From: Cris Di Sclafani Date: Wed, 5 Aug 2020 09:46:25 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.5.0 X-Git-Url: http://repos.xcallymotion.com/?a=commitdiff_plain;h=3597f3460a6833df515a450d383f4d040176ca42;p=motion2.git Built motion from commit (unavailable).|2.5.0 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index d03690a..5d3ea86 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -1 +1 @@ -define({ "name": "xCALLY Motion API", "version": "2.5.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 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": "2020-08-05T09:28:34.776Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); +define({ "name": "xCALLY Motion API", "version": "2.5.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 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": "2020-08-05T09:40:03.890Z", "url": "http://apidocjs.com", "version": "0.19.0" } }); diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 00d6ada..0cc9d45 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -1 +1 @@ -{ "name": "xCALLY Motion API", "version": "2.5.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 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": "2020-08-05T09:28:34.776Z", "url": "http://apidocjs.com", "version": "0.19.0" } } +{ "name": "xCALLY Motion API", "version": "2.5.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 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": "2020-08-05T09:40:03.890Z", "url": "http://apidocjs.com", "version": "0.19.0" } } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index bdfd683..8d4fbff 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 _0x6031=['integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','TEXT','sequelize','VIRTUAL','getDataValue','action','STRING','contactManager','integration','motionbar','jscripty','urlForward','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]'];(function(_0x4cac7a,_0x10e8bc){var _0x379f0e=function(_0x2e0cb5){while(--_0x2e0cb5){_0x4cac7a['push'](_0x4cac7a['shift']());}};_0x379f0e(++_0x10e8bc);}(_0x6031,0xd4));var _0x1603=function(_0x1d4b78,_0x211887){_0x1d4b78=_0x1d4b78-0x0;var _0x2baf74=_0x6031[_0x1d4b78];return _0x2baf74;};'use strict';var Sequelize=require(_0x1603('0x0'));module['exports']={'name':{'type':Sequelize[_0x1603('0x1')],'get':function(_0x2d8cb2){return this[_0x1603('0x2')](_0x1603('0x3'));}},'action':{'type':Sequelize[_0x1603('0x4')],'allowNull':![],'validate':{'isIn':{'args':[[_0x1603('0x5'),_0x1603('0x6'),_0x1603('0x7'),_0x1603('0x8'),_0x1603('0x9'),'browser','bot',_0x1603('0xa')]],'msg':_0x1603('0xb')}},'comment':_0x1603('0xb')},'data1':{'type':Sequelize[_0x1603('0x4')](0x1000),'comment':_0x1603('0xc')},'data2':{'type':Sequelize[_0x1603('0x4')](0x1000),'comment':_0x1603('0xd')},'data3':{'type':Sequelize['STRING'](0x1000),'comment':'motionbar[NULL,NULL,WinAppArguments]'},'data4':{'type':Sequelize[_0x1603('0x4')](0x1000)},'data5':{'type':Sequelize[_0x1603('0x4')](0x1000)},'data6':{'type':Sequelize[_0x1603('0x4')]},'data7':{'type':Sequelize[_0x1603('0xe')]}}; \ No newline at end of file +var _0x8b30=['Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','STRING','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','exports','VIRTUAL','getDataValue','action','contactManager','integration','jscripty','urlForward','browser','bot','script'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8b30,0xb5));var _0x08b3=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0x8b30[_0x1da04e];return _0xdd8c41;};'use strict';var Sequelize=require('sequelize');module[_0x08b3('0x0')]={'name':{'type':Sequelize[_0x08b3('0x1')],'get':function(_0x1029a8){return this[_0x08b3('0x2')](_0x08b3('0x3'));}},'action':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'isIn':{'args':[[_0x08b3('0x4'),_0x08b3('0x5'),'motionbar',_0x08b3('0x6'),_0x08b3('0x7'),_0x08b3('0x8'),_0x08b3('0x9'),_0x08b3('0xa')]],'msg':_0x08b3('0xb')}},'comment':_0x08b3('0xb')},'data1':{'type':Sequelize[_0x08b3('0xc')](0x1000),'comment':_0x08b3('0xd')},'data2':{'type':Sequelize['STRING'](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0x08b3('0xc')](0x1000),'comment':_0x08b3('0xe')},'data4':{'type':Sequelize[_0x08b3('0xc')](0x1000)},'data5':{'type':Sequelize['STRING'](0x1000)},'data6':{'type':Sequelize['STRING']},'data7':{'type':Sequelize[_0x08b3('0xf')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index ca8dcf9..28bc041 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 _0xb44c=['then','destroy','end','error','stack','name','body','Action','find','params','catch','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','set','Content-Range','apply','reject','save','update'];(function(_0x2ffd46,_0x51636a){var _0x5e442f=function(_0x167a97){while(--_0x167a97){_0x2ffd46['push'](_0x2ffd46['shift']());}};_0x5e442f(++_0x51636a);}(_0xb44c,0xbf));var _0xcb44=function(_0x375126,_0x514a8e){_0x375126=_0x375126-0x0;var _0x1f76bb=_0xb44c[_0x375126];return _0x1f76bb;};'use strict';var pdf=require(_0xcb44('0x0'));var emlformat=require(_0xcb44('0x1'));var rimraf=require(_0xcb44('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xcb44('0x3'));var moment=require(_0xcb44('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcb44('0x5'));var util=require(_0xcb44('0x6'));var path=require(_0xcb44('0x7'));var sox=require(_0xcb44('0x8'));var csv=require(_0xcb44('0x9'));var ejs=require(_0xcb44('0xa'));var fs=require('fs');var _=require(_0xcb44('0xb'));var squel=require(_0xcb44('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xcb44('0xd'));var toCsv=require(_0xcb44('0x9'));var querystring=require('querystring');var Papa=require(_0xcb44('0xe'));var Redis=require(_0xcb44('0xf'));var authService=require(_0xcb44('0x10'));var qs=require(_0xcb44('0x11'));var as=require(_0xcb44('0x12'));var hardwareService=require(_0xcb44('0x13'));var logger=require('../../config/logger')(_0xcb44('0x14'));var utils=require(_0xcb44('0x15'));var config=require(_0xcb44('0x16'));var db=require(_0xcb44('0x17'))['db'];function respondWithStatusCode(_0x45049d,_0x4eba3b){_0x4eba3b=_0x4eba3b||0xcc;return function(_0x330864){if(_0x330864){return _0x45049d[_0xcb44('0x18')](_0x4eba3b);}return _0x45049d['status'](_0x4eba3b)['end']();};}function respondWithResult(_0x5e1c75,_0x4d8bff){_0x4d8bff=_0x4d8bff||0xc8;return function(_0x4f2a93){if(_0x4f2a93){return _0x5e1c75[_0xcb44('0x19')](_0x4d8bff)[_0xcb44('0x1a')](_0x4f2a93);}};}function respondWithFilteredResult(_0x1941e5,_0x3e8490){return function(_0xa9c445){if(_0xa9c445){var _0x11f6cf=_0xa9c445['count'],_0x367214=_0x3e8490[_0xcb44('0x1b')],_0x519eb1=_0x3e8490[_0xcb44('0x1b')]+_0x3e8490['limit'],_0xe29e16;if(_0x519eb1>=_0x11f6cf){_0x519eb1=_0x11f6cf;_0xe29e16=0xc8;}else{_0xe29e16=0xce;}_0x1941e5[_0xcb44('0x19')](_0xe29e16);return _0x1941e5[_0xcb44('0x1c')](_0xcb44('0x1d'),_0x367214+'-'+_0x519eb1+'/'+_0x11f6cf)['json'](_0xa9c445);}return null;};}function patchUpdates(_0x4a6724){return function(_0x5af18b){try{jsonpatch[_0xcb44('0x1e')](_0x5af18b,_0x4a6724,!![]);}catch(_0x24fd8b){return BPromise[_0xcb44('0x1f')](_0x24fd8b);}return _0x5af18b[_0xcb44('0x20')]();};}function saveUpdates(_0x57ecbb,_0x1dad34){return function(_0x249c00){if(_0x249c00){return _0x249c00[_0xcb44('0x21')](_0x57ecbb)[_0xcb44('0x22')](function(_0x4a3325){return _0x4a3325;});}return null;};}function removeEntity(_0x39167a,_0x154b4d){return function(_0x2063e8){if(_0x2063e8){return _0x2063e8[_0xcb44('0x23')]()['then'](function(){_0x39167a[_0xcb44('0x19')](0xcc)[_0xcb44('0x24')]();});}};}function handleEntityNotFound(_0x2545e5,_0x55ea11){return function(_0x4d1dca){if(!_0x4d1dca){_0x2545e5[_0xcb44('0x18')](0x194);}return _0x4d1dca;};}function handleError(_0x3a3530,_0x25721e){_0x25721e=_0x25721e||0x1f4;return function(_0x3e5251){logger[_0xcb44('0x25')](_0x3e5251[_0xcb44('0x26')]);if(_0x3e5251[_0xcb44('0x27')]){delete _0x3e5251[_0xcb44('0x27')];}_0x3a3530[_0xcb44('0x19')](_0x25721e)['send'](_0x3e5251);};}exports[_0xcb44('0x21')]=function(_0x2530f9,_0x480436){if(_0x2530f9[_0xcb44('0x28')]['id']){delete _0x2530f9[_0xcb44('0x28')]['id'];}return db[_0xcb44('0x29')][_0xcb44('0x2a')]({'where':{'id':_0x2530f9[_0xcb44('0x2b')]['id']}})[_0xcb44('0x22')](handleEntityNotFound(_0x480436,null))[_0xcb44('0x22')](saveUpdates(_0x2530f9[_0xcb44('0x28')],null))[_0xcb44('0x22')](respondWithResult(_0x480436,null))[_0xcb44('0x2c')](handleError(_0x480436,null));};exports['destroy']=function(_0x3c1227,_0x2a86a9){return db[_0xcb44('0x29')]['find']({'where':{'id':_0x3c1227[_0xcb44('0x2b')]['id']}})[_0xcb44('0x22')](handleEntityNotFound(_0x2a86a9,null))[_0xcb44('0x22')](removeEntity(_0x2a86a9,null))[_0xcb44('0x2c')](handleError(_0x2a86a9,null));}; \ No newline at end of file +var _0x7f20=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','status','count','offset','limit','json','apply','reject','save','update','then','destroy','end','sendStatus','stack','name','send','body','Action','find','params','catch','html-pdf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','crypto','to-csv'];(function(_0x16a03f,_0x525b4b){var _0x4fca50=function(_0x402a4f){while(--_0x402a4f){_0x16a03f['push'](_0x16a03f['shift']());}};_0x4fca50(++_0x525b4b);}(_0x7f20,0x1c3));var _0x07f2=function(_0x2e7cb8,_0x58f24a){_0x2e7cb8=_0x2e7cb8-0x0;var _0x1b647d=_0x7f20[_0x2e7cb8];return _0x1b647d;};'use strict';var pdf=require(_0x07f2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x07f2('0x1'));var jsonpatch=require(_0x07f2('0x2'));var rp=require('request-promise');var moment=require(_0x07f2('0x3'));var BPromise=require(_0x07f2('0x4'));var Mustache=require(_0x07f2('0x5'));var util=require(_0x07f2('0x6'));var path=require(_0x07f2('0x7'));var sox=require(_0x07f2('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x07f2('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x07f2('0xa'));var querystring=require(_0x07f2('0xb'));var Papa=require(_0x07f2('0xc'));var Redis=require(_0x07f2('0xd'));var authService=require(_0x07f2('0xe'));var qs=require(_0x07f2('0xf'));var as=require(_0x07f2('0x10'));var hardwareService=require(_0x07f2('0x11'));var logger=require('../../config/logger')(_0x07f2('0x12'));var utils=require(_0x07f2('0x13'));var config=require('../../config/environment');var db=require(_0x07f2('0x14'))['db'];function respondWithStatusCode(_0x29fd9a,_0x142508){_0x142508=_0x142508||0xcc;return function(_0x475b75){if(_0x475b75){return _0x29fd9a['sendStatus'](_0x142508);}return _0x29fd9a[_0x07f2('0x15')](_0x142508)['end']();};}function respondWithResult(_0x15ad85,_0x41fb6c){_0x41fb6c=_0x41fb6c||0xc8;return function(_0x2bc5f3){if(_0x2bc5f3){return _0x15ad85[_0x07f2('0x15')](_0x41fb6c)['json'](_0x2bc5f3);}};}function respondWithFilteredResult(_0x5e4e50,_0xf1d62f){return function(_0x2a7eec){if(_0x2a7eec){var _0x3d0b06=_0x2a7eec[_0x07f2('0x16')],_0x283fb6=_0xf1d62f[_0x07f2('0x17')],_0x46be21=_0xf1d62f['offset']+_0xf1d62f[_0x07f2('0x18')],_0x551ece;if(_0x46be21>=_0x3d0b06){_0x46be21=_0x3d0b06;_0x551ece=0xc8;}else{_0x551ece=0xce;}_0x5e4e50['status'](_0x551ece);return _0x5e4e50['set']('Content-Range',_0x283fb6+'-'+_0x46be21+'/'+_0x3d0b06)[_0x07f2('0x19')](_0x2a7eec);}return null;};}function patchUpdates(_0x26ede7){return function(_0x531ec3){try{jsonpatch[_0x07f2('0x1a')](_0x531ec3,_0x26ede7,!![]);}catch(_0x1d1407){return BPromise[_0x07f2('0x1b')](_0x1d1407);}return _0x531ec3[_0x07f2('0x1c')]();};}function saveUpdates(_0x583f2f,_0x53cc40){return function(_0x542e9b){if(_0x542e9b){return _0x542e9b[_0x07f2('0x1d')](_0x583f2f)[_0x07f2('0x1e')](function(_0x570a7f){return _0x570a7f;});}return null;};}function removeEntity(_0x4ee206,_0x1e3d48){return function(_0xa51ad6){if(_0xa51ad6){return _0xa51ad6[_0x07f2('0x1f')]()[_0x07f2('0x1e')](function(){_0x4ee206['status'](0xcc)[_0x07f2('0x20')]();});}};}function handleEntityNotFound(_0x57a034,_0x3fa7e1){return function(_0x37b94c){if(!_0x37b94c){_0x57a034[_0x07f2('0x21')](0x194);}return _0x37b94c;};}function handleError(_0x546407,_0x1f8fcb){_0x1f8fcb=_0x1f8fcb||0x1f4;return function(_0x53580d){logger['error'](_0x53580d[_0x07f2('0x22')]);if(_0x53580d[_0x07f2('0x23')]){delete _0x53580d[_0x07f2('0x23')];}_0x546407[_0x07f2('0x15')](_0x1f8fcb)[_0x07f2('0x24')](_0x53580d);};}exports[_0x07f2('0x1d')]=function(_0x555b7b,_0x388f68){if(_0x555b7b['body']['id']){delete _0x555b7b[_0x07f2('0x25')]['id'];}return db[_0x07f2('0x26')][_0x07f2('0x27')]({'where':{'id':_0x555b7b[_0x07f2('0x28')]['id']}})[_0x07f2('0x1e')](handleEntityNotFound(_0x388f68,null))[_0x07f2('0x1e')](saveUpdates(_0x555b7b[_0x07f2('0x25')],null))[_0x07f2('0x1e')](respondWithResult(_0x388f68,null))[_0x07f2('0x29')](handleError(_0x388f68,null));};exports[_0x07f2('0x1f')]=function(_0x57213d,_0x2a3410){return db[_0x07f2('0x26')][_0x07f2('0x27')]({'where':{'id':_0x57213d[_0x07f2('0x28')]['id']}})[_0x07f2('0x1e')](handleEntityNotFound(_0x2a3410,null))['then'](removeEntity(_0x2a3410,null))[_0x07f2('0x29')](handleError(_0x2a3410,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 7951ed0..a7f555c 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 _0x46e5=['path','../../config/environment','./action.attributes','exports','define','Action','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x12a11e,_0x4c68d3){var _0x5bbd4f=function(_0x54906d){while(--_0x54906d){_0x12a11e['push'](_0x12a11e['shift']());}};_0x5bbd4f(++_0x4c68d3);}(_0x46e5,0x102));var _0x546e=function(_0x1bc132,_0x489a9b){_0x1bc132=_0x1bc132-0x0;var _0x1040e0=_0x46e5[_0x1bc132];return _0x1040e0;};'use strict';var _=require(_0x546e('0x0'));var util=require(_0x546e('0x1'));var logger=require(_0x546e('0x2'))('api');var moment=require(_0x546e('0x3'));var BPromise=require(_0x546e('0x4'));var rp=require(_0x546e('0x5'));var fs=require('fs');var path=require(_0x546e('0x6'));var rimraf=require('rimraf');var config=require(_0x546e('0x7'));var attributes=require(_0x546e('0x8'));module[_0x546e('0x9')]=function(_0x1fd1f0,_0x554345){return _0x1fd1f0[_0x546e('0xa')](_0x546e('0xb'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4067=['path','rimraf','../../config/environment','./action.attributes','exports','Action','lodash','util','api','moment','bluebird'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0x4067,0x10e));var _0x7406=function(_0x5957c9,_0x4a006b){_0x5957c9=_0x5957c9-0x0;var _0x1575ef=_0x4067[_0x5957c9];return _0x1575ef;};'use strict';var _=require(_0x7406('0x0'));var util=require(_0x7406('0x1'));var logger=require('../../config/logger')(_0x7406('0x2'));var moment=require(_0x7406('0x3'));var BPromise=require(_0x7406('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7406('0x5'));var rimraf=require(_0x7406('0x6'));var config=require(_0x7406('0x7'));var attributes=require(_0x7406('0x8'));module[_0x7406('0x9')]=function(_0x485f50,_0x5cee4a){return _0x485f50['define'](_0x7406('0xa'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index 35f7e04..68201ab 100644 --- a/server/api/action/action.rpc.js +++ b/server/api/action/action.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1bc2e3,_0x387c93){var _0x329a56=function(_0x41e765){while(--_0x41e765){_0x1bc2e3['push'](_0x1bc2e3['shift']());}};_0x329a56(++_0x387c93);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0xb7e7[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xa9e0=['http','info','Action,\x20%s,\x20%s','request\x20sent','debug','Action,\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(_0xc4a12c,_0x184362){var _0x3c6e08=function(_0x3ad34e){while(--_0x3ad34e){_0xc4a12c['push'](_0xc4a12c['shift']());}};_0x3c6e08(++_0x184362);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1da04e,_0x31024b){_0x1da04e=_0x1da04e-0x0;var _0xdd8c41=_0xa9e0[_0x1da04e];return _0xdd8c41;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var 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/action/index.js b/server/api/action/index.js index 2ddfa72..1efeda5 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 _0x5d5e=['update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','/:id','isAuthenticated'];(function(_0x5584fd,_0x54f3f0){var _0x1a3ded=function(_0x14595c){while(--_0x14595c){_0x5584fd['push'](_0x5584fd['shift']());}};_0x1a3ded(++_0x54f3f0);}(_0x5d5e,0x1e4));var _0xe5d5=function(_0x263c72,_0x3fc7c0){_0x263c72=_0x263c72-0x0;var _0x48a691=_0x5d5e[_0x263c72];return _0x48a691;};'use strict';var multer=require('multer');var util=require(_0xe5d5('0x0'));var path=require('path');var timeout=require(_0xe5d5('0x1'));var express=require(_0xe5d5('0x2'));var router=express[_0xe5d5('0x3')]();var auth=require(_0xe5d5('0x4'));var interaction=require(_0xe5d5('0x5'));var config=require('../../config/environment');var controller=require('./action.controller');router['put'](_0xe5d5('0x6'),auth[_0xe5d5('0x7')](),controller[_0xe5d5('0x8')]);router[_0xe5d5('0x9')](_0xe5d5('0x6'),auth[_0xe5d5('0x7')](),controller[_0xe5d5('0xa')]);module[_0xe5d5('0xb')]=router; \ No newline at end of file +var _0x9a33=['Router','../../components/interaction/service','../../config/environment','./action.controller','put','/:id','isAuthenticated','destroy','path','connect-timeout','express'];(function(_0x41d43c,_0x19377d){var _0x84821f=function(_0x1dea0b){while(--_0x1dea0b){_0x41d43c['push'](_0x41d43c['shift']());}};_0x84821f(++_0x19377d);}(_0x9a33,0xfa));var _0x39a3=function(_0x195802,_0x3edb16){_0x195802=_0x195802-0x0;var _0x3bb28f=_0x9a33[_0x195802];return _0x3bb28f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x39a3('0x0'));var timeout=require(_0x39a3('0x1'));var express=require(_0x39a3('0x2'));var router=express[_0x39a3('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x39a3('0x4'));var config=require(_0x39a3('0x5'));var controller=require(_0x39a3('0x6'));router[_0x39a3('0x7')](_0x39a3('0x8'),auth[_0x39a3('0x9')](),controller['update']);router['delete'](_0x39a3('0x8'),auth[_0x39a3('0x9')](),controller[_0x39a3('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index 7b3215e..0586f54 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 _0x3bf7=['exports','STRING','TEXT'];(function(_0x18b74f,_0x11a7ce){var _0x2df4ba=function(_0x24a5d4){while(--_0x24a5d4){_0x18b74f['push'](_0x18b74f['shift']());}};_0x2df4ba(++_0x11a7ce);}(_0x3bf7,0x117));var _0x73bf=function(_0x3ca50d,_0x439a9e){_0x3ca50d=_0x3ca50d-0x0;var _0x3b338f=_0x3bf7[_0x3ca50d];return _0x3b338f;};'use strict';var Sequelize=require('sequelize');module[_0x73bf('0x0')]={'name':{'type':Sequelize[_0x73bf('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x73bf('0x1')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize[_0x73bf('0x2')]}}; \ No newline at end of file +var _0x8885=['TEXT','sequelize','exports','STRING'];(function(_0x286a7a,_0x223ef0){var _0x4accfc=function(_0x225cbe){while(--_0x225cbe){_0x286a7a['push'](_0x286a7a['shift']());}};_0x4accfc(++_0x223ef0);}(_0x8885,0xb1));var _0x5888=function(_0x494f6e,_0xe7484){_0x494f6e=_0x494f6e-0x0;var _0x28fb81=_0x8885[_0x494f6e];return _0x28fb81;};'use strict';var Sequelize=require(_0x5888('0x0'));module[_0x5888('0x1')]={'name':{'type':Sequelize[_0x5888('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x5888('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x5888('0x3')]},'joins':{'type':Sequelize[_0x5888('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index 5cbd61d..86f617f 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 _0x4927=['model','query','filters','intersection','fields','length','hasOwnProperty','sort','filter','where','merge','map','options','includeAll','include','findAll','rows','catch','show','params','keys','rawAttributes','attributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','join','right_join','cross_join','SUM(%s)','COUNT(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','value','getFields','Sequelize','ValidationErrorItem','AnalyticMetric','keyBy','select','from','table','MetricId','metric','field','replace','groupBy','orderBy','order','DESC','alias','joins','foreignTable','foreignKey','parentKey','conditions','parse','clone','toString','sequelize','SELECT','COUNT(DISTINCT\x20%s)','MAX(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','Please\x20insert\x20at\x20least\x20one\x20field','function','format','%s.%s\x20=\x20%s.%s','debug','Limited\x20Query:','No\x20available\x20data','output','web','fullPath','%s-%s.%s','generate','csv','custom','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','info','Run\x20Query:','child_process','../../components/export/','countTable','COUNT(*)','QueryTypes','run','runReport','left_join','IS\x20NULL','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','get','CustomReports','then','stack','name','send','index','AnalyticCustomReport','fieldName','type','key'];(function(_0x1f8ddb,_0x182d4c){var _0x460b62=function(_0x1e8d85){while(--_0x1e8d85){_0x1f8ddb['push'](_0x1f8ddb['shift']());}};_0x460b62(++_0x182d4c);}(_0x4927,0x122));var _0x7492=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4927[_0x397e5f];return _0x5302b8;};'use strict';var pdf=require(_0x7492('0x0'));var emlformat=require(_0x7492('0x1'));var rimraf=require(_0x7492('0x2'));var zipdir=require(_0x7492('0x3'));var jsonpatch=require(_0x7492('0x4'));var rp=require(_0x7492('0x5'));var moment=require(_0x7492('0x6'));var BPromise=require(_0x7492('0x7'));var Mustache=require(_0x7492('0x8'));var util=require(_0x7492('0x9'));var path=require(_0x7492('0xa'));var sox=require(_0x7492('0xb'));var csv=require(_0x7492('0xc'));var ejs=require(_0x7492('0xd'));var fs=require('fs');var _=require(_0x7492('0xe'));var squel=require(_0x7492('0xf'));var crypto=require(_0x7492('0x10'));var jsforce=require(_0x7492('0x11'));var deskjs=require(_0x7492('0x12'));var toCsv=require(_0x7492('0xc'));var querystring=require(_0x7492('0x13'));var Papa=require(_0x7492('0x14'));var Redis=require('ioredis');var authService=require(_0x7492('0x15'));var qs=require(_0x7492('0x16'));var as=require(_0x7492('0x17'));var hardwareService=require(_0x7492('0x18'));var logger=require(_0x7492('0x19'))(_0x7492('0x1a'));var utils=require('../../config/utils');var config=require(_0x7492('0x1b'));var db=require(_0x7492('0x1c'))['db'];function respondWithStatusCode(_0x4c52c7,_0x3a5372){_0x3a5372=_0x3a5372||0xcc;return function(_0x32600e){if(_0x32600e){return _0x4c52c7[_0x7492('0x1d')](_0x3a5372);}return _0x4c52c7[_0x7492('0x1e')](_0x3a5372)[_0x7492('0x1f')]();};}function respondWithResult(_0x196e54,_0x5e820e){_0x5e820e=_0x5e820e||0xc8;return function(_0x1ed6f2){if(_0x1ed6f2){return _0x196e54[_0x7492('0x1e')](_0x5e820e)[_0x7492('0x20')](_0x1ed6f2);}};}function respondWithFilteredResult(_0x5b8463,_0x120b01){return function(_0x10d56d){if(_0x10d56d){var _0x43e621=_0x10d56d[_0x7492('0x21')],_0x51992a=_0x120b01[_0x7492('0x22')],_0x53566c=_0x120b01[_0x7492('0x22')]+_0x120b01[_0x7492('0x23')],_0x361613;if(_0x53566c>=_0x43e621){_0x53566c=_0x43e621;_0x361613=0xc8;}else{_0x361613=0xce;}_0x5b8463[_0x7492('0x1e')](_0x361613);return _0x5b8463[_0x7492('0x24')](_0x7492('0x25'),_0x51992a+'-'+_0x53566c+'/'+_0x43e621)['json'](_0x10d56d);}return null;};}function patchUpdates(_0x3eafcf){return function(_0x2d2090){try{jsonpatch[_0x7492('0x26')](_0x2d2090,_0x3eafcf,!![]);}catch(_0x6e2c8e){return BPromise['reject'](_0x6e2c8e);}return _0x2d2090['save']();};}function saveUpdates(_0x14d530,_0x32bafc){return function(_0x199718){if(_0x199718){return _0x199718[_0x7492('0x27')](_0x14d530)['then'](function(_0x5a0a8e){return _0x5a0a8e;});}return null;};}function removeEntity(_0x349dd6,_0x27e3cb){return function(_0xdf8929){if(_0xdf8929){return _0xdf8929[_0x7492('0x28')]()['then'](function(){var _0x29003a=_0xdf8929[_0x7492('0x29')]({'plain':!![]});var _0x4116e5=_0x7492('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x4116e5,'resourceId':_0x29003a['id']}})[_0x7492('0x2b')](function(){return _0xdf8929;});})[_0x7492('0x2b')](function(){_0x349dd6[_0x7492('0x1e')](0xcc)[_0x7492('0x1f')]();});}};}function handleEntityNotFound(_0x597c7d,_0x5d321a){return function(_0x25562a){if(!_0x25562a){_0x597c7d[_0x7492('0x1d')](0x194);}return _0x25562a;};}function handleError(_0x126ffb,_0x4ee9f0){_0x4ee9f0=_0x4ee9f0||0x1f4;return function(_0x5f16d0){logger['error'](_0x5f16d0[_0x7492('0x2c')]);if(_0x5f16d0['name']){delete _0x5f16d0[_0x7492('0x2d')];}_0x126ffb['status'](_0x4ee9f0)[_0x7492('0x2e')](_0x5f16d0);};}exports[_0x7492('0x2f')]=function(_0x2f1418,_0x391021){var _0x197012={},_0xcd3a58={},_0x35514e={'count':0x0,'rows':[]};var _0x2a2c66=_['map'](db[_0x7492('0x30')]['rawAttributes'],function(_0x5b4bad){return{'name':_0x5b4bad[_0x7492('0x31')],'type':_0x5b4bad[_0x7492('0x32')][_0x7492('0x33')]};});_0xcd3a58[_0x7492('0x34')]=_['map'](_0x2a2c66,_0x7492('0x2d'));_0xcd3a58[_0x7492('0x35')]=_['keys'](_0x2f1418[_0x7492('0x35')]);_0xcd3a58[_0x7492('0x36')]=_[_0x7492('0x37')](_0xcd3a58[_0x7492('0x34')],_0xcd3a58[_0x7492('0x35')]);_0x197012['attributes']=_[_0x7492('0x37')](_0xcd3a58[_0x7492('0x34')],qs[_0x7492('0x38')](_0x2f1418[_0x7492('0x35')]['fields']));_0x197012['attributes']=_0x197012['attributes'][_0x7492('0x39')]?_0x197012['attributes']:_0xcd3a58[_0x7492('0x34')];if(!_0x2f1418[_0x7492('0x35')][_0x7492('0x3a')]('nolimit')){_0x197012[_0x7492('0x23')]=qs[_0x7492('0x23')](_0x2f1418[_0x7492('0x35')]['limit']);_0x197012[_0x7492('0x22')]=qs[_0x7492('0x22')](_0x2f1418[_0x7492('0x35')][_0x7492('0x22')]);}_0x197012['order']=qs['sort'](_0x2f1418[_0x7492('0x35')][_0x7492('0x3b')]);_0x197012['where']=qs[_0x7492('0x36')](_['pick'](_0x2f1418[_0x7492('0x35')],_0xcd3a58['filters']));if(_0x2f1418[_0x7492('0x35')][_0x7492('0x3c')]){_0x197012[_0x7492('0x3d')]=_[_0x7492('0x3e')](_0x197012[_0x7492('0x3d')],{'$or':_[_0x7492('0x3f')](_0x2a2c66,function(_0x414fa7){if(_0x414fa7[_0x7492('0x32')]!=='VIRTUAL'){var _0x7db4ab={};_0x7db4ab[_0x414fa7[_0x7492('0x2d')]]={'$like':'%'+_0x2f1418['query'][_0x7492('0x3c')]+'%'};return _0x7db4ab;}})});}_0x197012=_[_0x7492('0x3e')]({},_0x197012,_0x2f1418[_0x7492('0x40')]);var _0x1d300a={'where':_0x197012[_0x7492('0x3d')]};return db[_0x7492('0x30')][_0x7492('0x21')](_0x1d300a)[_0x7492('0x2b')](function(_0x47936e){_0x35514e['count']=_0x47936e;if(_0x2f1418[_0x7492('0x35')][_0x7492('0x41')]){_0x197012[_0x7492('0x42')]=[{'all':!![]}];}return db[_0x7492('0x30')][_0x7492('0x43')](_0x197012);})[_0x7492('0x2b')](function(_0x46e0de){_0x35514e[_0x7492('0x44')]=_0x46e0de;return _0x35514e;})['then'](respondWithFilteredResult(_0x391021,_0x197012))[_0x7492('0x45')](handleError(_0x391021,null));};exports[_0x7492('0x46')]=function(_0x1e9ef2,_0x584912){var _0x1bdd5b={'raw':![],'where':{'id':_0x1e9ef2[_0x7492('0x47')]['id']}},_0x1f1016={};_0x1f1016[_0x7492('0x34')]=_[_0x7492('0x48')](db['AnalyticCustomReport'][_0x7492('0x49')]);_0x1f1016[_0x7492('0x35')]=_[_0x7492('0x48')](_0x1e9ef2[_0x7492('0x35')]);_0x1f1016['filters']=_[_0x7492('0x37')](_0x1f1016[_0x7492('0x34')],_0x1f1016[_0x7492('0x35')]);_0x1bdd5b[_0x7492('0x4a')]=_[_0x7492('0x37')](_0x1f1016[_0x7492('0x34')],qs['fields'](_0x1e9ef2['query'][_0x7492('0x38')]));_0x1bdd5b[_0x7492('0x4a')]=_0x1bdd5b[_0x7492('0x4a')][_0x7492('0x39')]?_0x1bdd5b[_0x7492('0x4a')]:_0x1f1016[_0x7492('0x34')];if(_0x1e9ef2[_0x7492('0x35')][_0x7492('0x41')]){_0x1bdd5b['include']=[{'all':!![]}];}_0x1bdd5b=_[_0x7492('0x3e')]({},_0x1bdd5b,_0x1e9ef2[_0x7492('0x40')]);return db['AnalyticCustomReport'][_0x7492('0x4b')](_0x1bdd5b)[_0x7492('0x2b')](handleEntityNotFound(_0x584912,null))[_0x7492('0x2b')](respondWithResult(_0x584912,null))[_0x7492('0x45')](handleError(_0x584912,null));};exports[_0x7492('0x4c')]=function(_0x5d7c0e,_0x1d66ea){return db[_0x7492('0x30')][_0x7492('0x4c')](_0x5d7c0e[_0x7492('0x4d')],{})['then'](function(_0x118348){var _0x5ae620=_0x5d7c0e[_0x7492('0x4e')][_0x7492('0x29')]({'plain':!![]});if(!_0x5ae620)throw new Error(_0x7492('0x4f'));if(_0x5ae620[_0x7492('0x50')]===_0x7492('0x4e')){var _0x42c4aa=_0x118348[_0x7492('0x29')]({'plain':!![]});var _0x18dec6=_0x7492('0x51');return db[_0x7492('0x52')]['find']({'where':{'name':_0x18dec6,'userProfileId':_0x5ae620[_0x7492('0x53')]},'raw':!![]})[_0x7492('0x2b')](function(_0x23c9ff){if(_0x23c9ff&&_0x23c9ff[_0x7492('0x54')]===0x0){return db[_0x7492('0x55')][_0x7492('0x4c')]({'name':_0x42c4aa[_0x7492('0x2d')],'resourceId':_0x42c4aa['id'],'type':_0x7492('0x2a'),'sectionId':_0x23c9ff['id']},{})[_0x7492('0x2b')](function(){return _0x118348;});}else{return _0x118348;}})[_0x7492('0x45')](function(_0x400c93){logger[_0x7492('0x56')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x400c93);throw _0x400c93;});}return _0x118348;})[_0x7492('0x2b')](respondWithResult(_0x1d66ea,0xc9))[_0x7492('0x45')](handleError(_0x1d66ea,null));};exports[_0x7492('0x27')]=function(_0x533059,_0x39cb66){if(_0x533059['body']['id']){delete _0x533059[_0x7492('0x4d')]['id'];}return db['AnalyticCustomReport'][_0x7492('0x4b')]({'where':{'id':_0x533059['params']['id']}})[_0x7492('0x2b')](handleEntityNotFound(_0x39cb66,null))[_0x7492('0x2b')](saveUpdates(_0x533059[_0x7492('0x4d')],null))[_0x7492('0x2b')](respondWithResult(_0x39cb66,null))[_0x7492('0x45')](handleError(_0x39cb66,null));};exports[_0x7492('0x28')]=function(_0x50c48b,_0x400291){return db['AnalyticCustomReport'][_0x7492('0x4b')]({'where':{'id':_0x50c48b[_0x7492('0x47')]['id']}})[_0x7492('0x2b')](handleEntityNotFound(_0x400291,null))['then'](removeEntity(_0x400291,null))[_0x7492('0x45')](handleError(_0x400291,null));};exports['preview']=function(_0x3375a1,_0x47fe5a){var _0x53be96=0xa;var _0x3e088d=[_0x7492('0x57'),'left_join',_0x7492('0x58'),_0x7492('0x59')];var _0x56c00f={'SUM':_0x7492('0x5a'),'COUNT':_0x7492('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x7492('0x5c'),'AVG':_0x7492('0x5d'),'GROUP_CONCAT':_0x7492('0x5e'),'GROUP_CONCAT ASC':_0x7492('0x5f'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0xb82db0={'SEC_TO_TIME':_0x7492('0x60'),'DATE':_0x7492('0x61'),'HOUR':'HOUR(%s)','ROUND':_0x7492('0x62'),'UNIX_TIMESTAMP':_0x7492('0x63')};var _0x2d4d51=function(_0x5add8b){return!_[_0x7492('0x64')](['IS\x20NULL',_0x7492('0x65'),_0x7492('0x66'),_0x7492('0x67')],_0x5add8b);};var _0x96828e=function(_0x35c67a){if(!_0x35c67a||!_0x35c67a[_0x7492('0x68')][_0x7492('0x39')]){return'';}for(var _0x4ee7ce='(',_0x21478d=0x0;_0x21478d<_0x35c67a['rules']['length'];_0x21478d+=0x1){_0x21478d>0x0&&(_0x4ee7ce+='\x20'+_0x35c67a[_0x7492('0x69')]+'\x20');_0x4ee7ce+=_0x35c67a[_0x7492('0x68')][_0x21478d][_0x7492('0x6a')]?_0x96828e(_0x35c67a['rules'][_0x21478d][_0x7492('0x6a')]):_0x35c67a['rules'][_0x21478d]['field']+'\x20'+_0x35c67a[_0x7492('0x68')][_0x21478d][_0x7492('0x6b')]+(_0x2d4d51(_0x35c67a[_0x7492('0x68')][_0x21478d][_0x7492('0x6b')])?'\x20'+_0x35c67a[_0x7492('0x68')][_0x21478d][_0x7492('0x6c')]:'');}return _0x4ee7ce+')';};var _0x5cea1d={'where':{'id':_0x3375a1[_0x7492('0x47')]['id']}},_0x1e8a4c,_0x547450,_0x1951f7,_0xdd7afa,_0x54a390;_0x5cea1d=_[_0x7492('0x3e')]({},_0x5cea1d,_0x3375a1[_0x7492('0x40')]);return db['AnalyticCustomReport'][_0x7492('0x4b')](_0x5cea1d)[_0x7492('0x2b')](function(_0xc29a08){if(_0xc29a08){_0x1e8a4c=_0xc29a08;return _0xc29a08[_0x7492('0x6d')]();}return null;})[_0x7492('0x2b')](function(_0x5828f6){if(_0x5828f6){if(!_0x5828f6[_0x7492('0x39')]){throw new db[(_0x7492('0x6e'))][(_0x7492('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x547450=_0x5828f6;return db[_0x7492('0x70')][_0x7492('0x43')]({'raw':!![]});}return null;})['then'](function(_0x3b9523){if(_0x3b9523){_0x1951f7=_[_0x7492('0x71')](_0x3b9523,'id');var _0x1b211a;var _0x15f16d=squel[_0x7492('0x72')]();_0x15f16d[_0x7492('0x73')](_0x1e8a4c[_0x7492('0x74')]);for(var _0x59e2b7=0x0;_0x59e2b7<_0x547450['length'];_0x59e2b7+=0x1){_0x1b211a=_0x547450[_0x59e2b7][_0x7492('0x75')]?_0x1951f7[_0x547450[_0x59e2b7][_0x7492('0x75')]][_0x7492('0x76')]:_0x547450[_0x59e2b7][_0x7492('0x77')];_0x1b211a=_0x547450[_0x59e2b7]['function']?_[_0x7492('0x78')](_0x56c00f[_0x547450[_0x59e2b7]['function']],'%s',_0x1b211a):_0x1b211a;_0x1b211a=_0x547450[_0x59e2b7]['format']?_[_0x7492('0x78')](_0xb82db0[_0x547450[_0x59e2b7]['format']],'%s',_0x1b211a):_0x1b211a;if(_0x547450[_0x59e2b7][_0x7492('0x79')]){_0x15f16d[_0x7492('0x6a')](_0x1b211a);}_0x547450[_0x59e2b7][_0x7492('0x7a')]&&_0x15f16d[_0x7492('0x7b')](_0x1b211a,_0x547450[_0x59e2b7][_0x7492('0x7a')]===_0x7492('0x7c')?![]:!![]);_0x15f16d[_0x7492('0x77')](_0x1b211a,_0x547450[_0x59e2b7][_0x7492('0x7d')]||_0x1b211a);}if(_0x1e8a4c['joins']){_0x1e8a4c[_0x7492('0x7e')]=JSON['parse'](_0x1e8a4c[_0x7492('0x7e')]);for(var _0x1e0f8b=0x0;_0x1e0f8b<_0x1e8a4c[_0x7492('0x7e')]['length'];_0x1e0f8b+=0x1){if(_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b][_0x7492('0x32')]&&_[_0x7492('0x64')](_0x3e088d,_0x1e8a4c['joins'][_0x1e0f8b][_0x7492('0x32')])&&_0x1e8a4c['joins'][_0x1e0f8b]['parentKey']&&_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b][_0x7492('0x7f')]&&_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b][_0x7492('0x80')]){_0x15f16d[_0x1e8a4c['joins'][_0x1e0f8b]['type']](_0x1e8a4c['joins'][_0x1e0f8b][_0x7492('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x1e8a4c[_0x7492('0x74')],_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b][_0x7492('0x81')],_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b]['foreignTable'],_0x1e8a4c[_0x7492('0x7e')][_0x1e0f8b]['foreignKey']));}}}if(_0x1e8a4c[_0x7492('0x82')]){_0x1e8a4c['conditions']=JSON[_0x7492('0x83')](_0x1e8a4c['conditions']);_0x15f16d['where'](_0x96828e(_0x1e8a4c['conditions']['group']));}_0x54a390=_0x15f16d[_0x7492('0x84')]();_0x15f16d[_0x7492('0x23')](_0x53be96);_0x15f16d[_0x7492('0x22')](0x0);logger['debug']('Limited\x20Query:',_0x15f16d[_0x7492('0x85')]());return db[_0x7492('0x86')]['query'](_0x15f16d[_0x7492('0x85')](),{'type':db[_0x7492('0x86')]['QueryTypes'][_0x7492('0x87')]});}})['then'](respondWithResult(_0x47fe5a,null))['catch'](handleError(_0x47fe5a,null));};function runReport(_0x4ab18c,_0x1099b0,_0x58fdc6){var _0x131ed9=_0x1099b0[_0x7492('0x2d')];var _0x3c1eb6=0xa;var _0x4458ec=[_0x7492('0x57'),'left_join','right_join',_0x7492('0x59')];var _0x8ebd0={'SUM':'SUM(%s)','COUNT':_0x7492('0x5b'),'COUNT DISTINCT':_0x7492('0x88'),'MAX':_0x7492('0x89'),'MIN':_0x7492('0x5c'),'AVG':_0x7492('0x5d'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x7492('0x5f'),'GROUP_CONCAT DESC':_0x7492('0x8a')};var _0x64dada={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x7492('0x61'),'HOUR':_0x7492('0x8b'),'ROUND':_0x7492('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x3ca658=function(_0x3016ba){return!_[_0x7492('0x64')](['IS\x20NULL',_0x7492('0x65'),_0x7492('0x66'),_0x7492('0x67')],_0x3016ba);};var _0x42a1ed=function(_0x20a809){if(!_0x20a809||!_0x20a809[_0x7492('0x68')]['length']){return'';}for(var _0x51dd3a='(',_0x5be141=0x0;_0x5be141<_0x20a809[_0x7492('0x68')][_0x7492('0x39')];_0x5be141+=0x1){_0x5be141>0x0&&(_0x51dd3a+='\x20'+_0x20a809[_0x7492('0x69')]+'\x20');_0x51dd3a+=_0x20a809[_0x7492('0x68')][_0x5be141][_0x7492('0x6a')]?_0x42a1ed(_0x20a809['rules'][_0x5be141]['group']):_0x20a809['rules'][_0x5be141][_0x7492('0x77')]+'\x20'+_0x20a809[_0x7492('0x68')][_0x5be141][_0x7492('0x6b')]+(_0x3ca658(_0x20a809[_0x7492('0x68')][_0x5be141][_0x7492('0x6b')])?'\x20'+_0x20a809[_0x7492('0x68')][_0x5be141][_0x7492('0x6c')]:'');}return _0x51dd3a+')';};var _0x2b1748={'where':{'id':_0x4ab18c['id']}},_0x5c2112,_0x5d413c,_0x4b238d,_0x3040da,_0x46f7a7;_0x2b1748=_[_0x7492('0x3e')]({},_0x2b1748,_0x58fdc6);return db[_0x7492('0x30')][_0x7492('0x4b')](_0x2b1748)['then'](function(_0x4c7c75){if(_0x4c7c75){_0x5c2112=_0x4c7c75;return _0x4c7c75['getFields']();}return null;})[_0x7492('0x2b')](function(_0x5300ad){if(_0x5300ad){if(!_0x5300ad[_0x7492('0x39')]){throw new db[(_0x7492('0x6e'))][(_0x7492('0x6f'))](_0x7492('0x8c'),0x193);}_0x5d413c=_0x5300ad;return db[_0x7492('0x70')][_0x7492('0x43')]({'raw':!![]});}return null;})[_0x7492('0x2b')](function(_0x33e001){if(_0x33e001){_0x4b238d=_[_0x7492('0x71')](_0x33e001,'id');var _0x29a0c6;var _0x406e30=squel[_0x7492('0x72')]();_0x406e30[_0x7492('0x73')](_0x5c2112[_0x7492('0x74')]);for(var _0x289484=0x0;_0x289484<_0x5d413c['length'];_0x289484+=0x1){_0x29a0c6=_0x5d413c[_0x289484][_0x7492('0x75')]?_0x4b238d[_0x5d413c[_0x289484][_0x7492('0x75')]][_0x7492('0x76')]:_0x5d413c[_0x289484][_0x7492('0x77')];_0x29a0c6=_0x5d413c[_0x289484]['function']?_[_0x7492('0x78')](_0x8ebd0[_0x5d413c[_0x289484][_0x7492('0x8d')]],'%s',_0x29a0c6):_0x29a0c6;_0x29a0c6=_0x5d413c[_0x289484][_0x7492('0x8e')]?_['replace'](_0x64dada[_0x5d413c[_0x289484][_0x7492('0x8e')]],'%s',_0x29a0c6):_0x29a0c6;if(_0x5d413c[_0x289484][_0x7492('0x79')]){_0x406e30[_0x7492('0x6a')](_0x29a0c6);}_0x5d413c[_0x289484][_0x7492('0x7a')]&&_0x406e30[_0x7492('0x7b')](_0x29a0c6,_0x5d413c[_0x289484][_0x7492('0x7a')]===_0x7492('0x7c')?![]:!![]);_0x406e30[_0x7492('0x77')](_0x29a0c6,_0x5d413c[_0x289484][_0x7492('0x7d')]||_0x29a0c6);}if(_0x5c2112['joins']){_0x5c2112[_0x7492('0x7e')]=JSON[_0x7492('0x83')](_0x5c2112['joins']);for(var _0x22f3dd=0x0;_0x22f3dd<_0x5c2112[_0x7492('0x7e')]['length'];_0x22f3dd+=0x1){if(_0x5c2112['joins'][_0x22f3dd]['type']&&_['includes'](_0x4458ec,_0x5c2112[_0x7492('0x7e')][_0x22f3dd]['type'])&&_0x5c2112['joins'][_0x22f3dd][_0x7492('0x81')]&&_0x5c2112['joins'][_0x22f3dd]['foreignTable']&&_0x5c2112['joins'][_0x22f3dd][_0x7492('0x80')]){_0x406e30[_0x5c2112['joins'][_0x22f3dd][_0x7492('0x32')]](_0x5c2112['joins'][_0x22f3dd][_0x7492('0x7f')],null,util[_0x7492('0x8e')](_0x7492('0x8f'),_0x5c2112[_0x7492('0x74')],_0x5c2112['joins'][_0x22f3dd][_0x7492('0x81')],_0x5c2112['joins'][_0x22f3dd][_0x7492('0x7f')],_0x5c2112[_0x7492('0x7e')][_0x22f3dd][_0x7492('0x80')]));}}}if(_0x5c2112[_0x7492('0x82')]){_0x5c2112[_0x7492('0x82')]=JSON[_0x7492('0x83')](_0x5c2112[_0x7492('0x82')]);_0x406e30[_0x7492('0x3d')](_0x42a1ed(_0x5c2112[_0x7492('0x82')][_0x7492('0x6a')]));}_0x46f7a7=_0x406e30['clone']();_0x406e30['limit'](_0x3c1eb6);_0x406e30[_0x7492('0x22')](0x0);logger[_0x7492('0x90')](_0x7492('0x91'),_0x406e30['toString']());return db[_0x7492('0x86')][_0x7492('0x35')](_0x406e30['toString'](),{'type':db[_0x7492('0x86')]['QueryTypes'][_0x7492('0x87')]});}})[_0x7492('0x2b')](function(_0x1dca57){if(!_0x1dca57[_0x7492('0x39')]){throw new db[(_0x7492('0x6e'))][(_0x7492('0x6f'))](_0x7492('0x92'),0xcc);}if(_0x1099b0[_0x7492('0x93')]===_0x7492('0x94')){return null;}var _0x2112c1=_[_0x7492('0x3e')](_0x1099b0,{'name':_0x1099b0[_0x7492('0x95')]||_0x1099b0[_0x7492('0x2d')]||_0x5c2112[_0x7492('0x2d')],'basename':_0x131ed9,'savename':util[_0x7492('0x8e')](_0x7492('0x96'),_0x1099b0[_0x7492('0x2d')]||_0x5c2112[_0x7492('0x2d')],require('randomstring')[_0x7492('0x97')](0x4),_0x1099b0[_0x7492('0x93')]||_0x7492('0x98')),'reportId':_0x5c2112['id'],'reportType':_0x7492('0x99')});return db[_0x7492('0x9a')]['create'](_0x2112c1,{'raw':!![]});})[_0x7492('0x2b')](function(_0x58ca3f){if(_0x5c2112[_0x7492('0x74')]===_0x7492('0x9b')){_0x46f7a7['where'](_0x5c2112['table']+_0x7492('0x9c'),_0x1099b0[_0x7492('0x9d')],_0x1099b0['endDate']);}else{_0x46f7a7[_0x7492('0x3d')](_0x5c2112['table']+_0x7492('0x9e'),_0x1099b0[_0x7492('0x9d')],_0x1099b0[_0x7492('0x9f')]);}if(_0x58ca3f){logger[_0x7492('0xa0')](_0x7492('0xa1'),_0x46f7a7[_0x7492('0x85')]());require(_0x7492('0xa2'))['fork'](path[_0x7492('0x57')](__dirname,_0x7492('0xa3'),_0x58ca3f[_0x7492('0x93')]),[_0x58ca3f['id'],_0x46f7a7[_0x7492('0x85')](),path[_0x7492('0x57')](__dirname,'../../files/reports',_0x58ca3f['savename']),_0x131ed9]);return _0x58ca3f;}else{var _0x5c62fc=squel[_0x7492('0x72')]();_0x5c62fc[_0x7492('0x73')]('('+_0x46f7a7[_0x7492('0x85')]()+')',_0x7492('0xa4'));_0x5c62fc['field'](_0x7492('0xa5'),_0x7492('0x21'));_0x46f7a7[_0x7492('0x23')](_0x1099b0[_0x7492('0x23')]||_0x3c1eb6);_0x46f7a7[_0x7492('0x22')](_0x1099b0[_0x7492('0x22')]||0x0);return db['sequelize'][_0x7492('0x35')](_0x5c62fc['toString'](),{'type':db[_0x7492('0x86')][_0x7492('0xa6')][_0x7492('0x87')]})['then'](function(_0x59abdb){if(!_0x59abdb[_0x7492('0x39')]){_0x3040da=0x0;}else{_0x3040da=_0x59abdb[0x0][_0x7492('0x21')]||0x0;}return db[_0x7492('0x86')][_0x7492('0x35')](_0x46f7a7[_0x7492('0x85')](),{'type':db[_0x7492('0x86')][_0x7492('0xa6')][_0x7492('0x87')]});})[_0x7492('0x2b')](function(_0x176b64){return{'rows':_0x176b64||[],'count':_0x3040da};});}});}exports[_0x7492('0xa7')]=function(_0x2b1cee,_0x222d4a){return runReport(_0x2b1cee[_0x7492('0x47')],_0x2b1cee['query'],_0x2b1cee[_0x7492('0x40')])['then'](respondWithResult(_0x222d4a,null))[_0x7492('0x45')](handleError(_0x222d4a,null));};exports[_0x7492('0xa8')]=runReport;exports[_0x7492('0x35')]=function(_0x2a8f69,_0x2ca3ef){var _0x2f5093=0xa;var _0x78b160=['join',_0x7492('0xa9'),_0x7492('0x58'),'cross_join'];var _0x1182ea={'SUM':_0x7492('0x5a'),'COUNT':_0x7492('0x5b'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x7492('0x89'),'MIN':_0x7492('0x5c'),'AVG':_0x7492('0x5d'),'GROUP_CONCAT':_0x7492('0x5e'),'GROUP_CONCAT ASC':_0x7492('0x5f'),'GROUP_CONCAT DESC':_0x7492('0x8a')};var _0x2c79f9={'SEC_TO_TIME':_0x7492('0x60'),'DATE':_0x7492('0x61'),'HOUR':_0x7492('0x8b'),'ROUND':_0x7492('0x62'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x47e8c3=function(_0x67a164){return!_[_0x7492('0x64')]([_0x7492('0xaa'),'IS\x20NOT\x20NULL',_0x7492('0x66'),_0x7492('0x67')],_0x67a164);};var _0x27443a=function(_0x149a66){if(!_0x149a66||!_0x149a66['rules'][_0x7492('0x39')]){return'';}for(var _0x1d46e6='(',_0x6ac943=0x0;_0x6ac943<_0x149a66['rules'][_0x7492('0x39')];_0x6ac943+=0x1){_0x6ac943>0x0&&(_0x1d46e6+='\x20'+_0x149a66[_0x7492('0x69')]+'\x20');_0x1d46e6+=_0x149a66['rules'][_0x6ac943]['group']?_0x27443a(_0x149a66[_0x7492('0x68')][_0x6ac943][_0x7492('0x6a')]):_0x149a66[_0x7492('0x68')][_0x6ac943][_0x7492('0x77')]+'\x20'+_0x149a66[_0x7492('0x68')][_0x6ac943][_0x7492('0x6b')]+(_0x47e8c3(_0x149a66[_0x7492('0x68')][_0x6ac943]['condition'])?'\x20'+_0x149a66[_0x7492('0x68')][_0x6ac943][_0x7492('0x6c')]:'');}return _0x1d46e6+')';};var _0x5db3b={'where':{'id':_0x2a8f69[_0x7492('0x47')]['id']}},_0xa88530,_0x489c7b,_0x4fe75a,_0x5ca267,_0x1a6b1e;_0x5db3b=_[_0x7492('0x3e')]({},_0x5db3b,_0x2a8f69[_0x7492('0x40')]);return db['AnalyticCustomReport']['find'](_0x5db3b)[_0x7492('0x2b')](function(_0x4950be){if(_0x4950be){_0xa88530=_0x4950be;return _0x4950be['getFields']();}return null;})[_0x7492('0x2b')](function(_0x92681a){if(_0x92681a){if(!_0x92681a[_0x7492('0x39')]){throw new db[(_0x7492('0x6e'))][(_0x7492('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x489c7b=_0x92681a;return db[_0x7492('0x70')][_0x7492('0x43')]({'raw':!![]});}return null;})[_0x7492('0x2b')](function(_0x27f702){if(_0x27f702){_0x4fe75a=_[_0x7492('0x71')](_0x27f702,'id');var _0x31558d;var _0x3f9f3e=squel[_0x7492('0x72')]();_0x3f9f3e[_0x7492('0x73')](_0xa88530['table']);for(var _0x331868=0x0;_0x331868<_0x489c7b[_0x7492('0x39')];_0x331868+=0x1){_0x31558d=_0x489c7b[_0x331868]['MetricId']?_0x4fe75a[_0x489c7b[_0x331868]['MetricId']][_0x7492('0x76')]:_0x489c7b[_0x331868][_0x7492('0x77')];_0x31558d=_0x489c7b[_0x331868][_0x7492('0x8d')]?_[_0x7492('0x78')](_0x1182ea[_0x489c7b[_0x331868][_0x7492('0x8d')]],'%s',_0x31558d):_0x31558d;_0x31558d=_0x489c7b[_0x331868][_0x7492('0x8e')]?_[_0x7492('0x78')](_0x2c79f9[_0x489c7b[_0x331868][_0x7492('0x8e')]],'%s',_0x31558d):_0x31558d;if(_0x489c7b[_0x331868]['groupBy']){_0x3f9f3e['group'](_0x31558d);}_0x489c7b[_0x331868][_0x7492('0x7a')]&&_0x3f9f3e[_0x7492('0x7b')](_0x31558d,_0x489c7b[_0x331868][_0x7492('0x7a')]===_0x7492('0x7c')?![]:!![]);_0x3f9f3e[_0x7492('0x77')](_0x31558d,_0x489c7b[_0x331868][_0x7492('0x7d')]||_0x31558d);}if(_0xa88530[_0x7492('0x7e')]){_0xa88530[_0x7492('0x7e')]=JSON['parse'](_0xa88530[_0x7492('0x7e')]);for(var _0x1984f2=0x0;_0x1984f2<_0xa88530['joins']['length'];_0x1984f2+=0x1){if(_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x32')]&&_[_0x7492('0x64')](_0x78b160,_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x32')])&&_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x81')]&&_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x7f')]&&_0xa88530['joins'][_0x1984f2][_0x7492('0x80')]){_0x3f9f3e[_0xa88530[_0x7492('0x7e')][_0x1984f2]['type']](_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x7f')],null,util['format']('%s.%s\x20=\x20%s.%s',_0xa88530[_0x7492('0x74')],_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x81')],_0xa88530['joins'][_0x1984f2][_0x7492('0x7f')],_0xa88530[_0x7492('0x7e')][_0x1984f2][_0x7492('0x80')]));}}}if(_0xa88530[_0x7492('0x82')]){_0xa88530[_0x7492('0x82')]=JSON[_0x7492('0x83')](_0xa88530[_0x7492('0x82')]);_0x3f9f3e['where'](_0x27443a(_0xa88530[_0x7492('0x82')][_0x7492('0x6a')]));}_0x1a6b1e=_0x3f9f3e[_0x7492('0x84')]();_0x3f9f3e[_0x7492('0x23')](_0x2f5093);_0x3f9f3e[_0x7492('0x22')](0x0);logger[_0x7492('0x90')](_0x7492('0x91'),_0x3f9f3e[_0x7492('0x85')]());return db['sequelize']['query'](_0x3f9f3e['toString'](),{'type':db[_0x7492('0x86')]['QueryTypes'][_0x7492('0x87')]});}})[_0x7492('0x2b')](function(){return{'sql':_0x1a6b1e[_0x7492('0x85')]()};})[_0x7492('0x2b')](respondWithResult(_0x2ca3ef,null))[_0x7492('0x45')](handleError(_0x2ca3ef,null));}; \ No newline at end of file +var _0xb668=['../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','send','map','AnalyticCustomReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','include','findAll','rows','show','length','includeAll','find','catch','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%s)','MAX(%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)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','MetricId','metric','function','replace','format','groupBy','orderBy','order','alias','joins','parse','includes','parentKey','foreignTable','foreignKey','conditions','clone','debug','toString','sequelize','QueryTypes','SELECT','right_join','COUNT(%s)','MIN(%s)','from','table','DESC','%s.%s\x20=\x20%s.%s','Limited\x20Query:','output','web','fullPath','randomstring','generate','csv','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','startDate','info','Run\x20Query:','child_process','fork'];(function(_0x29ad08,_0x2b455d){var _0x32f333=function(_0x4efdec){while(--_0x4efdec){_0x29ad08['push'](_0x29ad08['shift']());}};_0x32f333(++_0x2b455d);}(_0xb668,0x15b));var _0x8b66=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xb668[_0x17d9e3];return _0x14192d;};'use strict';var pdf=require(_0x8b66('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x8b66('0x1'));var jsonpatch=require(_0x8b66('0x2'));var rp=require(_0x8b66('0x3'));var moment=require(_0x8b66('0x4'));var BPromise=require(_0x8b66('0x5'));var Mustache=require(_0x8b66('0x6'));var util=require(_0x8b66('0x7'));var path=require('path');var sox=require(_0x8b66('0x8'));var csv=require(_0x8b66('0x9'));var ejs=require(_0x8b66('0xa'));var fs=require('fs');var _=require(_0x8b66('0xb'));var squel=require(_0x8b66('0xc'));var crypto=require(_0x8b66('0xd'));var jsforce=require(_0x8b66('0xe'));var deskjs=require(_0x8b66('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8b66('0x10'));var qs=require(_0x8b66('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b66('0x12'));var logger=require(_0x8b66('0x13'))(_0x8b66('0x14'));var utils=require(_0x8b66('0x15'));var config=require(_0x8b66('0x16'));var db=require(_0x8b66('0x17'))['db'];function respondWithStatusCode(_0x451096,_0x4f19de){_0x4f19de=_0x4f19de||0xcc;return function(_0x5f4008){if(_0x5f4008){return _0x451096['sendStatus'](_0x4f19de);}return _0x451096[_0x8b66('0x18')](_0x4f19de)['end']();};}function respondWithResult(_0x4fe444,_0x303e8a){_0x303e8a=_0x303e8a||0xc8;return function(_0x477dd0){if(_0x477dd0){return _0x4fe444[_0x8b66('0x18')](_0x303e8a)[_0x8b66('0x19')](_0x477dd0);}};}function respondWithFilteredResult(_0xeb6a21,_0x1f7aa7){return function(_0xb253e8){if(_0xb253e8){var _0x2b9304=_0xb253e8[_0x8b66('0x1a')],_0x2e68d1=_0x1f7aa7[_0x8b66('0x1b')],_0x4083d8=_0x1f7aa7['offset']+_0x1f7aa7[_0x8b66('0x1c')],_0x2be35b;if(_0x4083d8>=_0x2b9304){_0x4083d8=_0x2b9304;_0x2be35b=0xc8;}else{_0x2be35b=0xce;}_0xeb6a21[_0x8b66('0x18')](_0x2be35b);return _0xeb6a21[_0x8b66('0x1d')](_0x8b66('0x1e'),_0x2e68d1+'-'+_0x4083d8+'/'+_0x2b9304)[_0x8b66('0x19')](_0xb253e8);}return null;};}function patchUpdates(_0x1dc0f2){return function(_0x10c05b){try{jsonpatch[_0x8b66('0x1f')](_0x10c05b,_0x1dc0f2,!![]);}catch(_0x3de697){return BPromise[_0x8b66('0x20')](_0x3de697);}return _0x10c05b[_0x8b66('0x21')]();};}function saveUpdates(_0x193767,_0x4c8a2e){return function(_0x3f41a1){if(_0x3f41a1){return _0x3f41a1[_0x8b66('0x22')](_0x193767)['then'](function(_0x5af91d){return _0x5af91d;});}return null;};}function removeEntity(_0x5ddc66,_0x3bdbff){return function(_0xa4efd4){if(_0xa4efd4){return _0xa4efd4[_0x8b66('0x23')]()['then'](function(){var _0x2dd1d4=_0xa4efd4['get']({'plain':!![]});var _0x5b5501='CustomReports';return db['UserProfileResource']['destroy']({'where':{'type':_0x5b5501,'resourceId':_0x2dd1d4['id']}})[_0x8b66('0x24')](function(){return _0xa4efd4;});})[_0x8b66('0x24')](function(){_0x5ddc66[_0x8b66('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x20acec,_0x5afefc){return function(_0x1d22a3){if(!_0x1d22a3){_0x20acec[_0x8b66('0x25')](0x194);}return _0x1d22a3;};}function handleError(_0x259d66,_0x2da5ee){_0x2da5ee=_0x2da5ee||0x1f4;return function(_0x531586){logger[_0x8b66('0x26')](_0x531586[_0x8b66('0x27')]);if(_0x531586[_0x8b66('0x28')]){delete _0x531586['name'];}_0x259d66['status'](_0x2da5ee)[_0x8b66('0x29')](_0x531586);};}exports['index']=function(_0x24386c,_0x399cb3){var _0x342684={},_0x12c778={},_0x12b199={'count':0x0,'rows':[]};var _0x49d5c2=_[_0x8b66('0x2a')](db[_0x8b66('0x2b')][_0x8b66('0x2c')],function(_0x739d33){return{'name':_0x739d33[_0x8b66('0x2d')],'type':_0x739d33[_0x8b66('0x2e')]['key']};});_0x12c778[_0x8b66('0x2f')]=_[_0x8b66('0x2a')](_0x49d5c2,_0x8b66('0x28'));_0x12c778[_0x8b66('0x30')]=_[_0x8b66('0x31')](_0x24386c[_0x8b66('0x30')]);_0x12c778[_0x8b66('0x32')]=_['intersection'](_0x12c778[_0x8b66('0x2f')],_0x12c778[_0x8b66('0x30')]);_0x342684[_0x8b66('0x33')]=_[_0x8b66('0x34')](_0x12c778[_0x8b66('0x2f')],qs[_0x8b66('0x35')](_0x24386c[_0x8b66('0x30')][_0x8b66('0x35')]));_0x342684[_0x8b66('0x33')]=_0x342684['attributes']['length']?_0x342684[_0x8b66('0x33')]:_0x12c778[_0x8b66('0x2f')];if(!_0x24386c[_0x8b66('0x30')][_0x8b66('0x36')](_0x8b66('0x37'))){_0x342684[_0x8b66('0x1c')]=qs[_0x8b66('0x1c')](_0x24386c[_0x8b66('0x30')][_0x8b66('0x1c')]);_0x342684[_0x8b66('0x1b')]=qs[_0x8b66('0x1b')](_0x24386c[_0x8b66('0x30')][_0x8b66('0x1b')]);}_0x342684['order']=qs[_0x8b66('0x38')](_0x24386c[_0x8b66('0x30')][_0x8b66('0x38')]);_0x342684['where']=qs[_0x8b66('0x32')](_[_0x8b66('0x39')](_0x24386c[_0x8b66('0x30')],_0x12c778[_0x8b66('0x32')]));if(_0x24386c['query'][_0x8b66('0x3a')]){_0x342684[_0x8b66('0x3b')]=_[_0x8b66('0x3c')](_0x342684['where'],{'$or':_['map'](_0x49d5c2,function(_0x175e6e){if(_0x175e6e['type']!==_0x8b66('0x3d')){var _0x445613={};_0x445613[_0x175e6e['name']]={'$like':'%'+_0x24386c[_0x8b66('0x30')]['filter']+'%'};return _0x445613;}})});}_0x342684=_['merge']({},_0x342684,_0x24386c[_0x8b66('0x3e')]);var _0x2318b1={'where':_0x342684[_0x8b66('0x3b')]};return db[_0x8b66('0x2b')][_0x8b66('0x1a')](_0x2318b1)['then'](function(_0x46a055){_0x12b199[_0x8b66('0x1a')]=_0x46a055;if(_0x24386c[_0x8b66('0x30')]['includeAll']){_0x342684[_0x8b66('0x3f')]=[{'all':!![]}];}return db[_0x8b66('0x2b')][_0x8b66('0x40')](_0x342684);})[_0x8b66('0x24')](function(_0x368dd2){_0x12b199[_0x8b66('0x41')]=_0x368dd2;return _0x12b199;})[_0x8b66('0x24')](respondWithFilteredResult(_0x399cb3,_0x342684))['catch'](handleError(_0x399cb3,null));};exports[_0x8b66('0x42')]=function(_0x5c3bf2,_0x20489a){var _0x4cafd7={'raw':![],'where':{'id':_0x5c3bf2['params']['id']}},_0x226bbd={};_0x226bbd[_0x8b66('0x2f')]=_[_0x8b66('0x31')](db[_0x8b66('0x2b')][_0x8b66('0x2c')]);_0x226bbd['query']=_[_0x8b66('0x31')](_0x5c3bf2[_0x8b66('0x30')]);_0x226bbd[_0x8b66('0x32')]=_['intersection'](_0x226bbd[_0x8b66('0x2f')],_0x226bbd[_0x8b66('0x30')]);_0x4cafd7[_0x8b66('0x33')]=_['intersection'](_0x226bbd['model'],qs['fields'](_0x5c3bf2[_0x8b66('0x30')]['fields']));_0x4cafd7[_0x8b66('0x33')]=_0x4cafd7[_0x8b66('0x33')][_0x8b66('0x43')]?_0x4cafd7[_0x8b66('0x33')]:_0x226bbd[_0x8b66('0x2f')];if(_0x5c3bf2[_0x8b66('0x30')][_0x8b66('0x44')]){_0x4cafd7[_0x8b66('0x3f')]=[{'all':!![]}];}_0x4cafd7=_['merge']({},_0x4cafd7,_0x5c3bf2['options']);return db['AnalyticCustomReport'][_0x8b66('0x45')](_0x4cafd7)[_0x8b66('0x24')](handleEntityNotFound(_0x20489a,null))[_0x8b66('0x24')](respondWithResult(_0x20489a,null))[_0x8b66('0x46')](handleError(_0x20489a,null));};exports[_0x8b66('0x47')]=function(_0x1e3594,_0x318d06){return db[_0x8b66('0x2b')][_0x8b66('0x47')](_0x1e3594[_0x8b66('0x48')],{})[_0x8b66('0x24')](function(_0x355a0e){var _0x2ce8e7=_0x1e3594[_0x8b66('0x49')][_0x8b66('0x4a')]({'plain':!![]});if(!_0x2ce8e7)throw new Error(_0x8b66('0x4b'));if(_0x2ce8e7[_0x8b66('0x4c')]===_0x8b66('0x49')){var _0x44b4bc=_0x355a0e[_0x8b66('0x4a')]({'plain':!![]});var _0x5a9657=_0x8b66('0x4d');return db[_0x8b66('0x4e')]['find']({'where':{'name':_0x5a9657,'userProfileId':_0x2ce8e7[_0x8b66('0x4f')]},'raw':!![]})[_0x8b66('0x24')](function(_0x5632f6){if(_0x5632f6&&_0x5632f6[_0x8b66('0x50')]===0x0){return db[_0x8b66('0x51')]['create']({'name':_0x44b4bc['name'],'resourceId':_0x44b4bc['id'],'type':'CustomReports','sectionId':_0x5632f6['id']},{})['then'](function(){return _0x355a0e;});}else{return _0x355a0e;}})[_0x8b66('0x46')](function(_0x26e20f){logger['error'](_0x8b66('0x52'),_0x26e20f);throw _0x26e20f;});}return _0x355a0e;})[_0x8b66('0x24')](respondWithResult(_0x318d06,0xc9))[_0x8b66('0x46')](handleError(_0x318d06,null));};exports[_0x8b66('0x22')]=function(_0x47f312,_0xfde624){if(_0x47f312[_0x8b66('0x48')]['id']){delete _0x47f312[_0x8b66('0x48')]['id'];}return db[_0x8b66('0x2b')][_0x8b66('0x45')]({'where':{'id':_0x47f312[_0x8b66('0x53')]['id']}})[_0x8b66('0x24')](handleEntityNotFound(_0xfde624,null))[_0x8b66('0x24')](saveUpdates(_0x47f312[_0x8b66('0x48')],null))[_0x8b66('0x24')](respondWithResult(_0xfde624,null))[_0x8b66('0x46')](handleError(_0xfde624,null));};exports[_0x8b66('0x23')]=function(_0xa76030,_0x21c70f){return db[_0x8b66('0x2b')][_0x8b66('0x45')]({'where':{'id':_0xa76030[_0x8b66('0x53')]['id']}})[_0x8b66('0x24')](handleEntityNotFound(_0x21c70f,null))[_0x8b66('0x24')](removeEntity(_0x21c70f,null))['catch'](handleError(_0x21c70f,null));};exports[_0x8b66('0x54')]=function(_0x2b5f2b,_0x4570b8){var _0x15ade7=0xa;var _0xaae302=[_0x8b66('0x55'),_0x8b66('0x56'),'right_join',_0x8b66('0x57')];var _0x313f7e={'SUM':_0x8b66('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x8b66('0x59'),'MAX':_0x8b66('0x5a'),'MIN':'MIN(%s)','AVG':_0x8b66('0x5b'),'GROUP_CONCAT':_0x8b66('0x5c'),'GROUP_CONCAT ASC':_0x8b66('0x5d'),'GROUP_CONCAT DESC':_0x8b66('0x5e')};var _0x5d0aa3={'SEC_TO_TIME':_0x8b66('0x5f'),'DATE':_0x8b66('0x60'),'HOUR':_0x8b66('0x61'),'ROUND':_0x8b66('0x62'),'UNIX_TIMESTAMP':_0x8b66('0x63')};var _0x307543=function(_0x31ade8){return!_['includes']([_0x8b66('0x64'),_0x8b66('0x65'),_0x8b66('0x66'),_0x8b66('0x67')],_0x31ade8);};var _0x4da26d=function(_0x1a2610){if(!_0x1a2610||!_0x1a2610[_0x8b66('0x68')][_0x8b66('0x43')]){return'';}for(var _0xba6c75='(',_0x4bc360=0x0;_0x4bc360<_0x1a2610[_0x8b66('0x68')][_0x8b66('0x43')];_0x4bc360+=0x1){_0x4bc360>0x0&&(_0xba6c75+='\x20'+_0x1a2610[_0x8b66('0x69')]+'\x20');_0xba6c75+=_0x1a2610[_0x8b66('0x68')][_0x4bc360][_0x8b66('0x6a')]?_0x4da26d(_0x1a2610[_0x8b66('0x68')][_0x4bc360]['group']):_0x1a2610[_0x8b66('0x68')][_0x4bc360][_0x8b66('0x6b')]+'\x20'+_0x1a2610[_0x8b66('0x68')][_0x4bc360]['condition']+(_0x307543(_0x1a2610[_0x8b66('0x68')][_0x4bc360][_0x8b66('0x6c')])?'\x20'+_0x1a2610['rules'][_0x4bc360][_0x8b66('0x6d')]:'');}return _0xba6c75+')';};var _0x926365={'where':{'id':_0x2b5f2b[_0x8b66('0x53')]['id']}},_0x48a0a,_0x56d134,_0x13d6be,_0x114acf,_0x115578;_0x926365=_[_0x8b66('0x3c')]({},_0x926365,_0x2b5f2b[_0x8b66('0x3e')]);return db[_0x8b66('0x2b')]['find'](_0x926365)[_0x8b66('0x24')](function(_0x1f2fef){if(_0x1f2fef){_0x48a0a=_0x1f2fef;return _0x1f2fef[_0x8b66('0x6e')]();}return null;})['then'](function(_0x2b6bd7){if(_0x2b6bd7){if(!_0x2b6bd7[_0x8b66('0x43')]){throw new db[(_0x8b66('0x6f'))][(_0x8b66('0x70'))](_0x8b66('0x71'),0x193);}_0x56d134=_0x2b6bd7;return db[_0x8b66('0x72')][_0x8b66('0x40')]({'raw':!![]});}return null;})['then'](function(_0xea724c){if(_0xea724c){_0x13d6be=_[_0x8b66('0x73')](_0xea724c,'id');var _0x3ef190;var _0x56bc12=squel[_0x8b66('0x74')]();_0x56bc12['from'](_0x48a0a['table']);for(var _0x509ec3=0x0;_0x509ec3<_0x56d134[_0x8b66('0x43')];_0x509ec3+=0x1){_0x3ef190=_0x56d134[_0x509ec3][_0x8b66('0x75')]?_0x13d6be[_0x56d134[_0x509ec3][_0x8b66('0x75')]][_0x8b66('0x76')]:_0x56d134[_0x509ec3][_0x8b66('0x6b')];_0x3ef190=_0x56d134[_0x509ec3][_0x8b66('0x77')]?_[_0x8b66('0x78')](_0x313f7e[_0x56d134[_0x509ec3][_0x8b66('0x77')]],'%s',_0x3ef190):_0x3ef190;_0x3ef190=_0x56d134[_0x509ec3][_0x8b66('0x79')]?_['replace'](_0x5d0aa3[_0x56d134[_0x509ec3]['format']],'%s',_0x3ef190):_0x3ef190;if(_0x56d134[_0x509ec3][_0x8b66('0x7a')]){_0x56bc12[_0x8b66('0x6a')](_0x3ef190);}_0x56d134[_0x509ec3][_0x8b66('0x7b')]&&_0x56bc12[_0x8b66('0x7c')](_0x3ef190,_0x56d134[_0x509ec3]['orderBy']==='DESC'?![]:!![]);_0x56bc12[_0x8b66('0x6b')](_0x3ef190,_0x56d134[_0x509ec3][_0x8b66('0x7d')]||_0x3ef190);}if(_0x48a0a[_0x8b66('0x7e')]){_0x48a0a[_0x8b66('0x7e')]=JSON[_0x8b66('0x7f')](_0x48a0a[_0x8b66('0x7e')]);for(var _0x41510c=0x0;_0x41510c<_0x48a0a[_0x8b66('0x7e')][_0x8b66('0x43')];_0x41510c+=0x1){if(_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x2e')]&&_[_0x8b66('0x80')](_0xaae302,_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x2e')])&&_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x81')]&&_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x82')]&&_0x48a0a[_0x8b66('0x7e')][_0x41510c]['foreignKey']){_0x56bc12[_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x2e')]](_0x48a0a['joins'][_0x41510c]['foreignTable'],null,util[_0x8b66('0x79')]('%s.%s\x20=\x20%s.%s',_0x48a0a['table'],_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x81')],_0x48a0a[_0x8b66('0x7e')][_0x41510c][_0x8b66('0x82')],_0x48a0a['joins'][_0x41510c][_0x8b66('0x83')]));}}}if(_0x48a0a['conditions']){_0x48a0a[_0x8b66('0x84')]=JSON[_0x8b66('0x7f')](_0x48a0a[_0x8b66('0x84')]);_0x56bc12[_0x8b66('0x3b')](_0x4da26d(_0x48a0a['conditions'][_0x8b66('0x6a')]));}_0x115578=_0x56bc12[_0x8b66('0x85')]();_0x56bc12[_0x8b66('0x1c')](_0x15ade7);_0x56bc12[_0x8b66('0x1b')](0x0);logger[_0x8b66('0x86')]('Limited\x20Query:',_0x56bc12[_0x8b66('0x87')]());return db['sequelize'][_0x8b66('0x30')](_0x56bc12[_0x8b66('0x87')](),{'type':db[_0x8b66('0x88')][_0x8b66('0x89')][_0x8b66('0x8a')]});}})[_0x8b66('0x24')](respondWithResult(_0x4570b8,null))[_0x8b66('0x46')](handleError(_0x4570b8,null));};function runReport(_0x24009b,_0x16767a,_0x3a25ff){var _0x306264=_0x16767a['name'];var _0x6d8346=0xa;var _0x53868f=[_0x8b66('0x55'),'left_join',_0x8b66('0x8b'),_0x8b66('0x57')];var _0x3c6686={'SUM':_0x8b66('0x58'),'COUNT':_0x8b66('0x8c'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':'MAX(%s)','MIN':_0x8b66('0x8d'),'AVG':'AVG(%s)','GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8b66('0x5d'),'GROUP_CONCAT DESC':_0x8b66('0x5e')};var _0x97239a={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x8b66('0x60'),'HOUR':_0x8b66('0x61'),'ROUND':_0x8b66('0x62'),'UNIX_TIMESTAMP':_0x8b66('0x63')};var _0x51e9c6=function(_0x5731fd){return!_['includes']([_0x8b66('0x64'),_0x8b66('0x65'),_0x8b66('0x66'),_0x8b66('0x67')],_0x5731fd);};var _0x272471=function(_0x184b23){if(!_0x184b23||!_0x184b23[_0x8b66('0x68')][_0x8b66('0x43')]){return'';}for(var _0x61c076='(',_0x2bb6e6=0x0;_0x2bb6e6<_0x184b23['rules']['length'];_0x2bb6e6+=0x1){_0x2bb6e6>0x0&&(_0x61c076+='\x20'+_0x184b23[_0x8b66('0x69')]+'\x20');_0x61c076+=_0x184b23['rules'][_0x2bb6e6][_0x8b66('0x6a')]?_0x272471(_0x184b23[_0x8b66('0x68')][_0x2bb6e6][_0x8b66('0x6a')]):_0x184b23[_0x8b66('0x68')][_0x2bb6e6][_0x8b66('0x6b')]+'\x20'+_0x184b23[_0x8b66('0x68')][_0x2bb6e6]['condition']+(_0x51e9c6(_0x184b23[_0x8b66('0x68')][_0x2bb6e6]['condition'])?'\x20'+_0x184b23[_0x8b66('0x68')][_0x2bb6e6][_0x8b66('0x6d')]:'');}return _0x61c076+')';};var _0x8ffb4b={'where':{'id':_0x24009b['id']}},_0x15455a,_0x4cfec6,_0x137626,_0x3e94c7,_0x517a17;_0x8ffb4b=_[_0x8b66('0x3c')]({},_0x8ffb4b,_0x3a25ff);return db[_0x8b66('0x2b')][_0x8b66('0x45')](_0x8ffb4b)[_0x8b66('0x24')](function(_0x536dbd){if(_0x536dbd){_0x15455a=_0x536dbd;return _0x536dbd[_0x8b66('0x6e')]();}return null;})[_0x8b66('0x24')](function(_0x3b77c2){if(_0x3b77c2){if(!_0x3b77c2[_0x8b66('0x43')]){throw new db[(_0x8b66('0x6f'))][(_0x8b66('0x70'))](_0x8b66('0x71'),0x193);}_0x4cfec6=_0x3b77c2;return db[_0x8b66('0x72')]['findAll']({'raw':!![]});}return null;})[_0x8b66('0x24')](function(_0x483af7){if(_0x483af7){_0x137626=_[_0x8b66('0x73')](_0x483af7,'id');var _0x391d2a;var _0x109581=squel[_0x8b66('0x74')]();_0x109581[_0x8b66('0x8e')](_0x15455a[_0x8b66('0x8f')]);for(var _0x28d7ff=0x0;_0x28d7ff<_0x4cfec6[_0x8b66('0x43')];_0x28d7ff+=0x1){_0x391d2a=_0x4cfec6[_0x28d7ff]['MetricId']?_0x137626[_0x4cfec6[_0x28d7ff]['MetricId']][_0x8b66('0x76')]:_0x4cfec6[_0x28d7ff][_0x8b66('0x6b')];_0x391d2a=_0x4cfec6[_0x28d7ff]['function']?_[_0x8b66('0x78')](_0x3c6686[_0x4cfec6[_0x28d7ff]['function']],'%s',_0x391d2a):_0x391d2a;_0x391d2a=_0x4cfec6[_0x28d7ff][_0x8b66('0x79')]?_[_0x8b66('0x78')](_0x97239a[_0x4cfec6[_0x28d7ff]['format']],'%s',_0x391d2a):_0x391d2a;if(_0x4cfec6[_0x28d7ff]['groupBy']){_0x109581[_0x8b66('0x6a')](_0x391d2a);}_0x4cfec6[_0x28d7ff]['orderBy']&&_0x109581[_0x8b66('0x7c')](_0x391d2a,_0x4cfec6[_0x28d7ff][_0x8b66('0x7b')]===_0x8b66('0x90')?![]:!![]);_0x109581[_0x8b66('0x6b')](_0x391d2a,_0x4cfec6[_0x28d7ff]['alias']||_0x391d2a);}if(_0x15455a[_0x8b66('0x7e')]){_0x15455a['joins']=JSON[_0x8b66('0x7f')](_0x15455a[_0x8b66('0x7e')]);for(var _0x3b5332=0x0;_0x3b5332<_0x15455a[_0x8b66('0x7e')][_0x8b66('0x43')];_0x3b5332+=0x1){if(_0x15455a[_0x8b66('0x7e')][_0x3b5332]['type']&&_[_0x8b66('0x80')](_0x53868f,_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x2e')])&&_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x81')]&&_0x15455a['joins'][_0x3b5332]['foreignTable']&&_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x83')]){_0x109581[_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x2e')]](_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x82')],null,util['format'](_0x8b66('0x91'),_0x15455a[_0x8b66('0x8f')],_0x15455a[_0x8b66('0x7e')][_0x3b5332]['parentKey'],_0x15455a[_0x8b66('0x7e')][_0x3b5332]['foreignTable'],_0x15455a[_0x8b66('0x7e')][_0x3b5332][_0x8b66('0x83')]));}}}if(_0x15455a[_0x8b66('0x84')]){_0x15455a[_0x8b66('0x84')]=JSON['parse'](_0x15455a[_0x8b66('0x84')]);_0x109581['where'](_0x272471(_0x15455a[_0x8b66('0x84')]['group']));}_0x517a17=_0x109581[_0x8b66('0x85')]();_0x109581[_0x8b66('0x1c')](_0x6d8346);_0x109581[_0x8b66('0x1b')](0x0);logger[_0x8b66('0x86')](_0x8b66('0x92'),_0x109581[_0x8b66('0x87')]());return db[_0x8b66('0x88')]['query'](_0x109581[_0x8b66('0x87')](),{'type':db[_0x8b66('0x88')][_0x8b66('0x89')][_0x8b66('0x8a')]});}})[_0x8b66('0x24')](function(_0x17fdcc){if(!_0x17fdcc[_0x8b66('0x43')]){throw new db[(_0x8b66('0x6f'))][(_0x8b66('0x70'))]('No\x20available\x20data',0xcc);}if(_0x16767a[_0x8b66('0x93')]===_0x8b66('0x94')){return null;}var _0x532d1a=_[_0x8b66('0x3c')](_0x16767a,{'name':_0x16767a[_0x8b66('0x95')]||_0x16767a[_0x8b66('0x28')]||_0x15455a[_0x8b66('0x28')],'basename':_0x306264,'savename':util[_0x8b66('0x79')]('%s-%s.%s',_0x16767a[_0x8b66('0x28')]||_0x15455a[_0x8b66('0x28')],require(_0x8b66('0x96'))[_0x8b66('0x97')](0x4),_0x16767a['output']||_0x8b66('0x98')),'reportId':_0x15455a['id'],'reportType':'custom'});return db[_0x8b66('0x99')][_0x8b66('0x47')](_0x532d1a,{'raw':!![]});})[_0x8b66('0x24')](function(_0xa118f4){if(_0x15455a[_0x8b66('0x8f')]===_0x8b66('0x9a')){_0x517a17[_0x8b66('0x3b')](_0x15455a[_0x8b66('0x8f')]+_0x8b66('0x9b'),_0x16767a['startDate'],_0x16767a[_0x8b66('0x9c')]);}else{_0x517a17[_0x8b66('0x3b')](_0x15455a['table']+_0x8b66('0x9d'),_0x16767a[_0x8b66('0x9e')],_0x16767a[_0x8b66('0x9c')]);}if(_0xa118f4){logger[_0x8b66('0x9f')](_0x8b66('0xa0'),_0x517a17[_0x8b66('0x87')]());require(_0x8b66('0xa1'))[_0x8b66('0xa2')](path['join'](__dirname,_0x8b66('0xa3'),_0xa118f4[_0x8b66('0x93')]),[_0xa118f4['id'],_0x517a17[_0x8b66('0x87')](),path[_0x8b66('0x55')](__dirname,_0x8b66('0xa4'),_0xa118f4[_0x8b66('0xa5')]),_0x306264]);return _0xa118f4;}else{var _0xa7f18b=squel[_0x8b66('0x74')]();_0xa7f18b[_0x8b66('0x8e')]('('+_0x517a17[_0x8b66('0x87')]()+')',_0x8b66('0xa6'));_0xa7f18b[_0x8b66('0x6b')](_0x8b66('0xa7'),'count');_0x517a17['limit'](_0x16767a[_0x8b66('0x1c')]||_0x6d8346);_0x517a17['offset'](_0x16767a[_0x8b66('0x1b')]||0x0);return db[_0x8b66('0x88')]['query'](_0xa7f18b[_0x8b66('0x87')](),{'type':db['sequelize'][_0x8b66('0x89')][_0x8b66('0x8a')]})[_0x8b66('0x24')](function(_0x329b11){if(!_0x329b11['length']){_0x3e94c7=0x0;}else{_0x3e94c7=_0x329b11[0x0][_0x8b66('0x1a')]||0x0;}return db[_0x8b66('0x88')]['query'](_0x517a17[_0x8b66('0x87')](),{'type':db[_0x8b66('0x88')][_0x8b66('0x89')][_0x8b66('0x8a')]});})[_0x8b66('0x24')](function(_0x37486e){return{'rows':_0x37486e||[],'count':_0x3e94c7};});}});}exports[_0x8b66('0xa8')]=function(_0x5a6a7d,_0x4facd8){return runReport(_0x5a6a7d[_0x8b66('0x53')],_0x5a6a7d[_0x8b66('0x30')],_0x5a6a7d['options'])[_0x8b66('0x24')](respondWithResult(_0x4facd8,null))[_0x8b66('0x46')](handleError(_0x4facd8,null));};exports[_0x8b66('0xa9')]=runReport;exports[_0x8b66('0x30')]=function(_0x5f4a62,_0x1dd3b9){var _0x3f2ec5=0xa;var _0x195860=[_0x8b66('0x55'),_0x8b66('0x56'),_0x8b66('0x8b'),_0x8b66('0x57')];var _0x1858ba={'SUM':_0x8b66('0x58'),'COUNT':'COUNT(%s)','COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x8b66('0x5a'),'MIN':_0x8b66('0x8d'),'AVG':_0x8b66('0x5b'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':_0x8b66('0x5d'),'GROUP_CONCAT DESC':_0x8b66('0x5e')};var _0x154a03={'SEC_TO_TIME':_0x8b66('0x5f'),'DATE':'DATE(%s)','HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x84d331=function(_0x981f74){return!_['includes'](['IS\x20NULL',_0x8b66('0x65'),_0x8b66('0x66'),'IS\x20NOT\x20EMPTY'],_0x981f74);};var _0x1cfe25=function(_0x53d4f0){if(!_0x53d4f0||!_0x53d4f0[_0x8b66('0x68')]['length']){return'';}for(var _0x1be093='(',_0x594fd5=0x0;_0x594fd5<_0x53d4f0['rules'][_0x8b66('0x43')];_0x594fd5+=0x1){_0x594fd5>0x0&&(_0x1be093+='\x20'+_0x53d4f0['operator']+'\x20');_0x1be093+=_0x53d4f0['rules'][_0x594fd5][_0x8b66('0x6a')]?_0x1cfe25(_0x53d4f0['rules'][_0x594fd5][_0x8b66('0x6a')]):_0x53d4f0[_0x8b66('0x68')][_0x594fd5]['field']+'\x20'+_0x53d4f0[_0x8b66('0x68')][_0x594fd5]['condition']+(_0x84d331(_0x53d4f0[_0x8b66('0x68')][_0x594fd5]['condition'])?'\x20'+_0x53d4f0[_0x8b66('0x68')][_0x594fd5]['value']:'');}return _0x1be093+')';};var _0x12b777={'where':{'id':_0x5f4a62[_0x8b66('0x53')]['id']}},_0x4f7d37,_0x3f605a,_0x4e6d6f,_0xfa2943,_0x175f4c;_0x12b777=_['merge']({},_0x12b777,_0x5f4a62[_0x8b66('0x3e')]);return db['AnalyticCustomReport']['find'](_0x12b777)['then'](function(_0x243e29){if(_0x243e29){_0x4f7d37=_0x243e29;return _0x243e29[_0x8b66('0x6e')]();}return null;})[_0x8b66('0x24')](function(_0x2240a3){if(_0x2240a3){if(!_0x2240a3[_0x8b66('0x43')]){throw new db[(_0x8b66('0x6f'))][(_0x8b66('0x70'))](_0x8b66('0x71'),0x193);}_0x3f605a=_0x2240a3;return db[_0x8b66('0x72')][_0x8b66('0x40')]({'raw':!![]});}return null;})['then'](function(_0x57f243){if(_0x57f243){_0x4e6d6f=_[_0x8b66('0x73')](_0x57f243,'id');var _0x5c795f;var _0x466d03=squel['select']();_0x466d03[_0x8b66('0x8e')](_0x4f7d37[_0x8b66('0x8f')]);for(var _0x4ac49f=0x0;_0x4ac49f<_0x3f605a[_0x8b66('0x43')];_0x4ac49f+=0x1){_0x5c795f=_0x3f605a[_0x4ac49f][_0x8b66('0x75')]?_0x4e6d6f[_0x3f605a[_0x4ac49f][_0x8b66('0x75')]][_0x8b66('0x76')]:_0x3f605a[_0x4ac49f][_0x8b66('0x6b')];_0x5c795f=_0x3f605a[_0x4ac49f][_0x8b66('0x77')]?_[_0x8b66('0x78')](_0x1858ba[_0x3f605a[_0x4ac49f][_0x8b66('0x77')]],'%s',_0x5c795f):_0x5c795f;_0x5c795f=_0x3f605a[_0x4ac49f][_0x8b66('0x79')]?_[_0x8b66('0x78')](_0x154a03[_0x3f605a[_0x4ac49f][_0x8b66('0x79')]],'%s',_0x5c795f):_0x5c795f;if(_0x3f605a[_0x4ac49f][_0x8b66('0x7a')]){_0x466d03['group'](_0x5c795f);}_0x3f605a[_0x4ac49f][_0x8b66('0x7b')]&&_0x466d03[_0x8b66('0x7c')](_0x5c795f,_0x3f605a[_0x4ac49f][_0x8b66('0x7b')]===_0x8b66('0x90')?![]:!![]);_0x466d03[_0x8b66('0x6b')](_0x5c795f,_0x3f605a[_0x4ac49f][_0x8b66('0x7d')]||_0x5c795f);}if(_0x4f7d37[_0x8b66('0x7e')]){_0x4f7d37[_0x8b66('0x7e')]=JSON[_0x8b66('0x7f')](_0x4f7d37[_0x8b66('0x7e')]);for(var _0x4b6418=0x0;_0x4b6418<_0x4f7d37['joins'][_0x8b66('0x43')];_0x4b6418+=0x1){if(_0x4f7d37['joins'][_0x4b6418]['type']&&_[_0x8b66('0x80')](_0x195860,_0x4f7d37[_0x8b66('0x7e')][_0x4b6418]['type'])&&_0x4f7d37['joins'][_0x4b6418][_0x8b66('0x81')]&&_0x4f7d37['joins'][_0x4b6418][_0x8b66('0x82')]&&_0x4f7d37[_0x8b66('0x7e')][_0x4b6418]['foreignKey']){_0x466d03[_0x4f7d37['joins'][_0x4b6418][_0x8b66('0x2e')]](_0x4f7d37[_0x8b66('0x7e')][_0x4b6418][_0x8b66('0x82')],null,util[_0x8b66('0x79')](_0x8b66('0x91'),_0x4f7d37[_0x8b66('0x8f')],_0x4f7d37[_0x8b66('0x7e')][_0x4b6418][_0x8b66('0x81')],_0x4f7d37[_0x8b66('0x7e')][_0x4b6418]['foreignTable'],_0x4f7d37[_0x8b66('0x7e')][_0x4b6418][_0x8b66('0x83')]));}}}if(_0x4f7d37[_0x8b66('0x84')]){_0x4f7d37['conditions']=JSON[_0x8b66('0x7f')](_0x4f7d37['conditions']);_0x466d03[_0x8b66('0x3b')](_0x1cfe25(_0x4f7d37[_0x8b66('0x84')][_0x8b66('0x6a')]));}_0x175f4c=_0x466d03[_0x8b66('0x85')]();_0x466d03[_0x8b66('0x1c')](_0x3f2ec5);_0x466d03['offset'](0x0);logger[_0x8b66('0x86')](_0x8b66('0x92'),_0x466d03['toString']());return db[_0x8b66('0x88')][_0x8b66('0x30')](_0x466d03[_0x8b66('0x87')](),{'type':db[_0x8b66('0x88')][_0x8b66('0x89')][_0x8b66('0x8a')]});}})[_0x8b66('0x24')](function(){return{'sql':_0x175f4c['toString']()};})[_0x8b66('0x24')](respondWithResult(_0x1dd3b9,null))[_0x8b66('0x46')](handleError(_0x1dd3b9,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 3b01488..9dc67e4 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 _0xef7e=['path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','../../config/logger','api','bluebird'];(function(_0x1ad604,_0xda8c45){var _0x2d47cf=function(_0xcd3f4f){while(--_0xcd3f4f){_0x1ad604['push'](_0x1ad604['shift']());}};_0x2d47cf(++_0xda8c45);}(_0xef7e,0x194));var _0xeef7=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xef7e[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0xeef7('0x0'));var util=require('util');var logger=require(_0xeef7('0x1'))(_0xeef7('0x2'));var moment=require('moment');var BPromise=require(_0xeef7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xeef7('0x4'));var rimraf=require(_0xeef7('0x5'));var config=require(_0xeef7('0x6'));var attributes=require(_0xeef7('0x7'));module[_0xeef7('0x8')]=function(_0x124d3e,_0x1737a6){return _0x124d3e[_0xeef7('0x9')](_0xeef7('0xa'),attributes,{'tableName':_0xeef7('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd258=['analytics_custom_reports','lodash','util','api','moment','bluebird','request-promise','rimraf','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport'];(function(_0x188edb,_0x19fed6){var _0x669a3d=function(_0x40b5d9){while(--_0x40b5d9){_0x188edb['push'](_0x188edb['shift']());}};_0x669a3d(++_0x19fed6);}(_0xd258,0x18d));var _0x8d25=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd258[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8d25('0x0'));var util=require(_0x8d25('0x1'));var logger=require('../../config/logger')(_0x8d25('0x2'));var moment=require(_0x8d25('0x3'));var BPromise=require(_0x8d25('0x4'));var rp=require(_0x8d25('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8d25('0x6'));var config=require('../../config/environment');var attributes=require(_0x8d25('0x7'));module[_0x8d25('0x8')]=function(_0x562ec8,_0x277c59){return _0x562ec8[_0x8d25('0x9')](_0x8d25('0xa'),attributes,{'tableName':_0x8d25('0xb'),'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 e32986e..e404ff4 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 _0xd71f=['http','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x314140,_0x5e2b0d){var _0xb354b4=function(_0x3197e2){while(--_0x3197e2){_0x314140['push'](_0x314140['shift']());}};_0xb354b4(++_0x5e2b0d);}(_0xd71f,0x12b));var _0xfd71=function(_0x2dd66e,_0x361709){_0x2dd66e=_0x2dd66e-0x0;var _0x262289=_0xd71f[_0x2dd66e];return _0x262289;};'use strict';var _=require(_0xfd71('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfd71('0x1'));var rs=require(_0xfd71('0x2'));var fs=require('fs');var Redis=require(_0xfd71('0x3'));var db=require(_0xfd71('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfd71('0x5'));var config=require(_0xfd71('0x6'));var jayson=require(_0xfd71('0x7'));var client=jayson[_0xfd71('0x8')][_0xfd71('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xd1e56a,_0x833823,_0x202137){return new BPromise(function(_0x2976e4,_0x421c16){return client['request'](_0xd1e56a,_0x202137)[_0xfd71('0xa')](function(_0x5ed5ab){logger[_0xfd71('0xb')](_0xfd71('0xc'),_0x833823,'request\x20sent');logger[_0xfd71('0xd')](_0xfd71('0xe'),_0x833823,_0xfd71('0xf'),JSON[_0xfd71('0x10')](_0x5ed5ab));if(_0x5ed5ab[_0xfd71('0x11')]){if(_0x5ed5ab[_0xfd71('0x11')][_0xfd71('0x12')]===0x1f4){logger[_0xfd71('0x11')](_0xfd71('0xc'),_0x833823,_0x5ed5ab['error'][_0xfd71('0x13')]);return _0x421c16(_0x5ed5ab[_0xfd71('0x11')][_0xfd71('0x13')]);}logger[_0xfd71('0x11')](_0xfd71('0xc'),_0x833823,_0x5ed5ab[_0xfd71('0x11')][_0xfd71('0x13')]);return _0x2976e4(_0x5ed5ab[_0xfd71('0x11')][_0xfd71('0x13')]);}else{logger[_0xfd71('0xb')](_0xfd71('0xc'),_0x833823,_0xfd71('0xf'));_0x2976e4(_0x5ed5ab[_0xfd71('0x14')][_0xfd71('0x13')]);}})[_0xfd71('0x15')](function(_0x268048){logger[_0xfd71('0x11')](_0xfd71('0xc'),_0x833823,_0x268048);_0x421c16(_0x268048);});});} \ No newline at end of file +var _0x982f=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash'];(function(_0x4544a0,_0xde112a){var _0x47e8bf=function(_0x435331){while(--_0x435331){_0x4544a0['push'](_0x4544a0['shift']());}};_0x47e8bf(++_0xde112a);}(_0x982f,0x77));var _0xf982=function(_0x49ec90,_0x2b2131){_0x49ec90=_0x49ec90-0x0;var _0x50c217=_0x982f[_0x49ec90];return _0x50c217;};'use strict';var _=require(_0xf982('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf982('0x1'));var fs=require('fs');var Redis=require(_0xf982('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xf982('0x3'));var logger=require(_0xf982('0x4'))(_0xf982('0x5'));var config=require(_0xf982('0x6'));var jayson=require(_0xf982('0x7'));var client=jayson[_0xf982('0x8')][_0xf982('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x8e8621,_0x3a2678,_0x7e2568){return new BPromise(function(_0xb76a94,_0x21d0f6){return client[_0xf982('0xa')](_0x8e8621,_0x7e2568)[_0xf982('0xb')](function(_0x2871ed){logger['info'](_0xf982('0xc'),_0x3a2678,_0xf982('0xd'));logger['debug'](_0xf982('0xe'),_0x3a2678,_0xf982('0xd'),JSON[_0xf982('0xf')](_0x2871ed));if(_0x2871ed[_0xf982('0x10')]){if(_0x2871ed['error'][_0xf982('0x11')]===0x1f4){logger[_0xf982('0x10')](_0xf982('0xc'),_0x3a2678,_0x2871ed['error'][_0xf982('0x12')]);return _0x21d0f6(_0x2871ed['error'][_0xf982('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x3a2678,_0x2871ed['error']['message']);return _0xb76a94(_0x2871ed[_0xf982('0x10')]['message']);}else{logger['info']('AnalyticCustomReport,\x20%s,\x20%s',_0x3a2678,_0xf982('0xd'));_0xb76a94(_0x2871ed['result']['message']);}})[_0xf982('0x13')](function(_0xa471e0){logger[_0xf982('0x10')](_0xf982('0xc'),_0x3a2678,_0xa471e0);_0x21d0f6(_0xa471e0);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 3daa444..a03b748 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 _0x644f=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticCustomReport.controller','index','get','/:id','/:id/preview','isAuthenticated','preview','/:id/run','run','/:id/query','query','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x8fb035,_0x217b6d){var _0x3a678d=function(_0x29d401){while(--_0x29d401){_0x8fb035['push'](_0x8fb035['shift']());}};_0x3a678d(++_0x217b6d);}(_0x644f,0x1b7));var _0xf644=function(_0x498334,_0x27b6fe){_0x498334=_0x498334-0x0;var _0x13bb70=_0x644f[_0x498334];return _0x13bb70;};'use strict';var multer=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var path=require(_0xf644('0x2'));var timeout=require(_0xf644('0x3'));var express=require('express');var router=express[_0xf644('0x4')]();var auth=require(_0xf644('0x5'));var interaction=require(_0xf644('0x6'));var config=require(_0xf644('0x7'));var controller=require(_0xf644('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0xf644('0x9')]);router[_0xf644('0xa')](_0xf644('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xf644('0xa')](_0xf644('0xc'),auth[_0xf644('0xd')](),controller[_0xf644('0xe')]);router[_0xf644('0xa')](_0xf644('0xf'),auth['isAuthenticated'](),controller[_0xf644('0x10')]);router['get'](_0xf644('0x11'),auth[_0xf644('0xd')](),controller[_0xf644('0x12')]);router[_0xf644('0x13')]('/',auth['isAuthenticated'](),controller[_0xf644('0x14')]);router[_0xf644('0x15')](_0xf644('0xb'),auth[_0xf644('0xd')](),controller[_0xf644('0x16')]);router[_0xf644('0x17')](_0xf644('0xb'),auth[_0xf644('0xd')](),controller[_0xf644('0x18')]);module[_0xf644('0x19')]=router; \ No newline at end of file +var _0x4d6a=['preview','/:id/run','run','/:id/query','query','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','/:id/preview'];(function(_0x539533,_0x59b89b){var _0x3942f3=function(_0x3b386c){while(--_0x3b386c){_0x539533['push'](_0x539533['shift']());}};_0x3942f3(++_0x59b89b);}(_0x4d6a,0x7e));var _0xa4d6=function(_0x42df0c,_0x702ac3){_0x42df0c=_0x42df0c-0x0;var _0x31e566=_0x4d6a[_0x42df0c];return _0x31e566;};'use strict';var multer=require(_0xa4d6('0x0'));var util=require(_0xa4d6('0x1'));var path=require(_0xa4d6('0x2'));var timeout=require(_0xa4d6('0x3'));var express=require('express');var router=express[_0xa4d6('0x4')]();var auth=require(_0xa4d6('0x5'));var interaction=require(_0xa4d6('0x6'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router['get']('/',auth[_0xa4d6('0x7')](),controller[_0xa4d6('0x8')]);router[_0xa4d6('0x9')](_0xa4d6('0xa'),auth[_0xa4d6('0x7')](),controller['show']);router[_0xa4d6('0x9')](_0xa4d6('0xb'),auth[_0xa4d6('0x7')](),controller[_0xa4d6('0xc')]);router['get'](_0xa4d6('0xd'),auth[_0xa4d6('0x7')](),controller[_0xa4d6('0xe')]);router['get'](_0xa4d6('0xf'),auth[_0xa4d6('0x7')](),controller[_0xa4d6('0x10')]);router['post']('/',auth[_0xa4d6('0x7')](),controller[_0xa4d6('0x11')]);router[_0xa4d6('0x12')](_0xa4d6('0xa'),auth[_0xa4d6('0x7')](),controller[_0xa4d6('0x13')]);router[_0xa4d6('0x14')](_0xa4d6('0xa'),auth[_0xa4d6('0x7')](),controller[_0xa4d6('0x15')]);module[_0xa4d6('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index d99b318..6f73469 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 _0x8ac7=['STRING','TEXT','sequelize','exports'];(function(_0x876029,_0x1cfea2){var _0x370fc5=function(_0x41d3da){while(--_0x41d3da){_0x876029['push'](_0x876029['shift']());}};_0x370fc5(++_0x1cfea2);}(_0x8ac7,0x132));var _0x78ac=function(_0x33ad81,_0x2f6912){_0x33ad81=_0x33ad81-0x0;var _0x41dd1b=_0x8ac7[_0x33ad81];return _0x41dd1b;};'use strict';var Sequelize=require(_0x78ac('0x0'));module[_0x78ac('0x1')]={'name':{'type':Sequelize[_0x78ac('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x78ac('0x2')]},'parent':{'type':Sequelize[_0x78ac('0x2')]},'table':{'type':Sequelize[_0x78ac('0x2')]},'conditions':{'type':Sequelize[_0x78ac('0x3')]},'joins':{'type':Sequelize[_0x78ac('0x3')]}}; \ No newline at end of file +var _0x8219=['TEXT','sequelize','exports','STRING'];(function(_0x2a162d,_0x56fb94){var _0x4e82a7=function(_0x4a4f5d){while(--_0x4a4f5d){_0x2a162d['push'](_0x2a162d['shift']());}};_0x4e82a7(++_0x56fb94);}(_0x8219,0x101));var _0x9821=function(_0x382d8e,_0x2a5761){_0x382d8e=_0x382d8e-0x0;var _0x23993d=_0x8219[_0x382d8e];return _0x23993d;};'use strict';var Sequelize=require(_0x9821('0x0'));module[_0x9821('0x1')]={'name':{'type':Sequelize[_0x9821('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0x9821('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x9821('0x3')]},'joins':{'type':Sequelize[_0x9821('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 4b897be..6dbb9eb 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 _0xb545=['value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','from','table','MetricId','function','replace','format','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','toString','sequelize','QueryTypes','SELECT','right_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','ROUND(%s)','IS\x20NULL','IS\x20EMPTY','metric','alias','No\x20available\x20data','output','web','fullPath','%s-%s.%s','randomstring','generate','default','cdr','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../components/export/','savename','countTable','COUNT(*)','run','DATE(%s)','keyBy','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','get','DefaultReports','UserProfileResource','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','rows','catch','show','params','options','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Reports','UserProfileSection','userProfileId','autoAssociation','error','body','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','HOUR(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition'];(function(_0x212fcc,_0x1a8867){var _0x4d8190=function(_0x347f7b){while(--_0x347f7b){_0x212fcc['push'](_0x212fcc['shift']());}};_0x4d8190(++_0x1a8867);}(_0xb545,0xe2));var _0x5b54=function(_0x4e71f7,_0x147594){_0x4e71f7=_0x4e71f7-0x0;var _0x29970b=_0xb545[_0x4e71f7];return _0x29970b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5b54('0x0'));var rimraf=require(_0x5b54('0x1'));var zipdir=require(_0x5b54('0x2'));var jsonpatch=require(_0x5b54('0x3'));var rp=require(_0x5b54('0x4'));var moment=require(_0x5b54('0x5'));var BPromise=require(_0x5b54('0x6'));var Mustache=require(_0x5b54('0x7'));var util=require(_0x5b54('0x8'));var path=require(_0x5b54('0x9'));var sox=require('sox');var csv=require(_0x5b54('0xa'));var ejs=require(_0x5b54('0xb'));var fs=require('fs');var _=require(_0x5b54('0xc'));var squel=require(_0x5b54('0xd'));var crypto=require(_0x5b54('0xe'));var jsforce=require(_0x5b54('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5b54('0xa'));var querystring=require(_0x5b54('0x10'));var Papa=require(_0x5b54('0x11'));var Redis=require(_0x5b54('0x12'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5b54('0x13'));var hardwareService=require(_0x5b54('0x14'));var logger=require(_0x5b54('0x15'))('api');var utils=require(_0x5b54('0x16'));var config=require(_0x5b54('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x121869,_0x332fc0){_0x332fc0=_0x332fc0||0xcc;return function(_0x5b5afc){if(_0x5b5afc){return _0x121869[_0x5b54('0x18')](_0x332fc0);}return _0x121869['status'](_0x332fc0)[_0x5b54('0x19')]();};}function respondWithResult(_0x2c9a99,_0x6abc4e){_0x6abc4e=_0x6abc4e||0xc8;return function(_0x5d6842){if(_0x5d6842){return _0x2c9a99[_0x5b54('0x1a')](_0x6abc4e)[_0x5b54('0x1b')](_0x5d6842);}};}function respondWithFilteredResult(_0x4aa61b,_0xd99618){return function(_0x433b93){if(_0x433b93){var _0x421b64=_0x433b93['count'],_0x1e4c35=_0xd99618[_0x5b54('0x1c')],_0x30e60e=_0xd99618['offset']+_0xd99618[_0x5b54('0x1d')],_0xa8374b;if(_0x30e60e>=_0x421b64){_0x30e60e=_0x421b64;_0xa8374b=0xc8;}else{_0xa8374b=0xce;}_0x4aa61b[_0x5b54('0x1a')](_0xa8374b);return _0x4aa61b['set'](_0x5b54('0x1e'),_0x1e4c35+'-'+_0x30e60e+'/'+_0x421b64)[_0x5b54('0x1b')](_0x433b93);}return null;};}function patchUpdates(_0x387454){return function(_0x441f81){try{jsonpatch[_0x5b54('0x1f')](_0x441f81,_0x387454,!![]);}catch(_0x460591){return BPromise[_0x5b54('0x20')](_0x460591);}return _0x441f81[_0x5b54('0x21')]();};}function saveUpdates(_0x2257d7,_0x74275b){return function(_0x559010){if(_0x559010){return _0x559010[_0x5b54('0x22')](_0x2257d7)[_0x5b54('0x23')](function(_0x206c45){return _0x206c45;});}return null;};}function removeEntity(_0x42bf22,_0x5c29b8){return function(_0x2dada3){if(_0x2dada3){return _0x2dada3[_0x5b54('0x24')]()[_0x5b54('0x23')](function(){var _0x50006a=_0x2dada3[_0x5b54('0x25')]({'plain':!![]});var _0x508e26=_0x5b54('0x26');return db[_0x5b54('0x27')]['destroy']({'where':{'type':_0x508e26,'resourceId':_0x50006a['id']}})[_0x5b54('0x23')](function(){return _0x2dada3;});})['then'](function(){_0x42bf22[_0x5b54('0x1a')](0xcc)[_0x5b54('0x19')]();});}};}function handleEntityNotFound(_0x1588ea,_0x5b918a){return function(_0x1689bd){if(!_0x1689bd){_0x1588ea[_0x5b54('0x18')](0x194);}return _0x1689bd;};}function handleError(_0x19dc0a,_0x141e8b){_0x141e8b=_0x141e8b||0x1f4;return function(_0x420c97){logger['error'](_0x420c97['stack']);if(_0x420c97[_0x5b54('0x28')]){delete _0x420c97[_0x5b54('0x28')];}_0x19dc0a[_0x5b54('0x1a')](_0x141e8b)[_0x5b54('0x29')](_0x420c97);};}exports[_0x5b54('0x2a')]=function(_0x562ab1,_0x4d8180){var _0x4b641d={},_0x5275cb={},_0x412048={'count':0x0,'rows':[]};var _0x29e89e=_[_0x5b54('0x2b')](db[_0x5b54('0x2c')][_0x5b54('0x2d')],function(_0x1a37c4){return{'name':_0x1a37c4[_0x5b54('0x2e')],'type':_0x1a37c4[_0x5b54('0x2f')][_0x5b54('0x30')]};});_0x5275cb[_0x5b54('0x31')]=_[_0x5b54('0x2b')](_0x29e89e,_0x5b54('0x28'));_0x5275cb[_0x5b54('0x32')]=_[_0x5b54('0x33')](_0x562ab1[_0x5b54('0x32')]);_0x5275cb[_0x5b54('0x34')]=_[_0x5b54('0x35')](_0x5275cb[_0x5b54('0x31')],_0x5275cb[_0x5b54('0x32')]);_0x4b641d[_0x5b54('0x36')]=_[_0x5b54('0x35')](_0x5275cb[_0x5b54('0x31')],qs[_0x5b54('0x37')](_0x562ab1[_0x5b54('0x32')][_0x5b54('0x37')]));_0x4b641d[_0x5b54('0x36')]=_0x4b641d[_0x5b54('0x36')][_0x5b54('0x38')]?_0x4b641d['attributes']:_0x5275cb[_0x5b54('0x31')];if(!_0x562ab1[_0x5b54('0x32')][_0x5b54('0x39')](_0x5b54('0x3a'))){_0x4b641d[_0x5b54('0x1d')]=qs[_0x5b54('0x1d')](_0x562ab1['query'][_0x5b54('0x1d')]);_0x4b641d[_0x5b54('0x1c')]=qs['offset'](_0x562ab1[_0x5b54('0x32')][_0x5b54('0x1c')]);}_0x4b641d[_0x5b54('0x3b')]=qs['sort'](_0x562ab1[_0x5b54('0x32')][_0x5b54('0x3c')]);_0x4b641d[_0x5b54('0x3d')]=qs['filters'](_[_0x5b54('0x3e')](_0x562ab1[_0x5b54('0x32')],_0x5275cb[_0x5b54('0x34')]));if(_0x562ab1['query'][_0x5b54('0x3f')]){_0x4b641d[_0x5b54('0x3d')]=_['merge'](_0x4b641d[_0x5b54('0x3d')],{'$or':_[_0x5b54('0x2b')](_0x29e89e,function(_0xbf08e4){if(_0xbf08e4[_0x5b54('0x2f')]!=='VIRTUAL'){var _0x33c089={};_0x33c089[_0xbf08e4[_0x5b54('0x28')]]={'$like':'%'+_0x562ab1[_0x5b54('0x32')]['filter']+'%'};return _0x33c089;}})});}_0x4b641d=_[_0x5b54('0x40')]({},_0x4b641d,_0x562ab1['options']);var _0x31f976={'where':_0x4b641d['where']};return db[_0x5b54('0x2c')][_0x5b54('0x41')](_0x31f976)[_0x5b54('0x23')](function(_0x42c727){_0x412048[_0x5b54('0x41')]=_0x42c727;if(_0x562ab1[_0x5b54('0x32')][_0x5b54('0x42')]){_0x4b641d[_0x5b54('0x43')]=[{'all':!![]}];}return db[_0x5b54('0x2c')][_0x5b54('0x44')](_0x4b641d);})['then'](function(_0xfe0486){_0x412048[_0x5b54('0x45')]=_0xfe0486;return _0x412048;})[_0x5b54('0x23')](respondWithFilteredResult(_0x4d8180,_0x4b641d))[_0x5b54('0x46')](handleError(_0x4d8180,null));};exports[_0x5b54('0x47')]=function(_0x568efd,_0x448b74){var _0xf8ab08={'raw':!![],'where':{'id':_0x568efd[_0x5b54('0x48')]['id']}},_0x1c0c42={};_0x1c0c42[_0x5b54('0x31')]=_[_0x5b54('0x33')](db[_0x5b54('0x2c')][_0x5b54('0x2d')]);_0x1c0c42[_0x5b54('0x32')]=_[_0x5b54('0x33')](_0x568efd['query']);_0x1c0c42[_0x5b54('0x34')]=_[_0x5b54('0x35')](_0x1c0c42[_0x5b54('0x31')],_0x1c0c42[_0x5b54('0x32')]);_0xf8ab08[_0x5b54('0x36')]=_['intersection'](_0x1c0c42[_0x5b54('0x31')],qs[_0x5b54('0x37')](_0x568efd['query'][_0x5b54('0x37')]));_0xf8ab08['attributes']=_0xf8ab08[_0x5b54('0x36')]['length']?_0xf8ab08['attributes']:_0x1c0c42[_0x5b54('0x31')];if(_0x568efd[_0x5b54('0x32')][_0x5b54('0x42')]){_0xf8ab08['include']=[{'all':!![]}];}_0xf8ab08=_[_0x5b54('0x40')]({},_0xf8ab08,_0x568efd[_0x5b54('0x49')]);return db[_0x5b54('0x2c')][_0x5b54('0x4a')](_0xf8ab08)[_0x5b54('0x23')](handleEntityNotFound(_0x448b74,null))[_0x5b54('0x23')](respondWithResult(_0x448b74,null))[_0x5b54('0x46')](handleError(_0x448b74,null));};exports[_0x5b54('0x4b')]=function(_0x11d8f2,_0x2c52a3){return db['AnalyticDefaultReport']['create'](_0x11d8f2['body'],{})['then'](function(_0x475423){var _0x56416b=_0x11d8f2['user']['get']({'plain':!![]});if(!_0x56416b)throw new Error(_0x5b54('0x4c'));if(_0x56416b[_0x5b54('0x4d')]===_0x5b54('0x4e')){var _0x5e0d15=_0x475423[_0x5b54('0x25')]({'plain':!![]});var _0x2bd860=_0x5b54('0x4f');return db[_0x5b54('0x50')][_0x5b54('0x4a')]({'where':{'name':_0x2bd860,'userProfileId':_0x56416b[_0x5b54('0x51')]},'raw':!![]})['then'](function(_0x3ac077){if(_0x3ac077&&_0x3ac077[_0x5b54('0x52')]===0x0){return db[_0x5b54('0x27')][_0x5b54('0x4b')]({'name':_0x5e0d15[_0x5b54('0x28')],'resourceId':_0x5e0d15['id'],'type':_0x5b54('0x26'),'sectionId':_0x3ac077['id']},{})[_0x5b54('0x23')](function(){return _0x475423;});}else{return _0x475423;}})[_0x5b54('0x46')](function(_0x161a08){logger[_0x5b54('0x53')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x161a08);throw _0x161a08;});}return _0x475423;})['then'](respondWithResult(_0x2c52a3,0xc9))[_0x5b54('0x46')](handleError(_0x2c52a3,null));};exports[_0x5b54('0x22')]=function(_0x3d6058,_0x204cc0){if(_0x3d6058[_0x5b54('0x54')]['id']){delete _0x3d6058[_0x5b54('0x54')]['id'];}return db[_0x5b54('0x2c')][_0x5b54('0x4a')]({'where':{'id':_0x3d6058[_0x5b54('0x48')]['id']}})[_0x5b54('0x23')](handleEntityNotFound(_0x204cc0,null))['then'](saveUpdates(_0x3d6058[_0x5b54('0x54')],null))[_0x5b54('0x23')](respondWithResult(_0x204cc0,null))[_0x5b54('0x46')](handleError(_0x204cc0,null));};exports[_0x5b54('0x24')]=function(_0x1155f9,_0x2d9164){return db[_0x5b54('0x2c')][_0x5b54('0x4a')]({'where':{'id':_0x1155f9['params']['id']}})[_0x5b54('0x23')](handleEntityNotFound(_0x2d9164,null))[_0x5b54('0x23')](removeEntity(_0x2d9164,null))[_0x5b54('0x46')](handleError(_0x2d9164,null));};exports[_0x5b54('0x55')]=function(_0x1c3baf,_0x1494e2){var _0x15a0e7=0xa;var _0x329271=[_0x5b54('0x56'),_0x5b54('0x57'),'right_join',_0x5b54('0x58')];var _0x514b43={'SUM':_0x5b54('0x59'),'COUNT':_0x5b54('0x5a'),'COUNT DISTINCT':_0x5b54('0x5b'),'MAX':_0x5b54('0x5c'),'MIN':_0x5b54('0x5d'),'AVG':_0x5b54('0x5e'),'GROUP_CONCAT':_0x5b54('0x5f'),'GROUP_CONCAT ASC':_0x5b54('0x60'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x4ef874={'SEC_TO_TIME':_0x5b54('0x61'),'DATE':'DATE(%s)','HOUR':_0x5b54('0x62'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x5b54('0x63')};var _0x361671=function(_0x2e1854){return!_[_0x5b54('0x64')](['IS\x20NULL',_0x5b54('0x65'),'IS\x20EMPTY',_0x5b54('0x66')],_0x2e1854);};var _0x2cc1c7=function(_0x397bfb){if(!_0x397bfb||!_0x397bfb['rules']['length']){return'';}for(var _0x455a69='(',_0x4de6c3=0x0;_0x4de6c3<_0x397bfb[_0x5b54('0x67')]['length'];_0x4de6c3+=0x1){_0x4de6c3>0x0&&(_0x455a69+='\x20'+_0x397bfb[_0x5b54('0x68')]+'\x20');_0x455a69+=_0x397bfb['rules'][_0x4de6c3][_0x5b54('0x69')]?_0x2cc1c7(_0x397bfb['rules'][_0x4de6c3][_0x5b54('0x69')]):_0x397bfb[_0x5b54('0x67')][_0x4de6c3][_0x5b54('0x6a')]+'\x20'+_0x397bfb['rules'][_0x4de6c3]['condition']+(_0x361671(_0x397bfb[_0x5b54('0x67')][_0x4de6c3][_0x5b54('0x6b')])?'\x20'+_0x397bfb[_0x5b54('0x67')][_0x4de6c3][_0x5b54('0x6c')]:'');}return _0x455a69+')';};var _0x5c55ff={'where':{'id':_0x1c3baf['params']['id']}},_0x5dcc65,_0x4fa93e,_0x35764c,_0x23e62f,_0x2a608a;_0x5c55ff=_['merge']({},_0x5c55ff,_0x1c3baf[_0x5b54('0x49')]);return db[_0x5b54('0x2c')][_0x5b54('0x4a')](_0x5c55ff)[_0x5b54('0x23')](function(_0x1282a4){if(_0x1282a4){_0x5dcc65=_0x1282a4;return _0x1282a4[_0x5b54('0x6d')]();}return null;})['then'](function(_0x2f68c6){if(_0x2f68c6){if(!_0x2f68c6[_0x5b54('0x38')]){throw new db[(_0x5b54('0x6e'))][(_0x5b54('0x6f'))](_0x5b54('0x70'),0x193);}_0x4fa93e=_0x2f68c6;return db[_0x5b54('0x71')]['findAll']({'raw':!![]});}return null;})[_0x5b54('0x23')](function(_0x3f6899){if(_0x3f6899){_0x35764c=_['keyBy'](_0x3f6899,'id');var _0xbe38ad;var _0x1ee522=squel[_0x5b54('0x72')]();_0x1ee522[_0x5b54('0x73')](_0x5dcc65[_0x5b54('0x74')]);for(var _0x2e34c8=0x0;_0x2e34c8<_0x4fa93e['length'];_0x2e34c8+=0x1){_0xbe38ad=_0x4fa93e[_0x2e34c8][_0x5b54('0x75')]?_0x35764c[_0x4fa93e[_0x2e34c8][_0x5b54('0x75')]]['metric']:_0x4fa93e[_0x2e34c8]['field'];_0xbe38ad=_0x4fa93e[_0x2e34c8][_0x5b54('0x76')]?_['replace'](_0x514b43[_0x4fa93e[_0x2e34c8]['function']],'%s',_0xbe38ad):_0xbe38ad;_0xbe38ad=_0x4fa93e[_0x2e34c8]['format']?_[_0x5b54('0x77')](_0x4ef874[_0x4fa93e[_0x2e34c8][_0x5b54('0x78')]],'%s',_0xbe38ad):_0xbe38ad;if(_0x4fa93e[_0x2e34c8][_0x5b54('0x79')]){_0x1ee522[_0x5b54('0x69')](_0xbe38ad);}_0x4fa93e[_0x2e34c8][_0x5b54('0x7a')]&&_0x1ee522[_0x5b54('0x3b')](_0xbe38ad,_0x4fa93e[_0x2e34c8][_0x5b54('0x7a')]===_0x5b54('0x7b')?![]:!![]);_0x1ee522[_0x5b54('0x6a')](_0xbe38ad,_0x4fa93e[_0x2e34c8]['alias']||_0xbe38ad);}if(_0x5dcc65[_0x5b54('0x7c')]){_0x5dcc65[_0x5b54('0x7c')]=JSON[_0x5b54('0x7d')](_0x5dcc65[_0x5b54('0x7c')]);for(var _0x5ad2f0=0x0;_0x5ad2f0<_0x5dcc65['joins'][_0x5b54('0x38')];_0x5ad2f0+=0x1){if(_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x2f')]&&_[_0x5b54('0x64')](_0x329271,_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x2f')])&&_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x7e')]&&_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x7f')]&&_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x80')]){_0x1ee522[_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x2f')]](_0x5dcc65['joins'][_0x5ad2f0]['foreignTable'],null,util['format'](_0x5b54('0x81'),_0x5dcc65['table'],_0x5dcc65['joins'][_0x5ad2f0][_0x5b54('0x7e')],_0x5dcc65['joins'][_0x5ad2f0]['foreignTable'],_0x5dcc65[_0x5b54('0x7c')][_0x5ad2f0][_0x5b54('0x80')]));}}}if(_0x5dcc65['conditions']){_0x5dcc65[_0x5b54('0x82')]=JSON[_0x5b54('0x7d')](_0x5dcc65['conditions']);_0x1ee522[_0x5b54('0x3d')](_0x2cc1c7(_0x5dcc65[_0x5b54('0x82')][_0x5b54('0x69')]));}_0x2a608a=_0x1ee522[_0x5b54('0x83')]();_0x1ee522['limit'](_0x15a0e7);_0x1ee522['offset'](0x0);logger[_0x5b54('0x84')](_0x5b54('0x85'),_0x1ee522[_0x5b54('0x86')]());return db[_0x5b54('0x87')]['query'](_0x1ee522[_0x5b54('0x86')](),{'type':db['sequelize'][_0x5b54('0x88')][_0x5b54('0x89')]});}})[_0x5b54('0x23')](respondWithResult(_0x1494e2,null))[_0x5b54('0x46')](handleError(_0x1494e2,null));};function runReport(_0x338316,_0x5bc4a1,_0x109894){var _0x2dd74a=_0x5bc4a1[_0x5b54('0x28')];var _0x14a561=0xa;var _0x2d7920=[_0x5b54('0x56'),_0x5b54('0x57'),_0x5b54('0x8a'),_0x5b54('0x58')];var _0x5ee0e2={'SUM':'SUM(%s)','COUNT':_0x5b54('0x5a'),'COUNT DISTINCT':_0x5b54('0x5b'),'MAX':_0x5b54('0x5c'),'MIN':_0x5b54('0x5d'),'AVG':_0x5b54('0x5e'),'GROUP_CONCAT':_0x5b54('0x5f'),'GROUP_CONCAT ASC':_0x5b54('0x60'),'GROUP_CONCAT DESC':_0x5b54('0x8b')};var _0x204b7b={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x5b54('0x62'),'ROUND':_0x5b54('0x8c'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0xc9ff30=function(_0x1fe7e2){return!_[_0x5b54('0x64')]([_0x5b54('0x8d'),_0x5b54('0x65'),_0x5b54('0x8e'),_0x5b54('0x66')],_0x1fe7e2);};var _0x17e4e8=function(_0x1e7aa1){if(!_0x1e7aa1||!_0x1e7aa1['rules'][_0x5b54('0x38')]){return'';}for(var _0x58af43='(',_0x16de34=0x0;_0x16de34<_0x1e7aa1[_0x5b54('0x67')][_0x5b54('0x38')];_0x16de34+=0x1){_0x16de34>0x0&&(_0x58af43+='\x20'+_0x1e7aa1[_0x5b54('0x68')]+'\x20');_0x58af43+=_0x1e7aa1[_0x5b54('0x67')][_0x16de34][_0x5b54('0x69')]?_0x17e4e8(_0x1e7aa1['rules'][_0x16de34][_0x5b54('0x69')]):_0x1e7aa1[_0x5b54('0x67')][_0x16de34][_0x5b54('0x6a')]+'\x20'+_0x1e7aa1[_0x5b54('0x67')][_0x16de34][_0x5b54('0x6b')]+(_0xc9ff30(_0x1e7aa1[_0x5b54('0x67')][_0x16de34][_0x5b54('0x6b')])?'\x20'+_0x1e7aa1[_0x5b54('0x67')][_0x16de34]['value']:'');}return _0x58af43+')';};var _0x4f37cc={'where':{'id':_0x338316['id']}},_0x1aaf18,_0x2129c1,_0x1e7363,_0x1fb7d9,_0x3b20a9;_0x4f37cc=_[_0x5b54('0x40')]({},_0x4f37cc,_0x109894);return db[_0x5b54('0x2c')][_0x5b54('0x4a')](_0x4f37cc)[_0x5b54('0x23')](function(_0x358464){if(_0x358464){_0x1aaf18=_0x358464;return _0x358464[_0x5b54('0x6d')]();}return null;})['then'](function(_0x10755b){if(_0x10755b){if(!_0x10755b['length']){throw new db[(_0x5b54('0x6e'))][(_0x5b54('0x6f'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x2129c1=_0x10755b;return db['AnalyticMetric'][_0x5b54('0x44')]({'raw':!![]});}return null;})[_0x5b54('0x23')](function(_0x25b353){if(_0x25b353){_0x1e7363=_['keyBy'](_0x25b353,'id');var _0x39522a;var _0x46af73=squel[_0x5b54('0x72')]();_0x46af73[_0x5b54('0x73')](_0x1aaf18['table']);for(var _0x5bc7b5=0x0;_0x5bc7b5<_0x2129c1[_0x5b54('0x38')];_0x5bc7b5+=0x1){_0x39522a=_0x2129c1[_0x5bc7b5][_0x5b54('0x75')]?_0x1e7363[_0x2129c1[_0x5bc7b5][_0x5b54('0x75')]][_0x5b54('0x8f')]:_0x2129c1[_0x5bc7b5][_0x5b54('0x6a')];_0x39522a=_0x2129c1[_0x5bc7b5]['function']?_['replace'](_0x5ee0e2[_0x2129c1[_0x5bc7b5][_0x5b54('0x76')]],'%s',_0x39522a):_0x39522a;_0x39522a=_0x2129c1[_0x5bc7b5][_0x5b54('0x78')]?_[_0x5b54('0x77')](_0x204b7b[_0x2129c1[_0x5bc7b5][_0x5b54('0x78')]],'%s',_0x39522a):_0x39522a;if(_0x2129c1[_0x5bc7b5]['groupBy']){_0x46af73[_0x5b54('0x69')](_0x39522a);}_0x2129c1[_0x5bc7b5][_0x5b54('0x7a')]&&_0x46af73[_0x5b54('0x3b')](_0x39522a,_0x2129c1[_0x5bc7b5][_0x5b54('0x7a')]===_0x5b54('0x7b')?![]:!![]);_0x46af73[_0x5b54('0x6a')](_0x39522a,_0x2129c1[_0x5bc7b5][_0x5b54('0x90')]||_0x39522a);}if(_0x1aaf18['joins']){_0x1aaf18[_0x5b54('0x7c')]=JSON[_0x5b54('0x7d')](_0x1aaf18[_0x5b54('0x7c')]);for(var _0x4b7892=0x0;_0x4b7892<_0x1aaf18[_0x5b54('0x7c')][_0x5b54('0x38')];_0x4b7892+=0x1){if(_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x2f')]&&_[_0x5b54('0x64')](_0x2d7920,_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x2f')])&&_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x7e')]&&_0x1aaf18['joins'][_0x4b7892][_0x5b54('0x7f')]&&_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x80')]){_0x46af73[_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x2f')]](_0x1aaf18['joins'][_0x4b7892]['foreignTable'],null,util[_0x5b54('0x78')]('%s.%s\x20=\x20%s.%s',_0x1aaf18[_0x5b54('0x74')],_0x1aaf18['joins'][_0x4b7892]['parentKey'],_0x1aaf18['joins'][_0x4b7892][_0x5b54('0x7f')],_0x1aaf18[_0x5b54('0x7c')][_0x4b7892][_0x5b54('0x80')]));}}}if(_0x1aaf18['conditions']){_0x1aaf18[_0x5b54('0x82')]=JSON['parse'](_0x1aaf18[_0x5b54('0x82')]);_0x46af73['where'](_0x17e4e8(_0x1aaf18[_0x5b54('0x82')][_0x5b54('0x69')]));}_0x3b20a9=_0x46af73[_0x5b54('0x83')]();_0x46af73['limit'](_0x14a561);_0x46af73[_0x5b54('0x1c')](0x0);logger[_0x5b54('0x84')]('Limited\x20Query:',_0x46af73[_0x5b54('0x86')]());return db[_0x5b54('0x87')][_0x5b54('0x32')](_0x46af73[_0x5b54('0x86')](),{'type':db['sequelize'][_0x5b54('0x88')][_0x5b54('0x89')]});}})['then'](function(_0x370198){if(!_0x370198[_0x5b54('0x38')]){throw new db[(_0x5b54('0x6e'))]['ValidationErrorItem'](_0x5b54('0x91'),0xcc);}if(_0x5bc4a1[_0x5b54('0x92')]===_0x5b54('0x93')){return null;}var _0x7a56ae=_['merge'](_0x5bc4a1,{'name':_0x5bc4a1[_0x5b54('0x94')]||_0x5bc4a1[_0x5b54('0x28')]||_0x1aaf18[_0x5b54('0x28')],'basename':_0x2dd74a,'savename':util['format'](_0x5b54('0x95'),_0x5bc4a1[_0x5b54('0x28')]||_0x1aaf18[_0x5b54('0x28')],require(_0x5b54('0x96'))[_0x5b54('0x97')](0x4),_0x5bc4a1[_0x5b54('0x92')]||'csv'),'reportId':_0x1aaf18['id'],'reportType':_0x5b54('0x98')});return db['AnalyticExtractedReport'][_0x5b54('0x4b')](_0x7a56ae,{'raw':!![]});})[_0x5b54('0x23')](function(_0x4e9669){if(_0x1aaf18['table']===_0x5b54('0x99')){_0x3b20a9[_0x5b54('0x3d')](_0x1aaf18[_0x5b54('0x74')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x5bc4a1[_0x5b54('0x9a')],_0x5bc4a1['endDate']);}else{_0x3b20a9[_0x5b54('0x3d')](_0x1aaf18[_0x5b54('0x74')]+_0x5b54('0x9b'),_0x5bc4a1[_0x5b54('0x9a')],_0x5bc4a1['endDate']);}if(_0x4e9669){logger[_0x5b54('0x9c')](_0x5b54('0x9d'),_0x3b20a9[_0x5b54('0x86')]());require(_0x5b54('0x9e'))[_0x5b54('0x9f')](path['join'](__dirname,_0x5b54('0xa0'),_0x4e9669[_0x5b54('0x92')]),[_0x4e9669['id'],_0x3b20a9[_0x5b54('0x86')](),path[_0x5b54('0x56')](__dirname,'../../files/reports',_0x4e9669[_0x5b54('0xa1')]),_0x2dd74a]);return _0x4e9669;}else{var _0x5d24e4=squel[_0x5b54('0x72')]();_0x5d24e4[_0x5b54('0x73')]('('+_0x3b20a9[_0x5b54('0x86')]()+')',_0x5b54('0xa2'));_0x5d24e4[_0x5b54('0x6a')](_0x5b54('0xa3'),_0x5b54('0x41'));_0x3b20a9[_0x5b54('0x1d')](_0x5bc4a1['limit']||_0x14a561);_0x3b20a9[_0x5b54('0x1c')](_0x5bc4a1[_0x5b54('0x1c')]||0x0);return db[_0x5b54('0x87')]['query'](_0x5d24e4['toString'](),{'type':db['sequelize'][_0x5b54('0x88')]['SELECT']})[_0x5b54('0x23')](function(_0x30eae3){if(!_0x30eae3['length']){_0x1fb7d9=0x0;}else{_0x1fb7d9=_0x30eae3[0x0][_0x5b54('0x41')]||0x0;}return db[_0x5b54('0x87')][_0x5b54('0x32')](_0x3b20a9[_0x5b54('0x86')](),{'type':db['sequelize']['QueryTypes']['SELECT']});})[_0x5b54('0x23')](function(_0x52b0f2){return{'rows':_0x52b0f2||[],'count':_0x1fb7d9};});}});}exports[_0x5b54('0xa4')]=function(_0x516eb4,_0x45d235){return runReport(_0x516eb4[_0x5b54('0x48')],_0x516eb4['query'],_0x516eb4[_0x5b54('0x49')])[_0x5b54('0x23')](respondWithResult(_0x45d235,null))[_0x5b54('0x46')](handleError(_0x45d235,null));};exports['runReport']=runReport;exports[_0x5b54('0x32')]=function(_0x1ebc87,_0x51d02d){var _0x5a1d22=0xa;var _0x3c7cd4=[_0x5b54('0x56'),_0x5b54('0x57'),_0x5b54('0x8a'),_0x5b54('0x58')];var _0x50d201={'SUM':'SUM(%s)','COUNT':_0x5b54('0x5a'),'COUNT DISTINCT':_0x5b54('0x5b'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x5b54('0x5e'),'GROUP_CONCAT':_0x5b54('0x5f'),'GROUP_CONCAT ASC':_0x5b54('0x60'),'GROUP_CONCAT DESC':_0x5b54('0x8b')};var _0xeb7684={'SEC_TO_TIME':_0x5b54('0x61'),'DATE':_0x5b54('0xa5'),'HOUR':'HOUR(%s)','ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x6ad4e2=function(_0x396017){return!_['includes']([_0x5b54('0x8d'),_0x5b54('0x65'),_0x5b54('0x8e'),_0x5b54('0x66')],_0x396017);};var _0x21f4ce=function(_0x5b65a1){if(!_0x5b65a1||!_0x5b65a1[_0x5b54('0x67')][_0x5b54('0x38')]){return'';}for(var _0x337456='(',_0x3a6c78=0x0;_0x3a6c78<_0x5b65a1['rules'][_0x5b54('0x38')];_0x3a6c78+=0x1){_0x3a6c78>0x0&&(_0x337456+='\x20'+_0x5b65a1[_0x5b54('0x68')]+'\x20');_0x337456+=_0x5b65a1[_0x5b54('0x67')][_0x3a6c78][_0x5b54('0x69')]?_0x21f4ce(_0x5b65a1['rules'][_0x3a6c78][_0x5b54('0x69')]):_0x5b65a1[_0x5b54('0x67')][_0x3a6c78]['field']+'\x20'+_0x5b65a1['rules'][_0x3a6c78][_0x5b54('0x6b')]+(_0x6ad4e2(_0x5b65a1[_0x5b54('0x67')][_0x3a6c78][_0x5b54('0x6b')])?'\x20'+_0x5b65a1[_0x5b54('0x67')][_0x3a6c78][_0x5b54('0x6c')]:'');}return _0x337456+')';};var _0x366c15={'where':{'id':_0x1ebc87[_0x5b54('0x48')]['id']}},_0x2b39b6,_0x2742c9,_0x6103ad,_0x35eefc,_0x50aa89;_0x366c15=_['merge']({},_0x366c15,_0x1ebc87['options']);return db[_0x5b54('0x2c')][_0x5b54('0x4a')](_0x366c15)[_0x5b54('0x23')](function(_0x2a4c20){if(_0x2a4c20){_0x2b39b6=_0x2a4c20;return _0x2a4c20[_0x5b54('0x6d')]();}return null;})[_0x5b54('0x23')](function(_0x1c9879){if(_0x1c9879){if(!_0x1c9879[_0x5b54('0x38')]){throw new db[(_0x5b54('0x6e'))][(_0x5b54('0x6f'))](_0x5b54('0x70'),0x193);}_0x2742c9=_0x1c9879;return db[_0x5b54('0x71')][_0x5b54('0x44')]({'raw':!![]});}return null;})[_0x5b54('0x23')](function(_0x1f1566){if(_0x1f1566){_0x6103ad=_[_0x5b54('0xa6')](_0x1f1566,'id');var _0x4098cb;var _0x16a840=squel['select']();_0x16a840['from'](_0x2b39b6['table']);for(var _0x31c3c2=0x0;_0x31c3c2<_0x2742c9['length'];_0x31c3c2+=0x1){_0x4098cb=_0x2742c9[_0x31c3c2]['MetricId']?_0x6103ad[_0x2742c9[_0x31c3c2][_0x5b54('0x75')]]['metric']:_0x2742c9[_0x31c3c2][_0x5b54('0x6a')];_0x4098cb=_0x2742c9[_0x31c3c2][_0x5b54('0x76')]?_[_0x5b54('0x77')](_0x50d201[_0x2742c9[_0x31c3c2][_0x5b54('0x76')]],'%s',_0x4098cb):_0x4098cb;_0x4098cb=_0x2742c9[_0x31c3c2][_0x5b54('0x78')]?_[_0x5b54('0x77')](_0xeb7684[_0x2742c9[_0x31c3c2]['format']],'%s',_0x4098cb):_0x4098cb;if(_0x2742c9[_0x31c3c2][_0x5b54('0x79')]){_0x16a840[_0x5b54('0x69')](_0x4098cb);}_0x2742c9[_0x31c3c2][_0x5b54('0x7a')]&&_0x16a840[_0x5b54('0x3b')](_0x4098cb,_0x2742c9[_0x31c3c2][_0x5b54('0x7a')]==='DESC'?![]:!![]);_0x16a840[_0x5b54('0x6a')](_0x4098cb,_0x2742c9[_0x31c3c2][_0x5b54('0x90')]||_0x4098cb);}if(_0x2b39b6[_0x5b54('0x7c')]){_0x2b39b6[_0x5b54('0x7c')]=JSON[_0x5b54('0x7d')](_0x2b39b6[_0x5b54('0x7c')]);for(var _0x27de7c=0x0;_0x27de7c<_0x2b39b6['joins'][_0x5b54('0x38')];_0x27de7c+=0x1){if(_0x2b39b6[_0x5b54('0x7c')][_0x27de7c][_0x5b54('0x2f')]&&_[_0x5b54('0x64')](_0x3c7cd4,_0x2b39b6['joins'][_0x27de7c]['type'])&&_0x2b39b6[_0x5b54('0x7c')][_0x27de7c][_0x5b54('0x7e')]&&_0x2b39b6[_0x5b54('0x7c')][_0x27de7c][_0x5b54('0x7f')]&&_0x2b39b6[_0x5b54('0x7c')][_0x27de7c][_0x5b54('0x80')]){_0x16a840[_0x2b39b6[_0x5b54('0x7c')][_0x27de7c]['type']](_0x2b39b6['joins'][_0x27de7c][_0x5b54('0x7f')],null,util[_0x5b54('0x78')](_0x5b54('0x81'),_0x2b39b6[_0x5b54('0x74')],_0x2b39b6['joins'][_0x27de7c][_0x5b54('0x7e')],_0x2b39b6['joins'][_0x27de7c]['foreignTable'],_0x2b39b6[_0x5b54('0x7c')][_0x27de7c][_0x5b54('0x80')]));}}}if(_0x2b39b6[_0x5b54('0x82')]){_0x2b39b6['conditions']=JSON[_0x5b54('0x7d')](_0x2b39b6[_0x5b54('0x82')]);_0x16a840[_0x5b54('0x3d')](_0x21f4ce(_0x2b39b6[_0x5b54('0x82')]['group']));}_0x50aa89=_0x16a840['clone']();_0x16a840[_0x5b54('0x1d')](_0x5a1d22);_0x16a840[_0x5b54('0x1c')](0x0);logger['debug'](_0x5b54('0x85'),_0x16a840[_0x5b54('0x86')]());return db[_0x5b54('0x87')][_0x5b54('0x32')](_0x16a840['toString'](),{'type':db[_0x5b54('0x87')][_0x5b54('0x88')][_0x5b54('0x89')]});}})[_0x5b54('0x23')](function(){return{'sql':_0x50aa89[_0x5b54('0x86')]()};})[_0x5b54('0x23')](respondWithResult(_0x51d02d,null))['catch'](handleError(_0x51d02d,null));}; \ No newline at end of file +var _0xcbb8=['AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','select','table','MetricId','replace','format','groupBy','orderBy','DESC','joins','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','parentKey','conditions','parse','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','MIN(%s)','SEC_TO_TIME(%s)','IS\x20NOT\x20EMPTY','keyBy','from','metric','function','alias','clone','No\x20available\x20data','output','%s-%s.%s','randomstring','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','endDate','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','run','runReport','right_join','operator','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','apply','reject','save','update','get','DefaultReports','UserProfileResource','destroy','then','end','error','stack','name','index','AnalyticDefaultReport','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','filter','where','merge','map','VIRTUAL','options','include','findAll','rows','catch','show','params','rawAttributes','includeAll','find','create','user','Reports','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)'];(function(_0x334fbc,_0x48039d){var _0x1c513b=function(_0x1683c4){while(--_0x1683c4){_0x334fbc['push'](_0x334fbc['shift']());}};_0x1c513b(++_0x48039d);}(_0xcbb8,0x193));var _0x8cbb=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0xcbb8[_0x50aa2e];return _0x5e07f0;};'use strict';var pdf=require(_0x8cbb('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8cbb('0x1'));var zipdir=require(_0x8cbb('0x2'));var jsonpatch=require(_0x8cbb('0x3'));var rp=require(_0x8cbb('0x4'));var moment=require(_0x8cbb('0x5'));var BPromise=require(_0x8cbb('0x6'));var Mustache=require(_0x8cbb('0x7'));var util=require(_0x8cbb('0x8'));var path=require(_0x8cbb('0x9'));var sox=require(_0x8cbb('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x8cbb('0xb'));var squel=require(_0x8cbb('0xc'));var crypto=require(_0x8cbb('0xd'));var jsforce=require(_0x8cbb('0xe'));var deskjs=require(_0x8cbb('0xf'));var toCsv=require(_0x8cbb('0x10'));var querystring=require(_0x8cbb('0x11'));var Papa=require(_0x8cbb('0x12'));var Redis=require(_0x8cbb('0x13'));var authService=require(_0x8cbb('0x14'));var qs=require(_0x8cbb('0x15'));var as=require(_0x8cbb('0x16'));var hardwareService=require(_0x8cbb('0x17'));var logger=require(_0x8cbb('0x18'))(_0x8cbb('0x19'));var utils=require(_0x8cbb('0x1a'));var config=require('../../config/environment');var db=require(_0x8cbb('0x1b'))['db'];function respondWithStatusCode(_0x47e119,_0x2a6a4b){_0x2a6a4b=_0x2a6a4b||0xcc;return function(_0xac2742){if(_0xac2742){return _0x47e119[_0x8cbb('0x1c')](_0x2a6a4b);}return _0x47e119['status'](_0x2a6a4b)['end']();};}function respondWithResult(_0x35baba,_0x1a2515){_0x1a2515=_0x1a2515||0xc8;return function(_0x154a50){if(_0x154a50){return _0x35baba[_0x8cbb('0x1d')](_0x1a2515)[_0x8cbb('0x1e')](_0x154a50);}};}function respondWithFilteredResult(_0x26c700,_0x59cf8f){return function(_0x1e34a3){if(_0x1e34a3){var _0x49618e=_0x1e34a3[_0x8cbb('0x1f')],_0x11a361=_0x59cf8f[_0x8cbb('0x20')],_0x5d9a9b=_0x59cf8f[_0x8cbb('0x20')]+_0x59cf8f[_0x8cbb('0x21')],_0x15d64b;if(_0x5d9a9b>=_0x49618e){_0x5d9a9b=_0x49618e;_0x15d64b=0xc8;}else{_0x15d64b=0xce;}_0x26c700[_0x8cbb('0x1d')](_0x15d64b);return _0x26c700['set']('Content-Range',_0x11a361+'-'+_0x5d9a9b+'/'+_0x49618e)[_0x8cbb('0x1e')](_0x1e34a3);}return null;};}function patchUpdates(_0x8bba86){return function(_0x341ef1){try{jsonpatch[_0x8cbb('0x22')](_0x341ef1,_0x8bba86,!![]);}catch(_0x52cccc){return BPromise[_0x8cbb('0x23')](_0x52cccc);}return _0x341ef1[_0x8cbb('0x24')]();};}function saveUpdates(_0x5b5558,_0x122920){return function(_0x585e00){if(_0x585e00){return _0x585e00[_0x8cbb('0x25')](_0x5b5558)['then'](function(_0x3ce409){return _0x3ce409;});}return null;};}function removeEntity(_0x25829c,_0x10c096){return function(_0x1f4b10){if(_0x1f4b10){return _0x1f4b10['destroy']()['then'](function(){var _0x48f6e2=_0x1f4b10[_0x8cbb('0x26')]({'plain':!![]});var _0x113ce9=_0x8cbb('0x27');return db[_0x8cbb('0x28')][_0x8cbb('0x29')]({'where':{'type':_0x113ce9,'resourceId':_0x48f6e2['id']}})[_0x8cbb('0x2a')](function(){return _0x1f4b10;});})[_0x8cbb('0x2a')](function(){_0x25829c[_0x8cbb('0x1d')](0xcc)[_0x8cbb('0x2b')]();});}};}function handleEntityNotFound(_0x417198,_0x507546){return function(_0x36e777){if(!_0x36e777){_0x417198['sendStatus'](0x194);}return _0x36e777;};}function handleError(_0x369c26,_0x5bddf7){_0x5bddf7=_0x5bddf7||0x1f4;return function(_0x34c7a0){logger[_0x8cbb('0x2c')](_0x34c7a0[_0x8cbb('0x2d')]);if(_0x34c7a0['name']){delete _0x34c7a0[_0x8cbb('0x2e')];}_0x369c26[_0x8cbb('0x1d')](_0x5bddf7)['send'](_0x34c7a0);};}exports[_0x8cbb('0x2f')]=function(_0x352b62,_0x4fe579){var _0x117fab={},_0x13d2fa={},_0x6f1035={'count':0x0,'rows':[]};var _0x5fd6a9=_['map'](db[_0x8cbb('0x30')]['rawAttributes'],function(_0x1165c9){return{'name':_0x1165c9[_0x8cbb('0x31')],'type':_0x1165c9[_0x8cbb('0x32')][_0x8cbb('0x33')]};});_0x13d2fa[_0x8cbb('0x34')]=_['map'](_0x5fd6a9,_0x8cbb('0x2e'));_0x13d2fa[_0x8cbb('0x35')]=_[_0x8cbb('0x36')](_0x352b62['query']);_0x13d2fa[_0x8cbb('0x37')]=_['intersection'](_0x13d2fa[_0x8cbb('0x34')],_0x13d2fa[_0x8cbb('0x35')]);_0x117fab[_0x8cbb('0x38')]=_[_0x8cbb('0x39')](_0x13d2fa[_0x8cbb('0x34')],qs[_0x8cbb('0x3a')](_0x352b62[_0x8cbb('0x35')]['fields']));_0x117fab['attributes']=_0x117fab[_0x8cbb('0x38')][_0x8cbb('0x3b')]?_0x117fab[_0x8cbb('0x38')]:_0x13d2fa[_0x8cbb('0x34')];if(!_0x352b62['query'][_0x8cbb('0x3c')]('nolimit')){_0x117fab[_0x8cbb('0x21')]=qs[_0x8cbb('0x21')](_0x352b62['query'][_0x8cbb('0x21')]);_0x117fab[_0x8cbb('0x20')]=qs[_0x8cbb('0x20')](_0x352b62[_0x8cbb('0x35')][_0x8cbb('0x20')]);}_0x117fab[_0x8cbb('0x3d')]=qs[_0x8cbb('0x3e')](_0x352b62[_0x8cbb('0x35')]['sort']);_0x117fab['where']=qs['filters'](_['pick'](_0x352b62[_0x8cbb('0x35')],_0x13d2fa[_0x8cbb('0x37')]));if(_0x352b62[_0x8cbb('0x35')][_0x8cbb('0x3f')]){_0x117fab[_0x8cbb('0x40')]=_[_0x8cbb('0x41')](_0x117fab['where'],{'$or':_[_0x8cbb('0x42')](_0x5fd6a9,function(_0x4d70cb){if(_0x4d70cb['type']!==_0x8cbb('0x43')){var _0x575b50={};_0x575b50[_0x4d70cb['name']]={'$like':'%'+_0x352b62['query'][_0x8cbb('0x3f')]+'%'};return _0x575b50;}})});}_0x117fab=_[_0x8cbb('0x41')]({},_0x117fab,_0x352b62[_0x8cbb('0x44')]);var _0x185848={'where':_0x117fab[_0x8cbb('0x40')]};return db[_0x8cbb('0x30')]['count'](_0x185848)[_0x8cbb('0x2a')](function(_0x17bc82){_0x6f1035[_0x8cbb('0x1f')]=_0x17bc82;if(_0x352b62[_0x8cbb('0x35')]['includeAll']){_0x117fab[_0x8cbb('0x45')]=[{'all':!![]}];}return db[_0x8cbb('0x30')][_0x8cbb('0x46')](_0x117fab);})[_0x8cbb('0x2a')](function(_0x294611){_0x6f1035[_0x8cbb('0x47')]=_0x294611;return _0x6f1035;})[_0x8cbb('0x2a')](respondWithFilteredResult(_0x4fe579,_0x117fab))[_0x8cbb('0x48')](handleError(_0x4fe579,null));};exports[_0x8cbb('0x49')]=function(_0x1f387d,_0x5115cf){var _0x5e7742={'raw':!![],'where':{'id':_0x1f387d[_0x8cbb('0x4a')]['id']}},_0xdb8340={};_0xdb8340[_0x8cbb('0x34')]=_[_0x8cbb('0x36')](db[_0x8cbb('0x30')][_0x8cbb('0x4b')]);_0xdb8340['query']=_['keys'](_0x1f387d[_0x8cbb('0x35')]);_0xdb8340[_0x8cbb('0x37')]=_['intersection'](_0xdb8340[_0x8cbb('0x34')],_0xdb8340['query']);_0x5e7742[_0x8cbb('0x38')]=_[_0x8cbb('0x39')](_0xdb8340[_0x8cbb('0x34')],qs['fields'](_0x1f387d['query'][_0x8cbb('0x3a')]));_0x5e7742['attributes']=_0x5e7742[_0x8cbb('0x38')]['length']?_0x5e7742[_0x8cbb('0x38')]:_0xdb8340[_0x8cbb('0x34')];if(_0x1f387d[_0x8cbb('0x35')][_0x8cbb('0x4c')]){_0x5e7742['include']=[{'all':!![]}];}_0x5e7742=_[_0x8cbb('0x41')]({},_0x5e7742,_0x1f387d[_0x8cbb('0x44')]);return db[_0x8cbb('0x30')][_0x8cbb('0x4d')](_0x5e7742)[_0x8cbb('0x2a')](handleEntityNotFound(_0x5115cf,null))[_0x8cbb('0x2a')](respondWithResult(_0x5115cf,null))[_0x8cbb('0x48')](handleError(_0x5115cf,null));};exports[_0x8cbb('0x4e')]=function(_0x4617b8,_0x29e50f){return db[_0x8cbb('0x30')][_0x8cbb('0x4e')](_0x4617b8['body'],{})[_0x8cbb('0x2a')](function(_0x3bd844){var _0xdece1c=_0x4617b8[_0x8cbb('0x4f')][_0x8cbb('0x26')]({'plain':!![]});if(!_0xdece1c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xdece1c['role']===_0x8cbb('0x4f')){var _0x45dd9a=_0x3bd844[_0x8cbb('0x26')]({'plain':!![]});var _0x5a16d5=_0x8cbb('0x50');return db[_0x8cbb('0x51')][_0x8cbb('0x4d')]({'where':{'name':_0x5a16d5,'userProfileId':_0xdece1c['userProfileId']},'raw':!![]})[_0x8cbb('0x2a')](function(_0x179951){if(_0x179951&&_0x179951[_0x8cbb('0x52')]===0x0){return db[_0x8cbb('0x28')][_0x8cbb('0x4e')]({'name':_0x45dd9a[_0x8cbb('0x2e')],'resourceId':_0x45dd9a['id'],'type':_0x8cbb('0x27'),'sectionId':_0x179951['id']},{})[_0x8cbb('0x2a')](function(){return _0x3bd844;});}else{return _0x3bd844;}})['catch'](function(_0x66fff9){logger['error'](_0x8cbb('0x53'),_0x66fff9);throw _0x66fff9;});}return _0x3bd844;})['then'](respondWithResult(_0x29e50f,0xc9))[_0x8cbb('0x48')](handleError(_0x29e50f,null));};exports['update']=function(_0x30b477,_0xfe321f){if(_0x30b477['body']['id']){delete _0x30b477[_0x8cbb('0x54')]['id'];}return db[_0x8cbb('0x30')][_0x8cbb('0x4d')]({'where':{'id':_0x30b477['params']['id']}})[_0x8cbb('0x2a')](handleEntityNotFound(_0xfe321f,null))[_0x8cbb('0x2a')](saveUpdates(_0x30b477[_0x8cbb('0x54')],null))[_0x8cbb('0x2a')](respondWithResult(_0xfe321f,null))[_0x8cbb('0x48')](handleError(_0xfe321f,null));};exports[_0x8cbb('0x29')]=function(_0x56168f,_0x275bd1){return db['AnalyticDefaultReport'][_0x8cbb('0x4d')]({'where':{'id':_0x56168f['params']['id']}})[_0x8cbb('0x2a')](handleEntityNotFound(_0x275bd1,null))['then'](removeEntity(_0x275bd1,null))[_0x8cbb('0x48')](handleError(_0x275bd1,null));};exports['preview']=function(_0x18c1aa,_0x5787d5){var _0x345737=0xa;var _0x48ee74=[_0x8cbb('0x55'),_0x8cbb('0x56'),'right_join',_0x8cbb('0x57')];var _0x202561={'SUM':_0x8cbb('0x58'),'COUNT':_0x8cbb('0x59'),'COUNT DISTINCT':_0x8cbb('0x5a'),'MAX':_0x8cbb('0x5b'),'MIN':'MIN(%s)','AVG':_0x8cbb('0x5c'),'GROUP_CONCAT':_0x8cbb('0x5d'),'GROUP_CONCAT ASC':_0x8cbb('0x5e'),'GROUP_CONCAT DESC':_0x8cbb('0x5f')};var _0x3a74a2={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x8cbb('0x60'),'ROUND':_0x8cbb('0x61'),'UNIX_TIMESTAMP':_0x8cbb('0x62')};var _0x718eb=function(_0x48858b){return!_[_0x8cbb('0x63')]([_0x8cbb('0x64'),_0x8cbb('0x65'),_0x8cbb('0x66'),'IS\x20NOT\x20EMPTY'],_0x48858b);};var _0x10e77e=function(_0x516d9f){if(!_0x516d9f||!_0x516d9f[_0x8cbb('0x67')][_0x8cbb('0x3b')]){return'';}for(var _0x83ccff='(',_0x317b0b=0x0;_0x317b0b<_0x516d9f['rules'][_0x8cbb('0x3b')];_0x317b0b+=0x1){_0x317b0b>0x0&&(_0x83ccff+='\x20'+_0x516d9f['operator']+'\x20');_0x83ccff+=_0x516d9f[_0x8cbb('0x67')][_0x317b0b][_0x8cbb('0x68')]?_0x10e77e(_0x516d9f[_0x8cbb('0x67')][_0x317b0b][_0x8cbb('0x68')]):_0x516d9f[_0x8cbb('0x67')][_0x317b0b][_0x8cbb('0x69')]+'\x20'+_0x516d9f[_0x8cbb('0x67')][_0x317b0b]['condition']+(_0x718eb(_0x516d9f[_0x8cbb('0x67')][_0x317b0b][_0x8cbb('0x6a')])?'\x20'+_0x516d9f[_0x8cbb('0x67')][_0x317b0b][_0x8cbb('0x6b')]:'');}return _0x83ccff+')';};var _0x23a700={'where':{'id':_0x18c1aa[_0x8cbb('0x4a')]['id']}},_0x142bb9,_0x22e3f1,_0x3ee90b,_0x39f951,_0x3643c3;_0x23a700=_[_0x8cbb('0x41')]({},_0x23a700,_0x18c1aa[_0x8cbb('0x44')]);return db[_0x8cbb('0x30')]['find'](_0x23a700)[_0x8cbb('0x2a')](function(_0x2c02fd){if(_0x2c02fd){_0x142bb9=_0x2c02fd;return _0x2c02fd[_0x8cbb('0x6c')]();}return null;})[_0x8cbb('0x2a')](function(_0x10b336){if(_0x10b336){if(!_0x10b336[_0x8cbb('0x3b')]){throw new db[(_0x8cbb('0x6d'))][(_0x8cbb('0x6e'))](_0x8cbb('0x6f'),0x193);}_0x22e3f1=_0x10b336;return db[_0x8cbb('0x70')][_0x8cbb('0x46')]({'raw':!![]});}return null;})[_0x8cbb('0x2a')](function(_0x208826){if(_0x208826){_0x3ee90b=_['keyBy'](_0x208826,'id');var _0x54e2ca;var _0x4b1ad6=squel[_0x8cbb('0x71')]();_0x4b1ad6['from'](_0x142bb9[_0x8cbb('0x72')]);for(var _0x19dbd2=0x0;_0x19dbd2<_0x22e3f1['length'];_0x19dbd2+=0x1){_0x54e2ca=_0x22e3f1[_0x19dbd2][_0x8cbb('0x73')]?_0x3ee90b[_0x22e3f1[_0x19dbd2][_0x8cbb('0x73')]]['metric']:_0x22e3f1[_0x19dbd2]['field'];_0x54e2ca=_0x22e3f1[_0x19dbd2]['function']?_[_0x8cbb('0x74')](_0x202561[_0x22e3f1[_0x19dbd2]['function']],'%s',_0x54e2ca):_0x54e2ca;_0x54e2ca=_0x22e3f1[_0x19dbd2][_0x8cbb('0x75')]?_[_0x8cbb('0x74')](_0x3a74a2[_0x22e3f1[_0x19dbd2][_0x8cbb('0x75')]],'%s',_0x54e2ca):_0x54e2ca;if(_0x22e3f1[_0x19dbd2][_0x8cbb('0x76')]){_0x4b1ad6[_0x8cbb('0x68')](_0x54e2ca);}_0x22e3f1[_0x19dbd2][_0x8cbb('0x77')]&&_0x4b1ad6[_0x8cbb('0x3d')](_0x54e2ca,_0x22e3f1[_0x19dbd2][_0x8cbb('0x77')]===_0x8cbb('0x78')?![]:!![]);_0x4b1ad6[_0x8cbb('0x69')](_0x54e2ca,_0x22e3f1[_0x19dbd2]['alias']||_0x54e2ca);}if(_0x142bb9[_0x8cbb('0x79')]){_0x142bb9[_0x8cbb('0x79')]=JSON['parse'](_0x142bb9['joins']);for(var _0x30ca57=0x0;_0x30ca57<_0x142bb9[_0x8cbb('0x79')][_0x8cbb('0x3b')];_0x30ca57+=0x1){if(_0x142bb9[_0x8cbb('0x79')][_0x30ca57]['type']&&_['includes'](_0x48ee74,_0x142bb9[_0x8cbb('0x79')][_0x30ca57][_0x8cbb('0x32')])&&_0x142bb9[_0x8cbb('0x79')][_0x30ca57]['parentKey']&&_0x142bb9[_0x8cbb('0x79')][_0x30ca57][_0x8cbb('0x7a')]&&_0x142bb9[_0x8cbb('0x79')][_0x30ca57][_0x8cbb('0x7b')]){_0x4b1ad6[_0x142bb9[_0x8cbb('0x79')][_0x30ca57][_0x8cbb('0x32')]](_0x142bb9['joins'][_0x30ca57][_0x8cbb('0x7a')],null,util[_0x8cbb('0x75')](_0x8cbb('0x7c'),_0x142bb9[_0x8cbb('0x72')],_0x142bb9['joins'][_0x30ca57][_0x8cbb('0x7d')],_0x142bb9['joins'][_0x30ca57]['foreignTable'],_0x142bb9['joins'][_0x30ca57][_0x8cbb('0x7b')]));}}}if(_0x142bb9[_0x8cbb('0x7e')]){_0x142bb9['conditions']=JSON[_0x8cbb('0x7f')](_0x142bb9[_0x8cbb('0x7e')]);_0x4b1ad6[_0x8cbb('0x40')](_0x10e77e(_0x142bb9['conditions']['group']));}_0x3643c3=_0x4b1ad6['clone']();_0x4b1ad6['limit'](_0x345737);_0x4b1ad6[_0x8cbb('0x20')](0x0);logger[_0x8cbb('0x80')](_0x8cbb('0x81'),_0x4b1ad6['toString']());return db[_0x8cbb('0x82')][_0x8cbb('0x35')](_0x4b1ad6[_0x8cbb('0x83')](),{'type':db[_0x8cbb('0x82')][_0x8cbb('0x84')][_0x8cbb('0x85')]});}})['then'](respondWithResult(_0x5787d5,null))[_0x8cbb('0x48')](handleError(_0x5787d5,null));};function runReport(_0xc5e89c,_0x195844,_0xb4ed5d){var _0xf20e8=_0x195844['name'];var _0x4e7bc6=0xa;var _0x39fb09=[_0x8cbb('0x55'),_0x8cbb('0x56'),'right_join',_0x8cbb('0x57')];var _0x3e5280={'SUM':_0x8cbb('0x58'),'COUNT':_0x8cbb('0x59'),'COUNT DISTINCT':_0x8cbb('0x5a'),'MAX':_0x8cbb('0x5b'),'MIN':_0x8cbb('0x86'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x8cbb('0x5d'),'GROUP_CONCAT ASC':_0x8cbb('0x5e'),'GROUP_CONCAT DESC':_0x8cbb('0x5f')};var _0x250a20={'SEC_TO_TIME':_0x8cbb('0x87'),'DATE':'DATE(%s)','HOUR':_0x8cbb('0x60'),'ROUND':_0x8cbb('0x61'),'UNIX_TIMESTAMP':_0x8cbb('0x62')};var _0x1d23fb=function(_0x1db6ed){return!_[_0x8cbb('0x63')]([_0x8cbb('0x64'),_0x8cbb('0x65'),'IS\x20EMPTY',_0x8cbb('0x88')],_0x1db6ed);};var _0x35a4fd=function(_0x2c86a4){if(!_0x2c86a4||!_0x2c86a4['rules'][_0x8cbb('0x3b')]){return'';}for(var _0x4d37cc='(',_0x3f7057=0x0;_0x3f7057<_0x2c86a4[_0x8cbb('0x67')]['length'];_0x3f7057+=0x1){_0x3f7057>0x0&&(_0x4d37cc+='\x20'+_0x2c86a4['operator']+'\x20');_0x4d37cc+=_0x2c86a4[_0x8cbb('0x67')][_0x3f7057][_0x8cbb('0x68')]?_0x35a4fd(_0x2c86a4['rules'][_0x3f7057]['group']):_0x2c86a4[_0x8cbb('0x67')][_0x3f7057]['field']+'\x20'+_0x2c86a4[_0x8cbb('0x67')][_0x3f7057][_0x8cbb('0x6a')]+(_0x1d23fb(_0x2c86a4[_0x8cbb('0x67')][_0x3f7057]['condition'])?'\x20'+_0x2c86a4[_0x8cbb('0x67')][_0x3f7057][_0x8cbb('0x6b')]:'');}return _0x4d37cc+')';};var _0x629e04={'where':{'id':_0xc5e89c['id']}},_0x52e160,_0x4ae392,_0x52779a,_0x9c777b,_0x3a75f7;_0x629e04=_[_0x8cbb('0x41')]({},_0x629e04,_0xb4ed5d);return db[_0x8cbb('0x30')]['find'](_0x629e04)['then'](function(_0x5049eb){if(_0x5049eb){_0x52e160=_0x5049eb;return _0x5049eb[_0x8cbb('0x6c')]();}return null;})[_0x8cbb('0x2a')](function(_0x25f756){if(_0x25f756){if(!_0x25f756[_0x8cbb('0x3b')]){throw new db[(_0x8cbb('0x6d'))][(_0x8cbb('0x6e'))](_0x8cbb('0x6f'),0x193);}_0x4ae392=_0x25f756;return db[_0x8cbb('0x70')][_0x8cbb('0x46')]({'raw':!![]});}return null;})[_0x8cbb('0x2a')](function(_0x315449){if(_0x315449){_0x52779a=_[_0x8cbb('0x89')](_0x315449,'id');var _0x493959;var _0x1b6aa2=squel[_0x8cbb('0x71')]();_0x1b6aa2[_0x8cbb('0x8a')](_0x52e160[_0x8cbb('0x72')]);for(var _0x64b42d=0x0;_0x64b42d<_0x4ae392[_0x8cbb('0x3b')];_0x64b42d+=0x1){_0x493959=_0x4ae392[_0x64b42d][_0x8cbb('0x73')]?_0x52779a[_0x4ae392[_0x64b42d][_0x8cbb('0x73')]][_0x8cbb('0x8b')]:_0x4ae392[_0x64b42d][_0x8cbb('0x69')];_0x493959=_0x4ae392[_0x64b42d]['function']?_[_0x8cbb('0x74')](_0x3e5280[_0x4ae392[_0x64b42d][_0x8cbb('0x8c')]],'%s',_0x493959):_0x493959;_0x493959=_0x4ae392[_0x64b42d][_0x8cbb('0x75')]?_[_0x8cbb('0x74')](_0x250a20[_0x4ae392[_0x64b42d][_0x8cbb('0x75')]],'%s',_0x493959):_0x493959;if(_0x4ae392[_0x64b42d][_0x8cbb('0x76')]){_0x1b6aa2[_0x8cbb('0x68')](_0x493959);}_0x4ae392[_0x64b42d][_0x8cbb('0x77')]&&_0x1b6aa2['order'](_0x493959,_0x4ae392[_0x64b42d][_0x8cbb('0x77')]===_0x8cbb('0x78')?![]:!![]);_0x1b6aa2[_0x8cbb('0x69')](_0x493959,_0x4ae392[_0x64b42d][_0x8cbb('0x8d')]||_0x493959);}if(_0x52e160[_0x8cbb('0x79')]){_0x52e160[_0x8cbb('0x79')]=JSON[_0x8cbb('0x7f')](_0x52e160['joins']);for(var _0x561f3b=0x0;_0x561f3b<_0x52e160['joins'][_0x8cbb('0x3b')];_0x561f3b+=0x1){if(_0x52e160['joins'][_0x561f3b][_0x8cbb('0x32')]&&_[_0x8cbb('0x63')](_0x39fb09,_0x52e160[_0x8cbb('0x79')][_0x561f3b]['type'])&&_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x7d')]&&_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x7a')]&&_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x7b')]){_0x1b6aa2[_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x32')]](_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x7a')],null,util['format'](_0x8cbb('0x7c'),_0x52e160[_0x8cbb('0x72')],_0x52e160[_0x8cbb('0x79')][_0x561f3b]['parentKey'],_0x52e160['joins'][_0x561f3b]['foreignTable'],_0x52e160[_0x8cbb('0x79')][_0x561f3b][_0x8cbb('0x7b')]));}}}if(_0x52e160['conditions']){_0x52e160[_0x8cbb('0x7e')]=JSON[_0x8cbb('0x7f')](_0x52e160[_0x8cbb('0x7e')]);_0x1b6aa2[_0x8cbb('0x40')](_0x35a4fd(_0x52e160[_0x8cbb('0x7e')][_0x8cbb('0x68')]));}_0x3a75f7=_0x1b6aa2[_0x8cbb('0x8e')]();_0x1b6aa2[_0x8cbb('0x21')](_0x4e7bc6);_0x1b6aa2[_0x8cbb('0x20')](0x0);logger[_0x8cbb('0x80')]('Limited\x20Query:',_0x1b6aa2[_0x8cbb('0x83')]());return db[_0x8cbb('0x82')]['query'](_0x1b6aa2[_0x8cbb('0x83')](),{'type':db['sequelize'][_0x8cbb('0x84')][_0x8cbb('0x85')]});}})[_0x8cbb('0x2a')](function(_0x3b7531){if(!_0x3b7531[_0x8cbb('0x3b')]){throw new db['Sequelize']['ValidationErrorItem'](_0x8cbb('0x8f'),0xcc);}if(_0x195844[_0x8cbb('0x90')]==='web'){return null;}var _0x432195=_[_0x8cbb('0x41')](_0x195844,{'name':_0x195844['fullPath']||_0x195844['name']||_0x52e160[_0x8cbb('0x2e')],'basename':_0xf20e8,'savename':util['format'](_0x8cbb('0x91'),_0x195844['name']||_0x52e160[_0x8cbb('0x2e')],require(_0x8cbb('0x92'))['generate'](0x4),_0x195844[_0x8cbb('0x90')]||_0x8cbb('0x93')),'reportId':_0x52e160['id'],'reportType':_0x8cbb('0x94')});return db[_0x8cbb('0x95')][_0x8cbb('0x4e')](_0x432195,{'raw':!![]});})['then'](function(_0x46e66d){if(_0x52e160['table']===_0x8cbb('0x96')){_0x3a75f7[_0x8cbb('0x40')](_0x52e160[_0x8cbb('0x72')]+_0x8cbb('0x97'),_0x195844[_0x8cbb('0x98')],_0x195844['endDate']);}else{_0x3a75f7[_0x8cbb('0x40')](_0x52e160[_0x8cbb('0x72')]+_0x8cbb('0x99'),_0x195844['startDate'],_0x195844[_0x8cbb('0x9a')]);}if(_0x46e66d){logger['info']('Run\x20Query:',_0x3a75f7[_0x8cbb('0x83')]());require(_0x8cbb('0x9b'))[_0x8cbb('0x9c')](path[_0x8cbb('0x55')](__dirname,'../../components/export/',_0x46e66d['output']),[_0x46e66d['id'],_0x3a75f7[_0x8cbb('0x83')](),path[_0x8cbb('0x55')](__dirname,_0x8cbb('0x9d'),_0x46e66d[_0x8cbb('0x9e')]),_0xf20e8]);return _0x46e66d;}else{var _0x52a3e8=squel[_0x8cbb('0x71')]();_0x52a3e8[_0x8cbb('0x8a')]('('+_0x3a75f7[_0x8cbb('0x83')]()+')',_0x8cbb('0x9f'));_0x52a3e8[_0x8cbb('0x69')](_0x8cbb('0xa0'),'count');_0x3a75f7[_0x8cbb('0x21')](_0x195844['limit']||_0x4e7bc6);_0x3a75f7[_0x8cbb('0x20')](_0x195844[_0x8cbb('0x20')]||0x0);return db[_0x8cbb('0x82')][_0x8cbb('0x35')](_0x52a3e8[_0x8cbb('0x83')](),{'type':db[_0x8cbb('0x82')]['QueryTypes'][_0x8cbb('0x85')]})[_0x8cbb('0x2a')](function(_0x50d3ce){if(!_0x50d3ce[_0x8cbb('0x3b')]){_0x9c777b=0x0;}else{_0x9c777b=_0x50d3ce[0x0][_0x8cbb('0x1f')]||0x0;}return db[_0x8cbb('0x82')][_0x8cbb('0x35')](_0x3a75f7[_0x8cbb('0x83')](),{'type':db['sequelize'][_0x8cbb('0x84')][_0x8cbb('0x85')]});})[_0x8cbb('0x2a')](function(_0x55d50f){return{'rows':_0x55d50f||[],'count':_0x9c777b};});}});}exports[_0x8cbb('0xa1')]=function(_0x416359,_0xe0cad7){return runReport(_0x416359[_0x8cbb('0x4a')],_0x416359[_0x8cbb('0x35')],_0x416359['options'])[_0x8cbb('0x2a')](respondWithResult(_0xe0cad7,null))[_0x8cbb('0x48')](handleError(_0xe0cad7,null));};exports[_0x8cbb('0xa2')]=runReport;exports[_0x8cbb('0x35')]=function(_0x3f8877,_0x39c16f){var _0x1fd72f=0xa;var _0x4e3cf6=[_0x8cbb('0x55'),_0x8cbb('0x56'),_0x8cbb('0xa3'),_0x8cbb('0x57')];var _0xe31c50={'SUM':_0x8cbb('0x58'),'COUNT':_0x8cbb('0x59'),'COUNT DISTINCT':_0x8cbb('0x5a'),'MAX':_0x8cbb('0x5b'),'MIN':_0x8cbb('0x86'),'AVG':_0x8cbb('0x5c'),'GROUP_CONCAT':_0x8cbb('0x5d'),'GROUP_CONCAT ASC':_0x8cbb('0x5e'),'GROUP_CONCAT DESC':_0x8cbb('0x5f')};var _0x272f3e={'SEC_TO_TIME':_0x8cbb('0x87'),'DATE':'DATE(%s)','HOUR':_0x8cbb('0x60'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':_0x8cbb('0x62')};var _0x2d95ac=function(_0x4f6874){return!_[_0x8cbb('0x63')]([_0x8cbb('0x64'),_0x8cbb('0x65'),'IS\x20EMPTY',_0x8cbb('0x88')],_0x4f6874);};var _0x36bc96=function(_0xc660af){if(!_0xc660af||!_0xc660af[_0x8cbb('0x67')][_0x8cbb('0x3b')]){return'';}for(var _0x59cd98='(',_0x32340e=0x0;_0x32340e<_0xc660af[_0x8cbb('0x67')][_0x8cbb('0x3b')];_0x32340e+=0x1){_0x32340e>0x0&&(_0x59cd98+='\x20'+_0xc660af[_0x8cbb('0xa4')]+'\x20');_0x59cd98+=_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x68')]?_0x36bc96(_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x68')]):_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x69')]+'\x20'+_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x6a')]+(_0x2d95ac(_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x6a')])?'\x20'+_0xc660af[_0x8cbb('0x67')][_0x32340e][_0x8cbb('0x6b')]:'');}return _0x59cd98+')';};var _0x2ca192={'where':{'id':_0x3f8877['params']['id']}},_0x5e85aa,_0x49c2aa,_0xd6024e,_0xe17245,_0x65c2ab;_0x2ca192=_[_0x8cbb('0x41')]({},_0x2ca192,_0x3f8877[_0x8cbb('0x44')]);return db['AnalyticDefaultReport'][_0x8cbb('0x4d')](_0x2ca192)[_0x8cbb('0x2a')](function(_0x16b675){if(_0x16b675){_0x5e85aa=_0x16b675;return _0x16b675['getFields']();}return null;})[_0x8cbb('0x2a')](function(_0x5c6372){if(_0x5c6372){if(!_0x5c6372['length']){throw new db[(_0x8cbb('0x6d'))][(_0x8cbb('0x6e'))](_0x8cbb('0x6f'),0x193);}_0x49c2aa=_0x5c6372;return db[_0x8cbb('0x70')][_0x8cbb('0x46')]({'raw':!![]});}return null;})[_0x8cbb('0x2a')](function(_0x56a0e7){if(_0x56a0e7){_0xd6024e=_[_0x8cbb('0x89')](_0x56a0e7,'id');var _0x68b441;var _0x4bfac5=squel['select']();_0x4bfac5['from'](_0x5e85aa[_0x8cbb('0x72')]);for(var _0x5f0703=0x0;_0x5f0703<_0x49c2aa[_0x8cbb('0x3b')];_0x5f0703+=0x1){_0x68b441=_0x49c2aa[_0x5f0703]['MetricId']?_0xd6024e[_0x49c2aa[_0x5f0703][_0x8cbb('0x73')]][_0x8cbb('0x8b')]:_0x49c2aa[_0x5f0703][_0x8cbb('0x69')];_0x68b441=_0x49c2aa[_0x5f0703][_0x8cbb('0x8c')]?_[_0x8cbb('0x74')](_0xe31c50[_0x49c2aa[_0x5f0703][_0x8cbb('0x8c')]],'%s',_0x68b441):_0x68b441;_0x68b441=_0x49c2aa[_0x5f0703]['format']?_[_0x8cbb('0x74')](_0x272f3e[_0x49c2aa[_0x5f0703]['format']],'%s',_0x68b441):_0x68b441;if(_0x49c2aa[_0x5f0703][_0x8cbb('0x76')]){_0x4bfac5[_0x8cbb('0x68')](_0x68b441);}_0x49c2aa[_0x5f0703][_0x8cbb('0x77')]&&_0x4bfac5['order'](_0x68b441,_0x49c2aa[_0x5f0703][_0x8cbb('0x77')]===_0x8cbb('0x78')?![]:!![]);_0x4bfac5[_0x8cbb('0x69')](_0x68b441,_0x49c2aa[_0x5f0703][_0x8cbb('0x8d')]||_0x68b441);}if(_0x5e85aa['joins']){_0x5e85aa[_0x8cbb('0x79')]=JSON['parse'](_0x5e85aa['joins']);for(var _0x432776=0x0;_0x432776<_0x5e85aa[_0x8cbb('0x79')][_0x8cbb('0x3b')];_0x432776+=0x1){if(_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x32')]&&_[_0x8cbb('0x63')](_0x4e3cf6,_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x32')])&&_0x5e85aa['joins'][_0x432776][_0x8cbb('0x7d')]&&_0x5e85aa['joins'][_0x432776][_0x8cbb('0x7a')]&&_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x7b')]){_0x4bfac5[_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x32')]](_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x7a')],null,util[_0x8cbb('0x75')](_0x8cbb('0x7c'),_0x5e85aa[_0x8cbb('0x72')],_0x5e85aa[_0x8cbb('0x79')][_0x432776]['parentKey'],_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x7a')],_0x5e85aa[_0x8cbb('0x79')][_0x432776][_0x8cbb('0x7b')]));}}}if(_0x5e85aa['conditions']){_0x5e85aa[_0x8cbb('0x7e')]=JSON[_0x8cbb('0x7f')](_0x5e85aa[_0x8cbb('0x7e')]);_0x4bfac5['where'](_0x36bc96(_0x5e85aa['conditions'][_0x8cbb('0x68')]));}_0x65c2ab=_0x4bfac5[_0x8cbb('0x8e')]();_0x4bfac5['limit'](_0x1fd72f);_0x4bfac5[_0x8cbb('0x20')](0x0);logger[_0x8cbb('0x80')](_0x8cbb('0x81'),_0x4bfac5[_0x8cbb('0x83')]());return db[_0x8cbb('0x82')][_0x8cbb('0x35')](_0x4bfac5[_0x8cbb('0x83')](),{'type':db[_0x8cbb('0x82')][_0x8cbb('0x84')][_0x8cbb('0x85')]});}})[_0x8cbb('0x2a')](function(){return{'sql':_0x65c2ab['toString']()};})[_0x8cbb('0x2a')](respondWithResult(_0x39c16f,null))['catch'](handleError(_0x39c16f,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4b37421..46f8577 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 _0x659d=['util','../../config/logger','moment','request-promise','path','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports'];(function(_0x3cd4c1,_0x21cbe5){var _0x2cf65b=function(_0x4e0d99){while(--_0x4e0d99){_0x3cd4c1['push'](_0x3cd4c1['shift']());}};_0x2cf65b(++_0x21cbe5);}(_0x659d,0x64));var _0xd659=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x659d[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0xd659('0x0'));var logger=require(_0xd659('0x1'))('api');var moment=require(_0xd659('0x2'));var BPromise=require('bluebird');var rp=require(_0xd659('0x3'));var fs=require('fs');var path=require(_0xd659('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd659('0x5'));module[_0xd659('0x6')]=function(_0x1a63c2,_0x3ab055){return _0x1a63c2[_0xd659('0x7')](_0xd659('0x8'),attributes,{'tableName':_0xd659('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc298=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports','define','AnalyticDefaultReport','analytics_default_reports','util','../../config/logger'];(function(_0x4e9274,_0x49576e){var _0x8b474c=function(_0x204cca){while(--_0x204cca){_0x4e9274['push'](_0x4e9274['shift']());}};_0x8b474c(++_0x49576e);}(_0xc298,0x143));var _0x8c29=function(_0x3f8e92,_0x5a20b2){_0x3f8e92=_0x3f8e92-0x0;var _0x5b211b=_0xc298[_0x3f8e92];return _0x5b211b;};'use strict';var _=require('lodash');var util=require(_0x8c29('0x0'));var logger=require(_0x8c29('0x1'))(_0x8c29('0x2'));var moment=require(_0x8c29('0x3'));var BPromise=require(_0x8c29('0x4'));var rp=require(_0x8c29('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8c29('0x6'));var config=require(_0x8c29('0x7'));var attributes=require(_0x8c29('0x8'));module[_0x8c29('0x9')]=function(_0x6cac5d,_0x50a81c){return _0x6cac5d[_0x8c29('0xa')](_0x8c29('0xb'),attributes,{'tableName':_0x8c29('0xc'),'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 6249959..4f1bd64 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 _0x3189=['../../config/environment','jayson/promise','http','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x3c148b,_0x276697){var _0x11e854=function(_0x2f63e8){while(--_0x2f63e8){_0x3c148b['push'](_0x3c148b['shift']());}};_0x11e854(++_0x276697);}(_0x3189,0xae));var _0x9318=function(_0x133208,_0x40f759){_0x133208=_0x133208-0x0;var _0x4c9dcf=_0x3189[_0x133208];return _0x4c9dcf;};'use strict';var _=require(_0x9318('0x0'));var util=require(_0x9318('0x1'));var moment=require('moment');var BPromise=require(_0x9318('0x2'));var rs=require(_0x9318('0x3'));var fs=require('fs');var Redis=require(_0x9318('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9318('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9318('0x6'));var jayson=require(_0x9318('0x7'));var client=jayson['client'][_0x9318('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4bb3c3,_0x4dbe95,_0x2f6831){return new BPromise(function(_0x324307,_0x1bfed6){return client['request'](_0x4bb3c3,_0x2f6831)[_0x9318('0x9')](function(_0x2e8d1c){logger[_0x9318('0xa')](_0x9318('0xb'),_0x4dbe95,'request\x20sent');logger['debug'](_0x9318('0xc'),_0x4dbe95,'request\x20sent',JSON[_0x9318('0xd')](_0x2e8d1c));if(_0x2e8d1c[_0x9318('0xe')]){if(_0x2e8d1c[_0x9318('0xe')]['code']===0x1f4){logger[_0x9318('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c['error'][_0x9318('0xf')]);return _0x1bfed6(_0x2e8d1c['error'][_0x9318('0xf')]);}logger[_0x9318('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x4dbe95,_0x2e8d1c[_0x9318('0xe')][_0x9318('0xf')]);return _0x324307(_0x2e8d1c[_0x9318('0xe')]['message']);}else{logger['info'](_0x9318('0xb'),_0x4dbe95,_0x9318('0x10'));_0x324307(_0x2e8d1c['result'][_0x9318('0xf')]);}})[_0x9318('0x11')](function(_0x5e1238){logger[_0x9318('0xe')](_0x9318('0xb'),_0x4dbe95,_0x5e1238);_0x1bfed6(_0x5e1238);});});} \ No newline at end of file +var _0x750a=['error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','stringify'];(function(_0x51dadc,_0x175d30){var _0x847f19=function(_0x477be3){while(--_0x477be3){_0x51dadc['push'](_0x51dadc['shift']());}};_0x847f19(++_0x175d30);}(_0x750a,0x140));var _0xa750=function(_0x3a48d3,_0xb02a03){_0x3a48d3=_0x3a48d3-0x0;var _0x44210d=_0x750a[_0x3a48d3];return _0x44210d;};'use strict';var _=require('lodash');var util=require(_0xa750('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa750('0x1'));var fs=require('fs');var Redis=require(_0xa750('0x2'));var db=require(_0xa750('0x3'))['db'];var utils=require(_0xa750('0x4'));var logger=require(_0xa750('0x5'))(_0xa750('0x6'));var config=require(_0xa750('0x7'));var jayson=require(_0xa750('0x8'));var client=jayson[_0xa750('0x9')][_0xa750('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x197299,_0x1ae455,_0x3d7c43){return new BPromise(function(_0x47a4dd,_0x53f2cb){return client[_0xa750('0xb')](_0x197299,_0x3d7c43)['then'](function(_0x4458b1){logger[_0xa750('0xc')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1ae455,_0xa750('0xd'));logger[_0xa750('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x1ae455,'request\x20sent',JSON[_0xa750('0xf')](_0x4458b1));if(_0x4458b1['error']){if(_0x4458b1[_0xa750('0x10')][_0xa750('0x11')]===0x1f4){logger['error'](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x53f2cb(_0x4458b1['error'][_0xa750('0x13')]);}logger[_0xa750('0x10')](_0xa750('0x12'),_0x1ae455,_0x4458b1[_0xa750('0x10')][_0xa750('0x13')]);return _0x47a4dd(_0x4458b1[_0xa750('0x10')]['message']);}else{logger[_0xa750('0xc')](_0xa750('0x12'),_0x1ae455,_0xa750('0xd'));_0x47a4dd(_0x4458b1['result'][_0xa750('0x13')]);}})[_0xa750('0x14')](function(_0x58639b){logger['error'](_0xa750('0x12'),_0x1ae455,_0x58639b);_0x53f2cb(_0x58639b);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index 05155d0..3e5eba3 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 _0xe1cb=['express','Router','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller','get','isAuthenticated','index','/:id','preview','/:id/run','run','/:id/query','query','put','update','delete','destroy','multer','util','path'];(function(_0x181b9b,_0x171e4e){var _0x371d50=function(_0x32f23c){while(--_0x32f23c){_0x181b9b['push'](_0x181b9b['shift']());}};_0x371d50(++_0x171e4e);}(_0xe1cb,0x138));var _0xbe1c=function(_0x1ca9eb,_0x99a10b){_0x1ca9eb=_0x1ca9eb-0x0;var _0x2e284e=_0xe1cb[_0x1ca9eb];return _0x2e284e;};'use strict';var multer=require(_0xbe1c('0x0'));var util=require(_0xbe1c('0x1'));var path=require(_0xbe1c('0x2'));var timeout=require('connect-timeout');var express=require(_0xbe1c('0x3'));var router=express[_0xbe1c('0x4')]();var auth=require(_0xbe1c('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xbe1c('0x6'));var controller=require(_0xbe1c('0x7'));router[_0xbe1c('0x8')]('/',auth[_0xbe1c('0x9')](),controller[_0xbe1c('0xa')]);router['get'](_0xbe1c('0xb'),auth[_0xbe1c('0x9')](),controller['show']);router[_0xbe1c('0x8')]('/:id/preview',auth[_0xbe1c('0x9')](),controller[_0xbe1c('0xc')]);router[_0xbe1c('0x8')](_0xbe1c('0xd'),auth[_0xbe1c('0x9')](),controller[_0xbe1c('0xe')]);router['get'](_0xbe1c('0xf'),auth[_0xbe1c('0x9')](),controller[_0xbe1c('0x10')]);router['post']('/',auth[_0xbe1c('0x9')](),controller['create']);router[_0xbe1c('0x11')](_0xbe1c('0xb'),auth[_0xbe1c('0x9')](),controller[_0xbe1c('0x12')]);router[_0xbe1c('0x13')](_0xbe1c('0xb'),auth[_0xbe1c('0x9')](),controller[_0xbe1c('0x14')]);module['exports']=router; \ No newline at end of file +var _0x6b60=['index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated'];(function(_0x1a6799,_0x7f9faa){var _0x348903=function(_0x5bac0b){while(--_0x5bac0b){_0x1a6799['push'](_0x1a6799['shift']());}};_0x348903(++_0x7f9faa);}(_0x6b60,0x1f0));var _0x06b6=function(_0x557fd2,_0x2c0a7a){_0x557fd2=_0x557fd2-0x0;var _0x1b54a2=_0x6b60[_0x557fd2];return _0x1b54a2;};'use strict';var multer=require(_0x06b6('0x0'));var util=require(_0x06b6('0x1'));var path=require(_0x06b6('0x2'));var timeout=require(_0x06b6('0x3'));var express=require(_0x06b6('0x4'));var router=express['Router']();var auth=require(_0x06b6('0x5'));var interaction=require(_0x06b6('0x6'));var config=require('../../config/environment');var controller=require(_0x06b6('0x7'));router[_0x06b6('0x8')]('/',auth[_0x06b6('0x9')](),controller[_0x06b6('0xa')]);router['get'](_0x06b6('0xb'),auth[_0x06b6('0x9')](),controller[_0x06b6('0xc')]);router[_0x06b6('0x8')](_0x06b6('0xd'),auth[_0x06b6('0x9')](),controller[_0x06b6('0xe')]);router[_0x06b6('0x8')](_0x06b6('0xf'),auth[_0x06b6('0x9')](),controller[_0x06b6('0x10')]);router[_0x06b6('0x8')](_0x06b6('0x11'),auth[_0x06b6('0x9')](),controller['query']);router[_0x06b6('0x12')]('/',auth[_0x06b6('0x9')](),controller[_0x06b6('0x13')]);router[_0x06b6('0x14')]('/:id',auth[_0x06b6('0x9')](),controller['update']);router['delete'](_0x06b6('0xb'),auth['isAuthenticated'](),controller[_0x06b6('0x15')]);module[_0x06b6('0x16')]=router; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js b/server/api/analyticExtractedReport/analyticExtractedReport.attributes.js index fd66a00..a4802a4 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 _0xaf0d=['Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','moment','STRING','ENUM','pdf','xlsx','csv','DATE'];(function(_0x163c66,_0x69a3d4){var _0x255ff9=function(_0x334527){while(--_0x334527){_0x163c66['push'](_0x163c66['shift']());}};_0x255ff9(++_0x69a3d4);}(_0xaf0d,0x1cc));var _0xdaf0=function(_0x1aaa6e,_0x5b942c){_0x1aaa6e=_0x1aaa6e-0x0;var _0x47a8b8=_0xaf0d[_0x1aaa6e];return _0x47a8b8;};'use strict';var Sequelize=require(_0xdaf0('0x0'));var moment=require(_0xdaf0('0x1'));module['exports']={'name':{'type':Sequelize[_0xdaf0('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0xdaf0('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xdaf0('0x3')]('csv',_0xdaf0('0x4'),_0xdaf0('0x5')),'allowNull':![],'defaultValue':_0xdaf0('0x6')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize['DATE']},'endDate':{'type':Sequelize[_0xdaf0('0x7')]},'status':{'type':Sequelize[_0xdaf0('0x2')],'defaultValue':_0xdaf0('0x8')},'type':{'type':Sequelize[_0xdaf0('0x3')](_0xdaf0('0x9'),_0xdaf0('0xa')),'allowNull':![],'defaultValue':_0xdaf0('0x9')},'reportId':{'type':Sequelize[_0xdaf0('0xb')](0xb)[_0xdaf0('0xc')]},'reportType':{'type':Sequelize[_0xdaf0('0x2')]}}; \ No newline at end of file +var _0x4322=['exports','STRING','ENUM','csv','pdf','DATE','Loading','manual','INTEGER','sequelize'];(function(_0x4ff980,_0x2d5882){var _0x34bc53=function(_0x256ff0){while(--_0x256ff0){_0x4ff980['push'](_0x4ff980['shift']());}};_0x34bc53(++_0x2d5882);}(_0x4322,0x77));var _0x2432=function(_0x4de2cb,_0x12cfa9){_0x4de2cb=_0x4de2cb-0x0;var _0x169d22=_0x4322[_0x4de2cb];return _0x169d22;};'use strict';var Sequelize=require(_0x2432('0x0'));var moment=require('moment');module[_0x2432('0x1')]={'name':{'type':Sequelize[_0x2432('0x2')],'allowNull':![]},'basename':{'type':Sequelize[_0x2432('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0x2432('0x3')](_0x2432('0x4'),_0x2432('0x5'),'xlsx'),'allowNull':![],'defaultValue':_0x2432('0x4')},'savename':{'type':Sequelize['STRING'],'allowNull':![]},'startDate':{'type':Sequelize[_0x2432('0x6')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0x2432('0x2')],'defaultValue':_0x2432('0x7')},'type':{'type':Sequelize['ENUM'](_0x2432('0x8'),'scheduled'),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0x2432('0x9')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2432('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index 24376cd..be4f555 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 _0x1337=['keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','download','basename','existsSync','join','root','server/files/reports','savename','Sequelize','exists','format','%s.%s','output','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','then','destroy','ExtractedReports','UserProfileResource','error','name','send','index','map','AnalyticExtractedReport','fieldName','key','model'];(function(_0x547456,_0x1de17e){var _0xc1fd7b=function(_0x12be35){while(--_0x12be35){_0x547456['push'](_0x547456['shift']());}};_0xc1fd7b(++_0x1de17e);}(_0x1337,0x14b));var _0x7133=function(_0x14465d,_0x5a7403){_0x14465d=_0x14465d-0x0;var _0x5be222=_0x1337[_0x14465d];return _0x5be222;};'use strict';var pdf=require(_0x7133('0x0'));var emlformat=require(_0x7133('0x1'));var rimraf=require(_0x7133('0x2'));var zipdir=require(_0x7133('0x3'));var jsonpatch=require(_0x7133('0x4'));var rp=require(_0x7133('0x5'));var moment=require(_0x7133('0x6'));var BPromise=require(_0x7133('0x7'));var Mustache=require(_0x7133('0x8'));var util=require(_0x7133('0x9'));var path=require(_0x7133('0xa'));var sox=require(_0x7133('0xb'));var csv=require(_0x7133('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x7133('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7133('0xe'));var toCsv=require(_0x7133('0xc'));var querystring=require('querystring');var Papa=require(_0x7133('0xf'));var Redis=require(_0x7133('0x10'));var authService=require(_0x7133('0x11'));var qs=require(_0x7133('0x12'));var as=require(_0x7133('0x13'));var hardwareService=require(_0x7133('0x14'));var logger=require(_0x7133('0x15'))(_0x7133('0x16'));var utils=require('../../config/utils');var config=require(_0x7133('0x17'));var db=require(_0x7133('0x18'))['db'];function respondWithStatusCode(_0x283d96,_0x2ec6b6){_0x2ec6b6=_0x2ec6b6||0xcc;return function(_0x2d3b98){if(_0x2d3b98){return _0x283d96[_0x7133('0x19')](_0x2ec6b6);}return _0x283d96[_0x7133('0x1a')](_0x2ec6b6)[_0x7133('0x1b')]();};}function respondWithResult(_0x4f0416,_0x13f0ea){_0x13f0ea=_0x13f0ea||0xc8;return function(_0x285b55){if(_0x285b55){return _0x4f0416[_0x7133('0x1a')](_0x13f0ea)[_0x7133('0x1c')](_0x285b55);}};}function respondWithFilteredResult(_0x413e98,_0x417107){return function(_0x5b66dd){if(_0x5b66dd){var _0x1474a4=_0x5b66dd['count'],_0x1cb42d=_0x417107[_0x7133('0x1d')],_0x29d001=_0x417107['offset']+_0x417107[_0x7133('0x1e')],_0xfdaf1f;if(_0x29d001>=_0x1474a4){_0x29d001=_0x1474a4;_0xfdaf1f=0xc8;}else{_0xfdaf1f=0xce;}_0x413e98['status'](_0xfdaf1f);return _0x413e98[_0x7133('0x1f')](_0x7133('0x20'),_0x1cb42d+'-'+_0x29d001+'/'+_0x1474a4)[_0x7133('0x1c')](_0x5b66dd);}return null;};}function patchUpdates(_0x48516c){return function(_0x357a17){try{jsonpatch[_0x7133('0x21')](_0x357a17,_0x48516c,!![]);}catch(_0x3ed74d){return BPromise[_0x7133('0x22')](_0x3ed74d);}return _0x357a17[_0x7133('0x23')]();};}function saveUpdates(_0x1851c0,_0x479ec2){return function(_0x58e4d0){if(_0x58e4d0){return _0x58e4d0['update'](_0x1851c0)[_0x7133('0x24')](function(_0x1475a9){return _0x1475a9;});}return null;};}function removeEntity(_0x2d7c56,_0xcecd2f){return function(_0x584453){if(_0x584453){return _0x584453[_0x7133('0x25')]()[_0x7133('0x24')](function(){var _0x4331b9=_0x584453['get']({'plain':!![]});var _0x153ea9=_0x7133('0x26');return db[_0x7133('0x27')][_0x7133('0x25')]({'where':{'type':_0x153ea9,'resourceId':_0x4331b9['id']}})[_0x7133('0x24')](function(){return _0x584453;});})[_0x7133('0x24')](function(){_0x2d7c56[_0x7133('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x490b84,_0x3d805f){return function(_0x387de2){if(!_0x387de2){_0x490b84[_0x7133('0x19')](0x194);}return _0x387de2;};}function handleError(_0x4c3628,_0xd81aaf){_0xd81aaf=_0xd81aaf||0x1f4;return function(_0x243262){logger[_0x7133('0x28')](_0x243262['stack']);if(_0x243262[_0x7133('0x29')]){delete _0x243262[_0x7133('0x29')];}_0x4c3628['status'](_0xd81aaf)[_0x7133('0x2a')](_0x243262);};}exports[_0x7133('0x2b')]=function(_0x33daa8,_0x38ff3c){var _0x337f25={},_0x46ff21={},_0x525d37={'count':0x0,'rows':[]};var _0x58be0a=_[_0x7133('0x2c')](db[_0x7133('0x2d')]['rawAttributes'],function(_0x4a842e){return{'name':_0x4a842e[_0x7133('0x2e')],'type':_0x4a842e['type'][_0x7133('0x2f')]};});_0x46ff21[_0x7133('0x30')]=_['map'](_0x58be0a,_0x7133('0x29'));_0x46ff21['query']=_[_0x7133('0x31')](_0x33daa8['query']);_0x46ff21[_0x7133('0x32')]=_[_0x7133('0x33')](_0x46ff21['model'],_0x46ff21[_0x7133('0x34')]);_0x337f25[_0x7133('0x35')]=_['intersection'](_0x46ff21[_0x7133('0x30')],qs[_0x7133('0x36')](_0x33daa8['query'][_0x7133('0x36')]));_0x337f25[_0x7133('0x35')]=_0x337f25[_0x7133('0x35')][_0x7133('0x37')]?_0x337f25[_0x7133('0x35')]:_0x46ff21[_0x7133('0x30')];if(!_0x33daa8['query'][_0x7133('0x38')](_0x7133('0x39'))){_0x337f25['limit']=qs['limit'](_0x33daa8[_0x7133('0x34')][_0x7133('0x1e')]);_0x337f25[_0x7133('0x1d')]=qs[_0x7133('0x1d')](_0x33daa8[_0x7133('0x34')]['offset']);}_0x337f25[_0x7133('0x3a')]=qs[_0x7133('0x3b')](_0x33daa8[_0x7133('0x34')][_0x7133('0x3b')]);_0x337f25[_0x7133('0x3c')]=qs['filters'](_[_0x7133('0x3d')](_0x33daa8[_0x7133('0x34')],_0x46ff21[_0x7133('0x32')]));if(_0x33daa8[_0x7133('0x34')][_0x7133('0x3e')]){_0x337f25[_0x7133('0x3c')]=_[_0x7133('0x3f')](_0x337f25[_0x7133('0x3c')],{'$or':_[_0x7133('0x2c')](_0x58be0a,function(_0x5f26a3){if(_0x5f26a3['type']!==_0x7133('0x40')){var _0x5521a7={};_0x5521a7[_0x5f26a3[_0x7133('0x29')]]={'$like':'%'+_0x33daa8[_0x7133('0x34')][_0x7133('0x3e')]+'%'};return _0x5521a7;}})});}_0x337f25=_[_0x7133('0x3f')]({},_0x337f25,_0x33daa8['options']);var _0xb8a836={'where':_0x337f25[_0x7133('0x3c')]};return db['AnalyticExtractedReport']['count'](_0xb8a836)[_0x7133('0x24')](function(_0x3f5f9d){_0x525d37['count']=_0x3f5f9d;if(_0x33daa8[_0x7133('0x34')][_0x7133('0x41')]){_0x337f25[_0x7133('0x42')]=[{'all':!![]}];}return db[_0x7133('0x2d')][_0x7133('0x43')](_0x337f25);})[_0x7133('0x24')](function(_0x5cbda9){_0x525d37[_0x7133('0x44')]=_0x5cbda9;return _0x525d37;})[_0x7133('0x24')](respondWithFilteredResult(_0x38ff3c,_0x337f25))[_0x7133('0x45')](handleError(_0x38ff3c,null));};exports[_0x7133('0x46')]=function(_0xf80ad3,_0x1d8715){var _0x46ec4e={'raw':!![],'where':{'id':_0xf80ad3[_0x7133('0x47')]['id']}},_0x4a7b8f={};_0x4a7b8f[_0x7133('0x30')]=_[_0x7133('0x31')](db[_0x7133('0x2d')][_0x7133('0x48')]);_0x4a7b8f['query']=_[_0x7133('0x31')](_0xf80ad3[_0x7133('0x34')]);_0x4a7b8f[_0x7133('0x32')]=_[_0x7133('0x33')](_0x4a7b8f[_0x7133('0x30')],_0x4a7b8f['query']);_0x46ec4e['attributes']=_['intersection'](_0x4a7b8f['model'],qs[_0x7133('0x36')](_0xf80ad3[_0x7133('0x34')][_0x7133('0x36')]));_0x46ec4e[_0x7133('0x35')]=_0x46ec4e[_0x7133('0x35')][_0x7133('0x37')]?_0x46ec4e[_0x7133('0x35')]:_0x4a7b8f[_0x7133('0x30')];if(_0xf80ad3[_0x7133('0x34')]['includeAll']){_0x46ec4e[_0x7133('0x42')]=[{'all':!![]}];}_0x46ec4e=_[_0x7133('0x3f')]({},_0x46ec4e,_0xf80ad3['options']);return db['AnalyticExtractedReport'][_0x7133('0x49')](_0x46ec4e)[_0x7133('0x24')](handleEntityNotFound(_0x1d8715,null))[_0x7133('0x24')](respondWithResult(_0x1d8715,null))[_0x7133('0x45')](handleError(_0x1d8715,null));};exports[_0x7133('0x4a')]=function(_0x1600fb,_0x43156c){return db[_0x7133('0x2d')][_0x7133('0x4a')](_0x1600fb[_0x7133('0x4b')],{})['then'](function(_0x5efc91){var _0x759bde=_0x1600fb[_0x7133('0x4c')][_0x7133('0x4d')]({'plain':!![]});if(!_0x759bde)throw new Error(_0x7133('0x4e'));if(_0x759bde[_0x7133('0x4f')]===_0x7133('0x4c')){var _0x40e9a1=_0x5efc91[_0x7133('0x4d')]({'plain':!![]});var _0x221154=_0x7133('0x26');return db[_0x7133('0x50')]['find']({'where':{'name':_0x221154,'userProfileId':_0x759bde[_0x7133('0x51')]},'raw':!![]})[_0x7133('0x24')](function(_0x1eb8f8){if(_0x1eb8f8&&_0x1eb8f8[_0x7133('0x52')]===0x0){return db[_0x7133('0x27')][_0x7133('0x4a')]({'name':_0x40e9a1['name'],'resourceId':_0x40e9a1['id'],'type':_0x1eb8f8[_0x7133('0x29')],'sectionId':_0x1eb8f8['id']},{})[_0x7133('0x24')](function(){return _0x5efc91;});}else{return _0x5efc91;}})[_0x7133('0x45')](function(_0x891f64){logger[_0x7133('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x891f64);throw _0x891f64;});}return _0x5efc91;})[_0x7133('0x24')](respondWithResult(_0x43156c,0xc9))[_0x7133('0x45')](handleError(_0x43156c,null));};exports['update']=function(_0x5d654c,_0x545529){if(_0x5d654c[_0x7133('0x4b')]['id']){delete _0x5d654c[_0x7133('0x4b')]['id'];}return db['AnalyticExtractedReport']['find']({'where':{'id':_0x5d654c['params']['id']}})[_0x7133('0x24')](handleEntityNotFound(_0x545529,null))[_0x7133('0x24')](saveUpdates(_0x5d654c[_0x7133('0x4b')],null))[_0x7133('0x24')](respondWithResult(_0x545529,null))['catch'](handleError(_0x545529,null));};exports[_0x7133('0x25')]=function(_0x3946fb,_0x42dbda){return db['AnalyticExtractedReport'][_0x7133('0x49')]({'where':{'id':_0x3946fb[_0x7133('0x47')]['id']}})[_0x7133('0x24')](handleEntityNotFound(_0x42dbda,null))[_0x7133('0x24')](removeEntity(_0x42dbda,null))[_0x7133('0x45')](handleError(_0x42dbda,null));};exports[_0x7133('0x53')]=function(_0x35099a,_0x482274,_0xbb18b8){return db[_0x7133('0x2d')][_0x7133('0x49')]({'where':{'id':_0x35099a['params']['id']},'attributes':[_0x7133('0x29'),_0x7133('0x54'),'savename','output'],'raw':!![]})[_0x7133('0x24')](handleEntityNotFound(_0x482274,null))[_0x7133('0x24')](function(_0x26e9b9){if(_0x26e9b9){if(!fs[_0x7133('0x55')](path[_0x7133('0x56')](config[_0x7133('0x57')],_0x7133('0x58'),_0x26e9b9[_0x7133('0x59')]))){throw new db[(_0x7133('0x5a'))]['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x35099a[_0x7133('0x34')][_0x7133('0x5b')]){return _0x482274['sendStatus'](0xc8);}return _0x482274[_0x7133('0x53')](path['join'](config['root'],_0x7133('0x58'),_0x26e9b9[_0x7133('0x59')]),util[_0x7133('0x5c')](_0x7133('0x5d'),_0x26e9b9[_0x7133('0x54')]||_0x26e9b9[_0x7133('0x29')],_0x26e9b9[_0x7133('0x5e')]['toLowerCase']()));}})[_0x7133('0x45')](handleError(_0x482274,null));}; \ No newline at end of file +var _0x389b=['hasOwnProperty','nolimit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','rows','catch','show','params','include','create','body','user','get','UserProfileSection','find','userProfileId','autoAssociation','download','basename','savename','existsSync','join','root','server/files/reports','exists','output','toLowerCase','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json','reject','save','update','then','destroy','ExtractedReports','UserProfileResource','error','stack','index','map','AnalyticExtractedReport','rawAttributes','fieldName','type','model','name','query','keys','filters','attributes','intersection','fields','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x389b,0x1e3));var _0xb389=function(_0x295583,_0x4756aa){_0x295583=_0x295583-0x0;var _0x4c2ae6=_0x389b[_0x295583];return _0x4c2ae6;};'use strict';var pdf=require(_0xb389('0x0'));var emlformat=require(_0xb389('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb389('0x2'));var jsonpatch=require(_0xb389('0x3'));var rp=require('request-promise');var moment=require(_0xb389('0x4'));var BPromise=require(_0xb389('0x5'));var Mustache=require(_0xb389('0x6'));var util=require(_0xb389('0x7'));var path=require(_0xb389('0x8'));var sox=require(_0xb389('0x9'));var csv=require(_0xb389('0xa'));var ejs=require(_0xb389('0xb'));var fs=require('fs');var _=require(_0xb389('0xc'));var squel=require('squel');var crypto=require(_0xb389('0xd'));var jsforce=require(_0xb389('0xe'));var deskjs=require(_0xb389('0xf'));var toCsv=require(_0xb389('0xa'));var querystring=require(_0xb389('0x10'));var Papa=require(_0xb389('0x11'));var Redis=require(_0xb389('0x12'));var authService=require(_0xb389('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xb389('0x14'));var hardwareService=require(_0xb389('0x15'));var logger=require(_0xb389('0x16'))(_0xb389('0x17'));var utils=require('../../config/utils');var config=require(_0xb389('0x18'));var db=require(_0xb389('0x19'))['db'];function respondWithStatusCode(_0x388eb3,_0xa12d0c){_0xa12d0c=_0xa12d0c||0xcc;return function(_0xba3ad9){if(_0xba3ad9){return _0x388eb3[_0xb389('0x1a')](_0xa12d0c);}return _0x388eb3[_0xb389('0x1b')](_0xa12d0c)[_0xb389('0x1c')]();};}function respondWithResult(_0x24f25,_0x3d2a7e){_0x3d2a7e=_0x3d2a7e||0xc8;return function(_0x596866){if(_0x596866){return _0x24f25[_0xb389('0x1b')](_0x3d2a7e)['json'](_0x596866);}};}function respondWithFilteredResult(_0x3f0e3c,_0x496ea2){return function(_0x31a644){if(_0x31a644){var _0x131da9=_0x31a644[_0xb389('0x1d')],_0x4fe211=_0x496ea2[_0xb389('0x1e')],_0x2c5f8e=_0x496ea2[_0xb389('0x1e')]+_0x496ea2[_0xb389('0x1f')],_0x25861d;if(_0x2c5f8e>=_0x131da9){_0x2c5f8e=_0x131da9;_0x25861d=0xc8;}else{_0x25861d=0xce;}_0x3f0e3c['status'](_0x25861d);return _0x3f0e3c['set']('Content-Range',_0x4fe211+'-'+_0x2c5f8e+'/'+_0x131da9)[_0xb389('0x20')](_0x31a644);}return null;};}function patchUpdates(_0x505bc9){return function(_0x2d4a33){try{jsonpatch['apply'](_0x2d4a33,_0x505bc9,!![]);}catch(_0x208cc6){return BPromise[_0xb389('0x21')](_0x208cc6);}return _0x2d4a33[_0xb389('0x22')]();};}function saveUpdates(_0x3d833e,_0x206d36){return function(_0x3e453a){if(_0x3e453a){return _0x3e453a[_0xb389('0x23')](_0x3d833e)[_0xb389('0x24')](function(_0x28f470){return _0x28f470;});}return null;};}function removeEntity(_0x39dae6,_0x519667){return function(_0x315b83){if(_0x315b83){return _0x315b83[_0xb389('0x25')]()['then'](function(){var _0x116478=_0x315b83['get']({'plain':!![]});var _0x4f964b=_0xb389('0x26');return db[_0xb389('0x27')][_0xb389('0x25')]({'where':{'type':_0x4f964b,'resourceId':_0x116478['id']}})['then'](function(){return _0x315b83;});})[_0xb389('0x24')](function(){_0x39dae6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x513858,_0x3cf112){return function(_0x1a7d9f){if(!_0x1a7d9f){_0x513858[_0xb389('0x1a')](0x194);}return _0x1a7d9f;};}function handleError(_0x288234,_0x4bc669){_0x4bc669=_0x4bc669||0x1f4;return function(_0x5c6bf4){logger[_0xb389('0x28')](_0x5c6bf4[_0xb389('0x29')]);if(_0x5c6bf4['name']){delete _0x5c6bf4['name'];}_0x288234[_0xb389('0x1b')](_0x4bc669)['send'](_0x5c6bf4);};}exports[_0xb389('0x2a')]=function(_0x482d88,_0x31f581){var _0x1cae5a={},_0x3a657b={},_0x340da8={'count':0x0,'rows':[]};var _0x2584e1=_[_0xb389('0x2b')](db[_0xb389('0x2c')][_0xb389('0x2d')],function(_0x4a2c48){return{'name':_0x4a2c48[_0xb389('0x2e')],'type':_0x4a2c48[_0xb389('0x2f')]['key']};});_0x3a657b[_0xb389('0x30')]=_['map'](_0x2584e1,_0xb389('0x31'));_0x3a657b[_0xb389('0x32')]=_[_0xb389('0x33')](_0x482d88[_0xb389('0x32')]);_0x3a657b[_0xb389('0x34')]=_['intersection'](_0x3a657b[_0xb389('0x30')],_0x3a657b[_0xb389('0x32')]);_0x1cae5a[_0xb389('0x35')]=_[_0xb389('0x36')](_0x3a657b[_0xb389('0x30')],qs[_0xb389('0x37')](_0x482d88[_0xb389('0x32')]['fields']));_0x1cae5a['attributes']=_0x1cae5a[_0xb389('0x35')][_0xb389('0x38')]?_0x1cae5a['attributes']:_0x3a657b['model'];if(!_0x482d88[_0xb389('0x32')][_0xb389('0x39')](_0xb389('0x3a'))){_0x1cae5a[_0xb389('0x1f')]=qs['limit'](_0x482d88['query'][_0xb389('0x1f')]);_0x1cae5a[_0xb389('0x1e')]=qs['offset'](_0x482d88[_0xb389('0x32')]['offset']);}_0x1cae5a[_0xb389('0x3b')]=qs[_0xb389('0x3c')](_0x482d88['query'][_0xb389('0x3c')]);_0x1cae5a['where']=qs[_0xb389('0x34')](_['pick'](_0x482d88[_0xb389('0x32')],_0x3a657b['filters']));if(_0x482d88[_0xb389('0x32')][_0xb389('0x3d')]){_0x1cae5a[_0xb389('0x3e')]=_[_0xb389('0x3f')](_0x1cae5a[_0xb389('0x3e')],{'$or':_[_0xb389('0x2b')](_0x2584e1,function(_0x1bcebe){if(_0x1bcebe[_0xb389('0x2f')]!==_0xb389('0x40')){var _0x10f918={};_0x10f918[_0x1bcebe[_0xb389('0x31')]]={'$like':'%'+_0x482d88[_0xb389('0x32')][_0xb389('0x3d')]+'%'};return _0x10f918;}})});}_0x1cae5a=_[_0xb389('0x3f')]({},_0x1cae5a,_0x482d88[_0xb389('0x41')]);var _0x224d8c={'where':_0x1cae5a[_0xb389('0x3e')]};return db[_0xb389('0x2c')][_0xb389('0x1d')](_0x224d8c)['then'](function(_0xa11e9){_0x340da8[_0xb389('0x1d')]=_0xa11e9;if(_0x482d88[_0xb389('0x32')][_0xb389('0x42')]){_0x1cae5a['include']=[{'all':!![]}];}return db[_0xb389('0x2c')]['findAll'](_0x1cae5a);})[_0xb389('0x24')](function(_0x192265){_0x340da8[_0xb389('0x43')]=_0x192265;return _0x340da8;})[_0xb389('0x24')](respondWithFilteredResult(_0x31f581,_0x1cae5a))[_0xb389('0x44')](handleError(_0x31f581,null));};exports[_0xb389('0x45')]=function(_0x2675fa,_0x4c8016){var _0x112225={'raw':!![],'where':{'id':_0x2675fa[_0xb389('0x46')]['id']}},_0x8aa027={};_0x8aa027[_0xb389('0x30')]=_['keys'](db[_0xb389('0x2c')][_0xb389('0x2d')]);_0x8aa027[_0xb389('0x32')]=_[_0xb389('0x33')](_0x2675fa[_0xb389('0x32')]);_0x8aa027[_0xb389('0x34')]=_[_0xb389('0x36')](_0x8aa027['model'],_0x8aa027['query']);_0x112225[_0xb389('0x35')]=_[_0xb389('0x36')](_0x8aa027['model'],qs['fields'](_0x2675fa['query'][_0xb389('0x37')]));_0x112225[_0xb389('0x35')]=_0x112225[_0xb389('0x35')][_0xb389('0x38')]?_0x112225[_0xb389('0x35')]:_0x8aa027[_0xb389('0x30')];if(_0x2675fa[_0xb389('0x32')][_0xb389('0x42')]){_0x112225[_0xb389('0x47')]=[{'all':!![]}];}_0x112225=_['merge']({},_0x112225,_0x2675fa[_0xb389('0x41')]);return db['AnalyticExtractedReport']['find'](_0x112225)[_0xb389('0x24')](handleEntityNotFound(_0x4c8016,null))[_0xb389('0x24')](respondWithResult(_0x4c8016,null))[_0xb389('0x44')](handleError(_0x4c8016,null));};exports['create']=function(_0x28857c,_0x7b5905){return db[_0xb389('0x2c')][_0xb389('0x48')](_0x28857c[_0xb389('0x49')],{})[_0xb389('0x24')](function(_0x650419){var _0x5d06ec=_0x28857c[_0xb389('0x4a')][_0xb389('0x4b')]({'plain':!![]});if(!_0x5d06ec)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d06ec['role']==='user'){var _0x151a27=_0x650419['get']({'plain':!![]});var _0xc38228=_0xb389('0x26');return db[_0xb389('0x4c')][_0xb389('0x4d')]({'where':{'name':_0xc38228,'userProfileId':_0x5d06ec[_0xb389('0x4e')]},'raw':!![]})['then'](function(_0x5086d5){if(_0x5086d5&&_0x5086d5[_0xb389('0x4f')]===0x0){return db['UserProfileResource'][_0xb389('0x48')]({'name':_0x151a27[_0xb389('0x31')],'resourceId':_0x151a27['id'],'type':_0x5086d5[_0xb389('0x31')],'sectionId':_0x5086d5['id']},{})[_0xb389('0x24')](function(){return _0x650419;});}else{return _0x650419;}})['catch'](function(_0x1f58cd){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f58cd);throw _0x1f58cd;});}return _0x650419;})[_0xb389('0x24')](respondWithResult(_0x7b5905,0xc9))[_0xb389('0x44')](handleError(_0x7b5905,null));};exports[_0xb389('0x23')]=function(_0x432a08,_0x85e513){if(_0x432a08[_0xb389('0x49')]['id']){delete _0x432a08[_0xb389('0x49')]['id'];}return db[_0xb389('0x2c')][_0xb389('0x4d')]({'where':{'id':_0x432a08[_0xb389('0x46')]['id']}})[_0xb389('0x24')](handleEntityNotFound(_0x85e513,null))['then'](saveUpdates(_0x432a08['body'],null))[_0xb389('0x24')](respondWithResult(_0x85e513,null))['catch'](handleError(_0x85e513,null));};exports[_0xb389('0x25')]=function(_0x11c12d,_0x1131d4){return db[_0xb389('0x2c')][_0xb389('0x4d')]({'where':{'id':_0x11c12d[_0xb389('0x46')]['id']}})[_0xb389('0x24')](handleEntityNotFound(_0x1131d4,null))[_0xb389('0x24')](removeEntity(_0x1131d4,null))['catch'](handleError(_0x1131d4,null));};exports[_0xb389('0x50')]=function(_0x5e1eb4,_0x477496,_0x2889db){return db[_0xb389('0x2c')][_0xb389('0x4d')]({'where':{'id':_0x5e1eb4[_0xb389('0x46')]['id']},'attributes':[_0xb389('0x31'),_0xb389('0x51'),_0xb389('0x52'),'output'],'raw':!![]})[_0xb389('0x24')](handleEntityNotFound(_0x477496,null))[_0xb389('0x24')](function(_0x468c6c){if(_0x468c6c){if(!fs[_0xb389('0x53')](path[_0xb389('0x54')](config[_0xb389('0x55')],_0xb389('0x56'),_0x468c6c[_0xb389('0x52')]))){throw new db['Sequelize']['ValidationError']('Report\x20not\x20found\x20or\x20empty');}if(_0x5e1eb4[_0xb389('0x32')][_0xb389('0x57')]){return _0x477496[_0xb389('0x1a')](0xc8);}return _0x477496[_0xb389('0x50')](path[_0xb389('0x54')](config[_0xb389('0x55')],'server/files/reports',_0x468c6c[_0xb389('0x52')]),util['format']('%s.%s',_0x468c6c['basename']||_0x468c6c['name'],_0x468c6c[_0xb389('0x58')][_0xb389('0x59')]()));}})[_0xb389('0x44')](handleError(_0x477496,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 599ebcb..59a5ed8 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 _0xf6b6=['util','../../config/logger','api','moment','request-promise','path','rimraf','./analyticExtractedReport.attributes','define','AnalyticExtractedReport','analytics_extracted_reports','lodash'];(function(_0x4afb86,_0x55db3d){var _0x1cea2d=function(_0x5956b0){while(--_0x5956b0){_0x4afb86['push'](_0x4afb86['shift']());}};_0x1cea2d(++_0x55db3d);}(_0xf6b6,0x9b));var _0x6f6b=function(_0x3becd4,_0x1745a8){_0x3becd4=_0x3becd4-0x0;var _0x483386=_0xf6b6[_0x3becd4];return _0x483386;};'use strict';var _=require(_0x6f6b('0x0'));var util=require(_0x6f6b('0x1'));var logger=require(_0x6f6b('0x2'))(_0x6f6b('0x3'));var moment=require(_0x6f6b('0x4'));var BPromise=require('bluebird');var rp=require(_0x6f6b('0x5'));var fs=require('fs');var path=require(_0x6f6b('0x6'));var rimraf=require(_0x6f6b('0x7'));var config=require('../../config/environment');var attributes=require(_0x6f6b('0x8'));module['exports']=function(_0x135d2c,_0xb207c7){return _0x135d2c[_0x6f6b('0x9')](_0x6f6b('0xa'),attributes,{'tableName':_0x6f6b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcfce=['../../config/logger','api','moment','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport','lodash'];(function(_0x3312a3,_0x3f9cdb){var _0x262560=function(_0x51880a){while(--_0x51880a){_0x3312a3['push'](_0x3312a3['shift']());}};_0x262560(++_0x3f9cdb);}(_0xcfce,0x1cd));var _0xecfc=function(_0x1d90ef,_0x39ab6d){_0x1d90ef=_0x1d90ef-0x0;var _0x554777=_0xcfce[_0x1d90ef];return _0x554777;};'use strict';var _=require(_0xecfc('0x0'));var util=require('util');var logger=require(_0xecfc('0x1'))(_0xecfc('0x2'));var moment=require(_0xecfc('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xecfc('0x4'));var rimraf=require(_0xecfc('0x5'));var config=require(_0xecfc('0x6'));var attributes=require(_0xecfc('0x7'));module[_0xecfc('0x8')]=function(_0x2d2224,_0x433750){return _0x2d2224[_0xecfc('0x9')](_0xecfc('0xa'),attributes,{'tableName':'analytics_extracted_reports','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js b/server/api/analyticExtractedReport/analyticExtractedReport.rpc.js index c661f25..ee25fff 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 _0xf9d5=['AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info'];(function(_0x278479,_0x4978fd){var _0x21377c=function(_0x3dcae8){while(--_0x3dcae8){_0x278479['push'](_0x278479['shift']());}};_0x21377c(++_0x4978fd);}(_0xf9d5,0x158));var _0x5f9d=function(_0x1f449d,_0x215910){_0x1f449d=_0x1f449d-0x0;var _0x30daf0=_0xf9d5[_0x1f449d];return _0x30daf0;};'use strict';var _=require(_0x5f9d('0x0'));var util=require(_0x5f9d('0x1'));var moment=require(_0x5f9d('0x2'));var BPromise=require(_0x5f9d('0x3'));var rs=require(_0x5f9d('0x4'));var fs=require('fs');var Redis=require(_0x5f9d('0x5'));var db=require(_0x5f9d('0x6'))['db'];var utils=require(_0x5f9d('0x7'));var logger=require(_0x5f9d('0x8'))(_0x5f9d('0x9'));var config=require(_0x5f9d('0xa'));var jayson=require(_0x5f9d('0xb'));var client=jayson[_0x5f9d('0xc')][_0x5f9d('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x476db5,_0x4e07c9,_0x2be133){return new BPromise(function(_0x52bdbb,_0x1f33f3){return client[_0x5f9d('0xe')](_0x476db5,_0x2be133)['then'](function(_0x3c162f){logger[_0x5f9d('0xf')](_0x5f9d('0x10'),_0x4e07c9,_0x5f9d('0x11'));logger[_0x5f9d('0x12')](_0x5f9d('0x13'),_0x4e07c9,'request\x20sent',JSON['stringify'](_0x3c162f));if(_0x3c162f['error']){if(_0x3c162f[_0x5f9d('0x14')][_0x5f9d('0x15')]===0x1f4){logger[_0x5f9d('0x14')](_0x5f9d('0x10'),_0x4e07c9,_0x3c162f[_0x5f9d('0x14')][_0x5f9d('0x16')]);return _0x1f33f3(_0x3c162f[_0x5f9d('0x14')][_0x5f9d('0x16')]);}logger['error'](_0x5f9d('0x10'),_0x4e07c9,_0x3c162f[_0x5f9d('0x14')][_0x5f9d('0x16')]);return _0x52bdbb(_0x3c162f[_0x5f9d('0x14')][_0x5f9d('0x16')]);}else{logger[_0x5f9d('0xf')](_0x5f9d('0x10'),_0x4e07c9,_0x5f9d('0x11'));_0x52bdbb(_0x3c162f[_0x5f9d('0x17')]['message']);}})['catch'](function(_0x2c8985){logger[_0x5f9d('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x4e07c9,_0x2c8985);_0x1f33f3(_0x2c8985);});});} \ No newline at end of file +var _0xf333=['catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4bb581,_0x6f7037){var _0x316bf5=function(_0x1f6ed0){while(--_0x1f6ed0){_0x4bb581['push'](_0x4bb581['shift']());}};_0x316bf5(++_0x6f7037);}(_0xf333,0x15f));var _0x3f33=function(_0x4d8980,_0x2036f5){_0x4d8980=_0x4d8980-0x0;var _0x4c72fd=_0xf333[_0x4d8980];return _0x4c72fd;};'use strict';var _=require('lodash');var util=require(_0x3f33('0x0'));var moment=require(_0x3f33('0x1'));var BPromise=require(_0x3f33('0x2'));var rs=require(_0x3f33('0x3'));var fs=require('fs');var Redis=require(_0x3f33('0x4'));var db=require(_0x3f33('0x5'))['db'];var utils=require(_0x3f33('0x6'));var logger=require(_0x3f33('0x7'))(_0x3f33('0x8'));var config=require(_0x3f33('0x9'));var jayson=require(_0x3f33('0xa'));var client=jayson[_0x3f33('0xb')][_0x3f33('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1b5c0c,_0x9d2e8c,_0x14f2af){return new BPromise(function(_0x55143e,_0x49f8db){return client[_0x3f33('0xd')](_0x1b5c0c,_0x14f2af)['then'](function(_0x40a3a9){logger[_0x3f33('0xe')](_0x3f33('0xf'),_0x9d2e8c,_0x3f33('0x10'));logger[_0x3f33('0x11')](_0x3f33('0x12'),_0x9d2e8c,_0x3f33('0x10'),JSON[_0x3f33('0x13')](_0x40a3a9));if(_0x40a3a9[_0x3f33('0x14')]){if(_0x40a3a9[_0x3f33('0x14')][_0x3f33('0x15')]===0x1f4){logger[_0x3f33('0x14')](_0x3f33('0xf'),_0x9d2e8c,_0x40a3a9[_0x3f33('0x14')]['message']);return _0x49f8db(_0x40a3a9[_0x3f33('0x14')][_0x3f33('0x16')]);}logger['error'](_0x3f33('0xf'),_0x9d2e8c,_0x40a3a9['error']['message']);return _0x55143e(_0x40a3a9['error']['message']);}else{logger[_0x3f33('0xe')](_0x3f33('0xf'),_0x9d2e8c,_0x3f33('0x10'));_0x55143e(_0x40a3a9[_0x3f33('0x17')][_0x3f33('0x16')]);}})[_0x3f33('0x18')](function(_0x33dc2e){logger['error'](_0x3f33('0xf'),_0x9d2e8c,_0x33dc2e);_0x49f8db(_0x33dc2e);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index c0ba5ad..07999ec 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 _0x1596=['show','/:id/download','download','create','update','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./analyticExtractedReport.controller','get','isAuthenticated','/:id'];(function(_0x46cd51,_0x2b5be8){var _0x1a1461=function(_0x54759b){while(--_0x54759b){_0x46cd51['push'](_0x46cd51['shift']());}};_0x1a1461(++_0x2b5be8);}(_0x1596,0x16f));var _0x6159=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x1596[_0x4e676e];return _0x336a3c;};'use strict';var multer=require(_0x6159('0x0'));var util=require(_0x6159('0x1'));var path=require(_0x6159('0x2'));var timeout=require(_0x6159('0x3'));var express=require('express');var router=express[_0x6159('0x4')]();var auth=require(_0x6159('0x5'));var interaction=require(_0x6159('0x6'));var config=require('../../config/environment');var controller=require(_0x6159('0x7'));router[_0x6159('0x8')]('/',auth[_0x6159('0x9')](),controller['index']);router[_0x6159('0x8')](_0x6159('0xa'),auth[_0x6159('0x9')](),controller[_0x6159('0xb')]);router[_0x6159('0x8')](_0x6159('0xc'),auth['isAuthenticated'](),controller[_0x6159('0xd')]);router['post']('/',auth[_0x6159('0x9')](),controller[_0x6159('0xe')]);router['put'](_0x6159('0xa'),auth[_0x6159('0x9')](),controller[_0x6159('0xf')]);router['delete']('/:id',auth[_0x6159('0x9')](),controller[_0x6159('0x10')]);module[_0x6159('0x11')]=router; \ No newline at end of file +var _0x8801=['../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x83f529,_0x3d55d7){var _0x4383b8=function(_0x6ceff1){while(--_0x6ceff1){_0x83f529['push'](_0x83f529['shift']());}};_0x4383b8(++_0x3d55d7);}(_0x8801,0x116));var _0x1880=function(_0x4e1602,_0x495eef){_0x4e1602=_0x4e1602-0x0;var _0x4fcc5b=_0x8801[_0x4e1602];return _0x4fcc5b;};'use strict';var multer=require(_0x1880('0x0'));var util=require(_0x1880('0x1'));var path=require(_0x1880('0x2'));var timeout=require(_0x1880('0x3'));var express=require(_0x1880('0x4'));var router=express[_0x1880('0x5')]();var auth=require(_0x1880('0x6'));var interaction=require(_0x1880('0x7'));var config=require(_0x1880('0x8'));var controller=require(_0x1880('0x9'));router[_0x1880('0xa')]('/',auth[_0x1880('0xb')](),controller['index']);router[_0x1880('0xa')]('/:id',auth[_0x1880('0xb')](),controller[_0x1880('0xc')]);router[_0x1880('0xa')](_0x1880('0xd'),auth[_0x1880('0xb')](),controller[_0x1880('0xe')]);router[_0x1880('0xf')]('/',auth[_0x1880('0xb')](),controller[_0x1880('0x10')]);router[_0x1880('0x11')]('/:id',auth[_0x1880('0xb')](),controller[_0x1880('0x12')]);router[_0x1880('0x13')]('/:id',auth[_0x1880('0xb')](),controller[_0x1880('0x14')]);module[_0x1880('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index 2fcef4e..f9bebc6 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 _0xe14b=['sequelize','exports','STRING'];(function(_0x14b2e4,_0x1c6c09){var _0x8cb7a8=function(_0xabb109){while(--_0xabb109){_0x14b2e4['push'](_0x14b2e4['shift']());}};_0x8cb7a8(++_0x1c6c09);}(_0xe14b,0x93));var _0xbe14=function(_0x549a0c,_0x4c3bdb){_0x549a0c=_0x549a0c-0x0;var _0x62fdf8=_0xe14b[_0x549a0c];return _0x62fdf8;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize['STRING']},'function':{'type':Sequelize[_0xbe14('0x2')]},'format':{'type':Sequelize[_0xbe14('0x2')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize[_0xbe14('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x1261=['exports','TEXT','STRING','BOOLEAN'];(function(_0x1a1cd2,_0x49add5){var _0x5b2b22=function(_0x33d720){while(--_0x33d720){_0x1a1cd2['push'](_0x1a1cd2['shift']());}};_0x5b2b22(++_0x49add5);}(_0x1261,0x144));var _0x1126=function(_0x1877e2,_0x2b76d4){_0x1877e2=_0x1877e2-0x0;var _0x44e96a=_0x1261[_0x1877e2];return _0x44e96a;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'field':{'type':Sequelize[_0x1126('0x1')]},'alias':{'type':Sequelize[_0x1126('0x2')]},'function':{'type':Sequelize[_0x1126('0x2')]},'format':{'type':Sequelize[_0x1126('0x2')]},'groupBy':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x1126('0x2')]},'custom':{'type':Sequelize[_0x1126('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 6e44898..ed38eec 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 _0xf7f7=['pick','filter','where','VIRTUAL','options','include','rows','catch','params','length','includeAll','merge','create','bulkCreate','body','find','AnalyticCustomReport','findOne','sequelize','transaction','CustomReportId','findAll','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','name','send','index','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0xf7f7,0x192));var _0x7f7f=function(_0x35d4e9,_0x298c61){_0x35d4e9=_0x35d4e9-0x0;var _0x5c2770=_0xf7f7[_0x35d4e9];return _0x5c2770;};'use strict';var pdf=require(_0x7f7f('0x0'));var emlformat=require(_0x7f7f('0x1'));var rimraf=require(_0x7f7f('0x2'));var zipdir=require(_0x7f7f('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x7f7f('0x4'));var BPromise=require(_0x7f7f('0x5'));var Mustache=require(_0x7f7f('0x6'));var util=require(_0x7f7f('0x7'));var path=require('path');var sox=require(_0x7f7f('0x8'));var csv=require(_0x7f7f('0x9'));var ejs=require(_0x7f7f('0xa'));var fs=require('fs');var _=require(_0x7f7f('0xb'));var squel=require('squel');var crypto=require(_0x7f7f('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7f7f('0xd'));var toCsv=require('to-csv');var querystring=require(_0x7f7f('0xe'));var Papa=require('papaparse');var Redis=require(_0x7f7f('0xf'));var authService=require(_0x7f7f('0x10'));var qs=require(_0x7f7f('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7f7f('0x12'));var logger=require(_0x7f7f('0x13'))(_0x7f7f('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3c4a43,_0x15ca14){_0x15ca14=_0x15ca14||0xcc;return function(_0xb17c0a){if(_0xb17c0a){return _0x3c4a43[_0x7f7f('0x15')](_0x15ca14);}return _0x3c4a43['status'](_0x15ca14)['end']();};}function respondWithResult(_0x35d690,_0xd54f98){_0xd54f98=_0xd54f98||0xc8;return function(_0xe4c7b1){if(_0xe4c7b1){return _0x35d690[_0x7f7f('0x16')](_0xd54f98)[_0x7f7f('0x17')](_0xe4c7b1);}};}function respondWithFilteredResult(_0x131ed1,_0x464cc4){return function(_0x15d3a6){if(_0x15d3a6){var _0x329e81=_0x15d3a6[_0x7f7f('0x18')],_0x2c0049=_0x464cc4[_0x7f7f('0x19')],_0xdefd95=_0x464cc4[_0x7f7f('0x19')]+_0x464cc4[_0x7f7f('0x1a')],_0x17d850;if(_0xdefd95>=_0x329e81){_0xdefd95=_0x329e81;_0x17d850=0xc8;}else{_0x17d850=0xce;}_0x131ed1[_0x7f7f('0x16')](_0x17d850);return _0x131ed1[_0x7f7f('0x1b')](_0x7f7f('0x1c'),_0x2c0049+'-'+_0xdefd95+'/'+_0x329e81)[_0x7f7f('0x17')](_0x15d3a6);}return null;};}function patchUpdates(_0x4313c6){return function(_0x525a0e){try{jsonpatch[_0x7f7f('0x1d')](_0x525a0e,_0x4313c6,!![]);}catch(_0x1d419d){return BPromise[_0x7f7f('0x1e')](_0x1d419d);}return _0x525a0e['save']();};}function saveUpdates(_0xad25e,_0x57167b){return function(_0x181619){if(_0x181619){return _0x181619[_0x7f7f('0x1f')](_0xad25e)[_0x7f7f('0x20')](function(_0x220780){return _0x220780;});}return null;};}function removeEntity(_0x4e64b6,_0x72b10a){return function(_0x9a51d7){if(_0x9a51d7){return _0x9a51d7[_0x7f7f('0x21')]()['then'](function(){_0x4e64b6[_0x7f7f('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x47a262,_0x597be6){return function(_0x3dae62){if(!_0x3dae62){_0x47a262['sendStatus'](0x194);}return _0x3dae62;};}function handleError(_0x409039,_0x57e4d0){_0x57e4d0=_0x57e4d0||0x1f4;return function(_0x1ff21d){logger[_0x7f7f('0x22')](_0x1ff21d['stack']);if(_0x1ff21d[_0x7f7f('0x23')]){delete _0x1ff21d[_0x7f7f('0x23')];}_0x409039[_0x7f7f('0x16')](_0x57e4d0)[_0x7f7f('0x24')](_0x1ff21d);};}exports[_0x7f7f('0x25')]=function(_0x43b0fd,_0x15522e){var _0x3ec563={},_0x46a5d7={},_0x4ab519={'count':0x0,'rows':[]};var _0x4be351=_[_0x7f7f('0x26')](db[_0x7f7f('0x27')][_0x7f7f('0x28')],function(_0x4a028e){return{'name':_0x4a028e[_0x7f7f('0x29')],'type':_0x4a028e[_0x7f7f('0x2a')][_0x7f7f('0x2b')]};});_0x46a5d7['model']=_['map'](_0x4be351,'name');_0x46a5d7[_0x7f7f('0x2c')]=_[_0x7f7f('0x2d')](_0x43b0fd[_0x7f7f('0x2c')]);_0x46a5d7[_0x7f7f('0x2e')]=_[_0x7f7f('0x2f')](_0x46a5d7[_0x7f7f('0x30')],_0x46a5d7[_0x7f7f('0x2c')]);_0x3ec563[_0x7f7f('0x31')]=_[_0x7f7f('0x2f')](_0x46a5d7[_0x7f7f('0x30')],qs[_0x7f7f('0x32')](_0x43b0fd[_0x7f7f('0x2c')][_0x7f7f('0x32')]));_0x3ec563[_0x7f7f('0x31')]=_0x3ec563[_0x7f7f('0x31')]['length']?_0x3ec563[_0x7f7f('0x31')]:_0x46a5d7['model'];if(!_0x43b0fd[_0x7f7f('0x2c')][_0x7f7f('0x33')](_0x7f7f('0x34'))){_0x3ec563[_0x7f7f('0x1a')]=qs[_0x7f7f('0x1a')](_0x43b0fd['query'][_0x7f7f('0x1a')]);_0x3ec563['offset']=qs[_0x7f7f('0x19')](_0x43b0fd['query'][_0x7f7f('0x19')]);}_0x3ec563['order']=qs[_0x7f7f('0x35')](_0x43b0fd['query'][_0x7f7f('0x35')]);_0x3ec563['where']=qs['filters'](_[_0x7f7f('0x36')](_0x43b0fd['query'],_0x46a5d7['filters']));if(_0x43b0fd[_0x7f7f('0x2c')][_0x7f7f('0x37')]){_0x3ec563[_0x7f7f('0x38')]=_['merge'](_0x3ec563[_0x7f7f('0x38')],{'$or':_[_0x7f7f('0x26')](_0x4be351,function(_0x308816){if(_0x308816[_0x7f7f('0x2a')]!==_0x7f7f('0x39')){var _0x4e41b8={};_0x4e41b8[_0x308816['name']]={'$like':'%'+_0x43b0fd[_0x7f7f('0x2c')]['filter']+'%'};return _0x4e41b8;}})});}_0x3ec563=_['merge']({},_0x3ec563,_0x43b0fd[_0x7f7f('0x3a')]);var _0x149a80={'where':_0x3ec563[_0x7f7f('0x38')]};return db[_0x7f7f('0x27')]['count'](_0x149a80)[_0x7f7f('0x20')](function(_0x27fac3){_0x4ab519[_0x7f7f('0x18')]=_0x27fac3;if(_0x43b0fd[_0x7f7f('0x2c')]['includeAll']){_0x3ec563[_0x7f7f('0x3b')]=[{'all':!![]}];}return db['AnalyticFieldReport']['findAll'](_0x3ec563);})['then'](function(_0x188e8b){_0x4ab519[_0x7f7f('0x3c')]=_0x188e8b;return _0x4ab519;})[_0x7f7f('0x20')](respondWithFilteredResult(_0x15522e,_0x3ec563))[_0x7f7f('0x3d')](handleError(_0x15522e,null));};exports['show']=function(_0x5edfca,_0x20ea1e){var _0x524af0={'raw':![],'where':{'id':_0x5edfca[_0x7f7f('0x3e')]['id']}},_0x3eb509={};_0x3eb509[_0x7f7f('0x30')]=_['keys'](db[_0x7f7f('0x27')]['rawAttributes']);_0x3eb509['query']=_[_0x7f7f('0x2d')](_0x5edfca['query']);_0x3eb509['filters']=_[_0x7f7f('0x2f')](_0x3eb509[_0x7f7f('0x30')],_0x3eb509[_0x7f7f('0x2c')]);_0x524af0[_0x7f7f('0x31')]=_['intersection'](_0x3eb509[_0x7f7f('0x30')],qs['fields'](_0x5edfca[_0x7f7f('0x2c')][_0x7f7f('0x32')]));_0x524af0[_0x7f7f('0x31')]=_0x524af0[_0x7f7f('0x31')][_0x7f7f('0x3f')]?_0x524af0[_0x7f7f('0x31')]:_0x3eb509[_0x7f7f('0x30')];if(_0x5edfca[_0x7f7f('0x2c')][_0x7f7f('0x40')]){_0x524af0['include']=[{'all':!![]}];}_0x524af0=_[_0x7f7f('0x41')]({},_0x524af0,_0x5edfca[_0x7f7f('0x3a')]);return db['AnalyticFieldReport']['find'](_0x524af0)['then'](handleEntityNotFound(_0x20ea1e,null))[_0x7f7f('0x20')](respondWithResult(_0x20ea1e,null))[_0x7f7f('0x3d')](handleError(_0x20ea1e,null));};exports[_0x7f7f('0x42')]=function(_0x331d75,_0x4a7c21){return db[_0x7f7f('0x27')][_0x7f7f('0x42')](_0x331d75['body'],{})[_0x7f7f('0x20')](respondWithResult(_0x4a7c21,0xc9))[_0x7f7f('0x3d')](handleError(_0x4a7c21,null));};exports['bulkCreate']=function(_0x96549e,_0x414316){return db[_0x7f7f('0x27')][_0x7f7f('0x43')](_0x96549e[_0x7f7f('0x44')],{'raw':![],'individualHooks':!![]})[_0x7f7f('0x20')](respondWithResult(_0x414316,0xc9))[_0x7f7f('0x3d')](handleError(_0x414316,null));};exports[_0x7f7f('0x1f')]=function(_0xd701ee,_0x140dff){if(_0xd701ee['body']['id']){delete _0xd701ee['body']['id'];}return db['AnalyticFieldReport'][_0x7f7f('0x45')]({'where':{'id':_0xd701ee[_0x7f7f('0x3e')]['id']}})[_0x7f7f('0x20')](handleEntityNotFound(_0x140dff,null))[_0x7f7f('0x20')](saveUpdates(_0xd701ee[_0x7f7f('0x44')],null))['then'](respondWithResult(_0x140dff,null))[_0x7f7f('0x3d')](handleError(_0x140dff,null));};exports[_0x7f7f('0x21')]=function(_0x175eb0,_0x323946){return db['AnalyticFieldReport'][_0x7f7f('0x45')]({'where':{'id':_0x175eb0[_0x7f7f('0x3e')]['id']}})[_0x7f7f('0x20')](handleEntityNotFound(_0x323946,null))[_0x7f7f('0x20')](removeEntity(_0x323946,null))[_0x7f7f('0x3d')](handleError(_0x323946,null));};exports['bulkDestroy']=function(_0x2174c1,_0x4fbecc){return db[_0x7f7f('0x27')]['destroy']({'where':{'id':_0x2174c1[_0x7f7f('0x2c')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x7f7f('0x20')](respondWithResult(_0x4fbecc,0xcc))[_0x7f7f('0x3d')](handleError(_0x4fbecc,null));};exports['addFields']=function(_0x4e4b25,_0x1edfec,_0x47ffee){return db[_0x7f7f('0x46')][_0x7f7f('0x47')]({'where':{'id':_0x4e4b25['params']['id']}})[_0x7f7f('0x20')](handleEntityNotFound(_0x1edfec,null))[_0x7f7f('0x20')](function(_0x4f0999){if(_0x4f0999){return db[_0x7f7f('0x48')][_0x7f7f('0x49')](function(_0x22fc6b){return db[_0x7f7f('0x27')]['destroy']({'where':{'CustomReportId':_0x4e4b25['params']['id']},'transaction':_0x22fc6b})[_0x7f7f('0x20')](function(_0x11a4b2){var _0x53c18b=_[_0x7f7f('0x26')](_0x4e4b25[_0x7f7f('0x44')],function(_0x5b5918){delete _0x5b5918['id'];_0x5b5918[_0x7f7f('0x4a')]=_0x4e4b25[_0x7f7f('0x3e')]['id'];return _0x5b5918;});return db[_0x7f7f('0x27')][_0x7f7f('0x43')](_0x53c18b,{'transaction':_0x22fc6b});});})[_0x7f7f('0x20')](function(){return db[_0x7f7f('0x27')][_0x7f7f('0x4b')]({'where':{'CustomReportId':_0x4e4b25[_0x7f7f('0x3e')]['id']}});});}})[_0x7f7f('0x20')](respondWithResult(_0x1edfec,null))['catch'](handleError(_0x1edfec,null));}; \ No newline at end of file +var _0xd301=['filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','merge','where','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','find','create','body','bulkDestroy','addFields','AnalyticCustomReport','CustomReportId','bulkCreate','findAll','html-pdf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','apply','save','update','then','destroy','name','index','AnalyticFieldReport','key','model','map','query','keys'];(function(_0x1dfe5d,_0x1c4242){var _0x22dbcc=function(_0x5b148a){while(--_0x5b148a){_0x1dfe5d['push'](_0x1dfe5d['shift']());}};_0x22dbcc(++_0x1c4242);}(_0xd301,0x145));var _0x1d30=function(_0x148028,_0x8f4e9){_0x148028=_0x148028-0x0;var _0xb0ec6=_0xd301[_0x148028];return _0xb0ec6;};'use strict';var pdf=require(_0x1d30('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x1d30('0x1'));var rp=require(_0x1d30('0x2'));var moment=require(_0x1d30('0x3'));var BPromise=require(_0x1d30('0x4'));var Mustache=require(_0x1d30('0x5'));var util=require(_0x1d30('0x6'));var path=require(_0x1d30('0x7'));var sox=require(_0x1d30('0x8'));var csv=require(_0x1d30('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d30('0xa'));var squel=require(_0x1d30('0xb'));var crypto=require(_0x1d30('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x1d30('0xd'));var toCsv=require(_0x1d30('0x9'));var querystring=require(_0x1d30('0xe'));var Papa=require(_0x1d30('0xf'));var Redis=require(_0x1d30('0x10'));var authService=require(_0x1d30('0x11'));var qs=require(_0x1d30('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d30('0x13'));var logger=require(_0x1d30('0x14'))(_0x1d30('0x15'));var utils=require('../../config/utils');var config=require(_0x1d30('0x16'));var db=require(_0x1d30('0x17'))['db'];function respondWithStatusCode(_0x16c51b,_0x106454){_0x106454=_0x106454||0xcc;return function(_0x359611){if(_0x359611){return _0x16c51b[_0x1d30('0x18')](_0x106454);}return _0x16c51b[_0x1d30('0x19')](_0x106454)[_0x1d30('0x1a')]();};}function respondWithResult(_0x1123f6,_0x1dd644){_0x1dd644=_0x1dd644||0xc8;return function(_0x2b3f7b){if(_0x2b3f7b){return _0x1123f6[_0x1d30('0x19')](_0x1dd644)[_0x1d30('0x1b')](_0x2b3f7b);}};}function respondWithFilteredResult(_0x16a7f7,_0x110ab7){return function(_0x5caf34){if(_0x5caf34){var _0x108667=_0x5caf34[_0x1d30('0x1c')],_0x24ee2e=_0x110ab7['offset'],_0x3c8af1=_0x110ab7['offset']+_0x110ab7[_0x1d30('0x1d')],_0x156950;if(_0x3c8af1>=_0x108667){_0x3c8af1=_0x108667;_0x156950=0xc8;}else{_0x156950=0xce;}_0x16a7f7[_0x1d30('0x19')](_0x156950);return _0x16a7f7[_0x1d30('0x1e')](_0x1d30('0x1f'),_0x24ee2e+'-'+_0x3c8af1+'/'+_0x108667)[_0x1d30('0x1b')](_0x5caf34);}return null;};}function patchUpdates(_0x458b97){return function(_0x372520){try{jsonpatch[_0x1d30('0x20')](_0x372520,_0x458b97,!![]);}catch(_0x36a70d){return BPromise['reject'](_0x36a70d);}return _0x372520[_0x1d30('0x21')]();};}function saveUpdates(_0x359d7e,_0x364f87){return function(_0x2622ea){if(_0x2622ea){return _0x2622ea[_0x1d30('0x22')](_0x359d7e)[_0x1d30('0x23')](function(_0x3ae7dd){return _0x3ae7dd;});}return null;};}function removeEntity(_0x19bdc7,_0x3251be){return function(_0x117ed0){if(_0x117ed0){return _0x117ed0[_0x1d30('0x24')]()[_0x1d30('0x23')](function(){_0x19bdc7[_0x1d30('0x19')](0xcc)[_0x1d30('0x1a')]();});}};}function handleEntityNotFound(_0x3f0943,_0x3e20ac){return function(_0x5bab00){if(!_0x5bab00){_0x3f0943[_0x1d30('0x18')](0x194);}return _0x5bab00;};}function handleError(_0x77940e,_0x2be058){_0x2be058=_0x2be058||0x1f4;return function(_0x229909){logger['error'](_0x229909['stack']);if(_0x229909[_0x1d30('0x25')]){delete _0x229909[_0x1d30('0x25')];}_0x77940e[_0x1d30('0x19')](_0x2be058)['send'](_0x229909);};}exports[_0x1d30('0x26')]=function(_0xf4864a,_0x1b349c){var _0x341cca={},_0x35f599={},_0x1f1221={'count':0x0,'rows':[]};var _0x2b74fe=_['map'](db[_0x1d30('0x27')]['rawAttributes'],function(_0x50f9ef){return{'name':_0x50f9ef['fieldName'],'type':_0x50f9ef['type'][_0x1d30('0x28')]};});_0x35f599[_0x1d30('0x29')]=_[_0x1d30('0x2a')](_0x2b74fe,_0x1d30('0x25'));_0x35f599[_0x1d30('0x2b')]=_[_0x1d30('0x2c')](_0xf4864a[_0x1d30('0x2b')]);_0x35f599[_0x1d30('0x2d')]=_[_0x1d30('0x2e')](_0x35f599['model'],_0x35f599[_0x1d30('0x2b')]);_0x341cca[_0x1d30('0x2f')]=_[_0x1d30('0x2e')](_0x35f599['model'],qs[_0x1d30('0x30')](_0xf4864a[_0x1d30('0x2b')]['fields']));_0x341cca[_0x1d30('0x2f')]=_0x341cca['attributes'][_0x1d30('0x31')]?_0x341cca[_0x1d30('0x2f')]:_0x35f599['model'];if(!_0xf4864a['query'][_0x1d30('0x32')](_0x1d30('0x33'))){_0x341cca[_0x1d30('0x1d')]=qs[_0x1d30('0x1d')](_0xf4864a['query']['limit']);_0x341cca['offset']=qs['offset'](_0xf4864a[_0x1d30('0x2b')][_0x1d30('0x34')]);}_0x341cca[_0x1d30('0x35')]=qs[_0x1d30('0x36')](_0xf4864a[_0x1d30('0x2b')][_0x1d30('0x36')]);_0x341cca['where']=qs[_0x1d30('0x2d')](_['pick'](_0xf4864a[_0x1d30('0x2b')],_0x35f599[_0x1d30('0x2d')]));if(_0xf4864a[_0x1d30('0x2b')]['filter']){_0x341cca['where']=_[_0x1d30('0x37')](_0x341cca[_0x1d30('0x38')],{'$or':_['map'](_0x2b74fe,function(_0x7780d8){if(_0x7780d8['type']!==_0x1d30('0x39')){var _0x190d84={};_0x190d84[_0x7780d8[_0x1d30('0x25')]]={'$like':'%'+_0xf4864a[_0x1d30('0x2b')]['filter']+'%'};return _0x190d84;}})});}_0x341cca=_[_0x1d30('0x37')]({},_0x341cca,_0xf4864a['options']);var _0x489772={'where':_0x341cca[_0x1d30('0x38')]};return db[_0x1d30('0x27')][_0x1d30('0x1c')](_0x489772)['then'](function(_0x2603bc){_0x1f1221[_0x1d30('0x1c')]=_0x2603bc;if(_0xf4864a[_0x1d30('0x2b')][_0x1d30('0x3a')]){_0x341cca[_0x1d30('0x3b')]=[{'all':!![]}];}return db[_0x1d30('0x27')]['findAll'](_0x341cca);})[_0x1d30('0x23')](function(_0x445372){_0x1f1221[_0x1d30('0x3c')]=_0x445372;return _0x1f1221;})[_0x1d30('0x23')](respondWithFilteredResult(_0x1b349c,_0x341cca))[_0x1d30('0x3d')](handleError(_0x1b349c,null));};exports[_0x1d30('0x3e')]=function(_0x48d3a5,_0x5001b0){var _0x140b89={'raw':![],'where':{'id':_0x48d3a5[_0x1d30('0x3f')]['id']}},_0x5107ce={};_0x5107ce[_0x1d30('0x29')]=_['keys'](db['AnalyticFieldReport'][_0x1d30('0x40')]);_0x5107ce[_0x1d30('0x2b')]=_['keys'](_0x48d3a5[_0x1d30('0x2b')]);_0x5107ce['filters']=_[_0x1d30('0x2e')](_0x5107ce['model'],_0x5107ce['query']);_0x140b89[_0x1d30('0x2f')]=_['intersection'](_0x5107ce[_0x1d30('0x29')],qs['fields'](_0x48d3a5['query'][_0x1d30('0x30')]));_0x140b89[_0x1d30('0x2f')]=_0x140b89[_0x1d30('0x2f')]['length']?_0x140b89[_0x1d30('0x2f')]:_0x5107ce[_0x1d30('0x29')];if(_0x48d3a5[_0x1d30('0x2b')][_0x1d30('0x3a')]){_0x140b89[_0x1d30('0x3b')]=[{'all':!![]}];}_0x140b89=_['merge']({},_0x140b89,_0x48d3a5['options']);return db[_0x1d30('0x27')][_0x1d30('0x41')](_0x140b89)[_0x1d30('0x23')](handleEntityNotFound(_0x5001b0,null))[_0x1d30('0x23')](respondWithResult(_0x5001b0,null))['catch'](handleError(_0x5001b0,null));};exports[_0x1d30('0x42')]=function(_0x28bb80,_0x16e28d){return db[_0x1d30('0x27')][_0x1d30('0x42')](_0x28bb80[_0x1d30('0x43')],{})[_0x1d30('0x23')](respondWithResult(_0x16e28d,0xc9))[_0x1d30('0x3d')](handleError(_0x16e28d,null));};exports['bulkCreate']=function(_0x4ab37e,_0x2e4f52){return db[_0x1d30('0x27')]['bulkCreate'](_0x4ab37e['body'],{'raw':![],'individualHooks':!![]})[_0x1d30('0x23')](respondWithResult(_0x2e4f52,0xc9))[_0x1d30('0x3d')](handleError(_0x2e4f52,null));};exports[_0x1d30('0x22')]=function(_0x1f981f,_0x8ee709){if(_0x1f981f[_0x1d30('0x43')]['id']){delete _0x1f981f['body']['id'];}return db[_0x1d30('0x27')][_0x1d30('0x41')]({'where':{'id':_0x1f981f['params']['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x8ee709,null))[_0x1d30('0x23')](saveUpdates(_0x1f981f['body'],null))[_0x1d30('0x23')](respondWithResult(_0x8ee709,null))[_0x1d30('0x3d')](handleError(_0x8ee709,null));};exports['destroy']=function(_0x29c1bc,_0x2eaba8){return db[_0x1d30('0x27')][_0x1d30('0x41')]({'where':{'id':_0x29c1bc[_0x1d30('0x3f')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x2eaba8,null))[_0x1d30('0x23')](removeEntity(_0x2eaba8,null))[_0x1d30('0x3d')](handleError(_0x2eaba8,null));};exports[_0x1d30('0x44')]=function(_0x18c765,_0x2836a4){return db[_0x1d30('0x27')][_0x1d30('0x24')]({'where':{'id':_0x18c765[_0x1d30('0x2b')]['ids']||[]},'raw':![],'individualHooks':!![]})[_0x1d30('0x23')](respondWithResult(_0x2836a4,0xcc))[_0x1d30('0x3d')](handleError(_0x2836a4,null));};exports[_0x1d30('0x45')]=function(_0x21c644,_0x41ae1,_0x15013b){return db[_0x1d30('0x46')]['findOne']({'where':{'id':_0x21c644[_0x1d30('0x3f')]['id']}})[_0x1d30('0x23')](handleEntityNotFound(_0x41ae1,null))[_0x1d30('0x23')](function(_0x58f28c){if(_0x58f28c){return db['sequelize']['transaction'](function(_0x148523){return db[_0x1d30('0x27')][_0x1d30('0x24')]({'where':{'CustomReportId':_0x21c644[_0x1d30('0x3f')]['id']},'transaction':_0x148523})['then'](function(_0x1b11ef){var _0x795de5=_[_0x1d30('0x2a')](_0x21c644['body'],function(_0x1288bf){delete _0x1288bf['id'];_0x1288bf[_0x1d30('0x47')]=_0x21c644[_0x1d30('0x3f')]['id'];return _0x1288bf;});return db['AnalyticFieldReport'][_0x1d30('0x48')](_0x795de5,{'transaction':_0x148523});});})[_0x1d30('0x23')](function(){return db[_0x1d30('0x27')][_0x1d30('0x49')]({'where':{'CustomReportId':_0x21c644[_0x1d30('0x3f')]['id']}});});}})['then'](respondWithResult(_0x41ae1,null))['catch'](handleError(_0x41ae1,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index c6afe56..11665f8 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 _0xb6af=['lodash','util','api','moment','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','AnalyticFieldReport','analytics_report_fields'];(function(_0x4a7117,_0x240b3b){var _0x592695=function(_0x3a0ef1){while(--_0x3a0ef1){_0x4a7117['push'](_0x4a7117['shift']());}};_0x592695(++_0x240b3b);}(_0xb6af,0x113));var _0xfb6a=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xb6af[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xfb6a('0x0'));var util=require(_0xfb6a('0x1'));var logger=require('../../config/logger')(_0xfb6a('0x2'));var moment=require(_0xfb6a('0x3'));var BPromise=require('bluebird');var rp=require(_0xfb6a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xfb6a('0x5'));var config=require(_0xfb6a('0x6'));var attributes=require(_0xfb6a('0x7'));module[_0xfb6a('0x8')]=function(_0xb1f424,_0x4583d0){return _0xb1f424['define'](_0xfb6a('0x9'),attributes,{'tableName':_0xfb6a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3b9=['util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./analyticFieldReport.attributes','exports','define','analytics_report_fields'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xa3b9,0x1d9));var _0x9a3b=function(_0x1321bf,_0x433d10){_0x1321bf=_0x1321bf-0x0;var _0x24161a=_0xa3b9[_0x1321bf];return _0x24161a;};'use strict';var _=require('lodash');var util=require(_0x9a3b('0x0'));var logger=require(_0x9a3b('0x1'))('api');var moment=require(_0x9a3b('0x2'));var BPromise=require(_0x9a3b('0x3'));var rp=require(_0x9a3b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a3b('0x5'));var config=require(_0x9a3b('0x6'));var attributes=require(_0x9a3b('0x7'));module[_0x9a3b('0x8')]=function(_0x4fda2,_0x1d546e){return _0x4fda2[_0x9a3b('0x9')]('AnalyticFieldReport',attributes,{'tableName':_0x9a3b('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 f7a5e56..15f0d44 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 _0x62af=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0xe16cec,_0x58e80e){var _0x3f15d8=function(_0x1de743){while(--_0x1de743){_0xe16cec['push'](_0xe16cec['shift']());}};_0x3f15d8(++_0x58e80e);}(_0x62af,0xc1));var _0xf62a=function(_0x52ab17,_0xf51f71){_0x52ab17=_0x52ab17-0x0;var _0x4f420f=_0x62af[_0x52ab17];return _0x4f420f;};'use strict';var _=require('lodash');var util=require(_0xf62a('0x0'));var moment=require(_0xf62a('0x1'));var BPromise=require(_0xf62a('0x2'));var rs=require(_0xf62a('0x3'));var fs=require('fs');var Redis=require(_0xf62a('0x4'));var db=require(_0xf62a('0x5'))['db'];var utils=require(_0xf62a('0x6'));var logger=require(_0xf62a('0x7'))(_0xf62a('0x8'));var config=require('../../config/environment');var jayson=require(_0xf62a('0x9'));var client=jayson['client'][_0xf62a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a667b,_0x4efe22,_0x3ab12c){return new BPromise(function(_0x2eb40f,_0x29022c){return client[_0xf62a('0xb')](_0x3a667b,_0x3ab12c)[_0xf62a('0xc')](function(_0x1b0a3f){logger['info'](_0xf62a('0xd'),_0x4efe22,_0xf62a('0xe'));logger[_0xf62a('0xf')](_0xf62a('0x10'),_0x4efe22,_0xf62a('0xe'),JSON['stringify'](_0x1b0a3f));if(_0x1b0a3f[_0xf62a('0x11')]){if(_0x1b0a3f['error']['code']===0x1f4){logger['error'](_0xf62a('0xd'),_0x4efe22,_0x1b0a3f[_0xf62a('0x11')][_0xf62a('0x12')]);return _0x29022c(_0x1b0a3f[_0xf62a('0x11')][_0xf62a('0x12')]);}logger[_0xf62a('0x11')](_0xf62a('0xd'),_0x4efe22,_0x1b0a3f[_0xf62a('0x11')][_0xf62a('0x12')]);return _0x2eb40f(_0x1b0a3f[_0xf62a('0x11')][_0xf62a('0x12')]);}else{logger[_0xf62a('0x13')](_0xf62a('0xd'),_0x4efe22,_0xf62a('0xe'));_0x2eb40f(_0x1b0a3f[_0xf62a('0x14')][_0xf62a('0x12')]);}})[_0xf62a('0x15')](function(_0x2a93a9){logger[_0xf62a('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4efe22,_0x2a93a9);_0x29022c(_0x2a93a9);});});} \ No newline at end of file +var _0x78c9=['ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','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','moment','bluebird'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0x78c9,0x1a0));var _0x978c=function(_0x3afc57,_0x40f6a9){_0x3afc57=_0x3afc57-0x0;var _0x53d3df=_0x78c9[_0x3afc57];return _0x53d3df;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x978c('0x0'));var BPromise=require(_0x978c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x978c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x978c('0x3'));var logger=require('../../config/logger')(_0x978c('0x4'));var config=require(_0x978c('0x5'));var jayson=require(_0x978c('0x6'));var client=jayson[_0x978c('0x7')][_0x978c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x21b109,_0x39aa67,_0x2bbfa2){return new BPromise(function(_0x1b2ec0,_0x5672eb){return client[_0x978c('0x9')](_0x21b109,_0x2bbfa2)[_0x978c('0xa')](function(_0x4cd358){logger[_0x978c('0xb')](_0x978c('0xc'),_0x39aa67,_0x978c('0xd'));logger[_0x978c('0xe')](_0x978c('0xf'),_0x39aa67,'request\x20sent',JSON[_0x978c('0x10')](_0x4cd358));if(_0x4cd358[_0x978c('0x11')]){if(_0x4cd358[_0x978c('0x11')][_0x978c('0x12')]===0x1f4){logger[_0x978c('0x11')](_0x978c('0xc'),_0x39aa67,_0x4cd358['error'][_0x978c('0x13')]);return _0x5672eb(_0x4cd358[_0x978c('0x11')][_0x978c('0x13')]);}logger[_0x978c('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39aa67,_0x4cd358[_0x978c('0x11')]['message']);return _0x1b2ec0(_0x4cd358[_0x978c('0x11')][_0x978c('0x13')]);}else{logger[_0x978c('0xb')]('AnalyticFieldReport,\x20%s,\x20%s',_0x39aa67,_0x978c('0xd'));_0x1b2ec0(_0x4cd358[_0x978c('0x14')][_0x978c('0x13')]);}})[_0x978c('0x15')](function(_0x161d3d){logger[_0x978c('0x11')](_0x978c('0xc'),_0x39aa67,_0x161d3d);_0x5672eb(_0x161d3d);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 0c52170..99f1752 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 _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','post','/create_many','bulkCreate','/:id/create_many','put','update','delete','/destroy_many','bulkDestroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x9957,0x93));var _0x7995=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0x9957[_0x5ddb1c];return _0x354adc;};'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('./analyticFieldReport.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('0xc')](_0x7995('0xd'),auth[_0x7995('0x9')](),controller[_0x7995('0xe')]);router[_0x7995('0xc')](_0x7995('0xf'),auth[_0x7995('0x9')](),controller['addFields']);router[_0x7995('0x10')](_0x7995('0xb'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0x13'),auth[_0x7995('0x9')](),controller[_0x7995('0x14')]);router[_0x7995('0x12')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file +var _0x814b=['../../config/environment','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','post','create','/create_many','bulkCreate','/:id/create_many','addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x1caac3,_0x5761e9){var _0x112891=function(_0x414cf8){while(--_0x414cf8){_0x1caac3['push'](_0x1caac3['shift']());}};_0x112891(++_0x5761e9);}(_0x814b,0x1a2));var _0xb814=function(_0x190c49,_0x103457){_0x190c49=_0x190c49-0x0;var _0x475b9a=_0x814b[_0x190c49];return _0x475b9a;};'use strict';var multer=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var path=require(_0xb814('0x2'));var timeout=require(_0xb814('0x3'));var express=require(_0xb814('0x4'));var router=express[_0xb814('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['show']);router[_0xb814('0xd')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xd')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0xd')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['put'](_0xb814('0xc'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);router[_0xb814('0x14')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x14')](_0xb814('0xc'),auth[_0xb814('0xa')](),controller[_0xb814('0x17')]);module[_0xb814('0x18')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index 658c83e..b809eb4 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 _0x6629=['STRING','TEXT','sequelize','name'];(function(_0x9cd01b,_0x568ca3){var _0x51cd28=function(_0xee7454){while(--_0xee7454){_0x9cd01b['push'](_0x9cd01b['shift']());}};_0x51cd28(++_0x568ca3);}(_0x6629,0x1c2));var _0x9662=function(_0x42c8d6,_0x198db3){_0x42c8d6=_0x42c8d6-0x0;var _0x8e2c4b=_0x6629[_0x42c8d6];return _0x8e2c4b;};'use strict';var Sequelize=require(_0x9662('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x9662('0x1')},'table':{'type':Sequelize[_0x9662('0x2')]},'metric':{'type':Sequelize[_0x9662('0x3')]},'description':{'type':Sequelize[_0x9662('0x2')]}}; \ No newline at end of file +var _0xaa7c=['STRING','name','sequelize','exports'];(function(_0x587620,_0x29c7d5){var _0x251ff4=function(_0x1ca5ae){while(--_0x1ca5ae){_0x587620['push'](_0x587620['shift']());}};_0x251ff4(++_0x29c7d5);}(_0xaa7c,0x18e));var _0xcaa7=function(_0x28a7e5,_0x309d89){_0x28a7e5=_0x28a7e5-0x0;var _0x22e722=_0xaa7c[_0x28a7e5];return _0x22e722;};'use strict';var Sequelize=require(_0xcaa7('0x0'));module[_0xcaa7('0x1')]={'name':{'type':Sequelize[_0xcaa7('0x2')],'allowNull':![],'unique':_0xcaa7('0x3')},'table':{'type':Sequelize[_0xcaa7('0x2')]},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xcaa7('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index a369298..6708432 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 _0x47de=['count','offset','set','apply','reject','then','get','Metrics','error','stack','name','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','options','include','params','includeAll','merge','find','catch','create','body','user','userProfileId','autoAssociation','UserProfileResource','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','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json'];(function(_0x1fb5aa,_0x3c657f){var _0x1bbb81=function(_0x835b6){while(--_0x835b6){_0x1fb5aa['push'](_0x1fb5aa['shift']());}};_0x1bbb81(++_0x3c657f);}(_0x47de,0x1a7));var _0xe47d=function(_0x3f1d8f,_0x1f4c32){_0x3f1d8f=_0x3f1d8f-0x0;var _0x5bb188=_0x47de[_0x3f1d8f];return _0x5bb188;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe47d('0x0'));var rimraf=require(_0xe47d('0x1'));var zipdir=require(_0xe47d('0x2'));var jsonpatch=require(_0xe47d('0x3'));var rp=require(_0xe47d('0x4'));var moment=require(_0xe47d('0x5'));var BPromise=require(_0xe47d('0x6'));var Mustache=require(_0xe47d('0x7'));var util=require('util');var path=require('path');var sox=require(_0xe47d('0x8'));var csv=require(_0xe47d('0x9'));var ejs=require(_0xe47d('0xa'));var fs=require('fs');var _=require(_0xe47d('0xb'));var squel=require(_0xe47d('0xc'));var crypto=require(_0xe47d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe47d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xe47d('0xf'));var Papa=require(_0xe47d('0x10'));var Redis=require(_0xe47d('0x11'));var authService=require(_0xe47d('0x12'));var qs=require(_0xe47d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xe47d('0x14'));var logger=require(_0xe47d('0x15'))('api');var utils=require(_0xe47d('0x16'));var config=require('../../config/environment');var db=require(_0xe47d('0x17'))['db'];function respondWithStatusCode(_0x16eeb3,_0x5cf311){_0x5cf311=_0x5cf311||0xcc;return function(_0x194749){if(_0x194749){return _0x16eeb3[_0xe47d('0x18')](_0x5cf311);}return _0x16eeb3[_0xe47d('0x19')](_0x5cf311)['end']();};}function respondWithResult(_0x4e35f2,_0x1a4df8){_0x1a4df8=_0x1a4df8||0xc8;return function(_0x134bc3){if(_0x134bc3){return _0x4e35f2['status'](_0x1a4df8)[_0xe47d('0x1a')](_0x134bc3);}};}function respondWithFilteredResult(_0x336371,_0x504279){return function(_0x4eb312){if(_0x4eb312){var _0x2979e1=_0x4eb312[_0xe47d('0x1b')],_0x491de2=_0x504279[_0xe47d('0x1c')],_0x12d73b=_0x504279['offset']+_0x504279['limit'],_0x26b67c;if(_0x12d73b>=_0x2979e1){_0x12d73b=_0x2979e1;_0x26b67c=0xc8;}else{_0x26b67c=0xce;}_0x336371['status'](_0x26b67c);return _0x336371[_0xe47d('0x1d')]('Content-Range',_0x491de2+'-'+_0x12d73b+'/'+_0x2979e1)[_0xe47d('0x1a')](_0x4eb312);}return null;};}function patchUpdates(_0x2ac8a3){return function(_0x37cafa){try{jsonpatch[_0xe47d('0x1e')](_0x37cafa,_0x2ac8a3,!![]);}catch(_0x56b5c9){return BPromise[_0xe47d('0x1f')](_0x56b5c9);}return _0x37cafa['save']();};}function saveUpdates(_0x23675c,_0x2a5ce6){return function(_0x4000a2){if(_0x4000a2){return _0x4000a2['update'](_0x23675c)['then'](function(_0x2a0155){return _0x2a0155;});}return null;};}function removeEntity(_0x2ca839,_0x5990db){return function(_0x1f6727){if(_0x1f6727){return _0x1f6727['destroy']()[_0xe47d('0x20')](function(){var _0x3aae94=_0x1f6727[_0xe47d('0x21')]({'plain':!![]});var _0x24a666=_0xe47d('0x22');return db['UserProfileResource']['destroy']({'where':{'type':_0x24a666,'resourceId':_0x3aae94['id']}})['then'](function(){return _0x1f6727;});})[_0xe47d('0x20')](function(){_0x2ca839['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3f1dec,_0x1cee0e){return function(_0x229c66){if(!_0x229c66){_0x3f1dec[_0xe47d('0x18')](0x194);}return _0x229c66;};}function handleError(_0x47cc57,_0x119b5){_0x119b5=_0x119b5||0x1f4;return function(_0x5e3a91){logger[_0xe47d('0x23')](_0x5e3a91[_0xe47d('0x24')]);if(_0x5e3a91['name']){delete _0x5e3a91[_0xe47d('0x25')];}_0x47cc57[_0xe47d('0x19')](_0x119b5)['send'](_0x5e3a91);};}exports['index']=function(_0xfdeb8f,_0x50cea8){var _0x96597d={},_0x146e5f={},_0xd0f491={'count':0x0,'rows':[]};var _0x16e49e=_[_0xe47d('0x26')](db[_0xe47d('0x27')][_0xe47d('0x28')],function(_0x4a3bbe){return{'name':_0x4a3bbe[_0xe47d('0x29')],'type':_0x4a3bbe[_0xe47d('0x2a')][_0xe47d('0x2b')]};});_0x146e5f[_0xe47d('0x2c')]=_[_0xe47d('0x26')](_0x16e49e,_0xe47d('0x25'));_0x146e5f[_0xe47d('0x2d')]=_[_0xe47d('0x2e')](_0xfdeb8f[_0xe47d('0x2d')]);_0x146e5f[_0xe47d('0x2f')]=_[_0xe47d('0x30')](_0x146e5f['model'],_0x146e5f[_0xe47d('0x2d')]);_0x96597d[_0xe47d('0x31')]=_[_0xe47d('0x30')](_0x146e5f['model'],qs['fields'](_0xfdeb8f[_0xe47d('0x2d')][_0xe47d('0x32')]));_0x96597d[_0xe47d('0x31')]=_0x96597d[_0xe47d('0x31')]['length']?_0x96597d[_0xe47d('0x31')]:_0x146e5f[_0xe47d('0x2c')];if(!_0xfdeb8f[_0xe47d('0x2d')][_0xe47d('0x33')](_0xe47d('0x34'))){_0x96597d[_0xe47d('0x35')]=qs[_0xe47d('0x35')](_0xfdeb8f['query'][_0xe47d('0x35')]);_0x96597d[_0xe47d('0x1c')]=qs['offset'](_0xfdeb8f[_0xe47d('0x2d')][_0xe47d('0x1c')]);}_0x96597d[_0xe47d('0x36')]=qs[_0xe47d('0x37')](_0xfdeb8f[_0xe47d('0x2d')]['sort']);_0x96597d['where']=qs[_0xe47d('0x2f')](_[_0xe47d('0x38')](_0xfdeb8f[_0xe47d('0x2d')],_0x146e5f[_0xe47d('0x2f')]));if(_0xfdeb8f['query'][_0xe47d('0x39')]){_0x96597d[_0xe47d('0x3a')]=_['merge'](_0x96597d[_0xe47d('0x3a')],{'$or':_['map'](_0x16e49e,function(_0x33ed9d){if(_0x33ed9d[_0xe47d('0x2a')]!==_0xe47d('0x3b')){var _0x30d0ab={};_0x30d0ab[_0x33ed9d[_0xe47d('0x25')]]={'$like':'%'+_0xfdeb8f[_0xe47d('0x2d')][_0xe47d('0x39')]+'%'};return _0x30d0ab;}})});}_0x96597d=_['merge']({},_0x96597d,_0xfdeb8f[_0xe47d('0x3c')]);var _0x3781cc={'where':_0x96597d['where']};return db[_0xe47d('0x27')][_0xe47d('0x1b')](_0x3781cc)[_0xe47d('0x20')](function(_0x211846){_0xd0f491[_0xe47d('0x1b')]=_0x211846;if(_0xfdeb8f[_0xe47d('0x2d')]['includeAll']){_0x96597d[_0xe47d('0x3d')]=[{'all':!![]}];}return db['AnalyticMetric']['findAll'](_0x96597d);})[_0xe47d('0x20')](function(_0x477c49){_0xd0f491['rows']=_0x477c49;return _0xd0f491;})[_0xe47d('0x20')](respondWithFilteredResult(_0x50cea8,_0x96597d))['catch'](handleError(_0x50cea8,null));};exports['show']=function(_0x1201c5,_0x5aa6eb){var _0x2b8413={'raw':!![],'where':{'id':_0x1201c5[_0xe47d('0x3e')]['id']}},_0x212531={};_0x212531[_0xe47d('0x2c')]=_[_0xe47d('0x2e')](db['AnalyticMetric'][_0xe47d('0x28')]);_0x212531['query']=_[_0xe47d('0x2e')](_0x1201c5[_0xe47d('0x2d')]);_0x212531[_0xe47d('0x2f')]=_[_0xe47d('0x30')](_0x212531[_0xe47d('0x2c')],_0x212531[_0xe47d('0x2d')]);_0x2b8413[_0xe47d('0x31')]=_[_0xe47d('0x30')](_0x212531['model'],qs[_0xe47d('0x32')](_0x1201c5[_0xe47d('0x2d')][_0xe47d('0x32')]));_0x2b8413['attributes']=_0x2b8413['attributes']['length']?_0x2b8413['attributes']:_0x212531[_0xe47d('0x2c')];if(_0x1201c5[_0xe47d('0x2d')][_0xe47d('0x3f')]){_0x2b8413['include']=[{'all':!![]}];}_0x2b8413=_[_0xe47d('0x40')]({},_0x2b8413,_0x1201c5[_0xe47d('0x3c')]);return db[_0xe47d('0x27')][_0xe47d('0x41')](_0x2b8413)[_0xe47d('0x20')](handleEntityNotFound(_0x5aa6eb,null))[_0xe47d('0x20')](respondWithResult(_0x5aa6eb,null))[_0xe47d('0x42')](handleError(_0x5aa6eb,null));};exports[_0xe47d('0x43')]=function(_0x2b2909,_0x1e188f){return db[_0xe47d('0x27')][_0xe47d('0x43')](_0x2b2909[_0xe47d('0x44')],{})[_0xe47d('0x20')](function(_0x3a301c){var _0x3972e1=_0x2b2909['user'][_0xe47d('0x21')]({'plain':!![]});if(!_0x3972e1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3972e1['role']===_0xe47d('0x45')){var _0x3b6481=_0x3a301c[_0xe47d('0x21')]({'plain':!![]});var _0x2c6e59='Metrics';return db['UserProfileSection'][_0xe47d('0x41')]({'where':{'name':_0x2c6e59,'userProfileId':_0x3972e1[_0xe47d('0x46')]},'raw':!![]})[_0xe47d('0x20')](function(_0x305bea){if(_0x305bea&&_0x305bea[_0xe47d('0x47')]===0x0){return db[_0xe47d('0x48')][_0xe47d('0x43')]({'name':_0x3b6481['name'],'resourceId':_0x3b6481['id'],'type':_0x305bea[_0xe47d('0x25')],'sectionId':_0x305bea['id']},{})[_0xe47d('0x20')](function(){return _0x3a301c;});}else{return _0x3a301c;}})[_0xe47d('0x42')](function(_0x2126ea){logger['error'](_0xe47d('0x49'),_0x2126ea);throw _0x2126ea;});}return _0x3a301c;})[_0xe47d('0x20')](respondWithResult(_0x1e188f,0xc9))[_0xe47d('0x42')](handleError(_0x1e188f,null));};exports[_0xe47d('0x4a')]=function(_0x28d6c4,_0x56040c){if(_0x28d6c4[_0xe47d('0x44')]['id']){delete _0x28d6c4[_0xe47d('0x44')]['id'];}return db['AnalyticMetric'][_0xe47d('0x41')]({'where':{'id':_0x28d6c4[_0xe47d('0x3e')]['id']}})[_0xe47d('0x20')](handleEntityNotFound(_0x56040c,null))[_0xe47d('0x20')](saveUpdates(_0x28d6c4[_0xe47d('0x44')],null))['then'](respondWithResult(_0x56040c,null))[_0xe47d('0x42')](handleError(_0x56040c,null));};exports['destroy']=function(_0x53ad9a,_0x1a2f8c){return db[_0xe47d('0x27')]['find']({'where':{'id':_0x53ad9a[_0xe47d('0x3e')]['id']}})[_0xe47d('0x20')](handleEntityNotFound(_0x1a2f8c,null))[_0xe47d('0x20')](removeEntity(_0x1a2f8c,null))[_0xe47d('0x42')](handleError(_0x1a2f8c,null));}; \ No newline at end of file +var _0xc963=['map','rawAttributes','type','key','keys','query','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','merge','options','AnalyticMetric','includeAll','include','findAll','rows','catch','show','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','Metrics','UserProfileResource','end','error','stack','name','send','index'];(function(_0x2c3a88,_0x48637e){var _0x4a7925=function(_0x15780f){while(--_0x15780f){_0x2c3a88['push'](_0x2c3a88['shift']());}};_0x4a7925(++_0x48637e);}(_0xc963,0x119));var _0x3c96=function(_0x587dd0,_0x273922){_0x587dd0=_0x587dd0-0x0;var _0x56f153=_0xc963[_0x587dd0];return _0x56f153;};'use strict';var pdf=require(_0x3c96('0x0'));var emlformat=require(_0x3c96('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3c96('0x2'));var jsonpatch=require(_0x3c96('0x3'));var rp=require(_0x3c96('0x4'));var moment=require(_0x3c96('0x5'));var BPromise=require(_0x3c96('0x6'));var Mustache=require(_0x3c96('0x7'));var util=require(_0x3c96('0x8'));var path=require('path');var sox=require(_0x3c96('0x9'));var csv=require(_0x3c96('0xa'));var ejs=require(_0x3c96('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3c96('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3c96('0xa'));var querystring=require(_0x3c96('0xd'));var Papa=require(_0x3c96('0xe'));var Redis=require(_0x3c96('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x3c96('0x10'));var as=require(_0x3c96('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3c96('0x12'));var utils=require(_0x3c96('0x13'));var config=require(_0x3c96('0x14'));var db=require(_0x3c96('0x15'))['db'];function respondWithStatusCode(_0x9c9db5,_0x5a8a03){_0x5a8a03=_0x5a8a03||0xcc;return function(_0xc81f9d){if(_0xc81f9d){return _0x9c9db5[_0x3c96('0x16')](_0x5a8a03);}return _0x9c9db5['status'](_0x5a8a03)['end']();};}function respondWithResult(_0x39f49a,_0xab1e51){_0xab1e51=_0xab1e51||0xc8;return function(_0x25f46a){if(_0x25f46a){return _0x39f49a[_0x3c96('0x17')](_0xab1e51)[_0x3c96('0x18')](_0x25f46a);}};}function respondWithFilteredResult(_0x4afe26,_0x54fcf0){return function(_0x49cee1){if(_0x49cee1){var _0x328ec0=_0x49cee1[_0x3c96('0x19')],_0x23f96e=_0x54fcf0[_0x3c96('0x1a')],_0x1ffc1e=_0x54fcf0[_0x3c96('0x1a')]+_0x54fcf0[_0x3c96('0x1b')],_0x386d69;if(_0x1ffc1e>=_0x328ec0){_0x1ffc1e=_0x328ec0;_0x386d69=0xc8;}else{_0x386d69=0xce;}_0x4afe26[_0x3c96('0x17')](_0x386d69);return _0x4afe26[_0x3c96('0x1c')](_0x3c96('0x1d'),_0x23f96e+'-'+_0x1ffc1e+'/'+_0x328ec0)[_0x3c96('0x18')](_0x49cee1);}return null;};}function patchUpdates(_0x49bcdd){return function(_0x1e9918){try{jsonpatch[_0x3c96('0x1e')](_0x1e9918,_0x49bcdd,!![]);}catch(_0x34c0ce){return BPromise[_0x3c96('0x1f')](_0x34c0ce);}return _0x1e9918['save']();};}function saveUpdates(_0x18579c,_0xf68213){return function(_0x1f7414){if(_0x1f7414){return _0x1f7414[_0x3c96('0x20')](_0x18579c)['then'](function(_0x3ceaa4){return _0x3ceaa4;});}return null;};}function removeEntity(_0x4486d9,_0x1c1334){return function(_0xf4b659){if(_0xf4b659){return _0xf4b659[_0x3c96('0x21')]()[_0x3c96('0x22')](function(){var _0x2593f9=_0xf4b659['get']({'plain':!![]});var _0xdf7470=_0x3c96('0x23');return db[_0x3c96('0x24')][_0x3c96('0x21')]({'where':{'type':_0xdf7470,'resourceId':_0x2593f9['id']}})[_0x3c96('0x22')](function(){return _0xf4b659;});})[_0x3c96('0x22')](function(){_0x4486d9['status'](0xcc)[_0x3c96('0x25')]();});}};}function handleEntityNotFound(_0x28867b,_0x461880){return function(_0x4f848c){if(!_0x4f848c){_0x28867b['sendStatus'](0x194);}return _0x4f848c;};}function handleError(_0x2a2ace,_0xb16d7a){_0xb16d7a=_0xb16d7a||0x1f4;return function(_0x3791fe){logger[_0x3c96('0x26')](_0x3791fe[_0x3c96('0x27')]);if(_0x3791fe[_0x3c96('0x28')]){delete _0x3791fe[_0x3c96('0x28')];}_0x2a2ace[_0x3c96('0x17')](_0xb16d7a)[_0x3c96('0x29')](_0x3791fe);};}exports[_0x3c96('0x2a')]=function(_0x2dd1ad,_0x27a25d){var _0xc08792={},_0x10a930={},_0x23d1db={'count':0x0,'rows':[]};var _0x342f14=_[_0x3c96('0x2b')](db['AnalyticMetric'][_0x3c96('0x2c')],function(_0x18bf30){return{'name':_0x18bf30['fieldName'],'type':_0x18bf30[_0x3c96('0x2d')][_0x3c96('0x2e')]};});_0x10a930['model']=_[_0x3c96('0x2b')](_0x342f14,_0x3c96('0x28'));_0x10a930['query']=_[_0x3c96('0x2f')](_0x2dd1ad[_0x3c96('0x30')]);_0x10a930['filters']=_['intersection'](_0x10a930[_0x3c96('0x31')],_0x10a930['query']);_0xc08792[_0x3c96('0x32')]=_[_0x3c96('0x33')](_0x10a930[_0x3c96('0x31')],qs[_0x3c96('0x34')](_0x2dd1ad['query'][_0x3c96('0x34')]));_0xc08792[_0x3c96('0x32')]=_0xc08792['attributes'][_0x3c96('0x35')]?_0xc08792[_0x3c96('0x32')]:_0x10a930[_0x3c96('0x31')];if(!_0x2dd1ad['query'][_0x3c96('0x36')](_0x3c96('0x37'))){_0xc08792[_0x3c96('0x1b')]=qs[_0x3c96('0x1b')](_0x2dd1ad[_0x3c96('0x30')][_0x3c96('0x1b')]);_0xc08792[_0x3c96('0x1a')]=qs['offset'](_0x2dd1ad[_0x3c96('0x30')][_0x3c96('0x1a')]);}_0xc08792[_0x3c96('0x38')]=qs[_0x3c96('0x39')](_0x2dd1ad[_0x3c96('0x30')]['sort']);_0xc08792[_0x3c96('0x3a')]=qs['filters'](_['pick'](_0x2dd1ad['query'],_0x10a930[_0x3c96('0x3b')]));if(_0x2dd1ad['query']['filter']){_0xc08792[_0x3c96('0x3a')]=_[_0x3c96('0x3c')](_0xc08792[_0x3c96('0x3a')],{'$or':_[_0x3c96('0x2b')](_0x342f14,function(_0x2eae62){if(_0x2eae62[_0x3c96('0x2d')]!=='VIRTUAL'){var _0x20f37b={};_0x20f37b[_0x2eae62[_0x3c96('0x28')]]={'$like':'%'+_0x2dd1ad[_0x3c96('0x30')]['filter']+'%'};return _0x20f37b;}})});}_0xc08792=_[_0x3c96('0x3c')]({},_0xc08792,_0x2dd1ad[_0x3c96('0x3d')]);var _0x2c43ba={'where':_0xc08792['where']};return db[_0x3c96('0x3e')][_0x3c96('0x19')](_0x2c43ba)[_0x3c96('0x22')](function(_0x2a90f6){_0x23d1db['count']=_0x2a90f6;if(_0x2dd1ad[_0x3c96('0x30')][_0x3c96('0x3f')]){_0xc08792[_0x3c96('0x40')]=[{'all':!![]}];}return db[_0x3c96('0x3e')][_0x3c96('0x41')](_0xc08792);})['then'](function(_0x29d70d){_0x23d1db[_0x3c96('0x42')]=_0x29d70d;return _0x23d1db;})['then'](respondWithFilteredResult(_0x27a25d,_0xc08792))[_0x3c96('0x43')](handleError(_0x27a25d,null));};exports[_0x3c96('0x44')]=function(_0x2a9769,_0x4899ca){var _0x14dd72={'raw':!![],'where':{'id':_0x2a9769[_0x3c96('0x45')]['id']}},_0x567e6f={};_0x567e6f[_0x3c96('0x31')]=_[_0x3c96('0x2f')](db['AnalyticMetric'][_0x3c96('0x2c')]);_0x567e6f[_0x3c96('0x30')]=_[_0x3c96('0x2f')](_0x2a9769[_0x3c96('0x30')]);_0x567e6f['filters']=_[_0x3c96('0x33')](_0x567e6f[_0x3c96('0x31')],_0x567e6f[_0x3c96('0x30')]);_0x14dd72[_0x3c96('0x32')]=_['intersection'](_0x567e6f['model'],qs[_0x3c96('0x34')](_0x2a9769[_0x3c96('0x30')][_0x3c96('0x34')]));_0x14dd72[_0x3c96('0x32')]=_0x14dd72[_0x3c96('0x32')]['length']?_0x14dd72[_0x3c96('0x32')]:_0x567e6f['model'];if(_0x2a9769[_0x3c96('0x30')][_0x3c96('0x3f')]){_0x14dd72[_0x3c96('0x40')]=[{'all':!![]}];}_0x14dd72=_[_0x3c96('0x3c')]({},_0x14dd72,_0x2a9769[_0x3c96('0x3d')]);return db[_0x3c96('0x3e')]['find'](_0x14dd72)[_0x3c96('0x22')](handleEntityNotFound(_0x4899ca,null))['then'](respondWithResult(_0x4899ca,null))['catch'](handleError(_0x4899ca,null));};exports[_0x3c96('0x46')]=function(_0x16f196,_0x35143c){return db[_0x3c96('0x3e')][_0x3c96('0x46')](_0x16f196[_0x3c96('0x47')],{})[_0x3c96('0x22')](function(_0x279b6a){var _0x41538a=_0x16f196[_0x3c96('0x48')][_0x3c96('0x49')]({'plain':!![]});if(!_0x41538a)throw new Error(_0x3c96('0x4a'));if(_0x41538a[_0x3c96('0x4b')]===_0x3c96('0x48')){var _0x55352c=_0x279b6a[_0x3c96('0x49')]({'plain':!![]});var _0x1a6d76=_0x3c96('0x23');return db[_0x3c96('0x4c')]['find']({'where':{'name':_0x1a6d76,'userProfileId':_0x41538a[_0x3c96('0x4d')]},'raw':!![]})[_0x3c96('0x22')](function(_0x1bcf33){if(_0x1bcf33&&_0x1bcf33[_0x3c96('0x4e')]===0x0){return db[_0x3c96('0x24')][_0x3c96('0x46')]({'name':_0x55352c['name'],'resourceId':_0x55352c['id'],'type':_0x1bcf33[_0x3c96('0x28')],'sectionId':_0x1bcf33['id']},{})['then'](function(){return _0x279b6a;});}else{return _0x279b6a;}})[_0x3c96('0x43')](function(_0x3ea7cc){logger[_0x3c96('0x26')](_0x3c96('0x4f'),_0x3ea7cc);throw _0x3ea7cc;});}return _0x279b6a;})[_0x3c96('0x22')](respondWithResult(_0x35143c,0xc9))[_0x3c96('0x43')](handleError(_0x35143c,null));};exports['update']=function(_0x2be6d7,_0x35a448){if(_0x2be6d7[_0x3c96('0x47')]['id']){delete _0x2be6d7[_0x3c96('0x47')]['id'];}return db[_0x3c96('0x3e')][_0x3c96('0x50')]({'where':{'id':_0x2be6d7[_0x3c96('0x45')]['id']}})[_0x3c96('0x22')](handleEntityNotFound(_0x35a448,null))['then'](saveUpdates(_0x2be6d7['body'],null))[_0x3c96('0x22')](respondWithResult(_0x35a448,null))['catch'](handleError(_0x35a448,null));};exports[_0x3c96('0x21')]=function(_0x2f307d,_0x4303c8){return db[_0x3c96('0x3e')][_0x3c96('0x50')]({'where':{'id':_0x2f307d[_0x3c96('0x45')]['id']}})[_0x3c96('0x22')](handleEntityNotFound(_0x4303c8,null))['then'](removeEntity(_0x4303c8,null))[_0x3c96('0x43')](handleError(_0x4303c8,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index 4a0efb8..ef52098 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 _0x63cb=['request-promise','path','rimraf','../../config/environment','./analyticMetric.attributes','AnalyticMetric','analytics_metrics','lodash','../../config/logger','api','moment','bluebird'];(function(_0xeca528,_0x1581f2){var _0xea7d81=function(_0x55508c){while(--_0x55508c){_0xeca528['push'](_0xeca528['shift']());}};_0xea7d81(++_0x1581f2);}(_0x63cb,0x1db));var _0xb63c=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0x63cb[_0x4dc7b9];return _0x3ab114;};'use strict';var _=require(_0xb63c('0x0'));var util=require('util');var logger=require(_0xb63c('0x1'))(_0xb63c('0x2'));var moment=require(_0xb63c('0x3'));var BPromise=require(_0xb63c('0x4'));var rp=require(_0xb63c('0x5'));var fs=require('fs');var path=require(_0xb63c('0x6'));var rimraf=require(_0xb63c('0x7'));var config=require(_0xb63c('0x8'));var attributes=require(_0xb63c('0x9'));module['exports']=function(_0x4f9f6d,_0x491c8f){return _0x4f9f6d['define'](_0xb63c('0xa'),attributes,{'tableName':_0xb63c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc9da=['../../config/environment','./analyticMetric.attributes','define','analytics_metrics','lodash','util','api','moment','request-promise','path','rimraf'];(function(_0x235563,_0x260ece){var _0x219be0=function(_0xef2469){while(--_0xef2469){_0x235563['push'](_0x235563['shift']());}};_0x219be0(++_0x260ece);}(_0xc9da,0xa9));var _0xac9d=function(_0x2aa0e7,_0x4e5145){_0x2aa0e7=_0x2aa0e7-0x0;var _0x1472c0=_0xc9da[_0x2aa0e7];return _0x1472c0;};'use strict';var _=require(_0xac9d('0x0'));var util=require(_0xac9d('0x1'));var logger=require('../../config/logger')(_0xac9d('0x2'));var moment=require(_0xac9d('0x3'));var BPromise=require('bluebird');var rp=require(_0xac9d('0x4'));var fs=require('fs');var path=require(_0xac9d('0x5'));var rimraf=require(_0xac9d('0x6'));var config=require(_0xac9d('0x7'));var attributes=require(_0xac9d('0x8'));module['exports']=function(_0x3b4886,_0x14411f){return _0x3b4886[_0xac9d('0x9')]('AnalyticMetric',attributes,{'tableName':_0xac9d('0xa'),'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 c08d988..9db15b7 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 _0x5982=['then','info','AnalyticMetric,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4b0c4f,_0x2f4508){var _0x14c0b7=function(_0x4e855b){while(--_0x4e855b){_0x4b0c4f['push'](_0x4b0c4f['shift']());}};_0x14c0b7(++_0x2f4508);}(_0x5982,0xa1));var _0x2598=function(_0x535fa0,_0x441d8c){_0x535fa0=_0x535fa0-0x0;var _0x557e0a=_0x5982[_0x535fa0];return _0x557e0a;};'use strict';var _=require('lodash');var util=require(_0x2598('0x0'));var moment=require(_0x2598('0x1'));var BPromise=require(_0x2598('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2598('0x3'));var db=require(_0x2598('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2598('0x5'))(_0x2598('0x6'));var config=require(_0x2598('0x7'));var jayson=require(_0x2598('0x8'));var client=jayson[_0x2598('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54a52a,_0x186315,_0x27a0a9){return new BPromise(function(_0x6202a,_0x31d184){return client['request'](_0x54a52a,_0x27a0a9)[_0x2598('0xa')](function(_0x1926f3){logger[_0x2598('0xb')](_0x2598('0xc'),_0x186315,_0x2598('0xd'));logger[_0x2598('0xe')]('AnalyticMetric,\x20%s,\x20%s,\x20%s',_0x186315,_0x2598('0xd'),JSON[_0x2598('0xf')](_0x1926f3));if(_0x1926f3[_0x2598('0x10')]){if(_0x1926f3[_0x2598('0x10')]['code']===0x1f4){logger['error'](_0x2598('0xc'),_0x186315,_0x1926f3['error'][_0x2598('0x11')]);return _0x31d184(_0x1926f3[_0x2598('0x10')][_0x2598('0x11')]);}logger[_0x2598('0x10')](_0x2598('0xc'),_0x186315,_0x1926f3[_0x2598('0x10')][_0x2598('0x11')]);return _0x6202a(_0x1926f3[_0x2598('0x10')][_0x2598('0x11')]);}else{logger[_0x2598('0xb')](_0x2598('0xc'),_0x186315,_0x2598('0xd'));_0x6202a(_0x1926f3['result'][_0x2598('0x11')]);}})[_0x2598('0x12')](function(_0x51e4a8){logger[_0x2598('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x186315,_0x51e4a8);_0x31d184(_0x51e4a8);});});} \ No newline at end of file +var _0x63b0=['request\x20sent','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','AnalyticMetric,\x20%s,\x20%s','AnalyticMetric,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x2bcb57,_0xfcdaf6){var _0x51b60d=function(_0x1af818){while(--_0x1af818){_0x2bcb57['push'](_0x2bcb57['shift']());}};_0x51b60d(++_0xfcdaf6);}(_0x63b0,0x169));var _0x063b=function(_0x435971,_0x35157d){_0x435971=_0x435971-0x0;var _0x3a9578=_0x63b0[_0x435971];return _0x3a9578;};'use strict';var _=require('lodash');var util=require(_0x063b('0x0'));var moment=require(_0x063b('0x1'));var BPromise=require(_0x063b('0x2'));var rs=require(_0x063b('0x3'));var fs=require('fs');var Redis=require(_0x063b('0x4'));var db=require(_0x063b('0x5'))['db'];var utils=require(_0x063b('0x6'));var logger=require(_0x063b('0x7'))('rpc');var config=require(_0x063b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x063b('0x9')][_0x063b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x48d797,_0x89df75,_0x19d989){return new BPromise(function(_0x2a0ac3,_0x4bd188){return client['request'](_0x48d797,_0x19d989)[_0x063b('0xb')](function(_0x38cd06){logger[_0x063b('0xc')](_0x063b('0xd'),_0x89df75,'request\x20sent');logger['debug'](_0x063b('0xe'),_0x89df75,'request\x20sent',JSON[_0x063b('0xf')](_0x38cd06));if(_0x38cd06[_0x063b('0x10')]){if(_0x38cd06['error'][_0x063b('0x11')]===0x1f4){logger[_0x063b('0x10')]('AnalyticMetric,\x20%s,\x20%s',_0x89df75,_0x38cd06[_0x063b('0x10')]['message']);return _0x4bd188(_0x38cd06[_0x063b('0x10')]['message']);}logger[_0x063b('0x10')](_0x063b('0xd'),_0x89df75,_0x38cd06[_0x063b('0x10')][_0x063b('0x12')]);return _0x2a0ac3(_0x38cd06[_0x063b('0x10')][_0x063b('0x12')]);}else{logger[_0x063b('0xc')](_0x063b('0xd'),_0x89df75,_0x063b('0x13'));_0x2a0ac3(_0x38cd06['result'][_0x063b('0x12')]);}})['catch'](function(_0x4ab9bf){logger['error'](_0x063b('0xd'),_0x89df75,_0x4ab9bf);_0x4bd188(_0x4ab9bf);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index 39aaef2..6f010ad 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 _0x0295=['delete','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','put'];(function(_0x1e9381,_0x5a1ad4){var _0x4c95ce=function(_0x566c90){while(--_0x566c90){_0x1e9381['push'](_0x1e9381['shift']());}};_0x4c95ce(++_0x5a1ad4);}(_0x0295,0x1f0));var _0x5029=function(_0x484209,_0x202d7d){_0x484209=_0x484209-0x0;var _0x5cc99f=_0x0295[_0x484209];return _0x5cc99f;};'use strict';var multer=require(_0x5029('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x5029('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x5029('0x2'));var interaction=require(_0x5029('0x3'));var config=require(_0x5029('0x4'));var controller=require(_0x5029('0x5'));router[_0x5029('0x6')]('/',auth[_0x5029('0x7')](),controller[_0x5029('0x8')]);router[_0x5029('0x6')](_0x5029('0x9'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x5029('0x7')](),controller['create']);router[_0x5029('0xa')]('/:id',auth[_0x5029('0x7')](),controller['update']);router[_0x5029('0xb')](_0x5029('0x9'),auth[_0x5029('0x7')](),controller['destroy']);module[_0x5029('0xc')]=router; \ No newline at end of file +var _0xe2fe=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticMetric.controller','isAuthenticated','index','/:id','post','create','put','update','exports','multer'];(function(_0x3d33fa,_0x5cf836){var _0x212784=function(_0x2c4e5d){while(--_0x2c4e5d){_0x3d33fa['push'](_0x3d33fa['shift']());}};_0x212784(++_0x5cf836);}(_0xe2fe,0x86));var _0xee2f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe2fe[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0xee2f('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xee2f('0x1'));var express=require('express');var router=express[_0xee2f('0x2')]();var auth=require(_0xee2f('0x3'));var interaction=require(_0xee2f('0x4'));var config=require(_0xee2f('0x5'));var controller=require(_0xee2f('0x6'));router['get']('/',auth[_0xee2f('0x7')](),controller[_0xee2f('0x8')]);router['get'](_0xee2f('0x9'),auth[_0xee2f('0x7')](),controller['show']);router[_0xee2f('0xa')]('/',auth['isAuthenticated'](),controller[_0xee2f('0xb')]);router[_0xee2f('0xc')]('/:id',auth[_0xee2f('0x7')](),controller[_0xee2f('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xee2f('0xe')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index 86252c2..754c914 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 _0x38ed=['sequelize','exports','TEXT'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0x38ed,0x186));var _0xd38e=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x38ed[_0x422905];return _0x33dc6c;};'use strict';var Sequelize=require(_0xd38e('0x0'));module[_0xd38e('0x1')]={'tree':{'type':Sequelize[_0xd38e('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x5c19=['TEXT','sequelize'];(function(_0x310bc8,_0x57b39f){var _0xba541=function(_0x358b71){while(--_0x358b71){_0x310bc8['push'](_0x310bc8['shift']());}};_0xba541(++_0x57b39f);}(_0x5c19,0x12d));var _0x95c1=function(_0x1bfb48,_0x2de37a){_0x1bfb48=_0x1bfb48-0x0;var _0x1f432a=_0x5c19[_0x1bfb48];return _0x1f432a;};'use strict';var Sequelize=require(_0x95c1('0x0'));module['exports']={'tree':{'type':Sequelize[_0x95c1('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 cd349c9..a300763 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 _0xe5b5=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','map','AnalyticTreeReport','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','include','rows','catch','show','params','includeAll','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x3baf43,_0x5ae295){var _0x164eb4=function(_0xf72083){while(--_0xf72083){_0x3baf43['push'](_0x3baf43['shift']());}};_0x164eb4(++_0x5ae295);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x2ce6d5,_0x333e0c){_0x2ce6d5=_0x2ce6d5-0x0;var _0x32d272=_0xe5b5[_0x2ce6d5];return _0x32d272;};'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 Redis=require(_0x5e5b('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x5e5b('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5e5b('0x17'));var logger=require(_0x5e5b('0x18'))(_0x5e5b('0x19'));var utils=require(_0x5e5b('0x1a'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ebf65,_0x310f71){_0x310f71=_0x310f71||0xcc;return function(_0x18434e){if(_0x18434e){return _0x5ebf65[_0x5e5b('0x1b')](_0x310f71);}return _0x5ebf65[_0x5e5b('0x1c')](_0x310f71)[_0x5e5b('0x1d')]();};}function respondWithResult(_0x1e3483,_0x2e331d){_0x2e331d=_0x2e331d||0xc8;return function(_0x49edd0){if(_0x49edd0){return _0x1e3483[_0x5e5b('0x1c')](_0x2e331d)[_0x5e5b('0x1e')](_0x49edd0);}};}function respondWithFilteredResult(_0x4ff37b,_0x227417){return function(_0x578c14){if(_0x578c14){var _0x4e9509=_0x578c14['count'],_0x13a1cb=_0x227417[_0x5e5b('0x1f')],_0x444435=_0x227417['offset']+_0x227417[_0x5e5b('0x20')],_0xaf9ace;if(_0x444435>=_0x4e9509){_0x444435=_0x4e9509;_0xaf9ace=0xc8;}else{_0xaf9ace=0xce;}_0x4ff37b[_0x5e5b('0x1c')](_0xaf9ace);return _0x4ff37b['set'](_0x5e5b('0x21'),_0x13a1cb+'-'+_0x444435+'/'+_0x4e9509)[_0x5e5b('0x1e')](_0x578c14);}return null;};}function patchUpdates(_0x2281c8){return function(_0x538074){try{jsonpatch[_0x5e5b('0x22')](_0x538074,_0x2281c8,!![]);}catch(_0x3f1103){return BPromise['reject'](_0x3f1103);}return _0x538074[_0x5e5b('0x23')]();};}function saveUpdates(_0x1aa0c2,_0x3c488e){return function(_0x2d8252){if(_0x2d8252){return _0x2d8252[_0x5e5b('0x24')](_0x1aa0c2)[_0x5e5b('0x25')](function(_0x93df5c){return _0x93df5c;});}return null;};}function removeEntity(_0x37552c,_0x4a78e3){return function(_0x512e46){if(_0x512e46){return _0x512e46[_0x5e5b('0x26')]()[_0x5e5b('0x25')](function(){_0x37552c[_0x5e5b('0x1c')](0xcc)[_0x5e5b('0x1d')]();});}};}function handleEntityNotFound(_0x2e38ed,_0x28cd95){return function(_0x135c6c){if(!_0x135c6c){_0x2e38ed[_0x5e5b('0x1b')](0x194);}return _0x135c6c;};}function handleError(_0x161599,_0x26bc02){_0x26bc02=_0x26bc02||0x1f4;return function(_0x1788fd){logger['error'](_0x1788fd[_0x5e5b('0x27')]);if(_0x1788fd[_0x5e5b('0x28')]){delete _0x1788fd[_0x5e5b('0x28')];}_0x161599['status'](_0x26bc02)[_0x5e5b('0x29')](_0x1788fd);};}exports[_0x5e5b('0x2a')]=function(_0x5ee866,_0x13ff91){var _0x21c74b={},_0x39ce16={},_0x36b595={'count':0x0,'rows':[]};var _0x31af09=_[_0x5e5b('0x2b')](db[_0x5e5b('0x2c')][_0x5e5b('0x2d')],function(_0x3f6b25){return{'name':_0x3f6b25[_0x5e5b('0x2e')],'type':_0x3f6b25[_0x5e5b('0x2f')][_0x5e5b('0x30')]};});_0x39ce16['model']=_['map'](_0x31af09,_0x5e5b('0x28'));_0x39ce16[_0x5e5b('0x31')]=_[_0x5e5b('0x32')](_0x5ee866[_0x5e5b('0x31')]);_0x39ce16[_0x5e5b('0x33')]=_['intersection'](_0x39ce16[_0x5e5b('0x34')],_0x39ce16['query']);_0x21c74b[_0x5e5b('0x35')]=_[_0x5e5b('0x36')](_0x39ce16[_0x5e5b('0x34')],qs[_0x5e5b('0x37')](_0x5ee866['query'][_0x5e5b('0x37')]));_0x21c74b[_0x5e5b('0x35')]=_0x21c74b['attributes'][_0x5e5b('0x38')]?_0x21c74b[_0x5e5b('0x35')]:_0x39ce16[_0x5e5b('0x34')];if(!_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x39')](_0x5e5b('0x3a'))){_0x21c74b[_0x5e5b('0x20')]=qs[_0x5e5b('0x20')](_0x5ee866['query'][_0x5e5b('0x20')]);_0x21c74b[_0x5e5b('0x1f')]=qs[_0x5e5b('0x1f')](_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x1f')]);}_0x21c74b[_0x5e5b('0x3b')]=qs['sort'](_0x5ee866['query'][_0x5e5b('0x3c')]);_0x21c74b[_0x5e5b('0x3d')]=qs[_0x5e5b('0x33')](_['pick'](_0x5ee866[_0x5e5b('0x31')],_0x39ce16[_0x5e5b('0x33')]));if(_0x5ee866[_0x5e5b('0x31')][_0x5e5b('0x3e')]){_0x21c74b['where']=_[_0x5e5b('0x3f')](_0x21c74b[_0x5e5b('0x3d')],{'$or':_['map'](_0x31af09,function(_0x5ad9a6){if(_0x5ad9a6[_0x5e5b('0x2f')]!==_0x5e5b('0x40')){var _0xee3e6f={};_0xee3e6f[_0x5ad9a6['name']]={'$like':'%'+_0x5ee866[_0x5e5b('0x31')]['filter']+'%'};return _0xee3e6f;}})});}_0x21c74b=_['merge']({},_0x21c74b,_0x5ee866[_0x5e5b('0x41')]);var _0x2bcfaa={'where':_0x21c74b[_0x5e5b('0x3d')]};return db[_0x5e5b('0x2c')][_0x5e5b('0x42')](_0x2bcfaa)[_0x5e5b('0x25')](function(_0x2c1eb1){_0x36b595[_0x5e5b('0x42')]=_0x2c1eb1;if(_0x5ee866[_0x5e5b('0x31')]['includeAll']){_0x21c74b[_0x5e5b('0x43')]=[{'all':!![]}];}return db[_0x5e5b('0x2c')]['findAll'](_0x21c74b);})[_0x5e5b('0x25')](function(_0x4b54b0){_0x36b595[_0x5e5b('0x44')]=_0x4b54b0;return _0x36b595;})[_0x5e5b('0x25')](respondWithFilteredResult(_0x13ff91,_0x21c74b))[_0x5e5b('0x45')](handleError(_0x13ff91,null));};exports[_0x5e5b('0x46')]=function(_0x1659d5,_0xbe8b1d){var _0x371550={'raw':!![],'where':{'id':_0x1659d5[_0x5e5b('0x47')]['id']}},_0x24d81f={};_0x24d81f[_0x5e5b('0x34')]=_[_0x5e5b('0x32')](db['AnalyticTreeReport'][_0x5e5b('0x2d')]);_0x24d81f[_0x5e5b('0x31')]=_[_0x5e5b('0x32')](_0x1659d5['query']);_0x24d81f[_0x5e5b('0x33')]=_[_0x5e5b('0x36')](_0x24d81f['model'],_0x24d81f[_0x5e5b('0x31')]);_0x371550[_0x5e5b('0x35')]=_['intersection'](_0x24d81f[_0x5e5b('0x34')],qs['fields'](_0x1659d5['query']['fields']));_0x371550[_0x5e5b('0x35')]=_0x371550['attributes'][_0x5e5b('0x38')]?_0x371550['attributes']:_0x24d81f[_0x5e5b('0x34')];if(_0x1659d5[_0x5e5b('0x31')][_0x5e5b('0x48')]){_0x371550[_0x5e5b('0x43')]=[{'all':!![]}];}_0x371550=_[_0x5e5b('0x3f')]({},_0x371550,_0x1659d5[_0x5e5b('0x41')]);return db[_0x5e5b('0x2c')]['find'](_0x371550)['then'](handleEntityNotFound(_0xbe8b1d,null))[_0x5e5b('0x25')](respondWithResult(_0xbe8b1d,null))['catch'](handleError(_0xbe8b1d,null));};exports['create']=function(_0x4e83eb,_0x249922){return db['AnalyticTreeReport'][_0x5e5b('0x49')](_0x4e83eb[_0x5e5b('0x4a')],{})[_0x5e5b('0x25')](respondWithResult(_0x249922,0xc9))[_0x5e5b('0x45')](handleError(_0x249922,null));};exports[_0x5e5b('0x24')]=function(_0x192445,_0x4fd265){if(_0x192445[_0x5e5b('0x4a')]['id']){delete _0x192445[_0x5e5b('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x5e5b('0x4b')]({'where':{'id':_0x192445['params']['id']}})[_0x5e5b('0x25')](handleEntityNotFound(_0x4fd265,null))[_0x5e5b('0x25')](saveUpdates(_0x192445[_0x5e5b('0x4a')],null))[_0x5e5b('0x25')](respondWithResult(_0x4fd265,null))['catch'](handleError(_0x4fd265,null));};exports[_0x5e5b('0x26')]=function(_0x1c4efe,_0x4f4ea3){return db[_0x5e5b('0x2c')][_0x5e5b('0x4b')]({'where':{'id':_0x1c4efe[_0x5e5b('0x47')]['id']}})[_0x5e5b('0x25')](handleEntityNotFound(_0x4f4ea3,null))[_0x5e5b('0x25')](removeEntity(_0x4f4ea3,null))[_0x5e5b('0x45')](handleError(_0x4f4ea3,null));}; \ No newline at end of file +var _0x9ffd=['hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','create','body','params','destroy','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','type','key','model','map','keys','filters','intersection','attributes','fields','length','query'];(function(_0x16eb19,_0x58cea4){var _0x312a25=function(_0x343702){while(--_0x343702){_0x16eb19['push'](_0x16eb19['shift']());}};_0x312a25(++_0x58cea4);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x4538c7,_0x5e3944){_0x4538c7=_0x4538c7-0x0;var _0x49e2b8=_0x9ffd[_0x4538c7];return _0x49e2b8;};'use strict';var pdf=require(_0xd9ff('0x0'));var emlformat=require(_0xd9ff('0x1'));var rimraf=require(_0xd9ff('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd9ff('0x3'));var rp=require(_0xd9ff('0x4'));var moment=require(_0xd9ff('0x5'));var BPromise=require(_0xd9ff('0x6'));var Mustache=require('mustache');var util=require(_0xd9ff('0x7'));var path=require(_0xd9ff('0x8'));var sox=require('sox');var csv=require(_0xd9ff('0x9'));var ejs=require(_0xd9ff('0xa'));var fs=require('fs');var _=require(_0xd9ff('0xb'));var squel=require(_0xd9ff('0xc'));var crypto=require(_0xd9ff('0xd'));var jsforce=require(_0xd9ff('0xe'));var deskjs=require(_0xd9ff('0xf'));var toCsv=require(_0xd9ff('0x9'));var querystring=require(_0xd9ff('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd9ff('0x11'));var hardwareService=require(_0xd9ff('0x12'));var logger=require(_0xd9ff('0x13'))(_0xd9ff('0x14'));var utils=require(_0xd9ff('0x15'));var config=require(_0xd9ff('0x16'));var db=require(_0xd9ff('0x17'))['db'];function respondWithStatusCode(_0x1c2a16,_0x47d842){_0x47d842=_0x47d842||0xcc;return function(_0x47b0d7){if(_0x47b0d7){return _0x1c2a16[_0xd9ff('0x18')](_0x47d842);}return _0x1c2a16[_0xd9ff('0x19')](_0x47d842)[_0xd9ff('0x1a')]();};}function respondWithResult(_0x350a5d,_0x12c39a){_0x12c39a=_0x12c39a||0xc8;return function(_0x556aa4){if(_0x556aa4){return _0x350a5d[_0xd9ff('0x19')](_0x12c39a)[_0xd9ff('0x1b')](_0x556aa4);}};}function respondWithFilteredResult(_0x5c1a28,_0xf14c9f){return function(_0x5db010){if(_0x5db010){var _0x4ffe54=_0x5db010['count'],_0x547e28=_0xf14c9f[_0xd9ff('0x1c')],_0x4c5718=_0xf14c9f[_0xd9ff('0x1c')]+_0xf14c9f[_0xd9ff('0x1d')],_0x271287;if(_0x4c5718>=_0x4ffe54){_0x4c5718=_0x4ffe54;_0x271287=0xc8;}else{_0x271287=0xce;}_0x5c1a28[_0xd9ff('0x19')](_0x271287);return _0x5c1a28[_0xd9ff('0x1e')](_0xd9ff('0x1f'),_0x547e28+'-'+_0x4c5718+'/'+_0x4ffe54)[_0xd9ff('0x1b')](_0x5db010);}return null;};}function patchUpdates(_0x128588){return function(_0x182775){try{jsonpatch[_0xd9ff('0x20')](_0x182775,_0x128588,!![]);}catch(_0x3ea97d){return BPromise[_0xd9ff('0x21')](_0x3ea97d);}return _0x182775[_0xd9ff('0x22')]();};}function saveUpdates(_0x4c8740,_0x4cf8ec){return function(_0x264a3d){if(_0x264a3d){return _0x264a3d[_0xd9ff('0x23')](_0x4c8740)['then'](function(_0x588151){return _0x588151;});}return null;};}function removeEntity(_0x5ab7b6,_0x4b1477){return function(_0x1f4d9e){if(_0x1f4d9e){return _0x1f4d9e['destroy']()[_0xd9ff('0x24')](function(){_0x5ab7b6[_0xd9ff('0x19')](0xcc)[_0xd9ff('0x1a')]();});}};}function handleEntityNotFound(_0x9f074e,_0x278b66){return function(_0x42a828){if(!_0x42a828){_0x9f074e['sendStatus'](0x194);}return _0x42a828;};}function handleError(_0x4fada1,_0x1136e9){_0x1136e9=_0x1136e9||0x1f4;return function(_0x599fec){logger[_0xd9ff('0x25')](_0x599fec['stack']);if(_0x599fec[_0xd9ff('0x26')]){delete _0x599fec['name'];}_0x4fada1[_0xd9ff('0x19')](_0x1136e9)[_0xd9ff('0x27')](_0x599fec);};}exports[_0xd9ff('0x28')]=function(_0x2970e8,_0x5d685e){var _0x11a17b={},_0xe11f88={},_0x1c78c4={'count':0x0,'rows':[]};var _0x4390f7=_['map'](db[_0xd9ff('0x29')][_0xd9ff('0x2a')],function(_0x44b5a7){return{'name':_0x44b5a7[_0xd9ff('0x2b')],'type':_0x44b5a7[_0xd9ff('0x2c')][_0xd9ff('0x2d')]};});_0xe11f88[_0xd9ff('0x2e')]=_[_0xd9ff('0x2f')](_0x4390f7,_0xd9ff('0x26'));_0xe11f88['query']=_[_0xd9ff('0x30')](_0x2970e8['query']);_0xe11f88[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0xe11f88[_0xd9ff('0x2e')],_0xe11f88['query']);_0x11a17b[_0xd9ff('0x33')]=_[_0xd9ff('0x32')](_0xe11f88[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x2970e8['query'][_0xd9ff('0x34')]));_0x11a17b['attributes']=_0x11a17b[_0xd9ff('0x33')][_0xd9ff('0x35')]?_0x11a17b[_0xd9ff('0x33')]:_0xe11f88[_0xd9ff('0x2e')];if(!_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x37')](_0xd9ff('0x38'))){_0x11a17b[_0xd9ff('0x1d')]=qs[_0xd9ff('0x1d')](_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x1d')]);_0x11a17b[_0xd9ff('0x1c')]=qs[_0xd9ff('0x1c')](_0x2970e8[_0xd9ff('0x36')]['offset']);}_0x11a17b[_0xd9ff('0x39')]=qs[_0xd9ff('0x3a')](_0x2970e8[_0xd9ff('0x36')]['sort']);_0x11a17b[_0xd9ff('0x3b')]=qs['filters'](_[_0xd9ff('0x3c')](_0x2970e8['query'],_0xe11f88[_0xd9ff('0x31')]));if(_0x2970e8['query'][_0xd9ff('0x3d')]){_0x11a17b[_0xd9ff('0x3b')]=_[_0xd9ff('0x3e')](_0x11a17b['where'],{'$or':_['map'](_0x4390f7,function(_0x5dad16){if(_0x5dad16[_0xd9ff('0x2c')]!==_0xd9ff('0x3f')){var _0x405c3b={};_0x405c3b[_0x5dad16[_0xd9ff('0x26')]]={'$like':'%'+_0x2970e8[_0xd9ff('0x36')][_0xd9ff('0x3d')]+'%'};return _0x405c3b;}})});}_0x11a17b=_['merge']({},_0x11a17b,_0x2970e8['options']);var _0x4a9804={'where':_0x11a17b[_0xd9ff('0x3b')]};return db[_0xd9ff('0x29')][_0xd9ff('0x40')](_0x4a9804)[_0xd9ff('0x24')](function(_0x56b94d){_0x1c78c4[_0xd9ff('0x40')]=_0x56b94d;if(_0x2970e8['query'][_0xd9ff('0x41')]){_0x11a17b[_0xd9ff('0x42')]=[{'all':!![]}];}return db[_0xd9ff('0x29')][_0xd9ff('0x43')](_0x11a17b);})['then'](function(_0x1e34da){_0x1c78c4[_0xd9ff('0x44')]=_0x1e34da;return _0x1c78c4;})['then'](respondWithFilteredResult(_0x5d685e,_0x11a17b))[_0xd9ff('0x45')](handleError(_0x5d685e,null));};exports[_0xd9ff('0x46')]=function(_0x94dcd8,_0x3ba5ff){var _0x1fe44d={'raw':!![],'where':{'id':_0x94dcd8['params']['id']}},_0x1cc848={};_0x1cc848[_0xd9ff('0x2e')]=_[_0xd9ff('0x30')](db[_0xd9ff('0x29')][_0xd9ff('0x2a')]);_0x1cc848[_0xd9ff('0x36')]=_['keys'](_0x94dcd8[_0xd9ff('0x36')]);_0x1cc848[_0xd9ff('0x31')]=_[_0xd9ff('0x32')](_0x1cc848['model'],_0x1cc848['query']);_0x1fe44d[_0xd9ff('0x33')]=_[_0xd9ff('0x32')](_0x1cc848[_0xd9ff('0x2e')],qs[_0xd9ff('0x34')](_0x94dcd8[_0xd9ff('0x36')][_0xd9ff('0x34')]));_0x1fe44d['attributes']=_0x1fe44d[_0xd9ff('0x33')][_0xd9ff('0x35')]?_0x1fe44d['attributes']:_0x1cc848[_0xd9ff('0x2e')];if(_0x94dcd8[_0xd9ff('0x36')][_0xd9ff('0x41')]){_0x1fe44d[_0xd9ff('0x42')]=[{'all':!![]}];}_0x1fe44d=_[_0xd9ff('0x3e')]({},_0x1fe44d,_0x94dcd8['options']);return db['AnalyticTreeReport']['find'](_0x1fe44d)[_0xd9ff('0x24')](handleEntityNotFound(_0x3ba5ff,null))['then'](respondWithResult(_0x3ba5ff,null))[_0xd9ff('0x45')](handleError(_0x3ba5ff,null));};exports[_0xd9ff('0x47')]=function(_0x19d473,_0x4cfba7){return db[_0xd9ff('0x29')][_0xd9ff('0x47')](_0x19d473['body'],{})[_0xd9ff('0x24')](respondWithResult(_0x4cfba7,0xc9))[_0xd9ff('0x45')](handleError(_0x4cfba7,null));};exports[_0xd9ff('0x23')]=function(_0x316854,_0x559101){if(_0x316854[_0xd9ff('0x48')]['id']){delete _0x316854['body']['id'];}return db[_0xd9ff('0x29')]['find']({'where':{'id':_0x316854[_0xd9ff('0x49')]['id']}})[_0xd9ff('0x24')](handleEntityNotFound(_0x559101,null))[_0xd9ff('0x24')](saveUpdates(_0x316854[_0xd9ff('0x48')],null))[_0xd9ff('0x24')](respondWithResult(_0x559101,null))['catch'](handleError(_0x559101,null));};exports[_0xd9ff('0x4a')]=function(_0x3d6f11,_0x2fbe53){return db[_0xd9ff('0x29')]['find']({'where':{'id':_0x3d6f11['params']['id']}})['then'](handleEntityNotFound(_0x2fbe53,null))[_0xd9ff('0x24')](removeEntity(_0x2fbe53,null))[_0xd9ff('0x45')](handleError(_0x2fbe53,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 555db2f..5c9d3e8 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 _0x9d76=['moment','bluebird','request-promise','path','./analyticTreeReport.attributes','exports','AnalyticTreeReport','analytics_report_trees','lodash','../../config/logger','api'];(function(_0x1d6a13,_0xbbd7cf){var _0x1984b0=function(_0x59cc5f){while(--_0x59cc5f){_0x1d6a13['push'](_0x1d6a13['shift']());}};_0x1984b0(++_0xbbd7cf);}(_0x9d76,0x76));var _0x69d7=function(_0xf535fa,_0x542089){_0xf535fa=_0xf535fa-0x0;var _0x5c2d39=_0x9d76[_0xf535fa];return _0x5c2d39;};'use strict';var _=require(_0x69d7('0x0'));var util=require('util');var logger=require(_0x69d7('0x1'))(_0x69d7('0x2'));var moment=require(_0x69d7('0x3'));var BPromise=require(_0x69d7('0x4'));var rp=require(_0x69d7('0x5'));var fs=require('fs');var path=require(_0x69d7('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x69d7('0x7'));module[_0x69d7('0x8')]=function(_0x9ec22e,_0x237111){return _0x9ec22e['define'](_0x69d7('0x9'),attributes,{'tableName':_0x69d7('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x63a6=['rimraf','../../config/environment','./analyticTreeReport.attributes','define','AnalyticTreeReport','util','../../config/logger','moment','bluebird','path'];(function(_0x4c8b9f,_0x27d603){var _0x5d8463=function(_0x179f14){while(--_0x179f14){_0x4c8b9f['push'](_0x4c8b9f['shift']());}};_0x5d8463(++_0x27d603);}(_0x63a6,0x1c7));var _0x663a=function(_0x4c70c4,_0x963969){_0x4c70c4=_0x4c70c4-0x0;var _0x437865=_0x63a6[_0x4c70c4];return _0x437865;};'use strict';var _=require('lodash');var util=require(_0x663a('0x0'));var logger=require(_0x663a('0x1'))('api');var moment=require(_0x663a('0x2'));var BPromise=require(_0x663a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x663a('0x4'));var rimraf=require(_0x663a('0x5'));var config=require(_0x663a('0x6'));var attributes=require(_0x663a('0x7'));module['exports']=function(_0x5aab49,_0x5907e8){return _0x5aab49[_0x663a('0x8')](_0x663a('0x9'),attributes,{'tableName':'analytics_report_trees','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 7c2c1f9..11983fa 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 _0x1907=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch','lodash','util','bluebird'];(function(_0x5a79e2,_0x319b1a){var _0x266c45=function(_0x172478){while(--_0x172478){_0x5a79e2['push'](_0x5a79e2['shift']());}};_0x266c45(++_0x319b1a);}(_0x1907,0x138));var _0x7190=function(_0x774c3c,_0x18ab79){_0x774c3c=_0x774c3c-0x0;var _0x9808cc=_0x1907[_0x774c3c];return _0x9808cc;};'use strict';var _=require(_0x7190('0x0'));var util=require(_0x7190('0x1'));var moment=require('moment');var BPromise=require(_0x7190('0x2'));var rs=require(_0x7190('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7190('0x4'))['db'];var utils=require(_0x7190('0x5'));var logger=require('../../config/logger')(_0x7190('0x6'));var config=require('../../config/environment');var jayson=require(_0x7190('0x7'));var client=jayson[_0x7190('0x8')][_0x7190('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x423107,_0xabc6a4,_0x316538){return new BPromise(function(_0x3cde4f,_0x4e517c){return client[_0x7190('0xa')](_0x423107,_0x316538)['then'](function(_0x506925){logger['info'](_0x7190('0xb'),_0xabc6a4,'request\x20sent');logger[_0x7190('0xc')](_0x7190('0xd'),_0xabc6a4,_0x7190('0xe'),JSON['stringify'](_0x506925));if(_0x506925[_0x7190('0xf')]){if(_0x506925['error'][_0x7190('0x10')]===0x1f4){logger['error'](_0x7190('0xb'),_0xabc6a4,_0x506925[_0x7190('0xf')][_0x7190('0x11')]);return _0x4e517c(_0x506925['error'][_0x7190('0x11')]);}logger['error'](_0x7190('0xb'),_0xabc6a4,_0x506925[_0x7190('0xf')][_0x7190('0x11')]);return _0x3cde4f(_0x506925[_0x7190('0xf')]['message']);}else{logger[_0x7190('0x12')](_0x7190('0xb'),_0xabc6a4,_0x7190('0xe'));_0x3cde4f(_0x506925[_0x7190('0x13')][_0x7190('0x11')]);}})[_0x7190('0x14')](function(_0x31b1a4){logger[_0x7190('0xf')](_0x7190('0xb'),_0xabc6a4,_0x31b1a4);_0x4e517c(_0x31b1a4);});});} \ No newline at end of file +var _0xff6e=['randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird'];(function(_0x1a48f2,_0x5d2109){var _0x2b46c6=function(_0x32a496){while(--_0x32a496){_0x1a48f2['push'](_0x1a48f2['shift']());}};_0x2b46c6(++_0x5d2109);}(_0xff6e,0x1a0));var _0xeff6=function(_0x1602ef,_0x447aba){_0x1602ef=_0x1602ef-0x0;var _0x5870ee=_0xff6e[_0x1602ef];return _0x5870ee;};'use strict';var _=require(_0xeff6('0x0'));var util=require(_0xeff6('0x1'));var moment=require(_0xeff6('0x2'));var BPromise=require(_0xeff6('0x3'));var rs=require(_0xeff6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeff6('0x5'))['db'];var utils=require(_0xeff6('0x6'));var logger=require('../../config/logger')(_0xeff6('0x7'));var config=require('../../config/environment');var jayson=require(_0xeff6('0x8'));var client=jayson[_0xeff6('0x9')][_0xeff6('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xad238f,_0x4af7b5,_0x3544ec){return new BPromise(function(_0x371381,_0x56255b){return client['request'](_0xad238f,_0x3544ec)[_0xeff6('0xb')](function(_0x25194c){logger[_0xeff6('0xc')](_0xeff6('0xd'),_0x4af7b5,_0xeff6('0xe'));logger['debug'](_0xeff6('0xf'),_0x4af7b5,_0xeff6('0xe'),JSON['stringify'](_0x25194c));if(_0x25194c['error']){if(_0x25194c[_0xeff6('0x10')][_0xeff6('0x11')]===0x1f4){logger['error'](_0xeff6('0xd'),_0x4af7b5,_0x25194c['error'][_0xeff6('0x12')]);return _0x56255b(_0x25194c[_0xeff6('0x10')][_0xeff6('0x12')]);}logger[_0xeff6('0x10')](_0xeff6('0xd'),_0x4af7b5,_0x25194c[_0xeff6('0x10')]['message']);return _0x371381(_0x25194c[_0xeff6('0x10')][_0xeff6('0x12')]);}else{logger[_0xeff6('0xc')](_0xeff6('0xd'),_0x4af7b5,_0xeff6('0xe'));_0x371381(_0x25194c[_0xeff6('0x13')][_0xeff6('0x12')]);}})['catch'](function(_0x46441a){logger[_0xeff6('0x10')](_0xeff6('0xd'),_0x4af7b5,_0x46441a);_0x56255b(_0x46441a);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index 37b3a04..097c7fb 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 _0x55e9=['destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','put','update','delete'];(function(_0x2ded7d,_0x2ecab0){var _0x15212b=function(_0x245416){while(--_0x245416){_0x2ded7d['push'](_0x2ded7d['shift']());}};_0x15212b(++_0x2ecab0);}(_0x55e9,0x16a));var _0x955e=function(_0x56f43b,_0x12f74b){_0x56f43b=_0x56f43b-0x0;var _0x2a81de=_0x55e9[_0x56f43b];return _0x2a81de;};'use strict';var multer=require(_0x955e('0x0'));var util=require(_0x955e('0x1'));var path=require(_0x955e('0x2'));var timeout=require(_0x955e('0x3'));var express=require('express');var router=express[_0x955e('0x4')]();var auth=require(_0x955e('0x5'));var interaction=require(_0x955e('0x6'));var config=require(_0x955e('0x7'));var controller=require('./analyticTreeReport.controller');router[_0x955e('0x8')]('/',auth[_0x955e('0x9')](),controller[_0x955e('0xa')]);router[_0x955e('0x8')](_0x955e('0xb'),auth[_0x955e('0x9')](),controller['show']);router[_0x955e('0xc')]('/',auth[_0x955e('0x9')](),controller['create']);router[_0x955e('0xd')](_0x955e('0xb'),auth['isAuthenticated'](),controller[_0x955e('0xe')]);router[_0x955e('0xf')]('/:id',auth[_0x955e('0x9')](),controller[_0x955e('0x10')]);module[_0x955e('0x11')]=router; \ No newline at end of file +var _0xb52f=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb52f,0x78));var _0xfb52=function(_0x5f0a5e,_0x3b4743){_0x5f0a5e=_0x5f0a5e-0x0;var _0x553af4=_0xb52f[_0x5f0a5e];return _0x553af4;};'use strict';var multer=require(_0xfb52('0x0'));var util=require(_0xfb52('0x1'));var path=require('path');var timeout=require(_0xfb52('0x2'));var express=require(_0xfb52('0x3'));var router=express[_0xfb52('0x4')]();var auth=require(_0xfb52('0x5'));var interaction=require(_0xfb52('0x6'));var config=require(_0xfb52('0x7'));var controller=require(_0xfb52('0x8'));router['get']('/',auth[_0xfb52('0x9')](),controller[_0xfb52('0xa')]);router['get'](_0xfb52('0xb'),auth[_0xfb52('0x9')](),controller[_0xfb52('0xc')]);router[_0xfb52('0xd')]('/',auth['isAuthenticated'](),controller[_0xfb52('0xe')]);router['put'](_0xfb52('0xb'),auth['isAuthenticated'](),controller[_0xfb52('0xf')]);router[_0xfb52('0x10')](_0xfb52('0xb'),auth[_0xfb52('0x9')](),controller[_0xfb52('0x11')]);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 08b94db..586170e 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 _0x6883=['sequelize','exports','STRING'];(function(_0x344a3f,_0x579a22){var _0x264712=function(_0x34c9f0){while(--_0x34c9f0){_0x344a3f['push'](_0x344a3f['shift']());}};_0x264712(++_0x579a22);}(_0x6883,0x9c));var _0x3688=function(_0x469a74,_0x5b7242){_0x469a74=_0x469a74-0x0;var _0x37599f=_0x6883[_0x469a74];return _0x37599f;};'use strict';var Sequelize=require(_0x3688('0x0'));module[_0x3688('0x1')]={'name':{'type':Sequelize[_0x3688('0x2')]},'basename':{'type':Sequelize[_0x3688('0x2')]},'type':{'type':Sequelize[_0x3688('0x2')]}}; \ No newline at end of file +var _0x5e93=['exports','STRING'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x5e93,0x96));var _0x35e9=function(_0x3d548f,_0x1e7128){_0x3d548f=_0x3d548f-0x0;var _0x324dd8=_0x5e93[_0x3d548f];return _0x324dd8;};'use strict';var Sequelize=require('sequelize');module[_0x35e9('0x0')]={'name':{'type':Sequelize[_0x35e9('0x1')]},'basename':{'type':Sequelize[_0x35e9('0x1')]},'type':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index 10558a6..3a5be44 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 _0xa29f=['intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','Attachment','include','findAll','rows','catch','show','params','includeAll','find','get','omit','createdAt','body','create','update','file','originalname','basename','filename','findOne','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','destroy','then','end','error','name','send','index','map','rawAttributes','type','key','query','keys'];(function(_0x36f7f3,_0x528e1c){var _0x22bf44=function(_0x2c111c){while(--_0x2c111c){_0x36f7f3['push'](_0x36f7f3['shift']());}};_0x22bf44(++_0x528e1c);}(_0xa29f,0x17f));var _0xfa29=function(_0x111777,_0x43e893){_0x111777=_0x111777-0x0;var _0x18b652=_0xa29f[_0x111777];return _0x18b652;};'use strict';var pdf=require(_0xfa29('0x0'));var emlformat=require(_0xfa29('0x1'));var rimraf=require(_0xfa29('0x2'));var zipdir=require(_0xfa29('0x3'));var jsonpatch=require(_0xfa29('0x4'));var rp=require(_0xfa29('0x5'));var moment=require(_0xfa29('0x6'));var BPromise=require(_0xfa29('0x7'));var Mustache=require(_0xfa29('0x8'));var util=require('util');var path=require('path');var sox=require(_0xfa29('0x9'));var csv=require(_0xfa29('0xa'));var ejs=require(_0xfa29('0xb'));var fs=require('fs');var _=require(_0xfa29('0xc'));var squel=require(_0xfa29('0xd'));var crypto=require(_0xfa29('0xe'));var jsforce=require(_0xfa29('0xf'));var deskjs=require(_0xfa29('0x10'));var toCsv=require('to-csv');var querystring=require(_0xfa29('0x11'));var Papa=require(_0xfa29('0x12'));var Redis=require(_0xfa29('0x13'));var authService=require(_0xfa29('0x14'));var qs=require(_0xfa29('0x15'));var as=require(_0xfa29('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xfa29('0x17'));var utils=require('../../config/utils');var config=require(_0xfa29('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4a1dab,_0x313ce7){_0x313ce7=_0x313ce7||0xcc;return function(_0x10da36){if(_0x10da36){return _0x4a1dab[_0xfa29('0x19')](_0x313ce7);}return _0x4a1dab[_0xfa29('0x1a')](_0x313ce7)['end']();};}function respondWithResult(_0xffdc10,_0x1c1881){_0x1c1881=_0x1c1881||0xc8;return function(_0xc3a829){if(_0xc3a829){return _0xffdc10[_0xfa29('0x1a')](_0x1c1881)[_0xfa29('0x1b')](_0xc3a829);}};}function respondWithFilteredResult(_0x58ad59,_0x460c16){return function(_0x499e2d){if(_0x499e2d){var _0x40af3a=_0x499e2d[_0xfa29('0x1c')],_0x46471a=_0x460c16[_0xfa29('0x1d')],_0x508143=_0x460c16[_0xfa29('0x1d')]+_0x460c16[_0xfa29('0x1e')],_0x4cd02f;if(_0x508143>=_0x40af3a){_0x508143=_0x40af3a;_0x4cd02f=0xc8;}else{_0x4cd02f=0xce;}_0x58ad59[_0xfa29('0x1a')](_0x4cd02f);return _0x58ad59[_0xfa29('0x1f')](_0xfa29('0x20'),_0x46471a+'-'+_0x508143+'/'+_0x40af3a)['json'](_0x499e2d);}return null;};}function patchUpdates(_0x214cd5){return function(_0x287d72){try{jsonpatch['apply'](_0x287d72,_0x214cd5,!![]);}catch(_0x3b0d4b){return BPromise[_0xfa29('0x21')](_0x3b0d4b);}return _0x287d72['save']();};}function saveUpdates(_0x7308ea,_0x11db03){return function(_0x584d0e){if(_0x584d0e){return _0x584d0e['update'](_0x7308ea)['then'](function(_0x4c1052){return _0x4c1052;});}return null;};}function removeEntity(_0x54e8c6,_0x534571){return function(_0x5c8896){if(_0x5c8896){return _0x5c8896[_0xfa29('0x22')]()[_0xfa29('0x23')](function(){_0x54e8c6[_0xfa29('0x1a')](0xcc)[_0xfa29('0x24')]();});}};}function handleEntityNotFound(_0x5083ea,_0x10024e){return function(_0x54866e){if(!_0x54866e){_0x5083ea[_0xfa29('0x19')](0x194);}return _0x54866e;};}function handleError(_0x393bd7,_0x8e1b31){_0x8e1b31=_0x8e1b31||0x1f4;return function(_0x458d76){logger[_0xfa29('0x25')](_0x458d76['stack']);if(_0x458d76[_0xfa29('0x26')]){delete _0x458d76[_0xfa29('0x26')];}_0x393bd7[_0xfa29('0x1a')](_0x8e1b31)[_0xfa29('0x27')](_0x458d76);};}exports[_0xfa29('0x28')]=function(_0x238303,_0x59cc70){var _0x518cce={},_0x628ad0={},_0x46f8d0={'count':0x0,'rows':[]};var _0x296f3e=_[_0xfa29('0x29')](db['Attachment'][_0xfa29('0x2a')],function(_0x375646){return{'name':_0x375646['fieldName'],'type':_0x375646[_0xfa29('0x2b')][_0xfa29('0x2c')]};});_0x628ad0['model']=_[_0xfa29('0x29')](_0x296f3e,_0xfa29('0x26'));_0x628ad0[_0xfa29('0x2d')]=_[_0xfa29('0x2e')](_0x238303[_0xfa29('0x2d')]);_0x628ad0['filters']=_[_0xfa29('0x2f')](_0x628ad0[_0xfa29('0x30')],_0x628ad0[_0xfa29('0x2d')]);_0x518cce[_0xfa29('0x31')]=_[_0xfa29('0x2f')](_0x628ad0[_0xfa29('0x30')],qs[_0xfa29('0x32')](_0x238303['query'][_0xfa29('0x32')]));_0x518cce[_0xfa29('0x31')]=_0x518cce[_0xfa29('0x31')][_0xfa29('0x33')]?_0x518cce[_0xfa29('0x31')]:_0x628ad0[_0xfa29('0x30')];if(!_0x238303[_0xfa29('0x2d')][_0xfa29('0x34')]('nolimit')){_0x518cce['limit']=qs['limit'](_0x238303[_0xfa29('0x2d')][_0xfa29('0x1e')]);_0x518cce[_0xfa29('0x1d')]=qs[_0xfa29('0x1d')](_0x238303[_0xfa29('0x2d')][_0xfa29('0x1d')]);}_0x518cce[_0xfa29('0x35')]=qs[_0xfa29('0x36')](_0x238303[_0xfa29('0x2d')][_0xfa29('0x36')]);_0x518cce[_0xfa29('0x37')]=qs[_0xfa29('0x38')](_[_0xfa29('0x39')](_0x238303['query'],_0x628ad0[_0xfa29('0x38')]));if(_0x238303['query'][_0xfa29('0x3a')]){_0x518cce[_0xfa29('0x37')]=_['merge'](_0x518cce['where'],{'$or':_[_0xfa29('0x29')](_0x296f3e,function(_0x16f997){if(_0x16f997[_0xfa29('0x2b')]!==_0xfa29('0x3b')){var _0x57629f={};_0x57629f[_0x16f997[_0xfa29('0x26')]]={'$like':'%'+_0x238303[_0xfa29('0x2d')][_0xfa29('0x3a')]+'%'};return _0x57629f;}})});}_0x518cce=_[_0xfa29('0x3c')]({},_0x518cce,_0x238303[_0xfa29('0x3d')]);var _0x11690d={'where':_0x518cce[_0xfa29('0x37')]};return db[_0xfa29('0x3e')]['count'](_0x11690d)[_0xfa29('0x23')](function(_0x438a60){_0x46f8d0['count']=_0x438a60;if(_0x238303[_0xfa29('0x2d')]['includeAll']){_0x518cce[_0xfa29('0x3f')]=[{'all':!![]}];}return db[_0xfa29('0x3e')][_0xfa29('0x40')](_0x518cce);})[_0xfa29('0x23')](function(_0x433f27){_0x46f8d0[_0xfa29('0x41')]=_0x433f27;return _0x46f8d0;})[_0xfa29('0x23')](respondWithFilteredResult(_0x59cc70,_0x518cce))[_0xfa29('0x42')](handleError(_0x59cc70,null));};exports[_0xfa29('0x43')]=function(_0xfd7e4c,_0x5baa95){var _0x29c696={'raw':!![],'where':{'id':_0xfd7e4c[_0xfa29('0x44')]['id']}},_0x3551e9={};_0x3551e9[_0xfa29('0x30')]=_[_0xfa29('0x2e')](db[_0xfa29('0x3e')][_0xfa29('0x2a')]);_0x3551e9[_0xfa29('0x2d')]=_['keys'](_0xfd7e4c[_0xfa29('0x2d')]);_0x3551e9[_0xfa29('0x38')]=_['intersection'](_0x3551e9[_0xfa29('0x30')],_0x3551e9[_0xfa29('0x2d')]);_0x29c696[_0xfa29('0x31')]=_['intersection'](_0x3551e9[_0xfa29('0x30')],qs[_0xfa29('0x32')](_0xfd7e4c['query'][_0xfa29('0x32')]));_0x29c696[_0xfa29('0x31')]=_0x29c696['attributes'][_0xfa29('0x33')]?_0x29c696[_0xfa29('0x31')]:_0x3551e9[_0xfa29('0x30')];if(_0xfd7e4c[_0xfa29('0x2d')][_0xfa29('0x45')]){_0x29c696[_0xfa29('0x3f')]=[{'all':!![]}];}_0x29c696=_[_0xfa29('0x3c')]({},_0x29c696,_0xfd7e4c[_0xfa29('0x3d')]);return db['Attachment']['find'](_0x29c696)[_0xfa29('0x23')](handleEntityNotFound(_0x5baa95,null))[_0xfa29('0x23')](respondWithResult(_0x5baa95,null))['catch'](handleError(_0x5baa95,null));};exports['clone']=function(_0x322201,_0x1ab169){var _0x2212cf={'where':{'id':_0x322201[_0xfa29('0x44')]['id']}},_0x2f2da4={};_0x2f2da4[_0xfa29('0x30')]=_[_0xfa29('0x2e')](db[_0xfa29('0x3e')][_0xfa29('0x2a')]);_0x2212cf[_0xfa29('0x31')]=_[_0xfa29('0x2f')](_0x2f2da4[_0xfa29('0x30')],qs[_0xfa29('0x32')](_0x322201[_0xfa29('0x2d')][_0xfa29('0x32')]));_0x2212cf['attributes']=_0x2212cf[_0xfa29('0x31')][_0xfa29('0x33')]?_0x2212cf[_0xfa29('0x31')]:_0x2f2da4[_0xfa29('0x30')];if(_0x322201[_0xfa29('0x2d')]['includeAll']){_0x2212cf[_0xfa29('0x3f')]=[{'all':!![]}];}_0x2212cf=_[_0xfa29('0x3c')]({},_0x2212cf,_0x322201[_0xfa29('0x3d')]);return db[_0xfa29('0x3e')][_0xfa29('0x46')](_0x2212cf)[_0xfa29('0x23')](handleEntityNotFound(_0x1ab169,null))[_0xfa29('0x23')](function(_0x5d3993){if(_0x5d3993){var _0x1df813=_0x5d3993[_0xfa29('0x47')]({'plain':!![]});_0x1df813=qs[_0xfa29('0x48')](_0x1df813,['id',_0xfa29('0x49'),'updatedAt']);_0x322201[_0xfa29('0x4a')]=_[_0xfa29('0x48')](_0x322201[_0xfa29('0x4a')],['id',_0xfa29('0x49'),'updatedAt']);return db[_0xfa29('0x3e')][_0xfa29('0x4b')](_[_0xfa29('0x3c')](_0x1df813,_0x322201['body']),{'include':_0x322201[_0xfa29('0x2d')]['includeAll']?[{'all':!![]}]:undefined});}})[_0xfa29('0x23')](respondWithResult(_0x1ab169,0xc9))[_0xfa29('0x42')](handleError(_0x1ab169,null));};exports[_0xfa29('0x4c')]=function(_0xa4f6f,_0x75d31a){if(_0xa4f6f[_0xfa29('0x4a')]['id']){delete _0xa4f6f['body']['id'];}return db[_0xfa29('0x3e')]['find']({'where':{'id':_0xa4f6f['params']['id']}})['then'](handleEntityNotFound(_0x75d31a,null))[_0xfa29('0x23')](saveUpdates(_0xa4f6f[_0xfa29('0x4a')],null))[_0xfa29('0x23')](respondWithResult(_0x75d31a,null))[_0xfa29('0x42')](handleError(_0x75d31a,null));};exports[_0xfa29('0x22')]=function(_0x25ff33,_0x2cda13){return db[_0xfa29('0x3e')]['find']({'where':{'id':_0x25ff33[_0xfa29('0x44')]['id']}})['then'](handleEntityNotFound(_0x2cda13,null))[_0xfa29('0x23')](removeEntity(_0x2cda13,null))[_0xfa29('0x42')](handleError(_0x2cda13,null));};exports[_0xfa29('0x4b')]=function(_0x56b4f6,_0x3945f9,_0x2c2ad8){_0x56b4f6['body'][_0xfa29('0x26')]=_0x56b4f6[_0xfa29('0x4d')][_0xfa29('0x4e')];_0x56b4f6[_0xfa29('0x4a')][_0xfa29('0x4f')]=_0x56b4f6['file'][_0xfa29('0x50')];_0x56b4f6[_0xfa29('0x4a')][_0xfa29('0x2b')]=_0x56b4f6['file']['mimetype'];return db[_0xfa29('0x3e')][_0xfa29('0x4b')](_0x56b4f6[_0xfa29('0x4a')])[_0xfa29('0x23')](respondWithResult(_0x3945f9,0xc9))['catch'](handleError(_0x3945f9,null));};exports['download']=function(_0x866c04,_0x3231e6,_0x5e9a5e){return db[_0xfa29('0x3e')][_0xfa29('0x51')]({'where':{'id':_0x866c04[_0xfa29('0x44')]['id']},'raw':!![]})[_0xfa29('0x23')](handleEntityNotFound(_0x3231e6,null))[_0xfa29('0x23')](function(_0x122ae6){if(_0x122ae6){return _0x3231e6[_0xfa29('0x52')](path[_0xfa29('0x53')](config[_0xfa29('0x54')],_0xfa29('0x55'),_0x122ae6['basename']));}})[_0xfa29('0x42')](handleError(_0x3231e6,null));}; \ No newline at end of file +var _0xd363=['download','findOne','join','root','server/files/attachments/','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','save','destroy','then','error','stack','name','send','index','map','Attachment','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','options','includeAll','include','findAll','rows','show','keys','merge','catch','clone','find','get','omit','body','createdAt','updatedAt','create','params','file','originalname','basename','filename','mimetype'];(function(_0x1147ab,_0x10e72b){var _0x55cb5a=function(_0x364bd6){while(--_0x364bd6){_0x1147ab['push'](_0x1147ab['shift']());}};_0x55cb5a(++_0x10e72b);}(_0xd363,0xb5));var _0x3d36=function(_0x37d239,_0x9890dc){_0x37d239=_0x37d239-0x0;var _0x219891=_0xd363[_0x37d239];return _0x219891;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3d36('0x0'));var rimraf=require(_0x3d36('0x1'));var zipdir=require(_0x3d36('0x2'));var jsonpatch=require(_0x3d36('0x3'));var rp=require(_0x3d36('0x4'));var moment=require(_0x3d36('0x5'));var BPromise=require(_0x3d36('0x6'));var Mustache=require('mustache');var util=require(_0x3d36('0x7'));var path=require('path');var sox=require(_0x3d36('0x8'));var csv=require('to-csv');var ejs=require(_0x3d36('0x9'));var fs=require('fs');var _=require(_0x3d36('0xa'));var squel=require(_0x3d36('0xb'));var crypto=require(_0x3d36('0xc'));var jsforce=require(_0x3d36('0xd'));var deskjs=require(_0x3d36('0xe'));var toCsv=require(_0x3d36('0xf'));var querystring=require(_0x3d36('0x10'));var Papa=require(_0x3d36('0x11'));var Redis=require(_0x3d36('0x12'));var authService=require(_0x3d36('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x3d36('0x14'));var hardwareService=require(_0x3d36('0x15'));var logger=require(_0x3d36('0x16'))(_0x3d36('0x17'));var utils=require(_0x3d36('0x18'));var config=require(_0x3d36('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x554219,_0xd5c2dc){_0xd5c2dc=_0xd5c2dc||0xcc;return function(_0x3f7700){if(_0x3f7700){return _0x554219[_0x3d36('0x1a')](_0xd5c2dc);}return _0x554219[_0x3d36('0x1b')](_0xd5c2dc)[_0x3d36('0x1c')]();};}function respondWithResult(_0x3aecf0,_0x55e28d){_0x55e28d=_0x55e28d||0xc8;return function(_0x25da17){if(_0x25da17){return _0x3aecf0[_0x3d36('0x1b')](_0x55e28d)[_0x3d36('0x1d')](_0x25da17);}};}function respondWithFilteredResult(_0x574af2,_0x172f82){return function(_0x2fcfd4){if(_0x2fcfd4){var _0x59ea45=_0x2fcfd4[_0x3d36('0x1e')],_0x44fb16=_0x172f82['offset'],_0x596441=_0x172f82[_0x3d36('0x1f')]+_0x172f82['limit'],_0x147ec6;if(_0x596441>=_0x59ea45){_0x596441=_0x59ea45;_0x147ec6=0xc8;}else{_0x147ec6=0xce;}_0x574af2[_0x3d36('0x1b')](_0x147ec6);return _0x574af2['set'](_0x3d36('0x20'),_0x44fb16+'-'+_0x596441+'/'+_0x59ea45)[_0x3d36('0x1d')](_0x2fcfd4);}return null;};}function patchUpdates(_0x3417d2){return function(_0x35f18d){try{jsonpatch[_0x3d36('0x21')](_0x35f18d,_0x3417d2,!![]);}catch(_0x3f6561){return BPromise['reject'](_0x3f6561);}return _0x35f18d[_0x3d36('0x22')]();};}function saveUpdates(_0x11634e,_0x4e1976){return function(_0x1098ab){if(_0x1098ab){return _0x1098ab['update'](_0x11634e)['then'](function(_0x4cd660){return _0x4cd660;});}return null;};}function removeEntity(_0x32af57,_0x142c7c){return function(_0x1783ad){if(_0x1783ad){return _0x1783ad[_0x3d36('0x23')]()[_0x3d36('0x24')](function(){_0x32af57['status'](0xcc)[_0x3d36('0x1c')]();});}};}function handleEntityNotFound(_0x59cc90,_0x3c0808){return function(_0x3104e1){if(!_0x3104e1){_0x59cc90[_0x3d36('0x1a')](0x194);}return _0x3104e1;};}function handleError(_0x138342,_0x4dc4a0){_0x4dc4a0=_0x4dc4a0||0x1f4;return function(_0xb48d47){logger[_0x3d36('0x25')](_0xb48d47[_0x3d36('0x26')]);if(_0xb48d47[_0x3d36('0x27')]){delete _0xb48d47[_0x3d36('0x27')];}_0x138342['status'](_0x4dc4a0)[_0x3d36('0x28')](_0xb48d47);};}exports[_0x3d36('0x29')]=function(_0x424771,_0x29d593){var _0x58a0ae={},_0x28c727={},_0x1ca64e={'count':0x0,'rows':[]};var _0x17bbab=_[_0x3d36('0x2a')](db[_0x3d36('0x2b')][_0x3d36('0x2c')],function(_0x207960){return{'name':_0x207960['fieldName'],'type':_0x207960[_0x3d36('0x2d')][_0x3d36('0x2e')]};});_0x28c727[_0x3d36('0x2f')]=_[_0x3d36('0x2a')](_0x17bbab,_0x3d36('0x27'));_0x28c727[_0x3d36('0x30')]=_['keys'](_0x424771[_0x3d36('0x30')]);_0x28c727[_0x3d36('0x31')]=_[_0x3d36('0x32')](_0x28c727[_0x3d36('0x2f')],_0x28c727[_0x3d36('0x30')]);_0x58a0ae[_0x3d36('0x33')]=_[_0x3d36('0x32')](_0x28c727[_0x3d36('0x2f')],qs[_0x3d36('0x34')](_0x424771['query'][_0x3d36('0x34')]));_0x58a0ae[_0x3d36('0x33')]=_0x58a0ae[_0x3d36('0x33')][_0x3d36('0x35')]?_0x58a0ae[_0x3d36('0x33')]:_0x28c727[_0x3d36('0x2f')];if(!_0x424771['query'][_0x3d36('0x36')](_0x3d36('0x37'))){_0x58a0ae[_0x3d36('0x38')]=qs[_0x3d36('0x38')](_0x424771[_0x3d36('0x30')][_0x3d36('0x38')]);_0x58a0ae['offset']=qs[_0x3d36('0x1f')](_0x424771[_0x3d36('0x30')][_0x3d36('0x1f')]);}_0x58a0ae['order']=qs[_0x3d36('0x39')](_0x424771[_0x3d36('0x30')][_0x3d36('0x39')]);_0x58a0ae[_0x3d36('0x3a')]=qs[_0x3d36('0x31')](_['pick'](_0x424771['query'],_0x28c727['filters']));if(_0x424771[_0x3d36('0x30')][_0x3d36('0x3b')]){_0x58a0ae['where']=_['merge'](_0x58a0ae[_0x3d36('0x3a')],{'$or':_['map'](_0x17bbab,function(_0x5b2f3d){if(_0x5b2f3d[_0x3d36('0x2d')]!=='VIRTUAL'){var _0x441073={};_0x441073[_0x5b2f3d[_0x3d36('0x27')]]={'$like':'%'+_0x424771['query'][_0x3d36('0x3b')]+'%'};return _0x441073;}})});}_0x58a0ae=_['merge']({},_0x58a0ae,_0x424771[_0x3d36('0x3c')]);var _0x221ab2={'where':_0x58a0ae[_0x3d36('0x3a')]};return db[_0x3d36('0x2b')][_0x3d36('0x1e')](_0x221ab2)[_0x3d36('0x24')](function(_0x219269){_0x1ca64e[_0x3d36('0x1e')]=_0x219269;if(_0x424771[_0x3d36('0x30')][_0x3d36('0x3d')]){_0x58a0ae[_0x3d36('0x3e')]=[{'all':!![]}];}return db[_0x3d36('0x2b')][_0x3d36('0x3f')](_0x58a0ae);})[_0x3d36('0x24')](function(_0x51b1ad){_0x1ca64e[_0x3d36('0x40')]=_0x51b1ad;return _0x1ca64e;})[_0x3d36('0x24')](respondWithFilteredResult(_0x29d593,_0x58a0ae))['catch'](handleError(_0x29d593,null));};exports[_0x3d36('0x41')]=function(_0x59c2b0,_0x168aba){var _0x478cd7={'raw':!![],'where':{'id':_0x59c2b0['params']['id']}},_0x35cab6={};_0x35cab6[_0x3d36('0x2f')]=_[_0x3d36('0x42')](db[_0x3d36('0x2b')][_0x3d36('0x2c')]);_0x35cab6['query']=_[_0x3d36('0x42')](_0x59c2b0[_0x3d36('0x30')]);_0x35cab6[_0x3d36('0x31')]=_['intersection'](_0x35cab6['model'],_0x35cab6['query']);_0x478cd7[_0x3d36('0x33')]=_[_0x3d36('0x32')](_0x35cab6[_0x3d36('0x2f')],qs['fields'](_0x59c2b0[_0x3d36('0x30')][_0x3d36('0x34')]));_0x478cd7[_0x3d36('0x33')]=_0x478cd7[_0x3d36('0x33')][_0x3d36('0x35')]?_0x478cd7[_0x3d36('0x33')]:_0x35cab6[_0x3d36('0x2f')];if(_0x59c2b0[_0x3d36('0x30')]['includeAll']){_0x478cd7[_0x3d36('0x3e')]=[{'all':!![]}];}_0x478cd7=_[_0x3d36('0x43')]({},_0x478cd7,_0x59c2b0[_0x3d36('0x3c')]);return db[_0x3d36('0x2b')]['find'](_0x478cd7)[_0x3d36('0x24')](handleEntityNotFound(_0x168aba,null))[_0x3d36('0x24')](respondWithResult(_0x168aba,null))[_0x3d36('0x44')](handleError(_0x168aba,null));};exports[_0x3d36('0x45')]=function(_0x4c8678,_0x572973){var _0x21f933={'where':{'id':_0x4c8678['params']['id']}},_0x35eb00={};_0x35eb00[_0x3d36('0x2f')]=_[_0x3d36('0x42')](db[_0x3d36('0x2b')]['rawAttributes']);_0x21f933['attributes']=_[_0x3d36('0x32')](_0x35eb00[_0x3d36('0x2f')],qs['fields'](_0x4c8678[_0x3d36('0x30')][_0x3d36('0x34')]));_0x21f933[_0x3d36('0x33')]=_0x21f933[_0x3d36('0x33')]['length']?_0x21f933[_0x3d36('0x33')]:_0x35eb00[_0x3d36('0x2f')];if(_0x4c8678[_0x3d36('0x30')][_0x3d36('0x3d')]){_0x21f933[_0x3d36('0x3e')]=[{'all':!![]}];}_0x21f933=_[_0x3d36('0x43')]({},_0x21f933,_0x4c8678[_0x3d36('0x3c')]);return db[_0x3d36('0x2b')][_0x3d36('0x46')](_0x21f933)['then'](handleEntityNotFound(_0x572973,null))[_0x3d36('0x24')](function(_0x4a67b0){if(_0x4a67b0){var _0x133031=_0x4a67b0[_0x3d36('0x47')]({'plain':!![]});_0x133031=qs[_0x3d36('0x48')](_0x133031,['id','createdAt','updatedAt']);_0x4c8678[_0x3d36('0x49')]=_[_0x3d36('0x48')](_0x4c8678['body'],['id',_0x3d36('0x4a'),_0x3d36('0x4b')]);return db[_0x3d36('0x2b')][_0x3d36('0x4c')](_[_0x3d36('0x43')](_0x133031,_0x4c8678[_0x3d36('0x49')]),{'include':_0x4c8678[_0x3d36('0x30')][_0x3d36('0x3d')]?[{'all':!![]}]:undefined});}})[_0x3d36('0x24')](respondWithResult(_0x572973,0xc9))['catch'](handleError(_0x572973,null));};exports['update']=function(_0x347de5,_0x196c31){if(_0x347de5[_0x3d36('0x49')]['id']){delete _0x347de5[_0x3d36('0x49')]['id'];}return db[_0x3d36('0x2b')][_0x3d36('0x46')]({'where':{'id':_0x347de5[_0x3d36('0x4d')]['id']}})[_0x3d36('0x24')](handleEntityNotFound(_0x196c31,null))[_0x3d36('0x24')](saveUpdates(_0x347de5[_0x3d36('0x49')],null))[_0x3d36('0x24')](respondWithResult(_0x196c31,null))[_0x3d36('0x44')](handleError(_0x196c31,null));};exports[_0x3d36('0x23')]=function(_0x20221d,_0x4e96cc){return db[_0x3d36('0x2b')]['find']({'where':{'id':_0x20221d[_0x3d36('0x4d')]['id']}})['then'](handleEntityNotFound(_0x4e96cc,null))[_0x3d36('0x24')](removeEntity(_0x4e96cc,null))[_0x3d36('0x44')](handleError(_0x4e96cc,null));};exports[_0x3d36('0x4c')]=function(_0x1e673b,_0x5b00b1,_0x5e5d14){_0x1e673b[_0x3d36('0x49')]['name']=_0x1e673b[_0x3d36('0x4e')][_0x3d36('0x4f')];_0x1e673b[_0x3d36('0x49')][_0x3d36('0x50')]=_0x1e673b[_0x3d36('0x4e')][_0x3d36('0x51')];_0x1e673b[_0x3d36('0x49')]['type']=_0x1e673b[_0x3d36('0x4e')][_0x3d36('0x52')];return db[_0x3d36('0x2b')][_0x3d36('0x4c')](_0x1e673b[_0x3d36('0x49')])[_0x3d36('0x24')](respondWithResult(_0x5b00b1,0xc9))[_0x3d36('0x44')](handleError(_0x5b00b1,null));};exports[_0x3d36('0x53')]=function(_0x250143,_0x1e9ce1,_0x169952){return db[_0x3d36('0x2b')][_0x3d36('0x54')]({'where':{'id':_0x250143[_0x3d36('0x4d')]['id']},'raw':!![]})[_0x3d36('0x24')](handleEntityNotFound(_0x1e9ce1,null))[_0x3d36('0x24')](function(_0x1a083e){if(_0x1a083e){return _0x1e9ce1[_0x3d36('0x53')](path[_0x3d36('0x55')](config[_0x3d36('0x56')],_0x3d36('0x57'),_0x1a083e[_0x3d36('0x50')]));}})[_0x3d36('0x44')](handleError(_0x1e9ce1,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 312e3c1..dabae5d 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 _0x05e3=['Attachment','attachments','lodash','util','../../config/logger','bluebird','request-promise','rimraf','../../config/environment','exports','define'];(function(_0x21ff2c,_0x3c08ac){var _0x15abe3=function(_0x2f2739){while(--_0x2f2739){_0x21ff2c['push'](_0x21ff2c['shift']());}};_0x15abe3(++_0x3c08ac);}(_0x05e3,0x86));var _0x305e=function(_0x446737,_0x411246){_0x446737=_0x446737-0x0;var _0x575b95=_0x05e3[_0x446737];return _0x575b95;};'use strict';var _=require(_0x305e('0x0'));var util=require(_0x305e('0x1'));var logger=require(_0x305e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x305e('0x3'));var rp=require(_0x305e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x305e('0x5'));var config=require(_0x305e('0x6'));var attributes=require('./attachment.attributes');module[_0x305e('0x7')]=function(_0x404744,_0xfadd27){return _0x404744[_0x305e('0x8')](_0x305e('0x9'),attributes,{'tableName':_0x305e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['define','attachments','util','../../config/logger','request-promise','path','rimraf','../../config/environment','./attachment.attributes','exports'];(function(_0x4e93a9,_0x413f30){var _0x43013c=function(_0x3a0cf3){while(--_0x3a0cf3){_0x4e93a9['push'](_0x4e93a9['shift']());}};_0x43013c(++_0x413f30);}(_0x757a,0xde));var _0xa757=function(_0x526bfe,_0x2b4b3e){_0x526bfe=_0x526bfe-0x0;var _0x2bf2e3=_0x757a[_0x526bfe];return _0x2bf2e3;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('Attachment',attributes,{'tableName':_0xa757('0x9'),'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 f715095..5f1b3dd 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 _0x723b=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','code','message','error','result','CreateAttachment','Attachment','create','options','raw','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info'];(function(_0x36f62d,_0x5619b3){var _0x3062a9=function(_0x47359f){while(--_0x47359f){_0x36f62d['push'](_0x36f62d['shift']());}};_0x3062a9(++_0x5619b3);}(_0x723b,0x153));var _0xb723=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x723b[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xb723('0x0'));var util=require(_0xb723('0x1'));var moment=require(_0xb723('0x2'));var BPromise=require('bluebird');var rs=require(_0xb723('0x3'));var fs=require('fs');var Redis=require(_0xb723('0x4'));var db=require(_0xb723('0x5'))['db'];var utils=require(_0xb723('0x6'));var logger=require(_0xb723('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb723('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x97bcc0,_0x1efe39,_0x14f1c5){return new BPromise(function(_0x1c0807,_0x1203cf){return client[_0xb723('0x9')](_0x97bcc0,_0x14f1c5)['then'](function(_0x3cef76){logger[_0xb723('0xa')](_0xb723('0xb'),_0x1efe39,_0xb723('0xc'));logger[_0xb723('0xd')](_0xb723('0xe'),_0x1efe39,_0xb723('0xc'),JSON['stringify'](_0x3cef76));if(_0x3cef76['error']){if(_0x3cef76['error'][_0xb723('0xf')]===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x1efe39,_0x3cef76['error'][_0xb723('0x10')]);return _0x1203cf(_0x3cef76[_0xb723('0x11')][_0xb723('0x10')]);}logger[_0xb723('0x11')](_0xb723('0xb'),_0x1efe39,_0x3cef76[_0xb723('0x11')][_0xb723('0x10')]);return _0x1c0807(_0x3cef76[_0xb723('0x11')][_0xb723('0x10')]);}else{logger[_0xb723('0xa')](_0xb723('0xb'),_0x1efe39,_0xb723('0xc'));_0x1c0807(_0x3cef76[_0xb723('0x12')]['message']);}})['catch'](function(_0x43f131){logger[_0xb723('0x11')](_0xb723('0xb'),_0x1efe39,_0x43f131);_0x1203cf(_0x43f131);});});}exports[_0xb723('0x13')]=function(_0x2d4a47){var _0x323109=this;return new Promise(function(_0x279993,_0x24a9c1){return db[_0xb723('0x14')][_0xb723('0x15')](_0x2d4a47['body'],{'raw':_0x2d4a47[_0xb723('0x16')]?_0x2d4a47[_0xb723('0x16')][_0xb723('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x4e3ec7){logger[_0xb723('0xa')](_0xb723('0x13'),_0x2d4a47);logger[_0xb723('0xd')]('CreateAttachment',_0x2d4a47,JSON['stringify'](_0x4e3ec7));_0x279993(_0x4e3ec7);})[_0xb723('0x18')](function(_0xbe0807){logger['error']('CreateAttachment',_0xbe0807['message'],_0x2d4a47);_0x24a9c1(_0x323109['error'](0x1f4,_0xbe0807[_0xb723('0x10')]));});});}; \ No newline at end of file +var _0x994d=['util','moment','bluebird','ioredis','../../config/logger','rpc','client','http','request','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','error','message','catch','CreateAttachment','Attachment','body','options','raw','stringify','lodash'];(function(_0x329dd3,_0x23d9ca){var _0x18da0e=function(_0x280038){while(--_0x280038){_0x329dd3['push'](_0x329dd3['shift']());}};_0x18da0e(++_0x23d9ca);}(_0x994d,0xae));var _0xd994=function(_0x85292f,_0x31414c){_0x85292f=_0x85292f-0x0;var _0x59e802=_0x994d[_0x85292f];return _0x59e802;};'use strict';var _=require(_0xd994('0x0'));var util=require(_0xd994('0x1'));var moment=require(_0xd994('0x2'));var BPromise=require(_0xd994('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd994('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xd994('0x5'))(_0xd994('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xd994('0x7')][_0xd994('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5260ba,_0x4a9f31,_0x5b015d){return new BPromise(function(_0x1ceab0,_0x438ef5){return client[_0xd994('0x9')](_0x5260ba,_0x5b015d)[_0xd994('0xa')](function(_0x41ff35){logger[_0xd994('0xb')](_0xd994('0xc'),_0x4a9f31,_0xd994('0xd'));logger[_0xd994('0xe')](_0xd994('0xf'),_0x4a9f31,_0xd994('0xd'),JSON['stringify'](_0x41ff35));if(_0x41ff35[_0xd994('0x10')]){if(_0x41ff35[_0xd994('0x10')]['code']===0x1f4){logger['error']('Attachment,\x20%s,\x20%s',_0x4a9f31,_0x41ff35['error'][_0xd994('0x11')]);return _0x438ef5(_0x41ff35['error'][_0xd994('0x11')]);}logger[_0xd994('0x10')]('Attachment,\x20%s,\x20%s',_0x4a9f31,_0x41ff35[_0xd994('0x10')][_0xd994('0x11')]);return _0x1ceab0(_0x41ff35[_0xd994('0x10')][_0xd994('0x11')]);}else{logger[_0xd994('0xb')](_0xd994('0xc'),_0x4a9f31,_0xd994('0xd'));_0x1ceab0(_0x41ff35['result'][_0xd994('0x11')]);}})[_0xd994('0x12')](function(_0x489d5d){logger[_0xd994('0x10')](_0xd994('0xc'),_0x4a9f31,_0x489d5d);_0x438ef5(_0x489d5d);});});}exports[_0xd994('0x13')]=function(_0x239aa1){var _0x2d6541=this;return new Promise(function(_0x42bd91,_0x459917){return db[_0xd994('0x14')]['create'](_0x239aa1[_0xd994('0x15')],{'raw':_0x239aa1[_0xd994('0x16')]?_0x239aa1['options'][_0xd994('0x17')]===undefined?!![]:![]:!![]})[_0xd994('0xa')](function(_0x796d85){logger['info'](_0xd994('0x13'),_0x239aa1);logger[_0xd994('0xe')]('CreateAttachment',_0x239aa1,JSON[_0xd994('0x18')](_0x796d85));_0x42bd91(_0x796d85);})[_0xd994('0x12')](function(_0x5501b7){logger[_0xd994('0x10')]('CreateAttachment',_0x5501b7[_0xd994('0x11')],_0x239aa1);_0x459917(_0x2d6541[_0xd994('0x10')](0x1f4,_0x5501b7['message']));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index d311d14..6f06b3d 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 _0x66ee=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./attachment.controller','isAuthenticated','index','get','/:id','download','/:id/clone','clone','diskStorage','join','root','format','%s-%s','now','originalname','replace','post','single','file'];(function(_0x2948d6,_0x129751){var _0x13cac1=function(_0x5c1225){while(--_0x5c1225){_0x2948d6['push'](_0x2948d6['shift']());}};_0x13cac1(++_0x129751);}(_0x66ee,0x85));var _0xe66e=function(_0x5b42d9,_0xbe8540){_0x5b42d9=_0x5b42d9-0x0;var _0x43a00d=_0x66ee[_0x5b42d9];return _0x43a00d;};'use strict';var multer=require(_0xe66e('0x0'));var util=require(_0xe66e('0x1'));var path=require(_0xe66e('0x2'));var timeout=require(_0xe66e('0x3'));var express=require(_0xe66e('0x4'));var router=express['Router']();var auth=require(_0xe66e('0x5'));var interaction=require(_0xe66e('0x6'));var config=require(_0xe66e('0x7'));var controller=require(_0xe66e('0x8'));router['get']('/',auth[_0xe66e('0x9')](),controller[_0xe66e('0xa')]);router[_0xe66e('0xb')](_0xe66e('0xc'),auth[_0xe66e('0x9')](),controller['show']);router[_0xe66e('0xb')]('/:id/download',auth['isAuthenticated'](),controller[_0xe66e('0xd')]);router['post'](_0xe66e('0xe'),auth['isAuthenticated'](),controller[_0xe66e('0xf')]);var upload=multer({'storage':multer[_0xe66e('0x10')]({'destination':function(_0x35346f,_0x16dda2,_0x46b8fa){_0x46b8fa(null,path[_0xe66e('0x11')](config[_0xe66e('0x12')],'server/files/attachments/'));},'filename':function(_0x277250,_0x279384,_0x4e68e8){_0x4e68e8(null,util[_0xe66e('0x13')](_0xe66e('0x14'),Date[_0xe66e('0x15')](),_0x279384[_0xe66e('0x16')][_0xe66e('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0xe66e('0x18')]('/',upload[_0xe66e('0x19')](_0xe66e('0x1a')),controller['create']);router[_0xe66e('0x1b')]('/:id',auth[_0xe66e('0x9')](),controller[_0xe66e('0x1c')]);router[_0xe66e('0x1d')](_0xe66e('0xc'),auth[_0xe66e('0x9')](),controller[_0xe66e('0x1e')]);module[_0xe66e('0x1f')]=router; \ No newline at end of file +var _0x8165=['/:id/clone','diskStorage','join','root','server/files/attachments/','format','%s-%s','now','originalname','replace','single','file','put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/:id','isAuthenticated','show','/:id/download','post'];(function(_0x48ab63,_0x19199e){var _0x5f518d=function(_0x44274a){while(--_0x44274a){_0x48ab63['push'](_0x48ab63['shift']());}};_0x5f518d(++_0x19199e);}(_0x8165,0x1c3));var _0x5816=function(_0x76087e,_0x9cd048){_0x76087e=_0x76087e-0x0;var _0x373c65=_0x8165[_0x76087e];return _0x373c65;};'use strict';var multer=require(_0x5816('0x0'));var util=require(_0x5816('0x1'));var path=require('path');var timeout=require(_0x5816('0x2'));var express=require(_0x5816('0x3'));var router=express['Router']();var auth=require(_0x5816('0x4'));var interaction=require(_0x5816('0x5'));var config=require(_0x5816('0x6'));var controller=require('./attachment.controller');router[_0x5816('0x7')]('/',auth['isAuthenticated'](),controller[_0x5816('0x8')]);router[_0x5816('0x7')](_0x5816('0x9'),auth[_0x5816('0xa')](),controller[_0x5816('0xb')]);router[_0x5816('0x7')](_0x5816('0xc'),auth['isAuthenticated'](),controller['download']);router[_0x5816('0xd')](_0x5816('0xe'),auth[_0x5816('0xa')](),controller['clone']);var upload=multer({'storage':multer[_0x5816('0xf')]({'destination':function(_0x23d25e,_0x1c1ea2,_0x512528){_0x512528(null,path[_0x5816('0x10')](config[_0x5816('0x11')],_0x5816('0x12')));},'filename':function(_0x4c71a6,_0x17b2a3,_0x18d267){_0x18d267(null,util[_0x5816('0x13')](_0x5816('0x14'),Date[_0x5816('0x15')](),_0x17b2a3[_0x5816('0x16')][_0x5816('0x17')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5816('0xd')]('/',upload[_0x5816('0x18')](_0x5816('0x19')),controller['create']);router[_0x5816('0x1a')]('/:id',auth[_0x5816('0xa')](),controller[_0x5816('0x1b')]);router[_0x5816('0x1c')]('/:id',auth[_0x5816('0xa')](),controller[_0x5816('0x1d')]);module[_0x5816('0x1e')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index 2f20d18..99830f1 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 _0x5f9f=['add','minutes','clearBlockUser','getLicense','catch','lodash','Strategy','moment','../../mysqldb','../../config/environment','signToken','../../config/utils','login','authenticate','google','/login','profile','email','callback','use','clientID','clientSecret','secret','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','map','emails','value','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt'];(function(_0x390193,_0x2f8ec3){var _0x1b6ff2=function(_0x501e4b){while(--_0x501e4b){_0x390193['push'](_0x390193['shift']());}};_0x1b6ff2(++_0x2f8ec3);}(_0x5f9f,0xb9));var _0xf5f9=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x5f9f[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0xf5f9('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')[_0xf5f9('0x1')];var moment=require(_0xf5f9('0x2'));var db=require(_0xf5f9('0x3'))['db'];var config=require(_0xf5f9('0x4'));var signToken=require('../../components/auth/service')[_0xf5f9('0x5')];var utils=require(_0xf5f9('0x6'));exports[_0xf5f9('0x7')]=passport[_0xf5f9('0x8')](_0xf5f9('0x9'),{'failureRedirect':_0xf5f9('0xa'),'scope':[_0xf5f9('0xb'),_0xf5f9('0xc')],'session':![]});exports[_0xf5f9('0xd')]=passport[_0xf5f9('0x8')]('google',{'failureRedirect':_0xf5f9('0xa'),'session':![]});passport[_0xf5f9('0xe')](new GoogleStrategy({'clientID':config['google']?config[_0xf5f9('0x9')][_0xf5f9('0xf')]:'id','clientSecret':config[_0xf5f9('0x9')]?config[_0xf5f9('0x9')][_0xf5f9('0x10')]:_0xf5f9('0x11'),'callbackURL':config['google']?config[_0xf5f9('0x9')]['callbackURL']:''},function(_0x57d5d6,_0xcd2d0d,_0x49c33f,_0x618adf){var _0x169647,_0x1ed584;return db[_0xf5f9('0x12')][_0xf5f9('0x13')]({'where':{'id':0x1},'attributes':[_0xf5f9('0x14'),_0xf5f9('0x15')],'raw':!![]})[_0xf5f9('0x16')](function(_0x11d8e8){_0x169647=_0x11d8e8;return db[_0xf5f9('0x17')]['find']({'where':{'email':_[_0xf5f9('0x18')](_0x49c33f[_0xf5f9('0x19')],_0xf5f9('0x1a')),'role':{'$or':['admin','user','agent']}}});})[_0xf5f9('0x16')](function(_0x93d12a){_0x1ed584=_0x93d12a;if(_0x1ed584){if(_0x1ed584[_0xf5f9('0x1b')]){return _0x618adf(_0xf5f9('0x1c'));}else if(_0x169647['blockDuration']>0x0){if(_0x1ed584[_0xf5f9('0x1d')]){if(moment(_0x1ed584[_0xf5f9('0x1e')])[_0xf5f9('0x1f')](_0x169647[_0xf5f9('0x15')],_0xf5f9('0x20'))>moment()){return _0x618adf(_0xf5f9('0x1c'));}else{return utils[_0xf5f9('0x21')](_0x1ed584,0x0,![],null)[_0xf5f9('0x16')](function(){return utils[_0xf5f9('0x22')](_0x1ed584);})['then'](function(){return _0x618adf(null,_0x1ed584);});}}else{return utils[_0xf5f9('0x22')](_0x1ed584)[_0xf5f9('0x16')](function(){return _0x618adf(null,_0x1ed584);});}}else{return utils[_0xf5f9('0x22')](_0x1ed584)[_0xf5f9('0x16')](function(){return _0x618adf(null,_0x1ed584);});}}return _0x618adf(_0xf5f9('0x1c'));})[_0xf5f9('0x23')](function(_0x5bf71f){_0x618adf(_0x5bf71f);});})); \ No newline at end of file +var _0xe6fa=['user','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blockDuration','blocked','blockedAt','add','then','getLicense','catch','lodash','moment','signToken','../../config/utils','authenticate','google','/login','email','callback','use','Setting','allowedLoginAttempts','User','find','map','emails','value','admin'];(function(_0x289dd6,_0x51535f){var _0x5ba1a6=function(_0x3dfdc0){while(--_0x3dfdc0){_0x289dd6['push'](_0x289dd6['shift']());}};_0x5ba1a6(++_0x51535f);}(_0xe6fa,0x192));var _0xae6f=function(_0x209d9b,_0x224737){_0x209d9b=_0x209d9b-0x0;var _0x11b39b=_0xe6fa[_0x209d9b];return _0x11b39b;};'use strict';var _=require(_0xae6f('0x0'));var passport=require('passport');var GoogleStrategy=require('passport-google-oauth20')['Strategy'];var moment=require(_0xae6f('0x1'));var db=require('../../mysqldb')['db'];var config=require('../../config/environment');var signToken=require('../../components/auth/service')[_0xae6f('0x2')];var utils=require(_0xae6f('0x3'));exports['login']=passport[_0xae6f('0x4')](_0xae6f('0x5'),{'failureRedirect':_0xae6f('0x6'),'scope':['profile',_0xae6f('0x7')],'session':![]});exports[_0xae6f('0x8')]=passport['authenticate'](_0xae6f('0x5'),{'failureRedirect':_0xae6f('0x6'),'session':![]});passport[_0xae6f('0x9')](new GoogleStrategy({'clientID':config[_0xae6f('0x5')]?config[_0xae6f('0x5')]['clientID']:'id','clientSecret':config[_0xae6f('0x5')]?config['google']['clientSecret']:'secret','callbackURL':config[_0xae6f('0x5')]?config[_0xae6f('0x5')]['callbackURL']:''},function(_0x22edd9,_0x459336,_0xf419ea,_0x15983f){var _0xd63a2,_0x14c370;return db[_0xae6f('0xa')]['findOne']({'where':{'id':0x1},'attributes':[_0xae6f('0xb'),'blockDuration'],'raw':!![]})['then'](function(_0x102054){_0xd63a2=_0x102054;return db[_0xae6f('0xc')][_0xae6f('0xd')]({'where':{'email':_[_0xae6f('0xe')](_0xf419ea[_0xae6f('0xf')],_0xae6f('0x10')),'role':{'$or':[_0xae6f('0x11'),_0xae6f('0x12'),'agent']}}});})['then'](function(_0x493b34){_0x14c370=_0x493b34;if(_0x14c370){if(_0x14c370[_0xae6f('0x13')]){return _0x15983f(_0xae6f('0x14'));}else if(_0xd63a2[_0xae6f('0x15')]>0x0){if(_0x14c370[_0xae6f('0x16')]){if(moment(_0x14c370[_0xae6f('0x17')])[_0xae6f('0x18')](_0xd63a2[_0xae6f('0x15')],'minutes')>moment()){return _0x15983f('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils['clearBlockUser'](_0x14c370,0x0,![],null)[_0xae6f('0x19')](function(){return utils[_0xae6f('0x1a')](_0x14c370);})[_0xae6f('0x19')](function(){return _0x15983f(null,_0x14c370);});}}else{return utils['getLicense'](_0x14c370)['then'](function(){return _0x15983f(null,_0x14c370);});}}else{return utils['getLicense'](_0x14c370)['then'](function(){return _0x15983f(null,_0x14c370);});}}return _0x15983f(_0xae6f('0x14'));})[_0xae6f('0x1b')](function(_0x406625){_0x15983f(_0x406625);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index ac6e8c1..48f3f0c 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 _0x33a1=['get','login','callback','isMiddleware','exports','express','passport'];(function(_0x305e52,_0x1838a2){var _0x26f224=function(_0x1b2a7a){while(--_0x1b2a7a){_0x305e52['push'](_0x305e52['shift']());}};_0x26f224(++_0x1838a2);}(_0x33a1,0x7c));var _0x133a=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x33a1[_0x21a9d9];return _0x46adce;};'use strict';var express=require(_0x133a('0x0'));var passport=require(_0x133a('0x1'));var router=express['Router']();var controller=require('./authGoogle.controller');var userController=require('../user/user.controller.js');var authService=require('../../components/auth/service');router[_0x133a('0x2')]('/',controller[_0x133a('0x3')]);router[_0x133a('0x2')]('/callback',controller[_0x133a('0x4')],authService[_0x133a('0x5')],userController[_0x133a('0x3')],authService['setTokenCookie']);module[_0x133a('0x6')]=router; \ No newline at end of file +var _0x3667=['../user/user.controller.js','get','login','/callback','callback','isMiddleware','setTokenCookie','express','passport','Router','./authGoogle.controller'];(function(_0x4a29a9,_0x58cd04){var _0x386570=function(_0x1d2d09){while(--_0x1d2d09){_0x4a29a9['push'](_0x4a29a9['shift']());}};_0x386570(++_0x58cd04);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var express=require(_0x7366('0x0'));var passport=require(_0x7366('0x1'));var router=express[_0x7366('0x2')]();var controller=require(_0x7366('0x3'));var userController=require(_0x7366('0x4'));var authService=require('../../components/auth/service');router[_0x7366('0x5')]('/',controller[_0x7366('0x6')]);router['get'](_0x7366('0x7'),controller[_0x7366('0x8')],authService[_0x7366('0x9')],userController[_0x7366('0x6')],authService[_0x7366('0xa')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index aac2f10..800fa34 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 _0x3851=['clearBlockUser','getLicense','catch','find','email','MailServerOut','Smtp','service','host','port','secure','auth','pass','merge','\x22%s\x22\x20<%s>','SendMail','format','error','message','stringify','status','send','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','json','online','body','Email\x20parameter\x20is\x20missing','generate','trim','User','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','http://','headers','/reset/','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','password','securePassword','resetPasswordToken','Password\x20reset!','util','passport-local','Strategy','jayson/promise','moment','../../config/utils','client','Setting','findOne','allowedLoginAttempts','blockDuration','name','role','disabled','blocked','blockedAt','loginAttempts','admin','user','agent','then','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','add','minutes'];(function(_0x53cf8e,_0x3d290f){var _0x459197=function(_0x67073c){while(--_0x67073c){_0x53cf8e['push'](_0x53cf8e['shift']());}};_0x459197(++_0x3d290f);}(_0x3851,0x1b5));var _0x1385=function(_0x467dee,_0x6b22b0){_0x467dee=_0x467dee-0x0;var _0x4406c7=_0x3851[_0x467dee];return _0x4406c7;};'use strict';var util=require(_0x1385('0x0'));var passport=require('passport');var LocalStrategy=require(_0x1385('0x1'))[_0x1385('0x2')];var jayson=require(_0x1385('0x3'));var _=require('lodash');var rs=require('randomstring');var moment=require(_0x1385('0x4'));var db=require('../../mysqldb')['db'];var authService=require('../../components/auth/service');var utils=require(_0x1385('0x5'));var client=jayson[_0x1385('0x6')]['http']({'port':0x232b});function localAuthenticate(_0x523fb9,_0x939a97,_0x5d0c14,_0x23c933){var _0x21fa31,_0x2823d7;return db[_0x1385('0x7')][_0x1385('0x8')]({'where':{'id':0x1},'attributes':[_0x1385('0x9'),_0x1385('0xa')],'raw':!![]})['then'](function(_0xb38680){_0x21fa31=_0xb38680;return _0x523fb9[_0x1385('0x8')]({'attributes':['id',_0x1385('0xb'),'password','salt',_0x1385('0xc'),_0x1385('0xd'),_0x1385('0xe'),_0x1385('0xf'),_0x1385('0x10')],'where':{'name':_0x939a97,'role':{'$or':[_0x1385('0x11'),_0x1385('0x12'),_0x1385('0x13')]}}});})[_0x1385('0x14')](function(_0x255fa1){if(!_0x255fa1||_0x255fa1&&_0x255fa1[_0x1385('0xb')]!==_0x939a97){throw new Error(_0x1385('0x15'));}else{_0x2823d7=_0x255fa1;return _0x2823d7;}})[_0x1385('0x14')](function(){_0x2823d7[_0x1385('0x16')](_0x5d0c14,function(_0x57e98d,_0x2310a2){var _0x5998fe=_0x2823d7[_0x1385('0x10')]+0x1;if(_0x57e98d){return _0x23c933(_0x57e98d);}else if(!_0x2310a2){if(_0x2823d7[_0x1385('0xd')]){return _0x23c933(null,![],{'message':_0x1385('0x15')});}else if(_0x21fa31[_0x1385('0x9')]>0x0){if(_0x2823d7[_0x1385('0xe')]){if(_0x21fa31[_0x1385('0xa')]>0x0){if(moment(_0x2823d7['blockedAt'])[_0x1385('0x17')](_0x21fa31[_0x1385('0xa')],_0x1385('0x18'))>moment()){return _0x23c933(null,![],{'message':_0x1385('0x15')});}else{return utils[_0x1385('0x19')](_0x2823d7,_0x5998fe,![],null)['then'](function(){return _0x23c933(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x23c933(null,![],{'message':_0x1385('0x15')});}}else{if(_0x5998fe>=_0x21fa31['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2823d7,0x0,!![],moment())[_0x1385('0x14')](function(){return _0x23c933(null,![],{'message':_0x1385('0x15')});});}else{return utils[_0x1385('0x19')](_0x2823d7,_0x5998fe,![],null)[_0x1385('0x14')](function(){return _0x23c933(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}}else{return _0x23c933(null,![],{'message':_0x1385('0x15')});}}else{if(_0x2823d7[_0x1385('0xd')]){return _0x23c933(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x21fa31[_0x1385('0x9')]>0x0){if(_0x2823d7[_0x1385('0xe')]){if(_0x21fa31[_0x1385('0xa')]>0x0){if(moment(_0x2823d7[_0x1385('0xf')])[_0x1385('0x17')](_0x21fa31[_0x1385('0xa')],_0x1385('0x18'))>moment()){return _0x23c933(null,![],{'message':_0x1385('0x15')});}else{return utils[_0x1385('0x19')](_0x2823d7,0x0,![],null)[_0x1385('0x14')](function(){return utils[_0x1385('0x1a')](_0x2823d7);})['then'](function(){return _0x23c933(null,_0x2823d7);});}}else{return _0x23c933(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{return utils['clearBlockUser'](_0x2823d7,0x0,![],null)[_0x1385('0x14')](function(){return utils[_0x1385('0x1a')](_0x2823d7);})[_0x1385('0x14')](function(){return _0x23c933(null,_0x2823d7);})[_0x1385('0x1b')](function(_0x5675e8){return _0x23c933(null,![],_0x5675e8);});}}else{if(_0x2823d7[_0x1385('0xe')]){return _0x23c933(null,![],{'message':_0x1385('0x15')});}else{return utils[_0x1385('0x1a')](_0x2823d7)[_0x1385('0x14')](function(){return _0x23c933(null,_0x2823d7);});}}}});})['catch'](function(_0x4ef178){return _0x23c933(null,![],_0x4ef178);});}function sendServiceMail(_0xaa5bc1){return db['MailAccount'][_0x1385('0x1c')]({'where':{'service':!![]},'attributes':['id',_0x1385('0xb'),_0x1385('0x1d')],'include':[{'model':db[_0x1385('0x1e')],'as':_0x1385('0x1f')}]})[_0x1385('0x14')](function(_0x270e42){if(!_0x270e42){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x356c3d={'tls':{'rejectUnauthorized':![]}};if(_0x270e42[_0x1385('0x1f')][_0x1385('0x20')]){_0x356c3d[_0x1385('0x20')]=_0x270e42['Smtp'][_0x1385('0x20')];}else{_0x356c3d[_0x1385('0x21')]=_0x270e42[_0x1385('0x1f')][_0x1385('0x21')];_0x356c3d[_0x1385('0x22')]=_0x270e42[_0x1385('0x1f')][_0x1385('0x22')];_0x356c3d[_0x1385('0x23')]=_0x270e42[_0x1385('0x1f')][_0x1385('0x23')];}if(_0x270e42['Smtp']['authentication']){_0x356c3d[_0x1385('0x24')]={'user':_0x270e42[_0x1385('0x1f')]['user'],'pass':_0x270e42[_0x1385('0x1f')][_0x1385('0x25')]};}var _0x219281={'account':_0x356c3d,'message':_[_0x1385('0x26')]({'from':util['format'](_0x1385('0x27'),_0x270e42[_0x1385('0xb')],_0x270e42[_0x1385('0x1d')]||_0x270e42[_0x1385('0x1f')][_0x1385('0x12')])},_0xaa5bc1)};return client['request'](_0x1385('0x28'),_0x219281);})[_0x1385('0x14')](function(_0x23dc3d){if(_0x23dc3d['error']){throw new Error(util[_0x1385('0x29')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x23dc3d[_0x1385('0x2a')][_0x1385('0x2b')]||JSON[_0x1385('0x2c')](_0x23dc3d[_0x1385('0x2a')])));}return!![];});}function handleError(_0x5cde63,_0x4f0644,_0x14b6d1){return _0x5cde63[_0x1385('0x2d')](_0x4f0644||0x1f4)[_0x1385('0x2e')]({'message':_0x14b6d1?_0x14b6d1['message']||_0x14b6d1:''});}function checkPasswordPattern(_0x2e52ba,_0x26ba45,_0x532b50){if(_0x532b50){var _0x5855f6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5855f6['test'](_0x26ba45)){return _0x2e52ba;}else{throw new Error(_0x1385('0x2f'));}}else{return _0x2e52ba;}}exports['login']=function(_0x55b147,_0x149fde,_0x441d57){passport[_0x1385('0x16')](_0x1385('0x30'),function(_0x4606c5,_0x2e035f,_0x4d76f9){var _0x37fcf7=_0x4606c5||_0x4d76f9;if(_0x37fcf7){return handleError(_0x149fde,0x191,_0x37fcf7);}if(!_0x2e035f){return handleError(_0x149fde,0x194,{'message':_0x1385('0x31')});}else{var _0x546076={'payload':{'id':_0x2e035f['id'],'role':_0x2e035f[_0x1385('0xc')]},'options':{'expiresIn':0x15180}};return authService['signToken'](_0x546076)[_0x1385('0x14')](function(_0x281347){_0x149fde[_0x1385('0x32')]({'id':_0x2e035f['id'],'token':_0x281347,'statusCall':'','isAlreadyLogged':_0x2e035f[_0x1385('0x33')]});});}})(_0x55b147,_0x149fde,_0x441d57);};exports['forgot']=function(_0x4efbc9,_0x195fe5,_0x21d544){if(!_0x4efbc9[_0x1385('0x34')][_0x1385('0x1d')]){return handleError(_0x195fe5,0x1f4,{'message':_0x1385('0x35')});}var _0x23612a=rs[_0x1385('0x36')]();_0x4efbc9[_0x1385('0x34')][_0x1385('0x1d')]=_0x4efbc9['body'][_0x1385('0x1d')][_0x1385('0x37')]()['toLowerCase']();var _0x3f6d4d;return db[_0x1385('0x7')][_0x1385('0x8')]({'where':{'id':0x1},'attributes':[_0x1385('0x9'),_0x1385('0xa')],'raw':!![]})[_0x1385('0x14')](function(_0xfed639){_0x3f6d4d=_0xfed639;return db[_0x1385('0x38')][_0x1385('0x1c')]({'where':{'email':_0x4efbc9['body'][_0x1385('0x1d')]}});})[_0x1385('0x14')](function(_0x130e73){if(!_0x130e73){throw new Error('This\x20email\x20is\x20not\x20registered.');}if(_0x130e73['disabled']){throw new Error(_0x1385('0x39'));}if(_0x130e73[_0x1385('0xe')]){if(moment(_0x130e73[_0x1385('0xf')])[_0x1385('0x17')](_0x3f6d4d['blockDuration'],'minutes')>moment()){throw new Error(_0x1385('0x3a'));}else{_0x130e73['blocked']=![];_0x130e73['blockedAt']=null;}}_0x130e73['resetPasswordToken']=_0x23612a;_0x130e73[_0x1385('0x3b')]=Date['now']()+0x36ee80;return _0x130e73[_0x1385('0x3c')]();})[_0x1385('0x14')](function(){return sendServiceMail({'to':_0x4efbc9['body'][_0x1385('0x1d')],'subject':_0x1385('0x3d'),'text':_0x1385('0x3e')+_0x1385('0x3f')+_0x1385('0x40')+_0x4efbc9[_0x1385('0x41')][_0x1385('0x21')]+_0x1385('0x42')+_0x23612a+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0x1385('0x14')](function(){_0x195fe5['status'](0xc8)[_0x1385('0x2e')]({'message':_0x1385('0x43')});})['catch'](function(_0x50516a){return handleError(_0x195fe5,0x1f4,_0x50516a);});};exports[_0x1385('0x44')]=function(_0xe81a28,_0x4280d9,_0x31236a){var _0x5f18d5;return db[_0x1385('0x38')]['find']({'where':{'resetPasswordToken':_0xe81a28[_0x1385('0x45')][_0x1385('0x46')],'resetPasswordExpires':{'$gt':Date[_0x1385('0x47')]()}}})[_0x1385('0x14')](function(_0x36c044){_0x5f18d5=_0x36c044;if(!_0x5f18d5){throw new Error(_0x1385('0x48'));}return db[_0x1385('0x7')][_0x1385('0x8')]({'attributes':['id','securePassword']});})[_0x1385('0x14')](function(_0x2919e3){return checkPasswordPattern(_0x2919e3,_0xe81a28[_0x1385('0x34')][_0x1385('0x49')],_0x2919e3[_0x1385('0x4a')]);})[_0x1385('0x14')](function(){_0x5f18d5[_0x1385('0x49')]=_0xe81a28[_0x1385('0x34')][_0x1385('0x49')];_0x5f18d5[_0x1385('0x4b')]=null;_0x5f18d5[_0x1385('0x3b')]=null;return _0x5f18d5[_0x1385('0x3c')]();})[_0x1385('0x14')](function(){_0x4280d9[_0x1385('0x2d')](0xc8)[_0x1385('0x2e')]({'message':_0x1385('0x4c')});})[_0x1385('0x1b')](function(_0x3b9651){return handleError(_0x4280d9,0x1f4,_0x3b9651);});};passport['use'](new LocalStrategy({'usernameField':_0x1385('0xb'),'passwordField':_0x1385('0x49')},function(_0x3bb0e4,_0x4013bd,_0x559d42){return localAuthenticate(db['User'],_0x3bb0e4,_0x4013bd,_0x559d42);})); \ No newline at end of file +var _0x3393=['body','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','minutes','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','resetPasswordToken','resetPasswordExpires','now','save','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','status','Reset\x20Email\x20sent!','reset','params','findOne','securePassword','Password\x20reset!','util','passport-local','Strategy','jayson/promise','randomstring','moment','../../mysqldb','../../components/auth/service','../../config/utils','Setting','allowedLoginAttempts','blockDuration','then','name','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','user','authenticate','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','clearBlockUser','getLicense','catch','MailAccount','find','MailServerOut','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','Smtp','service','host','port','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','request','SendMail','error','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','message','stringify','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','signToken','json','online','forgot','Email\x20parameter\x20is\x20missing','generate'];(function(_0x25cc0f,_0x76e4df){var _0x4e716d=function(_0x505cb2){while(--_0x505cb2){_0x25cc0f['push'](_0x25cc0f['shift']());}};_0x4e716d(++_0x76e4df);}(_0x3393,0xbb));var _0x3339=function(_0x505f33,_0x522793){_0x505f33=_0x505f33-0x0;var _0x5cd2a1=_0x3393[_0x505f33];return _0x5cd2a1;};'use strict';var util=require(_0x3339('0x0'));var passport=require('passport');var LocalStrategy=require(_0x3339('0x1'))[_0x3339('0x2')];var jayson=require(_0x3339('0x3'));var _=require('lodash');var rs=require(_0x3339('0x4'));var moment=require(_0x3339('0x5'));var db=require(_0x3339('0x6'))['db'];var authService=require(_0x3339('0x7'));var utils=require(_0x3339('0x8'));var client=jayson['client']['http']({'port':0x232b});function localAuthenticate(_0x2d2cd7,_0x23eb28,_0x3e869b,_0x3d8119){var _0x2a6971,_0x11dcf5;return db[_0x3339('0x9')]['findOne']({'where':{'id':0x1},'attributes':[_0x3339('0xa'),_0x3339('0xb')],'raw':!![]})[_0x3339('0xc')](function(_0x92a8cc){_0x2a6971=_0x92a8cc;return _0x2d2cd7['findOne']({'attributes':['id',_0x3339('0xd'),_0x3339('0xe'),_0x3339('0xf'),_0x3339('0x10'),_0x3339('0x11'),_0x3339('0x12'),_0x3339('0x13'),_0x3339('0x14')],'where':{'name':_0x23eb28,'role':{'$or':[_0x3339('0x15'),_0x3339('0x16'),'agent']}}});})[_0x3339('0xc')](function(_0x355599){if(!_0x355599||_0x355599&&_0x355599[_0x3339('0xd')]!==_0x23eb28){throw new Error('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{_0x11dcf5=_0x355599;return _0x11dcf5;}})['then'](function(){_0x11dcf5[_0x3339('0x17')](_0x3e869b,function(_0x2fa31d,_0x1fbdc2){var _0x57b4e8=_0x11dcf5[_0x3339('0x14')]+0x1;if(_0x2fa31d){return _0x3d8119(_0x2fa31d);}else if(!_0x1fbdc2){if(_0x11dcf5[_0x3339('0x11')]){return _0x3d8119(null,![],{'message':_0x3339('0x18')});}else if(_0x2a6971[_0x3339('0xa')]>0x0){if(_0x11dcf5['blocked']){if(_0x2a6971['blockDuration']>0x0){if(moment(_0x11dcf5[_0x3339('0x13')])[_0x3339('0x19')](_0x2a6971[_0x3339('0xb')],'minutes')>moment()){return _0x3d8119(null,![],{'message':_0x3339('0x18')});}else{return utils[_0x3339('0x1a')](_0x11dcf5,_0x57b4e8,![],null)[_0x3339('0xc')](function(){return _0x3d8119(null,![],{'message':_0x3339('0x18')});});}}else{return _0x3d8119(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}}else{if(_0x57b4e8>=_0x2a6971[_0x3339('0xa')]){return utils[_0x3339('0x1a')](_0x11dcf5,0x0,!![],moment())[_0x3339('0xc')](function(){return _0x3d8119(null,![],{'message':_0x3339('0x18')});});}else{return utils[_0x3339('0x1a')](_0x11dcf5,_0x57b4e8,![],null)[_0x3339('0xc')](function(){return _0x3d8119(null,![],{'message':_0x3339('0x18')});});}}}else{return _0x3d8119(null,![],{'message':_0x3339('0x18')});}}else{if(_0x11dcf5[_0x3339('0x11')]){return _0x3d8119(null,![],{'message':_0x3339('0x18')});}else if(_0x2a6971['allowedLoginAttempts']>0x0){if(_0x11dcf5[_0x3339('0x12')]){if(_0x2a6971[_0x3339('0xb')]>0x0){if(moment(_0x11dcf5['blockedAt'])[_0x3339('0x19')](_0x2a6971['blockDuration'],'minutes')>moment()){return _0x3d8119(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3339('0x1a')](_0x11dcf5,0x0,![],null)[_0x3339('0xc')](function(){return utils[_0x3339('0x1b')](_0x11dcf5);})['then'](function(){return _0x3d8119(null,_0x11dcf5);});}}else{return _0x3d8119(null,![],{'message':_0x3339('0x18')});}}else{return utils['clearBlockUser'](_0x11dcf5,0x0,![],null)[_0x3339('0xc')](function(){return utils[_0x3339('0x1b')](_0x11dcf5);})['then'](function(){return _0x3d8119(null,_0x11dcf5);})['catch'](function(_0x50f7c9){return _0x3d8119(null,![],_0x50f7c9);});}}else{if(_0x11dcf5[_0x3339('0x12')]){return _0x3d8119(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else{return utils[_0x3339('0x1b')](_0x11dcf5)[_0x3339('0xc')](function(){return _0x3d8119(null,_0x11dcf5);});}}}});})[_0x3339('0x1c')](function(_0x5b4620){return _0x3d8119(null,![],_0x5b4620);});}function sendServiceMail(_0x4e365d){return db[_0x3339('0x1d')][_0x3339('0x1e')]({'where':{'service':!![]},'attributes':['id',_0x3339('0xd'),'email'],'include':[{'model':db[_0x3339('0x1f')],'as':'Smtp'}]})[_0x3339('0xc')](function(_0x255510){if(!_0x255510){throw new Error(_0x3339('0x20'));}var _0x456a4f={'tls':{'rejectUnauthorized':![]}};if(_0x255510[_0x3339('0x21')]['service']){_0x456a4f[_0x3339('0x22')]=_0x255510[_0x3339('0x21')][_0x3339('0x22')];}else{_0x456a4f[_0x3339('0x23')]=_0x255510['Smtp']['host'];_0x456a4f[_0x3339('0x24')]=_0x255510[_0x3339('0x21')][_0x3339('0x24')];_0x456a4f[_0x3339('0x25')]=_0x255510[_0x3339('0x21')][_0x3339('0x25')];}if(_0x255510[_0x3339('0x21')][_0x3339('0x26')]){_0x456a4f[_0x3339('0x27')]={'user':_0x255510[_0x3339('0x21')][_0x3339('0x16')],'pass':_0x255510['Smtp'][_0x3339('0x28')]};}var _0x505792={'account':_0x456a4f,'message':_['merge']({'from':util['format'](_0x3339('0x29'),_0x255510[_0x3339('0xd')],_0x255510[_0x3339('0x2a')]||_0x255510['Smtp'][_0x3339('0x16')])},_0x4e365d)};return client[_0x3339('0x2b')](_0x3339('0x2c'),_0x505792);})['then'](function(_0x757fae){if(_0x757fae[_0x3339('0x2d')]){throw new Error(util['format'](_0x3339('0x2e'),_0x757fae[_0x3339('0x2d')][_0x3339('0x2f')]||JSON[_0x3339('0x30')](_0x757fae[_0x3339('0x2d')])));}return!![];});}function handleError(_0x9a8393,_0x213508,_0xf1738d){return _0x9a8393['status'](_0x213508||0x1f4)['send']({'message':_0xf1738d?_0xf1738d[_0x3339('0x2f')]||_0xf1738d:''});}function checkPasswordPattern(_0x249fd8,_0x3eea40,_0x30bfb8){if(_0x30bfb8){var _0x2120b7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2120b7[_0x3339('0x31')](_0x3eea40)){return _0x249fd8;}else{throw new Error(_0x3339('0x32'));}}else{return _0x249fd8;}}exports[_0x3339('0x33')]=function(_0x255b00,_0x29f02b,_0x5c9e7e){passport['authenticate'](_0x3339('0x34'),function(_0x2eac1e,_0x897397,_0x544f7c){var _0x451a4e=_0x2eac1e||_0x544f7c;if(_0x451a4e){return handleError(_0x29f02b,0x191,_0x451a4e);}if(!_0x897397){return handleError(_0x29f02b,0x194,{'message':'Something\x20went\x20wrong,\x20please\x20try\x20again.'});}else{var _0x167828={'payload':{'id':_0x897397['id'],'role':_0x897397[_0x3339('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0x3339('0x35')](_0x167828)['then'](function(_0xc19974){_0x29f02b[_0x3339('0x36')]({'id':_0x897397['id'],'token':_0xc19974,'statusCall':'','isAlreadyLogged':_0x897397[_0x3339('0x37')]});});}})(_0x255b00,_0x29f02b,_0x5c9e7e);};exports[_0x3339('0x38')]=function(_0x432746,_0x2fb6fe,_0x2861bc){if(!_0x432746['body'][_0x3339('0x2a')]){return handleError(_0x2fb6fe,0x1f4,{'message':_0x3339('0x39')});}var _0x13c7e3=rs[_0x3339('0x3a')]();_0x432746['body']['email']=_0x432746[_0x3339('0x3b')][_0x3339('0x2a')]['trim']()[_0x3339('0x3c')]();var _0x226b32;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x3339('0xa'),_0x3339('0xb')],'raw':!![]})[_0x3339('0xc')](function(_0x197a29){_0x226b32=_0x197a29;return db[_0x3339('0x3d')]['find']({'where':{'email':_0x432746['body'][_0x3339('0x2a')]}});})['then'](function(_0x4654b3){if(!_0x4654b3){throw new Error(_0x3339('0x3e'));}if(_0x4654b3[_0x3339('0x11')]){throw new Error(_0x3339('0x3f'));}if(_0x4654b3['blocked']){if(moment(_0x4654b3[_0x3339('0x13')])[_0x3339('0x19')](_0x226b32[_0x3339('0xb')],_0x3339('0x40'))>moment()){throw new Error(_0x3339('0x41'));}else{_0x4654b3[_0x3339('0x12')]=![];_0x4654b3[_0x3339('0x13')]=null;}}_0x4654b3[_0x3339('0x42')]=_0x13c7e3;_0x4654b3[_0x3339('0x43')]=Date[_0x3339('0x44')]()+0x36ee80;return _0x4654b3[_0x3339('0x45')]();})[_0x3339('0xc')](function(){return sendServiceMail({'to':_0x432746[_0x3339('0x3b')][_0x3339('0x2a')],'subject':'xCally\x20Motion\x20Password\x20Reset','text':_0x3339('0x46')+_0x3339('0x47')+'http://'+_0x432746[_0x3339('0x48')][_0x3339('0x23')]+_0x3339('0x49')+_0x13c7e3+'\x0a\x0a'+_0x3339('0x4a')});})[_0x3339('0xc')](function(){_0x2fb6fe[_0x3339('0x4b')](0xc8)['send']({'message':_0x3339('0x4c')});})[_0x3339('0x1c')](function(_0x1fc214){return handleError(_0x2fb6fe,0x1f4,_0x1fc214);});};exports[_0x3339('0x4d')]=function(_0x4cdd40,_0x1c5a31,_0x2e89c2){var _0x1655da;return db['User'][_0x3339('0x1e')]({'where':{'resetPasswordToken':_0x4cdd40[_0x3339('0x4e')]['token'],'resetPasswordExpires':{'$gt':Date['now']()}}})[_0x3339('0xc')](function(_0x228c6b){_0x1655da=_0x228c6b;if(!_0x1655da){throw new Error('Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.');}return db['Setting'][_0x3339('0x4f')]({'attributes':['id','securePassword']});})[_0x3339('0xc')](function(_0x5e3463){return checkPasswordPattern(_0x5e3463,_0x4cdd40['body'][_0x3339('0xe')],_0x5e3463[_0x3339('0x50')]);})[_0x3339('0xc')](function(){_0x1655da[_0x3339('0xe')]=_0x4cdd40['body'][_0x3339('0xe')];_0x1655da[_0x3339('0x42')]=null;_0x1655da[_0x3339('0x43')]=null;return _0x1655da[_0x3339('0x45')]();})[_0x3339('0xc')](function(){_0x1c5a31['status'](0xc8)['send']({'message':_0x3339('0x51')});})[_0x3339('0x1c')](function(_0x44e8bd){return handleError(_0x1c5a31,0x1f4,_0x44e8bd);});};passport['use'](new LocalStrategy({'usernameField':_0x3339('0xd'),'passwordField':_0x3339('0xe')},function(_0x1470cf,_0x5e0ca6,_0x29ed51){return localAuthenticate(db['User'],_0x1470cf,_0x5e0ca6,_0x29ed51);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index 7a499b4..b97b608 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 _0xdeb8=['reset','exports','express','Router','post','/forgot','forgot','/reset/:token'];(function(_0x1881ac,_0x57ecf4){var _0x3b966e=function(_0x134036){while(--_0x134036){_0x1881ac['push'](_0x1881ac['shift']());}};_0x3b966e(++_0x57ecf4);}(_0xdeb8,0x1ea));var _0x8deb=function(_0x11b704,_0x4f1491){_0x11b704=_0x11b704-0x0;var _0xfdd17f=_0xdeb8[_0x11b704];return _0xfdd17f;};'use strict';var express=require(_0x8deb('0x0'));var router=express[_0x8deb('0x1')]();var controller=require('./authLocal.controller');router[_0x8deb('0x2')]('/',controller['login']);router[_0x8deb('0x2')](_0x8deb('0x3'),controller[_0x8deb('0x4')]);router[_0x8deb('0x2')](_0x8deb('0x5'),controller[_0x8deb('0x6')]);module[_0x8deb('0x7')]=router; \ No newline at end of file +var _0x780c=['post','/forgot','forgot','/reset/:token','reset','exports','express','login'];(function(_0x12835c,_0x5103bf){var _0x43d44a=function(_0x1e60f3){while(--_0x1e60f3){_0x12835c['push'](_0x12835c['shift']());}};_0x43d44a(++_0x5103bf);}(_0x780c,0x166));var _0xc780=function(_0x22e9fe,_0x3d019f){_0x22e9fe=_0x22e9fe-0x0;var _0x47cd19=_0x780c[_0x22e9fe];return _0x47cd19;};'use strict';var express=require(_0xc780('0x0'));var router=express['Router']();var controller=require('./authLocal.controller');router['post']('/',controller[_0xc780('0x1')]);router[_0xc780('0x2')](_0xc780('0x3'),controller[_0xc780('0x4')]);router['post'](_0xc780('0x5'),controller[_0xc780('0x6')]);module[_0xc780('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index b6570ed..88228ab 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 _0x47e2=['BOOLEAN','INTEGER','sequelize','exports','STRING'];(function(_0x35da2f,_0x3fbecf){var _0x4ed933=function(_0x3f84a2){while(--_0x3f84a2){_0x35da2f['push'](_0x35da2f['shift']());}};_0x4ed933(++_0x3fbecf);}(_0x47e2,0x124));var _0x247e=function(_0x531a87,_0x517aa2){_0x531a87=_0x531a87-0x0;var _0x5435d7=_0x47e2[_0x531a87];return _0x5435d7;};'use strict';var Sequelize=require(_0x247e('0x0'));module[_0x247e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x247e('0x2')]},'description':{'type':Sequelize[_0x247e('0x2')]},'status':{'type':Sequelize[_0x247e('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x247e('0x4')],'defaultValue':0xa}}; \ No newline at end of file +var _0xd8a6=['sequelize','exports','STRING','BOOLEAN','INTEGER'];(function(_0x34e481,_0x1f0d05){var _0x195d01=function(_0x4e3fae){while(--_0x4e3fae){_0x34e481['push'](_0x34e481['shift']());}};_0x195d01(++_0x1f0d05);}(_0xd8a6,0x69));var _0x6d8a=function(_0x23219a,_0x473d48){_0x23219a=_0x23219a-0x0;var _0x34d47f=_0xd8a6[_0x23219a];return _0x34d47f;};'use strict';var Sequelize=require(_0x6d8a('0x0'));module[_0x6d8a('0x1')]={'name':{'type':Sequelize[_0x6d8a('0x2')],'allowNull':![]},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6d8a('0x2')]},'status':{'type':Sequelize[_0x6d8a('0x3')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x6d8a('0x4')],'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 771ce8a..e9546e2 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 _0xe06b=['keys','rawAttributes','include','merge','find','create','body','addConditions','omit','ids','getConditions','Condition','Action','getActions','nolimit','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','path','sox','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','Automation','fieldName','key','map','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','catch','params'];(function(_0x1a857e,_0x32dab2){var _0x1d4bc5=function(_0x3533ee){while(--_0x3533ee){_0x1a857e['push'](_0x1a857e['shift']());}};_0x1d4bc5(++_0x32dab2);}(_0xe06b,0xad));var _0xbe06=function(_0x2a7134,_0x252cc4){_0x2a7134=_0x2a7134-0x0;var _0x33d39a=_0xe06b[_0x2a7134];return _0x33d39a;};'use strict';var pdf=require(_0xbe06('0x0'));var emlformat=require(_0xbe06('0x1'));var rimraf=require(_0xbe06('0x2'));var zipdir=require(_0xbe06('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbe06('0x4'));var Mustache=require(_0xbe06('0x5'));var util=require('util');var path=require(_0xbe06('0x6'));var sox=require(_0xbe06('0x7'));var csv=require('to-csv');var ejs=require(_0xbe06('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbe06('0x9'));var crypto=require(_0xbe06('0xa'));var jsforce=require(_0xbe06('0xb'));var deskjs=require(_0xbe06('0xc'));var toCsv=require('to-csv');var querystring=require(_0xbe06('0xd'));var Papa=require('papaparse');var Redis=require(_0xbe06('0xe'));var authService=require(_0xbe06('0xf'));var qs=require(_0xbe06('0x10'));var as=require(_0xbe06('0x11'));var hardwareService=require(_0xbe06('0x12'));var logger=require('../../config/logger')(_0xbe06('0x13'));var utils=require(_0xbe06('0x14'));var config=require(_0xbe06('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5ad8eb,_0x860316){_0x860316=_0x860316||0xcc;return function(_0xa86296){if(_0xa86296){return _0x5ad8eb[_0xbe06('0x16')](_0x860316);}return _0x5ad8eb[_0xbe06('0x17')](_0x860316)[_0xbe06('0x18')]();};}function respondWithResult(_0x5bfb79,_0x1a4351){_0x1a4351=_0x1a4351||0xc8;return function(_0x57d20e){if(_0x57d20e){return _0x5bfb79[_0xbe06('0x17')](_0x1a4351)[_0xbe06('0x19')](_0x57d20e);}};}function respondWithFilteredResult(_0x1dcbdd,_0x26295a){return function(_0x3c908c){if(_0x3c908c){var _0x22bb63=_0x3c908c[_0xbe06('0x1a')],_0x1a8f00=_0x26295a[_0xbe06('0x1b')],_0x412da5=_0x26295a[_0xbe06('0x1b')]+_0x26295a[_0xbe06('0x1c')],_0x54b1a3;if(_0x412da5>=_0x22bb63){_0x412da5=_0x22bb63;_0x54b1a3=0xc8;}else{_0x54b1a3=0xce;}_0x1dcbdd['status'](_0x54b1a3);return _0x1dcbdd[_0xbe06('0x1d')](_0xbe06('0x1e'),_0x1a8f00+'-'+_0x412da5+'/'+_0x22bb63)[_0xbe06('0x19')](_0x3c908c);}return null;};}function patchUpdates(_0x41bc90){return function(_0x1866ac){try{jsonpatch[_0xbe06('0x1f')](_0x1866ac,_0x41bc90,!![]);}catch(_0x58c219){return BPromise[_0xbe06('0x20')](_0x58c219);}return _0x1866ac['save']();};}function saveUpdates(_0x34694a,_0x460a6c){return function(_0x1febc7){if(_0x1febc7){return _0x1febc7[_0xbe06('0x21')](_0x34694a)[_0xbe06('0x22')](function(_0x72fdeb){return _0x72fdeb;});}return null;};}function removeEntity(_0xf48e57,_0x4a5a52){return function(_0x47b897){if(_0x47b897){return _0x47b897[_0xbe06('0x23')]()['then'](function(){_0xf48e57[_0xbe06('0x17')](0xcc)[_0xbe06('0x18')]();});}};}function handleEntityNotFound(_0x3ac067,_0x5f179e){return function(_0x47252d){if(!_0x47252d){_0x3ac067['sendStatus'](0x194);}return _0x47252d;};}function handleError(_0x3a81bb,_0x2abf80){_0x2abf80=_0x2abf80||0x1f4;return function(_0x255de0){logger[_0xbe06('0x24')](_0x255de0[_0xbe06('0x25')]);if(_0x255de0[_0xbe06('0x26')]){delete _0x255de0['name'];}_0x3a81bb['status'](_0x2abf80)[_0xbe06('0x27')](_0x255de0);};}exports['index']=function(_0x4a9582,_0x1a4e97){var _0x42e3f2={},_0x506220={},_0x540dcc={'count':0x0,'rows':[]};var _0xf5eb8b=_['map'](db[_0xbe06('0x28')]['rawAttributes'],function(_0x19752a){return{'name':_0x19752a[_0xbe06('0x29')],'type':_0x19752a['type'][_0xbe06('0x2a')]};});_0x506220['model']=_[_0xbe06('0x2b')](_0xf5eb8b,_0xbe06('0x26'));_0x506220['query']=_['keys'](_0x4a9582[_0xbe06('0x2c')]);_0x506220[_0xbe06('0x2d')]=_[_0xbe06('0x2e')](_0x506220[_0xbe06('0x2f')],_0x506220['query']);_0x42e3f2['attributes']=_[_0xbe06('0x2e')](_0x506220[_0xbe06('0x2f')],qs[_0xbe06('0x30')](_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x30')]));_0x42e3f2['attributes']=_0x42e3f2[_0xbe06('0x31')][_0xbe06('0x32')]?_0x42e3f2['attributes']:_0x506220['model'];if(!_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x33')]('nolimit')){_0x42e3f2[_0xbe06('0x1c')]=qs['limit'](_0x4a9582['query'][_0xbe06('0x1c')]);_0x42e3f2[_0xbe06('0x1b')]=qs['offset'](_0x4a9582[_0xbe06('0x2c')]['offset']);}_0x42e3f2[_0xbe06('0x34')]=qs[_0xbe06('0x35')](_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x35')]);_0x42e3f2[_0xbe06('0x36')]=qs[_0xbe06('0x2d')](_[_0xbe06('0x37')](_0x4a9582['query'],_0x506220[_0xbe06('0x2d')]));if(_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x38')]){_0x42e3f2[_0xbe06('0x36')]=_['merge'](_0x42e3f2[_0xbe06('0x36')],{'$or':_['map'](_0xf5eb8b,function(_0x108317){if(_0x108317['type']!==_0xbe06('0x39')){var _0x2f8fdf={};_0x2f8fdf[_0x108317[_0xbe06('0x26')]]={'$like':'%'+_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x38')]+'%'};return _0x2f8fdf;}})});}_0x42e3f2=_['merge']({},_0x42e3f2,_0x4a9582[_0xbe06('0x3a')]);var _0x482bd5={'where':_0x42e3f2[_0xbe06('0x36')]};return db[_0xbe06('0x28')][_0xbe06('0x1a')](_0x482bd5)['then'](function(_0x50db36){_0x540dcc[_0xbe06('0x1a')]=_0x50db36;if(_0x4a9582[_0xbe06('0x2c')][_0xbe06('0x3b')]){_0x42e3f2['include']=[{'all':!![]}];}return db[_0xbe06('0x28')][_0xbe06('0x3c')](_0x42e3f2);})[_0xbe06('0x22')](function(_0x2ad029){_0x540dcc[_0xbe06('0x3d')]=_0x2ad029;return _0x540dcc;})[_0xbe06('0x22')](respondWithFilteredResult(_0x1a4e97,_0x42e3f2))[_0xbe06('0x3e')](handleError(_0x1a4e97,null));};exports['show']=function(_0xd4c838,_0x11dfd4){var _0x5631d3={'raw':![],'where':{'id':_0xd4c838[_0xbe06('0x3f')]['id']}},_0x548cc7={};_0x548cc7[_0xbe06('0x2f')]=_[_0xbe06('0x40')](db[_0xbe06('0x28')][_0xbe06('0x41')]);_0x548cc7[_0xbe06('0x2c')]=_[_0xbe06('0x40')](_0xd4c838['query']);_0x548cc7[_0xbe06('0x2d')]=_[_0xbe06('0x2e')](_0x548cc7['model'],_0x548cc7['query']);_0x5631d3[_0xbe06('0x31')]=_[_0xbe06('0x2e')](_0x548cc7[_0xbe06('0x2f')],qs[_0xbe06('0x30')](_0xd4c838[_0xbe06('0x2c')][_0xbe06('0x30')]));_0x5631d3[_0xbe06('0x31')]=_0x5631d3[_0xbe06('0x31')][_0xbe06('0x32')]?_0x5631d3[_0xbe06('0x31')]:_0x548cc7[_0xbe06('0x2f')];if(_0xd4c838['query']['includeAll']){_0x5631d3[_0xbe06('0x42')]=[{'all':!![]}];}_0x5631d3=_[_0xbe06('0x43')]({},_0x5631d3,_0xd4c838[_0xbe06('0x3a')]);return db[_0xbe06('0x28')][_0xbe06('0x44')](_0x5631d3)['then'](handleEntityNotFound(_0x11dfd4,null))['then'](respondWithResult(_0x11dfd4,null))[_0xbe06('0x3e')](handleError(_0x11dfd4,null));};exports[_0xbe06('0x45')]=function(_0x12d17c,_0xd54c2f){return db[_0xbe06('0x28')][_0xbe06('0x45')](_0x12d17c[_0xbe06('0x46')],{})[_0xbe06('0x22')](respondWithResult(_0xd54c2f,0xc9))[_0xbe06('0x3e')](handleError(_0xd54c2f,null));};exports['update']=function(_0x4ac439,_0x28df92){if(_0x4ac439[_0xbe06('0x46')]['id']){delete _0x4ac439['body']['id'];}return db[_0xbe06('0x28')][_0xbe06('0x44')]({'where':{'id':_0x4ac439['params']['id']}})[_0xbe06('0x22')](handleEntityNotFound(_0x28df92,null))[_0xbe06('0x22')](saveUpdates(_0x4ac439[_0xbe06('0x46')],null))[_0xbe06('0x22')](respondWithResult(_0x28df92,null))['catch'](handleError(_0x28df92,null));};exports['destroy']=function(_0x22f2c4,_0x233064){return db['Automation'][_0xbe06('0x44')]({'where':{'id':_0x22f2c4['params']['id']}})['then'](handleEntityNotFound(_0x233064,null))[_0xbe06('0x22')](removeEntity(_0x233064,null))['catch'](handleError(_0x233064,null));};exports[_0xbe06('0x47')]=function(_0x3039a4,_0x23c9fc,_0x1ea34f){return db['Condition']['find']({'where':{'id':_0x3039a4[_0xbe06('0x3f')]['id']}})['then'](handleEntityNotFound(_0x23c9fc,null))[_0xbe06('0x22')](function(_0x42eee0){if(_0x42eee0){return _0x42eee0[_0xbe06('0x47')](_0x3039a4['body']['ids'],_[_0xbe06('0x48')](_0x3039a4[_0xbe06('0x46')],[_0xbe06('0x49'),'id'])||{});}})[_0xbe06('0x22')](respondWithResult(_0x23c9fc,null))['catch'](handleError(_0x23c9fc,null));};exports[_0xbe06('0x4a')]=function(_0x2cc2c6,_0x4c9cd2,_0x5236a3){var _0x78fc82={};var _0x17bdab={};var _0x243ca5;var _0x3b9fc5;return db['Automation']['findOne']({'where':{'id':_0x2cc2c6[_0xbe06('0x3f')]['id']}})[_0xbe06('0x22')](handleEntityNotFound(_0x4c9cd2,null))[_0xbe06('0x22')](function(_0xaf9855){if(_0xaf9855){_0x243ca5=_0xaf9855;_0x17bdab[_0xbe06('0x2f')]=_[_0xbe06('0x40')](db[_0xbe06('0x4b')][_0xbe06('0x41')]);_0x17bdab[_0xbe06('0x2c')]=_['keys'](_0x2cc2c6['query']);_0x17bdab[_0xbe06('0x2d')]=_['intersection'](_0x17bdab[_0xbe06('0x2f')],_0x17bdab[_0xbe06('0x2c')]);_0x78fc82[_0xbe06('0x31')]=_[_0xbe06('0x2e')](_0x17bdab[_0xbe06('0x2f')],qs[_0xbe06('0x30')](_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x30')]));_0x78fc82[_0xbe06('0x31')]=_0x78fc82[_0xbe06('0x31')]['length']?_0x78fc82[_0xbe06('0x31')]:_0x17bdab[_0xbe06('0x2f')];_0x78fc82[_0xbe06('0x34')]=qs[_0xbe06('0x35')](_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x35')]);_0x78fc82['where']=qs[_0xbe06('0x2d')](_[_0xbe06('0x37')](_0x2cc2c6[_0xbe06('0x2c')],_0x17bdab['filters']));if(_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x38')]){_0x78fc82[_0xbe06('0x36')]=_[_0xbe06('0x43')](_0x78fc82[_0xbe06('0x36')],{'$or':_[_0xbe06('0x2b')](_0x78fc82[_0xbe06('0x31')],function(_0x35de65){var _0x588127={};_0x588127[_0x35de65]={'$like':'%'+_0x2cc2c6[_0xbe06('0x2c')]['filter']+'%'};return _0x588127;})});}_0x78fc82=_[_0xbe06('0x43')]({},_0x78fc82,_0x2cc2c6[_0xbe06('0x3a')]);return _0x243ca5[_0xbe06('0x4a')](_0x78fc82);}})[_0xbe06('0x22')](function(_0xfedc97){if(_0xfedc97){_0x3b9fc5=_0xfedc97['length'];if(!_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x33')]('nolimit')){_0x78fc82[_0xbe06('0x1c')]=qs['limit'](_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x1c')]);_0x78fc82[_0xbe06('0x1b')]=qs[_0xbe06('0x1b')](_0x2cc2c6[_0xbe06('0x2c')][_0xbe06('0x1b')]);}return _0x243ca5['getConditions'](_0x78fc82);}})[_0xbe06('0x22')](function(_0x189ec1){if(_0x189ec1){return _0x189ec1?{'count':_0x3b9fc5,'rows':_0x189ec1}:null;}})[_0xbe06('0x22')](respondWithResult(_0x4c9cd2,null))[_0xbe06('0x3e')](handleError(_0x4c9cd2,null));};exports['addActions']=function(_0x40548c,_0x530482,_0x77188a){return db[_0xbe06('0x4c')][_0xbe06('0x44')]({'where':{'id':_0x40548c[_0xbe06('0x3f')]['id']}})['then'](handleEntityNotFound(_0x530482,null))['then'](function(_0x37c6dc){if(_0x37c6dc){return _0x37c6dc['addActions'](_0x40548c[_0xbe06('0x46')][_0xbe06('0x49')],_[_0xbe06('0x48')](_0x40548c[_0xbe06('0x46')],[_0xbe06('0x49'),'id'])||{});}})[_0xbe06('0x22')](respondWithResult(_0x530482,null))[_0xbe06('0x3e')](handleError(_0x530482,null));};exports[_0xbe06('0x4d')]=function(_0x3574ef,_0x139470,_0x46a026){var _0x2efecd={};var _0x191088={};var _0x72df30;var _0x2afdec;return db['Automation']['findOne']({'where':{'id':_0x3574ef['params']['id']}})[_0xbe06('0x22')](handleEntityNotFound(_0x139470,null))[_0xbe06('0x22')](function(_0x375fcd){if(_0x375fcd){_0x72df30=_0x375fcd;_0x191088['model']=_[_0xbe06('0x40')](db[_0xbe06('0x4c')]['rawAttributes']);_0x191088[_0xbe06('0x2c')]=_['keys'](_0x3574ef[_0xbe06('0x2c')]);_0x191088[_0xbe06('0x2d')]=_[_0xbe06('0x2e')](_0x191088[_0xbe06('0x2f')],_0x191088[_0xbe06('0x2c')]);_0x2efecd[_0xbe06('0x31')]=_['intersection'](_0x191088[_0xbe06('0x2f')],qs[_0xbe06('0x30')](_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x30')]));_0x2efecd['attributes']=_0x2efecd[_0xbe06('0x31')][_0xbe06('0x32')]?_0x2efecd[_0xbe06('0x31')]:_0x191088['model'];_0x2efecd['order']=qs[_0xbe06('0x35')](_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x35')]);_0x2efecd[_0xbe06('0x36')]=qs[_0xbe06('0x2d')](_[_0xbe06('0x37')](_0x3574ef['query'],_0x191088['filters']));if(_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x38')]){_0x2efecd[_0xbe06('0x36')]=_[_0xbe06('0x43')](_0x2efecd[_0xbe06('0x36')],{'$or':_[_0xbe06('0x2b')](_0x2efecd[_0xbe06('0x31')],function(_0x5a278a){var _0x33a0c5={};_0x33a0c5[_0x5a278a]={'$like':'%'+_0x3574ef[_0xbe06('0x2c')]['filter']+'%'};return _0x33a0c5;})});}_0x2efecd=_['merge']({},_0x2efecd,_0x3574ef[_0xbe06('0x3a')]);return _0x72df30[_0xbe06('0x4d')](_0x2efecd);}})[_0xbe06('0x22')](function(_0x5ccb10){if(_0x5ccb10){_0x2afdec=_0x5ccb10[_0xbe06('0x32')];if(!_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x33')](_0xbe06('0x4e'))){_0x2efecd[_0xbe06('0x1c')]=qs[_0xbe06('0x1c')](_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x1c')]);_0x2efecd[_0xbe06('0x1b')]=qs['offset'](_0x3574ef[_0xbe06('0x2c')][_0xbe06('0x1b')]);}return _0x72df30[_0xbe06('0x4d')](_0x2efecd);}})[_0xbe06('0x22')](function(_0x2b80ff){if(_0x2b80ff){return _0x2b80ff?{'count':_0x2afdec,'rows':_0x2b80ff}:null;}})[_0xbe06('0x22')](respondWithResult(_0x139470,null))[_0xbe06('0x3e')](handleError(_0x139470,null));}; \ No newline at end of file +var _0xf6c8=['html-pdf','eml-format','moment','bluebird','mustache','util','sox','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','key','query','keys','attributes','intersection','model','fields','length','nolimit','limit','order','sort','pick','filters','filter','where','merge','VIRTUAL','count','findAll','rows','catch','show','includeAll','include','find','create','body','params','addConditions','ids','omit','getConditions','Condition','options','hasOwnProperty','addActions','getActions','findOne','Action'];(function(_0x7b484,_0x195ad4){var _0x2ae1cf=function(_0x2e6247){while(--_0x2e6247){_0x7b484['push'](_0x7b484['shift']());}};_0x2ae1cf(++_0x195ad4);}(_0xf6c8,0x19a));var _0x8f6c=function(_0x173d7e,_0x3242fd){_0x173d7e=_0x173d7e-0x0;var _0x2220d6=_0xf6c8[_0x173d7e];return _0x2220d6;};'use strict';var pdf=require(_0x8f6c('0x0'));var emlformat=require(_0x8f6c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8f6c('0x2'));var BPromise=require(_0x8f6c('0x3'));var Mustache=require(_0x8f6c('0x4'));var util=require(_0x8f6c('0x5'));var path=require('path');var sox=require(_0x8f6c('0x6'));var csv=require('to-csv');var ejs=require(_0x8f6c('0x7'));var fs=require('fs');var _=require(_0x8f6c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8f6c('0x9'));var deskjs=require(_0x8f6c('0xa'));var toCsv=require('to-csv');var querystring=require(_0x8f6c('0xb'));var Papa=require(_0x8f6c('0xc'));var Redis=require(_0x8f6c('0xd'));var authService=require(_0x8f6c('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8f6c('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8f6c('0x10'))(_0x8f6c('0x11'));var utils=require(_0x8f6c('0x12'));var config=require(_0x8f6c('0x13'));var db=require(_0x8f6c('0x14'))['db'];function respondWithStatusCode(_0x356b61,_0x4a4e15){_0x4a4e15=_0x4a4e15||0xcc;return function(_0xe47d39){if(_0xe47d39){return _0x356b61[_0x8f6c('0x15')](_0x4a4e15);}return _0x356b61[_0x8f6c('0x16')](_0x4a4e15)[_0x8f6c('0x17')]();};}function respondWithResult(_0x4e57e4,_0x121d0b){_0x121d0b=_0x121d0b||0xc8;return function(_0x20e08){if(_0x20e08){return _0x4e57e4[_0x8f6c('0x16')](_0x121d0b)[_0x8f6c('0x18')](_0x20e08);}};}function respondWithFilteredResult(_0x51a5bc,_0x5f0a28){return function(_0x52d620){if(_0x52d620){var _0x10d7e3=_0x52d620['count'],_0x529b29=_0x5f0a28[_0x8f6c('0x19')],_0x57c0b1=_0x5f0a28['offset']+_0x5f0a28['limit'],_0x387783;if(_0x57c0b1>=_0x10d7e3){_0x57c0b1=_0x10d7e3;_0x387783=0xc8;}else{_0x387783=0xce;}_0x51a5bc[_0x8f6c('0x16')](_0x387783);return _0x51a5bc[_0x8f6c('0x1a')]('Content-Range',_0x529b29+'-'+_0x57c0b1+'/'+_0x10d7e3)[_0x8f6c('0x18')](_0x52d620);}return null;};}function patchUpdates(_0x39ffbe){return function(_0x5aa0e5){try{jsonpatch[_0x8f6c('0x1b')](_0x5aa0e5,_0x39ffbe,!![]);}catch(_0x670bb9){return BPromise[_0x8f6c('0x1c')](_0x670bb9);}return _0x5aa0e5[_0x8f6c('0x1d')]();};}function saveUpdates(_0x2b20df,_0x3a327b){return function(_0x578246){if(_0x578246){return _0x578246[_0x8f6c('0x1e')](_0x2b20df)[_0x8f6c('0x1f')](function(_0x11206c){return _0x11206c;});}return null;};}function removeEntity(_0x34a96f,_0x43e1e7){return function(_0x2f39e3){if(_0x2f39e3){return _0x2f39e3[_0x8f6c('0x20')]()[_0x8f6c('0x1f')](function(){_0x34a96f[_0x8f6c('0x16')](0xcc)[_0x8f6c('0x17')]();});}};}function handleEntityNotFound(_0x3662e2,_0x6a389e){return function(_0x17fea9){if(!_0x17fea9){_0x3662e2[_0x8f6c('0x15')](0x194);}return _0x17fea9;};}function handleError(_0x2198da,_0x185270){_0x185270=_0x185270||0x1f4;return function(_0x369e9b){logger[_0x8f6c('0x21')](_0x369e9b[_0x8f6c('0x22')]);if(_0x369e9b['name']){delete _0x369e9b[_0x8f6c('0x23')];}_0x2198da['status'](_0x185270)['send'](_0x369e9b);};}exports[_0x8f6c('0x24')]=function(_0x44018d,_0x5a8936){var _0x38970a={},_0x42f02d={},_0x59cf72={'count':0x0,'rows':[]};var _0x284b2b=_[_0x8f6c('0x25')](db[_0x8f6c('0x26')][_0x8f6c('0x27')],function(_0x327c8b){return{'name':_0x327c8b[_0x8f6c('0x28')],'type':_0x327c8b[_0x8f6c('0x29')][_0x8f6c('0x2a')]};});_0x42f02d['model']=_[_0x8f6c('0x25')](_0x284b2b,_0x8f6c('0x23'));_0x42f02d[_0x8f6c('0x2b')]=_[_0x8f6c('0x2c')](_0x44018d[_0x8f6c('0x2b')]);_0x42f02d['filters']=_['intersection'](_0x42f02d['model'],_0x42f02d[_0x8f6c('0x2b')]);_0x38970a[_0x8f6c('0x2d')]=_[_0x8f6c('0x2e')](_0x42f02d[_0x8f6c('0x2f')],qs[_0x8f6c('0x30')](_0x44018d[_0x8f6c('0x2b')][_0x8f6c('0x30')]));_0x38970a[_0x8f6c('0x2d')]=_0x38970a[_0x8f6c('0x2d')][_0x8f6c('0x31')]?_0x38970a[_0x8f6c('0x2d')]:_0x42f02d[_0x8f6c('0x2f')];if(!_0x44018d[_0x8f6c('0x2b')]['hasOwnProperty'](_0x8f6c('0x32'))){_0x38970a[_0x8f6c('0x33')]=qs[_0x8f6c('0x33')](_0x44018d[_0x8f6c('0x2b')][_0x8f6c('0x33')]);_0x38970a[_0x8f6c('0x19')]=qs['offset'](_0x44018d[_0x8f6c('0x2b')][_0x8f6c('0x19')]);}_0x38970a[_0x8f6c('0x34')]=qs[_0x8f6c('0x35')](_0x44018d[_0x8f6c('0x2b')][_0x8f6c('0x35')]);_0x38970a['where']=qs['filters'](_[_0x8f6c('0x36')](_0x44018d[_0x8f6c('0x2b')],_0x42f02d[_0x8f6c('0x37')]));if(_0x44018d['query'][_0x8f6c('0x38')]){_0x38970a[_0x8f6c('0x39')]=_[_0x8f6c('0x3a')](_0x38970a[_0x8f6c('0x39')],{'$or':_[_0x8f6c('0x25')](_0x284b2b,function(_0x3f5bf2){if(_0x3f5bf2['type']!==_0x8f6c('0x3b')){var _0x39cc1f={};_0x39cc1f[_0x3f5bf2[_0x8f6c('0x23')]]={'$like':'%'+_0x44018d[_0x8f6c('0x2b')][_0x8f6c('0x38')]+'%'};return _0x39cc1f;}})});}_0x38970a=_[_0x8f6c('0x3a')]({},_0x38970a,_0x44018d['options']);var _0x9833c7={'where':_0x38970a['where']};return db[_0x8f6c('0x26')][_0x8f6c('0x3c')](_0x9833c7)['then'](function(_0x3983ce){_0x59cf72['count']=_0x3983ce;if(_0x44018d[_0x8f6c('0x2b')]['includeAll']){_0x38970a['include']=[{'all':!![]}];}return db[_0x8f6c('0x26')][_0x8f6c('0x3d')](_0x38970a);})[_0x8f6c('0x1f')](function(_0x1c21cb){_0x59cf72[_0x8f6c('0x3e')]=_0x1c21cb;return _0x59cf72;})['then'](respondWithFilteredResult(_0x5a8936,_0x38970a))[_0x8f6c('0x3f')](handleError(_0x5a8936,null));};exports[_0x8f6c('0x40')]=function(_0x127b54,_0x160db4){var _0x3386f6={'raw':![],'where':{'id':_0x127b54['params']['id']}},_0x56c1aa={};_0x56c1aa[_0x8f6c('0x2f')]=_['keys'](db[_0x8f6c('0x26')][_0x8f6c('0x27')]);_0x56c1aa[_0x8f6c('0x2b')]=_[_0x8f6c('0x2c')](_0x127b54[_0x8f6c('0x2b')]);_0x56c1aa[_0x8f6c('0x37')]=_['intersection'](_0x56c1aa['model'],_0x56c1aa[_0x8f6c('0x2b')]);_0x3386f6[_0x8f6c('0x2d')]=_[_0x8f6c('0x2e')](_0x56c1aa[_0x8f6c('0x2f')],qs[_0x8f6c('0x30')](_0x127b54[_0x8f6c('0x2b')][_0x8f6c('0x30')]));_0x3386f6[_0x8f6c('0x2d')]=_0x3386f6[_0x8f6c('0x2d')][_0x8f6c('0x31')]?_0x3386f6[_0x8f6c('0x2d')]:_0x56c1aa[_0x8f6c('0x2f')];if(_0x127b54['query'][_0x8f6c('0x41')]){_0x3386f6[_0x8f6c('0x42')]=[{'all':!![]}];}_0x3386f6=_['merge']({},_0x3386f6,_0x127b54['options']);return db[_0x8f6c('0x26')][_0x8f6c('0x43')](_0x3386f6)[_0x8f6c('0x1f')](handleEntityNotFound(_0x160db4,null))[_0x8f6c('0x1f')](respondWithResult(_0x160db4,null))['catch'](handleError(_0x160db4,null));};exports[_0x8f6c('0x44')]=function(_0x53f1dc,_0x2d5f35){return db[_0x8f6c('0x26')][_0x8f6c('0x44')](_0x53f1dc[_0x8f6c('0x45')],{})[_0x8f6c('0x1f')](respondWithResult(_0x2d5f35,0xc9))[_0x8f6c('0x3f')](handleError(_0x2d5f35,null));};exports[_0x8f6c('0x1e')]=function(_0x1dac02,_0x5dfb78){if(_0x1dac02[_0x8f6c('0x45')]['id']){delete _0x1dac02[_0x8f6c('0x45')]['id'];}return db['Automation'][_0x8f6c('0x43')]({'where':{'id':_0x1dac02[_0x8f6c('0x46')]['id']}})[_0x8f6c('0x1f')](handleEntityNotFound(_0x5dfb78,null))[_0x8f6c('0x1f')](saveUpdates(_0x1dac02[_0x8f6c('0x45')],null))['then'](respondWithResult(_0x5dfb78,null))['catch'](handleError(_0x5dfb78,null));};exports[_0x8f6c('0x20')]=function(_0x55a039,_0x2d6d34){return db[_0x8f6c('0x26')][_0x8f6c('0x43')]({'where':{'id':_0x55a039[_0x8f6c('0x46')]['id']}})[_0x8f6c('0x1f')](handleEntityNotFound(_0x2d6d34,null))[_0x8f6c('0x1f')](removeEntity(_0x2d6d34,null))['catch'](handleError(_0x2d6d34,null));};exports[_0x8f6c('0x47')]=function(_0x2c788e,_0xb37165,_0x4ff472){return db['Condition']['find']({'where':{'id':_0x2c788e[_0x8f6c('0x46')]['id']}})['then'](handleEntityNotFound(_0xb37165,null))[_0x8f6c('0x1f')](function(_0x4a1bf2){if(_0x4a1bf2){return _0x4a1bf2[_0x8f6c('0x47')](_0x2c788e['body'][_0x8f6c('0x48')],_[_0x8f6c('0x49')](_0x2c788e['body'],[_0x8f6c('0x48'),'id'])||{});}})['then'](respondWithResult(_0xb37165,null))[_0x8f6c('0x3f')](handleError(_0xb37165,null));};exports[_0x8f6c('0x4a')]=function(_0x3a6f8d,_0x2ff0a6,_0x480f7c){var _0x5f1456={};var _0xee3feb={};var _0x30f069;var _0x5346ae;return db[_0x8f6c('0x26')]['findOne']({'where':{'id':_0x3a6f8d[_0x8f6c('0x46')]['id']}})[_0x8f6c('0x1f')](handleEntityNotFound(_0x2ff0a6,null))[_0x8f6c('0x1f')](function(_0x22a2a6){if(_0x22a2a6){_0x30f069=_0x22a2a6;_0xee3feb[_0x8f6c('0x2f')]=_[_0x8f6c('0x2c')](db[_0x8f6c('0x4b')][_0x8f6c('0x27')]);_0xee3feb[_0x8f6c('0x2b')]=_['keys'](_0x3a6f8d[_0x8f6c('0x2b')]);_0xee3feb['filters']=_[_0x8f6c('0x2e')](_0xee3feb['model'],_0xee3feb[_0x8f6c('0x2b')]);_0x5f1456['attributes']=_['intersection'](_0xee3feb['model'],qs[_0x8f6c('0x30')](_0x3a6f8d['query'][_0x8f6c('0x30')]));_0x5f1456[_0x8f6c('0x2d')]=_0x5f1456[_0x8f6c('0x2d')]['length']?_0x5f1456[_0x8f6c('0x2d')]:_0xee3feb['model'];_0x5f1456['order']=qs['sort'](_0x3a6f8d[_0x8f6c('0x2b')][_0x8f6c('0x35')]);_0x5f1456[_0x8f6c('0x39')]=qs[_0x8f6c('0x37')](_[_0x8f6c('0x36')](_0x3a6f8d[_0x8f6c('0x2b')],_0xee3feb[_0x8f6c('0x37')]));if(_0x3a6f8d[_0x8f6c('0x2b')][_0x8f6c('0x38')]){_0x5f1456['where']=_['merge'](_0x5f1456[_0x8f6c('0x39')],{'$or':_[_0x8f6c('0x25')](_0x5f1456['attributes'],function(_0x54a491){var _0x3cad80={};_0x3cad80[_0x54a491]={'$like':'%'+_0x3a6f8d[_0x8f6c('0x2b')]['filter']+'%'};return _0x3cad80;})});}_0x5f1456=_[_0x8f6c('0x3a')]({},_0x5f1456,_0x3a6f8d[_0x8f6c('0x4c')]);return _0x30f069[_0x8f6c('0x4a')](_0x5f1456);}})[_0x8f6c('0x1f')](function(_0x5ef0e3){if(_0x5ef0e3){_0x5346ae=_0x5ef0e3[_0x8f6c('0x31')];if(!_0x3a6f8d[_0x8f6c('0x2b')][_0x8f6c('0x4d')]('nolimit')){_0x5f1456[_0x8f6c('0x33')]=qs['limit'](_0x3a6f8d['query'][_0x8f6c('0x33')]);_0x5f1456[_0x8f6c('0x19')]=qs['offset'](_0x3a6f8d[_0x8f6c('0x2b')]['offset']);}return _0x30f069['getConditions'](_0x5f1456);}})[_0x8f6c('0x1f')](function(_0xeaf995){if(_0xeaf995){return _0xeaf995?{'count':_0x5346ae,'rows':_0xeaf995}:null;}})[_0x8f6c('0x1f')](respondWithResult(_0x2ff0a6,null))[_0x8f6c('0x3f')](handleError(_0x2ff0a6,null));};exports['addActions']=function(_0x525b0d,_0x4500b2,_0x357003){return db['Action'][_0x8f6c('0x43')]({'where':{'id':_0x525b0d['params']['id']}})[_0x8f6c('0x1f')](handleEntityNotFound(_0x4500b2,null))[_0x8f6c('0x1f')](function(_0x2f6a25){if(_0x2f6a25){return _0x2f6a25[_0x8f6c('0x4e')](_0x525b0d['body']['ids'],_[_0x8f6c('0x49')](_0x525b0d[_0x8f6c('0x45')],[_0x8f6c('0x48'),'id'])||{});}})['then'](respondWithResult(_0x4500b2,null))[_0x8f6c('0x3f')](handleError(_0x4500b2,null));};exports[_0x8f6c('0x4f')]=function(_0x420905,_0x7ded23,_0x410fc8){var _0x2a924d={};var _0x2cea52={};var _0x59143c;var _0x341f26;return db[_0x8f6c('0x26')][_0x8f6c('0x50')]({'where':{'id':_0x420905[_0x8f6c('0x46')]['id']}})[_0x8f6c('0x1f')](handleEntityNotFound(_0x7ded23,null))[_0x8f6c('0x1f')](function(_0x4fc480){if(_0x4fc480){_0x59143c=_0x4fc480;_0x2cea52['model']=_[_0x8f6c('0x2c')](db[_0x8f6c('0x51')][_0x8f6c('0x27')]);_0x2cea52[_0x8f6c('0x2b')]=_[_0x8f6c('0x2c')](_0x420905[_0x8f6c('0x2b')]);_0x2cea52[_0x8f6c('0x37')]=_['intersection'](_0x2cea52[_0x8f6c('0x2f')],_0x2cea52[_0x8f6c('0x2b')]);_0x2a924d['attributes']=_['intersection'](_0x2cea52[_0x8f6c('0x2f')],qs[_0x8f6c('0x30')](_0x420905[_0x8f6c('0x2b')]['fields']));_0x2a924d[_0x8f6c('0x2d')]=_0x2a924d[_0x8f6c('0x2d')]['length']?_0x2a924d[_0x8f6c('0x2d')]:_0x2cea52[_0x8f6c('0x2f')];_0x2a924d[_0x8f6c('0x34')]=qs[_0x8f6c('0x35')](_0x420905['query']['sort']);_0x2a924d[_0x8f6c('0x39')]=qs[_0x8f6c('0x37')](_[_0x8f6c('0x36')](_0x420905[_0x8f6c('0x2b')],_0x2cea52['filters']));if(_0x420905['query'][_0x8f6c('0x38')]){_0x2a924d[_0x8f6c('0x39')]=_['merge'](_0x2a924d[_0x8f6c('0x39')],{'$or':_[_0x8f6c('0x25')](_0x2a924d[_0x8f6c('0x2d')],function(_0x580913){var _0x5b27b6={};_0x5b27b6[_0x580913]={'$like':'%'+_0x420905['query']['filter']+'%'};return _0x5b27b6;})});}_0x2a924d=_[_0x8f6c('0x3a')]({},_0x2a924d,_0x420905[_0x8f6c('0x4c')]);return _0x59143c['getActions'](_0x2a924d);}})[_0x8f6c('0x1f')](function(_0x317207){if(_0x317207){_0x341f26=_0x317207['length'];if(!_0x420905['query'][_0x8f6c('0x4d')](_0x8f6c('0x32'))){_0x2a924d[_0x8f6c('0x33')]=qs[_0x8f6c('0x33')](_0x420905['query'][_0x8f6c('0x33')]);_0x2a924d[_0x8f6c('0x19')]=qs[_0x8f6c('0x19')](_0x420905[_0x8f6c('0x2b')]['offset']);}return _0x59143c[_0x8f6c('0x4f')](_0x2a924d);}})[_0x8f6c('0x1f')](function(_0x599a33){if(_0x599a33){return _0x599a33?{'count':_0x341f26,'rows':_0x599a33}:null;}})[_0x8f6c('0x1f')](respondWithResult(_0x7ded23,null))[_0x8f6c('0x3f')](handleError(_0x7ded23,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index a567eda..80aea35 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 _0x99dc=['api','moment','bluebird','request-promise','path','../../config/environment','./automation.attributes','exports','lodash','util','../../config/logger'];(function(_0x3542dc,_0x1688a7){var _0x565444=function(_0x573905){while(--_0x573905){_0x3542dc['push'](_0x3542dc['shift']());}};_0x565444(++_0x1688a7);}(_0x99dc,0xa2));var _0xc99d=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x99dc[_0x273c39];return _0x46d6b5;};'use strict';var _=require(_0xc99d('0x0'));var util=require(_0xc99d('0x1'));var logger=require(_0xc99d('0x2'))(_0xc99d('0x3'));var moment=require(_0xc99d('0x4'));var BPromise=require(_0xc99d('0x5'));var rp=require(_0xc99d('0x6'));var fs=require('fs');var path=require(_0xc99d('0x7'));var rimraf=require('rimraf');var config=require(_0xc99d('0x8'));var attributes=require(_0xc99d('0x9'));module[_0xc99d('0xa')]=function(_0x2c863b,_0x2734ce){return _0x2c863b['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4332=['request-promise','path','rimraf','./automation.attributes','exports','define','tools_automations','../../config/logger','api','moment','bluebird'];(function(_0x152f2f,_0xe7d7a3){var _0x3a760e=function(_0x2a03dc){while(--_0x2a03dc){_0x152f2f['push'](_0x152f2f['shift']());}};_0x3a760e(++_0xe7d7a3);}(_0x4332,0x8b));var _0x2433=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0x4332[_0x19e35c];return _0x3e1fe8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2433('0x0'))(_0x2433('0x1'));var moment=require(_0x2433('0x2'));var BPromise=require(_0x2433('0x3'));var rp=require(_0x2433('0x4'));var fs=require('fs');var path=require(_0x2433('0x5'));var rimraf=require(_0x2433('0x6'));var config=require('../../config/environment');var attributes=require(_0x2433('0x7'));module[_0x2433('0x8')]=function(_0x18a137,_0x5167db){return _0x18a137[_0x2433('0x9')]('Automation',attributes,{'tableName':_0x2433('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/automation/automation.rpc.js b/server/api/automation/automation.rpc.js index e63dd33..7798a9d 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 _0xba64=['then','Automation,\x20%s,\x20%s','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request'];(function(_0x2be459,_0x49bf39){var _0x242d43=function(_0x53db8f){while(--_0x53db8f){_0x2be459['push'](_0x2be459['shift']());}};_0x242d43(++_0x49bf39);}(_0xba64,0x1ef));var _0x4ba6=function(_0x27c54d,_0x5318c3){_0x27c54d=_0x27c54d-0x0;var _0x12529c=_0xba64[_0x27c54d];return _0x12529c;};'use strict';var _=require('lodash');var util=require(_0x4ba6('0x0'));var moment=require(_0x4ba6('0x1'));var BPromise=require(_0x4ba6('0x2'));var rs=require(_0x4ba6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4ba6('0x4'))['db'];var utils=require(_0x4ba6('0x5'));var logger=require('../../config/logger')(_0x4ba6('0x6'));var config=require(_0x4ba6('0x7'));var jayson=require(_0x4ba6('0x8'));var client=jayson[_0x4ba6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x52989e,_0x28078f,_0x3de72d){return new BPromise(function(_0x3ba648,_0x4319dc){return client[_0x4ba6('0xa')](_0x52989e,_0x3de72d)[_0x4ba6('0xb')](function(_0x485f3a){logger['info'](_0x4ba6('0xc'),_0x28078f,_0x4ba6('0xd'));logger[_0x4ba6('0xe')](_0x4ba6('0xf'),_0x28078f,_0x4ba6('0xd'),JSON[_0x4ba6('0x10')](_0x485f3a));if(_0x485f3a[_0x4ba6('0x11')]){if(_0x485f3a['error'][_0x4ba6('0x12')]===0x1f4){logger[_0x4ba6('0x11')](_0x4ba6('0xc'),_0x28078f,_0x485f3a[_0x4ba6('0x11')][_0x4ba6('0x13')]);return _0x4319dc(_0x485f3a[_0x4ba6('0x11')][_0x4ba6('0x13')]);}logger['error'](_0x4ba6('0xc'),_0x28078f,_0x485f3a[_0x4ba6('0x11')][_0x4ba6('0x13')]);return _0x3ba648(_0x485f3a[_0x4ba6('0x11')]['message']);}else{logger[_0x4ba6('0x14')](_0x4ba6('0xc'),_0x28078f,'request\x20sent');_0x3ba648(_0x485f3a['result'][_0x4ba6('0x13')]);}})[_0x4ba6('0x15')](function(_0x1460fd){logger[_0x4ba6('0x11')](_0x4ba6('0xc'),_0x28078f,_0x1460fd);_0x4319dc(_0x1460fd);});});} \ No newline at end of file +var _0xf726=['message','info','result','util','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf726,0xa3));var _0x6f72=function(_0x349ac1,_0xd4bf20){_0x349ac1=_0x349ac1-0x0;var _0x36b3f0=_0xf726[_0x349ac1];return _0x36b3f0;};'use strict';var _=require('lodash');var util=require(_0x6f72('0x0'));var moment=require('moment');var BPromise=require(_0x6f72('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6f72('0x2'));var db=require(_0x6f72('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x6f72('0x4'));var jayson=require(_0x6f72('0x5'));var client=jayson[_0x6f72('0x6')][_0x6f72('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5ca9ee,_0x1fcd09,_0x5d6433){return new BPromise(function(_0xbdf4a,_0x279dd2){return client[_0x6f72('0x8')](_0x5ca9ee,_0x5d6433)[_0x6f72('0x9')](function(_0x22cd9a){logger['info']('Automation,\x20%s,\x20%s',_0x1fcd09,_0x6f72('0xa'));logger[_0x6f72('0xb')](_0x6f72('0xc'),_0x1fcd09,'request\x20sent',JSON[_0x6f72('0xd')](_0x22cd9a));if(_0x22cd9a['error']){if(_0x22cd9a[_0x6f72('0xe')][_0x6f72('0xf')]===0x1f4){logger[_0x6f72('0xe')](_0x6f72('0x10'),_0x1fcd09,_0x22cd9a['error'][_0x6f72('0x11')]);return _0x279dd2(_0x22cd9a['error'][_0x6f72('0x11')]);}logger['error']('Automation,\x20%s,\x20%s',_0x1fcd09,_0x22cd9a[_0x6f72('0xe')]['message']);return _0xbdf4a(_0x22cd9a[_0x6f72('0xe')]['message']);}else{logger[_0x6f72('0x12')](_0x6f72('0x10'),_0x1fcd09,'request\x20sent');_0xbdf4a(_0x22cd9a[_0x6f72('0x13')][_0x6f72('0x11')]);}})['catch'](function(_0x100ff4){logger[_0x6f72('0xe')]('Automation,\x20%s,\x20%s',_0x1fcd09,_0x100ff4);_0x279dd2(_0x100ff4);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index 5a61a65..9477bbd 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 _0xe550=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/conditions','getConditions','/:id/actions','getActions','post','create','addConditions','addActions','put','delete','destroy','exports','multer','util'];(function(_0x3486ca,_0x1fe4bc){var _0x280fd6=function(_0x2a5538){while(--_0x2a5538){_0x3486ca['push'](_0x3486ca['shift']());}};_0x280fd6(++_0x1fe4bc);}(_0xe550,0x18e));var _0x0e55=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xe550[_0x14add3];return _0x4a174f;};'use strict';var multer=require(_0x0e55('0x0'));var util=require(_0x0e55('0x1'));var path=require(_0x0e55('0x2'));var timeout=require(_0x0e55('0x3'));var express=require(_0x0e55('0x4'));var router=express['Router']();var auth=require(_0x0e55('0x5'));var interaction=require(_0x0e55('0x6'));var config=require(_0x0e55('0x7'));var controller=require('./automation.controller');router['get']('/',auth[_0x0e55('0x8')](),controller[_0x0e55('0x9')]);router[_0x0e55('0xa')](_0x0e55('0xb'),auth[_0x0e55('0x8')](),controller[_0x0e55('0xc')]);router[_0x0e55('0xa')](_0x0e55('0xd'),auth[_0x0e55('0x8')](),controller[_0x0e55('0xe')]);router[_0x0e55('0xa')](_0x0e55('0xf'),auth['isAuthenticated'](),controller[_0x0e55('0x10')]);router[_0x0e55('0x11')]('/',auth[_0x0e55('0x8')](),controller[_0x0e55('0x12')]);router[_0x0e55('0x11')](_0x0e55('0xd'),auth['isAuthenticated'](),controller[_0x0e55('0x13')]);router['post'](_0x0e55('0xf'),auth['isAuthenticated'](),controller[_0x0e55('0x14')]);router[_0x0e55('0x15')](_0x0e55('0xb'),auth[_0x0e55('0x8')](),controller['update']);router[_0x0e55('0x16')](_0x0e55('0xb'),auth[_0x0e55('0x8')](),controller[_0x0e55('0x17')]);module[_0x0e55('0x18')]=router; \ No newline at end of file +var _0x98d8=['show','/:id/conditions','isAuthenticated','getConditions','get','/:id/actions','getActions','post','create','addConditions','addActions','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./automation.controller','index','/:id'];(function(_0x1e4a8e,_0x18022b){var _0x5408f9=function(_0x4ef2ed){while(--_0x4ef2ed){_0x1e4a8e['push'](_0x1e4a8e['shift']());}};_0x5408f9(++_0x18022b);}(_0x98d8,0xce));var _0x898d=function(_0x37ae26,_0x2ecd70){_0x37ae26=_0x37ae26-0x0;var _0x1b1902=_0x98d8[_0x37ae26];return _0x1b1902;};'use strict';var multer=require(_0x898d('0x0'));var util=require(_0x898d('0x1'));var path=require(_0x898d('0x2'));var timeout=require(_0x898d('0x3'));var express=require(_0x898d('0x4'));var router=express[_0x898d('0x5')]();var auth=require(_0x898d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x898d('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x898d('0x8')]);router['get'](_0x898d('0x9'),auth['isAuthenticated'](),controller[_0x898d('0xa')]);router['get'](_0x898d('0xb'),auth[_0x898d('0xc')](),controller[_0x898d('0xd')]);router[_0x898d('0xe')](_0x898d('0xf'),auth[_0x898d('0xc')](),controller[_0x898d('0x10')]);router[_0x898d('0x11')]('/',auth[_0x898d('0xc')](),controller[_0x898d('0x12')]);router[_0x898d('0x11')](_0x898d('0xb'),auth[_0x898d('0xc')](),controller[_0x898d('0x13')]);router[_0x898d('0x11')]('/:id/actions',auth[_0x898d('0xc')](),controller[_0x898d('0x14')]);router['put'](_0x898d('0x9'),auth[_0x898d('0xc')](),controller[_0x898d('0x15')]);router[_0x898d('0x16')](_0x898d('0x9'),auth[_0x898d('0xc')](),controller[_0x898d('0x17')]);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 32c0bb4..9df542c 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 _0xd31a=['always','onlyIfOpen','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','DESC','ASC','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','sequelize','exports','name','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','STRING','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','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,*,*,*','ENUM'];(function(_0x535d2e,_0x5392e1){var _0x1bdca5=function(_0x920f8b){while(--_0x920f8b){_0x535d2e['push'](_0x535d2e['shift']());}};_0x1bdca5(++_0x5392e1);}(_0xd31a,0x73));var _0xad31=function(_0x55a7f6,_0xfe725e){_0x55a7f6=_0x55a7f6-0x0;var _0x1b1ac7=_0xd31a[_0x55a7f6];return _0x1b1ac7;};'use strict';var Sequelize=require(_0xad31('0x0'));module[_0xad31('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xad31('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize['ENUM'](_0xad31('0x3')),'allowNull':![],'defaultValue':_0xad31('0x3')},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xad31('0x4')],'defaultValue':0x0,'comment':_0xad31('0x5')},'limitCalls':{'type':Sequelize[_0xad31('0x6')](0x4)[_0xad31('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize[_0xad31('0x8')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xad31('0x8')]},'dialOriginateTimeout':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad31('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0xa')},'dialBusyMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0xb')},'dialNoAnswerMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xad31('0x7')],'defaultValue':0x3,'comment':_0xad31('0xc')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0xd')},'dialGlobalMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xad31('0xe')},'dialTimezone':{'type':Sequelize[_0xad31('0x8')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xad31('0x8')],'defaultValue':_0xad31('0xf')},'dialCheckDuplicateType':{'type':Sequelize[_0xad31('0x10')](_0xad31('0x11'),'never',_0xad31('0x12')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0xad31('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xad31('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xad31('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xad31('0x6')](0x9)[_0xad31('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0xad31('0x6')](0x9)[_0xad31('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xad31('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xad31('0x6')](0x9)[_0xad31('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xad31('0x6')](0x9)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xad31('0x15')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xad31('0x16')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xad31('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Word\x20Length'},'dialOrderByScheduledAt':{'type':Sequelize[_0xad31('0x10')](_0xad31('0x17'),_0xad31('0x18')),'defaultValue':_0xad31('0x17')},'dialPrefix':{'type':Sequelize[_0xad31('0x8')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Random\x20Last\x20Digit\x20(min:1,\x20max:15)'},'dialCutDigit':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xad31('0x19')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad31('0x1a')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0x1b')},'dialDropMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad31('0x1c')},'dialDropRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0x1d')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad31('0x1e')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xad31('0x1f')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0xad31('0x6')](0x3)[_0xad31('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xad31('0x20')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0xad31('0x6')](0x5)[_0xad31('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file +var _0x2470=['never','onlyIfOpen','Active/Disactive\x20AMD','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Abandoned\x20Retry\x20(min:1,\x20max:999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','sequelize','exports','name','ENUM','ivr','STRING','BOOLEAN','UNSIGNED','Max\x20200\x20calls.','INTEGER','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always'];(function(_0x3e09df,_0x57fc75){var _0x37576f=function(_0x3a5392){while(--_0x3a5392){_0x3e09df['push'](_0x3e09df['shift']());}};_0x37576f(++_0x57fc75);}(_0x2470,0x7e));var _0x0247=function(_0x38bdd2,_0x40686a){_0x38bdd2=_0x38bdd2-0x0;var _0x9b8d4d=_0x2470[_0x38bdd2];return _0x9b8d4d;};'use strict';var Sequelize=require(_0x0247('0x0'));module[_0x0247('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0247('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x0247('0x3')](_0x0247('0x4')),'allowNull':![],'defaultValue':_0x0247('0x4')},'description':{'type':Sequelize[_0x0247('0x5')]},'active':{'type':Sequelize[_0x0247('0x6')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize['INTEGER'](0x4)[_0x0247('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x0247('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x0247('0x5')]},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0247('0xa')},'dialCongestionMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0247('0xb')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0xc')},'dialBusyMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0xd')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x3,'comment':_0x0247('0xe')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0xf')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0247('0x5')],'defaultValue':_0x0247('0x10')},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0247('0x11'),_0x0247('0x12'),_0x0247('0x13')),'defaultValue':_0x0247('0x11')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x0247('0x14')},'dialAMDInitialSilence':{'type':Sequelize[_0x0247('0x9')](0x9)[_0x0247('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x0247('0x9')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':'#AMD\x20Greeting'},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0247('0x9')](0x9)[_0x0247('0x7')],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0247('0x15')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0247('0x9')](0x9)[_0x0247('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0247('0x16')},'dialAMDMinWordLength':{'type':Sequelize[_0x0247('0x9')](0x9)[_0x0247('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0247('0x17')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x0247('0x7')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x0247('0x18')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0247('0x19')},'dialAMDMaximumWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x0247('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0247('0x1a')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0247('0x1b')),'defaultValue':_0x0247('0x1c')},'dialPrefix':{'type':Sequelize[_0x0247('0x5')],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0247('0x1d')},'dialCutDigit':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0247('0x1e')},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0247('0x1f')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0x20')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Drop\x20Retry\x20(min:1,\x20max:999)'},'dialDropRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0x21')},'dialAbandonedMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0247('0x22')},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0247('0x23')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0247('0x9')](0x3)[_0x0247('0x7')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#AgentReject\x20Retry\x20(min:1,\x20max:999)'},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0247('0x9')](0x5)[_0x0247('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index 4b11cf2..ce3ac61 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 _0xee5b=['json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','destroy','then','get','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','rawAttributes','type','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','filter','includeAll','include','findAll','rows','catch','show','params','options','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','findOne','CmHopperHistory','getHopperFinals','CampaignId','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','fromQuery','phone','ContactId','select','field','NOW()','scheduledAt','CmListId','toString','ListId','from','cm_contacts','phone\x20IS\x20NOT\x20NULL','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper','onlyIfOpen','into','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','push','removeBlackLists','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end'];(function(_0x41d598,_0xc9655d){var _0x13ee34=function(_0x4e5bdb){while(--_0x4e5bdb){_0x41d598['push'](_0x41d598['shift']());}};_0x13ee34(++_0xc9655d);}(_0xee5b,0x1f4));var _0xbee5=function(_0x4750b4,_0xd3fcb6){_0x4750b4=_0x4750b4-0x0;var _0x48b94b=_0xee5b[_0x4750b4];return _0x48b94b;};'use strict';var pdf=require(_0xbee5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbee5('0x1'));var zipdir=require(_0xbee5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xbee5('0x3'));var moment=require(_0xbee5('0x4'));var BPromise=require(_0xbee5('0x5'));var Mustache=require(_0xbee5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xbee5('0x7'));var csv=require(_0xbee5('0x8'));var ejs=require(_0xbee5('0x9'));var fs=require('fs');var _=require(_0xbee5('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbee5('0xb'));var Papa=require(_0xbee5('0xc'));var Redis=require(_0xbee5('0xd'));var authService=require(_0xbee5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xbee5('0xf'));var hardwareService=require(_0xbee5('0x10'));var logger=require(_0xbee5('0x11'))(_0xbee5('0x12'));var utils=require(_0xbee5('0x13'));var config=require(_0xbee5('0x14'));var db=require(_0xbee5('0x15'))['db'];function respondWithStatusCode(_0x17ee3c,_0xcef158){_0xcef158=_0xcef158||0xcc;return function(_0x48f771){if(_0x48f771){return _0x17ee3c[_0xbee5('0x16')](_0xcef158);}return _0x17ee3c['status'](_0xcef158)[_0xbee5('0x17')]();};}function respondWithResult(_0x180edd,_0x8a268f){_0x8a268f=_0x8a268f||0xc8;return function(_0x593ecb){if(_0x593ecb){return _0x180edd['status'](_0x8a268f)[_0xbee5('0x18')](_0x593ecb);}};}function respondWithFilteredResult(_0x4cf5a8,_0x40afcb){return function(_0x5426c9){if(_0x5426c9){var _0x1a24bd=_0x5426c9[_0xbee5('0x19')],_0x141878=_0x40afcb[_0xbee5('0x1a')],_0xf676b1=_0x40afcb['offset']+_0x40afcb[_0xbee5('0x1b')],_0x53b269;if(_0xf676b1>=_0x1a24bd){_0xf676b1=_0x1a24bd;_0x53b269=0xc8;}else{_0x53b269=0xce;}_0x4cf5a8[_0xbee5('0x1c')](_0x53b269);return _0x4cf5a8[_0xbee5('0x1d')](_0xbee5('0x1e'),_0x141878+'-'+_0xf676b1+'/'+_0x1a24bd)[_0xbee5('0x18')](_0x5426c9);}return null;};}function patchUpdates(_0xac51f5){return function(_0x982404){try{jsonpatch[_0xbee5('0x1f')](_0x982404,_0xac51f5,!![]);}catch(_0x20cf52){return BPromise[_0xbee5('0x20')](_0x20cf52);}return _0x982404[_0xbee5('0x21')]();};}function saveUpdates(_0x117f10,_0x35d7d3){return function(_0x40a06){if(_0x40a06){return _0x40a06[_0xbee5('0x22')](_0x117f10)['then'](function(_0x550325){return _0x550325;});}return null;};}function removeEntity(_0x469a7a,_0x48bfb5){return function(_0x205491){if(_0x205491){return _0x205491[_0xbee5('0x23')]()[_0xbee5('0x24')](function(){var _0x2bfb0f=_0x205491[_0xbee5('0x25')]({'plain':!![]});var _0xb665df=_0xbee5('0x26');return db[_0xbee5('0x27')][_0xbee5('0x23')]({'where':{'type':_0xb665df,'resourceId':_0x2bfb0f['id']}})['then'](function(){return _0x205491;});})['then'](function(){_0x469a7a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50d774,_0x1af3de){return function(_0x18d7f4){if(!_0x18d7f4){_0x50d774[_0xbee5('0x16')](0x194);}return _0x18d7f4;};}function handleError(_0x28c74d,_0x169042){_0x169042=_0x169042||0x1f4;return function(_0x20e7e8){logger[_0xbee5('0x28')](_0x20e7e8['stack']);if(_0x20e7e8[_0xbee5('0x29')]){delete _0x20e7e8[_0xbee5('0x29')];}_0x28c74d[_0xbee5('0x1c')](_0x169042)[_0xbee5('0x2a')](_0x20e7e8);};}exports[_0xbee5('0x2b')]=function(_0x5f0419,_0x21b993){var _0x15ffb1={},_0xb7a077={},_0x136a00={'count':0x0,'rows':[]};var _0xa57f85=_[_0xbee5('0x2c')](db[_0xbee5('0x2d')][_0xbee5('0x2e')],function(_0x2ccb91){return{'name':_0x2ccb91['fieldName'],'type':_0x2ccb91[_0xbee5('0x2f')]['key']};});_0xb7a077[_0xbee5('0x30')]=_['map'](_0xa57f85,_0xbee5('0x29'));_0xb7a077['query']=_[_0xbee5('0x31')](_0x5f0419['query']);_0xb7a077[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0xb7a077[_0xbee5('0x30')],_0xb7a077[_0xbee5('0x34')]);_0x15ffb1['attributes']=_[_0xbee5('0x33')](_0xb7a077[_0xbee5('0x30')],qs[_0xbee5('0x35')](_0x5f0419[_0xbee5('0x34')]['fields']));_0x15ffb1[_0xbee5('0x36')]=_0x15ffb1[_0xbee5('0x36')][_0xbee5('0x37')]?_0x15ffb1[_0xbee5('0x36')]:_0xb7a077['model'];if(!_0x5f0419[_0xbee5('0x34')][_0xbee5('0x38')](_0xbee5('0x39'))){_0x15ffb1[_0xbee5('0x1b')]=qs['limit'](_0x5f0419[_0xbee5('0x34')]['limit']);_0x15ffb1[_0xbee5('0x1a')]=qs['offset'](_0x5f0419['query']['offset']);}_0x15ffb1[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x5f0419[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x15ffb1[_0xbee5('0x3c')]=qs[_0xbee5('0x32')](_[_0xbee5('0x3d')](_0x5f0419[_0xbee5('0x34')],_0xb7a077['filters']));if(_0x5f0419[_0xbee5('0x34')]['filter']){_0x15ffb1[_0xbee5('0x3c')]=_[_0xbee5('0x3e')](_0x15ffb1[_0xbee5('0x3c')],{'$or':_[_0xbee5('0x2c')](_0xa57f85,function(_0x4a89ac){if(_0x4a89ac[_0xbee5('0x2f')]!=='VIRTUAL'){var _0x565e9f={};_0x565e9f[_0x4a89ac[_0xbee5('0x29')]]={'$like':'%'+_0x5f0419[_0xbee5('0x34')][_0xbee5('0x3f')]+'%'};return _0x565e9f;}})});}_0x15ffb1=_[_0xbee5('0x3e')]({},_0x15ffb1,_0x5f0419['options']);var _0xf3dd5={'where':_0x15ffb1[_0xbee5('0x3c')]};return db[_0xbee5('0x2d')][_0xbee5('0x19')](_0xf3dd5)[_0xbee5('0x24')](function(_0x25cf17){_0x136a00[_0xbee5('0x19')]=_0x25cf17;if(_0x5f0419[_0xbee5('0x34')][_0xbee5('0x40')]){_0x15ffb1[_0xbee5('0x41')]=[{'all':!![]}];}return db['Campaign'][_0xbee5('0x42')](_0x15ffb1);})[_0xbee5('0x24')](function(_0x5637e0){_0x136a00[_0xbee5('0x43')]=_0x5637e0;return _0x136a00;})[_0xbee5('0x24')](respondWithFilteredResult(_0x21b993,_0x15ffb1))[_0xbee5('0x44')](handleError(_0x21b993,null));};exports[_0xbee5('0x45')]=function(_0x4dad75,_0x4cfe54){var _0x4b4641={'raw':![],'where':{'id':_0x4dad75[_0xbee5('0x46')]['id']}},_0x138a40={};_0x138a40[_0xbee5('0x30')]=_[_0xbee5('0x31')](db[_0xbee5('0x2d')][_0xbee5('0x2e')]);_0x138a40[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x4dad75[_0xbee5('0x34')]);_0x138a40['filters']=_['intersection'](_0x138a40[_0xbee5('0x30')],_0x138a40['query']);_0x4b4641[_0xbee5('0x36')]=_[_0xbee5('0x33')](_0x138a40['model'],qs[_0xbee5('0x35')](_0x4dad75[_0xbee5('0x34')]['fields']));_0x4b4641['attributes']=_0x4b4641[_0xbee5('0x36')][_0xbee5('0x37')]?_0x4b4641['attributes']:_0x138a40[_0xbee5('0x30')];if(_0x4dad75[_0xbee5('0x34')]['includeAll']){_0x4b4641[_0xbee5('0x41')]=[{'all':!![]}];}_0x4b4641=_[_0xbee5('0x3e')]({},_0x4b4641,_0x4dad75[_0xbee5('0x47')]);return db[_0xbee5('0x2d')][_0xbee5('0x48')](_0x4b4641)[_0xbee5('0x24')](handleEntityNotFound(_0x4cfe54,null))[_0xbee5('0x24')](respondWithResult(_0x4cfe54,null))['catch'](handleError(_0x4cfe54,null));};exports[_0xbee5('0x49')]=function(_0x34f01d,_0x27ea7b){return db[_0xbee5('0x2d')]['create'](_0x34f01d[_0xbee5('0x4a')],{})[_0xbee5('0x24')](function(_0xa1736c){var _0x4aa21a=_0x34f01d[_0xbee5('0x4b')][_0xbee5('0x25')]({'plain':!![]});if(!_0x4aa21a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4aa21a['role']==='user'){var _0x3a27bb=_0xa1736c['get']({'plain':!![]});var _0x1a4e78=_0xbee5('0x26');return db[_0xbee5('0x4c')][_0xbee5('0x48')]({'where':{'name':_0x1a4e78,'userProfileId':_0x4aa21a[_0xbee5('0x4d')]},'raw':!![]})[_0xbee5('0x24')](function(_0x55e654){if(_0x55e654&&_0x55e654[_0xbee5('0x4e')]===0x0){return db[_0xbee5('0x27')][_0xbee5('0x49')]({'name':_0x3a27bb[_0xbee5('0x29')],'resourceId':_0x3a27bb['id'],'type':_0x55e654['name'],'sectionId':_0x55e654['id']},{})[_0xbee5('0x24')](function(){return _0xa1736c;});}else{return _0xa1736c;}})['catch'](function(_0x358a3a){logger[_0xbee5('0x28')](_0xbee5('0x4f'),_0x358a3a);throw _0x358a3a;});}return _0xa1736c;})[_0xbee5('0x24')](respondWithResult(_0x27ea7b,0xc9))[_0xbee5('0x44')](handleError(_0x27ea7b,null));};exports[_0xbee5('0x50')]=function(_0xe8902,_0x35f1d1){var _0x364ba2={'where':{'id':_0xe8902[_0xbee5('0x46')]['id']}},_0x31abcd={};_0x31abcd[_0xbee5('0x30')]=_[_0xbee5('0x31')](db[_0xbee5('0x2d')][_0xbee5('0x2e')]);_0x364ba2['attributes']=_[_0xbee5('0x33')](_0x31abcd[_0xbee5('0x30')],qs[_0xbee5('0x35')](_0xe8902['query'][_0xbee5('0x35')]));_0x364ba2[_0xbee5('0x36')]=_0x364ba2[_0xbee5('0x36')]['length']?_0x364ba2[_0xbee5('0x36')]:_0x31abcd['model'];if(_0xe8902[_0xbee5('0x34')]['includeAll']){_0x364ba2[_0xbee5('0x41')]=[{'all':!![]}];}_0x364ba2=_[_0xbee5('0x3e')]({},_0x364ba2,_0xe8902[_0xbee5('0x47')]);return db['Campaign']['find'](_0x364ba2)['then'](handleEntityNotFound(_0x35f1d1,null))[_0xbee5('0x24')](function(_0x684cd4){if(_0x684cd4){var _0xbc3da7=_0x684cd4['get']({'plain':!![]});_0xbc3da7=qs[_0xbee5('0x51')](_0xbc3da7,['id','createdAt',_0xbee5('0x52')]);_0xe8902[_0xbee5('0x4a')]=_[_0xbee5('0x51')](_0xe8902['body'],['id',_0xbee5('0x53'),_0xbee5('0x52')]);return db[_0xbee5('0x2d')][_0xbee5('0x49')](_[_0xbee5('0x3e')](_0xbc3da7,_0xe8902[_0xbee5('0x4a')]),{'include':_0xe8902[_0xbee5('0x34')][_0xbee5('0x40')]?[{'all':!![]}]:undefined})[_0xbee5('0x24')](function(_0x111027){var _0x38100e=_0xe8902[_0xbee5('0x4b')][_0xbee5('0x25')]({'plain':!![]});if(!_0x38100e)throw new Error(_0xbee5('0x54'));if(_0x38100e[_0xbee5('0x55')]===_0xbee5('0x4b')){var _0x32a8d2=_0x111027['get']({'plain':!![]});var _0x12a9bd='IvrCampaigns';return db['UserProfileSection'][_0xbee5('0x48')]({'where':{'name':_0x12a9bd,'userProfileId':_0x38100e[_0xbee5('0x4d')]},'raw':!![]})['then'](function(_0x5a2544){if(_0x5a2544&&_0x5a2544[_0xbee5('0x4e')]===0x0){return db['UserProfileResource'][_0xbee5('0x49')]({'name':_0x32a8d2[_0xbee5('0x29')],'resourceId':_0x32a8d2['id'],'type':_0x5a2544['name'],'sectionId':_0x5a2544['id']},{})[_0xbee5('0x24')](function(){return _0x111027;});}else{return _0x111027;}})[_0xbee5('0x44')](function(_0x1119af){logger[_0xbee5('0x28')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1119af);throw _0x1119af;});}return _0x111027;});}})[_0xbee5('0x24')](respondWithResult(_0x35f1d1,0xc9))['catch'](handleError(_0x35f1d1,null));};exports[_0xbee5('0x22')]=function(_0x465ec8,_0x5c4c2c){if(_0x465ec8[_0xbee5('0x4a')]['id']){delete _0x465ec8[_0xbee5('0x4a')]['id'];}return db['Campaign'][_0xbee5('0x48')]({'where':{'id':_0x465ec8[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x5c4c2c,null))[_0xbee5('0x24')](saveUpdates(_0x465ec8['body'],null))[_0xbee5('0x24')](respondWithResult(_0x5c4c2c,null))['catch'](handleError(_0x5c4c2c,null));};exports[_0xbee5('0x23')]=function(_0x536269,_0x541414){return db[_0xbee5('0x2d')][_0xbee5('0x48')]({'where':{'id':_0x536269[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x541414,null))[_0xbee5('0x24')](removeEntity(_0x541414,null))[_0xbee5('0x44')](handleError(_0x541414,null));};exports['getHoppers']=function(_0x190a43,_0x1d434b,_0x36586a){var _0x70f14d={'raw':!![],'where':{}};var _0x34c020={};var _0xf77d34={'count':0x0,'rows':[]};return db[_0xbee5('0x2d')][_0xbee5('0x56')]({'where':{'id':_0x190a43[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x1d434b,null))[_0xbee5('0x24')](function(_0xe9796a){if(_0xe9796a){_0x34c020[_0xbee5('0x30')]=_[_0xbee5('0x31')](db['CmHopper'][_0xbee5('0x2e')]);_0x34c020[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x190a43[_0xbee5('0x34')]);_0x34c020[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x34c020[_0xbee5('0x30')],_0x34c020[_0xbee5('0x34')]);_0x70f14d[_0xbee5('0x36')]=_[_0xbee5('0x33')](_0x34c020[_0xbee5('0x30')],qs[_0xbee5('0x35')](_0x190a43['query'][_0xbee5('0x35')]));_0x70f14d[_0xbee5('0x36')]=_0x70f14d['attributes'][_0xbee5('0x37')]?_0x70f14d['attributes']:_0x34c020[_0xbee5('0x30')];if(!_0x190a43[_0xbee5('0x34')]['hasOwnProperty'](_0xbee5('0x39'))){_0x70f14d['limit']=qs['limit'](_0x190a43['query']['limit']);_0x70f14d['offset']=qs['offset'](_0x190a43[_0xbee5('0x34')][_0xbee5('0x1a')]);}_0x70f14d[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x190a43[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x70f14d[_0xbee5('0x3c')]=qs[_0xbee5('0x32')](_[_0xbee5('0x3d')](_0x190a43[_0xbee5('0x34')],_0x34c020[_0xbee5('0x32')]));_0x70f14d[_0xbee5('0x3c')]['CampaignId']=_0xe9796a['id'];if(_0x190a43[_0xbee5('0x34')][_0xbee5('0x3f')]){_0x70f14d['where']=_['merge'](_0x70f14d[_0xbee5('0x3c')],{'$or':_[_0xbee5('0x2c')](_0x70f14d[_0xbee5('0x36')],function(_0x5e5cba){var _0x323fde={};_0x323fde[_0x5e5cba]={'$like':'%'+_0x190a43[_0xbee5('0x34')][_0xbee5('0x3f')]+'%'};return _0x323fde;})});}_0x70f14d=_['merge']({},_0x70f14d,_0x190a43['options']);return db['CmHopper'][_0xbee5('0x19')]({'where':_0x70f14d[_0xbee5('0x3c')]})[_0xbee5('0x24')](function(_0x13cb41){_0xf77d34[_0xbee5('0x19')]=_0x13cb41;if(_0x190a43[_0xbee5('0x34')][_0xbee5('0x40')]){_0x70f14d[_0xbee5('0x41')]=[{'all':!![]}];}return db['CmHopper']['findAll'](_0x70f14d);})[_0xbee5('0x24')](function(_0x1783e5){_0xf77d34['rows']=_0x1783e5;return _0xf77d34;});}})['then'](respondWithFilteredResult(_0x1d434b,_0x70f14d))[_0xbee5('0x44')](handleError(_0x1d434b,null));};exports['getHopperHistories']=function(_0x5dd04f,_0x382cd4,_0x525472){var _0x2b4ac9={'raw':!![],'where':{}};var _0x2a8798={};var _0x58840d={'count':0x0,'rows':[]};return db[_0xbee5('0x2d')][_0xbee5('0x56')]({'where':{'id':_0x5dd04f[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x382cd4,null))[_0xbee5('0x24')](function(_0x589d16){if(_0x589d16){_0x2a8798['model']=_[_0xbee5('0x31')](db['CmHopperHistory'][_0xbee5('0x2e')]);_0x2a8798['query']=_[_0xbee5('0x31')](_0x5dd04f[_0xbee5('0x34')]);_0x2a8798[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x2a8798[_0xbee5('0x30')],_0x2a8798[_0xbee5('0x34')]);_0x2b4ac9[_0xbee5('0x36')]=_[_0xbee5('0x33')](_0x2a8798[_0xbee5('0x30')],qs[_0xbee5('0x35')](_0x5dd04f[_0xbee5('0x34')][_0xbee5('0x35')]));_0x2b4ac9['attributes']=_0x2b4ac9[_0xbee5('0x36')][_0xbee5('0x37')]?_0x2b4ac9[_0xbee5('0x36')]:_0x2a8798[_0xbee5('0x30')];if(!_0x5dd04f['query'][_0xbee5('0x38')](_0xbee5('0x39'))){_0x2b4ac9[_0xbee5('0x1b')]=qs[_0xbee5('0x1b')](_0x5dd04f[_0xbee5('0x34')][_0xbee5('0x1b')]);_0x2b4ac9[_0xbee5('0x1a')]=qs[_0xbee5('0x1a')](_0x5dd04f['query'][_0xbee5('0x1a')]);}_0x2b4ac9[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x5dd04f[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x2b4ac9[_0xbee5('0x3c')]=qs[_0xbee5('0x32')](_[_0xbee5('0x3d')](_0x5dd04f[_0xbee5('0x34')],_0x2a8798[_0xbee5('0x32')]));_0x2b4ac9[_0xbee5('0x3c')]['CampaignId']=_0x589d16['id'];if(_0x5dd04f[_0xbee5('0x34')][_0xbee5('0x3f')]){_0x2b4ac9['where']=_[_0xbee5('0x3e')](_0x2b4ac9[_0xbee5('0x3c')],{'$or':_[_0xbee5('0x2c')](_0x2b4ac9['attributes'],function(_0x424bae){var _0x6a41d8={};_0x6a41d8[_0x424bae]={'$like':'%'+_0x5dd04f[_0xbee5('0x34')][_0xbee5('0x3f')]+'%'};return _0x6a41d8;})});}_0x2b4ac9=_[_0xbee5('0x3e')]({},_0x2b4ac9,_0x5dd04f[_0xbee5('0x47')]);return db[_0xbee5('0x57')][_0xbee5('0x19')]({'where':_0x2b4ac9[_0xbee5('0x3c')]})[_0xbee5('0x24')](function(_0x1f9e1d){_0x58840d[_0xbee5('0x19')]=_0x1f9e1d;if(_0x5dd04f['query'][_0xbee5('0x40')]){_0x2b4ac9['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xbee5('0x42')](_0x2b4ac9);})[_0xbee5('0x24')](function(_0x5aa8f7){_0x58840d['rows']=_0x5aa8f7;return _0x58840d;});}})[_0xbee5('0x24')](respondWithFilteredResult(_0x382cd4,_0x2b4ac9))[_0xbee5('0x44')](handleError(_0x382cd4,null));};exports[_0xbee5('0x58')]=function(_0x2947b5,_0x317712,_0x360076){var _0x14d8ec={'raw':!![],'where':{}};var _0x48c92f={};var _0x5eb60d={'count':0x0,'rows':[]};return db[_0xbee5('0x2d')][_0xbee5('0x56')]({'where':{'id':_0x2947b5[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x317712,null))[_0xbee5('0x24')](function(_0x3a034b){if(_0x3a034b){_0x48c92f[_0xbee5('0x30')]=_['keys'](db['CmHopperFinal']['rawAttributes']);_0x48c92f[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x2947b5[_0xbee5('0x34')]);_0x48c92f[_0xbee5('0x32')]=_['intersection'](_0x48c92f[_0xbee5('0x30')],_0x48c92f[_0xbee5('0x34')]);_0x14d8ec[_0xbee5('0x36')]=_['intersection'](_0x48c92f[_0xbee5('0x30')],qs['fields'](_0x2947b5[_0xbee5('0x34')][_0xbee5('0x35')]));_0x14d8ec['attributes']=_0x14d8ec['attributes']['length']?_0x14d8ec[_0xbee5('0x36')]:_0x48c92f['model'];if(!_0x2947b5[_0xbee5('0x34')][_0xbee5('0x38')]('nolimit')){_0x14d8ec['limit']=qs[_0xbee5('0x1b')](_0x2947b5['query'][_0xbee5('0x1b')]);_0x14d8ec[_0xbee5('0x1a')]=qs[_0xbee5('0x1a')](_0x2947b5['query'][_0xbee5('0x1a')]);}_0x14d8ec[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x2947b5[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x14d8ec[_0xbee5('0x3c')]=qs['filters'](_['pick'](_0x2947b5[_0xbee5('0x34')],_0x48c92f['filters']));_0x14d8ec['where'][_0xbee5('0x59')]=_0x3a034b['id'];if(_0x2947b5[_0xbee5('0x34')][_0xbee5('0x3f')]){_0x14d8ec[_0xbee5('0x3c')]=_[_0xbee5('0x3e')](_0x14d8ec[_0xbee5('0x3c')],{'$or':_[_0xbee5('0x2c')](_0x14d8ec['attributes'],function(_0x4ec289){var _0x4f6e5d={};_0x4f6e5d[_0x4ec289]={'$like':'%'+_0x2947b5['query'][_0xbee5('0x3f')]+'%'};return _0x4f6e5d;})});}_0x14d8ec=_[_0xbee5('0x3e')]({},_0x14d8ec,_0x2947b5[_0xbee5('0x47')]);return db['CmHopperFinal'][_0xbee5('0x19')]({'where':_0x14d8ec[_0xbee5('0x3c')]})[_0xbee5('0x24')](function(_0x55405a){_0x5eb60d[_0xbee5('0x19')]=_0x55405a;if(_0x2947b5[_0xbee5('0x34')][_0xbee5('0x40')]){_0x14d8ec[_0xbee5('0x41')]=[{'all':!![]}];}return db[_0xbee5('0x5a')]['findAll'](_0x14d8ec);})['then'](function(_0x5940dc){_0x5eb60d['rows']=_0x5940dc;return _0x5eb60d;});}})[_0xbee5('0x24')](respondWithFilteredResult(_0x317712,_0x14d8ec))[_0xbee5('0x44')](handleError(_0x317712,null));};exports[_0xbee5('0x5b')]=function(_0x1f80e2,_0x1d110b,_0xd70ec6){var _0x4aaf7={'raw':!![],'where':{}};var _0x214e98={};var _0x1830b8={'count':0x0,'rows':[]};return db[_0xbee5('0x2d')][_0xbee5('0x56')]({'where':{'id':_0x1f80e2['params']['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x1d110b,null))[_0xbee5('0x24')](function(_0x2f4ad4){if(_0x2f4ad4){_0x214e98[_0xbee5('0x30')]=_[_0xbee5('0x31')](db[_0xbee5('0x5c')][_0xbee5('0x2e')]);_0x214e98[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x1f80e2[_0xbee5('0x34')]);_0x214e98[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x214e98[_0xbee5('0x30')],_0x214e98[_0xbee5('0x34')]);_0x4aaf7[_0xbee5('0x36')]=_[_0xbee5('0x33')](_0x214e98[_0xbee5('0x30')],qs['fields'](_0x1f80e2[_0xbee5('0x34')][_0xbee5('0x35')]));_0x4aaf7[_0xbee5('0x36')]=_0x4aaf7[_0xbee5('0x36')][_0xbee5('0x37')]?_0x4aaf7[_0xbee5('0x36')]:_0x214e98[_0xbee5('0x30')];if(!_0x1f80e2['query'][_0xbee5('0x38')](_0xbee5('0x39'))){_0x4aaf7[_0xbee5('0x1b')]=qs[_0xbee5('0x1b')](_0x1f80e2['query'][_0xbee5('0x1b')]);_0x4aaf7['offset']=qs[_0xbee5('0x1a')](_0x1f80e2[_0xbee5('0x34')]['offset']);}_0x4aaf7[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x1f80e2[_0xbee5('0x34')]['sort']);_0x4aaf7[_0xbee5('0x3c')]=qs['filters'](_[_0xbee5('0x3d')](_0x1f80e2[_0xbee5('0x34')],_0x214e98[_0xbee5('0x32')]));_0x4aaf7['where']['CampaignId']=_0x2f4ad4['id'];if(_0x1f80e2[_0xbee5('0x34')]['filter']){_0x4aaf7[_0xbee5('0x3c')]=_['merge'](_0x4aaf7[_0xbee5('0x3c')],{'$or':_[_0xbee5('0x2c')](_0x4aaf7[_0xbee5('0x36')],function(_0x436296){var _0xed19ba={};_0xed19ba[_0x436296]={'$like':'%'+_0x1f80e2['query'][_0xbee5('0x3f')]+'%'};return _0xed19ba;})});}_0x4aaf7=_[_0xbee5('0x3e')]({},_0x4aaf7,_0x1f80e2['options']);return db['CmHopperBlack'][_0xbee5('0x19')]({'where':_0x4aaf7[_0xbee5('0x3c')]})[_0xbee5('0x24')](function(_0x58e6e1){_0x1830b8['count']=_0x58e6e1;if(_0x1f80e2[_0xbee5('0x34')]['includeAll']){_0x4aaf7[_0xbee5('0x41')]=[{'all':!![]}];}return db[_0xbee5('0x5c')][_0xbee5('0x42')](_0x4aaf7);})['then'](function(_0x12a6cb){_0x1830b8[_0xbee5('0x43')]=_0x12a6cb;return _0x1830b8;});}})[_0xbee5('0x24')](respondWithFilteredResult(_0x1d110b,_0x4aaf7))['catch'](handleError(_0x1d110b,null));};exports[_0xbee5('0x5d')]=function(_0x12780d,_0x58468a,_0x4858d4){var _0x575b3d={};var _0x4c8d80={};var _0x260523;var _0x30121c;return db[_0xbee5('0x2d')][_0xbee5('0x56')]({'where':{'id':_0x12780d[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x58468a,null))[_0xbee5('0x24')](function(_0x24e602){if(_0x24e602){_0x260523=_0x24e602;_0x4c8d80['model']=_[_0xbee5('0x31')](db[_0xbee5('0x5e')]['rawAttributes']);_0x4c8d80[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x12780d['query']);_0x4c8d80[_0xbee5('0x32')]=_[_0xbee5('0x33')](_0x4c8d80['model'],_0x4c8d80[_0xbee5('0x34')]);_0x575b3d[_0xbee5('0x36')]=_['intersection'](_0x4c8d80['model'],qs[_0xbee5('0x35')](_0x12780d[_0xbee5('0x34')][_0xbee5('0x35')]));_0x575b3d[_0xbee5('0x36')]=_0x575b3d[_0xbee5('0x36')]['length']?_0x575b3d[_0xbee5('0x36')]:_0x4c8d80[_0xbee5('0x30')];_0x575b3d[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x12780d[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x575b3d['where']=qs[_0xbee5('0x32')](_[_0xbee5('0x3d')](_0x12780d[_0xbee5('0x34')],_0x4c8d80[_0xbee5('0x32')]));if(_0x12780d['query'][_0xbee5('0x3f')]){_0x575b3d[_0xbee5('0x3c')]=_['merge'](_0x575b3d['where'],{'$or':_[_0xbee5('0x2c')](_0x575b3d['attributes'],function(_0x5be1ca){var _0x44febc={};_0x44febc[_0x5be1ca]={'$like':'%'+_0x12780d['query'][_0xbee5('0x3f')]+'%'};return _0x44febc;})});}_0x575b3d=_[_0xbee5('0x3e')]({},_0x575b3d,_0x12780d[_0xbee5('0x47')]);return _0x260523[_0xbee5('0x5d')](_0x575b3d);}})[_0xbee5('0x24')](function(_0x2c38dc){if(_0x2c38dc){_0x30121c=_0x2c38dc['length'];if(!_0x12780d['query']['hasOwnProperty'](_0xbee5('0x39'))){_0x575b3d[_0xbee5('0x1b')]=qs[_0xbee5('0x1b')](_0x12780d[_0xbee5('0x34')]['limit']);_0x575b3d[_0xbee5('0x1a')]=qs[_0xbee5('0x1a')](_0x12780d[_0xbee5('0x34')][_0xbee5('0x1a')]);}return _0x260523['getLists'](_0x575b3d);}})[_0xbee5('0x24')](function(_0xfb815b){if(_0xfb815b){return _0xfb815b?{'count':_0x30121c,'rows':_0xfb815b}:null;}})[_0xbee5('0x24')](respondWithResult(_0x58468a,null))[_0xbee5('0x44')](handleError(_0x58468a,null));};exports[_0xbee5('0x5f')]=function(_0x2b7b54,_0xd0296a,_0x5ac370){var _0x2564fc,_0x187f08;return db[_0xbee5('0x2d')][_0xbee5('0x48')]({'where':{'id':_0x2b7b54[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0xd0296a,null))['then'](function(_0x1cb162){if(_0x1cb162){_0x187f08=_0x1cb162;return _0x1cb162['addLists'](_0x2b7b54['body']['ids'],_[_0xbee5('0x51')](_0x2b7b54[_0xbee5('0x4a')],[_0xbee5('0x60'),'id'])||{});}return null;})['spread'](function(_0x302eef){var _0x512089;_0x2564fc=_0x302eef||[];var _0xd0b74d=[];if(_0x302eef){for(var _0x3b0e00=0x0;_0x3b0e00<_0x302eef['length'];_0x3b0e00+=0x1){var _0x929027=_0x302eef[_0x3b0e00][_0xbee5('0x25')]({'plain':!![]});_0x187f08['dialCheckDuplicateType']=_0x2b7b54['body'][_0xbee5('0x61')]?_0x2b7b54[_0xbee5('0x4a')]['dialCheckDuplicateType']:_0x187f08['dialCheckDuplicateType'];switch(_0x187f08[_0xbee5('0x61')]){case _0xbee5('0x62'):_0x512089=squel[_0xbee5('0x63')]()['into']('cm_hopper')[_0xbee5('0x64')]([_0xbee5('0x65'),'scheduledAt',_0xbee5('0x66'),'ListId','CampaignId',_0xbee5('0x53'),'updatedAt'],squel[_0xbee5('0x67')]()[_0xbee5('0x68')](_0xbee5('0x65'),'phone')['field'](_0xbee5('0x69'),_0xbee5('0x6a'))[_0xbee5('0x68')]('id',_0xbee5('0x66'))[_0xbee5('0x68')](_0x929027[_0xbee5('0x6b')][_0xbee5('0x6c')](),_0xbee5('0x6d'))[_0xbee5('0x68')](_0x2b7b54[_0xbee5('0x46')]['id'][_0xbee5('0x6c')](),_0xbee5('0x59'))['field'](_0xbee5('0x69'),_0xbee5('0x53'))[_0xbee5('0x68')]('NOW()','updatedAt')[_0xbee5('0x6e')](_0xbee5('0x6f'))[_0xbee5('0x3c')]('deletedAt\x20IS\x20NULL')['where']('ListId\x20=\x20?',_0x929027[_0xbee5('0x6b')][_0xbee5('0x6c')]())[_0xbee5('0x3c')](_0xbee5('0x70'))[_0xbee5('0x3c')]('phone\x20NOT\x20IN\x20(?)',squel[_0xbee5('0x67')]()['field'](_0xbee5('0x71'))['from'](_0xbee5('0x72'))[_0xbee5('0x3c')](_0xbee5('0x73'),_0x2b7b54['params']['id'][_0xbee5('0x6c')]()))[_0xbee5('0x3c')](_0xbee5('0x74'),squel[_0xbee5('0x67')]()[_0xbee5('0x68')]('COALESCE(phone,\x27\x27)')[_0xbee5('0x6e')](_0xbee5('0x75'))[_0xbee5('0x3c')](_0xbee5('0x73'),_0x2b7b54[_0xbee5('0x46')]['id'][_0xbee5('0x6c')]())))[_0xbee5('0x6c')]();break;case _0xbee5('0x76'):_0x512089=squel[_0xbee5('0x63')]()[_0xbee5('0x77')](_0xbee5('0x75'))['fromQuery']([_0xbee5('0x65'),_0xbee5('0x6a'),'ContactId',_0xbee5('0x6d'),_0xbee5('0x59'),_0xbee5('0x53'),'updatedAt'],squel['select']()[_0xbee5('0x68')](_0xbee5('0x65'),_0xbee5('0x65'))[_0xbee5('0x68')](_0xbee5('0x69'),_0xbee5('0x6a'))[_0xbee5('0x68')]('id',_0xbee5('0x66'))['field'](_0x929027[_0xbee5('0x6b')]['toString'](),_0xbee5('0x6d'))['field'](_0x2b7b54[_0xbee5('0x46')]['id']['toString'](),_0xbee5('0x59'))[_0xbee5('0x68')](_0xbee5('0x69'),_0xbee5('0x53'))[_0xbee5('0x68')](_0xbee5('0x69'),_0xbee5('0x52'))[_0xbee5('0x6e')](_0xbee5('0x6f'))['where'](_0xbee5('0x78'))[_0xbee5('0x3c')](_0xbee5('0x79'),_0x929027[_0xbee5('0x6b')][_0xbee5('0x6c')]())[_0xbee5('0x3c')](_0xbee5('0x70'))['where'](_0xbee5('0x74'),squel[_0xbee5('0x67')]()[_0xbee5('0x68')]('COALESCE(phone,\x27\x27)')['from']('cm_hopper')['where']('CampaignId\x20=\x20?',_0x2b7b54[_0xbee5('0x46')]['id']['toString']())))['toString']();break;default:_0x512089=squel[_0xbee5('0x63')]()['into']('cm_hopper')[_0xbee5('0x64')]([_0xbee5('0x65'),_0xbee5('0x6a'),'ContactId',_0xbee5('0x6d'),_0xbee5('0x59'),_0xbee5('0x53'),_0xbee5('0x52')],squel[_0xbee5('0x67')]()[_0xbee5('0x68')](_0xbee5('0x65'),_0xbee5('0x65'))['field'](_0xbee5('0x69'),_0xbee5('0x6a'))[_0xbee5('0x68')]('id',_0xbee5('0x66'))['field'](_0x929027[_0xbee5('0x6b')][_0xbee5('0x6c')](),_0xbee5('0x6d'))[_0xbee5('0x68')](_0x2b7b54['params']['id'][_0xbee5('0x6c')](),_0xbee5('0x59'))[_0xbee5('0x68')]('NOW()','createdAt')[_0xbee5('0x68')](_0xbee5('0x69'),_0xbee5('0x52'))[_0xbee5('0x6e')]('cm_contacts')[_0xbee5('0x3c')](_0xbee5('0x78'))['where'](_0xbee5('0x79'),_0x929027[_0xbee5('0x6b')][_0xbee5('0x6c')]())[_0xbee5('0x3c')]('phone\x20IS\x20NOT\x20NULL'))[_0xbee5('0x6c')]();}_0xd0b74d['push'](db[_0xbee5('0x7a')][_0xbee5('0x34')](_0x512089));}return BPromise[_0xbee5('0x7b')](_0xd0b74d);}})['then'](function(){return _0x2564fc;})[_0xbee5('0x24')](respondWithResult(_0xd0296a,null))[_0xbee5('0x44')](handleError(_0xd0296a,null));};exports[_0xbee5('0x7c')]=function(_0x151878,_0x3ce44f,_0x1594d5){return db[_0xbee5('0x2d')][_0xbee5('0x48')]({'where':{'id':_0x151878[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x3ce44f,null))[_0xbee5('0x24')](function(_0xa21b35){if(_0xa21b35){return _0xa21b35[_0xbee5('0x7c')](_0x151878[_0xbee5('0x34')][_0xbee5('0x60')]);}})[_0xbee5('0x24')](function(_0x5b2378){if(_0x5b2378){return db['CmHopper'][_0xbee5('0x23')]({'where':{'ListId':_0x151878[_0xbee5('0x34')][_0xbee5('0x60')],'CampaignId':_0x151878[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](function(){return _0x5b2378;});}})[_0xbee5('0x24')](respondWithStatusCode(_0x3ce44f,null))['catch'](handleError(_0x3ce44f,null));};exports[_0xbee5('0x7d')]=function(_0x2ae358,_0x4698fb,_0x570243){var _0x590f7={'raw':!![],'where':{}};var _0x2b211e={};var _0x422351={'count':0x0,'rows':[]};return db[_0xbee5('0x2d')]['findOne']({'where':{'id':_0x2ae358[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x4698fb,null))[_0xbee5('0x24')](function(_0x9e9914){if(_0x9e9914){_0x2b211e[_0xbee5('0x30')]=_[_0xbee5('0x31')](db[_0xbee5('0x5e')][_0xbee5('0x2e')]);_0x2b211e[_0xbee5('0x34')]=_[_0xbee5('0x31')](_0x2ae358[_0xbee5('0x34')]);_0x2b211e[_0xbee5('0x32')]=_['intersection'](_0x2b211e[_0xbee5('0x30')],_0x2b211e['query']);_0x590f7[_0xbee5('0x36')]=_[_0xbee5('0x33')](_0x2b211e['model'],qs[_0xbee5('0x35')](_0x2ae358[_0xbee5('0x34')][_0xbee5('0x35')]));_0x590f7[_0xbee5('0x36')]=_0x590f7['attributes'][_0xbee5('0x37')]?_0x590f7['attributes']:_0x2b211e[_0xbee5('0x30')];if(!_0x2ae358[_0xbee5('0x34')][_0xbee5('0x38')]('nolimit')){_0x590f7[_0xbee5('0x1b')]=qs[_0xbee5('0x1b')](_0x2ae358['query']['limit']);_0x590f7['offset']=qs[_0xbee5('0x1a')](_0x2ae358['query'][_0xbee5('0x1a')]);}_0x590f7[_0xbee5('0x3a')]=qs[_0xbee5('0x3b')](_0x2ae358[_0xbee5('0x34')][_0xbee5('0x3b')]);_0x590f7[_0xbee5('0x3c')]=qs['filters'](_[_0xbee5('0x3d')](_0x2ae358[_0xbee5('0x34')],_0x2b211e[_0xbee5('0x32')]));_0x590f7[_0xbee5('0x3c')][_0xbee5('0x59')]=_0x9e9914['id'];if(_0x2ae358[_0xbee5('0x34')][_0xbee5('0x3f')]){_0x590f7[_0xbee5('0x3c')]=_[_0xbee5('0x3e')](_0x590f7[_0xbee5('0x3c')],{'$or':_['map'](_0x590f7[_0xbee5('0x36')],function(_0x547714){var _0x1b7cc2={};_0x1b7cc2[_0x547714]={'$like':'%'+_0x2ae358[_0xbee5('0x34')]['filter']+'%'};return _0x1b7cc2;})});}_0x590f7=_['merge']({},_0x590f7,_0x2ae358[_0xbee5('0x47')]);return db['CmList'][_0xbee5('0x19')]({'where':_0x590f7[_0xbee5('0x3c')]})[_0xbee5('0x24')](function(_0x46c595){_0x422351[_0xbee5('0x19')]=_0x46c595;if(_0x2ae358[_0xbee5('0x34')]['includeAll']){_0x590f7[_0xbee5('0x41')]=[{'all':!![]}];}return db['CmList'][_0xbee5('0x42')](_0x590f7);})[_0xbee5('0x24')](function(_0x30f6c5){_0x422351[_0xbee5('0x43')]=_0x30f6c5;return _0x422351;});}})['then'](respondWithFilteredResult(_0x4698fb,_0x590f7))[_0xbee5('0x44')](handleError(_0x4698fb,null));};exports[_0xbee5('0x7e')]=function(_0x53d74f,_0x12f758,_0x32f3ec){var _0x14022a,_0x2740de;return db[_0xbee5('0x2d')]['find']({'where':{'id':_0x53d74f[_0xbee5('0x46')]['id']}})['then'](handleEntityNotFound(_0x12f758,null))[_0xbee5('0x24')](function(_0x292228){if(_0x292228){_0x2740de=_0x292228;return _0x292228['addBlackLists'](_0x53d74f[_0xbee5('0x4a')][_0xbee5('0x60')],_[_0xbee5('0x51')](_0x53d74f['body'],[_0xbee5('0x60'),'id'])||{});}return null;})[_0xbee5('0x7f')](function(_0x494cc4){var _0x44b131;_0x14022a=_0x494cc4||[];var _0x55df9d=[];if(_0x494cc4){for(var _0x1e21f3=0x0;_0x1e21f3<_0x494cc4[_0xbee5('0x37')];_0x1e21f3+=0x1){var _0x5388ca=_0x494cc4[_0x1e21f3][_0xbee5('0x25')]({'plain':!![]});_0x44b131=squel[_0xbee5('0x63')]()[_0xbee5('0x77')](_0xbee5('0x80'))['fromQuery']([_0xbee5('0x65'),_0xbee5('0x66'),_0xbee5('0x6d'),_0xbee5('0x59'),'createdAt','updatedAt'],squel['select']()[_0xbee5('0x68')](_0xbee5('0x65'),'phone')['field']('id','ContactId')[_0xbee5('0x68')](_0x5388ca[_0xbee5('0x6b')]['toString'](),_0xbee5('0x6d'))['field'](_0x53d74f[_0xbee5('0x46')]['id'][_0xbee5('0x6c')](),_0xbee5('0x59'))[_0xbee5('0x68')](_0xbee5('0x69'),_0xbee5('0x53'))[_0xbee5('0x68')]('NOW()',_0xbee5('0x52'))[_0xbee5('0x6e')]('cm_contacts')[_0xbee5('0x3c')](_0xbee5('0x78'))[_0xbee5('0x3c')]('ListId\x20=\x20?',_0x5388ca[_0xbee5('0x6b')]['toString']())[_0xbee5('0x3c')](_0xbee5('0x70')))[_0xbee5('0x6c')]();_0x55df9d[_0xbee5('0x81')](db[_0xbee5('0x7a')][_0xbee5('0x34')](_0x44b131));}return BPromise[_0xbee5('0x7b')](_0x55df9d);}})['then'](function(){return _0x14022a;})[_0xbee5('0x24')](respondWithResult(_0x12f758,null))[_0xbee5('0x44')](handleError(_0x12f758,null));};exports[_0xbee5('0x82')]=function(_0x41a48b,_0x4b2820,_0x25a2ae){return db['Campaign'][_0xbee5('0x48')]({'where':{'id':_0x41a48b[_0xbee5('0x46')]['id']}})[_0xbee5('0x24')](handleEntityNotFound(_0x4b2820,null))[_0xbee5('0x24')](function(_0x5b3d1c){if(_0x5b3d1c){return _0x5b3d1c[_0xbee5('0x82')](_0x41a48b['query']['ids']);}})[_0xbee5('0x24')](function(_0x2e828a){if(_0x2e828a){return db[_0xbee5('0x5c')][_0xbee5('0x23')]({'where':{'ListId':_0x41a48b['query'][_0xbee5('0x60')],'CampaignId':_0x41a48b[_0xbee5('0x46')]['id']}})['then'](function(){return _0x2e828a;});}})['then'](respondWithStatusCode(_0x4b2820,null))[_0xbee5('0x44')](handleError(_0x4b2820,null));}; \ No newline at end of file +var _0xda55=['status','end','offset','limit','set','Content-Range','apply','reject','then','destroy','IvrCampaigns','UserProfileResource','error','name','send','index','map','Campaign','type','key','model','keys','intersection','query','attributes','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','VIRTUAL','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes','include','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','merge','omit','createdAt','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getHoppers','findOne','sort','CampaignId','CmHopper','getHopperHistories','CmHopperHistory','getHopperFinals','getHopperBlacks','CmHopperBlack','getLists','addLists','ids','spread','dialCheckDuplicateType','always','insert','into','fromQuery','scheduledAt','ContactId','ListId','updatedAt','select','field','phone','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','onlyIfOpen','cm_hopper','NOW()','sequelize','all','removeLists','getBlackLists','CmList','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xda55,0x6d));var _0x5da5=function(_0x3cb41d,_0x2d7f6d){_0x3cb41d=_0x3cb41d-0x0;var _0x4dc372=_0xda55[_0x3cb41d];return _0x4dc372;};'use strict';var pdf=require(_0x5da5('0x0'));var emlformat=require(_0x5da5('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5da5('0x2'));var rp=require(_0x5da5('0x3'));var moment=require(_0x5da5('0x4'));var BPromise=require(_0x5da5('0x5'));var Mustache=require(_0x5da5('0x6'));var util=require('util');var path=require(_0x5da5('0x7'));var sox=require('sox');var csv=require(_0x5da5('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5da5('0x9'));var squel=require(_0x5da5('0xa'));var crypto=require(_0x5da5('0xb'));var jsforce=require(_0x5da5('0xc'));var deskjs=require(_0x5da5('0xd'));var toCsv=require(_0x5da5('0x8'));var querystring=require(_0x5da5('0xe'));var Papa=require(_0x5da5('0xf'));var Redis=require('ioredis');var authService=require(_0x5da5('0x10'));var qs=require(_0x5da5('0x11'));var as=require(_0x5da5('0x12'));var hardwareService=require(_0x5da5('0x13'));var logger=require(_0x5da5('0x14'))(_0x5da5('0x15'));var utils=require(_0x5da5('0x16'));var config=require('../../config/environment');var db=require(_0x5da5('0x17'))['db'];function respondWithStatusCode(_0x3b5ff9,_0x4f813b){_0x4f813b=_0x4f813b||0xcc;return function(_0x37aeb0){if(_0x37aeb0){return _0x3b5ff9[_0x5da5('0x18')](_0x4f813b);}return _0x3b5ff9[_0x5da5('0x19')](_0x4f813b)[_0x5da5('0x1a')]();};}function respondWithResult(_0x1877d4,_0x440b8f){_0x440b8f=_0x440b8f||0xc8;return function(_0x481562){if(_0x481562){return _0x1877d4['status'](_0x440b8f)['json'](_0x481562);}};}function respondWithFilteredResult(_0x4267cd,_0x126fc8){return function(_0x13c701){if(_0x13c701){var _0x665ce8=_0x13c701['count'],_0x11bd3=_0x126fc8[_0x5da5('0x1b')],_0x134afa=_0x126fc8[_0x5da5('0x1b')]+_0x126fc8[_0x5da5('0x1c')],_0x3aff51;if(_0x134afa>=_0x665ce8){_0x134afa=_0x665ce8;_0x3aff51=0xc8;}else{_0x3aff51=0xce;}_0x4267cd[_0x5da5('0x19')](_0x3aff51);return _0x4267cd[_0x5da5('0x1d')](_0x5da5('0x1e'),_0x11bd3+'-'+_0x134afa+'/'+_0x665ce8)['json'](_0x13c701);}return null;};}function patchUpdates(_0x1920e2){return function(_0x3766ee){try{jsonpatch[_0x5da5('0x1f')](_0x3766ee,_0x1920e2,!![]);}catch(_0x30cde5){return BPromise[_0x5da5('0x20')](_0x30cde5);}return _0x3766ee['save']();};}function saveUpdates(_0x4393d7,_0x3372fc){return function(_0x42a3cb){if(_0x42a3cb){return _0x42a3cb['update'](_0x4393d7)[_0x5da5('0x21')](function(_0x15aa62){return _0x15aa62;});}return null;};}function removeEntity(_0x20c8a6,_0x2e68d5){return function(_0xec69f2){if(_0xec69f2){return _0xec69f2[_0x5da5('0x22')]()['then'](function(){var _0x1a6bd7=_0xec69f2['get']({'plain':!![]});var _0x1b67c4=_0x5da5('0x23');return db[_0x5da5('0x24')]['destroy']({'where':{'type':_0x1b67c4,'resourceId':_0x1a6bd7['id']}})[_0x5da5('0x21')](function(){return _0xec69f2;});})[_0x5da5('0x21')](function(){_0x20c8a6[_0x5da5('0x19')](0xcc)[_0x5da5('0x1a')]();});}};}function handleEntityNotFound(_0x55d517,_0x5b0b43){return function(_0x50aadc){if(!_0x50aadc){_0x55d517[_0x5da5('0x18')](0x194);}return _0x50aadc;};}function handleError(_0x56d509,_0x4e8890){_0x4e8890=_0x4e8890||0x1f4;return function(_0x1f75f3){logger[_0x5da5('0x25')](_0x1f75f3['stack']);if(_0x1f75f3[_0x5da5('0x26')]){delete _0x1f75f3[_0x5da5('0x26')];}_0x56d509['status'](_0x4e8890)[_0x5da5('0x27')](_0x1f75f3);};}exports[_0x5da5('0x28')]=function(_0x38bb86,_0x42292d){var _0x766ed9={},_0x5734ce={},_0x3ae664={'count':0x0,'rows':[]};var _0x2e3c5d=_[_0x5da5('0x29')](db[_0x5da5('0x2a')]['rawAttributes'],function(_0x5ee7f2){return{'name':_0x5ee7f2['fieldName'],'type':_0x5ee7f2[_0x5da5('0x2b')][_0x5da5('0x2c')]};});_0x5734ce[_0x5da5('0x2d')]=_[_0x5da5('0x29')](_0x2e3c5d,'name');_0x5734ce['query']=_[_0x5da5('0x2e')](_0x38bb86['query']);_0x5734ce['filters']=_[_0x5da5('0x2f')](_0x5734ce['model'],_0x5734ce[_0x5da5('0x30')]);_0x766ed9[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x5734ce[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x32')]));_0x766ed9[_0x5da5('0x31')]=_0x766ed9['attributes'][_0x5da5('0x33')]?_0x766ed9['attributes']:_0x5734ce[_0x5da5('0x2d')];if(!_0x38bb86[_0x5da5('0x30')][_0x5da5('0x34')](_0x5da5('0x35'))){_0x766ed9[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x766ed9[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x38bb86[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x766ed9[_0x5da5('0x36')]=qs['sort'](_0x38bb86[_0x5da5('0x30')]['sort']);_0x766ed9[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x38bb86[_0x5da5('0x30')],_0x5734ce['filters']));if(_0x38bb86[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x766ed9[_0x5da5('0x37')]=_['merge'](_0x766ed9[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x2e3c5d,function(_0x4b8464){if(_0x4b8464[_0x5da5('0x2b')]!==_0x5da5('0x3b')){var _0xe9888e={};_0xe9888e[_0x4b8464[_0x5da5('0x26')]]={'$like':'%'+_0x38bb86[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0xe9888e;}})});}_0x766ed9=_['merge']({},_0x766ed9,_0x38bb86[_0x5da5('0x3c')]);var _0x91d336={'where':_0x766ed9[_0x5da5('0x37')]};return db[_0x5da5('0x2a')][_0x5da5('0x3d')](_0x91d336)['then'](function(_0x472e9f){_0x3ae664[_0x5da5('0x3d')]=_0x472e9f;if(_0x38bb86['query'][_0x5da5('0x3e')]){_0x766ed9['include']=[{'all':!![]}];}return db['Campaign'][_0x5da5('0x3f')](_0x766ed9);})[_0x5da5('0x21')](function(_0x2f6026){_0x3ae664[_0x5da5('0x40')]=_0x2f6026;return _0x3ae664;})[_0x5da5('0x21')](respondWithFilteredResult(_0x42292d,_0x766ed9))[_0x5da5('0x41')](handleError(_0x42292d,null));};exports[_0x5da5('0x42')]=function(_0xa6af2d,_0x40cf69){var _0x2a2814={'raw':![],'where':{'id':_0xa6af2d[_0x5da5('0x43')]['id']}},_0x22d47e={};_0x22d47e[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x2a')][_0x5da5('0x44')]);_0x22d47e[_0x5da5('0x30')]=_[_0x5da5('0x2e')](_0xa6af2d[_0x5da5('0x30')]);_0x22d47e[_0x5da5('0x38')]=_['intersection'](_0x22d47e['model'],_0x22d47e[_0x5da5('0x30')]);_0x2a2814[_0x5da5('0x31')]=_['intersection'](_0x22d47e[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0xa6af2d[_0x5da5('0x30')][_0x5da5('0x32')]));_0x2a2814[_0x5da5('0x31')]=_0x2a2814[_0x5da5('0x31')][_0x5da5('0x33')]?_0x2a2814[_0x5da5('0x31')]:_0x22d47e[_0x5da5('0x2d')];if(_0xa6af2d[_0x5da5('0x30')]['includeAll']){_0x2a2814[_0x5da5('0x45')]=[{'all':!![]}];}_0x2a2814=_['merge']({},_0x2a2814,_0xa6af2d['options']);return db[_0x5da5('0x2a')][_0x5da5('0x46')](_0x2a2814)[_0x5da5('0x21')](handleEntityNotFound(_0x40cf69,null))[_0x5da5('0x21')](respondWithResult(_0x40cf69,null))[_0x5da5('0x41')](handleError(_0x40cf69,null));};exports[_0x5da5('0x47')]=function(_0x5aa561,_0x216d06){return db['Campaign']['create'](_0x5aa561[_0x5da5('0x48')],{})[_0x5da5('0x21')](function(_0x47ca73){var _0x419d74=_0x5aa561[_0x5da5('0x49')][_0x5da5('0x4a')]({'plain':!![]});if(!_0x419d74)throw new Error(_0x5da5('0x4b'));if(_0x419d74[_0x5da5('0x4c')]==='user'){var _0x225792=_0x47ca73['get']({'plain':!![]});var _0x535b22=_0x5da5('0x23');return db['UserProfileSection'][_0x5da5('0x46')]({'where':{'name':_0x535b22,'userProfileId':_0x419d74[_0x5da5('0x4d')]},'raw':!![]})[_0x5da5('0x21')](function(_0x1ec725){if(_0x1ec725&&_0x1ec725[_0x5da5('0x4e')]===0x0){return db[_0x5da5('0x24')]['create']({'name':_0x225792['name'],'resourceId':_0x225792['id'],'type':_0x1ec725[_0x5da5('0x26')],'sectionId':_0x1ec725['id']},{})[_0x5da5('0x21')](function(){return _0x47ca73;});}else{return _0x47ca73;}})['catch'](function(_0x4fca4c){logger[_0x5da5('0x25')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4fca4c);throw _0x4fca4c;});}return _0x47ca73;})[_0x5da5('0x21')](respondWithResult(_0x216d06,0xc9))['catch'](handleError(_0x216d06,null));};exports['clone']=function(_0x39950d,_0x323655){var _0xc2b9a5={'where':{'id':_0x39950d['params']['id']}},_0x39d428={};_0x39d428[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x2a')]['rawAttributes']);_0xc2b9a5[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x39d428[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x39950d[_0x5da5('0x30')][_0x5da5('0x32')]));_0xc2b9a5[_0x5da5('0x31')]=_0xc2b9a5[_0x5da5('0x31')][_0x5da5('0x33')]?_0xc2b9a5[_0x5da5('0x31')]:_0x39d428[_0x5da5('0x2d')];if(_0x39950d[_0x5da5('0x30')][_0x5da5('0x3e')]){_0xc2b9a5[_0x5da5('0x45')]=[{'all':!![]}];}_0xc2b9a5=_[_0x5da5('0x4f')]({},_0xc2b9a5,_0x39950d[_0x5da5('0x3c')]);return db[_0x5da5('0x2a')][_0x5da5('0x46')](_0xc2b9a5)[_0x5da5('0x21')](handleEntityNotFound(_0x323655,null))[_0x5da5('0x21')](function(_0x2c5360){if(_0x2c5360){var _0x4cc539=_0x2c5360[_0x5da5('0x4a')]({'plain':!![]});_0x4cc539=qs[_0x5da5('0x50')](_0x4cc539,['id','createdAt','updatedAt']);_0x39950d['body']=_[_0x5da5('0x50')](_0x39950d[_0x5da5('0x48')],['id',_0x5da5('0x51'),'updatedAt']);return db['Campaign'][_0x5da5('0x47')](_[_0x5da5('0x4f')](_0x4cc539,_0x39950d[_0x5da5('0x48')]),{'include':_0x39950d[_0x5da5('0x30')]['includeAll']?[{'all':!![]}]:undefined})[_0x5da5('0x21')](function(_0x3eeff3){var _0x34b4b0=_0x39950d['user'][_0x5da5('0x4a')]({'plain':!![]});if(!_0x34b4b0)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x34b4b0[_0x5da5('0x4c')]===_0x5da5('0x49')){var _0x4f0e51=_0x3eeff3[_0x5da5('0x4a')]({'plain':!![]});var _0x12c983=_0x5da5('0x23');return db[_0x5da5('0x52')][_0x5da5('0x46')]({'where':{'name':_0x12c983,'userProfileId':_0x34b4b0[_0x5da5('0x4d')]},'raw':!![]})[_0x5da5('0x21')](function(_0x2f9f72){if(_0x2f9f72&&_0x2f9f72[_0x5da5('0x4e')]===0x0){return db[_0x5da5('0x24')][_0x5da5('0x47')]({'name':_0x4f0e51[_0x5da5('0x26')],'resourceId':_0x4f0e51['id'],'type':_0x2f9f72[_0x5da5('0x26')],'sectionId':_0x2f9f72['id']},{})[_0x5da5('0x21')](function(){return _0x3eeff3;});}else{return _0x3eeff3;}})[_0x5da5('0x41')](function(_0xc957b3){logger[_0x5da5('0x25')](_0x5da5('0x53'),_0xc957b3);throw _0xc957b3;});}return _0x3eeff3;});}})['then'](respondWithResult(_0x323655,0xc9))['catch'](handleError(_0x323655,null));};exports[_0x5da5('0x54')]=function(_0x35cca1,_0x4041e8){if(_0x35cca1['body']['id']){delete _0x35cca1[_0x5da5('0x48')]['id'];}return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x35cca1[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x4041e8,null))[_0x5da5('0x21')](saveUpdates(_0x35cca1['body'],null))[_0x5da5('0x21')](respondWithResult(_0x4041e8,null))[_0x5da5('0x41')](handleError(_0x4041e8,null));};exports[_0x5da5('0x22')]=function(_0x53cb6a,_0x57966d){return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x53cb6a['params']['id']}})['then'](handleEntityNotFound(_0x57966d,null))['then'](removeEntity(_0x57966d,null))[_0x5da5('0x41')](handleError(_0x57966d,null));};exports[_0x5da5('0x55')]=function(_0x2b5cd5,_0x152b61,_0x3e0904){var _0x283efe={'raw':!![],'where':{}};var _0x10e97c={};var _0xb2f3be={'count':0x0,'rows':[]};return db['Campaign'][_0x5da5('0x56')]({'where':{'id':_0x2b5cd5[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x152b61,null))['then'](function(_0x161821){if(_0x161821){_0x10e97c['model']=_[_0x5da5('0x2e')](db['CmHopper'][_0x5da5('0x44')]);_0x10e97c[_0x5da5('0x30')]=_[_0x5da5('0x2e')](_0x2b5cd5[_0x5da5('0x30')]);_0x10e97c[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x10e97c[_0x5da5('0x2d')],_0x10e97c[_0x5da5('0x30')]);_0x283efe[_0x5da5('0x31')]=_[_0x5da5('0x2f')](_0x10e97c[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x2b5cd5['query']['fields']));_0x283efe[_0x5da5('0x31')]=_0x283efe[_0x5da5('0x31')][_0x5da5('0x33')]?_0x283efe[_0x5da5('0x31')]:_0x10e97c['model'];if(!_0x2b5cd5['query']['hasOwnProperty'](_0x5da5('0x35'))){_0x283efe[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x283efe[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x283efe[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x2b5cd5[_0x5da5('0x30')][_0x5da5('0x57')]);_0x283efe[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x2b5cd5[_0x5da5('0x30')],_0x10e97c[_0x5da5('0x38')]));_0x283efe[_0x5da5('0x37')][_0x5da5('0x58')]=_0x161821['id'];if(_0x2b5cd5[_0x5da5('0x30')]['filter']){_0x283efe[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x283efe[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x283efe['attributes'],function(_0x488da6){var _0x2b14ca={};_0x2b14ca[_0x488da6]={'$like':'%'+_0x2b5cd5['query'][_0x5da5('0x3a')]+'%'};return _0x2b14ca;})});}_0x283efe=_[_0x5da5('0x4f')]({},_0x283efe,_0x2b5cd5[_0x5da5('0x3c')]);return db[_0x5da5('0x59')][_0x5da5('0x3d')]({'where':_0x283efe[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x7d0ff1){_0xb2f3be[_0x5da5('0x3d')]=_0x7d0ff1;if(_0x2b5cd5['query'][_0x5da5('0x3e')]){_0x283efe['include']=[{'all':!![]}];}return db[_0x5da5('0x59')][_0x5da5('0x3f')](_0x283efe);})['then'](function(_0x280132){_0xb2f3be['rows']=_0x280132;return _0xb2f3be;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x152b61,_0x283efe))['catch'](handleError(_0x152b61,null));};exports[_0x5da5('0x5a')]=function(_0x3a4ec8,_0x2c2815,_0x358f8d){var _0x4df458={'raw':!![],'where':{}};var _0x2f6d27={};var _0x42cc38={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x3a4ec8['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x2c2815,null))[_0x5da5('0x21')](function(_0x4ca5cb){if(_0x4ca5cb){_0x2f6d27['model']=_[_0x5da5('0x2e')](db[_0x5da5('0x5b')][_0x5da5('0x44')]);_0x2f6d27[_0x5da5('0x30')]=_['keys'](_0x3a4ec8[_0x5da5('0x30')]);_0x2f6d27['filters']=_[_0x5da5('0x2f')](_0x2f6d27['model'],_0x2f6d27['query']);_0x4df458[_0x5da5('0x31')]=_['intersection'](_0x2f6d27['model'],qs[_0x5da5('0x32')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x32')]));_0x4df458[_0x5da5('0x31')]=_0x4df458[_0x5da5('0x31')][_0x5da5('0x33')]?_0x4df458[_0x5da5('0x31')]:_0x2f6d27[_0x5da5('0x2d')];if(!_0x3a4ec8['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4df458[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4df458[_0x5da5('0x1b')]=qs[_0x5da5('0x1b')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x4df458[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x57')]);_0x4df458[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x3a4ec8[_0x5da5('0x30')],_0x2f6d27[_0x5da5('0x38')]));_0x4df458[_0x5da5('0x37')][_0x5da5('0x58')]=_0x4ca5cb['id'];if(_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x4df458[_0x5da5('0x37')]=_['merge'](_0x4df458[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x4df458['attributes'],function(_0x41986c){var _0x4f9e25={};_0x4f9e25[_0x41986c]={'$like':'%'+_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x4f9e25;})});}_0x4df458=_[_0x5da5('0x4f')]({},_0x4df458,_0x3a4ec8[_0x5da5('0x3c')]);return db[_0x5da5('0x5b')][_0x5da5('0x3d')]({'where':_0x4df458['where']})[_0x5da5('0x21')](function(_0x319490){_0x42cc38['count']=_0x319490;if(_0x3a4ec8[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4df458['include']=[{'all':!![]}];}return db[_0x5da5('0x5b')][_0x5da5('0x3f')](_0x4df458);})[_0x5da5('0x21')](function(_0x2faa78){_0x42cc38[_0x5da5('0x40')]=_0x2faa78;return _0x42cc38;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x2c2815,_0x4df458))[_0x5da5('0x41')](handleError(_0x2c2815,null));};exports[_0x5da5('0x5c')]=function(_0x263f18,_0x2c08a0,_0x4a9d03){var _0x449fe0={'raw':!![],'where':{}};var _0x2fba9e={};var _0x2464c0={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x263f18[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x2c08a0,null))['then'](function(_0x56d98a){if(_0x56d98a){_0x2fba9e[_0x5da5('0x2d')]=_['keys'](db['CmHopperFinal'][_0x5da5('0x44')]);_0x2fba9e['query']=_[_0x5da5('0x2e')](_0x263f18['query']);_0x2fba9e[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x2fba9e[_0x5da5('0x2d')],_0x2fba9e[_0x5da5('0x30')]);_0x449fe0['attributes']=_[_0x5da5('0x2f')](_0x2fba9e[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x263f18[_0x5da5('0x30')][_0x5da5('0x32')]));_0x449fe0[_0x5da5('0x31')]=_0x449fe0[_0x5da5('0x31')][_0x5da5('0x33')]?_0x449fe0['attributes']:_0x2fba9e[_0x5da5('0x2d')];if(!_0x263f18[_0x5da5('0x30')]['hasOwnProperty'](_0x5da5('0x35'))){_0x449fe0[_0x5da5('0x1c')]=qs[_0x5da5('0x1c')](_0x263f18[_0x5da5('0x30')]['limit']);_0x449fe0['offset']=qs[_0x5da5('0x1b')](_0x263f18[_0x5da5('0x30')][_0x5da5('0x1b')]);}_0x449fe0[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x263f18['query'][_0x5da5('0x57')]);_0x449fe0[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x263f18[_0x5da5('0x30')],_0x2fba9e[_0x5da5('0x38')]));_0x449fe0[_0x5da5('0x37')][_0x5da5('0x58')]=_0x56d98a['id'];if(_0x263f18[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x449fe0[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x449fe0[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x449fe0[_0x5da5('0x31')],function(_0x34bdd4){var _0x28da21={};_0x28da21[_0x34bdd4]={'$like':'%'+_0x263f18[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x28da21;})});}_0x449fe0=_['merge']({},_0x449fe0,_0x263f18[_0x5da5('0x3c')]);return db['CmHopperFinal'][_0x5da5('0x3d')]({'where':_0x449fe0[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x1fe6a0){_0x2464c0[_0x5da5('0x3d')]=_0x1fe6a0;if(_0x263f18['query'][_0x5da5('0x3e')]){_0x449fe0[_0x5da5('0x45')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x449fe0);})[_0x5da5('0x21')](function(_0x50cd17){_0x2464c0[_0x5da5('0x40')]=_0x50cd17;return _0x2464c0;});}})[_0x5da5('0x21')](respondWithFilteredResult(_0x2c08a0,_0x449fe0))[_0x5da5('0x41')](handleError(_0x2c08a0,null));};exports[_0x5da5('0x5d')]=function(_0x315e6f,_0x3611f7,_0x341587){var _0x4c16f3={'raw':!![],'where':{}};var _0x57b6e4={};var _0x4f9802={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x315e6f[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x3611f7,null))[_0x5da5('0x21')](function(_0x2f5cf9){if(_0x2f5cf9){_0x57b6e4[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db[_0x5da5('0x5e')][_0x5da5('0x44')]);_0x57b6e4['query']=_[_0x5da5('0x2e')](_0x315e6f[_0x5da5('0x30')]);_0x57b6e4[_0x5da5('0x38')]=_['intersection'](_0x57b6e4['model'],_0x57b6e4[_0x5da5('0x30')]);_0x4c16f3[_0x5da5('0x31')]=_['intersection'](_0x57b6e4[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x315e6f['query'][_0x5da5('0x32')]));_0x4c16f3['attributes']=_0x4c16f3['attributes'][_0x5da5('0x33')]?_0x4c16f3['attributes']:_0x57b6e4[_0x5da5('0x2d')];if(!_0x315e6f['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4c16f3['limit']=qs[_0x5da5('0x1c')](_0x315e6f[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4c16f3[_0x5da5('0x1b')]=qs['offset'](_0x315e6f['query'][_0x5da5('0x1b')]);}_0x4c16f3[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x315e6f[_0x5da5('0x30')][_0x5da5('0x57')]);_0x4c16f3[_0x5da5('0x37')]=qs['filters'](_[_0x5da5('0x39')](_0x315e6f[_0x5da5('0x30')],_0x57b6e4[_0x5da5('0x38')]));_0x4c16f3[_0x5da5('0x37')]['CampaignId']=_0x2f5cf9['id'];if(_0x315e6f['query'][_0x5da5('0x3a')]){_0x4c16f3[_0x5da5('0x37')]=_[_0x5da5('0x4f')](_0x4c16f3['where'],{'$or':_['map'](_0x4c16f3[_0x5da5('0x31')],function(_0x5e4533){var _0x1322ac={};_0x1322ac[_0x5e4533]={'$like':'%'+_0x315e6f[_0x5da5('0x30')]['filter']+'%'};return _0x1322ac;})});}_0x4c16f3=_['merge']({},_0x4c16f3,_0x315e6f['options']);return db[_0x5da5('0x5e')]['count']({'where':_0x4c16f3[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x24c565){_0x4f9802[_0x5da5('0x3d')]=_0x24c565;if(_0x315e6f[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4c16f3['include']=[{'all':!![]}];}return db[_0x5da5('0x5e')][_0x5da5('0x3f')](_0x4c16f3);})[_0x5da5('0x21')](function(_0x2212b1){_0x4f9802[_0x5da5('0x40')]=_0x2212b1;return _0x4f9802;});}})['then'](respondWithFilteredResult(_0x3611f7,_0x4c16f3))[_0x5da5('0x41')](handleError(_0x3611f7,null));};exports[_0x5da5('0x5f')]=function(_0x59e663,_0x51b2cb,_0x15ccd3){var _0x1971c2={};var _0x3385eb={};var _0x3822dd;var _0xe36532;return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x59e663[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x51b2cb,null))['then'](function(_0x3514b3){if(_0x3514b3){_0x3822dd=_0x3514b3;_0x3385eb[_0x5da5('0x2d')]=_[_0x5da5('0x2e')](db['CmList'][_0x5da5('0x44')]);_0x3385eb['query']=_['keys'](_0x59e663['query']);_0x3385eb[_0x5da5('0x38')]=_[_0x5da5('0x2f')](_0x3385eb[_0x5da5('0x2d')],_0x3385eb[_0x5da5('0x30')]);_0x1971c2['attributes']=_[_0x5da5('0x2f')](_0x3385eb[_0x5da5('0x2d')],qs[_0x5da5('0x32')](_0x59e663[_0x5da5('0x30')][_0x5da5('0x32')]));_0x1971c2[_0x5da5('0x31')]=_0x1971c2[_0x5da5('0x31')]['length']?_0x1971c2[_0x5da5('0x31')]:_0x3385eb[_0x5da5('0x2d')];_0x1971c2[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x59e663['query'][_0x5da5('0x57')]);_0x1971c2[_0x5da5('0x37')]=qs['filters'](_[_0x5da5('0x39')](_0x59e663[_0x5da5('0x30')],_0x3385eb[_0x5da5('0x38')]));if(_0x59e663[_0x5da5('0x30')]['filter']){_0x1971c2['where']=_[_0x5da5('0x4f')](_0x1971c2[_0x5da5('0x37')],{'$or':_[_0x5da5('0x29')](_0x1971c2['attributes'],function(_0x2d5eea){var _0x555728={};_0x555728[_0x2d5eea]={'$like':'%'+_0x59e663['query'][_0x5da5('0x3a')]+'%'};return _0x555728;})});}_0x1971c2=_[_0x5da5('0x4f')]({},_0x1971c2,_0x59e663[_0x5da5('0x3c')]);return _0x3822dd['getLists'](_0x1971c2);}})[_0x5da5('0x21')](function(_0x5738f4){if(_0x5738f4){_0xe36532=_0x5738f4['length'];if(!_0x59e663[_0x5da5('0x30')][_0x5da5('0x34')](_0x5da5('0x35'))){_0x1971c2['limit']=qs['limit'](_0x59e663[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x1971c2['offset']=qs['offset'](_0x59e663[_0x5da5('0x30')]['offset']);}return _0x3822dd[_0x5da5('0x5f')](_0x1971c2);}})[_0x5da5('0x21')](function(_0x2eb429){if(_0x2eb429){return _0x2eb429?{'count':_0xe36532,'rows':_0x2eb429}:null;}})[_0x5da5('0x21')](respondWithResult(_0x51b2cb,null))[_0x5da5('0x41')](handleError(_0x51b2cb,null));};exports[_0x5da5('0x60')]=function(_0x4814d5,_0x17c226,_0x41e33d){var _0x2441bb,_0x1179ea;return db[_0x5da5('0x2a')][_0x5da5('0x46')]({'where':{'id':_0x4814d5[_0x5da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x17c226,null))['then'](function(_0x4486b8){if(_0x4486b8){_0x1179ea=_0x4486b8;return _0x4486b8[_0x5da5('0x60')](_0x4814d5[_0x5da5('0x48')][_0x5da5('0x61')],_[_0x5da5('0x50')](_0x4814d5['body'],[_0x5da5('0x61'),'id'])||{});}return null;})[_0x5da5('0x62')](function(_0x6ba7b4){var _0x4ccfbc;_0x2441bb=_0x6ba7b4||[];var _0x45fdc3=[];if(_0x6ba7b4){for(var _0x1bee1c=0x0;_0x1bee1c<_0x6ba7b4[_0x5da5('0x33')];_0x1bee1c+=0x1){var _0x19ec84=_0x6ba7b4[_0x1bee1c][_0x5da5('0x4a')]({'plain':!![]});_0x1179ea[_0x5da5('0x63')]=_0x4814d5[_0x5da5('0x48')][_0x5da5('0x63')]?_0x4814d5[_0x5da5('0x48')][_0x5da5('0x63')]:_0x1179ea[_0x5da5('0x63')];switch(_0x1179ea['dialCheckDuplicateType']){case _0x5da5('0x64'):_0x4ccfbc=squel[_0x5da5('0x65')]()[_0x5da5('0x66')]('cm_hopper')[_0x5da5('0x67')](['phone',_0x5da5('0x68'),_0x5da5('0x69'),_0x5da5('0x6a'),'CampaignId','createdAt',_0x5da5('0x6b')],squel[_0x5da5('0x6c')]()[_0x5da5('0x6d')](_0x5da5('0x6e'),_0x5da5('0x6e'))[_0x5da5('0x6d')]('NOW()',_0x5da5('0x68'))['field']('id',_0x5da5('0x69'))[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')]['toString'](),'ListId')[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')]('NOW()','createdAt')[_0x5da5('0x6d')]('NOW()',_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84['CmListId'][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75'))[_0x5da5('0x37')](_0x5da5('0x76'),squel['select']()[_0x5da5('0x6d')](_0x5da5('0x77'))[_0x5da5('0x71')](_0x5da5('0x78'))[_0x5da5('0x37')]('CampaignId\x20=\x20?',_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')]()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x5da5('0x6d')](_0x5da5('0x79'))[_0x5da5('0x71')]('cm_hopper')[_0x5da5('0x37')](_0x5da5('0x7a'),_0x4814d5['params']['id'][_0x5da5('0x70')]())))[_0x5da5('0x70')]();break;case _0x5da5('0x7b'):_0x4ccfbc=squel[_0x5da5('0x65')]()['into'](_0x5da5('0x7c'))['fromQuery']([_0x5da5('0x6e'),_0x5da5('0x68'),'ContactId',_0x5da5('0x6a'),_0x5da5('0x58'),_0x5da5('0x51'),_0x5da5('0x6b')],squel[_0x5da5('0x6c')]()[_0x5da5('0x6d')](_0x5da5('0x6e'),_0x5da5('0x6e'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x68'))[_0x5da5('0x6d')]('id',_0x5da5('0x69'))[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')](),_0x5da5('0x6a'))[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x51'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75'))[_0x5da5('0x37')](_0x5da5('0x76'),squel[_0x5da5('0x6c')]()['field']('COALESCE(phone,\x27\x27)')[_0x5da5('0x71')](_0x5da5('0x7c'))['where']('CampaignId\x20=\x20?',_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')]())))[_0x5da5('0x70')]();break;default:_0x4ccfbc=squel[_0x5da5('0x65')]()[_0x5da5('0x66')](_0x5da5('0x7c'))[_0x5da5('0x67')](['phone',_0x5da5('0x68'),_0x5da5('0x69'),_0x5da5('0x6a'),_0x5da5('0x58'),_0x5da5('0x51'),'updatedAt'],squel['select']()[_0x5da5('0x6d')](_0x5da5('0x6e'),'phone')['field'](_0x5da5('0x7d'),_0x5da5('0x68'))[_0x5da5('0x6d')]('id','ContactId')[_0x5da5('0x6d')](_0x19ec84[_0x5da5('0x6f')]['toString'](),'ListId')[_0x5da5('0x6d')](_0x4814d5[_0x5da5('0x43')]['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x51'))['field'](_0x5da5('0x7d'),'updatedAt')[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x19ec84[_0x5da5('0x6f')][_0x5da5('0x70')]())[_0x5da5('0x37')](_0x5da5('0x75')))[_0x5da5('0x70')]();}_0x45fdc3['push'](db[_0x5da5('0x7e')][_0x5da5('0x30')](_0x4ccfbc));}return BPromise[_0x5da5('0x7f')](_0x45fdc3);}})['then'](function(){return _0x2441bb;})[_0x5da5('0x21')](respondWithResult(_0x17c226,null))[_0x5da5('0x41')](handleError(_0x17c226,null));};exports[_0x5da5('0x80')]=function(_0x1c1b7a,_0x1fe408,_0x121da7){return db[_0x5da5('0x2a')]['find']({'where':{'id':_0x1c1b7a['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x1fe408,null))[_0x5da5('0x21')](function(_0x1fc126){if(_0x1fc126){return _0x1fc126[_0x5da5('0x80')](_0x1c1b7a['query'][_0x5da5('0x61')]);}})[_0x5da5('0x21')](function(_0x5705ab){if(_0x5705ab){return db[_0x5da5('0x59')][_0x5da5('0x22')]({'where':{'ListId':_0x1c1b7a[_0x5da5('0x30')]['ids'],'CampaignId':_0x1c1b7a[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](function(){return _0x5705ab;});}})['then'](respondWithStatusCode(_0x1fe408,null))[_0x5da5('0x41')](handleError(_0x1fe408,null));};exports[_0x5da5('0x81')]=function(_0x3dad2d,_0x11e1b7,_0x469673){var _0x4ead9d={'raw':!![],'where':{}};var _0x13b785={};var _0x255556={'count':0x0,'rows':[]};return db[_0x5da5('0x2a')][_0x5da5('0x56')]({'where':{'id':_0x3dad2d[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x11e1b7,null))[_0x5da5('0x21')](function(_0x5471f2){if(_0x5471f2){_0x13b785['model']=_['keys'](db[_0x5da5('0x82')][_0x5da5('0x44')]);_0x13b785['query']=_[_0x5da5('0x2e')](_0x3dad2d['query']);_0x13b785['filters']=_[_0x5da5('0x2f')](_0x13b785['model'],_0x13b785[_0x5da5('0x30')]);_0x4ead9d['attributes']=_[_0x5da5('0x2f')](_0x13b785[_0x5da5('0x2d')],qs['fields'](_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x32')]));_0x4ead9d[_0x5da5('0x31')]=_0x4ead9d[_0x5da5('0x31')][_0x5da5('0x33')]?_0x4ead9d[_0x5da5('0x31')]:_0x13b785['model'];if(!_0x3dad2d['query'][_0x5da5('0x34')](_0x5da5('0x35'))){_0x4ead9d['limit']=qs[_0x5da5('0x1c')](_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x1c')]);_0x4ead9d['offset']=qs['offset'](_0x3dad2d['query'][_0x5da5('0x1b')]);}_0x4ead9d[_0x5da5('0x36')]=qs[_0x5da5('0x57')](_0x3dad2d[_0x5da5('0x30')]['sort']);_0x4ead9d[_0x5da5('0x37')]=qs[_0x5da5('0x38')](_[_0x5da5('0x39')](_0x3dad2d[_0x5da5('0x30')],_0x13b785['filters']));_0x4ead9d['where'][_0x5da5('0x58')]=_0x5471f2['id'];if(_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3a')]){_0x4ead9d['where']=_[_0x5da5('0x4f')](_0x4ead9d[_0x5da5('0x37')],{'$or':_['map'](_0x4ead9d['attributes'],function(_0x179867){var _0x58424b={};_0x58424b[_0x179867]={'$like':'%'+_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3a')]+'%'};return _0x58424b;})});}_0x4ead9d=_[_0x5da5('0x4f')]({},_0x4ead9d,_0x3dad2d[_0x5da5('0x3c')]);return db['CmList']['count']({'where':_0x4ead9d[_0x5da5('0x37')]})[_0x5da5('0x21')](function(_0x206b3b){_0x255556[_0x5da5('0x3d')]=_0x206b3b;if(_0x3dad2d[_0x5da5('0x30')][_0x5da5('0x3e')]){_0x4ead9d[_0x5da5('0x45')]=[{'all':!![]}];}return db[_0x5da5('0x82')]['findAll'](_0x4ead9d);})[_0x5da5('0x21')](function(_0x87baed){_0x255556['rows']=_0x87baed;return _0x255556;});}})['then'](respondWithFilteredResult(_0x11e1b7,_0x4ead9d))[_0x5da5('0x41')](handleError(_0x11e1b7,null));};exports[_0x5da5('0x83')]=function(_0x5d36fb,_0x663647,_0x4635ed){var _0x596d96,_0x104190;return db['Campaign'][_0x5da5('0x46')]({'where':{'id':_0x5d36fb[_0x5da5('0x43')]['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x663647,null))[_0x5da5('0x21')](function(_0x508643){if(_0x508643){_0x104190=_0x508643;return _0x508643[_0x5da5('0x83')](_0x5d36fb[_0x5da5('0x48')][_0x5da5('0x61')],_[_0x5da5('0x50')](_0x5d36fb['body'],[_0x5da5('0x61'),'id'])||{});}return null;})[_0x5da5('0x62')](function(_0x506704){var _0x2f94f2;_0x596d96=_0x506704||[];var _0x166b28=[];if(_0x506704){for(var _0x3c2680=0x0;_0x3c2680<_0x506704[_0x5da5('0x33')];_0x3c2680+=0x1){var _0x2372ce=_0x506704[_0x3c2680][_0x5da5('0x4a')]({'plain':!![]});_0x2f94f2=squel[_0x5da5('0x65')]()[_0x5da5('0x66')](_0x5da5('0x84'))[_0x5da5('0x67')]([_0x5da5('0x6e'),_0x5da5('0x69'),_0x5da5('0x6a'),'CampaignId','createdAt','updatedAt'],squel['select']()[_0x5da5('0x6d')](_0x5da5('0x6e'),'phone')['field']('id',_0x5da5('0x69'))['field'](_0x2372ce[_0x5da5('0x6f')][_0x5da5('0x70')](),'ListId')[_0x5da5('0x6d')](_0x5d36fb['params']['id'][_0x5da5('0x70')](),_0x5da5('0x58'))[_0x5da5('0x6d')]('NOW()','createdAt')[_0x5da5('0x6d')](_0x5da5('0x7d'),_0x5da5('0x6b'))[_0x5da5('0x71')](_0x5da5('0x72'))[_0x5da5('0x37')](_0x5da5('0x73'))[_0x5da5('0x37')](_0x5da5('0x74'),_0x2372ce[_0x5da5('0x6f')]['toString']())[_0x5da5('0x37')](_0x5da5('0x75')))[_0x5da5('0x70')]();_0x166b28['push'](db[_0x5da5('0x7e')][_0x5da5('0x30')](_0x2f94f2));}return BPromise['all'](_0x166b28);}})[_0x5da5('0x21')](function(){return _0x596d96;})['then'](respondWithResult(_0x663647,null))[_0x5da5('0x41')](handleError(_0x663647,null));};exports[_0x5da5('0x85')]=function(_0x3378aa,_0x955466,_0x37a270){return db[_0x5da5('0x2a')]['find']({'where':{'id':_0x3378aa['params']['id']}})[_0x5da5('0x21')](handleEntityNotFound(_0x955466,null))[_0x5da5('0x21')](function(_0x53f8b5){if(_0x53f8b5){return _0x53f8b5[_0x5da5('0x85')](_0x3378aa[_0x5da5('0x30')][_0x5da5('0x61')]);}})['then'](function(_0x33c78f){if(_0x33c78f){return db['CmHopperBlack']['destroy']({'where':{'ListId':_0x3378aa[_0x5da5('0x30')][_0x5da5('0x61')],'CampaignId':_0x3378aa['params']['id']}})[_0x5da5('0x21')](function(){return _0x33c78f;});}})['then'](respondWithStatusCode(_0x955466,null))[_0x5da5('0x41')](handleError(_0x955466,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index 3382457..c90ea7f 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 _0x947a=['Campaign','campaigns','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./campaign.attributes'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0x947a,0x1db));var _0xa947=function(_0x2f50ab,_0x4dfe90){_0x2f50ab=_0x2f50ab-0x0;var _0x1e9b19=_0x947a[_0x2f50ab];return _0x1e9b19;};'use strict';var _=require(_0xa947('0x0'));var util=require('util');var logger=require(_0xa947('0x1'))('api');var moment=require(_0xa947('0x2'));var BPromise=require(_0xa947('0x3'));var rp=require(_0xa947('0x4'));var fs=require('fs');var path=require(_0xa947('0x5'));var rimraf=require(_0xa947('0x6'));var config=require(_0xa947('0x7'));var attributes=require(_0xa947('0x8'));module['exports']=function(_0x14ab3f,_0x477045){return _0x14ab3f['define'](_0xa947('0x9'),attributes,{'tableName':_0xa947('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf128=['rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','campaigns','util','../../config/logger','moment','path'];(function(_0xd2ace9,_0x133c2c){var _0x14f789=function(_0x4d7e70){while(--_0x4d7e70){_0xd2ace9['push'](_0xd2ace9['shift']());}};_0x14f789(++_0x133c2c);}(_0xf128,0x15c));var _0x8f12=function(_0x12019a,_0x407485){_0x12019a=_0x12019a-0x0;var _0x49520a=_0xf128[_0x12019a];return _0x49520a;};'use strict';var _=require('lodash');var util=require(_0x8f12('0x0'));var logger=require(_0x8f12('0x1'))('api');var moment=require(_0x8f12('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x8f12('0x3'));var rimraf=require(_0x8f12('0x4'));var config=require(_0x8f12('0x5'));var attributes=require(_0x8f12('0x6'));module[_0x8f12('0x7')]=function(_0xa9901f,_0x1e2ca5){return _0xa9901f[_0x8f12('0x8')](_0x8f12('0x9'),attributes,{'tableName':_0x8f12('0xa'),'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 953b909..1b758b2 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2c7226,_0x29e306){var _0x7853d8=function(_0x569660){while(--_0x569660){_0x2c7226['push'](_0x2c7226['shift']());}};_0x7853d8(++_0x29e306);}(_0x9957,0x93));var _0x7995=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x9957[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x5ea9e1,_0xd42239){var _0x1443a9=function(_0xff7fe3){while(--_0xff7fe3){_0x5ea9e1['push'](_0x5ea9e1['shift']());}};_0x1443a9(++_0xd42239);}(_0x9957,0x93));var _0x7995=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x9957[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('Campaign,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index a836e22..d63f8a6 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 _0x2176=['show','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','/:id/hopper_black','getHopperBlacks','getLists','post','create','clone','/:id/lists','addLists','/:id/blacklists','put','delete','/:id','destroy','removeLists','removeBlackLists','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x291aaf,_0x4c6d8d){var _0x5571e6=function(_0x1b4fec){while(--_0x1b4fec){_0x291aaf['push'](_0x291aaf['shift']());}};_0x5571e6(++_0x4c6d8d);}(_0x2176,0xc8));var _0x6217=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2176[_0x20a584];return _0x4b41a8;};'use strict';var multer=require('multer');var util=require(_0x6217('0x0'));var path=require('path');var timeout=require(_0x6217('0x1'));var express=require(_0x6217('0x2'));var router=express[_0x6217('0x3')]();var auth=require(_0x6217('0x4'));var interaction=require(_0x6217('0x5'));var config=require(_0x6217('0x6'));var controller=require('./campaign.controller');router[_0x6217('0x7')]('/',auth[_0x6217('0x8')](),controller[_0x6217('0x9')]);router[_0x6217('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x6217('0xa')]);router[_0x6217('0x7')]('/:id/hoppers',auth[_0x6217('0x8')](),controller['getHoppers']);router[_0x6217('0x7')](_0x6217('0xb'),auth[_0x6217('0x8')](),controller[_0x6217('0xc')]);router[_0x6217('0x7')](_0x6217('0xd'),auth[_0x6217('0x8')](),controller['getHopperFinals']);router[_0x6217('0x7')](_0x6217('0xe'),auth[_0x6217('0x8')](),controller[_0x6217('0xf')]);router[_0x6217('0x7')]('/:id/lists',auth[_0x6217('0x8')](),controller[_0x6217('0x10')]);router[_0x6217('0x7')]('/:id/blacklists',auth[_0x6217('0x8')](),controller['getBlackLists']);router[_0x6217('0x11')]('/',auth[_0x6217('0x8')](),controller[_0x6217('0x12')]);router[_0x6217('0x11')]('/:id/clone',auth[_0x6217('0x8')](),controller[_0x6217('0x13')]);router[_0x6217('0x11')](_0x6217('0x14'),auth[_0x6217('0x8')](),controller[_0x6217('0x15')]);router[_0x6217('0x11')](_0x6217('0x16'),auth['isAuthenticated'](),controller['addBlackLists']);router[_0x6217('0x17')]('/:id',auth[_0x6217('0x8')](),controller['update']);router[_0x6217('0x18')](_0x6217('0x19'),auth['isAuthenticated'](),controller[_0x6217('0x1a')]);router['delete']('/:id/lists',auth['isAuthenticated'](),controller[_0x6217('0x1b')]);router[_0x6217('0x18')](_0x6217('0x16'),auth[_0x6217('0x8')](),controller[_0x6217('0x1c')]);module[_0x6217('0x1d')]=router; \ No newline at end of file +var _0x4c3d=['/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','clone','addBlackLists','put','/:id','update','delete','removeLists','removeBlackLists','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./campaign.controller','isAuthenticated','index','get','show','/:id/hoppers','getHoppers','/:id/hopper_histories'];(function(_0x355eea,_0x578068){var _0x257858=function(_0x3aa483){while(--_0x3aa483){_0x355eea['push'](_0x355eea['shift']());}};_0x257858(++_0x578068);}(_0x4c3d,0x123));var _0xd4c3=function(_0x12cb93,_0x3dc725){_0x12cb93=_0x12cb93-0x0;var _0x1a267e=_0x4c3d[_0x12cb93];return _0x1a267e;};'use strict';var multer=require(_0xd4c3('0x0'));var util=require('util');var path=require(_0xd4c3('0x1'));var timeout=require(_0xd4c3('0x2'));var express=require(_0xd4c3('0x3'));var router=express[_0xd4c3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd4c3('0x5'));var config=require(_0xd4c3('0x6'));var controller=require(_0xd4c3('0x7'));router['get']('/',auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x9')]);router[_0xd4c3('0xa')]('/:id',auth['isAuthenticated'](),controller[_0xd4c3('0xb')]);router[_0xd4c3('0xa')](_0xd4c3('0xc'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0xd')]);router['get'](_0xd4c3('0xe'),auth['isAuthenticated'](),controller['getHopperHistories']);router[_0xd4c3('0xa')](_0xd4c3('0xf'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x10')]);router['get'](_0xd4c3('0x11'),auth['isAuthenticated'](),controller[_0xd4c3('0x12')]);router[_0xd4c3('0xa')](_0xd4c3('0x13'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x14')]);router['get'](_0xd4c3('0x15'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x16')]);router[_0xd4c3('0x17')]('/',auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x18')]);router['post'](_0xd4c3('0x19'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x1a')]);router['post'](_0xd4c3('0x13'),auth[_0xd4c3('0x8')](),controller['addLists']);router['post'](_0xd4c3('0x15'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x1b')]);router[_0xd4c3('0x1c')](_0xd4c3('0x1d'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x1e')]);router[_0xd4c3('0x1f')](_0xd4c3('0x1d'),auth['isAuthenticated'](),controller['destroy']);router[_0xd4c3('0x1f')](_0xd4c3('0x13'),auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x20')]);router['delete']('/:id/blacklists',auth[_0xd4c3('0x8')](),controller[_0xd4c3('0x21')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 75e6c66..65c47d5 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 _0xe6e3=['getDataValue','key','sequelize','TEXT','STRING'];(function(_0x4ecc6b,_0x498935){var _0x179239=function(_0x506f0f){while(--_0x506f0f){_0x4ecc6b['push'](_0x4ecc6b['shift']());}};_0x179239(++_0x498935);}(_0xe6e3,0x1ec));var _0x3e6e=function(_0x1ce67b,_0x5d1e9f){_0x1ce67b=_0x1ce67b-0x0;var _0xc64cb0=_0xe6e3[_0x1ce67b];return _0xc64cb0;};'use strict';var Sequelize=require(_0x3e6e('0x0'));module['exports']={'key':{'type':Sequelize['STRING'],'allowNull':![]},'value':{'type':Sequelize[_0x3e6e('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x3e6e('0x2')]},'name':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x3e6e('0x3')](_0x3e6e('0x4'));}}}; \ No newline at end of file +var _0xb956=['getDataValue','sequelize','exports','STRING','TEXT','VIRTUAL'];(function(_0x518c89,_0x42ad66){var _0x4aee9d=function(_0xe5a064){while(--_0xe5a064){_0x518c89['push'](_0x518c89['shift']());}};_0x4aee9d(++_0x42ad66);}(_0xb956,0x15d));var _0x6b95=function(_0x407de4,_0x39b031){_0x407de4=_0x407de4-0x0;var _0x49b3a5=_0xb956[_0x407de4];return _0x49b3a5;};'use strict';var Sequelize=require(_0x6b95('0x0'));module[_0x6b95('0x1')]={'key':{'type':Sequelize[_0x6b95('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x6b95('0x3')],'allowNull':![]},'description':{'type':Sequelize[_0x6b95('0x2')]},'name':{'type':Sequelize[_0x6b95('0x4')],'get':function(){return this[_0x6b95('0x5')]('key');}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index 0bffa17..7c30a8c 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 _0x34e8=['filters','intersection','attributes','fields','length','order','sort','pick','filter','where','merge','options','include','findAll','catch','show','includeAll','find','body','params','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','The\x20inserted\x20key\x20already\x20exists.','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','CannedAnswers','destroy','sendStatus','error','stack','name','map','CannedAnswer','rawAttributes','fieldName','type','key','model','keys','query'];(function(_0x1594db,_0x4738eb){var _0x3dabee=function(_0x578c2){while(--_0x578c2){_0x1594db['push'](_0x1594db['shift']());}};_0x3dabee(++_0x4738eb);}(_0x34e8,0x12c));var _0x834e=function(_0x157c77,_0x477a14){_0x157c77=_0x157c77-0x0;var _0x2afa0f=_0x34e8[_0x157c77];return _0x2afa0f;};'use strict';var pdf=require(_0x834e('0x0'));var emlformat=require(_0x834e('0x1'));var rimraf=require(_0x834e('0x2'));var zipdir=require(_0x834e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x834e('0x4'));var moment=require(_0x834e('0x5'));var BPromise=require(_0x834e('0x6'));var Mustache=require(_0x834e('0x7'));var util=require(_0x834e('0x8'));var path=require(_0x834e('0x9'));var sox=require(_0x834e('0xa'));var csv=require('to-csv');var ejs=require(_0x834e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x834e('0xc'));var crypto=require(_0x834e('0xd'));var jsforce=require(_0x834e('0xe'));var deskjs=require(_0x834e('0xf'));var toCsv=require(_0x834e('0x10'));var querystring=require(_0x834e('0x11'));var Papa=require(_0x834e('0x12'));var Redis=require(_0x834e('0x13'));var authService=require(_0x834e('0x14'));var qs=require(_0x834e('0x15'));var as=require(_0x834e('0x16'));var hardwareService=require(_0x834e('0x17'));var logger=require(_0x834e('0x18'))(_0x834e('0x19'));var utils=require(_0x834e('0x1a'));var config=require(_0x834e('0x1b'));var db=require(_0x834e('0x1c'))['db'];function respondWithStatusCode(_0x538bb3,_0x5e5b6d){_0x5e5b6d=_0x5e5b6d||0xcc;return function(_0x6cd9b9){if(_0x6cd9b9){return _0x538bb3['sendStatus'](_0x5e5b6d);}return _0x538bb3[_0x834e('0x1d')](_0x5e5b6d)[_0x834e('0x1e')]();};}function respondWithResult(_0x28e659,_0x21cc0a){_0x21cc0a=_0x21cc0a||0xc8;return function(_0x50e860){if(_0x50e860){return _0x28e659[_0x834e('0x1d')](_0x21cc0a)[_0x834e('0x1f')](_0x50e860);}};}function respondWithFilteredResult(_0x57274a,_0x316205){return function(_0x4a9cdc){if(_0x4a9cdc){var _0x38a8cd=_0x4a9cdc[_0x834e('0x20')],_0x36d443=_0x316205[_0x834e('0x21')],_0x478afe=_0x316205['offset']+_0x316205[_0x834e('0x22')],_0x43ac41;if(_0x478afe>=_0x38a8cd){_0x478afe=_0x38a8cd;_0x43ac41=0xc8;}else{_0x43ac41=0xce;}_0x57274a[_0x834e('0x1d')](_0x43ac41);return _0x57274a[_0x834e('0x23')](_0x834e('0x24'),_0x36d443+'-'+_0x478afe+'/'+_0x38a8cd)[_0x834e('0x1f')](_0x4a9cdc);}return null;};}function patchUpdates(_0x254677){return function(_0x1dd214){try{jsonpatch['apply'](_0x1dd214,_0x254677,!![]);}catch(_0x2545b4){return BPromise[_0x834e('0x25')](_0x2545b4);}return _0x1dd214[_0x834e('0x26')]();};}function saveUpdates(_0x325a99,_0x4ab05d){return function(_0x45a630){if(_0x45a630){return _0x45a630[_0x834e('0x27')](_0x325a99)['then'](function(_0x1b4bdf){return _0x1b4bdf;});}return null;};}function removeEntity(_0x28d687,_0x8d406e){return function(_0x5c55ca){if(_0x5c55ca){return _0x5c55ca['destroy']()[_0x834e('0x28')](function(){var _0x34563b=_0x5c55ca['get']({'plain':!![]});var _0x25ee1d=_0x834e('0x29');return db['UserProfileResource'][_0x834e('0x2a')]({'where':{'type':_0x25ee1d,'resourceId':_0x34563b['id']}})[_0x834e('0x28')](function(){return _0x5c55ca;});})[_0x834e('0x28')](function(){_0x28d687['status'](0xcc)[_0x834e('0x1e')]();});}};}function handleEntityNotFound(_0x3e310f,_0x5e1cc5){return function(_0x5bef62){if(!_0x5bef62){_0x3e310f[_0x834e('0x2b')](0x194);}return _0x5bef62;};}function handleError(_0x508a1d,_0x2826ec){_0x2826ec=_0x2826ec||0x1f4;return function(_0x3f1b0b){logger[_0x834e('0x2c')](_0x3f1b0b[_0x834e('0x2d')]);if(_0x3f1b0b[_0x834e('0x2e')]){delete _0x3f1b0b[_0x834e('0x2e')];}_0x508a1d['status'](_0x2826ec)['send'](_0x3f1b0b);};}exports['index']=function(_0x58c1d7,_0x2c7a8d){var _0x567cea={},_0x106d6a={},_0x5dacc1={'count':0x0,'rows':[]};var _0xb5bc06=_[_0x834e('0x2f')](db[_0x834e('0x30')][_0x834e('0x31')],function(_0x4551f5){return{'name':_0x4551f5[_0x834e('0x32')],'type':_0x4551f5[_0x834e('0x33')][_0x834e('0x34')]};});_0x106d6a[_0x834e('0x35')]=_['map'](_0xb5bc06,_0x834e('0x2e'));_0x106d6a['query']=_[_0x834e('0x36')](_0x58c1d7[_0x834e('0x37')]);_0x106d6a[_0x834e('0x38')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],_0x106d6a[_0x834e('0x37')]);_0x567cea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x106d6a[_0x834e('0x35')],qs[_0x834e('0x3b')](_0x58c1d7['query'][_0x834e('0x3b')]));_0x567cea[_0x834e('0x3a')]=_0x567cea[_0x834e('0x3a')][_0x834e('0x3c')]?_0x567cea['attributes']:_0x106d6a[_0x834e('0x35')];if(!_0x58c1d7[_0x834e('0x37')]['hasOwnProperty']('nolimit')){_0x567cea['limit']=qs[_0x834e('0x22')](_0x58c1d7[_0x834e('0x37')][_0x834e('0x22')]);_0x567cea[_0x834e('0x21')]=qs[_0x834e('0x21')](_0x58c1d7[_0x834e('0x37')]['offset']);}_0x567cea[_0x834e('0x3d')]=qs['sort'](_0x58c1d7[_0x834e('0x37')][_0x834e('0x3e')]);_0x567cea['where']=qs[_0x834e('0x38')](_[_0x834e('0x3f')](_0x58c1d7['query'],_0x106d6a['filters']));if(_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]){_0x567cea[_0x834e('0x41')]=_[_0x834e('0x42')](_0x567cea[_0x834e('0x41')],{'$or':_['map'](_0xb5bc06,function(_0x1c5ed6){if(_0x1c5ed6['type']!=='VIRTUAL'){var _0x1b2edf={};_0x1b2edf[_0x1c5ed6['name']]={'$like':'%'+_0x58c1d7[_0x834e('0x37')][_0x834e('0x40')]+'%'};return _0x1b2edf;}})});}_0x567cea=_[_0x834e('0x42')]({},_0x567cea,_0x58c1d7[_0x834e('0x43')]);var _0x2b7933={'where':_0x567cea['where']};return db[_0x834e('0x30')][_0x834e('0x20')](_0x2b7933)[_0x834e('0x28')](function(_0x58c5fb){_0x5dacc1[_0x834e('0x20')]=_0x58c5fb;if(_0x58c1d7[_0x834e('0x37')]['includeAll']){_0x567cea[_0x834e('0x44')]=[{'all':!![]}];}return db['CannedAnswer'][_0x834e('0x45')](_0x567cea);})[_0x834e('0x28')](function(_0x4a18bb){_0x5dacc1['rows']=_0x4a18bb;return _0x5dacc1;})[_0x834e('0x28')](respondWithFilteredResult(_0x2c7a8d,_0x567cea))[_0x834e('0x46')](handleError(_0x2c7a8d,null));};exports[_0x834e('0x47')]=function(_0xbc1571,_0x8ad264){var _0x23feea={'raw':!![],'where':{'id':_0xbc1571['params']['id']}},_0x195204={};_0x195204[_0x834e('0x35')]=_['keys'](db[_0x834e('0x30')]['rawAttributes']);_0x195204[_0x834e('0x37')]=_['keys'](_0xbc1571[_0x834e('0x37')]);_0x195204[_0x834e('0x38')]=_['intersection'](_0x195204[_0x834e('0x35')],_0x195204[_0x834e('0x37')]);_0x23feea[_0x834e('0x3a')]=_[_0x834e('0x39')](_0x195204[_0x834e('0x35')],qs[_0x834e('0x3b')](_0xbc1571[_0x834e('0x37')][_0x834e('0x3b')]));_0x23feea[_0x834e('0x3a')]=_0x23feea[_0x834e('0x3a')]['length']?_0x23feea[_0x834e('0x3a')]:_0x195204[_0x834e('0x35')];if(_0xbc1571['query'][_0x834e('0x48')]){_0x23feea[_0x834e('0x44')]=[{'all':!![]}];}_0x23feea=_[_0x834e('0x42')]({},_0x23feea,_0xbc1571[_0x834e('0x43')]);return db[_0x834e('0x30')][_0x834e('0x49')](_0x23feea)['then'](handleEntityNotFound(_0x8ad264,null))['then'](respondWithResult(_0x8ad264,null))[_0x834e('0x46')](handleError(_0x8ad264,null));};exports[_0x834e('0x27')]=function(_0x30568e,_0x40ff5a){if(_0x30568e[_0x834e('0x4a')]['id']){delete _0x30568e[_0x834e('0x4a')]['id'];}return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x30568e[_0x834e('0x4b')]['id']}})[_0x834e('0x28')](handleEntityNotFound(_0x40ff5a,null))[_0x834e('0x28')](saveUpdates(_0x30568e[_0x834e('0x4a')],null))[_0x834e('0x28')](respondWithResult(_0x40ff5a,null))[_0x834e('0x46')](handleError(_0x40ff5a,null));};exports[_0x834e('0x2a')]=function(_0x1a3855,_0x3df078){return db[_0x834e('0x30')][_0x834e('0x49')]({'where':{'id':_0x1a3855[_0x834e('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3df078,null))[_0x834e('0x28')](removeEntity(_0x3df078,null))[_0x834e('0x46')](handleError(_0x3df078,null));};exports['create']=function(_0x3c00a3,_0x3b0988){var _0x55d491={'key':_0x3c00a3[_0x834e('0x4a')][_0x834e('0x34')]};if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')]){_0x55d491[_0x834e('0x4c')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4c')];}else if(_0x3c00a3['body'][_0x834e('0x4d')]){_0x55d491[_0x834e('0x4d')]=_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4d')];}else if(_0x3c00a3[_0x834e('0x4a')][_0x834e('0x4e')]){_0x55d491[_0x834e('0x4e')]=_0x3c00a3[_0x834e('0x4a')]['OpenchannelAccountId'];}else if(_0x3c00a3[_0x834e('0x4a')]['ChatWebsiteId']){_0x55d491[_0x834e('0x4f')]=_0x3c00a3['body'][_0x834e('0x4f')];}return db['CannedAnswer']['find']({'where':_0x55d491})[_0x834e('0x28')](function(_0x3e1bee){if(_0x3e1bee){throw new db['Sequelize']['ValidationError'](_0x834e('0x50'));}return db[_0x834e('0x30')][_0x834e('0x51')](_0x3c00a3[_0x834e('0x4a')]);})[_0x834e('0x28')](function(_0x315858){var _0x3d3f2b=_0x3c00a3[_0x834e('0x52')]['get']({'plain':!![]});if(!_0x3d3f2b)throw new Error(_0x834e('0x53'));if(_0x3d3f2b[_0x834e('0x54')]==='user'){var _0x281342=_0x315858['get']({'plain':!![]});return db[_0x834e('0x55')][_0x834e('0x49')]({'where':{'name':'CannedAnswers','userProfileId':_0x3d3f2b[_0x834e('0x56')]},'raw':!![]})[_0x834e('0x28')](function(_0x2de29a){if(_0x2de29a&&_0x2de29a[_0x834e('0x57')]===0x0){return db['UserProfileResource'][_0x834e('0x51')]({'name':_0x281342[_0x834e('0x2e')],'resourceId':_0x281342['id'],'type':_0x2de29a[_0x834e('0x2e')],'sectionId':_0x2de29a['id']},{})['then'](function(){return _0x315858;});}else{return _0x315858;}})[_0x834e('0x46')](function(_0x1fcae9){logger[_0x834e('0x2c')](_0x834e('0x58'),_0x1fcae9);throw _0x1fcae9;});}return _0x315858;})[_0x834e('0x28')](respondWithResult(_0x3b0988,0xc9))[_0x834e('0x46')](handleError(_0x3b0988,null));}; \ No newline at end of file +var _0xa9e0=['filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','include','find','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','Sequelize','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','CannedAnswers','UserProfileResource','end','error','name','send','index','map','CannedAnswer','rawAttributes','type','key','model','query','keys'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];function respondWithStatusCode(_0x36471c,_0xd5b662){_0xd5b662=_0xd5b662||0xcc;return function(_0x26d672){if(_0x26d672){return _0x36471c[_0x0a9e('0x14')](_0xd5b662);}return _0x36471c[_0x0a9e('0x15')](_0xd5b662)['end']();};}function respondWithResult(_0x4283ce,_0x239b12){_0x239b12=_0x239b12||0xc8;return function(_0x2b4227){if(_0x2b4227){return _0x4283ce[_0x0a9e('0x15')](_0x239b12)[_0x0a9e('0x16')](_0x2b4227);}};}function respondWithFilteredResult(_0x4d5611,_0x52a03d){return function(_0x22dccb){if(_0x22dccb){var _0x5d0880=_0x22dccb[_0x0a9e('0x17')],_0x1985b6=_0x52a03d['offset'],_0x519dfd=_0x52a03d[_0x0a9e('0x18')]+_0x52a03d['limit'],_0x16033c;if(_0x519dfd>=_0x5d0880){_0x519dfd=_0x5d0880;_0x16033c=0xc8;}else{_0x16033c=0xce;}_0x4d5611[_0x0a9e('0x15')](_0x16033c);return _0x4d5611[_0x0a9e('0x19')](_0x0a9e('0x1a'),_0x1985b6+'-'+_0x519dfd+'/'+_0x5d0880)[_0x0a9e('0x16')](_0x22dccb);}return null;};}function patchUpdates(_0x31b1ca){return function(_0x2eb11f){try{jsonpatch[_0x0a9e('0x1b')](_0x2eb11f,_0x31b1ca,!![]);}catch(_0x20559e){return BPromise[_0x0a9e('0x1c')](_0x20559e);}return _0x2eb11f[_0x0a9e('0x1d')]();};}function saveUpdates(_0x1c696a,_0x105080){return function(_0x4bb1e3){if(_0x4bb1e3){return _0x4bb1e3[_0x0a9e('0x1e')](_0x1c696a)[_0x0a9e('0x1f')](function(_0x53682f){return _0x53682f;});}return null;};}function removeEntity(_0x20f109,_0x5a09ef){return function(_0x588269){if(_0x588269){return _0x588269[_0x0a9e('0x20')]()[_0x0a9e('0x1f')](function(){var _0x38e7c4=_0x588269[_0x0a9e('0x21')]({'plain':!![]});var _0x4abc77=_0x0a9e('0x22');return db[_0x0a9e('0x23')][_0x0a9e('0x20')]({'where':{'type':_0x4abc77,'resourceId':_0x38e7c4['id']}})[_0x0a9e('0x1f')](function(){return _0x588269;});})[_0x0a9e('0x1f')](function(){_0x20f109[_0x0a9e('0x15')](0xcc)[_0x0a9e('0x24')]();});}};}function handleEntityNotFound(_0x5ea472,_0x59181e){return function(_0x197ec0){if(!_0x197ec0){_0x5ea472[_0x0a9e('0x14')](0x194);}return _0x197ec0;};}function handleError(_0x40c424,_0x33161b){_0x33161b=_0x33161b||0x1f4;return function(_0x526cf3){logger[_0x0a9e('0x25')](_0x526cf3['stack']);if(_0x526cf3[_0x0a9e('0x26')]){delete _0x526cf3['name'];}_0x40c424[_0x0a9e('0x15')](_0x33161b)[_0x0a9e('0x27')](_0x526cf3);};}exports[_0x0a9e('0x28')]=function(_0x14433c,_0x140511){var _0x1538a4={},_0x11c3b6={},_0x14de77={'count':0x0,'rows':[]};var _0x5a101a=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x2ec755){return{'name':_0x2ec755['fieldName'],'type':_0x2ec755[_0x0a9e('0x2c')][_0x0a9e('0x2d')]};});_0x11c3b6[_0x0a9e('0x2e')]=_[_0x0a9e('0x29')](_0x5a101a,_0x0a9e('0x26'));_0x11c3b6[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x14433c[_0x0a9e('0x2f')]);_0x11c3b6[_0x0a9e('0x31')]=_['intersection'](_0x11c3b6[_0x0a9e('0x2e')],_0x11c3b6['query']);_0x1538a4[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x11c3b6[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x14433c[_0x0a9e('0x2f')]['fields']));_0x1538a4[_0x0a9e('0x32')]=_0x1538a4[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x1538a4[_0x0a9e('0x32')]:_0x11c3b6[_0x0a9e('0x2e')];if(!_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x36')](_0x0a9e('0x37'))){_0x1538a4['limit']=qs[_0x0a9e('0x38')](_0x14433c['query'][_0x0a9e('0x38')]);_0x1538a4[_0x0a9e('0x18')]=qs[_0x0a9e('0x18')](_0x14433c[_0x0a9e('0x2f')]['offset']);}_0x1538a4[_0x0a9e('0x39')]=qs[_0x0a9e('0x3a')](_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3a')]);_0x1538a4['where']=qs['filters'](_[_0x0a9e('0x3b')](_0x14433c['query'],_0x11c3b6[_0x0a9e('0x31')]));if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x3c')]){_0x1538a4[_0x0a9e('0x3d')]=_['merge'](_0x1538a4[_0x0a9e('0x3d')],{'$or':_[_0x0a9e('0x29')](_0x5a101a,function(_0x3cae){if(_0x3cae['type']!==_0x0a9e('0x3e')){var _0x1a180b={};_0x1a180b[_0x3cae[_0x0a9e('0x26')]]={'$like':'%'+_0x14433c['query']['filter']+'%'};return _0x1a180b;}})});}_0x1538a4=_[_0x0a9e('0x3f')]({},_0x1538a4,_0x14433c[_0x0a9e('0x40')]);var _0x5adda1={'where':_0x1538a4[_0x0a9e('0x3d')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x17')](_0x5adda1)[_0x0a9e('0x1f')](function(_0x4b38d9){_0x14de77['count']=_0x4b38d9;if(_0x14433c[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x1538a4['include']=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x42')](_0x1538a4);})[_0x0a9e('0x1f')](function(_0x5b4f5e){_0x14de77[_0x0a9e('0x43')]=_0x5b4f5e;return _0x14de77;})[_0x0a9e('0x1f')](respondWithFilteredResult(_0x140511,_0x1538a4))[_0x0a9e('0x44')](handleError(_0x140511,null));};exports[_0x0a9e('0x45')]=function(_0x13cb1f,_0xeaa5e5){var _0x2881b3={'raw':!![],'where':{'id':_0x13cb1f[_0x0a9e('0x46')]['id']}},_0x45a9b8={};_0x45a9b8[_0x0a9e('0x2e')]=_[_0x0a9e('0x30')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x45a9b8[_0x0a9e('0x2f')]=_[_0x0a9e('0x30')](_0x13cb1f['query']);_0x45a9b8['filters']=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],_0x45a9b8[_0x0a9e('0x2f')]);_0x2881b3[_0x0a9e('0x32')]=_[_0x0a9e('0x33')](_0x45a9b8[_0x0a9e('0x2e')],qs[_0x0a9e('0x34')](_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x34')]));_0x2881b3[_0x0a9e('0x32')]=_0x2881b3[_0x0a9e('0x32')][_0x0a9e('0x35')]?_0x2881b3['attributes']:_0x45a9b8[_0x0a9e('0x2e')];if(_0x13cb1f[_0x0a9e('0x2f')][_0x0a9e('0x41')]){_0x2881b3[_0x0a9e('0x47')]=[{'all':!![]}];}_0x2881b3=_[_0x0a9e('0x3f')]({},_0x2881b3,_0x13cb1f[_0x0a9e('0x40')]);return db[_0x0a9e('0x2a')][_0x0a9e('0x48')](_0x2881b3)['then'](handleEntityNotFound(_0xeaa5e5,null))[_0x0a9e('0x1f')](respondWithResult(_0xeaa5e5,null))['catch'](handleError(_0xeaa5e5,null));};exports[_0x0a9e('0x1e')]=function(_0x476688,_0x8d6dd1){if(_0x476688['body']['id']){delete _0x476688[_0x0a9e('0x49')]['id'];}return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x476688[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x8d6dd1,null))[_0x0a9e('0x1f')](saveUpdates(_0x476688[_0x0a9e('0x49')],null))['then'](respondWithResult(_0x8d6dd1,null))[_0x0a9e('0x44')](handleError(_0x8d6dd1,null));};exports[_0x0a9e('0x20')]=function(_0x1b5e80,_0x16f976){return db[_0x0a9e('0x2a')][_0x0a9e('0x48')]({'where':{'id':_0x1b5e80[_0x0a9e('0x46')]['id']}})[_0x0a9e('0x1f')](handleEntityNotFound(_0x16f976,null))[_0x0a9e('0x1f')](removeEntity(_0x16f976,null))['catch'](handleError(_0x16f976,null));};exports[_0x0a9e('0x4a')]=function(_0x3fe430,_0x4f7240){var _0x4ae14b={'key':_0x3fe430['body'][_0x0a9e('0x2d')]};if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')]){_0x4ae14b[_0x0a9e('0x4b')]=_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4b')];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4c')]){_0x4ae14b['SmsAccountId']=_0x3fe430['body']['SmsAccountId'];}else if(_0x3fe430[_0x0a9e('0x49')][_0x0a9e('0x4d')]){_0x4ae14b[_0x0a9e('0x4d')]=_0x3fe430['body'][_0x0a9e('0x4d')];}else if(_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId']){_0x4ae14b['ChatWebsiteId']=_0x3fe430[_0x0a9e('0x49')]['ChatWebsiteId'];}return db[_0x0a9e('0x2a')]['find']({'where':_0x4ae14b})[_0x0a9e('0x1f')](function(_0x3c20b2){if(_0x3c20b2){throw new db[(_0x0a9e('0x4e'))]['ValidationError'](_0x0a9e('0x4f'));}return db[_0x0a9e('0x2a')]['create'](_0x3fe430['body']);})[_0x0a9e('0x1f')](function(_0x3aedd0){var _0x49c095=_0x3fe430[_0x0a9e('0x50')]['get']({'plain':!![]});if(!_0x49c095)throw new Error(_0x0a9e('0x51'));if(_0x49c095['role']===_0x0a9e('0x50')){var _0x4a6deb=_0x3aedd0['get']({'plain':!![]});return db['UserProfileSection'][_0x0a9e('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x49c095[_0x0a9e('0x52')]},'raw':!![]})[_0x0a9e('0x1f')](function(_0x3cfd00){if(_0x3cfd00&&_0x3cfd00[_0x0a9e('0x53')]===0x0){return db[_0x0a9e('0x23')][_0x0a9e('0x4a')]({'name':_0x4a6deb[_0x0a9e('0x26')],'resourceId':_0x4a6deb['id'],'type':_0x3cfd00[_0x0a9e('0x26')],'sectionId':_0x3cfd00['id']},{})['then'](function(){return _0x3aedd0;});}else{return _0x3aedd0;}})[_0x0a9e('0x44')](function(_0x121cef){logger[_0x0a9e('0x25')](_0x0a9e('0x54'),_0x121cef);throw _0x121cef;});}return _0x3aedd0;})[_0x0a9e('0x1f')](respondWithResult(_0x4f7240,0xc9))[_0x0a9e('0x44')](handleError(_0x4f7240,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 1a14e7c..72fc2e2 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 _0x96d5=['../../config/environment','exports','define','CannedAnswer','tools_canned_answers','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x372884,_0x3116d0){var _0x1ffc72=function(_0x1c3bfa){while(--_0x1c3bfa){_0x372884['push'](_0x372884['shift']());}};_0x1ffc72(++_0x3116d0);}(_0x96d5,0x166));var _0x596d=function(_0x3e4fac,_0x6f96a5){_0x3e4fac=_0x3e4fac-0x0;var _0x46a742=_0x96d5[_0x3e4fac];return _0x46a742;};'use strict';var _=require(_0x596d('0x0'));var util=require('util');var logger=require(_0x596d('0x1'))(_0x596d('0x2'));var moment=require('moment');var BPromise=require(_0x596d('0x3'));var rp=require(_0x596d('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x596d('0x5'));var config=require(_0x596d('0x6'));var attributes=require('./cannedAnswer.attributes');module[_0x596d('0x7')]=function(_0x1c8bbd,_0xfc78e8){return _0x1c8bbd[_0x596d('0x8')](_0x596d('0x9'),attributes,{'tableName':_0x596d('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x596d('0xb'),'collate':_0x596d('0xc')});}; \ No newline at end of file +var _0xedb4=['./cannedAnswer.attributes','CannedAnswer','tools_canned_answers','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x9f9584,_0x53b8bb){var _0x5aaed3=function(_0x54804b){while(--_0x54804b){_0x9f9584['push'](_0x9f9584['shift']());}};_0x5aaed3(++_0x53b8bb);}(_0xedb4,0x156));var _0x4edb=function(_0x52b24f,_0xca062d){_0x52b24f=_0x52b24f-0x0;var _0x46ea6b=_0xedb4[_0x52b24f];return _0x46ea6b;};'use strict';var _=require('lodash');var util=require(_0x4edb('0x0'));var logger=require(_0x4edb('0x1'))(_0x4edb('0x2'));var moment=require(_0x4edb('0x3'));var BPromise=require(_0x4edb('0x4'));var rp=require(_0x4edb('0x5'));var fs=require('fs');var path=require(_0x4edb('0x6'));var rimraf=require(_0x4edb('0x7'));var config=require(_0x4edb('0x8'));var attributes=require(_0x4edb('0x9'));module['exports']=function(_0x469d30,_0xe7762c){return _0x469d30['define'](_0x4edb('0xa'),attributes,{'tableName':_0x4edb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4edb('0xc')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index d56ea0b..8214259 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 _0x5988=['CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','client','http','then','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x3efe83,_0x186451){var _0x4f3054=function(_0x4e7c08){while(--_0x4e7c08){_0x3efe83['push'](_0x3efe83['shift']());}};_0x4f3054(++_0x186451);}(_0x5988,0xda));var _0x8598=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x5988[_0x4b2436];return _0x4f5ab2;};'use strict';var _=require(_0x8598('0x0'));var util=require('util');var moment=require(_0x8598('0x1'));var BPromise=require(_0x8598('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8598('0x3'));var db=require(_0x8598('0x4'))['db'];var utils=require(_0x8598('0x5'));var logger=require('../../config/logger')(_0x8598('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x8598('0x7')][_0x8598('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3e341c,_0x37f778,_0x38418d){return new BPromise(function(_0x50fc78,_0x553f06){return client['request'](_0x3e341c,_0x38418d)[_0x8598('0x9')](function(_0x69f45c){logger['info'](_0x8598('0xa'),_0x37f778,_0x8598('0xb'));logger[_0x8598('0xc')](_0x8598('0xd'),_0x37f778,'request\x20sent',JSON[_0x8598('0xe')](_0x69f45c));if(_0x69f45c[_0x8598('0xf')]){if(_0x69f45c[_0x8598('0xf')][_0x8598('0x10')]===0x1f4){logger[_0x8598('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x37f778,_0x69f45c[_0x8598('0xf')][_0x8598('0x11')]);return _0x553f06(_0x69f45c[_0x8598('0xf')][_0x8598('0x11')]);}logger['error'](_0x8598('0xa'),_0x37f778,_0x69f45c[_0x8598('0xf')][_0x8598('0x11')]);return _0x50fc78(_0x69f45c[_0x8598('0xf')][_0x8598('0x11')]);}else{logger[_0x8598('0x12')](_0x8598('0xa'),_0x37f778,'request\x20sent');_0x50fc78(_0x69f45c[_0x8598('0x13')][_0x8598('0x11')]);}})[_0x8598('0x14')](function(_0x229ce5){logger[_0x8598('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x37f778,_0x229ce5);_0x553f06(_0x229ce5);});});} \ No newline at end of file +var _0x8602=['request\x20sent','debug','stringify','error','code','message','CannedAnswer,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x5e507a,_0x1af135){var _0x3a24dc=function(_0x52de01){while(--_0x52de01){_0x5e507a['push'](_0x5e507a['shift']());}};_0x3a24dc(++_0x1af135);}(_0x8602,0x135));var _0x2860=function(_0x4bd06e,_0x593701){_0x4bd06e=_0x4bd06e-0x0;var _0x85ebb=_0x8602[_0x4bd06e];return _0x85ebb;};'use strict';var _=require('lodash');var util=require(_0x2860('0x0'));var moment=require(_0x2860('0x1'));var BPromise=require(_0x2860('0x2'));var rs=require(_0x2860('0x3'));var fs=require('fs');var Redis=require(_0x2860('0x4'));var db=require(_0x2860('0x5'))['db'];var utils=require(_0x2860('0x6'));var logger=require(_0x2860('0x7'))(_0x2860('0x8'));var config=require(_0x2860('0x9'));var jayson=require(_0x2860('0xa'));var client=jayson[_0x2860('0xb')][_0x2860('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x15a841,_0x3e2f08,_0x5a96b0){return new BPromise(function(_0x1d929e,_0x139837){return client[_0x2860('0xd')](_0x15a841,_0x5a96b0)[_0x2860('0xe')](function(_0x55b639){logger[_0x2860('0xf')]('CannedAnswer,\x20%s,\x20%s',_0x3e2f08,_0x2860('0x10'));logger[_0x2860('0x11')]('CannedAnswer,\x20%s,\x20%s,\x20%s',_0x3e2f08,'request\x20sent',JSON[_0x2860('0x12')](_0x55b639));if(_0x55b639[_0x2860('0x13')]){if(_0x55b639[_0x2860('0x13')][_0x2860('0x14')]===0x1f4){logger['error']('CannedAnswer,\x20%s,\x20%s',_0x3e2f08,_0x55b639[_0x2860('0x13')][_0x2860('0x15')]);return _0x139837(_0x55b639[_0x2860('0x13')][_0x2860('0x15')]);}logger[_0x2860('0x13')]('CannedAnswer,\x20%s,\x20%s',_0x3e2f08,_0x55b639[_0x2860('0x13')][_0x2860('0x15')]);return _0x1d929e(_0x55b639['error']['message']);}else{logger[_0x2860('0xf')](_0x2860('0x16'),_0x3e2f08,_0x2860('0x10'));_0x1d929e(_0x55b639[_0x2860('0x17')][_0x2860('0x15')]);}})[_0x2860('0x18')](function(_0x51c2f3){logger[_0x2860('0x13')](_0x2860('0x16'),_0x3e2f08,_0x51c2f3);_0x139837(_0x51c2f3);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index ee415c7..9574974 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 _0x2630=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','create','put','/:id','delete','destroy','exports','util','path'];(function(_0x47fa57,_0x1ef66c){var _0x3808aa=function(_0x3f6698){while(--_0x3f6698){_0x47fa57['push'](_0x47fa57['shift']());}};_0x3808aa(++_0x1ef66c);}(_0x2630,0xca));var _0x0263=function(_0x2857ae,_0x565f0f){_0x2857ae=_0x2857ae-0x0;var _0x5dfe32=_0x2630[_0x2857ae];return _0x5dfe32;};'use strict';var multer=require('multer');var util=require(_0x0263('0x0'));var path=require(_0x0263('0x1'));var timeout=require(_0x0263('0x2'));var express=require(_0x0263('0x3'));var router=express[_0x0263('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0263('0x5'));var config=require(_0x0263('0x6'));var controller=require(_0x0263('0x7'));router[_0x0263('0x8')]('/',auth[_0x0263('0x9')](),controller[_0x0263('0xa')]);router[_0x0263('0x8')]('/:id',auth[_0x0263('0x9')](),controller['show']);router['post']('/',auth[_0x0263('0x9')](),controller[_0x0263('0xb')]);router[_0x0263('0xc')](_0x0263('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0263('0xe')](_0x0263('0xd'),auth[_0x0263('0x9')](),controller[_0x0263('0xf')]);module[_0x0263('0x10')]=router; \ No newline at end of file +var _0x2e08=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','/:id','show','post','create','put','exports','multer','path','connect-timeout'];(function(_0x267b07,_0x30a4a9){var _0x28f8c3=function(_0x3ca6bc){while(--_0x3ca6bc){_0x267b07['push'](_0x267b07['shift']());}};_0x28f8c3(++_0x30a4a9);}(_0x2e08,0x1ad));var _0x82e0=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2e08[_0x42cae2];return _0x5f256f;};'use strict';var multer=require(_0x82e0('0x0'));var util=require('util');var path=require(_0x82e0('0x1'));var timeout=require(_0x82e0('0x2'));var express=require('express');var router=express[_0x82e0('0x3')]();var auth=require(_0x82e0('0x4'));var interaction=require(_0x82e0('0x5'));var config=require(_0x82e0('0x6'));var controller=require(_0x82e0('0x7'));router[_0x82e0('0x8')]('/',auth[_0x82e0('0x9')](),controller['index']);router[_0x82e0('0x8')](_0x82e0('0xa'),auth[_0x82e0('0x9')](),controller[_0x82e0('0xb')]);router[_0x82e0('0xc')]('/',auth[_0x82e0('0x9')](),controller[_0x82e0('0xd')]);router[_0x82e0('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x82e0('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0x82e0('0xf')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index de83f70..f1b3df9 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 _0xde7a=['INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING'];(function(_0x4839d1,_0x91ca6f){var _0x53d852=function(_0x5324eb){while(--_0x5324eb){_0x4839d1['push'](_0x4839d1['shift']());}};_0x53d852(++_0x91ca6f);}(_0xde7a,0x175));var _0xade7=function(_0x15311a,_0x3dfeee){_0x15311a=_0x15311a-0x0;var _0x378b48=_0xde7a[_0x15311a];return _0x378b48;};'use strict';var Sequelize=require(_0xade7('0x0'));module[_0xade7('0x1')]={'calldate':{'type':Sequelize[_0xade7('0x2')],'allowNull':![],'defaultValue':_0xade7('0x3')},'clid':{'type':Sequelize[_0xade7('0x4')]},'src':{'type':Sequelize[_0xade7('0x4')]},'dst':{'type':Sequelize[_0xade7('0x4')]},'dcontext':{'type':Sequelize[_0xade7('0x4')]},'channel':{'type':Sequelize[_0xade7('0x4')]},'dstchannel':{'type':Sequelize[_0xade7('0x4')]},'lastapp':{'type':Sequelize[_0xade7('0x4')]},'lastdata':{'type':Sequelize[_0xade7('0x4')]},'duration':{'type':Sequelize[_0xade7('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xade7('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xade7('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xade7('0x4')]},'userfield':{'type':Sequelize[_0xade7('0x4')]},'uniqueid':{'type':Sequelize[_0xade7('0x4')]},'linkedid':{'type':Sequelize[_0xade7('0x4')]},'sequence':{'type':Sequelize[_0xade7('0x4')]},'peeraccount':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xade7('0x4')]},'tag':{'type':Sequelize[_0xade7('0x4')]}}; \ No newline at end of file +var _0xb02a=['STRING','INTEGER','sequelize','exports','DATE','1970-01-01\x2000:00:01'];(function(_0x505241,_0x54a73d){var _0x1a1fcb=function(_0x264d96){while(--_0x264d96){_0x505241['push'](_0x505241['shift']());}};_0x1a1fcb(++_0x54a73d);}(_0xb02a,0x14c));var _0xab02=function(_0x32cede,_0x5b4364){_0x32cede=_0x32cede-0x0;var _0x27015c=_0xb02a[_0x32cede];return _0x27015c;};'use strict';var Sequelize=require(_0xab02('0x0'));module[_0xab02('0x1')]={'calldate':{'type':Sequelize[_0xab02('0x2')],'allowNull':![],'defaultValue':_0xab02('0x3')},'clid':{'type':Sequelize[_0xab02('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize[_0xab02('0x4')]},'dcontext':{'type':Sequelize[_0xab02('0x4')]},'channel':{'type':Sequelize[_0xab02('0x4')]},'dstchannel':{'type':Sequelize[_0xab02('0x4')]},'lastapp':{'type':Sequelize['STRING']},'lastdata':{'type':Sequelize[_0xab02('0x4')]},'duration':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xab02('0x5')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xab02('0x4')]},'amaflags':{'type':Sequelize[_0xab02('0x5')],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xab02('0x4')]},'userfield':{'type':Sequelize[_0xab02('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xab02('0x4')]},'sequence':{'type':Sequelize[_0xab02('0x4')]},'peeraccount':{'type':Sequelize[_0xab02('0x4')]},'type':{'type':Sequelize['STRING']},'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 7a9348b..11c5112 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 _0xa81e=['params','describe','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','sox','to-csv','lodash','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','end','status','count','offset','limit','set','json','reject','save','update','then','destroy','error','stack','name','send','index','map','Cdr','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','rows','show','rawAttributes','find','catch','create','body'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa81e,0x1a6));var _0xea81=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0xa81e[_0x422905];return _0x33dc6c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xea81('0x0'));var rimraf=require(_0xea81('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xea81('0x2'));var rp=require(_0xea81('0x3'));var moment=require('moment');var BPromise=require(_0xea81('0x4'));var Mustache=require('mustache');var util=require(_0xea81('0x5'));var path=require('path');var sox=require(_0xea81('0x6'));var csv=require(_0xea81('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xea81('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xea81('0x9'));var Papa=require(_0xea81('0xa'));var Redis=require(_0xea81('0xb'));var authService=require(_0xea81('0xc'));var qs=require(_0xea81('0xd'));var as=require(_0xea81('0xe'));var hardwareService=require(_0xea81('0xf'));var logger=require(_0xea81('0x10'))(_0xea81('0x11'));var utils=require(_0xea81('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12eb61,_0x460c64){_0x460c64=_0x460c64||0xcc;return function(_0x1b60e9){if(_0x1b60e9){return _0x12eb61[_0xea81('0x13')](_0x460c64);}return _0x12eb61['status'](_0x460c64)[_0xea81('0x14')]();};}function respondWithResult(_0x5ee2f9,_0xcf400){_0xcf400=_0xcf400||0xc8;return function(_0x40f3fc){if(_0x40f3fc){return _0x5ee2f9[_0xea81('0x15')](_0xcf400)['json'](_0x40f3fc);}};}function respondWithFilteredResult(_0x126660,_0xe4c1aa){return function(_0xb0c705){if(_0xb0c705){var _0x400317=_0xb0c705[_0xea81('0x16')],_0x5958ea=_0xe4c1aa[_0xea81('0x17')],_0x466a28=_0xe4c1aa[_0xea81('0x17')]+_0xe4c1aa[_0xea81('0x18')],_0x34c9b6;if(_0x466a28>=_0x400317){_0x466a28=_0x400317;_0x34c9b6=0xc8;}else{_0x34c9b6=0xce;}_0x126660[_0xea81('0x15')](_0x34c9b6);return _0x126660[_0xea81('0x19')]('Content-Range',_0x5958ea+'-'+_0x466a28+'/'+_0x400317)[_0xea81('0x1a')](_0xb0c705);}return null;};}function patchUpdates(_0x4abe21){return function(_0x5971d9){try{jsonpatch['apply'](_0x5971d9,_0x4abe21,!![]);}catch(_0x52f10a){return BPromise[_0xea81('0x1b')](_0x52f10a);}return _0x5971d9[_0xea81('0x1c')]();};}function saveUpdates(_0xd04d67,_0xcae15c){return function(_0x37a6cb){if(_0x37a6cb){return _0x37a6cb[_0xea81('0x1d')](_0xd04d67)[_0xea81('0x1e')](function(_0x3ecec2){return _0x3ecec2;});}return null;};}function removeEntity(_0x1ea04e,_0x3eaeef){return function(_0x2fd620){if(_0x2fd620){return _0x2fd620[_0xea81('0x1f')]()[_0xea81('0x1e')](function(){_0x1ea04e[_0xea81('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d7420,_0x59ef69){return function(_0x2d0b71){if(!_0x2d0b71){_0x1d7420['sendStatus'](0x194);}return _0x2d0b71;};}function handleError(_0x4957d3,_0x30aea2){_0x30aea2=_0x30aea2||0x1f4;return function(_0x43bddd){logger[_0xea81('0x20')](_0x43bddd[_0xea81('0x21')]);if(_0x43bddd['name']){delete _0x43bddd[_0xea81('0x22')];}_0x4957d3['status'](_0x30aea2)[_0xea81('0x23')](_0x43bddd);};}exports[_0xea81('0x24')]=function(_0x3c1eb2,_0x2dc64c){var _0x2659ba={},_0x56aa8d={},_0x5c04bf={'count':0x0,'rows':[]};var _0x43fb31=_[_0xea81('0x25')](db[_0xea81('0x26')]['rawAttributes'],function(_0x2b50d5){return{'name':_0x2b50d5['fieldName'],'type':_0x2b50d5[_0xea81('0x27')][_0xea81('0x28')]};});_0x56aa8d[_0xea81('0x29')]=_['map'](_0x43fb31,_0xea81('0x22'));_0x56aa8d[_0xea81('0x2a')]=_[_0xea81('0x2b')](_0x3c1eb2['query']);_0x56aa8d[_0xea81('0x2c')]=_[_0xea81('0x2d')](_0x56aa8d[_0xea81('0x29')],_0x56aa8d[_0xea81('0x2a')]);_0x2659ba[_0xea81('0x2e')]=_['intersection'](_0x56aa8d[_0xea81('0x29')],qs[_0xea81('0x2f')](_0x3c1eb2['query'][_0xea81('0x2f')]));_0x2659ba[_0xea81('0x2e')]=_0x2659ba[_0xea81('0x2e')][_0xea81('0x30')]?_0x2659ba[_0xea81('0x2e')]:_0x56aa8d[_0xea81('0x29')];if(!_0x3c1eb2[_0xea81('0x2a')]['hasOwnProperty'](_0xea81('0x31'))){_0x2659ba[_0xea81('0x18')]=qs[_0xea81('0x18')](_0x3c1eb2['query'][_0xea81('0x18')]);_0x2659ba[_0xea81('0x17')]=qs[_0xea81('0x17')](_0x3c1eb2[_0xea81('0x2a')][_0xea81('0x17')]);}_0x2659ba[_0xea81('0x32')]=qs[_0xea81('0x33')](_0x3c1eb2[_0xea81('0x2a')][_0xea81('0x33')]);_0x2659ba[_0xea81('0x34')]=qs['filters'](_[_0xea81('0x35')](_0x3c1eb2[_0xea81('0x2a')],_0x56aa8d[_0xea81('0x2c')]));if(_0x3c1eb2['query'][_0xea81('0x36')]){_0x2659ba['where']=_['merge'](_0x2659ba['where'],{'$or':_['map'](_0x43fb31,function(_0x40e5e5){if(_0x40e5e5[_0xea81('0x27')]!==_0xea81('0x37')){var _0x558ce0={};_0x558ce0[_0x40e5e5[_0xea81('0x22')]]={'$like':'%'+_0x3c1eb2[_0xea81('0x2a')][_0xea81('0x36')]+'%'};return _0x558ce0;}})});}_0x2659ba=_[_0xea81('0x38')]({},_0x2659ba,_0x3c1eb2[_0xea81('0x39')]);var _0x433ba2={'where':_0x2659ba[_0xea81('0x34')]};return db[_0xea81('0x26')][_0xea81('0x16')](_0x433ba2)[_0xea81('0x1e')](function(_0x5e5bf2){_0x5c04bf[_0xea81('0x16')]=_0x5e5bf2;if(_0x3c1eb2[_0xea81('0x2a')][_0xea81('0x3a')]){_0x2659ba[_0xea81('0x3b')]=[{'all':!![]}];}return db[_0xea81('0x26')][_0xea81('0x3c')](_0x2659ba);})[_0xea81('0x1e')](function(_0x1ca196){_0x5c04bf[_0xea81('0x3d')]=_0x1ca196;return _0x5c04bf;})['then'](respondWithFilteredResult(_0x2dc64c,_0x2659ba))['catch'](handleError(_0x2dc64c,null));};exports[_0xea81('0x3e')]=function(_0x23bf87,_0x3f3ca2){var _0x10b5f2={'raw':!![],'where':{'id':_0x23bf87['params']['id']}},_0x366999={};_0x366999[_0xea81('0x29')]=_[_0xea81('0x2b')](db[_0xea81('0x26')][_0xea81('0x3f')]);_0x366999[_0xea81('0x2a')]=_[_0xea81('0x2b')](_0x23bf87[_0xea81('0x2a')]);_0x366999[_0xea81('0x2c')]=_['intersection'](_0x366999[_0xea81('0x29')],_0x366999[_0xea81('0x2a')]);_0x10b5f2[_0xea81('0x2e')]=_[_0xea81('0x2d')](_0x366999[_0xea81('0x29')],qs['fields'](_0x23bf87[_0xea81('0x2a')][_0xea81('0x2f')]));_0x10b5f2['attributes']=_0x10b5f2[_0xea81('0x2e')]['length']?_0x10b5f2[_0xea81('0x2e')]:_0x366999[_0xea81('0x29')];if(_0x23bf87[_0xea81('0x2a')][_0xea81('0x3a')]){_0x10b5f2[_0xea81('0x3b')]=[{'all':!![]}];}_0x10b5f2=_[_0xea81('0x38')]({},_0x10b5f2,_0x23bf87[_0xea81('0x39')]);return db[_0xea81('0x26')][_0xea81('0x40')](_0x10b5f2)[_0xea81('0x1e')](handleEntityNotFound(_0x3f3ca2,null))[_0xea81('0x1e')](respondWithResult(_0x3f3ca2,null))[_0xea81('0x41')](handleError(_0x3f3ca2,null));};exports['create']=function(_0xf34e8a,_0x25028b){return db['Cdr'][_0xea81('0x42')](_0xf34e8a[_0xea81('0x43')],{})['then'](respondWithResult(_0x25028b,0xc9))[_0xea81('0x41')](handleError(_0x25028b,null));};exports[_0xea81('0x1d')]=function(_0xaf407d,_0x24c922){if(_0xaf407d[_0xea81('0x43')]['id']){delete _0xaf407d[_0xea81('0x43')]['id'];}return db['Cdr'][_0xea81('0x40')]({'where':{'id':_0xaf407d[_0xea81('0x44')]['id']}})['then'](handleEntityNotFound(_0x24c922,null))[_0xea81('0x1e')](saveUpdates(_0xaf407d[_0xea81('0x43')],null))['then'](respondWithResult(_0x24c922,null))[_0xea81('0x41')](handleError(_0x24c922,null));};exports[_0xea81('0x1f')]=function(_0x25b928,_0x3c4bb8){return db[_0xea81('0x26')][_0xea81('0x40')]({'where':{'id':_0x25b928['params']['id']}})[_0xea81('0x1e')](handleEntityNotFound(_0x3c4bb8,null))['then'](removeEntity(_0x3c4bb8,null))[_0xea81('0x41')](handleError(_0x3c4bb8,null));};exports[_0xea81('0x45')]=function(_0x110876,_0x1c5b14){return db[_0xea81('0x26')][_0xea81('0x45')]()['then'](respondWithResult(_0x1c5b14,null))[_0xea81('0x41')](handleError(_0x1c5b14,null));}; \ No newline at end of file +var _0xd49c=['VIRTUAL','options','count','then','includeAll','include','findAll','rows','show','params','find','catch','create','body','destroy','describe','eml-format','zip-dir','fast-json-patch','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','send','index','map','Cdr','type','key','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge'];(function(_0x1c2047,_0x136b50){var _0x18c765=function(_0x24ff86){while(--_0x24ff86){_0x1c2047['push'](_0x1c2047['shift']());}};_0x18c765(++_0x136b50);}(_0xd49c,0x1d8));var _0xcd49=function(_0x3a1ea0,_0x363246){_0x3a1ea0=_0x3a1ea0-0x0;var _0x194414=_0xd49c[_0x3a1ea0];return _0x194414;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcd49('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xcd49('0x1'));var jsonpatch=require(_0xcd49('0x2'));var rp=require('request-promise');var moment=require(_0xcd49('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xcd49('0x4'));var util=require('util');var path=require(_0xcd49('0x5'));var sox=require(_0xcd49('0x6'));var csv=require(_0xcd49('0x7'));var ejs=require(_0xcd49('0x8'));var fs=require('fs');var _=require(_0xcd49('0x9'));var squel=require(_0xcd49('0xa'));var crypto=require(_0xcd49('0xb'));var jsforce=require(_0xcd49('0xc'));var deskjs=require(_0xcd49('0xd'));var toCsv=require(_0xcd49('0x7'));var querystring=require(_0xcd49('0xe'));var Papa=require('papaparse');var Redis=require(_0xcd49('0xf'));var authService=require(_0xcd49('0x10'));var qs=require(_0xcd49('0x11'));var as=require(_0xcd49('0x12'));var hardwareService=require(_0xcd49('0x13'));var logger=require(_0xcd49('0x14'))(_0xcd49('0x15'));var utils=require(_0xcd49('0x16'));var config=require(_0xcd49('0x17'));var db=require(_0xcd49('0x18'))['db'];function respondWithStatusCode(_0x52222c,_0x5782e2){_0x5782e2=_0x5782e2||0xcc;return function(_0x5b8c8d){if(_0x5b8c8d){return _0x52222c[_0xcd49('0x19')](_0x5782e2);}return _0x52222c[_0xcd49('0x1a')](_0x5782e2)['end']();};}function respondWithResult(_0x2963e9,_0x4bed3d){_0x4bed3d=_0x4bed3d||0xc8;return function(_0x5c7d8c){if(_0x5c7d8c){return _0x2963e9[_0xcd49('0x1a')](_0x4bed3d)[_0xcd49('0x1b')](_0x5c7d8c);}};}function respondWithFilteredResult(_0x3d0637,_0x3f23e9){return function(_0x1e2275){if(_0x1e2275){var _0x328755=_0x1e2275['count'],_0x5a0c6e=_0x3f23e9[_0xcd49('0x1c')],_0x4b090e=_0x3f23e9[_0xcd49('0x1c')]+_0x3f23e9[_0xcd49('0x1d')],_0x56db62;if(_0x4b090e>=_0x328755){_0x4b090e=_0x328755;_0x56db62=0xc8;}else{_0x56db62=0xce;}_0x3d0637['status'](_0x56db62);return _0x3d0637[_0xcd49('0x1e')](_0xcd49('0x1f'),_0x5a0c6e+'-'+_0x4b090e+'/'+_0x328755)[_0xcd49('0x1b')](_0x1e2275);}return null;};}function patchUpdates(_0x48fd54){return function(_0x228841){try{jsonpatch[_0xcd49('0x20')](_0x228841,_0x48fd54,!![]);}catch(_0x322add){return BPromise[_0xcd49('0x21')](_0x322add);}return _0x228841[_0xcd49('0x22')]();};}function saveUpdates(_0x4700f1,_0x1c40a6){return function(_0x9475c1){if(_0x9475c1){return _0x9475c1[_0xcd49('0x23')](_0x4700f1)['then'](function(_0x243f1a){return _0x243f1a;});}return null;};}function removeEntity(_0x39b284,_0x37aea4){return function(_0x5829d1){if(_0x5829d1){return _0x5829d1['destroy']()['then'](function(){_0x39b284[_0xcd49('0x1a')](0xcc)[_0xcd49('0x24')]();});}};}function handleEntityNotFound(_0x57bc92,_0x1f649c){return function(_0x400669){if(!_0x400669){_0x57bc92[_0xcd49('0x19')](0x194);}return _0x400669;};}function handleError(_0x592973,_0x41c223){_0x41c223=_0x41c223||0x1f4;return function(_0x42b737){logger['error'](_0x42b737[_0xcd49('0x25')]);if(_0x42b737[_0xcd49('0x26')]){delete _0x42b737['name'];}_0x592973[_0xcd49('0x1a')](_0x41c223)[_0xcd49('0x27')](_0x42b737);};}exports[_0xcd49('0x28')]=function(_0x42bdfd,_0xe6ff0a){var _0x15b8b0={},_0xc04317={},_0x14f881={'count':0x0,'rows':[]};var _0x82f083=_[_0xcd49('0x29')](db[_0xcd49('0x2a')]['rawAttributes'],function(_0x3be5e6){return{'name':_0x3be5e6['fieldName'],'type':_0x3be5e6[_0xcd49('0x2b')][_0xcd49('0x2c')]};});_0xc04317['model']=_[_0xcd49('0x29')](_0x82f083,_0xcd49('0x26'));_0xc04317['query']=_[_0xcd49('0x2d')](_0x42bdfd[_0xcd49('0x2e')]);_0xc04317[_0xcd49('0x2f')]=_[_0xcd49('0x30')](_0xc04317[_0xcd49('0x31')],_0xc04317[_0xcd49('0x2e')]);_0x15b8b0['attributes']=_['intersection'](_0xc04317[_0xcd49('0x31')],qs[_0xcd49('0x32')](_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x32')]));_0x15b8b0[_0xcd49('0x33')]=_0x15b8b0[_0xcd49('0x33')][_0xcd49('0x34')]?_0x15b8b0[_0xcd49('0x33')]:_0xc04317[_0xcd49('0x31')];if(!_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x35')](_0xcd49('0x36'))){_0x15b8b0[_0xcd49('0x1d')]=qs['limit'](_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x1d')]);_0x15b8b0['offset']=qs['offset'](_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x1c')]);}_0x15b8b0['order']=qs[_0xcd49('0x37')](_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x37')]);_0x15b8b0[_0xcd49('0x38')]=qs[_0xcd49('0x2f')](_[_0xcd49('0x39')](_0x42bdfd[_0xcd49('0x2e')],_0xc04317['filters']));if(_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x3a')]){_0x15b8b0[_0xcd49('0x38')]=_[_0xcd49('0x3b')](_0x15b8b0[_0xcd49('0x38')],{'$or':_[_0xcd49('0x29')](_0x82f083,function(_0x5d32d4){if(_0x5d32d4[_0xcd49('0x2b')]!==_0xcd49('0x3c')){var _0x2aead0={};_0x2aead0[_0x5d32d4['name']]={'$like':'%'+_0x42bdfd[_0xcd49('0x2e')][_0xcd49('0x3a')]+'%'};return _0x2aead0;}})});}_0x15b8b0=_[_0xcd49('0x3b')]({},_0x15b8b0,_0x42bdfd[_0xcd49('0x3d')]);var _0x44a2a0={'where':_0x15b8b0[_0xcd49('0x38')]};return db[_0xcd49('0x2a')][_0xcd49('0x3e')](_0x44a2a0)[_0xcd49('0x3f')](function(_0x25cc2b){_0x14f881['count']=_0x25cc2b;if(_0x42bdfd['query'][_0xcd49('0x40')]){_0x15b8b0[_0xcd49('0x41')]=[{'all':!![]}];}return db[_0xcd49('0x2a')][_0xcd49('0x42')](_0x15b8b0);})[_0xcd49('0x3f')](function(_0x5124b6){_0x14f881[_0xcd49('0x43')]=_0x5124b6;return _0x14f881;})[_0xcd49('0x3f')](respondWithFilteredResult(_0xe6ff0a,_0x15b8b0))['catch'](handleError(_0xe6ff0a,null));};exports[_0xcd49('0x44')]=function(_0x37368f,_0x345fab){var _0x2ebfb9={'raw':!![],'where':{'id':_0x37368f[_0xcd49('0x45')]['id']}},_0x452a89={};_0x452a89[_0xcd49('0x31')]=_['keys'](db[_0xcd49('0x2a')]['rawAttributes']);_0x452a89[_0xcd49('0x2e')]=_[_0xcd49('0x2d')](_0x37368f['query']);_0x452a89[_0xcd49('0x2f')]=_[_0xcd49('0x30')](_0x452a89['model'],_0x452a89[_0xcd49('0x2e')]);_0x2ebfb9['attributes']=_[_0xcd49('0x30')](_0x452a89[_0xcd49('0x31')],qs[_0xcd49('0x32')](_0x37368f['query'][_0xcd49('0x32')]));_0x2ebfb9['attributes']=_0x2ebfb9['attributes'][_0xcd49('0x34')]?_0x2ebfb9[_0xcd49('0x33')]:_0x452a89['model'];if(_0x37368f[_0xcd49('0x2e')][_0xcd49('0x40')]){_0x2ebfb9[_0xcd49('0x41')]=[{'all':!![]}];}_0x2ebfb9=_[_0xcd49('0x3b')]({},_0x2ebfb9,_0x37368f[_0xcd49('0x3d')]);return db['Cdr'][_0xcd49('0x46')](_0x2ebfb9)[_0xcd49('0x3f')](handleEntityNotFound(_0x345fab,null))[_0xcd49('0x3f')](respondWithResult(_0x345fab,null))[_0xcd49('0x47')](handleError(_0x345fab,null));};exports['create']=function(_0x2d521c,_0x2956cd){return db[_0xcd49('0x2a')][_0xcd49('0x48')](_0x2d521c[_0xcd49('0x49')],{})[_0xcd49('0x3f')](respondWithResult(_0x2956cd,0xc9))[_0xcd49('0x47')](handleError(_0x2956cd,null));};exports[_0xcd49('0x23')]=function(_0x38676b,_0x5b11cc){if(_0x38676b[_0xcd49('0x49')]['id']){delete _0x38676b['body']['id'];}return db[_0xcd49('0x2a')][_0xcd49('0x46')]({'where':{'id':_0x38676b[_0xcd49('0x45')]['id']}})[_0xcd49('0x3f')](handleEntityNotFound(_0x5b11cc,null))[_0xcd49('0x3f')](saveUpdates(_0x38676b['body'],null))['then'](respondWithResult(_0x5b11cc,null))['catch'](handleError(_0x5b11cc,null));};exports[_0xcd49('0x4a')]=function(_0x457acf,_0x48b601){return db[_0xcd49('0x2a')][_0xcd49('0x46')]({'where':{'id':_0x457acf[_0xcd49('0x45')]['id']}})['then'](handleEntityNotFound(_0x48b601,null))['then'](removeEntity(_0x48b601,null))[_0xcd49('0x47')](handleError(_0x48b601,null));};exports['describe']=function(_0x440990,_0x26da47){return db[_0xcd49('0x2a')][_0xcd49('0x4b')]()[_0xcd49('0x3f')](respondWithResult(_0x26da47,null))['catch'](handleError(_0x26da47,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9552f00..893a270 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 _0x430c=['bluebird','./cdr.attributes','exports','Cdr','cdr','accountcode','calldate','disposition','dst','src','uniqueid','lodash','api','moment'];(function(_0x579a1c,_0x356db9){var _0x52730f=function(_0x43a374){while(--_0x43a374){_0x579a1c['push'](_0x579a1c['shift']());}};_0x52730f(++_0x356db9);}(_0x430c,0x1a1));var _0xc430=function(_0x3050ca,_0x3e36b0){_0x3050ca=_0x3050ca-0x0;var _0x1eed1d=_0x430c[_0x3050ca];return _0x1eed1d;};'use strict';var _=require(_0xc430('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xc430('0x1'));var moment=require(_0xc430('0x2'));var BPromise=require(_0xc430('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc430('0x4'));module[_0xc430('0x5')]=function(_0x50b256,_0x42aa9c){return _0x50b256['define'](_0xc430('0x6'),attributes,{'tableName':_0xc430('0x7'),'paranoid':![],'indexes':[{'name':_0xc430('0x8'),'fields':[_0xc430('0x8')]},{'name':_0xc430('0x9'),'fields':[_0xc430('0x9')]},{'name':_0xc430('0xa'),'fields':[_0xc430('0xa')]},{'name':_0xc430('0xb'),'fields':['dst']},{'name':_0xc430('0xc'),'fields':[_0xc430('0xc')]},{'name':'uniqueid','fields':[_0xc430('0xd')]}],'timestamps':![]});}; \ No newline at end of file +var _0xadb5=['bluebird','path','rimraf','../../config/environment','exports','define','Cdr','cdr','accountcode','calldate','disposition','dst','uniqueid','util','api','moment'];(function(_0x50e923,_0x453684){var _0xb28350=function(_0x306ce4){while(--_0x306ce4){_0x50e923['push'](_0x50e923['shift']());}};_0xb28350(++_0x453684);}(_0xadb5,0xad));var _0x5adb=function(_0x3393f1,_0x3301c8){_0x3393f1=_0x3393f1-0x0;var _0x16230b=_0xadb5[_0x3393f1];return _0x16230b;};'use strict';var _=require('lodash');var util=require(_0x5adb('0x0'));var logger=require('../../config/logger')(_0x5adb('0x1'));var moment=require(_0x5adb('0x2'));var BPromise=require(_0x5adb('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x5adb('0x4'));var rimraf=require(_0x5adb('0x5'));var config=require(_0x5adb('0x6'));var attributes=require('./cdr.attributes');module[_0x5adb('0x7')]=function(_0x168d89,_0x3e2555){return _0x168d89[_0x5adb('0x8')](_0x5adb('0x9'),attributes,{'tableName':_0x5adb('0xa'),'paranoid':![],'indexes':[{'name':_0x5adb('0xb'),'fields':[_0x5adb('0xb')]},{'name':_0x5adb('0xc'),'fields':[_0x5adb('0xc')]},{'name':_0x5adb('0xd'),'fields':[_0x5adb('0xd')]},{'name':_0x5adb('0xe'),'fields':[_0x5adb('0xe')]},{'name':'src','fields':['src']},{'name':_0x5adb('0xf'),'fields':[_0x5adb('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index 3fe39aa..bb763d7 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 _0x8561=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','Cdr,\x20%s,\x20%s','message','result'];(function(_0x2db130,_0x18125e){var _0x388801=function(_0x3ec1fa){while(--_0x3ec1fa){_0x2db130['push'](_0x2db130['shift']());}};_0x388801(++_0x18125e);}(_0x8561,0x1ef));var _0x1856=function(_0x5bdfb2,_0x5eeb10){_0x5bdfb2=_0x5bdfb2-0x0;var _0x5f5240=_0x8561[_0x5bdfb2];return _0x5f5240;};'use strict';var _=require(_0x1856('0x0'));var util=require('util');var moment=require(_0x1856('0x1'));var BPromise=require(_0x1856('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1856('0x3'));var db=require(_0x1856('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1856('0x5'))(_0x1856('0x6'));var config=require('../../config/environment');var jayson=require(_0x1856('0x7'));var client=jayson[_0x1856('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41fba1,_0x4a8bd2,_0x104f6f){return new BPromise(function(_0x2adc3d,_0x5ee0da){return client['request'](_0x41fba1,_0x104f6f)['then'](function(_0x1e55a9){logger[_0x1856('0x9')]('Cdr,\x20%s,\x20%s',_0x4a8bd2,_0x1856('0xa'));logger['debug'](_0x1856('0xb'),_0x4a8bd2,_0x1856('0xa'),JSON[_0x1856('0xc')](_0x1e55a9));if(_0x1e55a9[_0x1856('0xd')]){if(_0x1e55a9[_0x1856('0xd')][_0x1856('0xe')]===0x1f4){logger[_0x1856('0xd')](_0x1856('0xf'),_0x4a8bd2,_0x1e55a9[_0x1856('0xd')][_0x1856('0x10')]);return _0x5ee0da(_0x1e55a9[_0x1856('0xd')]['message']);}logger['error'](_0x1856('0xf'),_0x4a8bd2,_0x1e55a9[_0x1856('0xd')][_0x1856('0x10')]);return _0x2adc3d(_0x1e55a9['error']['message']);}else{logger['info'](_0x1856('0xf'),_0x4a8bd2,_0x1856('0xa'));_0x2adc3d(_0x1e55a9[_0x1856('0x11')][_0x1856('0x10')]);}})[_0x1856('0x12')](function(_0x38a233){logger[_0x1856('0xd')](_0x1856('0xf'),_0x4a8bd2,_0x38a233);_0x5ee0da(_0x38a233);});});} \ No newline at end of file +var _0xac80=['catch','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','request','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0xf7a5da,_0x1ec805){var _0x4790b9=function(_0x52b9fd){while(--_0x52b9fd){_0xf7a5da['push'](_0xf7a5da['shift']());}};_0x4790b9(++_0x1ec805);}(_0xac80,0x169));var _0x0ac8=function(_0x36f662,_0x2a69de){_0x36f662=_0x36f662-0x0;var _0x4f589d=_0xac80[_0x36f662];return _0x4f589d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0ac8('0x0'));var BPromise=require(_0x0ac8('0x1'));var rs=require(_0x0ac8('0x2'));var fs=require('fs');var Redis=require(_0x0ac8('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0ac8('0x4'));var logger=require('../../config/logger')(_0x0ac8('0x5'));var config=require(_0x0ac8('0x6'));var jayson=require(_0x0ac8('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5db054,_0x31c7bc,_0x1098d5){return new BPromise(function(_0x56b692,_0x4648f2){return client[_0x0ac8('0x8')](_0x5db054,_0x1098d5)['then'](function(_0x424d1a){logger[_0x0ac8('0x9')](_0x0ac8('0xa'),_0x31c7bc,_0x0ac8('0xb'));logger[_0x0ac8('0xc')](_0x0ac8('0xd'),_0x31c7bc,_0x0ac8('0xb'),JSON[_0x0ac8('0xe')](_0x424d1a));if(_0x424d1a[_0x0ac8('0xf')]){if(_0x424d1a[_0x0ac8('0xf')][_0x0ac8('0x10')]===0x1f4){logger['error']('Cdr,\x20%s,\x20%s',_0x31c7bc,_0x424d1a[_0x0ac8('0xf')][_0x0ac8('0x11')]);return _0x4648f2(_0x424d1a[_0x0ac8('0xf')]['message']);}logger[_0x0ac8('0xf')]('Cdr,\x20%s,\x20%s',_0x31c7bc,_0x424d1a[_0x0ac8('0xf')][_0x0ac8('0x11')]);return _0x56b692(_0x424d1a[_0x0ac8('0xf')][_0x0ac8('0x11')]);}else{logger['info']('Cdr,\x20%s,\x20%s',_0x31c7bc,'request\x20sent');_0x56b692(_0x424d1a[_0x0ac8('0x12')]['message']);}})[_0x0ac8('0x13')](function(_0x6efe13){logger[_0x0ac8('0xf')](_0x0ac8('0xa'),_0x31c7bc,_0x6efe13);_0x4648f2(_0x6efe13);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 5dc3ea7..5fc17f2 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 _0xf447=['/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path','express','../../config/environment','./cdr.controller','isAuthenticated','index','get'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0xf447,0x171));var _0x7f44=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf447[_0x2d34d6];return _0x1d3d12;};'use strict';var multer=require(_0x7f44('0x0'));var util=require(_0x7f44('0x1'));var path=require(_0x7f44('0x2'));var timeout=require('connect-timeout');var express=require(_0x7f44('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x7f44('0x4'));var controller=require(_0x7f44('0x5'));router['get']('/',auth[_0x7f44('0x6')](),controller[_0x7f44('0x7')]);router[_0x7f44('0x8')](_0x7f44('0x9'),auth[_0x7f44('0x6')](),controller[_0x7f44('0xa')]);router[_0x7f44('0x8')](_0x7f44('0xb'),auth[_0x7f44('0x6')](),controller[_0x7f44('0xc')]);router[_0x7f44('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x7f44('0xb'),auth[_0x7f44('0x6')](),controller[_0x7f44('0xe')]);router[_0x7f44('0xf')](_0x7f44('0xb'),auth['isAuthenticated'](),controller[_0x7f44('0x10')]);module[_0x7f44('0x11')]=router; \ No newline at end of file +var _0xec0c=['/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cdr.controller','isAuthenticated','index','get'];(function(_0x5b7180,_0x81ebf){var _0x105a55=function(_0x3c394a){while(--_0x3c394a){_0x5b7180['push'](_0x5b7180['shift']());}};_0x105a55(++_0x81ebf);}(_0xec0c,0xac));var _0xcec0=function(_0x15676a,_0x5edd39){_0x15676a=_0x15676a-0x0;var _0x175fa4=_0xec0c[_0x15676a];return _0x175fa4;};'use strict';var multer=require(_0xcec0('0x0'));var util=require(_0xcec0('0x1'));var path=require(_0xcec0('0x2'));var timeout=require(_0xcec0('0x3'));var express=require(_0xcec0('0x4'));var router=express[_0xcec0('0x5')]();var auth=require(_0xcec0('0x6'));var interaction=require(_0xcec0('0x7'));var config=require('../../config/environment');var controller=require(_0xcec0('0x8'));router['get']('/',auth[_0xcec0('0x9')](),controller[_0xcec0('0xa')]);router[_0xcec0('0xb')](_0xcec0('0xc'),auth['isAuthenticated'](),controller[_0xcec0('0xd')]);router[_0xcec0('0xb')](_0xcec0('0xe'),auth[_0xcec0('0x9')](),controller[_0xcec0('0xf')]);router[_0xcec0('0x10')]('/',auth[_0xcec0('0x9')](),controller[_0xcec0('0x11')]);router[_0xcec0('0x12')](_0xcec0('0xe'),auth[_0xcec0('0x9')](),controller[_0xcec0('0x13')]);router[_0xcec0('0x14')](_0xcec0('0xe'),auth['isAuthenticated'](),controller[_0xcec0('0x15')]);module[_0xcec0('0x16')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 8130628..0ed1aab 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 _0x7e8d=['noop','TEXT','sequelize','exports','INTEGER','STRING'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x7e8d,0x1e8));var _0xd7e8=function(_0x396466,_0xe9857b){_0x396466=_0x396466-0x0;var _0x5e9ab4=_0x7e8d[_0x396466];return _0x5e9ab4;};'use strict';var Sequelize=require(_0xd7e8('0x0'));module[_0xd7e8('0x1')]={'priority':{'type':Sequelize[_0xd7e8('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xd7e8('0x3')],'allowNull':![],'defaultValue':_0xd7e8('0x4')},'appdata':{'type':Sequelize[_0xd7e8('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xd7e8('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x4370=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x1b349a,_0x22222c){var _0x5d1f7c=function(_0x368d7c){while(--_0x368d7c){_0x1b349a['push'](_0x1b349a['shift']());}};_0x5d1f7c(++_0x22222c);}(_0x4370,0x176));var _0x0437=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4370[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x0437('0x0'));module[_0x0437('0x1')]={'priority':{'type':Sequelize[_0x0437('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x0437('0x3')]()},'description':{'type':Sequelize[_0x0437('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x0437('0x5')}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index 9fca926..d440b24 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 _0x944a=['limit','set','apply','reject','save','update','then','stack','send','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','options','ChatApplication','find','catch','body','destroy','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset'];(function(_0x2f32c4,_0x2597ba){var _0x95b5dc=function(_0x4ee89e){while(--_0x4ee89e){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x95b5dc(++_0x2597ba);}(_0x944a,0x90));var _0xa944=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x944a[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xa944('0x0'));var emlformat=require(_0xa944('0x1'));var rimraf=require(_0xa944('0x2'));var zipdir=require(_0xa944('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa944('0x4'));var moment=require(_0xa944('0x5'));var BPromise=require(_0xa944('0x6'));var Mustache=require(_0xa944('0x7'));var util=require(_0xa944('0x8'));var path=require(_0xa944('0x9'));var sox=require('sox');var csv=require(_0xa944('0xa'));var ejs=require(_0xa944('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa944('0xc'));var crypto=require('crypto');var jsforce=require(_0xa944('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xa944('0xa'));var querystring=require(_0xa944('0xe'));var Papa=require('papaparse');var Redis=require(_0xa944('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xa944('0x10'));var as=require(_0xa944('0x11'));var hardwareService=require(_0xa944('0x12'));var logger=require(_0xa944('0x13'))(_0xa944('0x14'));var utils=require(_0xa944('0x15'));var config=require(_0xa944('0x16'));var db=require(_0xa944('0x17'))['db'];function respondWithStatusCode(_0x240984,_0x37fe96){_0x37fe96=_0x37fe96||0xcc;return function(_0xddd670){if(_0xddd670){return _0x240984[_0xa944('0x18')](_0x37fe96);}return _0x240984[_0xa944('0x19')](_0x37fe96)[_0xa944('0x1a')]();};}function respondWithResult(_0x4033e0,_0x639589){_0x639589=_0x639589||0xc8;return function(_0x48f68a){if(_0x48f68a){return _0x4033e0[_0xa944('0x19')](_0x639589)[_0xa944('0x1b')](_0x48f68a);}};}function respondWithFilteredResult(_0x3f626a,_0x2467fa){return function(_0x57fd6f){if(_0x57fd6f){var _0x4ef5c0=_0x57fd6f[_0xa944('0x1c')],_0x55138d=_0x2467fa[_0xa944('0x1d')],_0x2b0e43=_0x2467fa['offset']+_0x2467fa[_0xa944('0x1e')],_0x5a298d;if(_0x2b0e43>=_0x4ef5c0){_0x2b0e43=_0x4ef5c0;_0x5a298d=0xc8;}else{_0x5a298d=0xce;}_0x3f626a[_0xa944('0x19')](_0x5a298d);return _0x3f626a[_0xa944('0x1f')]('Content-Range',_0x55138d+'-'+_0x2b0e43+'/'+_0x4ef5c0)[_0xa944('0x1b')](_0x57fd6f);}return null;};}function patchUpdates(_0x3cb82e){return function(_0x126e40){try{jsonpatch[_0xa944('0x20')](_0x126e40,_0x3cb82e,!![]);}catch(_0x17df41){return BPromise[_0xa944('0x21')](_0x17df41);}return _0x126e40[_0xa944('0x22')]();};}function saveUpdates(_0x5f3314,_0x4c383b){return function(_0x259539){if(_0x259539){return _0x259539[_0xa944('0x23')](_0x5f3314)[_0xa944('0x24')](function(_0x293ab2){return _0x293ab2;});}return null;};}function removeEntity(_0x690cf0,_0x50ba3b){return function(_0x2ddd34){if(_0x2ddd34){return _0x2ddd34['destroy']()[_0xa944('0x24')](function(){_0x690cf0['status'](0xcc)[_0xa944('0x1a')]();});}};}function handleEntityNotFound(_0x373449,_0x2a43cb){return function(_0x55ff69){if(!_0x55ff69){_0x373449[_0xa944('0x18')](0x194);}return _0x55ff69;};}function handleError(_0x447017,_0x5b83da){_0x5b83da=_0x5b83da||0x1f4;return function(_0x4aa6b8){logger['error'](_0x4aa6b8[_0xa944('0x25')]);if(_0x4aa6b8['name']){delete _0x4aa6b8['name'];}_0x447017[_0xa944('0x19')](_0x5b83da)[_0xa944('0x26')](_0x4aa6b8);};}exports['show']=function(_0x5dbd62,_0x4f0d81){var _0x1a2fb5={'raw':!![],'where':{'id':_0x5dbd62[_0xa944('0x27')]['id']}},_0x1a16fb={};_0x1a16fb[_0xa944('0x28')]=_[_0xa944('0x29')](db['ChatApplication'][_0xa944('0x2a')]);_0x1a16fb[_0xa944('0x2b')]=_['keys'](_0x5dbd62['query']);_0x1a16fb[_0xa944('0x2c')]=_[_0xa944('0x2d')](_0x1a16fb[_0xa944('0x28')],_0x1a16fb[_0xa944('0x2b')]);_0x1a2fb5[_0xa944('0x2e')]=_[_0xa944('0x2d')](_0x1a16fb[_0xa944('0x28')],qs[_0xa944('0x2f')](_0x5dbd62['query'][_0xa944('0x2f')]));_0x1a2fb5[_0xa944('0x2e')]=_0x1a2fb5[_0xa944('0x2e')][_0xa944('0x30')]?_0x1a2fb5[_0xa944('0x2e')]:_0x1a16fb[_0xa944('0x28')];if(_0x5dbd62['query'][_0xa944('0x31')]){_0x1a2fb5[_0xa944('0x32')]=[{'all':!![]}];}_0x1a2fb5=_[_0xa944('0x33')]({},_0x1a2fb5,_0x5dbd62[_0xa944('0x34')]);return db[_0xa944('0x35')][_0xa944('0x36')](_0x1a2fb5)[_0xa944('0x24')](handleEntityNotFound(_0x4f0d81,null))['then'](respondWithResult(_0x4f0d81,null))[_0xa944('0x37')](handleError(_0x4f0d81,null));};exports['update']=function(_0x145d8c,_0x3c9574){if(_0x145d8c[_0xa944('0x38')]['id']){delete _0x145d8c['body']['id'];}return db[_0xa944('0x35')][_0xa944('0x36')]({'where':{'id':_0x145d8c[_0xa944('0x27')]['id']}})[_0xa944('0x24')](handleEntityNotFound(_0x3c9574,null))[_0xa944('0x24')](saveUpdates(_0x145d8c[_0xa944('0x38')],null))[_0xa944('0x24')](respondWithResult(_0x3c9574,null))['catch'](handleError(_0x3c9574,null));};exports[_0xa944('0x39')]=function(_0x4d1824,_0x32d1f7){return db['ChatApplication'][_0xa944('0x36')]({'where':{'id':_0x4d1824[_0xa944('0x27')]['id']}})[_0xa944('0x24')](handleEntityNotFound(_0x32d1f7,null))['then'](removeEntity(_0x32d1f7,null))[_0xa944('0x37')](handleError(_0x32d1f7,null));}; \ No newline at end of file +var _0xf8ae=['keys','intersection','fields','length','attributes','options','ChatApplication','find','catch','update','body','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','offset','limit','Content-Range','json','apply','reject','save','destroy','then','error','name','send','params','model','rawAttributes','query'];(function(_0x587e69,_0x205cfe){var _0x3b7aa5=function(_0x24feac){while(--_0x24feac){_0x587e69['push'](_0x587e69['shift']());}};_0x3b7aa5(++_0x205cfe);}(_0xf8ae,0xb0));var _0xef8a=function(_0x215e8e,_0x2e9b00){_0x215e8e=_0x215e8e-0x0;var _0x43ce3b=_0xf8ae[_0x215e8e];return _0x43ce3b;};'use strict';var pdf=require(_0xef8a('0x0'));var emlformat=require(_0xef8a('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xef8a('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xef8a('0x3'));var BPromise=require(_0xef8a('0x4'));var Mustache=require(_0xef8a('0x5'));var util=require(_0xef8a('0x6'));var path=require(_0xef8a('0x7'));var sox=require('sox');var csv=require(_0xef8a('0x8'));var ejs=require(_0xef8a('0x9'));var fs=require('fs');var _=require(_0xef8a('0xa'));var squel=require(_0xef8a('0xb'));var crypto=require(_0xef8a('0xc'));var jsforce=require(_0xef8a('0xd'));var deskjs=require(_0xef8a('0xe'));var toCsv=require(_0xef8a('0x8'));var querystring=require(_0xef8a('0xf'));var Papa=require('papaparse');var Redis=require(_0xef8a('0x10'));var authService=require(_0xef8a('0x11'));var qs=require(_0xef8a('0x12'));var as=require(_0xef8a('0x13'));var hardwareService=require(_0xef8a('0x14'));var logger=require(_0xef8a('0x15'))(_0xef8a('0x16'));var utils=require(_0xef8a('0x17'));var config=require(_0xef8a('0x18'));var db=require(_0xef8a('0x19'))['db'];function respondWithStatusCode(_0x3927be,_0x26d3c3){_0x26d3c3=_0x26d3c3||0xcc;return function(_0x2bcf99){if(_0x2bcf99){return _0x3927be['sendStatus'](_0x26d3c3);}return _0x3927be['status'](_0x26d3c3)[_0xef8a('0x1a')]();};}function respondWithResult(_0x5c36a0,_0x4883fa){_0x4883fa=_0x4883fa||0xc8;return function(_0x435c15){if(_0x435c15){return _0x5c36a0[_0xef8a('0x1b')](_0x4883fa)['json'](_0x435c15);}};}function respondWithFilteredResult(_0x878bb4,_0x492b9f){return function(_0x4bf810){if(_0x4bf810){var _0x4d6973=_0x4bf810['count'],_0x559680=_0x492b9f[_0xef8a('0x1c')],_0x53b09e=_0x492b9f[_0xef8a('0x1c')]+_0x492b9f[_0xef8a('0x1d')],_0x230460;if(_0x53b09e>=_0x4d6973){_0x53b09e=_0x4d6973;_0x230460=0xc8;}else{_0x230460=0xce;}_0x878bb4[_0xef8a('0x1b')](_0x230460);return _0x878bb4['set'](_0xef8a('0x1e'),_0x559680+'-'+_0x53b09e+'/'+_0x4d6973)[_0xef8a('0x1f')](_0x4bf810);}return null;};}function patchUpdates(_0x17f913){return function(_0x3f5084){try{jsonpatch[_0xef8a('0x20')](_0x3f5084,_0x17f913,!![]);}catch(_0x4e87da){return BPromise[_0xef8a('0x21')](_0x4e87da);}return _0x3f5084[_0xef8a('0x22')]();};}function saveUpdates(_0x2bb079,_0x1dd559){return function(_0x4ee127){if(_0x4ee127){return _0x4ee127['update'](_0x2bb079)['then'](function(_0x298556){return _0x298556;});}return null;};}function removeEntity(_0x1ade89,_0x6ccc3){return function(_0x300e67){if(_0x300e67){return _0x300e67[_0xef8a('0x23')]()[_0xef8a('0x24')](function(){_0x1ade89[_0xef8a('0x1b')](0xcc)[_0xef8a('0x1a')]();});}};}function handleEntityNotFound(_0x4feb27,_0x36adeb){return function(_0x57f65a){if(!_0x57f65a){_0x4feb27['sendStatus'](0x194);}return _0x57f65a;};}function handleError(_0x5d0733,_0x46e16c){_0x46e16c=_0x46e16c||0x1f4;return function(_0x4f2c4a){logger[_0xef8a('0x25')](_0x4f2c4a['stack']);if(_0x4f2c4a[_0xef8a('0x26')]){delete _0x4f2c4a[_0xef8a('0x26')];}_0x5d0733[_0xef8a('0x1b')](_0x46e16c)[_0xef8a('0x27')](_0x4f2c4a);};}exports['show']=function(_0x4ce432,_0x5e4a1f){var _0x5104a8={'raw':!![],'where':{'id':_0x4ce432[_0xef8a('0x28')]['id']}},_0x44f300={};_0x44f300[_0xef8a('0x29')]=_['keys'](db['ChatApplication'][_0xef8a('0x2a')]);_0x44f300[_0xef8a('0x2b')]=_[_0xef8a('0x2c')](_0x4ce432[_0xef8a('0x2b')]);_0x44f300['filters']=_[_0xef8a('0x2d')](_0x44f300[_0xef8a('0x29')],_0x44f300[_0xef8a('0x2b')]);_0x5104a8['attributes']=_[_0xef8a('0x2d')](_0x44f300[_0xef8a('0x29')],qs['fields'](_0x4ce432[_0xef8a('0x2b')][_0xef8a('0x2e')]));_0x5104a8['attributes']=_0x5104a8['attributes'][_0xef8a('0x2f')]?_0x5104a8[_0xef8a('0x30')]:_0x44f300['model'];if(_0x4ce432['query']['includeAll']){_0x5104a8['include']=[{'all':!![]}];}_0x5104a8=_['merge']({},_0x5104a8,_0x4ce432[_0xef8a('0x31')]);return db[_0xef8a('0x32')][_0xef8a('0x33')](_0x5104a8)['then'](handleEntityNotFound(_0x5e4a1f,null))[_0xef8a('0x24')](respondWithResult(_0x5e4a1f,null))[_0xef8a('0x34')](handleError(_0x5e4a1f,null));};exports[_0xef8a('0x35')]=function(_0x377340,_0x2a7cd1){if(_0x377340[_0xef8a('0x36')]['id']){delete _0x377340[_0xef8a('0x36')]['id'];}return db[_0xef8a('0x32')][_0xef8a('0x33')]({'where':{'id':_0x377340[_0xef8a('0x28')]['id']}})[_0xef8a('0x24')](handleEntityNotFound(_0x2a7cd1,null))[_0xef8a('0x24')](saveUpdates(_0x377340[_0xef8a('0x36')],null))['then'](respondWithResult(_0x2a7cd1,null))['catch'](handleError(_0x2a7cd1,null));};exports[_0xef8a('0x23')]=function(_0x2ea21d,_0x117505){return db[_0xef8a('0x32')][_0xef8a('0x33')]({'where':{'id':_0x2ea21d[_0xef8a('0x28')]['id']}})['then'](handleEntityNotFound(_0x117505,null))[_0xef8a('0x24')](removeEntity(_0x117505,null))[_0xef8a('0x34')](handleError(_0x117505,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index ebfc37b..e51e29b 100644 --- a/server/api/chatApplication/chatApplication.model.js +++ b/server/api/chatApplication/chatApplication.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 05783a0..77b6c10 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 _0x546e=['debug','stringify','error','message','catch','lodash','randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','ChatApplication,\x20%s,\x20%s','request\x20sent'];(function(_0x1aa674,_0x5745b8){var _0x2021e3=function(_0x29562c){while(--_0x29562c){_0x1aa674['push'](_0x1aa674['shift']());}};_0x2021e3(++_0x5745b8);}(_0x546e,0x75));var _0xe546=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x546e[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xe546('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe546('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe546('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe546('0x3'))(_0xe546('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe546('0x5')][_0xe546('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x39621a,_0x37033c,_0x47eaa1){return new BPromise(function(_0x2ea797,_0xca1fd0){return client[_0xe546('0x7')](_0x39621a,_0x47eaa1)['then'](function(_0x2d9e47){logger[_0xe546('0x8')](_0xe546('0x9'),_0x37033c,_0xe546('0xa'));logger[_0xe546('0xb')]('ChatApplication,\x20%s,\x20%s,\x20%s',_0x37033c,_0xe546('0xa'),JSON[_0xe546('0xc')](_0x2d9e47));if(_0x2d9e47[_0xe546('0xd')]){if(_0x2d9e47[_0xe546('0xd')]['code']===0x1f4){logger[_0xe546('0xd')](_0xe546('0x9'),_0x37033c,_0x2d9e47[_0xe546('0xd')][_0xe546('0xe')]);return _0xca1fd0(_0x2d9e47[_0xe546('0xd')]['message']);}logger[_0xe546('0xd')]('ChatApplication,\x20%s,\x20%s',_0x37033c,_0x2d9e47[_0xe546('0xd')]['message']);return _0x2ea797(_0x2d9e47[_0xe546('0xd')][_0xe546('0xe')]);}else{logger[_0xe546('0x8')](_0xe546('0x9'),_0x37033c,_0xe546('0xa'));_0x2ea797(_0x2d9e47['result']['message']);}})[_0xe546('0xf')](function(_0x15faf7){logger[_0xe546('0xd')](_0xe546('0x9'),_0x37033c,_0x15faf7);_0xca1fd0(_0x15faf7);});});} \ No newline at end of file +var _0xe4cf=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','code','error','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x1eaeae,_0x83a004){var _0x464fcd=function(_0x311e71){while(--_0x311e71){_0x1eaeae['push'](_0x1eaeae['shift']());}};_0x464fcd(++_0x83a004);}(_0xe4cf,0xb4));var _0xfe4c=function(_0x471f7d,_0x59c86b){_0x471f7d=_0x471f7d-0x0;var _0x3088f1=_0xe4cf[_0x471f7d];return _0x3088f1;};'use strict';var _=require(_0xfe4c('0x0'));var util=require(_0xfe4c('0x1'));var moment=require(_0xfe4c('0x2'));var BPromise=require(_0xfe4c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe4c('0x4'));var db=require(_0xfe4c('0x5'))['db'];var utils=require(_0xfe4c('0x6'));var logger=require(_0xfe4c('0x7'))(_0xfe4c('0x8'));var config=require(_0xfe4c('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfe4c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xd1bee1,_0x30812a,_0x495427){return new BPromise(function(_0x427f64,_0x3c6fbb){return client[_0xfe4c('0xb')](_0xd1bee1,_0x495427)[_0xfe4c('0xc')](function(_0x42d98e){logger['info'](_0xfe4c('0xd'),_0x30812a,_0xfe4c('0xe'));logger[_0xfe4c('0xf')](_0xfe4c('0x10'),_0x30812a,'request\x20sent',JSON['stringify'](_0x42d98e));if(_0x42d98e['error']){if(_0x42d98e['error'][_0xfe4c('0x11')]===0x1f4){logger[_0xfe4c('0x12')]('ChatApplication,\x20%s,\x20%s',_0x30812a,_0x42d98e[_0xfe4c('0x12')]['message']);return _0x3c6fbb(_0x42d98e[_0xfe4c('0x12')][_0xfe4c('0x13')]);}logger[_0xfe4c('0x12')](_0xfe4c('0xd'),_0x30812a,_0x42d98e[_0xfe4c('0x12')]['message']);return _0x427f64(_0x42d98e[_0xfe4c('0x12')][_0xfe4c('0x13')]);}else{logger[_0xfe4c('0x14')](_0xfe4c('0xd'),_0x30812a,_0xfe4c('0xe'));_0x427f64(_0x42d98e[_0xfe4c('0x15')]['message']);}})[_0xfe4c('0x16')](function(_0x5546b4){logger['error'](_0xfe4c('0xd'),_0x30812a,_0x5546b4);_0x3c6fbb(_0x5546b4);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 01ac4ed..b842cc9 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 _0x336a=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller','get','/:id','isAuthenticated','update','delete'];(function(_0x260478,_0x2040a1){var _0x4048fb=function(_0x49b513){while(--_0x49b513){_0x260478['push'](_0x260478['shift']());}};_0x4048fb(++_0x2040a1);}(_0x336a,0x1f2));var _0xa336=function(_0x556927,_0x34b53f){_0x556927=_0x556927-0x0;var _0x5f1235=_0x336a[_0x556927];return _0x5f1235;};'use strict';var multer=require(_0xa336('0x0'));var util=require(_0xa336('0x1'));var path=require('path');var timeout=require(_0xa336('0x2'));var express=require(_0xa336('0x3'));var router=express[_0xa336('0x4')]();var auth=require(_0xa336('0x5'));var interaction=require(_0xa336('0x6'));var config=require(_0xa336('0x7'));var controller=require(_0xa336('0x8'));router[_0xa336('0x9')](_0xa336('0xa'),auth[_0xa336('0xb')](),controller['show']);router['put'](_0xa336('0xa'),auth['isAuthenticated'](),controller[_0xa336('0xc')]);router[_0xa336('0xd')](_0xa336('0xa'),auth[_0xa336('0xb')](),controller[_0xa336('0xe')]);module[_0xa336('0xf')]=router; \ No newline at end of file +var _0xb41a=['path','express','Router','../../components/interaction/service','./chatApplication.controller','get','/:id','show','isAuthenticated','delete','destroy','exports','multer'];(function(_0x102470,_0x199a01){var _0x558eaa=function(_0x12c74a){while(--_0x12c74a){_0x102470['push'](_0x102470['shift']());}};_0x558eaa(++_0x199a01);}(_0xb41a,0x178));var _0xab41=function(_0x2586ad,_0x3a2816){_0x2586ad=_0x2586ad-0x0;var _0x4128db=_0xb41a[_0x2586ad];return _0x4128db;};'use strict';var multer=require(_0xab41('0x0'));var util=require('util');var path=require(_0xab41('0x1'));var timeout=require('connect-timeout');var express=require(_0xab41('0x2'));var router=express[_0xab41('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xab41('0x4'));var config=require('../../config/environment');var controller=require(_0xab41('0x5'));router[_0xab41('0x6')](_0xab41('0x7'),auth['isAuthenticated'](),controller[_0xab41('0x8')]);router['put'](_0xab41('0x7'),auth[_0xab41('0x9')](),controller['update']);router[_0xab41('0xa')](_0xab41('0x7'),auth['isAuthenticated'](),controller[_0xab41('0xb')]);module[_0xab41('0xc')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 3d9570d..80f12c3 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 _0xaa87=['exports'];(function(_0x29ef06,_0x3e54b7){var _0x57bd49=function(_0x21e644){while(--_0x21e644){_0x29ef06['push'](_0x29ef06['shift']());}};_0x57bd49(++_0x3e54b7);}(_0xaa87,0x1a8));var _0x7aa8=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xaa87[_0x1cc8fe];return _0x230054;};'use strict';var Sequelize=require('sequelize');module[_0x7aa8('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize['STRING']},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x2f83=['sequelize','STRING','BOOLEAN'];(function(_0x18d707,_0x351dfe){var _0x506c8e=function(_0x2c8497){while(--_0x2c8497){_0x18d707['push'](_0x18d707['shift']());}};_0x506c8e(++_0x351dfe);}(_0x2f83,0xc6));var _0x32f8=function(_0x257fd4,_0x446a74){_0x257fd4=_0x257fd4-0x0;var _0x3bbcba=_0x2f83[_0x257fd4];return _0x3bbcba;};'use strict';var Sequelize=require(_0x32f8('0x0'));module['exports']={'name':{'type':Sequelize[_0x32f8('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x32f8('0x1')]},'write':{'type':Sequelize[_0x32f8('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 b90c078..b4a290c 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 _0x950f=['bluebird','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','jayson/promise','client','http','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','keys','create','body','find','params','destroy','describe','getUnread','ChatInternalMessage','user','toInteger','addMembers','ids','getMembers','User','removeMembers','addMessage','ChatGroupId','getMessages','findOne','$gte','split','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','fast-json-patch','request-promise'];(function(_0x3c3f58,_0xf6d0d6){var _0x4fb16f=function(_0x4f4027){while(--_0x4f4027){_0x3c3f58['push'](_0x3c3f58['shift']());}};_0x4fb16f(++_0xf6d0d6);}(_0x950f,0x12d));var _0xf950=function(_0x10a12a,_0xee7529){_0x10a12a=_0x10a12a-0x0;var _0x1905af=_0x950f[_0x10a12a];return _0x1905af;};'use strict';var pdf=require(_0xf950('0x0'));var emlformat=require(_0xf950('0x1'));var rimraf=require(_0xf950('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf950('0x3'));var rp=require(_0xf950('0x4'));var moment=require('moment');var BPromise=require(_0xf950('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xf950('0x6'));var ejs=require(_0xf950('0x7'));var fs=require('fs');var _=require(_0xf950('0x8'));var squel=require(_0xf950('0x9'));var crypto=require(_0xf950('0xa'));var jsforce=require(_0xf950('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xf950('0x6'));var querystring=require(_0xf950('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xf950('0xd'));var qs=require(_0xf950('0xe'));var as=require(_0xf950('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf950('0x10'))(_0xf950('0x11'));var utils=require(_0xf950('0x12'));var config=require(_0xf950('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xf950('0x14')](config[_0xf950('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xf950('0x16'))(new Redis(config[_0xf950('0x15')]));require('./chatGroup.socket')['register'](socket);var jayson=require(_0xf950('0x17'));var client=jayson[_0xf950('0x18')][_0xf950('0x19')]({'port':0x232a});function checkPasswordPattern(_0x303eb2,_0x44fedc,_0x2298a1){if(_0x2298a1){var _0x739ad3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x739ad3['test'](_0x44fedc)){return _0x303eb2;}else{throw new db[(_0xf950('0x1a'))]['ValidationError'](_0xf950('0x1b'));}}else{return _0x303eb2;}}function respondWithRpcPromise(_0x8181e7,_0x4faaaa,_0x366497,_0x5d6248){return new BPromise(function(_0x15b8c7,_0x1fbde3){var _0x33b81f=_0x5d6248||client;return _0x33b81f['request'](_0x8181e7,_0x366497)[_0xf950('0x1c')](function(_0xc93f9a){logger['info'](_0xf950('0x1d'),_0x4faaaa,_0xf950('0x1e'));logger[_0xf950('0x1f')](_0xf950('0x20'),_0x4faaaa,_0xf950('0x1e'),JSON[_0xf950('0x21')](_0xc93f9a));if(_0xc93f9a[_0xf950('0x22')]){if(_0xc93f9a[_0xf950('0x22')]['code']===0x1f4){logger['error'](_0xf950('0x1d'),_0x4faaaa,_0xc93f9a[_0xf950('0x22')]['message']);return _0x1fbde3(_0xc93f9a[_0xf950('0x22')][_0xf950('0x23')]);}logger[_0xf950('0x22')](_0xf950('0x1d'),_0x4faaaa,_0xc93f9a['error'][_0xf950('0x23')]);return _0x15b8c7(_0xc93f9a[_0xf950('0x22')][_0xf950('0x23')]);}else{logger['info'](_0xf950('0x1d'),_0x4faaaa,_0xf950('0x1e'));_0x15b8c7(_0xc93f9a[_0xf950('0x24')][_0xf950('0x23')]);}})[_0xf950('0x25')](function(_0x46cb76){logger[_0xf950('0x22')](_0xf950('0x1d'),_0x4faaaa,_0x46cb76);_0x1fbde3(_0x46cb76);});});}function respondWithStatusCode(_0x102484,_0x39c47b){_0x39c47b=_0x39c47b||0xcc;return function(_0xa82614){if(_0xa82614){return _0x102484[_0xf950('0x26')](_0x39c47b);}return _0x102484[_0xf950('0x27')](_0x39c47b)[_0xf950('0x28')]();};}function respondWithResult(_0x109bff,_0x20261f){_0x20261f=_0x20261f||0xc8;return function(_0x34ecb4){if(_0x34ecb4){return _0x109bff[_0xf950('0x27')](_0x20261f)[_0xf950('0x29')](_0x34ecb4);}};}function respondWithFilteredResult(_0x8740e8,_0x2fa77e){return function(_0x204537){if(_0x204537){var _0x39b2da=_0x204537[_0xf950('0x2a')],_0x29c332=_0x2fa77e[_0xf950('0x2b')],_0x17eced=_0x2fa77e['offset']+_0x2fa77e['limit'],_0x19ae3c;if(_0x17eced>=_0x39b2da){_0x17eced=_0x39b2da;_0x19ae3c=0xc8;}else{_0x19ae3c=0xce;}_0x8740e8[_0xf950('0x27')](_0x19ae3c);return _0x8740e8['set'](_0xf950('0x2c'),_0x29c332+'-'+_0x17eced+'/'+_0x39b2da)[_0xf950('0x29')](_0x204537);}return null;};}function patchUpdates(_0x53a68c){return function(_0xa2c988){try{jsonpatch[_0xf950('0x2d')](_0xa2c988,_0x53a68c,!![]);}catch(_0x12ceeb){return BPromise[_0xf950('0x2e')](_0x12ceeb);}return _0xa2c988[_0xf950('0x2f')]();};}function saveUpdates(_0x2d1e05,_0x5b3514){return function(_0x34c053){if(_0x34c053){return _0x34c053[_0xf950('0x30')](_0x2d1e05)[_0xf950('0x1c')](function(_0x1bf469){return _0x1bf469;});}return null;};}function removeEntity(_0x320fc3,_0xd65e3b){return function(_0x753c6){if(_0x753c6){return _0x753c6['destroy']()[_0xf950('0x1c')](function(){_0x320fc3['status'](0xcc)[_0xf950('0x28')]();});}};}function handleEntityNotFound(_0x38002f,_0x3c5b2e){return function(_0x39af3b){if(!_0x39af3b){_0x38002f[_0xf950('0x26')](0x194);}return _0x39af3b;};}function handleError(_0x16113b,_0x4417c2){_0x4417c2=_0x4417c2||0x1f4;return function(_0x292685){logger[_0xf950('0x22')](_0x292685['stack']);if(_0x292685[_0xf950('0x31')]){delete _0x292685[_0xf950('0x31')];}_0x16113b[_0xf950('0x27')](_0x4417c2)[_0xf950('0x32')](_0x292685);};}exports[_0xf950('0x33')]=function(_0x539ac2,_0x57bea7){var _0x2751c5={},_0x13c96e={},_0x1ea596={'count':0x0,'rows':[]};var _0x9eebc9=_[_0xf950('0x34')](db[_0xf950('0x35')][_0xf950('0x36')],function(_0x5bb831){return{'name':_0x5bb831[_0xf950('0x37')],'type':_0x5bb831[_0xf950('0x38')][_0xf950('0x39')]};});_0x13c96e[_0xf950('0x3a')]=_[_0xf950('0x34')](_0x9eebc9,_0xf950('0x31'));_0x13c96e[_0xf950('0x3b')]=_['keys'](_0x539ac2[_0xf950('0x3b')]);_0x13c96e[_0xf950('0x3c')]=_[_0xf950('0x3d')](_0x13c96e[_0xf950('0x3a')],_0x13c96e[_0xf950('0x3b')]);_0x2751c5[_0xf950('0x3e')]=_[_0xf950('0x3d')](_0x13c96e[_0xf950('0x3a')],qs[_0xf950('0x3f')](_0x539ac2[_0xf950('0x3b')][_0xf950('0x3f')]));_0x2751c5['attributes']=_0x2751c5[_0xf950('0x3e')][_0xf950('0x40')]?_0x2751c5[_0xf950('0x3e')]:_0x13c96e[_0xf950('0x3a')];if(!_0x539ac2[_0xf950('0x3b')][_0xf950('0x41')](_0xf950('0x42'))){_0x2751c5['limit']=qs[_0xf950('0x43')](_0x539ac2[_0xf950('0x3b')][_0xf950('0x43')]);_0x2751c5[_0xf950('0x2b')]=qs[_0xf950('0x2b')](_0x539ac2[_0xf950('0x3b')][_0xf950('0x2b')]);}_0x2751c5[_0xf950('0x44')]=qs[_0xf950('0x45')](_0x539ac2['query'][_0xf950('0x45')]);_0x2751c5[_0xf950('0x46')]=qs['filters'](_[_0xf950('0x47')](_0x539ac2[_0xf950('0x3b')],_0x13c96e['filters']));if(_0x539ac2[_0xf950('0x3b')][_0xf950('0x48')]){_0x2751c5[_0xf950('0x46')]=_[_0xf950('0x49')](_0x2751c5['where'],{'$or':_[_0xf950('0x34')](_0x9eebc9,function(_0x461d21){if(_0x461d21[_0xf950('0x38')]!==_0xf950('0x4a')){var _0x4c13b8={};_0x4c13b8[_0x461d21['name']]={'$like':'%'+_0x539ac2[_0xf950('0x3b')][_0xf950('0x48')]+'%'};return _0x4c13b8;}})});}_0x2751c5=_['merge']({},_0x2751c5,_0x539ac2[_0xf950('0x4b')]);var _0x1b95c6={'where':_0x2751c5[_0xf950('0x46')]};return db[_0xf950('0x35')]['count'](_0x1b95c6)[_0xf950('0x1c')](function(_0x43a4ba){_0x1ea596[_0xf950('0x2a')]=_0x43a4ba;if(_0x539ac2[_0xf950('0x3b')][_0xf950('0x4c')]){_0x2751c5[_0xf950('0x4d')]=[{'all':!![]}];}return db[_0xf950('0x35')]['findAll'](_0x2751c5);})[_0xf950('0x1c')](function(_0x1d6a46){_0x1ea596[_0xf950('0x4e')]=_0x1d6a46;return _0x1ea596;})[_0xf950('0x1c')](respondWithFilteredResult(_0x57bea7,_0x2751c5))['catch'](handleError(_0x57bea7,null));};exports['show']=function(_0x5e5317,_0x36d1af){var _0x37f680={'raw':!![],'where':{'id':_0x5e5317['params']['id']}},_0x4405e9={};_0x4405e9[_0xf950('0x3a')]=_['keys'](db[_0xf950('0x35')][_0xf950('0x36')]);_0x4405e9[_0xf950('0x3b')]=_[_0xf950('0x4f')](_0x5e5317[_0xf950('0x3b')]);_0x4405e9['filters']=_[_0xf950('0x3d')](_0x4405e9['model'],_0x4405e9[_0xf950('0x3b')]);_0x37f680[_0xf950('0x3e')]=_[_0xf950('0x3d')](_0x4405e9['model'],qs[_0xf950('0x3f')](_0x5e5317['query'][_0xf950('0x3f')]));_0x37f680[_0xf950('0x3e')]=_0x37f680[_0xf950('0x3e')][_0xf950('0x40')]?_0x37f680[_0xf950('0x3e')]:_0x4405e9[_0xf950('0x3a')];if(_0x5e5317[_0xf950('0x3b')][_0xf950('0x4c')]){_0x37f680[_0xf950('0x4d')]=[{'all':!![]}];}_0x37f680=_[_0xf950('0x49')]({},_0x37f680,_0x5e5317[_0xf950('0x4b')]);return db[_0xf950('0x35')]['find'](_0x37f680)['then'](handleEntityNotFound(_0x36d1af,null))[_0xf950('0x1c')](respondWithResult(_0x36d1af,null))[_0xf950('0x25')](handleError(_0x36d1af,null));};exports['create']=function(_0x29de7b,_0x41116a){return db[_0xf950('0x35')][_0xf950('0x50')](_0x29de7b[_0xf950('0x51')],{})[_0xf950('0x1c')](respondWithResult(_0x41116a,0xc9))['catch'](handleError(_0x41116a,null));};exports[_0xf950('0x30')]=function(_0x49980c,_0x2afe01){if(_0x49980c[_0xf950('0x51')]['id']){delete _0x49980c[_0xf950('0x51')]['id'];}return db[_0xf950('0x35')][_0xf950('0x52')]({'where':{'id':_0x49980c[_0xf950('0x53')]['id']}})['then'](handleEntityNotFound(_0x2afe01,null))['then'](saveUpdates(_0x49980c[_0xf950('0x51')],null))[_0xf950('0x1c')](respondWithResult(_0x2afe01,null))['catch'](handleError(_0x2afe01,null));};exports[_0xf950('0x54')]=function(_0x36af7f,_0x343698){return db['ChatGroup'][_0xf950('0x52')]({'where':{'id':_0x36af7f[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x343698,null))[_0xf950('0x1c')](removeEntity(_0x343698,null))['catch'](handleError(_0x343698,null));};exports[_0xf950('0x55')]=function(_0x466f7b,_0xca5920){return db[_0xf950('0x35')][_0xf950('0x55')]()['then'](respondWithResult(_0xca5920,null))[_0xf950('0x25')](handleError(_0xca5920,null));};exports[_0xf950('0x56')]=function(_0xe17f2f,_0x1e62e0,_0x21af63){return db[_0xf950('0x57')][_0xf950('0x2a')]({'where':{'ChatGroupId':_0xe17f2f['params']['id'],'ToId':_0xe17f2f[_0xf950('0x58')]['id'],'read':![]}})[_0xf950('0x1c')](function(_0x30605b){return{'id':_[_0xf950('0x59')](_0xe17f2f[_0xf950('0x53')]['id']),'count':_0x30605b};})['then'](respondWithResult(_0x1e62e0,null))[_0xf950('0x25')](handleError(_0x1e62e0,null));};exports[_0xf950('0x5a')]=function(_0x50ba12,_0x28c6f7,_0x594148){return db[_0xf950('0x35')][_0xf950('0x52')]({'where':{'id':_0x50ba12[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x28c6f7,null))[_0xf950('0x1c')](function(_0x3074c6){if(_0x3074c6){return _0x3074c6[_0xf950('0x5a')](_0x50ba12[_0xf950('0x51')][_0xf950('0x5b')],_['omit'](_0x50ba12[_0xf950('0x51')],[_0xf950('0x5b'),'id'])||{});}})[_0xf950('0x1c')](respondWithResult(_0x28c6f7,null))[_0xf950('0x25')](handleError(_0x28c6f7,null));};exports[_0xf950('0x5c')]=function(_0xefbfa0,_0x295914,_0x19bc53){var _0x109454={};var _0x1d019f={};var _0x241ee3;var _0x1c00b6;return db['ChatGroup']['findOne']({'where':{'id':_0xefbfa0[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x295914,null))[_0xf950('0x1c')](function(_0x112953){if(_0x112953){_0x241ee3=_0x112953;_0x1d019f[_0xf950('0x3a')]=_[_0xf950('0x4f')](db[_0xf950('0x5d')][_0xf950('0x36')]);_0x1d019f[_0xf950('0x3b')]=_[_0xf950('0x4f')](_0xefbfa0['query']);_0x1d019f[_0xf950('0x3c')]=_[_0xf950('0x3d')](_0x1d019f[_0xf950('0x3a')],_0x1d019f['query']);_0x109454[_0xf950('0x3e')]=_['intersection'](_0x1d019f[_0xf950('0x3a')],qs['fields'](_0xefbfa0[_0xf950('0x3b')]['fields']));_0x109454['attributes']=_0x109454[_0xf950('0x3e')]['length']?_0x109454[_0xf950('0x3e')]:_0x1d019f[_0xf950('0x3a')];_0x109454['order']=qs[_0xf950('0x45')](_0xefbfa0[_0xf950('0x3b')][_0xf950('0x45')]);_0x109454[_0xf950('0x46')]=qs[_0xf950('0x3c')](_[_0xf950('0x47')](_0xefbfa0['query'],_0x1d019f['filters']));if(_0xefbfa0[_0xf950('0x3b')][_0xf950('0x48')]){_0x109454[_0xf950('0x46')]=_[_0xf950('0x49')](_0x109454['where'],{'$or':_['map'](_0x109454[_0xf950('0x3e')],function(_0x431f0b){var _0x2421d0={};_0x2421d0[_0x431f0b]={'$like':'%'+_0xefbfa0[_0xf950('0x3b')][_0xf950('0x48')]+'%'};return _0x2421d0;})});}_0x109454=_[_0xf950('0x49')]({},_0x109454,_0xefbfa0[_0xf950('0x4b')]);return _0x241ee3['getMembers'](_0x109454);}})[_0xf950('0x1c')](function(_0x49682e){if(_0x49682e){_0x1c00b6=_0x49682e[_0xf950('0x40')];if(!_0xefbfa0['query']['hasOwnProperty'](_0xf950('0x42'))){_0x109454[_0xf950('0x43')]=qs[_0xf950('0x43')](_0xefbfa0[_0xf950('0x3b')][_0xf950('0x43')]);_0x109454[_0xf950('0x2b')]=qs[_0xf950('0x2b')](_0xefbfa0[_0xf950('0x3b')][_0xf950('0x2b')]);}return _0x241ee3['getMembers'](_0x109454);}})[_0xf950('0x1c')](function(_0x38b9d7){if(_0x38b9d7){return _0x38b9d7?{'count':_0x1c00b6,'rows':_0x38b9d7}:null;}})[_0xf950('0x1c')](respondWithResult(_0x295914,null))[_0xf950('0x25')](handleError(_0x295914,null));};exports[_0xf950('0x5e')]=function(_0x158a09,_0x113ced,_0x425a5b){return db[_0xf950('0x35')]['find']({'where':{'id':_0x158a09[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x113ced,null))['then'](function(_0xd570e5){if(_0xd570e5){return _0xd570e5[_0xf950('0x5e')](_0x158a09[_0xf950('0x3b')][_0xf950('0x5b')]);}})[_0xf950('0x1c')](respondWithStatusCode(_0x113ced,null))[_0xf950('0x25')](handleError(_0x113ced,null));};exports[_0xf950('0x5f')]=function(_0x19ba57,_0x2d916b,_0x52dbd7){if(_0x19ba57[_0xf950('0x51')]['id']){delete _0x19ba57['body']['id'];}return db[_0xf950('0x35')][_0xf950('0x52')]({'where':{'id':_0x19ba57[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x2d916b,null))[_0xf950('0x1c')](function(_0x24bf20){if(_0x24bf20){_0x19ba57[_0xf950('0x51')][_0xf950('0x60')]=_0x24bf20['id'];return db[_0xf950('0x57')][_0xf950('0x50')](_0x19ba57[_0xf950('0x51')]);}})[_0xf950('0x1c')](respondWithResult(_0x2d916b,null))[_0xf950('0x25')](handleError(_0x2d916b,null));};exports[_0xf950('0x61')]=function(_0x686754,_0x20df1b,_0x5d9677){var _0x497d26={};var _0xe14d0f={};var _0x3d55f7;var _0x4cfd12;return db[_0xf950('0x35')][_0xf950('0x62')]({'where':{'id':_0x686754[_0xf950('0x53')]['id']}})[_0xf950('0x1c')](handleEntityNotFound(_0x20df1b,null))[_0xf950('0x1c')](function(_0x14f9b6){if(_0x14f9b6){_0x3d55f7=_0x14f9b6;_0xe14d0f[_0xf950('0x3a')]=_['keys'](db[_0xf950('0x57')][_0xf950('0x36')]);_0xe14d0f['query']=_[_0xf950('0x4f')](_0x686754['query']);_0xe14d0f[_0xf950('0x3c')]=_[_0xf950('0x3d')](_0xe14d0f[_0xf950('0x3a')],_0xe14d0f[_0xf950('0x3b')]);_0x497d26['attributes']=_['intersection'](_0xe14d0f['model'],qs[_0xf950('0x3f')](_0x686754[_0xf950('0x3b')][_0xf950('0x3f')]));_0x497d26[_0xf950('0x3e')]=_0x497d26[_0xf950('0x3e')][_0xf950('0x40')]?_0x497d26[_0xf950('0x3e')]:_0xe14d0f[_0xf950('0x3a')];_0x497d26[_0xf950('0x44')]=qs[_0xf950('0x45')](_0x686754[_0xf950('0x3b')][_0xf950('0x45')]);_0x497d26[_0xf950('0x46')]=qs[_0xf950('0x3c')](_['pick'](_0x686754['query'],_0xe14d0f[_0xf950('0x3c')]));if(_0x686754[_0xf950('0x3b')][_0xf950('0x48')]){_0x497d26['where']=_[_0xf950('0x49')](_0x497d26[_0xf950('0x46')],{'$or':_[_0xf950('0x34')](_0x497d26[_0xf950('0x3e')],function(_0xa790cd){var _0x4373fc={};_0x4373fc[_0xa790cd]={'$like':'%'+_0x686754['query'][_0xf950('0x48')]+'%'};return _0x4373fc;})});}if(_0x686754[_0xf950('0x3b')][_0xf950('0x63')]){var _0x520804=_0x686754[_0xf950('0x3b')]['$gte'][_0xf950('0x64')](',');var _0xeeed5f={};_0xeeed5f[_0x520804[0x0]]={'$gte':moment(_0x520804[0x1])['format'](_0xf950('0x65'))};_0x497d26['where']=_[_0xf950('0x49')](_0x497d26['where'],_0xeeed5f);}_0x497d26=_[_0xf950('0x49')]({},_0x497d26,_0x686754[_0xf950('0x4b')]);return _0x3d55f7[_0xf950('0x61')](_0x497d26);}})[_0xf950('0x1c')](function(_0x106f0d){if(_0x106f0d){_0x4cfd12=_0x106f0d[_0xf950('0x40')];if(!_0x686754[_0xf950('0x3b')][_0xf950('0x41')](_0xf950('0x42'))){_0x497d26[_0xf950('0x43')]=qs[_0xf950('0x43')](_0x686754[_0xf950('0x3b')][_0xf950('0x43')]);_0x497d26[_0xf950('0x2b')]=qs[_0xf950('0x2b')](_0x686754[_0xf950('0x3b')][_0xf950('0x2b')]);}return _0x3d55f7[_0xf950('0x61')](_0x497d26);}})[_0xf950('0x1c')](function(_0x34aa53){if(_0x34aa53){return _0x34aa53?{'count':_0x4cfd12,'rows':_0x34aa53}:null;}})['then'](respondWithResult(_0x20df1b,null))[_0xf950('0x25')](handleError(_0x20df1b,null));}; \ No newline at end of file +var _0xd118=['addMessage','ChatGroupId','getMessages','$gte','split','format','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','lodash','squel','desk.js','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatGroup.socket','client','http','test','Sequelize','request','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','name','send','index','map','ChatGroup','rawAttributes','fieldName','type','key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','includeAll','find','create','body','params','describe','getUnread','ChatInternalMessage','addMembers','ids','omit','getMembers','findOne','User','removeMembers'];(function(_0x59f89c,_0x2c9e05){var _0x13238f=function(_0x1360f3){while(--_0x1360f3){_0x59f89c['push'](_0x59f89c['shift']());}};_0x13238f(++_0x2c9e05);}(_0xd118,0x6e));var _0x8d11=function(_0x3f2942,_0x21e389){_0x3f2942=_0x3f2942-0x0;var _0x364e2a=_0xd118[_0x3f2942];return _0x364e2a;};'use strict';var pdf=require(_0x8d11('0x0'));var emlformat=require(_0x8d11('0x1'));var rimraf=require(_0x8d11('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8d11('0x3'));var rp=require(_0x8d11('0x4'));var moment=require(_0x8d11('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8d11('0x6'));var path=require('path');var sox=require(_0x8d11('0x7'));var csv=require(_0x8d11('0x8'));var ejs=require(_0x8d11('0x9'));var fs=require('fs');var _=require(_0x8d11('0xa'));var squel=require(_0x8d11('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8d11('0xc'));var toCsv=require(_0x8d11('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x8d11('0xd'));var qs=require(_0x8d11('0xe'));var as=require(_0x8d11('0xf'));var hardwareService=require(_0x8d11('0x10'));var logger=require(_0x8d11('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x8d11('0x12'));var db=require(_0x8d11('0x13'))['db'];config[_0x8d11('0x14')]=_[_0x8d11('0x15')](config[_0x8d11('0x14')],{'host':'localhost','port':0x18eb});var socket=require(_0x8d11('0x16'))(new Redis(config[_0x8d11('0x14')]));require(_0x8d11('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x8d11('0x18')][_0x8d11('0x19')]({'port':0x232a});function checkPasswordPattern(_0x53b3a3,_0x5ed8bb,_0x3c62ae){if(_0x3c62ae){var _0x30b182=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30b182[_0x8d11('0x1a')](_0x5ed8bb)){return _0x53b3a3;}else{throw new db[(_0x8d11('0x1b'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x53b3a3;}}function respondWithRpcPromise(_0x1deb1a,_0x31cf4b,_0x4a135c,_0x4dd35e){return new BPromise(function(_0x73eeac,_0x126c80){var _0x2a521d=_0x4dd35e||client;return _0x2a521d[_0x8d11('0x1c')](_0x1deb1a,_0x4a135c)[_0x8d11('0x1d')](function(_0x560254){logger[_0x8d11('0x1e')](_0x8d11('0x1f'),_0x31cf4b,_0x8d11('0x20'));logger[_0x8d11('0x21')](_0x8d11('0x22'),_0x31cf4b,_0x8d11('0x20'),JSON[_0x8d11('0x23')](_0x560254));if(_0x560254[_0x8d11('0x24')]){if(_0x560254['error'][_0x8d11('0x25')]===0x1f4){logger[_0x8d11('0x24')](_0x8d11('0x1f'),_0x31cf4b,_0x560254[_0x8d11('0x24')][_0x8d11('0x26')]);return _0x126c80(_0x560254[_0x8d11('0x24')][_0x8d11('0x26')]);}logger[_0x8d11('0x24')](_0x8d11('0x1f'),_0x31cf4b,_0x560254['error'][_0x8d11('0x26')]);return _0x73eeac(_0x560254[_0x8d11('0x24')]['message']);}else{logger[_0x8d11('0x1e')](_0x8d11('0x1f'),_0x31cf4b,_0x8d11('0x20'));_0x73eeac(_0x560254['result']['message']);}})[_0x8d11('0x27')](function(_0x36a296){logger[_0x8d11('0x24')](_0x8d11('0x1f'),_0x31cf4b,_0x36a296);_0x126c80(_0x36a296);});});}function respondWithStatusCode(_0xf2840e,_0x576336){_0x576336=_0x576336||0xcc;return function(_0x3ebd65){if(_0x3ebd65){return _0xf2840e[_0x8d11('0x28')](_0x576336);}return _0xf2840e[_0x8d11('0x29')](_0x576336)[_0x8d11('0x2a')]();};}function respondWithResult(_0x4db924,_0x3bd996){_0x3bd996=_0x3bd996||0xc8;return function(_0x5d3684){if(_0x5d3684){return _0x4db924['status'](_0x3bd996)[_0x8d11('0x2b')](_0x5d3684);}};}function respondWithFilteredResult(_0xf60f60,_0x2dff09){return function(_0x3ed465){if(_0x3ed465){var _0x1f924a=_0x3ed465[_0x8d11('0x2c')],_0x5acfaf=_0x2dff09[_0x8d11('0x2d')],_0x429a6d=_0x2dff09['offset']+_0x2dff09[_0x8d11('0x2e')],_0x296f75;if(_0x429a6d>=_0x1f924a){_0x429a6d=_0x1f924a;_0x296f75=0xc8;}else{_0x296f75=0xce;}_0xf60f60[_0x8d11('0x29')](_0x296f75);return _0xf60f60[_0x8d11('0x2f')](_0x8d11('0x30'),_0x5acfaf+'-'+_0x429a6d+'/'+_0x1f924a)[_0x8d11('0x2b')](_0x3ed465);}return null;};}function patchUpdates(_0x4e74b2){return function(_0x4e5c77){try{jsonpatch[_0x8d11('0x31')](_0x4e5c77,_0x4e74b2,!![]);}catch(_0x1e7b7b){return BPromise[_0x8d11('0x32')](_0x1e7b7b);}return _0x4e5c77[_0x8d11('0x33')]();};}function saveUpdates(_0x491809,_0xd55016){return function(_0x25ec4c){if(_0x25ec4c){return _0x25ec4c['update'](_0x491809)[_0x8d11('0x1d')](function(_0x180f96){return _0x180f96;});}return null;};}function removeEntity(_0x476ef2,_0x1db840){return function(_0x36bae5){if(_0x36bae5){return _0x36bae5[_0x8d11('0x34')]()[_0x8d11('0x1d')](function(){_0x476ef2[_0x8d11('0x29')](0xcc)[_0x8d11('0x2a')]();});}};}function handleEntityNotFound(_0x2b14b4,_0xf524ae){return function(_0x523a2c){if(!_0x523a2c){_0x2b14b4[_0x8d11('0x28')](0x194);}return _0x523a2c;};}function handleError(_0x207df9,_0x296a90){_0x296a90=_0x296a90||0x1f4;return function(_0x32af90){logger['error'](_0x32af90['stack']);if(_0x32af90[_0x8d11('0x35')]){delete _0x32af90[_0x8d11('0x35')];}_0x207df9[_0x8d11('0x29')](_0x296a90)[_0x8d11('0x36')](_0x32af90);};}exports[_0x8d11('0x37')]=function(_0x303750,_0x328122){var _0x2f2c6e={},_0x21661d={},_0x3dab85={'count':0x0,'rows':[]};var _0x1586d1=_[_0x8d11('0x38')](db[_0x8d11('0x39')][_0x8d11('0x3a')],function(_0x96e4e5){return{'name':_0x96e4e5[_0x8d11('0x3b')],'type':_0x96e4e5[_0x8d11('0x3c')][_0x8d11('0x3d')]};});_0x21661d[_0x8d11('0x3e')]=_[_0x8d11('0x38')](_0x1586d1,_0x8d11('0x35'));_0x21661d['query']=_[_0x8d11('0x3f')](_0x303750['query']);_0x21661d[_0x8d11('0x40')]=_['intersection'](_0x21661d['model'],_0x21661d[_0x8d11('0x41')]);_0x2f2c6e[_0x8d11('0x42')]=_[_0x8d11('0x43')](_0x21661d[_0x8d11('0x3e')],qs[_0x8d11('0x44')](_0x303750[_0x8d11('0x41')][_0x8d11('0x44')]));_0x2f2c6e[_0x8d11('0x42')]=_0x2f2c6e[_0x8d11('0x42')][_0x8d11('0x45')]?_0x2f2c6e['attributes']:_0x21661d[_0x8d11('0x3e')];if(!_0x303750['query'][_0x8d11('0x46')](_0x8d11('0x47'))){_0x2f2c6e[_0x8d11('0x2e')]=qs[_0x8d11('0x2e')](_0x303750[_0x8d11('0x41')][_0x8d11('0x2e')]);_0x2f2c6e[_0x8d11('0x2d')]=qs[_0x8d11('0x2d')](_0x303750[_0x8d11('0x41')]['offset']);}_0x2f2c6e[_0x8d11('0x48')]=qs[_0x8d11('0x49')](_0x303750['query']['sort']);_0x2f2c6e[_0x8d11('0x4a')]=qs[_0x8d11('0x40')](_[_0x8d11('0x4b')](_0x303750[_0x8d11('0x41')],_0x21661d[_0x8d11('0x40')]));if(_0x303750[_0x8d11('0x41')][_0x8d11('0x4c')]){_0x2f2c6e[_0x8d11('0x4a')]=_[_0x8d11('0x4d')](_0x2f2c6e[_0x8d11('0x4a')],{'$or':_[_0x8d11('0x38')](_0x1586d1,function(_0x3b3ec7){if(_0x3b3ec7[_0x8d11('0x3c')]!==_0x8d11('0x4e')){var _0x43bdb3={};_0x43bdb3[_0x3b3ec7[_0x8d11('0x35')]]={'$like':'%'+_0x303750[_0x8d11('0x41')][_0x8d11('0x4c')]+'%'};return _0x43bdb3;}})});}_0x2f2c6e=_[_0x8d11('0x4d')]({},_0x2f2c6e,_0x303750[_0x8d11('0x4f')]);var _0x5f50e3={'where':_0x2f2c6e['where']};return db[_0x8d11('0x39')][_0x8d11('0x2c')](_0x5f50e3)[_0x8d11('0x1d')](function(_0x19578c){_0x3dab85['count']=_0x19578c;if(_0x303750[_0x8d11('0x41')]['includeAll']){_0x2f2c6e[_0x8d11('0x50')]=[{'all':!![]}];}return db['ChatGroup'][_0x8d11('0x51')](_0x2f2c6e);})[_0x8d11('0x1d')](function(_0x299e31){_0x3dab85['rows']=_0x299e31;return _0x3dab85;})[_0x8d11('0x1d')](respondWithFilteredResult(_0x328122,_0x2f2c6e))[_0x8d11('0x27')](handleError(_0x328122,null));};exports[_0x8d11('0x52')]=function(_0x22b167,_0x122a76){var _0x205f45={'raw':!![],'where':{'id':_0x22b167['params']['id']}},_0x713a4d={};_0x713a4d[_0x8d11('0x3e')]=_[_0x8d11('0x3f')](db[_0x8d11('0x39')][_0x8d11('0x3a')]);_0x713a4d[_0x8d11('0x41')]=_[_0x8d11('0x3f')](_0x22b167[_0x8d11('0x41')]);_0x713a4d['filters']=_[_0x8d11('0x43')](_0x713a4d[_0x8d11('0x3e')],_0x713a4d[_0x8d11('0x41')]);_0x205f45[_0x8d11('0x42')]=_[_0x8d11('0x43')](_0x713a4d[_0x8d11('0x3e')],qs[_0x8d11('0x44')](_0x22b167[_0x8d11('0x41')]['fields']));_0x205f45[_0x8d11('0x42')]=_0x205f45[_0x8d11('0x42')][_0x8d11('0x45')]?_0x205f45[_0x8d11('0x42')]:_0x713a4d['model'];if(_0x22b167[_0x8d11('0x41')][_0x8d11('0x53')]){_0x205f45[_0x8d11('0x50')]=[{'all':!![]}];}_0x205f45=_['merge']({},_0x205f45,_0x22b167['options']);return db[_0x8d11('0x39')][_0x8d11('0x54')](_0x205f45)['then'](handleEntityNotFound(_0x122a76,null))['then'](respondWithResult(_0x122a76,null))['catch'](handleError(_0x122a76,null));};exports[_0x8d11('0x55')]=function(_0xa92aa9,_0x478e5f){return db[_0x8d11('0x39')]['create'](_0xa92aa9[_0x8d11('0x56')],{})[_0x8d11('0x1d')](respondWithResult(_0x478e5f,0xc9))[_0x8d11('0x27')](handleError(_0x478e5f,null));};exports['update']=function(_0x599c0a,_0x3582dd){if(_0x599c0a['body']['id']){delete _0x599c0a[_0x8d11('0x56')]['id'];}return db['ChatGroup'][_0x8d11('0x54')]({'where':{'id':_0x599c0a[_0x8d11('0x57')]['id']}})[_0x8d11('0x1d')](handleEntityNotFound(_0x3582dd,null))[_0x8d11('0x1d')](saveUpdates(_0x599c0a['body'],null))[_0x8d11('0x1d')](respondWithResult(_0x3582dd,null))[_0x8d11('0x27')](handleError(_0x3582dd,null));};exports['destroy']=function(_0xad2d94,_0x153ca8){return db[_0x8d11('0x39')][_0x8d11('0x54')]({'where':{'id':_0xad2d94['params']['id']}})[_0x8d11('0x1d')](handleEntityNotFound(_0x153ca8,null))[_0x8d11('0x1d')](removeEntity(_0x153ca8,null))['catch'](handleError(_0x153ca8,null));};exports[_0x8d11('0x58')]=function(_0x4c912c,_0x5b689f){return db['ChatGroup'][_0x8d11('0x58')]()['then'](respondWithResult(_0x5b689f,null))[_0x8d11('0x27')](handleError(_0x5b689f,null));};exports[_0x8d11('0x59')]=function(_0x2a1e54,_0x4125fe,_0xf8378){return db[_0x8d11('0x5a')][_0x8d11('0x2c')]({'where':{'ChatGroupId':_0x2a1e54[_0x8d11('0x57')]['id'],'ToId':_0x2a1e54['user']['id'],'read':![]}})['then'](function(_0x2110f8){return{'id':_['toInteger'](_0x2a1e54[_0x8d11('0x57')]['id']),'count':_0x2110f8};})[_0x8d11('0x1d')](respondWithResult(_0x4125fe,null))['catch'](handleError(_0x4125fe,null));};exports[_0x8d11('0x5b')]=function(_0x10ceb8,_0x252bce,_0x227e50){return db[_0x8d11('0x39')][_0x8d11('0x54')]({'where':{'id':_0x10ceb8[_0x8d11('0x57')]['id']}})['then'](handleEntityNotFound(_0x252bce,null))['then'](function(_0x83f475){if(_0x83f475){return _0x83f475[_0x8d11('0x5b')](_0x10ceb8['body'][_0x8d11('0x5c')],_[_0x8d11('0x5d')](_0x10ceb8[_0x8d11('0x56')],[_0x8d11('0x5c'),'id'])||{});}})['then'](respondWithResult(_0x252bce,null))[_0x8d11('0x27')](handleError(_0x252bce,null));};exports[_0x8d11('0x5e')]=function(_0x182321,_0x10ce4,_0x48347a){var _0xd5f69f={};var _0x35dcd3={};var _0x3b63cf;var _0x540d93;return db['ChatGroup'][_0x8d11('0x5f')]({'where':{'id':_0x182321['params']['id']}})[_0x8d11('0x1d')](handleEntityNotFound(_0x10ce4,null))[_0x8d11('0x1d')](function(_0x5ac4df){if(_0x5ac4df){_0x3b63cf=_0x5ac4df;_0x35dcd3[_0x8d11('0x3e')]=_[_0x8d11('0x3f')](db[_0x8d11('0x60')][_0x8d11('0x3a')]);_0x35dcd3['query']=_[_0x8d11('0x3f')](_0x182321['query']);_0x35dcd3[_0x8d11('0x40')]=_[_0x8d11('0x43')](_0x35dcd3['model'],_0x35dcd3[_0x8d11('0x41')]);_0xd5f69f['attributes']=_[_0x8d11('0x43')](_0x35dcd3[_0x8d11('0x3e')],qs[_0x8d11('0x44')](_0x182321[_0x8d11('0x41')][_0x8d11('0x44')]));_0xd5f69f[_0x8d11('0x42')]=_0xd5f69f[_0x8d11('0x42')][_0x8d11('0x45')]?_0xd5f69f[_0x8d11('0x42')]:_0x35dcd3[_0x8d11('0x3e')];_0xd5f69f[_0x8d11('0x48')]=qs[_0x8d11('0x49')](_0x182321[_0x8d11('0x41')][_0x8d11('0x49')]);_0xd5f69f['where']=qs[_0x8d11('0x40')](_['pick'](_0x182321[_0x8d11('0x41')],_0x35dcd3[_0x8d11('0x40')]));if(_0x182321[_0x8d11('0x41')][_0x8d11('0x4c')]){_0xd5f69f[_0x8d11('0x4a')]=_[_0x8d11('0x4d')](_0xd5f69f['where'],{'$or':_[_0x8d11('0x38')](_0xd5f69f[_0x8d11('0x42')],function(_0x58d921){var _0x3160a9={};_0x3160a9[_0x58d921]={'$like':'%'+_0x182321['query'][_0x8d11('0x4c')]+'%'};return _0x3160a9;})});}_0xd5f69f=_[_0x8d11('0x4d')]({},_0xd5f69f,_0x182321['options']);return _0x3b63cf[_0x8d11('0x5e')](_0xd5f69f);}})['then'](function(_0x34702d){if(_0x34702d){_0x540d93=_0x34702d['length'];if(!_0x182321[_0x8d11('0x41')][_0x8d11('0x46')]('nolimit')){_0xd5f69f[_0x8d11('0x2e')]=qs[_0x8d11('0x2e')](_0x182321[_0x8d11('0x41')][_0x8d11('0x2e')]);_0xd5f69f[_0x8d11('0x2d')]=qs['offset'](_0x182321[_0x8d11('0x41')][_0x8d11('0x2d')]);}return _0x3b63cf[_0x8d11('0x5e')](_0xd5f69f);}})[_0x8d11('0x1d')](function(_0x2bf6f0){if(_0x2bf6f0){return _0x2bf6f0?{'count':_0x540d93,'rows':_0x2bf6f0}:null;}})['then'](respondWithResult(_0x10ce4,null))[_0x8d11('0x27')](handleError(_0x10ce4,null));};exports[_0x8d11('0x61')]=function(_0x546476,_0x23be7e,_0x3bf08f){return db[_0x8d11('0x39')][_0x8d11('0x54')]({'where':{'id':_0x546476[_0x8d11('0x57')]['id']}})['then'](handleEntityNotFound(_0x23be7e,null))['then'](function(_0x2db83a){if(_0x2db83a){return _0x2db83a[_0x8d11('0x61')](_0x546476[_0x8d11('0x41')][_0x8d11('0x5c')]);}})[_0x8d11('0x1d')](respondWithStatusCode(_0x23be7e,null))[_0x8d11('0x27')](handleError(_0x23be7e,null));};exports[_0x8d11('0x62')]=function(_0x4fbefb,_0x5e809a,_0x36b12c){if(_0x4fbefb[_0x8d11('0x56')]['id']){delete _0x4fbefb[_0x8d11('0x56')]['id'];}return db[_0x8d11('0x39')]['find']({'where':{'id':_0x4fbefb['params']['id']}})[_0x8d11('0x1d')](handleEntityNotFound(_0x5e809a,null))['then'](function(_0x543912){if(_0x543912){_0x4fbefb[_0x8d11('0x56')][_0x8d11('0x63')]=_0x543912['id'];return db[_0x8d11('0x5a')]['create'](_0x4fbefb['body']);}})[_0x8d11('0x1d')](respondWithResult(_0x5e809a,null))['catch'](handleError(_0x5e809a,null));};exports[_0x8d11('0x64')]=function(_0x256861,_0x1ac7e2,_0x4bcfdd){var _0x1319d4={};var _0xc1fc7={};var _0x39cf66;var _0x59c135;return db[_0x8d11('0x39')][_0x8d11('0x5f')]({'where':{'id':_0x256861[_0x8d11('0x57')]['id']}})['then'](handleEntityNotFound(_0x1ac7e2,null))[_0x8d11('0x1d')](function(_0x309e8a){if(_0x309e8a){_0x39cf66=_0x309e8a;_0xc1fc7[_0x8d11('0x3e')]=_[_0x8d11('0x3f')](db[_0x8d11('0x5a')][_0x8d11('0x3a')]);_0xc1fc7[_0x8d11('0x41')]=_['keys'](_0x256861['query']);_0xc1fc7[_0x8d11('0x40')]=_[_0x8d11('0x43')](_0xc1fc7[_0x8d11('0x3e')],_0xc1fc7[_0x8d11('0x41')]);_0x1319d4[_0x8d11('0x42')]=_[_0x8d11('0x43')](_0xc1fc7['model'],qs[_0x8d11('0x44')](_0x256861[_0x8d11('0x41')][_0x8d11('0x44')]));_0x1319d4[_0x8d11('0x42')]=_0x1319d4[_0x8d11('0x42')][_0x8d11('0x45')]?_0x1319d4['attributes']:_0xc1fc7[_0x8d11('0x3e')];_0x1319d4[_0x8d11('0x48')]=qs['sort'](_0x256861['query']['sort']);_0x1319d4[_0x8d11('0x4a')]=qs[_0x8d11('0x40')](_[_0x8d11('0x4b')](_0x256861[_0x8d11('0x41')],_0xc1fc7[_0x8d11('0x40')]));if(_0x256861[_0x8d11('0x41')][_0x8d11('0x4c')]){_0x1319d4['where']=_[_0x8d11('0x4d')](_0x1319d4['where'],{'$or':_[_0x8d11('0x38')](_0x1319d4[_0x8d11('0x42')],function(_0x202d5d){var _0x1fa13a={};_0x1fa13a[_0x202d5d]={'$like':'%'+_0x256861[_0x8d11('0x41')][_0x8d11('0x4c')]+'%'};return _0x1fa13a;})});}if(_0x256861['query'][_0x8d11('0x65')]){var _0x4b2d38=_0x256861[_0x8d11('0x41')][_0x8d11('0x65')][_0x8d11('0x66')](',');var _0x909588={};_0x909588[_0x4b2d38[0x0]]={'$gte':moment(_0x4b2d38[0x1])[_0x8d11('0x67')]('YYYY-MM-DD\x20HH:mm:ss')};_0x1319d4[_0x8d11('0x4a')]=_[_0x8d11('0x4d')](_0x1319d4['where'],_0x909588);}_0x1319d4=_[_0x8d11('0x4d')]({},_0x1319d4,_0x256861[_0x8d11('0x4f')]);return _0x39cf66[_0x8d11('0x64')](_0x1319d4);}})['then'](function(_0x4c5c16){if(_0x4c5c16){_0x59c135=_0x4c5c16[_0x8d11('0x45')];if(!_0x256861[_0x8d11('0x41')][_0x8d11('0x46')](_0x8d11('0x47'))){_0x1319d4['limit']=qs[_0x8d11('0x2e')](_0x256861['query']['limit']);_0x1319d4[_0x8d11('0x2d')]=qs['offset'](_0x256861['query'][_0x8d11('0x2d')]);}return _0x39cf66['getMessages'](_0x1319d4);}})[_0x8d11('0x1d')](function(_0x52fb9e){if(_0x52fb9e){return _0x52fb9e?{'count':_0x59c135,'rows':_0x52fb9e}:null;}})[_0x8d11('0x1d')](respondWithResult(_0x1ac7e2,null))['catch'](handleError(_0x1ac7e2,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 69ebabf..c9fc188 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 _0x2ef3=['setMaxListeners','save','update','emit','hook','exports','events','../../mysqldb','ChatGroup'];(function(_0xd0f42d,_0x5beaab){var _0x26534c=function(_0x281ccb){while(--_0x281ccb){_0xd0f42d['push'](_0xd0f42d['shift']());}};_0x26534c(++_0x5beaab);}(_0x2ef3,0xba));var _0x32ef=function(_0x108cda,_0x31c8aa){_0x108cda=_0x108cda-0x0;var _0xa04d1f=_0x2ef3[_0x108cda];return _0xa04d1f;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var ChatGroup=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x32ef('0x3')](0x0);var events={'afterCreate':_0x32ef('0x4'),'afterUpdate':_0x32ef('0x5'),'afterDestroy':'remove'};function emitEvent(_0x38f865){return function(_0x38b7f3,_0x524ab6,_0x402857){ChatGroupEvents[_0x32ef('0x6')](_0x38f865+':'+_0x38b7f3['id'],_0x38b7f3);ChatGroupEvents['emit'](_0x38f865,_0x38b7f3);_0x402857(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup[_0x32ef('0x7')](e,emitEvent(event));}}module[_0x32ef('0x8')]=ChatGroupEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x43cb7e,_0x3f1ae7){var _0x23798c=function(_0x443e2a){while(--_0x443e2a){_0x43cb7e['push'](_0x43cb7e['shift']());}};_0x23798c(++_0x3f1ae7);}(_0xb10b,0x12a));var _0xbb10=function(_0x4a64df,_0x2a89b1){_0x4a64df=_0x4a64df-0x0;var _0x5b3929=_0xb10b[_0x4a64df];return _0x5b3929;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 5d1bc1e..1906b3d 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 _0xb673=['moment','bluebird','path','rimraf','../../config/environment','exports','define','ChatGroup','chat_groups','lodash','util','api'];(function(_0x5aac41,_0x21d386){var _0x491e33=function(_0x392029){while(--_0x392029){_0x5aac41['push'](_0x5aac41['shift']());}};_0x491e33(++_0x21d386);}(_0xb673,0xa5));var _0x3b67=function(_0x415800,_0x5e57ca){_0x415800=_0x415800-0x0;var _0x3a3471=_0xb673[_0x415800];return _0x3a3471;};'use strict';var _=require(_0x3b67('0x0'));var util=require(_0x3b67('0x1'));var logger=require('../../config/logger')(_0x3b67('0x2'));var moment=require(_0x3b67('0x3'));var BPromise=require(_0x3b67('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b67('0x5'));var rimraf=require(_0x3b67('0x6'));var config=require(_0x3b67('0x7'));var attributes=require('./chatGroup.attributes');module[_0x3b67('0x8')]=function(_0x4bb159,_0x296e4c){return _0x4bb159[_0x3b67('0x9')](_0x3b67('0xa'),attributes,{'tableName':_0x3b67('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4f5d=['define','ChatGroup','chat_groups','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./chatGroup.attributes','exports'];(function(_0x5672b9,_0x32c790){var _0x24d6fa=function(_0x11e78d){while(--_0x11e78d){_0x5672b9['push'](_0x5672b9['shift']());}};_0x24d6fa(++_0x32c790);}(_0x4f5d,0x1d1));var _0xd4f5=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4f5d[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xd4f5('0x0'));var util=require(_0xd4f5('0x1'));var logger=require(_0xd4f5('0x2'))(_0xd4f5('0x3'));var moment=require(_0xd4f5('0x4'));var BPromise=require(_0xd4f5('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd4f5('0x6'));var rimraf=require(_0xd4f5('0x7'));var config=require(_0xd4f5('0x8'));var attributes=require(_0xd4f5('0x9'));module[_0xd4f5('0xa')]=function(_0x2c44bb,_0x121bfd){return _0x2c44bb[_0xd4f5('0xb')](_0xd4f5('0xc'),attributes,{'tableName':_0xd4f5('0xd'),'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 851f2a9..d5c38ca 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 _0x0d71=['register','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket'];(function(_0x2f92d8,_0x2ef7f4){var _0x200ef1=function(_0x24f52e){while(--_0x24f52e){_0x2f92d8['push'](_0x2f92d8['shift']());}};_0x200ef1(++_0x2ef7f4);}(_0x0d71,0x125));var _0x10d7=function(_0x5aa432,_0x43d16e){_0x5aa432=_0x5aa432-0x0;var _0xbef0b4=_0x0d71[_0x5aa432];return _0xbef0b4;};'use strict';var _=require('lodash');var util=require(_0x10d7('0x0'));var moment=require(_0x10d7('0x1'));var BPromise=require(_0x10d7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x10d7('0x3'));var db=require(_0x10d7('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x10d7('0x5'))(_0x10d7('0x6'));var config=require('../../config/environment');var jayson=require(_0x10d7('0x7'));var client=jayson[_0x10d7('0x8')][_0x10d7('0x9')]({'port':0x232a});config[_0x10d7('0xa')]=_[_0x10d7('0xb')](config[_0x10d7('0xa')],{'host':_0x10d7('0xc'),'port':0x18eb});var socket=require(_0x10d7('0xd'))(new Redis(config[_0x10d7('0xa')]));require(_0x10d7('0xe'))[_0x10d7('0xf')](socket);function respondWithRpcPromise(_0x2f25f6,_0x26c2b3,_0x35b2d5){return new BPromise(function(_0xf05946,_0x26cf19){return client[_0x10d7('0x10')](_0x2f25f6,_0x35b2d5)[_0x10d7('0x11')](function(_0x20d71a){logger['info'](_0x10d7('0x12'),_0x26c2b3,_0x10d7('0x13'));logger[_0x10d7('0x14')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x26c2b3,_0x10d7('0x13'),JSON[_0x10d7('0x15')](_0x20d71a));if(_0x20d71a[_0x10d7('0x16')]){if(_0x20d71a[_0x10d7('0x16')][_0x10d7('0x17')]===0x1f4){logger[_0x10d7('0x16')](_0x10d7('0x12'),_0x26c2b3,_0x20d71a[_0x10d7('0x16')]['message']);return _0x26cf19(_0x20d71a[_0x10d7('0x16')][_0x10d7('0x18')]);}logger[_0x10d7('0x16')](_0x10d7('0x12'),_0x26c2b3,_0x20d71a[_0x10d7('0x16')]['message']);return _0xf05946(_0x20d71a['error'][_0x10d7('0x18')]);}else{logger[_0x10d7('0x19')](_0x10d7('0x12'),_0x26c2b3,_0x10d7('0x13'));_0xf05946(_0x20d71a[_0x10d7('0x1a')][_0x10d7('0x18')]);}})[_0x10d7('0x1b')](function(_0x4aa3da){logger['error'](_0x10d7('0x12'),_0x26c2b3,_0x4aa3da);_0x26cf19(_0x4aa3da);});});} \ No newline at end of file +var _0x700f=['debug','stringify','error','code','ChatGroup,\x20%s,\x20%s','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','request','info','request\x20sent'];(function(_0x517d72,_0xd5a53){var _0x17c037=function(_0x35c116){while(--_0x35c116){_0x517d72['push'](_0x517d72['shift']());}};_0x17c037(++_0xd5a53);}(_0x700f,0xd2));var _0xf700=function(_0x305204,_0x1682a8){_0x305204=_0x305204-0x0;var _0x2aa5ab=_0x700f[_0x305204];return _0x2aa5ab;};'use strict';var _=require(_0xf700('0x0'));var util=require('util');var moment=require(_0xf700('0x1'));var BPromise=require(_0xf700('0x2'));var rs=require(_0xf700('0x3'));var fs=require('fs');var Redis=require(_0xf700('0x4'));var db=require(_0xf700('0x5'))['db'];var utils=require(_0xf700('0x6'));var logger=require(_0xf700('0x7'))(_0xf700('0x8'));var config=require(_0xf700('0x9'));var jayson=require(_0xf700('0xa'));var client=jayson[_0xf700('0xb')][_0xf700('0xc')]({'port':0x232a});config[_0xf700('0xd')]=_[_0xf700('0xe')](config[_0xf700('0xd')],{'host':_0xf700('0xf'),'port':0x18eb});var socket=require(_0xf700('0x10'))(new Redis(config[_0xf700('0xd')]));require(_0xf700('0x11'))[_0xf700('0x12')](socket);function respondWithRpcPromise(_0x45aff0,_0x3baf19,_0x357037){return new BPromise(function(_0x5c481f,_0x3359a1){return client[_0xf700('0x13')](_0x45aff0,_0x357037)['then'](function(_0x20b64a){logger[_0xf700('0x14')]('ChatGroup,\x20%s,\x20%s',_0x3baf19,_0xf700('0x15'));logger[_0xf700('0x16')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x3baf19,_0xf700('0x15'),JSON[_0xf700('0x17')](_0x20b64a));if(_0x20b64a[_0xf700('0x18')]){if(_0x20b64a['error'][_0xf700('0x19')]===0x1f4){logger[_0xf700('0x18')](_0xf700('0x1a'),_0x3baf19,_0x20b64a[_0xf700('0x18')][_0xf700('0x1b')]);return _0x3359a1(_0x20b64a['error']['message']);}logger[_0xf700('0x18')](_0xf700('0x1a'),_0x3baf19,_0x20b64a['error'][_0xf700('0x1b')]);return _0x5c481f(_0x20b64a[_0xf700('0x18')][_0xf700('0x1b')]);}else{logger['info'](_0xf700('0x1a'),_0x3baf19,'request\x20sent');_0x5c481f(_0x20b64a['result'][_0xf700('0x1b')]);}})[_0xf700('0x1c')](function(_0x143a75){logger[_0xf700('0x18')](_0xf700('0x1a'),_0x3baf19,_0x143a75);_0x3359a1(_0x143a75);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index 9b93c96..d661b3e 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 _0x9dce=['./chatGroup.events','save','update','emit','removeListener','register','length','chatGroup:'];(function(_0x548977,_0xd67bfb){var _0x10c3c6=function(_0x3eb9ec){while(--_0x3eb9ec){_0x548977['push'](_0x548977['shift']());}};_0x10c3c6(++_0xd67bfb);}(_0x9dce,0x138));var _0xe9dc=function(_0x1a9cf0,_0x45f935){_0x1a9cf0=_0x1a9cf0-0x0;var _0x3190bb=_0x9dce[_0x1a9cf0];return _0x3190bb;};'use strict';var ChatGroupEvents=require(_0xe9dc('0x0'));var events=[_0xe9dc('0x1'),'remove',_0xe9dc('0x2')];function createListener(_0x463cee,_0x2128e6){return function(_0x2435be){_0x2128e6[_0xe9dc('0x3')](_0x463cee,_0x2435be);};}function removeListener(_0x19855c,_0x1bca1e){return function(){ChatGroupEvents[_0xe9dc('0x4')](_0x19855c,_0x1bca1e);};}exports[_0xe9dc('0x5')]=function(_0x4885ac){for(var _0x223ec4=0x0,_0x50ac01=events[_0xe9dc('0x6')];_0x223ec4<_0x50ac01;_0x223ec4++){var _0x142739=events[_0x223ec4];var _0x7f1006=createListener(_0xe9dc('0x7')+_0x142739,_0x4885ac);ChatGroupEvents['on'](_0x142739,_0x7f1006);}}; \ No newline at end of file +var _0x6d4a=['update','emit','length','chatGroup:','save','remove'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x6d4a,0x124));var _0xa6d4=function(_0x2d2a28,_0x214213){_0x2d2a28=_0x2d2a28-0x0;var _0x6bd904=_0x6d4a[_0x2d2a28];return _0x6bd904;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=[_0xa6d4('0x0'),_0xa6d4('0x1'),_0xa6d4('0x2')];function createListener(_0x40a8e6,_0x51119a){return function(_0x2a37d7){_0x51119a[_0xa6d4('0x3')](_0x40a8e6,_0x2a37d7);};}function removeListener(_0x146f8b,_0x30bafe){return function(){ChatGroupEvents['removeListener'](_0x146f8b,_0x30bafe);};}exports['register']=function(_0x3f172c){for(var _0x3f896e=0x0,_0xa1ed4f=events[_0xa6d4('0x4')];_0x3f896e<_0xa1ed4f;_0x3f896e++){var _0xfa21cd=events[_0x3f896e];var _0x502613=createListener(_0xa6d4('0x5')+_0xfa21cd,_0x3f172c);ChatGroupEvents['on'](_0xfa21cd,_0x502613);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index 5e2950c..74d8d13 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 _0xc634=['addMessage','put','update','delete','removeMembers','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/unread','getUnread','/:id/members','getMembers','/:id/messages','getMessages','post','create'];(function(_0x294c13,_0x4a9d64){var _0xcddd13=function(_0x48e6db){while(--_0x48e6db){_0x294c13['push'](_0x294c13['shift']());}};_0xcddd13(++_0x4a9d64);}(_0xc634,0x13e));var _0x4c63=function(_0x29c2bb,_0x1bde54){_0x29c2bb=_0x29c2bb-0x0;var _0x5446f1=_0xc634[_0x29c2bb];return _0x5446f1;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4c63('0x0'));var timeout=require(_0x4c63('0x1'));var express=require(_0x4c63('0x2'));var router=express[_0x4c63('0x3')]();var auth=require(_0x4c63('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4c63('0x5'));var controller=require('./chatGroup.controller');router[_0x4c63('0x6')]('/',auth[_0x4c63('0x7')](),controller[_0x4c63('0x8')]);router[_0x4c63('0x6')]('/describe',auth[_0x4c63('0x7')](),controller['describe']);router[_0x4c63('0x6')](_0x4c63('0x9'),auth['isAuthenticated'](),controller['show']);router['get'](_0x4c63('0xa'),auth['isAuthenticated'](),controller[_0x4c63('0xb')]);router[_0x4c63('0x6')](_0x4c63('0xc'),auth[_0x4c63('0x7')](),controller[_0x4c63('0xd')]);router[_0x4c63('0x6')](_0x4c63('0xe'),auth[_0x4c63('0x7')](),controller[_0x4c63('0xf')]);router[_0x4c63('0x10')]('/',auth['isAuthenticated'](),controller[_0x4c63('0x11')]);router['post']('/:id/members',auth['isAuthenticated'](),controller['addMembers']);router[_0x4c63('0x10')](_0x4c63('0xe'),auth['isAuthenticated'](),controller[_0x4c63('0x12')]);router[_0x4c63('0x13')](_0x4c63('0x9'),auth['isAuthenticated'](),controller[_0x4c63('0x14')]);router[_0x4c63('0x15')](_0x4c63('0x9'),auth['isAuthenticated'](),controller['destroy']);router[_0x4c63('0x15')](_0x4c63('0xc'),auth['isAuthenticated'](),controller[_0x4c63('0x16')]);module[_0x4c63('0x17')]=router; \ No newline at end of file +var _0x80c4=['/:id','show','/:id/unread','/:id/members','/:id/messages','getMessages','post','addMembers','addMessage','put','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatGroup.controller','isAuthenticated','index','describe','get'];(function(_0x163742,_0x467e36){var _0x1152ac=function(_0x40a83d){while(--_0x40a83d){_0x163742['push'](_0x163742['shift']());}};_0x1152ac(++_0x467e36);}(_0x80c4,0xd5));var _0x480c=function(_0x1c1c12,_0x1c1755){_0x1c1c12=_0x1c1c12-0x0;var _0x1d0bf0=_0x80c4[_0x1c1c12];return _0x1d0bf0;};'use strict';var multer=require('multer');var util=require(_0x480c('0x0'));var path=require(_0x480c('0x1'));var timeout=require(_0x480c('0x2'));var express=require(_0x480c('0x3'));var router=express[_0x480c('0x4')]();var auth=require(_0x480c('0x5'));var interaction=require(_0x480c('0x6'));var config=require('../../config/environment');var controller=require(_0x480c('0x7'));router['get']('/',auth[_0x480c('0x8')](),controller[_0x480c('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x480c('0xa')]);router[_0x480c('0xb')](_0x480c('0xc'),auth[_0x480c('0x8')](),controller[_0x480c('0xd')]);router[_0x480c('0xb')](_0x480c('0xe'),auth['isAuthenticated'](),controller['getUnread']);router[_0x480c('0xb')](_0x480c('0xf'),auth[_0x480c('0x8')](),controller['getMembers']);router['get'](_0x480c('0x10'),auth['isAuthenticated'](),controller[_0x480c('0x11')]);router[_0x480c('0x12')]('/',auth[_0x480c('0x8')](),controller['create']);router[_0x480c('0x12')](_0x480c('0xf'),auth[_0x480c('0x8')](),controller[_0x480c('0x13')]);router[_0x480c('0x12')]('/:id/messages',auth[_0x480c('0x8')](),controller[_0x480c('0x14')]);router[_0x480c('0x15')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0x480c('0xc'),auth['isAuthenticated'](),controller[_0x480c('0x16')]);router['delete'](_0x480c('0xf'),auth[_0x480c('0x8')](),controller[_0x480c('0x17')]);module[_0x480c('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index 33e83e3..ddd5238 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 _0xc50f=['BOOLEAN','INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','long','out','exports'];(function(_0x4e61fb,_0x4ede33){var _0x5a2b26=function(_0x13c254){while(--_0x13c254){_0x4e61fb['push'](_0x4e61fb['shift']());}};_0x5a2b26(++_0x4ede33);}(_0xc50f,0x13e));var _0xfc50=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xc50f[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0xfc50('0x0')]={'closed':{'type':Sequelize[_0xfc50('0x1')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0xfc50('0x2')]},'ratingType':{'type':Sequelize[_0xfc50('0x3')](_0xfc50('0x4'),_0xfc50('0x5')),'defaultValue':_0xfc50('0x4')},'ratingMessage':{'type':Sequelize[_0xfc50('0x6')]},'pathTranscript':{'type':Sequelize[_0xfc50('0x6')]},'mailTranscript':{'type':Sequelize[_0xfc50('0x7')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0xfc50('0x8')]},'disposition':{'type':Sequelize[_0xfc50('0x7')]},'note':{'type':Sequelize[_0xfc50('0x7')]},'browserName':{'type':Sequelize[_0xfc50('0x7')]},'browserVersion':{'type':Sequelize['STRING']},'osName':{'type':Sequelize[_0xfc50('0x7')]},'osVersion':{'type':Sequelize[_0xfc50('0x7')]},'deviceModel':{'type':Sequelize[_0xfc50('0x7')]},'deviceVendor':{'type':Sequelize[_0xfc50('0x7')]},'deviceType':{'type':Sequelize[_0xfc50('0x7')]},'referer':{'type':Sequelize[_0xfc50('0x6')]},'customerIp':{'type':Sequelize[_0xfc50('0x7')]},'formData':{'type':Sequelize[_0xfc50('0x6')](_0xfc50('0x9'))},'read1stAt':{'type':Sequelize[_0xfc50('0x8')]},'lastMsgAt':{'type':Sequelize[_0xfc50('0x8')]},'lastMsgDirection':{'type':Sequelize[_0xfc50('0x3')]('in',_0xfc50('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0xfc50('0x7')]},'customerPort':{'type':Sequelize[_0xfc50('0x7')]}}; \ No newline at end of file +var _0xbec3=['INTEGER','ENUM','star','thumb','TEXT','STRING','DATE','out'];(function(_0x3cd77d,_0xf1bd15){var _0x276499=function(_0x270c7d){while(--_0x270c7d){_0x3cd77d['push'](_0x3cd77d['shift']());}};_0x276499(++_0xf1bd15);}(_0xbec3,0x118));var _0x3bec=function(_0x4644f1,_0x5c4521){_0x4644f1=_0x4644f1-0x0;var _0x4b1bce=_0xbec3[_0x4644f1];return _0x4b1bce;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x3bec('0x0')]},'ratingType':{'type':Sequelize[_0x3bec('0x1')](_0x3bec('0x2'),_0x3bec('0x3')),'defaultValue':_0x3bec('0x2')},'ratingMessage':{'type':Sequelize['TEXT']},'pathTranscript':{'type':Sequelize[_0x3bec('0x4')]},'mailTranscript':{'type':Sequelize[_0x3bec('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x3bec('0x5')]},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x3bec('0x5')]},'osName':{'type':Sequelize[_0x3bec('0x5')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize['STRING']},'deviceVendor':{'type':Sequelize[_0x3bec('0x5')]},'deviceType':{'type':Sequelize[_0x3bec('0x5')]},'referer':{'type':Sequelize[_0x3bec('0x4')]},'customerIp':{'type':Sequelize[_0x3bec('0x5')]},'formData':{'type':Sequelize[_0x3bec('0x4')]('long')},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x3bec('0x6')]},'lastMsgDirection':{'type':Sequelize[_0x3bec('0x1')]('in',_0x3bec('0x7')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x3bec('0x5')]},'customerPort':{'type':Sequelize[_0x3bec('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index f706a0f..6d9f40c 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 _0x33c5=['forEach','push','index','type','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','color','from','tools_tags','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','o.id\x20=\x20i.UserId','chat_websites','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','length','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','UserId','keys','some','compact','isEmpty','ChatWebsiteId','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','SELECT','clone','DESC','resolve','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','i.ChatWebsiteId\x20IN\x20?','sequelize','toString','merge','ChatInteraction','a.key','a.mandatoryDisposition','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','include','create','body','update','destroy','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','entity\x20not\x20found','AbandonInteraction','file','originalname','basename','filename','mimetype','Attachment','attachmentDownload','findOne','closed','Unauthorized','attachId','download','join','root','server/files/attachments/','close','mailTranscript','format','transcript-%s.txt','now','ChatMessage','Messages','User','ChatWebsite','CmContact','%s%d','agentAlias','System','customer','Visitor','website_alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailServerOut','Smtp','service','host','secure','authentication','auth','pass','SendMail','sendMail','email','Mail\x20Transcript','addMessage','ids','YYYY-MM-DD\x20HH:mm:ss','options','includeAll','findAll','getMyMessages','includeAgent','alias','addTags','setTags','spread','emit','removeTags','unix','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','lastName','read','Account','Owner','get','10px','40px','30px','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','closedAt','browserName','osName','referer','customerIp','customerPort','existsSync','createReadStream','pipe','createWriteStream','out','views','toFile','.pdf','log','err','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','name','Users','map','fullname','TagIds','Tags','split'];(function(_0x25d257,_0xfdf781){var _0x563731=function(_0x28efe9){while(--_0x28efe9){_0x25d257['push'](_0x25d257['shift']());}};_0x563731(++_0xfdf781);}(_0x33c5,0xe6));var _0x533c=function(_0x451e44,_0x2a4226){_0x451e44=_0x451e44-0x0;var _0x58f6ca=_0x33c5[_0x451e44];return _0x58f6ca;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x533c('0x0'));var rimraf=require(_0x533c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x533c('0x2'));var rp=require(_0x533c('0x3'));var moment=require(_0x533c('0x4'));var BPromise=require(_0x533c('0x5'));var Mustache=require(_0x533c('0x6'));var util=require('util');var path=require(_0x533c('0x7'));var sox=require(_0x533c('0x8'));var csv=require(_0x533c('0x9'));var ejs=require(_0x533c('0xa'));var fs=require('fs');var _=require(_0x533c('0xb'));var squel=require(_0x533c('0xc'));var crypto=require(_0x533c('0xd'));var jsforce=require(_0x533c('0xe'));var deskjs=require(_0x533c('0xf'));var toCsv=require(_0x533c('0x9'));var querystring=require(_0x533c('0x10'));var Papa=require(_0x533c('0x11'));var Redis=require(_0x533c('0x12'));var authService=require(_0x533c('0x13'));var qs=require(_0x533c('0x14'));var as=require(_0x533c('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x533c('0x16'))(_0x533c('0x17'));var utils=require(_0x533c('0x18'));var config=require(_0x533c('0x19'));var db=require(_0x533c('0x1a'))['db'];config[_0x533c('0x1b')]=_['defaults'](config[_0x533c('0x1b')],{'host':_0x533c('0x1c'),'port':0x18eb});var socket=require(_0x533c('0x1d'))(new Redis(config[_0x533c('0x1b')]));require(_0x533c('0x1e'))[_0x533c('0x1f')](socket);var jayson=require(_0x533c('0x20'));var client=jayson[_0x533c('0x21')]['http']({'port':0x232b});var client9004=jayson[_0x533c('0x21')][_0x533c('0x22')]({'port':0x232c});function checkPasswordPattern(_0x3f4a5c,_0x3e544f,_0x56dfb7){if(_0x56dfb7){var _0x1031e7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1031e7[_0x533c('0x23')](_0x3e544f)){return _0x3f4a5c;}else{throw new db[(_0x533c('0x24'))][(_0x533c('0x25'))](_0x533c('0x26'));}}else{return _0x3f4a5c;}}function respondWithRpcPromise(_0x4abaa3,_0x1f0a72,_0x35bfd3,_0x1f9f85){return new BPromise(function(_0x12e126,_0x287b9e){var _0x2c41e9=_0x1f9f85||client;return _0x2c41e9[_0x533c('0x27')](_0x4abaa3,_0x35bfd3)[_0x533c('0x28')](function(_0x2f21db){logger[_0x533c('0x29')](_0x533c('0x2a'),_0x1f0a72,_0x533c('0x2b'));logger['debug'](_0x533c('0x2c'),_0x1f0a72,'request\x20sent',JSON['stringify'](_0x2f21db));if(_0x2f21db[_0x533c('0x2d')]){if(_0x2f21db[_0x533c('0x2d')]['code']===0x1f4){logger[_0x533c('0x2d')](_0x533c('0x2a'),_0x1f0a72,_0x2f21db[_0x533c('0x2d')][_0x533c('0x2e')]);return _0x287b9e(_0x2f21db['error'][_0x533c('0x2e')]);}logger[_0x533c('0x2d')](_0x533c('0x2a'),_0x1f0a72,_0x2f21db[_0x533c('0x2d')][_0x533c('0x2e')]);return _0x12e126(_0x2f21db[_0x533c('0x2d')][_0x533c('0x2e')]);}else{logger[_0x533c('0x29')](_0x533c('0x2a'),_0x1f0a72,_0x533c('0x2b'));_0x12e126(_0x2f21db['result'][_0x533c('0x2e')]);}})[_0x533c('0x2f')](function(_0x503c2e){logger[_0x533c('0x2d')]('ChatInteraction,\x20%s,\x20%s',_0x1f0a72,_0x503c2e);_0x287b9e(_0x503c2e);});});}function respondWithStatusCode(_0x21f58d,_0x14d783){_0x14d783=_0x14d783||0xcc;return function(_0x4a0e86){if(_0x4a0e86){return _0x21f58d[_0x533c('0x30')](_0x14d783);}return _0x21f58d[_0x533c('0x31')](_0x14d783)[_0x533c('0x32')]();};}function respondWithResult(_0x212d1b,_0x38d886){_0x38d886=_0x38d886||0xc8;return function(_0x3c559b){if(_0x3c559b){return _0x212d1b[_0x533c('0x31')](_0x38d886)[_0x533c('0x33')](_0x3c559b);}};}function respondWithFilteredResult(_0x73c0,_0x58ae09){return function(_0x370263){if(_0x370263){var _0x591499=_0x370263[_0x533c('0x34')],_0x3290de=_0x58ae09[_0x533c('0x35')],_0x11c5e7=_0x58ae09[_0x533c('0x35')]+_0x58ae09[_0x533c('0x36')],_0x39eda3;if(_0x11c5e7>=_0x591499){_0x11c5e7=_0x591499;_0x39eda3=0xc8;}else{_0x39eda3=0xce;}_0x73c0[_0x533c('0x31')](_0x39eda3);return _0x73c0[_0x533c('0x37')](_0x533c('0x38'),_0x3290de+'-'+_0x11c5e7+'/'+_0x591499)[_0x533c('0x33')](_0x370263);}return null;};}function patchUpdates(_0x3ec4c8){return function(_0x3f7ffc){try{jsonpatch[_0x533c('0x39')](_0x3f7ffc,_0x3ec4c8,!![]);}catch(_0x3803d0){return BPromise['reject'](_0x3803d0);}return _0x3f7ffc[_0x533c('0x3a')]();};}function saveUpdates(_0x182d69,_0x188223){return function(_0x31129f){if(_0x31129f){return _0x31129f['update'](_0x182d69)[_0x533c('0x28')](function(_0x31b4e4){return _0x31b4e4;});}return null;};}function removeEntity(_0x2350fe,_0x40f077){return function(_0x1255b1){if(_0x1255b1){return _0x1255b1['destroy']()['then'](function(){_0x2350fe['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x52a85b,_0xf21fa4){return function(_0x4b6c22){if(!_0x4b6c22){_0x52a85b[_0x533c('0x30')](0x194);}return _0x4b6c22;};}function handleError(_0x55726a,_0x34243d){_0x34243d=_0x34243d||0x1f4;return function(_0x3cd1e6){logger[_0x533c('0x2d')](_0x3cd1e6['stack']);if(_0x3cd1e6[_0x533c('0x3b')]){delete _0x3cd1e6[_0x533c('0x3b')];}_0x55726a[_0x533c('0x31')](_0x34243d)['send'](_0x3cd1e6);};}function getInteractionUsers(_0x160d4b,_0x20b50c){return new BPromise(function(_0x30e5eb,_0x5dfe21){try{if(_0x20b50c[_0x160d4b['id']]){_0x160d4b[_0x533c('0x3c')]=_[_0x533c('0x3d')](_0x20b50c[_0x160d4b['id']],function(_0x2cd02f){return{'id':_0x2cd02f['id'],'fullname':_0x2cd02f[_0x533c('0x3e')]};});}}catch(_0x454dbc){_0x5dfe21(_0x454dbc);}_0x30e5eb(_0x160d4b);});}function getInteractionTags(_0x4154f9,_0x6523bc){return new BPromise(function(_0x2dbd81,_0x40f830){try{if(_0x4154f9[_0x533c('0x3f')]){_0x4154f9[_0x533c('0x40')]=[];_0x4154f9['TagIds'][_0x533c('0x41')](',')[_0x533c('0x42')](function(_0x35d5ec){_0x4154f9[_0x533c('0x40')][_0x533c('0x43')](_0x6523bc[_0x35d5ec]);});}delete _0x4154f9[_0x533c('0x3f')];}catch(_0x5d2bf9){_0x40f830(_0x5d2bf9);}_0x2dbd81(_0x4154f9);});}function updateChatInteraction(_0x88ea5d,_0xd3eaa0,_0x41f5a2){return new BPromise(function(_0x5e462e,_0x1fb236){return getInteractionUsers(_0x88ea5d,_0x41f5a2)[_0x533c('0x28')](function(_0x315e67){return getInteractionTags(_0x315e67,_0xd3eaa0);})[_0x533c('0x28')](function(_0x502a67){_0x5e462e(_0x502a67);})[_0x533c('0x2f')](function(_0x4f5e26){_0x1fb236(_0x4f5e26);});});}exports[_0x533c('0x44')]=function(_0x39034e,_0x55a372){var _0x3f4015={},_0x3f1e47={},_0x115d79={'count':0x0,'rows':[]};var _0x599b7e=_['map'](db['ChatInteraction']['rawAttributes'],function(_0x189615){return{'name':_0x189615['fieldName'],'type':_0x189615[_0x533c('0x45')]['key']};});_0x3f1e47[_0x533c('0x46')]=_['map'](_0x599b7e,_0x533c('0x3b'));_0x3f1e47[_0x533c('0x47')]=_['keys'](_0x39034e[_0x533c('0x47')]);_0x3f1e47[_0x533c('0x48')]=_[_0x533c('0x49')](_0x3f1e47[_0x533c('0x46')],_0x3f1e47[_0x533c('0x47')]);_0x3f4015['attributes']=_[_0x533c('0x49')](_0x3f1e47[_0x533c('0x46')],qs[_0x533c('0x4a')](_0x39034e[_0x533c('0x47')]['fields']));_0x3f4015[_0x533c('0x4b')]=_0x3f4015[_0x533c('0x4b')]['length']?_0x3f4015['attributes']:_0x3f1e47[_0x533c('0x46')];if(!_0x39034e['query'][_0x533c('0x4c')](_0x533c('0x4d'))){_0x3f4015[_0x533c('0x36')]=qs[_0x533c('0x36')](_0x39034e[_0x533c('0x47')][_0x533c('0x36')]);_0x3f4015[_0x533c('0x35')]=qs[_0x533c('0x35')](_0x39034e['query'][_0x533c('0x35')]);}_0x3f4015[_0x533c('0x4e')]=qs[_0x533c('0x4f')](_0x39034e['query'][_0x533c('0x4f')]);_0x3f4015[_0x533c('0x50')]=qs['filters'](_[_0x533c('0x51')](_0x39034e['query'],_0x3f1e47[_0x533c('0x48')]));var _0x2d1f93=[];var _0x3837d6=squel[_0x533c('0x52')]()[_0x533c('0x53')]('id')[_0x533c('0x53')](_0x533c('0x3b'))['field'](_0x533c('0x54'))[_0x533c('0x55')](_0x533c('0x56'));var _0x412bfb=squel[_0x533c('0x52')]()[_0x533c('0x53')](_0x533c('0x57'))['field']('u.fullname')['field']('ui.ChatInteractionId')[_0x533c('0x55')](_0x533c('0x58'),'ui')['left_join'](_0x533c('0x59'),'u',_0x533c('0x5a'));var _0x2f6794=squel['select']()[_0x533c('0x55')]('chat_interactions','i')['left_join'](_0x533c('0x5b'),'c',_0x533c('0x5c'))[_0x533c('0x5d')](_0x533c('0x59'),'o',_0x533c('0x5e'))[_0x533c('0x5d')](_0x533c('0x5f'),'a','a.id\x20=\x20i.ChatWebsiteId')[_0x533c('0x5d')]('chat_messages','me',_0x533c('0x60'))[_0x533c('0x5d')](_0x533c('0x61'),'it',_0x533c('0x62'))[_0x533c('0x5d')](_0x533c('0x56'),'t',_0x533c('0x63'));var _0x1f715c=squel['expr']();var _0x9d321f=[];var _0x43a333=squel[_0x533c('0x64')]();var _0x94063c;if(_0x39034e[_0x533c('0x47')][_0x533c('0x65')]){_0x94063c=as['parseSearch'](_0x39034e[_0x533c('0x47')]['search']);var _0x43383e=_0x94063c[_0x533c('0x66')];for(var _0x15f70=0x0;_0x15f70<_0x94063c[_0x533c('0x67')][_0x533c('0x68')];_0x15f70++){var _0xc683d5=_0x94063c['conditions'][_0x15f70];var _0x591985='i';var _0x1005a6=_[_0x533c('0x69')](_0x599b7e,[_0x533c('0x3b'),_0xc683d5[_0x533c('0x53')]]);if(!_0x1005a6){switch(_0xc683d5['field']){case _0x533c('0x6a'):if(_0xc683d5[_0x533c('0x6b')]==0x1){_0x2f6794[_0x533c('0x6c')]('`'+_0xc683d5[_0x533c('0x53')]+_0x533c('0x6d'));}else{_0x2f6794[_0x533c('0x6c')]('`'+_0xc683d5[_0x533c('0x53')]+_0x533c('0x6e'));}break;case _0x533c('0x6f'):if(_0xc683d5[_0x533c('0x70')]===_0x533c('0x71')){if(_0xc683d5[_0x533c('0x6b')][_0x533c('0x41')]('\x20')[_0x533c('0x68')]>0x1){_0x1f715c[_0x43383e](_0x533c('0x72'),qs[_0x533c('0x73')](_0xc683d5[_0x533c('0x6b')]),null);}else{var _0x5b369b='%'+_0xc683d5[_0x533c('0x6b')]+'%';_0x1f715c[_0x43383e]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x5b369b,_0x5b369b,_0x5b369b);}}else{_0x1005a6=_['find'](_0x599b7e,[_0x533c('0x3b'),_0x533c('0x74')]);_0xc683d5[_0x533c('0x53')]=_0x533c('0x74');_0x4bd014=as[_0x533c('0x75')](_0x591985,_0x1005a6[_0x533c('0x45')],_0xc683d5);_0x1f715c[_0x43383e](_0x4bd014[_0x533c('0x76')],_0x4bd014['value'][_0x533c('0x77')],_0x4bd014[_0x533c('0x6b')]['end']);}break;case _0x533c('0x78'):var _0x1c1b8a=_0xc683d5[_0x533c('0x6b')][_0x533c('0x41')](',')['map'](function(_0x1d4c79){return Number(_0x1d4c79);});_0x1c1b8a[_0x533c('0x42')](function(_0x50223e){_0x43a333['or'](_0x533c('0x79'),'%,'+_0x50223e+',%');});_0x9d321f=_[_0x533c('0x7a')](_0x9d321f,_0x1c1b8a);break;case'User':if(_0xc683d5[_0x533c('0x70')]===_0x533c('0x71')){_0x1f715c[_0x43383e]('CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','%'+_0xc683d5[_0x533c('0x6b')]+'%',null);}else{_0x1005a6=_['find'](_0x599b7e,['name',_0x533c('0x7b')]);_0xc683d5[_0x533c('0x53')]=_0x533c('0x7b');_0x4bd014=as[_0x533c('0x75')](_0x591985,_0x1005a6['type'],_0xc683d5);_0x1f715c[_0x43383e](_0x4bd014[_0x533c('0x76')],_0x4bd014[_0x533c('0x6b')][_0x533c('0x77')],_0x4bd014[_0x533c('0x6b')][_0x533c('0x32')]);}break;case'body':_0x4bd014=as[_0x533c('0x75')]('me',null,_0xc683d5);_0x1f715c[_0x43383e](_0x4bd014['text'],_0x4bd014[_0x533c('0x6b')]['start'],_0x4bd014[_0x533c('0x6b')]['end']);break;}}else{var _0x4bd014=as['buildExpression'](_0x591985,_0x1005a6[_0x533c('0x45')],_0xc683d5);_0x1f715c[_0x43383e](_0x4bd014[_0x533c('0x76')],_0x4bd014[_0x533c('0x6b')]['start'],_0x4bd014[_0x533c('0x6b')][_0x533c('0x32')]);}}}else{var _0x3fbb08=_(_0x39034e[_0x533c('0x47')])[_0x533c('0x7c')]()['map'](function(_0x596cb0){return _[_0x533c('0x7d')](_0x599b7e,[_0x533c('0x3b'),_0x596cb0])?_0x596cb0:undefined;})[_0x533c('0x7e')]()[_0x533c('0x6b')]();if(!_[_0x533c('0x7f')](_0x3fbb08)){_0x3fbb08[_0x533c('0x42')](function(_0x377fac){if(_0x377fac===_0x533c('0x80')){_0x2f6794[_0x533c('0x50')]('i.ChatWebsiteId\x20IN\x20?',[][_0x533c('0x81')](_0x39034e[_0x533c('0x47')][_0x377fac]));}else if(_0x377fac===_0x533c('0x82')){var _0x1be91f=JSON[_0x533c('0x83')](_0x39034e[_0x533c('0x47')][_0x377fac])[_0x533c('0x84')];var _0x49d765=JSON[_0x533c('0x83')](_0x39034e[_0x533c('0x47')][_0x377fac])[_0x533c('0x85')];_0x2f6794[_0x533c('0x50')](_0x533c('0x86'),_0x1be91f,_0x49d765);}else{if(_0x39034e[_0x533c('0x47')][_0x377fac]===_0x533c('0x87')){_0x2f6794[_0x533c('0x50')]('i.'+_0x377fac+_0x533c('0x88'));}else{_0x2f6794['where']('i.'+_0x377fac+_0x533c('0x89'),_0x39034e[_0x533c('0x47')][_0x377fac]);}}});}if(_0x39034e['query']['read']){if(_0x39034e[_0x533c('0x47')]['read']==0x1){_0x2f6794[_0x533c('0x6c')](_0x533c('0x8a'));}else{_0x2f6794[_0x533c('0x6c')](_0x533c('0x8b'));}}if(_0x39034e[_0x533c('0x47')]['tag']){_0x9d321f=_[_0x533c('0x8c')](_0x39034e[_0x533c('0x47')][_0x533c('0x8d')])?_0x39034e[_0x533c('0x47')][_0x533c('0x8d')]:new Array(_0x39034e[_0x533c('0x47')][_0x533c('0x8d')]);_0x9d321f[_0x533c('0x42')](function(_0x15e2e7){_0x43a333['or'](_0x533c('0x79'),'%,'+_0x15e2e7+',%');});}if(_0x39034e[_0x533c('0x47')][_0x533c('0x8e')]){var _0x1a5db5=_0x39034e[_0x533c('0x47')][_0x533c('0x8e')][_0x533c('0x8f')]('\x5c','\x5c\x5c')[_0x533c('0x8f')]('\x27\x27',_0x533c('0x90'));if(qs['isNumeric'](_0x1a5db5)){_0x1f715c['or'](_0x533c('0x91'),_0x1a5db5+'%');}else{_0x1f715c['or'](_0x533c('0x92'),qs[_0x533c('0x73')](_0x1a5db5))['or'](_0x533c('0x93'),_0x1a5db5+'%');}}}_0x2f6794['where'](_0x1f715c);_0x2f6794[_0x533c('0x94')](_0x533c('0x95'));var _0x4d1b98={'type':db[_0x533c('0x24')]['QueryTypes'][_0x533c('0x96')],'raw':!![]};var _0x4be94e=_0x2f6794[_0x533c('0x97')]();_0x4be94e[_0x533c('0x53')](_0x533c('0x95'));_0x4be94e['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0x3f4015[_0x533c('0x4e')]){_0x3f4015['order'][_0x533c('0x42')](function(_0x1a8176){_0x2f6794[_0x533c('0x4e')]('i.'+_0x1a8176[0x0],_0x1a8176[0x1]===_0x533c('0x98')?![]:!![]);});}if(!_['isEmpty'](_0x9d321f)){_0x2f6794['having'](_0x43a333);_0x4be94e[_0x533c('0x50')]('t.id\x20IN\x20?',_0x9d321f);}BPromise[_0x533c('0x99')]()[_0x533c('0x28')](function(){if(!_0x94063c){if(_0x39034e[_0x533c('0x47')]['ChatWebsiteId']||_0x39034e[_0x533c('0x47')]['journey'])return;_0x4be94e[_0x533c('0x50')](_0x533c('0x9a'));_0x2f6794['where'](_0x533c('0x9a'));return;}return _0x39034e[_0x533c('0x9b')][_0x533c('0x9c')]({'attributes':['id'],'raw':!![]})[_0x533c('0x28')](function(_0x1cea69){if(_[_0x533c('0x7f')](_0x1cea69)){_0x4be94e['where'](_0x533c('0x9d'));_0x2f6794[_0x533c('0x50')](_0x533c('0x9d'));}else{_0x4be94e['where'](_0x533c('0x9e'),_['map'](_0x1cea69,'id'));_0x2f6794['where'](_0x533c('0x9e'),_[_0x533c('0x3d')](_0x1cea69,'id'));}});})['then'](function(){db[_0x533c('0x9f')][_0x533c('0x47')](_0x4be94e[_0x533c('0xa0')](),_0x4d1b98)[_0x533c('0x28')](function(_0x1dd861){_0x115d79[_0x533c('0x34')]=_0x1dd861[_0x533c('0x68')];if(_0x115d79[_0x533c('0x34')]===0x0)return[];return db[_0x533c('0x9f')][_0x533c('0x47')](_0x3837d6[_0x533c('0xa0')](),_0x4d1b98)[_0x533c('0x28')](function(_0x368552){_0x2d1f93=_['keyBy'](_0x368552,'id');_0x4d1b98=_[_0x533c('0xa1')](_0x4d1b98,{'model':db[_0x533c('0xa2')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x39034e[_0x533c('0x47')]['fields']){_0x3f4015[_0x533c('0x4b')]['forEach'](function(_0x2c7faf){_0x2f6794[_0x533c('0x53')]('i.'+_0x2c7faf);});}else{_0x2f6794[_0x533c('0x53')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x533c('0x6a'));_0x2f6794[_0x533c('0x53')](_0x533c('0xa3'),'Account.key');_0x2f6794['field'](_0x533c('0xa4'),'Account.mandatoryDisposition');_0x2f6794[_0x533c('0x53')]('i.*');_0x2f6794[_0x533c('0x53')](_0x533c('0xa5'),_0x533c('0xa6'));_0x2f6794['field']('c.lastName',_0x533c('0xa7'));_0x2f6794[_0x533c('0x53')](_0x533c('0xa8'),_0x533c('0xa9'));_0x2f6794[_0x533c('0x53')](_0x533c('0xaa'),_0x533c('0xab'));_0x2f6794[_0x533c('0x53')](_0x533c('0xac'),'Contact.mobile');_0x2f6794[_0x533c('0x53')](_0x533c('0xad'),_0x533c('0xae'));_0x2f6794['field'](_0x533c('0xaf'),_0x533c('0xb0'));_0x2f6794[_0x533c('0x53')](_0x533c('0xb1'),_0x533c('0xb2'));_0x2f6794[_0x533c('0x53')](_0x533c('0xb3'),_0x533c('0x3f'));}_0x2f6794[_0x533c('0x36')](_0x3f4015[_0x533c('0x36')]);_0x2f6794[_0x533c('0x35')](_0x3f4015[_0x533c('0x35')]);return db['sequelize'][_0x533c('0x47')](_0x2f6794['toString'](),_0x4d1b98);})[_0x533c('0x28')](function(_0xd72add){_0x412bfb['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x533c('0x3d')](_0xd72add,'id'));return db['sequelize'][_0x533c('0x47')](_0x412bfb['toString'](),_0x4d1b98)[_0x533c('0x28')](function(_0x5b7280){var _0x3e260d=_[_0x533c('0xb4')](_0x5b7280,_0x533c('0xb5'));var _0x1295c8=[];_0xd72add[_0x533c('0x42')](function(_0x39121b){_0x1295c8[_0x533c('0x43')](updateChatInteraction(_0x39121b,_0x2d1f93,_0x3e260d));});return BPromise[_0x533c('0xb6')](_0x1295c8);});});})['then'](function(_0x1e9a65){_0x115d79[_0x533c('0xb7')]=_0x1e9a65;return _0x115d79;})[_0x533c('0x28')](respondWithFilteredResult(_0x55a372,_0x3f4015));})['catch'](handleError(_0x55a372,null));};exports[_0x533c('0xb8')]=function(_0x59471d,_0x5e6714){var _0x2d4a7c={'raw':![],'where':{'id':_0x59471d[_0x533c('0xb9')]['id']}},_0xdf61b1={};_0xdf61b1['model']=_['keys'](db[_0x533c('0xa2')][_0x533c('0xba')]);_0xdf61b1[_0x533c('0x47')]=_[_0x533c('0x7c')](_0x59471d['query']);_0xdf61b1[_0x533c('0x48')]=_[_0x533c('0x49')](_0xdf61b1[_0x533c('0x46')],_0xdf61b1[_0x533c('0x47')]);_0x2d4a7c['attributes']=_['intersection'](_0xdf61b1['model'],qs[_0x533c('0x4a')](_0x59471d[_0x533c('0x47')]['fields']));_0x2d4a7c[_0x533c('0x4b')]=_0x2d4a7c[_0x533c('0x4b')]['length']?_0x2d4a7c[_0x533c('0x4b')]:_0xdf61b1[_0x533c('0x46')];if(_0x59471d['query']['includeAll']){_0x2d4a7c[_0x533c('0xbb')]=[{'all':!![]}];}_0x2d4a7c=_['merge']({},_0x2d4a7c,_0x59471d['options']);return db[_0x533c('0xa2')][_0x533c('0x69')](_0x2d4a7c)[_0x533c('0x28')](handleEntityNotFound(_0x5e6714,null))[_0x533c('0x28')](respondWithResult(_0x5e6714,null))[_0x533c('0x2f')](handleError(_0x5e6714,null));};exports[_0x533c('0xbc')]=function(_0x514d66,_0x4faf5d){return db[_0x533c('0xa2')][_0x533c('0xbc')](_0x514d66[_0x533c('0xbd')],{})[_0x533c('0x28')](respondWithResult(_0x4faf5d,0xc9))[_0x533c('0x2f')](handleError(_0x4faf5d,null));};exports[_0x533c('0xbe')]=function(_0x20ebaa,_0x2301f4){if(_0x20ebaa[_0x533c('0xbd')]['id']){delete _0x20ebaa['body']['id'];}return db[_0x533c('0xa2')][_0x533c('0x69')]({'where':{'id':_0x20ebaa[_0x533c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x2301f4,null))[_0x533c('0x28')](saveUpdates(_0x20ebaa[_0x533c('0xbd')],null))[_0x533c('0x28')](respondWithResult(_0x2301f4,null))[_0x533c('0x2f')](handleError(_0x2301f4,null));};exports[_0x533c('0xbf')]=function(_0x4ba843,_0x1052dc){return db[_0x533c('0xa2')][_0x533c('0x69')]({'where':{'id':_0x4ba843['params']['id']}})['then'](handleEntityNotFound(_0x1052dc,null))[_0x533c('0x28')](removeEntity(_0x1052dc,null))[_0x533c('0x2f')](handleError(_0x1052dc,null));};exports[_0x533c('0xc0')]=function(_0x5e3be4,_0x31cc52){return db[_0x533c('0xa2')][_0x533c('0xc0')]()[_0x533c('0x28')](respondWithResult(_0x31cc52,null))[_0x533c('0x2f')](handleError(_0x31cc52,null));};exports[_0x533c('0xc1')]=function(_0x1e6d44,_0x5bf5d5){if(_0x1e6d44[_0x533c('0xbd')]['id']){delete _0x1e6d44['body']['id'];}return db['ChatInteraction'][_0x533c('0x69')]({'where':{'id':_0x1e6d44[_0x533c('0xb9')]['id']}})[_0x533c('0x28')](handleEntityNotFound(_0x5bf5d5,null))['then'](saveUpdates(_0x1e6d44[_0x533c('0xbd')],null))['then'](respondWithResult(_0x5bf5d5,null))[_0x533c('0x2f')](handleError(_0x5bf5d5,null));};exports['abandon']=function(_0x542171,_0x5400c9,_0x286baf){if(_0x542171[_0x533c('0xbd')]['id']){delete _0x542171['body']['id'];}return db[_0x533c('0xa2')][_0x533c('0x69')]({'where':{'id':_0x542171[_0x533c('0xb9')]['id']}})[_0x533c('0x28')](function(_0x1615ed){if(!_0x1615ed){logger['error'](_0x533c('0xc2'),_0x533c('0xc3'),0x194,_0x533c('0xc4'));_0x5400c9['sendStatus'](0x194);}else{if(_0x1615ed[_0x533c('0x7b')]){throw new db[(_0x533c('0x24'))]['ValidationError']('Interaction\x20already\x20assigned');}}return _0x1615ed;})[_0x533c('0x28')](function(_0x41545f){if(_0x41545f){return _0x41545f[_0x533c('0xbe')]({'closed':_0x542171[_0x533c('0xbd')]['closed'],'disposition':_0x542171['body']['disposition']})[_0x533c('0x28')](function(_0x25c77e){return _0x25c77e;});}})[_0x533c('0x28')](function(_0x4af774){return respondWithRpcPromise(_0x533c('0xc5'),'abandon',_0x542171['body'],client9004);})[_0x533c('0x28')](respondWithResult(_0x5400c9,null))[_0x533c('0x2f')](handleError(_0x5400c9,null));};exports['attachmentUpload']=function(_0x167fd1,_0x2650f3,_0x23baf9){_0x167fd1[_0x533c('0xbd')][_0x533c('0x3b')]=_0x167fd1[_0x533c('0xc6')][_0x533c('0xc7')];_0x167fd1[_0x533c('0xbd')][_0x533c('0xc8')]=_0x167fd1[_0x533c('0xc6')][_0x533c('0xc9')];_0x167fd1['body']['type']=_0x167fd1[_0x533c('0xc6')][_0x533c('0xca')];return db[_0x533c('0xcb')][_0x533c('0xbc')](_0x167fd1['body'])[_0x533c('0x28')](respondWithResult(_0x2650f3,0xc9))[_0x533c('0x2f')](handleError(_0x2650f3,null));};exports[_0x533c('0xcc')]=function(_0x6501e3,_0x586525,_0x1fe486){return db[_0x533c('0xa2')][_0x533c('0xcd')]({'where':{'id':_0x6501e3[_0x533c('0xb9')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x586525,null))[_0x533c('0x28')](function(_0x1625c6){if(_0x1625c6){if(_0x1625c6[_0x533c('0xce')]){return _0x586525['status'](0x193)[_0x533c('0x33')]({'status':0x193,'message':_0x533c('0xcf')});}return db[_0x533c('0xcb')][_0x533c('0xcd')]({'where':{'id':_0x6501e3[_0x533c('0x47')][_0x533c('0xd0')]},'raw':!![]})['then'](handleEntityNotFound(_0x586525,null));}})[_0x533c('0x28')](function(_0x315df8){if(_0x315df8){return _0x586525[_0x533c('0xd1')](path[_0x533c('0xd2')](config[_0x533c('0xd3')],_0x533c('0xd4'),_0x315df8[_0x533c('0xc8')]));}})[_0x533c('0x2f')](handleError(_0x586525,null));};exports[_0x533c('0xd5')]=function(_0x251686,_0x28f495){var _0x5e6d6c=null;var _0x4d3250=null;var _0x7f7324=null;var _0x50cb20=null;if(_0x251686[_0x533c('0xbd')]['id']){delete _0x251686['body']['id'];}if(_0x251686[_0x533c('0xbd')][_0x533c('0xd6')]){_0x50cb20=path['join'](config[_0x533c('0xd3')],'server/files/chat/upload/',util[_0x533c('0xd7')](_0x533c('0xd8'),Date[_0x533c('0xd9')]()));_0x251686[_0x533c('0xbd')]['pathTranscript']=_0x50cb20;}return db['ChatInteraction'][_0x533c('0x69')]({'where':{'id':_0x251686['params']['id']},'include':[{'model':db[_0x533c('0xda')],'as':_0x533c('0xdb'),'include':[{'model':db[_0x533c('0xdc')],'as':_0x533c('0xdc')}]}]})[_0x533c('0x28')](handleEntityNotFound(_0x28f495,null))['then'](saveUpdates(_0x251686[_0x533c('0xbd')],null))[_0x533c('0x28')](function(_0x2769dc){if(_0x2769dc){_0x5e6d6c=_0x2769dc;return db[_0x533c('0xdd')][_0x533c('0x69')]({'where':{'id':_0x5e6d6c[_0x533c('0x80')]}});}})[_0x533c('0x28')](function(_0xc41744){if(_0xc41744){_0x7f7324=_0xc41744;return db[_0x533c('0xde')][_0x533c('0x69')]({'where':{'id':_0x5e6d6c['ContactId']}});}})['then'](function(_0x2331b6){if(_0x2331b6){_0x4d3250=_0x2331b6;if(_0x50cb20){var _0xba8eaf=null;for(var _0x4852e5=0x1;_0x4852e5<_0x5e6d6c[_0x533c('0xdb')][_0x533c('0x68')];++_0x4852e5){_0xba8eaf=_0x5e6d6c[_0x533c('0xdb')][_0x4852e5];var _0xfded02=_0xba8eaf[_0x533c('0x7b')]?util[_0x533c('0xd7')](_0x533c('0xdf'),_0x7f7324[_0x533c('0xe0')],_0xba8eaf['UserId']):_0x533c('0xe1');var _0x3ab390=_0x251686[_0x533c('0xbd')][_0x533c('0xe2')]||util[_0x533c('0xd7')](_0x533c('0xdf'),_0x533c('0xe3'),_0xba8eaf['ContactId']);switch(_0x7f7324['agentIdentifier']){case _0x533c('0xe4'):_0xfded02=_0xba8eaf[_0x533c('0x7b')]?util[_0x533c('0xd7')]('%s%d',_0x7f7324['agentAlias'],_0xba8eaf[_0x533c('0x7b')]):_0x533c('0xe1');break;case'agent_alias':_0xfded02=_0xba8eaf[_0x533c('0x7b')]?_0xba8eaf[_0x533c('0xdc')]['alias']||_0xba8eaf[_0x533c('0xdc')][_0x533c('0x3e')]:_0x533c('0xe1');break;case _0x533c('0xe5'):_0xfded02=_0xba8eaf[_0x533c('0x7b')]?_0xba8eaf['User']['fullname']:_0x533c('0xe1');break;default:_0xfded02=_0xba8eaf[_0x533c('0x7b')]?util[_0x533c('0xd7')](_0x533c('0xdf'),_0x7f7324[_0x533c('0xe0')],_0xba8eaf['UserId']):_0x533c('0xe1');}var _0x5483f7=util['format'](_0x533c('0xe6'),moment(_0xba8eaf[_0x533c('0x82')])[_0x533c('0xd7')](_0x533c('0xe7')),_0xba8eaf[_0x533c('0xe8')]==='in'?_0x3ab390:_0xfded02,_0xba8eaf[_0x533c('0xbd')]);if(!_0xba8eaf[_0x533c('0xe9')]){fs['appendFileSync'](_0x50cb20,_0x5483f7);}}return db['MailAccount']['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x533c('0xea')],'as':_0x533c('0xeb'),'raw':!![]}]});}}})[_0x533c('0x28')](function(_0x44faf2){if(_0x44faf2&&_0x44faf2[_0x533c('0xeb')]&&_0x251686['body']){var _0x2c73d3={'tls':{'rejectUnauthorized':![]}};if(_0x44faf2['Smtp'][_0x533c('0xec')]){_0x2c73d3[_0x533c('0xec')]=_0x44faf2[_0x533c('0xeb')][_0x533c('0xec')];}else{_0x2c73d3[_0x533c('0xed')]=_0x44faf2[_0x533c('0xeb')]['host'];_0x2c73d3['port']=_0x44faf2[_0x533c('0xeb')]['port'];_0x2c73d3[_0x533c('0xee')]=_0x44faf2['Smtp'][_0x533c('0xee')];}if(_0x44faf2[_0x533c('0xeb')][_0x533c('0xef')]){_0x2c73d3[_0x533c('0xf0')]={'user':_0x44faf2[_0x533c('0xeb')][_0x533c('0x9b')],'pass':_0x44faf2[_0x533c('0xeb')][_0x533c('0xf1')]};}return respondWithRpcPromise(_0x533c('0xf2'),_0x533c('0xf3'),{'account':_0x2c73d3,'message':{'from':util['format']('\x22%s\x22\x20<%s>',_0x44faf2['name'],_0x44faf2[_0x533c('0xf4')]||_0x44faf2[_0x533c('0xeb')]['user']),'to':_0x251686[_0x533c('0xbd')]['mailTranscript'],'subject':_0x533c('0xf5'),'text':util['format']('Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a',_0x251686[_0x533c('0xbd')][_0x533c('0xd6')]),'attachments':[{'path':_0x50cb20}]}})[_0x533c('0x28')](function(){return _0x5e6d6c;})['catch'](function(_0x54351a){console[_0x533c('0x2d')](_0x54351a);});}else{return _0x5e6d6c;}})[_0x533c('0x28')](respondWithStatusCode(_0x28f495,0xc8))[_0x533c('0x2f')](handleError(_0x28f495,null));};exports['addMessage']=function(_0x49d9fb,_0x242897,_0xa33ba3){return db[_0x533c('0xda')][_0x533c('0x69')]({'where':{'id':_0x49d9fb[_0x533c('0xb9')]['id']}})[_0x533c('0x28')](handleEntityNotFound(_0x242897,null))[_0x533c('0x28')](function(_0x213327){if(_0x213327){return _0x213327[_0x533c('0xf6')](_0x49d9fb[_0x533c('0xbd')]['ids'],_['omit'](_0x49d9fb[_0x533c('0xbd')],[_0x533c('0xf7'),'id'])||{});}})['then'](respondWithResult(_0x242897,null))[_0x533c('0x2f')](handleError(_0x242897,null));};exports['getMessages']=function(_0x109300,_0x561ecc,_0x3e3a7f){var _0x5ac1bc={'raw':![],'where':{}};var _0x68c96b={};var _0x35377c={'count':0x0,'rows':[]};return db['ChatInteraction']['findOne']({'where':{'id':_0x109300[_0x533c('0xb9')]['id']}})[_0x533c('0x28')](handleEntityNotFound(_0x561ecc,null))[_0x533c('0x28')](function(_0x3a463f){if(_0x3a463f){_0x68c96b[_0x533c('0x46')]=_['keys'](db[_0x533c('0xda')][_0x533c('0xba')]);_0x68c96b[_0x533c('0x47')]=_[_0x533c('0x7c')](_0x109300[_0x533c('0x47')]);_0x68c96b[_0x533c('0x48')]=_[_0x533c('0x49')](_0x68c96b[_0x533c('0x46')],_0x68c96b['query']);_0x5ac1bc[_0x533c('0x4b')]=_[_0x533c('0x49')](_0x68c96b[_0x533c('0x46')],qs[_0x533c('0x4a')](_0x109300[_0x533c('0x47')][_0x533c('0x4a')]));_0x5ac1bc[_0x533c('0x4b')]=_0x5ac1bc[_0x533c('0x4b')][_0x533c('0x68')]?_0x5ac1bc['attributes']:_0x68c96b['model'];if(!_0x109300[_0x533c('0x47')][_0x533c('0x4c')](_0x533c('0x4d'))){_0x5ac1bc['limit']=qs['limit'](_0x109300['query']['limit']);_0x5ac1bc[_0x533c('0x35')]=qs[_0x533c('0x35')](_0x109300['query'][_0x533c('0x35')]);}_0x5ac1bc[_0x533c('0x4e')]=qs[_0x533c('0x4f')](_0x109300[_0x533c('0x47')][_0x533c('0x4f')]);_0x5ac1bc[_0x533c('0x50')]=qs[_0x533c('0x48')](_['pick'](_0x109300[_0x533c('0x47')],_0x68c96b[_0x533c('0x48')]));_0x5ac1bc['where'][_0x533c('0xb5')]=_0x3a463f['id'];if(_0x109300[_0x533c('0x47')][_0x533c('0x8e')]){_0x5ac1bc[_0x533c('0x50')]=_['merge'](_0x5ac1bc[_0x533c('0x50')],{'$or':_[_0x533c('0x3d')](_0x5ac1bc[_0x533c('0x4b')],function(_0x3d2ac6){var _0x446345={};_0x446345[_0x3d2ac6]={'$like':'%'+_0x109300[_0x533c('0x47')][_0x533c('0x8e')]+'%'};return _0x446345;})});}if(_0x109300[_0x533c('0x47')]['$gte']){var _0x358100=_0x109300['query'][_0x533c('0x84')]['split'](',');var _0x10d8e5={};_0x10d8e5[_0x358100[0x0]]={'$gte':moment(_0x358100[0x1])[_0x533c('0xd7')](_0x533c('0xf8'))};_0x5ac1bc['where']=_[_0x533c('0xa1')](_0x5ac1bc[_0x533c('0x50')],_0x10d8e5);}_0x5ac1bc=_[_0x533c('0xa1')]({},_0x5ac1bc,_0x109300[_0x533c('0xf9')]);return db[_0x533c('0xda')][_0x533c('0x34')]({'where':_0x5ac1bc[_0x533c('0x50')]})[_0x533c('0x28')](function(_0x564c19){_0x35377c[_0x533c('0x34')]=_0x564c19;if(_0x109300[_0x533c('0x47')][_0x533c('0xfa')]){_0x5ac1bc['include']=[{'all':!![]}];}return db[_0x533c('0xda')][_0x533c('0xfb')](_0x5ac1bc);})[_0x533c('0x28')](function(_0x39666b){_0x35377c[_0x533c('0xb7')]=_0x39666b;return _0x35377c;});}})[_0x533c('0x28')](respondWithFilteredResult(_0x561ecc,_0x5ac1bc))[_0x533c('0x2f')](handleError(_0x561ecc,null));};exports[_0x533c('0xfc')]=function(_0x5ee309,_0x32f1df,_0x582368){var _0x5516fc={'where':{}},_0x135725={},_0x3e56c5={'count':0x0,'rows':[]};return db[_0x533c('0xa2')][_0x533c('0xcd')]({'where':{'id':_0x5ee309[_0x533c('0xb9')]['id']}})['then'](handleEntityNotFound(_0x32f1df,null))[_0x533c('0x28')](function(_0x4b92d5){if(_0x4b92d5){_0x135725[_0x533c('0x46')]=_[_0x533c('0x7c')](db[_0x533c('0xda')]['rawAttributes']);_0x135725[_0x533c('0x47')]=_['keys'](_0x5ee309[_0x533c('0x47')]);_0x135725[_0x533c('0x48')]=_[_0x533c('0x49')](_0x135725[_0x533c('0x46')],_0x135725[_0x533c('0x47')]);_0x5516fc[_0x533c('0x4b')]=_[_0x533c('0x49')](_0x135725[_0x533c('0x46')],qs['fields'](_0x5ee309['query'][_0x533c('0x4a')]));_0x5516fc[_0x533c('0x4b')]=_0x5516fc[_0x533c('0x4b')][_0x533c('0x68')]?_0x5516fc[_0x533c('0x4b')]:_0x135725[_0x533c('0x46')];if(!_0x5ee309[_0x533c('0x47')][_0x533c('0x4c')](_0x533c('0x4d'))){_0x5516fc[_0x533c('0x36')]=qs[_0x533c('0x36')](_0x5ee309[_0x533c('0x47')]['limit']);_0x5516fc[_0x533c('0x35')]=qs[_0x533c('0x35')](_0x5ee309[_0x533c('0x47')][_0x533c('0x35')]);}_0x5516fc[_0x533c('0x4e')]=qs[_0x533c('0x4f')](_0x5ee309[_0x533c('0x47')][_0x533c('0x4f')]);_0x5516fc['where']=qs[_0x533c('0x48')](_[_0x533c('0x51')](_0x5ee309[_0x533c('0x47')],_0x135725[_0x533c('0x48')]));_0x5516fc[_0x533c('0x50')][_0x533c('0xb5')]=_0x4b92d5['id'];if(_0x5ee309[_0x533c('0x47')][_0x533c('0x8e')]){_0x5516fc[_0x533c('0x50')]=_[_0x533c('0xa1')](_0x5516fc[_0x533c('0x50')],{'$or':_[_0x533c('0x3d')](_0x5516fc[_0x533c('0x4b')],function(_0x46202d){var _0xde1713={};_0xde1713[_0x46202d]={'$like':'%'+_0x5ee309['query'][_0x533c('0x8e')]+'%'};return _0xde1713;})});}_0x5516fc[_0x533c('0x50')][_0x533c('0xe9')]=![];if(_0x5ee309['query']['id']){_0x5516fc[_0x533c('0x50')]['id']={'$gt':_0x5ee309['query']['id']};}_0x5516fc=_[_0x533c('0xa1')]({},_0x5516fc,_0x5ee309[_0x533c('0xf9')]);return db['ChatMessage'][_0x533c('0x34')]({'where':_0x5516fc[_0x533c('0x50')]})[_0x533c('0x28')](function(_0x26186d){_0x3e56c5['count']=_0x26186d;_0x5516fc['include']=[];if(_0x5ee309[_0x533c('0x47')][_0x533c('0xfd')]){_0x5516fc[_0x533c('0xbb')][_0x533c('0x43')]({'model':db[_0x533c('0xdc')],'as':'User','attributes':['id','fullname',_0x533c('0xfe')]});}if(_0x5ee309[_0x533c('0x47')]['includeAll']){_0x5516fc[_0x533c('0xbb')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x5516fc);})[_0x533c('0x28')](function(_0x34f125){_0x3e56c5['rows']=_0x34f125;return _0x3e56c5;});}})[_0x533c('0x28')](respondWithFilteredResult(_0x32f1df,_0x5516fc))[_0x533c('0x2f')](handleError(_0x32f1df,null));};exports[_0x533c('0xff')]=function(_0x28c634,_0x3e8291,_0x4020d9){return db[_0x533c('0xa2')][_0x533c('0x69')]({'where':{'id':_0x28c634[_0x533c('0xb9')]['id']}})[_0x533c('0x28')](handleEntityNotFound(_0x3e8291,null))[_0x533c('0x28')](function(_0x365c1d){if(_0x365c1d){return _0x365c1d[_0x533c('0x100')](_0x28c634['body'][_0x533c('0xf7')],_['omit'](_0x28c634[_0x533c('0xbd')],['ids','id'])||{})[_0x533c('0x101')](function(){return db['Tag']['findAll']({'attributes':['id',_0x533c('0x3b'),'color'],'where':{'id':_0x28c634['body'][_0x533c('0xf7')]}});})[_0x533c('0x28')](function(_0x4f91fb){socket[_0x533c('0x102')]('chatInteractionTags:save',{'id':Number(_0x28c634[_0x533c('0xb9')]['id']),'tags':_0x4f91fb||[]});return{'id':Number(_0x28c634[_0x533c('0xb9')]['id']),'tags':_0x4f91fb||[]};});}})[_0x533c('0x28')](respondWithResult(_0x3e8291,null))[_0x533c('0x2f')](handleError(_0x3e8291,null));};exports[_0x533c('0x103')]=function(_0x3daed2,_0x13c39d,_0x433976){return db[_0x533c('0xa2')]['find']({'where':{'id':_0x3daed2['params']['id']}})['then'](handleEntityNotFound(_0x13c39d,null))[_0x533c('0x28')](function(_0x1b3ee2){if(_0x1b3ee2){return _0x1b3ee2[_0x533c('0x103')](_0x3daed2[_0x533c('0x47')][_0x533c('0xf7')]);}})[_0x533c('0x28')](respondWithStatusCode(_0x13c39d,null))[_0x533c('0x2f')](handleError(_0x13c39d,null));};exports[_0x533c('0xd1')]=function(_0x2015e3,_0x1e5c74){var _0x56035f=moment()[_0x533c('0x104')]()[_0x533c('0xa0')]();var _0x57c83e=path[_0x533c('0xd2')](config['root'],_0x533c('0x105'),_0x533c('0x106'),_0x533c('0x107'));var _0x269297=path[_0x533c('0xd2')](config['root'],'server',_0x533c('0x106'),_0x533c('0x108'));var _0x2e3df4=path[_0x533c('0xd2')](_0x57c83e,_0x56035f);var _0x317f21=util['format'](_0x533c('0x109'),_0x2015e3[_0x533c('0xb9')]['id'],_0x56035f);var _0x12312a=path[_0x533c('0xd2')](_0x57c83e,_0x317f21);var _0x34b3ba=[];_0x34b3ba[_0x533c('0x43')]({'model':db['User'],'as':_0x533c('0xdc'),'attributes':['id',_0x533c('0x3e')],'raw':!![]});_0x34b3ba[_0x533c('0x43')]({'model':db[_0x533c('0xde')],'as':'Contact','attributes':['id',_0x533c('0x10a'),_0x533c('0x10b')],'raw':!![]});if(_0x2015e3['query'][_0x533c('0x108')]){_0x34b3ba['push']({'model':db[_0x533c('0xcb')],'as':'Attachment','raw':!![]});}var _0x132414=[{'model':db['ChatMessage'],'as':_0x533c('0xdb'),'attributes':['id','body',_0x533c('0x82'),_0x533c('0xe8'),_0x533c('0xe9'),_0x533c('0x10c')],'include':_0x34b3ba}];_0x132414[_0x533c('0x43')]({'model':db[_0x533c('0xdd')],'as':_0x533c('0x10d'),'attributes':['id',_0x533c('0x3b')]});_0x132414[_0x533c('0x43')]({'model':db[_0x533c('0xdc')],'as':_0x533c('0x10e'),'attributes':['id',_0x533c('0x3e')]});return db[_0x533c('0xa2')][_0x533c('0x69')]({'where':{'id':_0x2015e3[_0x533c('0xb9')]['id']},'include':_0x132414})['then'](handleEntityNotFound(_0x1e5c74,null))[_0x533c('0x28')](function(_0x1e4da5){if(_0x1e4da5){var _0x14b970=_0x1e4da5[_0x533c('0x10f')]({'plain':!![]});fs['mkdirSync'](_0x2e3df4);var _0x33f610={'format':'A4','border':_0x533c('0x110'),'header':{'height':_0x533c('0x111'),'contents':{'first':'\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x533c('0x112'),'contents':{'default':util[_0x533c('0xd7')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util['format'](_0x533c('0x113'),_0x533c('0x114'),_0x14b970['id']),moment()[_0x533c('0xd7')](_0x533c('0x115'))[_0x533c('0xa0')]())}}};var _0x40675a={'channel':'Chat','account':_0x14b970[_0x533c('0x10d')][_0x533c('0x3b')],'agent':_0x14b970['Owner']?_0x14b970[_0x533c('0x10e')][_0x533c('0x3e')]:_0x533c('0x116'),'createdAt':moment(_0x14b970[_0x533c('0x82')])['format'](_0x533c('0xf8'))[_0x533c('0xa0')](),'closedAt':_0x14b970['closed']?moment(_0x14b970[_0x533c('0x117')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x533c('0xa0')]():'','disposition':_0x14b970['disposition'],'chatInfo':{'browser':_0x14b970[_0x533c('0x118')],'os':_0x14b970[_0x533c('0x119')],'referer':_0x14b970[_0x533c('0x11a')],'customerIp':_0x14b970[_0x533c('0x11b')],'customerPort':_0x14b970['customerPort']?_0x14b970[_0x533c('0x11c')]:_0x533c('0x116')},'messages':_(_0x14b970[_0x533c('0xdb')])['tail']()['filter']({'secret':![]})[_0x533c('0x3d')](function(_0x169965){if(_0x169965[_0x533c('0xcb')]){var _0x3d17ce=path[_0x533c('0xd2')](_0x269297,_0x169965[_0x533c('0xcb')][_0x533c('0xc8')]);if(fs[_0x533c('0x11d')](_0x3d17ce)){fs[_0x533c('0x11e')](_0x3d17ce)[_0x533c('0x11f')](fs[_0x533c('0x120')](path['join'](_0x2e3df4,_0x169965[_0x533c('0xcb')][_0x533c('0xc8')])));}}return{'date':moment(_0x169965[_0x533c('0x82')])[_0x533c('0xd7')]('YYYY-MM-DD\x20HH:mm:ss')[_0x533c('0xa0')](),'sender':_0x169965[_0x533c('0xe8')]==='out'?_0x169965[_0x533c('0xdc')]?_0x169965[_0x533c('0xdc')][_0x533c('0x3e')]:_0x533c('0xe1'):_0x169965[_0x533c('0x6f')][_0x533c('0x10a')]+(_0x169965[_0x533c('0x6f')][_0x533c('0x10b')]?'\x20'+_0x169965[_0x533c('0x6f')][_0x533c('0x10b')]:''),'body':_0x169965[_0x533c('0xcb')]?_0x169965[_0x533c('0xcb')]['basename']:_0x169965[_0x533c('0xbd')],'direction':_0x169965[_0x533c('0xe8')]===_0x533c('0x121')?'A':'C','secret':_0x169965['secret'],'read':_0x169965[_0x533c('0x10c')],'attachment':_0x169965[_0x533c('0xcb')]};})['value']()};return ejs['renderFile'](path[_0x533c('0xd2')](config[_0x533c('0xd3')],'server',_0x533c('0x122'),'downloadInteraction.html'),{'interaction':_0x40675a})['then'](function(_0x1342aa){return new BPromise(function(_0x16b6e7,_0x30b446){pdf[_0x533c('0xbc')](_0x1342aa,_0x33f610)[_0x533c('0x123')](path[_0x533c('0xd2')](_0x2e3df4,'transcript-'+_0x14b970['id']+'-'+_0x56035f+_0x533c('0x124')),function(_0xa80eff,_0x4da7dd){if(_0xa80eff)return _0x30b446(_0xa80eff);_0x16b6e7(_0x4da7dd);});});})[_0x533c('0x28')](function(){return new BPromise(function(_0x11827d,_0x5f40be){zipdir(_0x2e3df4,{'saveTo':_0x12312a},function(_0x54fe59,_0x3c51db){if(_0x54fe59)return _0x5f40be(_0x54fe59);return _0x11827d(_0x3c51db);});})[_0x533c('0x28')](function(){return new BPromise(function(_0x1ca5b1,_0x32f2a5){rimraf(_0x2e3df4,function(_0x59e2cc){if(_0x59e2cc)_0x32f2a5(_0x59e2cc);return _0x1ca5b1();});});})[_0x533c('0x28')](function(){return _0x1e5c74['download'](_0x12312a,_0x317f21,function(_0x1b82a4){if(_0x1b82a4){console[_0x533c('0x125')](_0x533c('0x126'),_0x1b82a4);}else{fs[_0x533c('0x127')](_0x12312a);}});});});}else{return _0x1e5c74[_0x533c('0x30')](0xc8);}})['catch'](handleError(_0x1e5c74,null));}; \ No newline at end of file +var _0x3c6c=['push','all','rows','params','intersection','includeAll','options','ChatInteraction','create','destroy','describe','customUpdate','abandonInteraction,\x20%s,\x20%s,\x20%s','abandon','UserId','closed','disposition','AbandonInteraction','attachmentUpload','originalname','basename','file','filename','attachmentDownload','findOne','Attachment','download','join','root','server/files/attachments/','close','mailTranscript','server/files/chat/upload/','transcript-%s.txt','now','pathTranscript','User','ChatWebsite','Messages','format','%s%d','customer','Visitor','website_alias','agentAlias','System','agent_alias','alias','agent_fullname','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ChatMessage','omit','include','findAll','getMyMessages','pick','includeAgent','setTags','ids','spread','emit','chatInteractionTags:save','removeTags','unix','tmp','files','transcript-%d-%s.zip','CmContact','Contact','lastName','attachments','Account','Owner','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','referer','customerIp','customerPort','existsSync','createReadStream','createWriteStream','out','firstName','renderFile','server','views','downloadInteraction.html','toFile','transcript-','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','name','send','Users','map','fullname','TagIds','Tags','split','forEach','catch','rawAttributes','fieldName','type','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','select','field','color','from','tools_tags','u.id','ui.ChatInteractionId','left_join','users','u.id\x20=\x20ui.UserId','chat_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','chat_websites','a.id\x20=\x20i.ChatWebsiteId','chat_messages','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','text','body','some','compact','isEmpty','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','concat','$gte','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','journey','i.ChatWebsiteId\x20IS\x20NOT\x20NULL','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email','c.phone','c.mobile','Contact.mobile','Contact.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId'];(function(_0x11ffbd,_0x2d443b){var _0x30a20d=function(_0x2ac53e){while(--_0x2ac53e){_0x11ffbd['push'](_0x11ffbd['shift']());}};_0x30a20d(++_0x2d443b);}(_0x3c6c,0x7b));var _0xc3c6=function(_0x4e3496,_0x4f0426){_0x4e3496=_0x4e3496-0x0;var _0x37bb44=_0x3c6c[_0x4e3496];return _0x37bb44;};'use strict';var pdf=require(_0xc3c6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc3c6('0x1'));var zipdir=require(_0xc3c6('0x2'));var jsonpatch=require(_0xc3c6('0x3'));var rp=require(_0xc3c6('0x4'));var moment=require(_0xc3c6('0x5'));var BPromise=require(_0xc3c6('0x6'));var Mustache=require(_0xc3c6('0x7'));var util=require(_0xc3c6('0x8'));var path=require('path');var sox=require(_0xc3c6('0x9'));var csv=require('to-csv');var ejs=require(_0xc3c6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xc3c6('0xb'));var querystring=require(_0xc3c6('0xc'));var Papa=require('papaparse');var Redis=require(_0xc3c6('0xd'));var authService=require(_0xc3c6('0xe'));var qs=require(_0xc3c6('0xf'));var as=require(_0xc3c6('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xc3c6('0x11'))(_0xc3c6('0x12'));var utils=require(_0xc3c6('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xc3c6('0x14')]=_[_0xc3c6('0x15')](config[_0xc3c6('0x14')],{'host':_0xc3c6('0x16'),'port':0x18eb});var socket=require(_0xc3c6('0x17'))(new Redis(config[_0xc3c6('0x14')]));require(_0xc3c6('0x18'))[_0xc3c6('0x19')](socket);var jayson=require(_0xc3c6('0x1a'));var client=jayson[_0xc3c6('0x1b')][_0xc3c6('0x1c')]({'port':0x232b});var client9004=jayson[_0xc3c6('0x1b')][_0xc3c6('0x1c')]({'port':0x232c});function checkPasswordPattern(_0x25d2bd,_0x283506,_0x42c631){if(_0x42c631){var _0x32c52f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32c52f[_0xc3c6('0x1d')](_0x283506)){return _0x25d2bd;}else{throw new db[(_0xc3c6('0x1e'))][(_0xc3c6('0x1f'))](_0xc3c6('0x20'));}}else{return _0x25d2bd;}}function respondWithRpcPromise(_0x15ebec,_0x26c9b0,_0x11df9a,_0x3003e1){return new BPromise(function(_0x470592,_0x50a39c){var _0x23cd62=_0x3003e1||client;return _0x23cd62[_0xc3c6('0x21')](_0x15ebec,_0x11df9a)[_0xc3c6('0x22')](function(_0x248bfe){logger[_0xc3c6('0x23')](_0xc3c6('0x24'),_0x26c9b0,_0xc3c6('0x25'));logger[_0xc3c6('0x26')](_0xc3c6('0x27'),_0x26c9b0,_0xc3c6('0x25'),JSON[_0xc3c6('0x28')](_0x248bfe));if(_0x248bfe[_0xc3c6('0x29')]){if(_0x248bfe[_0xc3c6('0x29')][_0xc3c6('0x2a')]===0x1f4){logger[_0xc3c6('0x29')](_0xc3c6('0x24'),_0x26c9b0,_0x248bfe['error'][_0xc3c6('0x2b')]);return _0x50a39c(_0x248bfe[_0xc3c6('0x29')][_0xc3c6('0x2b')]);}logger['error'](_0xc3c6('0x24'),_0x26c9b0,_0x248bfe[_0xc3c6('0x29')][_0xc3c6('0x2b')]);return _0x470592(_0x248bfe[_0xc3c6('0x29')][_0xc3c6('0x2b')]);}else{logger[_0xc3c6('0x23')](_0xc3c6('0x24'),_0x26c9b0,'request\x20sent');_0x470592(_0x248bfe[_0xc3c6('0x2c')][_0xc3c6('0x2b')]);}})['catch'](function(_0x24c417){logger[_0xc3c6('0x29')](_0xc3c6('0x24'),_0x26c9b0,_0x24c417);_0x50a39c(_0x24c417);});});}function respondWithStatusCode(_0xdad009,_0x312539){_0x312539=_0x312539||0xcc;return function(_0x420723){if(_0x420723){return _0xdad009[_0xc3c6('0x2d')](_0x312539);}return _0xdad009[_0xc3c6('0x2e')](_0x312539)[_0xc3c6('0x2f')]();};}function respondWithResult(_0x478a4b,_0xb047b1){_0xb047b1=_0xb047b1||0xc8;return function(_0x4571f4){if(_0x4571f4){return _0x478a4b[_0xc3c6('0x2e')](_0xb047b1)[_0xc3c6('0x30')](_0x4571f4);}};}function respondWithFilteredResult(_0x57b1da,_0x1983f2){return function(_0x1bcc34){if(_0x1bcc34){var _0x223d34=_0x1bcc34['count'],_0x75066f=_0x1983f2[_0xc3c6('0x31')],_0x3189dd=_0x1983f2[_0xc3c6('0x31')]+_0x1983f2[_0xc3c6('0x32')],_0x354797;if(_0x3189dd>=_0x223d34){_0x3189dd=_0x223d34;_0x354797=0xc8;}else{_0x354797=0xce;}_0x57b1da[_0xc3c6('0x2e')](_0x354797);return _0x57b1da[_0xc3c6('0x33')]('Content-Range',_0x75066f+'-'+_0x3189dd+'/'+_0x223d34)[_0xc3c6('0x30')](_0x1bcc34);}return null;};}function patchUpdates(_0x3f8917){return function(_0x418071){try{jsonpatch[_0xc3c6('0x34')](_0x418071,_0x3f8917,!![]);}catch(_0x3dd849){return BPromise[_0xc3c6('0x35')](_0x3dd849);}return _0x418071[_0xc3c6('0x36')]();};}function saveUpdates(_0x53b4c6,_0xb64fca){return function(_0x4df203){if(_0x4df203){return _0x4df203[_0xc3c6('0x37')](_0x53b4c6)[_0xc3c6('0x22')](function(_0x41e9a8){return _0x41e9a8;});}return null;};}function removeEntity(_0x17a0f8,_0x1c96d0){return function(_0x1b8e52){if(_0x1b8e52){return _0x1b8e52['destroy']()[_0xc3c6('0x22')](function(){_0x17a0f8[_0xc3c6('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x417af3,_0x976ed4){return function(_0x139944){if(!_0x139944){_0x417af3[_0xc3c6('0x2d')](0x194);}return _0x139944;};}function handleError(_0x4140df,_0x377a2f){_0x377a2f=_0x377a2f||0x1f4;return function(_0x21163c){logger['error'](_0x21163c['stack']);if(_0x21163c[_0xc3c6('0x38')]){delete _0x21163c[_0xc3c6('0x38')];}_0x4140df[_0xc3c6('0x2e')](_0x377a2f)[_0xc3c6('0x39')](_0x21163c);};}function getInteractionUsers(_0x523771,_0x5cbbe3){return new BPromise(function(_0x25c8ee,_0x47623c){try{if(_0x5cbbe3[_0x523771['id']]){_0x523771[_0xc3c6('0x3a')]=_[_0xc3c6('0x3b')](_0x5cbbe3[_0x523771['id']],function(_0x1eb423){return{'id':_0x1eb423['id'],'fullname':_0x1eb423[_0xc3c6('0x3c')]};});}}catch(_0x2b69fd){_0x47623c(_0x2b69fd);}_0x25c8ee(_0x523771);});}function getInteractionTags(_0xada6f,_0x1cb060){return new BPromise(function(_0x52ef62,_0x26d92e){try{if(_0xada6f[_0xc3c6('0x3d')]){_0xada6f[_0xc3c6('0x3e')]=[];_0xada6f[_0xc3c6('0x3d')][_0xc3c6('0x3f')](',')[_0xc3c6('0x40')](function(_0x3e839e){_0xada6f[_0xc3c6('0x3e')]['push'](_0x1cb060[_0x3e839e]);});}delete _0xada6f[_0xc3c6('0x3d')];}catch(_0x242e2b){_0x26d92e(_0x242e2b);}_0x52ef62(_0xada6f);});}function updateChatInteraction(_0x58cba4,_0x2afdd2,_0x5ea389){return new BPromise(function(_0x2d5d8b,_0x298a7a){return getInteractionUsers(_0x58cba4,_0x5ea389)[_0xc3c6('0x22')](function(_0x1bc4fa){return getInteractionTags(_0x1bc4fa,_0x2afdd2);})[_0xc3c6('0x22')](function(_0x21f736){_0x2d5d8b(_0x21f736);})[_0xc3c6('0x41')](function(_0x998388){_0x298a7a(_0x998388);});});}exports['index']=function(_0xda8652,_0x570d11){var _0x32b5a0={},_0x6f81d1={},_0x33d6df={'count':0x0,'rows':[]};var _0x373c3f=_['map'](db['ChatInteraction'][_0xc3c6('0x42')],function(_0xf816a0){return{'name':_0xf816a0[_0xc3c6('0x43')],'type':_0xf816a0[_0xc3c6('0x44')]['key']};});_0x6f81d1[_0xc3c6('0x45')]=_[_0xc3c6('0x3b')](_0x373c3f,_0xc3c6('0x38'));_0x6f81d1[_0xc3c6('0x46')]=_[_0xc3c6('0x47')](_0xda8652[_0xc3c6('0x46')]);_0x6f81d1[_0xc3c6('0x48')]=_['intersection'](_0x6f81d1['model'],_0x6f81d1[_0xc3c6('0x46')]);_0x32b5a0[_0xc3c6('0x49')]=_['intersection'](_0x6f81d1[_0xc3c6('0x45')],qs[_0xc3c6('0x4a')](_0xda8652['query'][_0xc3c6('0x4a')]));_0x32b5a0[_0xc3c6('0x49')]=_0x32b5a0['attributes'][_0xc3c6('0x4b')]?_0x32b5a0[_0xc3c6('0x49')]:_0x6f81d1[_0xc3c6('0x45')];if(!_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x4c')](_0xc3c6('0x4d'))){_0x32b5a0[_0xc3c6('0x32')]=qs[_0xc3c6('0x32')](_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x32')]);_0x32b5a0[_0xc3c6('0x31')]=qs[_0xc3c6('0x31')](_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x31')]);}_0x32b5a0['order']=qs['sort'](_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x4e')]);_0x32b5a0[_0xc3c6('0x4f')]=qs[_0xc3c6('0x48')](_['pick'](_0xda8652['query'],_0x6f81d1[_0xc3c6('0x48')]));var _0x467c48=[];var _0x317cc7=squel[_0xc3c6('0x50')]()[_0xc3c6('0x51')]('id')[_0xc3c6('0x51')](_0xc3c6('0x38'))[_0xc3c6('0x51')](_0xc3c6('0x52'))[_0xc3c6('0x53')](_0xc3c6('0x54'));var _0x1a8938=squel[_0xc3c6('0x50')]()[_0xc3c6('0x51')](_0xc3c6('0x55'))[_0xc3c6('0x51')]('u.fullname')[_0xc3c6('0x51')](_0xc3c6('0x56'))['from']('user_has_chat_interactions','ui')[_0xc3c6('0x57')](_0xc3c6('0x58'),'u',_0xc3c6('0x59'));var _0x223c81=squel[_0xc3c6('0x50')]()[_0xc3c6('0x53')](_0xc3c6('0x5a'),'i')['left_join']('cm_contacts','c',_0xc3c6('0x5b'))[_0xc3c6('0x57')](_0xc3c6('0x58'),'o',_0xc3c6('0x5c'))[_0xc3c6('0x57')](_0xc3c6('0x5d'),'a',_0xc3c6('0x5e'))[_0xc3c6('0x57')](_0xc3c6('0x5f'),'me','me.ChatInteractionId\x20=\x20i.id')[_0xc3c6('0x57')]('chat_interaction_has_tags','it','it.ChatInteractionId\x20=\x20i.id')[_0xc3c6('0x57')](_0xc3c6('0x54'),'t',_0xc3c6('0x60'));var _0x3b0d2d=squel[_0xc3c6('0x61')]();var _0x185cf9=[];var _0x330cfc=squel[_0xc3c6('0x61')]();var _0x2e367f;if(_0xda8652[_0xc3c6('0x46')]['search']){_0x2e367f=as[_0xc3c6('0x62')](_0xda8652['query'][_0xc3c6('0x63')]);var _0x5c8884=_0x2e367f[_0xc3c6('0x64')];for(var _0x4ecb72=0x0;_0x4ecb72<_0x2e367f[_0xc3c6('0x65')]['length'];_0x4ecb72++){var _0x5bf4b2=_0x2e367f['conditions'][_0x4ecb72];var _0x1196d2='i';var _0x44051c=_[_0xc3c6('0x66')](_0x373c3f,[_0xc3c6('0x38'),_0x5bf4b2[_0xc3c6('0x51')]]);if(!_0x44051c){switch(_0x5bf4b2[_0xc3c6('0x51')]){case _0xc3c6('0x67'):if(_0x5bf4b2[_0xc3c6('0x68')]==0x1){_0x223c81[_0xc3c6('0x69')]('`'+_0x5bf4b2[_0xc3c6('0x51')]+_0xc3c6('0x6a'));}else{_0x223c81[_0xc3c6('0x69')]('`'+_0x5bf4b2[_0xc3c6('0x51')]+'`\x20>\x200');}break;case'Contact':if(_0x5bf4b2[_0xc3c6('0x6b')]===_0xc3c6('0x6c')){if(_0x5bf4b2[_0xc3c6('0x68')][_0xc3c6('0x3f')]('\x20')[_0xc3c6('0x4b')]>0x1){_0x3b0d2d[_0x5c8884](_0xc3c6('0x6d'),qs[_0xc3c6('0x6e')](_0x5bf4b2['value']),null);}else{var _0x25e791='%'+_0x5bf4b2['value']+'%';_0x3b0d2d[_0x5c8884](_0xc3c6('0x6f'),_0x25e791,_0x25e791,_0x25e791);}}else{_0x44051c=_['find'](_0x373c3f,[_0xc3c6('0x38'),_0xc3c6('0x70')]);_0x5bf4b2['field']=_0xc3c6('0x70');_0x452821=as[_0xc3c6('0x71')](_0x1196d2,_0x44051c[_0xc3c6('0x44')],_0x5bf4b2);_0x3b0d2d[_0x5c8884](_0x452821['text'],_0x452821[_0xc3c6('0x68')][_0xc3c6('0x72')],_0x452821[_0xc3c6('0x68')][_0xc3c6('0x2f')]);}break;case _0xc3c6('0x73'):var _0x49e23f=_0x5bf4b2['value'][_0xc3c6('0x3f')](',')['map'](function(_0xdb1bde){return Number(_0xdb1bde);});_0x49e23f[_0xc3c6('0x40')](function(_0x525b32){_0x330cfc['or'](_0xc3c6('0x74'),'%,'+_0x525b32+',%');});_0x185cf9=_[_0xc3c6('0x75')](_0x185cf9,_0x49e23f);break;case'User':if(_0x5bf4b2['operator']===_0xc3c6('0x6c')){_0x3b0d2d[_0x5c8884](_0xc3c6('0x76'),'%'+_0x5bf4b2[_0xc3c6('0x68')]+'%',null);}else{_0x44051c=_['find'](_0x373c3f,[_0xc3c6('0x38'),'UserId']);_0x5bf4b2[_0xc3c6('0x51')]='UserId';_0x452821=as['buildExpression'](_0x1196d2,_0x44051c['type'],_0x5bf4b2);_0x3b0d2d[_0x5c8884](_0x452821[_0xc3c6('0x77')],_0x452821['value'][_0xc3c6('0x72')],_0x452821[_0xc3c6('0x68')][_0xc3c6('0x2f')]);}break;case _0xc3c6('0x78'):_0x452821=as['buildExpression']('me',null,_0x5bf4b2);_0x3b0d2d[_0x5c8884](_0x452821['text'],_0x452821['value']['start'],_0x452821[_0xc3c6('0x68')][_0xc3c6('0x2f')]);break;}}else{var _0x452821=as['buildExpression'](_0x1196d2,_0x44051c[_0xc3c6('0x44')],_0x5bf4b2);_0x3b0d2d[_0x5c8884](_0x452821[_0xc3c6('0x77')],_0x452821[_0xc3c6('0x68')][_0xc3c6('0x72')],_0x452821['value']['end']);}}}else{var _0x417c25=_(_0xda8652[_0xc3c6('0x46')])[_0xc3c6('0x47')]()[_0xc3c6('0x3b')](function(_0x434da){return _[_0xc3c6('0x79')](_0x373c3f,[_0xc3c6('0x38'),_0x434da])?_0x434da:undefined;})[_0xc3c6('0x7a')]()[_0xc3c6('0x68')]();if(!_[_0xc3c6('0x7b')](_0x417c25)){_0x417c25[_0xc3c6('0x40')](function(_0x195849){if(_0x195849===_0xc3c6('0x7c')){_0x223c81[_0xc3c6('0x4f')](_0xc3c6('0x7d'),[][_0xc3c6('0x7e')](_0xda8652[_0xc3c6('0x46')][_0x195849]));}else if(_0x195849==='createdAt'){var _0x15c77c=JSON['parse'](_0xda8652[_0xc3c6('0x46')][_0x195849])[_0xc3c6('0x7f')];var _0x53049c=JSON[_0xc3c6('0x80')](_0xda8652[_0xc3c6('0x46')][_0x195849])[_0xc3c6('0x81')];_0x223c81[_0xc3c6('0x4f')](_0xc3c6('0x82'),_0x15c77c,_0x53049c);}else{if(_0xda8652[_0xc3c6('0x46')][_0x195849]===_0xc3c6('0x83')){_0x223c81[_0xc3c6('0x4f')]('i.'+_0x195849+_0xc3c6('0x84'));}else{_0x223c81[_0xc3c6('0x4f')]('i.'+_0x195849+_0xc3c6('0x85'),_0xda8652[_0xc3c6('0x46')][_0x195849]);}}});}if(_0xda8652['query'][_0xc3c6('0x86')]){if(_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x86')]==0x1){_0x223c81[_0xc3c6('0x69')](_0xc3c6('0x87'));}else{_0x223c81[_0xc3c6('0x69')](_0xc3c6('0x88'));}}if(_0xda8652['query'][_0xc3c6('0x89')]){_0x185cf9=_[_0xc3c6('0x8a')](_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x89')])?_0xda8652[_0xc3c6('0x46')]['tag']:new Array(_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x89')]);_0x185cf9['forEach'](function(_0x37e862){_0x330cfc['or'](_0xc3c6('0x74'),'%,'+_0x37e862+',%');});}if(_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x8b')]){var _0x2d7d06=_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x8b')][_0xc3c6('0x8c')]('\x5c','\x5c\x5c')[_0xc3c6('0x8c')]('\x27\x27',_0xc3c6('0x8d'));if(qs[_0xc3c6('0x8e')](_0x2d7d06)){_0x3b0d2d['or'](_0xc3c6('0x8f'),_0x2d7d06+'%');}else{_0x3b0d2d['or'](_0xc3c6('0x90'),qs['getFullTextValue'](_0x2d7d06))['or'](_0xc3c6('0x91'),_0x2d7d06+'%');}}}_0x223c81[_0xc3c6('0x4f')](_0x3b0d2d);_0x223c81[_0xc3c6('0x92')](_0xc3c6('0x93'));var _0x2df151={'type':db[_0xc3c6('0x1e')][_0xc3c6('0x94')][_0xc3c6('0x95')],'raw':!![]};var _0x5360e4=_0x223c81[_0xc3c6('0x96')]();_0x5360e4[_0xc3c6('0x51')](_0xc3c6('0x93'));_0x5360e4[_0xc3c6('0x51')](_0xc3c6('0x97'),_0xc3c6('0x67'));if(_0x32b5a0['order']){_0x32b5a0[_0xc3c6('0x98')][_0xc3c6('0x40')](function(_0xc26349){_0x223c81[_0xc3c6('0x98')]('i.'+_0xc26349[0x0],_0xc26349[0x1]===_0xc3c6('0x99')?![]:!![]);});}if(!_[_0xc3c6('0x7b')](_0x185cf9)){_0x223c81['having'](_0x330cfc);_0x5360e4['where'](_0xc3c6('0x9a'),_0x185cf9);}BPromise['resolve']()[_0xc3c6('0x22')](function(){if(!_0x2e367f){if(_0xda8652['query'][_0xc3c6('0x7c')]||_0xda8652['query'][_0xc3c6('0x9b')])return;_0x5360e4[_0xc3c6('0x4f')](_0xc3c6('0x9c'));_0x223c81[_0xc3c6('0x4f')]('i.ChatWebsiteId\x20IS\x20NOT\x20NULL');return;}return _0xda8652['user'][_0xc3c6('0x9d')]({'attributes':['id'],'raw':!![]})['then'](function(_0x55321e){if(_['isEmpty'](_0x55321e)){_0x5360e4['where'](_0xc3c6('0x9e'));_0x223c81[_0xc3c6('0x4f')]('i.ChatWebsiteId\x20IS\x20NULL');}else{_0x5360e4['where'](_0xc3c6('0x7d'),_[_0xc3c6('0x3b')](_0x55321e,'id'));_0x223c81['where'](_0xc3c6('0x7d'),_[_0xc3c6('0x3b')](_0x55321e,'id'));}});})['then'](function(){db[_0xc3c6('0x9f')][_0xc3c6('0x46')](_0x5360e4[_0xc3c6('0xa0')](),_0x2df151)['then'](function(_0x28e80b){_0x33d6df[_0xc3c6('0xa1')]=_0x28e80b[_0xc3c6('0x4b')];if(_0x33d6df[_0xc3c6('0xa1')]===0x0)return[];return db[_0xc3c6('0x9f')][_0xc3c6('0x46')](_0x317cc7[_0xc3c6('0xa0')](),_0x2df151)[_0xc3c6('0x22')](function(_0x1dd962){_0x467c48=_[_0xc3c6('0xa2')](_0x1dd962,'id');_0x2df151=_[_0xc3c6('0xa3')](_0x2df151,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xda8652[_0xc3c6('0x46')][_0xc3c6('0x4a')]){_0x32b5a0[_0xc3c6('0x49')]['forEach'](function(_0x4b5295){_0x223c81[_0xc3c6('0x51')]('i.'+_0x4b5295);});}else{_0x223c81['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xc3c6('0x67'));_0x223c81[_0xc3c6('0x51')]('a.key',_0xc3c6('0xa4'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xa5'),_0xc3c6('0xa6'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xa7'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xa8'),'Contact.firstName');_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xa9'),'Contact.lastName');_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xaa'),_0xc3c6('0xab'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xac'),'Contact.phone');_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xad'),_0xc3c6('0xae'));_0x223c81[_0xc3c6('0x51')]('c.fax',_0xc3c6('0xaf'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xb0'),_0xc3c6('0xb1'));_0x223c81[_0xc3c6('0x51')](_0xc3c6('0xb2'),_0xc3c6('0xb3'));_0x223c81[_0xc3c6('0x51')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xc3c6('0x3d'));}_0x223c81[_0xc3c6('0x32')](_0x32b5a0[_0xc3c6('0x32')]);_0x223c81['offset'](_0x32b5a0[_0xc3c6('0x31')]);return db['sequelize'][_0xc3c6('0x46')](_0x223c81[_0xc3c6('0xa0')](),_0x2df151);})['then'](function(_0x59f357){_0x1a8938[_0xc3c6('0x4f')](_0xc3c6('0xb4'),_[_0xc3c6('0x3b')](_0x59f357,'id'));return db[_0xc3c6('0x9f')][_0xc3c6('0x46')](_0x1a8938[_0xc3c6('0xa0')](),_0x2df151)[_0xc3c6('0x22')](function(_0x338248){var _0xa494ed=_[_0xc3c6('0xb5')](_0x338248,_0xc3c6('0xb6'));var _0x3c9ed3=[];_0x59f357[_0xc3c6('0x40')](function(_0x4e228d){_0x3c9ed3[_0xc3c6('0xb7')](updateChatInteraction(_0x4e228d,_0x467c48,_0xa494ed));});return BPromise[_0xc3c6('0xb8')](_0x3c9ed3);});});})[_0xc3c6('0x22')](function(_0x1dd1a1){_0x33d6df[_0xc3c6('0xb9')]=_0x1dd1a1;return _0x33d6df;})[_0xc3c6('0x22')](respondWithFilteredResult(_0x570d11,_0x32b5a0));})[_0xc3c6('0x41')](handleError(_0x570d11,null));};exports['show']=function(_0x41da99,_0x9dc95d){var _0x423bb7={'raw':![],'where':{'id':_0x41da99[_0xc3c6('0xba')]['id']}},_0x5c8b78={};_0x5c8b78[_0xc3c6('0x45')]=_[_0xc3c6('0x47')](db['ChatInteraction'][_0xc3c6('0x42')]);_0x5c8b78[_0xc3c6('0x46')]=_[_0xc3c6('0x47')](_0x41da99[_0xc3c6('0x46')]);_0x5c8b78[_0xc3c6('0x48')]=_[_0xc3c6('0xbb')](_0x5c8b78['model'],_0x5c8b78[_0xc3c6('0x46')]);_0x423bb7['attributes']=_[_0xc3c6('0xbb')](_0x5c8b78[_0xc3c6('0x45')],qs['fields'](_0x41da99[_0xc3c6('0x46')]['fields']));_0x423bb7[_0xc3c6('0x49')]=_0x423bb7[_0xc3c6('0x49')][_0xc3c6('0x4b')]?_0x423bb7['attributes']:_0x5c8b78[_0xc3c6('0x45')];if(_0x41da99[_0xc3c6('0x46')][_0xc3c6('0xbc')]){_0x423bb7['include']=[{'all':!![]}];}_0x423bb7=_[_0xc3c6('0xa3')]({},_0x423bb7,_0x41da99[_0xc3c6('0xbd')]);return db[_0xc3c6('0xbe')][_0xc3c6('0x66')](_0x423bb7)['then'](handleEntityNotFound(_0x9dc95d,null))[_0xc3c6('0x22')](respondWithResult(_0x9dc95d,null))[_0xc3c6('0x41')](handleError(_0x9dc95d,null));};exports[_0xc3c6('0xbf')]=function(_0x364d31,_0x10ad85){return db[_0xc3c6('0xbe')][_0xc3c6('0xbf')](_0x364d31['body'],{})[_0xc3c6('0x22')](respondWithResult(_0x10ad85,0xc9))[_0xc3c6('0x41')](handleError(_0x10ad85,null));};exports[_0xc3c6('0x37')]=function(_0x1ead70,_0x40416c){if(_0x1ead70[_0xc3c6('0x78')]['id']){delete _0x1ead70[_0xc3c6('0x78')]['id'];}return db[_0xc3c6('0xbe')][_0xc3c6('0x66')]({'where':{'id':_0x1ead70['params']['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x40416c,null))['then'](saveUpdates(_0x1ead70[_0xc3c6('0x78')],null))['then'](respondWithResult(_0x40416c,null))[_0xc3c6('0x41')](handleError(_0x40416c,null));};exports[_0xc3c6('0xc0')]=function(_0x456521,_0x30e3fa){return db[_0xc3c6('0xbe')][_0xc3c6('0x66')]({'where':{'id':_0x456521[_0xc3c6('0xba')]['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x30e3fa,null))['then'](removeEntity(_0x30e3fa,null))['catch'](handleError(_0x30e3fa,null));};exports[_0xc3c6('0xc1')]=function(_0x21a52f,_0x4b8b23){return db['ChatInteraction'][_0xc3c6('0xc1')]()[_0xc3c6('0x22')](respondWithResult(_0x4b8b23,null))[_0xc3c6('0x41')](handleError(_0x4b8b23,null));};exports[_0xc3c6('0xc2')]=function(_0x51a938,_0x4b5983){if(_0x51a938[_0xc3c6('0x78')]['id']){delete _0x51a938[_0xc3c6('0x78')]['id'];}return db[_0xc3c6('0xbe')][_0xc3c6('0x66')]({'where':{'id':_0x51a938['params']['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x4b5983,null))['then'](saveUpdates(_0x51a938[_0xc3c6('0x78')],null))[_0xc3c6('0x22')](respondWithResult(_0x4b5983,null))[_0xc3c6('0x41')](handleError(_0x4b5983,null));};exports['abandon']=function(_0xcefc8b,_0xab7e0a,_0x435acb){if(_0xcefc8b[_0xc3c6('0x78')]['id']){delete _0xcefc8b[_0xc3c6('0x78')]['id'];}return db[_0xc3c6('0xbe')][_0xc3c6('0x66')]({'where':{'id':_0xcefc8b[_0xc3c6('0xba')]['id']}})[_0xc3c6('0x22')](function(_0xcbcfda){if(!_0xcbcfda){logger[_0xc3c6('0x29')](_0xc3c6('0xc3'),_0xc3c6('0xc4'),0x194,'entity\x20not\x20found');_0xab7e0a[_0xc3c6('0x2d')](0x194);}else{if(_0xcbcfda[_0xc3c6('0xc5')]){throw new db[(_0xc3c6('0x1e'))][(_0xc3c6('0x1f'))]('Interaction\x20already\x20assigned');}}return _0xcbcfda;})[_0xc3c6('0x22')](function(_0x5b11e3){if(_0x5b11e3){return _0x5b11e3[_0xc3c6('0x37')]({'closed':_0xcefc8b[_0xc3c6('0x78')][_0xc3c6('0xc6')],'disposition':_0xcefc8b[_0xc3c6('0x78')][_0xc3c6('0xc7')]})[_0xc3c6('0x22')](function(_0x4acf7d){return _0x4acf7d;});}})[_0xc3c6('0x22')](function(_0x50e3f3){return respondWithRpcPromise(_0xc3c6('0xc8'),_0xc3c6('0xc4'),_0xcefc8b[_0xc3c6('0x78')],client9004);})['then'](respondWithResult(_0xab7e0a,null))[_0xc3c6('0x41')](handleError(_0xab7e0a,null));};exports[_0xc3c6('0xc9')]=function(_0x1851ab,_0x3044db,_0x45b469){_0x1851ab[_0xc3c6('0x78')][_0xc3c6('0x38')]=_0x1851ab['file'][_0xc3c6('0xca')];_0x1851ab[_0xc3c6('0x78')][_0xc3c6('0xcb')]=_0x1851ab[_0xc3c6('0xcc')][_0xc3c6('0xcd')];_0x1851ab['body'][_0xc3c6('0x44')]=_0x1851ab[_0xc3c6('0xcc')]['mimetype'];return db['Attachment']['create'](_0x1851ab[_0xc3c6('0x78')])[_0xc3c6('0x22')](respondWithResult(_0x3044db,0xc9))[_0xc3c6('0x41')](handleError(_0x3044db,null));};exports[_0xc3c6('0xce')]=function(_0x39d1cc,_0x29d956,_0x537999){return db['ChatInteraction'][_0xc3c6('0xcf')]({'where':{'id':_0x39d1cc[_0xc3c6('0xba')]['id']},'raw':!![]})[_0xc3c6('0x22')](handleEntityNotFound(_0x29d956,null))[_0xc3c6('0x22')](function(_0x505dea){if(_0x505dea){if(_0x505dea[_0xc3c6('0xc6')]){return _0x29d956[_0xc3c6('0x2e')](0x193)[_0xc3c6('0x30')]({'status':0x193,'message':'Unauthorized'});}return db[_0xc3c6('0xd0')][_0xc3c6('0xcf')]({'where':{'id':_0x39d1cc[_0xc3c6('0x46')]['attachId']},'raw':!![]})['then'](handleEntityNotFound(_0x29d956,null));}})[_0xc3c6('0x22')](function(_0x2b2d9b){if(_0x2b2d9b){return _0x29d956[_0xc3c6('0xd1')](path[_0xc3c6('0xd2')](config[_0xc3c6('0xd3')],_0xc3c6('0xd4'),_0x2b2d9b[_0xc3c6('0xcb')]));}})['catch'](handleError(_0x29d956,null));};exports[_0xc3c6('0xd5')]=function(_0xf43b79,_0x54653f){var _0x310c3b=null;var _0x23a256=null;var _0x4aded3=null;var _0x1579c2=null;if(_0xf43b79[_0xc3c6('0x78')]['id']){delete _0xf43b79[_0xc3c6('0x78')]['id'];}if(_0xf43b79[_0xc3c6('0x78')][_0xc3c6('0xd6')]){_0x1579c2=path['join'](config['root'],_0xc3c6('0xd7'),util['format'](_0xc3c6('0xd8'),Date[_0xc3c6('0xd9')]()));_0xf43b79['body'][_0xc3c6('0xda')]=_0x1579c2;}return db[_0xc3c6('0xbe')]['find']({'where':{'id':_0xf43b79[_0xc3c6('0xba')]['id']},'include':[{'model':db['ChatMessage'],'as':'Messages','include':[{'model':db[_0xc3c6('0xdb')],'as':_0xc3c6('0xdb')}]}]})['then'](handleEntityNotFound(_0x54653f,null))['then'](saveUpdates(_0xf43b79[_0xc3c6('0x78')],null))[_0xc3c6('0x22')](function(_0x1e366f){if(_0x1e366f){_0x310c3b=_0x1e366f;return db[_0xc3c6('0xdc')]['find']({'where':{'id':_0x310c3b[_0xc3c6('0x7c')]}});}})['then'](function(_0x8ef461){if(_0x8ef461){_0x4aded3=_0x8ef461;return db['CmContact'][_0xc3c6('0x66')]({'where':{'id':_0x310c3b[_0xc3c6('0x70')]}});}})['then'](function(_0x54457b){if(_0x54457b){_0x23a256=_0x54457b;if(_0x1579c2){var _0x1c0f9f=null;for(var _0x1203d9=0x1;_0x1203d9<_0x310c3b[_0xc3c6('0xdd')][_0xc3c6('0x4b')];++_0x1203d9){_0x1c0f9f=_0x310c3b[_0xc3c6('0xdd')][_0x1203d9];var _0x4865e5=_0x1c0f9f[_0xc3c6('0xc5')]?util[_0xc3c6('0xde')](_0xc3c6('0xdf'),_0x4aded3['agentAlias'],_0x1c0f9f[_0xc3c6('0xc5')]):'System';var _0x4d0498=_0xf43b79['body'][_0xc3c6('0xe0')]||util[_0xc3c6('0xde')]('%s%d',_0xc3c6('0xe1'),_0x1c0f9f['ContactId']);switch(_0x4aded3['agentIdentifier']){case _0xc3c6('0xe2'):_0x4865e5=_0x1c0f9f['UserId']?util[_0xc3c6('0xde')](_0xc3c6('0xdf'),_0x4aded3[_0xc3c6('0xe3')],_0x1c0f9f[_0xc3c6('0xc5')]):_0xc3c6('0xe4');break;case _0xc3c6('0xe5'):_0x4865e5=_0x1c0f9f[_0xc3c6('0xc5')]?_0x1c0f9f[_0xc3c6('0xdb')][_0xc3c6('0xe6')]||_0x1c0f9f['User'][_0xc3c6('0x3c')]:'System';break;case _0xc3c6('0xe7'):_0x4865e5=_0x1c0f9f['UserId']?_0x1c0f9f['User'][_0xc3c6('0x3c')]:_0xc3c6('0xe4');break;default:_0x4865e5=_0x1c0f9f[_0xc3c6('0xc5')]?util['format'](_0xc3c6('0xdf'),_0x4aded3[_0xc3c6('0xe3')],_0x1c0f9f[_0xc3c6('0xc5')]):'System';}var _0x264318=util[_0xc3c6('0xde')]('[%s]\x20%s:\x20%s\x0a',moment(_0x1c0f9f[_0xc3c6('0xe8')])['format'](_0xc3c6('0xe9')),_0x1c0f9f[_0xc3c6('0xea')]==='in'?_0x4d0498:_0x4865e5,_0x1c0f9f[_0xc3c6('0x78')]);if(!_0x1c0f9f[_0xc3c6('0xeb')]){fs['appendFileSync'](_0x1579c2,_0x264318);}}return db[_0xc3c6('0xec')][_0xc3c6('0xcf')]({'where':{'service':!![]},'include':[{'model':db[_0xc3c6('0xed')],'as':'Smtp','raw':!![]}]});}}})['then'](function(_0x42535a){if(_0x42535a&&_0x42535a[_0xc3c6('0xee')]&&_0xf43b79[_0xc3c6('0x78')]){var _0x3622f8={'tls':{'rejectUnauthorized':![]}};if(_0x42535a['Smtp'][_0xc3c6('0xef')]){_0x3622f8['service']=_0x42535a[_0xc3c6('0xee')]['service'];}else{_0x3622f8[_0xc3c6('0xf0')]=_0x42535a[_0xc3c6('0xee')][_0xc3c6('0xf0')];_0x3622f8[_0xc3c6('0xf1')]=_0x42535a['Smtp'][_0xc3c6('0xf1')];_0x3622f8[_0xc3c6('0xf2')]=_0x42535a['Smtp'][_0xc3c6('0xf2')];}if(_0x42535a[_0xc3c6('0xee')][_0xc3c6('0xf3')]){_0x3622f8[_0xc3c6('0xf4')]={'user':_0x42535a[_0xc3c6('0xee')][_0xc3c6('0xf5')],'pass':_0x42535a[_0xc3c6('0xee')][_0xc3c6('0xf6')]};}return respondWithRpcPromise(_0xc3c6('0xf7'),_0xc3c6('0xf8'),{'account':_0x3622f8,'message':{'from':util[_0xc3c6('0xde')](_0xc3c6('0xf9'),_0x42535a[_0xc3c6('0x38')],_0x42535a[_0xc3c6('0xfa')]||_0x42535a[_0xc3c6('0xee')][_0xc3c6('0xf5')]),'to':_0xf43b79[_0xc3c6('0x78')][_0xc3c6('0xd6')],'subject':_0xc3c6('0xfb'),'text':util['format'](_0xc3c6('0xfc'),_0xf43b79['body'][_0xc3c6('0xd6')]),'attachments':[{'path':_0x1579c2}]}})[_0xc3c6('0x22')](function(){return _0x310c3b;})[_0xc3c6('0x41')](function(_0x4379ff){console[_0xc3c6('0x29')](_0x4379ff);});}else{return _0x310c3b;}})['then'](respondWithStatusCode(_0x54653f,0xc8))['catch'](handleError(_0x54653f,null));};exports[_0xc3c6('0xfd')]=function(_0x5b6d84,_0x1bd341,_0x28b414){return db[_0xc3c6('0xfe')][_0xc3c6('0x66')]({'where':{'id':_0x5b6d84[_0xc3c6('0xba')]['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x1bd341,null))[_0xc3c6('0x22')](function(_0x29d045){if(_0x29d045){return _0x29d045[_0xc3c6('0xfd')](_0x5b6d84[_0xc3c6('0x78')]['ids'],_[_0xc3c6('0xff')](_0x5b6d84[_0xc3c6('0x78')],['ids','id'])||{});}})['then'](respondWithResult(_0x1bd341,null))['catch'](handleError(_0x1bd341,null));};exports['getMessages']=function(_0x3f9122,_0x34e129,_0x23ce21){var _0x519d09={'raw':![],'where':{}};var _0x3f6b3d={};var _0x2761dd={'count':0x0,'rows':[]};return db[_0xc3c6('0xbe')][_0xc3c6('0xcf')]({'where':{'id':_0x3f9122[_0xc3c6('0xba')]['id']}})['then'](handleEntityNotFound(_0x34e129,null))[_0xc3c6('0x22')](function(_0x32fe77){if(_0x32fe77){_0x3f6b3d[_0xc3c6('0x45')]=_['keys'](db[_0xc3c6('0xfe')][_0xc3c6('0x42')]);_0x3f6b3d[_0xc3c6('0x46')]=_[_0xc3c6('0x47')](_0x3f9122[_0xc3c6('0x46')]);_0x3f6b3d[_0xc3c6('0x48')]=_[_0xc3c6('0xbb')](_0x3f6b3d[_0xc3c6('0x45')],_0x3f6b3d[_0xc3c6('0x46')]);_0x519d09[_0xc3c6('0x49')]=_[_0xc3c6('0xbb')](_0x3f6b3d[_0xc3c6('0x45')],qs[_0xc3c6('0x4a')](_0x3f9122[_0xc3c6('0x46')][_0xc3c6('0x4a')]));_0x519d09[_0xc3c6('0x49')]=_0x519d09[_0xc3c6('0x49')][_0xc3c6('0x4b')]?_0x519d09[_0xc3c6('0x49')]:_0x3f6b3d[_0xc3c6('0x45')];if(!_0x3f9122[_0xc3c6('0x46')][_0xc3c6('0x4c')](_0xc3c6('0x4d'))){_0x519d09['limit']=qs['limit'](_0x3f9122[_0xc3c6('0x46')][_0xc3c6('0x32')]);_0x519d09[_0xc3c6('0x31')]=qs['offset'](_0x3f9122[_0xc3c6('0x46')]['offset']);}_0x519d09[_0xc3c6('0x98')]=qs['sort'](_0x3f9122['query'][_0xc3c6('0x4e')]);_0x519d09[_0xc3c6('0x4f')]=qs[_0xc3c6('0x48')](_['pick'](_0x3f9122[_0xc3c6('0x46')],_0x3f6b3d[_0xc3c6('0x48')]));_0x519d09['where'][_0xc3c6('0xb6')]=_0x32fe77['id'];if(_0x3f9122[_0xc3c6('0x46')]['filter']){_0x519d09[_0xc3c6('0x4f')]=_[_0xc3c6('0xa3')](_0x519d09[_0xc3c6('0x4f')],{'$or':_[_0xc3c6('0x3b')](_0x519d09[_0xc3c6('0x49')],function(_0x117c6a){var _0x31c02d={};_0x31c02d[_0x117c6a]={'$like':'%'+_0x3f9122[_0xc3c6('0x46')]['filter']+'%'};return _0x31c02d;})});}if(_0x3f9122[_0xc3c6('0x46')]['$gte']){var _0x4d832b=_0x3f9122[_0xc3c6('0x46')][_0xc3c6('0x7f')]['split'](',');var _0x18105d={};_0x18105d[_0x4d832b[0x0]]={'$gte':moment(_0x4d832b[0x1])[_0xc3c6('0xde')]('YYYY-MM-DD\x20HH:mm:ss')};_0x519d09[_0xc3c6('0x4f')]=_['merge'](_0x519d09['where'],_0x18105d);}_0x519d09=_[_0xc3c6('0xa3')]({},_0x519d09,_0x3f9122[_0xc3c6('0xbd')]);return db[_0xc3c6('0xfe')][_0xc3c6('0xa1')]({'where':_0x519d09[_0xc3c6('0x4f')]})[_0xc3c6('0x22')](function(_0x310483){_0x2761dd[_0xc3c6('0xa1')]=_0x310483;if(_0x3f9122[_0xc3c6('0x46')][_0xc3c6('0xbc')]){_0x519d09[_0xc3c6('0x100')]=[{'all':!![]}];}return db[_0xc3c6('0xfe')][_0xc3c6('0x101')](_0x519d09);})[_0xc3c6('0x22')](function(_0x1fdfb5){_0x2761dd[_0xc3c6('0xb9')]=_0x1fdfb5;return _0x2761dd;});}})['then'](respondWithFilteredResult(_0x34e129,_0x519d09))[_0xc3c6('0x41')](handleError(_0x34e129,null));};exports[_0xc3c6('0x102')]=function(_0x11775b,_0x40ff1e,_0x289880){var _0x4dc53a={'where':{}},_0x3fe2ce={},_0x543832={'count':0x0,'rows':[]};return db[_0xc3c6('0xbe')][_0xc3c6('0xcf')]({'where':{'id':_0x11775b[_0xc3c6('0xba')]['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x40ff1e,null))[_0xc3c6('0x22')](function(_0x4e5b21){if(_0x4e5b21){_0x3fe2ce[_0xc3c6('0x45')]=_['keys'](db[_0xc3c6('0xfe')][_0xc3c6('0x42')]);_0x3fe2ce[_0xc3c6('0x46')]=_[_0xc3c6('0x47')](_0x11775b[_0xc3c6('0x46')]);_0x3fe2ce[_0xc3c6('0x48')]=_[_0xc3c6('0xbb')](_0x3fe2ce[_0xc3c6('0x45')],_0x3fe2ce['query']);_0x4dc53a[_0xc3c6('0x49')]=_[_0xc3c6('0xbb')](_0x3fe2ce[_0xc3c6('0x45')],qs[_0xc3c6('0x4a')](_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x4a')]));_0x4dc53a[_0xc3c6('0x49')]=_0x4dc53a[_0xc3c6('0x49')][_0xc3c6('0x4b')]?_0x4dc53a['attributes']:_0x3fe2ce[_0xc3c6('0x45')];if(!_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x4c')]('nolimit')){_0x4dc53a[_0xc3c6('0x32')]=qs['limit'](_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x32')]);_0x4dc53a[_0xc3c6('0x31')]=qs[_0xc3c6('0x31')](_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x31')]);}_0x4dc53a[_0xc3c6('0x98')]=qs[_0xc3c6('0x4e')](_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x4e')]);_0x4dc53a[_0xc3c6('0x4f')]=qs[_0xc3c6('0x48')](_[_0xc3c6('0x103')](_0x11775b[_0xc3c6('0x46')],_0x3fe2ce[_0xc3c6('0x48')]));_0x4dc53a['where']['ChatInteractionId']=_0x4e5b21['id'];if(_0x11775b[_0xc3c6('0x46')][_0xc3c6('0x8b')]){_0x4dc53a[_0xc3c6('0x4f')]=_[_0xc3c6('0xa3')](_0x4dc53a[_0xc3c6('0x4f')],{'$or':_[_0xc3c6('0x3b')](_0x4dc53a[_0xc3c6('0x49')],function(_0x319cb5){var _0x4b69b4={};_0x4b69b4[_0x319cb5]={'$like':'%'+_0x11775b['query']['filter']+'%'};return _0x4b69b4;})});}_0x4dc53a['where'][_0xc3c6('0xeb')]=![];if(_0x11775b[_0xc3c6('0x46')]['id']){_0x4dc53a['where']['id']={'$gt':_0x11775b[_0xc3c6('0x46')]['id']};}_0x4dc53a=_[_0xc3c6('0xa3')]({},_0x4dc53a,_0x11775b[_0xc3c6('0xbd')]);return db[_0xc3c6('0xfe')][_0xc3c6('0xa1')]({'where':_0x4dc53a[_0xc3c6('0x4f')]})['then'](function(_0x3b1ee5){_0x543832[_0xc3c6('0xa1')]=_0x3b1ee5;_0x4dc53a[_0xc3c6('0x100')]=[];if(_0x11775b['query'][_0xc3c6('0x104')]){_0x4dc53a[_0xc3c6('0x100')]['push']({'model':db[_0xc3c6('0xdb')],'as':_0xc3c6('0xdb'),'attributes':['id',_0xc3c6('0x3c'),'alias']});}if(_0x11775b[_0xc3c6('0x46')][_0xc3c6('0xbc')]){_0x4dc53a[_0xc3c6('0x100')]=[{'all':!![]}];}return db['ChatMessage'][_0xc3c6('0x101')](_0x4dc53a);})[_0xc3c6('0x22')](function(_0xd10565){_0x543832[_0xc3c6('0xb9')]=_0xd10565;return _0x543832;});}})[_0xc3c6('0x22')](respondWithFilteredResult(_0x40ff1e,_0x4dc53a))['catch'](handleError(_0x40ff1e,null));};exports['addTags']=function(_0xce7a62,_0x57f450,_0x18eabd){return db[_0xc3c6('0xbe')]['find']({'where':{'id':_0xce7a62['params']['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x57f450,null))[_0xc3c6('0x22')](function(_0x5680e1){if(_0x5680e1){return _0x5680e1[_0xc3c6('0x105')](_0xce7a62['body'][_0xc3c6('0x106')],_[_0xc3c6('0xff')](_0xce7a62[_0xc3c6('0x78')],[_0xc3c6('0x106'),'id'])||{})[_0xc3c6('0x107')](function(){return db[_0xc3c6('0x73')]['findAll']({'attributes':['id',_0xc3c6('0x38'),'color'],'where':{'id':_0xce7a62['body']['ids']}});})[_0xc3c6('0x22')](function(_0x29187f){socket[_0xc3c6('0x108')](_0xc3c6('0x109'),{'id':Number(_0xce7a62['params']['id']),'tags':_0x29187f||[]});return{'id':Number(_0xce7a62[_0xc3c6('0xba')]['id']),'tags':_0x29187f||[]};});}})[_0xc3c6('0x22')](respondWithResult(_0x57f450,null))[_0xc3c6('0x41')](handleError(_0x57f450,null));};exports[_0xc3c6('0x10a')]=function(_0x4a4cdf,_0x25f1d0,_0x3df313){return db[_0xc3c6('0xbe')]['find']({'where':{'id':_0x4a4cdf[_0xc3c6('0xba')]['id']}})[_0xc3c6('0x22')](handleEntityNotFound(_0x25f1d0,null))[_0xc3c6('0x22')](function(_0x59efee){if(_0x59efee){return _0x59efee[_0xc3c6('0x10a')](_0x4a4cdf[_0xc3c6('0x46')]['ids']);}})[_0xc3c6('0x22')](respondWithStatusCode(_0x25f1d0,null))['catch'](handleError(_0x25f1d0,null));};exports['download']=function(_0xbc5ad9,_0x2dc9de){var _0x5ed499=moment()[_0xc3c6('0x10b')]()[_0xc3c6('0xa0')]();var _0x10a769=path[_0xc3c6('0xd2')](config['root'],'server','files',_0xc3c6('0x10c'));var _0x402172=path[_0xc3c6('0xd2')](config[_0xc3c6('0xd3')],'server',_0xc3c6('0x10d'),'attachments');var _0x53b003=path['join'](_0x10a769,_0x5ed499);var _0x1c4873=util[_0xc3c6('0xde')](_0xc3c6('0x10e'),_0xbc5ad9[_0xc3c6('0xba')]['id'],_0x5ed499);var _0x1cae3d=path[_0xc3c6('0xd2')](_0x10a769,_0x1c4873);var _0x2c44a1=[];_0x2c44a1[_0xc3c6('0xb7')]({'model':db[_0xc3c6('0xdb')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x2c44a1[_0xc3c6('0xb7')]({'model':db[_0xc3c6('0x10f')],'as':_0xc3c6('0x110'),'attributes':['id','firstName',_0xc3c6('0x111')],'raw':!![]});if(_0xbc5ad9[_0xc3c6('0x46')][_0xc3c6('0x112')]){_0x2c44a1['push']({'model':db['Attachment'],'as':_0xc3c6('0xd0'),'raw':!![]});}var _0x48d78f=[{'model':db[_0xc3c6('0xfe')],'as':_0xc3c6('0xdd'),'attributes':['id','body',_0xc3c6('0xe8'),_0xc3c6('0xea'),'secret',_0xc3c6('0x86')],'include':_0x2c44a1}];_0x48d78f[_0xc3c6('0xb7')]({'model':db[_0xc3c6('0xdc')],'as':_0xc3c6('0x113'),'attributes':['id',_0xc3c6('0x38')]});_0x48d78f[_0xc3c6('0xb7')]({'model':db[_0xc3c6('0xdb')],'as':_0xc3c6('0x114'),'attributes':['id',_0xc3c6('0x3c')]});return db[_0xc3c6('0xbe')][_0xc3c6('0x66')]({'where':{'id':_0xbc5ad9[_0xc3c6('0xba')]['id']},'include':_0x48d78f})[_0xc3c6('0x22')](handleEntityNotFound(_0x2dc9de,null))[_0xc3c6('0x22')](function(_0x3f2646){if(_0x3f2646){var _0x5bf39a=_0x3f2646[_0xc3c6('0x115')]({'plain':!![]});fs[_0xc3c6('0x116')](_0x53b003);var _0x7ef60e={'format':'A4','border':_0xc3c6('0x117'),'header':{'height':_0xc3c6('0x118'),'contents':{'first':_0xc3c6('0x119')}},'footer':{'height':_0xc3c6('0x11a'),'contents':{'default':util['format'](_0xc3c6('0x11b'),util[_0xc3c6('0xde')](_0xc3c6('0x11c'),_0xc3c6('0x11d'),_0x5bf39a['id']),moment()[_0xc3c6('0xde')](_0xc3c6('0x11e'))[_0xc3c6('0xa0')]())}}};var _0x246e7e={'channel':_0xc3c6('0x11d'),'account':_0x5bf39a[_0xc3c6('0x113')][_0xc3c6('0x38')],'agent':_0x5bf39a[_0xc3c6('0x114')]?_0x5bf39a[_0xc3c6('0x114')][_0xc3c6('0x3c')]:_0xc3c6('0x11f'),'createdAt':moment(_0x5bf39a[_0xc3c6('0xe8')])[_0xc3c6('0xde')](_0xc3c6('0x120'))['toString'](),'closedAt':_0x5bf39a[_0xc3c6('0xc6')]?moment(_0x5bf39a['closedAt'])[_0xc3c6('0xde')]('YYYY-MM-DD\x20HH:mm:ss')[_0xc3c6('0xa0')]():'','disposition':_0x5bf39a['disposition'],'chatInfo':{'browser':_0x5bf39a[_0xc3c6('0x121')],'os':_0x5bf39a['osName'],'referer':_0x5bf39a[_0xc3c6('0x122')],'customerIp':_0x5bf39a[_0xc3c6('0x123')],'customerPort':_0x5bf39a[_0xc3c6('0x124')]?_0x5bf39a[_0xc3c6('0x124')]:_0xc3c6('0x11f')},'messages':_(_0x5bf39a[_0xc3c6('0xdd')])['tail']()['filter']({'secret':![]})[_0xc3c6('0x3b')](function(_0x1e4cd1){if(_0x1e4cd1[_0xc3c6('0xd0')]){var _0x11e34e=path[_0xc3c6('0xd2')](_0x402172,_0x1e4cd1[_0xc3c6('0xd0')]['basename']);if(fs[_0xc3c6('0x125')](_0x11e34e)){fs[_0xc3c6('0x126')](_0x11e34e)['pipe'](fs[_0xc3c6('0x127')](path[_0xc3c6('0xd2')](_0x53b003,_0x1e4cd1[_0xc3c6('0xd0')]['basename'])));}}return{'date':moment(_0x1e4cd1[_0xc3c6('0xe8')])[_0xc3c6('0xde')](_0xc3c6('0x120'))[_0xc3c6('0xa0')](),'sender':_0x1e4cd1[_0xc3c6('0xea')]===_0xc3c6('0x128')?_0x1e4cd1[_0xc3c6('0xdb')]?_0x1e4cd1[_0xc3c6('0xdb')]['fullname']:_0xc3c6('0xe4'):_0x1e4cd1['Contact'][_0xc3c6('0x129')]+(_0x1e4cd1[_0xc3c6('0x110')][_0xc3c6('0x111')]?'\x20'+_0x1e4cd1[_0xc3c6('0x110')]['lastName']:''),'body':_0x1e4cd1['Attachment']?_0x1e4cd1['Attachment']['basename']:_0x1e4cd1[_0xc3c6('0x78')],'direction':_0x1e4cd1['direction']==='out'?'A':'C','secret':_0x1e4cd1[_0xc3c6('0xeb')],'read':_0x1e4cd1[_0xc3c6('0x86')],'attachment':_0x1e4cd1['Attachment']};})[_0xc3c6('0x68')]()};return ejs[_0xc3c6('0x12a')](path[_0xc3c6('0xd2')](config[_0xc3c6('0xd3')],_0xc3c6('0x12b'),_0xc3c6('0x12c'),_0xc3c6('0x12d')),{'interaction':_0x246e7e})[_0xc3c6('0x22')](function(_0x596b88){return new BPromise(function(_0x531ac0,_0x1c2c31){pdf['create'](_0x596b88,_0x7ef60e)[_0xc3c6('0x12e')](path[_0xc3c6('0xd2')](_0x53b003,_0xc3c6('0x12f')+_0x5bf39a['id']+'-'+_0x5ed499+'.pdf'),function(_0x2e1e31,_0x16ee53){if(_0x2e1e31)return _0x1c2c31(_0x2e1e31);_0x531ac0(_0x16ee53);});});})['then'](function(){return new BPromise(function(_0x578e0c,_0xd02d8e){zipdir(_0x53b003,{'saveTo':_0x1cae3d},function(_0x1a5c32,_0x25f33e){if(_0x1a5c32)return _0xd02d8e(_0x1a5c32);return _0x578e0c(_0x25f33e);});})[_0xc3c6('0x22')](function(){return new BPromise(function(_0x194c21,_0x5d465e){rimraf(_0x53b003,function(_0x4ad8a4){if(_0x4ad8a4)_0x5d465e(_0x4ad8a4);return _0x194c21();});});})[_0xc3c6('0x22')](function(){return _0x2dc9de[_0xc3c6('0xd1')](_0x1cae3d,_0x1c4873,function(_0x31aa8a){if(_0x31aa8a){console[_0xc3c6('0x130')]('err',_0x31aa8a);}else{fs[_0xc3c6('0x131')](_0x1cae3d);}});});});}else{return _0x2dc9de[_0xc3c6('0x2d')](0xc8);}})[_0xc3c6('0x41')](handleError(_0x2dc9de,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 3a0c8f6..faeabb3 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 _0xb718=['Users','map','unreadMessages','length','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatInteraction','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x3ff183,_0x3267a5){var _0x22efc8=function(_0x4d2206){while(--_0x4d2206){_0x3ff183['push'](_0x3ff183['shift']());}};_0x22efc8(++_0x3267a5);}(_0xb718,0x1ee));var _0x8b71=function(_0x37628a,_0x92e3c6){_0x37628a=_0x37628a-0x0;var _0x1cf2bf=_0xb718[_0x37628a];return _0x1cf2bf;};'use strict';var EventEmitter=require(_0x8b71('0x0'));var ChatInteraction=require(_0x8b71('0x1'))['db'][_0x8b71('0x2')];var ChatMessage=require(_0x8b71('0x1'))['db']['ChatMessage'];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x8b71('0x3')](0x0);var events={'afterCreate':_0x8b71('0x4'),'afterUpdate':_0x8b71('0x5'),'afterDestroy':_0x8b71('0x6')};function emitEvent(_0x47d5ef){return function(_0x26e06d,_0x79d615,_0x5b70aa){_0x26e06d[_0x8b71('0x7')]({'attributes':['id'],'raw':!![]})[_0x8b71('0x8')](function(_0x28ceb5){_0x26e06d[_0x8b71('0x9')](_0x8b71('0xa'),_0x28ceb5[_0x8b71('0xb')](function(_0x52fbd7){return{'id':_0x52fbd7['id']};}));return ChatMessage['findAll']({'where':{'ChatInteractionId':_0x26e06d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x8b71('0x8')](function(_0xa43117){_0x26e06d['setDataValue'](_0x8b71('0xc'),_0xa43117[_0x8b71('0xd')]);ChatInteractionEvents['emit'](_0x47d5ef+':'+_0x26e06d['id'],_0x26e06d);ChatInteractionEvents['emit'](_0x47d5ef,_0x26e06d);_0x5b70aa(null);})[_0x8b71('0xe')](_0x5b70aa(null));};}for(var e in events){if(events[_0x8b71('0xf')](e)){var event=events[e];ChatInteraction[_0x8b71('0x10')](e,emitEvent(event));}}module[_0x8b71('0x11')]=ChatInteractionEvents; \ No newline at end of file +var _0xb35b=['setDataValue','Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','ChatMessage','setMaxListeners','save','update','remove','then'];(function(_0x581517,_0x2b3322){var _0x122078=function(_0x3294b6){while(--_0x3294b6){_0x581517['push'](_0x581517['shift']());}};_0x122078(++_0x2b3322);}(_0xb35b,0xb6));var _0xbb35=function(_0x874cf1,_0x2a4954){_0x874cf1=_0x874cf1-0x0;var _0x233579=_0xb35b[_0x874cf1];return _0x233579;};'use strict';var EventEmitter=require(_0xbb35('0x0'));var ChatInteraction=require(_0xbb35('0x1'))['db']['ChatInteraction'];var ChatMessage=require(_0xbb35('0x1'))['db'][_0xbb35('0x2')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xbb35('0x3')](0x0);var events={'afterCreate':_0xbb35('0x4'),'afterUpdate':_0xbb35('0x5'),'afterDestroy':_0xbb35('0x6')};function emitEvent(_0x4a9214){return function(_0x21c78a,_0x338633,_0x154bf2){_0x21c78a['getUsers']({'attributes':['id'],'raw':!![]})[_0xbb35('0x7')](function(_0x2e38e6){_0x21c78a[_0xbb35('0x8')](_0xbb35('0x9'),_0x2e38e6[_0xbb35('0xa')](function(_0xbd9326){return{'id':_0xbd9326['id']};}));return ChatMessage[_0xbb35('0xb')]({'where':{'ChatInteractionId':_0x21c78a['id'],'direction':'in','read':![]},'raw':!![]});})[_0xbb35('0x7')](function(_0x1fda74){_0x21c78a[_0xbb35('0x8')](_0xbb35('0xc'),_0x1fda74[_0xbb35('0xd')]);ChatInteractionEvents[_0xbb35('0xe')](_0x4a9214+':'+_0x21c78a['id'],_0x21c78a);ChatInteractionEvents[_0xbb35('0xe')](_0x4a9214,_0x21c78a);_0x154bf2(null);})[_0xbb35('0xf')](_0x154bf2(null));};}for(var e in events){if(events[_0xbb35('0x10')](e)){var event=events[e];ChatInteraction[_0xbb35('0x11')](e,emitEvent(event));}}module[_0xbb35('0x12')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 8181807..757d4ca 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 _0xbfc6=['define','ChatInteraction','chat_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','moment','request-promise','rimraf','../../config/environment','./chatInteraction.attributes'];(function(_0x1eecf9,_0x4bf73e){var _0x47feee=function(_0x17e9a2){while(--_0x17e9a2){_0x1eecf9['push'](_0x1eecf9['shift']());}};_0x47feee(++_0x4bf73e);}(_0xbfc6,0x1bb));var _0x6bfc=function(_0x182722,_0xcb113b){_0x182722=_0x182722-0x0;var _0x5de86f=_0xbfc6[_0x182722];return _0x5de86f;};'use strict';var _=require(_0x6bfc('0x0'));var util=require(_0x6bfc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x6bfc('0x2'));var BPromise=require('bluebird');var rp=require(_0x6bfc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6bfc('0x4'));var config=require(_0x6bfc('0x5'));var attributes=require(_0x6bfc('0x6'));module['exports']=function(_0x2d345a,_0x59f35d){return _0x2d345a[_0x6bfc('0x7')](_0x6bfc('0x8'),attributes,{'tableName':_0x6bfc('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x597a39,_0x21fa08,_0x1c07fa){if(_0x597a39[_0x6bfc('0xa')](_0x6bfc('0xb'))){_0x597a39[_0x6bfc('0xc')]=moment()['format'](_0x6bfc('0xd'));}_0x1c07fa(null,_0x597a39);}},'charset':'utf8mb4','collate':_0x6bfc('0xe')});}; \ No newline at end of file +var _0xfe61=['changed','closed','closedAt','format','utf8mb4','utf8mb4_unicode_ci','moment','request-promise','path','exports','ChatInteraction','chat_interactions'];(function(_0x34e0dd,_0x1bd86f){var _0x505d0c=function(_0x354af3){while(--_0x354af3){_0x34e0dd['push'](_0x34e0dd['shift']());}};_0x505d0c(++_0x1bd86f);}(_0xfe61,0xa2));var _0x1fe6=function(_0x1fd48c,_0x55d1ea){_0x1fd48c=_0x1fd48c-0x0;var _0x481f63=_0xfe61[_0x1fd48c];return _0x481f63;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1fe6('0x0'));var BPromise=require('bluebird');var rp=require(_0x1fe6('0x1'));var fs=require('fs');var path=require(_0x1fe6('0x2'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./chatInteraction.attributes');module[_0x1fe6('0x3')]=function(_0x4d5f95,_0x5c5800){return _0x4d5f95['define'](_0x1fe6('0x4'),attributes,{'tableName':_0x1fe6('0x5'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x19154a,_0x4dcc35,_0x17f549){if(_0x19154a[_0x1fe6('0x6')](_0x1fe6('0x7'))){_0x19154a[_0x1fe6('0x8')]=moment()[_0x1fe6('0x9')]('YYYY-MM-DD\x20HH:mm:ss');}_0x17f549(null,_0x19154a);}},'charset':_0x1fe6('0xa'),'collate':_0x1fe6('0xb')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index 883f350..545b406 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 _0x02b9=['info','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','ChatInteraction','update','options','raw','where','attributes','limit','UpdateChatInteraction','debug','find','addTags','body','omit','spread','AddTags','lodash','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','redis','defaults','socket.io-emitter','./chatInteraction.socket','register','request','then'];(function(_0x38a7ac,_0x45514b){var _0x53061a=function(_0x1d2469){while(--_0x1d2469){_0x38a7ac['push'](_0x38a7ac['shift']());}};_0x53061a(++_0x45514b);}(_0x02b9,0x177));var _0x902b=function(_0x58b871,_0x3f2f92){_0x58b871=_0x58b871-0x0;var _0xf8430a=_0x02b9[_0x58b871];return _0xf8430a;};'use strict';var _=require(_0x902b('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x902b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x902b('0x2'));var db=require(_0x902b('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x902b('0x4'))(_0x902b('0x5'));var config=require(_0x902b('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x902b('0x7')]({'port':0x232a});config[_0x902b('0x8')]=_[_0x902b('0x9')](config[_0x902b('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0x902b('0xa'))(new Redis(config[_0x902b('0x8')]));require(_0x902b('0xb'))[_0x902b('0xc')](socket);function respondWithRpcPromise(_0x1d643d,_0x1d4b69,_0x503fb0){return new BPromise(function(_0x1c55db,_0x3c4cc8){return client[_0x902b('0xd')](_0x1d643d,_0x503fb0)[_0x902b('0xe')](function(_0x2eb4be){logger[_0x902b('0xf')]('ChatInteraction,\x20%s,\x20%s',_0x1d4b69,_0x902b('0x10'));logger['debug'](_0x902b('0x11'),_0x1d4b69,_0x902b('0x10'),JSON[_0x902b('0x12')](_0x2eb4be));if(_0x2eb4be['error']){if(_0x2eb4be[_0x902b('0x13')][_0x902b('0x14')]===0x1f4){logger[_0x902b('0x13')](_0x902b('0x15'),_0x1d4b69,_0x2eb4be['error']['message']);return _0x3c4cc8(_0x2eb4be['error'][_0x902b('0x16')]);}logger[_0x902b('0x13')](_0x902b('0x15'),_0x1d4b69,_0x2eb4be[_0x902b('0x13')][_0x902b('0x16')]);return _0x1c55db(_0x2eb4be['error'][_0x902b('0x16')]);}else{logger['info'](_0x902b('0x15'),_0x1d4b69,_0x902b('0x10'));_0x1c55db(_0x2eb4be['result']['message']);}})[_0x902b('0x17')](function(_0x2843b9){logger[_0x902b('0x13')](_0x902b('0x15'),_0x1d4b69,_0x2843b9);_0x3c4cc8(_0x2843b9);});});}exports['UpdateChatInteraction']=function(_0xd8b9af){var _0xd5ae96=this;return new Promise(function(_0x10501b,_0x4cd0a1){return db[_0x902b('0x18')][_0x902b('0x19')](_0xd8b9af['body'],{'raw':_0xd8b9af[_0x902b('0x1a')]?_0xd8b9af['options'][_0x902b('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd8b9af[_0x902b('0x1a')]?_0xd8b9af[_0x902b('0x1a')][_0x902b('0x1c')]||null:null,'attributes':_0xd8b9af[_0x902b('0x1a')]?_0xd8b9af[_0x902b('0x1a')][_0x902b('0x1d')]||null:null,'limit':_0xd8b9af[_0x902b('0x1a')]?_0xd8b9af[_0x902b('0x1a')][_0x902b('0x1e')]||null:null})[_0x902b('0xe')](function(_0xe3ddcd){logger[_0x902b('0xf')](_0x902b('0x1f'),_0xd8b9af);logger[_0x902b('0x20')](_0x902b('0x1f'),_0xd8b9af,JSON[_0x902b('0x12')](_0xe3ddcd));_0x10501b(_0xe3ddcd);})[_0x902b('0x17')](function(_0x1262df){logger[_0x902b('0x13')](_0x902b('0x1f'),_0x1262df[_0x902b('0x16')],_0xd8b9af);_0x4cd0a1(_0xd5ae96[_0x902b('0x13')](0x1f4,_0x1262df[_0x902b('0x16')]));});});};exports['AddTagsToChatInteraction']=function(_0xb91ddf){return new Promise(function(_0x9faf1,_0x304c4b){return db[_0x902b('0x18')][_0x902b('0x21')]({'where':_0xb91ddf[_0x902b('0x1a')]?_0xb91ddf['options']['where']||null:null})[_0x902b('0xe')](function(_0x5ea4e1){if(_0x5ea4e1){return _0x5ea4e1[_0x902b('0x22')](_0xb91ddf[_0x902b('0x23')]['ids'],_[_0x902b('0x24')](_0xb91ddf[_0x902b('0x23')],['ids','id'])||{});}})[_0x902b('0x25')](function(_0x13a9a2){logger[_0x902b('0xf')](_0x902b('0x26'),_0xb91ddf);logger[_0x902b('0x20')]('AddTags',_0xb91ddf,JSON['stringify'](_0x13a9a2));_0x9faf1(_0x13a9a2);})['catch'](function(_0x493cb3){logger[_0x902b('0x13')](_0x902b('0x26'),_0x493cb3[_0x902b('0x16')],_0xb91ddf);_0x304c4b(_this[_0x902b('0x13')](0x1f4,_0x493cb3[_0x902b('0x16')]));});});}; \ No newline at end of file +var _0x2e16=['UpdateChatInteraction','debug','AddTagsToChatInteraction','find','addTags','omit','AddTags','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatInteraction','update','body','options','raw','where','limit'];(function(_0x489249,_0x2c3e41){var _0x13871c=function(_0x2c4fab){while(--_0x2c4fab){_0x489249['push'](_0x489249['shift']());}};_0x13871c(++_0x2c3e41);}(_0x2e16,0xfd));var _0x62e1=function(_0x37954c,_0x5cfaca){_0x37954c=_0x37954c-0x0;var _0x3fb740=_0x2e16[_0x37954c];return _0x3fb740;};'use strict';var _=require(_0x62e1('0x0'));var util=require(_0x62e1('0x1'));var moment=require(_0x62e1('0x2'));var BPromise=require(_0x62e1('0x3'));var rs=require(_0x62e1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62e1('0x5'));var logger=require(_0x62e1('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x62e1('0x7'));var client=jayson[_0x62e1('0x8')]['http']({'port':0x232a});config[_0x62e1('0x9')]=_[_0x62e1('0xa')](config['redis'],{'host':_0x62e1('0xb'),'port':0x18eb});var socket=require(_0x62e1('0xc'))(new Redis(config[_0x62e1('0x9')]));require(_0x62e1('0xd'))[_0x62e1('0xe')](socket);function respondWithRpcPromise(_0x98f3b6,_0x1e5091,_0x4aaf93){return new BPromise(function(_0x407749,_0x1dca6b){return client[_0x62e1('0xf')](_0x98f3b6,_0x4aaf93)[_0x62e1('0x10')](function(_0x4e62d4){logger['info'](_0x62e1('0x11'),_0x1e5091,_0x62e1('0x12'));logger['debug'](_0x62e1('0x13'),_0x1e5091,_0x62e1('0x12'),JSON[_0x62e1('0x14')](_0x4e62d4));if(_0x4e62d4[_0x62e1('0x15')]){if(_0x4e62d4['error'][_0x62e1('0x16')]===0x1f4){logger['error'](_0x62e1('0x11'),_0x1e5091,_0x4e62d4[_0x62e1('0x15')]['message']);return _0x1dca6b(_0x4e62d4['error'][_0x62e1('0x17')]);}logger[_0x62e1('0x15')](_0x62e1('0x11'),_0x1e5091,_0x4e62d4[_0x62e1('0x15')][_0x62e1('0x17')]);return _0x407749(_0x4e62d4['error'][_0x62e1('0x17')]);}else{logger[_0x62e1('0x18')](_0x62e1('0x11'),_0x1e5091,_0x62e1('0x12'));_0x407749(_0x4e62d4[_0x62e1('0x19')][_0x62e1('0x17')]);}})[_0x62e1('0x1a')](function(_0x3025be){logger[_0x62e1('0x15')]('ChatInteraction,\x20%s,\x20%s',_0x1e5091,_0x3025be);_0x1dca6b(_0x3025be);});});}exports['UpdateChatInteraction']=function(_0x2b9399){var _0x2f04f6=this;return new Promise(function(_0x35cc87,_0x12222b){return db[_0x62e1('0x1b')][_0x62e1('0x1c')](_0x2b9399[_0x62e1('0x1d')],{'raw':_0x2b9399[_0x62e1('0x1e')]?_0x2b9399['options'][_0x62e1('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b9399[_0x62e1('0x1e')]?_0x2b9399[_0x62e1('0x1e')][_0x62e1('0x20')]||null:null,'attributes':_0x2b9399['options']?_0x2b9399[_0x62e1('0x1e')]['attributes']||null:null,'limit':_0x2b9399[_0x62e1('0x1e')]?_0x2b9399[_0x62e1('0x1e')][_0x62e1('0x21')]||null:null})[_0x62e1('0x10')](function(_0x28fbf3){logger['info'](_0x62e1('0x22'),_0x2b9399);logger[_0x62e1('0x23')]('UpdateChatInteraction',_0x2b9399,JSON[_0x62e1('0x14')](_0x28fbf3));_0x35cc87(_0x28fbf3);})[_0x62e1('0x1a')](function(_0x4b8da6){logger['error'](_0x62e1('0x22'),_0x4b8da6[_0x62e1('0x17')],_0x2b9399);_0x12222b(_0x2f04f6[_0x62e1('0x15')](0x1f4,_0x4b8da6['message']));});});};exports[_0x62e1('0x24')]=function(_0x1c8eb8){return new Promise(function(_0x416ebc,_0x198cac){return db[_0x62e1('0x1b')][_0x62e1('0x25')]({'where':_0x1c8eb8[_0x62e1('0x1e')]?_0x1c8eb8['options'][_0x62e1('0x20')]||null:null})[_0x62e1('0x10')](function(_0x27e6d5){if(_0x27e6d5){return _0x27e6d5[_0x62e1('0x26')](_0x1c8eb8[_0x62e1('0x1d')]['ids'],_[_0x62e1('0x27')](_0x1c8eb8[_0x62e1('0x1d')],['ids','id'])||{});}})['spread'](function(_0x3af896){logger['info'](_0x62e1('0x28'),_0x1c8eb8);logger[_0x62e1('0x23')]('AddTags',_0x1c8eb8,JSON[_0x62e1('0x14')](_0x3af896));_0x416ebc(_0x3af896);})[_0x62e1('0x1a')](function(_0x1c8cb6){logger[_0x62e1('0x15')]('AddTags',_0x1c8cb6[_0x62e1('0x17')],_0x1c8eb8);_0x198cac(_this[_0x62e1('0x15')](0x1f4,_0x1c8cb6['message']));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 8f8e9de..794c4a4 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 _0x6447=['register','length','chatInteraction:','./chatInteraction.events','save','update','emit','removeListener'];(function(_0x497220,_0x45c12f){var _0x432edf=function(_0x8e7c4f){while(--_0x8e7c4f){_0x497220['push'](_0x497220['shift']());}};_0x432edf(++_0x45c12f);}(_0x6447,0x19b));var _0x7644=function(_0x22b8a3,_0x2a79a7){_0x22b8a3=_0x22b8a3-0x0;var _0x199a0c=_0x6447[_0x22b8a3];return _0x199a0c;};'use strict';var ChatInteractionEvents=require(_0x7644('0x0'));var events=[_0x7644('0x1'),'remove',_0x7644('0x2')];function createListener(_0x5ea9ae,_0x1b48e5){return function(_0x49e374){_0x1b48e5[_0x7644('0x3')](_0x5ea9ae,_0x49e374);};}function removeListener(_0x4077a8,_0x511f66){return function(){ChatInteractionEvents[_0x7644('0x4')](_0x4077a8,_0x511f66);};}exports[_0x7644('0x5')]=function(_0x142d39){for(var _0x261a4f=0x0,_0x3cd445=events[_0x7644('0x6')];_0x261a4f<_0x3cd445;_0x261a4f++){var _0x216e9c=events[_0x261a4f];var _0x2a9ee3=createListener(_0x7644('0x7')+_0x216e9c,_0x142d39);ChatInteractionEvents['on'](_0x216e9c,_0x2a9ee3);}}; \ No newline at end of file +var _0xc8be=['./chatInteraction.events','remove','update','emit','register','chatInteraction:'];(function(_0x5c93ac,_0x17b5e8){var _0x50cafd=function(_0x4fbeb1){while(--_0x4fbeb1){_0x5c93ac['push'](_0x5c93ac['shift']());}};_0x50cafd(++_0x17b5e8);}(_0xc8be,0x66));var _0xec8b=function(_0xbc84d1,_0x3f217c){_0xbc84d1=_0xbc84d1-0x0;var _0x3a123e=_0xc8be[_0xbc84d1];return _0x3a123e;};'use strict';var ChatInteractionEvents=require(_0xec8b('0x0'));var events=['save',_0xec8b('0x1'),_0xec8b('0x2')];function createListener(_0x174cda,_0x17831a){return function(_0x512d4c){_0x17831a[_0xec8b('0x3')](_0x174cda,_0x512d4c);};}function removeListener(_0x59d132,_0x462644){return function(){ChatInteractionEvents['removeListener'](_0x59d132,_0x462644);};}exports[_0xec8b('0x4')]=function(_0x2aa8ac){for(var _0x5b54e3=0x0,_0x477372=events['length'];_0x5b54e3<_0x477372;_0x5b54e3++){var _0x504492=events[_0x5b54e3];var _0x253241=createListener(_0xec8b('0x5')+_0x504492,_0x2aa8ac);ChatInteractionEvents['on'](_0x504492,_0x253241);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index b09adbb..51507ac 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 _0xf012=['addMessage','/:id/tags','chat','addTags','put','chatinteraction:update','update','/:id/custom_update','/:id/abandon','/:id/close','chatinteraction:destroy','destroy','delete','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','/:id/my_messages','getMyMessages','/:id/download','post','create','join','root','server/files/attachments/','%s-%s','now','originalname','replace','single','file','attachmentUpload'];(function(_0x33154d,_0x854047){var _0x3b2f03=function(_0x35f7a6){while(--_0x35f7a6){_0x33154d['push'](_0x33154d['shift']());}};_0x3b2f03(++_0x854047);}(_0xf012,0xa1));var _0x2f01=function(_0x5c5b4d,_0x3b4781){_0x5c5b4d=_0x5c5b4d-0x0;var _0x448a9e=_0xf012[_0x5c5b4d];return _0x448a9e;};'use strict';var multer=require(_0x2f01('0x0'));var util=require(_0x2f01('0x1'));var path=require('path');var timeout=require(_0x2f01('0x2'));var express=require(_0x2f01('0x3'));var router=express[_0x2f01('0x4')]();var auth=require(_0x2f01('0x5'));var interaction=require(_0x2f01('0x6'));var config=require(_0x2f01('0x7'));var controller=require(_0x2f01('0x8'));router[_0x2f01('0x9')]('/',auth['isAuthenticated'](),controller[_0x2f01('0xa')]);router[_0x2f01('0x9')](_0x2f01('0xb'),auth[_0x2f01('0xc')](),controller[_0x2f01('0xd')]);router[_0x2f01('0x9')](_0x2f01('0xe'),auth[_0x2f01('0xf')](),controller[_0x2f01('0x10')]);router[_0x2f01('0x9')](_0x2f01('0x11'),auth['isChatInteractionAuthorized'](),controller[_0x2f01('0x12')]);router['get'](_0x2f01('0x13'),auth['isAuthenticated'](),controller['getMessages']);router[_0x2f01('0x9')](_0x2f01('0x14'),auth[_0x2f01('0xf')](),controller[_0x2f01('0x15')]);router[_0x2f01('0x9')](_0x2f01('0x16'),auth[_0x2f01('0xc')](),controller['download']);router[_0x2f01('0x17')]('/',auth[_0x2f01('0xc')](),controller[_0x2f01('0x18')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x6a8d75,_0x1145de,_0x1863a1){_0x1863a1(null,path[_0x2f01('0x19')](config[_0x2f01('0x1a')],_0x2f01('0x1b')));},'filename':function(_0x28f827,_0x5611b1,_0x12b2b0){_0x12b2b0(null,util['format'](_0x2f01('0x1c'),Date[_0x2f01('0x1d')](),_0x5611b1[_0x2f01('0x1e')][_0x2f01('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post']('/:id/attachment_upload',upload[_0x2f01('0x20')](_0x2f01('0x21')),controller[_0x2f01('0x22')]);router[_0x2f01('0x17')]('/:id/messages',auth[_0x2f01('0xf')](),controller[_0x2f01('0x23')]);router[_0x2f01('0x17')](_0x2f01('0x24'),auth[_0x2f01('0xc')](),interaction['tracked'](_0x2f01('0x25'),'chatinteraction:addtags'),controller[_0x2f01('0x26')]);router[_0x2f01('0x27')](_0x2f01('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x2f01('0x25'),_0x2f01('0x28')),controller[_0x2f01('0x29')]);router[_0x2f01('0x27')](_0x2f01('0x2a'),controller['customUpdate']);router[_0x2f01('0x27')](_0x2f01('0x2b'),auth[_0x2f01('0xf')](),controller['abandon']);router['put'](_0x2f01('0x2c'),controller['close']);router['delete'](_0x2f01('0xe'),auth[_0x2f01('0xc')](),interaction['tracked'](_0x2f01('0x25'),_0x2f01('0x2d')),controller[_0x2f01('0x2e')]);router[_0x2f01('0x2f')](_0x2f01('0x24'),auth[_0x2f01('0xc')](),controller[_0x2f01('0x30')]);module['exports']=router; \ No newline at end of file +var _0x0749=['../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','show','/:id/attachment_download','isChatInteractionAuthorized','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','getMyMessages','/:id/download','post','diskStorage','root','format','now','single','file','attachmentUpload','addMessage','tracked','chat','chatinteraction:addtags','addTags','chatinteraction:update','put','/:id/custom_update','customUpdate','abandon','close','delete','/:id','destroy','/:id/tags','exports','multer','util','connect-timeout','Router'];(function(_0x1ec7b7,_0x547cca){var _0x1bb477=function(_0x469203){while(--_0x469203){_0x1ec7b7['push'](_0x1ec7b7['shift']());}};_0x1bb477(++_0x547cca);}(_0x0749,0x10a));var _0x9074=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x0749[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x9074('0x0'));var util=require(_0x9074('0x1'));var path=require('path');var timeout=require(_0x9074('0x2'));var express=require('express');var router=express[_0x9074('0x3')]();var auth=require(_0x9074('0x4'));var interaction=require(_0x9074('0x5'));var config=require('../../config/environment');var controller=require(_0x9074('0x6'));router[_0x9074('0x7')]('/',auth[_0x9074('0x8')](),controller[_0x9074('0x9')]);router[_0x9074('0x7')](_0x9074('0xa'),auth[_0x9074('0x8')](),controller[_0x9074('0xb')]);router[_0x9074('0x7')]('/:id',auth['isChatInteractionAuthorized'](),controller[_0x9074('0xc')]);router['get'](_0x9074('0xd'),auth[_0x9074('0xe')](),controller[_0x9074('0xf')]);router[_0x9074('0x7')](_0x9074('0x10'),auth[_0x9074('0x8')](),controller[_0x9074('0x11')]);router[_0x9074('0x7')](_0x9074('0x12'),auth['isChatInteractionAuthorized'](),controller[_0x9074('0x13')]);router[_0x9074('0x7')](_0x9074('0x14'),auth['isAuthenticated'](),controller['download']);router[_0x9074('0x15')]('/',auth['isAuthenticated'](),controller['create']);var upload=multer({'storage':multer[_0x9074('0x16')]({'destination':function(_0x49babd,_0x104922,_0x3a35ce){_0x3a35ce(null,path['join'](config[_0x9074('0x17')],'server/files/attachments/'));},'filename':function(_0x2796a1,_0x4d3be2,_0x2db61c){_0x2db61c(null,util[_0x9074('0x18')]('%s-%s',Date[_0x9074('0x19')](),_0x4d3be2['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x9074('0x15')]('/:id/attachment_upload',upload[_0x9074('0x1a')](_0x9074('0x1b')),controller[_0x9074('0x1c')]);router[_0x9074('0x15')]('/:id/messages',auth['isChatInteractionAuthorized'](),controller[_0x9074('0x1d')]);router[_0x9074('0x15')]('/:id/tags',auth[_0x9074('0x8')](),interaction[_0x9074('0x1e')](_0x9074('0x1f'),_0x9074('0x20')),controller[_0x9074('0x21')]);router['put']('/:id',auth['isAuthenticated'](),interaction[_0x9074('0x1e')](_0x9074('0x1f'),_0x9074('0x22')),controller['update']);router[_0x9074('0x23')](_0x9074('0x24'),controller[_0x9074('0x25')]);router[_0x9074('0x23')]('/:id/abandon',auth[_0x9074('0xe')](),controller[_0x9074('0x26')]);router['put']('/:id/close',controller[_0x9074('0x27')]);router[_0x9074('0x28')](_0x9074('0x29'),auth[_0x9074('0x8')](),interaction['tracked'](_0x9074('0x1f'),'chatinteraction:destroy'),controller[_0x9074('0x2a')]);router[_0x9074('0x28')](_0x9074('0x2b'),auth[_0x9074('0x8')](),controller['removeTags']);module[_0x9074('0x2c')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 7a0dc01..8ca495d 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 _0x0b0e=['TEXT','BOOLEAN','INTEGER','sequelize'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x0b0e,0x187));var _0xe0b0=function(_0x359377,_0x1a63ef){_0x359377=_0x359377-0x0;var _0x8be18a=_0x0b0e[_0x359377];return _0x8be18a;};'use strict';var Sequelize=require(_0xe0b0('0x0'));module['exports']={'body':{'type':Sequelize[_0xe0b0('0x1')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0xe0b0('0x2')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xe0b0('0x3')]}}; \ No newline at end of file +var _0x4975=['TEXT','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x4975,0x86));var _0x5497=function(_0x3b8c62,_0x370dbb){_0x3b8c62=_0x3b8c62-0x0;var _0x16ada9=_0x4975[_0x3b8c62];return _0x16ada9;};'use strict';var Sequelize=require(_0x5497('0x0'));module['exports']={'body':{'type':Sequelize[_0x5497('0x1')](_0x5497('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x5497('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x5497('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 6cbbf23..0f32571 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 _0xdad7=['where','merge','VIRTUAL','ChatInternalMessage','includeAll','findAll','catch','show','params','keys','length','include','options','create','body','find','describe','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueues','UserProfileSection','Agents','userProfileId','UserProfileResource','isEmpty','agent','push','FromId','ToId','all','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','pick','filter'];(function(_0x46054c,_0x3aa17){var _0x146664=function(_0x2146d5){while(--_0x2146d5){_0x46054c['push'](_0x46054c['shift']());}};_0x146664(++_0x3aa17);}(_0xdad7,0x1ee));var _0x7dad=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0xdad7[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7dad('0x0'));var emlformat=require(_0x7dad('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x7dad('0x2'));var jsonpatch=require(_0x7dad('0x3'));var rp=require(_0x7dad('0x4'));var moment=require(_0x7dad('0x5'));var BPromise=require(_0x7dad('0x6'));var Mustache=require(_0x7dad('0x7'));var util=require(_0x7dad('0x8'));var path=require(_0x7dad('0x9'));var sox=require(_0x7dad('0xa'));var csv=require(_0x7dad('0xb'));var ejs=require(_0x7dad('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7dad('0xd'));var crypto=require(_0x7dad('0xe'));var jsforce=require(_0x7dad('0xf'));var deskjs=require(_0x7dad('0x10'));var toCsv=require(_0x7dad('0xb'));var querystring=require(_0x7dad('0x11'));var Papa=require(_0x7dad('0x12'));var Redis=require(_0x7dad('0x13'));var authService=require(_0x7dad('0x14'));var qs=require(_0x7dad('0x15'));var as=require(_0x7dad('0x16'));var hardwareService=require(_0x7dad('0x17'));var logger=require(_0x7dad('0x18'))('api');var utils=require(_0x7dad('0x19'));var config=require(_0x7dad('0x1a'));var db=require(_0x7dad('0x1b'))['db'];config[_0x7dad('0x1c')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7dad('0x1c')]));require(_0x7dad('0x1d'))[_0x7dad('0x1e')](socket);function respondWithStatusCode(_0x340e72,_0x1c3fe9){_0x1c3fe9=_0x1c3fe9||0xcc;return function(_0x375dcd){if(_0x375dcd){return _0x340e72[_0x7dad('0x1f')](_0x1c3fe9);}return _0x340e72[_0x7dad('0x20')](_0x1c3fe9)[_0x7dad('0x21')]();};}function respondWithResult(_0x325f0b,_0x53282b){_0x53282b=_0x53282b||0xc8;return function(_0x231ec8){if(_0x231ec8){return _0x325f0b[_0x7dad('0x20')](_0x53282b)[_0x7dad('0x22')](_0x231ec8);}};}function respondWithFilteredResult(_0x4da9f0,_0x4c67ba){return function(_0x281d22){if(_0x281d22){var _0x478dc7=_0x281d22[_0x7dad('0x23')],_0x24d212=_0x4c67ba[_0x7dad('0x24')],_0x1b94f3=_0x4c67ba[_0x7dad('0x24')]+_0x4c67ba['limit'],_0x983717;if(_0x1b94f3>=_0x478dc7){_0x1b94f3=_0x478dc7;_0x983717=0xc8;}else{_0x983717=0xce;}_0x4da9f0[_0x7dad('0x20')](_0x983717);return _0x4da9f0['set'](_0x7dad('0x25'),_0x24d212+'-'+_0x1b94f3+'/'+_0x478dc7)['json'](_0x281d22);}return null;};}function patchUpdates(_0x425ca0){return function(_0x17fa55){try{jsonpatch[_0x7dad('0x26')](_0x17fa55,_0x425ca0,!![]);}catch(_0x19d137){return BPromise[_0x7dad('0x27')](_0x19d137);}return _0x17fa55[_0x7dad('0x28')]();};}function saveUpdates(_0x2934a7,_0x8cfc94){return function(_0x56a378){if(_0x56a378){return _0x56a378[_0x7dad('0x29')](_0x2934a7)[_0x7dad('0x2a')](function(_0x1555a6){return _0x1555a6;});}return null;};}function removeEntity(_0x8e3201,_0x4d08c7){return function(_0x35d0f2){if(_0x35d0f2){return _0x35d0f2[_0x7dad('0x2b')]()[_0x7dad('0x2a')](function(){_0x8e3201[_0x7dad('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xb415f1,_0x342f1b){return function(_0x17e784){if(!_0x17e784){_0xb415f1[_0x7dad('0x1f')](0x194);}return _0x17e784;};}function handleError(_0x446989,_0x176581){_0x176581=_0x176581||0x1f4;return function(_0x2323ab){logger[_0x7dad('0x2c')](_0x2323ab[_0x7dad('0x2d')]);if(_0x2323ab[_0x7dad('0x2e')]){delete _0x2323ab[_0x7dad('0x2e')];}_0x446989[_0x7dad('0x20')](_0x176581)[_0x7dad('0x2f')](_0x2323ab);};}exports[_0x7dad('0x30')]=function(_0x59206d,_0x3190eb){var _0x351334={},_0x37103b={},_0x480e05={'count':0x0,'rows':[]};var _0x5a7183=_[_0x7dad('0x31')](db['ChatInternalMessage'][_0x7dad('0x32')],function(_0x4a5b18){return{'name':_0x4a5b18[_0x7dad('0x33')],'type':_0x4a5b18[_0x7dad('0x34')][_0x7dad('0x35')]};});_0x37103b[_0x7dad('0x36')]=_[_0x7dad('0x31')](_0x5a7183,_0x7dad('0x2e'));_0x37103b[_0x7dad('0x37')]=_['keys'](_0x59206d[_0x7dad('0x37')]);_0x37103b[_0x7dad('0x38')]=_[_0x7dad('0x39')](_0x37103b[_0x7dad('0x36')],_0x37103b[_0x7dad('0x37')]);_0x351334[_0x7dad('0x3a')]=_[_0x7dad('0x39')](_0x37103b[_0x7dad('0x36')],qs[_0x7dad('0x3b')](_0x59206d[_0x7dad('0x37')][_0x7dad('0x3b')]));_0x351334[_0x7dad('0x3a')]=_0x351334['attributes']['length']?_0x351334[_0x7dad('0x3a')]:_0x37103b['model'];if(!_0x59206d['query'][_0x7dad('0x3c')](_0x7dad('0x3d'))){_0x351334[_0x7dad('0x3e')]=qs[_0x7dad('0x3e')](_0x59206d[_0x7dad('0x37')][_0x7dad('0x3e')]);_0x351334[_0x7dad('0x24')]=qs['offset'](_0x59206d[_0x7dad('0x37')][_0x7dad('0x24')]);}_0x351334['order']=qs[_0x7dad('0x3f')](_0x59206d[_0x7dad('0x37')][_0x7dad('0x3f')]);_0x351334['where']=qs['filters'](_[_0x7dad('0x40')](_0x59206d[_0x7dad('0x37')],_0x37103b[_0x7dad('0x38')]));if(_0x59206d['query'][_0x7dad('0x41')]){_0x351334[_0x7dad('0x42')]=_[_0x7dad('0x43')](_0x351334[_0x7dad('0x42')],{'$or':_[_0x7dad('0x31')](_0x5a7183,function(_0x556def){if(_0x556def[_0x7dad('0x34')]!==_0x7dad('0x44')){var _0x511329={};_0x511329[_0x556def[_0x7dad('0x2e')]]={'$like':'%'+_0x59206d['query']['filter']+'%'};return _0x511329;}})});}_0x351334=_[_0x7dad('0x43')]({},_0x351334,_0x59206d['options']);var _0x40c62c={'where':_0x351334['where']};return db[_0x7dad('0x45')][_0x7dad('0x23')](_0x40c62c)[_0x7dad('0x2a')](function(_0x227342){_0x480e05[_0x7dad('0x23')]=_0x227342;if(_0x59206d['query'][_0x7dad('0x46')]){_0x351334['include']=[{'all':!![]}];}return db[_0x7dad('0x45')][_0x7dad('0x47')](_0x351334);})[_0x7dad('0x2a')](function(_0x5dc10a){_0x480e05['rows']=_0x5dc10a;return _0x480e05;})['then'](respondWithFilteredResult(_0x3190eb,_0x351334))[_0x7dad('0x48')](handleError(_0x3190eb,null));};exports[_0x7dad('0x49')]=function(_0x34f1d1,_0x39dfe6){var _0x17eefb={'raw':!![],'where':{'id':_0x34f1d1[_0x7dad('0x4a')]['id']}},_0x536301={};_0x536301['model']=_[_0x7dad('0x4b')](db[_0x7dad('0x45')]['rawAttributes']);_0x536301[_0x7dad('0x37')]=_[_0x7dad('0x4b')](_0x34f1d1[_0x7dad('0x37')]);_0x536301[_0x7dad('0x38')]=_['intersection'](_0x536301['model'],_0x536301[_0x7dad('0x37')]);_0x17eefb[_0x7dad('0x3a')]=_[_0x7dad('0x39')](_0x536301[_0x7dad('0x36')],qs[_0x7dad('0x3b')](_0x34f1d1['query'][_0x7dad('0x3b')]));_0x17eefb[_0x7dad('0x3a')]=_0x17eefb[_0x7dad('0x3a')][_0x7dad('0x4c')]?_0x17eefb[_0x7dad('0x3a')]:_0x536301[_0x7dad('0x36')];if(_0x34f1d1[_0x7dad('0x37')][_0x7dad('0x46')]){_0x17eefb[_0x7dad('0x4d')]=[{'all':!![]}];}_0x17eefb=_[_0x7dad('0x43')]({},_0x17eefb,_0x34f1d1[_0x7dad('0x4e')]);return db['ChatInternalMessage']['find'](_0x17eefb)['then'](handleEntityNotFound(_0x39dfe6,null))['then'](respondWithResult(_0x39dfe6,null))[_0x7dad('0x48')](handleError(_0x39dfe6,null));};exports[_0x7dad('0x4f')]=function(_0x5dc1b5,_0x332e85){return db[_0x7dad('0x45')]['create'](_0x5dc1b5[_0x7dad('0x50')],{})[_0x7dad('0x2a')](respondWithResult(_0x332e85,0xc9))[_0x7dad('0x48')](handleError(_0x332e85,null));};exports[_0x7dad('0x29')]=function(_0x2a59bf,_0x4068d4){if(_0x2a59bf[_0x7dad('0x50')]['id']){delete _0x2a59bf[_0x7dad('0x50')]['id'];}return db['ChatInternalMessage'][_0x7dad('0x51')]({'where':{'id':_0x2a59bf[_0x7dad('0x4a')]['id']}})[_0x7dad('0x2a')](handleEntityNotFound(_0x4068d4,null))[_0x7dad('0x2a')](saveUpdates(_0x2a59bf[_0x7dad('0x50')],null))[_0x7dad('0x2a')](respondWithResult(_0x4068d4,null))[_0x7dad('0x48')](handleError(_0x4068d4,null));};exports[_0x7dad('0x2b')]=function(_0x19b64b,_0x7a5e2f){return db[_0x7dad('0x45')][_0x7dad('0x51')]({'where':{'id':_0x19b64b[_0x7dad('0x4a')]['id']}})[_0x7dad('0x2a')](handleEntityNotFound(_0x7a5e2f,null))['then'](removeEntity(_0x7a5e2f,null))[_0x7dad('0x48')](handleError(_0x7a5e2f,null));};exports[_0x7dad('0x52')]=function(_0x52a8b1,_0x64ca97){return db['ChatInternalMessage'][_0x7dad('0x52')]()['then'](respondWithResult(_0x64ca97,null))[_0x7dad('0x48')](handleError(_0x64ca97,null));};function wrapUser(_0x2d0e41){return function(_0x4c0ae5){var _0x4dd9d2=_0x2d0e41[_0x7dad('0x53')]({'plain':!![]});_0x4dd9d2[_0x7dad('0x54')]=[];if(_0x4c0ae5){_0x4dd9d2['lastMessageAt']=_0x4c0ae5['createdAt'];_0x4dd9d2[_0x7dad('0x55')]=_0x4c0ae5;}else{_0x4dd9d2[_0x7dad('0x56')]=moment(0x0)[_0x7dad('0x57')](_0x7dad('0x58'));_0x4dd9d2[_0x7dad('0x55')]={};}return _0x4dd9d2;};}exports[_0x7dad('0x59')]=function(_0x503563,_0x34038e,_0x32a930){var _0x466b86=[];return db[_0x7dad('0x5a')]['findAll']({'where':{'role':['agent','admin',_0x7dad('0x5b')]},'attributes':['id',_0x7dad('0x5c'),_0x7dad('0x2e'),_0x7dad('0x5d'),_0x7dad('0x5e'),_0x7dad('0x5f'),_0x7dad('0x60'),_0x7dad('0x61'),_0x7dad('0x62'),_0x7dad('0x63')],'order':qs[_0x7dad('0x3f')](_0x7dad('0x64')),'include':[{'model':db['VoiceQueue'],'as':_0x7dad('0x65'),'attributes':['id',_0x7dad('0x2e'),'type'],'through':{'attributes':[]}}]})[_0x7dad('0x2a')](function(_0x428cba){if(_0x428cba){var _0x409b70=_0x503563[_0x7dad('0x5b')]['get']({'plain':!![]});if(!_0x409b70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x409b70[_0x7dad('0x5d')]===_0x7dad('0x5b')){return db[_0x7dad('0x66')][_0x7dad('0x51')]({'where':{'name':_0x7dad('0x67'),'userProfileId':_0x409b70[_0x7dad('0x68')]},'raw':!![]})[_0x7dad('0x2a')](function(_0x5bb926){if(_0x5bb926){if(_0x5bb926['autoAssociation']===0x0){return db[_0x7dad('0x69')][_0x7dad('0x47')]({'where':{'sectionId':_0x5bb926['id']},'raw':!![]})[_0x7dad('0x2a')](function(_0x2c039d){var _0x4993c4=[];if(_[_0x7dad('0x6a')](_0x2c039d)){_0x4993c4=_[_0x7dad('0x41')](_0x428cba,function(_0x3f8822){if(_0x3f8822['role']!=='agent'){return _0x3f8822;}});return _0x4993c4;}else{for(var _0x3ec6e0=0x0;_0x3ec6e0<_0x428cba[_0x7dad('0x4c')];_0x3ec6e0++){var _0x8f4c04=_0x428cba[_0x3ec6e0];if(_0x8f4c04['role']===_0x7dad('0x6b')){var _0x4c1d5b=_[_0x7dad('0x51')](_0x2c039d,function(_0x26b058){return _0x26b058['resourceId']===_0x8f4c04['id'];});if(_0x4c1d5b)_0x4993c4[_0x7dad('0x6c')](_0x8f4c04);}else{_0x4993c4[_0x7dad('0x6c')](_0x8f4c04);}}return _0x4993c4;}});}else{return _0x428cba;}}else{var _0x16600f=_[_0x7dad('0x41')](_0x428cba,function(_0x22b153){if(_0x22b153[_0x7dad('0x5d')]!=='agent'){return _0x22b153;}});return _0x16600f;}});}else{return _0x428cba;}}})['then'](function(_0x4e30ed){var _0x448464=[];if(_0x4e30ed){_0x466b86=_0x4e30ed;for(var _0x1112d2=0x0;_0x1112d2<_0x4e30ed['length'];_0x1112d2+=0x1){_0x466b86[_0x1112d2][_0x7dad('0x54')]=[];_0x448464[_0x7dad('0x6c')](db['ChatInternalMessage']['find']({'where':{'FromId':[_0x503563['user']['id'],_0x4e30ed[_0x1112d2]['id']],'ToId':[_0x503563[_0x7dad('0x5b')]['id'],_0x4e30ed[_0x1112d2]['id']],'ChatGroupId':null},'attributes':['id','createdAt',_0x7dad('0x6d'),_0x7dad('0x6e'),'read','body'],'order':qs['sort']('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7dad('0x2a')](wrapUser(_0x4e30ed[_0x1112d2])));}return BPromise[_0x7dad('0x6f')](_0x448464);}return[];})[_0x7dad('0x2a')](function(_0x41b381){return{'rows':_0x41b381,'count':_0x41b381[_0x7dad('0x4c')]};})['then'](respondWithResult(_0x34038e,null))[_0x7dad('0x48')](handleError(_0x34038e,null));}; \ No newline at end of file +var _0x7dba=['html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','ChatInternalMessage','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','rawAttributes','length','includeAll','include','create','body','find','describe','get','messages','lastMessageAt','createdAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent','admin','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','UserProfileResource','isEmpty','resourceId','push','user','read'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x7dba,0xdc));var _0xa7db=function(_0x3ab08b,_0x163eea){_0x3ab08b=_0x3ab08b-0x0;var _0x1d3cbb=_0x7dba[_0x3ab08b];return _0x1d3cbb;};'use strict';var pdf=require(_0xa7db('0x0'));var emlformat=require(_0xa7db('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa7db('0x2'));var moment=require('moment');var BPromise=require(_0xa7db('0x3'));var Mustache=require(_0xa7db('0x4'));var util=require(_0xa7db('0x5'));var path=require(_0xa7db('0x6'));var sox=require(_0xa7db('0x7'));var csv=require(_0xa7db('0x8'));var ejs=require(_0xa7db('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xa7db('0xa'));var crypto=require(_0xa7db('0xb'));var jsforce=require(_0xa7db('0xc'));var deskjs=require(_0xa7db('0xd'));var toCsv=require(_0xa7db('0x8'));var querystring=require(_0xa7db('0xe'));var Papa=require(_0xa7db('0xf'));var Redis=require(_0xa7db('0x10'));var authService=require(_0xa7db('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa7db('0x12'));var hardwareService=require(_0xa7db('0x13'));var logger=require('../../config/logger')(_0xa7db('0x14'));var utils=require(_0xa7db('0x15'));var config=require(_0xa7db('0x16'));var db=require(_0xa7db('0x17'))['db'];config['redis']=_[_0xa7db('0x18')](config[_0xa7db('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa7db('0x1a'))(new Redis(config['redis']));require(_0xa7db('0x1b'))[_0xa7db('0x1c')](socket);function respondWithStatusCode(_0x40f1a9,_0x936042){_0x936042=_0x936042||0xcc;return function(_0x27d06e){if(_0x27d06e){return _0x40f1a9[_0xa7db('0x1d')](_0x936042);}return _0x40f1a9[_0xa7db('0x1e')](_0x936042)[_0xa7db('0x1f')]();};}function respondWithResult(_0x4da23b,_0x5c5a2b){_0x5c5a2b=_0x5c5a2b||0xc8;return function(_0x47d7c7){if(_0x47d7c7){return _0x4da23b[_0xa7db('0x1e')](_0x5c5a2b)[_0xa7db('0x20')](_0x47d7c7);}};}function respondWithFilteredResult(_0x1f5fb8,_0x169b10){return function(_0x49ae6e){if(_0x49ae6e){var _0x406c15=_0x49ae6e[_0xa7db('0x21')],_0x9303f5=_0x169b10['offset'],_0x40a411=_0x169b10[_0xa7db('0x22')]+_0x169b10[_0xa7db('0x23')],_0x65210d;if(_0x40a411>=_0x406c15){_0x40a411=_0x406c15;_0x65210d=0xc8;}else{_0x65210d=0xce;}_0x1f5fb8[_0xa7db('0x1e')](_0x65210d);return _0x1f5fb8['set'](_0xa7db('0x24'),_0x9303f5+'-'+_0x40a411+'/'+_0x406c15)[_0xa7db('0x20')](_0x49ae6e);}return null;};}function patchUpdates(_0x33a89e){return function(_0xdef57b){try{jsonpatch[_0xa7db('0x25')](_0xdef57b,_0x33a89e,!![]);}catch(_0x4d728e){return BPromise[_0xa7db('0x26')](_0x4d728e);}return _0xdef57b['save']();};}function saveUpdates(_0x2217e6,_0x2c6373){return function(_0x3b6715){if(_0x3b6715){return _0x3b6715[_0xa7db('0x27')](_0x2217e6)[_0xa7db('0x28')](function(_0xcaa41f){return _0xcaa41f;});}return null;};}function removeEntity(_0x39a6f9,_0x4f6ebe){return function(_0x2cb15a){if(_0x2cb15a){return _0x2cb15a[_0xa7db('0x29')]()[_0xa7db('0x28')](function(){_0x39a6f9[_0xa7db('0x1e')](0xcc)[_0xa7db('0x1f')]();});}};}function handleEntityNotFound(_0x24be15,_0x4d81b4){return function(_0x55036f){if(!_0x55036f){_0x24be15[_0xa7db('0x1d')](0x194);}return _0x55036f;};}function handleError(_0x39f56f,_0x139a15){_0x139a15=_0x139a15||0x1f4;return function(_0x3b7fde){logger[_0xa7db('0x2a')](_0x3b7fde[_0xa7db('0x2b')]);if(_0x3b7fde[_0xa7db('0x2c')]){delete _0x3b7fde['name'];}_0x39f56f[_0xa7db('0x1e')](_0x139a15)['send'](_0x3b7fde);};}exports[_0xa7db('0x2d')]=function(_0x420fc2,_0x4a9f0c){var _0x2ee7a6={},_0x89d954={},_0x351fcb={'count':0x0,'rows':[]};var _0x374308=_[_0xa7db('0x2e')](db[_0xa7db('0x2f')]['rawAttributes'],function(_0x3c5b1b){return{'name':_0x3c5b1b[_0xa7db('0x30')],'type':_0x3c5b1b[_0xa7db('0x31')][_0xa7db('0x32')]};});_0x89d954[_0xa7db('0x33')]=_[_0xa7db('0x2e')](_0x374308,'name');_0x89d954['query']=_['keys'](_0x420fc2[_0xa7db('0x34')]);_0x89d954[_0xa7db('0x35')]=_[_0xa7db('0x36')](_0x89d954[_0xa7db('0x33')],_0x89d954['query']);_0x2ee7a6[_0xa7db('0x37')]=_[_0xa7db('0x36')](_0x89d954[_0xa7db('0x33')],qs[_0xa7db('0x38')](_0x420fc2[_0xa7db('0x34')][_0xa7db('0x38')]));_0x2ee7a6[_0xa7db('0x37')]=_0x2ee7a6[_0xa7db('0x37')]['length']?_0x2ee7a6[_0xa7db('0x37')]:_0x89d954[_0xa7db('0x33')];if(!_0x420fc2['query'][_0xa7db('0x39')](_0xa7db('0x3a'))){_0x2ee7a6[_0xa7db('0x23')]=qs[_0xa7db('0x23')](_0x420fc2[_0xa7db('0x34')][_0xa7db('0x23')]);_0x2ee7a6[_0xa7db('0x22')]=qs[_0xa7db('0x22')](_0x420fc2[_0xa7db('0x34')][_0xa7db('0x22')]);}_0x2ee7a6['order']=qs[_0xa7db('0x3b')](_0x420fc2['query'][_0xa7db('0x3b')]);_0x2ee7a6[_0xa7db('0x3c')]=qs[_0xa7db('0x35')](_[_0xa7db('0x3d')](_0x420fc2[_0xa7db('0x34')],_0x89d954[_0xa7db('0x35')]));if(_0x420fc2[_0xa7db('0x34')][_0xa7db('0x3e')]){_0x2ee7a6[_0xa7db('0x3c')]=_[_0xa7db('0x3f')](_0x2ee7a6[_0xa7db('0x3c')],{'$or':_[_0xa7db('0x2e')](_0x374308,function(_0x247e9e){if(_0x247e9e['type']!==_0xa7db('0x40')){var _0xa382e1={};_0xa382e1[_0x247e9e['name']]={'$like':'%'+_0x420fc2[_0xa7db('0x34')][_0xa7db('0x3e')]+'%'};return _0xa382e1;}})});}_0x2ee7a6=_[_0xa7db('0x3f')]({},_0x2ee7a6,_0x420fc2[_0xa7db('0x41')]);var _0x512a88={'where':_0x2ee7a6[_0xa7db('0x3c')]};return db[_0xa7db('0x2f')]['count'](_0x512a88)[_0xa7db('0x28')](function(_0x4a80c7){_0x351fcb[_0xa7db('0x21')]=_0x4a80c7;if(_0x420fc2[_0xa7db('0x34')]['includeAll']){_0x2ee7a6['include']=[{'all':!![]}];}return db[_0xa7db('0x2f')][_0xa7db('0x42')](_0x2ee7a6);})[_0xa7db('0x28')](function(_0x31d0ce){_0x351fcb[_0xa7db('0x43')]=_0x31d0ce;return _0x351fcb;})[_0xa7db('0x28')](respondWithFilteredResult(_0x4a9f0c,_0x2ee7a6))[_0xa7db('0x44')](handleError(_0x4a9f0c,null));};exports[_0xa7db('0x45')]=function(_0x3acd41,_0x232895){var _0x553e86={'raw':!![],'where':{'id':_0x3acd41[_0xa7db('0x46')]['id']}},_0x3a0d6d={};_0x3a0d6d[_0xa7db('0x33')]=_[_0xa7db('0x47')](db[_0xa7db('0x2f')][_0xa7db('0x48')]);_0x3a0d6d[_0xa7db('0x34')]=_['keys'](_0x3acd41[_0xa7db('0x34')]);_0x3a0d6d['filters']=_[_0xa7db('0x36')](_0x3a0d6d[_0xa7db('0x33')],_0x3a0d6d[_0xa7db('0x34')]);_0x553e86[_0xa7db('0x37')]=_['intersection'](_0x3a0d6d[_0xa7db('0x33')],qs[_0xa7db('0x38')](_0x3acd41[_0xa7db('0x34')][_0xa7db('0x38')]));_0x553e86[_0xa7db('0x37')]=_0x553e86['attributes'][_0xa7db('0x49')]?_0x553e86[_0xa7db('0x37')]:_0x3a0d6d[_0xa7db('0x33')];if(_0x3acd41['query'][_0xa7db('0x4a')]){_0x553e86[_0xa7db('0x4b')]=[{'all':!![]}];}_0x553e86=_['merge']({},_0x553e86,_0x3acd41[_0xa7db('0x41')]);return db[_0xa7db('0x2f')]['find'](_0x553e86)['then'](handleEntityNotFound(_0x232895,null))[_0xa7db('0x28')](respondWithResult(_0x232895,null))[_0xa7db('0x44')](handleError(_0x232895,null));};exports[_0xa7db('0x4c')]=function(_0x4dfe71,_0x297aa6){return db[_0xa7db('0x2f')][_0xa7db('0x4c')](_0x4dfe71[_0xa7db('0x4d')],{})[_0xa7db('0x28')](respondWithResult(_0x297aa6,0xc9))[_0xa7db('0x44')](handleError(_0x297aa6,null));};exports[_0xa7db('0x27')]=function(_0xc61eb3,_0x55e6e1){if(_0xc61eb3[_0xa7db('0x4d')]['id']){delete _0xc61eb3[_0xa7db('0x4d')]['id'];}return db[_0xa7db('0x2f')]['find']({'where':{'id':_0xc61eb3[_0xa7db('0x46')]['id']}})[_0xa7db('0x28')](handleEntityNotFound(_0x55e6e1,null))['then'](saveUpdates(_0xc61eb3[_0xa7db('0x4d')],null))[_0xa7db('0x28')](respondWithResult(_0x55e6e1,null))[_0xa7db('0x44')](handleError(_0x55e6e1,null));};exports[_0xa7db('0x29')]=function(_0x499533,_0x5dea43){return db[_0xa7db('0x2f')][_0xa7db('0x4e')]({'where':{'id':_0x499533[_0xa7db('0x46')]['id']}})[_0xa7db('0x28')](handleEntityNotFound(_0x5dea43,null))[_0xa7db('0x28')](removeEntity(_0x5dea43,null))['catch'](handleError(_0x5dea43,null));};exports[_0xa7db('0x4f')]=function(_0x636b0e,_0x5258e3){return db['ChatInternalMessage'][_0xa7db('0x4f')]()[_0xa7db('0x28')](respondWithResult(_0x5258e3,null))[_0xa7db('0x44')](handleError(_0x5258e3,null));};function wrapUser(_0x3b8712){return function(_0x580150){var _0x9940ad=_0x3b8712[_0xa7db('0x50')]({'plain':!![]});_0x9940ad[_0xa7db('0x51')]=[];if(_0x580150){_0x9940ad[_0xa7db('0x52')]=_0x580150[_0xa7db('0x53')];_0x9940ad[_0xa7db('0x54')]=_0x580150;}else{_0x9940ad[_0xa7db('0x52')]=moment(0x0)[_0xa7db('0x55')](_0xa7db('0x56'));_0x9940ad[_0xa7db('0x54')]={};}return _0x9940ad;};}exports[_0xa7db('0x57')]=function(_0x1d298b,_0x4b82e,_0x350b8c){var _0x3f7161=[];return db[_0xa7db('0x58')][_0xa7db('0x42')]({'where':{'role':[_0xa7db('0x59'),_0xa7db('0x5a'),'user']},'attributes':['id',_0xa7db('0x5b'),'name',_0xa7db('0x5c'),_0xa7db('0x5d'),_0xa7db('0x5e'),_0xa7db('0x5f'),_0xa7db('0x60'),_0xa7db('0x61'),'showWebBar'],'order':qs[_0xa7db('0x3b')](_0xa7db('0x62')),'include':[{'model':db[_0xa7db('0x63')],'as':_0xa7db('0x64'),'attributes':['id',_0xa7db('0x2c'),_0xa7db('0x31')],'through':{'attributes':[]}}]})['then'](function(_0x2fc2e3){if(_0x2fc2e3){var _0x57dcd1=_0x1d298b['user']['get']({'plain':!![]});if(!_0x57dcd1)throw new Error(_0xa7db('0x65'));if(_0x57dcd1['role']==='user'){return db[_0xa7db('0x66')][_0xa7db('0x4e')]({'where':{'name':'Agents','userProfileId':_0x57dcd1[_0xa7db('0x67')]},'raw':!![]})[_0xa7db('0x28')](function(_0x292cf6){if(_0x292cf6){if(_0x292cf6['autoAssociation']===0x0){return db[_0xa7db('0x68')][_0xa7db('0x42')]({'where':{'sectionId':_0x292cf6['id']},'raw':!![]})[_0xa7db('0x28')](function(_0x3e38c0){var _0x2930a6=[];if(_[_0xa7db('0x69')](_0x3e38c0)){_0x2930a6=_[_0xa7db('0x3e')](_0x2fc2e3,function(_0x2782fa){if(_0x2782fa[_0xa7db('0x5c')]!=='agent'){return _0x2782fa;}});return _0x2930a6;}else{for(var _0x5ad189=0x0;_0x5ad189<_0x2fc2e3[_0xa7db('0x49')];_0x5ad189++){var _0x5937e3=_0x2fc2e3[_0x5ad189];if(_0x5937e3['role']===_0xa7db('0x59')){var _0x2f9e3c=_[_0xa7db('0x4e')](_0x3e38c0,function(_0x15dc79){return _0x15dc79[_0xa7db('0x6a')]===_0x5937e3['id'];});if(_0x2f9e3c)_0x2930a6['push'](_0x5937e3);}else{_0x2930a6['push'](_0x5937e3);}}return _0x2930a6;}});}else{return _0x2fc2e3;}}else{var _0x42bf63=_[_0xa7db('0x3e')](_0x2fc2e3,function(_0x47d526){if(_0x47d526[_0xa7db('0x5c')]!==_0xa7db('0x59')){return _0x47d526;}});return _0x42bf63;}});}else{return _0x2fc2e3;}}})[_0xa7db('0x28')](function(_0xf7dd40){var _0x287f8b=[];if(_0xf7dd40){_0x3f7161=_0xf7dd40;for(var _0x5c102d=0x0;_0x5c102d<_0xf7dd40[_0xa7db('0x49')];_0x5c102d+=0x1){_0x3f7161[_0x5c102d]['messages']=[];_0x287f8b[_0xa7db('0x6b')](db['ChatInternalMessage'][_0xa7db('0x4e')]({'where':{'FromId':[_0x1d298b[_0xa7db('0x6c')]['id'],_0xf7dd40[_0x5c102d]['id']],'ToId':[_0x1d298b['user']['id'],_0xf7dd40[_0x5c102d]['id']],'ChatGroupId':null},'attributes':['id',_0xa7db('0x53'),'FromId','ToId',_0xa7db('0x6d'),_0xa7db('0x4d')],'order':qs[_0xa7db('0x3b')]('-createdAt'),'limit':0x1,'offset':0x0,'raw':!![]})[_0xa7db('0x28')](wrapUser(_0xf7dd40[_0x5c102d])));}return BPromise['all'](_0x287f8b);}return[];})[_0xa7db('0x28')](function(_0x1c7df8){return{'rows':_0x1c7df8,'count':_0x1c7df8[_0xa7db('0x49')]};})[_0xa7db('0x28')](respondWithResult(_0x4b82e,null))[_0xa7db('0x44')](handleError(_0x4b82e,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index 2b3aabb..1c90ce0 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 _0x9ec3=['hasOwnProperty','events','../../mysqldb','save','remove','emit'];(function(_0x2a095e,_0x1e337a){var _0x34f404=function(_0x31c672){while(--_0x31c672){_0x2a095e['push'](_0x2a095e['shift']());}};_0x34f404(++_0x1e337a);}(_0x9ec3,0xcd));var _0x39ec=function(_0x1b37c9,_0x2ccef5){_0x1b37c9=_0x1b37c9-0x0;var _0x3a8696=_0x9ec3[_0x1b37c9];return _0x3a8696;};'use strict';var EventEmitter=require(_0x39ec('0x0'));var ChatInternalMessage=require(_0x39ec('0x1'))['db']['ChatInternalMessage'];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x39ec('0x2'),'afterUpdate':'update','afterDestroy':_0x39ec('0x3')};function emitEvent(_0xa0b2a1){return function(_0x3ef850,_0x2e696d,_0x10d857){ChatInternalMessageEvents[_0x39ec('0x4')](_0xa0b2a1+':'+_0x3ef850['id'],_0x3ef850);ChatInternalMessageEvents[_0x39ec('0x4')](_0xa0b2a1,_0x3ef850);_0x10d857(null);};}for(var e in events){if(events[_0x39ec('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module['exports']=ChatInternalMessageEvents; \ No newline at end of file +var _0x40c2=['emit','hasOwnProperty','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save'];(function(_0x47aa64,_0xfb8a07){var _0x549c7a=function(_0x266165){while(--_0x266165){_0x47aa64['push'](_0x47aa64['shift']());}};_0x549c7a(++_0xfb8a07);}(_0x40c2,0x10d));var _0x240c=function(_0x109b18,_0x365978){_0x109b18=_0x109b18-0x0;var _0x33e9f3=_0x40c2[_0x109b18];return _0x33e9f3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0x240c('0x0'))['db'][_0x240c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0x240c('0x2')](0x0);var events={'afterCreate':_0x240c('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x25a75a){return function(_0x1827b7,_0x6cb99e,_0x3c3213){ChatInternalMessageEvents[_0x240c('0x4')](_0x25a75a+':'+_0x1827b7['id'],_0x1827b7);ChatInternalMessageEvents[_0x240c('0x4')](_0x25a75a,_0x1827b7);_0x3c3213(null);};}for(var e in events){if(events[_0x240c('0x5')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0x240c('0x6')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 445a81a..26dc8b5 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 _0xe706=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x126a10,_0x7bde76){var _0x15a853=function(_0x2bd2d6){while(--_0x2bd2d6){_0x126a10['push'](_0x126a10['shift']());}};_0x15a853(++_0x7bde76);}(_0xe706,0xa3));var _0x6e70=function(_0x3ab313,_0x4d6b91){_0x3ab313=_0x3ab313-0x0;var _0x52e13f=_0xe706[_0x3ab313];return _0x52e13f;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e70('0xe'),'collate':_0x6e70('0xf')});}; \ No newline at end of file +var _0xe706=['chat_internal_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatInternalMessage.attributes','exports','define','ChatInternalMessage'];(function(_0x56c37d,_0x486618){var _0x120476=function(_0x125e54){while(--_0x125e54){_0x56c37d['push'](_0x56c37d['shift']());}};_0x120476(++_0x486618);}(_0xe706,0xa3));var _0x6e70=function(_0x29e871,_0x330b98){_0x29e871=_0x29e871-0x0;var _0x3380e3=_0xe706[_0x29e871];return _0x3380e3;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var logger=require(_0x6e70('0x2'))('api');var moment=require(_0x6e70('0x3'));var BPromise=require(_0x6e70('0x4'));var rp=require(_0x6e70('0x5'));var fs=require('fs');var path=require(_0x6e70('0x6'));var rimraf=require(_0x6e70('0x7'));var config=require(_0x6e70('0x8'));var attributes=require(_0x6e70('0x9'));module[_0x6e70('0xa')]=function(_0x1b0389,_0x4381d1){return _0x1b0389[_0x6e70('0xb')](_0x6e70('0xc'),attributes,{'tableName':_0x6e70('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6e70('0xe'),'collate':_0x6e70('0xf')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index 567dd72..fe8d93b 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 _0x1783=['../../config/logger','rpc','../../config/environment','client','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register','then','info','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x403435,_0xcb4543){var _0x212dc8=function(_0x46bc0c){while(--_0x46bc0c){_0x403435['push'](_0x403435['shift']());}};_0x212dc8(++_0xcb4543);}(_0x1783,0x165));var _0x3178=function(_0xca4292,_0x497a24){_0xca4292=_0xca4292-0x0;var _0x3ea7c0=_0x1783[_0xca4292];return _0x3ea7c0;};'use strict';var _=require(_0x3178('0x0'));var util=require('util');var moment=require(_0x3178('0x1'));var BPromise=require(_0x3178('0x2'));var rs=require(_0x3178('0x3'));var fs=require('fs');var Redis=require(_0x3178('0x4'));var db=require(_0x3178('0x5'))['db'];var utils=require(_0x3178('0x6'));var logger=require(_0x3178('0x7'))(_0x3178('0x8'));var config=require(_0x3178('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3178('0xa')]['http']({'port':0x232a});config[_0x3178('0xb')]=_['defaults'](config['redis'],{'host':_0x3178('0xc'),'port':0x18eb});var socket=require(_0x3178('0xd'))(new Redis(config[_0x3178('0xb')]));require(_0x3178('0xe'))[_0x3178('0xf')](socket);function respondWithRpcPromise(_0x30e05a,_0x45f5cc,_0x4984d4){return new BPromise(function(_0x1d3db1,_0x4d1053){return client['request'](_0x30e05a,_0x4984d4)[_0x3178('0x10')](function(_0x54d3b2){logger[_0x3178('0x11')](_0x3178('0x12'),_0x45f5cc,_0x3178('0x13'));logger[_0x3178('0x14')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x45f5cc,_0x3178('0x13'),JSON[_0x3178('0x15')](_0x54d3b2));if(_0x54d3b2[_0x3178('0x16')]){if(_0x54d3b2[_0x3178('0x16')]['code']===0x1f4){logger[_0x3178('0x16')](_0x3178('0x12'),_0x45f5cc,_0x54d3b2[_0x3178('0x16')]['message']);return _0x4d1053(_0x54d3b2[_0x3178('0x16')][_0x3178('0x17')]);}logger['error'](_0x3178('0x12'),_0x45f5cc,_0x54d3b2['error']['message']);return _0x1d3db1(_0x54d3b2[_0x3178('0x16')][_0x3178('0x17')]);}else{logger[_0x3178('0x11')](_0x3178('0x12'),_0x45f5cc,_0x3178('0x13'));_0x1d3db1(_0x54d3b2[_0x3178('0x18')]['message']);}})[_0x3178('0x19')](function(_0x202de2){logger['error'](_0x3178('0x12'),_0x45f5cc,_0x202de2);_0x4d1053(_0x202de2);});});} \ No newline at end of file +var _0x8cc0=['defaults','socket.io-emitter','./chatInternalMessage.socket','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','ChatInternalMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','redis'];(function(_0x30b510,_0x3129c2){var _0x321e70=function(_0x1a3a16){while(--_0x1a3a16){_0x30b510['push'](_0x30b510['shift']());}};_0x321e70(++_0x3129c2);}(_0x8cc0,0x16c));var _0x08cc=function(_0x14b120,_0x475268){_0x14b120=_0x14b120-0x0;var _0xfca10c=_0x8cc0[_0x14b120];return _0xfca10c;};'use strict';var _=require(_0x08cc('0x0'));var util=require('util');var moment=require(_0x08cc('0x1'));var BPromise=require(_0x08cc('0x2'));var rs=require(_0x08cc('0x3'));var fs=require('fs');var Redis=require(_0x08cc('0x4'));var db=require(_0x08cc('0x5'))['db'];var utils=require(_0x08cc('0x6'));var logger=require('../../config/logger')(_0x08cc('0x7'));var config=require('../../config/environment');var jayson=require(_0x08cc('0x8'));var client=jayson['client'][_0x08cc('0x9')]({'port':0x232a});config[_0x08cc('0xa')]=_[_0x08cc('0xb')](config[_0x08cc('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x08cc('0xc'))(new Redis(config[_0x08cc('0xa')]));require(_0x08cc('0xd'))[_0x08cc('0xe')](socket);function respondWithRpcPromise(_0xbb8232,_0x25f574,_0x5757b9){return new BPromise(function(_0x4db70e,_0x3d8670){return client[_0x08cc('0xf')](_0xbb8232,_0x5757b9)['then'](function(_0x5a4645){logger['info'](_0x08cc('0x10'),_0x25f574,_0x08cc('0x11'));logger['debug'](_0x08cc('0x12'),_0x25f574,_0x08cc('0x11'),JSON[_0x08cc('0x13')](_0x5a4645));if(_0x5a4645['error']){if(_0x5a4645[_0x08cc('0x14')][_0x08cc('0x15')]===0x1f4){logger['error'](_0x08cc('0x10'),_0x25f574,_0x5a4645[_0x08cc('0x14')][_0x08cc('0x16')]);return _0x3d8670(_0x5a4645[_0x08cc('0x14')]['message']);}logger[_0x08cc('0x14')](_0x08cc('0x10'),_0x25f574,_0x5a4645['error'][_0x08cc('0x16')]);return _0x4db70e(_0x5a4645[_0x08cc('0x14')][_0x08cc('0x16')]);}else{logger[_0x08cc('0x17')](_0x08cc('0x10'),_0x25f574,_0x08cc('0x11'));_0x4db70e(_0x5a4645[_0x08cc('0x18')][_0x08cc('0x16')]);}})['catch'](function(_0x31926a){logger[_0x08cc('0x14')](_0x08cc('0x10'),_0x25f574,_0x31926a);_0x3d8670(_0x31926a);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index 0e5ed08..54c8a89 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 _0xb492=['remove','update','emit','removeListener','length','chatInternalMessage:','save'];(function(_0x1ed70d,_0x377c9c){var _0x5518da=function(_0x3ee7ae){while(--_0x3ee7ae){_0x1ed70d['push'](_0x1ed70d['shift']());}};_0x5518da(++_0x377c9c);}(_0xb492,0x172));var _0x2b49=function(_0xc159ad,_0x46aff6){_0xc159ad=_0xc159ad-0x0;var _0x56d734=_0xb492[_0xc159ad];return _0x56d734;};'use strict';var ChatInternalMessageEvents=require('./chatInternalMessage.events');var events=[_0x2b49('0x0'),_0x2b49('0x1'),_0x2b49('0x2')];function createListener(_0x1f3b35,_0x51fad7){return function(_0x522210){_0x51fad7[_0x2b49('0x3')](_0x1f3b35,_0x522210);};}function removeListener(_0x340296,_0x317a1d){return function(){ChatInternalMessageEvents[_0x2b49('0x4')](_0x340296,_0x317a1d);};}exports['register']=function(_0x53508a){for(var _0x346359=0x0,_0x363d21=events[_0x2b49('0x5')];_0x346359<_0x363d21;_0x346359++){var _0x2b745f=events[_0x346359];var _0x1b06c2=createListener(_0x2b49('0x6')+_0x2b745f,_0x53508a);ChatInternalMessageEvents['on'](_0x2b745f,_0x1b06c2);}}; \ No newline at end of file +var _0x9491=['./chatInternalMessage.events','save','remove','update','emit','register','chatInternalMessage:'];(function(_0x373317,_0x3b3dd8){var _0x200062=function(_0x36df9e){while(--_0x36df9e){_0x373317['push'](_0x373317['shift']());}};_0x200062(++_0x3b3dd8);}(_0x9491,0xb6));var _0x1949=function(_0x16884c,_0x508220){_0x16884c=_0x16884c-0x0;var _0x1c1d13=_0x9491[_0x16884c];return _0x1c1d13;};'use strict';var ChatInternalMessageEvents=require(_0x1949('0x0'));var events=[_0x1949('0x1'),_0x1949('0x2'),_0x1949('0x3')];function createListener(_0x46e060,_0x1f05db){return function(_0x28621a){_0x1f05db[_0x1949('0x4')](_0x46e060,_0x28621a);};}function removeListener(_0x4270d7,_0x358907){return function(){ChatInternalMessageEvents['removeListener'](_0x4270d7,_0x358907);};}exports[_0x1949('0x5')]=function(_0x5b01b9){for(var _0x14c30e=0x0,_0x2d39a3=events['length'];_0x14c30e<_0x2d39a3;_0x14c30e++){var _0x28b2b6=events[_0x14c30e];var _0x3665b6=createListener(_0x1949('0x6')+_0x28b2b6,_0x5b01b9);ChatInternalMessageEvents['on'](_0x28b2b6,_0x3665b6);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 6dff398..fe0361b 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 _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0x1cf313,_0x76dda2){var _0xde7899=function(_0x9f04d4){while(--_0x9f04d4){_0x1cf313['push'](_0x1cf313['shift']());}};_0xde7899(++_0x76dda2);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'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['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file +var _0xa9e0=['destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./chatInternalMessage.controller','get','isAuthenticated','/describe','/users','/:id','show','post','delete'];(function(_0x1f0b46,_0x12b7d5){var _0x33fa37=function(_0x2ae698){while(--_0x2ae698){_0x1f0b46['push'](_0x1f0b46['shift']());}};_0x33fa37(++_0x12b7d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'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['getUsers']);router[_0x0a9e('0x7')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')]('/',auth[_0x0a9e('0x8')](),controller['create']);router['put']('/:id',controller['update']);router[_0x0a9e('0xe')](_0x0a9e('0xb'),auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xf')]);module[_0x0a9e('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index bad1b75..1f89f90 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 _0xd510=['TEXT','BOOLEAN','out','DATE','sequelize','exports'];(function(_0x3fbd2b,_0xdd55b5){var _0x4ca6cc=function(_0x46e57d){while(--_0x46e57d){_0x3fbd2b['push'](_0x3fbd2b['shift']());}};_0x4ca6cc(++_0xdd55b5);}(_0xd510,0xe2));var _0x0d51=function(_0x5f3f78,_0x214d16){_0x5f3f78=_0x5f3f78-0x0;var _0x9a71c0=_0xd510[_0x5f3f78];return _0x9a71c0;};'use strict';var Sequelize=require(_0x0d51('0x0'));module[_0x0d51('0x1')]={'body':{'type':Sequelize[_0x0d51('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize[_0x0d51('0x3')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x0d51('0x4')),'defaultValue':'out','allowNull':![]},'readAt':{'type':Sequelize[_0x0d51('0x5')]}}; \ No newline at end of file +var _0x65ad=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x65ad,0x8e));var _0xd65a=function(_0x3f94c7,_0x180a4c){_0x3f94c7=_0x3f94c7-0x0;var _0x357350=_0x65ad[_0x3f94c7];return _0x357350;};'use strict';var Sequelize=require(_0xd65a('0x0'));module[_0xd65a('0x1')]={'body':{'type':Sequelize[_0xd65a('0x2')](_0xd65a('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xd65a('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xd65a('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xd65a('0x5')]('in','out'),'defaultValue':_0xd65a('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0xd65a('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 56b27bb..eb62774 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 _0x01d8=['get','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','rejectmessage','html-pdf','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','pick','merge','VIRTUAL','filter','count','includeAll','ChatMessage','findAll','rows','show','params','include','options','find','create','body','describe','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','ChatInteraction','ChatInteractionId','read1stAt','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','acceptmessage','parse','formData'];(function(_0x24ae63,_0x17a4d0){var _0x407fef=function(_0x250cf1){while(--_0x250cf1){_0x24ae63['push'](_0x24ae63['shift']());}};_0x407fef(++_0x17a4d0);}(_0x01d8,0x81));var _0x801d=function(_0x5d225a,_0x2debe9){_0x5d225a=_0x5d225a-0x0;var _0x1e7761=_0x01d8[_0x5d225a];return _0x1e7761;};'use strict';var pdf=require(_0x801d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x801d('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x801d('0x2'));var moment=require(_0x801d('0x3'));var BPromise=require(_0x801d('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x801d('0x5'));var sox=require(_0x801d('0x6'));var csv=require(_0x801d('0x7'));var ejs=require(_0x801d('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x801d('0x9'));var crypto=require('crypto');var jsforce=require(_0x801d('0xa'));var deskjs=require(_0x801d('0xb'));var toCsv=require(_0x801d('0x7'));var querystring=require(_0x801d('0xc'));var Papa=require('papaparse');var Redis=require(_0x801d('0xd'));var authService=require(_0x801d('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x801d('0xf'))('api');var utils=require(_0x801d('0x10'));var config=require(_0x801d('0x11'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x801d('0x12')](config['redis'],{'host':_0x801d('0x13'),'port':0x18eb});var socket=require(_0x801d('0x14'))(new Redis(config[_0x801d('0x15')]));require('./chatMessage.socket')[_0x801d('0x16')](socket);var jayson=require(_0x801d('0x17'));var client=jayson[_0x801d('0x18')]['http']({'port':0x232c});var client9002=jayson['client'][_0x801d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x102b14,_0x17bf6a,_0x4e9cd9){if(_0x4e9cd9){var _0x32bbd9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32bbd9['test'](_0x17bf6a)){return _0x102b14;}else{throw new db[(_0x801d('0x1a'))][(_0x801d('0x1b'))](_0x801d('0x1c'));}}else{return _0x102b14;}}function respondWithRpcPromise(_0x3d92ef,_0x8b9582,_0x49277f,_0x43d26d){return new BPromise(function(_0x36e668,_0x35fd5c){var _0x44329e=_0x43d26d||client;return _0x44329e[_0x801d('0x1d')](_0x3d92ef,_0x49277f)[_0x801d('0x1e')](function(_0x4d8fc0){logger[_0x801d('0x1f')](_0x801d('0x20'),_0x8b9582,_0x801d('0x21'));logger[_0x801d('0x22')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x8b9582,_0x801d('0x21'),JSON[_0x801d('0x23')](_0x4d8fc0));if(_0x4d8fc0[_0x801d('0x24')]){if(_0x4d8fc0[_0x801d('0x24')][_0x801d('0x25')]===0x1f4){logger[_0x801d('0x24')](_0x801d('0x20'),_0x8b9582,_0x4d8fc0[_0x801d('0x24')][_0x801d('0x26')]);return _0x35fd5c(_0x4d8fc0['error']['message']);}logger[_0x801d('0x24')]('ChatMessage,\x20%s,\x20%s',_0x8b9582,_0x4d8fc0[_0x801d('0x24')][_0x801d('0x26')]);return _0x36e668(_0x4d8fc0[_0x801d('0x24')][_0x801d('0x26')]);}else{logger[_0x801d('0x1f')](_0x801d('0x20'),_0x8b9582,_0x801d('0x21'));_0x36e668(_0x4d8fc0[_0x801d('0x27')][_0x801d('0x26')]);}})[_0x801d('0x28')](function(_0x522bae){logger[_0x801d('0x24')](_0x801d('0x20'),_0x8b9582,_0x522bae);_0x35fd5c(_0x522bae);});});}function respondWithStatusCode(_0x55339e,_0x3f0afd){_0x3f0afd=_0x3f0afd||0xcc;return function(_0x13c831){if(_0x13c831){return _0x55339e[_0x801d('0x29')](_0x3f0afd);}return _0x55339e[_0x801d('0x2a')](_0x3f0afd)[_0x801d('0x2b')]();};}function respondWithResult(_0x447e69,_0x44c90f){_0x44c90f=_0x44c90f||0xc8;return function(_0x19e303){if(_0x19e303){return _0x447e69[_0x801d('0x2a')](_0x44c90f)[_0x801d('0x2c')](_0x19e303);}};}function respondWithFilteredResult(_0xf15a2b,_0x808f2c){return function(_0x5215c0){if(_0x5215c0){var _0x1d1707=_0x5215c0['count'],_0x11d24d=_0x808f2c[_0x801d('0x2d')],_0x3df85a=_0x808f2c[_0x801d('0x2d')]+_0x808f2c[_0x801d('0x2e')],_0x4f836c;if(_0x3df85a>=_0x1d1707){_0x3df85a=_0x1d1707;_0x4f836c=0xc8;}else{_0x4f836c=0xce;}_0xf15a2b['status'](_0x4f836c);return _0xf15a2b[_0x801d('0x2f')](_0x801d('0x30'),_0x11d24d+'-'+_0x3df85a+'/'+_0x1d1707)['json'](_0x5215c0);}return null;};}function patchUpdates(_0x25e196){return function(_0x4359a0){try{jsonpatch['apply'](_0x4359a0,_0x25e196,!![]);}catch(_0x44a5f5){return BPromise[_0x801d('0x31')](_0x44a5f5);}return _0x4359a0[_0x801d('0x32')]();};}function saveUpdates(_0x2b53bf,_0x9e8002){return function(_0x2934ac){if(_0x2934ac){return _0x2934ac[_0x801d('0x33')](_0x2b53bf)['then'](function(_0x58cc4b){return _0x58cc4b;});}return null;};}function removeEntity(_0x5cb7a5,_0x4f4e1b){return function(_0x5b4d8a){if(_0x5b4d8a){return _0x5b4d8a[_0x801d('0x34')]()[_0x801d('0x1e')](function(){_0x5cb7a5[_0x801d('0x2a')](0xcc)[_0x801d('0x2b')]();});}};}function handleEntityNotFound(_0x468f6e,_0x4fb762){return function(_0x9d6fff){if(!_0x9d6fff){_0x468f6e['sendStatus'](0x194);}return _0x9d6fff;};}function handleError(_0x3f67c7,_0x246553){_0x246553=_0x246553||0x1f4;return function(_0x35f040){logger['error'](_0x35f040[_0x801d('0x35')]);if(_0x35f040[_0x801d('0x36')]){delete _0x35f040[_0x801d('0x36')];}_0x3f67c7[_0x801d('0x2a')](_0x246553)[_0x801d('0x37')](_0x35f040);};}exports[_0x801d('0x38')]=function(_0x17d8ef,_0x380ae6){var _0x5d1de3={},_0x524946={},_0x3cbe3e={'count':0x0,'rows':[]};var _0xb39bfa=_['map'](db['ChatMessage'][_0x801d('0x39')],function(_0x510dcc){return{'name':_0x510dcc[_0x801d('0x3a')],'type':_0x510dcc[_0x801d('0x3b')][_0x801d('0x3c')]};});_0x524946[_0x801d('0x3d')]=_[_0x801d('0x3e')](_0xb39bfa,_0x801d('0x36'));_0x524946[_0x801d('0x3f')]=_[_0x801d('0x40')](_0x17d8ef['query']);_0x524946['filters']=_[_0x801d('0x41')](_0x524946['model'],_0x524946[_0x801d('0x3f')]);_0x5d1de3['attributes']=_[_0x801d('0x41')](_0x524946[_0x801d('0x3d')],qs[_0x801d('0x42')](_0x17d8ef['query'][_0x801d('0x42')]));_0x5d1de3['attributes']=_0x5d1de3[_0x801d('0x43')][_0x801d('0x44')]?_0x5d1de3['attributes']:_0x524946[_0x801d('0x3d')];if(!_0x17d8ef[_0x801d('0x3f')][_0x801d('0x45')]('nolimit')){_0x5d1de3[_0x801d('0x2e')]=qs[_0x801d('0x2e')](_0x17d8ef[_0x801d('0x3f')]['limit']);_0x5d1de3['offset']=qs['offset'](_0x17d8ef['query']['offset']);}_0x5d1de3[_0x801d('0x46')]=qs[_0x801d('0x47')](_0x17d8ef[_0x801d('0x3f')][_0x801d('0x47')]);_0x5d1de3[_0x801d('0x48')]=qs[_0x801d('0x49')](_[_0x801d('0x4a')](_0x17d8ef['query'],_0x524946['filters']));if(_0x17d8ef[_0x801d('0x3f')]['filter']){_0x5d1de3[_0x801d('0x48')]=_[_0x801d('0x4b')](_0x5d1de3[_0x801d('0x48')],{'$or':_[_0x801d('0x3e')](_0xb39bfa,function(_0x3bcd5b){if(_0x3bcd5b[_0x801d('0x3b')]!==_0x801d('0x4c')){var _0x737814={};_0x737814[_0x3bcd5b[_0x801d('0x36')]]={'$like':'%'+_0x17d8ef['query'][_0x801d('0x4d')]+'%'};return _0x737814;}})});}_0x5d1de3=_[_0x801d('0x4b')]({},_0x5d1de3,_0x17d8ef['options']);var _0x6d39cf={'where':_0x5d1de3[_0x801d('0x48')]};return db['ChatMessage'][_0x801d('0x4e')](_0x6d39cf)[_0x801d('0x1e')](function(_0x303d02){_0x3cbe3e[_0x801d('0x4e')]=_0x303d02;if(_0x17d8ef[_0x801d('0x3f')][_0x801d('0x4f')]){_0x5d1de3['include']=[{'all':!![]}];}return db[_0x801d('0x50')][_0x801d('0x51')](_0x5d1de3);})['then'](function(_0x70b2ed){_0x3cbe3e[_0x801d('0x52')]=_0x70b2ed;return _0x3cbe3e;})[_0x801d('0x1e')](respondWithFilteredResult(_0x380ae6,_0x5d1de3))[_0x801d('0x28')](handleError(_0x380ae6,null));};exports[_0x801d('0x53')]=function(_0x3e32b9,_0x2e053d){var _0x16e35f={'raw':!![],'where':{'id':_0x3e32b9[_0x801d('0x54')]['id']}},_0x3b56e5={};_0x3b56e5[_0x801d('0x3d')]=_[_0x801d('0x40')](db[_0x801d('0x50')][_0x801d('0x39')]);_0x3b56e5[_0x801d('0x3f')]=_[_0x801d('0x40')](_0x3e32b9['query']);_0x3b56e5[_0x801d('0x49')]=_[_0x801d('0x41')](_0x3b56e5[_0x801d('0x3d')],_0x3b56e5[_0x801d('0x3f')]);_0x16e35f[_0x801d('0x43')]=_[_0x801d('0x41')](_0x3b56e5[_0x801d('0x3d')],qs[_0x801d('0x42')](_0x3e32b9[_0x801d('0x3f')][_0x801d('0x42')]));_0x16e35f[_0x801d('0x43')]=_0x16e35f[_0x801d('0x43')][_0x801d('0x44')]?_0x16e35f[_0x801d('0x43')]:_0x3b56e5[_0x801d('0x3d')];if(_0x3e32b9['query'][_0x801d('0x4f')]){_0x16e35f[_0x801d('0x55')]=[{'all':!![]}];}_0x16e35f=_['merge']({},_0x16e35f,_0x3e32b9[_0x801d('0x56')]);return db[_0x801d('0x50')][_0x801d('0x57')](_0x16e35f)[_0x801d('0x1e')](handleEntityNotFound(_0x2e053d,null))[_0x801d('0x1e')](respondWithResult(_0x2e053d,null))[_0x801d('0x28')](handleError(_0x2e053d,null));};exports[_0x801d('0x58')]=function(_0x2dd5c8,_0x1a5492){return db[_0x801d('0x50')]['create'](_0x2dd5c8[_0x801d('0x59')],{})[_0x801d('0x1e')](respondWithResult(_0x1a5492,0xc9))[_0x801d('0x28')](handleError(_0x1a5492,null));};exports[_0x801d('0x33')]=function(_0x2782d4,_0x4d4b00){if(_0x2782d4[_0x801d('0x59')]['id']){delete _0x2782d4[_0x801d('0x59')]['id'];}return db[_0x801d('0x50')][_0x801d('0x57')]({'where':{'id':_0x2782d4[_0x801d('0x54')]['id']}})[_0x801d('0x1e')](handleEntityNotFound(_0x4d4b00,null))[_0x801d('0x1e')](saveUpdates(_0x2782d4['body'],null))[_0x801d('0x1e')](respondWithResult(_0x4d4b00,null))[_0x801d('0x28')](handleError(_0x4d4b00,null));};exports[_0x801d('0x34')]=function(_0x1317dd,_0xf749f0){return db[_0x801d('0x50')][_0x801d('0x57')]({'where':{'id':_0x1317dd[_0x801d('0x54')]['id']}})[_0x801d('0x1e')](handleEntityNotFound(_0xf749f0,null))['then'](removeEntity(_0xf749f0,null))[_0x801d('0x28')](handleError(_0xf749f0,null));};exports['describe']=function(_0x405603,_0x57151d){return db['ChatMessage'][_0x801d('0x5a')]()[_0x801d('0x1e')](respondWithResult(_0x57151d,null))['catch'](handleError(_0x57151d,null));};var interaction_log=require(_0x801d('0xf'))(_0x801d('0x5b'));exports[_0x801d('0x5c')]=function(_0x2baaae,_0x26ed38,_0x3a8834){var _0x3cab7c={'channel':_0x801d('0x5d')};if(_0x2baaae['body']['id']){delete _0x2baaae['body']['id'];}_0x2baaae[_0x801d('0x59')][_0x801d('0x5e')]=!![];_0x2baaae[_0x801d('0x59')][_0x801d('0x5f')]=moment()[_0x801d('0x60')](_0x801d('0x61'));_0x2baaae['body'][_0x801d('0x62')]=_0x2baaae[_0x801d('0x59')][_0x801d('0x62')]||_0x2baaae['user']['id'];return db['ChatMessage'][_0x801d('0x57')]({'where':{'id':_0x2baaae[_0x801d('0x54')]['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0x801d('0x63')}]})[_0x801d('0x1e')](handleEntityNotFound(_0x26ed38,null))['then'](saveUpdates(_0x2baaae[_0x801d('0x59')],null))[_0x801d('0x1e')](function(_0x2682e4){if(_0x2682e4){_0x3cab7c[_0x801d('0x26')]=_0x2682e4['get']({'plain':!![]});return db[_0x801d('0x64')][_0x801d('0x57')]({'where':{'id':_0x2682e4[_0x801d('0x65')]}});}return null;})[_0x801d('0x1e')](handleEntityNotFound(_0x26ed38,null))[_0x801d('0x1e')](function(_0x282027){if(_0x282027){return _0x282027[_0x801d('0x33')]({'UserId':_0x2baaae['body']['UserId'],'read1stAt':_['isNil'](_0x282027[_0x801d('0x66')])?moment()[_0x801d('0x60')](_0x801d('0x61')):undefined});}return null;})[_0x801d('0x1e')](function(_0x114af3){if(_0x114af3){_0x3cab7c[_0x801d('0x67')]=_0x114af3['get']({'plain':!![]});interaction_log[_0x801d('0x1f')](_0x801d('0x68'),_0x2baaae['user']['id'],_0x2baaae[_0x801d('0x69')][_0x801d('0x36')],_0x2baaae[_0x801d('0x69')]['role'],_0x3cab7c[_0x801d('0x67')]['id'],_0x2baaae[_0x801d('0x59')]?JSON['stringify'](_0x2baaae['body']):_0x801d('0x6a'));return respondWithRpcPromise(_0x801d('0x6b'),_0x801d('0x6c'),_0x3cab7c);}return null;})['then'](function(_0x155fcd){if(_0x155fcd){if(_0x2baaae[_0x801d('0x59')]['manual']){_0x3cab7c[_0x801d('0x26')][_0x801d('0x6d')]=util[_0x801d('0x60')](_0x801d('0x6e'),_0x2baaae[_0x801d('0x69')]['name']);_0x3cab7c[_0x801d('0x26')][_0x801d('0x6f')]=_0x3cab7c['channel'];_0x3cab7c[_0x801d('0x26')][_0x801d('0x70')]=_0x801d('0x5c');return respondWithRpcPromise(_0x801d('0x71'),'EventManager',{'event':_0x801d('0x72'),'message':_[_0x801d('0x4b')](_0x3cab7c[_0x801d('0x26')],JSON[_0x801d('0x73')](_0x3cab7c[_0x801d('0x67')][_0x801d('0x74')]))},client9002)['then'](function(){return _0x3cab7c;});}return _0x3cab7c;}return null;})['then'](respondWithResult(_0x26ed38,null))['catch'](handleError(_0x26ed38,null));};var interaction_log=require('../../config/logger')(_0x801d('0x5b'));exports[_0x801d('0x31')]=function(_0x18a0ed,_0x4ca6fb,_0x5d402a){var _0x501cda={'agent':{},'channel':_0x801d('0x5d')};if(_0x18a0ed['body']['id']){delete _0x18a0ed[_0x801d('0x59')]['id'];}_0x18a0ed[_0x801d('0x59')][_0x801d('0x62')]=_0x18a0ed[_0x801d('0x59')][_0x801d('0x62')]||_0x18a0ed[_0x801d('0x69')]['id'];_0x501cda['agent']['id']=_0x18a0ed[_0x801d('0x59')][_0x801d('0x62')];return db[_0x801d('0x50')][_0x801d('0x57')]({'where':{'id':_0x18a0ed[_0x801d('0x54')]['id'],'UserId':null}})[_0x801d('0x1e')](handleEntityNotFound(_0x4ca6fb,null))[_0x801d('0x1e')](function(_0x2e62b1){if(_0x2e62b1){_0x501cda[_0x801d('0x26')]=_0x2e62b1[_0x801d('0x75')]({'plain':!![]});return db[_0x801d('0x64')][_0x801d('0x57')]({'where':{'id':_0x2e62b1['ChatInteractionId']}});}return null;})[_0x801d('0x1e')](handleEntityNotFound(_0x4ca6fb,null))['then'](function(_0x34116a){if(_0x34116a){_0x501cda[_0x801d('0x67')]=_0x34116a['get']({'plain':!![]});interaction_log[_0x801d('0x1f')](_0x801d('0x76'),_0x18a0ed['user']['id'],_0x18a0ed[_0x801d('0x69')][_0x801d('0x36')],_0x18a0ed['user'][_0x801d('0x77')],_0x501cda[_0x801d('0x67')]['id'],_0x18a0ed['body']?JSON[_0x801d('0x23')](_0x18a0ed[_0x801d('0x59')]):_0x801d('0x6a'));return respondWithRpcPromise(_0x801d('0x78'),_0x801d('0x79'),_0x501cda);}return null;})[_0x801d('0x1e')](function(_0x26ac6c){if(_0x26ac6c){_0x26ac6c[_0x801d('0x26')]['interface']=util['format'](_0x801d('0x6e'),_0x18a0ed[_0x801d('0x69')][_0x801d('0x36')]);_0x26ac6c['message'][_0x801d('0x6f')]=_0x501cda[_0x801d('0x6f')];_0x26ac6c[_0x801d('0x26')][_0x801d('0x70')]='reject';respondWithRpcPromise(_0x801d('0x71'),_0x801d('0x71'),{'event':_0x801d('0x7a'),'message':_0x26ac6c[_0x801d('0x26')]},client9002);return _0x501cda;}return null;})[_0x801d('0x1e')](respondWithResult(_0x4ca6fb,null))['catch'](handleError(_0x4ca6fb,null));}; \ No newline at end of file +var _0xaa6b=['register','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','ChatMessage,\x20%s,\x20%s','message','request\x20sent','catch','sendStatus','status','json','count','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','type','key','model','map','query','intersection','fields','attributes','length','nolimit','offset','order','sort','filters','pick','filter','where','VIRTUAL','merge','ChatMessage','includeAll','include','rows','show','params','keys','rawAttributes','options','create','body','find','describe','chat-interactions','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','null','AcceptMessage','acceptMessage','manual','format','channel','event','EventManager','parse','formData','agent','SIP/%s','rejectmessage','eml-format','request-promise','moment','bluebird','util','path','sox','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','socket.io-emitter','./chatMessage.socket'];(function(_0x5a7d5f,_0x5695cb){var _0x5dcded=function(_0x13f053){while(--_0x13f053){_0x5a7d5f['push'](_0x5a7d5f['shift']());}};_0x5dcded(++_0x5695cb);}(_0xaa6b,0x1af));var _0xbaa6=function(_0x333df4,_0x587ae1){_0x333df4=_0x333df4-0x0;var _0x1a8f47=_0xaa6b[_0x333df4];return _0x1a8f47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbaa6('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbaa6('0x1'));var moment=require(_0xbaa6('0x2'));var BPromise=require(_0xbaa6('0x3'));var Mustache=require('mustache');var util=require(_0xbaa6('0x4'));var path=require(_0xbaa6('0x5'));var sox=require(_0xbaa6('0x6'));var csv=require('to-csv');var ejs=require(_0xbaa6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbaa6('0x8'));var crypto=require(_0xbaa6('0x9'));var jsforce=require(_0xbaa6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbaa6('0xb'));var Papa=require(_0xbaa6('0xc'));var Redis=require(_0xbaa6('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xbaa6('0xe'));var as=require(_0xbaa6('0xf'));var hardwareService=require(_0xbaa6('0x10'));var logger=require(_0xbaa6('0x11'))(_0xbaa6('0x12'));var utils=require(_0xbaa6('0x13'));var config=require(_0xbaa6('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xbaa6('0x15')](config[_0xbaa6('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xbaa6('0x17'))(new Redis(config['redis']));require(_0xbaa6('0x18'))[_0xbaa6('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0xbaa6('0x1a')]({'port':0x232c});var client9002=jayson['client'][_0xbaa6('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x13c91e,_0x6e25da,_0x4f811f){if(_0x4f811f){var _0x51f6c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x51f6c3[_0xbaa6('0x1b')](_0x6e25da)){return _0x13c91e;}else{throw new db[(_0xbaa6('0x1c'))][(_0xbaa6('0x1d'))](_0xbaa6('0x1e'));}}else{return _0x13c91e;}}function respondWithRpcPromise(_0x2e9668,_0x3ce6b4,_0x1b01b9,_0x5d01ff){return new BPromise(function(_0x29cde7,_0xa3543e){var _0x3bc9fe=_0x5d01ff||client;return _0x3bc9fe['request'](_0x2e9668,_0x1b01b9)[_0xbaa6('0x1f')](function(_0x171bb9){logger[_0xbaa6('0x20')]('ChatMessage,\x20%s,\x20%s',_0x3ce6b4,'request\x20sent');logger['debug'](_0xbaa6('0x21'),_0x3ce6b4,'request\x20sent',JSON[_0xbaa6('0x22')](_0x171bb9));if(_0x171bb9[_0xbaa6('0x23')]){if(_0x171bb9[_0xbaa6('0x23')][_0xbaa6('0x24')]===0x1f4){logger[_0xbaa6('0x23')](_0xbaa6('0x25'),_0x3ce6b4,_0x171bb9[_0xbaa6('0x23')]['message']);return _0xa3543e(_0x171bb9[_0xbaa6('0x23')][_0xbaa6('0x26')]);}logger['error'](_0xbaa6('0x25'),_0x3ce6b4,_0x171bb9[_0xbaa6('0x23')]['message']);return _0x29cde7(_0x171bb9['error'][_0xbaa6('0x26')]);}else{logger[_0xbaa6('0x20')](_0xbaa6('0x25'),_0x3ce6b4,_0xbaa6('0x27'));_0x29cde7(_0x171bb9['result'][_0xbaa6('0x26')]);}})[_0xbaa6('0x28')](function(_0x1b0237){logger[_0xbaa6('0x23')]('ChatMessage,\x20%s,\x20%s',_0x3ce6b4,_0x1b0237);_0xa3543e(_0x1b0237);});});}function respondWithStatusCode(_0x280768,_0x476403){_0x476403=_0x476403||0xcc;return function(_0x59b92c){if(_0x59b92c){return _0x280768[_0xbaa6('0x29')](_0x476403);}return _0x280768[_0xbaa6('0x2a')](_0x476403)['end']();};}function respondWithResult(_0x48ebc2,_0x452b9b){_0x452b9b=_0x452b9b||0xc8;return function(_0x54f279){if(_0x54f279){return _0x48ebc2[_0xbaa6('0x2a')](_0x452b9b)[_0xbaa6('0x2b')](_0x54f279);}};}function respondWithFilteredResult(_0x39d59a,_0xd667c4){return function(_0x17ff99){if(_0x17ff99){var _0x430535=_0x17ff99[_0xbaa6('0x2c')],_0x5df6cc=_0xd667c4['offset'],_0x3a2672=_0xd667c4['offset']+_0xd667c4[_0xbaa6('0x2d')],_0x31ee12;if(_0x3a2672>=_0x430535){_0x3a2672=_0x430535;_0x31ee12=0xc8;}else{_0x31ee12=0xce;}_0x39d59a[_0xbaa6('0x2a')](_0x31ee12);return _0x39d59a['set'](_0xbaa6('0x2e'),_0x5df6cc+'-'+_0x3a2672+'/'+_0x430535)['json'](_0x17ff99);}return null;};}function patchUpdates(_0x360eb1){return function(_0x29c2ae){try{jsonpatch[_0xbaa6('0x2f')](_0x29c2ae,_0x360eb1,!![]);}catch(_0xc20ca4){return BPromise[_0xbaa6('0x30')](_0xc20ca4);}return _0x29c2ae[_0xbaa6('0x31')]();};}function saveUpdates(_0x2d9752,_0x4c1b73){return function(_0x42400c){if(_0x42400c){return _0x42400c[_0xbaa6('0x32')](_0x2d9752)[_0xbaa6('0x1f')](function(_0x87ac14){return _0x87ac14;});}return null;};}function removeEntity(_0x326504,_0x590edc){return function(_0x1ccbab){if(_0x1ccbab){return _0x1ccbab[_0xbaa6('0x33')]()['then'](function(){_0x326504[_0xbaa6('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27e7e4,_0x4d0017){return function(_0x44dccb){if(!_0x44dccb){_0x27e7e4[_0xbaa6('0x29')](0x194);}return _0x44dccb;};}function handleError(_0x4b53e9,_0x4859f1){_0x4859f1=_0x4859f1||0x1f4;return function(_0xee20af){logger[_0xbaa6('0x23')](_0xee20af[_0xbaa6('0x34')]);if(_0xee20af['name']){delete _0xee20af[_0xbaa6('0x35')];}_0x4b53e9[_0xbaa6('0x2a')](_0x4859f1)[_0xbaa6('0x36')](_0xee20af);};}exports['index']=function(_0x5235b6,_0x384ada){var _0x107546={},_0x23d965={},_0x1e33e4={'count':0x0,'rows':[]};var _0x4b04e3=_['map'](db['ChatMessage']['rawAttributes'],function(_0x154853){return{'name':_0x154853['fieldName'],'type':_0x154853[_0xbaa6('0x37')][_0xbaa6('0x38')]};});_0x23d965[_0xbaa6('0x39')]=_[_0xbaa6('0x3a')](_0x4b04e3,'name');_0x23d965[_0xbaa6('0x3b')]=_['keys'](_0x5235b6[_0xbaa6('0x3b')]);_0x23d965['filters']=_[_0xbaa6('0x3c')](_0x23d965[_0xbaa6('0x39')],_0x23d965[_0xbaa6('0x3b')]);_0x107546['attributes']=_[_0xbaa6('0x3c')](_0x23d965[_0xbaa6('0x39')],qs[_0xbaa6('0x3d')](_0x5235b6['query'][_0xbaa6('0x3d')]));_0x107546[_0xbaa6('0x3e')]=_0x107546[_0xbaa6('0x3e')][_0xbaa6('0x3f')]?_0x107546[_0xbaa6('0x3e')]:_0x23d965[_0xbaa6('0x39')];if(!_0x5235b6[_0xbaa6('0x3b')]['hasOwnProperty'](_0xbaa6('0x40'))){_0x107546[_0xbaa6('0x2d')]=qs[_0xbaa6('0x2d')](_0x5235b6[_0xbaa6('0x3b')]['limit']);_0x107546[_0xbaa6('0x41')]=qs[_0xbaa6('0x41')](_0x5235b6[_0xbaa6('0x3b')][_0xbaa6('0x41')]);}_0x107546[_0xbaa6('0x42')]=qs['sort'](_0x5235b6[_0xbaa6('0x3b')][_0xbaa6('0x43')]);_0x107546['where']=qs[_0xbaa6('0x44')](_[_0xbaa6('0x45')](_0x5235b6[_0xbaa6('0x3b')],_0x23d965[_0xbaa6('0x44')]));if(_0x5235b6[_0xbaa6('0x3b')][_0xbaa6('0x46')]){_0x107546[_0xbaa6('0x47')]=_['merge'](_0x107546['where'],{'$or':_[_0xbaa6('0x3a')](_0x4b04e3,function(_0x47d92e){if(_0x47d92e[_0xbaa6('0x37')]!==_0xbaa6('0x48')){var _0x4cceff={};_0x4cceff[_0x47d92e[_0xbaa6('0x35')]]={'$like':'%'+_0x5235b6[_0xbaa6('0x3b')]['filter']+'%'};return _0x4cceff;}})});}_0x107546=_[_0xbaa6('0x49')]({},_0x107546,_0x5235b6['options']);var _0x31bf76={'where':_0x107546['where']};return db[_0xbaa6('0x4a')]['count'](_0x31bf76)['then'](function(_0x2f25fc){_0x1e33e4[_0xbaa6('0x2c')]=_0x2f25fc;if(_0x5235b6[_0xbaa6('0x3b')][_0xbaa6('0x4b')]){_0x107546[_0xbaa6('0x4c')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x107546);})[_0xbaa6('0x1f')](function(_0x504239){_0x1e33e4[_0xbaa6('0x4d')]=_0x504239;return _0x1e33e4;})['then'](respondWithFilteredResult(_0x384ada,_0x107546))['catch'](handleError(_0x384ada,null));};exports[_0xbaa6('0x4e')]=function(_0x33e956,_0xb8536c){var _0x440d46={'raw':!![],'where':{'id':_0x33e956[_0xbaa6('0x4f')]['id']}},_0x33c3b1={};_0x33c3b1[_0xbaa6('0x39')]=_[_0xbaa6('0x50')](db[_0xbaa6('0x4a')][_0xbaa6('0x51')]);_0x33c3b1['query']=_[_0xbaa6('0x50')](_0x33e956[_0xbaa6('0x3b')]);_0x33c3b1[_0xbaa6('0x44')]=_[_0xbaa6('0x3c')](_0x33c3b1[_0xbaa6('0x39')],_0x33c3b1[_0xbaa6('0x3b')]);_0x440d46[_0xbaa6('0x3e')]=_[_0xbaa6('0x3c')](_0x33c3b1[_0xbaa6('0x39')],qs['fields'](_0x33e956[_0xbaa6('0x3b')][_0xbaa6('0x3d')]));_0x440d46[_0xbaa6('0x3e')]=_0x440d46[_0xbaa6('0x3e')][_0xbaa6('0x3f')]?_0x440d46['attributes']:_0x33c3b1[_0xbaa6('0x39')];if(_0x33e956[_0xbaa6('0x3b')][_0xbaa6('0x4b')]){_0x440d46[_0xbaa6('0x4c')]=[{'all':!![]}];}_0x440d46=_[_0xbaa6('0x49')]({},_0x440d46,_0x33e956[_0xbaa6('0x52')]);return db['ChatMessage']['find'](_0x440d46)[_0xbaa6('0x1f')](handleEntityNotFound(_0xb8536c,null))[_0xbaa6('0x1f')](respondWithResult(_0xb8536c,null))[_0xbaa6('0x28')](handleError(_0xb8536c,null));};exports['create']=function(_0x3563cc,_0x17a558){return db[_0xbaa6('0x4a')][_0xbaa6('0x53')](_0x3563cc[_0xbaa6('0x54')],{})[_0xbaa6('0x1f')](respondWithResult(_0x17a558,0xc9))[_0xbaa6('0x28')](handleError(_0x17a558,null));};exports[_0xbaa6('0x32')]=function(_0x3c7b21,_0x5bbdcb){if(_0x3c7b21['body']['id']){delete _0x3c7b21[_0xbaa6('0x54')]['id'];}return db[_0xbaa6('0x4a')][_0xbaa6('0x55')]({'where':{'id':_0x3c7b21[_0xbaa6('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5bbdcb,null))['then'](saveUpdates(_0x3c7b21['body'],null))[_0xbaa6('0x1f')](respondWithResult(_0x5bbdcb,null))[_0xbaa6('0x28')](handleError(_0x5bbdcb,null));};exports['destroy']=function(_0x187c6a,_0x1e9b37){return db['ChatMessage'][_0xbaa6('0x55')]({'where':{'id':_0x187c6a[_0xbaa6('0x4f')]['id']}})[_0xbaa6('0x1f')](handleEntityNotFound(_0x1e9b37,null))[_0xbaa6('0x1f')](removeEntity(_0x1e9b37,null))[_0xbaa6('0x28')](handleError(_0x1e9b37,null));};exports[_0xbaa6('0x56')]=function(_0x5a2a51,_0x49a528){return db[_0xbaa6('0x4a')][_0xbaa6('0x56')]()['then'](respondWithResult(_0x49a528,null))[_0xbaa6('0x28')](handleError(_0x49a528,null));};var interaction_log=require(_0xbaa6('0x11'))(_0xbaa6('0x57'));exports[_0xbaa6('0x58')]=function(_0x248a73,_0x16fb01,_0x55ea5b){var _0x23013b={'channel':'chat'};if(_0x248a73['body']['id']){delete _0x248a73[_0xbaa6('0x54')]['id'];}_0x248a73['body']['read']=!![];_0x248a73[_0xbaa6('0x54')][_0xbaa6('0x59')]=moment()['format'](_0xbaa6('0x5a'));_0x248a73['body'][_0xbaa6('0x5b')]=_0x248a73[_0xbaa6('0x54')]['UserId']||_0x248a73[_0xbaa6('0x5c')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x248a73['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':'Contact'}]})[_0xbaa6('0x1f')](handleEntityNotFound(_0x16fb01,null))['then'](saveUpdates(_0x248a73[_0xbaa6('0x54')],null))[_0xbaa6('0x1f')](function(_0x30d85f){if(_0x30d85f){_0x23013b['message']=_0x30d85f[_0xbaa6('0x5d')]({'plain':!![]});return db[_0xbaa6('0x5e')][_0xbaa6('0x55')]({'where':{'id':_0x30d85f[_0xbaa6('0x5f')]}});}return null;})[_0xbaa6('0x1f')](handleEntityNotFound(_0x16fb01,null))[_0xbaa6('0x1f')](function(_0x187665){if(_0x187665){return _0x187665['update']({'UserId':_0x248a73[_0xbaa6('0x54')][_0xbaa6('0x5b')],'read1stAt':_[_0xbaa6('0x60')](_0x187665[_0xbaa6('0x61')])?moment()['format'](_0xbaa6('0x5a')):undefined});}return null;})[_0xbaa6('0x1f')](function(_0x34a534){if(_0x34a534){_0x23013b['interaction']=_0x34a534[_0xbaa6('0x5d')]({'plain':!![]});interaction_log[_0xbaa6('0x20')](_0xbaa6('0x62'),_0x248a73[_0xbaa6('0x5c')]['id'],_0x248a73[_0xbaa6('0x5c')][_0xbaa6('0x35')],_0x248a73[_0xbaa6('0x5c')][_0xbaa6('0x63')],_0x23013b[_0xbaa6('0x64')]['id'],_0x248a73[_0xbaa6('0x54')]?JSON[_0xbaa6('0x22')](_0x248a73[_0xbaa6('0x54')]):_0xbaa6('0x65'));return respondWithRpcPromise(_0xbaa6('0x66'),_0xbaa6('0x67'),_0x23013b);}return null;})[_0xbaa6('0x1f')](function(_0x3aae0f){if(_0x3aae0f){if(_0x248a73[_0xbaa6('0x54')][_0xbaa6('0x68')]){_0x23013b[_0xbaa6('0x26')]['interface']=util[_0xbaa6('0x69')]('SIP/%s',_0x248a73[_0xbaa6('0x5c')][_0xbaa6('0x35')]);_0x23013b[_0xbaa6('0x26')][_0xbaa6('0x6a')]=_0x23013b['channel'];_0x23013b[_0xbaa6('0x26')][_0xbaa6('0x6b')]=_0xbaa6('0x58');return respondWithRpcPromise(_0xbaa6('0x6c'),_0xbaa6('0x6c'),{'event':'acceptmessage','message':_[_0xbaa6('0x49')](_0x23013b['message'],JSON[_0xbaa6('0x6d')](_0x23013b[_0xbaa6('0x64')][_0xbaa6('0x6e')]))},client9002)[_0xbaa6('0x1f')](function(){return _0x23013b;});}return _0x23013b;}return null;})['then'](respondWithResult(_0x16fb01,null))[_0xbaa6('0x28')](handleError(_0x16fb01,null));};var interaction_log=require(_0xbaa6('0x11'))('chat-interactions');exports[_0xbaa6('0x30')]=function(_0x11072b,_0x2cda39,_0x4b1fa4){var _0x32796d={'agent':{},'channel':'chat'};if(_0x11072b['body']['id']){delete _0x11072b['body']['id'];}_0x11072b[_0xbaa6('0x54')][_0xbaa6('0x5b')]=_0x11072b['body']['UserId']||_0x11072b[_0xbaa6('0x5c')]['id'];_0x32796d[_0xbaa6('0x6f')]['id']=_0x11072b['body']['UserId'];return db[_0xbaa6('0x4a')][_0xbaa6('0x55')]({'where':{'id':_0x11072b['params']['id'],'UserId':null}})[_0xbaa6('0x1f')](handleEntityNotFound(_0x2cda39,null))[_0xbaa6('0x1f')](function(_0x50ed65){if(_0x50ed65){_0x32796d[_0xbaa6('0x26')]=_0x50ed65['get']({'plain':!![]});return db[_0xbaa6('0x5e')][_0xbaa6('0x55')]({'where':{'id':_0x50ed65[_0xbaa6('0x5f')]}});}return null;})[_0xbaa6('0x1f')](handleEntityNotFound(_0x2cda39,null))[_0xbaa6('0x1f')](function(_0x4fb134){if(_0x4fb134){_0x32796d[_0xbaa6('0x64')]=_0x4fb134['get']({'plain':!![]});interaction_log[_0xbaa6('0x20')]('[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x11072b[_0xbaa6('0x5c')]['id'],_0x11072b['user']['name'],_0x11072b['user'][_0xbaa6('0x63')],_0x32796d[_0xbaa6('0x64')]['id'],_0x11072b[_0xbaa6('0x54')]?JSON[_0xbaa6('0x22')](_0x11072b['body']):_0xbaa6('0x65'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0x32796d);}return null;})[_0xbaa6('0x1f')](function(_0x2ffd63){if(_0x2ffd63){_0x2ffd63[_0xbaa6('0x26')]['interface']=util[_0xbaa6('0x69')](_0xbaa6('0x70'),_0x11072b['user'][_0xbaa6('0x35')]);_0x2ffd63[_0xbaa6('0x26')]['channel']=_0x32796d[_0xbaa6('0x6a')];_0x2ffd63['message'][_0xbaa6('0x6b')]=_0xbaa6('0x30');respondWithRpcPromise(_0xbaa6('0x6c'),_0xbaa6('0x6c'),{'event':_0xbaa6('0x71'),'message':_0x2ffd63[_0xbaa6('0x26')]},client9002);return _0x32796d;}return null;})[_0xbaa6('0x1f')](respondWithResult(_0x2cda39,null))[_0xbaa6('0x28')](handleError(_0x2cda39,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 88d37a5..4561dfe 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 _0xb818=['exports','events','ChatMessage','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x1f5d94,_0x3d59c5){var _0x6565ab=function(_0x39dfb1){while(--_0x39dfb1){_0x1f5d94['push'](_0x1f5d94['shift']());}};_0x6565ab(++_0x3d59c5);}(_0xb818,0xb5));var _0x8b81=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xb818[_0x4e676e];return _0x336a3c;};'use strict';var EventEmitter=require(_0x8b81('0x0'));var ChatMessage=require('../../mysqldb')['db'][_0x8b81('0x1')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x8b81('0x2'),'afterUpdate':_0x8b81('0x3'),'afterDestroy':_0x8b81('0x4')};function emitEvent(_0x3adfef){return function(_0x299cd5,_0x15508f,_0xe7b434){ChatMessageEvents[_0x8b81('0x5')](_0x3adfef+':'+_0x299cd5['id'],_0x299cd5);ChatMessageEvents[_0x8b81('0x5')](_0x3adfef,_0x299cd5);_0xe7b434(null);};}for(var e in events){if(events[_0x8b81('0x6')](e)){var event=events[e];ChatMessage[_0x8b81('0x7')](e,emitEvent(event));}}module[_0x8b81('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x8ca9=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','ChatMessage','setMaxListeners','save','update'];(function(_0xf40c8c,_0x26e1bd){var _0x3dbdd8=function(_0x191109){while(--_0x191109){_0xf40c8c['push'](_0xf40c8c['shift']());}};_0x3dbdd8(++_0x26e1bd);}(_0x8ca9,0x7c));var _0x98ca=function(_0x325b84,_0x549f57){_0x325b84=_0x325b84-0x0;var _0x1f7b96=_0x8ca9[_0x325b84];return _0x1f7b96;};'use strict';var EventEmitter=require(_0x98ca('0x0'));var ChatMessage=require(_0x98ca('0x1'))['db'][_0x98ca('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x98ca('0x3')](0x0);var events={'afterCreate':_0x98ca('0x4'),'afterUpdate':_0x98ca('0x5'),'afterDestroy':_0x98ca('0x6')};function emitEvent(_0x2968e2){return function(_0x2ac642,_0x2f3745,_0x41fe8e){ChatMessageEvents[_0x98ca('0x7')](_0x2968e2+':'+_0x2ac642['id'],_0x2ac642);ChatMessageEvents[_0x98ca('0x7')](_0x2968e2,_0x2ac642);_0x41fe8e(null);};}for(var e in events){if(events[_0x98ca('0x8')](e)){var event=events[e];ChatMessage[_0x98ca('0x9')](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 6d44fd4..3d5cbb6 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 _0x6c33=['path','rimraf','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','ChatInteraction','findOne','then','update','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird'];(function(_0x282e83,_0x2f7930){var _0xc51c8b=function(_0x15ed76){while(--_0x15ed76){_0x282e83['push'](_0x282e83['shift']());}};_0xc51c8b(++_0x2f7930);}(_0x6c33,0x1d7));var _0x36c3=function(_0xfa847c,_0x444a8c){_0xfa847c=_0xfa847c-0x0;var _0x3b22bf=_0x6c33[_0xfa847c];return _0x3b22bf;};'use strict';var _=require(_0x36c3('0x0'));var util=require(_0x36c3('0x1'));var logger=require('../../config/logger')(_0x36c3('0x2'));var moment=require(_0x36c3('0x3'));var BPromise=require(_0x36c3('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x36c3('0x5'));var rimraf=require(_0x36c3('0x6'));var config=require('../../config/environment');var attributes=require(_0x36c3('0x7'));module[_0x36c3('0x8')]=function(_0x1a704b,_0x172c36){return _0x1a704b['define'](_0x36c3('0x9'),attributes,{'tableName':_0x36c3('0xa'),'paranoid':![],'indexes':[{'name':_0x36c3('0xb'),'fields':[_0x36c3('0xc')],'type':_0x36c3('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1fff42,_0x10579e,_0x187d18){var _0x21400b=_0x1a704b[_0x36c3('0xe')];var _0x2f2992=_0x1fff42[_0x36c3('0xf')]({'plain':!![]});if(_0x2f2992[_0x36c3('0x10')][_0x36c3('0x11')]()==='in'||_0x2f2992['direction'][_0x36c3('0x11')]()===_0x36c3('0x12')&&!_0x2f2992[_0x36c3('0x13')]&&!_['isNil'](_0x2f2992[_0x36c3('0x14')])){_0x21400b[_0x36c3('0x15')][_0x36c3('0x16')]({'where':{'id':_0x2f2992['ChatInteractionId']}})[_0x36c3('0x17')](function(_0x10ce72){if(_0x10ce72){_0x10ce72[_0x36c3('0x18')]({'lastMsgAt':_0x2f2992['createdAt'],'lastMsgDirection':_0x2f2992[_0x36c3('0x10')][_0x36c3('0x11')]()});}})[_0x36c3('0x19')](function(_0x3b5d63){console['error'](_0x3b5d63);});}_0x187d18();}},'charset':_0x36c3('0x1a'),'collate':_0x36c3('0x1b')});}; \ No newline at end of file +var _0x2535=['direction','toLowerCase','secret','isNil','ChatInteraction','ChatInteractionId','then','update','createdAt','catch','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','ChatMessage','chat_messages','fti_chat_messages','body','FULLTEXT','models','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x2535,0xc0));var _0x5253=function(_0x1a4d8,_0x1bd69c){_0x1a4d8=_0x1a4d8-0x0;var _0x35fdd7=_0x2535[_0x1a4d8];return _0x35fdd7;};'use strict';var _=require('lodash');var util=require(_0x5253('0x0'));var logger=require('../../config/logger')(_0x5253('0x1'));var moment=require(_0x5253('0x2'));var BPromise=require(_0x5253('0x3'));var rp=require(_0x5253('0x4'));var fs=require('fs');var path=require(_0x5253('0x5'));var rimraf=require(_0x5253('0x6'));var config=require(_0x5253('0x7'));var attributes=require(_0x5253('0x8'));module['exports']=function(_0x2f01e2,_0x44b42b){return _0x2f01e2['define'](_0x5253('0x9'),attributes,{'tableName':_0x5253('0xa'),'paranoid':![],'indexes':[{'name':_0x5253('0xb'),'fields':[_0x5253('0xc')],'type':_0x5253('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x560d43,_0x6e16af,_0x2e952f){var _0x3fd63a=_0x2f01e2[_0x5253('0xe')];var _0x2d7ae3=_0x560d43[_0x5253('0xf')]({'plain':!![]});if(_0x2d7ae3[_0x5253('0x10')][_0x5253('0x11')]()==='in'||_0x2d7ae3[_0x5253('0x10')][_0x5253('0x11')]()==='out'&&!_0x2d7ae3[_0x5253('0x12')]&&!_[_0x5253('0x13')](_0x2d7ae3['UserId'])){_0x3fd63a[_0x5253('0x14')]['findOne']({'where':{'id':_0x2d7ae3[_0x5253('0x15')]}})[_0x5253('0x16')](function(_0x2c89cf){if(_0x2c89cf){_0x2c89cf[_0x5253('0x17')]({'lastMsgAt':_0x2d7ae3[_0x5253('0x18')],'lastMsgDirection':_0x2d7ae3[_0x5253('0x10')][_0x5253('0x11')]()});}})[_0x5253('0x19')](function(_0x1d23c8){console['error'](_0x1d23c8);});}_0x2e952f();}},'charset':'utf8mb4','collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 108e660..e03be87 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 _0x00d2=['code','ChatMessage,\x20%s,\x20%s','error','message','result','catch','CreateChatMessage','create','options','raw','stringify','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./chatMessage.socket','request','then','info','request\x20sent','debug'];(function(_0x2eec1f,_0x1b9987){var _0x543075=function(_0x5792d2){while(--_0x5792d2){_0x2eec1f['push'](_0x2eec1f['shift']());}};_0x543075(++_0x1b9987);}(_0x00d2,0x16b));var _0x200d=function(_0x3fbeea,_0x59b594){_0x3fbeea=_0x3fbeea-0x0;var _0x479753=_0x00d2[_0x3fbeea];return _0x479753;};'use strict';var _=require(_0x200d('0x0'));var util=require(_0x200d('0x1'));var moment=require(_0x200d('0x2'));var BPromise=require('bluebird');var rs=require(_0x200d('0x3'));var fs=require('fs');var Redis=require(_0x200d('0x4'));var db=require(_0x200d('0x5'))['db'];var utils=require(_0x200d('0x6'));var logger=require(_0x200d('0x7'))(_0x200d('0x8'));var config=require(_0x200d('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x200d('0xa')][_0x200d('0xb')]({'port':0x232a});config[_0x200d('0xc')]=_[_0x200d('0xd')](config[_0x200d('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x200d('0xe'))(new Redis(config[_0x200d('0xc')]));require(_0x200d('0xf'))['register'](socket);function respondWithRpcPromise(_0x3fe82d,_0x2aaf9d,_0x3a38ec){return new BPromise(function(_0x89b432,_0x55321d){return client[_0x200d('0x10')](_0x3fe82d,_0x3a38ec)[_0x200d('0x11')](function(_0x4444dd){logger[_0x200d('0x12')]('ChatMessage,\x20%s,\x20%s',_0x2aaf9d,_0x200d('0x13'));logger[_0x200d('0x14')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2aaf9d,_0x200d('0x13'),JSON['stringify'](_0x4444dd));if(_0x4444dd['error']){if(_0x4444dd['error'][_0x200d('0x15')]===0x1f4){logger['error'](_0x200d('0x16'),_0x2aaf9d,_0x4444dd[_0x200d('0x17')]['message']);return _0x55321d(_0x4444dd[_0x200d('0x17')][_0x200d('0x18')]);}logger[_0x200d('0x17')](_0x200d('0x16'),_0x2aaf9d,_0x4444dd['error'][_0x200d('0x18')]);return _0x89b432(_0x4444dd['error'][_0x200d('0x18')]);}else{logger[_0x200d('0x12')](_0x200d('0x16'),_0x2aaf9d,_0x200d('0x13'));_0x89b432(_0x4444dd[_0x200d('0x19')]['message']);}})[_0x200d('0x1a')](function(_0xcedf80){logger[_0x200d('0x17')](_0x200d('0x16'),_0x2aaf9d,_0xcedf80);_0x55321d(_0xcedf80);});});}exports[_0x200d('0x1b')]=function(_0x59ea64){var _0x3a1b85=this;return new Promise(function(_0x1c75ac,_0x303ff8){return db['ChatMessage'][_0x200d('0x1c')](_0x59ea64['body'],{'raw':_0x59ea64[_0x200d('0x1d')]?_0x59ea64['options'][_0x200d('0x1e')]===undefined?!![]:![]:!![]})[_0x200d('0x11')](function(_0x5f2baf){logger[_0x200d('0x12')](_0x200d('0x1b'),_0x59ea64);logger[_0x200d('0x14')](_0x200d('0x1b'),_0x59ea64,JSON[_0x200d('0x1f')](_0x5f2baf));_0x1c75ac(_0x5f2baf);})['catch'](function(_0x59ca06){logger['error'](_0x200d('0x1b'),_0x59ca06[_0x200d('0x18')],_0x59ea64);_0x303ff8(_0x3a1b85[_0x200d('0x17')](0x1f4,_0x59ca06[_0x200d('0x18')]));});});}; \ No newline at end of file +var _0x9111=['error','code','message','result','catch','CreateChatMessage','create','body','options','raw','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','ChatMessage,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x119d25,_0x588c8){var _0x39cf30=function(_0x31c68c){while(--_0x31c68c){_0x119d25['push'](_0x119d25['shift']());}};_0x39cf30(++_0x588c8);}(_0x9111,0x1a2));var _0x1911=function(_0x248012,_0x5661b4){_0x248012=_0x248012-0x0;var _0x58a12d=_0x9111[_0x248012];return _0x58a12d;};'use strict';var _=require(_0x1911('0x0'));var util=require(_0x1911('0x1'));var moment=require(_0x1911('0x2'));var BPromise=require(_0x1911('0x3'));var rs=require(_0x1911('0x4'));var fs=require('fs');var Redis=require(_0x1911('0x5'));var db=require(_0x1911('0x6'))['db'];var utils=require(_0x1911('0x7'));var logger=require(_0x1911('0x8'))(_0x1911('0x9'));var config=require(_0x1911('0xa'));var jayson=require(_0x1911('0xb'));var client=jayson[_0x1911('0xc')][_0x1911('0xd')]({'port':0x232a});config[_0x1911('0xe')]=_[_0x1911('0xf')](config[_0x1911('0xe')],{'host':_0x1911('0x10'),'port':0x18eb});var socket=require(_0x1911('0x11'))(new Redis(config[_0x1911('0xe')]));require(_0x1911('0x12'))['register'](socket);function respondWithRpcPromise(_0x122e0a,_0x6912a4,_0x29cd64){return new BPromise(function(_0x5e0ef9,_0xa2519d){return client[_0x1911('0x13')](_0x122e0a,_0x29cd64)[_0x1911('0x14')](function(_0x31226d){logger[_0x1911('0x15')](_0x1911('0x16'),_0x6912a4,_0x1911('0x17'));logger['debug'](_0x1911('0x18'),_0x6912a4,_0x1911('0x17'),JSON[_0x1911('0x19')](_0x31226d));if(_0x31226d['error']){if(_0x31226d[_0x1911('0x1a')][_0x1911('0x1b')]===0x1f4){logger[_0x1911('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x6912a4,_0x31226d['error'][_0x1911('0x1c')]);return _0xa2519d(_0x31226d[_0x1911('0x1a')][_0x1911('0x1c')]);}logger[_0x1911('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x6912a4,_0x31226d['error'][_0x1911('0x1c')]);return _0x5e0ef9(_0x31226d[_0x1911('0x1a')]['message']);}else{logger['info'](_0x1911('0x16'),_0x6912a4,_0x1911('0x17'));_0x5e0ef9(_0x31226d[_0x1911('0x1d')][_0x1911('0x1c')]);}})[_0x1911('0x1e')](function(_0x6efec2){logger[_0x1911('0x1a')]('ChatMessage,\x20%s,\x20%s',_0x6912a4,_0x6efec2);_0xa2519d(_0x6efec2);});});}exports[_0x1911('0x1f')]=function(_0x1bdc42){var _0x3b30a9=this;return new Promise(function(_0x5ccb32,_0x53bf12){return db['ChatMessage'][_0x1911('0x20')](_0x1bdc42[_0x1911('0x21')],{'raw':_0x1bdc42[_0x1911('0x22')]?_0x1bdc42['options'][_0x1911('0x23')]===undefined?!![]:![]:!![]})[_0x1911('0x14')](function(_0x319886){logger[_0x1911('0x15')](_0x1911('0x1f'),_0x1bdc42);logger[_0x1911('0x24')](_0x1911('0x1f'),_0x1bdc42,JSON[_0x1911('0x19')](_0x319886));_0x5ccb32(_0x319886);})[_0x1911('0x1e')](function(_0x1c741f){logger[_0x1911('0x1a')](_0x1911('0x1f'),_0x1c741f[_0x1911('0x1c')],_0x1bdc42);_0x53bf12(_0x3b30a9[_0x1911('0x1a')](0x1f4,_0x1c741f[_0x1911('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index bb69bb1..2b70ce9 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 _0x4991=['length','chatMessage:','./chatMessage.events','remove','emit','removeListener','register'];(function(_0x28e78d,_0xbe1472){var _0x174e75=function(_0x42de79){while(--_0x42de79){_0x28e78d['push'](_0x28e78d['shift']());}};_0x174e75(++_0xbe1472);}(_0x4991,0xf7));var _0x1499=function(_0x10763b,_0x93c06a){_0x10763b=_0x10763b-0x0;var _0x10744b=_0x4991[_0x10763b];return _0x10744b;};'use strict';var ChatMessageEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){ChatMessageEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);ChatMessageEvents['on'](_0x33b261,_0x133bae);}}; \ No newline at end of file +var _0x33af=['emit','removeListener','register','length','chatMessage:','save','update'];(function(_0x4f6dab,_0x21c0cc){var _0x50a282=function(_0x3ed6b9){while(--_0x3ed6b9){_0x4f6dab['push'](_0x4f6dab['shift']());}};_0x50a282(++_0x21c0cc);}(_0x33af,0xec));var _0xf33a=function(_0x308bc6,_0x564ec7){_0x308bc6=_0x308bc6-0x0;var _0x422fcf=_0x33af[_0x308bc6];return _0x422fcf;};'use strict';var ChatMessageEvents=require('./chatMessage.events');var events=[_0xf33a('0x0'),'remove',_0xf33a('0x1')];function createListener(_0x1111c6,_0x267057){return function(_0x4303f1){_0x267057[_0xf33a('0x2')](_0x1111c6,_0x4303f1);};}function removeListener(_0x25f156,_0x4c734e){return function(){ChatMessageEvents[_0xf33a('0x3')](_0x25f156,_0x4c734e);};}exports[_0xf33a('0x4')]=function(_0x583e54){for(var _0xc0dd13=0x0,_0x384b14=events[_0xf33a('0x5')];_0xc0dd13<_0x384b14;_0xc0dd13++){var _0x2f3730=events[_0xc0dd13];var _0x2baabb=createListener(_0xf33a('0x6')+_0x2f3730,_0x583e54);ChatMessageEvents['on'](_0x2f3730,_0x2baabb);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index 0d3aa5d..c96e7e7 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 _0x90a6=['/describe','/:id','show','post','tracked','chat','chatmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','connect-timeout','express','../../components/auth/service','../../config/environment','get','isAuthenticated'];(function(_0x42db98,_0x5126a7){var _0x48b8d5=function(_0x4d6510){while(--_0x4d6510){_0x42db98['push'](_0x42db98['shift']());}};_0x48b8d5(++_0x5126a7);}(_0x90a6,0x148));var _0x690a=function(_0x20d9a7,_0x3ecb87){_0x20d9a7=_0x20d9a7-0x0;var _0xc7cfc3=_0x90a6[_0x20d9a7];return _0xc7cfc3;};'use strict';var multer=require(_0x690a('0x0'));var util=require(_0x690a('0x1'));var path=require('path');var timeout=require(_0x690a('0x2'));var express=require(_0x690a('0x3'));var router=express['Router']();var auth=require(_0x690a('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x690a('0x5'));var controller=require('./chatMessage.controller');router[_0x690a('0x6')]('/',auth[_0x690a('0x7')](),controller['index']);router['get'](_0x690a('0x8'),auth[_0x690a('0x7')](),controller['describe']);router['get'](_0x690a('0x9'),auth[_0x690a('0x7')](),controller[_0x690a('0xa')]);router[_0x690a('0xb')]('/',auth[_0x690a('0x7')](),interaction[_0x690a('0xc')](_0x690a('0xd'),_0x690a('0xe')),controller[_0x690a('0xf')]);router[_0x690a('0x10')](_0x690a('0x9'),controller[_0x690a('0x11')]);router[_0x690a('0x10')](_0x690a('0x12'),auth[_0x690a('0x7')](),controller[_0x690a('0x13')]);router[_0x690a('0x10')](_0x690a('0x14'),auth[_0x690a('0x7')](),controller[_0x690a('0x15')]);router[_0x690a('0x16')](_0x690a('0x9'),auth[_0x690a('0x7')](),controller[_0x690a('0x17')]);module['exports']=router; \ No newline at end of file +var _0x03c6=['../../config/environment','./chatMessage.controller','isAuthenticated','get','describe','chatmessage:create','create','/:id','update','/:id/accept','accept','put','/:id/reject','reject','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x4c4146,_0x2a7a4e){var _0x512edc=function(_0x4aebb0){while(--_0x4aebb0){_0x4c4146['push'](_0x4c4146['shift']());}};_0x512edc(++_0x2a7a4e);}(_0x03c6,0x7e));var _0x603c=function(_0x1f4218,_0x1abc63){_0x1f4218=_0x1f4218-0x0;var _0x40a28c=_0x03c6[_0x1f4218];return _0x40a28c;};'use strict';var multer=require(_0x603c('0x0'));var util=require('util');var path=require(_0x603c('0x1'));var timeout=require(_0x603c('0x2'));var express=require(_0x603c('0x3'));var router=express['Router']();var auth=require(_0x603c('0x4'));var interaction=require(_0x603c('0x5'));var config=require(_0x603c('0x6'));var controller=require(_0x603c('0x7'));router['get']('/',auth[_0x603c('0x8')](),controller['index']);router[_0x603c('0x9')]('/describe',auth[_0x603c('0x8')](),controller[_0x603c('0xa')]);router[_0x603c('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x603c('0x8')](),interaction['tracked']('chat',_0x603c('0xb')),controller[_0x603c('0xc')]);router['put'](_0x603c('0xd'),controller[_0x603c('0xe')]);router['put'](_0x603c('0xf'),auth[_0x603c('0x8')](),controller[_0x603c('0x10')]);router[_0x603c('0x11')](_0x603c('0x12'),auth['isAuthenticated'](),controller[_0x603c('0x13')]);router[_0x603c('0x14')](_0x603c('0xd'),auth['isAuthenticated'](),controller[_0x603c('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index 80835d3..52fa0d9 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 _0x403b=['medium','exports'];(function(_0x486130,_0x5c2e01){var _0x353877=function(_0x5bcf64){while(--_0x5bcf64){_0x486130['push'](_0x486130['shift']());}};_0x353877(++_0x5c2e01);}(_0x403b,0xd1));var _0xb403=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x403b[_0x122ef9];return _0x42fba0;};'use strict';var Sequelize=require('sequelize');module[_0xb403('0x0')]={'body':{'type':Sequelize['TEXT'](_0xb403('0x1')),'allowNull':![]}}; \ No newline at end of file +var _0x204e=['exports','TEXT','medium','sequelize'];(function(_0x544ac9,_0x16bfa6){var _0x1c7212=function(_0x3c0263){while(--_0x3c0263){_0x544ac9['push'](_0x544ac9['shift']());}};_0x1c7212(++_0x16bfa6);}(_0x204e,0x107));var _0xe204=function(_0x504c33,_0x31dbac){_0x504c33=_0x504c33-0x0;var _0x4bb4b1=_0x204e[_0x504c33];return _0x4bb4b1;};'use strict';var Sequelize=require(_0xe204('0x0'));module[_0xe204('0x1')]={'body':{'type':Sequelize[_0xe204('0x2')](_0xe204('0x3')),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index 3c486b9..14de9cb 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 _0xf48b=['request-promise','util','path','to-csv','lodash','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','params','options','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x5b1d80,_0x4230ba){var _0x4f344c=function(_0x50d40b){while(--_0x50d40b){_0x5b1d80['push'](_0x5b1d80['shift']());}};_0x4f344c(++_0x4230ba);}(_0xf48b,0x86));var _0xbf48=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xf48b[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xbf48('0x0'));var emlformat=require(_0xbf48('0x1'));var rimraf=require(_0xbf48('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xbf48('0x3'));var rp=require(_0xbf48('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbf48('0x5'));var path=require(_0xbf48('0x6'));var sox=require('sox');var csv=require(_0xbf48('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbf48('0x8'));var squel=require('squel');var crypto=require(_0xbf48('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xbf48('0xa'));var toCsv=require('to-csv');var querystring=require(_0xbf48('0xb'));var Papa=require(_0xbf48('0xc'));var Redis=require('ioredis');var authService=require(_0xbf48('0xd'));var qs=require(_0xbf48('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf48('0xf'));var utils=require(_0xbf48('0x10'));var config=require(_0xbf48('0x11'));var db=require(_0xbf48('0x12'))['db'];function respondWithStatusCode(_0x43b41b,_0x39d0b4){_0x39d0b4=_0x39d0b4||0xcc;return function(_0xea2696){if(_0xea2696){return _0x43b41b[_0xbf48('0x13')](_0x39d0b4);}return _0x43b41b[_0xbf48('0x14')](_0x39d0b4)[_0xbf48('0x15')]();};}function respondWithResult(_0x15ec68,_0x13dac8){_0x13dac8=_0x13dac8||0xc8;return function(_0x2ca009){if(_0x2ca009){return _0x15ec68['status'](_0x13dac8)[_0xbf48('0x16')](_0x2ca009);}};}function respondWithFilteredResult(_0x44872b,_0x2fbcf5){return function(_0x131593){if(_0x131593){var _0x4167cd=_0x131593[_0xbf48('0x17')],_0x154193=_0x2fbcf5['offset'],_0x5053b5=_0x2fbcf5[_0xbf48('0x18')]+_0x2fbcf5[_0xbf48('0x19')],_0x26c079;if(_0x5053b5>=_0x4167cd){_0x5053b5=_0x4167cd;_0x26c079=0xc8;}else{_0x26c079=0xce;}_0x44872b[_0xbf48('0x14')](_0x26c079);return _0x44872b[_0xbf48('0x1a')](_0xbf48('0x1b'),_0x154193+'-'+_0x5053b5+'/'+_0x4167cd)[_0xbf48('0x16')](_0x131593);}return null;};}function patchUpdates(_0x884a82){return function(_0x381c36){try{jsonpatch[_0xbf48('0x1c')](_0x381c36,_0x884a82,!![]);}catch(_0xbad007){return BPromise[_0xbf48('0x1d')](_0xbad007);}return _0x381c36[_0xbf48('0x1e')]();};}function saveUpdates(_0x5aadac,_0x5af618){return function(_0x13e5c3){if(_0x13e5c3){return _0x13e5c3[_0xbf48('0x1f')](_0x5aadac)[_0xbf48('0x20')](function(_0x5a93a6){return _0x5a93a6;});}return null;};}function removeEntity(_0x2946f0,_0x51003c){return function(_0x15f645){if(_0x15f645){return _0x15f645['destroy']()[_0xbf48('0x20')](function(){_0x2946f0[_0xbf48('0x14')](0xcc)['end']();});}};}function handleEntityNotFound(_0x55262e,_0x462671){return function(_0x363272){if(!_0x363272){_0x55262e[_0xbf48('0x13')](0x194);}return _0x363272;};}function handleError(_0x36421e,_0x5d9e5c){_0x5d9e5c=_0x5d9e5c||0x1f4;return function(_0x340bfc){logger[_0xbf48('0x21')](_0x340bfc[_0xbf48('0x22')]);if(_0x340bfc[_0xbf48('0x23')]){delete _0x340bfc['name'];}_0x36421e['status'](_0x5d9e5c)['send'](_0x340bfc);};}exports['index']=function(_0x564c9c,_0x16e81b){var _0x2ce329={},_0x41583b={},_0x2cd696={'count':0x0,'rows':[]};var _0x523e7d=_['map'](db[_0xbf48('0x24')][_0xbf48('0x25')],function(_0x2507d4){return{'name':_0x2507d4[_0xbf48('0x26')],'type':_0x2507d4[_0xbf48('0x27')][_0xbf48('0x28')]};});_0x41583b[_0xbf48('0x29')]=_[_0xbf48('0x2a')](_0x523e7d,_0xbf48('0x23'));_0x41583b['query']=_[_0xbf48('0x2b')](_0x564c9c[_0xbf48('0x2c')]);_0x41583b[_0xbf48('0x2d')]=_[_0xbf48('0x2e')](_0x41583b[_0xbf48('0x29')],_0x41583b[_0xbf48('0x2c')]);_0x2ce329[_0xbf48('0x2f')]=_[_0xbf48('0x2e')](_0x41583b['model'],qs[_0xbf48('0x30')](_0x564c9c[_0xbf48('0x2c')][_0xbf48('0x30')]));_0x2ce329[_0xbf48('0x2f')]=_0x2ce329[_0xbf48('0x2f')][_0xbf48('0x31')]?_0x2ce329[_0xbf48('0x2f')]:_0x41583b[_0xbf48('0x29')];if(!_0x564c9c[_0xbf48('0x2c')][_0xbf48('0x32')](_0xbf48('0x33'))){_0x2ce329['limit']=qs['limit'](_0x564c9c[_0xbf48('0x2c')][_0xbf48('0x19')]);_0x2ce329[_0xbf48('0x18')]=qs[_0xbf48('0x18')](_0x564c9c[_0xbf48('0x2c')]['offset']);}_0x2ce329[_0xbf48('0x34')]=qs[_0xbf48('0x35')](_0x564c9c['query'][_0xbf48('0x35')]);_0x2ce329[_0xbf48('0x36')]=qs[_0xbf48('0x2d')](_[_0xbf48('0x37')](_0x564c9c[_0xbf48('0x2c')],_0x41583b['filters']));if(_0x564c9c['query'][_0xbf48('0x38')]){_0x2ce329[_0xbf48('0x36')]=_[_0xbf48('0x39')](_0x2ce329[_0xbf48('0x36')],{'$or':_[_0xbf48('0x2a')](_0x523e7d,function(_0x55034e){if(_0x55034e[_0xbf48('0x27')]!==_0xbf48('0x3a')){var _0x2541eb={};_0x2541eb[_0x55034e['name']]={'$like':'%'+_0x564c9c[_0xbf48('0x2c')][_0xbf48('0x38')]+'%'};return _0x2541eb;}})});}_0x2ce329=_[_0xbf48('0x39')]({},_0x2ce329,_0x564c9c['options']);var _0x1d80c9={'where':_0x2ce329[_0xbf48('0x36')]};return db[_0xbf48('0x24')][_0xbf48('0x17')](_0x1d80c9)[_0xbf48('0x20')](function(_0x4e95b1){_0x2cd696[_0xbf48('0x17')]=_0x4e95b1;if(_0x564c9c[_0xbf48('0x2c')][_0xbf48('0x3b')]){_0x2ce329[_0xbf48('0x3c')]=[{'all':!![]}];}return db['ChatOfflineMessage']['findAll'](_0x2ce329);})[_0xbf48('0x20')](function(_0xa91562){_0x2cd696[_0xbf48('0x3d')]=_0xa91562;return _0x2cd696;})[_0xbf48('0x20')](respondWithFilteredResult(_0x16e81b,_0x2ce329))[_0xbf48('0x3e')](handleError(_0x16e81b,null));};exports['show']=function(_0x5aad0c,_0x3ff735){var _0x3c9a99={'raw':!![],'where':{'id':_0x5aad0c[_0xbf48('0x3f')]['id']}},_0x733130={};_0x733130[_0xbf48('0x29')]=_[_0xbf48('0x2b')](db[_0xbf48('0x24')][_0xbf48('0x25')]);_0x733130[_0xbf48('0x2c')]=_[_0xbf48('0x2b')](_0x5aad0c[_0xbf48('0x2c')]);_0x733130[_0xbf48('0x2d')]=_[_0xbf48('0x2e')](_0x733130[_0xbf48('0x29')],_0x733130[_0xbf48('0x2c')]);_0x3c9a99[_0xbf48('0x2f')]=_[_0xbf48('0x2e')](_0x733130[_0xbf48('0x29')],qs[_0xbf48('0x30')](_0x5aad0c[_0xbf48('0x2c')]['fields']));_0x3c9a99['attributes']=_0x3c9a99['attributes'][_0xbf48('0x31')]?_0x3c9a99[_0xbf48('0x2f')]:_0x733130['model'];if(_0x5aad0c[_0xbf48('0x2c')][_0xbf48('0x3b')]){_0x3c9a99['include']=[{'all':!![]}];}_0x3c9a99=_[_0xbf48('0x39')]({},_0x3c9a99,_0x5aad0c[_0xbf48('0x40')]);return db[_0xbf48('0x24')][_0xbf48('0x41')](_0x3c9a99)[_0xbf48('0x20')](handleEntityNotFound(_0x3ff735,null))[_0xbf48('0x20')](respondWithResult(_0x3ff735,null))[_0xbf48('0x3e')](handleError(_0x3ff735,null));};exports[_0xbf48('0x42')]=function(_0x11a869,_0x42d61e){return db[_0xbf48('0x24')][_0xbf48('0x42')](_0x11a869[_0xbf48('0x43')],{})[_0xbf48('0x20')](respondWithResult(_0x42d61e,0xc9))[_0xbf48('0x3e')](handleError(_0x42d61e,null));};exports[_0xbf48('0x1f')]=function(_0x3f4fcf,_0x23fcc0){if(_0x3f4fcf[_0xbf48('0x43')]['id']){delete _0x3f4fcf['body']['id'];}return db[_0xbf48('0x24')][_0xbf48('0x41')]({'where':{'id':_0x3f4fcf[_0xbf48('0x3f')]['id']}})[_0xbf48('0x20')](handleEntityNotFound(_0x23fcc0,null))[_0xbf48('0x20')](saveUpdates(_0x3f4fcf[_0xbf48('0x43')],null))[_0xbf48('0x20')](respondWithResult(_0x23fcc0,null))[_0xbf48('0x3e')](handleError(_0x23fcc0,null));};exports['destroy']=function(_0x2b50eb,_0x3315cd){return db[_0xbf48('0x24')][_0xbf48('0x41')]({'where':{'id':_0x2b50eb[_0xbf48('0x3f')]['id']}})[_0xbf48('0x20')](handleEntityNotFound(_0x3315cd,null))[_0xbf48('0x20')](removeEntity(_0x3315cd,null))[_0xbf48('0x3e')](handleError(_0x3315cd,null));};exports[_0xbf48('0x44')]=function(_0x525f6c,_0xcb31d4){return db[_0xbf48('0x24')][_0xbf48('0x44')]()[_0xbf48('0x20')](respondWithResult(_0xcb31d4,null))[_0xbf48('0x3e')](handleError(_0xcb31d4,null));}; \ No newline at end of file +var _0x7f31=['pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','params','model','keys','catch','create','body','find','describe','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','update','then','destroy','stack','name','send','ChatOfflineMessage','rawAttributes','key','query','filters','intersection','fields','attributes','length','nolimit','order','sort','where'];(function(_0x5712a5,_0x23820b){var _0x224288=function(_0x86b731){while(--_0x86b731){_0x5712a5['push'](_0x5712a5['shift']());}};_0x224288(++_0x23820b);}(_0x7f31,0x9a));var _0x17f3=function(_0x1559a5,_0x41924e){_0x1559a5=_0x1559a5-0x0;var _0x17a783=_0x7f31[_0x1559a5];return _0x17a783;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x17f3('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x17f3('0x1'));var rp=require(_0x17f3('0x2'));var moment=require(_0x17f3('0x3'));var BPromise=require(_0x17f3('0x4'));var Mustache=require(_0x17f3('0x5'));var util=require(_0x17f3('0x6'));var path=require('path');var sox=require(_0x17f3('0x7'));var csv=require(_0x17f3('0x8'));var ejs=require(_0x17f3('0x9'));var fs=require('fs');var _=require(_0x17f3('0xa'));var squel=require(_0x17f3('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x17f3('0xc'));var toCsv=require(_0x17f3('0x8'));var querystring=require(_0x17f3('0xd'));var Papa=require(_0x17f3('0xe'));var Redis=require(_0x17f3('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17f3('0x10'));var logger=require(_0x17f3('0x11'))(_0x17f3('0x12'));var utils=require(_0x17f3('0x13'));var config=require(_0x17f3('0x14'));var db=require(_0x17f3('0x15'))['db'];function respondWithStatusCode(_0x2b05a8,_0x1f26d7){_0x1f26d7=_0x1f26d7||0xcc;return function(_0x5cd26d){if(_0x5cd26d){return _0x2b05a8[_0x17f3('0x16')](_0x1f26d7);}return _0x2b05a8[_0x17f3('0x17')](_0x1f26d7)[_0x17f3('0x18')]();};}function respondWithResult(_0x25ac0f,_0x1cf0c4){_0x1cf0c4=_0x1cf0c4||0xc8;return function(_0x692c22){if(_0x692c22){return _0x25ac0f[_0x17f3('0x17')](_0x1cf0c4)[_0x17f3('0x19')](_0x692c22);}};}function respondWithFilteredResult(_0x3131e4,_0xc044ef){return function(_0x504e6f){if(_0x504e6f){var _0x5a1557=_0x504e6f[_0x17f3('0x1a')],_0x44c647=_0xc044ef[_0x17f3('0x1b')],_0x13b4c8=_0xc044ef[_0x17f3('0x1b')]+_0xc044ef[_0x17f3('0x1c')],_0x430415;if(_0x13b4c8>=_0x5a1557){_0x13b4c8=_0x5a1557;_0x430415=0xc8;}else{_0x430415=0xce;}_0x3131e4[_0x17f3('0x17')](_0x430415);return _0x3131e4[_0x17f3('0x1d')]('Content-Range',_0x44c647+'-'+_0x13b4c8+'/'+_0x5a1557)[_0x17f3('0x19')](_0x504e6f);}return null;};}function patchUpdates(_0xa4e1bf){return function(_0x58c4de){try{jsonpatch['apply'](_0x58c4de,_0xa4e1bf,!![]);}catch(_0x1a1890){return BPromise['reject'](_0x1a1890);}return _0x58c4de[_0x17f3('0x1e')]();};}function saveUpdates(_0x1e0862,_0x5e80e8){return function(_0x46839b){if(_0x46839b){return _0x46839b[_0x17f3('0x1f')](_0x1e0862)[_0x17f3('0x20')](function(_0x2e93bc){return _0x2e93bc;});}return null;};}function removeEntity(_0x2569c4,_0x4d4728){return function(_0x46cbde){if(_0x46cbde){return _0x46cbde[_0x17f3('0x21')]()['then'](function(){_0x2569c4[_0x17f3('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x23a7b6,_0x40b31d){return function(_0x220232){if(!_0x220232){_0x23a7b6[_0x17f3('0x16')](0x194);}return _0x220232;};}function handleError(_0x2a5f90,_0xfb8e2a){_0xfb8e2a=_0xfb8e2a||0x1f4;return function(_0x50d639){logger['error'](_0x50d639[_0x17f3('0x22')]);if(_0x50d639[_0x17f3('0x23')]){delete _0x50d639[_0x17f3('0x23')];}_0x2a5f90[_0x17f3('0x17')](_0xfb8e2a)[_0x17f3('0x24')](_0x50d639);};}exports['index']=function(_0x1f6925,_0x4a2504){var _0x5ab438={},_0x2bf290={},_0xd0d9bc={'count':0x0,'rows':[]};var _0x325596=_['map'](db[_0x17f3('0x25')][_0x17f3('0x26')],function(_0x1ffa16){return{'name':_0x1ffa16['fieldName'],'type':_0x1ffa16['type'][_0x17f3('0x27')]};});_0x2bf290['model']=_['map'](_0x325596,_0x17f3('0x23'));_0x2bf290[_0x17f3('0x28')]=_['keys'](_0x1f6925[_0x17f3('0x28')]);_0x2bf290[_0x17f3('0x29')]=_[_0x17f3('0x2a')](_0x2bf290['model'],_0x2bf290['query']);_0x5ab438['attributes']=_[_0x17f3('0x2a')](_0x2bf290['model'],qs[_0x17f3('0x2b')](_0x1f6925[_0x17f3('0x28')][_0x17f3('0x2b')]));_0x5ab438[_0x17f3('0x2c')]=_0x5ab438[_0x17f3('0x2c')][_0x17f3('0x2d')]?_0x5ab438[_0x17f3('0x2c')]:_0x2bf290['model'];if(!_0x1f6925[_0x17f3('0x28')]['hasOwnProperty'](_0x17f3('0x2e'))){_0x5ab438[_0x17f3('0x1c')]=qs['limit'](_0x1f6925[_0x17f3('0x28')][_0x17f3('0x1c')]);_0x5ab438[_0x17f3('0x1b')]=qs[_0x17f3('0x1b')](_0x1f6925['query'][_0x17f3('0x1b')]);}_0x5ab438[_0x17f3('0x2f')]=qs['sort'](_0x1f6925['query'][_0x17f3('0x30')]);_0x5ab438[_0x17f3('0x31')]=qs[_0x17f3('0x29')](_[_0x17f3('0x32')](_0x1f6925['query'],_0x2bf290[_0x17f3('0x29')]));if(_0x1f6925[_0x17f3('0x28')][_0x17f3('0x33')]){_0x5ab438[_0x17f3('0x31')]=_[_0x17f3('0x34')](_0x5ab438['where'],{'$or':_[_0x17f3('0x35')](_0x325596,function(_0x337feb){if(_0x337feb['type']!==_0x17f3('0x36')){var _0x803cc3={};_0x803cc3[_0x337feb[_0x17f3('0x23')]]={'$like':'%'+_0x1f6925[_0x17f3('0x28')][_0x17f3('0x33')]+'%'};return _0x803cc3;}})});}_0x5ab438=_['merge']({},_0x5ab438,_0x1f6925[_0x17f3('0x37')]);var _0x104118={'where':_0x5ab438[_0x17f3('0x31')]};return db[_0x17f3('0x25')][_0x17f3('0x1a')](_0x104118)['then'](function(_0x5bb823){_0xd0d9bc[_0x17f3('0x1a')]=_0x5bb823;if(_0x1f6925[_0x17f3('0x28')][_0x17f3('0x38')]){_0x5ab438[_0x17f3('0x39')]=[{'all':!![]}];}return db[_0x17f3('0x25')][_0x17f3('0x3a')](_0x5ab438);})[_0x17f3('0x20')](function(_0x98d37b){_0xd0d9bc[_0x17f3('0x3b')]=_0x98d37b;return _0xd0d9bc;})[_0x17f3('0x20')](respondWithFilteredResult(_0x4a2504,_0x5ab438))['catch'](handleError(_0x4a2504,null));};exports['show']=function(_0xa87197,_0x177a06){var _0x4c6de8={'raw':!![],'where':{'id':_0xa87197[_0x17f3('0x3c')]['id']}},_0x5c27cd={};_0x5c27cd[_0x17f3('0x3d')]=_['keys'](db['ChatOfflineMessage'][_0x17f3('0x26')]);_0x5c27cd['query']=_[_0x17f3('0x3e')](_0xa87197[_0x17f3('0x28')]);_0x5c27cd[_0x17f3('0x29')]=_[_0x17f3('0x2a')](_0x5c27cd[_0x17f3('0x3d')],_0x5c27cd[_0x17f3('0x28')]);_0x4c6de8['attributes']=_[_0x17f3('0x2a')](_0x5c27cd[_0x17f3('0x3d')],qs[_0x17f3('0x2b')](_0xa87197['query'][_0x17f3('0x2b')]));_0x4c6de8[_0x17f3('0x2c')]=_0x4c6de8[_0x17f3('0x2c')][_0x17f3('0x2d')]?_0x4c6de8[_0x17f3('0x2c')]:_0x5c27cd[_0x17f3('0x3d')];if(_0xa87197[_0x17f3('0x28')][_0x17f3('0x38')]){_0x4c6de8[_0x17f3('0x39')]=[{'all':!![]}];}_0x4c6de8=_['merge']({},_0x4c6de8,_0xa87197['options']);return db[_0x17f3('0x25')]['find'](_0x4c6de8)[_0x17f3('0x20')](handleEntityNotFound(_0x177a06,null))[_0x17f3('0x20')](respondWithResult(_0x177a06,null))[_0x17f3('0x3f')](handleError(_0x177a06,null));};exports[_0x17f3('0x40')]=function(_0x1bd63c,_0xe7c24c){return db[_0x17f3('0x25')][_0x17f3('0x40')](_0x1bd63c[_0x17f3('0x41')],{})['then'](respondWithResult(_0xe7c24c,0xc9))[_0x17f3('0x3f')](handleError(_0xe7c24c,null));};exports[_0x17f3('0x1f')]=function(_0x3a6ada,_0x37c733){if(_0x3a6ada[_0x17f3('0x41')]['id']){delete _0x3a6ada['body']['id'];}return db[_0x17f3('0x25')][_0x17f3('0x42')]({'where':{'id':_0x3a6ada[_0x17f3('0x3c')]['id']}})[_0x17f3('0x20')](handleEntityNotFound(_0x37c733,null))[_0x17f3('0x20')](saveUpdates(_0x3a6ada[_0x17f3('0x41')],null))[_0x17f3('0x20')](respondWithResult(_0x37c733,null))[_0x17f3('0x3f')](handleError(_0x37c733,null));};exports[_0x17f3('0x21')]=function(_0x4579ff,_0x5dc491){return db[_0x17f3('0x25')][_0x17f3('0x42')]({'where':{'id':_0x4579ff['params']['id']}})['then'](handleEntityNotFound(_0x5dc491,null))[_0x17f3('0x20')](removeEntity(_0x5dc491,null))[_0x17f3('0x3f')](handleError(_0x5dc491,null));};exports[_0x17f3('0x43')]=function(_0x36d94e,_0x475fd7){return db[_0x17f3('0x25')][_0x17f3('0x43')]()['then'](respondWithResult(_0x475fd7,null))[_0x17f3('0x3f')](handleError(_0x475fd7,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 33b5f90..f9d54a4 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 _0xb66c=['rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','define','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','bluebird','request-promise'];(function(_0x3eb713,_0x437874){var _0x1d7128=function(_0x2b9cea){while(--_0x2b9cea){_0x3eb713['push'](_0x3eb713['shift']());}};_0x1d7128(++_0x437874);}(_0xb66c,0x175));var _0xcb66=function(_0x46642d,_0x2ef741){_0x46642d=_0x46642d-0x0;var _0x3fbdd9=_0xb66c[_0x46642d];return _0x3fbdd9;};'use strict';var _=require(_0xcb66('0x0'));var util=require('util');var logger=require(_0xcb66('0x1'))('api');var moment=require(_0xcb66('0x2'));var BPromise=require(_0xcb66('0x3'));var rp=require(_0xcb66('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcb66('0x5'));var config=require(_0xcb66('0x6'));var attributes=require(_0xcb66('0x7'));module[_0xcb66('0x8')]=function(_0x5d766d,_0x518163){return _0x5d766d[_0xcb66('0x9')](_0xcb66('0xa'),attributes,{'tableName':_0xcb66('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xcb66('0xc'),'collate':_0xcb66('0xd')});}; \ No newline at end of file +var _0xe14d=['lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','exports','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x505c20,_0x308ce5){var _0x510480=function(_0x252427){while(--_0x252427){_0x505c20['push'](_0x505c20['shift']());}};_0x510480(++_0x308ce5);}(_0xe14d,0x1ee));var _0xde14=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0xe14d[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xde14('0x0'));var util=require(_0xde14('0x1'));var logger=require(_0xde14('0x2'))(_0xde14('0x3'));var moment=require('moment');var BPromise=require(_0xde14('0x4'));var rp=require(_0xde14('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xde14('0x6'));var config=require(_0xde14('0x7'));var attributes=require(_0xde14('0x8'));module[_0xde14('0x9')]=function(_0x461af3,_0xba1514){return _0x461af3['define']('ChatOfflineMessage',attributes,{'tableName':_0xde14('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xde14('0xb'),'collate':_0xde14('0xc')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index e75a291..da74be5 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 _0x6674=['rpc','client','http','request','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xc78832,_0x27a347){var _0x21753a=function(_0x2efa96){while(--_0x2efa96){_0xc78832['push'](_0xc78832['shift']());}};_0x21753a(++_0x27a347);}(_0x6674,0x66));var _0x4667=function(_0x11378f,_0x17d371){_0x11378f=_0x11378f-0x0;var _0x169ee6=_0x6674[_0x11378f];return _0x169ee6;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4667('0x0'));var BPromise=require(_0x4667('0x1'));var rs=require(_0x4667('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4667('0x3'))['db'];var utils=require(_0x4667('0x4'));var logger=require(_0x4667('0x5'))(_0x4667('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4667('0x7')][_0x4667('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3b3016,_0xa7cdd6,_0x91913d){return new BPromise(function(_0x301041,_0x452e57){return client[_0x4667('0x9')](_0x3b3016,_0x91913d)['then'](function(_0x55aff3){logger[_0x4667('0xa')](_0x4667('0xb'),_0xa7cdd6,_0x4667('0xc'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0xa7cdd6,'request\x20sent',JSON[_0x4667('0xd')](_0x55aff3));if(_0x55aff3[_0x4667('0xe')]){if(_0x55aff3[_0x4667('0xe')][_0x4667('0xf')]===0x1f4){logger[_0x4667('0xe')](_0x4667('0xb'),_0xa7cdd6,_0x55aff3[_0x4667('0xe')][_0x4667('0x10')]);return _0x452e57(_0x55aff3[_0x4667('0xe')]['message']);}logger[_0x4667('0xe')]('ChatOfflineMessage,\x20%s,\x20%s',_0xa7cdd6,_0x55aff3[_0x4667('0xe')][_0x4667('0x10')]);return _0x301041(_0x55aff3['error'][_0x4667('0x10')]);}else{logger[_0x4667('0xa')](_0x4667('0xb'),_0xa7cdd6,'request\x20sent');_0x301041(_0x55aff3['result'][_0x4667('0x10')]);}})[_0x4667('0x11')](function(_0x43c465){logger[_0x4667('0xe')](_0x4667('0xb'),_0xa7cdd6,_0x43c465);_0x452e57(_0x43c465);});});} \ No newline at end of file +var _0x6815=['rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','error','code','ChatOfflineMessage,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring','../../config/utils','../../config/logger'];(function(_0x4fbdc8,_0x265bdb){var _0x5dd79d=function(_0xe9d7c){while(--_0xe9d7c){_0x4fbdc8['push'](_0x4fbdc8['shift']());}};_0x5dd79d(++_0x265bdb);}(_0x6815,0x9a));var _0x5681=function(_0x3c3148,_0x4dec7d){_0x3c3148=_0x3c3148-0x0;var _0x4e8f5d=_0x6815[_0x3c3148];return _0x4e8f5d;};'use strict';var _=require(_0x5681('0x0'));var util=require(_0x5681('0x1'));var moment=require(_0x5681('0x2'));var BPromise=require('bluebird');var rs=require(_0x5681('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5681('0x4'));var logger=require(_0x5681('0x5'))(_0x5681('0x6'));var config=require(_0x5681('0x7'));var jayson=require(_0x5681('0x8'));var client=jayson[_0x5681('0x9')][_0x5681('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf7d8f,_0x57c26a,_0x6fa4ab){return new BPromise(function(_0x5daf56,_0x132b1a){return client[_0x5681('0xb')](_0xf7d8f,_0x6fa4ab)['then'](function(_0xa67bc){logger[_0x5681('0xc')]('ChatOfflineMessage,\x20%s,\x20%s',_0x57c26a,_0x5681('0xd'));logger['debug'](_0x5681('0xe'),_0x57c26a,_0x5681('0xd'),JSON['stringify'](_0xa67bc));if(_0xa67bc['error']){if(_0xa67bc[_0x5681('0xf')][_0x5681('0x10')]===0x1f4){logger[_0x5681('0xf')](_0x5681('0x11'),_0x57c26a,_0xa67bc[_0x5681('0xf')]['message']);return _0x132b1a(_0xa67bc[_0x5681('0xf')]['message']);}logger[_0x5681('0xf')](_0x5681('0x11'),_0x57c26a,_0xa67bc[_0x5681('0xf')][_0x5681('0x12')]);return _0x5daf56(_0xa67bc[_0x5681('0xf')][_0x5681('0x12')]);}else{logger['info'](_0x5681('0x11'),_0x57c26a,_0x5681('0xd'));_0x5daf56(_0xa67bc['result']['message']);}})[_0x5681('0x13')](function(_0x510e63){logger[_0x5681('0xf')](_0x5681('0x11'),_0x57c26a,_0x510e63);_0x132b1a(_0x510e63);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 4f9830f..a1d00f8 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 _0x004c=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatOfflineMessage.controller','get','index','/describe','/:id','isAuthenticated','post','create','put','update','destroy','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x004c,0xc8));var _0xc004=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x004c[_0x1a72f3];return _0x57ef47;};'use strict';var multer=require(_0xc004('0x0'));var util=require(_0xc004('0x1'));var path=require(_0xc004('0x2'));var timeout=require(_0xc004('0x3'));var express=require(_0xc004('0x4'));var router=express[_0xc004('0x5')]();var auth=require(_0xc004('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc004('0x7'));var controller=require(_0xc004('0x8'));router[_0xc004('0x9')]('/',auth['isAuthenticated'](),controller[_0xc004('0xa')]);router['get'](_0xc004('0xb'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xc004('0xc'),auth[_0xc004('0xd')](),controller['show']);router[_0xc004('0xe')]('/',auth['isAuthenticated'](),controller[_0xc004('0xf')]);router[_0xc004('0x10')]('/:id',auth[_0xc004('0xd')](),controller[_0xc004('0x11')]);router['delete'](_0xc004('0xc'),auth[_0xc004('0xd')](),controller[_0xc004('0x12')]);module[_0xc004('0x13')]=router; \ No newline at end of file +var _0x4e9f=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','describe','show','create','put','delete','/:id','destroy','exports','multer','util'];(function(_0x441db3,_0x10f359){var _0x16c05d=function(_0x4c0d4e){while(--_0x4c0d4e){_0x441db3['push'](_0x441db3['shift']());}};_0x16c05d(++_0x10f359);}(_0x4e9f,0x18d));var _0xf4e9=function(_0x36290a,_0x4a6288){_0x36290a=_0x36290a-0x0;var _0x250502=_0x4e9f[_0x36290a];return _0x250502;};'use strict';var multer=require(_0xf4e9('0x0'));var util=require(_0xf4e9('0x1'));var path=require(_0xf4e9('0x2'));var timeout=require(_0xf4e9('0x3'));var express=require(_0xf4e9('0x4'));var router=express['Router']();var auth=require(_0xf4e9('0x5'));var interaction=require(_0xf4e9('0x6'));var config=require(_0xf4e9('0x7'));var controller=require(_0xf4e9('0x8'));router[_0xf4e9('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf4e9('0x9')]('/describe',auth[_0xf4e9('0xa')](),controller[_0xf4e9('0xb')]);router[_0xf4e9('0x9')]('/:id',auth[_0xf4e9('0xa')](),controller[_0xf4e9('0xc')]);router['post']('/',auth[_0xf4e9('0xa')](),controller[_0xf4e9('0xd')]);router[_0xf4e9('0xe')]('/:id',auth[_0xf4e9('0xa')](),controller['update']);router[_0xf4e9('0xf')](_0xf4e9('0x10'),auth[_0xf4e9('0xa')](),controller[_0xf4e9('0x11')]);module[_0xf4e9('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 5a21933..389d4fc 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 _0x9048=['STRING','mouseOver','timeout','sequelize','exports'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0x9048,0x1b6));var _0x8904=function(_0x3c38fb,_0x5c27c1){_0x3c38fb=_0x3c38fb-0x0;var _0x4012da=_0x9048[_0x3c38fb];return _0x4012da;};'use strict';var Sequelize=require(_0x8904('0x0'));module[_0x8904('0x1')]={'name':{'type':Sequelize[_0x8904('0x2')],'allowNull':![]},'type':{'type':Sequelize['ENUM'](_0x8904('0x3'),_0x8904('0x4')),'defaultValue':'mouseOver'},'selector':{'type':Sequelize[_0x8904('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x1b76=['mouseOver','timeout','sequelize','exports','STRING','ENUM'];(function(_0x53131f,_0x1b8e4a){var _0x124ccd=function(_0x5a53ef){while(--_0x5a53ef){_0x53131f['push'](_0x53131f['shift']());}};_0x124ccd(++_0x1b8e4a);}(_0x1b76,0x104));var _0x61b7=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x1b76[_0x432682];return _0x463d05;};'use strict';var Sequelize=require(_0x61b7('0x0'));module[_0x61b7('0x1')]={'name':{'type':Sequelize[_0x61b7('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x61b7('0x3')](_0x61b7('0x4'),_0x61b7('0x5')),'defaultValue':_0x61b7('0x4')},'selector':{'type':Sequelize[_0x61b7('0x2')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index f0ad7f7..f16dad4 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 _0xd8b0=['eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','keys','rawAttributes','filters','model','attributes','intersection','length','query','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','html-pdf'];(function(_0x1570e4,_0x244686){var _0x428d09=function(_0x97634a){while(--_0x97634a){_0x1570e4['push'](_0x1570e4['shift']());}};_0x428d09(++_0x244686);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'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 Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={'raw':!![],'where':{'id':_0xa2af02[_0x0d8b('0x28')]['id']}},_0x28f639={};_0x28f639['model']=_[_0x0d8b('0x29')](db['ChatProactiveAction'][_0x0d8b('0x2a')]);_0x28f639['query']=_[_0x0d8b('0x29')](_0xa2af02['query']);_0x28f639[_0x0d8b('0x2b')]=_['intersection'](_0x28f639[_0x0d8b('0x2c')],_0x28f639['query']);_0x59a905[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x28f639[_0x0d8b('0x2c')],qs['fields'](_0xa2af02['query']['fields']));_0x59a905[_0x0d8b('0x2d')]=_0x59a905['attributes'][_0x0d8b('0x2f')]?_0x59a905['attributes']:_0x28f639['model'];if(_0xa2af02[_0x0d8b('0x30')][_0x0d8b('0x31')]){_0x59a905[_0x0d8b('0x32')]=[{'all':!![]}];}_0x59a905=_[_0x0d8b('0x33')]({},_0x59a905,_0xa2af02[_0x0d8b('0x34')]);return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x59a905)[_0x0d8b('0x22')](handleEntityNotFound(_0x4fe6f9,null))['then'](respondWithResult(_0x4fe6f9,null))[_0x0d8b('0x37')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x38')]=function(_0x4b3ea0,_0xb18586){return db[_0x0d8b('0x35')][_0x0d8b('0x38')](_0x4b3ea0['body'],{})[_0x0d8b('0x22')](respondWithResult(_0xb18586,0xc9))[_0x0d8b('0x37')](handleError(_0xb18586,null));};exports[_0x0d8b('0x21')]=function(_0x31ceba,_0x933e01){if(_0x31ceba['body']['id']){delete _0x31ceba[_0x0d8b('0x39')]['id'];}return db[_0x0d8b('0x35')]['find']({'where':{'id':_0x31ceba[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x933e01,null))[_0x0d8b('0x22')](saveUpdates(_0x31ceba[_0x0d8b('0x39')],null))[_0x0d8b('0x22')](respondWithResult(_0x933e01,null))['catch'](handleError(_0x933e01,null));};exports['destroy']=function(_0x41b4f9,_0x5c2c04){return db['ChatProactiveAction'][_0x0d8b('0x36')]({'where':{'id':_0x41b4f9[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x5c2c04,null))[_0x0d8b('0x22')](removeEntity(_0x5c2c04,null))[_0x0d8b('0x37')](handleError(_0x5c2c04,null));}; \ No newline at end of file +var _0xd8b0=['eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','keys','rawAttributes','filters','model','attributes','intersection','length','query','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','html-pdf'];(function(_0x29e3d5,_0x3bd486){var _0x5e3590=function(_0x5005f5){while(--_0x5005f5){_0x29e3d5['push'](_0x29e3d5['shift']());}};_0x5e3590(++_0x3bd486);}(_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 Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={'raw':!![],'where':{'id':_0xa2af02[_0x0d8b('0x28')]['id']}},_0x28f639={};_0x28f639['model']=_[_0x0d8b('0x29')](db['ChatProactiveAction'][_0x0d8b('0x2a')]);_0x28f639['query']=_[_0x0d8b('0x29')](_0xa2af02['query']);_0x28f639[_0x0d8b('0x2b')]=_['intersection'](_0x28f639[_0x0d8b('0x2c')],_0x28f639['query']);_0x59a905[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x28f639[_0x0d8b('0x2c')],qs['fields'](_0xa2af02['query']['fields']));_0x59a905[_0x0d8b('0x2d')]=_0x59a905['attributes'][_0x0d8b('0x2f')]?_0x59a905['attributes']:_0x28f639['model'];if(_0xa2af02[_0x0d8b('0x30')][_0x0d8b('0x31')]){_0x59a905[_0x0d8b('0x32')]=[{'all':!![]}];}_0x59a905=_[_0x0d8b('0x33')]({},_0x59a905,_0xa2af02[_0x0d8b('0x34')]);return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x59a905)[_0x0d8b('0x22')](handleEntityNotFound(_0x4fe6f9,null))['then'](respondWithResult(_0x4fe6f9,null))[_0x0d8b('0x37')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x38')]=function(_0x4b3ea0,_0xb18586){return db[_0x0d8b('0x35')][_0x0d8b('0x38')](_0x4b3ea0['body'],{})[_0x0d8b('0x22')](respondWithResult(_0xb18586,0xc9))[_0x0d8b('0x37')](handleError(_0xb18586,null));};exports[_0x0d8b('0x21')]=function(_0x31ceba,_0x933e01){if(_0x31ceba['body']['id']){delete _0x31ceba[_0x0d8b('0x39')]['id'];}return db[_0x0d8b('0x35')]['find']({'where':{'id':_0x31ceba[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x933e01,null))[_0x0d8b('0x22')](saveUpdates(_0x31ceba[_0x0d8b('0x39')],null))[_0x0d8b('0x22')](respondWithResult(_0x933e01,null))['catch'](handleError(_0x933e01,null));};exports['destroy']=function(_0x41b4f9,_0x5c2c04){return db['ChatProactiveAction'][_0x0d8b('0x36')]({'where':{'id':_0x41b4f9[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x5c2c04,null))[_0x0d8b('0x22')](removeEntity(_0x5c2c04,null))[_0x0d8b('0x37')](handleError(_0x5c2c04,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index ad13712..e613488 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 _0xb8cf=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatProactiveAction.attributes','define','ChatProactiveAction','lodash','util','api'];(function(_0x4d53ad,_0x5a8c2b){var _0x1bf121=function(_0x4f88c1){while(--_0x4f88c1){_0x4d53ad['push'](_0x4d53ad['shift']());}};_0x1bf121(++_0x5a8c2b);}(_0xb8cf,0xd5));var _0xfb8c=function(_0x5ef8ac,_0x4513ee){_0x5ef8ac=_0x5ef8ac-0x0;var _0x5e56c6=_0xb8cf[_0x5ef8ac];return _0x5e56c6;};'use strict';var _=require(_0xfb8c('0x0'));var util=require(_0xfb8c('0x1'));var logger=require('../../config/logger')(_0xfb8c('0x2'));var moment=require(_0xfb8c('0x3'));var BPromise=require(_0xfb8c('0x4'));var rp=require(_0xfb8c('0x5'));var fs=require('fs');var path=require(_0xfb8c('0x6'));var rimraf=require(_0xfb8c('0x7'));var config=require(_0xfb8c('0x8'));var attributes=require(_0xfb8c('0x9'));module['exports']=function(_0x5532f2,_0x52ea46){return _0x5532f2[_0xfb8c('0xa')](_0xfb8c('0xb'),attributes,{'tableName':'chat_proactive_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x29c9=['request-promise','path','../../config/environment','./chatProactiveAction.attributes','exports','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2c1e09,_0x1af1e0){var _0x62e59e=function(_0x3419b7){while(--_0x3419b7){_0x2c1e09['push'](_0x2c1e09['shift']());}};_0x62e59e(++_0x1af1e0);}(_0x29c9,0x118));var _0x929c=function(_0x568f7c,_0x58c7d2){_0x568f7c=_0x568f7c-0x0;var _0x53f645=_0x29c9[_0x568f7c];return _0x53f645;};'use strict';var _=require(_0x929c('0x0'));var util=require(_0x929c('0x1'));var logger=require(_0x929c('0x2'))(_0x929c('0x3'));var moment=require(_0x929c('0x4'));var BPromise=require(_0x929c('0x5'));var rp=require(_0x929c('0x6'));var fs=require('fs');var path=require(_0x929c('0x7'));var rimraf=require('rimraf');var config=require(_0x929c('0x8'));var attributes=require(_0x929c('0x9'));module[_0x929c('0xa')]=function(_0x3f0d68,_0x3ce4d2){return _0x3f0d68['define'](_0x929c('0xb'),attributes,{'tableName':_0x929c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.rpc.js b/server/api/chatProactiveAction/chatProactiveAction.rpc.js index 5397b34..e6c0985 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 _0xc803=['request','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5e77db,_0x468bb0){var _0x14fae7=function(_0x5c64d8){while(--_0x5c64d8){_0x5e77db['push'](_0x5e77db['shift']());}};_0x14fae7(++_0x468bb0);}(_0xc803,0x14e));var _0x3c80=function(_0x1d15cd,_0x9933cf){_0x1d15cd=_0x1d15cd-0x0;var _0x22a70a=_0xc803[_0x1d15cd];return _0x22a70a;};'use strict';var _=require(_0x3c80('0x0'));var util=require(_0x3c80('0x1'));var moment=require('moment');var BPromise=require(_0x3c80('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3c80('0x3'))['db'];var utils=require(_0x3c80('0x4'));var logger=require(_0x3c80('0x5'))(_0x3c80('0x6'));var config=require(_0x3c80('0x7'));var jayson=require(_0x3c80('0x8'));var client=jayson[_0x3c80('0x9')][_0x3c80('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x170b45,_0x3a19e7,_0x585bee){return new BPromise(function(_0x1cb993,_0xb6ca86){return client[_0x3c80('0xb')](_0x170b45,_0x585bee)[_0x3c80('0xc')](function(_0x188288){logger[_0x3c80('0xd')](_0x3c80('0xe'),_0x3a19e7,_0x3c80('0xf'));logger['debug'](_0x3c80('0x10'),_0x3a19e7,'request\x20sent',JSON[_0x3c80('0x11')](_0x188288));if(_0x188288['error']){if(_0x188288[_0x3c80('0x12')][_0x3c80('0x13')]===0x1f4){logger[_0x3c80('0x12')](_0x3c80('0xe'),_0x3a19e7,_0x188288[_0x3c80('0x12')]['message']);return _0xb6ca86(_0x188288[_0x3c80('0x12')]['message']);}logger[_0x3c80('0x12')]('ChatProactiveAction,\x20%s,\x20%s',_0x3a19e7,_0x188288['error'][_0x3c80('0x14')]);return _0x1cb993(_0x188288[_0x3c80('0x12')][_0x3c80('0x14')]);}else{logger['info'](_0x3c80('0xe'),_0x3a19e7,_0x3c80('0xf'));_0x1cb993(_0x188288[_0x3c80('0x15')]['message']);}})[_0x3c80('0x16')](function(_0x55582c){logger['error'](_0x3c80('0xe'),_0x3a19e7,_0x55582c);_0xb6ca86(_0x55582c);});});} \ No newline at end of file +var _0xb5f8=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ChatProactiveAction,\x20%s,\x20%s','message','catch','lodash','util','moment','randomstring'];(function(_0x1ebd67,_0x408823){var _0x26fbce=function(_0x3842d9){while(--_0x3842d9){_0x1ebd67['push'](_0x1ebd67['shift']());}};_0x26fbce(++_0x408823);}(_0xb5f8,0x17c));var _0x8b5f=function(_0x3b95e2,_0x5a5024){_0x3b95e2=_0x3b95e2-0x0;var _0x2cd1e5=_0xb5f8[_0x3b95e2];return _0x2cd1e5;};'use strict';var _=require(_0x8b5f('0x0'));var util=require(_0x8b5f('0x1'));var moment=require(_0x8b5f('0x2'));var BPromise=require('bluebird');var rs=require(_0x8b5f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8b5f('0x4'))['db'];var utils=require(_0x8b5f('0x5'));var logger=require(_0x8b5f('0x6'))(_0x8b5f('0x7'));var config=require(_0x8b5f('0x8'));var jayson=require(_0x8b5f('0x9'));var client=jayson[_0x8b5f('0xa')][_0x8b5f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x149a00,_0x2cae2c,_0x4a3be3){return new BPromise(function(_0x41d55a,_0x3908b8){return client[_0x8b5f('0xc')](_0x149a00,_0x4a3be3)[_0x8b5f('0xd')](function(_0x59f89c){logger[_0x8b5f('0xe')]('ChatProactiveAction,\x20%s,\x20%s',_0x2cae2c,'request\x20sent');logger[_0x8b5f('0xf')](_0x8b5f('0x10'),_0x2cae2c,_0x8b5f('0x11'),JSON[_0x8b5f('0x12')](_0x59f89c));if(_0x59f89c[_0x8b5f('0x13')]){if(_0x59f89c[_0x8b5f('0x13')][_0x8b5f('0x14')]===0x1f4){logger['error'](_0x8b5f('0x15'),_0x2cae2c,_0x59f89c[_0x8b5f('0x13')]['message']);return _0x3908b8(_0x59f89c[_0x8b5f('0x13')][_0x8b5f('0x16')]);}logger[_0x8b5f('0x13')](_0x8b5f('0x15'),_0x2cae2c,_0x59f89c['error']['message']);return _0x41d55a(_0x59f89c['error'][_0x8b5f('0x16')]);}else{logger[_0x8b5f('0xe')](_0x8b5f('0x15'),_0x2cae2c,_0x8b5f('0x11'));_0x41d55a(_0x59f89c['result'][_0x8b5f('0x16')]);}})[_0x8b5f('0x17')](function(_0xd637ca){logger[_0x8b5f('0x13')](_0x8b5f('0x15'),_0x2cae2c,_0xd637ca);_0x3908b8(_0xd637ca);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 76cbaff..7ec4d41 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 _0x9fd8=['delete','/:id','destroy','util','path','connect-timeout','../../components/auth/service','../../config/environment','./chatProactiveAction.controller','get','isAuthenticated','create','put','update'];(function(_0x43216d,_0x25e405){var _0x33ffee=function(_0x35cf68){while(--_0x35cf68){_0x43216d['push'](_0x43216d['shift']());}};_0x33ffee(++_0x25e405);}(_0x9fd8,0x18b));var _0x89fd=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9fd8[_0x1facfa];return _0x9ec701;};'use strict';var multer=require('multer');var util=require(_0x89fd('0x0'));var path=require(_0x89fd('0x1'));var timeout=require(_0x89fd('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x89fd('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x89fd('0x4'));var controller=require(_0x89fd('0x5'));router[_0x89fd('0x6')]('/:id',auth[_0x89fd('0x7')](),controller['show']);router['post']('/',auth[_0x89fd('0x7')](),controller[_0x89fd('0x8')]);router[_0x89fd('0x9')]('/:id',auth[_0x89fd('0x7')](),controller[_0x89fd('0xa')]);router[_0x89fd('0xb')](_0x89fd('0xc'),auth[_0x89fd('0x7')](),controller[_0x89fd('0xd')]);module['exports']=router; \ No newline at end of file +var _0xf8bb=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','create','delete'];(function(_0x34fb19,_0xc493c6){var _0x3a1dcd=function(_0xed1626){while(--_0xed1626){_0x34fb19['push'](_0x34fb19['shift']());}};_0x3a1dcd(++_0xc493c6);}(_0xf8bb,0x111));var _0xbf8b=function(_0x461ac8,_0x29748c){_0x461ac8=_0x461ac8-0x0;var _0x2f4819=_0xf8bb[_0x461ac8];return _0x2f4819;};'use strict';var multer=require(_0xbf8b('0x0'));var util=require(_0xbf8b('0x1'));var path=require(_0xbf8b('0x2'));var timeout=require('connect-timeout');var express=require(_0xbf8b('0x3'));var router=express[_0xbf8b('0x4')]();var auth=require(_0xbf8b('0x5'));var interaction=require(_0xbf8b('0x6'));var config=require(_0xbf8b('0x7'));var controller=require(_0xbf8b('0x8'));router[_0xbf8b('0x9')](_0xbf8b('0xa'),auth[_0xbf8b('0xb')](),controller[_0xbf8b('0xc')]);router[_0xbf8b('0xd')]('/',auth[_0xbf8b('0xb')](),controller[_0xbf8b('0xe')]);router['put'](_0xbf8b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xbf8b('0xf')]('/:id',auth[_0xbf8b('0xb')](),controller['destroy']);module[_0xbf8b('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index f4c092b..908085c 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 _0xb98f=['beepall','roundrobin','STRING','INTEGER','ENUM','rrmemory'];(function(_0x4aa245,_0xc5a494){var _0x2e6535=function(_0x258f10){while(--_0x258f10){_0x4aa245['push'](_0x4aa245['shift']());}};_0x2e6535(++_0xc5a494);}(_0xb98f,0x13a));var _0xfb98=function(_0x5a0864,_0x3cbfb2){_0x5a0864=_0x5a0864-0x0;var _0x55f1d9=_0xb98f[_0x5a0864];return _0x55f1d9;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xfb98('0x0')],'unique':'name','allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xfb98('0x0')]},'timeout':{'type':Sequelize[_0xfb98('0x1')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xfb98('0x2')](_0xfb98('0x3'),_0xfb98('0x4'),_0xfb98('0x5'))}}; \ No newline at end of file +var _0xb8db=['rrmemory','beepall','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0xd9f162,_0x3951eb){var _0x13e3e2=function(_0x259d5c){while(--_0x259d5c){_0xd9f162['push'](_0xd9f162['shift']());}};_0x13e3e2(++_0x3951eb);}(_0xb8db,0x152));var _0xbb8d=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb8db[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xbb8d('0x0'));module[_0xbb8d('0x1')]={'name':{'type':Sequelize[_0xbb8d('0x2')],'unique':_0xbb8d('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xbb8d('0x2')]},'timeout':{'type':Sequelize[_0xbb8d('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xbb8d('0x5')](_0xbb8d('0x6'),_0xbb8d('0x7'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index df34dbf..5e360a8 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 _0x975b=['spread','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','test','ValidationError','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','apply','reject','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','limit','order','sort','where','filters','merge','filter','options','findAll','rows','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','pick','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x975b,0x1c9));var _0xb975=function(_0x1b2709,_0x219732){_0x1b2709=_0x1b2709-0x0;var _0xd268aa=_0x975b[_0x1b2709];return _0xd268aa;};'use strict';var pdf=require(_0xb975('0x0'));var emlformat=require(_0xb975('0x1'));var rimraf=require(_0xb975('0x2'));var zipdir=require(_0xb975('0x3'));var jsonpatch=require(_0xb975('0x4'));var rp=require(_0xb975('0x5'));var moment=require(_0xb975('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb975('0x7'));var util=require(_0xb975('0x8'));var path=require(_0xb975('0x9'));var sox=require(_0xb975('0xa'));var csv=require(_0xb975('0xb'));var ejs=require(_0xb975('0xc'));var fs=require('fs');var _=require(_0xb975('0xd'));var squel=require('squel');var crypto=require(_0xb975('0xe'));var jsforce=require(_0xb975('0xf'));var deskjs=require(_0xb975('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb975('0x11'));var Papa=require(_0xb975('0x12'));var Redis=require(_0xb975('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb975('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb975('0x15'));var logger=require('../../config/logger')(_0xb975('0x16'));var utils=require('../../config/utils');var config=require(_0xb975('0x17'));var db=require(_0xb975('0x18'))['db'];config[_0xb975('0x19')]=_[_0xb975('0x1a')](config[_0xb975('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb975('0x1b'))(new Redis(config[_0xb975('0x19')]));require(_0xb975('0x1c'))[_0xb975('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb975('0x1e')][_0xb975('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x394b6d,_0x4b1ede,_0x24f8ec){if(_0x24f8ec){var _0x3da9e9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3da9e9[_0xb975('0x20')](_0x4b1ede)){return _0x394b6d;}else{throw new db['Sequelize'][(_0xb975('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x394b6d;}}function respondWithRpcPromise(_0xb046b6,_0x34e062,_0xaa1ba3,_0x347a04){return new BPromise(function(_0x2c5d5f,_0x327728){var _0x47075f=_0x347a04||client;return _0x47075f['request'](_0xb046b6,_0xaa1ba3)['then'](function(_0x2abb84){logger[_0xb975('0x22')](_0xb975('0x23'),_0x34e062,_0xb975('0x24'));logger['debug'](_0xb975('0x25'),_0x34e062,'request\x20sent',JSON[_0xb975('0x26')](_0x2abb84));if(_0x2abb84[_0xb975('0x27')]){if(_0x2abb84[_0xb975('0x27')]['code']===0x1f4){logger[_0xb975('0x27')]('ChatQueue,\x20%s,\x20%s',_0x34e062,_0x2abb84['error'][_0xb975('0x28')]);return _0x327728(_0x2abb84[_0xb975('0x27')][_0xb975('0x28')]);}logger[_0xb975('0x27')](_0xb975('0x23'),_0x34e062,_0x2abb84['error'][_0xb975('0x28')]);return _0x2c5d5f(_0x2abb84['error'][_0xb975('0x28')]);}else{logger[_0xb975('0x22')](_0xb975('0x23'),_0x34e062,_0xb975('0x24'));_0x2c5d5f(_0x2abb84['result'][_0xb975('0x28')]);}})[_0xb975('0x29')](function(_0x41905e){logger[_0xb975('0x27')]('ChatQueue,\x20%s,\x20%s',_0x34e062,_0x41905e);_0x327728(_0x41905e);});});}function respondWithStatusCode(_0x323600,_0x388f4d){_0x388f4d=_0x388f4d||0xcc;return function(_0x67fcc5){if(_0x67fcc5){return _0x323600[_0xb975('0x2a')](_0x388f4d);}return _0x323600[_0xb975('0x2b')](_0x388f4d)[_0xb975('0x2c')]();};}function respondWithResult(_0x442bc6,_0x135cc9){_0x135cc9=_0x135cc9||0xc8;return function(_0x2d730d){if(_0x2d730d){return _0x442bc6['status'](_0x135cc9)[_0xb975('0x2d')](_0x2d730d);}};}function respondWithFilteredResult(_0x2b3ec2,_0x3e7503){return function(_0xc57f0e){if(_0xc57f0e){var _0x1fa1c3=_0xc57f0e[_0xb975('0x2e')],_0x3bd5cb=_0x3e7503[_0xb975('0x2f')],_0x2de7e5=_0x3e7503[_0xb975('0x2f')]+_0x3e7503['limit'],_0xa8ee8c;if(_0x2de7e5>=_0x1fa1c3){_0x2de7e5=_0x1fa1c3;_0xa8ee8c=0xc8;}else{_0xa8ee8c=0xce;}_0x2b3ec2[_0xb975('0x2b')](_0xa8ee8c);return _0x2b3ec2['set']('Content-Range',_0x3bd5cb+'-'+_0x2de7e5+'/'+_0x1fa1c3)[_0xb975('0x2d')](_0xc57f0e);}return null;};}function patchUpdates(_0x54aa36){return function(_0xf3e9f3){try{jsonpatch[_0xb975('0x30')](_0xf3e9f3,_0x54aa36,!![]);}catch(_0x55996f){return BPromise[_0xb975('0x31')](_0x55996f);}return _0xf3e9f3['save']();};}function saveUpdates(_0x3dd15f,_0x818320){return function(_0x1e3ca3){if(_0x1e3ca3){return _0x1e3ca3[_0xb975('0x32')](_0x3dd15f)[_0xb975('0x33')](function(_0x58578c){return _0x58578c;});}return null;};}function removeEntity(_0x219c93,_0x5389a9){return function(_0x568a00){if(_0x568a00){return _0x568a00[_0xb975('0x34')]()[_0xb975('0x33')](function(){var _0x37fa4d=_0x568a00[_0xb975('0x35')]({'plain':!![]});var _0x182955=_0xb975('0x36');return db[_0xb975('0x37')][_0xb975('0x34')]({'where':{'type':_0x182955,'resourceId':_0x37fa4d['id']}})['then'](function(){return _0x568a00;});})[_0xb975('0x33')](function(){_0x219c93[_0xb975('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271798,_0x2e39b0){return function(_0x24459d){if(!_0x24459d){_0x271798[_0xb975('0x2a')](0x194);}return _0x24459d;};}function handleError(_0x1a1ffa,_0x3d0096){_0x3d0096=_0x3d0096||0x1f4;return function(_0x10f392){logger['error'](_0x10f392[_0xb975('0x38')]);if(_0x10f392['name']){delete _0x10f392[_0xb975('0x39')];}_0x1a1ffa[_0xb975('0x2b')](_0x3d0096)['send'](_0x10f392);};}exports[_0xb975('0x3a')]=function(_0x50a38f,_0xc1303a){var _0x378e54={},_0x18106c={},_0x20c24e={'count':0x0,'rows':[]};var _0x4528b1=_[_0xb975('0x3b')](db[_0xb975('0x3c')][_0xb975('0x3d')],function(_0x5d92b2){return{'name':_0x5d92b2[_0xb975('0x3e')],'type':_0x5d92b2[_0xb975('0x3f')][_0xb975('0x40')]};});_0x18106c['model']=_['map'](_0x4528b1,_0xb975('0x39'));_0x18106c[_0xb975('0x41')]=_[_0xb975('0x42')](_0x50a38f['query']);_0x18106c['filters']=_[_0xb975('0x43')](_0x18106c[_0xb975('0x44')],_0x18106c[_0xb975('0x41')]);_0x378e54[_0xb975('0x45')]=_['intersection'](_0x18106c[_0xb975('0x44')],qs[_0xb975('0x46')](_0x50a38f[_0xb975('0x41')][_0xb975('0x46')]));_0x378e54['attributes']=_0x378e54[_0xb975('0x45')][_0xb975('0x47')]?_0x378e54['attributes']:_0x18106c['model'];if(!_0x50a38f[_0xb975('0x41')]['hasOwnProperty']('nolimit')){_0x378e54[_0xb975('0x48')]=qs['limit'](_0x50a38f[_0xb975('0x41')][_0xb975('0x48')]);_0x378e54['offset']=qs[_0xb975('0x2f')](_0x50a38f[_0xb975('0x41')][_0xb975('0x2f')]);}_0x378e54[_0xb975('0x49')]=qs[_0xb975('0x4a')](_0x50a38f['query'][_0xb975('0x4a')]);_0x378e54[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_['pick'](_0x50a38f[_0xb975('0x41')],_0x18106c[_0xb975('0x4c')]));if(_0x50a38f[_0xb975('0x41')]['filter']){_0x378e54[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x378e54[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x4528b1,function(_0x5f3871){if(_0x5f3871['type']!=='VIRTUAL'){var _0x339943={};_0x339943[_0x5f3871[_0xb975('0x39')]]={'$like':'%'+_0x50a38f[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x339943;}})});}_0x378e54=_[_0xb975('0x4d')]({},_0x378e54,_0x50a38f[_0xb975('0x4f')]);var _0x19a2f0={'where':_0x378e54[_0xb975('0x4b')]};return db[_0xb975('0x3c')][_0xb975('0x2e')](_0x19a2f0)[_0xb975('0x33')](function(_0x4c2f75){_0x20c24e[_0xb975('0x2e')]=_0x4c2f75;if(_0x50a38f['query']['includeAll']){_0x378e54['include']=[{'all':!![]}];}return db[_0xb975('0x3c')][_0xb975('0x50')](_0x378e54);})['then'](function(_0x14c49e){_0x20c24e[_0xb975('0x51')]=_0x14c49e;return _0x20c24e;})[_0xb975('0x33')](respondWithFilteredResult(_0xc1303a,_0x378e54))[_0xb975('0x29')](handleError(_0xc1303a,null));};exports[_0xb975('0x52')]=function(_0x116325,_0x2d228e){var _0x1d4fb5={'raw':!![],'where':{'id':_0x116325['params']['id']}},_0x43b6da={};_0x43b6da['model']=_['keys'](db[_0xb975('0x3c')][_0xb975('0x3d')]);_0x43b6da['query']=_[_0xb975('0x42')](_0x116325[_0xb975('0x41')]);_0x43b6da[_0xb975('0x4c')]=_['intersection'](_0x43b6da[_0xb975('0x44')],_0x43b6da['query']);_0x1d4fb5[_0xb975('0x45')]=_['intersection'](_0x43b6da[_0xb975('0x44')],qs[_0xb975('0x46')](_0x116325[_0xb975('0x41')][_0xb975('0x46')]));_0x1d4fb5['attributes']=_0x1d4fb5[_0xb975('0x45')][_0xb975('0x47')]?_0x1d4fb5['attributes']:_0x43b6da['model'];if(_0x116325['query'][_0xb975('0x53')]){_0x1d4fb5[_0xb975('0x54')]=[{'all':!![]}];}_0x1d4fb5=_[_0xb975('0x4d')]({},_0x1d4fb5,_0x116325[_0xb975('0x4f')]);return db[_0xb975('0x3c')][_0xb975('0x55')](_0x1d4fb5)[_0xb975('0x33')](handleEntityNotFound(_0x2d228e,null))[_0xb975('0x33')](respondWithResult(_0x2d228e,null))[_0xb975('0x29')](handleError(_0x2d228e,null));};exports[_0xb975('0x56')]=function(_0x395952,_0x215b3d){return db[_0xb975('0x3c')][_0xb975('0x56')](_0x395952[_0xb975('0x57')],{})['then'](function(_0xb376ee){var _0x2c0af2=_0x395952[_0xb975('0x58')][_0xb975('0x35')]({'plain':!![]});if(!_0x2c0af2)throw new Error(_0xb975('0x59'));if(_0x2c0af2['role']==='user'){var _0x56ecd0=_0xb376ee[_0xb975('0x35')]({'plain':!![]});var _0xdc1da8=_0xb975('0x36');return db[_0xb975('0x5a')][_0xb975('0x55')]({'where':{'name':_0xdc1da8,'userProfileId':_0x2c0af2[_0xb975('0x5b')]},'raw':!![]})['then'](function(_0x22b690){if(_0x22b690&&_0x22b690['autoAssociation']===0x0){return db[_0xb975('0x37')]['create']({'name':_0x56ecd0[_0xb975('0x39')],'resourceId':_0x56ecd0['id'],'type':_0x22b690[_0xb975('0x39')],'sectionId':_0x22b690['id']},{})[_0xb975('0x33')](function(){return _0xb376ee;});}else{return _0xb376ee;}})[_0xb975('0x29')](function(_0x22306d){logger[_0xb975('0x27')](_0xb975('0x5c'),_0x22306d);throw _0x22306d;});}return _0xb376ee;})[_0xb975('0x33')](respondWithResult(_0x215b3d,0xc9))[_0xb975('0x29')](handleError(_0x215b3d,null));};exports[_0xb975('0x32')]=function(_0x44dad4,_0x415bb9){if(_0x44dad4[_0xb975('0x57')]['id']){delete _0x44dad4[_0xb975('0x57')]['id'];}return db[_0xb975('0x3c')][_0xb975('0x55')]({'where':{'id':_0x44dad4['params']['id']}})['then'](handleEntityNotFound(_0x415bb9,null))[_0xb975('0x33')](saveUpdates(_0x44dad4['body'],null))[_0xb975('0x33')](respondWithResult(_0x415bb9,null))[_0xb975('0x29')](handleError(_0x415bb9,null));};exports[_0xb975('0x34')]=function(_0x5ac9ea,_0x19157c){return db[_0xb975('0x3c')]['find']({'where':{'id':_0x5ac9ea[_0xb975('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19157c,null))[_0xb975('0x33')](removeEntity(_0x19157c,null))[_0xb975('0x29')](handleError(_0x19157c,null));};exports[_0xb975('0x5e')]=function(_0x2c1aca,_0x11e627){return db[_0xb975('0x3c')][_0xb975('0x5e')]()[_0xb975('0x33')](respondWithResult(_0x11e627,null))[_0xb975('0x29')](handleError(_0x11e627,null));};exports[_0xb975('0x5f')]=function(_0xf0393b,_0x3b0e53,_0x11c656){var _0x5678b9={'raw':!![],'where':{}},_0x3f3338={},_0x34cc42;return db[_0xb975('0x3c')]['findOne']({'where':{'id':_0xf0393b['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x3b0e53,null))[_0xb975('0x33')](function(_0xb2c0d1){if(_0xb2c0d1){_0x34cc42=_0xb2c0d1[_0xb975('0x35')]({'plain':!![]});_0x3f3338[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x60')][_0xb975('0x3d')]);_0x3f3338[_0xb975('0x41')]=_[_0xb975('0x42')](_0xf0393b[_0xb975('0x41')]);_0x3f3338['filters']=_[_0xb975('0x43')](_0x3f3338[_0xb975('0x44')],_0x3f3338[_0xb975('0x41')]);_0x5678b9[_0xb975('0x45')]=_['intersection'](_0x3f3338[_0xb975('0x44')],qs[_0xb975('0x46')](_0xf0393b[_0xb975('0x41')][_0xb975('0x46')]));_0x5678b9[_0xb975('0x45')]=_0x5678b9[_0xb975('0x45')]['length']?_0x5678b9[_0xb975('0x45')]:_0x3f3338['model'];if(!_0xf0393b[_0xb975('0x41')][_0xb975('0x61')](_0xb975('0x62'))){_0x5678b9['limit']=qs[_0xb975('0x48')](_0xf0393b[_0xb975('0x41')]['limit']);_0x5678b9['offset']=qs[_0xb975('0x2f')](_0xf0393b[_0xb975('0x41')][_0xb975('0x2f')]);}_0x5678b9[_0xb975('0x49')]=qs['sort'](_0xf0393b['query'][_0xb975('0x4a')]);_0x5678b9[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_[_0xb975('0x63')](_0xf0393b[_0xb975('0x41')],_0x3f3338[_0xb975('0x4c')]));_0x5678b9['where']['ChatQueueId']=_0xb2c0d1['id'];if(_0xf0393b[_0xb975('0x41')][_0xb975('0x4e')]){_0x5678b9[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x5678b9[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x5678b9[_0xb975('0x45')],function(_0x1807e5){var _0x282b2e={};_0x282b2e[_0x1807e5]={'$like':'%'+_0xf0393b[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x282b2e;})});}_0x5678b9=_['merge']({},_0x5678b9,_0xf0393b[_0xb975('0x4f')]);return db[_0xb975('0x60')][_0xb975('0x50')](_0x5678b9);}})[_0xb975('0x33')](function(_0x47655b){if(_0x47655b){return db['User'][_0xb975('0x64')]({'where':{'id':_[_0xb975('0x3b')](_0x47655b,_0xb975('0x65')),'role':_0xb975('0x66')},'attributes':['id',_0xb975('0x39'),_0xb975('0x67'),_0xb975('0x68'),_0xb975('0x69')]});}})[_0xb975('0x33')](function(_0xa41c73){if(_0xa41c73){return{'count':_0xa41c73[_0xb975('0x2e')],'rows':_[_0xb975('0x3b')](_0xa41c73[_0xb975('0x51')],function(_0x22716c){return{'membername':_0x22716c[_0xb975('0x39')],'UserId':_0x22716c['id'],'queue_name':_0x34cc42[_0xb975('0x39')],'ChatQueueId':_0x34cc42['id'],'interface':util[_0xb975('0x6a')](_0xb975('0x6b'),'SIP',_0x22716c[_0xb975('0x39')]),'penalty':0x0,'paused':_0x22716c[_0xb975('0x67')],'createdAt':_0x22716c['createdAt'],'updatedAt':_0x22716c[_0xb975('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb975('0x33')](respondWithFilteredResult(_0x3b0e53,_0x5678b9))[_0xb975('0x29')](handleError(_0x3b0e53,null));};exports[_0xb975('0x6c')]=function(_0x48a6e9,_0xc98f70,_0x15c22e){var _0x23d0f5={};var _0x1ebfa1={};var _0x5f2f24;var _0x247085;return db[_0xb975('0x3c')][_0xb975('0x6d')]({'where':{'id':_0x48a6e9['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0xc98f70,null))[_0xb975('0x33')](function(_0xc9f295){if(_0xc9f295){_0x5f2f24=_0xc9f295;_0x1ebfa1[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x6e')][_0xb975('0x3d')]);_0x1ebfa1[_0xb975('0x41')]=_['keys'](_0x48a6e9[_0xb975('0x41')]);_0x1ebfa1[_0xb975('0x4c')]=_[_0xb975('0x43')](_0x1ebfa1['model'],_0x1ebfa1[_0xb975('0x41')]);_0x23d0f5[_0xb975('0x45')]=_[_0xb975('0x43')](_0x1ebfa1[_0xb975('0x44')],qs[_0xb975('0x46')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x46')]));_0x23d0f5[_0xb975('0x45')]=_0x23d0f5[_0xb975('0x45')][_0xb975('0x47')]?_0x23d0f5['attributes']:_0x1ebfa1[_0xb975('0x44')];_0x23d0f5[_0xb975('0x49')]=qs['sort'](_0x48a6e9[_0xb975('0x41')][_0xb975('0x4a')]);_0x23d0f5['where']=qs[_0xb975('0x4c')](_[_0xb975('0x63')](_0x48a6e9[_0xb975('0x41')],_0x1ebfa1[_0xb975('0x4c')]));if(_0x48a6e9[_0xb975('0x41')][_0xb975('0x4e')]){_0x23d0f5[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x23d0f5[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x23d0f5[_0xb975('0x45')],function(_0x35d443){var _0x3a7d44={};_0x3a7d44[_0x35d443]={'$like':'%'+_0x48a6e9[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x3a7d44;})});}_0x23d0f5=_[_0xb975('0x4d')]({},_0x23d0f5,_0x48a6e9[_0xb975('0x4f')]);return _0x5f2f24[_0xb975('0x6c')](_0x23d0f5);}})[_0xb975('0x33')](function(_0x30e422){if(_0x30e422){_0x247085=_0x30e422['length'];if(!_0x48a6e9[_0xb975('0x41')][_0xb975('0x61')]('nolimit')){_0x23d0f5[_0xb975('0x48')]=qs[_0xb975('0x48')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x48')]);_0x23d0f5[_0xb975('0x2f')]=qs[_0xb975('0x2f')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x2f')]);}return _0x5f2f24['getTeams'](_0x23d0f5);}})[_0xb975('0x33')](function(_0x1afd91){if(_0x1afd91){return _0x1afd91?{'count':_0x247085,'rows':_0x1afd91}:null;}})[_0xb975('0x33')](respondWithResult(_0xc98f70,null))[_0xb975('0x29')](handleError(_0xc98f70,null));};exports['addTeams']=function(_0x1ac6ea,_0x3b8d01,_0x47c86d){var _0x5125b2=_0x1ac6ea['body'][_0xb975('0x6f')];return db[_0xb975('0x6e')]['findAll']({'where':{'id':_0x5125b2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb975('0x70'),'attributes':['id',_0xb975('0x39'),_0xb975('0x71'),'voicePause',_0xb975('0x72')],'raw':!![]}]})[_0xb975('0x33')](function(_0x365d8d){if(_0x365d8d){var _0x5e50b0=_['flatMap'](_0x365d8d,function(_0x3b841d){var _0x3594f6=_0x3b841d[_0xb975('0x35')]({'plain':!![]});return _0x3594f6[_0xb975('0x70')];});return db[_0xb975('0x3c')]['find']({'where':{'id':_0x1ac6ea['params']['id']}})[_0xb975('0x33')](function(_0x41eb6c){return db[_0xb975('0x73')][_0xb975('0x74')](function(_0x5b2249){return _0x41eb6c['addTeams'](_0x5125b2,{'transaction':_0x5b2249})['then'](function(){return BPromise[_0xb975('0x75')](_0x5e50b0,function(_0x2dcf4b){return db['UserChatQueue'][_0xb975('0x76')]({'where':{'UserId':_0x2dcf4b['id'],'ChatQueueId':_0x1ac6ea[_0xb975('0x5d')]['id']},'transaction':_0x5b2249});});})[_0xb975('0x33')](function(){_0x5e50b0[_0xb975('0x77')](function(_0x40fe33){socket[_0xb975('0x78')](_0xb975('0x79'),{'UserId':_0x40fe33['id'],'ChatQueueId':_0x41eb6c['id']});});});});});}})[_0xb975('0x33')](respondWithStatusCode(_0x3b8d01,null))[_0xb975('0x29')](handleError(_0x3b8d01,null));};exports[_0xb975('0x7a')]=function(_0x5a3122,_0x580078,_0x1f6d34){return db[_0xb975('0x6e')]['findAll']({'where':{'id':_0x5a3122[_0xb975('0x41')][_0xb975('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xb975('0x7b')],'as':_0xb975('0x70'),'attributes':['id'],'raw':!![]}]})[_0xb975('0x33')](handleEntityNotFound(_0x580078,null))['then'](function(_0xc67376){var _0x4a55ae=_[_0xb975('0x3b')](_0xc67376,'id');var _0x430351=[];var _0x1ca952=[];var _0x5117b8=squel[_0xb975('0x7c')]();_0x5117b8[_0xb975('0x7d')](_0xb975('0x7e'))[_0xb975('0x7f')](_0xb975('0x80'),'tq')[_0xb975('0x81')](_0xb975('0x82'),'ut',_0xb975('0x83'))[_0xb975('0x4b')](_0xb975('0x84'),_0x5a3122['params']['id']);for(var _0x2efc1e=0x0;_0x2efc1e<_0xc67376[_0xb975('0x47')];_0x2efc1e+=0x1){let _0x37a0f7=_0xc67376[_0x2efc1e];for(var _0xf9278f=0x0;_0xf9278f<_0x37a0f7[_0xb975('0x70')][_0xb975('0x47')];_0xf9278f+=0x1){let _0x194c90=_0x37a0f7[_0xb975('0x70')][_0xf9278f];var _0x27ff24=_0x5117b8[_0xb975('0x85')]();_0x27ff24[_0xb975('0x4b')](_0xb975('0x86'),_0x194c90['id']);_0x1ca952[_0xb975('0x87')](db[_0xb975('0x73')]['query'](_0x27ff24['toString'](),{'type':db[_0xb975('0x73')]['QueryTypes']['SELECT']})[_0xb975('0x33')](function(_0x4f3f59){if(_0x4f3f59['length']===0x1){return _0x194c90['id'];}else{var _0x18eb81=_[_0xb975('0x88')](_['map'](_0x4f3f59,_0xb975('0x89')),function(_0x2536ec){return _[_0xb975('0x8a')](_0x4a55ae,_0x2536ec);});if(_0x18eb81){return _0x194c90['id'];}}}));}}return BPromise[_0xb975('0x8b')](_0x1ca952)['then'](function(_0x45d76f){_0x430351=_(_0x430351)[_0xb975('0x8c')](_0x45d76f)[_0xb975('0x8d')]()[_0xb975('0x8e')]();return db[_0xb975('0x3c')]['find']({'where':{'id':_0x5a3122[_0xb975('0x5d')]['id']}})[_0xb975('0x33')](function(_0x2acc99){return db[_0xb975('0x73')]['transaction'](function(_0x3fd360){return _0x2acc99['removeTeams'](_0x5a3122[_0xb975('0x41')][_0xb975('0x6f')],{'transaction':_0x3fd360})[_0xb975('0x33')](function(){if(!_[_0xb975('0x8f')](_0x430351)){return _0x2acc99[_0xb975('0x90')](_0x430351,{'transaction':_0x3fd360});}})[_0xb975('0x33')](function(){_0x430351['forEach'](function(_0x39c897){socket[_0xb975('0x78')]('userChatQueue:remove',{'UserId':_0x39c897,'ChatQueueId':_0x2acc99['id']});});});});});});})[_0xb975('0x33')](respondWithStatusCode(_0x580078,null))['catch'](handleError(_0x580078,null));};exports[_0xb975('0x91')]=function(_0x1ed066,_0x49708c,_0x2d8d0f){return db[_0xb975('0x3c')][_0xb975('0x55')]({'where':{'id':_0x1ed066['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x49708c,null))[_0xb975('0x33')](function(_0x20d59c){if(_0x20d59c){return _0x20d59c['addAgents'](_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')],_[_0xb975('0x92')](_0x1ed066['body'],[_0xb975('0x6f'),'id'])||{})[_0xb975('0x93')](function(_0x46b9c3){for(var _0x316cf6=0x0;_0x316cf6<_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')]['length'];_0x316cf6+=0x1){socket['emit'](_0xb975('0x79'),{'UserId':_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')][_0x316cf6],'ChatQueueId':_0x1ed066['params']['id']});}return _0x46b9c3;});}})[_0xb975('0x33')](respondWithResult(_0x49708c,null))[_0xb975('0x29')](handleError(_0x49708c,null));};exports[_0xb975('0x90')]=function(_0xa00549,_0x14ce7b,_0x51d4d4){return db['ChatQueue'][_0xb975('0x55')]({'where':{'id':_0xa00549['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x14ce7b,null))[_0xb975('0x33')](function(_0x312946){if(_0x312946){return _0x312946[_0xb975('0x90')](_0xa00549[_0xb975('0x41')][_0xb975('0x6f')])['then'](function(){if(_[_0xb975('0x94')](_0xa00549[_0xb975('0x41')][_0xb975('0x6f')])){for(var _0x4e6d6d=0x0;_0x4e6d6d<_0xa00549[_0xb975('0x41')][_0xb975('0x6f')][_0xb975('0x47')];_0x4e6d6d+=0x1){socket['emit'](_0xb975('0x95'),{'UserId':Number(_0xa00549[_0xb975('0x41')][_0xb975('0x6f')][_0x4e6d6d]),'ChatQueueId':Number(_0xa00549['params']['id'])});}}else{socket[_0xb975('0x78')](_0xb975('0x95'),{'UserId':Number(_0xa00549[_0xb975('0x41')][_0xb975('0x6f')]),'ChatQueueId':Number(_0xa00549[_0xb975('0x5d')]['id'])});}});}})[_0xb975('0x33')](respondWithStatusCode(_0x14ce7b,null))[_0xb975('0x29')](handleError(_0x14ce7b,null));};exports[_0xb975('0x96')]=function(_0x1ea243,_0x850205,_0x1696cc){var _0x40d782={};var _0x17de32={};var _0x2cca7c;var _0x5883f4;return db[_0xb975('0x3c')]['findOne']({'where':{'id':_0x1ea243[_0xb975('0x5d')]['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x850205,null))['then'](function(_0x40e321){if(_0x40e321){_0x2cca7c=_0x40e321;_0x17de32[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x7b')]['rawAttributes']);_0x17de32[_0xb975('0x41')]=_[_0xb975('0x42')](_0x1ea243[_0xb975('0x41')]);_0x17de32[_0xb975('0x4c')]=_[_0xb975('0x43')](_0x17de32['model'],_0x17de32[_0xb975('0x41')]);_0x40d782[_0xb975('0x45')]=_[_0xb975('0x43')](_0x17de32[_0xb975('0x44')],qs[_0xb975('0x46')](_0x1ea243['query']['fields']));_0x40d782[_0xb975('0x45')]=_0x40d782['attributes']['length']?_0x40d782[_0xb975('0x45')]:_0x17de32[_0xb975('0x44')];_0x40d782[_0xb975('0x49')]=qs[_0xb975('0x4a')](_0x1ea243[_0xb975('0x41')]['sort']);_0x40d782[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_['pick'](_0x1ea243['query'],_0x17de32[_0xb975('0x4c')]));if(_0x1ea243[_0xb975('0x41')][_0xb975('0x4e')]){_0x40d782[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x40d782[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x40d782[_0xb975('0x45')],function(_0x4a2402){var _0x1d77cc={};_0x1d77cc[_0x4a2402]={'$like':'%'+_0x1ea243['query'][_0xb975('0x4e')]+'%'};return _0x1d77cc;})});}_0x40d782=_[_0xb975('0x4d')]({},_0x40d782,_0x1ea243[_0xb975('0x4f')]);return _0x2cca7c['getAgents'](_0x40d782);}})['then'](function(_0x15317f){if(_0x15317f){_0x5883f4=_0x15317f['length'];if(!_0x1ea243[_0xb975('0x41')][_0xb975('0x61')]('nolimit')){_0x40d782['limit']=qs[_0xb975('0x48')](_0x1ea243[_0xb975('0x41')][_0xb975('0x48')]);_0x40d782[_0xb975('0x2f')]=qs[_0xb975('0x2f')](_0x1ea243[_0xb975('0x41')][_0xb975('0x2f')]);}return _0x2cca7c[_0xb975('0x96')](_0x40d782);}})[_0xb975('0x33')](function(_0x4d91a3){if(_0x4d91a3){return _0x4d91a3?{'count':_0x5883f4,'rows':_0x4d91a3}:null;}})['then'](respondWithResult(_0x850205,null))[_0xb975('0x29')](handleError(_0x850205,null));}; \ No newline at end of file +var _0x4317=['then','info','ChatQueue,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','ChatQueue,\x20%s,\x20%s','message','result','catch','status','end','json','count','offset','set','Content-Range','reject','update','destroy','get','ChatQueues','UserProfileResource','sendStatus','stack','name','send','index','map','ChatQueue','fieldName','type','key','query','keys','intersection','attributes','model','fields','hasOwnProperty','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','rawAttributes','filters','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserChatQueue','nolimit','pick','ChatQueueId','User','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','rows','format','%s/%s','SIP','getTeams','Team','findAll','Agents','online','voicePause','interface','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','from','team_has_chat_queues','join','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','every','all','compact','value','isEmpty','removeAgents','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatQueue.socket','register','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request'];(function(_0x4a328d,_0x4c62d6){var _0x4410d9=function(_0x18243d){while(--_0x18243d){_0x4a328d['push'](_0x4a328d['shift']());}};_0x4410d9(++_0x4c62d6);}(_0x4317,0x7c));var _0x7431=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x4317[_0x4cf98e];return _0x1623ac;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7431('0x0'));var rimraf=require(_0x7431('0x1'));var zipdir=require(_0x7431('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7431('0x3'));var moment=require(_0x7431('0x4'));var BPromise=require(_0x7431('0x5'));var Mustache=require(_0x7431('0x6'));var util=require(_0x7431('0x7'));var path=require(_0x7431('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7431('0x9'));var fs=require('fs');var _=require(_0x7431('0xa'));var squel=require(_0x7431('0xb'));var crypto=require(_0x7431('0xc'));var jsforce=require(_0x7431('0xd'));var deskjs=require(_0x7431('0xe'));var toCsv=require(_0x7431('0xf'));var querystring=require(_0x7431('0x10'));var Papa=require(_0x7431('0x11'));var Redis=require(_0x7431('0x12'));var authService=require(_0x7431('0x13'));var qs=require(_0x7431('0x14'));var as=require(_0x7431('0x15'));var hardwareService=require(_0x7431('0x16'));var logger=require(_0x7431('0x17'))(_0x7431('0x18'));var utils=require(_0x7431('0x19'));var config=require(_0x7431('0x1a'));var db=require(_0x7431('0x1b'))['db'];config[_0x7431('0x1c')]=_[_0x7431('0x1d')](config[_0x7431('0x1c')],{'host':_0x7431('0x1e'),'port':0x18eb});var socket=require(_0x7431('0x1f'))(new Redis(config['redis']));require(_0x7431('0x20'))[_0x7431('0x21')](socket);var jayson=require(_0x7431('0x22'));var client=jayson['client'][_0x7431('0x23')]({'port':0x232a});function checkPasswordPattern(_0x38c2d1,_0x14bf18,_0x541904){if(_0x541904){var _0xc08396=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xc08396['test'](_0x14bf18)){return _0x38c2d1;}else{throw new db['Sequelize']['ValidationError'](_0x7431('0x24'));}}else{return _0x38c2d1;}}function respondWithRpcPromise(_0x1f5096,_0x2fe0df,_0x24f065,_0x4a7048){return new BPromise(function(_0x525efc,_0x167238){var _0x28aaab=_0x4a7048||client;return _0x28aaab[_0x7431('0x25')](_0x1f5096,_0x24f065)[_0x7431('0x26')](function(_0x1e7fdf){logger[_0x7431('0x27')]('ChatQueue,\x20%s,\x20%s',_0x2fe0df,'request\x20sent');logger['debug'](_0x7431('0x28'),_0x2fe0df,_0x7431('0x29'),JSON['stringify'](_0x1e7fdf));if(_0x1e7fdf[_0x7431('0x2a')]){if(_0x1e7fdf[_0x7431('0x2a')][_0x7431('0x2b')]===0x1f4){logger['error'](_0x7431('0x2c'),_0x2fe0df,_0x1e7fdf[_0x7431('0x2a')][_0x7431('0x2d')]);return _0x167238(_0x1e7fdf[_0x7431('0x2a')]['message']);}logger[_0x7431('0x2a')](_0x7431('0x2c'),_0x2fe0df,_0x1e7fdf[_0x7431('0x2a')][_0x7431('0x2d')]);return _0x525efc(_0x1e7fdf[_0x7431('0x2a')][_0x7431('0x2d')]);}else{logger[_0x7431('0x27')](_0x7431('0x2c'),_0x2fe0df,_0x7431('0x29'));_0x525efc(_0x1e7fdf[_0x7431('0x2e')][_0x7431('0x2d')]);}})[_0x7431('0x2f')](function(_0x551f92){logger[_0x7431('0x2a')]('ChatQueue,\x20%s,\x20%s',_0x2fe0df,_0x551f92);_0x167238(_0x551f92);});});}function respondWithStatusCode(_0x500ce7,_0x24727b){_0x24727b=_0x24727b||0xcc;return function(_0x16eab7){if(_0x16eab7){return _0x500ce7['sendStatus'](_0x24727b);}return _0x500ce7[_0x7431('0x30')](_0x24727b)[_0x7431('0x31')]();};}function respondWithResult(_0xb1ac3,_0x2701e2){_0x2701e2=_0x2701e2||0xc8;return function(_0x30e63f){if(_0x30e63f){return _0xb1ac3[_0x7431('0x30')](_0x2701e2)[_0x7431('0x32')](_0x30e63f);}};}function respondWithFilteredResult(_0x26a1be,_0x2e102c){return function(_0x2c9872){if(_0x2c9872){var _0x39c550=_0x2c9872[_0x7431('0x33')],_0xa63228=_0x2e102c[_0x7431('0x34')],_0x4a3cfe=_0x2e102c[_0x7431('0x34')]+_0x2e102c['limit'],_0x18ce37;if(_0x4a3cfe>=_0x39c550){_0x4a3cfe=_0x39c550;_0x18ce37=0xc8;}else{_0x18ce37=0xce;}_0x26a1be[_0x7431('0x30')](_0x18ce37);return _0x26a1be[_0x7431('0x35')](_0x7431('0x36'),_0xa63228+'-'+_0x4a3cfe+'/'+_0x39c550)['json'](_0x2c9872);}return null;};}function patchUpdates(_0x52e193){return function(_0xf074e8){try{jsonpatch['apply'](_0xf074e8,_0x52e193,!![]);}catch(_0x5349c5){return BPromise[_0x7431('0x37')](_0x5349c5);}return _0xf074e8['save']();};}function saveUpdates(_0x298d2e,_0x28b6cf){return function(_0x54d637){if(_0x54d637){return _0x54d637[_0x7431('0x38')](_0x298d2e)[_0x7431('0x26')](function(_0x54949c){return _0x54949c;});}return null;};}function removeEntity(_0x179628,_0x173f1a){return function(_0x18366b){if(_0x18366b){return _0x18366b[_0x7431('0x39')]()[_0x7431('0x26')](function(){var _0x4d2be3=_0x18366b[_0x7431('0x3a')]({'plain':!![]});var _0x4e033f=_0x7431('0x3b');return db[_0x7431('0x3c')][_0x7431('0x39')]({'where':{'type':_0x4e033f,'resourceId':_0x4d2be3['id']}})[_0x7431('0x26')](function(){return _0x18366b;});})[_0x7431('0x26')](function(){_0x179628[_0x7431('0x30')](0xcc)[_0x7431('0x31')]();});}};}function handleEntityNotFound(_0x1e5941,_0x988122){return function(_0x316e0c){if(!_0x316e0c){_0x1e5941[_0x7431('0x3d')](0x194);}return _0x316e0c;};}function handleError(_0x18f99b,_0x39a89d){_0x39a89d=_0x39a89d||0x1f4;return function(_0xfde13f){logger[_0x7431('0x2a')](_0xfde13f[_0x7431('0x3e')]);if(_0xfde13f[_0x7431('0x3f')]){delete _0xfde13f['name'];}_0x18f99b['status'](_0x39a89d)[_0x7431('0x40')](_0xfde13f);};}exports[_0x7431('0x41')]=function(_0x505591,_0x4ff7dd){var _0x1cb05a={},_0x226d0f={},_0x273bb8={'count':0x0,'rows':[]};var _0xab0565=_[_0x7431('0x42')](db[_0x7431('0x43')]['rawAttributes'],function(_0x576cf9){return{'name':_0x576cf9[_0x7431('0x44')],'type':_0x576cf9[_0x7431('0x45')][_0x7431('0x46')]};});_0x226d0f['model']=_['map'](_0xab0565,_0x7431('0x3f'));_0x226d0f[_0x7431('0x47')]=_[_0x7431('0x48')](_0x505591[_0x7431('0x47')]);_0x226d0f['filters']=_[_0x7431('0x49')](_0x226d0f['model'],_0x226d0f[_0x7431('0x47')]);_0x1cb05a[_0x7431('0x4a')]=_['intersection'](_0x226d0f[_0x7431('0x4b')],qs[_0x7431('0x4c')](_0x505591[_0x7431('0x47')]['fields']));_0x1cb05a[_0x7431('0x4a')]=_0x1cb05a[_0x7431('0x4a')]['length']?_0x1cb05a[_0x7431('0x4a')]:_0x226d0f[_0x7431('0x4b')];if(!_0x505591[_0x7431('0x47')][_0x7431('0x4d')]('nolimit')){_0x1cb05a[_0x7431('0x4e')]=qs['limit'](_0x505591['query'][_0x7431('0x4e')]);_0x1cb05a[_0x7431('0x34')]=qs[_0x7431('0x34')](_0x505591['query']['offset']);}_0x1cb05a[_0x7431('0x4f')]=qs[_0x7431('0x50')](_0x505591['query'][_0x7431('0x50')]);_0x1cb05a[_0x7431('0x51')]=qs['filters'](_['pick'](_0x505591[_0x7431('0x47')],_0x226d0f['filters']));if(_0x505591[_0x7431('0x47')][_0x7431('0x52')]){_0x1cb05a[_0x7431('0x51')]=_['merge'](_0x1cb05a[_0x7431('0x51')],{'$or':_['map'](_0xab0565,function(_0x6e10dd){if(_0x6e10dd[_0x7431('0x45')]!==_0x7431('0x53')){var _0x38a4af={};_0x38a4af[_0x6e10dd[_0x7431('0x3f')]]={'$like':'%'+_0x505591['query']['filter']+'%'};return _0x38a4af;}})});}_0x1cb05a=_[_0x7431('0x54')]({},_0x1cb05a,_0x505591[_0x7431('0x55')]);var _0x393159={'where':_0x1cb05a[_0x7431('0x51')]};return db[_0x7431('0x43')][_0x7431('0x33')](_0x393159)[_0x7431('0x26')](function(_0x4ae19b){_0x273bb8[_0x7431('0x33')]=_0x4ae19b;if(_0x505591[_0x7431('0x47')][_0x7431('0x56')]){_0x1cb05a[_0x7431('0x57')]=[{'all':!![]}];}return db[_0x7431('0x43')]['findAll'](_0x1cb05a);})[_0x7431('0x26')](function(_0x5afb12){_0x273bb8['rows']=_0x5afb12;return _0x273bb8;})[_0x7431('0x26')](respondWithFilteredResult(_0x4ff7dd,_0x1cb05a))[_0x7431('0x2f')](handleError(_0x4ff7dd,null));};exports[_0x7431('0x58')]=function(_0x477641,_0x15bf44){var _0xfd3c3f={'raw':!![],'where':{'id':_0x477641[_0x7431('0x59')]['id']}},_0x49f969={};_0x49f969[_0x7431('0x4b')]=_['keys'](db[_0x7431('0x43')][_0x7431('0x5a')]);_0x49f969[_0x7431('0x47')]=_[_0x7431('0x48')](_0x477641['query']);_0x49f969[_0x7431('0x5b')]=_['intersection'](_0x49f969['model'],_0x49f969[_0x7431('0x47')]);_0xfd3c3f[_0x7431('0x4a')]=_[_0x7431('0x49')](_0x49f969[_0x7431('0x4b')],qs[_0x7431('0x4c')](_0x477641[_0x7431('0x47')][_0x7431('0x4c')]));_0xfd3c3f['attributes']=_0xfd3c3f[_0x7431('0x4a')][_0x7431('0x5c')]?_0xfd3c3f['attributes']:_0x49f969[_0x7431('0x4b')];if(_0x477641[_0x7431('0x47')]['includeAll']){_0xfd3c3f[_0x7431('0x57')]=[{'all':!![]}];}_0xfd3c3f=_[_0x7431('0x54')]({},_0xfd3c3f,_0x477641[_0x7431('0x55')]);return db['ChatQueue']['find'](_0xfd3c3f)[_0x7431('0x26')](handleEntityNotFound(_0x15bf44,null))[_0x7431('0x26')](respondWithResult(_0x15bf44,null))[_0x7431('0x2f')](handleError(_0x15bf44,null));};exports['create']=function(_0x1cdeec,_0x1ff3ab){return db[_0x7431('0x43')][_0x7431('0x5d')](_0x1cdeec[_0x7431('0x5e')],{})[_0x7431('0x26')](function(_0x5b1e7d){var _0x59e6da=_0x1cdeec[_0x7431('0x5f')]['get']({'plain':!![]});if(!_0x59e6da)throw new Error(_0x7431('0x60'));if(_0x59e6da[_0x7431('0x61')]==='user'){var _0x104857=_0x5b1e7d[_0x7431('0x3a')]({'plain':!![]});var _0x494626='ChatQueues';return db[_0x7431('0x62')][_0x7431('0x63')]({'where':{'name':_0x494626,'userProfileId':_0x59e6da[_0x7431('0x64')]},'raw':!![]})[_0x7431('0x26')](function(_0x4502be){if(_0x4502be&&_0x4502be[_0x7431('0x65')]===0x0){return db[_0x7431('0x3c')][_0x7431('0x5d')]({'name':_0x104857['name'],'resourceId':_0x104857['id'],'type':_0x4502be['name'],'sectionId':_0x4502be['id']},{})['then'](function(){return _0x5b1e7d;});}else{return _0x5b1e7d;}})['catch'](function(_0x3fe98d){logger[_0x7431('0x2a')](_0x7431('0x66'),_0x3fe98d);throw _0x3fe98d;});}return _0x5b1e7d;})['then'](respondWithResult(_0x1ff3ab,0xc9))[_0x7431('0x2f')](handleError(_0x1ff3ab,null));};exports[_0x7431('0x38')]=function(_0xf705b0,_0x2c3533){if(_0xf705b0[_0x7431('0x5e')]['id']){delete _0xf705b0[_0x7431('0x5e')]['id'];}return db[_0x7431('0x43')][_0x7431('0x63')]({'where':{'id':_0xf705b0['params']['id']}})[_0x7431('0x26')](handleEntityNotFound(_0x2c3533,null))[_0x7431('0x26')](saveUpdates(_0xf705b0['body'],null))['then'](respondWithResult(_0x2c3533,null))['catch'](handleError(_0x2c3533,null));};exports[_0x7431('0x39')]=function(_0x38c979,_0x52b2e8){return db[_0x7431('0x43')][_0x7431('0x63')]({'where':{'id':_0x38c979[_0x7431('0x59')]['id']}})['then'](handleEntityNotFound(_0x52b2e8,null))[_0x7431('0x26')](removeEntity(_0x52b2e8,null))[_0x7431('0x2f')](handleError(_0x52b2e8,null));};exports[_0x7431('0x67')]=function(_0x20d56c,_0x3b35e9){return db[_0x7431('0x43')]['describe']()[_0x7431('0x26')](respondWithResult(_0x3b35e9,null))['catch'](handleError(_0x3b35e9,null));};exports[_0x7431('0x68')]=function(_0x232bd6,_0x366b0e,_0x2679a8){var _0x5e52e8={'raw':!![],'where':{}},_0x471d56={},_0x381aad;return db[_0x7431('0x43')][_0x7431('0x69')]({'where':{'id':_0x232bd6[_0x7431('0x59')]['id']}})[_0x7431('0x26')](handleEntityNotFound(_0x366b0e,null))[_0x7431('0x26')](function(_0x25e08d){if(_0x25e08d){_0x381aad=_0x25e08d[_0x7431('0x3a')]({'plain':!![]});_0x471d56[_0x7431('0x4b')]=_[_0x7431('0x48')](db[_0x7431('0x6a')][_0x7431('0x5a')]);_0x471d56[_0x7431('0x47')]=_[_0x7431('0x48')](_0x232bd6[_0x7431('0x47')]);_0x471d56[_0x7431('0x5b')]=_[_0x7431('0x49')](_0x471d56[_0x7431('0x4b')],_0x471d56[_0x7431('0x47')]);_0x5e52e8[_0x7431('0x4a')]=_[_0x7431('0x49')](_0x471d56[_0x7431('0x4b')],qs[_0x7431('0x4c')](_0x232bd6[_0x7431('0x47')]['fields']));_0x5e52e8[_0x7431('0x4a')]=_0x5e52e8[_0x7431('0x4a')][_0x7431('0x5c')]?_0x5e52e8[_0x7431('0x4a')]:_0x471d56[_0x7431('0x4b')];if(!_0x232bd6[_0x7431('0x47')][_0x7431('0x4d')](_0x7431('0x6b'))){_0x5e52e8[_0x7431('0x4e')]=qs[_0x7431('0x4e')](_0x232bd6['query'][_0x7431('0x4e')]);_0x5e52e8[_0x7431('0x34')]=qs[_0x7431('0x34')](_0x232bd6[_0x7431('0x47')][_0x7431('0x34')]);}_0x5e52e8[_0x7431('0x4f')]=qs[_0x7431('0x50')](_0x232bd6['query'][_0x7431('0x50')]);_0x5e52e8[_0x7431('0x51')]=qs[_0x7431('0x5b')](_[_0x7431('0x6c')](_0x232bd6[_0x7431('0x47')],_0x471d56['filters']));_0x5e52e8[_0x7431('0x51')][_0x7431('0x6d')]=_0x25e08d['id'];if(_0x232bd6[_0x7431('0x47')][_0x7431('0x52')]){_0x5e52e8['where']=_[_0x7431('0x54')](_0x5e52e8[_0x7431('0x51')],{'$or':_[_0x7431('0x42')](_0x5e52e8['attributes'],function(_0x25695b){var _0x2f2806={};_0x2f2806[_0x25695b]={'$like':'%'+_0x232bd6[_0x7431('0x47')][_0x7431('0x52')]+'%'};return _0x2f2806;})});}_0x5e52e8=_[_0x7431('0x54')]({},_0x5e52e8,_0x232bd6[_0x7431('0x55')]);return db[_0x7431('0x6a')]['findAll'](_0x5e52e8);}})[_0x7431('0x26')](function(_0x2af235){if(_0x2af235){return db[_0x7431('0x6e')][_0x7431('0x6f')]({'where':{'id':_['map'](_0x2af235,_0x7431('0x70')),'role':_0x7431('0x71')},'attributes':['id','name',_0x7431('0x72'),_0x7431('0x73'),_0x7431('0x74')]});}})[_0x7431('0x26')](function(_0x3ceaf5){if(_0x3ceaf5){return{'count':_0x3ceaf5[_0x7431('0x33')],'rows':_[_0x7431('0x42')](_0x3ceaf5[_0x7431('0x75')],function(_0x1022ad){return{'membername':_0x1022ad[_0x7431('0x3f')],'UserId':_0x1022ad['id'],'queue_name':_0x381aad['name'],'ChatQueueId':_0x381aad['id'],'interface':util[_0x7431('0x76')](_0x7431('0x77'),_0x7431('0x78'),_0x1022ad['name']),'penalty':0x0,'paused':_0x1022ad[_0x7431('0x72')],'createdAt':_0x1022ad[_0x7431('0x74')],'updatedAt':_0x1022ad[_0x7431('0x73')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x366b0e,_0x5e52e8))[_0x7431('0x2f')](handleError(_0x366b0e,null));};exports[_0x7431('0x79')]=function(_0x39ce1b,_0x1e0d45,_0x10d474){var _0x318a1d={};var _0x221a81={};var _0x26fcc0;var _0x1c9fa5;return db[_0x7431('0x43')][_0x7431('0x69')]({'where':{'id':_0x39ce1b[_0x7431('0x59')]['id']}})['then'](handleEntityNotFound(_0x1e0d45,null))[_0x7431('0x26')](function(_0x274436){if(_0x274436){_0x26fcc0=_0x274436;_0x221a81[_0x7431('0x4b')]=_[_0x7431('0x48')](db['Team'][_0x7431('0x5a')]);_0x221a81[_0x7431('0x47')]=_[_0x7431('0x48')](_0x39ce1b[_0x7431('0x47')]);_0x221a81[_0x7431('0x5b')]=_[_0x7431('0x49')](_0x221a81[_0x7431('0x4b')],_0x221a81['query']);_0x318a1d[_0x7431('0x4a')]=_['intersection'](_0x221a81['model'],qs[_0x7431('0x4c')](_0x39ce1b[_0x7431('0x47')][_0x7431('0x4c')]));_0x318a1d[_0x7431('0x4a')]=_0x318a1d[_0x7431('0x4a')][_0x7431('0x5c')]?_0x318a1d[_0x7431('0x4a')]:_0x221a81[_0x7431('0x4b')];_0x318a1d[_0x7431('0x4f')]=qs[_0x7431('0x50')](_0x39ce1b[_0x7431('0x47')][_0x7431('0x50')]);_0x318a1d['where']=qs[_0x7431('0x5b')](_[_0x7431('0x6c')](_0x39ce1b[_0x7431('0x47')],_0x221a81[_0x7431('0x5b')]));if(_0x39ce1b[_0x7431('0x47')]['filter']){_0x318a1d['where']=_['merge'](_0x318a1d[_0x7431('0x51')],{'$or':_[_0x7431('0x42')](_0x318a1d['attributes'],function(_0x35d884){var _0x39914d={};_0x39914d[_0x35d884]={'$like':'%'+_0x39ce1b[_0x7431('0x47')][_0x7431('0x52')]+'%'};return _0x39914d;})});}_0x318a1d=_[_0x7431('0x54')]({},_0x318a1d,_0x39ce1b[_0x7431('0x55')]);return _0x26fcc0[_0x7431('0x79')](_0x318a1d);}})[_0x7431('0x26')](function(_0x2a0904){if(_0x2a0904){_0x1c9fa5=_0x2a0904[_0x7431('0x5c')];if(!_0x39ce1b[_0x7431('0x47')]['hasOwnProperty']('nolimit')){_0x318a1d[_0x7431('0x4e')]=qs['limit'](_0x39ce1b[_0x7431('0x47')]['limit']);_0x318a1d['offset']=qs[_0x7431('0x34')](_0x39ce1b['query'][_0x7431('0x34')]);}return _0x26fcc0[_0x7431('0x79')](_0x318a1d);}})[_0x7431('0x26')](function(_0x4ac843){if(_0x4ac843){return _0x4ac843?{'count':_0x1c9fa5,'rows':_0x4ac843}:null;}})[_0x7431('0x26')](respondWithResult(_0x1e0d45,null))[_0x7431('0x2f')](handleError(_0x1e0d45,null));};exports['addTeams']=function(_0x55929f,_0x704ab,_0x1ef44b){var _0x3eb012=_0x55929f[_0x7431('0x5e')]['ids'];return db[_0x7431('0x7a')][_0x7431('0x7b')]({'where':{'id':_0x3eb012},'attributes':['id'],'include':[{'model':db[_0x7431('0x6e')],'as':_0x7431('0x7c'),'attributes':['id','name',_0x7431('0x7d'),_0x7431('0x7e'),_0x7431('0x7f')],'raw':!![]}]})[_0x7431('0x26')](function(_0x531a52){if(_0x531a52){var _0x3d2e8f=_['flatMap'](_0x531a52,function(_0x42f4da){var _0x5e1f83=_0x42f4da[_0x7431('0x3a')]({'plain':!![]});return _0x5e1f83[_0x7431('0x7c')];});return db['ChatQueue']['find']({'where':{'id':_0x55929f[_0x7431('0x59')]['id']}})[_0x7431('0x26')](function(_0x2e76ab){return db[_0x7431('0x80')][_0x7431('0x81')](function(_0x2458e){return _0x2e76ab[_0x7431('0x82')](_0x3eb012,{'transaction':_0x2458e})[_0x7431('0x26')](function(){return BPromise[_0x7431('0x83')](_0x3d2e8f,function(_0x58fd70){return db['UserChatQueue'][_0x7431('0x84')]({'where':{'UserId':_0x58fd70['id'],'ChatQueueId':_0x55929f[_0x7431('0x59')]['id']},'transaction':_0x2458e});});})[_0x7431('0x26')](function(){_0x3d2e8f[_0x7431('0x85')](function(_0x545222){socket[_0x7431('0x86')](_0x7431('0x87'),{'UserId':_0x545222['id'],'ChatQueueId':_0x2e76ab['id']});});});});});}})[_0x7431('0x26')](respondWithStatusCode(_0x704ab,null))[_0x7431('0x2f')](handleError(_0x704ab,null));};exports[_0x7431('0x88')]=function(_0x1eac23,_0x214b6c,_0x3ec97e){return db[_0x7431('0x7a')][_0x7431('0x7b')]({'where':{'id':_0x1eac23['query'][_0x7431('0x89')]},'attributes':['id'],'include':[{'model':db[_0x7431('0x6e')],'as':_0x7431('0x7c'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x214b6c,null))[_0x7431('0x26')](function(_0x3fc6e1){var _0x17dc57=_[_0x7431('0x42')](_0x3fc6e1,'id');var _0x214902=[];var _0x524593=[];var _0x15d0f9=squel[_0x7431('0x8a')]();_0x15d0f9[_0x7431('0x8b')](_0x7431('0x8c'))[_0x7431('0x8d')](_0x7431('0x8e'),'tq')[_0x7431('0x8f')]('user_has_teams','ut',_0x7431('0x90'))[_0x7431('0x51')](_0x7431('0x91'),_0x1eac23[_0x7431('0x59')]['id']);for(var _0x404af9=0x0;_0x404af9<_0x3fc6e1[_0x7431('0x5c')];_0x404af9+=0x1){let _0x14d943=_0x3fc6e1[_0x404af9];for(var _0x24e5a1=0x0;_0x24e5a1<_0x14d943['Agents'][_0x7431('0x5c')];_0x24e5a1+=0x1){let _0x37b4ef=_0x14d943['Agents'][_0x24e5a1];var _0x5497f0=_0x15d0f9[_0x7431('0x92')]();_0x5497f0[_0x7431('0x51')](_0x7431('0x93'),_0x37b4ef['id']);_0x524593[_0x7431('0x94')](db['sequelize'][_0x7431('0x47')](_0x5497f0[_0x7431('0x95')](),{'type':db[_0x7431('0x80')]['QueryTypes']['SELECT']})[_0x7431('0x26')](function(_0x210d33){if(_0x210d33['length']===0x1){return _0x37b4ef['id'];}else{var _0x40c8c9=_[_0x7431('0x96')](_[_0x7431('0x42')](_0x210d33,'TeamId'),function(_0x4f91f0){return _['includes'](_0x17dc57,_0x4f91f0);});if(_0x40c8c9){return _0x37b4ef['id'];}}}));}}return BPromise[_0x7431('0x97')](_0x524593)[_0x7431('0x26')](function(_0x40ea84){_0x214902=_(_0x214902)['union'](_0x40ea84)[_0x7431('0x98')]()[_0x7431('0x99')]();return db[_0x7431('0x43')][_0x7431('0x63')]({'where':{'id':_0x1eac23[_0x7431('0x59')]['id']}})[_0x7431('0x26')](function(_0x10cd3d){return db[_0x7431('0x80')]['transaction'](function(_0x3bf6da){return _0x10cd3d[_0x7431('0x88')](_0x1eac23[_0x7431('0x47')][_0x7431('0x89')],{'transaction':_0x3bf6da})['then'](function(){if(!_[_0x7431('0x9a')](_0x214902)){return _0x10cd3d[_0x7431('0x9b')](_0x214902,{'transaction':_0x3bf6da});}})[_0x7431('0x26')](function(){_0x214902['forEach'](function(_0x36f3af){socket[_0x7431('0x86')](_0x7431('0x9c'),{'UserId':_0x36f3af,'ChatQueueId':_0x10cd3d['id']});});});});});});})[_0x7431('0x26')](respondWithStatusCode(_0x214b6c,null))[_0x7431('0x2f')](handleError(_0x214b6c,null));};exports[_0x7431('0x9d')]=function(_0x2da767,_0x4089f2,_0x2052d4){return db[_0x7431('0x43')][_0x7431('0x63')]({'where':{'id':_0x2da767[_0x7431('0x59')]['id']}})[_0x7431('0x26')](handleEntityNotFound(_0x4089f2,null))[_0x7431('0x26')](function(_0x3bcb2b){if(_0x3bcb2b){return _0x3bcb2b[_0x7431('0x9d')](_0x2da767[_0x7431('0x5e')][_0x7431('0x89')],_[_0x7431('0x9e')](_0x2da767[_0x7431('0x5e')],['ids','id'])||{})[_0x7431('0x9f')](function(_0x3bbf07){for(var _0x249840=0x0;_0x249840<_0x2da767[_0x7431('0x5e')][_0x7431('0x89')]['length'];_0x249840+=0x1){socket[_0x7431('0x86')](_0x7431('0x87'),{'UserId':_0x2da767[_0x7431('0x5e')]['ids'][_0x249840],'ChatQueueId':_0x2da767['params']['id']});}return _0x3bbf07;});}})[_0x7431('0x26')](respondWithResult(_0x4089f2,null))[_0x7431('0x2f')](handleError(_0x4089f2,null));};exports[_0x7431('0x9b')]=function(_0x375b83,_0x5c5711,_0x267429){return db[_0x7431('0x43')][_0x7431('0x63')]({'where':{'id':_0x375b83[_0x7431('0x59')]['id']}})[_0x7431('0x26')](handleEntityNotFound(_0x5c5711,null))[_0x7431('0x26')](function(_0xc7ac7){if(_0xc7ac7){return _0xc7ac7['removeAgents'](_0x375b83[_0x7431('0x47')][_0x7431('0x89')])[_0x7431('0x26')](function(){if(_[_0x7431('0xa0')](_0x375b83[_0x7431('0x47')][_0x7431('0x89')])){for(var _0x532d11=0x0;_0x532d11<_0x375b83[_0x7431('0x47')]['ids'][_0x7431('0x5c')];_0x532d11+=0x1){socket[_0x7431('0x86')](_0x7431('0x9c'),{'UserId':Number(_0x375b83[_0x7431('0x47')][_0x7431('0x89')][_0x532d11]),'ChatQueueId':Number(_0x375b83[_0x7431('0x59')]['id'])});}}else{socket[_0x7431('0x86')](_0x7431('0x9c'),{'UserId':Number(_0x375b83[_0x7431('0x47')][_0x7431('0x89')]),'ChatQueueId':Number(_0x375b83['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5c5711,null))[_0x7431('0x2f')](handleError(_0x5c5711,null));};exports['getAgents']=function(_0x56b9d5,_0x4153a8,_0x4a3aff){var _0x1374fa={};var _0x5bbffe={};var _0x18b460;var _0x1e6a06;return db['ChatQueue'][_0x7431('0x69')]({'where':{'id':_0x56b9d5[_0x7431('0x59')]['id']}})['then'](handleEntityNotFound(_0x4153a8,null))[_0x7431('0x26')](function(_0x583599){if(_0x583599){_0x18b460=_0x583599;_0x5bbffe['model']=_['keys'](db[_0x7431('0x6e')][_0x7431('0x5a')]);_0x5bbffe['query']=_[_0x7431('0x48')](_0x56b9d5[_0x7431('0x47')]);_0x5bbffe['filters']=_[_0x7431('0x49')](_0x5bbffe['model'],_0x5bbffe[_0x7431('0x47')]);_0x1374fa[_0x7431('0x4a')]=_[_0x7431('0x49')](_0x5bbffe['model'],qs[_0x7431('0x4c')](_0x56b9d5[_0x7431('0x47')][_0x7431('0x4c')]));_0x1374fa['attributes']=_0x1374fa[_0x7431('0x4a')]['length']?_0x1374fa[_0x7431('0x4a')]:_0x5bbffe[_0x7431('0x4b')];_0x1374fa['order']=qs[_0x7431('0x50')](_0x56b9d5[_0x7431('0x47')]['sort']);_0x1374fa['where']=qs[_0x7431('0x5b')](_[_0x7431('0x6c')](_0x56b9d5[_0x7431('0x47')],_0x5bbffe[_0x7431('0x5b')]));if(_0x56b9d5['query'][_0x7431('0x52')]){_0x1374fa['where']=_[_0x7431('0x54')](_0x1374fa[_0x7431('0x51')],{'$or':_['map'](_0x1374fa[_0x7431('0x4a')],function(_0xe23335){var _0x46bd71={};_0x46bd71[_0xe23335]={'$like':'%'+_0x56b9d5[_0x7431('0x47')][_0x7431('0x52')]+'%'};return _0x46bd71;})});}_0x1374fa=_[_0x7431('0x54')]({},_0x1374fa,_0x56b9d5[_0x7431('0x55')]);return _0x18b460['getAgents'](_0x1374fa);}})[_0x7431('0x26')](function(_0x4eb4b4){if(_0x4eb4b4){_0x1e6a06=_0x4eb4b4[_0x7431('0x5c')];if(!_0x56b9d5['query']['hasOwnProperty'](_0x7431('0x6b'))){_0x1374fa[_0x7431('0x4e')]=qs[_0x7431('0x4e')](_0x56b9d5[_0x7431('0x47')][_0x7431('0x4e')]);_0x1374fa[_0x7431('0x34')]=qs['offset'](_0x56b9d5[_0x7431('0x47')][_0x7431('0x34')]);}return _0x18b460[_0x7431('0xa1')](_0x1374fa);}})[_0x7431('0x26')](function(_0x50d4e3){if(_0x50d4e3){return _0x50d4e3?{'count':_0x1e6a06,'rows':_0x50d4e3}:null;}})[_0x7431('0x26')](respondWithResult(_0x4153a8,null))[_0x7431('0x2f')](handleError(_0x4153a8,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index e4c1712..e53c61c 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 _0xb10b=['hasOwnProperty','hook','events','ChatQueue','setMaxListeners','save','remove','emit'];(function(_0x54edae,_0x151fe6){var _0x34ff50=function(_0x14e9ce){while(--_0x14e9ce){_0x54edae['push'](_0x54edae['shift']());}};_0x34ff50(++_0x151fe6);}(_0xb10b,0x12a));var _0xbb10=function(_0x4be57c,_0x151881){_0x4be57c=_0x4be57c-0x0;var _0x5901da=_0xb10b[_0x4be57c];return _0x5901da;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatQueueEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatQueueEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatQueue[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0xbaf0=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','../../mysqldb','ChatQueue'];(function(_0x17e0ff,_0x4dbd1e){var _0x357979=function(_0x443276){while(--_0x443276){_0x17e0ff['push'](_0x17e0ff['shift']());}};_0x357979(++_0x4dbd1e);}(_0xbaf0,0x12a));var _0x0baf=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xbaf0[_0x1facfa];return _0x9ec701;};'use strict';var EventEmitter=require('events');var ChatQueue=require(_0x0baf('0x0'))['db'][_0x0baf('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0x0baf('0x2')](0x0);var events={'afterCreate':_0x0baf('0x3'),'afterUpdate':_0x0baf('0x4'),'afterDestroy':_0x0baf('0x5')};function emitEvent(_0x5a3e42){return function(_0x232cc7,_0x1c383e,_0x2d3fa5){ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42+':'+_0x232cc7['id'],_0x232cc7);ChatQueueEvents[_0x0baf('0x6')](_0x5a3e42,_0x232cc7);_0x2d3fa5(null);};}for(var e in events){if(events[_0x0baf('0x7')](e)){var event=events[e];ChatQueue[_0x0baf('0x8')](e,emitEvent(event));}}module[_0x0baf('0x9')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 3de34ee..15085d9 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 _0x8f39=['path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','api','bluebird','request-promise'];(function(_0x476f2f,_0x30dc16){var _0x213a4d=function(_0x4b1219){while(--_0x4b1219){_0x476f2f['push'](_0x476f2f['shift']());}};_0x213a4d(++_0x30dc16);}(_0x8f39,0x1a8));var _0x98f3=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0x8f39[_0xa148b7];return _0x51efd3;};'use strict';var _=require(_0x98f3('0x0'));var util=require(_0x98f3('0x1'));var logger=require('../../config/logger')(_0x98f3('0x2'));var moment=require('moment');var BPromise=require(_0x98f3('0x3'));var rp=require(_0x98f3('0x4'));var fs=require('fs');var path=require(_0x98f3('0x5'));var rimraf=require(_0x98f3('0x6'));var config=require(_0x98f3('0x7'));var attributes=require(_0x98f3('0x8'));module[_0x98f3('0x9')]=function(_0x5555a3,_0x192afb){return _0x5555a3[_0x98f3('0xa')](_0x98f3('0xb'),attributes,{'tableName':_0x98f3('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1482=['ChatQueue','chat_queues','lodash','util','../../config/logger','moment','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x188958,_0x5469ae){var _0x1ac5fa=function(_0x4f330d){while(--_0x4f330d){_0x188958['push'](_0x188958['shift']());}};_0x1ac5fa(++_0x5469ae);}(_0x1482,0x9e));var _0x2148=function(_0x117b9b,_0x31afec){_0x117b9b=_0x117b9b-0x0;var _0x297e27=_0x1482[_0x117b9b];return _0x297e27;};'use strict';var _=require(_0x2148('0x0'));var util=require(_0x2148('0x1'));var logger=require(_0x2148('0x2'))('api');var moment=require(_0x2148('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x2148('0x4'));var rimraf=require(_0x2148('0x5'));var config=require(_0x2148('0x6'));var attributes=require(_0x2148('0x7'));module[_0x2148('0x8')]=function(_0x41f5ba,_0x190740){return _0x41f5ba[_0x2148('0x9')](_0x2148('0xa'),attributes,{'tableName':_0x2148('0xb'),'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 26296f5..ac39d8a 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 _0x286a=['where','attributes','include','map','model','catch','ShowChatQueue','find','raw','stringify','lodash','util','moment','bluebird','../../config/utils','../../config/environment','http','localhost','redis','./chatQueue.socket','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','GetChatQueue','ChatQueue','findAll','options'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x286a,0x76));var _0xa286=function(_0x3ef1fb,_0x4b803d){_0x3ef1fb=_0x3ef1fb-0x0;var _0x568c9b=_0x286a[_0x3ef1fb];return _0x568c9b;};'use strict';var _=require(_0xa286('0x0'));var util=require(_0xa286('0x1'));var moment=require(_0xa286('0x2'));var BPromise=require(_0xa286('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa286('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xa286('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa286('0x6')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xa286('0x7'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa286('0x8')]));require(_0xa286('0x9'))[_0xa286('0xa')](socket);function respondWithRpcPromise(_0x738dba,_0x17b414,_0x522c18){return new BPromise(function(_0x175220,_0x46f3de){return client[_0xa286('0xb')](_0x738dba,_0x522c18)[_0xa286('0xc')](function(_0x2cf80f){logger[_0xa286('0xd')](_0xa286('0xe'),_0x17b414,_0xa286('0xf'));logger[_0xa286('0x10')](_0xa286('0x11'),_0x17b414,_0xa286('0xf'),JSON['stringify'](_0x2cf80f));if(_0x2cf80f[_0xa286('0x12')]){if(_0x2cf80f[_0xa286('0x12')][_0xa286('0x13')]===0x1f4){logger[_0xa286('0x12')](_0xa286('0xe'),_0x17b414,_0x2cf80f['error'][_0xa286('0x14')]);return _0x46f3de(_0x2cf80f[_0xa286('0x12')][_0xa286('0x14')]);}logger[_0xa286('0x12')](_0xa286('0xe'),_0x17b414,_0x2cf80f[_0xa286('0x12')][_0xa286('0x14')]);return _0x175220(_0x2cf80f[_0xa286('0x12')][_0xa286('0x14')]);}else{logger[_0xa286('0xd')](_0xa286('0xe'),_0x17b414,'request\x20sent');_0x175220(_0x2cf80f[_0xa286('0x15')][_0xa286('0x14')]);}})['catch'](function(_0x173dd7){logger[_0xa286('0x12')](_0xa286('0xe'),_0x17b414,_0x173dd7);_0x46f3de(_0x173dd7);});});}exports[_0xa286('0x16')]=function(_0x10254c){var _0x4853=this;return new Promise(function(_0x8ea6f8,_0x2b9e7a){return db[_0xa286('0x17')][_0xa286('0x18')]({'raw':_0x10254c[_0xa286('0x19')]?_0x10254c[_0xa286('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x10254c[_0xa286('0x19')]?_0x10254c[_0xa286('0x19')][_0xa286('0x1a')]||null:null,'attributes':_0x10254c[_0xa286('0x19')]?_0x10254c[_0xa286('0x19')][_0xa286('0x1b')]||null:null,'limit':_0x10254c[_0xa286('0x19')]?_0x10254c[_0xa286('0x19')]['limit']||null:null,'include':_0x10254c[_0xa286('0x19')]?_0x10254c[_0xa286('0x19')][_0xa286('0x1c')]?_[_0xa286('0x1d')](_0x10254c[_0xa286('0x19')]['include'],function(_0x49d5c9){return{'model':db[_0x49d5c9['model']],'as':_0x49d5c9['as'],'attributes':_0x49d5c9['attributes'],'include':_0x49d5c9[_0xa286('0x1c')]?_[_0xa286('0x1d')](_0x49d5c9[_0xa286('0x1c')],function(_0x41feeb){return{'model':db[_0x41feeb[_0xa286('0x1e')]],'as':_0x41feeb['as'],'attributes':_0x41feeb[_0xa286('0x1b')],'include':_0x41feeb['include']?_['map'](_0x41feeb[_0xa286('0x1c')],function(_0xabe082){return{'model':db[_0xabe082[_0xa286('0x1e')]],'as':_0xabe082['as'],'attributes':_0xabe082[_0xa286('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xa286('0xc')](function(_0x400e91){logger[_0xa286('0xd')](_0xa286('0x16'),_0x10254c);logger['debug'](_0xa286('0x16'),_0x10254c,JSON['stringify'](_0x400e91));_0x8ea6f8(_0x400e91);})[_0xa286('0x1f')](function(_0x59d3fe){logger[_0xa286('0x12')]('GetChatQueue',_0x59d3fe[_0xa286('0x14')],_0x10254c);_0x2b9e7a(_0x4853['error'](0x1f4,_0x59d3fe[_0xa286('0x14')]));});});};exports[_0xa286('0x20')]=function(_0x37fb99){var _0x16f50f=this;return new Promise(function(_0x570b23,_0x5cdc6f){return db[_0xa286('0x17')][_0xa286('0x21')]({'raw':_0x37fb99[_0xa286('0x19')]?_0x37fb99[_0xa286('0x19')][_0xa286('0x22')]===undefined?!![]:![]:!![],'where':_0x37fb99[_0xa286('0x19')]?_0x37fb99['options']['where']||null:null,'attributes':_0x37fb99[_0xa286('0x19')]?_0x37fb99[_0xa286('0x19')][_0xa286('0x1b')]||null:null,'include':_0x37fb99['options']?_0x37fb99[_0xa286('0x19')][_0xa286('0x1c')]?_['map'](_0x37fb99[_0xa286('0x19')]['include'],function(_0x2feab0){return{'model':db[_0x2feab0[_0xa286('0x1e')]],'as':_0x2feab0['as'],'attributes':_0x2feab0[_0xa286('0x1b')],'include':_0x2feab0[_0xa286('0x1c')]?_[_0xa286('0x1d')](_0x2feab0['include'],function(_0x253594){return{'model':db[_0x253594[_0xa286('0x1e')]],'as':_0x253594['as'],'attributes':_0x253594[_0xa286('0x1b')],'include':_0x253594['include']?_['map'](_0x253594[_0xa286('0x1c')],function(_0x3c032e){return{'model':db[_0x3c032e[_0xa286('0x1e')]],'as':_0x3c032e['as'],'attributes':_0x3c032e[_0xa286('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x550064){logger['info'](_0xa286('0x20'),_0x37fb99);logger[_0xa286('0x10')](_0xa286('0x20'),_0x37fb99,JSON[_0xa286('0x23')](_0x550064));_0x570b23(_0x550064);})[_0xa286('0x1f')](function(_0x431a27){logger[_0xa286('0x12')](_0xa286('0x20'),_0x431a27[_0xa286('0x14')],_0x37fb99);_0x5cdc6f(_0x16f50f[_0xa286('0x12')](0x1f4,_0x431a27['message']));});});}; \ No newline at end of file +var _0xa321=['options','raw','where','attributes','limit','include','map','model','ShowChatQueue','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','http','defaults','redis','localhost','socket.io-emitter','register','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','GetChatQueue','findAll'];(function(_0x56cfdc,_0x49a1bd){var _0x2251fd=function(_0x26d823){while(--_0x26d823){_0x56cfdc['push'](_0x56cfdc['shift']());}};_0x2251fd(++_0x49a1bd);}(_0xa321,0x9d));var _0x1a32=function(_0x4fbaf9,_0x3b8190){_0x4fbaf9=_0x4fbaf9-0x0;var _0x1d89a0=_0xa321[_0x4fbaf9];return _0x1d89a0;};'use strict';var _=require(_0x1a32('0x0'));var util=require(_0x1a32('0x1'));var moment=require(_0x1a32('0x2'));var BPromise=require(_0x1a32('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1a32('0x4'));var db=require(_0x1a32('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x1a32('0x6'))(_0x1a32('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x1a32('0x8')]({'port':0x232a});config['redis']=_[_0x1a32('0x9')](config[_0x1a32('0xa')],{'host':_0x1a32('0xb'),'port':0x18eb});var socket=require(_0x1a32('0xc'))(new Redis(config[_0x1a32('0xa')]));require('./chatQueue.socket')[_0x1a32('0xd')](socket);function respondWithRpcPromise(_0xa920f7,_0x5d034a,_0x14d287){return new BPromise(function(_0x3cf338,_0x1ce64e){return client[_0x1a32('0xe')](_0xa920f7,_0x14d287)[_0x1a32('0xf')](function(_0x31f14f){logger['info'](_0x1a32('0x10'),_0x5d034a,_0x1a32('0x11'));logger[_0x1a32('0x12')]('ChatQueue,\x20%s,\x20%s,\x20%s',_0x5d034a,_0x1a32('0x11'),JSON[_0x1a32('0x13')](_0x31f14f));if(_0x31f14f[_0x1a32('0x14')]){if(_0x31f14f[_0x1a32('0x14')][_0x1a32('0x15')]===0x1f4){logger['error'](_0x1a32('0x10'),_0x5d034a,_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);return _0x1ce64e(_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);}logger[_0x1a32('0x14')]('ChatQueue,\x20%s,\x20%s',_0x5d034a,_0x31f14f[_0x1a32('0x14')][_0x1a32('0x16')]);return _0x3cf338(_0x31f14f['error'][_0x1a32('0x16')]);}else{logger[_0x1a32('0x17')](_0x1a32('0x10'),_0x5d034a,_0x1a32('0x11'));_0x3cf338(_0x31f14f[_0x1a32('0x18')][_0x1a32('0x16')]);}})[_0x1a32('0x19')](function(_0xf6093d){logger[_0x1a32('0x14')](_0x1a32('0x10'),_0x5d034a,_0xf6093d);_0x1ce64e(_0xf6093d);});});}exports[_0x1a32('0x1a')]=function(_0x4c1141){var _0x3231b2=this;return new Promise(function(_0x16896e,_0x235fd0){return db['ChatQueue'][_0x1a32('0x1b')]({'raw':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x1d')]===undefined?!![]:![]:!![],'where':_0x4c1141['options']?_0x4c1141[_0x1a32('0x1c')][_0x1a32('0x1e')]||null:null,'attributes':_0x4c1141['options']?_0x4c1141[_0x1a32('0x1c')][_0x1a32('0x1f')]||null:null,'limit':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x20')]||null:null,'include':_0x4c1141[_0x1a32('0x1c')]?_0x4c1141['options'][_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x4c1141['options'][_0x1a32('0x21')],function(_0x4b3b33){return{'model':db[_0x4b3b33['model']],'as':_0x4b3b33['as'],'attributes':_0x4b3b33['attributes'],'include':_0x4b3b33['include']?_['map'](_0x4b3b33[_0x1a32('0x21')],function(_0x2309b3){return{'model':db[_0x2309b3[_0x1a32('0x23')]],'as':_0x2309b3['as'],'attributes':_0x2309b3[_0x1a32('0x1f')],'include':_0x2309b3[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x2309b3[_0x1a32('0x21')],function(_0x2edc3e){return{'model':db[_0x2edc3e['model']],'as':_0x2edc3e['as'],'attributes':_0x2edc3e[_0x1a32('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a32('0xf')](function(_0x37d660){logger[_0x1a32('0x17')](_0x1a32('0x1a'),_0x4c1141);logger[_0x1a32('0x12')](_0x1a32('0x1a'),_0x4c1141,JSON[_0x1a32('0x13')](_0x37d660));_0x16896e(_0x37d660);})[_0x1a32('0x19')](function(_0x54b122){logger[_0x1a32('0x14')](_0x1a32('0x1a'),_0x54b122['message'],_0x4c1141);_0x235fd0(_0x3231b2['error'](0x1f4,_0x54b122[_0x1a32('0x16')]));});});};exports['ShowChatQueue']=function(_0x5b9f13){var _0x1d874e=this;return new Promise(function(_0x4ef9fd,_0x59f1bc){return db['ChatQueue']['find']({'raw':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x1d')]===undefined?!![]:![]:!![],'where':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')]['where']||null:null,'attributes':_0x5b9f13['options']?_0x5b9f13[_0x1a32('0x1c')]['attributes']||null:null,'include':_0x5b9f13[_0x1a32('0x1c')]?_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x21')]?_['map'](_0x5b9f13[_0x1a32('0x1c')][_0x1a32('0x21')],function(_0x2121e2){return{'model':db[_0x2121e2[_0x1a32('0x23')]],'as':_0x2121e2['as'],'attributes':_0x2121e2[_0x1a32('0x1f')],'include':_0x2121e2[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x2121e2[_0x1a32('0x21')],function(_0x1b0b1e){return{'model':db[_0x1b0b1e['model']],'as':_0x1b0b1e['as'],'attributes':_0x1b0b1e[_0x1a32('0x1f')],'include':_0x1b0b1e[_0x1a32('0x21')]?_[_0x1a32('0x22')](_0x1b0b1e['include'],function(_0x20d393){return{'model':db[_0x20d393[_0x1a32('0x23')]],'as':_0x20d393['as'],'attributes':_0x20d393[_0x1a32('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x1a32('0xf')](function(_0x29dd8d){logger[_0x1a32('0x17')](_0x1a32('0x24'),_0x5b9f13);logger[_0x1a32('0x12')](_0x1a32('0x24'),_0x5b9f13,JSON[_0x1a32('0x13')](_0x29dd8d));_0x4ef9fd(_0x29dd8d);})[_0x1a32('0x19')](function(_0x3e26e8){logger[_0x1a32('0x14')](_0x1a32('0x24'),_0x3e26e8[_0x1a32('0x16')],_0x5b9f13);_0x59f1bc(_0x1d874e['error'](0x1f4,_0x3e26e8['message']));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index 58f3387..3e2364d 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x592992,_0x25e680){var _0x36f1b0=function(_0x573813){while(--_0x573813){_0x592992['push'](_0x592992['shift']());}};_0x36f1b0(++_0x25e680);}(_0x0b0e,0x187));var _0xe0b0=function(_0x340756,_0xad31ae){_0x340756=_0x340756-0x0;var _0x2ef745=_0x0b0e[_0x340756];return _0x2ef745;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x4e0e1d,_0x5e18c3){var _0x1159b1=function(_0x4546c4){while(--_0x4546c4){_0x4e0e1d['push'](_0x4e0e1d['shift']());}};_0x1159b1(++_0x5e18c3);}(_0x0b0e,0x187));var _0xe0b0=function(_0x216f7d,_0x496249){_0x216f7d=_0x216f7d-0x0;var _0xc49d7f=_0x0b0e[_0x216f7d];return _0xc49d7f;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 0e9cdb6..0268e71 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 _0x6702=['addAgents','put','update','destroy','delete','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./chatQueue.controller','get','index','/describe','isAuthenticated','describe','/:id','show','/:id/members','getMembers','getTeams','/:id/users','getAgents','post','create','/:id/teams','addTeams'];(function(_0x6d036a,_0x571582){var _0x3135b3=function(_0x5ad580){while(--_0x5ad580){_0x6d036a['push'](_0x6d036a['shift']());}};_0x3135b3(++_0x571582);}(_0x6702,0x17f));var _0x2670=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0x6702[_0x45f951];return _0x24756c;};'use strict';var multer=require(_0x2670('0x0'));var util=require(_0x2670('0x1'));var path=require('path');var timeout=require(_0x2670('0x2'));var express=require(_0x2670('0x3'));var router=express[_0x2670('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2670('0x5'));var config=require('../../config/environment');var controller=require(_0x2670('0x6'));router[_0x2670('0x7')]('/',auth['isAuthenticated'](),controller[_0x2670('0x8')]);router[_0x2670('0x7')](_0x2670('0x9'),auth[_0x2670('0xa')](),controller[_0x2670('0xb')]);router['get'](_0x2670('0xc'),auth[_0x2670('0xa')](),controller[_0x2670('0xd')]);router[_0x2670('0x7')](_0x2670('0xe'),auth[_0x2670('0xa')](),controller[_0x2670('0xf')]);router[_0x2670('0x7')]('/:id/teams',auth[_0x2670('0xa')](),controller[_0x2670('0x10')]);router[_0x2670('0x7')](_0x2670('0x11'),auth['isAuthenticated'](),controller[_0x2670('0x12')]);router[_0x2670('0x13')]('/',auth[_0x2670('0xa')](),controller[_0x2670('0x14')]);router[_0x2670('0x13')](_0x2670('0x15'),auth[_0x2670('0xa')](),controller[_0x2670('0x16')]);router[_0x2670('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0x2670('0x17')]);router[_0x2670('0x18')](_0x2670('0xc'),auth['isAuthenticated'](),controller[_0x2670('0x19')]);router['delete'](_0x2670('0xc'),auth[_0x2670('0xa')](),controller[_0x2670('0x1a')]);router['delete'](_0x2670('0x15'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x2670('0x1b')](_0x2670('0x11'),auth[_0x2670('0xa')](),controller['removeAgents']);module[_0x2670('0x1c')]=router; \ No newline at end of file +var _0xea95=['../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x5e7e1a,_0x38a7c6){var _0x46b94f=function(_0x4d6e22){while(--_0x4d6e22){_0x5e7e1a['push'](_0x5e7e1a['shift']());}};_0x46b94f(++_0x38a7c6);}(_0xea95,0x1ad));var _0x5ea9=function(_0x331b9c,_0x1a9f2b){_0x331b9c=_0x331b9c-0x0;var _0x3730bb=_0xea95[_0x331b9c];return _0x3730bb;};'use strict';var multer=require('multer');var util=require(_0x5ea9('0x0'));var path=require('path');var timeout=require(_0x5ea9('0x1'));var express=require(_0x5ea9('0x2'));var router=express[_0x5ea9('0x3')]();var auth=require(_0x5ea9('0x4'));var interaction=require(_0x5ea9('0x5'));var config=require(_0x5ea9('0x6'));var controller=require('./chatQueue.controller');router[_0x5ea9('0x7')]('/',auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x9')]);router['get'](_0x5ea9('0xa'),auth[_0x5ea9('0x8')](),controller[_0x5ea9('0xb')]);router['get'](_0x5ea9('0xc'),auth[_0x5ea9('0x8')](),controller[_0x5ea9('0xd')]);router[_0x5ea9('0x7')](_0x5ea9('0xe'),auth[_0x5ea9('0x8')](),controller[_0x5ea9('0xf')]);router[_0x5ea9('0x7')](_0x5ea9('0x10'),auth['isAuthenticated'](),controller[_0x5ea9('0x11')]);router[_0x5ea9('0x7')](_0x5ea9('0x12'),auth['isAuthenticated'](),controller[_0x5ea9('0x13')]);router['post']('/',auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x14')]);router[_0x5ea9('0x15')]('/:id/teams',auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x16')]);router[_0x5ea9('0x15')]('/:id/users',auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x17')]);router[_0x5ea9('0x18')](_0x5ea9('0xc'),auth['isAuthenticated'](),controller[_0x5ea9('0x19')]);router[_0x5ea9('0x1a')]('/:id',auth['isAuthenticated'](),controller[_0x5ea9('0x1b')]);router['delete'](_0x5ea9('0x10'),auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x1c')]);router[_0x5ea9('0x1a')]('/:id/users',auth[_0x5ea9('0x8')](),controller[_0x5ea9('0x1d')]);module[_0x5ea9('0x1e')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 0217cb5..ec10f21 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 _0x53ea=['STRING','DATE','sequelize','exports'];(function(_0x3f8f75,_0x2b066a){var _0x1104d3=function(_0x165246){while(--_0x165246){_0x3f8f75['push'](_0x3f8f75['shift']());}};_0x1104d3(++_0x2b066a);}(_0x53ea,0xbe));var _0xa53e=function(_0x13446d,_0x2c12f1){_0x13446d=_0x13446d-0x0;var _0x3eb5fd=_0x53ea[_0x13446d];return _0x3eb5fd;};'use strict';var moment=require('moment');var Sequelize=require(_0xa53e('0x0'));module[_0xa53e('0x1')]={'uniqueid':{'type':Sequelize[_0xa53e('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xa53e('0x2')]},'joinAt':{'type':Sequelize[_0xa53e('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0xa53e('0x3')]},'exitAt':{'type':Sequelize[_0xa53e('0x3')]},'reason':{'type':Sequelize[_0xa53e('0x2')]}}; \ No newline at end of file +var _0x2830=['moment','sequelize','exports','STRING','DATE'];(function(_0x43f489,_0x2b4fea){var _0x4134b4=function(_0x4365f6){while(--_0x4365f6){_0x43f489['push'](_0x43f489['shift']());}};_0x4134b4(++_0x2b4fea);}(_0x2830,0xb9));var _0x0283=function(_0xf4ecdd,_0x21a6e0){_0xf4ecdd=_0xf4ecdd-0x0;var _0x35fbb9=_0x2830[_0xf4ecdd];return _0x35fbb9;};'use strict';var moment=require(_0x0283('0x0'));var Sequelize=require(_0x0283('0x1'));module[_0x0283('0x2')]={'uniqueid':{'type':Sequelize[_0x0283('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0283('0x4')]},'leaveAt':{'type':Sequelize[_0x0283('0x4')]},'acceptAt':{'type':Sequelize[_0x0283('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x0283('0x3')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index 66a6101..f8d4b4c 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 _0x7323=['to-csv','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','then','end','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','VIRTUAL','count','catch','show','params','fields','includeAll','options','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','lodash','squel','crypto'];(function(_0xa5d65,_0x1f5748){var _0x149488=function(_0x19ddb6){while(--_0x19ddb6){_0xa5d65['push'](_0xa5d65['shift']());}};_0x149488(++_0x1f5748);}(_0x7323,0x79));var _0x3732=function(_0x521929,_0x479be5){_0x521929=_0x521929-0x0;var _0x632436=_0x7323[_0x521929];return _0x632436;};'use strict';var pdf=require(_0x3732('0x0'));var emlformat=require(_0x3732('0x1'));var rimraf=require(_0x3732('0x2'));var zipdir=require(_0x3732('0x3'));var jsonpatch=require(_0x3732('0x4'));var rp=require('request-promise');var moment=require(_0x3732('0x5'));var BPromise=require(_0x3732('0x6'));var Mustache=require(_0x3732('0x7'));var util=require(_0x3732('0x8'));var path=require('path');var sox=require(_0x3732('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x3732('0xa'));var squel=require(_0x3732('0xb'));var crypto=require(_0x3732('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x3732('0xd'));var querystring=require(_0x3732('0xe'));var Papa=require(_0x3732('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3732('0x10'));var hardwareService=require(_0x3732('0x11'));var logger=require('../../config/logger')(_0x3732('0x12'));var utils=require(_0x3732('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42dd71,_0x5b211d){_0x5b211d=_0x5b211d||0xcc;return function(_0x1a6fbd){if(_0x1a6fbd){return _0x42dd71[_0x3732('0x14')](_0x5b211d);}return _0x42dd71[_0x3732('0x15')](_0x5b211d)['end']();};}function respondWithResult(_0x276f34,_0xae7e02){_0xae7e02=_0xae7e02||0xc8;return function(_0x14469b){if(_0x14469b){return _0x276f34[_0x3732('0x15')](_0xae7e02)['json'](_0x14469b);}};}function respondWithFilteredResult(_0x3c492a,_0x11528b){return function(_0x318973){if(_0x318973){var _0x2b36a7=_0x318973['count'],_0x5b1945=_0x11528b[_0x3732('0x16')],_0x44bb72=_0x11528b[_0x3732('0x16')]+_0x11528b[_0x3732('0x17')],_0x301dac;if(_0x44bb72>=_0x2b36a7){_0x44bb72=_0x2b36a7;_0x301dac=0xc8;}else{_0x301dac=0xce;}_0x3c492a[_0x3732('0x15')](_0x301dac);return _0x3c492a[_0x3732('0x18')](_0x3732('0x19'),_0x5b1945+'-'+_0x44bb72+'/'+_0x2b36a7)[_0x3732('0x1a')](_0x318973);}return null;};}function patchUpdates(_0x6d174e){return function(_0xb88325){try{jsonpatch[_0x3732('0x1b')](_0xb88325,_0x6d174e,!![]);}catch(_0x2525df){return BPromise[_0x3732('0x1c')](_0x2525df);}return _0xb88325[_0x3732('0x1d')]();};}function saveUpdates(_0x2725d8,_0x2b2741){return function(_0x3ad5bc){if(_0x3ad5bc){return _0x3ad5bc['update'](_0x2725d8)[_0x3732('0x1e')](function(_0x1f4fa5){return _0x1f4fa5;});}return null;};}function removeEntity(_0xa9f0e5,_0x251d88){return function(_0x76d821){if(_0x76d821){return _0x76d821['destroy']()['then'](function(){_0xa9f0e5['status'](0xcc)[_0x3732('0x1f')]();});}};}function handleEntityNotFound(_0x22c085,_0x4eec1b){return function(_0x4583b3){if(!_0x4583b3){_0x22c085[_0x3732('0x14')](0x194);}return _0x4583b3;};}function handleError(_0x95ba26,_0x59f06d){_0x59f06d=_0x59f06d||0x1f4;return function(_0x2c53b6){logger[_0x3732('0x20')](_0x2c53b6[_0x3732('0x21')]);if(_0x2c53b6[_0x3732('0x22')]){delete _0x2c53b6[_0x3732('0x22')];}_0x95ba26['status'](_0x59f06d)[_0x3732('0x23')](_0x2c53b6);};}exports[_0x3732('0x24')]=function(_0x1a8965,_0x1cf43e){var _0x5e3a94={},_0x472382={},_0x159743={'count':0x0,'rows':[]};var _0x477910=_[_0x3732('0x25')](db[_0x3732('0x26')][_0x3732('0x27')],function(_0x178722){return{'name':_0x178722['fieldName'],'type':_0x178722[_0x3732('0x28')][_0x3732('0x29')]};});_0x472382[_0x3732('0x2a')]=_[_0x3732('0x25')](_0x477910,_0x3732('0x22'));_0x472382[_0x3732('0x2b')]=_[_0x3732('0x2c')](_0x1a8965[_0x3732('0x2b')]);_0x472382[_0x3732('0x2d')]=_[_0x3732('0x2e')](_0x472382[_0x3732('0x2a')],_0x472382[_0x3732('0x2b')]);_0x5e3a94[_0x3732('0x2f')]=_['intersection'](_0x472382[_0x3732('0x2a')],qs['fields'](_0x1a8965[_0x3732('0x2b')]['fields']));_0x5e3a94[_0x3732('0x2f')]=_0x5e3a94['attributes'][_0x3732('0x30')]?_0x5e3a94[_0x3732('0x2f')]:_0x472382['model'];if(!_0x1a8965['query'][_0x3732('0x31')]('nolimit')){_0x5e3a94[_0x3732('0x17')]=qs[_0x3732('0x17')](_0x1a8965['query'][_0x3732('0x17')]);_0x5e3a94[_0x3732('0x16')]=qs[_0x3732('0x16')](_0x1a8965[_0x3732('0x2b')][_0x3732('0x16')]);}_0x5e3a94['order']=qs[_0x3732('0x32')](_0x1a8965[_0x3732('0x2b')][_0x3732('0x32')]);_0x5e3a94[_0x3732('0x33')]=qs[_0x3732('0x2d')](_[_0x3732('0x34')](_0x1a8965[_0x3732('0x2b')],_0x472382[_0x3732('0x2d')]));if(_0x1a8965[_0x3732('0x2b')][_0x3732('0x35')]){_0x5e3a94['where']=_[_0x3732('0x36')](_0x5e3a94[_0x3732('0x33')],{'$or':_[_0x3732('0x25')](_0x477910,function(_0x317827){if(_0x317827[_0x3732('0x28')]!==_0x3732('0x37')){var _0x357b1a={};_0x357b1a[_0x317827['name']]={'$like':'%'+_0x1a8965[_0x3732('0x2b')][_0x3732('0x35')]+'%'};return _0x357b1a;}})});}_0x5e3a94=_['merge']({},_0x5e3a94,_0x1a8965['options']);var _0x5dcd2a={'where':_0x5e3a94[_0x3732('0x33')]};return db['ChatQueueReport'][_0x3732('0x38')](_0x5dcd2a)[_0x3732('0x1e')](function(_0x28e9ae){_0x159743[_0x3732('0x38')]=_0x28e9ae;if(_0x1a8965[_0x3732('0x2b')]['includeAll']){_0x5e3a94['include']=[{'all':!![]}];}return db[_0x3732('0x26')]['findAll'](_0x5e3a94);})[_0x3732('0x1e')](function(_0x21dc2f){_0x159743['rows']=_0x21dc2f;return _0x159743;})[_0x3732('0x1e')](respondWithFilteredResult(_0x1cf43e,_0x5e3a94))[_0x3732('0x39')](handleError(_0x1cf43e,null));};exports[_0x3732('0x3a')]=function(_0x18cd34,_0x2ae1f5){var _0x43adaf={'raw':!![],'where':{'id':_0x18cd34[_0x3732('0x3b')]['id']}},_0x3d7171={};_0x3d7171[_0x3732('0x2a')]=_[_0x3732('0x2c')](db[_0x3732('0x26')]['rawAttributes']);_0x3d7171[_0x3732('0x2b')]=_[_0x3732('0x2c')](_0x18cd34['query']);_0x3d7171[_0x3732('0x2d')]=_[_0x3732('0x2e')](_0x3d7171['model'],_0x3d7171[_0x3732('0x2b')]);_0x43adaf['attributes']=_[_0x3732('0x2e')](_0x3d7171['model'],qs[_0x3732('0x3c')](_0x18cd34['query'][_0x3732('0x3c')]));_0x43adaf[_0x3732('0x2f')]=_0x43adaf[_0x3732('0x2f')][_0x3732('0x30')]?_0x43adaf[_0x3732('0x2f')]:_0x3d7171[_0x3732('0x2a')];if(_0x18cd34[_0x3732('0x2b')][_0x3732('0x3d')]){_0x43adaf['include']=[{'all':!![]}];}_0x43adaf=_['merge']({},_0x43adaf,_0x18cd34[_0x3732('0x3e')]);return db[_0x3732('0x26')]['find'](_0x43adaf)[_0x3732('0x1e')](handleEntityNotFound(_0x2ae1f5,null))[_0x3732('0x1e')](respondWithResult(_0x2ae1f5,null))[_0x3732('0x39')](handleError(_0x2ae1f5,null));};exports['create']=function(_0x129588,_0x15923e){return db[_0x3732('0x26')]['create'](_0x129588[_0x3732('0x3f')],{})[_0x3732('0x1e')](respondWithResult(_0x15923e,0xc9))[_0x3732('0x39')](handleError(_0x15923e,null));};exports[_0x3732('0x40')]=function(_0x346e77,_0x1b3af6){if(_0x346e77[_0x3732('0x3f')]['id']){delete _0x346e77[_0x3732('0x3f')]['id'];}return db[_0x3732('0x26')][_0x3732('0x41')]({'where':{'id':_0x346e77[_0x3732('0x3b')]['id']}})[_0x3732('0x1e')](handleEntityNotFound(_0x1b3af6,null))['then'](saveUpdates(_0x346e77['body'],null))['then'](respondWithResult(_0x1b3af6,null))['catch'](handleError(_0x1b3af6,null));};exports['destroy']=function(_0x167e73,_0x3517a1){return db[_0x3732('0x26')][_0x3732('0x41')]({'where':{'id':_0x167e73['params']['id']}})[_0x3732('0x1e')](handleEntityNotFound(_0x3517a1,null))[_0x3732('0x1e')](removeEntity(_0x3517a1,null))[_0x3732('0x39')](handleError(_0x3517a1,null));};exports[_0x3732('0x42')]=function(_0x160cd3,_0x3760e3){return db[_0x3732('0x26')]['describe']()[_0x3732('0x1e')](respondWithResult(_0x3760e3,null))[_0x3732('0x39')](handleError(_0x3760e3,null));}; \ No newline at end of file +var _0xfa04=['find','describe','html-pdf','rimraf','zip-dir','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','apply','reject','destroy','then','error','stack','index','map','ChatQueueReport','rawAttributes','fieldName','key','model','name','query','filters','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','params','keys','fields','length','includeAll','create','body','update'];(function(_0x5c6994,_0x19ad9a){var _0x1d5c84=function(_0x4a385a){while(--_0x4a385a){_0x5c6994['push'](_0x5c6994['shift']());}};_0x1d5c84(++_0x19ad9a);}(_0xfa04,0x126));var _0x4fa0=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0xfa04[_0x3ab51d];return _0x29a04e;};'use strict';var pdf=require(_0x4fa0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4fa0('0x1'));var zipdir=require(_0x4fa0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x4fa0('0x3'));var BPromise=require(_0x4fa0('0x4'));var Mustache=require(_0x4fa0('0x5'));var util=require(_0x4fa0('0x6'));var path=require(_0x4fa0('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4fa0('0x8'));var fs=require('fs');var _=require(_0x4fa0('0x9'));var squel=require(_0x4fa0('0xa'));var crypto=require(_0x4fa0('0xb'));var jsforce=require(_0x4fa0('0xc'));var deskjs=require(_0x4fa0('0xd'));var toCsv=require(_0x4fa0('0xe'));var querystring=require(_0x4fa0('0xf'));var Papa=require('papaparse');var Redis=require(_0x4fa0('0x10'));var authService=require(_0x4fa0('0x11'));var qs=require(_0x4fa0('0x12'));var as=require(_0x4fa0('0x13'));var hardwareService=require(_0x4fa0('0x14'));var logger=require(_0x4fa0('0x15'))(_0x4fa0('0x16'));var utils=require(_0x4fa0('0x17'));var config=require(_0x4fa0('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5690f9,_0x1a6890){_0x1a6890=_0x1a6890||0xcc;return function(_0x28dbf9){if(_0x28dbf9){return _0x5690f9[_0x4fa0('0x19')](_0x1a6890);}return _0x5690f9[_0x4fa0('0x1a')](_0x1a6890)[_0x4fa0('0x1b')]();};}function respondWithResult(_0x46da47,_0x5e247c){_0x5e247c=_0x5e247c||0xc8;return function(_0x1dae0c){if(_0x1dae0c){return _0x46da47['status'](_0x5e247c)[_0x4fa0('0x1c')](_0x1dae0c);}};}function respondWithFilteredResult(_0x223dbc,_0x5660f8){return function(_0x14c2c2){if(_0x14c2c2){var _0x2db840=_0x14c2c2[_0x4fa0('0x1d')],_0x62ee24=_0x5660f8[_0x4fa0('0x1e')],_0x5b660e=_0x5660f8['offset']+_0x5660f8[_0x4fa0('0x1f')],_0x26abe6;if(_0x5b660e>=_0x2db840){_0x5b660e=_0x2db840;_0x26abe6=0xc8;}else{_0x26abe6=0xce;}_0x223dbc[_0x4fa0('0x1a')](_0x26abe6);return _0x223dbc['set']('Content-Range',_0x62ee24+'-'+_0x5b660e+'/'+_0x2db840)[_0x4fa0('0x1c')](_0x14c2c2);}return null;};}function patchUpdates(_0x4ed1c6){return function(_0x1e7370){try{jsonpatch[_0x4fa0('0x20')](_0x1e7370,_0x4ed1c6,!![]);}catch(_0x34ea83){return BPromise[_0x4fa0('0x21')](_0x34ea83);}return _0x1e7370['save']();};}function saveUpdates(_0x3a738e,_0x51ef4c){return function(_0x27e566){if(_0x27e566){return _0x27e566['update'](_0x3a738e)['then'](function(_0xe78f){return _0xe78f;});}return null;};}function removeEntity(_0x174304,_0x226e92){return function(_0x562c6f){if(_0x562c6f){return _0x562c6f[_0x4fa0('0x22')]()[_0x4fa0('0x23')](function(){_0x174304[_0x4fa0('0x1a')](0xcc)[_0x4fa0('0x1b')]();});}};}function handleEntityNotFound(_0xbcb9c4,_0x2501d7){return function(_0x5bf516){if(!_0x5bf516){_0xbcb9c4['sendStatus'](0x194);}return _0x5bf516;};}function handleError(_0x1f7893,_0x48ce55){_0x48ce55=_0x48ce55||0x1f4;return function(_0x770ed6){logger[_0x4fa0('0x24')](_0x770ed6[_0x4fa0('0x25')]);if(_0x770ed6['name']){delete _0x770ed6['name'];}_0x1f7893['status'](_0x48ce55)['send'](_0x770ed6);};}exports[_0x4fa0('0x26')]=function(_0x16d7e3,_0x1ecac7){var _0x4f0c64={},_0x34fe15={},_0x34aa22={'count':0x0,'rows':[]};var _0x4e9f25=_[_0x4fa0('0x27')](db[_0x4fa0('0x28')][_0x4fa0('0x29')],function(_0x76b90b){return{'name':_0x76b90b[_0x4fa0('0x2a')],'type':_0x76b90b['type'][_0x4fa0('0x2b')]};});_0x34fe15[_0x4fa0('0x2c')]=_['map'](_0x4e9f25,_0x4fa0('0x2d'));_0x34fe15[_0x4fa0('0x2e')]=_['keys'](_0x16d7e3['query']);_0x34fe15[_0x4fa0('0x2f')]=_['intersection'](_0x34fe15[_0x4fa0('0x2c')],_0x34fe15['query']);_0x4f0c64[_0x4fa0('0x30')]=_[_0x4fa0('0x31')](_0x34fe15[_0x4fa0('0x2c')],qs['fields'](_0x16d7e3['query']['fields']));_0x4f0c64[_0x4fa0('0x30')]=_0x4f0c64[_0x4fa0('0x30')]['length']?_0x4f0c64['attributes']:_0x34fe15['model'];if(!_0x16d7e3[_0x4fa0('0x2e')][_0x4fa0('0x32')]('nolimit')){_0x4f0c64[_0x4fa0('0x1f')]=qs[_0x4fa0('0x1f')](_0x16d7e3[_0x4fa0('0x2e')][_0x4fa0('0x1f')]);_0x4f0c64[_0x4fa0('0x1e')]=qs[_0x4fa0('0x1e')](_0x16d7e3[_0x4fa0('0x2e')]['offset']);}_0x4f0c64[_0x4fa0('0x33')]=qs['sort'](_0x16d7e3[_0x4fa0('0x2e')][_0x4fa0('0x34')]);_0x4f0c64[_0x4fa0('0x35')]=qs[_0x4fa0('0x2f')](_[_0x4fa0('0x36')](_0x16d7e3[_0x4fa0('0x2e')],_0x34fe15[_0x4fa0('0x2f')]));if(_0x16d7e3[_0x4fa0('0x2e')][_0x4fa0('0x37')]){_0x4f0c64[_0x4fa0('0x35')]=_[_0x4fa0('0x38')](_0x4f0c64['where'],{'$or':_[_0x4fa0('0x27')](_0x4e9f25,function(_0x367cc7){if(_0x367cc7['type']!==_0x4fa0('0x39')){var _0xde4cb0={};_0xde4cb0[_0x367cc7['name']]={'$like':'%'+_0x16d7e3['query']['filter']+'%'};return _0xde4cb0;}})});}_0x4f0c64=_[_0x4fa0('0x38')]({},_0x4f0c64,_0x16d7e3[_0x4fa0('0x3a')]);var _0x40f0f5={'where':_0x4f0c64[_0x4fa0('0x35')]};return db[_0x4fa0('0x28')][_0x4fa0('0x1d')](_0x40f0f5)[_0x4fa0('0x23')](function(_0x1e268c){_0x34aa22[_0x4fa0('0x1d')]=_0x1e268c;if(_0x16d7e3[_0x4fa0('0x2e')]['includeAll']){_0x4f0c64[_0x4fa0('0x3b')]=[{'all':!![]}];}return db[_0x4fa0('0x28')]['findAll'](_0x4f0c64);})['then'](function(_0x247240){_0x34aa22[_0x4fa0('0x3c')]=_0x247240;return _0x34aa22;})['then'](respondWithFilteredResult(_0x1ecac7,_0x4f0c64))[_0x4fa0('0x3d')](handleError(_0x1ecac7,null));};exports[_0x4fa0('0x3e')]=function(_0xb3bdfe,_0x46cecf){var _0x275b64={'raw':!![],'where':{'id':_0xb3bdfe[_0x4fa0('0x3f')]['id']}},_0x2a281d={};_0x2a281d[_0x4fa0('0x2c')]=_[_0x4fa0('0x40')](db[_0x4fa0('0x28')][_0x4fa0('0x29')]);_0x2a281d[_0x4fa0('0x2e')]=_[_0x4fa0('0x40')](_0xb3bdfe['query']);_0x2a281d['filters']=_['intersection'](_0x2a281d['model'],_0x2a281d[_0x4fa0('0x2e')]);_0x275b64[_0x4fa0('0x30')]=_[_0x4fa0('0x31')](_0x2a281d['model'],qs[_0x4fa0('0x41')](_0xb3bdfe['query']['fields']));_0x275b64['attributes']=_0x275b64[_0x4fa0('0x30')][_0x4fa0('0x42')]?_0x275b64['attributes']:_0x2a281d['model'];if(_0xb3bdfe['query'][_0x4fa0('0x43')]){_0x275b64[_0x4fa0('0x3b')]=[{'all':!![]}];}_0x275b64=_[_0x4fa0('0x38')]({},_0x275b64,_0xb3bdfe['options']);return db['ChatQueueReport']['find'](_0x275b64)[_0x4fa0('0x23')](handleEntityNotFound(_0x46cecf,null))[_0x4fa0('0x23')](respondWithResult(_0x46cecf,null))['catch'](handleError(_0x46cecf,null));};exports[_0x4fa0('0x44')]=function(_0x23f0fb,_0x5a890c){return db[_0x4fa0('0x28')][_0x4fa0('0x44')](_0x23f0fb[_0x4fa0('0x45')],{})['then'](respondWithResult(_0x5a890c,0xc9))[_0x4fa0('0x3d')](handleError(_0x5a890c,null));};exports[_0x4fa0('0x46')]=function(_0x35c5a8,_0x1057a2){if(_0x35c5a8[_0x4fa0('0x45')]['id']){delete _0x35c5a8[_0x4fa0('0x45')]['id'];}return db[_0x4fa0('0x28')][_0x4fa0('0x47')]({'where':{'id':_0x35c5a8[_0x4fa0('0x3f')]['id']}})['then'](handleEntityNotFound(_0x1057a2,null))[_0x4fa0('0x23')](saveUpdates(_0x35c5a8['body'],null))[_0x4fa0('0x23')](respondWithResult(_0x1057a2,null))['catch'](handleError(_0x1057a2,null));};exports[_0x4fa0('0x22')]=function(_0x5a8a19,_0x2163bd){return db['ChatQueueReport'][_0x4fa0('0x47')]({'where':{'id':_0x5a8a19['params']['id']}})[_0x4fa0('0x23')](handleEntityNotFound(_0x2163bd,null))[_0x4fa0('0x23')](removeEntity(_0x2163bd,null))[_0x4fa0('0x3d')](handleError(_0x2163bd,null));};exports[_0x4fa0('0x48')]=function(_0x2ad525,_0x304e12){return db[_0x4fa0('0x28')]['describe']()[_0x4fa0('0x23')](respondWithResult(_0x304e12,null))[_0x4fa0('0x3d')](handleError(_0x304e12,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index 5ac06ec..2e12456 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 _0x16ca=['report_chat_queue','uniqueid','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','ChatQueueReport'];(function(_0x1e7596,_0x4940ef){var _0x3d9682=function(_0x3ce32d){while(--_0x3ce32d){_0x1e7596['push'](_0x1e7596['shift']());}};_0x3d9682(++_0x4940ef);}(_0x16ca,0x1db));var _0xa16c=function(_0x4f51f2,_0x277484){_0x4f51f2=_0x4f51f2-0x0;var _0x1cfdf3=_0x16ca[_0x4f51f2];return _0x1cfdf3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa16c('0x0'))('api');var moment=require(_0xa16c('0x1'));var BPromise=require(_0xa16c('0x2'));var rp=require(_0xa16c('0x3'));var fs=require('fs');var path=require(_0xa16c('0x4'));var rimraf=require(_0xa16c('0x5'));var config=require(_0xa16c('0x6'));var attributes=require(_0xa16c('0x7'));module['exports']=function(_0x295545,_0xc7cb9d){return _0x295545['define'](_0xa16c('0x8'),attributes,{'tableName':_0xa16c('0x9'),'paranoid':![],'indexes':[{'name':_0xa16c('0xa'),'fields':[_0xa16c('0xa')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf188=['../../config/environment','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','request-promise','path'];(function(_0x529c58,_0x5040d0){var _0x5ad8d8=function(_0x571785){while(--_0x571785){_0x529c58['push'](_0x529c58['shift']());}};_0x5ad8d8(++_0x5040d0);}(_0xf188,0xea));var _0x8f18=function(_0x10868a,_0xee169){_0x10868a=_0x10868a-0x0;var _0x5ecac2=_0xf188[_0x10868a];return _0x5ecac2;};'use strict';var _=require(_0x8f18('0x0'));var util=require('util');var logger=require(_0x8f18('0x1'))(_0x8f18('0x2'));var moment=require(_0x8f18('0x3'));var BPromise=require('bluebird');var rp=require(_0x8f18('0x4'));var fs=require('fs');var path=require(_0x8f18('0x5'));var rimraf=require('rimraf');var config=require(_0x8f18('0x6'));var attributes=require('./chatQueueReport.attributes');module[_0x8f18('0x7')]=function(_0x5a2cc9,_0x43fc85){return _0x5a2cc9[_0x8f18('0x8')](_0x8f18('0x9'),attributes,{'tableName':_0x8f18('0xa'),'paranoid':![],'indexes':[{'name':_0x8f18('0xb'),'fields':[_0x8f18('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 cfe9de2..60307e5 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 _0xf88f=['options','raw','update','where','attributes','limit','UpdateChatQueueReport','util','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code','ChatQueueReport,\x20%s,\x20%s','message','result','catch','CreateChatQueueReport','ChatQueueReport','create','body'];(function(_0x538c70,_0x35531f){var _0x42ae01=function(_0x5c7368){while(--_0x5c7368){_0x538c70['push'](_0x538c70['shift']());}};_0x42ae01(++_0x35531f);}(_0xf88f,0x130));var _0xff88=function(_0x1bb039,_0x202f37){_0x1bb039=_0x1bb039-0x0;var _0x12af73=_0xf88f[_0x1bb039];return _0x12af73;};'use strict';var _=require('lodash');var util=require(_0xff88('0x0'));var moment=require('moment');var BPromise=require(_0xff88('0x1'));var rs=require(_0xff88('0x2'));var fs=require('fs');var Redis=require(_0xff88('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xff88('0x4'))(_0xff88('0x5'));var config=require(_0xff88('0x6'));var jayson=require(_0xff88('0x7'));var client=jayson[_0xff88('0x8')][_0xff88('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x52344f,_0xe5c439,_0x2495eb){return new BPromise(function(_0xcdf71a,_0x359591){return client[_0xff88('0xa')](_0x52344f,_0x2495eb)[_0xff88('0xb')](function(_0x17818a){logger[_0xff88('0xc')]('ChatQueueReport,\x20%s,\x20%s',_0xe5c439,_0xff88('0xd'));logger[_0xff88('0xe')]('ChatQueueReport,\x20%s,\x20%s,\x20%s',_0xe5c439,_0xff88('0xd'),JSON[_0xff88('0xf')](_0x17818a));if(_0x17818a[_0xff88('0x10')]){if(_0x17818a[_0xff88('0x10')][_0xff88('0x11')]===0x1f4){logger[_0xff88('0x10')](_0xff88('0x12'),_0xe5c439,_0x17818a[_0xff88('0x10')]['message']);return _0x359591(_0x17818a['error']['message']);}logger[_0xff88('0x10')](_0xff88('0x12'),_0xe5c439,_0x17818a[_0xff88('0x10')][_0xff88('0x13')]);return _0xcdf71a(_0x17818a['error'][_0xff88('0x13')]);}else{logger[_0xff88('0xc')](_0xff88('0x12'),_0xe5c439,'request\x20sent');_0xcdf71a(_0x17818a[_0xff88('0x14')][_0xff88('0x13')]);}})[_0xff88('0x15')](function(_0x53d7e1){logger[_0xff88('0x10')](_0xff88('0x12'),_0xe5c439,_0x53d7e1);_0x359591(_0x53d7e1);});});}exports[_0xff88('0x16')]=function(_0x4fa024){var _0x3ecd9f=this;return new Promise(function(_0x477a69,_0x593e9f){return db[_0xff88('0x17')][_0xff88('0x18')](_0x4fa024[_0xff88('0x19')],{'raw':_0x4fa024[_0xff88('0x1a')]?_0x4fa024[_0xff88('0x1a')][_0xff88('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x67798){logger[_0xff88('0xc')](_0xff88('0x16'),_0x4fa024);logger[_0xff88('0xe')](_0xff88('0x16'),_0x4fa024,JSON[_0xff88('0xf')](_0x67798));_0x477a69(_0x67798);})[_0xff88('0x15')](function(_0x52cc67){logger['error'](_0xff88('0x16'),_0x52cc67['message'],_0x4fa024);_0x593e9f(_0x3ecd9f[_0xff88('0x10')](0x1f4,_0x52cc67[_0xff88('0x13')]));});});};exports['UpdateChatQueueReport']=function(_0x3ad84e){var _0x18ca10=this;return new Promise(function(_0x35235d,_0x1dc0d6){return db['ChatQueueReport'][_0xff88('0x1c')](_0x3ad84e['body'],{'raw':_0x3ad84e[_0xff88('0x1a')]?_0x3ad84e[_0xff88('0x1a')][_0xff88('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3ad84e[_0xff88('0x1a')]?_0x3ad84e[_0xff88('0x1a')][_0xff88('0x1d')]||null:null,'attributes':_0x3ad84e[_0xff88('0x1a')]?_0x3ad84e[_0xff88('0x1a')][_0xff88('0x1e')]||null:null,'limit':_0x3ad84e[_0xff88('0x1a')]?_0x3ad84e[_0xff88('0x1a')][_0xff88('0x1f')]||null:null})[_0xff88('0xb')](function(_0x4f11fb){logger['info'](_0xff88('0x20'),_0x3ad84e);logger['debug'](_0xff88('0x20'),_0x3ad84e,JSON[_0xff88('0xf')](_0x4f11fb));_0x35235d(_0x4f11fb);})[_0xff88('0x15')](function(_0x4e9834){logger['error'](_0xff88('0x20'),_0x4e9834[_0xff88('0x13')],_0x3ad84e);_0x1dc0d6(_0x18ca10[_0xff88('0x10')](0x1f4,_0x4e9834['message']));});});}; \ No newline at end of file +var _0x18af=['../../config/environment','jayson/promise','client','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','CreateChatQueueReport','ChatQueueReport','body','options','raw','UpdateChatQueueReport','where','attributes','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x18af,0x9d));var _0xf18a=function(_0x356fbc,_0x144658){_0x356fbc=_0x356fbc-0x0;var _0x4851df=_0x18af[_0x356fbc];return _0x4851df;};'use strict';var _=require(_0xf18a('0x0'));var util=require(_0xf18a('0x1'));var moment=require(_0xf18a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf18a('0x3'));var fs=require('fs');var Redis=require(_0xf18a('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf18a('0x5'));var logger=require(_0xf18a('0x6'))(_0xf18a('0x7'));var config=require(_0xf18a('0x8'));var jayson=require(_0xf18a('0x9'));var client=jayson[_0xf18a('0xa')][_0xf18a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x404603,_0x9d680f,_0x167df5){return new BPromise(function(_0x25bfae,_0x541ba8){return client[_0xf18a('0xc')](_0x404603,_0x167df5)[_0xf18a('0xd')](function(_0x2f1baa){logger[_0xf18a('0xe')](_0xf18a('0xf'),_0x9d680f,'request\x20sent');logger[_0xf18a('0x10')](_0xf18a('0x11'),_0x9d680f,'request\x20sent',JSON[_0xf18a('0x12')](_0x2f1baa));if(_0x2f1baa[_0xf18a('0x13')]){if(_0x2f1baa[_0xf18a('0x13')][_0xf18a('0x14')]===0x1f4){logger[_0xf18a('0x13')]('ChatQueueReport,\x20%s,\x20%s',_0x9d680f,_0x2f1baa[_0xf18a('0x13')]['message']);return _0x541ba8(_0x2f1baa[_0xf18a('0x13')]['message']);}logger['error']('ChatQueueReport,\x20%s,\x20%s',_0x9d680f,_0x2f1baa[_0xf18a('0x13')][_0xf18a('0x15')]);return _0x25bfae(_0x2f1baa[_0xf18a('0x13')][_0xf18a('0x15')]);}else{logger[_0xf18a('0xe')](_0xf18a('0xf'),_0x9d680f,_0xf18a('0x16'));_0x25bfae(_0x2f1baa[_0xf18a('0x17')]['message']);}})[_0xf18a('0x18')](function(_0xb2c536){logger['error'](_0xf18a('0xf'),_0x9d680f,_0xb2c536);_0x541ba8(_0xb2c536);});});}exports[_0xf18a('0x19')]=function(_0x1bc02c){var _0x1c00f4=this;return new Promise(function(_0x2ffb00,_0x48afc2){return db[_0xf18a('0x1a')]['create'](_0x1bc02c[_0xf18a('0x1b')],{'raw':_0x1bc02c[_0xf18a('0x1c')]?_0x1bc02c[_0xf18a('0x1c')][_0xf18a('0x1d')]===undefined?!![]:![]:!![]})[_0xf18a('0xd')](function(_0x1b2299){logger[_0xf18a('0xe')](_0xf18a('0x19'),_0x1bc02c);logger[_0xf18a('0x10')]('CreateChatQueueReport',_0x1bc02c,JSON['stringify'](_0x1b2299));_0x2ffb00(_0x1b2299);})[_0xf18a('0x18')](function(_0x1b8d8f){logger[_0xf18a('0x13')]('CreateChatQueueReport',_0x1b8d8f[_0xf18a('0x15')],_0x1bc02c);_0x48afc2(_0x1c00f4[_0xf18a('0x13')](0x1f4,_0x1b8d8f['message']));});});};exports[_0xf18a('0x1e')]=function(_0x3df795){var _0x6eb009=this;return new Promise(function(_0x4fabc8,_0x441cd8){return db[_0xf18a('0x1a')]['update'](_0x3df795['body'],{'raw':_0x3df795['options']?_0x3df795['options'][_0xf18a('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3df795[_0xf18a('0x1c')]?_0x3df795[_0xf18a('0x1c')][_0xf18a('0x1f')]||null:null,'attributes':_0x3df795[_0xf18a('0x1c')]?_0x3df795[_0xf18a('0x1c')][_0xf18a('0x20')]||null:null,'limit':_0x3df795[_0xf18a('0x1c')]?_0x3df795['options']['limit']||null:null})['then'](function(_0x326b88){logger[_0xf18a('0xe')](_0xf18a('0x1e'),_0x3df795);logger['debug'](_0xf18a('0x1e'),_0x3df795,JSON[_0xf18a('0x12')](_0x326b88));_0x4fabc8(_0x326b88);})['catch'](function(_0x5d142a){logger['error'](_0xf18a('0x1e'),_0x5d142a[_0xf18a('0x15')],_0x3df795);_0x441cd8(_0x6eb009[_0xf18a('0x13')](0x1f4,_0x5d142a[_0xf18a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index 14039ee..2bf9b13 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 _0xfe2e=['multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','update','destroy','exports'];(function(_0x578f8f,_0xed55d3){var _0x1984fc=function(_0x4128d4){while(--_0x4128d4){_0x578f8f['push'](_0x578f8f['shift']());}};_0x1984fc(++_0xed55d3);}(_0xfe2e,0x12c));var _0xefe2=function(_0x39bc8b,_0x2c5ecc){_0x39bc8b=_0x39bc8b-0x0;var _0x4424b4=_0xfe2e[_0x39bc8b];return _0x4424b4;};'use strict';var multer=require(_0xefe2('0x0'));var util=require(_0xefe2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xefe2('0x2'));var router=express[_0xefe2('0x3')]();var auth=require(_0xefe2('0x4'));var interaction=require(_0xefe2('0x5'));var config=require(_0xefe2('0x6'));var controller=require(_0xefe2('0x7'));router[_0xefe2('0x8')]('/',auth[_0xefe2('0x9')](),controller[_0xefe2('0xa')]);router[_0xefe2('0x8')](_0xefe2('0xb'),auth[_0xefe2('0x9')](),controller[_0xefe2('0xc')]);router[_0xefe2('0x8')](_0xefe2('0xd'),auth['isAuthenticated'](),controller[_0xefe2('0xe')]);router[_0xefe2('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xefe2('0x10')](_0xefe2('0xd'),auth[_0xefe2('0x9')](),controller[_0xefe2('0x11')]);router['delete'](_0xefe2('0xd'),auth[_0xefe2('0x9')](),controller[_0xefe2('0x12')]);module[_0xefe2('0x13')]=router; \ No newline at end of file +var _0x978a=['show','post','create','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x4f2f13,_0x1cbe3f){var _0x5b1fa5=function(_0x3eb6c8){while(--_0x3eb6c8){_0x4f2f13['push'](_0x4f2f13['shift']());}};_0x5b1fa5(++_0x1cbe3f);}(_0x978a,0xc3));var _0xa978=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x978a[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xa978('0x0'));var util=require(_0xa978('0x1'));var path=require(_0xa978('0x2'));var timeout=require('connect-timeout');var express=require(_0xa978('0x3'));var router=express[_0xa978('0x4')]();var auth=require(_0xa978('0x5'));var interaction=require(_0xa978('0x6'));var config=require(_0xa978('0x7'));var controller=require('./chatQueueReport.controller');router[_0xa978('0x8')]('/',auth[_0xa978('0x9')](),controller[_0xa978('0xa')]);router[_0xa978('0x8')](_0xa978('0xb'),auth[_0xa978('0x9')](),controller[_0xa978('0xc')]);router[_0xa978('0x8')](_0xa978('0xd'),auth[_0xa978('0x9')](),controller[_0xa978('0xe')]);router[_0xa978('0xf')]('/',auth[_0xa978('0x9')](),controller[_0xa978('0x10')]);router['put']('/:id',auth[_0xa978('0x9')](),controller['update']);router[_0xa978('0x11')](_0xa978('0xd'),auth[_0xa978('0x9')](),controller[_0xa978('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 9e0a35b..b8573a5 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 _0xce79=['NOW','moment','sequelize','exports','STRING','ENUM','agent','queue','DATE'];(function(_0x1d7f7d,_0x3e160f){var _0x2764b0=function(_0x219995){while(--_0x219995){_0x1d7f7d['push'](_0x1d7f7d['shift']());}};_0x2764b0(++_0x3e160f);}(_0xce79,0x133));var _0x9ce7=function(_0x36f243,_0x188505){_0x36f243=_0x36f243-0x0;var _0x426436=_0xce79[_0x36f243];return _0x426436;};'use strict';var moment=require(_0x9ce7('0x0'));var Sequelize=require(_0x9ce7('0x1'));module[_0x9ce7('0x2')]={'uniqueid':{'type':Sequelize[_0x9ce7('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x9ce7('0x4')]('account',_0x9ce7('0x5'),'queue'),'allowNull':![],'defaultValue':_0x9ce7('0x6')},'transferredAt':{'type':Sequelize[_0x9ce7('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x9ce7('0x8')]}}; \ No newline at end of file +var _0x65d7=['agent','queue','NOW','moment','exports','STRING','ENUM','account'];(function(_0x2d344f,_0x25fa84){var _0x2e796b=function(_0x10466a){while(--_0x10466a){_0x2d344f['push'](_0x2d344f['shift']());}};_0x2e796b(++_0x25fa84);}(_0x65d7,0xb3));var _0x765d=function(_0x538c70,_0x35531f){_0x538c70=_0x538c70-0x0;var _0x42ae01=_0x65d7[_0x538c70];return _0x42ae01;};'use strict';var moment=require(_0x765d('0x0'));var Sequelize=require('sequelize');module[_0x765d('0x1')]={'uniqueid':{'type':Sequelize[_0x765d('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x765d('0x3')](_0x765d('0x4'),_0x765d('0x5'),_0x765d('0x6')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x765d('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index 1b14a09..0b2b0ea 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 _0x89f3=['sendStatus','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','name','index','map','ChatTransferReport','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','includeAll','include','rows','catch','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb'];(function(_0x5d864b,_0x1af2ca){var _0x47a3c6=function(_0x3615d8){while(--_0x3615d8){_0x5d864b['push'](_0x5d864b['shift']());}};_0x47a3c6(++_0x1af2ca);}(_0x89f3,0xc1));var _0x389f=function(_0x53003f,_0x5b7880){_0x53003f=_0x53003f-0x0;var _0x8ed945=_0x89f3[_0x53003f];return _0x8ed945;};'use strict';var pdf=require(_0x389f('0x0'));var emlformat=require(_0x389f('0x1'));var rimraf=require(_0x389f('0x2'));var zipdir=require(_0x389f('0x3'));var jsonpatch=require(_0x389f('0x4'));var rp=require(_0x389f('0x5'));var moment=require(_0x389f('0x6'));var BPromise=require(_0x389f('0x7'));var Mustache=require(_0x389f('0x8'));var util=require('util');var path=require('path');var sox=require(_0x389f('0x9'));var csv=require(_0x389f('0xa'));var ejs=require(_0x389f('0xb'));var fs=require('fs');var _=require(_0x389f('0xc'));var squel=require(_0x389f('0xd'));var crypto=require(_0x389f('0xe'));var jsforce=require(_0x389f('0xf'));var deskjs=require(_0x389f('0x10'));var toCsv=require(_0x389f('0xa'));var querystring=require('querystring');var Papa=require(_0x389f('0x11'));var Redis=require('ioredis');var authService=require(_0x389f('0x12'));var qs=require(_0x389f('0x13'));var as=require(_0x389f('0x14'));var hardwareService=require(_0x389f('0x15'));var logger=require(_0x389f('0x16'))(_0x389f('0x17'));var utils=require('../../config/utils');var config=require(_0x389f('0x18'));var db=require(_0x389f('0x19'))['db'];function respondWithStatusCode(_0x516f5c,_0x24550e){_0x24550e=_0x24550e||0xcc;return function(_0x294f48){if(_0x294f48){return _0x516f5c[_0x389f('0x1a')](_0x24550e);}return _0x516f5c[_0x389f('0x1b')](_0x24550e)['end']();};}function respondWithResult(_0x19bab9,_0x2157c5){_0x2157c5=_0x2157c5||0xc8;return function(_0x529868){if(_0x529868){return _0x19bab9['status'](_0x2157c5)[_0x389f('0x1c')](_0x529868);}};}function respondWithFilteredResult(_0x560b14,_0x526b8a){return function(_0x251e80){if(_0x251e80){var _0xe5e054=_0x251e80[_0x389f('0x1d')],_0x2e6932=_0x526b8a[_0x389f('0x1e')],_0xa29ad9=_0x526b8a[_0x389f('0x1e')]+_0x526b8a['limit'],_0x46ea96;if(_0xa29ad9>=_0xe5e054){_0xa29ad9=_0xe5e054;_0x46ea96=0xc8;}else{_0x46ea96=0xce;}_0x560b14[_0x389f('0x1b')](_0x46ea96);return _0x560b14[_0x389f('0x1f')](_0x389f('0x20'),_0x2e6932+'-'+_0xa29ad9+'/'+_0xe5e054)['json'](_0x251e80);}return null;};}function patchUpdates(_0x5045c3){return function(_0x4ddad3){try{jsonpatch[_0x389f('0x21')](_0x4ddad3,_0x5045c3,!![]);}catch(_0x442e25){return BPromise[_0x389f('0x22')](_0x442e25);}return _0x4ddad3[_0x389f('0x23')]();};}function saveUpdates(_0x2bbba5,_0x1f8612){return function(_0x23e41e){if(_0x23e41e){return _0x23e41e[_0x389f('0x24')](_0x2bbba5)[_0x389f('0x25')](function(_0x1fc463){return _0x1fc463;});}return null;};}function removeEntity(_0xe999bc,_0x355039){return function(_0x17dabc){if(_0x17dabc){return _0x17dabc[_0x389f('0x26')]()[_0x389f('0x25')](function(){_0xe999bc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2703d1,_0x8de39b){return function(_0x5980e3){if(!_0x5980e3){_0x2703d1[_0x389f('0x1a')](0x194);}return _0x5980e3;};}function handleError(_0x44f2ae,_0x3ceca2){_0x3ceca2=_0x3ceca2||0x1f4;return function(_0x361910){logger[_0x389f('0x27')](_0x361910['stack']);if(_0x361910['name']){delete _0x361910[_0x389f('0x28')];}_0x44f2ae[_0x389f('0x1b')](_0x3ceca2)['send'](_0x361910);};}exports[_0x389f('0x29')]=function(_0x3024a7,_0x2d6ddb){var _0xac559d={},_0x1a0edc={},_0x544608={'count':0x0,'rows':[]};var _0x51e434=_[_0x389f('0x2a')](db[_0x389f('0x2b')][_0x389f('0x2c')],function(_0x298a3b){return{'name':_0x298a3b[_0x389f('0x2d')],'type':_0x298a3b['type']['key']};});_0x1a0edc[_0x389f('0x2e')]=_[_0x389f('0x2a')](_0x51e434,_0x389f('0x28'));_0x1a0edc[_0x389f('0x2f')]=_[_0x389f('0x30')](_0x3024a7[_0x389f('0x2f')]);_0x1a0edc[_0x389f('0x31')]=_[_0x389f('0x32')](_0x1a0edc[_0x389f('0x2e')],_0x1a0edc['query']);_0xac559d[_0x389f('0x33')]=_[_0x389f('0x32')](_0x1a0edc[_0x389f('0x2e')],qs[_0x389f('0x34')](_0x3024a7['query']['fields']));_0xac559d[_0x389f('0x33')]=_0xac559d[_0x389f('0x33')][_0x389f('0x35')]?_0xac559d['attributes']:_0x1a0edc[_0x389f('0x2e')];if(!_0x3024a7[_0x389f('0x2f')][_0x389f('0x36')](_0x389f('0x37'))){_0xac559d[_0x389f('0x38')]=qs[_0x389f('0x38')](_0x3024a7[_0x389f('0x2f')][_0x389f('0x38')]);_0xac559d['offset']=qs[_0x389f('0x1e')](_0x3024a7[_0x389f('0x2f')]['offset']);}_0xac559d[_0x389f('0x39')]=qs[_0x389f('0x3a')](_0x3024a7[_0x389f('0x2f')][_0x389f('0x3a')]);_0xac559d[_0x389f('0x3b')]=qs[_0x389f('0x31')](_[_0x389f('0x3c')](_0x3024a7['query'],_0x1a0edc[_0x389f('0x31')]));if(_0x3024a7[_0x389f('0x2f')][_0x389f('0x3d')]){_0xac559d[_0x389f('0x3b')]=_[_0x389f('0x3e')](_0xac559d[_0x389f('0x3b')],{'$or':_[_0x389f('0x2a')](_0x51e434,function(_0x3f6466){if(_0x3f6466['type']!=='VIRTUAL'){var _0x4e59ff={};_0x4e59ff[_0x3f6466['name']]={'$like':'%'+_0x3024a7[_0x389f('0x2f')][_0x389f('0x3d')]+'%'};return _0x4e59ff;}})});}_0xac559d=_[_0x389f('0x3e')]({},_0xac559d,_0x3024a7['options']);var _0x1605be={'where':_0xac559d[_0x389f('0x3b')]};return db[_0x389f('0x2b')][_0x389f('0x1d')](_0x1605be)[_0x389f('0x25')](function(_0x28ff9f){_0x544608['count']=_0x28ff9f;if(_0x3024a7[_0x389f('0x2f')][_0x389f('0x3f')]){_0xac559d[_0x389f('0x40')]=[{'all':!![]}];}return db[_0x389f('0x2b')]['findAll'](_0xac559d);})[_0x389f('0x25')](function(_0x20d964){_0x544608[_0x389f('0x41')]=_0x20d964;return _0x544608;})['then'](respondWithFilteredResult(_0x2d6ddb,_0xac559d))[_0x389f('0x42')](handleError(_0x2d6ddb,null));};exports['show']=function(_0x2565db,_0x31c036){var _0x1a61d9={'raw':!![],'where':{'id':_0x2565db['params']['id']}},_0x1453fe={};_0x1453fe['model']=_['keys'](db[_0x389f('0x2b')]['rawAttributes']);_0x1453fe[_0x389f('0x2f')]=_[_0x389f('0x30')](_0x2565db[_0x389f('0x2f')]);_0x1453fe['filters']=_[_0x389f('0x32')](_0x1453fe['model'],_0x1453fe['query']);_0x1a61d9['attributes']=_[_0x389f('0x32')](_0x1453fe[_0x389f('0x2e')],qs['fields'](_0x2565db[_0x389f('0x2f')]['fields']));_0x1a61d9[_0x389f('0x33')]=_0x1a61d9[_0x389f('0x33')]['length']?_0x1a61d9[_0x389f('0x33')]:_0x1453fe[_0x389f('0x2e')];if(_0x2565db[_0x389f('0x2f')][_0x389f('0x3f')]){_0x1a61d9['include']=[{'all':!![]}];}_0x1a61d9=_[_0x389f('0x3e')]({},_0x1a61d9,_0x2565db[_0x389f('0x43')]);return db[_0x389f('0x2b')][_0x389f('0x44')](_0x1a61d9)['then'](handleEntityNotFound(_0x31c036,null))[_0x389f('0x25')](respondWithResult(_0x31c036,null))[_0x389f('0x42')](handleError(_0x31c036,null));};exports[_0x389f('0x45')]=function(_0x442c37,_0x495e3c){return db['ChatTransferReport'][_0x389f('0x45')](_0x442c37[_0x389f('0x46')],{})['then'](respondWithResult(_0x495e3c,0xc9))[_0x389f('0x42')](handleError(_0x495e3c,null));};exports['update']=function(_0x3b06ed,_0x485658){if(_0x3b06ed[_0x389f('0x46')]['id']){delete _0x3b06ed[_0x389f('0x46')]['id'];}return db[_0x389f('0x2b')]['find']({'where':{'id':_0x3b06ed[_0x389f('0x47')]['id']}})[_0x389f('0x25')](handleEntityNotFound(_0x485658,null))[_0x389f('0x25')](saveUpdates(_0x3b06ed[_0x389f('0x46')],null))['then'](respondWithResult(_0x485658,null))[_0x389f('0x42')](handleError(_0x485658,null));};exports['destroy']=function(_0x3ab32e,_0x27aacc){return db[_0x389f('0x2b')][_0x389f('0x44')]({'where':{'id':_0x3ab32e[_0x389f('0x47')]['id']}})[_0x389f('0x25')](handleEntityNotFound(_0x27aacc,null))[_0x389f('0x25')](removeEntity(_0x27aacc,null))[_0x389f('0x42')](handleError(_0x27aacc,null));};exports[_0x389f('0x48')]=function(_0x38760,_0xd22db9){return db['ChatTransferReport'][_0x389f('0x48')]()[_0x389f('0x25')](respondWithResult(_0xd22db9,null))[_0x389f('0x42')](handleError(_0xd22db9,null));}; \ No newline at end of file +var _0x2b92=['util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','map','ChatTransferReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','rows','catch','show','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache'];(function(_0x209e12,_0x2ce907){var _0x3f5b89=function(_0x39cc7f){while(--_0x39cc7f){_0x209e12['push'](_0x209e12['shift']());}};_0x3f5b89(++_0x2ce907);}(_0x2b92,0x1cd));var _0x22b9=function(_0x27ad31,_0x28d5f3){_0x27ad31=_0x27ad31-0x0;var _0x5b5c72=_0x2b92[_0x27ad31];return _0x5b5c72;};'use strict';var pdf=require(_0x22b9('0x0'));var emlformat=require(_0x22b9('0x1'));var rimraf=require(_0x22b9('0x2'));var zipdir=require(_0x22b9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x22b9('0x4'));var moment=require('moment');var BPromise=require(_0x22b9('0x5'));var Mustache=require(_0x22b9('0x6'));var util=require(_0x22b9('0x7'));var path=require(_0x22b9('0x8'));var sox=require(_0x22b9('0x9'));var csv=require(_0x22b9('0xa'));var ejs=require(_0x22b9('0xb'));var fs=require('fs');var _=require(_0x22b9('0xc'));var squel=require(_0x22b9('0xd'));var crypto=require(_0x22b9('0xe'));var jsforce=require(_0x22b9('0xf'));var deskjs=require(_0x22b9('0x10'));var toCsv=require(_0x22b9('0xa'));var querystring=require('querystring');var Papa=require(_0x22b9('0x11'));var Redis=require(_0x22b9('0x12'));var authService=require(_0x22b9('0x13'));var qs=require(_0x22b9('0x14'));var as=require(_0x22b9('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x22b9('0x16'))(_0x22b9('0x17'));var utils=require(_0x22b9('0x18'));var config=require(_0x22b9('0x19'));var db=require(_0x22b9('0x1a'))['db'];function respondWithStatusCode(_0x403f5e,_0x510a4f){_0x510a4f=_0x510a4f||0xcc;return function(_0x437e0f){if(_0x437e0f){return _0x403f5e[_0x22b9('0x1b')](_0x510a4f);}return _0x403f5e[_0x22b9('0x1c')](_0x510a4f)[_0x22b9('0x1d')]();};}function respondWithResult(_0x3ed61f,_0x3ec649){_0x3ec649=_0x3ec649||0xc8;return function(_0x2e7056){if(_0x2e7056){return _0x3ed61f[_0x22b9('0x1c')](_0x3ec649)[_0x22b9('0x1e')](_0x2e7056);}};}function respondWithFilteredResult(_0x566ca5,_0x527961){return function(_0x2e2413){if(_0x2e2413){var _0x422ff4=_0x2e2413[_0x22b9('0x1f')],_0x170e1c=_0x527961[_0x22b9('0x20')],_0x407aab=_0x527961[_0x22b9('0x20')]+_0x527961[_0x22b9('0x21')],_0x5ac1f9;if(_0x407aab>=_0x422ff4){_0x407aab=_0x422ff4;_0x5ac1f9=0xc8;}else{_0x5ac1f9=0xce;}_0x566ca5['status'](_0x5ac1f9);return _0x566ca5['set'](_0x22b9('0x22'),_0x170e1c+'-'+_0x407aab+'/'+_0x422ff4)[_0x22b9('0x1e')](_0x2e2413);}return null;};}function patchUpdates(_0x373e96){return function(_0x2bbd16){try{jsonpatch[_0x22b9('0x23')](_0x2bbd16,_0x373e96,!![]);}catch(_0x489c8d){return BPromise[_0x22b9('0x24')](_0x489c8d);}return _0x2bbd16[_0x22b9('0x25')]();};}function saveUpdates(_0x4e7731,_0x3d4ed9){return function(_0x5e63eb){if(_0x5e63eb){return _0x5e63eb[_0x22b9('0x26')](_0x4e7731)[_0x22b9('0x27')](function(_0x4d572e){return _0x4d572e;});}return null;};}function removeEntity(_0x381fef,_0x995e40){return function(_0x1e5aa2){if(_0x1e5aa2){return _0x1e5aa2[_0x22b9('0x28')]()[_0x22b9('0x27')](function(){_0x381fef[_0x22b9('0x1c')](0xcc)[_0x22b9('0x1d')]();});}};}function handleEntityNotFound(_0x1bf58a,_0x59019a){return function(_0x11c385){if(!_0x11c385){_0x1bf58a['sendStatus'](0x194);}return _0x11c385;};}function handleError(_0x4c9a25,_0x429045){_0x429045=_0x429045||0x1f4;return function(_0x44f0a8){logger[_0x22b9('0x29')](_0x44f0a8[_0x22b9('0x2a')]);if(_0x44f0a8[_0x22b9('0x2b')]){delete _0x44f0a8[_0x22b9('0x2b')];}_0x4c9a25[_0x22b9('0x1c')](_0x429045)['send'](_0x44f0a8);};}exports[_0x22b9('0x2c')]=function(_0x5526dc,_0x4e6677){var _0x1b697d={},_0x276f71={},_0xf33088={'count':0x0,'rows':[]};var _0x47d569=_[_0x22b9('0x2d')](db[_0x22b9('0x2e')][_0x22b9('0x2f')],function(_0x399dcf){return{'name':_0x399dcf[_0x22b9('0x30')],'type':_0x399dcf[_0x22b9('0x31')][_0x22b9('0x32')]};});_0x276f71['model']=_['map'](_0x47d569,_0x22b9('0x2b'));_0x276f71[_0x22b9('0x33')]=_[_0x22b9('0x34')](_0x5526dc['query']);_0x276f71[_0x22b9('0x35')]=_[_0x22b9('0x36')](_0x276f71[_0x22b9('0x37')],_0x276f71['query']);_0x1b697d[_0x22b9('0x38')]=_['intersection'](_0x276f71['model'],qs['fields'](_0x5526dc[_0x22b9('0x33')][_0x22b9('0x39')]));_0x1b697d[_0x22b9('0x38')]=_0x1b697d[_0x22b9('0x38')][_0x22b9('0x3a')]?_0x1b697d['attributes']:_0x276f71[_0x22b9('0x37')];if(!_0x5526dc[_0x22b9('0x33')][_0x22b9('0x3b')]('nolimit')){_0x1b697d[_0x22b9('0x21')]=qs[_0x22b9('0x21')](_0x5526dc[_0x22b9('0x33')]['limit']);_0x1b697d[_0x22b9('0x20')]=qs[_0x22b9('0x20')](_0x5526dc['query'][_0x22b9('0x20')]);}_0x1b697d[_0x22b9('0x3c')]=qs[_0x22b9('0x3d')](_0x5526dc[_0x22b9('0x33')]['sort']);_0x1b697d[_0x22b9('0x3e')]=qs[_0x22b9('0x35')](_[_0x22b9('0x3f')](_0x5526dc[_0x22b9('0x33')],_0x276f71[_0x22b9('0x35')]));if(_0x5526dc[_0x22b9('0x33')]['filter']){_0x1b697d[_0x22b9('0x3e')]=_[_0x22b9('0x40')](_0x1b697d[_0x22b9('0x3e')],{'$or':_['map'](_0x47d569,function(_0x3fb587){if(_0x3fb587[_0x22b9('0x31')]!==_0x22b9('0x41')){var _0x489117={};_0x489117[_0x3fb587[_0x22b9('0x2b')]]={'$like':'%'+_0x5526dc[_0x22b9('0x33')][_0x22b9('0x42')]+'%'};return _0x489117;}})});}_0x1b697d=_['merge']({},_0x1b697d,_0x5526dc[_0x22b9('0x43')]);var _0x136442={'where':_0x1b697d['where']};return db[_0x22b9('0x2e')][_0x22b9('0x1f')](_0x136442)[_0x22b9('0x27')](function(_0x37099d){_0xf33088['count']=_0x37099d;if(_0x5526dc[_0x22b9('0x33')][_0x22b9('0x44')]){_0x1b697d[_0x22b9('0x45')]=[{'all':!![]}];}return db[_0x22b9('0x2e')]['findAll'](_0x1b697d);})[_0x22b9('0x27')](function(_0x4be4c5){_0xf33088[_0x22b9('0x46')]=_0x4be4c5;return _0xf33088;})['then'](respondWithFilteredResult(_0x4e6677,_0x1b697d))[_0x22b9('0x47')](handleError(_0x4e6677,null));};exports[_0x22b9('0x48')]=function(_0x39b41c,_0x5ccb4c){var _0x2188ce={'raw':!![],'where':{'id':_0x39b41c['params']['id']}},_0x51d6f9={};_0x51d6f9[_0x22b9('0x37')]=_[_0x22b9('0x34')](db[_0x22b9('0x2e')][_0x22b9('0x2f')]);_0x51d6f9[_0x22b9('0x33')]=_[_0x22b9('0x34')](_0x39b41c[_0x22b9('0x33')]);_0x51d6f9['filters']=_[_0x22b9('0x36')](_0x51d6f9[_0x22b9('0x37')],_0x51d6f9[_0x22b9('0x33')]);_0x2188ce[_0x22b9('0x38')]=_['intersection'](_0x51d6f9[_0x22b9('0x37')],qs['fields'](_0x39b41c[_0x22b9('0x33')][_0x22b9('0x39')]));_0x2188ce[_0x22b9('0x38')]=_0x2188ce[_0x22b9('0x38')][_0x22b9('0x3a')]?_0x2188ce[_0x22b9('0x38')]:_0x51d6f9[_0x22b9('0x37')];if(_0x39b41c[_0x22b9('0x33')][_0x22b9('0x44')]){_0x2188ce[_0x22b9('0x45')]=[{'all':!![]}];}_0x2188ce=_[_0x22b9('0x40')]({},_0x2188ce,_0x39b41c[_0x22b9('0x43')]);return db[_0x22b9('0x2e')][_0x22b9('0x49')](_0x2188ce)[_0x22b9('0x27')](handleEntityNotFound(_0x5ccb4c,null))[_0x22b9('0x27')](respondWithResult(_0x5ccb4c,null))[_0x22b9('0x47')](handleError(_0x5ccb4c,null));};exports[_0x22b9('0x4a')]=function(_0x573847,_0x154da4){return db['ChatTransferReport'][_0x22b9('0x4a')](_0x573847[_0x22b9('0x4b')],{})[_0x22b9('0x27')](respondWithResult(_0x154da4,0xc9))[_0x22b9('0x47')](handleError(_0x154da4,null));};exports[_0x22b9('0x26')]=function(_0x3550e0,_0x559435){if(_0x3550e0[_0x22b9('0x4b')]['id']){delete _0x3550e0[_0x22b9('0x4b')]['id'];}return db[_0x22b9('0x2e')][_0x22b9('0x49')]({'where':{'id':_0x3550e0[_0x22b9('0x4c')]['id']}})[_0x22b9('0x27')](handleEntityNotFound(_0x559435,null))['then'](saveUpdates(_0x3550e0[_0x22b9('0x4b')],null))[_0x22b9('0x27')](respondWithResult(_0x559435,null))[_0x22b9('0x47')](handleError(_0x559435,null));};exports[_0x22b9('0x28')]=function(_0x2196cf,_0x562669){return db[_0x22b9('0x2e')][_0x22b9('0x49')]({'where':{'id':_0x2196cf[_0x22b9('0x4c')]['id']}})[_0x22b9('0x27')](handleEntityNotFound(_0x562669,null))[_0x22b9('0x27')](removeEntity(_0x562669,null))['catch'](handleError(_0x562669,null));};exports[_0x22b9('0x4d')]=function(_0x5baa6c,_0x151519){return db[_0x22b9('0x2e')][_0x22b9('0x4d')]()[_0x22b9('0x27')](respondWithResult(_0x151519,null))[_0x22b9('0x47')](handleError(_0x151519,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index d516e38..4d7d7f7 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 _0x4096=['../../config/logger','api','moment','bluebird','request-promise','path','./chatTransferReport.attributes','exports','define','ChatTransferReport','report_chat_transfer','uniqueid','lodash'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0x4096,0x110));var _0x6409=function(_0x196cb1,_0x355324){_0x196cb1=_0x196cb1-0x0;var _0x533908=_0x4096[_0x196cb1];return _0x533908;};'use strict';var _=require(_0x6409('0x0'));var util=require('util');var logger=require(_0x6409('0x1'))(_0x6409('0x2'));var moment=require(_0x6409('0x3'));var BPromise=require(_0x6409('0x4'));var rp=require(_0x6409('0x5'));var fs=require('fs');var path=require(_0x6409('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6409('0x7'));module[_0x6409('0x8')]=function(_0x37d8fa,_0x50ea0f){return _0x37d8fa[_0x6409('0x9')](_0x6409('0xa'),attributes,{'tableName':_0x6409('0xb'),'paranoid':![],'indexes':[{'name':_0x6409('0xc'),'fields':[_0x6409('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf7e=['define','ChatTransferReport','report_chat_transfer','uniqueid','lodash','util','api','moment','../../config/environment','./chatTransferReport.attributes','exports'];(function(_0x381726,_0x2f9818){var _0x267242=function(_0x1a0dbc){while(--_0x1a0dbc){_0x381726['push'](_0x381726['shift']());}};_0x267242(++_0x2f9818);}(_0xaf7e,0x1bc));var _0xeaf7=function(_0x6ef631,_0x44994d){_0x6ef631=_0x6ef631-0x0;var _0x3aa23f=_0xaf7e[_0x6ef631];return _0x3aa23f;};'use strict';var _=require(_0xeaf7('0x0'));var util=require(_0xeaf7('0x1'));var logger=require('../../config/logger')(_0xeaf7('0x2'));var moment=require(_0xeaf7('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xeaf7('0x4'));var attributes=require(_0xeaf7('0x5'));module[_0xeaf7('0x6')]=function(_0x3c31aa,_0x1ee780){return _0x3c31aa[_0xeaf7('0x7')](_0xeaf7('0x8'),attributes,{'tableName':_0xeaf7('0x9'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0xeaf7('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 07f1a38..c62c7d7 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 _0x8818=['client','http','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x5b17b4,_0x5a3221){var _0x55af79=function(_0x888225){while(--_0x888225){_0x5b17b4['push'](_0x5b17b4['shift']());}};_0x55af79(++_0x5a3221);}(_0x8818,0x1d8));var _0x8881=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x8818[_0x3b380d];return _0x54502b;};'use strict';var _=require(_0x8881('0x0'));var util=require(_0x8881('0x1'));var moment=require(_0x8881('0x2'));var BPromise=require(_0x8881('0x3'));var rs=require(_0x8881('0x4'));var fs=require('fs');var Redis=require(_0x8881('0x5'));var db=require(_0x8881('0x6'))['db'];var utils=require(_0x8881('0x7'));var logger=require(_0x8881('0x8'))('rpc');var config=require(_0x8881('0x9'));var jayson=require(_0x8881('0xa'));var client=jayson[_0x8881('0xb')][_0x8881('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1262a3,_0x43dd41,_0x3f6775){return new BPromise(function(_0x502e55,_0x1d0180){return client['request'](_0x1262a3,_0x3f6775)[_0x8881('0xd')](function(_0x10d650){logger['info'](_0x8881('0xe'),_0x43dd41,_0x8881('0xf'));logger[_0x8881('0x10')](_0x8881('0x11'),_0x43dd41,'request\x20sent',JSON['stringify'](_0x10d650));if(_0x10d650[_0x8881('0x12')]){if(_0x10d650[_0x8881('0x12')][_0x8881('0x13')]===0x1f4){logger[_0x8881('0x12')](_0x8881('0xe'),_0x43dd41,_0x10d650[_0x8881('0x12')]['message']);return _0x1d0180(_0x10d650[_0x8881('0x12')][_0x8881('0x14')]);}logger['error'](_0x8881('0xe'),_0x43dd41,_0x10d650['error'][_0x8881('0x14')]);return _0x502e55(_0x10d650[_0x8881('0x12')]['message']);}else{logger[_0x8881('0x15')](_0x8881('0xe'),_0x43dd41,_0x8881('0xf'));_0x502e55(_0x10d650['result'][_0x8881('0x14')]);}})[_0x8881('0x16')](function(_0x19a8ca){logger[_0x8881('0x12')](_0x8881('0xe'),_0x43dd41,_0x19a8ca);_0x1d0180(_0x19a8ca);});});} \ No newline at end of file +var _0x81f8=['catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','info'];(function(_0x49b207,_0x408ade){var _0x2dc8fa=function(_0x150975){while(--_0x150975){_0x49b207['push'](_0x49b207['shift']());}};_0x2dc8fa(++_0x408ade);}(_0x81f8,0x1e4));var _0x881f=function(_0x16e30c,_0x5f5d17){_0x16e30c=_0x16e30c-0x0;var _0x244709=_0x81f8[_0x16e30c];return _0x244709;};'use strict';var _=require(_0x881f('0x0'));var util=require('util');var moment=require(_0x881f('0x1'));var BPromise=require(_0x881f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x881f('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x881f('0x4'));var logger=require(_0x881f('0x5'))(_0x881f('0x6'));var config=require(_0x881f('0x7'));var jayson=require(_0x881f('0x8'));var client=jayson[_0x881f('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x552cba,_0x5df7b4,_0x22a9a2){return new BPromise(function(_0x572604,_0x594245){return client[_0x881f('0xa')](_0x552cba,_0x22a9a2)[_0x881f('0xb')](function(_0x7201ad){logger['info'](_0x881f('0xc'),_0x5df7b4,_0x881f('0xd'));logger[_0x881f('0xe')](_0x881f('0xf'),_0x5df7b4,_0x881f('0xd'),JSON['stringify'](_0x7201ad));if(_0x7201ad[_0x881f('0x10')]){if(_0x7201ad[_0x881f('0x10')][_0x881f('0x11')]===0x1f4){logger[_0x881f('0x10')](_0x881f('0xc'),_0x5df7b4,_0x7201ad[_0x881f('0x10')][_0x881f('0x12')]);return _0x594245(_0x7201ad[_0x881f('0x10')][_0x881f('0x12')]);}logger['error'](_0x881f('0xc'),_0x5df7b4,_0x7201ad[_0x881f('0x10')]['message']);return _0x572604(_0x7201ad[_0x881f('0x10')][_0x881f('0x12')]);}else{logger[_0x881f('0x13')]('ChatTransferReport,\x20%s,\x20%s',_0x5df7b4,'request\x20sent');_0x572604(_0x7201ad['result'][_0x881f('0x12')]);}})[_0x881f('0x14')](function(_0xabc212){logger['error']('ChatTransferReport,\x20%s,\x20%s',_0x5df7b4,_0xabc212);_0x594245(_0xabc212);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index d0f5ca5..4b28a30 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 _0xbaf0=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','util','path'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0xf')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x11')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x13')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x2032=['describe','/:id','post','create','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe'];(function(_0x563379,_0x352c96){var _0x2a5b10=function(_0xfed86a){while(--_0xfed86a){_0x563379['push'](_0x563379['shift']());}};_0x2a5b10(++_0x352c96);}(_0x2032,0xd9));var _0x2203=function(_0x14e724,_0x2645cd){_0x14e724=_0x14e724-0x0;var _0x1c27a2=_0x2032[_0x14e724];return _0x1c27a2;};'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('0x7')](_0x2203('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x2203('0xd')]('/',auth['isAuthenticated'](),controller[_0x2203('0xe')]);router[_0x2203('0xf')](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x10')]);router['delete'](_0x2203('0xc'),auth['isAuthenticated'](),controller[_0x2203('0x11')]);module[_0x2203('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index e35c5ed..308f7c0 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 _0x8169=['star','stringify','name','input','getDataValue','parse','setDataValue','onlineForm','textarea','Comments','Leave\x20your\x20comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','alternate','#fafafa','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','address','email','Agent','#9f946a','INTEGER','BOOLEAN','ENUM','rounded','squared','We\x20are\x20here!','Chat','Contact\x20us','TEXT','Form\x20submission\x20error','Note','Type\x20a\x20message','Thanks\x20you\x20for\x20your\x20time!','Send','Skip','Feedback'];(function(_0x2db12b,_0x30ab1d){var _0x20990b=function(_0x589477){while(--_0x589477){_0x2db12b['push'](_0x2db12b['shift']());}};_0x20990b(++_0x30ab1d);}(_0x8169,0x1ed));var _0x9816=function(_0x14fa38,_0xb3a122){_0x14fa38=_0x14fa38-0x0;var _0x1d0d39=_0x8169[_0x14fa38];return _0x1d0d39;};'use strict';var Sequelize=require(_0x9816('0x0'));var rs=require(_0x9816('0x1'));module[_0x9816('0x2')]={'name':{'type':Sequelize[_0x9816('0x3')],'allowNull':![]},'address':{'type':Sequelize[_0x9816('0x3')],'allowNull':![],'unique':_0x9816('0x4')},'description':{'type':Sequelize[_0x9816('0x3')]},'mapKey':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x5')},'mapKeyOffline':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x5')},'key':{'type':Sequelize[_0x9816('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x6')},'customerAlias':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x9816('0x3')],'allowNull':![],'defaultValue':_0x9816('0x7'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x9816('0x3')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x9816('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x9816('0x3')]},'animation':{'type':Sequelize[_0x9816('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x9816('0xa')](_0x9816('0xb'),_0x9816('0xc')),'defaultValue':_0x9816('0xb')},'header_online':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0xd')},'start_chat_button':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0xe')},'offline_chat_button':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'Send'},'header_offline':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0xf')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x9816('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':'Powered\x20by\x20xCALLY'},'defaultWhiteLabel':{'type':Sequelize[_0x9816('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x9816('0x10')]},'closingQuestion':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'Do\x20you\x20want\x20to\x20close\x20the\x20interaction?'},'formSubmitSuccessMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20properly\x20submitted'},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x11')},'noteTitle':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x12')},'placeholderMessage':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x13')},'closingMessage':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x14')},'closingMessageButton':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x15')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x16')},'conditionAgreement':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x17')},'ratingType':{'type':Sequelize[_0x9816('0xa')](_0x9816('0x18'),'thumb'),'defaultValue':_0x9816('0x18')},'ratingStarsNumber':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'onlineForm':{'type':Sequelize['TEXT'],'defaultValue':function(){return JSON[_0x9816('0x19')]({'items':[{'type':'input','variable':null,'config':{'placeholder':_0x9816('0x1a'),'type':'text','required':!![]},'props':{'title':_0x9816('0x1a'),'helpText':''}},{'type':_0x9816('0x1b'),'props':{'title':_0x9816('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9816('0x5'),'type':_0x9816('0x5')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x9816('0x1c')]('onlineForm')?JSON[_0x9816('0x1d')](this[_0x9816('0x1c')]('onlineForm')):{};},'set':function(_0x450459){return this[_0x9816('0x1e')](_0x9816('0x1f'),JSON[_0x9816('0x19')](_0x450459));}},'offlineForm':{'type':Sequelize[_0x9816('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x9816('0x1b'),'props':{'title':_0x9816('0x5'),'helpText':''},'config':{'required':!![],'placeholder':_0x9816('0x5'),'type':_0x9816('0x5')},'variable':null},{'type':_0x9816('0x20'),'config':{'placeholder':_0x9816('0x21')},'props':{'title':_0x9816('0x21'),'helpText':_0x9816('0x22')}}],'fromKey':0x0});},'get':function(){return this[_0x9816('0x1c')](_0x9816('0x23'))?JSON['parse'](this[_0x9816('0x1c')](_0x9816('0x23'))):{};},'set':function(_0x93a029){return this[_0x9816('0x1e')]('offlineForm',JSON[_0x9816('0x19')](_0x93a029));}},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9816('0x24')]();}},'autoclose':{'type':Sequelize[_0x9816('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x9816('0x3')]},'forwardOffline':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x9816('0x3')]},'waitingTitle':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x25')},'waitingMessage':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x26')},'offlineMessageSubject':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x27')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x28')},'enableUnmanagedNote':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x29')},'skipUnmanaged':{'type':Sequelize[_0x9816('0x3')],'defaultValue':_0x9816('0x16')},'sendUnmanaged':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x9816('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x9816('0x10')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x9816('0x9')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'website_alias'},'waitForTheAssignedAgent':{'type':Sequelize[_0x9816('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x9816('0x2a')},'defaultTitle':{'type':Sequelize['STRING']},'customerAvatar':{'type':Sequelize[_0x9816('0x10')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x9816('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x9816('0x3')],'allowNull':![],'defaultValue':_0x9816('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x9816('0x3')],'defaultValue':'System'},'systemAvatar':{'type':Sequelize[_0x9816('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9816('0x8')],'comment':_0x9816('0x2c')},'mandatoryDisposition':{'type':Sequelize[_0x9816('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xf78590){if(!_0xf78590)this[_0x9816('0x1e')](_0x9816('0x2d'),null);this['setDataValue'](_0x9816('0x2e'),_0xf78590);}}}; \ No newline at end of file +var _0xf71f=['ENUM','rounded','Send','Powered\x20by\x20xCALLY','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Type\x20a\x20message','Skip','Feedback','star','thumb','TEXT','stringify','input','text','onlineForm','parse','getDataValue','setDataValue','Comments','offlineForm','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','System','sequelize','randomstring','exports','STRING','email','Agent','#9f946a','#ffffff','INTEGER','BOOLEAN'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0xf71f,0x1ee));var _0xff71=function(_0x460f40,_0x4a2a2d){_0x460f40=_0x460f40-0x0;var _0x4128c5=_0xf71f[_0x460f40];return _0x4128c5;};'use strict';var Sequelize=require(_0xff71('0x0'));var rs=require(_0xff71('0x1'));module[_0xff71('0x2')]={'name':{'type':Sequelize[_0xff71('0x3')],'allowNull':![]},'address':{'type':Sequelize['STRING'],'allowNull':![],'unique':'address'},'description':{'type':Sequelize[_0xff71('0x3')]},'mapKey':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x4')},'mapKeyOffline':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x4')},'key':{'type':Sequelize[_0xff71('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x5')},'customerAlias':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0xff71('0x3')],'allowNull':![],'defaultValue':_0xff71('0x6'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0xff71('0x3')],'allowNull':![],'defaultValue':_0xff71('0x6'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0xff71('0x3')],'allowNull':![],'defaultValue':_0xff71('0x7'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0xff71('0x8')],'defaultValue':0xf},'remote':{'type':Sequelize[_0xff71('0x3')]},'animation':{'type':Sequelize[_0xff71('0x9')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0xff71('0xa')](_0xff71('0xb'),'squared'),'defaultValue':_0xff71('0xb')},'header_online':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize['STRING'],'defaultValue':'Chat'},'offline_chat_button':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0xc')},'header_offline':{'type':Sequelize['STRING'],'defaultValue':'Contact\x20us'},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0xff71('0x8')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0xd')},'defaultWhiteLabel':{'type':Sequelize[_0xff71('0x9')],'defaultValue':!![]},'sitepic':{'type':Sequelize['TEXT']},'closingQuestion':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0xe')},'formSubmitSuccessMessage':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0xf')},'formSubmitFailureMessage':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x10')},'noteTitle':{'type':Sequelize['STRING'],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x11')},'closingMessage':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'Send'},'skipMessageButton':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x12')},'conditionAgreement':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x13')},'ratingType':{'type':Sequelize['ENUM'](_0xff71('0x14'),_0xff71('0x15')),'defaultValue':_0xff71('0x14')},'ratingStarsNumber':{'type':Sequelize[_0xff71('0x8')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0xff71('0x16')],'defaultValue':function(){return JSON[_0xff71('0x17')]({'items':[{'type':_0xff71('0x18'),'variable':null,'config':{'placeholder':'name','type':_0xff71('0x19'),'required':!![]},'props':{'title':'name','helpText':''}},{'type':_0xff71('0x18'),'props':{'title':_0xff71('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xff71('0x4'),'type':_0xff71('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this['getDataValue'](_0xff71('0x1a'))?JSON[_0xff71('0x1b')](this[_0xff71('0x1c')](_0xff71('0x1a'))):{};},'set':function(_0x46c94c){return this[_0xff71('0x1d')](_0xff71('0x1a'),JSON['stringify'](_0x46c94c));}},'offlineForm':{'type':Sequelize[_0xff71('0x16')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0xff71('0x18'),'props':{'title':_0xff71('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0xff71('0x4'),'type':_0xff71('0x4')},'variable':null},{'type':'textarea','config':{'placeholder':_0xff71('0x1e')},'props':{'title':'Comments','helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this['getDataValue']('offlineForm')?JSON[_0xff71('0x1b')](this['getDataValue']('offlineForm')):{};},'set':function(_0x42ad8d){return this[_0xff71('0x1d')](_0xff71('0x1f'),JSON[_0xff71('0x17')](_0x42ad8d));}},'token':{'type':Sequelize[_0xff71('0x3')],'defaultValue':function(){return rs[_0xff71('0x20')]();}},'autoclose':{'type':Sequelize[_0xff71('0x9')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0xff71('0x3')]},'forwardOffline':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0xff71('0x3')]},'waitingTitle':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x21')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x22')},'offlineMessageSubject':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'New\x20offline\x20message\x20from\x20websiteName'},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x23')},'enableUnmanagedNote':{'type':Sequelize[_0xff71('0x9')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x24')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0xff71('0x3')],'defaultValue':'Send'},'enableCustomerAttachment':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0xff71('0x16')]},'showAgentAvatar':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'timezone':{'type':Sequelize[_0xff71('0x3')]},'notificationTemplate':{'type':Sequelize[_0xff71('0x16')],'defaultValue':function(){return _0xff71('0x25');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x26')},'waitForTheAssignedAgent':{'type':Sequelize[_0xff71('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x27')},'verticalAlignment':{'type':Sequelize[_0xff71('0x8')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0xff71('0x28')},'defaultTitle':{'type':Sequelize[_0xff71('0x3')]},'customerAvatar':{'type':Sequelize[_0xff71('0x16')]},'showCustomerAvatar':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0xff71('0x8')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0xff71('0x3')],'allowNull':![],'defaultValue':'#fafafa','validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xff71('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0xff71('0x3')],'defaultValue':_0xff71('0x29')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize[_0xff71('0x8')],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x249a83){if(!_0x249a83)this[_0xff71('0x1d')]('mandatoryDispositionPauseId',null);this[_0xff71('0x1d')]('mandatoryDisposition',_0x249a83);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index ab1c0aa..688772b 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 _0x9e64=['request-promise','bluebird','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','register','client','Sequelize','request','then','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','ChatWebsite,\x20%s,\x20%s','message','info','catch','sendStatus','end','status','json','count','offset','limit','apply','save','update','get','ChatWebsites','UserProfileResource','destroy','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','name','filter','merge','options','includeAll','include','findAll','rows','params','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','describe','addDisposition','ChatWebsiteId','Disposition','getDispositions','nolimit','removeDispositions','ids','addAnswer','CannedAnswer','findOne','removeAnswers','addLogo','sitepic','file','filename','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','getLicense','custom','isNil','join','server/files/images/avatars/default_avatar.png','existsSync','server/files/images/avatars/','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','download','getSystemAvatar','setUA','headers','user-agent','getResult','chat','CmContact','ValidationError','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','ChatApplication','Applications','account','applications','orderBy','priority','asc','ListId','contact','customerIp','cf-connecting-ip','x-forwarded-for','first','split','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','externalUrl','interaction','ChatInteraction','spread','firstName','messageId','created','autoclose','push','close','unmanaged','*,*,*,*','ChatMessage','AttachmentId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','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','ChatOfflineMessage','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','internal','Tag','color','tag','getSnippet','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','ONLINE','timezone','No\x20timezone','inspect','Interval','virtual','increment','Intervals','all','some','server/files/chat/iframe.js','stringify','connection','verticalAlignment','textColor','addApplications','sequelize','transaction','bulkCreate','getApplications','chatProactiveAction','addProactiveActions','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','Contact','addAgents','emit','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','getAgents','html-pdf','eml-format','fast-json-patch'];(function(_0x551c44,_0x5e95bd){var _0x4dbcea=function(_0x2800b0){while(--_0x2800b0){_0x551c44['push'](_0x551c44['shift']());}};_0x4dbcea(++_0x5e95bd);}(_0x9e64,0x109));var _0x49e6=function(_0x40b955,_0x36f4df){_0x40b955=_0x40b955-0x0;var _0x3e076e=_0x9e64[_0x40b955];return _0x3e076e;};'use strict';var pdf=require(_0x49e6('0x0'));var emlformat=require(_0x49e6('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x49e6('0x2'));var rp=require(_0x49e6('0x3'));var moment=require('moment');var BPromise=require(_0x49e6('0x4'));var Mustache=require('mustache');var util=require(_0x49e6('0x5'));var path=require('path');var sox=require(_0x49e6('0x6'));var csv=require('to-csv');var ejs=require(_0x49e6('0x7'));var fs=require('fs');var _=require(_0x49e6('0x8'));var squel=require('squel');var crypto=require(_0x49e6('0x9'));var jsforce=require(_0x49e6('0xa'));var deskjs=require(_0x49e6('0xb'));var toCsv=require(_0x49e6('0xc'));var querystring=require(_0x49e6('0xd'));var Papa=require(_0x49e6('0xe'));var Redis=require(_0x49e6('0xf'));var authService=require(_0x49e6('0x10'));var qs=require(_0x49e6('0x11'));var as=require(_0x49e6('0x12'));var hardwareService=require(_0x49e6('0x13'));var logger=require(_0x49e6('0x14'))('api');var utils=require(_0x49e6('0x15'));var config=require('../../config/environment');var db=require(_0x49e6('0x16'))['db'];config['redis']=_[_0x49e6('0x17')](config[_0x49e6('0x18')],{'host':_0x49e6('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatWebsite.socket')[_0x49e6('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0x49e6('0x1b')]['http']({'port':0x232c});var client9002=jayson[_0x49e6('0x1b')]['http']({'port':0x232a});var client9003=jayson[_0x49e6('0x1b')]['http']({'port':0x232b});function checkPasswordPattern(_0x5389b0,_0x4cbc55,_0x5bf3a5){if(_0x5bf3a5){var _0x18516f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x18516f['test'](_0x4cbc55)){return _0x5389b0;}else{throw new db[(_0x49e6('0x1c'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5389b0;}}function respondWithRpcPromise(_0x299cfe,_0x33bc62,_0x322c8c,_0x1ffb76){return new BPromise(function(_0x137c5c,_0x46d068){var _0x51e8d9=_0x1ffb76||client;return _0x51e8d9[_0x49e6('0x1d')](_0x299cfe,_0x322c8c)[_0x49e6('0x1e')](function(_0x566def){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x33bc62,_0x49e6('0x1f'));logger[_0x49e6('0x20')](_0x49e6('0x21'),_0x33bc62,_0x49e6('0x1f'),JSON['stringify'](_0x566def));if(_0x566def[_0x49e6('0x22')]){if(_0x566def['error'][_0x49e6('0x23')]===0x1f4){logger[_0x49e6('0x22')](_0x49e6('0x24'),_0x33bc62,_0x566def[_0x49e6('0x22')][_0x49e6('0x25')]);return _0x46d068(_0x566def['error']['message']);}logger['error'](_0x49e6('0x24'),_0x33bc62,_0x566def[_0x49e6('0x22')][_0x49e6('0x25')]);return _0x137c5c(_0x566def[_0x49e6('0x22')][_0x49e6('0x25')]);}else{logger[_0x49e6('0x26')](_0x49e6('0x24'),_0x33bc62,'request\x20sent');_0x137c5c(_0x566def['result'][_0x49e6('0x25')]);}})[_0x49e6('0x27')](function(_0x29affa){logger['error'](_0x49e6('0x24'),_0x33bc62,_0x29affa);_0x46d068(_0x29affa);});});}function respondWithStatusCode(_0x1540e4,_0x5a877a){_0x5a877a=_0x5a877a||0xcc;return function(_0x22c708){if(_0x22c708){return _0x1540e4[_0x49e6('0x28')](_0x5a877a);}return _0x1540e4['status'](_0x5a877a)[_0x49e6('0x29')]();};}function respondWithResult(_0x966a79,_0x4e7d52){_0x4e7d52=_0x4e7d52||0xc8;return function(_0x2d59ee){if(_0x2d59ee){return _0x966a79[_0x49e6('0x2a')](_0x4e7d52)[_0x49e6('0x2b')](_0x2d59ee);}};}function respondWithFilteredResult(_0x3cd320,_0xb3347a){return function(_0x568a10){if(_0x568a10){var _0x21a0a8=_0x568a10[_0x49e6('0x2c')],_0x237a36=_0xb3347a[_0x49e6('0x2d')],_0x5e0b6b=_0xb3347a[_0x49e6('0x2d')]+_0xb3347a[_0x49e6('0x2e')],_0x1abd4d;if(_0x5e0b6b>=_0x21a0a8){_0x5e0b6b=_0x21a0a8;_0x1abd4d=0xc8;}else{_0x1abd4d=0xce;}_0x3cd320[_0x49e6('0x2a')](_0x1abd4d);return _0x3cd320['set']('Content-Range',_0x237a36+'-'+_0x5e0b6b+'/'+_0x21a0a8)['json'](_0x568a10);}return null;};}function patchUpdates(_0xee2053){return function(_0x1e67e0){try{jsonpatch[_0x49e6('0x2f')](_0x1e67e0,_0xee2053,!![]);}catch(_0x3f1e99){return BPromise['reject'](_0x3f1e99);}return _0x1e67e0[_0x49e6('0x30')]();};}function saveUpdates(_0xd9eb34,_0x2554ae){return function(_0x513dfa){if(_0x513dfa){return _0x513dfa[_0x49e6('0x31')](_0xd9eb34)['then'](function(_0x43b716){return _0x43b716;});}return null;};}function removeEntity(_0x1444b4,_0xa496a0){return function(_0x3ca84a){if(_0x3ca84a){return _0x3ca84a['destroy']()['then'](function(){var _0x2b318d=_0x3ca84a[_0x49e6('0x32')]({'plain':!![]});var _0x1e03a3=_0x49e6('0x33');return db[_0x49e6('0x34')][_0x49e6('0x35')]({'where':{'type':_0x1e03a3,'resourceId':_0x2b318d['id']}})['then'](function(){return _0x3ca84a;});})[_0x49e6('0x1e')](function(){_0x1444b4[_0x49e6('0x2a')](0xcc)[_0x49e6('0x29')]();});}};}function handleEntityNotFound(_0x45d96,_0x17574f){return function(_0x32cc24){if(!_0x32cc24){_0x45d96['sendStatus'](0x194);}return _0x32cc24;};}function handleError(_0x43ad71,_0x1caff0){_0x1caff0=_0x1caff0||0x1f4;return function(_0x3d46b1){logger[_0x49e6('0x22')](_0x3d46b1['stack']);if(_0x3d46b1['name']){delete _0x3d46b1['name'];}_0x43ad71[_0x49e6('0x2a')](_0x1caff0)[_0x49e6('0x36')](_0x3d46b1);};}exports['index']=function(_0x58c08a,_0x1c4684){var _0x578d7c={'include':[{'model':db[_0x49e6('0x37')],'as':_0x49e6('0x38')}]},_0x31cd6e={},_0x106f93={'count':0x0,'rows':[]};var _0x1de4ed=_[_0x49e6('0x39')](db[_0x49e6('0x3a')][_0x49e6('0x3b')],function(_0x517fc4){return{'name':_0x517fc4['fieldName'],'type':_0x517fc4[_0x49e6('0x3c')][_0x49e6('0x3d')]};});_0x31cd6e[_0x49e6('0x3e')]=_['map'](_0x1de4ed,'name');_0x31cd6e[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x58c08a[_0x49e6('0x3f')]);_0x31cd6e[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x31cd6e[_0x49e6('0x3e')],_0x31cd6e['query']);_0x578d7c[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x31cd6e['model'],qs[_0x49e6('0x44')](_0x58c08a['query'][_0x49e6('0x44')]));_0x578d7c[_0x49e6('0x43')]=_0x578d7c[_0x49e6('0x43')]['length']?_0x578d7c[_0x49e6('0x43')]:_0x31cd6e[_0x49e6('0x3e')];if(!_0x58c08a[_0x49e6('0x3f')][_0x49e6('0x45')]('nolimit')){_0x578d7c['limit']=qs[_0x49e6('0x2e')](_0x58c08a[_0x49e6('0x3f')][_0x49e6('0x2e')]);_0x578d7c[_0x49e6('0x2d')]=qs[_0x49e6('0x2d')](_0x58c08a[_0x49e6('0x3f')][_0x49e6('0x2d')]);}_0x578d7c[_0x49e6('0x46')]=qs[_0x49e6('0x47')](_0x58c08a[_0x49e6('0x3f')]['sort']);_0x578d7c[_0x49e6('0x48')]=qs['filters'](_[_0x49e6('0x49')](_0x58c08a['query'],_0x31cd6e[_0x49e6('0x41')]));if(_0x58c08a['query']['filter']){_0x578d7c['where']=_['merge'](_0x578d7c[_0x49e6('0x48')],{'$or':_['map'](_0x1de4ed,function(_0xebb3c8){if(_0xebb3c8[_0x49e6('0x3c')]!=='VIRTUAL'){var _0x10c749={};_0x10c749[_0xebb3c8[_0x49e6('0x4a')]]={'$like':'%'+_0x58c08a['query'][_0x49e6('0x4b')]+'%'};return _0x10c749;}})});}_0x578d7c=_[_0x49e6('0x4c')]({},_0x578d7c,_0x58c08a[_0x49e6('0x4d')]);var _0x1fd4a4={'where':_0x578d7c[_0x49e6('0x48')]};return db[_0x49e6('0x3a')][_0x49e6('0x2c')](_0x1fd4a4)[_0x49e6('0x1e')](function(_0x59d3ef){_0x106f93[_0x49e6('0x2c')]=_0x59d3ef;if(_0x58c08a[_0x49e6('0x3f')][_0x49e6('0x4e')]){_0x578d7c[_0x49e6('0x4f')]=[{'all':!![]}];}return db[_0x49e6('0x3a')][_0x49e6('0x50')](_0x578d7c);})[_0x49e6('0x1e')](function(_0x2d4301){_0x106f93[_0x49e6('0x51')]=_0x2d4301;return _0x106f93;})[_0x49e6('0x1e')](respondWithFilteredResult(_0x1c4684,_0x578d7c))[_0x49e6('0x27')](handleError(_0x1c4684,null));};exports['show']=function(_0x465268,_0x3780c2){var _0x5dc889={'raw':![],'where':{'id':_0x465268[_0x49e6('0x52')]['id']},'include':[{'model':db[_0x49e6('0x37')],'as':_0x49e6('0x38')}]},_0x35f017={};_0x35f017[_0x49e6('0x3e')]=_[_0x49e6('0x40')](db[_0x49e6('0x3a')][_0x49e6('0x3b')]);_0x35f017[_0x49e6('0x3f')]=_['keys'](_0x465268[_0x49e6('0x3f')]);_0x35f017[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x35f017[_0x49e6('0x3e')],_0x35f017[_0x49e6('0x3f')]);_0x5dc889['attributes']=_[_0x49e6('0x42')](_0x35f017['model'],qs[_0x49e6('0x44')](_0x465268[_0x49e6('0x3f')][_0x49e6('0x44')]));_0x5dc889['attributes']=_0x5dc889['attributes'][_0x49e6('0x53')]?_0x5dc889[_0x49e6('0x43')]:_0x35f017['model'];if(_0x465268[_0x49e6('0x3f')][_0x49e6('0x4e')]){_0x5dc889['include']=[{'all':!![]}];}_0x5dc889=_[_0x49e6('0x4c')]({},_0x5dc889,_0x465268[_0x49e6('0x4d')]);return db[_0x49e6('0x3a')]['find'](_0x5dc889)['then'](handleEntityNotFound(_0x3780c2,null))[_0x49e6('0x1e')](respondWithResult(_0x3780c2,null))[_0x49e6('0x27')](handleError(_0x3780c2,null));};exports[_0x49e6('0x54')]=function(_0x4a8327,_0x1618d8){return db[_0x49e6('0x3a')]['create'](_0x4a8327[_0x49e6('0x55')],{})['then'](function(_0x1c0ee5){var _0x108797=_0x4a8327[_0x49e6('0x56')][_0x49e6('0x32')]({'plain':!![]});if(!_0x108797)throw new Error(_0x49e6('0x57'));if(_0x108797['role']===_0x49e6('0x56')){var _0xc1e128=_0x1c0ee5[_0x49e6('0x32')]({'plain':!![]});var _0x2576c1='ChatWebsites';return db[_0x49e6('0x58')][_0x49e6('0x59')]({'where':{'name':_0x2576c1,'userProfileId':_0x108797[_0x49e6('0x5a')]},'raw':!![]})['then'](function(_0x508cac){if(_0x508cac&&_0x508cac[_0x49e6('0x5b')]===0x0){return db[_0x49e6('0x34')]['create']({'name':_0xc1e128[_0x49e6('0x4a')],'resourceId':_0xc1e128['id'],'type':_0x508cac[_0x49e6('0x4a')],'sectionId':_0x508cac['id']},{})[_0x49e6('0x1e')](function(){return _0x1c0ee5;});}else{return _0x1c0ee5;}})[_0x49e6('0x27')](function(_0x160fe6){logger[_0x49e6('0x22')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x160fe6);throw _0x160fe6;});}return _0x1c0ee5;})[_0x49e6('0x1e')](respondWithResult(_0x1618d8,0xc9))['catch'](handleError(_0x1618d8,null));};exports[_0x49e6('0x31')]=function(_0x39d9b,_0x2e2b76){if(_0x39d9b[_0x49e6('0x55')]['id']){delete _0x39d9b['body']['id'];}return db[_0x49e6('0x3a')]['find']({'where':{'id':_0x39d9b[_0x49e6('0x52')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x49e6('0x1e')](handleEntityNotFound(_0x2e2b76,null))[_0x49e6('0x1e')](saveUpdates(_0x39d9b[_0x49e6('0x55')],null))[_0x49e6('0x1e')](respondWithResult(_0x2e2b76,null))['catch'](handleError(_0x2e2b76,null));};exports[_0x49e6('0x35')]=function(_0x1e93aa,_0x1a6aa2){return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x1e93aa[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x1a6aa2,null))['then'](removeEntity(_0x1a6aa2,null))[_0x49e6('0x27')](handleError(_0x1a6aa2,null));};exports[_0x49e6('0x5c')]=function(_0x1bcc3e,_0x4e9de5){return db['ChatWebsite'][_0x49e6('0x5c')]()['then'](respondWithResult(_0x4e9de5,null))['catch'](handleError(_0x4e9de5,null));};exports[_0x49e6('0x5d')]=function(_0x491dfa,_0x50e338,_0x522340){if(_0x491dfa[_0x49e6('0x55')]['id']){delete _0x491dfa['body']['id'];}return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x491dfa['params']['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x50e338,null))[_0x49e6('0x1e')](function(_0x4c18d3){if(_0x4c18d3){_0x491dfa[_0x49e6('0x55')][_0x49e6('0x5e')]=_0x4c18d3['id'];return db[_0x49e6('0x5f')][_0x49e6('0x54')](_0x491dfa[_0x49e6('0x55')]);}})['then'](respondWithResult(_0x50e338,null))[_0x49e6('0x27')](handleError(_0x50e338,null));};exports[_0x49e6('0x60')]=function(_0x117600,_0x6a926b,_0x45de65){var _0x59c388={'raw':![],'where':{}};var _0x23b6aa={};var _0x1577ff={'count':0x0,'rows':[]};return db[_0x49e6('0x3a')]['findOne']({'where':{'id':_0x117600['params']['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x6a926b,null))[_0x49e6('0x1e')](function(_0x960ca4){if(_0x960ca4){_0x23b6aa[_0x49e6('0x3e')]=_['keys'](db[_0x49e6('0x5f')][_0x49e6('0x3b')]);_0x23b6aa[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x117600[_0x49e6('0x3f')]);_0x23b6aa[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x23b6aa[_0x49e6('0x3e')],_0x23b6aa[_0x49e6('0x3f')]);_0x59c388[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x23b6aa[_0x49e6('0x3e')],qs[_0x49e6('0x44')](_0x117600[_0x49e6('0x3f')][_0x49e6('0x44')]));_0x59c388[_0x49e6('0x43')]=_0x59c388[_0x49e6('0x43')]['length']?_0x59c388[_0x49e6('0x43')]:_0x23b6aa['model'];if(!_0x117600['query'][_0x49e6('0x45')](_0x49e6('0x61'))){_0x59c388[_0x49e6('0x2e')]=qs['limit'](_0x117600[_0x49e6('0x3f')][_0x49e6('0x2e')]);_0x59c388['offset']=qs[_0x49e6('0x2d')](_0x117600[_0x49e6('0x3f')]['offset']);}_0x59c388['order']=qs[_0x49e6('0x47')](_0x117600[_0x49e6('0x3f')][_0x49e6('0x47')]);_0x59c388[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0x117600['query'],_0x23b6aa[_0x49e6('0x41')]));_0x59c388[_0x49e6('0x48')][_0x49e6('0x5e')]=_0x960ca4['id'];if(_0x117600[_0x49e6('0x3f')][_0x49e6('0x4b')]){_0x59c388[_0x49e6('0x48')]=_[_0x49e6('0x4c')](_0x59c388[_0x49e6('0x48')],{'$or':_[_0x49e6('0x39')](_0x59c388['attributes'],function(_0x531c8f){var _0x27ddfd={};_0x27ddfd[_0x531c8f]={'$like':'%'+_0x117600[_0x49e6('0x3f')][_0x49e6('0x4b')]+'%'};return _0x27ddfd;})});}_0x59c388=_[_0x49e6('0x4c')]({},_0x59c388,_0x117600['options']);return db[_0x49e6('0x5f')][_0x49e6('0x2c')]({'where':_0x59c388[_0x49e6('0x48')]})[_0x49e6('0x1e')](function(_0x410e83){_0x1577ff[_0x49e6('0x2c')]=_0x410e83;if(_0x117600[_0x49e6('0x3f')][_0x49e6('0x4e')]){_0x59c388[_0x49e6('0x4f')]=[{'all':!![]}];}return db[_0x49e6('0x5f')]['findAll'](_0x59c388);})['then'](function(_0x45f28c){_0x1577ff[_0x49e6('0x51')]=_0x45f28c;return _0x1577ff;});}})[_0x49e6('0x1e')](respondWithFilteredResult(_0x6a926b,_0x59c388))[_0x49e6('0x27')](handleError(_0x6a926b,null));};exports[_0x49e6('0x62')]=function(_0x1f31fa,_0x40644d,_0x1ed335){return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x1f31fa[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x40644d,null))[_0x49e6('0x1e')](function(_0x144792){if(_0x144792){return _0x144792[_0x49e6('0x62')](_0x1f31fa[_0x49e6('0x3f')][_0x49e6('0x63')]);}})[_0x49e6('0x1e')](respondWithStatusCode(_0x40644d,null))[_0x49e6('0x27')](handleError(_0x40644d,null));};exports[_0x49e6('0x64')]=function(_0x416a6d,_0x315d93,_0x12ff84){if(_0x416a6d['body']['id']){delete _0x416a6d[_0x49e6('0x55')]['id'];}return db['ChatWebsite'][_0x49e6('0x59')]({'where':{'id':_0x416a6d['params']['id']}})['then'](handleEntityNotFound(_0x315d93,null))['then'](function(_0x18b431){if(_0x18b431){_0x416a6d[_0x49e6('0x55')]['ChatWebsiteId']=_0x18b431['id'];return db[_0x49e6('0x65')][_0x49e6('0x54')](_0x416a6d[_0x49e6('0x55')]);}})[_0x49e6('0x1e')](respondWithResult(_0x315d93,null))[_0x49e6('0x27')](handleError(_0x315d93,null));};exports['getAnswers']=function(_0x1c13e4,_0x2417cc,_0x4812ea){var _0x65b17f={'raw':![],'where':{}};var _0x48659a={};var _0x59f31f={'count':0x0,'rows':[]};return db[_0x49e6('0x3a')][_0x49e6('0x66')]({'where':{'id':_0x1c13e4[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x2417cc,null))[_0x49e6('0x1e')](function(_0x495f5f){if(_0x495f5f){_0x48659a['model']=_['keys'](db['CannedAnswer'][_0x49e6('0x3b')]);_0x48659a[_0x49e6('0x3f')]=_['keys'](_0x1c13e4[_0x49e6('0x3f')]);_0x48659a[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x48659a['model'],_0x48659a[_0x49e6('0x3f')]);_0x65b17f[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x48659a[_0x49e6('0x3e')],qs['fields'](_0x1c13e4[_0x49e6('0x3f')]['fields']));_0x65b17f['attributes']=_0x65b17f[_0x49e6('0x43')][_0x49e6('0x53')]?_0x65b17f[_0x49e6('0x43')]:_0x48659a[_0x49e6('0x3e')];if(!_0x1c13e4[_0x49e6('0x3f')][_0x49e6('0x45')](_0x49e6('0x61'))){_0x65b17f['limit']=qs[_0x49e6('0x2e')](_0x1c13e4[_0x49e6('0x3f')]['limit']);_0x65b17f['offset']=qs[_0x49e6('0x2d')](_0x1c13e4['query'][_0x49e6('0x2d')]);}_0x65b17f['order']=qs[_0x49e6('0x47')](_0x1c13e4[_0x49e6('0x3f')][_0x49e6('0x47')]);_0x65b17f[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0x1c13e4['query'],_0x48659a[_0x49e6('0x41')]));_0x65b17f[_0x49e6('0x48')][_0x49e6('0x5e')]=_0x495f5f['id'];if(_0x1c13e4[_0x49e6('0x3f')][_0x49e6('0x4b')]){_0x65b17f[_0x49e6('0x48')]=_[_0x49e6('0x4c')](_0x65b17f['where'],{'$or':_['map'](_0x65b17f['attributes'],function(_0x21ab8e){var _0x4560f3={};_0x4560f3[_0x21ab8e]={'$like':'%'+_0x1c13e4['query'][_0x49e6('0x4b')]+'%'};return _0x4560f3;})});}_0x65b17f=_[_0x49e6('0x4c')]({},_0x65b17f,_0x1c13e4['options']);return db['CannedAnswer'][_0x49e6('0x2c')]({'where':_0x65b17f[_0x49e6('0x48')]})[_0x49e6('0x1e')](function(_0x2d6d58){_0x59f31f[_0x49e6('0x2c')]=_0x2d6d58;if(_0x1c13e4[_0x49e6('0x3f')]['includeAll']){_0x65b17f[_0x49e6('0x4f')]=[{'all':!![]}];}return db[_0x49e6('0x65')]['findAll'](_0x65b17f);})[_0x49e6('0x1e')](function(_0x53d2ce){_0x59f31f[_0x49e6('0x51')]=_0x53d2ce;return _0x59f31f;});}})[_0x49e6('0x1e')](respondWithFilteredResult(_0x2417cc,_0x65b17f))[_0x49e6('0x27')](handleError(_0x2417cc,null));};exports[_0x49e6('0x67')]=function(_0x18c0a6,_0xcc5f8d,_0xbc2c02){return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x18c0a6['params']['id']}})['then'](handleEntityNotFound(_0xcc5f8d,null))[_0x49e6('0x1e')](function(_0x3227e5){if(_0x3227e5){return _0x3227e5[_0x49e6('0x67')](_0x18c0a6[_0x49e6('0x3f')]['ids']);}})['then'](respondWithStatusCode(_0xcc5f8d,null))[_0x49e6('0x27')](handleError(_0xcc5f8d,null));};exports[_0x49e6('0x68')]=function(_0x4b3ffc,_0xec004f,_0x27ab16){_0x4b3ffc[_0x49e6('0x55')][_0x49e6('0x69')]=_0x4b3ffc[_0x49e6('0x6a')][_0x49e6('0x6b')];return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x4b3ffc[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0xec004f,null))[_0x49e6('0x1e')](saveUpdates(_0x4b3ffc[_0x49e6('0x55')],null))[_0x49e6('0x1e')](respondWithResult(_0xec004f,null))[_0x49e6('0x27')](handleError(_0xec004f,null));};exports['addAvatar']=function(_0x390e80,_0xf484c4,_0x3bb242){_0x390e80[_0x49e6('0x55')][_0x49e6('0x6c')]=_0x390e80[_0x49e6('0x6a')][_0x49e6('0x6b')];return db['ChatWebsite'][_0x49e6('0x59')]({'where':{'id':_0x390e80[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0xf484c4,null))[_0x49e6('0x1e')](saveUpdates(_0x390e80[_0x49e6('0x55')],null))['then'](respondWithResult(_0xf484c4,null))[_0x49e6('0x27')](handleError(_0xf484c4,null));};exports[_0x49e6('0x6d')]=function(_0x4041ac,_0x1f7ac0,_0x89efe1){_0x4041ac['body'][_0x49e6('0x6e')]=_0x4041ac[_0x49e6('0x6a')]['filename'];return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x4041ac[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x1f7ac0,null))[_0x49e6('0x1e')](saveUpdates(_0x4041ac['body'],null))[_0x49e6('0x1e')](respondWithResult(_0x1f7ac0,null))[_0x49e6('0x27')](handleError(_0x1f7ac0,null));};exports[_0x49e6('0x6f')]=function(_0x2553ce,_0x349c3f,_0x5d5dc9){_0x2553ce['body'][_0x49e6('0x70')]=_0x2553ce[_0x49e6('0x6a')][_0x49e6('0x6b')];return db['ChatWebsite'][_0x49e6('0x59')]({'where':{'id':_0x2553ce['params']['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x349c3f,null))[_0x49e6('0x1e')](saveUpdates(_0x2553ce[_0x49e6('0x55')],null))['then'](respondWithResult(_0x349c3f,null))[_0x49e6('0x27')](handleError(_0x349c3f,null));};exports[_0x49e6('0x71')]=function(_0x548ccc,_0x217ab5,_0x27a360){var _0x2c4e1e=path['join'](config[_0x49e6('0x72')],_0x49e6('0x73'));var _0x176513={'where':{'id':_0x548ccc[_0x49e6('0x52')]['id']},'attributes':['id',_0x49e6('0x69')],'raw':!![]};var _0x440f9a=![];return require('../../config/license/util')[_0x49e6('0x74')]()[_0x49e6('0x1e')](function(_0xc60948){if(_0xc60948){_0x440f9a=_0xc60948[_0x49e6('0x75')];}})[_0x49e6('0x1e')](function(){return db[_0x49e6('0x3a')][_0x49e6('0x59')](_0x176513);})['then'](handleEntityNotFound(_0x217ab5,null))['then'](function(_0x5ce054){if(_0x5ce054){if(!_[_0x49e6('0x76')](_0x5ce054['sitepic'])){if(fs['existsSync'](path[_0x49e6('0x77')](config[_0x49e6('0x72')],'server/files/images/logos/',_0x5ce054['sitepic']))&&_0x440f9a){_0x2c4e1e=path[_0x49e6('0x77')](config[_0x49e6('0x72')],'server/files/images/logos/',_0x5ce054[_0x49e6('0x69')]);}}return _0x217ab5['download'](_0x2c4e1e);}})[_0x49e6('0x27')](handleError(_0x217ab5,null));};exports['getAvatar']=function(_0x3272de,_0x479901,_0xee68c2){var _0x597e66=path[_0x49e6('0x77')](config[_0x49e6('0x72')],_0x49e6('0x78'));var _0x222d4e={'where':{'id':_0x3272de[_0x49e6('0x52')]['id']},'attributes':['id',_0x49e6('0x6c')],'raw':!![]};return db['ChatWebsite'][_0x49e6('0x59')](_0x222d4e)['then'](handleEntityNotFound(_0x479901,null))[_0x49e6('0x1e')](function(_0x3cdde2){if(_0x3cdde2){if(!_[_0x49e6('0x76')](_0x3cdde2['agentAvatar'])){if(fs[_0x49e6('0x79')](path[_0x49e6('0x77')](config['root'],_0x49e6('0x7a'),_0x3cdde2[_0x49e6('0x6c')]))){_0x597e66=path[_0x49e6('0x77')](config['root'],_0x49e6('0x7a'),_0x3cdde2[_0x49e6('0x6c')]);}}return _0x479901['download'](_0x597e66);}})[_0x49e6('0x27')](handleError(_0x479901,null));};exports['getCustomerAvatar']=function(_0x42636d,_0x14e9b0,_0x4333ae){var _0x5d42fb=path[_0x49e6('0x77')](config[_0x49e6('0x72')],_0x49e6('0x7b'));var _0x3ea9bc={'where':{'id':_0x42636d[_0x49e6('0x52')]['id']},'attributes':['id',_0x49e6('0x6e'),_0x49e6('0x7c')],'raw':!![]};return db['ChatWebsite'][_0x49e6('0x59')](_0x3ea9bc)['then'](handleEntityNotFound(_0x14e9b0,null))[_0x49e6('0x1e')](function(_0x383cca){if(_0x383cca){if(!_['isNil'](_0x383cca[_0x49e6('0x6e')])){if(fs[_0x49e6('0x79')](path['join'](config['root'],_0x49e6('0x7a'),_0x383cca['customerAvatar']))&&_0x383cca[_0x49e6('0x7c')]){_0x5d42fb=path['join'](config[_0x49e6('0x72')],'server/files/images/avatars/',_0x383cca[_0x49e6('0x6e')]);}}return _0x14e9b0[_0x49e6('0x7d')](_0x5d42fb);}})['catch'](handleError(_0x14e9b0,null));};exports[_0x49e6('0x7e')]=function(_0x2ae32f,_0xc1dc99,_0x1aef4d){var _0x25b7ae=path[_0x49e6('0x77')](config[_0x49e6('0x72')],'server/files/images/avatars/system_avatar.png');var _0x2150a7={'where':{'id':_0x2ae32f[_0x49e6('0x52')]['id']},'attributes':['id',_0x49e6('0x70')],'raw':!![]};return db[_0x49e6('0x3a')][_0x49e6('0x59')](_0x2150a7)[_0x49e6('0x1e')](handleEntityNotFound(_0xc1dc99,null))[_0x49e6('0x1e')](function(_0x8a2605){if(_0x8a2605){if(!_[_0x49e6('0x76')](_0x8a2605['systemAvatar'])){if(fs[_0x49e6('0x79')](path[_0x49e6('0x77')](config[_0x49e6('0x72')],_0x49e6('0x7a'),_0x8a2605[_0x49e6('0x70')]))){_0x25b7ae=path[_0x49e6('0x77')](config[_0x49e6('0x72')],'server/files/images/avatars/',_0x8a2605[_0x49e6('0x70')]);}}return _0xc1dc99[_0x49e6('0x7d')](_0x25b7ae);}})[_0x49e6('0x27')](handleError(_0xc1dc99,null));};exports['notify']=function(_0x3f2044,_0x226d4c,_0x57827b){var _0x363fd1=require('user-agent-parser');var _0x223060=new _0x363fd1();var _0x3cdd22=_0x223060[_0x49e6('0x7f')](_0x3f2044[_0x49e6('0x80')][_0x49e6('0x81')])[_0x49e6('0x82')]();var _0x89da9={'body':_0x3f2044[_0x49e6('0x55')],'channel':_0x49e6('0x83')};var _0x502289=[];var _0xf1ada1=[];var _0x5af331={};var _0x3fa8ad=![];return db[_0x49e6('0x84')]['describe']()['then'](function(_0x4974e0){if(!_0x4974e0){throw new db['Sequelize'][(_0x49e6('0x85'))](_0x49e6('0x86'));}_0x502289=_[_0x49e6('0x87')](_[_0x49e6('0x40')](_0x4974e0),[_0x49e6('0x88'),_0x49e6('0x89')]);_0xf1ada1=_[_0x49e6('0x87')](_[_0x49e6('0x40')](_0x4974e0),[_0x49e6('0x88'),_0x49e6('0x89'),_0x49e6('0x8a'),'ListId']);if(_0x3f2044['body']['id']){delete _0x3f2044['body']['id'];}if(_[_0x49e6('0x76')](_0x3f2044[_0x49e6('0x55')]['from'])){throw new db['Sequelize'][(_0x49e6('0x85'))](_0x49e6('0x8b'));}if(_[_0x49e6('0x76')](_0x3f2044[_0x49e6('0x55')]['body'])||_0x3f2044[_0x49e6('0x55')][_0x49e6('0x55')]===''){throw new db[(_0x49e6('0x1c'))][(_0x49e6('0x85'))](_0x49e6('0x8c'));}if(_[_0x49e6('0x76')](_0x3f2044[_0x49e6('0x55')][_0x49e6('0x8d')])){throw new db['Sequelize'][(_0x49e6('0x85'))](_0x49e6('0x8e')+_0xf1ada1);}if(!_[_0x49e6('0x8f')](_0xf1ada1,_0x3f2044[_0x49e6('0x55')][_0x49e6('0x8d')])){throw new db[(_0x49e6('0x1c'))][(_0x49e6('0x85'))](_0x49e6('0x90')+_0xf1ada1);}_0x5af331[_0x3f2044['body'][_0x49e6('0x8d')]]=_0x3f2044[_0x49e6('0x55')][_0x49e6('0x91')];})[_0x49e6('0x1e')](function(){return db[_0x49e6('0x3a')]['find']({'where':{'id':_0x3f2044['params']['id']},'include':[{'model':db[_0x49e6('0x92')],'as':_0x49e6('0x93'),'include':[{'model':db['CmContact'],'as':_0x49e6('0x94'),'where':_0x5af331,'limit':0x1,'order':[[_0x49e6('0x89'),_0x49e6('0x95')]]}]},{'model':db[_0x49e6('0x96')],'as':_0x49e6('0x97')}]});})['then'](handleEntityNotFound(_0x226d4c,null))['then'](function(_0x2b94dc){if(_0x2b94dc&&_0x2b94dc[_0x49e6('0x93')]){_0x89da9[_0x49e6('0x98')]=_0x2b94dc;_0x89da9[_0x49e6('0x99')]=_0x2b94dc[_0x49e6('0x97')];_0x89da9['list']=_0x2b94dc['List'];_0x89da9['applications']=_[_0x49e6('0x9a')](_0x89da9[_0x49e6('0x99')],[_0x49e6('0x9b')],[_0x49e6('0x9c')]);if(_0x89da9[_0x49e6('0x98')][_0x49e6('0x97')]){delete _0x89da9[_0x49e6('0x98')]['Applications'];}if(_0x89da9[_0x49e6('0x98')]['List']&&_0x89da9[_0x49e6('0x98')][_0x49e6('0x93')]['Contacts']['length']){return _0x89da9[_0x49e6('0x98')][_0x49e6('0x93')][_0x49e6('0x94')][0x0];}var _0x2b0718=_[_0x49e6('0x17')](_0x3f2044[_0x49e6('0x55')],{'firstName':_0x3f2044[_0x49e6('0x55')][_0x49e6('0x91')],'ListId':_0x2b94dc[_0x49e6('0x9d')]});_0x2b0718[_0x3f2044[_0x49e6('0x55')][_0x49e6('0x8d')]]=_0x3f2044[_0x49e6('0x55')]['from'];return db[_0x49e6('0x84')][_0x49e6('0x54')](_0x2b0718,{'fields':_0x502289,'raw':!![]});}})[_0x49e6('0x1e')](handleEntityNotFound(_0x226d4c,null))[_0x49e6('0x1e')](function(_0x517dd5){_0x89da9[_0x49e6('0x9e')]=_0x517dd5;var _0x4ad156=_0x3f2044[_0x49e6('0x55')][_0x49e6('0x9f')];if(_0x3f2044[_0x49e6('0x80')][_0x49e6('0xa0')]){_0x4ad156=_0x3f2044[_0x49e6('0x80')][_0x49e6('0xa0')];}else if(_0x3f2044['headers'][_0x49e6('0xa1')]){_0x4ad156=_[_0x49e6('0xa2')](_0x3f2044[_0x49e6('0x80')][_0x49e6('0xa1')][_0x49e6('0xa3')](','));}if(_0x517dd5){var _0xa818d0={'ContactId':_0x517dd5['id'],'ChatWebsiteId':_0x3f2044[_0x49e6('0x52')]['id'],'from':(_0x517dd5['firstName']||'')+'\x20'+(_0x517dd5['lastName']||''),'customerIp':_0x4ad156,'customerPort':_0x3f2044[_0x49e6('0x80')]['x-real-port']?_0x3f2044[_0x49e6('0x80')][_0x49e6('0xa4')]:null,'referer':_0x3f2044['body'][_0x49e6('0xa5')],'browserName':_0x3cdd22[_0x49e6('0xa6')][_0x49e6('0x4a')]&&_0x3cdd22[_0x49e6('0xa6')][_0x49e6('0xa7')]?util[_0x49e6('0xa8')](_0x49e6('0xa9'),_0x3cdd22[_0x49e6('0xa6')][_0x49e6('0x4a')],_0x3cdd22[_0x49e6('0xa6')][_0x49e6('0xa7')]):'unknown','browserVersion':_0x3cdd22[_0x49e6('0xa6')][_0x49e6('0xa7')]||_0x49e6('0xaa'),'osName':util[_0x49e6('0xa8')](_0x49e6('0xa9'),_0x3cdd22['os'][_0x49e6('0x4a')],_0x3cdd22['os'][_0x49e6('0xa7')]),'osVersion':_0x3cdd22['os'][_0x49e6('0xa7')],'deviceModel':_0x3cdd22[_0x49e6('0xab')][_0x49e6('0x3e')]&&_0x3cdd22['device']['vendor']?util[_0x49e6('0xa8')]('%s\x20%s\x20%s',_0x3cdd22[_0x49e6('0xab')][_0x49e6('0x3e')],_0x3cdd22['device']['vendor'],_0x3cdd22[_0x49e6('0xab')]['type']):null,'deviceVendor':_0x3cdd22[_0x49e6('0xab')][_0x49e6('0xac')],'deviceType':_0x3cdd22[_0x49e6('0xab')][_0x49e6('0x3c')],'formData':JSON['stringify'](_0x3f2044[_0x49e6('0x55')])};var _0x1f3ab8={'ChatWebsiteId':_0x3f2044[_0x49e6('0x52')]['id'],'closed':![]};if(_0x3f2044[_0x49e6('0x55')]['threadId']){_0x1f3ab8[_0x49e6('0xad')]=_0x3f2044[_0x49e6('0x55')][_0x49e6('0xad')];return db['ChatInteraction']['find']({'where':_0x1f3ab8})[_0x49e6('0x1e')](function(_0x497f33){if(_0x497f33){return[_0x497f33,![]];}_0xa818d0[_0x49e6('0xad')]=_0x3f2044[_0x49e6('0x55')]['threadId'];_0xa818d0[_0x49e6('0xae')]=_0x3f2044[_0x49e6('0x55')][_0x49e6('0xae')];return db['ChatInteraction'][_0x49e6('0x54')](_0xa818d0)[_0x49e6('0x1e')](function(_0x185e20){return[_0x185e20,!![]];});});}_0x1f3ab8['ContactId']=_0x517dd5['id'];if(_0x3f2044[_0x49e6('0x55')]['interaction']&&_0x3f2044[_0x49e6('0x55')][_0x49e6('0xaf')]['id']){_0x1f3ab8['id']=_0x3f2044[_0x49e6('0x55')]['interaction']['id'];return db[_0x49e6('0xb0')][_0x49e6('0x59')]({'where':_0x1f3ab8})[_0x49e6('0x1e')](function(_0x4956af){if(_0x4956af){return[_0x4956af,![]];}return db[_0x49e6('0xb0')][_0x49e6('0x54')](_0xa818d0)[_0x49e6('0x1e')](function(_0x21cd42){return[_0x21cd42,!![]];});});}return db['ChatInteraction'][_0x49e6('0x54')](_0xa818d0)[_0x49e6('0x1e')](function(_0x484291){return[_0x484291,!![]];});}})[_0x49e6('0xb1')](function(_0x621e86,_0x1ca349){if(_0x621e86){_0x3fa8ad=_0x1ca349;if(!_0x1ca349){var _0x2e4acd={'from':(_0x89da9[_0x49e6('0x9e')][_0x49e6('0xb2')]||'')+'\x20'+(_0x89da9[_0x49e6('0x9e')]['lastName']||'')};if(_0x3f2044[_0x49e6('0x55')][_0x49e6('0xad')]&&_0x3f2044[_0x49e6('0x55')][_0x49e6('0xb3')]&&_0x3f2044[_0x49e6('0x55')]['threadId']!=_0x3f2044['body']['messageId']){_0x2e4acd[_0x49e6('0xad')]=_0x3f2044[_0x49e6('0x55')][_0x49e6('0xb3')];}return _0x621e86[_0x49e6('0x31')](_0x2e4acd);}else{return _0x621e86;}}})[_0x49e6('0x1e')](function(_0xb85c4b){_0x89da9[_0x49e6('0xaf')]=_0xb85c4b['get']({'plain':!![]});_0x89da9[_0x49e6('0xaf')][_0x49e6('0xb4')]=_0x3fa8ad;if(_0x89da9['interaction'][_0x49e6('0xb4')]){if(_0x89da9['account'][_0x49e6('0xb5')]){_0x89da9[_0x49e6('0x99')][_0x49e6('0xb6')]({'id':0x0,'priority':_0x89da9['applications'][_0x49e6('0x53')]+0x1,'app':_0x49e6('0xb7'),'appdata':_0x49e6('0xb8'),'interval':_0x49e6('0xb9')});}}return db[_0x49e6('0xba')][_0x49e6('0x54')]({'body':_0x3f2044[_0x49e6('0x55')][_0x49e6('0x55')],'ChatWebsiteId':_0x3f2044[_0x49e6('0x52')]['id'],'ChatInteractionId':_0xb85c4b['id'],'direction':'in','ContactId':_0x89da9[_0x49e6('0x9e')]['id'],'AttachmentId':_0x3f2044['body'][_0x49e6('0xbb')]});})[_0x49e6('0x1e')](function(_0x1bd7f5){_0x89da9[_0x49e6('0x25')]=_0x1bd7f5;if(_0x89da9['interaction']['UserId']){return db['User'][_0x49e6('0x59')]({'attributes':['id',_0x49e6('0x4a')],'where':{'id':_0x89da9[_0x49e6('0xaf')]['UserId']}})[_0x49e6('0x1e')](function(_0x283088){if(_0x283088){_0x89da9[_0x49e6('0x99')][_0x49e6('0xbc')]({'id':0x0,'priority':0x0,'app':_0x49e6('0xbd'),'appdata':_0x283088['name']+','+(_0x89da9[_0x49e6('0x98')][_0x49e6('0xbe')]||0xa),'interval':_0x49e6('0xb9')});_0x89da9['forcedOwnership']=!![];}return respondWithRpcPromise(_0x49e6('0xbf'),_0x49e6('0xc0'),_0x89da9);});}return respondWithRpcPromise(_0x49e6('0xbf'),'startRouting',_0x89da9);})[_0x49e6('0x1e')](function(_0x55137b){respondWithRpcPromise('EventManager','EventManager',{'event':'notify','message':_0x55137b},client9002);return _0x55137b;})[_0x49e6('0x1e')](respondWithResult(_0x226d4c,null))['catch'](handleError(_0x226d4c,null));};exports['offline']=function(_0x107a27,_0x54c370,_0x478768){var _0x1aa318,_0x405f45,_0x1e0388;var _0x399cd8=[];var _0x12e88f=[];var _0x2f09f1={};return db['CmContact'][_0x49e6('0x5c')]()[_0x49e6('0x1e')](function(_0x46787a){if(!_0x46787a){throw new db[(_0x49e6('0x1c'))]['ValidationError']('no\x20available\x20attributes');}_0x12e88f=_[_0x49e6('0x87')](_['keys'](_0x46787a),[_0x49e6('0x88'),_0x49e6('0x89')]);_0x399cd8=_['difference'](_[_0x49e6('0x40')](_0x46787a),['createdAt',_0x49e6('0x89'),_0x49e6('0x8a'),_0x49e6('0x9d')]);if(_0x107a27[_0x49e6('0x55')]['id']){delete _0x107a27[_0x49e6('0x55')]['id'];}if(_[_0x49e6('0x76')](_0x107a27[_0x49e6('0x55')][_0x49e6('0x91')])){throw _0x54c370[_0x49e6('0x2a')](0x1f4)[_0x49e6('0x36')](new db[(_0x49e6('0x1c'))][(_0x49e6('0x85'))](_0x49e6('0x8b')));}if(_['isNil'](_0x107a27['body']['body'])||_0x107a27[_0x49e6('0x55')][_0x49e6('0x55')]===''){throw _0x54c370['status'](0x1f4)[_0x49e6('0x36')](new db['Sequelize'][(_0x49e6('0x85'))](_0x49e6('0x8c')));}if(_[_0x49e6('0x76')](_0x107a27[_0x49e6('0x55')][_0x49e6('0xc1')])){throw _0x54c370[_0x49e6('0x2a')](0x1f4)[_0x49e6('0x36')](new db[(_0x49e6('0x1c'))][(_0x49e6('0x85'))](_0x49e6('0xc2')+_0x399cd8));}if(!_[_0x49e6('0x8f')](_0x399cd8,_0x107a27[_0x49e6('0x55')][_0x49e6('0xc1')])){throw _0x54c370[_0x49e6('0x2a')](0x1f4)[_0x49e6('0x36')](new db[(_0x49e6('0x1c'))][(_0x49e6('0x85'))](_0x49e6('0xc3')+_0x399cd8));}_0x2f09f1[_0x107a27[_0x49e6('0x55')][_0x49e6('0xc1')]]=_0x107a27[_0x49e6('0x55')][_0x49e6('0x91')];})[_0x49e6('0x1e')](function(){return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'where':{'id':_0x107a27['params']['id']},'include':[{'model':db[_0x49e6('0x92')],'as':_0x49e6('0x93')}]});})['then'](handleEntityNotFound(_0x54c370,null))[_0x49e6('0x1e')](function(_0x319133){if(_0x319133&&_0x319133[_0x49e6('0x93')]){_0x405f45=_0x319133;var _0xe9a05=_[_0x49e6('0x17')](_0x107a27['body'],{'firstName':_0x107a27['body'][_0x49e6('0x91')],'phone':_0x107a27[_0x49e6('0x55')][_0x49e6('0x91')],'ListId':_0x319133[_0x49e6('0x9d')]});_0xe9a05[_0x107a27['body'][_0x49e6('0xc1')]]=_0x107a27[_0x49e6('0x55')][_0x49e6('0x91')];return db[_0x49e6('0x84')]['findOrCreate']({'where':_0x2f09f1,'defaults':_0xe9a05});}})[_0x49e6('0xb1')](function(_0x2d680d){if(_0x2d680d){_0x1e0388=_0x2d680d;var _0x77c31c=fs[_0x49e6('0xc4')](path['join'](config[_0x49e6('0x72')],_0x49e6('0xc5')),_0x49e6('0xc6'));var _0x2ea7e1=ejs[_0x49e6('0xc7')](_0x77c31c,{'body':_[_0x49e6('0xc8')](_0x107a27[_0x49e6('0x55')][_0x49e6('0x55')]),'bodyTitle':_0x405f45[_0x49e6('0xc9')]});return db[_0x49e6('0xca')][_0x49e6('0x54')]({'body':_0x2ea7e1,'ContactId':_0x2d680d['id'],'ChatWebsiteId':_0x405f45['id']});}})[_0x49e6('0x1e')](function(_0x19f745){if(_0x19f745){_0x1aa318=_0x19f745;return db['MailAccount'][_0x49e6('0x66')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0x49e6('0xcb'),'raw':!![]}]});}})[_0x49e6('0x1e')](function(_0x43b885){if(_0x43b885&&_0x43b885[_0x49e6('0xcb')]&&_0x405f45[_0x49e6('0xcc')]){var _0x42ded1={'tls':{'rejectUnauthorized':![]}};if(_0x43b885[_0x49e6('0xcb')][_0x49e6('0xcd')]){_0x42ded1[_0x49e6('0xcd')]=_0x43b885[_0x49e6('0xcb')][_0x49e6('0xcd')];}else{_0x42ded1[_0x49e6('0xce')]=_0x43b885[_0x49e6('0xcb')][_0x49e6('0xce')];_0x42ded1[_0x49e6('0xcf')]=_0x43b885['Smtp'][_0x49e6('0xcf')];_0x42ded1[_0x49e6('0xd0')]=_0x43b885[_0x49e6('0xcb')]['secure'];}if(_0x43b885[_0x49e6('0xcb')][_0x49e6('0xd1')]){_0x42ded1['auth']={'user':_0x43b885[_0x49e6('0xcb')][_0x49e6('0x56')],'pass':_0x43b885[_0x49e6('0xcb')][_0x49e6('0xd2')]};}return respondWithRpcPromise('SendMail',_0x49e6('0xd3'),{'account':_0x42ded1,'message':{'from':util[_0x49e6('0xa8')](_0x49e6('0xd4'),_0x43b885[_0x49e6('0x4a')],_0x43b885[_0x49e6('0xd5')]||_0x43b885['Smtp'][_0x49e6('0x56')]),'to':_0x405f45['forwardOfflineAddress'],'subject':_0x405f45[_0x49e6('0xd6')],'text':_0x1aa318[_0x49e6('0x55')]}},client9003)[_0x49e6('0x1e')](function(){return _0x1aa318;})['catch'](function(_0x408672){console['error'](_0x408672);});}})[_0x49e6('0x1e')](function(){if(_0x1aa318){return _0x1aa318;}})[_0x49e6('0x1e')](respondWithResult(_0x54c370,null))['catch'](handleError(_0x54c370,null));};exports[_0x49e6('0xd7')]=function(_0xcc0f69,_0xeef680,_0x2075ed){return db[_0x49e6('0xb0')][_0x49e6('0x59')]({'where':{'id':_0xcc0f69[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0xeef680,null))['then'](function(_0x1ed280){if(_0x1ed280){return _0x1ed280['addInteraction'](_0xcc0f69[_0x49e6('0x55')][_0x49e6('0x63')],_[_0x49e6('0xd8')](_0xcc0f69[_0x49e6('0x55')],[_0x49e6('0x63'),'id'])||{});}})[_0x49e6('0x1e')](respondWithResult(_0xeef680,null))[_0x49e6('0x27')](handleError(_0xeef680,null));};exports[_0x49e6('0xd9')]=function(_0x2d3f91,_0x4e9748,_0x5d855f){var _0x34de19={'raw':![],'where':{}};var _0x1829f3={};var _0x64f944={'count':0x0,'rows':[]};return db[_0x49e6('0x3a')][_0x49e6('0x66')]({'where':{'id':_0x2d3f91[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x4e9748,null))[_0x49e6('0x1e')](function(_0x262730){if(_0x262730){_0x1829f3[_0x49e6('0x3e')]=_['keys'](db['ChatInteraction'][_0x49e6('0x3b')]);_0x1829f3[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x2d3f91[_0x49e6('0x3f')]);_0x1829f3[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x1829f3[_0x49e6('0x3e')],_0x1829f3[_0x49e6('0x3f')]);_0x34de19['attributes']=_[_0x49e6('0x42')](_0x1829f3[_0x49e6('0x3e')],qs['fields'](_0x2d3f91[_0x49e6('0x3f')]['fields']));_0x34de19[_0x49e6('0x43')]=_0x34de19[_0x49e6('0x43')][_0x49e6('0x53')]?_0x34de19[_0x49e6('0x43')]:_0x1829f3[_0x49e6('0x3e')];if(!_0x2d3f91['query'][_0x49e6('0x45')]('nolimit')){_0x34de19[_0x49e6('0x2e')]=qs[_0x49e6('0x2e')](_0x2d3f91[_0x49e6('0x3f')][_0x49e6('0x2e')]);_0x34de19[_0x49e6('0x2d')]=qs[_0x49e6('0x2d')](_0x2d3f91[_0x49e6('0x3f')]['offset']);}_0x34de19[_0x49e6('0x46')]=qs[_0x49e6('0x47')](_0x2d3f91['query'][_0x49e6('0x47')]);_0x34de19[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0x2d3f91['query'],_0x1829f3[_0x49e6('0x41')]));_0x34de19[_0x49e6('0x48')][_0x49e6('0x5e')]=_0x262730['id'];if(_0x2d3f91['query']['filter']){_0x34de19[_0x49e6('0x48')]=_[_0x49e6('0x4c')](_0x34de19[_0x49e6('0x48')],{'$or':_[_0x49e6('0x39')](_0x34de19['attributes'],function(_0x44d257){var _0x41153e={};_0x41153e[_0x44d257]={'$like':'%'+_0x2d3f91['query'][_0x49e6('0x4b')]+'%'};return _0x41153e;})});}_0x34de19=_[_0x49e6('0x4c')]({},_0x34de19,_0x2d3f91[_0x49e6('0x4d')]);return db['ChatInteraction'][_0x49e6('0x2c')]({'where':_0x34de19['where']})[_0x49e6('0x1e')](function(_0x5c37b4){_0x64f944[_0x49e6('0x2c')]=_0x5c37b4;if(_0x2d3f91['query'][_0x49e6('0x4e')]){_0x34de19[_0x49e6('0x4f')]=[{'model':db[_0x49e6('0x84')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x49e6('0xda'),'attributes':[_0x49e6('0x4a'),_0x49e6('0xdb'),_0x49e6('0xdc')],'required':![]},{'model':db[_0x49e6('0xdd')],'as':'Tags','attributes':['id',_0x49e6('0x4a'),_0x49e6('0xde')],'where':_0x2d3f91[_0x49e6('0x3f')][_0x49e6('0xdf')]?{'id':_0x2d3f91[_0x49e6('0x3f')]['tag']}:undefined,'required':_0x2d3f91[_0x49e6('0x3f')][_0x49e6('0xdf')]?!![]:![]}];}return db[_0x49e6('0xb0')][_0x49e6('0x50')](_0x34de19);})[_0x49e6('0x1e')](function(_0x3478f9){_0x64f944['rows']=_0x3478f9;return _0x64f944;});}})[_0x49e6('0x1e')](respondWithFilteredResult(_0x4e9748,_0x34de19))['catch'](handleError(_0x4e9748,null));};function iftimePromise(_0x1aef30,_0x4eb4a7){return respondWithRpcPromise('Command',_0x49e6('0xe0'),{'command':_0x4eb4a7['timezone']?util[_0x49e6('0xa8')]('iftime\x20%s,%s',_0x1aef30[_0x49e6('0xe1')],_0x4eb4a7['timezone']):util[_0x49e6('0xa8')](_0x49e6('0xe2'),_0x1aef30[_0x49e6('0xe1')])},client9002)['then'](function(_0x1b7ffc){var _0x334399=_0x1b7ffc&&_0x1b7ffc['indexOf'](_0x49e6('0xe3'))>=0x0?!![]:![];logger[_0x49e6('0x26')](_0x49e6('0xe4'),_0x4eb4a7['id'],_0x1aef30['id'],_0x1aef30[_0x49e6('0xe1')],_0x334399?_0x49e6('0xe5'):'OFFLINE',_0x4eb4a7[_0x49e6('0xe6')]?_0x4eb4a7[_0x49e6('0xe6')]:_0x49e6('0xe7'));return _0x334399;})[_0x49e6('0x27')](function(_0x4d063d){logger[_0x49e6('0x22')](_0x49e6('0xe4'),_0x4eb4a7['id'],_0x1aef30['id'],_0x1aef30['interval'],util[_0x49e6('0xe8')](_0x4d063d,{'showHidden':![],'depth':null}),_0x4eb4a7['timezone']?_0x4eb4a7[_0x49e6('0xe6')]:_0x49e6('0xe7'));return![];});}exports[_0x49e6('0xe0')]=function(_0x4ba0ae,_0x52ae14,_0x399898){var _0x265de3=0x0;var _0x54afb4=0x0;var _0x31ec24=![];var _0x4ba9e1;var _0x17754e;return db[_0x49e6('0x3a')]['find']({'where':{'id':_0x4ba0ae[_0x49e6('0x52')]['id']},'include':[{'model':db[_0x49e6('0xe9')],'as':_0x49e6('0xe9'),'include':[{'model':db[_0x49e6('0xe9')],'as':'Intervals','attributes':['id',_0x49e6('0xe1')],'raw':!![]}]}]})[_0x49e6('0x1e')](handleEntityNotFound(_0x52ae14,null))[_0x49e6('0x1e')](function(_0x513a49){if(_0x513a49){_0x4ba9e1=_0x513a49;return _0x513a49['getProactiveActions']({'raw':!![]});}})[_0x49e6('0x1e')](function(_0x22ed0b){if(_0x4ba9e1){if(_0x22ed0b){_0x17754e=_0x22ed0b;}}return require('../../config/license/util')['getLicense']();})[_0x49e6('0x1e')](function(_0xdb5b84){if(_0xdb5b84){_0x54afb4=_0xdb5b84[_0x49e6('0xea')];_0x31ec24=_0xdb5b84[_0x49e6('0x75')];}})['then'](function(){return db[_0x49e6('0xb0')]['count']({'where':{'closed':![]}});})['then'](function(_0x3d4956){_0x265de3=_0x3d4956;if(_0x54afb4&&_0x3d4956>_0x54afb4){return db['License']['findOne']({'where':{'id':0x1}})['then'](function(_0x11c296){if(_0x11c296){_0x11c296[_0x49e6('0xeb')]('chatLicenseExceeded');}});}})[_0x49e6('0x1e')](function(){if(_0x4ba9e1[_0x49e6('0xe9')]&&_0x4ba9e1[_0x49e6('0xe9')][_0x49e6('0xec')]){var _0x3896b5=[];for(var _0xd0795e=0x0;_0xd0795e<_0x4ba9e1[_0x49e6('0xe9')][_0x49e6('0xec')]['length'];_0xd0795e++){var _0x20aedf=_0x4ba9e1[_0x49e6('0xe9')]['Intervals'][_0xd0795e]['get']({'plain':!![]});_0x3896b5['push'](iftimePromise(_0x20aedf,_0x4ba9e1));}return BPromise[_0x49e6('0xed')](_0x3896b5)[_0x49e6('0x1e')](function(_0x47d2dc){return _[_0x49e6('0xee')](_0x47d2dc);});}else{return!![];}})[_0x49e6('0x1e')](function(_0x1f9f9e){var _0x4a1bfb=fs[_0x49e6('0xc4')](path[_0x49e6('0x77')](config[_0x49e6('0x72')],_0x49e6('0xef')),_0x49e6('0xc6'));var _0x43e9f8={'remote':_0x4ba9e1['remote'],'query':querystring[_0x49e6('0xf0')](_[_0x49e6('0x4c')](_0x4ba9e1[_0x49e6('0x32')]({'plain':!![]}),{'customerIp':_0x4ba0ae[_0x49e6('0x80')]['x-forwarded-for']||_0x4ba0ae[_0x49e6('0x80')]['x-real-ip']||_0x4ba0ae[_0x49e6('0xf1')]['remoteAddress']||_0x4ba0ae['ip'],'referer':_0x4ba0ae[_0x49e6('0x80')][_0x49e6('0xa5')],'openedInteractions':_0x265de3,'maxInteractions':_0x54afb4,'virtual':_0x31ec24[_0x49e6('0xea')],'online':_0x1f9f9e,'custom':_0x31ec24}))['replace'](/'/g,'\x5c\x27')};_0x52ae14[_0x49e6('0x36')](ejs['render'](Mustache['render'](_0x4a1bfb,_0x43e9f8),{'proactiveActions':_0x17754e,'alignment':_0x4ba9e1['alignment'],'verticalAlignment':_0x4ba9e1[_0x49e6('0xf2')],'div_color':_0x4ba9e1[_0x49e6('0xde')],'text_color':_0x4ba9e1[_0x49e6('0xf3')]}));})[_0x49e6('0x27')](handleError(_0x52ae14,null));};exports[_0x49e6('0xf4')]=function(_0x2351f0,_0x5cc12d,_0x55a136){return db[_0x49e6('0x3a')]['findOne']({'where':{'id':_0x2351f0['params']['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x5cc12d,null))[_0x49e6('0x1e')](function(_0x3f7f4f){if(_0x3f7f4f){return db[_0x49e6('0xf5')][_0x49e6('0xf6')](function(_0x194ba5){return db[_0x49e6('0x96')][_0x49e6('0x35')]({'where':{'ChatWebsiteId':_0x2351f0[_0x49e6('0x52')]['id']},'transaction':_0x194ba5})['then'](function(_0x40523c){var _0x16b52c=_[_0x49e6('0x39')](_0x2351f0[_0x49e6('0x55')],function(_0x287ab3){_0x287ab3[_0x49e6('0x5e')]=_0x2351f0[_0x49e6('0x52')]['id'];return _0x287ab3;});return db[_0x49e6('0x96')][_0x49e6('0xf7')](_0x16b52c,{'transaction':_0x194ba5});});})[_0x49e6('0x1e')](function(){return db['ChatApplication']['findAndCountAll']({'where':{'ChatWebsiteId':_0x2351f0[_0x49e6('0x52')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x5cc12d,null))[_0x49e6('0x27')](handleError(_0x5cc12d,null));};exports[_0x49e6('0xf8')]=function(_0x14416b,_0x4743a3,_0x4188a6){var _0x89ccd6={};var _0x1de182={};var _0x5dc191;var _0x576d01;return db[_0x49e6('0x3a')][_0x49e6('0x66')]({'where':{'id':_0x14416b[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x4743a3,null))[_0x49e6('0x1e')](function(_0x42e596){if(_0x42e596){_0x5dc191=_0x42e596;_0x1de182[_0x49e6('0x3e')]=_[_0x49e6('0x40')](db['ChatApplication'][_0x49e6('0x3b')]);_0x1de182[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x14416b[_0x49e6('0x3f')]);_0x1de182[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x1de182['model'],_0x1de182['query']);_0x89ccd6[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x1de182['model'],qs[_0x49e6('0x44')](_0x14416b[_0x49e6('0x3f')]['fields']));_0x89ccd6[_0x49e6('0x43')]=_0x89ccd6[_0x49e6('0x43')][_0x49e6('0x53')]?_0x89ccd6[_0x49e6('0x43')]:_0x1de182['model'];_0x89ccd6[_0x49e6('0x46')]=qs[_0x49e6('0x47')](_0x14416b[_0x49e6('0x3f')]['sort']);_0x89ccd6[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0x14416b['query'],_0x1de182[_0x49e6('0x41')]));if(_0x14416b[_0x49e6('0x3f')][_0x49e6('0x4b')]){_0x89ccd6[_0x49e6('0x48')]=_['merge'](_0x89ccd6['where'],{'$or':_[_0x49e6('0x39')](_0x89ccd6[_0x49e6('0x43')],function(_0x3f9ba2){var _0x50d52e={};_0x50d52e[_0x3f9ba2]={'$like':'%'+_0x14416b[_0x49e6('0x3f')][_0x49e6('0x4b')]+'%'};return _0x50d52e;})});}_0x89ccd6=_[_0x49e6('0x4c')]({},_0x89ccd6,_0x14416b[_0x49e6('0x4d')]);return _0x5dc191['getApplications'](_0x89ccd6);}})[_0x49e6('0x1e')](function(_0x1ebba1){if(_0x1ebba1){_0x576d01=_0x1ebba1[_0x49e6('0x53')];if(!_0x14416b[_0x49e6('0x3f')][_0x49e6('0x45')](_0x49e6('0x61'))){_0x89ccd6[_0x49e6('0x2e')]=qs[_0x49e6('0x2e')](_0x14416b[_0x49e6('0x3f')]['limit']);_0x89ccd6[_0x49e6('0x2d')]=qs[_0x49e6('0x2d')](_0x14416b['query'][_0x49e6('0x2d')]);}return _0x5dc191['getApplications'](_0x89ccd6);}})['then'](function(_0x59b19e){if(_0x59b19e){return _0x59b19e?{'count':_0x576d01,'rows':_0x59b19e}:null;}})[_0x49e6('0x1e')](respondWithResult(_0x4743a3,null))[_0x49e6('0x27')](handleError(_0x4743a3,null));};exports['addProactiveActions']=function(_0x2fd922,_0x147336,_0x17c657){return db[_0x49e6('0xf9')][_0x49e6('0x59')]({'where':{'id':_0x2fd922[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x147336,null))['then'](function(_0x5757cb){if(_0x5757cb){return _0x5757cb[_0x49e6('0xfa')](_0x2fd922['body'][_0x49e6('0x63')],_[_0x49e6('0xd8')](_0x2fd922[_0x49e6('0x55')],[_0x49e6('0x63'),'id'])||{});}})[_0x49e6('0x1e')](respondWithResult(_0x147336,null))['catch'](handleError(_0x147336,null));};exports[_0x49e6('0xfb')]=function(_0x2bdb4c,_0x437bcc,_0x29a6b5){var _0x53f264={};var _0x48d706={};var _0x3ef02a;var _0x16949d;return db[_0x49e6('0x3a')][_0x49e6('0x66')]({'where':{'id':_0x2bdb4c[_0x49e6('0x52')]['id']}})['then'](handleEntityNotFound(_0x437bcc,null))[_0x49e6('0x1e')](function(_0x17d892){if(_0x17d892){_0x3ef02a=_0x17d892;_0x48d706[_0x49e6('0x3e')]=_[_0x49e6('0x40')](db[_0x49e6('0xfc')][_0x49e6('0x3b')]);_0x48d706[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x2bdb4c[_0x49e6('0x3f')]);_0x48d706['filters']=_[_0x49e6('0x42')](_0x48d706[_0x49e6('0x3e')],_0x48d706[_0x49e6('0x3f')]);_0x53f264[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x48d706[_0x49e6('0x3e')],qs['fields'](_0x2bdb4c[_0x49e6('0x3f')][_0x49e6('0x44')]));_0x53f264['attributes']=_0x53f264['attributes']['length']?_0x53f264[_0x49e6('0x43')]:_0x48d706[_0x49e6('0x3e')];_0x53f264['order']=qs[_0x49e6('0x47')](_0x2bdb4c['query']['sort']);_0x53f264[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0x2bdb4c[_0x49e6('0x3f')],_0x48d706[_0x49e6('0x41')]));if(_0x2bdb4c[_0x49e6('0x3f')][_0x49e6('0x4b')]){_0x53f264[_0x49e6('0x48')]=_['merge'](_0x53f264[_0x49e6('0x48')],{'$or':_[_0x49e6('0x39')](_0x53f264[_0x49e6('0x43')],function(_0xb9de){var _0x25069a={};_0x25069a[_0xb9de]={'$like':'%'+_0x2bdb4c[_0x49e6('0x3f')][_0x49e6('0x4b')]+'%'};return _0x25069a;})});}_0x53f264=_['merge']({},_0x53f264,_0x2bdb4c[_0x49e6('0x4d')]);return _0x3ef02a[_0x49e6('0xfb')](_0x53f264);}})[_0x49e6('0x1e')](function(_0x1ec0e2){if(_0x1ec0e2){_0x16949d=_0x1ec0e2[_0x49e6('0x53')];if(!_0x2bdb4c[_0x49e6('0x3f')][_0x49e6('0x45')]('nolimit')){_0x53f264[_0x49e6('0x2e')]=qs['limit'](_0x2bdb4c[_0x49e6('0x3f')][_0x49e6('0x2e')]);_0x53f264['offset']=qs[_0x49e6('0x2d')](_0x2bdb4c['query'][_0x49e6('0x2d')]);}return _0x3ef02a['getProactiveActions'](_0x53f264);}})[_0x49e6('0x1e')](function(_0x3f250d){if(_0x3f250d){return _0x3f250d?{'count':_0x16949d,'rows':_0x3f250d}:null;}})[_0x49e6('0x1e')](respondWithResult(_0x437bcc,null))[_0x49e6('0x27')](handleError(_0x437bcc,null));};exports['getFields']=function(_0x4c2a34,_0x23d4de,_0x4df3ab){var _0x479be3=_0x4c2a34[_0x49e6('0x3f')][_0x49e6('0xfd')]===_0x49e6('0xfe')?_0x49e6('0xff'):_0x49e6('0x100');return db[_0x49e6('0x3a')][_0x49e6('0x59')]({'attributes':['id',_0x479be3],'where':{'id':_0x4c2a34[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x23d4de,null))[_0x49e6('0x1e')](function(_0x8919f5){if(_0x8919f5){var _0xba5500=_0x8919f5[_0x479be3];var _0x4116fd=_0xba5500&&_0xba5500[_0x49e6('0x101')]?_0xba5500[_0x49e6('0x101')]:[];_0x23d4de[_0x49e6('0x36')]({'fromKey':_[_0x49e6('0x76')](_0xba5500[_0x49e6('0x102')])?undefined:_0xba5500[_0x49e6('0x102')],'count':_0x4116fd[_0x49e6('0x53')],'rows':_0x4116fd});}})[_0x49e6('0x27')](handleError(_0x23d4de,null));};exports[_0x49e6('0x103')]=function(_0xa72f83,_0x5b02dd,_0x469466){var _0x37656a={'raw':![],'where':{}};var _0x5badfa={};var _0x2d73b5={'count':0x0,'rows':[]};return db[_0x49e6('0x3a')][_0x49e6('0x66')]({'where':{'id':_0xa72f83['params']['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x5b02dd,null))[_0x49e6('0x1e')](function(_0x2a5a70){if(_0x2a5a70){_0x5badfa[_0x49e6('0x3e')]=_[_0x49e6('0x40')](db[_0x49e6('0xca')]['rawAttributes']);_0x5badfa['query']=_[_0x49e6('0x40')](_0xa72f83[_0x49e6('0x3f')]);_0x5badfa['filters']=_[_0x49e6('0x42')](_0x5badfa[_0x49e6('0x3e')],_0x5badfa['query']);_0x37656a[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x5badfa[_0x49e6('0x3e')],qs[_0x49e6('0x44')](_0xa72f83['query']['fields']));_0x37656a[_0x49e6('0x43')]=_0x37656a[_0x49e6('0x43')][_0x49e6('0x53')]?_0x37656a['attributes']:_0x5badfa[_0x49e6('0x3e')];if(!_0xa72f83['query'][_0x49e6('0x45')](_0x49e6('0x61'))){_0x37656a['limit']=qs[_0x49e6('0x2e')](_0xa72f83[_0x49e6('0x3f')][_0x49e6('0x2e')]);_0x37656a[_0x49e6('0x2d')]=qs['offset'](_0xa72f83[_0x49e6('0x3f')][_0x49e6('0x2d')]);}_0x37656a[_0x49e6('0x46')]=qs['sort'](_0xa72f83[_0x49e6('0x3f')]['sort']);_0x37656a['where']=qs[_0x49e6('0x41')](_[_0x49e6('0x49')](_0xa72f83[_0x49e6('0x3f')],_0x5badfa[_0x49e6('0x41')]));_0x37656a[_0x49e6('0x48')]['ChatWebsiteId']=_0x2a5a70['id'];if(_0xa72f83[_0x49e6('0x3f')][_0x49e6('0x4b')]){_0x37656a[_0x49e6('0x48')]=_['merge'](_0x37656a[_0x49e6('0x48')],{'$or':_[_0x49e6('0x39')](_0x37656a[_0x49e6('0x43')],function(_0x27b8b2){var _0x32b1c8={};_0x32b1c8[_0x27b8b2]={'$like':'%'+_0xa72f83[_0x49e6('0x3f')][_0x49e6('0x4b')]+'%'};return _0x32b1c8;})});}_0x37656a=_[_0x49e6('0x4c')]({},_0x37656a,_0xa72f83[_0x49e6('0x4d')]);return db[_0x49e6('0xca')]['count']({'where':_0x37656a['where']})['then'](function(_0x8dd014){_0x2d73b5[_0x49e6('0x2c')]=_0x8dd014;if(_0xa72f83[_0x49e6('0x3f')][_0x49e6('0x4e')]){_0x37656a['include']=[{'all':!![]}];}else{_0x37656a[_0x49e6('0x4f')]=[{'model':db[_0x49e6('0x84')],'as':_0x49e6('0x104'),'required':![]}];}return db['ChatOfflineMessage'][_0x49e6('0x50')](_0x37656a);})['then'](function(_0x23ac49){_0x2d73b5[_0x49e6('0x51')]=_0x23ac49;return _0x2d73b5;});}})[_0x49e6('0x1e')](respondWithFilteredResult(_0x5b02dd,_0x37656a))[_0x49e6('0x27')](handleError(_0x5b02dd,null));};exports[_0x49e6('0x105')]=function(_0x52880e,_0x4d8f8d,_0xd44b35){return db['ChatWebsite'][_0x49e6('0x59')]({'where':{'id':_0x52880e['params']['id']}})['then'](handleEntityNotFound(_0x4d8f8d,null))[_0x49e6('0x1e')](function(_0x41e5dd){if(_0x41e5dd){return _0x41e5dd[_0x49e6('0x105')](_0x52880e[_0x49e6('0x55')][_0x49e6('0x63')],_[_0x49e6('0xd8')](_0x52880e[_0x49e6('0x55')],['ids','id'])||{})[_0x49e6('0xb1')](function(_0xa4c41f){for(var _0x436971=0x0;_0x436971<_0x52880e[_0x49e6('0x55')][_0x49e6('0x63')]['length'];_0x436971+=0x1){socket[_0x49e6('0x106')](_0x49e6('0x107'),{'UserId':_0x52880e[_0x49e6('0x55')][_0x49e6('0x63')][_0x436971],'ChatWebsiteId':_0x52880e['params']['id']});}return _0xa4c41f;});}})[_0x49e6('0x1e')](respondWithResult(_0x4d8f8d,null))[_0x49e6('0x27')](handleError(_0x4d8f8d,null));};exports[_0x49e6('0x108')]=function(_0x109645,_0x5f38a6,_0x5e36dc){return db['ChatWebsite'][_0x49e6('0x59')]({'where':{'id':_0x109645[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x5f38a6,null))[_0x49e6('0x1e')](function(_0x57026f){if(_0x57026f){return _0x57026f[_0x49e6('0x108')](_0x109645[_0x49e6('0x3f')][_0x49e6('0x63')])[_0x49e6('0x1e')](function(){if(_[_0x49e6('0x109')](_0x109645[_0x49e6('0x3f')][_0x49e6('0x63')])){for(var _0x6fc7a6=0x0;_0x6fc7a6<_0x109645['query'][_0x49e6('0x63')][_0x49e6('0x53')];_0x6fc7a6+=0x1){socket[_0x49e6('0x106')]('userChatWebsite:remove',{'UserId':Number(_0x109645[_0x49e6('0x3f')][_0x49e6('0x63')][_0x6fc7a6]),'ChatWebsiteId':Number(_0x109645[_0x49e6('0x52')]['id'])});}}else{socket[_0x49e6('0x106')](_0x49e6('0x10a'),{'UserId':Number(_0x109645[_0x49e6('0x3f')][_0x49e6('0x63')]),'ChatWebsiteId':Number(_0x109645[_0x49e6('0x52')]['id'])});}});}})[_0x49e6('0x1e')](respondWithStatusCode(_0x5f38a6,null))[_0x49e6('0x27')](handleError(_0x5f38a6,null));};exports[_0x49e6('0x10b')]=function(_0x51196d,_0x505cd1,_0x42bd94){var _0x3ba75c={};var _0x189276={};var _0x2ee8e5;var _0xcad6b5;return db[_0x49e6('0x3a')]['findOne']({'where':{'id':_0x51196d[_0x49e6('0x52')]['id']}})[_0x49e6('0x1e')](handleEntityNotFound(_0x505cd1,null))['then'](function(_0x5ef626){if(_0x5ef626){_0x2ee8e5=_0x5ef626;_0x189276[_0x49e6('0x3e')]=_[_0x49e6('0x40')](db['User'][_0x49e6('0x3b')]);_0x189276[_0x49e6('0x3f')]=_[_0x49e6('0x40')](_0x51196d[_0x49e6('0x3f')]);_0x189276[_0x49e6('0x41')]=_[_0x49e6('0x42')](_0x189276[_0x49e6('0x3e')],_0x189276[_0x49e6('0x3f')]);_0x3ba75c[_0x49e6('0x43')]=_[_0x49e6('0x42')](_0x189276[_0x49e6('0x3e')],qs['fields'](_0x51196d[_0x49e6('0x3f')][_0x49e6('0x44')]));_0x3ba75c['attributes']=_0x3ba75c['attributes'][_0x49e6('0x53')]?_0x3ba75c[_0x49e6('0x43')]:_0x189276[_0x49e6('0x3e')];_0x3ba75c[_0x49e6('0x46')]=qs[_0x49e6('0x47')](_0x51196d[_0x49e6('0x3f')][_0x49e6('0x47')]);_0x3ba75c[_0x49e6('0x48')]=qs[_0x49e6('0x41')](_['pick'](_0x51196d[_0x49e6('0x3f')],_0x189276['filters']));if(_0x51196d[_0x49e6('0x3f')]['filter']){_0x3ba75c[_0x49e6('0x48')]=_['merge'](_0x3ba75c[_0x49e6('0x48')],{'$or':_[_0x49e6('0x39')](_0x3ba75c[_0x49e6('0x43')],function(_0x34cefb){var _0x3cce63={};_0x3cce63[_0x34cefb]={'$like':'%'+_0x51196d['query'][_0x49e6('0x4b')]+'%'};return _0x3cce63;})});}_0x3ba75c=_['merge']({},_0x3ba75c,_0x51196d['options']);return _0x2ee8e5[_0x49e6('0x10b')](_0x3ba75c);}})['then'](function(_0x4e0a56){if(_0x4e0a56){_0xcad6b5=_0x4e0a56['length'];if(!_0x51196d[_0x49e6('0x3f')]['hasOwnProperty'](_0x49e6('0x61'))){_0x3ba75c[_0x49e6('0x2e')]=qs[_0x49e6('0x2e')](_0x51196d['query'][_0x49e6('0x2e')]);_0x3ba75c[_0x49e6('0x2d')]=qs['offset'](_0x51196d[_0x49e6('0x3f')][_0x49e6('0x2d')]);}return _0x2ee8e5[_0x49e6('0x10b')](_0x3ba75c);}})[_0x49e6('0x1e')](function(_0x2945b9){if(_0x2945b9){return _0x2945b9?{'count':_0xcad6b5,'rows':_0x2945b9}:null;}})[_0x49e6('0x1e')](respondWithResult(_0x505cd1,null))[_0x49e6('0x27')](handleError(_0x505cd1,null));}; \ No newline at end of file +var _0xae6a=['server/files/images/logos/','getAvatar','server/files/images/avatars/','download','server/files/images/avatars/customer_avatar.png','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','setUA','headers','user-agent','getResult','chat','difference','createdAt','updatedAt','CompanyId','ListId','Sequelize','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','CmContact','Contacts','DESC','ChatApplication','Applications','account','applications','list','List','orderBy','priority','contact','customerIp','x-forwarded-for','firstName','x-real-port','referer','browser','version','format','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','externalUrl','ChatInteraction','interaction','spread','messageId','created','autoclose','push','close','*,*,*,*','ChatMessage','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','EventManager','offline','send','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','findOrCreate','readFileSync','server/files/templates/chatOfflineMessage.ejs','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','Smtp','forwardOfflineAddress','service','host','secure','authentication','auth','pass','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','getInteractions','Contact','internal','Tag','Tags','tag','getSnippet','iftime\x20%s,%s','interval','timezone','iftime\x20%s','indexOf','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','Interval','virtual','custom','License','increment','chatLicenseExceeded','Intervals','some','server/files/chat/iframe.js','utf8','remote','stringify','x-real-ip','connection','remoteAddress','alignment','color','textColor','sequelize','transaction','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','omit','getProactiveActions','ChatProactiveAction','online','false','offlineForm','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','emit','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','get','ChatWebsites','UserProfileResource','stack','name','index','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','includeAll','include','findAll','show','params','Pause','length','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ChatWebsiteId','getDispositions','findOne','Disposition','rows','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','join','root','server/files/images/logos/default_logo.png','../../config/license/util','getLicense','isNil','existsSync'];(function(_0x6057c7,_0x5ea90a){var _0x113c8b=function(_0x4816bb){while(--_0x4816bb){_0x6057c7['push'](_0x6057c7['shift']());}};_0x113c8b(++_0x5ea90a);}(_0xae6a,0x9d));var _0xaae6=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xae6a[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require(_0xaae6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaae6('0x1'));var zipdir=require(_0xaae6('0x2'));var jsonpatch=require(_0xaae6('0x3'));var rp=require(_0xaae6('0x4'));var moment=require(_0xaae6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xaae6('0x6'));var util=require(_0xaae6('0x7'));var path=require(_0xaae6('0x8'));var sox=require(_0xaae6('0x9'));var csv=require('to-csv');var ejs=require(_0xaae6('0xa'));var fs=require('fs');var _=require(_0xaae6('0xb'));var squel=require(_0xaae6('0xc'));var crypto=require(_0xaae6('0xd'));var jsforce=require(_0xaae6('0xe'));var deskjs=require(_0xaae6('0xf'));var toCsv=require(_0xaae6('0x10'));var querystring=require(_0xaae6('0x11'));var Papa=require(_0xaae6('0x12'));var Redis=require(_0xaae6('0x13'));var authService=require(_0xaae6('0x14'));var qs=require(_0xaae6('0x15'));var as=require(_0xaae6('0x16'));var hardwareService=require(_0xaae6('0x17'));var logger=require(_0xaae6('0x18'))(_0xaae6('0x19'));var utils=require(_0xaae6('0x1a'));var config=require(_0xaae6('0x1b'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xaae6('0x1c')],{'host':_0xaae6('0x1d'),'port':0x18eb});var socket=require(_0xaae6('0x1e'))(new Redis(config[_0xaae6('0x1c')]));require('./chatWebsite.socket')['register'](socket);var jayson=require(_0xaae6('0x1f'));var client=jayson[_0xaae6('0x20')][_0xaae6('0x21')]({'port':0x232c});var client9002=jayson[_0xaae6('0x20')][_0xaae6('0x21')]({'port':0x232a});var client9003=jayson[_0xaae6('0x20')][_0xaae6('0x21')]({'port':0x232b});function checkPasswordPattern(_0x2c57aa,_0x2e362c,_0x873aeb){if(_0x873aeb){var _0x4c9f45=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4c9f45[_0xaae6('0x22')](_0x2e362c)){return _0x2c57aa;}else{throw new db['Sequelize'][(_0xaae6('0x23'))](_0xaae6('0x24'));}}else{return _0x2c57aa;}}function respondWithRpcPromise(_0x77a09,_0x3d204c,_0x1fdd42,_0x3e6847){return new BPromise(function(_0x21f79d,_0x24ecd4){var _0x494e12=_0x3e6847||client;return _0x494e12[_0xaae6('0x25')](_0x77a09,_0x1fdd42)[_0xaae6('0x26')](function(_0x575416){logger[_0xaae6('0x27')](_0xaae6('0x28'),_0x3d204c,_0xaae6('0x29'));logger[_0xaae6('0x2a')](_0xaae6('0x2b'),_0x3d204c,'request\x20sent',JSON['stringify'](_0x575416));if(_0x575416['error']){if(_0x575416[_0xaae6('0x2c')][_0xaae6('0x2d')]===0x1f4){logger[_0xaae6('0x2c')]('ChatWebsite,\x20%s,\x20%s',_0x3d204c,_0x575416[_0xaae6('0x2c')][_0xaae6('0x2e')]);return _0x24ecd4(_0x575416['error'][_0xaae6('0x2e')]);}logger['error'](_0xaae6('0x28'),_0x3d204c,_0x575416[_0xaae6('0x2c')]['message']);return _0x21f79d(_0x575416[_0xaae6('0x2c')][_0xaae6('0x2e')]);}else{logger[_0xaae6('0x27')](_0xaae6('0x28'),_0x3d204c,_0xaae6('0x29'));_0x21f79d(_0x575416[_0xaae6('0x2f')]['message']);}})[_0xaae6('0x30')](function(_0x3aedc4){logger[_0xaae6('0x2c')](_0xaae6('0x28'),_0x3d204c,_0x3aedc4);_0x24ecd4(_0x3aedc4);});});}function respondWithStatusCode(_0x432f05,_0x336f06){_0x336f06=_0x336f06||0xcc;return function(_0x4e909d){if(_0x4e909d){return _0x432f05[_0xaae6('0x31')](_0x336f06);}return _0x432f05[_0xaae6('0x32')](_0x336f06)[_0xaae6('0x33')]();};}function respondWithResult(_0x214ba6,_0x3644a4){_0x3644a4=_0x3644a4||0xc8;return function(_0x451069){if(_0x451069){return _0x214ba6['status'](_0x3644a4)[_0xaae6('0x34')](_0x451069);}};}function respondWithFilteredResult(_0x408a1f,_0xb062e){return function(_0x156c8a){if(_0x156c8a){var _0x49be90=_0x156c8a[_0xaae6('0x35')],_0x43368b=_0xb062e[_0xaae6('0x36')],_0x4d42e5=_0xb062e[_0xaae6('0x36')]+_0xb062e['limit'],_0x5a4efe;if(_0x4d42e5>=_0x49be90){_0x4d42e5=_0x49be90;_0x5a4efe=0xc8;}else{_0x5a4efe=0xce;}_0x408a1f[_0xaae6('0x32')](_0x5a4efe);return _0x408a1f[_0xaae6('0x37')](_0xaae6('0x38'),_0x43368b+'-'+_0x4d42e5+'/'+_0x49be90)['json'](_0x156c8a);}return null;};}function patchUpdates(_0x5526fa){return function(_0x5d544a){try{jsonpatch[_0xaae6('0x39')](_0x5d544a,_0x5526fa,!![]);}catch(_0x4d17e7){return BPromise[_0xaae6('0x3a')](_0x4d17e7);}return _0x5d544a[_0xaae6('0x3b')]();};}function saveUpdates(_0x17c1ad,_0x59edad){return function(_0x1d7897){if(_0x1d7897){return _0x1d7897[_0xaae6('0x3c')](_0x17c1ad)[_0xaae6('0x26')](function(_0x5a2436){return _0x5a2436;});}return null;};}function removeEntity(_0x48ce04,_0x4a049c){return function(_0x21adaf){if(_0x21adaf){return _0x21adaf[_0xaae6('0x3d')]()[_0xaae6('0x26')](function(){var _0x2e5e3f=_0x21adaf[_0xaae6('0x3e')]({'plain':!![]});var _0x163dff=_0xaae6('0x3f');return db[_0xaae6('0x40')][_0xaae6('0x3d')]({'where':{'type':_0x163dff,'resourceId':_0x2e5e3f['id']}})[_0xaae6('0x26')](function(){return _0x21adaf;});})[_0xaae6('0x26')](function(){_0x48ce04[_0xaae6('0x32')](0xcc)[_0xaae6('0x33')]();});}};}function handleEntityNotFound(_0x2e9b34,_0x5335f2){return function(_0x2b9ef1){if(!_0x2b9ef1){_0x2e9b34['sendStatus'](0x194);}return _0x2b9ef1;};}function handleError(_0x250f0e,_0x467e25){_0x467e25=_0x467e25||0x1f4;return function(_0x58a226){logger[_0xaae6('0x2c')](_0x58a226[_0xaae6('0x41')]);if(_0x58a226['name']){delete _0x58a226[_0xaae6('0x42')];}_0x250f0e[_0xaae6('0x32')](_0x467e25)['send'](_0x58a226);};}exports[_0xaae6('0x43')]=function(_0xb07d27,_0x54d1fb){var _0x38831e={'include':[{'model':db['Pause'],'as':_0xaae6('0x44')}]},_0x24dcc2={},_0x383d51={'count':0x0,'rows':[]};var _0x4dbc92=_[_0xaae6('0x45')](db[_0xaae6('0x46')][_0xaae6('0x47')],function(_0x43112c){return{'name':_0x43112c[_0xaae6('0x48')],'type':_0x43112c[_0xaae6('0x49')]['key']};});_0x24dcc2[_0xaae6('0x4a')]=_[_0xaae6('0x45')](_0x4dbc92,_0xaae6('0x42'));_0x24dcc2[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0xb07d27[_0xaae6('0x4b')]);_0x24dcc2['filters']=_['intersection'](_0x24dcc2['model'],_0x24dcc2[_0xaae6('0x4b')]);_0x38831e[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x24dcc2[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0xb07d27['query'][_0xaae6('0x4f')]));_0x38831e[_0xaae6('0x4d')]=_0x38831e['attributes']['length']?_0x38831e[_0xaae6('0x4d')]:_0x24dcc2[_0xaae6('0x4a')];if(!_0xb07d27['query'][_0xaae6('0x50')](_0xaae6('0x51'))){_0x38831e[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0xb07d27['query'][_0xaae6('0x52')]);_0x38831e['offset']=qs[_0xaae6('0x36')](_0xb07d27[_0xaae6('0x4b')][_0xaae6('0x36')]);}_0x38831e[_0xaae6('0x53')]=qs[_0xaae6('0x54')](_0xb07d27['query'][_0xaae6('0x54')]);_0x38831e[_0xaae6('0x55')]=qs[_0xaae6('0x56')](_[_0xaae6('0x57')](_0xb07d27['query'],_0x24dcc2[_0xaae6('0x56')]));if(_0xb07d27[_0xaae6('0x4b')][_0xaae6('0x58')]){_0x38831e[_0xaae6('0x55')]=_[_0xaae6('0x59')](_0x38831e[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x4dbc92,function(_0x2d57c9){if(_0x2d57c9['type']!==_0xaae6('0x5a')){var _0x15fad6={};_0x15fad6[_0x2d57c9['name']]={'$like':'%'+_0xb07d27[_0xaae6('0x4b')][_0xaae6('0x58')]+'%'};return _0x15fad6;}})});}_0x38831e=_[_0xaae6('0x59')]({},_0x38831e,_0xb07d27['options']);var _0x5ca9e7={'where':_0x38831e[_0xaae6('0x55')]};return db[_0xaae6('0x46')][_0xaae6('0x35')](_0x5ca9e7)[_0xaae6('0x26')](function(_0x1a61e4){_0x383d51[_0xaae6('0x35')]=_0x1a61e4;if(_0xb07d27['query'][_0xaae6('0x5b')]){_0x38831e[_0xaae6('0x5c')]=[{'all':!![]}];}return db[_0xaae6('0x46')][_0xaae6('0x5d')](_0x38831e);})[_0xaae6('0x26')](function(_0x37f226){_0x383d51['rows']=_0x37f226;return _0x383d51;})[_0xaae6('0x26')](respondWithFilteredResult(_0x54d1fb,_0x38831e))['catch'](handleError(_0x54d1fb,null));};exports[_0xaae6('0x5e')]=function(_0x2b3680,_0x49924a){var _0x40ce01={'raw':![],'where':{'id':_0x2b3680[_0xaae6('0x5f')]['id']},'include':[{'model':db[_0xaae6('0x60')],'as':_0xaae6('0x44')}]},_0x8fbfb0={};_0x8fbfb0[_0xaae6('0x4a')]=_[_0xaae6('0x4c')](db[_0xaae6('0x46')][_0xaae6('0x47')]);_0x8fbfb0[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0x2b3680['query']);_0x8fbfb0[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0x8fbfb0[_0xaae6('0x4a')],_0x8fbfb0['query']);_0x40ce01[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x8fbfb0[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x2b3680[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x40ce01[_0xaae6('0x4d')]=_0x40ce01['attributes'][_0xaae6('0x61')]?_0x40ce01['attributes']:_0x8fbfb0['model'];if(_0x2b3680[_0xaae6('0x4b')][_0xaae6('0x5b')]){_0x40ce01[_0xaae6('0x5c')]=[{'all':!![]}];}_0x40ce01=_[_0xaae6('0x59')]({},_0x40ce01,_0x2b3680[_0xaae6('0x62')]);return db[_0xaae6('0x46')][_0xaae6('0x63')](_0x40ce01)[_0xaae6('0x26')](handleEntityNotFound(_0x49924a,null))['then'](respondWithResult(_0x49924a,null))[_0xaae6('0x30')](handleError(_0x49924a,null));};exports['create']=function(_0x127cd8,_0x36fc3d){return db[_0xaae6('0x46')][_0xaae6('0x64')](_0x127cd8[_0xaae6('0x65')],{})[_0xaae6('0x26')](function(_0x5086c9){var _0x1e8483=_0x127cd8[_0xaae6('0x66')][_0xaae6('0x3e')]({'plain':!![]});if(!_0x1e8483)throw new Error(_0xaae6('0x67'));if(_0x1e8483[_0xaae6('0x68')]===_0xaae6('0x66')){var _0xf220=_0x5086c9[_0xaae6('0x3e')]({'plain':!![]});var _0x3ea15b='ChatWebsites';return db['UserProfileSection'][_0xaae6('0x63')]({'where':{'name':_0x3ea15b,'userProfileId':_0x1e8483[_0xaae6('0x69')]},'raw':!![]})[_0xaae6('0x26')](function(_0x95a92e){if(_0x95a92e&&_0x95a92e[_0xaae6('0x6a')]===0x0){return db[_0xaae6('0x40')][_0xaae6('0x64')]({'name':_0xf220[_0xaae6('0x42')],'resourceId':_0xf220['id'],'type':_0x95a92e[_0xaae6('0x42')],'sectionId':_0x95a92e['id']},{})[_0xaae6('0x26')](function(){return _0x5086c9;});}else{return _0x5086c9;}})[_0xaae6('0x30')](function(_0x46de4d){logger['error'](_0xaae6('0x6b'),_0x46de4d);throw _0x46de4d;});}return _0x5086c9;})[_0xaae6('0x26')](respondWithResult(_0x36fc3d,0xc9))[_0xaae6('0x30')](handleError(_0x36fc3d,null));};exports['update']=function(_0x4070f9,_0x22feb0){if(_0x4070f9[_0xaae6('0x65')]['id']){delete _0x4070f9['body']['id'];}return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x4070f9['params']['id']},'include':[{'model':db['Pause'],'as':_0xaae6('0x44')}]})[_0xaae6('0x26')](handleEntityNotFound(_0x22feb0,null))[_0xaae6('0x26')](saveUpdates(_0x4070f9[_0xaae6('0x65')],null))[_0xaae6('0x26')](respondWithResult(_0x22feb0,null))[_0xaae6('0x30')](handleError(_0x22feb0,null));};exports[_0xaae6('0x3d')]=function(_0x9790fc,_0x4cfb5d){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x9790fc[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x4cfb5d,null))[_0xaae6('0x26')](removeEntity(_0x4cfb5d,null))['catch'](handleError(_0x4cfb5d,null));};exports[_0xaae6('0x6c')]=function(_0x58f010,_0x23f4a8){return db[_0xaae6('0x46')][_0xaae6('0x6c')]()[_0xaae6('0x26')](respondWithResult(_0x23f4a8,null))[_0xaae6('0x30')](handleError(_0x23f4a8,null));};exports[_0xaae6('0x6d')]=function(_0x50ed94,_0x528c58,_0x3d525b){if(_0x50ed94[_0xaae6('0x65')]['id']){delete _0x50ed94[_0xaae6('0x65')]['id'];}return db[_0xaae6('0x46')]['find']({'where':{'id':_0x50ed94[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x528c58,null))[_0xaae6('0x26')](function(_0x36829a){if(_0x36829a){_0x50ed94['body'][_0xaae6('0x6e')]=_0x36829a['id'];return db['Disposition'][_0xaae6('0x64')](_0x50ed94[_0xaae6('0x65')]);}})[_0xaae6('0x26')](respondWithResult(_0x528c58,null))[_0xaae6('0x30')](handleError(_0x528c58,null));};exports[_0xaae6('0x6f')]=function(_0x1f9547,_0x384c7e,_0x552f78){var _0x4faa52={'raw':![],'where':{}};var _0x59eabc={};var _0x35a9fa={'count':0x0,'rows':[]};return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x1f9547[_0xaae6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x384c7e,null))[_0xaae6('0x26')](function(_0x1df7c9){if(_0x1df7c9){_0x59eabc['model']=_['keys'](db['Disposition'][_0xaae6('0x47')]);_0x59eabc[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0x1f9547[_0xaae6('0x4b')]);_0x59eabc['filters']=_[_0xaae6('0x4e')](_0x59eabc[_0xaae6('0x4a')],_0x59eabc[_0xaae6('0x4b')]);_0x4faa52[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x59eabc[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x1f9547[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x4faa52['attributes']=_0x4faa52[_0xaae6('0x4d')][_0xaae6('0x61')]?_0x4faa52[_0xaae6('0x4d')]:_0x59eabc[_0xaae6('0x4a')];if(!_0x1f9547[_0xaae6('0x4b')]['hasOwnProperty'](_0xaae6('0x51'))){_0x4faa52[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0x1f9547['query'][_0xaae6('0x52')]);_0x4faa52[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x1f9547['query'][_0xaae6('0x36')]);}_0x4faa52[_0xaae6('0x53')]=qs[_0xaae6('0x54')](_0x1f9547[_0xaae6('0x4b')][_0xaae6('0x54')]);_0x4faa52[_0xaae6('0x55')]=qs[_0xaae6('0x56')](_[_0xaae6('0x57')](_0x1f9547[_0xaae6('0x4b')],_0x59eabc[_0xaae6('0x56')]));_0x4faa52[_0xaae6('0x55')][_0xaae6('0x6e')]=_0x1df7c9['id'];if(_0x1f9547[_0xaae6('0x4b')][_0xaae6('0x58')]){_0x4faa52['where']=_['merge'](_0x4faa52[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x4faa52[_0xaae6('0x4d')],function(_0x4a9b71){var _0x4f98e2={};_0x4f98e2[_0x4a9b71]={'$like':'%'+_0x1f9547['query'][_0xaae6('0x58')]+'%'};return _0x4f98e2;})});}_0x4faa52=_[_0xaae6('0x59')]({},_0x4faa52,_0x1f9547[_0xaae6('0x62')]);return db[_0xaae6('0x71')][_0xaae6('0x35')]({'where':_0x4faa52[_0xaae6('0x55')]})['then'](function(_0x55939f){_0x35a9fa[_0xaae6('0x35')]=_0x55939f;if(_0x1f9547[_0xaae6('0x4b')][_0xaae6('0x5b')]){_0x4faa52[_0xaae6('0x5c')]=[{'all':!![]}];}return db[_0xaae6('0x71')][_0xaae6('0x5d')](_0x4faa52);})[_0xaae6('0x26')](function(_0x40a784){_0x35a9fa[_0xaae6('0x72')]=_0x40a784;return _0x35a9fa;});}})[_0xaae6('0x26')](respondWithFilteredResult(_0x384c7e,_0x4faa52))[_0xaae6('0x30')](handleError(_0x384c7e,null));};exports[_0xaae6('0x73')]=function(_0x100a63,_0x439c69,_0x4021e7){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x100a63['params']['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x439c69,null))[_0xaae6('0x26')](function(_0x488838){if(_0x488838){return _0x488838[_0xaae6('0x73')](_0x100a63[_0xaae6('0x4b')][_0xaae6('0x74')]);}})[_0xaae6('0x26')](respondWithStatusCode(_0x439c69,null))[_0xaae6('0x30')](handleError(_0x439c69,null));};exports[_0xaae6('0x75')]=function(_0x23f750,_0x9a09fb,_0x2ed0f5){if(_0x23f750[_0xaae6('0x65')]['id']){delete _0x23f750[_0xaae6('0x65')]['id'];}return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x23f750[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x9a09fb,null))[_0xaae6('0x26')](function(_0x3116b7){if(_0x3116b7){_0x23f750['body'][_0xaae6('0x6e')]=_0x3116b7['id'];return db[_0xaae6('0x76')][_0xaae6('0x64')](_0x23f750[_0xaae6('0x65')]);}})[_0xaae6('0x26')](respondWithResult(_0x9a09fb,null))[_0xaae6('0x30')](handleError(_0x9a09fb,null));};exports[_0xaae6('0x77')]=function(_0x4e7ac3,_0x5a4d1d,_0x1ac7f3){var _0x136228={'raw':![],'where':{}};var _0x3383fe={};var _0x34a5bb={'count':0x0,'rows':[]};return db['ChatWebsite'][_0xaae6('0x70')]({'where':{'id':_0x4e7ac3[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x5a4d1d,null))[_0xaae6('0x26')](function(_0x156cb5){if(_0x156cb5){_0x3383fe['model']=_[_0xaae6('0x4c')](db['CannedAnswer'][_0xaae6('0x47')]);_0x3383fe[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0x4e7ac3[_0xaae6('0x4b')]);_0x3383fe[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0x3383fe[_0xaae6('0x4a')],_0x3383fe['query']);_0x136228['attributes']=_['intersection'](_0x3383fe[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x4e7ac3[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x136228[_0xaae6('0x4d')]=_0x136228['attributes'][_0xaae6('0x61')]?_0x136228[_0xaae6('0x4d')]:_0x3383fe[_0xaae6('0x4a')];if(!_0x4e7ac3[_0xaae6('0x4b')][_0xaae6('0x50')](_0xaae6('0x51'))){_0x136228[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0x4e7ac3['query'][_0xaae6('0x52')]);_0x136228[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x4e7ac3[_0xaae6('0x4b')][_0xaae6('0x36')]);}_0x136228['order']=qs[_0xaae6('0x54')](_0x4e7ac3['query'][_0xaae6('0x54')]);_0x136228['where']=qs[_0xaae6('0x56')](_[_0xaae6('0x57')](_0x4e7ac3[_0xaae6('0x4b')],_0x3383fe['filters']));_0x136228[_0xaae6('0x55')][_0xaae6('0x6e')]=_0x156cb5['id'];if(_0x4e7ac3['query'][_0xaae6('0x58')]){_0x136228[_0xaae6('0x55')]=_[_0xaae6('0x59')](_0x136228[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x136228['attributes'],function(_0x116604){var _0x2199a5={};_0x2199a5[_0x116604]={'$like':'%'+_0x4e7ac3['query']['filter']+'%'};return _0x2199a5;})});}_0x136228=_[_0xaae6('0x59')]({},_0x136228,_0x4e7ac3[_0xaae6('0x62')]);return db[_0xaae6('0x76')][_0xaae6('0x35')]({'where':_0x136228[_0xaae6('0x55')]})[_0xaae6('0x26')](function(_0x2287ca){_0x34a5bb['count']=_0x2287ca;if(_0x4e7ac3[_0xaae6('0x4b')]['includeAll']){_0x136228[_0xaae6('0x5c')]=[{'all':!![]}];}return db[_0xaae6('0x76')][_0xaae6('0x5d')](_0x136228);})['then'](function(_0x3e0ee4){_0x34a5bb[_0xaae6('0x72')]=_0x3e0ee4;return _0x34a5bb;});}})[_0xaae6('0x26')](respondWithFilteredResult(_0x5a4d1d,_0x136228))[_0xaae6('0x30')](handleError(_0x5a4d1d,null));};exports[_0xaae6('0x78')]=function(_0x4883ee,_0x358fbe,_0x45705d){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x4883ee[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x358fbe,null))[_0xaae6('0x26')](function(_0x1b38cd){if(_0x1b38cd){return _0x1b38cd[_0xaae6('0x78')](_0x4883ee[_0xaae6('0x4b')][_0xaae6('0x74')]);}})[_0xaae6('0x26')](respondWithStatusCode(_0x358fbe,null))[_0xaae6('0x30')](handleError(_0x358fbe,null));};exports[_0xaae6('0x79')]=function(_0x18d289,_0x5650d9,_0x3a7df6){_0x18d289[_0xaae6('0x65')][_0xaae6('0x7a')]=_0x18d289[_0xaae6('0x7b')][_0xaae6('0x7c')];return db['ChatWebsite'][_0xaae6('0x63')]({'where':{'id':_0x18d289[_0xaae6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5650d9,null))[_0xaae6('0x26')](saveUpdates(_0x18d289[_0xaae6('0x65')],null))[_0xaae6('0x26')](respondWithResult(_0x5650d9,null))[_0xaae6('0x30')](handleError(_0x5650d9,null));};exports[_0xaae6('0x7d')]=function(_0x404ced,_0xc75666,_0x34a07c){_0x404ced[_0xaae6('0x65')][_0xaae6('0x7e')]=_0x404ced[_0xaae6('0x7b')][_0xaae6('0x7c')];return db[_0xaae6('0x46')]['find']({'where':{'id':_0x404ced[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0xc75666,null))[_0xaae6('0x26')](saveUpdates(_0x404ced['body'],null))[_0xaae6('0x26')](respondWithResult(_0xc75666,null))[_0xaae6('0x30')](handleError(_0xc75666,null));};exports['addCustomerAvatar']=function(_0x563b85,_0x1bb88b,_0x351368){_0x563b85['body'][_0xaae6('0x7f')]=_0x563b85[_0xaae6('0x7b')][_0xaae6('0x7c')];return db['ChatWebsite'][_0xaae6('0x63')]({'where':{'id':_0x563b85[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x1bb88b,null))[_0xaae6('0x26')](saveUpdates(_0x563b85[_0xaae6('0x65')],null))['then'](respondWithResult(_0x1bb88b,null))[_0xaae6('0x30')](handleError(_0x1bb88b,null));};exports[_0xaae6('0x80')]=function(_0x1fc4d6,_0x378b78,_0x40717){_0x1fc4d6['body'][_0xaae6('0x81')]=_0x1fc4d6[_0xaae6('0x7b')][_0xaae6('0x7c')];return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x1fc4d6[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x378b78,null))[_0xaae6('0x26')](saveUpdates(_0x1fc4d6['body'],null))[_0xaae6('0x26')](respondWithResult(_0x378b78,null))[_0xaae6('0x30')](handleError(_0x378b78,null));};exports[_0xaae6('0x82')]=function(_0xe3d0f8,_0x691ff3,_0x393873){var _0x5c4696=path[_0xaae6('0x83')](config[_0xaae6('0x84')],_0xaae6('0x85'));var _0x3656a1={'where':{'id':_0xe3d0f8[_0xaae6('0x5f')]['id']},'attributes':['id','sitepic'],'raw':!![]};var _0x7578ff=![];return require(_0xaae6('0x86'))[_0xaae6('0x87')]()[_0xaae6('0x26')](function(_0x5bd9a4){if(_0x5bd9a4){_0x7578ff=_0x5bd9a4['custom'];}})[_0xaae6('0x26')](function(){return db['ChatWebsite'][_0xaae6('0x63')](_0x3656a1);})[_0xaae6('0x26')](handleEntityNotFound(_0x691ff3,null))['then'](function(_0x5df367){if(_0x5df367){if(!_[_0xaae6('0x88')](_0x5df367[_0xaae6('0x7a')])){if(fs[_0xaae6('0x89')](path[_0xaae6('0x83')](config[_0xaae6('0x84')],_0xaae6('0x8a'),_0x5df367[_0xaae6('0x7a')]))&&_0x7578ff){_0x5c4696=path[_0xaae6('0x83')](config[_0xaae6('0x84')],_0xaae6('0x8a'),_0x5df367[_0xaae6('0x7a')]);}}return _0x691ff3['download'](_0x5c4696);}})[_0xaae6('0x30')](handleError(_0x691ff3,null));};exports[_0xaae6('0x8b')]=function(_0x38a256,_0x59d4d1,_0x273b9e){var _0x52c4d7=path[_0xaae6('0x83')](config[_0xaae6('0x84')],'server/files/images/avatars/default_avatar.png');var _0x4acf71={'where':{'id':_0x38a256[_0xaae6('0x5f')]['id']},'attributes':['id',_0xaae6('0x7e')],'raw':!![]};return db[_0xaae6('0x46')][_0xaae6('0x63')](_0x4acf71)[_0xaae6('0x26')](handleEntityNotFound(_0x59d4d1,null))[_0xaae6('0x26')](function(_0x8c4631){if(_0x8c4631){if(!_[_0xaae6('0x88')](_0x8c4631[_0xaae6('0x7e')])){if(fs[_0xaae6('0x89')](path[_0xaae6('0x83')](config[_0xaae6('0x84')],_0xaae6('0x8c'),_0x8c4631[_0xaae6('0x7e')]))){_0x52c4d7=path['join'](config[_0xaae6('0x84')],_0xaae6('0x8c'),_0x8c4631[_0xaae6('0x7e')]);}}return _0x59d4d1[_0xaae6('0x8d')](_0x52c4d7);}})['catch'](handleError(_0x59d4d1,null));};exports['getCustomerAvatar']=function(_0x4834e8,_0x8134c5,_0x1b3a47){var _0xf69e71=path['join'](config[_0xaae6('0x84')],_0xaae6('0x8e'));var _0x2e4b71={'where':{'id':_0x4834e8['params']['id']},'attributes':['id',_0xaae6('0x7f'),_0xaae6('0x8f')],'raw':!![]};return db[_0xaae6('0x46')][_0xaae6('0x63')](_0x2e4b71)[_0xaae6('0x26')](handleEntityNotFound(_0x8134c5,null))['then'](function(_0x389b99){if(_0x389b99){if(!_[_0xaae6('0x88')](_0x389b99[_0xaae6('0x7f')])){if(fs[_0xaae6('0x89')](path['join'](config[_0xaae6('0x84')],_0xaae6('0x8c'),_0x389b99[_0xaae6('0x7f')]))&&_0x389b99['showCustomerAvatar']){_0xf69e71=path[_0xaae6('0x83')](config['root'],_0xaae6('0x8c'),_0x389b99[_0xaae6('0x7f')]);}}return _0x8134c5[_0xaae6('0x8d')](_0xf69e71);}})[_0xaae6('0x30')](handleError(_0x8134c5,null));};exports[_0xaae6('0x90')]=function(_0x359e6a,_0xd96851,_0x17b9f4){var _0x29d47b=path['join'](config['root'],_0xaae6('0x91'));var _0x2a288c={'where':{'id':_0x359e6a[_0xaae6('0x5f')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0xaae6('0x46')][_0xaae6('0x63')](_0x2a288c)['then'](handleEntityNotFound(_0xd96851,null))[_0xaae6('0x26')](function(_0x3537f5){if(_0x3537f5){if(!_[_0xaae6('0x88')](_0x3537f5[_0xaae6('0x81')])){if(fs[_0xaae6('0x89')](path[_0xaae6('0x83')](config['root'],'server/files/images/avatars/',_0x3537f5[_0xaae6('0x81')]))){_0x29d47b=path['join'](config[_0xaae6('0x84')],_0xaae6('0x8c'),_0x3537f5[_0xaae6('0x81')]);}}return _0xd96851[_0xaae6('0x8d')](_0x29d47b);}})[_0xaae6('0x30')](handleError(_0xd96851,null));};exports[_0xaae6('0x92')]=function(_0xadcc49,_0x536d3d,_0xa68da6){var _0x30ce79=require(_0xaae6('0x93'));var _0x493ccf=new _0x30ce79();var _0x384a16=_0x493ccf[_0xaae6('0x94')](_0xadcc49[_0xaae6('0x95')][_0xaae6('0x96')])[_0xaae6('0x97')]();var _0xc58004={'body':_0xadcc49[_0xaae6('0x65')],'channel':_0xaae6('0x98')};var _0x3a2785=[];var _0x28dca2=[];var _0x2cc5fe={};var _0x62ecae=![];return db['CmContact'][_0xaae6('0x6c')]()[_0xaae6('0x26')](function(_0x28b51e){if(!_0x28b51e){throw new db['Sequelize']['ValidationError']('no\x20available\x20attributes');}_0x3a2785=_[_0xaae6('0x99')](_[_0xaae6('0x4c')](_0x28b51e),[_0xaae6('0x9a'),_0xaae6('0x9b')]);_0x28dca2=_[_0xaae6('0x99')](_[_0xaae6('0x4c')](_0x28b51e),[_0xaae6('0x9a'),_0xaae6('0x9b'),_0xaae6('0x9c'),_0xaae6('0x9d')]);if(_0xadcc49[_0xaae6('0x65')]['id']){delete _0xadcc49[_0xaae6('0x65')]['id'];}if(_[_0xaae6('0x88')](_0xadcc49[_0xaae6('0x65')]['from'])){throw new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0x9f'));}if(_[_0xaae6('0x88')](_0xadcc49[_0xaae6('0x65')]['body'])||_0xadcc49[_0xaae6('0x65')][_0xaae6('0x65')]===''){throw new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0xa0'));}if(_[_0xaae6('0x88')](_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa1')])){throw new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x28dca2);}if(!_[_0xaae6('0xa2')](_0x28dca2,_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa1')])){throw new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0xa3')+_0x28dca2);}_0x2cc5fe[_0xadcc49['body'][_0xaae6('0xa1')]]=_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa4')];})[_0xaae6('0x26')](function(){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0xadcc49[_0xaae6('0x5f')]['id']},'include':[{'model':db[_0xaae6('0xa5')],'as':'List','include':[{'model':db[_0xaae6('0xa6')],'as':_0xaae6('0xa7'),'where':_0x2cc5fe,'limit':0x1,'order':[[_0xaae6('0x9b'),_0xaae6('0xa8')]]}]},{'model':db[_0xaae6('0xa9')],'as':_0xaae6('0xaa')}]});})['then'](handleEntityNotFound(_0x536d3d,null))[_0xaae6('0x26')](function(_0x25459f){if(_0x25459f&&_0x25459f['List']){_0xc58004[_0xaae6('0xab')]=_0x25459f;_0xc58004[_0xaae6('0xac')]=_0x25459f[_0xaae6('0xaa')];_0xc58004[_0xaae6('0xad')]=_0x25459f[_0xaae6('0xae')];_0xc58004[_0xaae6('0xac')]=_[_0xaae6('0xaf')](_0xc58004[_0xaae6('0xac')],[_0xaae6('0xb0')],['asc']);if(_0xc58004[_0xaae6('0xab')][_0xaae6('0xaa')]){delete _0xc58004[_0xaae6('0xab')][_0xaae6('0xaa')];}if(_0xc58004[_0xaae6('0xab')]['List']&&_0xc58004[_0xaae6('0xab')][_0xaae6('0xae')]['Contacts'][_0xaae6('0x61')]){return _0xc58004['account']['List'][_0xaae6('0xa7')][0x0];}var _0x2cd269=_['defaults'](_0xadcc49['body'],{'firstName':_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa4')],'ListId':_0x25459f[_0xaae6('0x9d')]});_0x2cd269[_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa1')]]=_0xadcc49[_0xaae6('0x65')][_0xaae6('0xa4')];return db[_0xaae6('0xa6')][_0xaae6('0x64')](_0x2cd269,{'fields':_0x3a2785,'raw':!![]});}})[_0xaae6('0x26')](handleEntityNotFound(_0x536d3d,null))[_0xaae6('0x26')](function(_0x107675){_0xc58004[_0xaae6('0xb1')]=_0x107675;var _0xbf0141=_0xadcc49['body'][_0xaae6('0xb2')];if(_0xadcc49[_0xaae6('0x95')]['cf-connecting-ip']){_0xbf0141=_0xadcc49[_0xaae6('0x95')]['cf-connecting-ip'];}else if(_0xadcc49['headers']['x-forwarded-for']){_0xbf0141=_['first'](_0xadcc49[_0xaae6('0x95')][_0xaae6('0xb3')]['split'](','));}if(_0x107675){var _0xa25788={'ContactId':_0x107675['id'],'ChatWebsiteId':_0xadcc49[_0xaae6('0x5f')]['id'],'from':(_0x107675[_0xaae6('0xb4')]||'')+'\x20'+(_0x107675['lastName']||''),'customerIp':_0xbf0141,'customerPort':_0xadcc49[_0xaae6('0x95')][_0xaae6('0xb5')]?_0xadcc49[_0xaae6('0x95')][_0xaae6('0xb5')]:null,'referer':_0xadcc49[_0xaae6('0x65')][_0xaae6('0xb6')],'browserName':_0x384a16['browser'][_0xaae6('0x42')]&&_0x384a16[_0xaae6('0xb7')][_0xaae6('0xb8')]?util[_0xaae6('0xb9')]('%s\x20%s',_0x384a16[_0xaae6('0xb7')][_0xaae6('0x42')],_0x384a16[_0xaae6('0xb7')][_0xaae6('0xb8')]):_0xaae6('0xba'),'browserVersion':_0x384a16[_0xaae6('0xb7')][_0xaae6('0xb8')]||_0xaae6('0xba'),'osName':util['format'](_0xaae6('0xbb'),_0x384a16['os'][_0xaae6('0x42')],_0x384a16['os']['version']),'osVersion':_0x384a16['os']['version'],'deviceModel':_0x384a16[_0xaae6('0xbc')][_0xaae6('0x4a')]&&_0x384a16[_0xaae6('0xbc')][_0xaae6('0xbd')]?util[_0xaae6('0xb9')](_0xaae6('0xbe'),_0x384a16[_0xaae6('0xbc')][_0xaae6('0x4a')],_0x384a16[_0xaae6('0xbc')][_0xaae6('0xbd')],_0x384a16['device']['type']):null,'deviceVendor':_0x384a16[_0xaae6('0xbc')]['vendor'],'deviceType':_0x384a16['device']['type'],'formData':JSON['stringify'](_0xadcc49['body'])};var _0x5354c8={'ChatWebsiteId':_0xadcc49[_0xaae6('0x5f')]['id'],'closed':![]};if(_0xadcc49['body'][_0xaae6('0xbf')]){_0x5354c8['threadId']=_0xadcc49[_0xaae6('0x65')]['threadId'];return db['ChatInteraction'][_0xaae6('0x63')]({'where':_0x5354c8})[_0xaae6('0x26')](function(_0x2c7d74){if(_0x2c7d74){return[_0x2c7d74,![]];}_0xa25788[_0xaae6('0xbf')]=_0xadcc49[_0xaae6('0x65')][_0xaae6('0xbf')];_0xa25788['externalUrl']=_0xadcc49['body'][_0xaae6('0xc0')];return db[_0xaae6('0xc1')][_0xaae6('0x64')](_0xa25788)[_0xaae6('0x26')](function(_0x4c4e24){return[_0x4c4e24,!![]];});});}_0x5354c8['ContactId']=_0x107675['id'];if(_0xadcc49['body']['interaction']&&_0xadcc49[_0xaae6('0x65')][_0xaae6('0xc2')]['id']){_0x5354c8['id']=_0xadcc49[_0xaae6('0x65')]['interaction']['id'];return db['ChatInteraction'][_0xaae6('0x63')]({'where':_0x5354c8})[_0xaae6('0x26')](function(_0x775583){if(_0x775583){return[_0x775583,![]];}return db['ChatInteraction'][_0xaae6('0x64')](_0xa25788)['then'](function(_0xa1a1b1){return[_0xa1a1b1,!![]];});});}return db[_0xaae6('0xc1')][_0xaae6('0x64')](_0xa25788)[_0xaae6('0x26')](function(_0x47e319){return[_0x47e319,!![]];});}})[_0xaae6('0xc3')](function(_0xfd73c0,_0x15fa8e){if(_0xfd73c0){_0x62ecae=_0x15fa8e;if(!_0x15fa8e){var _0x454fc4={'from':(_0xc58004[_0xaae6('0xb1')][_0xaae6('0xb4')]||'')+'\x20'+(_0xc58004[_0xaae6('0xb1')]['lastName']||'')};if(_0xadcc49[_0xaae6('0x65')][_0xaae6('0xbf')]&&_0xadcc49[_0xaae6('0x65')][_0xaae6('0xc4')]&&_0xadcc49[_0xaae6('0x65')]['threadId']!=_0xadcc49[_0xaae6('0x65')][_0xaae6('0xc4')]){_0x454fc4[_0xaae6('0xbf')]=_0xadcc49[_0xaae6('0x65')][_0xaae6('0xc4')];}return _0xfd73c0[_0xaae6('0x3c')](_0x454fc4);}else{return _0xfd73c0;}}})[_0xaae6('0x26')](function(_0xc0c284){_0xc58004[_0xaae6('0xc2')]=_0xc0c284[_0xaae6('0x3e')]({'plain':!![]});_0xc58004[_0xaae6('0xc2')][_0xaae6('0xc5')]=_0x62ecae;if(_0xc58004[_0xaae6('0xc2')][_0xaae6('0xc5')]){if(_0xc58004[_0xaae6('0xab')][_0xaae6('0xc6')]){_0xc58004[_0xaae6('0xac')][_0xaae6('0xc7')]({'id':0x0,'priority':_0xc58004[_0xaae6('0xac')][_0xaae6('0x61')]+0x1,'app':_0xaae6('0xc8'),'appdata':'unmanaged','interval':_0xaae6('0xc9')});}}return db[_0xaae6('0xca')][_0xaae6('0x64')]({'body':_0xadcc49[_0xaae6('0x65')][_0xaae6('0x65')],'ChatWebsiteId':_0xadcc49['params']['id'],'ChatInteractionId':_0xc0c284['id'],'direction':'in','ContactId':_0xc58004[_0xaae6('0xb1')]['id'],'AttachmentId':_0xadcc49[_0xaae6('0x65')][_0xaae6('0xcb')]});})[_0xaae6('0x26')](function(_0x356b42){_0xc58004['message']=_0x356b42;if(_0xc58004[_0xaae6('0xc2')]['UserId']){return db[_0xaae6('0xcc')][_0xaae6('0x63')]({'attributes':['id',_0xaae6('0x42')],'where':{'id':_0xc58004['interaction'][_0xaae6('0xcd')]}})[_0xaae6('0x26')](function(_0x1af92c){if(_0x1af92c){_0xc58004[_0xaae6('0xac')][_0xaae6('0xce')]({'id':0x0,'priority':0x0,'app':_0xaae6('0xcf'),'appdata':_0x1af92c[_0xaae6('0x42')]+','+(_0xc58004[_0xaae6('0xab')][_0xaae6('0xd0')]||0xa),'interval':'*,*,*,*'});_0xc58004[_0xaae6('0xd1')]=!![];}return respondWithRpcPromise(_0xaae6('0xd2'),'startRouting',_0xc58004);});}return respondWithRpcPromise(_0xaae6('0xd2'),_0xaae6('0xd3'),_0xc58004);})['then'](function(_0x831b40){respondWithRpcPromise(_0xaae6('0xd4'),'EventManager',{'event':_0xaae6('0x92'),'message':_0x831b40},client9002);return _0x831b40;})[_0xaae6('0x26')](respondWithResult(_0x536d3d,null))[_0xaae6('0x30')](handleError(_0x536d3d,null));};exports[_0xaae6('0xd5')]=function(_0x30b723,_0x2020d3,_0x4cdfac){var _0x5018a1,_0x33c99e,_0x274bed;var _0x835a4d=[];var _0x196aaf=[];var _0x54a212={};return db[_0xaae6('0xa6')][_0xaae6('0x6c')]()['then'](function(_0x436a45){if(!_0x436a45){throw new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))]('no\x20available\x20attributes');}_0x196aaf=_[_0xaae6('0x99')](_[_0xaae6('0x4c')](_0x436a45),['createdAt',_0xaae6('0x9b')]);_0x835a4d=_[_0xaae6('0x99')](_['keys'](_0x436a45),[_0xaae6('0x9a'),_0xaae6('0x9b'),_0xaae6('0x9c'),_0xaae6('0x9d')]);if(_0x30b723[_0xaae6('0x65')]['id']){delete _0x30b723[_0xaae6('0x65')]['id'];}if(_['isNil'](_0x30b723[_0xaae6('0x65')][_0xaae6('0xa4')])){throw _0x2020d3[_0xaae6('0x32')](0x1f4)[_0xaae6('0xd6')](new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0x9f')));}if(_[_0xaae6('0x88')](_0x30b723[_0xaae6('0x65')]['body'])||_0x30b723['body'][_0xaae6('0x65')]===''){throw _0x2020d3[_0xaae6('0x32')](0x1f4)['send'](new db[(_0xaae6('0x9e'))]['ValidationError'](_0xaae6('0xa0')));}if(_[_0xaae6('0x88')](_0x30b723['body']['mapKeyOffline'])){throw _0x2020d3[_0xaae6('0x32')](0x1f4)[_0xaae6('0xd6')](new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0xd7')+_0x835a4d));}if(!_[_0xaae6('0xa2')](_0x835a4d,_0x30b723[_0xaae6('0x65')][_0xaae6('0xd8')])){throw _0x2020d3['status'](0x1f4)['send'](new db[(_0xaae6('0x9e'))][(_0xaae6('0x23'))](_0xaae6('0xd9')+_0x835a4d));}_0x54a212[_0x30b723[_0xaae6('0x65')][_0xaae6('0xd8')]]=_0x30b723['body'][_0xaae6('0xa4')];})[_0xaae6('0x26')](function(){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x30b723[_0xaae6('0x5f')]['id']},'include':[{'model':db[_0xaae6('0xa5')],'as':_0xaae6('0xae')}]});})[_0xaae6('0x26')](handleEntityNotFound(_0x2020d3,null))[_0xaae6('0x26')](function(_0x4aa32a){if(_0x4aa32a&&_0x4aa32a[_0xaae6('0xae')]){_0x33c99e=_0x4aa32a;var _0x46bca5=_['defaults'](_0x30b723[_0xaae6('0x65')],{'firstName':_0x30b723[_0xaae6('0x65')]['from'],'phone':_0x30b723['body'][_0xaae6('0xa4')],'ListId':_0x4aa32a[_0xaae6('0x9d')]});_0x46bca5[_0x30b723[_0xaae6('0x65')][_0xaae6('0xd8')]]=_0x30b723[_0xaae6('0x65')][_0xaae6('0xa4')];return db[_0xaae6('0xa6')][_0xaae6('0xda')]({'where':_0x54a212,'defaults':_0x46bca5});}})['spread'](function(_0x23e1d7){if(_0x23e1d7){_0x274bed=_0x23e1d7;var _0x338f71=fs[_0xaae6('0xdb')](path['join'](config[_0xaae6('0x84')],_0xaae6('0xdc')),'utf8');var _0xe254b7=ejs[_0xaae6('0xdd')](_0x338f71,{'body':_[_0xaae6('0xde')](_0x30b723[_0xaae6('0x65')][_0xaae6('0x65')]),'bodyTitle':_0x33c99e[_0xaae6('0xdf')]});return db[_0xaae6('0xe0')][_0xaae6('0x64')]({'body':_0xe254b7,'ContactId':_0x23e1d7['id'],'ChatWebsiteId':_0x33c99e['id']});}})[_0xaae6('0x26')](function(_0x4062fd){if(_0x4062fd){_0x5018a1=_0x4062fd;return db[_0xaae6('0xe1')][_0xaae6('0x70')]({'where':{'service':!![]},'include':[{'model':db['MailServerOut'],'as':_0xaae6('0xe2'),'raw':!![]}]});}})[_0xaae6('0x26')](function(_0x54235d){if(_0x54235d&&_0x54235d[_0xaae6('0xe2')]&&_0x33c99e[_0xaae6('0xe3')]){var _0x486830={'tls':{'rejectUnauthorized':![]}};if(_0x54235d['Smtp'][_0xaae6('0xe4')]){_0x486830[_0xaae6('0xe4')]=_0x54235d['Smtp'][_0xaae6('0xe4')];}else{_0x486830[_0xaae6('0xe5')]=_0x54235d[_0xaae6('0xe2')][_0xaae6('0xe5')];_0x486830['port']=_0x54235d[_0xaae6('0xe2')]['port'];_0x486830[_0xaae6('0xe6')]=_0x54235d[_0xaae6('0xe2')][_0xaae6('0xe6')];}if(_0x54235d['Smtp'][_0xaae6('0xe7')]){_0x486830[_0xaae6('0xe8')]={'user':_0x54235d['Smtp'][_0xaae6('0x66')],'pass':_0x54235d[_0xaae6('0xe2')][_0xaae6('0xe9')]};}return respondWithRpcPromise('SendMail','sendMail',{'account':_0x486830,'message':{'from':util['format'](_0xaae6('0xea'),_0x54235d['name'],_0x54235d[_0xaae6('0xeb')]||_0x54235d['Smtp'][_0xaae6('0x66')]),'to':_0x33c99e[_0xaae6('0xe3')],'subject':_0x33c99e[_0xaae6('0xec')],'text':_0x5018a1[_0xaae6('0x65')]}},client9003)[_0xaae6('0x26')](function(){return _0x5018a1;})[_0xaae6('0x30')](function(_0x54f4dd){console[_0xaae6('0x2c')](_0x54f4dd);});}})[_0xaae6('0x26')](function(){if(_0x5018a1){return _0x5018a1;}})[_0xaae6('0x26')](respondWithResult(_0x2020d3,null))['catch'](handleError(_0x2020d3,null));};exports[_0xaae6('0xed')]=function(_0x33f04f,_0x56d5ec,_0x2741fb){return db[_0xaae6('0xc1')][_0xaae6('0x63')]({'where':{'id':_0x33f04f[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x56d5ec,null))[_0xaae6('0x26')](function(_0x495e2e){if(_0x495e2e){return _0x495e2e[_0xaae6('0xed')](_0x33f04f[_0xaae6('0x65')]['ids'],_['omit'](_0x33f04f['body'],[_0xaae6('0x74'),'id'])||{});}})[_0xaae6('0x26')](respondWithResult(_0x56d5ec,null))['catch'](handleError(_0x56d5ec,null));};exports[_0xaae6('0xee')]=function(_0x20ae88,_0x24182a,_0x137434){var _0x1eb318={'raw':![],'where':{}};var _0x59058d={};var _0x269476={'count':0x0,'rows':[]};return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x20ae88[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x24182a,null))[_0xaae6('0x26')](function(_0xeba86){if(_0xeba86){_0x59058d[_0xaae6('0x4a')]=_['keys'](db[_0xaae6('0xc1')][_0xaae6('0x47')]);_0x59058d[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0x20ae88[_0xaae6('0x4b')]);_0x59058d[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0x59058d[_0xaae6('0x4a')],_0x59058d['query']);_0x1eb318[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x59058d[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x20ae88[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x1eb318['attributes']=_0x1eb318[_0xaae6('0x4d')][_0xaae6('0x61')]?_0x1eb318['attributes']:_0x59058d[_0xaae6('0x4a')];if(!_0x20ae88[_0xaae6('0x4b')]['hasOwnProperty'](_0xaae6('0x51'))){_0x1eb318['limit']=qs[_0xaae6('0x52')](_0x20ae88['query'][_0xaae6('0x52')]);_0x1eb318[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x20ae88[_0xaae6('0x4b')][_0xaae6('0x36')]);}_0x1eb318[_0xaae6('0x53')]=qs['sort'](_0x20ae88[_0xaae6('0x4b')][_0xaae6('0x54')]);_0x1eb318[_0xaae6('0x55')]=qs[_0xaae6('0x56')](_['pick'](_0x20ae88[_0xaae6('0x4b')],_0x59058d[_0xaae6('0x56')]));_0x1eb318[_0xaae6('0x55')][_0xaae6('0x6e')]=_0xeba86['id'];if(_0x20ae88['query']['filter']){_0x1eb318[_0xaae6('0x55')]=_[_0xaae6('0x59')](_0x1eb318[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x1eb318['attributes'],function(_0x4af02b){var _0x4d4506={};_0x4d4506[_0x4af02b]={'$like':'%'+_0x20ae88[_0xaae6('0x4b')]['filter']+'%'};return _0x4d4506;})});}_0x1eb318=_[_0xaae6('0x59')]({},_0x1eb318,_0x20ae88[_0xaae6('0x62')]);return db[_0xaae6('0xc1')][_0xaae6('0x35')]({'where':_0x1eb318[_0xaae6('0x55')]})[_0xaae6('0x26')](function(_0x142473){_0x269476[_0xaae6('0x35')]=_0x142473;if(_0x20ae88[_0xaae6('0x4b')][_0xaae6('0x5b')]){_0x1eb318['include']=[{'model':db[_0xaae6('0xa6')],'as':_0xaae6('0xef'),'required':![]},{'model':db[_0xaae6('0xcc')],'as':'Owner','attributes':[_0xaae6('0x42'),'fullname',_0xaae6('0xf0')],'required':![]},{'model':db[_0xaae6('0xf1')],'as':_0xaae6('0xf2'),'attributes':['id','name','color'],'where':_0x20ae88[_0xaae6('0x4b')]['tag']?{'id':_0x20ae88['query'][_0xaae6('0xf3')]}:undefined,'required':_0x20ae88[_0xaae6('0x4b')][_0xaae6('0xf3')]?!![]:![]}];}return db[_0xaae6('0xc1')][_0xaae6('0x5d')](_0x1eb318);})['then'](function(_0x4df80b){_0x269476[_0xaae6('0x72')]=_0x4df80b;return _0x269476;});}})[_0xaae6('0x26')](respondWithFilteredResult(_0x24182a,_0x1eb318))['catch'](handleError(_0x24182a,null));};function iftimePromise(_0x383ae0,_0x5a2dc2){return respondWithRpcPromise('Command',_0xaae6('0xf4'),{'command':_0x5a2dc2['timezone']?util[_0xaae6('0xb9')](_0xaae6('0xf5'),_0x383ae0[_0xaae6('0xf6')],_0x5a2dc2[_0xaae6('0xf7')]):util['format'](_0xaae6('0xf8'),_0x383ae0[_0xaae6('0xf6')])},client9002)[_0xaae6('0x26')](function(_0x1139c9){var _0x1283fa=_0x1139c9&&_0x1139c9[_0xaae6('0xf9')](_0xaae6('0xfa'))>=0x0?!![]:![];logger['info'](_0xaae6('0xfb'),_0x5a2dc2['id'],_0x383ae0['id'],_0x383ae0[_0xaae6('0xf6')],_0x1283fa?'ONLINE':_0xaae6('0xfc'),_0x5a2dc2[_0xaae6('0xf7')]?_0x5a2dc2[_0xaae6('0xf7')]:_0xaae6('0xfd'));return _0x1283fa;})[_0xaae6('0x30')](function(_0x35119e){logger['error'](_0xaae6('0xfb'),_0x5a2dc2['id'],_0x383ae0['id'],_0x383ae0[_0xaae6('0xf6')],util[_0xaae6('0xfe')](_0x35119e,{'showHidden':![],'depth':null}),_0x5a2dc2[_0xaae6('0xf7')]?_0x5a2dc2['timezone']:_0xaae6('0xfd'));return![];});}exports['getSnippet']=function(_0x411eea,_0x225711,_0x2bab77){var _0x6fa23a=0x0;var _0x3d3f1d=0x0;var _0x45f7e1=![];var _0x5b7b97;var _0x1b3631;return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x411eea[_0xaae6('0x5f')]['id']},'include':[{'model':db[_0xaae6('0xff')],'as':_0xaae6('0xff'),'include':[{'model':db[_0xaae6('0xff')],'as':'Intervals','attributes':['id',_0xaae6('0xf6')],'raw':!![]}]}]})['then'](handleEntityNotFound(_0x225711,null))['then'](function(_0x5c012f){if(_0x5c012f){_0x5b7b97=_0x5c012f;return _0x5c012f['getProactiveActions']({'raw':!![]});}})[_0xaae6('0x26')](function(_0x305721){if(_0x5b7b97){if(_0x305721){_0x1b3631=_0x305721;}}return require(_0xaae6('0x86'))['getLicense']();})['then'](function(_0x51a10b){if(_0x51a10b){_0x3d3f1d=_0x51a10b[_0xaae6('0x100')];_0x45f7e1=_0x51a10b[_0xaae6('0x101')];}})[_0xaae6('0x26')](function(){return db['ChatInteraction'][_0xaae6('0x35')]({'where':{'closed':![]}});})[_0xaae6('0x26')](function(_0x381fbb){_0x6fa23a=_0x381fbb;if(_0x3d3f1d&&_0x381fbb>_0x3d3f1d){return db[_0xaae6('0x102')][_0xaae6('0x70')]({'where':{'id':0x1}})['then'](function(_0x4d7743){if(_0x4d7743){_0x4d7743[_0xaae6('0x103')](_0xaae6('0x104'));}});}})[_0xaae6('0x26')](function(){if(_0x5b7b97[_0xaae6('0xff')]&&_0x5b7b97[_0xaae6('0xff')][_0xaae6('0x105')]){var _0x450bbc=[];for(var _0x321093=0x0;_0x321093<_0x5b7b97[_0xaae6('0xff')][_0xaae6('0x105')][_0xaae6('0x61')];_0x321093++){var _0x3b855e=_0x5b7b97['Interval'][_0xaae6('0x105')][_0x321093][_0xaae6('0x3e')]({'plain':!![]});_0x450bbc[_0xaae6('0xc7')](iftimePromise(_0x3b855e,_0x5b7b97));}return BPromise['all'](_0x450bbc)['then'](function(_0x2d14df){return _[_0xaae6('0x106')](_0x2d14df);});}else{return!![];}})[_0xaae6('0x26')](function(_0x5545ff){var _0x389200=fs[_0xaae6('0xdb')](path[_0xaae6('0x83')](config[_0xaae6('0x84')],_0xaae6('0x107')),_0xaae6('0x108'));var _0xbde799={'remote':_0x5b7b97[_0xaae6('0x109')],'query':querystring[_0xaae6('0x10a')](_[_0xaae6('0x59')](_0x5b7b97[_0xaae6('0x3e')]({'plain':!![]}),{'customerIp':_0x411eea['headers']['x-forwarded-for']||_0x411eea[_0xaae6('0x95')][_0xaae6('0x10b')]||_0x411eea[_0xaae6('0x10c')][_0xaae6('0x10d')]||_0x411eea['ip'],'referer':_0x411eea[_0xaae6('0x95')][_0xaae6('0xb6')],'openedInteractions':_0x6fa23a,'maxInteractions':_0x3d3f1d,'virtual':_0x45f7e1[_0xaae6('0x100')],'online':_0x5545ff,'custom':_0x45f7e1}))['replace'](/'/g,'\x5c\x27')};_0x225711[_0xaae6('0xd6')](ejs[_0xaae6('0xdd')](Mustache[_0xaae6('0xdd')](_0x389200,_0xbde799),{'proactiveActions':_0x1b3631,'alignment':_0x5b7b97[_0xaae6('0x10e')],'verticalAlignment':_0x5b7b97['verticalAlignment'],'div_color':_0x5b7b97[_0xaae6('0x10f')],'text_color':_0x5b7b97[_0xaae6('0x110')]}));})[_0xaae6('0x30')](handleError(_0x225711,null));};exports['addApplications']=function(_0x57f503,_0x502ff6,_0xe4e1d8){return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x57f503['params']['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x502ff6,null))['then'](function(_0xde6aa5){if(_0xde6aa5){return db[_0xaae6('0x111')][_0xaae6('0x112')](function(_0x1bbb7a){return db[_0xaae6('0xa9')][_0xaae6('0x3d')]({'where':{'ChatWebsiteId':_0x57f503[_0xaae6('0x5f')]['id']},'transaction':_0x1bbb7a})[_0xaae6('0x26')](function(_0x1999f7){var _0x56df28=_['map'](_0x57f503[_0xaae6('0x65')],function(_0x37c0a4){_0x37c0a4['ChatWebsiteId']=_0x57f503[_0xaae6('0x5f')]['id'];return _0x37c0a4;});return db[_0xaae6('0xa9')][_0xaae6('0x113')](_0x56df28,{'transaction':_0x1bbb7a});});})[_0xaae6('0x26')](function(){return db['ChatApplication'][_0xaae6('0x114')]({'where':{'ChatWebsiteId':_0x57f503[_0xaae6('0x5f')]['id']},'order':'priority'});});}})[_0xaae6('0x26')](respondWithResult(_0x502ff6,null))[_0xaae6('0x30')](handleError(_0x502ff6,null));};exports[_0xaae6('0x115')]=function(_0x414bee,_0x46c9fc,_0x1b5885){var _0x63cdda={};var _0x2cd402={};var _0x2cfc4d;var _0x43a6cf;return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x414bee['params']['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x46c9fc,null))['then'](function(_0x37e312){if(_0x37e312){_0x2cfc4d=_0x37e312;_0x2cd402[_0xaae6('0x4a')]=_[_0xaae6('0x4c')](db[_0xaae6('0xa9')][_0xaae6('0x47')]);_0x2cd402['query']=_[_0xaae6('0x4c')](_0x414bee[_0xaae6('0x4b')]);_0x2cd402['filters']=_[_0xaae6('0x4e')](_0x2cd402[_0xaae6('0x4a')],_0x2cd402[_0xaae6('0x4b')]);_0x63cdda['attributes']=_[_0xaae6('0x4e')](_0x2cd402[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x414bee[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x63cdda['attributes']=_0x63cdda['attributes'][_0xaae6('0x61')]?_0x63cdda[_0xaae6('0x4d')]:_0x2cd402[_0xaae6('0x4a')];_0x63cdda['order']=qs[_0xaae6('0x54')](_0x414bee[_0xaae6('0x4b')]['sort']);_0x63cdda['where']=qs[_0xaae6('0x56')](_['pick'](_0x414bee[_0xaae6('0x4b')],_0x2cd402[_0xaae6('0x56')]));if(_0x414bee[_0xaae6('0x4b')]['filter']){_0x63cdda['where']=_[_0xaae6('0x59')](_0x63cdda[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x63cdda[_0xaae6('0x4d')],function(_0x20cc33){var _0x103774={};_0x103774[_0x20cc33]={'$like':'%'+_0x414bee['query']['filter']+'%'};return _0x103774;})});}_0x63cdda=_['merge']({},_0x63cdda,_0x414bee[_0xaae6('0x62')]);return _0x2cfc4d[_0xaae6('0x115')](_0x63cdda);}})[_0xaae6('0x26')](function(_0x32d22e){if(_0x32d22e){_0x43a6cf=_0x32d22e[_0xaae6('0x61')];if(!_0x414bee[_0xaae6('0x4b')][_0xaae6('0x50')]('nolimit')){_0x63cdda[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0x414bee[_0xaae6('0x4b')][_0xaae6('0x52')]);_0x63cdda[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x414bee[_0xaae6('0x4b')]['offset']);}return _0x2cfc4d['getApplications'](_0x63cdda);}})[_0xaae6('0x26')](function(_0x360ae1){if(_0x360ae1){return _0x360ae1?{'count':_0x43a6cf,'rows':_0x360ae1}:null;}})[_0xaae6('0x26')](respondWithResult(_0x46c9fc,null))[_0xaae6('0x30')](handleError(_0x46c9fc,null));};exports[_0xaae6('0x116')]=function(_0x3f6040,_0x5237e0,_0x574b2d){return db[_0xaae6('0x117')]['find']({'where':{'id':_0x3f6040['params']['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x5237e0,null))[_0xaae6('0x26')](function(_0x188081){if(_0x188081){return _0x188081[_0xaae6('0x116')](_0x3f6040['body'][_0xaae6('0x74')],_[_0xaae6('0x118')](_0x3f6040[_0xaae6('0x65')],[_0xaae6('0x74'),'id'])||{});}})[_0xaae6('0x26')](respondWithResult(_0x5237e0,null))['catch'](handleError(_0x5237e0,null));};exports[_0xaae6('0x119')]=function(_0x3a8bfa,_0x1954c5,_0x32b81){var _0x3e8116={};var _0x1a0350={};var _0x3a3ed1;var _0x535be7;return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x3a8bfa['params']['id']}})['then'](handleEntityNotFound(_0x1954c5,null))['then'](function(_0x2f99a5){if(_0x2f99a5){_0x3a3ed1=_0x2f99a5;_0x1a0350[_0xaae6('0x4a')]=_[_0xaae6('0x4c')](db[_0xaae6('0x11a')][_0xaae6('0x47')]);_0x1a0350[_0xaae6('0x4b')]=_['keys'](_0x3a8bfa[_0xaae6('0x4b')]);_0x1a0350[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0x1a0350['model'],_0x1a0350[_0xaae6('0x4b')]);_0x3e8116[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x1a0350[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x3a8bfa[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x3e8116[_0xaae6('0x4d')]=_0x3e8116[_0xaae6('0x4d')]['length']?_0x3e8116[_0xaae6('0x4d')]:_0x1a0350[_0xaae6('0x4a')];_0x3e8116['order']=qs[_0xaae6('0x54')](_0x3a8bfa['query']['sort']);_0x3e8116[_0xaae6('0x55')]=qs['filters'](_[_0xaae6('0x57')](_0x3a8bfa[_0xaae6('0x4b')],_0x1a0350['filters']));if(_0x3a8bfa[_0xaae6('0x4b')][_0xaae6('0x58')]){_0x3e8116[_0xaae6('0x55')]=_[_0xaae6('0x59')](_0x3e8116[_0xaae6('0x55')],{'$or':_['map'](_0x3e8116[_0xaae6('0x4d')],function(_0x575682){var _0x1bfbca={};_0x1bfbca[_0x575682]={'$like':'%'+_0x3a8bfa['query'][_0xaae6('0x58')]+'%'};return _0x1bfbca;})});}_0x3e8116=_[_0xaae6('0x59')]({},_0x3e8116,_0x3a8bfa[_0xaae6('0x62')]);return _0x3a3ed1[_0xaae6('0x119')](_0x3e8116);}})[_0xaae6('0x26')](function(_0x22f892){if(_0x22f892){_0x535be7=_0x22f892['length'];if(!_0x3a8bfa[_0xaae6('0x4b')][_0xaae6('0x50')](_0xaae6('0x51'))){_0x3e8116[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0x3a8bfa[_0xaae6('0x4b')]['limit']);_0x3e8116[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x3a8bfa[_0xaae6('0x4b')][_0xaae6('0x36')]);}return _0x3a3ed1['getProactiveActions'](_0x3e8116);}})[_0xaae6('0x26')](function(_0x3760cf){if(_0x3760cf){return _0x3760cf?{'count':_0x535be7,'rows':_0x3760cf}:null;}})[_0xaae6('0x26')](respondWithResult(_0x1954c5,null))[_0xaae6('0x30')](handleError(_0x1954c5,null));};exports['getFields']=function(_0x1e9a29,_0x58dd95,_0x50e9cc){var _0x5924b9=_0x1e9a29[_0xaae6('0x4b')][_0xaae6('0x11b')]===_0xaae6('0x11c')?_0xaae6('0x11d'):_0xaae6('0x11e');return db['ChatWebsite'][_0xaae6('0x63')]({'attributes':['id',_0x5924b9],'where':{'id':_0x1e9a29[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x58dd95,null))[_0xaae6('0x26')](function(_0x486552){if(_0x486552){var _0x270256=_0x486552[_0x5924b9];var _0x51c648=_0x270256&&_0x270256[_0xaae6('0x11f')]?_0x270256[_0xaae6('0x11f')]:[];_0x58dd95[_0xaae6('0xd6')]({'fromKey':_['isNil'](_0x270256[_0xaae6('0x120')])?undefined:_0x270256['fromKey'],'count':_0x51c648[_0xaae6('0x61')],'rows':_0x51c648});}})['catch'](handleError(_0x58dd95,null));};exports[_0xaae6('0x121')]=function(_0x1a5e43,_0x229a8c,_0x332966){var _0x55fb2b={'raw':![],'where':{}};var _0x170085={};var _0x58e044={'count':0x0,'rows':[]};return db[_0xaae6('0x46')]['findOne']({'where':{'id':_0x1a5e43['params']['id']}})['then'](handleEntityNotFound(_0x229a8c,null))[_0xaae6('0x26')](function(_0x431616){if(_0x431616){_0x170085['model']=_[_0xaae6('0x4c')](db[_0xaae6('0xe0')][_0xaae6('0x47')]);_0x170085[_0xaae6('0x4b')]=_['keys'](_0x1a5e43[_0xaae6('0x4b')]);_0x170085[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0x170085[_0xaae6('0x4a')],_0x170085[_0xaae6('0x4b')]);_0x55fb2b[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0x170085[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x55fb2b[_0xaae6('0x4d')]=_0x55fb2b[_0xaae6('0x4d')][_0xaae6('0x61')]?_0x55fb2b[_0xaae6('0x4d')]:_0x170085[_0xaae6('0x4a')];if(!_0x1a5e43['query'][_0xaae6('0x50')](_0xaae6('0x51'))){_0x55fb2b['limit']=qs[_0xaae6('0x52')](_0x1a5e43['query']['limit']);_0x55fb2b[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x36')]);}_0x55fb2b['order']=qs['sort'](_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x54')]);_0x55fb2b['where']=qs[_0xaae6('0x56')](_[_0xaae6('0x57')](_0x1a5e43['query'],_0x170085[_0xaae6('0x56')]));_0x55fb2b[_0xaae6('0x55')][_0xaae6('0x6e')]=_0x431616['id'];if(_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x58')]){_0x55fb2b['where']=_['merge'](_0x55fb2b[_0xaae6('0x55')],{'$or':_[_0xaae6('0x45')](_0x55fb2b[_0xaae6('0x4d')],function(_0x46619c){var _0x5c7430={};_0x5c7430[_0x46619c]={'$like':'%'+_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x58')]+'%'};return _0x5c7430;})});}_0x55fb2b=_['merge']({},_0x55fb2b,_0x1a5e43[_0xaae6('0x62')]);return db['ChatOfflineMessage'][_0xaae6('0x35')]({'where':_0x55fb2b[_0xaae6('0x55')]})[_0xaae6('0x26')](function(_0x7a53f6){_0x58e044[_0xaae6('0x35')]=_0x7a53f6;if(_0x1a5e43[_0xaae6('0x4b')][_0xaae6('0x5b')]){_0x55fb2b[_0xaae6('0x5c')]=[{'all':!![]}];}else{_0x55fb2b['include']=[{'model':db[_0xaae6('0xa6')],'as':_0xaae6('0xef'),'required':![]}];}return db['ChatOfflineMessage'][_0xaae6('0x5d')](_0x55fb2b);})[_0xaae6('0x26')](function(_0x442485){_0x58e044[_0xaae6('0x72')]=_0x442485;return _0x58e044;});}})[_0xaae6('0x26')](respondWithFilteredResult(_0x229a8c,_0x55fb2b))[_0xaae6('0x30')](handleError(_0x229a8c,null));};exports['addAgents']=function(_0x428713,_0x3faf74,_0x331471){return db[_0xaae6('0x46')][_0xaae6('0x63')]({'where':{'id':_0x428713[_0xaae6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x3faf74,null))[_0xaae6('0x26')](function(_0x39cee1){if(_0x39cee1){return _0x39cee1[_0xaae6('0x122')](_0x428713[_0xaae6('0x65')][_0xaae6('0x74')],_[_0xaae6('0x118')](_0x428713['body'],[_0xaae6('0x74'),'id'])||{})[_0xaae6('0xc3')](function(_0x86b079){for(var _0x444871=0x0;_0x444871<_0x428713[_0xaae6('0x65')][_0xaae6('0x74')]['length'];_0x444871+=0x1){socket['emit'](_0xaae6('0x123'),{'UserId':_0x428713[_0xaae6('0x65')][_0xaae6('0x74')][_0x444871],'ChatWebsiteId':_0x428713[_0xaae6('0x5f')]['id']});}return _0x86b079;});}})[_0xaae6('0x26')](respondWithResult(_0x3faf74,null))[_0xaae6('0x30')](handleError(_0x3faf74,null));};exports['removeAgents']=function(_0x45a6a5,_0x271d1b,_0x141d33){return db['ChatWebsite'][_0xaae6('0x63')]({'where':{'id':_0x45a6a5[_0xaae6('0x5f')]['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x271d1b,null))[_0xaae6('0x26')](function(_0x4da0b3){if(_0x4da0b3){return _0x4da0b3[_0xaae6('0x124')](_0x45a6a5[_0xaae6('0x4b')][_0xaae6('0x74')])[_0xaae6('0x26')](function(){if(_['isArray'](_0x45a6a5[_0xaae6('0x4b')][_0xaae6('0x74')])){for(var _0x17a2e7=0x0;_0x17a2e7<_0x45a6a5['query'][_0xaae6('0x74')]['length'];_0x17a2e7+=0x1){socket[_0xaae6('0x125')]('userChatWebsite:remove',{'UserId':Number(_0x45a6a5[_0xaae6('0x4b')]['ids'][_0x17a2e7]),'ChatWebsiteId':Number(_0x45a6a5[_0xaae6('0x5f')]['id'])});}}else{socket['emit']('userChatWebsite:remove',{'UserId':Number(_0x45a6a5['query'][_0xaae6('0x74')]),'ChatWebsiteId':Number(_0x45a6a5[_0xaae6('0x5f')]['id'])});}});}})['then'](respondWithStatusCode(_0x271d1b,null))[_0xaae6('0x30')](handleError(_0x271d1b,null));};exports['getAgents']=function(_0x5d8697,_0x48dce4,_0x51ee4e){var _0x33701e={};var _0xf01526={};var _0x7df991;var _0x155340;return db[_0xaae6('0x46')][_0xaae6('0x70')]({'where':{'id':_0x5d8697['params']['id']}})[_0xaae6('0x26')](handleEntityNotFound(_0x48dce4,null))['then'](function(_0x26fa47){if(_0x26fa47){_0x7df991=_0x26fa47;_0xf01526[_0xaae6('0x4a')]=_[_0xaae6('0x4c')](db['User'][_0xaae6('0x47')]);_0xf01526[_0xaae6('0x4b')]=_[_0xaae6('0x4c')](_0x5d8697[_0xaae6('0x4b')]);_0xf01526[_0xaae6('0x56')]=_[_0xaae6('0x4e')](_0xf01526[_0xaae6('0x4a')],_0xf01526[_0xaae6('0x4b')]);_0x33701e[_0xaae6('0x4d')]=_[_0xaae6('0x4e')](_0xf01526[_0xaae6('0x4a')],qs[_0xaae6('0x4f')](_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x4f')]));_0x33701e['attributes']=_0x33701e[_0xaae6('0x4d')]['length']?_0x33701e[_0xaae6('0x4d')]:_0xf01526[_0xaae6('0x4a')];_0x33701e[_0xaae6('0x53')]=qs['sort'](_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x54')]);_0x33701e['where']=qs['filters'](_[_0xaae6('0x57')](_0x5d8697[_0xaae6('0x4b')],_0xf01526[_0xaae6('0x56')]));if(_0x5d8697[_0xaae6('0x4b')]['filter']){_0x33701e['where']=_['merge'](_0x33701e['where'],{'$or':_[_0xaae6('0x45')](_0x33701e[_0xaae6('0x4d')],function(_0x27d168){var _0x13a263={};_0x13a263[_0x27d168]={'$like':'%'+_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x58')]+'%'};return _0x13a263;})});}_0x33701e=_[_0xaae6('0x59')]({},_0x33701e,_0x5d8697[_0xaae6('0x62')]);return _0x7df991[_0xaae6('0x126')](_0x33701e);}})[_0xaae6('0x26')](function(_0x1f7dc2){if(_0x1f7dc2){_0x155340=_0x1f7dc2[_0xaae6('0x61')];if(!_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x50')]('nolimit')){_0x33701e[_0xaae6('0x52')]=qs[_0xaae6('0x52')](_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x52')]);_0x33701e[_0xaae6('0x36')]=qs[_0xaae6('0x36')](_0x5d8697[_0xaae6('0x4b')][_0xaae6('0x36')]);}return _0x7df991[_0xaae6('0x126')](_0x33701e);}})[_0xaae6('0x26')](function(_0x4fb931){if(_0x4fb931){return _0x4fb931?{'count':_0x155340,'rows':_0x4fb931}:null;}})[_0xaae6('0x26')](respondWithResult(_0x48dce4,null))[_0xaae6('0x30')](handleError(_0x48dce4,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 9ca367a..240489c 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 _0x177a=['remove','emit','hasOwnProperty','hook','exports','events','setMaxListeners','save','update'];(function(_0x5f31e9,_0xf44932){var _0x165bed=function(_0xfa0e79){while(--_0xfa0e79){_0x5f31e9['push'](_0x5f31e9['shift']());}};_0x165bed(++_0xf44932);}(_0x177a,0xdd));var _0xa177=function(_0x11e491,_0x156010){_0x11e491=_0x11e491-0x0;var _0x18f3d3=_0x177a[_0x11e491];return _0x18f3d3;};'use strict';var EventEmitter=require(_0xa177('0x0'));var ChatWebsite=require('../../mysqldb')['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xa177('0x1')](0x0);var events={'afterCreate':_0xa177('0x2'),'afterUpdate':_0xa177('0x3'),'afterDestroy':_0xa177('0x4')};function emitEvent(_0x4275db){return function(_0x471a81,_0x5ce1ad,_0x243aee){ChatWebsiteEvents[_0xa177('0x5')](_0x4275db+':'+_0x471a81['id'],_0x471a81);ChatWebsiteEvents[_0xa177('0x5')](_0x4275db,_0x471a81);_0x243aee(null);};}for(var e in events){if(events[_0xa177('0x6')](e)){var event=events[e];ChatWebsite[_0xa177('0x7')](e,emitEvent(event));}}module[_0xa177('0x8')]=ChatWebsiteEvents; \ No newline at end of file +var _0x7dbc=['hasOwnProperty','hook','events','../../mysqldb','setMaxListeners','save','update'];(function(_0x3715eb,_0x2f8a9e){var _0x136afc=function(_0x1a92ce){while(--_0x1a92ce){_0x3715eb['push'](_0x3715eb['shift']());}};_0x136afc(++_0x2f8a9e);}(_0x7dbc,0xe2));var _0xc7db=function(_0x24a2b1,_0x420d5f){_0x24a2b1=_0x24a2b1-0x0;var _0x2a7ef8=_0x7dbc[_0x24a2b1];return _0x2a7ef8;};'use strict';var EventEmitter=require(_0xc7db('0x0'));var ChatWebsite=require(_0xc7db('0x1'))['db']['ChatWebsite'];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0xc7db('0x2')](0x0);var events={'afterCreate':_0xc7db('0x3'),'afterUpdate':_0xc7db('0x4'),'afterDestroy':'remove'};function emitEvent(_0x147390){return function(_0x29bda9,_0x1ea8cb,_0x3ac2bc){ChatWebsiteEvents['emit'](_0x147390+':'+_0x29bda9['id'],_0x29bda9);ChatWebsiteEvents['emit'](_0x147390,_0x29bda9);_0x3ac2bc(null);};}for(var e in events){if(events[_0xc7db('0x5')](e)){var event=events[e];ChatWebsite[_0xc7db('0x6')](e,emitEvent(event));}}module['exports']=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index a2331a2..87dd3b0 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 _0x2bc6=['./chatWebsite.attributes','define','ChatWebsite','chat_websites','lodash','util','../../config/logger','path','../../config/environment'];(function(_0x62c958,_0x2bfdbc){var _0x57ec61=function(_0x5c0094){while(--_0x5c0094){_0x62c958['push'](_0x62c958['shift']());}};_0x57ec61(++_0x2bfdbc);}(_0x2bc6,0x163));var _0x62bc=function(_0x50e89b,_0x4bded8){_0x50e89b=_0x50e89b-0x0;var _0x4b9202=_0x2bc6[_0x50e89b];return _0x4b9202;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var logger=require(_0x62bc('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x62bc('0x3'));var rimraf=require('rimraf');var config=require(_0x62bc('0x4'));var attributes=require(_0x62bc('0x5'));module['exports']=function(_0x3cce26,_0x450cb6){return _0x3cce26[_0x62bc('0x6')](_0x62bc('0x7'),attributes,{'tableName':_0x62bc('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6324=['define','chat_websites','lodash','util','../../config/logger','api','bluebird','path','../../config/environment','exports'];(function(_0x73a500,_0x323fb2){var _0x845402=function(_0x7a9534){while(--_0x7a9534){_0x73a500['push'](_0x73a500['shift']());}};_0x845402(++_0x323fb2);}(_0x6324,0x142));var _0x4632=function(_0x1cd3e3,_0xbeb106){_0x1cd3e3=_0x1cd3e3-0x0;var _0x4a3336=_0x6324[_0x1cd3e3];return _0x4a3336;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var logger=require(_0x4632('0x2'))(_0x4632('0x3'));var moment=require('moment');var BPromise=require(_0x4632('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4632('0x5'));var rimraf=require('rimraf');var config=require(_0x4632('0x6'));var attributes=require('./chatWebsite.attributes');module[_0x4632('0x7')]=function(_0x24aba6,_0x1f3077){return _0x24aba6[_0x4632('0x8')]('ChatWebsite',attributes,{'tableName':_0x4632('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index 580b5cd..e6de153 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 _0x5fab=['request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','ChatWebsite,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','defaults','redis','localhost','./chatWebsite.socket','register'];(function(_0x5ad220,_0x27407e){var _0xdec77d=function(_0x58d736){while(--_0x58d736){_0x5ad220['push'](_0x5ad220['shift']());}};_0xdec77d(++_0x27407e);}(_0x5fab,0x177));var _0xb5fa=function(_0x5180c3,_0x4b35f7){_0x5180c3=_0x5180c3-0x0;var _0x55c975=_0x5fab[_0x5180c3];return _0x55c975;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require('moment');var BPromise=require(_0xb5fa('0x2'));var rs=require(_0xb5fa('0x3'));var fs=require('fs');var Redis=require(_0xb5fa('0x4'));var db=require(_0xb5fa('0x5'))['db'];var utils=require(_0xb5fa('0x6'));var logger=require(_0xb5fa('0x7'))(_0xb5fa('0x8'));var config=require(_0xb5fa('0x9'));var jayson=require(_0xb5fa('0xa'));var client=jayson[_0xb5fa('0xb')]['http']({'port':0x232a});config['redis']=_[_0xb5fa('0xc')](config[_0xb5fa('0xd')],{'host':_0xb5fa('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xb5fa('0xd')]));require(_0xb5fa('0xf'))[_0xb5fa('0x10')](socket);function respondWithRpcPromise(_0x54c7eb,_0x5b5ea8,_0x3a8e1b){return new BPromise(function(_0x23d124,_0xe46b26){return client[_0xb5fa('0x11')](_0x54c7eb,_0x3a8e1b)[_0xb5fa('0x12')](function(_0xadef41){logger[_0xb5fa('0x13')](_0xb5fa('0x14'),_0x5b5ea8,_0xb5fa('0x15'));logger['debug'](_0xb5fa('0x16'),_0x5b5ea8,_0xb5fa('0x15'),JSON['stringify'](_0xadef41));if(_0xadef41[_0xb5fa('0x17')]){if(_0xadef41['error'][_0xb5fa('0x18')]===0x1f4){logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0xadef41[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0xe46b26(_0xadef41['error']['message']);}logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0xadef41[_0xb5fa('0x17')][_0xb5fa('0x19')]);return _0x23d124(_0xadef41['error']['message']);}else{logger[_0xb5fa('0x13')](_0xb5fa('0x14'),_0x5b5ea8,_0xb5fa('0x15'));_0x23d124(_0xadef41[_0xb5fa('0x1a')][_0xb5fa('0x19')]);}})[_0xb5fa('0x1b')](function(_0x3b0f69){logger[_0xb5fa('0x17')](_0xb5fa('0x14'),_0x5b5ea8,_0x3b0f69);_0xe46b26(_0x3b0f69);});});} \ No newline at end of file +var _0xfcf0=['ChatWebsite,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error','code'];(function(_0x44dc4c,_0x357e6a){var _0x4e644e=function(_0x2f033e){while(--_0x2f033e){_0x44dc4c['push'](_0x44dc4c['shift']());}};_0x4e644e(++_0x357e6a);}(_0xfcf0,0x138));var _0x0fcf=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0xfcf0[_0x2074db];return _0x27324c;};'use strict';var _=require(_0x0fcf('0x0'));var util=require(_0x0fcf('0x1'));var moment=require('moment');var BPromise=require(_0x0fcf('0x2'));var rs=require(_0x0fcf('0x3'));var fs=require('fs');var Redis=require(_0x0fcf('0x4'));var db=require(_0x0fcf('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0fcf('0x6'))(_0x0fcf('0x7'));var config=require(_0x0fcf('0x8'));var jayson=require(_0x0fcf('0x9'));var client=jayson[_0x0fcf('0xa')][_0x0fcf('0xb')]({'port':0x232a});config[_0x0fcf('0xc')]=_[_0x0fcf('0xd')](config['redis'],{'host':_0x0fcf('0xe'),'port':0x18eb});var socket=require(_0x0fcf('0xf'))(new Redis(config[_0x0fcf('0xc')]));require('./chatWebsite.socket')[_0x0fcf('0x10')](socket);function respondWithRpcPromise(_0x7ac7bd,_0x239e5d,_0x4b3923){return new BPromise(function(_0x369959,_0x5c29ed){return client[_0x0fcf('0x11')](_0x7ac7bd,_0x4b3923)[_0x0fcf('0x12')](function(_0x201a58){logger['info']('ChatWebsite,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'));logger[_0x0fcf('0x14')]('ChatWebsite,\x20%s,\x20%s,\x20%s',_0x239e5d,_0x0fcf('0x13'),JSON[_0x0fcf('0x15')](_0x201a58));if(_0x201a58[_0x0fcf('0x16')]){if(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x17')]===0x1f4){logger['error'](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);return _0x5c29ed(_0x201a58['error'][_0x0fcf('0x19')]);}logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x201a58[_0x0fcf('0x16')]['message']);return _0x369959(_0x201a58[_0x0fcf('0x16')][_0x0fcf('0x19')]);}else{logger[_0x0fcf('0x1a')](_0x0fcf('0x18'),_0x239e5d,_0x0fcf('0x13'));_0x369959(_0x201a58['result'][_0x0fcf('0x19')]);}})[_0x0fcf('0x1b')](function(_0x5dad87){logger[_0x0fcf('0x16')](_0x0fcf('0x18'),_0x239e5d,_0x5dad87);_0x5c29ed(_0x5dad87);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index cc86581..eeaab68 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 _0xb10b=['emit','removeListener','register','chatWebsite:','./chatWebsite.events','remove','update'];(function(_0xdb8c35,_0x49387e){var _0x3636f6=function(_0x30e5e8){while(--_0x30e5e8){_0xdb8c35['push'](_0xdb8c35['shift']());}};_0x3636f6(++_0x49387e);}(_0xb10b,0x12a));var _0xbb10=function(_0x4fcbec,_0x90e467){_0x4fcbec=_0x4fcbec-0x0;var _0x275177=_0xb10b[_0x4fcbec];return _0x275177;};'use strict';var ChatWebsiteEvents=require(_0xbb10('0x0'));var events=['save',_0xbb10('0x1'),_0xbb10('0x2')];function createListener(_0x1dcb08,_0x4d688c){return function(_0x4541ae){_0x4d688c[_0xbb10('0x3')](_0x1dcb08,_0x4541ae);};}function removeListener(_0x460981,_0x22320e){return function(){ChatWebsiteEvents[_0xbb10('0x4')](_0x460981,_0x22320e);};}exports[_0xbb10('0x5')]=function(_0x481979){for(var _0x328583=0x0,_0x3cdd53=events['length'];_0x328583<_0x3cdd53;_0x328583++){var _0x1b9e94=events[_0x328583];var _0x3fb675=createListener(_0xbb10('0x6')+_0x1b9e94,_0x481979);ChatWebsiteEvents['on'](_0x1b9e94,_0x3fb675);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x46cb12,_0x488fa1){var _0x29fa4d=function(_0xe95109){while(--_0xe95109){_0x46cb12['push'](_0x46cb12['shift']());}};_0x29fa4d(++_0x488fa1);}(_0x7a54,0x106));var _0x47a5=function(_0x12a488,_0x379557){_0x12a488=_0x12a488-0x0;var _0x532056=_0x7a54[_0x12a488];return _0x532056;};'use strict';var ChatWebsiteEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){ChatWebsiteEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);ChatWebsiteEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index a36a8b8..d75dfd1 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 _0x2db7=['addAvatar','server/files/images/avatars/','now','addCustomerAvatar','addSystemAvatar','/:id/notify','addInteraction','addApplications','addAgents','put','/:id','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','describe','/:id/dispositions','getDispositions','/:id/canned_answers','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','/:id/interactions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','create','post','addDisposition','addAnswer','diskStorage','root','%s-%s','originalname','single','file','addLogo','join','format'];(function(_0x3f5ff2,_0x1c225f){var _0x2675ac=function(_0x2ed7ab){while(--_0x2ed7ab){_0x3f5ff2['push'](_0x3f5ff2['shift']());}};_0x2675ac(++_0x1c225f);}(_0x2db7,0x89));var _0x72db=function(_0x384898,_0x147e51){_0x384898=_0x384898-0x0;var _0x270b4c=_0x2db7[_0x384898];return _0x270b4c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x72db('0x0'));var timeout=require(_0x72db('0x1'));var express=require(_0x72db('0x2'));var router=express[_0x72db('0x3')]();var auth=require(_0x72db('0x4'));var interaction=require(_0x72db('0x5'));var config=require(_0x72db('0x6'));var controller=require(_0x72db('0x7'));router[_0x72db('0x8')]('/',auth[_0x72db('0x9')](),controller['index']);router[_0x72db('0x8')]('/describe',auth[_0x72db('0x9')](),controller[_0x72db('0xa')]);router['get']('/:id',auth[_0x72db('0x9')](),controller['show']);router[_0x72db('0x8')](_0x72db('0xb'),auth['isAuthenticated'](),controller[_0x72db('0xc')]);router['get'](_0x72db('0xd'),auth[_0x72db('0x9')](),controller['getAnswers']);router[_0x72db('0x8')]('/:id/logo',controller[_0x72db('0xe')]);router[_0x72db('0x8')](_0x72db('0xf'),controller[_0x72db('0x10')]);router['get'](_0x72db('0x11'),controller['getCustomerAvatar']);router[_0x72db('0x8')](_0x72db('0x12'),controller['getSystemAvatar']);router[_0x72db('0x8')](_0x72db('0x13'),auth[_0x72db('0x9')](),controller['getInteractions']);router[_0x72db('0x8')](_0x72db('0x14'),controller[_0x72db('0x15')]);router['get'](_0x72db('0x16'),auth[_0x72db('0x9')](),controller[_0x72db('0x17')]);router[_0x72db('0x8')](_0x72db('0x18'),auth[_0x72db('0x9')](),controller[_0x72db('0x19')]);router[_0x72db('0x8')](_0x72db('0x1a'),controller[_0x72db('0x1b')]);router[_0x72db('0x8')](_0x72db('0x1c'),auth[_0x72db('0x9')](),controller['getOfflineMessages']);router[_0x72db('0x8')](_0x72db('0x1d'),auth[_0x72db('0x9')](),controller['getAgents']);router['post']('/',auth[_0x72db('0x9')](),controller[_0x72db('0x1e')]);router[_0x72db('0x1f')]('/:id/dispositions',auth[_0x72db('0x9')](),controller[_0x72db('0x20')]);router[_0x72db('0x1f')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x72db('0x21')]);var upload=multer({'storage':multer[_0x72db('0x22')]({'destination':function(_0x42a63a,_0x32ca3a,_0x53ec1b){_0x53ec1b(null,path['join'](config[_0x72db('0x23')],'server/files/images/logos/'));},'filename':function(_0x2d6c5a,_0x581621,_0x3d377c){_0x3d377c(null,util['format'](_0x72db('0x24'),Date['now'](),_0x581621[_0x72db('0x25')]));}})});router['post']('/:id/logo',upload[_0x72db('0x26')](_0x72db('0x27')),controller[_0x72db('0x28')]);var upload=multer({'storage':multer[_0x72db('0x22')]({'destination':function(_0x17e9dc,_0x15092a,_0x530d8a){_0x530d8a(null,path[_0x72db('0x29')](config[_0x72db('0x23')],'server/files/images/avatars/'));},'filename':function(_0x1745df,_0x108a5d,_0x49ba4c){_0x49ba4c(null,util[_0x72db('0x2a')](_0x72db('0x24'),Date['now'](),_0x108a5d[_0x72db('0x25')]));}})});router[_0x72db('0x1f')](_0x72db('0xf'),upload[_0x72db('0x26')](_0x72db('0x27')),controller[_0x72db('0x2b')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1ebdca,_0xd685,_0xe8a25){_0xe8a25(null,path['join'](config[_0x72db('0x23')],_0x72db('0x2c')));},'filename':function(_0x5e5886,_0x5e68a6,_0x55932e){_0x55932e(null,util[_0x72db('0x2a')]('%s-%s',Date[_0x72db('0x2d')](),_0x5e68a6[_0x72db('0x25')]));}})});router[_0x72db('0x1f')](_0x72db('0x11'),upload[_0x72db('0x26')](_0x72db('0x27')),controller[_0x72db('0x2e')]);var upload=multer({'storage':multer[_0x72db('0x22')]({'destination':function(_0x3a831a,_0x194096,_0x119565){_0x119565(null,path['join'](config[_0x72db('0x23')],_0x72db('0x2c')));},'filename':function(_0x11ddd1,_0x165840,_0x14a0cf){_0x14a0cf(null,util[_0x72db('0x2a')](_0x72db('0x24'),Date['now'](),_0x165840[_0x72db('0x25')]));}})});router[_0x72db('0x1f')](_0x72db('0x12'),upload['single'](_0x72db('0x27')),controller[_0x72db('0x2f')]);router[_0x72db('0x1f')](_0x72db('0x30'),controller['notify']);router['post']('/:id/offline',controller['offline']);router[_0x72db('0x1f')](_0x72db('0x13'),auth['isAuthenticated'](),controller[_0x72db('0x31')]);router[_0x72db('0x1f')](_0x72db('0x16'),auth[_0x72db('0x9')](),controller[_0x72db('0x32')]);router[_0x72db('0x1f')](_0x72db('0x18'),auth[_0x72db('0x9')](),controller['addProactiveActions']);router[_0x72db('0x1f')](_0x72db('0x1d'),auth[_0x72db('0x9')](),controller[_0x72db('0x33')]);router[_0x72db('0x34')](_0x72db('0x35'),auth[_0x72db('0x9')](),controller[_0x72db('0x36')]);router[_0x72db('0x37')](_0x72db('0x35'),auth[_0x72db('0x9')](),controller[_0x72db('0x38')]);router[_0x72db('0x37')](_0x72db('0xb'),auth[_0x72db('0x9')](),controller[_0x72db('0x39')]);router[_0x72db('0x37')]('/:id/canned_answers',auth[_0x72db('0x9')](),controller[_0x72db('0x3a')]);router['delete']('/:id/users',auth[_0x72db('0x9')](),controller[_0x72db('0x3b')]);module['exports']=router; \ No newline at end of file +var _0x25d4=['getOfflineMessages','/:id/users','getAgents','create','post','addDisposition','diskStorage','root','server/files/images/logos/','format','%s-%s','now','originalname','single','server/files/images/avatars/','file','addAvatar','join','addCustomerAvatar','addSystemAvatar','/:id/notify','offline','addInteraction','addApplications','addProactiveActions','addAgents','put','update','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatWebsite.controller','get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','getFields'];(function(_0x1e30e1,_0x14df93){var _0x2fc771=function(_0x174b4e){while(--_0x174b4e){_0x1e30e1['push'](_0x1e30e1['shift']());}};_0x2fc771(++_0x14df93);}(_0x25d4,0x15c));var _0x425d=function(_0x58c53f,_0x414b5d){_0x58c53f=_0x58c53f-0x0;var _0x17b7eb=_0x25d4[_0x58c53f];return _0x17b7eb;};'use strict';var multer=require(_0x425d('0x0'));var util=require('util');var path=require(_0x425d('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x425d('0x2'));var interaction=require(_0x425d('0x3'));var config=require(_0x425d('0x4'));var controller=require(_0x425d('0x5'));router[_0x425d('0x6')]('/',auth[_0x425d('0x7')](),controller['index']);router[_0x425d('0x6')]('/describe',auth[_0x425d('0x7')](),controller['describe']);router['get'](_0x425d('0x8'),auth[_0x425d('0x7')](),controller[_0x425d('0x9')]);router[_0x425d('0x6')](_0x425d('0xa'),auth[_0x425d('0x7')](),controller[_0x425d('0xb')]);router[_0x425d('0x6')](_0x425d('0xc'),auth[_0x425d('0x7')](),controller[_0x425d('0xd')]);router['get'](_0x425d('0xe'),controller[_0x425d('0xf')]);router[_0x425d('0x6')](_0x425d('0x10'),controller[_0x425d('0x11')]);router[_0x425d('0x6')](_0x425d('0x12'),controller['getCustomerAvatar']);router[_0x425d('0x6')](_0x425d('0x13'),controller[_0x425d('0x14')]);router[_0x425d('0x6')](_0x425d('0x15'),auth['isAuthenticated'](),controller[_0x425d('0x16')]);router[_0x425d('0x6')](_0x425d('0x17'),controller[_0x425d('0x18')]);router['get'](_0x425d('0x19'),auth['isAuthenticated'](),controller[_0x425d('0x1a')]);router[_0x425d('0x6')](_0x425d('0x1b'),auth[_0x425d('0x7')](),controller[_0x425d('0x1c')]);router['get']('/:id/fields',controller[_0x425d('0x1d')]);router[_0x425d('0x6')]('/:id/offline_messages',auth['isAuthenticated'](),controller[_0x425d('0x1e')]);router[_0x425d('0x6')](_0x425d('0x1f'),auth['isAuthenticated'](),controller[_0x425d('0x20')]);router['post']('/',auth['isAuthenticated'](),controller[_0x425d('0x21')]);router[_0x425d('0x22')](_0x425d('0xa'),auth[_0x425d('0x7')](),controller[_0x425d('0x23')]);router['post'](_0x425d('0xc'),auth[_0x425d('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x425d('0x24')]({'destination':function(_0x56f781,_0x30c8c9,_0x54d099){_0x54d099(null,path['join'](config[_0x425d('0x25')],_0x425d('0x26')));},'filename':function(_0x74cf79,_0x342c90,_0x2d4ad2){_0x2d4ad2(null,util[_0x425d('0x27')](_0x425d('0x28'),Date[_0x425d('0x29')](),_0x342c90[_0x425d('0x2a')]));}})});router[_0x425d('0x22')]('/:id/logo',upload[_0x425d('0x2b')]('file'),controller['addLogo']);var upload=multer({'storage':multer[_0x425d('0x24')]({'destination':function(_0x194f19,_0x3c7a8f,_0x2d2e9c){_0x2d2e9c(null,path['join'](config[_0x425d('0x25')],_0x425d('0x2c')));},'filename':function(_0x201808,_0x4d03ea,_0x19981c){_0x19981c(null,util['format'](_0x425d('0x28'),Date[_0x425d('0x29')](),_0x4d03ea[_0x425d('0x2a')]));}})});router['post'](_0x425d('0x10'),upload[_0x425d('0x2b')](_0x425d('0x2d')),controller[_0x425d('0x2e')]);var upload=multer({'storage':multer[_0x425d('0x24')]({'destination':function(_0x8296cc,_0x24f86b,_0x198c2a){_0x198c2a(null,path[_0x425d('0x2f')](config[_0x425d('0x25')],_0x425d('0x2c')));},'filename':function(_0x7bf7c4,_0x2a1264,_0x10598b){_0x10598b(null,util[_0x425d('0x27')](_0x425d('0x28'),Date[_0x425d('0x29')](),_0x2a1264[_0x425d('0x2a')]));}})});router[_0x425d('0x22')](_0x425d('0x12'),upload[_0x425d('0x2b')]('file'),controller[_0x425d('0x30')]);var upload=multer({'storage':multer[_0x425d('0x24')]({'destination':function(_0x2ccda2,_0x5d5a2f,_0x31b1fa){_0x31b1fa(null,path[_0x425d('0x2f')](config[_0x425d('0x25')],'server/files/images/avatars/'));},'filename':function(_0x477054,_0x547ed3,_0x285261){_0x285261(null,util[_0x425d('0x27')](_0x425d('0x28'),Date[_0x425d('0x29')](),_0x547ed3[_0x425d('0x2a')]));}})});router['post'](_0x425d('0x13'),upload[_0x425d('0x2b')](_0x425d('0x2d')),controller[_0x425d('0x31')]);router[_0x425d('0x22')](_0x425d('0x32'),controller['notify']);router[_0x425d('0x22')]('/:id/offline',controller[_0x425d('0x33')]);router[_0x425d('0x22')]('/:id/interactions',auth[_0x425d('0x7')](),controller[_0x425d('0x34')]);router[_0x425d('0x22')]('/:id/applications',auth['isAuthenticated'](),controller[_0x425d('0x35')]);router[_0x425d('0x22')](_0x425d('0x1b'),auth[_0x425d('0x7')](),controller[_0x425d('0x36')]);router[_0x425d('0x22')](_0x425d('0x1f'),auth[_0x425d('0x7')](),controller[_0x425d('0x37')]);router[_0x425d('0x38')]('/:id',auth[_0x425d('0x7')](),controller[_0x425d('0x39')]);router[_0x425d('0x3a')](_0x425d('0x8'),auth[_0x425d('0x7')](),controller['destroy']);router[_0x425d('0x3a')](_0x425d('0xa'),auth[_0x425d('0x7')](),controller[_0x425d('0x3b')]);router[_0x425d('0x3a')](_0x425d('0xc'),auth['isAuthenticated'](),controller[_0x425d('0x3c')]);router[_0x425d('0x3a')](_0x425d('0x1f'),auth['isAuthenticated'](),controller[_0x425d('0x3d')]);module[_0x425d('0x3e')]=router; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.attributes.js b/server/api/cmCompany/cmCompany.attributes.js index 110b78f..f3fead3 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 _0xbcf2=['name','STRING','sequelize','exports'];(function(_0x2401b5,_0x586aa2){var _0x30bd43=function(_0x23ce93){while(--_0x23ce93){_0x2401b5['push'](_0x2401b5['shift']());}};_0x30bd43(++_0x586aa2);}(_0xbcf2,0x122));var _0x2bcf=function(_0x51cf64,_0x303dab){_0x51cf64=_0x51cf64-0x0;var _0x2c982b=_0xbcf2[_0x51cf64];return _0x2c982b;};'use strict';var Sequelize=require(_0x2bcf('0x0'));module[_0x2bcf('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x2bcf('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x2bcf('0x3')]},'companyId':{'type':Sequelize[_0x2bcf('0x3')]},'website':{'type':Sequelize[_0x2bcf('0x3')]},'phone':{'type':Sequelize[_0x2bcf('0x3')]},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'street':{'type':Sequelize[_0x2bcf('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0x2bcf('0x3')]},'country':{'type':Sequelize[_0x2bcf('0x3')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x2bcf('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize[_0x2bcf('0x3')]},'sCity':{'type':Sequelize[_0x2bcf('0x3')]},'sCountry':{'type':Sequelize[_0x2bcf('0x3')]},'description':{'type':Sequelize[_0x2bcf('0x3')]}}; \ No newline at end of file +var _0x67d7=['name','STRING','sequelize','exports'];(function(_0x3c17a4,_0x3390af){var _0x9b8521=function(_0x1a0d92){while(--_0x1a0d92){_0x3c17a4['push'](_0x3c17a4['shift']());}};_0x9b8521(++_0x3390af);}(_0x67d7,0x8e));var _0x767d=function(_0x284609,_0x386b54){_0x284609=_0x284609-0x0;var _0x55116b=_0x67d7[_0x284609];return _0x55116b;};'use strict';var Sequelize=require(_0x767d('0x0'));module[_0x767d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x767d('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x767d('0x3')]},'companyId':{'type':Sequelize[_0x767d('0x3')]},'website':{'type':Sequelize[_0x767d('0x3')]},'phone':{'type':Sequelize[_0x767d('0x3')]},'fax':{'type':Sequelize[_0x767d('0x3')]},'type':{'type':Sequelize[_0x767d('0x3')]},'street':{'type':Sequelize[_0x767d('0x3')]},'postalCode':{'type':Sequelize[_0x767d('0x3')]},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize[_0x767d('0x3')]},'email':{'type':Sequelize[_0x767d('0x3')],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x767d('0x3')]},'sStreet':{'type':Sequelize['STRING']},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0x767d('0x3')]},'sCountry':{'type':Sequelize[_0x767d('0x3')]},'description':{'type':Sequelize[_0x767d('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index 20a57bb..e1075cc 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 _0x549c=['role','Companies','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addContacts','CmContact','ids','omit','getContacts','order','sort','nolimit','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','save','update','destroy','then','get','error','name','send','describe','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','map','filter','merge','options','CmCompany','includeAll','findAll','rows','catch','show','params','rawAttributes','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0xb6adf4,_0x45d74b){var _0x28b3e0=function(_0x41489d){while(--_0x41489d){_0xb6adf4['push'](_0xb6adf4['shift']());}};_0x28b3e0(++_0x45d74b);}(_0x549c,0xba));var _0xc549=function(_0x5816ef,_0x1c2735){_0x5816ef=_0x5816ef-0x0;var _0x33ccfd=_0x549c[_0x5816ef];return _0x33ccfd;};'use strict';var pdf=require(_0xc549('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc549('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc549('0x2'));var rp=require(_0xc549('0x3'));var moment=require(_0xc549('0x4'));var BPromise=require(_0xc549('0x5'));var Mustache=require(_0xc549('0x6'));var util=require(_0xc549('0x7'));var path=require(_0xc549('0x8'));var sox=require(_0xc549('0x9'));var csv=require(_0xc549('0xa'));var ejs=require(_0xc549('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc549('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xc549('0xd'));var toCsv=require(_0xc549('0xa'));var querystring=require(_0xc549('0xe'));var Papa=require(_0xc549('0xf'));var Redis=require(_0xc549('0x10'));var authService=require(_0xc549('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xc549('0x12'));var hardwareService=require(_0xc549('0x13'));var logger=require(_0xc549('0x14'))(_0xc549('0x15'));var utils=require(_0xc549('0x16'));var config=require(_0xc549('0x17'));var db=require(_0xc549('0x18'))['db'];function respondWithStatusCode(_0x15ba48,_0x3fe3e5){_0x3fe3e5=_0x3fe3e5||0xcc;return function(_0x35d1ed){if(_0x35d1ed){return _0x15ba48[_0xc549('0x19')](_0x3fe3e5);}return _0x15ba48['status'](_0x3fe3e5)['end']();};}function respondWithResult(_0x4ca5ed,_0x1a1cd3){_0x1a1cd3=_0x1a1cd3||0xc8;return function(_0x25ace6){if(_0x25ace6){return _0x4ca5ed[_0xc549('0x1a')](_0x1a1cd3)['json'](_0x25ace6);}};}function respondWithFilteredResult(_0x113045,_0x28d8a4){return function(_0x2cd26c){if(_0x2cd26c){var _0x51b636=_0x2cd26c[_0xc549('0x1b')],_0x2e1c8c=_0x28d8a4['offset'],_0x30fd76=_0x28d8a4[_0xc549('0x1c')]+_0x28d8a4[_0xc549('0x1d')],_0x68be46;if(_0x30fd76>=_0x51b636){_0x30fd76=_0x51b636;_0x68be46=0xc8;}else{_0x68be46=0xce;}_0x113045[_0xc549('0x1a')](_0x68be46);return _0x113045[_0xc549('0x1e')]('Content-Range',_0x2e1c8c+'-'+_0x30fd76+'/'+_0x51b636)[_0xc549('0x1f')](_0x2cd26c);}return null;};}function patchUpdates(_0x50b340){return function(_0x489fd4){try{jsonpatch[_0xc549('0x20')](_0x489fd4,_0x50b340,!![]);}catch(_0x3bcbcd){return BPromise['reject'](_0x3bcbcd);}return _0x489fd4[_0xc549('0x21')]();};}function saveUpdates(_0x2ee38f,_0x48aea5){return function(_0xc26b92){if(_0xc26b92){return _0xc26b92[_0xc549('0x22')](_0x2ee38f)['then'](function(_0x5ef5b1){return _0x5ef5b1;});}return null;};}function removeEntity(_0xfbde21,_0x302ef5){return function(_0x503881){if(_0x503881){return _0x503881[_0xc549('0x23')]()[_0xc549('0x24')](function(){var _0x411d84=_0x503881[_0xc549('0x25')]({'plain':!![]});var _0x2857a4='Companies';return db['UserProfileResource'][_0xc549('0x23')]({'where':{'type':_0x2857a4,'resourceId':_0x411d84['id']}})[_0xc549('0x24')](function(){return _0x503881;});})[_0xc549('0x24')](function(){_0xfbde21[_0xc549('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x150c55,_0x3eecb4){return function(_0x475e36){if(!_0x475e36){_0x150c55[_0xc549('0x19')](0x194);}return _0x475e36;};}function handleError(_0x1077ba,_0x348e03){_0x348e03=_0x348e03||0x1f4;return function(_0x4460ea){logger[_0xc549('0x26')](_0x4460ea['stack']);if(_0x4460ea[_0xc549('0x27')]){delete _0x4460ea[_0xc549('0x27')];}_0x1077ba[_0xc549('0x1a')](_0x348e03)[_0xc549('0x28')](_0x4460ea);};}exports['index']=function(_0x35b17e,_0x59171b){var _0x4c0142={},_0x4630bc={},_0x43e054={'count':0x0,'rows':[]};return db['CmCompany'][_0xc549('0x29')]()[_0xc549('0x24')](function(_0x19acff){_0x4630bc[_0xc549('0x2a')]=_[_0xc549('0x2b')](_0x19acff);_0x4630bc[_0xc549('0x2c')]=_[_0xc549('0x2b')](_0x35b17e[_0xc549('0x2c')]);_0x4630bc[_0xc549('0x2d')]=_[_0xc549('0x2e')](_0x4630bc[_0xc549('0x2a')],_0x4630bc['query']);_0x4c0142[_0xc549('0x2f')]=_[_0xc549('0x2e')](_0x4630bc[_0xc549('0x2a')],qs[_0xc549('0x30')](_0x35b17e[_0xc549('0x2c')]['fields']));_0x4c0142[_0xc549('0x2f')]=_0x4c0142[_0xc549('0x2f')][_0xc549('0x31')]?_0x4c0142['attributes']:_0x4630bc[_0xc549('0x2a')];if(!_0x35b17e[_0xc549('0x2c')][_0xc549('0x32')]('nolimit')){_0x4c0142[_0xc549('0x1d')]=qs['limit'](_0x35b17e[_0xc549('0x2c')][_0xc549('0x1d')]);_0x4c0142[_0xc549('0x1c')]=qs[_0xc549('0x1c')](_0x35b17e['query']['offset']);}_0x4c0142['order']=qs['sort'](_0x35b17e[_0xc549('0x2c')]['sort']);_0x4c0142[_0xc549('0x33')]=qs[_0xc549('0x2d')](_[_0xc549('0x34')](_0x35b17e[_0xc549('0x2c')],_0x4630bc[_0xc549('0x2d')]));if(_0x35b17e['query']['filter']){_0x4c0142[_0xc549('0x33')]=_['merge'](_0x4c0142[_0xc549('0x33')],{'$or':_[_0xc549('0x35')](_0x4c0142['attributes'],function(_0x2c038f){var _0x2d642b={};_0x2d642b[_0x2c038f]={'$like':'%'+_0x35b17e[_0xc549('0x2c')][_0xc549('0x36')]+'%'};return _0x2d642b;})});}_0x4c0142=_[_0xc549('0x37')]({},_0x4c0142,_0x35b17e[_0xc549('0x38')]);var _0x2c0238={'where':_0x4c0142[_0xc549('0x33')]};return db[_0xc549('0x39')]['count'](_0x2c0238)[_0xc549('0x24')](function(_0x3b18b7){_0x43e054[_0xc549('0x1b')]=_0x3b18b7;if(_0x35b17e[_0xc549('0x2c')][_0xc549('0x3a')]){_0x4c0142['include']=[{'all':!![]}];}return db['CmCompany'][_0xc549('0x3b')](_0x4c0142);})[_0xc549('0x24')](function(_0x37a934){_0x43e054[_0xc549('0x3c')]=_0x37a934;return _0x43e054;})[_0xc549('0x24')](respondWithFilteredResult(_0x59171b,_0x4c0142))['catch'](handleError(_0x59171b,null));})[_0xc549('0x3d')](handleError(_0x59171b,null));};exports[_0xc549('0x3e')]=function(_0xf2c4f7,_0x3f2b40){var _0x5ebebb={'raw':![],'where':{'id':_0xf2c4f7[_0xc549('0x3f')]['id']}},_0x27e487={};_0x27e487[_0xc549('0x2a')]=_[_0xc549('0x2b')](db[_0xc549('0x39')][_0xc549('0x40')]);_0x27e487[_0xc549('0x2c')]=_[_0xc549('0x2b')](_0xf2c4f7['query']);_0x27e487[_0xc549('0x2d')]=_['intersection'](_0x27e487[_0xc549('0x2a')],_0x27e487[_0xc549('0x2c')]);_0x5ebebb[_0xc549('0x2f')]=_[_0xc549('0x2e')](_0x27e487[_0xc549('0x2a')],qs['fields'](_0xf2c4f7[_0xc549('0x2c')][_0xc549('0x30')]));_0x5ebebb[_0xc549('0x2f')]=_0x5ebebb[_0xc549('0x2f')][_0xc549('0x31')]?_0x5ebebb[_0xc549('0x2f')]:_0x27e487[_0xc549('0x2a')];if(_0xf2c4f7['query'][_0xc549('0x3a')]){_0x5ebebb[_0xc549('0x41')]=[{'all':!![]}];}_0x5ebebb=_['merge']({},_0x5ebebb,_0xf2c4f7[_0xc549('0x38')]);return db[_0xc549('0x39')]['find'](_0x5ebebb)[_0xc549('0x24')](handleEntityNotFound(_0x3f2b40,null))[_0xc549('0x24')](respondWithResult(_0x3f2b40,null))['catch'](handleError(_0x3f2b40,null));};exports[_0xc549('0x42')]=function(_0x8e591f,_0x3d08f7){return db[_0xc549('0x39')]['create'](_0x8e591f[_0xc549('0x43')],{})[_0xc549('0x24')](function(_0x2bd744){var _0x1128d4=_0x8e591f['user'][_0xc549('0x25')]({'plain':!![]});if(!_0x1128d4)throw new Error(_0xc549('0x44'));if(_0x1128d4[_0xc549('0x45')]==='user'){var _0x3780dc=_0x2bd744[_0xc549('0x25')]({'plain':!![]});var _0x2130fc=_0xc549('0x46');return db[_0xc549('0x47')][_0xc549('0x48')]({'where':{'name':_0x2130fc,'userProfileId':_0x1128d4[_0xc549('0x49')]},'raw':!![]})[_0xc549('0x24')](function(_0x2db9a3){if(_0x2db9a3&&_0x2db9a3[_0xc549('0x4a')]===0x0){return db[_0xc549('0x4b')][_0xc549('0x42')]({'name':_0x3780dc[_0xc549('0x27')],'resourceId':_0x3780dc['id'],'type':_0x2db9a3['name'],'sectionId':_0x2db9a3['id']},{})[_0xc549('0x24')](function(){return _0x2bd744;});}else{return _0x2bd744;}})['catch'](function(_0x45d450){logger['error'](_0xc549('0x4c'),_0x45d450);throw _0x45d450;});}return _0x2bd744;})[_0xc549('0x24')](respondWithResult(_0x3d08f7,0xc9))[_0xc549('0x3d')](handleError(_0x3d08f7,null));};exports[_0xc549('0x22')]=function(_0x439a95,_0xf6af3b){if(_0x439a95['body']['id']){delete _0x439a95['body']['id'];}return db[_0xc549('0x39')][_0xc549('0x48')]({'where':{'id':_0x439a95[_0xc549('0x3f')]['id']}})[_0xc549('0x24')](handleEntityNotFound(_0xf6af3b,null))[_0xc549('0x24')](saveUpdates(_0x439a95[_0xc549('0x43')],null))[_0xc549('0x24')](respondWithResult(_0xf6af3b,null))['catch'](handleError(_0xf6af3b,null));};exports['destroy']=function(_0x18a533,_0x4124c3){return db[_0xc549('0x39')][_0xc549('0x48')]({'where':{'id':_0x18a533[_0xc549('0x3f')]['id']}})[_0xc549('0x24')](handleEntityNotFound(_0x4124c3,null))[_0xc549('0x24')](removeEntity(_0x4124c3,null))[_0xc549('0x3d')](handleError(_0x4124c3,null));};exports[_0xc549('0x29')]=function(_0x105497,_0x9ac1f7){return db[_0xc549('0x39')][_0xc549('0x29')]()[_0xc549('0x24')](respondWithResult(_0x9ac1f7,null))['catch'](handleError(_0x9ac1f7,null));};exports[_0xc549('0x4d')]=function(_0x25d40e,_0x4c064d,_0x53e928){return db[_0xc549('0x4e')]['find']({'where':{'id':_0x25d40e[_0xc549('0x3f')]['id']}})[_0xc549('0x24')](handleEntityNotFound(_0x4c064d,null))['then'](function(_0x2e872c){if(_0x2e872c){return _0x2e872c['addContacts'](_0x25d40e['body'][_0xc549('0x4f')],_[_0xc549('0x50')](_0x25d40e[_0xc549('0x43')],[_0xc549('0x4f'),'id'])||{});}})[_0xc549('0x24')](respondWithResult(_0x4c064d,null))[_0xc549('0x3d')](handleError(_0x4c064d,null));};exports[_0xc549('0x51')]=function(_0x3a82f9,_0x4964a7,_0x394377){var _0x5a6121={};var _0x38f3b8={};var _0x11f2f5;var _0xf4b056;return db[_0xc549('0x39')]['findOne']({'where':{'id':_0x3a82f9['params']['id']}})['then'](handleEntityNotFound(_0x4964a7,null))[_0xc549('0x24')](function(_0x2f67d0){if(_0x2f67d0){_0x11f2f5=_0x2f67d0;_0x38f3b8[_0xc549('0x2a')]=_[_0xc549('0x2b')](db[_0xc549('0x4e')]['rawAttributes']);_0x38f3b8[_0xc549('0x2c')]=_[_0xc549('0x2b')](_0x3a82f9[_0xc549('0x2c')]);_0x38f3b8[_0xc549('0x2d')]=_[_0xc549('0x2e')](_0x38f3b8[_0xc549('0x2a')],_0x38f3b8[_0xc549('0x2c')]);_0x5a6121[_0xc549('0x2f')]=_[_0xc549('0x2e')](_0x38f3b8['model'],qs[_0xc549('0x30')](_0x3a82f9['query'][_0xc549('0x30')]));_0x5a6121[_0xc549('0x2f')]=_0x5a6121[_0xc549('0x2f')][_0xc549('0x31')]?_0x5a6121[_0xc549('0x2f')]:_0x38f3b8[_0xc549('0x2a')];_0x5a6121[_0xc549('0x52')]=qs[_0xc549('0x53')](_0x3a82f9[_0xc549('0x2c')][_0xc549('0x53')]);_0x5a6121[_0xc549('0x33')]=qs[_0xc549('0x2d')](_[_0xc549('0x34')](_0x3a82f9['query'],_0x38f3b8['filters']));if(_0x3a82f9[_0xc549('0x2c')]['filter']){_0x5a6121[_0xc549('0x33')]=_[_0xc549('0x37')](_0x5a6121[_0xc549('0x33')],{'$or':_[_0xc549('0x35')](_0x5a6121[_0xc549('0x2f')],function(_0x34bbd0){var _0x496c46={};_0x496c46[_0x34bbd0]={'$like':'%'+_0x3a82f9['query']['filter']+'%'};return _0x496c46;})});}_0x5a6121=_[_0xc549('0x37')]({},_0x5a6121,_0x3a82f9[_0xc549('0x38')]);return _0x11f2f5['getContacts'](_0x5a6121);}})[_0xc549('0x24')](function(_0x45fb54){if(_0x45fb54){_0xf4b056=_0x45fb54['length'];if(!_0x3a82f9['query'][_0xc549('0x32')](_0xc549('0x54'))){_0x5a6121[_0xc549('0x1d')]=qs[_0xc549('0x1d')](_0x3a82f9[_0xc549('0x2c')]['limit']);_0x5a6121['offset']=qs[_0xc549('0x1c')](_0x3a82f9[_0xc549('0x2c')][_0xc549('0x1c')]);}return _0x11f2f5[_0xc549('0x51')](_0x5a6121);}})[_0xc549('0x24')](function(_0x3515e8){if(_0x3515e8){return _0x3515e8?{'count':_0xf4b056,'rows':_0x3515e8}:null;}})[_0xc549('0x24')](respondWithResult(_0x4964a7,null))[_0xc549('0x3d')](handleError(_0x4964a7,null));}; \ No newline at end of file +var _0xe593=['sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','json','apply','reject','save','destroy','then','get','UserProfileResource','error','name','send','describe','keys','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','map','options','include','CmCompany','rows','catch','create','body','user','role','find','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','addContacts','ids','omit','findOne','rawAttributes','getContacts','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path'];(function(_0x52fc68,_0x179325){var _0x391c16=function(_0x1e8ee){while(--_0x1e8ee){_0x52fc68['push'](_0x52fc68['shift']());}};_0x391c16(++_0x179325);}(_0xe593,0xdf));var _0x3e59=function(_0x18c9be,_0x443774){_0x18c9be=_0x18c9be-0x0;var _0x4d35ae=_0xe593[_0x18c9be];return _0x4d35ae;};'use strict';var pdf=require(_0x3e59('0x0'));var emlformat=require(_0x3e59('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3e59('0x2'));var jsonpatch=require(_0x3e59('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e59('0x4'));var Mustache=require(_0x3e59('0x5'));var util=require(_0x3e59('0x6'));var path=require(_0x3e59('0x7'));var sox=require(_0x3e59('0x8'));var csv=require('to-csv');var ejs=require(_0x3e59('0x9'));var fs=require('fs');var _=require(_0x3e59('0xa'));var squel=require(_0x3e59('0xb'));var crypto=require(_0x3e59('0xc'));var jsforce=require(_0x3e59('0xd'));var deskjs=require(_0x3e59('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x3e59('0xf'));var Redis=require(_0x3e59('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x3e59('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3e59('0x12'));var utils=require(_0x3e59('0x13'));var config=require(_0x3e59('0x14'));var db=require(_0x3e59('0x15'))['db'];function respondWithStatusCode(_0x1b1087,_0x22087c){_0x22087c=_0x22087c||0xcc;return function(_0x51d071){if(_0x51d071){return _0x1b1087[_0x3e59('0x16')](_0x22087c);}return _0x1b1087[_0x3e59('0x17')](_0x22087c)[_0x3e59('0x18')]();};}function respondWithResult(_0x1db75e,_0x20c638){_0x20c638=_0x20c638||0xc8;return function(_0x46b534){if(_0x46b534){return _0x1db75e['status'](_0x20c638)['json'](_0x46b534);}};}function respondWithFilteredResult(_0x1f3bd3,_0x212490){return function(_0x5c8f86){if(_0x5c8f86){var _0x1b123d=_0x5c8f86[_0x3e59('0x19')],_0x204250=_0x212490[_0x3e59('0x1a')],_0x151bc8=_0x212490[_0x3e59('0x1a')]+_0x212490['limit'],_0xd7f6ef;if(_0x151bc8>=_0x1b123d){_0x151bc8=_0x1b123d;_0xd7f6ef=0xc8;}else{_0xd7f6ef=0xce;}_0x1f3bd3[_0x3e59('0x17')](_0xd7f6ef);return _0x1f3bd3[_0x3e59('0x1b')]('Content-Range',_0x204250+'-'+_0x151bc8+'/'+_0x1b123d)[_0x3e59('0x1c')](_0x5c8f86);}return null;};}function patchUpdates(_0x1d757e){return function(_0x312df7){try{jsonpatch[_0x3e59('0x1d')](_0x312df7,_0x1d757e,!![]);}catch(_0x144f87){return BPromise[_0x3e59('0x1e')](_0x144f87);}return _0x312df7[_0x3e59('0x1f')]();};}function saveUpdates(_0x1de066,_0x93e92e){return function(_0x226240){if(_0x226240){return _0x226240['update'](_0x1de066)['then'](function(_0x50afac){return _0x50afac;});}return null;};}function removeEntity(_0x340e6a,_0x17dd78){return function(_0x410b5b){if(_0x410b5b){return _0x410b5b[_0x3e59('0x20')]()[_0x3e59('0x21')](function(){var _0x5c37e3=_0x410b5b[_0x3e59('0x22')]({'plain':!![]});var _0x38948f='Companies';return db[_0x3e59('0x23')]['destroy']({'where':{'type':_0x38948f,'resourceId':_0x5c37e3['id']}})[_0x3e59('0x21')](function(){return _0x410b5b;});})[_0x3e59('0x21')](function(){_0x340e6a[_0x3e59('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xcb75ce,_0x265829){return function(_0x875bf9){if(!_0x875bf9){_0xcb75ce['sendStatus'](0x194);}return _0x875bf9;};}function handleError(_0x4f52bb,_0x3abcfd){_0x3abcfd=_0x3abcfd||0x1f4;return function(_0xfb28f9){logger[_0x3e59('0x24')](_0xfb28f9['stack']);if(_0xfb28f9[_0x3e59('0x25')]){delete _0xfb28f9[_0x3e59('0x25')];}_0x4f52bb['status'](_0x3abcfd)[_0x3e59('0x26')](_0xfb28f9);};}exports['index']=function(_0x211bb7,_0x480005){var _0x3b90c6={},_0x1170af={},_0x417fbc={'count':0x0,'rows':[]};return db['CmCompany'][_0x3e59('0x27')]()['then'](function(_0x3a2957){_0x1170af['model']=_[_0x3e59('0x28')](_0x3a2957);_0x1170af[_0x3e59('0x29')]=_[_0x3e59('0x28')](_0x211bb7['query']);_0x1170af[_0x3e59('0x2a')]=_[_0x3e59('0x2b')](_0x1170af[_0x3e59('0x2c')],_0x1170af[_0x3e59('0x29')]);_0x3b90c6['attributes']=_[_0x3e59('0x2b')](_0x1170af[_0x3e59('0x2c')],qs[_0x3e59('0x2d')](_0x211bb7['query']['fields']));_0x3b90c6[_0x3e59('0x2e')]=_0x3b90c6[_0x3e59('0x2e')][_0x3e59('0x2f')]?_0x3b90c6[_0x3e59('0x2e')]:_0x1170af[_0x3e59('0x2c')];if(!_0x211bb7[_0x3e59('0x29')][_0x3e59('0x30')](_0x3e59('0x31'))){_0x3b90c6[_0x3e59('0x32')]=qs[_0x3e59('0x32')](_0x211bb7[_0x3e59('0x29')][_0x3e59('0x32')]);_0x3b90c6[_0x3e59('0x1a')]=qs[_0x3e59('0x1a')](_0x211bb7['query'][_0x3e59('0x1a')]);}_0x3b90c6['order']=qs['sort'](_0x211bb7[_0x3e59('0x29')][_0x3e59('0x33')]);_0x3b90c6[_0x3e59('0x34')]=qs[_0x3e59('0x2a')](_[_0x3e59('0x35')](_0x211bb7[_0x3e59('0x29')],_0x1170af[_0x3e59('0x2a')]));if(_0x211bb7[_0x3e59('0x29')][_0x3e59('0x36')]){_0x3b90c6[_0x3e59('0x34')]=_[_0x3e59('0x37')](_0x3b90c6['where'],{'$or':_[_0x3e59('0x38')](_0x3b90c6[_0x3e59('0x2e')],function(_0x4ae1fe){var _0x5a6ecf={};_0x5a6ecf[_0x4ae1fe]={'$like':'%'+_0x211bb7[_0x3e59('0x29')]['filter']+'%'};return _0x5a6ecf;})});}_0x3b90c6=_[_0x3e59('0x37')]({},_0x3b90c6,_0x211bb7[_0x3e59('0x39')]);var _0x5c240={'where':_0x3b90c6[_0x3e59('0x34')]};return db['CmCompany'][_0x3e59('0x19')](_0x5c240)[_0x3e59('0x21')](function(_0xf3349f){_0x417fbc['count']=_0xf3349f;if(_0x211bb7['query']['includeAll']){_0x3b90c6[_0x3e59('0x3a')]=[{'all':!![]}];}return db[_0x3e59('0x3b')]['findAll'](_0x3b90c6);})[_0x3e59('0x21')](function(_0x63b1b0){_0x417fbc[_0x3e59('0x3c')]=_0x63b1b0;return _0x417fbc;})['then'](respondWithFilteredResult(_0x480005,_0x3b90c6))[_0x3e59('0x3d')](handleError(_0x480005,null));})[_0x3e59('0x3d')](handleError(_0x480005,null));};exports['show']=function(_0x293114,_0x585f1){var _0x3eec7c={'raw':![],'where':{'id':_0x293114['params']['id']}},_0x2933ce={};_0x2933ce['model']=_[_0x3e59('0x28')](db[_0x3e59('0x3b')]['rawAttributes']);_0x2933ce['query']=_[_0x3e59('0x28')](_0x293114[_0x3e59('0x29')]);_0x2933ce['filters']=_[_0x3e59('0x2b')](_0x2933ce[_0x3e59('0x2c')],_0x2933ce[_0x3e59('0x29')]);_0x3eec7c[_0x3e59('0x2e')]=_[_0x3e59('0x2b')](_0x2933ce[_0x3e59('0x2c')],qs[_0x3e59('0x2d')](_0x293114[_0x3e59('0x29')][_0x3e59('0x2d')]));_0x3eec7c[_0x3e59('0x2e')]=_0x3eec7c[_0x3e59('0x2e')]['length']?_0x3eec7c['attributes']:_0x2933ce[_0x3e59('0x2c')];if(_0x293114[_0x3e59('0x29')]['includeAll']){_0x3eec7c['include']=[{'all':!![]}];}_0x3eec7c=_[_0x3e59('0x37')]({},_0x3eec7c,_0x293114['options']);return db['CmCompany']['find'](_0x3eec7c)[_0x3e59('0x21')](handleEntityNotFound(_0x585f1,null))[_0x3e59('0x21')](respondWithResult(_0x585f1,null))['catch'](handleError(_0x585f1,null));};exports['create']=function(_0x39bb67,_0x1027a4){return db[_0x3e59('0x3b')][_0x3e59('0x3e')](_0x39bb67[_0x3e59('0x3f')],{})[_0x3e59('0x21')](function(_0x5966f4){var _0x4dcb29=_0x39bb67[_0x3e59('0x40')][_0x3e59('0x22')]({'plain':!![]});if(!_0x4dcb29)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4dcb29[_0x3e59('0x41')]===_0x3e59('0x40')){var _0x547710=_0x5966f4[_0x3e59('0x22')]({'plain':!![]});var _0x420fe7='Companies';return db['UserProfileSection'][_0x3e59('0x42')]({'where':{'name':_0x420fe7,'userProfileId':_0x4dcb29['userProfileId']},'raw':!![]})['then'](function(_0x38a047){if(_0x38a047&&_0x38a047[_0x3e59('0x43')]===0x0){return db['UserProfileResource'][_0x3e59('0x3e')]({'name':_0x547710[_0x3e59('0x25')],'resourceId':_0x547710['id'],'type':_0x38a047[_0x3e59('0x25')],'sectionId':_0x38a047['id']},{})[_0x3e59('0x21')](function(){return _0x5966f4;});}else{return _0x5966f4;}})['catch'](function(_0x4137cd){logger[_0x3e59('0x24')](_0x3e59('0x44'),_0x4137cd);throw _0x4137cd;});}return _0x5966f4;})['then'](respondWithResult(_0x1027a4,0xc9))['catch'](handleError(_0x1027a4,null));};exports[_0x3e59('0x45')]=function(_0x52c1c0,_0x2a4889){if(_0x52c1c0[_0x3e59('0x3f')]['id']){delete _0x52c1c0[_0x3e59('0x3f')]['id'];}return db[_0x3e59('0x3b')][_0x3e59('0x42')]({'where':{'id':_0x52c1c0[_0x3e59('0x46')]['id']}})['then'](handleEntityNotFound(_0x2a4889,null))[_0x3e59('0x21')](saveUpdates(_0x52c1c0[_0x3e59('0x3f')],null))[_0x3e59('0x21')](respondWithResult(_0x2a4889,null))[_0x3e59('0x3d')](handleError(_0x2a4889,null));};exports[_0x3e59('0x20')]=function(_0x3fcd28,_0x2f7230){return db[_0x3e59('0x3b')][_0x3e59('0x42')]({'where':{'id':_0x3fcd28['params']['id']}})['then'](handleEntityNotFound(_0x2f7230,null))[_0x3e59('0x21')](removeEntity(_0x2f7230,null))[_0x3e59('0x3d')](handleError(_0x2f7230,null));};exports[_0x3e59('0x27')]=function(_0x35e3b4,_0x1bf9a9){return db[_0x3e59('0x3b')][_0x3e59('0x27')]()[_0x3e59('0x21')](respondWithResult(_0x1bf9a9,null))['catch'](handleError(_0x1bf9a9,null));};exports[_0x3e59('0x47')]=function(_0x3ef865,_0x12a461,_0x39cefa){return db['CmContact'][_0x3e59('0x42')]({'where':{'id':_0x3ef865[_0x3e59('0x46')]['id']}})[_0x3e59('0x21')](handleEntityNotFound(_0x12a461,null))[_0x3e59('0x21')](function(_0x2b2701){if(_0x2b2701){return _0x2b2701[_0x3e59('0x47')](_0x3ef865[_0x3e59('0x3f')][_0x3e59('0x48')],_[_0x3e59('0x49')](_0x3ef865[_0x3e59('0x3f')],['ids','id'])||{});}})[_0x3e59('0x21')](respondWithResult(_0x12a461,null))[_0x3e59('0x3d')](handleError(_0x12a461,null));};exports['getContacts']=function(_0xf25b77,_0x40b462,_0x3ce555){var _0x4ba1b9={};var _0x55c370={};var _0xb9d4a3;var _0x4b151a;return db[_0x3e59('0x3b')][_0x3e59('0x4a')]({'where':{'id':_0xf25b77[_0x3e59('0x46')]['id']}})[_0x3e59('0x21')](handleEntityNotFound(_0x40b462,null))[_0x3e59('0x21')](function(_0x5c98af){if(_0x5c98af){_0xb9d4a3=_0x5c98af;_0x55c370['model']=_[_0x3e59('0x28')](db['CmContact'][_0x3e59('0x4b')]);_0x55c370[_0x3e59('0x29')]=_[_0x3e59('0x28')](_0xf25b77[_0x3e59('0x29')]);_0x55c370[_0x3e59('0x2a')]=_[_0x3e59('0x2b')](_0x55c370['model'],_0x55c370[_0x3e59('0x29')]);_0x4ba1b9[_0x3e59('0x2e')]=_[_0x3e59('0x2b')](_0x55c370[_0x3e59('0x2c')],qs[_0x3e59('0x2d')](_0xf25b77[_0x3e59('0x29')][_0x3e59('0x2d')]));_0x4ba1b9[_0x3e59('0x2e')]=_0x4ba1b9[_0x3e59('0x2e')][_0x3e59('0x2f')]?_0x4ba1b9[_0x3e59('0x2e')]:_0x55c370[_0x3e59('0x2c')];_0x4ba1b9['order']=qs[_0x3e59('0x33')](_0xf25b77['query']['sort']);_0x4ba1b9[_0x3e59('0x34')]=qs[_0x3e59('0x2a')](_[_0x3e59('0x35')](_0xf25b77['query'],_0x55c370[_0x3e59('0x2a')]));if(_0xf25b77[_0x3e59('0x29')][_0x3e59('0x36')]){_0x4ba1b9[_0x3e59('0x34')]=_['merge'](_0x4ba1b9['where'],{'$or':_['map'](_0x4ba1b9[_0x3e59('0x2e')],function(_0x47c56e){var _0x1975c6={};_0x1975c6[_0x47c56e]={'$like':'%'+_0xf25b77[_0x3e59('0x29')]['filter']+'%'};return _0x1975c6;})});}_0x4ba1b9=_['merge']({},_0x4ba1b9,_0xf25b77[_0x3e59('0x39')]);return _0xb9d4a3[_0x3e59('0x4c')](_0x4ba1b9);}})[_0x3e59('0x21')](function(_0x295b0a){if(_0x295b0a){_0x4b151a=_0x295b0a[_0x3e59('0x2f')];if(!_0xf25b77[_0x3e59('0x29')]['hasOwnProperty']('nolimit')){_0x4ba1b9[_0x3e59('0x32')]=qs[_0x3e59('0x32')](_0xf25b77['query'][_0x3e59('0x32')]);_0x4ba1b9['offset']=qs[_0x3e59('0x1a')](_0xf25b77[_0x3e59('0x29')][_0x3e59('0x1a')]);}return _0xb9d4a3[_0x3e59('0x4c')](_0x4ba1b9);}})[_0x3e59('0x21')](function(_0x2e90f0){if(_0x2e90f0){return _0x2e90f0?{'count':_0x4b151a,'rows':_0x2e90f0}:null;}})[_0x3e59('0x21')](respondWithResult(_0x40b462,null))[_0x3e59('0x3d')](handleError(_0x40b462,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index dcd2291..fd877b9 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 _0xc3b5=['define','CmCompany','cm_companies','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x40ac5e,_0x2de228){var _0x2839d6=function(_0x123d47){while(--_0x123d47){_0x40ac5e['push'](_0x40ac5e['shift']());}};_0x2839d6(++_0x2de228);}(_0xc3b5,0x6f));var _0x5c3b=function(_0x44ded4,_0x112260){_0x44ded4=_0x44ded4-0x0;var _0x8472c0=_0xc3b5[_0x44ded4];return _0x8472c0;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5c3b('0x0'))(_0x5c3b('0x1'));var moment=require(_0x5c3b('0x2'));var BPromise=require(_0x5c3b('0x3'));var rp=require(_0x5c3b('0x4'));var fs=require('fs');var path=require(_0x5c3b('0x5'));var rimraf=require(_0x5c3b('0x6'));var config=require(_0x5c3b('0x7'));var attributes=require('./cmCompany.attributes');module[_0x5c3b('0x8')]=function(_0x6b8a1e,_0x56345e){return _0x6b8a1e[_0x5c3b('0x9')](_0x5c3b('0xa'),attributes,{'tableName':_0x5c3b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5fd1=['CmCompany','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define'];(function(_0x5307d8,_0x3112a9){var _0x547d68=function(_0xa1a0a6){while(--_0xa1a0a6){_0x5307d8['push'](_0x5307d8['shift']());}};_0x547d68(++_0x3112a9);}(_0x5fd1,0x155));var _0x15fd=function(_0x101f13,_0xe2f9e6){_0x101f13=_0x101f13-0x0;var _0x2f8fda=_0x5fd1[_0x101f13];return _0x2f8fda;};'use strict';var _=require(_0x15fd('0x0'));var util=require('util');var logger=require(_0x15fd('0x1'))(_0x15fd('0x2'));var moment=require(_0x15fd('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x15fd('0x4'));var rimraf=require(_0x15fd('0x5'));var config=require(_0x15fd('0x6'));var attributes=require('./cmCompany.attributes');module[_0x15fd('0x7')]=function(_0x386441,_0x18450c){return _0x386441[_0x15fd('0x8')](_0x15fd('0x9'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 9efbac3..27288ad 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 _0x4a16=['../../config/environment','client','http','then','info','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','error','message','request\x20sent','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x4a16,0x1d3));var _0x64a1=function(_0x2d5cba,_0x51762a){_0x2d5cba=_0x2d5cba-0x0;var _0x1b920a=_0x4a16[_0x2d5cba];return _0x1b920a;};'use strict';var _=require(_0x64a1('0x0'));var util=require(_0x64a1('0x1'));var moment=require(_0x64a1('0x2'));var BPromise=require(_0x64a1('0x3'));var rs=require(_0x64a1('0x4'));var fs=require('fs');var Redis=require(_0x64a1('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x64a1('0x6'));var logger=require(_0x64a1('0x7'))('rpc');var config=require(_0x64a1('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x64a1('0x9')][_0x64a1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d34fd,_0x56e53f,_0x391c48){return new BPromise(function(_0xbff31c,_0x4fb443){return client['request'](_0x1d34fd,_0x391c48)[_0x64a1('0xb')](function(_0x2367b0){logger[_0x64a1('0xc')](_0x64a1('0xd'),_0x56e53f,'request\x20sent');logger['debug'](_0x64a1('0xe'),_0x56e53f,'request\x20sent',JSON['stringify'](_0x2367b0));if(_0x2367b0['error']){if(_0x2367b0[_0x64a1('0xf')]['code']===0x1f4){logger[_0x64a1('0xf')](_0x64a1('0xd'),_0x56e53f,_0x2367b0[_0x64a1('0xf')][_0x64a1('0x10')]);return _0x4fb443(_0x2367b0['error'][_0x64a1('0x10')]);}logger[_0x64a1('0xf')]('CmCompany,\x20%s,\x20%s',_0x56e53f,_0x2367b0[_0x64a1('0xf')][_0x64a1('0x10')]);return _0xbff31c(_0x2367b0[_0x64a1('0xf')][_0x64a1('0x10')]);}else{logger[_0x64a1('0xc')]('CmCompany,\x20%s,\x20%s',_0x56e53f,_0x64a1('0x11'));_0xbff31c(_0x2367b0['result'][_0x64a1('0x10')]);}})[_0x64a1('0x12')](function(_0x516a2b){logger[_0x64a1('0xf')](_0x64a1('0xd'),_0x56e53f,_0x516a2b);_0x4fb443(_0x516a2b);});});} \ No newline at end of file +var _0xbe4d=['randomstring','ioredis','../../mysqldb','../../config/utils','http','request','then','CmCompany,\x20%s,\x20%s','CmCompany,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment'];(function(_0x1b8c71,_0x41d8ab){var _0x539905=function(_0x395edd){while(--_0x395edd){_0x1b8c71['push'](_0x1b8c71['shift']());}};_0x539905(++_0x41d8ab);}(_0xbe4d,0x75));var _0xdbe4=function(_0x5c8014,_0x33d7c5){_0x5c8014=_0x5c8014-0x0;var _0x250d9e=_0xbe4d[_0x5c8014];return _0x250d9e;};'use strict';var _=require(_0xdbe4('0x0'));var util=require(_0xdbe4('0x1'));var moment=require(_0xdbe4('0x2'));var BPromise=require('bluebird');var rs=require(_0xdbe4('0x3'));var fs=require('fs');var Redis=require(_0xdbe4('0x4'));var db=require(_0xdbe4('0x5'))['db'];var utils=require(_0xdbe4('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xdbe4('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x48410f,_0x2cb689,_0x4ff28e){return new BPromise(function(_0x4d1e46,_0x5900ce){return client[_0xdbe4('0x8')](_0x48410f,_0x4ff28e)[_0xdbe4('0x9')](function(_0x5760eb){logger['info'](_0xdbe4('0xa'),_0x2cb689,'request\x20sent');logger['debug'](_0xdbe4('0xb'),_0x2cb689,_0xdbe4('0xc'),JSON[_0xdbe4('0xd')](_0x5760eb));if(_0x5760eb[_0xdbe4('0xe')]){if(_0x5760eb[_0xdbe4('0xe')][_0xdbe4('0xf')]===0x1f4){logger[_0xdbe4('0xe')]('CmCompany,\x20%s,\x20%s',_0x2cb689,_0x5760eb[_0xdbe4('0xe')][_0xdbe4('0x10')]);return _0x5900ce(_0x5760eb[_0xdbe4('0xe')]['message']);}logger['error']('CmCompany,\x20%s,\x20%s',_0x2cb689,_0x5760eb[_0xdbe4('0xe')]['message']);return _0x4d1e46(_0x5760eb[_0xdbe4('0xe')][_0xdbe4('0x10')]);}else{logger[_0xdbe4('0x11')]('CmCompany,\x20%s,\x20%s',_0x2cb689,_0xdbe4('0xc'));_0x4d1e46(_0x5760eb[_0xdbe4('0x12')][_0xdbe4('0x10')]);}})[_0xdbe4('0x13')](function(_0x541998){logger[_0xdbe4('0xe')](_0xdbe4('0xa'),_0x2cb689,_0x541998);_0x5900ce(_0x541998);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index b53faad..30544d6 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 _0xa6b0=['util','express','Router','../../components/auth/service','../../config/environment','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','put','update','destroy','exports','multer'];(function(_0x897b7d,_0x327515){var _0x7bec39=function(_0x224b2e){while(--_0x224b2e){_0x897b7d['push'](_0x897b7d['shift']());}};_0x7bec39(++_0x327515);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x376dc6,_0x2e1e20){_0x376dc6=_0x376dc6-0x0;var _0xb052c9=_0xa6b0[_0x376dc6];return _0xb052c9;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var auth=require(_0x0a6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a6b('0x5'));var controller=require(_0x0a6b('0x6'));router[_0x0a6b('0x7')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x9')]);router[_0x0a6b('0x7')](_0x0a6b('0xa'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xb')]);router[_0x0a6b('0x7')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller['show']);router['get'](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xe')]);router[_0x0a6b('0xf')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x10')]);router[_0x0a6b('0xf')](_0x0a6b('0xd'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x11')]);router[_0x0a6b('0x12')](_0x0a6b('0xc'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x13')]);router['delete']('/:id',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x14')]);module[_0x0a6b('0x15')]=router; \ No newline at end of file +var _0x90b1=['destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/describe','isAuthenticated','describe','/:id','/:id/contacts','getContacts','post','create','addContacts','update','delete'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x90b1,0x1bb));var _0x190b=function(_0x21a69e,_0x4c15ae){_0x21a69e=_0x21a69e-0x0;var _0x5f3e66=_0x90b1[_0x21a69e];return _0x5f3e66;};'use strict';var multer=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var path=require(_0x190b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x190b('0x3')]();var auth=require(_0x190b('0x4'));var interaction=require(_0x190b('0x5'));var config=require(_0x190b('0x6'));var controller=require('./cmCompany.controller');router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x190b('0x7')](_0x190b('0x8'),auth[_0x190b('0x9')](),controller[_0x190b('0xa')]);router[_0x190b('0x7')](_0x190b('0xb'),auth[_0x190b('0x9')](),controller['show']);router[_0x190b('0x7')](_0x190b('0xc'),auth[_0x190b('0x9')](),controller[_0x190b('0xd')]);router[_0x190b('0xe')]('/',auth[_0x190b('0x9')](),controller[_0x190b('0xf')]);router[_0x190b('0xe')]('/:id/contacts',auth[_0x190b('0x9')](),controller[_0x190b('0x10')]);router['put'](_0x190b('0xb'),auth[_0x190b('0x9')](),controller[_0x190b('0x11')]);router[_0x190b('0x12')](_0x190b('0xb'),auth[_0x190b('0x9')](),controller[_0x190b('0x13')]);module[_0x190b('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.attributes.js b/server/api/cmContact/cmContact.attributes.js index 4399b30..0c18026 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 _0x18be=['STRING','TEXT','INTEGER','UNSIGNED','DATE','lodash','exports'];(function(_0x2df16c,_0x1e0bf7){var _0x48caa3=function(_0x2c7659){while(--_0x2c7659){_0x2df16c['push'](_0x2df16c['shift']());}};_0x48caa3(++_0x1e0bf7);}(_0x18be,0xc2));var _0xe18b=function(_0x2f56b0,_0x5cb656){_0x2f56b0=_0x2f56b0-0x0;var _0x310bbf=_0x18be[_0x2f56b0];return _0x310bbf;};'use strict';var _=require(_0xe18b('0x0'));var Sequelize=require('sequelize');module[_0xe18b('0x1')]={'firstName':{'type':Sequelize[_0xe18b('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0xe18b('0x2')]},'street':{'type':Sequelize[_0xe18b('0x2')]},'postalCode':{'type':Sequelize[_0xe18b('0x2')]},'city':{'type':Sequelize[_0xe18b('0x2')]},'country':{'type':Sequelize[_0xe18b('0x2')]},'dateOfBirth':{'type':Sequelize[_0xe18b('0x2')]},'description':{'type':Sequelize[_0xe18b('0x3')]},'phone':{'type':Sequelize[_0xe18b('0x2')]},'mobile':{'type':Sequelize[_0xe18b('0x2')]},'fax':{'type':Sequelize[_0xe18b('0x2')]},'email':{'type':Sequelize[_0xe18b('0x2')]},'url':{'type':Sequelize[_0xe18b('0x2')]},'facebook':{'type':Sequelize[_0xe18b('0x2')]},'fb_data':{'type':Sequelize['STRING']},'twitter':{'type':Sequelize[_0xe18b('0x2')]},'skype':{'type':Sequelize['STRING']},'teams':{'type':Sequelize[_0xe18b('0x2')]},'viber':{'type':Sequelize['STRING']},'line':{'type':Sequelize[_0xe18b('0x2')]},'wechat':{'type':Sequelize[_0xe18b('0x2')]},'telegram':{'type':Sequelize[_0xe18b('0x2')]},'UserId':{'type':Sequelize[_0xe18b('0x4')]},'priority':{'type':Sequelize['INTEGER'](0x2)[_0xe18b('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xe18b('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x15b8=['UNSIGNED','NOW','lodash','sequelize','exports','STRING','TEXT','INTEGER'];(function(_0x317461,_0x5af00a){var _0x5a1698=function(_0x19595e){while(--_0x19595e){_0x317461['push'](_0x317461['shift']());}};_0x5a1698(++_0x5af00a);}(_0x15b8,0x1aa));var _0x815b=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x15b8[_0x167cc1];return _0x10bc4b;};'use strict';var _=require(_0x815b('0x0'));var Sequelize=require(_0x815b('0x1'));module[_0x815b('0x2')]={'firstName':{'type':Sequelize[_0x815b('0x3')],'allowNull':![]},'lastName':{'type':Sequelize[_0x815b('0x3')]},'street':{'type':Sequelize[_0x815b('0x3')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize['STRING']},'country':{'type':Sequelize['STRING']},'dateOfBirth':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x815b('0x4')]},'phone':{'type':Sequelize[_0x815b('0x3')]},'mobile':{'type':Sequelize[_0x815b('0x3')]},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x815b('0x3')]},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize[_0x815b('0x3')]},'fb_data':{'type':Sequelize[_0x815b('0x3')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x815b('0x3')]},'teams':{'type':Sequelize[_0x815b('0x3')]},'viber':{'type':Sequelize[_0x815b('0x3')]},'line':{'type':Sequelize['STRING']},'wechat':{'type':Sequelize['STRING']},'telegram':{'type':Sequelize[_0x815b('0x3')]},'UserId':{'type':Sequelize[_0x815b('0x5')]},'priority':{'type':Sequelize[_0x815b('0x5')](0x2)[_0x815b('0x6')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x815b('0x7')]}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index f8d774f..623425c 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 _0x505b=['ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./cmContact.socket','register','status','end','count','offset','set','Content-Range','json','apply','reject','save','then','destroy','sendStatus','error','stack','name','send','CmContact','keys','cf_','push','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','filters','select','field','color','from','cm_contacts','cm_user_has_contacts','left_join','cm_contact_has_tags','ct.CmContactId\x20=\x20c.id','tools_tags','t.id\x20=\x20ct.TagId','expr','search','parseSearch','conditions','Tag','split','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','uc.UserId\x20=\x20?','value','dateOfBirth','datetime','castTo','DATE','buildExpression','start','map','filter','isNil','Contact','isEmpty','ListId','where','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','tag','replace','\x27\x27\x27\x27','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','isNumeric','c.id\x20LIKE\x20?','c.mobile\x20LIKE\x20?','c.fax\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','c.firstName\x20LIKE\x20?','c.lastName\x20LIKE\x20?','group','c.id','Sequelize','QueryTypes','SELECT','DESC','having','t.id\x20IN\x20?','resolve','some','getLists','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.ListId','c.deletedAt','TagIds','Tags','catch','find','describe','tags','startsWith','columnName','displayName','CmCustomField','findAll','alias','custom','type','values','merge','body','get','mergeWith','isArray','join','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','CmHopper','[CmContact][merge][destroy][CmHopper],\x20%s','CmHopperBlack','create','update','ChatOfflineMessage','MailInteraction','MailMessage','SmsMessage','FaxInteraction','FaxMessage','OpenchannelMessage','CmHopperFinal','CmHopperHistory','ReportAgentPreview','VoiceCallReport','ChatQueueReport','FaxQueueReport','MailQueueReport','OpenchannelQueueReport','SmsQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','show','params','$and','omit','cf_%d','format','setFields','phone','getTags','rawAttributes','sort','pick','setTags','ids','getHoppers','findOne','includeAll','rows','getHopperHistories','ContactId','options','include','getJscriptySessions','JscriptySessionReport','uploadCsv','No\x20association\x20keys\x20specified!','No\x20association\x20values\x20specified!','socket_timestamp','binding_values','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','No\x20firstName\x20column\x20specified','root','server/files/tmp','file','filename','0777','child_process','fork','../../components/import/cm/csv','binding_keys','CompanyId','File\x20uploaded\x20correctly!','pid','upload','createReadStream','path','parse','import','agent','No\x20ListId\x20specified','binding','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','../../components/import/cm/csv2','stringify','message','start\x20child\x20process\x20correctly!','exit','error\x20child\x20process','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3e3bb2,_0x126ba8){var _0x198d14=function(_0x5cc0dd){while(--_0x5cc0dd){_0x3e3bb2['push'](_0x3e3bb2['shift']());}};_0x198d14(++_0x126ba8);}(_0x505b,0x1d4));var _0xb505=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0x505b[_0x2be8c2];return _0x97f531;};'use strict';var pdf=require(_0xb505('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb505('0x1'));var zipdir=require(_0xb505('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb505('0x3'));var moment=require(_0xb505('0x4'));var BPromise=require(_0xb505('0x5'));var Mustache=require('mustache');var util=require(_0xb505('0x6'));var path=require('path');var sox=require(_0xb505('0x7'));var csv=require(_0xb505('0x8'));var ejs=require(_0xb505('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb505('0xa'));var crypto=require(_0xb505('0xb'));var jsforce=require(_0xb505('0xc'));var deskjs=require(_0xb505('0xd'));var toCsv=require(_0xb505('0x8'));var querystring=require(_0xb505('0xe'));var Papa=require(_0xb505('0xf'));var Redis=require(_0xb505('0x10'));var authService=require(_0xb505('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb505('0x12'));var hardwareService=require(_0xb505('0x13'));var logger=require('../../config/logger')(_0xb505('0x14'));var utils=require(_0xb505('0x15'));var config=require(_0xb505('0x16'));var db=require(_0xb505('0x17'))['db'];config[_0xb505('0x18')]=_[_0xb505('0x19')](config[_0xb505('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb505('0x1a'))[_0xb505('0x1b')](socket);function respondWithStatusCode(_0x472dd5,_0xb9f5cf){_0xb9f5cf=_0xb9f5cf||0xcc;return function(_0x1c2b52){if(_0x1c2b52){return _0x472dd5['sendStatus'](_0xb9f5cf);}return _0x472dd5[_0xb505('0x1c')](_0xb9f5cf)[_0xb505('0x1d')]();};}function respondWithResult(_0x316db3,_0x443a8d){_0x443a8d=_0x443a8d||0xc8;return function(_0x42c4c2){if(_0x42c4c2){return _0x316db3[_0xb505('0x1c')](_0x443a8d)['json'](_0x42c4c2);}};}function respondWithFilteredResult(_0x481670,_0x6afe68){return function(_0x559357){if(_0x559357){var _0x283502=_0x559357[_0xb505('0x1e')],_0x3755e3=_0x6afe68[_0xb505('0x1f')],_0x498b24=_0x6afe68[_0xb505('0x1f')]+_0x6afe68['limit'],_0x2f5eb1;if(_0x498b24>=_0x283502){_0x498b24=_0x283502;_0x2f5eb1=0xc8;}else{_0x2f5eb1=0xce;}_0x481670[_0xb505('0x1c')](_0x2f5eb1);return _0x481670[_0xb505('0x20')](_0xb505('0x21'),_0x3755e3+'-'+_0x498b24+'/'+_0x283502)[_0xb505('0x22')](_0x559357);}return null;};}function patchUpdates(_0x2a93df){return function(_0x26df4a){try{jsonpatch[_0xb505('0x23')](_0x26df4a,_0x2a93df,!![]);}catch(_0x190f60){return BPromise[_0xb505('0x24')](_0x190f60);}return _0x26df4a[_0xb505('0x25')]();};}function saveUpdates(_0x52f775,_0x50ceef){return function(_0x31a0a5){if(_0x31a0a5){return _0x31a0a5['update'](_0x52f775)[_0xb505('0x26')](function(_0x1353a8){return _0x1353a8;});}return null;};}function removeEntity(_0x16f0d9,_0x202c68){return function(_0x3fb1b9){if(_0x3fb1b9){return _0x3fb1b9[_0xb505('0x27')]()[_0xb505('0x26')](function(){_0x16f0d9[_0xb505('0x1c')](0xcc)[_0xb505('0x1d')]();});}};}function handleEntityNotFound(_0x15e26e,_0x36c759){return function(_0x2f843f){if(!_0x2f843f){_0x15e26e[_0xb505('0x28')](0x194);}return _0x2f843f;};}function handleError(_0x29f30d,_0x35483a){_0x35483a=_0x35483a||0x1f4;return function(_0x5e6d8a){logger[_0xb505('0x29')](_0x5e6d8a[_0xb505('0x2a')]);if(_0x5e6d8a[_0xb505('0x2b')]){delete _0x5e6d8a['name'];}_0x29f30d[_0xb505('0x1c')](_0x35483a)[_0xb505('0x2c')](_0x5e6d8a);};}exports['index']=function(_0x2aa409,_0x36666f){var _0xef663f={},_0x4d89b5={},_0x1a39b2={'count':0x0,'rows':[]};return db[_0xb505('0x2d')]['describe']()[_0xb505('0x26')](function(_0x137901){var _0x8a1a17=[];for(var _0x39738c=0x0;_0x39738c0x1){_0x4569c5['or'](_0xb505('0x63'),qs[_0xb505('0x64')](_0x15acbe),null);}else{if(qs[_0xb505('0x65')](_0x15acbe)){_0x4569c5['or'](_0xb505('0x66'),_0x15acbe+'%');_0x4569c5['or']('c.phone\x20LIKE\x20?',_0x15acbe+'%');_0x4569c5['or'](_0xb505('0x67'),_0x15acbe+'%');_0x4569c5['or'](_0xb505('0x68'),_0x15acbe+'%');}else if(qs[_0xb505('0x69')](_0x15acbe)){_0x4569c5['or'](_0xb505('0x6a'),_0x15acbe+'%');}else{_0x4569c5['or'](_0xb505('0x6b'),'%'+_0x15acbe+'%');_0x4569c5['or'](_0xb505('0x6c'),'%'+_0x15acbe+'%');_0x4569c5['or'](_0xb505('0x6a'),'%'+_0x15acbe+'%');}}}}_0x469b61[_0xb505('0x5e')](_0x4569c5);_0x469b61[_0xb505('0x6d')](_0xb505('0x6e'));var _0x1143aa={'type':db[_0xb505('0x6f')][_0xb505('0x70')][_0xb505('0x71')],'raw':!![]};var _0x1cfcc7=_0x469b61['clone']()[_0xb505('0x3d')](_0xb505('0x6e'));if(_0xef663f[_0xb505('0x3a')]){_0xef663f['order'][_0xb505('0x4d')](function(_0x1c07b3){_0x469b61['order']('c.'+_0x1c07b3[0x0],_0x1c07b3[0x1]===_0xb505('0x72')?![]:!![]);});}if(!_['isEmpty'](_0x2df64b)){_0x469b61[_0xb505('0x73')](_0x275b17);_0x1cfcc7[_0xb505('0x5e')](_0xb505('0x74'),_0x2df64b);}BPromise[_0xb505('0x75')]()['then'](function(){if(_0x41cafb&&!_[_0xb505('0x76')](_0x41cafb[_0xb505('0x4a')],[_0xb505('0x3d'),_0xb505('0x4f')])){return _0x2aa409['user'][_0xb505('0x77')]({'attributes':['id'],'raw':!![]})[_0xb505('0x26')](function(_0x21be87){if(_[_0xb505('0x5c')](_0x21be87)){_0x1cfcc7['where'](_0xb505('0x78'));_0x469b61[_0xb505('0x5e')](_0xb505('0x78'));}else{_0x1cfcc7['where']('c.ListId\x20IN\x20?',_['map'](_0x21be87,'id'));_0x469b61['where'](_0xb505('0x79'),_[_0xb505('0x58')](_0x21be87,'id'));}});}else{return;}})['then'](function(){db[_0xb505('0x7a')]['query'](_0x1cfcc7[_0xb505('0x7b')](),_0x1143aa)[_0xb505('0x26')](function(_0x4e833b){_0x1a39b2[_0xb505('0x1e')]=_0x4e833b['length'];if(_0x1a39b2[_0xb505('0x1e')]===0x0)return[];return db['sequelize'][_0xb505('0x32')](_0x5acd93['toString'](),_0x1143aa);})[_0xb505('0x26')](function(_0x4de07f){_0x24f05=_[_0xb505('0x7c')](_0x4de07f,'id');_0x1143aa=_['merge'](_0x1143aa,{'model':db[_0xb505('0x2d')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2aa409['query'][_0xb505('0x35')]){_0xef663f[_0xb505('0x33')]['forEach'](function(_0x3e3766){_0x469b61[_0xb505('0x3d')]('c.'+_0x3e3766);});}else{_0x469b61[_0xb505('0x3d')](_0xb505('0x6e'));_0x469b61[_0xb505('0x3d')](_0xb505('0x7d'));_0x469b61[_0xb505('0x3d')](_0xb505('0x7e'));_0x469b61[_0xb505('0x3d')](_0xb505('0x7f'));_0x469b61[_0xb505('0x3d')](_0xb505('0x80'));_0x469b61['field'](_0xb505('0x81'));_0x469b61[_0xb505('0x3d')]('c.email');_0x469b61[_0xb505('0x3d')](_0xb505('0x82'));_0x469b61[_0xb505('0x3d')](_0xb505('0x83'));_0x469b61[_0xb505('0x3d')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xb505('0x84'));}if(_0xef663f[_0xb505('0x39')])_0x469b61[_0xb505('0x39')](_0xef663f['limit']);if(_0xef663f[_0xb505('0x1f')])_0x469b61[_0xb505('0x1f')](_0xef663f[_0xb505('0x1f')]);return db['sequelize']['query'](_0x469b61['toString'](),_0x1143aa);})[_0xb505('0x26')](function(_0x3e1b01){_0x3e1b01[_0xb505('0x4d')](function(_0x336ff2){if(_0x336ff2[_0xb505('0x84')]){_0x336ff2[_0xb505('0x85')]=[];_0x336ff2[_0xb505('0x84')][_0xb505('0x4c')](',')['forEach'](function(_0x32f2e6){_0x336ff2[_0xb505('0x85')][_0xb505('0x30')](_0x24f05[_0x32f2e6]);});}delete _0x336ff2[_0xb505('0x84')];});_0x1a39b2['rows']=_0x3e1b01;return _0x1a39b2;})[_0xb505('0x26')](respondWithFilteredResult(_0x36666f,_0xef663f));});})[_0xb505('0x86')](handleError(_0x36666f,null));};exports[_0xb505('0x27')]=function(_0x33cc8c,_0x4ab1d1){return db[_0xb505('0x2d')][_0xb505('0x87')]({'where':{'id':_0x33cc8c['params']['id']}})['then'](handleEntityNotFound(_0x4ab1d1,null))[_0xb505('0x26')](removeEntity(_0x4ab1d1,null))['catch'](handleError(_0x4ab1d1,null));};exports['describe']=function(_0x3c5f32,_0x4ad7f8){return db['CmContact'][_0xb505('0x88')]()[_0xb505('0x26')](function(_0x355b47){delete _0x355b47[_0xb505('0x89')];for(var _0x1bfd25=0x0;_0x1bfd25=_0x1ff3e4){_0x4c6aa2=_0x1ff3e4;_0x1bda91=0xc8;}else{_0x1bda91=0xce;}_0x46b27f[_0xac51('0x19')](_0x1bda91);return _0x46b27f[_0xac51('0x1e')](_0xac51('0x1f'),_0x3cff0f+'-'+_0x4c6aa2+'/'+_0x1ff3e4)[_0xac51('0x20')](_0x34cf7f);}return null;};}function patchUpdates(_0x5316d9){return function(_0x25be13){try{jsonpatch[_0xac51('0x21')](_0x25be13,_0x5316d9,!![]);}catch(_0x216014){return BPromise['reject'](_0x216014);}return _0x25be13[_0xac51('0x22')]();};}function saveUpdates(_0x2c3f2e,_0x363270){return function(_0x3bfc5b){if(_0x3bfc5b){return _0x3bfc5b[_0xac51('0x23')](_0x2c3f2e)[_0xac51('0x24')](function(_0xd2d9aa){return _0xd2d9aa;});}return null;};}function removeEntity(_0x679662,_0x201ece){return function(_0x2f888c){if(_0x2f888c){return _0x2f888c['destroy']()[_0xac51('0x24')](function(){_0x679662['status'](0xcc)[_0xac51('0x1a')]();});}};}function handleEntityNotFound(_0x2b8fd8,_0x3eb464){return function(_0x559d93){if(!_0x559d93){_0x2b8fd8[_0xac51('0x18')](0x194);}return _0x559d93;};}function handleError(_0x273f58,_0x36f483){_0x36f483=_0x36f483||0x1f4;return function(_0x30dbe8){logger[_0xac51('0x25')](_0x30dbe8[_0xac51('0x26')]);if(_0x30dbe8[_0xac51('0x27')]){delete _0x30dbe8[_0xac51('0x27')];}_0x273f58[_0xac51('0x19')](_0x36f483)['send'](_0x30dbe8);};}exports[_0xac51('0x28')]=function(_0x2320a7,_0x596f40){var _0x2b64a4={},_0x1caa63={},_0x4861a1={'count':0x0,'rows':[]};return db[_0xac51('0x29')][_0xac51('0x2a')]()[_0xac51('0x24')](function(_0x580589){var _0x59edd4=[];for(var _0x4ba6cd=0x0;_0x4ba6cd0x1){_0x1c65c5['or'](_0xac51('0x69'),qs[_0xac51('0x6a')](_0x20230d),null);}else{if(qs[_0xac51('0x6b')](_0x20230d)){_0x1c65c5['or']('c.id\x20LIKE\x20?',_0x20230d+'%');_0x1c65c5['or'](_0xac51('0x6c'),_0x20230d+'%');_0x1c65c5['or'](_0xac51('0x6d'),_0x20230d+'%');_0x1c65c5['or'](_0xac51('0x6e'),_0x20230d+'%');}else if(qs[_0xac51('0x6f')](_0x20230d)){_0x1c65c5['or'](_0xac51('0x70'),_0x20230d+'%');}else{_0x1c65c5['or'](_0xac51('0x71'),'%'+_0x20230d+'%');_0x1c65c5['or']('c.lastName\x20LIKE\x20?','%'+_0x20230d+'%');_0x1c65c5['or']('c.email\x20LIKE\x20?','%'+_0x20230d+'%');}}}}_0x1bff62[_0xac51('0x49')](_0x1c65c5);_0x1bff62[_0xac51('0x72')](_0xac51('0x73'));var _0x1c7582={'type':db['Sequelize']['QueryTypes'][_0xac51('0x74')],'raw':!![]};var _0x23b9e5=_0x1bff62[_0xac51('0x75')]()[_0xac51('0x3f')](_0xac51('0x73'));if(_0x2b64a4['order']){_0x2b64a4[_0xac51('0x3c')]['forEach'](function(_0x122c8d){_0x1bff62[_0xac51('0x3c')]('c.'+_0x122c8d[0x0],_0x122c8d[0x1]===_0xac51('0x76')?![]:!![]);});}if(!_[_0xac51('0x77')](_0x2ed041)){_0x1bff62[_0xac51('0x78')](_0x32fc9b);_0x23b9e5[_0xac51('0x49')](_0xac51('0x79'),_0x2ed041);}BPromise['resolve']()['then'](function(){if(_0xcb7154&&!_['some'](_0xcb7154[_0xac51('0x4d')],[_0xac51('0x3f'),_0xac51('0x55')])){return _0x2320a7[_0xac51('0x7a')][_0xac51('0x7b')]({'attributes':['id'],'raw':!![]})[_0xac51('0x24')](function(_0x1d71a4){if(_['isEmpty'](_0x1d71a4)){_0x23b9e5['where'](_0xac51('0x7c'));_0x1bff62[_0xac51('0x49')](_0xac51('0x7c'));}else{_0x23b9e5['where'](_0xac51('0x60'),_['map'](_0x1d71a4,'id'));_0x1bff62[_0xac51('0x49')](_0xac51('0x60'),_[_0xac51('0x52')](_0x1d71a4,'id'));}});}else{return;}})[_0xac51('0x24')](function(){db[_0xac51('0x7d')][_0xac51('0x34')](_0x23b9e5[_0xac51('0x7e')](),_0x1c7582)['then'](function(_0x4bc01a){_0x4861a1[_0xac51('0x1b')]=_0x4bc01a[_0xac51('0x2c')];if(_0x4861a1[_0xac51('0x1b')]===0x0)return[];return db[_0xac51('0x7d')][_0xac51('0x34')](_0x2776a1[_0xac51('0x7e')](),_0x1c7582);})[_0xac51('0x24')](function(_0x1c1429){_0x25d5ca=_['keyBy'](_0x1c1429,'id');_0x1c7582=_[_0xac51('0x7f')](_0x1c7582,{'model':db['CmContact'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x2320a7['query'][_0xac51('0x39')]){_0x2b64a4[_0xac51('0x38')]['forEach'](function(_0x3f63c3){_0x1bff62[_0xac51('0x3f')]('c.'+_0x3f63c3);});}else{_0x1bff62[_0xac51('0x3f')](_0xac51('0x73'));_0x1bff62[_0xac51('0x3f')](_0xac51('0x80'));_0x1bff62[_0xac51('0x3f')]('c.lastName');_0x1bff62[_0xac51('0x3f')](_0xac51('0x81'));_0x1bff62[_0xac51('0x3f')](_0xac51('0x82'));_0x1bff62['field']('c.fax');_0x1bff62[_0xac51('0x3f')](_0xac51('0x83'));_0x1bff62[_0xac51('0x3f')](_0xac51('0x84'));_0x1bff62[_0xac51('0x3f')](_0xac51('0x85'));_0x1bff62[_0xac51('0x3f')](_0xac51('0x86'),'TagIds');}if(_0x2b64a4[_0xac51('0x1d')])_0x1bff62[_0xac51('0x1d')](_0x2b64a4['limit']);if(_0x2b64a4[_0xac51('0x1c')])_0x1bff62[_0xac51('0x1c')](_0x2b64a4[_0xac51('0x1c')]);return db[_0xac51('0x7d')][_0xac51('0x34')](_0x1bff62['toString'](),_0x1c7582);})['then'](function(_0xd2a860){_0xd2a860['forEach'](function(_0x4908c2){if(_0x4908c2[_0xac51('0x87')]){_0x4908c2[_0xac51('0x88')]=[];_0x4908c2[_0xac51('0x87')][_0xac51('0x51')](',')['forEach'](function(_0x12f332){_0x4908c2[_0xac51('0x88')][_0xac51('0x5e')](_0x25d5ca[_0x12f332]);});}delete _0x4908c2[_0xac51('0x87')];});_0x4861a1[_0xac51('0x89')]=_0xd2a860;return _0x4861a1;})[_0xac51('0x24')](respondWithFilteredResult(_0x596f40,_0x2b64a4));});})['catch'](handleError(_0x596f40,null));};exports[_0xac51('0x8a')]=function(_0x312d6a,_0x5c5b10){return db['CmContact'][_0xac51('0x4e')]({'where':{'id':_0x312d6a[_0xac51('0x8b')]['id']}})[_0xac51('0x24')](handleEntityNotFound(_0x5c5b10,null))[_0xac51('0x24')](removeEntity(_0x5c5b10,null))[_0xac51('0x8c')](handleError(_0x5c5b10,null));};exports[_0xac51('0x2a')]=function(_0x37bd51,_0x36590f){return db[_0xac51('0x29')]['describe']()['then'](function(_0x5c69ac){delete _0x5c69ac[_0xac51('0x8d')];for(var _0x11398e=0x0;_0x11398e{}\s\\|]/g,'-');_0x2ab57c(null,util['format'](_0x5dbf('0x1c'),path[_0x5dbf('0x1d')](_0x358d46[_0x5dbf('0x1a')],path[_0x5dbf('0x1e')](_0x358d46[_0x5dbf('0x1a')])),Date[_0x5dbf('0x1f')](),path['extname'](_0x358d46[_0x5dbf('0x1a')])));}})});router[_0x5dbf('0x13')](_0x5dbf('0x20'),upload[_0x5dbf('0x21')](_0x5dbf('0x22')),controller[_0x5dbf('0x23')]);var upload=multer({'storage':multer[_0x5dbf('0x18')]({'destination':function(_0x20ab1b,_0x42f13b,_0x15a790){_0x15a790(null,path[_0x5dbf('0x24')](config[_0x5dbf('0x25')],_0x5dbf('0x19')));},'filename':function(_0x407741,_0x729d8f,_0x17f135){_0x729d8f[_0x5dbf('0x1a')]=_0x729d8f[_0x5dbf('0x1a')][_0x5dbf('0x1b')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x17f135(null,util[_0x5dbf('0x26')](_0x5dbf('0x1c'),path[_0x5dbf('0x1d')](_0x729d8f[_0x5dbf('0x1a')],path['extname'](_0x729d8f[_0x5dbf('0x1a')])),Date[_0x5dbf('0x1f')](),path[_0x5dbf('0x1e')](_0x729d8f[_0x5dbf('0x1a')])));}})});router[_0x5dbf('0x13')](_0x5dbf('0x27'),upload[_0x5dbf('0x21')](_0x5dbf('0x22')),controller[_0x5dbf('0x28')]);router[_0x5dbf('0x13')](_0x5dbf('0x29'),auth['isAuthenticated'](),controller['import']);router[_0x5dbf('0x2a')](_0x5dbf('0xc'),auth[_0x5dbf('0x8')](),controller[_0x5dbf('0x2b')]);router[_0x5dbf('0x2c')]('/:id',auth['isAuthenticated'](),controller[_0x5dbf('0x2d')]);module[_0x5dbf('0x2e')]=router; \ No newline at end of file +var _0xac9d=['getTags','/:id/hoppers','getHoppers','/:id/hopper_histories','/:id/hopper_finals','/:id/jscripty_sessions','/merge','post','create','/create_many','bulkCreate','setTags','join','originalname','replace','format','%s-%s%s','basename','extname','now','/csv','single','file','uploadCsv','server/files/tmp','/upload','upload','/upload/:id','import','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./cmContact.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/tags'];(function(_0x3ecae3,_0x4f4e68){var _0x48e606=function(_0x208056){while(--_0x208056){_0x3ecae3['push'](_0x3ecae3['shift']());}};_0x48e606(++_0x4f4e68);}(_0xac9d,0x14d));var _0xdac9=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xac9d[_0x369a98];return _0x29565c;};'use strict';var multer=require(_0xdac9('0x0'));var util=require(_0xdac9('0x1'));var path=require(_0xdac9('0x2'));var timeout=require(_0xdac9('0x3'));var express=require(_0xdac9('0x4'));var router=express[_0xdac9('0x5')]();var auth=require(_0xdac9('0x6'));var interaction=require(_0xdac9('0x7'));var config=require('../../config/environment');var controller=require(_0xdac9('0x8'));router['get']('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0xa')]);router[_0xdac9('0xb')](_0xdac9('0xc'),auth[_0xdac9('0x9')](),controller[_0xdac9('0xd')]);router['get'](_0xdac9('0xe'),auth['isAuthenticated'](),controller[_0xdac9('0xf')]);router[_0xdac9('0xb')](_0xdac9('0x10'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x11')]);router[_0xdac9('0xb')](_0xdac9('0x12'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x13')]);router['get'](_0xdac9('0x14'),auth[_0xdac9('0x9')](),controller['getHopperHistories']);router[_0xdac9('0xb')](_0xdac9('0x15'),auth[_0xdac9('0x9')](),controller['getHopperFinals']);router[_0xdac9('0xb')](_0xdac9('0x16'),auth[_0xdac9('0x9')](),controller['getJscriptySessions']);router['post'](_0xdac9('0x17'),auth[_0xdac9('0x9')](),controller['merge']);router[_0xdac9('0x18')]('/',auth[_0xdac9('0x9')](),controller[_0xdac9('0x19')]);router[_0xdac9('0x18')](_0xdac9('0x1a'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x1b')]);router[_0xdac9('0x18')]('/:id/tags',auth[_0xdac9('0x9')](),controller[_0xdac9('0x1c')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1cd239,_0xa57f2d,_0x171df1){_0x171df1(null,path[_0xdac9('0x1d')](config['root'],'server/files/tmp'));},'filename':function(_0x4029fc,_0x20ece3,_0x2b9d91){_0x20ece3[_0xdac9('0x1e')]=_0x20ece3['originalname'][_0xdac9('0x1f')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x2b9d91(null,util[_0xdac9('0x20')](_0xdac9('0x21'),path[_0xdac9('0x22')](_0x20ece3[_0xdac9('0x1e')],path[_0xdac9('0x23')](_0x20ece3[_0xdac9('0x1e')])),Date[_0xdac9('0x24')](),path[_0xdac9('0x23')](_0x20ece3[_0xdac9('0x1e')])));}})});router['post'](_0xdac9('0x25'),upload[_0xdac9('0x26')](_0xdac9('0x27')),controller[_0xdac9('0x28')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e631a,_0x5686db,_0x3ce475){_0x3ce475(null,path[_0xdac9('0x1d')](config['root'],_0xdac9('0x29')));},'filename':function(_0x5105f1,_0x450f91,_0x3743f7){_0x450f91[_0xdac9('0x1e')]=_0x450f91[_0xdac9('0x1e')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3743f7(null,util['format'](_0xdac9('0x21'),path[_0xdac9('0x22')](_0x450f91['originalname'],path['extname'](_0x450f91[_0xdac9('0x1e')])),Date[_0xdac9('0x24')](),path[_0xdac9('0x23')](_0x450f91[_0xdac9('0x1e')])));}})});router[_0xdac9('0x18')](_0xdac9('0x2a'),upload[_0xdac9('0x26')](_0xdac9('0x27')),controller[_0xdac9('0x2b')]);router[_0xdac9('0x18')](_0xdac9('0x2c'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x2d')]);router[_0xdac9('0x2e')](_0xdac9('0xe'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x2f')]);router[_0xdac9('0x30')](_0xdac9('0xe'),auth[_0xdac9('0x9')](),controller[_0xdac9('0x31')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index 8c9d74a..28578fd 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 _0x441d=['parse','values','isArray','sequelize','exports','getDataValue','alias','setDataValue','name','STRING','TEXT','type','select'];(function(_0x3f9024,_0x48d0e5){var _0x3c931c=function(_0x336fdf){while(--_0x336fdf){_0x3f9024['push'](_0x3f9024['shift']());}};_0x3c931c(++_0x48d0e5);}(_0x441d,0xd3));var _0xd441=function(_0x90144f,_0x2c9aea){_0x90144f=_0x90144f-0x0;var _0x3bc16d=_0x441d[_0x90144f];return _0x3bc16d;};'use strict';var Sequelize=require(_0xd441('0x0'));var _=require('lodash');module[_0xd441('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x45ed7b){return this[_0xd441('0x2')](_0xd441('0x3'));}},'alias':{'type':Sequelize['STRING'],'allowNull':![],'set':function(_0xd6e798){this[_0xd441('0x4')]('alias',_0xd6e798?_0xd6e798:this[_0xd441('0x2')](_0xd441('0x5')));}},'type':{'type':Sequelize[_0xd441('0x6')],'allowNull':![]},'values':{'type':Sequelize[_0xd441('0x7')]('long'),'get':function(){if(this[_0xd441('0x2')](_0xd441('0x8'))===_0xd441('0x9')){return JSON[_0xd441('0xa')](this[_0xd441('0x2')]('values'));}else{return this[_0xd441('0x2')](_0xd441('0xb'));}},'set':function(_0x4fc981){if(Array[_0xd441('0xc')](_0x4fc981)){this['setDataValue'](_0xd441('0xb'),JSON['stringify'](_0x4fc981));}else{this[_0xd441('0x4')](_0xd441('0xb'),_0x4fc981);}}},'required':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc0b6=['lodash','alias','STRING','setDataValue','getDataValue','name','TEXT','type','select','parse','values','isArray','BOOLEAN','sequelize'];(function(_0xe6f0ef,_0x2778f7){var _0xbb19af=function(_0x13b0d0){while(--_0x13b0d0){_0xe6f0ef['push'](_0xe6f0ef['shift']());}};_0xbb19af(++_0x2778f7);}(_0xc0b6,0xdf));var _0x6c0b=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xc0b6[_0x501510];return _0x1e6ee5;};'use strict';var Sequelize=require(_0x6c0b('0x0'));var _=require(_0x6c0b('0x1'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2ab17a){return this['getDataValue'](_0x6c0b('0x2'));}},'alias':{'type':Sequelize[_0x6c0b('0x3')],'allowNull':![],'set':function(_0x2bbbf9){this[_0x6c0b('0x4')](_0x6c0b('0x2'),_0x2bbbf9?_0x2bbbf9:this[_0x6c0b('0x5')](_0x6c0b('0x6')));}},'type':{'type':Sequelize['STRING'],'allowNull':![]},'values':{'type':Sequelize[_0x6c0b('0x7')]('long'),'get':function(){if(this[_0x6c0b('0x5')](_0x6c0b('0x8'))===_0x6c0b('0x9')){return JSON[_0x6c0b('0xa')](this[_0x6c0b('0x5')](_0x6c0b('0xb')));}else{return this[_0x6c0b('0x5')]('values');}},'set':function(_0x39d721){if(Array[_0x6c0b('0xc')](_0x39d721)){this[_0x6c0b('0x4')](_0x6c0b('0xb'),JSON['stringify'](_0x39d721));}else{this['setDataValue'](_0x6c0b('0xb'),_0x39d721);}}},'required':{'type':Sequelize[_0x6c0b('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index e407d83..afb5f6b 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 _0xa2a5=['VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','rawAttributes','find','body','params','create','sequelize','TEXT','Sequelize','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','util','sox','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','sendStatus','status','end','json','offset','limit','set','apply','reject','save','update','then','destroy','error','stack','name','index','map','CmCustomField','fieldName','type','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge'];(function(_0x50e473,_0x561c53){var _0x1ebcde=function(_0x5eff9a){while(--_0x5eff9a){_0x50e473['push'](_0x50e473['shift']());}};_0x1ebcde(++_0x561c53);}(_0xa2a5,0x1f4));var _0x5a2a=function(_0x15988d,_0x27fce8){_0x15988d=_0x15988d-0x0;var _0x4e873b=_0xa2a5[_0x15988d];return _0x4e873b;};'use strict';var pdf=require(_0x5a2a('0x0'));var emlformat=require(_0x5a2a('0x1'));var rimraf=require(_0x5a2a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5a2a('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5a2a('0x4'));var Mustache=require('mustache');var util=require(_0x5a2a('0x5'));var path=require('path');var sox=require(_0x5a2a('0x6'));var csv=require(_0x5a2a('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5a2a('0x8'));var squel=require(_0x5a2a('0x9'));var crypto=require(_0x5a2a('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5a2a('0xb'));var toCsv=require(_0x5a2a('0x7'));var querystring=require(_0x5a2a('0xc'));var Papa=require('papaparse');var Redis=require(_0x5a2a('0xd'));var authService=require(_0x5a2a('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5a2a('0xf'));var logger=require(_0x5a2a('0x10'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20a5c1,_0x148066){_0x148066=_0x148066||0xcc;return function(_0x148963){if(_0x148963){return _0x20a5c1[_0x5a2a('0x11')](_0x148066);}return _0x20a5c1[_0x5a2a('0x12')](_0x148066)[_0x5a2a('0x13')]();};}function respondWithResult(_0x57ddd0,_0x13e232){_0x13e232=_0x13e232||0xc8;return function(_0x41d5c1){if(_0x41d5c1){return _0x57ddd0[_0x5a2a('0x12')](_0x13e232)[_0x5a2a('0x14')](_0x41d5c1);}};}function respondWithFilteredResult(_0x3af35f,_0x2c15c1){return function(_0x2fcd9e){if(_0x2fcd9e){var _0x468b36=_0x2fcd9e['count'],_0x4dc75c=_0x2c15c1[_0x5a2a('0x15')],_0x3fcf23=_0x2c15c1[_0x5a2a('0x15')]+_0x2c15c1[_0x5a2a('0x16')],_0x4a3820;if(_0x3fcf23>=_0x468b36){_0x3fcf23=_0x468b36;_0x4a3820=0xc8;}else{_0x4a3820=0xce;}_0x3af35f[_0x5a2a('0x12')](_0x4a3820);return _0x3af35f[_0x5a2a('0x17')]('Content-Range',_0x4dc75c+'-'+_0x3fcf23+'/'+_0x468b36)[_0x5a2a('0x14')](_0x2fcd9e);}return null;};}function patchUpdates(_0x5779f5){return function(_0x3fbbdb){try{jsonpatch[_0x5a2a('0x18')](_0x3fbbdb,_0x5779f5,!![]);}catch(_0x198c8a){return BPromise[_0x5a2a('0x19')](_0x198c8a);}return _0x3fbbdb[_0x5a2a('0x1a')]();};}function saveUpdates(_0x1a17eb,_0x232c7e){return function(_0xc13484){if(_0xc13484){return _0xc13484[_0x5a2a('0x1b')](_0x1a17eb)[_0x5a2a('0x1c')](function(_0x3277e6){return _0x3277e6;});}return null;};}function removeEntity(_0x2c04fe,_0x543aca){return function(_0x55a918){if(_0x55a918){return _0x55a918[_0x5a2a('0x1d')]()[_0x5a2a('0x1c')](function(){_0x2c04fe[_0x5a2a('0x12')](0xcc)[_0x5a2a('0x13')]();});}};}function handleEntityNotFound(_0x508635,_0x466067){return function(_0x4f7b0b){if(!_0x4f7b0b){_0x508635['sendStatus'](0x194);}return _0x4f7b0b;};}function handleError(_0x4530be,_0x2a3503){_0x2a3503=_0x2a3503||0x1f4;return function(_0x19b6d3){logger[_0x5a2a('0x1e')](_0x19b6d3[_0x5a2a('0x1f')]);if(_0x19b6d3[_0x5a2a('0x20')]){delete _0x19b6d3['name'];}_0x4530be[_0x5a2a('0x12')](_0x2a3503)['send'](_0x19b6d3);};}exports[_0x5a2a('0x21')]=function(_0x156e92,_0x49217d){var _0x1c9a3e={},_0x239e08={},_0x421407={'count':0x0,'rows':[]};var _0x46fca0=_[_0x5a2a('0x22')](db[_0x5a2a('0x23')]['rawAttributes'],function(_0x219807){return{'name':_0x219807[_0x5a2a('0x24')],'type':_0x219807[_0x5a2a('0x25')]['key']};});_0x239e08['model']=_['differenceBy'](_['map'](_0x46fca0,'name'),[_0x5a2a('0x20')]);_0x239e08[_0x5a2a('0x26')]=_[_0x5a2a('0x27')](_0x156e92['query']);_0x239e08[_0x5a2a('0x28')]=_[_0x5a2a('0x29')](_0x239e08[_0x5a2a('0x2a')],_0x239e08[_0x5a2a('0x26')]);_0x1c9a3e[_0x5a2a('0x2b')]=_[_0x5a2a('0x29')](_0x239e08[_0x5a2a('0x2a')],qs[_0x5a2a('0x2c')](_0x156e92[_0x5a2a('0x26')][_0x5a2a('0x2c')]));_0x1c9a3e['attributes']=_0x1c9a3e['attributes'][_0x5a2a('0x2d')]?_0x1c9a3e[_0x5a2a('0x2b')]:_0x239e08[_0x5a2a('0x2a')];if(!_0x156e92[_0x5a2a('0x26')]['hasOwnProperty'](_0x5a2a('0x2e'))){_0x1c9a3e[_0x5a2a('0x16')]=qs[_0x5a2a('0x16')](_0x156e92[_0x5a2a('0x26')][_0x5a2a('0x16')]);_0x1c9a3e[_0x5a2a('0x15')]=qs['offset'](_0x156e92['query']['offset']);}_0x1c9a3e[_0x5a2a('0x2f')]=qs[_0x5a2a('0x30')](_0x156e92['query']['sort']);_0x1c9a3e[_0x5a2a('0x31')]=qs['filters'](_[_0x5a2a('0x32')](_0x156e92[_0x5a2a('0x26')],_0x239e08[_0x5a2a('0x28')]));if(_0x156e92[_0x5a2a('0x26')][_0x5a2a('0x33')]){_0x1c9a3e[_0x5a2a('0x31')]=_[_0x5a2a('0x34')](_0x1c9a3e['where'],{'$or':_[_0x5a2a('0x22')](_0x46fca0,function(_0x1a60d0){if(_0x1a60d0['type']!==_0x5a2a('0x35')){var _0x3f2804={};_0x3f2804[_0x1a60d0[_0x5a2a('0x20')]]={'$like':'%'+_0x156e92[_0x5a2a('0x26')]['filter']+'%'};return _0x3f2804;}})});}_0x1c9a3e=_[_0x5a2a('0x34')]({},_0x1c9a3e,_0x156e92[_0x5a2a('0x36')]);var _0x1bbd6c={'where':_0x1c9a3e[_0x5a2a('0x31')]};return db[_0x5a2a('0x23')][_0x5a2a('0x37')](_0x1bbd6c)[_0x5a2a('0x1c')](function(_0x4f5056){_0x421407['count']=_0x4f5056;if(_0x156e92['query'][_0x5a2a('0x38')]){_0x1c9a3e[_0x5a2a('0x39')]=[{'all':!![]}];}return db[_0x5a2a('0x23')][_0x5a2a('0x3a')](_0x1c9a3e);})[_0x5a2a('0x1c')](function(_0x5b4031){_0x421407[_0x5a2a('0x3b')]=_0x5b4031;return _0x421407;})['then'](respondWithFilteredResult(_0x49217d,_0x1c9a3e))[_0x5a2a('0x3c')](handleError(_0x49217d,null));};exports[_0x5a2a('0x3d')]=function(_0x521ff9,_0x58dc02){var _0xa09bbd={'raw':!![],'where':{'id':_0x521ff9['params']['id']}},_0x32c26e={};_0x32c26e[_0x5a2a('0x2a')]=_[_0x5a2a('0x27')](db[_0x5a2a('0x23')][_0x5a2a('0x3e')]);_0x32c26e[_0x5a2a('0x26')]=_[_0x5a2a('0x27')](_0x521ff9[_0x5a2a('0x26')]);_0x32c26e[_0x5a2a('0x28')]=_[_0x5a2a('0x29')](_0x32c26e['model'],_0x32c26e[_0x5a2a('0x26')]);_0xa09bbd[_0x5a2a('0x2b')]=_[_0x5a2a('0x29')](_0x32c26e['model'],qs[_0x5a2a('0x2c')](_0x521ff9[_0x5a2a('0x26')][_0x5a2a('0x2c')]));_0xa09bbd[_0x5a2a('0x2b')]=_0xa09bbd[_0x5a2a('0x2b')][_0x5a2a('0x2d')]?_0xa09bbd[_0x5a2a('0x2b')]:_0x32c26e[_0x5a2a('0x2a')];if(_0x521ff9[_0x5a2a('0x26')][_0x5a2a('0x38')]){_0xa09bbd[_0x5a2a('0x39')]=[{'all':!![]}];}_0xa09bbd=_[_0x5a2a('0x34')]({},_0xa09bbd,_0x521ff9[_0x5a2a('0x36')]);return db[_0x5a2a('0x23')][_0x5a2a('0x3f')](_0xa09bbd)[_0x5a2a('0x1c')](handleEntityNotFound(_0x58dc02,null))[_0x5a2a('0x1c')](respondWithResult(_0x58dc02,null))['catch'](handleError(_0x58dc02,null));};exports[_0x5a2a('0x1b')]=function(_0x380748,_0x23609d){if(_0x380748[_0x5a2a('0x40')]['id']){delete _0x380748[_0x5a2a('0x40')]['id'];}return db[_0x5a2a('0x23')][_0x5a2a('0x3f')]({'where':{'id':_0x380748['params']['id']}})['then'](handleEntityNotFound(_0x23609d,null))[_0x5a2a('0x1c')](saveUpdates(_0x380748[_0x5a2a('0x40')],null))['then'](respondWithResult(_0x23609d,null))[_0x5a2a('0x3c')](handleError(_0x23609d,null));};exports[_0x5a2a('0x1d')]=function(_0x572498,_0x42de7d){return db['CmCustomField'][_0x5a2a('0x3f')]({'where':{'id':_0x572498[_0x5a2a('0x41')]['id']}})['then'](handleEntityNotFound(_0x42de7d,null))[_0x5a2a('0x1c')](removeEntity(_0x42de7d,null))[_0x5a2a('0x3c')](handleError(_0x42de7d,null));};exports[_0x5a2a('0x42')]=function(_0x5aa05d,_0x1c0cee){var _0x524226;return db[_0x5a2a('0x43')]['transaction'](function(_0x172d10){return db['CmCustomField'][_0x5a2a('0x42')](_0x5aa05d[_0x5a2a('0x40')],{'transaction':_0x172d10})[_0x5a2a('0x1c')](function(_0x40e570){_0x524226=_0x40e570;var _0x5449b5={'type':db['Sequelize'][_0x5a2a('0x44')],'transaction':_0x172d10};switch(_0x5aa05d['body']['type']){case'text':_0x5449b5[_0x5a2a('0x25')]=db['Sequelize'][_0x5a2a('0x44')];break;case'number':_0x5449b5[_0x5a2a('0x25')]=db[_0x5a2a('0x45')][_0x5a2a('0x46')];break;case _0x5a2a('0x47'):_0x5449b5[_0x5a2a('0x25')]=db[_0x5a2a('0x45')][_0x5a2a('0x48')];_0x5449b5[_0x5a2a('0x49')]=![];break;default:}return db[_0x5a2a('0x43')][_0x5a2a('0x4a')][_0x5a2a('0x4b')](_0x5a2a('0x4c'),util[_0x5a2a('0x4d')](_0x5a2a('0x4e'),_0x524226['id']),_0x5449b5);})[_0x5a2a('0x1c')](function(){return _0x524226;});})['then'](respondWithResult(_0x1c0cee,0xc9))['catch'](handleError(_0x1c0cee,null));}; \ No newline at end of file +var _0xf576=['BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','index','map','CmCustomField','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','options','find','body','create','sequelize','transaction','Sequelize','TEXT','text','INTEGER','switch'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xf576,0x1d3));var _0x6f57=function(_0x1de8f1,_0xdd5c76){_0x1de8f1=_0x1de8f1-0x0;var _0x55ce65=_0xf576[_0x1de8f1];return _0x55ce65;};'use strict';var pdf=require(_0x6f57('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f57('0x1'));var zipdir=require(_0x6f57('0x2'));var jsonpatch=require(_0x6f57('0x3'));var rp=require(_0x6f57('0x4'));var moment=require(_0x6f57('0x5'));var BPromise=require(_0x6f57('0x6'));var Mustache=require(_0x6f57('0x7'));var util=require('util');var path=require(_0x6f57('0x8'));var sox=require(_0x6f57('0x9'));var csv=require(_0x6f57('0xa'));var ejs=require(_0x6f57('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6f57('0xc'));var crypto=require(_0x6f57('0xd'));var jsforce=require(_0x6f57('0xe'));var deskjs=require(_0x6f57('0xf'));var toCsv=require(_0x6f57('0xa'));var querystring=require(_0x6f57('0x10'));var Papa=require(_0x6f57('0x11'));var Redis=require(_0x6f57('0x12'));var authService=require(_0x6f57('0x13'));var qs=require(_0x6f57('0x14'));var as=require(_0x6f57('0x15'));var hardwareService=require(_0x6f57('0x16'));var logger=require(_0x6f57('0x17'))(_0x6f57('0x18'));var utils=require(_0x6f57('0x19'));var config=require('../../config/environment');var db=require(_0x6f57('0x1a'))['db'];function respondWithStatusCode(_0x21309c,_0x2e7c11){_0x2e7c11=_0x2e7c11||0xcc;return function(_0x474cce){if(_0x474cce){return _0x21309c[_0x6f57('0x1b')](_0x2e7c11);}return _0x21309c[_0x6f57('0x1c')](_0x2e7c11)['end']();};}function respondWithResult(_0x2355c0,_0x138c38){_0x138c38=_0x138c38||0xc8;return function(_0x1e39dd){if(_0x1e39dd){return _0x2355c0[_0x6f57('0x1c')](_0x138c38)[_0x6f57('0x1d')](_0x1e39dd);}};}function respondWithFilteredResult(_0x2e81d9,_0x4a0903){return function(_0x42a672){if(_0x42a672){var _0x2395e9=_0x42a672[_0x6f57('0x1e')],_0x5e9095=_0x4a0903[_0x6f57('0x1f')],_0x379830=_0x4a0903[_0x6f57('0x1f')]+_0x4a0903[_0x6f57('0x20')],_0x45052a;if(_0x379830>=_0x2395e9){_0x379830=_0x2395e9;_0x45052a=0xc8;}else{_0x45052a=0xce;}_0x2e81d9[_0x6f57('0x1c')](_0x45052a);return _0x2e81d9[_0x6f57('0x21')](_0x6f57('0x22'),_0x5e9095+'-'+_0x379830+'/'+_0x2395e9)['json'](_0x42a672);}return null;};}function patchUpdates(_0x2dd9ff){return function(_0x3ce1c1){try{jsonpatch[_0x6f57('0x23')](_0x3ce1c1,_0x2dd9ff,!![]);}catch(_0x15458d){return BPromise[_0x6f57('0x24')](_0x15458d);}return _0x3ce1c1[_0x6f57('0x25')]();};}function saveUpdates(_0x2cb655,_0x2df37c){return function(_0x4d2ba5){if(_0x4d2ba5){return _0x4d2ba5[_0x6f57('0x26')](_0x2cb655)['then'](function(_0x2d4178){return _0x2d4178;});}return null;};}function removeEntity(_0x1172f6,_0x3403ba){return function(_0x1801c0){if(_0x1801c0){return _0x1801c0[_0x6f57('0x27')]()[_0x6f57('0x28')](function(){_0x1172f6['status'](0xcc)[_0x6f57('0x29')]();});}};}function handleEntityNotFound(_0x33eb07,_0x36f59b){return function(_0x1799c7){if(!_0x1799c7){_0x33eb07[_0x6f57('0x1b')](0x194);}return _0x1799c7;};}function handleError(_0x4c22e3,_0x561843){_0x561843=_0x561843||0x1f4;return function(_0x524b30){logger[_0x6f57('0x2a')](_0x524b30[_0x6f57('0x2b')]);if(_0x524b30[_0x6f57('0x2c')]){delete _0x524b30['name'];}_0x4c22e3[_0x6f57('0x1c')](_0x561843)[_0x6f57('0x2d')](_0x524b30);};}exports[_0x6f57('0x2e')]=function(_0x39b77f,_0x13b25f){var _0x5a5d7b={},_0x2331e9={},_0x44e357={'count':0x0,'rows':[]};var _0x2af97e=_[_0x6f57('0x2f')](db[_0x6f57('0x30')][_0x6f57('0x31')],function(_0xe00ba8){return{'name':_0xe00ba8['fieldName'],'type':_0xe00ba8[_0x6f57('0x32')][_0x6f57('0x33')]};});_0x2331e9[_0x6f57('0x34')]=_['differenceBy'](_['map'](_0x2af97e,_0x6f57('0x2c')),[_0x6f57('0x2c')]);_0x2331e9['query']=_['keys'](_0x39b77f[_0x6f57('0x35')]);_0x2331e9[_0x6f57('0x36')]=_[_0x6f57('0x37')](_0x2331e9['model'],_0x2331e9[_0x6f57('0x35')]);_0x5a5d7b['attributes']=_[_0x6f57('0x37')](_0x2331e9[_0x6f57('0x34')],qs[_0x6f57('0x38')](_0x39b77f[_0x6f57('0x35')]['fields']));_0x5a5d7b[_0x6f57('0x39')]=_0x5a5d7b['attributes'][_0x6f57('0x3a')]?_0x5a5d7b[_0x6f57('0x39')]:_0x2331e9[_0x6f57('0x34')];if(!_0x39b77f['query'][_0x6f57('0x3b')]('nolimit')){_0x5a5d7b['limit']=qs[_0x6f57('0x20')](_0x39b77f['query'][_0x6f57('0x20')]);_0x5a5d7b[_0x6f57('0x1f')]=qs[_0x6f57('0x1f')](_0x39b77f['query'][_0x6f57('0x1f')]);}_0x5a5d7b[_0x6f57('0x3c')]=qs[_0x6f57('0x3d')](_0x39b77f[_0x6f57('0x35')][_0x6f57('0x3d')]);_0x5a5d7b['where']=qs[_0x6f57('0x36')](_[_0x6f57('0x3e')](_0x39b77f[_0x6f57('0x35')],_0x2331e9['filters']));if(_0x39b77f['query'][_0x6f57('0x3f')]){_0x5a5d7b[_0x6f57('0x40')]=_[_0x6f57('0x41')](_0x5a5d7b['where'],{'$or':_[_0x6f57('0x2f')](_0x2af97e,function(_0x10bc87){if(_0x10bc87[_0x6f57('0x32')]!==_0x6f57('0x42')){var _0x2fa9e7={};_0x2fa9e7[_0x10bc87['name']]={'$like':'%'+_0x39b77f['query']['filter']+'%'};return _0x2fa9e7;}})});}_0x5a5d7b=_[_0x6f57('0x41')]({},_0x5a5d7b,_0x39b77f['options']);var _0x3dba1e={'where':_0x5a5d7b[_0x6f57('0x40')]};return db[_0x6f57('0x30')][_0x6f57('0x1e')](_0x3dba1e)[_0x6f57('0x28')](function(_0x17ba69){_0x44e357[_0x6f57('0x1e')]=_0x17ba69;if(_0x39b77f['query'][_0x6f57('0x43')]){_0x5a5d7b[_0x6f57('0x44')]=[{'all':!![]}];}return db[_0x6f57('0x30')][_0x6f57('0x45')](_0x5a5d7b);})[_0x6f57('0x28')](function(_0x39510c){_0x44e357[_0x6f57('0x46')]=_0x39510c;return _0x44e357;})['then'](respondWithFilteredResult(_0x13b25f,_0x5a5d7b))[_0x6f57('0x47')](handleError(_0x13b25f,null));};exports['show']=function(_0x46a22e,_0x49b7ed){var _0x279efa={'raw':!![],'where':{'id':_0x46a22e[_0x6f57('0x48')]['id']}},_0x25d351={};_0x25d351[_0x6f57('0x34')]=_['keys'](db[_0x6f57('0x30')][_0x6f57('0x31')]);_0x25d351[_0x6f57('0x35')]=_[_0x6f57('0x49')](_0x46a22e[_0x6f57('0x35')]);_0x25d351[_0x6f57('0x36')]=_[_0x6f57('0x37')](_0x25d351['model'],_0x25d351[_0x6f57('0x35')]);_0x279efa[_0x6f57('0x39')]=_[_0x6f57('0x37')](_0x25d351[_0x6f57('0x34')],qs['fields'](_0x46a22e['query'][_0x6f57('0x38')]));_0x279efa[_0x6f57('0x39')]=_0x279efa[_0x6f57('0x39')]['length']?_0x279efa['attributes']:_0x25d351[_0x6f57('0x34')];if(_0x46a22e[_0x6f57('0x35')][_0x6f57('0x43')]){_0x279efa['include']=[{'all':!![]}];}_0x279efa=_[_0x6f57('0x41')]({},_0x279efa,_0x46a22e[_0x6f57('0x4a')]);return db[_0x6f57('0x30')][_0x6f57('0x4b')](_0x279efa)[_0x6f57('0x28')](handleEntityNotFound(_0x49b7ed,null))[_0x6f57('0x28')](respondWithResult(_0x49b7ed,null))[_0x6f57('0x47')](handleError(_0x49b7ed,null));};exports[_0x6f57('0x26')]=function(_0x501643,_0x1671be){if(_0x501643[_0x6f57('0x4c')]['id']){delete _0x501643['body']['id'];}return db[_0x6f57('0x30')][_0x6f57('0x4b')]({'where':{'id':_0x501643[_0x6f57('0x48')]['id']}})[_0x6f57('0x28')](handleEntityNotFound(_0x1671be,null))['then'](saveUpdates(_0x501643['body'],null))[_0x6f57('0x28')](respondWithResult(_0x1671be,null))[_0x6f57('0x47')](handleError(_0x1671be,null));};exports['destroy']=function(_0x160163,_0x38a338){return db[_0x6f57('0x30')]['find']({'where':{'id':_0x160163[_0x6f57('0x48')]['id']}})[_0x6f57('0x28')](handleEntityNotFound(_0x38a338,null))['then'](removeEntity(_0x38a338,null))['catch'](handleError(_0x38a338,null));};exports[_0x6f57('0x4d')]=function(_0x51dba4,_0x5b3bc8){var _0x418dff;return db[_0x6f57('0x4e')][_0x6f57('0x4f')](function(_0x2c97c3){return db[_0x6f57('0x30')][_0x6f57('0x4d')](_0x51dba4[_0x6f57('0x4c')],{'transaction':_0x2c97c3})['then'](function(_0x5cc845){_0x418dff=_0x5cc845;var _0x340180={'type':db[_0x6f57('0x50')][_0x6f57('0x51')],'transaction':_0x2c97c3};switch(_0x51dba4[_0x6f57('0x4c')][_0x6f57('0x32')]){case _0x6f57('0x52'):_0x340180[_0x6f57('0x32')]=db['Sequelize'][_0x6f57('0x51')];break;case'number':_0x340180['type']=db[_0x6f57('0x50')][_0x6f57('0x53')];break;case _0x6f57('0x54'):_0x340180[_0x6f57('0x32')]=db[_0x6f57('0x50')][_0x6f57('0x55')];_0x340180[_0x6f57('0x56')]=![];break;default:}return db[_0x6f57('0x4e')][_0x6f57('0x57')][_0x6f57('0x58')](_0x6f57('0x59'),util[_0x6f57('0x5a')](_0x6f57('0x5b'),_0x418dff['id']),_0x340180);})[_0x6f57('0x28')](function(){return _0x418dff;});})[_0x6f57('0x28')](respondWithResult(_0x5b3bc8,0xc9))[_0x6f57('0x47')](handleError(_0x5b3bc8,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index 74292aa..55444aa 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 _0x68cc=['bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','api','moment'];(function(_0x13606d,_0x30f265){var _0x1b85b0=function(_0x285c1b){while(--_0x285c1b){_0x13606d['push'](_0x13606d['shift']());}};_0x1b85b0(++_0x30f265);}(_0x68cc,0x104));var _0xc68c=function(_0x173441,_0x26b0d9){_0x173441=_0x173441-0x0;var _0x2423a8=_0x68cc[_0x173441];return _0x2423a8;};'use strict';var _=require(_0xc68c('0x0'));var util=require(_0xc68c('0x1'));var logger=require('../../config/logger')(_0xc68c('0x2'));var moment=require(_0xc68c('0x3'));var BPromise=require(_0xc68c('0x4'));var rp=require(_0xc68c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc68c('0x6'));var config=require(_0xc68c('0x7'));var attributes=require(_0xc68c('0x8'));module[_0xc68c('0x9')]=function(_0x2878b8,_0x15772f){return _0x2878b8[_0xc68c('0xa')]('CmCustomField',attributes,{'tableName':_0xc68c('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcdc2=['path','rimraf','../../config/environment','./cmCustomField.attributes','exports','define','cm_custom_fields','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x28b1b5,_0x18c30a){var _0x4c3647=function(_0x526f99){while(--_0x526f99){_0x28b1b5['push'](_0x28b1b5['shift']());}};_0x4c3647(++_0x18c30a);}(_0xcdc2,0x19d));var _0x2cdc=function(_0x4cdc21,_0x52325e){_0x4cdc21=_0x4cdc21-0x0;var _0xd1221d=_0xcdc2[_0x4cdc21];return _0xd1221d;};'use strict';var _=require(_0x2cdc('0x0'));var util=require(_0x2cdc('0x1'));var logger=require(_0x2cdc('0x2'))(_0x2cdc('0x3'));var moment=require(_0x2cdc('0x4'));var BPromise=require(_0x2cdc('0x5'));var rp=require(_0x2cdc('0x6'));var fs=require('fs');var path=require(_0x2cdc('0x7'));var rimraf=require(_0x2cdc('0x8'));var config=require(_0x2cdc('0x9'));var attributes=require(_0x2cdc('0xa'));module[_0x2cdc('0xb')]=function(_0x487c5e,_0x581345){return _0x487c5e[_0x2cdc('0xc')]('CmCustomField',attributes,{'tableName':_0x2cdc('0xd'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.rpc.js b/server/api/cmCustomField/cmCustomField.rpc.js index e2b2f1c..47a359a 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 _0x4fdb=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x4ec520,_0x15fee2){var _0xed49d7=function(_0x3031f2){while(--_0x3031f2){_0x4ec520['push'](_0x4ec520['shift']());}};_0xed49d7(++_0x15fee2);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x3f15be,_0x46a71b){_0x3f15be=_0x3f15be-0x0;var _0x189ba9=_0x4fdb[_0x3f15be];return _0x189ba9;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var moment=require(_0xb4fd('0x2'));var BPromise=require(_0xb4fd('0x3'));var rs=require(_0xb4fd('0x4'));var fs=require('fs');var Redis=require(_0xb4fd('0x5'));var db=require(_0xb4fd('0x6'))['db'];var utils=require(_0xb4fd('0x7'));var logger=require(_0xb4fd('0x8'))('rpc');var config=require(_0xb4fd('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xb4fd('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x53273f,_0x299bff,_0x3af8e3){return new BPromise(function(_0x1151b5,_0x52dca2){return client['request'](_0x53273f,_0x3af8e3)[_0xb4fd('0xb')](function(_0x4f9d18){logger[_0xb4fd('0xc')]('CmCustomField,\x20%s,\x20%s',_0x299bff,_0xb4fd('0xd'));logger[_0xb4fd('0xe')](_0xb4fd('0xf'),_0x299bff,_0xb4fd('0xd'),JSON[_0xb4fd('0x10')](_0x4f9d18));if(_0x4f9d18['error']){if(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x12')]===0x1f4){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x4f9d18['error'][_0xb4fd('0x14')]);return _0x52dca2(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}logger['error'](_0xb4fd('0x13'),_0x299bff,_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);return _0x1151b5(_0x4f9d18[_0xb4fd('0x11')][_0xb4fd('0x14')]);}else{logger[_0xb4fd('0xc')](_0xb4fd('0x13'),_0x299bff,'request\x20sent');_0x1151b5(_0x4f9d18[_0xb4fd('0x15')][_0xb4fd('0x14')]);}})[_0xb4fd('0x16')](function(_0x2d4701){logger[_0xb4fd('0x11')](_0xb4fd('0x13'),_0x299bff,_0x2d4701);_0x52dca2(_0x2d4701);});});} \ No newline at end of file +var _0xaba6=['../../mysqldb','../../config/utils','rpc','../../config/environment','request','then','info','CmCustomField,\x20%s,\x20%s','request\x20sent','debug','CmCustomField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xaba6,0xe2));var _0x6aba=function(_0x4e0b8c,_0x443f31){_0x4e0b8c=_0x4e0b8c-0x0;var _0x633ecc=_0xaba6[_0x4e0b8c];return _0x633ecc;};'use strict';var _=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6aba('0x2'))['db'];var utils=require(_0x6aba('0x3'));var logger=require('../../config/logger')(_0x6aba('0x4'));var config=require(_0x6aba('0x5'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x39c32a,_0x54416a,_0x3766d4){return new BPromise(function(_0x1a4fbc,_0x508dff){return client[_0x6aba('0x6')](_0x39c32a,_0x3766d4)[_0x6aba('0x7')](function(_0x4ea8eb){logger[_0x6aba('0x8')](_0x6aba('0x9'),_0x54416a,_0x6aba('0xa'));logger[_0x6aba('0xb')](_0x6aba('0xc'),_0x54416a,_0x6aba('0xa'),JSON[_0x6aba('0xd')](_0x4ea8eb));if(_0x4ea8eb['error']){if(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0xf')]===0x1f4){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb['error'][_0x6aba('0x10')]);return _0x508dff(_0x4ea8eb[_0x6aba('0xe')]['message']);}logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x4ea8eb[_0x6aba('0xe')]['message']);return _0x1a4fbc(_0x4ea8eb[_0x6aba('0xe')][_0x6aba('0x10')]);}else{logger[_0x6aba('0x8')]('CmCustomField,\x20%s,\x20%s',_0x54416a,_0x6aba('0xa'));_0x1a4fbc(_0x4ea8eb[_0x6aba('0x11')][_0x6aba('0x10')]);}})[_0x6aba('0x12')](function(_0x379b17){logger[_0x6aba('0xe')](_0x6aba('0x9'),_0x54416a,_0x379b17);_0x508dff(_0x379b17);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index f805842..bb3075c 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 _0x0773=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x1035c1,_0x2d8583){var _0x308d67=function(_0x58ddb6){while(--_0x58ddb6){_0x1035c1['push'](_0x1035c1['shift']());}};_0x308d67(++_0x2d8583);}(_0x0773,0xf6));var _0x3077=function(_0x156b1b,_0x2b7fb5){_0x156b1b=_0x156b1b-0x0;var _0x2a6ab4=_0x0773[_0x156b1b];return _0x2a6ab4;};'use strict';var multer=require(_0x3077('0x0'));var util=require(_0x3077('0x1'));var path=require('path');var timeout=require(_0x3077('0x2'));var express=require(_0x3077('0x3'));var router=express[_0x3077('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3077('0x5'));var config=require(_0x3077('0x6'));var controller=require('./cmCustomField.controller');router[_0x3077('0x7')]('/',auth[_0x3077('0x8')](),controller[_0x3077('0x9')]);router[_0x3077('0x7')]('/:id',auth[_0x3077('0x8')](),controller[_0x3077('0xa')]);router[_0x3077('0xb')]('/',auth[_0x3077('0x8')](),controller[_0x3077('0xc')]);router[_0x3077('0xd')]('/:id',auth['isAuthenticated'](),controller[_0x3077('0xe')]);router[_0x3077('0xf')](_0x3077('0x10'),auth[_0x3077('0x8')](),controller[_0x3077('0x11')]);module[_0x3077('0x12')]=router; \ No newline at end of file +var _0xf495=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','post','put','update','destroy','exports','util','path','connect-timeout'];(function(_0x3bfd3d,_0x29683b){var _0x3cd190=function(_0x57f2a6){while(--_0x57f2a6){_0x3bfd3d['push'](_0x3bfd3d['shift']());}};_0x3cd190(++_0x29683b);}(_0xf495,0x7d));var _0x5f49=function(_0x25a440,_0x2322a8){_0x25a440=_0x25a440-0x0;var _0x3ccb3f=_0xf495[_0x25a440];return _0x3ccb3f;};'use strict';var multer=require('multer');var util=require(_0x5f49('0x0'));var path=require(_0x5f49('0x1'));var timeout=require(_0x5f49('0x2'));var express=require('express');var router=express[_0x5f49('0x3')]();var auth=require(_0x5f49('0x4'));var interaction=require(_0x5f49('0x5'));var config=require(_0x5f49('0x6'));var controller=require('./cmCustomField.controller');router['get']('/',auth[_0x5f49('0x7')](),controller['index']);router[_0x5f49('0x8')](_0x5f49('0x9'),auth[_0x5f49('0x7')](),controller[_0x5f49('0xa')]);router[_0x5f49('0xb')]('/',auth[_0x5f49('0x7')](),controller['create']);router[_0x5f49('0xc')](_0x5f49('0x9'),auth[_0x5f49('0x7')](),controller[_0x5f49('0xd')]);router['delete'](_0x5f49('0x9'),auth[_0x5f49('0x7')](),controller[_0x5f49('0xe')]);module[_0x5f49('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 5925621..7330d65 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 _0x5fc3=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','contactListQueue','moment','sequelize','STRING'];(function(_0x1ccdf7,_0x215d5a){var _0x52a0ae=function(_0x40324a){while(--_0x40324a){_0x1ccdf7['push'](_0x1ccdf7['shift']());}};_0x52a0ae(++_0x215d5a);}(_0x5fc3,0xa8));var _0x35fc=function(_0x34d275,_0x5d84ee){_0x34d275=_0x34d275-0x0;var _0x1379cc=_0x5fc3[_0x34d275];return _0x1379cc;};'use strict';var moment=require(_0x35fc('0x0'));var Sequelize=require(_0x35fc('0x1'));module['exports']={'phone':{'type':Sequelize[_0x35fc('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x35fc('0x4')],'defaultValue':moment()[_0x35fc('0x5')](_0x35fc('0x6'))},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x35fc('0x7')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x35fc('0x7')],'defaultValue':0x0},'callback':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x35fc('0x7')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x35fc('0x7')],'unique':_0x35fc('0x8')},'ListId':{'type':Sequelize[_0x35fc('0x7')],'unique':_0x35fc('0x8')},'UserId':{'type':Sequelize[_0x35fc('0x7')]},'VoiceQueueId':{'type':Sequelize[_0x35fc('0x7')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x35fc('0x7')]},'countnosuchnumberretry':{'type':Sequelize[_0x35fc('0x7')],'defaultValue':0x0},'countdropretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x35fc('0x7')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x35fc('0x7')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xee14=['STRING','BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','exports'];(function(_0x133e8d,_0x4648f1){var _0x10ce55=function(_0x13e8bd){while(--_0x13e8bd){_0x133e8d['push'](_0x133e8d['shift']());}};_0x10ce55(++_0x4648f1);}(_0xee14,0x13a));var _0x4ee1=function(_0x3f1b0b,_0x40b77b){_0x3f1b0b=_0x3f1b0b-0x0;var _0x2fd549=_0xee14[_0x3f1b0b];return _0x2fd549;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x4ee1('0x0')]={'phone':{'type':Sequelize[_0x4ee1('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x4ee1('0x3')],'defaultValue':moment()[_0x4ee1('0x4')](_0x4ee1('0x5'))},'countbusyretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x4ee1('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x4ee1('0x6')](0x2)[_0x4ee1('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x4ee1('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0x4ee1('0x6')],'unique':_0x4ee1('0x8')},'ListId':{'type':Sequelize[_0x4ee1('0x6')],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0x4ee1('0x6')]},'VoiceQueueId':{'type':Sequelize[_0x4ee1('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize[_0x4ee1('0x6')]},'countnosuchnumberretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x4ee1('0x6')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 83271a5..06b12da 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 _0x5432=['ASC','DESC','sequelize','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','scheduledAt','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','UPDATE','CmCompany','CmList','List','dialActive','outbound','isNumber','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','name','send','index','CmHopper','type','key','model','map','keys','query','filters','intersection','concat','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','$any','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','merge','VIRTUAL','options','includeAll','rows','show','params','rawAttributes','length','include','find','create','body','catch','describe','CampaignId','VoiceQueue','VoiceQueueId','omit','dataValues','updatedAt','statedesc','deleted','membername','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','phone','campaigntype','ivr','CmContact','firstName','isNil','calleridname','lastName','finally','getPreview','user','getVoiceQueues','preview','dialOrderByScheduledAt','transaction','direction','prev','isEmpty','hopperIds','priority'];(function(_0x58137a,_0xf61205){var _0x224246=function(_0x4d9c32){while(--_0x4d9c32){_0x58137a['push'](_0x58137a['shift']());}};_0x224246(++_0xf61205);}(_0x5432,0x1b1));var _0x2543=function(_0xd05a1d,_0x4cdec6){_0xd05a1d=_0xd05a1d-0x0;var _0x3933f6=_0x5432[_0xd05a1d];return _0x3933f6;};'use strict';var pdf=require(_0x2543('0x0'));var emlformat=require(_0x2543('0x1'));var rimraf=require(_0x2543('0x2'));var zipdir=require(_0x2543('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2543('0x4'));var moment=require('moment');var BPromise=require(_0x2543('0x5'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x2543('0x6'));var ejs=require(_0x2543('0x7'));var fs=require('fs');var _=require(_0x2543('0x8'));var squel=require(_0x2543('0x9'));var crypto=require('crypto');var jsforce=require(_0x2543('0xa'));var deskjs=require(_0x2543('0xb'));var toCsv=require(_0x2543('0x6'));var querystring=require('querystring');var Papa=require(_0x2543('0xc'));var Redis=require(_0x2543('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x2543('0xe'));var as=require(_0x2543('0xf'));var hardwareService=require(_0x2543('0x10'));var logger=require(_0x2543('0x11'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x2543('0x12'))['db'];function respondWithStatusCode(_0x23ad49,_0x18ebd2){_0x18ebd2=_0x18ebd2||0xcc;return function(_0x254731){if(_0x254731){return _0x23ad49[_0x2543('0x13')](_0x18ebd2);}return _0x23ad49[_0x2543('0x14')](_0x18ebd2)[_0x2543('0x15')]();};}function respondWithResult(_0x5bbec7,_0x29cf70){_0x29cf70=_0x29cf70||0xc8;return function(_0xcd7037){if(_0xcd7037){return _0x5bbec7[_0x2543('0x14')](_0x29cf70)['json'](_0xcd7037);}};}function respondWithFilteredResult(_0x37ff26,_0x3ef853){return function(_0x52244d){if(_0x52244d){var _0x1ee0bc=_0x52244d[_0x2543('0x16')],_0x95632a=_0x3ef853[_0x2543('0x17')],_0x41fcf0=_0x3ef853[_0x2543('0x17')]+_0x3ef853['limit'],_0x3af586;if(_0x41fcf0>=_0x1ee0bc){_0x41fcf0=_0x1ee0bc;_0x3af586=0xc8;}else{_0x3af586=0xce;}_0x37ff26[_0x2543('0x14')](_0x3af586);return _0x37ff26[_0x2543('0x18')](_0x2543('0x19'),_0x95632a+'-'+_0x41fcf0+'/'+_0x1ee0bc)[_0x2543('0x1a')](_0x52244d);}return null;};}function patchUpdates(_0x16af1c){return function(_0x5a7ead){try{jsonpatch[_0x2543('0x1b')](_0x5a7ead,_0x16af1c,!![]);}catch(_0x5f2dcf){return BPromise[_0x2543('0x1c')](_0x5f2dcf);}return _0x5a7ead[_0x2543('0x1d')]();};}function saveUpdates(_0x6e2dff,_0x4f292a){return function(_0x44dfc1){if(_0x44dfc1){return _0x44dfc1[_0x2543('0x1e')](_0x6e2dff)[_0x2543('0x1f')](function(_0x245b31){return _0x245b31;});}return null;};}function removeEntity(_0x435f75,_0x1bd2fe){return function(_0x20fef9){if(_0x20fef9){return _0x20fef9[_0x2543('0x20')]()[_0x2543('0x1f')](function(){_0x435f75[_0x2543('0x14')](0xcc)[_0x2543('0x15')]();});}};}function handleEntityNotFound(_0x5f4bdf,_0xc2b166){return function(_0x2813b5){if(!_0x2813b5){_0x5f4bdf['sendStatus'](0x194);}return _0x2813b5;};}function handleError(_0x3739df,_0x3579c1){_0x3579c1=_0x3579c1||0x1f4;return function(_0xfe421){logger[_0x2543('0x21')](_0xfe421['stack']);if(_0xfe421[_0x2543('0x22')]){delete _0xfe421['name'];}_0x3739df[_0x2543('0x14')](_0x3579c1)[_0x2543('0x23')](_0xfe421);};}exports[_0x2543('0x24')]=function(_0x3ec49d,_0xae8514){var _0x4f288b={},_0x299563={},_0x2ed525={'count':0x0,'rows':[]};var _0x5ebd34=_['map'](db[_0x2543('0x25')]['rawAttributes'],function(_0x5352ad){return{'name':_0x5352ad['fieldName'],'type':_0x5352ad[_0x2543('0x26')][_0x2543('0x27')]};});_0x299563[_0x2543('0x28')]=_[_0x2543('0x29')](_0x5ebd34,_0x2543('0x22'));_0x299563['query']=_[_0x2543('0x2a')](_0x3ec49d[_0x2543('0x2b')]);_0x299563[_0x2543('0x2c')]=_[_0x2543('0x2d')](_0x299563[_0x2543('0x28')],_0x299563[_0x2543('0x2b')]);_0x299563[_0x2543('0x2c')]=_[_0x2543('0x2e')](_0x299563[_0x2543('0x2c')],[_0x2543('0x2f'),_0x2543('0x30'),_0x2543('0x31'),_0x2543('0x32'),_0x2543('0x33'),_0x2543('0x34'),_0x2543('0x35'),_0x2543('0x36'),_0x2543('0x37'),_0x2543('0x38'),_0x2543('0x39'),_0x2543('0x3a'),_0x2543('0x3b'),_0x2543('0x3c'),'$notLike',_0x2543('0x3d'),_0x2543('0x3e'),_0x2543('0x3c'),_0x2543('0x3f'),_0x2543('0x40'),_0x2543('0x41'),_0x2543('0x42')]);_0x4f288b['attributes']=_['intersection'](_0x299563[_0x2543('0x28')],qs[_0x2543('0x43')](_0x3ec49d[_0x2543('0x2b')][_0x2543('0x43')]));_0x4f288b[_0x2543('0x44')]=_0x4f288b['attributes']['length']?_0x4f288b['attributes']:_0x299563[_0x2543('0x28')];if(!_0x3ec49d['query'][_0x2543('0x45')](_0x2543('0x46'))){_0x4f288b[_0x2543('0x47')]=qs['limit'](_0x3ec49d['query']['limit']);_0x4f288b[_0x2543('0x17')]=qs[_0x2543('0x17')](_0x3ec49d['query']['offset']);}_0x4f288b[_0x2543('0x48')]=qs[_0x2543('0x49')](_0x3ec49d['query'][_0x2543('0x49')]);_0x4f288b[_0x2543('0x4a')]=qs[_0x2543('0x2c')](_['pick'](_0x3ec49d[_0x2543('0x2b')],_0x299563[_0x2543('0x2c')]));if(_0x3ec49d['query']['filter']){_0x4f288b[_0x2543('0x4a')]=_[_0x2543('0x4b')](_0x4f288b[_0x2543('0x4a')],{'$or':_[_0x2543('0x29')](_0x5ebd34,function(_0x188f0d){if(_0x188f0d[_0x2543('0x26')]!==_0x2543('0x4c')){var _0x5cc641={};_0x5cc641[_0x188f0d['name']]={'$like':'%'+_0x3ec49d[_0x2543('0x2b')]['filter']+'%'};return _0x5cc641;}})});}_0x4f288b=_[_0x2543('0x4b')]({},_0x4f288b,_0x3ec49d[_0x2543('0x4d')]);var _0x4cb64a={'where':_0x4f288b[_0x2543('0x4a')]};return db[_0x2543('0x25')][_0x2543('0x16')](_0x4cb64a)[_0x2543('0x1f')](function(_0x41774b){_0x2ed525[_0x2543('0x16')]=_0x41774b;if(_0x3ec49d[_0x2543('0x2b')][_0x2543('0x4e')]){_0x4f288b['include']=[{'all':!![]}];}return db[_0x2543('0x25')]['findAll'](_0x4f288b);})[_0x2543('0x1f')](function(_0x1cca47){_0x2ed525[_0x2543('0x4f')]=_0x1cca47;return _0x2ed525;})[_0x2543('0x1f')](respondWithFilteredResult(_0xae8514,_0x4f288b))['catch'](handleError(_0xae8514,null));};exports[_0x2543('0x50')]=function(_0x192aad,_0x4d1101){var _0x1884b9={'raw':!![],'where':{'id':_0x192aad[_0x2543('0x51')]['id']}},_0x3886cb={};_0x3886cb[_0x2543('0x28')]=_[_0x2543('0x2a')](db[_0x2543('0x25')][_0x2543('0x52')]);_0x3886cb[_0x2543('0x2b')]=_[_0x2543('0x2a')](_0x192aad[_0x2543('0x2b')]);_0x3886cb[_0x2543('0x2c')]=_['intersection'](_0x3886cb['model'],_0x3886cb['query']);_0x1884b9[_0x2543('0x44')]=_[_0x2543('0x2d')](_0x3886cb['model'],qs[_0x2543('0x43')](_0x192aad[_0x2543('0x2b')]['fields']));_0x1884b9[_0x2543('0x44')]=_0x1884b9[_0x2543('0x44')][_0x2543('0x53')]?_0x1884b9[_0x2543('0x44')]:_0x3886cb[_0x2543('0x28')];if(_0x192aad['query'][_0x2543('0x4e')]){_0x1884b9[_0x2543('0x54')]=[{'all':!![]}];}_0x1884b9=_['merge']({},_0x1884b9,_0x192aad[_0x2543('0x4d')]);return db[_0x2543('0x25')][_0x2543('0x55')](_0x1884b9)[_0x2543('0x1f')](handleEntityNotFound(_0x4d1101,null))[_0x2543('0x1f')](respondWithResult(_0x4d1101,null))['catch'](handleError(_0x4d1101,null));};exports[_0x2543('0x56')]=function(_0x392fe9,_0x19f382){return db[_0x2543('0x25')][_0x2543('0x56')](_0x392fe9[_0x2543('0x57')],{})[_0x2543('0x1f')](respondWithResult(_0x19f382,0xc9))[_0x2543('0x58')](handleError(_0x19f382,null));};exports['update']=function(_0x238441,_0xbc033f){if(_0x238441[_0x2543('0x57')]['id']){delete _0x238441[_0x2543('0x57')]['id'];}return db[_0x2543('0x25')][_0x2543('0x55')]({'where':{'id':_0x238441['params']['id']}})[_0x2543('0x1f')](handleEntityNotFound(_0xbc033f,null))[_0x2543('0x1f')](saveUpdates(_0x238441[_0x2543('0x57')],null))[_0x2543('0x1f')](respondWithResult(_0xbc033f,null))[_0x2543('0x58')](handleError(_0xbc033f,null));};exports['describe']=function(_0x183a5a,_0xebaeb9){return db[_0x2543('0x25')][_0x2543('0x59')]()[_0x2543('0x1f')](respondWithResult(_0xebaeb9,null))[_0x2543('0x58')](handleError(_0xebaeb9,null));};exports['destroy']=function(_0x509e93,_0x11e087){var _0x5d72a0;return db[_0x2543('0x25')][_0x2543('0x55')]({'where':{'id':_0x509e93[_0x2543('0x51')]['id']}})[_0x2543('0x1f')](handleEntityNotFound(_0x11e087,null))['then'](function(_0x93b90b){if(_0x93b90b){return _0x93b90b[_0x2543('0x20')]()[_0x2543('0x1f')](function(_0x3dbdad){return _0x3dbdad;});}})[_0x2543('0x1f')](function(_0x1abf41){_0x5d72a0=_0x1abf41;if(_0x1abf41){if(_0x1abf41['VoiceQueueId']||_0x1abf41[_0x2543('0x5a')]){return db[_0x1abf41['VoiceQueueId']?_0x2543('0x5b'):'Campaign'][_0x2543('0x55')]({'where':{'id':_0x1abf41['VoiceQueueId']?_0x1abf41[_0x2543('0x5c')]:_0x1abf41[_0x2543('0x5a')]},'attributes':['id',_0x2543('0x22')],'raw':!![]});}}})[_0x2543('0x1f')](function(_0x55d282){var _0x435a08={};if(_0x55d282){_[_0x2543('0x4b')](_0x435a08,_[_0x2543('0x5d')](_0x5d72a0[_0x2543('0x5e')],['createdAt',_0x2543('0x5f'),'id']));_0x435a08['state']=0x15;_0x435a08[_0x2543('0x60')]=_0x2543('0x61');_0x435a08['campaign']=_0x55d282[_0x2543('0x22')];_0x435a08[_0x2543('0x62')]=_0x509e93['user']['name'];_0x435a08[_0x2543('0x63')]=_0x509e93['user']['id'];_0x435a08[_0x2543('0x61')]=!![];_0x435a08[_0x2543('0x64')]=moment()[_0x2543('0x65')](_0x2543('0x66'));_0x435a08['calleridnum']=_0x5d72a0[_0x2543('0x67')];_0x435a08[_0x2543('0x68')]=_0x5d72a0[_0x2543('0x5c')]?'queue':_0x2543('0x69');return db[_0x2543('0x6a')][_0x2543('0x55')]({'where':{'id':_0x435a08['ContactId']},'attributes':[_0x2543('0x6b'),'lastName']})['then'](function(_0x50a45f){if(!_[_0x2543('0x6c')](_0x11e087)&&!_[_0x2543('0x6c')](_0x50a45f[_0x2543('0x6b')])){_0x435a08[_0x2543('0x6d')]=_0x50a45f[_0x2543('0x6b')];if(!_[_0x2543('0x6c')](_0x50a45f[_0x2543('0x6e')])){_0x435a08[_0x2543('0x6d')]+='\x20'+_0x50a45f['lastName'];}}})[_0x2543('0x6f')](function(){return db['CmHopperFinal']['create'](_0x435a08);});}})[_0x2543('0x1f')](function(){return _0x11e087[_0x2543('0x14')](0xcc)[_0x2543('0x15')]();})[_0x2543('0x58')](handleError(_0x11e087,null));};exports[_0x2543('0x70')]=function(_0x2118b4,_0x231b13,_0x442d6d){var _0x58b2b3=[];return db[_0x2543('0x6a')]['describe']()[_0x2543('0x1f')](function(_0x2ad7d2){_0x58b2b3=_[_0x2543('0x2a')](_0x2ad7d2);return _0x2118b4[_0x2543('0x71')][_0x2543('0x72')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':_0x2543('0x73')},'attributes':['id',_0x2543('0x74')],'raw':!![]});})[_0x2543('0x1f')](function(_0x2f24ee){if(_0x2f24ee&&_0x2f24ee[_0x2543('0x53')]){return db['sequelize'][_0x2543('0x75')](function(_0x17a657){var _0x50ed88={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2543('0x65')](_0x2543('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x2f24ee,'id')},'$or':[{'UserId':null},{'UserId':_0x2118b4[_0x2543('0x71')]['id']}]};var _0x50df22=[];if(_0x2118b4[_0x2543('0x57')][_0x2543('0x76')]&&_0x2118b4[_0x2543('0x57')]['direction']===_0x2543('0x77')){if(!_[_0x2543('0x78')](_0x2118b4['body'][_0x2543('0x79')])){_0x50ed88['id']={'$in':_0x2118b4['body'][_0x2543('0x79')]};}_0x50df22=[[_0x2543('0x7a'),_0x2543('0x7b')],['scheduledAt',_0x2f24ee[0x0]['dialOrderByScheduledAt']===_0x2543('0x7b')?_0x2543('0x7c'):_0x2543('0x7b')],db[_0x2543('0x7d')][_0x2543('0x7e')](_0x2543('0x7f')),['id',_0x2543('0x7c')]];}else{if(!_[_0x2543('0x78')](_0x2118b4[_0x2543('0x57')][_0x2543('0x79')])){_0x50ed88['id']={'$notIn':_0x2118b4[_0x2543('0x57')][_0x2543('0x79')]};}_0x50df22=[[_0x2543('0x7a'),_0x2543('0x7c')],[_0x2543('0x80'),_0x2f24ee[0x0][_0x2543('0x74')]],db[_0x2543('0x7d')][_0x2543('0x7e')](_0x2543('0x81')),['id',_0x2543('0x7b')]];}return db[_0x2543('0x25')][_0x2543('0x82')]({'attributes':['id',_0x2543('0x83')],'where':_0x50ed88,'order':_0x50df22,'transaction':_0x17a657,'lock':_0x17a657['LOCK'][_0x2543('0x84')],'include':[{'model':db[_0x2543('0x6a')],'as':'Contact','attributes':_0x58b2b3,'include':[{'model':db[_0x2543('0x85')],'as':'Company','attributes':['id','name']}]},{'model':db[_0x2543('0x86')],'as':_0x2543('0x87'),'attributes':['id','name']},{'model':db['VoiceQueue'],'as':'Queue','attributes':['id','name',_0x2543('0x88')]}]})[_0x2543('0x1f')](function(_0x5ac89b){if(_0x5ac89b){return _0x5ac89b['update']({'UserId':_0x2118b4[_0x2543('0x71')]['id']},{'transaction':_0x17a657});}});});}})[_0x2543('0x1f')](handleEntityNotFound(_0x231b13,null))[_0x2543('0x1f')](respondWithResult(_0x231b13,null))[_0x2543('0x58')](handleError(_0x231b13,null));};exports['getOpenContacts']=function(_0x440051,_0x330fed,_0x5c8f47){return _0x440051[_0x2543('0x71')][_0x2543('0x72')]({'where':{'type':_0x2543('0x89'),'dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x2543('0x1f')](function(_0x3d3a71){if(_0x3d3a71&&_0x3d3a71[_0x2543('0x53')]){return db[_0x2543('0x25')][_0x2543('0x16')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x2543('0x65')](_0x2543('0x66'))},'VoiceQueueId':{'$in':_['map'](_0x3d3a71,'id')},'$or':[{'UserId':null},{'UserId':_0x440051['user']['id']}]}});}return 0x0;})[_0x2543('0x1f')](function(_0x13223a){if(!_['isNil'](_0x13223a)&&_[_0x2543('0x8a')](_0x13223a)){return _0x330fed[_0x2543('0x14')](0xc8)[_0x2543('0x1a')]({'contacts':_0x13223a});}else{logger[_0x2543('0x21')]('CmHopper,\x20%s,\x20%s,\x20%s','getOpenContacts',0x194,'entity\x20not\x20found');_0x330fed[_0x2543('0x13')](0x194);}})[_0x2543('0x58')](handleError(_0x330fed,null));}; \ No newline at end of file +var _0xb56f=['hopperIds','ASC','DESC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','priority','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','scheduledat','LOCK','UPDATE','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','isNumber','error','entity\x20not\x20found','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','ejs','squel','crypto','desk.js','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','send','map','type','model','filters','query','$and','$or','$gt','$gte','$lt','$lte','$ne','$eq','$between','$notBetween','$in','$notIn','$notLike','$notILike','$like','$overlap','$contains','$any','attributes','fields','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','name','filter','options','CmHopper','includeAll','include','findAll','rows','catch','show','keys','intersection','length','create','body','find','params','describe','VoiceQueueId','VoiceQueue','Campaign','CampaignId','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','calleridnum','phone','campaigntype','queue','ivr','ContactId','firstName','isNil','calleridname','lastName','finally','CmHopperFinal','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','format','YYYY-MM-DD\x20HH:mm:ss','direction','isEmpty'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xb56f,0x139));var _0xfb56=function(_0x5755f6,_0x23ac51){_0x5755f6=_0x5755f6-0x0;var _0x1ae354=_0xb56f[_0x5755f6];return _0x1ae354;};'use strict';var pdf=require(_0xfb56('0x0'));var emlformat=require(_0xfb56('0x1'));var rimraf=require(_0xfb56('0x2'));var zipdir=require(_0xfb56('0x3'));var jsonpatch=require(_0xfb56('0x4'));var rp=require('request-promise');var moment=require(_0xfb56('0x5'));var BPromise=require(_0xfb56('0x6'));var Mustache=require('mustache');var util=require(_0xfb56('0x7'));var path=require(_0xfb56('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xfb56('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfb56('0xa'));var crypto=require(_0xfb56('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfb56('0xc'));var toCsv=require(_0xfb56('0xd'));var querystring=require(_0xfb56('0xe'));var Papa=require(_0xfb56('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfb56('0x10'));var as=require(_0xfb56('0x11'));var hardwareService=require(_0xfb56('0x12'));var logger=require('../../config/logger')(_0xfb56('0x13'));var utils=require(_0xfb56('0x14'));var config=require(_0xfb56('0x15'));var db=require(_0xfb56('0x16'))['db'];function respondWithStatusCode(_0x24fd57,_0x430ff8){_0x430ff8=_0x430ff8||0xcc;return function(_0x498d72){if(_0x498d72){return _0x24fd57[_0xfb56('0x17')](_0x430ff8);}return _0x24fd57[_0xfb56('0x18')](_0x430ff8)[_0xfb56('0x19')]();};}function respondWithResult(_0x199ff8,_0x5e19ef){_0x5e19ef=_0x5e19ef||0xc8;return function(_0x3f35a6){if(_0x3f35a6){return _0x199ff8[_0xfb56('0x18')](_0x5e19ef)[_0xfb56('0x1a')](_0x3f35a6);}};}function respondWithFilteredResult(_0x3aef6b,_0x55d583){return function(_0x257944){if(_0x257944){var _0x39f046=_0x257944[_0xfb56('0x1b')],_0x419f74=_0x55d583[_0xfb56('0x1c')],_0xe5a2e0=_0x55d583[_0xfb56('0x1c')]+_0x55d583[_0xfb56('0x1d')],_0x2ea293;if(_0xe5a2e0>=_0x39f046){_0xe5a2e0=_0x39f046;_0x2ea293=0xc8;}else{_0x2ea293=0xce;}_0x3aef6b[_0xfb56('0x18')](_0x2ea293);return _0x3aef6b[_0xfb56('0x1e')]('Content-Range',_0x419f74+'-'+_0xe5a2e0+'/'+_0x39f046)['json'](_0x257944);}return null;};}function patchUpdates(_0x104110){return function(_0x1cd948){try{jsonpatch[_0xfb56('0x1f')](_0x1cd948,_0x104110,!![]);}catch(_0x3aede0){return BPromise[_0xfb56('0x20')](_0x3aede0);}return _0x1cd948[_0xfb56('0x21')]();};}function saveUpdates(_0x116fac,_0x5f33fd){return function(_0x4ea008){if(_0x4ea008){return _0x4ea008[_0xfb56('0x22')](_0x116fac)[_0xfb56('0x23')](function(_0xecd7e0){return _0xecd7e0;});}return null;};}function removeEntity(_0x377bb2,_0x51a2d4){return function(_0x4c5d64){if(_0x4c5d64){return _0x4c5d64[_0xfb56('0x24')]()[_0xfb56('0x23')](function(){_0x377bb2['status'](0xcc)[_0xfb56('0x19')]();});}};}function handleEntityNotFound(_0x635629,_0x54c0e8){return function(_0x336e6b){if(!_0x336e6b){_0x635629[_0xfb56('0x17')](0x194);}return _0x336e6b;};}function handleError(_0x2196df,_0x3b1001){_0x3b1001=_0x3b1001||0x1f4;return function(_0x5f37af){logger['error'](_0x5f37af[_0xfb56('0x25')]);if(_0x5f37af['name']){delete _0x5f37af['name'];}_0x2196df[_0xfb56('0x18')](_0x3b1001)[_0xfb56('0x26')](_0x5f37af);};}exports['index']=function(_0x5b718f,_0x4b4a55){var _0x2054e0={},_0x5dcb06={},_0x179470={'count':0x0,'rows':[]};var _0x3ec666=_[_0xfb56('0x27')](db['CmHopper']['rawAttributes'],function(_0x49e0fd){return{'name':_0x49e0fd['fieldName'],'type':_0x49e0fd[_0xfb56('0x28')]['key']};});_0x5dcb06[_0xfb56('0x29')]=_['map'](_0x3ec666,'name');_0x5dcb06['query']=_['keys'](_0x5b718f['query']);_0x5dcb06[_0xfb56('0x2a')]=_['intersection'](_0x5dcb06[_0xfb56('0x29')],_0x5dcb06[_0xfb56('0x2b')]);_0x5dcb06[_0xfb56('0x2a')]=_['concat'](_0x5dcb06[_0xfb56('0x2a')],[_0xfb56('0x2c'),_0xfb56('0x2d'),_0xfb56('0x2e'),_0xfb56('0x2f'),_0xfb56('0x30'),_0xfb56('0x31'),_0xfb56('0x32'),_0xfb56('0x33'),'$not',_0xfb56('0x34'),_0xfb56('0x35'),_0xfb56('0x36'),_0xfb56('0x37'),'$like',_0xfb56('0x38'),'$iLike',_0xfb56('0x39'),_0xfb56('0x3a'),_0xfb56('0x3b'),_0xfb56('0x3c'),'$contained',_0xfb56('0x3d')]);_0x2054e0[_0xfb56('0x3e')]=_['intersection'](_0x5dcb06[_0xfb56('0x29')],qs['fields'](_0x5b718f[_0xfb56('0x2b')][_0xfb56('0x3f')]));_0x2054e0[_0xfb56('0x3e')]=_0x2054e0['attributes']['length']?_0x2054e0[_0xfb56('0x3e')]:_0x5dcb06[_0xfb56('0x29')];if(!_0x5b718f['query'][_0xfb56('0x40')](_0xfb56('0x41'))){_0x2054e0[_0xfb56('0x1d')]=qs[_0xfb56('0x1d')](_0x5b718f[_0xfb56('0x2b')][_0xfb56('0x1d')]);_0x2054e0[_0xfb56('0x1c')]=qs[_0xfb56('0x1c')](_0x5b718f[_0xfb56('0x2b')][_0xfb56('0x1c')]);}_0x2054e0[_0xfb56('0x42')]=qs[_0xfb56('0x43')](_0x5b718f['query'][_0xfb56('0x43')]);_0x2054e0[_0xfb56('0x44')]=qs[_0xfb56('0x2a')](_['pick'](_0x5b718f[_0xfb56('0x2b')],_0x5dcb06[_0xfb56('0x2a')]));if(_0x5b718f['query']['filter']){_0x2054e0[_0xfb56('0x44')]=_[_0xfb56('0x45')](_0x2054e0['where'],{'$or':_['map'](_0x3ec666,function(_0x2ede7a){if(_0x2ede7a[_0xfb56('0x28')]!==_0xfb56('0x46')){var _0x4febe2={};_0x4febe2[_0x2ede7a[_0xfb56('0x47')]]={'$like':'%'+_0x5b718f[_0xfb56('0x2b')][_0xfb56('0x48')]+'%'};return _0x4febe2;}})});}_0x2054e0=_['merge']({},_0x2054e0,_0x5b718f[_0xfb56('0x49')]);var _0x13f016={'where':_0x2054e0[_0xfb56('0x44')]};return db[_0xfb56('0x4a')]['count'](_0x13f016)['then'](function(_0x4f1261){_0x179470['count']=_0x4f1261;if(_0x5b718f[_0xfb56('0x2b')][_0xfb56('0x4b')]){_0x2054e0[_0xfb56('0x4c')]=[{'all':!![]}];}return db[_0xfb56('0x4a')][_0xfb56('0x4d')](_0x2054e0);})[_0xfb56('0x23')](function(_0x297179){_0x179470[_0xfb56('0x4e')]=_0x297179;return _0x179470;})[_0xfb56('0x23')](respondWithFilteredResult(_0x4b4a55,_0x2054e0))[_0xfb56('0x4f')](handleError(_0x4b4a55,null));};exports[_0xfb56('0x50')]=function(_0x26e9d5,_0x298c3c){var _0x415dc0={'raw':!![],'where':{'id':_0x26e9d5['params']['id']}},_0x166feb={};_0x166feb['model']=_[_0xfb56('0x51')](db[_0xfb56('0x4a')]['rawAttributes']);_0x166feb['query']=_['keys'](_0x26e9d5[_0xfb56('0x2b')]);_0x166feb['filters']=_[_0xfb56('0x52')](_0x166feb[_0xfb56('0x29')],_0x166feb[_0xfb56('0x2b')]);_0x415dc0['attributes']=_[_0xfb56('0x52')](_0x166feb[_0xfb56('0x29')],qs[_0xfb56('0x3f')](_0x26e9d5[_0xfb56('0x2b')][_0xfb56('0x3f')]));_0x415dc0[_0xfb56('0x3e')]=_0x415dc0[_0xfb56('0x3e')][_0xfb56('0x53')]?_0x415dc0[_0xfb56('0x3e')]:_0x166feb[_0xfb56('0x29')];if(_0x26e9d5[_0xfb56('0x2b')][_0xfb56('0x4b')]){_0x415dc0[_0xfb56('0x4c')]=[{'all':!![]}];}_0x415dc0=_[_0xfb56('0x45')]({},_0x415dc0,_0x26e9d5[_0xfb56('0x49')]);return db[_0xfb56('0x4a')]['find'](_0x415dc0)['then'](handleEntityNotFound(_0x298c3c,null))[_0xfb56('0x23')](respondWithResult(_0x298c3c,null))['catch'](handleError(_0x298c3c,null));};exports[_0xfb56('0x54')]=function(_0x48ba54,_0x59af2a){return db[_0xfb56('0x4a')][_0xfb56('0x54')](_0x48ba54['body'],{})[_0xfb56('0x23')](respondWithResult(_0x59af2a,0xc9))[_0xfb56('0x4f')](handleError(_0x59af2a,null));};exports[_0xfb56('0x22')]=function(_0x357419,_0x56f0b4){if(_0x357419[_0xfb56('0x55')]['id']){delete _0x357419[_0xfb56('0x55')]['id'];}return db['CmHopper'][_0xfb56('0x56')]({'where':{'id':_0x357419[_0xfb56('0x57')]['id']}})['then'](handleEntityNotFound(_0x56f0b4,null))[_0xfb56('0x23')](saveUpdates(_0x357419[_0xfb56('0x55')],null))[_0xfb56('0x23')](respondWithResult(_0x56f0b4,null))['catch'](handleError(_0x56f0b4,null));};exports['describe']=function(_0x30e30a,_0x257b4c){return db['CmHopper'][_0xfb56('0x58')]()['then'](respondWithResult(_0x257b4c,null))[_0xfb56('0x4f')](handleError(_0x257b4c,null));};exports[_0xfb56('0x24')]=function(_0x5c7d5e,_0x3fb06d){var _0x2ce56f;return db[_0xfb56('0x4a')][_0xfb56('0x56')]({'where':{'id':_0x5c7d5e[_0xfb56('0x57')]['id']}})[_0xfb56('0x23')](handleEntityNotFound(_0x3fb06d,null))['then'](function(_0x2b3e0e){if(_0x2b3e0e){return _0x2b3e0e[_0xfb56('0x24')]()['then'](function(_0x5a0a81){return _0x5a0a81;});}})[_0xfb56('0x23')](function(_0x434178){_0x2ce56f=_0x434178;if(_0x434178){if(_0x434178[_0xfb56('0x59')]||_0x434178['CampaignId']){return db[_0x434178[_0xfb56('0x59')]?_0xfb56('0x5a'):_0xfb56('0x5b')][_0xfb56('0x56')]({'where':{'id':_0x434178[_0xfb56('0x59')]?_0x434178[_0xfb56('0x59')]:_0x434178[_0xfb56('0x5c')]},'attributes':['id','name'],'raw':!![]});}}})[_0xfb56('0x23')](function(_0x4bd473){var _0x3197da={};if(_0x4bd473){_[_0xfb56('0x45')](_0x3197da,_['omit'](_0x2ce56f[_0xfb56('0x5d')],[_0xfb56('0x5e'),_0xfb56('0x5f'),'id']));_0x3197da[_0xfb56('0x60')]=0x15;_0x3197da[_0xfb56('0x61')]=_0xfb56('0x62');_0x3197da[_0xfb56('0x63')]=_0x4bd473['name'];_0x3197da[_0xfb56('0x64')]=_0x5c7d5e[_0xfb56('0x65')]['name'];_0x3197da[_0xfb56('0x66')]=_0x5c7d5e['user']['id'];_0x3197da['deleted']=!![];_0x3197da[_0xfb56('0x67')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x3197da[_0xfb56('0x68')]=_0x2ce56f[_0xfb56('0x69')];_0x3197da[_0xfb56('0x6a')]=_0x2ce56f[_0xfb56('0x59')]?_0xfb56('0x6b'):_0xfb56('0x6c');return db['CmContact'][_0xfb56('0x56')]({'where':{'id':_0x3197da[_0xfb56('0x6d')]},'attributes':[_0xfb56('0x6e'),'lastName']})['then'](function(_0x537ce5){if(!_[_0xfb56('0x6f')](_0x3fb06d)&&!_[_0xfb56('0x6f')](_0x537ce5['firstName'])){_0x3197da[_0xfb56('0x70')]=_0x537ce5[_0xfb56('0x6e')];if(!_[_0xfb56('0x6f')](_0x537ce5['lastName'])){_0x3197da[_0xfb56('0x70')]+='\x20'+_0x537ce5[_0xfb56('0x71')];}}})[_0xfb56('0x72')](function(){return db[_0xfb56('0x73')][_0xfb56('0x54')](_0x3197da);});}})['then'](function(){return _0x3fb06d[_0xfb56('0x18')](0xcc)['end']();})['catch'](handleError(_0x3fb06d,null));};exports['getPreview']=function(_0x2d439d,_0x3a6f2e,_0x47cec3){var _0x1e7ef0=[];return db['CmContact'][_0xfb56('0x58')]()[_0xfb56('0x23')](function(_0x216882){_0x1e7ef0=_['keys'](_0x216882);return _0x2d439d[_0xfb56('0x65')][_0xfb56('0x74')]({'where':{'type':_0xfb56('0x75'),'dialActive':!![],'dialMethod':_0xfb56('0x76')},'attributes':['id',_0xfb56('0x77')],'raw':!![]});})['then'](function(_0x2b7988){if(_0x2b7988&&_0x2b7988[_0xfb56('0x53')]){return db[_0xfb56('0x78')]['transaction'](function(_0x1c42d8){var _0x293816={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfb56('0x79')](_0xfb56('0x7a'))},'VoiceQueueId':{'$in':_[_0xfb56('0x27')](_0x2b7988,'id')},'$or':[{'UserId':null},{'UserId':_0x2d439d[_0xfb56('0x65')]['id']}]};var _0x4b4dae=[];if(_0x2d439d[_0xfb56('0x55')][_0xfb56('0x7b')]&&_0x2d439d[_0xfb56('0x55')][_0xfb56('0x7b')]==='prev'){if(!_[_0xfb56('0x7c')](_0x2d439d['body'][_0xfb56('0x7d')])){_0x293816['id']={'$in':_0x2d439d[_0xfb56('0x55')][_0xfb56('0x7d')]};}_0x4b4dae=[['priority',_0xfb56('0x7e')],['scheduledAt',_0x2b7988[0x0][_0xfb56('0x77')]==='ASC'?_0xfb56('0x7f'):_0xfb56('0x7e')],db[_0xfb56('0x78')][_0xfb56('0x80')](_0xfb56('0x81')),['id','DESC']];}else{if(!_['isEmpty'](_0x2d439d['body'][_0xfb56('0x7d')])){_0x293816['id']={'$notIn':_0x2d439d[_0xfb56('0x55')][_0xfb56('0x7d')]};}_0x4b4dae=[[_0xfb56('0x82'),'DESC'],['scheduledAt',_0x2b7988[0x0][_0xfb56('0x77')]],db[_0xfb56('0x78')][_0xfb56('0x80')](_0xfb56('0x83')),['id','ASC']];}return db[_0xfb56('0x4a')][_0xfb56('0x84')]({'attributes':['id',_0xfb56('0x85')],'where':_0x293816,'order':_0x4b4dae,'transaction':_0x1c42d8,'lock':_0x1c42d8[_0xfb56('0x86')][_0xfb56('0x87')],'include':[{'model':db['CmContact'],'as':_0xfb56('0x88'),'attributes':_0x1e7ef0,'include':[{'model':db[_0xfb56('0x89')],'as':_0xfb56('0x8a'),'attributes':['id',_0xfb56('0x47')]}]},{'model':db[_0xfb56('0x8b')],'as':'List','attributes':['id',_0xfb56('0x47')]},{'model':db[_0xfb56('0x5a')],'as':_0xfb56('0x8c'),'attributes':['id',_0xfb56('0x47'),_0xfb56('0x8d')]}]})[_0xfb56('0x23')](function(_0x2dbf7d){if(_0x2dbf7d){return _0x2dbf7d['update']({'UserId':_0x2d439d[_0xfb56('0x65')]['id']},{'transaction':_0x1c42d8});}});});}})[_0xfb56('0x23')](handleEntityNotFound(_0x3a6f2e,null))['then'](respondWithResult(_0x3a6f2e,null))[_0xfb56('0x4f')](handleError(_0x3a6f2e,null));};exports[_0xfb56('0x8e')]=function(_0x5315a6,_0x1e229c,_0x4f4491){return _0x5315a6['user'][_0xfb56('0x74')]({'where':{'type':_0xfb56('0x75'),'dialActive':!![],'dialMethod':_0xfb56('0x76')},'attributes':['id'],'raw':!![]})[_0xfb56('0x23')](function(_0x224ce3){if(_0x224ce3&&_0x224ce3[_0xfb56('0x53')]){return db[_0xfb56('0x4a')][_0xfb56('0x1b')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0xfb56('0x79')](_0xfb56('0x7a'))},'VoiceQueueId':{'$in':_[_0xfb56('0x27')](_0x224ce3,'id')},'$or':[{'UserId':null},{'UserId':_0x5315a6[_0xfb56('0x65')]['id']}]}});}return 0x0;})[_0xfb56('0x23')](function(_0x419cb5){if(!_['isNil'](_0x419cb5)&&_[_0xfb56('0x8f')](_0x419cb5)){return _0x1e229c[_0xfb56('0x18')](0xc8)[_0xfb56('0x1a')]({'contacts':_0x419cb5});}else{logger[_0xfb56('0x90')]('CmHopper,\x20%s,\x20%s,\x20%s',_0xfb56('0x8e'),0x194,_0xfb56('0x91'));_0x1e229c[_0xfb56('0x17')](0x194);}})[_0xfb56('0x4f')](handleError(_0x1e229c,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index d979e2d..883a274 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 _0x361c=['util','api','bluebird','request-promise','path','rimraf','./cmHopper.attributes','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash'];(function(_0x3c86c5,_0x3de761){var _0x3f9076=function(_0xe683a2){while(--_0xe683a2){_0x3c86c5['push'](_0x3c86c5['shift']());}};_0x3f9076(++_0x3de761);}(_0x361c,0x14f));var _0xc361=function(_0x4b5aed,_0x3b6d4f){_0x4b5aed=_0x4b5aed-0x0;var _0x17a5ce=_0x361c[_0x4b5aed];return _0x17a5ce;};'use strict';var _=require(_0xc361('0x0'));var util=require(_0xc361('0x1'));var logger=require('../../config/logger')(_0xc361('0x2'));var moment=require('moment');var BPromise=require(_0xc361('0x3'));var rp=require(_0xc361('0x4'));var fs=require('fs');var path=require(_0xc361('0x5'));var rimraf=require(_0xc361('0x6'));var config=require('../../config/environment');var attributes=require(_0xc361('0x7'));module['exports']=function(_0x29624f,_0x7b07c4){return _0x29624f[_0xc361('0x8')](_0xc361('0x9'),attributes,{'tableName':_0xc361('0xa'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0xc361('0xb')]},{'name':_0xc361('0xc'),'fields':[_0xc361('0xc')]},{'name':_0xc361('0xd'),'fields':[_0xc361('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb1f3=['request-promise','path','rimraf','./cmHopper.attributes','exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','util','../../config/logger','api','moment','bluebird'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xb1f3,0xab));var _0x3b1f=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xb1f3[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x3b1f('0x0'));var logger=require(_0x3b1f('0x1'))(_0x3b1f('0x2'));var moment=require(_0x3b1f('0x3'));var BPromise=require(_0x3b1f('0x4'));var rp=require(_0x3b1f('0x5'));var fs=require('fs');var path=require(_0x3b1f('0x6'));var rimraf=require(_0x3b1f('0x7'));var config=require('../../config/environment');var attributes=require(_0x3b1f('0x8'));module[_0x3b1f('0x9')]=function(_0x4d8d75,_0x2a14d5){return _0x4d8d75[_0x3b1f('0xa')](_0x3b1f('0xb'),attributes,{'tableName':_0x3b1f('0xc'),'paranoid':![],'indexes':[{'name':_0x3b1f('0xd'),'fields':[_0x3b1f('0xd')]},{'name':_0x3b1f('0xe'),'fields':[_0x3b1f('0xe')]},{'name':_0x3b1f('0xf'),'fields':[_0x3b1f('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index 00c7139..9afce52 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 _0x7a54=['stringify','error','code','message','request\x20sent','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','body','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','debug'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7a54,0x106));var _0x47a5=function(_0x1486c5,_0x4e4f16){_0x1486c5=_0x1486c5-0x0;var _0x435877=_0x7a54[_0x1486c5];return _0x435877;};'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')]('CmHopper,\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['GetCmHopper']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});};exports[_0x47a5('0x22')]=function(_0x49c4b5){var _0x101f70=this;return new Promise(function(_0x10f660,_0x596097){return db[_0x47a5('0x15')][_0x47a5('0x23')](_0x49c4b5['body'],{'raw':_0x49c4b5['options']?_0x49c4b5['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9b5eaf){logger[_0x47a5('0xb')](_0x47a5('0x22'),_0x49c4b5);logger[_0x47a5('0xd')](_0x47a5('0x22'),_0x49c4b5,JSON[_0x47a5('0xe')](_0x9b5eaf));_0x10f660(_0x9b5eaf);})[_0x47a5('0x14')](function(_0x1f3d01){logger[_0x47a5('0xf')](_0x47a5('0x22'),_0x1f3d01[_0x47a5('0x11')],_0x49c4b5);_0x596097(_0x101f70[_0x47a5('0xf')](0x1f4,_0x1f3d01[_0x47a5('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1fbece){var _0x1c36fa=this;return new Promise(function(_0x331474,_0x23bd8d){return db['CmHopper'][_0x47a5('0x24')](_0x1fbece['body'],{'raw':_0x1fbece['options']?_0x1fbece['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fbece[_0x47a5('0x17')]?_0x1fbece['options'][_0x47a5('0x19')]||null:null,'attributes':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['attributes']||null:null,'limit':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['limit']||null:null})['then'](function(_0xbe21d9){logger['info'](_0x47a5('0x25'),_0x1fbece);logger[_0x47a5('0xd')](_0x47a5('0x25'),_0x1fbece,JSON[_0x47a5('0xe')](_0xbe21d9));_0x331474(_0xbe21d9);})[_0x47a5('0x14')](function(_0xf0edbb){logger[_0x47a5('0xf')](_0x47a5('0x25'),_0xf0edbb[_0x47a5('0x11')],_0x1fbece);_0x23bd8d(_0x1c36fa[_0x47a5('0xf')](0x1f4,_0xf0edbb[_0x47a5('0x11')]));});});};exports[_0x47a5('0x26')]=function(_0xe28d76){var _0x3574d4=this;return new Promise(function(_0x4e5e7,_0x3a2b38){return db['CmHopper'][_0x47a5('0x27')]({'where':_0xe28d76[_0x47a5('0x17')]?_0xe28d76['options']['where']||null:null})[_0x47a5('0x1e')](function(_0x560e4e){logger[_0x47a5('0xb')](_0x47a5('0x26'),_0xe28d76);logger['debug']('DestroyCmHopper',_0xe28d76,JSON[_0x47a5('0xe')](_0x560e4e));_0x4e5e7(_0x560e4e);})['catch'](function(_0x2d147c){logger[_0x47a5('0xf')](_0x47a5('0x26'),_0x2d147c[_0x47a5('0x11')],_0xe28d76);_0x3a2b38(_0x3574d4[_0x47a5('0xf')](0x1f4,_0x2d147c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x28')]=function(_0x53e994){var _0x48a0ef=this;return new Promise(function(_0x2dd1db,_0x411230){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x2c0c86){return db[_0x47a5('0x2b')]['transaction'](function(_0x45cca5){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'where':_0x53e994['options']?_0x53e994[_0x47a5('0x17')]['where']||null:null,'attributes':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'limit':_0x53e994[_0x47a5('0x17')]?_0x53e994['options'][_0x47a5('0x2c')]||null:null,'order':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'transaction':_0x45cca5,'lock':_0x45cca5[_0x47a5('0x2e')][_0x47a5('0x2f')],'include':[{'model':db[_0x47a5('0x29')],'as':'Contact','attributes':_[_0x47a5('0x30')](_0x2c0c86)},{'model':db[_0x47a5('0x31')],'as':_0x47a5('0x32'),'attributes':['id',_0x47a5('0x33'),_0x47a5('0x34')]}]})[_0x47a5('0x1e')](function(_0x572233){var _0x1ad6a9=[];for(var _0x245a15=0x0;_0x245a15<_0x572233[_0x47a5('0x35')];_0x245a15+=0x1){_0x1ad6a9['push'](_0x572233[_0x245a15][_0x47a5('0x24')](_0x53e994[_0x47a5('0x36')],{'transaction':_0x45cca5}));}return BPromise[_0x47a5('0x37')](_0x1ad6a9);});})['then'](function(_0x57641e){logger[_0x47a5('0xb')](_0x47a5('0x28'),_0x53e994);logger['debug']('GetContactDialer',_0x53e994,JSON[_0x47a5('0xe')](_0x57641e));_0x2dd1db(_0x57641e);})['catch'](function(_0x16bb8a){logger['error']('GetContactDialer',_0x16bb8a[_0x47a5('0x11')],_0x53e994);_0x411230(_0x48a0ef[_0x47a5('0xf')](0x1f4,_0x16bb8a['message']));});});});};exports[_0x47a5('0x38')]=function(_0x72fe){var _0x4b706a=this;return new Promise(function(_0x5b6127,_0x16b4fd){return db[_0x47a5('0x2b')][_0x47a5('0x39')](function(_0x2931e4){return db['CmHopperFinal'][_0x47a5('0x23')](_0x72fe[_0x47a5('0x36')],{'raw':_0x72fe[_0x47a5('0x17')]?_0x72fe['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2931e4})['then'](function(){return db[_0x47a5('0x15')][_0x47a5('0x27')]({'where':_0x72fe[_0x47a5('0x17')]?_0x72fe[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'transaction':_0x2931e4});});})['then'](function(_0x144af9){logger['info']('MoveContactManagedDialer',_0x72fe);logger['debug']('MoveContactManagedDialer',_0x72fe,JSON[_0x47a5('0xe')](_0x144af9));_0x5b6127(_0x144af9);})[_0x47a5('0x14')](function(_0x1e2bb4){logger['error']('MoveContactManagedDialer',_0x1e2bb4[_0x47a5('0x11')],_0x72fe);_0x16b4fd(_0x4b706a[_0x47a5('0xf')](0x1f4,_0x1e2bb4[_0x47a5('0x11')]));});});};exports[_0x47a5('0x3a')]=function(_0xc45e25){var _0x4b5d0c=this;return new Promise(function(_0x3474b7,_0x519e9e){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0xc45e25['options']?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0xc45e25[_0x47a5('0x17')]?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':[[db[_0x47a5('0x2b')]['fn'](_0x47a5('0x3b'),db[_0x47a5('0x2b')]['fn']('IF',db['sequelize'][_0x47a5('0x3c')](_0x47a5('0x3d')+util[_0x47a5('0x3e')](_0x47a5('0x3f'),moment()[_0x47a5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x47a5('0x40')))),_0x47a5('0x41')]]})[_0x47a5('0x1e')](function(_0x144aaa){logger[_0x47a5('0xb')](_0x47a5('0x3a'),_0xc45e25);logger[_0x47a5('0xd')](_0x47a5('0x3a'),_0xc45e25,JSON[_0x47a5('0xe')](_0x144aaa));_0x3474b7(_0x144aaa);})[_0x47a5('0x14')](function(_0x1d56f3){logger[_0x47a5('0xf')](_0x47a5('0x3a'),_0x1d56f3[_0x47a5('0x11')],_0xc45e25);_0x519e9e(_0x4b5d0c[_0x47a5('0xf')](0x1f4,_0x1d56f3['message']));});});};exports[_0x47a5('0x42')]=function(_0x284fb8){var _0x30504e=this;return new Promise(function(_0x4b42f3,_0x37ac59){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x5d9822){return db[_0x47a5('0x2b')]['transaction'](function(_0x2d5ee6){return db['CmHopper'][_0x47a5('0x16')]({'where':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':_0x284fb8[_0x47a5('0x17')]?_0x284fb8['options']['attributes']||null:null,'limit':0x1,'order':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'group':db[_0x47a5('0x15')][_0x47a5('0x43')],'transaction':_0x2d5ee6,'lock':_0x2d5ee6['LOCK'][_0x47a5('0x2f')],'include':_0x284fb8[_0x47a5('0x17')]?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')],function(_0x39939a){return{'model':db[_0x39939a[_0x47a5('0x1d')]],'as':_0x39939a['as'],'attributes':_0x39939a[_0x47a5('0x1a')],'include':_0x39939a[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x39939a['include'],function(_0x1e3212){return{'model':db[_0x1e3212['model']],'as':_0x1e3212['as'],'attributes':_0x1e3212[_0x47a5('0x1a')],'include':_0x1e3212[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x1e3212[_0x47a5('0x1b')],function(_0x40e584){return{'model':db[_0x40e584[_0x47a5('0x1d')]],'as':_0x40e584['as'],'attributes':_0x40e584[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x11c1db){var _0x254049=[];for(var _0x1cfb37=0x0;_0x1cfb37<_0x11c1db[_0x47a5('0x35')];_0x1cfb37+=0x1){_0x254049[_0x47a5('0x44')](_0x11c1db[_0x1cfb37][_0x47a5('0x24')](_0x284fb8[_0x47a5('0x36')],{'transaction':_0x2d5ee6}));}return BPromise['all'](_0x254049);});})['then'](function(_0x5ccc89){logger['info'](_0x47a5('0x42'),_0x284fb8);logger[_0x47a5('0xd')]('GetContactRecallMe',_0x284fb8,JSON[_0x47a5('0xe')](_0x5ccc89));_0x4b42f3(_0x5ccc89);})[_0x47a5('0x14')](function(_0x1baa5a){logger[_0x47a5('0xf')](_0x47a5('0x42'),_0x1baa5a[_0x47a5('0x11')],_0x284fb8);_0x37ac59(_0x30504e[_0x47a5('0xf')](0x1f4,_0x1baa5a[_0x47a5('0x11')]));});});});}; \ No newline at end of file +var _0x7a54=['stringify','error','code','message','request\x20sent','result','catch','CmHopper','findAll','options','raw','where','attributes','include','map','model','then','GetCmHopper','ShowCmHopper','find','CreateCmHopper','create','update','UpdateCmHopper','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','limit','order','LOCK','UPDATE','keys','User','Agent','name','voicePause','length','body','all','MoveContactManagedDialer','transaction','CountReScheduled','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22','\x20,\x201,\x20null','contactsRescheduled','GetContactRecallMe','UserId','push','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','CmHopper,\x20%s,\x20%s','debug'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7a54,0x106));var _0x47a5=function(_0x497d68,_0xb934cd){_0x497d68=_0x497d68-0x0;var _0x1410c9=_0x7a54[_0x497d68];return _0x1410c9;};'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')]('CmHopper,\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['GetCmHopper']=function(_0x5247fd){var _0x423a81=this;return new Promise(function(_0xaf70a6,_0x2ce454){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x19')]||null:null,'attributes':_0x5247fd[_0x47a5('0x17')]?_0x5247fd['options'][_0x47a5('0x1a')]||null:null,'limit':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')]['limit']||null:null,'include':_0x5247fd[_0x47a5('0x17')]?_0x5247fd[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x5247fd['options'][_0x47a5('0x1b')],function(_0x385687){return{'model':db[_0x385687['model']],'as':_0x385687['as'],'attributes':_0x385687[_0x47a5('0x1a')],'include':_0x385687[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x385687[_0x47a5('0x1b')],function(_0x3abd6a){return{'model':db[_0x3abd6a['model']],'as':_0x3abd6a['as'],'attributes':_0x3abd6a['attributes'],'include':_0x3abd6a[_0x47a5('0x1b')]?_['map'](_0x3abd6a[_0x47a5('0x1b')],function(_0x5b6c4e){return{'model':db[_0x5b6c4e[_0x47a5('0x1d')]],'as':_0x5b6c4e['as'],'attributes':_0x5b6c4e[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x1dac65){logger[_0x47a5('0xb')](_0x47a5('0x1f'),_0x5247fd);logger[_0x47a5('0xd')](_0x47a5('0x1f'),_0x5247fd,JSON[_0x47a5('0xe')](_0x1dac65));_0xaf70a6(_0x1dac65);})[_0x47a5('0x14')](function(_0x1127f8){logger[_0x47a5('0xf')](_0x47a5('0x1f'),_0x1127f8['message'],_0x5247fd);_0x2ce454(_0x423a81[_0x47a5('0xf')](0x1f4,_0x1127f8['message']));});});};exports[_0x47a5('0x20')]=function(_0x9ac908){var _0x16901f=this;return new Promise(function(_0x4d6b57,_0x256650){return db[_0x47a5('0x15')][_0x47a5('0x21')]({'raw':_0x9ac908[_0x47a5('0x17')]?_0x9ac908['options']['raw']===undefined?!![]:![]:!![],'where':_0x9ac908[_0x47a5('0x17')]?_0x9ac908[_0x47a5('0x17')]['where']||null:null,'attributes':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'include':_0x9ac908['options']?_0x9ac908[_0x47a5('0x17')]['include']?_[_0x47a5('0x1c')](_0x9ac908[_0x47a5('0x17')]['include'],function(_0x4843c0){return{'model':db[_0x4843c0[_0x47a5('0x1d')]],'as':_0x4843c0['as'],'attributes':_0x4843c0['attributes'],'include':_0x4843c0[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x4843c0[_0x47a5('0x1b')],function(_0x52749b){return{'model':db[_0x52749b[_0x47a5('0x1d')]],'as':_0x52749b['as'],'attributes':_0x52749b['attributes'],'include':_0x52749b['include']?_[_0x47a5('0x1c')](_0x52749b['include'],function(_0x25cce0){return{'model':db[_0x25cce0['model']],'as':_0x25cce0['as'],'attributes':_0x25cce0[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x38c8d4){logger[_0x47a5('0xb')](_0x47a5('0x20'),_0x9ac908);logger[_0x47a5('0xd')](_0x47a5('0x20'),_0x9ac908,JSON[_0x47a5('0xe')](_0x38c8d4));_0x4d6b57(_0x38c8d4);})[_0x47a5('0x14')](function(_0x4caed5){logger[_0x47a5('0xf')](_0x47a5('0x20'),_0x4caed5['message'],_0x9ac908);_0x256650(_0x16901f[_0x47a5('0xf')](0x1f4,_0x4caed5[_0x47a5('0x11')]));});});};exports[_0x47a5('0x22')]=function(_0x49c4b5){var _0x101f70=this;return new Promise(function(_0x10f660,_0x596097){return db[_0x47a5('0x15')][_0x47a5('0x23')](_0x49c4b5['body'],{'raw':_0x49c4b5['options']?_0x49c4b5['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x9b5eaf){logger[_0x47a5('0xb')](_0x47a5('0x22'),_0x49c4b5);logger[_0x47a5('0xd')](_0x47a5('0x22'),_0x49c4b5,JSON[_0x47a5('0xe')](_0x9b5eaf));_0x10f660(_0x9b5eaf);})[_0x47a5('0x14')](function(_0x1f3d01){logger[_0x47a5('0xf')](_0x47a5('0x22'),_0x1f3d01[_0x47a5('0x11')],_0x49c4b5);_0x596097(_0x101f70[_0x47a5('0xf')](0x1f4,_0x1f3d01[_0x47a5('0x11')]));});});};exports['UpdateCmHopper']=function(_0x1fbece){var _0x1c36fa=this;return new Promise(function(_0x331474,_0x23bd8d){return db['CmHopper'][_0x47a5('0x24')](_0x1fbece['body'],{'raw':_0x1fbece['options']?_0x1fbece['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fbece[_0x47a5('0x17')]?_0x1fbece['options'][_0x47a5('0x19')]||null:null,'attributes':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['attributes']||null:null,'limit':_0x1fbece[_0x47a5('0x17')]?_0x1fbece[_0x47a5('0x17')]['limit']||null:null})['then'](function(_0xbe21d9){logger['info'](_0x47a5('0x25'),_0x1fbece);logger[_0x47a5('0xd')](_0x47a5('0x25'),_0x1fbece,JSON[_0x47a5('0xe')](_0xbe21d9));_0x331474(_0xbe21d9);})[_0x47a5('0x14')](function(_0xf0edbb){logger[_0x47a5('0xf')](_0x47a5('0x25'),_0xf0edbb[_0x47a5('0x11')],_0x1fbece);_0x23bd8d(_0x1c36fa[_0x47a5('0xf')](0x1f4,_0xf0edbb[_0x47a5('0x11')]));});});};exports[_0x47a5('0x26')]=function(_0xe28d76){var _0x3574d4=this;return new Promise(function(_0x4e5e7,_0x3a2b38){return db['CmHopper'][_0x47a5('0x27')]({'where':_0xe28d76[_0x47a5('0x17')]?_0xe28d76['options']['where']||null:null})[_0x47a5('0x1e')](function(_0x560e4e){logger[_0x47a5('0xb')](_0x47a5('0x26'),_0xe28d76);logger['debug']('DestroyCmHopper',_0xe28d76,JSON[_0x47a5('0xe')](_0x560e4e));_0x4e5e7(_0x560e4e);})['catch'](function(_0x2d147c){logger[_0x47a5('0xf')](_0x47a5('0x26'),_0x2d147c[_0x47a5('0x11')],_0xe28d76);_0x3a2b38(_0x3574d4[_0x47a5('0xf')](0x1f4,_0x2d147c[_0x47a5('0x11')]));});});};exports[_0x47a5('0x28')]=function(_0x53e994){var _0x48a0ef=this;return new Promise(function(_0x2dd1db,_0x411230){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x2c0c86){return db[_0x47a5('0x2b')]['transaction'](function(_0x45cca5){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'where':_0x53e994['options']?_0x53e994[_0x47a5('0x17')]['where']||null:null,'attributes':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x1a')]||null:null,'limit':_0x53e994[_0x47a5('0x17')]?_0x53e994['options'][_0x47a5('0x2c')]||null:null,'order':_0x53e994[_0x47a5('0x17')]?_0x53e994[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'transaction':_0x45cca5,'lock':_0x45cca5[_0x47a5('0x2e')][_0x47a5('0x2f')],'include':[{'model':db[_0x47a5('0x29')],'as':'Contact','attributes':_[_0x47a5('0x30')](_0x2c0c86)},{'model':db[_0x47a5('0x31')],'as':_0x47a5('0x32'),'attributes':['id',_0x47a5('0x33'),_0x47a5('0x34')]}]})[_0x47a5('0x1e')](function(_0x572233){var _0x1ad6a9=[];for(var _0x245a15=0x0;_0x245a15<_0x572233[_0x47a5('0x35')];_0x245a15+=0x1){_0x1ad6a9['push'](_0x572233[_0x245a15][_0x47a5('0x24')](_0x53e994[_0x47a5('0x36')],{'transaction':_0x45cca5}));}return BPromise[_0x47a5('0x37')](_0x1ad6a9);});})['then'](function(_0x57641e){logger[_0x47a5('0xb')](_0x47a5('0x28'),_0x53e994);logger['debug']('GetContactDialer',_0x53e994,JSON[_0x47a5('0xe')](_0x57641e));_0x2dd1db(_0x57641e);})['catch'](function(_0x16bb8a){logger['error']('GetContactDialer',_0x16bb8a[_0x47a5('0x11')],_0x53e994);_0x411230(_0x48a0ef[_0x47a5('0xf')](0x1f4,_0x16bb8a['message']));});});});};exports[_0x47a5('0x38')]=function(_0x72fe){var _0x4b706a=this;return new Promise(function(_0x5b6127,_0x16b4fd){return db[_0x47a5('0x2b')][_0x47a5('0x39')](function(_0x2931e4){return db['CmHopperFinal'][_0x47a5('0x23')](_0x72fe[_0x47a5('0x36')],{'raw':_0x72fe[_0x47a5('0x17')]?_0x72fe['options'][_0x47a5('0x18')]===undefined?!![]:![]:!![],'transaction':_0x2931e4})['then'](function(){return db[_0x47a5('0x15')][_0x47a5('0x27')]({'where':_0x72fe[_0x47a5('0x17')]?_0x72fe[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'transaction':_0x2931e4});});})['then'](function(_0x144af9){logger['info']('MoveContactManagedDialer',_0x72fe);logger['debug']('MoveContactManagedDialer',_0x72fe,JSON[_0x47a5('0xe')](_0x144af9));_0x5b6127(_0x144af9);})[_0x47a5('0x14')](function(_0x1e2bb4){logger['error']('MoveContactManagedDialer',_0x1e2bb4[_0x47a5('0x11')],_0x72fe);_0x16b4fd(_0x4b706a[_0x47a5('0xf')](0x1f4,_0x1e2bb4[_0x47a5('0x11')]));});});};exports[_0x47a5('0x3a')]=function(_0xc45e25){var _0x4b5d0c=this;return new Promise(function(_0x3474b7,_0x519e9e){return db[_0x47a5('0x15')][_0x47a5('0x16')]({'raw':_0xc45e25['options']?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x18')]===undefined?!![]:![]:!![],'where':_0xc45e25[_0x47a5('0x17')]?_0xc45e25[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':[[db[_0x47a5('0x2b')]['fn'](_0x47a5('0x3b'),db[_0x47a5('0x2b')]['fn']('IF',db['sequelize'][_0x47a5('0x3c')](_0x47a5('0x3d')+util[_0x47a5('0x3e')](_0x47a5('0x3f'),moment()[_0x47a5('0x3e')]('YYYY-MM-DD\x20HH:mm:ss'))+_0x47a5('0x40')))),_0x47a5('0x41')]]})[_0x47a5('0x1e')](function(_0x144aaa){logger[_0x47a5('0xb')](_0x47a5('0x3a'),_0xc45e25);logger[_0x47a5('0xd')](_0x47a5('0x3a'),_0xc45e25,JSON[_0x47a5('0xe')](_0x144aaa));_0x3474b7(_0x144aaa);})[_0x47a5('0x14')](function(_0x1d56f3){logger[_0x47a5('0xf')](_0x47a5('0x3a'),_0x1d56f3[_0x47a5('0x11')],_0xc45e25);_0x519e9e(_0x4b5d0c[_0x47a5('0xf')](0x1f4,_0x1d56f3['message']));});});};exports[_0x47a5('0x42')]=function(_0x284fb8){var _0x30504e=this;return new Promise(function(_0x4b42f3,_0x37ac59){return db[_0x47a5('0x29')][_0x47a5('0x2a')]()[_0x47a5('0x1e')](function(_0x5d9822){return db[_0x47a5('0x2b')]['transaction'](function(_0x2d5ee6){return db['CmHopper'][_0x47a5('0x16')]({'where':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x19')]||null:null,'attributes':_0x284fb8[_0x47a5('0x17')]?_0x284fb8['options']['attributes']||null:null,'limit':0x1,'order':_0x284fb8['options']?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x2d')]||null:null,'group':db[_0x47a5('0x15')][_0x47a5('0x43')],'transaction':_0x2d5ee6,'lock':_0x2d5ee6['LOCK'][_0x47a5('0x2f')],'include':_0x284fb8[_0x47a5('0x17')]?_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x284fb8[_0x47a5('0x17')][_0x47a5('0x1b')],function(_0x39939a){return{'model':db[_0x39939a[_0x47a5('0x1d')]],'as':_0x39939a['as'],'attributes':_0x39939a[_0x47a5('0x1a')],'include':_0x39939a[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x39939a['include'],function(_0x1e3212){return{'model':db[_0x1e3212['model']],'as':_0x1e3212['as'],'attributes':_0x1e3212[_0x47a5('0x1a')],'include':_0x1e3212[_0x47a5('0x1b')]?_[_0x47a5('0x1c')](_0x1e3212[_0x47a5('0x1b')],function(_0x40e584){return{'model':db[_0x40e584[_0x47a5('0x1d')]],'as':_0x40e584['as'],'attributes':_0x40e584[_0x47a5('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x47a5('0x1e')](function(_0x11c1db){var _0x254049=[];for(var _0x1cfb37=0x0;_0x1cfb37<_0x11c1db[_0x47a5('0x35')];_0x1cfb37+=0x1){_0x254049[_0x47a5('0x44')](_0x11c1db[_0x1cfb37][_0x47a5('0x24')](_0x284fb8[_0x47a5('0x36')],{'transaction':_0x2d5ee6}));}return BPromise['all'](_0x254049);});})['then'](function(_0x5ccc89){logger['info'](_0x47a5('0x42'),_0x284fb8);logger[_0x47a5('0xd')]('GetContactRecallMe',_0x284fb8,JSON[_0x47a5('0xe')](_0x5ccc89));_0x4b42f3(_0x5ccc89);})[_0x47a5('0x14')](function(_0x1baa5a){logger[_0x47a5('0xf')](_0x47a5('0x42'),_0x1baa5a[_0x47a5('0x11')],_0x284fb8);_0x37ac59(_0x30504e[_0x47a5('0xf')](0x1f4,_0x1baa5a[_0x47a5('0x11')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 44de76d..3ebdf04 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 _0x937d=['./cmHopper.controller','isAuthenticated','index','get','describe','/opencontacts','getOpenContacts','/:id','show','post','/preview','getPreview','put','update','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2fa847,_0x26fa15){var _0x1e7758=function(_0x5792a5){while(--_0x5792a5){_0x2fa847['push'](_0x2fa847['shift']());}};_0x1e7758(++_0x26fa15);}(_0x937d,0x1f4));var _0xd937=function(_0x3b4c0f,_0xbaff){_0x3b4c0f=_0x3b4c0f-0x0;var _0x36a1f3=_0x937d[_0x3b4c0f];return _0x36a1f3;};'use strict';var multer=require(_0xd937('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd937('0x1'));var router=express[_0xd937('0x2')]();var auth=require(_0xd937('0x3'));var interaction=require(_0xd937('0x4'));var config=require(_0xd937('0x5'));var controller=require(_0xd937('0x6'));router['get']('/',auth[_0xd937('0x7')](),controller[_0xd937('0x8')]);router[_0xd937('0x9')]('/describe',auth[_0xd937('0x7')](),controller[_0xd937('0xa')]);router['get'](_0xd937('0xb'),auth[_0xd937('0x7')](),controller[_0xd937('0xc')]);router[_0xd937('0x9')](_0xd937('0xd'),auth['isAuthenticated'](),controller[_0xd937('0xe')]);router['post']('/',auth[_0xd937('0x7')](),controller['create']);router[_0xd937('0xf')](_0xd937('0x10'),auth[_0xd937('0x7')](),controller[_0xd937('0x11')]);router[_0xd937('0x12')]('/:id',auth[_0xd937('0x7')](),controller[_0xd937('0x13')]);router[_0xd937('0x14')](_0xd937('0xd'),auth[_0xd937('0x7')](),controller[_0xd937('0x15')]);module[_0xd937('0x16')]=router; \ No newline at end of file +var _0x6b72=['./cmHopper.controller','get','isAuthenticated','index','/describe','describe','/opencontacts','/:id','post','create','/preview','getPreview','put','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service'];(function(_0x455d61,_0x190258){var _0x2131c7=function(_0x2a8712){while(--_0x2a8712){_0x455d61['push'](_0x455d61['shift']());}};_0x2131c7(++_0x190258);}(_0x6b72,0x19d));var _0x26b7=function(_0x2004ef,_0x1ed236){_0x2004ef=_0x2004ef-0x0;var _0x550603=_0x6b72[_0x2004ef];return _0x550603;};'use strict';var multer=require(_0x26b7('0x0'));var util=require('util');var path=require(_0x26b7('0x1'));var timeout=require(_0x26b7('0x2'));var express=require('express');var router=express[_0x26b7('0x3')]();var auth=require(_0x26b7('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x26b7('0x5'));router[_0x26b7('0x6')]('/',auth[_0x26b7('0x7')](),controller[_0x26b7('0x8')]);router[_0x26b7('0x6')](_0x26b7('0x9'),auth[_0x26b7('0x7')](),controller[_0x26b7('0xa')]);router[_0x26b7('0x6')](_0x26b7('0xb'),auth[_0x26b7('0x7')](),controller['getOpenContacts']);router[_0x26b7('0x6')](_0x26b7('0xc'),auth[_0x26b7('0x7')](),controller['show']);router[_0x26b7('0xd')]('/',auth['isAuthenticated'](),controller[_0x26b7('0xe')]);router['post'](_0x26b7('0xf'),auth[_0x26b7('0x7')](),controller[_0x26b7('0x10')]);router[_0x26b7('0x11')]('/:id',auth[_0x26b7('0x7')](),controller[_0x26b7('0x12')]);router[_0x26b7('0x13')](_0x26b7('0xc'),auth[_0x26b7('0x7')](),controller[_0x26b7('0x14')]);module[_0x26b7('0x15')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 2428068..15d2104 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 _0x2326=['contactListQueue','moment','exports'];(function(_0x537c37,_0x536e74){var _0x241f84=function(_0x3fe709){while(--_0x3fe709){_0x537c37['push'](_0x537c37['shift']());}};_0x241f84(++_0x536e74);}(_0x2326,0x14e));var _0x6232=function(_0x575ab4,_0x2cc16b){_0x575ab4=_0x575ab4-0x0;var _0x8faa95=_0x2326[_0x575ab4];return _0x8faa95;};'use strict';var moment=require(_0x6232('0x0'));var Sequelize=require('sequelize');module[_0x6232('0x1')]={'phone':{'type':Sequelize['STRING'],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x6232('0x2')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x6232('0x2')},'VoiceQueueId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'}}; \ No newline at end of file +var _0x2d0e=['sequelize','exports','STRING','contactListQueue','INTEGER'];(function(_0x476b5f,_0x1f9952){var _0x5a23d8=function(_0x50b464){while(--_0x50b464){_0x476b5f['push'](_0x476b5f['shift']());}};_0x5a23d8(++_0x1f9952);}(_0x2d0e,0xe6));var _0xe2d0=function(_0x28c4cf,_0x137caa){_0x28c4cf=_0x28c4cf-0x0;var _0xd408c8=_0x2d0e[_0x28c4cf];return _0xd408c8;};'use strict';var moment=require('moment');var Sequelize=require(_0xe2d0('0x0'));module[_0xe2d0('0x1')]={'phone':{'type':Sequelize[_0xe2d0('0x2')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0xe2d0('0x3')},'ListId':{'type':Sequelize[_0xe2d0('0x4')],'unique':_0xe2d0('0x3')},'VoiceQueueId':{'type':Sequelize[_0xe2d0('0x4')],'unique':_0xe2d0('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 4e1cdd0..be2026a 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 _0xeb3f=['order','sort','pick','filter','where','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','include','merge','find','body','describe','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','Content-Range','update','destroy','then','error','name','send','map','CmHopperBlack','type','key','model','query','keys','filters','intersection','fields','length','attributes','hasOwnProperty','nolimit','limit','offset'];(function(_0x4973ec,_0x23756f){var _0x2f0e9b=function(_0x373872){while(--_0x373872){_0x4973ec['push'](_0x4973ec['shift']());}};_0x2f0e9b(++_0x23756f);}(_0xeb3f,0xa8));var _0xfeb3=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xeb3f[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0xfeb3('0x0'));var emlformat=require(_0xfeb3('0x1'));var rimraf=require(_0xfeb3('0x2'));var zipdir=require(_0xfeb3('0x3'));var jsonpatch=require(_0xfeb3('0x4'));var rp=require(_0xfeb3('0x5'));var moment=require(_0xfeb3('0x6'));var BPromise=require(_0xfeb3('0x7'));var Mustache=require(_0xfeb3('0x8'));var util=require(_0xfeb3('0x9'));var path=require(_0xfeb3('0xa'));var sox=require(_0xfeb3('0xb'));var csv=require(_0xfeb3('0xc'));var ejs=require(_0xfeb3('0xd'));var fs=require('fs');var _=require(_0xfeb3('0xe'));var squel=require('squel');var crypto=require(_0xfeb3('0xf'));var jsforce=require(_0xfeb3('0x10'));var deskjs=require(_0xfeb3('0x11'));var toCsv=require(_0xfeb3('0xc'));var querystring=require(_0xfeb3('0x12'));var Papa=require(_0xfeb3('0x13'));var Redis=require(_0xfeb3('0x14'));var authService=require(_0xfeb3('0x15'));var qs=require(_0xfeb3('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfeb3('0x17'));var logger=require(_0xfeb3('0x18'))(_0xfeb3('0x19'));var utils=require(_0xfeb3('0x1a'));var config=require(_0xfeb3('0x1b'));var db=require(_0xfeb3('0x1c'))['db'];function respondWithStatusCode(_0x350416,_0x3a8846){_0x3a8846=_0x3a8846||0xcc;return function(_0x519028){if(_0x519028){return _0x350416[_0xfeb3('0x1d')](_0x3a8846);}return _0x350416[_0xfeb3('0x1e')](_0x3a8846)[_0xfeb3('0x1f')]();};}function respondWithResult(_0x35f9b5,_0x491e52){_0x491e52=_0x491e52||0xc8;return function(_0x293eac){if(_0x293eac){return _0x35f9b5['status'](_0x491e52)[_0xfeb3('0x20')](_0x293eac);}};}function respondWithFilteredResult(_0x231a57,_0x3bad36){return function(_0x1d388d){if(_0x1d388d){var _0x1b6df3=_0x1d388d[_0xfeb3('0x21')],_0x572a86=_0x3bad36['offset'],_0x320464=_0x3bad36['offset']+_0x3bad36['limit'],_0x363a9c;if(_0x320464>=_0x1b6df3){_0x320464=_0x1b6df3;_0x363a9c=0xc8;}else{_0x363a9c=0xce;}_0x231a57[_0xfeb3('0x1e')](_0x363a9c);return _0x231a57['set'](_0xfeb3('0x22'),_0x572a86+'-'+_0x320464+'/'+_0x1b6df3)[_0xfeb3('0x20')](_0x1d388d);}return null;};}function patchUpdates(_0x2547a0){return function(_0x431557){try{jsonpatch['apply'](_0x431557,_0x2547a0,!![]);}catch(_0x338c37){return BPromise['reject'](_0x338c37);}return _0x431557['save']();};}function saveUpdates(_0x4d48a2,_0x3c714b){return function(_0xd684e1){if(_0xd684e1){return _0xd684e1[_0xfeb3('0x23')](_0x4d48a2)['then'](function(_0x39c502){return _0x39c502;});}return null;};}function removeEntity(_0x2d77a3,_0x421ccd){return function(_0x43a21f){if(_0x43a21f){return _0x43a21f[_0xfeb3('0x24')]()[_0xfeb3('0x25')](function(){_0x2d77a3[_0xfeb3('0x1e')](0xcc)[_0xfeb3('0x1f')]();});}};}function handleEntityNotFound(_0x506a2c,_0x3978eb){return function(_0x460a28){if(!_0x460a28){_0x506a2c[_0xfeb3('0x1d')](0x194);}return _0x460a28;};}function handleError(_0x2b4fa1,_0x133e2a){_0x133e2a=_0x133e2a||0x1f4;return function(_0x17b5f4){logger[_0xfeb3('0x26')](_0x17b5f4['stack']);if(_0x17b5f4[_0xfeb3('0x27')]){delete _0x17b5f4['name'];}_0x2b4fa1[_0xfeb3('0x1e')](_0x133e2a)[_0xfeb3('0x28')](_0x17b5f4);};}exports['index']=function(_0x22803a,_0x3007b8){var _0x3d31c2={},_0x2a6df6={},_0x4a7478={'count':0x0,'rows':[]};var _0x1d8c33=_[_0xfeb3('0x29')](db[_0xfeb3('0x2a')]['rawAttributes'],function(_0x2d0a5d){return{'name':_0x2d0a5d['fieldName'],'type':_0x2d0a5d[_0xfeb3('0x2b')][_0xfeb3('0x2c')]};});_0x2a6df6[_0xfeb3('0x2d')]=_[_0xfeb3('0x29')](_0x1d8c33,_0xfeb3('0x27'));_0x2a6df6[_0xfeb3('0x2e')]=_[_0xfeb3('0x2f')](_0x22803a[_0xfeb3('0x2e')]);_0x2a6df6[_0xfeb3('0x30')]=_[_0xfeb3('0x31')](_0x2a6df6[_0xfeb3('0x2d')],_0x2a6df6[_0xfeb3('0x2e')]);_0x3d31c2['attributes']=_['intersection'](_0x2a6df6[_0xfeb3('0x2d')],qs[_0xfeb3('0x32')](_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x32')]));_0x3d31c2['attributes']=_0x3d31c2['attributes'][_0xfeb3('0x33')]?_0x3d31c2[_0xfeb3('0x34')]:_0x2a6df6[_0xfeb3('0x2d')];if(!_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x35')](_0xfeb3('0x36'))){_0x3d31c2[_0xfeb3('0x37')]=qs[_0xfeb3('0x37')](_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x37')]);_0x3d31c2[_0xfeb3('0x38')]=qs[_0xfeb3('0x38')](_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x38')]);}_0x3d31c2[_0xfeb3('0x39')]=qs[_0xfeb3('0x3a')](_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x3a')]);_0x3d31c2['where']=qs[_0xfeb3('0x30')](_[_0xfeb3('0x3b')](_0x22803a[_0xfeb3('0x2e')],_0x2a6df6[_0xfeb3('0x30')]));if(_0x22803a[_0xfeb3('0x2e')][_0xfeb3('0x3c')]){_0x3d31c2[_0xfeb3('0x3d')]=_['merge'](_0x3d31c2[_0xfeb3('0x3d')],{'$or':_[_0xfeb3('0x29')](_0x1d8c33,function(_0x1f7941){if(_0x1f7941[_0xfeb3('0x2b')]!==_0xfeb3('0x3e')){var _0x1ce4de={};_0x1ce4de[_0x1f7941[_0xfeb3('0x27')]]={'$like':'%'+_0x22803a['query']['filter']+'%'};return _0x1ce4de;}})});}_0x3d31c2=_['merge']({},_0x3d31c2,_0x22803a[_0xfeb3('0x3f')]);var _0x527abe={'where':_0x3d31c2[_0xfeb3('0x3d')]};return db[_0xfeb3('0x2a')][_0xfeb3('0x21')](_0x527abe)[_0xfeb3('0x25')](function(_0x21de58){_0x4a7478[_0xfeb3('0x21')]=_0x21de58;if(_0x22803a['query'][_0xfeb3('0x40')]){_0x3d31c2['include']=[{'all':!![]}];}return db[_0xfeb3('0x2a')][_0xfeb3('0x41')](_0x3d31c2);})[_0xfeb3('0x25')](function(_0x18fd2e){_0x4a7478[_0xfeb3('0x42')]=_0x18fd2e;return _0x4a7478;})[_0xfeb3('0x25')](respondWithFilteredResult(_0x3007b8,_0x3d31c2))[_0xfeb3('0x43')](handleError(_0x3007b8,null));};exports[_0xfeb3('0x44')]=function(_0x34bf32,_0x196b03){var _0x11a504={'raw':!![],'where':{'id':_0x34bf32[_0xfeb3('0x45')]['id']}},_0x56cbb5={};_0x56cbb5[_0xfeb3('0x2d')]=_['keys'](db[_0xfeb3('0x2a')]['rawAttributes']);_0x56cbb5[_0xfeb3('0x2e')]=_['keys'](_0x34bf32[_0xfeb3('0x2e')]);_0x56cbb5['filters']=_[_0xfeb3('0x31')](_0x56cbb5['model'],_0x56cbb5[_0xfeb3('0x2e')]);_0x11a504[_0xfeb3('0x34')]=_['intersection'](_0x56cbb5['model'],qs[_0xfeb3('0x32')](_0x34bf32['query'][_0xfeb3('0x32')]));_0x11a504[_0xfeb3('0x34')]=_0x11a504[_0xfeb3('0x34')][_0xfeb3('0x33')]?_0x11a504[_0xfeb3('0x34')]:_0x56cbb5[_0xfeb3('0x2d')];if(_0x34bf32[_0xfeb3('0x2e')][_0xfeb3('0x40')]){_0x11a504[_0xfeb3('0x46')]=[{'all':!![]}];}_0x11a504=_[_0xfeb3('0x47')]({},_0x11a504,_0x34bf32[_0xfeb3('0x3f')]);return db[_0xfeb3('0x2a')][_0xfeb3('0x48')](_0x11a504)['then'](handleEntityNotFound(_0x196b03,null))[_0xfeb3('0x25')](respondWithResult(_0x196b03,null))['catch'](handleError(_0x196b03,null));};exports[_0xfeb3('0x23')]=function(_0x53dbe5,_0x2ecab8){if(_0x53dbe5[_0xfeb3('0x49')]['id']){delete _0x53dbe5[_0xfeb3('0x49')]['id'];}return db[_0xfeb3('0x2a')][_0xfeb3('0x48')]({'where':{'id':_0x53dbe5['params']['id']}})[_0xfeb3('0x25')](handleEntityNotFound(_0x2ecab8,null))['then'](saveUpdates(_0x53dbe5[_0xfeb3('0x49')],null))['then'](respondWithResult(_0x2ecab8,null))[_0xfeb3('0x43')](handleError(_0x2ecab8,null));};exports[_0xfeb3('0x24')]=function(_0x3efdc7,_0x38ad13){return db['CmHopperBlack'][_0xfeb3('0x48')]({'where':{'id':_0x3efdc7[_0xfeb3('0x45')]['id']}})[_0xfeb3('0x25')](handleEntityNotFound(_0x38ad13,null))[_0xfeb3('0x25')](removeEntity(_0x38ad13,null))[_0xfeb3('0x43')](handleError(_0x38ad13,null));};exports[_0xfeb3('0x4a')]=function(_0x3d1ff9,_0xd4784c){return db[_0xfeb3('0x2a')][_0xfeb3('0x4a')]()[_0xfeb3('0x25')](respondWithResult(_0xd4784c,null))[_0xfeb3('0x43')](handleError(_0xd4784c,null));}; \ No newline at end of file +var _0x88c7=['apply','save','update','then','destroy','end','error','stack','name','send','index','CmHopperBlack','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','length','nolimit','order','sort','filters','pick','filter','merge','where','VIRTUAL','includeAll','include','catch','show','params','keys','fields','find','body','describe','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','count','offset','limit','set','Content-Range'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x88c7,0x6f));var _0x788c=function(_0x3c0745,_0x5cf11e){_0x3c0745=_0x3c0745-0x0;var _0x517c61=_0x88c7[_0x3c0745];return _0x517c61;};'use strict';var pdf=require(_0x788c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x788c('0x1'));var jsonpatch=require(_0x788c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x788c('0x3'));var Mustache=require(_0x788c('0x4'));var util=require('util');var path=require(_0x788c('0x5'));var sox=require(_0x788c('0x6'));var csv=require('to-csv');var ejs=require(_0x788c('0x7'));var fs=require('fs');var _=require(_0x788c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x788c('0x9'));var deskjs=require(_0x788c('0xa'));var toCsv=require(_0x788c('0xb'));var querystring=require(_0x788c('0xc'));var Papa=require(_0x788c('0xd'));var Redis=require('ioredis');var authService=require(_0x788c('0xe'));var qs=require(_0x788c('0xf'));var as=require(_0x788c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x788c('0x11'))(_0x788c('0x12'));var utils=require(_0x788c('0x13'));var config=require(_0x788c('0x14'));var db=require(_0x788c('0x15'))['db'];function respondWithStatusCode(_0xce4ada,_0x4bdf26){_0x4bdf26=_0x4bdf26||0xcc;return function(_0x1f899c){if(_0x1f899c){return _0xce4ada['sendStatus'](_0x4bdf26);}return _0xce4ada[_0x788c('0x16')](_0x4bdf26)['end']();};}function respondWithResult(_0xdab417,_0x42817b){_0x42817b=_0x42817b||0xc8;return function(_0x2eb90a){if(_0x2eb90a){return _0xdab417[_0x788c('0x16')](_0x42817b)[_0x788c('0x17')](_0x2eb90a);}};}function respondWithFilteredResult(_0x7249ae,_0x3d7971){return function(_0x3d837d){if(_0x3d837d){var _0x2b6e32=_0x3d837d[_0x788c('0x18')],_0x41d920=_0x3d7971['offset'],_0x67dc6c=_0x3d7971[_0x788c('0x19')]+_0x3d7971[_0x788c('0x1a')],_0xa118b5;if(_0x67dc6c>=_0x2b6e32){_0x67dc6c=_0x2b6e32;_0xa118b5=0xc8;}else{_0xa118b5=0xce;}_0x7249ae[_0x788c('0x16')](_0xa118b5);return _0x7249ae[_0x788c('0x1b')](_0x788c('0x1c'),_0x41d920+'-'+_0x67dc6c+'/'+_0x2b6e32)[_0x788c('0x17')](_0x3d837d);}return null;};}function patchUpdates(_0x9f9cec){return function(_0x360106){try{jsonpatch[_0x788c('0x1d')](_0x360106,_0x9f9cec,!![]);}catch(_0x37ecba){return BPromise['reject'](_0x37ecba);}return _0x360106[_0x788c('0x1e')]();};}function saveUpdates(_0x2cbbba,_0x7ef5d5){return function(_0x130eae){if(_0x130eae){return _0x130eae[_0x788c('0x1f')](_0x2cbbba)[_0x788c('0x20')](function(_0x397cd7){return _0x397cd7;});}return null;};}function removeEntity(_0x21be51,_0x5e93b5){return function(_0x7b2ba0){if(_0x7b2ba0){return _0x7b2ba0[_0x788c('0x21')]()[_0x788c('0x20')](function(){_0x21be51[_0x788c('0x16')](0xcc)[_0x788c('0x22')]();});}};}function handleEntityNotFound(_0x1f1ab1,_0x14deb4){return function(_0x2a1235){if(!_0x2a1235){_0x1f1ab1['sendStatus'](0x194);}return _0x2a1235;};}function handleError(_0x3bf479,_0x30ea17){_0x30ea17=_0x30ea17||0x1f4;return function(_0x487ee2){logger[_0x788c('0x23')](_0x487ee2[_0x788c('0x24')]);if(_0x487ee2[_0x788c('0x25')]){delete _0x487ee2['name'];}_0x3bf479[_0x788c('0x16')](_0x30ea17)[_0x788c('0x26')](_0x487ee2);};}exports[_0x788c('0x27')]=function(_0x37d2eb,_0x200134){var _0x2ea11c={},_0x271218={},_0x12fdbc={'count':0x0,'rows':[]};var _0x2dbf2d=_['map'](db[_0x788c('0x28')][_0x788c('0x29')],function(_0x297ea6){return{'name':_0x297ea6[_0x788c('0x2a')],'type':_0x297ea6[_0x788c('0x2b')][_0x788c('0x2c')]};});_0x271218[_0x788c('0x2d')]=_[_0x788c('0x2e')](_0x2dbf2d,_0x788c('0x25'));_0x271218[_0x788c('0x2f')]=_['keys'](_0x37d2eb[_0x788c('0x2f')]);_0x271218['filters']=_[_0x788c('0x30')](_0x271218[_0x788c('0x2d')],_0x271218[_0x788c('0x2f')]);_0x2ea11c[_0x788c('0x31')]=_[_0x788c('0x30')](_0x271218[_0x788c('0x2d')],qs['fields'](_0x37d2eb[_0x788c('0x2f')]['fields']));_0x2ea11c[_0x788c('0x31')]=_0x2ea11c['attributes'][_0x788c('0x32')]?_0x2ea11c['attributes']:_0x271218[_0x788c('0x2d')];if(!_0x37d2eb['query']['hasOwnProperty'](_0x788c('0x33'))){_0x2ea11c[_0x788c('0x1a')]=qs['limit'](_0x37d2eb[_0x788c('0x2f')][_0x788c('0x1a')]);_0x2ea11c['offset']=qs[_0x788c('0x19')](_0x37d2eb['query']['offset']);}_0x2ea11c[_0x788c('0x34')]=qs[_0x788c('0x35')](_0x37d2eb[_0x788c('0x2f')]['sort']);_0x2ea11c['where']=qs[_0x788c('0x36')](_[_0x788c('0x37')](_0x37d2eb['query'],_0x271218['filters']));if(_0x37d2eb['query'][_0x788c('0x38')]){_0x2ea11c['where']=_[_0x788c('0x39')](_0x2ea11c[_0x788c('0x3a')],{'$or':_[_0x788c('0x2e')](_0x2dbf2d,function(_0x1976e1){if(_0x1976e1[_0x788c('0x2b')]!==_0x788c('0x3b')){var _0x583ede={};_0x583ede[_0x1976e1[_0x788c('0x25')]]={'$like':'%'+_0x37d2eb[_0x788c('0x2f')][_0x788c('0x38')]+'%'};return _0x583ede;}})});}_0x2ea11c=_['merge']({},_0x2ea11c,_0x37d2eb['options']);var _0x329f91={'where':_0x2ea11c['where']};return db['CmHopperBlack'][_0x788c('0x18')](_0x329f91)[_0x788c('0x20')](function(_0x9302d3){_0x12fdbc[_0x788c('0x18')]=_0x9302d3;if(_0x37d2eb[_0x788c('0x2f')][_0x788c('0x3c')]){_0x2ea11c[_0x788c('0x3d')]=[{'all':!![]}];}return db['CmHopperBlack']['findAll'](_0x2ea11c);})[_0x788c('0x20')](function(_0x132df2){_0x12fdbc['rows']=_0x132df2;return _0x12fdbc;})[_0x788c('0x20')](respondWithFilteredResult(_0x200134,_0x2ea11c))[_0x788c('0x3e')](handleError(_0x200134,null));};exports[_0x788c('0x3f')]=function(_0x52e58c,_0x4440a1){var _0x1455bd={'raw':!![],'where':{'id':_0x52e58c[_0x788c('0x40')]['id']}},_0x3ca7b8={};_0x3ca7b8[_0x788c('0x2d')]=_[_0x788c('0x41')](db[_0x788c('0x28')][_0x788c('0x29')]);_0x3ca7b8[_0x788c('0x2f')]=_[_0x788c('0x41')](_0x52e58c[_0x788c('0x2f')]);_0x3ca7b8[_0x788c('0x36')]=_[_0x788c('0x30')](_0x3ca7b8['model'],_0x3ca7b8[_0x788c('0x2f')]);_0x1455bd[_0x788c('0x31')]=_[_0x788c('0x30')](_0x3ca7b8['model'],qs['fields'](_0x52e58c[_0x788c('0x2f')][_0x788c('0x42')]));_0x1455bd['attributes']=_0x1455bd[_0x788c('0x31')][_0x788c('0x32')]?_0x1455bd[_0x788c('0x31')]:_0x3ca7b8[_0x788c('0x2d')];if(_0x52e58c[_0x788c('0x2f')]['includeAll']){_0x1455bd['include']=[{'all':!![]}];}_0x1455bd=_[_0x788c('0x39')]({},_0x1455bd,_0x52e58c['options']);return db[_0x788c('0x28')][_0x788c('0x43')](_0x1455bd)[_0x788c('0x20')](handleEntityNotFound(_0x4440a1,null))[_0x788c('0x20')](respondWithResult(_0x4440a1,null))['catch'](handleError(_0x4440a1,null));};exports[_0x788c('0x1f')]=function(_0xcb05cb,_0x3e6ac2){if(_0xcb05cb['body']['id']){delete _0xcb05cb[_0x788c('0x44')]['id'];}return db[_0x788c('0x28')][_0x788c('0x43')]({'where':{'id':_0xcb05cb[_0x788c('0x40')]['id']}})[_0x788c('0x20')](handleEntityNotFound(_0x3e6ac2,null))[_0x788c('0x20')](saveUpdates(_0xcb05cb[_0x788c('0x44')],null))[_0x788c('0x20')](respondWithResult(_0x3e6ac2,null))['catch'](handleError(_0x3e6ac2,null));};exports['destroy']=function(_0x4c3b3c,_0x48830b){return db['CmHopperBlack'][_0x788c('0x43')]({'where':{'id':_0x4c3b3c['params']['id']}})[_0x788c('0x20')](handleEntityNotFound(_0x48830b,null))[_0x788c('0x20')](removeEntity(_0x48830b,null))[_0x788c('0x3e')](handleError(_0x48830b,null));};exports[_0x788c('0x45')]=function(_0x5c354c,_0x41307c){return db[_0x788c('0x28')][_0x788c('0x45')]()[_0x788c('0x20')](respondWithResult(_0x41307c,null))[_0x788c('0x3e')](handleError(_0x41307c,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 8141994..7abe3de 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 _0x2784=['path','rimraf','../../config/environment','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x20d13c,_0x51ad2d){var _0x4bd9a9=function(_0xd98885){while(--_0xd98885){_0x20d13c['push'](_0x20d13c['shift']());}};_0x4bd9a9(++_0x51ad2d);}(_0x2784,0xae));var _0x4278=function(_0x1f7b98,_0x4ffb4a){_0x1f7b98=_0x1f7b98-0x0;var _0x147a17=_0x2784[_0x1f7b98];return _0x147a17;};'use strict';var _=require(_0x4278('0x0'));var util=require(_0x4278('0x1'));var logger=require(_0x4278('0x2'))('api');var moment=require(_0x4278('0x3'));var BPromise=require(_0x4278('0x4'));var rp=require(_0x4278('0x5'));var fs=require('fs');var path=require(_0x4278('0x6'));var rimraf=require(_0x4278('0x7'));var config=require(_0x4278('0x8'));var attributes=require('./cmHopperBlack.attributes');module['exports']=function(_0x4bf525,_0x1d8b44){return _0x4bf525[_0x4278('0x9')](_0x4278('0xa'),attributes,{'tableName':_0x4278('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5ebe=['lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperBlack.attributes','exports','define','cm_hopper_black'];(function(_0x5e3701,_0x596265){var _0x345dcf=function(_0x5eb12a){while(--_0x5eb12a){_0x5e3701['push'](_0x5e3701['shift']());}};_0x345dcf(++_0x596265);}(_0x5ebe,0x16c));var _0xe5eb=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x5ebe[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xe5eb('0x0'));var util=require(_0xe5eb('0x1'));var logger=require('../../config/logger')(_0xe5eb('0x2'));var moment=require(_0xe5eb('0x3'));var BPromise=require(_0xe5eb('0x4'));var rp=require(_0xe5eb('0x5'));var fs=require('fs');var path=require(_0xe5eb('0x6'));var rimraf=require(_0xe5eb('0x7'));var config=require(_0xe5eb('0x8'));var attributes=require(_0xe5eb('0x9'));module[_0xe5eb('0xa')]=function(_0x43befd,_0x5e1880){return _0x43befd[_0xe5eb('0xb')]('CmHopperBlack',attributes,{'tableName':_0xe5eb('0xc'),'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 81bd240..25c123e 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 _0x6aab=['include','map','model','then','debug','catch','UpdateCmHopperBlack','limit','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','CmHopperBlack,\x20%s,\x20%s','CmHopperBlack,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes'];(function(_0x42245d,_0x51758f){var _0x4b211a=function(_0x2634e){while(--_0x2634e){_0x42245d['push'](_0x42245d['shift']());}};_0x4b211a(++_0x51758f);}(_0x6aab,0x14d));var _0xb6aa=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x6aab[_0x4792c8];return _0x35edb1;};'use strict';var _=require(_0xb6aa('0x0'));var util=require('util');var moment=require(_0xb6aa('0x1'));var BPromise=require(_0xb6aa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb6aa('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xb6aa('0x4'));var logger=require(_0xb6aa('0x5'))(_0xb6aa('0x6'));var config=require(_0xb6aa('0x7'));var jayson=require(_0xb6aa('0x8'));var client=jayson[_0xb6aa('0x9')][_0xb6aa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x27ac6d,_0x32f1dc,_0x5932cb){return new BPromise(function(_0x2ebb63,_0x114726){return client['request'](_0x27ac6d,_0x5932cb)['then'](function(_0x170aae){logger['info'](_0xb6aa('0xb'),_0x32f1dc,'request\x20sent');logger['debug'](_0xb6aa('0xc'),_0x32f1dc,_0xb6aa('0xd'),JSON[_0xb6aa('0xe')](_0x170aae));if(_0x170aae['error']){if(_0x170aae[_0xb6aa('0xf')][_0xb6aa('0x10')]===0x1f4){logger[_0xb6aa('0xf')](_0xb6aa('0xb'),_0x32f1dc,_0x170aae[_0xb6aa('0xf')]['message']);return _0x114726(_0x170aae[_0xb6aa('0xf')][_0xb6aa('0x11')]);}logger[_0xb6aa('0xf')](_0xb6aa('0xb'),_0x32f1dc,_0x170aae[_0xb6aa('0xf')][_0xb6aa('0x11')]);return _0x2ebb63(_0x170aae[_0xb6aa('0xf')]['message']);}else{logger[_0xb6aa('0x12')](_0xb6aa('0xb'),_0x32f1dc,_0xb6aa('0xd'));_0x2ebb63(_0x170aae[_0xb6aa('0x13')][_0xb6aa('0x11')]);}})['catch'](function(_0x365fa0){logger[_0xb6aa('0xf')](_0xb6aa('0xb'),_0x32f1dc,_0x365fa0);_0x114726(_0x365fa0);});});}exports[_0xb6aa('0x14')]=function(_0x429fba){var _0x29c284=this;return new Promise(function(_0x3ac2dc,_0x351185){return db[_0xb6aa('0x15')][_0xb6aa('0x16')]({'raw':_0x429fba[_0xb6aa('0x17')]?_0x429fba[_0xb6aa('0x17')][_0xb6aa('0x18')]===undefined?!![]:![]:!![],'where':_0x429fba[_0xb6aa('0x17')]?_0x429fba[_0xb6aa('0x17')][_0xb6aa('0x19')]||null:null,'attributes':_0x429fba[_0xb6aa('0x17')]?_0x429fba[_0xb6aa('0x17')][_0xb6aa('0x1a')]||null:null,'limit':_0x429fba[_0xb6aa('0x17')]?_0x429fba[_0xb6aa('0x17')]['limit']||null:null,'include':_0x429fba[_0xb6aa('0x17')]?_0x429fba[_0xb6aa('0x17')][_0xb6aa('0x1b')]?_[_0xb6aa('0x1c')](_0x429fba[_0xb6aa('0x17')]['include'],function(_0x361cbf){return{'model':db[_0x361cbf['model']],'as':_0x361cbf['as'],'attributes':_0x361cbf[_0xb6aa('0x1a')],'include':_0x361cbf['include']?_[_0xb6aa('0x1c')](_0x361cbf[_0xb6aa('0x1b')],function(_0x296489){return{'model':db[_0x296489[_0xb6aa('0x1d')]],'as':_0x296489['as'],'attributes':_0x296489[_0xb6aa('0x1a')],'include':_0x296489['include']?_[_0xb6aa('0x1c')](_0x296489[_0xb6aa('0x1b')],function(_0x136919){return{'model':db[_0x136919[_0xb6aa('0x1d')]],'as':_0x136919['as'],'attributes':_0x136919[_0xb6aa('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb6aa('0x1e')](function(_0x5c6915){logger[_0xb6aa('0x12')]('GetCmHopperBlack',_0x429fba);logger[_0xb6aa('0x1f')]('GetCmHopperBlack',_0x429fba,JSON[_0xb6aa('0xe')](_0x5c6915));_0x3ac2dc(_0x5c6915);})[_0xb6aa('0x20')](function(_0x5f49f5){logger['error'](_0xb6aa('0x14'),_0x5f49f5[_0xb6aa('0x11')],_0x429fba);_0x351185(_0x29c284[_0xb6aa('0xf')](0x1f4,_0x5f49f5['message']));});});};exports[_0xb6aa('0x21')]=function(_0x18ed0d){var _0x3d67e7=this;return new Promise(function(_0x664187,_0xacc491){return db[_0xb6aa('0x15')]['update'](_0x18ed0d['body'],{'raw':_0x18ed0d['options']?_0x18ed0d[_0xb6aa('0x17')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x18ed0d[_0xb6aa('0x17')]?_0x18ed0d[_0xb6aa('0x17')][_0xb6aa('0x19')]||null:null,'attributes':_0x18ed0d[_0xb6aa('0x17')]?_0x18ed0d['options'][_0xb6aa('0x1a')]||null:null,'limit':_0x18ed0d[_0xb6aa('0x17')]?_0x18ed0d['options'][_0xb6aa('0x22')]||null:null})[_0xb6aa('0x1e')](function(_0x1b34c2){logger[_0xb6aa('0x12')](_0xb6aa('0x21'),_0x18ed0d);logger[_0xb6aa('0x1f')](_0xb6aa('0x21'),_0x18ed0d,JSON[_0xb6aa('0xe')](_0x1b34c2));_0x664187(_0x1b34c2);})[_0xb6aa('0x20')](function(_0x1d0e10){logger['error']('UpdateCmHopperBlack',_0x1d0e10[_0xb6aa('0x11')],_0x18ed0d);_0xacc491(_0x3d67e7['error'](0x1f4,_0x1d0e10[_0xb6aa('0x11')]));});});};exports['DestroyCmHopperBlack']=function(_0x2d9404){var _0x107839=this;return new Promise(function(_0x57ad2d,_0x57e01f){return db['CmHopperBlack']['destroy']({'where':_0x2d9404[_0xb6aa('0x17')]?_0x2d9404[_0xb6aa('0x17')][_0xb6aa('0x19')]||null:null})[_0xb6aa('0x1e')](function(_0x56076e){logger[_0xb6aa('0x12')](_0xb6aa('0x23'),_0x2d9404);logger[_0xb6aa('0x1f')](_0xb6aa('0x23'),_0x2d9404,JSON[_0xb6aa('0xe')](_0x56076e));_0x57ad2d(_0x56076e);})[_0xb6aa('0x20')](function(_0x5a1c64){logger[_0xb6aa('0xf')](_0xb6aa('0x23'),_0x5a1c64[_0xb6aa('0x11')],_0x2d9404);_0x57e01f(_0x107839['error'](0x1f4,_0x5a1c64[_0xb6aa('0x11')]));});});}; \ No newline at end of file +var _0x8f54=['moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','limit','map','include','model','catch','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util'];(function(_0x1b4c04,_0x8d961d){var _0x374f5d=function(_0x11dc31){while(--_0x11dc31){_0x1b4c04['push'](_0x1b4c04['shift']());}};_0x374f5d(++_0x8d961d);}(_0x8f54,0x67));var _0x48f5=function(_0xb552c8,_0x579e50){_0xb552c8=_0xb552c8-0x0;var _0x4766b6=_0x8f54[_0xb552c8];return _0x4766b6;};'use strict';var _=require(_0x48f5('0x0'));var util=require(_0x48f5('0x1'));var moment=require(_0x48f5('0x2'));var BPromise=require(_0x48f5('0x3'));var rs=require(_0x48f5('0x4'));var fs=require('fs');var Redis=require(_0x48f5('0x5'));var db=require(_0x48f5('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x48f5('0x7'));var config=require(_0x48f5('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x48f5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x34d598,_0x1d6e6b,_0x4348b0){return new BPromise(function(_0x583fba,_0x16b032){return client[_0x48f5('0xa')](_0x34d598,_0x4348b0)[_0x48f5('0xb')](function(_0x39038f){logger[_0x48f5('0xc')](_0x48f5('0xd'),_0x1d6e6b,_0x48f5('0xe'));logger[_0x48f5('0xf')]('CmHopperBlack,\x20%s,\x20%s,\x20%s',_0x1d6e6b,_0x48f5('0xe'),JSON[_0x48f5('0x10')](_0x39038f));if(_0x39038f[_0x48f5('0x11')]){if(_0x39038f[_0x48f5('0x11')]['code']===0x1f4){logger[_0x48f5('0x11')](_0x48f5('0xd'),_0x1d6e6b,_0x39038f[_0x48f5('0x11')][_0x48f5('0x12')]);return _0x16b032(_0x39038f[_0x48f5('0x11')]['message']);}logger[_0x48f5('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x1d6e6b,_0x39038f[_0x48f5('0x11')]['message']);return _0x583fba(_0x39038f['error'][_0x48f5('0x12')]);}else{logger[_0x48f5('0xc')](_0x48f5('0xd'),_0x1d6e6b,_0x48f5('0xe'));_0x583fba(_0x39038f[_0x48f5('0x13')][_0x48f5('0x12')]);}})['catch'](function(_0x485790){logger[_0x48f5('0x11')]('CmHopperBlack,\x20%s,\x20%s',_0x1d6e6b,_0x485790);_0x16b032(_0x485790);});});}exports[_0x48f5('0x14')]=function(_0x5a8b7e){var _0x335fb9=this;return new Promise(function(_0x528c40,_0x343d09){return db[_0x48f5('0x15')][_0x48f5('0x16')]({'raw':_0x5a8b7e[_0x48f5('0x17')]?_0x5a8b7e['options']['raw']===undefined?!![]:![]:!![],'where':_0x5a8b7e[_0x48f5('0x17')]?_0x5a8b7e[_0x48f5('0x17')][_0x48f5('0x18')]||null:null,'attributes':_0x5a8b7e[_0x48f5('0x17')]?_0x5a8b7e[_0x48f5('0x17')][_0x48f5('0x19')]||null:null,'limit':_0x5a8b7e[_0x48f5('0x17')]?_0x5a8b7e[_0x48f5('0x17')][_0x48f5('0x1a')]||null:null,'include':_0x5a8b7e['options']?_0x5a8b7e[_0x48f5('0x17')]['include']?_[_0x48f5('0x1b')](_0x5a8b7e['options'][_0x48f5('0x1c')],function(_0x24cc3a){return{'model':db[_0x24cc3a[_0x48f5('0x1d')]],'as':_0x24cc3a['as'],'attributes':_0x24cc3a[_0x48f5('0x19')],'include':_0x24cc3a['include']?_[_0x48f5('0x1b')](_0x24cc3a[_0x48f5('0x1c')],function(_0x3a54f4){return{'model':db[_0x3a54f4['model']],'as':_0x3a54f4['as'],'attributes':_0x3a54f4[_0x48f5('0x19')],'include':_0x3a54f4[_0x48f5('0x1c')]?_[_0x48f5('0x1b')](_0x3a54f4[_0x48f5('0x1c')],function(_0x2252c6){return{'model':db[_0x2252c6[_0x48f5('0x1d')]],'as':_0x2252c6['as'],'attributes':_0x2252c6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b444a){logger[_0x48f5('0xc')](_0x48f5('0x14'),_0x5a8b7e);logger[_0x48f5('0xf')]('GetCmHopperBlack',_0x5a8b7e,JSON[_0x48f5('0x10')](_0x5b444a));_0x528c40(_0x5b444a);})[_0x48f5('0x1e')](function(_0xda091a){logger[_0x48f5('0x11')]('GetCmHopperBlack',_0xda091a[_0x48f5('0x12')],_0x5a8b7e);_0x343d09(_0x335fb9[_0x48f5('0x11')](0x1f4,_0xda091a[_0x48f5('0x12')]));});});};exports[_0x48f5('0x1f')]=function(_0x5c8372){var _0x35142e=this;return new Promise(function(_0xf80695,_0x30fc31){return db[_0x48f5('0x15')][_0x48f5('0x20')](_0x5c8372[_0x48f5('0x21')],{'raw':_0x5c8372[_0x48f5('0x17')]?_0x5c8372['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c8372['options']?_0x5c8372[_0x48f5('0x17')][_0x48f5('0x18')]||null:null,'attributes':_0x5c8372[_0x48f5('0x17')]?_0x5c8372[_0x48f5('0x17')]['attributes']||null:null,'limit':_0x5c8372[_0x48f5('0x17')]?_0x5c8372[_0x48f5('0x17')]['limit']||null:null})[_0x48f5('0xb')](function(_0x590e04){logger[_0x48f5('0xc')](_0x48f5('0x1f'),_0x5c8372);logger[_0x48f5('0xf')](_0x48f5('0x1f'),_0x5c8372,JSON[_0x48f5('0x10')](_0x590e04));_0xf80695(_0x590e04);})[_0x48f5('0x1e')](function(_0x5566c2){logger[_0x48f5('0x11')](_0x48f5('0x1f'),_0x5566c2['message'],_0x5c8372);_0x30fc31(_0x35142e[_0x48f5('0x11')](0x1f4,_0x5566c2['message']));});});};exports[_0x48f5('0x22')]=function(_0x32a0b2){var _0x419fee=this;return new Promise(function(_0x297dcf,_0xe08d18){return db[_0x48f5('0x15')]['destroy']({'where':_0x32a0b2[_0x48f5('0x17')]?_0x32a0b2['options'][_0x48f5('0x18')]||null:null})[_0x48f5('0xb')](function(_0x166826){logger['info']('DestroyCmHopperBlack',_0x32a0b2);logger['debug'](_0x48f5('0x22'),_0x32a0b2,JSON[_0x48f5('0x10')](_0x166826));_0x297dcf(_0x166826);})[_0x48f5('0x1e')](function(_0x2285f8){logger[_0x48f5('0x11')](_0x48f5('0x22'),_0x2285f8['message'],_0x32a0b2);_0xe08d18(_0x419fee['error'](0x1f4,_0x2285f8['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 35a9aab..7c79bb6 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 _0x98a8=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperBlack.controller','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete','destroy'];(function(_0x376b45,_0x5964fb){var _0x2341b3=function(_0x5a7f01){while(--_0x5a7f01){_0x376b45['push'](_0x376b45['shift']());}};_0x2341b3(++_0x5964fb);}(_0x98a8,0x12c));var _0x898a=function(_0x20f339,_0x4246e8){_0x20f339=_0x20f339-0x0;var _0x103568=_0x98a8[_0x20f339];return _0x103568;};'use strict';var multer=require(_0x898a('0x0'));var util=require(_0x898a('0x1'));var path=require(_0x898a('0x2'));var timeout=require(_0x898a('0x3'));var express=require(_0x898a('0x4'));var router=express[_0x898a('0x5')]();var auth=require(_0x898a('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x898a('0x7'));var controller=require(_0x898a('0x8'));router[_0x898a('0x9')]('/',auth[_0x898a('0xa')](),controller[_0x898a('0xb')]);router['get'](_0x898a('0xc'),auth['isAuthenticated'](),controller[_0x898a('0xd')]);router['get'](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0xf')]);router[_0x898a('0x10')](_0x898a('0xe'),auth[_0x898a('0xa')](),controller[_0x898a('0x11')]);router[_0x898a('0x12')](_0x898a('0xe'),auth['isAuthenticated'](),controller[_0x898a('0x13')]);module['exports']=router; \ No newline at end of file +var _0x5fd1=['/:id','put','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./cmHopperBlack.controller','isAuthenticated','index','get','/describe'];(function(_0x3cbe18,_0x5af60b){var _0x2abe43=function(_0x185c1d){while(--_0x185c1d){_0x3cbe18['push'](_0x3cbe18['shift']());}};_0x2abe43(++_0x5af60b);}(_0x5fd1,0x155));var _0x15fd=function(_0x2f5497,_0x44a4aa){_0x2f5497=_0x2f5497-0x0;var _0x860a23=_0x5fd1[_0x2f5497];return _0x860a23;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['describe']);router[_0x15fd('0x9')](_0x15fd('0xb'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0xc')]('/:id',auth[_0x15fd('0x7')](),controller[_0x15fd('0xd')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x15fd('0xe')]);module[_0x15fd('0xf')]=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index d57545d..3e6641a 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 _0x9913=['getDataValue','setDataValue','followuptime','diff','seconds','dispositionat','BOOLEAN','sequelize','moment','exports','DATE','INTEGER','STRING'];(function(_0x1d227e,_0x491955){var _0x4f752a=function(_0x521229){while(--_0x521229){_0x1d227e['push'](_0x1d227e['shift']());}};_0x4f752a(++_0x491955);}(_0x9913,0x96));var _0x3991=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x9913[_0x33bc64];return _0x3fdd34;};'use strict';var Sequelize=require(_0x3991('0x0'));var moment=require(_0x3991('0x1'));module[_0x3991('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0x3991('0x3')]},'countbusyretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0x3991('0x5')]},'calleridnum':{'type':Sequelize[_0x3991('0x5')]},'calleridname':{'type':Sequelize[_0x3991('0x5')]},'starttime':{'type':Sequelize[_0x3991('0x3')]},'responsetime':{'type':Sequelize[_0x3991('0x3')]},'answertime':{'type':Sequelize[_0x3991('0x3')]},'droptime':{'type':Sequelize[_0x3991('0x3')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x3991('0x5')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0x3991('0x5')]},'membername':{'type':Sequelize[_0x3991('0x5')]},'reason':{'type':Sequelize[_0x3991('0x5')]},'disposition':{'type':Sequelize['STRING']},'dispositionat':{'type':Sequelize['DATE'],'set':function(_0x9d4200){var _0x2bfce7=this[_0x3991('0x6')]('endtime');if(_0x2bfce7&&_0x9d4200){this[_0x3991('0x7')](_0x3991('0x8'),moment(_0x9d4200)[_0x3991('0x9')](moment(_0x2bfce7),_0x3991('0xa')));}return this['setDataValue'](_0x3991('0xb'),_0x9d4200);}},'amd':{'type':Sequelize[_0x3991('0xc')],'defaultValue':![]},'fax':{'type':Sequelize[_0x3991('0xc')],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x3991('0x5')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x3991('0x3')]},'deleted':{'type':Sequelize[_0x3991('0x5')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x3991('0x3')]},'recallme':{'type':Sequelize[_0x3991('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x3991('0x3')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x3991('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7450=['setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports','INTEGER','STRING','DATE','endtime','followuptime','diff','seconds'];(function(_0xe65ac8,_0x2691be){var _0x202ba1=function(_0x4af6ff){while(--_0x4af6ff){_0xe65ac8['push'](_0xe65ac8['shift']());}};_0x202ba1(++_0x2691be);}(_0x7450,0xac));var _0x0745=function(_0x22bec5,_0x1d926f){_0x22bec5=_0x22bec5-0x0;var _0x3dd643=_0x7450[_0x22bec5];return _0x3dd643;};'use strict';var Sequelize=require(_0x0745('0x0'));var moment=require(_0x0745('0x1'));module[_0x0745('0x2')]={'state':{'type':Sequelize[_0x0745('0x3')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0745('0x4')]},'originatecalleridnum':{'type':Sequelize[_0x0745('0x4')]},'originatecalleridname':{'type':Sequelize[_0x0745('0x4')]},'calleridnum':{'type':Sequelize[_0x0745('0x4')]},'calleridname':{'type':Sequelize[_0x0745('0x4')]},'starttime':{'type':Sequelize[_0x0745('0x5')]},'responsetime':{'type':Sequelize[_0x0745('0x5')]},'answertime':{'type':Sequelize[_0x0745('0x5')]},'droptime':{'type':Sequelize[_0x0745('0x5')]},'endtime':{'type':Sequelize[_0x0745('0x5')]},'ringtime':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0x0745('0x4')]},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x0745('0x4')]},'reason':{'type':Sequelize[_0x0745('0x4')]},'disposition':{'type':Sequelize[_0x0745('0x4')]},'dispositionat':{'type':Sequelize[_0x0745('0x5')],'set':function(_0x4a7a4c){var _0x108a47=this['getDataValue'](_0x0745('0x6'));if(_0x108a47&&_0x4a7a4c){this['setDataValue'](_0x0745('0x7'),moment(_0x4a7a4c)[_0x0745('0x8')](moment(_0x108a47),_0x0745('0x9')));}return this[_0x0745('0xa')](_0x0745('0xb'),_0x4a7a4c);}},'amd':{'type':Sequelize[_0x0745('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0x0745('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize['DATE']},'callback':{'type':Sequelize[_0x0745('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0745('0x4')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0745('0x5')]},'deleted':{'type':Sequelize[_0x0745('0x4')],'defaultValue':null},'deletedat':{'type':Sequelize[_0x0745('0x5')]},'recallme':{'type':Sequelize[_0x0745('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0x0745('0x5')]},'countnosuchnumberretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0745('0x3')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 7e99492..0a3ebf3 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 _0x7556=['checkContactHopper','CmHopper','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','fields','include','find','describe','body','uniqueid','countContactsQueueCampaignHopperFinal','sequelize','COUNT','literal','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','countContactsIvrCampaignHopperFinal','findAll','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','cm_hopper','phone','scheduledAt','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ContactId','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','from','calleridnum','state\x20=\x204','group','Campaign','CampaignId','ANY_VALUE(CampaignId)','CampaignId\x20=\x20?','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)'];(function(_0x112e2a,_0x364486){var _0x4f8af9=function(_0xa11c0d){while(--_0xa11c0d){_0x112e2a['push'](_0x112e2a['shift']());}};_0x4f8af9(++_0x364486);}(_0x7556,0x188));var _0x6755=function(_0x146bc5,_0x3ee412){_0x146bc5=_0x146bc5-0x0;var _0x5b9952=_0x7556[_0x146bc5];return _0x5b9952;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6755('0x0'));var jsonpatch=require(_0x6755('0x1'));var rp=require(_0x6755('0x2'));var moment=require(_0x6755('0x3'));var BPromise=require(_0x6755('0x4'));var Mustache=require(_0x6755('0x5'));var util=require('util');var path=require(_0x6755('0x6'));var sox=require(_0x6755('0x7'));var csv=require(_0x6755('0x8'));var ejs=require(_0x6755('0x9'));var fs=require('fs');var _=require(_0x6755('0xa'));var squel=require(_0x6755('0xb'));var crypto=require(_0x6755('0xc'));var jsforce=require(_0x6755('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6755('0x8'));var querystring=require(_0x6755('0xe'));var Papa=require(_0x6755('0xf'));var Redis=require(_0x6755('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x6755('0x11'));var as=require(_0x6755('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6755('0x13'));var utils=require(_0x6755('0x14'));var config=require('../../config/environment');var db=require(_0x6755('0x15'))['db'];function respondWithStatusCode(_0x46e3a7,_0x1c937e){_0x1c937e=_0x1c937e||0xcc;return function(_0x916497){if(_0x916497){return _0x46e3a7[_0x6755('0x16')](_0x1c937e);}return _0x46e3a7['status'](_0x1c937e)[_0x6755('0x17')]();};}function respondWithResult(_0x57ed36,_0x13403f){_0x13403f=_0x13403f||0xc8;return function(_0x175003){if(_0x175003){return _0x57ed36[_0x6755('0x18')](_0x13403f)[_0x6755('0x19')](_0x175003);}};}function respondWithFilteredResult(_0x1bf849,_0x4f8ee2){return function(_0x55c4b6){if(_0x55c4b6){var _0x23884a=_0x55c4b6[_0x6755('0x1a')],_0x145581=_0x4f8ee2[_0x6755('0x1b')],_0x3f0159=_0x4f8ee2[_0x6755('0x1b')]+_0x4f8ee2['limit'],_0x333369;if(_0x3f0159>=_0x23884a){_0x3f0159=_0x23884a;_0x333369=0xc8;}else{_0x333369=0xce;}_0x1bf849[_0x6755('0x18')](_0x333369);return _0x1bf849[_0x6755('0x1c')](_0x6755('0x1d'),_0x145581+'-'+_0x3f0159+'/'+_0x23884a)[_0x6755('0x19')](_0x55c4b6);}return null;};}function patchUpdates(_0x1b94e0){return function(_0x2150b9){try{jsonpatch[_0x6755('0x1e')](_0x2150b9,_0x1b94e0,!![]);}catch(_0x54c0f0){return BPromise['reject'](_0x54c0f0);}return _0x2150b9[_0x6755('0x1f')]();};}function saveUpdates(_0x1b9521,_0x1f997e){return function(_0x4efb45){if(_0x4efb45){return _0x4efb45[_0x6755('0x20')](_0x1b9521)[_0x6755('0x21')](function(_0x51ce93){return _0x51ce93;});}return null;};}function removeEntity(_0x1616c6,_0x3e5ff9){return function(_0xc56a66){if(_0xc56a66){return _0xc56a66[_0x6755('0x22')]()[_0x6755('0x21')](function(){_0x1616c6[_0x6755('0x18')](0xcc)[_0x6755('0x17')]();});}};}function handleEntityNotFound(_0x44a07d,_0x179135){return function(_0x4aca57){if(!_0x4aca57){_0x44a07d[_0x6755('0x16')](0x194);}return _0x4aca57;};}function handleError(_0xb2c308,_0x2d5dc9){_0x2d5dc9=_0x2d5dc9||0x1f4;return function(_0x2181e8){logger[_0x6755('0x23')](_0x2181e8[_0x6755('0x24')]);if(_0x2181e8[_0x6755('0x25')]){delete _0x2181e8[_0x6755('0x25')];}_0xb2c308[_0x6755('0x18')](_0x2d5dc9)[_0x6755('0x26')](_0x2181e8);};}exports[_0x6755('0x27')]=function(_0x329707,_0x490b47){var _0x5a7768={},_0x18ece3={},_0xbd1c6b={'count':0x0,'rows':[]};var _0x38f973=_[_0x6755('0x28')](db[_0x6755('0x29')][_0x6755('0x2a')],function(_0x330192){return{'name':_0x330192[_0x6755('0x2b')],'type':_0x330192[_0x6755('0x2c')][_0x6755('0x2d')]};});_0x18ece3[_0x6755('0x2e')]=_[_0x6755('0x28')](_0x38f973,_0x6755('0x25'));_0x18ece3[_0x6755('0x2f')]=_[_0x6755('0x30')](_0x329707[_0x6755('0x2f')]);_0x18ece3[_0x6755('0x31')]=_[_0x6755('0x32')](_0x18ece3[_0x6755('0x2e')],_0x18ece3[_0x6755('0x2f')]);_0x5a7768['attributes']=_[_0x6755('0x32')](_0x18ece3[_0x6755('0x2e')],qs['fields'](_0x329707['query']['fields']));_0x5a7768[_0x6755('0x33')]=_0x5a7768[_0x6755('0x33')][_0x6755('0x34')]?_0x5a7768[_0x6755('0x33')]:_0x18ece3[_0x6755('0x2e')];if(!_0x329707[_0x6755('0x2f')][_0x6755('0x35')](_0x6755('0x36'))){_0x5a7768['limit']=qs[_0x6755('0x37')](_0x329707[_0x6755('0x2f')][_0x6755('0x37')]);_0x5a7768[_0x6755('0x1b')]=qs[_0x6755('0x1b')](_0x329707['query'][_0x6755('0x1b')]);}_0x5a7768[_0x6755('0x38')]=qs[_0x6755('0x39')](_0x329707[_0x6755('0x2f')][_0x6755('0x39')]);_0x5a7768[_0x6755('0x3a')]=qs[_0x6755('0x31')](_[_0x6755('0x3b')](_0x329707[_0x6755('0x2f')],_0x18ece3[_0x6755('0x31')]));if(_0x329707[_0x6755('0x2f')][_0x6755('0x3c')]){_0x5a7768[_0x6755('0x3a')]=_[_0x6755('0x3d')](_0x5a7768[_0x6755('0x3a')],{'$or':_[_0x6755('0x28')](_0x38f973,function(_0x22423){if(_0x22423['type']!==_0x6755('0x3e')){var _0x3f267f={};_0x3f267f[_0x22423[_0x6755('0x25')]]={'$like':'%'+_0x329707[_0x6755('0x2f')][_0x6755('0x3c')]+'%'};return _0x3f267f;}})});}_0x5a7768=_['merge']({},_0x5a7768,_0x329707[_0x6755('0x3f')]);var _0x426340={'where':_0x5a7768[_0x6755('0x3a')]};return db['CmHopperFinal'][_0x6755('0x1a')](_0x426340)[_0x6755('0x21')](function(_0x27a7ed){_0xbd1c6b[_0x6755('0x1a')]=_0x27a7ed;if(_0x329707['query'][_0x6755('0x40')]){_0x5a7768['include']=[{'all':!![]}];}return db[_0x6755('0x29')]['findAll'](_0x5a7768);})[_0x6755('0x21')](function(_0x5a27e2){_0xbd1c6b[_0x6755('0x41')]=_0x5a27e2;return _0xbd1c6b;})['then'](respondWithFilteredResult(_0x490b47,_0x5a7768))[_0x6755('0x42')](handleError(_0x490b47,null));};exports['show']=function(_0x371fca,_0x26b3e6){var _0x3c01ef={'raw':!![],'where':{'id':_0x371fca[_0x6755('0x43')]['id']}},_0x42f648={};_0x42f648[_0x6755('0x2e')]=_[_0x6755('0x30')](db[_0x6755('0x29')][_0x6755('0x2a')]);_0x42f648[_0x6755('0x2f')]=_[_0x6755('0x30')](_0x371fca[_0x6755('0x2f')]);_0x42f648[_0x6755('0x31')]=_[_0x6755('0x32')](_0x42f648[_0x6755('0x2e')],_0x42f648[_0x6755('0x2f')]);_0x3c01ef['attributes']=_[_0x6755('0x32')](_0x42f648[_0x6755('0x2e')],qs[_0x6755('0x44')](_0x371fca[_0x6755('0x2f')][_0x6755('0x44')]));_0x3c01ef['attributes']=_0x3c01ef['attributes'][_0x6755('0x34')]?_0x3c01ef[_0x6755('0x33')]:_0x42f648[_0x6755('0x2e')];if(_0x371fca[_0x6755('0x2f')][_0x6755('0x40')]){_0x3c01ef[_0x6755('0x45')]=[{'all':!![]}];}_0x3c01ef=_['merge']({},_0x3c01ef,_0x371fca[_0x6755('0x3f')]);return db[_0x6755('0x29')][_0x6755('0x46')](_0x3c01ef)['then'](handleEntityNotFound(_0x26b3e6,null))[_0x6755('0x21')](respondWithResult(_0x26b3e6,null))[_0x6755('0x42')](handleError(_0x26b3e6,null));};exports[_0x6755('0x47')]=function(_0x4f6cec,_0x2139d5){return db[_0x6755('0x29')][_0x6755('0x47')]()[_0x6755('0x21')](respondWithResult(_0x2139d5,null))[_0x6755('0x42')](handleError(_0x2139d5,null));};exports[_0x6755('0x20')]=function(_0x747aa7,_0x161d47){if(_0x747aa7[_0x6755('0x48')][_0x6755('0x49')]){delete _0x747aa7[_0x6755('0x48')][_0x6755('0x49')];}return db[_0x6755('0x29')][_0x6755('0x46')]({'where':{'uniqueid':_0x747aa7[_0x6755('0x43')]['id']}})['then'](handleEntityNotFound(_0x161d47,null))[_0x6755('0x21')](saveUpdates(_0x747aa7[_0x6755('0x48')],null))[_0x6755('0x21')](respondWithResult(_0x161d47,null))['catch'](handleError(_0x161d47,null));};exports[_0x6755('0x4a')]=function(_0x2bf64e,_0x465f15,_0xef216e){return db['CmHopperFinal']['findAll']({'raw':![],'where':{'VoiceQueueId':_0x2bf64e[_0x6755('0x43')]['id']},'attributes':[[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x6755('0x4e')],[db[_0x6755('0x4b')]['fn']('COUNT',db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')](_0x6755('0x4f')))),_0x6755('0x50')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db['sequelize']['fn']('IF',db[_0x6755('0x4b')]['literal'](_0x6755('0x51')))),_0x6755('0x52')],[db[_0x6755('0x4b')]['fn']('COUNT',db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')]['literal'](_0x6755('0x53')))),_0x6755('0x54')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')]['literal'](_0x6755('0x55')))),'dropContacts'],[db['sequelize']['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')]('`state`\x20=\x2011\x20,\x201,\x20null'))),'abandonedContacts'],[db['sequelize']['fn'](_0x6755('0x4c'),db['sequelize']['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')]('`state`\x20=\x2022,\x201,\x20null'))),'reCallContacts'],[db[_0x6755('0x4b')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')]('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x465f15,null))[_0x6755('0x21')](respondWithResult(_0x465f15,null))[_0x6755('0x42')](handleError(_0x465f15,null));};exports[_0x6755('0x56')]=function(_0x25a16e,_0x10c31c,_0x4d467d){return db[_0x6755('0x29')][_0x6755('0x57')]({'raw':![],'where':{'CampaignId':_0x25a16e[_0x6755('0x43')]['id']},'attributes':[[db[_0x6755('0x4b')]['fn']('COUNT',db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')]('`state`\x20=\x200,\x201,\x20null'))),_0x6755('0x4e')],[db['sequelize']['fn'](_0x6755('0x4c'),db['sequelize']['fn']('IF',db['sequelize'][_0x6755('0x4d')](_0x6755('0x4f')))),_0x6755('0x50')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db['sequelize']['fn']('IF',db[_0x6755('0x4b')][_0x6755('0x4d')](_0x6755('0x51')))),_0x6755('0x52')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')]['literal']('`state`\x20=\x208,\x201,\x20null'))),_0x6755('0x54')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db['sequelize'][_0x6755('0x4d')](_0x6755('0x55')))),_0x6755('0x58')],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db[_0x6755('0x4b')]['literal'](_0x6755('0x59')))),'abandonedContacts'],[db[_0x6755('0x4b')]['fn'](_0x6755('0x4c'),db[_0x6755('0x4b')]['fn']('IF',db['sequelize'][_0x6755('0x4d')](_0x6755('0x5a')))),_0x6755('0x5b')],[db[_0x6755('0x4b')]['fn']('COUNT',db[_0x6755('0x4b')]['fn']('IF',db['sequelize'][_0x6755('0x4d')](_0x6755('0x5c')))),_0x6755('0x5d')]]})['then'](handleEntityNotFound(_0x10c31c,null))['then'](respondWithResult(_0x10c31c,null))[_0x6755('0x42')](handleError(_0x10c31c,null));};exports[_0x6755('0x5e')]=function(_0x59db4b,_0x213ac0,_0x3d8d35){return db[_0x6755('0x5f')][_0x6755('0x46')]({'where':{'id':_0x59db4b[_0x6755('0x43')]['id']}})[_0x6755('0x21')](handleEntityNotFound(_0x213ac0,null))[_0x6755('0x21')](function(_0x15db78){var _0x34ae0a;if(_0x15db78){_0x34ae0a=squel[_0x6755('0x60')]()[_0x6755('0x61')](_0x6755('0x62'))['fromQuery']([_0x6755('0x63'),_0x6755('0x64'),'ContactId',_0x6755('0x65'),_0x6755('0x66'),_0x6755('0x67'),_0x6755('0x68')],squel[_0x6755('0x69')]()[_0x6755('0x6a')](_0x6755('0x6b'),_0x6755('0x63'))[_0x6755('0x6a')](_0x6755('0x6c'),_0x6755('0x64'))['field'](_0x6755('0x6d'),_0x6755('0x6e'))[_0x6755('0x6a')](_0x6755('0x6f'),_0x6755('0x65'))[_0x6755('0x6a')](_0x6755('0x70'),_0x6755('0x66'))[_0x6755('0x6a')](_0x6755('0x6c'),'createdAt')[_0x6755('0x6a')](_0x6755('0x6c'),_0x6755('0x68'))['from'](_0x6755('0x71'))[_0x6755('0x3a')](_0x6755('0x72'),_0x59db4b[_0x6755('0x43')]['id'][_0x6755('0x73')]())['where']('state\x20=\x20?',_0x59db4b[_0x6755('0x48')]['state'][_0x6755('0x73')]())[_0x6755('0x3a')]('calleridnum\x20IS\x20NOT\x20NULL')[_0x6755('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6755('0x69')]()[_0x6755('0x6a')]('phone')[_0x6755('0x74')]('cm_hopper')[_0x6755('0x3a')](_0x6755('0x72'),_0x59db4b[_0x6755('0x43')]['id']['toString']()))[_0x6755('0x3a')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6755('0x69')]()[_0x6755('0x6a')](_0x6755('0x75'))[_0x6755('0x74')](_0x6755('0x71'))[_0x6755('0x3a')]('VoiceQueueId\x20=\x20?',_0x59db4b[_0x6755('0x43')]['id']['toString']())[_0x6755('0x3a')](_0x6755('0x76')))[_0x6755('0x77')]('ContactId'))[_0x6755('0x73')]();return db[_0x6755('0x4b')][_0x6755('0x2f')](_0x34ae0a);}return[];})['then'](respondWithResult(_0x213ac0,null))['catch'](handleError(_0x213ac0,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x42ec10,_0x378f9b,_0x751542){return db[_0x6755('0x78')][_0x6755('0x46')]({'where':{'id':_0x42ec10[_0x6755('0x43')]['id']}})[_0x6755('0x21')](handleEntityNotFound(_0x378f9b,null))[_0x6755('0x21')](function(_0x6a68f6){var _0x19c31c;if(_0x6a68f6){_0x19c31c=squel[_0x6755('0x60')]()[_0x6755('0x61')](_0x6755('0x62'))['fromQuery']([_0x6755('0x63'),_0x6755('0x64'),_0x6755('0x6e'),'ListId',_0x6755('0x79'),_0x6755('0x67'),_0x6755('0x68')],squel[_0x6755('0x69')]()['field'](_0x6755('0x6b'),_0x6755('0x63'))[_0x6755('0x6a')](_0x6755('0x6c'),'scheduledAt')[_0x6755('0x6a')]('ANY_VALUE(ContactId)',_0x6755('0x6e'))['field'](_0x6755('0x6f'),'ListId')[_0x6755('0x6a')](_0x6755('0x7a'),_0x6755('0x79'))[_0x6755('0x6a')]('NOW()','createdAt')['field'](_0x6755('0x6c'),'updatedAt')[_0x6755('0x74')](_0x6755('0x71'))[_0x6755('0x3a')](_0x6755('0x7b'),_0x42ec10['params']['id'][_0x6755('0x73')]())[_0x6755('0x3a')](_0x6755('0x7c'),_0x42ec10[_0x6755('0x48')][_0x6755('0x7d')]['toString']())['where'](_0x6755('0x7e'))['where']('calleridnum\x20NOT\x20IN\x20(?)',squel[_0x6755('0x69')]()[_0x6755('0x6a')]('phone')['from'](_0x6755('0x62'))[_0x6755('0x3a')]('CampaignId\x20=\x20?',_0x42ec10[_0x6755('0x43')]['id']['toString']()))[_0x6755('0x3a')](_0x6755('0x7f'),squel[_0x6755('0x69')]()['field']('calleridnum')[_0x6755('0x74')](_0x6755('0x71'))['where'](_0x6755('0x7b'),_0x42ec10[_0x6755('0x43')]['id'][_0x6755('0x73')]())[_0x6755('0x3a')](_0x6755('0x76')))[_0x6755('0x77')](_0x6755('0x6e')))['toString']();return db[_0x6755('0x4b')][_0x6755('0x2f')](_0x19c31c);}return[];})[_0x6755('0x21')](respondWithResult(_0x378f9b,null))[_0x6755('0x42')](handleError(_0x378f9b,null));};exports[_0x6755('0x80')]=function(_0x50a81f,_0x174fb5,_0x3f4053){return db[_0x6755('0x81')]['findOne']({'where':{'VoiceQueueId':_0x50a81f[_0x6755('0x48')][_0x6755('0x66')],'CampaignId':_0x50a81f[_0x6755('0x48')][_0x6755('0x79')],'ContactId':_0x50a81f['body'][_0x6755('0x6e')]}})[_0x6755('0x21')](handleEntityNotFound(_0x174fb5,null))['then'](function(_0x3abe35){if(_0x3abe35){return _0x3abe35;}return null;})[_0x6755('0x21')](respondWithResult(_0x174fb5,null))[_0x6755('0x42')](handleError(_0x174fb5,null));}; \ No newline at end of file +var _0x3968=['countContactsIvrCampaignHopperFinal','busyContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','answeringMachine','moveContactsQueueCampaignHopperFinal','VoiceQueue','insert','into','fromQuery','phone','ContactId','ListId','VoiceQueueId','createdAt','select','field','ANY_VALUE(calleridnum)','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','NOW()','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','Campaign','cm_hopper','scheduledAt','updatedAt','ANY_VALUE(CampaignId)','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','sendStatus','status','count','offset','Content-Range','json','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','CmHopperFinal','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','VIRTUAL','options','include','rows','show','params','includeAll','describe','catch','uniqueid','body','find','findAll','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','reCallContacts','`state`\x20=\x2019,\x201,\x20null'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x3968,0xaf));var _0x8396=function(_0x1266f9,_0x40f076){_0x1266f9=_0x1266f9-0x0;var _0x56ced3=_0x3968[_0x1266f9];return _0x56ced3;};'use strict';var pdf=require(_0x8396('0x0'));var emlformat=require(_0x8396('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x8396('0x2'));var jsonpatch=require(_0x8396('0x3'));var rp=require(_0x8396('0x4'));var moment=require('moment');var BPromise=require(_0x8396('0x5'));var Mustache=require(_0x8396('0x6'));var util=require('util');var path=require(_0x8396('0x7'));var sox=require(_0x8396('0x8'));var csv=require(_0x8396('0x9'));var ejs=require(_0x8396('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8396('0xb'));var jsforce=require(_0x8396('0xc'));var deskjs=require(_0x8396('0xd'));var toCsv=require(_0x8396('0x9'));var querystring=require('querystring');var Papa=require(_0x8396('0xe'));var Redis=require(_0x8396('0xf'));var authService=require(_0x8396('0x10'));var qs=require(_0x8396('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x8396('0x12'));var db=require(_0x8396('0x13'))['db'];function respondWithStatusCode(_0x564e1b,_0x2dfd5e){_0x2dfd5e=_0x2dfd5e||0xcc;return function(_0x44b42c){if(_0x44b42c){return _0x564e1b[_0x8396('0x14')](_0x2dfd5e);}return _0x564e1b[_0x8396('0x15')](_0x2dfd5e)['end']();};}function respondWithResult(_0x537ba0,_0x2b1026){_0x2b1026=_0x2b1026||0xc8;return function(_0x5132cc){if(_0x5132cc){return _0x537ba0[_0x8396('0x15')](_0x2b1026)['json'](_0x5132cc);}};}function respondWithFilteredResult(_0x4e4c81,_0x10a5be){return function(_0x30acad){if(_0x30acad){var _0xc5f087=_0x30acad[_0x8396('0x16')],_0x69fb0a=_0x10a5be['offset'],_0x1b2822=_0x10a5be[_0x8396('0x17')]+_0x10a5be['limit'],_0x1ecf76;if(_0x1b2822>=_0xc5f087){_0x1b2822=_0xc5f087;_0x1ecf76=0xc8;}else{_0x1ecf76=0xce;}_0x4e4c81[_0x8396('0x15')](_0x1ecf76);return _0x4e4c81['set'](_0x8396('0x18'),_0x69fb0a+'-'+_0x1b2822+'/'+_0xc5f087)[_0x8396('0x19')](_0x30acad);}return null;};}function patchUpdates(_0x41cde8){return function(_0x3e18ec){try{jsonpatch[_0x8396('0x1a')](_0x3e18ec,_0x41cde8,!![]);}catch(_0x263edd){return BPromise[_0x8396('0x1b')](_0x263edd);}return _0x3e18ec[_0x8396('0x1c')]();};}function saveUpdates(_0x57fdc4,_0x38cb28){return function(_0xfb9465){if(_0xfb9465){return _0xfb9465[_0x8396('0x1d')](_0x57fdc4)[_0x8396('0x1e')](function(_0x118e5f){return _0x118e5f;});}return null;};}function removeEntity(_0x55b7de,_0x174e32){return function(_0x231247){if(_0x231247){return _0x231247[_0x8396('0x1f')]()[_0x8396('0x1e')](function(){_0x55b7de['status'](0xcc)[_0x8396('0x20')]();});}};}function handleEntityNotFound(_0x3591ca,_0x4f24c0){return function(_0x3eb51d){if(!_0x3eb51d){_0x3591ca[_0x8396('0x14')](0x194);}return _0x3eb51d;};}function handleError(_0x36f8d3,_0x5a8b0e){_0x5a8b0e=_0x5a8b0e||0x1f4;return function(_0x4f5523){logger[_0x8396('0x21')](_0x4f5523[_0x8396('0x22')]);if(_0x4f5523[_0x8396('0x23')]){delete _0x4f5523[_0x8396('0x23')];}_0x36f8d3[_0x8396('0x15')](_0x5a8b0e)[_0x8396('0x24')](_0x4f5523);};}exports[_0x8396('0x25')]=function(_0x2a01e3,_0x15c2f4){var _0x3aaf25={},_0x59ead6={},_0x25e5e4={'count':0x0,'rows':[]};var _0x25d46=_[_0x8396('0x26')](db[_0x8396('0x27')][_0x8396('0x28')],function(_0x274f44){return{'name':_0x274f44[_0x8396('0x29')],'type':_0x274f44[_0x8396('0x2a')][_0x8396('0x2b')]};});_0x59ead6[_0x8396('0x2c')]=_['map'](_0x25d46,_0x8396('0x23'));_0x59ead6[_0x8396('0x2d')]=_[_0x8396('0x2e')](_0x2a01e3[_0x8396('0x2d')]);_0x59ead6[_0x8396('0x2f')]=_[_0x8396('0x30')](_0x59ead6[_0x8396('0x2c')],_0x59ead6[_0x8396('0x2d')]);_0x3aaf25[_0x8396('0x31')]=_[_0x8396('0x30')](_0x59ead6[_0x8396('0x2c')],qs[_0x8396('0x32')](_0x2a01e3[_0x8396('0x2d')]['fields']));_0x3aaf25[_0x8396('0x31')]=_0x3aaf25[_0x8396('0x31')][_0x8396('0x33')]?_0x3aaf25['attributes']:_0x59ead6[_0x8396('0x2c')];if(!_0x2a01e3[_0x8396('0x2d')][_0x8396('0x34')]('nolimit')){_0x3aaf25['limit']=qs[_0x8396('0x35')](_0x2a01e3['query'][_0x8396('0x35')]);_0x3aaf25[_0x8396('0x17')]=qs['offset'](_0x2a01e3[_0x8396('0x2d')][_0x8396('0x17')]);}_0x3aaf25[_0x8396('0x36')]=qs['sort'](_0x2a01e3['query'][_0x8396('0x37')]);_0x3aaf25[_0x8396('0x38')]=qs[_0x8396('0x2f')](_['pick'](_0x2a01e3[_0x8396('0x2d')],_0x59ead6['filters']));if(_0x2a01e3['query'][_0x8396('0x39')]){_0x3aaf25[_0x8396('0x38')]=_[_0x8396('0x3a')](_0x3aaf25[_0x8396('0x38')],{'$or':_['map'](_0x25d46,function(_0x788fdf){if(_0x788fdf[_0x8396('0x2a')]!==_0x8396('0x3b')){var _0x2d78ca={};_0x2d78ca[_0x788fdf[_0x8396('0x23')]]={'$like':'%'+_0x2a01e3[_0x8396('0x2d')][_0x8396('0x39')]+'%'};return _0x2d78ca;}})});}_0x3aaf25=_[_0x8396('0x3a')]({},_0x3aaf25,_0x2a01e3[_0x8396('0x3c')]);var _0x4a63d7={'where':_0x3aaf25['where']};return db[_0x8396('0x27')]['count'](_0x4a63d7)[_0x8396('0x1e')](function(_0x22ba02){_0x25e5e4[_0x8396('0x16')]=_0x22ba02;if(_0x2a01e3[_0x8396('0x2d')]['includeAll']){_0x3aaf25[_0x8396('0x3d')]=[{'all':!![]}];}return db['CmHopperFinal']['findAll'](_0x3aaf25);})[_0x8396('0x1e')](function(_0xe56a88){_0x25e5e4[_0x8396('0x3e')]=_0xe56a88;return _0x25e5e4;})[_0x8396('0x1e')](respondWithFilteredResult(_0x15c2f4,_0x3aaf25))['catch'](handleError(_0x15c2f4,null));};exports[_0x8396('0x3f')]=function(_0x3372a4,_0x39f764){var _0x4925fb={'raw':!![],'where':{'id':_0x3372a4[_0x8396('0x40')]['id']}},_0x3e941e={};_0x3e941e[_0x8396('0x2c')]=_[_0x8396('0x2e')](db[_0x8396('0x27')][_0x8396('0x28')]);_0x3e941e[_0x8396('0x2d')]=_[_0x8396('0x2e')](_0x3372a4['query']);_0x3e941e[_0x8396('0x2f')]=_[_0x8396('0x30')](_0x3e941e[_0x8396('0x2c')],_0x3e941e['query']);_0x4925fb[_0x8396('0x31')]=_[_0x8396('0x30')](_0x3e941e['model'],qs[_0x8396('0x32')](_0x3372a4['query'][_0x8396('0x32')]));_0x4925fb['attributes']=_0x4925fb['attributes'][_0x8396('0x33')]?_0x4925fb[_0x8396('0x31')]:_0x3e941e['model'];if(_0x3372a4[_0x8396('0x2d')][_0x8396('0x41')]){_0x4925fb[_0x8396('0x3d')]=[{'all':!![]}];}_0x4925fb=_[_0x8396('0x3a')]({},_0x4925fb,_0x3372a4[_0x8396('0x3c')]);return db['CmHopperFinal']['find'](_0x4925fb)[_0x8396('0x1e')](handleEntityNotFound(_0x39f764,null))[_0x8396('0x1e')](respondWithResult(_0x39f764,null))['catch'](handleError(_0x39f764,null));};exports[_0x8396('0x42')]=function(_0x235015,_0x30a9f8){return db[_0x8396('0x27')]['describe']()['then'](respondWithResult(_0x30a9f8,null))[_0x8396('0x43')](handleError(_0x30a9f8,null));};exports['update']=function(_0x191586,_0x50610d){if(_0x191586['body'][_0x8396('0x44')]){delete _0x191586[_0x8396('0x45')]['uniqueid'];}return db[_0x8396('0x27')][_0x8396('0x46')]({'where':{'uniqueid':_0x191586[_0x8396('0x40')]['id']}})[_0x8396('0x1e')](handleEntityNotFound(_0x50610d,null))['then'](saveUpdates(_0x191586['body'],null))['then'](respondWithResult(_0x50610d,null))[_0x8396('0x43')](handleError(_0x50610d,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x597b06,_0x133e43,_0x1e9f69){return db['CmHopperFinal'][_0x8396('0x47')]({'raw':![],'where':{'VoiceQueueId':_0x597b06[_0x8396('0x40')]['id']},'attributes':[[db[_0x8396('0x48')]['fn'](_0x8396('0x49'),db['sequelize']['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x4b')))),_0x8396('0x4c')],[db['sequelize']['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x4d')))),_0x8396('0x4e')],[db['sequelize']['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x4f')))),'busyContacts'],[db['sequelize']['fn'](_0x8396('0x49'),db['sequelize']['fn']('IF',db[_0x8396('0x48')]['literal'](_0x8396('0x50')))),_0x8396('0x51')],[db['sequelize']['fn']('COUNT',db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0x8396('0x48')]['fn']('COUNT',db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x52')))),_0x8396('0x53')],[db[_0x8396('0x48')]['fn'](_0x8396('0x49'),db['sequelize']['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x54')))),_0x8396('0x55')],[db['sequelize']['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x56')))),'answeringMachine']]})[_0x8396('0x1e')](handleEntityNotFound(_0x133e43,null))[_0x8396('0x1e')](respondWithResult(_0x133e43,null))[_0x8396('0x43')](handleError(_0x133e43,null));};exports[_0x8396('0x57')]=function(_0x16fe10,_0x433f34,_0xc5be7c){return db[_0x8396('0x27')][_0x8396('0x47')]({'raw':![],'where':{'CampaignId':_0x16fe10['params']['id']},'attributes':[[db[_0x8396('0x48')]['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')]['literal'](_0x8396('0x4b')))),_0x8396('0x4c')],[db['sequelize']['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x4d')))),'noAnswerContacts'],[db[_0x8396('0x48')]['fn'](_0x8396('0x49'),db['sequelize']['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')]('`state`\x20=\x205,\x201,\x20null'))),_0x8396('0x58')],[db['sequelize']['fn']('COUNT',db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x50')))),'congestionContacts'],[db['sequelize']['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db['sequelize'][_0x8396('0x4a')](_0x8396('0x59')))),_0x8396('0x5a')],[db[_0x8396('0x48')]['fn'](_0x8396('0x49'),db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x52')))),'abandonedContacts'],[db['sequelize']['fn']('COUNT',db[_0x8396('0x48')]['fn']('IF',db[_0x8396('0x48')][_0x8396('0x4a')](_0x8396('0x54')))),_0x8396('0x55')],[db[_0x8396('0x48')]['fn']('COUNT',db['sequelize']['fn']('IF',db['sequelize'][_0x8396('0x4a')](_0x8396('0x56')))),_0x8396('0x5b')]]})['then'](handleEntityNotFound(_0x433f34,null))['then'](respondWithResult(_0x433f34,null))[_0x8396('0x43')](handleError(_0x433f34,null));};exports[_0x8396('0x5c')]=function(_0x18f826,_0x52b449,_0x3ac0b1){return db[_0x8396('0x5d')][_0x8396('0x46')]({'where':{'id':_0x18f826['params']['id']}})[_0x8396('0x1e')](handleEntityNotFound(_0x52b449,null))[_0x8396('0x1e')](function(_0x1749d7){var _0x29f7aa;if(_0x1749d7){_0x29f7aa=squel[_0x8396('0x5e')]()[_0x8396('0x5f')]('cm_hopper')[_0x8396('0x60')]([_0x8396('0x61'),'scheduledAt',_0x8396('0x62'),_0x8396('0x63'),_0x8396('0x64'),_0x8396('0x65'),'updatedAt'],squel[_0x8396('0x66')]()[_0x8396('0x67')](_0x8396('0x68'),_0x8396('0x61'))[_0x8396('0x67')]('NOW()','scheduledAt')[_0x8396('0x67')](_0x8396('0x69'),_0x8396('0x62'))['field'](_0x8396('0x6a'),_0x8396('0x63'))['field'](_0x8396('0x6b'),_0x8396('0x64'))[_0x8396('0x67')](_0x8396('0x6c'),'createdAt')[_0x8396('0x67')](_0x8396('0x6c'),'updatedAt')[_0x8396('0x6d')](_0x8396('0x6e'))[_0x8396('0x38')](_0x8396('0x6f'),_0x18f826[_0x8396('0x40')]['id'][_0x8396('0x70')]())['where'](_0x8396('0x71'),_0x18f826[_0x8396('0x45')][_0x8396('0x72')][_0x8396('0x70')]())[_0x8396('0x38')](_0x8396('0x73'))[_0x8396('0x38')](_0x8396('0x74'),squel[_0x8396('0x66')]()[_0x8396('0x67')](_0x8396('0x61'))[_0x8396('0x6d')]('cm_hopper')[_0x8396('0x38')](_0x8396('0x6f'),_0x18f826[_0x8396('0x40')]['id'][_0x8396('0x70')]()))[_0x8396('0x38')](_0x8396('0x74'),squel['select']()[_0x8396('0x67')](_0x8396('0x75'))[_0x8396('0x6d')](_0x8396('0x6e'))['where'](_0x8396('0x6f'),_0x18f826[_0x8396('0x40')]['id'][_0x8396('0x70')]())[_0x8396('0x38')](_0x8396('0x76')))[_0x8396('0x77')]('ContactId'))[_0x8396('0x70')]();return db[_0x8396('0x48')][_0x8396('0x2d')](_0x29f7aa);}return[];})[_0x8396('0x1e')](respondWithResult(_0x52b449,null))[_0x8396('0x43')](handleError(_0x52b449,null));};exports[_0x8396('0x78')]=function(_0x488a17,_0x4b9fb5,_0x39c883){return db[_0x8396('0x79')]['find']({'where':{'id':_0x488a17[_0x8396('0x40')]['id']}})[_0x8396('0x1e')](handleEntityNotFound(_0x4b9fb5,null))[_0x8396('0x1e')](function(_0x43c94c){var _0x1cd15f;if(_0x43c94c){_0x1cd15f=squel[_0x8396('0x5e')]()[_0x8396('0x5f')](_0x8396('0x7a'))[_0x8396('0x60')]([_0x8396('0x61'),_0x8396('0x7b'),'ContactId',_0x8396('0x63'),'CampaignId',_0x8396('0x65'),_0x8396('0x7c')],squel[_0x8396('0x66')]()['field'](_0x8396('0x68'),_0x8396('0x61'))[_0x8396('0x67')](_0x8396('0x6c'),_0x8396('0x7b'))[_0x8396('0x67')](_0x8396('0x69'),_0x8396('0x62'))[_0x8396('0x67')](_0x8396('0x6a'),_0x8396('0x63'))[_0x8396('0x67')](_0x8396('0x7d'),_0x8396('0x7e'))['field'](_0x8396('0x6c'),_0x8396('0x65'))['field'](_0x8396('0x6c'),_0x8396('0x7c'))['from'](_0x8396('0x6e'))[_0x8396('0x38')](_0x8396('0x7f'),_0x488a17[_0x8396('0x40')]['id']['toString']())[_0x8396('0x38')]('state\x20=\x20?',_0x488a17[_0x8396('0x45')][_0x8396('0x72')][_0x8396('0x70')]())['where'](_0x8396('0x73'))[_0x8396('0x38')](_0x8396('0x74'),squel[_0x8396('0x66')]()['field'](_0x8396('0x61'))['from'](_0x8396('0x7a'))['where']('CampaignId\x20=\x20?',_0x488a17['params']['id'][_0x8396('0x70')]()))[_0x8396('0x38')](_0x8396('0x74'),squel[_0x8396('0x66')]()[_0x8396('0x67')](_0x8396('0x75'))[_0x8396('0x6d')](_0x8396('0x6e'))[_0x8396('0x38')](_0x8396('0x7f'),_0x488a17[_0x8396('0x40')]['id'][_0x8396('0x70')]())[_0x8396('0x38')](_0x8396('0x76')))[_0x8396('0x77')]('ContactId'))['toString']();return db[_0x8396('0x48')]['query'](_0x1cd15f);}return[];})[_0x8396('0x1e')](respondWithResult(_0x4b9fb5,null))[_0x8396('0x43')](handleError(_0x4b9fb5,null));};exports[_0x8396('0x80')]=function(_0x29b78f,_0x5cfa0a,_0x251075){return db[_0x8396('0x81')][_0x8396('0x82')]({'where':{'VoiceQueueId':_0x29b78f[_0x8396('0x45')]['VoiceQueueId'],'CampaignId':_0x29b78f['body']['CampaignId'],'ContactId':_0x29b78f[_0x8396('0x45')][_0x8396('0x62')]}})['then'](handleEntityNotFound(_0x5cfa0a,null))[_0x8396('0x1e')](function(_0x194dc8){if(_0x194dc8){return _0x194dc8;}return null;})['then'](respondWithResult(_0x5cfa0a,null))[_0x8396('0x43')](handleError(_0x5cfa0a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index fdc27b0..74a3296 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 _0x18e7=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperFinal.attributes','exports','calleridnum','uniqueid'];(function(_0x4c2300,_0x868092){var _0x543133=function(_0x37a762){while(--_0x37a762){_0x4c2300['push'](_0x4c2300['shift']());}};_0x543133(++_0x868092);}(_0x18e7,0xc4));var _0x718e=function(_0x33e755,_0x1ba175){_0x33e755=_0x33e755-0x0;var _0x599a88=_0x18e7[_0x33e755];return _0x599a88;};'use strict';var _=require(_0x718e('0x0'));var util=require(_0x718e('0x1'));var logger=require(_0x718e('0x2'))(_0x718e('0x3'));var moment=require(_0x718e('0x4'));var BPromise=require(_0x718e('0x5'));var rp=require(_0x718e('0x6'));var fs=require('fs');var path=require(_0x718e('0x7'));var rimraf=require(_0x718e('0x8'));var config=require(_0x718e('0x9'));var attributes=require(_0x718e('0xa'));module[_0x718e('0xb')]=function(_0x4db260,_0x1f4148){return _0x4db260['define']('CmHopperFinal',attributes,{'tableName':'cm_hopper_final','paranoid':![],'indexes':[{'name':_0x718e('0xc'),'fields':[_0x718e('0xc')]},{'name':_0x718e('0xd'),'fields':[_0x718e('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x606f=['lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./cmHopperFinal.attributes','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x606f,0x17a));var _0xf606=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x606f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xf606('0x0'));var util=require(_0xf606('0x1'));var logger=require(_0xf606('0x2'))(_0xf606('0x3'));var moment=require(_0xf606('0x4'));var BPromise=require('bluebird');var rp=require(_0xf606('0x5'));var fs=require('fs');var path=require(_0xf606('0x6'));var rimraf=require('rimraf');var config=require(_0xf606('0x7'));var attributes=require(_0xf606('0x8'));module['exports']=function(_0x451e19,_0x2548a7){return _0x451e19[_0xf606('0x9')](_0xf606('0xa'),attributes,{'tableName':_0xf606('0xb'),'paranoid':![],'indexes':[{'name':_0xf606('0xc'),'fields':['calleridnum']},{'name':'uniqueid','fields':[_0xf606('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index be88a03..cca04e3 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 _0xa872=['code','message','create','body','options','raw','then','CreateCmHopperFinal','stringify','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','error'];(function(_0x276522,_0x5cb95a){var _0x263a32=function(_0x2380ff){while(--_0x2380ff){_0x276522['push'](_0x276522['shift']());}};_0x263a32(++_0x5cb95a);}(_0xa872,0x71));var _0x2a87=function(_0x2fffff,_0x415518){_0x2fffff=_0x2fffff-0x0;var _0x4f2a2c=_0xa872[_0x2fffff];return _0x4f2a2c;};'use strict';var _=require('lodash');var util=require(_0x2a87('0x0'));var moment=require(_0x2a87('0x1'));var BPromise=require(_0x2a87('0x2'));var rs=require(_0x2a87('0x3'));var fs=require('fs');var Redis=require(_0x2a87('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x2a87('0x5'));var logger=require('../../config/logger')(_0x2a87('0x6'));var config=require(_0x2a87('0x7'));var jayson=require(_0x2a87('0x8'));var client=jayson['client'][_0x2a87('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d2431,_0x45bca2,_0x4888ed){return new BPromise(function(_0x4df9dd,_0x839fe7){return client[_0x2a87('0xa')](_0x3d2431,_0x4888ed)['then'](function(_0x2a1e21){logger[_0x2a87('0xb')](_0x2a87('0xc'),_0x45bca2,_0x2a87('0xd'));logger[_0x2a87('0xe')](_0x2a87('0xf'),_0x45bca2,_0x2a87('0xd'),JSON['stringify'](_0x2a1e21));if(_0x2a1e21[_0x2a87('0x10')]){if(_0x2a1e21['error'][_0x2a87('0x11')]===0x1f4){logger[_0x2a87('0x10')](_0x2a87('0xc'),_0x45bca2,_0x2a1e21[_0x2a87('0x10')][_0x2a87('0x12')]);return _0x839fe7(_0x2a1e21[_0x2a87('0x10')][_0x2a87('0x12')]);}logger[_0x2a87('0x10')](_0x2a87('0xc'),_0x45bca2,_0x2a1e21[_0x2a87('0x10')][_0x2a87('0x12')]);return _0x4df9dd(_0x2a1e21[_0x2a87('0x10')][_0x2a87('0x12')]);}else{logger[_0x2a87('0xb')](_0x2a87('0xc'),_0x45bca2,_0x2a87('0xd'));_0x4df9dd(_0x2a1e21['result'][_0x2a87('0x12')]);}})['catch'](function(_0x1b7e99){logger[_0x2a87('0x10')](_0x2a87('0xc'),_0x45bca2,_0x1b7e99);_0x839fe7(_0x1b7e99);});});}exports['CreateCmHopperFinal']=function(_0x2ec89f){var _0x435f2f=this;return new Promise(function(_0x48f5f5,_0x351eab){return db['CmHopperFinal'][_0x2a87('0x13')](_0x2ec89f[_0x2a87('0x14')],{'raw':_0x2ec89f[_0x2a87('0x15')]?_0x2ec89f['options'][_0x2a87('0x16')]===undefined?!![]:![]:!![]})[_0x2a87('0x17')](function(_0x383c6b){logger[_0x2a87('0xb')]('CreateCmHopperFinal',_0x2ec89f);logger['debug'](_0x2a87('0x18'),_0x2ec89f,JSON[_0x2a87('0x19')](_0x383c6b));_0x48f5f5(_0x383c6b);})['catch'](function(_0x39a27c){logger['error'](_0x2a87('0x18'),_0x39a27c[_0x2a87('0x12')],_0x2ec89f);_0x351eab(_0x435f2f[_0x2a87('0x10')](0x1f4,_0x39a27c[_0x2a87('0x12')]));});});}; \ No newline at end of file +var _0x767d=['CmHopperFinal,\x20%s,\x20%s','message','result','CreateCmHopperFinal','body','options','raw','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x4d60c0,_0x244fcd){var _0x110139=function(_0x5bd61b){while(--_0x5bd61b){_0x4d60c0['push'](_0x4d60c0['shift']());}};_0x110139(++_0x244fcd);}(_0x767d,0x11b));var _0xd767=function(_0x354cec,_0x1af255){_0x354cec=_0x354cec-0x0;var _0x5eca54=_0x767d[_0x354cec];return _0x5eca54;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd767('0x0'));var fs=require('fs');var Redis=require(_0xd767('0x1'));var db=require(_0xd767('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd767('0x3'))(_0xd767('0x4'));var config=require(_0xd767('0x5'));var jayson=require(_0xd767('0x6'));var client=jayson[_0xd767('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58866e,_0x590d31,_0x2cb39f){return new BPromise(function(_0x1b33ee,_0x38da70){return client[_0xd767('0x8')](_0x58866e,_0x2cb39f)['then'](function(_0x1697d7){logger[_0xd767('0x9')]('CmHopperFinal,\x20%s,\x20%s',_0x590d31,'request\x20sent');logger[_0xd767('0xa')](_0xd767('0xb'),_0x590d31,_0xd767('0xc'),JSON[_0xd767('0xd')](_0x1697d7));if(_0x1697d7[_0xd767('0xe')]){if(_0x1697d7[_0xd767('0xe')][_0xd767('0xf')]===0x1f4){logger['error'](_0xd767('0x10'),_0x590d31,_0x1697d7[_0xd767('0xe')][_0xd767('0x11')]);return _0x38da70(_0x1697d7[_0xd767('0xe')][_0xd767('0x11')]);}logger['error'](_0xd767('0x10'),_0x590d31,_0x1697d7[_0xd767('0xe')]['message']);return _0x1b33ee(_0x1697d7[_0xd767('0xe')][_0xd767('0x11')]);}else{logger[_0xd767('0x9')](_0xd767('0x10'),_0x590d31,_0xd767('0xc'));_0x1b33ee(_0x1697d7[_0xd767('0x12')][_0xd767('0x11')]);}})['catch'](function(_0x4ee7e3){logger[_0xd767('0xe')](_0xd767('0x10'),_0x590d31,_0x4ee7e3);_0x38da70(_0x4ee7e3);});});}exports[_0xd767('0x13')]=function(_0x57eab5){var _0x20c080=this;return new Promise(function(_0x476669,_0x1775e4){return db['CmHopperFinal']['create'](_0x57eab5[_0xd767('0x14')],{'raw':_0x57eab5[_0xd767('0x15')]?_0x57eab5[_0xd767('0x15')][_0xd767('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x38779d){logger[_0xd767('0x9')](_0xd767('0x13'),_0x57eab5);logger[_0xd767('0xa')](_0xd767('0x13'),_0x57eab5,JSON[_0xd767('0xd')](_0x38779d));_0x476669(_0x38779d);})['catch'](function(_0x5dbb7c){logger[_0xd767('0xe')](_0xd767('0x13'),_0x5dbb7c[_0xd767('0x11')],_0x57eab5);_0x1775e4(_0x20c080[_0xd767('0xe')](0x1f4,_0x5dbb7c[_0xd767('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 4c104eb..c45139f 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 _0x211b=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','post','/voice/queue/moveContacts/:id','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','/checkContactHopper','checkContactHopper','put','exports','util'];(function(_0x29e3b6,_0x40b0b4){var _0x55d4b0=function(_0x55c58e){while(--_0x55c58e){_0x29e3b6['push'](_0x29e3b6['shift']());}};_0x55d4b0(++_0x40b0b4);}(_0x211b,0xa7));var _0xb211=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x211b[_0x3e5086];return _0xfeb102;};'use strict';var multer=require('multer');var util=require(_0xb211('0x0'));var path=require(_0xb211('0x1'));var timeout=require(_0xb211('0x2'));var express=require(_0xb211('0x3'));var router=express['Router']();var auth=require(_0xb211('0x4'));var interaction=require(_0xb211('0x5'));var config=require(_0xb211('0x6'));var controller=require('./cmHopperFinal.controller');router[_0xb211('0x7')]('/',auth[_0xb211('0x8')](),controller['index']);router[_0xb211('0x7')]('/describe',auth['isAuthenticated'](),controller[_0xb211('0x9')]);router['get'](_0xb211('0xa'),auth[_0xb211('0x8')](),controller[_0xb211('0xb')]);router[_0xb211('0x7')](_0xb211('0xc'),auth[_0xb211('0x8')](),controller[_0xb211('0xd')]);router[_0xb211('0x7')](_0xb211('0xe'),auth[_0xb211('0x8')](),controller[_0xb211('0xf')]);router[_0xb211('0x10')](_0xb211('0x11'),auth[_0xb211('0x8')](),controller['moveContactsQueueCampaignHopperFinal']);router[_0xb211('0x10')](_0xb211('0x12'),auth[_0xb211('0x8')](),controller[_0xb211('0x13')]);router['post'](_0xb211('0x14'),auth['isAuthenticated'](),controller[_0xb211('0x15')]);router[_0xb211('0x16')](_0xb211('0xa'),auth[_0xb211('0x8')](),controller['update']);module[_0xb211('0x17')]=router; \ No newline at end of file +var _0xff38=['../../config/environment','./cmHopperFinal.controller','get','isAuthenticated','index','/:id','show','/voice/queue/countAttributes/:id','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','post','checkContactHopper','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3f5148,_0x33dea7){var _0x9ddea7=function(_0xa969e5){while(--_0xa969e5){_0x3f5148['push'](_0x3f5148['shift']());}};_0x9ddea7(++_0x33dea7);}(_0xff38,0xf3));var _0x8ff3=function(_0x11fc38,_0x16fd3f){_0x11fc38=_0x11fc38-0x0;var _0x3b98b3=_0xff38[_0x11fc38];return _0x3b98b3;};'use strict';var multer=require(_0x8ff3('0x0'));var util=require(_0x8ff3('0x1'));var path=require('path');var timeout=require(_0x8ff3('0x2'));var express=require(_0x8ff3('0x3'));var router=express[_0x8ff3('0x4')]();var auth=require(_0x8ff3('0x5'));var interaction=require(_0x8ff3('0x6'));var config=require(_0x8ff3('0x7'));var controller=require(_0x8ff3('0x8'));router[_0x8ff3('0x9')]('/',auth[_0x8ff3('0xa')](),controller[_0x8ff3('0xb')]);router[_0x8ff3('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x8ff3('0x9')](_0x8ff3('0xc'),auth['isAuthenticated'](),controller[_0x8ff3('0xd')]);router[_0x8ff3('0x9')](_0x8ff3('0xe'),auth[_0x8ff3('0xa')](),controller['countContactsQueueCampaignHopperFinal']);router[_0x8ff3('0x9')](_0x8ff3('0xf'),auth['isAuthenticated'](),controller[_0x8ff3('0x10')]);router['post'](_0x8ff3('0x11'),auth[_0x8ff3('0xa')](),controller[_0x8ff3('0x12')]);router['post'](_0x8ff3('0x13'),auth[_0x8ff3('0xa')](),controller[_0x8ff3('0x14')]);router[_0x8ff3('0x15')]('/checkContactHopper',auth[_0x8ff3('0xa')](),controller[_0x8ff3('0x16')]);router['put']('/:id',auth[_0x8ff3('0xa')](),controller[_0x8ff3('0x17')]);module[_0x8ff3('0x18')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 33a9a52..5262f0e 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 _0xf2d0=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x24b4b8,_0x277ca4){var _0x42a95a=function(_0x41f14c){while(--_0x41f14c){_0x24b4b8['push'](_0x24b4b8['shift']());}};_0x42a95a(++_0x277ca4);}(_0xf2d0,0xb0));var _0x0f2d=function(_0x45b982,_0x4707f6){_0x45b982=_0x45b982-0x0;var _0x48b9c9=_0xf2d0[_0x45b982];return _0x48b9c9;};'use strict';var Sequelize=require(_0x0f2d('0x0'));module['exports']={'state':{'type':Sequelize[_0x0f2d('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x0f2d('0x2')]},'scheduledat':{'type':Sequelize[_0x0f2d('0x3')]},'countbusyretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x0f2d('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x0f2d('0x2')]},'originatecalleridname':{'type':Sequelize[_0x0f2d('0x2')]},'calleridnum':{'type':Sequelize[_0x0f2d('0x2')]},'calleridname':{'type':Sequelize[_0x0f2d('0x2')]},'starttime':{'type':Sequelize[_0x0f2d('0x3')]},'responsetime':{'type':Sequelize['DATE']},'answertime':{'type':Sequelize[_0x0f2d('0x3')]},'droptime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x0f2d('0x2')]},'campaign':{'type':Sequelize[_0x0f2d('0x2')]},'campaigntype':{'type':Sequelize[_0x0f2d('0x2')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]},'callback':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x0f2d('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x0f2d('0x3')]},'recallme':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x0f2d('0x3')]},'edited':{'type':Sequelize[_0x0f2d('0x4')],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize[_0x0f2d('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0x142c=['STRING','DATE','BOOLEAN','sequelize','exports','INTEGER'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0x142c,0xff));var _0xc142=function(_0x3f28a3,_0x24a190){_0x3f28a3=_0x3f28a3-0x0;var _0x31cd17=_0x142c[_0x3f28a3];return _0x31cd17;};'use strict';var Sequelize=require(_0xc142('0x0'));module[_0xc142('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize[_0xc142('0x3')]},'originatecalleridname':{'type':Sequelize[_0xc142('0x3')]},'calleridnum':{'type':Sequelize[_0xc142('0x3')]},'calleridname':{'type':Sequelize[_0xc142('0x3')]},'starttime':{'type':Sequelize[_0xc142('0x4')]},'responsetime':{'type':Sequelize[_0xc142('0x4')]},'answertime':{'type':Sequelize[_0xc142('0x4')]},'droptime':{'type':Sequelize[_0xc142('0x4')]},'endtime':{'type':Sequelize[_0xc142('0x4')]},'ringtime':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xc142('0x3')]},'campaign':{'type':Sequelize[_0xc142('0x3')]},'campaigntype':{'type':Sequelize[_0xc142('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xc142('0x3')]},'amd':{'type':Sequelize[_0xc142('0x5')],'defaultValue':![]},'fax':{'type':Sequelize[_0xc142('0x5')],'defaultValue':![]},'callback':{'type':Sequelize[_0xc142('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xc142('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xc142('0x4')]},'recallme':{'type':Sequelize[_0xc142('0x5')],'defaultValue':![]},'editedat':{'type':Sequelize[_0xc142('0x4')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'countnosuchnumberretry':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'countdropretry':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'countabandonedretry':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'countmachineretry':{'type':Sequelize[_0xc142('0x2')],'defaultValue':0x0},'countagentrejectretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index e3516c5..21a0e9f 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 _0x9873=['include','show','find','catch','create','describe','body','uniqueid','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','update','destroy','then','error','stack','name','send','index','map','CmHopperHistory','rawAttributes','type','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0x9873,0xa7));var _0x3987=function(_0x1afd82,_0x14a715){_0x1afd82=_0x1afd82-0x0;var _0x1e070a=_0x9873[_0x1afd82];return _0x1e070a;};'use strict';var pdf=require(_0x3987('0x0'));var emlformat=require(_0x3987('0x1'));var rimraf=require(_0x3987('0x2'));var zipdir=require(_0x3987('0x3'));var jsonpatch=require(_0x3987('0x4'));var rp=require(_0x3987('0x5'));var moment=require(_0x3987('0x6'));var BPromise=require(_0x3987('0x7'));var Mustache=require(_0x3987('0x8'));var util=require(_0x3987('0x9'));var path=require(_0x3987('0xa'));var sox=require(_0x3987('0xb'));var csv=require(_0x3987('0xc'));var ejs=require(_0x3987('0xd'));var fs=require('fs');var _=require(_0x3987('0xe'));var squel=require(_0x3987('0xf'));var crypto=require(_0x3987('0x10'));var jsforce=require(_0x3987('0x11'));var deskjs=require(_0x3987('0x12'));var toCsv=require(_0x3987('0xc'));var querystring=require(_0x3987('0x13'));var Papa=require(_0x3987('0x14'));var Redis=require('ioredis');var authService=require(_0x3987('0x15'));var qs=require(_0x3987('0x16'));var as=require(_0x3987('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3987('0x18'))(_0x3987('0x19'));var utils=require(_0x3987('0x1a'));var config=require(_0x3987('0x1b'));var db=require(_0x3987('0x1c'))['db'];function respondWithStatusCode(_0x9e8bd5,_0x423a21){_0x423a21=_0x423a21||0xcc;return function(_0x10a1e9){if(_0x10a1e9){return _0x9e8bd5[_0x3987('0x1d')](_0x423a21);}return _0x9e8bd5['status'](_0x423a21)[_0x3987('0x1e')]();};}function respondWithResult(_0x26603c,_0x1119ad){_0x1119ad=_0x1119ad||0xc8;return function(_0x41d275){if(_0x41d275){return _0x26603c[_0x3987('0x1f')](_0x1119ad)[_0x3987('0x20')](_0x41d275);}};}function respondWithFilteredResult(_0x39ed43,_0x1be3ac){return function(_0x156cb0){if(_0x156cb0){var _0x1d3b28=_0x156cb0[_0x3987('0x21')],_0x41beda=_0x1be3ac[_0x3987('0x22')],_0x197aec=_0x1be3ac[_0x3987('0x22')]+_0x1be3ac[_0x3987('0x23')],_0x3226b7;if(_0x197aec>=_0x1d3b28){_0x197aec=_0x1d3b28;_0x3226b7=0xc8;}else{_0x3226b7=0xce;}_0x39ed43[_0x3987('0x1f')](_0x3226b7);return _0x39ed43[_0x3987('0x24')]('Content-Range',_0x41beda+'-'+_0x197aec+'/'+_0x1d3b28)['json'](_0x156cb0);}return null;};}function patchUpdates(_0x447a44){return function(_0x1456d3){try{jsonpatch[_0x3987('0x25')](_0x1456d3,_0x447a44,!![]);}catch(_0x1d2e15){return BPromise[_0x3987('0x26')](_0x1d2e15);}return _0x1456d3['save']();};}function saveUpdates(_0x1d3f67,_0x145371){return function(_0x16465c){if(_0x16465c){return _0x16465c[_0x3987('0x27')](_0x1d3f67)['then'](function(_0x4b68d4){return _0x4b68d4;});}return null;};}function removeEntity(_0x35a7ce,_0x1f9cfe){return function(_0x105712){if(_0x105712){return _0x105712[_0x3987('0x28')]()[_0x3987('0x29')](function(){_0x35a7ce[_0x3987('0x1f')](0xcc)[_0x3987('0x1e')]();});}};}function handleEntityNotFound(_0xba171f,_0x5d9c20){return function(_0x37ad90){if(!_0x37ad90){_0xba171f[_0x3987('0x1d')](0x194);}return _0x37ad90;};}function handleError(_0x21e6f0,_0x4dd713){_0x4dd713=_0x4dd713||0x1f4;return function(_0x148146){logger[_0x3987('0x2a')](_0x148146[_0x3987('0x2b')]);if(_0x148146['name']){delete _0x148146[_0x3987('0x2c')];}_0x21e6f0[_0x3987('0x1f')](_0x4dd713)[_0x3987('0x2d')](_0x148146);};}exports[_0x3987('0x2e')]=function(_0x6f114b,_0x21ef8f){var _0x25ee17={},_0x34ff20={},_0x29f661={'count':0x0,'rows':[]};var _0x196e32=_[_0x3987('0x2f')](db[_0x3987('0x30')][_0x3987('0x31')],function(_0x1652ce){return{'name':_0x1652ce['fieldName'],'type':_0x1652ce[_0x3987('0x32')][_0x3987('0x33')]};});_0x34ff20[_0x3987('0x34')]=_['map'](_0x196e32,_0x3987('0x2c'));_0x34ff20[_0x3987('0x35')]=_[_0x3987('0x36')](_0x6f114b['query']);_0x34ff20[_0x3987('0x37')]=_['intersection'](_0x34ff20[_0x3987('0x34')],_0x34ff20[_0x3987('0x35')]);_0x25ee17['attributes']=_[_0x3987('0x38')](_0x34ff20[_0x3987('0x34')],qs[_0x3987('0x39')](_0x6f114b[_0x3987('0x35')][_0x3987('0x39')]));_0x25ee17[_0x3987('0x3a')]=_0x25ee17[_0x3987('0x3a')][_0x3987('0x3b')]?_0x25ee17[_0x3987('0x3a')]:_0x34ff20[_0x3987('0x34')];if(!_0x6f114b[_0x3987('0x35')]['hasOwnProperty'](_0x3987('0x3c'))){_0x25ee17[_0x3987('0x23')]=qs[_0x3987('0x23')](_0x6f114b[_0x3987('0x35')][_0x3987('0x23')]);_0x25ee17['offset']=qs[_0x3987('0x22')](_0x6f114b[_0x3987('0x35')][_0x3987('0x22')]);}_0x25ee17[_0x3987('0x3d')]=qs[_0x3987('0x3e')](_0x6f114b[_0x3987('0x35')][_0x3987('0x3e')]);_0x25ee17[_0x3987('0x3f')]=qs[_0x3987('0x37')](_[_0x3987('0x40')](_0x6f114b[_0x3987('0x35')],_0x34ff20[_0x3987('0x37')]));if(_0x6f114b[_0x3987('0x35')][_0x3987('0x41')]){_0x25ee17[_0x3987('0x3f')]=_[_0x3987('0x42')](_0x25ee17[_0x3987('0x3f')],{'$or':_['map'](_0x196e32,function(_0x237b81){if(_0x237b81['type']!==_0x3987('0x43')){var _0x5561ef={};_0x5561ef[_0x237b81[_0x3987('0x2c')]]={'$like':'%'+_0x6f114b[_0x3987('0x35')][_0x3987('0x41')]+'%'};return _0x5561ef;}})});}_0x25ee17=_['merge']({},_0x25ee17,_0x6f114b[_0x3987('0x44')]);var _0x8cfa52={'where':_0x25ee17[_0x3987('0x3f')]};return db[_0x3987('0x30')][_0x3987('0x21')](_0x8cfa52)['then'](function(_0xbd63df){_0x29f661[_0x3987('0x21')]=_0xbd63df;if(_0x6f114b[_0x3987('0x35')][_0x3987('0x45')]){_0x25ee17[_0x3987('0x46')]=[{'all':!![]}];}return db[_0x3987('0x30')]['findAll'](_0x25ee17);})[_0x3987('0x29')](function(_0xa65e61){_0x29f661['rows']=_0xa65e61;return _0x29f661;})[_0x3987('0x29')](respondWithFilteredResult(_0x21ef8f,_0x25ee17))['catch'](handleError(_0x21ef8f,null));};exports[_0x3987('0x47')]=function(_0x3855da,_0x5c4fa0){var _0x22e81e={'raw':!![],'where':{'id':_0x3855da['params']['id']}},_0x5e1302={};_0x5e1302[_0x3987('0x34')]=_[_0x3987('0x36')](db[_0x3987('0x30')][_0x3987('0x31')]);_0x5e1302[_0x3987('0x35')]=_[_0x3987('0x36')](_0x3855da['query']);_0x5e1302[_0x3987('0x37')]=_[_0x3987('0x38')](_0x5e1302['model'],_0x5e1302[_0x3987('0x35')]);_0x22e81e[_0x3987('0x3a')]=_[_0x3987('0x38')](_0x5e1302[_0x3987('0x34')],qs[_0x3987('0x39')](_0x3855da[_0x3987('0x35')][_0x3987('0x39')]));_0x22e81e[_0x3987('0x3a')]=_0x22e81e['attributes']['length']?_0x22e81e[_0x3987('0x3a')]:_0x5e1302[_0x3987('0x34')];if(_0x3855da[_0x3987('0x35')][_0x3987('0x45')]){_0x22e81e[_0x3987('0x46')]=[{'all':!![]}];}_0x22e81e=_['merge']({},_0x22e81e,_0x3855da[_0x3987('0x44')]);return db[_0x3987('0x30')][_0x3987('0x48')](_0x22e81e)[_0x3987('0x29')](handleEntityNotFound(_0x5c4fa0,null))[_0x3987('0x29')](respondWithResult(_0x5c4fa0,null))[_0x3987('0x49')](handleError(_0x5c4fa0,null));};exports[_0x3987('0x4a')]=function(_0x4d8cf6,_0x4a4db5){return db['CmHopperHistory'][_0x3987('0x4a')](_0x4d8cf6['body'],{})['then'](respondWithResult(_0x4a4db5,0xc9))[_0x3987('0x49')](handleError(_0x4a4db5,null));};exports[_0x3987('0x4b')]=function(_0x14095e,_0x400f30){return db[_0x3987('0x30')]['describe']()[_0x3987('0x29')](respondWithResult(_0x400f30,null))[_0x3987('0x49')](handleError(_0x400f30,null));};exports['update']=function(_0x13d67a,_0x1e4bc2){if(_0x13d67a[_0x3987('0x4c')][_0x3987('0x4d')]){delete _0x13d67a[_0x3987('0x4c')][_0x3987('0x4d')];}return db[_0x3987('0x30')][_0x3987('0x48')]({'where':{'uniqueid':_0x13d67a[_0x3987('0x4e')]['id']}})['then'](handleEntityNotFound(_0x1e4bc2,null))['then'](saveUpdates(_0x13d67a[_0x3987('0x4c')],null))[_0x3987('0x29')](respondWithResult(_0x1e4bc2,null))['catch'](handleError(_0x1e4bc2,null));}; \ No newline at end of file +var _0x0fb7=['error','stack','name','send','index','CmHopperHistory','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','catch','show','find','create','body','describe','uniqueid','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x4baa60,_0xbc56a1){var _0x25a61a=function(_0x3f4f8f){while(--_0x3f4f8f){_0x4baa60['push'](_0x4baa60['shift']());}};_0x25a61a(++_0xbc56a1);}(_0x0fb7,0x15b));var _0x70fb=function(_0x37df7f,_0x4c827d){_0x37df7f=_0x37df7f-0x0;var _0x59fd67=_0x0fb7[_0x37df7f];return _0x59fd67;};'use strict';var pdf=require(_0x70fb('0x0'));var emlformat=require(_0x70fb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x70fb('0x2'));var jsonpatch=require(_0x70fb('0x3'));var rp=require(_0x70fb('0x4'));var moment=require(_0x70fb('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x70fb('0x6'));var csv=require('to-csv');var ejs=require(_0x70fb('0x7'));var fs=require('fs');var _=require(_0x70fb('0x8'));var squel=require(_0x70fb('0x9'));var crypto=require(_0x70fb('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x70fb('0xb'));var toCsv=require(_0x70fb('0xc'));var querystring=require(_0x70fb('0xd'));var Papa=require('papaparse');var Redis=require(_0x70fb('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x70fb('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x70fb('0x10'))(_0x70fb('0x11'));var utils=require(_0x70fb('0x12'));var config=require(_0x70fb('0x13'));var db=require(_0x70fb('0x14'))['db'];function respondWithStatusCode(_0x18fe18,_0x2a9506){_0x2a9506=_0x2a9506||0xcc;return function(_0x39fda4){if(_0x39fda4){return _0x18fe18[_0x70fb('0x15')](_0x2a9506);}return _0x18fe18[_0x70fb('0x16')](_0x2a9506)[_0x70fb('0x17')]();};}function respondWithResult(_0x396004,_0x3529fe){_0x3529fe=_0x3529fe||0xc8;return function(_0x5ebc9b){if(_0x5ebc9b){return _0x396004[_0x70fb('0x16')](_0x3529fe)['json'](_0x5ebc9b);}};}function respondWithFilteredResult(_0x172a14,_0x4582cd){return function(_0x1a55c9){if(_0x1a55c9){var _0x11a949=_0x1a55c9['count'],_0x1d451c=_0x4582cd[_0x70fb('0x18')],_0x2fd9f7=_0x4582cd[_0x70fb('0x18')]+_0x4582cd['limit'],_0x5898f0;if(_0x2fd9f7>=_0x11a949){_0x2fd9f7=_0x11a949;_0x5898f0=0xc8;}else{_0x5898f0=0xce;}_0x172a14[_0x70fb('0x16')](_0x5898f0);return _0x172a14[_0x70fb('0x19')](_0x70fb('0x1a'),_0x1d451c+'-'+_0x2fd9f7+'/'+_0x11a949)['json'](_0x1a55c9);}return null;};}function patchUpdates(_0x54fdf6){return function(_0x3cae3b){try{jsonpatch[_0x70fb('0x1b')](_0x3cae3b,_0x54fdf6,!![]);}catch(_0x1c05d5){return BPromise[_0x70fb('0x1c')](_0x1c05d5);}return _0x3cae3b[_0x70fb('0x1d')]();};}function saveUpdates(_0x4e8893,_0x33417e){return function(_0x1c3aeb){if(_0x1c3aeb){return _0x1c3aeb[_0x70fb('0x1e')](_0x4e8893)[_0x70fb('0x1f')](function(_0x1fa748){return _0x1fa748;});}return null;};}function removeEntity(_0x36f22c,_0x3350f0){return function(_0x2e3097){if(_0x2e3097){return _0x2e3097[_0x70fb('0x20')]()['then'](function(){_0x36f22c[_0x70fb('0x16')](0xcc)[_0x70fb('0x17')]();});}};}function handleEntityNotFound(_0x1a1011,_0x2d121a){return function(_0x50b05d){if(!_0x50b05d){_0x1a1011['sendStatus'](0x194);}return _0x50b05d;};}function handleError(_0x56477c,_0x22d3a9){_0x22d3a9=_0x22d3a9||0x1f4;return function(_0x3b1e04){logger[_0x70fb('0x21')](_0x3b1e04[_0x70fb('0x22')]);if(_0x3b1e04[_0x70fb('0x23')]){delete _0x3b1e04[_0x70fb('0x23')];}_0x56477c[_0x70fb('0x16')](_0x22d3a9)[_0x70fb('0x24')](_0x3b1e04);};}exports[_0x70fb('0x25')]=function(_0x1621c7,_0x5ab5ef){var _0x3982da={},_0x3f6547={},_0x2ee2e2={'count':0x0,'rows':[]};var _0x1b43b8=_['map'](db[_0x70fb('0x26')][_0x70fb('0x27')],function(_0x5acd7c){return{'name':_0x5acd7c[_0x70fb('0x28')],'type':_0x5acd7c[_0x70fb('0x29')][_0x70fb('0x2a')]};});_0x3f6547[_0x70fb('0x2b')]=_[_0x70fb('0x2c')](_0x1b43b8,_0x70fb('0x23'));_0x3f6547['query']=_[_0x70fb('0x2d')](_0x1621c7[_0x70fb('0x2e')]);_0x3f6547[_0x70fb('0x2f')]=_[_0x70fb('0x30')](_0x3f6547[_0x70fb('0x2b')],_0x3f6547[_0x70fb('0x2e')]);_0x3982da[_0x70fb('0x31')]=_['intersection'](_0x3f6547['model'],qs[_0x70fb('0x32')](_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x32')]));_0x3982da[_0x70fb('0x31')]=_0x3982da[_0x70fb('0x31')][_0x70fb('0x33')]?_0x3982da[_0x70fb('0x31')]:_0x3f6547[_0x70fb('0x2b')];if(!_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x34')](_0x70fb('0x35'))){_0x3982da[_0x70fb('0x36')]=qs[_0x70fb('0x36')](_0x1621c7['query'][_0x70fb('0x36')]);_0x3982da[_0x70fb('0x18')]=qs[_0x70fb('0x18')](_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x18')]);}_0x3982da[_0x70fb('0x37')]=qs[_0x70fb('0x38')](_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x38')]);_0x3982da[_0x70fb('0x39')]=qs[_0x70fb('0x2f')](_[_0x70fb('0x3a')](_0x1621c7[_0x70fb('0x2e')],_0x3f6547['filters']));if(_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x3b')]){_0x3982da[_0x70fb('0x39')]=_['merge'](_0x3982da[_0x70fb('0x39')],{'$or':_[_0x70fb('0x2c')](_0x1b43b8,function(_0x577ef1){if(_0x577ef1[_0x70fb('0x29')]!==_0x70fb('0x3c')){var _0x1129ed={};_0x1129ed[_0x577ef1[_0x70fb('0x23')]]={'$like':'%'+_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x3b')]+'%'};return _0x1129ed;}})});}_0x3982da=_[_0x70fb('0x3d')]({},_0x3982da,_0x1621c7[_0x70fb('0x3e')]);var _0x45454c={'where':_0x3982da[_0x70fb('0x39')]};return db[_0x70fb('0x26')]['count'](_0x45454c)[_0x70fb('0x1f')](function(_0x25899c){_0x2ee2e2[_0x70fb('0x3f')]=_0x25899c;if(_0x1621c7[_0x70fb('0x2e')][_0x70fb('0x40')]){_0x3982da[_0x70fb('0x41')]=[{'all':!![]}];}return db[_0x70fb('0x26')][_0x70fb('0x42')](_0x3982da);})[_0x70fb('0x1f')](function(_0x3dabb8){_0x2ee2e2[_0x70fb('0x43')]=_0x3dabb8;return _0x2ee2e2;})[_0x70fb('0x1f')](respondWithFilteredResult(_0x5ab5ef,_0x3982da))[_0x70fb('0x44')](handleError(_0x5ab5ef,null));};exports[_0x70fb('0x45')]=function(_0x365bbb,_0x254e19){var _0x288511={'raw':!![],'where':{'id':_0x365bbb['params']['id']}},_0x374bc9={};_0x374bc9[_0x70fb('0x2b')]=_['keys'](db[_0x70fb('0x26')]['rawAttributes']);_0x374bc9['query']=_['keys'](_0x365bbb[_0x70fb('0x2e')]);_0x374bc9['filters']=_[_0x70fb('0x30')](_0x374bc9[_0x70fb('0x2b')],_0x374bc9['query']);_0x288511[_0x70fb('0x31')]=_[_0x70fb('0x30')](_0x374bc9[_0x70fb('0x2b')],qs[_0x70fb('0x32')](_0x365bbb[_0x70fb('0x2e')][_0x70fb('0x32')]));_0x288511[_0x70fb('0x31')]=_0x288511[_0x70fb('0x31')][_0x70fb('0x33')]?_0x288511['attributes']:_0x374bc9[_0x70fb('0x2b')];if(_0x365bbb[_0x70fb('0x2e')][_0x70fb('0x40')]){_0x288511[_0x70fb('0x41')]=[{'all':!![]}];}_0x288511=_[_0x70fb('0x3d')]({},_0x288511,_0x365bbb[_0x70fb('0x3e')]);return db['CmHopperHistory'][_0x70fb('0x46')](_0x288511)[_0x70fb('0x1f')](handleEntityNotFound(_0x254e19,null))[_0x70fb('0x1f')](respondWithResult(_0x254e19,null))[_0x70fb('0x44')](handleError(_0x254e19,null));};exports['create']=function(_0x32e891,_0x481bcc){return db[_0x70fb('0x26')][_0x70fb('0x47')](_0x32e891[_0x70fb('0x48')],{})[_0x70fb('0x1f')](respondWithResult(_0x481bcc,0xc9))[_0x70fb('0x44')](handleError(_0x481bcc,null));};exports[_0x70fb('0x49')]=function(_0x2dbadd,_0x529b79){return db[_0x70fb('0x26')][_0x70fb('0x49')]()['then'](respondWithResult(_0x529b79,null))[_0x70fb('0x44')](handleError(_0x529b79,null));};exports['update']=function(_0x45da85,_0x494e5a){if(_0x45da85[_0x70fb('0x48')][_0x70fb('0x4a')]){delete _0x45da85[_0x70fb('0x48')][_0x70fb('0x4a')];}return db[_0x70fb('0x26')][_0x70fb('0x46')]({'where':{'uniqueid':_0x45da85[_0x70fb('0x4b')]['id']}})[_0x70fb('0x1f')](handleEntityNotFound(_0x494e5a,null))[_0x70fb('0x1f')](saveUpdates(_0x45da85[_0x70fb('0x48')],null))[_0x70fb('0x1f')](respondWithResult(_0x494e5a,null))[_0x70fb('0x44')](handleError(_0x494e5a,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 60c37e5..6bb554a 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 _0xefb4=['exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise','path','./cmHopperHistory.attributes'];(function(_0xdc19d4,_0x4afa8e){var _0x1e9ff9=function(_0xe6a551){while(--_0xe6a551){_0xdc19d4['push'](_0xdc19d4['shift']());}};_0x1e9ff9(++_0x4afa8e);}(_0xefb4,0x1da));var _0x4efb=function(_0x284158,_0x27c08c){_0x284158=_0x284158-0x0;var _0x3f1a64=_0xefb4[_0x284158];return _0x3f1a64;};'use strict';var _=require(_0x4efb('0x0'));var util=require(_0x4efb('0x1'));var logger=require(_0x4efb('0x2'))(_0x4efb('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x4efb('0x4'));var fs=require('fs');var path=require(_0x4efb('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4efb('0x6'));module[_0x4efb('0x7')]=function(_0x14eb7c,_0x2f6810){return _0x14eb7c[_0x4efb('0x8')](_0x4efb('0x9'),attributes,{'tableName':_0x4efb('0xa'),'paranoid':![],'indexes':[{'name':_0x4efb('0xb'),'fields':[_0x4efb('0xb')]},{'name':_0x4efb('0xc'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xf25a=['cm_hopper_history','endtime','uniqueid','lodash','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory'];(function(_0x9c3f12,_0x3f06d0){var _0x27d92d=function(_0x559100){while(--_0x559100){_0x9c3f12['push'](_0x9c3f12['shift']());}};_0x27d92d(++_0x3f06d0);}(_0xf25a,0xff));var _0xaf25=function(_0x4b9df5,_0x20625d){_0x4b9df5=_0x4b9df5-0x0;var _0x229b39=_0xf25a[_0x4b9df5];return _0x229b39;};'use strict';var _=require(_0xaf25('0x0'));var util=require('util');var logger=require(_0xaf25('0x1'))('api');var moment=require('moment');var BPromise=require(_0xaf25('0x2'));var rp=require(_0xaf25('0x3'));var fs=require('fs');var path=require(_0xaf25('0x4'));var rimraf=require(_0xaf25('0x5'));var config=require(_0xaf25('0x6'));var attributes=require(_0xaf25('0x7'));module[_0xaf25('0x8')]=function(_0x2a0ca0,_0x444b2c){return _0x2a0ca0[_0xaf25('0x9')](_0xaf25('0xa'),attributes,{'tableName':_0xaf25('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':[_0xaf25('0xc')]},{'name':_0xaf25('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.rpc.js b/server/api/cmHopperHistory/cmHopperHistory.rpc.js index 9dab60c..95c9b70 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 _0x4024=['randomstring','../../mysqldb','../../config/logger','rpc','client','http','request','info','request\x20sent','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopperHistory,\x20%s,\x20%s','message','result','catch','CreateCmHopperHistory','CmHopperHistory','body','options','raw','debug','AvgHandleTime','where','sequelize','col','predictiveIntervalTotalCalls','COUNT','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','literal','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','`state`\x20=\x2011,\x201,\x20null','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','AVG','`state`\x20=\x204,\x20`talktime`,\x20null','then','GetVoiceQueueHopperHistory','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','outboundNoAnswerCallsDay','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','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','campaign','ivrTotalCallsDays','ivrAnswerCallsDay','GetCampaignHopperHistory','lodash','util','bluebird'];(function(_0x3b4b79,_0x395e10){var _0x5d48b9=function(_0x48aaa6){while(--_0x48aaa6){_0x3b4b79['push'](_0x3b4b79['shift']());}};_0x5d48b9(++_0x395e10);}(_0x4024,0x89));var _0x4402=function(_0x3e77a2,_0x1302b9){_0x3e77a2=_0x3e77a2-0x0;var _0x9e85a3=_0x4024[_0x3e77a2];return _0x9e85a3;};'use strict';var _=require(_0x4402('0x0'));var util=require(_0x4402('0x1'));var moment=require('moment');var BPromise=require(_0x4402('0x2'));var rs=require(_0x4402('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4402('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x4402('0x5'))(_0x4402('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4402('0x7')][_0x4402('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x168acd,_0x4ed77d,_0x3045ae){return new BPromise(function(_0x5d7ca4,_0x5c0b70){return client[_0x4402('0x9')](_0x168acd,_0x3045ae)['then'](function(_0x4d2882){logger[_0x4402('0xa')]('CmHopperHistory,\x20%s,\x20%s',_0x4ed77d,_0x4402('0xb'));logger['debug'](_0x4402('0xc'),_0x4ed77d,'request\x20sent',JSON[_0x4402('0xd')](_0x4d2882));if(_0x4d2882[_0x4402('0xe')]){if(_0x4d2882['error'][_0x4402('0xf')]===0x1f4){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882['error'][_0x4402('0x11')]);return _0x5c0b70(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);return _0x5d7ca4(_0x4d2882[_0x4402('0xe')][_0x4402('0x11')]);}else{logger[_0x4402('0xa')](_0x4402('0x10'),_0x4ed77d,_0x4402('0xb'));_0x5d7ca4(_0x4d2882[_0x4402('0x12')][_0x4402('0x11')]);}})[_0x4402('0x13')](function(_0x30c390){logger[_0x4402('0xe')](_0x4402('0x10'),_0x4ed77d,_0x30c390);_0x5c0b70(_0x30c390);});});}exports[_0x4402('0x14')]=function(_0x231382){var _0x5b127f=this;return new Promise(function(_0x494389,_0x663ab7){return db[_0x4402('0x15')]['create'](_0x231382[_0x4402('0x16')],{'raw':_0x231382[_0x4402('0x17')]?_0x231382['options'][_0x4402('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x55cc8c){logger[_0x4402('0xa')](_0x4402('0x14'),_0x231382);logger[_0x4402('0x19')]('CreateCmHopperHistory',_0x231382,JSON[_0x4402('0xd')](_0x55cc8c));_0x494389(_0x55cc8c);})['catch'](function(_0x47ab54){logger[_0x4402('0xe')](_0x4402('0x14'),_0x47ab54[_0x4402('0x11')],_0x231382);_0x663ab7(_0x5b127f[_0x4402('0xe')](0x1f4,_0x47ab54[_0x4402('0x11')]));});});};exports[_0x4402('0x1a')]=function(_0x289a3e){var _0x6b1fc5=this;return new Promise(function(_0x24a9b8,_0x4d6846){return db[_0x4402('0x15')]['findAll']({'raw':_0x289a3e[_0x4402('0x17')]?_0x289a3e[_0x4402('0x17')][_0x4402('0x18')]===undefined?!![]:![]:!![],'where':_0x289a3e[_0x4402('0x17')]?_0x289a3e['options'][_0x4402('0x1b')]||null:null,'attributes':[[db['sequelize']['fn']('COUNT',db[_0x4402('0x1c')][_0x4402('0x1d')]('id')),_0x4402('0x1e')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')]['literal'](_0x4402('0x20')))),_0x4402('0x21')],[db[_0x4402('0x1c')]['fn']('COUNT',db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x23')))),_0x4402('0x24')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x25')))),'predictiveIntervalDroppedCallsCallersExit'],[db[_0x4402('0x1c')]['fn']('AVG',db[_0x4402('0x1c')]['fn']('IF',db['sequelize'][_0x4402('0x22')](_0x4402('0x26')))),_0x4402('0x27')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x28'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x29')))),'predictiveIntervalAvgTalktime']]})[_0x4402('0x2a')](function(_0x3383e3){logger['info'](_0x4402('0x1a'),_0x289a3e);logger[_0x4402('0x19')](_0x4402('0x1a'),_0x289a3e,JSON[_0x4402('0xd')](_0x3383e3));_0x24a9b8(_0x3383e3);})[_0x4402('0x13')](function(_0x235f30){logger[_0x4402('0xe')](_0x4402('0x1a'),_0x235f30[_0x4402('0x11')],_0x289a3e);_0x4d6846(_0x6b1fc5['error'](0x1f4,_0x235f30[_0x4402('0x11')]));});});};exports[_0x4402('0x2b')]=function(_0x2a1657){var _0x566a80=this;return new Promise(function(_0x34e4ae,_0x1c1ac3){return db['CmHopperHistory']['findAll']({'raw':_0x2a1657[_0x4402('0x17')]?_0x2a1657[_0x4402('0x17')][_0x4402('0x18')]===undefined?!![]:![]:!![],'where':_0x2a1657[_0x4402('0x17')]?_0x2a1657['options']['where']||null:null,'attributes':[['campaign',_0x4402('0x2c')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db['sequelize'][_0x4402('0x22')](_0x4402('0x2d')))),_0x4402('0x2e')],[db['sequelize']['fn'](_0x4402('0x1f'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')]('`state`\x20=\x203,\x201,\x20null'))),_0x4402('0x2f')],[db['sequelize']['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db['sequelize'][_0x4402('0x22')](_0x4402('0x20')))),_0x4402('0x30')],[db[_0x4402('0x1c')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0x4402('0x1c')]['literal'](_0x4402('0x31')))),_0x4402('0x32')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x33')))),_0x4402('0x34')],[db[_0x4402('0x1c')]['fn']('COUNT',db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')]['literal'](_0x4402('0x35')))),_0x4402('0x36')],[db['sequelize']['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x37')))),'outboundDropCallsDayCallersExit'],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x38')))),_0x4402('0x39')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')]['literal'](_0x4402('0x3a')))),'outboundBlacklistCallsDay'],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x3b')))),_0x4402('0x3c')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x3d')))),_0x4402('0x3e')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn']('COUNT',db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x3f')))),'outboundRejectCallsDay'],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')]['fn']('IF',db[_0x4402('0x1c')][_0x4402('0x22')](_0x4402('0x40')))),_0x4402('0x41')]],'group':['campaign']})[_0x4402('0x2a')](function(_0x2a8085){logger[_0x4402('0xa')](_0x4402('0x2b'),_0x2a1657);logger[_0x4402('0x19')](_0x4402('0x2b'),_0x2a1657,JSON['stringify'](_0x2a8085));_0x34e4ae(_0x2a8085);})[_0x4402('0x13')](function(_0x642ab4){logger[_0x4402('0xe')](_0x4402('0x2b'),_0x642ab4[_0x4402('0x11')],_0x2a1657);_0x1c1ac3(_0x566a80[_0x4402('0xe')](0x1f4,_0x642ab4[_0x4402('0x11')]));});});};exports['GetCampaignHopperHistory']=function(_0x48e138){var _0x1a94f5=this;return new Promise(function(_0xb82409,_0x219472){return db['CmHopperHistory']['findAll']({'raw':_0x48e138[_0x4402('0x17')]?_0x48e138[_0x4402('0x17')][_0x4402('0x18')]===undefined?!![]:![]:!![],'where':_0x48e138[_0x4402('0x17')]?_0x48e138[_0x4402('0x17')][_0x4402('0x1b')]||null:null,'attributes':[[_0x4402('0x42'),_0x4402('0x2c')],[db[_0x4402('0x1c')]['fn'](_0x4402('0x1f'),db[_0x4402('0x1c')][_0x4402('0x1d')]('id')),_0x4402('0x43')],[db['sequelize']['fn'](_0x4402('0x1f'),db['sequelize']['fn']('IF',db[_0x4402('0x1c')]['literal'](_0x4402('0x20')))),_0x4402('0x44')]],'group':[_0x4402('0x42')]})[_0x4402('0x2a')](function(_0x1f298c){logger[_0x4402('0xa')]('GetCampaignHopperHistory',_0x48e138);logger[_0x4402('0x19')](_0x4402('0x45'),_0x48e138,JSON[_0x4402('0xd')](_0x1f298c));_0xb82409(_0x1f298c);})[_0x4402('0x13')](function(_0xb341ab){logger['error'](_0x4402('0x45'),_0xb341ab[_0x4402('0x11')],_0x48e138);_0x219472(_0x1a94f5[_0x4402('0xe')](0x1f4,_0xb341ab[_0x4402('0x11')]));});});}; \ No newline at end of file +var _0xed3c=['http','info','CmHopperHistory,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CmHopperHistory','create','body','options','raw','then','CreateCmHopperHistory','AvgHandleTime','findAll','where','sequelize','COUNT','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','predictiveIntervalAnsweredCalls','`state`\x20=\x2010,\x201,\x20null','`state`\x20=\x2011,\x201,\x20null','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','predictiveIntervalAvgTalktime','GetVoiceQueueHopperHistory','campaign','name','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','`state`\x20=\x2012,\x201,\x20null','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundAnswerAgiCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','GetCampaignHopperHistory','col','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xed3c,0x1a6));var _0xced3=function(_0x31aa4b,_0x468550){_0x31aa4b=_0x31aa4b-0x0;var _0x49f208=_0xed3c[_0x31aa4b];return _0x49f208;};'use strict';var _=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var moment=require(_0xced3('0x2'));var BPromise=require(_0xced3('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xced3('0x4'));var db=require(_0xced3('0x5'))['db'];var utils=require(_0xced3('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xced3('0x7'));var jayson=require(_0xced3('0x8'));var client=jayson[_0xced3('0x9')][_0xced3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4795cd,_0x510164,_0x5ca701){return new BPromise(function(_0x851bd3,_0x5f2f90){return client['request'](_0x4795cd,_0x5ca701)['then'](function(_0x19a727){logger[_0xced3('0xb')](_0xced3('0xc'),_0x510164,_0xced3('0xd'));logger[_0xced3('0xe')]('CmHopperHistory,\x20%s,\x20%s,\x20%s',_0x510164,_0xced3('0xd'),JSON[_0xced3('0xf')](_0x19a727));if(_0x19a727[_0xced3('0x10')]){if(_0x19a727['error'][_0xced3('0x11')]===0x1f4){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);return _0x5f2f90(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}logger['error'](_0xced3('0xc'),_0x510164,_0x19a727['error'][_0xced3('0x12')]);return _0x851bd3(_0x19a727[_0xced3('0x10')][_0xced3('0x12')]);}else{logger[_0xced3('0xb')]('CmHopperHistory,\x20%s,\x20%s',_0x510164,_0xced3('0xd'));_0x851bd3(_0x19a727[_0xced3('0x13')]['message']);}})[_0xced3('0x14')](function(_0x37e2d5){logger[_0xced3('0x10')](_0xced3('0xc'),_0x510164,_0x37e2d5);_0x5f2f90(_0x37e2d5);});});}exports['CreateCmHopperHistory']=function(_0x4569af){var _0x4a3afe=this;return new Promise(function(_0x353580,_0x4480a6){return db[_0xced3('0x15')][_0xced3('0x16')](_0x4569af[_0xced3('0x17')],{'raw':_0x4569af[_0xced3('0x18')]?_0x4569af[_0xced3('0x18')][_0xced3('0x19')]===undefined?!![]:![]:!![]})[_0xced3('0x1a')](function(_0x17c011){logger[_0xced3('0xb')]('CreateCmHopperHistory',_0x4569af);logger['debug']('CreateCmHopperHistory',_0x4569af,JSON[_0xced3('0xf')](_0x17c011));_0x353580(_0x17c011);})[_0xced3('0x14')](function(_0x21e074){logger['error'](_0xced3('0x1b'),_0x21e074[_0xced3('0x12')],_0x4569af);_0x4480a6(_0x4a3afe['error'](0x1f4,_0x21e074['message']));});});};exports[_0xced3('0x1c')]=function(_0x101708){var _0x219fa8=this;return new Promise(function(_0x15c6c5,_0x50f7c1){return db[_0xced3('0x15')][_0xced3('0x1d')]({'raw':_0x101708['options']?_0x101708[_0xced3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x101708[_0xced3('0x18')]?_0x101708[_0xced3('0x18')][_0xced3('0x1e')]||null:null,'attributes':[[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db['sequelize']['col']('id')),_0xced3('0x21')],[db['sequelize']['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db['sequelize'][_0xced3('0x22')](_0xced3('0x23')))),_0xced3('0x24')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x25')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x26')))),_0xced3('0x27')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x28'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x29')))),_0xced3('0x2a')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x28'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x2b')))),_0xced3('0x2c')]]})['then'](function(_0x5b92fc){logger['info'](_0xced3('0x1c'),_0x101708);logger[_0xced3('0xe')](_0xced3('0x1c'),_0x101708,JSON[_0xced3('0xf')](_0x5b92fc));_0x15c6c5(_0x5b92fc);})[_0xced3('0x14')](function(_0xefac3d){logger[_0xced3('0x10')](_0xced3('0x1c'),_0xefac3d[_0xced3('0x12')],_0x101708);_0x50f7c1(_0x219fa8[_0xced3('0x10')](0x1f4,_0xefac3d['message']));});});};exports[_0xced3('0x2d')]=function(_0x26a435){var _0x53e401=this;return new Promise(function(_0x468c21,_0x3bf5e5){return db[_0xced3('0x15')]['findAll']({'raw':_0x26a435['options']?_0x26a435[_0xced3('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x26a435[_0xced3('0x18')]?_0x26a435[_0xced3('0x18')]['where']||null:null,'attributes':[[_0xced3('0x2e'),_0xced3('0x2f')],[db[_0xced3('0x1f')]['fn']('COUNT',db[_0xced3('0x1f')]['fn']('IF',db['sequelize']['literal'](_0xced3('0x30')))),_0xced3('0x31')],[db[_0xced3('0x1f')]['fn']('COUNT',db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x32')))),_0xced3('0x33')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x23')))),_0xced3('0x34')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db['sequelize'][_0xced3('0x22')](_0xced3('0x35')))),_0xced3('0x36')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x37')))),'outboundCongestionCallsDay'],[db[_0xced3('0x1f')]['fn']('COUNT',db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xced3('0x38')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db['sequelize'][_0xced3('0x22')](_0xced3('0x39')))),_0xced3('0x3a')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db['sequelize']['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x3b')))),_0xced3('0x3c')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db['sequelize'][_0xced3('0x22')](_0xced3('0x3d')))),'outboundBlacklistCallsDay'],[db['sequelize']['fn'](_0xced3('0x20'),db['sequelize']['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x3e')))),_0xced3('0x3f')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')]('`state`\x20=\x2018,\x201,\x20null'))),_0xced3('0x40')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')]('`state`\x20=\x2016,\x201,\x20null'))),_0xced3('0x41')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x42')))),_0xced3('0x40')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db[_0xced3('0x1f')]['fn']('IF',db[_0xced3('0x1f')]['literal'](_0xced3('0x43')))),'outboundReCallsDay']],'group':[_0xced3('0x2e')]})[_0xced3('0x1a')](function(_0xc93e05){logger['info']('GetVoiceQueueHopperHistory',_0x26a435);logger[_0xced3('0xe')](_0xced3('0x2d'),_0x26a435,JSON['stringify'](_0xc93e05));_0x468c21(_0xc93e05);})[_0xced3('0x14')](function(_0x4ae67d){logger[_0xced3('0x10')](_0xced3('0x2d'),_0x4ae67d['message'],_0x26a435);_0x3bf5e5(_0x53e401[_0xced3('0x10')](0x1f4,_0x4ae67d[_0xced3('0x12')]));});});};exports[_0xced3('0x44')]=function(_0x4b0bdc){var _0x12c991=this;return new Promise(function(_0x4cfd9a,_0x1cd21f){return db[_0xced3('0x15')][_0xced3('0x1d')]({'raw':_0x4b0bdc[_0xced3('0x18')]?_0x4b0bdc[_0xced3('0x18')][_0xced3('0x19')]===undefined?!![]:![]:!![],'where':_0x4b0bdc[_0xced3('0x18')]?_0x4b0bdc[_0xced3('0x18')][_0xced3('0x1e')]||null:null,'attributes':[[_0xced3('0x2e'),_0xced3('0x2f')],[db['sequelize']['fn'](_0xced3('0x20'),db[_0xced3('0x1f')][_0xced3('0x45')]('id')),_0xced3('0x46')],[db[_0xced3('0x1f')]['fn'](_0xced3('0x20'),db['sequelize']['fn']('IF',db[_0xced3('0x1f')][_0xced3('0x22')](_0xced3('0x23')))),_0xced3('0x47')]],'group':[_0xced3('0x2e')]})[_0xced3('0x1a')](function(_0x56b18e){logger[_0xced3('0xb')]('GetCampaignHopperHistory',_0x4b0bdc);logger[_0xced3('0xe')]('GetCampaignHopperHistory',_0x4b0bdc,JSON[_0xced3('0xf')](_0x56b18e));_0x4cfd9a(_0x56b18e);})[_0xced3('0x14')](function(_0x48f1b3){logger[_0xced3('0x10')](_0xced3('0x44'),_0x48f1b3[_0xced3('0x12')],_0x4b0bdc);_0x1cd21f(_0x12c991[_0xced3('0x10')](0x1f4,_0x48f1b3[_0xced3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index a680ad4..870a08f 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 _0x9d56=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout'];(function(_0x137df7,_0x3272d3){var _0x56c33a=function(_0x4ff645){while(--_0x4ff645){_0x137df7['push'](_0x137df7['shift']());}};_0x56c33a(++_0x3272d3);}(_0x9d56,0x122));var _0x69d5=function(_0xe4587a,_0x3a122d){_0xe4587a=_0xe4587a-0x0;var _0x3cd26b=_0x9d56[_0xe4587a];return _0x3cd26b;};'use strict';var multer=require(_0x69d5('0x0'));var util=require(_0x69d5('0x1'));var path=require(_0x69d5('0x2'));var timeout=require(_0x69d5('0x3'));var express=require('express');var router=express[_0x69d5('0x4')]();var auth=require(_0x69d5('0x5'));var interaction=require(_0x69d5('0x6'));var config=require(_0x69d5('0x7'));var controller=require(_0x69d5('0x8'));router['get']('/',auth[_0x69d5('0x9')](),controller[_0x69d5('0xa')]);router[_0x69d5('0xb')](_0x69d5('0xc'),auth[_0x69d5('0x9')](),controller[_0x69d5('0xd')]);router[_0x69d5('0xb')](_0x69d5('0xe'),auth[_0x69d5('0x9')](),controller[_0x69d5('0xf')]);router[_0x69d5('0x10')]('/',auth[_0x69d5('0x9')](),controller[_0x69d5('0x11')]);router[_0x69d5('0x12')](_0x69d5('0xe'),auth[_0x69d5('0x9')](),controller[_0x69d5('0x13')]);module[_0x69d5('0x14')]=router; \ No newline at end of file +var _0xe47d=['get','index','/describe','isAuthenticated','describe','/:id','show','post','create','put','update','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmHopperHistory.controller'];(function(_0x1c3370,_0xf617e8){var _0xa9b358=function(_0x39cb44){while(--_0x39cb44){_0x1c3370['push'](_0x1c3370['shift']());}};_0xa9b358(++_0xf617e8);}(_0xe47d,0x1c5));var _0xde47=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0xe47d[_0x1d2bbb];return _0x38082b;};'use strict';var multer=require(_0xde47('0x0'));var util=require(_0xde47('0x1'));var path=require(_0xde47('0x2'));var timeout=require(_0xde47('0x3'));var express=require(_0xde47('0x4'));var router=express[_0xde47('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xde47('0x6'));var config=require(_0xde47('0x7'));var controller=require(_0xde47('0x8'));router[_0xde47('0x9')]('/',auth['isAuthenticated'](),controller[_0xde47('0xa')]);router['get'](_0xde47('0xb'),auth[_0xde47('0xc')](),controller[_0xde47('0xd')]);router[_0xde47('0x9')](_0xde47('0xe'),auth['isAuthenticated'](),controller[_0xde47('0xf')]);router[_0xde47('0x10')]('/',auth[_0xde47('0xc')](),controller[_0xde47('0x11')]);router[_0xde47('0x12')](_0xde47('0xe'),auth[_0xde47('0xc')](),controller[_0xde47('0x13')]);module[_0xde47('0x14')]=router; \ No newline at end of file diff --git a/server/api/cmList/cmList.attributes.js b/server/api/cmList/cmList.attributes.js index f51233b..6f2d003 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 _0xa81a=['exports','name','STRING','sequelize'];(function(_0x8ef085,_0x2c7a48){var _0x436bad=function(_0x3f716f){while(--_0x3f716f){_0x8ef085['push'](_0x8ef085['shift']());}};_0x436bad(++_0x2c7a48);}(_0xa81a,0x1a7));var _0xaa81=function(_0x3bbd4e,_0x502b91){_0x3bbd4e=_0x3bbd4e-0x0;var _0x4dfeb8=_0xa81a[_0x3bbd4e];return _0x4dfeb8;};'use strict';var Sequelize=require(_0xaa81('0x0'));module[_0xaa81('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xaa81('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'dialPrefix':{'type':Sequelize[_0xaa81('0x3')]}}; \ No newline at end of file +var _0x4034=['STRING','sequelize','exports','name'];(function(_0x43adcb,_0x13b56d){var _0x2e4e77=function(_0x31f8a5){while(--_0x31f8a5){_0x43adcb['push'](_0x43adcb['shift']());}};_0x2e4e77(++_0x13b56d);}(_0x4034,0x191));var _0x4403=function(_0x4d05dd,_0x258cdd){_0x4d05dd=_0x4d05dd-0x0;var _0x1c5226=_0x4034[_0x4d05dd];return _0x1c5226;};'use strict';var Sequelize=require(_0x4403('0x0'));module[_0x4403('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x4403('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x4403('0x3')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index f11f501..580000a 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 _0x70e0=['offset','limit','apply','reject','update','then','destroy','end','error','stack','name','send','map','CmList','rawAttributes','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','filter','where','type','merge','includeAll','include','catch','show','params','keys','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','Disposition','findOne','rows','removeDispositions','addContacts','tags','join','isArray','ListId','push','each','CmContact','omit','ids','success','dataValues','errors','message','Malformed\x20request\x20syntax','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','hasOwnProperty','isEmpty','/tmp/list_%d_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','download','addCustomField','sequelize','addCustomFields','Sequelize','TEXT','text','number','INTEGER','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','cf_%s','getCustomFields','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./cmList.socket','sendStatus','status','count'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x70e0,0x17b));var _0x070e=function(_0x5572f0,_0x47cb29){_0x5572f0=_0x5572f0-0x0;var _0x2e670b=_0x70e0[_0x5572f0];return _0x2e670b;};'use strict';var pdf=require(_0x070e('0x0'));var emlformat=require(_0x070e('0x1'));var rimraf=require(_0x070e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x070e('0x3'));var moment=require(_0x070e('0x4'));var BPromise=require(_0x070e('0x5'));var Mustache=require(_0x070e('0x6'));var util=require('util');var path=require(_0x070e('0x7'));var sox=require('sox');var csv=require(_0x070e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x070e('0x9'));var jsforce=require(_0x070e('0xa'));var deskjs=require(_0x070e('0xb'));var toCsv=require(_0x070e('0x8'));var querystring=require(_0x070e('0xc'));var Papa=require(_0x070e('0xd'));var Redis=require(_0x070e('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x070e('0xf'));var hardwareService=require(_0x070e('0x10'));var logger=require(_0x070e('0x11'))(_0x070e('0x12'));var utils=require(_0x070e('0x13'));var config=require(_0x070e('0x14'));var db=require(_0x070e('0x15'))['db'];config[_0x070e('0x16')]=_[_0x070e('0x17')](config[_0x070e('0x16')],{'host':_0x070e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x070e('0x19'))['register'](socket);function respondWithStatusCode(_0x4a33d2,_0x5bae0f){_0x5bae0f=_0x5bae0f||0xcc;return function(_0x11d2ce){if(_0x11d2ce){return _0x4a33d2[_0x070e('0x1a')](_0x5bae0f);}return _0x4a33d2['status'](_0x5bae0f)['end']();};}function respondWithResult(_0x373d86,_0xeae1a5){_0xeae1a5=_0xeae1a5||0xc8;return function(_0x180897){if(_0x180897){return _0x373d86[_0x070e('0x1b')](_0xeae1a5)['json'](_0x180897);}};}function respondWithFilteredResult(_0x49861b,_0x17e2e4){return function(_0x2bd937){if(_0x2bd937){var _0x38f6e6=_0x2bd937[_0x070e('0x1c')],_0x2060cc=_0x17e2e4[_0x070e('0x1d')],_0x364b3f=_0x17e2e4[_0x070e('0x1d')]+_0x17e2e4[_0x070e('0x1e')],_0x5037eb;if(_0x364b3f>=_0x38f6e6){_0x364b3f=_0x38f6e6;_0x5037eb=0xc8;}else{_0x5037eb=0xce;}_0x49861b[_0x070e('0x1b')](_0x5037eb);return _0x49861b['set']('Content-Range',_0x2060cc+'-'+_0x364b3f+'/'+_0x38f6e6)['json'](_0x2bd937);}return null;};}function patchUpdates(_0x9907cf){return function(_0x3004f0){try{jsonpatch[_0x070e('0x1f')](_0x3004f0,_0x9907cf,!![]);}catch(_0x4be0d7){return BPromise[_0x070e('0x20')](_0x4be0d7);}return _0x3004f0['save']();};}function saveUpdates(_0xf8dd5d,_0x3f6985){return function(_0x27a01e){if(_0x27a01e){return _0x27a01e[_0x070e('0x21')](_0xf8dd5d)[_0x070e('0x22')](function(_0xa86797){return _0xa86797;});}return null;};}function removeEntity(_0xe405e,_0x164cdf){return function(_0x595c7e){if(_0x595c7e){return _0x595c7e[_0x070e('0x23')]()[_0x070e('0x22')](function(){var _0x4790eb=_0x595c7e['get']({'plain':!![]});var _0xf17c56='Lists';return db['UserProfileResource'][_0x070e('0x23')]({'where':{'type':_0xf17c56,'resourceId':_0x4790eb['id']}})[_0x070e('0x22')](function(){return _0x595c7e;});})[_0x070e('0x22')](function(){_0xe405e[_0x070e('0x1b')](0xcc)[_0x070e('0x24')]();});}};}function handleEntityNotFound(_0x497f58,_0x374c54){return function(_0x219e48){if(!_0x219e48){_0x497f58[_0x070e('0x1a')](0x194);}return _0x219e48;};}function handleError(_0x1d2a34,_0x43dd96){_0x43dd96=_0x43dd96||0x1f4;return function(_0x28d7f2){logger[_0x070e('0x25')](_0x28d7f2[_0x070e('0x26')]);if(_0x28d7f2['name']){delete _0x28d7f2[_0x070e('0x27')];}_0x1d2a34[_0x070e('0x1b')](_0x43dd96)[_0x070e('0x28')](_0x28d7f2);};}exports['index']=function(_0x5c5f0d,_0x13097f){var _0x46065c={},_0xa6c0ab={},_0x51402c={'count':0x0,'rows':[]};var _0x3fa994=_[_0x070e('0x29')](db[_0x070e('0x2a')][_0x070e('0x2b')],function(_0x53d473){return{'name':_0x53d473['fieldName'],'type':_0x53d473['type']['key']};});_0xa6c0ab[_0x070e('0x2c')]=_['map'](_0x3fa994,_0x070e('0x27'));_0xa6c0ab[_0x070e('0x2d')]=_['keys'](_0x5c5f0d['query']);_0xa6c0ab[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0xa6c0ab['model'],_0xa6c0ab['query']);_0x46065c[_0x070e('0x30')]=_[_0x070e('0x2f')](_0xa6c0ab[_0x070e('0x2c')],qs[_0x070e('0x31')](_0x5c5f0d[_0x070e('0x2d')]['fields']));_0x46065c['attributes']=_0x46065c[_0x070e('0x30')][_0x070e('0x32')]?_0x46065c[_0x070e('0x30')]:_0xa6c0ab[_0x070e('0x2c')];if(!_0x5c5f0d[_0x070e('0x2d')]['hasOwnProperty'](_0x070e('0x33'))){_0x46065c[_0x070e('0x1e')]=qs['limit'](_0x5c5f0d[_0x070e('0x2d')][_0x070e('0x1e')]);_0x46065c['offset']=qs['offset'](_0x5c5f0d['query'][_0x070e('0x1d')]);}_0x46065c[_0x070e('0x34')]=qs[_0x070e('0x35')](_0x5c5f0d[_0x070e('0x2d')][_0x070e('0x35')]);_0x46065c['where']=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0x5c5f0d[_0x070e('0x2d')],_0xa6c0ab['filters']));if(_0x5c5f0d[_0x070e('0x2d')][_0x070e('0x37')]){_0x46065c[_0x070e('0x38')]=_['merge'](_0x46065c[_0x070e('0x38')],{'$or':_[_0x070e('0x29')](_0x3fa994,function(_0x4800a9){if(_0x4800a9[_0x070e('0x39')]!=='VIRTUAL'){var _0x18dae9={};_0x18dae9[_0x4800a9[_0x070e('0x27')]]={'$like':'%'+_0x5c5f0d[_0x070e('0x2d')][_0x070e('0x37')]+'%'};return _0x18dae9;}})});}_0x46065c=_[_0x070e('0x3a')]({},_0x46065c,_0x5c5f0d['options']);var _0xd18220={'where':_0x46065c['where']};return db['CmList'][_0x070e('0x1c')](_0xd18220)[_0x070e('0x22')](function(_0x38879f){_0x51402c['count']=_0x38879f;if(_0x5c5f0d[_0x070e('0x2d')][_0x070e('0x3b')]){_0x46065c[_0x070e('0x3c')]=[{'all':!![]}];}return db[_0x070e('0x2a')]['findAll'](_0x46065c);})[_0x070e('0x22')](function(_0x5851ab){_0x51402c['rows']=_0x5851ab;return _0x51402c;})['then'](respondWithFilteredResult(_0x13097f,_0x46065c))[_0x070e('0x3d')](handleError(_0x13097f,null));};exports[_0x070e('0x3e')]=function(_0x26b3e2,_0x29dccd){var _0x34f23e={'raw':![],'where':{'id':_0x26b3e2[_0x070e('0x3f')]['id']}},_0x562aa4={};_0x562aa4['model']=_[_0x070e('0x40')](db[_0x070e('0x2a')][_0x070e('0x2b')]);_0x562aa4['query']=_['keys'](_0x26b3e2[_0x070e('0x2d')]);_0x562aa4['filters']=_[_0x070e('0x2f')](_0x562aa4[_0x070e('0x2c')],_0x562aa4[_0x070e('0x2d')]);_0x34f23e['attributes']=_[_0x070e('0x2f')](_0x562aa4[_0x070e('0x2c')],qs['fields'](_0x26b3e2['query'][_0x070e('0x31')]));_0x34f23e[_0x070e('0x30')]=_0x34f23e[_0x070e('0x30')][_0x070e('0x32')]?_0x34f23e[_0x070e('0x30')]:_0x562aa4['model'];if(_0x26b3e2[_0x070e('0x2d')][_0x070e('0x3b')]){_0x34f23e[_0x070e('0x3c')]=[{'all':!![]}];}_0x34f23e=_[_0x070e('0x3a')]({},_0x34f23e,_0x26b3e2[_0x070e('0x41')]);return db[_0x070e('0x2a')][_0x070e('0x42')](_0x34f23e)[_0x070e('0x22')](handleEntityNotFound(_0x29dccd,null))[_0x070e('0x22')](respondWithResult(_0x29dccd,null))[_0x070e('0x3d')](handleError(_0x29dccd,null));};exports[_0x070e('0x43')]=function(_0x3be553,_0x5254f8){return db[_0x070e('0x2a')][_0x070e('0x43')](_0x3be553['body'],{})[_0x070e('0x22')](function(_0xa7a41b){var _0x40298a=_0x3be553[_0x070e('0x44')][_0x070e('0x45')]({'plain':!![]});if(!_0x40298a)throw new Error(_0x070e('0x46'));if(_0x40298a[_0x070e('0x47')]===_0x070e('0x44')){var _0x1c64d2=_0xa7a41b['get']({'plain':!![]});var _0x251696='Lists';return db[_0x070e('0x48')][_0x070e('0x42')]({'where':{'name':_0x251696,'userProfileId':_0x40298a['userProfileId']},'raw':!![]})[_0x070e('0x22')](function(_0x130a50){if(_0x130a50&&_0x130a50[_0x070e('0x49')]===0x0){return db[_0x070e('0x4a')][_0x070e('0x43')]({'name':_0x1c64d2[_0x070e('0x27')],'resourceId':_0x1c64d2['id'],'type':_0x130a50[_0x070e('0x27')],'sectionId':_0x130a50['id']},{})['then'](function(){return _0xa7a41b;});}else{return _0xa7a41b;}})[_0x070e('0x3d')](function(_0x5bacbd){logger['error'](_0x070e('0x4b'),_0x5bacbd);throw _0x5bacbd;});}return _0xa7a41b;})[_0x070e('0x22')](respondWithResult(_0x5254f8,0xc9))[_0x070e('0x3d')](handleError(_0x5254f8,null));};exports[_0x070e('0x21')]=function(_0x202015,_0x7948ed){if(_0x202015[_0x070e('0x4c')]['id']){delete _0x202015[_0x070e('0x4c')]['id'];}return db['CmList'][_0x070e('0x42')]({'where':{'id':_0x202015['params']['id']}})['then'](handleEntityNotFound(_0x7948ed,null))[_0x070e('0x22')](saveUpdates(_0x202015[_0x070e('0x4c')],null))['then'](respondWithResult(_0x7948ed,null))[_0x070e('0x3d')](handleError(_0x7948ed,null));};exports[_0x070e('0x23')]=function(_0x210f4a,_0x2f8104){return db[_0x070e('0x2a')][_0x070e('0x42')]({'where':{'id':_0x210f4a[_0x070e('0x3f')]['id']}})['then'](handleEntityNotFound(_0x2f8104,null))['then'](removeEntity(_0x2f8104,null))['catch'](handleError(_0x2f8104,null));};exports[_0x070e('0x4d')]=function(_0x1948a5,_0x29f497){return db[_0x070e('0x2a')]['describe']()[_0x070e('0x22')](respondWithResult(_0x29f497,null))['catch'](handleError(_0x29f497,null));};exports[_0x070e('0x4e')]=function(_0x1cbb7e,_0x476804,_0x24f303){if(_0x1cbb7e[_0x070e('0x4c')]['id']){delete _0x1cbb7e[_0x070e('0x4c')]['id'];}return db['CmList'][_0x070e('0x42')]({'where':{'id':_0x1cbb7e[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x476804,null))['then'](function(_0x1d7873){if(_0x1d7873){_0x1cbb7e[_0x070e('0x4c')]['ListId']=_0x1d7873['id'];return db[_0x070e('0x4f')]['create'](_0x1cbb7e[_0x070e('0x4c')]);}})['then'](respondWithResult(_0x476804,null))['catch'](handleError(_0x476804,null));};exports['getDispositions']=function(_0xbaf43e,_0x1ae5cb,_0x1100d8){var _0x122198={'raw':![],'where':{}};var _0x3cb9ee={};var _0x3a00bb={'count':0x0,'rows':[]};return db['CmList'][_0x070e('0x50')]({'where':{'id':_0xbaf43e['params']['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x1ae5cb,null))['then'](function(_0x2e10f7){if(_0x2e10f7){_0x3cb9ee[_0x070e('0x2c')]=_['keys'](db[_0x070e('0x4f')]['rawAttributes']);_0x3cb9ee[_0x070e('0x2d')]=_[_0x070e('0x40')](_0xbaf43e[_0x070e('0x2d')]);_0x3cb9ee[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x3cb9ee[_0x070e('0x2c')],_0x3cb9ee[_0x070e('0x2d')]);_0x122198[_0x070e('0x30')]=_[_0x070e('0x2f')](_0x3cb9ee[_0x070e('0x2c')],qs[_0x070e('0x31')](_0xbaf43e[_0x070e('0x2d')][_0x070e('0x31')]));_0x122198[_0x070e('0x30')]=_0x122198['attributes'][_0x070e('0x32')]?_0x122198[_0x070e('0x30')]:_0x3cb9ee[_0x070e('0x2c')];if(!_0xbaf43e[_0x070e('0x2d')]['hasOwnProperty'](_0x070e('0x33'))){_0x122198[_0x070e('0x1e')]=qs[_0x070e('0x1e')](_0xbaf43e[_0x070e('0x2d')][_0x070e('0x1e')]);_0x122198[_0x070e('0x1d')]=qs['offset'](_0xbaf43e[_0x070e('0x2d')][_0x070e('0x1d')]);}_0x122198[_0x070e('0x34')]=qs[_0x070e('0x35')](_0xbaf43e['query'][_0x070e('0x35')]);_0x122198['where']=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0xbaf43e[_0x070e('0x2d')],_0x3cb9ee[_0x070e('0x2e')]));_0x122198[_0x070e('0x38')]['ListId']=_0x2e10f7['id'];if(_0xbaf43e[_0x070e('0x2d')][_0x070e('0x37')]){_0x122198[_0x070e('0x38')]=_[_0x070e('0x3a')](_0x122198['where'],{'$or':_[_0x070e('0x29')](_0x122198['attributes'],function(_0x399055){var _0x44e465={};_0x44e465[_0x399055]={'$like':'%'+_0xbaf43e[_0x070e('0x2d')]['filter']+'%'};return _0x44e465;})});}_0x122198=_[_0x070e('0x3a')]({},_0x122198,_0xbaf43e['options']);return db[_0x070e('0x4f')]['count']({'where':_0x122198[_0x070e('0x38')]})[_0x070e('0x22')](function(_0x5cb168){_0x3a00bb[_0x070e('0x1c')]=_0x5cb168;if(_0xbaf43e['query'][_0x070e('0x3b')]){_0x122198[_0x070e('0x3c')]=[{'all':!![]}];}return db['Disposition']['findAll'](_0x122198);})[_0x070e('0x22')](function(_0x3022cd){_0x3a00bb[_0x070e('0x51')]=_0x3022cd;return _0x3a00bb;});}})[_0x070e('0x22')](respondWithFilteredResult(_0x1ae5cb,_0x122198))[_0x070e('0x3d')](handleError(_0x1ae5cb,null));};exports[_0x070e('0x52')]=function(_0x280d62,_0x332c8a,_0x25b599){return db[_0x070e('0x2a')][_0x070e('0x42')]({'where':{'id':_0x280d62[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x332c8a,null))['then'](function(_0x3308b5){if(_0x3308b5){return _0x3308b5[_0x070e('0x52')](_0x280d62['query']['ids']);}})[_0x070e('0x22')](respondWithStatusCode(_0x332c8a,null))[_0x070e('0x3d')](handleError(_0x332c8a,null));};exports[_0x070e('0x53')]=function(_0x24bbc7,_0x3b3e96,_0x12fe4f){return db[_0x070e('0x2a')][_0x070e('0x42')]({'where':{'id':_0x24bbc7[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x3b3e96,null))[_0x070e('0x22')](function(_0x2084a1){if(_0x2084a1){var _0x46ec49=[];var _0x595e2e={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x070e('0x22')](function(_0x2e4b4a){if(_0x24bbc7[_0x070e('0x4c')][_0x070e('0x54')]&&_['isArray'](_0x24bbc7[_0x070e('0x4c')][_0x070e('0x54')])){if(_0x24bbc7[_0x070e('0x4c')][_0x070e('0x54')][_0x070e('0x32')]){_0x24bbc7[_0x070e('0x4c')]['tags']=_0x24bbc7[_0x070e('0x4c')]['tags'][_0x070e('0x55')](';')+';';}else{_0x24bbc7[_0x070e('0x4c')][_0x070e('0x54')]=null;}}else{_0x24bbc7[_0x070e('0x4c')][_0x070e('0x54')]=null;}if(_0x24bbc7['body']&&_[_0x070e('0x56')](_0x24bbc7[_0x070e('0x4c')])){for(var _0x5d3bd8=0x0;_0x5d3bd8<_0x24bbc7[_0x070e('0x4c')][_0x070e('0x32')];_0x5d3bd8+=0x1){_0x24bbc7['body'][_0x5d3bd8][_0x070e('0x57')]=_0x24bbc7[_0x070e('0x3f')]['id'];_0x46ec49[_0x070e('0x58')](_0x24bbc7['body'][_0x5d3bd8]);}return BPromise[_0x070e('0x59')](_0x46ec49,function(_0xe8c476){return db[_0x070e('0x5a')][_0x070e('0x43')](_[_0x070e('0x5b')](_0xe8c476,[_0x070e('0x5c'),'id'])||{},{'fields':_[_0x070e('0x40')](_0x2e4b4a),'raw':!![]})[_0x070e('0x22')](function(_0x206b97){_0x595e2e[_0x070e('0x5d')][_0x070e('0x58')](_0x206b97[_0x070e('0x5e')]);})[_0x070e('0x3d')](function(_0x4b058d){_0x595e2e[_0x070e('0x5f')][_0x070e('0x58')]({'data':_0xe8c476,'error':_0x4b058d[_0x070e('0x60')]});});})[_0x070e('0x22')](function(_0x1dceda){return _0x595e2e;})[_0x070e('0x3d')](function(_0x5c4352){return _0x5c4352;});}else{_0x3b3e96['status'](0x190)['json']({'message':_0x070e('0x61')});}});}})[_0x070e('0x22')](respondWithResult(_0x3b3e96,null))[_0x070e('0x3d')](handleError(_0x3b3e96,null));};exports[_0x070e('0x62')]=function(_0x4b4b9a,_0x7f3f5,_0x20cd8a){var _0x370209;return db['CmList'][_0x070e('0x42')]({'where':{'id':_0x4b4b9a['params']['id']},'include':[{'model':db[_0x070e('0x63')],'as':_0x070e('0x64')}]})['then'](handleEntityNotFound(_0x7f3f5,null))['then'](function(_0x2048e9){if(_0x2048e9){_0x370209=_0x2048e9;return db[_0x070e('0x5a')]['rawAttributes'];}})[_0x070e('0x22')](function(_0x596beb){if(_0x596beb){var _0x4e8af1={};var _0x4caaa9={};_0x4caaa9[_0x070e('0x2c')]=_[_0x070e('0x65')](_[_0x070e('0x40')](_0x596beb),_[_0x070e('0x29')](_0x370209[_0x070e('0x64')],function(_0x341756){return util[_0x070e('0x66')](_0x070e('0x67'),_0x341756['id']);}));_0x4caaa9[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x4b4b9a[_0x070e('0x2d')]);_0x4caaa9[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x4caaa9[_0x070e('0x2c')],_0x4caaa9[_0x070e('0x2d')]);_0x4e8af1[_0x070e('0x30')]=_[_0x070e('0x2f')](_0x4caaa9[_0x070e('0x2c')],qs[_0x070e('0x31')](_0x4b4b9a[_0x070e('0x2d')][_0x070e('0x31')]));_0x4e8af1[_0x070e('0x30')]=_0x4e8af1['attributes'][_0x070e('0x32')]?_0x4e8af1[_0x070e('0x30')]:_0x4caaa9[_0x070e('0x2c')];if(!_0x4b4b9a[_0x070e('0x2d')]['hasOwnProperty'](_0x070e('0x33'))){_0x4e8af1[_0x070e('0x1e')]=qs[_0x070e('0x1e')](_0x4b4b9a[_0x070e('0x2d')][_0x070e('0x1e')]);_0x4e8af1[_0x070e('0x1d')]=qs['offset'](_0x4b4b9a['query']['offset']);}_0x4e8af1[_0x070e('0x34')]=qs['sort'](_0x4b4b9a[_0x070e('0x2d')][_0x070e('0x35')]);_0x4e8af1['where']=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0x4b4b9a['query'],_0x4caaa9['filters']));_0x4e8af1[_0x070e('0x68')]=!![];if(_0x4b4b9a[_0x070e('0x2d')][_0x070e('0x37')]){_0x4e8af1[_0x070e('0x38')]=_[_0x070e('0x3a')](_0x4e8af1['where'],{'$or':_[_0x070e('0x29')](_0x4e8af1['attributes'],function(_0x44feba){var _0x1219b4={};_0x1219b4[_0x44feba]={'$like':'%'+_0x4b4b9a['query'][_0x070e('0x37')]+'%'};return _0x1219b4;})});}_0x4e8af1=_[_0x070e('0x3a')]({},_0x4e8af1,_0x4b4b9a[_0x070e('0x41')]);return _0x370209[_0x070e('0x62')](_0x4e8af1);}})[_0x070e('0x22')](respondWithResult(_0x7f3f5,null))[_0x070e('0x3d')](handleError(_0x7f3f5,null));};exports['getContactsCsv']=function(_0x41a3cc,_0x3b75f3,_0xde8455){var _0x1ba0de;return db[_0x070e('0x2a')]['find']({'where':{'id':_0x41a3cc[_0x070e('0x3f')]['id']},'include':[{'model':db[_0x070e('0x63')],'as':_0x070e('0x64')}]})[_0x070e('0x22')](handleEntityNotFound(_0x3b75f3,null))[_0x070e('0x22')](function(_0x31ceee){if(_0x31ceee){_0x1ba0de=_0x31ceee;return db[_0x070e('0x5a')][_0x070e('0x2b')];}})[_0x070e('0x22')](function(_0xfe61be){if(_0xfe61be){var _0x1e14b5={};var _0x2614b2={};_0x2614b2[_0x070e('0x2c')]=_[_0x070e('0x65')](_[_0x070e('0x40')](_0xfe61be),_[_0x070e('0x29')](_0x1ba0de['CustomFields'],function(_0x48fe1d){return util[_0x070e('0x66')](_0x070e('0x67'),_0x48fe1d['id']);}));_0x2614b2['query']=_['keys'](_0x41a3cc['query']);_0x2614b2['filters']=_[_0x070e('0x2f')](_0x2614b2[_0x070e('0x2c')],_0x2614b2[_0x070e('0x2d')]);_0x1e14b5[_0x070e('0x30')]=_[_0x070e('0x2f')](_0x2614b2[_0x070e('0x2c')],qs[_0x070e('0x31')](_0x41a3cc[_0x070e('0x2d')][_0x070e('0x31')]));_0x1e14b5[_0x070e('0x30')]=_0x1e14b5['attributes'][_0x070e('0x32')]?_0x1e14b5[_0x070e('0x30')]:_0x2614b2['model'];if(!_0x41a3cc[_0x070e('0x2d')][_0x070e('0x69')](_0x070e('0x33'))){_0x1e14b5[_0x070e('0x1e')]=qs['limit'](_0x41a3cc[_0x070e('0x2d')][_0x070e('0x1e')]);_0x1e14b5[_0x070e('0x1d')]=qs[_0x070e('0x1d')](_0x41a3cc['query'][_0x070e('0x1d')]);}_0x1e14b5[_0x070e('0x34')]=qs[_0x070e('0x35')](_0x41a3cc[_0x070e('0x2d')][_0x070e('0x35')]);_0x1e14b5[_0x070e('0x38')]=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0x41a3cc[_0x070e('0x2d')],_0x2614b2[_0x070e('0x2e')]));_0x1e14b5[_0x070e('0x68')]=!![];if(_0x41a3cc['query'][_0x070e('0x37')]){_0x1e14b5[_0x070e('0x38')]=_['merge'](_0x1e14b5['where'],{'$or':_[_0x070e('0x29')](_0x1e14b5['attributes'],function(_0x2c759a){var _0x24612f={};_0x24612f[_0x2c759a]={'$like':'%'+_0x41a3cc[_0x070e('0x2d')][_0x070e('0x37')]+'%'};return _0x24612f;})});}_0x1e14b5=_[_0x070e('0x3a')]({},_0x1e14b5,_0x41a3cc[_0x070e('0x41')]);return _0x1ba0de[_0x070e('0x62')](_0x1e14b5);}})['then'](function(_0x20493c){if(!_[_0x070e('0x6a')](_0x20493c)){var _0x2543df=toCsv(_0x20493c);var _0x2a80bd=Date['now']();fs['writeFileSync'](util[_0x070e('0x66')](_0x070e('0x6b'),_0x1ba0de['id'],_0x2a80bd),_0x2543df);_0x3b75f3[_0x070e('0x6c')]('Content-disposition',_0x070e('0x6d')+util[_0x070e('0x66')]('list_%d_%s.csv',_0x1ba0de['id'],_0x2a80bd));_0x3b75f3[_0x070e('0x6c')](_0x070e('0x6e'),_0x070e('0x6f'));return _0x3b75f3[_0x070e('0x70')](util[_0x070e('0x66')](_0x070e('0x6b'),_0x1ba0de['id'],_0x2a80bd));}else{return _0x3b75f3['sendStatus'](0xcc);}})['catch'](handleError(_0x3b75f3,null));};exports[_0x070e('0x71')]=function(_0x54b6af,_0xc7f214,_0x270d47){var _0x4cf2b8;delete _0x54b6af[_0x070e('0x4c')]['id'];return db['CmList'][_0x070e('0x50')]({'where':{'id':_0x54b6af[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0xc7f214,null))[_0x070e('0x22')](function(_0x207a7a){if(_0x207a7a){return db[_0x070e('0x72')]['transaction'](function(_0x434723){return db[_0x070e('0x63')]['create'](_0x54b6af['body'],{'transaction':_0x434723})[_0x070e('0x22')](function(_0x8e9b5c){_0x4cf2b8=_0x8e9b5c;return _0x207a7a[_0x070e('0x73')](_0x8e9b5c,{'transaction':_0x434723});})[_0x070e('0x22')](function(){var _0x3893a5={'type':db[_0x070e('0x74')][_0x070e('0x75')],'transaction':_0x434723};switch(_0x54b6af[_0x070e('0x4c')]['type']){case _0x070e('0x76'):_0x3893a5[_0x070e('0x39')]=db[_0x070e('0x74')][_0x070e('0x75')];break;case _0x070e('0x77'):_0x3893a5[_0x070e('0x39')]=db[_0x070e('0x74')][_0x070e('0x78')];break;case'switch':_0x3893a5[_0x070e('0x39')]=db[_0x070e('0x74')][_0x070e('0x79')];_0x3893a5[_0x070e('0x7a')]=![];break;default:}return db[_0x070e('0x72')][_0x070e('0x7b')][_0x070e('0x7c')](_0x070e('0x7d'),util[_0x070e('0x66')](_0x070e('0x7e'),_0x4cf2b8['id']),_0x3893a5);})['then'](function(){return _0x4cf2b8;});});}})['then'](respondWithResult(_0xc7f214,null))[_0x070e('0x3d')](handleError(_0xc7f214,null));};exports[_0x070e('0x7f')]=function(_0x256105,_0x567202,_0xefd35a){var _0x36dfb5={};var _0x5f00d0={};var _0x26901c;var _0x2b6909;return db[_0x070e('0x2a')][_0x070e('0x50')]({'where':{'id':_0x256105[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x567202,null))['then'](function(_0x4de58b){if(_0x4de58b){_0x26901c=_0x4de58b;_0x5f00d0[_0x070e('0x2c')]=_[_0x070e('0x40')](db['CmCustomField'][_0x070e('0x2b')]);_0x5f00d0[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x256105[_0x070e('0x2d')]);_0x5f00d0[_0x070e('0x2e')]=_[_0x070e('0x2f')](_0x5f00d0['model'],_0x5f00d0[_0x070e('0x2d')]);_0x36dfb5[_0x070e('0x30')]=_['intersection'](_0x5f00d0[_0x070e('0x2c')],qs[_0x070e('0x31')](_0x256105[_0x070e('0x2d')][_0x070e('0x31')]));_0x36dfb5['attributes']=_0x36dfb5['attributes'][_0x070e('0x32')]?_0x36dfb5[_0x070e('0x30')]:_0x5f00d0[_0x070e('0x2c')];_0x36dfb5[_0x070e('0x34')]=qs[_0x070e('0x35')](_0x256105[_0x070e('0x2d')][_0x070e('0x35')]);_0x36dfb5[_0x070e('0x38')]=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0x256105['query'],_0x5f00d0[_0x070e('0x2e')]));_0x36dfb5[_0x070e('0x38')]=_[_0x070e('0x3a')](_0x36dfb5[_0x070e('0x38')],{'$or':[{'ListId':_0x4de58b['id']},{'ListId':null}]});if(_0x256105['query'][_0x070e('0x37')]){_0x36dfb5[_0x070e('0x38')]=_['merge'](_0x36dfb5['where'],{'$or':_[_0x070e('0x29')](_0x36dfb5[_0x070e('0x30')],function(_0x1abf03){var _0x5f0d6a={};_0x5f0d6a[_0x1abf03]={'$like':'%'+_0x256105[_0x070e('0x2d')][_0x070e('0x37')]+'%'};return _0x5f0d6a;})});}_0x36dfb5=_[_0x070e('0x3a')]({},_0x36dfb5,_0x256105[_0x070e('0x41')]);return db[_0x070e('0x63')]['findAndCountAll'](_0x36dfb5);}})[_0x070e('0x22')](respondWithResult(_0x567202,null))[_0x070e('0x3d')](handleError(_0x567202,null));};exports['addAgents']=function(_0x2a94f9,_0x4b3fbc,_0x5326f2){return db['CmList'][_0x070e('0x42')]({'where':{'id':_0x2a94f9[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x4b3fbc,null))[_0x070e('0x22')](function(_0x4f5c50){if(_0x4f5c50){return _0x4f5c50[_0x070e('0x80')](_0x2a94f9[_0x070e('0x4c')]['ids'],_[_0x070e('0x5b')](_0x2a94f9[_0x070e('0x4c')],[_0x070e('0x5c'),'id'])||{})[_0x070e('0x81')](function(_0x4ea0a6){for(var _0x445182=0x0;_0x445182<_0x2a94f9['body'][_0x070e('0x5c')]['length'];_0x445182+=0x1){socket[_0x070e('0x82')](_0x070e('0x83'),{'UserId':_0x2a94f9[_0x070e('0x4c')]['ids'][_0x445182],'CmListId':_0x2a94f9[_0x070e('0x3f')]['id']});}return _0x4ea0a6;});}})[_0x070e('0x22')](respondWithResult(_0x4b3fbc,null))[_0x070e('0x3d')](handleError(_0x4b3fbc,null));};exports['removeAgents']=function(_0xbaed32,_0x3a5086,_0x52545e){return db[_0x070e('0x2a')][_0x070e('0x42')]({'where':{'id':_0xbaed32['params']['id']}})['then'](handleEntityNotFound(_0x3a5086,null))['then'](function(_0x5e1fee){if(_0x5e1fee){return _0x5e1fee[_0x070e('0x84')](_0xbaed32[_0x070e('0x2d')][_0x070e('0x5c')])[_0x070e('0x22')](function(){if(_[_0x070e('0x56')](_0xbaed32[_0x070e('0x2d')][_0x070e('0x5c')])){for(var _0x472fc9=0x0;_0x472fc9<_0xbaed32['query']['ids']['length'];_0x472fc9+=0x1){socket['emit'](_0x070e('0x85'),{'UserId':Number(_0xbaed32[_0x070e('0x2d')][_0x070e('0x5c')][_0x472fc9]),'CmListId':Number(_0xbaed32[_0x070e('0x3f')]['id'])});}}else{socket[_0x070e('0x82')]('userCmList:remove',{'UserId':Number(_0xbaed32['query'][_0x070e('0x5c')]),'CmListId':Number(_0xbaed32[_0x070e('0x3f')]['id'])});}});}})['then'](respondWithStatusCode(_0x3a5086,null))[_0x070e('0x3d')](handleError(_0x3a5086,null));};exports[_0x070e('0x86')]=function(_0x239385,_0x75ea53,_0x38b0e1){var _0x15b1f6={};var _0x5e71ab={};var _0x202ebf;var _0x1d48a9;return db[_0x070e('0x2a')]['findOne']({'where':{'id':_0x239385[_0x070e('0x3f')]['id']}})[_0x070e('0x22')](handleEntityNotFound(_0x75ea53,null))[_0x070e('0x22')](function(_0x281b3d){if(_0x281b3d){_0x202ebf=_0x281b3d;_0x5e71ab['model']=_[_0x070e('0x40')](db[_0x070e('0x87')]['rawAttributes']);_0x5e71ab[_0x070e('0x2d')]=_[_0x070e('0x40')](_0x239385['query']);_0x5e71ab[_0x070e('0x2e')]=_['intersection'](_0x5e71ab[_0x070e('0x2c')],_0x5e71ab['query']);_0x15b1f6[_0x070e('0x30')]=_['intersection'](_0x5e71ab['model'],qs[_0x070e('0x31')](_0x239385['query']['fields']));_0x15b1f6[_0x070e('0x30')]=_0x15b1f6[_0x070e('0x30')][_0x070e('0x32')]?_0x15b1f6[_0x070e('0x30')]:_0x5e71ab[_0x070e('0x2c')];_0x15b1f6['order']=qs[_0x070e('0x35')](_0x239385[_0x070e('0x2d')][_0x070e('0x35')]);_0x15b1f6[_0x070e('0x38')]=qs[_0x070e('0x2e')](_[_0x070e('0x36')](_0x239385['query'],_0x5e71ab[_0x070e('0x2e')]));if(_0x239385[_0x070e('0x2d')][_0x070e('0x37')]){_0x15b1f6[_0x070e('0x38')]=_['merge'](_0x15b1f6['where'],{'$or':_[_0x070e('0x29')](_0x15b1f6[_0x070e('0x30')],function(_0x287f59){var _0xacac33={};_0xacac33[_0x287f59]={'$like':'%'+_0x239385[_0x070e('0x2d')][_0x070e('0x37')]+'%'};return _0xacac33;})});}_0x15b1f6=_['merge']({},_0x15b1f6,_0x239385[_0x070e('0x41')]);return _0x202ebf[_0x070e('0x86')](_0x15b1f6);}})[_0x070e('0x22')](function(_0x3a894e){if(_0x3a894e){_0x1d48a9=_0x3a894e[_0x070e('0x32')];if(!_0x239385[_0x070e('0x2d')]['hasOwnProperty']('nolimit')){_0x15b1f6[_0x070e('0x1e')]=qs[_0x070e('0x1e')](_0x239385[_0x070e('0x2d')][_0x070e('0x1e')]);_0x15b1f6[_0x070e('0x1d')]=qs[_0x070e('0x1d')](_0x239385[_0x070e('0x2d')]['offset']);}return _0x202ebf[_0x070e('0x86')](_0x15b1f6);}})['then'](function(_0xfe12a6){if(_0xfe12a6){return _0xfe12a6?{'count':_0x1d48a9,'rows':_0xfe12a6}:null;}})['then'](respondWithResult(_0x75ea53,null))['catch'](handleError(_0x75ea53,null));}; \ No newline at end of file +var _0xa9e0=['addAgents','spread','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmList.socket','register','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','CmList','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','pick','filter','where','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','ListId','findOne','Disposition','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','errors','message','CmCustomField','CustomFields','concat','format','cf_%d','nolimit','raw','getContacts','isEmpty','now','/tmp/list_%d_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Content-type','text/csv','addCustomField','sequelize','transaction','addCustomFields','TEXT','text','Sequelize','number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','cf_%s','getCustomFields','findAndCountAll'];(function(_0x373e5e,_0x1b41b8){var _0x1f43ce=function(_0x222d6c){while(--_0x222d6c){_0x373e5e['push'](_0x373e5e['shift']());}};_0x1f43ce(++_0x1b41b8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);function respondWithStatusCode(_0x2b4227,_0x281129){_0x281129=_0x281129||0xcc;return function(_0x44dcfd){if(_0x44dcfd){return _0x2b4227[_0x0a9e('0x1a')](_0x281129);}return _0x2b4227['status'](_0x281129)[_0x0a9e('0x1b')]();};}function respondWithResult(_0x5d0880,_0x1985b6){_0x1985b6=_0x1985b6||0xc8;return function(_0x519dfd){if(_0x519dfd){return _0x5d0880[_0x0a9e('0x1c')](_0x1985b6)[_0x0a9e('0x1d')](_0x519dfd);}};}function respondWithFilteredResult(_0x48f32d,_0x225616){return function(_0x5a0a06){if(_0x5a0a06){var _0x459eb1=_0x5a0a06[_0x0a9e('0x1e')],_0x478723=_0x225616[_0x0a9e('0x1f')],_0x106033=_0x225616[_0x0a9e('0x1f')]+_0x225616[_0x0a9e('0x20')],_0x205fd6;if(_0x106033>=_0x459eb1){_0x106033=_0x459eb1;_0x205fd6=0xc8;}else{_0x205fd6=0xce;}_0x48f32d[_0x0a9e('0x1c')](_0x205fd6);return _0x48f32d[_0x0a9e('0x21')](_0x0a9e('0x22'),_0x478723+'-'+_0x106033+'/'+_0x459eb1)[_0x0a9e('0x1d')](_0x5a0a06);}return null;};}function patchUpdates(_0x4bb1e3){return function(_0x2c3407){try{jsonpatch[_0x0a9e('0x23')](_0x2c3407,_0x4bb1e3,!![]);}catch(_0x53682f){return BPromise[_0x0a9e('0x24')](_0x53682f);}return _0x2c3407['save']();};}function saveUpdates(_0x588269,_0x3a02e1){return function(_0x432e56){if(_0x432e56){return _0x432e56[_0x0a9e('0x25')](_0x588269)[_0x0a9e('0x26')](function(_0x4abc77){return _0x4abc77;});}return null;};}function removeEntity(_0xfb6e48,_0x2fb0e4){return function(_0x3b45bc){if(_0x3b45bc){return _0x3b45bc[_0x0a9e('0x27')]()[_0x0a9e('0x26')](function(){var _0x42ac8f=_0x3b45bc[_0x0a9e('0x28')]({'plain':!![]});var _0x5ea472='Lists';return db[_0x0a9e('0x29')][_0x0a9e('0x27')]({'where':{'type':_0x5ea472,'resourceId':_0x42ac8f['id']}})[_0x0a9e('0x26')](function(){return _0x3b45bc;});})[_0x0a9e('0x26')](function(){_0xfb6e48['status'](0xcc)[_0x0a9e('0x1b')]();});}};}function handleEntityNotFound(_0x479bc4,_0x45a1e7){return function(_0x5bfb33){if(!_0x5bfb33){_0x479bc4[_0x0a9e('0x1a')](0x194);}return _0x5bfb33;};}function handleError(_0x34dc65,_0x25fba9){_0x25fba9=_0x25fba9||0x1f4;return function(_0x14433c){logger[_0x0a9e('0x2a')](_0x14433c[_0x0a9e('0x2b')]);if(_0x14433c[_0x0a9e('0x2c')]){delete _0x14433c[_0x0a9e('0x2c')];}_0x34dc65['status'](_0x25fba9)[_0x0a9e('0x2d')](_0x14433c);};}exports[_0x0a9e('0x2e')]=function(_0x2b1f27,_0x2ec755){var _0x5c877d={},_0x15b200={},_0x40e7a3={'count':0x0,'rows':[]};var _0x1843b2=_[_0x0a9e('0x2f')](db[_0x0a9e('0x30')][_0x0a9e('0x31')],function(_0x296f41){return{'name':_0x296f41[_0x0a9e('0x32')],'type':_0x296f41[_0x0a9e('0x33')]['key']};});_0x15b200[_0x0a9e('0x34')]=_['map'](_0x1843b2,_0x0a9e('0x2c'));_0x15b200[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2b1f27[_0x0a9e('0x35')]);_0x15b200[_0x0a9e('0x37')]=_['intersection'](_0x15b200[_0x0a9e('0x34')],_0x15b200[_0x0a9e('0x35')]);_0x5c877d[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x15b200[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5c877d['attributes']=_0x5c877d[_0x0a9e('0x38')]['length']?_0x5c877d[_0x0a9e('0x38')]:_0x15b200[_0x0a9e('0x34')];if(!_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5c877d[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x5c877d['offset']=qs['offset'](_0x2b1f27[_0x0a9e('0x35')]['offset']);}_0x5c877d[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5c877d['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2b1f27[_0x0a9e('0x35')],_0x15b200['filters']));if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5c877d[_0x0a9e('0x40')]=_['merge'](_0x5c877d['where'],{'$or':_[_0x0a9e('0x2f')](_0x1843b2,function(_0x40d766){if(_0x40d766['type']!==_0x0a9e('0x41')){var _0x419125={};_0x419125[_0x40d766[_0x0a9e('0x2c')]]={'$like':'%'+_0x2b1f27[_0x0a9e('0x35')]['filter']+'%'};return _0x419125;}})});}_0x5c877d=_['merge']({},_0x5c877d,_0x2b1f27[_0x0a9e('0x42')]);var _0x45b3d0={'where':_0x5c877d['where']};return db[_0x0a9e('0x30')][_0x0a9e('0x1e')](_0x45b3d0)[_0x0a9e('0x26')](function(_0x5b4f5e){_0x40e7a3[_0x0a9e('0x1e')]=_0x5b4f5e;if(_0x2b1f27[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5c877d[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x30')][_0x0a9e('0x45')](_0x5c877d);})[_0x0a9e('0x26')](function(_0x45a9b8){_0x40e7a3[_0x0a9e('0x46')]=_0x45a9b8;return _0x40e7a3;})[_0x0a9e('0x26')](respondWithFilteredResult(_0x2ec755,_0x5c877d))[_0x0a9e('0x47')](handleError(_0x2ec755,null));};exports[_0x0a9e('0x48')]=function(_0x1a7bce,_0x11ca30){var _0x37f6cc={'raw':![],'where':{'id':_0x1a7bce['params']['id']}},_0x4d04c8={};_0x4d04c8[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x30')][_0x0a9e('0x31')]);_0x4d04c8[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x1a7bce[_0x0a9e('0x35')]);_0x4d04c8[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4d04c8[_0x0a9e('0x34')],_0x4d04c8[_0x0a9e('0x35')]);_0x37f6cc[_0x0a9e('0x38')]=_['intersection'](_0x4d04c8[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7bce[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x37f6cc[_0x0a9e('0x38')]=_0x37f6cc[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x37f6cc[_0x0a9e('0x38')]:_0x4d04c8['model'];if(_0x1a7bce[_0x0a9e('0x35')]['includeAll']){_0x37f6cc[_0x0a9e('0x44')]=[{'all':!![]}];}_0x37f6cc=_[_0x0a9e('0x4a')]({},_0x37f6cc,_0x1a7bce[_0x0a9e('0x42')]);return db['CmList'][_0x0a9e('0x4b')](_0x37f6cc)[_0x0a9e('0x26')](handleEntityNotFound(_0x11ca30,null))[_0x0a9e('0x26')](respondWithResult(_0x11ca30,null))[_0x0a9e('0x47')](handleError(_0x11ca30,null));};exports[_0x0a9e('0x4c')]=function(_0x37be73,_0x45bf7f){return db['CmList'][_0x0a9e('0x4c')](_0x37be73[_0x0a9e('0x4d')],{})[_0x0a9e('0x26')](function(_0x16f976){var _0x409789=_0x37be73[_0x0a9e('0x4e')][_0x0a9e('0x28')]({'plain':!![]});if(!_0x409789)throw new Error(_0x0a9e('0x4f'));if(_0x409789[_0x0a9e('0x50')]==='user'){var _0xe401a=_0x16f976[_0x0a9e('0x28')]({'plain':!![]});var _0x4f7240='Lists';return db['UserProfileSection'][_0x0a9e('0x4b')]({'where':{'name':_0x4f7240,'userProfileId':_0x409789[_0x0a9e('0x51')]},'raw':!![]})[_0x0a9e('0x26')](function(_0x11545a){if(_0x11545a&&_0x11545a[_0x0a9e('0x52')]===0x0){return db[_0x0a9e('0x29')][_0x0a9e('0x4c')]({'name':_0xe401a[_0x0a9e('0x2c')],'resourceId':_0xe401a['id'],'type':_0x11545a['name'],'sectionId':_0x11545a['id']},{})['then'](function(){return _0x16f976;});}else{return _0x16f976;}})['catch'](function(_0x39d77d){logger[_0x0a9e('0x2a')](_0x0a9e('0x53'),_0x39d77d);throw _0x39d77d;});}return _0x16f976;})['then'](respondWithResult(_0x45bf7f,0xc9))[_0x0a9e('0x47')](handleError(_0x45bf7f,null));};exports[_0x0a9e('0x25')]=function(_0x53d113,_0x5a88da){if(_0x53d113[_0x0a9e('0x4d')]['id']){delete _0x53d113['body']['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x53d113[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5a88da,null))[_0x0a9e('0x26')](saveUpdates(_0x53d113['body'],null))[_0x0a9e('0x26')](respondWithResult(_0x5a88da,null))[_0x0a9e('0x47')](handleError(_0x5a88da,null));};exports['destroy']=function(_0x50f687,_0x128aa6){return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x50f687[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x128aa6,null))[_0x0a9e('0x26')](removeEntity(_0x128aa6,null))['catch'](handleError(_0x128aa6,null));};exports[_0x0a9e('0x55')]=function(_0x4a6deb,_0x5da27d){return db['CmList'][_0x0a9e('0x55')]()['then'](respondWithResult(_0x5da27d,null))[_0x0a9e('0x47')](handleError(_0x5da27d,null));};exports[_0x0a9e('0x56')]=function(_0x3cfd00,_0x19b4df,_0x232830){if(_0x3cfd00[_0x0a9e('0x4d')]['id']){delete _0x3cfd00[_0x0a9e('0x4d')]['id'];}return db[_0x0a9e('0x30')]['find']({'where':{'id':_0x3cfd00[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x19b4df,null))[_0x0a9e('0x26')](function(_0x30c491){if(_0x30c491){_0x3cfd00[_0x0a9e('0x4d')][_0x0a9e('0x57')]=_0x30c491['id'];return db['Disposition'][_0x0a9e('0x4c')](_0x3cfd00[_0x0a9e('0x4d')]);}})['then'](respondWithResult(_0x19b4df,null))[_0x0a9e('0x47')](handleError(_0x19b4df,null));};exports['getDispositions']=function(_0x20c668,_0x5ba1f9,_0x4b3c1a){var _0x5674ee={'raw':![],'where':{}};var _0x273cb5={};var _0x49d231={'count':0x0,'rows':[]};return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x20c668[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5ba1f9,null))[_0x0a9e('0x26')](function(_0x26d7db){if(_0x26d7db){_0x273cb5['model']=_[_0x0a9e('0x36')](db['Disposition'][_0x0a9e('0x31')]);_0x273cb5[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x20c668['query']);_0x273cb5[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],_0x273cb5[_0x0a9e('0x35')]);_0x5674ee['attributes']=_[_0x0a9e('0x39')](_0x273cb5[_0x0a9e('0x34')],qs['fields'](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x5674ee[_0x0a9e('0x38')]=_0x5674ee[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x5674ee['attributes']:_0x273cb5[_0x0a9e('0x34')];if(!_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3b')]('nolimit')){_0x5674ee[_0x0a9e('0x20')]=qs['limit'](_0x20c668['query'][_0x0a9e('0x20')]);_0x5674ee[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x5674ee[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x5674ee[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x20c668[_0x0a9e('0x35')],_0x273cb5[_0x0a9e('0x37')]));_0x5674ee[_0x0a9e('0x40')][_0x0a9e('0x57')]=_0x26d7db['id'];if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x5674ee['where']=_[_0x0a9e('0x4a')](_0x5674ee[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x5674ee['attributes'],function(_0x1148a1){var _0x30944e={};_0x30944e[_0x1148a1]={'$like':'%'+_0x20c668['query'][_0x0a9e('0x3f')]+'%'};return _0x30944e;})});}_0x5674ee=_[_0x0a9e('0x4a')]({},_0x5674ee,_0x20c668[_0x0a9e('0x42')]);return db[_0x0a9e('0x59')][_0x0a9e('0x1e')]({'where':_0x5674ee['where']})['then'](function(_0x4a2438){_0x49d231[_0x0a9e('0x1e')]=_0x4a2438;if(_0x20c668[_0x0a9e('0x35')][_0x0a9e('0x43')]){_0x5674ee[_0x0a9e('0x44')]=[{'all':!![]}];}return db[_0x0a9e('0x59')][_0x0a9e('0x45')](_0x5674ee);})[_0x0a9e('0x26')](function(_0x1a0677){_0x49d231['rows']=_0x1a0677;return _0x49d231;});}})[_0x0a9e('0x26')](respondWithFilteredResult(_0x5ba1f9,_0x5674ee))[_0x0a9e('0x47')](handleError(_0x5ba1f9,null));};exports[_0x0a9e('0x5a')]=function(_0x4a4fc7,_0x2bdc44,_0x583b2e){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4a4fc7['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x2bdc44,null))[_0x0a9e('0x26')](function(_0x2cc7a7){if(_0x2cc7a7){return _0x2cc7a7[_0x0a9e('0x5a')](_0x4a4fc7['query'][_0x0a9e('0x5b')]);}})[_0x0a9e('0x26')](respondWithStatusCode(_0x2bdc44,null))[_0x0a9e('0x47')](handleError(_0x2bdc44,null));};exports[_0x0a9e('0x5c')]=function(_0x5b7fc3,_0x109ccb,_0x3d91db){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x5b7fc3['params']['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x109ccb,null))[_0x0a9e('0x26')](function(_0x30a4c7){if(_0x30a4c7){var _0xf410e5=[];var _0x332367={'success':[],'errors':[]};return db[_0x0a9e('0x5d')][_0x0a9e('0x55')]()[_0x0a9e('0x26')](function(_0x1a7b03){if(_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')]&&_[_0x0a9e('0x5f')](_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')])){if(_0x5b7fc3['body'][_0x0a9e('0x5e')][_0x0a9e('0x49')]){_0x5b7fc3[_0x0a9e('0x4d')]['tags']=_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x5e')][_0x0a9e('0x60')](';')+';';}else{_0x5b7fc3[_0x0a9e('0x4d')]['tags']=null;}}else{_0x5b7fc3['body'][_0x0a9e('0x5e')]=null;}if(_0x5b7fc3[_0x0a9e('0x4d')]&&_['isArray'](_0x5b7fc3[_0x0a9e('0x4d')])){for(var _0x53a6a1=0x0;_0x53a6a1<_0x5b7fc3[_0x0a9e('0x4d')][_0x0a9e('0x49')];_0x53a6a1+=0x1){_0x5b7fc3['body'][_0x53a6a1][_0x0a9e('0x57')]=_0x5b7fc3[_0x0a9e('0x54')]['id'];_0xf410e5[_0x0a9e('0x61')](_0x5b7fc3[_0x0a9e('0x4d')][_0x53a6a1]);}return BPromise[_0x0a9e('0x62')](_0xf410e5,function(_0x1f42a0){return db[_0x0a9e('0x5d')]['create'](_[_0x0a9e('0x63')](_0x1f42a0,[_0x0a9e('0x5b'),'id'])||{},{'fields':_[_0x0a9e('0x36')](_0x1a7b03),'raw':!![]})[_0x0a9e('0x26')](function(_0x492543){_0x332367[_0x0a9e('0x64')][_0x0a9e('0x61')](_0x492543['dataValues']);})[_0x0a9e('0x47')](function(_0x5b7940){_0x332367[_0x0a9e('0x65')][_0x0a9e('0x61')]({'data':_0x1f42a0,'error':_0x5b7940[_0x0a9e('0x66')]});});})[_0x0a9e('0x26')](function(_0x5af453){return _0x332367;})['catch'](function(_0x353384){return _0x353384;});}else{_0x109ccb[_0x0a9e('0x1c')](0x190)[_0x0a9e('0x1d')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x0a9e('0x26')](respondWithResult(_0x109ccb,null))[_0x0a9e('0x47')](handleError(_0x109ccb,null));};exports['getContacts']=function(_0x4e46b2,_0xf0a802,_0x56acca){var _0x5ea541;return db['CmList'][_0x0a9e('0x4b')]({'where':{'id':_0x4e46b2[_0x0a9e('0x54')]['id']},'include':[{'model':db[_0x0a9e('0x67')],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0xf0a802,null))[_0x0a9e('0x26')](function(_0x5a8854){if(_0x5a8854){_0x5ea541=_0x5a8854;return db[_0x0a9e('0x5d')]['rawAttributes'];}})[_0x0a9e('0x26')](function(_0x2aabab){if(_0x2aabab){var _0x18ad56={};var _0x4566b0={};_0x4566b0['model']=_[_0x0a9e('0x69')](_[_0x0a9e('0x36')](_0x2aabab),_[_0x0a9e('0x2f')](_0x5ea541['CustomFields'],function(_0xb6e411){return util[_0x0a9e('0x6a')](_0x0a9e('0x6b'),_0xb6e411['id']);}));_0x4566b0[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x4e46b2[_0x0a9e('0x35')]);_0x4566b0[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x4566b0['model'],_0x4566b0[_0x0a9e('0x35')]);_0x18ad56[_0x0a9e('0x38')]=_['intersection'](_0x4566b0[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x4e46b2[_0x0a9e('0x35')]['fields']));_0x18ad56[_0x0a9e('0x38')]=_0x18ad56['attributes'][_0x0a9e('0x49')]?_0x18ad56[_0x0a9e('0x38')]:_0x4566b0[_0x0a9e('0x34')];if(!_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3b')](_0x0a9e('0x6c'))){_0x18ad56[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x4e46b2['query'][_0x0a9e('0x20')]);_0x18ad56[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x18ad56[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x18ad56[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x4e46b2[_0x0a9e('0x35')],_0x4566b0['filters']));_0x18ad56[_0x0a9e('0x6d')]=!![];if(_0x4e46b2[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x18ad56[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x18ad56['where'],{'$or':_[_0x0a9e('0x2f')](_0x18ad56[_0x0a9e('0x38')],function(_0x5ce99d){var _0x23b447={};_0x23b447[_0x5ce99d]={'$like':'%'+_0x4e46b2['query'][_0x0a9e('0x3f')]+'%'};return _0x23b447;})});}_0x18ad56=_[_0x0a9e('0x4a')]({},_0x18ad56,_0x4e46b2[_0x0a9e('0x42')]);return _0x5ea541[_0x0a9e('0x6e')](_0x18ad56);}})['then'](respondWithResult(_0xf0a802,null))[_0x0a9e('0x47')](handleError(_0xf0a802,null));};exports['getContactsCsv']=function(_0x2ec396,_0x3d0a77,_0x5e5b89){var _0x231c6a;return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x2ec396['params']['id']},'include':[{'model':db['CmCustomField'],'as':_0x0a9e('0x68')}]})[_0x0a9e('0x26')](handleEntityNotFound(_0x3d0a77,null))[_0x0a9e('0x26')](function(_0x413190){if(_0x413190){_0x231c6a=_0x413190;return db[_0x0a9e('0x5d')][_0x0a9e('0x31')];}})[_0x0a9e('0x26')](function(_0x3c75b9){if(_0x3c75b9){var _0x3f8124={};var _0x586510={};_0x586510[_0x0a9e('0x34')]=_['concat'](_[_0x0a9e('0x36')](_0x3c75b9),_[_0x0a9e('0x2f')](_0x231c6a[_0x0a9e('0x68')],function(_0x28ce92){return util[_0x0a9e('0x6a')]('cf_%d',_0x28ce92['id']);}));_0x586510[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ec396[_0x0a9e('0x35')]);_0x586510[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x586510['model'],_0x586510['query']);_0x3f8124[_0x0a9e('0x38')]=_['intersection'](_0x586510[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x3f8124[_0x0a9e('0x38')]=_0x3f8124[_0x0a9e('0x38')]['length']?_0x3f8124['attributes']:_0x586510[_0x0a9e('0x34')];if(!_0x2ec396['query'][_0x0a9e('0x3b')]('nolimit')){_0x3f8124[_0x0a9e('0x20')]=qs['limit'](_0x2ec396['query'][_0x0a9e('0x20')]);_0x3f8124[_0x0a9e('0x1f')]=qs['offset'](_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x1f')]);}_0x3f8124[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ec396[_0x0a9e('0x35')]['sort']);_0x3f8124['where']=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x2ec396[_0x0a9e('0x35')],_0x586510[_0x0a9e('0x37')]));_0x3f8124[_0x0a9e('0x6d')]=!![];if(_0x2ec396['query'][_0x0a9e('0x3f')]){_0x3f8124[_0x0a9e('0x40')]=_['merge'](_0x3f8124[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3f8124[_0x0a9e('0x38')],function(_0x2427d5){var _0x23b25b={};_0x23b25b[_0x2427d5]={'$like':'%'+_0x2ec396[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x23b25b;})});}_0x3f8124=_[_0x0a9e('0x4a')]({},_0x3f8124,_0x2ec396[_0x0a9e('0x42')]);return _0x231c6a[_0x0a9e('0x6e')](_0x3f8124);}})['then'](function(_0x1065a7){if(!_[_0x0a9e('0x6f')](_0x1065a7)){var _0x2ada60=toCsv(_0x1065a7);var _0x1c4232=Date[_0x0a9e('0x70')]();fs['writeFileSync'](util['format'](_0x0a9e('0x71'),_0x231c6a['id'],_0x1c4232),_0x2ada60);_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x73'),_0x0a9e('0x74')+util[_0x0a9e('0x6a')]('list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));_0x3d0a77[_0x0a9e('0x72')](_0x0a9e('0x75'),_0x0a9e('0x76'));return _0x3d0a77['download'](util[_0x0a9e('0x6a')]('/tmp/list_%d_%s.csv',_0x231c6a['id'],_0x1c4232));}else{return _0x3d0a77[_0x0a9e('0x1a')](0xcc);}})['catch'](handleError(_0x3d0a77,null));};exports[_0x0a9e('0x77')]=function(_0x42b833,_0xe339b1,_0x5c500c){var _0xc9529d;delete _0x42b833['body']['id'];return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x42b833[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0xe339b1,null))[_0x0a9e('0x26')](function(_0x1bee04){if(_0x1bee04){return db[_0x0a9e('0x78')][_0x0a9e('0x79')](function(_0x2aaf07){return db[_0x0a9e('0x67')][_0x0a9e('0x4c')](_0x42b833[_0x0a9e('0x4d')],{'transaction':_0x2aaf07})[_0x0a9e('0x26')](function(_0x399def){_0xc9529d=_0x399def;return _0x1bee04[_0x0a9e('0x7a')](_0x399def,{'transaction':_0x2aaf07});})[_0x0a9e('0x26')](function(){var _0x5b93dd={'type':db['Sequelize'][_0x0a9e('0x7b')],'transaction':_0x2aaf07};switch(_0x42b833['body'][_0x0a9e('0x33')]){case _0x0a9e('0x7c'):_0x5b93dd['type']=db[_0x0a9e('0x7d')][_0x0a9e('0x7b')];break;case _0x0a9e('0x7e'):_0x5b93dd[_0x0a9e('0x33')]=db['Sequelize'][_0x0a9e('0x7f')];break;case _0x0a9e('0x80'):_0x5b93dd[_0x0a9e('0x33')]=db[_0x0a9e('0x7d')]['BOOLEAN'];_0x5b93dd[_0x0a9e('0x81')]=![];break;default:}return db[_0x0a9e('0x78')][_0x0a9e('0x82')]['addColumn'](_0x0a9e('0x83'),util[_0x0a9e('0x6a')](_0x0a9e('0x84'),_0xc9529d['id']),_0x5b93dd);})['then'](function(){return _0xc9529d;});});}})[_0x0a9e('0x26')](respondWithResult(_0xe339b1,null))[_0x0a9e('0x47')](handleError(_0xe339b1,null));};exports[_0x0a9e('0x85')]=function(_0x1a7f58,_0x2394d3,_0x555780){var _0x3211d2={};var _0x289e65={};var _0x4795ae;var _0x3bab3e;return db[_0x0a9e('0x30')][_0x0a9e('0x58')]({'where':{'id':_0x1a7f58['params']['id']}})['then'](handleEntityNotFound(_0x2394d3,null))['then'](function(_0x1015aa){if(_0x1015aa){_0x4795ae=_0x1015aa;_0x289e65[_0x0a9e('0x34')]=_['keys'](db[_0x0a9e('0x67')][_0x0a9e('0x31')]);_0x289e65[_0x0a9e('0x35')]=_['keys'](_0x1a7f58[_0x0a9e('0x35')]);_0x289e65[_0x0a9e('0x37')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],_0x289e65[_0x0a9e('0x35')]);_0x3211d2[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x289e65[_0x0a9e('0x34')],qs[_0x0a9e('0x3a')](_0x1a7f58['query'][_0x0a9e('0x3a')]));_0x3211d2['attributes']=_0x3211d2[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x3211d2[_0x0a9e('0x38')]:_0x289e65[_0x0a9e('0x34')];_0x3211d2[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x1a7f58['query'][_0x0a9e('0x3d')]);_0x3211d2[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_[_0x0a9e('0x3e')](_0x1a7f58['query'],_0x289e65[_0x0a9e('0x37')]));_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':[{'ListId':_0x1015aa['id']},{'ListId':null}]});if(_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x3211d2[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x3211d2[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x3211d2['attributes'],function(_0x2272bc){var _0x88b25f={};_0x88b25f[_0x2272bc]={'$like':'%'+_0x1a7f58[_0x0a9e('0x35')][_0x0a9e('0x3f')]+'%'};return _0x88b25f;})});}_0x3211d2=_[_0x0a9e('0x4a')]({},_0x3211d2,_0x1a7f58[_0x0a9e('0x42')]);return db[_0x0a9e('0x67')][_0x0a9e('0x86')](_0x3211d2);}})['then'](respondWithResult(_0x2394d3,null))[_0x0a9e('0x47')](handleError(_0x2394d3,null));};exports[_0x0a9e('0x87')]=function(_0x1a9ef1,_0x5c65fc,_0x1402c7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x1a9ef1[_0x0a9e('0x54')]['id']}})[_0x0a9e('0x26')](handleEntityNotFound(_0x5c65fc,null))[_0x0a9e('0x26')](function(_0x424f1b){if(_0x424f1b){return _0x424f1b[_0x0a9e('0x87')](_0x1a9ef1[_0x0a9e('0x4d')][_0x0a9e('0x5b')],_['omit'](_0x1a9ef1[_0x0a9e('0x4d')],[_0x0a9e('0x5b'),'id'])||{})[_0x0a9e('0x88')](function(_0x3db98f){for(var _0x2b624e=0x0;_0x2b624e<_0x1a9ef1[_0x0a9e('0x4d')]['ids'][_0x0a9e('0x49')];_0x2b624e+=0x1){socket['emit']('userCmList:save',{'UserId':_0x1a9ef1['body'][_0x0a9e('0x5b')][_0x2b624e],'CmListId':_0x1a9ef1[_0x0a9e('0x54')]['id']});}return _0x3db98f;});}})[_0x0a9e('0x26')](respondWithResult(_0x5c65fc,null))[_0x0a9e('0x47')](handleError(_0x5c65fc,null));};exports['removeAgents']=function(_0x4156a5,_0x309fa9,_0x3ddbc7){return db[_0x0a9e('0x30')][_0x0a9e('0x4b')]({'where':{'id':_0x4156a5['params']['id']}})['then'](handleEntityNotFound(_0x309fa9,null))[_0x0a9e('0x26')](function(_0x33bcb2){if(_0x33bcb2){return _0x33bcb2[_0x0a9e('0x89')](_0x4156a5['query'][_0x0a9e('0x5b')])[_0x0a9e('0x26')](function(){if(_[_0x0a9e('0x5f')](_0x4156a5['query'][_0x0a9e('0x5b')])){for(var _0x2bf85d=0x0;_0x2bf85d<_0x4156a5[_0x0a9e('0x35')]['ids'][_0x0a9e('0x49')];_0x2bf85d+=0x1){socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5['query']['ids'][_0x2bf85d]),'CmListId':Number(_0x4156a5['params']['id'])});}}else{socket[_0x0a9e('0x8a')](_0x0a9e('0x8b'),{'UserId':Number(_0x4156a5[_0x0a9e('0x35')][_0x0a9e('0x5b')]),'CmListId':Number(_0x4156a5['params']['id'])});}});}})[_0x0a9e('0x26')](respondWithStatusCode(_0x309fa9,null))['catch'](handleError(_0x309fa9,null));};exports[_0x0a9e('0x8c')]=function(_0x2ff2ab,_0x242f23,_0x57f673){var _0x33b4b3={};var _0x33a26c={};var _0xb8a476;var _0x580dd6;return db[_0x0a9e('0x30')]['findOne']({'where':{'id':_0x2ff2ab[_0x0a9e('0x54')]['id']}})['then'](handleEntityNotFound(_0x242f23,null))[_0x0a9e('0x26')](function(_0x57b7d4){if(_0x57b7d4){_0xb8a476=_0x57b7d4;_0x33a26c[_0x0a9e('0x34')]=_[_0x0a9e('0x36')](db[_0x0a9e('0x8d')][_0x0a9e('0x31')]);_0x33a26c[_0x0a9e('0x35')]=_[_0x0a9e('0x36')](_0x2ff2ab[_0x0a9e('0x35')]);_0x33a26c['filters']=_[_0x0a9e('0x39')](_0x33a26c[_0x0a9e('0x34')],_0x33a26c['query']);_0x33b4b3[_0x0a9e('0x38')]=_[_0x0a9e('0x39')](_0x33a26c['model'],qs[_0x0a9e('0x3a')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3a')]));_0x33b4b3['attributes']=_0x33b4b3[_0x0a9e('0x38')][_0x0a9e('0x49')]?_0x33b4b3[_0x0a9e('0x38')]:_0x33a26c[_0x0a9e('0x34')];_0x33b4b3[_0x0a9e('0x3c')]=qs[_0x0a9e('0x3d')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3d')]);_0x33b4b3[_0x0a9e('0x40')]=qs[_0x0a9e('0x37')](_['pick'](_0x2ff2ab[_0x0a9e('0x35')],_0x33a26c['filters']));if(_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x3f')]){_0x33b4b3[_0x0a9e('0x40')]=_[_0x0a9e('0x4a')](_0x33b4b3[_0x0a9e('0x40')],{'$or':_[_0x0a9e('0x2f')](_0x33b4b3['attributes'],function(_0x119708){var _0x469035={};_0x469035[_0x119708]={'$like':'%'+_0x2ff2ab[_0x0a9e('0x35')]['filter']+'%'};return _0x469035;})});}_0x33b4b3=_[_0x0a9e('0x4a')]({},_0x33b4b3,_0x2ff2ab[_0x0a9e('0x42')]);return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x31e1e0){if(_0x31e1e0){_0x580dd6=_0x31e1e0[_0x0a9e('0x49')];if(!_0x2ff2ab[_0x0a9e('0x35')]['hasOwnProperty'](_0x0a9e('0x6c'))){_0x33b4b3[_0x0a9e('0x20')]=qs[_0x0a9e('0x20')](_0x2ff2ab[_0x0a9e('0x35')][_0x0a9e('0x20')]);_0x33b4b3[_0x0a9e('0x1f')]=qs[_0x0a9e('0x1f')](_0x2ff2ab['query']['offset']);}return _0xb8a476[_0x0a9e('0x8c')](_0x33b4b3);}})[_0x0a9e('0x26')](function(_0x1f4929){if(_0x1f4929){return _0x1f4929?{'count':_0x580dd6,'rows':_0x1f4929}:null;}})[_0x0a9e('0x26')](respondWithResult(_0x242f23,null))[_0x0a9e('0x47')](handleError(_0x242f23,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index 6fc058c..400d32a 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 _0x9fb2=['save','update','remove','emit','hasOwnProperty','hook','exports','CmList','setMaxListeners'];(function(_0x127187,_0x4f7f5c){var _0xcb9e8e=function(_0x2ed907){while(--_0x2ed907){_0x127187['push'](_0x127187['shift']());}};_0xcb9e8e(++_0x4f7f5c);}(_0x9fb2,0x97));var _0x29fb=function(_0x2212d3,_0x324f32){_0x2212d3=_0x2212d3-0x0;var _0x51c05d=_0x9fb2[_0x2212d3];return _0x51c05d;};'use strict';var EventEmitter=require('events');var CmList=require('../../mysqldb')['db'][_0x29fb('0x0')];var CmListEvents=new EventEmitter();CmListEvents[_0x29fb('0x1')](0x0);var events={'afterCreate':_0x29fb('0x2'),'afterUpdate':_0x29fb('0x3'),'afterDestroy':_0x29fb('0x4')};function emitEvent(_0x3a24a3){return function(_0xf84455,_0xb270aa,_0x39aa2f){CmListEvents['emit'](_0x3a24a3+':'+_0xf84455['id'],_0xf84455);CmListEvents[_0x29fb('0x5')](_0x3a24a3,_0xf84455);_0x39aa2f(null);};}for(var e in events){if(events[_0x29fb('0x6')](e)){var event=events[e];CmList[_0x29fb('0x7')](e,emitEvent(event));}}module[_0x29fb('0x8')]=CmListEvents; \ No newline at end of file +var _0xf3ab=['CmList','setMaxListeners','save','remove','emit','hasOwnProperty','exports','../../mysqldb'];(function(_0x1adcb8,_0x1df169){var _0x1bd025=function(_0x51b18b){while(--_0x51b18b){_0x1adcb8['push'](_0x1adcb8['shift']());}};_0x1bd025(++_0x1df169);}(_0xf3ab,0xbf));var _0xbf3a=function(_0x59162a,_0x10e547){_0x59162a=_0x59162a-0x0;var _0x35e50d=_0xf3ab[_0x59162a];return _0x35e50d;};'use strict';var EventEmitter=require('events');var CmList=require(_0xbf3a('0x0'))['db'][_0xbf3a('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xbf3a('0x2')](0x0);var events={'afterCreate':_0xbf3a('0x3'),'afterUpdate':'update','afterDestroy':_0xbf3a('0x4')};function emitEvent(_0x41d029){return function(_0x324123,_0xa7b40f,_0x563058){CmListEvents[_0xbf3a('0x5')](_0x41d029+':'+_0x324123['id'],_0x324123);CmListEvents['emit'](_0x41d029,_0x324123);_0x563058(null);};}for(var e in events){if(events[_0xbf3a('0x6')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0xbf3a('0x7')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index 83f91a6..a7faaa7 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 _0x9155=['cm_lists','lodash','api','moment','bluebird','request-promise','path','rimraf','exports','define','CmList'];(function(_0x34272a,_0x6c5b74){var _0x6a45f3=function(_0x2ed6b1){while(--_0x2ed6b1){_0x34272a['push'](_0x34272a['shift']());}};_0x6a45f3(++_0x6c5b74);}(_0x9155,0x1cf));var _0x5915=function(_0x303c30,_0x16edcb){_0x303c30=_0x303c30-0x0;var _0x43161b=_0x9155[_0x303c30];return _0x43161b;};'use strict';var _=require(_0x5915('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5915('0x1'));var moment=require(_0x5915('0x2'));var BPromise=require(_0x5915('0x3'));var rp=require(_0x5915('0x4'));var fs=require('fs');var path=require(_0x5915('0x5'));var rimraf=require(_0x5915('0x6'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x5915('0x7')]=function(_0x47d7a4,_0x22b2a9){return _0x47d7a4[_0x5915('0x8')](_0x5915('0x9'),attributes,{'tableName':_0x5915('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc68=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./cmList.attributes','exports','define','cm_lists','lodash'];(function(_0xfb0cfd,_0x500179){var _0x2fd8aa=function(_0xccb501){while(--_0xccb501){_0xfb0cfd['push'](_0xfb0cfd['shift']());}};_0x2fd8aa(++_0x500179);}(_0xcc68,0x77));var _0x8cc6=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xcc68[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x8cc6('0x0'));var util=require('util');var logger=require(_0x8cc6('0x1'))(_0x8cc6('0x2'));var moment=require('moment');var BPromise=require(_0x8cc6('0x3'));var rp=require(_0x8cc6('0x4'));var fs=require('fs');var path=require(_0x8cc6('0x5'));var rimraf=require(_0x8cc6('0x6'));var config=require(_0x8cc6('0x7'));var attributes=require(_0x8cc6('0x8'));module[_0x8cc6('0x9')]=function(_0x18a8a1,_0x508d88){return _0x18a8a1[_0x8cc6('0xa')]('CmList',attributes,{'tableName':_0x8cc6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 3f44867..5604bb7 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 _0xae84=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','register','request','then','CmList,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x42b8c1,_0x599b5a){var _0x2ae69f=function(_0x45569b){while(--_0x45569b){_0x42b8c1['push'](_0x42b8c1['shift']());}};_0x2ae69f(++_0x599b5a);}(_0xae84,0x160));var _0x4ae8=function(_0x1ee5ac,_0x59ca27){_0x1ee5ac=_0x1ee5ac-0x0;var _0x2f66d4=_0xae84[_0x1ee5ac];return _0x2f66d4;};'use strict';var _=require(_0x4ae8('0x0'));var util=require(_0x4ae8('0x1'));var moment=require(_0x4ae8('0x2'));var BPromise=require(_0x4ae8('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4ae8('0x4'));var db=require(_0x4ae8('0x5'))['db'];var utils=require(_0x4ae8('0x6'));var logger=require(_0x4ae8('0x7'))(_0x4ae8('0x8'));var config=require(_0x4ae8('0x9'));var jayson=require(_0x4ae8('0xa'));var client=jayson[_0x4ae8('0xb')][_0x4ae8('0xc')]({'port':0x232a});config[_0x4ae8('0xd')]=_['defaults'](config[_0x4ae8('0xd')],{'host':_0x4ae8('0xe'),'port':0x18eb});var socket=require(_0x4ae8('0xf'))(new Redis(config[_0x4ae8('0xd')]));require(_0x4ae8('0x10'))[_0x4ae8('0x11')](socket);function respondWithRpcPromise(_0x478b59,_0x523d7c,_0x58b5ee){return new BPromise(function(_0x37f328,_0x3efecd){return client[_0x4ae8('0x12')](_0x478b59,_0x58b5ee)[_0x4ae8('0x13')](function(_0x326f88){logger['info'](_0x4ae8('0x14'),_0x523d7c,'request\x20sent');logger[_0x4ae8('0x15')]('CmList,\x20%s,\x20%s,\x20%s',_0x523d7c,_0x4ae8('0x16'),JSON[_0x4ae8('0x17')](_0x326f88));if(_0x326f88[_0x4ae8('0x18')]){if(_0x326f88[_0x4ae8('0x18')][_0x4ae8('0x19')]===0x1f4){logger[_0x4ae8('0x18')](_0x4ae8('0x14'),_0x523d7c,_0x326f88[_0x4ae8('0x18')][_0x4ae8('0x1a')]);return _0x3efecd(_0x326f88[_0x4ae8('0x18')]['message']);}logger[_0x4ae8('0x18')]('CmList,\x20%s,\x20%s',_0x523d7c,_0x326f88[_0x4ae8('0x18')][_0x4ae8('0x1a')]);return _0x37f328(_0x326f88['error'][_0x4ae8('0x1a')]);}else{logger[_0x4ae8('0x1b')](_0x4ae8('0x14'),_0x523d7c,_0x4ae8('0x16'));_0x37f328(_0x326f88[_0x4ae8('0x1c')][_0x4ae8('0x1a')]);}})[_0x4ae8('0x1d')](function(_0x353336){logger[_0x4ae8('0x18')]('CmList,\x20%s,\x20%s',_0x523d7c,_0x353336);_0x3efecd(_0x353336);});});} \ No newline at end of file +var _0xfc8a=['defaults','localhost','socket.io-emitter','./cmList.socket','register','info','CmList,\x20%s,\x20%s','debug','CmList,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xfc8a,0x9b));var _0xafc8=function(_0x4ceb13,_0x5e70f7){_0x4ceb13=_0x4ceb13-0x0;var _0x11f6e7=_0xfc8a[_0x4ceb13];return _0x11f6e7;};'use strict';var _=require(_0xafc8('0x0'));var util=require('util');var moment=require(_0xafc8('0x1'));var BPromise=require(_0xafc8('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xafc8('0x3'));var db=require(_0xafc8('0x4'))['db'];var utils=require(_0xafc8('0x5'));var logger=require(_0xafc8('0x6'))(_0xafc8('0x7'));var config=require(_0xafc8('0x8'));var jayson=require(_0xafc8('0x9'));var client=jayson[_0xafc8('0xa')][_0xafc8('0xb')]({'port':0x232a});config[_0xafc8('0xc')]=_[_0xafc8('0xd')](config[_0xafc8('0xc')],{'host':_0xafc8('0xe'),'port':0x18eb});var socket=require(_0xafc8('0xf'))(new Redis(config[_0xafc8('0xc')]));require(_0xafc8('0x10'))[_0xafc8('0x11')](socket);function respondWithRpcPromise(_0x36a356,_0x255a97,_0x11ca24){return new BPromise(function(_0x3c3a63,_0x2596c5){return client['request'](_0x36a356,_0x11ca24)['then'](function(_0x4218a8){logger[_0xafc8('0x12')](_0xafc8('0x13'),_0x255a97,'request\x20sent');logger[_0xafc8('0x14')](_0xafc8('0x15'),_0x255a97,_0xafc8('0x16'),JSON['stringify'](_0x4218a8));if(_0x4218a8[_0xafc8('0x17')]){if(_0x4218a8[_0xafc8('0x17')][_0xafc8('0x18')]===0x1f4){logger[_0xafc8('0x17')]('CmList,\x20%s,\x20%s',_0x255a97,_0x4218a8['error']['message']);return _0x2596c5(_0x4218a8[_0xafc8('0x17')][_0xafc8('0x19')]);}logger['error'](_0xafc8('0x13'),_0x255a97,_0x4218a8[_0xafc8('0x17')]['message']);return _0x3c3a63(_0x4218a8[_0xafc8('0x17')][_0xafc8('0x19')]);}else{logger[_0xafc8('0x12')](_0xafc8('0x13'),_0x255a97,_0xafc8('0x16'));_0x3c3a63(_0x4218a8[_0xafc8('0x1a')]['message']);}})[_0xafc8('0x1b')](function(_0x2b4145){logger[_0xafc8('0x17')]('CmList,\x20%s,\x20%s',_0x255a97,_0x2b4145);_0x2596c5(_0x2b4145);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 5337366..29e54fd 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 _0xb4c7=['remove','update','emit','removeListener','./cmList.events','save'];(function(_0x5298e0,_0x9a71a){var _0x580a7a=function(_0x401869){while(--_0x401869){_0x5298e0['push'](_0x5298e0['shift']());}};_0x580a7a(++_0x9a71a);}(_0xb4c7,0x1ea));var _0x7b4c=function(_0x718ed5,_0x2cc9cc){_0x718ed5=_0x718ed5-0x0;var _0x509ebc=_0xb4c7[_0x718ed5];return _0x509ebc;};'use strict';var CmListEvents=require(_0x7b4c('0x0'));var events=[_0x7b4c('0x1'),_0x7b4c('0x2'),_0x7b4c('0x3')];function createListener(_0x286a79,_0x4bef48){return function(_0x387199){_0x4bef48[_0x7b4c('0x4')](_0x286a79,_0x387199);};}function removeListener(_0x3ebc75,_0x17cea2){return function(){CmListEvents[_0x7b4c('0x5')](_0x3ebc75,_0x17cea2);};}exports['register']=function(_0x1b0f57){for(var _0x10e197=0x0,_0x2dd5c7=events['length'];_0x10e197<_0x2dd5c7;_0x10e197++){var _0x2d7b7e=events[_0x10e197];var _0x21687f=createListener('cmList:'+_0x2d7b7e,_0x1b0f57);CmListEvents['on'](_0x2d7b7e,_0x21687f);}}; \ No newline at end of file +var _0xaf1b=['register','length','./cmList.events','save','remove','update','emit','removeListener'];(function(_0xa388a2,_0x40bde6){var _0x7ce7f6=function(_0x5a242a){while(--_0x5a242a){_0xa388a2['push'](_0xa388a2['shift']());}};_0x7ce7f6(++_0x40bde6);}(_0xaf1b,0x11a));var _0xbaf1=function(_0xbef685,_0x4b755c){_0xbef685=_0xbef685-0x0;var _0x40e0bb=_0xaf1b[_0xbef685];return _0x40e0bb;};'use strict';var CmListEvents=require(_0xbaf1('0x0'));var events=[_0xbaf1('0x1'),_0xbaf1('0x2'),_0xbaf1('0x3')];function createListener(_0x2293e7,_0x132c6a){return function(_0x3631fb){_0x132c6a[_0xbaf1('0x4')](_0x2293e7,_0x3631fb);};}function removeListener(_0x461ffb,_0x3fe8f0){return function(){CmListEvents[_0xbaf1('0x5')](_0x461ffb,_0x3fe8f0);};}exports[_0xbaf1('0x6')]=function(_0x7dd657){for(var _0x2f05ad=0x0,_0x548a29=events[_0xbaf1('0x7')];_0x2f05ad<_0x548a29;_0x2f05ad++){var _0x5f337d=events[_0x2f05ad];var _0x16a74d=createListener('cmList:'+_0x5f337d,_0x7dd657);CmListEvents['on'](_0x5f337d,_0x16a74d);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index dbdd402..5b60584 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 _0x846c=['/:id/dispositions','removeAgents','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmList.controller','get','isAuthenticated','/describe','describe','/:id','getContacts','/:id/contacts/csv','getContactsCsv','getCustomFields','getAgents','post','create','addDisposition','addContacts','/:id/fields','addCustomField','/:id/users','addAgents','put','update','destroy','delete'];(function(_0x39bc58,_0x27a34e){var _0x42b508=function(_0x1868cd){while(--_0x1868cd){_0x39bc58['push'](_0x39bc58['shift']());}};_0x42b508(++_0x27a34e);}(_0x846c,0x138));var _0xc846=function(_0x3b9e68,_0x3621df){_0x3b9e68=_0x3b9e68-0x0;var _0x9d8359=_0x846c[_0x3b9e68];return _0x9d8359;};'use strict';var multer=require(_0xc846('0x0'));var util=require('util');var path=require(_0xc846('0x1'));var timeout=require(_0xc846('0x2'));var express=require('express');var router=express[_0xc846('0x3')]();var auth=require(_0xc846('0x4'));var interaction=require(_0xc846('0x5'));var config=require('../../config/environment');var controller=require(_0xc846('0x6'));router[_0xc846('0x7')]('/',auth[_0xc846('0x8')](),controller['index']);router[_0xc846('0x7')](_0xc846('0x9'),auth[_0xc846('0x8')](),controller[_0xc846('0xa')]);router[_0xc846('0x7')](_0xc846('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xc846('0x7')]('/:id/dispositions',auth[_0xc846('0x8')](),controller['getDispositions']);router['get']('/:id/contacts',auth[_0xc846('0x8')](),controller[_0xc846('0xc')]);router['get'](_0xc846('0xd'),auth[_0xc846('0x8')](),controller[_0xc846('0xe')]);router[_0xc846('0x7')]('/:id/fields',auth[_0xc846('0x8')](),controller[_0xc846('0xf')]);router[_0xc846('0x7')]('/:id/users',auth[_0xc846('0x8')](),controller[_0xc846('0x10')]);router[_0xc846('0x11')]('/',auth[_0xc846('0x8')](),controller[_0xc846('0x12')]);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller[_0xc846('0x13')]);router['post']('/:id/contacts',auth['isAuthenticated'](),controller[_0xc846('0x14')]);router['post'](_0xc846('0x15'),auth[_0xc846('0x8')](),controller[_0xc846('0x16')]);router[_0xc846('0x11')](_0xc846('0x17'),auth[_0xc846('0x8')](),controller[_0xc846('0x18')]);router[_0xc846('0x19')](_0xc846('0xb'),auth['isAuthenticated'](),controller[_0xc846('0x1a')]);router['delete'](_0xc846('0xb'),auth[_0xc846('0x8')](),controller[_0xc846('0x1b')]);router[_0xc846('0x1c')](_0xc846('0x1d'),auth[_0xc846('0x8')](),controller['removeDispositions']);router['delete']('/:id/users',auth[_0xc846('0x8')](),controller[_0xc846('0x1e')]);module['exports']=router; \ No newline at end of file +var _0xc757=['put','update','delete','destroy','removeDispositions','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmList.controller','isAuthenticated','index','get','describe','/:id','show','/:id/dispositions','/:id/contacts','getContacts','/:id/users','post','create','addDisposition','addAgents'];(function(_0x5c2e3e,_0x26ecd3){var _0x53f64a=function(_0x2b5df8){while(--_0x2b5df8){_0x5c2e3e['push'](_0x5c2e3e['shift']());}};_0x53f64a(++_0x26ecd3);}(_0xc757,0x101));var _0x7c75=function(_0x266b2b,_0x2ea5ae){_0x266b2b=_0x266b2b-0x0;var _0x1d1940=_0xc757[_0x266b2b];return _0x1d1940;};'use strict';var multer=require(_0x7c75('0x0'));var util=require(_0x7c75('0x1'));var path=require(_0x7c75('0x2'));var timeout=require(_0x7c75('0x3'));var express=require(_0x7c75('0x4'));var router=express[_0x7c75('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c75('0x6'));var config=require(_0x7c75('0x7'));var controller=require(_0x7c75('0x8'));router['get']('/',auth[_0x7c75('0x9')](),controller[_0x7c75('0xa')]);router[_0x7c75('0xb')]('/describe',auth['isAuthenticated'](),controller[_0x7c75('0xc')]);router['get'](_0x7c75('0xd'),auth[_0x7c75('0x9')](),controller[_0x7c75('0xe')]);router['get'](_0x7c75('0xf'),auth[_0x7c75('0x9')](),controller['getDispositions']);router[_0x7c75('0xb')](_0x7c75('0x10'),auth['isAuthenticated'](),controller[_0x7c75('0x11')]);router[_0x7c75('0xb')]('/:id/contacts/csv',auth[_0x7c75('0x9')](),controller['getContactsCsv']);router[_0x7c75('0xb')]('/:id/fields',auth['isAuthenticated'](),controller['getCustomFields']);router[_0x7c75('0xb')](_0x7c75('0x12'),auth[_0x7c75('0x9')](),controller['getAgents']);router[_0x7c75('0x13')]('/',auth['isAuthenticated'](),controller[_0x7c75('0x14')]);router[_0x7c75('0x13')](_0x7c75('0xf'),auth[_0x7c75('0x9')](),controller[_0x7c75('0x15')]);router[_0x7c75('0x13')](_0x7c75('0x10'),auth[_0x7c75('0x9')](),controller['addContacts']);router[_0x7c75('0x13')]('/:id/fields',auth[_0x7c75('0x9')](),controller['addCustomField']);router['post'](_0x7c75('0x12'),auth[_0x7c75('0x9')](),controller[_0x7c75('0x16')]);router[_0x7c75('0x17')](_0x7c75('0xd'),auth['isAuthenticated'](),controller[_0x7c75('0x18')]);router[_0x7c75('0x19')]('/:id',auth[_0x7c75('0x9')](),controller[_0x7c75('0x1a')]);router[_0x7c75('0x19')](_0x7c75('0xf'),auth[_0x7c75('0x9')](),controller[_0x7c75('0x1b')]);router[_0x7c75('0x19')](_0x7c75('0x12'),auth[_0x7c75('0x9')](),controller['removeAgents']);module['exports']=router; \ No newline at end of file diff --git a/server/api/condition/condition.attributes.js b/server/api/condition/condition.attributes.js index 0c76468..72d4caa 100644 --- a/server/api/condition/condition.attributes.js +++ b/server/api/condition/condition.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x203eee,_0x431a52){var _0x250749=function(_0x4450c5){while(--_0x4450c5){_0x203eee['push'](_0x203eee['shift']());}};_0x250749(++_0x431a52);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xa9e0[_0x3635ce];return _0x97ecd0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x1c808a,_0x162d25){var _0x53318b=function(_0x8cd4c4){while(--_0x8cd4c4){_0x1c808a['push'](_0x1c808a['shift']());}};_0x53318b(++_0x162d25);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index 0e5e623..61a3014 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 _0xd6ed=['jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','body','find','params','destroy','Condition','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto'];(function(_0xab5159,_0xb741a7){var _0x214491=function(_0x426d5f){while(--_0x426d5f){_0xab5159['push'](_0xab5159['shift']());}};_0x214491(++_0xb741a7);}(_0xd6ed,0x1aa));var _0xdd6e=function(_0x37dd52,_0x49120f){_0x37dd52=_0x37dd52-0x0;var _0x134f7d=_0xd6ed[_0x37dd52];return _0x134f7d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdd6e('0x0'));var rimraf=require(_0xdd6e('0x1'));var zipdir=require(_0xdd6e('0x2'));var jsonpatch=require(_0xdd6e('0x3'));var rp=require(_0xdd6e('0x4'));var moment=require(_0xdd6e('0x5'));var BPromise=require(_0xdd6e('0x6'));var Mustache=require(_0xdd6e('0x7'));var util=require(_0xdd6e('0x8'));var path=require(_0xdd6e('0x9'));var sox=require(_0xdd6e('0xa'));var csv=require(_0xdd6e('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdd6e('0xc'));var crypto=require(_0xdd6e('0xd'));var jsforce=require(_0xdd6e('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd6e('0xf'));var Papa=require('papaparse');var Redis=require(_0xdd6e('0x10'));var authService=require(_0xdd6e('0x11'));var qs=require(_0xdd6e('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdd6e('0x13'));var logger=require(_0xdd6e('0x14'))(_0xdd6e('0x15'));var utils=require(_0xdd6e('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d1555,_0x510ea4){_0x510ea4=_0x510ea4||0xcc;return function(_0x5a0eaf){if(_0x5a0eaf){return _0x3d1555[_0xdd6e('0x17')](_0x510ea4);}return _0x3d1555[_0xdd6e('0x18')](_0x510ea4)[_0xdd6e('0x19')]();};}function respondWithResult(_0x434f4b,_0x554906){_0x554906=_0x554906||0xc8;return function(_0x9e2bda){if(_0x9e2bda){return _0x434f4b[_0xdd6e('0x18')](_0x554906)[_0xdd6e('0x1a')](_0x9e2bda);}};}function respondWithFilteredResult(_0x2fe860,_0xf899){return function(_0x41b6ad){if(_0x41b6ad){var _0x40728a=_0x41b6ad['count'],_0x36c0c8=_0xf899[_0xdd6e('0x1b')],_0x55cd57=_0xf899[_0xdd6e('0x1b')]+_0xf899[_0xdd6e('0x1c')],_0x3ed703;if(_0x55cd57>=_0x40728a){_0x55cd57=_0x40728a;_0x3ed703=0xc8;}else{_0x3ed703=0xce;}_0x2fe860['status'](_0x3ed703);return _0x2fe860[_0xdd6e('0x1d')](_0xdd6e('0x1e'),_0x36c0c8+'-'+_0x55cd57+'/'+_0x40728a)[_0xdd6e('0x1a')](_0x41b6ad);}return null;};}function patchUpdates(_0x515648){return function(_0x11e5c6){try{jsonpatch[_0xdd6e('0x1f')](_0x11e5c6,_0x515648,!![]);}catch(_0x517522){return BPromise[_0xdd6e('0x20')](_0x517522);}return _0x11e5c6[_0xdd6e('0x21')]();};}function saveUpdates(_0x170f4a,_0xa24f09){return function(_0x57bc30){if(_0x57bc30){return _0x57bc30[_0xdd6e('0x22')](_0x170f4a)[_0xdd6e('0x23')](function(_0x21598e){return _0x21598e;});}return null;};}function removeEntity(_0x51717a,_0x3c2376){return function(_0xf4f6d4){if(_0xf4f6d4){return _0xf4f6d4['destroy']()[_0xdd6e('0x23')](function(){_0x51717a[_0xdd6e('0x18')](0xcc)[_0xdd6e('0x19')]();});}};}function handleEntityNotFound(_0x4e72e1,_0x2e9174){return function(_0x2a3447){if(!_0x2a3447){_0x4e72e1[_0xdd6e('0x17')](0x194);}return _0x2a3447;};}function handleError(_0xd14447,_0x5e723e){_0x5e723e=_0x5e723e||0x1f4;return function(_0x5404de){logger['error'](_0x5404de[_0xdd6e('0x24')]);if(_0x5404de[_0xdd6e('0x25')]){delete _0x5404de['name'];}_0xd14447['status'](_0x5e723e)[_0xdd6e('0x26')](_0x5404de);};}exports[_0xdd6e('0x22')]=function(_0x4649b6,_0x3383fd){if(_0x4649b6[_0xdd6e('0x27')]['id']){delete _0x4649b6[_0xdd6e('0x27')]['id'];}return db['Condition'][_0xdd6e('0x28')]({'where':{'id':_0x4649b6[_0xdd6e('0x29')]['id']}})['then'](handleEntityNotFound(_0x3383fd,null))['then'](saveUpdates(_0x4649b6['body'],null))['then'](respondWithResult(_0x3383fd,null))['catch'](handleError(_0x3383fd,null));};exports[_0xdd6e('0x2a')]=function(_0x13dbf6,_0x4a55fa){return db[_0xdd6e('0x2b')]['find']({'where':{'id':_0x13dbf6['params']['id']}})['then'](handleEntityNotFound(_0x4a55fa,null))[_0xdd6e('0x23')](removeEntity(_0x4a55fa,null))['catch'](handleError(_0x4a55fa,null));}; \ No newline at end of file +var _0x30c0=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','find','params','body','Condition','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x5223d5,_0x19f039){var _0x2fcc92=function(_0x67270d){while(--_0x67270d){_0x5223d5['push'](_0x5223d5['shift']());}};_0x2fcc92(++_0x19f039);}(_0x30c0,0x168));var _0x030c=function(_0x3c18c0,_0xf71884){_0x3c18c0=_0x3c18c0-0x0;var _0x5a0b52=_0x30c0[_0x3c18c0];return _0x5a0b52;};'use strict';var pdf=require(_0x030c('0x0'));var emlformat=require(_0x030c('0x1'));var rimraf=require(_0x030c('0x2'));var zipdir=require(_0x030c('0x3'));var jsonpatch=require(_0x030c('0x4'));var rp=require('request-promise');var moment=require(_0x030c('0x5'));var BPromise=require(_0x030c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x030c('0x7'));var sox=require(_0x030c('0x8'));var csv=require(_0x030c('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x030c('0xa'));var crypto=require(_0x030c('0xb'));var jsforce=require(_0x030c('0xc'));var deskjs=require(_0x030c('0xd'));var toCsv=require(_0x030c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x030c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x030c('0xf'));var as=require(_0x030c('0x10'));var hardwareService=require(_0x030c('0x11'));var logger=require(_0x030c('0x12'))(_0x030c('0x13'));var utils=require(_0x030c('0x14'));var config=require(_0x030c('0x15'));var db=require(_0x030c('0x16'))['db'];function respondWithStatusCode(_0x5787d3,_0x2bb918){_0x2bb918=_0x2bb918||0xcc;return function(_0x35706d){if(_0x35706d){return _0x5787d3['sendStatus'](_0x2bb918);}return _0x5787d3[_0x030c('0x17')](_0x2bb918)[_0x030c('0x18')]();};}function respondWithResult(_0x29b722,_0x1d02dc){_0x1d02dc=_0x1d02dc||0xc8;return function(_0x19797a){if(_0x19797a){return _0x29b722['status'](_0x1d02dc)[_0x030c('0x19')](_0x19797a);}};}function respondWithFilteredResult(_0x1bedc2,_0x5143d6){return function(_0x490536){if(_0x490536){var _0x16b795=_0x490536['count'],_0x400b08=_0x5143d6[_0x030c('0x1a')],_0x14cb26=_0x5143d6['offset']+_0x5143d6[_0x030c('0x1b')],_0x166825;if(_0x14cb26>=_0x16b795){_0x14cb26=_0x16b795;_0x166825=0xc8;}else{_0x166825=0xce;}_0x1bedc2[_0x030c('0x17')](_0x166825);return _0x1bedc2[_0x030c('0x1c')](_0x030c('0x1d'),_0x400b08+'-'+_0x14cb26+'/'+_0x16b795)[_0x030c('0x19')](_0x490536);}return null;};}function patchUpdates(_0x4a2e99){return function(_0x2ead42){try{jsonpatch[_0x030c('0x1e')](_0x2ead42,_0x4a2e99,!![]);}catch(_0x14b2de){return BPromise[_0x030c('0x1f')](_0x14b2de);}return _0x2ead42['save']();};}function saveUpdates(_0x1c8495,_0x211da2){return function(_0x38b826){if(_0x38b826){return _0x38b826[_0x030c('0x20')](_0x1c8495)[_0x030c('0x21')](function(_0x2ed77d){return _0x2ed77d;});}return null;};}function removeEntity(_0x2efa33,_0xd8589a){return function(_0x49ed1c){if(_0x49ed1c){return _0x49ed1c[_0x030c('0x22')]()['then'](function(){_0x2efa33[_0x030c('0x17')](0xcc)[_0x030c('0x18')]();});}};}function handleEntityNotFound(_0x4ab455,_0x4d1e0d){return function(_0x1b1e18){if(!_0x1b1e18){_0x4ab455[_0x030c('0x23')](0x194);}return _0x1b1e18;};}function handleError(_0x23350d,_0x51b097){_0x51b097=_0x51b097||0x1f4;return function(_0x50b9c6){logger[_0x030c('0x24')](_0x50b9c6['stack']);if(_0x50b9c6['name']){delete _0x50b9c6['name'];}_0x23350d[_0x030c('0x17')](_0x51b097)['send'](_0x50b9c6);};}exports[_0x030c('0x20')]=function(_0x185e05,_0x45a311){if(_0x185e05['body']['id']){delete _0x185e05['body']['id'];}return db['Condition'][_0x030c('0x25')]({'where':{'id':_0x185e05[_0x030c('0x26')]['id']}})[_0x030c('0x21')](handleEntityNotFound(_0x45a311,null))[_0x030c('0x21')](saveUpdates(_0x185e05[_0x030c('0x27')],null))[_0x030c('0x21')](respondWithResult(_0x45a311,null))['catch'](handleError(_0x45a311,null));};exports[_0x030c('0x22')]=function(_0x39d0a4,_0x3d748d){return db[_0x030c('0x28')][_0x030c('0x25')]({'where':{'id':_0x39d0a4[_0x030c('0x26')]['id']}})[_0x030c('0x21')](handleEntityNotFound(_0x3d748d,null))['then'](removeEntity(_0x3d748d,null))[_0x030c('0x29')](handleError(_0x3d748d,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index ff9463b..c4848a1 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 _0x6b53=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./condition.attributes','exports','define','Condition','tools_conditions','lodash'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x6b53,0x1b9));var _0x36b5=function(_0x2f79ed,_0x2c6f1c){_0x2f79ed=_0x2f79ed-0x0;var _0x3b6301=_0x6b53[_0x2f79ed];return _0x3b6301;};'use strict';var _=require(_0x36b5('0x0'));var util=require('util');var logger=require(_0x36b5('0x1'))(_0x36b5('0x2'));var moment=require('moment');var BPromise=require(_0x36b5('0x3'));var rp=require(_0x36b5('0x4'));var fs=require('fs');var path=require(_0x36b5('0x5'));var rimraf=require(_0x36b5('0x6'));var config=require(_0x36b5('0x7'));var attributes=require(_0x36b5('0x8'));module[_0x36b5('0x9')]=function(_0x24a846,_0x2f56ec){return _0x24a846[_0x36b5('0xa')](_0x36b5('0xb'),attributes,{'tableName':_0x36b5('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb0c1=['./condition.attributes','exports','define','Condition','tools_conditions','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x5b4ab9,_0x727578){var _0x398087=function(_0x264ce9){while(--_0x264ce9){_0x5b4ab9['push'](_0x5b4ab9['shift']());}};_0x398087(++_0x727578);}(_0xb0c1,0x10d));var _0x1b0c=function(_0x1d13d5,_0x460a66){_0x1d13d5=_0x1d13d5-0x0;var _0x3c281d=_0xb0c1[_0x1d13d5];return _0x3c281d;};'use strict';var _=require(_0x1b0c('0x0'));var util=require(_0x1b0c('0x1'));var logger=require(_0x1b0c('0x2'))(_0x1b0c('0x3'));var moment=require('moment');var BPromise=require(_0x1b0c('0x4'));var rp=require(_0x1b0c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b0c('0x6'));var config=require('../../config/environment');var attributes=require(_0x1b0c('0x7'));module[_0x1b0c('0x8')]=function(_0x1ecd31,_0x611554){return _0x1ecd31[_0x1b0c('0x9')](_0x1b0c('0xa'),attributes,{'tableName':_0x1b0c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/condition/condition.rpc.js b/server/api/condition/condition.rpc.js index 6ed5635..ea95829 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 _0xe675=['../../config/environment','http','request','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','Condition,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x1731a9,_0x4fb551){var _0x22b9a5=function(_0x3b62fd){while(--_0x3b62fd){_0x1731a9['push'](_0x1731a9['shift']());}};_0x22b9a5(++_0x4fb551);}(_0xe675,0xd5));var _0x5e67=function(_0xd8a3b0,_0x296d12){_0xd8a3b0=_0xd8a3b0-0x0;var _0xf9276=_0xe675[_0xd8a3b0];return _0xf9276;};'use strict';var _=require(_0x5e67('0x0'));var util=require('util');var moment=require(_0x5e67('0x1'));var BPromise=require(_0x5e67('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5e67('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e67('0x4'));var logger=require(_0x5e67('0x5'))(_0x5e67('0x6'));var config=require(_0x5e67('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5e67('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3d2eba,_0x28953c,_0x255aad){return new BPromise(function(_0x135ea3,_0x23b0e9){return client[_0x5e67('0x9')](_0x3d2eba,_0x255aad)['then'](function(_0x2efb2c){logger[_0x5e67('0xa')]('Condition,\x20%s,\x20%s',_0x28953c,_0x5e67('0xb'));logger['debug'](_0x5e67('0xc'),_0x28953c,_0x5e67('0xb'),JSON[_0x5e67('0xd')](_0x2efb2c));if(_0x2efb2c['error']){if(_0x2efb2c[_0x5e67('0xe')][_0x5e67('0xf')]===0x1f4){logger['error'](_0x5e67('0x10'),_0x28953c,_0x2efb2c['error'][_0x5e67('0x11')]);return _0x23b0e9(_0x2efb2c[_0x5e67('0xe')][_0x5e67('0x11')]);}logger[_0x5e67('0xe')](_0x5e67('0x10'),_0x28953c,_0x2efb2c[_0x5e67('0xe')][_0x5e67('0x11')]);return _0x135ea3(_0x2efb2c[_0x5e67('0xe')][_0x5e67('0x11')]);}else{logger[_0x5e67('0xa')](_0x5e67('0x10'),_0x28953c,_0x5e67('0xb'));_0x135ea3(_0x2efb2c[_0x5e67('0x12')][_0x5e67('0x11')]);}})[_0x5e67('0x13')](function(_0x226681){logger[_0x5e67('0xe')](_0x5e67('0x10'),_0x28953c,_0x226681);_0x23b0e9(_0x226681);});});} \ No newline at end of file +var _0x396f=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Condition,\x20%s,\x20%s','request\x20sent','debug','Condition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x27444f,_0x459ebe){var _0xc66c8b=function(_0x56031e){while(--_0x56031e){_0x27444f['push'](_0x27444f['shift']());}};_0xc66c8b(++_0x459ebe);}(_0x396f,0xe4));var _0xf396=function(_0x1d11c6,_0x4f3078){_0x1d11c6=_0x1d11c6-0x0;var _0xbfb5a9=_0x396f[_0x1d11c6];return _0xbfb5a9;};'use strict';var _=require(_0xf396('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf396('0x1'));var rs=require(_0xf396('0x2'));var fs=require('fs');var Redis=require(_0xf396('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xf396('0x4'));var logger=require('../../config/logger')(_0xf396('0x5'));var config=require(_0xf396('0x6'));var jayson=require(_0xf396('0x7'));var client=jayson[_0xf396('0x8')][_0xf396('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b8a11,_0x4e630f,_0x5b0c01){return new BPromise(function(_0x1da4ad,_0x2c5bce){return client[_0xf396('0xa')](_0x2b8a11,_0x5b0c01)[_0xf396('0xb')](function(_0x5d794e){logger[_0xf396('0xc')](_0xf396('0xd'),_0x4e630f,_0xf396('0xe'));logger[_0xf396('0xf')](_0xf396('0x10'),_0x4e630f,_0xf396('0xe'),JSON[_0xf396('0x11')](_0x5d794e));if(_0x5d794e[_0xf396('0x12')]){if(_0x5d794e[_0xf396('0x12')][_0xf396('0x13')]===0x1f4){logger[_0xf396('0x12')](_0xf396('0xd'),_0x4e630f,_0x5d794e['error']['message']);return _0x2c5bce(_0x5d794e[_0xf396('0x12')][_0xf396('0x14')]);}logger[_0xf396('0x12')](_0xf396('0xd'),_0x4e630f,_0x5d794e['error'][_0xf396('0x14')]);return _0x1da4ad(_0x5d794e['error'][_0xf396('0x14')]);}else{logger[_0xf396('0xc')]('Condition,\x20%s,\x20%s',_0x4e630f,_0xf396('0xe'));_0x1da4ad(_0x5d794e[_0xf396('0x15')][_0xf396('0x14')]);}})[_0xf396('0x16')](function(_0x3dda89){logger[_0xf396('0x12')](_0xf396('0xd'),_0x4e630f,_0x3dda89);_0x2c5bce(_0x3dda89);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 68042c9..b667980 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 _0x676c=['exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update','delete'];(function(_0x355596,_0x246075){var _0xb1a106=function(_0x57f3f6){while(--_0x57f3f6){_0x355596['push'](_0x355596['shift']());}};_0xb1a106(++_0x246075);}(_0x676c,0x12d));var _0xc676=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x676c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc676('0x0'));var util=require(_0xc676('0x1'));var path=require(_0xc676('0x2'));var timeout=require(_0xc676('0x3'));var express=require('express');var router=express[_0xc676('0x4')]();var auth=require(_0xc676('0x5'));var interaction=require(_0xc676('0x6'));var config=require(_0xc676('0x7'));var controller=require(_0xc676('0x8'));router[_0xc676('0x9')](_0xc676('0xa'),auth[_0xc676('0xb')](),controller[_0xc676('0xc')]);router[_0xc676('0xd')](_0xc676('0xa'),auth[_0xc676('0xb')](),controller['destroy']);module[_0xc676('0xe')]=router; \ No newline at end of file +var _0x4f5f=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','isAuthenticated'];(function(_0x4fac0c,_0x278fcf){var _0x37f7ef=function(_0x15ced9){while(--_0x15ced9){_0x4fac0c['push'](_0x4fac0c['shift']());}};_0x37f7ef(++_0x278fcf);}(_0x4f5f,0x1f3));var _0xf4f5=function(_0x4536a4,_0x55af7b){_0x4536a4=_0x4536a4-0x0;var _0x4fd1c1=_0x4f5f[_0x4536a4];return _0x4fd1c1;};'use strict';var multer=require(_0xf4f5('0x0'));var util=require(_0xf4f5('0x1'));var path=require(_0xf4f5('0x2'));var timeout=require(_0xf4f5('0x3'));var express=require('express');var router=express[_0xf4f5('0x4')]();var auth=require(_0xf4f5('0x5'));var interaction=require(_0xf4f5('0x6'));var config=require(_0xf4f5('0x7'));var controller=require('./condition.controller');router[_0xf4f5('0x8')](_0xf4f5('0x9'),auth[_0xf4f5('0xa')](),controller[_0xf4f5('0xb')]);router[_0xf4f5('0xc')](_0xf4f5('0x9'),auth[_0xf4f5('0xa')](),controller[_0xf4f5('0xd')]);module[_0xf4f5('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 ff7ae31..e11600f 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 _0xaeaf=['STRING','name','sequelize','exports'];(function(_0x539ce1,_0x4a65eb){var _0x20be8e=function(_0x45efa4){while(--_0x45efa4){_0x539ce1['push'](_0x539ce1['shift']());}};_0x20be8e(++_0x4a65eb);}(_0xaeaf,0x14e));var _0xfaea=function(_0x4ac31f,_0x3bf843){_0x4ac31f=_0x4ac31f-0x0;var _0x1f1926=_0xaeaf[_0x4ac31f];return _0x1f1926;};'use strict';var Sequelize=require(_0xfaea('0x0'));module[_0xfaea('0x1')]={'name':{'type':Sequelize[_0xfaea('0x2')],'allowNull':![],'unique':_0xfaea('0x3')},'description':{'type':Sequelize[_0xfaea('0x2')]}}; \ No newline at end of file +var _0x5f7d=['name','sequelize','exports','STRING'];(function(_0x1f76a4,_0x433129){var _0x1f515a=function(_0x3384c3){while(--_0x3384c3){_0x1f76a4['push'](_0x1f76a4['shift']());}};_0x1f515a(++_0x433129);}(_0x5f7d,0x6d));var _0xd5f7=function(_0x1e8f01,_0x30cbc4){_0x1e8f01=_0x1e8f01-0x0;var _0x448913=_0x5f7d[_0x1e8f01];return _0x448913;};'use strict';var Sequelize=require(_0xd5f7('0x0'));module[_0xd5f7('0x1')]={'name':{'type':Sequelize[_0xd5f7('0x2')],'allowNull':![],'unique':_0xd5f7('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index fc2b86c..77ea57d 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 _0x6cd2=['Content-Range','apply','save','update','then','CustomDashboards','UserProfileResource','destroy','error','name','send','map','Dashboard','rawAttributes','fieldName','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','show','params','keys','includeAll','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','userProfileId','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','createdAt','updatedAt','iframe','attrUrl','attrs','custom','attrPath','value','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','counter','attrMetric','total','attrVoiceQueues','attrFontSize','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','attrRefresh','widgetAttributes:\x20%s','addItem','DashboardId','DashboardItem','getItems','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','sendStatus','status','end','json','count','limit'];(function(_0x367939,_0x5acadd){var _0x33676c=function(_0x523e5c){while(--_0x523e5c){_0x367939['push'](_0x367939['shift']());}};_0x33676c(++_0x5acadd);}(_0x6cd2,0x147));var _0x26cd=function(_0x2ab382,_0x4d5521){_0x2ab382=_0x2ab382-0x0;var _0x468461=_0x6cd2[_0x2ab382];return _0x468461;};'use strict';var pdf=require(_0x26cd('0x0'));var emlformat=require(_0x26cd('0x1'));var rimraf=require(_0x26cd('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x26cd('0x3'));var moment=require(_0x26cd('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x26cd('0x5'));var util=require(_0x26cd('0x6'));var path=require(_0x26cd('0x7'));var sox=require(_0x26cd('0x8'));var csv=require(_0x26cd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x26cd('0xa'));var squel=require(_0x26cd('0xb'));var crypto=require(_0x26cd('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x26cd('0xd'));var toCsv=require(_0x26cd('0x9'));var querystring=require(_0x26cd('0xe'));var Papa=require(_0x26cd('0xf'));var Redis=require(_0x26cd('0x10'));var authService=require(_0x26cd('0x11'));var qs=require(_0x26cd('0x12'));var as=require(_0x26cd('0x13'));var hardwareService=require(_0x26cd('0x14'));var logger=require(_0x26cd('0x15'))(_0x26cd('0x16'));var utils=require('../../config/utils');var config=require(_0x26cd('0x17'));var db=require(_0x26cd('0x18'))['db'];config[_0x26cd('0x19')]=_[_0x26cd('0x1a')](config['redis'],{'host':_0x26cd('0x1b'),'port':0x18eb});var socket=require(_0x26cd('0x1c'))(new Redis(config[_0x26cd('0x19')]));require(_0x26cd('0x1d'))['register'](socket);function respondWithStatusCode(_0xb4c67f,_0x25ec7a){_0x25ec7a=_0x25ec7a||0xcc;return function(_0x1e0f75){if(_0x1e0f75){return _0xb4c67f[_0x26cd('0x1e')](_0x25ec7a);}return _0xb4c67f[_0x26cd('0x1f')](_0x25ec7a)[_0x26cd('0x20')]();};}function respondWithResult(_0x3ff2a2,_0x5d7e76){_0x5d7e76=_0x5d7e76||0xc8;return function(_0x6834ca){if(_0x6834ca){return _0x3ff2a2['status'](_0x5d7e76)[_0x26cd('0x21')](_0x6834ca);}};}function respondWithFilteredResult(_0x1e6e72,_0x28c4f0){return function(_0x1e5dad){if(_0x1e5dad){var _0x1d46fa=_0x1e5dad[_0x26cd('0x22')],_0x59644e=_0x28c4f0['offset'],_0x53e003=_0x28c4f0['offset']+_0x28c4f0[_0x26cd('0x23')],_0x1df169;if(_0x53e003>=_0x1d46fa){_0x53e003=_0x1d46fa;_0x1df169=0xc8;}else{_0x1df169=0xce;}_0x1e6e72[_0x26cd('0x1f')](_0x1df169);return _0x1e6e72['set'](_0x26cd('0x24'),_0x59644e+'-'+_0x53e003+'/'+_0x1d46fa)[_0x26cd('0x21')](_0x1e5dad);}return null;};}function patchUpdates(_0x4c6d96){return function(_0x668b6d){try{jsonpatch[_0x26cd('0x25')](_0x668b6d,_0x4c6d96,!![]);}catch(_0x1614ff){return BPromise['reject'](_0x1614ff);}return _0x668b6d[_0x26cd('0x26')]();};}function saveUpdates(_0x35b0b8,_0x16925e){return function(_0x161757){if(_0x161757){return _0x161757[_0x26cd('0x27')](_0x35b0b8)[_0x26cd('0x28')](function(_0x4a8d4f){return _0x4a8d4f;});}return null;};}function removeEntity(_0x14a37b,_0x5cdb13){return function(_0x12626c){if(_0x12626c){return _0x12626c['destroy']()['then'](function(){var _0x48d4b4=_0x12626c['get']({'plain':!![]});var _0x47fda1=_0x26cd('0x29');return db[_0x26cd('0x2a')][_0x26cd('0x2b')]({'where':{'type':_0x47fda1,'resourceId':_0x48d4b4['id']}})[_0x26cd('0x28')](function(){return _0x12626c;});})['then'](function(){_0x14a37b[_0x26cd('0x1f')](0xcc)[_0x26cd('0x20')]();});}};}function handleEntityNotFound(_0x2b4598,_0x427f62){return function(_0x24a482){if(!_0x24a482){_0x2b4598[_0x26cd('0x1e')](0x194);}return _0x24a482;};}function handleError(_0xe41975,_0x11699e){_0x11699e=_0x11699e||0x1f4;return function(_0x80671a){logger[_0x26cd('0x2c')](_0x80671a['stack']);if(_0x80671a[_0x26cd('0x2d')]){delete _0x80671a[_0x26cd('0x2d')];}_0xe41975[_0x26cd('0x1f')](_0x11699e)[_0x26cd('0x2e')](_0x80671a);};}exports['index']=function(_0x53b285,_0x2b7c75){var _0x26bebb={},_0x525f91={},_0x4ec034={'count':0x0,'rows':[]};var _0x4dd41b=_[_0x26cd('0x2f')](db[_0x26cd('0x30')][_0x26cd('0x31')],function(_0x4da701){return{'name':_0x4da701[_0x26cd('0x32')],'type':_0x4da701['type'][_0x26cd('0x33')]};});_0x525f91[_0x26cd('0x34')]=_[_0x26cd('0x2f')](_0x4dd41b,_0x26cd('0x2d'));_0x525f91['query']=_['keys'](_0x53b285['query']);_0x525f91[_0x26cd('0x35')]=_['intersection'](_0x525f91['model'],_0x525f91[_0x26cd('0x36')]);_0x26bebb[_0x26cd('0x37')]=_[_0x26cd('0x38')](_0x525f91[_0x26cd('0x34')],qs[_0x26cd('0x39')](_0x53b285[_0x26cd('0x36')][_0x26cd('0x39')]));_0x26bebb[_0x26cd('0x37')]=_0x26bebb[_0x26cd('0x37')][_0x26cd('0x3a')]?_0x26bebb['attributes']:_0x525f91[_0x26cd('0x34')];if(!_0x53b285[_0x26cd('0x36')][_0x26cd('0x3b')](_0x26cd('0x3c'))){_0x26bebb[_0x26cd('0x23')]=qs[_0x26cd('0x23')](_0x53b285['query'][_0x26cd('0x23')]);_0x26bebb[_0x26cd('0x3d')]=qs[_0x26cd('0x3d')](_0x53b285['query'][_0x26cd('0x3d')]);}_0x26bebb[_0x26cd('0x3e')]=qs[_0x26cd('0x3f')](_0x53b285[_0x26cd('0x36')]['sort']);_0x26bebb[_0x26cd('0x40')]=qs[_0x26cd('0x35')](_[_0x26cd('0x41')](_0x53b285['query'],_0x525f91[_0x26cd('0x35')]));if(_0x53b285[_0x26cd('0x36')][_0x26cd('0x42')]){_0x26bebb[_0x26cd('0x40')]=_['merge'](_0x26bebb[_0x26cd('0x40')],{'$or':_['map'](_0x4dd41b,function(_0x4a7d2f){if(_0x4a7d2f[_0x26cd('0x43')]!==_0x26cd('0x44')){var _0x1cc349={};_0x1cc349[_0x4a7d2f['name']]={'$like':'%'+_0x53b285['query'][_0x26cd('0x42')]+'%'};return _0x1cc349;}})});}_0x26bebb=_[_0x26cd('0x45')]({},_0x26bebb,_0x53b285[_0x26cd('0x46')]);var _0x23673f={'where':_0x26bebb[_0x26cd('0x40')]};return db['Dashboard'][_0x26cd('0x22')](_0x23673f)['then'](function(_0x56a697){_0x4ec034[_0x26cd('0x22')]=_0x56a697;if(_0x53b285['query']['includeAll']){_0x26bebb[_0x26cd('0x47')]=[{'all':!![]}];}return db['Dashboard'][_0x26cd('0x48')](_0x26bebb);})[_0x26cd('0x28')](function(_0x3d9958){_0x4ec034[_0x26cd('0x49')]=_0x3d9958;return _0x4ec034;})['then'](respondWithFilteredResult(_0x2b7c75,_0x26bebb))['catch'](handleError(_0x2b7c75,null));};exports[_0x26cd('0x4a')]=function(_0x31703a,_0x278e36){var _0x5dd4ba={'raw':![],'where':{'id':_0x31703a[_0x26cd('0x4b')]['id']}},_0x3a3628={};_0x3a3628[_0x26cd('0x34')]=_[_0x26cd('0x4c')](db[_0x26cd('0x30')]['rawAttributes']);_0x3a3628[_0x26cd('0x36')]=_[_0x26cd('0x4c')](_0x31703a[_0x26cd('0x36')]);_0x3a3628[_0x26cd('0x35')]=_[_0x26cd('0x38')](_0x3a3628[_0x26cd('0x34')],_0x3a3628[_0x26cd('0x36')]);_0x5dd4ba[_0x26cd('0x37')]=_[_0x26cd('0x38')](_0x3a3628[_0x26cd('0x34')],qs['fields'](_0x31703a['query'][_0x26cd('0x39')]));_0x5dd4ba[_0x26cd('0x37')]=_0x5dd4ba[_0x26cd('0x37')][_0x26cd('0x3a')]?_0x5dd4ba[_0x26cd('0x37')]:_0x3a3628['model'];if(_0x31703a[_0x26cd('0x36')][_0x26cd('0x4d')]){_0x5dd4ba[_0x26cd('0x47')]=[{'all':!![]}];}_0x5dd4ba=_[_0x26cd('0x45')]({},_0x5dd4ba,_0x31703a[_0x26cd('0x46')]);return db[_0x26cd('0x30')]['find'](_0x5dd4ba)[_0x26cd('0x28')](handleEntityNotFound(_0x278e36,null))[_0x26cd('0x28')](respondWithResult(_0x278e36,null))['catch'](handleError(_0x278e36,null));};exports[_0x26cd('0x4e')]=function(_0x42f436,_0x5cdbaf){return db[_0x26cd('0x30')][_0x26cd('0x4e')](_0x42f436[_0x26cd('0x4f')],{})[_0x26cd('0x28')](function(_0x4cd8d1){var _0xc4deb5=_0x42f436[_0x26cd('0x50')]['get']({'plain':!![]});if(!_0xc4deb5)throw new Error(_0x26cd('0x51'));if(_0xc4deb5[_0x26cd('0x52')]===_0x26cd('0x50')){var _0x51106d=_0x4cd8d1[_0x26cd('0x53')]({'plain':!![]});var _0x455434='CustomDashboards';return db[_0x26cd('0x54')][_0x26cd('0x55')]({'where':{'name':_0x455434,'userProfileId':_0xc4deb5[_0x26cd('0x56')]},'raw':!![]})[_0x26cd('0x28')](function(_0x7408c9){if(_0x7408c9&&_0x7408c9['autoAssociation']===0x0){return db[_0x26cd('0x2a')]['create']({'name':_0x51106d[_0x26cd('0x2d')],'resourceId':_0x51106d['id'],'type':_0x7408c9[_0x26cd('0x2d')],'sectionId':_0x7408c9['id']},{})[_0x26cd('0x28')](function(){return _0x4cd8d1;});}else{return _0x4cd8d1;}})[_0x26cd('0x57')](function(_0x38f307){logger[_0x26cd('0x2c')](_0x26cd('0x58'),_0x38f307);throw _0x38f307;});}return _0x4cd8d1;})[_0x26cd('0x28')](respondWithResult(_0x5cdbaf,0xc9))[_0x26cd('0x57')](handleError(_0x5cdbaf,null));};exports[_0x26cd('0x59')]=function(_0x5f5851,_0x340ed7){var _0x5730fb={'where':{'id':_0x5f5851[_0x26cd('0x4b')]['id']}},_0x540f07={};_0x540f07['model']=_[_0x26cd('0x4c')](db[_0x26cd('0x30')][_0x26cd('0x31')]);_0x5730fb['attributes']=_[_0x26cd('0x38')](_0x540f07[_0x26cd('0x34')],qs[_0x26cd('0x39')](_0x5f5851['query'][_0x26cd('0x39')]));_0x5730fb[_0x26cd('0x37')]=_0x5730fb[_0x26cd('0x37')][_0x26cd('0x3a')]?_0x5730fb['attributes']:_0x540f07[_0x26cd('0x34')];if(_0x5f5851[_0x26cd('0x36')][_0x26cd('0x4d')]){_0x5730fb[_0x26cd('0x47')]=[{'all':!![]}];}_0x5730fb=_[_0x26cd('0x45')]({},_0x5730fb,_0x5f5851['options']);return db[_0x26cd('0x30')][_0x26cd('0x55')](_0x5730fb)[_0x26cd('0x28')](handleEntityNotFound(_0x340ed7,null))[_0x26cd('0x28')](function(_0x117837){if(_0x117837){var _0x44bf34=_0x117837[_0x26cd('0x53')]({'plain':!![]});_0x44bf34=qs['omit'](_0x44bf34,['id',_0x26cd('0x5a'),_0x26cd('0x5b')]);_0x5f5851[_0x26cd('0x4f')]=_['omit'](_0x5f5851[_0x26cd('0x4f')],['id',_0x26cd('0x5a'),_0x26cd('0x5b')]);return db[_0x26cd('0x30')][_0x26cd('0x4e')](_[_0x26cd('0x45')](_0x44bf34,_0x5f5851['body']),{'include':_0x5f5851[_0x26cd('0x36')]['includeAll']?[{'all':!![]}]:undefined})[_0x26cd('0x28')](function(_0x333f11){var _0x4a97ed=_0x5f5851['user']['get']({'plain':!![]});if(!_0x4a97ed)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4a97ed[_0x26cd('0x52')]==='user'){var _0x13681d=_0x333f11[_0x26cd('0x53')]({'plain':!![]});var _0x2a2d81=_0x26cd('0x29');return db[_0x26cd('0x54')][_0x26cd('0x55')]({'where':{'name':_0x2a2d81,'userProfileId':_0x4a97ed[_0x26cd('0x56')]},'raw':!![]})[_0x26cd('0x28')](function(_0x5309fb){if(_0x5309fb&&_0x5309fb['autoAssociation']===0x0){return db[_0x26cd('0x2a')]['create']({'name':_0x13681d['name'],'resourceId':_0x13681d['id'],'type':_0x5309fb[_0x26cd('0x2d')],'sectionId':_0x5309fb['id']},{})[_0x26cd('0x28')](function(){return _0x333f11;});}else{return _0x333f11;}})[_0x26cd('0x57')](function(_0x107fb7){logger[_0x26cd('0x2c')](_0x26cd('0x58'),_0x107fb7);throw _0x107fb7;});}return _0x333f11;});}})[_0x26cd('0x28')](respondWithResult(_0x340ed7,0xc9))['catch'](handleError(_0x340ed7,null));};exports[_0x26cd('0x27')]=function(_0x596d27,_0x9c27e7){if(_0x596d27['body']['id']){delete _0x596d27[_0x26cd('0x4f')]['id'];}return db[_0x26cd('0x30')][_0x26cd('0x55')]({'where':{'id':_0x596d27[_0x26cd('0x4b')]['id']}})[_0x26cd('0x28')](handleEntityNotFound(_0x9c27e7,null))[_0x26cd('0x28')](saveUpdates(_0x596d27['body'],null))['then'](respondWithResult(_0x9c27e7,null))[_0x26cd('0x57')](handleError(_0x9c27e7,null));};exports[_0x26cd('0x2b')]=function(_0x1d5de5,_0x1e0f28){return db[_0x26cd('0x30')][_0x26cd('0x55')]({'where':{'id':_0x1d5de5[_0x26cd('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1e0f28,null))[_0x26cd('0x28')](removeEntity(_0x1e0f28,null))['catch'](handleError(_0x1e0f28,null));};function widgetAttributes(_0x357277){try{switch(_0x357277[_0x26cd('0x43')]){case _0x26cd('0x5c'):return[{'name':'attrUrl','value':_0x357277[_0x26cd('0x5d')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x0]?_0x357277['attrs'][0x0]['value']:undefined)||'https://'}];case _0x26cd('0x5f'):return[{'name':_0x26cd('0x60'),'value':_0x357277['attrPath']||(_0x357277['attrs']&&_0x357277[_0x26cd('0x5e')][0x0]?_0x357277[_0x26cd('0x5e')][0x0][_0x26cd('0x61')]:undefined)||''}];case _0x26cd('0x62'):return[{'name':'attrHourFormat','value':_0x357277[_0x26cd('0x63')]||(_0x357277['attrs']&&_0x357277[_0x26cd('0x5e')][0x0]?_0x357277[_0x26cd('0x5e')][0x0]['value']:undefined)||_0x26cd('0x64')},{'name':_0x26cd('0x65'),'value':_0x357277[_0x26cd('0x65')]||(_0x357277['attrs']&&_0x357277['attrs'][0x1]?_0x357277[_0x26cd('0x5e')][0x1][_0x26cd('0x61')]:undefined)||_0x26cd('0x66')},{'name':'attrFontSize','value':_0x357277['attrFontSize']||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x2]?_0x357277[_0x26cd('0x5e')][0x2]['value']:undefined)||0xc}];case _0x26cd('0x67'):return[{'name':'attrMetric','value':_0x357277[_0x26cd('0x68')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x0]?_0x357277['attrs'][0x0][_0x26cd('0x61')]:undefined)||_0x26cd('0x69')},{'name':_0x26cd('0x6a'),'value':_0x357277[_0x26cd('0x6a')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x1]?_0x357277[_0x26cd('0x5e')][0x1][_0x26cd('0x61')]:undefined)||[]},{'name':_0x26cd('0x6b'),'value':_0x357277[_0x26cd('0x6b')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x2]?_0x357277['attrs'][0x2][_0x26cd('0x61')]:undefined)||0x14}];case _0x26cd('0x6c'):case _0x26cd('0x6d'):return[{'name':'attrSerie1','value':_0x357277[_0x26cd('0x6e')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x0]?_0x357277['attrs'][0x0][_0x26cd('0x61')]:undefined)||'total'},{'name':_0x26cd('0x6f'),'value':_0x357277[_0x26cd('0x6f')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x1]?_0x357277[_0x26cd('0x5e')][0x1][_0x26cd('0x61')]:undefined)||null},{'name':_0x26cd('0x70'),'value':_0x357277[_0x26cd('0x70')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x2]?_0x357277['attrs'][0x2][_0x26cd('0x61')]:undefined)||null},{'name':_0x26cd('0x6a'),'value':_0x357277['attrVoiceQueues']||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x3]?_0x357277['attrs'][0x3][_0x26cd('0x61')]:undefined)||[]}];case _0x26cd('0x71'):return[{'name':_0x26cd('0x72'),'type':_0x357277['reportType']||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x0]?_0x357277[_0x26cd('0x5e')][0x0][_0x26cd('0x43')]:undefined)||null,'value':_0x357277[_0x26cd('0x72')]||(_0x357277[_0x26cd('0x5e')]&&_0x357277['attrs'][0x0]?_0x357277[_0x26cd('0x5e')][0x0][_0x26cd('0x61')]:undefined)||null},{'name':_0x26cd('0x73'),'value':_0x357277['attrRefresh']||(_0x357277[_0x26cd('0x5e')]&&_0x357277[_0x26cd('0x5e')][0x1]?_0x357277[_0x26cd('0x5e')][0x1][_0x26cd('0x61')]:undefined)||0x0}];default:return[];}}catch(_0x3703ca){logger[_0x26cd('0x2c')](_0x26cd('0x74'),JSON['stringify'](_0x3703ca));return[];}}exports[_0x26cd('0x75')]=function(_0x44d966,_0x16a9f3,_0x3062fe){if(_0x44d966[_0x26cd('0x4f')]['id']){delete _0x44d966[_0x26cd('0x4f')]['id'];}return db[_0x26cd('0x30')]['find']({'where':{'id':_0x44d966[_0x26cd('0x4b')]['id']}})[_0x26cd('0x28')](handleEntityNotFound(_0x16a9f3,null))[_0x26cd('0x28')](function(_0x30a68a){if(_0x30a68a){_0x44d966[_0x26cd('0x4f')][_0x26cd('0x76')]=_0x30a68a['id'];_0x44d966[_0x26cd('0x4f')][_0x26cd('0x5e')]=widgetAttributes(_0x44d966['body']);return db[_0x26cd('0x77')]['create'](_0x44d966[_0x26cd('0x4f')]);}})['then'](respondWithResult(_0x16a9f3,null))[_0x26cd('0x57')](handleError(_0x16a9f3,null));};exports[_0x26cd('0x78')]=function(_0x1744e7,_0x4ebb63,_0x59a88f){var _0xfc14ae={};var _0x7373ba={};var _0x2f1895;var _0x4f1860;return db[_0x26cd('0x30')]['findOne']({'where':{'id':_0x1744e7['params']['id']}})[_0x26cd('0x28')](handleEntityNotFound(_0x4ebb63,null))['then'](function(_0x524dc8){if(_0x524dc8){_0x2f1895=_0x524dc8;_0x7373ba[_0x26cd('0x34')]=_[_0x26cd('0x4c')](db['DashboardItem'][_0x26cd('0x31')]);_0x7373ba[_0x26cd('0x36')]=_[_0x26cd('0x4c')](_0x1744e7[_0x26cd('0x36')]);_0x7373ba[_0x26cd('0x35')]=_[_0x26cd('0x38')](_0x7373ba[_0x26cd('0x34')],_0x7373ba[_0x26cd('0x36')]);_0xfc14ae['attributes']=_['intersection'](_0x7373ba[_0x26cd('0x34')],qs[_0x26cd('0x39')](_0x1744e7[_0x26cd('0x36')][_0x26cd('0x39')]));_0xfc14ae[_0x26cd('0x37')]=_0xfc14ae[_0x26cd('0x37')][_0x26cd('0x3a')]?_0xfc14ae[_0x26cd('0x37')]:_0x7373ba['model'];_0xfc14ae[_0x26cd('0x3e')]=qs[_0x26cd('0x3f')](_0x1744e7[_0x26cd('0x36')][_0x26cd('0x3f')]);_0xfc14ae['where']=qs[_0x26cd('0x35')](_[_0x26cd('0x41')](_0x1744e7[_0x26cd('0x36')],_0x7373ba[_0x26cd('0x35')]));if(_0x1744e7[_0x26cd('0x36')][_0x26cd('0x42')]){_0xfc14ae[_0x26cd('0x40')]=_[_0x26cd('0x45')](_0xfc14ae['where'],{'$or':_[_0x26cd('0x2f')](_0xfc14ae['attributes'],function(_0x349482){var _0x537417={};_0x537417[_0x349482]={'$like':'%'+_0x1744e7[_0x26cd('0x36')][_0x26cd('0x42')]+'%'};return _0x537417;})});}_0xfc14ae=_[_0x26cd('0x45')]({},_0xfc14ae,_0x1744e7[_0x26cd('0x46')]);return _0x2f1895[_0x26cd('0x78')](_0xfc14ae);}})['then'](function(_0xd9018a){if(_0xd9018a){_0x4f1860=_0xd9018a['length'];if(!_0x1744e7['query'][_0x26cd('0x3b')](_0x26cd('0x3c'))){_0xfc14ae[_0x26cd('0x23')]=qs['limit'](_0x1744e7['query'][_0x26cd('0x23')]);_0xfc14ae[_0x26cd('0x3d')]=qs[_0x26cd('0x3d')](_0x1744e7[_0x26cd('0x36')][_0x26cd('0x3d')]);}return _0x2f1895['getItems'](_0xfc14ae);}})[_0x26cd('0x28')](function(_0x506a81){if(_0x506a81){return _0x506a81?{'count':_0x4f1860,'rows':_0x506a81}:null;}})['then'](respondWithResult(_0x4ebb63,null))[_0x26cd('0x57')](handleError(_0x4ebb63,null));}; \ No newline at end of file +var _0xe1fe=['update','then','CustomDashboards','destroy','stack','name','send','index','map','Dashboard','rawAttributes','model','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','type','merge','includeAll','include','findAll','rows','catch','show','params','options','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','body','userProfileId','error','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','getItems','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save'];(function(_0x599f41,_0x4db732){var _0x2e4d58=function(_0x14c882){while(--_0x14c882){_0x599f41['push'](_0x599f41['shift']());}};_0x2e4d58(++_0x4db732);}(_0xe1fe,0x1c3));var _0xee1f=function(_0x3e7235,_0x159995){_0x3e7235=_0x3e7235-0x0;var _0x29c981=_0xe1fe[_0x3e7235];return _0x29c981;};'use strict';var pdf=require(_0xee1f('0x0'));var emlformat=require(_0xee1f('0x1'));var rimraf=require(_0xee1f('0x2'));var zipdir=require(_0xee1f('0x3'));var jsonpatch=require(_0xee1f('0x4'));var rp=require(_0xee1f('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xee1f('0x6'));var util=require(_0xee1f('0x7'));var path=require(_0xee1f('0x8'));var sox=require(_0xee1f('0x9'));var csv=require(_0xee1f('0xa'));var ejs=require(_0xee1f('0xb'));var fs=require('fs');var _=require(_0xee1f('0xc'));var squel=require(_0xee1f('0xd'));var crypto=require(_0xee1f('0xe'));var jsforce=require(_0xee1f('0xf'));var deskjs=require(_0xee1f('0x10'));var toCsv=require(_0xee1f('0xa'));var querystring=require(_0xee1f('0x11'));var Papa=require(_0xee1f('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xee1f('0x13'));var logger=require(_0xee1f('0x14'))(_0xee1f('0x15'));var utils=require(_0xee1f('0x16'));var config=require(_0xee1f('0x17'));var db=require(_0xee1f('0x18'))['db'];config[_0xee1f('0x19')]=_[_0xee1f('0x1a')](config[_0xee1f('0x19')],{'host':_0xee1f('0x1b'),'port':0x18eb});var socket=require(_0xee1f('0x1c'))(new Redis(config[_0xee1f('0x19')]));require(_0xee1f('0x1d'))[_0xee1f('0x1e')](socket);function respondWithStatusCode(_0x3302c3,_0x4e1073){_0x4e1073=_0x4e1073||0xcc;return function(_0x5a65e7){if(_0x5a65e7){return _0x3302c3[_0xee1f('0x1f')](_0x4e1073);}return _0x3302c3[_0xee1f('0x20')](_0x4e1073)[_0xee1f('0x21')]();};}function respondWithResult(_0x15ebbc,_0x158a8e){_0x158a8e=_0x158a8e||0xc8;return function(_0x264150){if(_0x264150){return _0x15ebbc[_0xee1f('0x20')](_0x158a8e)[_0xee1f('0x22')](_0x264150);}};}function respondWithFilteredResult(_0x26b183,_0x23f77a){return function(_0x4de362){if(_0x4de362){var _0x10cbe3=_0x4de362[_0xee1f('0x23')],_0x52390e=_0x23f77a[_0xee1f('0x24')],_0x4fe1b5=_0x23f77a[_0xee1f('0x24')]+_0x23f77a[_0xee1f('0x25')],_0x363d0e;if(_0x4fe1b5>=_0x10cbe3){_0x4fe1b5=_0x10cbe3;_0x363d0e=0xc8;}else{_0x363d0e=0xce;}_0x26b183[_0xee1f('0x20')](_0x363d0e);return _0x26b183['set'](_0xee1f('0x26'),_0x52390e+'-'+_0x4fe1b5+'/'+_0x10cbe3)[_0xee1f('0x22')](_0x4de362);}return null;};}function patchUpdates(_0x29dad7){return function(_0x27b8e6){try{jsonpatch['apply'](_0x27b8e6,_0x29dad7,!![]);}catch(_0x5a4a34){return BPromise[_0xee1f('0x27')](_0x5a4a34);}return _0x27b8e6[_0xee1f('0x28')]();};}function saveUpdates(_0x361953,_0x4c1fb6){return function(_0x56df3c){if(_0x56df3c){return _0x56df3c[_0xee1f('0x29')](_0x361953)[_0xee1f('0x2a')](function(_0x395044){return _0x395044;});}return null;};}function removeEntity(_0x2103ec,_0x44acef){return function(_0x249070){if(_0x249070){return _0x249070['destroy']()[_0xee1f('0x2a')](function(){var _0x55158d=_0x249070['get']({'plain':!![]});var _0x131848=_0xee1f('0x2b');return db['UserProfileResource'][_0xee1f('0x2c')]({'where':{'type':_0x131848,'resourceId':_0x55158d['id']}})[_0xee1f('0x2a')](function(){return _0x249070;});})[_0xee1f('0x2a')](function(){_0x2103ec['status'](0xcc)[_0xee1f('0x21')]();});}};}function handleEntityNotFound(_0x140816,_0x52d835){return function(_0x58cb06){if(!_0x58cb06){_0x140816[_0xee1f('0x1f')](0x194);}return _0x58cb06;};}function handleError(_0xe62b18,_0x5be320){_0x5be320=_0x5be320||0x1f4;return function(_0x3ffb94){logger['error'](_0x3ffb94[_0xee1f('0x2d')]);if(_0x3ffb94['name']){delete _0x3ffb94[_0xee1f('0x2e')];}_0xe62b18[_0xee1f('0x20')](_0x5be320)[_0xee1f('0x2f')](_0x3ffb94);};}exports[_0xee1f('0x30')]=function(_0x3d0a52,_0x19344b){var _0xdec86f={},_0x4f8c8e={},_0x69c6e0={'count':0x0,'rows':[]};var _0x553601=_[_0xee1f('0x31')](db[_0xee1f('0x32')][_0xee1f('0x33')],function(_0x205ba4){return{'name':_0x205ba4['fieldName'],'type':_0x205ba4['type']['key']};});_0x4f8c8e[_0xee1f('0x34')]=_[_0xee1f('0x31')](_0x553601,_0xee1f('0x2e'));_0x4f8c8e['query']=_[_0xee1f('0x35')](_0x3d0a52['query']);_0x4f8c8e['filters']=_[_0xee1f('0x36')](_0x4f8c8e[_0xee1f('0x34')],_0x4f8c8e['query']);_0xdec86f[_0xee1f('0x37')]=_[_0xee1f('0x36')](_0x4f8c8e[_0xee1f('0x34')],qs[_0xee1f('0x38')](_0x3d0a52[_0xee1f('0x39')]['fields']));_0xdec86f[_0xee1f('0x37')]=_0xdec86f[_0xee1f('0x37')][_0xee1f('0x3a')]?_0xdec86f[_0xee1f('0x37')]:_0x4f8c8e[_0xee1f('0x34')];if(!_0x3d0a52['query'][_0xee1f('0x3b')](_0xee1f('0x3c'))){_0xdec86f['limit']=qs['limit'](_0x3d0a52[_0xee1f('0x39')][_0xee1f('0x25')]);_0xdec86f[_0xee1f('0x24')]=qs[_0xee1f('0x24')](_0x3d0a52[_0xee1f('0x39')]['offset']);}_0xdec86f[_0xee1f('0x3d')]=qs[_0xee1f('0x3e')](_0x3d0a52['query'][_0xee1f('0x3e')]);_0xdec86f[_0xee1f('0x3f')]=qs[_0xee1f('0x40')](_[_0xee1f('0x41')](_0x3d0a52[_0xee1f('0x39')],_0x4f8c8e[_0xee1f('0x40')]));if(_0x3d0a52[_0xee1f('0x39')][_0xee1f('0x42')]){_0xdec86f[_0xee1f('0x3f')]=_['merge'](_0xdec86f['where'],{'$or':_[_0xee1f('0x31')](_0x553601,function(_0x523a13){if(_0x523a13[_0xee1f('0x43')]!=='VIRTUAL'){var _0x105228={};_0x105228[_0x523a13[_0xee1f('0x2e')]]={'$like':'%'+_0x3d0a52[_0xee1f('0x39')][_0xee1f('0x42')]+'%'};return _0x105228;}})});}_0xdec86f=_[_0xee1f('0x44')]({},_0xdec86f,_0x3d0a52['options']);var _0x15a881={'where':_0xdec86f['where']};return db['Dashboard'][_0xee1f('0x23')](_0x15a881)[_0xee1f('0x2a')](function(_0x249ca9){_0x69c6e0[_0xee1f('0x23')]=_0x249ca9;if(_0x3d0a52[_0xee1f('0x39')][_0xee1f('0x45')]){_0xdec86f[_0xee1f('0x46')]=[{'all':!![]}];}return db[_0xee1f('0x32')][_0xee1f('0x47')](_0xdec86f);})[_0xee1f('0x2a')](function(_0xec5457){_0x69c6e0[_0xee1f('0x48')]=_0xec5457;return _0x69c6e0;})[_0xee1f('0x2a')](respondWithFilteredResult(_0x19344b,_0xdec86f))[_0xee1f('0x49')](handleError(_0x19344b,null));};exports[_0xee1f('0x4a')]=function(_0xf2fdf3,_0x2468cb){var _0x29dc1b={'raw':![],'where':{'id':_0xf2fdf3[_0xee1f('0x4b')]['id']}},_0x42ffe3={};_0x42ffe3['model']=_[_0xee1f('0x35')](db[_0xee1f('0x32')]['rawAttributes']);_0x42ffe3['query']=_[_0xee1f('0x35')](_0xf2fdf3[_0xee1f('0x39')]);_0x42ffe3[_0xee1f('0x40')]=_[_0xee1f('0x36')](_0x42ffe3['model'],_0x42ffe3[_0xee1f('0x39')]);_0x29dc1b[_0xee1f('0x37')]=_[_0xee1f('0x36')](_0x42ffe3['model'],qs[_0xee1f('0x38')](_0xf2fdf3['query']['fields']));_0x29dc1b[_0xee1f('0x37')]=_0x29dc1b[_0xee1f('0x37')][_0xee1f('0x3a')]?_0x29dc1b['attributes']:_0x42ffe3[_0xee1f('0x34')];if(_0xf2fdf3[_0xee1f('0x39')][_0xee1f('0x45')]){_0x29dc1b['include']=[{'all':!![]}];}_0x29dc1b=_[_0xee1f('0x44')]({},_0x29dc1b,_0xf2fdf3[_0xee1f('0x4c')]);return db['Dashboard'][_0xee1f('0x4d')](_0x29dc1b)[_0xee1f('0x2a')](handleEntityNotFound(_0x2468cb,null))['then'](respondWithResult(_0x2468cb,null))['catch'](handleError(_0x2468cb,null));};exports['create']=function(_0x5b93d6,_0x5076cc){return db[_0xee1f('0x32')][_0xee1f('0x4e')](_0x5b93d6['body'],{})[_0xee1f('0x2a')](function(_0x6848b9){var _0x223610=_0x5b93d6[_0xee1f('0x4f')][_0xee1f('0x50')]({'plain':!![]});if(!_0x223610)throw new Error(_0xee1f('0x51'));if(_0x223610[_0xee1f('0x52')]==='user'){var _0x176c8b=_0x6848b9[_0xee1f('0x50')]({'plain':!![]});var _0x2c9c94=_0xee1f('0x2b');return db['UserProfileSection']['find']({'where':{'name':_0x2c9c94,'userProfileId':_0x223610['userProfileId']},'raw':!![]})['then'](function(_0x54e4d3){if(_0x54e4d3&&_0x54e4d3[_0xee1f('0x53')]===0x0){return db[_0xee1f('0x54')]['create']({'name':_0x176c8b[_0xee1f('0x2e')],'resourceId':_0x176c8b['id'],'type':_0x54e4d3[_0xee1f('0x2e')],'sectionId':_0x54e4d3['id']},{})[_0xee1f('0x2a')](function(){return _0x6848b9;});}else{return _0x6848b9;}})[_0xee1f('0x49')](function(_0x14dfa7){logger['error'](_0xee1f('0x55'),_0x14dfa7);throw _0x14dfa7;});}return _0x6848b9;})[_0xee1f('0x2a')](respondWithResult(_0x5076cc,0xc9))[_0xee1f('0x49')](handleError(_0x5076cc,null));};exports[_0xee1f('0x56')]=function(_0x1dc5f4,_0x5cff21){var _0x2de796={'where':{'id':_0x1dc5f4[_0xee1f('0x4b')]['id']}},_0x100a4e={};_0x100a4e['model']=_['keys'](db[_0xee1f('0x32')][_0xee1f('0x33')]);_0x2de796[_0xee1f('0x37')]=_[_0xee1f('0x36')](_0x100a4e[_0xee1f('0x34')],qs[_0xee1f('0x38')](_0x1dc5f4[_0xee1f('0x39')][_0xee1f('0x38')]));_0x2de796['attributes']=_0x2de796[_0xee1f('0x37')][_0xee1f('0x3a')]?_0x2de796[_0xee1f('0x37')]:_0x100a4e[_0xee1f('0x34')];if(_0x1dc5f4[_0xee1f('0x39')][_0xee1f('0x45')]){_0x2de796[_0xee1f('0x46')]=[{'all':!![]}];}_0x2de796=_[_0xee1f('0x44')]({},_0x2de796,_0x1dc5f4[_0xee1f('0x4c')]);return db[_0xee1f('0x32')]['find'](_0x2de796)[_0xee1f('0x2a')](handleEntityNotFound(_0x5cff21,null))[_0xee1f('0x2a')](function(_0x25b380){if(_0x25b380){var _0x236043=_0x25b380[_0xee1f('0x50')]({'plain':!![]});_0x236043=qs[_0xee1f('0x57')](_0x236043,['id',_0xee1f('0x58'),_0xee1f('0x59')]);_0x1dc5f4[_0xee1f('0x5a')]=_[_0xee1f('0x57')](_0x1dc5f4[_0xee1f('0x5a')],['id',_0xee1f('0x58'),_0xee1f('0x59')]);return db[_0xee1f('0x32')]['create'](_[_0xee1f('0x44')](_0x236043,_0x1dc5f4[_0xee1f('0x5a')]),{'include':_0x1dc5f4[_0xee1f('0x39')][_0xee1f('0x45')]?[{'all':!![]}]:undefined})[_0xee1f('0x2a')](function(_0x2de2af){var _0x9c5beb=_0x1dc5f4['user'][_0xee1f('0x50')]({'plain':!![]});if(!_0x9c5beb)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x9c5beb[_0xee1f('0x52')]===_0xee1f('0x4f')){var _0x13ecf4=_0x2de2af[_0xee1f('0x50')]({'plain':!![]});var _0x28c757=_0xee1f('0x2b');return db['UserProfileSection'][_0xee1f('0x4d')]({'where':{'name':_0x28c757,'userProfileId':_0x9c5beb[_0xee1f('0x5b')]},'raw':!![]})[_0xee1f('0x2a')](function(_0x2c4643){if(_0x2c4643&&_0x2c4643['autoAssociation']===0x0){return db[_0xee1f('0x54')][_0xee1f('0x4e')]({'name':_0x13ecf4[_0xee1f('0x2e')],'resourceId':_0x13ecf4['id'],'type':_0x2c4643[_0xee1f('0x2e')],'sectionId':_0x2c4643['id']},{})['then'](function(){return _0x2de2af;});}else{return _0x2de2af;}})[_0xee1f('0x49')](function(_0x59c735){logger[_0xee1f('0x5c')](_0xee1f('0x55'),_0x59c735);throw _0x59c735;});}return _0x2de2af;});}})[_0xee1f('0x2a')](respondWithResult(_0x5cff21,0xc9))[_0xee1f('0x49')](handleError(_0x5cff21,null));};exports[_0xee1f('0x29')]=function(_0x2ef896,_0x9c062b){if(_0x2ef896[_0xee1f('0x5a')]['id']){delete _0x2ef896[_0xee1f('0x5a')]['id'];}return db[_0xee1f('0x32')][_0xee1f('0x4d')]({'where':{'id':_0x2ef896[_0xee1f('0x4b')]['id']}})[_0xee1f('0x2a')](handleEntityNotFound(_0x9c062b,null))['then'](saveUpdates(_0x2ef896[_0xee1f('0x5a')],null))['then'](respondWithResult(_0x9c062b,null))['catch'](handleError(_0x9c062b,null));};exports[_0xee1f('0x2c')]=function(_0x53a407,_0x24e5fc){return db['Dashboard'][_0xee1f('0x4d')]({'where':{'id':_0x53a407[_0xee1f('0x4b')]['id']}})[_0xee1f('0x2a')](handleEntityNotFound(_0x24e5fc,null))['then'](removeEntity(_0x24e5fc,null))[_0xee1f('0x49')](handleError(_0x24e5fc,null));};function widgetAttributes(_0x1fafcc){try{switch(_0x1fafcc[_0xee1f('0x43')]){case _0xee1f('0x5d'):return[{'name':_0xee1f('0x5e'),'value':_0x1fafcc[_0xee1f('0x5e')]||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc['attrs'][0x0][_0xee1f('0x60')]:undefined)||'https://'}];case _0xee1f('0x61'):return[{'name':_0xee1f('0x62'),'value':_0x1fafcc['attrPath']||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc[_0xee1f('0x5f')][0x0][_0xee1f('0x60')]:undefined)||''}];case _0xee1f('0x63'):return[{'name':'attrHourFormat','value':_0x1fafcc[_0xee1f('0x64')]||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc[_0xee1f('0x5f')][0x0][_0xee1f('0x60')]:undefined)||_0xee1f('0x65')},{'name':_0xee1f('0x66'),'value':_0x1fafcc[_0xee1f('0x66')]||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x1]?_0x1fafcc[_0xee1f('0x5f')][0x1]['value']:undefined)||_0xee1f('0x67')},{'name':_0xee1f('0x68'),'value':_0x1fafcc['attrFontSize']||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x2]?_0x1fafcc['attrs'][0x2][_0xee1f('0x60')]:undefined)||0xc}];case _0xee1f('0x69'):return[{'name':'attrMetric','value':_0x1fafcc[_0xee1f('0x6a')]||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc['attrs'][0x0][_0xee1f('0x60')]:undefined)||_0xee1f('0x6b')},{'name':_0xee1f('0x6c'),'value':_0x1fafcc[_0xee1f('0x6c')]||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x1]?_0x1fafcc['attrs'][0x1]['value']:undefined)||[]},{'name':_0xee1f('0x68'),'value':_0x1fafcc['attrFontSize']||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x2]?_0x1fafcc[_0xee1f('0x5f')][0x2][_0xee1f('0x60')]:undefined)||0x14}];case _0xee1f('0x6d'):case'pie-chart':return[{'name':_0xee1f('0x6e'),'value':_0x1fafcc[_0xee1f('0x6e')]||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc[_0xee1f('0x5f')][0x0]['value']:undefined)||_0xee1f('0x6b')},{'name':_0xee1f('0x6f'),'value':_0x1fafcc[_0xee1f('0x6f')]||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x1]?_0x1fafcc[_0xee1f('0x5f')][0x1][_0xee1f('0x60')]:undefined)||null},{'name':'attrSerie3','value':_0x1fafcc[_0xee1f('0x70')]||(_0x1fafcc['attrs']&&_0x1fafcc['attrs'][0x2]?_0x1fafcc[_0xee1f('0x5f')][0x2][_0xee1f('0x60')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1fafcc[_0xee1f('0x6c')]||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x3]?_0x1fafcc[_0xee1f('0x5f')][0x3][_0xee1f('0x60')]:undefined)||[]}];case _0xee1f('0x71'):return[{'name':_0xee1f('0x72'),'type':_0x1fafcc[_0xee1f('0x73')]||(_0x1fafcc['attrs']&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc[_0xee1f('0x5f')][0x0][_0xee1f('0x43')]:undefined)||null,'value':_0x1fafcc[_0xee1f('0x72')]||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc[_0xee1f('0x5f')][0x0]?_0x1fafcc[_0xee1f('0x5f')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1fafcc['attrRefresh']||(_0x1fafcc[_0xee1f('0x5f')]&&_0x1fafcc['attrs'][0x1]?_0x1fafcc[_0xee1f('0x5f')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x15f7f9){logger[_0xee1f('0x5c')](_0xee1f('0x74'),JSON[_0xee1f('0x75')](_0x15f7f9));return[];}}exports[_0xee1f('0x76')]=function(_0x4e3f58,_0x4e5672,_0x5816e6){if(_0x4e3f58['body']['id']){delete _0x4e3f58[_0xee1f('0x5a')]['id'];}return db[_0xee1f('0x32')][_0xee1f('0x4d')]({'where':{'id':_0x4e3f58[_0xee1f('0x4b')]['id']}})['then'](handleEntityNotFound(_0x4e5672,null))['then'](function(_0x1c4bd4){if(_0x1c4bd4){_0x4e3f58[_0xee1f('0x5a')][_0xee1f('0x77')]=_0x1c4bd4['id'];_0x4e3f58[_0xee1f('0x5a')][_0xee1f('0x5f')]=widgetAttributes(_0x4e3f58[_0xee1f('0x5a')]);return db[_0xee1f('0x78')]['create'](_0x4e3f58[_0xee1f('0x5a')]);}})[_0xee1f('0x2a')](respondWithResult(_0x4e5672,null))[_0xee1f('0x49')](handleError(_0x4e5672,null));};exports[_0xee1f('0x79')]=function(_0x4de8f9,_0x247b9a,_0x1b86f5){var _0x3ed959={};var _0x51d89d={};var _0xe6fb84;var _0x16b5ca;return db[_0xee1f('0x32')][_0xee1f('0x7a')]({'where':{'id':_0x4de8f9[_0xee1f('0x4b')]['id']}})[_0xee1f('0x2a')](handleEntityNotFound(_0x247b9a,null))[_0xee1f('0x2a')](function(_0x245824){if(_0x245824){_0xe6fb84=_0x245824;_0x51d89d[_0xee1f('0x34')]=_[_0xee1f('0x35')](db['DashboardItem'][_0xee1f('0x33')]);_0x51d89d['query']=_[_0xee1f('0x35')](_0x4de8f9[_0xee1f('0x39')]);_0x51d89d[_0xee1f('0x40')]=_[_0xee1f('0x36')](_0x51d89d[_0xee1f('0x34')],_0x51d89d[_0xee1f('0x39')]);_0x3ed959[_0xee1f('0x37')]=_['intersection'](_0x51d89d['model'],qs[_0xee1f('0x38')](_0x4de8f9[_0xee1f('0x39')][_0xee1f('0x38')]));_0x3ed959[_0xee1f('0x37')]=_0x3ed959[_0xee1f('0x37')]['length']?_0x3ed959[_0xee1f('0x37')]:_0x51d89d[_0xee1f('0x34')];_0x3ed959[_0xee1f('0x3d')]=qs[_0xee1f('0x3e')](_0x4de8f9['query'][_0xee1f('0x3e')]);_0x3ed959[_0xee1f('0x3f')]=qs[_0xee1f('0x40')](_[_0xee1f('0x41')](_0x4de8f9[_0xee1f('0x39')],_0x51d89d[_0xee1f('0x40')]));if(_0x4de8f9[_0xee1f('0x39')]['filter']){_0x3ed959[_0xee1f('0x3f')]=_[_0xee1f('0x44')](_0x3ed959[_0xee1f('0x3f')],{'$or':_[_0xee1f('0x31')](_0x3ed959[_0xee1f('0x37')],function(_0xe1a97a){var _0xa55e1f={};_0xa55e1f[_0xe1a97a]={'$like':'%'+_0x4de8f9[_0xee1f('0x39')][_0xee1f('0x42')]+'%'};return _0xa55e1f;})});}_0x3ed959=_[_0xee1f('0x44')]({},_0x3ed959,_0x4de8f9[_0xee1f('0x4c')]);return _0xe6fb84['getItems'](_0x3ed959);}})[_0xee1f('0x2a')](function(_0x18dfa1){if(_0x18dfa1){_0x16b5ca=_0x18dfa1[_0xee1f('0x3a')];if(!_0x4de8f9[_0xee1f('0x39')][_0xee1f('0x3b')]('nolimit')){_0x3ed959['limit']=qs[_0xee1f('0x25')](_0x4de8f9[_0xee1f('0x39')]['limit']);_0x3ed959['offset']=qs[_0xee1f('0x24')](_0x4de8f9[_0xee1f('0x39')][_0xee1f('0x24')]);}return _0xe6fb84['getItems'](_0x3ed959);}})[_0xee1f('0x2a')](function(_0x21955a){if(_0x21955a){return _0x21955a?{'count':_0x16b5ca,'rows':_0x21955a}:null;}})[_0xee1f('0x2a')](respondWithResult(_0x247b9a,null))[_0xee1f('0x49')](handleError(_0x247b9a,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 64a6020..6741a12 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 _0x5687=['update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','Dashboard','save'];(function(_0x32b8e7,_0x513a41){var _0x4fd845=function(_0x23edbe){while(--_0x23edbe){_0x32b8e7['push'](_0x32b8e7['shift']());}};_0x4fd845(++_0x513a41);}(_0x5687,0x1a3));var _0x7568=function(_0x22651a,_0x131ee8){_0x22651a=_0x22651a-0x0;var _0x518710=_0x5687[_0x22651a];return _0x518710;};'use strict';var EventEmitter=require(_0x7568('0x0'));var Dashboard=require(_0x7568('0x1'))['db'][_0x7568('0x2')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x7568('0x3'),'afterUpdate':_0x7568('0x4'),'afterDestroy':_0x7568('0x5')};function emitEvent(_0x1fe3d2){return function(_0xebd8bc,_0x5edca6,_0x1d17db){DashboardEvents[_0x7568('0x6')](_0x1fe3d2+':'+_0xebd8bc['id'],_0xebd8bc);DashboardEvents[_0x7568('0x6')](_0x1fe3d2,_0xebd8bc);_0x1d17db(null);};}for(var e in events){if(events[_0x7568('0x7')](e)){var event=events[e];Dashboard[_0x7568('0x8')](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file +var _0xa3cc=['../../mysqldb','Dashboard','save','update','remove','emit','hasOwnProperty'];(function(_0x1dc01f,_0x157a75){var _0x298041=function(_0x47fce1){while(--_0x47fce1){_0x1dc01f['push'](_0x1dc01f['shift']());}};_0x298041(++_0x157a75);}(_0xa3cc,0xe0));var _0xca3c=function(_0x59420e,_0x2a66ff){_0x59420e=_0x59420e-0x0;var _0x3f1f06=_0xa3cc[_0x59420e];return _0x3f1f06;};'use strict';var EventEmitter=require('events');var Dashboard=require(_0xca3c('0x0'))['db'][_0xca3c('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xca3c('0x2'),'afterUpdate':_0xca3c('0x3'),'afterDestroy':_0xca3c('0x4')};function emitEvent(_0x58bde2){return function(_0x1d7648,_0x90d4d9,_0x1045d2){DashboardEvents[_0xca3c('0x5')](_0x58bde2+':'+_0x1d7648['id'],_0x1d7648);DashboardEvents[_0xca3c('0x5')](_0x58bde2,_0x1d7648);_0x1045d2(null);};}for(var e in events){if(events[_0xca3c('0x6')](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module['exports']=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 212906d..012d52c 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 _0x8971=['dashboards','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','exports','define'];(function(_0x56ccd2,_0x1fbef1){var _0x341819=function(_0x5b0bc1){while(--_0x5b0bc1){_0x56ccd2['push'](_0x56ccd2['shift']());}};_0x341819(++_0x1fbef1);}(_0x8971,0x1af));var _0x1897=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0x8971[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x1897('0x0'));var util=require(_0x1897('0x1'));var logger=require(_0x1897('0x2'))(_0x1897('0x3'));var moment=require('moment');var BPromise=require(_0x1897('0x4'));var rp=require(_0x1897('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1897('0x6'));var config=require('../../config/environment');var attributes=require('./dashboard.attributes');module[_0x1897('0x7')]=function(_0x1c2203,_0x61d4c5){return _0x1c2203[_0x1897('0x8')]('Dashboard',attributes,{'tableName':_0x1897('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc6f0=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./dashboard.attributes','exports','define','Dashboard','util'];(function(_0x64b6e,_0x391478){var _0x5d4448=function(_0x56985d){while(--_0x56985d){_0x64b6e['push'](_0x64b6e['shift']());}};_0x5d4448(++_0x391478);}(_0xc6f0,0x14f));var _0x0c6f=function(_0x46c70c,_0x1b8925){_0x46c70c=_0x46c70c-0x0;var _0x452ecb=_0xc6f0[_0x46c70c];return _0x452ecb;};'use strict';var _=require('lodash');var util=require(_0x0c6f('0x0'));var logger=require('../../config/logger')(_0x0c6f('0x1'));var moment=require(_0x0c6f('0x2'));var BPromise=require(_0x0c6f('0x3'));var rp=require(_0x0c6f('0x4'));var fs=require('fs');var path=require(_0x0c6f('0x5'));var rimraf=require(_0x0c6f('0x6'));var config=require(_0x0c6f('0x7'));var attributes=require(_0x0c6f('0x8'));module[_0x0c6f('0x9')]=function(_0x105f5e,_0x284c97){return _0x105f5e[_0x0c6f('0xa')](_0x0c6f('0xb'),attributes,{'tableName':'dashboards','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.rpc.js b/server/api/dashboard/dashboard.rpc.js index da42a44..42411d9 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 _0x21dc=['client','redis','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5df2d9,_0x322f12){var _0x250b96=function(_0x130f76){while(--_0x130f76){_0x5df2d9['push'](_0x5df2d9['shift']());}};_0x250b96(++_0x322f12);}(_0x21dc,0xa4));var _0xc21d=function(_0x18a020,_0x592bc1){_0x18a020=_0x18a020-0x0;var _0x2054ce=_0x21dc[_0x18a020];return _0x2054ce;};'use strict';var _=require(_0xc21d('0x0'));var util=require(_0xc21d('0x1'));var moment=require(_0xc21d('0x2'));var BPromise=require(_0xc21d('0x3'));var rs=require(_0xc21d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc21d('0x5'));var logger=require(_0xc21d('0x6'))(_0xc21d('0x7'));var config=require(_0xc21d('0x8'));var jayson=require(_0xc21d('0x9'));var client=jayson[_0xc21d('0xa')]['http']({'port':0x232a});config[_0xc21d('0xb')]=_['defaults'](config[_0xc21d('0xb')],{'host':_0xc21d('0xc'),'port':0x18eb});var socket=require(_0xc21d('0xd'))(new Redis(config[_0xc21d('0xb')]));require(_0xc21d('0xe'))[_0xc21d('0xf')](socket);function respondWithRpcPromise(_0x47b6ce,_0x3b370e,_0x34916b){return new BPromise(function(_0x57aa06,_0x33f068){return client[_0xc21d('0x10')](_0x47b6ce,_0x34916b)[_0xc21d('0x11')](function(_0x4112ef){logger[_0xc21d('0x12')](_0xc21d('0x13'),_0x3b370e,'request\x20sent');logger[_0xc21d('0x14')](_0xc21d('0x15'),_0x3b370e,_0xc21d('0x16'),JSON[_0xc21d('0x17')](_0x4112ef));if(_0x4112ef['error']){if(_0x4112ef[_0xc21d('0x18')][_0xc21d('0x19')]===0x1f4){logger[_0xc21d('0x18')](_0xc21d('0x13'),_0x3b370e,_0x4112ef[_0xc21d('0x18')][_0xc21d('0x1a')]);return _0x33f068(_0x4112ef['error']['message']);}logger[_0xc21d('0x18')](_0xc21d('0x13'),_0x3b370e,_0x4112ef[_0xc21d('0x18')][_0xc21d('0x1a')]);return _0x57aa06(_0x4112ef[_0xc21d('0x18')]['message']);}else{logger[_0xc21d('0x12')](_0xc21d('0x13'),_0x3b370e,_0xc21d('0x16'));_0x57aa06(_0x4112ef[_0xc21d('0x1b')]['message']);}})[_0xc21d('0x1c')](function(_0x3deeea){logger[_0xc21d('0x18')](_0xc21d('0x13'),_0x3b370e,_0x3deeea);_0x33f068(_0x3deeea);});});} \ No newline at end of file +var _0xd889=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','moment','ioredis','../../config/utils','../../config/environment'];(function(_0x5a9bba,_0x19138a){var _0x445aa1=function(_0x1c56be){while(--_0x1c56be){_0x5a9bba['push'](_0x5a9bba['shift']());}};_0x445aa1(++_0x19138a);}(_0xd889,0x15c));var _0x9d88=function(_0x56f912,_0x20830d){_0x56f912=_0x56f912-0x0;var _0x32ab70=_0xd889[_0x56f912];return _0x32ab70;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x9d88('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9d88('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x9d88('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0x9d88('0x3'));var jayson=require(_0x9d88('0x4'));var client=jayson['client'][_0x9d88('0x5')]({'port':0x232a});config[_0x9d88('0x6')]=_[_0x9d88('0x7')](config[_0x9d88('0x6')],{'host':_0x9d88('0x8'),'port':0x18eb});var socket=require(_0x9d88('0x9'))(new Redis(config[_0x9d88('0x6')]));require(_0x9d88('0xa'))[_0x9d88('0xb')](socket);function respondWithRpcPromise(_0x129be8,_0x22263e,_0x2bdcd4){return new BPromise(function(_0x4932e2,_0x4002eb){return client['request'](_0x129be8,_0x2bdcd4)[_0x9d88('0xc')](function(_0x3a5765){logger[_0x9d88('0xd')](_0x9d88('0xe'),_0x22263e,_0x9d88('0xf'));logger[_0x9d88('0x10')](_0x9d88('0x11'),_0x22263e,'request\x20sent',JSON[_0x9d88('0x12')](_0x3a5765));if(_0x3a5765[_0x9d88('0x13')]){if(_0x3a5765[_0x9d88('0x13')]['code']===0x1f4){logger[_0x9d88('0x13')]('Dashboard,\x20%s,\x20%s',_0x22263e,_0x3a5765[_0x9d88('0x13')][_0x9d88('0x14')]);return _0x4002eb(_0x3a5765[_0x9d88('0x13')][_0x9d88('0x14')]);}logger[_0x9d88('0x13')](_0x9d88('0xe'),_0x22263e,_0x3a5765[_0x9d88('0x13')][_0x9d88('0x14')]);return _0x4932e2(_0x3a5765[_0x9d88('0x13')]['message']);}else{logger[_0x9d88('0xd')](_0x9d88('0xe'),_0x22263e,_0x9d88('0xf'));_0x4932e2(_0x3a5765[_0x9d88('0x15')]['message']);}})['catch'](function(_0x2142b8){logger[_0x9d88('0x13')](_0x9d88('0xe'),_0x22263e,_0x2142b8);_0x4002eb(_0x2142b8);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index 3a0f95f..c59a6d6 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 _0x1f6f=['emit','register','length','save','update'];(function(_0x2713eb,_0x45818d){var _0x3a28da=function(_0x89d277){while(--_0x89d277){_0x2713eb['push'](_0x2713eb['shift']());}};_0x3a28da(++_0x45818d);}(_0x1f6f,0x12a));var _0xf1f6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1f6f[_0x3dd15e];return _0x231fd0;};'use strict';var DashboardEvents=require('./dashboard.events');var events=[_0xf1f6('0x0'),'remove',_0xf1f6('0x1')];function createListener(_0x35c447,_0x21be85){return function(_0x4938be){_0x21be85[_0xf1f6('0x2')](_0x35c447,_0x4938be);};}function removeListener(_0x36b335,_0x1a6029){return function(){DashboardEvents['removeListener'](_0x36b335,_0x1a6029);};}exports[_0xf1f6('0x3')]=function(_0x4add21){for(var _0x338782=0x0,_0x16c4ba=events[_0xf1f6('0x4')];_0x338782<_0x16c4ba;_0x338782++){var _0x119f29=events[_0x338782];var _0x5904b2=createListener('dashboard:'+_0x119f29,_0x4add21);DashboardEvents['on'](_0x119f29,_0x5904b2);}}; \ No newline at end of file +var _0x3dfa=['removeListener','register','./dashboard.events','remove','update','emit'];(function(_0x1ce2fc,_0xcbf996){var _0x1b1d97=function(_0x11bd6e){while(--_0x11bd6e){_0x1ce2fc['push'](_0x1ce2fc['shift']());}};_0x1b1d97(++_0xcbf996);}(_0x3dfa,0x176));var _0xa3df=function(_0x4b3368,_0x5338b2){_0x4b3368=_0x4b3368-0x0;var _0x443905=_0x3dfa[_0x4b3368];return _0x443905;};'use strict';var DashboardEvents=require(_0xa3df('0x0'));var events=['save',_0xa3df('0x1'),_0xa3df('0x2')];function createListener(_0x5de2b4,_0x5cbe54){return function(_0x1a4748){_0x5cbe54[_0xa3df('0x3')](_0x5de2b4,_0x1a4748);};}function removeListener(_0x3678dc,_0x384c05){return function(){DashboardEvents[_0xa3df('0x4')](_0x3678dc,_0x384c05);};}exports[_0xa3df('0x5')]=function(_0x1a2bec){for(var _0x2e9d5e=0x0,_0x202e51=events['length'];_0x2e9d5e<_0x202e51;_0x2e9d5e++){var _0x5579be=events[_0x2e9d5e];var _0x565216=createListener('dashboard:'+_0x5579be,_0x1a2bec);DashboardEvents['on'](_0x5579be,_0x565216);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 4a05bf2..86a2a3b 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0xf26b8f,_0x57f36d){var _0x320c9b=function(_0x5ecb1f){while(--_0x5ecb1f){_0xf26b8f['push'](_0xf26b8f['shift']());}};_0x320c9b(++_0x57f36d);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3071('0x0'));var timeout=require(_0x3071('0x1'));var express=require(_0x3071('0x2'));var router=express[_0x3071('0x3')]();var auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0x70e0=['util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','/:id/items','isAuthenticated','getItems','post','/:id/clone','clone','addItem','put','/:id','update','multer'];(function(_0x20d322,_0x1049e9){var _0x4d363d=function(_0x54b5d4){while(--_0x54b5d4){_0x20d322['push'](_0x20d322['shift']());}};_0x4d363d(++_0x1049e9);}(_0x70e0,0x17b));var _0x070e=function(_0x3b5bc9,_0x1dabd0){_0x3b5bc9=_0x3b5bc9-0x0;var _0x318c7b=_0x70e0[_0x3b5bc9];return _0x318c7b;};'use strict';var multer=require(_0x070e('0x0'));var util=require(_0x070e('0x1'));var path=require(_0x070e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x070e('0x3')]();var auth=require(_0x070e('0x4'));var interaction=require(_0x070e('0x5'));var config=require(_0x070e('0x6'));var controller=require('./dashboard.controller');router[_0x070e('0x7')]('/',auth['isAuthenticated'](),controller[_0x070e('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x070e('0x9')]);router[_0x070e('0x7')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0xc')]);router[_0x070e('0xd')]('/',auth[_0x070e('0xb')](),controller['create']);router['post'](_0x070e('0xe'),auth[_0x070e('0xb')](),controller[_0x070e('0xf')]);router[_0x070e('0xd')](_0x070e('0xa'),auth[_0x070e('0xb')](),controller[_0x070e('0x10')]);router[_0x070e('0x11')](_0x070e('0x12'),auth[_0x070e('0xb')](),controller[_0x070e('0x13')]);router['delete']('/:id',auth[_0x070e('0xb')](),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 68ae1b6..c600e5e 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 _0x352f=['exports','STRING','TEXT','long','parse','attrs','setDataValue','INTEGER','#2196f3','squel','lodash'];(function(_0x586d34,_0x92c20d){var _0x10f5d8=function(_0x217b30){while(--_0x217b30){_0x586d34['push'](_0x586d34['shift']());}};_0x10f5d8(++_0x92c20d);}(_0x352f,0x132));var _0xf352=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x352f[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require('sequelize');var squel=require(_0xf352('0x0'));var _=require(_0xf352('0x1'));module[_0xf352('0x2')]={'title':{'type':Sequelize[_0xf352('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xf352('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0xf352('0x4')](_0xf352('0x5')),'get':function(){try{return JSON[_0xf352('0x6')](this['getDataValue'](_0xf352('0x7')));}catch(_0xb85cb0){return[];}},'set':function(_0x5265de){try{this['setDataValue'](_0xf352('0x7'),JSON['stringify'](_0x5265de));}catch(_0x2d2328){this[_0xf352('0x8')](_0xf352('0x7'),JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0xf352('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0xf352('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0xf352('0x9')]},'col':{'type':Sequelize[_0xf352('0x9')]},'background':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0xf352('0x3')],'allowNull':![],'defaultValue':_0xf352('0xa'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xa0c3=['setDataValue','attrs','stringify','INTEGER','#ffffff','#2196f3','squel','lodash','exports','STRING','TEXT','parse','getDataValue'];(function(_0x4792c8,_0x5158a1){var _0x35edb1=function(_0x2472d3){while(--_0x2472d3){_0x4792c8['push'](_0x4792c8['shift']());}};_0x35edb1(++_0x5158a1);}(_0xa0c3,0x1cd));var _0x3a0c=function(_0x2fd5d4,_0x513dc4){_0x2fd5d4=_0x2fd5d4-0x0;var _0x5237d9=_0xa0c3[_0x2fd5d4];return _0x5237d9;};'use strict';var Sequelize=require('sequelize');var squel=require(_0x3a0c('0x0'));var _=require(_0x3a0c('0x1'));module[_0x3a0c('0x2')]={'title':{'type':Sequelize[_0x3a0c('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x3a0c('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3a0c('0x4')]('long'),'get':function(){try{return JSON[_0x3a0c('0x5')](this[_0x3a0c('0x6')]('attrs'));}catch(_0x4d07b0){return[];}},'set':function(_0x26d4fb){try{this[_0x3a0c('0x7')](_0x3a0c('0x8'),JSON[_0x3a0c('0x9')](_0x26d4fb));}catch(_0x4d4ea1){this[_0x3a0c('0x7')](_0x3a0c('0x8'),JSON[_0x3a0c('0x9')]([]));}}},'sizeX':{'type':Sequelize[_0x3a0c('0xa')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x3a0c('0xa')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x3a0c('0xa')]},'col':{'type':Sequelize[_0x3a0c('0xa')]},'background':{'type':Sequelize[_0x3a0c('0x3')],'allowNull':![],'defaultValue':_0x3a0c('0xb'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3a0c('0x3')],'allowNull':![],'defaultValue':_0x3a0c('0xc'),'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 0ce5d2e..21bd748 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 _0x987f=['attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./dashboardItem.socket','register','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','sendStatus','error','stack','name','show','params','DashboardItem','rawAttributes','query','keys','intersection','model','fields','attributes','length','includeAll','include','merge','options','then','catch','destroy','find','type','iframe','attrUrl','attrs','value','https://','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','counter'];(function(_0x5b8e88,_0x1cc7a1){var _0x2ae0da=function(_0x2f2cf8){while(--_0x2f2cf8){_0x5b8e88['push'](_0x5b8e88['shift']());}};_0x2ae0da(++_0x1cc7a1);}(_0x987f,0x178));var _0xf987=function(_0x5ac7d7,_0x109040){_0x5ac7d7=_0x5ac7d7-0x0;var _0x23955f=_0x987f[_0x5ac7d7];return _0x23955f;};'use strict';var pdf=require(_0xf987('0x0'));var emlformat=require(_0xf987('0x1'));var rimraf=require(_0xf987('0x2'));var zipdir=require(_0xf987('0x3'));var jsonpatch=require(_0xf987('0x4'));var rp=require('request-promise');var moment=require(_0xf987('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xf987('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xf987('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf987('0x8'));var squel=require(_0xf987('0x9'));var crypto=require(_0xf987('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xf987('0xb'));var toCsv=require(_0xf987('0x7'));var querystring=require(_0xf987('0xc'));var Papa=require(_0xf987('0xd'));var Redis=require(_0xf987('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf987('0xf'));var as=require(_0xf987('0x10'));var hardwareService=require(_0xf987('0x11'));var logger=require(_0xf987('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xf987('0x13'));var db=require(_0xf987('0x14'))['db'];config[_0xf987('0x15')]=_['defaults'](config['redis'],{'host':_0xf987('0x16'),'port':0x18eb});var socket=require(_0xf987('0x17'))(new Redis(config['redis']));require(_0xf987('0x18'))[_0xf987('0x19')](socket);function respondWithStatusCode(_0x3bc4c2,_0x5d9ea4){_0x5d9ea4=_0x5d9ea4||0xcc;return function(_0x3a2eea){if(_0x3a2eea){return _0x3bc4c2['sendStatus'](_0x5d9ea4);}return _0x3bc4c2['status'](_0x5d9ea4)[_0xf987('0x1a')]();};}function respondWithResult(_0x48daaa,_0x8ed327){_0x8ed327=_0x8ed327||0xc8;return function(_0x35a18c){if(_0x35a18c){return _0x48daaa['status'](_0x8ed327)['json'](_0x35a18c);}};}function respondWithFilteredResult(_0x1361fc,_0x2231e7){return function(_0x2d4655){if(_0x2d4655){var _0x58c57e=_0x2d4655[_0xf987('0x1b')],_0x473ace=_0x2231e7['offset'],_0x11799e=_0x2231e7[_0xf987('0x1c')]+_0x2231e7[_0xf987('0x1d')],_0x3807b3;if(_0x11799e>=_0x58c57e){_0x11799e=_0x58c57e;_0x3807b3=0xc8;}else{_0x3807b3=0xce;}_0x1361fc[_0xf987('0x1e')](_0x3807b3);return _0x1361fc[_0xf987('0x1f')](_0xf987('0x20'),_0x473ace+'-'+_0x11799e+'/'+_0x58c57e)[_0xf987('0x21')](_0x2d4655);}return null;};}function patchUpdates(_0x53b1a7){return function(_0x4d9138){try{jsonpatch[_0xf987('0x22')](_0x4d9138,_0x53b1a7,!![]);}catch(_0x3da853){return BPromise[_0xf987('0x23')](_0x3da853);}return _0x4d9138[_0xf987('0x24')]();};}function saveUpdates(_0x2c558c,_0x2fc63b){return function(_0x2e26d6){if(_0x2e26d6){return _0x2e26d6[_0xf987('0x25')](_0x2c558c)['then'](function(_0xaac37){return _0xaac37;});}return null;};}function removeEntity(_0x2c7d25,_0xb73e34){return function(_0x354236){if(_0x354236){return _0x354236['destroy']()['then'](function(){_0x2c7d25[_0xf987('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x71f8a7,_0x393d80){return function(_0x464b28){if(!_0x464b28){_0x71f8a7[_0xf987('0x26')](0x194);}return _0x464b28;};}function handleError(_0xff726c,_0x4a371){_0x4a371=_0x4a371||0x1f4;return function(_0x40c86f){logger[_0xf987('0x27')](_0x40c86f[_0xf987('0x28')]);if(_0x40c86f[_0xf987('0x29')]){delete _0x40c86f['name'];}_0xff726c[_0xf987('0x1e')](_0x4a371)['send'](_0x40c86f);};}exports[_0xf987('0x2a')]=function(_0x1ef34b,_0x453e4c){var _0x5328b5={'raw':![],'where':{'id':_0x1ef34b[_0xf987('0x2b')]['id']}},_0x4f17c0={};_0x4f17c0['model']=_['keys'](db[_0xf987('0x2c')][_0xf987('0x2d')]);_0x4f17c0[_0xf987('0x2e')]=_[_0xf987('0x2f')](_0x1ef34b[_0xf987('0x2e')]);_0x4f17c0['filters']=_[_0xf987('0x30')](_0x4f17c0[_0xf987('0x31')],_0x4f17c0[_0xf987('0x2e')]);_0x5328b5['attributes']=_[_0xf987('0x30')](_0x4f17c0[_0xf987('0x31')],qs[_0xf987('0x32')](_0x1ef34b['query'][_0xf987('0x32')]));_0x5328b5[_0xf987('0x33')]=_0x5328b5[_0xf987('0x33')][_0xf987('0x34')]?_0x5328b5[_0xf987('0x33')]:_0x4f17c0[_0xf987('0x31')];if(_0x1ef34b[_0xf987('0x2e')][_0xf987('0x35')]){_0x5328b5[_0xf987('0x36')]=[{'all':!![]}];}_0x5328b5=_[_0xf987('0x37')]({},_0x5328b5,_0x1ef34b[_0xf987('0x38')]);return db[_0xf987('0x2c')]['find'](_0x5328b5)[_0xf987('0x39')](handleEntityNotFound(_0x453e4c,null))['then'](respondWithResult(_0x453e4c,null))[_0xf987('0x3a')](handleError(_0x453e4c,null));};exports[_0xf987('0x3b')]=function(_0x189ec0,_0x3ebec5){return db[_0xf987('0x2c')][_0xf987('0x3c')]({'where':{'id':_0x189ec0[_0xf987('0x2b')]['id']}})[_0xf987('0x39')](handleEntityNotFound(_0x3ebec5,null))['then'](removeEntity(_0x3ebec5,null))['catch'](handleError(_0x3ebec5,null));};function widgetAttributes(_0x327ec3){try{switch(_0x327ec3[_0xf987('0x3d')]){case _0xf987('0x3e'):return[{'name':_0xf987('0x3f'),'value':_0x327ec3[_0xf987('0x3f')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3['attrs'][0x0]?_0x327ec3[_0xf987('0x40')][0x0][_0xf987('0x41')]:undefined)||_0xf987('0x42')}];case'custom':return[{'name':_0xf987('0x43'),'value':_0x327ec3[_0xf987('0x43')]||(_0x327ec3['attrs']&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3[_0xf987('0x40')][0x0]['value']:undefined)||''}];case _0xf987('0x44'):return[{'name':_0xf987('0x45'),'value':_0x327ec3[_0xf987('0x45')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3[_0xf987('0x40')][0x0][_0xf987('0x41')]:undefined)||'HH:mm:ss'},{'name':_0xf987('0x46'),'value':_0x327ec3[_0xf987('0x46')]||(_0x327ec3['attrs']&&_0x327ec3[_0xf987('0x40')][0x1]?_0x327ec3['attrs'][0x1][_0xf987('0x41')]:undefined)||_0xf987('0x47')},{'name':_0xf987('0x48'),'value':_0x327ec3['attrFontSize']||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x2]?_0x327ec3[_0xf987('0x40')][0x2][_0xf987('0x41')]:undefined)||0xc}];case _0xf987('0x49'):return[{'name':_0xf987('0x4a'),'value':_0x327ec3[_0xf987('0x4a')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3[_0xf987('0x40')][0x0][_0xf987('0x41')]:undefined)||_0xf987('0x4b')},{'name':_0xf987('0x4c'),'value':_0x327ec3[_0xf987('0x4c')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3['attrs'][0x1]?_0x327ec3[_0xf987('0x40')][0x1][_0xf987('0x41')]:undefined)||[]},{'name':_0xf987('0x48'),'value':_0x327ec3[_0xf987('0x48')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x2]?_0x327ec3[_0xf987('0x40')][0x2][_0xf987('0x41')]:undefined)||0x14}];case _0xf987('0x4d'):case _0xf987('0x4e'):return[{'name':_0xf987('0x4f'),'value':_0x327ec3[_0xf987('0x4f')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3['attrs'][0x0][_0xf987('0x41')]:undefined)||_0xf987('0x4b')},{'name':_0xf987('0x50'),'value':_0x327ec3[_0xf987('0x50')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x1]?_0x327ec3[_0xf987('0x40')][0x1][_0xf987('0x41')]:undefined)||null},{'name':_0xf987('0x51'),'value':_0x327ec3[_0xf987('0x51')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x2]?_0x327ec3['attrs'][0x2][_0xf987('0x41')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x327ec3[_0xf987('0x4c')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3['attrs'][0x3]?_0x327ec3[_0xf987('0x40')][0x3]['value']:undefined)||[]}];case _0xf987('0x52'):return[{'name':_0xf987('0x53'),'type':_0x327ec3[_0xf987('0x54')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3[_0xf987('0x40')][0x0]['type']:undefined)||null,'value':_0x327ec3[_0xf987('0x53')]||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x0]?_0x327ec3['attrs'][0x0][_0xf987('0x41')]:undefined)||null},{'name':_0xf987('0x55'),'value':_0x327ec3['attrRefresh']||(_0x327ec3[_0xf987('0x40')]&&_0x327ec3[_0xf987('0x40')][0x1]?_0x327ec3[_0xf987('0x40')][0x1][_0xf987('0x41')]:undefined)||0x0}];default:return[];}}catch(_0x57fed1){logger[_0xf987('0x27')](_0xf987('0x56'),JSON[_0xf987('0x57')](_0x57fed1));return[];}}exports[_0xf987('0x58')]=function(_0x489613,_0x57f80a){if(_0x489613[_0xf987('0x59')]){_0x489613[_0xf987('0x59')]['attrs']=widgetAttributes(_0x489613[_0xf987('0x59')]);}return db[_0xf987('0x2c')][_0xf987('0x58')](_0x489613[_0xf987('0x59')],{})[_0xf987('0x39')](respondWithResult(_0x57f80a,0xc9))['catch'](handleError(_0x57f80a,null));};exports[_0xf987('0x25')]=function(_0x5b2e11,_0x7ea826){if(_0x5b2e11[_0xf987('0x59')]['id']){delete _0x5b2e11[_0xf987('0x59')]['id'];}_0x5b2e11[_0xf987('0x59')][_0xf987('0x40')]=widgetAttributes(_0x5b2e11[_0xf987('0x59')]);return db[_0xf987('0x2c')]['find']({'where':{'id':_0x5b2e11[_0xf987('0x2b')]['id']}})[_0xf987('0x39')](handleEntityNotFound(_0x7ea826,null))[_0xf987('0x39')](saveUpdates(_0x5b2e11[_0xf987('0x59')],null))['then'](respondWithResult(_0x7ea826,null))['catch'](handleError(_0x7ea826,null));}; \ No newline at end of file +var _0x7982=['attrFontSize','attrMetric','total','attrVoiceQueues','pie-chart','attrSerie1','attrSerie2','attrSerie3','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','create','body','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','sendStatus','status','end','count','offset','json','apply','reject','save','then','destroy','error','stack','name','send','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','attrUrl','attrs','custom','value','clock','attrHourFormat','attrTimezone','0.00'];(function(_0x5cfb92,_0x5797e6){var _0x1cd7c2=function(_0x1bb452){while(--_0x1bb452){_0x5cfb92['push'](_0x5cfb92['shift']());}};_0x1cd7c2(++_0x5797e6);}(_0x7982,0x169));var _0x2798=function(_0x59c301,_0x359c50){_0x59c301=_0x59c301-0x0;var _0x3866b9=_0x7982[_0x59c301];return _0x3866b9;};'use strict';var pdf=require(_0x2798('0x0'));var emlformat=require(_0x2798('0x1'));var rimraf=require(_0x2798('0x2'));var zipdir=require(_0x2798('0x3'));var jsonpatch=require(_0x2798('0x4'));var rp=require(_0x2798('0x5'));var moment=require(_0x2798('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x2798('0x7'));var util=require('util');var path=require(_0x2798('0x8'));var sox=require(_0x2798('0x9'));var csv=require(_0x2798('0xa'));var ejs=require(_0x2798('0xb'));var fs=require('fs');var _=require(_0x2798('0xc'));var squel=require(_0x2798('0xd'));var crypto=require(_0x2798('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x2798('0xf'));var toCsv=require('to-csv');var querystring=require(_0x2798('0x10'));var Papa=require(_0x2798('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2798('0x12'));var as=require(_0x2798('0x13'));var hardwareService=require(_0x2798('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x2798('0x15'));var config=require(_0x2798('0x16'));var db=require(_0x2798('0x17'))['db'];config[_0x2798('0x18')]=_[_0x2798('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2798('0x1a'))(new Redis(config[_0x2798('0x18')]));require(_0x2798('0x1b'))[_0x2798('0x1c')](socket);function respondWithStatusCode(_0x35e3e0,_0x4ca9c0){_0x4ca9c0=_0x4ca9c0||0xcc;return function(_0x204629){if(_0x204629){return _0x35e3e0[_0x2798('0x1d')](_0x4ca9c0);}return _0x35e3e0[_0x2798('0x1e')](_0x4ca9c0)[_0x2798('0x1f')]();};}function respondWithResult(_0x442021,_0x8750f4){_0x8750f4=_0x8750f4||0xc8;return function(_0x35164b){if(_0x35164b){return _0x442021[_0x2798('0x1e')](_0x8750f4)['json'](_0x35164b);}};}function respondWithFilteredResult(_0xaf9ef1,_0x5b691e){return function(_0x5f584c){if(_0x5f584c){var _0x205394=_0x5f584c[_0x2798('0x20')],_0x4b171c=_0x5b691e[_0x2798('0x21')],_0x594271=_0x5b691e[_0x2798('0x21')]+_0x5b691e['limit'],_0x36fb51;if(_0x594271>=_0x205394){_0x594271=_0x205394;_0x36fb51=0xc8;}else{_0x36fb51=0xce;}_0xaf9ef1[_0x2798('0x1e')](_0x36fb51);return _0xaf9ef1['set']('Content-Range',_0x4b171c+'-'+_0x594271+'/'+_0x205394)[_0x2798('0x22')](_0x5f584c);}return null;};}function patchUpdates(_0x26a711){return function(_0x20d157){try{jsonpatch[_0x2798('0x23')](_0x20d157,_0x26a711,!![]);}catch(_0x3c77ab){return BPromise[_0x2798('0x24')](_0x3c77ab);}return _0x20d157[_0x2798('0x25')]();};}function saveUpdates(_0x3a9432,_0x482c87){return function(_0x17fb04){if(_0x17fb04){return _0x17fb04['update'](_0x3a9432)[_0x2798('0x26')](function(_0x2d0577){return _0x2d0577;});}return null;};}function removeEntity(_0x169cd1,_0x4a72c3){return function(_0x14e8a8){if(_0x14e8a8){return _0x14e8a8[_0x2798('0x27')]()[_0x2798('0x26')](function(){_0x169cd1[_0x2798('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2314dc,_0x29eeb8){return function(_0x1c273f){if(!_0x1c273f){_0x2314dc[_0x2798('0x1d')](0x194);}return _0x1c273f;};}function handleError(_0x45ddcf,_0x5fb02e){_0x5fb02e=_0x5fb02e||0x1f4;return function(_0x15a3df){logger[_0x2798('0x28')](_0x15a3df[_0x2798('0x29')]);if(_0x15a3df[_0x2798('0x2a')]){delete _0x15a3df[_0x2798('0x2a')];}_0x45ddcf[_0x2798('0x1e')](_0x5fb02e)[_0x2798('0x2b')](_0x15a3df);};}exports[_0x2798('0x2c')]=function(_0x386c08,_0x480bfd){var _0x430433={'raw':![],'where':{'id':_0x386c08[_0x2798('0x2d')]['id']}},_0x5300e3={};_0x5300e3[_0x2798('0x2e')]=_[_0x2798('0x2f')](db[_0x2798('0x30')][_0x2798('0x31')]);_0x5300e3[_0x2798('0x32')]=_[_0x2798('0x2f')](_0x386c08['query']);_0x5300e3[_0x2798('0x33')]=_[_0x2798('0x34')](_0x5300e3[_0x2798('0x2e')],_0x5300e3[_0x2798('0x32')]);_0x430433[_0x2798('0x35')]=_[_0x2798('0x34')](_0x5300e3['model'],qs[_0x2798('0x36')](_0x386c08['query']['fields']));_0x430433[_0x2798('0x35')]=_0x430433[_0x2798('0x35')][_0x2798('0x37')]?_0x430433[_0x2798('0x35')]:_0x5300e3[_0x2798('0x2e')];if(_0x386c08['query'][_0x2798('0x38')]){_0x430433[_0x2798('0x39')]=[{'all':!![]}];}_0x430433=_[_0x2798('0x3a')]({},_0x430433,_0x386c08['options']);return db[_0x2798('0x30')][_0x2798('0x3b')](_0x430433)[_0x2798('0x26')](handleEntityNotFound(_0x480bfd,null))[_0x2798('0x26')](respondWithResult(_0x480bfd,null))[_0x2798('0x3c')](handleError(_0x480bfd,null));};exports[_0x2798('0x27')]=function(_0x53b3be,_0x518cb3){return db[_0x2798('0x30')]['find']({'where':{'id':_0x53b3be[_0x2798('0x2d')]['id']}})[_0x2798('0x26')](handleEntityNotFound(_0x518cb3,null))[_0x2798('0x26')](removeEntity(_0x518cb3,null))[_0x2798('0x3c')](handleError(_0x518cb3,null));};function widgetAttributes(_0x564a88){try{switch(_0x564a88['type']){case'iframe':return[{'name':_0x2798('0x3d'),'value':_0x564a88[_0x2798('0x3d')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88['attrs'][0x0]?_0x564a88[_0x2798('0x3e')][0x0]['value']:undefined)||'https://'}];case _0x2798('0x3f'):return[{'name':'attrPath','value':_0x564a88['attrPath']||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x0]?_0x564a88[_0x2798('0x3e')][0x0][_0x2798('0x40')]:undefined)||''}];case _0x2798('0x41'):return[{'name':'attrHourFormat','value':_0x564a88[_0x2798('0x42')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x0]?_0x564a88[_0x2798('0x3e')][0x0][_0x2798('0x40')]:undefined)||'HH:mm:ss'},{'name':_0x2798('0x43'),'value':_0x564a88[_0x2798('0x43')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x1]?_0x564a88[_0x2798('0x3e')][0x1]['value']:undefined)||_0x2798('0x44')},{'name':_0x2798('0x45'),'value':_0x564a88['attrFontSize']||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x2]?_0x564a88['attrs'][0x2][_0x2798('0x40')]:undefined)||0xc}];case'counter':return[{'name':_0x2798('0x46'),'value':_0x564a88[_0x2798('0x46')]||(_0x564a88['attrs']&&_0x564a88[_0x2798('0x3e')][0x0]?_0x564a88['attrs'][0x0][_0x2798('0x40')]:undefined)||_0x2798('0x47')},{'name':_0x2798('0x48'),'value':_0x564a88[_0x2798('0x48')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88['attrs'][0x1]?_0x564a88[_0x2798('0x3e')][0x1][_0x2798('0x40')]:undefined)||[]},{'name':_0x2798('0x45'),'value':_0x564a88[_0x2798('0x45')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88['attrs'][0x2]?_0x564a88['attrs'][0x2][_0x2798('0x40')]:undefined)||0x14}];case'multibar-chart':case _0x2798('0x49'):return[{'name':_0x2798('0x4a'),'value':_0x564a88['attrSerie1']||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x0]?_0x564a88[_0x2798('0x3e')][0x0][_0x2798('0x40')]:undefined)||'total'},{'name':'attrSerie2','value':_0x564a88[_0x2798('0x4b')]||(_0x564a88['attrs']&&_0x564a88[_0x2798('0x3e')][0x1]?_0x564a88[_0x2798('0x3e')][0x1]['value']:undefined)||null},{'name':_0x2798('0x4c'),'value':_0x564a88[_0x2798('0x4c')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x2]?_0x564a88['attrs'][0x2][_0x2798('0x40')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x564a88[_0x2798('0x48')]||(_0x564a88['attrs']&&_0x564a88['attrs'][0x3]?_0x564a88[_0x2798('0x3e')][0x3]['value']:undefined)||[]}];case _0x2798('0x4d'):return[{'name':_0x2798('0x4e'),'type':_0x564a88[_0x2798('0x4f')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x0]?_0x564a88[_0x2798('0x3e')][0x0]['type']:undefined)||null,'value':_0x564a88[_0x2798('0x4e')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88['attrs'][0x0]?_0x564a88['attrs'][0x0][_0x2798('0x40')]:undefined)||null},{'name':'attrRefresh','value':_0x564a88[_0x2798('0x50')]||(_0x564a88[_0x2798('0x3e')]&&_0x564a88[_0x2798('0x3e')][0x1]?_0x564a88[_0x2798('0x3e')][0x1]['value']:undefined)||0x0}];default:return[];}}catch(_0x46a842){logger[_0x2798('0x28')](_0x2798('0x51'),JSON[_0x2798('0x52')](_0x46a842));return[];}}exports[_0x2798('0x53')]=function(_0x2eda7a,_0x2d9e44){if(_0x2eda7a[_0x2798('0x54')]){_0x2eda7a[_0x2798('0x54')][_0x2798('0x3e')]=widgetAttributes(_0x2eda7a['body']);}return db['DashboardItem']['create'](_0x2eda7a[_0x2798('0x54')],{})[_0x2798('0x26')](respondWithResult(_0x2d9e44,0xc9))[_0x2798('0x3c')](handleError(_0x2d9e44,null));};exports[_0x2798('0x55')]=function(_0x5b45ac,_0x20af82){if(_0x5b45ac[_0x2798('0x54')]['id']){delete _0x5b45ac['body']['id'];}_0x5b45ac['body'][_0x2798('0x3e')]=widgetAttributes(_0x5b45ac[_0x2798('0x54')]);return db[_0x2798('0x30')][_0x2798('0x3b')]({'where':{'id':_0x5b45ac[_0x2798('0x2d')]['id']}})[_0x2798('0x26')](handleEntityNotFound(_0x20af82,null))[_0x2798('0x26')](saveUpdates(_0x5b45ac[_0x2798('0x54')],null))[_0x2798('0x26')](respondWithResult(_0x20af82,null))['catch'](handleError(_0x20af82,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 60c823e..b62723f 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 _0xc959=['events','../../mysqldb','DashboardItem','setMaxListeners','remove','emit','hasOwnProperty','hook'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xc959,0x88));var _0x9c95=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0xc959[_0x580647];return _0x5f0792;};'use strict';var EventEmitter=require(_0x9c95('0x0'));var DashboardItem=require(_0x9c95('0x1'))['db'][_0x9c95('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x9c95('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x9c95('0x4')};function emitEvent(_0x330b60){return function(_0x13efdf,_0x17c949,_0x196f28){DashboardItemEvents[_0x9c95('0x5')](_0x330b60+':'+_0x13efdf['id'],_0x13efdf);DashboardItemEvents[_0x9c95('0x5')](_0x330b60,_0x13efdf);_0x196f28(null);};}for(var e in events){if(events[_0x9c95('0x6')](e)){var event=events[e];DashboardItem[_0x9c95('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file +var _0xf32e=['remove','emit','hook','events','../../mysqldb','DashboardItem','save','update'];(function(_0x2919e7,_0x22bb31){var _0x166578=function(_0xd1c091){while(--_0xd1c091){_0x2919e7['push'](_0x2919e7['shift']());}};_0x166578(++_0x22bb31);}(_0xf32e,0xf3));var _0xef32=function(_0x46aa25,_0x1db4e7){_0x46aa25=_0x46aa25-0x0;var _0x20ddff=_0xf32e[_0x46aa25];return _0x20ddff;};'use strict';var EventEmitter=require(_0xef32('0x0'));var DashboardItem=require(_0xef32('0x1'))['db'][_0xef32('0x2')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef32('0x3'),'afterUpdate':_0xef32('0x4'),'afterDestroy':_0xef32('0x5')};function emitEvent(_0x2cf772){return function(_0x2fad8f,_0x3b51d6,_0x214f8a){DashboardItemEvents[_0xef32('0x6')](_0x2cf772+':'+_0x2fad8f['id'],_0x2fad8f);DashboardItemEvents[_0xef32('0x6')](_0x2cf772,_0x2fad8f);_0x214f8a(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem[_0xef32('0x7')](e,emitEvent(event));}}module['exports']=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 5978389..eac70cc 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 _0x5ad9=['util','../../config/logger','api','moment','path','../../config/environment','./dashboardItem.attributes','exports','define','dashboard_items','lodash'];(function(_0x523671,_0x4657fc){var _0x5b0bdc=function(_0x301007){while(--_0x301007){_0x523671['push'](_0x523671['shift']());}};_0x5b0bdc(++_0x4657fc);}(_0x5ad9,0xc5));var _0x95ad=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x5ad9[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x95ad('0x0'));var util=require(_0x95ad('0x1'));var logger=require(_0x95ad('0x2'))(_0x95ad('0x3'));var moment=require(_0x95ad('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x95ad('0x5'));var rimraf=require('rimraf');var config=require(_0x95ad('0x6'));var attributes=require(_0x95ad('0x7'));module[_0x95ad('0x8')]=function(_0x293625,_0x563bcf){return _0x293625[_0x95ad('0x9')]('DashboardItem',attributes,{'tableName':_0x95ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9d5c=['../../config/logger','api','moment','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','DashboardItem','dashboard_items'];(function(_0xa5ee61,_0x3038c1){var _0x187d40=function(_0x3aea1d){while(--_0x3aea1d){_0xa5ee61['push'](_0xa5ee61['shift']());}};_0x187d40(++_0x3038c1);}(_0x9d5c,0xf0));var _0xc9d5=function(_0x5a57ff,_0x2a68f8){_0x5a57ff=_0x5a57ff-0x0;var _0x1feee3=_0x9d5c[_0x5a57ff];return _0x1feee3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc9d5('0x0'))(_0xc9d5('0x1'));var moment=require(_0xc9d5('0x2'));var BPromise=require('bluebird');var rp=require(_0xc9d5('0x3'));var fs=require('fs');var path=require(_0xc9d5('0x4'));var rimraf=require('rimraf');var config=require(_0xc9d5('0x5'));var attributes=require(_0xc9d5('0x6'));module[_0xc9d5('0x7')]=function(_0x31f5f0,_0x631776){return _0x31f5f0['define'](_0xc9d5('0x8'),attributes,{'tableName':_0xc9d5('0x9'),'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 590cf32..a416a08 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 _0x47a3=['socket.io-emitter','./dashboardItem.socket','register','request','info','DashboardItem,\x20%s,\x20%s','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x32e2c6,_0x47dae9){var _0x2f1250=function(_0x19b4c7){while(--_0x19b4c7){_0x32e2c6['push'](_0x32e2c6['shift']());}};_0x2f1250(++_0x47dae9);}(_0x47a3,0xcc));var _0x347a=function(_0x235dad,_0x5a1790){_0x235dad=_0x235dad-0x0;var _0x2b8f8b=_0x47a3[_0x235dad];return _0x2b8f8b;};'use strict';var _=require(_0x347a('0x0'));var util=require(_0x347a('0x1'));var moment=require('moment');var BPromise=require(_0x347a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x347a('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x347a('0x4'))(_0x347a('0x5'));var config=require(_0x347a('0x6'));var jayson=require(_0x347a('0x7'));var client=jayson[_0x347a('0x8')][_0x347a('0x9')]({'port':0x232a});config[_0x347a('0xa')]=_['defaults'](config[_0x347a('0xa')],{'host':_0x347a('0xb'),'port':0x18eb});var socket=require(_0x347a('0xc'))(new Redis(config['redis']));require(_0x347a('0xd'))[_0x347a('0xe')](socket);function respondWithRpcPromise(_0x2526fa,_0x1b6bfd,_0x4a195b){return new BPromise(function(_0x1e6c77,_0x55a6b9){return client[_0x347a('0xf')](_0x2526fa,_0x4a195b)['then'](function(_0x356eac){logger[_0x347a('0x10')](_0x347a('0x11'),_0x1b6bfd,_0x347a('0x12'));logger['debug'](_0x347a('0x13'),_0x1b6bfd,_0x347a('0x12'),JSON[_0x347a('0x14')](_0x356eac));if(_0x356eac['error']){if(_0x356eac[_0x347a('0x15')][_0x347a('0x16')]===0x1f4){logger[_0x347a('0x15')]('DashboardItem,\x20%s,\x20%s',_0x1b6bfd,_0x356eac[_0x347a('0x15')]['message']);return _0x55a6b9(_0x356eac[_0x347a('0x15')][_0x347a('0x17')]);}logger[_0x347a('0x15')]('DashboardItem,\x20%s,\x20%s',_0x1b6bfd,_0x356eac[_0x347a('0x15')][_0x347a('0x17')]);return _0x1e6c77(_0x356eac[_0x347a('0x15')][_0x347a('0x17')]);}else{logger[_0x347a('0x10')](_0x347a('0x11'),_0x1b6bfd,'request\x20sent');_0x1e6c77(_0x356eac['result'][_0x347a('0x17')]);}})['catch'](function(_0x3e668b){logger[_0x347a('0x15')]('DashboardItem,\x20%s,\x20%s',_0x1b6bfd,_0x3e668b);_0x55a6b9(_0x3e668b);});});} \ No newline at end of file +var _0xe9d3=['result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x5c4e5e,_0x145427){var _0x4d7487=function(_0x515383){while(--_0x515383){_0x5c4e5e['push'](_0x5c4e5e['shift']());}};_0x4d7487(++_0x145427);}(_0xe9d3,0xf5));var _0x3e9d=function(_0x58a900,_0x21f9d5){_0x58a900=_0x58a900-0x0;var _0x1d9b85=_0xe9d3[_0x58a900];return _0x1d9b85;};'use strict';var _=require(_0x3e9d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3e9d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3e9d('0x2'));var db=require(_0x3e9d('0x3'))['db'];var utils=require(_0x3e9d('0x4'));var logger=require(_0x3e9d('0x5'))(_0x3e9d('0x6'));var config=require(_0x3e9d('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3e9d('0x8')][_0x3e9d('0x9')]({'port':0x232a});config[_0x3e9d('0xa')]=_[_0x3e9d('0xb')](config[_0x3e9d('0xa')],{'host':_0x3e9d('0xc'),'port':0x18eb});var socket=require(_0x3e9d('0xd'))(new Redis(config[_0x3e9d('0xa')]));require(_0x3e9d('0xe'))[_0x3e9d('0xf')](socket);function respondWithRpcPromise(_0x11afac,_0x428b91,_0x4abf65){return new BPromise(function(_0x46f886,_0x789fd5){return client[_0x3e9d('0x10')](_0x11afac,_0x4abf65)[_0x3e9d('0x11')](function(_0xc24cd5){logger[_0x3e9d('0x12')](_0x3e9d('0x13'),_0x428b91,_0x3e9d('0x14'));logger[_0x3e9d('0x15')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x428b91,_0x3e9d('0x14'),JSON['stringify'](_0xc24cd5));if(_0xc24cd5[_0x3e9d('0x16')]){if(_0xc24cd5[_0x3e9d('0x16')][_0x3e9d('0x17')]===0x1f4){logger['error'](_0x3e9d('0x13'),_0x428b91,_0xc24cd5['error'][_0x3e9d('0x18')]);return _0x789fd5(_0xc24cd5[_0x3e9d('0x16')][_0x3e9d('0x18')]);}logger[_0x3e9d('0x16')](_0x3e9d('0x13'),_0x428b91,_0xc24cd5[_0x3e9d('0x16')]['message']);return _0x46f886(_0xc24cd5[_0x3e9d('0x16')][_0x3e9d('0x18')]);}else{logger[_0x3e9d('0x12')](_0x3e9d('0x13'),_0x428b91,_0x3e9d('0x14'));_0x46f886(_0xc24cd5[_0x3e9d('0x19')][_0x3e9d('0x18')]);}})[_0x3e9d('0x1a')](function(_0x4b9f92){logger[_0x3e9d('0x16')](_0x3e9d('0x13'),_0x428b91,_0x4b9f92);_0x789fd5(_0x4b9f92);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 6eb6d1f..8479833 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 _0xcfe0=['dashboardItem:','./dashboardItem.events','remove','update','length'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xcfe0,0x155));var _0x0cfe=function(_0x25ac48,_0x94585a){_0x25ac48=_0x25ac48-0x0;var _0x4f280e=_0xcfe0[_0x25ac48];return _0x4f280e;};'use strict';var DashboardItemEvents=require(_0x0cfe('0x0'));var events=['save',_0x0cfe('0x1'),_0x0cfe('0x2')];function createListener(_0x5e3b9a,_0x372f1a){return function(_0x25f7c7){_0x372f1a['emit'](_0x5e3b9a,_0x25f7c7);};}function removeListener(_0x22e527,_0x4cfee3){return function(){DashboardItemEvents['removeListener'](_0x22e527,_0x4cfee3);};}exports['register']=function(_0x4b6a84){for(var _0x24d07f=0x0,_0x12f36c=events[_0x0cfe('0x3')];_0x24d07f<_0x12f36c;_0x24d07f++){var _0x352bc9=events[_0x24d07f];var _0x387c0f=createListener(_0x0cfe('0x4')+_0x352bc9,_0x4b6a84);DashboardItemEvents['on'](_0x352bc9,_0x387c0f);}}; \ No newline at end of file +var _0x7830=['./dashboardItem.events','save','remove','update','register','length','dashboardItem:'];(function(_0x4e88b6,_0x521d68){var _0x5d9070=function(_0xd731f6){while(--_0xd731f6){_0x4e88b6['push'](_0x4e88b6['shift']());}};_0x5d9070(++_0x521d68);}(_0x7830,0x16c));var _0x0783=function(_0x60ca39,_0x44216c){_0x60ca39=_0x60ca39-0x0;var _0x15c6da=_0x7830[_0x60ca39];return _0x15c6da;};'use strict';var DashboardItemEvents=require(_0x0783('0x0'));var events=[_0x0783('0x1'),_0x0783('0x2'),_0x0783('0x3')];function createListener(_0x4e2176,_0x351f4d){return function(_0x7aa87e){_0x351f4d['emit'](_0x4e2176,_0x7aa87e);};}function removeListener(_0x4c9303,_0x383356){return function(){DashboardItemEvents['removeListener'](_0x4c9303,_0x383356);};}exports[_0x0783('0x4')]=function(_0x1e3e4c){for(var _0x9c503a=0x0,_0x2d2ed8=events[_0x0783('0x5')];_0x9c503a<_0x2d2ed8;_0x9c503a++){var _0x3444bf=events[_0x9c503a];var _0x55a79c=createListener(_0x0783('0x6')+_0x3444bf,_0x1e3e4c);DashboardItemEvents['on'](_0x3444bf,_0x55a79c);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index ccde8f7..73712f6 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 _0xdc97=['../../components/interaction/service','./dashboardItem.controller','get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service'];(function(_0x4a3271,_0x26c3bf){var _0x524537=function(_0x54cc86){while(--_0x54cc86){_0x4a3271['push'](_0x4a3271['shift']());}};_0x524537(++_0x26c3bf);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2e9b36,_0x436b99){_0x2e9b36=_0x2e9b36-0x0;var _0x219d61=_0xdc97[_0x2e9b36];return _0x219d61;};'use strict';var multer=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var path=require(_0x7dc9('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc9('0x3'));var router=express['Router']();var auth=require(_0x7dc9('0x4'));var interaction=require(_0x7dc9('0x5'));var config=require('../../config/environment');var controller=require(_0x7dc9('0x6'));router[_0x7dc9('0x7')](_0x7dc9('0x8'),auth[_0x7dc9('0x9')](),controller['show']);router[_0x7dc9('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x7dc9('0xb')](_0x7dc9('0x8'),auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xc')]);router[_0x7dc9('0xd')]('/:id',auth[_0x7dc9('0x9')](),controller[_0x7dc9('0xe')]);module[_0x7dc9('0xf')]=router; \ No newline at end of file +var _0x9c5a=['delete','isAuthenticated','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboardItem.controller','/:id','show','post','put','update'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0xdbe61,_0x174cf2){_0xdbe61=_0xdbe61-0x0;var _0x3dad78=_0x9c5a[_0xdbe61];return _0x3dad78;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get'](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0x9')]);router[_0xa9c5('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0xa9c5('0xb')](_0xa9c5('0x8'),auth['isAuthenticated'](),controller[_0xa9c5('0xc')]);router[_0xa9c5('0xd')]('/:id',auth[_0xa9c5('0xe')](),controller[_0xa9c5('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 76f59a2..766f562 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 _0x3a87=['STRING','sequelize'];(function(_0x354fc7,_0x10bd45){var _0x462135=function(_0x8d4cd2){while(--_0x8d4cd2){_0x354fc7['push'](_0x354fc7['shift']());}};_0x462135(++_0x10bd45);}(_0x3a87,0x143));var _0x73a8=function(_0x3a9e73,_0x567a70){_0x3a9e73=_0x3a9e73-0x0;var _0x5af67a=_0x3a87[_0x3a9e73];return _0x5af67a;};'use strict';var Sequelize=require(_0x73a8('0x0'));module['exports']={'name':{'type':Sequelize[_0x73a8('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xe2cf=['exports','STRING'];(function(_0xbb453f,_0x29bdb4){var _0x167c47=function(_0xd4bdd8){while(--_0xd4bdd8){_0xbb453f['push'](_0xbb453f['shift']());}};_0x167c47(++_0x29bdb4);}(_0xe2cf,0x17e));var _0xfe2c=function(_0x2baa5d,_0x42a1cb){_0x2baa5d=_0x2baa5d-0x0;var _0x88bf18=_0xe2cf[_0x2baa5d];return _0x88bf18;};'use strict';var Sequelize=require('sequelize');module[_0xfe2c('0x0')]={'name':{'type':Sequelize[_0xfe2c('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 0a47ca5..7c9923b 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 _0x9b67=['create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','Dispositions','destroy','stack','name','index','map','Disposition','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','nolimit','order','sort','where','filters','filter','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes'];(function(_0xb544f3,_0x461073){var _0x28dd5e=function(_0x28b9ba){while(--_0x28b9ba){_0xb544f3['push'](_0xb544f3['shift']());}};_0x28dd5e(++_0x461073);}(_0x9b67,0xf6));var _0x79b6=function(_0x538511,_0x5d0f75){_0x538511=_0x538511-0x0;var _0xbc1b10=_0x9b67[_0x538511];return _0xbc1b10;};'use strict';var pdf=require(_0x79b6('0x0'));var emlformat=require(_0x79b6('0x1'));var rimraf=require(_0x79b6('0x2'));var zipdir=require(_0x79b6('0x3'));var jsonpatch=require(_0x79b6('0x4'));var rp=require('request-promise');var moment=require(_0x79b6('0x5'));var BPromise=require(_0x79b6('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x79b6('0x7'));var sox=require(_0x79b6('0x8'));var csv=require(_0x79b6('0x9'));var ejs=require(_0x79b6('0xa'));var fs=require('fs');var _=require(_0x79b6('0xb'));var squel=require(_0x79b6('0xc'));var crypto=require(_0x79b6('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x79b6('0xe'));var toCsv=require(_0x79b6('0x9'));var querystring=require(_0x79b6('0xf'));var Papa=require(_0x79b6('0x10'));var Redis=require(_0x79b6('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x79b6('0x12'));var as=require(_0x79b6('0x13'));var hardwareService=require(_0x79b6('0x14'));var logger=require(_0x79b6('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x79b6('0x16'));var db=require(_0x79b6('0x17'))['db'];function respondWithStatusCode(_0x303cfb,_0x526727){_0x526727=_0x526727||0xcc;return function(_0xc05a77){if(_0xc05a77){return _0x303cfb[_0x79b6('0x18')](_0x526727);}return _0x303cfb[_0x79b6('0x19')](_0x526727)[_0x79b6('0x1a')]();};}function respondWithResult(_0x3b0721,_0x40478d){_0x40478d=_0x40478d||0xc8;return function(_0x19d5b2){if(_0x19d5b2){return _0x3b0721[_0x79b6('0x19')](_0x40478d)[_0x79b6('0x1b')](_0x19d5b2);}};}function respondWithFilteredResult(_0x114d8c,_0x2ac966){return function(_0x3563cc){if(_0x3563cc){var _0x1e8bf1=_0x3563cc[_0x79b6('0x1c')],_0x4cf491=_0x2ac966[_0x79b6('0x1d')],_0x207bcc=_0x2ac966[_0x79b6('0x1d')]+_0x2ac966[_0x79b6('0x1e')],_0x2a75d5;if(_0x207bcc>=_0x1e8bf1){_0x207bcc=_0x1e8bf1;_0x2a75d5=0xc8;}else{_0x2a75d5=0xce;}_0x114d8c[_0x79b6('0x19')](_0x2a75d5);return _0x114d8c[_0x79b6('0x1f')](_0x79b6('0x20'),_0x4cf491+'-'+_0x207bcc+'/'+_0x1e8bf1)[_0x79b6('0x1b')](_0x3563cc);}return null;};}function patchUpdates(_0x323376){return function(_0xa1a29a){try{jsonpatch[_0x79b6('0x21')](_0xa1a29a,_0x323376,!![]);}catch(_0x52a70f){return BPromise[_0x79b6('0x22')](_0x52a70f);}return _0xa1a29a['save']();};}function saveUpdates(_0x22a9eb,_0x532e65){return function(_0x28b9c2){if(_0x28b9c2){return _0x28b9c2[_0x79b6('0x23')](_0x22a9eb)[_0x79b6('0x24')](function(_0x56ebf4){return _0x56ebf4;});}return null;};}function removeEntity(_0x46304b,_0x30dc0b){return function(_0x53208a){if(_0x53208a){return _0x53208a['destroy']()[_0x79b6('0x24')](function(){var _0x2e2948=_0x53208a[_0x79b6('0x25')]({'plain':!![]});var _0x268826=_0x79b6('0x26');return db['UserProfileResource'][_0x79b6('0x27')]({'where':{'type':_0x268826,'resourceId':_0x2e2948['id']}})[_0x79b6('0x24')](function(){return _0x53208a;});})[_0x79b6('0x24')](function(){_0x46304b[_0x79b6('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x53c03c,_0x40ef76){return function(_0x2d16b2){if(!_0x2d16b2){_0x53c03c[_0x79b6('0x18')](0x194);}return _0x2d16b2;};}function handleError(_0xc25c99,_0x4adf15){_0x4adf15=_0x4adf15||0x1f4;return function(_0x6f6ca1){logger['error'](_0x6f6ca1[_0x79b6('0x28')]);if(_0x6f6ca1[_0x79b6('0x29')]){delete _0x6f6ca1[_0x79b6('0x29')];}_0xc25c99[_0x79b6('0x19')](_0x4adf15)['send'](_0x6f6ca1);};}exports[_0x79b6('0x2a')]=function(_0x310832,_0x53b463){var _0x158221={},_0x2d219c={},_0x1b1f2b={'count':0x0,'rows':[]};var _0x4f47dc=_[_0x79b6('0x2b')](db[_0x79b6('0x2c')]['rawAttributes'],function(_0x160d2a){return{'name':_0x160d2a[_0x79b6('0x2d')],'type':_0x160d2a[_0x79b6('0x2e')][_0x79b6('0x2f')]};});_0x2d219c[_0x79b6('0x30')]=_[_0x79b6('0x2b')](_0x4f47dc,'name');_0x2d219c[_0x79b6('0x31')]=_[_0x79b6('0x32')](_0x310832[_0x79b6('0x31')]);_0x2d219c['filters']=_['intersection'](_0x2d219c[_0x79b6('0x30')],_0x2d219c[_0x79b6('0x31')]);_0x158221[_0x79b6('0x33')]=_[_0x79b6('0x34')](_0x2d219c[_0x79b6('0x30')],qs[_0x79b6('0x35')](_0x310832['query']['fields']));_0x158221[_0x79b6('0x33')]=_0x158221['attributes'][_0x79b6('0x36')]?_0x158221['attributes']:_0x2d219c[_0x79b6('0x30')];if(!_0x310832[_0x79b6('0x31')]['hasOwnProperty'](_0x79b6('0x37'))){_0x158221[_0x79b6('0x1e')]=qs['limit'](_0x310832[_0x79b6('0x31')]['limit']);_0x158221[_0x79b6('0x1d')]=qs[_0x79b6('0x1d')](_0x310832[_0x79b6('0x31')][_0x79b6('0x1d')]);}_0x158221[_0x79b6('0x38')]=qs[_0x79b6('0x39')](_0x310832[_0x79b6('0x31')][_0x79b6('0x39')]);_0x158221[_0x79b6('0x3a')]=qs[_0x79b6('0x3b')](_['pick'](_0x310832['query'],_0x2d219c['filters']));if(_0x310832[_0x79b6('0x31')][_0x79b6('0x3c')]){_0x158221['where']=_[_0x79b6('0x3d')](_0x158221['where'],{'$or':_[_0x79b6('0x2b')](_0x4f47dc,function(_0x42757a){if(_0x42757a[_0x79b6('0x2e')]!=='VIRTUAL'){var _0x601bb8={};_0x601bb8[_0x42757a['name']]={'$like':'%'+_0x310832[_0x79b6('0x31')][_0x79b6('0x3c')]+'%'};return _0x601bb8;}})});}_0x158221=_[_0x79b6('0x3d')]({},_0x158221,_0x310832[_0x79b6('0x3e')]);var _0x1cb2a6={'where':_0x158221['where']};return db['Disposition'][_0x79b6('0x1c')](_0x1cb2a6)['then'](function(_0x4037c8){_0x1b1f2b[_0x79b6('0x1c')]=_0x4037c8;if(_0x310832[_0x79b6('0x31')][_0x79b6('0x3f')]){_0x158221[_0x79b6('0x40')]=[{'all':!![]}];}return db[_0x79b6('0x2c')][_0x79b6('0x41')](_0x158221);})['then'](function(_0x109514){_0x1b1f2b[_0x79b6('0x42')]=_0x109514;return _0x1b1f2b;})[_0x79b6('0x24')](respondWithFilteredResult(_0x53b463,_0x158221))[_0x79b6('0x43')](handleError(_0x53b463,null));};exports['show']=function(_0x12ea22,_0x4f803c){var _0x4ba212={'raw':!![],'where':{'id':_0x12ea22[_0x79b6('0x44')]['id']}},_0x22025a={};_0x22025a[_0x79b6('0x30')]=_[_0x79b6('0x32')](db[_0x79b6('0x2c')][_0x79b6('0x45')]);_0x22025a[_0x79b6('0x31')]=_[_0x79b6('0x32')](_0x12ea22['query']);_0x22025a[_0x79b6('0x3b')]=_['intersection'](_0x22025a['model'],_0x22025a[_0x79b6('0x31')]);_0x4ba212[_0x79b6('0x33')]=_[_0x79b6('0x34')](_0x22025a[_0x79b6('0x30')],qs[_0x79b6('0x35')](_0x12ea22[_0x79b6('0x31')][_0x79b6('0x35')]));_0x4ba212[_0x79b6('0x33')]=_0x4ba212[_0x79b6('0x33')]['length']?_0x4ba212[_0x79b6('0x33')]:_0x22025a[_0x79b6('0x30')];if(_0x12ea22[_0x79b6('0x31')][_0x79b6('0x3f')]){_0x4ba212[_0x79b6('0x40')]=[{'all':!![]}];}_0x4ba212=_['merge']({},_0x4ba212,_0x12ea22[_0x79b6('0x3e')]);return db[_0x79b6('0x2c')]['find'](_0x4ba212)['then'](handleEntityNotFound(_0x4f803c,null))[_0x79b6('0x24')](respondWithResult(_0x4f803c,null))[_0x79b6('0x43')](handleError(_0x4f803c,null));};exports[_0x79b6('0x46')]=function(_0xa0c396,_0x37f4b1){return db[_0x79b6('0x2c')][_0x79b6('0x46')](_0xa0c396[_0x79b6('0x47')],{})[_0x79b6('0x24')](function(_0x909351){var _0x15c795=_0xa0c396[_0x79b6('0x48')][_0x79b6('0x25')]({'plain':!![]});if(!_0x15c795)throw new Error(_0x79b6('0x49'));if(_0x15c795[_0x79b6('0x4a')]===_0x79b6('0x48')){var _0x26ab29=_0x909351[_0x79b6('0x25')]({'plain':!![]});var _0x29216c='Dispositions';return db['UserProfileSection']['find']({'where':{'name':_0x29216c,'userProfileId':_0x15c795['userProfileId']},'raw':!![]})['then'](function(_0x412c1e){if(_0x412c1e&&_0x412c1e[_0x79b6('0x4b')]===0x0){return db[_0x79b6('0x4c')][_0x79b6('0x46')]({'name':_0x26ab29[_0x79b6('0x29')],'resourceId':_0x26ab29['id'],'type':_0x412c1e[_0x79b6('0x29')],'sectionId':_0x412c1e['id']},{})['then'](function(){return _0x909351;});}else{return _0x909351;}})[_0x79b6('0x43')](function(_0xa2ba0e){logger['error'](_0x79b6('0x4d'),_0xa2ba0e);throw _0xa2ba0e;});}return _0x909351;})['then'](respondWithResult(_0x37f4b1,0xc9))[_0x79b6('0x43')](handleError(_0x37f4b1,null));};exports['update']=function(_0x48dd20,_0x46adb4){if(_0x48dd20[_0x79b6('0x47')]['id']){delete _0x48dd20[_0x79b6('0x47')]['id'];}return db[_0x79b6('0x2c')][_0x79b6('0x4e')]({'where':{'id':_0x48dd20[_0x79b6('0x44')]['id']}})['then'](handleEntityNotFound(_0x46adb4,null))['then'](saveUpdates(_0x48dd20[_0x79b6('0x47')],null))[_0x79b6('0x24')](respondWithResult(_0x46adb4,null))['catch'](handleError(_0x46adb4,null));};exports[_0x79b6('0x27')]=function(_0x251118,_0x12cb4c){return db[_0x79b6('0x2c')][_0x79b6('0x4e')]({'where':{'id':_0x251118[_0x79b6('0x44')]['id']}})[_0x79b6('0x24')](handleEntityNotFound(_0x12cb4c,null))['then'](removeEntity(_0x12cb4c,null))[_0x79b6('0x43')](handleError(_0x12cb4c,null));}; \ No newline at end of file +var _0xa41a=['nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','options','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','send','index','Disposition','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xa41a,0x6b));var _0xaa41=function(_0x1871a2,_0x287772){_0x1871a2=_0x1871a2-0x0;var _0x5d73c3=_0xa41a[_0x1871a2];return _0x5d73c3;};'use strict';var pdf=require(_0xaa41('0x0'));var emlformat=require(_0xaa41('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaa41('0x2'));var jsonpatch=require(_0xaa41('0x3'));var rp=require(_0xaa41('0x4'));var moment=require(_0xaa41('0x5'));var BPromise=require(_0xaa41('0x6'));var Mustache=require(_0xaa41('0x7'));var util=require(_0xaa41('0x8'));var path=require(_0xaa41('0x9'));var sox=require('sox');var csv=require(_0xaa41('0xa'));var ejs=require(_0xaa41('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xaa41('0xc'));var jsforce=require(_0xaa41('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xaa41('0xa'));var querystring=require(_0xaa41('0xe'));var Papa=require(_0xaa41('0xf'));var Redis=require(_0xaa41('0x10'));var authService=require(_0xaa41('0x11'));var qs=require(_0xaa41('0x12'));var as=require(_0xaa41('0x13'));var hardwareService=require(_0xaa41('0x14'));var logger=require(_0xaa41('0x15'))('api');var utils=require(_0xaa41('0x16'));var config=require(_0xaa41('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x54827c,_0x1d0a54){_0x1d0a54=_0x1d0a54||0xcc;return function(_0x518b5b){if(_0x518b5b){return _0x54827c[_0xaa41('0x18')](_0x1d0a54);}return _0x54827c[_0xaa41('0x19')](_0x1d0a54)[_0xaa41('0x1a')]();};}function respondWithResult(_0x889d44,_0x6f9ade){_0x6f9ade=_0x6f9ade||0xc8;return function(_0x4eaf81){if(_0x4eaf81){return _0x889d44[_0xaa41('0x19')](_0x6f9ade)[_0xaa41('0x1b')](_0x4eaf81);}};}function respondWithFilteredResult(_0x1934e9,_0x1ef7d9){return function(_0x2a6988){if(_0x2a6988){var _0x2005ae=_0x2a6988[_0xaa41('0x1c')],_0x1e1e02=_0x1ef7d9[_0xaa41('0x1d')],_0x550ad5=_0x1ef7d9[_0xaa41('0x1d')]+_0x1ef7d9[_0xaa41('0x1e')],_0x2d868a;if(_0x550ad5>=_0x2005ae){_0x550ad5=_0x2005ae;_0x2d868a=0xc8;}else{_0x2d868a=0xce;}_0x1934e9[_0xaa41('0x19')](_0x2d868a);return _0x1934e9[_0xaa41('0x1f')](_0xaa41('0x20'),_0x1e1e02+'-'+_0x550ad5+'/'+_0x2005ae)[_0xaa41('0x1b')](_0x2a6988);}return null;};}function patchUpdates(_0x4fe1a4){return function(_0x5cd936){try{jsonpatch[_0xaa41('0x21')](_0x5cd936,_0x4fe1a4,!![]);}catch(_0x22de55){return BPromise[_0xaa41('0x22')](_0x22de55);}return _0x5cd936['save']();};}function saveUpdates(_0x2bf794,_0x1f692b){return function(_0x4e768e){if(_0x4e768e){return _0x4e768e['update'](_0x2bf794)[_0xaa41('0x23')](function(_0x5d4374){return _0x5d4374;});}return null;};}function removeEntity(_0xafd672,_0x209c83){return function(_0x3e2175){if(_0x3e2175){return _0x3e2175[_0xaa41('0x24')]()[_0xaa41('0x23')](function(){var _0x4eb01f=_0x3e2175[_0xaa41('0x25')]({'plain':!![]});var _0x43a85c=_0xaa41('0x26');return db[_0xaa41('0x27')][_0xaa41('0x24')]({'where':{'type':_0x43a85c,'resourceId':_0x4eb01f['id']}})[_0xaa41('0x23')](function(){return _0x3e2175;});})['then'](function(){_0xafd672['status'](0xcc)[_0xaa41('0x1a')]();});}};}function handleEntityNotFound(_0x527cac,_0x493a10){return function(_0x12e362){if(!_0x12e362){_0x527cac['sendStatus'](0x194);}return _0x12e362;};}function handleError(_0x536bed,_0x2d0ac0){_0x2d0ac0=_0x2d0ac0||0x1f4;return function(_0x9c8c21){logger[_0xaa41('0x28')](_0x9c8c21[_0xaa41('0x29')]);if(_0x9c8c21[_0xaa41('0x2a')]){delete _0x9c8c21[_0xaa41('0x2a')];}_0x536bed['status'](_0x2d0ac0)[_0xaa41('0x2b')](_0x9c8c21);};}exports[_0xaa41('0x2c')]=function(_0x63c18c,_0x9a16e3){var _0x1d8c2b={},_0x4466a3={},_0x30f88e={'count':0x0,'rows':[]};var _0x104a95=_['map'](db[_0xaa41('0x2d')]['rawAttributes'],function(_0x5dad80){return{'name':_0x5dad80[_0xaa41('0x2e')],'type':_0x5dad80[_0xaa41('0x2f')]['key']};});_0x4466a3[_0xaa41('0x30')]=_[_0xaa41('0x31')](_0x104a95,'name');_0x4466a3['query']=_['keys'](_0x63c18c[_0xaa41('0x32')]);_0x4466a3[_0xaa41('0x33')]=_[_0xaa41('0x34')](_0x4466a3[_0xaa41('0x30')],_0x4466a3['query']);_0x1d8c2b[_0xaa41('0x35')]=_[_0xaa41('0x34')](_0x4466a3[_0xaa41('0x30')],qs['fields'](_0x63c18c[_0xaa41('0x32')][_0xaa41('0x36')]));_0x1d8c2b[_0xaa41('0x35')]=_0x1d8c2b['attributes'][_0xaa41('0x37')]?_0x1d8c2b[_0xaa41('0x35')]:_0x4466a3['model'];if(!_0x63c18c[_0xaa41('0x32')][_0xaa41('0x38')](_0xaa41('0x39'))){_0x1d8c2b['limit']=qs[_0xaa41('0x1e')](_0x63c18c['query'][_0xaa41('0x1e')]);_0x1d8c2b[_0xaa41('0x1d')]=qs[_0xaa41('0x1d')](_0x63c18c['query']['offset']);}_0x1d8c2b['order']=qs[_0xaa41('0x3a')](_0x63c18c[_0xaa41('0x32')][_0xaa41('0x3a')]);_0x1d8c2b[_0xaa41('0x3b')]=qs['filters'](_['pick'](_0x63c18c[_0xaa41('0x32')],_0x4466a3[_0xaa41('0x33')]));if(_0x63c18c[_0xaa41('0x32')][_0xaa41('0x3c')]){_0x1d8c2b[_0xaa41('0x3b')]=_[_0xaa41('0x3d')](_0x1d8c2b[_0xaa41('0x3b')],{'$or':_['map'](_0x104a95,function(_0x3adc28){if(_0x3adc28[_0xaa41('0x2f')]!==_0xaa41('0x3e')){var _0x27817f={};_0x27817f[_0x3adc28['name']]={'$like':'%'+_0x63c18c['query'][_0xaa41('0x3c')]+'%'};return _0x27817f;}})});}_0x1d8c2b=_[_0xaa41('0x3d')]({},_0x1d8c2b,_0x63c18c['options']);var _0x4101ab={'where':_0x1d8c2b['where']};return db[_0xaa41('0x2d')][_0xaa41('0x1c')](_0x4101ab)[_0xaa41('0x23')](function(_0x466eee){_0x30f88e[_0xaa41('0x1c')]=_0x466eee;if(_0x63c18c[_0xaa41('0x32')][_0xaa41('0x3f')]){_0x1d8c2b[_0xaa41('0x40')]=[{'all':!![]}];}return db['Disposition'][_0xaa41('0x41')](_0x1d8c2b);})[_0xaa41('0x23')](function(_0x35c685){_0x30f88e[_0xaa41('0x42')]=_0x35c685;return _0x30f88e;})[_0xaa41('0x23')](respondWithFilteredResult(_0x9a16e3,_0x1d8c2b))[_0xaa41('0x43')](handleError(_0x9a16e3,null));};exports['show']=function(_0x5bb318,_0x87e2f4){var _0x4f9086={'raw':!![],'where':{'id':_0x5bb318[_0xaa41('0x44')]['id']}},_0x1ed366={};_0x1ed366[_0xaa41('0x30')]=_[_0xaa41('0x45')](db[_0xaa41('0x2d')][_0xaa41('0x46')]);_0x1ed366[_0xaa41('0x32')]=_['keys'](_0x5bb318[_0xaa41('0x32')]);_0x1ed366['filters']=_['intersection'](_0x1ed366[_0xaa41('0x30')],_0x1ed366['query']);_0x4f9086['attributes']=_['intersection'](_0x1ed366[_0xaa41('0x30')],qs['fields'](_0x5bb318[_0xaa41('0x32')][_0xaa41('0x36')]));_0x4f9086['attributes']=_0x4f9086['attributes'][_0xaa41('0x37')]?_0x4f9086[_0xaa41('0x35')]:_0x1ed366[_0xaa41('0x30')];if(_0x5bb318[_0xaa41('0x32')][_0xaa41('0x3f')]){_0x4f9086[_0xaa41('0x40')]=[{'all':!![]}];}_0x4f9086=_[_0xaa41('0x3d')]({},_0x4f9086,_0x5bb318[_0xaa41('0x47')]);return db[_0xaa41('0x2d')]['find'](_0x4f9086)[_0xaa41('0x23')](handleEntityNotFound(_0x87e2f4,null))[_0xaa41('0x23')](respondWithResult(_0x87e2f4,null))[_0xaa41('0x43')](handleError(_0x87e2f4,null));};exports[_0xaa41('0x48')]=function(_0x206d86,_0x1d6112){return db['Disposition'][_0xaa41('0x48')](_0x206d86[_0xaa41('0x49')],{})[_0xaa41('0x23')](function(_0x2288f8){var _0x57d1f6=_0x206d86[_0xaa41('0x4a')]['get']({'plain':!![]});if(!_0x57d1f6)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x57d1f6[_0xaa41('0x4b')]===_0xaa41('0x4a')){var _0x3e16ef=_0x2288f8['get']({'plain':!![]});var _0xb4773b=_0xaa41('0x26');return db[_0xaa41('0x4c')]['find']({'where':{'name':_0xb4773b,'userProfileId':_0x57d1f6[_0xaa41('0x4d')]},'raw':!![]})[_0xaa41('0x23')](function(_0x2c68b3){if(_0x2c68b3&&_0x2c68b3[_0xaa41('0x4e')]===0x0){return db[_0xaa41('0x27')][_0xaa41('0x48')]({'name':_0x3e16ef[_0xaa41('0x2a')],'resourceId':_0x3e16ef['id'],'type':_0x2c68b3[_0xaa41('0x2a')],'sectionId':_0x2c68b3['id']},{})['then'](function(){return _0x2288f8;});}else{return _0x2288f8;}})[_0xaa41('0x43')](function(_0x5bef5f){logger['error'](_0xaa41('0x4f'),_0x5bef5f);throw _0x5bef5f;});}return _0x2288f8;})[_0xaa41('0x23')](respondWithResult(_0x1d6112,0xc9))[_0xaa41('0x43')](handleError(_0x1d6112,null));};exports[_0xaa41('0x50')]=function(_0x14aab0,_0x288db3){if(_0x14aab0[_0xaa41('0x49')]['id']){delete _0x14aab0[_0xaa41('0x49')]['id'];}return db['Disposition'][_0xaa41('0x51')]({'where':{'id':_0x14aab0[_0xaa41('0x44')]['id']}})[_0xaa41('0x23')](handleEntityNotFound(_0x288db3,null))['then'](saveUpdates(_0x14aab0[_0xaa41('0x49')],null))[_0xaa41('0x23')](respondWithResult(_0x288db3,null))['catch'](handleError(_0x288db3,null));};exports[_0xaa41('0x24')]=function(_0xd36d1a,_0x283b3b){return db['Disposition'][_0xaa41('0x51')]({'where':{'id':_0xd36d1a[_0xaa41('0x44')]['id']}})['then'](handleEntityNotFound(_0x283b3b,null))['then'](removeEntity(_0x283b3b,null))[_0xaa41('0x43')](handleError(_0x283b3b,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 3462c67..6e2b5e1 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 _0x02ab=['OpenchannelAccountId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','ListId','name_chat','name','ChatWebsiteId','name_mail','MailAccountId','SmsAccountId','name_fax','name_openchannel'];(function(_0x580cc3,_0x16d7fb){var _0x33c338=function(_0x8293a1){while(--_0x8293a1){_0x580cc3['push'](_0x580cc3['shift']());}};_0x33c338(++_0x16d7fb);}(_0x02ab,0x191));var _0xb02a=function(_0x5dd97f,_0x51e4f4){_0x5dd97f=_0x5dd97f-0x0;var _0x347a7a=_0x02ab[_0x5dd97f];return _0x347a7a;};'use strict';var _=require(_0xb02a('0x0'));var util=require(_0xb02a('0x1'));var logger=require(_0xb02a('0x2'))(_0xb02a('0x3'));var moment=require(_0xb02a('0x4'));var BPromise=require(_0xb02a('0x5'));var rp=require(_0xb02a('0x6'));var fs=require('fs');var path=require(_0xb02a('0x7'));var rimraf=require('rimraf');var config=require(_0xb02a('0x8'));var attributes=require(_0xb02a('0x9'));module[_0xb02a('0xa')]=function(_0x5bac1b,_0x4b0e5b){return _0x5bac1b[_0xb02a('0xb')](_0xb02a('0xc'),attributes,{'tableName':_0xb02a('0xd'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xb02a('0xe'),'fields':['name',_0xb02a('0xf')]},{'unique':!![],'name':_0xb02a('0x10'),'fields':[_0xb02a('0x11'),_0xb02a('0x12')]},{'unique':!![],'name':_0xb02a('0x13'),'fields':['name',_0xb02a('0x14')]},{'unique':!![],'name':'name_sms','fields':['name',_0xb02a('0x15')]},{'unique':!![],'name':_0xb02a('0x16'),'fields':['name','FaxAccountId']},{'unique':!![],'name':_0xb02a('0x17'),'fields':[_0xb02a('0x11'),_0xb02a('0x18')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7f65=['bluebird','request-promise','rimraf','./disposition.attributes','exports','define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','name_mail','MailAccountId','name_sms','SmsAccountId','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment'];(function(_0x23c69d,_0x5334f5){var _0x1465c5=function(_0x1bc0ee){while(--_0x1bc0ee){_0x23c69d['push'](_0x23c69d['shift']());}};_0x1465c5(++_0x5334f5);}(_0x7f65,0x91));var _0x57f6=function(_0x4287de,_0x16b1d9){_0x4287de=_0x4287de-0x0;var _0x4edfe0=_0x7f65[_0x4287de];return _0x4edfe0;};'use strict';var _=require(_0x57f6('0x0'));var util=require(_0x57f6('0x1'));var logger=require(_0x57f6('0x2'))(_0x57f6('0x3'));var moment=require(_0x57f6('0x4'));var BPromise=require(_0x57f6('0x5'));var rp=require(_0x57f6('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57f6('0x7'));var config=require('../../config/environment');var attributes=require(_0x57f6('0x8'));module[_0x57f6('0x9')]=function(_0x5ba2bf,_0x2d19ae){return _0x5ba2bf[_0x57f6('0xa')](_0x57f6('0xb'),attributes,{'tableName':_0x57f6('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':_0x57f6('0xd'),'fields':[_0x57f6('0xe'),_0x57f6('0xf')]},{'unique':!![],'name':_0x57f6('0x10'),'fields':[_0x57f6('0xe'),'ChatWebsiteId']},{'unique':!![],'name':_0x57f6('0x11'),'fields':[_0x57f6('0xe'),_0x57f6('0x12')]},{'unique':!![],'name':_0x57f6('0x13'),'fields':[_0x57f6('0xe'),_0x57f6('0x14')]},{'unique':!![],'name':_0x57f6('0x15'),'fields':['name',_0x57f6('0x16')]},{'unique':!![],'name':_0x57f6('0x17'),'fields':[_0x57f6('0xe'),_0x57f6('0x18')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 656321c..0ac935d 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 _0xd0ea=['http','request','then','info','request\x20sent','error','Disposition,\x20%s,\x20%s','message','result','catch','util','moment','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1093f0,_0x5f0af0){var _0x516e16=function(_0x4bea46){while(--_0x4bea46){_0x1093f0['push'](_0x1093f0['shift']());}};_0x516e16(++_0x5f0af0);}(_0xd0ea,0x81));var _0xad0e=function(_0x112c0d,_0x5af795){_0x112c0d=_0x112c0d-0x0;var _0xcb9325=_0xd0ea[_0x112c0d];return _0xcb9325;};'use strict';var _=require('lodash');var util=require(_0xad0e('0x0'));var moment=require(_0xad0e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad0e('0x2'))['db'];var utils=require(_0xad0e('0x3'));var logger=require(_0xad0e('0x4'))('rpc');var config=require(_0xad0e('0x5'));var jayson=require(_0xad0e('0x6'));var client=jayson['client'][_0xad0e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x301432,_0xe33de7,_0x6e6803){return new BPromise(function(_0x1c3056,_0x5aad66){return client[_0xad0e('0x8')](_0x301432,_0x6e6803)[_0xad0e('0x9')](function(_0x526bb0){logger[_0xad0e('0xa')]('Disposition,\x20%s,\x20%s',_0xe33de7,_0xad0e('0xb'));logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0xe33de7,_0xad0e('0xb'),JSON['stringify'](_0x526bb0));if(_0x526bb0[_0xad0e('0xc')]){if(_0x526bb0['error']['code']===0x1f4){logger[_0xad0e('0xc')](_0xad0e('0xd'),_0xe33de7,_0x526bb0[_0xad0e('0xc')][_0xad0e('0xe')]);return _0x5aad66(_0x526bb0[_0xad0e('0xc')][_0xad0e('0xe')]);}logger[_0xad0e('0xc')]('Disposition,\x20%s,\x20%s',_0xe33de7,_0x526bb0[_0xad0e('0xc')]['message']);return _0x1c3056(_0x526bb0[_0xad0e('0xc')][_0xad0e('0xe')]);}else{logger[_0xad0e('0xa')](_0xad0e('0xd'),_0xe33de7,_0xad0e('0xb'));_0x1c3056(_0x526bb0[_0xad0e('0xf')][_0xad0e('0xe')]);}})[_0xad0e('0x10')](function(_0x4e9f9a){logger[_0xad0e('0xc')]('Disposition,\x20%s,\x20%s',_0xe33de7,_0x4e9f9a);_0x5aad66(_0x4e9f9a);});});} \ No newline at end of file +var _0x60a6=['request\x20sent','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','Disposition,\x20%s,\x20%s'];(function(_0x548995,_0x2fa6bd){var _0x226488=function(_0x2407c4){while(--_0x2407c4){_0x548995['push'](_0x548995['shift']());}};_0x226488(++_0x2fa6bd);}(_0x60a6,0x133));var _0x660a=function(_0x5c8b96,_0x3d91bc){_0x5c8b96=_0x5c8b96-0x0;var _0x1211a5=_0x60a6[_0x5c8b96];return _0x1211a5;};'use strict';var _=require(_0x660a('0x0'));var util=require(_0x660a('0x1'));var moment=require(_0x660a('0x2'));var BPromise=require(_0x660a('0x3'));var rs=require(_0x660a('0x4'));var fs=require('fs');var Redis=require(_0x660a('0x5'));var db=require(_0x660a('0x6'))['db'];var utils=require(_0x660a('0x7'));var logger=require(_0x660a('0x8'))(_0x660a('0x9'));var config=require('../../config/environment');var jayson=require(_0x660a('0xa'));var client=jayson[_0x660a('0xb')][_0x660a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22264a,_0x2382b8,_0x4f438e){return new BPromise(function(_0x302291,_0x218e38){return client[_0x660a('0xd')](_0x22264a,_0x4f438e)['then'](function(_0x5e734e){logger['info'](_0x660a('0xe'),_0x2382b8,_0x660a('0xf'));logger['debug'](_0x660a('0x10'),_0x2382b8,_0x660a('0xf'),JSON[_0x660a('0x11')](_0x5e734e));if(_0x5e734e[_0x660a('0x12')]){if(_0x5e734e[_0x660a('0x12')][_0x660a('0x13')]===0x1f4){logger[_0x660a('0x12')]('Disposition,\x20%s,\x20%s',_0x2382b8,_0x5e734e[_0x660a('0x12')][_0x660a('0x14')]);return _0x218e38(_0x5e734e[_0x660a('0x12')][_0x660a('0x14')]);}logger[_0x660a('0x12')](_0x660a('0xe'),_0x2382b8,_0x5e734e[_0x660a('0x12')]['message']);return _0x302291(_0x5e734e[_0x660a('0x12')]['message']);}else{logger[_0x660a('0x15')](_0x660a('0xe'),_0x2382b8,_0x660a('0xf'));_0x302291(_0x5e734e[_0x660a('0x16')]['message']);}})['catch'](function(_0x11dae0){logger[_0x660a('0x12')](_0x660a('0xe'),_0x2382b8,_0x11dae0);_0x218e38(_0x11dae0);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index 810c093..7cb4a62 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 _0xc891=['multer','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./disposition.controller','get','isAuthenticated','index','/:id','post','put','destroy'];(function(_0x1a1e70,_0x3e90fa){var _0x2ae40e=function(_0x59358c){while(--_0x59358c){_0x1a1e70['push'](_0x1a1e70['shift']());}};_0x2ae40e(++_0x3e90fa);}(_0xc891,0x152));var _0x1c89=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xc891[_0x12d033];return _0x3b4e80;};'use strict';var multer=require(_0x1c89('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x1c89('0x1'));var express=require('express');var router=express[_0x1c89('0x2')]();var auth=require(_0x1c89('0x3'));var interaction=require(_0x1c89('0x4'));var config=require('../../config/environment');var controller=require(_0x1c89('0x5'));router[_0x1c89('0x6')]('/',auth[_0x1c89('0x7')](),controller[_0x1c89('0x8')]);router['get'](_0x1c89('0x9'),auth[_0x1c89('0x7')](),controller['show']);router[_0x1c89('0xa')]('/',auth[_0x1c89('0x7')](),controller['create']);router[_0x1c89('0xb')]('/:id',auth[_0x1c89('0x7')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x1c89('0xc')]);module['exports']=router; \ No newline at end of file +var _0xdaa8=['delete','destroy','exports','multer','util','path','connect-timeout','get','isAuthenticated','index','post','create','put','/:id','update'];(function(_0x258ab1,_0x26690a){var _0x3198d8=function(_0x1351dc){while(--_0x1351dc){_0x258ab1['push'](_0x258ab1['shift']());}};_0x3198d8(++_0x26690a);}(_0xdaa8,0xe4));var _0x8daa=function(_0x3b1eb6,_0x1a024a){_0x3b1eb6=_0x3b1eb6-0x0;var _0x6c9f8b=_0xdaa8[_0x3b1eb6];return _0x6c9f8b;};'use strict';var multer=require(_0x8daa('0x0'));var util=require(_0x8daa('0x1'));var path=require(_0x8daa('0x2'));var timeout=require(_0x8daa('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./disposition.controller');router[_0x8daa('0x4')]('/',auth[_0x8daa('0x5')](),controller[_0x8daa('0x6')]);router['get']('/:id',auth[_0x8daa('0x5')](),controller['show']);router[_0x8daa('0x7')]('/',auth[_0x8daa('0x5')](),controller[_0x8daa('0x8')]);router[_0x8daa('0x9')](_0x8daa('0xa'),auth['isAuthenticated'](),controller[_0x8daa('0xb')]);router[_0x8daa('0xc')](_0x8daa('0xa'),auth[_0x8daa('0x5')](),controller[_0x8daa('0xd')]);module[_0x8daa('0xe')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 695eee9..07ec28f 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 _0xcdef=['KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','2400','7200','9600','14400','4800','12000','v17,v27,v29','INTEGER','SIP','IAX'];(function(_0x3c5e53,_0x510079){var _0x2ad579=function(_0x17f6cc){while(--_0x17f6cc){_0x3c5e53['push'](_0x3c5e53['shift']());}};_0x2ad579(++_0x510079);}(_0xcdef,0x18f));var _0xfcde=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcdef[_0x4e676e];return _0x336a3c;};'use strict';var Sequelize=require(_0xfcde('0x0'));module[_0xfcde('0x1')]={'name':{'type':Sequelize[_0xfcde('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xfcde('0x2')]},'ecm':{'type':Sequelize[_0xfcde('0x3')](_0xfcde('0x4'),'no'),'defaultValue':_0xfcde('0x4')},'headerinfo':{'type':Sequelize[_0xfcde('0x2')],'defaultValue':_0xfcde('0x5')},'localstationid':{'type':Sequelize[_0xfcde('0x2')],'unique':_0xfcde('0x6')},'minrate':{'type':Sequelize[_0xfcde('0x3')](_0xfcde('0x7'),'4800',_0xfcde('0x8'),_0xfcde('0x9'),'12000',_0xfcde('0xa')),'defaultValue':_0xfcde('0xb')},'maxrate':{'type':Sequelize[_0xfcde('0x3')](_0xfcde('0x7'),_0xfcde('0xb'),'7200','9600',_0xfcde('0xc'),_0xfcde('0xa')),'defaultValue':_0xfcde('0xa')},'modem':{'type':Sequelize['STRING'],'defaultValue':_0xfcde('0xd')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0xfcde('0xe')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0xfcde('0x3')](_0xfcde('0xf'),_0xfcde('0x10'),'DADHI',_0xfcde('0x11')),'defaultValue':_0xfcde('0xf')},'key':{'type':Sequelize[_0xfcde('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xfcde('0x12')],'defaultValue':function(){return _0xfcde('0x13');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xfcde('0x14')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xfcde('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xfcde('0x14')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xfcde('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xfcde('0xe')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xfcde('0x15')},'mandatoryDisposition':{'type':Sequelize[_0xfcde('0x14')],'defaultValue':![],'comment':_0xfcde('0x16'),'set':function(_0x1ae715){if(!_0x1ae715)this[_0xfcde('0x17')](_0xfcde('0x18'),null);this['setDataValue'](_0xfcde('0x19'),_0x1ae715);}}}; \ No newline at end of file +var _0x0891=['7200','9600','14400','12000','v17,v27,v29','INTEGER','SIP','IAX','KHOMP','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','ENUM','yes','xCALLY\x20Motion\x20Fax','localstationid','4800'];(function(_0x18841e,_0x64e61f){var _0x49db81=function(_0x814ab8){while(--_0x814ab8){_0x18841e['push'](_0x18841e['shift']());}};_0x49db81(++_0x64e61f);}(_0x0891,0x119));var _0x1089=function(_0x48d6ea,_0x5daabb){_0x48d6ea=_0x48d6ea-0x0;var _0x5cee37=_0x0891[_0x48d6ea];return _0x5cee37;};'use strict';var Sequelize=require(_0x1089('0x0'));module['exports']={'name':{'type':Sequelize[_0x1089('0x1')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x1089('0x1')]},'ecm':{'type':Sequelize[_0x1089('0x2')](_0x1089('0x3'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize['STRING'],'defaultValue':_0x1089('0x4')},'localstationid':{'type':Sequelize[_0x1089('0x1')],'unique':_0x1089('0x5')},'minrate':{'type':Sequelize[_0x1089('0x2')]('2400',_0x1089('0x6'),_0x1089('0x7'),_0x1089('0x8'),'12000',_0x1089('0x9')),'defaultValue':_0x1089('0x6')},'maxrate':{'type':Sequelize[_0x1089('0x2')]('2400',_0x1089('0x6'),'7200',_0x1089('0x8'),_0x1089('0xa'),_0x1089('0x9')),'defaultValue':_0x1089('0x9')},'modem':{'type':Sequelize[_0x1089('0x1')],'defaultValue':_0x1089('0xb')},'gateway':{'type':Sequelize['STRING'],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x1089('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x1089('0xc')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x1089('0x2')](_0x1089('0xd'),_0x1089('0xe'),'DADHI',_0x1089('0xf')),'defaultValue':_0x1089('0xd')},'key':{'type':Sequelize[_0x1089('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1089('0x10')],'defaultValue':function(){return _0x1089('0x11');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x1089('0x12')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1089('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x1089('0x12')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1089('0xc')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1089('0xc')],'allowNull':!![],'defaultValue':null,'comment':_0x1089('0x13')},'mandatoryDisposition':{'type':Sequelize[_0x1089('0x12')],'defaultValue':![],'comment':_0x1089('0x14'),'set':function(_0x468315){if(!_0x468315)this[_0x1089('0x15')](_0x1089('0x16'),null);this['setDataValue'](_0x1089('0x17'),_0x468315);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index e814f9b..6300369 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 _0xfd21=['http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FaxAccount,\x20%s,\x20%s','info','catch','sendStatus','end','status','offset','set','apply','save','update','destroy','get','UserProfileResource','Pause','map','FaxAccount','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','name','filter','merge','options','count','includeAll','rows','params','keys','length','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','FaxAccounts','UserProfileSection','find','autoAssociation','mandatoryDispositionPause','describe','addDisposition','FaxAccountId','findOne','Disposition','findAll','removeDispositions','ids','CannedAnswer','include','removeAnswers','FaxInteraction','addInteraction','CmContact','Contact','fullname','internal','color','tag','addApplications','sequelize','transaction','FaxApplication','findAndCountAll','priority','getApplications','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','gateway','faxdetect','headerinfo','maxrate','modem','t38timeout','FAXOPT(','Wait','/var/opt/motion2/server/files/attachments/fax-${CALLERID(num)}-${CUT(UNIQUEID,.,1)}-${CUT(UNIQUEID,.,2)}-${STRFTIME(,,%C%y%m%d%H%M%S)}-rx.tif,d','ReceiveFax','VoiceExtension','bulkCreate','updateAccountApplications','omit','tech','createdAt','updatedAt','ListId','findById','FaxMessage','$gte','YYYY-MM-DD\x20HH:mm:ss','List','Contacts','DESC','attachments','join','root','basename','CheckAfterSend','isNil','from','format','\x22%s\x22\x20<%s>','fax','List\x20not\x20found','Send\x20Fax\x20failed','user','out','filename','Messages','Contact\x20not\x20found','spread','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','removeAgents','isArray','emit','userFaxAccount:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','register','jayson/promise','client'];(function(_0x56db83,_0x4cf2fc){var _0x2258b3=function(_0x17a4c0){while(--_0x17a4c0){_0x56db83['push'](_0x56db83['shift']());}};_0x2258b3(++_0x4cf2fc);}(_0xfd21,0x159));var _0x1fd2=function(_0x3cb0a9,_0x172b0a){_0x3cb0a9=_0x3cb0a9-0x0;var _0x5e45fc=_0xfd21[_0x3cb0a9];return _0x5e45fc;};'use strict';var pdf=require(_0x1fd2('0x0'));var emlformat=require(_0x1fd2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1fd2('0x2'));var jsonpatch=require(_0x1fd2('0x3'));var rp=require(_0x1fd2('0x4'));var moment=require(_0x1fd2('0x5'));var BPromise=require(_0x1fd2('0x6'));var Mustache=require(_0x1fd2('0x7'));var util=require(_0x1fd2('0x8'));var path=require(_0x1fd2('0x9'));var sox=require(_0x1fd2('0xa'));var csv=require(_0x1fd2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1fd2('0xc'));var squel=require(_0x1fd2('0xd'));var crypto=require(_0x1fd2('0xe'));var jsforce=require(_0x1fd2('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x1fd2('0xb'));var querystring=require(_0x1fd2('0x10'));var Papa=require(_0x1fd2('0x11'));var Redis=require(_0x1fd2('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1fd2('0x13'));var as=require(_0x1fd2('0x14'));var hardwareService=require(_0x1fd2('0x15'));var logger=require(_0x1fd2('0x16'))('api');var utils=require('../../config/utils');var config=require(_0x1fd2('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x1fd2('0x18')](config[_0x1fd2('0x19')],{'host':_0x1fd2('0x1a'),'port':0x18eb});var socket=require(_0x1fd2('0x1b'))(new Redis(config[_0x1fd2('0x19')]));require('./faxAccount.socket')[_0x1fd2('0x1c')](socket);var jayson=require(_0x1fd2('0x1d'));var client=jayson[_0x1fd2('0x1e')][_0x1fd2('0x1f')]({'port':0x232c});var client9002=jayson['client'][_0x1fd2('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x2c3e2a,_0x4b3e04,_0x77f9a6){if(_0x77f9a6){var _0x57a993=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x57a993[_0x1fd2('0x20')](_0x4b3e04)){return _0x2c3e2a;}else{throw new db[(_0x1fd2('0x21'))][(_0x1fd2('0x22'))](_0x1fd2('0x23'));}}else{return _0x2c3e2a;}}function respondWithRpcPromise(_0x4dd78d,_0x52c7aa,_0x8e8c31,_0x5bc028){return new BPromise(function(_0x1d8e1f,_0x4a1365){var _0x28c9a4=_0x5bc028||client;return _0x28c9a4[_0x1fd2('0x24')](_0x4dd78d,_0x8e8c31)[_0x1fd2('0x25')](function(_0xafc129){logger['info']('FaxAccount,\x20%s,\x20%s',_0x52c7aa,_0x1fd2('0x26'));logger[_0x1fd2('0x27')](_0x1fd2('0x28'),_0x52c7aa,_0x1fd2('0x26'),JSON[_0x1fd2('0x29')](_0xafc129));if(_0xafc129[_0x1fd2('0x2a')]){if(_0xafc129[_0x1fd2('0x2a')][_0x1fd2('0x2b')]===0x1f4){logger[_0x1fd2('0x2a')]('FaxAccount,\x20%s,\x20%s',_0x52c7aa,_0xafc129['error'][_0x1fd2('0x2c')]);return _0x4a1365(_0xafc129[_0x1fd2('0x2a')][_0x1fd2('0x2c')]);}logger[_0x1fd2('0x2a')](_0x1fd2('0x2d'),_0x52c7aa,_0xafc129[_0x1fd2('0x2a')][_0x1fd2('0x2c')]);return _0x1d8e1f(_0xafc129[_0x1fd2('0x2a')][_0x1fd2('0x2c')]);}else{logger[_0x1fd2('0x2e')](_0x1fd2('0x2d'),_0x52c7aa,_0x1fd2('0x26'));_0x1d8e1f(_0xafc129['result']['message']);}})[_0x1fd2('0x2f')](function(_0x20d9d4){logger[_0x1fd2('0x2a')](_0x1fd2('0x2d'),_0x52c7aa,_0x20d9d4);_0x4a1365(_0x20d9d4);});});}function respondWithStatusCode(_0x30e66a,_0x58ef52){_0x58ef52=_0x58ef52||0xcc;return function(_0x1dcabc){if(_0x1dcabc){return _0x30e66a[_0x1fd2('0x30')](_0x58ef52);}return _0x30e66a['status'](_0x58ef52)[_0x1fd2('0x31')]();};}function respondWithResult(_0x40e7b3,_0x539a24){_0x539a24=_0x539a24||0xc8;return function(_0x2ee3dd){if(_0x2ee3dd){return _0x40e7b3[_0x1fd2('0x32')](_0x539a24)['json'](_0x2ee3dd);}};}function respondWithFilteredResult(_0x3073e2,_0x293a1e){return function(_0x3d9a34){if(_0x3d9a34){var _0x54607c=_0x3d9a34['count'],_0x2bf3af=_0x293a1e[_0x1fd2('0x33')],_0x2d38f6=_0x293a1e[_0x1fd2('0x33')]+_0x293a1e['limit'],_0x42a9bb;if(_0x2d38f6>=_0x54607c){_0x2d38f6=_0x54607c;_0x42a9bb=0xc8;}else{_0x42a9bb=0xce;}_0x3073e2[_0x1fd2('0x32')](_0x42a9bb);return _0x3073e2[_0x1fd2('0x34')]('Content-Range',_0x2bf3af+'-'+_0x2d38f6+'/'+_0x54607c)['json'](_0x3d9a34);}return null;};}function patchUpdates(_0xfccf30){return function(_0x2f0668){try{jsonpatch[_0x1fd2('0x35')](_0x2f0668,_0xfccf30,!![]);}catch(_0x553afa){return BPromise['reject'](_0x553afa);}return _0x2f0668[_0x1fd2('0x36')]();};}function saveUpdates(_0x45a75f,_0xd038c5){return function(_0x147ca0){if(_0x147ca0){return _0x147ca0[_0x1fd2('0x37')](_0x45a75f)['then'](function(_0x293f58){return _0x293f58;});}return null;};}function removeEntity(_0x2acaea,_0x188d72){return function(_0x3afa54){if(_0x3afa54){return _0x3afa54[_0x1fd2('0x38')]()[_0x1fd2('0x25')](function(){var _0x51f07e=_0x3afa54[_0x1fd2('0x39')]({'plain':!![]});var _0x504af0='FaxAccounts';return db[_0x1fd2('0x3a')][_0x1fd2('0x38')]({'where':{'type':_0x504af0,'resourceId':_0x51f07e['id']}})[_0x1fd2('0x25')](function(){return _0x3afa54;});})[_0x1fd2('0x25')](function(){_0x2acaea[_0x1fd2('0x32')](0xcc)[_0x1fd2('0x31')]();});}};}function handleEntityNotFound(_0x3e8ec4,_0x30fa6d){return function(_0x54da14){if(!_0x54da14){_0x3e8ec4[_0x1fd2('0x30')](0x194);}return _0x54da14;};}function handleError(_0x11329d,_0x1be698){_0x1be698=_0x1be698||0x1f4;return function(_0x2a9b51){logger[_0x1fd2('0x2a')](_0x2a9b51['stack']);if(_0x2a9b51['name']){delete _0x2a9b51['name'];}_0x11329d['status'](_0x1be698)['send'](_0x2a9b51);};}exports['index']=function(_0x2ea41d,_0x2d6952){var _0x144de5={'include':[{'model':db[_0x1fd2('0x3b')],'as':'mandatoryDispositionPause'}]},_0x3b1b6a={},_0x273fda={'count':0x0,'rows':[]};var _0x8d9f74=_[_0x1fd2('0x3c')](db[_0x1fd2('0x3d')][_0x1fd2('0x3e')],function(_0x2bc196){return{'name':_0x2bc196[_0x1fd2('0x3f')],'type':_0x2bc196[_0x1fd2('0x40')][_0x1fd2('0x41')]};});_0x3b1b6a['model']=_['map'](_0x8d9f74,'name');_0x3b1b6a['query']=_['keys'](_0x2ea41d[_0x1fd2('0x42')]);_0x3b1b6a['filters']=_[_0x1fd2('0x43')](_0x3b1b6a[_0x1fd2('0x44')],_0x3b1b6a[_0x1fd2('0x42')]);_0x144de5[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x3b1b6a[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x2ea41d[_0x1fd2('0x42')]['fields']));_0x144de5[_0x1fd2('0x45')]=_0x144de5[_0x1fd2('0x45')]['length']?_0x144de5['attributes']:_0x3b1b6a[_0x1fd2('0x44')];if(!_0x2ea41d[_0x1fd2('0x42')][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x144de5[_0x1fd2('0x49')]=qs['limit'](_0x2ea41d[_0x1fd2('0x42')]['limit']);_0x144de5[_0x1fd2('0x33')]=qs[_0x1fd2('0x33')](_0x2ea41d[_0x1fd2('0x42')][_0x1fd2('0x33')]);}_0x144de5[_0x1fd2('0x4a')]=qs[_0x1fd2('0x4b')](_0x2ea41d[_0x1fd2('0x42')][_0x1fd2('0x4b')]);_0x144de5[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_[_0x1fd2('0x4e')](_0x2ea41d['query'],_0x3b1b6a['filters']));if(_0x2ea41d[_0x1fd2('0x42')]['filter']){_0x144de5[_0x1fd2('0x4c')]=_['merge'](_0x144de5[_0x1fd2('0x4c')],{'$or':_[_0x1fd2('0x3c')](_0x8d9f74,function(_0x39f5af){if(_0x39f5af['type']!=='VIRTUAL'){var _0x33b767={};_0x33b767[_0x39f5af[_0x1fd2('0x4f')]]={'$like':'%'+_0x2ea41d['query'][_0x1fd2('0x50')]+'%'};return _0x33b767;}})});}_0x144de5=_[_0x1fd2('0x51')]({},_0x144de5,_0x2ea41d[_0x1fd2('0x52')]);var _0x4a87ed={'where':_0x144de5['where']};return db[_0x1fd2('0x3d')][_0x1fd2('0x53')](_0x4a87ed)['then'](function(_0x51d2b8){_0x273fda[_0x1fd2('0x53')]=_0x51d2b8;if(_0x2ea41d[_0x1fd2('0x42')][_0x1fd2('0x54')]){_0x144de5['include']=[{'all':!![]}];}return db[_0x1fd2('0x3d')]['findAll'](_0x144de5);})[_0x1fd2('0x25')](function(_0x43fd77){_0x273fda[_0x1fd2('0x55')]=_0x43fd77;return _0x273fda;})['then'](respondWithFilteredResult(_0x2d6952,_0x144de5))[_0x1fd2('0x2f')](handleError(_0x2d6952,null));};exports['show']=function(_0xadae51,_0x5a66c9){var _0x5676fc={'raw':![],'where':{'id':_0xadae51[_0x1fd2('0x56')]['id']},'include':[{'model':db[_0x1fd2('0x3b')],'as':'mandatoryDispositionPause'}]},_0x5c1541={};_0x5c1541[_0x1fd2('0x44')]=_['keys'](db[_0x1fd2('0x3d')][_0x1fd2('0x3e')]);_0x5c1541['query']=_[_0x1fd2('0x57')](_0xadae51[_0x1fd2('0x42')]);_0x5c1541['filters']=_[_0x1fd2('0x43')](_0x5c1541[_0x1fd2('0x44')],_0x5c1541['query']);_0x5676fc[_0x1fd2('0x45')]=_['intersection'](_0x5c1541['model'],qs[_0x1fd2('0x46')](_0xadae51[_0x1fd2('0x42')][_0x1fd2('0x46')]));_0x5676fc[_0x1fd2('0x45')]=_0x5676fc[_0x1fd2('0x45')][_0x1fd2('0x58')]?_0x5676fc['attributes']:_0x5c1541['model'];if(_0xadae51[_0x1fd2('0x42')][_0x1fd2('0x54')]){_0x5676fc['include']=[{'all':!![]}];}_0x5676fc=_['merge']({},_0x5676fc,_0xadae51[_0x1fd2('0x52')]);return db[_0x1fd2('0x3d')]['find'](_0x5676fc)[_0x1fd2('0x25')](handleEntityNotFound(_0x5a66c9,null))[_0x1fd2('0x25')](respondWithResult(_0x5a66c9,null))['catch'](handleError(_0x5a66c9,null));};exports[_0x1fd2('0x59')]=function(_0x3515bf,_0x443546){return db[_0x1fd2('0x3d')]['create'](_0x3515bf[_0x1fd2('0x5a')],{})[_0x1fd2('0x25')](function(_0x2ea1ae){var _0x165511=_0x3515bf['user']['get']({'plain':!![]});if(!_0x165511)throw new Error(_0x1fd2('0x5b'));if(_0x165511['role']==='user'){var _0x3dd225=_0x2ea1ae[_0x1fd2('0x39')]({'plain':!![]});var _0x333b6=_0x1fd2('0x5c');return db[_0x1fd2('0x5d')][_0x1fd2('0x5e')]({'where':{'name':_0x333b6,'userProfileId':_0x165511['userProfileId']},'raw':!![]})['then'](function(_0x49cfdd){if(_0x49cfdd&&_0x49cfdd[_0x1fd2('0x5f')]===0x0){return db['UserProfileResource']['create']({'name':_0x3dd225[_0x1fd2('0x4f')],'resourceId':_0x3dd225['id'],'type':_0x49cfdd[_0x1fd2('0x4f')],'sectionId':_0x49cfdd['id']},{})[_0x1fd2('0x25')](function(){return _0x2ea1ae;});}else{return _0x2ea1ae;}})[_0x1fd2('0x2f')](function(_0x1c7cc1){logger[_0x1fd2('0x2a')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1c7cc1);throw _0x1c7cc1;});}return _0x2ea1ae;})[_0x1fd2('0x25')](respondWithResult(_0x443546,0xc9))[_0x1fd2('0x2f')](handleError(_0x443546,null));};exports[_0x1fd2('0x37')]=function(_0x43e6c2,_0x5d339c){if(_0x43e6c2['body']['id']){delete _0x43e6c2['body']['id'];}return db['FaxAccount'][_0x1fd2('0x5e')]({'where':{'id':_0x43e6c2[_0x1fd2('0x56')]['id']},'include':[{'model':db[_0x1fd2('0x3b')],'as':_0x1fd2('0x60')}]})[_0x1fd2('0x25')](handleEntityNotFound(_0x5d339c,null))['then'](saveUpdates(_0x43e6c2[_0x1fd2('0x5a')],null))[_0x1fd2('0x25')](respondWithResult(_0x5d339c,null))[_0x1fd2('0x2f')](handleError(_0x5d339c,null));};exports['destroy']=function(_0x3ac1e4,_0x455c83){return db['FaxAccount']['find']({'where':{'id':_0x3ac1e4['params']['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x455c83,null))[_0x1fd2('0x25')](removeEntity(_0x455c83,null))[_0x1fd2('0x2f')](handleError(_0x455c83,null));};exports[_0x1fd2('0x61')]=function(_0x13bb8e,_0x7cc6e5){return db[_0x1fd2('0x3d')][_0x1fd2('0x61')]()[_0x1fd2('0x25')](respondWithResult(_0x7cc6e5,null))['catch'](handleError(_0x7cc6e5,null));};exports[_0x1fd2('0x62')]=function(_0x32d9b4,_0x23a42b,_0x254788){if(_0x32d9b4[_0x1fd2('0x5a')]['id']){delete _0x32d9b4[_0x1fd2('0x5a')]['id'];}return db['FaxAccount'][_0x1fd2('0x5e')]({'where':{'id':_0x32d9b4['params']['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x23a42b,null))[_0x1fd2('0x25')](function(_0x57ca40){if(_0x57ca40){_0x32d9b4[_0x1fd2('0x5a')][_0x1fd2('0x63')]=_0x57ca40['id'];return db['Disposition'][_0x1fd2('0x59')](_0x32d9b4[_0x1fd2('0x5a')]);}})[_0x1fd2('0x25')](respondWithResult(_0x23a42b,null))[_0x1fd2('0x2f')](handleError(_0x23a42b,null));};exports['getDispositions']=function(_0x17fe01,_0x40d79d,_0x3dec1b){var _0x556535={'raw':![],'where':{}};var _0x5f3aef={};var _0x5e968d={'count':0x0,'rows':[]};return db[_0x1fd2('0x3d')][_0x1fd2('0x64')]({'where':{'id':_0x17fe01[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x40d79d,null))[_0x1fd2('0x25')](function(_0x117178){if(_0x117178){_0x5f3aef['model']=_[_0x1fd2('0x57')](db[_0x1fd2('0x65')][_0x1fd2('0x3e')]);_0x5f3aef[_0x1fd2('0x42')]=_[_0x1fd2('0x57')](_0x17fe01['query']);_0x5f3aef[_0x1fd2('0x4d')]=_[_0x1fd2('0x43')](_0x5f3aef[_0x1fd2('0x44')],_0x5f3aef[_0x1fd2('0x42')]);_0x556535[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x5f3aef[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x46')]));_0x556535['attributes']=_0x556535['attributes'][_0x1fd2('0x58')]?_0x556535['attributes']:_0x5f3aef[_0x1fd2('0x44')];if(!_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x556535[_0x1fd2('0x49')]=qs['limit'](_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x49')]);_0x556535['offset']=qs[_0x1fd2('0x33')](_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x33')]);}_0x556535[_0x1fd2('0x4a')]=qs['sort'](_0x17fe01['query'][_0x1fd2('0x4b')]);_0x556535[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_['pick'](_0x17fe01[_0x1fd2('0x42')],_0x5f3aef[_0x1fd2('0x4d')]));_0x556535[_0x1fd2('0x4c')][_0x1fd2('0x63')]=_0x117178['id'];if(_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x50')]){_0x556535['where']=_[_0x1fd2('0x51')](_0x556535[_0x1fd2('0x4c')],{'$or':_['map'](_0x556535['attributes'],function(_0x492275){var _0x261147={};_0x261147[_0x492275]={'$like':'%'+_0x17fe01[_0x1fd2('0x42')][_0x1fd2('0x50')]+'%'};return _0x261147;})});}_0x556535=_[_0x1fd2('0x51')]({},_0x556535,_0x17fe01[_0x1fd2('0x52')]);return db[_0x1fd2('0x65')][_0x1fd2('0x53')]({'where':_0x556535[_0x1fd2('0x4c')]})['then'](function(_0xc3efc3){_0x5e968d[_0x1fd2('0x53')]=_0xc3efc3;if(_0x17fe01['query'][_0x1fd2('0x54')]){_0x556535['include']=[{'all':!![]}];}return db[_0x1fd2('0x65')][_0x1fd2('0x66')](_0x556535);})[_0x1fd2('0x25')](function(_0x322881){_0x5e968d[_0x1fd2('0x55')]=_0x322881;return _0x5e968d;});}})[_0x1fd2('0x25')](respondWithFilteredResult(_0x40d79d,_0x556535))[_0x1fd2('0x2f')](handleError(_0x40d79d,null));};exports[_0x1fd2('0x67')]=function(_0x5894e1,_0x5e51fd,_0x717edf){return db[_0x1fd2('0x3d')][_0x1fd2('0x5e')]({'where':{'id':_0x5894e1[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x5e51fd,null))[_0x1fd2('0x25')](function(_0x52f452){if(_0x52f452){return _0x52f452[_0x1fd2('0x67')](_0x5894e1['query'][_0x1fd2('0x68')]);}})['then'](respondWithStatusCode(_0x5e51fd,null))[_0x1fd2('0x2f')](handleError(_0x5e51fd,null));};exports['addAnswer']=function(_0x57b33d,_0x12d511,_0x3204ef){if(_0x57b33d[_0x1fd2('0x5a')]['id']){delete _0x57b33d['body']['id'];}return db[_0x1fd2('0x3d')][_0x1fd2('0x5e')]({'where':{'id':_0x57b33d[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x12d511,null))['then'](function(_0x5b9fb0){if(_0x5b9fb0){_0x57b33d[_0x1fd2('0x5a')][_0x1fd2('0x63')]=_0x5b9fb0['id'];return db[_0x1fd2('0x69')][_0x1fd2('0x59')](_0x57b33d['body']);}})[_0x1fd2('0x25')](respondWithResult(_0x12d511,null))['catch'](handleError(_0x12d511,null));};exports['getAnswers']=function(_0x370e4a,_0x536fde,_0x3bb7d3){var _0x3e64b3={'raw':![],'where':{}};var _0x517f75={};var _0x45c184={'count':0x0,'rows':[]};return db[_0x1fd2('0x3d')][_0x1fd2('0x64')]({'where':{'id':_0x370e4a['params']['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x536fde,null))[_0x1fd2('0x25')](function(_0x527e39){if(_0x527e39){_0x517f75[_0x1fd2('0x44')]=_[_0x1fd2('0x57')](db[_0x1fd2('0x69')][_0x1fd2('0x3e')]);_0x517f75[_0x1fd2('0x42')]=_['keys'](_0x370e4a[_0x1fd2('0x42')]);_0x517f75[_0x1fd2('0x4d')]=_[_0x1fd2('0x43')](_0x517f75[_0x1fd2('0x44')],_0x517f75[_0x1fd2('0x42')]);_0x3e64b3[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x517f75[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x370e4a[_0x1fd2('0x42')]['fields']));_0x3e64b3['attributes']=_0x3e64b3[_0x1fd2('0x45')][_0x1fd2('0x58')]?_0x3e64b3['attributes']:_0x517f75[_0x1fd2('0x44')];if(!_0x370e4a[_0x1fd2('0x42')][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x3e64b3[_0x1fd2('0x49')]=qs['limit'](_0x370e4a[_0x1fd2('0x42')][_0x1fd2('0x49')]);_0x3e64b3[_0x1fd2('0x33')]=qs['offset'](_0x370e4a[_0x1fd2('0x42')][_0x1fd2('0x33')]);}_0x3e64b3[_0x1fd2('0x4a')]=qs[_0x1fd2('0x4b')](_0x370e4a['query']['sort']);_0x3e64b3[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_[_0x1fd2('0x4e')](_0x370e4a['query'],_0x517f75[_0x1fd2('0x4d')]));_0x3e64b3[_0x1fd2('0x4c')][_0x1fd2('0x63')]=_0x527e39['id'];if(_0x370e4a[_0x1fd2('0x42')][_0x1fd2('0x50')]){_0x3e64b3[_0x1fd2('0x4c')]=_[_0x1fd2('0x51')](_0x3e64b3[_0x1fd2('0x4c')],{'$or':_[_0x1fd2('0x3c')](_0x3e64b3[_0x1fd2('0x45')],function(_0x40db32){var _0x56f7ba={};_0x56f7ba[_0x40db32]={'$like':'%'+_0x370e4a['query'][_0x1fd2('0x50')]+'%'};return _0x56f7ba;})});}_0x3e64b3=_['merge']({},_0x3e64b3,_0x370e4a[_0x1fd2('0x52')]);return db[_0x1fd2('0x69')]['count']({'where':_0x3e64b3['where']})[_0x1fd2('0x25')](function(_0x131277){_0x45c184[_0x1fd2('0x53')]=_0x131277;if(_0x370e4a[_0x1fd2('0x42')][_0x1fd2('0x54')]){_0x3e64b3[_0x1fd2('0x6a')]=[{'all':!![]}];}return db[_0x1fd2('0x69')][_0x1fd2('0x66')](_0x3e64b3);})[_0x1fd2('0x25')](function(_0x44c8a2){_0x45c184['rows']=_0x44c8a2;return _0x45c184;});}})['then'](respondWithFilteredResult(_0x536fde,_0x3e64b3))['catch'](handleError(_0x536fde,null));};exports['removeAnswers']=function(_0x5be86f,_0x569100,_0x373642){return db['FaxAccount'][_0x1fd2('0x5e')]({'where':{'id':_0x5be86f[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x569100,null))['then'](function(_0x528487){if(_0x528487){return _0x528487[_0x1fd2('0x6b')](_0x5be86f[_0x1fd2('0x42')][_0x1fd2('0x68')]);}})['then'](respondWithStatusCode(_0x569100,null))[_0x1fd2('0x2f')](handleError(_0x569100,null));};exports['addInteraction']=function(_0xe73be0,_0x9ba3a4,_0x5ee5f7){return db[_0x1fd2('0x6c')]['find']({'where':{'id':_0xe73be0[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x9ba3a4,null))['then'](function(_0x388e95){if(_0x388e95){return _0x388e95[_0x1fd2('0x6d')](_0xe73be0[_0x1fd2('0x5a')][_0x1fd2('0x68')],_['omit'](_0xe73be0[_0x1fd2('0x5a')],[_0x1fd2('0x68'),'id'])||{});}})['then'](respondWithResult(_0x9ba3a4,null))[_0x1fd2('0x2f')](handleError(_0x9ba3a4,null));};exports['getInteractions']=function(_0x1e73bb,_0x43fd7e,_0x2d8599){var _0x43e8da={'raw':![],'where':{}};var _0x535e85={};var _0x515d69={'count':0x0,'rows':[]};return db[_0x1fd2('0x3d')][_0x1fd2('0x64')]({'where':{'id':_0x1e73bb[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x43fd7e,null))[_0x1fd2('0x25')](function(_0x5c12f3){if(_0x5c12f3){_0x535e85[_0x1fd2('0x44')]=_[_0x1fd2('0x57')](db['FaxInteraction'][_0x1fd2('0x3e')]);_0x535e85[_0x1fd2('0x42')]=_[_0x1fd2('0x57')](_0x1e73bb[_0x1fd2('0x42')]);_0x535e85[_0x1fd2('0x4d')]=_['intersection'](_0x535e85[_0x1fd2('0x44')],_0x535e85[_0x1fd2('0x42')]);_0x43e8da[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x535e85[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x46')]));_0x43e8da[_0x1fd2('0x45')]=_0x43e8da[_0x1fd2('0x45')][_0x1fd2('0x58')]?_0x43e8da['attributes']:_0x535e85['model'];if(!_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x43e8da[_0x1fd2('0x49')]=qs[_0x1fd2('0x49')](_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x49')]);_0x43e8da['offset']=qs[_0x1fd2('0x33')](_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x33')]);}_0x43e8da[_0x1fd2('0x4a')]=qs['sort'](_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x4b')]);_0x43e8da[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_[_0x1fd2('0x4e')](_0x1e73bb[_0x1fd2('0x42')],_0x535e85[_0x1fd2('0x4d')]));_0x43e8da[_0x1fd2('0x4c')][_0x1fd2('0x63')]=_0x5c12f3['id'];if(_0x1e73bb['query'][_0x1fd2('0x50')]){_0x43e8da['where']=_[_0x1fd2('0x51')](_0x43e8da[_0x1fd2('0x4c')],{'$or':_[_0x1fd2('0x3c')](_0x43e8da[_0x1fd2('0x45')],function(_0x229e52){var _0x40dba4={};_0x40dba4[_0x229e52]={'$like':'%'+_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x50')]+'%'};return _0x40dba4;})});}_0x43e8da=_[_0x1fd2('0x51')]({},_0x43e8da,_0x1e73bb[_0x1fd2('0x52')]);return db[_0x1fd2('0x6c')][_0x1fd2('0x53')]({'where':_0x43e8da['where']})[_0x1fd2('0x25')](function(_0x41541b){_0x515d69['count']=_0x41541b;if(_0x1e73bb['query'][_0x1fd2('0x54')]){_0x43e8da[_0x1fd2('0x6a')]=[{'model':db[_0x1fd2('0x6e')],'as':_0x1fd2('0x6f'),'required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x1fd2('0x4f'),_0x1fd2('0x70'),_0x1fd2('0x71')],'required':![]},{'model':db['Tag'],'as':'Tags','attributes':['id',_0x1fd2('0x4f'),_0x1fd2('0x72')],'where':_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x73')]?{'id':_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x73')]}:undefined,'required':_0x1e73bb[_0x1fd2('0x42')][_0x1fd2('0x73')]?!![]:![]}];}return db[_0x1fd2('0x6c')][_0x1fd2('0x66')](_0x43e8da);})[_0x1fd2('0x25')](function(_0xe89acc){_0x515d69[_0x1fd2('0x55')]=_0xe89acc;return _0x515d69;});}})[_0x1fd2('0x25')](respondWithFilteredResult(_0x43fd7e,_0x43e8da))[_0x1fd2('0x2f')](handleError(_0x43fd7e,null));};exports[_0x1fd2('0x74')]=function(_0xd47664,_0x2ee952,_0xedf84c){return db['FaxAccount'][_0x1fd2('0x64')]({'where':{'id':_0xd47664[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x2ee952,null))[_0x1fd2('0x25')](function(_0x3920d4){if(_0x3920d4){return db[_0x1fd2('0x75')][_0x1fd2('0x76')](function(_0x4df6a7){return db[_0x1fd2('0x77')][_0x1fd2('0x38')]({'where':{'FaxAccountId':_0xd47664[_0x1fd2('0x56')]['id']},'transaction':_0x4df6a7})[_0x1fd2('0x25')](function(_0xe3f72f){var _0x12a199=_[_0x1fd2('0x3c')](_0xd47664[_0x1fd2('0x5a')],function(_0xeb3f0){_0xeb3f0[_0x1fd2('0x63')]=_0xd47664['params']['id'];return _0xeb3f0;});return db[_0x1fd2('0x77')]['bulkCreate'](_0x12a199,{'transaction':_0x4df6a7});});})[_0x1fd2('0x25')](function(){return db['FaxApplication'][_0x1fd2('0x78')]({'where':{'FaxAccountId':_0xd47664[_0x1fd2('0x56')]['id']},'order':_0x1fd2('0x79')});});}})['then'](respondWithResult(_0x2ee952,null))[_0x1fd2('0x2f')](handleError(_0x2ee952,null));};exports['getApplications']=function(_0x5f1a28,_0x12ea3c,_0x377d66){var _0x57b699={};var _0x440c89={};var _0x123df7;var _0x177bcf;return db['FaxAccount'][_0x1fd2('0x64')]({'where':{'id':_0x5f1a28[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x12ea3c,null))[_0x1fd2('0x25')](function(_0x4b8333){if(_0x4b8333){_0x123df7=_0x4b8333;_0x440c89['model']=_[_0x1fd2('0x57')](db[_0x1fd2('0x77')]['rawAttributes']);_0x440c89[_0x1fd2('0x42')]=_['keys'](_0x5f1a28['query']);_0x440c89[_0x1fd2('0x4d')]=_['intersection'](_0x440c89[_0x1fd2('0x44')],_0x440c89['query']);_0x57b699[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x440c89[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x5f1a28[_0x1fd2('0x42')][_0x1fd2('0x46')]));_0x57b699[_0x1fd2('0x45')]=_0x57b699[_0x1fd2('0x45')]['length']?_0x57b699['attributes']:_0x440c89[_0x1fd2('0x44')];_0x57b699[_0x1fd2('0x4a')]=qs[_0x1fd2('0x4b')](_0x5f1a28['query'][_0x1fd2('0x4b')]);_0x57b699[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_[_0x1fd2('0x4e')](_0x5f1a28[_0x1fd2('0x42')],_0x440c89['filters']));if(_0x5f1a28[_0x1fd2('0x42')][_0x1fd2('0x50')]){_0x57b699[_0x1fd2('0x4c')]=_['merge'](_0x57b699[_0x1fd2('0x4c')],{'$or':_[_0x1fd2('0x3c')](_0x57b699[_0x1fd2('0x45')],function(_0xdd1bd3){var _0x84fba7={};_0x84fba7[_0xdd1bd3]={'$like':'%'+_0x5f1a28[_0x1fd2('0x42')][_0x1fd2('0x50')]+'%'};return _0x84fba7;})});}_0x57b699=_['merge']({},_0x57b699,_0x5f1a28[_0x1fd2('0x52')]);return _0x123df7['getApplications'](_0x57b699);}})[_0x1fd2('0x25')](function(_0x44cd01){if(_0x44cd01){_0x177bcf=_0x44cd01[_0x1fd2('0x58')];if(!_0x5f1a28[_0x1fd2('0x42')]['hasOwnProperty'](_0x1fd2('0x48'))){_0x57b699[_0x1fd2('0x49')]=qs[_0x1fd2('0x49')](_0x5f1a28[_0x1fd2('0x42')][_0x1fd2('0x49')]);_0x57b699['offset']=qs[_0x1fd2('0x33')](_0x5f1a28[_0x1fd2('0x42')][_0x1fd2('0x33')]);}return _0x123df7[_0x1fd2('0x7a')](_0x57b699);}})[_0x1fd2('0x25')](function(_0x4782e6){if(_0x4782e6){return _0x4782e6?{'count':_0x177bcf,'rows':_0x4782e6}:null;}})[_0x1fd2('0x25')](respondWithResult(_0x12ea3c,null))['catch'](handleError(_0x12ea3c,null));};function Extension(_0x46a425,_0x29ce79,_0x1015c2,_0xb9bba8){this['context']=_0x1fd2('0x7b');this['exten']=_0x46a425[_0x1fd2('0x7c')];this[_0x1fd2('0x7d')]=_0xb9bba8;this[_0x1fd2('0x40')]=_0x1fd2('0x7e');this[_0x1fd2('0x7f')]=_0x1fd2('0x80');this[_0x1fd2('0x63')]=_0x46a425['id'];this[_0x1fd2('0x79')]=_0x29ce79;this[_0x1fd2('0x81')]=_0x1015c2;}function createExtensionsReciveFax(_0x44096b){var _0xfe68cd=0x1;var _0x43c6fe=[];_0x43c6fe[_0x1fd2('0x82')](new Extension(_0x44096b,_0xfe68cd,'',_0x1fd2('0x83')));_0xfe68cd+=0x1;_0x43c6fe[_0x1fd2('0x82')](new Extension(_0x44096b,_0xfe68cd,_0x1fd2('0x84'),_0x1fd2('0x85')));_0xfe68cd+=0x1;for(var _0x1ed0f9 in _0x44096b){if(_0x44096b['hasOwnProperty'](_0x1ed0f9)&&(_0x1ed0f9===_0x1fd2('0x86')||_0x1ed0f9==='localstationid'||_0x1ed0f9===_0x1fd2('0x87')||_0x1ed0f9===_0x1fd2('0x88')||_0x1ed0f9===_0x1fd2('0x89')||_0x1ed0f9===_0x1fd2('0x8a')||_0x1ed0f9==='minrate'||_0x1ed0f9===_0x1fd2('0x8b')||_0x1ed0f9===_0x1fd2('0x8c'))){_0x43c6fe[_0x1fd2('0x82')](new Extension(_0x44096b,_0xfe68cd,_0x1fd2('0x8d')+_0x1ed0f9+')='+_0x44096b[_0x1ed0f9],_0x1fd2('0x85')));_0xfe68cd+=0x1;}}_0x43c6fe['push'](new Extension(_0x44096b,_0xfe68cd,'6',_0x1fd2('0x8e')));_0xfe68cd+=0x1;_0x43c6fe[_0x1fd2('0x82')](new Extension(_0x44096b,_0xfe68cd,_0x1fd2('0x8f'),_0x1fd2('0x90')));_0xfe68cd=0x0;return _0x43c6fe;}exports['addAccountApplications']=function(_0x27e0ef,_0x5592ab,_0x94d087){var _0x54e31e;return db[_0x1fd2('0x75')][_0x1fd2('0x76')](function(_0x5c221f){return db[_0x1fd2('0x3d')][_0x1fd2('0x59')](_0x27e0ef[_0x1fd2('0x5a')],{'transaction':_0x5c221f})[_0x1fd2('0x25')](function(_0x3cce94){_0x54e31e=_0x3cce94[_0x1fd2('0x39')]({'plain':!![]});return db[_0x1fd2('0x91')][_0x1fd2('0x92')](createExtensionsReciveFax(_0x54e31e),{'transaction':_0x5c221f});});})['then'](function(){return _0x54e31e;})[_0x1fd2('0x25')](respondWithResult(_0x5592ab,null))['catch'](handleError(_0x5592ab,null));};exports[_0x1fd2('0x93')]=function(_0x43c2a7,_0x510b80,_0x5de8eb){var _0x1ec515;return db[_0x1fd2('0x75')]['transaction'](function(_0x5de747){return db['FaxAccount'][_0x1fd2('0x37')](_0x43c2a7['body'],{'where':{'id':_0x43c2a7['body']['id']},'transaction':_0x5de747})[_0x1fd2('0x25')](function(_0x160d31){return db[_0x1fd2('0x91')][_0x1fd2('0x38')]({'where':{'FaxAccountId':_0x43c2a7[_0x1fd2('0x5a')]['id']},'transaction':_0x5de747})[_0x1fd2('0x25')](function(_0x4537fa){return db[_0x1fd2('0x91')][_0x1fd2('0x92')](createExtensionsReciveFax(_[_0x1fd2('0x94')](_0x43c2a7[_0x1fd2('0x5a')],[_0x1fd2('0x95'),_0x1fd2('0x41'),_0x1fd2('0x96'),_0x1fd2('0x97'),'TrunkId',_0x1fd2('0x98')])),{'transaction':_0x5de747});});});})[_0x1fd2('0x25')](function(){return db[_0x1fd2('0x3d')][_0x1fd2('0x99')](_0x43c2a7['body']['id']);})[_0x1fd2('0x25')](respondWithResult(_0x510b80,null))[_0x1fd2('0x2f')](handleError(_0x510b80,null));};exports['getMessages']=function(_0x1a7bcf,_0x3872c9,_0x37555a){var _0x31ab2a={'raw':!![],'where':{}};var _0x139fde={};var _0x56d543={'count':0x0,'rows':[]};return db[_0x1fd2('0x3d')]['findOne']({'where':{'id':_0x1a7bcf[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x3872c9,null))[_0x1fd2('0x25')](function(_0x32ff14){if(_0x32ff14){_0x139fde[_0x1fd2('0x44')]=_['keys'](db[_0x1fd2('0x9a')][_0x1fd2('0x3e')]);_0x139fde[_0x1fd2('0x42')]=_[_0x1fd2('0x57')](_0x1a7bcf[_0x1fd2('0x42')]);_0x139fde[_0x1fd2('0x4d')]=_['intersection'](_0x139fde[_0x1fd2('0x44')],_0x139fde[_0x1fd2('0x42')]);_0x31ab2a[_0x1fd2('0x45')]=_[_0x1fd2('0x43')](_0x139fde[_0x1fd2('0x44')],qs[_0x1fd2('0x46')](_0x1a7bcf['query']['fields']));_0x31ab2a[_0x1fd2('0x45')]=_0x31ab2a[_0x1fd2('0x45')][_0x1fd2('0x58')]?_0x31ab2a[_0x1fd2('0x45')]:_0x139fde[_0x1fd2('0x44')];if(!_0x1a7bcf['query'][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x31ab2a[_0x1fd2('0x49')]=qs['limit'](_0x1a7bcf[_0x1fd2('0x42')]['limit']);_0x31ab2a['offset']=qs['offset'](_0x1a7bcf[_0x1fd2('0x42')][_0x1fd2('0x33')]);}_0x31ab2a['order']=qs[_0x1fd2('0x4b')](_0x1a7bcf[_0x1fd2('0x42')]['sort']);_0x31ab2a[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_['pick'](_0x1a7bcf[_0x1fd2('0x42')],_0x139fde[_0x1fd2('0x4d')]));_0x31ab2a[_0x1fd2('0x4c')][_0x1fd2('0x63')]=_0x32ff14['id'];if(_0x1a7bcf['query'][_0x1fd2('0x50')]){_0x31ab2a[_0x1fd2('0x4c')]=_['merge'](_0x31ab2a[_0x1fd2('0x4c')],{'$or':_['map'](_0x31ab2a['attributes'],function(_0x526665){var _0x19894d={};_0x19894d[_0x526665]={'$like':'%'+_0x1a7bcf['query']['filter']+'%'};return _0x19894d;})});}if(_0x1a7bcf[_0x1fd2('0x42')][_0x1fd2('0x9b')]){var _0x49d796=_0x1a7bcf[_0x1fd2('0x42')][_0x1fd2('0x9b')]['split'](',');var _0x43d933={};_0x43d933[_0x49d796[0x0]]={'$gte':moment(_0x49d796[0x1])['format'](_0x1fd2('0x9c'))};_0x31ab2a[_0x1fd2('0x4c')]=_['merge'](_0x31ab2a[_0x1fd2('0x4c')],_0x43d933);}_0x31ab2a=_[_0x1fd2('0x51')]({},_0x31ab2a,_0x1a7bcf[_0x1fd2('0x52')]);return db[_0x1fd2('0x9a')][_0x1fd2('0x53')]({'where':_0x31ab2a[_0x1fd2('0x4c')]})[_0x1fd2('0x25')](function(_0xbe9130){_0x56d543['count']=_0xbe9130;if(_0x1a7bcf[_0x1fd2('0x42')]['includeAll']){_0x31ab2a[_0x1fd2('0x6a')]=[{'all':!![]}];}return db[_0x1fd2('0x9a')]['findAll'](_0x31ab2a);})['then'](function(_0x524525){_0x56d543[_0x1fd2('0x55')]=_0x524525;return _0x56d543;});}})[_0x1fd2('0x25')](respondWithFilteredResult(_0x3872c9,_0x31ab2a))[_0x1fd2('0x2f')](handleError(_0x3872c9,null));};exports['send']=function(_0x2f2978,_0x5791ff,_0x1048ce){var _0x28ae8a,_0x787dfa={},_0x492d44;if(_0x2f2978[_0x1fd2('0x5a')]['to']){_0x492d44=_0x2f2978[_0x1fd2('0x5a')]['to'][0x0];}return db[_0x1fd2('0x3d')][_0x1fd2('0x5e')]({'where':{'id':_0x2f2978[_0x1fd2('0x56')]['id']},'include':[{'model':db['CmList'],'as':_0x1fd2('0x9d'),'include':[{'model':db['CmContact'],'as':_0x1fd2('0x9e'),'where':{'fax':_0x492d44},'limit':0x1,'order':[[_0x1fd2('0x97'),_0x1fd2('0x9f')]]}]}]})[_0x1fd2('0x25')](handleEntityNotFound(_0x5791ff,null))['then'](function(_0x1a474e){_0x28ae8a=_0x1a474e;if(_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')]&&_0x2f2978[_0x1fd2('0x5a')]['attachments']['length']){for(var _0x39cb35=0x0;_0x39cb35<_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')]['length'];_0x39cb35+=0x1){_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][_0x39cb35]={'filename':_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][_0x39cb35][_0x1fd2('0x4f')],'id':_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][_0x39cb35]['id'],'path':path[_0x1fd2('0xa1')](config[_0x1fd2('0xa2')],'server/files/attachments',_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][_0x39cb35][_0x1fd2('0xa3')])};}}return respondWithRpcPromise(_0x1fd2('0xa4'),_0x1fd2('0xa4'),{'FaxAccountId':_['isNil'](_0x2f2978[_0x1fd2('0x56')]['id'])?undefined:_0x2f2978[_0x1fd2('0x56')]['id'],'path':_[_0x1fd2('0xa5')](_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0][_0x1fd2('0x9')])?undefined:_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0][_0x1fd2('0x9')],'fax':_[_0x1fd2('0xa5')](_0x2f2978[_0x1fd2('0x5a')]['to'][0x0])?undefined:_0x2f2978[_0x1fd2('0x5a')]['to'][0x0]},client9002);})['then'](function(){if(_0x28ae8a){if(_[_0x1fd2('0xa5')](_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa6')])){_0x2f2978['body'][_0x1fd2('0xa6')]=util[_0x1fd2('0xa7')](_0x1fd2('0xa8'),_0x28ae8a['name'],_0x28ae8a[_0x1fd2('0xa9')]);}if(_0x28ae8a['List']){if(_0x28ae8a['List'][_0x1fd2('0x9e')][_0x1fd2('0x58')]){return _0x28ae8a['List'][_0x1fd2('0x9e')][0x0];}else{return db['CmContact'][_0x1fd2('0x59')](_[_0x1fd2('0x18')](_0x2f2978['body'],{'firstName':_0x2f2978['body']['to'][0x0],'phone':_0x2f2978[_0x1fd2('0x5a')]['to'][0x0],'fax':_0x2f2978[_0x1fd2('0x5a')]['to'][0x0],'ListId':_0x28ae8a[_0x1fd2('0x98')]}));}}else{throw new Error(_0x1fd2('0xaa'));}}else{throw new Error(_0x1fd2('0xab'));}})[_0x1fd2('0x25')](function(_0x2e0902){if(_0x2e0902){return db[_0x1fd2('0x6c')]['find']({'where':{'ContactId':_0x2e0902['id'],'closed':![],'FaxAccountId':_0x28ae8a['id']}})['then'](function(_0x18655e){if(_0x18655e){return[_0x18655e,![]];}return db[_0x1fd2('0x6c')][_0x1fd2('0x59')]({'UserId':_0x2f2978[_0x1fd2('0xac')]['id'],'ContactId':_0x2e0902['id'],'FaxAccountId':_0x28ae8a['id'],'fax':_0x2f2978[_0x1fd2('0x5a')]['to'][0x0],'firstMsgDirection':_0x1fd2('0xad'),'Messages':[_[_0x1fd2('0x51')](_0x2f2978[_0x1fd2('0x5a')],{'read':![],'body':_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0][_0x1fd2('0xae')],'FaxAccountId':_0x28ae8a['id'],'UserId':_0x2f2978[_0x1fd2('0xac')]['id'],'ContactId':_0x2e0902['id'],'AttachmentId':_0x2f2978['body'][_0x1fd2('0xa0')][0x0]['id']})]},{'include':[{'model':db[_0x1fd2('0x9a')],'as':_0x1fd2('0xaf')}]})['then'](function(_0x3b4de7){return[_0x3b4de7,!![]];});});}else{throw new Error(_0x1fd2('0xb0'));}})[_0x1fd2('0xb1')](function(_0x5a7ebf,_0x40fba5){if(_0x40fba5){return _0x5a7ebf;}return db['FaxMessage'][_0x1fd2('0x59')]({'direction':_0x1fd2('0xad'),'read':![],'body':_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0][_0x1fd2('0xae')],'FaxAccountId':_0x28ae8a['id'],'FaxInteractionId':_0x5a7ebf['id'],'UserId':_0x2f2978['user']['id'],'ContactId':_0x5a7ebf['ContactId'],'AttachmentId':_0x2f2978[_0x1fd2('0x5a')]['attachments'][0x0]['id']})['then'](function(_0x25a679){_0x5a7ebf[_0x1fd2('0xb2')][_0x1fd2('0xaf')]=[];_0x5a7ebf[_0x1fd2('0xb2')][_0x1fd2('0xaf')]['push'](_0x25a679['dataValues']);return _0x5a7ebf;});})[_0x1fd2('0x25')](function(_0x538020){respondWithRpcPromise(_0x1fd2('0xb3'),'SendFax',{'FaxAccountId':_[_0x1fd2('0xa5')](_0x2f2978['params']['id'])?undefined:_0x2f2978[_0x1fd2('0x56')]['id'],'path':_['isNil'](_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0][_0x1fd2('0x9')])?undefined:_0x2f2978['body'][_0x1fd2('0xa0')][0x0][_0x1fd2('0x9')],'fax':_[_0x1fd2('0xa5')](_0x2f2978[_0x1fd2('0x5a')]['to'][0x0])?undefined:_0x2f2978[_0x1fd2('0x5a')]['to'][0x0],'AttachmentId':_0x2f2978[_0x1fd2('0x5a')][_0x1fd2('0xa0')][0x0]['id']},client9002)['then'](function(_0x36b135){logger['info'](_0x1fd2('0xb4'),_0x36b135);})['catch'](function(_0x3b2a57){logger[_0x1fd2('0x2e')](_0x1fd2('0xb4'),_0x3b2a57);});return _0x538020;})['then'](respondWithResult(_0x5791ff,null))[_0x1fd2('0x2f')](handleError(_0x5791ff,null));};exports['addAgents']=function(_0x114e15,_0x720c75,_0x11c506){return db[_0x1fd2('0x3d')][_0x1fd2('0x5e')]({'where':{'id':_0x114e15[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x720c75,null))[_0x1fd2('0x25')](function(_0x2e3d2f){if(_0x2e3d2f){return _0x2e3d2f[_0x1fd2('0xb5')](_0x114e15['body'][_0x1fd2('0x68')],_[_0x1fd2('0x94')](_0x114e15['body'],[_0x1fd2('0x68'),'id'])||{})[_0x1fd2('0xb1')](function(_0xa985e2){for(var _0x438e66=0x0;_0x438e66<_0x114e15[_0x1fd2('0x5a')][_0x1fd2('0x68')]['length'];_0x438e66+=0x1){socket['emit']('userFaxAccount:save',{'UserId':_0x114e15[_0x1fd2('0x5a')][_0x1fd2('0x68')][_0x438e66],'FaxAccountId':_0x114e15[_0x1fd2('0x56')]['id']});}return _0xa985e2;});}})[_0x1fd2('0x25')](respondWithResult(_0x720c75,null))[_0x1fd2('0x2f')](handleError(_0x720c75,null));};exports[_0x1fd2('0xb6')]=function(_0x432d51,_0x1ae566,_0x179162){return db[_0x1fd2('0x3d')][_0x1fd2('0x5e')]({'where':{'id':_0x432d51[_0x1fd2('0x56')]['id']}})[_0x1fd2('0x25')](handleEntityNotFound(_0x1ae566,null))['then'](function(_0x2fdfce){if(_0x2fdfce){return _0x2fdfce['removeAgents'](_0x432d51[_0x1fd2('0x42')]['ids'])[_0x1fd2('0x25')](function(){if(_[_0x1fd2('0xb7')](_0x432d51[_0x1fd2('0x42')]['ids'])){for(var _0x477c76=0x0;_0x477c76<_0x432d51['query'][_0x1fd2('0x68')][_0x1fd2('0x58')];_0x477c76+=0x1){socket[_0x1fd2('0xb8')](_0x1fd2('0xb9'),{'UserId':Number(_0x432d51[_0x1fd2('0x42')]['ids'][_0x477c76]),'FaxAccountId':Number(_0x432d51[_0x1fd2('0x56')]['id'])});}}else{socket['emit'](_0x1fd2('0xb9'),{'UserId':Number(_0x432d51[_0x1fd2('0x42')]['ids']),'FaxAccountId':Number(_0x432d51[_0x1fd2('0x56')]['id'])});}});}})[_0x1fd2('0x25')](respondWithStatusCode(_0x1ae566,null))[_0x1fd2('0x2f')](handleError(_0x1ae566,null));};exports[_0x1fd2('0xba')]=function(_0x309b00,_0x1fb9b4,_0x12c6f7){var _0x1df262={};var _0x238e09={};var _0x579869;var _0xb6fd0d;return db[_0x1fd2('0x3d')][_0x1fd2('0x64')]({'where':{'id':_0x309b00[_0x1fd2('0x56')]['id']}})['then'](handleEntityNotFound(_0x1fb9b4,null))[_0x1fd2('0x25')](function(_0x4d3ad7){if(_0x4d3ad7){_0x579869=_0x4d3ad7;_0x238e09[_0x1fd2('0x44')]=_['keys'](db[_0x1fd2('0xbb')][_0x1fd2('0x3e')]);_0x238e09[_0x1fd2('0x42')]=_['keys'](_0x309b00[_0x1fd2('0x42')]);_0x238e09[_0x1fd2('0x4d')]=_['intersection'](_0x238e09[_0x1fd2('0x44')],_0x238e09[_0x1fd2('0x42')]);_0x1df262['attributes']=_[_0x1fd2('0x43')](_0x238e09['model'],qs[_0x1fd2('0x46')](_0x309b00['query'][_0x1fd2('0x46')]));_0x1df262['attributes']=_0x1df262[_0x1fd2('0x45')]['length']?_0x1df262['attributes']:_0x238e09['model'];_0x1df262[_0x1fd2('0x4a')]=qs[_0x1fd2('0x4b')](_0x309b00[_0x1fd2('0x42')][_0x1fd2('0x4b')]);_0x1df262[_0x1fd2('0x4c')]=qs[_0x1fd2('0x4d')](_[_0x1fd2('0x4e')](_0x309b00['query'],_0x238e09[_0x1fd2('0x4d')]));if(_0x309b00[_0x1fd2('0x42')][_0x1fd2('0x50')]){_0x1df262[_0x1fd2('0x4c')]=_[_0x1fd2('0x51')](_0x1df262[_0x1fd2('0x4c')],{'$or':_[_0x1fd2('0x3c')](_0x1df262[_0x1fd2('0x45')],function(_0x299bda){var _0x5e22e4={};_0x5e22e4[_0x299bda]={'$like':'%'+_0x309b00[_0x1fd2('0x42')][_0x1fd2('0x50')]+'%'};return _0x5e22e4;})});}_0x1df262=_[_0x1fd2('0x51')]({},_0x1df262,_0x309b00[_0x1fd2('0x52')]);return _0x579869['getAgents'](_0x1df262);}})[_0x1fd2('0x25')](function(_0x139b47){if(_0x139b47){_0xb6fd0d=_0x139b47['length'];if(!_0x309b00[_0x1fd2('0x42')][_0x1fd2('0x47')](_0x1fd2('0x48'))){_0x1df262['limit']=qs[_0x1fd2('0x49')](_0x309b00[_0x1fd2('0x42')]['limit']);_0x1df262[_0x1fd2('0x33')]=qs[_0x1fd2('0x33')](_0x309b00[_0x1fd2('0x42')][_0x1fd2('0x33')]);}return _0x579869[_0x1fd2('0xba')](_0x1df262);}})[_0x1fd2('0x25')](function(_0x31f579){if(_0x31f579){return _0x31f579?{'count':_0xb6fd0d,'rows':_0x31f579}:null;}})[_0x1fd2('0x25')](respondWithResult(_0x1fb9b4,null))['catch'](handleError(_0x1fb9b4,null));}; \ No newline at end of file +var _0x00d9=['status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','stack','name','index','Pause','mandatoryDispositionPause','map','FaxAccount','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','filters','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','rawAttributes','includeAll','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','FaxAccountId','Disposition','getDispositions','order','pick','ids','addAnswer','getAnswers','findOne','CannedAnswer','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','addApplications','sequelize','FaxApplication','bulkCreate','priority','getApplications','context','from-voip-provider','localstationid','app','system','description','Fax\x20Extension','push','Answer','CDR(type)=inbound-fax','Set','gateway','faxdetect','headerinfo','maxrate','minrate','modem','FAXOPT(','Wait','addAccountApplications','transaction','VoiceExtension','updateAccountApplications','createdAt','updatedAt','ListId','getMessages','$gte','split','format','FaxMessage','send','List','Contacts','attachments','join','root','basename','CheckAfterSend','isNil','\x22%s\x22\x20<%s>','fax','CmContact','defaults','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','FaxAccount,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','sendStatus'];(function(_0x5f0456,_0x9bedd5){var _0x2b6613=function(_0x9e881a){while(--_0x9e881a){_0x5f0456['push'](_0x5f0456['shift']());}};_0x2b6613(++_0x9bedd5);}(_0x00d9,0x154));var _0x900d=function(_0x580576,_0x2f107d){_0x580576=_0x580576-0x0;var _0x3f55a0=_0x00d9[_0x580576];return _0x3f55a0;};'use strict';var pdf=require(_0x900d('0x0'));var emlformat=require(_0x900d('0x1'));var rimraf=require(_0x900d('0x2'));var zipdir=require(_0x900d('0x3'));var jsonpatch=require(_0x900d('0x4'));var rp=require(_0x900d('0x5'));var moment=require('moment');var BPromise=require(_0x900d('0x6'));var Mustache=require(_0x900d('0x7'));var util=require(_0x900d('0x8'));var path=require(_0x900d('0x9'));var sox=require(_0x900d('0xa'));var csv=require(_0x900d('0xb'));var ejs=require(_0x900d('0xc'));var fs=require('fs');var _=require(_0x900d('0xd'));var squel=require(_0x900d('0xe'));var crypto=require(_0x900d('0xf'));var jsforce=require('jsforce');var deskjs=require(_0x900d('0x10'));var toCsv=require(_0x900d('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x900d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x900d('0x12'));var hardwareService=require(_0x900d('0x13'));var logger=require(_0x900d('0x14'))(_0x900d('0x15'));var utils=require('../../config/utils');var config=require(_0x900d('0x16'));var db=require(_0x900d('0x17'))['db'];config[_0x900d('0x18')]=_['defaults'](config[_0x900d('0x18')],{'host':_0x900d('0x19'),'port':0x18eb});var socket=require(_0x900d('0x1a'))(new Redis(config[_0x900d('0x18')]));require('./faxAccount.socket')['register'](socket);var jayson=require(_0x900d('0x1b'));var client=jayson[_0x900d('0x1c')]['http']({'port':0x232c});var client9002=jayson[_0x900d('0x1c')][_0x900d('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x144ecc,_0x5016b1,_0x3d1361){if(_0x3d1361){var _0x5bf99f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5bf99f[_0x900d('0x1e')](_0x5016b1)){return _0x144ecc;}else{throw new db[(_0x900d('0x1f'))]['ValidationError'](_0x900d('0x20'));}}else{return _0x144ecc;}}function respondWithRpcPromise(_0x185cd7,_0x32c832,_0x2be474,_0x444df8){return new BPromise(function(_0x1602c9,_0x492be3){var _0x1664f4=_0x444df8||client;return _0x1664f4['request'](_0x185cd7,_0x2be474)[_0x900d('0x21')](function(_0x3637d9){logger['info'](_0x900d('0x22'),_0x32c832,_0x900d('0x23'));logger['debug']('FaxAccount,\x20%s,\x20%s,\x20%s',_0x32c832,_0x900d('0x23'),JSON[_0x900d('0x24')](_0x3637d9));if(_0x3637d9[_0x900d('0x25')]){if(_0x3637d9[_0x900d('0x25')]['code']===0x1f4){logger[_0x900d('0x25')]('FaxAccount,\x20%s,\x20%s',_0x32c832,_0x3637d9[_0x900d('0x25')][_0x900d('0x26')]);return _0x492be3(_0x3637d9[_0x900d('0x25')][_0x900d('0x26')]);}logger[_0x900d('0x25')](_0x900d('0x22'),_0x32c832,_0x3637d9['error'][_0x900d('0x26')]);return _0x1602c9(_0x3637d9[_0x900d('0x25')][_0x900d('0x26')]);}else{logger[_0x900d('0x27')](_0x900d('0x22'),_0x32c832,_0x900d('0x23'));_0x1602c9(_0x3637d9[_0x900d('0x28')]['message']);}})['catch'](function(_0x2b1d07){logger[_0x900d('0x25')](_0x900d('0x22'),_0x32c832,_0x2b1d07);_0x492be3(_0x2b1d07);});});}function respondWithStatusCode(_0xe4b502,_0x1241c0){_0x1241c0=_0x1241c0||0xcc;return function(_0x144370){if(_0x144370){return _0xe4b502[_0x900d('0x29')](_0x1241c0);}return _0xe4b502[_0x900d('0x2a')](_0x1241c0)[_0x900d('0x2b')]();};}function respondWithResult(_0x32dba5,_0x4bc32c){_0x4bc32c=_0x4bc32c||0xc8;return function(_0x23bf14){if(_0x23bf14){return _0x32dba5[_0x900d('0x2a')](_0x4bc32c)[_0x900d('0x2c')](_0x23bf14);}};}function respondWithFilteredResult(_0x539743,_0x289adb){return function(_0x616f93){if(_0x616f93){var _0x18e1b6=_0x616f93[_0x900d('0x2d')],_0x8bcb90=_0x289adb[_0x900d('0x2e')],_0x769ee2=_0x289adb['offset']+_0x289adb[_0x900d('0x2f')],_0x1ccd2e;if(_0x769ee2>=_0x18e1b6){_0x769ee2=_0x18e1b6;_0x1ccd2e=0xc8;}else{_0x1ccd2e=0xce;}_0x539743[_0x900d('0x2a')](_0x1ccd2e);return _0x539743[_0x900d('0x30')](_0x900d('0x31'),_0x8bcb90+'-'+_0x769ee2+'/'+_0x18e1b6)[_0x900d('0x2c')](_0x616f93);}return null;};}function patchUpdates(_0x477114){return function(_0x5d760c){try{jsonpatch[_0x900d('0x32')](_0x5d760c,_0x477114,!![]);}catch(_0x5d3177){return BPromise[_0x900d('0x33')](_0x5d3177);}return _0x5d760c[_0x900d('0x34')]();};}function saveUpdates(_0x55208b,_0x135054){return function(_0x2f3b14){if(_0x2f3b14){return _0x2f3b14['update'](_0x55208b)['then'](function(_0x35b733){return _0x35b733;});}return null;};}function removeEntity(_0x33874d,_0x54cccb){return function(_0x4c9a7f){if(_0x4c9a7f){return _0x4c9a7f[_0x900d('0x35')]()[_0x900d('0x21')](function(){var _0x1a9ef4=_0x4c9a7f[_0x900d('0x36')]({'plain':!![]});var _0xf0ab6='FaxAccounts';return db['UserProfileResource'][_0x900d('0x35')]({'where':{'type':_0xf0ab6,'resourceId':_0x1a9ef4['id']}})[_0x900d('0x21')](function(){return _0x4c9a7f;});})[_0x900d('0x21')](function(){_0x33874d['status'](0xcc)[_0x900d('0x2b')]();});}};}function handleEntityNotFound(_0x4141a2,_0x66589c){return function(_0x526977){if(!_0x526977){_0x4141a2[_0x900d('0x29')](0x194);}return _0x526977;};}function handleError(_0xc6d9f6,_0x1326c4){_0x1326c4=_0x1326c4||0x1f4;return function(_0x1f6af1){logger[_0x900d('0x25')](_0x1f6af1[_0x900d('0x37')]);if(_0x1f6af1[_0x900d('0x38')]){delete _0x1f6af1['name'];}_0xc6d9f6['status'](_0x1326c4)['send'](_0x1f6af1);};}exports[_0x900d('0x39')]=function(_0x5df80d,_0x2ec3e9){var _0x38ac7a={'include':[{'model':db[_0x900d('0x3a')],'as':_0x900d('0x3b')}]},_0x2f4c9b={},_0x28183e={'count':0x0,'rows':[]};var _0x52dcd9=_[_0x900d('0x3c')](db[_0x900d('0x3d')]['rawAttributes'],function(_0xfec6fe){return{'name':_0xfec6fe[_0x900d('0x3e')],'type':_0xfec6fe[_0x900d('0x3f')][_0x900d('0x40')]};});_0x2f4c9b[_0x900d('0x41')]=_[_0x900d('0x3c')](_0x52dcd9,_0x900d('0x38'));_0x2f4c9b[_0x900d('0x42')]=_[_0x900d('0x43')](_0x5df80d[_0x900d('0x42')]);_0x2f4c9b['filters']=_['intersection'](_0x2f4c9b[_0x900d('0x41')],_0x2f4c9b[_0x900d('0x42')]);_0x38ac7a[_0x900d('0x44')]=_[_0x900d('0x45')](_0x2f4c9b[_0x900d('0x41')],qs[_0x900d('0x46')](_0x5df80d[_0x900d('0x42')][_0x900d('0x46')]));_0x38ac7a[_0x900d('0x44')]=_0x38ac7a[_0x900d('0x44')][_0x900d('0x47')]?_0x38ac7a[_0x900d('0x44')]:_0x2f4c9b[_0x900d('0x41')];if(!_0x5df80d[_0x900d('0x42')][_0x900d('0x48')](_0x900d('0x49'))){_0x38ac7a[_0x900d('0x2f')]=qs[_0x900d('0x2f')](_0x5df80d[_0x900d('0x42')]['limit']);_0x38ac7a[_0x900d('0x2e')]=qs[_0x900d('0x2e')](_0x5df80d[_0x900d('0x42')][_0x900d('0x2e')]);}_0x38ac7a['order']=qs[_0x900d('0x4a')](_0x5df80d[_0x900d('0x42')]['sort']);_0x38ac7a[_0x900d('0x4b')]=qs['filters'](_['pick'](_0x5df80d[_0x900d('0x42')],_0x2f4c9b[_0x900d('0x4c')]));if(_0x5df80d[_0x900d('0x42')]['filter']){_0x38ac7a[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x38ac7a[_0x900d('0x4b')],{'$or':_[_0x900d('0x3c')](_0x52dcd9,function(_0x156500){if(_0x156500[_0x900d('0x3f')]!==_0x900d('0x4e')){var _0x397ca3={};_0x397ca3[_0x156500['name']]={'$like':'%'+_0x5df80d[_0x900d('0x42')][_0x900d('0x4f')]+'%'};return _0x397ca3;}})});}_0x38ac7a=_[_0x900d('0x4d')]({},_0x38ac7a,_0x5df80d['options']);var _0x53c066={'where':_0x38ac7a[_0x900d('0x4b')]};return db['FaxAccount'][_0x900d('0x2d')](_0x53c066)[_0x900d('0x21')](function(_0xe5e625){_0x28183e['count']=_0xe5e625;if(_0x5df80d[_0x900d('0x42')]['includeAll']){_0x38ac7a[_0x900d('0x50')]=[{'all':!![]}];}return db[_0x900d('0x3d')][_0x900d('0x51')](_0x38ac7a);})[_0x900d('0x21')](function(_0x47fcd4){_0x28183e[_0x900d('0x52')]=_0x47fcd4;return _0x28183e;})[_0x900d('0x21')](respondWithFilteredResult(_0x2ec3e9,_0x38ac7a))[_0x900d('0x53')](handleError(_0x2ec3e9,null));};exports[_0x900d('0x54')]=function(_0x537f3e,_0x2d36e1){var _0x13abc9={'raw':![],'where':{'id':_0x537f3e[_0x900d('0x55')]['id']},'include':[{'model':db['Pause'],'as':_0x900d('0x3b')}]},_0xbfefe5={};_0xbfefe5['model']=_['keys'](db['FaxAccount'][_0x900d('0x56')]);_0xbfefe5['query']=_['keys'](_0x537f3e['query']);_0xbfefe5[_0x900d('0x4c')]=_[_0x900d('0x45')](_0xbfefe5['model'],_0xbfefe5[_0x900d('0x42')]);_0x13abc9['attributes']=_[_0x900d('0x45')](_0xbfefe5[_0x900d('0x41')],qs['fields'](_0x537f3e[_0x900d('0x42')][_0x900d('0x46')]));_0x13abc9[_0x900d('0x44')]=_0x13abc9[_0x900d('0x44')][_0x900d('0x47')]?_0x13abc9[_0x900d('0x44')]:_0xbfefe5[_0x900d('0x41')];if(_0x537f3e[_0x900d('0x42')][_0x900d('0x57')]){_0x13abc9[_0x900d('0x50')]=[{'all':!![]}];}_0x13abc9=_['merge']({},_0x13abc9,_0x537f3e[_0x900d('0x58')]);return db[_0x900d('0x3d')][_0x900d('0x59')](_0x13abc9)[_0x900d('0x21')](handleEntityNotFound(_0x2d36e1,null))['then'](respondWithResult(_0x2d36e1,null))[_0x900d('0x53')](handleError(_0x2d36e1,null));};exports[_0x900d('0x5a')]=function(_0xc0d361,_0x52407e){return db[_0x900d('0x3d')]['create'](_0xc0d361[_0x900d('0x5b')],{})['then'](function(_0x44deee){var _0x47ea09=_0xc0d361['user'][_0x900d('0x36')]({'plain':!![]});if(!_0x47ea09)throw new Error(_0x900d('0x5c'));if(_0x47ea09['role']===_0x900d('0x5d')){var _0x566c0f=_0x44deee[_0x900d('0x36')]({'plain':!![]});var _0x2f3e7c='FaxAccounts';return db[_0x900d('0x5e')][_0x900d('0x59')]({'where':{'name':_0x2f3e7c,'userProfileId':_0x47ea09[_0x900d('0x5f')]},'raw':!![]})[_0x900d('0x21')](function(_0x17f6fb){if(_0x17f6fb&&_0x17f6fb[_0x900d('0x60')]===0x0){return db[_0x900d('0x61')]['create']({'name':_0x566c0f[_0x900d('0x38')],'resourceId':_0x566c0f['id'],'type':_0x17f6fb['name'],'sectionId':_0x17f6fb['id']},{})[_0x900d('0x21')](function(){return _0x44deee;});}else{return _0x44deee;}})[_0x900d('0x53')](function(_0x281abf){logger[_0x900d('0x25')](_0x900d('0x62'),_0x281abf);throw _0x281abf;});}return _0x44deee;})['then'](respondWithResult(_0x52407e,0xc9))[_0x900d('0x53')](handleError(_0x52407e,null));};exports[_0x900d('0x63')]=function(_0x310cfd,_0x17e54a){if(_0x310cfd[_0x900d('0x5b')]['id']){delete _0x310cfd[_0x900d('0x5b')]['id'];}return db[_0x900d('0x3d')]['find']({'where':{'id':_0x310cfd[_0x900d('0x55')]['id']},'include':[{'model':db[_0x900d('0x3a')],'as':_0x900d('0x3b')}]})['then'](handleEntityNotFound(_0x17e54a,null))[_0x900d('0x21')](saveUpdates(_0x310cfd['body'],null))['then'](respondWithResult(_0x17e54a,null))[_0x900d('0x53')](handleError(_0x17e54a,null));};exports[_0x900d('0x35')]=function(_0x9d20c1,_0x52d91b){return db[_0x900d('0x3d')]['find']({'where':{'id':_0x9d20c1[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x52d91b,null))[_0x900d('0x21')](removeEntity(_0x52d91b,null))[_0x900d('0x53')](handleError(_0x52d91b,null));};exports[_0x900d('0x64')]=function(_0x3597fc,_0x4440a6){return db[_0x900d('0x3d')][_0x900d('0x64')]()[_0x900d('0x21')](respondWithResult(_0x4440a6,null))[_0x900d('0x53')](handleError(_0x4440a6,null));};exports[_0x900d('0x65')]=function(_0x1b4108,_0x1011f9,_0x8d6a67){if(_0x1b4108[_0x900d('0x5b')]['id']){delete _0x1b4108['body']['id'];}return db[_0x900d('0x3d')][_0x900d('0x59')]({'where':{'id':_0x1b4108[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x1011f9,null))[_0x900d('0x21')](function(_0x16fc19){if(_0x16fc19){_0x1b4108[_0x900d('0x5b')][_0x900d('0x66')]=_0x16fc19['id'];return db[_0x900d('0x67')][_0x900d('0x5a')](_0x1b4108[_0x900d('0x5b')]);}})['then'](respondWithResult(_0x1011f9,null))['catch'](handleError(_0x1011f9,null));};exports[_0x900d('0x68')]=function(_0x3a64aa,_0x346a74,_0x1427f5){var _0x5a1324={'raw':![],'where':{}};var _0x5bec7c={};var _0x84e7e={'count':0x0,'rows':[]};return db[_0x900d('0x3d')]['findOne']({'where':{'id':_0x3a64aa['params']['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x346a74,null))[_0x900d('0x21')](function(_0x348844){if(_0x348844){_0x5bec7c[_0x900d('0x41')]=_['keys'](db['Disposition']['rawAttributes']);_0x5bec7c[_0x900d('0x42')]=_[_0x900d('0x43')](_0x3a64aa[_0x900d('0x42')]);_0x5bec7c[_0x900d('0x4c')]=_['intersection'](_0x5bec7c['model'],_0x5bec7c[_0x900d('0x42')]);_0x5a1324[_0x900d('0x44')]=_[_0x900d('0x45')](_0x5bec7c['model'],qs['fields'](_0x3a64aa[_0x900d('0x42')]['fields']));_0x5a1324['attributes']=_0x5a1324[_0x900d('0x44')][_0x900d('0x47')]?_0x5a1324[_0x900d('0x44')]:_0x5bec7c['model'];if(!_0x3a64aa[_0x900d('0x42')][_0x900d('0x48')]('nolimit')){_0x5a1324[_0x900d('0x2f')]=qs[_0x900d('0x2f')](_0x3a64aa[_0x900d('0x42')][_0x900d('0x2f')]);_0x5a1324[_0x900d('0x2e')]=qs['offset'](_0x3a64aa[_0x900d('0x42')][_0x900d('0x2e')]);}_0x5a1324[_0x900d('0x69')]=qs[_0x900d('0x4a')](_0x3a64aa['query'][_0x900d('0x4a')]);_0x5a1324[_0x900d('0x4b')]=qs[_0x900d('0x4c')](_[_0x900d('0x6a')](_0x3a64aa[_0x900d('0x42')],_0x5bec7c[_0x900d('0x4c')]));_0x5a1324['where'][_0x900d('0x66')]=_0x348844['id'];if(_0x3a64aa[_0x900d('0x42')]['filter']){_0x5a1324[_0x900d('0x4b')]=_['merge'](_0x5a1324['where'],{'$or':_[_0x900d('0x3c')](_0x5a1324[_0x900d('0x44')],function(_0x1fd766){var _0x19aa7a={};_0x19aa7a[_0x1fd766]={'$like':'%'+_0x3a64aa['query'][_0x900d('0x4f')]+'%'};return _0x19aa7a;})});}_0x5a1324=_[_0x900d('0x4d')]({},_0x5a1324,_0x3a64aa[_0x900d('0x58')]);return db[_0x900d('0x67')][_0x900d('0x2d')]({'where':_0x5a1324[_0x900d('0x4b')]})[_0x900d('0x21')](function(_0x3ed88c){_0x84e7e['count']=_0x3ed88c;if(_0x3a64aa[_0x900d('0x42')][_0x900d('0x57')]){_0x5a1324['include']=[{'all':!![]}];}return db[_0x900d('0x67')][_0x900d('0x51')](_0x5a1324);})[_0x900d('0x21')](function(_0x4c40c9){_0x84e7e[_0x900d('0x52')]=_0x4c40c9;return _0x84e7e;});}})[_0x900d('0x21')](respondWithFilteredResult(_0x346a74,_0x5a1324))['catch'](handleError(_0x346a74,null));};exports['removeDispositions']=function(_0x44d8f4,_0x4acfc7,_0x37021a){return db['FaxAccount'][_0x900d('0x59')]({'where':{'id':_0x44d8f4['params']['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x4acfc7,null))[_0x900d('0x21')](function(_0x352b2a){if(_0x352b2a){return _0x352b2a['removeDispositions'](_0x44d8f4[_0x900d('0x42')][_0x900d('0x6b')]);}})['then'](respondWithStatusCode(_0x4acfc7,null))[_0x900d('0x53')](handleError(_0x4acfc7,null));};exports[_0x900d('0x6c')]=function(_0x40fcff,_0x598113,_0x59d6e4){if(_0x40fcff[_0x900d('0x5b')]['id']){delete _0x40fcff[_0x900d('0x5b')]['id'];}return db[_0x900d('0x3d')]['find']({'where':{'id':_0x40fcff[_0x900d('0x55')]['id']}})['then'](handleEntityNotFound(_0x598113,null))[_0x900d('0x21')](function(_0x17cefa){if(_0x17cefa){_0x40fcff[_0x900d('0x5b')]['FaxAccountId']=_0x17cefa['id'];return db['CannedAnswer'][_0x900d('0x5a')](_0x40fcff[_0x900d('0x5b')]);}})[_0x900d('0x21')](respondWithResult(_0x598113,null))[_0x900d('0x53')](handleError(_0x598113,null));};exports[_0x900d('0x6d')]=function(_0x2e431d,_0xb4a3cd,_0x4feaa9){var _0x147d62={'raw':![],'where':{}};var _0x45ea09={};var _0x16fc49={'count':0x0,'rows':[]};return db[_0x900d('0x3d')][_0x900d('0x6e')]({'where':{'id':_0x2e431d[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0xb4a3cd,null))[_0x900d('0x21')](function(_0x2c1bdf){if(_0x2c1bdf){_0x45ea09[_0x900d('0x41')]=_[_0x900d('0x43')](db[_0x900d('0x6f')]['rawAttributes']);_0x45ea09['query']=_[_0x900d('0x43')](_0x2e431d[_0x900d('0x42')]);_0x45ea09[_0x900d('0x4c')]=_[_0x900d('0x45')](_0x45ea09[_0x900d('0x41')],_0x45ea09[_0x900d('0x42')]);_0x147d62[_0x900d('0x44')]=_[_0x900d('0x45')](_0x45ea09[_0x900d('0x41')],qs[_0x900d('0x46')](_0x2e431d[_0x900d('0x42')][_0x900d('0x46')]));_0x147d62[_0x900d('0x44')]=_0x147d62[_0x900d('0x44')][_0x900d('0x47')]?_0x147d62[_0x900d('0x44')]:_0x45ea09[_0x900d('0x41')];if(!_0x2e431d[_0x900d('0x42')]['hasOwnProperty']('nolimit')){_0x147d62['limit']=qs[_0x900d('0x2f')](_0x2e431d[_0x900d('0x42')][_0x900d('0x2f')]);_0x147d62['offset']=qs[_0x900d('0x2e')](_0x2e431d['query']['offset']);}_0x147d62[_0x900d('0x69')]=qs[_0x900d('0x4a')](_0x2e431d[_0x900d('0x42')][_0x900d('0x4a')]);_0x147d62[_0x900d('0x4b')]=qs[_0x900d('0x4c')](_[_0x900d('0x6a')](_0x2e431d[_0x900d('0x42')],_0x45ea09[_0x900d('0x4c')]));_0x147d62[_0x900d('0x4b')][_0x900d('0x66')]=_0x2c1bdf['id'];if(_0x2e431d[_0x900d('0x42')]['filter']){_0x147d62[_0x900d('0x4b')]=_['merge'](_0x147d62['where'],{'$or':_[_0x900d('0x3c')](_0x147d62[_0x900d('0x44')],function(_0x2abaa6){var _0x420569={};_0x420569[_0x2abaa6]={'$like':'%'+_0x2e431d[_0x900d('0x42')][_0x900d('0x4f')]+'%'};return _0x420569;})});}_0x147d62=_[_0x900d('0x4d')]({},_0x147d62,_0x2e431d['options']);return db[_0x900d('0x6f')][_0x900d('0x2d')]({'where':_0x147d62[_0x900d('0x4b')]})['then'](function(_0x2f1c04){_0x16fc49[_0x900d('0x2d')]=_0x2f1c04;if(_0x2e431d[_0x900d('0x42')][_0x900d('0x57')]){_0x147d62[_0x900d('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x900d('0x51')](_0x147d62);})['then'](function(_0x157744){_0x16fc49[_0x900d('0x52')]=_0x157744;return _0x16fc49;});}})['then'](respondWithFilteredResult(_0xb4a3cd,_0x147d62))['catch'](handleError(_0xb4a3cd,null));};exports[_0x900d('0x70')]=function(_0xdbf115,_0x4d6d35,_0x596a6c){return db[_0x900d('0x3d')][_0x900d('0x59')]({'where':{'id':_0xdbf115['params']['id']}})['then'](handleEntityNotFound(_0x4d6d35,null))[_0x900d('0x21')](function(_0x1feeb6){if(_0x1feeb6){return _0x1feeb6['removeAnswers'](_0xdbf115[_0x900d('0x42')][_0x900d('0x6b')]);}})['then'](respondWithStatusCode(_0x4d6d35,null))[_0x900d('0x53')](handleError(_0x4d6d35,null));};exports[_0x900d('0x71')]=function(_0x57358f,_0x932b7e,_0x485676){return db['FaxInteraction'][_0x900d('0x59')]({'where':{'id':_0x57358f[_0x900d('0x55')]['id']}})['then'](handleEntityNotFound(_0x932b7e,null))['then'](function(_0xa92f00){if(_0xa92f00){return _0xa92f00[_0x900d('0x71')](_0x57358f['body'][_0x900d('0x6b')],_[_0x900d('0x72')](_0x57358f['body'],[_0x900d('0x6b'),'id'])||{});}})['then'](respondWithResult(_0x932b7e,null))['catch'](handleError(_0x932b7e,null));};exports[_0x900d('0x73')]=function(_0x229cb4,_0x583705,_0x5c15fe){var _0x564727={'raw':![],'where':{}};var _0xd820a5={};var _0x95a072={'count':0x0,'rows':[]};return db[_0x900d('0x3d')][_0x900d('0x6e')]({'where':{'id':_0x229cb4[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x583705,null))[_0x900d('0x21')](function(_0xc0e36c){if(_0xc0e36c){_0xd820a5['model']=_[_0x900d('0x43')](db[_0x900d('0x74')][_0x900d('0x56')]);_0xd820a5[_0x900d('0x42')]=_[_0x900d('0x43')](_0x229cb4[_0x900d('0x42')]);_0xd820a5[_0x900d('0x4c')]=_[_0x900d('0x45')](_0xd820a5[_0x900d('0x41')],_0xd820a5[_0x900d('0x42')]);_0x564727['attributes']=_[_0x900d('0x45')](_0xd820a5[_0x900d('0x41')],qs[_0x900d('0x46')](_0x229cb4[_0x900d('0x42')][_0x900d('0x46')]));_0x564727[_0x900d('0x44')]=_0x564727[_0x900d('0x44')][_0x900d('0x47')]?_0x564727['attributes']:_0xd820a5[_0x900d('0x41')];if(!_0x229cb4[_0x900d('0x42')]['hasOwnProperty'](_0x900d('0x49'))){_0x564727['limit']=qs[_0x900d('0x2f')](_0x229cb4['query'][_0x900d('0x2f')]);_0x564727['offset']=qs[_0x900d('0x2e')](_0x229cb4['query'][_0x900d('0x2e')]);}_0x564727[_0x900d('0x69')]=qs['sort'](_0x229cb4[_0x900d('0x42')][_0x900d('0x4a')]);_0x564727[_0x900d('0x4b')]=qs['filters'](_[_0x900d('0x6a')](_0x229cb4[_0x900d('0x42')],_0xd820a5[_0x900d('0x4c')]));_0x564727[_0x900d('0x4b')][_0x900d('0x66')]=_0xc0e36c['id'];if(_0x229cb4['query'][_0x900d('0x4f')]){_0x564727[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x564727[_0x900d('0x4b')],{'$or':_[_0x900d('0x3c')](_0x564727[_0x900d('0x44')],function(_0x31c52a){var _0x40d592={};_0x40d592[_0x31c52a]={'$like':'%'+_0x229cb4[_0x900d('0x42')][_0x900d('0x4f')]+'%'};return _0x40d592;})});}_0x564727=_[_0x900d('0x4d')]({},_0x564727,_0x229cb4[_0x900d('0x58')]);return db['FaxInteraction'][_0x900d('0x2d')]({'where':_0x564727[_0x900d('0x4b')]})[_0x900d('0x21')](function(_0x4b490b){_0x95a072[_0x900d('0x2d')]=_0x4b490b;if(_0x229cb4[_0x900d('0x42')][_0x900d('0x57')]){_0x564727['include']=[{'model':db['CmContact'],'as':_0x900d('0x75'),'required':![]},{'model':db[_0x900d('0x76')],'as':_0x900d('0x77'),'attributes':['name',_0x900d('0x78'),_0x900d('0x79')],'required':![]},{'model':db[_0x900d('0x7a')],'as':_0x900d('0x7b'),'attributes':['id',_0x900d('0x38'),_0x900d('0x7c')],'where':_0x229cb4[_0x900d('0x42')][_0x900d('0x7d')]?{'id':_0x229cb4[_0x900d('0x42')][_0x900d('0x7d')]}:undefined,'required':_0x229cb4[_0x900d('0x42')][_0x900d('0x7d')]?!![]:![]}];}return db[_0x900d('0x74')][_0x900d('0x51')](_0x564727);})['then'](function(_0x9b59d1){_0x95a072[_0x900d('0x52')]=_0x9b59d1;return _0x95a072;});}})['then'](respondWithFilteredResult(_0x583705,_0x564727))[_0x900d('0x53')](handleError(_0x583705,null));};exports[_0x900d('0x7e')]=function(_0x1c37a5,_0x388d25,_0x20cfe3){return db[_0x900d('0x3d')][_0x900d('0x6e')]({'where':{'id':_0x1c37a5[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x388d25,null))['then'](function(_0x5aeff2){if(_0x5aeff2){return db[_0x900d('0x7f')]['transaction'](function(_0x328067){return db[_0x900d('0x80')][_0x900d('0x35')]({'where':{'FaxAccountId':_0x1c37a5[_0x900d('0x55')]['id']},'transaction':_0x328067})[_0x900d('0x21')](function(_0x1c5b82){var _0x569364=_[_0x900d('0x3c')](_0x1c37a5['body'],function(_0x48652f){_0x48652f[_0x900d('0x66')]=_0x1c37a5[_0x900d('0x55')]['id'];return _0x48652f;});return db['FaxApplication'][_0x900d('0x81')](_0x569364,{'transaction':_0x328067});});})[_0x900d('0x21')](function(){return db[_0x900d('0x80')]['findAndCountAll']({'where':{'FaxAccountId':_0x1c37a5[_0x900d('0x55')]['id']},'order':_0x900d('0x82')});});}})[_0x900d('0x21')](respondWithResult(_0x388d25,null))[_0x900d('0x53')](handleError(_0x388d25,null));};exports[_0x900d('0x83')]=function(_0x195d96,_0x17c158,_0x49e007){var _0x2d4d25={};var _0x3e8636={};var _0xcfbe9f;var _0xc965ad;return db['FaxAccount']['findOne']({'where':{'id':_0x195d96[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x17c158,null))['then'](function(_0x5b57bd){if(_0x5b57bd){_0xcfbe9f=_0x5b57bd;_0x3e8636[_0x900d('0x41')]=_['keys'](db['FaxApplication'][_0x900d('0x56')]);_0x3e8636[_0x900d('0x42')]=_['keys'](_0x195d96['query']);_0x3e8636[_0x900d('0x4c')]=_[_0x900d('0x45')](_0x3e8636[_0x900d('0x41')],_0x3e8636[_0x900d('0x42')]);_0x2d4d25[_0x900d('0x44')]=_[_0x900d('0x45')](_0x3e8636['model'],qs[_0x900d('0x46')](_0x195d96['query'][_0x900d('0x46')]));_0x2d4d25[_0x900d('0x44')]=_0x2d4d25[_0x900d('0x44')]['length']?_0x2d4d25[_0x900d('0x44')]:_0x3e8636[_0x900d('0x41')];_0x2d4d25['order']=qs[_0x900d('0x4a')](_0x195d96[_0x900d('0x42')][_0x900d('0x4a')]);_0x2d4d25[_0x900d('0x4b')]=qs[_0x900d('0x4c')](_[_0x900d('0x6a')](_0x195d96['query'],_0x3e8636[_0x900d('0x4c')]));if(_0x195d96[_0x900d('0x42')][_0x900d('0x4f')]){_0x2d4d25[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x2d4d25[_0x900d('0x4b')],{'$or':_[_0x900d('0x3c')](_0x2d4d25[_0x900d('0x44')],function(_0x4c6a53){var _0x35f3b2={};_0x35f3b2[_0x4c6a53]={'$like':'%'+_0x195d96['query'][_0x900d('0x4f')]+'%'};return _0x35f3b2;})});}_0x2d4d25=_[_0x900d('0x4d')]({},_0x2d4d25,_0x195d96[_0x900d('0x58')]);return _0xcfbe9f[_0x900d('0x83')](_0x2d4d25);}})[_0x900d('0x21')](function(_0x209f60){if(_0x209f60){_0xc965ad=_0x209f60[_0x900d('0x47')];if(!_0x195d96[_0x900d('0x42')][_0x900d('0x48')](_0x900d('0x49'))){_0x2d4d25[_0x900d('0x2f')]=qs[_0x900d('0x2f')](_0x195d96[_0x900d('0x42')]['limit']);_0x2d4d25['offset']=qs[_0x900d('0x2e')](_0x195d96[_0x900d('0x42')][_0x900d('0x2e')]);}return _0xcfbe9f[_0x900d('0x83')](_0x2d4d25);}})['then'](function(_0x43932f){if(_0x43932f){return _0x43932f?{'count':_0xc965ad,'rows':_0x43932f}:null;}})['then'](respondWithResult(_0x17c158,null))['catch'](handleError(_0x17c158,null));};function Extension(_0x156e1b,_0x4ccddc,_0x575679,_0x3e786a){this[_0x900d('0x84')]=_0x900d('0x85');this['exten']=_0x156e1b[_0x900d('0x86')];this[_0x900d('0x87')]=_0x3e786a;this['type']=_0x900d('0x88');this[_0x900d('0x89')]=_0x900d('0x8a');this[_0x900d('0x66')]=_0x156e1b['id'];this['priority']=_0x4ccddc;this['appdata']=_0x575679;}function createExtensionsReciveFax(_0x1b9144){var _0x328c45=0x1;var _0x537574=[];_0x537574[_0x900d('0x8b')](new Extension(_0x1b9144,_0x328c45,'',_0x900d('0x8c')));_0x328c45+=0x1;_0x537574[_0x900d('0x8b')](new Extension(_0x1b9144,_0x328c45,_0x900d('0x8d'),_0x900d('0x8e')));_0x328c45+=0x1;for(var _0x5c1073 in _0x1b9144){if(_0x1b9144[_0x900d('0x48')](_0x5c1073)&&(_0x5c1073==='ecm'||_0x5c1073==='localstationid'||_0x5c1073===_0x900d('0x8f')||_0x5c1073===_0x900d('0x90')||_0x5c1073===_0x900d('0x91')||_0x5c1073===_0x900d('0x92')||_0x5c1073===_0x900d('0x93')||_0x5c1073===_0x900d('0x94')||_0x5c1073==='t38timeout')){_0x537574[_0x900d('0x8b')](new Extension(_0x1b9144,_0x328c45,_0x900d('0x95')+_0x5c1073+')='+_0x1b9144[_0x5c1073],_0x900d('0x8e')));_0x328c45+=0x1;}}_0x537574['push'](new Extension(_0x1b9144,_0x328c45,'6',_0x900d('0x96')));_0x328c45+=0x1;_0x537574[_0x900d('0x8b')](new Extension(_0x1b9144,_0x328c45,'/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'));_0x328c45=0x0;return _0x537574;}exports[_0x900d('0x97')]=function(_0xc5abee,_0x248abe,_0x2ed8fa){var _0x4b2faf;return db['sequelize'][_0x900d('0x98')](function(_0x5401a6){return db['FaxAccount']['create'](_0xc5abee[_0x900d('0x5b')],{'transaction':_0x5401a6})[_0x900d('0x21')](function(_0x96dfcc){_0x4b2faf=_0x96dfcc[_0x900d('0x36')]({'plain':!![]});return db[_0x900d('0x99')][_0x900d('0x81')](createExtensionsReciveFax(_0x4b2faf),{'transaction':_0x5401a6});});})[_0x900d('0x21')](function(){return _0x4b2faf;})[_0x900d('0x21')](respondWithResult(_0x248abe,null))[_0x900d('0x53')](handleError(_0x248abe,null));};exports[_0x900d('0x9a')]=function(_0x45ac8f,_0x319d39,_0x5895f4){var _0x56b548;return db[_0x900d('0x7f')][_0x900d('0x98')](function(_0x5a921e){return db[_0x900d('0x3d')][_0x900d('0x63')](_0x45ac8f[_0x900d('0x5b')],{'where':{'id':_0x45ac8f[_0x900d('0x5b')]['id']},'transaction':_0x5a921e})[_0x900d('0x21')](function(_0x575286){return db[_0x900d('0x99')][_0x900d('0x35')]({'where':{'FaxAccountId':_0x45ac8f[_0x900d('0x5b')]['id']},'transaction':_0x5a921e})[_0x900d('0x21')](function(_0xe5b09c){return db[_0x900d('0x99')][_0x900d('0x81')](createExtensionsReciveFax(_[_0x900d('0x72')](_0x45ac8f['body'],['tech','key',_0x900d('0x9b'),_0x900d('0x9c'),'TrunkId',_0x900d('0x9d')])),{'transaction':_0x5a921e});});});})['then'](function(){return db[_0x900d('0x3d')]['findById'](_0x45ac8f[_0x900d('0x5b')]['id']);})[_0x900d('0x21')](respondWithResult(_0x319d39,null))['catch'](handleError(_0x319d39,null));};exports[_0x900d('0x9e')]=function(_0x23f83a,_0x314d7d,_0x26db44){var _0x363734={'raw':!![],'where':{}};var _0x28a9a5={};var _0x36d48e={'count':0x0,'rows':[]};return db['FaxAccount'][_0x900d('0x6e')]({'where':{'id':_0x23f83a[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x314d7d,null))[_0x900d('0x21')](function(_0x4d949b){if(_0x4d949b){_0x28a9a5[_0x900d('0x41')]=_[_0x900d('0x43')](db['FaxMessage'][_0x900d('0x56')]);_0x28a9a5[_0x900d('0x42')]=_[_0x900d('0x43')](_0x23f83a[_0x900d('0x42')]);_0x28a9a5[_0x900d('0x4c')]=_[_0x900d('0x45')](_0x28a9a5['model'],_0x28a9a5[_0x900d('0x42')]);_0x363734[_0x900d('0x44')]=_[_0x900d('0x45')](_0x28a9a5[_0x900d('0x41')],qs['fields'](_0x23f83a[_0x900d('0x42')][_0x900d('0x46')]));_0x363734['attributes']=_0x363734[_0x900d('0x44')][_0x900d('0x47')]?_0x363734['attributes']:_0x28a9a5[_0x900d('0x41')];if(!_0x23f83a[_0x900d('0x42')]['hasOwnProperty'](_0x900d('0x49'))){_0x363734[_0x900d('0x2f')]=qs[_0x900d('0x2f')](_0x23f83a[_0x900d('0x42')][_0x900d('0x2f')]);_0x363734[_0x900d('0x2e')]=qs[_0x900d('0x2e')](_0x23f83a[_0x900d('0x42')][_0x900d('0x2e')]);}_0x363734['order']=qs[_0x900d('0x4a')](_0x23f83a[_0x900d('0x42')][_0x900d('0x4a')]);_0x363734[_0x900d('0x4b')]=qs[_0x900d('0x4c')](_[_0x900d('0x6a')](_0x23f83a[_0x900d('0x42')],_0x28a9a5[_0x900d('0x4c')]));_0x363734[_0x900d('0x4b')][_0x900d('0x66')]=_0x4d949b['id'];if(_0x23f83a[_0x900d('0x42')][_0x900d('0x4f')]){_0x363734[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x363734[_0x900d('0x4b')],{'$or':_['map'](_0x363734['attributes'],function(_0x5efe24){var _0x5b6810={};_0x5b6810[_0x5efe24]={'$like':'%'+_0x23f83a[_0x900d('0x42')][_0x900d('0x4f')]+'%'};return _0x5b6810;})});}if(_0x23f83a[_0x900d('0x42')][_0x900d('0x9f')]){var _0x2cfab3=_0x23f83a[_0x900d('0x42')][_0x900d('0x9f')][_0x900d('0xa0')](',');var _0x5b2f81={};_0x5b2f81[_0x2cfab3[0x0]]={'$gte':moment(_0x2cfab3[0x1])[_0x900d('0xa1')]('YYYY-MM-DD\x20HH:mm:ss')};_0x363734[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x363734[_0x900d('0x4b')],_0x5b2f81);}_0x363734=_[_0x900d('0x4d')]({},_0x363734,_0x23f83a[_0x900d('0x58')]);return db['FaxMessage']['count']({'where':_0x363734[_0x900d('0x4b')]})['then'](function(_0xd4ffc3){_0x36d48e[_0x900d('0x2d')]=_0xd4ffc3;if(_0x23f83a[_0x900d('0x42')][_0x900d('0x57')]){_0x363734['include']=[{'all':!![]}];}return db[_0x900d('0xa2')]['findAll'](_0x363734);})['then'](function(_0x17fc7c){_0x36d48e[_0x900d('0x52')]=_0x17fc7c;return _0x36d48e;});}})['then'](respondWithFilteredResult(_0x314d7d,_0x363734))[_0x900d('0x53')](handleError(_0x314d7d,null));};exports[_0x900d('0xa3')]=function(_0x4423cb,_0x10340e,_0x4eafdd){var _0x4ad289,_0x520a6d={},_0xedc38;if(_0x4423cb[_0x900d('0x5b')]['to']){_0xedc38=_0x4423cb['body']['to'][0x0];}return db[_0x900d('0x3d')][_0x900d('0x59')]({'where':{'id':_0x4423cb[_0x900d('0x55')]['id']},'include':[{'model':db['CmList'],'as':_0x900d('0xa4'),'include':[{'model':db['CmContact'],'as':_0x900d('0xa5'),'where':{'fax':_0xedc38},'limit':0x1,'order':[[_0x900d('0x9c'),'DESC']]}]}]})[_0x900d('0x21')](handleEntityNotFound(_0x10340e,null))[_0x900d('0x21')](function(_0x5a9826){_0x4ad289=_0x5a9826;if(_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')]&&_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][_0x900d('0x47')]){for(var _0x37e662=0x0;_0x37e662<_0x4423cb['body'][_0x900d('0xa6')][_0x900d('0x47')];_0x37e662+=0x1){_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][_0x37e662]={'filename':_0x4423cb['body']['attachments'][_0x37e662][_0x900d('0x38')],'id':_0x4423cb[_0x900d('0x5b')]['attachments'][_0x37e662]['id'],'path':path[_0x900d('0xa7')](config[_0x900d('0xa8')],'server/files/attachments',_0x4423cb['body'][_0x900d('0xa6')][_0x37e662][_0x900d('0xa9')])};}}return respondWithRpcPromise(_0x900d('0xaa'),'CheckAfterSend',{'FaxAccountId':_[_0x900d('0xab')](_0x4423cb['params']['id'])?undefined:_0x4423cb[_0x900d('0x55')]['id'],'path':_[_0x900d('0xab')](_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][0x0][_0x900d('0x9')])?undefined:_0x4423cb['body'][_0x900d('0xa6')][0x0][_0x900d('0x9')],'fax':_['isNil'](_0x4423cb[_0x900d('0x5b')]['to'][0x0])?undefined:_0x4423cb[_0x900d('0x5b')]['to'][0x0]},client9002);})[_0x900d('0x21')](function(){if(_0x4ad289){if(_[_0x900d('0xab')](_0x4423cb['body']['from'])){_0x4423cb['body']['from']=util[_0x900d('0xa1')](_0x900d('0xac'),_0x4ad289[_0x900d('0x38')],_0x4ad289[_0x900d('0xad')]);}if(_0x4ad289[_0x900d('0xa4')]){if(_0x4ad289['List'][_0x900d('0xa5')][_0x900d('0x47')]){return _0x4ad289['List'][_0x900d('0xa5')][0x0];}else{return db[_0x900d('0xae')][_0x900d('0x5a')](_[_0x900d('0xaf')](_0x4423cb[_0x900d('0x5b')],{'firstName':_0x4423cb[_0x900d('0x5b')]['to'][0x0],'phone':_0x4423cb[_0x900d('0x5b')]['to'][0x0],'fax':_0x4423cb[_0x900d('0x5b')]['to'][0x0],'ListId':_0x4ad289['ListId']}));}}else{throw new Error('List\x20not\x20found');}}else{throw new Error(_0x900d('0xb0'));}})[_0x900d('0x21')](function(_0x44eff0){if(_0x44eff0){return db[_0x900d('0x74')]['find']({'where':{'ContactId':_0x44eff0['id'],'closed':![],'FaxAccountId':_0x4ad289['id']}})[_0x900d('0x21')](function(_0x2446e5){if(_0x2446e5){return[_0x2446e5,![]];}return db['FaxInteraction'][_0x900d('0x5a')]({'UserId':_0x4423cb['user']['id'],'ContactId':_0x44eff0['id'],'FaxAccountId':_0x4ad289['id'],'fax':_0x4423cb[_0x900d('0x5b')]['to'][0x0],'firstMsgDirection':'out','Messages':[_[_0x900d('0x4d')](_0x4423cb[_0x900d('0x5b')],{'read':![],'body':_0x4423cb[_0x900d('0x5b')]['attachments'][0x0][_0x900d('0xb1')],'FaxAccountId':_0x4ad289['id'],'UserId':_0x4423cb[_0x900d('0x5d')]['id'],'ContactId':_0x44eff0['id'],'AttachmentId':_0x4423cb[_0x900d('0x5b')]['attachments'][0x0]['id']})]},{'include':[{'model':db[_0x900d('0xa2')],'as':_0x900d('0xb2')}]})[_0x900d('0x21')](function(_0x133147){return[_0x133147,!![]];});});}else{throw new Error(_0x900d('0xb3'));}})[_0x900d('0xb4')](function(_0x977b64,_0x538afa){if(_0x538afa){return _0x977b64;}return db[_0x900d('0xa2')][_0x900d('0x5a')]({'direction':_0x900d('0xb5'),'read':![],'body':_0x4423cb['body']['attachments'][0x0][_0x900d('0xb1')],'FaxAccountId':_0x4ad289['id'],'FaxInteractionId':_0x977b64['id'],'UserId':_0x4423cb['user']['id'],'ContactId':_0x977b64[_0x900d('0xb6')],'AttachmentId':_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][0x0]['id']})[_0x900d('0x21')](function(_0x37b6e5){_0x977b64[_0x900d('0xb7')][_0x900d('0xb2')]=[];_0x977b64[_0x900d('0xb7')][_0x900d('0xb2')]['push'](_0x37b6e5[_0x900d('0xb7')]);return _0x977b64;});})[_0x900d('0x21')](function(_0x396afc){respondWithRpcPromise(_0x900d('0xb8'),_0x900d('0xb8'),{'FaxAccountId':_[_0x900d('0xab')](_0x4423cb['params']['id'])?undefined:_0x4423cb[_0x900d('0x55')]['id'],'path':_[_0x900d('0xab')](_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][0x0]['path'])?undefined:_0x4423cb['body'][_0x900d('0xa6')][0x0]['path'],'fax':_[_0x900d('0xab')](_0x4423cb[_0x900d('0x5b')]['to'][0x0])?undefined:_0x4423cb[_0x900d('0x5b')]['to'][0x0],'AttachmentId':_0x4423cb[_0x900d('0x5b')][_0x900d('0xa6')][0x0]['id']},client9002)[_0x900d('0x21')](function(_0x21985d){logger[_0x900d('0x27')](_0x900d('0xb9'),_0x21985d);})[_0x900d('0x53')](function(_0x1d529e){logger['info'](_0x900d('0xb9'),_0x1d529e);});return _0x396afc;})[_0x900d('0x21')](respondWithResult(_0x10340e,null))[_0x900d('0x53')](handleError(_0x10340e,null));};exports[_0x900d('0xba')]=function(_0x1902cb,_0x147a57,_0x5d1e25){return db[_0x900d('0x3d')][_0x900d('0x59')]({'where':{'id':_0x1902cb[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x147a57,null))[_0x900d('0x21')](function(_0x640d1f){if(_0x640d1f){return _0x640d1f['addAgents'](_0x1902cb[_0x900d('0x5b')]['ids'],_['omit'](_0x1902cb[_0x900d('0x5b')],[_0x900d('0x6b'),'id'])||{})[_0x900d('0xb4')](function(_0x4f2a2a){for(var _0x5e2285=0x0;_0x5e2285<_0x1902cb[_0x900d('0x5b')]['ids'][_0x900d('0x47')];_0x5e2285+=0x1){socket[_0x900d('0xbb')]('userFaxAccount:save',{'UserId':_0x1902cb[_0x900d('0x5b')]['ids'][_0x5e2285],'FaxAccountId':_0x1902cb['params']['id']});}return _0x4f2a2a;});}})[_0x900d('0x21')](respondWithResult(_0x147a57,null))[_0x900d('0x53')](handleError(_0x147a57,null));};exports[_0x900d('0xbc')]=function(_0x2fa991,_0x55cdb0,_0x326447){return db[_0x900d('0x3d')]['find']({'where':{'id':_0x2fa991[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x55cdb0,null))['then'](function(_0xacafe8){if(_0xacafe8){return _0xacafe8[_0x900d('0xbc')](_0x2fa991[_0x900d('0x42')]['ids'])[_0x900d('0x21')](function(){if(_['isArray'](_0x2fa991[_0x900d('0x42')]['ids'])){for(var _0x5132ef=0x0;_0x5132ef<_0x2fa991[_0x900d('0x42')][_0x900d('0x6b')]['length'];_0x5132ef+=0x1){socket['emit']('userFaxAccount:remove',{'UserId':Number(_0x2fa991[_0x900d('0x42')][_0x900d('0x6b')][_0x5132ef]),'FaxAccountId':Number(_0x2fa991[_0x900d('0x55')]['id'])});}}else{socket[_0x900d('0xbb')](_0x900d('0xbd'),{'UserId':Number(_0x2fa991[_0x900d('0x42')][_0x900d('0x6b')]),'FaxAccountId':Number(_0x2fa991[_0x900d('0x55')]['id'])});}});}})['then'](respondWithStatusCode(_0x55cdb0,null))['catch'](handleError(_0x55cdb0,null));};exports[_0x900d('0xbe')]=function(_0x5c2c98,_0x255f05,_0x2173b7){var _0x4c7160={};var _0x32a497={};var _0xf9aad6;var _0x175d1e;return db['FaxAccount'][_0x900d('0x6e')]({'where':{'id':_0x5c2c98[_0x900d('0x55')]['id']}})[_0x900d('0x21')](handleEntityNotFound(_0x255f05,null))[_0x900d('0x21')](function(_0x5639d6){if(_0x5639d6){_0xf9aad6=_0x5639d6;_0x32a497[_0x900d('0x41')]=_['keys'](db[_0x900d('0x76')]['rawAttributes']);_0x32a497[_0x900d('0x42')]=_[_0x900d('0x43')](_0x5c2c98['query']);_0x32a497[_0x900d('0x4c')]=_['intersection'](_0x32a497[_0x900d('0x41')],_0x32a497[_0x900d('0x42')]);_0x4c7160[_0x900d('0x44')]=_[_0x900d('0x45')](_0x32a497[_0x900d('0x41')],qs[_0x900d('0x46')](_0x5c2c98['query'][_0x900d('0x46')]));_0x4c7160[_0x900d('0x44')]=_0x4c7160[_0x900d('0x44')][_0x900d('0x47')]?_0x4c7160[_0x900d('0x44')]:_0x32a497[_0x900d('0x41')];_0x4c7160[_0x900d('0x69')]=qs['sort'](_0x5c2c98[_0x900d('0x42')][_0x900d('0x4a')]);_0x4c7160[_0x900d('0x4b')]=qs['filters'](_[_0x900d('0x6a')](_0x5c2c98[_0x900d('0x42')],_0x32a497[_0x900d('0x4c')]));if(_0x5c2c98[_0x900d('0x42')][_0x900d('0x4f')]){_0x4c7160[_0x900d('0x4b')]=_[_0x900d('0x4d')](_0x4c7160[_0x900d('0x4b')],{'$or':_[_0x900d('0x3c')](_0x4c7160[_0x900d('0x44')],function(_0x31643d){var _0x6dd13b={};_0x6dd13b[_0x31643d]={'$like':'%'+_0x5c2c98['query'][_0x900d('0x4f')]+'%'};return _0x6dd13b;})});}_0x4c7160=_[_0x900d('0x4d')]({},_0x4c7160,_0x5c2c98['options']);return _0xf9aad6['getAgents'](_0x4c7160);}})[_0x900d('0x21')](function(_0x3465e4){if(_0x3465e4){_0x175d1e=_0x3465e4['length'];if(!_0x5c2c98[_0x900d('0x42')][_0x900d('0x48')]('nolimit')){_0x4c7160['limit']=qs['limit'](_0x5c2c98[_0x900d('0x42')]['limit']);_0x4c7160[_0x900d('0x2e')]=qs['offset'](_0x5c2c98['query'][_0x900d('0x2e')]);}return _0xf9aad6[_0x900d('0xbe')](_0x4c7160);}})['then'](function(_0x25bc72){if(_0x25bc72){return _0x25bc72?{'count':_0x175d1e,'rows':_0x25bc72}:null;}})[_0x900d('0x21')](respondWithResult(_0x255f05,null))[_0x900d('0x53')](handleError(_0x255f05,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index 97a00f7..3c9beab 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 _0x48ca=['update','remove','emit','hasOwnProperty','hook','exports','FaxAccount','setMaxListeners'];(function(_0x3aebf6,_0x3dd185){var _0x32e7c9=function(_0x40bdf0){while(--_0x40bdf0){_0x3aebf6['push'](_0x3aebf6['shift']());}};_0x32e7c9(++_0x3dd185);}(_0x48ca,0xae));var _0xa48c=function(_0x3130e7,_0x28b8d0){_0x3130e7=_0x3130e7-0x0;var _0x145186=_0x48ca[_0x3130e7];return _0x145186;};'use strict';var EventEmitter=require('events');var FaxAccount=require('../../mysqldb')['db'][_0xa48c('0x0')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xa48c('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0xa48c('0x2'),'afterDestroy':_0xa48c('0x3')};function emitEvent(_0x1ad7f2){return function(_0x12c395,_0x56c855,_0x4f8146){FaxAccountEvents[_0xa48c('0x4')](_0x1ad7f2+':'+_0x12c395['id'],_0x12c395);FaxAccountEvents[_0xa48c('0x4')](_0x1ad7f2,_0x12c395);_0x4f8146(null);};}for(var e in events){if(events[_0xa48c('0x5')](e)){var event=events[e];FaxAccount[_0xa48c('0x6')](e,emitEvent(event));}}module[_0xa48c('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x4ee9=['../../mysqldb','FaxAccount','setMaxListeners','save','update','remove','emit','hasOwnProperty','events'];(function(_0x4eefaf,_0x836e76){var _0x4ea52e=function(_0x477272){while(--_0x477272){_0x4eefaf['push'](_0x4eefaf['shift']());}};_0x4ea52e(++_0x836e76);}(_0x4ee9,0x1c1));var _0x94ee=function(_0x4503b5,_0x966a4c){_0x4503b5=_0x4503b5-0x0;var _0x237549=_0x4ee9[_0x4503b5];return _0x237549;};'use strict';var EventEmitter=require(_0x94ee('0x0'));var FaxAccount=require(_0x94ee('0x1'))['db'][_0x94ee('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x94ee('0x3')](0x0);var events={'afterCreate':_0x94ee('0x4'),'afterUpdate':_0x94ee('0x5'),'afterDestroy':_0x94ee('0x6')};function emitEvent(_0x6ea81c){return function(_0x1e0d43,_0x527ba8,_0x301262){FaxAccountEvents[_0x94ee('0x7')](_0x6ea81c+':'+_0x1e0d43['id'],_0x1e0d43);FaxAccountEvents[_0x94ee('0x7')](_0x6ea81c,_0x1e0d43);_0x301262(null);};}for(var e in events){if(events[_0x94ee('0x8')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module['exports']=FaxAccountEvents; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.model.js b/server/api/faxAccount/faxAccount.model.js index 6d27611..00b2c73 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 _0x9b26=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','fax_accounts','lodash','util','../../config/logger','api'];(function(_0x1f31cb,_0x49ed49){var _0x188f8d=function(_0x27c5fd){while(--_0x27c5fd){_0x1f31cb['push'](_0x1f31cb['shift']());}};_0x188f8d(++_0x49ed49);}(_0x9b26,0x130));var _0x69b2=function(_0x128b9c,_0x2f8e15){_0x128b9c=_0x128b9c-0x0;var _0x296504=_0x9b26[_0x128b9c];return _0x296504;};'use strict';var _=require(_0x69b2('0x0'));var util=require(_0x69b2('0x1'));var logger=require(_0x69b2('0x2'))(_0x69b2('0x3'));var moment=require(_0x69b2('0x4'));var BPromise=require(_0x69b2('0x5'));var rp=require(_0x69b2('0x6'));var fs=require('fs');var path=require(_0x69b2('0x7'));var rimraf=require(_0x69b2('0x8'));var config=require(_0x69b2('0x9'));var attributes=require(_0x69b2('0xa'));module[_0x69b2('0xb')]=function(_0x131081,_0x599cf7){return _0x131081[_0x69b2('0xc')]('FaxAccount',attributes,{'tableName':_0x69b2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x52a0=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','util'];(function(_0x374690,_0x43e1b9){var _0x27f846=function(_0x6b1500){while(--_0x6b1500){_0x374690['push'](_0x374690['shift']());}};_0x27f846(++_0x43e1b9);}(_0x52a0,0x110));var _0x052a=function(_0x5b71cb,_0x5d3de5){_0x5b71cb=_0x5b71cb-0x0;var _0x7b0184=_0x52a0[_0x5b71cb];return _0x7b0184;};'use strict';var _=require('lodash');var util=require(_0x052a('0x0'));var logger=require(_0x052a('0x1'))('api');var moment=require(_0x052a('0x2'));var BPromise=require(_0x052a('0x3'));var rp=require(_0x052a('0x4'));var fs=require('fs');var path=require(_0x052a('0x5'));var rimraf=require(_0x052a('0x6'));var config=require(_0x052a('0x7'));var attributes=require(_0x052a('0x8'));module[_0x052a('0x9')]=function(_0x869178,_0x21ef00){return _0x869178[_0x052a('0xa')](_0x052a('0xb'),attributes,{'tableName':_0x052a('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.rpc.js b/server/api/faxAccount/faxAccount.rpc.js index f47a937..3e32b9c 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 _0x037e=['User','name','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','client','http','defaults','redis','localhost','socket.io-emitter','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','FaxAccount','findAll','options','raw','where','attributes','limit','map','model','include','GetFaxAccount','NotifyFaxAccount','describe','Sequelize','difference','keys','createdAt','updatedAt','CompanyId','body','isNil','from','ValidationError','from\x20is\x20mandatory','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','CmList','List','Contacts','DESC','FaxApplication','Applications','get','list','applications','orderBy','priority','asc','account','CmContact','contact','fax','FaxInteraction','create','spread','autoclose','close','*,*,*,*','created','FaxMessage','ContactId','AttachmentId','interaction','UserId'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x037e,0x113));var _0xe037=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x037e[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xe037('0x0'));var util=require(_0xe037('0x1'));var moment=require(_0xe037('0x2'));var BPromise=require(_0xe037('0x3'));var rs=require(_0xe037('0x4'));var fs=require('fs');var Redis=require(_0xe037('0x5'));var db=require(_0xe037('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe037('0x7'))(_0xe037('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe037('0x9')][_0xe037('0xa')]({'port':0x232c});config['redis']=_[_0xe037('0xb')](config[_0xe037('0xc')],{'host':_0xe037('0xd'),'port':0x18eb});var socket=require(_0xe037('0xe'))(new Redis(config['redis']));require(_0xe037('0xf'))['register'](socket);function respondWithRpcPromise(_0x3a146e,_0x2cb0fb,_0x7c63f2){return new BPromise(function(_0x7ed77f,_0x305f1d){return client[_0xe037('0x10')](_0x3a146e,_0x7c63f2)[_0xe037('0x11')](function(_0x473039){logger[_0xe037('0x12')](_0xe037('0x13'),_0x2cb0fb,_0xe037('0x14'));logger[_0xe037('0x15')](_0xe037('0x16'),_0x2cb0fb,_0xe037('0x14'),JSON[_0xe037('0x17')](_0x473039));if(_0x473039[_0xe037('0x18')]){if(_0x473039['error'][_0xe037('0x19')]===0x1f4){logger['error']('FaxAccount,\x20%s,\x20%s',_0x2cb0fb,_0x473039['error'][_0xe037('0x1a')]);return _0x305f1d(_0x473039[_0xe037('0x18')]['message']);}logger[_0xe037('0x18')]('FaxAccount,\x20%s,\x20%s',_0x2cb0fb,_0x473039[_0xe037('0x18')][_0xe037('0x1a')]);return _0x7ed77f(_0x473039[_0xe037('0x18')][_0xe037('0x1a')]);}else{logger[_0xe037('0x12')]('FaxAccount,\x20%s,\x20%s',_0x2cb0fb,_0xe037('0x14'));_0x7ed77f(_0x473039[_0xe037('0x1b')][_0xe037('0x1a')]);}})[_0xe037('0x1c')](function(_0x47ab66){logger[_0xe037('0x18')]('FaxAccount,\x20%s,\x20%s',_0x2cb0fb,_0x47ab66);_0x305f1d(_0x47ab66);});});}exports['GetFaxAccount']=function(_0x139b05){var _0x6bb74=this;return new Promise(function(_0x2d99f6,_0x51596d){return db[_0xe037('0x1d')][_0xe037('0x1e')]({'raw':_0x139b05[_0xe037('0x1f')]?_0x139b05[_0xe037('0x1f')][_0xe037('0x20')]===undefined?!![]:![]:!![],'where':_0x139b05[_0xe037('0x1f')]?_0x139b05[_0xe037('0x1f')][_0xe037('0x21')]||null:null,'attributes':_0x139b05[_0xe037('0x1f')]?_0x139b05[_0xe037('0x1f')][_0xe037('0x22')]||null:null,'limit':_0x139b05[_0xe037('0x1f')]?_0x139b05[_0xe037('0x1f')][_0xe037('0x23')]||null:null,'include':_0x139b05['options']?_0x139b05['options']['include']?_[_0xe037('0x24')](_0x139b05[_0xe037('0x1f')]['include'],function(_0x37375a){return{'model':db[_0x37375a[_0xe037('0x25')]],'as':_0x37375a['as'],'attributes':_0x37375a[_0xe037('0x22')],'include':_0x37375a[_0xe037('0x26')]?_[_0xe037('0x24')](_0x37375a[_0xe037('0x26')],function(_0x51b980){return{'model':db[_0x51b980['model']],'as':_0x51b980['as'],'attributes':_0x51b980['attributes'],'include':_0x51b980[_0xe037('0x26')]?_[_0xe037('0x24')](_0x51b980[_0xe037('0x26')],function(_0x385c90){return{'model':db[_0x385c90['model']],'as':_0x385c90['as'],'attributes':_0x385c90[_0xe037('0x22')]};}):[]};}):[]};}):[]:[]})[_0xe037('0x11')](function(_0x428352){logger[_0xe037('0x12')](_0xe037('0x27'),_0x139b05);logger[_0xe037('0x15')]('GetFaxAccount',_0x139b05,JSON['stringify'](_0x428352));_0x2d99f6(_0x428352);})[_0xe037('0x1c')](function(_0x57a73c){logger[_0xe037('0x18')](_0xe037('0x27'),_0x57a73c[_0xe037('0x1a')],_0x139b05);_0x51596d(_0x6bb74[_0xe037('0x18')](0x1f4,_0x57a73c['message']));});});};exports[_0xe037('0x28')]=function(_0x3b1b2a,_0x365f0e,_0x6a4175){var _0x557024=this;return new Promise(function(_0x1880cf,_0x16456c){var _0x397d11={'body':_0x3b1b2a['body'],'channel':'fax'};var _0x48c7f5=[];var _0x5736bb=[];var _0x332a51={};return db['CmContact'][_0xe037('0x29')]()['then'](function(_0x50d1fa){if(!_0x50d1fa){throw new db[(_0xe037('0x2a'))]['ValidationError']('no\x20available\x20attributes');}_0x48c7f5=_[_0xe037('0x2b')](_[_0xe037('0x2c')](_0x50d1fa),[_0xe037('0x2d'),_0xe037('0x2e')]);_0x5736bb=_[_0xe037('0x2b')](_['keys'](_0x50d1fa),['createdAt',_0xe037('0x2e'),_0xe037('0x2f'),'ListId']);if(_0x3b1b2a[_0xe037('0x30')]['id']){delete _0x3b1b2a['body']['id'];}if(_[_0xe037('0x31')](_0x3b1b2a[_0xe037('0x30')][_0xe037('0x32')])){throw new db[(_0xe037('0x2a'))][(_0xe037('0x33'))](_0xe037('0x34'));}if(_[_0xe037('0x31')](_0x3b1b2a[_0xe037('0x30')][_0xe037('0x30')])||_0x3b1b2a['body']['body']===''){throw new db[(_0xe037('0x2a'))][(_0xe037('0x33'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe037('0x31')](_0x3b1b2a[_0xe037('0x30')]['mapKey'])){throw new db[(_0xe037('0x2a'))][(_0xe037('0x33'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x5736bb);}if(!_[_0xe037('0x35')](_0x5736bb,_0x3b1b2a['body'][_0xe037('0x36')])){throw new db[(_0xe037('0x2a'))]['ValidationError'](_0xe037('0x37')+_0x5736bb);}_0x332a51[_0x3b1b2a[_0xe037('0x30')][_0xe037('0x36')]]=_0x3b1b2a[_0xe037('0x30')][_0xe037('0x32')];})['then'](function(){return db[_0xe037('0x1d')][_0xe037('0x38')]({'where':{'id':_0x3b1b2a['account']['id']},'include':[{'model':db[_0xe037('0x39')],'as':_0xe037('0x3a'),'include':[{'model':db['CmContact'],'as':_0xe037('0x3b'),'where':_0x332a51,'limit':0x1,'order':[[_0xe037('0x2e'),_0xe037('0x3c')]]}]},{'model':db[_0xe037('0x3d')],'as':_0xe037('0x3e')}]});})['then'](function(_0x121fa3){if(_0x121fa3&&_0x121fa3['List']){var _0x3249f2=_0x121fa3[_0xe037('0x3f')]({'plain':!![]});_0x397d11['account']=_0x3249f2;_0x397d11['applications']=_0x3249f2[_0xe037('0x3e')];_0x397d11[_0xe037('0x40')]=_0x3249f2[_0xe037('0x3a')];_0x397d11[_0xe037('0x41')]=_[_0xe037('0x42')](_0x397d11[_0xe037('0x41')],[_0xe037('0x43')],[_0xe037('0x44')]);if(_0x397d11[_0xe037('0x45')][_0xe037('0x3e')]){delete _0x397d11[_0xe037('0x45')][_0xe037('0x3e')];}if(_0x397d11[_0xe037('0x45')][_0xe037('0x3a')]&&_0x397d11[_0xe037('0x45')][_0xe037('0x3a')][_0xe037('0x3b')]['length']){return _0x397d11[_0xe037('0x45')][_0xe037('0x3a')][_0xe037('0x3b')][0x0];}var _0x589b6e=_['defaults'](_0x3b1b2a[_0xe037('0x30')],{'firstName':_0x3b1b2a[_0xe037('0x30')][_0xe037('0x32')],'ListId':_0x3249f2['ListId']});_0x589b6e[_0x3b1b2a['body']['mapKey']]=_0x3b1b2a[_0xe037('0x30')][_0xe037('0x32')];return db[_0xe037('0x46')]['create'](_0x589b6e,{'fields':_0x48c7f5,'raw':!![]});}})[_0xe037('0x11')](function(_0x2799c8){_0x397d11[_0xe037('0x47')]=_0x2799c8;if(_0x2799c8){var _0x45c437={'ContactId':_0x2799c8['id'],'FaxAccountId':_0x3b1b2a[_0xe037('0x45')]['id'],'fax':_0x2799c8[_0xe037('0x48')]};return db[_0xe037('0x49')][_0xe037('0x38')]({'where':{'ContactId':_0x2799c8['id'],'closed':![],'FaxAccountId':_0x3b1b2a[_0xe037('0x45')]['id']}})[_0xe037('0x11')](function(_0x57618e){if(_0x57618e){return[_0x57618e,![]];}return db[_0xe037('0x49')][_0xe037('0x4a')](_0x45c437)['then'](function(_0x56a53e){return[_0x56a53e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xe037('0x4b')](function(_0x5e68a8,_0x4bedec){var _0x55e7f5=_0x5e68a8[_0xe037('0x3f')]({'plain':!![]});if(_0x4bedec){if(_0x397d11['account'][_0xe037('0x4c')]){_0x397d11[_0xe037('0x41')]['push']({'id':0x0,'priority':_0x397d11[_0xe037('0x41')]['length']+0x1,'app':_0xe037('0x4d'),'appdata':'unmanaged','interval':_0xe037('0x4e')});}_0x55e7f5['created']=!![];}else{_0x55e7f5[_0xe037('0x4f')]=![];}_0x397d11['interaction']=_0x55e7f5;return db[_0xe037('0x50')][_0xe037('0x4a')]({'body':_0x3b1b2a['body']['body'],'FaxAccountId':_0x3b1b2a[_0xe037('0x45')]['id'],'FaxInteractionId':_0x5e68a8['id'],'direction':'in','ContactId':_0x5e68a8[_0xe037('0x51')],'AttachmentId':_0x3b1b2a[_0xe037('0x30')][_0xe037('0x52')]});})[_0xe037('0x11')](function(_0xbfa664){_0x397d11[_0xe037('0x1a')]=_0xbfa664;if(_0x397d11[_0xe037('0x53')][_0xe037('0x54')]){return db[_0xe037('0x55')][_0xe037('0x38')]({'attributes':['id',_0xe037('0x56')],'where':{'id':_0x397d11[_0xe037('0x53')][_0xe037('0x54')]}})[_0xe037('0x11')](function(_0x5ae02c){if(_0x5ae02c){_0x397d11['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x5ae02c[_0xe037('0x56')]+','+(_0x397d11[_0xe037('0x45')][_0xe037('0x57')]||0xa),'interval':_0xe037('0x4e')});}return respondWithRpcPromise(_0xe037('0x58'),_0xe037('0x59'),_0x397d11);});}return respondWithRpcPromise('Start',_0xe037('0x59'),_0x397d11);})['then'](function(_0x505bd2){_0x1880cf(_0x505bd2);})[_0xe037('0x1c')](function(_0x12701e){_0x16456c(_0x557024['error'](0x1f4,_0x12701e[_0xe037('0x1a')]));});});}; \ No newline at end of file +var _0x78ba=['startRouting','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','redis','localhost','./faxAccount.socket','register','then','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','NotifyFaxAccount','body','fax','CmContact','Sequelize','ValidationError','keys','difference','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','Contacts','FaxApplication','get','applications','Applications','list','orderBy','priority','asc','length','create','contact','FaxInteraction','Contact\x20not\x20found','autoclose','push','close','unmanaged','*,*,*,*','created','interaction','FaxMessage','ContactId','AttachmentId','UserId','unshift','agent','waitForTheAssignedAgent'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x78ba,0xb5));var _0xa78b=function(_0x16489e,_0x1bc882){_0x16489e=_0x16489e-0x0;var _0x52d440=_0x78ba[_0x16489e];return _0x52d440;};'use strict';var _=require(_0xa78b('0x0'));var util=require(_0xa78b('0x1'));var moment=require(_0xa78b('0x2'));var BPromise=require(_0xa78b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa78b('0x4'))['db'];var utils=require(_0xa78b('0x5'));var logger=require(_0xa78b('0x6'))(_0xa78b('0x7'));var config=require('../../config/environment');var jayson=require(_0xa78b('0x8'));var client=jayson[_0xa78b('0x9')][_0xa78b('0xa')]({'port':0x232c});config['redis']=_[_0xa78b('0xb')](config[_0xa78b('0xc')],{'host':_0xa78b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa78b('0xc')]));require(_0xa78b('0xe'))[_0xa78b('0xf')](socket);function respondWithRpcPromise(_0x2238b8,_0x193816,_0x4442f2){return new BPromise(function(_0x3fd6df,_0x1569d9){return client['request'](_0x2238b8,_0x4442f2)[_0xa78b('0x10')](function(_0x3b6692){logger['info'](_0xa78b('0x11'),_0x193816,_0xa78b('0x12'));logger['debug'](_0xa78b('0x13'),_0x193816,_0xa78b('0x12'),JSON[_0xa78b('0x14')](_0x3b6692));if(_0x3b6692['error']){if(_0x3b6692[_0xa78b('0x15')][_0xa78b('0x16')]===0x1f4){logger['error'](_0xa78b('0x11'),_0x193816,_0x3b6692[_0xa78b('0x15')][_0xa78b('0x17')]);return _0x1569d9(_0x3b6692[_0xa78b('0x15')]['message']);}logger[_0xa78b('0x15')](_0xa78b('0x11'),_0x193816,_0x3b6692[_0xa78b('0x15')][_0xa78b('0x17')]);return _0x3fd6df(_0x3b6692[_0xa78b('0x15')][_0xa78b('0x17')]);}else{logger[_0xa78b('0x18')](_0xa78b('0x11'),_0x193816,_0xa78b('0x12'));_0x3fd6df(_0x3b6692[_0xa78b('0x19')][_0xa78b('0x17')]);}})[_0xa78b('0x1a')](function(_0x35c90d){logger['error'](_0xa78b('0x11'),_0x193816,_0x35c90d);_0x1569d9(_0x35c90d);});});}exports[_0xa78b('0x1b')]=function(_0x3dd55b){var _0x28d8a4=this;return new Promise(function(_0x33f784,_0x59e2b8){return db[_0xa78b('0x1c')][_0xa78b('0x1d')]({'raw':_0x3dd55b[_0xa78b('0x1e')]?_0x3dd55b[_0xa78b('0x1e')][_0xa78b('0x1f')]===undefined?!![]:![]:!![],'where':_0x3dd55b[_0xa78b('0x1e')]?_0x3dd55b[_0xa78b('0x1e')][_0xa78b('0x20')]||null:null,'attributes':_0x3dd55b[_0xa78b('0x1e')]?_0x3dd55b[_0xa78b('0x1e')][_0xa78b('0x21')]||null:null,'limit':_0x3dd55b[_0xa78b('0x1e')]?_0x3dd55b[_0xa78b('0x1e')][_0xa78b('0x22')]||null:null,'include':_0x3dd55b[_0xa78b('0x1e')]?_0x3dd55b[_0xa78b('0x1e')][_0xa78b('0x23')]?_[_0xa78b('0x24')](_0x3dd55b[_0xa78b('0x1e')]['include'],function(_0x370f52){return{'model':db[_0x370f52['model']],'as':_0x370f52['as'],'attributes':_0x370f52['attributes'],'include':_0x370f52['include']?_[_0xa78b('0x24')](_0x370f52[_0xa78b('0x23')],function(_0x2ccbf0){return{'model':db[_0x2ccbf0[_0xa78b('0x25')]],'as':_0x2ccbf0['as'],'attributes':_0x2ccbf0['attributes'],'include':_0x2ccbf0[_0xa78b('0x23')]?_[_0xa78b('0x24')](_0x2ccbf0[_0xa78b('0x23')],function(_0x5746fc){return{'model':db[_0x5746fc[_0xa78b('0x25')]],'as':_0x5746fc['as'],'attributes':_0x5746fc[_0xa78b('0x21')]};}):[]};}):[]};}):[]:[]})[_0xa78b('0x10')](function(_0x455878){logger[_0xa78b('0x18')](_0xa78b('0x1b'),_0x3dd55b);logger['debug']('GetFaxAccount',_0x3dd55b,JSON[_0xa78b('0x14')](_0x455878));_0x33f784(_0x455878);})['catch'](function(_0x193a2a){logger[_0xa78b('0x15')]('GetFaxAccount',_0x193a2a[_0xa78b('0x17')],_0x3dd55b);_0x59e2b8(_0x28d8a4[_0xa78b('0x15')](0x1f4,_0x193a2a[_0xa78b('0x17')]));});});};exports[_0xa78b('0x26')]=function(_0x3ea3be,_0x3b47a2,_0x45a0a0){var _0xaf6998=this;return new Promise(function(_0x13a68f,_0x35d6fd){var _0x3d77c0={'body':_0x3ea3be[_0xa78b('0x27')],'channel':_0xa78b('0x28')};var _0xf0a856=[];var _0x49ecf9=[];var _0xeaaf12={};return db[_0xa78b('0x29')]['describe']()[_0xa78b('0x10')](function(_0x33ab21){if(!_0x33ab21){throw new db[(_0xa78b('0x2a'))][(_0xa78b('0x2b'))]('no\x20available\x20attributes');}_0xf0a856=_['difference'](_[_0xa78b('0x2c')](_0x33ab21),['createdAt','updatedAt']);_0x49ecf9=_[_0xa78b('0x2d')](_[_0xa78b('0x2c')](_0x33ab21),[_0xa78b('0x2e'),_0xa78b('0x2f'),'CompanyId',_0xa78b('0x30')]);if(_0x3ea3be['body']['id']){delete _0x3ea3be[_0xa78b('0x27')]['id'];}if(_[_0xa78b('0x31')](_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x32')])){throw new db['Sequelize']['ValidationError'](_0xa78b('0x33'));}if(_[_0xa78b('0x31')](_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x27')])||_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x27')]===''){throw new db[(_0xa78b('0x2a'))][(_0xa78b('0x2b'))](_0xa78b('0x34'));}if(_['isNil'](_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x35')])){throw new db[(_0xa78b('0x2a'))][(_0xa78b('0x2b'))](_0xa78b('0x36')+_0x49ecf9);}if(!_[_0xa78b('0x37')](_0x49ecf9,_0x3ea3be['body'][_0xa78b('0x35')])){throw new db[(_0xa78b('0x2a'))]['ValidationError'](_0xa78b('0x38')+_0x49ecf9);}_0xeaaf12[_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x35')]]=_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x32')];})[_0xa78b('0x10')](function(){return db[_0xa78b('0x1c')][_0xa78b('0x39')]({'where':{'id':_0x3ea3be[_0xa78b('0x3a')]['id']},'include':[{'model':db[_0xa78b('0x3b')],'as':_0xa78b('0x3c'),'include':[{'model':db['CmContact'],'as':_0xa78b('0x3d'),'where':_0xeaaf12,'limit':0x1,'order':[[_0xa78b('0x2f'),'DESC']]}]},{'model':db[_0xa78b('0x3e')],'as':'Applications'}]});})['then'](function(_0x55985c){if(_0x55985c&&_0x55985c[_0xa78b('0x3c')]){var _0x382ce9=_0x55985c[_0xa78b('0x3f')]({'plain':!![]});_0x3d77c0['account']=_0x382ce9;_0x3d77c0[_0xa78b('0x40')]=_0x382ce9[_0xa78b('0x41')];_0x3d77c0[_0xa78b('0x42')]=_0x382ce9[_0xa78b('0x3c')];_0x3d77c0[_0xa78b('0x40')]=_[_0xa78b('0x43')](_0x3d77c0[_0xa78b('0x40')],[_0xa78b('0x44')],[_0xa78b('0x45')]);if(_0x3d77c0['account'][_0xa78b('0x41')]){delete _0x3d77c0[_0xa78b('0x3a')][_0xa78b('0x41')];}if(_0x3d77c0[_0xa78b('0x3a')]['List']&&_0x3d77c0['account'][_0xa78b('0x3c')][_0xa78b('0x3d')][_0xa78b('0x46')]){return _0x3d77c0[_0xa78b('0x3a')][_0xa78b('0x3c')][_0xa78b('0x3d')][0x0];}var _0x387ddb=_['defaults'](_0x3ea3be[_0xa78b('0x27')],{'firstName':_0x3ea3be['body'][_0xa78b('0x32')],'ListId':_0x382ce9[_0xa78b('0x30')]});_0x387ddb[_0x3ea3be[_0xa78b('0x27')]['mapKey']]=_0x3ea3be['body'][_0xa78b('0x32')];return db[_0xa78b('0x29')][_0xa78b('0x47')](_0x387ddb,{'fields':_0xf0a856,'raw':!![]});}})[_0xa78b('0x10')](function(_0x429113){_0x3d77c0[_0xa78b('0x48')]=_0x429113;if(_0x429113){var _0x4017db={'ContactId':_0x429113['id'],'FaxAccountId':_0x3ea3be[_0xa78b('0x3a')]['id'],'fax':_0x429113['fax']};return db[_0xa78b('0x49')][_0xa78b('0x39')]({'where':{'ContactId':_0x429113['id'],'closed':![],'FaxAccountId':_0x3ea3be['account']['id']}})['then'](function(_0x258ab4){if(_0x258ab4){return[_0x258ab4,![]];}return db[_0xa78b('0x49')][_0xa78b('0x47')](_0x4017db)[_0xa78b('0x10')](function(_0x139222){return[_0x139222,!![]];});});}else{throw new Error(_0xa78b('0x4a'));}})['spread'](function(_0x31fdc0,_0x151eb9){var _0x57e324=_0x31fdc0['get']({'plain':!![]});if(_0x151eb9){if(_0x3d77c0[_0xa78b('0x3a')][_0xa78b('0x4b')]){_0x3d77c0[_0xa78b('0x40')][_0xa78b('0x4c')]({'id':0x0,'priority':_0x3d77c0[_0xa78b('0x40')]['length']+0x1,'app':_0xa78b('0x4d'),'appdata':_0xa78b('0x4e'),'interval':_0xa78b('0x4f')});}_0x57e324[_0xa78b('0x50')]=!![];}else{_0x57e324[_0xa78b('0x50')]=![];}_0x3d77c0[_0xa78b('0x51')]=_0x57e324;return db[_0xa78b('0x52')][_0xa78b('0x47')]({'body':_0x3ea3be[_0xa78b('0x27')][_0xa78b('0x27')],'FaxAccountId':_0x3ea3be[_0xa78b('0x3a')]['id'],'FaxInteractionId':_0x31fdc0['id'],'direction':'in','ContactId':_0x31fdc0[_0xa78b('0x53')],'AttachmentId':_0x3ea3be['body'][_0xa78b('0x54')]});})[_0xa78b('0x10')](function(_0x1bcf5f){_0x3d77c0[_0xa78b('0x17')]=_0x1bcf5f;if(_0x3d77c0[_0xa78b('0x51')]['UserId']){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x3d77c0['interaction'][_0xa78b('0x55')]}})[_0xa78b('0x10')](function(_0x168602){if(_0x168602){_0x3d77c0[_0xa78b('0x40')][_0xa78b('0x56')]({'id':0x0,'priority':0x0,'app':_0xa78b('0x57'),'appdata':_0x168602['name']+','+(_0x3d77c0[_0xa78b('0x3a')][_0xa78b('0x58')]||0xa),'interval':_0xa78b('0x4f')});}return respondWithRpcPromise('Start','startRouting',_0x3d77c0);});}return respondWithRpcPromise('Start',_0xa78b('0x59'),_0x3d77c0);})[_0xa78b('0x10')](function(_0x3b43dc){_0x13a68f(_0x3b43dc);})[_0xa78b('0x1a')](function(_0xe7a1dd){_0x35d6fd(_0xaf6998[_0xa78b('0x15')](0x1f4,_0xe7a1dd[_0xa78b('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 6163fa3..1fe2ec0 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 _0x4991=['length','faxAccount:','./faxAccount.events','remove','emit','removeListener','register'];(function(_0x36c270,_0x2569ff){var _0x276c73=function(_0x27ea41){while(--_0x27ea41){_0x36c270['push'](_0x36c270['shift']());}};_0x276c73(++_0x2569ff);}(_0x4991,0xf7));var _0x1499=function(_0x5f13f2,_0x159b8e){_0x5f13f2=_0x5f13f2-0x0;var _0x4ddd2d=_0x4991[_0x5f13f2];return _0x4ddd2d;};'use strict';var FaxAccountEvents=require(_0x1499('0x0'));var events=['save',_0x1499('0x1'),'update'];function createListener(_0x30d640,_0x256e41){return function(_0x16ac22){_0x256e41[_0x1499('0x2')](_0x30d640,_0x16ac22);};}function removeListener(_0x1b291f,_0x158134){return function(){FaxAccountEvents[_0x1499('0x3')](_0x1b291f,_0x158134);};}exports[_0x1499('0x4')]=function(_0x4b6154){for(var _0x2a8e96=0x0,_0x1c3bd7=events[_0x1499('0x5')];_0x2a8e96<_0x1c3bd7;_0x2a8e96++){var _0x33b261=events[_0x2a8e96];var _0x133bae=createListener(_0x1499('0x6')+_0x33b261,_0x4b6154);FaxAccountEvents['on'](_0x33b261,_0x133bae);}}; \ No newline at end of file +var _0xd943=['save','remove','update','emit','./faxAccount.events'];(function(_0x11e762,_0x3f7103){var _0x24c967=function(_0x4a3cf0){while(--_0x4a3cf0){_0x11e762['push'](_0x11e762['shift']());}};_0x24c967(++_0x3f7103);}(_0xd943,0x15d));var _0x3d94=function(_0x4573d0,_0x147fd0){_0x4573d0=_0x4573d0-0x0;var _0x49f34a=_0xd943[_0x4573d0];return _0x49f34a;};'use strict';var FaxAccountEvents=require(_0x3d94('0x0'));var events=[_0x3d94('0x1'),_0x3d94('0x2'),_0x3d94('0x3')];function createListener(_0x5495df,_0x691e28){return function(_0x3edd1b){_0x691e28[_0x3d94('0x4')](_0x5495df,_0x3edd1b);};}function removeListener(_0xc13b61,_0xaf8962){return function(){FaxAccountEvents['removeListener'](_0xc13b61,_0xaf8962);};}exports['register']=function(_0x34c9c3){for(var _0x51cf1f=0x0,_0x54e81f=events['length'];_0x51cf1f<_0x54e81f;_0x51cf1f++){var _0x20f4d1=events[_0x51cf1f];var _0x35d36a=createListener('faxAccount:'+_0x20f4d1,_0x34c9c3);FaxAccountEvents['on'](_0x20f4d1,_0x35d36a);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index 912f39e..ab61aea 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 _0x4a03=['/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','delete','removeDispositions','removeAnswers','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','/describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','addDisposition','addAnswer','/:id/interactions','addInteraction','addApplications'];(function(_0x163581,_0x5b9c12){var _0x429613=function(_0x5ee3cc){while(--_0x5ee3cc){_0x163581['push'](_0x163581['shift']());}};_0x429613(++_0x5b9c12);}(_0x4a03,0x15d));var _0x34a0=function(_0x3ac3a2,_0x107b0f){_0x3ac3a2=_0x3ac3a2-0x0;var _0x37e1c3=_0x4a03[_0x3ac3a2];return _0x37e1c3;};'use strict';var multer=require(_0x34a0('0x0'));var util=require(_0x34a0('0x1'));var path=require(_0x34a0('0x2'));var timeout=require(_0x34a0('0x3'));var express=require(_0x34a0('0x4'));var router=express['Router']();var auth=require(_0x34a0('0x5'));var interaction=require(_0x34a0('0x6'));var config=require(_0x34a0('0x7'));var controller=require(_0x34a0('0x8'));router[_0x34a0('0x9')]('/',auth[_0x34a0('0xa')](),controller['index']);router[_0x34a0('0x9')](_0x34a0('0xb'),auth[_0x34a0('0xa')](),controller['describe']);router[_0x34a0('0x9')](_0x34a0('0xc'),auth['isAuthenticated'](),controller['show']);router['get'](_0x34a0('0xd'),auth[_0x34a0('0xa')](),controller['getDispositions']);router[_0x34a0('0x9')](_0x34a0('0xe'),auth[_0x34a0('0xa')](),controller[_0x34a0('0xf')]);router[_0x34a0('0x9')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x34a0('0x10')]);router[_0x34a0('0x9')](_0x34a0('0x11'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x12')]);router['get'](_0x34a0('0x13'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x14')]);router[_0x34a0('0x9')](_0x34a0('0x15'),auth['isAuthenticated'](),controller[_0x34a0('0x16')]);router[_0x34a0('0x17')]('/',auth['isAuthenticated'](),controller['create']);router['post'](_0x34a0('0xd'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x18')]);router[_0x34a0('0x17')]('/:id/canned_answers',auth['isAuthenticated'](),controller[_0x34a0('0x19')]);router[_0x34a0('0x17')](_0x34a0('0x1a'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x1b')]);router[_0x34a0('0x17')](_0x34a0('0x11'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x1c')]);router[_0x34a0('0x17')](_0x34a0('0x1d'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x1e')]);router[_0x34a0('0x17')](_0x34a0('0x1f'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x20')]);router[_0x34a0('0x17')](_0x34a0('0x21'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x22')]);router[_0x34a0('0x17')](_0x34a0('0x15'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x23')]);router[_0x34a0('0x24')](_0x34a0('0xc'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x25')]);router[_0x34a0('0x26')](_0x34a0('0xc'),auth[_0x34a0('0xa')](),controller['destroy']);router[_0x34a0('0x26')](_0x34a0('0xd'),auth[_0x34a0('0xa')](),controller[_0x34a0('0x27')]);router[_0x34a0('0x26')]('/:id/canned_answers',auth[_0x34a0('0xa')](),controller[_0x34a0('0x28')]);router[_0x34a0('0x26')](_0x34a0('0x15'),auth[_0x34a0('0xa')](),controller['removeAgents']);module[_0x34a0('0x29')]=router; \ No newline at end of file +var _0x1ea3=['/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','/:id/users','getAgents','post','create','addDisposition','addAnswer','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','addAgents','put','update','destroy','delete','removeDispositions','removeAnswers','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxAccount.controller','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions'];(function(_0x47b58b,_0x41a189){var _0x46bebe=function(_0x22bbfa){while(--_0x22bbfa){_0x47b58b['push'](_0x47b58b['shift']());}};_0x46bebe(++_0x41a189);}(_0x1ea3,0x1de));var _0x31ea=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0x1ea3[_0x4d613c];return _0x301fe3;};'use strict';var multer=require(_0x31ea('0x0'));var util=require('util');var path=require(_0x31ea('0x1'));var timeout=require(_0x31ea('0x2'));var express=require(_0x31ea('0x3'));var router=express[_0x31ea('0x4')]();var auth=require(_0x31ea('0x5'));var interaction=require(_0x31ea('0x6'));var config=require(_0x31ea('0x7'));var controller=require(_0x31ea('0x8'));router[_0x31ea('0x9')]('/',auth[_0x31ea('0xa')](),controller[_0x31ea('0xb')]);router[_0x31ea('0x9')]('/describe',auth[_0x31ea('0xa')](),controller[_0x31ea('0xc')]);router[_0x31ea('0x9')](_0x31ea('0xd'),auth['isAuthenticated'](),controller[_0x31ea('0xe')]);router[_0x31ea('0x9')](_0x31ea('0xf'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x10')]);router[_0x31ea('0x9')](_0x31ea('0x11'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x12')]);router[_0x31ea('0x9')](_0x31ea('0x13'),auth['isAuthenticated'](),controller[_0x31ea('0x14')]);router['get'](_0x31ea('0x15'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x16')]);router['get'](_0x31ea('0x17'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x18')]);router[_0x31ea('0x9')](_0x31ea('0x19'),auth['isAuthenticated'](),controller[_0x31ea('0x1a')]);router[_0x31ea('0x1b')]('/',auth[_0x31ea('0xa')](),controller[_0x31ea('0x1c')]);router[_0x31ea('0x1b')](_0x31ea('0xf'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x1d')]);router[_0x31ea('0x1b')](_0x31ea('0x11'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x1e')]);router[_0x31ea('0x1b')]('/:id/interactions',auth[_0x31ea('0xa')](),controller['addInteraction']);router[_0x31ea('0x1b')](_0x31ea('0x15'),auth[_0x31ea('0xa')](),controller['addApplications']);router[_0x31ea('0x1b')]('/addaccountapplications',auth[_0x31ea('0xa')](),controller[_0x31ea('0x1f')]);router['post'](_0x31ea('0x20'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x21')]);router['post'](_0x31ea('0x22'),auth['isAuthenticated'](),controller[_0x31ea('0x23')]);router['post'](_0x31ea('0x19'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x24')]);router[_0x31ea('0x25')](_0x31ea('0xd'),auth['isAuthenticated'](),controller[_0x31ea('0x26')]);router['delete'](_0x31ea('0xd'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x27')]);router[_0x31ea('0x28')](_0x31ea('0xf'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x29')]);router[_0x31ea('0x28')](_0x31ea('0x11'),auth[_0x31ea('0xa')](),controller[_0x31ea('0x2a')]);router[_0x31ea('0x28')](_0x31ea('0x19'),auth['isAuthenticated'](),controller[_0x31ea('0x2b')]);module[_0x31ea('0x2c')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 52e728a..a125e44 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 _0xd506=['*,*,*,*','sequelize'];(function(_0x3fd394,_0x4bd06c){var _0x586523=function(_0x2c699b){while(--_0x2c699b){_0x3fd394['push'](_0x3fd394['shift']());}};_0x586523(++_0x4bd06c);}(_0xd506,0x197));var _0x6d50=function(_0x243b2f,_0x30aa15){_0x243b2f=_0x243b2f-0x0;var _0xcb3c2d=_0xd506[_0x243b2f];return _0xcb3c2d;};'use strict';var Sequelize=require(_0x6d50('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x6d50('0x1')}}; \ No newline at end of file +var _0xd7a3=['sequelize','STRING','noop','TEXT'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0xd7a3,0xf4));var _0x3d7a=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0xd7a3[_0x3ff085];return _0x2b68c3;};'use strict';var Sequelize=require(_0x3d7a('0x0'));module['exports']={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x3d7a('0x1')],'allowNull':![],'defaultValue':_0x3d7a('0x2')},'appdata':{'type':Sequelize[_0x3d7a('0x3')]()},'description':{'type':Sequelize[_0x3d7a('0x1')]},'interval':{'type':Sequelize[_0x3d7a('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index 0f70b0f..d7fa380 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 _0x291c=['include','findAll','rows','catch','show','params','includeAll','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','map','FaxApplication','rawAttributes','fieldName','type','key','query','keys','model','intersection','fields','attributes','length','nolimit','limit','order','sort','where','filters','pick','filter','merge'];(function(_0xd9f102,_0x5a0d28){var _0x2652e4=function(_0x5021a1){while(--_0x5021a1){_0xd9f102['push'](_0xd9f102['shift']());}};_0x2652e4(++_0x5a0d28);}(_0x291c,0x137));var _0xc291=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0x291c[_0x2c91e9];return _0x13f0ff;};'use strict';var pdf=require(_0xc291('0x0'));var emlformat=require(_0xc291('0x1'));var rimraf=require(_0xc291('0x2'));var zipdir=require(_0xc291('0x3'));var jsonpatch=require(_0xc291('0x4'));var rp=require(_0xc291('0x5'));var moment=require(_0xc291('0x6'));var BPromise=require(_0xc291('0x7'));var Mustache=require(_0xc291('0x8'));var util=require(_0xc291('0x9'));var path=require(_0xc291('0xa'));var sox=require('sox');var csv=require(_0xc291('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc291('0xc'));var crypto=require(_0xc291('0xd'));var jsforce=require(_0xc291('0xe'));var deskjs=require(_0xc291('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc291('0x10'));var Papa=require(_0xc291('0x11'));var Redis=require(_0xc291('0x12'));var authService=require(_0xc291('0x13'));var qs=require(_0xc291('0x14'));var as=require(_0xc291('0x15'));var hardwareService=require(_0xc291('0x16'));var logger=require(_0xc291('0x17'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc291('0x18'))['db'];function respondWithStatusCode(_0x1a5af1,_0x3c7a29){_0x3c7a29=_0x3c7a29||0xcc;return function(_0x4d5eda){if(_0x4d5eda){return _0x1a5af1[_0xc291('0x19')](_0x3c7a29);}return _0x1a5af1['status'](_0x3c7a29)[_0xc291('0x1a')]();};}function respondWithResult(_0x9b3761,_0x1217f8){_0x1217f8=_0x1217f8||0xc8;return function(_0x31f272){if(_0x31f272){return _0x9b3761[_0xc291('0x1b')](_0x1217f8)[_0xc291('0x1c')](_0x31f272);}};}function respondWithFilteredResult(_0x1c3870,_0x409efe){return function(_0x1fe920){if(_0x1fe920){var _0x7eb5f1=_0x1fe920['count'],_0x5495ff=_0x409efe[_0xc291('0x1d')],_0x305ecc=_0x409efe['offset']+_0x409efe['limit'],_0x23dbf0;if(_0x305ecc>=_0x7eb5f1){_0x305ecc=_0x7eb5f1;_0x23dbf0=0xc8;}else{_0x23dbf0=0xce;}_0x1c3870['status'](_0x23dbf0);return _0x1c3870[_0xc291('0x1e')](_0xc291('0x1f'),_0x5495ff+'-'+_0x305ecc+'/'+_0x7eb5f1)[_0xc291('0x1c')](_0x1fe920);}return null;};}function patchUpdates(_0x212325){return function(_0x28f339){try{jsonpatch[_0xc291('0x20')](_0x28f339,_0x212325,!![]);}catch(_0x20ac90){return BPromise[_0xc291('0x21')](_0x20ac90);}return _0x28f339[_0xc291('0x22')]();};}function saveUpdates(_0x27a66a,_0x4b511c){return function(_0x42ac65){if(_0x42ac65){return _0x42ac65[_0xc291('0x23')](_0x27a66a)[_0xc291('0x24')](function(_0x503797){return _0x503797;});}return null;};}function removeEntity(_0x33822b,_0x56f7f9){return function(_0x50fbda){if(_0x50fbda){return _0x50fbda[_0xc291('0x25')]()['then'](function(){_0x33822b['status'](0xcc)[_0xc291('0x1a')]();});}};}function handleEntityNotFound(_0x1cec23,_0x359c1c){return function(_0x47a504){if(!_0x47a504){_0x1cec23[_0xc291('0x19')](0x194);}return _0x47a504;};}function handleError(_0x57f30d,_0x13a3cd){_0x13a3cd=_0x13a3cd||0x1f4;return function(_0x297030){logger[_0xc291('0x26')](_0x297030[_0xc291('0x27')]);if(_0x297030[_0xc291('0x28')]){delete _0x297030[_0xc291('0x28')];}_0x57f30d[_0xc291('0x1b')](_0x13a3cd)[_0xc291('0x29')](_0x297030);};}exports['index']=function(_0x3e4e3c,_0x273c0a){var _0x1ed0af={},_0x550363={},_0x3223f9={'count':0x0,'rows':[]};var _0xbf4adb=_[_0xc291('0x2a')](db[_0xc291('0x2b')][_0xc291('0x2c')],function(_0x48e001){return{'name':_0x48e001[_0xc291('0x2d')],'type':_0x48e001[_0xc291('0x2e')][_0xc291('0x2f')]};});_0x550363['model']=_[_0xc291('0x2a')](_0xbf4adb,_0xc291('0x28'));_0x550363[_0xc291('0x30')]=_[_0xc291('0x31')](_0x3e4e3c['query']);_0x550363['filters']=_['intersection'](_0x550363[_0xc291('0x32')],_0x550363['query']);_0x1ed0af['attributes']=_[_0xc291('0x33')](_0x550363[_0xc291('0x32')],qs[_0xc291('0x34')](_0x3e4e3c[_0xc291('0x30')][_0xc291('0x34')]));_0x1ed0af[_0xc291('0x35')]=_0x1ed0af[_0xc291('0x35')][_0xc291('0x36')]?_0x1ed0af[_0xc291('0x35')]:_0x550363['model'];if(!_0x3e4e3c[_0xc291('0x30')]['hasOwnProperty'](_0xc291('0x37'))){_0x1ed0af[_0xc291('0x38')]=qs[_0xc291('0x38')](_0x3e4e3c['query'][_0xc291('0x38')]);_0x1ed0af[_0xc291('0x1d')]=qs['offset'](_0x3e4e3c[_0xc291('0x30')][_0xc291('0x1d')]);}_0x1ed0af[_0xc291('0x39')]=qs[_0xc291('0x3a')](_0x3e4e3c[_0xc291('0x30')][_0xc291('0x3a')]);_0x1ed0af[_0xc291('0x3b')]=qs[_0xc291('0x3c')](_[_0xc291('0x3d')](_0x3e4e3c[_0xc291('0x30')],_0x550363['filters']));if(_0x3e4e3c[_0xc291('0x30')][_0xc291('0x3e')]){_0x1ed0af[_0xc291('0x3b')]=_[_0xc291('0x3f')](_0x1ed0af[_0xc291('0x3b')],{'$or':_[_0xc291('0x2a')](_0xbf4adb,function(_0x5940e8){if(_0x5940e8[_0xc291('0x2e')]!=='VIRTUAL'){var _0x5b7084={};_0x5b7084[_0x5940e8[_0xc291('0x28')]]={'$like':'%'+_0x3e4e3c[_0xc291('0x30')][_0xc291('0x3e')]+'%'};return _0x5b7084;}})});}_0x1ed0af=_[_0xc291('0x3f')]({},_0x1ed0af,_0x3e4e3c['options']);var _0x523381={'where':_0x1ed0af[_0xc291('0x3b')]};return db['FaxApplication']['count'](_0x523381)[_0xc291('0x24')](function(_0x9a73ec){_0x3223f9['count']=_0x9a73ec;if(_0x3e4e3c[_0xc291('0x30')]['includeAll']){_0x1ed0af[_0xc291('0x40')]=[{'all':!![]}];}return db[_0xc291('0x2b')][_0xc291('0x41')](_0x1ed0af);})[_0xc291('0x24')](function(_0x31edb2){_0x3223f9[_0xc291('0x42')]=_0x31edb2;return _0x3223f9;})['then'](respondWithFilteredResult(_0x273c0a,_0x1ed0af))[_0xc291('0x43')](handleError(_0x273c0a,null));};exports[_0xc291('0x44')]=function(_0x5edfe8,_0x50429c){var _0x31f0b1={'raw':!![],'where':{'id':_0x5edfe8[_0xc291('0x45')]['id']}},_0x1f3133={};_0x1f3133['model']=_[_0xc291('0x31')](db[_0xc291('0x2b')]['rawAttributes']);_0x1f3133[_0xc291('0x30')]=_['keys'](_0x5edfe8[_0xc291('0x30')]);_0x1f3133[_0xc291('0x3c')]=_['intersection'](_0x1f3133[_0xc291('0x32')],_0x1f3133[_0xc291('0x30')]);_0x31f0b1[_0xc291('0x35')]=_[_0xc291('0x33')](_0x1f3133[_0xc291('0x32')],qs[_0xc291('0x34')](_0x5edfe8['query'][_0xc291('0x34')]));_0x31f0b1[_0xc291('0x35')]=_0x31f0b1[_0xc291('0x35')][_0xc291('0x36')]?_0x31f0b1[_0xc291('0x35')]:_0x1f3133['model'];if(_0x5edfe8['query'][_0xc291('0x46')]){_0x31f0b1['include']=[{'all':!![]}];}_0x31f0b1=_['merge']({},_0x31f0b1,_0x5edfe8[_0xc291('0x47')]);return db[_0xc291('0x2b')][_0xc291('0x48')](_0x31f0b1)[_0xc291('0x24')](handleEntityNotFound(_0x50429c,null))[_0xc291('0x24')](respondWithResult(_0x50429c,null))[_0xc291('0x43')](handleError(_0x50429c,null));};exports[_0xc291('0x49')]=function(_0x19be9b,_0x24e552){return db[_0xc291('0x2b')]['create'](_0x19be9b[_0xc291('0x4a')],{})['then'](respondWithResult(_0x24e552,0xc9))[_0xc291('0x43')](handleError(_0x24e552,null));};exports[_0xc291('0x23')]=function(_0x273440,_0x453256){if(_0x273440[_0xc291('0x4a')]['id']){delete _0x273440[_0xc291('0x4a')]['id'];}return db['FaxApplication'][_0xc291('0x48')]({'where':{'id':_0x273440[_0xc291('0x45')]['id']}})[_0xc291('0x24')](handleEntityNotFound(_0x453256,null))[_0xc291('0x24')](saveUpdates(_0x273440[_0xc291('0x4a')],null))['then'](respondWithResult(_0x453256,null))[_0xc291('0x43')](handleError(_0x453256,null));};exports['destroy']=function(_0x5be533,_0x57f310){return db[_0xc291('0x2b')][_0xc291('0x48')]({'where':{'id':_0x5be533[_0xc291('0x45')]['id']}})[_0xc291('0x24')](handleEntityNotFound(_0x57f310,null))['then'](removeEntity(_0x57f310,null))[_0xc291('0x43')](handleError(_0x57f310,null));}; \ No newline at end of file +var _0x9ade=['status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','FaxApplication','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','order','sort','pick','filter','where','merge','VIRTUAL','options','count','findAll','rows','params','length','include','find','catch','create','update','body','html-pdf','eml-format','fast-json-patch','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','offset','limit'];(function(_0x36f442,_0x54b15d){var _0x5f2414=function(_0x996577){while(--_0x996577){_0x36f442['push'](_0x36f442['shift']());}};_0x5f2414(++_0x54b15d);}(_0x9ade,0x107));var _0xe9ad=function(_0x2d719c,_0x59b346){_0x2d719c=_0x2d719c-0x0;var _0x16c7e8=_0x9ade[_0x2d719c];return _0x16c7e8;};'use strict';var pdf=require(_0xe9ad('0x0'));var emlformat=require(_0xe9ad('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xe9ad('0x2'));var rp=require('request-promise');var moment=require(_0xe9ad('0x3'));var BPromise=require(_0xe9ad('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe9ad('0x5'));var sox=require(_0xe9ad('0x6'));var csv=require(_0xe9ad('0x7'));var ejs=require(_0xe9ad('0x8'));var fs=require('fs');var _=require(_0xe9ad('0x9'));var squel=require(_0xe9ad('0xa'));var crypto=require(_0xe9ad('0xb'));var jsforce=require(_0xe9ad('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe9ad('0x7'));var querystring=require(_0xe9ad('0xd'));var Papa=require(_0xe9ad('0xe'));var Redis=require(_0xe9ad('0xf'));var authService=require(_0xe9ad('0x10'));var qs=require(_0xe9ad('0x11'));var as=require(_0xe9ad('0x12'));var hardwareService=require(_0xe9ad('0x13'));var logger=require(_0xe9ad('0x14'))(_0xe9ad('0x15'));var utils=require(_0xe9ad('0x16'));var config=require(_0xe9ad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaaf1b7,_0x295b64){_0x295b64=_0x295b64||0xcc;return function(_0x43fc98){if(_0x43fc98){return _0xaaf1b7[_0xe9ad('0x18')](_0x295b64);}return _0xaaf1b7['status'](_0x295b64)[_0xe9ad('0x19')]();};}function respondWithResult(_0x1c29d5,_0x2ea149){_0x2ea149=_0x2ea149||0xc8;return function(_0x208416){if(_0x208416){return _0x1c29d5['status'](_0x2ea149)[_0xe9ad('0x1a')](_0x208416);}};}function respondWithFilteredResult(_0x5e1808,_0x302f52){return function(_0x4d018f){if(_0x4d018f){var _0x29ae6a=_0x4d018f['count'],_0x15d4dd=_0x302f52[_0xe9ad('0x1b')],_0x2b5201=_0x302f52[_0xe9ad('0x1b')]+_0x302f52[_0xe9ad('0x1c')],_0x453f77;if(_0x2b5201>=_0x29ae6a){_0x2b5201=_0x29ae6a;_0x453f77=0xc8;}else{_0x453f77=0xce;}_0x5e1808[_0xe9ad('0x1d')](_0x453f77);return _0x5e1808[_0xe9ad('0x1e')](_0xe9ad('0x1f'),_0x15d4dd+'-'+_0x2b5201+'/'+_0x29ae6a)['json'](_0x4d018f);}return null;};}function patchUpdates(_0x3939dd){return function(_0x108d15){try{jsonpatch[_0xe9ad('0x20')](_0x108d15,_0x3939dd,!![]);}catch(_0xd34940){return BPromise[_0xe9ad('0x21')](_0xd34940);}return _0x108d15[_0xe9ad('0x22')]();};}function saveUpdates(_0x3d474b,_0x2ecac0){return function(_0x35cab8){if(_0x35cab8){return _0x35cab8['update'](_0x3d474b)[_0xe9ad('0x23')](function(_0x5192b5){return _0x5192b5;});}return null;};}function removeEntity(_0x170371,_0x4d2bae){return function(_0xe4ddc1){if(_0xe4ddc1){return _0xe4ddc1[_0xe9ad('0x24')]()[_0xe9ad('0x23')](function(){_0x170371[_0xe9ad('0x1d')](0xcc)[_0xe9ad('0x19')]();});}};}function handleEntityNotFound(_0x479856,_0x5b6c24){return function(_0x40a6ce){if(!_0x40a6ce){_0x479856[_0xe9ad('0x18')](0x194);}return _0x40a6ce;};}function handleError(_0x281b6a,_0x465d10){_0x465d10=_0x465d10||0x1f4;return function(_0x331759){logger[_0xe9ad('0x25')](_0x331759[_0xe9ad('0x26')]);if(_0x331759[_0xe9ad('0x27')]){delete _0x331759['name'];}_0x281b6a[_0xe9ad('0x1d')](_0x465d10)[_0xe9ad('0x28')](_0x331759);};}exports[_0xe9ad('0x29')]=function(_0x136858,_0x55299c){var _0x26814f={},_0x2627d5={},_0x2b3e34={'count':0x0,'rows':[]};var _0x353394=_[_0xe9ad('0x2a')](db[_0xe9ad('0x2b')]['rawAttributes'],function(_0x546486){return{'name':_0x546486[_0xe9ad('0x2c')],'type':_0x546486[_0xe9ad('0x2d')][_0xe9ad('0x2e')]};});_0x2627d5['model']=_[_0xe9ad('0x2a')](_0x353394,_0xe9ad('0x27'));_0x2627d5[_0xe9ad('0x2f')]=_[_0xe9ad('0x30')](_0x136858[_0xe9ad('0x2f')]);_0x2627d5[_0xe9ad('0x31')]=_['intersection'](_0x2627d5[_0xe9ad('0x32')],_0x2627d5['query']);_0x26814f[_0xe9ad('0x33')]=_[_0xe9ad('0x34')](_0x2627d5[_0xe9ad('0x32')],qs[_0xe9ad('0x35')](_0x136858[_0xe9ad('0x2f')][_0xe9ad('0x35')]));_0x26814f[_0xe9ad('0x33')]=_0x26814f[_0xe9ad('0x33')]['length']?_0x26814f[_0xe9ad('0x33')]:_0x2627d5[_0xe9ad('0x32')];if(!_0x136858[_0xe9ad('0x2f')]['hasOwnProperty']('nolimit')){_0x26814f[_0xe9ad('0x1c')]=qs[_0xe9ad('0x1c')](_0x136858[_0xe9ad('0x2f')][_0xe9ad('0x1c')]);_0x26814f[_0xe9ad('0x1b')]=qs[_0xe9ad('0x1b')](_0x136858['query'][_0xe9ad('0x1b')]);}_0x26814f[_0xe9ad('0x36')]=qs[_0xe9ad('0x37')](_0x136858['query']['sort']);_0x26814f['where']=qs[_0xe9ad('0x31')](_[_0xe9ad('0x38')](_0x136858['query'],_0x2627d5[_0xe9ad('0x31')]));if(_0x136858[_0xe9ad('0x2f')][_0xe9ad('0x39')]){_0x26814f[_0xe9ad('0x3a')]=_[_0xe9ad('0x3b')](_0x26814f[_0xe9ad('0x3a')],{'$or':_[_0xe9ad('0x2a')](_0x353394,function(_0xa27be1){if(_0xa27be1[_0xe9ad('0x2d')]!==_0xe9ad('0x3c')){var _0x2431e1={};_0x2431e1[_0xa27be1['name']]={'$like':'%'+_0x136858[_0xe9ad('0x2f')][_0xe9ad('0x39')]+'%'};return _0x2431e1;}})});}_0x26814f=_[_0xe9ad('0x3b')]({},_0x26814f,_0x136858[_0xe9ad('0x3d')]);var _0x4769fa={'where':_0x26814f[_0xe9ad('0x3a')]};return db[_0xe9ad('0x2b')]['count'](_0x4769fa)['then'](function(_0xa2c1a5){_0x2b3e34[_0xe9ad('0x3e')]=_0xa2c1a5;if(_0x136858[_0xe9ad('0x2f')]['includeAll']){_0x26814f['include']=[{'all':!![]}];}return db['FaxApplication'][_0xe9ad('0x3f')](_0x26814f);})[_0xe9ad('0x23')](function(_0x428b1b){_0x2b3e34[_0xe9ad('0x40')]=_0x428b1b;return _0x2b3e34;})[_0xe9ad('0x23')](respondWithFilteredResult(_0x55299c,_0x26814f))['catch'](handleError(_0x55299c,null));};exports['show']=function(_0x291bea,_0x82bce8){var _0x3c497d={'raw':!![],'where':{'id':_0x291bea[_0xe9ad('0x41')]['id']}},_0x2ba1c4={};_0x2ba1c4[_0xe9ad('0x32')]=_[_0xe9ad('0x30')](db['FaxApplication']['rawAttributes']);_0x2ba1c4[_0xe9ad('0x2f')]=_[_0xe9ad('0x30')](_0x291bea['query']);_0x2ba1c4[_0xe9ad('0x31')]=_['intersection'](_0x2ba1c4['model'],_0x2ba1c4[_0xe9ad('0x2f')]);_0x3c497d['attributes']=_[_0xe9ad('0x34')](_0x2ba1c4[_0xe9ad('0x32')],qs['fields'](_0x291bea[_0xe9ad('0x2f')][_0xe9ad('0x35')]));_0x3c497d[_0xe9ad('0x33')]=_0x3c497d[_0xe9ad('0x33')][_0xe9ad('0x42')]?_0x3c497d[_0xe9ad('0x33')]:_0x2ba1c4[_0xe9ad('0x32')];if(_0x291bea['query']['includeAll']){_0x3c497d[_0xe9ad('0x43')]=[{'all':!![]}];}_0x3c497d=_[_0xe9ad('0x3b')]({},_0x3c497d,_0x291bea[_0xe9ad('0x3d')]);return db['FaxApplication'][_0xe9ad('0x44')](_0x3c497d)[_0xe9ad('0x23')](handleEntityNotFound(_0x82bce8,null))[_0xe9ad('0x23')](respondWithResult(_0x82bce8,null))[_0xe9ad('0x45')](handleError(_0x82bce8,null));};exports[_0xe9ad('0x46')]=function(_0x3f6473,_0x3dbc3e){return db['FaxApplication'][_0xe9ad('0x46')](_0x3f6473['body'],{})[_0xe9ad('0x23')](respondWithResult(_0x3dbc3e,0xc9))['catch'](handleError(_0x3dbc3e,null));};exports[_0xe9ad('0x47')]=function(_0x45c186,_0x49044c){if(_0x45c186['body']['id']){delete _0x45c186[_0xe9ad('0x48')]['id'];}return db[_0xe9ad('0x2b')][_0xe9ad('0x44')]({'where':{'id':_0x45c186[_0xe9ad('0x41')]['id']}})[_0xe9ad('0x23')](handleEntityNotFound(_0x49044c,null))[_0xe9ad('0x23')](saveUpdates(_0x45c186[_0xe9ad('0x48')],null))[_0xe9ad('0x23')](respondWithResult(_0x49044c,null))['catch'](handleError(_0x49044c,null));};exports[_0xe9ad('0x24')]=function(_0x198521,_0x24d497){return db[_0xe9ad('0x2b')][_0xe9ad('0x44')]({'where':{'id':_0x198521[_0xe9ad('0x41')]['id']}})[_0xe9ad('0x23')](handleEntityNotFound(_0x24d497,null))[_0xe9ad('0x23')](removeEntity(_0x24d497,null))[_0xe9ad('0x45')](handleError(_0x24d497,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 48847af..1cf7e4c 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 _0xab4a=['../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4_unicode_ci','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0xee14f,_0x332b45){var _0x5ec147=function(_0x294b11){while(--_0x294b11){_0xee14f['push'](_0xee14f['shift']());}};_0x5ec147(++_0x332b45);}(_0xab4a,0x117));var _0xaab4=function(_0x193e28,_0x3dac1d){_0x193e28=_0x193e28-0x0;var _0x20ef59=_0xab4a[_0x193e28];return _0x20ef59;};'use strict';var _=require('lodash');var util=require(_0xaab4('0x0'));var logger=require('../../config/logger')(_0xaab4('0x1'));var moment=require(_0xaab4('0x2'));var BPromise=require(_0xaab4('0x3'));var rp=require(_0xaab4('0x4'));var fs=require('fs');var path=require(_0xaab4('0x5'));var rimraf=require(_0xaab4('0x6'));var config=require(_0xaab4('0x7'));var attributes=require(_0xaab4('0x8'));module[_0xaab4('0x9')]=function(_0x55fc89,_0x120a5e){return _0x55fc89[_0xaab4('0xa')]('FaxApplication',attributes,{'tableName':_0xaab4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xaab4('0xc')});}; \ No newline at end of file +var _0x71f0=['request-promise','rimraf','../../config/environment','exports','define','FaxApplication','fax_applications','utf8mb4','utf8mb4_unicode_ci','lodash','moment','bluebird'];(function(_0x1240b4,_0x4868e6){var _0x177471=function(_0x1d0a84){while(--_0x1d0a84){_0x1240b4['push'](_0x1240b4['shift']());}};_0x177471(++_0x4868e6);}(_0x71f0,0x1dd));var _0x071f=function(_0x4b4154,_0x38a122){_0x4b4154=_0x4b4154-0x0;var _0x340ed7=_0x71f0[_0x4b4154];return _0x340ed7;};'use strict';var _=require(_0x071f('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x071f('0x1'));var BPromise=require(_0x071f('0x2'));var rp=require(_0x071f('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x071f('0x4'));var config=require(_0x071f('0x5'));var attributes=require('./faxApplication.attributes');module[_0x071f('0x6')]=function(_0x438109,_0x26acfa){return _0x438109[_0x071f('0x7')](_0x071f('0x8'),attributes,{'tableName':_0x071f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x071f('0xa'),'collate':_0x071f('0xb')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 2441a4e..f7fddf4 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 _0x1514=['attributes','limit','then','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','info','FaxApplication,\x20%s,\x20%s','debug','FaxApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','UpdateFaxApplication','body','options','raw','where'];(function(_0x73cdbb,_0x4119a6){var _0x2ba4de=function(_0x400ad2){while(--_0x400ad2){_0x73cdbb['push'](_0x73cdbb['shift']());}};_0x2ba4de(++_0x4119a6);}(_0x1514,0xf3));var _0x4151=function(_0x4f9579,_0x219e79){_0x4f9579=_0x4f9579-0x0;var _0x761c2e=_0x1514[_0x4f9579];return _0x761c2e;};'use strict';var _=require(_0x4151('0x0'));var util=require(_0x4151('0x1'));var moment=require(_0x4151('0x2'));var BPromise=require('bluebird');var rs=require(_0x4151('0x3'));var fs=require('fs');var Redis=require(_0x4151('0x4'));var db=require(_0x4151('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4151('0x6'))(_0x4151('0x7'));var config=require(_0x4151('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x4151('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2a755b,_0x5f132f,_0x1c4c59){return new BPromise(function(_0x5d4b8e,_0x100fd2){return client[_0x4151('0xa')](_0x2a755b,_0x1c4c59)['then'](function(_0x53c065){logger[_0x4151('0xb')](_0x4151('0xc'),_0x5f132f,'request\x20sent');logger[_0x4151('0xd')](_0x4151('0xe'),_0x5f132f,_0x4151('0xf'),JSON[_0x4151('0x10')](_0x53c065));if(_0x53c065[_0x4151('0x11')]){if(_0x53c065[_0x4151('0x11')][_0x4151('0x12')]===0x1f4){logger[_0x4151('0x11')](_0x4151('0xc'),_0x5f132f,_0x53c065[_0x4151('0x11')][_0x4151('0x13')]);return _0x100fd2(_0x53c065[_0x4151('0x11')]['message']);}logger[_0x4151('0x11')]('FaxApplication,\x20%s,\x20%s',_0x5f132f,_0x53c065[_0x4151('0x11')][_0x4151('0x13')]);return _0x5d4b8e(_0x53c065[_0x4151('0x11')][_0x4151('0x13')]);}else{logger[_0x4151('0xb')](_0x4151('0xc'),_0x5f132f,'request\x20sent');_0x5d4b8e(_0x53c065[_0x4151('0x14')][_0x4151('0x13')]);}})[_0x4151('0x15')](function(_0x1815f1){logger[_0x4151('0x11')]('FaxApplication,\x20%s,\x20%s',_0x5f132f,_0x1815f1);_0x100fd2(_0x1815f1);});});}exports[_0x4151('0x16')]=function(_0x11697f){var _0x37a8e8=this;return new Promise(function(_0x2e243d,_0x587c02){return db['FaxApplication']['update'](_0x11697f[_0x4151('0x17')],{'raw':_0x11697f[_0x4151('0x18')]?_0x11697f[_0x4151('0x18')][_0x4151('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11697f['options']?_0x11697f[_0x4151('0x18')][_0x4151('0x1a')]||null:null,'attributes':_0x11697f['options']?_0x11697f[_0x4151('0x18')][_0x4151('0x1b')]||null:null,'limit':_0x11697f['options']?_0x11697f[_0x4151('0x18')][_0x4151('0x1c')]||null:null})[_0x4151('0x1d')](function(_0x5545b3){logger['info'](_0x4151('0x16'),_0x11697f);logger[_0x4151('0xd')]('UpdateFaxApplication',_0x11697f,JSON['stringify'](_0x5545b3));_0x2e243d(_0x5545b3);})[_0x4151('0x15')](function(_0x5aed3f){logger[_0x4151('0x11')](_0x4151('0x16'),_0x5aed3f['message'],_0x11697f);_0x587c02(_0x37a8e8[_0x4151('0x11')](0x1f4,_0x5aed3f[_0x4151('0x13')]));});});}; \ No newline at end of file +var _0x5e9a=['ioredis','../../mysqldb','../../config/utils','jayson/promise','info','FaxApplication,\x20%s,\x20%s','request\x20sent','FaxApplication,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','UpdateFaxApplication','update','options','raw','where','attributes','then','debug','stringify','bluebird'];(function(_0x405314,_0x5d5b0f){var _0x2c3b12=function(_0x21a7c0){while(--_0x21a7c0){_0x405314['push'](_0x405314['shift']());}};_0x2c3b12(++_0x5d5b0f);}(_0x5e9a,0x19d));var _0xa5e9=function(_0x3ac87f,_0x9ef3b9){_0x3ac87f=_0x3ac87f-0x0;var _0x43671b=_0x5e9a[_0x3ac87f];return _0x43671b;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xa5e9('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa5e9('0x1'));var db=require(_0xa5e9('0x2'))['db'];var utils=require(_0xa5e9('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xa5e9('0x4'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x212548,_0x3bf5e5,_0x383939){return new BPromise(function(_0x2b8b7b,_0x24989b){return client['request'](_0x212548,_0x383939)['then'](function(_0x5818d2){logger[_0xa5e9('0x5')](_0xa5e9('0x6'),_0x3bf5e5,_0xa5e9('0x7'));logger['debug'](_0xa5e9('0x8'),_0x3bf5e5,_0xa5e9('0x7'),JSON['stringify'](_0x5818d2));if(_0x5818d2['error']){if(_0x5818d2['error'][_0xa5e9('0x9')]===0x1f4){logger[_0xa5e9('0xa')]('FaxApplication,\x20%s,\x20%s',_0x3bf5e5,_0x5818d2[_0xa5e9('0xa')][_0xa5e9('0xb')]);return _0x24989b(_0x5818d2[_0xa5e9('0xa')][_0xa5e9('0xb')]);}logger[_0xa5e9('0xa')](_0xa5e9('0x6'),_0x3bf5e5,_0x5818d2[_0xa5e9('0xa')]['message']);return _0x2b8b7b(_0x5818d2[_0xa5e9('0xa')][_0xa5e9('0xb')]);}else{logger[_0xa5e9('0x5')](_0xa5e9('0x6'),_0x3bf5e5,_0xa5e9('0x7'));_0x2b8b7b(_0x5818d2[_0xa5e9('0xc')][_0xa5e9('0xb')]);}})[_0xa5e9('0xd')](function(_0x31a9b8){logger[_0xa5e9('0xa')]('FaxApplication,\x20%s,\x20%s',_0x3bf5e5,_0x31a9b8);_0x24989b(_0x31a9b8);});});}exports[_0xa5e9('0xe')]=function(_0x4fe83a){var _0x2c1870=this;return new Promise(function(_0x256fb1,_0x386334){return db['FaxApplication'][_0xa5e9('0xf')](_0x4fe83a['body'],{'raw':_0x4fe83a[_0xa5e9('0x10')]?_0x4fe83a[_0xa5e9('0x10')][_0xa5e9('0x11')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4fe83a['options']?_0x4fe83a[_0xa5e9('0x10')][_0xa5e9('0x12')]||null:null,'attributes':_0x4fe83a[_0xa5e9('0x10')]?_0x4fe83a['options'][_0xa5e9('0x13')]||null:null,'limit':_0x4fe83a[_0xa5e9('0x10')]?_0x4fe83a[_0xa5e9('0x10')]['limit']||null:null})[_0xa5e9('0x14')](function(_0x4f1a2c){logger[_0xa5e9('0x5')](_0xa5e9('0xe'),_0x4fe83a);logger[_0xa5e9('0x15')](_0xa5e9('0xe'),_0x4fe83a,JSON[_0xa5e9('0x16')](_0x4f1a2c));_0x256fb1(_0x4f1a2c);})[_0xa5e9('0xd')](function(_0xd92b5b){logger[_0xa5e9('0xa')](_0xa5e9('0xe'),_0xd92b5b[_0xa5e9('0xb')],_0x4fe83a);_0x386334(_0x2c1870[_0xa5e9('0xa')](0x1f4,_0xd92b5b['message']));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index df5c239..c99d06a 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 _0xf2ca=['update','delete','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxApplication.controller','isAuthenticated','index','get','/:id','show','post','create'];(function(_0x367b4d,_0x16eb06){var _0x3b098b=function(_0x169cf9){while(--_0x169cf9){_0x367b4d['push'](_0x367b4d['shift']());}};_0x3b098b(++_0x16eb06);}(_0xf2ca,0x16a));var _0xaf2c=function(_0xf6e75d,_0xc70967){_0xf6e75d=_0xf6e75d-0x0;var _0x27514d=_0xf2ca[_0xf6e75d];return _0x27514d;};'use strict';var multer=require(_0xaf2c('0x0'));var util=require(_0xaf2c('0x1'));var path=require(_0xaf2c('0x2'));var timeout=require('connect-timeout');var express=require(_0xaf2c('0x3'));var router=express[_0xaf2c('0x4')]();var auth=require(_0xaf2c('0x5'));var interaction=require(_0xaf2c('0x6'));var config=require(_0xaf2c('0x7'));var controller=require(_0xaf2c('0x8'));router['get']('/',auth[_0xaf2c('0x9')](),controller[_0xaf2c('0xa')]);router[_0xaf2c('0xb')](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0xd')]);router[_0xaf2c('0xe')]('/',auth['isAuthenticated'](),controller[_0xaf2c('0xf')]);router['put'](_0xaf2c('0xc'),auth['isAuthenticated'](),controller[_0xaf2c('0x10')]);router[_0xaf2c('0x11')](_0xaf2c('0xc'),auth[_0xaf2c('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xb138=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller','get','index','isAuthenticated','show','post','create','put','update','delete','/:id','destroy','multer','util','path'];(function(_0x214466,_0x45a34c){var _0x2ff367=function(_0x3ca6f2){while(--_0x3ca6f2){_0x214466['push'](_0x214466['shift']());}};_0x2ff367(++_0x45a34c);}(_0xb138,0x1dd));var _0x8b13=function(_0x1a0e35,_0x307fa9){_0x1a0e35=_0x1a0e35-0x0;var _0x41619d=_0xb138[_0x1a0e35];return _0x41619d;};'use strict';var multer=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var path=require(_0x8b13('0x2'));var timeout=require(_0x8b13('0x3'));var express=require(_0x8b13('0x4'));var router=express[_0x8b13('0x5')]();var auth=require(_0x8b13('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x8b13('0x7'));var controller=require(_0x8b13('0x8'));router[_0x8b13('0x9')]('/',auth['isAuthenticated'](),controller[_0x8b13('0xa')]);router[_0x8b13('0x9')]('/:id',auth[_0x8b13('0xb')](),controller[_0x8b13('0xc')]);router[_0x8b13('0xd')]('/',auth['isAuthenticated'](),controller[_0x8b13('0xe')]);router[_0x8b13('0xf')]('/:id',auth['isAuthenticated'](),controller[_0x8b13('0x10')]);router[_0x8b13('0x11')](_0x8b13('0x12'),auth[_0x8b13('0xb')](),controller[_0x8b13('0x13')]);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 d0c6cf2..0197ace 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 _0xc062=['BOOLEAN','DATE','STRING','ENUM','out','exports'];(function(_0x55ba8c,_0x1b494c){var _0x537cc3=function(_0x63024f){while(--_0x63024f){_0x55ba8c['push'](_0x55ba8c['shift']());}};_0x537cc3(++_0x1b494c);}(_0xc062,0xa7));var _0x2c06=function(_0x451b9f,_0x43ba57){_0x451b9f=_0x451b9f-0x0;var _0x213d56=_0xc062[_0x451b9f];return _0x213d56;};'use strict';var Sequelize=require('sequelize');module[_0x2c06('0x0')]={'closed':{'type':Sequelize[_0x2c06('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x2c06('0x2')]},'disposition':{'type':Sequelize[_0x2c06('0x3')]},'note':{'type':Sequelize[_0x2c06('0x3')]},'read1stAt':{'type':Sequelize[_0x2c06('0x2')]},'fax':{'type':Sequelize[_0x2c06('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x2c06('0x4')]('in',_0x2c06('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x2c06('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2c06('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x29a1=['ENUM','exports','BOOLEAN','STRING','DATE','out'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x29a1,0xd9));var _0x129a=function(_0x556b4f,_0x343aca){_0x556b4f=_0x556b4f-0x0;var _0x16aabe=_0x29a1[_0x556b4f];return _0x16aabe;};'use strict';var Sequelize=require('sequelize');module[_0x129a('0x0')]={'closed':{'type':Sequelize[_0x129a('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x129a('0x2')]},'note':{'type':Sequelize[_0x129a('0x2')]},'read1stAt':{'type':Sequelize[_0x129a('0x3')]},'fax':{'type':Sequelize['STRING']},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x129a('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x129a('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x129a('0x5')]('in',_0x129a('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.controller.js b/server/api/faxInteraction/faxInteraction.controller.js index 2326399..d7e06e0 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 _0x7981=['transcript-%d-%s.zip','Messages','get','mkdirSync','Attachment','basename','existsSync','createReadStream','resolve','log','err','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','sendStatus','end','status','offset','set','Content-Range','json','apply','save','update','then','error','name','map','TagIds','Tags','split','forEach','catch','index','FaxInteraction','fieldName','type','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','left_join','users','fax_interactions','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','t.id\x20=\x20it.TagId','search','parseSearch','sqlOperator','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','isEmpty','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','t.id\x20IN\x20?','FaxAccountId','i.FaxAccountId\x20IS\x20NOT\x20NULL','user','i.FaxAccountId\x20IS\x20NULL','i.FaxAccountId\x20IN\x20?','count','sequelize','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','FaxInteractionId','push','all','rows','show','params','keys','rawAttributes','include','options','create','body','destroy','describe','addMessage','FaxMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','attachments'];(function(_0x50fc19,_0x2685e7){var _0x30c392=function(_0x5763f6){while(--_0x5763f6){_0x50fc19['push'](_0x50fc19['shift']());}};_0x30c392(++_0x2685e7);}(_0x7981,0x1a9));var _0x1798=function(_0x25627b,_0x469873){_0x25627b=_0x25627b-0x0;var _0x19f9e7=_0x7981[_0x25627b];return _0x19f9e7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1798('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1798('0x1'));var jsonpatch=require(_0x1798('0x2'));var rp=require(_0x1798('0x3'));var moment=require(_0x1798('0x4'));var BPromise=require(_0x1798('0x5'));var Mustache=require(_0x1798('0x6'));var util=require('util');var path=require(_0x1798('0x7'));var sox=require(_0x1798('0x8'));var csv=require(_0x1798('0x9'));var ejs=require(_0x1798('0xa'));var fs=require('fs');var _=require(_0x1798('0xb'));var squel=require(_0x1798('0xc'));var crypto=require(_0x1798('0xd'));var jsforce=require(_0x1798('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x1798('0xf'));var Papa=require(_0x1798('0x10'));var Redis=require(_0x1798('0x11'));var authService=require(_0x1798('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1798('0x13'));var logger=require(_0x1798('0x14'))('api');var utils=require(_0x1798('0x15'));var config=require(_0x1798('0x16'));var db=require('../../mysqldb')['db'];config[_0x1798('0x17')]=_[_0x1798('0x18')](config[_0x1798('0x17')],{'host':_0x1798('0x19'),'port':0x18eb});var socket=require(_0x1798('0x1a'))(new Redis(config[_0x1798('0x17')]));require(_0x1798('0x1b'))[_0x1798('0x1c')](socket);function respondWithStatusCode(_0x5da820,_0x25edfc){_0x25edfc=_0x25edfc||0xcc;return function(_0x153a74){if(_0x153a74){return _0x5da820[_0x1798('0x1d')](_0x25edfc);}return _0x5da820['status'](_0x25edfc)[_0x1798('0x1e')]();};}function respondWithResult(_0xd733dd,_0x1319fb){_0x1319fb=_0x1319fb||0xc8;return function(_0x156fea){if(_0x156fea){return _0xd733dd[_0x1798('0x1f')](_0x1319fb)['json'](_0x156fea);}};}function respondWithFilteredResult(_0x371c74,_0x23dd62){return function(_0x4e57c3){if(_0x4e57c3){var _0x41a3e2=_0x4e57c3['count'],_0x4d759f=_0x23dd62[_0x1798('0x20')],_0x513712=_0x23dd62['offset']+_0x23dd62['limit'],_0xd24d87;if(_0x513712>=_0x41a3e2){_0x513712=_0x41a3e2;_0xd24d87=0xc8;}else{_0xd24d87=0xce;}_0x371c74[_0x1798('0x1f')](_0xd24d87);return _0x371c74[_0x1798('0x21')](_0x1798('0x22'),_0x4d759f+'-'+_0x513712+'/'+_0x41a3e2)[_0x1798('0x23')](_0x4e57c3);}return null;};}function patchUpdates(_0x3f7c72){return function(_0x1b8e7b){try{jsonpatch[_0x1798('0x24')](_0x1b8e7b,_0x3f7c72,!![]);}catch(_0x20aa06){return BPromise['reject'](_0x20aa06);}return _0x1b8e7b[_0x1798('0x25')]();};}function saveUpdates(_0x115f4b,_0x5bbc96){return function(_0x5d7e32){if(_0x5d7e32){return _0x5d7e32[_0x1798('0x26')](_0x115f4b)[_0x1798('0x27')](function(_0x328eba){return _0x328eba;});}return null;};}function removeEntity(_0x51cd18,_0x2e7c0b){return function(_0x37d010){if(_0x37d010){return _0x37d010['destroy']()[_0x1798('0x27')](function(){_0x51cd18['status'](0xcc)[_0x1798('0x1e')]();});}};}function handleEntityNotFound(_0x58a7b5,_0x2b7557){return function(_0x502ade){if(!_0x502ade){_0x58a7b5[_0x1798('0x1d')](0x194);}return _0x502ade;};}function handleError(_0x59ca9a,_0x464811){_0x464811=_0x464811||0x1f4;return function(_0x23ab02){logger[_0x1798('0x28')](_0x23ab02['stack']);if(_0x23ab02['name']){delete _0x23ab02[_0x1798('0x29')];}_0x59ca9a[_0x1798('0x1f')](_0x464811)['send'](_0x23ab02);};}function getInteractionUsers(_0x256f02,_0x3c2266){return new BPromise(function(_0x2221b5,_0x5bfa20){try{if(_0x3c2266[_0x256f02['id']]){_0x256f02['Users']=_[_0x1798('0x2a')](_0x3c2266[_0x256f02['id']],function(_0x3ab542){return{'id':_0x3ab542['id'],'fullname':_0x3ab542['fullname']};});}}catch(_0xdc94ea){_0x5bfa20(_0xdc94ea);}_0x2221b5(_0x256f02);});}function getInteractionTags(_0x4faeae,_0x386fe4){return new BPromise(function(_0x5a9ca1,_0x114777){try{if(_0x4faeae[_0x1798('0x2b')]){_0x4faeae[_0x1798('0x2c')]=[];_0x4faeae[_0x1798('0x2b')][_0x1798('0x2d')](',')[_0x1798('0x2e')](function(_0x3417ff){_0x4faeae[_0x1798('0x2c')]['push'](_0x386fe4[_0x3417ff]);});}delete _0x4faeae['TagIds'];}catch(_0x26963b){_0x114777(_0x26963b);}_0x5a9ca1(_0x4faeae);});}function updateFaxInteraction(_0x50b5ad,_0xc215da,_0x4d522b){return new BPromise(function(_0x3c332a,_0x1f41df){return getInteractionUsers(_0x50b5ad,_0x4d522b)[_0x1798('0x27')](function(_0x15c903){return getInteractionTags(_0x15c903,_0xc215da);})[_0x1798('0x27')](function(_0x36f5e8){_0x3c332a(_0x36f5e8);})[_0x1798('0x2f')](function(_0x54f0dd){_0x1f41df(_0x54f0dd);});});}exports[_0x1798('0x30')]=function(_0x8ec6c1,_0x17f3be){var _0x4afa09={},_0x7b6342={},_0x2e67c3={'count':0x0,'rows':[]};var _0x5a6875=_[_0x1798('0x2a')](db[_0x1798('0x31')]['rawAttributes'],function(_0x3f4d46){return{'name':_0x3f4d46[_0x1798('0x32')],'type':_0x3f4d46[_0x1798('0x33')]['key']};});_0x7b6342['model']=_['map'](_0x5a6875,_0x1798('0x29'));_0x7b6342['query']=_['keys'](_0x8ec6c1['query']);_0x7b6342['filters']=_[_0x1798('0x34')](_0x7b6342[_0x1798('0x35')],_0x7b6342[_0x1798('0x36')]);_0x4afa09[_0x1798('0x37')]=_['intersection'](_0x7b6342[_0x1798('0x35')],qs['fields'](_0x8ec6c1['query'][_0x1798('0x38')]));_0x4afa09[_0x1798('0x37')]=_0x4afa09['attributes'][_0x1798('0x39')]?_0x4afa09[_0x1798('0x37')]:_0x7b6342['model'];if(!_0x8ec6c1[_0x1798('0x36')][_0x1798('0x3a')](_0x1798('0x3b'))){_0x4afa09[_0x1798('0x3c')]=qs['limit'](_0x8ec6c1[_0x1798('0x36')][_0x1798('0x3c')]);_0x4afa09[_0x1798('0x20')]=qs[_0x1798('0x20')](_0x8ec6c1['query'][_0x1798('0x20')]);}_0x4afa09[_0x1798('0x3d')]=qs[_0x1798('0x3e')](_0x8ec6c1[_0x1798('0x36')][_0x1798('0x3e')]);_0x4afa09[_0x1798('0x3f')]=qs[_0x1798('0x40')](_['pick'](_0x8ec6c1['query'],_0x7b6342[_0x1798('0x40')]));var _0x49b777=[];var _0xe38e93=squel[_0x1798('0x41')]()[_0x1798('0x42')]('id')[_0x1798('0x42')](_0x1798('0x29'))['field'](_0x1798('0x43'))[_0x1798('0x44')](_0x1798('0x45'));var _0x5d2dc0=squel['select']()['field'](_0x1798('0x46'))[_0x1798('0x42')](_0x1798('0x47'))[_0x1798('0x42')](_0x1798('0x48'))[_0x1798('0x44')]('user_has_fax_interactions','ui')[_0x1798('0x49')](_0x1798('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x5422e7=squel[_0x1798('0x41')]()[_0x1798('0x44')](_0x1798('0x4b'),'i')[_0x1798('0x49')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0x1798('0x4a'),'o','o.id\x20=\x20i.UserId')[_0x1798('0x49')](_0x1798('0x4c'),'a',_0x1798('0x4d'))['left_join']('fax_messages','me',_0x1798('0x4e'))[_0x1798('0x49')](_0x1798('0x4f'),'it','it.FaxInteractionId\x20=\x20i.id')[_0x1798('0x49')](_0x1798('0x45'),'t',_0x1798('0x50'));var _0x2161f4=squel['expr']();var _0x144f71=[];var _0x1e4a2a=squel['expr']();var _0x1375d6;if(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x51')]){_0x1375d6=as[_0x1798('0x52')](_0x8ec6c1[_0x1798('0x36')][_0x1798('0x51')]);var _0x469c36=_0x1375d6[_0x1798('0x53')];for(var _0x292822=0x0;_0x292822<_0x1375d6[_0x1798('0x54')][_0x1798('0x39')];_0x292822++){var _0x3db61f=_0x1375d6[_0x1798('0x54')][_0x292822];var _0x788006='i';var _0x15de98=_[_0x1798('0x55')](_0x5a6875,['name',_0x3db61f[_0x1798('0x42')]]);if(!_0x15de98){switch(_0x3db61f[_0x1798('0x42')]){case'unreadMessages':if(_0x3db61f[_0x1798('0x56')]==0x1){_0x5422e7[_0x1798('0x57')]('`'+_0x3db61f[_0x1798('0x42')]+_0x1798('0x58'));}else{_0x5422e7['having']('`'+_0x3db61f[_0x1798('0x42')]+_0x1798('0x59'));}break;case _0x1798('0x5a'):if(_0x3db61f[_0x1798('0x5b')]===_0x1798('0x5c')){if(_0x3db61f[_0x1798('0x56')][_0x1798('0x2d')]('\x20')['length']>0x1){_0x2161f4[_0x469c36]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x1798('0x5d')](_0x3db61f[_0x1798('0x56')]),null);}else{var _0x32f178='%'+_0x3db61f[_0x1798('0x56')]+'%';_0x2161f4[_0x469c36](_0x1798('0x5e'),_0x32f178,_0x32f178,_0x32f178);}}else{_0x15de98=_['find'](_0x5a6875,[_0x1798('0x29'),_0x1798('0x5f')]);_0x3db61f[_0x1798('0x42')]=_0x1798('0x5f');_0x361fc2=as[_0x1798('0x60')](_0x788006,_0x15de98[_0x1798('0x33')],_0x3db61f);_0x2161f4[_0x469c36](_0x361fc2[_0x1798('0x61')],_0x361fc2[_0x1798('0x56')][_0x1798('0x62')],_0x361fc2[_0x1798('0x56')][_0x1798('0x1e')]);}break;case _0x1798('0x63'):var _0x5ed6c0=_0x3db61f[_0x1798('0x56')][_0x1798('0x2d')](',')['map'](function(_0x43b93f){return Number(_0x43b93f);});_0x5ed6c0['forEach'](function(_0x2e06f8){_0x1e4a2a['or'](_0x1798('0x64'),'%,'+_0x2e06f8+',%');});_0x144f71=_[_0x1798('0x65')](_0x144f71,_0x5ed6c0);break;case _0x1798('0x66'):if(_0x3db61f[_0x1798('0x5b')]==='$substring'){_0x2161f4[_0x469c36](_0x1798('0x67'),'%'+_0x3db61f[_0x1798('0x56')]+'%',null);}else{_0x15de98=_[_0x1798('0x55')](_0x5a6875,['name',_0x1798('0x68')]);_0x3db61f[_0x1798('0x42')]=_0x1798('0x68');_0x361fc2=as['buildExpression'](_0x788006,_0x15de98[_0x1798('0x33')],_0x3db61f);_0x2161f4[_0x469c36](_0x361fc2[_0x1798('0x61')],_0x361fc2[_0x1798('0x56')][_0x1798('0x62')],_0x361fc2[_0x1798('0x56')][_0x1798('0x1e')]);}break;case'body':_0x361fc2=as['buildExpression']('me',null,_0x3db61f);_0x2161f4[_0x469c36](_0x361fc2[_0x1798('0x61')],_0x361fc2[_0x1798('0x56')][_0x1798('0x62')],_0x361fc2[_0x1798('0x56')]['end']);break;}}else{var _0x361fc2=as[_0x1798('0x60')](_0x788006,_0x15de98[_0x1798('0x33')],_0x3db61f);_0x2161f4[_0x469c36](_0x361fc2['text'],_0x361fc2[_0x1798('0x56')][_0x1798('0x62')],_0x361fc2[_0x1798('0x56')][_0x1798('0x1e')]);}}}else{var _0x86835c=_(_0x8ec6c1[_0x1798('0x36')])['keys']()[_0x1798('0x2a')](function(_0x2ddecb){return _['some'](_0x5a6875,[_0x1798('0x29'),_0x2ddecb])?_0x2ddecb:undefined;})['compact']()[_0x1798('0x56')]();if(!_[_0x1798('0x69')](_0x86835c)){_0x86835c[_0x1798('0x2e')](function(_0x225f2f){if(_0x225f2f==='FaxAccountId'){_0x5422e7[_0x1798('0x3f')]('i.FaxAccountId\x20IN\x20?',[]['concat'](_0x8ec6c1[_0x1798('0x36')][_0x225f2f]));}else if(_0x225f2f===_0x1798('0x6a')){var _0x4899ef=JSON[_0x1798('0x6b')](_0x8ec6c1['query'][_0x225f2f])[_0x1798('0x6c')];var _0x49ac93=JSON[_0x1798('0x6b')](_0x8ec6c1[_0x1798('0x36')][_0x225f2f])[_0x1798('0x6d')];_0x5422e7['where'](_0x1798('0x6e'),_0x4899ef,_0x49ac93);}else{if(_0x8ec6c1[_0x1798('0x36')][_0x225f2f]===_0x1798('0x6f')){_0x5422e7[_0x1798('0x3f')]('i.'+_0x225f2f+'\x20IS\x20NULL');}else{_0x5422e7[_0x1798('0x3f')]('i.'+_0x225f2f+_0x1798('0x70'),_0x8ec6c1['query'][_0x225f2f]);}}});}if(_0x8ec6c1['query'][_0x1798('0x71')]){if(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x71')]==0x1){_0x5422e7[_0x1798('0x57')](_0x1798('0x72'));}else{_0x5422e7[_0x1798('0x57')](_0x1798('0x73'));}}if(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x74')]){_0x144f71=_['isArray'](_0x8ec6c1[_0x1798('0x36')][_0x1798('0x74')])?_0x8ec6c1[_0x1798('0x36')][_0x1798('0x74')]:new Array(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x74')]);_0x144f71[_0x1798('0x2e')](function(_0x372d5f){_0x1e4a2a['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x372d5f+',%');});}if(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x75')]){var _0xa84b4d=_0x8ec6c1[_0x1798('0x36')][_0x1798('0x75')][_0x1798('0x76')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1798('0x77'));if(qs[_0x1798('0x78')](_0xa84b4d)){_0x2161f4['or'](_0x1798('0x79'),_0xa84b4d+'%')['or'](_0x1798('0x7a'),_0xa84b4d+'%');}_0x2161f4['or'](_0x1798('0x7b'),_0xa84b4d+'%');}}_0x5422e7['where'](_0x2161f4);_0x5422e7[_0x1798('0x7c')](_0x1798('0x7d'));var _0x5d9f32={'type':db[_0x1798('0x7e')][_0x1798('0x7f')][_0x1798('0x80')],'raw':!![]};var _0x4b2875=_0x5422e7[_0x1798('0x81')]();_0x4b2875['field'](_0x1798('0x7d'));_0x4b2875['field'](_0x1798('0x82'),_0x1798('0x83'));if(_0x4afa09[_0x1798('0x3d')]){_0x4afa09['order'][_0x1798('0x2e')](function(_0x11093f){_0x5422e7[_0x1798('0x3d')]('i.'+_0x11093f[0x0],_0x11093f[0x1]===_0x1798('0x84')?![]:!![]);});}if(!_[_0x1798('0x69')](_0x144f71)){_0x5422e7[_0x1798('0x57')](_0x1e4a2a);_0x4b2875[_0x1798('0x3f')](_0x1798('0x85'),_0x144f71);}BPromise['resolve']()[_0x1798('0x27')](function(){if(!_0x1375d6){if(_0x8ec6c1['query'][_0x1798('0x86')]||_0x8ec6c1[_0x1798('0x36')]['journey'])return;_0x4b2875[_0x1798('0x3f')](_0x1798('0x87'));_0x5422e7['where'](_0x1798('0x87'));return;}return _0x8ec6c1[_0x1798('0x88')]['getFaxAccounts']({'attributes':['id'],'raw':!![]})['then'](function(_0xad461c){if(_[_0x1798('0x69')](_0xad461c)){_0x4b2875[_0x1798('0x3f')](_0x1798('0x89'));_0x5422e7[_0x1798('0x3f')](_0x1798('0x89'));}else{_0x4b2875['where'](_0x1798('0x8a'),_[_0x1798('0x2a')](_0xad461c,'id'));_0x5422e7['where'](_0x1798('0x8a'),_[_0x1798('0x2a')](_0xad461c,'id'));}});})[_0x1798('0x27')](function(){db['sequelize'][_0x1798('0x36')](_0x4b2875['toString'](),_0x5d9f32)['then'](function(_0x3a1ec7){_0x2e67c3[_0x1798('0x8b')]=_0x3a1ec7[_0x1798('0x39')];if(_0x2e67c3['count']===0x0)return[];return db[_0x1798('0x8c')][_0x1798('0x36')](_0xe38e93['toString'](),_0x5d9f32)[_0x1798('0x27')](function(_0x9107b5){_0x49b777=_['keyBy'](_0x9107b5,'id');_0x5d9f32=_[_0x1798('0x8d')](_0x5d9f32,{'model':db[_0x1798('0x31')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x8ec6c1[_0x1798('0x36')][_0x1798('0x38')]){_0x4afa09[_0x1798('0x37')][_0x1798('0x2e')](function(_0x473877){_0x5422e7[_0x1798('0x42')]('i.'+_0x473877);});}else{_0x5422e7['field'](_0x1798('0x82'),'unreadMessages');_0x5422e7['field']('a.key','Account.key');_0x5422e7[_0x1798('0x42')](_0x1798('0x8e'),_0x1798('0x8f'));_0x5422e7[_0x1798('0x42')](_0x1798('0x90'));_0x5422e7[_0x1798('0x42')](_0x1798('0x91'),_0x1798('0x92'));_0x5422e7[_0x1798('0x42')](_0x1798('0x93'),_0x1798('0x94'));_0x5422e7[_0x1798('0x42')](_0x1798('0x95'),_0x1798('0x96'));_0x5422e7[_0x1798('0x42')](_0x1798('0x97'),_0x1798('0x98'));_0x5422e7[_0x1798('0x42')]('c.mobile',_0x1798('0x99'));_0x5422e7[_0x1798('0x42')](_0x1798('0x9a'),'Contact.fax');_0x5422e7[_0x1798('0x42')](_0x1798('0x9b'),_0x1798('0x9c'));_0x5422e7['field'](_0x1798('0x9d'),_0x1798('0x9e'));_0x5422e7['field'](_0x1798('0x9f'),_0x1798('0x2b'));}_0x5422e7[_0x1798('0x3c')](_0x4afa09[_0x1798('0x3c')]);_0x5422e7['offset'](_0x4afa09[_0x1798('0x20')]);return db[_0x1798('0x8c')]['query'](_0x5422e7['toString'](),_0x5d9f32);})[_0x1798('0x27')](function(_0x481515){_0x5d2dc0['where'](_0x1798('0xa0'),_[_0x1798('0x2a')](_0x481515,'id'));return db[_0x1798('0x8c')][_0x1798('0x36')](_0x5d2dc0['toString'](),_0x5d9f32)[_0x1798('0x27')](function(_0xb18259){var _0x37ab40=_[_0x1798('0xa1')](_0xb18259,_0x1798('0xa2'));var _0x2eeb97=[];_0x481515[_0x1798('0x2e')](function(_0x3a6545){_0x2eeb97[_0x1798('0xa3')](updateFaxInteraction(_0x3a6545,_0x49b777,_0x37ab40));});return BPromise[_0x1798('0xa4')](_0x2eeb97);});});})['then'](function(_0x5c63c2){_0x2e67c3[_0x1798('0xa5')]=_0x5c63c2;return _0x2e67c3;})[_0x1798('0x27')](respondWithFilteredResult(_0x17f3be,_0x4afa09));})[_0x1798('0x2f')](handleError(_0x17f3be,null));};exports[_0x1798('0xa6')]=function(_0x5e9506,_0x222786){var _0x32c4f6={'raw':![],'where':{'id':_0x5e9506[_0x1798('0xa7')]['id']}},_0x2e76ac={};_0x2e76ac['model']=_[_0x1798('0xa8')](db[_0x1798('0x31')][_0x1798('0xa9')]);_0x2e76ac[_0x1798('0x36')]=_[_0x1798('0xa8')](_0x5e9506[_0x1798('0x36')]);_0x2e76ac[_0x1798('0x40')]=_[_0x1798('0x34')](_0x2e76ac[_0x1798('0x35')],_0x2e76ac['query']);_0x32c4f6[_0x1798('0x37')]=_[_0x1798('0x34')](_0x2e76ac['model'],qs['fields'](_0x5e9506[_0x1798('0x36')][_0x1798('0x38')]));_0x32c4f6[_0x1798('0x37')]=_0x32c4f6['attributes'][_0x1798('0x39')]?_0x32c4f6[_0x1798('0x37')]:_0x2e76ac['model'];if(_0x5e9506['query']['includeAll']){_0x32c4f6[_0x1798('0xaa')]=[{'all':!![]}];}_0x32c4f6=_['merge']({},_0x32c4f6,_0x5e9506[_0x1798('0xab')]);return db[_0x1798('0x31')][_0x1798('0x55')](_0x32c4f6)[_0x1798('0x27')](handleEntityNotFound(_0x222786,null))[_0x1798('0x27')](respondWithResult(_0x222786,null))[_0x1798('0x2f')](handleError(_0x222786,null));};exports[_0x1798('0xac')]=function(_0x41377f,_0x36a507){return db['FaxInteraction'][_0x1798('0xac')](_0x41377f['body'],{})[_0x1798('0x27')](respondWithResult(_0x36a507,0xc9))[_0x1798('0x2f')](handleError(_0x36a507,null));};exports['update']=function(_0x278234,_0x41bc3a){if(_0x278234[_0x1798('0xad')]['id']){delete _0x278234['body']['id'];}return db[_0x1798('0x31')][_0x1798('0x55')]({'where':{'id':_0x278234[_0x1798('0xa7')]['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x41bc3a,null))[_0x1798('0x27')](saveUpdates(_0x278234[_0x1798('0xad')],null))[_0x1798('0x27')](respondWithResult(_0x41bc3a,null))[_0x1798('0x2f')](handleError(_0x41bc3a,null));};exports[_0x1798('0xae')]=function(_0x36949e,_0x54ef65){return db['FaxInteraction']['find']({'where':{'id':_0x36949e['params']['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x54ef65,null))['then'](removeEntity(_0x54ef65,null))['catch'](handleError(_0x54ef65,null));};exports[_0x1798('0xaf')]=function(_0x430948,_0x20ea16){return db['FaxInteraction'][_0x1798('0xaf')]()[_0x1798('0x27')](respondWithResult(_0x20ea16,null))[_0x1798('0x2f')](handleError(_0x20ea16,null));};exports[_0x1798('0xb0')]=function(_0x382714,_0x43ca77,_0x574815){return db[_0x1798('0xb1')][_0x1798('0x55')]({'where':{'id':_0x382714[_0x1798('0xa7')]['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x43ca77,null))['then'](function(_0x298fbc){if(_0x298fbc){return _0x298fbc[_0x1798('0xb0')](_0x382714[_0x1798('0xad')][_0x1798('0xb2')],_[_0x1798('0xb3')](_0x382714[_0x1798('0xad')],[_0x1798('0xb2'),'id'])||{});}})[_0x1798('0x27')](respondWithResult(_0x43ca77,null))[_0x1798('0x2f')](handleError(_0x43ca77,null));};exports['getMessages']=function(_0x44cc6d,_0x3312da,_0x593d54){var _0x382394={'raw':![],'where':{}};var _0xc6b1e9={};var _0x3e2f14={'count':0x0,'rows':[]};return db[_0x1798('0x31')][_0x1798('0xb4')]({'where':{'id':_0x44cc6d[_0x1798('0xa7')]['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x3312da,null))['then'](function(_0x4e2291){if(_0x4e2291){_0xc6b1e9[_0x1798('0x35')]=_[_0x1798('0xa8')](db[_0x1798('0xb1')]['rawAttributes']);_0xc6b1e9['query']=_['keys'](_0x44cc6d[_0x1798('0x36')]);_0xc6b1e9['filters']=_[_0x1798('0x34')](_0xc6b1e9[_0x1798('0x35')],_0xc6b1e9[_0x1798('0x36')]);_0x382394[_0x1798('0x37')]=_[_0x1798('0x34')](_0xc6b1e9[_0x1798('0x35')],qs['fields'](_0x44cc6d[_0x1798('0x36')][_0x1798('0x38')]));_0x382394['attributes']=_0x382394['attributes'][_0x1798('0x39')]?_0x382394[_0x1798('0x37')]:_0xc6b1e9[_0x1798('0x35')];if(!_0x44cc6d['query'][_0x1798('0x3a')]('nolimit')){_0x382394['limit']=qs[_0x1798('0x3c')](_0x44cc6d[_0x1798('0x36')][_0x1798('0x3c')]);_0x382394[_0x1798('0x20')]=qs[_0x1798('0x20')](_0x44cc6d[_0x1798('0x36')][_0x1798('0x20')]);}_0x382394[_0x1798('0x3d')]=qs[_0x1798('0x3e')](_0x44cc6d[_0x1798('0x36')][_0x1798('0x3e')]);_0x382394[_0x1798('0x3f')]=qs[_0x1798('0x40')](_['pick'](_0x44cc6d['query'],_0xc6b1e9[_0x1798('0x40')]));_0x382394[_0x1798('0x3f')][_0x1798('0xa2')]=_0x4e2291['id'];if(_0x44cc6d[_0x1798('0x36')]['filter']){_0x382394['where']=_['merge'](_0x382394[_0x1798('0x3f')],{'$or':_[_0x1798('0x2a')](_0x382394['attributes'],function(_0x42bbf){var _0x1a6057={};_0x1a6057[_0x42bbf]={'$like':'%'+_0x44cc6d[_0x1798('0x36')]['filter']+'%'};return _0x1a6057;})});}if(_0x44cc6d[_0x1798('0x36')]['$gte']){var _0x21e97d=_0x44cc6d[_0x1798('0x36')]['$gte'][_0x1798('0x2d')](',');var _0x511edf={};_0x511edf[_0x21e97d[0x0]]={'$gte':moment(_0x21e97d[0x1])[_0x1798('0xb5')](_0x1798('0xb6'))};_0x382394[_0x1798('0x3f')]=_[_0x1798('0x8d')](_0x382394['where'],_0x511edf);}_0x382394=_[_0x1798('0x8d')]({},_0x382394,_0x44cc6d['options']);return db['FaxMessage'][_0x1798('0x8b')]({'where':_0x382394[_0x1798('0x3f')]})['then'](function(_0x517e71){_0x3e2f14[_0x1798('0x8b')]=_0x517e71;if(_0x44cc6d[_0x1798('0x36')]['includeAll']){_0x382394[_0x1798('0xaa')]=[{'all':!![]}];}return db[_0x1798('0xb1')][_0x1798('0xb7')](_0x382394);})[_0x1798('0x27')](function(_0x55667c){_0x3e2f14[_0x1798('0xa5')]=_0x55667c;return _0x3e2f14;});}})[_0x1798('0x27')](respondWithFilteredResult(_0x3312da,_0x382394))[_0x1798('0x2f')](handleError(_0x3312da,null));};exports['addTags']=function(_0x584727,_0x38b84c,_0x121368){return db['FaxInteraction'][_0x1798('0x55')]({'where':{'id':_0x584727['params']['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x38b84c,null))[_0x1798('0x27')](function(_0x3242d1){if(_0x3242d1){return _0x3242d1[_0x1798('0xb8')](_0x584727[_0x1798('0xad')]['ids'],_[_0x1798('0xb3')](_0x584727['body'],[_0x1798('0xb2'),'id'])||{})[_0x1798('0xb9')](function(){return db[_0x1798('0x63')][_0x1798('0xb7')]({'attributes':['id','name',_0x1798('0x43')],'where':{'id':_0x584727[_0x1798('0xad')][_0x1798('0xb2')]}});})['then'](function(_0x1b0f01){socket[_0x1798('0xba')](_0x1798('0xbb'),{'id':Number(_0x584727[_0x1798('0xa7')]['id']),'tags':_0x1b0f01||[]});return{'id':Number(_0x584727[_0x1798('0xa7')]['id']),'tags':_0x1b0f01||[]};});}})[_0x1798('0x27')](respondWithResult(_0x38b84c,null))['catch'](handleError(_0x38b84c,null));};exports[_0x1798('0xbc')]=function(_0x36bfd8,_0x32be19,_0x528b9e){return db['FaxInteraction']['find']({'where':{'id':_0x36bfd8[_0x1798('0xa7')]['id']}})[_0x1798('0x27')](handleEntityNotFound(_0x32be19,null))['then'](function(_0xf604e1){if(_0xf604e1){return _0xf604e1['removeTags'](_0x36bfd8[_0x1798('0x36')][_0x1798('0xb2')]);}})[_0x1798('0x27')](respondWithStatusCode(_0x32be19,null))[_0x1798('0x2f')](handleError(_0x32be19,null));};exports[_0x1798('0xbd')]=function(_0x4c549c,_0x463dda){var _0x313123=moment()[_0x1798('0xbe')]()['toString']();var _0x57512d=path[_0x1798('0xbf')](config[_0x1798('0xc0')],_0x1798('0xc1'),_0x1798('0xc2'),'tmp');var _0x5bed72=path[_0x1798('0xbf')](config[_0x1798('0xc0')],_0x1798('0xc1'),_0x1798('0xc2'),_0x1798('0xc3'));var _0x217387=path[_0x1798('0xbf')](_0x57512d,_0x313123);var _0x53edc2=util[_0x1798('0xb5')](_0x1798('0xc4'),_0x4c549c[_0x1798('0xa7')]['id'],_0x313123);var _0x299278=path['join'](_0x57512d,_0x53edc2);var _0x2f2dda=[];_0x2f2dda[_0x1798('0xa3')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});var _0xb86c7a=[{'model':db[_0x1798('0xb1')],'as':_0x1798('0xc5'),'attributes':['id','body','createdAt'],'include':_0x2f2dda}];return db[_0x1798('0x31')][_0x1798('0x55')]({'where':{'id':_0x4c549c[_0x1798('0xa7')]['id']},'include':_0xb86c7a})['then'](handleEntityNotFound(_0x463dda,null))[_0x1798('0x27')](function(_0x2ef86c){if(_0x2ef86c&&_0x2ef86c[_0x1798('0xc5')]){var _0x4959e6=_0x2ef86c[_0x1798('0xc6')]({'plain':!![]});fs[_0x1798('0xc7')](_0x217387);for(var _0x34f31d=0x0;_0x34f31d<_0x4959e6['Messages'][_0x1798('0x39')];_0x34f31d++){var _0x3a2df7=_0x4959e6[_0x1798('0xc5')][_0x34f31d][_0x1798('0xc8')];if(_0x3a2df7){var _0x14e6ab=path['join'](_0x5bed72,_0x3a2df7[_0x1798('0xc9')]);if(fs[_0x1798('0xca')](_0x14e6ab)){fs[_0x1798('0xcb')](_0x14e6ab)['pipe'](fs['createWriteStream'](path[_0x1798('0xbf')](_0x217387,_0x3a2df7[_0x1798('0xc9')])));}}}return BPromise[_0x1798('0xcc')]()[_0x1798('0x27')](function(){return new BPromise(function(_0x358762,_0x8e74e8){zipdir(_0x217387,{'saveTo':_0x299278},function(_0x5435ef,_0x11e19a){if(_0x5435ef)return _0x8e74e8(_0x5435ef);return _0x358762(_0x11e19a);});})[_0x1798('0x27')](function(){return new BPromise(function(_0x80d7da,_0x321c82){rimraf(_0x217387,function(_0x373ac3){if(_0x373ac3)_0x321c82(_0x373ac3);return _0x80d7da();});});})[_0x1798('0x27')](function(){return _0x463dda[_0x1798('0xbd')](_0x299278,_0x53edc2,function(_0xca7e1e){if(_0xca7e1e){console[_0x1798('0xcd')](_0x1798('0xce'),_0xca7e1e);}else{fs['unlinkSync'](_0x299278);}});});});}else{return _0x463dda[_0x1798('0x1d')](0xc8);}})[_0x1798('0x2f')](handleError(_0x463dda,null));}; \ No newline at end of file +var _0xc81a=['include','options','create','update','describe','FaxMessage','addMessage','ids','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','faxInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','push','Attachment','Messages','get','mkdirSync','existsSync','pipe','createWriteStream','basename','log','sendStatus','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','socket.io-emitter','./faxInteraction.socket','register','status','json','count','offset','set','Content-Range','apply','reject','save','then','destroy','end','stack','name','send','Users','map','fullname','Tags','split','forEach','TagIds','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.FaxInteractionId','user_has_fax_interactions','users','u.id\x20=\x20ui.UserId','fax_interactions','left_join','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','a.id\x20=\x20i.FaxAccountId','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','conditions','find','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','buildExpression','body','compact','FaxAccountId','where','i.FaxAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','read','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','Sequelize','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','t.id\x20IN\x20?','i.FaxAccountId\x20IS\x20NOT\x20NULL','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','c.fax','Contact.fax','o.fullname','Owner.fullname','ui.FaxInteractionId\x20IN\x20?','all','rows','show','params','includeAll'];(function(_0x1eb216,_0x2f2f32){var _0x19dc1c=function(_0xee47e8){while(--_0xee47e8){_0x1eb216['push'](_0x1eb216['shift']());}};_0x19dc1c(++_0x2f2f32);}(_0xc81a,0x1bd));var _0xac81=function(_0x1ec73d,_0x54a8ff){_0x1ec73d=_0x1ec73d-0x0;var _0x2f5dc1=_0xc81a[_0x1ec73d];return _0x2f5dc1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xac81('0x0'));var rimraf=require(_0xac81('0x1'));var zipdir=require(_0xac81('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xac81('0x3'));var moment=require(_0xac81('0x4'));var BPromise=require(_0xac81('0x5'));var Mustache=require(_0xac81('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xac81('0x7'));var fs=require('fs');var _=require(_0xac81('0x8'));var squel=require(_0xac81('0x9'));var crypto=require('crypto');var jsforce=require(_0xac81('0xa'));var deskjs=require(_0xac81('0xb'));var toCsv=require(_0xac81('0xc'));var querystring=require(_0xac81('0xd'));var Papa=require(_0xac81('0xe'));var Redis=require('ioredis');var authService=require(_0xac81('0xf'));var qs=require(_0xac81('0x10'));var as=require(_0xac81('0x11'));var hardwareService=require(_0xac81('0x12'));var logger=require(_0xac81('0x13'))(_0xac81('0x14'));var utils=require(_0xac81('0x15'));var config=require('../../config/environment');var db=require(_0xac81('0x16'))['db'];config[_0xac81('0x17')]=_['defaults'](config[_0xac81('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xac81('0x18'))(new Redis(config[_0xac81('0x17')]));require(_0xac81('0x19'))[_0xac81('0x1a')](socket);function respondWithStatusCode(_0x1f6d88,_0x578949){_0x578949=_0x578949||0xcc;return function(_0x25d234){if(_0x25d234){return _0x1f6d88['sendStatus'](_0x578949);}return _0x1f6d88[_0xac81('0x1b')](_0x578949)['end']();};}function respondWithResult(_0x3d433c,_0x16b520){_0x16b520=_0x16b520||0xc8;return function(_0x211589){if(_0x211589){return _0x3d433c['status'](_0x16b520)[_0xac81('0x1c')](_0x211589);}};}function respondWithFilteredResult(_0x1e7c8d,_0x2332e0){return function(_0x68b7d1){if(_0x68b7d1){var _0x5cb05c=_0x68b7d1[_0xac81('0x1d')],_0x49c5f2=_0x2332e0[_0xac81('0x1e')],_0x3759e2=_0x2332e0['offset']+_0x2332e0['limit'],_0x432a76;if(_0x3759e2>=_0x5cb05c){_0x3759e2=_0x5cb05c;_0x432a76=0xc8;}else{_0x432a76=0xce;}_0x1e7c8d['status'](_0x432a76);return _0x1e7c8d[_0xac81('0x1f')](_0xac81('0x20'),_0x49c5f2+'-'+_0x3759e2+'/'+_0x5cb05c)[_0xac81('0x1c')](_0x68b7d1);}return null;};}function patchUpdates(_0x4aed95){return function(_0x2c4449){try{jsonpatch[_0xac81('0x21')](_0x2c4449,_0x4aed95,!![]);}catch(_0x155bca){return BPromise[_0xac81('0x22')](_0x155bca);}return _0x2c4449[_0xac81('0x23')]();};}function saveUpdates(_0x17fe98,_0x3c25da){return function(_0x1ce387){if(_0x1ce387){return _0x1ce387['update'](_0x17fe98)[_0xac81('0x24')](function(_0x181864){return _0x181864;});}return null;};}function removeEntity(_0x372463,_0x1ee4ad){return function(_0x40c094){if(_0x40c094){return _0x40c094[_0xac81('0x25')]()[_0xac81('0x24')](function(){_0x372463[_0xac81('0x1b')](0xcc)[_0xac81('0x26')]();});}};}function handleEntityNotFound(_0x3745a6,_0x21c3a2){return function(_0x5351d8){if(!_0x5351d8){_0x3745a6['sendStatus'](0x194);}return _0x5351d8;};}function handleError(_0x1b9b93,_0x5e3406){_0x5e3406=_0x5e3406||0x1f4;return function(_0x1e3744){logger['error'](_0x1e3744[_0xac81('0x27')]);if(_0x1e3744[_0xac81('0x28')]){delete _0x1e3744[_0xac81('0x28')];}_0x1b9b93[_0xac81('0x1b')](_0x5e3406)[_0xac81('0x29')](_0x1e3744);};}function getInteractionUsers(_0x6eae6b,_0x2be190){return new BPromise(function(_0x466961,_0x3010bb){try{if(_0x2be190[_0x6eae6b['id']]){_0x6eae6b[_0xac81('0x2a')]=_[_0xac81('0x2b')](_0x2be190[_0x6eae6b['id']],function(_0x5bdb61){return{'id':_0x5bdb61['id'],'fullname':_0x5bdb61[_0xac81('0x2c')]};});}}catch(_0x404b88){_0x3010bb(_0x404b88);}_0x466961(_0x6eae6b);});}function getInteractionTags(_0x14b812,_0x5a71b0){return new BPromise(function(_0x13e504,_0x390d80){try{if(_0x14b812['TagIds']){_0x14b812[_0xac81('0x2d')]=[];_0x14b812['TagIds'][_0xac81('0x2e')](',')[_0xac81('0x2f')](function(_0x9268ca){_0x14b812[_0xac81('0x2d')]['push'](_0x5a71b0[_0x9268ca]);});}delete _0x14b812[_0xac81('0x30')];}catch(_0x32d6c9){_0x390d80(_0x32d6c9);}_0x13e504(_0x14b812);});}function updateFaxInteraction(_0x47e79c,_0x468d25,_0x5b0fa8){return new BPromise(function(_0x4fa597,_0x599484){return getInteractionUsers(_0x47e79c,_0x5b0fa8)[_0xac81('0x24')](function(_0x23a793){return getInteractionTags(_0x23a793,_0x468d25);})['then'](function(_0x24b6af){_0x4fa597(_0x24b6af);})[_0xac81('0x31')](function(_0x26d726){_0x599484(_0x26d726);});});}exports[_0xac81('0x32')]=function(_0x337ce0,_0x30963b){var _0x719d0c={},_0x258897={},_0x2fdab5={'count':0x0,'rows':[]};var _0x4138c4=_[_0xac81('0x2b')](db[_0xac81('0x33')][_0xac81('0x34')],function(_0x2b4f1e){return{'name':_0x2b4f1e[_0xac81('0x35')],'type':_0x2b4f1e[_0xac81('0x36')][_0xac81('0x37')]};});_0x258897['model']=_[_0xac81('0x2b')](_0x4138c4,_0xac81('0x28'));_0x258897[_0xac81('0x38')]=_[_0xac81('0x39')](_0x337ce0[_0xac81('0x38')]);_0x258897[_0xac81('0x3a')]=_[_0xac81('0x3b')](_0x258897[_0xac81('0x3c')],_0x258897[_0xac81('0x38')]);_0x719d0c[_0xac81('0x3d')]=_['intersection'](_0x258897['model'],qs['fields'](_0x337ce0['query'][_0xac81('0x3e')]));_0x719d0c[_0xac81('0x3d')]=_0x719d0c['attributes'][_0xac81('0x3f')]?_0x719d0c[_0xac81('0x3d')]:_0x258897[_0xac81('0x3c')];if(!_0x337ce0['query'][_0xac81('0x40')](_0xac81('0x41'))){_0x719d0c[_0xac81('0x42')]=qs['limit'](_0x337ce0[_0xac81('0x38')][_0xac81('0x42')]);_0x719d0c[_0xac81('0x1e')]=qs[_0xac81('0x1e')](_0x337ce0['query'][_0xac81('0x1e')]);}_0x719d0c[_0xac81('0x43')]=qs[_0xac81('0x44')](_0x337ce0[_0xac81('0x38')]['sort']);_0x719d0c['where']=qs[_0xac81('0x3a')](_[_0xac81('0x45')](_0x337ce0[_0xac81('0x38')],_0x258897[_0xac81('0x3a')]));var _0x2be8d5=[];var _0x5351b8=squel[_0xac81('0x46')]()['field']('id')[_0xac81('0x47')]('name')[_0xac81('0x47')](_0xac81('0x48'))[_0xac81('0x49')](_0xac81('0x4a'));var _0x4c3b84=squel[_0xac81('0x46')]()[_0xac81('0x47')](_0xac81('0x4b'))[_0xac81('0x47')](_0xac81('0x4c'))['field'](_0xac81('0x4d'))[_0xac81('0x49')](_0xac81('0x4e'),'ui')['left_join'](_0xac81('0x4f'),'u',_0xac81('0x50'));var _0x2ccb77=squel[_0xac81('0x46')]()[_0xac81('0x49')](_0xac81('0x51'),'i')[_0xac81('0x52')]('cm_contacts','c',_0xac81('0x53'))[_0xac81('0x52')](_0xac81('0x4f'),'o',_0xac81('0x54'))['left_join'](_0xac81('0x55'),'a',_0xac81('0x56'))[_0xac81('0x52')]('fax_messages','me',_0xac81('0x57'))['left_join'](_0xac81('0x58'),'it',_0xac81('0x59'))[_0xac81('0x52')]('tools_tags','t',_0xac81('0x5a'));var _0x4051fd=squel[_0xac81('0x5b')]();var _0x1ec40f=[];var _0x4880da=squel['expr']();var _0x200fea;if(_0x337ce0[_0xac81('0x38')][_0xac81('0x5c')]){_0x200fea=as['parseSearch'](_0x337ce0[_0xac81('0x38')]['search']);var _0x2adc2b=_0x200fea['sqlOperator'];for(var _0x582674=0x0;_0x582674<_0x200fea[_0xac81('0x5d')][_0xac81('0x3f')];_0x582674++){var _0x28a72b=_0x200fea[_0xac81('0x5d')][_0x582674];var _0x8bf757='i';var _0x4d9bfa=_[_0xac81('0x5e')](_0x4138c4,[_0xac81('0x28'),_0x28a72b[_0xac81('0x47')]]);if(!_0x4d9bfa){switch(_0x28a72b[_0xac81('0x47')]){case'unreadMessages':if(_0x28a72b[_0xac81('0x5f')]==0x1){_0x2ccb77[_0xac81('0x60')]('`'+_0x28a72b[_0xac81('0x47')]+_0xac81('0x61'));}else{_0x2ccb77[_0xac81('0x60')]('`'+_0x28a72b[_0xac81('0x47')]+_0xac81('0x62'));}break;case _0xac81('0x63'):if(_0x28a72b[_0xac81('0x64')]===_0xac81('0x65')){if(_0x28a72b[_0xac81('0x5f')][_0xac81('0x2e')]('\x20')[_0xac81('0x3f')]>0x1){_0x4051fd[_0x2adc2b](_0xac81('0x66'),qs[_0xac81('0x67')](_0x28a72b[_0xac81('0x5f')]),null);}else{var _0x925137='%'+_0x28a72b['value']+'%';_0x4051fd[_0x2adc2b](_0xac81('0x68'),_0x925137,_0x925137,_0x925137);}}else{_0x4d9bfa=_[_0xac81('0x5e')](_0x4138c4,[_0xac81('0x28'),'ContactId']);_0x28a72b[_0xac81('0x47')]='ContactId';_0x4f39a2=as['buildExpression'](_0x8bf757,_0x4d9bfa[_0xac81('0x36')],_0x28a72b);_0x4051fd[_0x2adc2b](_0x4f39a2[_0xac81('0x69')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x6a')],_0x4f39a2[_0xac81('0x5f')]['end']);}break;case _0xac81('0x6b'):var _0x13cba5=_0x28a72b[_0xac81('0x5f')][_0xac81('0x2e')](',')[_0xac81('0x2b')](function(_0x25aa97){return Number(_0x25aa97);});_0x13cba5[_0xac81('0x2f')](function(_0x37f5e8){_0x4880da['or'](_0xac81('0x6c'),'%,'+_0x37f5e8+',%');});_0x1ec40f=_[_0xac81('0x6d')](_0x1ec40f,_0x13cba5);break;case _0xac81('0x6e'):if(_0x28a72b[_0xac81('0x64')]===_0xac81('0x65')){_0x4051fd[_0x2adc2b](_0xac81('0x6f'),'%'+_0x28a72b[_0xac81('0x5f')]+'%',null);}else{_0x4d9bfa=_[_0xac81('0x5e')](_0x4138c4,[_0xac81('0x28'),'UserId']);_0x28a72b[_0xac81('0x47')]='UserId';_0x4f39a2=as[_0xac81('0x70')](_0x8bf757,_0x4d9bfa[_0xac81('0x36')],_0x28a72b);_0x4051fd[_0x2adc2b](_0x4f39a2[_0xac81('0x69')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x6a')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x26')]);}break;case _0xac81('0x71'):_0x4f39a2=as[_0xac81('0x70')]('me',null,_0x28a72b);_0x4051fd[_0x2adc2b](_0x4f39a2[_0xac81('0x69')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x6a')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x26')]);break;}}else{var _0x4f39a2=as['buildExpression'](_0x8bf757,_0x4d9bfa['type'],_0x28a72b);_0x4051fd[_0x2adc2b](_0x4f39a2[_0xac81('0x69')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x6a')],_0x4f39a2[_0xac81('0x5f')][_0xac81('0x26')]);}}}else{var _0x12b620=_(_0x337ce0[_0xac81('0x38')])[_0xac81('0x39')]()[_0xac81('0x2b')](function(_0x4082bc){return _['some'](_0x4138c4,[_0xac81('0x28'),_0x4082bc])?_0x4082bc:undefined;})[_0xac81('0x72')]()['value']();if(!_['isEmpty'](_0x12b620)){_0x12b620[_0xac81('0x2f')](function(_0x13cae8){if(_0x13cae8===_0xac81('0x73')){_0x2ccb77[_0xac81('0x74')](_0xac81('0x75'),[]['concat'](_0x337ce0[_0xac81('0x38')][_0x13cae8]));}else if(_0x13cae8===_0xac81('0x76')){var _0x1e765f=JSON[_0xac81('0x77')](_0x337ce0[_0xac81('0x38')][_0x13cae8])[_0xac81('0x78')];var _0x30b0c4=JSON[_0xac81('0x77')](_0x337ce0[_0xac81('0x38')][_0x13cae8])['$lte'];_0x2ccb77['where'](_0xac81('0x79'),_0x1e765f,_0x30b0c4);}else{if(_0x337ce0['query'][_0x13cae8]===_0xac81('0x7a')){_0x2ccb77[_0xac81('0x74')]('i.'+_0x13cae8+'\x20IS\x20NULL');}else{_0x2ccb77['where']('i.'+_0x13cae8+'\x20=\x20?',_0x337ce0[_0xac81('0x38')][_0x13cae8]);}}});}if(_0x337ce0[_0xac81('0x38')]['read']){if(_0x337ce0['query'][_0xac81('0x7b')]==0x1){_0x2ccb77[_0xac81('0x60')](_0xac81('0x7c'));}else{_0x2ccb77[_0xac81('0x60')]('`unreadMessages`\x20>\x200');}}if(_0x337ce0['query'][_0xac81('0x7d')]){_0x1ec40f=_['isArray'](_0x337ce0[_0xac81('0x38')][_0xac81('0x7d')])?_0x337ce0[_0xac81('0x38')][_0xac81('0x7d')]:new Array(_0x337ce0[_0xac81('0x38')][_0xac81('0x7d')]);_0x1ec40f[_0xac81('0x2f')](function(_0x5a9b4){_0x4880da['or'](_0xac81('0x6c'),'%,'+_0x5a9b4+',%');});}if(_0x337ce0['query']['filter']){var _0x5f049e=_0x337ce0[_0xac81('0x38')][_0xac81('0x7e')][_0xac81('0x7f')]('\x5c','\x5c\x5c')[_0xac81('0x7f')]('\x27\x27',_0xac81('0x80'));if(qs['isNumeric'](_0x5f049e)){_0x4051fd['or'](_0xac81('0x81'),_0x5f049e+'%')['or']('i.fax\x20LIKE\x20?',_0x5f049e+'%');}_0x4051fd['or'](_0xac81('0x82'),_0x5f049e+'%');}}_0x2ccb77[_0xac81('0x74')](_0x4051fd);_0x2ccb77['group']('i.id');var _0x59abb2={'type':db[_0xac81('0x83')]['QueryTypes'][_0xac81('0x84')],'raw':!![]};var _0x473b58=_0x2ccb77[_0xac81('0x85')]();_0x473b58[_0xac81('0x47')](_0xac81('0x86'));_0x473b58[_0xac81('0x47')](_0xac81('0x87'),_0xac81('0x88'));if(_0x719d0c[_0xac81('0x43')]){_0x719d0c['order'][_0xac81('0x2f')](function(_0x4c7350){_0x2ccb77[_0xac81('0x43')]('i.'+_0x4c7350[0x0],_0x4c7350[0x1]===_0xac81('0x89')?![]:!![]);});}if(!_[_0xac81('0x8a')](_0x1ec40f)){_0x2ccb77[_0xac81('0x60')](_0x4880da);_0x473b58[_0xac81('0x74')](_0xac81('0x8b'),_0x1ec40f);}BPromise['resolve']()['then'](function(){if(!_0x200fea){if(_0x337ce0[_0xac81('0x38')]['FaxAccountId']||_0x337ce0[_0xac81('0x38')]['journey'])return;_0x473b58[_0xac81('0x74')]('i.FaxAccountId\x20IS\x20NOT\x20NULL');_0x2ccb77[_0xac81('0x74')](_0xac81('0x8c'));return;}return _0x337ce0['user'][_0xac81('0x8d')]({'attributes':['id'],'raw':!![]})[_0xac81('0x24')](function(_0x48daf7){if(_['isEmpty'](_0x48daf7)){_0x473b58[_0xac81('0x74')](_0xac81('0x8e'));_0x2ccb77[_0xac81('0x74')](_0xac81('0x8e'));}else{_0x473b58[_0xac81('0x74')]('i.FaxAccountId\x20IN\x20?',_['map'](_0x48daf7,'id'));_0x2ccb77[_0xac81('0x74')]('i.FaxAccountId\x20IN\x20?',_[_0xac81('0x2b')](_0x48daf7,'id'));}});})[_0xac81('0x24')](function(){db[_0xac81('0x8f')][_0xac81('0x38')](_0x473b58[_0xac81('0x90')](),_0x59abb2)[_0xac81('0x24')](function(_0x4ed5e0){_0x2fdab5['count']=_0x4ed5e0[_0xac81('0x3f')];if(_0x2fdab5[_0xac81('0x1d')]===0x0)return[];return db[_0xac81('0x8f')]['query'](_0x5351b8[_0xac81('0x90')](),_0x59abb2)[_0xac81('0x24')](function(_0x1bfadf){_0x2be8d5=_[_0xac81('0x91')](_0x1bfadf,'id');_0x59abb2=_[_0xac81('0x92')](_0x59abb2,{'model':db[_0xac81('0x33')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x337ce0['query'][_0xac81('0x3e')]){_0x719d0c[_0xac81('0x3d')][_0xac81('0x2f')](function(_0xa28704){_0x2ccb77[_0xac81('0x47')]('i.'+_0xa28704);});}else{_0x2ccb77[_0xac81('0x47')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');_0x2ccb77['field']('a.key',_0xac81('0x93'));_0x2ccb77[_0xac81('0x47')]('a.mandatoryDisposition',_0xac81('0x94'));_0x2ccb77[_0xac81('0x47')](_0xac81('0x95'));_0x2ccb77[_0xac81('0x47')](_0xac81('0x96'),_0xac81('0x97'));_0x2ccb77[_0xac81('0x47')](_0xac81('0x98'),_0xac81('0x99'));_0x2ccb77[_0xac81('0x47')](_0xac81('0x9a'),_0xac81('0x9b'));_0x2ccb77['field'](_0xac81('0x9c'),'Contact.phone');_0x2ccb77[_0xac81('0x47')]('c.mobile','Contact.mobile');_0x2ccb77[_0xac81('0x47')](_0xac81('0x9d'),_0xac81('0x9e'));_0x2ccb77[_0xac81('0x47')](_0xac81('0x9f'),_0xac81('0xa0'));_0x2ccb77[_0xac81('0x47')]('o.internal','Owner.internal');_0x2ccb77[_0xac81('0x47')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xac81('0x30'));}_0x2ccb77['limit'](_0x719d0c[_0xac81('0x42')]);_0x2ccb77[_0xac81('0x1e')](_0x719d0c['offset']);return db[_0xac81('0x8f')][_0xac81('0x38')](_0x2ccb77['toString'](),_0x59abb2);})[_0xac81('0x24')](function(_0x5c7390){_0x4c3b84[_0xac81('0x74')](_0xac81('0xa1'),_[_0xac81('0x2b')](_0x5c7390,'id'));return db[_0xac81('0x8f')][_0xac81('0x38')](_0x4c3b84[_0xac81('0x90')](),_0x59abb2)[_0xac81('0x24')](function(_0x5a3853){var _0x5be8bf=_['groupBy'](_0x5a3853,'FaxInteractionId');var _0x13b918=[];_0x5c7390['forEach'](function(_0x4157a2){_0x13b918['push'](updateFaxInteraction(_0x4157a2,_0x2be8d5,_0x5be8bf));});return BPromise[_0xac81('0xa2')](_0x13b918);});});})[_0xac81('0x24')](function(_0x4d355b){_0x2fdab5[_0xac81('0xa3')]=_0x4d355b;return _0x2fdab5;})['then'](respondWithFilteredResult(_0x30963b,_0x719d0c));})[_0xac81('0x31')](handleError(_0x30963b,null));};exports[_0xac81('0xa4')]=function(_0x5ca825,_0x5969cd){var _0x304927={'raw':![],'where':{'id':_0x5ca825[_0xac81('0xa5')]['id']}},_0x1e9fb4={};_0x1e9fb4[_0xac81('0x3c')]=_[_0xac81('0x39')](db['FaxInteraction'][_0xac81('0x34')]);_0x1e9fb4[_0xac81('0x38')]=_[_0xac81('0x39')](_0x5ca825['query']);_0x1e9fb4['filters']=_['intersection'](_0x1e9fb4[_0xac81('0x3c')],_0x1e9fb4[_0xac81('0x38')]);_0x304927['attributes']=_[_0xac81('0x3b')](_0x1e9fb4['model'],qs[_0xac81('0x3e')](_0x5ca825[_0xac81('0x38')][_0xac81('0x3e')]));_0x304927[_0xac81('0x3d')]=_0x304927[_0xac81('0x3d')][_0xac81('0x3f')]?_0x304927[_0xac81('0x3d')]:_0x1e9fb4['model'];if(_0x5ca825['query'][_0xac81('0xa6')]){_0x304927[_0xac81('0xa7')]=[{'all':!![]}];}_0x304927=_[_0xac81('0x92')]({},_0x304927,_0x5ca825[_0xac81('0xa8')]);return db['FaxInteraction'][_0xac81('0x5e')](_0x304927)[_0xac81('0x24')](handleEntityNotFound(_0x5969cd,null))[_0xac81('0x24')](respondWithResult(_0x5969cd,null))[_0xac81('0x31')](handleError(_0x5969cd,null));};exports[_0xac81('0xa9')]=function(_0x20f347,_0x19e9be){return db['FaxInteraction'][_0xac81('0xa9')](_0x20f347[_0xac81('0x71')],{})[_0xac81('0x24')](respondWithResult(_0x19e9be,0xc9))[_0xac81('0x31')](handleError(_0x19e9be,null));};exports[_0xac81('0xaa')]=function(_0x231ee0,_0x49f673){if(_0x231ee0['body']['id']){delete _0x231ee0[_0xac81('0x71')]['id'];}return db[_0xac81('0x33')]['find']({'where':{'id':_0x231ee0[_0xac81('0xa5')]['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x49f673,null))[_0xac81('0x24')](saveUpdates(_0x231ee0[_0xac81('0x71')],null))[_0xac81('0x24')](respondWithResult(_0x49f673,null))[_0xac81('0x31')](handleError(_0x49f673,null));};exports[_0xac81('0x25')]=function(_0x177ad1,_0x3cb311){return db[_0xac81('0x33')]['find']({'where':{'id':_0x177ad1['params']['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x3cb311,null))[_0xac81('0x24')](removeEntity(_0x3cb311,null))[_0xac81('0x31')](handleError(_0x3cb311,null));};exports[_0xac81('0xab')]=function(_0x6513aa,_0x33b701){return db[_0xac81('0x33')][_0xac81('0xab')]()[_0xac81('0x24')](respondWithResult(_0x33b701,null))[_0xac81('0x31')](handleError(_0x33b701,null));};exports['addMessage']=function(_0x12bc91,_0x400046,_0x182021){return db[_0xac81('0xac')][_0xac81('0x5e')]({'where':{'id':_0x12bc91[_0xac81('0xa5')]['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x400046,null))['then'](function(_0x53c931){if(_0x53c931){return _0x53c931[_0xac81('0xad')](_0x12bc91[_0xac81('0x71')][_0xac81('0xae')],_['omit'](_0x12bc91[_0xac81('0x71')],[_0xac81('0xae'),'id'])||{});}})[_0xac81('0x24')](respondWithResult(_0x400046,null))[_0xac81('0x31')](handleError(_0x400046,null));};exports[_0xac81('0xaf')]=function(_0x39086f,_0x55138d,_0x4d62a6){var _0x1a417b={'raw':![],'where':{}};var _0x13e0bd={};var _0x4a8925={'count':0x0,'rows':[]};return db[_0xac81('0x33')]['findOne']({'where':{'id':_0x39086f[_0xac81('0xa5')]['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x55138d,null))[_0xac81('0x24')](function(_0x1f0e09){if(_0x1f0e09){_0x13e0bd[_0xac81('0x3c')]=_[_0xac81('0x39')](db[_0xac81('0xac')]['rawAttributes']);_0x13e0bd[_0xac81('0x38')]=_[_0xac81('0x39')](_0x39086f[_0xac81('0x38')]);_0x13e0bd['filters']=_[_0xac81('0x3b')](_0x13e0bd[_0xac81('0x3c')],_0x13e0bd[_0xac81('0x38')]);_0x1a417b[_0xac81('0x3d')]=_[_0xac81('0x3b')](_0x13e0bd[_0xac81('0x3c')],qs[_0xac81('0x3e')](_0x39086f[_0xac81('0x38')][_0xac81('0x3e')]));_0x1a417b['attributes']=_0x1a417b[_0xac81('0x3d')][_0xac81('0x3f')]?_0x1a417b[_0xac81('0x3d')]:_0x13e0bd[_0xac81('0x3c')];if(!_0x39086f['query'][_0xac81('0x40')](_0xac81('0x41'))){_0x1a417b[_0xac81('0x42')]=qs[_0xac81('0x42')](_0x39086f['query'][_0xac81('0x42')]);_0x1a417b[_0xac81('0x1e')]=qs['offset'](_0x39086f[_0xac81('0x38')][_0xac81('0x1e')]);}_0x1a417b[_0xac81('0x43')]=qs[_0xac81('0x44')](_0x39086f[_0xac81('0x38')][_0xac81('0x44')]);_0x1a417b[_0xac81('0x74')]=qs[_0xac81('0x3a')](_[_0xac81('0x45')](_0x39086f[_0xac81('0x38')],_0x13e0bd[_0xac81('0x3a')]));_0x1a417b[_0xac81('0x74')]['FaxInteractionId']=_0x1f0e09['id'];if(_0x39086f[_0xac81('0x38')][_0xac81('0x7e')]){_0x1a417b[_0xac81('0x74')]=_[_0xac81('0x92')](_0x1a417b[_0xac81('0x74')],{'$or':_['map'](_0x1a417b[_0xac81('0x3d')],function(_0x5781b7){var _0xbbc7b8={};_0xbbc7b8[_0x5781b7]={'$like':'%'+_0x39086f[_0xac81('0x38')][_0xac81('0x7e')]+'%'};return _0xbbc7b8;})});}if(_0x39086f['query'][_0xac81('0x78')]){var _0x277404=_0x39086f[_0xac81('0x38')][_0xac81('0x78')][_0xac81('0x2e')](',');var _0x17cd23={};_0x17cd23[_0x277404[0x0]]={'$gte':moment(_0x277404[0x1])[_0xac81('0xb0')](_0xac81('0xb1'))};_0x1a417b[_0xac81('0x74')]=_[_0xac81('0x92')](_0x1a417b['where'],_0x17cd23);}_0x1a417b=_[_0xac81('0x92')]({},_0x1a417b,_0x39086f[_0xac81('0xa8')]);return db[_0xac81('0xac')][_0xac81('0x1d')]({'where':_0x1a417b[_0xac81('0x74')]})['then'](function(_0x437bbe){_0x4a8925['count']=_0x437bbe;if(_0x39086f[_0xac81('0x38')][_0xac81('0xa6')]){_0x1a417b[_0xac81('0xa7')]=[{'all':!![]}];}return db[_0xac81('0xac')][_0xac81('0xb2')](_0x1a417b);})[_0xac81('0x24')](function(_0x4e5217){_0x4a8925[_0xac81('0xa3')]=_0x4e5217;return _0x4a8925;});}})[_0xac81('0x24')](respondWithFilteredResult(_0x55138d,_0x1a417b))[_0xac81('0x31')](handleError(_0x55138d,null));};exports['addTags']=function(_0x184047,_0x4d0900,_0x3b07c1){return db[_0xac81('0x33')][_0xac81('0x5e')]({'where':{'id':_0x184047[_0xac81('0xa5')]['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x4d0900,null))[_0xac81('0x24')](function(_0x528340){if(_0x528340){return _0x528340[_0xac81('0xb3')](_0x184047[_0xac81('0x71')][_0xac81('0xae')],_['omit'](_0x184047[_0xac81('0x71')],[_0xac81('0xae'),'id'])||{})[_0xac81('0xb4')](function(){return db[_0xac81('0x6b')][_0xac81('0xb2')]({'attributes':['id',_0xac81('0x28'),_0xac81('0x48')],'where':{'id':_0x184047[_0xac81('0x71')][_0xac81('0xae')]}});})[_0xac81('0x24')](function(_0x42c536){socket[_0xac81('0xb5')](_0xac81('0xb6'),{'id':Number(_0x184047[_0xac81('0xa5')]['id']),'tags':_0x42c536||[]});return{'id':Number(_0x184047[_0xac81('0xa5')]['id']),'tags':_0x42c536||[]};});}})[_0xac81('0x24')](respondWithResult(_0x4d0900,null))['catch'](handleError(_0x4d0900,null));};exports[_0xac81('0xb7')]=function(_0x31e05f,_0x32a93a,_0x2b0cf8){return db[_0xac81('0x33')][_0xac81('0x5e')]({'where':{'id':_0x31e05f[_0xac81('0xa5')]['id']}})[_0xac81('0x24')](handleEntityNotFound(_0x32a93a,null))[_0xac81('0x24')](function(_0xd31a47){if(_0xd31a47){return _0xd31a47['removeTags'](_0x31e05f[_0xac81('0x38')][_0xac81('0xae')]);}})['then'](respondWithStatusCode(_0x32a93a,null))[_0xac81('0x31')](handleError(_0x32a93a,null));};exports[_0xac81('0xb8')]=function(_0x41cbf9,_0x3184e8){var _0x391e1a=moment()[_0xac81('0xb9')]()['toString']();var _0x552d41=path[_0xac81('0xba')](config[_0xac81('0xbb')],_0xac81('0xbc'),_0xac81('0xbd'),_0xac81('0xbe'));var _0x4e758f=path[_0xac81('0xba')](config['root'],_0xac81('0xbc'),_0xac81('0xbd'),_0xac81('0xbf'));var _0x41e0d4=path[_0xac81('0xba')](_0x552d41,_0x391e1a);var _0xe14375=util['format'](_0xac81('0xc0'),_0x41cbf9[_0xac81('0xa5')]['id'],_0x391e1a);var _0x5dffd9=path[_0xac81('0xba')](_0x552d41,_0xe14375);var _0x2e7828=[];_0x2e7828[_0xac81('0xc1')]({'model':db['Attachment'],'as':_0xac81('0xc2'),'raw':!![]});var _0x15aa6b=[{'model':db[_0xac81('0xac')],'as':_0xac81('0xc3'),'attributes':['id','body',_0xac81('0x76')],'include':_0x2e7828}];return db['FaxInteraction'][_0xac81('0x5e')]({'where':{'id':_0x41cbf9['params']['id']},'include':_0x15aa6b})[_0xac81('0x24')](handleEntityNotFound(_0x3184e8,null))[_0xac81('0x24')](function(_0x23a869){if(_0x23a869&&_0x23a869[_0xac81('0xc3')]){var _0x544329=_0x23a869[_0xac81('0xc4')]({'plain':!![]});fs[_0xac81('0xc5')](_0x41e0d4);for(var _0x2d1f81=0x0;_0x2d1f81<_0x544329[_0xac81('0xc3')]['length'];_0x2d1f81++){var _0x728d17=_0x544329[_0xac81('0xc3')][_0x2d1f81][_0xac81('0xc2')];if(_0x728d17){var _0x25ebde=path[_0xac81('0xba')](_0x4e758f,_0x728d17['basename']);if(fs[_0xac81('0xc6')](_0x25ebde)){fs['createReadStream'](_0x25ebde)[_0xac81('0xc7')](fs[_0xac81('0xc8')](path['join'](_0x41e0d4,_0x728d17[_0xac81('0xc9')])));}}}return BPromise['resolve']()[_0xac81('0x24')](function(){return new BPromise(function(_0x43f19c,_0xe6cafa){zipdir(_0x41e0d4,{'saveTo':_0x5dffd9},function(_0x46ee70,_0x3eea61){if(_0x46ee70)return _0xe6cafa(_0x46ee70);return _0x43f19c(_0x3eea61);});})['then'](function(){return new BPromise(function(_0x2cd8bd,_0x1bba31){rimraf(_0x41e0d4,function(_0x1b0342){if(_0x1b0342)_0x1bba31(_0x1b0342);return _0x2cd8bd();});});})[_0xac81('0x24')](function(){return _0x3184e8[_0xac81('0xb8')](_0x5dffd9,_0xe14375,function(_0x2331bd){if(_0x2331bd){console[_0xac81('0xca')]('err',_0x2331bd);}else{fs['unlinkSync'](_0x5dffd9);}});});});}else{return _0x3184e8[_0xac81('0xcb')](0xc8);}})[_0xac81('0x31')](handleError(_0x3184e8,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 6bae238..acf0fa4 100644 --- a/server/api/faxInteraction/faxInteraction.events.js +++ b/server/api/faxInteraction/faxInteraction.events.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2ef3,0xba));var _0x32ef=function(_0x298e3c,_0x373d03){_0x298e3c=_0x298e3c-0x0;var _0x562d4f=_0x2ef3[_0x298e3c];return _0x562d4f;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents; \ No newline at end of file +var _0xc4aa=['unreadMessages','length','emit','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','getUsers','then','setDataValue','findAll'];(function(_0x368e09,_0x2c1517){var _0x14b7df=function(_0x5002af){while(--_0x5002af){_0x368e09['push'](_0x368e09['shift']());}};_0x14b7df(++_0x2c1517);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x50a0c2,_0x4befab){_0x50a0c2=_0x50a0c2-0x0;var _0x5ebadd=_0xc4aa[_0x50a0c2];return _0x5ebadd;};'use strict';var EventEmitter=require(_0xac4a('0x0'));var FaxInteraction=require(_0xac4a('0x1'))['db'][_0xac4a('0x2')];var FaxMessage=require(_0xac4a('0x1'))['db'][_0xac4a('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xac4a('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2f48ed){return function(_0x15b967,_0x730a38,_0x215f39){_0x15b967[_0xac4a('0x5')]({'attributes':['id'],'raw':!![]})[_0xac4a('0x6')](function(_0x3ef77c){_0x15b967[_0xac4a('0x7')]('Users',_0x3ef77c['map'](function(_0x1aba6d){return{'id':_0x1aba6d['id']};}));return FaxMessage[_0xac4a('0x8')]({'where':{'FaxInteractionId':_0x15b967['id'],'direction':'in','read':![]},'raw':!![]});})[_0xac4a('0x6')](function(_0x4f4146){_0x15b967[_0xac4a('0x7')](_0xac4a('0x9'),_0x4f4146[_0xac4a('0xa')]);FaxInteractionEvents['emit'](_0x2f48ed+':'+_0x15b967['id'],_0x15b967);FaxInteractionEvents[_0xac4a('0xb')](_0x2f48ed,_0x15b967);_0x215f39(null);})['catch'](_0x215f39(null));};}for(var e in events){if(events[_0xac4a('0xc')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xac4a('0xd')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index fc606dc..5170995 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 _0xb37d=['./faxInteraction.attributes','exports','define','FaxInteraction','fax_interactions','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x1c8262,_0x365816){var _0x450202=function(_0x16c7f9){while(--_0x16c7f9){_0x1c8262['push'](_0x1c8262['shift']());}};_0x450202(++_0x365816);}(_0xb37d,0x99));var _0xdb37=function(_0x48b793,_0x4fbf8e){_0x48b793=_0x48b793-0x0;var _0x32eefb=_0xb37d[_0x48b793];return _0x32eefb;};'use strict';var _=require(_0xdb37('0x0'));var util=require(_0xdb37('0x1'));var logger=require(_0xdb37('0x2'))('api');var moment=require(_0xdb37('0x3'));var BPromise=require(_0xdb37('0x4'));var rp=require(_0xdb37('0x5'));var fs=require('fs');var path=require(_0xdb37('0x6'));var rimraf=require(_0xdb37('0x7'));var config=require(_0xdb37('0x8'));var attributes=require(_0xdb37('0x9'));module[_0xdb37('0xa')]=function(_0x3457bc,_0x28f318){return _0x3457bc[_0xdb37('0xb')](_0xdb37('0xc'),attributes,{'tableName':_0xdb37('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x2e49b0,_0x48b338,_0x40ac18){if(_0x2e49b0['changed'](_0xdb37('0xe'))){_0x2e49b0[_0xdb37('0xf')]=moment()[_0xdb37('0x10')](_0xdb37('0x11'));}_0x40ac18(null,_0x2e49b0);}}});}; \ No newline at end of file +var _0x217f=['../../config/environment','./faxInteraction.attributes','exports','define','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','../../config/logger','api','rimraf'];(function(_0x46962a,_0x4bdaf3){var _0x462b87=function(_0x1f8384){while(--_0x1f8384){_0x46962a['push'](_0x46962a['shift']());}};_0x462b87(++_0x4bdaf3);}(_0x217f,0xa4));var _0xf217=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x217f[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xf217('0x0'));var util=require(_0xf217('0x1'));var logger=require(_0xf217('0x2'))(_0xf217('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xf217('0x4'));var config=require(_0xf217('0x5'));var attributes=require(_0xf217('0x6'));module[_0xf217('0x7')]=function(_0x2d0a90,_0x49add8){return _0x2d0a90[_0xf217('0x8')]('FaxInteraction',attributes,{'tableName':'fax_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x273adc,_0x230146,_0x506676){if(_0x273adc['changed'](_0xf217('0x9'))){_0x273adc[_0xf217('0xa')]=moment()[_0xf217('0xb')](_0xf217('0xc'));}_0x506676(null,_0x273adc);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index 3aaa533..90f6b07 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 _0x13c9=['redis','defaults','localhost','socket.io-emitter','register','then','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateFaxInteraction','FaxInteraction','update','body','options','raw','attributes','limit','AddTagsToFaxInteraction','where','addTags','ids','omit','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x2cb5bd,_0x11e637){var _0xe6c260=function(_0x3a2d3e){while(--_0x3a2d3e){_0x2cb5bd['push'](_0x2cb5bd['shift']());}};_0xe6c260(++_0x11e637);}(_0x13c9,0xc7));var _0x913c=function(_0x7c3482,_0x3187db){_0x7c3482=_0x7c3482-0x0;var _0xa2cf24=_0x13c9[_0x7c3482];return _0xa2cf24;};'use strict';var _=require('lodash');var util=require(_0x913c('0x0'));var moment=require(_0x913c('0x1'));var BPromise=require(_0x913c('0x2'));var rs=require(_0x913c('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x913c('0x4'))['db'];var utils=require(_0x913c('0x5'));var logger=require(_0x913c('0x6'))(_0x913c('0x7'));var config=require(_0x913c('0x8'));var jayson=require(_0x913c('0x9'));var client=jayson['client'][_0x913c('0xa')]({'port':0x232a});config[_0x913c('0xb')]=_[_0x913c('0xc')](config[_0x913c('0xb')],{'host':_0x913c('0xd'),'port':0x18eb});var socket=require(_0x913c('0xe'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0x913c('0xf')](socket);function respondWithRpcPromise(_0x3a6ce2,_0x3012b4,_0x5c9cf1){return new BPromise(function(_0x4b9060,_0x512ad3){return client['request'](_0x3a6ce2,_0x5c9cf1)[_0x913c('0x10')](function(_0x2fb412){logger[_0x913c('0x11')](_0x913c('0x12'),_0x3012b4,_0x913c('0x13'));logger[_0x913c('0x14')](_0x913c('0x15'),_0x3012b4,_0x913c('0x13'),JSON[_0x913c('0x16')](_0x2fb412));if(_0x2fb412[_0x913c('0x17')]){if(_0x2fb412[_0x913c('0x17')][_0x913c('0x18')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x3012b4,_0x2fb412[_0x913c('0x17')][_0x913c('0x19')]);return _0x512ad3(_0x2fb412['error'][_0x913c('0x19')]);}logger[_0x913c('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x3012b4,_0x2fb412[_0x913c('0x17')]['message']);return _0x4b9060(_0x2fb412['error'][_0x913c('0x19')]);}else{logger['info'](_0x913c('0x12'),_0x3012b4,'request\x20sent');_0x4b9060(_0x2fb412[_0x913c('0x1a')][_0x913c('0x19')]);}})[_0x913c('0x1b')](function(_0x3b469f){logger[_0x913c('0x17')]('FaxInteraction,\x20%s,\x20%s',_0x3012b4,_0x3b469f);_0x512ad3(_0x3b469f);});});}exports[_0x913c('0x1c')]=function(_0x36f39c){var _0x21b628=this;return new Promise(function(_0x1d0823,_0x81799c){return db[_0x913c('0x1d')][_0x913c('0x1e')](_0x36f39c[_0x913c('0x1f')],{'raw':_0x36f39c[_0x913c('0x20')]?_0x36f39c[_0x913c('0x20')][_0x913c('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x36f39c[_0x913c('0x20')]?_0x36f39c['options']['where']||null:null,'attributes':_0x36f39c['options']?_0x36f39c[_0x913c('0x20')][_0x913c('0x22')]||null:null,'limit':_0x36f39c[_0x913c('0x20')]?_0x36f39c[_0x913c('0x20')][_0x913c('0x23')]||null:null})[_0x913c('0x10')](function(_0x42b04b){logger[_0x913c('0x11')]('UpdateFaxInteraction',_0x36f39c);logger[_0x913c('0x14')](_0x913c('0x1c'),_0x36f39c,JSON[_0x913c('0x16')](_0x42b04b));_0x1d0823(_0x42b04b);})[_0x913c('0x1b')](function(_0x1eafb0){logger[_0x913c('0x17')](_0x913c('0x1c'),_0x1eafb0[_0x913c('0x19')],_0x36f39c);_0x81799c(_0x21b628[_0x913c('0x17')](0x1f4,_0x1eafb0['message']));});});};exports[_0x913c('0x24')]=function(_0x213283){return new Promise(function(_0x559d36,_0x36a7ab){return db[_0x913c('0x1d')]['find']({'where':_0x213283[_0x913c('0x20')]?_0x213283[_0x913c('0x20')][_0x913c('0x25')]||null:null})[_0x913c('0x10')](function(_0x376ff3){if(_0x376ff3){return _0x376ff3[_0x913c('0x26')](_0x213283[_0x913c('0x1f')][_0x913c('0x27')],_[_0x913c('0x28')](_0x213283[_0x913c('0x1f')],[_0x913c('0x27'),'id'])||{});}})['spread'](function(_0x64a8cb){logger[_0x913c('0x11')](_0x913c('0x29'),_0x213283);logger[_0x913c('0x14')](_0x913c('0x29'),_0x213283,JSON['stringify'](_0x64a8cb));_0x559d36(_0x64a8cb);})[_0x913c('0x1b')](function(_0x36795c){logger['error'](_0x913c('0x29'),_0x36795c[_0x913c('0x19')],_0x213283);_0x36a7ab(_this[_0x913c('0x17')](0x1f4,_0x36795c[_0x913c('0x19')]));});});}; \ No newline at end of file +var _0xe79f=['http','redis','defaults','localhost','socket.io-emitter','./faxInteraction.socket','register','request','info','FaxInteraction,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','UpdateFaxInteraction','FaxInteraction','update','options','raw','where','attributes','limit','stringify','catch','AddTagsToFaxInteraction','then','addTags','body','ids','omit','spread','AddTags','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise'];(function(_0x3213b4,_0x3cddd0){var _0xa97785=function(_0x3c9282){while(--_0x3c9282){_0x3213b4['push'](_0x3213b4['shift']());}};_0xa97785(++_0x3cddd0);}(_0xe79f,0x1a5));var _0xfe79=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe79f[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xfe79('0x0'));var moment=require(_0xfe79('0x1'));var BPromise=require(_0xfe79('0x2'));var rs=require(_0xfe79('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xfe79('0x4'))['db'];var utils=require(_0xfe79('0x5'));var logger=require(_0xfe79('0x6'))(_0xfe79('0x7'));var config=require('../../config/environment');var jayson=require(_0xfe79('0x8'));var client=jayson['client'][_0xfe79('0x9')]({'port':0x232a});config[_0xfe79('0xa')]=_[_0xfe79('0xb')](config[_0xfe79('0xa')],{'host':_0xfe79('0xc'),'port':0x18eb});var socket=require(_0xfe79('0xd'))(new Redis(config[_0xfe79('0xa')]));require(_0xfe79('0xe'))[_0xfe79('0xf')](socket);function respondWithRpcPromise(_0x374cfa,_0x342da0,_0x22e220){return new BPromise(function(_0x1606a4,_0x21ac71){return client[_0xfe79('0x10')](_0x374cfa,_0x22e220)['then'](function(_0x9088cf){logger[_0xfe79('0x11')](_0xfe79('0x12'),_0x342da0,_0xfe79('0x13'));logger[_0xfe79('0x14')]('FaxInteraction,\x20%s,\x20%s,\x20%s',_0x342da0,'request\x20sent',JSON['stringify'](_0x9088cf));if(_0x9088cf[_0xfe79('0x15')]){if(_0x9088cf[_0xfe79('0x15')][_0xfe79('0x16')]===0x1f4){logger[_0xfe79('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x342da0,_0x9088cf[_0xfe79('0x15')][_0xfe79('0x17')]);return _0x21ac71(_0x9088cf[_0xfe79('0x15')][_0xfe79('0x17')]);}logger[_0xfe79('0x15')](_0xfe79('0x12'),_0x342da0,_0x9088cf[_0xfe79('0x15')][_0xfe79('0x17')]);return _0x1606a4(_0x9088cf[_0xfe79('0x15')][_0xfe79('0x17')]);}else{logger[_0xfe79('0x11')]('FaxInteraction,\x20%s,\x20%s',_0x342da0,_0xfe79('0x13'));_0x1606a4(_0x9088cf[_0xfe79('0x18')]['message']);}})['catch'](function(_0x730fc9){logger[_0xfe79('0x15')](_0xfe79('0x12'),_0x342da0,_0x730fc9);_0x21ac71(_0x730fc9);});});}exports[_0xfe79('0x19')]=function(_0x3439b6){var _0x34816e=this;return new Promise(function(_0x23d3b0,_0x3c9175){return db[_0xfe79('0x1a')][_0xfe79('0x1b')](_0x3439b6['body'],{'raw':_0x3439b6[_0xfe79('0x1c')]?_0x3439b6[_0xfe79('0x1c')][_0xfe79('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3439b6[_0xfe79('0x1c')]?_0x3439b6[_0xfe79('0x1c')][_0xfe79('0x1e')]||null:null,'attributes':_0x3439b6['options']?_0x3439b6[_0xfe79('0x1c')][_0xfe79('0x1f')]||null:null,'limit':_0x3439b6[_0xfe79('0x1c')]?_0x3439b6[_0xfe79('0x1c')][_0xfe79('0x20')]||null:null})['then'](function(_0x414817){logger['info'](_0xfe79('0x19'),_0x3439b6);logger[_0xfe79('0x14')](_0xfe79('0x19'),_0x3439b6,JSON[_0xfe79('0x21')](_0x414817));_0x23d3b0(_0x414817);})[_0xfe79('0x22')](function(_0x7c5e10){logger[_0xfe79('0x15')](_0xfe79('0x19'),_0x7c5e10[_0xfe79('0x17')],_0x3439b6);_0x3c9175(_0x34816e[_0xfe79('0x15')](0x1f4,_0x7c5e10[_0xfe79('0x17')]));});});};exports[_0xfe79('0x23')]=function(_0x27bebc){return new Promise(function(_0x527c70,_0x16b4d3){return db['FaxInteraction']['find']({'where':_0x27bebc['options']?_0x27bebc[_0xfe79('0x1c')]['where']||null:null})[_0xfe79('0x24')](function(_0x184038){if(_0x184038){return _0x184038[_0xfe79('0x25')](_0x27bebc[_0xfe79('0x26')][_0xfe79('0x27')],_[_0xfe79('0x28')](_0x27bebc[_0xfe79('0x26')],['ids','id'])||{});}})[_0xfe79('0x29')](function(_0x2e99f2){logger[_0xfe79('0x11')](_0xfe79('0x2a'),_0x27bebc);logger['debug'](_0xfe79('0x2a'),_0x27bebc,JSON[_0xfe79('0x21')](_0x2e99f2));_0x527c70(_0x2e99f2);})[_0xfe79('0x22')](function(_0x405ef5){logger[_0xfe79('0x15')](_0xfe79('0x2a'),_0x405ef5['message'],_0x27bebc);_0x16b4d3(_this[_0xfe79('0x15')](0x1f4,_0x405ef5[_0xfe79('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index e2fe851..4a2a725 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 _0x716a=['update','emit','removeListener','register','length','./faxInteraction.events','save','remove'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x716a,0xed));var _0xa716=function(_0x34e752,_0x32e2a2){_0x34e752=_0x34e752-0x0;var _0x7c6347=_0x716a[_0x34e752];return _0x7c6347;};'use strict';var FaxInteractionEvents=require(_0xa716('0x0'));var events=[_0xa716('0x1'),_0xa716('0x2'),_0xa716('0x3')];function createListener(_0x618ef3,_0x50fbe7){return function(_0x49f369){_0x50fbe7[_0xa716('0x4')](_0x618ef3,_0x49f369);};}function removeListener(_0x15db6d,_0xef3fbe){return function(){FaxInteractionEvents[_0xa716('0x5')](_0x15db6d,_0xef3fbe);};}exports[_0xa716('0x6')]=function(_0x279b0d){for(var _0x4a3fd9=0x0,_0x38a10d=events[_0xa716('0x7')];_0x4a3fd9<_0x38a10d;_0x4a3fd9++){var _0x160554=events[_0x4a3fd9];var _0x4e61fe=createListener('faxInteraction:'+_0x160554,_0x279b0d);FaxInteractionEvents['on'](_0x160554,_0x4e61fe);}}; \ No newline at end of file +var _0xe563=['length','faxInteraction:','./faxInteraction.events','remove','update','removeListener','register'];(function(_0x3b11b6,_0x1166e6){var _0x1c93eb=function(_0x54243b){while(--_0x54243b){_0x3b11b6['push'](_0x3b11b6['shift']());}};_0x1c93eb(++_0x1166e6);}(_0xe563,0xb1));var _0x3e56=function(_0xc1a403,_0x22b205){_0xc1a403=_0xc1a403-0x0;var _0x47ddd5=_0xe563[_0xc1a403];return _0x47ddd5;};'use strict';var FaxInteractionEvents=require(_0x3e56('0x0'));var events=['save',_0x3e56('0x1'),_0x3e56('0x2')];function createListener(_0x27d0be,_0x162b02){return function(_0x1ee272){_0x162b02['emit'](_0x27d0be,_0x1ee272);};}function removeListener(_0x260a7c,_0x4040fd){return function(){FaxInteractionEvents[_0x3e56('0x3')](_0x260a7c,_0x4040fd);};}exports[_0x3e56('0x4')]=function(_0x2a9220){for(var _0x3ba241=0x0,_0x1d14d3=events[_0x3e56('0x5')];_0x3ba241<_0x1d14d3;_0x3ba241++){var _0x50f35a=events[_0x3ba241];var _0x33b137=createListener(_0x3e56('0x6')+_0x50f35a,_0x2a9220);FaxInteractionEvents['on'](_0x50f35a,_0x33b137);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 0cb978e..f1ee287 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 _0xc212=['addMessage','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','destroy','delete','removeTags','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','post','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc212,0x1af));var _0x2c21=function(_0x41d61d,_0x2882a3){_0x41d61d=_0x41d61d-0x0;var _0x20c4a5=_0xc212[_0x41d61d];return _0x20c4a5;};'use strict';var multer=require('multer');var util=require(_0x2c21('0x0'));var path=require(_0x2c21('0x1'));var timeout=require(_0x2c21('0x2'));var express=require(_0x2c21('0x3'));var router=express[_0x2c21('0x4')]();var auth=require(_0x2c21('0x5'));var interaction=require(_0x2c21('0x6'));var config=require(_0x2c21('0x7'));var controller=require(_0x2c21('0x8'));router[_0x2c21('0x9')]('/',auth[_0x2c21('0xa')](),controller[_0x2c21('0xb')]);router[_0x2c21('0x9')](_0x2c21('0xc'),auth['isAuthenticated'](),controller[_0x2c21('0xd')]);router[_0x2c21('0x9')](_0x2c21('0xe'),auth['isAuthenticated'](),controller['show']);router[_0x2c21('0x9')](_0x2c21('0xf'),auth[_0x2c21('0xa')](),controller[_0x2c21('0x10')]);router[_0x2c21('0x9')]('/:id/download',auth[_0x2c21('0xa')](),controller['download']);router[_0x2c21('0x11')]('/',auth[_0x2c21('0xa')](),controller[_0x2c21('0x12')]);router[_0x2c21('0x11')](_0x2c21('0xf'),auth['isAuthenticated'](),controller[_0x2c21('0x13')]);router['post']('/:id/tags',auth[_0x2c21('0xa')](),interaction['tracked'](_0x2c21('0x14'),_0x2c21('0x15')),controller[_0x2c21('0x16')]);router[_0x2c21('0x17')](_0x2c21('0xe'),auth['isAuthenticated'](),interaction['tracked'](_0x2c21('0x14'),_0x2c21('0x18')),controller[_0x2c21('0x19')]);router['delete'](_0x2c21('0xe'),auth[_0x2c21('0xa')](),interaction['tracked'](_0x2c21('0x14'),'faxinteraction:destroy'),controller[_0x2c21('0x1a')]);router[_0x2c21('0x1b')]('/:id/tags',auth['isAuthenticated'](),controller[_0x2c21('0x1c')]);module[_0x2c21('0x1d')]=router; \ No newline at end of file +var _0x3cb7=['addTags','put','faxinteraction:update','update','faxinteraction:destroy','delete','/:id/tags','removeTags','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','tracked','fax'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x3cb7,0x1a8));var _0x73cb=function(_0x101094,_0x5d3900){_0x101094=_0x101094-0x0;var _0x3d6d75=_0x3cb7[_0x101094];return _0x3d6d75;};'use strict';var multer=require(_0x73cb('0x0'));var util=require(_0x73cb('0x1'));var path=require('path');var timeout=require(_0x73cb('0x2'));var express=require(_0x73cb('0x3'));var router=express[_0x73cb('0x4')]();var auth=require(_0x73cb('0x5'));var interaction=require(_0x73cb('0x6'));var config=require('../../config/environment');var controller=require(_0x73cb('0x7'));router['get']('/',auth[_0x73cb('0x8')](),controller[_0x73cb('0x9')]);router[_0x73cb('0xa')](_0x73cb('0xb'),auth[_0x73cb('0x8')](),controller[_0x73cb('0xc')]);router['get'](_0x73cb('0xd'),auth[_0x73cb('0x8')](),controller[_0x73cb('0xe')]);router[_0x73cb('0xa')](_0x73cb('0xf'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x10')]);router[_0x73cb('0xa')](_0x73cb('0x11'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x12')]);router[_0x73cb('0x13')]('/',auth[_0x73cb('0x8')](),controller[_0x73cb('0x14')]);router['post'](_0x73cb('0xf'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x15')]);router['post']('/:id/tags',auth[_0x73cb('0x8')](),interaction[_0x73cb('0x16')](_0x73cb('0x17'),'faxinteraction:addtags'),controller[_0x73cb('0x18')]);router[_0x73cb('0x19')]('/:id',auth[_0x73cb('0x8')](),interaction['tracked'](_0x73cb('0x17'),_0x73cb('0x1a')),controller[_0x73cb('0x1b')]);router['delete'](_0x73cb('0xd'),auth['isAuthenticated'](),interaction[_0x73cb('0x16')](_0x73cb('0x17'),_0x73cb('0x1c')),controller['destroy']);router[_0x73cb('0x1d')](_0x73cb('0x1e'),auth[_0x73cb('0x8')](),controller[_0x73cb('0x1f')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.attributes.js b/server/api/faxMessage/faxMessage.attributes.js index d86289f..3e6614e 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 _0xae7b=['BOOLEAN','ENUM','DATE','exports','TEXT','medium'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xae7b,0x17d));var _0xbae7=function(_0x3ba422,_0x53303c){_0x3ba422=_0x3ba422-0x0;var _0x20b5dd=_0xae7b[_0x3ba422];return _0x20b5dd;};'use strict';var Sequelize=require('sequelize');module[_0xbae7('0x0')]={'body':{'type':Sequelize[_0xbae7('0x1')](_0xbae7('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xbae7('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xbae7('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xbae7('0x1')],'defaultValue':null},'readAt':{'type':Sequelize[_0xbae7('0x5')]}}; \ No newline at end of file +var _0x1a7b=['medium','out','TEXT','DATE','sequelize','exports'];(function(_0x5dc32b,_0x5ab340){var _0x4fe7b2=function(_0x5ea543){while(--_0x5ea543){_0x5dc32b['push'](_0x5dc32b['shift']());}};_0x4fe7b2(++_0x5ab340);}(_0x1a7b,0xe2));var _0xb1a7=function(_0x78e522,_0x37c539){_0x78e522=_0x78e522-0x0;var _0x4a170d=_0x1a7b[_0x78e522];return _0x4a170d;};'use strict';var Sequelize=require(_0xb1a7('0x0'));module[_0xb1a7('0x1')]={'body':{'type':Sequelize['TEXT'](_0xb1a7('0x2')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xb1a7('0x3')),'defaultValue':'out','allowNull':![]},'failMessage':{'type':Sequelize[_0xb1a7('0x4')],'defaultValue':null},'readAt':{'type':Sequelize[_0xb1a7('0x5')]}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index f39398b..c5cb6f3 100644 --- a/server/api/faxMessage/faxMessage.controller.js +++ b/server/api/faxMessage/faxMessage.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_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 Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_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 Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 51835ff..434a852 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 _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x4b3e16,_0x30f6e8){var _0x5e9d86=function(_0x165f3b){while(--_0x165f3b){_0x4b3e16['push'](_0x4b3e16['shift']());}};_0x5e9d86(++_0x30f6e8);}(_0x008c,0x188));var _0xc008=function(_0xb0bd5d,_0x156b62){_0xb0bd5d=_0xb0bd5d-0x0;var _0x417125=_0x008c[_0xb0bd5d];return _0x417125;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxMessage','setMaxListeners'];(function(_0x2a149b,_0x5e3d0c){var _0x262475=function(_0x176293){while(--_0x176293){_0x2a149b['push'](_0x2a149b['shift']());}};_0x262475(++_0x5e3d0c);}(_0x008c,0x188));var _0xc008=function(_0x3ff97b,_0x459934){_0x3ff97b=_0x3ff97b-0x0;var _0x43ab91=_0x008c[_0x3ff97b];return _0x43ab91;};'use strict';var EventEmitter=require(_0xc008('0x0'));var FaxMessage=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){FaxMessageEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);FaxMessageEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];FaxMessage[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 19d2d3b..7641ec9 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 _0xe5e6=['path','../../config/environment','./faxMessage.attributes','define','FaxMessage','fti_fax_messages','FULLTEXT','models','get','direction','toLowerCase','out','secret','UserId','findOne','then','createdAt','catch','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','request-promise'];(function(_0x4dbf26,_0x2dc290){var _0x58db8e=function(_0x1b92f7){while(--_0x1b92f7){_0x4dbf26['push'](_0x4dbf26['shift']());}};_0x58db8e(++_0x2dc290);}(_0xe5e6,0x1ab));var _0x6e5e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe5e6[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x6e5e('0x0'));var util=require('util');var logger=require(_0x6e5e('0x1'))(_0x6e5e('0x2'));var moment=require('moment');var BPromise=require(_0x6e5e('0x3'));var rp=require(_0x6e5e('0x4'));var fs=require('fs');var path=require(_0x6e5e('0x5'));var rimraf=require('rimraf');var config=require(_0x6e5e('0x6'));var attributes=require(_0x6e5e('0x7'));module['exports']=function(_0x1a6f2d,_0x15e90e){return _0x1a6f2d[_0x6e5e('0x8')](_0x6e5e('0x9'),attributes,{'tableName':'fax_messages','paranoid':![],'indexes':[{'name':_0x6e5e('0xa'),'fields':['body'],'type':_0x6e5e('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x108664,_0x259009,_0x47fb19){var _0x853563=_0x1a6f2d[_0x6e5e('0xc')];var _0x2d3f34=_0x108664[_0x6e5e('0xd')]({'plain':!![]});if(_0x2d3f34[_0x6e5e('0xe')]['toLowerCase']()==='in'||_0x2d3f34[_0x6e5e('0xe')][_0x6e5e('0xf')]()===_0x6e5e('0x10')&&!_0x2d3f34[_0x6e5e('0x11')]&&!_['isNil'](_0x2d3f34[_0x6e5e('0x12')])){_0x853563['FaxInteraction'][_0x6e5e('0x13')]({'where':{'id':_0x2d3f34['FaxInteractionId']}})[_0x6e5e('0x14')](function(_0x3b9974){if(_0x3b9974){_0x3b9974['update']({'lastMsgAt':_0x2d3f34[_0x6e5e('0x15')],'lastMsgDirection':_0x2d3f34[_0x6e5e('0xe')][_0x6e5e('0xf')]()});}})[_0x6e5e('0x16')](function(_0x2f4e10){console['error'](_0x2f4e10);});}_0x47fb19();}},'charset':'utf8mb4','collate':_0x6e5e('0x17')});}; \ No newline at end of file +var _0x1b48=['error','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxMessage','fax_messages','fti_fax_messages','body','models','get','toLowerCase','direction','out','secret','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch'];(function(_0x330911,_0x70724f){var _0x1b3168=function(_0x432e82){while(--_0x432e82){_0x330911['push'](_0x330911['shift']());}};_0x1b3168(++_0x70724f);}(_0x1b48,0x99));var _0x81b4=function(_0x4def75,_0x5818e4){_0x4def75=_0x4def75-0x0;var _0x9f9484=_0x1b48[_0x4def75];return _0x9f9484;};'use strict';var _=require(_0x81b4('0x0'));var util=require('util');var logger=require(_0x81b4('0x1'))(_0x81b4('0x2'));var moment=require(_0x81b4('0x3'));var BPromise=require(_0x81b4('0x4'));var rp=require(_0x81b4('0x5'));var fs=require('fs');var path=require(_0x81b4('0x6'));var rimraf=require(_0x81b4('0x7'));var config=require(_0x81b4('0x8'));var attributes=require('./faxMessage.attributes');module[_0x81b4('0x9')]=function(_0x300494,_0x3ba626){return _0x300494['define'](_0x81b4('0xa'),attributes,{'tableName':_0x81b4('0xb'),'paranoid':![],'indexes':[{'name':_0x81b4('0xc'),'fields':[_0x81b4('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x3b46f7,_0x3a0af9,_0x31aa02){var _0x4420a2=_0x300494[_0x81b4('0xe')];var _0x45912e=_0x3b46f7[_0x81b4('0xf')]({'plain':!![]});if(_0x45912e['direction'][_0x81b4('0x10')]()==='in'||_0x45912e[_0x81b4('0x11')][_0x81b4('0x10')]()===_0x81b4('0x12')&&!_0x45912e[_0x81b4('0x13')]&&!_['isNil'](_0x45912e[_0x81b4('0x14')])){_0x4420a2[_0x81b4('0x15')][_0x81b4('0x16')]({'where':{'id':_0x45912e[_0x81b4('0x17')]}})[_0x81b4('0x18')](function(_0x335c6b){if(_0x335c6b){_0x335c6b['update']({'lastMsgAt':_0x45912e[_0x81b4('0x19')],'lastMsgDirection':_0x45912e[_0x81b4('0x11')][_0x81b4('0x10')]()});}})[_0x81b4('0x1a')](function(_0x1aae85){console[_0x81b4('0x1b')](_0x1aae85);});}_0x31aa02();}},'charset':_0x81b4('0x1c'),'collate':_0x81b4('0x1d')});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 55e1c40..42e9a5c 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 _0xe0d6=['info','FaxMessage,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','FaxMessage','body','options','CreateFaxMessage','UpdateFaxMessage','update','raw','where','limit','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','request','then'];(function(_0x48d7aa,_0x52349c){var _0x138fc6=function(_0x273dd9){while(--_0x273dd9){_0x48d7aa['push'](_0x48d7aa['shift']());}};_0x138fc6(++_0x52349c);}(_0xe0d6,0x18f));var _0x6e0d=function(_0x2ec39e,_0x4bdff0){_0x2ec39e=_0x2ec39e-0x0;var _0x3e51cc=_0xe0d6[_0x2ec39e];return _0x3e51cc;};'use strict';var _=require(_0x6e0d('0x0'));var util=require(_0x6e0d('0x1'));var moment=require(_0x6e0d('0x2'));var BPromise=require(_0x6e0d('0x3'));var rs=require(_0x6e0d('0x4'));var fs=require('fs');var Redis=require(_0x6e0d('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x6e0d('0x6'));var logger=require(_0x6e0d('0x7'))(_0x6e0d('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6e0d('0x9')][_0x6e0d('0xa')]({'port':0x232a});config[_0x6e0d('0xb')]=_[_0x6e0d('0xc')](config['redis'],{'host':_0x6e0d('0xd'),'port':0x18eb});var socket=require(_0x6e0d('0xe'))(new Redis(config['redis']));require(_0x6e0d('0xf'))[_0x6e0d('0x10')](socket);function respondWithRpcPromise(_0x1ac9c5,_0x2593cd,_0x42db8c){return new BPromise(function(_0x3bb7c1,_0x2ca6e4){return client[_0x6e0d('0x11')](_0x1ac9c5,_0x42db8c)[_0x6e0d('0x12')](function(_0xedf1b2){logger[_0x6e0d('0x13')](_0x6e0d('0x14'),_0x2593cd,_0x6e0d('0x15'));logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x2593cd,_0x6e0d('0x15'),JSON[_0x6e0d('0x16')](_0xedf1b2));if(_0xedf1b2['error']){if(_0xedf1b2['error'][_0x6e0d('0x17')]===0x1f4){logger[_0x6e0d('0x18')]('FaxMessage,\x20%s,\x20%s',_0x2593cd,_0xedf1b2[_0x6e0d('0x18')][_0x6e0d('0x19')]);return _0x2ca6e4(_0xedf1b2[_0x6e0d('0x18')][_0x6e0d('0x19')]);}logger[_0x6e0d('0x18')](_0x6e0d('0x14'),_0x2593cd,_0xedf1b2[_0x6e0d('0x18')][_0x6e0d('0x19')]);return _0x3bb7c1(_0xedf1b2[_0x6e0d('0x18')][_0x6e0d('0x19')]);}else{logger[_0x6e0d('0x13')](_0x6e0d('0x14'),_0x2593cd,_0x6e0d('0x15'));_0x3bb7c1(_0xedf1b2[_0x6e0d('0x1a')][_0x6e0d('0x19')]);}})[_0x6e0d('0x1b')](function(_0x40bce3){logger[_0x6e0d('0x18')]('FaxMessage,\x20%s,\x20%s',_0x2593cd,_0x40bce3);_0x2ca6e4(_0x40bce3);});});}exports['CreateFaxMessage']=function(_0x49cd0e){var _0xe0bcd0=this;return new Promise(function(_0x5bfb44,_0x3f60a1){return db[_0x6e0d('0x1c')]['create'](_0x49cd0e[_0x6e0d('0x1d')],{'raw':_0x49cd0e[_0x6e0d('0x1e')]?_0x49cd0e[_0x6e0d('0x1e')]['raw']===undefined?!![]:![]:!![]})[_0x6e0d('0x12')](function(_0x3745c7){logger[_0x6e0d('0x13')](_0x6e0d('0x1f'),_0x49cd0e);logger['debug']('CreateFaxMessage',_0x49cd0e,JSON['stringify'](_0x3745c7));_0x5bfb44(_0x3745c7);})[_0x6e0d('0x1b')](function(_0x21c229){logger['error'](_0x6e0d('0x1f'),_0x21c229[_0x6e0d('0x19')],_0x49cd0e);_0x3f60a1(_0xe0bcd0['error'](0x1f4,_0x21c229['message']));});});};exports[_0x6e0d('0x20')]=function(_0xbb4c08){var _0x35edc3=this;return new Promise(function(_0x23e4ae,_0x405e39){return db[_0x6e0d('0x1c')][_0x6e0d('0x21')](_0xbb4c08[_0x6e0d('0x1d')],{'raw':_0xbb4c08[_0x6e0d('0x1e')]?_0xbb4c08[_0x6e0d('0x1e')][_0x6e0d('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xbb4c08[_0x6e0d('0x1e')]?_0xbb4c08['options'][_0x6e0d('0x23')]||null:null,'attributes':_0xbb4c08['options']?_0xbb4c08['options']['attributes']||null:null,'limit':_0xbb4c08['options']?_0xbb4c08[_0x6e0d('0x1e')][_0x6e0d('0x24')]||null:null})[_0x6e0d('0x12')](function(_0x23e7bd){logger[_0x6e0d('0x13')](_0x6e0d('0x20'),_0xbb4c08);logger[_0x6e0d('0x25')](_0x6e0d('0x20'),_0xbb4c08,JSON[_0x6e0d('0x16')](_0x23e7bd));_0x23e4ae(_0x23e7bd);})[_0x6e0d('0x1b')](function(_0x4fb26c){logger[_0x6e0d('0x18')](_0x6e0d('0x20'),_0x4fb26c[_0x6e0d('0x19')],_0xbb4c08);_0x405e39(_0x35edc3[_0x6e0d('0x18')](0x1f4,_0x4fb26c[_0x6e0d('0x19')]));});});}; \ No newline at end of file +var _0x682f=['body','options','raw','then','stringify','catch','UpdateFaxMessage','update','where','attributes','lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','register','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','CreateFaxMessage','FaxMessage','create'];(function(_0x412484,_0x276b6c){var _0x1d6329=function(_0x258437){while(--_0x258437){_0x412484['push'](_0x412484['shift']());}};_0x1d6329(++_0x276b6c);}(_0x682f,0x1eb));var _0xf682=function(_0x47ea87,_0x2393d6){_0x47ea87=_0x47ea87-0x0;var _0x20cca7=_0x682f[_0x47ea87];return _0x20cca7;};'use strict';var _=require(_0xf682('0x0'));var util=require(_0xf682('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xf682('0x2'));var fs=require('fs');var Redis=require(_0xf682('0x3'));var db=require(_0xf682('0x4'))['db'];var utils=require(_0xf682('0x5'));var logger=require(_0xf682('0x6'))(_0xf682('0x7'));var config=require(_0xf682('0x8'));var jayson=require(_0xf682('0x9'));var client=jayson[_0xf682('0xa')]['http']({'port':0x232a});config[_0xf682('0xb')]=_[_0xf682('0xc')](config[_0xf682('0xb')],{'host':_0xf682('0xd'),'port':0x18eb});var socket=require(_0xf682('0xe'))(new Redis(config[_0xf682('0xb')]));require('./faxMessage.socket')[_0xf682('0xf')](socket);function respondWithRpcPromise(_0x8b33ad,_0x553923,_0x3e107e){return new BPromise(function(_0x413f69,_0x4dd2e9){return client['request'](_0x8b33ad,_0x3e107e)['then'](function(_0x1c1f82){logger[_0xf682('0x10')](_0xf682('0x11'),_0x553923,_0xf682('0x12'));logger[_0xf682('0x13')](_0xf682('0x14'),_0x553923,_0xf682('0x12'),JSON['stringify'](_0x1c1f82));if(_0x1c1f82[_0xf682('0x15')]){if(_0x1c1f82[_0xf682('0x15')]['code']===0x1f4){logger['error']('FaxMessage,\x20%s,\x20%s',_0x553923,_0x1c1f82[_0xf682('0x15')][_0xf682('0x16')]);return _0x4dd2e9(_0x1c1f82['error'][_0xf682('0x16')]);}logger[_0xf682('0x15')]('FaxMessage,\x20%s,\x20%s',_0x553923,_0x1c1f82[_0xf682('0x15')][_0xf682('0x16')]);return _0x413f69(_0x1c1f82[_0xf682('0x15')][_0xf682('0x16')]);}else{logger['info'](_0xf682('0x11'),_0x553923,_0xf682('0x12'));_0x413f69(_0x1c1f82[_0xf682('0x17')][_0xf682('0x16')]);}})['catch'](function(_0x760389){logger[_0xf682('0x15')](_0xf682('0x11'),_0x553923,_0x760389);_0x4dd2e9(_0x760389);});});}exports[_0xf682('0x18')]=function(_0x5b02f9){var _0x36d546=this;return new Promise(function(_0x5146cb,_0x1761d3){return db[_0xf682('0x19')][_0xf682('0x1a')](_0x5b02f9[_0xf682('0x1b')],{'raw':_0x5b02f9[_0xf682('0x1c')]?_0x5b02f9['options'][_0xf682('0x1d')]===undefined?!![]:![]:!![]})[_0xf682('0x1e')](function(_0x27d125){logger[_0xf682('0x10')](_0xf682('0x18'),_0x5b02f9);logger[_0xf682('0x13')]('CreateFaxMessage',_0x5b02f9,JSON[_0xf682('0x1f')](_0x27d125));_0x5146cb(_0x27d125);})[_0xf682('0x20')](function(_0x41072e){logger['error'](_0xf682('0x18'),_0x41072e[_0xf682('0x16')],_0x5b02f9);_0x1761d3(_0x36d546[_0xf682('0x15')](0x1f4,_0x41072e[_0xf682('0x16')]));});});};exports[_0xf682('0x21')]=function(_0x24e1b3){var _0x358af1=this;return new Promise(function(_0x1c0dde,_0x33c371){return db[_0xf682('0x19')][_0xf682('0x22')](_0x24e1b3[_0xf682('0x1b')],{'raw':_0x24e1b3[_0xf682('0x1c')]?_0x24e1b3['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e1b3[_0xf682('0x1c')]?_0x24e1b3[_0xf682('0x1c')][_0xf682('0x23')]||null:null,'attributes':_0x24e1b3[_0xf682('0x1c')]?_0x24e1b3[_0xf682('0x1c')][_0xf682('0x24')]||null:null,'limit':_0x24e1b3['options']?_0x24e1b3[_0xf682('0x1c')]['limit']||null:null})[_0xf682('0x1e')](function(_0x44f26b){logger[_0xf682('0x10')](_0xf682('0x21'),_0x24e1b3);logger[_0xf682('0x13')]('UpdateFaxMessage',_0x24e1b3,JSON['stringify'](_0x44f26b));_0x1c0dde(_0x44f26b);})['catch'](function(_0x1b80cd){logger[_0xf682('0x15')](_0xf682('0x21'),_0x1b80cd[_0xf682('0x16')],_0x24e1b3);_0x33c371(_0x358af1['error'](0x1f4,_0x1b80cd['message']));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index 1229c78..4437dd2 100644 --- a/server/api/faxMessage/faxMessage.socket.js +++ b/server/api/faxMessage/faxMessage.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x38ced4,_0x24263f){var _0x547c07=function(_0x279fc4){while(--_0x279fc4){_0x38ced4['push'](_0x38ced4['shift']());}};_0x547c07(++_0x24263f);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file +var _0xa9e0=['register','length','faxMessage:','./faxMessage.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(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xa9e0[_0x34bc30];return _0x5706de;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index ad299e3..5b3926a 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 _0xc953=['describe','/:id','show','/:id/download','post','tracked','fax','faxmessage:create','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','./faxMessage.controller','isAuthenticated','index','get','/describe'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0xc953,0x195));var _0x3c95=function(_0x37a7c6,_0x3a84b6){_0x37a7c6=_0x37a7c6-0x0;var _0x539905=_0xc953[_0x37a7c6];return _0x539905;};'use strict';var multer=require(_0x3c95('0x0'));var util=require(_0x3c95('0x1'));var path=require(_0x3c95('0x2'));var timeout=require(_0x3c95('0x3'));var express=require(_0x3c95('0x4'));var router=express['Router']();var auth=require(_0x3c95('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x3c95('0x6'));router['get']('/',auth[_0x3c95('0x7')](),controller[_0x3c95('0x8')]);router[_0x3c95('0x9')](_0x3c95('0xa'),auth[_0x3c95('0x7')](),controller[_0x3c95('0xb')]);router[_0x3c95('0x9')](_0x3c95('0xc'),auth[_0x3c95('0x7')](),controller[_0x3c95('0xd')]);router['get'](_0x3c95('0xe'),auth['isAuthenticated'](),controller['download']);router[_0x3c95('0xf')]('/',auth[_0x3c95('0x7')](),interaction[_0x3c95('0x10')](_0x3c95('0x11'),_0x3c95('0x12')),controller['create']);router[_0x3c95('0x13')](_0x3c95('0xc'),auth[_0x3c95('0x7')](),controller['update']);router[_0x3c95('0x13')](_0x3c95('0x14'),auth[_0x3c95('0x7')](),controller[_0x3c95('0x15')]);router[_0x3c95('0x13')](_0x3c95('0x16'),auth[_0x3c95('0x7')](),controller[_0x3c95('0x17')]);router[_0x3c95('0x18')](_0x3c95('0xc'),auth[_0x3c95('0x7')](),controller[_0x3c95('0x19')]);module['exports']=router; \ No newline at end of file +var _0xd4e1=['fax','faxmessage:create','put','/:id','update','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./faxMessage.controller','get','/describe','describe','show','/:id/download','download','post','isAuthenticated','tracked'];(function(_0x1ff575,_0xdba21f){var _0x48fc9e=function(_0x51cf97){while(--_0x51cf97){_0x1ff575['push'](_0x1ff575['shift']());}};_0x48fc9e(++_0xdba21f);}(_0xd4e1,0xea));var _0x1d4e=function(_0x3ae055,_0x270352){_0x3ae055=_0x3ae055-0x0;var _0x34522b=_0xd4e1[_0x3ae055];return _0x34522b;};'use strict';var multer=require(_0x1d4e('0x0'));var util=require(_0x1d4e('0x1'));var path=require(_0x1d4e('0x2'));var timeout=require(_0x1d4e('0x3'));var express=require(_0x1d4e('0x4'));var router=express[_0x1d4e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1d4e('0x6'));var config=require(_0x1d4e('0x7'));var controller=require(_0x1d4e('0x8'));router[_0x1d4e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1d4e('0x9')](_0x1d4e('0xa'),auth['isAuthenticated'](),controller[_0x1d4e('0xb')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0x1d4e('0xc')]);router['get'](_0x1d4e('0xd'),auth['isAuthenticated'](),controller[_0x1d4e('0xe')]);router[_0x1d4e('0xf')]('/',auth[_0x1d4e('0x10')](),interaction[_0x1d4e('0x11')](_0x1d4e('0x12'),_0x1d4e('0x13')),controller['create']);router[_0x1d4e('0x14')](_0x1d4e('0x15'),auth[_0x1d4e('0x10')](),controller[_0x1d4e('0x16')]);router[_0x1d4e('0x14')]('/:id/accept',auth['isAuthenticated'](),controller['accept']);router[_0x1d4e('0x14')](_0x1d4e('0x17'),auth['isAuthenticated'](),controller[_0x1d4e('0x18')]);router[_0x1d4e('0x19')](_0x1d4e('0x15'),auth[_0x1d4e('0x10')](),controller[_0x1d4e('0x1a')]);module[_0x1d4e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index fbd6c81..70550a7 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 _0x95c5=['STRING','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize','exports','name'];(function(_0x5af8a1,_0x1f2b20){var _0x3b6e2f=function(_0x5dec52){while(--_0x5dec52){_0x5af8a1['push'](_0x5af8a1['shift']());}};_0x3b6e2f(++_0x1f2b20);}(_0x95c5,0x153));var _0x595c=function(_0x39d544,_0x35c14f){_0x39d544=_0x39d544-0x0;var _0x5a5ff2=_0x95c5[_0x39d544];return _0x5a5ff2;};'use strict';var Sequelize=require(_0x595c('0x0'));module[_0x595c('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x595c('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x595c('0x3')]},'timeout':{'type':Sequelize[_0x595c('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x595c('0x5')](_0x595c('0x6'),_0x595c('0x7'),_0x595c('0x8')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0x595c('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x3cfb=['sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory','roundrobin'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x3239db,_0x56f0eb){_0x3239db=_0x3239db-0x0;var _0x82625a=_0x3cfb[_0x3239db];return _0x82625a;};'use strict';var Sequelize=require(_0xb3cf('0x0'));module[_0xb3cf('0x1')]={'name':{'type':Sequelize[_0xb3cf('0x2')],'unique':_0xb3cf('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xb3cf('0x2')]},'timeout':{'type':Sequelize[_0xb3cf('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xb3cf('0x5')](_0xb3cf('0x6'),'beepall',_0xb3cf('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize[_0xb3cf('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.controller.js b/server/api/faxQueue/faxQueue.controller.js index 498e873..27f9d19 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 _0x5800=['SIP','updatedAt','getTeams','ids','Team','Agents','online','voicePause','sequelize','each','findOrCreate','forEach','emit','removeTeams','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','toString','QueryTypes','every','TeamId','includes','all','union','value','isEmpty','addAgents','omit','removeAgents','isArray','userFaxQueue:remove','getAgents','findOne','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','to-csv','ejs','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','defaults','redis','localhost','./faxQueue.socket','register','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','get','FaxQueues','UserProfileResource','destroy','error','stack','name','send','index','map','FaxQueue','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','filter','where','VIRTUAL','merge','options','count','include','findAll','rows','catch','show','params','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','order','pick','UserFaxQueue','User','agent','faxPause','createdAt'];(function(_0x49ff03,_0x228278){var _0x546c30=function(_0x5e6943){while(--_0x5e6943){_0x49ff03['push'](_0x49ff03['shift']());}};_0x546c30(++_0x228278);}(_0x5800,0x1b9));var _0x0580=function(_0x437c1c,_0x858013){_0x437c1c=_0x437c1c-0x0;var _0x1e725a=_0x5800[_0x437c1c];return _0x1e725a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0580('0x0'));var rimraf=require(_0x0580('0x1'));var zipdir=require(_0x0580('0x2'));var jsonpatch=require(_0x0580('0x3'));var rp=require('request-promise');var moment=require(_0x0580('0x4'));var BPromise=require(_0x0580('0x5'));var Mustache=require('mustache');var util=require(_0x0580('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0580('0x7'));var ejs=require(_0x0580('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0580('0x9'));var crypto=require('crypto');var jsforce=require(_0x0580('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x0580('0x7'));var querystring=require(_0x0580('0xb'));var Papa=require(_0x0580('0xc'));var Redis=require(_0x0580('0xd'));var authService=require(_0x0580('0xe'));var qs=require(_0x0580('0xf'));var as=require(_0x0580('0x10'));var hardwareService=require(_0x0580('0x11'));var logger=require('../../config/logger')(_0x0580('0x12'));var utils=require(_0x0580('0x13'));var config=require(_0x0580('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0580('0x15')](config[_0x0580('0x16')],{'host':_0x0580('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0580('0x16')]));require(_0x0580('0x18'))[_0x0580('0x19')](socket);function respondWithStatusCode(_0x58bee1,_0x33edb2){_0x33edb2=_0x33edb2||0xcc;return function(_0x16759a){if(_0x16759a){return _0x58bee1[_0x0580('0x1a')](_0x33edb2);}return _0x58bee1[_0x0580('0x1b')](_0x33edb2)[_0x0580('0x1c')]();};}function respondWithResult(_0x16b257,_0x1e9639){_0x1e9639=_0x1e9639||0xc8;return function(_0x5da996){if(_0x5da996){return _0x16b257[_0x0580('0x1b')](_0x1e9639)[_0x0580('0x1d')](_0x5da996);}};}function respondWithFilteredResult(_0x309475,_0x297fb1){return function(_0x18739d){if(_0x18739d){var _0x549e64=_0x18739d['count'],_0x1fd89d=_0x297fb1[_0x0580('0x1e')],_0x15dcac=_0x297fb1[_0x0580('0x1e')]+_0x297fb1[_0x0580('0x1f')],_0x2c0030;if(_0x15dcac>=_0x549e64){_0x15dcac=_0x549e64;_0x2c0030=0xc8;}else{_0x2c0030=0xce;}_0x309475[_0x0580('0x1b')](_0x2c0030);return _0x309475[_0x0580('0x20')](_0x0580('0x21'),_0x1fd89d+'-'+_0x15dcac+'/'+_0x549e64)[_0x0580('0x1d')](_0x18739d);}return null;};}function patchUpdates(_0x482ecb){return function(_0x38dc0c){try{jsonpatch[_0x0580('0x22')](_0x38dc0c,_0x482ecb,!![]);}catch(_0xab9d36){return BPromise[_0x0580('0x23')](_0xab9d36);}return _0x38dc0c[_0x0580('0x24')]();};}function saveUpdates(_0x36f360,_0x180fc3){return function(_0x162064){if(_0x162064){return _0x162064[_0x0580('0x25')](_0x36f360)[_0x0580('0x26')](function(_0x26f31f){return _0x26f31f;});}return null;};}function removeEntity(_0x2f1b31,_0x391560){return function(_0x4a5bee){if(_0x4a5bee){return _0x4a5bee['destroy']()[_0x0580('0x26')](function(){var _0x5ee76e=_0x4a5bee[_0x0580('0x27')]({'plain':!![]});var _0x30ee2b=_0x0580('0x28');return db[_0x0580('0x29')][_0x0580('0x2a')]({'where':{'type':_0x30ee2b,'resourceId':_0x5ee76e['id']}})[_0x0580('0x26')](function(){return _0x4a5bee;});})[_0x0580('0x26')](function(){_0x2f1b31[_0x0580('0x1b')](0xcc)[_0x0580('0x1c')]();});}};}function handleEntityNotFound(_0x26a5d2,_0x22a5c2){return function(_0x56cb13){if(!_0x56cb13){_0x26a5d2[_0x0580('0x1a')](0x194);}return _0x56cb13;};}function handleError(_0x3156a0,_0x4c417a){_0x4c417a=_0x4c417a||0x1f4;return function(_0x36333e){logger[_0x0580('0x2b')](_0x36333e[_0x0580('0x2c')]);if(_0x36333e[_0x0580('0x2d')]){delete _0x36333e['name'];}_0x3156a0[_0x0580('0x1b')](_0x4c417a)[_0x0580('0x2e')](_0x36333e);};}exports[_0x0580('0x2f')]=function(_0x457f1b,_0x2522df){var _0x212ce3={},_0x3429ed={},_0x2cfaf8={'count':0x0,'rows':[]};var _0x302f70=_[_0x0580('0x30')](db[_0x0580('0x31')][_0x0580('0x32')],function(_0x5ecb98){return{'name':_0x5ecb98['fieldName'],'type':_0x5ecb98[_0x0580('0x33')][_0x0580('0x34')]};});_0x3429ed[_0x0580('0x35')]=_[_0x0580('0x30')](_0x302f70,_0x0580('0x2d'));_0x3429ed[_0x0580('0x36')]=_[_0x0580('0x37')](_0x457f1b[_0x0580('0x36')]);_0x3429ed[_0x0580('0x38')]=_['intersection'](_0x3429ed[_0x0580('0x35')],_0x3429ed[_0x0580('0x36')]);_0x212ce3[_0x0580('0x39')]=_[_0x0580('0x3a')](_0x3429ed[_0x0580('0x35')],qs[_0x0580('0x3b')](_0x457f1b['query'][_0x0580('0x3b')]));_0x212ce3['attributes']=_0x212ce3['attributes'][_0x0580('0x3c')]?_0x212ce3[_0x0580('0x39')]:_0x3429ed[_0x0580('0x35')];if(!_0x457f1b[_0x0580('0x36')][_0x0580('0x3d')](_0x0580('0x3e'))){_0x212ce3['limit']=qs[_0x0580('0x1f')](_0x457f1b[_0x0580('0x36')][_0x0580('0x1f')]);_0x212ce3[_0x0580('0x1e')]=qs['offset'](_0x457f1b[_0x0580('0x36')][_0x0580('0x1e')]);}_0x212ce3['order']=qs[_0x0580('0x3f')](_0x457f1b[_0x0580('0x36')][_0x0580('0x3f')]);_0x212ce3['where']=qs['filters'](_['pick'](_0x457f1b[_0x0580('0x36')],_0x3429ed['filters']));if(_0x457f1b[_0x0580('0x36')][_0x0580('0x40')]){_0x212ce3['where']=_['merge'](_0x212ce3[_0x0580('0x41')],{'$or':_[_0x0580('0x30')](_0x302f70,function(_0x523bc4){if(_0x523bc4[_0x0580('0x33')]!==_0x0580('0x42')){var _0x4c730e={};_0x4c730e[_0x523bc4[_0x0580('0x2d')]]={'$like':'%'+_0x457f1b[_0x0580('0x36')][_0x0580('0x40')]+'%'};return _0x4c730e;}})});}_0x212ce3=_[_0x0580('0x43')]({},_0x212ce3,_0x457f1b[_0x0580('0x44')]);var _0x4ed61b={'where':_0x212ce3[_0x0580('0x41')]};return db[_0x0580('0x31')][_0x0580('0x45')](_0x4ed61b)['then'](function(_0x4a7ee1){_0x2cfaf8['count']=_0x4a7ee1;if(_0x457f1b[_0x0580('0x36')]['includeAll']){_0x212ce3[_0x0580('0x46')]=[{'all':!![]}];}return db[_0x0580('0x31')][_0x0580('0x47')](_0x212ce3);})[_0x0580('0x26')](function(_0x5aa34e){_0x2cfaf8[_0x0580('0x48')]=_0x5aa34e;return _0x2cfaf8;})[_0x0580('0x26')](respondWithFilteredResult(_0x2522df,_0x212ce3))[_0x0580('0x49')](handleError(_0x2522df,null));};exports[_0x0580('0x4a')]=function(_0x215f3c,_0x4d6520){var _0x34cc7a={'raw':!![],'where':{'id':_0x215f3c[_0x0580('0x4b')]['id']}},_0x3c35f1={};_0x3c35f1[_0x0580('0x35')]=_[_0x0580('0x37')](db['FaxQueue'][_0x0580('0x32')]);_0x3c35f1[_0x0580('0x36')]=_[_0x0580('0x37')](_0x215f3c[_0x0580('0x36')]);_0x3c35f1[_0x0580('0x38')]=_[_0x0580('0x3a')](_0x3c35f1['model'],_0x3c35f1[_0x0580('0x36')]);_0x34cc7a[_0x0580('0x39')]=_[_0x0580('0x3a')](_0x3c35f1[_0x0580('0x35')],qs[_0x0580('0x3b')](_0x215f3c[_0x0580('0x36')][_0x0580('0x3b')]));_0x34cc7a[_0x0580('0x39')]=_0x34cc7a['attributes']['length']?_0x34cc7a[_0x0580('0x39')]:_0x3c35f1[_0x0580('0x35')];if(_0x215f3c['query'][_0x0580('0x4c')]){_0x34cc7a[_0x0580('0x46')]=[{'all':!![]}];}_0x34cc7a=_[_0x0580('0x43')]({},_0x34cc7a,_0x215f3c['options']);return db[_0x0580('0x31')][_0x0580('0x4d')](_0x34cc7a)['then'](handleEntityNotFound(_0x4d6520,null))['then'](respondWithResult(_0x4d6520,null))[_0x0580('0x49')](handleError(_0x4d6520,null));};exports['create']=function(_0x19a6d8,_0x489cb0){return db[_0x0580('0x31')][_0x0580('0x4e')](_0x19a6d8[_0x0580('0x4f')],{})[_0x0580('0x26')](function(_0x57d323){var _0x37fb93=_0x19a6d8[_0x0580('0x50')]['get']({'plain':!![]});if(!_0x37fb93)throw new Error(_0x0580('0x51'));if(_0x37fb93['role']===_0x0580('0x50')){var _0x522732=_0x57d323[_0x0580('0x27')]({'plain':!![]});var _0x24c5b2=_0x0580('0x28');return db[_0x0580('0x52')]['find']({'where':{'name':_0x24c5b2,'userProfileId':_0x37fb93[_0x0580('0x53')]},'raw':!![]})['then'](function(_0x9849cd){if(_0x9849cd&&_0x9849cd[_0x0580('0x54')]===0x0){return db[_0x0580('0x29')][_0x0580('0x4e')]({'name':_0x522732[_0x0580('0x2d')],'resourceId':_0x522732['id'],'type':_0x9849cd['name'],'sectionId':_0x9849cd['id']},{})[_0x0580('0x26')](function(){return _0x57d323;});}else{return _0x57d323;}})['catch'](function(_0x3f4251){logger['error'](_0x0580('0x55'),_0x3f4251);throw _0x3f4251;});}return _0x57d323;})[_0x0580('0x26')](respondWithResult(_0x489cb0,0xc9))['catch'](handleError(_0x489cb0,null));};exports['update']=function(_0x369ce7,_0x8714d9){if(_0x369ce7[_0x0580('0x4f')]['id']){delete _0x369ce7['body']['id'];}return db[_0x0580('0x31')][_0x0580('0x4d')]({'where':{'id':_0x369ce7[_0x0580('0x4b')]['id']}})[_0x0580('0x26')](handleEntityNotFound(_0x8714d9,null))[_0x0580('0x26')](saveUpdates(_0x369ce7['body'],null))[_0x0580('0x26')](respondWithResult(_0x8714d9,null))[_0x0580('0x49')](handleError(_0x8714d9,null));};exports[_0x0580('0x2a')]=function(_0x55612b,_0x1bec2c){return db['FaxQueue']['find']({'where':{'id':_0x55612b[_0x0580('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1bec2c,null))[_0x0580('0x26')](removeEntity(_0x1bec2c,null))[_0x0580('0x49')](handleError(_0x1bec2c,null));};exports['describe']=function(_0x4ddc78,_0x266263){return db[_0x0580('0x31')][_0x0580('0x56')]()[_0x0580('0x26')](respondWithResult(_0x266263,null))[_0x0580('0x49')](handleError(_0x266263,null));};exports[_0x0580('0x57')]=function(_0x269b48,_0x36a9c2,_0x2d6e33){var _0x70fbdd={'raw':!![],'where':{}},_0x5deae8={},_0x408166;return db[_0x0580('0x31')]['findOne']({'where':{'id':_0x269b48[_0x0580('0x4b')]['id']}})[_0x0580('0x26')](handleEntityNotFound(_0x36a9c2,null))[_0x0580('0x26')](function(_0x282c1a){if(_0x282c1a){_0x408166=_0x282c1a[_0x0580('0x27')]({'plain':!![]});_0x5deae8[_0x0580('0x35')]=_[_0x0580('0x37')](db['UserFaxQueue'][_0x0580('0x32')]);_0x5deae8[_0x0580('0x36')]=_['keys'](_0x269b48[_0x0580('0x36')]);_0x5deae8[_0x0580('0x38')]=_['intersection'](_0x5deae8[_0x0580('0x35')],_0x5deae8[_0x0580('0x36')]);_0x70fbdd['attributes']=_[_0x0580('0x3a')](_0x5deae8[_0x0580('0x35')],qs[_0x0580('0x3b')](_0x269b48[_0x0580('0x36')][_0x0580('0x3b')]));_0x70fbdd['attributes']=_0x70fbdd[_0x0580('0x39')]['length']?_0x70fbdd[_0x0580('0x39')]:_0x5deae8[_0x0580('0x35')];if(!_0x269b48['query'][_0x0580('0x3d')](_0x0580('0x3e'))){_0x70fbdd['limit']=qs[_0x0580('0x1f')](_0x269b48[_0x0580('0x36')][_0x0580('0x1f')]);_0x70fbdd[_0x0580('0x1e')]=qs[_0x0580('0x1e')](_0x269b48[_0x0580('0x36')][_0x0580('0x1e')]);}_0x70fbdd[_0x0580('0x58')]=qs[_0x0580('0x3f')](_0x269b48[_0x0580('0x36')]['sort']);_0x70fbdd[_0x0580('0x41')]=qs[_0x0580('0x38')](_[_0x0580('0x59')](_0x269b48[_0x0580('0x36')],_0x5deae8[_0x0580('0x38')]));_0x70fbdd[_0x0580('0x41')]['FaxQueueId']=_0x282c1a['id'];if(_0x269b48[_0x0580('0x36')][_0x0580('0x40')]){_0x70fbdd[_0x0580('0x41')]=_['merge'](_0x70fbdd[_0x0580('0x41')],{'$or':_['map'](_0x70fbdd['attributes'],function(_0xe85ab7){var _0x41e17b={};_0x41e17b[_0xe85ab7]={'$like':'%'+_0x269b48[_0x0580('0x36')][_0x0580('0x40')]+'%'};return _0x41e17b;})});}_0x70fbdd=_['merge']({},_0x70fbdd,_0x269b48['options']);return db[_0x0580('0x5a')][_0x0580('0x47')](_0x70fbdd);}})[_0x0580('0x26')](function(_0x48e277){if(_0x48e277){return db[_0x0580('0x5b')]['findAndCountAll']({'where':{'id':_['map'](_0x48e277,'UserId'),'role':_0x0580('0x5c')},'attributes':['id',_0x0580('0x2d'),_0x0580('0x5d'),'updatedAt',_0x0580('0x5e')]});}})['then'](function(_0x44ca4d){if(_0x44ca4d){return{'count':_0x44ca4d[_0x0580('0x45')],'rows':_[_0x0580('0x30')](_0x44ca4d['rows'],function(_0x1c2d91){return{'membername':_0x1c2d91['name'],'UserId':_0x1c2d91['id'],'queue_name':_0x408166[_0x0580('0x2d')],'FaxQueueId':_0x408166['id'],'interface':util['format']('%s/%s',_0x0580('0x5f'),_0x1c2d91['name']),'penalty':0x0,'paused':_0x1c2d91[_0x0580('0x5d')],'createdAt':_0x1c2d91[_0x0580('0x5e')],'updatedAt':_0x1c2d91[_0x0580('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0580('0x26')](respondWithFilteredResult(_0x36a9c2,_0x70fbdd))[_0x0580('0x49')](handleError(_0x36a9c2,null));};exports[_0x0580('0x61')]=function(_0x169c32,_0x48069d,_0xc602c3){var _0x243d70={};var _0x56c00f={};var _0x488e64;var _0x4704a9;return db[_0x0580('0x31')]['findOne']({'where':{'id':_0x169c32[_0x0580('0x4b')]['id']}})['then'](handleEntityNotFound(_0x48069d,null))[_0x0580('0x26')](function(_0x458852){if(_0x458852){_0x488e64=_0x458852;_0x56c00f[_0x0580('0x35')]=_[_0x0580('0x37')](db['Team'][_0x0580('0x32')]);_0x56c00f[_0x0580('0x36')]=_[_0x0580('0x37')](_0x169c32['query']);_0x56c00f[_0x0580('0x38')]=_[_0x0580('0x3a')](_0x56c00f[_0x0580('0x35')],_0x56c00f[_0x0580('0x36')]);_0x243d70['attributes']=_[_0x0580('0x3a')](_0x56c00f[_0x0580('0x35')],qs[_0x0580('0x3b')](_0x169c32[_0x0580('0x36')]['fields']));_0x243d70['attributes']=_0x243d70[_0x0580('0x39')][_0x0580('0x3c')]?_0x243d70[_0x0580('0x39')]:_0x56c00f['model'];_0x243d70[_0x0580('0x58')]=qs['sort'](_0x169c32[_0x0580('0x36')]['sort']);_0x243d70['where']=qs[_0x0580('0x38')](_['pick'](_0x169c32['query'],_0x56c00f[_0x0580('0x38')]));if(_0x169c32[_0x0580('0x36')]['filter']){_0x243d70['where']=_[_0x0580('0x43')](_0x243d70[_0x0580('0x41')],{'$or':_[_0x0580('0x30')](_0x243d70[_0x0580('0x39')],function(_0x26ad8a){var _0x5cd1a8={};_0x5cd1a8[_0x26ad8a]={'$like':'%'+_0x169c32[_0x0580('0x36')]['filter']+'%'};return _0x5cd1a8;})});}_0x243d70=_[_0x0580('0x43')]({},_0x243d70,_0x169c32[_0x0580('0x44')]);return _0x488e64[_0x0580('0x61')](_0x243d70);}})[_0x0580('0x26')](function(_0x15e390){if(_0x15e390){_0x4704a9=_0x15e390['length'];if(!_0x169c32[_0x0580('0x36')][_0x0580('0x3d')](_0x0580('0x3e'))){_0x243d70[_0x0580('0x1f')]=qs['limit'](_0x169c32['query']['limit']);_0x243d70[_0x0580('0x1e')]=qs[_0x0580('0x1e')](_0x169c32[_0x0580('0x36')][_0x0580('0x1e')]);}return _0x488e64[_0x0580('0x61')](_0x243d70);}})[_0x0580('0x26')](function(_0x43de30){if(_0x43de30){return _0x43de30?{'count':_0x4704a9,'rows':_0x43de30}:null;}})[_0x0580('0x26')](respondWithResult(_0x48069d,null))['catch'](handleError(_0x48069d,null));};exports['addTeams']=function(_0x552bcf,_0x3d3e21,_0x5a9d02){var _0x2f7c5a=_0x552bcf[_0x0580('0x4f')][_0x0580('0x62')];return db[_0x0580('0x63')]['findAll']({'where':{'id':_0x2f7c5a},'attributes':['id'],'include':[{'model':db['User'],'as':_0x0580('0x64'),'attributes':['id',_0x0580('0x2d'),_0x0580('0x65'),_0x0580('0x66'),'interface'],'raw':!![]}]})[_0x0580('0x26')](function(_0x45e4de){if(_0x45e4de){var _0x356956=_['flatMap'](_0x45e4de,function(_0xc0e897){var _0x4f1be7=_0xc0e897[_0x0580('0x27')]({'plain':!![]});return _0x4f1be7[_0x0580('0x64')];});return db[_0x0580('0x31')]['find']({'where':{'id':_0x552bcf['params']['id']}})['then'](function(_0x4fb7da){return db[_0x0580('0x67')]['transaction'](function(_0x2d2692){return _0x4fb7da['addTeams'](_0x2f7c5a,{'transaction':_0x2d2692})[_0x0580('0x26')](function(){return BPromise[_0x0580('0x68')](_0x356956,function(_0x15b95f){return db['UserFaxQueue'][_0x0580('0x69')]({'where':{'UserId':_0x15b95f['id'],'FaxQueueId':_0x552bcf['params']['id']},'transaction':_0x2d2692});});})[_0x0580('0x26')](function(){_0x356956[_0x0580('0x6a')](function(_0x96eaf5){socket[_0x0580('0x6b')]('userFaxQueue:save',{'UserId':_0x96eaf5['id'],'FaxQueueId':_0x4fb7da['id']});});});});});}})['then'](respondWithStatusCode(_0x3d3e21,null))[_0x0580('0x49')](handleError(_0x3d3e21,null));};exports[_0x0580('0x6c')]=function(_0x2252bc,_0x297d1a,_0x1359a5){return db[_0x0580('0x63')][_0x0580('0x47')]({'where':{'id':_0x2252bc['query'][_0x0580('0x62')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0x0580('0x26')](handleEntityNotFound(_0x297d1a,null))[_0x0580('0x26')](function(_0xcfe959){var _0x3bb1ff=_['map'](_0xcfe959,'id');var _0x55e9d6=[];var _0x5d2d78=[];var _0x59fef6=squel['select']();_0x59fef6[_0x0580('0x6d')](_0x0580('0x6e'))[_0x0580('0x6f')](_0x0580('0x70'),'tq')[_0x0580('0x71')](_0x0580('0x72'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0x0580('0x41')](_0x0580('0x73'),_0x2252bc[_0x0580('0x4b')]['id']);for(var _0x485ca5=0x0;_0x485ca5<_0xcfe959[_0x0580('0x3c')];_0x485ca5+=0x1){let _0x3f0f87=_0xcfe959[_0x485ca5];for(var _0x3a0f3a=0x0;_0x3a0f3a<_0x3f0f87[_0x0580('0x64')][_0x0580('0x3c')];_0x3a0f3a+=0x1){let _0x487c19=_0x3f0f87['Agents'][_0x3a0f3a];var _0x77db84=_0x59fef6[_0x0580('0x74')]();_0x77db84[_0x0580('0x41')](_0x0580('0x75'),_0x487c19['id']);_0x5d2d78['push'](db['sequelize']['query'](_0x77db84[_0x0580('0x76')](),{'type':db[_0x0580('0x67')][_0x0580('0x77')]['SELECT']})[_0x0580('0x26')](function(_0x3ba55b){if(_0x3ba55b['length']===0x1){return _0x487c19['id'];}else{var _0x4a422a=_[_0x0580('0x78')](_[_0x0580('0x30')](_0x3ba55b,_0x0580('0x79')),function(_0x4222ba){return _[_0x0580('0x7a')](_0x3bb1ff,_0x4222ba);});if(_0x4a422a){return _0x487c19['id'];}}}));}}return BPromise[_0x0580('0x7b')](_0x5d2d78)[_0x0580('0x26')](function(_0x932b25){_0x55e9d6=_(_0x55e9d6)[_0x0580('0x7c')](_0x932b25)['compact']()[_0x0580('0x7d')]();return db['FaxQueue'][_0x0580('0x4d')]({'where':{'id':_0x2252bc[_0x0580('0x4b')]['id']}})[_0x0580('0x26')](function(_0x5318c5){return db[_0x0580('0x67')]['transaction'](function(_0x3f50c1){return _0x5318c5['removeTeams'](_0x2252bc[_0x0580('0x36')][_0x0580('0x62')],{'transaction':_0x3f50c1})[_0x0580('0x26')](function(){if(!_[_0x0580('0x7e')](_0x55e9d6)){return _0x5318c5['removeAgents'](_0x55e9d6,{'transaction':_0x3f50c1});}})[_0x0580('0x26')](function(){_0x55e9d6[_0x0580('0x6a')](function(_0x2ce6b0){socket['emit']('userFaxQueue:remove',{'UserId':_0x2ce6b0,'FaxQueueId':_0x5318c5['id']});});});});});});})[_0x0580('0x26')](respondWithStatusCode(_0x297d1a,null))[_0x0580('0x49')](handleError(_0x297d1a,null));};exports[_0x0580('0x7f')]=function(_0x19d470,_0x9a0e94,_0x64d12c){return db['FaxQueue'][_0x0580('0x4d')]({'where':{'id':_0x19d470[_0x0580('0x4b')]['id']}})['then'](handleEntityNotFound(_0x9a0e94,null))['then'](function(_0x33e11d){if(_0x33e11d){return _0x33e11d[_0x0580('0x7f')](_0x19d470[_0x0580('0x4f')][_0x0580('0x62')],_[_0x0580('0x80')](_0x19d470[_0x0580('0x4f')],['ids','id'])||{})['spread'](function(_0x4af30e){for(var _0x415090=0x0;_0x415090<_0x19d470[_0x0580('0x4f')][_0x0580('0x62')][_0x0580('0x3c')];_0x415090+=0x1){socket[_0x0580('0x6b')]('userFaxQueue:save',{'UserId':_0x19d470[_0x0580('0x4f')][_0x0580('0x62')][_0x415090],'FaxQueueId':_0x19d470[_0x0580('0x4b')]['id']});}return _0x4af30e;});}})[_0x0580('0x26')](respondWithResult(_0x9a0e94,null))[_0x0580('0x49')](handleError(_0x9a0e94,null));};exports[_0x0580('0x81')]=function(_0x1e7c0a,_0x79f6eb,_0x114f62){return db['FaxQueue']['find']({'where':{'id':_0x1e7c0a[_0x0580('0x4b')]['id']}})[_0x0580('0x26')](handleEntityNotFound(_0x79f6eb,null))[_0x0580('0x26')](function(_0x561b97){if(_0x561b97){return _0x561b97[_0x0580('0x81')](_0x1e7c0a['query'][_0x0580('0x62')])[_0x0580('0x26')](function(){if(_[_0x0580('0x82')](_0x1e7c0a['query']['ids'])){for(var _0x1c4c71=0x0;_0x1c4c71<_0x1e7c0a[_0x0580('0x36')][_0x0580('0x62')][_0x0580('0x3c')];_0x1c4c71+=0x1){socket[_0x0580('0x6b')](_0x0580('0x83'),{'UserId':Number(_0x1e7c0a['query']['ids'][_0x1c4c71]),'FaxQueueId':Number(_0x1e7c0a[_0x0580('0x4b')]['id'])});}}else{socket[_0x0580('0x6b')](_0x0580('0x83'),{'UserId':Number(_0x1e7c0a[_0x0580('0x36')][_0x0580('0x62')]),'FaxQueueId':Number(_0x1e7c0a[_0x0580('0x4b')]['id'])});}});}})[_0x0580('0x26')](respondWithStatusCode(_0x79f6eb,null))[_0x0580('0x49')](handleError(_0x79f6eb,null));};exports[_0x0580('0x84')]=function(_0x46478d,_0x2d42cc,_0x39b3e1){var _0x36127d={};var _0x6efd07={};var _0x15abca;var _0x5b01bb;return db[_0x0580('0x31')][_0x0580('0x85')]({'where':{'id':_0x46478d['params']['id']}})[_0x0580('0x26')](handleEntityNotFound(_0x2d42cc,null))[_0x0580('0x26')](function(_0x144b5f){if(_0x144b5f){_0x15abca=_0x144b5f;_0x6efd07[_0x0580('0x35')]=_[_0x0580('0x37')](db['User'][_0x0580('0x32')]);_0x6efd07[_0x0580('0x36')]=_[_0x0580('0x37')](_0x46478d[_0x0580('0x36')]);_0x6efd07[_0x0580('0x38')]=_[_0x0580('0x3a')](_0x6efd07[_0x0580('0x35')],_0x6efd07[_0x0580('0x36')]);_0x36127d[_0x0580('0x39')]=_[_0x0580('0x3a')](_0x6efd07['model'],qs['fields'](_0x46478d[_0x0580('0x36')][_0x0580('0x3b')]));_0x36127d['attributes']=_0x36127d[_0x0580('0x39')]['length']?_0x36127d['attributes']:_0x6efd07[_0x0580('0x35')];_0x36127d['order']=qs[_0x0580('0x3f')](_0x46478d[_0x0580('0x36')][_0x0580('0x3f')]);_0x36127d[_0x0580('0x41')]=qs['filters'](_[_0x0580('0x59')](_0x46478d[_0x0580('0x36')],_0x6efd07[_0x0580('0x38')]));if(_0x46478d['query']['filter']){_0x36127d[_0x0580('0x41')]=_[_0x0580('0x43')](_0x36127d['where'],{'$or':_[_0x0580('0x30')](_0x36127d['attributes'],function(_0x32a351){var _0xfd8dd3={};_0xfd8dd3[_0x32a351]={'$like':'%'+_0x46478d[_0x0580('0x36')][_0x0580('0x40')]+'%'};return _0xfd8dd3;})});}_0x36127d=_[_0x0580('0x43')]({},_0x36127d,_0x46478d[_0x0580('0x44')]);return _0x15abca[_0x0580('0x84')](_0x36127d);}})[_0x0580('0x26')](function(_0x8f7a7f){if(_0x8f7a7f){_0x5b01bb=_0x8f7a7f[_0x0580('0x3c')];if(!_0x46478d['query'][_0x0580('0x3d')]('nolimit')){_0x36127d[_0x0580('0x1f')]=qs[_0x0580('0x1f')](_0x46478d[_0x0580('0x36')]['limit']);_0x36127d[_0x0580('0x1e')]=qs[_0x0580('0x1e')](_0x46478d[_0x0580('0x36')]['offset']);}return _0x15abca['getAgents'](_0x36127d);}})[_0x0580('0x26')](function(_0x1d9034){if(_0x1d9034){return _0x1d9034?{'count':_0x5b01bb,'rows':_0x1d9034}:null;}})['then'](respondWithResult(_0x2d42cc,null))[_0x0580('0x49')](handleError(_0x2d42cc,null));}; \ No newline at end of file +var _0x7df3=['agent','updatedAt','rows','format','%s/%s','faxPause','createdAt','Team','options','getTeams','addTeams','ids','User','Agents','interface','sequelize','transaction','UserFaxQueue','findOrCreate','forEach','emit','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','all','compact','value','isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','userFaxQueue:save','isArray','getAgents','html-pdf','eml-format','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','./faxQueue.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','FaxQueues','UserProfileResource','sendStatus','error','name','send','index','map','FaxQueue','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','VIRTUAL','filter','include','catch','show','params','keys','length','merge','find','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','FaxQueueId','findAll','UserId'];(function(_0xbe41ba,_0x384563){var _0x2c2085=function(_0x146ee7){while(--_0x146ee7){_0xbe41ba['push'](_0xbe41ba['shift']());}};_0x2c2085(++_0x384563);}(_0x7df3,0x1cc));var _0x37df=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0x7df3[_0x5b561d];return _0x431060;};'use strict';var pdf=require(_0x37df('0x0'));var emlformat=require(_0x37df('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x37df('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x37df('0x3'));var moment=require('moment');var BPromise=require(_0x37df('0x4'));var Mustache=require('mustache');var util=require(_0x37df('0x5'));var path=require(_0x37df('0x6'));var sox=require(_0x37df('0x7'));var csv=require(_0x37df('0x8'));var ejs=require(_0x37df('0x9'));var fs=require('fs');var _=require(_0x37df('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x37df('0xb'));var toCsv=require(_0x37df('0x8'));var querystring=require(_0x37df('0xc'));var Papa=require(_0x37df('0xd'));var Redis=require('ioredis');var authService=require(_0x37df('0xe'));var qs=require(_0x37df('0xf'));var as=require(_0x37df('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37df('0x11'))(_0x37df('0x12'));var utils=require(_0x37df('0x13'));var config=require('../../config/environment');var db=require(_0x37df('0x14'))['db'];config[_0x37df('0x15')]=_[_0x37df('0x16')](config[_0x37df('0x15')],{'host':_0x37df('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x37df('0x15')]));require(_0x37df('0x18'))[_0x37df('0x19')](socket);function respondWithStatusCode(_0x497eae,_0x315253){_0x315253=_0x315253||0xcc;return function(_0x2cf240){if(_0x2cf240){return _0x497eae['sendStatus'](_0x315253);}return _0x497eae['status'](_0x315253)['end']();};}function respondWithResult(_0x23d4c4,_0x425c3b){_0x425c3b=_0x425c3b||0xc8;return function(_0x3ed1fa){if(_0x3ed1fa){return _0x23d4c4[_0x37df('0x1a')](_0x425c3b)[_0x37df('0x1b')](_0x3ed1fa);}};}function respondWithFilteredResult(_0xcafa08,_0x39779e){return function(_0x3f48a4){if(_0x3f48a4){var _0x2ddebe=_0x3f48a4[_0x37df('0x1c')],_0x298954=_0x39779e[_0x37df('0x1d')],_0x402b13=_0x39779e['offset']+_0x39779e[_0x37df('0x1e')],_0x1e2ef2;if(_0x402b13>=_0x2ddebe){_0x402b13=_0x2ddebe;_0x1e2ef2=0xc8;}else{_0x1e2ef2=0xce;}_0xcafa08['status'](_0x1e2ef2);return _0xcafa08[_0x37df('0x1f')](_0x37df('0x20'),_0x298954+'-'+_0x402b13+'/'+_0x2ddebe)['json'](_0x3f48a4);}return null;};}function patchUpdates(_0x3b4974){return function(_0x3ab324){try{jsonpatch[_0x37df('0x21')](_0x3ab324,_0x3b4974,!![]);}catch(_0x34508a){return BPromise[_0x37df('0x22')](_0x34508a);}return _0x3ab324[_0x37df('0x23')]();};}function saveUpdates(_0x47d163,_0x365a76){return function(_0x515f61){if(_0x515f61){return _0x515f61[_0x37df('0x24')](_0x47d163)['then'](function(_0x49c1fb){return _0x49c1fb;});}return null;};}function removeEntity(_0x4827ef,_0x20f991){return function(_0x4c32b8){if(_0x4c32b8){return _0x4c32b8[_0x37df('0x25')]()[_0x37df('0x26')](function(){var _0x305b1d=_0x4c32b8['get']({'plain':!![]});var _0x4bb17d=_0x37df('0x27');return db[_0x37df('0x28')]['destroy']({'where':{'type':_0x4bb17d,'resourceId':_0x305b1d['id']}})[_0x37df('0x26')](function(){return _0x4c32b8;});})[_0x37df('0x26')](function(){_0x4827ef[_0x37df('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x220cea,_0x43ef2a){return function(_0x2a4495){if(!_0x2a4495){_0x220cea[_0x37df('0x29')](0x194);}return _0x2a4495;};}function handleError(_0x5eb090,_0xcb9370){_0xcb9370=_0xcb9370||0x1f4;return function(_0x325870){logger[_0x37df('0x2a')](_0x325870['stack']);if(_0x325870['name']){delete _0x325870[_0x37df('0x2b')];}_0x5eb090['status'](_0xcb9370)[_0x37df('0x2c')](_0x325870);};}exports[_0x37df('0x2d')]=function(_0x1e3701,_0x220740){var _0x518c70={},_0x534522={},_0x3ccf8c={'count':0x0,'rows':[]};var _0xd0c72c=_[_0x37df('0x2e')](db[_0x37df('0x2f')][_0x37df('0x30')],function(_0x14b38a){return{'name':_0x14b38a[_0x37df('0x31')],'type':_0x14b38a[_0x37df('0x32')][_0x37df('0x33')]};});_0x534522[_0x37df('0x34')]=_[_0x37df('0x2e')](_0xd0c72c,_0x37df('0x2b'));_0x534522[_0x37df('0x35')]=_['keys'](_0x1e3701[_0x37df('0x35')]);_0x534522[_0x37df('0x36')]=_[_0x37df('0x37')](_0x534522[_0x37df('0x34')],_0x534522['query']);_0x518c70[_0x37df('0x38')]=_['intersection'](_0x534522['model'],qs[_0x37df('0x39')](_0x1e3701['query'][_0x37df('0x39')]));_0x518c70[_0x37df('0x38')]=_0x518c70[_0x37df('0x38')]['length']?_0x518c70[_0x37df('0x38')]:_0x534522[_0x37df('0x34')];if(!_0x1e3701[_0x37df('0x35')][_0x37df('0x3a')](_0x37df('0x3b'))){_0x518c70[_0x37df('0x1e')]=qs['limit'](_0x1e3701[_0x37df('0x35')]['limit']);_0x518c70['offset']=qs[_0x37df('0x1d')](_0x1e3701[_0x37df('0x35')]['offset']);}_0x518c70[_0x37df('0x3c')]=qs[_0x37df('0x3d')](_0x1e3701[_0x37df('0x35')][_0x37df('0x3d')]);_0x518c70['where']=qs[_0x37df('0x36')](_[_0x37df('0x3e')](_0x1e3701['query'],_0x534522['filters']));if(_0x1e3701[_0x37df('0x35')]['filter']){_0x518c70[_0x37df('0x3f')]=_['merge'](_0x518c70[_0x37df('0x3f')],{'$or':_['map'](_0xd0c72c,function(_0x411cde){if(_0x411cde[_0x37df('0x32')]!==_0x37df('0x40')){var _0x5ea161={};_0x5ea161[_0x411cde['name']]={'$like':'%'+_0x1e3701[_0x37df('0x35')][_0x37df('0x41')]+'%'};return _0x5ea161;}})});}_0x518c70=_['merge']({},_0x518c70,_0x1e3701['options']);var _0x56300c={'where':_0x518c70['where']};return db[_0x37df('0x2f')]['count'](_0x56300c)[_0x37df('0x26')](function(_0x293577){_0x3ccf8c[_0x37df('0x1c')]=_0x293577;if(_0x1e3701[_0x37df('0x35')]['includeAll']){_0x518c70[_0x37df('0x42')]=[{'all':!![]}];}return db['FaxQueue']['findAll'](_0x518c70);})[_0x37df('0x26')](function(_0x383753){_0x3ccf8c['rows']=_0x383753;return _0x3ccf8c;})['then'](respondWithFilteredResult(_0x220740,_0x518c70))[_0x37df('0x43')](handleError(_0x220740,null));};exports[_0x37df('0x44')]=function(_0x4efc1a,_0x2d3efb){var _0x307751={'raw':!![],'where':{'id':_0x4efc1a[_0x37df('0x45')]['id']}},_0x461da8={};_0x461da8[_0x37df('0x34')]=_['keys'](db[_0x37df('0x2f')][_0x37df('0x30')]);_0x461da8['query']=_[_0x37df('0x46')](_0x4efc1a[_0x37df('0x35')]);_0x461da8[_0x37df('0x36')]=_[_0x37df('0x37')](_0x461da8[_0x37df('0x34')],_0x461da8[_0x37df('0x35')]);_0x307751[_0x37df('0x38')]=_['intersection'](_0x461da8[_0x37df('0x34')],qs[_0x37df('0x39')](_0x4efc1a[_0x37df('0x35')]['fields']));_0x307751[_0x37df('0x38')]=_0x307751[_0x37df('0x38')][_0x37df('0x47')]?_0x307751['attributes']:_0x461da8['model'];if(_0x4efc1a['query']['includeAll']){_0x307751[_0x37df('0x42')]=[{'all':!![]}];}_0x307751=_[_0x37df('0x48')]({},_0x307751,_0x4efc1a['options']);return db[_0x37df('0x2f')][_0x37df('0x49')](_0x307751)[_0x37df('0x26')](handleEntityNotFound(_0x2d3efb,null))[_0x37df('0x26')](respondWithResult(_0x2d3efb,null))['catch'](handleError(_0x2d3efb,null));};exports[_0x37df('0x4a')]=function(_0x2b9a46,_0x3bc58f){return db[_0x37df('0x2f')][_0x37df('0x4a')](_0x2b9a46['body'],{})[_0x37df('0x26')](function(_0x31c793){var _0x26fb0c=_0x2b9a46['user'][_0x37df('0x4b')]({'plain':!![]});if(!_0x26fb0c)throw new Error(_0x37df('0x4c'));if(_0x26fb0c['role']==='user'){var _0x844d8e=_0x31c793['get']({'plain':!![]});var _0x5d4cd9=_0x37df('0x27');return db[_0x37df('0x4d')][_0x37df('0x49')]({'where':{'name':_0x5d4cd9,'userProfileId':_0x26fb0c[_0x37df('0x4e')]},'raw':!![]})[_0x37df('0x26')](function(_0x4cadb8){if(_0x4cadb8&&_0x4cadb8[_0x37df('0x4f')]===0x0){return db[_0x37df('0x28')][_0x37df('0x4a')]({'name':_0x844d8e['name'],'resourceId':_0x844d8e['id'],'type':_0x4cadb8['name'],'sectionId':_0x4cadb8['id']},{})[_0x37df('0x26')](function(){return _0x31c793;});}else{return _0x31c793;}})[_0x37df('0x43')](function(_0x2d286e){logger['error'](_0x37df('0x50'),_0x2d286e);throw _0x2d286e;});}return _0x31c793;})[_0x37df('0x26')](respondWithResult(_0x3bc58f,0xc9))['catch'](handleError(_0x3bc58f,null));};exports['update']=function(_0x32615b,_0x14de47){if(_0x32615b[_0x37df('0x51')]['id']){delete _0x32615b[_0x37df('0x51')]['id'];}return db[_0x37df('0x2f')][_0x37df('0x49')]({'where':{'id':_0x32615b['params']['id']}})[_0x37df('0x26')](handleEntityNotFound(_0x14de47,null))[_0x37df('0x26')](saveUpdates(_0x32615b[_0x37df('0x51')],null))[_0x37df('0x26')](respondWithResult(_0x14de47,null))[_0x37df('0x43')](handleError(_0x14de47,null));};exports[_0x37df('0x25')]=function(_0x3eb544,_0x39d12b){return db[_0x37df('0x2f')]['find']({'where':{'id':_0x3eb544[_0x37df('0x45')]['id']}})['then'](handleEntityNotFound(_0x39d12b,null))[_0x37df('0x26')](removeEntity(_0x39d12b,null))[_0x37df('0x43')](handleError(_0x39d12b,null));};exports[_0x37df('0x52')]=function(_0x24984a,_0x3fcc9d){return db[_0x37df('0x2f')][_0x37df('0x52')]()[_0x37df('0x26')](respondWithResult(_0x3fcc9d,null))[_0x37df('0x43')](handleError(_0x3fcc9d,null));};exports[_0x37df('0x53')]=function(_0x1e2969,_0x23dd25,_0x15d137){var _0x5d1ddf={'raw':!![],'where':{}},_0x163206={},_0x123bd7;return db[_0x37df('0x2f')][_0x37df('0x54')]({'where':{'id':_0x1e2969['params']['id']}})[_0x37df('0x26')](handleEntityNotFound(_0x23dd25,null))[_0x37df('0x26')](function(_0x5ec368){if(_0x5ec368){_0x123bd7=_0x5ec368[_0x37df('0x4b')]({'plain':!![]});_0x163206[_0x37df('0x34')]=_[_0x37df('0x46')](db['UserFaxQueue']['rawAttributes']);_0x163206[_0x37df('0x35')]=_[_0x37df('0x46')](_0x1e2969[_0x37df('0x35')]);_0x163206['filters']=_[_0x37df('0x37')](_0x163206[_0x37df('0x34')],_0x163206[_0x37df('0x35')]);_0x5d1ddf[_0x37df('0x38')]=_[_0x37df('0x37')](_0x163206[_0x37df('0x34')],qs[_0x37df('0x39')](_0x1e2969[_0x37df('0x35')][_0x37df('0x39')]));_0x5d1ddf[_0x37df('0x38')]=_0x5d1ddf['attributes'][_0x37df('0x47')]?_0x5d1ddf[_0x37df('0x38')]:_0x163206[_0x37df('0x34')];if(!_0x1e2969[_0x37df('0x35')]['hasOwnProperty'](_0x37df('0x3b'))){_0x5d1ddf[_0x37df('0x1e')]=qs[_0x37df('0x1e')](_0x1e2969[_0x37df('0x35')][_0x37df('0x1e')]);_0x5d1ddf[_0x37df('0x1d')]=qs[_0x37df('0x1d')](_0x1e2969[_0x37df('0x35')][_0x37df('0x1d')]);}_0x5d1ddf[_0x37df('0x3c')]=qs[_0x37df('0x3d')](_0x1e2969[_0x37df('0x35')][_0x37df('0x3d')]);_0x5d1ddf[_0x37df('0x3f')]=qs[_0x37df('0x36')](_[_0x37df('0x3e')](_0x1e2969['query'],_0x163206['filters']));_0x5d1ddf[_0x37df('0x3f')][_0x37df('0x55')]=_0x5ec368['id'];if(_0x1e2969[_0x37df('0x35')][_0x37df('0x41')]){_0x5d1ddf['where']=_['merge'](_0x5d1ddf[_0x37df('0x3f')],{'$or':_[_0x37df('0x2e')](_0x5d1ddf[_0x37df('0x38')],function(_0x20ee3a){var _0x2dc3a6={};_0x2dc3a6[_0x20ee3a]={'$like':'%'+_0x1e2969[_0x37df('0x35')][_0x37df('0x41')]+'%'};return _0x2dc3a6;})});}_0x5d1ddf=_[_0x37df('0x48')]({},_0x5d1ddf,_0x1e2969['options']);return db['UserFaxQueue'][_0x37df('0x56')](_0x5d1ddf);}})[_0x37df('0x26')](function(_0x8f99){if(_0x8f99){return db['User']['findAndCountAll']({'where':{'id':_[_0x37df('0x2e')](_0x8f99,_0x37df('0x57')),'role':_0x37df('0x58')},'attributes':['id',_0x37df('0x2b'),'faxPause',_0x37df('0x59'),'createdAt']});}})[_0x37df('0x26')](function(_0x1afa7a){if(_0x1afa7a){return{'count':_0x1afa7a['count'],'rows':_[_0x37df('0x2e')](_0x1afa7a[_0x37df('0x5a')],function(_0x5ecf23){return{'membername':_0x5ecf23[_0x37df('0x2b')],'UserId':_0x5ecf23['id'],'queue_name':_0x123bd7[_0x37df('0x2b')],'FaxQueueId':_0x123bd7['id'],'interface':util[_0x37df('0x5b')](_0x37df('0x5c'),'SIP',_0x5ecf23[_0x37df('0x2b')]),'penalty':0x0,'paused':_0x5ecf23[_0x37df('0x5d')],'createdAt':_0x5ecf23[_0x37df('0x5e')],'updatedAt':_0x5ecf23[_0x37df('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x37df('0x26')](respondWithFilteredResult(_0x23dd25,_0x5d1ddf))['catch'](handleError(_0x23dd25,null));};exports['getTeams']=function(_0x4ac02a,_0x3545e0,_0x28e426){var _0x113ab9={};var _0x3ccd58={};var _0x130b56;var _0x14561a;return db[_0x37df('0x2f')][_0x37df('0x54')]({'where':{'id':_0x4ac02a[_0x37df('0x45')]['id']}})[_0x37df('0x26')](handleEntityNotFound(_0x3545e0,null))['then'](function(_0x38442c){if(_0x38442c){_0x130b56=_0x38442c;_0x3ccd58['model']=_[_0x37df('0x46')](db[_0x37df('0x5f')][_0x37df('0x30')]);_0x3ccd58['query']=_['keys'](_0x4ac02a['query']);_0x3ccd58[_0x37df('0x36')]=_['intersection'](_0x3ccd58['model'],_0x3ccd58[_0x37df('0x35')]);_0x113ab9['attributes']=_['intersection'](_0x3ccd58[_0x37df('0x34')],qs[_0x37df('0x39')](_0x4ac02a[_0x37df('0x35')][_0x37df('0x39')]));_0x113ab9[_0x37df('0x38')]=_0x113ab9[_0x37df('0x38')][_0x37df('0x47')]?_0x113ab9[_0x37df('0x38')]:_0x3ccd58[_0x37df('0x34')];_0x113ab9['order']=qs['sort'](_0x4ac02a['query'][_0x37df('0x3d')]);_0x113ab9[_0x37df('0x3f')]=qs['filters'](_[_0x37df('0x3e')](_0x4ac02a[_0x37df('0x35')],_0x3ccd58[_0x37df('0x36')]));if(_0x4ac02a['query'][_0x37df('0x41')]){_0x113ab9[_0x37df('0x3f')]=_['merge'](_0x113ab9[_0x37df('0x3f')],{'$or':_[_0x37df('0x2e')](_0x113ab9[_0x37df('0x38')],function(_0x3ba427){var _0x91c94b={};_0x91c94b[_0x3ba427]={'$like':'%'+_0x4ac02a[_0x37df('0x35')]['filter']+'%'};return _0x91c94b;})});}_0x113ab9=_[_0x37df('0x48')]({},_0x113ab9,_0x4ac02a[_0x37df('0x60')]);return _0x130b56['getTeams'](_0x113ab9);}})['then'](function(_0x387362){if(_0x387362){_0x14561a=_0x387362['length'];if(!_0x4ac02a['query'][_0x37df('0x3a')](_0x37df('0x3b'))){_0x113ab9['limit']=qs['limit'](_0x4ac02a[_0x37df('0x35')][_0x37df('0x1e')]);_0x113ab9[_0x37df('0x1d')]=qs[_0x37df('0x1d')](_0x4ac02a[_0x37df('0x35')][_0x37df('0x1d')]);}return _0x130b56[_0x37df('0x61')](_0x113ab9);}})[_0x37df('0x26')](function(_0x598cdf){if(_0x598cdf){return _0x598cdf?{'count':_0x14561a,'rows':_0x598cdf}:null;}})[_0x37df('0x26')](respondWithResult(_0x3545e0,null))['catch'](handleError(_0x3545e0,null));};exports[_0x37df('0x62')]=function(_0x1f9d38,_0x4c1c61,_0x371b63){var _0x6f8a7a=_0x1f9d38[_0x37df('0x51')][_0x37df('0x63')];return db[_0x37df('0x5f')]['findAll']({'where':{'id':_0x6f8a7a},'attributes':['id'],'include':[{'model':db[_0x37df('0x64')],'as':_0x37df('0x65'),'attributes':['id',_0x37df('0x2b'),'online','voicePause',_0x37df('0x66')],'raw':!![]}]})[_0x37df('0x26')](function(_0x42149c){if(_0x42149c){var _0x586b7c=_['flatMap'](_0x42149c,function(_0xf5eace){var _0x1c723f=_0xf5eace[_0x37df('0x4b')]({'plain':!![]});return _0x1c723f['Agents'];});return db['FaxQueue'][_0x37df('0x49')]({'where':{'id':_0x1f9d38[_0x37df('0x45')]['id']}})[_0x37df('0x26')](function(_0x4453cc){return db[_0x37df('0x67')][_0x37df('0x68')](function(_0x143041){return _0x4453cc[_0x37df('0x62')](_0x6f8a7a,{'transaction':_0x143041})[_0x37df('0x26')](function(){return BPromise['each'](_0x586b7c,function(_0x442115){return db[_0x37df('0x69')][_0x37df('0x6a')]({'where':{'UserId':_0x442115['id'],'FaxQueueId':_0x1f9d38[_0x37df('0x45')]['id']},'transaction':_0x143041});});})[_0x37df('0x26')](function(){_0x586b7c[_0x37df('0x6b')](function(_0x48e5ab){socket[_0x37df('0x6c')]('userFaxQueue:save',{'UserId':_0x48e5ab['id'],'FaxQueueId':_0x4453cc['id']});});});});});}})[_0x37df('0x26')](respondWithStatusCode(_0x4c1c61,null))[_0x37df('0x43')](handleError(_0x4c1c61,null));};exports[_0x37df('0x6d')]=function(_0x5b1980,_0x33e138,_0x2a2e01){return db[_0x37df('0x5f')][_0x37df('0x56')]({'where':{'id':_0x5b1980['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x37df('0x64')],'as':_0x37df('0x65'),'attributes':['id'],'raw':!![]}]})[_0x37df('0x26')](handleEntityNotFound(_0x33e138,null))['then'](function(_0x43afe0){var _0x1e02fe=_[_0x37df('0x2e')](_0x43afe0,'id');var _0x176938=[];var _0x7ae388=[];var _0x205536=squel[_0x37df('0x6e')]();_0x205536[_0x37df('0x6f')](_0x37df('0x70'))[_0x37df('0x71')](_0x37df('0x72'),'tq')[_0x37df('0x73')](_0x37df('0x74'),'ut',_0x37df('0x75'))[_0x37df('0x3f')](_0x37df('0x76'),_0x5b1980[_0x37df('0x45')]['id']);for(var _0x2138be=0x0;_0x2138be<_0x43afe0[_0x37df('0x47')];_0x2138be+=0x1){let _0x1402a2=_0x43afe0[_0x2138be];for(var _0x9d2e6c=0x0;_0x9d2e6c<_0x1402a2[_0x37df('0x65')][_0x37df('0x47')];_0x9d2e6c+=0x1){let _0x237829=_0x1402a2[_0x37df('0x65')][_0x9d2e6c];var _0x1ef2e1=_0x205536[_0x37df('0x77')]();_0x1ef2e1[_0x37df('0x3f')](_0x37df('0x78'),_0x237829['id']);_0x7ae388[_0x37df('0x79')](db[_0x37df('0x67')][_0x37df('0x35')](_0x1ef2e1[_0x37df('0x7a')](),{'type':db[_0x37df('0x67')][_0x37df('0x7b')]['SELECT']})[_0x37df('0x26')](function(_0x4fd106){if(_0x4fd106[_0x37df('0x47')]===0x1){return _0x237829['id'];}else{var _0x2e58ac=_[_0x37df('0x7c')](_[_0x37df('0x2e')](_0x4fd106,_0x37df('0x7d')),function(_0x3d6c4b){return _['includes'](_0x1e02fe,_0x3d6c4b);});if(_0x2e58ac){return _0x237829['id'];}}}));}}return BPromise[_0x37df('0x7e')](_0x7ae388)[_0x37df('0x26')](function(_0x3534c4){_0x176938=_(_0x176938)['union'](_0x3534c4)[_0x37df('0x7f')]()[_0x37df('0x80')]();return db[_0x37df('0x2f')][_0x37df('0x49')]({'where':{'id':_0x5b1980['params']['id']}})['then'](function(_0x5373fe){return db[_0x37df('0x67')]['transaction'](function(_0x2b9600){return _0x5373fe[_0x37df('0x6d')](_0x5b1980[_0x37df('0x35')]['ids'],{'transaction':_0x2b9600})['then'](function(){if(!_[_0x37df('0x81')](_0x176938)){return _0x5373fe[_0x37df('0x82')](_0x176938,{'transaction':_0x2b9600});}})['then'](function(){_0x176938['forEach'](function(_0x1b2c75){socket[_0x37df('0x6c')](_0x37df('0x83'),{'UserId':_0x1b2c75,'FaxQueueId':_0x5373fe['id']});});});});});});})['then'](respondWithStatusCode(_0x33e138,null))['catch'](handleError(_0x33e138,null));};exports['addAgents']=function(_0x2b0a48,_0x4fe0a0,_0x5df812){return db[_0x37df('0x2f')][_0x37df('0x49')]({'where':{'id':_0x2b0a48[_0x37df('0x45')]['id']}})[_0x37df('0x26')](handleEntityNotFound(_0x4fe0a0,null))[_0x37df('0x26')](function(_0x587da4){if(_0x587da4){return _0x587da4[_0x37df('0x84')](_0x2b0a48[_0x37df('0x51')][_0x37df('0x63')],_[_0x37df('0x85')](_0x2b0a48['body'],['ids','id'])||{})['spread'](function(_0xb654ff){for(var _0x328c2a=0x0;_0x328c2a<_0x2b0a48[_0x37df('0x51')]['ids'][_0x37df('0x47')];_0x328c2a+=0x1){socket[_0x37df('0x6c')](_0x37df('0x86'),{'UserId':_0x2b0a48['body'][_0x37df('0x63')][_0x328c2a],'FaxQueueId':_0x2b0a48[_0x37df('0x45')]['id']});}return _0xb654ff;});}})[_0x37df('0x26')](respondWithResult(_0x4fe0a0,null))[_0x37df('0x43')](handleError(_0x4fe0a0,null));};exports[_0x37df('0x82')]=function(_0x34916e,_0xb46ba,_0x4bb404){return db[_0x37df('0x2f')][_0x37df('0x49')]({'where':{'id':_0x34916e['params']['id']}})['then'](handleEntityNotFound(_0xb46ba,null))[_0x37df('0x26')](function(_0x57bf36){if(_0x57bf36){return _0x57bf36[_0x37df('0x82')](_0x34916e[_0x37df('0x35')][_0x37df('0x63')])[_0x37df('0x26')](function(){if(_[_0x37df('0x87')](_0x34916e[_0x37df('0x35')][_0x37df('0x63')])){for(var _0x37a7fc=0x0;_0x37a7fc<_0x34916e['query'][_0x37df('0x63')]['length'];_0x37a7fc+=0x1){socket[_0x37df('0x6c')](_0x37df('0x83'),{'UserId':Number(_0x34916e['query'][_0x37df('0x63')][_0x37a7fc]),'FaxQueueId':Number(_0x34916e['params']['id'])});}}else{socket[_0x37df('0x6c')](_0x37df('0x83'),{'UserId':Number(_0x34916e[_0x37df('0x35')][_0x37df('0x63')]),'FaxQueueId':Number(_0x34916e[_0x37df('0x45')]['id'])});}});}})[_0x37df('0x26')](respondWithStatusCode(_0xb46ba,null))[_0x37df('0x43')](handleError(_0xb46ba,null));};exports['getAgents']=function(_0x275fff,_0x3a4005,_0xfbfddc){var _0x36c22b={};var _0x156092={};var _0x34a2d5;var _0x1fe4af;return db[_0x37df('0x2f')][_0x37df('0x54')]({'where':{'id':_0x275fff[_0x37df('0x45')]['id']}})['then'](handleEntityNotFound(_0x3a4005,null))[_0x37df('0x26')](function(_0x3e6914){if(_0x3e6914){_0x34a2d5=_0x3e6914;_0x156092[_0x37df('0x34')]=_['keys'](db[_0x37df('0x64')]['rawAttributes']);_0x156092[_0x37df('0x35')]=_[_0x37df('0x46')](_0x275fff[_0x37df('0x35')]);_0x156092[_0x37df('0x36')]=_[_0x37df('0x37')](_0x156092[_0x37df('0x34')],_0x156092[_0x37df('0x35')]);_0x36c22b[_0x37df('0x38')]=_[_0x37df('0x37')](_0x156092[_0x37df('0x34')],qs[_0x37df('0x39')](_0x275fff['query']['fields']));_0x36c22b[_0x37df('0x38')]=_0x36c22b[_0x37df('0x38')]['length']?_0x36c22b[_0x37df('0x38')]:_0x156092[_0x37df('0x34')];_0x36c22b['order']=qs[_0x37df('0x3d')](_0x275fff[_0x37df('0x35')]['sort']);_0x36c22b[_0x37df('0x3f')]=qs[_0x37df('0x36')](_['pick'](_0x275fff['query'],_0x156092[_0x37df('0x36')]));if(_0x275fff[_0x37df('0x35')][_0x37df('0x41')]){_0x36c22b[_0x37df('0x3f')]=_[_0x37df('0x48')](_0x36c22b[_0x37df('0x3f')],{'$or':_['map'](_0x36c22b['attributes'],function(_0x3ffbfc){var _0x2f9d7f={};_0x2f9d7f[_0x3ffbfc]={'$like':'%'+_0x275fff[_0x37df('0x35')][_0x37df('0x41')]+'%'};return _0x2f9d7f;})});}_0x36c22b=_[_0x37df('0x48')]({},_0x36c22b,_0x275fff[_0x37df('0x60')]);return _0x34a2d5[_0x37df('0x88')](_0x36c22b);}})[_0x37df('0x26')](function(_0x233668){if(_0x233668){_0x1fe4af=_0x233668[_0x37df('0x47')];if(!_0x275fff[_0x37df('0x35')][_0x37df('0x3a')](_0x37df('0x3b'))){_0x36c22b[_0x37df('0x1e')]=qs['limit'](_0x275fff[_0x37df('0x35')]['limit']);_0x36c22b[_0x37df('0x1d')]=qs[_0x37df('0x1d')](_0x275fff[_0x37df('0x35')][_0x37df('0x1d')]);}return _0x34a2d5[_0x37df('0x88')](_0x36c22b);}})[_0x37df('0x26')](function(_0x5eda26){if(_0x5eda26){return _0x5eda26?{'count':_0x1fe4af,'rows':_0x5eda26}:null;}})[_0x37df('0x26')](respondWithResult(_0x3a4005,null))[_0x37df('0x43')](handleError(_0x3a4005,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index dffef69..d022b59 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 _0x183b=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','FaxQueue','setMaxListeners'];(function(_0x134d79,_0x139f91){var _0x4c0031=function(_0x15a791){while(--_0x15a791){_0x134d79['push'](_0x134d79['shift']());}};_0x4c0031(++_0x139f91);}(_0x183b,0x150));var _0xb183=function(_0x188e71,_0x329c42){_0x188e71=_0x188e71-0x0;var _0xc5b6b8=_0x183b[_0x188e71];return _0xc5b6b8;};'use strict';var EventEmitter=require(_0xb183('0x0'));var FaxQueue=require(_0xb183('0x1'))['db'][_0xb183('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xb183('0x3')](0x0);var events={'afterCreate':_0xb183('0x4'),'afterUpdate':_0xb183('0x5'),'afterDestroy':_0xb183('0x6')};function emitEvent(_0x58af72){return function(_0x31ebef,_0xd047a0,_0x3aeda1){FaxQueueEvents[_0xb183('0x7')](_0x58af72+':'+_0x31ebef['id'],_0x31ebef);FaxQueueEvents['emit'](_0x58af72,_0x31ebef);_0x3aeda1(null);};}for(var e in events){if(events[_0xb183('0x8')](e)){var event=events[e];FaxQueue[_0xb183('0x9')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file +var _0x650e=['update','remove','emit','hook','events','../../mysqldb','FaxQueue','setMaxListeners','save'];(function(_0x25d937,_0x1f9d77){var _0x240052=function(_0x322d29){while(--_0x322d29){_0x25d937['push'](_0x25d937['shift']());}};_0x240052(++_0x1f9d77);}(_0x650e,0xf7));var _0xe650=function(_0x3862be,_0xf70133){_0x3862be=_0x3862be-0x0;var _0x4c2c6b=_0x650e[_0x3862be];return _0x4c2c6b;};'use strict';var EventEmitter=require(_0xe650('0x0'));var FaxQueue=require(_0xe650('0x1'))['db'][_0xe650('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xe650('0x3')](0x0);var events={'afterCreate':_0xe650('0x4'),'afterUpdate':_0xe650('0x5'),'afterDestroy':_0xe650('0x6')};function emitEvent(_0x4995c6){return function(_0x20b516,_0x3abc0b,_0x2aa020){FaxQueueEvents[_0xe650('0x7')](_0x4995c6+':'+_0x20b516['id'],_0x20b516);FaxQueueEvents['emit'](_0x4995c6,_0x20b516);_0x2aa020(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];FaxQueue[_0xe650('0x8')](e,emitEvent(event));}}module['exports']=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index f73f059..7458c6c 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 _0xf671=['path','../../config/environment','define','FaxQueue','fax_queues','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf671,0x68));var _0x1f67=function(_0x2f41db,_0x3e09d6){_0x2f41db=_0x2f41db-0x0;var _0x534620=_0xf671[_0x2f41db];return _0x534620;};'use strict';var _=require(_0x1f67('0x0'));var util=require(_0x1f67('0x1'));var logger=require(_0x1f67('0x2'))('api');var moment=require(_0x1f67('0x3'));var BPromise=require(_0x1f67('0x4'));var rp=require(_0x1f67('0x5'));var fs=require('fs');var path=require(_0x1f67('0x6'));var rimraf=require('rimraf');var config=require(_0x1f67('0x7'));var attributes=require('./faxQueue.attributes');module['exports']=function(_0x3de280,_0x324f75){return _0x3de280[_0x1f67('0x8')](_0x1f67('0x9'),attributes,{'tableName':_0x1f67('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x22de=['lodash','util','../../config/logger','api','moment','path','../../config/environment','./faxQueue.attributes','exports','FaxQueue','fax_queues'];(function(_0x27a1a0,_0x410857){var _0x1321a0=function(_0x4d0991){while(--_0x4d0991){_0x27a1a0['push'](_0x27a1a0['shift']());}};_0x1321a0(++_0x410857);}(_0x22de,0xdc));var _0xe22d=function(_0x4205c9,_0x4dc8e0){_0x4205c9=_0x4205c9-0x0;var _0x27dd35=_0x22de[_0x4205c9];return _0x27dd35;};'use strict';var _=require(_0xe22d('0x0'));var util=require(_0xe22d('0x1'));var logger=require(_0xe22d('0x2'))(_0xe22d('0x3'));var moment=require(_0xe22d('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xe22d('0x5'));var rimraf=require('rimraf');var config=require(_0xe22d('0x6'));var attributes=require(_0xe22d('0x7'));module[_0xe22d('0x8')]=function(_0x29c8b2,_0x28e12a){return _0x29c8b2['define'](_0xe22d('0x9'),attributes,{'tableName':_0xe22d('0xa'),'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 e64f7d0..3326e73 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 _0xcff1=['defaults','redis','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','debug','FaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','GetFaxQueue','findAll','options','raw','where','attributes','include','map','model','ShowFaxQueue','FaxQueue','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0xdc6279,_0x1ca87f){var _0x1230e6=function(_0x4ca4d4){while(--_0x4ca4d4){_0xdc6279['push'](_0xdc6279['shift']());}};_0x1230e6(++_0x1ca87f);}(_0xcff1,0x1f1));var _0x1cff=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0xcff1[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require(_0x1cff('0x0'));var util=require(_0x1cff('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1cff('0x2'));var fs=require('fs');var Redis=require(_0x1cff('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x1cff('0x4'));var logger=require(_0x1cff('0x5'))(_0x1cff('0x6'));var config=require(_0x1cff('0x7'));var jayson=require(_0x1cff('0x8'));var client=jayson[_0x1cff('0x9')]['http']({'port':0x232a});config['redis']=_[_0x1cff('0xa')](config[_0x1cff('0xb')],{'host':_0x1cff('0xc'),'port':0x18eb});var socket=require(_0x1cff('0xd'))(new Redis(config[_0x1cff('0xb')]));require(_0x1cff('0xe'))[_0x1cff('0xf')](socket);function respondWithRpcPromise(_0xe3118,_0x5296a5,_0x1c4ccb){return new BPromise(function(_0x28fb90,_0x5a3a40){return client[_0x1cff('0x10')](_0xe3118,_0x1c4ccb)[_0x1cff('0x11')](function(_0x400802){logger[_0x1cff('0x12')](_0x1cff('0x13'),_0x5296a5,'request\x20sent');logger[_0x1cff('0x14')](_0x1cff('0x15'),_0x5296a5,_0x1cff('0x16'),JSON[_0x1cff('0x17')](_0x400802));if(_0x400802[_0x1cff('0x18')]){if(_0x400802[_0x1cff('0x18')][_0x1cff('0x19')]===0x1f4){logger[_0x1cff('0x18')](_0x1cff('0x13'),_0x5296a5,_0x400802[_0x1cff('0x18')][_0x1cff('0x1a')]);return _0x5a3a40(_0x400802[_0x1cff('0x18')][_0x1cff('0x1a')]);}logger['error'](_0x1cff('0x13'),_0x5296a5,_0x400802['error']['message']);return _0x28fb90(_0x400802[_0x1cff('0x18')][_0x1cff('0x1a')]);}else{logger[_0x1cff('0x12')](_0x1cff('0x13'),_0x5296a5,_0x1cff('0x16'));_0x28fb90(_0x400802['result'][_0x1cff('0x1a')]);}})[_0x1cff('0x1b')](function(_0x1f8060){logger[_0x1cff('0x18')](_0x1cff('0x13'),_0x5296a5,_0x1f8060);_0x5a3a40(_0x1f8060);});});}exports[_0x1cff('0x1c')]=function(_0x43117c){var _0x3fac0d=this;return new Promise(function(_0x46c02c,_0xb66785){return db['FaxQueue'][_0x1cff('0x1d')]({'raw':_0x43117c[_0x1cff('0x1e')]?_0x43117c[_0x1cff('0x1e')][_0x1cff('0x1f')]===undefined?!![]:![]:!![],'where':_0x43117c[_0x1cff('0x1e')]?_0x43117c[_0x1cff('0x1e')][_0x1cff('0x20')]||null:null,'attributes':_0x43117c[_0x1cff('0x1e')]?_0x43117c[_0x1cff('0x1e')][_0x1cff('0x21')]||null:null,'limit':_0x43117c[_0x1cff('0x1e')]?_0x43117c[_0x1cff('0x1e')]['limit']||null:null,'include':_0x43117c['options']?_0x43117c[_0x1cff('0x1e')][_0x1cff('0x22')]?_[_0x1cff('0x23')](_0x43117c[_0x1cff('0x1e')][_0x1cff('0x22')],function(_0x35970c){return{'model':db[_0x35970c[_0x1cff('0x24')]],'as':_0x35970c['as'],'attributes':_0x35970c['attributes'],'include':_0x35970c['include']?_[_0x1cff('0x23')](_0x35970c[_0x1cff('0x22')],function(_0x2afa34){return{'model':db[_0x2afa34[_0x1cff('0x24')]],'as':_0x2afa34['as'],'attributes':_0x2afa34[_0x1cff('0x21')],'include':_0x2afa34[_0x1cff('0x22')]?_[_0x1cff('0x23')](_0x2afa34[_0x1cff('0x22')],function(_0x213db8){return{'model':db[_0x213db8['model']],'as':_0x213db8['as'],'attributes':_0x213db8['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cff('0x11')](function(_0x5aa2bc){logger[_0x1cff('0x12')](_0x1cff('0x1c'),_0x43117c);logger[_0x1cff('0x14')](_0x1cff('0x1c'),_0x43117c,JSON[_0x1cff('0x17')](_0x5aa2bc));_0x46c02c(_0x5aa2bc);})[_0x1cff('0x1b')](function(_0xce0900){logger[_0x1cff('0x18')](_0x1cff('0x1c'),_0xce0900[_0x1cff('0x1a')],_0x43117c);_0xb66785(_0x3fac0d[_0x1cff('0x18')](0x1f4,_0xce0900['message']));});});};exports[_0x1cff('0x25')]=function(_0x27cfe4){var _0x3d1aab=this;return new Promise(function(_0x10560d,_0xe328c5){return db[_0x1cff('0x26')]['find']({'raw':_0x27cfe4[_0x1cff('0x1e')]?_0x27cfe4[_0x1cff('0x1e')][_0x1cff('0x1f')]===undefined?!![]:![]:!![],'where':_0x27cfe4['options']?_0x27cfe4[_0x1cff('0x1e')]['where']||null:null,'attributes':_0x27cfe4[_0x1cff('0x1e')]?_0x27cfe4[_0x1cff('0x1e')][_0x1cff('0x21')]||null:null,'include':_0x27cfe4[_0x1cff('0x1e')]?_0x27cfe4[_0x1cff('0x1e')][_0x1cff('0x22')]?_[_0x1cff('0x23')](_0x27cfe4[_0x1cff('0x1e')]['include'],function(_0x58591e){return{'model':db[_0x58591e[_0x1cff('0x24')]],'as':_0x58591e['as'],'attributes':_0x58591e[_0x1cff('0x21')],'include':_0x58591e[_0x1cff('0x22')]?_[_0x1cff('0x23')](_0x58591e[_0x1cff('0x22')],function(_0x483618){return{'model':db[_0x483618[_0x1cff('0x24')]],'as':_0x483618['as'],'attributes':_0x483618[_0x1cff('0x21')],'include':_0x483618[_0x1cff('0x22')]?_[_0x1cff('0x23')](_0x483618[_0x1cff('0x22')],function(_0x244133){return{'model':db[_0x244133['model']],'as':_0x244133['as'],'attributes':_0x244133['attributes']};}):[]};}):[]};}):[]:[]})[_0x1cff('0x11')](function(_0x52f5e1){logger['info']('ShowFaxQueue',_0x27cfe4);logger['debug']('ShowFaxQueue',_0x27cfe4,JSON[_0x1cff('0x17')](_0x52f5e1));_0x10560d(_0x52f5e1);})[_0x1cff('0x1b')](function(_0x490ce5){logger['error'](_0x1cff('0x25'),_0x490ce5[_0x1cff('0x1a')],_0x27cfe4);_0xe328c5(_0x3d1aab[_0x1cff('0x18')](0x1f4,_0x490ce5[_0x1cff('0x1a')]));});});}; \ No newline at end of file +var _0x46f8=['localhost','socket.io-emitter','./faxQueue.socket','register','request','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetFaxQueue','FaxQueue','findAll','options','where','attributes','limit','include','map','model','catch','ShowFaxQueue','find','raw','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis'];(function(_0x4f3021,_0x15bf04){var _0xd62bcd=function(_0x18ec51){while(--_0x18ec51){_0x4f3021['push'](_0x4f3021['shift']());}};_0xd62bcd(++_0x15bf04);}(_0x46f8,0x18f));var _0x846f=function(_0x4338f9,_0x708c9b){_0x4338f9=_0x4338f9-0x0;var _0x589603=_0x46f8[_0x4338f9];return _0x589603;};'use strict';var _=require('lodash');var util=require(_0x846f('0x0'));var moment=require('moment');var BPromise=require(_0x846f('0x1'));var rs=require(_0x846f('0x2'));var fs=require('fs');var Redis=require(_0x846f('0x3'));var db=require(_0x846f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x846f('0x5'))(_0x846f('0x6'));var config=require(_0x846f('0x7'));var jayson=require(_0x846f('0x8'));var client=jayson[_0x846f('0x9')]['http']({'port':0x232a});config[_0x846f('0xa')]=_['defaults'](config[_0x846f('0xa')],{'host':_0x846f('0xb'),'port':0x18eb});var socket=require(_0x846f('0xc'))(new Redis(config['redis']));require(_0x846f('0xd'))[_0x846f('0xe')](socket);function respondWithRpcPromise(_0x1ef6a9,_0x6d9565,_0xfabb70){return new BPromise(function(_0x147319,_0x19bad8){return client[_0x846f('0xf')](_0x1ef6a9,_0xfabb70)[_0x846f('0x10')](function(_0x38d86e){logger['info'](_0x846f('0x11'),_0x6d9565,_0x846f('0x12'));logger[_0x846f('0x13')](_0x846f('0x14'),_0x6d9565,_0x846f('0x12'),JSON[_0x846f('0x15')](_0x38d86e));if(_0x38d86e[_0x846f('0x16')]){if(_0x38d86e[_0x846f('0x16')][_0x846f('0x17')]===0x1f4){logger[_0x846f('0x16')]('FaxQueue,\x20%s,\x20%s',_0x6d9565,_0x38d86e['error'][_0x846f('0x18')]);return _0x19bad8(_0x38d86e[_0x846f('0x16')][_0x846f('0x18')]);}logger[_0x846f('0x16')](_0x846f('0x11'),_0x6d9565,_0x38d86e[_0x846f('0x16')][_0x846f('0x18')]);return _0x147319(_0x38d86e[_0x846f('0x16')][_0x846f('0x18')]);}else{logger[_0x846f('0x19')](_0x846f('0x11'),_0x6d9565,_0x846f('0x12'));_0x147319(_0x38d86e[_0x846f('0x1a')][_0x846f('0x18')]);}})['catch'](function(_0x271fb5){logger[_0x846f('0x16')](_0x846f('0x11'),_0x6d9565,_0x271fb5);_0x19bad8(_0x271fb5);});});}exports[_0x846f('0x1b')]=function(_0x6b056a){var _0x26981b=this;return new Promise(function(_0x3196db,_0xa91d9f){return db[_0x846f('0x1c')][_0x846f('0x1d')]({'raw':_0x6b056a[_0x846f('0x1e')]?_0x6b056a[_0x846f('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x6b056a[_0x846f('0x1e')]?_0x6b056a['options'][_0x846f('0x1f')]||null:null,'attributes':_0x6b056a[_0x846f('0x1e')]?_0x6b056a[_0x846f('0x1e')][_0x846f('0x20')]||null:null,'limit':_0x6b056a[_0x846f('0x1e')]?_0x6b056a[_0x846f('0x1e')][_0x846f('0x21')]||null:null,'include':_0x6b056a[_0x846f('0x1e')]?_0x6b056a[_0x846f('0x1e')][_0x846f('0x22')]?_[_0x846f('0x23')](_0x6b056a[_0x846f('0x1e')][_0x846f('0x22')],function(_0x4adae7){return{'model':db[_0x4adae7[_0x846f('0x24')]],'as':_0x4adae7['as'],'attributes':_0x4adae7[_0x846f('0x20')],'include':_0x4adae7['include']?_[_0x846f('0x23')](_0x4adae7[_0x846f('0x22')],function(_0x5d2235){return{'model':db[_0x5d2235[_0x846f('0x24')]],'as':_0x5d2235['as'],'attributes':_0x5d2235[_0x846f('0x20')],'include':_0x5d2235['include']?_[_0x846f('0x23')](_0x5d2235['include'],function(_0xa10d38){return{'model':db[_0xa10d38[_0x846f('0x24')]],'as':_0xa10d38['as'],'attributes':_0xa10d38[_0x846f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x846f('0x10')](function(_0xcc47f7){logger['info'](_0x846f('0x1b'),_0x6b056a);logger[_0x846f('0x13')](_0x846f('0x1b'),_0x6b056a,JSON[_0x846f('0x15')](_0xcc47f7));_0x3196db(_0xcc47f7);})[_0x846f('0x25')](function(_0x7f6f18){logger['error'](_0x846f('0x1b'),_0x7f6f18[_0x846f('0x18')],_0x6b056a);_0xa91d9f(_0x26981b[_0x846f('0x16')](0x1f4,_0x7f6f18[_0x846f('0x18')]));});});};exports[_0x846f('0x26')]=function(_0x495d91){var _0x465467=this;return new Promise(function(_0x3b68c7,_0x56147d){return db[_0x846f('0x1c')][_0x846f('0x27')]({'raw':_0x495d91['options']?_0x495d91[_0x846f('0x1e')][_0x846f('0x28')]===undefined?!![]:![]:!![],'where':_0x495d91['options']?_0x495d91[_0x846f('0x1e')]['where']||null:null,'attributes':_0x495d91[_0x846f('0x1e')]?_0x495d91[_0x846f('0x1e')][_0x846f('0x20')]||null:null,'include':_0x495d91[_0x846f('0x1e')]?_0x495d91['options']['include']?_['map'](_0x495d91[_0x846f('0x1e')][_0x846f('0x22')],function(_0x28da17){return{'model':db[_0x28da17['model']],'as':_0x28da17['as'],'attributes':_0x28da17[_0x846f('0x20')],'include':_0x28da17[_0x846f('0x22')]?_[_0x846f('0x23')](_0x28da17['include'],function(_0x3cfdf9){return{'model':db[_0x3cfdf9[_0x846f('0x24')]],'as':_0x3cfdf9['as'],'attributes':_0x3cfdf9[_0x846f('0x20')],'include':_0x3cfdf9[_0x846f('0x22')]?_[_0x846f('0x23')](_0x3cfdf9[_0x846f('0x22')],function(_0x4e045b){return{'model':db[_0x4e045b[_0x846f('0x24')]],'as':_0x4e045b['as'],'attributes':_0x4e045b[_0x846f('0x20')]};}):[]};}):[]};}):[]:[]})[_0x846f('0x10')](function(_0x5e305a){logger[_0x846f('0x19')]('ShowFaxQueue',_0x495d91);logger['debug'](_0x846f('0x26'),_0x495d91,JSON[_0x846f('0x15')](_0x5e305a));_0x3b68c7(_0x5e305a);})[_0x846f('0x25')](function(_0x422c83){logger['error'](_0x846f('0x26'),_0x422c83['message'],_0x495d91);_0x56147d(_0x465467['error'](0x1f4,_0x422c83[_0x846f('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index 16aae6c..5997167 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 _0x356c=['emit','removeListener','faxQueue:','./faxQueue.events','save','remove'];(function(_0x456ecc,_0x11df8d){var _0x4d666d=function(_0x335a03){while(--_0x335a03){_0x456ecc['push'](_0x456ecc['shift']());}};_0x4d666d(++_0x11df8d);}(_0x356c,0xdb));var _0xc356=function(_0x2deb91,_0x262690){_0x2deb91=_0x2deb91-0x0;var _0x4ff1b3=_0x356c[_0x2deb91];return _0x4ff1b3;};'use strict';var FaxQueueEvents=require(_0xc356('0x0'));var events=[_0xc356('0x1'),_0xc356('0x2'),'update'];function createListener(_0x41a170,_0x276251){return function(_0x22585c){_0x276251[_0xc356('0x3')](_0x41a170,_0x22585c);};}function removeListener(_0xf8853f,_0x48554b){return function(){FaxQueueEvents[_0xc356('0x4')](_0xf8853f,_0x48554b);};}exports['register']=function(_0x526cf2){for(var _0x241f72=0x0,_0xefacc=events['length'];_0x241f72<_0xefacc;_0x241f72++){var _0x4ea300=events[_0x241f72];var _0x3fa75e=createListener(_0xc356('0x5')+_0x4ea300,_0x526cf2);FaxQueueEvents['on'](_0x4ea300,_0x3fa75e);}}; \ No newline at end of file +var _0x1b6e=['emit','removeListener','register','length','faxQueue:','./faxQueue.events','save','remove'];(function(_0x114b7c,_0xc4b93b){var _0x47185f=function(_0x5b4cfa){while(--_0x5b4cfa){_0x114b7c['push'](_0x114b7c['shift']());}};_0x47185f(++_0xc4b93b);}(_0x1b6e,0x1c5));var _0xe1b6=function(_0x18eac3,_0x1ade7b){_0x18eac3=_0x18eac3-0x0;var _0x406084=_0x1b6e[_0x18eac3];return _0x406084;};'use strict';var FaxQueueEvents=require(_0xe1b6('0x0'));var events=[_0xe1b6('0x1'),_0xe1b6('0x2'),'update'];function createListener(_0x9ed1aa,_0x1c09e1){return function(_0x17da9a){_0x1c09e1[_0xe1b6('0x3')](_0x9ed1aa,_0x17da9a);};}function removeListener(_0x1cf326,_0x54af06){return function(){FaxQueueEvents[_0xe1b6('0x4')](_0x1cf326,_0x54af06);};}exports[_0xe1b6('0x5')]=function(_0x110382){for(var _0x287246=0x0,_0x2bc38f=events[_0xe1b6('0x6')];_0x287246<_0x2bc38f;_0x287246++){var _0xb3e21b=events[_0x287246];var _0x2b2966=createListener(_0xe1b6('0x7')+_0xb3e21b,_0x110382);FaxQueueEvents['on'](_0xb3e21b,_0x2b2966);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 42e4684..c171884 100644 --- a/server/api/faxQueue/index.js +++ b/server/api/faxQueue/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x504d75,_0x2e9be7){var _0x27382f=function(_0x2fedb4){while(--_0x2fedb4){_0x504d75['push'](_0x504d75['shift']());}};_0x27382f(++_0x2e9be7);}(_0xbaf0,0x12a));var _0x0baf=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xbaf0[_0x126558];return _0x1f6d14;};'use strict';var multer=require('multer');var util=require(_0x0baf('0x0'));var path=require(_0x0baf('0x1'));var timeout=require(_0x0baf('0x2'));var express=require(_0x0baf('0x3'));var router=express[_0x0baf('0x4')]();var auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0x0b0e=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','update','destroy','delete','removeTeams','removeAgents','multer'];(function(_0x15797a,_0x16274f){var _0x3e2618=function(_0x2b6e99){while(--_0x2b6e99){_0x15797a['push'](_0x15797a['shift']());}};_0x3e2618(++_0x16274f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1c7889,_0x24cd26){_0x1c7889=_0x1c7889-0x0;var _0x2f14e5=_0x0b0e[_0x1c7889];return _0x2f14e5;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['get'](_0xe0b0('0xe'),auth[_0xe0b0('0x9')](),controller['getMembers']);router[_0xe0b0('0x8')](_0xe0b0('0xf'),auth['isAuthenticated'](),controller[_0xe0b0('0x10')]);router[_0xe0b0('0x8')](_0xe0b0('0x11'),auth['isAuthenticated'](),controller[_0xe0b0('0x12')]);router[_0xe0b0('0x13')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x14')]);router[_0xe0b0('0x13')]('/:id/teams',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x15')]);router[_0xe0b0('0x13')](_0xe0b0('0x11'),auth[_0xe0b0('0x9')](),controller['addAgents']);router[_0xe0b0('0x16')]('/:id',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0x17')]);router['delete'](_0xe0b0('0xc'),auth['isAuthenticated'](),controller[_0xe0b0('0x18')]);router[_0xe0b0('0x19')]('/:id/teams',auth['isAuthenticated'](),controller[_0xe0b0('0x1a')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xe0b0('0x1b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 0d5867e..d7a5e58 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 _0x1a04=['sequelize','exports','STRING','DATE'];(function(_0x5387b4,_0x44e1ef){var _0x41e0b9=function(_0x1a4d38){while(--_0x1a4d38){_0x5387b4['push'](_0x5387b4['shift']());}};_0x41e0b9(++_0x44e1ef);}(_0x1a04,0xd0));var _0x41a0=function(_0x58ecdd,_0xee345d){_0x58ecdd=_0x58ecdd-0x0;var _0x108980=_0x1a04[_0x58ecdd];return _0x108980;};'use strict';var moment=require('moment');var Sequelize=require(_0x41a0('0x0'));module[_0x41a0('0x1')]={'uniqueid':{'type':Sequelize[_0x41a0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x41a0('0x3')]},'leaveAt':{'type':Sequelize[_0x41a0('0x3')]},'acceptAt':{'type':Sequelize[_0x41a0('0x3')]},'exitAt':{'type':Sequelize[_0x41a0('0x3')]},'reason':{'type':Sequelize[_0x41a0('0x2')]}}; \ No newline at end of file +var _0xca38=['moment','sequelize','STRING','DATE'];(function(_0x2bc4df,_0x397a6f){var _0x4bcc54=function(_0xc72ce8){while(--_0xc72ce8){_0x2bc4df['push'](_0x2bc4df['shift']());}};_0x4bcc54(++_0x397a6f);}(_0xca38,0x158));var _0x8ca3=function(_0x29f587,_0x839db3){_0x29f587=_0x29f587-0x0;var _0x2f84e0=_0xca38[_0x29f587];return _0x2f84e0;};'use strict';var moment=require(_0x8ca3('0x0'));var Sequelize=require(_0x8ca3('0x1'));module['exports']={'uniqueid':{'type':Sequelize[_0x8ca3('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x8ca3('0x3')]},'leaveAt':{'type':Sequelize[_0x8ca3('0x3')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x8ca3('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index b75f382..ac612a6 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 _0x4de4=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','then','error','name','send','map','FaxQueueReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','options','find','catch','update','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service'];(function(_0x2080a3,_0x48acfa){var _0x8d7d17=function(_0x2dbc06){while(--_0x2dbc06){_0x2080a3['push'](_0x2080a3['shift']());}};_0x8d7d17(++_0x48acfa);}(_0x4de4,0x7e));var _0x44de=function(_0x2ab430,_0x5e339c){_0x2ab430=_0x2ab430-0x0;var _0x559fe1=_0x4de4[_0x2ab430];return _0x559fe1;};'use strict';var pdf=require(_0x44de('0x0'));var emlformat=require(_0x44de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x44de('0x2'));var jsonpatch=require(_0x44de('0x3'));var rp=require('request-promise');var moment=require(_0x44de('0x4'));var BPromise=require(_0x44de('0x5'));var Mustache=require(_0x44de('0x6'));var util=require(_0x44de('0x7'));var path=require(_0x44de('0x8'));var sox=require(_0x44de('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x44de('0xa'));var squel=require(_0x44de('0xb'));var crypto=require(_0x44de('0xc'));var jsforce=require(_0x44de('0xd'));var deskjs=require(_0x44de('0xe'));var toCsv=require(_0x44de('0xf'));var querystring=require(_0x44de('0x10'));var Papa=require(_0x44de('0x11'));var Redis=require(_0x44de('0x12'));var authService=require(_0x44de('0x13'));var qs=require(_0x44de('0x14'));var as=require(_0x44de('0x15'));var hardwareService=require(_0x44de('0x16'));var logger=require(_0x44de('0x17'))(_0x44de('0x18'));var utils=require(_0x44de('0x19'));var config=require(_0x44de('0x1a'));var db=require(_0x44de('0x1b'))['db'];function respondWithStatusCode(_0x493747,_0x1ab641){_0x1ab641=_0x1ab641||0xcc;return function(_0x2d27c9){if(_0x2d27c9){return _0x493747[_0x44de('0x1c')](_0x1ab641);}return _0x493747[_0x44de('0x1d')](_0x1ab641)[_0x44de('0x1e')]();};}function respondWithResult(_0x2b05a5,_0x1e7040){_0x1e7040=_0x1e7040||0xc8;return function(_0x2e5d1d){if(_0x2e5d1d){return _0x2b05a5[_0x44de('0x1d')](_0x1e7040)[_0x44de('0x1f')](_0x2e5d1d);}};}function respondWithFilteredResult(_0x113fce,_0x1a6b4c){return function(_0xa37fcd){if(_0xa37fcd){var _0xf027e6=_0xa37fcd[_0x44de('0x20')],_0x20d6fb=_0x1a6b4c[_0x44de('0x21')],_0x2cb218=_0x1a6b4c['offset']+_0x1a6b4c['limit'],_0x376727;if(_0x2cb218>=_0xf027e6){_0x2cb218=_0xf027e6;_0x376727=0xc8;}else{_0x376727=0xce;}_0x113fce[_0x44de('0x1d')](_0x376727);return _0x113fce['set'](_0x44de('0x22'),_0x20d6fb+'-'+_0x2cb218+'/'+_0xf027e6)[_0x44de('0x1f')](_0xa37fcd);}return null;};}function patchUpdates(_0x5736ab){return function(_0x23e683){try{jsonpatch[_0x44de('0x23')](_0x23e683,_0x5736ab,!![]);}catch(_0x422b2f){return BPromise['reject'](_0x422b2f);}return _0x23e683['save']();};}function saveUpdates(_0x425ddf,_0x1d536c){return function(_0xe6ce6d){if(_0xe6ce6d){return _0xe6ce6d['update'](_0x425ddf)[_0x44de('0x24')](function(_0x1d29cd){return _0x1d29cd;});}return null;};}function removeEntity(_0x9f08a7,_0x2cccc9){return function(_0x259f8e){if(_0x259f8e){return _0x259f8e['destroy']()[_0x44de('0x24')](function(){_0x9f08a7[_0x44de('0x1d')](0xcc)[_0x44de('0x1e')]();});}};}function handleEntityNotFound(_0x38bfe9,_0x3fa585){return function(_0x342413){if(!_0x342413){_0x38bfe9[_0x44de('0x1c')](0x194);}return _0x342413;};}function handleError(_0x2dbf29,_0x269966){_0x269966=_0x269966||0x1f4;return function(_0x545d0c){logger[_0x44de('0x25')](_0x545d0c['stack']);if(_0x545d0c[_0x44de('0x26')]){delete _0x545d0c[_0x44de('0x26')];}_0x2dbf29[_0x44de('0x1d')](_0x269966)[_0x44de('0x27')](_0x545d0c);};}exports['index']=function(_0x2f70a1,_0x4b947d){var _0x4fbdb5={},_0x59decd={},_0x47f2c9={'count':0x0,'rows':[]};var _0x6f3585=_[_0x44de('0x28')](db[_0x44de('0x29')][_0x44de('0x2a')],function(_0x1d295c){return{'name':_0x1d295c['fieldName'],'type':_0x1d295c['type'][_0x44de('0x2b')]};});_0x59decd[_0x44de('0x2c')]=_['map'](_0x6f3585,'name');_0x59decd[_0x44de('0x2d')]=_[_0x44de('0x2e')](_0x2f70a1[_0x44de('0x2d')]);_0x59decd[_0x44de('0x2f')]=_[_0x44de('0x30')](_0x59decd[_0x44de('0x2c')],_0x59decd[_0x44de('0x2d')]);_0x4fbdb5['attributes']=_[_0x44de('0x30')](_0x59decd[_0x44de('0x2c')],qs[_0x44de('0x31')](_0x2f70a1[_0x44de('0x2d')][_0x44de('0x31')]));_0x4fbdb5[_0x44de('0x32')]=_0x4fbdb5[_0x44de('0x32')][_0x44de('0x33')]?_0x4fbdb5['attributes']:_0x59decd[_0x44de('0x2c')];if(!_0x2f70a1[_0x44de('0x2d')][_0x44de('0x34')](_0x44de('0x35'))){_0x4fbdb5[_0x44de('0x36')]=qs['limit'](_0x2f70a1[_0x44de('0x2d')]['limit']);_0x4fbdb5[_0x44de('0x21')]=qs[_0x44de('0x21')](_0x2f70a1[_0x44de('0x2d')][_0x44de('0x21')]);}_0x4fbdb5['order']=qs['sort'](_0x2f70a1[_0x44de('0x2d')][_0x44de('0x37')]);_0x4fbdb5[_0x44de('0x38')]=qs[_0x44de('0x2f')](_[_0x44de('0x39')](_0x2f70a1[_0x44de('0x2d')],_0x59decd[_0x44de('0x2f')]));if(_0x2f70a1[_0x44de('0x2d')][_0x44de('0x3a')]){_0x4fbdb5[_0x44de('0x38')]=_[_0x44de('0x3b')](_0x4fbdb5[_0x44de('0x38')],{'$or':_[_0x44de('0x28')](_0x6f3585,function(_0x302fb2){if(_0x302fb2['type']!=='VIRTUAL'){var _0xa071f4={};_0xa071f4[_0x302fb2[_0x44de('0x26')]]={'$like':'%'+_0x2f70a1[_0x44de('0x2d')][_0x44de('0x3a')]+'%'};return _0xa071f4;}})});}_0x4fbdb5=_[_0x44de('0x3b')]({},_0x4fbdb5,_0x2f70a1['options']);var _0xe01655={'where':_0x4fbdb5[_0x44de('0x38')]};return db['FaxQueueReport'][_0x44de('0x20')](_0xe01655)[_0x44de('0x24')](function(_0x394522){_0x47f2c9['count']=_0x394522;if(_0x2f70a1[_0x44de('0x2d')][_0x44de('0x3c')]){_0x4fbdb5[_0x44de('0x3d')]=[{'all':!![]}];}return db[_0x44de('0x29')][_0x44de('0x3e')](_0x4fbdb5);})[_0x44de('0x24')](function(_0x2de869){_0x47f2c9[_0x44de('0x3f')]=_0x2de869;return _0x47f2c9;})[_0x44de('0x24')](respondWithFilteredResult(_0x4b947d,_0x4fbdb5))['catch'](handleError(_0x4b947d,null));};exports[_0x44de('0x40')]=function(_0x1515b7,_0x25851e){var _0x3349a2={'raw':!![],'where':{'id':_0x1515b7[_0x44de('0x41')]['id']}},_0x1b1081={};_0x1b1081['model']=_[_0x44de('0x2e')](db[_0x44de('0x29')][_0x44de('0x2a')]);_0x1b1081[_0x44de('0x2d')]=_[_0x44de('0x2e')](_0x1515b7[_0x44de('0x2d')]);_0x1b1081[_0x44de('0x2f')]=_[_0x44de('0x30')](_0x1b1081['model'],_0x1b1081[_0x44de('0x2d')]);_0x3349a2[_0x44de('0x32')]=_[_0x44de('0x30')](_0x1b1081[_0x44de('0x2c')],qs[_0x44de('0x31')](_0x1515b7[_0x44de('0x2d')][_0x44de('0x31')]));_0x3349a2[_0x44de('0x32')]=_0x3349a2[_0x44de('0x32')]['length']?_0x3349a2[_0x44de('0x32')]:_0x1b1081[_0x44de('0x2c')];if(_0x1515b7['query']['includeAll']){_0x3349a2[_0x44de('0x3d')]=[{'all':!![]}];}_0x3349a2=_['merge']({},_0x3349a2,_0x1515b7[_0x44de('0x42')]);return db[_0x44de('0x29')][_0x44de('0x43')](_0x3349a2)[_0x44de('0x24')](handleEntityNotFound(_0x25851e,null))[_0x44de('0x24')](respondWithResult(_0x25851e,null))[_0x44de('0x44')](handleError(_0x25851e,null));};exports['create']=function(_0x4ac2de,_0x10d4f0){return db[_0x44de('0x29')]['create'](_0x4ac2de['body'],{})[_0x44de('0x24')](respondWithResult(_0x10d4f0,0xc9))[_0x44de('0x44')](handleError(_0x10d4f0,null));};exports[_0x44de('0x45')]=function(_0x421f47,_0x2970cb){if(_0x421f47[_0x44de('0x46')]['id']){delete _0x421f47[_0x44de('0x46')]['id'];}return db[_0x44de('0x29')][_0x44de('0x43')]({'where':{'id':_0x421f47[_0x44de('0x41')]['id']}})['then'](handleEntityNotFound(_0x2970cb,null))[_0x44de('0x24')](saveUpdates(_0x421f47['body'],null))[_0x44de('0x24')](respondWithResult(_0x2970cb,null))[_0x44de('0x44')](handleError(_0x2970cb,null));};exports[_0x44de('0x47')]=function(_0x251f94,_0x294157){return db[_0x44de('0x29')]['find']({'where':{'id':_0x251f94[_0x44de('0x41')]['id']}})[_0x44de('0x24')](handleEntityNotFound(_0x294157,null))['then'](removeEntity(_0x294157,null))[_0x44de('0x44')](handleError(_0x294157,null));};exports['describe']=function(_0x374a8d,_0x3cc752){return db[_0x44de('0x29')][_0x44de('0x48')]()[_0x44de('0x24')](respondWithResult(_0x3cc752,null))['catch'](handleError(_0x3cc752,null));}; \ No newline at end of file +var _0x8c89=['zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','json','apply','reject','save','update','then','name','send','index','map','FaxQueueReport','rawAttributes','fieldName','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','merge','type','filter','options','includeAll','include','findAll','rows','show','find','catch','create','destroy','params','describe','html-pdf','rimraf'];(function(_0x13aa3f,_0x417789){var _0x576245=function(_0x3321ad){while(--_0x3321ad){_0x13aa3f['push'](_0x13aa3f['shift']());}};_0x576245(++_0x417789);}(_0x8c89,0x17f));var _0x98c8=function(_0x516eef,_0x3c0047){_0x516eef=_0x516eef-0x0;var _0x25c38f=_0x8c89[_0x516eef];return _0x25c38f;};'use strict';var pdf=require(_0x98c8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x98c8('0x1'));var zipdir=require(_0x98c8('0x2'));var jsonpatch=require(_0x98c8('0x3'));var rp=require(_0x98c8('0x4'));var moment=require(_0x98c8('0x5'));var BPromise=require(_0x98c8('0x6'));var Mustache=require('mustache');var util=require(_0x98c8('0x7'));var path=require(_0x98c8('0x8'));var sox=require(_0x98c8('0x9'));var csv=require(_0x98c8('0xa'));var ejs=require(_0x98c8('0xb'));var fs=require('fs');var _=require(_0x98c8('0xc'));var squel=require(_0x98c8('0xd'));var crypto=require(_0x98c8('0xe'));var jsforce=require(_0x98c8('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x98c8('0xa'));var querystring=require(_0x98c8('0x10'));var Papa=require(_0x98c8('0x11'));var Redis=require(_0x98c8('0x12'));var authService=require(_0x98c8('0x13'));var qs=require(_0x98c8('0x14'));var as=require(_0x98c8('0x15'));var hardwareService=require(_0x98c8('0x16'));var logger=require('../../config/logger')(_0x98c8('0x17'));var utils=require(_0x98c8('0x18'));var config=require('../../config/environment');var db=require(_0x98c8('0x19'))['db'];function respondWithStatusCode(_0x265aa0,_0x3f0fce){_0x3f0fce=_0x3f0fce||0xcc;return function(_0x5a83f8){if(_0x5a83f8){return _0x265aa0[_0x98c8('0x1a')](_0x3f0fce);}return _0x265aa0[_0x98c8('0x1b')](_0x3f0fce)[_0x98c8('0x1c')]();};}function respondWithResult(_0x296043,_0x247d7a){_0x247d7a=_0x247d7a||0xc8;return function(_0x4eee13){if(_0x4eee13){return _0x296043[_0x98c8('0x1b')](_0x247d7a)['json'](_0x4eee13);}};}function respondWithFilteredResult(_0x29947b,_0x9643e8){return function(_0x56bd18){if(_0x56bd18){var _0x21f3fd=_0x56bd18[_0x98c8('0x1d')],_0x19c7ac=_0x9643e8['offset'],_0x36f104=_0x9643e8['offset']+_0x9643e8[_0x98c8('0x1e')],_0x650622;if(_0x36f104>=_0x21f3fd){_0x36f104=_0x21f3fd;_0x650622=0xc8;}else{_0x650622=0xce;}_0x29947b[_0x98c8('0x1b')](_0x650622);return _0x29947b[_0x98c8('0x1f')](_0x98c8('0x20'),_0x19c7ac+'-'+_0x36f104+'/'+_0x21f3fd)[_0x98c8('0x21')](_0x56bd18);}return null;};}function patchUpdates(_0x41f934){return function(_0x26c2e2){try{jsonpatch[_0x98c8('0x22')](_0x26c2e2,_0x41f934,!![]);}catch(_0x53f2d8){return BPromise[_0x98c8('0x23')](_0x53f2d8);}return _0x26c2e2[_0x98c8('0x24')]();};}function saveUpdates(_0x325800,_0x30ea9d){return function(_0x5cee0f){if(_0x5cee0f){return _0x5cee0f[_0x98c8('0x25')](_0x325800)[_0x98c8('0x26')](function(_0x51214d){return _0x51214d;});}return null;};}function removeEntity(_0x557e02,_0x4d6dc5){return function(_0x4ae7b6){if(_0x4ae7b6){return _0x4ae7b6['destroy']()[_0x98c8('0x26')](function(){_0x557e02['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d6f87,_0x72a9db){return function(_0x41b37c){if(!_0x41b37c){_0x4d6f87['sendStatus'](0x194);}return _0x41b37c;};}function handleError(_0x5897e7,_0x52c50d){_0x52c50d=_0x52c50d||0x1f4;return function(_0x7b65ef){logger['error'](_0x7b65ef['stack']);if(_0x7b65ef[_0x98c8('0x27')]){delete _0x7b65ef[_0x98c8('0x27')];}_0x5897e7[_0x98c8('0x1b')](_0x52c50d)[_0x98c8('0x28')](_0x7b65ef);};}exports[_0x98c8('0x29')]=function(_0x80878e,_0x488195){var _0x2347fc={},_0x210ef4={},_0x5f3f9d={'count':0x0,'rows':[]};var _0x20282f=_[_0x98c8('0x2a')](db[_0x98c8('0x2b')][_0x98c8('0x2c')],function(_0x5d3dc4){return{'name':_0x5d3dc4[_0x98c8('0x2d')],'type':_0x5d3dc4['type'][_0x98c8('0x2e')]};});_0x210ef4[_0x98c8('0x2f')]=_[_0x98c8('0x2a')](_0x20282f,_0x98c8('0x27'));_0x210ef4[_0x98c8('0x30')]=_[_0x98c8('0x31')](_0x80878e['query']);_0x210ef4['filters']=_[_0x98c8('0x32')](_0x210ef4[_0x98c8('0x2f')],_0x210ef4[_0x98c8('0x30')]);_0x2347fc[_0x98c8('0x33')]=_[_0x98c8('0x32')](_0x210ef4[_0x98c8('0x2f')],qs[_0x98c8('0x34')](_0x80878e['query'][_0x98c8('0x34')]));_0x2347fc[_0x98c8('0x33')]=_0x2347fc['attributes'][_0x98c8('0x35')]?_0x2347fc[_0x98c8('0x33')]:_0x210ef4[_0x98c8('0x2f')];if(!_0x80878e[_0x98c8('0x30')][_0x98c8('0x36')](_0x98c8('0x37'))){_0x2347fc['limit']=qs[_0x98c8('0x1e')](_0x80878e[_0x98c8('0x30')][_0x98c8('0x1e')]);_0x2347fc[_0x98c8('0x38')]=qs['offset'](_0x80878e['query'][_0x98c8('0x38')]);}_0x2347fc[_0x98c8('0x39')]=qs['sort'](_0x80878e['query'][_0x98c8('0x3a')]);_0x2347fc[_0x98c8('0x3b')]=qs[_0x98c8('0x3c')](_[_0x98c8('0x3d')](_0x80878e['query'],_0x210ef4[_0x98c8('0x3c')]));if(_0x80878e[_0x98c8('0x30')]['filter']){_0x2347fc[_0x98c8('0x3b')]=_[_0x98c8('0x3e')](_0x2347fc['where'],{'$or':_['map'](_0x20282f,function(_0x22f73c){if(_0x22f73c[_0x98c8('0x3f')]!=='VIRTUAL'){var _0x2843b8={};_0x2843b8[_0x22f73c[_0x98c8('0x27')]]={'$like':'%'+_0x80878e['query'][_0x98c8('0x40')]+'%'};return _0x2843b8;}})});}_0x2347fc=_[_0x98c8('0x3e')]({},_0x2347fc,_0x80878e[_0x98c8('0x41')]);var _0x1a61c6={'where':_0x2347fc[_0x98c8('0x3b')]};return db[_0x98c8('0x2b')][_0x98c8('0x1d')](_0x1a61c6)[_0x98c8('0x26')](function(_0x7fd78f){_0x5f3f9d[_0x98c8('0x1d')]=_0x7fd78f;if(_0x80878e[_0x98c8('0x30')][_0x98c8('0x42')]){_0x2347fc[_0x98c8('0x43')]=[{'all':!![]}];}return db[_0x98c8('0x2b')][_0x98c8('0x44')](_0x2347fc);})['then'](function(_0x4e967d){_0x5f3f9d[_0x98c8('0x45')]=_0x4e967d;return _0x5f3f9d;})[_0x98c8('0x26')](respondWithFilteredResult(_0x488195,_0x2347fc))['catch'](handleError(_0x488195,null));};exports[_0x98c8('0x46')]=function(_0x390727,_0x2c10e1){var _0x5bf3d0={'raw':!![],'where':{'id':_0x390727['params']['id']}},_0x32632c={};_0x32632c[_0x98c8('0x2f')]=_[_0x98c8('0x31')](db[_0x98c8('0x2b')][_0x98c8('0x2c')]);_0x32632c[_0x98c8('0x30')]=_['keys'](_0x390727[_0x98c8('0x30')]);_0x32632c['filters']=_[_0x98c8('0x32')](_0x32632c['model'],_0x32632c['query']);_0x5bf3d0[_0x98c8('0x33')]=_[_0x98c8('0x32')](_0x32632c[_0x98c8('0x2f')],qs[_0x98c8('0x34')](_0x390727[_0x98c8('0x30')][_0x98c8('0x34')]));_0x5bf3d0['attributes']=_0x5bf3d0[_0x98c8('0x33')][_0x98c8('0x35')]?_0x5bf3d0['attributes']:_0x32632c[_0x98c8('0x2f')];if(_0x390727[_0x98c8('0x30')][_0x98c8('0x42')]){_0x5bf3d0[_0x98c8('0x43')]=[{'all':!![]}];}_0x5bf3d0=_[_0x98c8('0x3e')]({},_0x5bf3d0,_0x390727[_0x98c8('0x41')]);return db[_0x98c8('0x2b')][_0x98c8('0x47')](_0x5bf3d0)[_0x98c8('0x26')](handleEntityNotFound(_0x2c10e1,null))[_0x98c8('0x26')](respondWithResult(_0x2c10e1,null))[_0x98c8('0x48')](handleError(_0x2c10e1,null));};exports['create']=function(_0x1e6b95,_0x5dac39){return db[_0x98c8('0x2b')][_0x98c8('0x49')](_0x1e6b95['body'],{})[_0x98c8('0x26')](respondWithResult(_0x5dac39,0xc9))[_0x98c8('0x48')](handleError(_0x5dac39,null));};exports['update']=function(_0x1db767,_0x1b222b){if(_0x1db767['body']['id']){delete _0x1db767['body']['id'];}return db[_0x98c8('0x2b')][_0x98c8('0x47')]({'where':{'id':_0x1db767['params']['id']}})[_0x98c8('0x26')](handleEntityNotFound(_0x1b222b,null))[_0x98c8('0x26')](saveUpdates(_0x1db767['body'],null))['then'](respondWithResult(_0x1b222b,null))[_0x98c8('0x48')](handleError(_0x1b222b,null));};exports[_0x98c8('0x4a')]=function(_0x394e3e,_0x1837d3){return db[_0x98c8('0x2b')][_0x98c8('0x47')]({'where':{'id':_0x394e3e[_0x98c8('0x4b')]['id']}})[_0x98c8('0x26')](handleEntityNotFound(_0x1837d3,null))['then'](removeEntity(_0x1837d3,null))[_0x98c8('0x48')](handleError(_0x1837d3,null));};exports['describe']=function(_0x4d279d,_0x7d044e){return db[_0x98c8('0x2b')][_0x98c8('0x4c')]()[_0x98c8('0x26')](respondWithResult(_0x7d044e,null))[_0x98c8('0x48')](handleError(_0x7d044e,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index 4944627..7b38ec4 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 _0xd355=['lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','FaxQueueReport','report_fax_queue','uniqueid'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd355,0x150));var _0x5d35=function(_0x18a246,_0x5e7f4b){_0x18a246=_0x18a246-0x0;var _0x268977=_0xd355[_0x18a246];return _0x268977;};'use strict';var _=require(_0x5d35('0x0'));var util=require('util');var logger=require(_0x5d35('0x1'))('api');var moment=require(_0x5d35('0x2'));var BPromise=require(_0x5d35('0x3'));var rp=require(_0x5d35('0x4'));var fs=require('fs');var path=require(_0x5d35('0x5'));var rimraf=require(_0x5d35('0x6'));var config=require(_0x5d35('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x561e3b,_0x5e6211){return _0x561e3b[_0x5d35('0x8')](_0x5d35('0x9'),attributes,{'tableName':_0x5d35('0xa'),'paranoid':![],'indexes':[{'name':_0x5d35('0xb'),'fields':[_0x5d35('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xd1ca=['FaxQueueReport','uniqueid','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./faxQueueReport.attributes','exports','define'];(function(_0xc57e60,_0xe3399c){var _0x5222b3=function(_0x2d9c56){while(--_0x2d9c56){_0xc57e60['push'](_0xc57e60['shift']());}};_0x5222b3(++_0xe3399c);}(_0xd1ca,0x18e));var _0xad1c=function(_0x6cf19c,_0x2f3f02){_0x6cf19c=_0x6cf19c-0x0;var _0xce14f3=_0xd1ca[_0x6cf19c];return _0xce14f3;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var logger=require('../../config/logger')(_0xad1c('0x2'));var moment=require(_0xad1c('0x3'));var BPromise=require(_0xad1c('0x4'));var rp=require(_0xad1c('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad1c('0x6'));var attributes=require(_0xad1c('0x7'));module[_0xad1c('0x8')]=function(_0x1f4981,_0x4ae210){return _0x1f4981[_0xad1c('0x9')](_0xad1c('0xa'),attributes,{'tableName':'report_fax_queue','paranoid':![],'indexes':[{'name':_0xad1c('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index c76adef..dcb2504 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 _0x1ff7=['catch','body','options','raw','CreateFaxQueueReport','stringify','UpdateFaxQueueReport','update','where','limit','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','error','FaxQueueReport,\x20%s,\x20%s','message','result'];(function(_0x4addd5,_0x222b79){var _0x4d3476=function(_0x46a95f){while(--_0x46a95f){_0x4addd5['push'](_0x4addd5['shift']());}};_0x4d3476(++_0x222b79);}(_0x1ff7,0x82));var _0x71ff=function(_0x4b41e0,_0x14a1b3){_0x4b41e0=_0x4b41e0-0x0;var _0xaa6c59=_0x1ff7[_0x4b41e0];return _0xaa6c59;};'use strict';var _=require(_0x71ff('0x0'));var util=require(_0x71ff('0x1'));var moment=require(_0x71ff('0x2'));var BPromise=require('bluebird');var rs=require(_0x71ff('0x3'));var fs=require('fs');var Redis=require(_0x71ff('0x4'));var db=require(_0x71ff('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x71ff('0x6'))(_0x71ff('0x7'));var config=require(_0x71ff('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x71ff('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4f8c70,_0x26493b,_0x1ba6bb){return new BPromise(function(_0x40b7d8,_0x24c014){return client[_0x71ff('0xa')](_0x4f8c70,_0x1ba6bb)[_0x71ff('0xb')](function(_0x134175){logger[_0x71ff('0xc')]('FaxQueueReport,\x20%s,\x20%s',_0x26493b,_0x71ff('0xd'));logger[_0x71ff('0xe')](_0x71ff('0xf'),_0x26493b,_0x71ff('0xd'),JSON['stringify'](_0x134175));if(_0x134175[_0x71ff('0x10')]){if(_0x134175[_0x71ff('0x10')]['code']===0x1f4){logger[_0x71ff('0x10')](_0x71ff('0x11'),_0x26493b,_0x134175['error'][_0x71ff('0x12')]);return _0x24c014(_0x134175['error']['message']);}logger[_0x71ff('0x10')]('FaxQueueReport,\x20%s,\x20%s',_0x26493b,_0x134175[_0x71ff('0x10')]['message']);return _0x40b7d8(_0x134175[_0x71ff('0x10')][_0x71ff('0x12')]);}else{logger[_0x71ff('0xc')](_0x71ff('0x11'),_0x26493b,_0x71ff('0xd'));_0x40b7d8(_0x134175[_0x71ff('0x13')][_0x71ff('0x12')]);}})[_0x71ff('0x14')](function(_0x44f7ce){logger['error'](_0x71ff('0x11'),_0x26493b,_0x44f7ce);_0x24c014(_0x44f7ce);});});}exports['CreateFaxQueueReport']=function(_0x3c2f32){var _0x17480a=this;return new Promise(function(_0x2f1ab6,_0x119b56){return db['FaxQueueReport']['create'](_0x3c2f32[_0x71ff('0x15')],{'raw':_0x3c2f32[_0x71ff('0x16')]?_0x3c2f32['options'][_0x71ff('0x17')]===undefined?!![]:![]:!![]})[_0x71ff('0xb')](function(_0x14658c){logger[_0x71ff('0xc')]('CreateFaxQueueReport',_0x3c2f32);logger[_0x71ff('0xe')](_0x71ff('0x18'),_0x3c2f32,JSON[_0x71ff('0x19')](_0x14658c));_0x2f1ab6(_0x14658c);})[_0x71ff('0x14')](function(_0x1367a9){logger[_0x71ff('0x10')](_0x71ff('0x18'),_0x1367a9[_0x71ff('0x12')],_0x3c2f32);_0x119b56(_0x17480a[_0x71ff('0x10')](0x1f4,_0x1367a9['message']));});});};exports[_0x71ff('0x1a')]=function(_0x19353e){var _0x41fd0c=this;return new Promise(function(_0x51d30b,_0x3142ca){return db['FaxQueueReport'][_0x71ff('0x1b')](_0x19353e[_0x71ff('0x15')],{'raw':_0x19353e[_0x71ff('0x16')]?_0x19353e[_0x71ff('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19353e[_0x71ff('0x16')]?_0x19353e[_0x71ff('0x16')][_0x71ff('0x1c')]||null:null,'attributes':_0x19353e[_0x71ff('0x16')]?_0x19353e[_0x71ff('0x16')]['attributes']||null:null,'limit':_0x19353e[_0x71ff('0x16')]?_0x19353e['options'][_0x71ff('0x1d')]||null:null})[_0x71ff('0xb')](function(_0x3255a3){logger[_0x71ff('0xc')]('UpdateFaxQueueReport',_0x19353e);logger['debug'](_0x71ff('0x1a'),_0x19353e,JSON[_0x71ff('0x19')](_0x3255a3));_0x51d30b(_0x3255a3);})[_0x71ff('0x14')](function(_0x51a060){logger[_0x71ff('0x10')](_0x71ff('0x1a'),_0x51a060[_0x71ff('0x12')],_0x19353e);_0x3142ca(_0x41fd0c[_0x71ff('0x10')](0x1f4,_0x51a060['message']));});});}; \ No newline at end of file +var _0xde44=['create','body','options','raw','catch','UpdateFaxQueueReport','update','attributes','limit','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','client','request','then','info','FaxQueueReport,\x20%s,\x20%s','debug','FaxQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','CreateFaxQueueReport','FaxQueueReport'];(function(_0x1c5968,_0x68d40c){var _0x290441=function(_0x5e2f4b){while(--_0x5e2f4b){_0x1c5968['push'](_0x1c5968['shift']());}};_0x290441(++_0x68d40c);}(_0xde44,0xa9));var _0x4de4=function(_0xdaa79a,_0x91cb6c){_0xdaa79a=_0xdaa79a-0x0;var _0x57bc3a=_0xde44[_0xdaa79a];return _0x57bc3a;};'use strict';var _=require(_0x4de4('0x0'));var util=require(_0x4de4('0x1'));var moment=require(_0x4de4('0x2'));var BPromise=require(_0x4de4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4de4('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4de4('0x5'));var logger=require(_0x4de4('0x6'))(_0x4de4('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4de4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x19651a,_0x2aa0fc,_0x1bfc95){return new BPromise(function(_0x302030,_0xeea60e){return client[_0x4de4('0x9')](_0x19651a,_0x1bfc95)[_0x4de4('0xa')](function(_0x41e1a4){logger[_0x4de4('0xb')](_0x4de4('0xc'),_0x2aa0fc,'request\x20sent');logger[_0x4de4('0xd')](_0x4de4('0xe'),_0x2aa0fc,_0x4de4('0xf'),JSON[_0x4de4('0x10')](_0x41e1a4));if(_0x41e1a4[_0x4de4('0x11')]){if(_0x41e1a4[_0x4de4('0x11')][_0x4de4('0x12')]===0x1f4){logger[_0x4de4('0x11')](_0x4de4('0xc'),_0x2aa0fc,_0x41e1a4[_0x4de4('0x11')]['message']);return _0xeea60e(_0x41e1a4[_0x4de4('0x11')][_0x4de4('0x13')]);}logger[_0x4de4('0x11')]('FaxQueueReport,\x20%s,\x20%s',_0x2aa0fc,_0x41e1a4[_0x4de4('0x11')][_0x4de4('0x13')]);return _0x302030(_0x41e1a4['error'][_0x4de4('0x13')]);}else{logger['info']('FaxQueueReport,\x20%s,\x20%s',_0x2aa0fc,_0x4de4('0xf'));_0x302030(_0x41e1a4[_0x4de4('0x14')][_0x4de4('0x13')]);}})['catch'](function(_0x33a923){logger[_0x4de4('0x11')](_0x4de4('0xc'),_0x2aa0fc,_0x33a923);_0xeea60e(_0x33a923);});});}exports[_0x4de4('0x15')]=function(_0x26292b){var _0x2ab8c4=this;return new Promise(function(_0x45f7ea,_0xe19938){return db[_0x4de4('0x16')][_0x4de4('0x17')](_0x26292b[_0x4de4('0x18')],{'raw':_0x26292b['options']?_0x26292b[_0x4de4('0x19')][_0x4de4('0x1a')]===undefined?!![]:![]:!![]})[_0x4de4('0xa')](function(_0x33dce2){logger['info'](_0x4de4('0x15'),_0x26292b);logger[_0x4de4('0xd')]('CreateFaxQueueReport',_0x26292b,JSON['stringify'](_0x33dce2));_0x45f7ea(_0x33dce2);})[_0x4de4('0x1b')](function(_0x3992a5){logger['error']('CreateFaxQueueReport',_0x3992a5[_0x4de4('0x13')],_0x26292b);_0xe19938(_0x2ab8c4['error'](0x1f4,_0x3992a5[_0x4de4('0x13')]));});});};exports[_0x4de4('0x1c')]=function(_0xd13ddf){var _0x34159c=this;return new Promise(function(_0x5b0ba5,_0x315858){return db[_0x4de4('0x16')][_0x4de4('0x1d')](_0xd13ddf[_0x4de4('0x18')],{'raw':_0xd13ddf[_0x4de4('0x19')]?_0xd13ddf['options'][_0x4de4('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd13ddf[_0x4de4('0x19')]?_0xd13ddf['options']['where']||null:null,'attributes':_0xd13ddf[_0x4de4('0x19')]?_0xd13ddf[_0x4de4('0x19')][_0x4de4('0x1e')]||null:null,'limit':_0xd13ddf['options']?_0xd13ddf['options'][_0x4de4('0x1f')]||null:null})[_0x4de4('0xa')](function(_0x329691){logger[_0x4de4('0xb')](_0x4de4('0x1c'),_0xd13ddf);logger[_0x4de4('0xd')](_0x4de4('0x1c'),_0xd13ddf,JSON[_0x4de4('0x10')](_0x329691));_0x5b0ba5(_0x329691);})['catch'](function(_0xa9026f){logger[_0x4de4('0x11')](_0x4de4('0x1c'),_0xa9026f['message'],_0xd13ddf);_0x315858(_0x34159c[_0x4de4('0x11')](0x1f4,_0xa9026f[_0x4de4('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 2c5a6cc..fca963b 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 _0x4a3a=['../../config/environment','./faxQueueReport.controller','get','isAuthenticated','index','/:id','show','post','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x485bad,_0x21c418){var _0x523c91=function(_0x7393a4){while(--_0x7393a4){_0x485bad['push'](_0x485bad['shift']());}};_0x523c91(++_0x21c418);}(_0x4a3a,0x1a3));var _0xa4a3=function(_0x394a56,_0x2f5c9d){_0x394a56=_0x394a56-0x0;var _0x271897=_0x4a3a[_0x394a56];return _0x271897;};'use strict';var multer=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xa4a3('0x2'));var router=express[_0xa4a3('0x3')]();var auth=require(_0xa4a3('0x4'));var interaction=require(_0xa4a3('0x5'));var config=require(_0xa4a3('0x6'));var controller=require(_0xa4a3('0x7'));router[_0xa4a3('0x8')]('/',auth[_0xa4a3('0x9')](),controller[_0xa4a3('0xa')]);router['get']('/describe',auth[_0xa4a3('0x9')](),controller['describe']);router[_0xa4a3('0x8')](_0xa4a3('0xb'),auth[_0xa4a3('0x9')](),controller[_0xa4a3('0xc')]);router[_0xa4a3('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0xa4a3('0x9')](),controller['update']);router[_0xa4a3('0xe')](_0xa4a3('0xb'),auth[_0xa4a3('0x9')](),controller[_0xa4a3('0xf')]);module[_0xa4a3('0x10')]=router; \ No newline at end of file +var _0x6587=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller','get','/describe','isAuthenticated','describe','/:id','show','post','create','delete','destroy','exports','multer','util','connect-timeout','express'];(function(_0x12917c,_0x41b371){var _0x59b248=function(_0x2b552a){while(--_0x2b552a){_0x12917c['push'](_0x12917c['shift']());}};_0x59b248(++_0x41b371);}(_0x6587,0x1a0));var _0x7658=function(_0x4ded65,_0xc8d7c1){_0x4ded65=_0x4ded65-0x0;var _0x5864fb=_0x6587[_0x4ded65];return _0x5864fb;};'use strict';var multer=require(_0x7658('0x0'));var util=require(_0x7658('0x1'));var path=require('path');var timeout=require(_0x7658('0x2'));var express=require(_0x7658('0x3'));var router=express[_0x7658('0x4')]();var auth=require(_0x7658('0x5'));var interaction=require(_0x7658('0x6'));var config=require(_0x7658('0x7'));var controller=require(_0x7658('0x8'));router[_0x7658('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x7658('0xa'),auth[_0x7658('0xb')](),controller[_0x7658('0xc')]);router[_0x7658('0x9')](_0x7658('0xd'),auth[_0x7658('0xb')](),controller[_0x7658('0xe')]);router[_0x7658('0xf')]('/',auth[_0x7658('0xb')](),controller[_0x7658('0x10')]);router['put'](_0x7658('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x7658('0x11')](_0x7658('0xd'),auth['isAuthenticated'](),controller[_0x7658('0x12')]);module[_0x7658('0x13')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index 8802d13..ae5e6ba 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 _0xacf3=['DATE','moment','sequelize','exports','ENUM','account','agent','queue'];(function(_0x1344d6,_0x2181e6){var _0xf45b24=function(_0x2d90c1){while(--_0x2d90c1){_0x1344d6['push'](_0x1344d6['shift']());}};_0xf45b24(++_0x2181e6);}(_0xacf3,0xf9));var _0x3acf=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xacf3[_0x4e676e];return _0x336a3c;};'use strict';var moment=require(_0x3acf('0x0'));var Sequelize=require(_0x3acf('0x1'));module[_0x3acf('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x3acf('0x3')](_0x3acf('0x4'),_0x3acf('0x5'),_0x3acf('0x6')),'allowNull':![],'defaultValue':_0x3acf('0x6')},'transferredAt':{'type':Sequelize[_0x3acf('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xd1f9=['agent','queue','NOW','sequelize','exports','STRING','ENUM'];(function(_0x366a38,_0x3f9c95){var _0x35dbc0=function(_0x435ed7){while(--_0x435ed7){_0x366a38['push'](_0x366a38['shift']());}};_0x35dbc0(++_0x3f9c95);}(_0xd1f9,0x15a));var _0x9d1f=function(_0x30c91d,_0x1a8c6d){_0x30c91d=_0x30c91d-0x0;var _0x319942=_0xd1f9[_0x30c91d];return _0x319942;};'use strict';var moment=require('moment');var Sequelize=require(_0x9d1f('0x0'));module[_0x9d1f('0x1')]={'uniqueid':{'type':Sequelize[_0x9d1f('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x9d1f('0x3')]('account',_0x9d1f('0x4'),'queue'),'allowNull':![],'defaultValue':_0x9d1f('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x9d1f('0x6')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index 1abe160..938918f 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 _0xb8e1=['pick','filter','merge','options','FaxTransferReport','includeAll','include','findAll','show','params','catch','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','json','apply','save','update','then','destroy','name','map','rawAttributes','key','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where'];(function(_0x8bf294,_0x1ca4ae){var _0x596021=function(_0x2d1e15){while(--_0x2d1e15){_0x8bf294['push'](_0x8bf294['shift']());}};_0x596021(++_0x1ca4ae);}(_0xb8e1,0xd8));var _0x1b8e=function(_0x585c89,_0x5519f1){_0x585c89=_0x585c89-0x0;var _0x1cbe95=_0xb8e1[_0x585c89];return _0x1cbe95;};'use strict';var pdf=require(_0x1b8e('0x0'));var emlformat=require(_0x1b8e('0x1'));var rimraf=require(_0x1b8e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1b8e('0x3'));var rp=require(_0x1b8e('0x4'));var moment=require(_0x1b8e('0x5'));var BPromise=require(_0x1b8e('0x6'));var Mustache=require('mustache');var util=require(_0x1b8e('0x7'));var path=require('path');var sox=require(_0x1b8e('0x8'));var csv=require(_0x1b8e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x1b8e('0xa'));var crypto=require(_0x1b8e('0xb'));var jsforce=require(_0x1b8e('0xc'));var deskjs=require(_0x1b8e('0xd'));var toCsv=require(_0x1b8e('0x9'));var querystring=require(_0x1b8e('0xe'));var Papa=require(_0x1b8e('0xf'));var Redis=require(_0x1b8e('0x10'));var authService=require(_0x1b8e('0x11'));var qs=require(_0x1b8e('0x12'));var as=require(_0x1b8e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1b8e('0x14'))(_0x1b8e('0x15'));var utils=require('../../config/utils');var config=require(_0x1b8e('0x16'));var db=require(_0x1b8e('0x17'))['db'];function respondWithStatusCode(_0x1ad3c8,_0x45d085){_0x45d085=_0x45d085||0xcc;return function(_0x21d00a){if(_0x21d00a){return _0x1ad3c8['sendStatus'](_0x45d085);}return _0x1ad3c8['status'](_0x45d085)[_0x1b8e('0x18')]();};}function respondWithResult(_0x1d7600,_0x36fd5d){_0x36fd5d=_0x36fd5d||0xc8;return function(_0x35218c){if(_0x35218c){return _0x1d7600[_0x1b8e('0x19')](_0x36fd5d)['json'](_0x35218c);}};}function respondWithFilteredResult(_0x2c6996,_0x53a099){return function(_0x99c55f){if(_0x99c55f){var _0x1fa722=_0x99c55f[_0x1b8e('0x1a')],_0x1bfb90=_0x53a099[_0x1b8e('0x1b')],_0x2c2a7b=_0x53a099[_0x1b8e('0x1b')]+_0x53a099[_0x1b8e('0x1c')],_0xd820c3;if(_0x2c2a7b>=_0x1fa722){_0x2c2a7b=_0x1fa722;_0xd820c3=0xc8;}else{_0xd820c3=0xce;}_0x2c6996[_0x1b8e('0x19')](_0xd820c3);return _0x2c6996[_0x1b8e('0x1d')]('Content-Range',_0x1bfb90+'-'+_0x2c2a7b+'/'+_0x1fa722)[_0x1b8e('0x1e')](_0x99c55f);}return null;};}function patchUpdates(_0x534eb9){return function(_0xed0bcd){try{jsonpatch[_0x1b8e('0x1f')](_0xed0bcd,_0x534eb9,!![]);}catch(_0x210ac0){return BPromise['reject'](_0x210ac0);}return _0xed0bcd[_0x1b8e('0x20')]();};}function saveUpdates(_0x701d88,_0x3cae5f){return function(_0x1d8738){if(_0x1d8738){return _0x1d8738[_0x1b8e('0x21')](_0x701d88)[_0x1b8e('0x22')](function(_0xc730f3){return _0xc730f3;});}return null;};}function removeEntity(_0x400a11,_0x3e9ddb){return function(_0x3324db){if(_0x3324db){return _0x3324db[_0x1b8e('0x23')]()[_0x1b8e('0x22')](function(){_0x400a11['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da8e5,_0x1e06cc){return function(_0x271dc5){if(!_0x271dc5){_0x3da8e5['sendStatus'](0x194);}return _0x271dc5;};}function handleError(_0x51dec4,_0x278407){_0x278407=_0x278407||0x1f4;return function(_0x3caad3){logger['error'](_0x3caad3['stack']);if(_0x3caad3[_0x1b8e('0x24')]){delete _0x3caad3['name'];}_0x51dec4['status'](_0x278407)['send'](_0x3caad3);};}exports['index']=function(_0x3b6f96,_0x1cf2a9){var _0x32308c={},_0x5a744a={},_0x3172b8={'count':0x0,'rows':[]};var _0x515d71=_[_0x1b8e('0x25')](db['FaxTransferReport'][_0x1b8e('0x26')],function(_0x48da8d){return{'name':_0x48da8d['fieldName'],'type':_0x48da8d['type'][_0x1b8e('0x27')]};});_0x5a744a['model']=_[_0x1b8e('0x25')](_0x515d71,_0x1b8e('0x24'));_0x5a744a[_0x1b8e('0x28')]=_[_0x1b8e('0x29')](_0x3b6f96[_0x1b8e('0x28')]);_0x5a744a[_0x1b8e('0x2a')]=_[_0x1b8e('0x2b')](_0x5a744a['model'],_0x5a744a[_0x1b8e('0x28')]);_0x32308c[_0x1b8e('0x2c')]=_[_0x1b8e('0x2b')](_0x5a744a[_0x1b8e('0x2d')],qs[_0x1b8e('0x2e')](_0x3b6f96[_0x1b8e('0x28')][_0x1b8e('0x2e')]));_0x32308c[_0x1b8e('0x2c')]=_0x32308c[_0x1b8e('0x2c')][_0x1b8e('0x2f')]?_0x32308c[_0x1b8e('0x2c')]:_0x5a744a[_0x1b8e('0x2d')];if(!_0x3b6f96[_0x1b8e('0x28')]['hasOwnProperty'](_0x1b8e('0x30'))){_0x32308c[_0x1b8e('0x1c')]=qs[_0x1b8e('0x1c')](_0x3b6f96[_0x1b8e('0x28')]['limit']);_0x32308c[_0x1b8e('0x1b')]=qs[_0x1b8e('0x1b')](_0x3b6f96[_0x1b8e('0x28')]['offset']);}_0x32308c[_0x1b8e('0x31')]=qs[_0x1b8e('0x32')](_0x3b6f96['query']['sort']);_0x32308c[_0x1b8e('0x33')]=qs[_0x1b8e('0x2a')](_[_0x1b8e('0x34')](_0x3b6f96[_0x1b8e('0x28')],_0x5a744a[_0x1b8e('0x2a')]));if(_0x3b6f96[_0x1b8e('0x28')][_0x1b8e('0x35')]){_0x32308c[_0x1b8e('0x33')]=_[_0x1b8e('0x36')](_0x32308c['where'],{'$or':_[_0x1b8e('0x25')](_0x515d71,function(_0x5c90e8){if(_0x5c90e8['type']!=='VIRTUAL'){var _0x234952={};_0x234952[_0x5c90e8[_0x1b8e('0x24')]]={'$like':'%'+_0x3b6f96[_0x1b8e('0x28')][_0x1b8e('0x35')]+'%'};return _0x234952;}})});}_0x32308c=_[_0x1b8e('0x36')]({},_0x32308c,_0x3b6f96[_0x1b8e('0x37')]);var _0x162ae9={'where':_0x32308c['where']};return db[_0x1b8e('0x38')]['count'](_0x162ae9)[_0x1b8e('0x22')](function(_0x5153b7){_0x3172b8['count']=_0x5153b7;if(_0x3b6f96['query'][_0x1b8e('0x39')]){_0x32308c[_0x1b8e('0x3a')]=[{'all':!![]}];}return db[_0x1b8e('0x38')][_0x1b8e('0x3b')](_0x32308c);})[_0x1b8e('0x22')](function(_0x48fb3d){_0x3172b8['rows']=_0x48fb3d;return _0x3172b8;})[_0x1b8e('0x22')](respondWithFilteredResult(_0x1cf2a9,_0x32308c))['catch'](handleError(_0x1cf2a9,null));};exports[_0x1b8e('0x3c')]=function(_0x3bc723,_0x1fb139){var _0x185475={'raw':!![],'where':{'id':_0x3bc723[_0x1b8e('0x3d')]['id']}},_0x4587fb={};_0x4587fb['model']=_['keys'](db['FaxTransferReport']['rawAttributes']);_0x4587fb['query']=_[_0x1b8e('0x29')](_0x3bc723['query']);_0x4587fb[_0x1b8e('0x2a')]=_[_0x1b8e('0x2b')](_0x4587fb[_0x1b8e('0x2d')],_0x4587fb['query']);_0x185475[_0x1b8e('0x2c')]=_[_0x1b8e('0x2b')](_0x4587fb[_0x1b8e('0x2d')],qs[_0x1b8e('0x2e')](_0x3bc723[_0x1b8e('0x28')][_0x1b8e('0x2e')]));_0x185475[_0x1b8e('0x2c')]=_0x185475[_0x1b8e('0x2c')][_0x1b8e('0x2f')]?_0x185475[_0x1b8e('0x2c')]:_0x4587fb[_0x1b8e('0x2d')];if(_0x3bc723['query']['includeAll']){_0x185475['include']=[{'all':!![]}];}_0x185475=_[_0x1b8e('0x36')]({},_0x185475,_0x3bc723[_0x1b8e('0x37')]);return db[_0x1b8e('0x38')]['find'](_0x185475)[_0x1b8e('0x22')](handleEntityNotFound(_0x1fb139,null))[_0x1b8e('0x22')](respondWithResult(_0x1fb139,null))[_0x1b8e('0x3e')](handleError(_0x1fb139,null));};exports[_0x1b8e('0x3f')]=function(_0x4da6e1,_0x18ced7){return db[_0x1b8e('0x38')][_0x1b8e('0x3f')](_0x4da6e1[_0x1b8e('0x40')],{})[_0x1b8e('0x22')](respondWithResult(_0x18ced7,0xc9))[_0x1b8e('0x3e')](handleError(_0x18ced7,null));};exports['update']=function(_0x293b9d,_0x30ca7b){if(_0x293b9d[_0x1b8e('0x40')]['id']){delete _0x293b9d[_0x1b8e('0x40')]['id'];}return db[_0x1b8e('0x38')][_0x1b8e('0x41')]({'where':{'id':_0x293b9d['params']['id']}})['then'](handleEntityNotFound(_0x30ca7b,null))[_0x1b8e('0x22')](saveUpdates(_0x293b9d[_0x1b8e('0x40')],null))[_0x1b8e('0x22')](respondWithResult(_0x30ca7b,null))['catch'](handleError(_0x30ca7b,null));};exports[_0x1b8e('0x23')]=function(_0x36bccc,_0x58d88d){return db['FaxTransferReport'][_0x1b8e('0x41')]({'where':{'id':_0x36bccc[_0x1b8e('0x3d')]['id']}})[_0x1b8e('0x22')](handleEntityNotFound(_0x58d88d,null))[_0x1b8e('0x22')](removeEntity(_0x58d88d,null))[_0x1b8e('0x3e')](handleError(_0x58d88d,null));};exports[_0x1b8e('0x42')]=function(_0xfbef93,_0xa98052){return db[_0x1b8e('0x38')][_0x1b8e('0x42')]()['then'](respondWithResult(_0xa98052,null))[_0x1b8e('0x3e')](handleError(_0xa98052,null));}; \ No newline at end of file +var _0x9157=['filters','merge','type','filter','options','FaxTransferReport','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','rawAttributes','key','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0xed4e36,_0x695439){var _0x58eb80=function(_0x49e5c8){while(--_0x49e5c8){_0xed4e36['push'](_0xed4e36['shift']());}};_0x58eb80(++_0x695439);}(_0x9157,0x138));var _0x7915=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x9157[_0x1034ca];return _0x1a023a;};'use strict';var pdf=require(_0x7915('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7915('0x1'));var zipdir=require(_0x7915('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7915('0x3'));var moment=require(_0x7915('0x4'));var BPromise=require(_0x7915('0x5'));var Mustache=require(_0x7915('0x6'));var util=require(_0x7915('0x7'));var path=require(_0x7915('0x8'));var sox=require(_0x7915('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7915('0xa'));var squel=require(_0x7915('0xb'));var crypto=require(_0x7915('0xc'));var jsforce=require(_0x7915('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7915('0xe'));var querystring=require(_0x7915('0xf'));var Papa=require(_0x7915('0x10'));var Redis=require(_0x7915('0x11'));var authService=require(_0x7915('0x12'));var qs=require(_0x7915('0x13'));var as=require(_0x7915('0x14'));var hardwareService=require(_0x7915('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x7915('0x16'));var config=require('../../config/environment');var db=require(_0x7915('0x17'))['db'];function respondWithStatusCode(_0x9ae582,_0x495ffe){_0x495ffe=_0x495ffe||0xcc;return function(_0xc9cd49){if(_0xc9cd49){return _0x9ae582[_0x7915('0x18')](_0x495ffe);}return _0x9ae582[_0x7915('0x19')](_0x495ffe)['end']();};}function respondWithResult(_0x2217dd,_0x1a6518){_0x1a6518=_0x1a6518||0xc8;return function(_0x1d9ee7){if(_0x1d9ee7){return _0x2217dd[_0x7915('0x19')](_0x1a6518)[_0x7915('0x1a')](_0x1d9ee7);}};}function respondWithFilteredResult(_0x4dc87c,_0x1c6c51){return function(_0x3e89ca){if(_0x3e89ca){var _0x7c15e8=_0x3e89ca[_0x7915('0x1b')],_0x20752f=_0x1c6c51['offset'],_0x1219d9=_0x1c6c51[_0x7915('0x1c')]+_0x1c6c51[_0x7915('0x1d')],_0x592778;if(_0x1219d9>=_0x7c15e8){_0x1219d9=_0x7c15e8;_0x592778=0xc8;}else{_0x592778=0xce;}_0x4dc87c['status'](_0x592778);return _0x4dc87c['set'](_0x7915('0x1e'),_0x20752f+'-'+_0x1219d9+'/'+_0x7c15e8)[_0x7915('0x1a')](_0x3e89ca);}return null;};}function patchUpdates(_0xa53b4d){return function(_0x4cfc3e){try{jsonpatch[_0x7915('0x1f')](_0x4cfc3e,_0xa53b4d,!![]);}catch(_0x5bcf71){return BPromise[_0x7915('0x20')](_0x5bcf71);}return _0x4cfc3e[_0x7915('0x21')]();};}function saveUpdates(_0x1562d3,_0x137d9f){return function(_0x3d48f3){if(_0x3d48f3){return _0x3d48f3[_0x7915('0x22')](_0x1562d3)[_0x7915('0x23')](function(_0x1b92d9){return _0x1b92d9;});}return null;};}function removeEntity(_0x4b46f7,_0x30f814){return function(_0x55eeca){if(_0x55eeca){return _0x55eeca[_0x7915('0x24')]()[_0x7915('0x23')](function(){_0x4b46f7[_0x7915('0x19')](0xcc)[_0x7915('0x25')]();});}};}function handleEntityNotFound(_0x2885c9,_0x599276){return function(_0x5b3ec1){if(!_0x5b3ec1){_0x2885c9[_0x7915('0x18')](0x194);}return _0x5b3ec1;};}function handleError(_0x423e27,_0x21918c){_0x21918c=_0x21918c||0x1f4;return function(_0x43e838){logger[_0x7915('0x26')](_0x43e838[_0x7915('0x27')]);if(_0x43e838[_0x7915('0x28')]){delete _0x43e838['name'];}_0x423e27[_0x7915('0x19')](_0x21918c)[_0x7915('0x29')](_0x43e838);};}exports[_0x7915('0x2a')]=function(_0x22a6c5,_0x7a9869){var _0x242c07={},_0x1d759c={},_0x52f272={'count':0x0,'rows':[]};var _0x39bb03=_['map'](db['FaxTransferReport'][_0x7915('0x2b')],function(_0x135960){return{'name':_0x135960['fieldName'],'type':_0x135960['type'][_0x7915('0x2c')]};});_0x1d759c[_0x7915('0x2d')]=_[_0x7915('0x2e')](_0x39bb03,_0x7915('0x28'));_0x1d759c['query']=_[_0x7915('0x2f')](_0x22a6c5[_0x7915('0x30')]);_0x1d759c['filters']=_[_0x7915('0x31')](_0x1d759c['model'],_0x1d759c[_0x7915('0x30')]);_0x242c07[_0x7915('0x32')]=_['intersection'](_0x1d759c[_0x7915('0x2d')],qs['fields'](_0x22a6c5[_0x7915('0x30')][_0x7915('0x33')]));_0x242c07[_0x7915('0x32')]=_0x242c07[_0x7915('0x32')][_0x7915('0x34')]?_0x242c07[_0x7915('0x32')]:_0x1d759c[_0x7915('0x2d')];if(!_0x22a6c5[_0x7915('0x30')][_0x7915('0x35')](_0x7915('0x36'))){_0x242c07['limit']=qs[_0x7915('0x1d')](_0x22a6c5['query'][_0x7915('0x1d')]);_0x242c07[_0x7915('0x1c')]=qs['offset'](_0x22a6c5[_0x7915('0x30')][_0x7915('0x1c')]);}_0x242c07[_0x7915('0x37')]=qs[_0x7915('0x38')](_0x22a6c5[_0x7915('0x30')][_0x7915('0x38')]);_0x242c07[_0x7915('0x39')]=qs[_0x7915('0x3a')](_['pick'](_0x22a6c5[_0x7915('0x30')],_0x1d759c[_0x7915('0x3a')]));if(_0x22a6c5['query']['filter']){_0x242c07[_0x7915('0x39')]=_[_0x7915('0x3b')](_0x242c07[_0x7915('0x39')],{'$or':_['map'](_0x39bb03,function(_0x549d51){if(_0x549d51[_0x7915('0x3c')]!=='VIRTUAL'){var _0x541713={};_0x541713[_0x549d51['name']]={'$like':'%'+_0x22a6c5['query'][_0x7915('0x3d')]+'%'};return _0x541713;}})});}_0x242c07=_[_0x7915('0x3b')]({},_0x242c07,_0x22a6c5[_0x7915('0x3e')]);var _0x32d17b={'where':_0x242c07[_0x7915('0x39')]};return db[_0x7915('0x3f')][_0x7915('0x1b')](_0x32d17b)[_0x7915('0x23')](function(_0x84f511){_0x52f272[_0x7915('0x1b')]=_0x84f511;if(_0x22a6c5['query']['includeAll']){_0x242c07[_0x7915('0x40')]=[{'all':!![]}];}return db[_0x7915('0x3f')][_0x7915('0x41')](_0x242c07);})[_0x7915('0x23')](function(_0x29691b){_0x52f272[_0x7915('0x42')]=_0x29691b;return _0x52f272;})[_0x7915('0x23')](respondWithFilteredResult(_0x7a9869,_0x242c07))[_0x7915('0x43')](handleError(_0x7a9869,null));};exports[_0x7915('0x44')]=function(_0x58aa11,_0x39bb74){var _0x4af356={'raw':!![],'where':{'id':_0x58aa11[_0x7915('0x45')]['id']}},_0x4d531f={};_0x4d531f[_0x7915('0x2d')]=_[_0x7915('0x2f')](db['FaxTransferReport']['rawAttributes']);_0x4d531f[_0x7915('0x30')]=_[_0x7915('0x2f')](_0x58aa11['query']);_0x4d531f[_0x7915('0x3a')]=_[_0x7915('0x31')](_0x4d531f['model'],_0x4d531f['query']);_0x4af356[_0x7915('0x32')]=_['intersection'](_0x4d531f['model'],qs[_0x7915('0x33')](_0x58aa11[_0x7915('0x30')][_0x7915('0x33')]));_0x4af356['attributes']=_0x4af356[_0x7915('0x32')][_0x7915('0x34')]?_0x4af356[_0x7915('0x32')]:_0x4d531f[_0x7915('0x2d')];if(_0x58aa11[_0x7915('0x30')]['includeAll']){_0x4af356['include']=[{'all':!![]}];}_0x4af356=_[_0x7915('0x3b')]({},_0x4af356,_0x58aa11['options']);return db[_0x7915('0x3f')][_0x7915('0x46')](_0x4af356)[_0x7915('0x23')](handleEntityNotFound(_0x39bb74,null))[_0x7915('0x23')](respondWithResult(_0x39bb74,null))['catch'](handleError(_0x39bb74,null));};exports[_0x7915('0x47')]=function(_0x2ec962,_0x5b5728){return db[_0x7915('0x3f')][_0x7915('0x47')](_0x2ec962[_0x7915('0x48')],{})[_0x7915('0x23')](respondWithResult(_0x5b5728,0xc9))[_0x7915('0x43')](handleError(_0x5b5728,null));};exports[_0x7915('0x22')]=function(_0x13fab1,_0x10cfbd){if(_0x13fab1[_0x7915('0x48')]['id']){delete _0x13fab1[_0x7915('0x48')]['id'];}return db[_0x7915('0x3f')][_0x7915('0x46')]({'where':{'id':_0x13fab1[_0x7915('0x45')]['id']}})[_0x7915('0x23')](handleEntityNotFound(_0x10cfbd,null))[_0x7915('0x23')](saveUpdates(_0x13fab1['body'],null))[_0x7915('0x23')](respondWithResult(_0x10cfbd,null))[_0x7915('0x43')](handleError(_0x10cfbd,null));};exports[_0x7915('0x24')]=function(_0x3271df,_0x2ff837){return db[_0x7915('0x3f')]['find']({'where':{'id':_0x3271df[_0x7915('0x45')]['id']}})[_0x7915('0x23')](handleEntityNotFound(_0x2ff837,null))[_0x7915('0x23')](removeEntity(_0x2ff837,null))[_0x7915('0x43')](handleError(_0x2ff837,null));};exports[_0x7915('0x49')]=function(_0x18e94e,_0x40f47e){return db[_0x7915('0x3f')]['describe']()['then'](respondWithResult(_0x40f47e,null))[_0x7915('0x43')](handleError(_0x40f47e,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 87c1e79..f011fa8 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 _0x5c97=['../../config/environment','./faxTransferReport.attributes','exports','report_fax_transfer','../../config/logger','api','moment','path'];(function(_0x47316d,_0x24de96){var _0x1a8ec4=function(_0x39c61c){while(--_0x39c61c){_0x47316d['push'](_0x47316d['shift']());}};_0x1a8ec4(++_0x24de96);}(_0x5c97,0x164));var _0x75c9=function(_0x27e7e2,_0x3ddb8a){_0x27e7e2=_0x27e7e2-0x0;var _0x55431f=_0x5c97[_0x27e7e2];return _0x55431f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x75c9('0x0'))(_0x75c9('0x1'));var moment=require(_0x75c9('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75c9('0x3'));var rimraf=require('rimraf');var config=require(_0x75c9('0x4'));var attributes=require(_0x75c9('0x5'));module[_0x75c9('0x6')]=function(_0x5a8382,_0x593294){return _0x5a8382['define']('FaxTransferReport',attributes,{'tableName':_0x75c9('0x7'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8a53=['./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x43a138,_0x2037f6){var _0x1efe89=function(_0x387a43){while(--_0x387a43){_0x43a138['push'](_0x43a138['shift']());}};_0x1efe89(++_0x2037f6);}(_0x8a53,0x86));var _0x38a5=function(_0xa567a8,_0x10e039){_0xa567a8=_0xa567a8-0x0;var _0x59eeaa=_0x8a53[_0xa567a8];return _0x59eeaa;};'use strict';var _=require(_0x38a5('0x0'));var util=require(_0x38a5('0x1'));var logger=require(_0x38a5('0x2'))(_0x38a5('0x3'));var moment=require(_0x38a5('0x4'));var BPromise=require(_0x38a5('0x5'));var rp=require(_0x38a5('0x6'));var fs=require('fs');var path=require(_0x38a5('0x7'));var rimraf=require(_0x38a5('0x8'));var config=require(_0x38a5('0x9'));var attributes=require(_0x38a5('0xa'));module[_0x38a5('0xb')]=function(_0x4daa11,_0x48b53c){return _0x4daa11[_0x38a5('0xc')](_0x38a5('0xd'),attributes,{'tableName':_0x38a5('0xe'),'paranoid':![],'indexes':[{'name':_0x38a5('0xf'),'fields':[_0x38a5('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index b99fd5f..74dcb5f 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 _0x40b1=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error','code','FaxTransferReport,\x20%s,\x20%s'];(function(_0x377270,_0x11c42a){var _0x604bff=function(_0x47afd8){while(--_0x47afd8){_0x377270['push'](_0x377270['shift']());}};_0x604bff(++_0x11c42a);}(_0x40b1,0x12e));var _0x140b=function(_0x5e9092,_0x2a064e){_0x5e9092=_0x5e9092-0x0;var _0x8fea2f=_0x40b1[_0x5e9092];return _0x8fea2f;};'use strict';var _=require(_0x140b('0x0'));var util=require(_0x140b('0x1'));var moment=require(_0x140b('0x2'));var BPromise=require(_0x140b('0x3'));var rs=require(_0x140b('0x4'));var fs=require('fs');var Redis=require(_0x140b('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x140b('0x6'));var logger=require(_0x140b('0x7'))(_0x140b('0x8'));var config=require('../../config/environment');var jayson=require(_0x140b('0x9'));var client=jayson[_0x140b('0xa')][_0x140b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31054d,_0x3e6f41,_0x3c7fff){return new BPromise(function(_0x172a43,_0x7d6234){return client[_0x140b('0xc')](_0x31054d,_0x3c7fff)[_0x140b('0xd')](function(_0x16efed){logger['info']('FaxTransferReport,\x20%s,\x20%s',_0x3e6f41,_0x140b('0xe'));logger[_0x140b('0xf')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x3e6f41,'request\x20sent',JSON[_0x140b('0x10')](_0x16efed));if(_0x16efed[_0x140b('0x11')]){if(_0x16efed['error'][_0x140b('0x12')]===0x1f4){logger['error'](_0x140b('0x13'),_0x3e6f41,_0x16efed[_0x140b('0x11')][_0x140b('0x14')]);return _0x7d6234(_0x16efed[_0x140b('0x11')][_0x140b('0x14')]);}logger[_0x140b('0x11')](_0x140b('0x13'),_0x3e6f41,_0x16efed[_0x140b('0x11')][_0x140b('0x14')]);return _0x172a43(_0x16efed[_0x140b('0x11')][_0x140b('0x14')]);}else{logger[_0x140b('0x15')](_0x140b('0x13'),_0x3e6f41,'request\x20sent');_0x172a43(_0x16efed[_0x140b('0x16')][_0x140b('0x14')]);}})['catch'](function(_0x449528){logger[_0x140b('0x11')](_0x140b('0x13'),_0x3e6f41,_0x449528);_0x7d6234(_0x449528);});});} \ No newline at end of file +var _0x3acc=['util','moment','randomstring','ioredis','../../config/logger','rpc','jayson/promise','http','request','info','FaxTransferReport,\x20%s,\x20%s','debug','FaxTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash'];(function(_0x25870a,_0x297f27){var _0x19d0b3=function(_0x59bef3){while(--_0x59bef3){_0x25870a['push'](_0x25870a['shift']());}};_0x19d0b3(++_0x297f27);}(_0x3acc,0xd1));var _0xc3ac=function(_0x45b40c,_0x36a203){_0x45b40c=_0x45b40c-0x0;var _0x5b1585=_0x3acc[_0x45b40c];return _0x5b1585;};'use strict';var _=require(_0xc3ac('0x0'));var util=require(_0xc3ac('0x1'));var moment=require(_0xc3ac('0x2'));var BPromise=require('bluebird');var rs=require(_0xc3ac('0x3'));var fs=require('fs');var Redis=require(_0xc3ac('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc3ac('0x5'))(_0xc3ac('0x6'));var config=require('../../config/environment');var jayson=require(_0xc3ac('0x7'));var client=jayson['client'][_0xc3ac('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2b2324,_0x204606,_0x347cc2){return new BPromise(function(_0x16a069,_0x308eba){return client[_0xc3ac('0x9')](_0x2b2324,_0x347cc2)['then'](function(_0x3afa75){logger[_0xc3ac('0xa')](_0xc3ac('0xb'),_0x204606,'request\x20sent');logger[_0xc3ac('0xc')](_0xc3ac('0xd'),_0x204606,'request\x20sent',JSON[_0xc3ac('0xe')](_0x3afa75));if(_0x3afa75[_0xc3ac('0xf')]){if(_0x3afa75['error'][_0xc3ac('0x10')]===0x1f4){logger['error'](_0xc3ac('0xb'),_0x204606,_0x3afa75[_0xc3ac('0xf')][_0xc3ac('0x11')]);return _0x308eba(_0x3afa75[_0xc3ac('0xf')][_0xc3ac('0x11')]);}logger[_0xc3ac('0xf')]('FaxTransferReport,\x20%s,\x20%s',_0x204606,_0x3afa75[_0xc3ac('0xf')][_0xc3ac('0x11')]);return _0x16a069(_0x3afa75[_0xc3ac('0xf')][_0xc3ac('0x11')]);}else{logger[_0xc3ac('0xa')](_0xc3ac('0xb'),_0x204606,_0xc3ac('0x12'));_0x16a069(_0x3afa75[_0xc3ac('0x13')][_0xc3ac('0x11')]);}})[_0xc3ac('0x14')](function(_0x366582){logger[_0xc3ac('0xf')](_0xc3ac('0xb'),_0x204606,_0x366582);_0x308eba(_0x366582);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index 492c98e..1aac233 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 _0x7ac0=['connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','isAuthenticated','index','/describe','describe','get','/:id','show','create','update','delete','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7ac0,0x151));var _0x07ac=function(_0x148b48,_0x1ac851){_0x148b48=_0x148b48-0x0;var _0x18e773=_0x7ac0[_0x148b48];return _0x18e773;};'use strict';var multer=require(_0x07ac('0x0'));var util=require(_0x07ac('0x1'));var path=require(_0x07ac('0x2'));var timeout=require(_0x07ac('0x3'));var express=require(_0x07ac('0x4'));var router=express['Router']();var auth=require(_0x07ac('0x5'));var interaction=require(_0x07ac('0x6'));var config=require(_0x07ac('0x7'));var controller=require(_0x07ac('0x8'));router['get']('/',auth[_0x07ac('0x9')](),controller[_0x07ac('0xa')]);router['get'](_0x07ac('0xb'),auth[_0x07ac('0x9')](),controller[_0x07ac('0xc')]);router[_0x07ac('0xd')](_0x07ac('0xe'),auth[_0x07ac('0x9')](),controller[_0x07ac('0xf')]);router['post']('/',auth['isAuthenticated'](),controller[_0x07ac('0x10')]);router['put'](_0x07ac('0xe'),auth['isAuthenticated'](),controller[_0x07ac('0x11')]);router[_0x07ac('0x12')](_0x07ac('0xe'),auth['isAuthenticated'](),controller['destroy']);module[_0x07ac('0x13')]=router; \ No newline at end of file +var _0x15e7=['create','put','update','delete','destroy','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','describe','/:id','show','post'];(function(_0xd8a19a,_0x4b2395){var _0xfec191=function(_0x43cc88){while(--_0x43cc88){_0xd8a19a['push'](_0xd8a19a['shift']());}};_0xfec191(++_0x4b2395);}(_0x15e7,0x137));var _0x715e=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x15e7[_0x2f5ac5];return _0x37c9a8;};'use strict';var multer=require('multer');var util=require(_0x715e('0x0'));var path=require(_0x715e('0x1'));var timeout=require(_0x715e('0x2'));var express=require(_0x715e('0x3'));var router=express['Router']();var auth=require(_0x715e('0x4'));var interaction=require(_0x715e('0x5'));var config=require(_0x715e('0x6'));var controller=require('./faxTransferReport.controller');router['get']('/',auth[_0x715e('0x7')](),controller[_0x715e('0x8')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x715e('0x9')]);router['get'](_0x715e('0xa'),auth[_0x715e('0x7')](),controller[_0x715e('0xb')]);router[_0x715e('0xc')]('/',auth['isAuthenticated'](),controller[_0x715e('0xd')]);router[_0x715e('0xe')](_0x715e('0xa'),auth[_0x715e('0x7')](),controller[_0x715e('0xf')]);router[_0x715e('0x10')](_0x715e('0xa'),auth[_0x715e('0x7')](),controller[_0x715e('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index dc5ee2d..8323f12 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 _0xf494=['../../components/interaction/service','../../config/environment','./intDeskAccount.controller','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x4a95cc,_0x5c7129){var _0x2360a0=function(_0x2ea134){while(--_0x2ea134){_0x4a95cc['push'](_0x4a95cc['shift']());}};_0x2360a0(++_0x5c7129);}(_0xf494,0x1c6));var _0x4f49=function(_0x42c8ce,_0xdc007f){_0x42c8ce=_0x42c8ce-0x0;var _0x348975=_0xf494[_0x42c8ce];return _0x348975;};'use strict';var multer=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var path=require(_0x4f49('0x2'));var timeout=require('connect-timeout');var express=require(_0x4f49('0x3'));var router=express[_0x4f49('0x4')]();var auth=require(_0x4f49('0x5'));var interaction=require(_0x4f49('0x6'));var config=require(_0x4f49('0x7'));var controller=require(_0x4f49('0x8'));router[_0x4f49('0x9')]('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0xb')]);router[_0x4f49('0x9')](_0x4f49('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x4f49('0x9')](_0x4f49('0xd'),auth[_0x4f49('0xa')](),controller[_0x4f49('0xe')]);router[_0x4f49('0x9')](_0x4f49('0xf'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x10')]);router['post']('/',auth[_0x4f49('0xa')](),controller[_0x4f49('0x11')]);router['post'](_0x4f49('0xd'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0x4f49('0x12')](_0x4f49('0xc'),auth['isAuthenticated'](),controller[_0x4f49('0x13')]);router[_0x4f49('0x14')](_0x4f49('0xc'),auth[_0x4f49('0xa')](),controller[_0x4f49('0x15')]);module[_0x4f49('0x16')]=router; \ No newline at end of file +var _0xaba6=['addConfiguration','put','update','delete','destroy','exports','multer','util','../../components/auth/service','../../components/interaction/service','./intDeskAccount.controller','get','/:id','show','isAuthenticated','getConfigurations','/:id/fields','getFields','post','create'];(function(_0x11af74,_0x4576a8){var _0x19c129=function(_0x49a345){while(--_0x49a345){_0x11af74['push'](_0x11af74['shift']());}};_0x19c129(++_0x4576a8);}(_0xaba6,0xe2));var _0x6aba=function(_0x3dbd6d,_0x3ee9d7){_0x3dbd6d=_0x3dbd6d-0x0;var _0x1216f1=_0xaba6[_0x3dbd6d];return _0x1216f1;};'use strict';var multer=require(_0x6aba('0x0'));var util=require(_0x6aba('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x6aba('0x2'));var interaction=require(_0x6aba('0x3'));var config=require('../../config/environment');var controller=require(_0x6aba('0x4'));router[_0x6aba('0x5')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x6aba('0x6'),auth['isAuthenticated'](),controller[_0x6aba('0x7')]);router[_0x6aba('0x5')]('/:id/configurations',auth[_0x6aba('0x8')](),controller[_0x6aba('0x9')]);router['get'](_0x6aba('0xa'),auth[_0x6aba('0x8')](),controller[_0x6aba('0xb')]);router[_0x6aba('0xc')]('/',auth[_0x6aba('0x8')](),controller[_0x6aba('0xd')]);router[_0x6aba('0xc')]('/:id/configurations',auth[_0x6aba('0x8')](),controller[_0x6aba('0xe')]);router[_0x6aba('0xf')](_0x6aba('0x6'),auth['isAuthenticated'](),controller[_0x6aba('0x10')]);router[_0x6aba('0x11')]('/:id',auth[_0x6aba('0x8')](),controller[_0x6aba('0x12')]);module[_0x6aba('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 2ca3057..db6185b 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 _0x4f0a=['basic','integrationTab','STRING','ENUM'];(function(_0x20aefe,_0x362453){var _0x11a9d3=function(_0x1a8769){while(--_0x1a8769){_0x20aefe['push'](_0x20aefe['shift']());}};_0x11a9d3(++_0x362453);}(_0x4f0a,0xe6));var _0xa4f0=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x4f0a[_0x3e0dc4];return _0x586111;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa4f0('0x0')]},'remoteUri':{'type':Sequelize[_0xa4f0('0x0')]},'authType':{'type':Sequelize[_0xa4f0('0x1')](_0xa4f0('0x2')),'defaultValue':_0xa4f0('0x2')},'password':{'type':Sequelize[_0xa4f0('0x0')]},'consumerKey':{'type':Sequelize[_0xa4f0('0x0')]},'consumerSecret':{'type':Sequelize[_0xa4f0('0x0')]},'token':{'type':Sequelize['STRING']},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0xa4f0('0x0')]},'type':{'type':Sequelize[_0xa4f0('0x1')](_0xa4f0('0x3'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0xa1e7=['exports','STRING','ENUM','basic','integrationTab','newTab','sequelize'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0xa1e7,0x187));var _0x7a1e=function(_0x19898c,_0x1bc283){_0x19898c=_0x19898c-0x0;var _0x29b739=_0xa1e7[_0x19898c];return _0x29b739;};'use strict';var Sequelize=require(_0x7a1e('0x0'));module[_0x7a1e('0x1')]={'name':{'type':Sequelize[_0x7a1e('0x2')]},'description':{'type':Sequelize[_0x7a1e('0x2')]},'username':{'type':Sequelize[_0x7a1e('0x2')]},'remoteUri':{'type':Sequelize[_0x7a1e('0x2')]},'authType':{'type':Sequelize[_0x7a1e('0x3')]('basic'),'defaultValue':_0x7a1e('0x4')},'password':{'type':Sequelize[_0x7a1e('0x2')]},'consumerKey':{'type':Sequelize[_0x7a1e('0x2')]},'consumerSecret':{'type':Sequelize[_0x7a1e('0x2')]},'token':{'type':Sequelize[_0x7a1e('0x2')]},'tokenSecret':{'type':Sequelize[_0x7a1e('0x2')]},'serverUrl':{'type':Sequelize[_0x7a1e('0x2')]},'type':{'type':Sequelize['ENUM'](_0x7a1e('0x5'),_0x7a1e('0x6')),'defaultValue':_0x7a1e('0x5')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 68b45c8..fc2ff2b 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 _0x7671=['consumerKey','consumerSecret','token','tokenSecret','remoteUri','slice','substring','lastIndexOf','GET','%s/custom_fields','application/json','basic','headers','Authorization','format','Basic\x20%s','%s:%s','toString','base64','label','send','test','Wrong\x20credentials','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','name','index','map','DeskAccount','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','length','includeAll','find','create','body','update','findOne','DeskConfiguration','getConfigurations','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','authType','username'];(function(_0x49b4e9,_0x45e0f2){var _0x3b4cdc=function(_0x1abf00){while(--_0x1abf00){_0x49b4e9['push'](_0x49b4e9['shift']());}};_0x3b4cdc(++_0x45e0f2);}(_0x7671,0x96));var _0x1767=function(_0x26e606,_0xf6d86e){_0x26e606=_0x26e606-0x0;var _0x4b346e=_0x7671[_0x26e606];return _0x4b346e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1767('0x0'));var rimraf=require(_0x1767('0x1'));var zipdir=require(_0x1767('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1767('0x3'));var moment=require(_0x1767('0x4'));var BPromise=require(_0x1767('0x5'));var Mustache=require('mustache');var util=require(_0x1767('0x6'));var path=require(_0x1767('0x7'));var sox=require(_0x1767('0x8'));var csv=require(_0x1767('0x9'));var ejs=require(_0x1767('0xa'));var fs=require('fs');var _=require(_0x1767('0xb'));var squel=require('squel');var crypto=require(_0x1767('0xc'));var jsforce=require(_0x1767('0xd'));var deskjs=require(_0x1767('0xe'));var toCsv=require(_0x1767('0x9'));var querystring=require(_0x1767('0xf'));var Papa=require(_0x1767('0x10'));var Redis=require('ioredis');var authService=require(_0x1767('0x11'));var qs=require(_0x1767('0x12'));var as=require(_0x1767('0x13'));var hardwareService=require(_0x1767('0x14'));var logger=require('../../config/logger')(_0x1767('0x15'));var utils=require(_0x1767('0x16'));var config=require(_0x1767('0x17'));var db=require(_0x1767('0x18'))['db'];var integrations=require(_0x1767('0x19'));var jayson=require(_0x1767('0x1a'));var client=jayson[_0x1767('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2cd6b5,_0x54b93d,_0x26c676){if(_0x26c676){var _0x2edc74=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2edc74['test'](_0x54b93d)){return _0x2cd6b5;}else{throw new db[(_0x1767('0x1c'))][(_0x1767('0x1d'))](_0x1767('0x1e'));}}else{return _0x2cd6b5;}}function respondWithRpcPromise(_0x4fa0d6,_0x5e74d5,_0x3d6b4e,_0x3c7645){return new BPromise(function(_0x360039,_0x5f288a){var _0x19e083=_0x3c7645||client;return _0x19e083[_0x1767('0x1f')](_0x4fa0d6,_0x3d6b4e)[_0x1767('0x20')](function(_0x3165dd){logger[_0x1767('0x21')]('DeskAccount,\x20%s,\x20%s',_0x5e74d5,_0x1767('0x22'));logger[_0x1767('0x23')](_0x1767('0x24'),_0x5e74d5,_0x1767('0x22'),JSON[_0x1767('0x25')](_0x3165dd));if(_0x3165dd['error']){if(_0x3165dd[_0x1767('0x26')][_0x1767('0x27')]===0x1f4){logger['error'](_0x1767('0x28'),_0x5e74d5,_0x3165dd[_0x1767('0x26')][_0x1767('0x29')]);return _0x5f288a(_0x3165dd[_0x1767('0x26')]['message']);}logger[_0x1767('0x26')](_0x1767('0x28'),_0x5e74d5,_0x3165dd['error'][_0x1767('0x29')]);return _0x360039(_0x3165dd[_0x1767('0x26')][_0x1767('0x29')]);}else{logger[_0x1767('0x21')](_0x1767('0x28'),_0x5e74d5,_0x1767('0x22'));_0x360039(_0x3165dd[_0x1767('0x2a')][_0x1767('0x29')]);}})[_0x1767('0x2b')](function(_0x463c07){logger[_0x1767('0x26')](_0x1767('0x28'),_0x5e74d5,_0x463c07);_0x5f288a(_0x463c07);});});}function respondWithStatusCode(_0x2b1e15,_0x54d16c){_0x54d16c=_0x54d16c||0xcc;return function(_0x4bf592){if(_0x4bf592){return _0x2b1e15[_0x1767('0x2c')](_0x54d16c);}return _0x2b1e15[_0x1767('0x2d')](_0x54d16c)[_0x1767('0x2e')]();};}function respondWithResult(_0xed1629,_0x25c2b3){_0x25c2b3=_0x25c2b3||0xc8;return function(_0x2a6c66){if(_0x2a6c66){return _0xed1629[_0x1767('0x2d')](_0x25c2b3)[_0x1767('0x2f')](_0x2a6c66);}};}function respondWithFilteredResult(_0x4b42f8,_0x5ded24){return function(_0xac1fd6){if(_0xac1fd6){var _0x584070=_0xac1fd6[_0x1767('0x30')],_0x137338=_0x5ded24[_0x1767('0x31')],_0x945f88=_0x5ded24[_0x1767('0x31')]+_0x5ded24[_0x1767('0x32')],_0x20d746;if(_0x945f88>=_0x584070){_0x945f88=_0x584070;_0x20d746=0xc8;}else{_0x20d746=0xce;}_0x4b42f8[_0x1767('0x2d')](_0x20d746);return _0x4b42f8[_0x1767('0x33')](_0x1767('0x34'),_0x137338+'-'+_0x945f88+'/'+_0x584070)[_0x1767('0x2f')](_0xac1fd6);}return null;};}function patchUpdates(_0x15b202){return function(_0x3dac16){try{jsonpatch['apply'](_0x3dac16,_0x15b202,!![]);}catch(_0x23d4ac){return BPromise[_0x1767('0x35')](_0x23d4ac);}return _0x3dac16[_0x1767('0x36')]();};}function saveUpdates(_0x40450c,_0x4ff3f4){return function(_0x4ec8cf){if(_0x4ec8cf){return _0x4ec8cf['update'](_0x40450c)['then'](function(_0x3fc347){return _0x3fc347;});}return null;};}function removeEntity(_0x48a859,_0x490718){return function(_0x569d5d){if(_0x569d5d){return _0x569d5d[_0x1767('0x37')]()[_0x1767('0x20')](function(){_0x48a859[_0x1767('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59b993,_0x4194f5){return function(_0x5a4635){if(!_0x5a4635){_0x59b993[_0x1767('0x2c')](0x194);}return _0x5a4635;};}function handleError(_0xca2a2d,_0x3c3af0){_0x3c3af0=_0x3c3af0||0x1f4;return function(_0x54056d){logger[_0x1767('0x26')](_0x54056d['stack']);if(_0x54056d[_0x1767('0x38')]){delete _0x54056d[_0x1767('0x38')];}_0xca2a2d[_0x1767('0x2d')](_0x3c3af0)['send'](_0x54056d);};}exports[_0x1767('0x39')]=function(_0x314390,_0x43a756){var _0x4feec1={},_0x5bab08={},_0x31b835={'count':0x0,'rows':[]};var _0x49ae10=_[_0x1767('0x3a')](db[_0x1767('0x3b')][_0x1767('0x3c')],function(_0x1ab808){return{'name':_0x1ab808['fieldName'],'type':_0x1ab808[_0x1767('0x3d')]['key']};});_0x5bab08[_0x1767('0x3e')]=_[_0x1767('0x3a')](_0x49ae10,_0x1767('0x38'));_0x5bab08[_0x1767('0x3f')]=_[_0x1767('0x40')](_0x314390[_0x1767('0x3f')]);_0x5bab08[_0x1767('0x41')]=_['intersection'](_0x5bab08[_0x1767('0x3e')],_0x5bab08['query']);_0x4feec1[_0x1767('0x42')]=_[_0x1767('0x43')](_0x5bab08['model'],qs['fields'](_0x314390[_0x1767('0x3f')][_0x1767('0x44')]));_0x4feec1['attributes']=_0x4feec1[_0x1767('0x42')]['length']?_0x4feec1[_0x1767('0x42')]:_0x5bab08[_0x1767('0x3e')];if(!_0x314390[_0x1767('0x3f')][_0x1767('0x45')](_0x1767('0x46'))){_0x4feec1[_0x1767('0x32')]=qs['limit'](_0x314390[_0x1767('0x3f')][_0x1767('0x32')]);_0x4feec1[_0x1767('0x31')]=qs[_0x1767('0x31')](_0x314390[_0x1767('0x3f')]['offset']);}_0x4feec1[_0x1767('0x47')]=qs[_0x1767('0x48')](_0x314390[_0x1767('0x3f')]['sort']);_0x4feec1[_0x1767('0x49')]=qs[_0x1767('0x41')](_[_0x1767('0x4a')](_0x314390['query'],_0x5bab08['filters']));if(_0x314390['query'][_0x1767('0x4b')]){_0x4feec1[_0x1767('0x49')]=_[_0x1767('0x4c')](_0x4feec1[_0x1767('0x49')],{'$or':_[_0x1767('0x3a')](_0x49ae10,function(_0x3fd88e){if(_0x3fd88e[_0x1767('0x3d')]!==_0x1767('0x4d')){var _0x186e07={};_0x186e07[_0x3fd88e['name']]={'$like':'%'+_0x314390[_0x1767('0x3f')]['filter']+'%'};return _0x186e07;}})});}_0x4feec1=_[_0x1767('0x4c')]({},_0x4feec1,_0x314390[_0x1767('0x4e')]);var _0x10fc73={'where':_0x4feec1[_0x1767('0x49')]};return db[_0x1767('0x3b')]['count'](_0x10fc73)['then'](function(_0x1cc92d){_0x31b835[_0x1767('0x30')]=_0x1cc92d;if(_0x314390[_0x1767('0x3f')]['includeAll']){_0x4feec1[_0x1767('0x4f')]=[{'all':!![]}];}return db[_0x1767('0x3b')][_0x1767('0x50')](_0x4feec1);})[_0x1767('0x20')](function(_0x4cb02c){_0x31b835[_0x1767('0x51')]=_0x4cb02c;return _0x31b835;})['then'](respondWithFilteredResult(_0x43a756,_0x4feec1))[_0x1767('0x2b')](handleError(_0x43a756,null));};exports[_0x1767('0x52')]=function(_0x25f4a5,_0x484b68){var _0x519d17={'raw':![],'where':{'id':_0x25f4a5[_0x1767('0x53')]['id']}},_0x429283={};_0x429283[_0x1767('0x3e')]=_[_0x1767('0x40')](db['DeskAccount']['rawAttributes']);_0x429283['query']=_[_0x1767('0x40')](_0x25f4a5[_0x1767('0x3f')]);_0x429283[_0x1767('0x41')]=_[_0x1767('0x43')](_0x429283[_0x1767('0x3e')],_0x429283[_0x1767('0x3f')]);_0x519d17[_0x1767('0x42')]=_[_0x1767('0x43')](_0x429283[_0x1767('0x3e')],qs[_0x1767('0x44')](_0x25f4a5[_0x1767('0x3f')]['fields']));_0x519d17[_0x1767('0x42')]=_0x519d17['attributes'][_0x1767('0x54')]?_0x519d17[_0x1767('0x42')]:_0x429283[_0x1767('0x3e')];if(_0x25f4a5[_0x1767('0x3f')][_0x1767('0x55')]){_0x519d17[_0x1767('0x4f')]=[{'all':!![]}];}_0x519d17=_['merge']({},_0x519d17,_0x25f4a5[_0x1767('0x4e')]);return db[_0x1767('0x3b')][_0x1767('0x56')](_0x519d17)[_0x1767('0x20')](handleEntityNotFound(_0x484b68,null))[_0x1767('0x20')](respondWithResult(_0x484b68,null))['catch'](handleError(_0x484b68,null));};exports[_0x1767('0x57')]=function(_0x4106ce,_0x58727f){return db[_0x1767('0x3b')]['create'](_0x4106ce[_0x1767('0x58')],{})['then'](respondWithResult(_0x58727f,0xc9))['catch'](handleError(_0x58727f,null));};exports[_0x1767('0x59')]=function(_0xf5b216,_0x16f1c2){if(_0xf5b216[_0x1767('0x58')]['id']){delete _0xf5b216[_0x1767('0x58')]['id'];}return db['DeskAccount'][_0x1767('0x56')]({'where':{'id':_0xf5b216[_0x1767('0x53')]['id']}})[_0x1767('0x20')](handleEntityNotFound(_0x16f1c2,null))[_0x1767('0x20')](saveUpdates(_0xf5b216[_0x1767('0x58')],null))['then'](respondWithResult(_0x16f1c2,null))[_0x1767('0x2b')](handleError(_0x16f1c2,null));};exports[_0x1767('0x37')]=function(_0x104132,_0x4bfa89){return db['DeskAccount'][_0x1767('0x56')]({'where':{'id':_0x104132[_0x1767('0x53')]['id']}})[_0x1767('0x20')](handleEntityNotFound(_0x4bfa89,null))['then'](removeEntity(_0x4bfa89,null))['catch'](handleError(_0x4bfa89,null));};exports['getConfigurations']=function(_0x260733,_0x4d6c7f,_0x5dfcee){var _0xb9e3a4={};var _0x1c68ab={};var _0x48bde5;var _0x103451;return db[_0x1767('0x3b')][_0x1767('0x5a')]({'where':{'id':_0x260733[_0x1767('0x53')]['id']}})['then'](handleEntityNotFound(_0x4d6c7f,null))[_0x1767('0x20')](function(_0x4ecbb1){if(_0x4ecbb1){_0x48bde5=_0x4ecbb1;_0x1c68ab[_0x1767('0x3e')]=_[_0x1767('0x40')](db[_0x1767('0x5b')]['rawAttributes']);_0x1c68ab[_0x1767('0x3f')]=_[_0x1767('0x40')](_0x260733[_0x1767('0x3f')]);_0x1c68ab[_0x1767('0x41')]=_[_0x1767('0x43')](_0x1c68ab[_0x1767('0x3e')],_0x1c68ab[_0x1767('0x3f')]);_0xb9e3a4['attributes']=_['intersection'](_0x1c68ab[_0x1767('0x3e')],qs[_0x1767('0x44')](_0x260733['query'][_0x1767('0x44')]));_0xb9e3a4[_0x1767('0x42')]=_0xb9e3a4[_0x1767('0x42')][_0x1767('0x54')]?_0xb9e3a4[_0x1767('0x42')]:_0x1c68ab[_0x1767('0x3e')];_0xb9e3a4['order']=qs[_0x1767('0x48')](_0x260733[_0x1767('0x3f')]['sort']);_0xb9e3a4[_0x1767('0x49')]=qs[_0x1767('0x41')](_['pick'](_0x260733[_0x1767('0x3f')],_0x1c68ab[_0x1767('0x41')]));if(_0x260733[_0x1767('0x3f')][_0x1767('0x4b')]){_0xb9e3a4[_0x1767('0x49')]=_[_0x1767('0x4c')](_0xb9e3a4[_0x1767('0x49')],{'$or':_['map'](_0xb9e3a4[_0x1767('0x42')],function(_0x192d7a){var _0xaa18f5={};_0xaa18f5[_0x192d7a]={'$like':'%'+_0x260733[_0x1767('0x3f')][_0x1767('0x4b')]+'%'};return _0xaa18f5;})});}_0xb9e3a4=_[_0x1767('0x4c')]({},_0xb9e3a4,_0x260733[_0x1767('0x4e')]);return _0x48bde5['getConfigurations'](_0xb9e3a4);}})[_0x1767('0x20')](function(_0x266a1c){if(_0x266a1c){_0x103451=_0x266a1c[_0x1767('0x54')];if(!_0x260733[_0x1767('0x3f')][_0x1767('0x45')](_0x1767('0x46'))){_0xb9e3a4[_0x1767('0x32')]=qs['limit'](_0x260733['query'][_0x1767('0x32')]);_0xb9e3a4[_0x1767('0x31')]=qs[_0x1767('0x31')](_0x260733[_0x1767('0x3f')][_0x1767('0x31')]);}return _0x48bde5[_0x1767('0x5c')](_0xb9e3a4);}})[_0x1767('0x20')](function(_0x163b1b){if(_0x163b1b){return _0x163b1b?{'count':_0x103451,'rows':_0x163b1b}:null;}})[_0x1767('0x20')](respondWithResult(_0x4d6c7f,null))[_0x1767('0x2b')](handleError(_0x4d6c7f,null));};exports['addConfiguration']=function(_0x1fe580,_0x573712,_0xf1187a){if(_0x1fe580[_0x1767('0x58')]['id']){delete _0x1fe580[_0x1767('0x58')]['id'];}return db[_0x1767('0x3b')]['findOne']({'where':{'id':_0x1fe580[_0x1767('0x53')]['id']}})[_0x1767('0x20')](handleEntityNotFound(_0x573712,null))['then'](function(_0x44c2ce){if(_0x44c2ce){_0x1fe580[_0x1767('0x58')][_0x1767('0x5d')]=_0x44c2ce['id'];_0x1fe580[_0x1767('0x58')][_0x1767('0x5e')]=integrations[_0x1767('0x5f')](_0x1fe580[_0x1767('0x58')][_0x1767('0x60')],_0x1fe580[_0x1767('0x58')][_0x1767('0x3d')]);_0x1fe580['body'][_0x1767('0x61')]=integrations[_0x1767('0x62')](_0x1fe580[_0x1767('0x58')][_0x1767('0x60')],_0x1fe580[_0x1767('0x58')]['type']);return db[_0x1767('0x5b')][_0x1767('0x57')](_0x1fe580['body'],{'include':[{'model':db[_0x1767('0x63')],'as':_0x1767('0x5e')},{'model':db[_0x1767('0x63')],'as':_0x1767('0x61')}]});}return null;})[_0x1767('0x20')](respondWithResult(_0x573712,null))[_0x1767('0x2b')](handleError(_0x573712,null));};exports[_0x1767('0x64')]=function(_0x384857,_0x2290fd,_0x435f55){var _0x4b011b=[{'name':_0x1767('0x65'),'label':_0x1767('0x65'),'custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x1b4d10='';return db[_0x1767('0x3b')][_0x1767('0x5a')]({'where':{'id':_0x384857[_0x1767('0x53')]['id']},'attributes':['id','remoteUri',_0x1767('0x66'),_0x1767('0x67'),'password',_0x1767('0x68'),_0x1767('0x69'),_0x1767('0x6a'),_0x1767('0x6b')]})[_0x1767('0x20')](handleEntityNotFound(_0x2290fd,null))[_0x1767('0x20')](function(_0x40fae7){if(_0x40fae7){_0x1b4d10=_0x40fae7[_0x1767('0x6c')];var _0x2bd290=_0x1b4d10[_0x1767('0x6d')](-0x1);if(_0x2bd290==='/'){_0x1b4d10=_0x1b4d10[_0x1767('0x6e')](0x0,_0x1b4d10[_0x1767('0x6f')](_0x2bd290));}var _0x310c52={'method':_0x1767('0x70'),'uri':util['format'](_0x1767('0x71'),_0x1b4d10),'headers':{'Content-Type':_0x1767('0x72'),'Accept':_0x1767('0x72')},'json':!![]};if(_0x40fae7['authType']===_0x1767('0x73')){_0x310c52[_0x1767('0x74')][_0x1767('0x75')]=util[_0x1767('0x76')](_0x1767('0x77'),new Buffer(util[_0x1767('0x76')](_0x1767('0x78'),_0x40fae7[_0x1767('0x67')],_0x40fae7['password']))[_0x1767('0x79')](_0x1767('0x7a')));}return rp(_0x310c52)['then'](function(_0x1725f4){return _0x4b011b['concat'](_[_0x1767('0x3a')](_0x1725f4['_embedded']['entries'],function(_0x10e767){return{'id':_0x10e767[_0x1767('0x38')],'name':_0x10e767[_0x1767('0x38')],'type':_0x10e767[_0x1767('0x3d')],'active':_0x10e767['active'],'label':_0x10e767[_0x1767('0x7b')],'custom':!![]};}));});}})['then'](function(_0x15a386){return{'count':_0x15a386[_0x1767('0x54')],'rows':_0x15a386};})[_0x1767('0x20')](respondWithResult(_0x2290fd,null))[_0x1767('0x2b')](function(_0x4bdd8a){var _0x24576d=_0x384857['query']['test']?0x1f4:_0x4bdd8a['statusCode']||0x1f4;logger[_0x1767('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0x1767('0x64'),_0x24576d,JSON[_0x1767('0x25')](_0x4bdd8a));delete _0x4bdd8a['name'];if(_0x24576d===0x191){_0x24576d=0x190;}_0x2290fd[_0x1767('0x2d')](_0x24576d)[_0x1767('0x7c')](_0x384857[_0x1767('0x3f')][_0x1767('0x7d')]?{'message':_0x1767('0x7e'),'statusCode':_0x4bdd8a['statusCode']}:_0x4bdd8a);});}; \ No newline at end of file +var _0xf539=['substring','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','Basic\x20%s','%s:%s','_embedded','active','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','offset','limit','set','json','apply','then','destroy','stack','name','index','map','DeskAccount','filters','attributes','intersection','model','fields','length','query','hasOwnProperty','nolimit','order','sort','where','pick','filter','type','merge','count','includeAll','include','findAll','rows','show','params','keys','options','find','create','body','getConfigurations','findOne','rawAttributes','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskConfiguration','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','slice'];(function(_0x2bbe64,_0x6ceee0){var _0xf5fa3f=function(_0x3f8f60){while(--_0x3f8f60){_0x2bbe64['push'](_0x2bbe64['shift']());}};_0xf5fa3f(++_0x6ceee0);}(_0xf539,0x180));var _0x9f53=function(_0x1fd809,_0x1ad7b2){_0x1fd809=_0x1fd809-0x0;var _0x139a8e=_0xf539[_0x1fd809];return _0x139a8e;};'use strict';var pdf=require(_0x9f53('0x0'));var emlformat=require(_0x9f53('0x1'));var rimraf=require(_0x9f53('0x2'));var zipdir=require(_0x9f53('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9f53('0x4'));var moment=require(_0x9f53('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f53('0x6'));var util=require(_0x9f53('0x7'));var path=require(_0x9f53('0x8'));var sox=require('sox');var csv=require(_0x9f53('0x9'));var ejs=require(_0x9f53('0xa'));var fs=require('fs');var _=require(_0x9f53('0xb'));var squel=require(_0x9f53('0xc'));var crypto=require(_0x9f53('0xd'));var jsforce=require(_0x9f53('0xe'));var deskjs=require(_0x9f53('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9f53('0x10'));var Papa=require(_0x9f53('0x11'));var Redis=require(_0x9f53('0x12'));var authService=require(_0x9f53('0x13'));var qs=require(_0x9f53('0x14'));var as=require(_0x9f53('0x15'));var hardwareService=require(_0x9f53('0x16'));var logger=require(_0x9f53('0x17'))(_0x9f53('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x9f53('0x19'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9f53('0x1a'));var client=jayson['client'][_0x9f53('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x585db3,_0x3c40d9,_0xf839d3){if(_0xf839d3){var _0x265653=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x265653['test'](_0x3c40d9)){return _0x585db3;}else{throw new db['Sequelize']['ValidationError'](_0x9f53('0x1c'));}}else{return _0x585db3;}}function respondWithRpcPromise(_0x3766db,_0x27a11c,_0x282e3e,_0x426da4){return new BPromise(function(_0xbdad87,_0x1bd7e5){var _0x38f81e=_0x426da4||client;return _0x38f81e['request'](_0x3766db,_0x282e3e)['then'](function(_0x3c261b){logger[_0x9f53('0x1d')](_0x9f53('0x1e'),_0x27a11c,_0x9f53('0x1f'));logger[_0x9f53('0x20')](_0x9f53('0x21'),_0x27a11c,_0x9f53('0x1f'),JSON[_0x9f53('0x22')](_0x3c261b));if(_0x3c261b[_0x9f53('0x23')]){if(_0x3c261b[_0x9f53('0x23')]['code']===0x1f4){logger[_0x9f53('0x23')](_0x9f53('0x1e'),_0x27a11c,_0x3c261b['error'][_0x9f53('0x24')]);return _0x1bd7e5(_0x3c261b[_0x9f53('0x23')][_0x9f53('0x24')]);}logger[_0x9f53('0x23')](_0x9f53('0x1e'),_0x27a11c,_0x3c261b[_0x9f53('0x23')][_0x9f53('0x24')]);return _0xbdad87(_0x3c261b[_0x9f53('0x23')][_0x9f53('0x24')]);}else{logger[_0x9f53('0x1d')](_0x9f53('0x1e'),_0x27a11c,_0x9f53('0x1f'));_0xbdad87(_0x3c261b[_0x9f53('0x25')][_0x9f53('0x24')]);}})[_0x9f53('0x26')](function(_0x27778c){logger[_0x9f53('0x23')](_0x9f53('0x1e'),_0x27a11c,_0x27778c);_0x1bd7e5(_0x27778c);});});}function respondWithStatusCode(_0x5d1c90,_0x3924e7){_0x3924e7=_0x3924e7||0xcc;return function(_0xd59df0){if(_0xd59df0){return _0x5d1c90[_0x9f53('0x27')](_0x3924e7);}return _0x5d1c90[_0x9f53('0x28')](_0x3924e7)[_0x9f53('0x29')]();};}function respondWithResult(_0x2118a3,_0xb38f85){_0xb38f85=_0xb38f85||0xc8;return function(_0x4ec1f5){if(_0x4ec1f5){return _0x2118a3[_0x9f53('0x28')](_0xb38f85)['json'](_0x4ec1f5);}};}function respondWithFilteredResult(_0x31e18b,_0x2e9ba1){return function(_0x196046){if(_0x196046){var _0x5d7327=_0x196046['count'],_0x30fa1c=_0x2e9ba1[_0x9f53('0x2a')],_0x56db58=_0x2e9ba1[_0x9f53('0x2a')]+_0x2e9ba1[_0x9f53('0x2b')],_0x566388;if(_0x56db58>=_0x5d7327){_0x56db58=_0x5d7327;_0x566388=0xc8;}else{_0x566388=0xce;}_0x31e18b['status'](_0x566388);return _0x31e18b[_0x9f53('0x2c')]('Content-Range',_0x30fa1c+'-'+_0x56db58+'/'+_0x5d7327)[_0x9f53('0x2d')](_0x196046);}return null;};}function patchUpdates(_0xb1a953){return function(_0xa31b09){try{jsonpatch[_0x9f53('0x2e')](_0xa31b09,_0xb1a953,!![]);}catch(_0x4dfe78){return BPromise['reject'](_0x4dfe78);}return _0xa31b09['save']();};}function saveUpdates(_0x59a98e,_0x4930fb){return function(_0x23e480){if(_0x23e480){return _0x23e480['update'](_0x59a98e)[_0x9f53('0x2f')](function(_0x59abbe){return _0x59abbe;});}return null;};}function removeEntity(_0x2e5c58,_0x8298c4){return function(_0x3458be){if(_0x3458be){return _0x3458be[_0x9f53('0x30')]()[_0x9f53('0x2f')](function(){_0x2e5c58[_0x9f53('0x28')](0xcc)['end']();});}};}function handleEntityNotFound(_0x9891bb,_0x4b0057){return function(_0x475a9e){if(!_0x475a9e){_0x9891bb['sendStatus'](0x194);}return _0x475a9e;};}function handleError(_0x397d30,_0x4340ea){_0x4340ea=_0x4340ea||0x1f4;return function(_0x3765fb){logger[_0x9f53('0x23')](_0x3765fb[_0x9f53('0x31')]);if(_0x3765fb[_0x9f53('0x32')]){delete _0x3765fb[_0x9f53('0x32')];}_0x397d30[_0x9f53('0x28')](_0x4340ea)['send'](_0x3765fb);};}exports[_0x9f53('0x33')]=function(_0x11cc3f,_0x320487){var _0x3e4b77={},_0x3bdcc6={},_0x32ea76={'count':0x0,'rows':[]};var _0x4e7a4b=_[_0x9f53('0x34')](db[_0x9f53('0x35')]['rawAttributes'],function(_0x228561){return{'name':_0x228561['fieldName'],'type':_0x228561['type']['key']};});_0x3bdcc6['model']=_[_0x9f53('0x34')](_0x4e7a4b,_0x9f53('0x32'));_0x3bdcc6['query']=_['keys'](_0x11cc3f['query']);_0x3bdcc6[_0x9f53('0x36')]=_['intersection'](_0x3bdcc6['model'],_0x3bdcc6['query']);_0x3e4b77[_0x9f53('0x37')]=_[_0x9f53('0x38')](_0x3bdcc6[_0x9f53('0x39')],qs[_0x9f53('0x3a')](_0x11cc3f['query']['fields']));_0x3e4b77[_0x9f53('0x37')]=_0x3e4b77['attributes'][_0x9f53('0x3b')]?_0x3e4b77[_0x9f53('0x37')]:_0x3bdcc6[_0x9f53('0x39')];if(!_0x11cc3f[_0x9f53('0x3c')][_0x9f53('0x3d')](_0x9f53('0x3e'))){_0x3e4b77[_0x9f53('0x2b')]=qs['limit'](_0x11cc3f['query'][_0x9f53('0x2b')]);_0x3e4b77[_0x9f53('0x2a')]=qs[_0x9f53('0x2a')](_0x11cc3f[_0x9f53('0x3c')][_0x9f53('0x2a')]);}_0x3e4b77[_0x9f53('0x3f')]=qs[_0x9f53('0x40')](_0x11cc3f[_0x9f53('0x3c')][_0x9f53('0x40')]);_0x3e4b77[_0x9f53('0x41')]=qs[_0x9f53('0x36')](_[_0x9f53('0x42')](_0x11cc3f[_0x9f53('0x3c')],_0x3bdcc6['filters']));if(_0x11cc3f[_0x9f53('0x3c')][_0x9f53('0x43')]){_0x3e4b77[_0x9f53('0x41')]=_['merge'](_0x3e4b77[_0x9f53('0x41')],{'$or':_[_0x9f53('0x34')](_0x4e7a4b,function(_0x4a10e2){if(_0x4a10e2[_0x9f53('0x44')]!=='VIRTUAL'){var _0x423382={};_0x423382[_0x4a10e2[_0x9f53('0x32')]]={'$like':'%'+_0x11cc3f[_0x9f53('0x3c')]['filter']+'%'};return _0x423382;}})});}_0x3e4b77=_[_0x9f53('0x45')]({},_0x3e4b77,_0x11cc3f['options']);var _0x3c1413={'where':_0x3e4b77['where']};return db[_0x9f53('0x35')]['count'](_0x3c1413)['then'](function(_0x5633b6){_0x32ea76[_0x9f53('0x46')]=_0x5633b6;if(_0x11cc3f[_0x9f53('0x3c')][_0x9f53('0x47')]){_0x3e4b77[_0x9f53('0x48')]=[{'all':!![]}];}return db[_0x9f53('0x35')][_0x9f53('0x49')](_0x3e4b77);})['then'](function(_0x10d582){_0x32ea76[_0x9f53('0x4a')]=_0x10d582;return _0x32ea76;})[_0x9f53('0x2f')](respondWithFilteredResult(_0x320487,_0x3e4b77))['catch'](handleError(_0x320487,null));};exports[_0x9f53('0x4b')]=function(_0x20035d,_0x4641ca){var _0x186335={'raw':![],'where':{'id':_0x20035d[_0x9f53('0x4c')]['id']}},_0xf145ce={};_0xf145ce[_0x9f53('0x39')]=_[_0x9f53('0x4d')](db[_0x9f53('0x35')]['rawAttributes']);_0xf145ce[_0x9f53('0x3c')]=_[_0x9f53('0x4d')](_0x20035d[_0x9f53('0x3c')]);_0xf145ce[_0x9f53('0x36')]=_['intersection'](_0xf145ce[_0x9f53('0x39')],_0xf145ce[_0x9f53('0x3c')]);_0x186335[_0x9f53('0x37')]=_[_0x9f53('0x38')](_0xf145ce[_0x9f53('0x39')],qs[_0x9f53('0x3a')](_0x20035d[_0x9f53('0x3c')][_0x9f53('0x3a')]));_0x186335['attributes']=_0x186335['attributes'][_0x9f53('0x3b')]?_0x186335[_0x9f53('0x37')]:_0xf145ce['model'];if(_0x20035d[_0x9f53('0x3c')][_0x9f53('0x47')]){_0x186335[_0x9f53('0x48')]=[{'all':!![]}];}_0x186335=_['merge']({},_0x186335,_0x20035d[_0x9f53('0x4e')]);return db[_0x9f53('0x35')][_0x9f53('0x4f')](_0x186335)[_0x9f53('0x2f')](handleEntityNotFound(_0x4641ca,null))[_0x9f53('0x2f')](respondWithResult(_0x4641ca,null))[_0x9f53('0x26')](handleError(_0x4641ca,null));};exports[_0x9f53('0x50')]=function(_0x3352be,_0x42843c){return db[_0x9f53('0x35')][_0x9f53('0x50')](_0x3352be[_0x9f53('0x51')],{})[_0x9f53('0x2f')](respondWithResult(_0x42843c,0xc9))[_0x9f53('0x26')](handleError(_0x42843c,null));};exports['update']=function(_0x1bcd45,_0x4c6f32){if(_0x1bcd45[_0x9f53('0x51')]['id']){delete _0x1bcd45[_0x9f53('0x51')]['id'];}return db[_0x9f53('0x35')][_0x9f53('0x4f')]({'where':{'id':_0x1bcd45['params']['id']}})[_0x9f53('0x2f')](handleEntityNotFound(_0x4c6f32,null))[_0x9f53('0x2f')](saveUpdates(_0x1bcd45[_0x9f53('0x51')],null))[_0x9f53('0x2f')](respondWithResult(_0x4c6f32,null))['catch'](handleError(_0x4c6f32,null));};exports[_0x9f53('0x30')]=function(_0x6d2aa5,_0x23aa9d){return db[_0x9f53('0x35')]['find']({'where':{'id':_0x6d2aa5['params']['id']}})[_0x9f53('0x2f')](handleEntityNotFound(_0x23aa9d,null))[_0x9f53('0x2f')](removeEntity(_0x23aa9d,null))[_0x9f53('0x26')](handleError(_0x23aa9d,null));};exports[_0x9f53('0x52')]=function(_0x537c84,_0x92ef70,_0x3e4271){var _0x2fb24c={};var _0x539435={};var _0xa071a5;var _0x4c1d50;return db['DeskAccount'][_0x9f53('0x53')]({'where':{'id':_0x537c84['params']['id']}})[_0x9f53('0x2f')](handleEntityNotFound(_0x92ef70,null))['then'](function(_0x59add8){if(_0x59add8){_0xa071a5=_0x59add8;_0x539435[_0x9f53('0x39')]=_[_0x9f53('0x4d')](db['DeskConfiguration'][_0x9f53('0x54')]);_0x539435[_0x9f53('0x3c')]=_[_0x9f53('0x4d')](_0x537c84['query']);_0x539435[_0x9f53('0x36')]=_['intersection'](_0x539435[_0x9f53('0x39')],_0x539435[_0x9f53('0x3c')]);_0x2fb24c[_0x9f53('0x37')]=_[_0x9f53('0x38')](_0x539435[_0x9f53('0x39')],qs[_0x9f53('0x3a')](_0x537c84['query']['fields']));_0x2fb24c[_0x9f53('0x37')]=_0x2fb24c['attributes'][_0x9f53('0x3b')]?_0x2fb24c['attributes']:_0x539435[_0x9f53('0x39')];_0x2fb24c[_0x9f53('0x3f')]=qs['sort'](_0x537c84[_0x9f53('0x3c')][_0x9f53('0x40')]);_0x2fb24c[_0x9f53('0x41')]=qs[_0x9f53('0x36')](_[_0x9f53('0x42')](_0x537c84[_0x9f53('0x3c')],_0x539435[_0x9f53('0x36')]));if(_0x537c84['query'][_0x9f53('0x43')]){_0x2fb24c['where']=_[_0x9f53('0x45')](_0x2fb24c[_0x9f53('0x41')],{'$or':_[_0x9f53('0x34')](_0x2fb24c[_0x9f53('0x37')],function(_0x26ac01){var _0x5a51c6={};_0x5a51c6[_0x26ac01]={'$like':'%'+_0x537c84[_0x9f53('0x3c')][_0x9f53('0x43')]+'%'};return _0x5a51c6;})});}_0x2fb24c=_[_0x9f53('0x45')]({},_0x2fb24c,_0x537c84[_0x9f53('0x4e')]);return _0xa071a5[_0x9f53('0x52')](_0x2fb24c);}})[_0x9f53('0x2f')](function(_0x149e65){if(_0x149e65){_0x4c1d50=_0x149e65[_0x9f53('0x3b')];if(!_0x537c84[_0x9f53('0x3c')][_0x9f53('0x3d')](_0x9f53('0x3e'))){_0x2fb24c[_0x9f53('0x2b')]=qs[_0x9f53('0x2b')](_0x537c84[_0x9f53('0x3c')][_0x9f53('0x2b')]);_0x2fb24c[_0x9f53('0x2a')]=qs[_0x9f53('0x2a')](_0x537c84[_0x9f53('0x3c')][_0x9f53('0x2a')]);}return _0xa071a5[_0x9f53('0x52')](_0x2fb24c);}})[_0x9f53('0x2f')](function(_0x3157f3){if(_0x3157f3){return _0x3157f3?{'count':_0x4c1d50,'rows':_0x3157f3}:null;}})['then'](respondWithResult(_0x92ef70,null))[_0x9f53('0x26')](handleError(_0x92ef70,null));};exports[_0x9f53('0x55')]=function(_0x6a1342,_0x5de279,_0x14bebd){if(_0x6a1342['body']['id']){delete _0x6a1342[_0x9f53('0x51')]['id'];}return db[_0x9f53('0x35')][_0x9f53('0x53')]({'where':{'id':_0x6a1342[_0x9f53('0x4c')]['id']}})[_0x9f53('0x2f')](handleEntityNotFound(_0x5de279,null))[_0x9f53('0x2f')](function(_0x1bbdd6){if(_0x1bbdd6){_0x6a1342[_0x9f53('0x51')][_0x9f53('0x56')]=_0x1bbdd6['id'];_0x6a1342['body'][_0x9f53('0x57')]=integrations[_0x9f53('0x58')](_0x6a1342[_0x9f53('0x51')][_0x9f53('0x59')],_0x6a1342[_0x9f53('0x51')][_0x9f53('0x44')]);_0x6a1342[_0x9f53('0x51')][_0x9f53('0x5a')]=integrations[_0x9f53('0x5b')](_0x6a1342[_0x9f53('0x51')][_0x9f53('0x59')],_0x6a1342[_0x9f53('0x51')][_0x9f53('0x44')]);return db[_0x9f53('0x5c')]['create'](_0x6a1342[_0x9f53('0x51')],{'include':[{'model':db[_0x9f53('0x5d')],'as':'Subjects'},{'model':db[_0x9f53('0x5d')],'as':_0x9f53('0x5a')}]});}return null;})[_0x9f53('0x2f')](respondWithResult(_0x5de279,null))['catch'](handleError(_0x5de279,null));};exports[_0x9f53('0x5e')]=function(_0x335270,_0x586c69,_0x4bf55e){var _0x9bd0fd=[{'name':_0x9f53('0x5f'),'label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x2eabcc='';return db[_0x9f53('0x35')]['findOne']({'where':{'id':_0x335270['params']['id']},'attributes':['id',_0x9f53('0x60'),_0x9f53('0x61'),_0x9f53('0x62'),_0x9f53('0x63'),_0x9f53('0x64'),_0x9f53('0x65'),_0x9f53('0x66'),'tokenSecret']})['then'](handleEntityNotFound(_0x586c69,null))['then'](function(_0x285bdd){if(_0x285bdd){_0x2eabcc=_0x285bdd['remoteUri'];var _0x213cb8=_0x2eabcc[_0x9f53('0x67')](-0x1);if(_0x213cb8==='/'){_0x2eabcc=_0x2eabcc[_0x9f53('0x68')](0x0,_0x2eabcc[_0x9f53('0x69')](_0x213cb8));}var _0x4c7bb9={'method':_0x9f53('0x6a'),'uri':util[_0x9f53('0x6b')](_0x9f53('0x6c'),_0x2eabcc),'headers':{'Content-Type':_0x9f53('0x6d'),'Accept':_0x9f53('0x6d')},'json':!![]};if(_0x285bdd[_0x9f53('0x61')]===_0x9f53('0x6e')){_0x4c7bb9[_0x9f53('0x6f')][_0x9f53('0x70')]=util[_0x9f53('0x6b')](_0x9f53('0x71'),new Buffer(util[_0x9f53('0x6b')](_0x9f53('0x72'),_0x285bdd['username'],_0x285bdd[_0x9f53('0x63')]))['toString']('base64'));}return rp(_0x4c7bb9)[_0x9f53('0x2f')](function(_0x483562){return _0x9bd0fd['concat'](_['map'](_0x483562[_0x9f53('0x73')]['entries'],function(_0xebcb7f){return{'id':_0xebcb7f['name'],'name':_0xebcb7f[_0x9f53('0x32')],'type':_0xebcb7f[_0x9f53('0x44')],'active':_0xebcb7f[_0x9f53('0x74')],'label':_0xebcb7f['label'],'custom':!![]};}));});}})[_0x9f53('0x2f')](function(_0x3c35be){return{'count':_0x3c35be['length'],'rows':_0x3c35be};})[_0x9f53('0x2f')](respondWithResult(_0x586c69,null))[_0x9f53('0x26')](function(_0x4fe81b){var _0x58d7ac=_0x335270[_0x9f53('0x3c')][_0x9f53('0x75')]?0x1f4:_0x4fe81b[_0x9f53('0x76')]||0x1f4;logger[_0x9f53('0x23')](_0x9f53('0x77'),_0x9f53('0x5e'),_0x58d7ac,JSON[_0x9f53('0x22')](_0x4fe81b));delete _0x4fe81b[_0x9f53('0x32')];if(_0x58d7ac===0x191){_0x58d7ac=0x190;}_0x586c69[_0x9f53('0x28')](_0x58d7ac)[_0x9f53('0x78')](_0x335270[_0x9f53('0x3c')][_0x9f53('0x75')]?{'message':_0x9f53('0x79'),'statusCode':_0x4fe81b[_0x9f53('0x76')]}:_0x4fe81b);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index b464eb6..b03905d 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 _0x81ea=['util','../../config/logger','moment','request-promise','path','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','DeskAccount','int_desk_accounts'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x81ea,0x10e));var _0xa81e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x81ea[_0x14add3];return _0x4a174f;};'use strict';var _=require('lodash');var util=require(_0xa81e('0x0'));var logger=require(_0xa81e('0x1'))('api');var moment=require(_0xa81e('0x2'));var BPromise=require('bluebird');var rp=require(_0xa81e('0x3'));var fs=require('fs');var path=require(_0xa81e('0x4'));var rimraf=require('rimraf');var config=require(_0xa81e('0x5'));var attributes=require(_0xa81e('0x6'));var integrations=require(_0xa81e('0x7'));module['exports']=function(_0x1f583b,_0xdcaec){return _0x1f583b['define'](_0xa81e('0x8'),attributes,{'tableName':_0xa81e('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xeb6d=['api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_desk_accounts','lodash','util','../../config/logger'];(function(_0x440c00,_0x18bef0){var _0x18ea7e=function(_0x4f9fe4){while(--_0x4f9fe4){_0x440c00['push'](_0x440c00['shift']());}};_0x18ea7e(++_0x18bef0);}(_0xeb6d,0x111));var _0xdeb6=function(_0x368fb9,_0x1a9895){_0x368fb9=_0x368fb9-0x0;var _0x4892fb=_0xeb6d[_0x368fb9];return _0x4892fb;};'use strict';var _=require(_0xdeb6('0x0'));var util=require(_0xdeb6('0x1'));var logger=require(_0xdeb6('0x2'))(_0xdeb6('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdeb6('0x4'));var fs=require('fs');var path=require(_0xdeb6('0x5'));var rimraf=require(_0xdeb6('0x6'));var config=require(_0xdeb6('0x7'));var attributes=require('./intDeskAccount.attributes');var integrations=require(_0xdeb6('0x8'));module[_0xdeb6('0x9')]=function(_0x1222a6,_0x4cd306){return _0x1222a6[_0xdeb6('0xa')]('DeskAccount',attributes,{'tableName':_0xdeb6('0xb'),'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 457069a..ce8254e 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 _0x0182=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','GetDeskAccount','DeskAccount','options','raw','where','limit','include','model','attributes','map','catch','ShowDeskAccount','find','util','moment','randomstring'];(function(_0x34ee17,_0x4c93bd){var _0x3222f4=function(_0x3655fc){while(--_0x3655fc){_0x34ee17['push'](_0x34ee17['shift']());}};_0x3222f4(++_0x4c93bd);}(_0x0182,0x1d1));var _0x2018=function(_0x129102,_0x3ac9c9){_0x129102=_0x129102-0x0;var _0x346551=_0x0182[_0x129102];return _0x346551;};'use strict';var _=require('lodash');var util=require(_0x2018('0x0'));var moment=require(_0x2018('0x1'));var BPromise=require('bluebird');var rs=require(_0x2018('0x2'));var fs=require('fs');var Redis=require(_0x2018('0x3'));var db=require(_0x2018('0x4'))['db'];var utils=require(_0x2018('0x5'));var logger=require(_0x2018('0x6'))(_0x2018('0x7'));var config=require(_0x2018('0x8'));var jayson=require(_0x2018('0x9'));var client=jayson[_0x2018('0xa')][_0x2018('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xf0146a,_0x4b2e78,_0x5ef55b){return new BPromise(function(_0x1a0e01,_0x10cb0e){return client[_0x2018('0xc')](_0xf0146a,_0x5ef55b)[_0x2018('0xd')](function(_0x265c3b){logger[_0x2018('0xe')](_0x2018('0xf'),_0x4b2e78,_0x2018('0x10'));logger[_0x2018('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x4b2e78,_0x2018('0x10'),JSON[_0x2018('0x12')](_0x265c3b));if(_0x265c3b[_0x2018('0x13')]){if(_0x265c3b[_0x2018('0x13')][_0x2018('0x14')]===0x1f4){logger[_0x2018('0x13')]('DeskAccount,\x20%s,\x20%s',_0x4b2e78,_0x265c3b['error'][_0x2018('0x15')]);return _0x10cb0e(_0x265c3b[_0x2018('0x13')]['message']);}logger[_0x2018('0x13')](_0x2018('0xf'),_0x4b2e78,_0x265c3b[_0x2018('0x13')]['message']);return _0x1a0e01(_0x265c3b['error']['message']);}else{logger[_0x2018('0xe')](_0x2018('0xf'),_0x4b2e78,_0x2018('0x10'));_0x1a0e01(_0x265c3b[_0x2018('0x16')][_0x2018('0x15')]);}})['catch'](function(_0x4c0a74){logger[_0x2018('0x13')](_0x2018('0xf'),_0x4b2e78,_0x4c0a74);_0x10cb0e(_0x4c0a74);});});}exports[_0x2018('0x17')]=function(_0x48a193){var _0x171e70=this;return new Promise(function(_0x122ae6,_0x499d08){return db[_0x2018('0x18')]['findAll']({'raw':_0x48a193[_0x2018('0x19')]?_0x48a193[_0x2018('0x19')][_0x2018('0x1a')]===undefined?!![]:![]:!![],'where':_0x48a193[_0x2018('0x19')]?_0x48a193['options'][_0x2018('0x1b')]||null:null,'attributes':_0x48a193[_0x2018('0x19')]?_0x48a193[_0x2018('0x19')]['attributes']||null:null,'limit':_0x48a193['options']?_0x48a193['options'][_0x2018('0x1c')]||null:null,'include':_0x48a193[_0x2018('0x19')]?_0x48a193[_0x2018('0x19')][_0x2018('0x1d')]?_['map'](_0x48a193[_0x2018('0x19')][_0x2018('0x1d')],function(_0xb95332){return{'model':db[_0xb95332[_0x2018('0x1e')]],'as':_0xb95332['as'],'attributes':_0xb95332[_0x2018('0x1f')],'include':_0xb95332[_0x2018('0x1d')]?_[_0x2018('0x20')](_0xb95332[_0x2018('0x1d')],function(_0x69ea11){return{'model':db[_0x69ea11[_0x2018('0x1e')]],'as':_0x69ea11['as'],'attributes':_0x69ea11[_0x2018('0x1f')],'include':_0x69ea11[_0x2018('0x1d')]?_[_0x2018('0x20')](_0x69ea11[_0x2018('0x1d')],function(_0xff3978){return{'model':db[_0xff3978[_0x2018('0x1e')]],'as':_0xff3978['as'],'attributes':_0xff3978[_0x2018('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x2018('0xd')](function(_0x36059e){logger[_0x2018('0xe')](_0x2018('0x17'),_0x48a193);logger[_0x2018('0x11')](_0x2018('0x17'),_0x48a193,JSON[_0x2018('0x12')](_0x36059e));_0x122ae6(_0x36059e);})[_0x2018('0x21')](function(_0x1ef3d1){logger['error'](_0x2018('0x17'),_0x1ef3d1['message'],_0x48a193);_0x499d08(_0x171e70[_0x2018('0x13')](0x1f4,_0x1ef3d1[_0x2018('0x15')]));});});};exports[_0x2018('0x22')]=function(_0x3bf706){var _0x394a24=this;return new Promise(function(_0x528cc3,_0x44469f){return db[_0x2018('0x18')][_0x2018('0x23')]({'raw':_0x3bf706['options']?_0x3bf706[_0x2018('0x19')][_0x2018('0x1a')]===undefined?!![]:![]:!![],'where':_0x3bf706[_0x2018('0x19')]?_0x3bf706['options'][_0x2018('0x1b')]||null:null,'attributes':_0x3bf706['options']?_0x3bf706[_0x2018('0x19')][_0x2018('0x1f')]||null:null,'include':_0x3bf706[_0x2018('0x19')]?_0x3bf706[_0x2018('0x19')][_0x2018('0x1d')]?_['map'](_0x3bf706[_0x2018('0x19')][_0x2018('0x1d')],function(_0x214d3f){return{'model':db[_0x214d3f['model']],'as':_0x214d3f['as'],'attributes':_0x214d3f[_0x2018('0x1f')],'include':_0x214d3f[_0x2018('0x1d')]?_[_0x2018('0x20')](_0x214d3f[_0x2018('0x1d')],function(_0x1430fb){return{'model':db[_0x1430fb[_0x2018('0x1e')]],'as':_0x1430fb['as'],'attributes':_0x1430fb[_0x2018('0x1f')],'include':_0x1430fb[_0x2018('0x1d')]?_[_0x2018('0x20')](_0x1430fb['include'],function(_0x5e1519){return{'model':db[_0x5e1519[_0x2018('0x1e')]],'as':_0x5e1519['as'],'attributes':_0x5e1519[_0x2018('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1bdea3){logger[_0x2018('0xe')](_0x2018('0x22'),_0x3bf706);logger[_0x2018('0x11')]('ShowDeskAccount',_0x3bf706,JSON['stringify'](_0x1bdea3));_0x528cc3(_0x1bdea3);})['catch'](function(_0x731703){logger[_0x2018('0x13')](_0x2018('0x22'),_0x731703[_0x2018('0x15')],_0x3bf706);_0x44469f(_0x394a24['error'](0x1f4,_0x731703[_0x2018('0x15')]));});});}; \ No newline at end of file +var _0x2181=['raw','where','attributes','include','map','model','catch','ShowDeskAccount','find','lodash','moment','bluebird','randomstring','../../mysqldb','rpc','jayson/promise','request','then','debug','DeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','DeskAccount,\x20%s,\x20%s','info','result','GetDeskAccount','DeskAccount','findAll','options'];(function(_0x33dd74,_0x494e2e){var _0x5294a8=function(_0x4c08ed){while(--_0x4c08ed){_0x33dd74['push'](_0x33dd74['shift']());}};_0x5294a8(++_0x494e2e);}(_0x2181,0x19c));var _0x1218=function(_0x478300,_0x1c4eed){_0x478300=_0x478300-0x0;var _0x26a176=_0x2181[_0x478300];return _0x26a176;};'use strict';var _=require(_0x1218('0x0'));var util=require('util');var moment=require(_0x1218('0x1'));var BPromise=require(_0x1218('0x2'));var rs=require(_0x1218('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1218('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x1218('0x5'));var config=require('../../config/environment');var jayson=require(_0x1218('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x316ff5,_0x4a6806,_0x29301f){return new BPromise(function(_0x73ee48,_0x290da6){return client[_0x1218('0x7')](_0x316ff5,_0x29301f)[_0x1218('0x8')](function(_0x410b00){logger['info']('DeskAccount,\x20%s,\x20%s',_0x4a6806,'request\x20sent');logger[_0x1218('0x9')](_0x1218('0xa'),_0x4a6806,_0x1218('0xb'),JSON[_0x1218('0xc')](_0x410b00));if(_0x410b00[_0x1218('0xd')]){if(_0x410b00['error']['code']===0x1f4){logger[_0x1218('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4a6806,_0x410b00[_0x1218('0xd')][_0x1218('0xe')]);return _0x290da6(_0x410b00['error']['message']);}logger[_0x1218('0xd')](_0x1218('0xf'),_0x4a6806,_0x410b00['error']['message']);return _0x73ee48(_0x410b00[_0x1218('0xd')][_0x1218('0xe')]);}else{logger[_0x1218('0x10')]('DeskAccount,\x20%s,\x20%s',_0x4a6806,_0x1218('0xb'));_0x73ee48(_0x410b00[_0x1218('0x11')][_0x1218('0xe')]);}})['catch'](function(_0x177b56){logger[_0x1218('0xd')]('DeskAccount,\x20%s,\x20%s',_0x4a6806,_0x177b56);_0x290da6(_0x177b56);});});}exports[_0x1218('0x12')]=function(_0x455aab){var _0x1903c7=this;return new Promise(function(_0x5a0a0c,_0x360158){return db[_0x1218('0x13')][_0x1218('0x14')]({'raw':_0x455aab[_0x1218('0x15')]?_0x455aab[_0x1218('0x15')][_0x1218('0x16')]===undefined?!![]:![]:!![],'where':_0x455aab['options']?_0x455aab[_0x1218('0x15')][_0x1218('0x17')]||null:null,'attributes':_0x455aab[_0x1218('0x15')]?_0x455aab[_0x1218('0x15')][_0x1218('0x18')]||null:null,'limit':_0x455aab[_0x1218('0x15')]?_0x455aab['options']['limit']||null:null,'include':_0x455aab[_0x1218('0x15')]?_0x455aab[_0x1218('0x15')][_0x1218('0x19')]?_[_0x1218('0x1a')](_0x455aab[_0x1218('0x15')]['include'],function(_0x1d1ee4){return{'model':db[_0x1d1ee4[_0x1218('0x1b')]],'as':_0x1d1ee4['as'],'attributes':_0x1d1ee4[_0x1218('0x18')],'include':_0x1d1ee4[_0x1218('0x19')]?_[_0x1218('0x1a')](_0x1d1ee4[_0x1218('0x19')],function(_0x224f67){return{'model':db[_0x224f67['model']],'as':_0x224f67['as'],'attributes':_0x224f67[_0x1218('0x18')],'include':_0x224f67[_0x1218('0x19')]?_['map'](_0x224f67[_0x1218('0x19')],function(_0x40de64){return{'model':db[_0x40de64['model']],'as':_0x40de64['as'],'attributes':_0x40de64[_0x1218('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1218('0x8')](function(_0x34c1df){logger['info'](_0x1218('0x12'),_0x455aab);logger[_0x1218('0x9')]('GetDeskAccount',_0x455aab,JSON['stringify'](_0x34c1df));_0x5a0a0c(_0x34c1df);})[_0x1218('0x1c')](function(_0x1e6ac6){logger[_0x1218('0xd')]('GetDeskAccount',_0x1e6ac6[_0x1218('0xe')],_0x455aab);_0x360158(_0x1903c7[_0x1218('0xd')](0x1f4,_0x1e6ac6[_0x1218('0xe')]));});});};exports[_0x1218('0x1d')]=function(_0x56ddee){var _0x3e4b2a=this;return new Promise(function(_0x1c4a65,_0x4b2f9){return db[_0x1218('0x13')][_0x1218('0x1e')]({'raw':_0x56ddee['options']?_0x56ddee[_0x1218('0x15')][_0x1218('0x16')]===undefined?!![]:![]:!![],'where':_0x56ddee[_0x1218('0x15')]?_0x56ddee[_0x1218('0x15')]['where']||null:null,'attributes':_0x56ddee[_0x1218('0x15')]?_0x56ddee['options'][_0x1218('0x18')]||null:null,'include':_0x56ddee['options']?_0x56ddee[_0x1218('0x15')]['include']?_[_0x1218('0x1a')](_0x56ddee[_0x1218('0x15')][_0x1218('0x19')],function(_0x38c8c6){return{'model':db[_0x38c8c6[_0x1218('0x1b')]],'as':_0x38c8c6['as'],'attributes':_0x38c8c6[_0x1218('0x18')],'include':_0x38c8c6['include']?_[_0x1218('0x1a')](_0x38c8c6[_0x1218('0x19')],function(_0x145e2b){return{'model':db[_0x145e2b[_0x1218('0x1b')]],'as':_0x145e2b['as'],'attributes':_0x145e2b[_0x1218('0x18')],'include':_0x145e2b[_0x1218('0x19')]?_['map'](_0x145e2b['include'],function(_0x3c1ec8){return{'model':db[_0x3c1ec8['model']],'as':_0x3c1ec8['as'],'attributes':_0x3c1ec8[_0x1218('0x18')]};}):[]};}):[]};}):[]:[]})[_0x1218('0x8')](function(_0x1fdc80){logger['info'](_0x1218('0x1d'),_0x56ddee);logger['debug'](_0x1218('0x1d'),_0x56ddee,JSON[_0x1218('0xc')](_0x1fdc80));_0x1c4a65(_0x1fdc80);})[_0x1218('0x1c')](function(_0x5de078){logger[_0x1218('0xd')](_0x1218('0x1d'),_0x5de078[_0x1218('0xe')],_0x56ddee);_0x4b2f9(_0x3e4b2a[_0x1218('0xd')](0x1f4,_0x5de078['message']));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index e1c3187..2af3d16 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 _0x781d=['setTags','/:id','delete','destroy','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDeskConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','/:id/tags','getTags','post','create'];(function(_0x5b287d,_0x5c1379){var _0x352e2c=function(_0x3a1d29){while(--_0x3a1d29){_0x5b287d['push'](_0x5b287d['shift']());}};_0x352e2c(++_0x5c1379);}(_0x781d,0x14a));var _0xd781=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x781d[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xd781('0x0'));var util=require(_0xd781('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xd781('0x2'));var router=express[_0xd781('0x3')]();var auth=require(_0xd781('0x4'));var interaction=require(_0xd781('0x5'));var config=require(_0xd781('0x6'));var controller=require(_0xd781('0x7'));router[_0xd781('0x8')]('/',auth[_0xd781('0x9')](),controller[_0xd781('0xa')]);router[_0xd781('0x8')]('/:id',auth[_0xd781('0x9')](),controller[_0xd781('0xb')]);router[_0xd781('0x8')](_0xd781('0xc'),auth['isAuthenticated'](),controller[_0xd781('0xd')]);router['get'](_0xd781('0xe'),auth[_0xd781('0x9')](),controller['getSubjects']);router[_0xd781('0x8')](_0xd781('0xf'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd781('0x8')](_0xd781('0x10'),auth[_0xd781('0x9')](),controller[_0xd781('0x11')]);router[_0xd781('0x12')]('/',auth[_0xd781('0x9')](),controller[_0xd781('0x13')]);router[_0xd781('0x12')](_0xd781('0x10'),auth[_0xd781('0x9')](),controller[_0xd781('0x14')]);router['put'](_0xd781('0x15'),auth[_0xd781('0x9')](),controller['update']);router[_0xd781('0x16')]('/:id',auth[_0xd781('0x9')](),controller[_0xd781('0x17')]);module[_0xd781('0x18')]=router; \ No newline at end of file +var _0x2cc4=['show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','put','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','get','isAuthenticated','index','/:id'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x2cc4,0x1f0));var _0x42cc=function(_0x274dd7,_0x2e6051){_0x274dd7=_0x274dd7-0x0;var _0x148829=_0x2cc4[_0x274dd7];return _0x148829;};'use strict';var multer=require(_0x42cc('0x0'));var util=require(_0x42cc('0x1'));var path=require(_0x42cc('0x2'));var timeout=require(_0x42cc('0x3'));var express=require('express');var router=express[_0x42cc('0x4')]();var auth=require(_0x42cc('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDeskConfiguration.controller');router[_0x42cc('0x6')]('/',auth[_0x42cc('0x7')](),controller[_0x42cc('0x8')]);router[_0x42cc('0x6')](_0x42cc('0x9'),auth['isAuthenticated'](),controller[_0x42cc('0xa')]);router[_0x42cc('0x6')](_0x42cc('0xb'),auth['isAuthenticated'](),controller['getFields']);router[_0x42cc('0x6')](_0x42cc('0xc'),auth[_0x42cc('0x7')](),controller[_0x42cc('0xd')]);router[_0x42cc('0x6')](_0x42cc('0xe'),auth[_0x42cc('0x7')](),controller[_0x42cc('0xf')]);router[_0x42cc('0x6')](_0x42cc('0x10'),auth[_0x42cc('0x7')](),controller[_0x42cc('0x11')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x42cc('0x12')](_0x42cc('0x10'),auth[_0x42cc('0x7')](),controller['setTags']);router[_0x42cc('0x13')]('/:id',auth[_0x42cc('0x7')](),controller['update']);router[_0x42cc('0x14')](_0x42cc('0x9'),auth[_0x42cc('0x7')](),controller[_0x42cc('0x15')]);module[_0x42cc('0x16')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index f17b469..73cd8b5 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 _0xcb74=['exports','STRING','sequelize'];(function(_0x380c14,_0x1b3823){var _0x5a6d86=function(_0x43cc31){while(--_0x43cc31){_0x380c14['push'](_0x380c14['shift']());}};_0x5a6d86(++_0x1b3823);}(_0xcb74,0x1dc));var _0x4cb7=function(_0x47cbeb,_0x3a4af6){_0x47cbeb=_0x47cbeb-0x0;var _0x158677=_0xcb74[_0x47cbeb];return _0x158677;};'use strict';var Sequelize=require(_0x4cb7('0x0'));module[_0x4cb7('0x1')]={'name':{'type':Sequelize[_0x4cb7('0x2')]},'description':{'type':Sequelize[_0x4cb7('0x2')]}}; \ No newline at end of file +var _0x7607=['STRING','sequelize'];(function(_0x15e29f,_0x424fd8){var _0x23945f=function(_0x42bdea){while(--_0x42bdea){_0x15e29f['push'](_0x15e29f['shift']());}};_0x23945f(++_0x424fd8);}(_0x7607,0xd9));var _0x7760=function(_0x28404d,_0x1eac0c){_0x28404d=_0x28404d-0x0;var _0x4a3abe=_0x7607[_0x28404d];return _0x4a3abe;};'use strict';var Sequelize=require(_0x7760('0x0'));module['exports']={'name':{'type':Sequelize[_0x7760('0x1')]},'description':{'type':Sequelize[_0x7760('0x1')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index 931b43f..e17584b 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 _0xc02d=['request-promise','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','jayson/promise','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','reject','save','destroy','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','count','include','findAll','rows','show','params','includeAll','options','find','create','body','update','getFields','DeskField','order','findOne','getSubjects','getDescriptions','hasOwnProperty','getTags','Tag','setTags','html-pdf','eml-format','rimraf','fast-json-patch'];(function(_0x1a76f6,_0x19fe5d){var _0xfb53af=function(_0x3e8654){while(--_0x3e8654){_0x1a76f6['push'](_0x1a76f6['shift']());}};_0xfb53af(++_0x19fe5d);}(_0xc02d,0x11c));var _0xdc02=function(_0x57f8aa,_0x5687ad){_0x57f8aa=_0x57f8aa-0x0;var _0x448684=_0xc02d[_0x57f8aa];return _0x448684;};'use strict';var pdf=require(_0xdc02('0x0'));var emlformat=require(_0xdc02('0x1'));var rimraf=require(_0xdc02('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xdc02('0x3'));var rp=require(_0xdc02('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xdc02('0x5'));var util=require(_0xdc02('0x6'));var path=require(_0xdc02('0x7'));var sox=require(_0xdc02('0x8'));var csv=require('to-csv');var ejs=require(_0xdc02('0x9'));var fs=require('fs');var _=require(_0xdc02('0xa'));var squel=require(_0xdc02('0xb'));var crypto=require(_0xdc02('0xc'));var jsforce=require(_0xdc02('0xd'));var deskjs=require(_0xdc02('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdc02('0xf'));var Papa=require(_0xdc02('0x10'));var Redis=require(_0xdc02('0x11'));var authService=require(_0xdc02('0x12'));var qs=require(_0xdc02('0x13'));var as=require(_0xdc02('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xdc02('0x15'));var config=require('../../config/environment');var db=require(_0xdc02('0x16'))['db'];var jayson=require(_0xdc02('0x17'));var client=jayson[_0xdc02('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x43909,_0x104390,_0x53b568){if(_0x53b568){var _0x5cf321=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cf321[_0xdc02('0x19')](_0x104390)){return _0x43909;}else{throw new db['Sequelize'][(_0xdc02('0x1a'))](_0xdc02('0x1b'));}}else{return _0x43909;}}function respondWithRpcPromise(_0x2e98bd,_0x35f247,_0x3db78d,_0x53eef7){return new BPromise(function(_0x5d2d0f,_0x3a6cff){var _0x322835=_0x53eef7||client;return _0x322835[_0xdc02('0x1c')](_0x2e98bd,_0x3db78d)[_0xdc02('0x1d')](function(_0x2d04cb){logger[_0xdc02('0x1e')](_0xdc02('0x1f'),_0x35f247,_0xdc02('0x20'));logger[_0xdc02('0x21')](_0xdc02('0x22'),_0x35f247,_0xdc02('0x20'),JSON[_0xdc02('0x23')](_0x2d04cb));if(_0x2d04cb['error']){if(_0x2d04cb[_0xdc02('0x24')]['code']===0x1f4){logger[_0xdc02('0x24')](_0xdc02('0x1f'),_0x35f247,_0x2d04cb[_0xdc02('0x24')][_0xdc02('0x25')]);return _0x3a6cff(_0x2d04cb['error'][_0xdc02('0x25')]);}logger['error'](_0xdc02('0x1f'),_0x35f247,_0x2d04cb[_0xdc02('0x24')][_0xdc02('0x25')]);return _0x5d2d0f(_0x2d04cb['error']['message']);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x35f247,'request\x20sent');_0x5d2d0f(_0x2d04cb[_0xdc02('0x26')][_0xdc02('0x25')]);}})[_0xdc02('0x27')](function(_0x59ab84){logger['error'](_0xdc02('0x1f'),_0x35f247,_0x59ab84);_0x3a6cff(_0x59ab84);});});}function respondWithStatusCode(_0x2dff4b,_0x13e299){_0x13e299=_0x13e299||0xcc;return function(_0x2d3ab3){if(_0x2d3ab3){return _0x2dff4b[_0xdc02('0x28')](_0x13e299);}return _0x2dff4b[_0xdc02('0x29')](_0x13e299)[_0xdc02('0x2a')]();};}function respondWithResult(_0x5b2b3a,_0xa4363f){_0xa4363f=_0xa4363f||0xc8;return function(_0x1a970e){if(_0x1a970e){return _0x5b2b3a[_0xdc02('0x29')](_0xa4363f)[_0xdc02('0x2b')](_0x1a970e);}};}function respondWithFilteredResult(_0x1eb98c,_0x3b5489){return function(_0x18da99){if(_0x18da99){var _0x3093d7=_0x18da99['count'],_0x34aaa2=_0x3b5489['offset'],_0x3dd3d4=_0x3b5489[_0xdc02('0x2c')]+_0x3b5489['limit'],_0x151ef4;if(_0x3dd3d4>=_0x3093d7){_0x3dd3d4=_0x3093d7;_0x151ef4=0xc8;}else{_0x151ef4=0xce;}_0x1eb98c[_0xdc02('0x29')](_0x151ef4);return _0x1eb98c[_0xdc02('0x2d')](_0xdc02('0x2e'),_0x34aaa2+'-'+_0x3dd3d4+'/'+_0x3093d7)[_0xdc02('0x2b')](_0x18da99);}return null;};}function patchUpdates(_0x5b4a62){return function(_0x4efc28){try{jsonpatch['apply'](_0x4efc28,_0x5b4a62,!![]);}catch(_0x5d688a){return BPromise[_0xdc02('0x2f')](_0x5d688a);}return _0x4efc28[_0xdc02('0x30')]();};}function saveUpdates(_0x45291e,_0x19ff8d){return function(_0x56df1c){if(_0x56df1c){return _0x56df1c['update'](_0x45291e)[_0xdc02('0x1d')](function(_0x49fe90){return _0x49fe90;});}return null;};}function removeEntity(_0x34438e,_0x52deb){return function(_0x537e0c){if(_0x537e0c){return _0x537e0c[_0xdc02('0x31')]()[_0xdc02('0x1d')](function(){_0x34438e['status'](0xcc)[_0xdc02('0x2a')]();});}};}function handleEntityNotFound(_0x508781,_0x5b0af3){return function(_0x5adc89){if(!_0x5adc89){_0x508781[_0xdc02('0x28')](0x194);}return _0x5adc89;};}function handleError(_0xdead47,_0x5f1279){_0x5f1279=_0x5f1279||0x1f4;return function(_0x398ce0){logger['error'](_0x398ce0['stack']);if(_0x398ce0['name']){delete _0x398ce0['name'];}_0xdead47[_0xdc02('0x29')](_0x5f1279)[_0xdc02('0x32')](_0x398ce0);};}exports['index']=function(_0x1d5e0a,_0x523ebc){var _0x1c607b={},_0x359b92={},_0x9e29e2={'count':0x0,'rows':[]};var _0x13bc5c=_[_0xdc02('0x33')](db[_0xdc02('0x34')][_0xdc02('0x35')],function(_0x246b04){return{'name':_0x246b04[_0xdc02('0x36')],'type':_0x246b04[_0xdc02('0x37')][_0xdc02('0x38')]};});_0x359b92[_0xdc02('0x39')]=_[_0xdc02('0x33')](_0x13bc5c,_0xdc02('0x3a'));_0x359b92[_0xdc02('0x3b')]=_[_0xdc02('0x3c')](_0x1d5e0a[_0xdc02('0x3b')]);_0x359b92[_0xdc02('0x3d')]=_[_0xdc02('0x3e')](_0x359b92['model'],_0x359b92[_0xdc02('0x3b')]);_0x1c607b[_0xdc02('0x3f')]=_['intersection'](_0x359b92[_0xdc02('0x39')],qs[_0xdc02('0x40')](_0x1d5e0a[_0xdc02('0x3b')][_0xdc02('0x40')]));_0x1c607b[_0xdc02('0x3f')]=_0x1c607b[_0xdc02('0x3f')][_0xdc02('0x41')]?_0x1c607b[_0xdc02('0x3f')]:_0x359b92['model'];if(!_0x1d5e0a['query']['hasOwnProperty'](_0xdc02('0x42'))){_0x1c607b[_0xdc02('0x43')]=qs['limit'](_0x1d5e0a['query'][_0xdc02('0x43')]);_0x1c607b[_0xdc02('0x2c')]=qs[_0xdc02('0x2c')](_0x1d5e0a[_0xdc02('0x3b')][_0xdc02('0x2c')]);}_0x1c607b['order']=qs[_0xdc02('0x44')](_0x1d5e0a[_0xdc02('0x3b')]['sort']);_0x1c607b[_0xdc02('0x45')]=qs[_0xdc02('0x3d')](_[_0xdc02('0x46')](_0x1d5e0a[_0xdc02('0x3b')],_0x359b92[_0xdc02('0x3d')]));if(_0x1d5e0a[_0xdc02('0x3b')][_0xdc02('0x47')]){_0x1c607b['where']=_[_0xdc02('0x48')](_0x1c607b[_0xdc02('0x45')],{'$or':_[_0xdc02('0x33')](_0x13bc5c,function(_0x5cea37){if(_0x5cea37[_0xdc02('0x37')]!==_0xdc02('0x49')){var _0x474190={};_0x474190[_0x5cea37[_0xdc02('0x3a')]]={'$like':'%'+_0x1d5e0a[_0xdc02('0x3b')][_0xdc02('0x47')]+'%'};return _0x474190;}})});}_0x1c607b=_[_0xdc02('0x48')]({},_0x1c607b,_0x1d5e0a['options']);var _0x505724={'where':_0x1c607b[_0xdc02('0x45')]};return db[_0xdc02('0x34')][_0xdc02('0x4a')](_0x505724)[_0xdc02('0x1d')](function(_0x150cc3){_0x9e29e2['count']=_0x150cc3;if(_0x1d5e0a['query']['includeAll']){_0x1c607b[_0xdc02('0x4b')]=[{'all':!![]}];}return db[_0xdc02('0x34')][_0xdc02('0x4c')](_0x1c607b);})[_0xdc02('0x1d')](function(_0x1d0f0f){_0x9e29e2[_0xdc02('0x4d')]=_0x1d0f0f;return _0x9e29e2;})['then'](respondWithFilteredResult(_0x523ebc,_0x1c607b))['catch'](handleError(_0x523ebc,null));};exports[_0xdc02('0x4e')]=function(_0x21e5b9,_0x502576){var _0x54815b={'raw':![],'where':{'id':_0x21e5b9[_0xdc02('0x4f')]['id']}},_0x402c3f={};_0x402c3f[_0xdc02('0x39')]=_[_0xdc02('0x3c')](db[_0xdc02('0x34')][_0xdc02('0x35')]);_0x402c3f[_0xdc02('0x3b')]=_[_0xdc02('0x3c')](_0x21e5b9[_0xdc02('0x3b')]);_0x402c3f[_0xdc02('0x3d')]=_[_0xdc02('0x3e')](_0x402c3f['model'],_0x402c3f[_0xdc02('0x3b')]);_0x54815b[_0xdc02('0x3f')]=_['intersection'](_0x402c3f[_0xdc02('0x39')],qs[_0xdc02('0x40')](_0x21e5b9[_0xdc02('0x3b')][_0xdc02('0x40')]));_0x54815b[_0xdc02('0x3f')]=_0x54815b['attributes']['length']?_0x54815b[_0xdc02('0x3f')]:_0x402c3f['model'];if(_0x21e5b9[_0xdc02('0x3b')][_0xdc02('0x50')]){_0x54815b[_0xdc02('0x4b')]=[{'all':!![]}];}_0x54815b=_['merge']({},_0x54815b,_0x21e5b9[_0xdc02('0x51')]);return db[_0xdc02('0x34')][_0xdc02('0x52')](_0x54815b)[_0xdc02('0x1d')](handleEntityNotFound(_0x502576,null))['then'](respondWithResult(_0x502576,null))['catch'](handleError(_0x502576,null));};exports['create']=function(_0x38f7d9,_0x1fd2d8){return db[_0xdc02('0x34')][_0xdc02('0x53')](_0x38f7d9[_0xdc02('0x54')],{})[_0xdc02('0x1d')](respondWithResult(_0x1fd2d8,0xc9))[_0xdc02('0x27')](handleError(_0x1fd2d8,null));};exports[_0xdc02('0x55')]=function(_0x534794,_0x1e2de5){if(_0x534794[_0xdc02('0x54')]['id']){delete _0x534794['body']['id'];}return db['DeskConfiguration'][_0xdc02('0x52')]({'where':{'id':_0x534794['params']['id']}})[_0xdc02('0x1d')](handleEntityNotFound(_0x1e2de5,null))[_0xdc02('0x1d')](saveUpdates(_0x534794[_0xdc02('0x54')],null))['then'](respondWithResult(_0x1e2de5,null))[_0xdc02('0x27')](handleError(_0x1e2de5,null));};exports[_0xdc02('0x31')]=function(_0xa80059,_0x1971b7){return db[_0xdc02('0x34')][_0xdc02('0x52')]({'where':{'id':_0xa80059[_0xdc02('0x4f')]['id']}})[_0xdc02('0x1d')](handleEntityNotFound(_0x1971b7,null))[_0xdc02('0x1d')](removeEntity(_0x1971b7,null))['catch'](handleError(_0x1971b7,null));};exports[_0xdc02('0x56')]=function(_0x20b341,_0x444a42,_0x2130ba){var _0x1e85dd={};var _0x25dd83={};var _0x579f03;var _0x1bee77;return db[_0xdc02('0x34')]['findOne']({'where':{'id':_0x20b341[_0xdc02('0x4f')]['id']}})[_0xdc02('0x1d')](handleEntityNotFound(_0x444a42,null))[_0xdc02('0x1d')](function(_0x37176e){if(_0x37176e){_0x579f03=_0x37176e;_0x25dd83['model']=_[_0xdc02('0x3c')](db[_0xdc02('0x57')][_0xdc02('0x35')]);_0x25dd83[_0xdc02('0x3b')]=_[_0xdc02('0x3c')](_0x20b341[_0xdc02('0x3b')]);_0x25dd83[_0xdc02('0x3d')]=_[_0xdc02('0x3e')](_0x25dd83[_0xdc02('0x39')],_0x25dd83[_0xdc02('0x3b')]);_0x1e85dd[_0xdc02('0x3f')]=_[_0xdc02('0x3e')](_0x25dd83[_0xdc02('0x39')],qs[_0xdc02('0x40')](_0x20b341[_0xdc02('0x3b')][_0xdc02('0x40')]));_0x1e85dd[_0xdc02('0x3f')]=_0x1e85dd[_0xdc02('0x3f')][_0xdc02('0x41')]?_0x1e85dd[_0xdc02('0x3f')]:_0x25dd83['model'];_0x1e85dd[_0xdc02('0x58')]=qs[_0xdc02('0x44')](_0x20b341['query'][_0xdc02('0x44')]);_0x1e85dd[_0xdc02('0x45')]=qs[_0xdc02('0x3d')](_[_0xdc02('0x46')](_0x20b341['query'],_0x25dd83['filters']));if(_0x20b341[_0xdc02('0x3b')][_0xdc02('0x47')]){_0x1e85dd['where']=_['merge'](_0x1e85dd[_0xdc02('0x45')],{'$or':_[_0xdc02('0x33')](_0x1e85dd[_0xdc02('0x3f')],function(_0x1fac75){var _0xa77f16={};_0xa77f16[_0x1fac75]={'$like':'%'+_0x20b341[_0xdc02('0x3b')][_0xdc02('0x47')]+'%'};return _0xa77f16;})});}_0x1e85dd=_[_0xdc02('0x48')]({},_0x1e85dd,_0x20b341[_0xdc02('0x51')]);return _0x579f03[_0xdc02('0x56')](_0x1e85dd);}})[_0xdc02('0x1d')](function(_0xa93156){if(_0xa93156){_0x1bee77=_0xa93156['length'];if(!_0x20b341[_0xdc02('0x3b')]['hasOwnProperty'](_0xdc02('0x42'))){_0x1e85dd[_0xdc02('0x43')]=qs[_0xdc02('0x43')](_0x20b341[_0xdc02('0x3b')][_0xdc02('0x43')]);_0x1e85dd[_0xdc02('0x2c')]=qs[_0xdc02('0x2c')](_0x20b341['query'][_0xdc02('0x2c')]);}return _0x579f03[_0xdc02('0x56')](_0x1e85dd);}})[_0xdc02('0x1d')](function(_0x312c04){if(_0x312c04){return _0x312c04?{'count':_0x1bee77,'rows':_0x312c04}:null;}})[_0xdc02('0x1d')](respondWithResult(_0x444a42,null))[_0xdc02('0x27')](handleError(_0x444a42,null));};exports['getSubjects']=function(_0x2ee515,_0x38ecb8,_0x193bc1){var _0x20db2b={};var _0x2b42e4={};var _0x193c1a;var _0x138e61;return db[_0xdc02('0x34')][_0xdc02('0x59')]({'where':{'id':_0x2ee515['params']['id']}})['then'](handleEntityNotFound(_0x38ecb8,null))['then'](function(_0x6c40e8){if(_0x6c40e8){_0x193c1a=_0x6c40e8;_0x2b42e4[_0xdc02('0x39')]=_[_0xdc02('0x3c')](db[_0xdc02('0x57')]['rawAttributes']);_0x2b42e4[_0xdc02('0x3b')]=_[_0xdc02('0x3c')](_0x2ee515[_0xdc02('0x3b')]);_0x2b42e4['filters']=_['intersection'](_0x2b42e4[_0xdc02('0x39')],_0x2b42e4['query']);_0x20db2b[_0xdc02('0x3f')]=_['intersection'](_0x2b42e4['model'],qs[_0xdc02('0x40')](_0x2ee515[_0xdc02('0x3b')][_0xdc02('0x40')]));_0x20db2b[_0xdc02('0x3f')]=_0x20db2b[_0xdc02('0x3f')][_0xdc02('0x41')]?_0x20db2b[_0xdc02('0x3f')]:_0x2b42e4[_0xdc02('0x39')];_0x20db2b[_0xdc02('0x58')]=qs[_0xdc02('0x44')](_0x2ee515[_0xdc02('0x3b')][_0xdc02('0x44')]);_0x20db2b[_0xdc02('0x45')]=qs[_0xdc02('0x3d')](_['pick'](_0x2ee515[_0xdc02('0x3b')],_0x2b42e4[_0xdc02('0x3d')]));if(_0x2ee515[_0xdc02('0x3b')][_0xdc02('0x47')]){_0x20db2b[_0xdc02('0x45')]=_[_0xdc02('0x48')](_0x20db2b[_0xdc02('0x45')],{'$or':_['map'](_0x20db2b[_0xdc02('0x3f')],function(_0x33d965){var _0x47c657={};_0x47c657[_0x33d965]={'$like':'%'+_0x2ee515[_0xdc02('0x3b')][_0xdc02('0x47')]+'%'};return _0x47c657;})});}_0x20db2b=_['merge']({},_0x20db2b,_0x2ee515[_0xdc02('0x51')]);return _0x193c1a[_0xdc02('0x5a')](_0x20db2b);}})[_0xdc02('0x1d')](function(_0x4e42fe){if(_0x4e42fe){_0x138e61=_0x4e42fe[_0xdc02('0x41')];if(!_0x2ee515['query']['hasOwnProperty']('nolimit')){_0x20db2b[_0xdc02('0x43')]=qs[_0xdc02('0x43')](_0x2ee515[_0xdc02('0x3b')]['limit']);_0x20db2b[_0xdc02('0x2c')]=qs[_0xdc02('0x2c')](_0x2ee515[_0xdc02('0x3b')][_0xdc02('0x2c')]);}return _0x193c1a[_0xdc02('0x5a')](_0x20db2b);}})[_0xdc02('0x1d')](function(_0x3e9d02){if(_0x3e9d02){return _0x3e9d02?{'count':_0x138e61,'rows':_0x3e9d02}:null;}})[_0xdc02('0x1d')](respondWithResult(_0x38ecb8,null))[_0xdc02('0x27')](handleError(_0x38ecb8,null));};exports['getDescriptions']=function(_0x27da31,_0x59b16a,_0x147174){var _0x1070f3={};var _0x1300ca={};var _0x3c0aa9;var _0xdb8244;return db['DeskConfiguration'][_0xdc02('0x59')]({'where':{'id':_0x27da31[_0xdc02('0x4f')]['id']}})[_0xdc02('0x1d')](handleEntityNotFound(_0x59b16a,null))[_0xdc02('0x1d')](function(_0x3ff66f){if(_0x3ff66f){_0x3c0aa9=_0x3ff66f;_0x1300ca[_0xdc02('0x39')]=_[_0xdc02('0x3c')](db[_0xdc02('0x57')][_0xdc02('0x35')]);_0x1300ca[_0xdc02('0x3b')]=_['keys'](_0x27da31['query']);_0x1300ca[_0xdc02('0x3d')]=_[_0xdc02('0x3e')](_0x1300ca['model'],_0x1300ca[_0xdc02('0x3b')]);_0x1070f3[_0xdc02('0x3f')]=_['intersection'](_0x1300ca['model'],qs[_0xdc02('0x40')](_0x27da31['query'][_0xdc02('0x40')]));_0x1070f3[_0xdc02('0x3f')]=_0x1070f3[_0xdc02('0x3f')]['length']?_0x1070f3[_0xdc02('0x3f')]:_0x1300ca[_0xdc02('0x39')];_0x1070f3[_0xdc02('0x58')]=qs[_0xdc02('0x44')](_0x27da31[_0xdc02('0x3b')][_0xdc02('0x44')]);_0x1070f3['where']=qs[_0xdc02('0x3d')](_[_0xdc02('0x46')](_0x27da31[_0xdc02('0x3b')],_0x1300ca[_0xdc02('0x3d')]));if(_0x27da31['query'][_0xdc02('0x47')]){_0x1070f3['where']=_[_0xdc02('0x48')](_0x1070f3[_0xdc02('0x45')],{'$or':_['map'](_0x1070f3[_0xdc02('0x3f')],function(_0x5f1bda){var _0x4673f5={};_0x4673f5[_0x5f1bda]={'$like':'%'+_0x27da31[_0xdc02('0x3b')]['filter']+'%'};return _0x4673f5;})});}_0x1070f3=_['merge']({},_0x1070f3,_0x27da31[_0xdc02('0x51')]);return _0x3c0aa9[_0xdc02('0x5b')](_0x1070f3);}})[_0xdc02('0x1d')](function(_0x4ad9ca){if(_0x4ad9ca){_0xdb8244=_0x4ad9ca[_0xdc02('0x41')];if(!_0x27da31['query'][_0xdc02('0x5c')](_0xdc02('0x42'))){_0x1070f3[_0xdc02('0x43')]=qs['limit'](_0x27da31[_0xdc02('0x3b')][_0xdc02('0x43')]);_0x1070f3[_0xdc02('0x2c')]=qs['offset'](_0x27da31[_0xdc02('0x3b')][_0xdc02('0x2c')]);}return _0x3c0aa9[_0xdc02('0x5b')](_0x1070f3);}})[_0xdc02('0x1d')](function(_0x497ba3){if(_0x497ba3){return _0x497ba3?{'count':_0xdb8244,'rows':_0x497ba3}:null;}})[_0xdc02('0x1d')](respondWithResult(_0x59b16a,null))['catch'](handleError(_0x59b16a,null));};exports[_0xdc02('0x5d')]=function(_0x639ddf,_0x138ffb,_0xb96080){var _0x52e990={};var _0xd0a35b={};var _0xb8bd39;var _0x443cdf;return db[_0xdc02('0x34')]['findOne']({'where':{'id':_0x639ddf['params']['id']}})[_0xdc02('0x1d')](handleEntityNotFound(_0x138ffb,null))[_0xdc02('0x1d')](function(_0xb6fa1e){if(_0xb6fa1e){_0xb8bd39=_0xb6fa1e;_0xd0a35b[_0xdc02('0x39')]=_[_0xdc02('0x3c')](db[_0xdc02('0x5e')][_0xdc02('0x35')]);_0xd0a35b['query']=_[_0xdc02('0x3c')](_0x639ddf[_0xdc02('0x3b')]);_0xd0a35b['filters']=_[_0xdc02('0x3e')](_0xd0a35b[_0xdc02('0x39')],_0xd0a35b[_0xdc02('0x3b')]);_0x52e990[_0xdc02('0x3f')]=_[_0xdc02('0x3e')](_0xd0a35b[_0xdc02('0x39')],qs[_0xdc02('0x40')](_0x639ddf[_0xdc02('0x3b')]['fields']));_0x52e990['attributes']=_0x52e990['attributes'][_0xdc02('0x41')]?_0x52e990[_0xdc02('0x3f')]:_0xd0a35b['model'];_0x52e990['order']=qs[_0xdc02('0x44')](_0x639ddf[_0xdc02('0x3b')][_0xdc02('0x44')]);_0x52e990[_0xdc02('0x45')]=qs['filters'](_[_0xdc02('0x46')](_0x639ddf[_0xdc02('0x3b')],_0xd0a35b[_0xdc02('0x3d')]));if(_0x639ddf[_0xdc02('0x3b')][_0xdc02('0x47')]){_0x52e990[_0xdc02('0x45')]=_[_0xdc02('0x48')](_0x52e990[_0xdc02('0x45')],{'$or':_[_0xdc02('0x33')](_0x52e990[_0xdc02('0x3f')],function(_0x2b5377){var _0x3a7866={};_0x3a7866[_0x2b5377]={'$like':'%'+_0x639ddf['query'][_0xdc02('0x47')]+'%'};return _0x3a7866;})});}_0x52e990=_['merge']({},_0x52e990,_0x639ddf[_0xdc02('0x51')]);return _0xb8bd39['getTags'](_0x52e990);}})['then'](function(_0x40db3a){if(_0x40db3a){_0x443cdf=_0x40db3a[_0xdc02('0x41')];if(!_0x639ddf[_0xdc02('0x3b')][_0xdc02('0x5c')](_0xdc02('0x42'))){_0x52e990[_0xdc02('0x43')]=qs[_0xdc02('0x43')](_0x639ddf[_0xdc02('0x3b')][_0xdc02('0x43')]);_0x52e990[_0xdc02('0x2c')]=qs[_0xdc02('0x2c')](_0x639ddf[_0xdc02('0x3b')][_0xdc02('0x2c')]);}return _0xb8bd39[_0xdc02('0x5d')](_0x52e990);}})[_0xdc02('0x1d')](function(_0x13e025){if(_0x13e025){return _0x13e025?{'count':_0x443cdf,'rows':_0x13e025}:null;}})[_0xdc02('0x1d')](respondWithResult(_0x138ffb,null))[_0xdc02('0x27')](handleError(_0x138ffb,null));};exports[_0xdc02('0x5f')]=function(_0x10d3d3,_0x51dd6c,_0x18dca7){if(_0x10d3d3['body']['id']){delete _0x10d3d3[_0xdc02('0x54')]['id'];}return db[_0xdc02('0x34')]['findOne']({'where':{'id':_0x10d3d3['params']['id']}})['then'](handleEntityNotFound(_0x51dd6c,null))[_0xdc02('0x1d')](function(_0x350453){if(_0x350453){return _0x350453[_0xdc02('0x5f')](_0x10d3d3[_0xdc02('0x54')]['ids']||[]);}return null;})['then'](respondWithResult(_0x51dd6c,null))['catch'](handleError(_0x51dd6c,null));}; \ No newline at end of file +var _0x6714=['request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','destroy','stack','name','send','map','DeskConfiguration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','includeAll','findAll','catch','params','length','include','options','find','create','body','update','getFields','DeskField','findOne','nolimit','getSubjects','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x6714,0xa7));var _0x4671=function(_0x560448,_0x2c1082){_0x560448=_0x560448-0x0;var _0x550276=_0x6714[_0x560448];return _0x550276;};'use strict';var pdf=require(_0x4671('0x0'));var emlformat=require(_0x4671('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x4671('0x2'));var jsonpatch=require(_0x4671('0x3'));var rp=require('request-promise');var moment=require(_0x4671('0x4'));var BPromise=require(_0x4671('0x5'));var Mustache=require(_0x4671('0x6'));var util=require(_0x4671('0x7'));var path=require(_0x4671('0x8'));var sox=require(_0x4671('0x9'));var csv=require(_0x4671('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4671('0xb'));var squel=require(_0x4671('0xc'));var crypto=require(_0x4671('0xd'));var jsforce=require(_0x4671('0xe'));var deskjs=require(_0x4671('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4671('0x10'));var Redis=require(_0x4671('0x11'));var authService=require(_0x4671('0x12'));var qs=require(_0x4671('0x13'));var as=require(_0x4671('0x14'));var hardwareService=require(_0x4671('0x15'));var logger=require(_0x4671('0x16'))(_0x4671('0x17'));var utils=require(_0x4671('0x18'));var config=require(_0x4671('0x19'));var db=require(_0x4671('0x1a'))['db'];var jayson=require(_0x4671('0x1b'));var client=jayson[_0x4671('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x2fcb10,_0x17e893,_0x4f22dd){if(_0x4f22dd){var _0x37fe22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x37fe22[_0x4671('0x1d')](_0x17e893)){return _0x2fcb10;}else{throw new db[(_0x4671('0x1e'))][(_0x4671('0x1f'))](_0x4671('0x20'));}}else{return _0x2fcb10;}}function respondWithRpcPromise(_0x1530cd,_0x37b142,_0x1fca44,_0x4e52d1){return new BPromise(function(_0x5d3d7e,_0x2db1bd){var _0x1a2ebc=_0x4e52d1||client;return _0x1a2ebc[_0x4671('0x21')](_0x1530cd,_0x1fca44)[_0x4671('0x22')](function(_0x4a0d0a){logger[_0x4671('0x23')](_0x4671('0x24'),_0x37b142,_0x4671('0x25'));logger['debug'](_0x4671('0x26'),_0x37b142,'request\x20sent',JSON[_0x4671('0x27')](_0x4a0d0a));if(_0x4a0d0a[_0x4671('0x28')]){if(_0x4a0d0a['error'][_0x4671('0x29')]===0x1f4){logger['error'](_0x4671('0x24'),_0x37b142,_0x4a0d0a[_0x4671('0x28')][_0x4671('0x2a')]);return _0x2db1bd(_0x4a0d0a[_0x4671('0x28')][_0x4671('0x2a')]);}logger[_0x4671('0x28')]('DeskConfiguration,\x20%s,\x20%s',_0x37b142,_0x4a0d0a[_0x4671('0x28')][_0x4671('0x2a')]);return _0x5d3d7e(_0x4a0d0a[_0x4671('0x28')][_0x4671('0x2a')]);}else{logger['info']('DeskConfiguration,\x20%s,\x20%s',_0x37b142,'request\x20sent');_0x5d3d7e(_0x4a0d0a[_0x4671('0x2b')][_0x4671('0x2a')]);}})['catch'](function(_0x102364){logger[_0x4671('0x28')]('DeskConfiguration,\x20%s,\x20%s',_0x37b142,_0x102364);_0x2db1bd(_0x102364);});});}function respondWithStatusCode(_0x50baa6,_0x7f0761){_0x7f0761=_0x7f0761||0xcc;return function(_0x42a154){if(_0x42a154){return _0x50baa6[_0x4671('0x2c')](_0x7f0761);}return _0x50baa6['status'](_0x7f0761)[_0x4671('0x2d')]();};}function respondWithResult(_0x24d626,_0xb7561e){_0xb7561e=_0xb7561e||0xc8;return function(_0x66ae08){if(_0x66ae08){return _0x24d626[_0x4671('0x2e')](_0xb7561e)[_0x4671('0x2f')](_0x66ae08);}};}function respondWithFilteredResult(_0x555bf4,_0x2debc9){return function(_0x31b467){if(_0x31b467){var _0x239fd2=_0x31b467[_0x4671('0x30')],_0x7084a9=_0x2debc9[_0x4671('0x31')],_0x524efb=_0x2debc9[_0x4671('0x31')]+_0x2debc9[_0x4671('0x32')],_0x1f010f;if(_0x524efb>=_0x239fd2){_0x524efb=_0x239fd2;_0x1f010f=0xc8;}else{_0x1f010f=0xce;}_0x555bf4[_0x4671('0x2e')](_0x1f010f);return _0x555bf4[_0x4671('0x33')](_0x4671('0x34'),_0x7084a9+'-'+_0x524efb+'/'+_0x239fd2)[_0x4671('0x2f')](_0x31b467);}return null;};}function patchUpdates(_0xfd59e){return function(_0x2c3fa0){try{jsonpatch[_0x4671('0x35')](_0x2c3fa0,_0xfd59e,!![]);}catch(_0x5ac334){return BPromise['reject'](_0x5ac334);}return _0x2c3fa0[_0x4671('0x36')]();};}function saveUpdates(_0x1d06f1,_0xb687be){return function(_0x5a7097){if(_0x5a7097){return _0x5a7097['update'](_0x1d06f1)[_0x4671('0x22')](function(_0x2b5239){return _0x2b5239;});}return null;};}function removeEntity(_0x1673ca,_0x36f0c6){return function(_0x423e36){if(_0x423e36){return _0x423e36[_0x4671('0x37')]()[_0x4671('0x22')](function(){_0x1673ca[_0x4671('0x2e')](0xcc)[_0x4671('0x2d')]();});}};}function handleEntityNotFound(_0x811033,_0x481aed){return function(_0xf935fe){if(!_0xf935fe){_0x811033[_0x4671('0x2c')](0x194);}return _0xf935fe;};}function handleError(_0x28da9d,_0x16aeda){_0x16aeda=_0x16aeda||0x1f4;return function(_0x127b4f){logger[_0x4671('0x28')](_0x127b4f[_0x4671('0x38')]);if(_0x127b4f['name']){delete _0x127b4f[_0x4671('0x39')];}_0x28da9d[_0x4671('0x2e')](_0x16aeda)[_0x4671('0x3a')](_0x127b4f);};}exports['index']=function(_0x4b6637,_0x1cdf7c){var _0x8d745={},_0x4729bf={},_0x3d7583={'count':0x0,'rows':[]};var _0xeb1fab=_[_0x4671('0x3b')](db[_0x4671('0x3c')][_0x4671('0x3d')],function(_0x452006){return{'name':_0x452006[_0x4671('0x3e')],'type':_0x452006[_0x4671('0x3f')][_0x4671('0x40')]};});_0x4729bf['model']=_[_0x4671('0x3b')](_0xeb1fab,_0x4671('0x39'));_0x4729bf[_0x4671('0x41')]=_[_0x4671('0x42')](_0x4b6637[_0x4671('0x41')]);_0x4729bf['filters']=_[_0x4671('0x43')](_0x4729bf[_0x4671('0x44')],_0x4729bf[_0x4671('0x41')]);_0x8d745[_0x4671('0x45')]=_[_0x4671('0x43')](_0x4729bf[_0x4671('0x44')],qs[_0x4671('0x46')](_0x4b6637['query'][_0x4671('0x46')]));_0x8d745[_0x4671('0x45')]=_0x8d745[_0x4671('0x45')]['length']?_0x8d745['attributes']:_0x4729bf[_0x4671('0x44')];if(!_0x4b6637[_0x4671('0x41')][_0x4671('0x47')]('nolimit')){_0x8d745[_0x4671('0x32')]=qs[_0x4671('0x32')](_0x4b6637[_0x4671('0x41')][_0x4671('0x32')]);_0x8d745[_0x4671('0x31')]=qs[_0x4671('0x31')](_0x4b6637[_0x4671('0x41')][_0x4671('0x31')]);}_0x8d745[_0x4671('0x48')]=qs['sort'](_0x4b6637['query'][_0x4671('0x49')]);_0x8d745[_0x4671('0x4a')]=qs[_0x4671('0x4b')](_[_0x4671('0x4c')](_0x4b6637[_0x4671('0x41')],_0x4729bf[_0x4671('0x4b')]));if(_0x4b6637[_0x4671('0x41')][_0x4671('0x4d')]){_0x8d745[_0x4671('0x4a')]=_['merge'](_0x8d745[_0x4671('0x4a')],{'$or':_['map'](_0xeb1fab,function(_0x1c5766){if(_0x1c5766[_0x4671('0x3f')]!=='VIRTUAL'){var _0x4405e1={};_0x4405e1[_0x1c5766[_0x4671('0x39')]]={'$like':'%'+_0x4b6637[_0x4671('0x41')][_0x4671('0x4d')]+'%'};return _0x4405e1;}})});}_0x8d745=_[_0x4671('0x4e')]({},_0x8d745,_0x4b6637['options']);var _0x1c4055={'where':_0x8d745[_0x4671('0x4a')]};return db[_0x4671('0x3c')][_0x4671('0x30')](_0x1c4055)['then'](function(_0x3b40e2){_0x3d7583['count']=_0x3b40e2;if(_0x4b6637[_0x4671('0x41')][_0x4671('0x4f')]){_0x8d745['include']=[{'all':!![]}];}return db[_0x4671('0x3c')][_0x4671('0x50')](_0x8d745);})[_0x4671('0x22')](function(_0x3827d9){_0x3d7583['rows']=_0x3827d9;return _0x3d7583;})['then'](respondWithFilteredResult(_0x1cdf7c,_0x8d745))[_0x4671('0x51')](handleError(_0x1cdf7c,null));};exports['show']=function(_0x55a7ee,_0x25c657){var _0x3f8da8={'raw':![],'where':{'id':_0x55a7ee[_0x4671('0x52')]['id']}},_0x1061bb={};_0x1061bb['model']=_[_0x4671('0x42')](db[_0x4671('0x3c')]['rawAttributes']);_0x1061bb[_0x4671('0x41')]=_[_0x4671('0x42')](_0x55a7ee[_0x4671('0x41')]);_0x1061bb[_0x4671('0x4b')]=_['intersection'](_0x1061bb[_0x4671('0x44')],_0x1061bb[_0x4671('0x41')]);_0x3f8da8[_0x4671('0x45')]=_[_0x4671('0x43')](_0x1061bb['model'],qs[_0x4671('0x46')](_0x55a7ee[_0x4671('0x41')][_0x4671('0x46')]));_0x3f8da8[_0x4671('0x45')]=_0x3f8da8[_0x4671('0x45')][_0x4671('0x53')]?_0x3f8da8[_0x4671('0x45')]:_0x1061bb[_0x4671('0x44')];if(_0x55a7ee['query']['includeAll']){_0x3f8da8[_0x4671('0x54')]=[{'all':!![]}];}_0x3f8da8=_['merge']({},_0x3f8da8,_0x55a7ee[_0x4671('0x55')]);return db['DeskConfiguration'][_0x4671('0x56')](_0x3f8da8)[_0x4671('0x22')](handleEntityNotFound(_0x25c657,null))['then'](respondWithResult(_0x25c657,null))[_0x4671('0x51')](handleError(_0x25c657,null));};exports[_0x4671('0x57')]=function(_0x567309,_0x29ea2e){return db[_0x4671('0x3c')][_0x4671('0x57')](_0x567309[_0x4671('0x58')],{})[_0x4671('0x22')](respondWithResult(_0x29ea2e,0xc9))[_0x4671('0x51')](handleError(_0x29ea2e,null));};exports[_0x4671('0x59')]=function(_0x35bdc7,_0x4707f2){if(_0x35bdc7['body']['id']){delete _0x35bdc7[_0x4671('0x58')]['id'];}return db['DeskConfiguration']['find']({'where':{'id':_0x35bdc7[_0x4671('0x52')]['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x4707f2,null))[_0x4671('0x22')](saveUpdates(_0x35bdc7['body'],null))[_0x4671('0x22')](respondWithResult(_0x4707f2,null))[_0x4671('0x51')](handleError(_0x4707f2,null));};exports[_0x4671('0x37')]=function(_0x659adb,_0x3312f2){return db['DeskConfiguration']['find']({'where':{'id':_0x659adb['params']['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x3312f2,null))['then'](removeEntity(_0x3312f2,null))[_0x4671('0x51')](handleError(_0x3312f2,null));};exports[_0x4671('0x5a')]=function(_0x1ce276,_0x2e9c9f,_0x32efc7){var _0x520fb9={};var _0x11f3f0={};var _0x18c92b;var _0x4754c6;return db[_0x4671('0x3c')]['findOne']({'where':{'id':_0x1ce276[_0x4671('0x52')]['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x2e9c9f,null))[_0x4671('0x22')](function(_0x383a04){if(_0x383a04){_0x18c92b=_0x383a04;_0x11f3f0[_0x4671('0x44')]=_[_0x4671('0x42')](db[_0x4671('0x5b')]['rawAttributes']);_0x11f3f0[_0x4671('0x41')]=_[_0x4671('0x42')](_0x1ce276['query']);_0x11f3f0[_0x4671('0x4b')]=_[_0x4671('0x43')](_0x11f3f0['model'],_0x11f3f0[_0x4671('0x41')]);_0x520fb9['attributes']=_[_0x4671('0x43')](_0x11f3f0[_0x4671('0x44')],qs['fields'](_0x1ce276[_0x4671('0x41')][_0x4671('0x46')]));_0x520fb9[_0x4671('0x45')]=_0x520fb9[_0x4671('0x45')][_0x4671('0x53')]?_0x520fb9['attributes']:_0x11f3f0[_0x4671('0x44')];_0x520fb9[_0x4671('0x48')]=qs[_0x4671('0x49')](_0x1ce276[_0x4671('0x41')]['sort']);_0x520fb9[_0x4671('0x4a')]=qs[_0x4671('0x4b')](_[_0x4671('0x4c')](_0x1ce276[_0x4671('0x41')],_0x11f3f0[_0x4671('0x4b')]));if(_0x1ce276[_0x4671('0x41')][_0x4671('0x4d')]){_0x520fb9[_0x4671('0x4a')]=_[_0x4671('0x4e')](_0x520fb9[_0x4671('0x4a')],{'$or':_[_0x4671('0x3b')](_0x520fb9['attributes'],function(_0x1e2d02){var _0x3a941f={};_0x3a941f[_0x1e2d02]={'$like':'%'+_0x1ce276[_0x4671('0x41')][_0x4671('0x4d')]+'%'};return _0x3a941f;})});}_0x520fb9=_[_0x4671('0x4e')]({},_0x520fb9,_0x1ce276[_0x4671('0x55')]);return _0x18c92b[_0x4671('0x5a')](_0x520fb9);}})[_0x4671('0x22')](function(_0x5d1889){if(_0x5d1889){_0x4754c6=_0x5d1889[_0x4671('0x53')];if(!_0x1ce276['query'][_0x4671('0x47')]('nolimit')){_0x520fb9[_0x4671('0x32')]=qs[_0x4671('0x32')](_0x1ce276['query'][_0x4671('0x32')]);_0x520fb9[_0x4671('0x31')]=qs[_0x4671('0x31')](_0x1ce276[_0x4671('0x41')]['offset']);}return _0x18c92b['getFields'](_0x520fb9);}})[_0x4671('0x22')](function(_0x539f02){if(_0x539f02){return _0x539f02?{'count':_0x4754c6,'rows':_0x539f02}:null;}})[_0x4671('0x22')](respondWithResult(_0x2e9c9f,null))[_0x4671('0x51')](handleError(_0x2e9c9f,null));};exports['getSubjects']=function(_0x461e83,_0x2a6be5,_0x2d34b3){var _0x150eca={};var _0x424f11={};var _0x17eda7;var _0xd35823;return db[_0x4671('0x3c')][_0x4671('0x5c')]({'where':{'id':_0x461e83[_0x4671('0x52')]['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x2a6be5,null))['then'](function(_0x33d4d2){if(_0x33d4d2){_0x17eda7=_0x33d4d2;_0x424f11['model']=_[_0x4671('0x42')](db[_0x4671('0x5b')]['rawAttributes']);_0x424f11[_0x4671('0x41')]=_[_0x4671('0x42')](_0x461e83[_0x4671('0x41')]);_0x424f11['filters']=_[_0x4671('0x43')](_0x424f11['model'],_0x424f11[_0x4671('0x41')]);_0x150eca['attributes']=_['intersection'](_0x424f11['model'],qs[_0x4671('0x46')](_0x461e83['query'][_0x4671('0x46')]));_0x150eca[_0x4671('0x45')]=_0x150eca[_0x4671('0x45')]['length']?_0x150eca['attributes']:_0x424f11[_0x4671('0x44')];_0x150eca[_0x4671('0x48')]=qs[_0x4671('0x49')](_0x461e83['query']['sort']);_0x150eca[_0x4671('0x4a')]=qs[_0x4671('0x4b')](_['pick'](_0x461e83['query'],_0x424f11[_0x4671('0x4b')]));if(_0x461e83[_0x4671('0x41')][_0x4671('0x4d')]){_0x150eca[_0x4671('0x4a')]=_['merge'](_0x150eca['where'],{'$or':_[_0x4671('0x3b')](_0x150eca[_0x4671('0x45')],function(_0x227ec3){var _0x40f88c={};_0x40f88c[_0x227ec3]={'$like':'%'+_0x461e83[_0x4671('0x41')][_0x4671('0x4d')]+'%'};return _0x40f88c;})});}_0x150eca=_['merge']({},_0x150eca,_0x461e83[_0x4671('0x55')]);return _0x17eda7['getSubjects'](_0x150eca);}})[_0x4671('0x22')](function(_0x21f49d){if(_0x21f49d){_0xd35823=_0x21f49d[_0x4671('0x53')];if(!_0x461e83[_0x4671('0x41')][_0x4671('0x47')](_0x4671('0x5d'))){_0x150eca['limit']=qs['limit'](_0x461e83[_0x4671('0x41')][_0x4671('0x32')]);_0x150eca[_0x4671('0x31')]=qs[_0x4671('0x31')](_0x461e83[_0x4671('0x41')][_0x4671('0x31')]);}return _0x17eda7[_0x4671('0x5e')](_0x150eca);}})['then'](function(_0x5c15e4){if(_0x5c15e4){return _0x5c15e4?{'count':_0xd35823,'rows':_0x5c15e4}:null;}})[_0x4671('0x22')](respondWithResult(_0x2a6be5,null))[_0x4671('0x51')](handleError(_0x2a6be5,null));};exports[_0x4671('0x5f')]=function(_0x25e9f1,_0x5ac86f,_0x42c8cf){var _0x4506ea={};var _0x269e58={};var _0x3a2f17;var _0x26507e;return db[_0x4671('0x3c')][_0x4671('0x5c')]({'where':{'id':_0x25e9f1['params']['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x5ac86f,null))[_0x4671('0x22')](function(_0x192de3){if(_0x192de3){_0x3a2f17=_0x192de3;_0x269e58[_0x4671('0x44')]=_[_0x4671('0x42')](db[_0x4671('0x5b')][_0x4671('0x3d')]);_0x269e58['query']=_[_0x4671('0x42')](_0x25e9f1[_0x4671('0x41')]);_0x269e58['filters']=_[_0x4671('0x43')](_0x269e58[_0x4671('0x44')],_0x269e58[_0x4671('0x41')]);_0x4506ea[_0x4671('0x45')]=_[_0x4671('0x43')](_0x269e58[_0x4671('0x44')],qs[_0x4671('0x46')](_0x25e9f1['query'][_0x4671('0x46')]));_0x4506ea['attributes']=_0x4506ea[_0x4671('0x45')][_0x4671('0x53')]?_0x4506ea[_0x4671('0x45')]:_0x269e58['model'];_0x4506ea[_0x4671('0x48')]=qs[_0x4671('0x49')](_0x25e9f1[_0x4671('0x41')][_0x4671('0x49')]);_0x4506ea[_0x4671('0x4a')]=qs[_0x4671('0x4b')](_[_0x4671('0x4c')](_0x25e9f1[_0x4671('0x41')],_0x269e58[_0x4671('0x4b')]));if(_0x25e9f1['query'][_0x4671('0x4d')]){_0x4506ea[_0x4671('0x4a')]=_['merge'](_0x4506ea[_0x4671('0x4a')],{'$or':_[_0x4671('0x3b')](_0x4506ea[_0x4671('0x45')],function(_0x332d48){var _0x248a47={};_0x248a47[_0x332d48]={'$like':'%'+_0x25e9f1[_0x4671('0x41')][_0x4671('0x4d')]+'%'};return _0x248a47;})});}_0x4506ea=_[_0x4671('0x4e')]({},_0x4506ea,_0x25e9f1[_0x4671('0x55')]);return _0x3a2f17[_0x4671('0x5f')](_0x4506ea);}})[_0x4671('0x22')](function(_0xa05468){if(_0xa05468){_0x26507e=_0xa05468[_0x4671('0x53')];if(!_0x25e9f1[_0x4671('0x41')][_0x4671('0x47')](_0x4671('0x5d'))){_0x4506ea[_0x4671('0x32')]=qs['limit'](_0x25e9f1[_0x4671('0x41')][_0x4671('0x32')]);_0x4506ea['offset']=qs[_0x4671('0x31')](_0x25e9f1['query']['offset']);}return _0x3a2f17[_0x4671('0x5f')](_0x4506ea);}})[_0x4671('0x22')](function(_0x3dade7){if(_0x3dade7){return _0x3dade7?{'count':_0x26507e,'rows':_0x3dade7}:null;}})[_0x4671('0x22')](respondWithResult(_0x5ac86f,null))[_0x4671('0x51')](handleError(_0x5ac86f,null));};exports[_0x4671('0x60')]=function(_0x3c3953,_0x1e8ce3,_0x12d5ec){var _0x4e032b={};var _0x224535={};var _0x44f1df;var _0x3c9ef7;return db[_0x4671('0x3c')]['findOne']({'where':{'id':_0x3c3953[_0x4671('0x52')]['id']}})[_0x4671('0x22')](handleEntityNotFound(_0x1e8ce3,null))[_0x4671('0x22')](function(_0x1064dd){if(_0x1064dd){_0x44f1df=_0x1064dd;_0x224535[_0x4671('0x44')]=_['keys'](db[_0x4671('0x61')]['rawAttributes']);_0x224535[_0x4671('0x41')]=_[_0x4671('0x42')](_0x3c3953[_0x4671('0x41')]);_0x224535[_0x4671('0x4b')]=_[_0x4671('0x43')](_0x224535[_0x4671('0x44')],_0x224535[_0x4671('0x41')]);_0x4e032b[_0x4671('0x45')]=_[_0x4671('0x43')](_0x224535[_0x4671('0x44')],qs[_0x4671('0x46')](_0x3c3953[_0x4671('0x41')][_0x4671('0x46')]));_0x4e032b[_0x4671('0x45')]=_0x4e032b[_0x4671('0x45')]['length']?_0x4e032b['attributes']:_0x224535[_0x4671('0x44')];_0x4e032b[_0x4671('0x48')]=qs[_0x4671('0x49')](_0x3c3953['query']['sort']);_0x4e032b[_0x4671('0x4a')]=qs[_0x4671('0x4b')](_[_0x4671('0x4c')](_0x3c3953['query'],_0x224535[_0x4671('0x4b')]));if(_0x3c3953['query']['filter']){_0x4e032b[_0x4671('0x4a')]=_[_0x4671('0x4e')](_0x4e032b[_0x4671('0x4a')],{'$or':_[_0x4671('0x3b')](_0x4e032b[_0x4671('0x45')],function(_0x2d2fbe){var _0x387c31={};_0x387c31[_0x2d2fbe]={'$like':'%'+_0x3c3953[_0x4671('0x41')][_0x4671('0x4d')]+'%'};return _0x387c31;})});}_0x4e032b=_[_0x4671('0x4e')]({},_0x4e032b,_0x3c3953['options']);return _0x44f1df[_0x4671('0x60')](_0x4e032b);}})[_0x4671('0x22')](function(_0x38209c){if(_0x38209c){_0x3c9ef7=_0x38209c[_0x4671('0x53')];if(!_0x3c3953[_0x4671('0x41')][_0x4671('0x47')]('nolimit')){_0x4e032b[_0x4671('0x32')]=qs[_0x4671('0x32')](_0x3c3953[_0x4671('0x41')][_0x4671('0x32')]);_0x4e032b[_0x4671('0x31')]=qs[_0x4671('0x31')](_0x3c3953[_0x4671('0x41')][_0x4671('0x31')]);}return _0x44f1df[_0x4671('0x60')](_0x4e032b);}})[_0x4671('0x22')](function(_0x519cce){if(_0x519cce){return _0x519cce?{'count':_0x3c9ef7,'rows':_0x519cce}:null;}})[_0x4671('0x22')](respondWithResult(_0x1e8ce3,null))[_0x4671('0x51')](handleError(_0x1e8ce3,null));};exports['setTags']=function(_0x305393,_0x543d97,_0xc93d3c){if(_0x305393[_0x4671('0x58')]['id']){delete _0x305393[_0x4671('0x58')]['id'];}return db[_0x4671('0x3c')]['findOne']({'where':{'id':_0x305393[_0x4671('0x52')]['id']}})['then'](handleEntityNotFound(_0x543d97,null))[_0x4671('0x22')](function(_0x30abf7){if(_0x30abf7){return _0x30abf7[_0x4671('0x62')](_0x305393['body'][_0x4671('0x63')]||[]);}return null;})['then'](respondWithResult(_0x543d97,null))['catch'](handleError(_0x543d97,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index e780d8f..2a7129b 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 _0x4fa3=['lodash','../../config/logger','moment','request-promise','path','./intDeskConfiguration.attributes','exports','define','DeskConfiguration'];(function(_0x5a6c50,_0x581a54){var _0x18e40b=function(_0x32b842){while(--_0x32b842){_0x5a6c50['push'](_0x5a6c50['shift']());}};_0x18e40b(++_0x581a54);}(_0x4fa3,0x183));var _0x34fa=function(_0x29a1e9,_0x3049a6){_0x29a1e9=_0x29a1e9-0x0;var _0x3302c2=_0x4fa3[_0x29a1e9];return _0x3302c2;};'use strict';var _=require(_0x34fa('0x0'));var util=require('util');var logger=require(_0x34fa('0x1'))('api');var moment=require(_0x34fa('0x2'));var BPromise=require('bluebird');var rp=require(_0x34fa('0x3'));var fs=require('fs');var path=require(_0x34fa('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x34fa('0x5'));module[_0x34fa('0x6')]=function(_0x2c65ed,_0x1955f8){return _0x2c65ed[_0x34fa('0x7')](_0x34fa('0x8'),attributes,{'tableName':'int_desk_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa1da=['api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','define','DeskConfiguration','int_desk_configurations','lodash','../../config/logger'];(function(_0x53bcc3,_0x364374){var _0x47c959=function(_0x40ef7d){while(--_0x40ef7d){_0x53bcc3['push'](_0x53bcc3['shift']());}};_0x47c959(++_0x364374);}(_0xa1da,0x17e));var _0xaa1d=function(_0x2e6776,_0x1ea7c7){_0x2e6776=_0x2e6776-0x0;var _0x3423bf=_0xa1da[_0x2e6776];return _0x3423bf;};'use strict';var _=require(_0xaa1d('0x0'));var util=require('util');var logger=require(_0xaa1d('0x1'))(_0xaa1d('0x2'));var moment=require(_0xaa1d('0x3'));var BPromise=require(_0xaa1d('0x4'));var rp=require(_0xaa1d('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaa1d('0x6'));var config=require(_0xaa1d('0x7'));var attributes=require(_0xaa1d('0x8'));module['exports']=function(_0x5ddb50,_0x348db0){return _0x5ddb50[_0xaa1d('0x9')](_0xaa1d('0xa'),attributes,{'tableName':_0xaa1d('0xb'),'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 e3db078..2b71d2d 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 _0xbca8=['error','code','message','DeskConfiguration,\x20%s,\x20%s','request\x20sent','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','request','then','info','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0x1184a5,_0x2b63d8){var _0x33b71e=function(_0x719bee){while(--_0x719bee){_0x1184a5['push'](_0x1184a5['shift']());}};_0x33b71e(++_0x2b63d8);}(_0xbca8,0xcc));var _0x8bca=function(_0xd0fa40,_0x2f09e1){_0xd0fa40=_0xd0fa40-0x0;var _0x428c01=_0xbca8[_0xd0fa40];return _0x428c01;};'use strict';var _=require(_0x8bca('0x0'));var util=require(_0x8bca('0x1'));var moment=require(_0x8bca('0x2'));var BPromise=require(_0x8bca('0x3'));var rs=require(_0x8bca('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8bca('0x5'))['db'];var utils=require(_0x8bca('0x6'));var logger=require(_0x8bca('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x8bca('0x8'));var client=jayson[_0x8bca('0x9')][_0x8bca('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x348ddd,_0x4b3267,_0x3fdccf){return new BPromise(function(_0x38e241,_0x278c99){return client[_0x8bca('0xb')](_0x348ddd,_0x3fdccf)[_0x8bca('0xc')](function(_0xe266ca){logger[_0x8bca('0xd')]('DeskConfiguration,\x20%s,\x20%s',_0x4b3267,'request\x20sent');logger[_0x8bca('0xe')](_0x8bca('0xf'),_0x4b3267,'request\x20sent',JSON['stringify'](_0xe266ca));if(_0xe266ca[_0x8bca('0x10')]){if(_0xe266ca['error'][_0x8bca('0x11')]===0x1f4){logger[_0x8bca('0x10')]('DeskConfiguration,\x20%s,\x20%s',_0x4b3267,_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);return _0x278c99(_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x4b3267,_0xe266ca[_0x8bca('0x10')]['message']);return _0x38e241(_0xe266ca[_0x8bca('0x10')][_0x8bca('0x12')]);}else{logger[_0x8bca('0xd')](_0x8bca('0x13'),_0x4b3267,_0x8bca('0x14'));_0x38e241(_0xe266ca[_0x8bca('0x15')]['message']);}})['catch'](function(_0x11037e){logger['error'](_0x8bca('0x13'),_0x4b3267,_0x11037e);_0x278c99(_0x11037e);});});} \ No newline at end of file +var _0xde2c=['DeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x575aa6,_0xbc58df){var _0x59e0d6=function(_0x5f16f3){while(--_0x5f16f3){_0x575aa6['push'](_0x575aa6['shift']());}};_0x59e0d6(++_0xbc58df);}(_0xde2c,0x7f));var _0xcde2=function(_0xa8883,_0x1f107f){_0xa8883=_0xa8883-0x0;var _0x479426=_0xde2c[_0xa8883];return _0x479426;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('DeskConfiguration,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index bb743e7..a2f1495 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 _0xe5be=['../../components/auth/service','../../config/environment','./intDeskField.controller','isAuthenticated','/:id','post','delete','destroy','exports','multer','util','path','Router'];(function(_0x284b63,_0x5b3af9){var _0x56a16a=function(_0x2ae08a){while(--_0x2ae08a){_0x284b63['push'](_0x284b63['shift']());}};_0x56a16a(++_0x5b3af9);}(_0xe5be,0x7e));var _0xee5b=function(_0x3e1feb,_0x32c3c2){_0x3e1feb=_0x3e1feb-0x0;var _0x4fd356=_0xe5be[_0x3e1feb];return _0x4fd356;};'use strict';var multer=require(_0xee5b('0x0'));var util=require(_0xee5b('0x1'));var path=require(_0xee5b('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xee5b('0x3')]();var auth=require(_0xee5b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xee5b('0x5'));var controller=require(_0xee5b('0x6'));router['get']('/',auth[_0xee5b('0x7')](),controller['index']);router['get'](_0xee5b('0x8'),auth['isAuthenticated'](),controller['show']);router[_0xee5b('0x9')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xee5b('0x8'),auth['isAuthenticated'](),controller['update']);router[_0xee5b('0xa')](_0xee5b('0x8'),auth['isAuthenticated'](),controller[_0xee5b('0xb')]);module[_0xee5b('0xc')]=router; \ No newline at end of file +var _0xfbc4=['./intDeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0xfbc4,0xad));var _0x4fbc=function(_0x4ca50c,_0x24d21f){_0x4ca50c=_0x4ca50c-0x0;var _0x4275c6=_0xfbc4[_0x4ca50c];return _0x4275c6;};'use strict';var multer=require(_0x4fbc('0x0'));var util=require(_0x4fbc('0x1'));var path=require(_0x4fbc('0x2'));var timeout=require(_0x4fbc('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x4fbc('0x4'));var interaction=require(_0x4fbc('0x5'));var config=require(_0x4fbc('0x6'));var controller=require(_0x4fbc('0x7'));router[_0x4fbc('0x8')]('/',auth[_0x4fbc('0x9')](),controller[_0x4fbc('0xa')]);router[_0x4fbc('0x8')](_0x4fbc('0xb'),auth['isAuthenticated'](),controller[_0x4fbc('0xc')]);router[_0x4fbc('0xd')]('/',auth['isAuthenticated'](),controller[_0x4fbc('0xe')]);router[_0x4fbc('0xf')](_0x4fbc('0xb'),auth['isAuthenticated'](),controller[_0x4fbc('0x10')]);router[_0x4fbc('0x11')](_0x4fbc('0xb'),auth[_0x4fbc('0x9')](),controller[_0x4fbc('0x12')]);module[_0x4fbc('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index 77e70ff..8a4cee9 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 _0x0519=['STRING','sequelize','exports','ENUM','string','variable','keyValue'];(function(_0x10772c,_0x1df6ad){var _0x806119=function(_0xd52771){while(--_0xd52771){_0x10772c['push'](_0x10772c['shift']());}};_0x806119(++_0x1df6ad);}(_0x0519,0x158));var _0x9051=function(_0x3fd3a3,_0x36c863){_0x3fd3a3=_0x3fd3a3-0x0;var _0xa3e4d5=_0x0519[_0x3fd3a3];return _0xa3e4d5;};'use strict';var Sequelize=require(_0x9051('0x0'));module[_0x9051('0x1')]={'type':{'type':Sequelize[_0x9051('0x2')](_0x9051('0x3'),_0x9051('0x4'),'customVariable',_0x9051('0x5')),'defaultValue':_0x9051('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize['ENUM'](_0x9051('0x3'),_0x9051('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9051('0x6')]},'nameField':{'type':Sequelize[_0x9051('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9051('0x6')]}}; \ No newline at end of file +var _0x085a=['exports','ENUM','string','customVariable','STRING','variable','BOOLEAN','sequelize'];(function(_0xb073d5,_0x1ca3f3){var _0x128bde=function(_0x268e7c){while(--_0x268e7c){_0xb073d5['push'](_0xb073d5['shift']());}};_0x128bde(++_0x1ca3f3);}(_0x085a,0xff));var _0xa085=function(_0x23a799,_0x4549a2){_0x23a799=_0x23a799-0x0;var _0x43e610=_0x085a[_0x23a799];return _0x43e610;};'use strict';var Sequelize=require(_0xa085('0x0'));module[_0xa085('0x1')]={'type':{'type':Sequelize[_0xa085('0x2')](_0xa085('0x3'),'variable',_0xa085('0x4'),'keyValue'),'defaultValue':_0xa085('0x3')},'content':{'type':Sequelize[_0xa085('0x5')]},'key':{'type':Sequelize[_0xa085('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0xa085('0x3'),_0xa085('0x6'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xa085('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa085('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 2b10e2a..8b8c626 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 _0x826a=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','offset','limit','status','set','json','reject','save','then','destroy','stack','name','send','index','map','DeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','include','findAll','rows','catch','show','includeAll','create','body','find','eml-format','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x3fb5eb,_0x5947a6){var _0x481291=function(_0x74e4e){while(--_0x74e4e){_0x3fb5eb['push'](_0x3fb5eb['shift']());}};_0x481291(++_0x5947a6);}(_0x826a,0x1aa));var _0xa826=function(_0xddc894,_0x5eea05){_0xddc894=_0xddc894-0x0;var _0xd64966=_0x826a[_0xddc894];return _0xd64966;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa826('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xa826('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa826('0x2'));var moment=require(_0xa826('0x3'));var BPromise=require(_0xa826('0x4'));var Mustache=require(_0xa826('0x5'));var util=require('util');var path=require(_0xa826('0x6'));var sox=require(_0xa826('0x7'));var csv=require(_0xa826('0x8'));var ejs=require(_0xa826('0x9'));var fs=require('fs');var _=require(_0xa826('0xa'));var squel=require(_0xa826('0xb'));var crypto=require(_0xa826('0xc'));var jsforce=require(_0xa826('0xd'));var deskjs=require(_0xa826('0xe'));var toCsv=require(_0xa826('0x8'));var querystring=require(_0xa826('0xf'));var Papa=require(_0xa826('0x10'));var Redis=require(_0xa826('0x11'));var authService=require(_0xa826('0x12'));var qs=require(_0xa826('0x13'));var as=require(_0xa826('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa826('0x15'))('api');var utils=require(_0xa826('0x16'));var config=require(_0xa826('0x17'));var db=require(_0xa826('0x18'))['db'];function respondWithStatusCode(_0xa55bd7,_0x212fac){_0x212fac=_0x212fac||0xcc;return function(_0x40838f){if(_0x40838f){return _0xa55bd7[_0xa826('0x19')](_0x212fac);}return _0xa55bd7['status'](_0x212fac)[_0xa826('0x1a')]();};}function respondWithResult(_0x5c6cee,_0x3e99b0){_0x3e99b0=_0x3e99b0||0xc8;return function(_0x41c0c2){if(_0x41c0c2){return _0x5c6cee['status'](_0x3e99b0)['json'](_0x41c0c2);}};}function respondWithFilteredResult(_0x49c91e,_0x1b6d16){return function(_0x4f25bd){if(_0x4f25bd){var _0x4c546b=_0x4f25bd['count'],_0x9a3788=_0x1b6d16[_0xa826('0x1b')],_0x142474=_0x1b6d16[_0xa826('0x1b')]+_0x1b6d16[_0xa826('0x1c')],_0x2e15e2;if(_0x142474>=_0x4c546b){_0x142474=_0x4c546b;_0x2e15e2=0xc8;}else{_0x2e15e2=0xce;}_0x49c91e[_0xa826('0x1d')](_0x2e15e2);return _0x49c91e[_0xa826('0x1e')]('Content-Range',_0x9a3788+'-'+_0x142474+'/'+_0x4c546b)[_0xa826('0x1f')](_0x4f25bd);}return null;};}function patchUpdates(_0x2938ba){return function(_0x229b90){try{jsonpatch['apply'](_0x229b90,_0x2938ba,!![]);}catch(_0x5d8161){return BPromise[_0xa826('0x20')](_0x5d8161);}return _0x229b90[_0xa826('0x21')]();};}function saveUpdates(_0xd8ca56,_0x8d1650){return function(_0x124564){if(_0x124564){return _0x124564['update'](_0xd8ca56)[_0xa826('0x22')](function(_0x2e7e90){return _0x2e7e90;});}return null;};}function removeEntity(_0x3272fb,_0x5d410f){return function(_0x5ddeef){if(_0x5ddeef){return _0x5ddeef[_0xa826('0x23')]()[_0xa826('0x22')](function(){_0x3272fb[_0xa826('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d7adf,_0x26ef25){return function(_0x1d4ade){if(!_0x1d4ade){_0x1d7adf[_0xa826('0x19')](0x194);}return _0x1d4ade;};}function handleError(_0x1ec8a8,_0x4d6909){_0x4d6909=_0x4d6909||0x1f4;return function(_0x13329a){logger['error'](_0x13329a[_0xa826('0x24')]);if(_0x13329a[_0xa826('0x25')]){delete _0x13329a['name'];}_0x1ec8a8[_0xa826('0x1d')](_0x4d6909)[_0xa826('0x26')](_0x13329a);};}exports[_0xa826('0x27')]=function(_0xf132e0,_0x1107a4){var _0x3c6307={},_0x14e836={},_0x3b9c6d={'count':0x0,'rows':[]};var _0x36ded2=_[_0xa826('0x28')](db[_0xa826('0x29')][_0xa826('0x2a')],function(_0x1f2749){return{'name':_0x1f2749[_0xa826('0x2b')],'type':_0x1f2749[_0xa826('0x2c')][_0xa826('0x2d')]};});_0x14e836['model']=_[_0xa826('0x28')](_0x36ded2,'name');_0x14e836[_0xa826('0x2e')]=_[_0xa826('0x2f')](_0xf132e0[_0xa826('0x2e')]);_0x14e836[_0xa826('0x30')]=_[_0xa826('0x31')](_0x14e836['model'],_0x14e836['query']);_0x3c6307[_0xa826('0x32')]=_[_0xa826('0x31')](_0x14e836[_0xa826('0x33')],qs[_0xa826('0x34')](_0xf132e0['query'][_0xa826('0x34')]));_0x3c6307[_0xa826('0x32')]=_0x3c6307['attributes'][_0xa826('0x35')]?_0x3c6307['attributes']:_0x14e836[_0xa826('0x33')];if(!_0xf132e0[_0xa826('0x2e')][_0xa826('0x36')](_0xa826('0x37'))){_0x3c6307[_0xa826('0x1c')]=qs['limit'](_0xf132e0[_0xa826('0x2e')][_0xa826('0x1c')]);_0x3c6307[_0xa826('0x1b')]=qs[_0xa826('0x1b')](_0xf132e0[_0xa826('0x2e')][_0xa826('0x1b')]);}_0x3c6307[_0xa826('0x38')]=qs[_0xa826('0x39')](_0xf132e0[_0xa826('0x2e')][_0xa826('0x39')]);_0x3c6307[_0xa826('0x3a')]=qs['filters'](_[_0xa826('0x3b')](_0xf132e0['query'],_0x14e836[_0xa826('0x30')]));if(_0xf132e0['query'][_0xa826('0x3c')]){_0x3c6307[_0xa826('0x3a')]=_[_0xa826('0x3d')](_0x3c6307[_0xa826('0x3a')],{'$or':_[_0xa826('0x28')](_0x36ded2,function(_0x75f59){if(_0x75f59[_0xa826('0x2c')]!==_0xa826('0x3e')){var _0x22a45e={};_0x22a45e[_0x75f59[_0xa826('0x25')]]={'$like':'%'+_0xf132e0[_0xa826('0x2e')][_0xa826('0x3c')]+'%'};return _0x22a45e;}})});}_0x3c6307=_['merge']({},_0x3c6307,_0xf132e0[_0xa826('0x3f')]);var _0x2f7be4={'where':_0x3c6307[_0xa826('0x3a')]};return db['DeskField'][_0xa826('0x40')](_0x2f7be4)[_0xa826('0x22')](function(_0x520e10){_0x3b9c6d[_0xa826('0x40')]=_0x520e10;if(_0xf132e0['query']['includeAll']){_0x3c6307[_0xa826('0x41')]=[{'all':!![]}];}return db[_0xa826('0x29')][_0xa826('0x42')](_0x3c6307);})[_0xa826('0x22')](function(_0x451814){_0x3b9c6d[_0xa826('0x43')]=_0x451814;return _0x3b9c6d;})['then'](respondWithFilteredResult(_0x1107a4,_0x3c6307))[_0xa826('0x44')](handleError(_0x1107a4,null));};exports[_0xa826('0x45')]=function(_0x2be07c,_0x14fc0d){var _0x244fd3={'raw':!![],'where':{'id':_0x2be07c['params']['id']}},_0x19292e={};_0x19292e[_0xa826('0x33')]=_[_0xa826('0x2f')](db[_0xa826('0x29')][_0xa826('0x2a')]);_0x19292e[_0xa826('0x2e')]=_['keys'](_0x2be07c[_0xa826('0x2e')]);_0x19292e[_0xa826('0x30')]=_[_0xa826('0x31')](_0x19292e[_0xa826('0x33')],_0x19292e[_0xa826('0x2e')]);_0x244fd3[_0xa826('0x32')]=_[_0xa826('0x31')](_0x19292e[_0xa826('0x33')],qs[_0xa826('0x34')](_0x2be07c[_0xa826('0x2e')][_0xa826('0x34')]));_0x244fd3[_0xa826('0x32')]=_0x244fd3['attributes'][_0xa826('0x35')]?_0x244fd3[_0xa826('0x32')]:_0x19292e[_0xa826('0x33')];if(_0x2be07c['query'][_0xa826('0x46')]){_0x244fd3[_0xa826('0x41')]=[{'all':!![]}];}_0x244fd3=_[_0xa826('0x3d')]({},_0x244fd3,_0x2be07c[_0xa826('0x3f')]);return db[_0xa826('0x29')]['find'](_0x244fd3)[_0xa826('0x22')](handleEntityNotFound(_0x14fc0d,null))[_0xa826('0x22')](respondWithResult(_0x14fc0d,null))[_0xa826('0x44')](handleError(_0x14fc0d,null));};exports[_0xa826('0x47')]=function(_0xec6ccf,_0x30aac0){return db[_0xa826('0x29')]['create'](_0xec6ccf[_0xa826('0x48')],{})['then'](respondWithResult(_0x30aac0,0xc9))['catch'](handleError(_0x30aac0,null));};exports['update']=function(_0x26a858,_0x35d118){if(_0x26a858[_0xa826('0x48')]['id']){delete _0x26a858[_0xa826('0x48')]['id'];}return db['DeskField'][_0xa826('0x49')]({'where':{'id':_0x26a858['params']['id']}})['then'](handleEntityNotFound(_0x35d118,null))[_0xa826('0x22')](saveUpdates(_0x26a858[_0xa826('0x48')],null))['then'](respondWithResult(_0x35d118,null))[_0xa826('0x44')](handleError(_0x35d118,null));};exports[_0xa826('0x23')]=function(_0x57f237,_0x5a87bf){return db['DeskField']['find']({'where':{'id':_0x57f237['params']['id']}})['then'](handleEntityNotFound(_0x5a87bf,null))['then'](removeEntity(_0x5a87bf,null))[_0xa826('0x44')](handleError(_0x5a87bf,null));}; \ No newline at end of file +var _0xac95=['DeskField','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','sort','where','filter','merge','type','VIRTUAL','options','findAll','rows','catch','params','keys','length','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','util','path','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','end','json','count','limit','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xac95,0xa8));var _0x5ac9=function(_0x36ed5c,_0x48863f){_0x36ed5c=_0x36ed5c-0x0;var _0x42496e=_0xac95[_0x36ed5c];return _0x42496e;};'use strict';var pdf=require(_0x5ac9('0x0'));var emlformat=require(_0x5ac9('0x1'));var rimraf=require(_0x5ac9('0x2'));var zipdir=require(_0x5ac9('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5ac9('0x4'));var BPromise=require(_0x5ac9('0x5'));var Mustache=require('mustache');var util=require(_0x5ac9('0x6'));var path=require(_0x5ac9('0x7'));var sox=require('sox');var csv=require(_0x5ac9('0x8'));var ejs=require(_0x5ac9('0x9'));var fs=require('fs');var _=require(_0x5ac9('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x5ac9('0xb'));var deskjs=require(_0x5ac9('0xc'));var toCsv=require(_0x5ac9('0x8'));var querystring=require(_0x5ac9('0xd'));var Papa=require(_0x5ac9('0xe'));var Redis=require(_0x5ac9('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x5ac9('0x10'));var as=require(_0x5ac9('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5ac9('0x12'))('api');var utils=require(_0x5ac9('0x13'));var config=require('../../config/environment');var db=require(_0x5ac9('0x14'))['db'];function respondWithStatusCode(_0x296b34,_0x371231){_0x371231=_0x371231||0xcc;return function(_0x40eb62){if(_0x40eb62){return _0x296b34['sendStatus'](_0x371231);}return _0x296b34['status'](_0x371231)[_0x5ac9('0x15')]();};}function respondWithResult(_0x5f2d30,_0x3a7d64){_0x3a7d64=_0x3a7d64||0xc8;return function(_0x364007){if(_0x364007){return _0x5f2d30['status'](_0x3a7d64)[_0x5ac9('0x16')](_0x364007);}};}function respondWithFilteredResult(_0x4590f1,_0x3f8fac){return function(_0x122590){if(_0x122590){var _0x456ed9=_0x122590[_0x5ac9('0x17')],_0x2fe47e=_0x3f8fac['offset'],_0x44a5b1=_0x3f8fac['offset']+_0x3f8fac[_0x5ac9('0x18')],_0x19b3a4;if(_0x44a5b1>=_0x456ed9){_0x44a5b1=_0x456ed9;_0x19b3a4=0xc8;}else{_0x19b3a4=0xce;}_0x4590f1[_0x5ac9('0x19')](_0x19b3a4);return _0x4590f1[_0x5ac9('0x1a')](_0x5ac9('0x1b'),_0x2fe47e+'-'+_0x44a5b1+'/'+_0x456ed9)[_0x5ac9('0x16')](_0x122590);}return null;};}function patchUpdates(_0x47713e){return function(_0x986be7){try{jsonpatch[_0x5ac9('0x1c')](_0x986be7,_0x47713e,!![]);}catch(_0x293e4e){return BPromise[_0x5ac9('0x1d')](_0x293e4e);}return _0x986be7[_0x5ac9('0x1e')]();};}function saveUpdates(_0x2b144e,_0x2efa5f){return function(_0x479c6b){if(_0x479c6b){return _0x479c6b[_0x5ac9('0x1f')](_0x2b144e)[_0x5ac9('0x20')](function(_0x1a983d){return _0x1a983d;});}return null;};}function removeEntity(_0x32e65c,_0x2d2ba5){return function(_0x492679){if(_0x492679){return _0x492679[_0x5ac9('0x21')]()[_0x5ac9('0x20')](function(){_0x32e65c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5a4664,_0xc36d2){return function(_0x2e666b){if(!_0x2e666b){_0x5a4664['sendStatus'](0x194);}return _0x2e666b;};}function handleError(_0x5ce83a,_0x1a6372){_0x1a6372=_0x1a6372||0x1f4;return function(_0x59c3fd){logger['error'](_0x59c3fd[_0x5ac9('0x22')]);if(_0x59c3fd['name']){delete _0x59c3fd[_0x5ac9('0x23')];}_0x5ce83a[_0x5ac9('0x19')](_0x1a6372)[_0x5ac9('0x24')](_0x59c3fd);};}exports[_0x5ac9('0x25')]=function(_0x34c273,_0x174cfe){var _0x13aaa7={},_0x2dc7fa={},_0x203d19={'count':0x0,'rows':[]};var _0x48182b=_[_0x5ac9('0x26')](db[_0x5ac9('0x27')][_0x5ac9('0x28')],function(_0x3a536c){return{'name':_0x3a536c[_0x5ac9('0x29')],'type':_0x3a536c['type']['key']};});_0x2dc7fa[_0x5ac9('0x2a')]=_[_0x5ac9('0x26')](_0x48182b,'name');_0x2dc7fa[_0x5ac9('0x2b')]=_['keys'](_0x34c273[_0x5ac9('0x2b')]);_0x2dc7fa[_0x5ac9('0x2c')]=_[_0x5ac9('0x2d')](_0x2dc7fa['model'],_0x2dc7fa[_0x5ac9('0x2b')]);_0x13aaa7[_0x5ac9('0x2e')]=_[_0x5ac9('0x2d')](_0x2dc7fa[_0x5ac9('0x2a')],qs[_0x5ac9('0x2f')](_0x34c273[_0x5ac9('0x2b')]['fields']));_0x13aaa7['attributes']=_0x13aaa7[_0x5ac9('0x2e')]['length']?_0x13aaa7['attributes']:_0x2dc7fa[_0x5ac9('0x2a')];if(!_0x34c273[_0x5ac9('0x2b')][_0x5ac9('0x30')](_0x5ac9('0x31'))){_0x13aaa7[_0x5ac9('0x18')]=qs[_0x5ac9('0x18')](_0x34c273[_0x5ac9('0x2b')][_0x5ac9('0x18')]);_0x13aaa7[_0x5ac9('0x32')]=qs['offset'](_0x34c273[_0x5ac9('0x2b')][_0x5ac9('0x32')]);}_0x13aaa7['order']=qs['sort'](_0x34c273[_0x5ac9('0x2b')][_0x5ac9('0x33')]);_0x13aaa7[_0x5ac9('0x34')]=qs[_0x5ac9('0x2c')](_['pick'](_0x34c273[_0x5ac9('0x2b')],_0x2dc7fa['filters']));if(_0x34c273[_0x5ac9('0x2b')][_0x5ac9('0x35')]){_0x13aaa7[_0x5ac9('0x34')]=_[_0x5ac9('0x36')](_0x13aaa7[_0x5ac9('0x34')],{'$or':_[_0x5ac9('0x26')](_0x48182b,function(_0x14928e){if(_0x14928e[_0x5ac9('0x37')]!==_0x5ac9('0x38')){var _0x427d86={};_0x427d86[_0x14928e[_0x5ac9('0x23')]]={'$like':'%'+_0x34c273[_0x5ac9('0x2b')]['filter']+'%'};return _0x427d86;}})});}_0x13aaa7=_['merge']({},_0x13aaa7,_0x34c273[_0x5ac9('0x39')]);var _0x42c4f0={'where':_0x13aaa7[_0x5ac9('0x34')]};return db[_0x5ac9('0x27')][_0x5ac9('0x17')](_0x42c4f0)[_0x5ac9('0x20')](function(_0x49bddc){_0x203d19[_0x5ac9('0x17')]=_0x49bddc;if(_0x34c273[_0x5ac9('0x2b')]['includeAll']){_0x13aaa7['include']=[{'all':!![]}];}return db['DeskField'][_0x5ac9('0x3a')](_0x13aaa7);})[_0x5ac9('0x20')](function(_0x46a9fe){_0x203d19[_0x5ac9('0x3b')]=_0x46a9fe;return _0x203d19;})['then'](respondWithFilteredResult(_0x174cfe,_0x13aaa7))[_0x5ac9('0x3c')](handleError(_0x174cfe,null));};exports['show']=function(_0x4b407d,_0x35141c){var _0x45bc9b={'raw':!![],'where':{'id':_0x4b407d[_0x5ac9('0x3d')]['id']}},_0x57488d={};_0x57488d[_0x5ac9('0x2a')]=_['keys'](db[_0x5ac9('0x27')][_0x5ac9('0x28')]);_0x57488d[_0x5ac9('0x2b')]=_[_0x5ac9('0x3e')](_0x4b407d[_0x5ac9('0x2b')]);_0x57488d[_0x5ac9('0x2c')]=_[_0x5ac9('0x2d')](_0x57488d[_0x5ac9('0x2a')],_0x57488d[_0x5ac9('0x2b')]);_0x45bc9b[_0x5ac9('0x2e')]=_[_0x5ac9('0x2d')](_0x57488d[_0x5ac9('0x2a')],qs['fields'](_0x4b407d[_0x5ac9('0x2b')][_0x5ac9('0x2f')]));_0x45bc9b[_0x5ac9('0x2e')]=_0x45bc9b['attributes'][_0x5ac9('0x3f')]?_0x45bc9b[_0x5ac9('0x2e')]:_0x57488d[_0x5ac9('0x2a')];if(_0x4b407d['query'][_0x5ac9('0x40')]){_0x45bc9b[_0x5ac9('0x41')]=[{'all':!![]}];}_0x45bc9b=_[_0x5ac9('0x36')]({},_0x45bc9b,_0x4b407d[_0x5ac9('0x39')]);return db[_0x5ac9('0x27')][_0x5ac9('0x42')](_0x45bc9b)['then'](handleEntityNotFound(_0x35141c,null))['then'](respondWithResult(_0x35141c,null))[_0x5ac9('0x3c')](handleError(_0x35141c,null));};exports['create']=function(_0x448330,_0x4807ef){return db[_0x5ac9('0x27')][_0x5ac9('0x43')](_0x448330[_0x5ac9('0x44')],{})[_0x5ac9('0x20')](respondWithResult(_0x4807ef,0xc9))[_0x5ac9('0x3c')](handleError(_0x4807ef,null));};exports[_0x5ac9('0x1f')]=function(_0x324b7d,_0x20b55b){if(_0x324b7d[_0x5ac9('0x44')]['id']){delete _0x324b7d[_0x5ac9('0x44')]['id'];}return db[_0x5ac9('0x27')]['find']({'where':{'id':_0x324b7d[_0x5ac9('0x3d')]['id']}})[_0x5ac9('0x20')](handleEntityNotFound(_0x20b55b,null))['then'](saveUpdates(_0x324b7d['body'],null))[_0x5ac9('0x20')](respondWithResult(_0x20b55b,null))[_0x5ac9('0x3c')](handleError(_0x20b55b,null));};exports[_0x5ac9('0x21')]=function(_0x48a81e,_0x33446e){return db[_0x5ac9('0x27')][_0x5ac9('0x42')]({'where':{'id':_0x48a81e[_0x5ac9('0x3d')]['id']}})[_0x5ac9('0x20')](handleEntityNotFound(_0x33446e,null))[_0x5ac9('0x20')](removeEntity(_0x33446e,null))['catch'](handleError(_0x33446e,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 7e23adc..b1548cb 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 _0x5a3d=['define','DeskField','int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./intDeskField.attributes','exports'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5a3d,0x156));var _0xd5a3=function(_0x1d5a02,_0xfcbb92){_0x1d5a02=_0x1d5a02-0x0;var _0x1dac7c=_0x5a3d[_0x1d5a02];return _0x1dac7c;};'use strict';var _=require(_0xd5a3('0x0'));var util=require(_0xd5a3('0x1'));var logger=require(_0xd5a3('0x2'))(_0xd5a3('0x3'));var moment=require('moment');var BPromise=require(_0xd5a3('0x4'));var rp=require(_0xd5a3('0x5'));var fs=require('fs');var path=require(_0xd5a3('0x6'));var rimraf=require('rimraf');var config=require(_0xd5a3('0x7'));var attributes=require(_0xd5a3('0x8'));module[_0xd5a3('0x9')]=function(_0x47b804,_0xb2d29c){return _0x47b804[_0xd5a3('0xa')](_0xd5a3('0xb'),attributes,{'tableName':_0xd5a3('0xc'),'paranoid':![],'indexes':[{'name':_0xd5a3('0xd'),'fields':[_0xd5a3('0xe'),_0xd5a3('0xf')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc2ec=['path','rimraf','../../config/environment','exports','define','desk_unique_index','idField','FieldId','lodash','../../config/logger','api'];(function(_0xf47605,_0x22a2f5){var _0x33bee8=function(_0x4516f0){while(--_0x4516f0){_0xf47605['push'](_0xf47605['shift']());}};_0x33bee8(++_0x22a2f5);}(_0xc2ec,0x126));var _0xcc2e=function(_0x6ab737,_0xad7162){_0x6ab737=_0x6ab737-0x0;var _0x599691=_0xc2ec[_0x6ab737];return _0x599691;};'use strict';var _=require(_0xcc2e('0x0'));var util=require('util');var logger=require(_0xcc2e('0x1'))(_0xcc2e('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xcc2e('0x3'));var rimraf=require(_0xcc2e('0x4'));var config=require(_0xcc2e('0x5'));var attributes=require('./intDeskField.attributes');module[_0xcc2e('0x6')]=function(_0x43438e,_0x46e870){return _0x43438e[_0xcc2e('0x7')]('DeskField',attributes,{'tableName':'int_desk_fields','paranoid':![],'indexes':[{'name':_0xcc2e('0x8'),'fields':[_0xcc2e('0x9'),_0xcc2e('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.rpc.js b/server/api/intDeskField/intDeskField.rpc.js index c428318..4b24005 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 _0xc9aa=['catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','client','request','then','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc9aa,0x16a));var _0xac9a=function(_0x322bef,_0x4890d4){_0x322bef=_0x322bef-0x0;var _0x229e60=_0xc9aa[_0x322bef];return _0x229e60;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xac9a('0x0'));var BPromise=require(_0xac9a('0x1'));var rs=require(_0xac9a('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xac9a('0x3'))['db'];var utils=require(_0xac9a('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xac9a('0x5'));var jayson=require('jayson/promise');var client=jayson[_0xac9a('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x502a55,_0x2bc7a1,_0xdb9043){return new BPromise(function(_0x4a1814,_0x4e615c){return client[_0xac9a('0x7')](_0x502a55,_0xdb9043)[_0xac9a('0x8')](function(_0x3807f7){logger[_0xac9a('0x9')](_0xac9a('0xa'),_0x2bc7a1,_0xac9a('0xb'));logger[_0xac9a('0xc')]('DeskField,\x20%s,\x20%s,\x20%s',_0x2bc7a1,'request\x20sent',JSON[_0xac9a('0xd')](_0x3807f7));if(_0x3807f7[_0xac9a('0xe')]){if(_0x3807f7[_0xac9a('0xe')][_0xac9a('0xf')]===0x1f4){logger[_0xac9a('0xe')](_0xac9a('0xa'),_0x2bc7a1,_0x3807f7[_0xac9a('0xe')][_0xac9a('0x10')]);return _0x4e615c(_0x3807f7[_0xac9a('0xe')][_0xac9a('0x10')]);}logger[_0xac9a('0xe')](_0xac9a('0xa'),_0x2bc7a1,_0x3807f7[_0xac9a('0xe')][_0xac9a('0x10')]);return _0x4a1814(_0x3807f7[_0xac9a('0xe')][_0xac9a('0x10')]);}else{logger[_0xac9a('0x9')](_0xac9a('0xa'),_0x2bc7a1,'request\x20sent');_0x4a1814(_0x3807f7[_0xac9a('0x11')][_0xac9a('0x10')]);}})[_0xac9a('0x12')](function(_0x2b875b){logger['error'](_0xac9a('0xa'),_0x2bc7a1,_0x2b875b);_0x4e615c(_0x2b875b);});});} \ No newline at end of file +var _0xe68a=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','stringify','error','DeskField,\x20%s,\x20%s','message','catch','util','moment','bluebird'];(function(_0x2ab3d9,_0x50e716){var _0x210a54=function(_0x24c479){while(--_0x24c479){_0x2ab3d9['push'](_0x2ab3d9['shift']());}};_0x210a54(++_0x50e716);}(_0xe68a,0x18d));var _0xae68=function(_0x34bbe3,_0x28d122){_0x34bbe3=_0x34bbe3-0x0;var _0x4301aa=_0xe68a[_0x34bbe3];return _0x4301aa;};'use strict';var _=require('lodash');var util=require(_0xae68('0x0'));var moment=require(_0xae68('0x1'));var BPromise=require(_0xae68('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xae68('0x3'));var db=require(_0xae68('0x4'))['db'];var utils=require(_0xae68('0x5'));var logger=require('../../config/logger')(_0xae68('0x6'));var config=require(_0xae68('0x7'));var jayson=require(_0xae68('0x8'));var client=jayson['client'][_0xae68('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11bbb7,_0x1431f8,_0x237223){return new BPromise(function(_0x10e9a8,_0x545e9a){return client[_0xae68('0xa')](_0x11bbb7,_0x237223)['then'](function(_0x51f892){logger[_0xae68('0xb')]('DeskField,\x20%s,\x20%s',_0x1431f8,_0xae68('0xc'));logger[_0xae68('0xd')](_0xae68('0xe'),_0x1431f8,_0xae68('0xc'),JSON[_0xae68('0xf')](_0x51f892));if(_0x51f892[_0xae68('0x10')]){if(_0x51f892[_0xae68('0x10')]['code']===0x1f4){logger[_0xae68('0x10')](_0xae68('0x11'),_0x1431f8,_0x51f892[_0xae68('0x10')]['message']);return _0x545e9a(_0x51f892['error']['message']);}logger[_0xae68('0x10')]('DeskField,\x20%s,\x20%s',_0x1431f8,_0x51f892[_0xae68('0x10')][_0xae68('0x12')]);return _0x10e9a8(_0x51f892[_0xae68('0x10')][_0xae68('0x12')]);}else{logger[_0xae68('0xb')]('DeskField,\x20%s,\x20%s',_0x1431f8,_0xae68('0xc'));_0x10e9a8(_0x51f892['result']['message']);}})[_0xae68('0x13')](function(_0x490c4f){logger[_0xae68('0x10')]('DeskField,\x20%s,\x20%s',_0x1431f8,_0x490c4f);_0x545e9a(_0x490c4f);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index 6d4353a..e4aaa30 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 _0x7503=['addConfiguration','put','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/fields','post','create','/:id/configurations'];(function(_0x80f836,_0x59da46){var _0x3ed3b7=function(_0x32eb92){while(--_0x32eb92){_0x80f836['push'](_0x80f836['shift']());}};_0x3ed3b7(++_0x59da46);}(_0x7503,0xec));var _0x3750=function(_0x19159a,_0x1cb5c3){_0x19159a=_0x19159a-0x0;var _0xa677f4=_0x7503[_0x19159a];return _0xa677f4;};'use strict';var multer=require(_0x3750('0x0'));var util=require(_0x3750('0x1'));var path=require(_0x3750('0x2'));var timeout=require(_0x3750('0x3'));var express=require(_0x3750('0x4'));var router=express['Router']();var auth=require(_0x3750('0x5'));var interaction=require(_0x3750('0x6'));var config=require(_0x3750('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x3750('0x8')](),controller['index']);router[_0x3750('0x9')](_0x3750('0xa'),auth['isAuthenticated'](),controller[_0x3750('0xb')]);router['get']('/:id/configurations',auth[_0x3750('0x8')](),controller['getConfigurations']);router[_0x3750('0x9')](_0x3750('0xc'),auth[_0x3750('0x8')](),controller['getFields']);router[_0x3750('0xd')]('/',auth[_0x3750('0x8')](),controller[_0x3750('0xe')]);router[_0x3750('0xd')](_0x3750('0xf'),auth[_0x3750('0x8')](),controller[_0x3750('0x10')]);router[_0x3750('0x11')](_0x3750('0xa'),auth[_0x3750('0x8')](),controller['update']);router[_0x3750('0x12')](_0x3750('0xa'),auth['isAuthenticated'](),controller[_0x3750('0x13')]);module[_0x3750('0x14')]=router; \ No newline at end of file +var _0x8880=['getFields','post','create','addConfiguration','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','/:id/fields'];(function(_0x1c0991,_0x4f22d2){var _0x5034de=function(_0x520f49){while(--_0x520f49){_0x1c0991['push'](_0x1c0991['shift']());}};_0x5034de(++_0x4f22d2);}(_0x8880,0x188));var _0x0888=function(_0x459b74,_0x5773bd){_0x459b74=_0x459b74-0x0;var _0x46cb16=_0x8880[_0x459b74];return _0x46cb16;};'use strict';var multer=require(_0x0888('0x0'));var util=require(_0x0888('0x1'));var path=require(_0x0888('0x2'));var timeout=require(_0x0888('0x3'));var express=require(_0x0888('0x4'));var router=express[_0x0888('0x5')]();var auth=require(_0x0888('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x0888('0x7'));var controller=require('./intDynamics365Account.controller');router['get']('/',auth[_0x0888('0x8')](),controller[_0x0888('0x9')]);router[_0x0888('0xa')](_0x0888('0xb'),auth[_0x0888('0x8')](),controller[_0x0888('0xc')]);router['get'](_0x0888('0xd'),auth['isAuthenticated'](),controller[_0x0888('0xe')]);router[_0x0888('0xa')](_0x0888('0xf'),auth[_0x0888('0x8')](),controller[_0x0888('0x10')]);router[_0x0888('0x11')]('/',auth[_0x0888('0x8')](),controller[_0x0888('0x12')]);router[_0x0888('0x11')](_0x0888('0xd'),auth[_0x0888('0x8')](),controller[_0x0888('0x13')]);router['put'](_0x0888('0xb'),auth[_0x0888('0x8')](),controller[_0x0888('0x14')]);router[_0x0888('0x15')]('/:id',auth[_0x0888('0x8')](),controller[_0x0888('0x16')]);module[_0x0888('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index 3eee2bb..f1137cc 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 _0x8a22=['sequelize','exports','STRING'];(function(_0x331067,_0x1ad5fe){var _0x430a40=function(_0x6fce4e){while(--_0x6fce4e){_0x331067['push'](_0x331067['shift']());}};_0x430a40(++_0x1ad5fe);}(_0x8a22,0x8d));var _0x28a2=function(_0x38411c,_0x5b0add){_0x38411c=_0x38411c-0x0;var _0x5a94a3=_0x8a22[_0x38411c];return _0x5a94a3;};'use strict';var Sequelize=require(_0x28a2('0x0'));module[_0x28a2('0x1')]={'name':{'type':Sequelize[_0x28a2('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x28a2('0x2')]},'remoteUri':{'type':Sequelize[_0x28a2('0x2')]},'tenantId':{'type':Sequelize[_0x28a2('0x2')]},'clientId':{'type':Sequelize[_0x28a2('0x2')]},'clientSecret':{'type':Sequelize[_0x28a2('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x28a2('0x2')]}}; \ No newline at end of file +var _0x26bd=['sequelize','exports','STRING'];(function(_0x2a8d36,_0x287050){var _0x48ebcf=function(_0xbc481c){while(--_0xbc481c){_0x2a8d36['push'](_0x2a8d36['shift']());}};_0x48ebcf(++_0x287050);}(_0x26bd,0x10b));var _0xd26b=function(_0x39304b,_0xa98c51){_0x39304b=_0x39304b-0x0;var _0x48ce81=_0x26bd[_0x39304b];return _0x48ce81;};'use strict';var Sequelize=require(_0xd26b('0x0'));module[_0xd26b('0x1')]={'name':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xd26b('0x2')]},'remoteUri':{'type':Sequelize[_0xd26b('0x2')]},'tenantId':{'type':Sequelize[_0xd26b('0x2')]},'clientId':{'type':Sequelize[_0xd26b('0x2')]},'clientSecret':{'type':Sequelize[_0xd26b('0x2')]},'serverUrl':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xd26b('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index f0e52f2..c37480f 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 _0x435b=['message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','key','model','map','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','Dynamics365Account','includeAll','include','findAll','rows','catch','show','find','create','body','params','findOne','Dynamics365Configuration','pick','getConfigurations','AccountId','getSubjects','channel','getDescriptions','Dynamics365Field','Subjects','Descriptions','getFields','incident','title','ownerid','subject','regardingobjectid','phonecall_activity_parties','accountidyominame','contactidname','contactidyominame','createdbyexternalpartyname','createdbyname','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridtype','customeridyominame','emailaddress','entityimage_timestamp','entityimage_url','escalatedon','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','msdyn_iotalertname','numberofchildincidents','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','productidname','productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','lastIndexOf','POST','/oauth2/token','clientSecret','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','Attributes','includes','LogicalName','forEach','@odata.type','substring','PicklistAttributeMetadata','push','all','isNil','BooleanAttributeMetadata','StringAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','Label','Value','DisplayName','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','OptionSet','TrueOption','true','FalseOption','false','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x2c7dc6,_0x3c4ce0){var _0x10002b=function(_0x26f390){while(--_0x26f390){_0x2c7dc6['push'](_0x2c7dc6['shift']());}};_0x10002b(++_0x3c4ce0);}(_0x435b,0x180));var _0xb435=function(_0x5818e7,_0xc31c34){_0x5818e7=_0x5818e7-0x0;var _0x3a8da3=_0x435b[_0x5818e7];return _0x3a8da3;};'use strict';var pdf=require(_0xb435('0x0'));var emlformat=require(_0xb435('0x1'));var rimraf=require(_0xb435('0x2'));var zipdir=require(_0xb435('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb435('0x4'));var moment=require(_0xb435('0x5'));var BPromise=require(_0xb435('0x6'));var Mustache=require('mustache');var util=require(_0xb435('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xb435('0x8'));var ejs=require(_0xb435('0x9'));var fs=require('fs');var _=require(_0xb435('0xa'));var squel=require('squel');var crypto=require(_0xb435('0xb'));var jsforce=require(_0xb435('0xc'));var deskjs=require(_0xb435('0xd'));var toCsv=require(_0xb435('0x8'));var querystring=require(_0xb435('0xe'));var Papa=require('papaparse');var Redis=require(_0xb435('0xf'));var authService=require(_0xb435('0x10'));var qs=require(_0xb435('0x11'));var as=require(_0xb435('0x12'));var hardwareService=require(_0xb435('0x13'));var logger=require(_0xb435('0x14'))(_0xb435('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var integrations=require(_0xb435('0x16'));var jayson=require(_0xb435('0x17'));var client=jayson[_0xb435('0x18')][_0xb435('0x19')]({'port':0x232a});function checkPasswordPattern(_0x430e65,_0x1c34ec,_0x238e42){if(_0x238e42){var _0x16d8da=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x16d8da[_0xb435('0x1a')](_0x1c34ec)){return _0x430e65;}else{throw new db[(_0xb435('0x1b'))][(_0xb435('0x1c'))](_0xb435('0x1d'));}}else{return _0x430e65;}}function respondWithRpcPromise(_0x1f9ceb,_0x4aa267,_0x5d1e63,_0x125d47){return new BPromise(function(_0x5a3f4c,_0xed3c85){var _0x32692d=_0x125d47||client;return _0x32692d[_0xb435('0x1e')](_0x1f9ceb,_0x5d1e63)[_0xb435('0x1f')](function(_0x2cf57c){logger[_0xb435('0x20')](_0xb435('0x21'),_0x4aa267,'request\x20sent');logger[_0xb435('0x22')](_0xb435('0x23'),_0x4aa267,_0xb435('0x24'),JSON[_0xb435('0x25')](_0x2cf57c));if(_0x2cf57c[_0xb435('0x26')]){if(_0x2cf57c[_0xb435('0x26')][_0xb435('0x27')]===0x1f4){logger[_0xb435('0x26')](_0xb435('0x21'),_0x4aa267,_0x2cf57c[_0xb435('0x26')][_0xb435('0x28')]);return _0xed3c85(_0x2cf57c['error']['message']);}logger['error'](_0xb435('0x21'),_0x4aa267,_0x2cf57c[_0xb435('0x26')][_0xb435('0x28')]);return _0x5a3f4c(_0x2cf57c[_0xb435('0x26')]['message']);}else{logger[_0xb435('0x20')](_0xb435('0x21'),_0x4aa267,_0xb435('0x24'));_0x5a3f4c(_0x2cf57c[_0xb435('0x29')][_0xb435('0x28')]);}})['catch'](function(_0x1ba8de){logger[_0xb435('0x26')]('Dynamics365Account,\x20%s,\x20%s',_0x4aa267,_0x1ba8de);_0xed3c85(_0x1ba8de);});});}function respondWithStatusCode(_0x209531,_0x178421){_0x178421=_0x178421||0xcc;return function(_0x243a1c){if(_0x243a1c){return _0x209531[_0xb435('0x2a')](_0x178421);}return _0x209531[_0xb435('0x2b')](_0x178421)[_0xb435('0x2c')]();};}function respondWithResult(_0x300ac9,_0x261faf){_0x261faf=_0x261faf||0xc8;return function(_0x281c86){if(_0x281c86){return _0x300ac9[_0xb435('0x2b')](_0x261faf)[_0xb435('0x2d')](_0x281c86);}};}function respondWithFilteredResult(_0x3f0099,_0x41ee57){return function(_0x9dc77d){if(_0x9dc77d){var _0x304e39=_0x9dc77d[_0xb435('0x2e')],_0x2b28b2=_0x41ee57['offset'],_0x30c761=_0x41ee57[_0xb435('0x2f')]+_0x41ee57[_0xb435('0x30')],_0xa4ed6e;if(_0x30c761>=_0x304e39){_0x30c761=_0x304e39;_0xa4ed6e=0xc8;}else{_0xa4ed6e=0xce;}_0x3f0099[_0xb435('0x2b')](_0xa4ed6e);return _0x3f0099['set'](_0xb435('0x31'),_0x2b28b2+'-'+_0x30c761+'/'+_0x304e39)['json'](_0x9dc77d);}return null;};}function patchUpdates(_0x548cb3){return function(_0x29c498){try{jsonpatch[_0xb435('0x32')](_0x29c498,_0x548cb3,!![]);}catch(_0x535702){return BPromise[_0xb435('0x33')](_0x535702);}return _0x29c498[_0xb435('0x34')]();};}function saveUpdates(_0x45382a,_0x575aa8){return function(_0x183ca1){if(_0x183ca1){return _0x183ca1[_0xb435('0x35')](_0x45382a)[_0xb435('0x1f')](function(_0x3d7e90){return _0x3d7e90;});}return null;};}function removeEntity(_0x166212,_0x2817fe){return function(_0x1944c8){if(_0x1944c8){return _0x1944c8[_0xb435('0x36')]()[_0xb435('0x1f')](function(){_0x166212[_0xb435('0x2b')](0xcc)[_0xb435('0x2c')]();});}};}function handleEntityNotFound(_0x2eb8b7,_0xb3ed84){return function(_0x180493){if(!_0x180493){_0x2eb8b7[_0xb435('0x2a')](0x194);}return _0x180493;};}function handleError(_0x157b3e,_0x232bf6){_0x232bf6=_0x232bf6||0x1f4;return function(_0xb9e002){logger[_0xb435('0x26')](_0xb9e002[_0xb435('0x37')]);if(_0xb9e002['name']){delete _0xb9e002[_0xb435('0x38')];}_0x157b3e[_0xb435('0x2b')](_0x232bf6)[_0xb435('0x39')](_0xb9e002);};}exports[_0xb435('0x3a')]=function(_0x53bb16,_0x54dd1c){var _0x1a3109={},_0x2ecd63={},_0x50a8f1={'count':0x0,'rows':[]};var _0x13df5e=_['map'](db['Dynamics365Account'][_0xb435('0x3b')],function(_0x19051c){return{'name':_0x19051c[_0xb435('0x3c')],'type':_0x19051c['type'][_0xb435('0x3d')]};});_0x2ecd63[_0xb435('0x3e')]=_[_0xb435('0x3f')](_0x13df5e,_0xb435('0x38'));_0x2ecd63['query']=_[_0xb435('0x40')](_0x53bb16[_0xb435('0x41')]);_0x2ecd63[_0xb435('0x42')]=_['intersection'](_0x2ecd63['model'],_0x2ecd63[_0xb435('0x41')]);_0x1a3109[_0xb435('0x43')]=_[_0xb435('0x44')](_0x2ecd63[_0xb435('0x3e')],qs['fields'](_0x53bb16[_0xb435('0x41')][_0xb435('0x45')]));_0x1a3109[_0xb435('0x43')]=_0x1a3109[_0xb435('0x43')][_0xb435('0x46')]?_0x1a3109['attributes']:_0x2ecd63[_0xb435('0x3e')];if(!_0x53bb16['query'][_0xb435('0x47')](_0xb435('0x48'))){_0x1a3109['limit']=qs[_0xb435('0x30')](_0x53bb16['query'][_0xb435('0x30')]);_0x1a3109[_0xb435('0x2f')]=qs[_0xb435('0x2f')](_0x53bb16[_0xb435('0x41')][_0xb435('0x2f')]);}_0x1a3109[_0xb435('0x49')]=qs[_0xb435('0x4a')](_0x53bb16['query'][_0xb435('0x4a')]);_0x1a3109[_0xb435('0x4b')]=qs['filters'](_['pick'](_0x53bb16[_0xb435('0x41')],_0x2ecd63['filters']));if(_0x53bb16[_0xb435('0x41')][_0xb435('0x4c')]){_0x1a3109[_0xb435('0x4b')]=_[_0xb435('0x4d')](_0x1a3109['where'],{'$or':_[_0xb435('0x3f')](_0x13df5e,function(_0x51d932){if(_0x51d932[_0xb435('0x4e')]!==_0xb435('0x4f')){var _0x1694c3={};_0x1694c3[_0x51d932[_0xb435('0x38')]]={'$like':'%'+_0x53bb16[_0xb435('0x41')]['filter']+'%'};return _0x1694c3;}})});}_0x1a3109=_[_0xb435('0x4d')]({},_0x1a3109,_0x53bb16[_0xb435('0x50')]);var _0x182f45={'where':_0x1a3109[_0xb435('0x4b')]};return db[_0xb435('0x51')]['count'](_0x182f45)[_0xb435('0x1f')](function(_0x3a6dcb){_0x50a8f1[_0xb435('0x2e')]=_0x3a6dcb;if(_0x53bb16[_0xb435('0x41')][_0xb435('0x52')]){_0x1a3109[_0xb435('0x53')]=[{'all':!![]}];}return db['Dynamics365Account'][_0xb435('0x54')](_0x1a3109);})[_0xb435('0x1f')](function(_0x51615d){_0x50a8f1[_0xb435('0x55')]=_0x51615d;return _0x50a8f1;})['then'](respondWithFilteredResult(_0x54dd1c,_0x1a3109))[_0xb435('0x56')](handleError(_0x54dd1c,null));};exports[_0xb435('0x57')]=function(_0x2f5ab7,_0x569125){var _0x3d0cef={'raw':![],'where':{'id':_0x2f5ab7['params']['id']}},_0x1c2cb3={};_0x1c2cb3['model']=_['keys'](db[_0xb435('0x51')]['rawAttributes']);_0x1c2cb3[_0xb435('0x41')]=_[_0xb435('0x40')](_0x2f5ab7[_0xb435('0x41')]);_0x1c2cb3[_0xb435('0x42')]=_[_0xb435('0x44')](_0x1c2cb3[_0xb435('0x3e')],_0x1c2cb3['query']);_0x3d0cef[_0xb435('0x43')]=_[_0xb435('0x44')](_0x1c2cb3[_0xb435('0x3e')],qs['fields'](_0x2f5ab7[_0xb435('0x41')][_0xb435('0x45')]));_0x3d0cef['attributes']=_0x3d0cef[_0xb435('0x43')][_0xb435('0x46')]?_0x3d0cef[_0xb435('0x43')]:_0x1c2cb3['model'];if(_0x2f5ab7[_0xb435('0x41')]['includeAll']){_0x3d0cef[_0xb435('0x53')]=[{'all':!![]}];}_0x3d0cef=_[_0xb435('0x4d')]({},_0x3d0cef,_0x2f5ab7['options']);return db[_0xb435('0x51')][_0xb435('0x58')](_0x3d0cef)['then'](handleEntityNotFound(_0x569125,null))[_0xb435('0x1f')](respondWithResult(_0x569125,null))['catch'](handleError(_0x569125,null));};exports[_0xb435('0x59')]=function(_0x3aca4b,_0x30d84b){return db[_0xb435('0x51')][_0xb435('0x59')](_0x3aca4b[_0xb435('0x5a')],{})[_0xb435('0x1f')](respondWithResult(_0x30d84b,0xc9))[_0xb435('0x56')](handleError(_0x30d84b,null));};exports[_0xb435('0x35')]=function(_0x448754,_0x278870){if(_0x448754['body']['id']){delete _0x448754['body']['id'];}return db[_0xb435('0x51')][_0xb435('0x58')]({'where':{'id':_0x448754[_0xb435('0x5b')]['id']}})[_0xb435('0x1f')](handleEntityNotFound(_0x278870,null))[_0xb435('0x1f')](saveUpdates(_0x448754[_0xb435('0x5a')],null))[_0xb435('0x1f')](respondWithResult(_0x278870,null))[_0xb435('0x56')](handleError(_0x278870,null));};exports[_0xb435('0x36')]=function(_0x1c7b47,_0x2d74ce){return db[_0xb435('0x51')][_0xb435('0x58')]({'where':{'id':_0x1c7b47[_0xb435('0x5b')]['id']}})[_0xb435('0x1f')](handleEntityNotFound(_0x2d74ce,null))[_0xb435('0x1f')](removeEntity(_0x2d74ce,null))[_0xb435('0x56')](handleError(_0x2d74ce,null));};exports['getConfigurations']=function(_0x576fa4,_0x15263c,_0x1c33a0){var _0x420302={};var _0x346e20={};var _0x5d3382;var _0x21176d;return db['Dynamics365Account'][_0xb435('0x5c')]({'where':{'id':_0x576fa4[_0xb435('0x5b')]['id']}})['then'](handleEntityNotFound(_0x15263c,null))['then'](function(_0x3a8f7d){if(_0x3a8f7d){_0x5d3382=_0x3a8f7d;_0x346e20[_0xb435('0x3e')]=_[_0xb435('0x40')](db[_0xb435('0x5d')][_0xb435('0x3b')]);_0x346e20[_0xb435('0x41')]=_[_0xb435('0x40')](_0x576fa4[_0xb435('0x41')]);_0x346e20[_0xb435('0x42')]=_['intersection'](_0x346e20['model'],_0x346e20[_0xb435('0x41')]);_0x420302['attributes']=_[_0xb435('0x44')](_0x346e20['model'],qs[_0xb435('0x45')](_0x576fa4['query'][_0xb435('0x45')]));_0x420302[_0xb435('0x43')]=_0x420302['attributes'][_0xb435('0x46')]?_0x420302[_0xb435('0x43')]:_0x346e20[_0xb435('0x3e')];_0x420302['order']=qs[_0xb435('0x4a')](_0x576fa4[_0xb435('0x41')][_0xb435('0x4a')]);_0x420302[_0xb435('0x4b')]=qs['filters'](_[_0xb435('0x5e')](_0x576fa4[_0xb435('0x41')],_0x346e20[_0xb435('0x42')]));if(_0x576fa4[_0xb435('0x41')][_0xb435('0x4c')]){_0x420302['where']=_[_0xb435('0x4d')](_0x420302[_0xb435('0x4b')],{'$or':_[_0xb435('0x3f')](_0x420302[_0xb435('0x43')],function(_0x2a2268){var _0x1869b={};_0x1869b[_0x2a2268]={'$like':'%'+_0x576fa4[_0xb435('0x41')][_0xb435('0x4c')]+'%'};return _0x1869b;})});}_0x420302=_[_0xb435('0x4d')]({},_0x420302,_0x576fa4[_0xb435('0x50')]);return _0x5d3382[_0xb435('0x5f')](_0x420302);}})[_0xb435('0x1f')](function(_0x3dab08){if(_0x3dab08){_0x21176d=_0x3dab08[_0xb435('0x46')];if(!_0x576fa4['query'][_0xb435('0x47')](_0xb435('0x48'))){_0x420302[_0xb435('0x30')]=qs[_0xb435('0x30')](_0x576fa4['query'][_0xb435('0x30')]);_0x420302[_0xb435('0x2f')]=qs['offset'](_0x576fa4['query'][_0xb435('0x2f')]);}return _0x5d3382[_0xb435('0x5f')](_0x420302);}})['then'](function(_0xe810bc){if(_0xe810bc){return _0xe810bc?{'count':_0x21176d,'rows':_0xe810bc}:null;}})[_0xb435('0x1f')](respondWithResult(_0x15263c,null))[_0xb435('0x56')](handleError(_0x15263c,null));};exports['addConfiguration']=function(_0x39fc64,_0x28681a,_0x498faf){if(_0x39fc64[_0xb435('0x5a')]['id']){delete _0x39fc64[_0xb435('0x5a')]['id'];}return db[_0xb435('0x51')][_0xb435('0x5c')]({'where':{'id':_0x39fc64[_0xb435('0x5b')]['id']}})['then'](handleEntityNotFound(_0x28681a,null))[_0xb435('0x1f')](function(_0x11a5b3){if(_0x11a5b3){_0x39fc64['body'][_0xb435('0x60')]=_0x11a5b3['id'];_0x39fc64[_0xb435('0x5a')]['Subjects']=integrations[_0xb435('0x61')](_0x39fc64[_0xb435('0x5a')][_0xb435('0x62')],_0x39fc64['body'][_0xb435('0x4e')]);_0x39fc64[_0xb435('0x5a')]['Descriptions']=integrations[_0xb435('0x63')](_0x39fc64['body'][_0xb435('0x62')],_0x39fc64[_0xb435('0x5a')][_0xb435('0x4e')]);return db[_0xb435('0x5d')]['create'](_0x39fc64[_0xb435('0x5a')],{'include':[{'model':db[_0xb435('0x64')],'as':_0xb435('0x65')},{'model':db['Dynamics365Field'],'as':_0xb435('0x66')}]});}return null;})[_0xb435('0x1f')](respondWithResult(_0x28681a,null))[_0xb435('0x56')](handleError(_0x28681a,null));};exports[_0xb435('0x67')]=function(_0x51df2f,_0xd207fa,_0x54eaa2){var _0x40b752=_0x51df2f[_0xb435('0x41')]['ticketType'];var _0x1484ad=_0x40b752===_0xb435('0x68')?'Incident':'PhoneCall';var _0x2be538='';var _0x2c19c8='';var _0x2304c4='';var _0x138882='';var _0x56af68='';var _0x23fae2='';var _0x4eb712='';var _0x28ef6f='';var _0x4dfd62=[_0xb435('0x69'),'description','customerid',_0xb435('0x6a'),'caseorigincode',_0xb435('0x6b'),'phonenumber',_0xb435('0x6c'),'directioncode',_0xb435('0x6d')];var _0x116241=['accountidname',_0xb435('0x6e'),'actualserviceunits','billedserviceunits',_0xb435('0x6f'),_0xb435('0x70'),'contractdetailidname','contractidname',_0xb435('0x71'),'createdbyexternalpartyyominame',_0xb435('0x72'),'createdbyyominame',_0xb435('0x73'),_0xb435('0x74'),_0xb435('0x75'),_0xb435('0x76'),_0xb435('0x77'),_0xb435('0x78'),_0xb435('0x79'),'entitlementidname',_0xb435('0x7a'),_0xb435('0x7b'),_0xb435('0x7c'),'exchangerate',_0xb435('0x7d'),_0xb435('0x7e'),_0xb435('0x7f'),_0xb435('0x80'),'kbarticleidname',_0xb435('0x81'),'masteridname',_0xb435('0x82'),_0xb435('0x83'),_0xb435('0x84'),_0xb435('0x85'),_0xb435('0x86'),'modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename',_0xb435('0x87'),_0xb435('0x88'),'onholdtime',_0xb435('0x89'),_0xb435('0x8a'),_0xb435('0x8b'),_0xb435('0x8c'),_0xb435('0x8d'),_0xb435('0x8e'),'primarycontactidyominame','prioritycodename',_0xb435('0x8f'),_0xb435('0x90'),_0xb435('0x91'),_0xb435('0x92'),_0xb435('0x93'),_0xb435('0x94'),_0xb435('0x95'),_0xb435('0x96'),'slainvokedidname',_0xb435('0x97'),_0xb435('0x98'),_0xb435('0x99'),_0xb435('0x9a'),'subjectidname',_0xb435('0x9b'),_0xb435('0x9c'),_0xb435('0x9d'),_0xb435('0x9e'),_0xb435('0x9f'),_0xb435('0xa0')];var _0x37b814=_0x4dfd62[_0xb435('0xa1')](_0x116241);return db[_0xb435('0x51')]['findOne']({'where':{'id':_0x51df2f[_0xb435('0x5b')]['id']},'attributes':['id',_0xb435('0xa2'),_0xb435('0xa3'),_0xb435('0xa4'),_0xb435('0xa5'),_0xb435('0xa6'),'clientSecret']})[_0xb435('0x1f')](handleEntityNotFound(_0xd207fa,null))['then'](function(_0x1afe62){if(_0x1afe62){_0x28ef6f=_0x1afe62[_0xb435('0xa4')];var _0x75a78d=_0x28ef6f['slice'](-0x1);if(_0x75a78d==='/'){_0x28ef6f=_0x28ef6f['substring'](0x0,_0x28ef6f[_0xb435('0xa7')](_0x75a78d));}_0x4eb712=util['format']('%s/api/data/v9.0/',_0x28ef6f);var _0x5446c3={'method':_0xb435('0xa8'),'uri':'https://login.microsoftonline.com/'+_0x1afe62[_0xb435('0xa5')]+_0xb435('0xa9'),'form':{'client_id':_0x1afe62[_0xb435('0xa6')],'resource':_0x28ef6f,'username':_0x1afe62['username'],'password':_0x1afe62[_0xb435('0xa3')],'grant_type':'password','client_secret':_0x1afe62[_0xb435('0xaa')]},'json':!![]};return rp(_0x5446c3);}})[_0xb435('0x1f')](function(_0x57ae06){_0x23fae2=_0x57ae06['access_token'];var _0x22b808={'method':_0xb435('0xab'),'uri':encodeURI(_0x4eb712+_0xb435('0xac')+_0x1484ad+'\x27'),'headers':{'Authorization':_0xb435('0xad')+_0x23fae2,'If-None-Match':null,'OData-Version':_0xb435('0xae')},'json':!![]};return rp(_0x22b808);})['then'](function(_0x3ddaa1){var _0x53f50e=_0x3ddaa1[_0xb435('0xaf')][0x0];var _0x487d82=_0x53f50e[_0xb435('0xb0')];var _0x2c25aa={'method':_0xb435('0xab'),'uri':_0x4eb712+_0xb435('0xb1')+_0x487d82+_0xb435('0xb2'),'headers':{'Authorization':_0xb435('0xad')+_0x23fae2,'If-None-Match':null,'OData-Version':_0xb435('0xae')},'json':!![]};return rp(_0x2c25aa);})['then'](function(_0x4c9d70){_0x2be538=_0x4c9d70;_0x2c19c8=_0x2be538[_0xb435('0xb3')];_0x2c19c8=_['remove'](_0x2c19c8,function(_0x28907c){return!_0x37b814[_0xb435('0xb4')](_0x28907c[_0xb435('0xb5')]);});var _0x3fd160=[];var _0x11c84a=[];_0x2c19c8[_0xb435('0xb6')](function(_0x4de635){if(_0x4de635[_0xb435('0xb7')]){var _0x59250d=_0x4de635[_0xb435('0xb7')][_0xb435('0xb8')](_0x4de635['@odata.type'][_0xb435('0xa7')]('.')+0x1);if(_0x59250d===_0xb435('0xb9')){_0x3fd160[_0xb435('0xba')](getSelectList(_0x4eb712,_0x40b752,_0x11c84a,_0x2be538[_0xb435('0xb0')],_0x4de635[_0xb435('0xb0')],_0x23fae2));}}});return Promise[_0xb435('0xbb')](_0x3fd160);})[_0xb435('0x1f')](function(_0x363c37){_0x2304c4=_0x363c37[0x0];var _0x26cccf=[];var _0xff561f=[];_0x2c19c8[_0xb435('0xb6')](function(_0x4e7658){if(!_[_0xb435('0xbc')](_0x4e7658['@odata.type'])){var _0x577bbb=_0x4e7658['@odata.type'][_0xb435('0xb8')](_0x4e7658['@odata.type']['lastIndexOf']('.')+0x1);if(_0x577bbb===_0xb435('0xbd')){_0x26cccf['push'](getBooleanList(_0x4eb712,_0x40b752,_0xff561f,_0x2be538[_0xb435('0xb0')],_0x4e7658[_0xb435('0xb0')],_0x23fae2));}}});return Promise['all'](_0x26cccf);})[_0xb435('0x1f')](function(_0x4246b5){_0x138882=_0x4246b5[0x0];var _0x2eb483=[];var _0x284169=[];_0x2c19c8[_0xb435('0xb6')](function(_0x5d9ce5){if(_0x5d9ce5[_0xb435('0xb7')]){var _0x7c6762=_0x5d9ce5[_0xb435('0xb7')][_0xb435('0xb8')](_0x5d9ce5[_0xb435('0xb7')]['lastIndexOf']('.')+0x1);if(_0x7c6762===_0xb435('0xbe')||_0x7c6762==='DoubleAttributeMetadata'||_0x7c6762===_0xb435('0xbf')||_0x7c6762===_0xb435('0xc0')||_0x7c6762===_0xb435('0xc1')||_0x7c6762==='DateTimeAttributeMetadata'||_0x7c6762===_0xb435('0xc2')||_0x7c6762===_0xb435('0xc3')||_0x7c6762===_0xb435('0xc4')||_0x7c6762===_0xb435('0xc5')){_0x2eb483['push'](getInputList(_0x4eb712,_0x40b752,_0x7c6762,_0x284169,_0x2be538[_0xb435('0xb0')],_0x5d9ce5['MetadataId'],_0x23fae2));}}});return Promise['all'](_0x2eb483);})[_0xb435('0x1f')](function(_0x5d29d1){_0x56af68=_0x5d29d1[0x0];var _0x3c4a18=_0x2304c4[_0xb435('0xa1')](_0x138882)[_0xb435('0xa1')](_0x56af68);var _0x12c191={'count':_0x3c4a18['length'],'rows':_0x3c4a18};return _0x12c191;})['then'](respondWithResult(_0xd207fa,null))['catch'](function(_0x32bd3c){var _0x339150=_0x51df2f[_0xb435('0x41')]['test']?0x1f4:_0x32bd3c[_0xb435('0xc6')]||0x1f4;logger['error'](_0x32bd3c[_0xb435('0x37')]);delete _0x32bd3c['name'];if(_0x339150===0x191){_0x339150=0x190;}_0xd207fa[_0xb435('0x2b')](_0x339150)[_0xb435('0x39')](_0x51df2f['query'][_0xb435('0x1a')]?{'message':_0xb435('0xc7'),'statusCode':_0x32bd3c[_0xb435('0xc6')]}:_0x32bd3c);});};function getSelectList(_0x1a1a30,_0x5ef439,_0x4e9f34,_0x299b8b,_0x11f2e7,_0x4a1fb5){var _0xa53a2c={'method':'GET','uri':_0x1a1a30+_0xb435('0xb1')+_0x299b8b+_0xb435('0xc8')+_0x11f2e7+_0xb435('0xc9')+'$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','headers':{'Authorization':_0xb435('0xad')+_0x4a1fb5,'If-None-Match':null,'OData-Version':_0xb435('0xae')},'json':!![]};return rp(_0xa53a2c)['then'](function(_0x1d3cae){var _0xbd61=[];var _0x3fb064=_0x1d3cae['OptionSet']['Options'];_0x3fb064['forEach'](function(_0x4cb305){_0xbd61[_0xb435('0xba')]({'name':_0x4cb305[_0xb435('0xca')]['UserLocalizedLabel'][_0xb435('0xca')],'value':String(_0x4cb305[_0xb435('0xcb')])});});var _0x518e04={'id':_0x5ef439+'_'+_0x1d3cae['LogicalName'],'name':_0x1d3cae[_0xb435('0xcc')][_0xb435('0xcd')][_0xb435('0xca')],'custom':![],'options':_0xbd61};_0x4e9f34[_0xb435('0xba')](_0x518e04);return _0x4e9f34;});}function getBooleanList(_0x1a1ad0,_0x2674f3,_0x40be81,_0x2da5d9,_0x13e24b,_0x230aa0){var _0x14cb10={'method':_0xb435('0xab'),'uri':_0x1a1ad0+'EntityDefinitions('+_0x2da5d9+_0xb435('0xc8')+_0x13e24b+_0xb435('0xce'),'headers':{'Authorization':'Bearer\x20'+_0x230aa0,'If-None-Match':null,'OData-Version':_0xb435('0xae')},'json':!![]};return rp(_0x14cb10)[_0xb435('0x1f')](function(_0x239cf7){var _0x1ff75d=[];_0x1ff75d[_0xb435('0xba')]({'name':_0x239cf7[_0xb435('0xcf')][_0xb435('0xd0')][_0xb435('0xca')][_0xb435('0xcd')]['Label'],'value':_0xb435('0xd1')},{'name':_0x239cf7[_0xb435('0xcf')][_0xb435('0xd2')][_0xb435('0xca')][_0xb435('0xcd')]['Label'],'value':_0xb435('0xd3')});var _0x1e261e={'id':_0x2674f3+'_'+_0x239cf7[_0xb435('0xb5')],'name':_0x239cf7[_0xb435('0xcc')]['UserLocalizedLabel'][_0xb435('0xca')],'custom':![],'options':_0x1ff75d};_0x40be81['push'](_0x1e261e);return _0x40be81;});}function getInputList(_0x3d1d81,_0x12299e,_0x52cea5,_0x888ac8,_0xa55582,_0x1b5e7f,_0x324732){var _0x33893e={'method':_0xb435('0xab'),'uri':_0x3d1d81+'EntityDefinitions('+_0xa55582+_0xb435('0xc8')+_0x1b5e7f+')/Microsoft.Dynamics.CRM.'+_0x52cea5+'?$select=DisplayName,LogicalName','headers':{'Authorization':_0xb435('0xad')+_0x324732,'If-None-Match':null,'OData-Version':_0xb435('0xae')},'json':!![]};return rp(_0x33893e)['then'](function(_0x335b5e){var _0x58c5d5={'id':_0x12299e+'_'+_0x335b5e[_0xb435('0xb5')],'name':_0x335b5e[_0xb435('0xcc')][_0xb435('0xcd')]?_0x335b5e[_0xb435('0xcc')][_0xb435('0xcd')]['Label']:_0x335b5e[_0xb435('0xb5')],'custom':![],'options':[]};_0x888ac8['push'](_0x58c5d5);return _0x888ac8;});} \ No newline at end of file +var _0x0457=['productserialnumber','resolveby','resolvebykpiidname','responseby','responsiblecontactidname','responsiblecontactidyominame','slainvokedidname','slaname','socialprofileidname','statecode','statuscode','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','utcconversiontimezonecode','concat','username','password','clientId','remoteUri','slice','substring','format','POST','tenantId','/oauth2/token','clientSecret','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','includes','forEach','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','BooleanAttributeMetadata','StringAttributeMetadata','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','stack','Wrong\x20credentials',')/Attributes(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Label','Value','LogicalName','DisplayName',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','UserLocalizedLabel','true','FalseOption','false','?$select=DisplayName,LogicalName','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','sendStatus','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','name','send','index','map','Dynamics365Account','rawAttributes','fieldName','type','query','attributes','intersection','model','fields','length','hasOwnProperty','order','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','keys','find','body','getConfigurations','Dynamics365Configuration','sort','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','create','Dynamics365Field','getFields','ticketType','incident','Incident','PhoneCall','description','customerid','ownerid','subject','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','actualserviceunits','billedserviceunits','contactidname','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyname','createdbyyominame','createdon','createdonbehalfbyyominame','customeridtype','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','exchangerate','followupby','influencescore','kbarticleidname','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedon','modifiedonbehalfbyyominame','msdyn_incidenttypename','msdyn_iotalertname','numberofchildincidents','onholdtime','owneridname','owneridtype','owneridyominame','primarycontactidyominame','prioritycodename'];(function(_0x48ccc1,_0x55e9cb){var _0x9ffe13=function(_0x323a36){while(--_0x323a36){_0x48ccc1['push'](_0x48ccc1['shift']());}};_0x9ffe13(++_0x55e9cb);}(_0x0457,0x11f));var _0x7045=function(_0x1fc4b8,_0x56613e){_0x1fc4b8=_0x1fc4b8-0x0;var _0x160ab5=_0x0457[_0x1fc4b8];return _0x160ab5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7045('0x0'));var rimraf=require(_0x7045('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7045('0x2'));var rp=require(_0x7045('0x3'));var moment=require(_0x7045('0x4'));var BPromise=require(_0x7045('0x5'));var Mustache=require(_0x7045('0x6'));var util=require(_0x7045('0x7'));var path=require('path');var sox=require(_0x7045('0x8'));var csv=require('to-csv');var ejs=require(_0x7045('0x9'));var fs=require('fs');var _=require(_0x7045('0xa'));var squel=require(_0x7045('0xb'));var crypto=require(_0x7045('0xc'));var jsforce=require(_0x7045('0xd'));var deskjs=require(_0x7045('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7045('0xf'));var Redis=require(_0x7045('0x10'));var authService=require(_0x7045('0x11'));var qs=require(_0x7045('0x12'));var as=require(_0x7045('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7045('0x14'))(_0x7045('0x15'));var utils=require(_0x7045('0x16'));var config=require(_0x7045('0x17'));var db=require(_0x7045('0x18'))['db'];var integrations=require(_0x7045('0x19'));var jayson=require(_0x7045('0x1a'));var client=jayson['client'][_0x7045('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x1b6043,_0x59eaa2,_0x568261){if(_0x568261){var _0x426243=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x426243[_0x7045('0x1c')](_0x59eaa2)){return _0x1b6043;}else{throw new db['Sequelize'][(_0x7045('0x1d'))](_0x7045('0x1e'));}}else{return _0x1b6043;}}function respondWithRpcPromise(_0x364b86,_0x38c059,_0xb8fdae,_0x50ede5){return new BPromise(function(_0x38aaa6,_0x231c1c){var _0xeb6cfd=_0x50ede5||client;return _0xeb6cfd[_0x7045('0x1f')](_0x364b86,_0xb8fdae)[_0x7045('0x20')](function(_0x1d1e30){logger[_0x7045('0x21')](_0x7045('0x22'),_0x38c059,_0x7045('0x23'));logger[_0x7045('0x24')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x38c059,'request\x20sent',JSON[_0x7045('0x25')](_0x1d1e30));if(_0x1d1e30[_0x7045('0x26')]){if(_0x1d1e30[_0x7045('0x26')][_0x7045('0x27')]===0x1f4){logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x38c059,_0x1d1e30[_0x7045('0x26')][_0x7045('0x28')]);return _0x231c1c(_0x1d1e30[_0x7045('0x26')]['message']);}logger[_0x7045('0x26')](_0x7045('0x22'),_0x38c059,_0x1d1e30['error'][_0x7045('0x28')]);return _0x38aaa6(_0x1d1e30[_0x7045('0x26')]['message']);}else{logger[_0x7045('0x21')](_0x7045('0x22'),_0x38c059,_0x7045('0x23'));_0x38aaa6(_0x1d1e30[_0x7045('0x29')]['message']);}})['catch'](function(_0x3b66c8){logger[_0x7045('0x26')](_0x7045('0x22'),_0x38c059,_0x3b66c8);_0x231c1c(_0x3b66c8);});});}function respondWithStatusCode(_0x1694bf,_0x54508a){_0x54508a=_0x54508a||0xcc;return function(_0x138281){if(_0x138281){return _0x1694bf[_0x7045('0x2a')](_0x54508a);}return _0x1694bf['status'](_0x54508a)[_0x7045('0x2b')]();};}function respondWithResult(_0xace1f0,_0x38658e){_0x38658e=_0x38658e||0xc8;return function(_0xc97840){if(_0xc97840){return _0xace1f0['status'](_0x38658e)[_0x7045('0x2c')](_0xc97840);}};}function respondWithFilteredResult(_0x349010,_0x37b288){return function(_0x2e7e65){if(_0x2e7e65){var _0x2628d0=_0x2e7e65[_0x7045('0x2d')],_0x297a4d=_0x37b288[_0x7045('0x2e')],_0x109a88=_0x37b288[_0x7045('0x2e')]+_0x37b288[_0x7045('0x2f')],_0x4e078b;if(_0x109a88>=_0x2628d0){_0x109a88=_0x2628d0;_0x4e078b=0xc8;}else{_0x4e078b=0xce;}_0x349010[_0x7045('0x30')](_0x4e078b);return _0x349010['set'](_0x7045('0x31'),_0x297a4d+'-'+_0x109a88+'/'+_0x2628d0)[_0x7045('0x2c')](_0x2e7e65);}return null;};}function patchUpdates(_0x5e7909){return function(_0x4bced3){try{jsonpatch['apply'](_0x4bced3,_0x5e7909,!![]);}catch(_0x53440d){return BPromise[_0x7045('0x32')](_0x53440d);}return _0x4bced3[_0x7045('0x33')]();};}function saveUpdates(_0x179a05,_0x574f9f){return function(_0x1a794f){if(_0x1a794f){return _0x1a794f[_0x7045('0x34')](_0x179a05)[_0x7045('0x20')](function(_0x3fa97a){return _0x3fa97a;});}return null;};}function removeEntity(_0x5cca6e,_0x366454){return function(_0x150a06){if(_0x150a06){return _0x150a06[_0x7045('0x35')]()['then'](function(){_0x5cca6e[_0x7045('0x30')](0xcc)[_0x7045('0x2b')]();});}};}function handleEntityNotFound(_0x30d88c,_0x12c024){return function(_0x1f31d8){if(!_0x1f31d8){_0x30d88c[_0x7045('0x2a')](0x194);}return _0x1f31d8;};}function handleError(_0x439ac8,_0x596b70){_0x596b70=_0x596b70||0x1f4;return function(_0x59a187){logger[_0x7045('0x26')](_0x59a187['stack']);if(_0x59a187[_0x7045('0x36')]){delete _0x59a187[_0x7045('0x36')];}_0x439ac8['status'](_0x596b70)[_0x7045('0x37')](_0x59a187);};}exports[_0x7045('0x38')]=function(_0x5c503a,_0x1f7ddb){var _0x2a2814={},_0x231565={},_0x3bd14={'count':0x0,'rows':[]};var _0xbb438c=_[_0x7045('0x39')](db[_0x7045('0x3a')][_0x7045('0x3b')],function(_0x223fd){return{'name':_0x223fd[_0x7045('0x3c')],'type':_0x223fd[_0x7045('0x3d')]['key']};});_0x231565['model']=_[_0x7045('0x39')](_0xbb438c,_0x7045('0x36'));_0x231565[_0x7045('0x3e')]=_['keys'](_0x5c503a['query']);_0x231565['filters']=_['intersection'](_0x231565['model'],_0x231565[_0x7045('0x3e')]);_0x2a2814[_0x7045('0x3f')]=_[_0x7045('0x40')](_0x231565[_0x7045('0x41')],qs[_0x7045('0x42')](_0x5c503a[_0x7045('0x3e')][_0x7045('0x42')]));_0x2a2814[_0x7045('0x3f')]=_0x2a2814[_0x7045('0x3f')][_0x7045('0x43')]?_0x2a2814[_0x7045('0x3f')]:_0x231565[_0x7045('0x41')];if(!_0x5c503a[_0x7045('0x3e')][_0x7045('0x44')]('nolimit')){_0x2a2814[_0x7045('0x2f')]=qs[_0x7045('0x2f')](_0x5c503a[_0x7045('0x3e')][_0x7045('0x2f')]);_0x2a2814[_0x7045('0x2e')]=qs[_0x7045('0x2e')](_0x5c503a['query'][_0x7045('0x2e')]);}_0x2a2814[_0x7045('0x45')]=qs['sort'](_0x5c503a[_0x7045('0x3e')]['sort']);_0x2a2814[_0x7045('0x46')]=qs[_0x7045('0x47')](_[_0x7045('0x48')](_0x5c503a[_0x7045('0x3e')],_0x231565['filters']));if(_0x5c503a[_0x7045('0x3e')][_0x7045('0x49')]){_0x2a2814[_0x7045('0x46')]=_[_0x7045('0x4a')](_0x2a2814[_0x7045('0x46')],{'$or':_[_0x7045('0x39')](_0xbb438c,function(_0x5e42bb){if(_0x5e42bb[_0x7045('0x3d')]!==_0x7045('0x4b')){var _0x2352ee={};_0x2352ee[_0x5e42bb['name']]={'$like':'%'+_0x5c503a[_0x7045('0x3e')][_0x7045('0x49')]+'%'};return _0x2352ee;}})});}_0x2a2814=_['merge']({},_0x2a2814,_0x5c503a[_0x7045('0x4c')]);var _0x400db0={'where':_0x2a2814['where']};return db['Dynamics365Account']['count'](_0x400db0)[_0x7045('0x20')](function(_0x5e87de){_0x3bd14[_0x7045('0x2d')]=_0x5e87de;if(_0x5c503a['query'][_0x7045('0x4d')]){_0x2a2814[_0x7045('0x4e')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x7045('0x4f')](_0x2a2814);})[_0x7045('0x20')](function(_0x49d10d){_0x3bd14[_0x7045('0x50')]=_0x49d10d;return _0x3bd14;})[_0x7045('0x20')](respondWithFilteredResult(_0x1f7ddb,_0x2a2814))[_0x7045('0x51')](handleError(_0x1f7ddb,null));};exports[_0x7045('0x52')]=function(_0x3ab982,_0x26da26){var _0x24d265={'raw':![],'where':{'id':_0x3ab982[_0x7045('0x53')]['id']}},_0x79cd38={};_0x79cd38[_0x7045('0x41')]=_[_0x7045('0x54')](db[_0x7045('0x3a')]['rawAttributes']);_0x79cd38[_0x7045('0x3e')]=_[_0x7045('0x54')](_0x3ab982['query']);_0x79cd38['filters']=_[_0x7045('0x40')](_0x79cd38[_0x7045('0x41')],_0x79cd38[_0x7045('0x3e')]);_0x24d265[_0x7045('0x3f')]=_[_0x7045('0x40')](_0x79cd38[_0x7045('0x41')],qs[_0x7045('0x42')](_0x3ab982[_0x7045('0x3e')][_0x7045('0x42')]));_0x24d265[_0x7045('0x3f')]=_0x24d265[_0x7045('0x3f')][_0x7045('0x43')]?_0x24d265['attributes']:_0x79cd38['model'];if(_0x3ab982[_0x7045('0x3e')][_0x7045('0x4d')]){_0x24d265[_0x7045('0x4e')]=[{'all':!![]}];}_0x24d265=_[_0x7045('0x4a')]({},_0x24d265,_0x3ab982['options']);return db[_0x7045('0x3a')][_0x7045('0x55')](_0x24d265)[_0x7045('0x20')](handleEntityNotFound(_0x26da26,null))[_0x7045('0x20')](respondWithResult(_0x26da26,null))['catch'](handleError(_0x26da26,null));};exports['create']=function(_0x413340,_0x4e53df){return db[_0x7045('0x3a')]['create'](_0x413340[_0x7045('0x56')],{})['then'](respondWithResult(_0x4e53df,0xc9))[_0x7045('0x51')](handleError(_0x4e53df,null));};exports['update']=function(_0xc9c5ab,_0x34e905){if(_0xc9c5ab[_0x7045('0x56')]['id']){delete _0xc9c5ab['body']['id'];}return db[_0x7045('0x3a')][_0x7045('0x55')]({'where':{'id':_0xc9c5ab[_0x7045('0x53')]['id']}})['then'](handleEntityNotFound(_0x34e905,null))[_0x7045('0x20')](saveUpdates(_0xc9c5ab[_0x7045('0x56')],null))[_0x7045('0x20')](respondWithResult(_0x34e905,null))[_0x7045('0x51')](handleError(_0x34e905,null));};exports[_0x7045('0x35')]=function(_0x456a30,_0x27c90d){return db[_0x7045('0x3a')]['find']({'where':{'id':_0x456a30[_0x7045('0x53')]['id']}})[_0x7045('0x20')](handleEntityNotFound(_0x27c90d,null))['then'](removeEntity(_0x27c90d,null))['catch'](handleError(_0x27c90d,null));};exports[_0x7045('0x57')]=function(_0x14d392,_0x323696,_0x5757ae){var _0x446dc0={};var _0x1fc6e7={};var _0x3b9beb;var _0x2eca3e;return db[_0x7045('0x3a')]['findOne']({'where':{'id':_0x14d392['params']['id']}})['then'](handleEntityNotFound(_0x323696,null))[_0x7045('0x20')](function(_0x2bf3bf){if(_0x2bf3bf){_0x3b9beb=_0x2bf3bf;_0x1fc6e7[_0x7045('0x41')]=_[_0x7045('0x54')](db[_0x7045('0x58')]['rawAttributes']);_0x1fc6e7[_0x7045('0x3e')]=_[_0x7045('0x54')](_0x14d392[_0x7045('0x3e')]);_0x1fc6e7[_0x7045('0x47')]=_['intersection'](_0x1fc6e7[_0x7045('0x41')],_0x1fc6e7[_0x7045('0x3e')]);_0x446dc0[_0x7045('0x3f')]=_[_0x7045('0x40')](_0x1fc6e7[_0x7045('0x41')],qs['fields'](_0x14d392[_0x7045('0x3e')][_0x7045('0x42')]));_0x446dc0[_0x7045('0x3f')]=_0x446dc0[_0x7045('0x3f')][_0x7045('0x43')]?_0x446dc0[_0x7045('0x3f')]:_0x1fc6e7['model'];_0x446dc0[_0x7045('0x45')]=qs[_0x7045('0x59')](_0x14d392['query']['sort']);_0x446dc0['where']=qs[_0x7045('0x47')](_[_0x7045('0x48')](_0x14d392[_0x7045('0x3e')],_0x1fc6e7[_0x7045('0x47')]));if(_0x14d392[_0x7045('0x3e')][_0x7045('0x49')]){_0x446dc0[_0x7045('0x46')]=_[_0x7045('0x4a')](_0x446dc0[_0x7045('0x46')],{'$or':_['map'](_0x446dc0[_0x7045('0x3f')],function(_0x9bb2a3){var _0x2b420e={};_0x2b420e[_0x9bb2a3]={'$like':'%'+_0x14d392[_0x7045('0x3e')][_0x7045('0x49')]+'%'};return _0x2b420e;})});}_0x446dc0=_[_0x7045('0x4a')]({},_0x446dc0,_0x14d392[_0x7045('0x4c')]);return _0x3b9beb[_0x7045('0x57')](_0x446dc0);}})[_0x7045('0x20')](function(_0x45639c){if(_0x45639c){_0x2eca3e=_0x45639c['length'];if(!_0x14d392[_0x7045('0x3e')][_0x7045('0x44')]('nolimit')){_0x446dc0[_0x7045('0x2f')]=qs['limit'](_0x14d392['query'][_0x7045('0x2f')]);_0x446dc0[_0x7045('0x2e')]=qs[_0x7045('0x2e')](_0x14d392[_0x7045('0x3e')][_0x7045('0x2e')]);}return _0x3b9beb[_0x7045('0x57')](_0x446dc0);}})[_0x7045('0x20')](function(_0x4522b4){if(_0x4522b4){return _0x4522b4?{'count':_0x2eca3e,'rows':_0x4522b4}:null;}})[_0x7045('0x20')](respondWithResult(_0x323696,null))[_0x7045('0x51')](handleError(_0x323696,null));};exports[_0x7045('0x5a')]=function(_0x1bb649,_0x12c2d5,_0xa09542){if(_0x1bb649[_0x7045('0x56')]['id']){delete _0x1bb649['body']['id'];}return db[_0x7045('0x3a')][_0x7045('0x5b')]({'where':{'id':_0x1bb649[_0x7045('0x53')]['id']}})[_0x7045('0x20')](handleEntityNotFound(_0x12c2d5,null))[_0x7045('0x20')](function(_0xb703f0){if(_0xb703f0){_0x1bb649[_0x7045('0x56')][_0x7045('0x5c')]=_0xb703f0['id'];_0x1bb649[_0x7045('0x56')][_0x7045('0x5d')]=integrations[_0x7045('0x5e')](_0x1bb649[_0x7045('0x56')][_0x7045('0x5f')],_0x1bb649[_0x7045('0x56')]['type']);_0x1bb649['body'][_0x7045('0x60')]=integrations[_0x7045('0x61')](_0x1bb649[_0x7045('0x56')][_0x7045('0x5f')],_0x1bb649['body'][_0x7045('0x3d')]);return db[_0x7045('0x58')][_0x7045('0x62')](_0x1bb649[_0x7045('0x56')],{'include':[{'model':db[_0x7045('0x63')],'as':_0x7045('0x5d')},{'model':db[_0x7045('0x63')],'as':_0x7045('0x60')}]});}return null;})['then'](respondWithResult(_0x12c2d5,null))[_0x7045('0x51')](handleError(_0x12c2d5,null));};exports[_0x7045('0x64')]=function(_0x5ab822,_0x952664,_0x5d9205){var _0x3230b8=_0x5ab822[_0x7045('0x3e')][_0x7045('0x65')];var _0x12d6e8=_0x3230b8===_0x7045('0x66')?_0x7045('0x67'):_0x7045('0x68');var _0x2d4059='';var _0x5f2043='';var _0x3e1817='';var _0x1441a9='';var _0x488b4f='';var _0x160362='';var _0x3afb5e='';var _0x5b9861='';var _0x549cc3=['title',_0x7045('0x69'),_0x7045('0x6a'),_0x7045('0x6b'),'caseorigincode',_0x7045('0x6c'),_0x7045('0x6d'),_0x7045('0x6e'),_0x7045('0x6f'),_0x7045('0x70')];var _0x326456=[_0x7045('0x71'),'accountidyominame',_0x7045('0x72'),_0x7045('0x73'),_0x7045('0x74'),'contactidyominame',_0x7045('0x75'),'contractidname',_0x7045('0x76'),_0x7045('0x77'),_0x7045('0x78'),_0x7045('0x79'),_0x7045('0x7a'),'createdonbehalfbyname',_0x7045('0x7b'),'customeridname',_0x7045('0x7c'),'customeridyominame',_0x7045('0x7d'),_0x7045('0x7e'),_0x7045('0x7f'),_0x7045('0x80'),'escalatedon',_0x7045('0x81'),'firstresponsebykpiidname',_0x7045('0x82'),'importsequencenumber',_0x7045('0x83'),_0x7045('0x84'),'lastonholdtime',_0x7045('0x85'),_0x7045('0x86'),_0x7045('0x87'),'modifiedbyname','modifiedbyyominame',_0x7045('0x88'),'modifiedonbehalfbyname',_0x7045('0x89'),_0x7045('0x8a'),_0x7045('0x8b'),_0x7045('0x8c'),_0x7045('0x8d'),'overriddencreatedon',_0x7045('0x8e'),_0x7045('0x8f'),_0x7045('0x90'),'parentcaseidname','primarycontactidname',_0x7045('0x91'),_0x7045('0x92'),'productidname',_0x7045('0x93'),_0x7045('0x94'),_0x7045('0x95'),_0x7045('0x96'),_0x7045('0x97'),_0x7045('0x98'),'sentimentvalue',_0x7045('0x99'),_0x7045('0x9a'),_0x7045('0x9b'),_0x7045('0x9c'),_0x7045('0x9d'),'subjectidname',_0x7045('0x9e'),_0x7045('0x9f'),_0x7045('0xa0'),'traversedpath',_0x7045('0xa1'),'versionnumber'];var _0xf2a9b1=_0x549cc3[_0x7045('0xa2')](_0x326456);return db['Dynamics365Account']['findOne']({'where':{'id':_0x5ab822[_0x7045('0x53')]['id']},'attributes':['id',_0x7045('0xa3'),_0x7045('0xa4'),'remoteUri','tenantId',_0x7045('0xa5'),'clientSecret']})['then'](handleEntityNotFound(_0x952664,null))[_0x7045('0x20')](function(_0x4c5545){if(_0x4c5545){_0x5b9861=_0x4c5545[_0x7045('0xa6')];var _0x42661a=_0x5b9861[_0x7045('0xa7')](-0x1);if(_0x42661a==='/'){_0x5b9861=_0x5b9861[_0x7045('0xa8')](0x0,_0x5b9861['lastIndexOf'](_0x42661a));}_0x3afb5e=util[_0x7045('0xa9')]('%s/api/data/v9.0/',_0x5b9861);var _0x3ebad6={'method':_0x7045('0xaa'),'uri':'https://login.microsoftonline.com/'+_0x4c5545[_0x7045('0xab')]+_0x7045('0xac'),'form':{'client_id':_0x4c5545[_0x7045('0xa5')],'resource':_0x5b9861,'username':_0x4c5545[_0x7045('0xa3')],'password':_0x4c5545[_0x7045('0xa4')],'grant_type':'password','client_secret':_0x4c5545[_0x7045('0xad')]},'json':!![]};return rp(_0x3ebad6);}})[_0x7045('0x20')](function(_0xf11921){_0x160362=_0xf11921[_0x7045('0xae')];var _0x5313e1={'method':_0x7045('0xaf'),'uri':encodeURI(_0x3afb5e+_0x7045('0xb0')+_0x12d6e8+'\x27'),'headers':{'Authorization':_0x7045('0xb1')+_0x160362,'If-None-Match':null,'OData-Version':_0x7045('0xb2')},'json':!![]};return rp(_0x5313e1);})['then'](function(_0x202d51){var _0x5f3e42=_0x202d51[_0x7045('0xb3')][0x0];var _0x5217c3=_0x5f3e42[_0x7045('0xb4')];var _0x8c0954={'method':_0x7045('0xaf'),'uri':_0x3afb5e+_0x7045('0xb5')+_0x5217c3+_0x7045('0xb6'),'headers':{'Authorization':_0x7045('0xb1')+_0x160362,'If-None-Match':null,'OData-Version':_0x7045('0xb2')},'json':!![]};return rp(_0x8c0954);})[_0x7045('0x20')](function(_0x319b98){_0x2d4059=_0x319b98;_0x5f2043=_0x2d4059['Attributes'];_0x5f2043=_[_0x7045('0xb7')](_0x5f2043,function(_0x51cd6b){return!_0xf2a9b1[_0x7045('0xb8')](_0x51cd6b['LogicalName']);});var _0x3ccfaa=[];var _0x49e13c=[];_0x5f2043[_0x7045('0xb9')](function(_0xcd3f4f){if(_0xcd3f4f[_0x7045('0xba')]){var _0x10aba1=_0xcd3f4f[_0x7045('0xba')][_0x7045('0xa8')](_0xcd3f4f[_0x7045('0xba')][_0x7045('0xbb')]('.')+0x1);if(_0x10aba1===_0x7045('0xbc')){_0x3ccfaa[_0x7045('0xbd')](getSelectList(_0x3afb5e,_0x3230b8,_0x49e13c,_0x2d4059[_0x7045('0xb4')],_0xcd3f4f[_0x7045('0xb4')],_0x160362));}}});return Promise[_0x7045('0xbe')](_0x3ccfaa);})['then'](function(_0x5c9429){_0x3e1817=_0x5c9429[0x0];var _0xc8126b=[];var _0x500bf2=[];_0x5f2043[_0x7045('0xb9')](function(_0x3a2b3c){if(!_['isNil'](_0x3a2b3c['@odata.type'])){var _0x30cae6=_0x3a2b3c[_0x7045('0xba')][_0x7045('0xa8')](_0x3a2b3c[_0x7045('0xba')][_0x7045('0xbb')]('.')+0x1);if(_0x30cae6===_0x7045('0xbf')){_0xc8126b[_0x7045('0xbd')](getBooleanList(_0x3afb5e,_0x3230b8,_0x500bf2,_0x2d4059[_0x7045('0xb4')],_0x3a2b3c[_0x7045('0xb4')],_0x160362));}}});return Promise[_0x7045('0xbe')](_0xc8126b);})['then'](function(_0x99febb){_0x1441a9=_0x99febb[0x0];var _0x54d638=[];var _0x45eac0=[];_0x5f2043[_0x7045('0xb9')](function(_0x294ef9){if(_0x294ef9[_0x7045('0xba')]){var _0x51f09e=_0x294ef9[_0x7045('0xba')]['substring'](_0x294ef9[_0x7045('0xba')][_0x7045('0xbb')]('.')+0x1);if(_0x51f09e===_0x7045('0xc0')||_0x51f09e===_0x7045('0xc1')||_0x51f09e===_0x7045('0xc2')||_0x51f09e===_0x7045('0xc3')||_0x51f09e==='MemoAttributeMetadata'||_0x51f09e===_0x7045('0xc4')||_0x51f09e===_0x7045('0xc5')||_0x51f09e===_0x7045('0xc6')||_0x51f09e===_0x7045('0xc7')||_0x51f09e===_0x7045('0xc8')){_0x54d638['push'](getInputList(_0x3afb5e,_0x3230b8,_0x51f09e,_0x45eac0,_0x2d4059['MetadataId'],_0x294ef9['MetadataId'],_0x160362));}}});return Promise[_0x7045('0xbe')](_0x54d638);})[_0x7045('0x20')](function(_0x2754cd){_0x488b4f=_0x2754cd[0x0];var _0x59422a=_0x3e1817[_0x7045('0xa2')](_0x1441a9)['concat'](_0x488b4f);var _0x73c36e={'count':_0x59422a['length'],'rows':_0x59422a};return _0x73c36e;})[_0x7045('0x20')](respondWithResult(_0x952664,null))[_0x7045('0x51')](function(_0x17ae97){var _0xb1e503=_0x5ab822[_0x7045('0x3e')][_0x7045('0x1c')]?0x1f4:_0x17ae97[_0x7045('0xc9')]||0x1f4;logger[_0x7045('0x26')](_0x17ae97[_0x7045('0xca')]);delete _0x17ae97[_0x7045('0x36')];if(_0xb1e503===0x191){_0xb1e503=0x190;}_0x952664[_0x7045('0x30')](_0xb1e503)[_0x7045('0x37')](_0x5ab822[_0x7045('0x3e')][_0x7045('0x1c')]?{'message':_0x7045('0xcb'),'statusCode':_0x17ae97['statusCode']}:_0x17ae97);});};function getSelectList(_0x5addde,_0x494c95,_0x3a789a,_0x245871,_0x59e9e9,_0x5b2d66){var _0x2e9d28={'method':_0x7045('0xaf'),'uri':_0x5addde+_0x7045('0xb5')+_0x245871+_0x7045('0xcc')+_0x59e9e9+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x7045('0xcd'),'headers':{'Authorization':_0x7045('0xb1')+_0x5b2d66,'If-None-Match':null,'OData-Version':_0x7045('0xb2')},'json':!![]};return rp(_0x2e9d28)[_0x7045('0x20')](function(_0x58b6d7){var _0x3c93ed=[];var _0x465608=_0x58b6d7[_0x7045('0xce')]['Options'];_0x465608[_0x7045('0xb9')](function(_0x4e2cc7){_0x3c93ed['push']({'name':_0x4e2cc7[_0x7045('0xcf')]['UserLocalizedLabel'][_0x7045('0xcf')],'value':String(_0x4e2cc7[_0x7045('0xd0')])});});var _0x4ba5b4={'id':_0x494c95+'_'+_0x58b6d7[_0x7045('0xd1')],'name':_0x58b6d7[_0x7045('0xd2')]['UserLocalizedLabel']['Label'],'custom':![],'options':_0x3c93ed};_0x3a789a[_0x7045('0xbd')](_0x4ba5b4);return _0x3a789a;});}function getBooleanList(_0xd98063,_0x3c6d9c,_0x66cf03,_0x3909aa,_0x291444,_0x3427ea){var _0x447222={'method':_0x7045('0xaf'),'uri':_0xd98063+'EntityDefinitions('+_0x3909aa+_0x7045('0xcc')+_0x291444+_0x7045('0xd3'),'headers':{'Authorization':'Bearer\x20'+_0x3427ea,'If-None-Match':null,'OData-Version':_0x7045('0xb2')},'json':!![]};return rp(_0x447222)[_0x7045('0x20')](function(_0x225a64){var _0x1d9bef=[];_0x1d9bef[_0x7045('0xbd')]({'name':_0x225a64['OptionSet']['TrueOption']['Label'][_0x7045('0xd4')][_0x7045('0xcf')],'value':_0x7045('0xd5')},{'name':_0x225a64[_0x7045('0xce')][_0x7045('0xd6')]['Label'][_0x7045('0xd4')][_0x7045('0xcf')],'value':_0x7045('0xd7')});var _0x30dda2={'id':_0x3c6d9c+'_'+_0x225a64[_0x7045('0xd1')],'name':_0x225a64[_0x7045('0xd2')]['UserLocalizedLabel'][_0x7045('0xcf')],'custom':![],'options':_0x1d9bef};_0x66cf03[_0x7045('0xbd')](_0x30dda2);return _0x66cf03;});}function getInputList(_0x4bfe6c,_0xd3bd5b,_0x52a723,_0x4c84d0,_0x42d48f,_0x5b44bc,_0x537645){var _0x25fec8={'method':_0x7045('0xaf'),'uri':_0x4bfe6c+_0x7045('0xb5')+_0x42d48f+_0x7045('0xcc')+_0x5b44bc+')/Microsoft.Dynamics.CRM.'+_0x52a723+_0x7045('0xd8'),'headers':{'Authorization':'Bearer\x20'+_0x537645,'If-None-Match':null,'OData-Version':_0x7045('0xb2')},'json':!![]};return rp(_0x25fec8)['then'](function(_0x8aea95){var _0x1c89f5={'id':_0xd3bd5b+'_'+_0x8aea95[_0x7045('0xd1')],'name':_0x8aea95[_0x7045('0xd2')][_0x7045('0xd4')]?_0x8aea95[_0x7045('0xd2')][_0x7045('0xd4')][_0x7045('0xcf')]:_0x8aea95[_0x7045('0xd1')],'custom':![],'options':[]};_0x4c84d0[_0x7045('0xbd')](_0x1c89f5);return _0x4c84d0;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index f003f37..ddbd91d 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 _0xe6aa=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./intDynamics365Account.attributes','exports','define','Dynamics365Account','int_dynamics365_accounts','lodash'];(function(_0x233767,_0x4685b3){var _0x2ed347=function(_0x3b88e4){while(--_0x3b88e4){_0x233767['push'](_0x233767['shift']());}};_0x2ed347(++_0x4685b3);}(_0xe6aa,0x117));var _0xae6a=function(_0xc69c24,_0xfd04d0){_0xc69c24=_0xc69c24-0x0;var _0xb54e90=_0xe6aa[_0xc69c24];return _0xb54e90;};'use strict';var _=require(_0xae6a('0x0'));var util=require(_0xae6a('0x1'));var logger=require(_0xae6a('0x2'))(_0xae6a('0x3'));var moment=require(_0xae6a('0x4'));var BPromise=require(_0xae6a('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xae6a('0x6'));var rimraf=require(_0xae6a('0x7'));var config=require(_0xae6a('0x8'));var attributes=require(_0xae6a('0x9'));var integrations=require('../../components/integrations/configuration');module[_0xae6a('0xa')]=function(_0x3a1912,_0x29e6ca){return _0x3a1912[_0xae6a('0xb')](_0xae6a('0xc'),attributes,{'tableName':_0xae6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe9cc=['define','Dynamics365Account','../../config/logger','moment','request-promise','../../config/environment','./intDynamics365Account.attributes','../../components/integrations/configuration','exports'];(function(_0x4d0315,_0x589f3f){var _0x285fd5=function(_0x2e63fa){while(--_0x2e63fa){_0x4d0315['push'](_0x4d0315['shift']());}};_0x285fd5(++_0x589f3f);}(_0xe9cc,0x197));var _0xce9c=function(_0x560a60,_0x461904){_0x560a60=_0x560a60-0x0;var _0x4b42d3=_0xe9cc[_0x560a60];return _0x4b42d3;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xce9c('0x0'))('api');var moment=require(_0xce9c('0x1'));var BPromise=require('bluebird');var rp=require(_0xce9c('0x2'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xce9c('0x3'));var attributes=require(_0xce9c('0x4'));var integrations=require(_0xce9c('0x5'));module[_0xce9c('0x6')]=function(_0x5314a2,_0xa2db1b){return _0x5314a2[_0xce9c('0x7')](_0xce9c('0x8'),attributes,{'tableName':'int_dynamics365_accounts','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 bc48d50..d6bf8ae 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 _0xc891=['include','map','model','find','raw','attributes','debug','ShowDynamics365Account','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','request\x20sent','error','code','Dynamics365Account,\x20%s,\x20%s','message','catch','GetDynamics365Account','Dynamics365Account','options','where','limit'];(function(_0x410709,_0x1f84d8){var _0x3b8158=function(_0x3e6197){while(--_0x3e6197){_0x410709['push'](_0x410709['shift']());}};_0x3b8158(++_0x1f84d8);}(_0xc891,0x152));var _0x1c89=function(_0x4d07cc,_0x587613){_0x4d07cc=_0x4d07cc-0x0;var _0x42de3b=_0xc891[_0x4d07cc];return _0x42de3b;};'use strict';var _=require(_0x1c89('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x1c89('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1c89('0x2'));var db=require(_0x1c89('0x3'))['db'];var utils=require(_0x1c89('0x4'));var logger=require('../../config/logger')(_0x1c89('0x5'));var config=require(_0x1c89('0x6'));var jayson=require(_0x1c89('0x7'));var client=jayson[_0x1c89('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14436b,_0x30aa4d,_0x4cbacb){return new BPromise(function(_0x44b3cf,_0x300289){return client['request'](_0x14436b,_0x4cbacb)[_0x1c89('0x9')](function(_0x4e9b16){logger[_0x1c89('0xa')]('Dynamics365Account,\x20%s,\x20%s',_0x30aa4d,'request\x20sent');logger['debug']('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x30aa4d,_0x1c89('0xb'),JSON['stringify'](_0x4e9b16));if(_0x4e9b16[_0x1c89('0xc')]){if(_0x4e9b16[_0x1c89('0xc')][_0x1c89('0xd')]===0x1f4){logger[_0x1c89('0xc')](_0x1c89('0xe'),_0x30aa4d,_0x4e9b16[_0x1c89('0xc')][_0x1c89('0xf')]);return _0x300289(_0x4e9b16[_0x1c89('0xc')]['message']);}logger[_0x1c89('0xc')]('Dynamics365Account,\x20%s,\x20%s',_0x30aa4d,_0x4e9b16[_0x1c89('0xc')][_0x1c89('0xf')]);return _0x44b3cf(_0x4e9b16[_0x1c89('0xc')]['message']);}else{logger[_0x1c89('0xa')](_0x1c89('0xe'),_0x30aa4d,_0x1c89('0xb'));_0x44b3cf(_0x4e9b16['result'][_0x1c89('0xf')]);}})[_0x1c89('0x10')](function(_0x266ad8){logger[_0x1c89('0xc')](_0x1c89('0xe'),_0x30aa4d,_0x266ad8);_0x300289(_0x266ad8);});});}exports[_0x1c89('0x11')]=function(_0x2cb186){var _0x2b856c=this;return new Promise(function(_0x166444,_0x35bd99){return db[_0x1c89('0x12')]['findAll']({'raw':_0x2cb186[_0x1c89('0x13')]?_0x2cb186[_0x1c89('0x13')]['raw']===undefined?!![]:![]:!![],'where':_0x2cb186[_0x1c89('0x13')]?_0x2cb186[_0x1c89('0x13')][_0x1c89('0x14')]||null:null,'attributes':_0x2cb186[_0x1c89('0x13')]?_0x2cb186['options']['attributes']||null:null,'limit':_0x2cb186[_0x1c89('0x13')]?_0x2cb186[_0x1c89('0x13')][_0x1c89('0x15')]||null:null,'include':_0x2cb186[_0x1c89('0x13')]?_0x2cb186['options'][_0x1c89('0x16')]?_[_0x1c89('0x17')](_0x2cb186['options'][_0x1c89('0x16')],function(_0x26a1cc){return{'model':db[_0x26a1cc[_0x1c89('0x18')]],'as':_0x26a1cc['as'],'attributes':_0x26a1cc['attributes'],'include':_0x26a1cc[_0x1c89('0x16')]?_[_0x1c89('0x17')](_0x26a1cc[_0x1c89('0x16')],function(_0x59a87e){return{'model':db[_0x59a87e[_0x1c89('0x18')]],'as':_0x59a87e['as'],'attributes':_0x59a87e['attributes'],'include':_0x59a87e['include']?_[_0x1c89('0x17')](_0x59a87e[_0x1c89('0x16')],function(_0x4c4694){return{'model':db[_0x4c4694['model']],'as':_0x4c4694['as'],'attributes':_0x4c4694['attributes']};}):[]};}):[]};}):[]:[]})[_0x1c89('0x9')](function(_0x5ce91f){logger['info'](_0x1c89('0x11'),_0x2cb186);logger['debug'](_0x1c89('0x11'),_0x2cb186,JSON['stringify'](_0x5ce91f));_0x166444(_0x5ce91f);})['catch'](function(_0x25500d){logger[_0x1c89('0xc')](_0x1c89('0x11'),_0x25500d['message'],_0x2cb186);_0x35bd99(_0x2b856c[_0x1c89('0xc')](0x1f4,_0x25500d[_0x1c89('0xf')]));});});};exports['ShowDynamics365Account']=function(_0x438970){var _0x545e37=this;return new Promise(function(_0x13bb07,_0x38679f){return db[_0x1c89('0x12')][_0x1c89('0x19')]({'raw':_0x438970[_0x1c89('0x13')]?_0x438970[_0x1c89('0x13')][_0x1c89('0x1a')]===undefined?!![]:![]:!![],'where':_0x438970[_0x1c89('0x13')]?_0x438970[_0x1c89('0x13')][_0x1c89('0x14')]||null:null,'attributes':_0x438970['options']?_0x438970[_0x1c89('0x13')]['attributes']||null:null,'include':_0x438970['options']?_0x438970[_0x1c89('0x13')][_0x1c89('0x16')]?_[_0x1c89('0x17')](_0x438970[_0x1c89('0x13')][_0x1c89('0x16')],function(_0x1c7ce2){return{'model':db[_0x1c7ce2[_0x1c89('0x18')]],'as':_0x1c7ce2['as'],'attributes':_0x1c7ce2[_0x1c89('0x1b')],'include':_0x1c7ce2[_0x1c89('0x16')]?_[_0x1c89('0x17')](_0x1c7ce2[_0x1c89('0x16')],function(_0x4e4872){return{'model':db[_0x4e4872['model']],'as':_0x4e4872['as'],'attributes':_0x4e4872[_0x1c89('0x1b')],'include':_0x4e4872['include']?_['map'](_0x4e4872[_0x1c89('0x16')],function(_0x238c6d){return{'model':db[_0x238c6d[_0x1c89('0x18')]],'as':_0x238c6d['as'],'attributes':_0x238c6d[_0x1c89('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1c89('0x9')](function(_0x42d93d){logger[_0x1c89('0xa')]('ShowDynamics365Account',_0x438970);logger[_0x1c89('0x1c')](_0x1c89('0x1d'),_0x438970,JSON['stringify'](_0x42d93d));_0x13bb07(_0x42d93d);})[_0x1c89('0x10')](function(_0x3f6ce0){logger[_0x1c89('0xc')](_0x1c89('0x1d'),_0x3f6ce0[_0x1c89('0xf')],_0x438970);_0x38679f(_0x545e37['error'](0x1f4,_0x3f6ce0[_0x1c89('0xf')]));});});}; \ No newline at end of file +var _0x5e8d=['request\x20sent','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetDynamics365Account','Dynamics365Account','findAll','options','raw','where','attributes','limit','include','map','model','then','debug','stringify','find','ShowDynamics365Account','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s'];(function(_0x2ef291,_0x11d6f5){var _0x2c374b=function(_0x50aef6){while(--_0x50aef6){_0x2ef291['push'](_0x2ef291['shift']());}};_0x2c374b(++_0x11d6f5);}(_0x5e8d,0x11a));var _0xd5e8=function(_0x49cace,_0x4ba78b){_0x49cace=_0x49cace-0x0;var _0x370228=_0x5e8d[_0x49cace];return _0x370228;};'use strict';var _=require(_0xd5e8('0x0'));var util=require(_0xd5e8('0x1'));var moment=require(_0xd5e8('0x2'));var BPromise=require(_0xd5e8('0x3'));var rs=require(_0xd5e8('0x4'));var fs=require('fs');var Redis=require(_0xd5e8('0x5'));var db=require(_0xd5e8('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd5e8('0x7'))(_0xd5e8('0x8'));var config=require('../../config/environment');var jayson=require(_0xd5e8('0x9'));var client=jayson[_0xd5e8('0xa')][_0xd5e8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4c904d,_0x31c6bb,_0x4196e2){return new BPromise(function(_0x1597ec,_0x37ad2a){return client['request'](_0x4c904d,_0x4196e2)['then'](function(_0x3699c4){logger[_0xd5e8('0xc')](_0xd5e8('0xd'),_0x31c6bb,_0xd5e8('0xe'));logger['debug'](_0xd5e8('0xf'),_0x31c6bb,_0xd5e8('0xe'),JSON['stringify'](_0x3699c4));if(_0x3699c4[_0xd5e8('0x10')]){if(_0x3699c4[_0xd5e8('0x10')][_0xd5e8('0x11')]===0x1f4){logger[_0xd5e8('0x10')](_0xd5e8('0xd'),_0x31c6bb,_0x3699c4[_0xd5e8('0x10')][_0xd5e8('0x12')]);return _0x37ad2a(_0x3699c4[_0xd5e8('0x10')][_0xd5e8('0x12')]);}logger['error']('Dynamics365Account,\x20%s,\x20%s',_0x31c6bb,_0x3699c4[_0xd5e8('0x10')][_0xd5e8('0x12')]);return _0x1597ec(_0x3699c4[_0xd5e8('0x10')][_0xd5e8('0x12')]);}else{logger[_0xd5e8('0xc')](_0xd5e8('0xd'),_0x31c6bb,'request\x20sent');_0x1597ec(_0x3699c4[_0xd5e8('0x13')][_0xd5e8('0x12')]);}})[_0xd5e8('0x14')](function(_0x2dfd4a){logger['error'](_0xd5e8('0xd'),_0x31c6bb,_0x2dfd4a);_0x37ad2a(_0x2dfd4a);});});}exports[_0xd5e8('0x15')]=function(_0x529d45){var _0x4b89e9=this;return new Promise(function(_0x1be884,_0x25e0b9){return db[_0xd5e8('0x16')][_0xd5e8('0x17')]({'raw':_0x529d45[_0xd5e8('0x18')]?_0x529d45[_0xd5e8('0x18')][_0xd5e8('0x19')]===undefined?!![]:![]:!![],'where':_0x529d45['options']?_0x529d45[_0xd5e8('0x18')][_0xd5e8('0x1a')]||null:null,'attributes':_0x529d45[_0xd5e8('0x18')]?_0x529d45[_0xd5e8('0x18')][_0xd5e8('0x1b')]||null:null,'limit':_0x529d45[_0xd5e8('0x18')]?_0x529d45[_0xd5e8('0x18')][_0xd5e8('0x1c')]||null:null,'include':_0x529d45[_0xd5e8('0x18')]?_0x529d45[_0xd5e8('0x18')][_0xd5e8('0x1d')]?_[_0xd5e8('0x1e')](_0x529d45[_0xd5e8('0x18')]['include'],function(_0x4a133e){return{'model':db[_0x4a133e['model']],'as':_0x4a133e['as'],'attributes':_0x4a133e['attributes'],'include':_0x4a133e[_0xd5e8('0x1d')]?_['map'](_0x4a133e[_0xd5e8('0x1d')],function(_0x3b1a69){return{'model':db[_0x3b1a69['model']],'as':_0x3b1a69['as'],'attributes':_0x3b1a69['attributes'],'include':_0x3b1a69[_0xd5e8('0x1d')]?_[_0xd5e8('0x1e')](_0x3b1a69[_0xd5e8('0x1d')],function(_0x26018b){return{'model':db[_0x26018b[_0xd5e8('0x1f')]],'as':_0x26018b['as'],'attributes':_0x26018b[_0xd5e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd5e8('0x20')](function(_0x2b7244){logger[_0xd5e8('0xc')]('GetDynamics365Account',_0x529d45);logger[_0xd5e8('0x21')]('GetDynamics365Account',_0x529d45,JSON[_0xd5e8('0x22')](_0x2b7244));_0x1be884(_0x2b7244);})[_0xd5e8('0x14')](function(_0x38414b){logger[_0xd5e8('0x10')](_0xd5e8('0x15'),_0x38414b['message'],_0x529d45);_0x25e0b9(_0x4b89e9[_0xd5e8('0x10')](0x1f4,_0x38414b[_0xd5e8('0x12')]));});});};exports['ShowDynamics365Account']=function(_0x315955){var _0x5d4b1c=this;return new Promise(function(_0x3980a1,_0x202cb7){return db[_0xd5e8('0x16')][_0xd5e8('0x23')]({'raw':_0x315955[_0xd5e8('0x18')]?_0x315955[_0xd5e8('0x18')][_0xd5e8('0x19')]===undefined?!![]:![]:!![],'where':_0x315955[_0xd5e8('0x18')]?_0x315955['options'][_0xd5e8('0x1a')]||null:null,'attributes':_0x315955[_0xd5e8('0x18')]?_0x315955[_0xd5e8('0x18')][_0xd5e8('0x1b')]||null:null,'include':_0x315955[_0xd5e8('0x18')]?_0x315955[_0xd5e8('0x18')][_0xd5e8('0x1d')]?_[_0xd5e8('0x1e')](_0x315955['options']['include'],function(_0x50bbd4){return{'model':db[_0x50bbd4[_0xd5e8('0x1f')]],'as':_0x50bbd4['as'],'attributes':_0x50bbd4[_0xd5e8('0x1b')],'include':_0x50bbd4[_0xd5e8('0x1d')]?_[_0xd5e8('0x1e')](_0x50bbd4[_0xd5e8('0x1d')],function(_0x31477b){return{'model':db[_0x31477b[_0xd5e8('0x1f')]],'as':_0x31477b['as'],'attributes':_0x31477b['attributes'],'include':_0x31477b['include']?_[_0xd5e8('0x1e')](_0x31477b[_0xd5e8('0x1d')],function(_0x14ea92){return{'model':db[_0x14ea92[_0xd5e8('0x1f')]],'as':_0x14ea92['as'],'attributes':_0x14ea92[_0xd5e8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xd5e8('0x20')](function(_0x3b6d13){logger[_0xd5e8('0xc')](_0xd5e8('0x24'),_0x315955);logger[_0xd5e8('0x21')](_0xd5e8('0x24'),_0x315955,JSON['stringify'](_0x3b6d13));_0x3980a1(_0x3b6d13);})[_0xd5e8('0x14')](function(_0x569f00){logger[_0xd5e8('0x10')]('ShowDynamics365Account',_0x569f00[_0xd5e8('0x12')],_0x315955);_0x202cb7(_0x5d4b1c['error'](0x1f4,_0x569f00[_0xd5e8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0b0abee..76ef56f 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 _0xe3f2=['../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','index','/:id','isAuthenticated','show','/:id/fields','/:id/subjects','getSubjects','getDescriptions','create','put','delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x30055e,_0x28e900){var _0x34ef86=function(_0x3f2e76){while(--_0x3f2e76){_0x30055e['push'](_0x30055e['shift']());}};_0x34ef86(++_0x28e900);}(_0xe3f2,0xc0));var _0x2e3f=function(_0x5c9887,_0x17e795){_0x5c9887=_0x5c9887-0x0;var _0x4f456a=_0xe3f2[_0x5c9887];return _0x4f456a;};'use strict';var multer=require(_0x2e3f('0x0'));var util=require('util');var path=require(_0x2e3f('0x1'));var timeout=require(_0x2e3f('0x2'));var express=require(_0x2e3f('0x3'));var router=express[_0x2e3f('0x4')]();var auth=require(_0x2e3f('0x5'));var interaction=require(_0x2e3f('0x6'));var config=require(_0x2e3f('0x7'));var controller=require(_0x2e3f('0x8'));router[_0x2e3f('0x9')]('/',auth['isAuthenticated'](),controller[_0x2e3f('0xa')]);router[_0x2e3f('0x9')](_0x2e3f('0xb'),auth[_0x2e3f('0xc')](),controller[_0x2e3f('0xd')]);router['get'](_0x2e3f('0xe'),auth[_0x2e3f('0xc')](),controller['getFields']);router[_0x2e3f('0x9')](_0x2e3f('0xf'),auth[_0x2e3f('0xc')](),controller[_0x2e3f('0x10')]);router[_0x2e3f('0x9')]('/:id/descriptions',auth[_0x2e3f('0xc')](),controller[_0x2e3f('0x11')]);router['post']('/',auth['isAuthenticated'](),controller[_0x2e3f('0x12')]);router[_0x2e3f('0x13')](_0x2e3f('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x2e3f('0x14')](_0x2e3f('0xb'),auth[_0x2e3f('0xc')](),controller[_0x2e3f('0x15')]);module['exports']=router; \ No newline at end of file +var _0xbeb5=['update','delete','destroy','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','isAuthenticated','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put'];(function(_0x3e45e2,_0x2bfa1d){var _0x1e7142=function(_0x5cc5cd){while(--_0x5cc5cd){_0x3e45e2['push'](_0x3e45e2['shift']());}};_0x1e7142(++_0x2bfa1d);}(_0xbeb5,0x1e6));var _0x5beb=function(_0x493e41,_0x188f3a){_0x493e41=_0x493e41-0x0;var _0x2bb4c1=_0xbeb5[_0x493e41];return _0x2bb4c1;};'use strict';var multer=require(_0x5beb('0x0'));var util=require(_0x5beb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5beb('0x2'));var router=express[_0x5beb('0x3')]();var auth=require(_0x5beb('0x4'));var interaction=require(_0x5beb('0x5'));var config=require(_0x5beb('0x6'));var controller=require(_0x5beb('0x7'));router['get']('/',auth[_0x5beb('0x8')](),controller['index']);router[_0x5beb('0x9')](_0x5beb('0xa'),auth['isAuthenticated'](),controller[_0x5beb('0xb')]);router[_0x5beb('0x9')]('/:id/fields',auth[_0x5beb('0x8')](),controller[_0x5beb('0xc')]);router['get'](_0x5beb('0xd'),auth['isAuthenticated'](),controller[_0x5beb('0xe')]);router[_0x5beb('0x9')](_0x5beb('0xf'),auth['isAuthenticated'](),controller[_0x5beb('0x10')]);router[_0x5beb('0x11')]('/',auth[_0x5beb('0x8')](),controller[_0x5beb('0x12')]);router[_0x5beb('0x13')](_0x5beb('0xa'),auth[_0x5beb('0x8')](),controller[_0x5beb('0x14')]);router[_0x5beb('0x15')](_0x5beb('0xa'),auth['isAuthenticated'](),controller[_0x5beb('0x16')]);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 3cb832b..dbd9242 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 _0xa4c4=['ENUM','incident','phonecall','sequelize','STRING'];(function(_0x4b2b03,_0xbf34ee){var _0x1bf0ed=function(_0x562785){while(--_0x562785){_0x4b2b03['push'](_0x4b2b03['shift']());}};_0x1bf0ed(++_0xbf34ee);}(_0xa4c4,0x143));var _0x4a4c=function(_0x2e9ff8,_0x457fda){_0x2e9ff8=_0x2e9ff8-0x0;var _0x2febdd=_0xa4c4[_0x2e9ff8];return _0x2febdd;};'use strict';var Sequelize=require(_0x4a4c('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a4c('0x1')]},'description':{'type':Sequelize[_0x4a4c('0x1')]},'ticketType':{'type':Sequelize[_0x4a4c('0x2')](_0x4a4c('0x3'),_0x4a4c('0x4')),'defaultValue':_0x4a4c('0x3')}}; \ No newline at end of file +var _0x4367=['sequelize','exports','STRING','ENUM','incident'];(function(_0x51020b,_0x38c2c7){var _0x371e47=function(_0x2a538f){while(--_0x2a538f){_0x51020b['push'](_0x51020b['shift']());}};_0x371e47(++_0x38c2c7);}(_0x4367,0x19f));var _0x7436=function(_0x478240,_0x1d8d22){_0x478240=_0x478240-0x0;var _0x33ab8f=_0x4367[_0x478240];return _0x33ab8f;};'use strict';var Sequelize=require(_0x7436('0x0'));module[_0x7436('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x7436('0x2')]},'ticketType':{'type':Sequelize[_0x7436('0x3')](_0x7436('0x4'),'phonecall'),'defaultValue':_0x7436('0x4')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index a2f0569..b0a6555 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 _0x0661=['bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','keys','create','body','update','params','findOne','Dynamics365Field','order','filter','getFields','nolimit','getSubjects','getDescriptions','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x5a7262,_0x457200){var _0x1e4dad=function(_0x39ca47){while(--_0x39ca47){_0x5a7262['push'](_0x5a7262['shift']());}};_0x1e4dad(++_0x457200);}(_0x0661,0x109));var _0x1066=function(_0xbf5624,_0x306236){_0xbf5624=_0xbf5624-0x0;var _0x390b36=_0x0661[_0xbf5624];return _0x390b36;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1066('0x0'));var rimraf=require(_0x1066('0x1'));var zipdir=require(_0x1066('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x1066('0x3'));var moment=require(_0x1066('0x4'));var BPromise=require(_0x1066('0x5'));var Mustache=require(_0x1066('0x6'));var util=require(_0x1066('0x7'));var path=require(_0x1066('0x8'));var sox=require(_0x1066('0x9'));var csv=require(_0x1066('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1066('0xb'));var squel=require(_0x1066('0xc'));var crypto=require(_0x1066('0xd'));var jsforce=require(_0x1066('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1066('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1066('0x10'));var as=require(_0x1066('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x1066('0x12'));var utils=require(_0x1066('0x13'));var config=require(_0x1066('0x14'));var db=require(_0x1066('0x15'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x1066('0x16')][_0x1066('0x17')]({'port':0x232a});function checkPasswordPattern(_0x4b4229,_0x466101,_0x6f0d7){if(_0x6f0d7){var _0x41b700=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x41b700['test'](_0x466101)){return _0x4b4229;}else{throw new db[(_0x1066('0x18'))][(_0x1066('0x19'))](_0x1066('0x1a'));}}else{return _0x4b4229;}}function respondWithRpcPromise(_0x3ade8d,_0x56b314,_0x433148,_0x36fd0a){return new BPromise(function(_0x6241da,_0xc64140){var _0x50b516=_0x36fd0a||client;return _0x50b516[_0x1066('0x1b')](_0x3ade8d,_0x433148)[_0x1066('0x1c')](function(_0x16d192){logger[_0x1066('0x1d')](_0x1066('0x1e'),_0x56b314,_0x1066('0x1f'));logger[_0x1066('0x20')](_0x1066('0x21'),_0x56b314,_0x1066('0x1f'),JSON[_0x1066('0x22')](_0x16d192));if(_0x16d192[_0x1066('0x23')]){if(_0x16d192[_0x1066('0x23')]['code']===0x1f4){logger[_0x1066('0x23')]('Dynamics365Configuration,\x20%s,\x20%s',_0x56b314,_0x16d192[_0x1066('0x23')]['message']);return _0xc64140(_0x16d192['error'][_0x1066('0x24')]);}logger[_0x1066('0x23')](_0x1066('0x1e'),_0x56b314,_0x16d192[_0x1066('0x23')][_0x1066('0x24')]);return _0x6241da(_0x16d192[_0x1066('0x23')][_0x1066('0x24')]);}else{logger[_0x1066('0x1d')](_0x1066('0x1e'),_0x56b314,_0x1066('0x1f'));_0x6241da(_0x16d192[_0x1066('0x25')][_0x1066('0x24')]);}})[_0x1066('0x26')](function(_0x168ed5){logger[_0x1066('0x23')](_0x1066('0x1e'),_0x56b314,_0x168ed5);_0xc64140(_0x168ed5);});});}function respondWithStatusCode(_0x5bb023,_0x59dae3){_0x59dae3=_0x59dae3||0xcc;return function(_0x47172b){if(_0x47172b){return _0x5bb023[_0x1066('0x27')](_0x59dae3);}return _0x5bb023[_0x1066('0x28')](_0x59dae3)[_0x1066('0x29')]();};}function respondWithResult(_0x29bb74,_0x42e86f){_0x42e86f=_0x42e86f||0xc8;return function(_0x4aa13b){if(_0x4aa13b){return _0x29bb74[_0x1066('0x28')](_0x42e86f)[_0x1066('0x2a')](_0x4aa13b);}};}function respondWithFilteredResult(_0xc66332,_0x46eac2){return function(_0x20c5a1){if(_0x20c5a1){var _0x2a995d=_0x20c5a1[_0x1066('0x2b')],_0x5bd44d=_0x46eac2['offset'],_0x1a5b8c=_0x46eac2[_0x1066('0x2c')]+_0x46eac2[_0x1066('0x2d')],_0x20f21d;if(_0x1a5b8c>=_0x2a995d){_0x1a5b8c=_0x2a995d;_0x20f21d=0xc8;}else{_0x20f21d=0xce;}_0xc66332[_0x1066('0x28')](_0x20f21d);return _0xc66332[_0x1066('0x2e')](_0x1066('0x2f'),_0x5bd44d+'-'+_0x1a5b8c+'/'+_0x2a995d)[_0x1066('0x2a')](_0x20c5a1);}return null;};}function patchUpdates(_0x56ba2a){return function(_0x42a8ab){try{jsonpatch['apply'](_0x42a8ab,_0x56ba2a,!![]);}catch(_0x39600f){return BPromise[_0x1066('0x30')](_0x39600f);}return _0x42a8ab[_0x1066('0x31')]();};}function saveUpdates(_0x5ed120,_0x14867e){return function(_0x3603b9){if(_0x3603b9){return _0x3603b9['update'](_0x5ed120)[_0x1066('0x1c')](function(_0x2f9fb7){return _0x2f9fb7;});}return null;};}function removeEntity(_0x1d8921,_0x24ebd0){return function(_0x6d330a){if(_0x6d330a){return _0x6d330a[_0x1066('0x32')]()[_0x1066('0x1c')](function(){_0x1d8921['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x106e52,_0x1a6afa){return function(_0x13455d){if(!_0x13455d){_0x106e52[_0x1066('0x27')](0x194);}return _0x13455d;};}function handleError(_0x3e13e5,_0x318952){_0x318952=_0x318952||0x1f4;return function(_0x5dd8a9){logger[_0x1066('0x23')](_0x5dd8a9[_0x1066('0x33')]);if(_0x5dd8a9[_0x1066('0x34')]){delete _0x5dd8a9[_0x1066('0x34')];}_0x3e13e5[_0x1066('0x28')](_0x318952)[_0x1066('0x35')](_0x5dd8a9);};}exports[_0x1066('0x36')]=function(_0x5b395a,_0x2c7db9){var _0x472e43={},_0x18ce19={},_0x2958be={'count':0x0,'rows':[]};var _0x281295=_[_0x1066('0x37')](db[_0x1066('0x38')][_0x1066('0x39')],function(_0x59733a){return{'name':_0x59733a['fieldName'],'type':_0x59733a[_0x1066('0x3a')][_0x1066('0x3b')]};});_0x18ce19['model']=_['map'](_0x281295,_0x1066('0x34'));_0x18ce19[_0x1066('0x3c')]=_['keys'](_0x5b395a[_0x1066('0x3c')]);_0x18ce19[_0x1066('0x3d')]=_[_0x1066('0x3e')](_0x18ce19[_0x1066('0x3f')],_0x18ce19[_0x1066('0x3c')]);_0x472e43[_0x1066('0x40')]=_[_0x1066('0x3e')](_0x18ce19[_0x1066('0x3f')],qs['fields'](_0x5b395a[_0x1066('0x3c')][_0x1066('0x41')]));_0x472e43[_0x1066('0x40')]=_0x472e43['attributes'][_0x1066('0x42')]?_0x472e43[_0x1066('0x40')]:_0x18ce19[_0x1066('0x3f')];if(!_0x5b395a['query'][_0x1066('0x43')]('nolimit')){_0x472e43['limit']=qs[_0x1066('0x2d')](_0x5b395a[_0x1066('0x3c')][_0x1066('0x2d')]);_0x472e43['offset']=qs['offset'](_0x5b395a[_0x1066('0x3c')]['offset']);}_0x472e43['order']=qs['sort'](_0x5b395a[_0x1066('0x3c')][_0x1066('0x44')]);_0x472e43[_0x1066('0x45')]=qs['filters'](_[_0x1066('0x46')](_0x5b395a['query'],_0x18ce19['filters']));if(_0x5b395a[_0x1066('0x3c')]['filter']){_0x472e43['where']=_[_0x1066('0x47')](_0x472e43['where'],{'$or':_['map'](_0x281295,function(_0x1b05ac){if(_0x1b05ac['type']!==_0x1066('0x48')){var _0x343707={};_0x343707[_0x1b05ac['name']]={'$like':'%'+_0x5b395a[_0x1066('0x3c')]['filter']+'%'};return _0x343707;}})});}_0x472e43=_['merge']({},_0x472e43,_0x5b395a[_0x1066('0x49')]);var _0x5d7b28={'where':_0x472e43['where']};return db['Dynamics365Configuration']['count'](_0x5d7b28)[_0x1066('0x1c')](function(_0x249469){_0x2958be[_0x1066('0x2b')]=_0x249469;if(_0x5b395a['query'][_0x1066('0x4a')]){_0x472e43[_0x1066('0x4b')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x472e43);})[_0x1066('0x1c')](function(_0x5958fb){_0x2958be[_0x1066('0x4c')]=_0x5958fb;return _0x2958be;})[_0x1066('0x1c')](respondWithFilteredResult(_0x2c7db9,_0x472e43))[_0x1066('0x26')](handleError(_0x2c7db9,null));};exports['show']=function(_0xb47cc6,_0x5c3261){var _0x24d779={'raw':![],'where':{'id':_0xb47cc6['params']['id']}},_0xf070ad={};_0xf070ad['model']=_[_0x1066('0x4d')](db['Dynamics365Configuration'][_0x1066('0x39')]);_0xf070ad[_0x1066('0x3c')]=_[_0x1066('0x4d')](_0xb47cc6[_0x1066('0x3c')]);_0xf070ad[_0x1066('0x3d')]=_[_0x1066('0x3e')](_0xf070ad[_0x1066('0x3f')],_0xf070ad['query']);_0x24d779[_0x1066('0x40')]=_[_0x1066('0x3e')](_0xf070ad[_0x1066('0x3f')],qs['fields'](_0xb47cc6[_0x1066('0x3c')]['fields']));_0x24d779[_0x1066('0x40')]=_0x24d779[_0x1066('0x40')][_0x1066('0x42')]?_0x24d779[_0x1066('0x40')]:_0xf070ad[_0x1066('0x3f')];if(_0xb47cc6[_0x1066('0x3c')]['includeAll']){_0x24d779[_0x1066('0x4b')]=[{'all':!![]}];}_0x24d779=_[_0x1066('0x47')]({},_0x24d779,_0xb47cc6['options']);return db[_0x1066('0x38')]['find'](_0x24d779)[_0x1066('0x1c')](handleEntityNotFound(_0x5c3261,null))['then'](respondWithResult(_0x5c3261,null))[_0x1066('0x26')](handleError(_0x5c3261,null));};exports['create']=function(_0x4c19d5,_0x4b2c4f){return db[_0x1066('0x38')][_0x1066('0x4e')](_0x4c19d5[_0x1066('0x4f')],{})[_0x1066('0x1c')](respondWithResult(_0x4b2c4f,0xc9))[_0x1066('0x26')](handleError(_0x4b2c4f,null));};exports[_0x1066('0x50')]=function(_0x302882,_0x28703a){if(_0x302882[_0x1066('0x4f')]['id']){delete _0x302882[_0x1066('0x4f')]['id'];}return db[_0x1066('0x38')]['find']({'where':{'id':_0x302882[_0x1066('0x51')]['id']}})[_0x1066('0x1c')](handleEntityNotFound(_0x28703a,null))['then'](saveUpdates(_0x302882['body'],null))[_0x1066('0x1c')](respondWithResult(_0x28703a,null))['catch'](handleError(_0x28703a,null));};exports[_0x1066('0x32')]=function(_0x19d5a4,_0x39c85c){return db[_0x1066('0x38')]['find']({'where':{'id':_0x19d5a4[_0x1066('0x51')]['id']}})[_0x1066('0x1c')](handleEntityNotFound(_0x39c85c,null))[_0x1066('0x1c')](removeEntity(_0x39c85c,null))[_0x1066('0x26')](handleError(_0x39c85c,null));};exports['getFields']=function(_0x3d7b45,_0x99e937,_0x27dde3){var _0x12c5a1={};var _0x3cc140={};var _0xfc5217;var _0x34e079;return db['Dynamics365Configuration'][_0x1066('0x52')]({'where':{'id':_0x3d7b45['params']['id']}})[_0x1066('0x1c')](handleEntityNotFound(_0x99e937,null))[_0x1066('0x1c')](function(_0x25f3b7){if(_0x25f3b7){_0xfc5217=_0x25f3b7;_0x3cc140[_0x1066('0x3f')]=_['keys'](db[_0x1066('0x53')][_0x1066('0x39')]);_0x3cc140[_0x1066('0x3c')]=_[_0x1066('0x4d')](_0x3d7b45[_0x1066('0x3c')]);_0x3cc140[_0x1066('0x3d')]=_[_0x1066('0x3e')](_0x3cc140[_0x1066('0x3f')],_0x3cc140['query']);_0x12c5a1['attributes']=_[_0x1066('0x3e')](_0x3cc140[_0x1066('0x3f')],qs[_0x1066('0x41')](_0x3d7b45[_0x1066('0x3c')][_0x1066('0x41')]));_0x12c5a1[_0x1066('0x40')]=_0x12c5a1[_0x1066('0x40')][_0x1066('0x42')]?_0x12c5a1[_0x1066('0x40')]:_0x3cc140[_0x1066('0x3f')];_0x12c5a1[_0x1066('0x54')]=qs['sort'](_0x3d7b45[_0x1066('0x3c')][_0x1066('0x44')]);_0x12c5a1['where']=qs['filters'](_[_0x1066('0x46')](_0x3d7b45[_0x1066('0x3c')],_0x3cc140['filters']));if(_0x3d7b45[_0x1066('0x3c')][_0x1066('0x55')]){_0x12c5a1['where']=_[_0x1066('0x47')](_0x12c5a1[_0x1066('0x45')],{'$or':_['map'](_0x12c5a1[_0x1066('0x40')],function(_0x5655ed){var _0x50437e={};_0x50437e[_0x5655ed]={'$like':'%'+_0x3d7b45[_0x1066('0x3c')][_0x1066('0x55')]+'%'};return _0x50437e;})});}_0x12c5a1=_[_0x1066('0x47')]({},_0x12c5a1,_0x3d7b45[_0x1066('0x49')]);return _0xfc5217[_0x1066('0x56')](_0x12c5a1);}})[_0x1066('0x1c')](function(_0x2cab39){if(_0x2cab39){_0x34e079=_0x2cab39[_0x1066('0x42')];if(!_0x3d7b45[_0x1066('0x3c')][_0x1066('0x43')](_0x1066('0x57'))){_0x12c5a1[_0x1066('0x2d')]=qs[_0x1066('0x2d')](_0x3d7b45[_0x1066('0x3c')][_0x1066('0x2d')]);_0x12c5a1[_0x1066('0x2c')]=qs[_0x1066('0x2c')](_0x3d7b45[_0x1066('0x3c')]['offset']);}return _0xfc5217['getFields'](_0x12c5a1);}})[_0x1066('0x1c')](function(_0x50d3ed){if(_0x50d3ed){return _0x50d3ed?{'count':_0x34e079,'rows':_0x50d3ed}:null;}})[_0x1066('0x1c')](respondWithResult(_0x99e937,null))[_0x1066('0x26')](handleError(_0x99e937,null));};exports[_0x1066('0x58')]=function(_0x14755a,_0x3a584a,_0x4dd5ff){var _0x5951b4={};var _0x1570a7={};var _0x33bc2e;var _0x517ce6;return db['Dynamics365Configuration'][_0x1066('0x52')]({'where':{'id':_0x14755a[_0x1066('0x51')]['id']}})[_0x1066('0x1c')](handleEntityNotFound(_0x3a584a,null))[_0x1066('0x1c')](function(_0x5efa64){if(_0x5efa64){_0x33bc2e=_0x5efa64;_0x1570a7['model']=_[_0x1066('0x4d')](db[_0x1066('0x53')][_0x1066('0x39')]);_0x1570a7[_0x1066('0x3c')]=_['keys'](_0x14755a[_0x1066('0x3c')]);_0x1570a7[_0x1066('0x3d')]=_[_0x1066('0x3e')](_0x1570a7[_0x1066('0x3f')],_0x1570a7[_0x1066('0x3c')]);_0x5951b4[_0x1066('0x40')]=_[_0x1066('0x3e')](_0x1570a7[_0x1066('0x3f')],qs[_0x1066('0x41')](_0x14755a['query'][_0x1066('0x41')]));_0x5951b4[_0x1066('0x40')]=_0x5951b4[_0x1066('0x40')]['length']?_0x5951b4[_0x1066('0x40')]:_0x1570a7[_0x1066('0x3f')];_0x5951b4[_0x1066('0x54')]=qs[_0x1066('0x44')](_0x14755a[_0x1066('0x3c')][_0x1066('0x44')]);_0x5951b4[_0x1066('0x45')]=qs['filters'](_[_0x1066('0x46')](_0x14755a[_0x1066('0x3c')],_0x1570a7[_0x1066('0x3d')]));if(_0x14755a[_0x1066('0x3c')][_0x1066('0x55')]){_0x5951b4[_0x1066('0x45')]=_[_0x1066('0x47')](_0x5951b4[_0x1066('0x45')],{'$or':_[_0x1066('0x37')](_0x5951b4[_0x1066('0x40')],function(_0x4b348c){var _0x39f802={};_0x39f802[_0x4b348c]={'$like':'%'+_0x14755a[_0x1066('0x3c')][_0x1066('0x55')]+'%'};return _0x39f802;})});}_0x5951b4=_['merge']({},_0x5951b4,_0x14755a['options']);return _0x33bc2e[_0x1066('0x58')](_0x5951b4);}})[_0x1066('0x1c')](function(_0x11ba02){if(_0x11ba02){_0x517ce6=_0x11ba02[_0x1066('0x42')];if(!_0x14755a['query'][_0x1066('0x43')](_0x1066('0x57'))){_0x5951b4[_0x1066('0x2d')]=qs[_0x1066('0x2d')](_0x14755a['query'][_0x1066('0x2d')]);_0x5951b4[_0x1066('0x2c')]=qs[_0x1066('0x2c')](_0x14755a['query'][_0x1066('0x2c')]);}return _0x33bc2e[_0x1066('0x58')](_0x5951b4);}})[_0x1066('0x1c')](function(_0x243f44){if(_0x243f44){return _0x243f44?{'count':_0x517ce6,'rows':_0x243f44}:null;}})[_0x1066('0x1c')](respondWithResult(_0x3a584a,null))['catch'](handleError(_0x3a584a,null));};exports['getDescriptions']=function(_0x4b9b55,_0x3cdff3,_0x5b25c8){var _0x237c51={};var _0x2165a1={};var _0x2ec5f6;var _0x3a7a42;return db['Dynamics365Configuration']['findOne']({'where':{'id':_0x4b9b55[_0x1066('0x51')]['id']}})[_0x1066('0x1c')](handleEntityNotFound(_0x3cdff3,null))[_0x1066('0x1c')](function(_0x682fa8){if(_0x682fa8){_0x2ec5f6=_0x682fa8;_0x2165a1[_0x1066('0x3f')]=_[_0x1066('0x4d')](db['Dynamics365Field'][_0x1066('0x39')]);_0x2165a1[_0x1066('0x3c')]=_[_0x1066('0x4d')](_0x4b9b55[_0x1066('0x3c')]);_0x2165a1['filters']=_[_0x1066('0x3e')](_0x2165a1[_0x1066('0x3f')],_0x2165a1[_0x1066('0x3c')]);_0x237c51['attributes']=_[_0x1066('0x3e')](_0x2165a1[_0x1066('0x3f')],qs[_0x1066('0x41')](_0x4b9b55[_0x1066('0x3c')][_0x1066('0x41')]));_0x237c51['attributes']=_0x237c51['attributes']['length']?_0x237c51['attributes']:_0x2165a1[_0x1066('0x3f')];_0x237c51[_0x1066('0x54')]=qs[_0x1066('0x44')](_0x4b9b55[_0x1066('0x3c')][_0x1066('0x44')]);_0x237c51[_0x1066('0x45')]=qs[_0x1066('0x3d')](_[_0x1066('0x46')](_0x4b9b55['query'],_0x2165a1[_0x1066('0x3d')]));if(_0x4b9b55['query'][_0x1066('0x55')]){_0x237c51[_0x1066('0x45')]=_[_0x1066('0x47')](_0x237c51['where'],{'$or':_[_0x1066('0x37')](_0x237c51[_0x1066('0x40')],function(_0x4ca1a0){var _0x557c0a={};_0x557c0a[_0x4ca1a0]={'$like':'%'+_0x4b9b55[_0x1066('0x3c')]['filter']+'%'};return _0x557c0a;})});}_0x237c51=_[_0x1066('0x47')]({},_0x237c51,_0x4b9b55[_0x1066('0x49')]);return _0x2ec5f6[_0x1066('0x59')](_0x237c51);}})[_0x1066('0x1c')](function(_0x551cc1){if(_0x551cc1){_0x3a7a42=_0x551cc1['length'];if(!_0x4b9b55['query'][_0x1066('0x43')](_0x1066('0x57'))){_0x237c51[_0x1066('0x2d')]=qs[_0x1066('0x2d')](_0x4b9b55[_0x1066('0x3c')][_0x1066('0x2d')]);_0x237c51[_0x1066('0x2c')]=qs[_0x1066('0x2c')](_0x4b9b55[_0x1066('0x3c')][_0x1066('0x2c')]);}return _0x2ec5f6[_0x1066('0x59')](_0x237c51);}})['then'](function(_0x4468c0){if(_0x4468c0){return _0x4468c0?{'count':_0x3a7a42,'rows':_0x4468c0}:null;}})[_0x1066('0x1c')](respondWithResult(_0x3cdff3,null))[_0x1066('0x26')](handleError(_0x3cdff3,null));}; \ No newline at end of file +var _0x7b56=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','message','Dynamics365Configuration,\x20%s,\x20%s','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','destroy','stack','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','limit','order','sort','where','filter','type','merge','includeAll','include','findAll','rows','show','params','find','create','body','getFields','findOne','pick','options','hasOwnProperty','getSubjects','Dynamics365Field','getDescriptions','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','squel','crypto','jsforce','to-csv','querystring'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x7b56,0x15d));var _0x67b5=function(_0x59c5b9,_0x4345e9){_0x59c5b9=_0x59c5b9-0x0;var _0x12b298=_0x7b56[_0x59c5b9];return _0x12b298;};'use strict';var pdf=require(_0x67b5('0x0'));var emlformat=require(_0x67b5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x67b5('0x2'));var jsonpatch=require(_0x67b5('0x3'));var rp=require(_0x67b5('0x4'));var moment=require(_0x67b5('0x5'));var BPromise=require(_0x67b5('0x6'));var Mustache=require(_0x67b5('0x7'));var util=require('util');var path=require(_0x67b5('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x67b5('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x67b5('0xa'));var crypto=require(_0x67b5('0xb'));var jsforce=require(_0x67b5('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x67b5('0xd'));var querystring=require(_0x67b5('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x67b5('0xf'));var qs=require(_0x67b5('0x10'));var as=require(_0x67b5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x67b5('0x12'))(_0x67b5('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x67b5('0x14'))['db'];var jayson=require(_0x67b5('0x15'));var client=jayson[_0x67b5('0x16')][_0x67b5('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3f6e96,_0x24bac1,_0x5123c6){if(_0x5123c6){var _0x4f60c2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f60c2[_0x67b5('0x18')](_0x24bac1)){return _0x3f6e96;}else{throw new db['Sequelize'][(_0x67b5('0x19'))](_0x67b5('0x1a'));}}else{return _0x3f6e96;}}function respondWithRpcPromise(_0x1425bb,_0x3964f2,_0x14aa79,_0xac3e3b){return new BPromise(function(_0x1c2085,_0x49ebee){var _0x380529=_0xac3e3b||client;return _0x380529['request'](_0x1425bb,_0x14aa79)[_0x67b5('0x1b')](function(_0x1faeaf){logger[_0x67b5('0x1c')]('Dynamics365Configuration,\x20%s,\x20%s',_0x3964f2,_0x67b5('0x1d'));logger[_0x67b5('0x1e')](_0x67b5('0x1f'),_0x3964f2,_0x67b5('0x1d'),JSON[_0x67b5('0x20')](_0x1faeaf));if(_0x1faeaf['error']){if(_0x1faeaf['error']['code']===0x1f4){logger['error']('Dynamics365Configuration,\x20%s,\x20%s',_0x3964f2,_0x1faeaf[_0x67b5('0x21')][_0x67b5('0x22')]);return _0x49ebee(_0x1faeaf['error'][_0x67b5('0x22')]);}logger[_0x67b5('0x21')](_0x67b5('0x23'),_0x3964f2,_0x1faeaf[_0x67b5('0x21')][_0x67b5('0x22')]);return _0x1c2085(_0x1faeaf[_0x67b5('0x21')][_0x67b5('0x22')]);}else{logger[_0x67b5('0x1c')](_0x67b5('0x23'),_0x3964f2,_0x67b5('0x1d'));_0x1c2085(_0x1faeaf[_0x67b5('0x24')][_0x67b5('0x22')]);}})[_0x67b5('0x25')](function(_0x11a5db){logger[_0x67b5('0x21')](_0x67b5('0x23'),_0x3964f2,_0x11a5db);_0x49ebee(_0x11a5db);});});}function respondWithStatusCode(_0x516a2b,_0x1065d2){_0x1065d2=_0x1065d2||0xcc;return function(_0x13d3ee){if(_0x13d3ee){return _0x516a2b[_0x67b5('0x26')](_0x1065d2);}return _0x516a2b[_0x67b5('0x27')](_0x1065d2)[_0x67b5('0x28')]();};}function respondWithResult(_0xe2d575,_0x2ab57a){_0x2ab57a=_0x2ab57a||0xc8;return function(_0x33a95f){if(_0x33a95f){return _0xe2d575['status'](_0x2ab57a)[_0x67b5('0x29')](_0x33a95f);}};}function respondWithFilteredResult(_0x1c038b,_0x564225){return function(_0x2a0b26){if(_0x2a0b26){var _0x4f6e75=_0x2a0b26[_0x67b5('0x2a')],_0x48ac79=_0x564225[_0x67b5('0x2b')],_0x4db197=_0x564225[_0x67b5('0x2b')]+_0x564225['limit'],_0x35b272;if(_0x4db197>=_0x4f6e75){_0x4db197=_0x4f6e75;_0x35b272=0xc8;}else{_0x35b272=0xce;}_0x1c038b[_0x67b5('0x27')](_0x35b272);return _0x1c038b[_0x67b5('0x2c')](_0x67b5('0x2d'),_0x48ac79+'-'+_0x4db197+'/'+_0x4f6e75)[_0x67b5('0x29')](_0x2a0b26);}return null;};}function patchUpdates(_0x44ee5d){return function(_0x49afc3){try{jsonpatch['apply'](_0x49afc3,_0x44ee5d,!![]);}catch(_0x1f94b4){return BPromise[_0x67b5('0x2e')](_0x1f94b4);}return _0x49afc3[_0x67b5('0x2f')]();};}function saveUpdates(_0xce7c5e,_0x29cab0){return function(_0x2dc122){if(_0x2dc122){return _0x2dc122[_0x67b5('0x30')](_0xce7c5e)[_0x67b5('0x1b')](function(_0x4e42fc){return _0x4e42fc;});}return null;};}function removeEntity(_0x2d6175,_0x3c7681){return function(_0x7006bc){if(_0x7006bc){return _0x7006bc[_0x67b5('0x31')]()[_0x67b5('0x1b')](function(){_0x2d6175[_0x67b5('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x13f1b2,_0x77160f){return function(_0x39492d){if(!_0x39492d){_0x13f1b2[_0x67b5('0x26')](0x194);}return _0x39492d;};}function handleError(_0x1e21fc,_0x2988a5){_0x2988a5=_0x2988a5||0x1f4;return function(_0x3e5a7c){logger['error'](_0x3e5a7c[_0x67b5('0x32')]);if(_0x3e5a7c[_0x67b5('0x33')]){delete _0x3e5a7c[_0x67b5('0x33')];}_0x1e21fc['status'](_0x2988a5)[_0x67b5('0x34')](_0x3e5a7c);};}exports[_0x67b5('0x35')]=function(_0x56d704,_0x59392f){var _0x5081c5={},_0x4b5fb7={},_0x51192b={'count':0x0,'rows':[]};var _0x391f49=_[_0x67b5('0x36')](db[_0x67b5('0x37')][_0x67b5('0x38')],function(_0x12acc0){return{'name':_0x12acc0[_0x67b5('0x39')],'type':_0x12acc0['type'][_0x67b5('0x3a')]};});_0x4b5fb7['model']=_['map'](_0x391f49,_0x67b5('0x33'));_0x4b5fb7[_0x67b5('0x3b')]=_[_0x67b5('0x3c')](_0x56d704[_0x67b5('0x3b')]);_0x4b5fb7[_0x67b5('0x3d')]=_[_0x67b5('0x3e')](_0x4b5fb7[_0x67b5('0x3f')],_0x4b5fb7[_0x67b5('0x3b')]);_0x5081c5[_0x67b5('0x40')]=_['intersection'](_0x4b5fb7['model'],qs[_0x67b5('0x41')](_0x56d704[_0x67b5('0x3b')]['fields']));_0x5081c5[_0x67b5('0x40')]=_0x5081c5['attributes'][_0x67b5('0x42')]?_0x5081c5['attributes']:_0x4b5fb7[_0x67b5('0x3f')];if(!_0x56d704[_0x67b5('0x3b')]['hasOwnProperty']('nolimit')){_0x5081c5[_0x67b5('0x43')]=qs['limit'](_0x56d704['query'][_0x67b5('0x43')]);_0x5081c5[_0x67b5('0x2b')]=qs[_0x67b5('0x2b')](_0x56d704[_0x67b5('0x3b')]['offset']);}_0x5081c5[_0x67b5('0x44')]=qs['sort'](_0x56d704[_0x67b5('0x3b')][_0x67b5('0x45')]);_0x5081c5[_0x67b5('0x46')]=qs[_0x67b5('0x3d')](_['pick'](_0x56d704[_0x67b5('0x3b')],_0x4b5fb7[_0x67b5('0x3d')]));if(_0x56d704[_0x67b5('0x3b')][_0x67b5('0x47')]){_0x5081c5[_0x67b5('0x46')]=_['merge'](_0x5081c5[_0x67b5('0x46')],{'$or':_['map'](_0x391f49,function(_0x376a83){if(_0x376a83[_0x67b5('0x48')]!=='VIRTUAL'){var _0x4471dd={};_0x4471dd[_0x376a83['name']]={'$like':'%'+_0x56d704[_0x67b5('0x3b')][_0x67b5('0x47')]+'%'};return _0x4471dd;}})});}_0x5081c5=_[_0x67b5('0x49')]({},_0x5081c5,_0x56d704['options']);var _0x261238={'where':_0x5081c5[_0x67b5('0x46')]};return db['Dynamics365Configuration'][_0x67b5('0x2a')](_0x261238)[_0x67b5('0x1b')](function(_0x7dd077){_0x51192b['count']=_0x7dd077;if(_0x56d704[_0x67b5('0x3b')][_0x67b5('0x4a')]){_0x5081c5[_0x67b5('0x4b')]=[{'all':!![]}];}return db[_0x67b5('0x37')][_0x67b5('0x4c')](_0x5081c5);})[_0x67b5('0x1b')](function(_0x4ab452){_0x51192b[_0x67b5('0x4d')]=_0x4ab452;return _0x51192b;})[_0x67b5('0x1b')](respondWithFilteredResult(_0x59392f,_0x5081c5))[_0x67b5('0x25')](handleError(_0x59392f,null));};exports[_0x67b5('0x4e')]=function(_0xa695d1,_0x2bcaa3){var _0x377ee6={'raw':![],'where':{'id':_0xa695d1[_0x67b5('0x4f')]['id']}},_0x1f96cd={};_0x1f96cd[_0x67b5('0x3f')]=_[_0x67b5('0x3c')](db['Dynamics365Configuration'][_0x67b5('0x38')]);_0x1f96cd['query']=_[_0x67b5('0x3c')](_0xa695d1[_0x67b5('0x3b')]);_0x1f96cd[_0x67b5('0x3d')]=_[_0x67b5('0x3e')](_0x1f96cd[_0x67b5('0x3f')],_0x1f96cd['query']);_0x377ee6[_0x67b5('0x40')]=_[_0x67b5('0x3e')](_0x1f96cd['model'],qs['fields'](_0xa695d1[_0x67b5('0x3b')][_0x67b5('0x41')]));_0x377ee6[_0x67b5('0x40')]=_0x377ee6['attributes'][_0x67b5('0x42')]?_0x377ee6[_0x67b5('0x40')]:_0x1f96cd[_0x67b5('0x3f')];if(_0xa695d1[_0x67b5('0x3b')][_0x67b5('0x4a')]){_0x377ee6[_0x67b5('0x4b')]=[{'all':!![]}];}_0x377ee6=_['merge']({},_0x377ee6,_0xa695d1['options']);return db[_0x67b5('0x37')][_0x67b5('0x50')](_0x377ee6)[_0x67b5('0x1b')](handleEntityNotFound(_0x2bcaa3,null))[_0x67b5('0x1b')](respondWithResult(_0x2bcaa3,null))['catch'](handleError(_0x2bcaa3,null));};exports[_0x67b5('0x51')]=function(_0x20447a,_0x1884a7){return db[_0x67b5('0x37')][_0x67b5('0x51')](_0x20447a['body'],{})[_0x67b5('0x1b')](respondWithResult(_0x1884a7,0xc9))[_0x67b5('0x25')](handleError(_0x1884a7,null));};exports[_0x67b5('0x30')]=function(_0x869f0,_0xe559f9){if(_0x869f0[_0x67b5('0x52')]['id']){delete _0x869f0[_0x67b5('0x52')]['id'];}return db[_0x67b5('0x37')][_0x67b5('0x50')]({'where':{'id':_0x869f0['params']['id']}})[_0x67b5('0x1b')](handleEntityNotFound(_0xe559f9,null))['then'](saveUpdates(_0x869f0[_0x67b5('0x52')],null))[_0x67b5('0x1b')](respondWithResult(_0xe559f9,null))[_0x67b5('0x25')](handleError(_0xe559f9,null));};exports[_0x67b5('0x31')]=function(_0x216f21,_0xe40327){return db[_0x67b5('0x37')][_0x67b5('0x50')]({'where':{'id':_0x216f21[_0x67b5('0x4f')]['id']}})[_0x67b5('0x1b')](handleEntityNotFound(_0xe40327,null))['then'](removeEntity(_0xe40327,null))[_0x67b5('0x25')](handleError(_0xe40327,null));};exports[_0x67b5('0x53')]=function(_0x10f928,_0x4ebe03,_0x2e5a0b){var _0x482073={};var _0x57e98b={};var _0xd2c916;var _0x1639c6;return db[_0x67b5('0x37')][_0x67b5('0x54')]({'where':{'id':_0x10f928[_0x67b5('0x4f')]['id']}})[_0x67b5('0x1b')](handleEntityNotFound(_0x4ebe03,null))[_0x67b5('0x1b')](function(_0x251be4){if(_0x251be4){_0xd2c916=_0x251be4;_0x57e98b['model']=_[_0x67b5('0x3c')](db['Dynamics365Field']['rawAttributes']);_0x57e98b[_0x67b5('0x3b')]=_[_0x67b5('0x3c')](_0x10f928[_0x67b5('0x3b')]);_0x57e98b[_0x67b5('0x3d')]=_[_0x67b5('0x3e')](_0x57e98b[_0x67b5('0x3f')],_0x57e98b[_0x67b5('0x3b')]);_0x482073[_0x67b5('0x40')]=_[_0x67b5('0x3e')](_0x57e98b[_0x67b5('0x3f')],qs['fields'](_0x10f928[_0x67b5('0x3b')]['fields']));_0x482073[_0x67b5('0x40')]=_0x482073['attributes'][_0x67b5('0x42')]?_0x482073[_0x67b5('0x40')]:_0x57e98b[_0x67b5('0x3f')];_0x482073[_0x67b5('0x44')]=qs['sort'](_0x10f928[_0x67b5('0x3b')][_0x67b5('0x45')]);_0x482073['where']=qs[_0x67b5('0x3d')](_[_0x67b5('0x55')](_0x10f928['query'],_0x57e98b[_0x67b5('0x3d')]));if(_0x10f928['query'][_0x67b5('0x47')]){_0x482073[_0x67b5('0x46')]=_[_0x67b5('0x49')](_0x482073['where'],{'$or':_[_0x67b5('0x36')](_0x482073[_0x67b5('0x40')],function(_0x362bd8){var _0x11b665={};_0x11b665[_0x362bd8]={'$like':'%'+_0x10f928[_0x67b5('0x3b')][_0x67b5('0x47')]+'%'};return _0x11b665;})});}_0x482073=_[_0x67b5('0x49')]({},_0x482073,_0x10f928[_0x67b5('0x56')]);return _0xd2c916[_0x67b5('0x53')](_0x482073);}})[_0x67b5('0x1b')](function(_0x534b28){if(_0x534b28){_0x1639c6=_0x534b28['length'];if(!_0x10f928['query'][_0x67b5('0x57')]('nolimit')){_0x482073[_0x67b5('0x43')]=qs[_0x67b5('0x43')](_0x10f928[_0x67b5('0x3b')][_0x67b5('0x43')]);_0x482073[_0x67b5('0x2b')]=qs['offset'](_0x10f928[_0x67b5('0x3b')][_0x67b5('0x2b')]);}return _0xd2c916[_0x67b5('0x53')](_0x482073);}})[_0x67b5('0x1b')](function(_0x82223a){if(_0x82223a){return _0x82223a?{'count':_0x1639c6,'rows':_0x82223a}:null;}})[_0x67b5('0x1b')](respondWithResult(_0x4ebe03,null))[_0x67b5('0x25')](handleError(_0x4ebe03,null));};exports[_0x67b5('0x58')]=function(_0x29d9c4,_0x37b4a0,_0x525c10){var _0x5b0b96={};var _0x16dd2b={};var _0x9c51e2;var _0x645f14;return db[_0x67b5('0x37')]['findOne']({'where':{'id':_0x29d9c4[_0x67b5('0x4f')]['id']}})['then'](handleEntityNotFound(_0x37b4a0,null))[_0x67b5('0x1b')](function(_0x5f12a4){if(_0x5f12a4){_0x9c51e2=_0x5f12a4;_0x16dd2b[_0x67b5('0x3f')]=_[_0x67b5('0x3c')](db[_0x67b5('0x59')]['rawAttributes']);_0x16dd2b[_0x67b5('0x3b')]=_[_0x67b5('0x3c')](_0x29d9c4['query']);_0x16dd2b[_0x67b5('0x3d')]=_[_0x67b5('0x3e')](_0x16dd2b[_0x67b5('0x3f')],_0x16dd2b[_0x67b5('0x3b')]);_0x5b0b96['attributes']=_[_0x67b5('0x3e')](_0x16dd2b[_0x67b5('0x3f')],qs['fields'](_0x29d9c4[_0x67b5('0x3b')]['fields']));_0x5b0b96[_0x67b5('0x40')]=_0x5b0b96[_0x67b5('0x40')][_0x67b5('0x42')]?_0x5b0b96[_0x67b5('0x40')]:_0x16dd2b[_0x67b5('0x3f')];_0x5b0b96['order']=qs['sort'](_0x29d9c4[_0x67b5('0x3b')][_0x67b5('0x45')]);_0x5b0b96['where']=qs[_0x67b5('0x3d')](_[_0x67b5('0x55')](_0x29d9c4[_0x67b5('0x3b')],_0x16dd2b[_0x67b5('0x3d')]));if(_0x29d9c4['query'][_0x67b5('0x47')]){_0x5b0b96[_0x67b5('0x46')]=_[_0x67b5('0x49')](_0x5b0b96[_0x67b5('0x46')],{'$or':_[_0x67b5('0x36')](_0x5b0b96['attributes'],function(_0x101316){var _0x163e7c={};_0x163e7c[_0x101316]={'$like':'%'+_0x29d9c4[_0x67b5('0x3b')]['filter']+'%'};return _0x163e7c;})});}_0x5b0b96=_[_0x67b5('0x49')]({},_0x5b0b96,_0x29d9c4[_0x67b5('0x56')]);return _0x9c51e2[_0x67b5('0x58')](_0x5b0b96);}})[_0x67b5('0x1b')](function(_0x348803){if(_0x348803){_0x645f14=_0x348803[_0x67b5('0x42')];if(!_0x29d9c4[_0x67b5('0x3b')]['hasOwnProperty']('nolimit')){_0x5b0b96[_0x67b5('0x43')]=qs[_0x67b5('0x43')](_0x29d9c4[_0x67b5('0x3b')][_0x67b5('0x43')]);_0x5b0b96[_0x67b5('0x2b')]=qs[_0x67b5('0x2b')](_0x29d9c4[_0x67b5('0x3b')][_0x67b5('0x2b')]);}return _0x9c51e2['getSubjects'](_0x5b0b96);}})[_0x67b5('0x1b')](function(_0x38a7ec){if(_0x38a7ec){return _0x38a7ec?{'count':_0x645f14,'rows':_0x38a7ec}:null;}})[_0x67b5('0x1b')](respondWithResult(_0x37b4a0,null))[_0x67b5('0x25')](handleError(_0x37b4a0,null));};exports[_0x67b5('0x5a')]=function(_0x2c8b9d,_0x505242,_0x4b5ca9){var _0x1feeb7={};var _0x2f07a7={};var _0xc37c76;var _0x1da59b;return db['Dynamics365Configuration'][_0x67b5('0x54')]({'where':{'id':_0x2c8b9d['params']['id']}})[_0x67b5('0x1b')](handleEntityNotFound(_0x505242,null))[_0x67b5('0x1b')](function(_0x1da868){if(_0x1da868){_0xc37c76=_0x1da868;_0x2f07a7[_0x67b5('0x3f')]=_[_0x67b5('0x3c')](db[_0x67b5('0x59')][_0x67b5('0x38')]);_0x2f07a7[_0x67b5('0x3b')]=_[_0x67b5('0x3c')](_0x2c8b9d[_0x67b5('0x3b')]);_0x2f07a7[_0x67b5('0x3d')]=_[_0x67b5('0x3e')](_0x2f07a7[_0x67b5('0x3f')],_0x2f07a7[_0x67b5('0x3b')]);_0x1feeb7[_0x67b5('0x40')]=_[_0x67b5('0x3e')](_0x2f07a7[_0x67b5('0x3f')],qs['fields'](_0x2c8b9d['query'][_0x67b5('0x41')]));_0x1feeb7[_0x67b5('0x40')]=_0x1feeb7['attributes'][_0x67b5('0x42')]?_0x1feeb7[_0x67b5('0x40')]:_0x2f07a7[_0x67b5('0x3f')];_0x1feeb7[_0x67b5('0x44')]=qs[_0x67b5('0x45')](_0x2c8b9d[_0x67b5('0x3b')][_0x67b5('0x45')]);_0x1feeb7[_0x67b5('0x46')]=qs[_0x67b5('0x3d')](_[_0x67b5('0x55')](_0x2c8b9d[_0x67b5('0x3b')],_0x2f07a7[_0x67b5('0x3d')]));if(_0x2c8b9d[_0x67b5('0x3b')]['filter']){_0x1feeb7['where']=_[_0x67b5('0x49')](_0x1feeb7[_0x67b5('0x46')],{'$or':_[_0x67b5('0x36')](_0x1feeb7['attributes'],function(_0x23fec2){var _0x147959={};_0x147959[_0x23fec2]={'$like':'%'+_0x2c8b9d['query'][_0x67b5('0x47')]+'%'};return _0x147959;})});}_0x1feeb7=_[_0x67b5('0x49')]({},_0x1feeb7,_0x2c8b9d['options']);return _0xc37c76[_0x67b5('0x5a')](_0x1feeb7);}})['then'](function(_0x475950){if(_0x475950){_0x1da59b=_0x475950[_0x67b5('0x42')];if(!_0x2c8b9d[_0x67b5('0x3b')][_0x67b5('0x57')]('nolimit')){_0x1feeb7[_0x67b5('0x43')]=qs['limit'](_0x2c8b9d[_0x67b5('0x3b')][_0x67b5('0x43')]);_0x1feeb7['offset']=qs[_0x67b5('0x2b')](_0x2c8b9d[_0x67b5('0x3b')]['offset']);}return _0xc37c76[_0x67b5('0x5a')](_0x1feeb7);}})[_0x67b5('0x1b')](function(_0x326382){if(_0x326382){return _0x326382?{'count':_0x1da59b,'rows':_0x326382}:null;}})[_0x67b5('0x1b')](respondWithResult(_0x505242,null))[_0x67b5('0x25')](handleError(_0x505242,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index 899f382..ee9fdd9 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 _0xf0fd=['../../config/environment','./intDynamics365Configuration.attributes','exports','Dynamics365Configuration','int_dynamics365_configurations','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x16ac90,_0x22d602){var _0x580bfc=function(_0xe3b901){while(--_0xe3b901){_0x16ac90['push'](_0x16ac90['shift']());}};_0x580bfc(++_0x22d602);}(_0xf0fd,0x18b));var _0xdf0f=function(_0x662edd,_0x1d9abb){_0x662edd=_0x662edd-0x0;var _0x3687c8=_0xf0fd[_0x662edd];return _0x3687c8;};'use strict';var _=require(_0xdf0f('0x0'));var util=require(_0xdf0f('0x1'));var logger=require('../../config/logger')(_0xdf0f('0x2'));var moment=require(_0xdf0f('0x3'));var BPromise=require(_0xdf0f('0x4'));var rp=require(_0xdf0f('0x5'));var fs=require('fs');var path=require(_0xdf0f('0x6'));var rimraf=require(_0xdf0f('0x7'));var config=require(_0xdf0f('0x8'));var attributes=require(_0xdf0f('0x9'));module[_0xdf0f('0xa')]=function(_0x417e85,_0x431269){return _0x417e85['define'](_0xdf0f('0xb'),attributes,{'tableName':_0xdf0f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x89bf=['../../config/logger','moment','request-promise','path','../../config/environment','./intDynamics365Configuration.attributes','exports','define','Dynamics365Configuration','int_dynamics365_configurations','lodash'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x89bf,0x11d));var _0xf89b=function(_0x316b12,_0x12a04f){_0x316b12=_0x316b12-0x0;var _0x29769f=_0x89bf[_0x316b12];return _0x29769f;};'use strict';var _=require(_0xf89b('0x0'));var util=require('util');var logger=require(_0xf89b('0x1'))('api');var moment=require(_0xf89b('0x2'));var BPromise=require('bluebird');var rp=require(_0xf89b('0x3'));var fs=require('fs');var path=require(_0xf89b('0x4'));var rimraf=require('rimraf');var config=require(_0xf89b('0x5'));var attributes=require(_0xf89b('0x6'));module[_0xf89b('0x7')]=function(_0x2fa0a2,_0x26a35a){return _0x2fa0a2[_0xf89b('0x8')](_0xf89b('0x9'),attributes,{'tableName':_0xf89b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.rpc.js index 2c8a31d..37a5dda 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 _0xb8cc=['code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1ec8e3,_0x4014dc){var _0xb338d8=function(_0x3f6246){while(--_0x3f6246){_0x1ec8e3['push'](_0x1ec8e3['shift']());}};_0xb338d8(++_0x4014dc);}(_0xb8cc,0x82));var _0xcb8c=function(_0xd86092,_0x1b6272){_0xd86092=_0xd86092-0x0;var _0x544e2f=_0xb8cc[_0xd86092];return _0x544e2f;};'use strict';var _=require(_0xcb8c('0x0'));var util=require(_0xcb8c('0x1'));var moment=require('moment');var BPromise=require(_0xcb8c('0x2'));var rs=require(_0xcb8c('0x3'));var fs=require('fs');var Redis=require(_0xcb8c('0x4'));var db=require(_0xcb8c('0x5'))['db'];var utils=require(_0xcb8c('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcb8c('0x7'));var client=jayson[_0xcb8c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x544b5a,_0x1161d8,_0x5bbc15){return new BPromise(function(_0x5d6df0,_0x4a2f41){return client[_0xcb8c('0x9')](_0x544b5a,_0x5bbc15)[_0xcb8c('0xa')](function(_0x109866){logger[_0xcb8c('0xb')](_0xcb8c('0xc'),_0x1161d8,_0xcb8c('0xd'));logger['debug'](_0xcb8c('0xe'),_0x1161d8,_0xcb8c('0xd'),JSON[_0xcb8c('0xf')](_0x109866));if(_0x109866[_0xcb8c('0x10')]){if(_0x109866[_0xcb8c('0x10')][_0xcb8c('0x11')]===0x1f4){logger[_0xcb8c('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1161d8,_0x109866[_0xcb8c('0x10')][_0xcb8c('0x12')]);return _0x4a2f41(_0x109866[_0xcb8c('0x10')][_0xcb8c('0x12')]);}logger[_0xcb8c('0x10')](_0xcb8c('0xc'),_0x1161d8,_0x109866[_0xcb8c('0x10')][_0xcb8c('0x12')]);return _0x5d6df0(_0x109866[_0xcb8c('0x10')][_0xcb8c('0x12')]);}else{logger[_0xcb8c('0xb')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1161d8,_0xcb8c('0xd'));_0x5d6df0(_0x109866[_0xcb8c('0x13')][_0xcb8c('0x12')]);}})[_0xcb8c('0x14')](function(_0x22c9d1){logger[_0xcb8c('0x10')]('Dynamics365Configuration,\x20%s,\x20%s',_0x1161d8,_0x22c9d1);_0x4a2f41(_0x22c9d1);});});} \ No newline at end of file +var _0xd19f=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x44e50a,_0x1cc4a2){var _0x1b5994=function(_0x29a487){while(--_0x29a487){_0x44e50a['push'](_0x44e50a['shift']());}};_0x1b5994(++_0x1cc4a2);}(_0xd19f,0xea));var _0xfd19=function(_0x16aaef,_0x410651){_0x16aaef=_0x16aaef-0x0;var _0x1c82ef=_0xd19f[_0x16aaef];return _0x1c82ef;};'use strict';var _=require(_0xfd19('0x0'));var util=require(_0xfd19('0x1'));var moment=require(_0xfd19('0x2'));var BPromise=require(_0xfd19('0x3'));var rs=require(_0xfd19('0x4'));var fs=require('fs');var Redis=require(_0xfd19('0x5'));var db=require(_0xfd19('0x6'))['db'];var utils=require(_0xfd19('0x7'));var logger=require('../../config/logger')(_0xfd19('0x8'));var config=require(_0xfd19('0x9'));var jayson=require(_0xfd19('0xa'));var client=jayson[_0xfd19('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1fec27,_0xecdf82,_0x9812a1){return new BPromise(function(_0x1942db,_0x3ecee4){return client[_0xfd19('0xc')](_0x1fec27,_0x9812a1)[_0xfd19('0xd')](function(_0x45c23a){logger[_0xfd19('0xe')](_0xfd19('0xf'),_0xecdf82,_0xfd19('0x10'));logger[_0xfd19('0x11')]('Dynamics365Configuration,\x20%s,\x20%s,\x20%s',_0xecdf82,_0xfd19('0x10'),JSON[_0xfd19('0x12')](_0x45c23a));if(_0x45c23a['error']){if(_0x45c23a[_0xfd19('0x13')][_0xfd19('0x14')]===0x1f4){logger[_0xfd19('0x13')](_0xfd19('0xf'),_0xecdf82,_0x45c23a[_0xfd19('0x13')][_0xfd19('0x15')]);return _0x3ecee4(_0x45c23a['error'][_0xfd19('0x15')]);}logger['error'](_0xfd19('0xf'),_0xecdf82,_0x45c23a[_0xfd19('0x13')][_0xfd19('0x15')]);return _0x1942db(_0x45c23a[_0xfd19('0x13')][_0xfd19('0x15')]);}else{logger[_0xfd19('0xe')](_0xfd19('0xf'),_0xecdf82,_0xfd19('0x10'));_0x1942db(_0x45c23a[_0xfd19('0x16')][_0xfd19('0x15')]);}})[_0xfd19('0x17')](function(_0x4f0d12){logger[_0xfd19('0x13')](_0xfd19('0xf'),_0xecdf82,_0x4f0d12);_0x3ecee4(_0x4f0d12);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 26d354f..50e048b 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 _0x55ea=['update','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','show','post','create','put','/:id'];(function(_0xa15309,_0x486d32){var _0xd1a6d6=function(_0x6f03da){while(--_0x6f03da){_0xa15309['push'](_0xa15309['shift']());}};_0xd1a6d6(++_0x486d32);}(_0x55ea,0xc9));var _0xa55e=function(_0x4a83c5,_0x14dc28){_0x4a83c5=_0x4a83c5-0x0;var _0x1c3eec=_0x55ea[_0x4a83c5];return _0x1c3eec;};'use strict';var multer=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var path=require(_0xa55e('0x2'));var timeout=require('connect-timeout');var express=require(_0xa55e('0x3'));var router=express[_0xa55e('0x4')]();var auth=require(_0xa55e('0x5'));var interaction=require(_0xa55e('0x6'));var config=require(_0xa55e('0x7'));var controller=require('./intDynamics365Field.controller');router[_0xa55e('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0xa55e('0x9')](),controller[_0xa55e('0xa')]);router[_0xa55e('0xb')]('/',auth[_0xa55e('0x9')](),controller[_0xa55e('0xc')]);router[_0xa55e('0xd')](_0xa55e('0xe'),auth[_0xa55e('0x9')](),controller[_0xa55e('0xf')]);router['delete']('/:id',auth[_0xa55e('0x9')](),controller[_0xa55e('0x10')]);module[_0xa55e('0x11')]=router; \ No newline at end of file +var _0xd404=['create','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x9e5b1d,_0x5d790a){var _0x7accf5=function(_0x54b15b){while(--_0x54b15b){_0x9e5b1d['push'](_0x9e5b1d['shift']());}};_0x7accf5(++_0x5d790a);}(_0xd404,0x15b));var _0x4d40=function(_0x4ddc7f,_0x7aeeda){_0x4ddc7f=_0x4ddc7f-0x0;var _0x33c421=_0xd404[_0x4ddc7f];return _0x33c421;};'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('0xd')]('/',auth['isAuthenticated'](),controller[_0x4d40('0xe')]);router['put']('/:id',auth[_0x4d40('0x9')](),controller[_0x4d40('0xf')]);router[_0x4d40('0x10')](_0x4d40('0xb'),auth[_0x4d40('0x9')](),controller[_0x4d40('0x11')]);module[_0x4d40('0x12')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index edc4668..5d87b8d 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 _0xe49f=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xe49f,0x17b));var _0xfe49=function(_0x4f0e3c,_0xec1366){_0x4f0e3c=_0x4f0e3c-0x0;var _0x8db852=_0xe49f[_0x4f0e3c];return _0x8db852;};'use strict';var Sequelize=require(_0xfe49('0x0'));module['exports']={'type':{'type':Sequelize[_0xfe49('0x1')](_0xfe49('0x2'),_0xfe49('0x3'),_0xfe49('0x4'),_0xfe49('0x5')),'defaultValue':_0xfe49('0x2')},'content':{'type':Sequelize[_0xfe49('0x6')]},'key':{'type':Sequelize[_0xfe49('0x6')]},'keyType':{'type':Sequelize[_0xfe49('0x1')]('string',_0xfe49('0x3'),_0xfe49('0x4'))},'keyContent':{'type':Sequelize[_0xfe49('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xfe49('0x6')]},'customField':{'type':Sequelize[_0xfe49('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfe49('0x6')]}}; \ No newline at end of file +var _0x7800=['STRING','customVariable','sequelize','exports','ENUM','keyValue'];(function(_0x565a37,_0x3e26b7){var _0x2a60e2=function(_0x3b4c77){while(--_0x3b4c77){_0x565a37['push'](_0x565a37['shift']());}};_0x2a60e2(++_0x3e26b7);}(_0x7800,0x1ee));var _0x0780=function(_0x508594,_0x4b8641){_0x508594=_0x508594-0x0;var _0x363645=_0x7800[_0x508594];return _0x363645;};'use strict';var Sequelize=require(_0x0780('0x0'));module[_0x0780('0x1')]={'type':{'type':Sequelize[_0x0780('0x2')]('string','variable','customVariable',_0x0780('0x3')),'defaultValue':'string'},'content':{'type':Sequelize[_0x0780('0x4')]},'key':{'type':Sequelize[_0x0780('0x4')]},'keyType':{'type':Sequelize['ENUM']('string','variable',_0x0780('0x5'))},'keyContent':{'type':Sequelize[_0x0780('0x4')]},'idField':{'type':Sequelize[_0x0780('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0780('0x4')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 9a42aea..e0080b8 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 _0x5bd7=['map','VIRTUAL','options','count','includeAll','include','findAll','rows','params','find','catch','create','update','body','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','index','Dynamics365Field','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','where','merge'];(function(_0x17be7f,_0x1fe8a5){var _0x531f11=function(_0x35f2a7){while(--_0x35f2a7){_0x17be7f['push'](_0x17be7f['shift']());}};_0x531f11(++_0x1fe8a5);}(_0x5bd7,0x12a));var _0x75bd=function(_0x2579dd,_0x426995){_0x2579dd=_0x2579dd-0x0;var _0x13330c=_0x5bd7[_0x2579dd];return _0x13330c;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x75bd('0x0'));var rimraf=require(_0x75bd('0x1'));var zipdir=require(_0x75bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x75bd('0x3'));var moment=require('moment');var BPromise=require(_0x75bd('0x4'));var Mustache=require(_0x75bd('0x5'));var util=require('util');var path=require(_0x75bd('0x6'));var sox=require(_0x75bd('0x7'));var csv=require(_0x75bd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x75bd('0x9'));var squel=require(_0x75bd('0xa'));var crypto=require(_0x75bd('0xb'));var jsforce=require(_0x75bd('0xc'));var deskjs=require(_0x75bd('0xd'));var toCsv=require(_0x75bd('0x8'));var querystring=require(_0x75bd('0xe'));var Papa=require('papaparse');var Redis=require(_0x75bd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x75bd('0x10'));var hardwareService=require(_0x75bd('0x11'));var logger=require(_0x75bd('0x12'))('api');var utils=require(_0x75bd('0x13'));var config=require(_0x75bd('0x14'));var db=require(_0x75bd('0x15'))['db'];function respondWithStatusCode(_0x3fb1de,_0x14e1e5){_0x14e1e5=_0x14e1e5||0xcc;return function(_0x2f698f){if(_0x2f698f){return _0x3fb1de['sendStatus'](_0x14e1e5);}return _0x3fb1de['status'](_0x14e1e5)['end']();};}function respondWithResult(_0x21df25,_0x147532){_0x147532=_0x147532||0xc8;return function(_0x363f78){if(_0x363f78){return _0x21df25[_0x75bd('0x16')](_0x147532)[_0x75bd('0x17')](_0x363f78);}};}function respondWithFilteredResult(_0x254fe8,_0x631be3){return function(_0x23988a){if(_0x23988a){var _0x321412=_0x23988a['count'],_0x48c4f1=_0x631be3[_0x75bd('0x18')],_0x529357=_0x631be3[_0x75bd('0x18')]+_0x631be3['limit'],_0x4fa113;if(_0x529357>=_0x321412){_0x529357=_0x321412;_0x4fa113=0xc8;}else{_0x4fa113=0xce;}_0x254fe8['status'](_0x4fa113);return _0x254fe8[_0x75bd('0x19')](_0x75bd('0x1a'),_0x48c4f1+'-'+_0x529357+'/'+_0x321412)[_0x75bd('0x17')](_0x23988a);}return null;};}function patchUpdates(_0x4a18fd){return function(_0x4b6477){try{jsonpatch[_0x75bd('0x1b')](_0x4b6477,_0x4a18fd,!![]);}catch(_0x5ceb7e){return BPromise[_0x75bd('0x1c')](_0x5ceb7e);}return _0x4b6477[_0x75bd('0x1d')]();};}function saveUpdates(_0x599007,_0x1374e4){return function(_0x58cb64){if(_0x58cb64){return _0x58cb64['update'](_0x599007)[_0x75bd('0x1e')](function(_0x18e22f){return _0x18e22f;});}return null;};}function removeEntity(_0x132b14,_0x334bae){return function(_0x1ba6b3){if(_0x1ba6b3){return _0x1ba6b3[_0x75bd('0x1f')]()[_0x75bd('0x1e')](function(){_0x132b14[_0x75bd('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a619a,_0x44f171){return function(_0x4ce8e2){if(!_0x4ce8e2){_0x1a619a[_0x75bd('0x20')](0x194);}return _0x4ce8e2;};}function handleError(_0x42b215,_0x4b53ff){_0x4b53ff=_0x4b53ff||0x1f4;return function(_0x11aba5){logger[_0x75bd('0x21')](_0x11aba5['stack']);if(_0x11aba5[_0x75bd('0x22')]){delete _0x11aba5[_0x75bd('0x22')];}_0x42b215[_0x75bd('0x16')](_0x4b53ff)[_0x75bd('0x23')](_0x11aba5);};}exports[_0x75bd('0x24')]=function(_0x4dbcf8,_0x115fb0){var _0x74438b={},_0x47a1c1={},_0x4d63c7={'count':0x0,'rows':[]};var _0x5570ff=_['map'](db[_0x75bd('0x25')][_0x75bd('0x26')],function(_0x51b41f){return{'name':_0x51b41f['fieldName'],'type':_0x51b41f[_0x75bd('0x27')][_0x75bd('0x28')]};});_0x47a1c1[_0x75bd('0x29')]=_['map'](_0x5570ff,_0x75bd('0x22'));_0x47a1c1[_0x75bd('0x2a')]=_[_0x75bd('0x2b')](_0x4dbcf8[_0x75bd('0x2a')]);_0x47a1c1[_0x75bd('0x2c')]=_[_0x75bd('0x2d')](_0x47a1c1[_0x75bd('0x29')],_0x47a1c1[_0x75bd('0x2a')]);_0x74438b[_0x75bd('0x2e')]=_[_0x75bd('0x2d')](_0x47a1c1['model'],qs['fields'](_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x2f')]));_0x74438b['attributes']=_0x74438b['attributes'][_0x75bd('0x30')]?_0x74438b[_0x75bd('0x2e')]:_0x47a1c1['model'];if(!_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x31')](_0x75bd('0x32'))){_0x74438b['limit']=qs['limit'](_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x33')]);_0x74438b[_0x75bd('0x18')]=qs[_0x75bd('0x18')](_0x4dbcf8['query']['offset']);}_0x74438b[_0x75bd('0x34')]=qs['sort'](_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x35')]);_0x74438b['where']=qs[_0x75bd('0x2c')](_['pick'](_0x4dbcf8[_0x75bd('0x2a')],_0x47a1c1[_0x75bd('0x2c')]));if(_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x36')]){_0x74438b[_0x75bd('0x37')]=_[_0x75bd('0x38')](_0x74438b[_0x75bd('0x37')],{'$or':_[_0x75bd('0x39')](_0x5570ff,function(_0x455772){if(_0x455772[_0x75bd('0x27')]!==_0x75bd('0x3a')){var _0x241f29={};_0x241f29[_0x455772[_0x75bd('0x22')]]={'$like':'%'+_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x36')]+'%'};return _0x241f29;}})});}_0x74438b=_[_0x75bd('0x38')]({},_0x74438b,_0x4dbcf8[_0x75bd('0x3b')]);var _0x230643={'where':_0x74438b[_0x75bd('0x37')]};return db[_0x75bd('0x25')][_0x75bd('0x3c')](_0x230643)[_0x75bd('0x1e')](function(_0x324712){_0x4d63c7[_0x75bd('0x3c')]=_0x324712;if(_0x4dbcf8[_0x75bd('0x2a')][_0x75bd('0x3d')]){_0x74438b[_0x75bd('0x3e')]=[{'all':!![]}];}return db[_0x75bd('0x25')][_0x75bd('0x3f')](_0x74438b);})[_0x75bd('0x1e')](function(_0x2704db){_0x4d63c7[_0x75bd('0x40')]=_0x2704db;return _0x4d63c7;})['then'](respondWithFilteredResult(_0x115fb0,_0x74438b))['catch'](handleError(_0x115fb0,null));};exports['show']=function(_0x3fee55,_0x2cbf72){var _0x18dba2={'raw':!![],'where':{'id':_0x3fee55[_0x75bd('0x41')]['id']}},_0x2031c9={};_0x2031c9['model']=_[_0x75bd('0x2b')](db[_0x75bd('0x25')][_0x75bd('0x26')]);_0x2031c9[_0x75bd('0x2a')]=_[_0x75bd('0x2b')](_0x3fee55['query']);_0x2031c9[_0x75bd('0x2c')]=_[_0x75bd('0x2d')](_0x2031c9[_0x75bd('0x29')],_0x2031c9[_0x75bd('0x2a')]);_0x18dba2[_0x75bd('0x2e')]=_[_0x75bd('0x2d')](_0x2031c9[_0x75bd('0x29')],qs[_0x75bd('0x2f')](_0x3fee55[_0x75bd('0x2a')]['fields']));_0x18dba2[_0x75bd('0x2e')]=_0x18dba2[_0x75bd('0x2e')][_0x75bd('0x30')]?_0x18dba2[_0x75bd('0x2e')]:_0x2031c9['model'];if(_0x3fee55['query'][_0x75bd('0x3d')]){_0x18dba2[_0x75bd('0x3e')]=[{'all':!![]}];}_0x18dba2=_[_0x75bd('0x38')]({},_0x18dba2,_0x3fee55[_0x75bd('0x3b')]);return db[_0x75bd('0x25')][_0x75bd('0x42')](_0x18dba2)[_0x75bd('0x1e')](handleEntityNotFound(_0x2cbf72,null))[_0x75bd('0x1e')](respondWithResult(_0x2cbf72,null))[_0x75bd('0x43')](handleError(_0x2cbf72,null));};exports[_0x75bd('0x44')]=function(_0x17ba9f,_0x21bd81){return db[_0x75bd('0x25')][_0x75bd('0x44')](_0x17ba9f['body'],{})['then'](respondWithResult(_0x21bd81,0xc9))[_0x75bd('0x43')](handleError(_0x21bd81,null));};exports[_0x75bd('0x45')]=function(_0x382caa,_0x116c7b){if(_0x382caa[_0x75bd('0x46')]['id']){delete _0x382caa[_0x75bd('0x46')]['id'];}return db[_0x75bd('0x25')]['find']({'where':{'id':_0x382caa[_0x75bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x116c7b,null))['then'](saveUpdates(_0x382caa['body'],null))[_0x75bd('0x1e')](respondWithResult(_0x116c7b,null))[_0x75bd('0x43')](handleError(_0x116c7b,null));};exports[_0x75bd('0x1f')]=function(_0x5f14a6,_0x58ac05){return db[_0x75bd('0x25')][_0x75bd('0x42')]({'where':{'id':_0x5f14a6[_0x75bd('0x41')]['id']}})['then'](handleEntityNotFound(_0x58ac05,null))['then'](removeEntity(_0x58ac05,null))[_0x75bd('0x43')](handleError(_0x58ac05,null));}; \ No newline at end of file +var _0x49c1=['index','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','options','Dynamics365Field','includeAll','findAll','rows','catch','include','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','update','then','destroy','stack','name'];(function(_0x21527a,_0x347b95){var _0xa8d961=function(_0x570157){while(--_0x570157){_0x21527a['push'](_0x21527a['shift']());}};_0xa8d961(++_0x347b95);}(_0x49c1,0xef));var _0x149c=function(_0x2ec02d,_0x1c6fbb){_0x2ec02d=_0x2ec02d-0x0;var _0x3624cd=_0x49c1[_0x2ec02d];return _0x3624cd;};'use strict';var pdf=require(_0x149c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x149c('0x1'));var zipdir=require(_0x149c('0x2'));var jsonpatch=require(_0x149c('0x3'));var rp=require('request-promise');var moment=require(_0x149c('0x4'));var BPromise=require(_0x149c('0x5'));var Mustache=require('mustache');var util=require(_0x149c('0x6'));var path=require(_0x149c('0x7'));var sox=require('sox');var csv=require(_0x149c('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x149c('0x9'));var squel=require(_0x149c('0xa'));var crypto=require('crypto');var jsforce=require(_0x149c('0xb'));var deskjs=require(_0x149c('0xc'));var toCsv=require('to-csv');var querystring=require(_0x149c('0xd'));var Papa=require(_0x149c('0xe'));var Redis=require('ioredis');var authService=require(_0x149c('0xf'));var qs=require(_0x149c('0x10'));var as=require(_0x149c('0x11'));var hardwareService=require(_0x149c('0x12'));var logger=require('../../config/logger')(_0x149c('0x13'));var utils=require(_0x149c('0x14'));var config=require(_0x149c('0x15'));var db=require(_0x149c('0x16'))['db'];function respondWithStatusCode(_0x32a56c,_0x19e0b1){_0x19e0b1=_0x19e0b1||0xcc;return function(_0x1a0c32){if(_0x1a0c32){return _0x32a56c[_0x149c('0x17')](_0x19e0b1);}return _0x32a56c['status'](_0x19e0b1)[_0x149c('0x18')]();};}function respondWithResult(_0x2125a2,_0x4aee29){_0x4aee29=_0x4aee29||0xc8;return function(_0x3b247e){if(_0x3b247e){return _0x2125a2['status'](_0x4aee29)[_0x149c('0x19')](_0x3b247e);}};}function respondWithFilteredResult(_0x1d2a83,_0x177800){return function(_0x471e93){if(_0x471e93){var _0x3d851a=_0x471e93[_0x149c('0x1a')],_0x30f8c1=_0x177800['offset'],_0x3659eb=_0x177800[_0x149c('0x1b')]+_0x177800[_0x149c('0x1c')],_0x3e966f;if(_0x3659eb>=_0x3d851a){_0x3659eb=_0x3d851a;_0x3e966f=0xc8;}else{_0x3e966f=0xce;}_0x1d2a83[_0x149c('0x1d')](_0x3e966f);return _0x1d2a83[_0x149c('0x1e')](_0x149c('0x1f'),_0x30f8c1+'-'+_0x3659eb+'/'+_0x3d851a)[_0x149c('0x19')](_0x471e93);}return null;};}function patchUpdates(_0x653d6){return function(_0x3290e4){try{jsonpatch['apply'](_0x3290e4,_0x653d6,!![]);}catch(_0x1f4f40){return BPromise['reject'](_0x1f4f40);}return _0x3290e4['save']();};}function saveUpdates(_0x528337,_0x4c9b41){return function(_0x14194d){if(_0x14194d){return _0x14194d[_0x149c('0x20')](_0x528337)[_0x149c('0x21')](function(_0x37bf11){return _0x37bf11;});}return null;};}function removeEntity(_0x4e4053,_0x184924){return function(_0x4e663e){if(_0x4e663e){return _0x4e663e[_0x149c('0x22')]()[_0x149c('0x21')](function(){_0x4e4053[_0x149c('0x1d')](0xcc)[_0x149c('0x18')]();});}};}function handleEntityNotFound(_0x2cdd54,_0xb60e06){return function(_0x238363){if(!_0x238363){_0x2cdd54[_0x149c('0x17')](0x194);}return _0x238363;};}function handleError(_0x48e34c,_0x39bfee){_0x39bfee=_0x39bfee||0x1f4;return function(_0x364059){logger['error'](_0x364059[_0x149c('0x23')]);if(_0x364059[_0x149c('0x24')]){delete _0x364059[_0x149c('0x24')];}_0x48e34c[_0x149c('0x1d')](_0x39bfee)['send'](_0x364059);};}exports[_0x149c('0x25')]=function(_0x106061,_0x3a9090){var _0x1ba032={},_0x149705={},_0x44f3c6={'count':0x0,'rows':[]};var _0x16f5d6=_['map'](db['Dynamics365Field'][_0x149c('0x26')],function(_0x1203f2){return{'name':_0x1203f2[_0x149c('0x27')],'type':_0x1203f2['type'][_0x149c('0x28')]};});_0x149705[_0x149c('0x29')]=_[_0x149c('0x2a')](_0x16f5d6,_0x149c('0x24'));_0x149705['query']=_[_0x149c('0x2b')](_0x106061[_0x149c('0x2c')]);_0x149705[_0x149c('0x2d')]=_[_0x149c('0x2e')](_0x149705[_0x149c('0x29')],_0x149705['query']);_0x1ba032[_0x149c('0x2f')]=_['intersection'](_0x149705[_0x149c('0x29')],qs[_0x149c('0x30')](_0x106061[_0x149c('0x2c')][_0x149c('0x30')]));_0x1ba032[_0x149c('0x2f')]=_0x1ba032[_0x149c('0x2f')][_0x149c('0x31')]?_0x1ba032['attributes']:_0x149705[_0x149c('0x29')];if(!_0x106061['query'][_0x149c('0x32')]('nolimit')){_0x1ba032[_0x149c('0x1c')]=qs['limit'](_0x106061[_0x149c('0x2c')][_0x149c('0x1c')]);_0x1ba032['offset']=qs['offset'](_0x106061[_0x149c('0x2c')][_0x149c('0x1b')]);}_0x1ba032['order']=qs['sort'](_0x106061[_0x149c('0x2c')][_0x149c('0x33')]);_0x1ba032[_0x149c('0x34')]=qs[_0x149c('0x2d')](_[_0x149c('0x35')](_0x106061[_0x149c('0x2c')],_0x149705['filters']));if(_0x106061[_0x149c('0x2c')][_0x149c('0x36')]){_0x1ba032[_0x149c('0x34')]=_[_0x149c('0x37')](_0x1ba032['where'],{'$or':_[_0x149c('0x2a')](_0x16f5d6,function(_0x176bcf){if(_0x176bcf[_0x149c('0x38')]!==_0x149c('0x39')){var _0x5d3f68={};_0x5d3f68[_0x176bcf['name']]={'$like':'%'+_0x106061[_0x149c('0x2c')][_0x149c('0x36')]+'%'};return _0x5d3f68;}})});}_0x1ba032=_['merge']({},_0x1ba032,_0x106061[_0x149c('0x3a')]);var _0x4e6a3f={'where':_0x1ba032[_0x149c('0x34')]};return db[_0x149c('0x3b')][_0x149c('0x1a')](_0x4e6a3f)[_0x149c('0x21')](function(_0x11387d){_0x44f3c6['count']=_0x11387d;if(_0x106061[_0x149c('0x2c')][_0x149c('0x3c')]){_0x1ba032['include']=[{'all':!![]}];}return db['Dynamics365Field'][_0x149c('0x3d')](_0x1ba032);})[_0x149c('0x21')](function(_0x5a3f90){_0x44f3c6[_0x149c('0x3e')]=_0x5a3f90;return _0x44f3c6;})[_0x149c('0x21')](respondWithFilteredResult(_0x3a9090,_0x1ba032))[_0x149c('0x3f')](handleError(_0x3a9090,null));};exports['show']=function(_0x55d804,_0x248c9e){var _0x14f790={'raw':!![],'where':{'id':_0x55d804['params']['id']}},_0x1ab916={};_0x1ab916[_0x149c('0x29')]=_['keys'](db['Dynamics365Field'][_0x149c('0x26')]);_0x1ab916[_0x149c('0x2c')]=_[_0x149c('0x2b')](_0x55d804[_0x149c('0x2c')]);_0x1ab916[_0x149c('0x2d')]=_[_0x149c('0x2e')](_0x1ab916['model'],_0x1ab916[_0x149c('0x2c')]);_0x14f790[_0x149c('0x2f')]=_[_0x149c('0x2e')](_0x1ab916[_0x149c('0x29')],qs[_0x149c('0x30')](_0x55d804[_0x149c('0x2c')][_0x149c('0x30')]));_0x14f790[_0x149c('0x2f')]=_0x14f790[_0x149c('0x2f')][_0x149c('0x31')]?_0x14f790['attributes']:_0x1ab916[_0x149c('0x29')];if(_0x55d804[_0x149c('0x2c')][_0x149c('0x3c')]){_0x14f790[_0x149c('0x40')]=[{'all':!![]}];}_0x14f790=_[_0x149c('0x37')]({},_0x14f790,_0x55d804['options']);return db['Dynamics365Field'][_0x149c('0x41')](_0x14f790)['then'](handleEntityNotFound(_0x248c9e,null))[_0x149c('0x21')](respondWithResult(_0x248c9e,null))[_0x149c('0x3f')](handleError(_0x248c9e,null));};exports['create']=function(_0x4ffa7f,_0x470f64){return db[_0x149c('0x3b')][_0x149c('0x42')](_0x4ffa7f[_0x149c('0x43')],{})['then'](respondWithResult(_0x470f64,0xc9))['catch'](handleError(_0x470f64,null));};exports[_0x149c('0x20')]=function(_0x25584b,_0x5b9a8e){if(_0x25584b['body']['id']){delete _0x25584b['body']['id'];}return db[_0x149c('0x3b')][_0x149c('0x41')]({'where':{'id':_0x25584b[_0x149c('0x44')]['id']}})[_0x149c('0x21')](handleEntityNotFound(_0x5b9a8e,null))['then'](saveUpdates(_0x25584b[_0x149c('0x43')],null))[_0x149c('0x21')](respondWithResult(_0x5b9a8e,null))[_0x149c('0x3f')](handleError(_0x5b9a8e,null));};exports['destroy']=function(_0xe4f81a,_0x16de3f){return db['Dynamics365Field']['find']({'where':{'id':_0xe4f81a['params']['id']}})['then'](handleEntityNotFound(_0x16de3f,null))[_0x149c('0x21')](removeEntity(_0x16de3f,null))[_0x149c('0x3f')](handleError(_0x16de3f,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index cf22d73..4ab21e8 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 _0xe21e=['idField','FieldId','lodash','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','int_dynamics365_fields','dynamics365_unique_index'];(function(_0xdbb6cb,_0x3b8fda){var _0x476b50=function(_0x470ebb){while(--_0x470ebb){_0xdbb6cb['push'](_0xdbb6cb['shift']());}};_0x476b50(++_0x3b8fda);}(_0xe21e,0x8e));var _0xee21=function(_0x14182e,_0x41e5d9){_0x14182e=_0x14182e-0x0;var _0x4c8e7f=_0xe21e[_0x14182e];return _0x4c8e7f;};'use strict';var _=require(_0xee21('0x0'));var util=require('util');var logger=require(_0xee21('0x1'))(_0xee21('0x2'));var moment=require('moment');var BPromise=require(_0xee21('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee21('0x4'));var rimraf=require(_0xee21('0x5'));var config=require(_0xee21('0x6'));var attributes=require(_0xee21('0x7'));module[_0xee21('0x8')]=function(_0x501f94,_0x114293){return _0x501f94[_0xee21('0x9')]('Dynamics365Field',attributes,{'tableName':_0xee21('0xa'),'paranoid':![],'indexes':[{'name':_0xee21('0xb'),'fields':[_0xee21('0xc'),_0xee21('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa624=['FieldId','lodash','util','../../config/logger','moment','bluebird','rimraf','../../config/environment','./intDynamics365Field.attributes','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index'];(function(_0x351023,_0xcdcadb){var _0x3b9ddd=function(_0x44cfd2){while(--_0x44cfd2){_0x351023['push'](_0x351023['shift']());}};_0x3b9ddd(++_0xcdcadb);}(_0xa624,0x153));var _0x4a62=function(_0x1ebce2,_0x10e903){_0x1ebce2=_0x1ebce2-0x0;var _0x4a330c=_0xa624[_0x1ebce2];return _0x4a330c;};'use strict';var _=require(_0x4a62('0x0'));var util=require(_0x4a62('0x1'));var logger=require(_0x4a62('0x2'))('api');var moment=require(_0x4a62('0x3'));var BPromise=require(_0x4a62('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4a62('0x5'));var config=require(_0x4a62('0x6'));var attributes=require(_0x4a62('0x7'));module['exports']=function(_0x3f0262,_0x25140e){return _0x3f0262[_0x4a62('0x8')](_0x4a62('0x9'),attributes,{'tableName':_0x4a62('0xa'),'paranoid':![],'indexes':[{'name':_0x4a62('0xb'),'fields':['idField',_0x4a62('0xc')],'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 0482bb0..5c0f457 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 _0x8a9a=['rpc','../../config/environment','jayson/promise','client','request','then','info','Dynamics365Field,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x98e821,_0x1725e0){var _0x4f27e9=function(_0x518a96){while(--_0x518a96){_0x98e821['push'](_0x98e821['shift']());}};_0x4f27e9(++_0x1725e0);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x55f8b4,_0x43f30d){_0x55f8b4=_0x55f8b4-0x0;var _0x2475f9=_0x8a9a[_0x55f8b4];return _0x2475f9;};'use strict';var _=require('lodash');var util=require(_0xa8a9('0x0'));var moment=require(_0xa8a9('0x1'));var BPromise=require(_0xa8a9('0x2'));var rs=require(_0xa8a9('0x3'));var fs=require('fs');var Redis=require(_0xa8a9('0x4'));var db=require(_0xa8a9('0x5'))['db'];var utils=require(_0xa8a9('0x6'));var logger=require(_0xa8a9('0x7'))(_0xa8a9('0x8'));var config=require(_0xa8a9('0x9'));var jayson=require(_0xa8a9('0xa'));var client=jayson[_0xa8a9('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x24a2bc,_0x4a091d,_0x1b4873){return new BPromise(function(_0x129e9f,_0x1477b0){return client[_0xa8a9('0xc')](_0x24a2bc,_0x1b4873)[_0xa8a9('0xd')](function(_0x4ebe24){logger[_0xa8a9('0xe')](_0xa8a9('0xf'),_0x4a091d,'request\x20sent');logger[_0xa8a9('0x10')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'),JSON[_0xa8a9('0x12')](_0x4ebe24));if(_0x4ebe24['error']){if(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x14')]===0x1f4){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);return _0x1477b0(_0x4ebe24['error'][_0xa8a9('0x15')]);}logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x4ebe24['error']['message']);return _0x129e9f(_0x4ebe24[_0xa8a9('0x13')][_0xa8a9('0x15')]);}else{logger[_0xa8a9('0xe')]('Dynamics365Field,\x20%s,\x20%s',_0x4a091d,_0xa8a9('0x11'));_0x129e9f(_0x4ebe24[_0xa8a9('0x16')]['message']);}})['catch'](function(_0x1039c9){logger[_0xa8a9('0x13')](_0xa8a9('0xf'),_0x4a091d,_0x1039c9);_0x1477b0(_0x1039c9);});});} \ No newline at end of file +var _0x853e=['then','info','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','Dynamics365Field,\x20%s,\x20%s','message','request\x20sent','result','catch','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x56e5b8,_0x488931){var _0x242ee5=function(_0x57e4bc){while(--_0x57e4bc){_0x56e5b8['push'](_0x56e5b8['shift']());}};_0x242ee5(++_0x488931);}(_0x853e,0x1ea));var _0xe853=function(_0x1b18e1,_0x504e55){_0x1b18e1=_0x1b18e1-0x0;var _0x1edc9b=_0x853e[_0x1b18e1];return _0x1edc9b;};'use strict';var _=require('lodash');var util=require(_0xe853('0x0'));var moment=require('moment');var BPromise=require(_0xe853('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe853('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xe853('0x3'));var logger=require(_0xe853('0x4'))(_0xe853('0x5'));var config=require(_0xe853('0x6'));var jayson=require(_0xe853('0x7'));var client=jayson['client'][_0xe853('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x131614,_0xab8d0d,_0x25e6e1){return new BPromise(function(_0xe3d468,_0x36d502){return client[_0xe853('0x9')](_0x131614,_0x25e6e1)[_0xe853('0xa')](function(_0x213f17){logger[_0xe853('0xb')]('Dynamics365Field,\x20%s,\x20%s',_0xab8d0d,'request\x20sent');logger['debug'](_0xe853('0xc'),_0xab8d0d,'request\x20sent',JSON['stringify'](_0x213f17));if(_0x213f17[_0xe853('0xd')]){if(_0x213f17[_0xe853('0xd')][_0xe853('0xe')]===0x1f4){logger['error'](_0xe853('0xf'),_0xab8d0d,_0x213f17[_0xe853('0xd')][_0xe853('0x10')]);return _0x36d502(_0x213f17[_0xe853('0xd')][_0xe853('0x10')]);}logger[_0xe853('0xd')](_0xe853('0xf'),_0xab8d0d,_0x213f17['error']['message']);return _0xe3d468(_0x213f17['error']['message']);}else{logger[_0xe853('0xb')](_0xe853('0xf'),_0xab8d0d,_0xe853('0x11'));_0xe3d468(_0x213f17[_0xe853('0x12')][_0xe853('0x10')]);}})[_0xe853('0x13')](function(_0x335ca3){logger[_0xe853('0xd')](_0xe853('0xf'),_0xab8d0d,_0x335ca3);_0x36d502(_0x335ca3);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index dd5445e..debc265 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 _0x5d28=['get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','connect-timeout','../../components/interaction/service','../../config/environment'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x5d28,0x9c));var _0x85d2=function(_0x37926f,_0x2016fd){_0x37926f=_0x37926f-0x0;var _0xd2ebb8=_0x5d28[_0x37926f];return _0xd2ebb8;};'use strict';var multer=require(_0x85d2('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x85d2('0x1'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x85d2('0x2'));var config=require(_0x85d2('0x3'));var controller=require('./intFreshdeskAccount.controller');router[_0x85d2('0x4')]('/',auth[_0x85d2('0x5')](),controller[_0x85d2('0x6')]);router[_0x85d2('0x4')](_0x85d2('0x7'),auth[_0x85d2('0x5')](),controller[_0x85d2('0x8')]);router[_0x85d2('0x4')](_0x85d2('0x9'),auth[_0x85d2('0x5')](),controller[_0x85d2('0xa')]);router[_0x85d2('0x4')]('/:id/fields',auth['isAuthenticated'](),controller[_0x85d2('0xb')]);router[_0x85d2('0xc')]('/',auth[_0x85d2('0x5')](),controller[_0x85d2('0xd')]);router[_0x85d2('0xc')](_0x85d2('0x9'),auth[_0x85d2('0x5')](),controller[_0x85d2('0xe')]);router[_0x85d2('0xf')](_0x85d2('0x7'),auth[_0x85d2('0x5')](),controller[_0x85d2('0x10')]);router[_0x85d2('0x11')]('/:id',auth[_0x85d2('0x5')](),controller[_0x85d2('0x12')]);module[_0x85d2('0x13')]=router; \ No newline at end of file +var _0x5f86=['exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','post','create','addConfiguration','put','delete','destroy'];(function(_0x2b89d5,_0x32f084){var _0x1c0607=function(_0x5e1988){while(--_0x5e1988){_0x2b89d5['push'](_0x2b89d5['shift']());}};_0x1c0607(++_0x32f084);}(_0x5f86,0x177));var _0x65f8=function(_0x328951,_0x36a5f3){_0x328951=_0x328951-0x0;var _0x182d71=_0x5f86[_0x328951];return _0x182d71;};'use strict';var multer=require('multer');var util=require(_0x65f8('0x0'));var path=require(_0x65f8('0x1'));var timeout=require(_0x65f8('0x2'));var express=require(_0x65f8('0x3'));var router=express[_0x65f8('0x4')]();var auth=require(_0x65f8('0x5'));var interaction=require(_0x65f8('0x6'));var config=require(_0x65f8('0x7'));var controller=require('./intFreshdeskAccount.controller');router[_0x65f8('0x8')]('/',auth[_0x65f8('0x9')](),controller[_0x65f8('0xa')]);router[_0x65f8('0x8')](_0x65f8('0xb'),auth[_0x65f8('0x9')](),controller[_0x65f8('0xc')]);router[_0x65f8('0x8')]('/:id/configurations',auth[_0x65f8('0x9')](),controller['getConfigurations']);router[_0x65f8('0x8')](_0x65f8('0xd'),auth[_0x65f8('0x9')](),controller[_0x65f8('0xe')]);router[_0x65f8('0xf')]('/',auth['isAuthenticated'](),controller[_0x65f8('0x10')]);router[_0x65f8('0xf')]('/:id/configurations',auth[_0x65f8('0x9')](),controller[_0x65f8('0x11')]);router[_0x65f8('0x12')]('/:id',auth[_0x65f8('0x9')](),controller['update']);router[_0x65f8('0x13')](_0x65f8('0xb'),auth[_0x65f8('0x9')](),controller[_0x65f8('0x14')]);module[_0x65f8('0x15')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.attributes.js index 10a40f8..fbbe2b4 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 _0x9219=['STRING'];(function(_0x1a72f3,_0x217011){var _0x57ef47=function(_0x20123d){while(--_0x20123d){_0x1a72f3['push'](_0x1a72f3['shift']());}};_0x57ef47(++_0x217011);}(_0x9219,0x19e));var _0x9921=function(_0x4b665e,_0x3bc535){_0x4b665e=_0x4b665e-0x0;var _0x1219a8=_0x9219[_0x4b665e];return _0x1219a8;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x9921('0x0')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9921('0x0')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd26f=['sequelize','exports','STRING','username','remoteUri'];(function(_0x4f7141,_0x4afce6){var _0x3b42aa=function(_0x1e0691){while(--_0x1e0691){_0x4f7141['push'](_0x4f7141['shift']());}};_0x3b42aa(++_0x4afce6);}(_0xd26f,0x113));var _0xfd26=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0xd26f[_0xdea41a];return _0x15d0d8;};'use strict';var Sequelize=require(_0xfd26('0x0'));module[_0xfd26('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x3')},'apiKey':{'type':Sequelize[_0xfd26('0x2')]},'remoteUri':{'type':Sequelize[_0xfd26('0x2')],'unique':_0xfd26('0x4')},'serverUrl':{'type':Sequelize[_0xfd26('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index df8b70b..f79ed09 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 _0x224f=['addConfiguration','AccountId','Subjects','getSubjects','channel','getDescriptions','FreshdeskField','getFields','remoteUri','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','apiKey','toString','base64','subject','description','priority','source','group','company','remove','includes','default','custom_dropdown','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','count','offset','limit','set','json','reject','update','destroy','stack','name','send','map','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','where','pick','merge','type','filter','options','FreshdeskAccount','includeAll','findAll','params','keys','include','find','create','body','getConfigurations','findOne','FreshdeskConfiguration','order','sort'];(function(_0x1feefe,_0x2018ad){var _0x56471a=function(_0x8745df){while(--_0x8745df){_0x1feefe['push'](_0x1feefe['shift']());}};_0x56471a(++_0x2018ad);}(_0x224f,0x193));var _0xf224=function(_0x4907de,_0x5bbdc6){_0x4907de=_0x4907de-0x0;var _0x482054=_0x224f[_0x4907de];return _0x482054;};'use strict';var pdf=require(_0xf224('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf224('0x1'));var zipdir=require(_0xf224('0x2'));var jsonpatch=require(_0xf224('0x3'));var rp=require(_0xf224('0x4'));var moment=require(_0xf224('0x5'));var BPromise=require(_0xf224('0x6'));var Mustache=require(_0xf224('0x7'));var util=require(_0xf224('0x8'));var path=require(_0xf224('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xf224('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf224('0xb'));var crypto=require(_0xf224('0xc'));var jsforce=require(_0xf224('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xf224('0xe'));var Papa=require(_0xf224('0xf'));var Redis=require(_0xf224('0x10'));var authService=require(_0xf224('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xf224('0x12'));var hardwareService=require(_0xf224('0x13'));var logger=require(_0xf224('0x14'))(_0xf224('0x15'));var utils=require(_0xf224('0x16'));var config=require(_0xf224('0x17'));var db=require(_0xf224('0x18'))['db'];var integrations=require(_0xf224('0x19'));var jayson=require(_0xf224('0x1a'));var client=jayson[_0xf224('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x376d49,_0x4144fe,_0x53ffd6){if(_0x53ffd6){var _0x1bfe85=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1bfe85[_0xf224('0x1c')](_0x4144fe)){return _0x376d49;}else{throw new db[(_0xf224('0x1d'))][(_0xf224('0x1e'))](_0xf224('0x1f'));}}else{return _0x376d49;}}function respondWithRpcPromise(_0x361e5b,_0x5f298d,_0x2ff18c,_0x46043f){return new BPromise(function(_0x2c7dd3,_0x50aaf6){var _0x34ff03=_0x46043f||client;return _0x34ff03[_0xf224('0x20')](_0x361e5b,_0x2ff18c)[_0xf224('0x21')](function(_0x8e11c1){logger[_0xf224('0x22')](_0xf224('0x23'),_0x5f298d,_0xf224('0x24'));logger[_0xf224('0x25')](_0xf224('0x26'),_0x5f298d,_0xf224('0x24'),JSON[_0xf224('0x27')](_0x8e11c1));if(_0x8e11c1[_0xf224('0x28')]){if(_0x8e11c1[_0xf224('0x28')][_0xf224('0x29')]===0x1f4){logger[_0xf224('0x28')](_0xf224('0x23'),_0x5f298d,_0x8e11c1[_0xf224('0x28')][_0xf224('0x2a')]);return _0x50aaf6(_0x8e11c1[_0xf224('0x28')]['message']);}logger[_0xf224('0x28')](_0xf224('0x23'),_0x5f298d,_0x8e11c1[_0xf224('0x28')][_0xf224('0x2a')]);return _0x2c7dd3(_0x8e11c1[_0xf224('0x28')][_0xf224('0x2a')]);}else{logger[_0xf224('0x22')]('FreshdeskAccount,\x20%s,\x20%s',_0x5f298d,_0xf224('0x24'));_0x2c7dd3(_0x8e11c1['result'][_0xf224('0x2a')]);}})[_0xf224('0x2b')](function(_0x2eb634){logger['error'](_0xf224('0x23'),_0x5f298d,_0x2eb634);_0x50aaf6(_0x2eb634);});});}function respondWithStatusCode(_0x452812,_0x1b353f){_0x1b353f=_0x1b353f||0xcc;return function(_0x19671e){if(_0x19671e){return _0x452812[_0xf224('0x2c')](_0x1b353f);}return _0x452812[_0xf224('0x2d')](_0x1b353f)[_0xf224('0x2e')]();};}function respondWithResult(_0x5be637,_0x13a0f5){_0x13a0f5=_0x13a0f5||0xc8;return function(_0x4a492b){if(_0x4a492b){return _0x5be637[_0xf224('0x2d')](_0x13a0f5)['json'](_0x4a492b);}};}function respondWithFilteredResult(_0x317758,_0x1c73b1){return function(_0x517a9c){if(_0x517a9c){var _0x148027=_0x517a9c[_0xf224('0x2f')],_0x85c08c=_0x1c73b1[_0xf224('0x30')],_0x1a47f8=_0x1c73b1[_0xf224('0x30')]+_0x1c73b1[_0xf224('0x31')],_0x5791e5;if(_0x1a47f8>=_0x148027){_0x1a47f8=_0x148027;_0x5791e5=0xc8;}else{_0x5791e5=0xce;}_0x317758['status'](_0x5791e5);return _0x317758[_0xf224('0x32')]('Content-Range',_0x85c08c+'-'+_0x1a47f8+'/'+_0x148027)[_0xf224('0x33')](_0x517a9c);}return null;};}function patchUpdates(_0x24f448){return function(_0x56aaaf){try{jsonpatch['apply'](_0x56aaaf,_0x24f448,!![]);}catch(_0x3ba062){return BPromise[_0xf224('0x34')](_0x3ba062);}return _0x56aaaf['save']();};}function saveUpdates(_0x11134b,_0x3c7888){return function(_0xd1f185){if(_0xd1f185){return _0xd1f185[_0xf224('0x35')](_0x11134b)[_0xf224('0x21')](function(_0x564666){return _0x564666;});}return null;};}function removeEntity(_0x487ed7,_0x55f8fe){return function(_0x56f5cd){if(_0x56f5cd){return _0x56f5cd[_0xf224('0x36')]()['then'](function(){_0x487ed7[_0xf224('0x2d')](0xcc)[_0xf224('0x2e')]();});}};}function handleEntityNotFound(_0x55799d,_0x1216f4){return function(_0x113135){if(!_0x113135){_0x55799d[_0xf224('0x2c')](0x194);}return _0x113135;};}function handleError(_0x239efe,_0x5d2c44){_0x5d2c44=_0x5d2c44||0x1f4;return function(_0x3f374f){logger[_0xf224('0x28')](_0x3f374f[_0xf224('0x37')]);if(_0x3f374f[_0xf224('0x38')]){delete _0x3f374f[_0xf224('0x38')];}_0x239efe[_0xf224('0x2d')](_0x5d2c44)[_0xf224('0x39')](_0x3f374f);};}exports['index']=function(_0x2fba19,_0x3b9f87){var _0x341b41={},_0x5a43d7={},_0x132362={'count':0x0,'rows':[]};var _0x330e9=_[_0xf224('0x3a')](db['FreshdeskAccount'][_0xf224('0x3b')],function(_0x213230){return{'name':_0x213230[_0xf224('0x3c')],'type':_0x213230['type']['key']};});_0x5a43d7[_0xf224('0x3d')]=_[_0xf224('0x3a')](_0x330e9,_0xf224('0x38'));_0x5a43d7['query']=_['keys'](_0x2fba19[_0xf224('0x3e')]);_0x5a43d7[_0xf224('0x3f')]=_[_0xf224('0x40')](_0x5a43d7[_0xf224('0x3d')],_0x5a43d7[_0xf224('0x3e')]);_0x341b41[_0xf224('0x41')]=_['intersection'](_0x5a43d7[_0xf224('0x3d')],qs[_0xf224('0x42')](_0x2fba19[_0xf224('0x3e')][_0xf224('0x42')]));_0x341b41[_0xf224('0x41')]=_0x341b41[_0xf224('0x41')][_0xf224('0x43')]?_0x341b41[_0xf224('0x41')]:_0x5a43d7['model'];if(!_0x2fba19[_0xf224('0x3e')][_0xf224('0x44')]('nolimit')){_0x341b41[_0xf224('0x31')]=qs[_0xf224('0x31')](_0x2fba19[_0xf224('0x3e')]['limit']);_0x341b41[_0xf224('0x30')]=qs[_0xf224('0x30')](_0x2fba19['query'][_0xf224('0x30')]);}_0x341b41['order']=qs['sort'](_0x2fba19[_0xf224('0x3e')]['sort']);_0x341b41[_0xf224('0x45')]=qs[_0xf224('0x3f')](_[_0xf224('0x46')](_0x2fba19[_0xf224('0x3e')],_0x5a43d7[_0xf224('0x3f')]));if(_0x2fba19['query']['filter']){_0x341b41['where']=_[_0xf224('0x47')](_0x341b41[_0xf224('0x45')],{'$or':_[_0xf224('0x3a')](_0x330e9,function(_0x3f76d3){if(_0x3f76d3[_0xf224('0x48')]!=='VIRTUAL'){var _0x57521d={};_0x57521d[_0x3f76d3[_0xf224('0x38')]]={'$like':'%'+_0x2fba19[_0xf224('0x3e')][_0xf224('0x49')]+'%'};return _0x57521d;}})});}_0x341b41=_[_0xf224('0x47')]({},_0x341b41,_0x2fba19[_0xf224('0x4a')]);var _0x6a23e3={'where':_0x341b41[_0xf224('0x45')]};return db[_0xf224('0x4b')]['count'](_0x6a23e3)[_0xf224('0x21')](function(_0x51fe3c){_0x132362[_0xf224('0x2f')]=_0x51fe3c;if(_0x2fba19['query'][_0xf224('0x4c')]){_0x341b41['include']=[{'all':!![]}];}return db[_0xf224('0x4b')][_0xf224('0x4d')](_0x341b41);})[_0xf224('0x21')](function(_0x1b39c5){_0x132362['rows']=_0x1b39c5;return _0x132362;})[_0xf224('0x21')](respondWithFilteredResult(_0x3b9f87,_0x341b41))['catch'](handleError(_0x3b9f87,null));};exports['show']=function(_0x24e61e,_0x21fdb1){var _0x567cbe={'raw':![],'where':{'id':_0x24e61e[_0xf224('0x4e')]['id']}},_0x52dafe={};_0x52dafe['model']=_['keys'](db[_0xf224('0x4b')][_0xf224('0x3b')]);_0x52dafe[_0xf224('0x3e')]=_[_0xf224('0x4f')](_0x24e61e[_0xf224('0x3e')]);_0x52dafe[_0xf224('0x3f')]=_['intersection'](_0x52dafe[_0xf224('0x3d')],_0x52dafe[_0xf224('0x3e')]);_0x567cbe[_0xf224('0x41')]=_[_0xf224('0x40')](_0x52dafe[_0xf224('0x3d')],qs[_0xf224('0x42')](_0x24e61e['query']['fields']));_0x567cbe[_0xf224('0x41')]=_0x567cbe[_0xf224('0x41')][_0xf224('0x43')]?_0x567cbe['attributes']:_0x52dafe['model'];if(_0x24e61e[_0xf224('0x3e')]['includeAll']){_0x567cbe[_0xf224('0x50')]=[{'all':!![]}];}_0x567cbe=_[_0xf224('0x47')]({},_0x567cbe,_0x24e61e[_0xf224('0x4a')]);return db['FreshdeskAccount'][_0xf224('0x51')](_0x567cbe)[_0xf224('0x21')](handleEntityNotFound(_0x21fdb1,null))[_0xf224('0x21')](respondWithResult(_0x21fdb1,null))[_0xf224('0x2b')](handleError(_0x21fdb1,null));};exports[_0xf224('0x52')]=function(_0x1f2629,_0x1f0811){return db[_0xf224('0x4b')]['create'](_0x1f2629[_0xf224('0x53')],{})['then'](respondWithResult(_0x1f0811,0xc9))[_0xf224('0x2b')](handleError(_0x1f0811,null));};exports[_0xf224('0x35')]=function(_0x58e0fb,_0x3c336b){if(_0x58e0fb[_0xf224('0x53')]['id']){delete _0x58e0fb[_0xf224('0x53')]['id'];}return db[_0xf224('0x4b')][_0xf224('0x51')]({'where':{'id':_0x58e0fb[_0xf224('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3c336b,null))['then'](saveUpdates(_0x58e0fb[_0xf224('0x53')],null))['then'](respondWithResult(_0x3c336b,null))[_0xf224('0x2b')](handleError(_0x3c336b,null));};exports[_0xf224('0x36')]=function(_0x15eb44,_0x3f844d){return db[_0xf224('0x4b')]['find']({'where':{'id':_0x15eb44[_0xf224('0x4e')]['id']}})[_0xf224('0x21')](handleEntityNotFound(_0x3f844d,null))[_0xf224('0x21')](removeEntity(_0x3f844d,null))[_0xf224('0x2b')](handleError(_0x3f844d,null));};exports[_0xf224('0x54')]=function(_0x50ddc9,_0x575ff7,_0xe04c7d){var _0x575ed8={};var _0x224e03={};var _0x34eb0d;var _0x1d4df1;return db[_0xf224('0x4b')][_0xf224('0x55')]({'where':{'id':_0x50ddc9[_0xf224('0x4e')]['id']}})[_0xf224('0x21')](handleEntityNotFound(_0x575ff7,null))[_0xf224('0x21')](function(_0x6abd38){if(_0x6abd38){_0x34eb0d=_0x6abd38;_0x224e03[_0xf224('0x3d')]=_[_0xf224('0x4f')](db[_0xf224('0x56')][_0xf224('0x3b')]);_0x224e03[_0xf224('0x3e')]=_[_0xf224('0x4f')](_0x50ddc9['query']);_0x224e03[_0xf224('0x3f')]=_[_0xf224('0x40')](_0x224e03[_0xf224('0x3d')],_0x224e03[_0xf224('0x3e')]);_0x575ed8[_0xf224('0x41')]=_[_0xf224('0x40')](_0x224e03['model'],qs['fields'](_0x50ddc9[_0xf224('0x3e')][_0xf224('0x42')]));_0x575ed8[_0xf224('0x41')]=_0x575ed8['attributes'][_0xf224('0x43')]?_0x575ed8[_0xf224('0x41')]:_0x224e03['model'];_0x575ed8[_0xf224('0x57')]=qs[_0xf224('0x58')](_0x50ddc9[_0xf224('0x3e')][_0xf224('0x58')]);_0x575ed8[_0xf224('0x45')]=qs[_0xf224('0x3f')](_[_0xf224('0x46')](_0x50ddc9[_0xf224('0x3e')],_0x224e03[_0xf224('0x3f')]));if(_0x50ddc9[_0xf224('0x3e')][_0xf224('0x49')]){_0x575ed8[_0xf224('0x45')]=_[_0xf224('0x47')](_0x575ed8['where'],{'$or':_[_0xf224('0x3a')](_0x575ed8[_0xf224('0x41')],function(_0x379d35){var _0x17ae97={};_0x17ae97[_0x379d35]={'$like':'%'+_0x50ddc9[_0xf224('0x3e')][_0xf224('0x49')]+'%'};return _0x17ae97;})});}_0x575ed8=_[_0xf224('0x47')]({},_0x575ed8,_0x50ddc9[_0xf224('0x4a')]);return _0x34eb0d[_0xf224('0x54')](_0x575ed8);}})[_0xf224('0x21')](function(_0x305fc3){if(_0x305fc3){_0x1d4df1=_0x305fc3['length'];if(!_0x50ddc9['query'][_0xf224('0x44')]('nolimit')){_0x575ed8[_0xf224('0x31')]=qs[_0xf224('0x31')](_0x50ddc9['query'][_0xf224('0x31')]);_0x575ed8['offset']=qs[_0xf224('0x30')](_0x50ddc9[_0xf224('0x3e')][_0xf224('0x30')]);}return _0x34eb0d['getConfigurations'](_0x575ed8);}})['then'](function(_0x3f5ff8){if(_0x3f5ff8){return _0x3f5ff8?{'count':_0x1d4df1,'rows':_0x3f5ff8}:null;}})[_0xf224('0x21')](respondWithResult(_0x575ff7,null))[_0xf224('0x2b')](handleError(_0x575ff7,null));};exports[_0xf224('0x59')]=function(_0x2613ea,_0x1a9c2d,_0x3a02e5){if(_0x2613ea[_0xf224('0x53')]['id']){delete _0x2613ea['body']['id'];}return db[_0xf224('0x4b')]['findOne']({'where':{'id':_0x2613ea[_0xf224('0x4e')]['id']}})[_0xf224('0x21')](handleEntityNotFound(_0x1a9c2d,null))['then'](function(_0x5201fc){if(_0x5201fc){_0x2613ea[_0xf224('0x53')][_0xf224('0x5a')]=_0x5201fc['id'];_0x2613ea['body'][_0xf224('0x5b')]=integrations[_0xf224('0x5c')](_0x2613ea[_0xf224('0x53')][_0xf224('0x5d')],_0x2613ea[_0xf224('0x53')][_0xf224('0x48')]);_0x2613ea[_0xf224('0x53')]['Descriptions']=integrations[_0xf224('0x5e')](_0x2613ea['body'][_0xf224('0x5d')],_0x2613ea[_0xf224('0x53')][_0xf224('0x48')]);return db[_0xf224('0x56')][_0xf224('0x52')](_0x2613ea[_0xf224('0x53')],{'include':[{'model':db[_0xf224('0x5f')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':'Descriptions'}]});}return null;})[_0xf224('0x21')](respondWithResult(_0x1a9c2d,null))['catch'](handleError(_0x1a9c2d,null));};exports[_0xf224('0x60')]=function(_0x151759,_0x1ad9c2,_0x2f2a8a){var _0x3834f1='';return db[_0xf224('0x4b')][_0xf224('0x55')]({'where':{'id':_0x151759[_0xf224('0x4e')]['id']},'attributes':['id',_0xf224('0x61'),'apiKey']})[_0xf224('0x21')](handleEntityNotFound(_0x1ad9c2,null))[_0xf224('0x21')](function(_0x5e19d4){if(_0x5e19d4){_0x3834f1=_0x5e19d4['remoteUri'];var _0x5ca221=_0x3834f1[_0xf224('0x62')](-0x1);if(_0x5ca221==='/'){_0x3834f1=_0x3834f1[_0xf224('0x63')](0x0,_0x3834f1[_0xf224('0x64')](_0x5ca221));}return rp({'method':_0xf224('0x65'),'uri':util[_0xf224('0x66')](_0xf224('0x67'),_0x3834f1,_0xf224('0x68')),'headers':{'Authorization':util[_0xf224('0x66')]('Basic\x20%s',new Buffer(util[_0xf224('0x66')](_0xf224('0x69'),_0x5e19d4[_0xf224('0x6a')]))[_0xf224('0x6b')](_0xf224('0x6c')))},'json':!![]});}})[_0xf224('0x21')](function(_0x40590a){if(_0x40590a){var _0x4be0b7=['requester',_0xf224('0x6d'),'agent',_0xf224('0x6e'),_0xf224('0x2d'),_0xf224('0x6f'),'group',_0xf224('0x70'),'ticket_type',_0xf224('0x71'),_0xf224('0x72')];_[_0xf224('0x73')](_0x40590a,function(_0x37dcc2){return _0x4be0b7[_0xf224('0x74')](_0x37dcc2['name'])||!_0x37dcc2[_0xf224('0x75')]&&_0x37dcc2[_0xf224('0x48')]!=='custom_text'&&_0x37dcc2[_0xf224('0x48')]!==_0xf224('0x76');});return{'count':_0x40590a['length'],'rows':_['map'](_0x40590a,function(_0x28e178){return{'id':_0x28e178[_0xf224('0x38')],'name':_0x28e178['label'],'custom':!_0x28e178['default'],'options':_0x28e178[_0xf224('0x77')]?_['map'](_0x28e178[_0xf224('0x77')],function(_0x32638b){return{'name':_[_0xf224('0x78')](_0x32638b),'value':_0x32638b};}):[]};})};}})[_0xf224('0x21')](respondWithResult(_0x1ad9c2,null))['catch'](function(_0xf085d){var _0x327ac8=_0x151759[_0xf224('0x3e')][_0xf224('0x1c')]?0x1f4:_0xf085d[_0xf224('0x79')]||0x1f4;logger[_0xf224('0x28')](_0xf224('0x7a'),'getFields',_0x327ac8,JSON[_0xf224('0x27')](_0xf085d));delete _0xf085d['name'];if(_0x327ac8===0x191){_0x327ac8=0x190;}_0x1ad9c2[_0xf224('0x2d')](_0x327ac8)[_0xf224('0x39')](_0x151759[_0xf224('0x3e')][_0xf224('0x1c')]?{'message':'Wrong\x20credentials','statusCode':_0xf085d[_0xf224('0x79')]}:_0xf085d);});}; \ No newline at end of file +var _0x4a8d=['message','catch','status','json','count','offset','limit','set','apply','reject','save','destroy','end','sendStatus','stack','name','send','map','rawAttributes','fieldName','key','model','query','filters','attributes','intersection','fields','length','nolimit','sort','pick','where','merge','type','filter','options','FreshdeskAccount','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','getConfigurations','FreshdeskConfiguration','order','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshdeskField','getFields','remoteUri','apiKey','slice','substring','GET','format','%s/%s','Basic\x20%s','%s:X','toString','base64','subject','agent','description','priority','group','remove','includes','default','custom_text','custom_dropdown','label','choices','capitalize','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','squel','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x58e469,_0x95ee3e){var _0x4c01c5=function(_0x1ef7ae){while(--_0x1ef7ae){_0x58e469['push'](_0x58e469['shift']());}};_0x4c01c5(++_0x95ee3e);}(_0x4a8d,0xd7));var _0xd4a8=function(_0x3cb929,_0x13cbfe){_0x3cb929=_0x3cb929-0x0;var _0x1a9c52=_0x4a8d[_0x3cb929];return _0x1a9c52;};'use strict';var pdf=require(_0xd4a8('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd4a8('0x1'));var zipdir=require(_0xd4a8('0x2'));var jsonpatch=require(_0xd4a8('0x3'));var rp=require(_0xd4a8('0x4'));var moment=require(_0xd4a8('0x5'));var BPromise=require(_0xd4a8('0x6'));var Mustache=require(_0xd4a8('0x7'));var util=require('util');var path=require(_0xd4a8('0x8'));var sox=require(_0xd4a8('0x9'));var csv=require(_0xd4a8('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd4a8('0xb'));var crypto=require('crypto');var jsforce=require(_0xd4a8('0xc'));var deskjs=require(_0xd4a8('0xd'));var toCsv=require(_0xd4a8('0xa'));var querystring=require('querystring');var Papa=require(_0xd4a8('0xe'));var Redis=require(_0xd4a8('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd4a8('0x10'));var as=require(_0xd4a8('0x11'));var hardwareService=require(_0xd4a8('0x12'));var logger=require(_0xd4a8('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xd4a8('0x14'));var db=require(_0xd4a8('0x15'))['db'];var integrations=require(_0xd4a8('0x16'));var jayson=require('jayson/promise');var client=jayson[_0xd4a8('0x17')][_0xd4a8('0x18')]({'port':0x232a});function checkPasswordPattern(_0x1c037e,_0x1f7e8e,_0x28eee5){if(_0x28eee5){var _0x32dbbf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x32dbbf[_0xd4a8('0x19')](_0x1f7e8e)){return _0x1c037e;}else{throw new db['Sequelize'][(_0xd4a8('0x1a'))](_0xd4a8('0x1b'));}}else{return _0x1c037e;}}function respondWithRpcPromise(_0x27b6cb,_0x53794b,_0x2ccecb,_0x3a7887){return new BPromise(function(_0x583eac,_0x2360e1){var _0x8364a6=_0x3a7887||client;return _0x8364a6[_0xd4a8('0x1c')](_0x27b6cb,_0x2ccecb)[_0xd4a8('0x1d')](function(_0x2770e3){logger[_0xd4a8('0x1e')](_0xd4a8('0x1f'),_0x53794b,_0xd4a8('0x20'));logger[_0xd4a8('0x21')](_0xd4a8('0x22'),_0x53794b,_0xd4a8('0x20'),JSON['stringify'](_0x2770e3));if(_0x2770e3[_0xd4a8('0x23')]){if(_0x2770e3[_0xd4a8('0x23')][_0xd4a8('0x24')]===0x1f4){logger[_0xd4a8('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x53794b,_0x2770e3['error']['message']);return _0x2360e1(_0x2770e3[_0xd4a8('0x23')][_0xd4a8('0x25')]);}logger['error'](_0xd4a8('0x1f'),_0x53794b,_0x2770e3[_0xd4a8('0x23')][_0xd4a8('0x25')]);return _0x583eac(_0x2770e3[_0xd4a8('0x23')][_0xd4a8('0x25')]);}else{logger['info'](_0xd4a8('0x1f'),_0x53794b,_0xd4a8('0x20'));_0x583eac(_0x2770e3['result'][_0xd4a8('0x25')]);}})[_0xd4a8('0x26')](function(_0x4d11d7){logger[_0xd4a8('0x23')]('FreshdeskAccount,\x20%s,\x20%s',_0x53794b,_0x4d11d7);_0x2360e1(_0x4d11d7);});});}function respondWithStatusCode(_0x1f3608,_0x143299){_0x143299=_0x143299||0xcc;return function(_0x41352e){if(_0x41352e){return _0x1f3608['sendStatus'](_0x143299);}return _0x1f3608[_0xd4a8('0x27')](_0x143299)['end']();};}function respondWithResult(_0x39b3a8,_0x2c876a){_0x2c876a=_0x2c876a||0xc8;return function(_0x514ab6){if(_0x514ab6){return _0x39b3a8[_0xd4a8('0x27')](_0x2c876a)[_0xd4a8('0x28')](_0x514ab6);}};}function respondWithFilteredResult(_0x36736f,_0x4d59fe){return function(_0x52ee00){if(_0x52ee00){var _0x47daba=_0x52ee00[_0xd4a8('0x29')],_0x557d77=_0x4d59fe['offset'],_0x4d9fa1=_0x4d59fe[_0xd4a8('0x2a')]+_0x4d59fe[_0xd4a8('0x2b')],_0x13c53b;if(_0x4d9fa1>=_0x47daba){_0x4d9fa1=_0x47daba;_0x13c53b=0xc8;}else{_0x13c53b=0xce;}_0x36736f[_0xd4a8('0x27')](_0x13c53b);return _0x36736f[_0xd4a8('0x2c')]('Content-Range',_0x557d77+'-'+_0x4d9fa1+'/'+_0x47daba)[_0xd4a8('0x28')](_0x52ee00);}return null;};}function patchUpdates(_0x52ebf7){return function(_0x437bce){try{jsonpatch[_0xd4a8('0x2d')](_0x437bce,_0x52ebf7,!![]);}catch(_0x3740c3){return BPromise[_0xd4a8('0x2e')](_0x3740c3);}return _0x437bce[_0xd4a8('0x2f')]();};}function saveUpdates(_0x242d9d,_0x437163){return function(_0x45616e){if(_0x45616e){return _0x45616e['update'](_0x242d9d)[_0xd4a8('0x1d')](function(_0x522a84){return _0x522a84;});}return null;};}function removeEntity(_0xb983db,_0x1ee68c){return function(_0x4e5e23){if(_0x4e5e23){return _0x4e5e23[_0xd4a8('0x30')]()['then'](function(){_0xb983db[_0xd4a8('0x27')](0xcc)[_0xd4a8('0x31')]();});}};}function handleEntityNotFound(_0x5afc4e,_0x1ecafc){return function(_0x38814c){if(!_0x38814c){_0x5afc4e[_0xd4a8('0x32')](0x194);}return _0x38814c;};}function handleError(_0x4ac471,_0x336edb){_0x336edb=_0x336edb||0x1f4;return function(_0xf03264){logger[_0xd4a8('0x23')](_0xf03264[_0xd4a8('0x33')]);if(_0xf03264[_0xd4a8('0x34')]){delete _0xf03264[_0xd4a8('0x34')];}_0x4ac471[_0xd4a8('0x27')](_0x336edb)[_0xd4a8('0x35')](_0xf03264);};}exports['index']=function(_0x530dbc,_0x293510){var _0x55fb71={},_0x25490d={},_0x678b9f={'count':0x0,'rows':[]};var _0x3d8c48=_[_0xd4a8('0x36')](db['FreshdeskAccount'][_0xd4a8('0x37')],function(_0x4204c6){return{'name':_0x4204c6[_0xd4a8('0x38')],'type':_0x4204c6['type'][_0xd4a8('0x39')]};});_0x25490d[_0xd4a8('0x3a')]=_[_0xd4a8('0x36')](_0x3d8c48,_0xd4a8('0x34'));_0x25490d['query']=_['keys'](_0x530dbc[_0xd4a8('0x3b')]);_0x25490d[_0xd4a8('0x3c')]=_['intersection'](_0x25490d[_0xd4a8('0x3a')],_0x25490d[_0xd4a8('0x3b')]);_0x55fb71[_0xd4a8('0x3d')]=_[_0xd4a8('0x3e')](_0x25490d[_0xd4a8('0x3a')],qs['fields'](_0x530dbc[_0xd4a8('0x3b')][_0xd4a8('0x3f')]));_0x55fb71['attributes']=_0x55fb71[_0xd4a8('0x3d')][_0xd4a8('0x40')]?_0x55fb71[_0xd4a8('0x3d')]:_0x25490d['model'];if(!_0x530dbc['query']['hasOwnProperty'](_0xd4a8('0x41'))){_0x55fb71[_0xd4a8('0x2b')]=qs[_0xd4a8('0x2b')](_0x530dbc['query'][_0xd4a8('0x2b')]);_0x55fb71[_0xd4a8('0x2a')]=qs[_0xd4a8('0x2a')](_0x530dbc[_0xd4a8('0x3b')][_0xd4a8('0x2a')]);}_0x55fb71['order']=qs['sort'](_0x530dbc[_0xd4a8('0x3b')][_0xd4a8('0x42')]);_0x55fb71['where']=qs['filters'](_[_0xd4a8('0x43')](_0x530dbc[_0xd4a8('0x3b')],_0x25490d[_0xd4a8('0x3c')]));if(_0x530dbc[_0xd4a8('0x3b')]['filter']){_0x55fb71[_0xd4a8('0x44')]=_[_0xd4a8('0x45')](_0x55fb71['where'],{'$or':_[_0xd4a8('0x36')](_0x3d8c48,function(_0x508511){if(_0x508511[_0xd4a8('0x46')]!=='VIRTUAL'){var _0x4197d6={};_0x4197d6[_0x508511[_0xd4a8('0x34')]]={'$like':'%'+_0x530dbc['query'][_0xd4a8('0x47')]+'%'};return _0x4197d6;}})});}_0x55fb71=_['merge']({},_0x55fb71,_0x530dbc[_0xd4a8('0x48')]);var _0x3abd82={'where':_0x55fb71[_0xd4a8('0x44')]};return db[_0xd4a8('0x49')][_0xd4a8('0x29')](_0x3abd82)[_0xd4a8('0x1d')](function(_0x6b79c9){_0x678b9f[_0xd4a8('0x29')]=_0x6b79c9;if(_0x530dbc[_0xd4a8('0x3b')][_0xd4a8('0x4a')]){_0x55fb71[_0xd4a8('0x4b')]=[{'all':!![]}];}return db[_0xd4a8('0x49')][_0xd4a8('0x4c')](_0x55fb71);})['then'](function(_0x10f974){_0x678b9f[_0xd4a8('0x4d')]=_0x10f974;return _0x678b9f;})[_0xd4a8('0x1d')](respondWithFilteredResult(_0x293510,_0x55fb71))['catch'](handleError(_0x293510,null));};exports[_0xd4a8('0x4e')]=function(_0x3d5ef9,_0xacc4d6){var _0x727b48={'raw':![],'where':{'id':_0x3d5ef9[_0xd4a8('0x4f')]['id']}},_0x4ccffc={};_0x4ccffc['model']=_[_0xd4a8('0x50')](db[_0xd4a8('0x49')][_0xd4a8('0x37')]);_0x4ccffc[_0xd4a8('0x3b')]=_[_0xd4a8('0x50')](_0x3d5ef9[_0xd4a8('0x3b')]);_0x4ccffc[_0xd4a8('0x3c')]=_[_0xd4a8('0x3e')](_0x4ccffc[_0xd4a8('0x3a')],_0x4ccffc[_0xd4a8('0x3b')]);_0x727b48[_0xd4a8('0x3d')]=_[_0xd4a8('0x3e')](_0x4ccffc[_0xd4a8('0x3a')],qs[_0xd4a8('0x3f')](_0x3d5ef9[_0xd4a8('0x3b')][_0xd4a8('0x3f')]));_0x727b48[_0xd4a8('0x3d')]=_0x727b48[_0xd4a8('0x3d')][_0xd4a8('0x40')]?_0x727b48[_0xd4a8('0x3d')]:_0x4ccffc[_0xd4a8('0x3a')];if(_0x3d5ef9[_0xd4a8('0x3b')]['includeAll']){_0x727b48[_0xd4a8('0x4b')]=[{'all':!![]}];}_0x727b48=_[_0xd4a8('0x45')]({},_0x727b48,_0x3d5ef9['options']);return db[_0xd4a8('0x49')][_0xd4a8('0x51')](_0x727b48)[_0xd4a8('0x1d')](handleEntityNotFound(_0xacc4d6,null))[_0xd4a8('0x1d')](respondWithResult(_0xacc4d6,null))[_0xd4a8('0x26')](handleError(_0xacc4d6,null));};exports['create']=function(_0x40de8f,_0x22f2b5){return db[_0xd4a8('0x49')][_0xd4a8('0x52')](_0x40de8f[_0xd4a8('0x53')],{})['then'](respondWithResult(_0x22f2b5,0xc9))['catch'](handleError(_0x22f2b5,null));};exports[_0xd4a8('0x54')]=function(_0x17315f,_0xd843b4){if(_0x17315f['body']['id']){delete _0x17315f['body']['id'];}return db[_0xd4a8('0x49')][_0xd4a8('0x51')]({'where':{'id':_0x17315f[_0xd4a8('0x4f')]['id']}})[_0xd4a8('0x1d')](handleEntityNotFound(_0xd843b4,null))['then'](saveUpdates(_0x17315f[_0xd4a8('0x53')],null))[_0xd4a8('0x1d')](respondWithResult(_0xd843b4,null))[_0xd4a8('0x26')](handleError(_0xd843b4,null));};exports[_0xd4a8('0x30')]=function(_0x5c9ab5,_0x431d5b){return db[_0xd4a8('0x49')]['find']({'where':{'id':_0x5c9ab5['params']['id']}})[_0xd4a8('0x1d')](handleEntityNotFound(_0x431d5b,null))[_0xd4a8('0x1d')](removeEntity(_0x431d5b,null))['catch'](handleError(_0x431d5b,null));};exports[_0xd4a8('0x55')]=function(_0x53444e,_0x244666,_0x4c731b){var _0x4fe7f8={};var _0x3071f5={};var _0x568c5d;var _0x1c6edb;return db[_0xd4a8('0x49')]['findOne']({'where':{'id':_0x53444e['params']['id']}})[_0xd4a8('0x1d')](handleEntityNotFound(_0x244666,null))['then'](function(_0x4b5224){if(_0x4b5224){_0x568c5d=_0x4b5224;_0x3071f5[_0xd4a8('0x3a')]=_[_0xd4a8('0x50')](db[_0xd4a8('0x56')][_0xd4a8('0x37')]);_0x3071f5[_0xd4a8('0x3b')]=_[_0xd4a8('0x50')](_0x53444e[_0xd4a8('0x3b')]);_0x3071f5[_0xd4a8('0x3c')]=_[_0xd4a8('0x3e')](_0x3071f5[_0xd4a8('0x3a')],_0x3071f5[_0xd4a8('0x3b')]);_0x4fe7f8[_0xd4a8('0x3d')]=_['intersection'](_0x3071f5[_0xd4a8('0x3a')],qs[_0xd4a8('0x3f')](_0x53444e[_0xd4a8('0x3b')][_0xd4a8('0x3f')]));_0x4fe7f8[_0xd4a8('0x3d')]=_0x4fe7f8[_0xd4a8('0x3d')][_0xd4a8('0x40')]?_0x4fe7f8[_0xd4a8('0x3d')]:_0x3071f5[_0xd4a8('0x3a')];_0x4fe7f8[_0xd4a8('0x57')]=qs[_0xd4a8('0x42')](_0x53444e[_0xd4a8('0x3b')][_0xd4a8('0x42')]);_0x4fe7f8[_0xd4a8('0x44')]=qs[_0xd4a8('0x3c')](_[_0xd4a8('0x43')](_0x53444e[_0xd4a8('0x3b')],_0x3071f5['filters']));if(_0x53444e[_0xd4a8('0x3b')]['filter']){_0x4fe7f8[_0xd4a8('0x44')]=_[_0xd4a8('0x45')](_0x4fe7f8[_0xd4a8('0x44')],{'$or':_[_0xd4a8('0x36')](_0x4fe7f8['attributes'],function(_0x3a151f){var _0x1692b1={};_0x1692b1[_0x3a151f]={'$like':'%'+_0x53444e['query'][_0xd4a8('0x47')]+'%'};return _0x1692b1;})});}_0x4fe7f8=_[_0xd4a8('0x45')]({},_0x4fe7f8,_0x53444e['options']);return _0x568c5d[_0xd4a8('0x55')](_0x4fe7f8);}})[_0xd4a8('0x1d')](function(_0x53e0ee){if(_0x53e0ee){_0x1c6edb=_0x53e0ee['length'];if(!_0x53444e[_0xd4a8('0x3b')]['hasOwnProperty'](_0xd4a8('0x41'))){_0x4fe7f8[_0xd4a8('0x2b')]=qs[_0xd4a8('0x2b')](_0x53444e['query'][_0xd4a8('0x2b')]);_0x4fe7f8[_0xd4a8('0x2a')]=qs[_0xd4a8('0x2a')](_0x53444e[_0xd4a8('0x3b')][_0xd4a8('0x2a')]);}return _0x568c5d[_0xd4a8('0x55')](_0x4fe7f8);}})[_0xd4a8('0x1d')](function(_0x5137de){if(_0x5137de){return _0x5137de?{'count':_0x1c6edb,'rows':_0x5137de}:null;}})['then'](respondWithResult(_0x244666,null))[_0xd4a8('0x26')](handleError(_0x244666,null));};exports[_0xd4a8('0x58')]=function(_0xbed0dc,_0x2df045,_0x4e393d){if(_0xbed0dc[_0xd4a8('0x53')]['id']){delete _0xbed0dc[_0xd4a8('0x53')]['id'];}return db['FreshdeskAccount'][_0xd4a8('0x59')]({'where':{'id':_0xbed0dc[_0xd4a8('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2df045,null))[_0xd4a8('0x1d')](function(_0x13d0b0){if(_0x13d0b0){_0xbed0dc['body'][_0xd4a8('0x5a')]=_0x13d0b0['id'];_0xbed0dc[_0xd4a8('0x53')][_0xd4a8('0x5b')]=integrations[_0xd4a8('0x5c')](_0xbed0dc[_0xd4a8('0x53')][_0xd4a8('0x5d')],_0xbed0dc['body'][_0xd4a8('0x46')]);_0xbed0dc[_0xd4a8('0x53')][_0xd4a8('0x5e')]=integrations[_0xd4a8('0x5f')](_0xbed0dc[_0xd4a8('0x53')][_0xd4a8('0x5d')],_0xbed0dc[_0xd4a8('0x53')][_0xd4a8('0x46')]);return db[_0xd4a8('0x56')][_0xd4a8('0x52')](_0xbed0dc[_0xd4a8('0x53')],{'include':[{'model':db[_0xd4a8('0x60')],'as':_0xd4a8('0x5b')},{'model':db[_0xd4a8('0x60')],'as':_0xd4a8('0x5e')}]});}return null;})[_0xd4a8('0x1d')](respondWithResult(_0x2df045,null))[_0xd4a8('0x26')](handleError(_0x2df045,null));};exports[_0xd4a8('0x61')]=function(_0x17a499,_0x2ca76c,_0x2de02e){var _0x14bdc2='';return db[_0xd4a8('0x49')][_0xd4a8('0x59')]({'where':{'id':_0x17a499[_0xd4a8('0x4f')]['id']},'attributes':['id',_0xd4a8('0x62'),_0xd4a8('0x63')]})[_0xd4a8('0x1d')](handleEntityNotFound(_0x2ca76c,null))[_0xd4a8('0x1d')](function(_0x915f56){if(_0x915f56){_0x14bdc2=_0x915f56[_0xd4a8('0x62')];var _0x460eb7=_0x14bdc2[_0xd4a8('0x64')](-0x1);if(_0x460eb7==='/'){_0x14bdc2=_0x14bdc2[_0xd4a8('0x65')](0x0,_0x14bdc2['lastIndexOf'](_0x460eb7));}return rp({'method':_0xd4a8('0x66'),'uri':util[_0xd4a8('0x67')](_0xd4a8('0x68'),_0x14bdc2,'api/v2/ticket_fields'),'headers':{'Authorization':util['format'](_0xd4a8('0x69'),new Buffer(util[_0xd4a8('0x67')](_0xd4a8('0x6a'),_0x915f56[_0xd4a8('0x63')]))[_0xd4a8('0x6b')](_0xd4a8('0x6c')))},'json':!![]});}})[_0xd4a8('0x1d')](function(_0x2c0eb9){if(_0x2c0eb9){var _0x1cb176=['requester',_0xd4a8('0x6d'),_0xd4a8('0x6e'),_0xd4a8('0x6f'),_0xd4a8('0x27'),_0xd4a8('0x70'),'group','source','ticket_type',_0xd4a8('0x71'),'company'];_[_0xd4a8('0x72')](_0x2c0eb9,function(_0x436beb){return _0x1cb176[_0xd4a8('0x73')](_0x436beb[_0xd4a8('0x34')])||!_0x436beb[_0xd4a8('0x74')]&&_0x436beb[_0xd4a8('0x46')]!==_0xd4a8('0x75')&&_0x436beb[_0xd4a8('0x46')]!==_0xd4a8('0x76');});return{'count':_0x2c0eb9[_0xd4a8('0x40')],'rows':_['map'](_0x2c0eb9,function(_0x559be4){return{'id':_0x559be4['name'],'name':_0x559be4[_0xd4a8('0x77')],'custom':!_0x559be4[_0xd4a8('0x74')],'options':_0x559be4[_0xd4a8('0x78')]?_[_0xd4a8('0x36')](_0x559be4[_0xd4a8('0x78')],function(_0x3f6eb5){return{'name':_[_0xd4a8('0x79')](_0x3f6eb5),'value':_0x3f6eb5};}):[]};})};}})[_0xd4a8('0x1d')](respondWithResult(_0x2ca76c,null))['catch'](function(_0x2a8851){var _0x591058=_0x17a499['query'][_0xd4a8('0x19')]?0x1f4:_0x2a8851[_0xd4a8('0x7a')]||0x1f4;logger[_0xd4a8('0x23')](_0xd4a8('0x7b'),_0xd4a8('0x61'),_0x591058,JSON[_0xd4a8('0x7c')](_0x2a8851));delete _0x2a8851['name'];if(_0x591058===0x191){_0x591058=0x190;}_0x2ca76c[_0xd4a8('0x27')](_0x591058)['send'](_0x17a499['query'][_0xd4a8('0x19')]?{'message':_0xd4a8('0x7d'),'statusCode':_0x2a8851[_0xd4a8('0x7a')]}:_0x2a8851);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 2ed41be..cdd6c4b 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 _0xbf91=['path','rimraf','../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','int_freshdesk_accounts','lodash','../../config/logger','api','moment'];(function(_0x11b1b3,_0xf3cc69){var _0x437029=function(_0x40499a){while(--_0x40499a){_0x11b1b3['push'](_0x11b1b3['shift']());}};_0x437029(++_0xf3cc69);}(_0xbf91,0x8c));var _0x1bf9=function(_0x5045a8,_0x5d27b9){_0x5045a8=_0x5045a8-0x0;var _0x3945cf=_0xbf91[_0x5045a8];return _0x3945cf;};'use strict';var _=require(_0x1bf9('0x0'));var util=require('util');var logger=require(_0x1bf9('0x1'))(_0x1bf9('0x2'));var moment=require(_0x1bf9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1bf9('0x4'));var rimraf=require(_0x1bf9('0x5'));var config=require(_0x1bf9('0x6'));var attributes=require(_0x1bf9('0x7'));var integrations=require(_0x1bf9('0x8'));module[_0x1bf9('0x9')]=function(_0xe03004,_0x33dd2d){return _0xe03004[_0x1bf9('0xa')]('FreshdeskAccount',attributes,{'tableName':_0x1bf9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7ca5=['./intFreshdeskAccount.attributes','../../components/integrations/configuration','FreshdeskAccount','lodash','util','api','moment','request-promise','rimraf'];(function(_0xdefbc3,_0x1ea49a){var _0x367798=function(_0x594678){while(--_0x594678){_0xdefbc3['push'](_0xdefbc3['shift']());}};_0x367798(++_0x1ea49a);}(_0x7ca5,0x1f2));var _0x57ca=function(_0x1332fc,_0x5dae42){_0x1332fc=_0x1332fc-0x0;var _0x17ff02=_0x7ca5[_0x1332fc];return _0x17ff02;};'use strict';var _=require(_0x57ca('0x0'));var util=require(_0x57ca('0x1'));var logger=require('../../config/logger')(_0x57ca('0x2'));var moment=require(_0x57ca('0x3'));var BPromise=require('bluebird');var rp=require(_0x57ca('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x57ca('0x5'));var config=require('../../config/environment');var attributes=require(_0x57ca('0x6'));var integrations=require(_0x57ca('0x7'));module['exports']=function(_0xdfa30a,_0x209eb){return _0xdfa30a['define'](_0x57ca('0x8'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.rpc.js index 7555602..f04966f 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 _0xcd47=['map','model','then','GetFreshdeskAccount','ShowFreshdeskAccount','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','FreshdeskAccount,\x20%s,\x20%s','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','FreshdeskAccount','findAll','options','raw','where','attributes','limit','include'];(function(_0x222dd3,_0x4b0e4b){var _0x2c3d17=function(_0x592318){while(--_0x592318){_0x222dd3['push'](_0x222dd3['shift']());}};_0x2c3d17(++_0x4b0e4b);}(_0xcd47,0x1e1));var _0x7cd4=function(_0xe52657,_0x374354){_0xe52657=_0xe52657-0x0;var _0x4f14ea=_0xcd47[_0xe52657];return _0x4f14ea;};'use strict';var _=require(_0x7cd4('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x7cd4('0x1'));var rs=require(_0x7cd4('0x2'));var fs=require('fs');var Redis=require(_0x7cd4('0x3'));var db=require(_0x7cd4('0x4'))['db'];var utils=require(_0x7cd4('0x5'));var logger=require(_0x7cd4('0x6'))(_0x7cd4('0x7'));var config=require(_0x7cd4('0x8'));var jayson=require(_0x7cd4('0x9'));var client=jayson[_0x7cd4('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x378c56,_0x210206,_0x54959c){return new BPromise(function(_0x209d38,_0x2a1949){return client[_0x7cd4('0xb')](_0x378c56,_0x54959c)['then'](function(_0x15a669){logger[_0x7cd4('0xc')](_0x7cd4('0xd'),_0x210206,'request\x20sent');logger['debug'](_0x7cd4('0xe'),_0x210206,_0x7cd4('0xf'),JSON[_0x7cd4('0x10')](_0x15a669));if(_0x15a669[_0x7cd4('0x11')]){if(_0x15a669[_0x7cd4('0x11')][_0x7cd4('0x12')]===0x1f4){logger[_0x7cd4('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x210206,_0x15a669[_0x7cd4('0x11')][_0x7cd4('0x13')]);return _0x2a1949(_0x15a669[_0x7cd4('0x11')][_0x7cd4('0x13')]);}logger[_0x7cd4('0x11')](_0x7cd4('0xd'),_0x210206,_0x15a669['error']['message']);return _0x209d38(_0x15a669[_0x7cd4('0x11')][_0x7cd4('0x13')]);}else{logger[_0x7cd4('0xc')](_0x7cd4('0xd'),_0x210206,_0x7cd4('0xf'));_0x209d38(_0x15a669['result'][_0x7cd4('0x13')]);}})[_0x7cd4('0x14')](function(_0xf86707){logger[_0x7cd4('0x11')]('FreshdeskAccount,\x20%s,\x20%s',_0x210206,_0xf86707);_0x2a1949(_0xf86707);});});}exports['GetFreshdeskAccount']=function(_0x56a549){var _0x5610b4=this;return new Promise(function(_0x2650d1,_0x473758){return db[_0x7cd4('0x15')][_0x7cd4('0x16')]({'raw':_0x56a549[_0x7cd4('0x17')]?_0x56a549['options'][_0x7cd4('0x18')]===undefined?!![]:![]:!![],'where':_0x56a549[_0x7cd4('0x17')]?_0x56a549[_0x7cd4('0x17')][_0x7cd4('0x19')]||null:null,'attributes':_0x56a549['options']?_0x56a549[_0x7cd4('0x17')][_0x7cd4('0x1a')]||null:null,'limit':_0x56a549[_0x7cd4('0x17')]?_0x56a549['options'][_0x7cd4('0x1b')]||null:null,'include':_0x56a549['options']?_0x56a549[_0x7cd4('0x17')][_0x7cd4('0x1c')]?_[_0x7cd4('0x1d')](_0x56a549[_0x7cd4('0x17')][_0x7cd4('0x1c')],function(_0x188db9){return{'model':db[_0x188db9[_0x7cd4('0x1e')]],'as':_0x188db9['as'],'attributes':_0x188db9[_0x7cd4('0x1a')],'include':_0x188db9['include']?_[_0x7cd4('0x1d')](_0x188db9[_0x7cd4('0x1c')],function(_0x34a79c){return{'model':db[_0x34a79c[_0x7cd4('0x1e')]],'as':_0x34a79c['as'],'attributes':_0x34a79c['attributes'],'include':_0x34a79c['include']?_[_0x7cd4('0x1d')](_0x34a79c[_0x7cd4('0x1c')],function(_0x37a209){return{'model':db[_0x37a209[_0x7cd4('0x1e')]],'as':_0x37a209['as'],'attributes':_0x37a209['attributes']};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x1f')](function(_0x4500ec){logger[_0x7cd4('0xc')](_0x7cd4('0x20'),_0x56a549);logger['debug']('GetFreshdeskAccount',_0x56a549,JSON['stringify'](_0x4500ec));_0x2650d1(_0x4500ec);})['catch'](function(_0x31d2be){logger[_0x7cd4('0x11')]('GetFreshdeskAccount',_0x31d2be[_0x7cd4('0x13')],_0x56a549);_0x473758(_0x5610b4['error'](0x1f4,_0x31d2be[_0x7cd4('0x13')]));});});};exports['ShowFreshdeskAccount']=function(_0x4b692e){var _0x582495=this;return new Promise(function(_0x22499b,_0x2e0ad1){return db[_0x7cd4('0x15')]['find']({'raw':_0x4b692e[_0x7cd4('0x17')]?_0x4b692e[_0x7cd4('0x17')][_0x7cd4('0x18')]===undefined?!![]:![]:!![],'where':_0x4b692e['options']?_0x4b692e[_0x7cd4('0x17')][_0x7cd4('0x19')]||null:null,'attributes':_0x4b692e[_0x7cd4('0x17')]?_0x4b692e[_0x7cd4('0x17')][_0x7cd4('0x1a')]||null:null,'include':_0x4b692e[_0x7cd4('0x17')]?_0x4b692e[_0x7cd4('0x17')][_0x7cd4('0x1c')]?_['map'](_0x4b692e[_0x7cd4('0x17')][_0x7cd4('0x1c')],function(_0x5d898f){return{'model':db[_0x5d898f[_0x7cd4('0x1e')]],'as':_0x5d898f['as'],'attributes':_0x5d898f[_0x7cd4('0x1a')],'include':_0x5d898f[_0x7cd4('0x1c')]?_[_0x7cd4('0x1d')](_0x5d898f[_0x7cd4('0x1c')],function(_0x1f494f){return{'model':db[_0x1f494f[_0x7cd4('0x1e')]],'as':_0x1f494f['as'],'attributes':_0x1f494f[_0x7cd4('0x1a')],'include':_0x1f494f[_0x7cd4('0x1c')]?_[_0x7cd4('0x1d')](_0x1f494f[_0x7cd4('0x1c')],function(_0x166022){return{'model':db[_0x166022[_0x7cd4('0x1e')]],'as':_0x166022['as'],'attributes':_0x166022[_0x7cd4('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x7cd4('0x1f')](function(_0x1f27ca){logger[_0x7cd4('0xc')](_0x7cd4('0x21'),_0x4b692e);logger['debug'](_0x7cd4('0x21'),_0x4b692e,JSON[_0x7cd4('0x10')](_0x1f27ca));_0x22499b(_0x1f27ca);})[_0x7cd4('0x14')](function(_0x5df753){logger[_0x7cd4('0x11')](_0x7cd4('0x21'),_0x5df753[_0x7cd4('0x13')],_0x4b692e);_0x2e0ad1(_0x582495[_0x7cd4('0x11')](0x1f4,_0x5df753[_0x7cd4('0x13')]));});});}; \ No newline at end of file +var _0x1a53=['attributes','debug','catch','ShowFreshdeskAccount','find','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','raw','limit','include','map','model'];(function(_0x17ab23,_0x1e9de7){var _0x598c5c=function(_0x35fd93){while(--_0x35fd93){_0x17ab23['push'](_0x17ab23['shift']());}};_0x598c5c(++_0x1e9de7);}(_0x1a53,0x196));var _0x31a5=function(_0x13bf36,_0x2a305b){_0x13bf36=_0x13bf36-0x0;var _0x2bfd47=_0x1a53[_0x13bf36];return _0x2bfd47;};'use strict';var _=require(_0x31a5('0x0'));var util=require(_0x31a5('0x1'));var moment=require(_0x31a5('0x2'));var BPromise=require(_0x31a5('0x3'));var rs=require(_0x31a5('0x4'));var fs=require('fs');var Redis=require(_0x31a5('0x5'));var db=require(_0x31a5('0x6'))['db'];var utils=require(_0x31a5('0x7'));var logger=require(_0x31a5('0x8'))(_0x31a5('0x9'));var config=require(_0x31a5('0xa'));var jayson=require(_0x31a5('0xb'));var client=jayson[_0x31a5('0xc')][_0x31a5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0xafa973,_0x1500a1,_0x434bc7){return new BPromise(function(_0x5db421,_0x36847d){return client[_0x31a5('0xe')](_0xafa973,_0x434bc7)[_0x31a5('0xf')](function(_0x159777){logger[_0x31a5('0x10')](_0x31a5('0x11'),_0x1500a1,_0x31a5('0x12'));logger['debug'](_0x31a5('0x13'),_0x1500a1,_0x31a5('0x12'),JSON[_0x31a5('0x14')](_0x159777));if(_0x159777['error']){if(_0x159777[_0x31a5('0x15')][_0x31a5('0x16')]===0x1f4){logger[_0x31a5('0x15')]('FreshdeskAccount,\x20%s,\x20%s',_0x1500a1,_0x159777['error']['message']);return _0x36847d(_0x159777[_0x31a5('0x15')][_0x31a5('0x17')]);}logger[_0x31a5('0x15')](_0x31a5('0x11'),_0x1500a1,_0x159777[_0x31a5('0x15')][_0x31a5('0x17')]);return _0x5db421(_0x159777[_0x31a5('0x15')][_0x31a5('0x17')]);}else{logger[_0x31a5('0x10')]('FreshdeskAccount,\x20%s,\x20%s',_0x1500a1,_0x31a5('0x12'));_0x5db421(_0x159777[_0x31a5('0x18')][_0x31a5('0x17')]);}})['catch'](function(_0x986aac){logger[_0x31a5('0x15')](_0x31a5('0x11'),_0x1500a1,_0x986aac);_0x36847d(_0x986aac);});});}exports[_0x31a5('0x19')]=function(_0x3b70f8){var _0x254c41=this;return new Promise(function(_0x16f14d,_0x82547d){return db[_0x31a5('0x1a')][_0x31a5('0x1b')]({'raw':_0x3b70f8[_0x31a5('0x1c')]?_0x3b70f8['options'][_0x31a5('0x1d')]===undefined?!![]:![]:!![],'where':_0x3b70f8[_0x31a5('0x1c')]?_0x3b70f8['options']['where']||null:null,'attributes':_0x3b70f8[_0x31a5('0x1c')]?_0x3b70f8[_0x31a5('0x1c')]['attributes']||null:null,'limit':_0x3b70f8[_0x31a5('0x1c')]?_0x3b70f8['options'][_0x31a5('0x1e')]||null:null,'include':_0x3b70f8[_0x31a5('0x1c')]?_0x3b70f8[_0x31a5('0x1c')][_0x31a5('0x1f')]?_[_0x31a5('0x20')](_0x3b70f8[_0x31a5('0x1c')]['include'],function(_0x18676d){return{'model':db[_0x18676d[_0x31a5('0x21')]],'as':_0x18676d['as'],'attributes':_0x18676d[_0x31a5('0x22')],'include':_0x18676d[_0x31a5('0x1f')]?_[_0x31a5('0x20')](_0x18676d['include'],function(_0xb15bef){return{'model':db[_0xb15bef[_0x31a5('0x21')]],'as':_0xb15bef['as'],'attributes':_0xb15bef['attributes'],'include':_0xb15bef['include']?_[_0x31a5('0x20')](_0xb15bef[_0x31a5('0x1f')],function(_0x5c392f){return{'model':db[_0x5c392f[_0x31a5('0x21')]],'as':_0x5c392f['as'],'attributes':_0x5c392f[_0x31a5('0x22')]};}):[]};}):[]};}):[]:[]})[_0x31a5('0xf')](function(_0x29de16){logger[_0x31a5('0x10')](_0x31a5('0x19'),_0x3b70f8);logger[_0x31a5('0x23')](_0x31a5('0x19'),_0x3b70f8,JSON[_0x31a5('0x14')](_0x29de16));_0x16f14d(_0x29de16);})[_0x31a5('0x24')](function(_0x4af16e){logger[_0x31a5('0x15')]('GetFreshdeskAccount',_0x4af16e[_0x31a5('0x17')],_0x3b70f8);_0x82547d(_0x254c41['error'](0x1f4,_0x4af16e[_0x31a5('0x17')]));});});};exports[_0x31a5('0x25')]=function(_0x3ec95f){var _0x337086=this;return new Promise(function(_0x20b91a,_0x5b538a){return db[_0x31a5('0x1a')][_0x31a5('0x26')]({'raw':_0x3ec95f[_0x31a5('0x1c')]?_0x3ec95f[_0x31a5('0x1c')][_0x31a5('0x1d')]===undefined?!![]:![]:!![],'where':_0x3ec95f[_0x31a5('0x1c')]?_0x3ec95f['options'][_0x31a5('0x27')]||null:null,'attributes':_0x3ec95f[_0x31a5('0x1c')]?_0x3ec95f[_0x31a5('0x1c')][_0x31a5('0x22')]||null:null,'include':_0x3ec95f['options']?_0x3ec95f[_0x31a5('0x1c')][_0x31a5('0x1f')]?_[_0x31a5('0x20')](_0x3ec95f['options'][_0x31a5('0x1f')],function(_0x16144e){return{'model':db[_0x16144e[_0x31a5('0x21')]],'as':_0x16144e['as'],'attributes':_0x16144e[_0x31a5('0x22')],'include':_0x16144e[_0x31a5('0x1f')]?_['map'](_0x16144e['include'],function(_0x27a93d){return{'model':db[_0x27a93d[_0x31a5('0x21')]],'as':_0x27a93d['as'],'attributes':_0x27a93d[_0x31a5('0x22')],'include':_0x27a93d[_0x31a5('0x1f')]?_[_0x31a5('0x20')](_0x27a93d[_0x31a5('0x1f')],function(_0x48047d){return{'model':db[_0x48047d[_0x31a5('0x21')]],'as':_0x48047d['as'],'attributes':_0x48047d[_0x31a5('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x28551a){logger['info'](_0x31a5('0x25'),_0x3ec95f);logger[_0x31a5('0x23')](_0x31a5('0x25'),_0x3ec95f,JSON[_0x31a5('0x14')](_0x28551a));_0x20b91a(_0x28551a);})[_0x31a5('0x24')](function(_0x3269e5){logger[_0x31a5('0x15')]('ShowFreshdeskAccount',_0x3269e5[_0x31a5('0x17')],_0x3ec95f);_0x5b538a(_0x337086[_0x31a5('0x15')](0x1f4,_0x3269e5[_0x31a5('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index a6b19db..abd505b 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 _0x35fa=['/:id/tags','setTags','put','update','delete','destroy','multer','util','path','express','Router','../../config/environment','./intFreshdeskConfiguration.controller','get','index','/:id','show','/:id/fields','isAuthenticated','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create'];(function(_0x3f454e,_0x1b6b17){var _0x547b14=function(_0x33cb2d){while(--_0x33cb2d){_0x3f454e['push'](_0x3f454e['shift']());}};_0x547b14(++_0x1b6b17);}(_0x35fa,0x1c0));var _0xa35f=function(_0x16efcd,_0x52bc16){_0x16efcd=_0x16efcd-0x0;var _0x298b68=_0x35fa[_0x16efcd];return _0x298b68;};'use strict';var multer=require(_0xa35f('0x0'));var util=require(_0xa35f('0x1'));var path=require(_0xa35f('0x2'));var timeout=require('connect-timeout');var express=require(_0xa35f('0x3'));var router=express[_0xa35f('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa35f('0x5'));var controller=require(_0xa35f('0x6'));router[_0xa35f('0x7')]('/',auth['isAuthenticated'](),controller[_0xa35f('0x8')]);router[_0xa35f('0x7')](_0xa35f('0x9'),auth['isAuthenticated'](),controller[_0xa35f('0xa')]);router['get'](_0xa35f('0xb'),auth[_0xa35f('0xc')](),controller[_0xa35f('0xd')]);router[_0xa35f('0x7')](_0xa35f('0xe'),auth[_0xa35f('0xc')](),controller[_0xa35f('0xf')]);router[_0xa35f('0x7')]('/:id/descriptions',auth[_0xa35f('0xc')](),controller[_0xa35f('0x10')]);router[_0xa35f('0x7')]('/:id/tags',auth[_0xa35f('0xc')](),controller[_0xa35f('0x11')]);router[_0xa35f('0x12')]('/',auth['isAuthenticated'](),controller[_0xa35f('0x13')]);router[_0xa35f('0x12')](_0xa35f('0x14'),auth[_0xa35f('0xc')](),controller[_0xa35f('0x15')]);router[_0xa35f('0x16')]('/:id',auth[_0xa35f('0xc')](),controller[_0xa35f('0x17')]);router[_0xa35f('0x18')]('/:id',auth['isAuthenticated'](),controller[_0xa35f('0x19')]);module['exports']=router; \ No newline at end of file +var _0x0dc5=['/:id/subjects','/:id/tags','getTags','put','/:id','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id/fields','isAuthenticated','getFields'];(function(_0x2493f7,_0x49c670){var _0x594ab2=function(_0x344ec2){while(--_0x344ec2){_0x2493f7['push'](_0x2493f7['shift']());}};_0x594ab2(++_0x49c670);}(_0x0dc5,0x1d6));var _0x50dc=function(_0x55930b,_0x47fd3f){_0x55930b=_0x55930b-0x0;var _0x34a347=_0x0dc5[_0x55930b];return _0x34a347;};'use strict';var multer=require(_0x50dc('0x0'));var util=require(_0x50dc('0x1'));var path=require(_0x50dc('0x2'));var timeout=require(_0x50dc('0x3'));var express=require(_0x50dc('0x4'));var router=express[_0x50dc('0x5')]();var auth=require(_0x50dc('0x6'));var interaction=require(_0x50dc('0x7'));var config=require(_0x50dc('0x8'));var controller=require('./intFreshdeskConfiguration.controller');router[_0x50dc('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x50dc('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x50dc('0x9')](_0x50dc('0xa'),auth[_0x50dc('0xb')](),controller[_0x50dc('0xc')]);router['get'](_0x50dc('0xd'),auth[_0x50dc('0xb')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller['getDescriptions']);router['get'](_0x50dc('0xe'),auth[_0x50dc('0xb')](),controller[_0x50dc('0xf')]);router['post']('/',auth[_0x50dc('0xb')](),controller['create']);router['post']('/:id/tags',auth['isAuthenticated'](),controller['setTags']);router[_0x50dc('0x10')](_0x50dc('0x11'),auth['isAuthenticated'](),controller[_0x50dc('0x12')]);router['delete'](_0x50dc('0x11'),auth[_0x50dc('0xb')](),controller[_0x50dc('0x13')]);module[_0x50dc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index d931d65..6b03ba3 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 _0xfaf5=['STRING','exports'];(function(_0x1175df,_0x5d0c0c){var _0x23e90c=function(_0x2cbe10){while(--_0x2cbe10){_0x1175df['push'](_0x1175df['shift']());}};_0x23e90c(++_0x5d0c0c);}(_0xfaf5,0x11f));var _0x5faf=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfaf5[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x5faf('0x0')]={'name':{'type':Sequelize[_0x5faf('0x1')]},'description':{'type':Sequelize[_0x5faf('0x1')]}}; \ No newline at end of file +var _0xb82a=['STRING','sequelize','exports'];(function(_0x47f84a,_0x33b10f){var _0x328233=function(_0x174a31){while(--_0x174a31){_0x47f84a['push'](_0x47f84a['shift']());}};_0x328233(++_0x33b10f);}(_0xb82a,0x187));var _0xab82=function(_0xbe65eb,_0x5e179a){_0xbe65eb=_0xbe65eb-0x0;var _0x3520c9=_0xb82a[_0xbe65eb];return _0x3520c9;};'use strict';var Sequelize=require(_0xab82('0x0'));module[_0xab82('0x1')]={'name':{'type':Sequelize[_0xab82('0x2')]},'description':{'type':Sequelize[_0xab82('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index f2068ad..ba17d4f 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 _0x3e57=['rows','params','find','create','body','getFields','FreshdeskField','getSubjects','hasOwnProperty','findOne','getDescriptions','getTags','Tag','setTags','ids','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','status','end','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','sendStatus','stack','name','send','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','query','keys','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include'];(function(_0x1020c0,_0x4f8652){var _0x474c22=function(_0x9774bb){while(--_0x9774bb){_0x1020c0['push'](_0x1020c0['shift']());}};_0x474c22(++_0x4f8652);}(_0x3e57,0x1d1));var _0x73e5=function(_0x1e381c,_0x47b5b9){_0x1e381c=_0x1e381c-0x0;var _0x9b5ea9=_0x3e57[_0x1e381c];return _0x9b5ea9;};'use strict';var pdf=require(_0x73e5('0x0'));var emlformat=require(_0x73e5('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x73e5('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x73e5('0x3'));var BPromise=require(_0x73e5('0x4'));var Mustache=require(_0x73e5('0x5'));var util=require('util');var path=require(_0x73e5('0x6'));var sox=require(_0x73e5('0x7'));var csv=require(_0x73e5('0x8'));var ejs=require(_0x73e5('0x9'));var fs=require('fs');var _=require(_0x73e5('0xa'));var squel=require(_0x73e5('0xb'));var crypto=require(_0x73e5('0xc'));var jsforce=require(_0x73e5('0xd'));var deskjs=require(_0x73e5('0xe'));var toCsv=require(_0x73e5('0x8'));var querystring=require('querystring');var Papa=require(_0x73e5('0xf'));var Redis=require('ioredis');var authService=require(_0x73e5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x73e5('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x73e5('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x73e5('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x52079c,_0x12ac6f,_0xdbf756){if(_0xdbf756){var _0x1eff56=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1eff56[_0x73e5('0x14')](_0x12ac6f)){return _0x52079c;}else{throw new db['Sequelize'][(_0x73e5('0x15'))](_0x73e5('0x16'));}}else{return _0x52079c;}}function respondWithRpcPromise(_0x48b3ca,_0x317da9,_0x5107a5,_0x1835db){return new BPromise(function(_0x44f25e,_0x3c8b1f){var _0x3ef327=_0x1835db||client;return _0x3ef327[_0x73e5('0x17')](_0x48b3ca,_0x5107a5)['then'](function(_0x4e38f4){logger[_0x73e5('0x18')](_0x73e5('0x19'),_0x317da9,_0x73e5('0x1a'));logger[_0x73e5('0x1b')](_0x73e5('0x1c'),_0x317da9,_0x73e5('0x1a'),JSON[_0x73e5('0x1d')](_0x4e38f4));if(_0x4e38f4[_0x73e5('0x1e')]){if(_0x4e38f4[_0x73e5('0x1e')][_0x73e5('0x1f')]===0x1f4){logger['error'](_0x73e5('0x19'),_0x317da9,_0x4e38f4[_0x73e5('0x1e')][_0x73e5('0x20')]);return _0x3c8b1f(_0x4e38f4[_0x73e5('0x1e')][_0x73e5('0x20')]);}logger[_0x73e5('0x1e')](_0x73e5('0x19'),_0x317da9,_0x4e38f4[_0x73e5('0x1e')][_0x73e5('0x20')]);return _0x44f25e(_0x4e38f4[_0x73e5('0x1e')][_0x73e5('0x20')]);}else{logger[_0x73e5('0x18')](_0x73e5('0x19'),_0x317da9,_0x73e5('0x1a'));_0x44f25e(_0x4e38f4[_0x73e5('0x21')][_0x73e5('0x20')]);}})[_0x73e5('0x22')](function(_0x2ef1c8){logger[_0x73e5('0x1e')](_0x73e5('0x19'),_0x317da9,_0x2ef1c8);_0x3c8b1f(_0x2ef1c8);});});}function respondWithStatusCode(_0x53a3d2,_0x5e80d4){_0x5e80d4=_0x5e80d4||0xcc;return function(_0x1decf8){if(_0x1decf8){return _0x53a3d2['sendStatus'](_0x5e80d4);}return _0x53a3d2[_0x73e5('0x23')](_0x5e80d4)[_0x73e5('0x24')]();};}function respondWithResult(_0x111ba2,_0x54be37){_0x54be37=_0x54be37||0xc8;return function(_0x5476e4){if(_0x5476e4){return _0x111ba2['status'](_0x54be37)['json'](_0x5476e4);}};}function respondWithFilteredResult(_0x2be8e8,_0x251547){return function(_0x4fe2d4){if(_0x4fe2d4){var _0x4bdbf6=_0x4fe2d4[_0x73e5('0x25')],_0x311eca=_0x251547['offset'],_0x4a6fd6=_0x251547[_0x73e5('0x26')]+_0x251547[_0x73e5('0x27')],_0x1a3236;if(_0x4a6fd6>=_0x4bdbf6){_0x4a6fd6=_0x4bdbf6;_0x1a3236=0xc8;}else{_0x1a3236=0xce;}_0x2be8e8[_0x73e5('0x23')](_0x1a3236);return _0x2be8e8[_0x73e5('0x28')](_0x73e5('0x29'),_0x311eca+'-'+_0x4a6fd6+'/'+_0x4bdbf6)['json'](_0x4fe2d4);}return null;};}function patchUpdates(_0x2570b6){return function(_0x3cc52d){try{jsonpatch['apply'](_0x3cc52d,_0x2570b6,!![]);}catch(_0x3444bd){return BPromise[_0x73e5('0x2a')](_0x3444bd);}return _0x3cc52d[_0x73e5('0x2b')]();};}function saveUpdates(_0x5516ca,_0xb8bbfd){return function(_0x415ef6){if(_0x415ef6){return _0x415ef6[_0x73e5('0x2c')](_0x5516ca)[_0x73e5('0x2d')](function(_0x2bd0c8){return _0x2bd0c8;});}return null;};}function removeEntity(_0x452c54,_0x37863b){return function(_0x3a953e){if(_0x3a953e){return _0x3a953e[_0x73e5('0x2e')]()['then'](function(){_0x452c54[_0x73e5('0x23')](0xcc)['end']();});}};}function handleEntityNotFound(_0x48b42c,_0x2d9e83){return function(_0x149518){if(!_0x149518){_0x48b42c[_0x73e5('0x2f')](0x194);}return _0x149518;};}function handleError(_0xf14bd6,_0xd6e858){_0xd6e858=_0xd6e858||0x1f4;return function(_0x542289){logger[_0x73e5('0x1e')](_0x542289[_0x73e5('0x30')]);if(_0x542289['name']){delete _0x542289[_0x73e5('0x31')];}_0xf14bd6[_0x73e5('0x23')](_0xd6e858)[_0x73e5('0x32')](_0x542289);};}exports[_0x73e5('0x33')]=function(_0x4350a4,_0x108326){var _0x1ce5e5={},_0x109f7b={},_0x458ce4={'count':0x0,'rows':[]};var _0x48ab1d=_[_0x73e5('0x34')](db[_0x73e5('0x35')][_0x73e5('0x36')],function(_0x1716f9){return{'name':_0x1716f9[_0x73e5('0x37')],'type':_0x1716f9[_0x73e5('0x38')]['key']};});_0x109f7b['model']=_[_0x73e5('0x34')](_0x48ab1d,_0x73e5('0x31'));_0x109f7b[_0x73e5('0x39')]=_[_0x73e5('0x3a')](_0x4350a4[_0x73e5('0x39')]);_0x109f7b[_0x73e5('0x3b')]=_[_0x73e5('0x3c')](_0x109f7b['model'],_0x109f7b[_0x73e5('0x39')]);_0x1ce5e5[_0x73e5('0x3d')]=_[_0x73e5('0x3c')](_0x109f7b[_0x73e5('0x3e')],qs['fields'](_0x4350a4[_0x73e5('0x39')][_0x73e5('0x3f')]));_0x1ce5e5[_0x73e5('0x3d')]=_0x1ce5e5['attributes'][_0x73e5('0x40')]?_0x1ce5e5[_0x73e5('0x3d')]:_0x109f7b[_0x73e5('0x3e')];if(!_0x4350a4[_0x73e5('0x39')]['hasOwnProperty'](_0x73e5('0x41'))){_0x1ce5e5[_0x73e5('0x27')]=qs[_0x73e5('0x27')](_0x4350a4['query'][_0x73e5('0x27')]);_0x1ce5e5[_0x73e5('0x26')]=qs[_0x73e5('0x26')](_0x4350a4[_0x73e5('0x39')][_0x73e5('0x26')]);}_0x1ce5e5[_0x73e5('0x42')]=qs[_0x73e5('0x43')](_0x4350a4[_0x73e5('0x39')][_0x73e5('0x43')]);_0x1ce5e5[_0x73e5('0x44')]=qs[_0x73e5('0x3b')](_[_0x73e5('0x45')](_0x4350a4[_0x73e5('0x39')],_0x109f7b[_0x73e5('0x3b')]));if(_0x4350a4[_0x73e5('0x39')][_0x73e5('0x46')]){_0x1ce5e5[_0x73e5('0x44')]=_[_0x73e5('0x47')](_0x1ce5e5[_0x73e5('0x44')],{'$or':_['map'](_0x48ab1d,function(_0x6f5315){if(_0x6f5315[_0x73e5('0x38')]!=='VIRTUAL'){var _0x7cd069={};_0x7cd069[_0x6f5315[_0x73e5('0x31')]]={'$like':'%'+_0x4350a4[_0x73e5('0x39')][_0x73e5('0x46')]+'%'};return _0x7cd069;}})});}_0x1ce5e5=_[_0x73e5('0x47')]({},_0x1ce5e5,_0x4350a4[_0x73e5('0x48')]);var _0xb5b2b7={'where':_0x1ce5e5[_0x73e5('0x44')]};return db[_0x73e5('0x35')]['count'](_0xb5b2b7)[_0x73e5('0x2d')](function(_0x5a9ad7){_0x458ce4['count']=_0x5a9ad7;if(_0x4350a4[_0x73e5('0x39')][_0x73e5('0x49')]){_0x1ce5e5[_0x73e5('0x4a')]=[{'all':!![]}];}return db[_0x73e5('0x35')]['findAll'](_0x1ce5e5);})[_0x73e5('0x2d')](function(_0x28fc26){_0x458ce4[_0x73e5('0x4b')]=_0x28fc26;return _0x458ce4;})[_0x73e5('0x2d')](respondWithFilteredResult(_0x108326,_0x1ce5e5))['catch'](handleError(_0x108326,null));};exports['show']=function(_0x18e84e,_0xa480ba){var _0x385b89={'raw':![],'where':{'id':_0x18e84e[_0x73e5('0x4c')]['id']}},_0x393f28={};_0x393f28['model']=_['keys'](db[_0x73e5('0x35')][_0x73e5('0x36')]);_0x393f28[_0x73e5('0x39')]=_['keys'](_0x18e84e[_0x73e5('0x39')]);_0x393f28[_0x73e5('0x3b')]=_[_0x73e5('0x3c')](_0x393f28['model'],_0x393f28[_0x73e5('0x39')]);_0x385b89[_0x73e5('0x3d')]=_[_0x73e5('0x3c')](_0x393f28['model'],qs[_0x73e5('0x3f')](_0x18e84e['query']['fields']));_0x385b89[_0x73e5('0x3d')]=_0x385b89[_0x73e5('0x3d')][_0x73e5('0x40')]?_0x385b89[_0x73e5('0x3d')]:_0x393f28[_0x73e5('0x3e')];if(_0x18e84e[_0x73e5('0x39')][_0x73e5('0x49')]){_0x385b89[_0x73e5('0x4a')]=[{'all':!![]}];}_0x385b89=_[_0x73e5('0x47')]({},_0x385b89,_0x18e84e['options']);return db[_0x73e5('0x35')][_0x73e5('0x4d')](_0x385b89)['then'](handleEntityNotFound(_0xa480ba,null))[_0x73e5('0x2d')](respondWithResult(_0xa480ba,null))[_0x73e5('0x22')](handleError(_0xa480ba,null));};exports[_0x73e5('0x4e')]=function(_0x10bd9c,_0x51ae6e){return db[_0x73e5('0x35')]['create'](_0x10bd9c[_0x73e5('0x4f')],{})[_0x73e5('0x2d')](respondWithResult(_0x51ae6e,0xc9))[_0x73e5('0x22')](handleError(_0x51ae6e,null));};exports[_0x73e5('0x2c')]=function(_0x2b8b51,_0x13c432){if(_0x2b8b51[_0x73e5('0x4f')]['id']){delete _0x2b8b51[_0x73e5('0x4f')]['id'];}return db[_0x73e5('0x35')][_0x73e5('0x4d')]({'where':{'id':_0x2b8b51[_0x73e5('0x4c')]['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x13c432,null))[_0x73e5('0x2d')](saveUpdates(_0x2b8b51[_0x73e5('0x4f')],null))[_0x73e5('0x2d')](respondWithResult(_0x13c432,null))[_0x73e5('0x22')](handleError(_0x13c432,null));};exports['destroy']=function(_0x3df058,_0x57c21d){return db[_0x73e5('0x35')][_0x73e5('0x4d')]({'where':{'id':_0x3df058[_0x73e5('0x4c')]['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x57c21d,null))[_0x73e5('0x2d')](removeEntity(_0x57c21d,null))[_0x73e5('0x22')](handleError(_0x57c21d,null));};exports[_0x73e5('0x50')]=function(_0x20b47c,_0x138aa4,_0x1c6d8a){var _0x1fe686={};var _0x303932={};var _0x27a12c;var _0x257738;return db[_0x73e5('0x35')]['findOne']({'where':{'id':_0x20b47c['params']['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x138aa4,null))[_0x73e5('0x2d')](function(_0x1a5752){if(_0x1a5752){_0x27a12c=_0x1a5752;_0x303932['model']=_['keys'](db[_0x73e5('0x51')]['rawAttributes']);_0x303932[_0x73e5('0x39')]=_[_0x73e5('0x3a')](_0x20b47c[_0x73e5('0x39')]);_0x303932[_0x73e5('0x3b')]=_['intersection'](_0x303932[_0x73e5('0x3e')],_0x303932[_0x73e5('0x39')]);_0x1fe686[_0x73e5('0x3d')]=_['intersection'](_0x303932['model'],qs[_0x73e5('0x3f')](_0x20b47c[_0x73e5('0x39')]['fields']));_0x1fe686[_0x73e5('0x3d')]=_0x1fe686[_0x73e5('0x3d')][_0x73e5('0x40')]?_0x1fe686[_0x73e5('0x3d')]:_0x303932[_0x73e5('0x3e')];_0x1fe686[_0x73e5('0x42')]=qs[_0x73e5('0x43')](_0x20b47c[_0x73e5('0x39')][_0x73e5('0x43')]);_0x1fe686[_0x73e5('0x44')]=qs[_0x73e5('0x3b')](_[_0x73e5('0x45')](_0x20b47c['query'],_0x303932[_0x73e5('0x3b')]));if(_0x20b47c[_0x73e5('0x39')][_0x73e5('0x46')]){_0x1fe686[_0x73e5('0x44')]=_['merge'](_0x1fe686[_0x73e5('0x44')],{'$or':_[_0x73e5('0x34')](_0x1fe686[_0x73e5('0x3d')],function(_0x1f7d14){var _0x15cc3f={};_0x15cc3f[_0x1f7d14]={'$like':'%'+_0x20b47c[_0x73e5('0x39')][_0x73e5('0x46')]+'%'};return _0x15cc3f;})});}_0x1fe686=_['merge']({},_0x1fe686,_0x20b47c['options']);return _0x27a12c[_0x73e5('0x50')](_0x1fe686);}})[_0x73e5('0x2d')](function(_0x2fcd35){if(_0x2fcd35){_0x257738=_0x2fcd35[_0x73e5('0x40')];if(!_0x20b47c[_0x73e5('0x39')]['hasOwnProperty'](_0x73e5('0x41'))){_0x1fe686[_0x73e5('0x27')]=qs[_0x73e5('0x27')](_0x20b47c[_0x73e5('0x39')][_0x73e5('0x27')]);_0x1fe686['offset']=qs[_0x73e5('0x26')](_0x20b47c['query'][_0x73e5('0x26')]);}return _0x27a12c[_0x73e5('0x50')](_0x1fe686);}})[_0x73e5('0x2d')](function(_0xb31d90){if(_0xb31d90){return _0xb31d90?{'count':_0x257738,'rows':_0xb31d90}:null;}})[_0x73e5('0x2d')](respondWithResult(_0x138aa4,null))[_0x73e5('0x22')](handleError(_0x138aa4,null));};exports[_0x73e5('0x52')]=function(_0x2bc57b,_0x1a2caf,_0x379f54){var _0x2f7559={};var _0x59ab91={};var _0x21590e;var _0x3b140a;return db[_0x73e5('0x35')]['findOne']({'where':{'id':_0x2bc57b['params']['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x1a2caf,null))[_0x73e5('0x2d')](function(_0x1370fa){if(_0x1370fa){_0x21590e=_0x1370fa;_0x59ab91['model']=_['keys'](db[_0x73e5('0x51')][_0x73e5('0x36')]);_0x59ab91[_0x73e5('0x39')]=_[_0x73e5('0x3a')](_0x2bc57b[_0x73e5('0x39')]);_0x59ab91[_0x73e5('0x3b')]=_[_0x73e5('0x3c')](_0x59ab91[_0x73e5('0x3e')],_0x59ab91[_0x73e5('0x39')]);_0x2f7559['attributes']=_['intersection'](_0x59ab91['model'],qs[_0x73e5('0x3f')](_0x2bc57b[_0x73e5('0x39')]['fields']));_0x2f7559[_0x73e5('0x3d')]=_0x2f7559[_0x73e5('0x3d')][_0x73e5('0x40')]?_0x2f7559[_0x73e5('0x3d')]:_0x59ab91['model'];_0x2f7559[_0x73e5('0x42')]=qs[_0x73e5('0x43')](_0x2bc57b[_0x73e5('0x39')][_0x73e5('0x43')]);_0x2f7559[_0x73e5('0x44')]=qs['filters'](_[_0x73e5('0x45')](_0x2bc57b[_0x73e5('0x39')],_0x59ab91[_0x73e5('0x3b')]));if(_0x2bc57b[_0x73e5('0x39')]['filter']){_0x2f7559[_0x73e5('0x44')]=_[_0x73e5('0x47')](_0x2f7559['where'],{'$or':_[_0x73e5('0x34')](_0x2f7559[_0x73e5('0x3d')],function(_0x2ae1f1){var _0x278998={};_0x278998[_0x2ae1f1]={'$like':'%'+_0x2bc57b[_0x73e5('0x39')][_0x73e5('0x46')]+'%'};return _0x278998;})});}_0x2f7559=_[_0x73e5('0x47')]({},_0x2f7559,_0x2bc57b[_0x73e5('0x48')]);return _0x21590e[_0x73e5('0x52')](_0x2f7559);}})['then'](function(_0x59bfbc){if(_0x59bfbc){_0x3b140a=_0x59bfbc['length'];if(!_0x2bc57b[_0x73e5('0x39')][_0x73e5('0x53')](_0x73e5('0x41'))){_0x2f7559[_0x73e5('0x27')]=qs[_0x73e5('0x27')](_0x2bc57b[_0x73e5('0x39')][_0x73e5('0x27')]);_0x2f7559[_0x73e5('0x26')]=qs['offset'](_0x2bc57b['query'][_0x73e5('0x26')]);}return _0x21590e['getSubjects'](_0x2f7559);}})['then'](function(_0xf7e10a){if(_0xf7e10a){return _0xf7e10a?{'count':_0x3b140a,'rows':_0xf7e10a}:null;}})[_0x73e5('0x2d')](respondWithResult(_0x1a2caf,null))['catch'](handleError(_0x1a2caf,null));};exports['getDescriptions']=function(_0x58616e,_0x495dc6,_0xb985fd){var _0x535bf0={};var _0x42e47d={};var _0x3de5bd;var _0x275f6d;return db[_0x73e5('0x35')][_0x73e5('0x54')]({'where':{'id':_0x58616e['params']['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x495dc6,null))[_0x73e5('0x2d')](function(_0x17cd03){if(_0x17cd03){_0x3de5bd=_0x17cd03;_0x42e47d['model']=_[_0x73e5('0x3a')](db[_0x73e5('0x51')][_0x73e5('0x36')]);_0x42e47d[_0x73e5('0x39')]=_[_0x73e5('0x3a')](_0x58616e[_0x73e5('0x39')]);_0x42e47d[_0x73e5('0x3b')]=_[_0x73e5('0x3c')](_0x42e47d[_0x73e5('0x3e')],_0x42e47d[_0x73e5('0x39')]);_0x535bf0[_0x73e5('0x3d')]=_[_0x73e5('0x3c')](_0x42e47d[_0x73e5('0x3e')],qs['fields'](_0x58616e[_0x73e5('0x39')][_0x73e5('0x3f')]));_0x535bf0[_0x73e5('0x3d')]=_0x535bf0['attributes'][_0x73e5('0x40')]?_0x535bf0[_0x73e5('0x3d')]:_0x42e47d[_0x73e5('0x3e')];_0x535bf0[_0x73e5('0x42')]=qs['sort'](_0x58616e[_0x73e5('0x39')][_0x73e5('0x43')]);_0x535bf0[_0x73e5('0x44')]=qs[_0x73e5('0x3b')](_[_0x73e5('0x45')](_0x58616e[_0x73e5('0x39')],_0x42e47d[_0x73e5('0x3b')]));if(_0x58616e[_0x73e5('0x39')][_0x73e5('0x46')]){_0x535bf0[_0x73e5('0x44')]=_['merge'](_0x535bf0[_0x73e5('0x44')],{'$or':_[_0x73e5('0x34')](_0x535bf0[_0x73e5('0x3d')],function(_0x3e24bf){var _0x1fc1af={};_0x1fc1af[_0x3e24bf]={'$like':'%'+_0x58616e[_0x73e5('0x39')][_0x73e5('0x46')]+'%'};return _0x1fc1af;})});}_0x535bf0=_['merge']({},_0x535bf0,_0x58616e[_0x73e5('0x48')]);return _0x3de5bd[_0x73e5('0x55')](_0x535bf0);}})[_0x73e5('0x2d')](function(_0x1e527e){if(_0x1e527e){_0x275f6d=_0x1e527e[_0x73e5('0x40')];if(!_0x58616e[_0x73e5('0x39')][_0x73e5('0x53')](_0x73e5('0x41'))){_0x535bf0[_0x73e5('0x27')]=qs[_0x73e5('0x27')](_0x58616e[_0x73e5('0x39')][_0x73e5('0x27')]);_0x535bf0[_0x73e5('0x26')]=qs['offset'](_0x58616e[_0x73e5('0x39')]['offset']);}return _0x3de5bd['getDescriptions'](_0x535bf0);}})[_0x73e5('0x2d')](function(_0x206f12){if(_0x206f12){return _0x206f12?{'count':_0x275f6d,'rows':_0x206f12}:null;}})[_0x73e5('0x2d')](respondWithResult(_0x495dc6,null))[_0x73e5('0x22')](handleError(_0x495dc6,null));};exports[_0x73e5('0x56')]=function(_0x54a1df,_0x3d3836,_0x42ba32){var _0x457ec2={};var _0x5d90ee={};var _0x4a5a48;var _0x37beb7;return db[_0x73e5('0x35')]['findOne']({'where':{'id':_0x54a1df[_0x73e5('0x4c')]['id']}})[_0x73e5('0x2d')](handleEntityNotFound(_0x3d3836,null))[_0x73e5('0x2d')](function(_0x509645){if(_0x509645){_0x4a5a48=_0x509645;_0x5d90ee[_0x73e5('0x3e')]=_[_0x73e5('0x3a')](db[_0x73e5('0x57')][_0x73e5('0x36')]);_0x5d90ee['query']=_[_0x73e5('0x3a')](_0x54a1df['query']);_0x5d90ee['filters']=_[_0x73e5('0x3c')](_0x5d90ee[_0x73e5('0x3e')],_0x5d90ee['query']);_0x457ec2[_0x73e5('0x3d')]=_['intersection'](_0x5d90ee[_0x73e5('0x3e')],qs[_0x73e5('0x3f')](_0x54a1df['query'][_0x73e5('0x3f')]));_0x457ec2[_0x73e5('0x3d')]=_0x457ec2['attributes'][_0x73e5('0x40')]?_0x457ec2[_0x73e5('0x3d')]:_0x5d90ee[_0x73e5('0x3e')];_0x457ec2[_0x73e5('0x42')]=qs[_0x73e5('0x43')](_0x54a1df['query'][_0x73e5('0x43')]);_0x457ec2[_0x73e5('0x44')]=qs[_0x73e5('0x3b')](_[_0x73e5('0x45')](_0x54a1df[_0x73e5('0x39')],_0x5d90ee[_0x73e5('0x3b')]));if(_0x54a1df[_0x73e5('0x39')][_0x73e5('0x46')]){_0x457ec2[_0x73e5('0x44')]=_[_0x73e5('0x47')](_0x457ec2[_0x73e5('0x44')],{'$or':_['map'](_0x457ec2[_0x73e5('0x3d')],function(_0x48b6fb){var _0x25dce6={};_0x25dce6[_0x48b6fb]={'$like':'%'+_0x54a1df[_0x73e5('0x39')][_0x73e5('0x46')]+'%'};return _0x25dce6;})});}_0x457ec2=_['merge']({},_0x457ec2,_0x54a1df[_0x73e5('0x48')]);return _0x4a5a48[_0x73e5('0x56')](_0x457ec2);}})[_0x73e5('0x2d')](function(_0x12dc84){if(_0x12dc84){_0x37beb7=_0x12dc84['length'];if(!_0x54a1df[_0x73e5('0x39')][_0x73e5('0x53')]('nolimit')){_0x457ec2['limit']=qs[_0x73e5('0x27')](_0x54a1df[_0x73e5('0x39')][_0x73e5('0x27')]);_0x457ec2[_0x73e5('0x26')]=qs[_0x73e5('0x26')](_0x54a1df['query']['offset']);}return _0x4a5a48[_0x73e5('0x56')](_0x457ec2);}})['then'](function(_0x436896){if(_0x436896){return _0x436896?{'count':_0x37beb7,'rows':_0x436896}:null;}})[_0x73e5('0x2d')](respondWithResult(_0x3d3836,null))['catch'](handleError(_0x3d3836,null));};exports[_0x73e5('0x58')]=function(_0x57962f,_0x142e19,_0x1ec9b6){if(_0x57962f[_0x73e5('0x4f')]['id']){delete _0x57962f[_0x73e5('0x4f')]['id'];}return db['FreshdeskConfiguration'][_0x73e5('0x54')]({'where':{'id':_0x57962f[_0x73e5('0x4c')]['id']}})['then'](handleEntityNotFound(_0x142e19,null))[_0x73e5('0x2d')](function(_0x3201b5){if(_0x3201b5){return _0x3201b5[_0x73e5('0x58')](_0x57962f['body'][_0x73e5('0x59')]||[]);}return null;})['then'](respondWithResult(_0x142e19,null))['catch'](handleError(_0x142e19,null));}; \ No newline at end of file +var _0x843e=['getDescriptions','hasOwnProperty','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','save','update','destroy','stack','name','index','map','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','rows','show','params','length','find','create','body','findOne','FreshdeskField','getFields','getSubjects'];(function(_0x1cb18a,_0x33167a){var _0x22442e=function(_0x46c611){while(--_0x46c611){_0x1cb18a['push'](_0x1cb18a['shift']());}};_0x22442e(++_0x33167a);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xe843('0x0'));var emlformat=require(_0xe843('0x1'));var rimraf=require(_0xe843('0x2'));var zipdir=require(_0xe843('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe843('0x4'));var moment=require(_0xe843('0x5'));var BPromise=require(_0xe843('0x6'));var Mustache=require(_0xe843('0x7'));var util=require(_0xe843('0x8'));var path=require(_0xe843('0x9'));var sox=require(_0xe843('0xa'));var csv=require('to-csv');var ejs=require(_0xe843('0xb'));var fs=require('fs');var _=require(_0xe843('0xc'));var squel=require('squel');var crypto=require(_0xe843('0xd'));var jsforce=require(_0xe843('0xe'));var deskjs=require(_0xe843('0xf'));var toCsv=require(_0xe843('0x10'));var querystring=require(_0xe843('0x11'));var Papa=require(_0xe843('0x12'));var Redis=require(_0xe843('0x13'));var authService=require(_0xe843('0x14'));var qs=require(_0xe843('0x15'));var as=require(_0xe843('0x16'));var hardwareService=require(_0xe843('0x17'));var logger=require(_0xe843('0x18'))(_0xe843('0x19'));var utils=require(_0xe843('0x1a'));var config=require(_0xe843('0x1b'));var db=require(_0xe843('0x1c'))['db'];var jayson=require(_0xe843('0x1d'));var client=jayson[_0xe843('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x2b1802,_0x376bf8,_0xa3ce80){if(_0xa3ce80){var _0x264200=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x264200['test'](_0x376bf8)){return _0x2b1802;}else{throw new db[(_0xe843('0x1f'))][(_0xe843('0x20'))](_0xe843('0x21'));}}else{return _0x2b1802;}}function respondWithRpcPromise(_0x519ade,_0x447eee,_0x5cab8c,_0x5c6f63){return new BPromise(function(_0x13b19d,_0x411c56){var _0x3b6b8f=_0x5c6f63||client;return _0x3b6b8f[_0xe843('0x22')](_0x519ade,_0x5cab8c)[_0xe843('0x23')](function(_0x295226){logger[_0xe843('0x24')](_0xe843('0x25'),_0x447eee,_0xe843('0x26'));logger['debug']('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x447eee,'request\x20sent',JSON[_0xe843('0x27')](_0x295226));if(_0x295226['error']){if(_0x295226[_0xe843('0x28')][_0xe843('0x29')]===0x1f4){logger['error'](_0xe843('0x25'),_0x447eee,_0x295226[_0xe843('0x28')][_0xe843('0x2a')]);return _0x411c56(_0x295226[_0xe843('0x28')][_0xe843('0x2a')]);}logger[_0xe843('0x28')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x447eee,_0x295226[_0xe843('0x28')][_0xe843('0x2a')]);return _0x13b19d(_0x295226[_0xe843('0x28')][_0xe843('0x2a')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x447eee,'request\x20sent');_0x13b19d(_0x295226[_0xe843('0x2b')][_0xe843('0x2a')]);}})[_0xe843('0x2c')](function(_0x15da80){logger[_0xe843('0x28')](_0xe843('0x25'),_0x447eee,_0x15da80);_0x411c56(_0x15da80);});});}function respondWithStatusCode(_0xc3f14c,_0x29ebbd){_0x29ebbd=_0x29ebbd||0xcc;return function(_0x24faee){if(_0x24faee){return _0xc3f14c[_0xe843('0x2d')](_0x29ebbd);}return _0xc3f14c[_0xe843('0x2e')](_0x29ebbd)[_0xe843('0x2f')]();};}function respondWithResult(_0x4dc83b,_0x18609d){_0x18609d=_0x18609d||0xc8;return function(_0x1bc911){if(_0x1bc911){return _0x4dc83b['status'](_0x18609d)['json'](_0x1bc911);}};}function respondWithFilteredResult(_0x2da60d,_0x2c643e){return function(_0x55f02a){if(_0x55f02a){var _0x24f049=_0x55f02a[_0xe843('0x30')],_0x13f0f8=_0x2c643e[_0xe843('0x31')],_0x5f511b=_0x2c643e['offset']+_0x2c643e[_0xe843('0x32')],_0x103eab;if(_0x5f511b>=_0x24f049){_0x5f511b=_0x24f049;_0x103eab=0xc8;}else{_0x103eab=0xce;}_0x2da60d[_0xe843('0x2e')](_0x103eab);return _0x2da60d[_0xe843('0x33')](_0xe843('0x34'),_0x13f0f8+'-'+_0x5f511b+'/'+_0x24f049)[_0xe843('0x35')](_0x55f02a);}return null;};}function patchUpdates(_0x1c91b3){return function(_0xe6fbf){try{jsonpatch['apply'](_0xe6fbf,_0x1c91b3,!![]);}catch(_0x4c63e8){return BPromise['reject'](_0x4c63e8);}return _0xe6fbf[_0xe843('0x36')]();};}function saveUpdates(_0x5a6c7b,_0x682881){return function(_0x3cb064){if(_0x3cb064){return _0x3cb064[_0xe843('0x37')](_0x5a6c7b)['then'](function(_0x10ac8e){return _0x10ac8e;});}return null;};}function removeEntity(_0x14118c,_0x37d60a){return function(_0x222429){if(_0x222429){return _0x222429[_0xe843('0x38')]()[_0xe843('0x23')](function(){_0x14118c[_0xe843('0x2e')](0xcc)[_0xe843('0x2f')]();});}};}function handleEntityNotFound(_0x1fc424,_0x4b8b55){return function(_0x5b581d){if(!_0x5b581d){_0x1fc424[_0xe843('0x2d')](0x194);}return _0x5b581d;};}function handleError(_0x2eff2,_0x3877a5){_0x3877a5=_0x3877a5||0x1f4;return function(_0x15dd73){logger[_0xe843('0x28')](_0x15dd73[_0xe843('0x39')]);if(_0x15dd73['name']){delete _0x15dd73[_0xe843('0x3a')];}_0x2eff2['status'](_0x3877a5)['send'](_0x15dd73);};}exports[_0xe843('0x3b')]=function(_0x128f7d,_0x220c31){var _0xbaa449={},_0x204205={},_0x193253={'count':0x0,'rows':[]};var _0x2d855c=_[_0xe843('0x3c')](db[_0xe843('0x3d')][_0xe843('0x3e')],function(_0x4262cf){return{'name':_0x4262cf[_0xe843('0x3f')],'type':_0x4262cf[_0xe843('0x40')][_0xe843('0x41')]};});_0x204205[_0xe843('0x42')]=_[_0xe843('0x3c')](_0x2d855c,'name');_0x204205[_0xe843('0x43')]=_[_0xe843('0x44')](_0x128f7d['query']);_0x204205[_0xe843('0x45')]=_['intersection'](_0x204205['model'],_0x204205['query']);_0xbaa449[_0xe843('0x46')]=_[_0xe843('0x47')](_0x204205[_0xe843('0x42')],qs['fields'](_0x128f7d[_0xe843('0x43')][_0xe843('0x48')]));_0xbaa449[_0xe843('0x46')]=_0xbaa449['attributes']['length']?_0xbaa449['attributes']:_0x204205[_0xe843('0x42')];if(!_0x128f7d[_0xe843('0x43')]['hasOwnProperty'](_0xe843('0x49'))){_0xbaa449[_0xe843('0x32')]=qs[_0xe843('0x32')](_0x128f7d['query'][_0xe843('0x32')]);_0xbaa449[_0xe843('0x31')]=qs[_0xe843('0x31')](_0x128f7d[_0xe843('0x43')][_0xe843('0x31')]);}_0xbaa449[_0xe843('0x4a')]=qs['sort'](_0x128f7d[_0xe843('0x43')][_0xe843('0x4b')]);_0xbaa449['where']=qs[_0xe843('0x45')](_[_0xe843('0x4c')](_0x128f7d['query'],_0x204205[_0xe843('0x45')]));if(_0x128f7d[_0xe843('0x43')]['filter']){_0xbaa449[_0xe843('0x4d')]=_[_0xe843('0x4e')](_0xbaa449[_0xe843('0x4d')],{'$or':_[_0xe843('0x3c')](_0x2d855c,function(_0x12bdd6){if(_0x12bdd6[_0xe843('0x40')]!==_0xe843('0x4f')){var _0x174bb7={};_0x174bb7[_0x12bdd6['name']]={'$like':'%'+_0x128f7d[_0xe843('0x43')][_0xe843('0x50')]+'%'};return _0x174bb7;}})});}_0xbaa449=_[_0xe843('0x4e')]({},_0xbaa449,_0x128f7d[_0xe843('0x51')]);var _0xed3327={'where':_0xbaa449[_0xe843('0x4d')]};return db[_0xe843('0x3d')][_0xe843('0x30')](_0xed3327)['then'](function(_0x3f375b){_0x193253[_0xe843('0x30')]=_0x3f375b;if(_0x128f7d[_0xe843('0x43')]['includeAll']){_0xbaa449[_0xe843('0x52')]=[{'all':!![]}];}return db['FreshdeskConfiguration'][_0xe843('0x53')](_0xbaa449);})[_0xe843('0x23')](function(_0x4a8598){_0x193253[_0xe843('0x54')]=_0x4a8598;return _0x193253;})[_0xe843('0x23')](respondWithFilteredResult(_0x220c31,_0xbaa449))['catch'](handleError(_0x220c31,null));};exports[_0xe843('0x55')]=function(_0x449624,_0x4f1684){var _0x2dd5ba={'raw':![],'where':{'id':_0x449624[_0xe843('0x56')]['id']}},_0xbf57a1={};_0xbf57a1[_0xe843('0x42')]=_[_0xe843('0x44')](db[_0xe843('0x3d')]['rawAttributes']);_0xbf57a1[_0xe843('0x43')]=_[_0xe843('0x44')](_0x449624[_0xe843('0x43')]);_0xbf57a1[_0xe843('0x45')]=_['intersection'](_0xbf57a1[_0xe843('0x42')],_0xbf57a1[_0xe843('0x43')]);_0x2dd5ba[_0xe843('0x46')]=_[_0xe843('0x47')](_0xbf57a1[_0xe843('0x42')],qs[_0xe843('0x48')](_0x449624['query'][_0xe843('0x48')]));_0x2dd5ba[_0xe843('0x46')]=_0x2dd5ba[_0xe843('0x46')][_0xe843('0x57')]?_0x2dd5ba['attributes']:_0xbf57a1[_0xe843('0x42')];if(_0x449624['query']['includeAll']){_0x2dd5ba[_0xe843('0x52')]=[{'all':!![]}];}_0x2dd5ba=_[_0xe843('0x4e')]({},_0x2dd5ba,_0x449624[_0xe843('0x51')]);return db[_0xe843('0x3d')][_0xe843('0x58')](_0x2dd5ba)[_0xe843('0x23')](handleEntityNotFound(_0x4f1684,null))['then'](respondWithResult(_0x4f1684,null))[_0xe843('0x2c')](handleError(_0x4f1684,null));};exports[_0xe843('0x59')]=function(_0x16e710,_0x545b5a){return db[_0xe843('0x3d')][_0xe843('0x59')](_0x16e710['body'],{})[_0xe843('0x23')](respondWithResult(_0x545b5a,0xc9))[_0xe843('0x2c')](handleError(_0x545b5a,null));};exports[_0xe843('0x37')]=function(_0x25e7e1,_0x367b4e){if(_0x25e7e1[_0xe843('0x5a')]['id']){delete _0x25e7e1[_0xe843('0x5a')]['id'];}return db[_0xe843('0x3d')][_0xe843('0x58')]({'where':{'id':_0x25e7e1[_0xe843('0x56')]['id']}})['then'](handleEntityNotFound(_0x367b4e,null))[_0xe843('0x23')](saveUpdates(_0x25e7e1['body'],null))['then'](respondWithResult(_0x367b4e,null))[_0xe843('0x2c')](handleError(_0x367b4e,null));};exports[_0xe843('0x38')]=function(_0x5eb9d6,_0x352e27){return db[_0xe843('0x3d')][_0xe843('0x58')]({'where':{'id':_0x5eb9d6[_0xe843('0x56')]['id']}})[_0xe843('0x23')](handleEntityNotFound(_0x352e27,null))[_0xe843('0x23')](removeEntity(_0x352e27,null))['catch'](handleError(_0x352e27,null));};exports['getFields']=function(_0xed35a6,_0x230dec,_0x533110){var _0x4ef46f={};var _0x1c0c48={};var _0xaa71bb;var _0x38d725;return db['FreshdeskConfiguration'][_0xe843('0x5b')]({'where':{'id':_0xed35a6[_0xe843('0x56')]['id']}})[_0xe843('0x23')](handleEntityNotFound(_0x230dec,null))['then'](function(_0x1dfaaf){if(_0x1dfaaf){_0xaa71bb=_0x1dfaaf;_0x1c0c48[_0xe843('0x42')]=_[_0xe843('0x44')](db[_0xe843('0x5c')][_0xe843('0x3e')]);_0x1c0c48[_0xe843('0x43')]=_[_0xe843('0x44')](_0xed35a6['query']);_0x1c0c48[_0xe843('0x45')]=_[_0xe843('0x47')](_0x1c0c48[_0xe843('0x42')],_0x1c0c48[_0xe843('0x43')]);_0x4ef46f[_0xe843('0x46')]=_[_0xe843('0x47')](_0x1c0c48[_0xe843('0x42')],qs[_0xe843('0x48')](_0xed35a6[_0xe843('0x43')][_0xe843('0x48')]));_0x4ef46f['attributes']=_0x4ef46f[_0xe843('0x46')][_0xe843('0x57')]?_0x4ef46f['attributes']:_0x1c0c48[_0xe843('0x42')];_0x4ef46f[_0xe843('0x4a')]=qs['sort'](_0xed35a6['query'][_0xe843('0x4b')]);_0x4ef46f['where']=qs['filters'](_[_0xe843('0x4c')](_0xed35a6['query'],_0x1c0c48[_0xe843('0x45')]));if(_0xed35a6[_0xe843('0x43')][_0xe843('0x50')]){_0x4ef46f[_0xe843('0x4d')]=_['merge'](_0x4ef46f['where'],{'$or':_[_0xe843('0x3c')](_0x4ef46f[_0xe843('0x46')],function(_0x1383e7){var _0x4100f9={};_0x4100f9[_0x1383e7]={'$like':'%'+_0xed35a6[_0xe843('0x43')][_0xe843('0x50')]+'%'};return _0x4100f9;})});}_0x4ef46f=_[_0xe843('0x4e')]({},_0x4ef46f,_0xed35a6['options']);return _0xaa71bb[_0xe843('0x5d')](_0x4ef46f);}})['then'](function(_0x555f05){if(_0x555f05){_0x38d725=_0x555f05[_0xe843('0x57')];if(!_0xed35a6[_0xe843('0x43')]['hasOwnProperty'](_0xe843('0x49'))){_0x4ef46f['limit']=qs[_0xe843('0x32')](_0xed35a6[_0xe843('0x43')]['limit']);_0x4ef46f[_0xe843('0x31')]=qs[_0xe843('0x31')](_0xed35a6[_0xe843('0x43')][_0xe843('0x31')]);}return _0xaa71bb[_0xe843('0x5d')](_0x4ef46f);}})[_0xe843('0x23')](function(_0x54870e){if(_0x54870e){return _0x54870e?{'count':_0x38d725,'rows':_0x54870e}:null;}})[_0xe843('0x23')](respondWithResult(_0x230dec,null))[_0xe843('0x2c')](handleError(_0x230dec,null));};exports[_0xe843('0x5e')]=function(_0x5d4608,_0x2f7d96,_0x2aaefd){var _0x4605c0={};var _0x1d5d42={};var _0x5ba0dd;var _0x28ffd5;return db[_0xe843('0x3d')][_0xe843('0x5b')]({'where':{'id':_0x5d4608[_0xe843('0x56')]['id']}})[_0xe843('0x23')](handleEntityNotFound(_0x2f7d96,null))[_0xe843('0x23')](function(_0x4aa6ac){if(_0x4aa6ac){_0x5ba0dd=_0x4aa6ac;_0x1d5d42['model']=_[_0xe843('0x44')](db[_0xe843('0x5c')]['rawAttributes']);_0x1d5d42[_0xe843('0x43')]=_[_0xe843('0x44')](_0x5d4608['query']);_0x1d5d42[_0xe843('0x45')]=_[_0xe843('0x47')](_0x1d5d42['model'],_0x1d5d42['query']);_0x4605c0[_0xe843('0x46')]=_['intersection'](_0x1d5d42[_0xe843('0x42')],qs[_0xe843('0x48')](_0x5d4608[_0xe843('0x43')][_0xe843('0x48')]));_0x4605c0[_0xe843('0x46')]=_0x4605c0[_0xe843('0x46')][_0xe843('0x57')]?_0x4605c0['attributes']:_0x1d5d42[_0xe843('0x42')];_0x4605c0[_0xe843('0x4a')]=qs[_0xe843('0x4b')](_0x5d4608[_0xe843('0x43')][_0xe843('0x4b')]);_0x4605c0['where']=qs['filters'](_[_0xe843('0x4c')](_0x5d4608[_0xe843('0x43')],_0x1d5d42[_0xe843('0x45')]));if(_0x5d4608[_0xe843('0x43')][_0xe843('0x50')]){_0x4605c0['where']=_['merge'](_0x4605c0['where'],{'$or':_[_0xe843('0x3c')](_0x4605c0[_0xe843('0x46')],function(_0x19d2cf){var _0x326e80={};_0x326e80[_0x19d2cf]={'$like':'%'+_0x5d4608[_0xe843('0x43')]['filter']+'%'};return _0x326e80;})});}_0x4605c0=_[_0xe843('0x4e')]({},_0x4605c0,_0x5d4608['options']);return _0x5ba0dd[_0xe843('0x5e')](_0x4605c0);}})[_0xe843('0x23')](function(_0x5117f8){if(_0x5117f8){_0x28ffd5=_0x5117f8[_0xe843('0x57')];if(!_0x5d4608['query']['hasOwnProperty'](_0xe843('0x49'))){_0x4605c0[_0xe843('0x32')]=qs[_0xe843('0x32')](_0x5d4608[_0xe843('0x43')][_0xe843('0x32')]);_0x4605c0[_0xe843('0x31')]=qs[_0xe843('0x31')](_0x5d4608[_0xe843('0x43')][_0xe843('0x31')]);}return _0x5ba0dd[_0xe843('0x5e')](_0x4605c0);}})[_0xe843('0x23')](function(_0x2980be){if(_0x2980be){return _0x2980be?{'count':_0x28ffd5,'rows':_0x2980be}:null;}})[_0xe843('0x23')](respondWithResult(_0x2f7d96,null))[_0xe843('0x2c')](handleError(_0x2f7d96,null));};exports[_0xe843('0x5f')]=function(_0x3ff9fa,_0x22b04f,_0x1d8a58){var _0x212dd5={};var _0x31d0be={};var _0x477f33;var _0x12a4d7;return db[_0xe843('0x3d')][_0xe843('0x5b')]({'where':{'id':_0x3ff9fa[_0xe843('0x56')]['id']}})['then'](handleEntityNotFound(_0x22b04f,null))[_0xe843('0x23')](function(_0x1c780f){if(_0x1c780f){_0x477f33=_0x1c780f;_0x31d0be[_0xe843('0x42')]=_[_0xe843('0x44')](db[_0xe843('0x5c')]['rawAttributes']);_0x31d0be[_0xe843('0x43')]=_[_0xe843('0x44')](_0x3ff9fa[_0xe843('0x43')]);_0x31d0be['filters']=_[_0xe843('0x47')](_0x31d0be[_0xe843('0x42')],_0x31d0be['query']);_0x212dd5[_0xe843('0x46')]=_[_0xe843('0x47')](_0x31d0be['model'],qs[_0xe843('0x48')](_0x3ff9fa[_0xe843('0x43')]['fields']));_0x212dd5[_0xe843('0x46')]=_0x212dd5[_0xe843('0x46')][_0xe843('0x57')]?_0x212dd5[_0xe843('0x46')]:_0x31d0be[_0xe843('0x42')];_0x212dd5[_0xe843('0x4a')]=qs[_0xe843('0x4b')](_0x3ff9fa[_0xe843('0x43')][_0xe843('0x4b')]);_0x212dd5[_0xe843('0x4d')]=qs[_0xe843('0x45')](_[_0xe843('0x4c')](_0x3ff9fa[_0xe843('0x43')],_0x31d0be[_0xe843('0x45')]));if(_0x3ff9fa[_0xe843('0x43')][_0xe843('0x50')]){_0x212dd5[_0xe843('0x4d')]=_['merge'](_0x212dd5[_0xe843('0x4d')],{'$or':_[_0xe843('0x3c')](_0x212dd5['attributes'],function(_0x6825a7){var _0x5e668b={};_0x5e668b[_0x6825a7]={'$like':'%'+_0x3ff9fa[_0xe843('0x43')][_0xe843('0x50')]+'%'};return _0x5e668b;})});}_0x212dd5=_[_0xe843('0x4e')]({},_0x212dd5,_0x3ff9fa[_0xe843('0x51')]);return _0x477f33['getDescriptions'](_0x212dd5);}})[_0xe843('0x23')](function(_0x571373){if(_0x571373){_0x12a4d7=_0x571373[_0xe843('0x57')];if(!_0x3ff9fa[_0xe843('0x43')][_0xe843('0x60')](_0xe843('0x49'))){_0x212dd5[_0xe843('0x32')]=qs[_0xe843('0x32')](_0x3ff9fa[_0xe843('0x43')][_0xe843('0x32')]);_0x212dd5[_0xe843('0x31')]=qs['offset'](_0x3ff9fa[_0xe843('0x43')][_0xe843('0x31')]);}return _0x477f33[_0xe843('0x5f')](_0x212dd5);}})['then'](function(_0x5486b2){if(_0x5486b2){return _0x5486b2?{'count':_0x12a4d7,'rows':_0x5486b2}:null;}})['then'](respondWithResult(_0x22b04f,null))[_0xe843('0x2c')](handleError(_0x22b04f,null));};exports[_0xe843('0x61')]=function(_0xc86c1d,_0xa9e78a,_0x4412fc){var _0x2f2b5a={};var _0x59c259={};var _0x237d04;var _0x308198;return db[_0xe843('0x3d')][_0xe843('0x5b')]({'where':{'id':_0xc86c1d[_0xe843('0x56')]['id']}})[_0xe843('0x23')](handleEntityNotFound(_0xa9e78a,null))['then'](function(_0x5c01d2){if(_0x5c01d2){_0x237d04=_0x5c01d2;_0x59c259['model']=_[_0xe843('0x44')](db[_0xe843('0x62')][_0xe843('0x3e')]);_0x59c259['query']=_[_0xe843('0x44')](_0xc86c1d['query']);_0x59c259['filters']=_['intersection'](_0x59c259[_0xe843('0x42')],_0x59c259[_0xe843('0x43')]);_0x2f2b5a[_0xe843('0x46')]=_[_0xe843('0x47')](_0x59c259[_0xe843('0x42')],qs[_0xe843('0x48')](_0xc86c1d['query']['fields']));_0x2f2b5a['attributes']=_0x2f2b5a[_0xe843('0x46')][_0xe843('0x57')]?_0x2f2b5a[_0xe843('0x46')]:_0x59c259[_0xe843('0x42')];_0x2f2b5a[_0xe843('0x4a')]=qs[_0xe843('0x4b')](_0xc86c1d[_0xe843('0x43')][_0xe843('0x4b')]);_0x2f2b5a[_0xe843('0x4d')]=qs[_0xe843('0x45')](_[_0xe843('0x4c')](_0xc86c1d['query'],_0x59c259[_0xe843('0x45')]));if(_0xc86c1d[_0xe843('0x43')][_0xe843('0x50')]){_0x2f2b5a['where']=_[_0xe843('0x4e')](_0x2f2b5a[_0xe843('0x4d')],{'$or':_[_0xe843('0x3c')](_0x2f2b5a['attributes'],function(_0x18bd35){var _0x2124ef={};_0x2124ef[_0x18bd35]={'$like':'%'+_0xc86c1d[_0xe843('0x43')][_0xe843('0x50')]+'%'};return _0x2124ef;})});}_0x2f2b5a=_[_0xe843('0x4e')]({},_0x2f2b5a,_0xc86c1d[_0xe843('0x51')]);return _0x237d04[_0xe843('0x61')](_0x2f2b5a);}})[_0xe843('0x23')](function(_0x1748e0){if(_0x1748e0){_0x308198=_0x1748e0[_0xe843('0x57')];if(!_0xc86c1d[_0xe843('0x43')][_0xe843('0x60')](_0xe843('0x49'))){_0x2f2b5a[_0xe843('0x32')]=qs[_0xe843('0x32')](_0xc86c1d[_0xe843('0x43')][_0xe843('0x32')]);_0x2f2b5a['offset']=qs[_0xe843('0x31')](_0xc86c1d[_0xe843('0x43')]['offset']);}return _0x237d04[_0xe843('0x61')](_0x2f2b5a);}})[_0xe843('0x23')](function(_0x27d87){if(_0x27d87){return _0x27d87?{'count':_0x308198,'rows':_0x27d87}:null;}})[_0xe843('0x23')](respondWithResult(_0xa9e78a,null))[_0xe843('0x2c')](handleError(_0xa9e78a,null));};exports[_0xe843('0x63')]=function(_0x4f4e4e,_0x39e3a0,_0x49e258){if(_0x4f4e4e[_0xe843('0x5a')]['id']){delete _0x4f4e4e['body']['id'];}return db[_0xe843('0x3d')][_0xe843('0x5b')]({'where':{'id':_0x4f4e4e[_0xe843('0x56')]['id']}})[_0xe843('0x23')](handleEntityNotFound(_0x39e3a0,null))[_0xe843('0x23')](function(_0x598662){if(_0x598662){return _0x598662[_0xe843('0x63')](_0x4f4e4e[_0xe843('0x5a')]['ids']||[]);}return null;})[_0xe843('0x23')](respondWithResult(_0x39e3a0,null))[_0xe843('0x2c')](handleError(_0x39e3a0,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index c369ac4..0827371 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 _0x1b34=['exports','int_freshdesk_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x32359e,_0x450ddb){var _0x3227f3=function(_0xe3ae5c){while(--_0xe3ae5c){_0x32359e['push'](_0x32359e['shift']());}};_0x3227f3(++_0x450ddb);}(_0x1b34,0x92));var _0x41b3=function(_0x296858,_0x195a1f){_0x296858=_0x296858-0x0;var _0x40cba6=_0x1b34[_0x296858];return _0x40cba6;};'use strict';var _=require(_0x41b3('0x0'));var util=require(_0x41b3('0x1'));var logger=require(_0x41b3('0x2'))(_0x41b3('0x3'));var moment=require(_0x41b3('0x4'));var BPromise=require(_0x41b3('0x5'));var rp=require(_0x41b3('0x6'));var fs=require('fs');var path=require(_0x41b3('0x7'));var rimraf=require(_0x41b3('0x8'));var config=require(_0x41b3('0x9'));var attributes=require('./intFreshdeskConfiguration.attributes');module[_0x41b3('0xa')]=function(_0x43d6da,_0xee2353){return _0x43d6da['define']('FreshdeskConfiguration',attributes,{'tableName':_0x41b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x709c=['moment','request-promise','path','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration','int_freshdesk_configurations','util','../../config/logger','api'];(function(_0x5636a5,_0x2bb5dc){var _0x32c581=function(_0x216caf){while(--_0x216caf){_0x5636a5['push'](_0x5636a5['shift']());}};_0x32c581(++_0x2bb5dc);}(_0x709c,0x101));var _0xc709=function(_0x34e0fa,_0x5a0d1b){_0x34e0fa=_0x34e0fa-0x0;var _0x268baa=_0x709c[_0x34e0fa];return _0x268baa;};'use strict';var _=require('lodash');var util=require(_0xc709('0x0'));var logger=require(_0xc709('0x1'))(_0xc709('0x2'));var moment=require(_0xc709('0x3'));var BPromise=require('bluebird');var rp=require(_0xc709('0x4'));var fs=require('fs');var path=require(_0xc709('0x5'));var rimraf=require(_0xc709('0x6'));var config=require(_0xc709('0x7'));var attributes=require(_0xc709('0x8'));module[_0xc709('0x9')]=function(_0x40e40f,_0x3ec7bc){return _0x40e40f[_0xc709('0xa')](_0xc709('0xb'),attributes,{'tableName':_0xc709('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.rpc.js index 0e74c3e..408de71 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 _0x14a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','http','request','request\x20sent','debug','stringify','error','code','FreshdeskConfiguration,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x1826f7,_0x5c7c64){var _0x3bcebf=function(_0x5f4577){while(--_0x5f4577){_0x1826f7['push'](_0x1826f7['shift']());}};_0x3bcebf(++_0x5c7c64);}(_0x14a3,0x19e));var _0x314a=function(_0x29dda1,_0x508e13){_0x29dda1=_0x29dda1-0x0;var _0x21b0ef=_0x14a3[_0x29dda1];return _0x21b0ef;};'use strict';var _=require(_0x314a('0x0'));var util=require(_0x314a('0x1'));var moment=require(_0x314a('0x2'));var BPromise=require(_0x314a('0x3'));var rs=require(_0x314a('0x4'));var fs=require('fs');var Redis=require(_0x314a('0x5'));var db=require(_0x314a('0x6'))['db'];var utils=require(_0x314a('0x7'));var logger=require(_0x314a('0x8'))(_0x314a('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x314a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3900f6,_0x59546d,_0x73b0b8){return new BPromise(function(_0xcc5bbe,_0x258cab){return client[_0x314a('0xb')](_0x3900f6,_0x73b0b8)['then'](function(_0x3a85df){logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x59546d,_0x314a('0xc'));logger[_0x314a('0xd')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x59546d,'request\x20sent',JSON[_0x314a('0xe')](_0x3a85df));if(_0x3a85df[_0x314a('0xf')]){if(_0x3a85df[_0x314a('0xf')][_0x314a('0x10')]===0x1f4){logger[_0x314a('0xf')](_0x314a('0x11'),_0x59546d,_0x3a85df['error']['message']);return _0x258cab(_0x3a85df[_0x314a('0xf')][_0x314a('0x12')]);}logger['error'](_0x314a('0x11'),_0x59546d,_0x3a85df[_0x314a('0xf')][_0x314a('0x12')]);return _0xcc5bbe(_0x3a85df[_0x314a('0xf')]['message']);}else{logger['info'](_0x314a('0x11'),_0x59546d,_0x314a('0xc'));_0xcc5bbe(_0x3a85df[_0x314a('0x13')][_0x314a('0x12')]);}})[_0x314a('0x14')](function(_0x3bbfc4){logger[_0x314a('0xf')](_0x314a('0x11'),_0x59546d,_0x3bbfc4);_0x258cab(_0x3bbfc4);});});} \ No newline at end of file +var _0x9ed4=['info','FreshdeskConfiguration,\x20%s,\x20%s','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request'];(function(_0xc15a99,_0x47af96){var _0x9d4e28=function(_0x5b24e3){while(--_0x5b24e3){_0xc15a99['push'](_0xc15a99['shift']());}};_0x9d4e28(++_0x47af96);}(_0x9ed4,0xf0));var _0x49ed=function(_0x3ef181,_0x1f0891){_0x3ef181=_0x3ef181-0x0;var _0x2c64f0=_0x9ed4[_0x3ef181];return _0x2c64f0;};'use strict';var _=require(_0x49ed('0x0'));var util=require('util');var moment=require(_0x49ed('0x1'));var BPromise=require(_0x49ed('0x2'));var rs=require(_0x49ed('0x3'));var fs=require('fs');var Redis=require(_0x49ed('0x4'));var db=require(_0x49ed('0x5'))['db'];var utils=require(_0x49ed('0x6'));var logger=require(_0x49ed('0x7'))(_0x49ed('0x8'));var config=require(_0x49ed('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x49ed('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x59104d,_0x278edc,_0x29f934){return new BPromise(function(_0x529ec0,_0xaae966){return client[_0x49ed('0xb')](_0x59104d,_0x29f934)['then'](function(_0x2f31e1){logger[_0x49ed('0xc')](_0x49ed('0xd'),_0x278edc,'request\x20sent');logger[_0x49ed('0xe')](_0x49ed('0xf'),_0x278edc,_0x49ed('0x10'),JSON['stringify'](_0x2f31e1));if(_0x2f31e1[_0x49ed('0x11')]){if(_0x2f31e1[_0x49ed('0x11')][_0x49ed('0x12')]===0x1f4){logger[_0x49ed('0x11')](_0x49ed('0xd'),_0x278edc,_0x2f31e1[_0x49ed('0x11')][_0x49ed('0x13')]);return _0xaae966(_0x2f31e1['error'][_0x49ed('0x13')]);}logger['error'](_0x49ed('0xd'),_0x278edc,_0x2f31e1[_0x49ed('0x11')][_0x49ed('0x13')]);return _0x529ec0(_0x2f31e1[_0x49ed('0x11')][_0x49ed('0x13')]);}else{logger['info'](_0x49ed('0xd'),_0x278edc,_0x49ed('0x10'));_0x529ec0(_0x2f31e1['result'][_0x49ed('0x13')]);}})[_0x49ed('0x14')](function(_0x5d5e0a){logger[_0x49ed('0x11')](_0x49ed('0xd'),_0x278edc,_0x5d5e0a);_0xaae966(_0x5d5e0a);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 62d078f..e2a1c82 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 _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x5ebc04,_0x14a363){var _0x17845c=function(_0x360850){while(--_0x360850){_0x5ebc04['push'](_0x5ebc04['shift']());}};_0x17845c(++_0x14a363);}(_0x34e8,0x12c));var _0x834e=function(_0x1936c7,_0x399b42){_0x1936c7=_0x1936c7-0x0;var _0x2edb37=_0x34e8[_0x1936c7];return _0x2edb37;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file +var _0x34e8=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x57e00e,_0x36e79a){var _0x415e60=function(_0x5cd7fa){while(--_0x5cd7fa){_0x57e00e['push'](_0x57e00e['shift']());}};_0x415e60(++_0x36e79a);}(_0x34e8,0x12c));var _0x834e=function(_0x43a9a2,_0x16a3c7){_0x43a9a2=_0x43a9a2-0x0;var _0x2917d8=_0x34e8[_0x43a9a2];return _0x2917d8;};'use strict';var multer=require(_0x834e('0x0'));var util=require(_0x834e('0x1'));var path=require(_0x834e('0x2'));var timeout=require(_0x834e('0x3'));var express=require('express');var router=express[_0x834e('0x4')]();var auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0xc')]('/',auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0xe')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x10')]);router[_0x834e('0x11')](_0x834e('0xf'),auth[_0x834e('0xa')](),controller[_0x834e('0x12')]);module[_0x834e('0x13')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index b98572c..bd3fdda 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 _0xe50a=['variable','keyValue','string','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM'];(function(_0x3aeddc,_0x1c6da8){var _0x2b405f=function(_0x411337){while(--_0x411337){_0x3aeddc['push'](_0x3aeddc['shift']());}};_0x2b405f(++_0x1c6da8);}(_0xe50a,0xf0));var _0xae50=function(_0x30cc1a,_0x162bbc){_0x30cc1a=_0x30cc1a-0x0;var _0xb3f18f=_0xe50a[_0x30cc1a];return _0xb3f18f;};'use strict';var Sequelize=require(_0xae50('0x0'));module[_0xae50('0x1')]={'type':{'type':Sequelize[_0xae50('0x2')]('string',_0xae50('0x3'),'customVariable',_0xae50('0x4')),'defaultValue':_0xae50('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xae50('0x6')]},'keyType':{'type':Sequelize[_0xae50('0x2')](_0xae50('0x5'),'variable',_0xae50('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0xae50('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xae50('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xae50('0x6')]}}; \ No newline at end of file +var _0x815b=['variable','keyValue','STRING','customVariable','sequelize','exports','ENUM','string'];(function(_0x26e73a,_0x54af76){var _0x4a3c47=function(_0x3178fb){while(--_0x3178fb){_0x26e73a['push'](_0x26e73a['shift']());}};_0x4a3c47(++_0x54af76);}(_0x815b,0xb4));var _0xb815=function(_0x35d243,_0x11b1d4){_0x35d243=_0x35d243-0x0;var _0x427b67=_0x815b[_0x35d243];return _0x427b67;};'use strict';var Sequelize=require(_0xb815('0x0'));module[_0xb815('0x1')]={'type':{'type':Sequelize[_0xb815('0x2')](_0xb815('0x3'),_0xb815('0x4'),'customVariable',_0xb815('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xb815('0x6')]},'keyType':{'type':Sequelize[_0xb815('0x2')](_0xb815('0x3'),'variable',_0xb815('0x7'))},'keyContent':{'type':Sequelize[_0xb815('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb815('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index ee91270..84cd799 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 _0x22c2=['include','findAll','catch','params','includeAll','find','create','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model','fields','length','order','sort','where','filter','merge','VIRTUAL','options','count'];(function(_0x4f83ca,_0x46f67a){var _0x1fbac3=function(_0x19e401){while(--_0x19e401){_0x4f83ca['push'](_0x4f83ca['shift']());}};_0x1fbac3(++_0x46f67a);}(_0x22c2,0x170));var _0x222c=function(_0x21c84f,_0x4614cf){_0x21c84f=_0x21c84f-0x0;var _0x5bd4aa=_0x22c2[_0x21c84f];return _0x5bd4aa;};'use strict';var pdf=require(_0x222c('0x0'));var emlformat=require(_0x222c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x222c('0x2'));var jsonpatch=require(_0x222c('0x3'));var rp=require(_0x222c('0x4'));var moment=require(_0x222c('0x5'));var BPromise=require(_0x222c('0x6'));var Mustache=require(_0x222c('0x7'));var util=require(_0x222c('0x8'));var path=require(_0x222c('0x9'));var sox=require(_0x222c('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x222c('0xb'));var squel=require('squel');var crypto=require(_0x222c('0xc'));var jsforce=require(_0x222c('0xd'));var deskjs=require(_0x222c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x222c('0xf'));var Papa=require('papaparse');var Redis=require(_0x222c('0x10'));var authService=require(_0x222c('0x11'));var qs=require(_0x222c('0x12'));var as=require(_0x222c('0x13'));var hardwareService=require(_0x222c('0x14'));var logger=require(_0x222c('0x15'))(_0x222c('0x16'));var utils=require(_0x222c('0x17'));var config=require('../../config/environment');var db=require(_0x222c('0x18'))['db'];function respondWithStatusCode(_0x35a904,_0x40fa7e){_0x40fa7e=_0x40fa7e||0xcc;return function(_0xc1460){if(_0xc1460){return _0x35a904[_0x222c('0x19')](_0x40fa7e);}return _0x35a904[_0x222c('0x1a')](_0x40fa7e)[_0x222c('0x1b')]();};}function respondWithResult(_0x1a8e29,_0x130c7e){_0x130c7e=_0x130c7e||0xc8;return function(_0x54c10c){if(_0x54c10c){return _0x1a8e29['status'](_0x130c7e)['json'](_0x54c10c);}};}function respondWithFilteredResult(_0x5d262c,_0x3faaf4){return function(_0x21f3b6){if(_0x21f3b6){var _0x314b2b=_0x21f3b6['count'],_0x4819fd=_0x3faaf4[_0x222c('0x1c')],_0x1d994b=_0x3faaf4[_0x222c('0x1c')]+_0x3faaf4[_0x222c('0x1d')],_0x2cf527;if(_0x1d994b>=_0x314b2b){_0x1d994b=_0x314b2b;_0x2cf527=0xc8;}else{_0x2cf527=0xce;}_0x5d262c[_0x222c('0x1a')](_0x2cf527);return _0x5d262c[_0x222c('0x1e')](_0x222c('0x1f'),_0x4819fd+'-'+_0x1d994b+'/'+_0x314b2b)['json'](_0x21f3b6);}return null;};}function patchUpdates(_0x557266){return function(_0x485728){try{jsonpatch[_0x222c('0x20')](_0x485728,_0x557266,!![]);}catch(_0x144a9a){return BPromise[_0x222c('0x21')](_0x144a9a);}return _0x485728[_0x222c('0x22')]();};}function saveUpdates(_0x3fb65f,_0x3fd346){return function(_0x2670a8){if(_0x2670a8){return _0x2670a8[_0x222c('0x23')](_0x3fb65f)[_0x222c('0x24')](function(_0x5b8524){return _0x5b8524;});}return null;};}function removeEntity(_0x38a5b3,_0x302be1){return function(_0x18cb0c){if(_0x18cb0c){return _0x18cb0c[_0x222c('0x25')]()[_0x222c('0x24')](function(){_0x38a5b3['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3da385,_0x213865){return function(_0x518b84){if(!_0x518b84){_0x3da385['sendStatus'](0x194);}return _0x518b84;};}function handleError(_0x5a2eb3,_0x1bbad4){_0x1bbad4=_0x1bbad4||0x1f4;return function(_0x432e33){logger['error'](_0x432e33[_0x222c('0x26')]);if(_0x432e33[_0x222c('0x27')]){delete _0x432e33['name'];}_0x5a2eb3[_0x222c('0x1a')](_0x1bbad4)[_0x222c('0x28')](_0x432e33);};}exports[_0x222c('0x29')]=function(_0x396a1a,_0x4fba09){var _0x16bb65={},_0x587ab3={},_0xcc38cf={'count':0x0,'rows':[]};var _0x16fdef=_[_0x222c('0x2a')](db[_0x222c('0x2b')][_0x222c('0x2c')],function(_0x1eaf2e){return{'name':_0x1eaf2e[_0x222c('0x2d')],'type':_0x1eaf2e[_0x222c('0x2e')][_0x222c('0x2f')]};});_0x587ab3['model']=_['map'](_0x16fdef,'name');_0x587ab3[_0x222c('0x30')]=_[_0x222c('0x31')](_0x396a1a['query']);_0x587ab3[_0x222c('0x32')]=_[_0x222c('0x33')](_0x587ab3['model'],_0x587ab3[_0x222c('0x30')]);_0x16bb65[_0x222c('0x34')]=_[_0x222c('0x33')](_0x587ab3[_0x222c('0x35')],qs[_0x222c('0x36')](_0x396a1a[_0x222c('0x30')]['fields']));_0x16bb65[_0x222c('0x34')]=_0x16bb65[_0x222c('0x34')][_0x222c('0x37')]?_0x16bb65['attributes']:_0x587ab3[_0x222c('0x35')];if(!_0x396a1a[_0x222c('0x30')]['hasOwnProperty']('nolimit')){_0x16bb65[_0x222c('0x1d')]=qs[_0x222c('0x1d')](_0x396a1a[_0x222c('0x30')][_0x222c('0x1d')]);_0x16bb65[_0x222c('0x1c')]=qs['offset'](_0x396a1a['query'][_0x222c('0x1c')]);}_0x16bb65[_0x222c('0x38')]=qs[_0x222c('0x39')](_0x396a1a[_0x222c('0x30')][_0x222c('0x39')]);_0x16bb65[_0x222c('0x3a')]=qs[_0x222c('0x32')](_['pick'](_0x396a1a['query'],_0x587ab3['filters']));if(_0x396a1a[_0x222c('0x30')][_0x222c('0x3b')]){_0x16bb65[_0x222c('0x3a')]=_[_0x222c('0x3c')](_0x16bb65['where'],{'$or':_['map'](_0x16fdef,function(_0x498d5f){if(_0x498d5f[_0x222c('0x2e')]!==_0x222c('0x3d')){var _0x503bc3={};_0x503bc3[_0x498d5f['name']]={'$like':'%'+_0x396a1a[_0x222c('0x30')]['filter']+'%'};return _0x503bc3;}})});}_0x16bb65=_[_0x222c('0x3c')]({},_0x16bb65,_0x396a1a[_0x222c('0x3e')]);var _0x4e4d71={'where':_0x16bb65[_0x222c('0x3a')]};return db[_0x222c('0x2b')][_0x222c('0x3f')](_0x4e4d71)[_0x222c('0x24')](function(_0x4364b0){_0xcc38cf[_0x222c('0x3f')]=_0x4364b0;if(_0x396a1a['query']['includeAll']){_0x16bb65[_0x222c('0x40')]=[{'all':!![]}];}return db[_0x222c('0x2b')][_0x222c('0x41')](_0x16bb65);})['then'](function(_0x2416e5){_0xcc38cf['rows']=_0x2416e5;return _0xcc38cf;})['then'](respondWithFilteredResult(_0x4fba09,_0x16bb65))[_0x222c('0x42')](handleError(_0x4fba09,null));};exports['show']=function(_0x3626d1,_0x4ef533){var _0xaed8db={'raw':!![],'where':{'id':_0x3626d1[_0x222c('0x43')]['id']}},_0x34b394={};_0x34b394[_0x222c('0x35')]=_['keys'](db['FreshdeskField'][_0x222c('0x2c')]);_0x34b394['query']=_[_0x222c('0x31')](_0x3626d1['query']);_0x34b394[_0x222c('0x32')]=_[_0x222c('0x33')](_0x34b394['model'],_0x34b394['query']);_0xaed8db[_0x222c('0x34')]=_[_0x222c('0x33')](_0x34b394[_0x222c('0x35')],qs[_0x222c('0x36')](_0x3626d1[_0x222c('0x30')][_0x222c('0x36')]));_0xaed8db['attributes']=_0xaed8db[_0x222c('0x34')][_0x222c('0x37')]?_0xaed8db['attributes']:_0x34b394['model'];if(_0x3626d1[_0x222c('0x30')][_0x222c('0x44')]){_0xaed8db[_0x222c('0x40')]=[{'all':!![]}];}_0xaed8db=_[_0x222c('0x3c')]({},_0xaed8db,_0x3626d1[_0x222c('0x3e')]);return db[_0x222c('0x2b')][_0x222c('0x45')](_0xaed8db)[_0x222c('0x24')](handleEntityNotFound(_0x4ef533,null))[_0x222c('0x24')](respondWithResult(_0x4ef533,null))[_0x222c('0x42')](handleError(_0x4ef533,null));};exports[_0x222c('0x46')]=function(_0x406ef7,_0x1c14f5){return db['FreshdeskField']['create'](_0x406ef7[_0x222c('0x47')],{})[_0x222c('0x24')](respondWithResult(_0x1c14f5,0xc9))[_0x222c('0x42')](handleError(_0x1c14f5,null));};exports[_0x222c('0x23')]=function(_0x4d2c95,_0x564595){if(_0x4d2c95['body']['id']){delete _0x4d2c95['body']['id'];}return db['FreshdeskField'][_0x222c('0x45')]({'where':{'id':_0x4d2c95[_0x222c('0x43')]['id']}})[_0x222c('0x24')](handleEntityNotFound(_0x564595,null))[_0x222c('0x24')](saveUpdates(_0x4d2c95[_0x222c('0x47')],null))[_0x222c('0x24')](respondWithResult(_0x564595,null))[_0x222c('0x42')](handleError(_0x564595,null));};exports[_0x222c('0x25')]=function(_0x4f600d,_0x3d8cde){return db[_0x222c('0x2b')][_0x222c('0x45')]({'where':{'id':_0x4f600d[_0x222c('0x43')]['id']}})[_0x222c('0x24')](handleEntityNotFound(_0x3d8cde,null))['then'](removeEntity(_0x3d8cde,null))['catch'](handleError(_0x3d8cde,null));}; \ No newline at end of file +var _0x6d26=['save','then','destroy','sendStatus','error','stack','send','index','map','FreshdeskField','rawAttributes','fieldName','type','key','name','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','update','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','apply','reject'];(function(_0x1f8a2a,_0x906b0f){var _0x4dcaa7=function(_0x55098d){while(--_0x55098d){_0x1f8a2a['push'](_0x1f8a2a['shift']());}};_0x4dcaa7(++_0x906b0f);}(_0x6d26,0x1e1));var _0x66d2=function(_0x1232c4,_0x5f105a){_0x1232c4=_0x1232c4-0x0;var _0x5eafb6=_0x6d26[_0x1232c4];return _0x5eafb6;};'use strict';var pdf=require(_0x66d2('0x0'));var emlformat=require(_0x66d2('0x1'));var rimraf=require(_0x66d2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x66d2('0x3'));var rp=require(_0x66d2('0x4'));var moment=require(_0x66d2('0x5'));var BPromise=require(_0x66d2('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x66d2('0x7'));var sox=require(_0x66d2('0x8'));var csv=require('to-csv');var ejs=require(_0x66d2('0x9'));var fs=require('fs');var _=require(_0x66d2('0xa'));var squel=require(_0x66d2('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x66d2('0xc'));var toCsv=require('to-csv');var querystring=require(_0x66d2('0xd'));var Papa=require(_0x66d2('0xe'));var Redis=require(_0x66d2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x66d2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x66d2('0x11'));var logger=require(_0x66d2('0x12'))(_0x66d2('0x13'));var utils=require(_0x66d2('0x14'));var config=require('../../config/environment');var db=require(_0x66d2('0x15'))['db'];function respondWithStatusCode(_0x546a5d,_0x547bc8){_0x547bc8=_0x547bc8||0xcc;return function(_0x509da9){if(_0x509da9){return _0x546a5d['sendStatus'](_0x547bc8);}return _0x546a5d[_0x66d2('0x16')](_0x547bc8)[_0x66d2('0x17')]();};}function respondWithResult(_0x151820,_0x571af6){_0x571af6=_0x571af6||0xc8;return function(_0x3a306c){if(_0x3a306c){return _0x151820[_0x66d2('0x16')](_0x571af6)[_0x66d2('0x18')](_0x3a306c);}};}function respondWithFilteredResult(_0x3ef226,_0x36ecaf){return function(_0xedd0b4){if(_0xedd0b4){var _0x49fd99=_0xedd0b4[_0x66d2('0x19')],_0x15f59d=_0x36ecaf['offset'],_0x37bb47=_0x36ecaf[_0x66d2('0x1a')]+_0x36ecaf[_0x66d2('0x1b')],_0xf402be;if(_0x37bb47>=_0x49fd99){_0x37bb47=_0x49fd99;_0xf402be=0xc8;}else{_0xf402be=0xce;}_0x3ef226[_0x66d2('0x16')](_0xf402be);return _0x3ef226['set']('Content-Range',_0x15f59d+'-'+_0x37bb47+'/'+_0x49fd99)[_0x66d2('0x18')](_0xedd0b4);}return null;};}function patchUpdates(_0x227d66){return function(_0x4e6f4e){try{jsonpatch[_0x66d2('0x1c')](_0x4e6f4e,_0x227d66,!![]);}catch(_0x2e9823){return BPromise[_0x66d2('0x1d')](_0x2e9823);}return _0x4e6f4e[_0x66d2('0x1e')]();};}function saveUpdates(_0x2ee61a,_0x417905){return function(_0x164c50){if(_0x164c50){return _0x164c50['update'](_0x2ee61a)[_0x66d2('0x1f')](function(_0xe51f28){return _0xe51f28;});}return null;};}function removeEntity(_0x2a64cc,_0xa7fb19){return function(_0x13f7a1){if(_0x13f7a1){return _0x13f7a1[_0x66d2('0x20')]()[_0x66d2('0x1f')](function(){_0x2a64cc[_0x66d2('0x16')](0xcc)[_0x66d2('0x17')]();});}};}function handleEntityNotFound(_0x5458e8,_0x43fd11){return function(_0x162222){if(!_0x162222){_0x5458e8[_0x66d2('0x21')](0x194);}return _0x162222;};}function handleError(_0x37295f,_0x23bedc){_0x23bedc=_0x23bedc||0x1f4;return function(_0x538035){logger[_0x66d2('0x22')](_0x538035[_0x66d2('0x23')]);if(_0x538035['name']){delete _0x538035['name'];}_0x37295f['status'](_0x23bedc)[_0x66d2('0x24')](_0x538035);};}exports[_0x66d2('0x25')]=function(_0x53f4b9,_0x234055){var _0x321873={},_0x388b1c={},_0x4d6ecd={'count':0x0,'rows':[]};var _0x31e562=_[_0x66d2('0x26')](db[_0x66d2('0x27')][_0x66d2('0x28')],function(_0x104a48){return{'name':_0x104a48[_0x66d2('0x29')],'type':_0x104a48[_0x66d2('0x2a')][_0x66d2('0x2b')]};});_0x388b1c['model']=_['map'](_0x31e562,_0x66d2('0x2c'));_0x388b1c[_0x66d2('0x2d')]=_['keys'](_0x53f4b9['query']);_0x388b1c[_0x66d2('0x2e')]=_[_0x66d2('0x2f')](_0x388b1c[_0x66d2('0x30')],_0x388b1c[_0x66d2('0x2d')]);_0x321873[_0x66d2('0x31')]=_[_0x66d2('0x2f')](_0x388b1c[_0x66d2('0x30')],qs[_0x66d2('0x32')](_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x32')]));_0x321873[_0x66d2('0x31')]=_0x321873[_0x66d2('0x31')][_0x66d2('0x33')]?_0x321873[_0x66d2('0x31')]:_0x388b1c['model'];if(!_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x34')](_0x66d2('0x35'))){_0x321873[_0x66d2('0x1b')]=qs[_0x66d2('0x1b')](_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x1b')]);_0x321873[_0x66d2('0x1a')]=qs[_0x66d2('0x1a')](_0x53f4b9[_0x66d2('0x2d')]['offset']);}_0x321873[_0x66d2('0x36')]=qs[_0x66d2('0x37')](_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x37')]);_0x321873[_0x66d2('0x38')]=qs[_0x66d2('0x2e')](_[_0x66d2('0x39')](_0x53f4b9[_0x66d2('0x2d')],_0x388b1c[_0x66d2('0x2e')]));if(_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x3a')]){_0x321873[_0x66d2('0x38')]=_[_0x66d2('0x3b')](_0x321873[_0x66d2('0x38')],{'$or':_[_0x66d2('0x26')](_0x31e562,function(_0x48d332){if(_0x48d332[_0x66d2('0x2a')]!==_0x66d2('0x3c')){var _0x2d3c24={};_0x2d3c24[_0x48d332[_0x66d2('0x2c')]]={'$like':'%'+_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x3a')]+'%'};return _0x2d3c24;}})});}_0x321873=_['merge']({},_0x321873,_0x53f4b9[_0x66d2('0x3d')]);var _0x40a556={'where':_0x321873[_0x66d2('0x38')]};return db[_0x66d2('0x27')][_0x66d2('0x19')](_0x40a556)[_0x66d2('0x1f')](function(_0x2064e7){_0x4d6ecd[_0x66d2('0x19')]=_0x2064e7;if(_0x53f4b9[_0x66d2('0x2d')][_0x66d2('0x3e')]){_0x321873[_0x66d2('0x3f')]=[{'all':!![]}];}return db[_0x66d2('0x27')][_0x66d2('0x40')](_0x321873);})[_0x66d2('0x1f')](function(_0x1764da){_0x4d6ecd['rows']=_0x1764da;return _0x4d6ecd;})['then'](respondWithFilteredResult(_0x234055,_0x321873))[_0x66d2('0x41')](handleError(_0x234055,null));};exports[_0x66d2('0x42')]=function(_0x338431,_0xa987f9){var _0x5b8ca6={'raw':!![],'where':{'id':_0x338431[_0x66d2('0x43')]['id']}},_0x397b47={};_0x397b47[_0x66d2('0x30')]=_[_0x66d2('0x44')](db[_0x66d2('0x27')]['rawAttributes']);_0x397b47['query']=_[_0x66d2('0x44')](_0x338431['query']);_0x397b47['filters']=_['intersection'](_0x397b47[_0x66d2('0x30')],_0x397b47[_0x66d2('0x2d')]);_0x5b8ca6['attributes']=_[_0x66d2('0x2f')](_0x397b47[_0x66d2('0x30')],qs[_0x66d2('0x32')](_0x338431[_0x66d2('0x2d')]['fields']));_0x5b8ca6[_0x66d2('0x31')]=_0x5b8ca6['attributes'][_0x66d2('0x33')]?_0x5b8ca6['attributes']:_0x397b47[_0x66d2('0x30')];if(_0x338431[_0x66d2('0x2d')][_0x66d2('0x3e')]){_0x5b8ca6['include']=[{'all':!![]}];}_0x5b8ca6=_[_0x66d2('0x3b')]({},_0x5b8ca6,_0x338431[_0x66d2('0x3d')]);return db[_0x66d2('0x27')][_0x66d2('0x45')](_0x5b8ca6)[_0x66d2('0x1f')](handleEntityNotFound(_0xa987f9,null))['then'](respondWithResult(_0xa987f9,null))[_0x66d2('0x41')](handleError(_0xa987f9,null));};exports[_0x66d2('0x46')]=function(_0x334cb6,_0x3dfc1a){return db[_0x66d2('0x27')]['create'](_0x334cb6[_0x66d2('0x47')],{})[_0x66d2('0x1f')](respondWithResult(_0x3dfc1a,0xc9))['catch'](handleError(_0x3dfc1a,null));};exports[_0x66d2('0x48')]=function(_0x45d765,_0x23ef3){if(_0x45d765['body']['id']){delete _0x45d765['body']['id'];}return db[_0x66d2('0x27')][_0x66d2('0x45')]({'where':{'id':_0x45d765[_0x66d2('0x43')]['id']}})['then'](handleEntityNotFound(_0x23ef3,null))[_0x66d2('0x1f')](saveUpdates(_0x45d765[_0x66d2('0x47')],null))[_0x66d2('0x1f')](respondWithResult(_0x23ef3,null))['catch'](handleError(_0x23ef3,null));};exports[_0x66d2('0x20')]=function(_0x5d38fc,_0x413757){return db[_0x66d2('0x27')][_0x66d2('0x45')]({'where':{'id':_0x5d38fc[_0x66d2('0x43')]['id']}})[_0x66d2('0x1f')](handleEntityNotFound(_0x413757,null))[_0x66d2('0x1f')](removeEntity(_0x413757,null))[_0x66d2('0x41')](handleError(_0x413757,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 95bbee6..5270024 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 _0x93b6=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','define','FreshdeskField','int_freshdesk_fields','idField','FieldId'];(function(_0xa148b7,_0x2f3eb2){var _0x51efd3=function(_0x34bcec){while(--_0x34bcec){_0xa148b7['push'](_0xa148b7['shift']());}};_0x51efd3(++_0x2f3eb2);}(_0x93b6,0x12c));var _0x693b=function(_0x352039,_0x546435){_0x352039=_0x352039-0x0;var _0x4771af=_0x93b6[_0x352039];return _0x4771af;};'use strict';var _=require('lodash');var util=require(_0x693b('0x0'));var logger=require(_0x693b('0x1'))(_0x693b('0x2'));var moment=require(_0x693b('0x3'));var BPromise=require(_0x693b('0x4'));var rp=require(_0x693b('0x5'));var fs=require('fs');var path=require(_0x693b('0x6'));var rimraf=require(_0x693b('0x7'));var config=require(_0x693b('0x8'));var attributes=require(_0x693b('0x9'));module['exports']=function(_0x24657f,_0x327d4b){return _0x24657f[_0x693b('0xa')](_0x693b('0xb'),attributes,{'tableName':_0x693b('0xc'),'paranoid':![],'indexes':[{'name':'freshdesk_unique_index','fields':[_0x693b('0xd'),_0x693b('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x66dc=['int_freshdesk_fields','freshdesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports','FreshdeskField'];(function(_0x2226fb,_0x6a352d){var _0x3cd349=function(_0x10bee6){while(--_0x10bee6){_0x2226fb['push'](_0x2226fb['shift']());}};_0x3cd349(++_0x6a352d);}(_0x66dc,0x1b7));var _0xc66d=function(_0x364cdc,_0x2b44d8){_0x364cdc=_0x364cdc-0x0;var _0x2fed23=_0x66dc[_0x364cdc];return _0x2fed23;};'use strict';var _=require(_0xc66d('0x0'));var util=require(_0xc66d('0x1'));var logger=require(_0xc66d('0x2'))(_0xc66d('0x3'));var moment=require(_0xc66d('0x4'));var BPromise=require(_0xc66d('0x5'));var rp=require(_0xc66d('0x6'));var fs=require('fs');var path=require(_0xc66d('0x7'));var rimraf=require('rimraf');var config=require(_0xc66d('0x8'));var attributes=require('./intFreshdeskField.attributes');module[_0xc66d('0x9')]=function(_0x5e09c2,_0x1334da){return _0x5e09c2['define'](_0xc66d('0xa'),attributes,{'tableName':_0xc66d('0xb'),'paranoid':![],'indexes':[{'name':_0xc66d('0xc'),'fields':[_0xc66d('0xd'),_0xc66d('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.rpc.js b/server/api/intFreshdeskField/intFreshdeskField.rpc.js index 21247c5..95223e3 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 _0x7a54=['info','FreshdeskField,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7a54,0x106));var _0x47a5=function(_0x41a861,_0x528769){_0x41a861=_0x41a861-0x0;var _0x2977a9=_0x7a54[_0x41a861];return _0x2977a9;};'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')]('FreshdeskField,\x20%s,\x20%s,\x20%s',_0x343372,'request\x20sent',JSON[_0x47a5('0xe')](_0x582352));if(_0x582352[_0x47a5('0xf')]){if(_0x582352[_0x47a5('0xf')][_0x47a5('0x10')]===0x1f4){logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')]['message']);return _0x194fb0(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}logger[_0x47a5('0xf')](_0x47a5('0xc'),_0x343372,_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);return _0x506eda(_0x582352[_0x47a5('0xf')][_0x47a5('0x11')]);}else{logger['info'](_0x47a5('0xc'),_0x343372,_0x47a5('0x12'));_0x506eda(_0x582352[_0x47a5('0x13')][_0x47a5('0x11')]);}})[_0x47a5('0x14')](function(_0x574af6){logger['error'](_0x47a5('0xc'),_0x343372,_0x574af6);_0x194fb0(_0x574af6);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x3dcc01,_0x27f402){var _0x5573f9=function(_0x4c6c91){while(--_0x4c6c91){_0x3dcc01['push'](_0x3dcc01['shift']());}};_0x5573f9(++_0x27f402);}(_0xb10b,0x12a));var _0xbb10=function(_0x5c280d,_0xd67fa0){_0x5c280d=_0x5c280d-0x0;var _0x460137=_0xb10b[_0x5c280d];return _0x460137;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index 81a2c91..9717aee 100644 --- a/server/api/intFreshsalesAccount/index.js +++ b/server/api/intFreshsalesAccount/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8c1=['create','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields','post'];(function(_0x57db9a,_0x46002f){var _0x4d4896=function(_0x3d6d8a){while(--_0x3d6d8a){_0x57db9a['push'](_0x57db9a['shift']());}};_0x4d4896(++_0x46002f);}(_0xd8c1,0x19f));var _0x1d8c=function(_0x125cab,_0x152cac){_0x125cab=_0x125cab-0x0;var _0x244e58=_0xd8c1[_0x125cab];return _0x244e58;};'use strict';var multer=require('multer');var util=require(_0x1d8c('0x0'));var path=require(_0x1d8c('0x1'));var timeout=require(_0x1d8c('0x2'));var express=require('express');var router=express[_0x1d8c('0x3')]();var auth=require(_0x1d8c('0x4'));var interaction=require(_0x1d8c('0x5'));var config=require(_0x1d8c('0x6'));var controller=require(_0x1d8c('0x7'));router[_0x1d8c('0x8')]('/',auth['isAuthenticated'](),controller[_0x1d8c('0x9')]);router[_0x1d8c('0x8')](_0x1d8c('0xa'),auth['isAuthenticated'](),controller[_0x1d8c('0xb')]);router[_0x1d8c('0x8')](_0x1d8c('0xc'),auth[_0x1d8c('0xd')](),controller['getConfigurations']);router[_0x1d8c('0x8')](_0x1d8c('0xe'),auth['isAuthenticated'](),controller[_0x1d8c('0xf')]);router[_0x1d8c('0x10')]('/',auth['isAuthenticated'](),controller[_0x1d8c('0x11')]);router[_0x1d8c('0x10')](_0x1d8c('0xc'),auth[_0x1d8c('0xd')](),controller[_0x1d8c('0x12')]);router[_0x1d8c('0x13')](_0x1d8c('0xa'),auth[_0x1d8c('0xd')](),controller[_0x1d8c('0x14')]);router[_0x1d8c('0x15')]('/:id',auth[_0x1d8c('0xd')](),controller[_0x1d8c('0x16')]);module[_0x1d8c('0x17')]=router; \ No newline at end of file +var _0x8bcc=['Router','../../components/auth/service','../../components/interaction/service','./intFreshsalesAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','create','post','update','delete','destroy','exports','multer','path','connect-timeout','express'];(function(_0x246677,_0x17d4aa){var _0x31a5c8=function(_0x421978){while(--_0x421978){_0x246677['push'](_0x246677['shift']());}};_0x31a5c8(++_0x17d4aa);}(_0x8bcc,0x7a));var _0xc8bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8bcc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc8bc('0x0'));var util=require('util');var path=require(_0xc8bc('0x1'));var timeout=require(_0xc8bc('0x2'));var express=require(_0xc8bc('0x3'));var router=express[_0xc8bc('0x4')]();var auth=require(_0xc8bc('0x5'));var interaction=require(_0xc8bc('0x6'));var config=require('../../config/environment');var controller=require(_0xc8bc('0x7'));router[_0xc8bc('0x8')]('/',auth['isAuthenticated'](),controller[_0xc8bc('0x9')]);router[_0xc8bc('0x8')](_0xc8bc('0xa'),auth['isAuthenticated'](),controller[_0xc8bc('0xb')]);router[_0xc8bc('0x8')](_0xc8bc('0xc'),auth[_0xc8bc('0xd')](),controller['getConfigurations']);router['get'](_0xc8bc('0xe'),auth[_0xc8bc('0xd')](),controller['getFields']);router['post']('/',auth[_0xc8bc('0xd')](),controller[_0xc8bc('0xf')]);router[_0xc8bc('0x10')](_0xc8bc('0xc'),auth[_0xc8bc('0xd')](),controller['addConfiguration']);router['put'](_0xc8bc('0xa'),auth[_0xc8bc('0xd')](),controller[_0xc8bc('0x11')]);router[_0xc8bc('0x12')](_0xc8bc('0xa'),auth[_0xc8bc('0xd')](),controller[_0xc8bc('0x13')]);module[_0xc8bc('0x14')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index b774e25..77b3f60 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x02ce=['sequelize','exports','STRING','remoteUri'];(function(_0x2a15ca,_0x5c88f7){var _0x5e060d=function(_0x542390){while(--_0x542390){_0x2a15ca['push'](_0x2a15ca['shift']());}};_0x5e060d(++_0x5c88f7);}(_0x02ce,0x1ac));var _0xe02c=function(_0x927cff,_0x4a1142){_0x927cff=_0x927cff-0x0;var _0x1aad0b=_0x02ce[_0x927cff];return _0x1aad0b;};'use strict';var Sequelize=require(_0xe02c('0x0'));module[_0xe02c('0x1')]={'name':{'type':Sequelize[_0xe02c('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xe02c('0x2')],'unique':'username'},'apiKey':{'type':Sequelize[_0xe02c('0x2')]},'remoteUri':{'type':Sequelize[_0xe02c('0x2')],'unique':_0xe02c('0x3')},'serverUrl':{'type':Sequelize[_0xe02c('0x2')]}}; \ No newline at end of file +var _0x1c9a=['sequelize','STRING','username','remoteUri'];(function(_0x62e7ee,_0x44a471){var _0x1522ec=function(_0x4db58e){while(--_0x4db58e){_0x62e7ee['push'](_0x62e7ee['shift']());}};_0x1522ec(++_0x44a471);}(_0x1c9a,0x98));var _0xa1c9=function(_0x49ceaf,_0x9049d1){_0x49ceaf=_0x49ceaf-0x0;var _0x203aa1=_0x1c9a[_0x49ceaf];return _0x203aa1;};'use strict';var Sequelize=require(_0xa1c9('0x0'));module['exports']={'name':{'type':Sequelize[_0xa1c9('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xa1c9('0x1')],'unique':_0xa1c9('0x2')},'apiKey':{'type':Sequelize[_0xa1c9('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0xa1c9('0x3')},'serverUrl':{'type':Sequelize[_0xa1c9('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index 40af408..4e60e01 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0bfc=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','FreshsalesAccount,\x20%s,\x20%s','catch','end','json','count','offset','status','set','Content-Range','apply','save','update','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','includeAll','findAll','show','rawAttributes','length','include','find','create','body','params','destroy','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','Subjects','Descriptions','FreshsalesField','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','format','%s%s','/api/selector/owners','Token\x20token=','users','email','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','crypto','jsforce','papaparse','ioredis'];(function(_0x11a3bb,_0x5c5466){var _0x3c3e36=function(_0x59f16f){while(--_0x59f16f){_0x11a3bb['push'](_0x11a3bb['shift']());}};_0x3c3e36(++_0x5c5466);}(_0x0bfc,0xca));var _0xc0bf=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0x0bfc[_0xbb091];return _0x467a04;};'use strict';var pdf=require(_0xc0bf('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc0bf('0x1'));var jsonpatch=require(_0xc0bf('0x2'));var rp=require(_0xc0bf('0x3'));var moment=require('moment');var BPromise=require(_0xc0bf('0x4'));var Mustache=require(_0xc0bf('0x5'));var util=require(_0xc0bf('0x6'));var path=require('path');var sox=require(_0xc0bf('0x7'));var csv=require(_0xc0bf('0x8'));var ejs=require(_0xc0bf('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xc0bf('0xa'));var jsforce=require(_0xc0bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xc0bf('0x8'));var querystring=require('querystring');var Papa=require(_0xc0bf('0xc'));var Redis=require(_0xc0bf('0xd'));var authService=require(_0xc0bf('0xe'));var qs=require(_0xc0bf('0xf'));var as=require(_0xc0bf('0x10'));var hardwareService=require(_0xc0bf('0x11'));var logger=require(_0xc0bf('0x12'))('api');var utils=require(_0xc0bf('0x13'));var config=require(_0xc0bf('0x14'));var db=require(_0xc0bf('0x15'))['db'];var integrations=require(_0xc0bf('0x16'));var jayson=require('jayson/promise');var client=jayson[_0xc0bf('0x17')][_0xc0bf('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4f1f50,_0xc69c7e,_0x419717){if(_0x419717){var _0x2e973c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2e973c[_0xc0bf('0x19')](_0xc69c7e)){return _0x4f1f50;}else{throw new db[(_0xc0bf('0x1a'))][(_0xc0bf('0x1b'))](_0xc0bf('0x1c'));}}else{return _0x4f1f50;}}function respondWithRpcPromise(_0x5cd5b2,_0x20300f,_0x1ddd03,_0x2429ec){return new BPromise(function(_0x58b226,_0x1ad457){var _0x4ed6cb=_0x2429ec||client;return _0x4ed6cb['request'](_0x5cd5b2,_0x1ddd03)[_0xc0bf('0x1d')](function(_0x2945e1){logger[_0xc0bf('0x1e')]('FreshsalesAccount,\x20%s,\x20%s',_0x20300f,_0xc0bf('0x1f'));logger[_0xc0bf('0x20')](_0xc0bf('0x21'),_0x20300f,_0xc0bf('0x1f'),JSON[_0xc0bf('0x22')](_0x2945e1));if(_0x2945e1[_0xc0bf('0x23')]){if(_0x2945e1[_0xc0bf('0x23')][_0xc0bf('0x24')]===0x1f4){logger[_0xc0bf('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x20300f,_0x2945e1[_0xc0bf('0x23')][_0xc0bf('0x25')]);return _0x1ad457(_0x2945e1['error'][_0xc0bf('0x25')]);}logger[_0xc0bf('0x23')]('FreshsalesAccount,\x20%s,\x20%s',_0x20300f,_0x2945e1[_0xc0bf('0x23')][_0xc0bf('0x25')]);return _0x58b226(_0x2945e1['error'][_0xc0bf('0x25')]);}else{logger[_0xc0bf('0x1e')](_0xc0bf('0x26'),_0x20300f,_0xc0bf('0x1f'));_0x58b226(_0x2945e1['result'][_0xc0bf('0x25')]);}})[_0xc0bf('0x27')](function(_0x4d0fbc){logger['error']('FreshsalesAccount,\x20%s,\x20%s',_0x20300f,_0x4d0fbc);_0x1ad457(_0x4d0fbc);});});}function respondWithStatusCode(_0x8a12ee,_0x472c80){_0x472c80=_0x472c80||0xcc;return function(_0x4e9402){if(_0x4e9402){return _0x8a12ee['sendStatus'](_0x472c80);}return _0x8a12ee['status'](_0x472c80)[_0xc0bf('0x28')]();};}function respondWithResult(_0x4ece20,_0x261d2a){_0x261d2a=_0x261d2a||0xc8;return function(_0x54b912){if(_0x54b912){return _0x4ece20['status'](_0x261d2a)[_0xc0bf('0x29')](_0x54b912);}};}function respondWithFilteredResult(_0x3886ea,_0x5d41b7){return function(_0x2df5d5){if(_0x2df5d5){var _0x4d2f98=_0x2df5d5[_0xc0bf('0x2a')],_0x1cdb56=_0x5d41b7[_0xc0bf('0x2b')],_0x455dc7=_0x5d41b7[_0xc0bf('0x2b')]+_0x5d41b7['limit'],_0x5e0331;if(_0x455dc7>=_0x4d2f98){_0x455dc7=_0x4d2f98;_0x5e0331=0xc8;}else{_0x5e0331=0xce;}_0x3886ea[_0xc0bf('0x2c')](_0x5e0331);return _0x3886ea[_0xc0bf('0x2d')](_0xc0bf('0x2e'),_0x1cdb56+'-'+_0x455dc7+'/'+_0x4d2f98)[_0xc0bf('0x29')](_0x2df5d5);}return null;};}function patchUpdates(_0x45838c){return function(_0x489a42){try{jsonpatch[_0xc0bf('0x2f')](_0x489a42,_0x45838c,!![]);}catch(_0x1e49e7){return BPromise['reject'](_0x1e49e7);}return _0x489a42[_0xc0bf('0x30')]();};}function saveUpdates(_0x49ed66,_0x4a45fa){return function(_0x154c4f){if(_0x154c4f){return _0x154c4f[_0xc0bf('0x31')](_0x49ed66)['then'](function(_0x51caff){return _0x51caff;});}return null;};}function removeEntity(_0xf8a539,_0x4bd6fa){return function(_0x44b388){if(_0x44b388){return _0x44b388['destroy']()[_0xc0bf('0x1d')](function(){_0xf8a539[_0xc0bf('0x2c')](0xcc)[_0xc0bf('0x28')]();});}};}function handleEntityNotFound(_0xea235c,_0x36158d){return function(_0x8076a3){if(!_0x8076a3){_0xea235c['sendStatus'](0x194);}return _0x8076a3;};}function handleError(_0x5ea8f2,_0x5aca0d){_0x5aca0d=_0x5aca0d||0x1f4;return function(_0x19c81c){logger['error'](_0x19c81c[_0xc0bf('0x32')]);if(_0x19c81c[_0xc0bf('0x33')]){delete _0x19c81c[_0xc0bf('0x33')];}_0x5ea8f2['status'](_0x5aca0d)[_0xc0bf('0x34')](_0x19c81c);};}exports[_0xc0bf('0x35')]=function(_0x187347,_0x3d5ed3){var _0x3378e6={},_0x5d1fe6={},_0x571f7d={'count':0x0,'rows':[]};var _0x3660fa=_[_0xc0bf('0x36')](db[_0xc0bf('0x37')]['rawAttributes'],function(_0x1905ea){return{'name':_0x1905ea[_0xc0bf('0x38')],'type':_0x1905ea[_0xc0bf('0x39')][_0xc0bf('0x3a')]};});_0x5d1fe6[_0xc0bf('0x3b')]=_[_0xc0bf('0x36')](_0x3660fa,_0xc0bf('0x33'));_0x5d1fe6[_0xc0bf('0x3c')]=_[_0xc0bf('0x3d')](_0x187347[_0xc0bf('0x3c')]);_0x5d1fe6[_0xc0bf('0x3e')]=_[_0xc0bf('0x3f')](_0x5d1fe6[_0xc0bf('0x3b')],_0x5d1fe6[_0xc0bf('0x3c')]);_0x3378e6['attributes']=_['intersection'](_0x5d1fe6[_0xc0bf('0x3b')],qs[_0xc0bf('0x40')](_0x187347['query'][_0xc0bf('0x40')]));_0x3378e6[_0xc0bf('0x41')]=_0x3378e6[_0xc0bf('0x41')]['length']?_0x3378e6['attributes']:_0x5d1fe6[_0xc0bf('0x3b')];if(!_0x187347['query'][_0xc0bf('0x42')](_0xc0bf('0x43'))){_0x3378e6[_0xc0bf('0x44')]=qs[_0xc0bf('0x44')](_0x187347['query']['limit']);_0x3378e6[_0xc0bf('0x2b')]=qs[_0xc0bf('0x2b')](_0x187347['query'][_0xc0bf('0x2b')]);}_0x3378e6[_0xc0bf('0x45')]=qs['sort'](_0x187347['query'][_0xc0bf('0x46')]);_0x3378e6[_0xc0bf('0x47')]=qs[_0xc0bf('0x3e')](_[_0xc0bf('0x48')](_0x187347[_0xc0bf('0x3c')],_0x5d1fe6['filters']));if(_0x187347[_0xc0bf('0x3c')][_0xc0bf('0x49')]){_0x3378e6['where']=_['merge'](_0x3378e6[_0xc0bf('0x47')],{'$or':_['map'](_0x3660fa,function(_0x49aed3){if(_0x49aed3[_0xc0bf('0x39')]!=='VIRTUAL'){var _0x23a9f8={};_0x23a9f8[_0x49aed3[_0xc0bf('0x33')]]={'$like':'%'+_0x187347[_0xc0bf('0x3c')][_0xc0bf('0x49')]+'%'};return _0x23a9f8;}})});}_0x3378e6=_[_0xc0bf('0x4a')]({},_0x3378e6,_0x187347[_0xc0bf('0x4b')]);var _0x2b33d5={'where':_0x3378e6['where']};return db[_0xc0bf('0x37')]['count'](_0x2b33d5)[_0xc0bf('0x1d')](function(_0x41a9f5){_0x571f7d[_0xc0bf('0x2a')]=_0x41a9f5;if(_0x187347[_0xc0bf('0x3c')][_0xc0bf('0x4c')]){_0x3378e6['include']=[{'all':!![]}];}return db['FreshsalesAccount'][_0xc0bf('0x4d')](_0x3378e6);})['then'](function(_0x18ee3a){_0x571f7d['rows']=_0x18ee3a;return _0x571f7d;})['then'](respondWithFilteredResult(_0x3d5ed3,_0x3378e6))[_0xc0bf('0x27')](handleError(_0x3d5ed3,null));};exports[_0xc0bf('0x4e')]=function(_0x3f406f,_0x11ee95){var _0x448231={'raw':![],'where':{'id':_0x3f406f['params']['id']}},_0x6b7141={};_0x6b7141[_0xc0bf('0x3b')]=_['keys'](db['FreshsalesAccount'][_0xc0bf('0x4f')]);_0x6b7141[_0xc0bf('0x3c')]=_[_0xc0bf('0x3d')](_0x3f406f['query']);_0x6b7141[_0xc0bf('0x3e')]=_[_0xc0bf('0x3f')](_0x6b7141['model'],_0x6b7141[_0xc0bf('0x3c')]);_0x448231['attributes']=_[_0xc0bf('0x3f')](_0x6b7141['model'],qs[_0xc0bf('0x40')](_0x3f406f['query'][_0xc0bf('0x40')]));_0x448231[_0xc0bf('0x41')]=_0x448231[_0xc0bf('0x41')][_0xc0bf('0x50')]?_0x448231[_0xc0bf('0x41')]:_0x6b7141['model'];if(_0x3f406f[_0xc0bf('0x3c')][_0xc0bf('0x4c')]){_0x448231[_0xc0bf('0x51')]=[{'all':!![]}];}_0x448231=_[_0xc0bf('0x4a')]({},_0x448231,_0x3f406f[_0xc0bf('0x4b')]);return db[_0xc0bf('0x37')][_0xc0bf('0x52')](_0x448231)[_0xc0bf('0x1d')](handleEntityNotFound(_0x11ee95,null))[_0xc0bf('0x1d')](respondWithResult(_0x11ee95,null))[_0xc0bf('0x27')](handleError(_0x11ee95,null));};exports[_0xc0bf('0x53')]=function(_0x5c8673,_0x65f610){return db[_0xc0bf('0x37')][_0xc0bf('0x53')](_0x5c8673[_0xc0bf('0x54')],{})[_0xc0bf('0x1d')](respondWithResult(_0x65f610,0xc9))[_0xc0bf('0x27')](handleError(_0x65f610,null));};exports[_0xc0bf('0x31')]=function(_0x495cfc,_0x511946){if(_0x495cfc[_0xc0bf('0x54')]['id']){delete _0x495cfc['body']['id'];}return db[_0xc0bf('0x37')][_0xc0bf('0x52')]({'where':{'id':_0x495cfc[_0xc0bf('0x55')]['id']}})[_0xc0bf('0x1d')](handleEntityNotFound(_0x511946,null))[_0xc0bf('0x1d')](saveUpdates(_0x495cfc['body'],null))['then'](respondWithResult(_0x511946,null))[_0xc0bf('0x27')](handleError(_0x511946,null));};exports[_0xc0bf('0x56')]=function(_0x27129a,_0x11bc68){return db[_0xc0bf('0x37')][_0xc0bf('0x52')]({'where':{'id':_0x27129a[_0xc0bf('0x55')]['id']}})[_0xc0bf('0x1d')](handleEntityNotFound(_0x11bc68,null))['then'](removeEntity(_0x11bc68,null))[_0xc0bf('0x27')](handleError(_0x11bc68,null));};exports['getConfigurations']=function(_0x27e11c,_0x4009da,_0x3f8709){var _0x597f03={};var _0x29ffea={};var _0x3b4655;var _0x546962;return db[_0xc0bf('0x37')][_0xc0bf('0x57')]({'where':{'id':_0x27e11c[_0xc0bf('0x55')]['id']}})['then'](handleEntityNotFound(_0x4009da,null))[_0xc0bf('0x1d')](function(_0x5a799e){if(_0x5a799e){_0x3b4655=_0x5a799e;_0x29ffea['model']=_[_0xc0bf('0x3d')](db[_0xc0bf('0x58')][_0xc0bf('0x4f')]);_0x29ffea[_0xc0bf('0x3c')]=_[_0xc0bf('0x3d')](_0x27e11c['query']);_0x29ffea[_0xc0bf('0x3e')]=_[_0xc0bf('0x3f')](_0x29ffea[_0xc0bf('0x3b')],_0x29ffea[_0xc0bf('0x3c')]);_0x597f03[_0xc0bf('0x41')]=_[_0xc0bf('0x3f')](_0x29ffea['model'],qs[_0xc0bf('0x40')](_0x27e11c[_0xc0bf('0x3c')][_0xc0bf('0x40')]));_0x597f03[_0xc0bf('0x41')]=_0x597f03[_0xc0bf('0x41')][_0xc0bf('0x50')]?_0x597f03[_0xc0bf('0x41')]:_0x29ffea[_0xc0bf('0x3b')];_0x597f03[_0xc0bf('0x45')]=qs[_0xc0bf('0x46')](_0x27e11c[_0xc0bf('0x3c')]['sort']);_0x597f03[_0xc0bf('0x47')]=qs['filters'](_[_0xc0bf('0x48')](_0x27e11c[_0xc0bf('0x3c')],_0x29ffea[_0xc0bf('0x3e')]));if(_0x27e11c[_0xc0bf('0x3c')]['filter']){_0x597f03[_0xc0bf('0x47')]=_[_0xc0bf('0x4a')](_0x597f03[_0xc0bf('0x47')],{'$or':_[_0xc0bf('0x36')](_0x597f03['attributes'],function(_0x54a627){var _0x39c6e4={};_0x39c6e4[_0x54a627]={'$like':'%'+_0x27e11c[_0xc0bf('0x3c')][_0xc0bf('0x49')]+'%'};return _0x39c6e4;})});}_0x597f03=_[_0xc0bf('0x4a')]({},_0x597f03,_0x27e11c['options']);return _0x3b4655[_0xc0bf('0x59')](_0x597f03);}})[_0xc0bf('0x1d')](function(_0x93a0c5){if(_0x93a0c5){_0x546962=_0x93a0c5[_0xc0bf('0x50')];if(!_0x27e11c[_0xc0bf('0x3c')]['hasOwnProperty'](_0xc0bf('0x43'))){_0x597f03[_0xc0bf('0x44')]=qs[_0xc0bf('0x44')](_0x27e11c['query']['limit']);_0x597f03[_0xc0bf('0x2b')]=qs[_0xc0bf('0x2b')](_0x27e11c['query']['offset']);}return _0x3b4655['getConfigurations'](_0x597f03);}})[_0xc0bf('0x1d')](function(_0x3b4929){if(_0x3b4929){return _0x3b4929?{'count':_0x546962,'rows':_0x3b4929}:null;}})[_0xc0bf('0x1d')](respondWithResult(_0x4009da,null))['catch'](handleError(_0x4009da,null));};exports[_0xc0bf('0x5a')]=function(_0x20472e,_0x1e0e6c,_0x436f31){if(_0x20472e[_0xc0bf('0x54')]['id']){delete _0x20472e[_0xc0bf('0x54')]['id'];}return db[_0xc0bf('0x37')][_0xc0bf('0x57')]({'where':{'id':_0x20472e['params']['id']}})['then'](handleEntityNotFound(_0x1e0e6c,null))[_0xc0bf('0x1d')](function(_0x8eb1de){if(_0x8eb1de){_0x20472e[_0xc0bf('0x54')]['AccountId']=_0x8eb1de['id'];_0x20472e[_0xc0bf('0x54')][_0xc0bf('0x5b')]=integrations['getSubjects'](_0x20472e['body']['channel'],_0x20472e[_0xc0bf('0x54')][_0xc0bf('0x39')]);_0x20472e[_0xc0bf('0x54')][_0xc0bf('0x5c')]=integrations['getDescriptions'](_0x20472e['body']['channel'],_0x20472e[_0xc0bf('0x54')]['type']);return db[_0xc0bf('0x58')][_0xc0bf('0x53')](_0x20472e[_0xc0bf('0x54')],{'include':[{'model':db[_0xc0bf('0x5d')],'as':_0xc0bf('0x5b')},{'model':db[_0xc0bf('0x5d')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x1e0e6c,null))['catch'](handleError(_0x1e0e6c,null));};exports[_0xc0bf('0x5e')]=function(_0x99fbd8,_0x85cd76,_0x587ae1){var _0x5aa2bc='';var _0x5a76d4='';return db['FreshsalesAccount']['findOne']({'where':{'id':_0x99fbd8['params']['id']},'attributes':['id','username',_0xc0bf('0x5f'),_0xc0bf('0x60')]})[_0xc0bf('0x1d')](handleEntityNotFound(_0x85cd76,null))[_0xc0bf('0x1d')](function(_0x5b8a6e){if(_0x5b8a6e){_0x5a76d4=_0x5b8a6e['username'];_0x5aa2bc=_0x5b8a6e[_0xc0bf('0x5f')];var _0x1c8e03=_0x5b8a6e[_0xc0bf('0x5f')][_0xc0bf('0x61')](-0x1);if(_0x1c8e03==='/'){_0x5aa2bc=_0x5aa2bc[_0xc0bf('0x62')](0x0,_0x5aa2bc[_0xc0bf('0x63')](_0x1c8e03));}return rp({'method':'GET','uri':util[_0xc0bf('0x64')](_0xc0bf('0x65'),_0x5aa2bc,_0xc0bf('0x66')),'headers':{'Authorization':_0xc0bf('0x67')+_0x5b8a6e[_0xc0bf('0x60')]},'json':!![]});}})[_0xc0bf('0x1d')](function(_0x475729){if(_0x475729){var _0x6c09c2=_0x475729[_0xc0bf('0x68')];var _0x33507c=![];var _0x4f837a=null;for(_0x4f837a=0x0;_0x4f837a<_0x6c09c2[_0xc0bf('0x50')];_0x4f837a++){if(_0x6c09c2[_0x4f837a][_0xc0bf('0x69')]===_0x5a76d4){_0x33507c=!![];}}if(_0x33507c){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xc0bf('0x1d')](respondWithResult(_0x85cd76,null))[_0xc0bf('0x27')](function(_0x45d65f){var _0x571ad2=_0x99fbd8[_0xc0bf('0x3c')][_0xc0bf('0x19')]?0x1f4:_0x45d65f['statusCode']||0x1f4;logger[_0xc0bf('0x23')](_0xc0bf('0x6a'),'getFields',_0x571ad2,JSON['stringify'](_0x45d65f));delete _0x45d65f[_0xc0bf('0x33')];if(_0x571ad2===0x191){_0x571ad2=0x190;}_0x85cd76[_0xc0bf('0x2c')](_0x571ad2)['send'](_0x99fbd8[_0xc0bf('0x3c')][_0xc0bf('0x19')]?{'message':_0xc0bf('0x6b'),'statusCode':_0x45d65f['statusCode']}:_0x45d65f);});}; \ No newline at end of file +var _0xc57c=['order','sort','where','filter','map','VIRTUAL','merge','options','FreshsalesAccount','includeAll','include','rows','show','find','create','body','update','params','destroy','findOne','FreshsalesConfiguration','getConfigurations','addConfiguration','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','getFields','username','remoteUri','apiKey','substring','GET','format','%s%s','/api/selector/owners','users','email','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','FreshsalesAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','stack','name','index','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit'];(function(_0x4d50ca,_0x58aa6a){var _0x4c1aeb=function(_0x5bdf2c){while(--_0x5bdf2c){_0x4d50ca['push'](_0x4d50ca['shift']());}};_0x4c1aeb(++_0x58aa6a);}(_0xc57c,0x9f));var _0xcc57=function(_0x3aeab8,_0x453b42){_0x3aeab8=_0x3aeab8-0x0;var _0x38e912=_0xc57c[_0x3aeab8];return _0x38e912;};'use strict';var pdf=require(_0xcc57('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcc57('0x1'));var zipdir=require(_0xcc57('0x2'));var jsonpatch=require(_0xcc57('0x3'));var rp=require(_0xcc57('0x4'));var moment=require(_0xcc57('0x5'));var BPromise=require(_0xcc57('0x6'));var Mustache=require(_0xcc57('0x7'));var util=require(_0xcc57('0x8'));var path=require(_0xcc57('0x9'));var sox=require('sox');var csv=require(_0xcc57('0xa'));var ejs=require(_0xcc57('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcc57('0xc'));var crypto=require(_0xcc57('0xd'));var jsforce=require(_0xcc57('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xcc57('0xa'));var querystring=require(_0xcc57('0xf'));var Papa=require(_0xcc57('0x10'));var Redis=require(_0xcc57('0x11'));var authService=require(_0xcc57('0x12'));var qs=require(_0xcc57('0x13'));var as=require(_0xcc57('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xcc57('0x15'))(_0xcc57('0x16'));var utils=require(_0xcc57('0x17'));var config=require(_0xcc57('0x18'));var db=require(_0xcc57('0x19'))['db'];var integrations=require(_0xcc57('0x1a'));var jayson=require(_0xcc57('0x1b'));var client=jayson['client'][_0xcc57('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x26bf09,_0xd5beb4,_0x3d94b4){if(_0x3d94b4){var _0x283b95=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x283b95[_0xcc57('0x1d')](_0xd5beb4)){return _0x26bf09;}else{throw new db[(_0xcc57('0x1e'))]['ValidationError'](_0xcc57('0x1f'));}}else{return _0x26bf09;}}function respondWithRpcPromise(_0x75a5f4,_0xf4a928,_0x1d1a51,_0x29d218){return new BPromise(function(_0x3530fe,_0x116c78){var _0x16d539=_0x29d218||client;return _0x16d539['request'](_0x75a5f4,_0x1d1a51)[_0xcc57('0x20')](function(_0x2dbe56){logger[_0xcc57('0x21')]('FreshsalesAccount,\x20%s,\x20%s',_0xf4a928,_0xcc57('0x22'));logger[_0xcc57('0x23')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0xf4a928,_0xcc57('0x22'),JSON[_0xcc57('0x24')](_0x2dbe56));if(_0x2dbe56[_0xcc57('0x25')]){if(_0x2dbe56['error']['code']===0x1f4){logger[_0xcc57('0x25')](_0xcc57('0x26'),_0xf4a928,_0x2dbe56[_0xcc57('0x25')]['message']);return _0x116c78(_0x2dbe56[_0xcc57('0x25')][_0xcc57('0x27')]);}logger[_0xcc57('0x25')]('FreshsalesAccount,\x20%s,\x20%s',_0xf4a928,_0x2dbe56[_0xcc57('0x25')][_0xcc57('0x27')]);return _0x3530fe(_0x2dbe56[_0xcc57('0x25')][_0xcc57('0x27')]);}else{logger[_0xcc57('0x21')](_0xcc57('0x26'),_0xf4a928,_0xcc57('0x22'));_0x3530fe(_0x2dbe56[_0xcc57('0x28')]['message']);}})[_0xcc57('0x29')](function(_0xe647e8){logger[_0xcc57('0x25')](_0xcc57('0x26'),_0xf4a928,_0xe647e8);_0x116c78(_0xe647e8);});});}function respondWithStatusCode(_0x1f8f05,_0x2d8024){_0x2d8024=_0x2d8024||0xcc;return function(_0x46c829){if(_0x46c829){return _0x1f8f05[_0xcc57('0x2a')](_0x2d8024);}return _0x1f8f05[_0xcc57('0x2b')](_0x2d8024)[_0xcc57('0x2c')]();};}function respondWithResult(_0xecc241,_0x29d5d3){_0x29d5d3=_0x29d5d3||0xc8;return function(_0x2b6707){if(_0x2b6707){return _0xecc241['status'](_0x29d5d3)[_0xcc57('0x2d')](_0x2b6707);}};}function respondWithFilteredResult(_0x3383b2,_0x118290){return function(_0x1749a4){if(_0x1749a4){var _0x4f95f3=_0x1749a4[_0xcc57('0x2e')],_0x27054c=_0x118290[_0xcc57('0x2f')],_0x543380=_0x118290['offset']+_0x118290[_0xcc57('0x30')],_0xab5be1;if(_0x543380>=_0x4f95f3){_0x543380=_0x4f95f3;_0xab5be1=0xc8;}else{_0xab5be1=0xce;}_0x3383b2[_0xcc57('0x2b')](_0xab5be1);return _0x3383b2[_0xcc57('0x31')](_0xcc57('0x32'),_0x27054c+'-'+_0x543380+'/'+_0x4f95f3)['json'](_0x1749a4);}return null;};}function patchUpdates(_0x59cbf4){return function(_0x4ae82b){try{jsonpatch[_0xcc57('0x33')](_0x4ae82b,_0x59cbf4,!![]);}catch(_0x4136b2){return BPromise[_0xcc57('0x34')](_0x4136b2);}return _0x4ae82b[_0xcc57('0x35')]();};}function saveUpdates(_0x1861a6,_0x21374c){return function(_0x3d0c47){if(_0x3d0c47){return _0x3d0c47['update'](_0x1861a6)[_0xcc57('0x20')](function(_0x481087){return _0x481087;});}return null;};}function removeEntity(_0x30581f,_0x5295f4){return function(_0x5a7f4a){if(_0x5a7f4a){return _0x5a7f4a['destroy']()[_0xcc57('0x20')](function(){_0x30581f[_0xcc57('0x2b')](0xcc)[_0xcc57('0x2c')]();});}};}function handleEntityNotFound(_0x468384,_0x3209d2){return function(_0xd90f1d){if(!_0xd90f1d){_0x468384['sendStatus'](0x194);}return _0xd90f1d;};}function handleError(_0x5bbfd2,_0x28df58){_0x28df58=_0x28df58||0x1f4;return function(_0x3d9e93){logger[_0xcc57('0x25')](_0x3d9e93[_0xcc57('0x36')]);if(_0x3d9e93[_0xcc57('0x37')]){delete _0x3d9e93[_0xcc57('0x37')];}_0x5bbfd2[_0xcc57('0x2b')](_0x28df58)['send'](_0x3d9e93);};}exports[_0xcc57('0x38')]=function(_0x3c2256,_0x138cf4){var _0x100386={},_0x322d4={},_0x103d64={'count':0x0,'rows':[]};var _0x56b758=_['map'](db['FreshsalesAccount'][_0xcc57('0x39')],function(_0x290651){return{'name':_0x290651[_0xcc57('0x3a')],'type':_0x290651[_0xcc57('0x3b')][_0xcc57('0x3c')]};});_0x322d4[_0xcc57('0x3d')]=_['map'](_0x56b758,'name');_0x322d4[_0xcc57('0x3e')]=_[_0xcc57('0x3f')](_0x3c2256[_0xcc57('0x3e')]);_0x322d4[_0xcc57('0x40')]=_[_0xcc57('0x41')](_0x322d4[_0xcc57('0x3d')],_0x322d4[_0xcc57('0x3e')]);_0x100386[_0xcc57('0x42')]=_[_0xcc57('0x41')](_0x322d4[_0xcc57('0x3d')],qs[_0xcc57('0x43')](_0x3c2256[_0xcc57('0x3e')]['fields']));_0x100386[_0xcc57('0x42')]=_0x100386['attributes'][_0xcc57('0x44')]?_0x100386[_0xcc57('0x42')]:_0x322d4[_0xcc57('0x3d')];if(!_0x3c2256['query'][_0xcc57('0x45')](_0xcc57('0x46'))){_0x100386[_0xcc57('0x30')]=qs[_0xcc57('0x30')](_0x3c2256[_0xcc57('0x3e')][_0xcc57('0x30')]);_0x100386[_0xcc57('0x2f')]=qs[_0xcc57('0x2f')](_0x3c2256['query'][_0xcc57('0x2f')]);}_0x100386[_0xcc57('0x47')]=qs['sort'](_0x3c2256['query'][_0xcc57('0x48')]);_0x100386[_0xcc57('0x49')]=qs[_0xcc57('0x40')](_['pick'](_0x3c2256[_0xcc57('0x3e')],_0x322d4[_0xcc57('0x40')]));if(_0x3c2256[_0xcc57('0x3e')][_0xcc57('0x4a')]){_0x100386[_0xcc57('0x49')]=_['merge'](_0x100386['where'],{'$or':_[_0xcc57('0x4b')](_0x56b758,function(_0x4a03dd){if(_0x4a03dd[_0xcc57('0x3b')]!==_0xcc57('0x4c')){var _0x17ae1c={};_0x17ae1c[_0x4a03dd[_0xcc57('0x37')]]={'$like':'%'+_0x3c2256['query'][_0xcc57('0x4a')]+'%'};return _0x17ae1c;}})});}_0x100386=_[_0xcc57('0x4d')]({},_0x100386,_0x3c2256[_0xcc57('0x4e')]);var _0x321728={'where':_0x100386[_0xcc57('0x49')]};return db[_0xcc57('0x4f')][_0xcc57('0x2e')](_0x321728)[_0xcc57('0x20')](function(_0x590d71){_0x103d64['count']=_0x590d71;if(_0x3c2256[_0xcc57('0x3e')][_0xcc57('0x50')]){_0x100386[_0xcc57('0x51')]=[{'all':!![]}];}return db['FreshsalesAccount']['findAll'](_0x100386);})['then'](function(_0x381096){_0x103d64[_0xcc57('0x52')]=_0x381096;return _0x103d64;})['then'](respondWithFilteredResult(_0x138cf4,_0x100386))[_0xcc57('0x29')](handleError(_0x138cf4,null));};exports[_0xcc57('0x53')]=function(_0x1070a6,_0x2dee28){var _0x199e12={'raw':![],'where':{'id':_0x1070a6['params']['id']}},_0x3d8ac6={};_0x3d8ac6[_0xcc57('0x3d')]=_[_0xcc57('0x3f')](db[_0xcc57('0x4f')]['rawAttributes']);_0x3d8ac6[_0xcc57('0x3e')]=_[_0xcc57('0x3f')](_0x1070a6[_0xcc57('0x3e')]);_0x3d8ac6[_0xcc57('0x40')]=_[_0xcc57('0x41')](_0x3d8ac6[_0xcc57('0x3d')],_0x3d8ac6[_0xcc57('0x3e')]);_0x199e12[_0xcc57('0x42')]=_[_0xcc57('0x41')](_0x3d8ac6[_0xcc57('0x3d')],qs[_0xcc57('0x43')](_0x1070a6['query']['fields']));_0x199e12[_0xcc57('0x42')]=_0x199e12['attributes'][_0xcc57('0x44')]?_0x199e12[_0xcc57('0x42')]:_0x3d8ac6[_0xcc57('0x3d')];if(_0x1070a6[_0xcc57('0x3e')][_0xcc57('0x50')]){_0x199e12[_0xcc57('0x51')]=[{'all':!![]}];}_0x199e12=_[_0xcc57('0x4d')]({},_0x199e12,_0x1070a6[_0xcc57('0x4e')]);return db['FreshsalesAccount'][_0xcc57('0x54')](_0x199e12)[_0xcc57('0x20')](handleEntityNotFound(_0x2dee28,null))[_0xcc57('0x20')](respondWithResult(_0x2dee28,null))['catch'](handleError(_0x2dee28,null));};exports[_0xcc57('0x55')]=function(_0xe4e8d3,_0x3f2818){return db[_0xcc57('0x4f')][_0xcc57('0x55')](_0xe4e8d3[_0xcc57('0x56')],{})[_0xcc57('0x20')](respondWithResult(_0x3f2818,0xc9))['catch'](handleError(_0x3f2818,null));};exports[_0xcc57('0x57')]=function(_0x381fe0,_0x4d91b9){if(_0x381fe0[_0xcc57('0x56')]['id']){delete _0x381fe0[_0xcc57('0x56')]['id'];}return db['FreshsalesAccount'][_0xcc57('0x54')]({'where':{'id':_0x381fe0[_0xcc57('0x58')]['id']}})[_0xcc57('0x20')](handleEntityNotFound(_0x4d91b9,null))[_0xcc57('0x20')](saveUpdates(_0x381fe0[_0xcc57('0x56')],null))['then'](respondWithResult(_0x4d91b9,null))[_0xcc57('0x29')](handleError(_0x4d91b9,null));};exports[_0xcc57('0x59')]=function(_0x5a46c2,_0x29801b){return db[_0xcc57('0x4f')][_0xcc57('0x54')]({'where':{'id':_0x5a46c2[_0xcc57('0x58')]['id']}})[_0xcc57('0x20')](handleEntityNotFound(_0x29801b,null))[_0xcc57('0x20')](removeEntity(_0x29801b,null))[_0xcc57('0x29')](handleError(_0x29801b,null));};exports['getConfigurations']=function(_0x1d1f10,_0x1e2873,_0x2ab44a){var _0x1cbe5e={};var _0x4e5669={};var _0x4ebb87;var _0x6bb8a8;return db[_0xcc57('0x4f')][_0xcc57('0x5a')]({'where':{'id':_0x1d1f10[_0xcc57('0x58')]['id']}})[_0xcc57('0x20')](handleEntityNotFound(_0x1e2873,null))[_0xcc57('0x20')](function(_0x476d49){if(_0x476d49){_0x4ebb87=_0x476d49;_0x4e5669['model']=_['keys'](db[_0xcc57('0x5b')][_0xcc57('0x39')]);_0x4e5669[_0xcc57('0x3e')]=_[_0xcc57('0x3f')](_0x1d1f10['query']);_0x4e5669['filters']=_[_0xcc57('0x41')](_0x4e5669[_0xcc57('0x3d')],_0x4e5669[_0xcc57('0x3e')]);_0x1cbe5e['attributes']=_[_0xcc57('0x41')](_0x4e5669[_0xcc57('0x3d')],qs['fields'](_0x1d1f10[_0xcc57('0x3e')]['fields']));_0x1cbe5e['attributes']=_0x1cbe5e['attributes'][_0xcc57('0x44')]?_0x1cbe5e[_0xcc57('0x42')]:_0x4e5669['model'];_0x1cbe5e[_0xcc57('0x47')]=qs['sort'](_0x1d1f10[_0xcc57('0x3e')]['sort']);_0x1cbe5e[_0xcc57('0x49')]=qs[_0xcc57('0x40')](_['pick'](_0x1d1f10[_0xcc57('0x3e')],_0x4e5669['filters']));if(_0x1d1f10[_0xcc57('0x3e')][_0xcc57('0x4a')]){_0x1cbe5e['where']=_[_0xcc57('0x4d')](_0x1cbe5e[_0xcc57('0x49')],{'$or':_[_0xcc57('0x4b')](_0x1cbe5e[_0xcc57('0x42')],function(_0x562acd){var _0x201a4a={};_0x201a4a[_0x562acd]={'$like':'%'+_0x1d1f10[_0xcc57('0x3e')][_0xcc57('0x4a')]+'%'};return _0x201a4a;})});}_0x1cbe5e=_[_0xcc57('0x4d')]({},_0x1cbe5e,_0x1d1f10[_0xcc57('0x4e')]);return _0x4ebb87[_0xcc57('0x5c')](_0x1cbe5e);}})[_0xcc57('0x20')](function(_0x141ffa){if(_0x141ffa){_0x6bb8a8=_0x141ffa[_0xcc57('0x44')];if(!_0x1d1f10['query'][_0xcc57('0x45')](_0xcc57('0x46'))){_0x1cbe5e[_0xcc57('0x30')]=qs[_0xcc57('0x30')](_0x1d1f10[_0xcc57('0x3e')][_0xcc57('0x30')]);_0x1cbe5e[_0xcc57('0x2f')]=qs[_0xcc57('0x2f')](_0x1d1f10[_0xcc57('0x3e')][_0xcc57('0x2f')]);}return _0x4ebb87['getConfigurations'](_0x1cbe5e);}})[_0xcc57('0x20')](function(_0x3c6e77){if(_0x3c6e77){return _0x3c6e77?{'count':_0x6bb8a8,'rows':_0x3c6e77}:null;}})[_0xcc57('0x20')](respondWithResult(_0x1e2873,null))[_0xcc57('0x29')](handleError(_0x1e2873,null));};exports[_0xcc57('0x5d')]=function(_0x49aa6d,_0x7d8259,_0x3f8b1f){if(_0x49aa6d[_0xcc57('0x56')]['id']){delete _0x49aa6d['body']['id'];}return db['FreshsalesAccount'][_0xcc57('0x5a')]({'where':{'id':_0x49aa6d[_0xcc57('0x58')]['id']}})[_0xcc57('0x20')](handleEntityNotFound(_0x7d8259,null))['then'](function(_0x176769){if(_0x176769){_0x49aa6d[_0xcc57('0x56')]['AccountId']=_0x176769['id'];_0x49aa6d['body'][_0xcc57('0x5e')]=integrations[_0xcc57('0x5f')](_0x49aa6d[_0xcc57('0x56')][_0xcc57('0x60')],_0x49aa6d[_0xcc57('0x56')][_0xcc57('0x3b')]);_0x49aa6d[_0xcc57('0x56')][_0xcc57('0x61')]=integrations[_0xcc57('0x62')](_0x49aa6d[_0xcc57('0x56')][_0xcc57('0x60')],_0x49aa6d[_0xcc57('0x56')]['type']);return db[_0xcc57('0x5b')][_0xcc57('0x55')](_0x49aa6d[_0xcc57('0x56')],{'include':[{'model':db['FreshsalesField'],'as':_0xcc57('0x5e')},{'model':db[_0xcc57('0x63')],'as':_0xcc57('0x61')}]});}return null;})['then'](respondWithResult(_0x7d8259,null))[_0xcc57('0x29')](handleError(_0x7d8259,null));};exports[_0xcc57('0x64')]=function(_0x10083e,_0x3e9de5,_0x1dc359){var _0x5e8955='';var _0x23cd7f='';return db[_0xcc57('0x4f')][_0xcc57('0x5a')]({'where':{'id':_0x10083e[_0xcc57('0x58')]['id']},'attributes':['id',_0xcc57('0x65'),_0xcc57('0x66'),_0xcc57('0x67')]})[_0xcc57('0x20')](handleEntityNotFound(_0x3e9de5,null))[_0xcc57('0x20')](function(_0x39c840){if(_0x39c840){_0x23cd7f=_0x39c840['username'];_0x5e8955=_0x39c840['remoteUri'];var _0x5e9cdd=_0x39c840[_0xcc57('0x66')]['slice'](-0x1);if(_0x5e9cdd==='/'){_0x5e8955=_0x5e8955[_0xcc57('0x68')](0x0,_0x5e8955['lastIndexOf'](_0x5e9cdd));}return rp({'method':_0xcc57('0x69'),'uri':util[_0xcc57('0x6a')](_0xcc57('0x6b'),_0x5e8955,_0xcc57('0x6c')),'headers':{'Authorization':'Token\x20token='+_0x39c840[_0xcc57('0x67')]},'json':!![]});}})[_0xcc57('0x20')](function(_0x136115){if(_0x136115){var _0x2d7b2a=_0x136115[_0xcc57('0x6d')];var _0x557df1=![];var _0x430ae9=null;for(_0x430ae9=0x0;_0x430ae9<_0x2d7b2a[_0xcc57('0x44')];_0x430ae9++){if(_0x2d7b2a[_0x430ae9][_0xcc57('0x6e')]===_0x23cd7f){_0x557df1=!![];}}if(_0x557df1){return!![];}else{throw new Error({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}})[_0xcc57('0x20')](respondWithResult(_0x3e9de5,null))[_0xcc57('0x29')](function(_0x3fecdf){var _0x30e300=_0x10083e[_0xcc57('0x3e')][_0xcc57('0x1d')]?0x1f4:_0x3fecdf[_0xcc57('0x6f')]||0x1f4;logger['error'](_0xcc57('0x70'),_0xcc57('0x64'),_0x30e300,JSON[_0xcc57('0x24')](_0x3fecdf));delete _0x3fecdf[_0xcc57('0x37')];if(_0x30e300===0x191){_0x30e300=0x190;}_0x3e9de5[_0xcc57('0x2b')](_0x30e300)[_0xcc57('0x71')](_0x10083e[_0xcc57('0x3e')][_0xcc57('0x1d')]?{'message':_0xcc57('0x72'),'statusCode':_0x3fecdf[_0xcc57('0x6f')]}:_0x3fecdf);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index aff58b6..8ab6702 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xabfc=['define','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshsalesAccount.attributes','exports'];(function(_0x2ad52a,_0x41a2be){var _0x1d3497=function(_0x4b1930){while(--_0x4b1930){_0x2ad52a['push'](_0x2ad52a['shift']());}};_0x1d3497(++_0x41a2be);}(_0xabfc,0x137));var _0xcabf=function(_0x173113,_0x316a7c){_0x173113=_0x173113-0x0;var _0x3bea89=_0xabfc[_0x173113];return _0x3bea89;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xcabf('0x0'))('api');var moment=require(_0xcabf('0x1'));var BPromise=require(_0xcabf('0x2'));var rp=require(_0xcabf('0x3'));var fs=require('fs');var path=require(_0xcabf('0x4'));var rimraf=require(_0xcabf('0x5'));var config=require(_0xcabf('0x6'));var attributes=require(_0xcabf('0x7'));var integrations=require('../../components/integrations/configuration');module[_0xcabf('0x8')]=function(_0x27c5b8,_0x5db325){return _0x27c5b8[_0xcabf('0x9')]('FreshsalesAccount',attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf55c=['moment','bluebird','request-promise','path','rimraf','./intFreshsalesAccount.attributes','../../components/integrations/configuration','exports','define','FreshsalesAccount','int_freshsales_accounts','lodash','../../config/logger','api'];(function(_0x3a852a,_0xf3f1d3){var _0x48c902=function(_0x22cdd1){while(--_0x22cdd1){_0x3a852a['push'](_0x3a852a['shift']());}};_0x48c902(++_0xf3f1d3);}(_0xf55c,0x1e7));var _0xcf55=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xf55c[_0x4fc9e6];return _0x551d28;};'use strict';var _=require(_0xcf55('0x0'));var util=require('util');var logger=require(_0xcf55('0x1'))(_0xcf55('0x2'));var moment=require(_0xcf55('0x3'));var BPromise=require(_0xcf55('0x4'));var rp=require(_0xcf55('0x5'));var fs=require('fs');var path=require(_0xcf55('0x6'));var rimraf=require(_0xcf55('0x7'));var config=require('../../config/environment');var attributes=require(_0xcf55('0x8'));var integrations=require(_0xcf55('0x9'));module[_0xcf55('0xa')]=function(_0x3a6de7,_0x4b3453){return _0x3a6de7[_0xcf55('0xb')](_0xcf55('0xc'),attributes,{'tableName':_0xcf55('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 94eefa5..7c58666 100644 --- a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js +++ b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8325=['ShowFreshsalesAccount','find','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetFreshsalesAccount','FreshsalesAccount','findAll','options','where','map','model','attributes','include','stringify','catch'];(function(_0x1a0600,_0x41feef){var _0x734670=function(_0x2da4e4){while(--_0x2da4e4){_0x1a0600['push'](_0x1a0600['shift']());}};_0x734670(++_0x41feef);}(_0x8325,0x1f1));var _0x5832=function(_0x1dcb9b,_0x1befc2){_0x1dcb9b=_0x1dcb9b-0x0;var _0x2870f0=_0x8325[_0x1dcb9b];return _0x2870f0;};'use strict';var _=require(_0x5832('0x0'));var util=require('util');var moment=require(_0x5832('0x1'));var BPromise=require('bluebird');var rs=require(_0x5832('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5832('0x3'))['db'];var utils=require(_0x5832('0x4'));var logger=require(_0x5832('0x5'))(_0x5832('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5832('0x7')][_0x5832('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x8b3b30,_0xe80d1d,_0xb4e9b9){return new BPromise(function(_0x333780,_0x495531){return client[_0x5832('0x9')](_0x8b3b30,_0xb4e9b9)[_0x5832('0xa')](function(_0x10192d){logger[_0x5832('0xb')](_0x5832('0xc'),_0xe80d1d,_0x5832('0xd'));logger[_0x5832('0xe')](_0x5832('0xf'),_0xe80d1d,_0x5832('0xd'),JSON['stringify'](_0x10192d));if(_0x10192d['error']){if(_0x10192d[_0x5832('0x10')][_0x5832('0x11')]===0x1f4){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error']['message']);return _0x495531(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x10192d['error'][_0x5832('0x12')]);return _0x333780(_0x10192d[_0x5832('0x10')][_0x5832('0x12')]);}else{logger[_0x5832('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0xe80d1d,_0x5832('0xd'));_0x333780(_0x10192d[_0x5832('0x13')][_0x5832('0x12')]);}})['catch'](function(_0x32d360){logger[_0x5832('0x10')](_0x5832('0xc'),_0xe80d1d,_0x32d360);_0x495531(_0x32d360);});});}exports[_0x5832('0x14')]=function(_0x1f986d){var _0x3598f5=this;return new Promise(function(_0x2c929f,_0xc466d0){return db[_0x5832('0x15')][_0x5832('0x16')]({'raw':_0x1f986d['options']?_0x1f986d[_0x5832('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x1f986d['options']?_0x1f986d['options'][_0x5832('0x18')]||null:null,'attributes':_0x1f986d['options']?_0x1f986d['options']['attributes']||null:null,'limit':_0x1f986d['options']?_0x1f986d[_0x5832('0x17')]['limit']||null:null,'include':_0x1f986d['options']?_0x1f986d[_0x5832('0x17')]['include']?_[_0x5832('0x19')](_0x1f986d['options']['include'],function(_0x5de263){return{'model':db[_0x5de263[_0x5832('0x1a')]],'as':_0x5de263['as'],'attributes':_0x5de263[_0x5832('0x1b')],'include':_0x5de263[_0x5832('0x1c')]?_[_0x5832('0x19')](_0x5de263['include'],function(_0x52bc08){return{'model':db[_0x52bc08[_0x5832('0x1a')]],'as':_0x52bc08['as'],'attributes':_0x52bc08[_0x5832('0x1b')],'include':_0x52bc08['include']?_[_0x5832('0x19')](_0x52bc08[_0x5832('0x1c')],function(_0x5bd864){return{'model':db[_0x5bd864[_0x5832('0x1a')]],'as':_0x5bd864['as'],'attributes':_0x5bd864[_0x5832('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5832('0xa')](function(_0x32b4da){logger[_0x5832('0xb')](_0x5832('0x14'),_0x1f986d);logger[_0x5832('0xe')](_0x5832('0x14'),_0x1f986d,JSON[_0x5832('0x1d')](_0x32b4da));_0x2c929f(_0x32b4da);})[_0x5832('0x1e')](function(_0xdb70aa){logger['error'](_0x5832('0x14'),_0xdb70aa[_0x5832('0x12')],_0x1f986d);_0xc466d0(_0x3598f5[_0x5832('0x10')](0x1f4,_0xdb70aa['message']));});});};exports[_0x5832('0x1f')]=function(_0x5d3828){var _0x47cd38=this;return new Promise(function(_0x227873,_0x4603d5){return db[_0x5832('0x15')][_0x5832('0x20')]({'raw':_0x5d3828['options']?_0x5d3828[_0x5832('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x5d3828[_0x5832('0x17')]?_0x5d3828[_0x5832('0x17')][_0x5832('0x18')]||null:null,'attributes':_0x5d3828[_0x5832('0x17')]?_0x5d3828[_0x5832('0x17')][_0x5832('0x1b')]||null:null,'include':_0x5d3828['options']?_0x5d3828[_0x5832('0x17')]['include']?_['map'](_0x5d3828[_0x5832('0x17')][_0x5832('0x1c')],function(_0x2bc0c7){return{'model':db[_0x2bc0c7[_0x5832('0x1a')]],'as':_0x2bc0c7['as'],'attributes':_0x2bc0c7[_0x5832('0x1b')],'include':_0x2bc0c7[_0x5832('0x1c')]?_[_0x5832('0x19')](_0x2bc0c7[_0x5832('0x1c')],function(_0x5434bb){return{'model':db[_0x5434bb[_0x5832('0x1a')]],'as':_0x5434bb['as'],'attributes':_0x5434bb['attributes'],'include':_0x5434bb[_0x5832('0x1c')]?_[_0x5832('0x19')](_0x5434bb[_0x5832('0x1c')],function(_0x7e1f88){return{'model':db[_0x7e1f88['model']],'as':_0x7e1f88['as'],'attributes':_0x7e1f88[_0x5832('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x5832('0xa')](function(_0x38d21b){logger[_0x5832('0xb')](_0x5832('0x1f'),_0x5d3828);logger[_0x5832('0xe')](_0x5832('0x1f'),_0x5d3828,JSON[_0x5832('0x1d')](_0x38d21b));_0x227873(_0x38d21b);})['catch'](function(_0x571a5a){logger[_0x5832('0x10')]('ShowFreshsalesAccount',_0x571a5a[_0x5832('0x12')],_0x5d3828);_0x4603d5(_0x47cd38[_0x5832('0x10')](0x1f4,_0x571a5a[_0x5832('0x12')]));});});}; \ No newline at end of file +var _0x508a=['stringify','error','code','message','result','catch','GetFreshsalesAccount','FreshsalesAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowFreshsalesAccount','find','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_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 moment=require(_0xa508('0x1'));var BPromise=require(_0xa508('0x2'));var rs=require(_0xa508('0x3'));var fs=require('fs');var Redis=require(_0xa508('0x4'));var db=require(_0xa508('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa508('0x6'))(_0xa508('0x7'));var config=require(_0xa508('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xa508('0x9')][_0xa508('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x406df0,_0x4ddfec,_0x284fb1){return new BPromise(function(_0x6f201c,_0x4f6c23){return client[_0xa508('0xb')](_0x406df0,_0x284fb1)[_0xa508('0xc')](function(_0x577617){logger[_0xa508('0xd')](_0xa508('0xe'),_0x4ddfec,_0xa508('0xf'));logger[_0xa508('0x10')](_0xa508('0x11'),_0x4ddfec,'request\x20sent',JSON[_0xa508('0x12')](_0x577617));if(_0x577617[_0xa508('0x13')]){if(_0x577617['error'][_0xa508('0x14')]===0x1f4){logger[_0xa508('0x13')](_0xa508('0xe'),_0x4ddfec,_0x577617['error'][_0xa508('0x15')]);return _0x4f6c23(_0x577617['error'][_0xa508('0x15')]);}logger[_0xa508('0x13')](_0xa508('0xe'),_0x4ddfec,_0x577617[_0xa508('0x13')]['message']);return _0x6f201c(_0x577617[_0xa508('0x13')][_0xa508('0x15')]);}else{logger[_0xa508('0xd')](_0xa508('0xe'),_0x4ddfec,'request\x20sent');_0x6f201c(_0x577617[_0xa508('0x16')][_0xa508('0x15')]);}})[_0xa508('0x17')](function(_0xb76bf){logger['error'](_0xa508('0xe'),_0x4ddfec,_0xb76bf);_0x4f6c23(_0xb76bf);});});}exports[_0xa508('0x18')]=function(_0x5e29a8){var _0x5d345d=this;return new Promise(function(_0x1984ae,_0x226024){return db[_0xa508('0x19')][_0xa508('0x1a')]({'raw':_0x5e29a8[_0xa508('0x1b')]?_0x5e29a8[_0xa508('0x1b')][_0xa508('0x1c')]===undefined?!![]:![]:!![],'where':_0x5e29a8[_0xa508('0x1b')]?_0x5e29a8['options'][_0xa508('0x1d')]||null:null,'attributes':_0x5e29a8[_0xa508('0x1b')]?_0x5e29a8[_0xa508('0x1b')][_0xa508('0x1e')]||null:null,'limit':_0x5e29a8[_0xa508('0x1b')]?_0x5e29a8['options'][_0xa508('0x1f')]||null:null,'include':_0x5e29a8['options']?_0x5e29a8[_0xa508('0x1b')][_0xa508('0x20')]?_['map'](_0x5e29a8[_0xa508('0x1b')][_0xa508('0x20')],function(_0x14ca1c){return{'model':db[_0x14ca1c[_0xa508('0x21')]],'as':_0x14ca1c['as'],'attributes':_0x14ca1c['attributes'],'include':_0x14ca1c['include']?_['map'](_0x14ca1c[_0xa508('0x20')],function(_0x2cda06){return{'model':db[_0x2cda06[_0xa508('0x21')]],'as':_0x2cda06['as'],'attributes':_0x2cda06[_0xa508('0x1e')],'include':_0x2cda06[_0xa508('0x20')]?_[_0xa508('0x22')](_0x2cda06[_0xa508('0x20')],function(_0x4be5bf){return{'model':db[_0x4be5bf['model']],'as':_0x4be5bf['as'],'attributes':_0x4be5bf[_0xa508('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xa508('0xc')](function(_0x47d93b){logger[_0xa508('0xd')]('GetFreshsalesAccount',_0x5e29a8);logger[_0xa508('0x10')](_0xa508('0x18'),_0x5e29a8,JSON['stringify'](_0x47d93b));_0x1984ae(_0x47d93b);})[_0xa508('0x17')](function(_0x2ca53f){logger[_0xa508('0x13')](_0xa508('0x18'),_0x2ca53f['message'],_0x5e29a8);_0x226024(_0x5d345d[_0xa508('0x13')](0x1f4,_0x2ca53f[_0xa508('0x15')]));});});};exports[_0xa508('0x23')]=function(_0x5d971d){var _0x2affae=this;return new Promise(function(_0x391ba7,_0x4a7161){return db['FreshsalesAccount'][_0xa508('0x24')]({'raw':_0x5d971d['options']?_0x5d971d['options'][_0xa508('0x1c')]===undefined?!![]:![]:!![],'where':_0x5d971d['options']?_0x5d971d['options'][_0xa508('0x1d')]||null:null,'attributes':_0x5d971d[_0xa508('0x1b')]?_0x5d971d['options'][_0xa508('0x1e')]||null:null,'include':_0x5d971d[_0xa508('0x1b')]?_0x5d971d[_0xa508('0x1b')]['include']?_['map'](_0x5d971d[_0xa508('0x1b')][_0xa508('0x20')],function(_0x2a74dc){return{'model':db[_0x2a74dc[_0xa508('0x21')]],'as':_0x2a74dc['as'],'attributes':_0x2a74dc[_0xa508('0x1e')],'include':_0x2a74dc[_0xa508('0x20')]?_[_0xa508('0x22')](_0x2a74dc[_0xa508('0x20')],function(_0x374293){return{'model':db[_0x374293[_0xa508('0x21')]],'as':_0x374293['as'],'attributes':_0x374293[_0xa508('0x1e')],'include':_0x374293['include']?_[_0xa508('0x22')](_0x374293[_0xa508('0x20')],function(_0x453e4e){return{'model':db[_0x453e4e[_0xa508('0x21')]],'as':_0x453e4e['as'],'attributes':_0x453e4e['attributes']};}):[]};}):[]};}):[]:[]})[_0xa508('0xc')](function(_0x3de64d){logger[_0xa508('0xd')]('ShowFreshsalesAccount',_0x5d971d);logger[_0xa508('0x10')](_0xa508('0x23'),_0x5d971d,JSON[_0xa508('0x12')](_0x3de64d));_0x391ba7(_0x3de64d);})['catch'](function(_0x4cc50e){logger[_0xa508('0x13')](_0xa508('0x23'),_0x4cc50e[_0xa508('0x15')],_0x5d971d);_0x4a7161(_0x2affae[_0xa508('0x13')](0x1f4,_0x4cc50e['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index e891bb7..042d810 100644 --- a/server/api/intFreshsalesConfiguration/index.js +++ b/server/api/intFreshsalesConfiguration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9b1a=['update','destroy','exports','multer','path','connect-timeout','../../config/environment','./intFreshsalesConfiguration.controller','isAuthenticated','index','get','/:id','getSubjects','/:id/descriptions','getDescriptions','getFields','post','create','put'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x9b1a,0x1de));var _0xa9b1=function(_0x1ab180,_0x382b2c){_0x1ab180=_0x1ab180-0x0;var _0xfb2c2d=_0x9b1a[_0x1ab180];return _0xfb2c2d;};'use strict';var multer=require(_0xa9b1('0x0'));var util=require('util');var path=require(_0xa9b1('0x1'));var timeout=require(_0xa9b1('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xa9b1('0x3'));var controller=require(_0xa9b1('0x4'));router['get']('/',auth[_0xa9b1('0x5')](),controller[_0xa9b1('0x6')]);router[_0xa9b1('0x7')](_0xa9b1('0x8'),auth[_0xa9b1('0x5')](),controller['show']);router['get']('/:id/subjects',auth[_0xa9b1('0x5')](),controller[_0xa9b1('0x9')]);router[_0xa9b1('0x7')](_0xa9b1('0xa'),auth[_0xa9b1('0x5')](),controller[_0xa9b1('0xb')]);router[_0xa9b1('0x7')]('/:id/fields',auth['isAuthenticated'](),controller[_0xa9b1('0xc')]);router[_0xa9b1('0xd')]('/',auth[_0xa9b1('0x5')](),controller[_0xa9b1('0xe')]);router[_0xa9b1('0xf')](_0xa9b1('0x8'),auth['isAuthenticated'](),controller[_0xa9b1('0x10')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa9b1('0x11')]);module[_0xa9b1('0x12')]=router; \ No newline at end of file +var _0x2759=['getSubjects','/:id/descriptions','getDescriptions','/:id/fields','getFields','post','put','/:id','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','show','/:id/subjects'];(function(_0x4a06e3,_0x16b3ec){var _0x2496a1=function(_0x16a831){while(--_0x16a831){_0x4a06e3['push'](_0x4a06e3['shift']());}};_0x2496a1(++_0x16b3ec);}(_0x2759,0xe2));var _0x9275=function(_0x105aaa,_0x358e95){_0x105aaa=_0x105aaa-0x0;var _0xe4b1fa=_0x2759[_0x105aaa];return _0xe4b1fa;};'use strict';var multer=require(_0x9275('0x0'));var util=require(_0x9275('0x1'));var path=require(_0x9275('0x2'));var timeout=require(_0x9275('0x3'));var express=require('express');var router=express[_0x9275('0x4')]();var auth=require(_0x9275('0x5'));var interaction=require(_0x9275('0x6'));var config=require(_0x9275('0x7'));var controller=require(_0x9275('0x8'));router[_0x9275('0x9')]('/',auth[_0x9275('0xa')](),controller[_0x9275('0xb')]);router['get']('/:id',auth[_0x9275('0xa')](),controller[_0x9275('0xc')]);router[_0x9275('0x9')](_0x9275('0xd'),auth[_0x9275('0xa')](),controller[_0x9275('0xe')]);router[_0x9275('0x9')](_0x9275('0xf'),auth[_0x9275('0xa')](),controller[_0x9275('0x10')]);router[_0x9275('0x9')](_0x9275('0x11'),auth[_0x9275('0xa')](),controller[_0x9275('0x12')]);router[_0x9275('0x13')]('/',auth[_0x9275('0xa')](),controller['create']);router[_0x9275('0x14')](_0x9275('0x15'),auth[_0x9275('0xa')](),controller['update']);router[_0x9275('0x16')](_0x9275('0x15'),auth[_0x9275('0xa')](),controller['destroy']);module[_0x9275('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 0fa3b22..f85b8b1 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8534=['STRING','sequelize','exports'];(function(_0x2a7b50,_0x545d55){var _0x4224c9=function(_0x2b96f6){while(--_0x2b96f6){_0x2a7b50['push'](_0x2a7b50['shift']());}};_0x4224c9(++_0x545d55);}(_0x8534,0xbe));var _0x4853=function(_0x360f24,_0x1fc85b){_0x360f24=_0x360f24-0x0;var _0x1212b7=_0x8534[_0x360f24];return _0x1212b7;};'use strict';var Sequelize=require(_0x4853('0x0'));module[_0x4853('0x1')]={'name':{'type':Sequelize[_0x4853('0x2')]},'description':{'type':Sequelize[_0x4853('0x2')]}}; \ No newline at end of file +var _0xb28c=['STRING'];(function(_0x24dad7,_0x466ce5){var _0x5c395b=function(_0x32609b){while(--_0x32609b){_0x24dad7['push'](_0x24dad7['shift']());}};_0x5c395b(++_0x466ce5);}(_0xb28c,0x87));var _0xcb28=function(_0x26da71,_0x5a8d99){_0x26da71=_0x26da71-0x0;var _0x4b1e21=_0xb28c[_0x26da71];return _0x4b1e21;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xcb28('0x0')]},'description':{'type':Sequelize[_0xcb28('0x0')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 29aa703..38659c6 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x535f=['body','getSubjects','findOne','FreshsalesField','pick','filter','getDescriptions','order','getFields','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','FreshsalesConfiguration','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','merge','includeAll','include','show','params','options','find','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x535f,0x111));var _0xf535=function(_0x3ef5a9,_0x4a2ac6){_0x3ef5a9=_0x3ef5a9-0x0;var _0x272e9a=_0x535f[_0x3ef5a9];return _0x272e9a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf535('0x0'));var rimraf=require(_0xf535('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf535('0x2'));var rp=require(_0xf535('0x3'));var moment=require(_0xf535('0x4'));var BPromise=require(_0xf535('0x5'));var Mustache=require('mustache');var util=require(_0xf535('0x6'));var path=require(_0xf535('0x7'));var sox=require(_0xf535('0x8'));var csv=require(_0xf535('0x9'));var ejs=require(_0xf535('0xa'));var fs=require('fs');var _=require(_0xf535('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf535('0xc'));var deskjs=require(_0xf535('0xd'));var toCsv=require(_0xf535('0x9'));var querystring=require('querystring');var Papa=require(_0xf535('0xe'));var Redis=require(_0xf535('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf535('0x10'));var hardwareService=require(_0xf535('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0xf535('0x12'));var config=require(_0xf535('0x13'));var db=require(_0xf535('0x14'))['db'];var jayson=require(_0xf535('0x15'));var client=jayson[_0xf535('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x11928e,_0x27e116,_0x203d91){if(_0x203d91){var _0x1fbab6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1fbab6[_0xf535('0x17')](_0x27e116)){return _0x11928e;}else{throw new db[(_0xf535('0x18'))][(_0xf535('0x19'))](_0xf535('0x1a'));}}else{return _0x11928e;}}function respondWithRpcPromise(_0x34822b,_0xb52d7f,_0xc3db30,_0x4dacbb){return new BPromise(function(_0x938e7f,_0x1e3500){var _0x302a4e=_0x4dacbb||client;return _0x302a4e[_0xf535('0x1b')](_0x34822b,_0xc3db30)[_0xf535('0x1c')](function(_0x1fb901){logger[_0xf535('0x1d')](_0xf535('0x1e'),_0xb52d7f,_0xf535('0x1f'));logger[_0xf535('0x20')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0xb52d7f,_0xf535('0x1f'),JSON[_0xf535('0x21')](_0x1fb901));if(_0x1fb901[_0xf535('0x22')]){if(_0x1fb901[_0xf535('0x22')]['code']===0x1f4){logger[_0xf535('0x22')](_0xf535('0x1e'),_0xb52d7f,_0x1fb901['error']['message']);return _0x1e3500(_0x1fb901['error'][_0xf535('0x23')]);}logger[_0xf535('0x22')](_0xf535('0x1e'),_0xb52d7f,_0x1fb901['error']['message']);return _0x938e7f(_0x1fb901[_0xf535('0x22')][_0xf535('0x23')]);}else{logger[_0xf535('0x1d')](_0xf535('0x1e'),_0xb52d7f,_0xf535('0x1f'));_0x938e7f(_0x1fb901[_0xf535('0x24')][_0xf535('0x23')]);}})[_0xf535('0x25')](function(_0x3482a2){logger[_0xf535('0x22')](_0xf535('0x1e'),_0xb52d7f,_0x3482a2);_0x1e3500(_0x3482a2);});});}function respondWithStatusCode(_0x5b3917,_0x44ce19){_0x44ce19=_0x44ce19||0xcc;return function(_0x28e761){if(_0x28e761){return _0x5b3917[_0xf535('0x26')](_0x44ce19);}return _0x5b3917[_0xf535('0x27')](_0x44ce19)[_0xf535('0x28')]();};}function respondWithResult(_0x1250a0,_0x351b3a){_0x351b3a=_0x351b3a||0xc8;return function(_0x104b6a){if(_0x104b6a){return _0x1250a0[_0xf535('0x27')](_0x351b3a)[_0xf535('0x29')](_0x104b6a);}};}function respondWithFilteredResult(_0x39e3a1,_0x11cc78){return function(_0x506533){if(_0x506533){var _0x5d1887=_0x506533[_0xf535('0x2a')],_0x47151e=_0x11cc78[_0xf535('0x2b')],_0x12a94a=_0x11cc78['offset']+_0x11cc78[_0xf535('0x2c')],_0xfba892;if(_0x12a94a>=_0x5d1887){_0x12a94a=_0x5d1887;_0xfba892=0xc8;}else{_0xfba892=0xce;}_0x39e3a1['status'](_0xfba892);return _0x39e3a1[_0xf535('0x2d')](_0xf535('0x2e'),_0x47151e+'-'+_0x12a94a+'/'+_0x5d1887)[_0xf535('0x29')](_0x506533);}return null;};}function patchUpdates(_0x1e432d){return function(_0x3463da){try{jsonpatch[_0xf535('0x2f')](_0x3463da,_0x1e432d,!![]);}catch(_0x1a213d){return BPromise['reject'](_0x1a213d);}return _0x3463da[_0xf535('0x30')]();};}function saveUpdates(_0x3c71cf,_0x4193ae){return function(_0x21e225){if(_0x21e225){return _0x21e225[_0xf535('0x31')](_0x3c71cf)[_0xf535('0x1c')](function(_0x3ed51f){return _0x3ed51f;});}return null;};}function removeEntity(_0x878b51,_0xb6f808){return function(_0x536ba7){if(_0x536ba7){return _0x536ba7[_0xf535('0x32')]()['then'](function(){_0x878b51['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x409c5f,_0x331b95){return function(_0x19b1e4){if(!_0x19b1e4){_0x409c5f['sendStatus'](0x194);}return _0x19b1e4;};}function handleError(_0x22acf9,_0x2b64a2){_0x2b64a2=_0x2b64a2||0x1f4;return function(_0x38a31a){logger[_0xf535('0x22')](_0x38a31a[_0xf535('0x33')]);if(_0x38a31a[_0xf535('0x34')]){delete _0x38a31a['name'];}_0x22acf9['status'](_0x2b64a2)['send'](_0x38a31a);};}exports['index']=function(_0x4dae87,_0x4a1b36){var _0x538e9f={},_0x53dedd={},_0x2889ed={'count':0x0,'rows':[]};var _0x422de2=_['map'](db[_0xf535('0x35')][_0xf535('0x36')],function(_0x4eaa7d){return{'name':_0x4eaa7d[_0xf535('0x37')],'type':_0x4eaa7d[_0xf535('0x38')][_0xf535('0x39')]};});_0x53dedd['model']=_[_0xf535('0x3a')](_0x422de2,_0xf535('0x34'));_0x53dedd[_0xf535('0x3b')]=_[_0xf535('0x3c')](_0x4dae87['query']);_0x53dedd[_0xf535('0x3d')]=_[_0xf535('0x3e')](_0x53dedd[_0xf535('0x3f')],_0x53dedd[_0xf535('0x3b')]);_0x538e9f['attributes']=_[_0xf535('0x3e')](_0x53dedd[_0xf535('0x3f')],qs['fields'](_0x4dae87[_0xf535('0x3b')][_0xf535('0x40')]));_0x538e9f['attributes']=_0x538e9f['attributes'][_0xf535('0x41')]?_0x538e9f[_0xf535('0x42')]:_0x53dedd[_0xf535('0x3f')];if(!_0x4dae87[_0xf535('0x3b')][_0xf535('0x43')](_0xf535('0x44'))){_0x538e9f[_0xf535('0x2c')]=qs['limit'](_0x4dae87[_0xf535('0x3b')]['limit']);_0x538e9f[_0xf535('0x2b')]=qs['offset'](_0x4dae87[_0xf535('0x3b')]['offset']);}_0x538e9f['order']=qs[_0xf535('0x45')](_0x4dae87['query'][_0xf535('0x45')]);_0x538e9f['where']=qs[_0xf535('0x3d')](_['pick'](_0x4dae87[_0xf535('0x3b')],_0x53dedd[_0xf535('0x3d')]));if(_0x4dae87['query']['filter']){_0x538e9f[_0xf535('0x46')]=_[_0xf535('0x47')](_0x538e9f[_0xf535('0x46')],{'$or':_['map'](_0x422de2,function(_0x493c64){if(_0x493c64[_0xf535('0x38')]!=='VIRTUAL'){var _0x163e1d={};_0x163e1d[_0x493c64['name']]={'$like':'%'+_0x4dae87[_0xf535('0x3b')]['filter']+'%'};return _0x163e1d;}})});}_0x538e9f=_[_0xf535('0x47')]({},_0x538e9f,_0x4dae87['options']);var _0x70059e={'where':_0x538e9f[_0xf535('0x46')]};return db[_0xf535('0x35')][_0xf535('0x2a')](_0x70059e)[_0xf535('0x1c')](function(_0xc23b4){_0x2889ed[_0xf535('0x2a')]=_0xc23b4;if(_0x4dae87['query'][_0xf535('0x48')]){_0x538e9f[_0xf535('0x49')]=[{'all':!![]}];}return db[_0xf535('0x35')]['findAll'](_0x538e9f);})[_0xf535('0x1c')](function(_0x1e8894){_0x2889ed['rows']=_0x1e8894;return _0x2889ed;})['then'](respondWithFilteredResult(_0x4a1b36,_0x538e9f))['catch'](handleError(_0x4a1b36,null));};exports[_0xf535('0x4a')]=function(_0x1840c7,_0x42751b){var _0x3096ff={'raw':![],'where':{'id':_0x1840c7[_0xf535('0x4b')]['id']}},_0x1e89cb={};_0x1e89cb[_0xf535('0x3f')]=_['keys'](db['FreshsalesConfiguration'][_0xf535('0x36')]);_0x1e89cb[_0xf535('0x3b')]=_[_0xf535('0x3c')](_0x1840c7[_0xf535('0x3b')]);_0x1e89cb['filters']=_[_0xf535('0x3e')](_0x1e89cb['model'],_0x1e89cb[_0xf535('0x3b')]);_0x3096ff[_0xf535('0x42')]=_[_0xf535('0x3e')](_0x1e89cb[_0xf535('0x3f')],qs[_0xf535('0x40')](_0x1840c7[_0xf535('0x3b')][_0xf535('0x40')]));_0x3096ff['attributes']=_0x3096ff[_0xf535('0x42')][_0xf535('0x41')]?_0x3096ff[_0xf535('0x42')]:_0x1e89cb['model'];if(_0x1840c7[_0xf535('0x3b')][_0xf535('0x48')]){_0x3096ff[_0xf535('0x49')]=[{'all':!![]}];}_0x3096ff=_[_0xf535('0x47')]({},_0x3096ff,_0x1840c7[_0xf535('0x4c')]);return db['FreshsalesConfiguration'][_0xf535('0x4d')](_0x3096ff)['then'](handleEntityNotFound(_0x42751b,null))[_0xf535('0x1c')](respondWithResult(_0x42751b,null))[_0xf535('0x25')](handleError(_0x42751b,null));};exports['create']=function(_0x4d1d46,_0x5a2415){return db[_0xf535('0x35')][_0xf535('0x4e')](_0x4d1d46[_0xf535('0x4f')],{})[_0xf535('0x1c')](respondWithResult(_0x5a2415,0xc9))[_0xf535('0x25')](handleError(_0x5a2415,null));};exports[_0xf535('0x31')]=function(_0x226654,_0x1cf04b){if(_0x226654['body']['id']){delete _0x226654[_0xf535('0x4f')]['id'];}return db['FreshsalesConfiguration'][_0xf535('0x4d')]({'where':{'id':_0x226654[_0xf535('0x4b')]['id']}})[_0xf535('0x1c')](handleEntityNotFound(_0x1cf04b,null))[_0xf535('0x1c')](saveUpdates(_0x226654[_0xf535('0x4f')],null))['then'](respondWithResult(_0x1cf04b,null))[_0xf535('0x25')](handleError(_0x1cf04b,null));};exports[_0xf535('0x32')]=function(_0x3bff54,_0xa9ab69){return db[_0xf535('0x35')]['find']({'where':{'id':_0x3bff54[_0xf535('0x4b')]['id']}})[_0xf535('0x1c')](handleEntityNotFound(_0xa9ab69,null))['then'](removeEntity(_0xa9ab69,null))['catch'](handleError(_0xa9ab69,null));};exports[_0xf535('0x50')]=function(_0x3deddc,_0x3da4ab,_0x2d9f8e){var _0x4e2128={};var _0x1d71f5={};var _0x5613c1;var _0x388ff3;return db[_0xf535('0x35')][_0xf535('0x51')]({'where':{'id':_0x3deddc[_0xf535('0x4b')]['id']}})[_0xf535('0x1c')](handleEntityNotFound(_0x3da4ab,null))[_0xf535('0x1c')](function(_0x47297b){if(_0x47297b){_0x5613c1=_0x47297b;_0x1d71f5[_0xf535('0x3f')]=_[_0xf535('0x3c')](db[_0xf535('0x52')]['rawAttributes']);_0x1d71f5[_0xf535('0x3b')]=_[_0xf535('0x3c')](_0x3deddc[_0xf535('0x3b')]);_0x1d71f5[_0xf535('0x3d')]=_[_0xf535('0x3e')](_0x1d71f5['model'],_0x1d71f5[_0xf535('0x3b')]);_0x4e2128['attributes']=_[_0xf535('0x3e')](_0x1d71f5[_0xf535('0x3f')],qs[_0xf535('0x40')](_0x3deddc[_0xf535('0x3b')][_0xf535('0x40')]));_0x4e2128[_0xf535('0x42')]=_0x4e2128['attributes'][_0xf535('0x41')]?_0x4e2128[_0xf535('0x42')]:_0x1d71f5[_0xf535('0x3f')];_0x4e2128['order']=qs[_0xf535('0x45')](_0x3deddc['query'][_0xf535('0x45')]);_0x4e2128[_0xf535('0x46')]=qs[_0xf535('0x3d')](_[_0xf535('0x53')](_0x3deddc[_0xf535('0x3b')],_0x1d71f5[_0xf535('0x3d')]));if(_0x3deddc[_0xf535('0x3b')][_0xf535('0x54')]){_0x4e2128[_0xf535('0x46')]=_[_0xf535('0x47')](_0x4e2128[_0xf535('0x46')],{'$or':_['map'](_0x4e2128[_0xf535('0x42')],function(_0x3b3eb2){var _0x191736={};_0x191736[_0x3b3eb2]={'$like':'%'+_0x3deddc[_0xf535('0x3b')][_0xf535('0x54')]+'%'};return _0x191736;})});}_0x4e2128=_[_0xf535('0x47')]({},_0x4e2128,_0x3deddc[_0xf535('0x4c')]);return _0x5613c1[_0xf535('0x50')](_0x4e2128);}})['then'](function(_0x16bcae){if(_0x16bcae){_0x388ff3=_0x16bcae['length'];if(!_0x3deddc[_0xf535('0x3b')][_0xf535('0x43')]('nolimit')){_0x4e2128[_0xf535('0x2c')]=qs[_0xf535('0x2c')](_0x3deddc['query']['limit']);_0x4e2128[_0xf535('0x2b')]=qs[_0xf535('0x2b')](_0x3deddc['query'][_0xf535('0x2b')]);}return _0x5613c1[_0xf535('0x50')](_0x4e2128);}})[_0xf535('0x1c')](function(_0x3e2176){if(_0x3e2176){return _0x3e2176?{'count':_0x388ff3,'rows':_0x3e2176}:null;}})[_0xf535('0x1c')](respondWithResult(_0x3da4ab,null))[_0xf535('0x25')](handleError(_0x3da4ab,null));};exports[_0xf535('0x55')]=function(_0x5bfa9a,_0x26e7b8,_0x449d84){var _0x17375b={};var _0x5147a7={};var _0x573d7c;var _0x53d519;return db[_0xf535('0x35')][_0xf535('0x51')]({'where':{'id':_0x5bfa9a['params']['id']}})[_0xf535('0x1c')](handleEntityNotFound(_0x26e7b8,null))['then'](function(_0x2a4a46){if(_0x2a4a46){_0x573d7c=_0x2a4a46;_0x5147a7[_0xf535('0x3f')]=_[_0xf535('0x3c')](db[_0xf535('0x52')]['rawAttributes']);_0x5147a7[_0xf535('0x3b')]=_[_0xf535('0x3c')](_0x5bfa9a[_0xf535('0x3b')]);_0x5147a7[_0xf535('0x3d')]=_[_0xf535('0x3e')](_0x5147a7[_0xf535('0x3f')],_0x5147a7[_0xf535('0x3b')]);_0x17375b[_0xf535('0x42')]=_['intersection'](_0x5147a7[_0xf535('0x3f')],qs[_0xf535('0x40')](_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x40')]));_0x17375b[_0xf535('0x42')]=_0x17375b[_0xf535('0x42')]['length']?_0x17375b[_0xf535('0x42')]:_0x5147a7[_0xf535('0x3f')];_0x17375b[_0xf535('0x56')]=qs[_0xf535('0x45')](_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x45')]);_0x17375b[_0xf535('0x46')]=qs[_0xf535('0x3d')](_[_0xf535('0x53')](_0x5bfa9a[_0xf535('0x3b')],_0x5147a7[_0xf535('0x3d')]));if(_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x54')]){_0x17375b['where']=_['merge'](_0x17375b[_0xf535('0x46')],{'$or':_[_0xf535('0x3a')](_0x17375b[_0xf535('0x42')],function(_0x3fbef9){var _0x32b0c0={};_0x32b0c0[_0x3fbef9]={'$like':'%'+_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x54')]+'%'};return _0x32b0c0;})});}_0x17375b=_[_0xf535('0x47')]({},_0x17375b,_0x5bfa9a[_0xf535('0x4c')]);return _0x573d7c['getDescriptions'](_0x17375b);}})[_0xf535('0x1c')](function(_0x19bc04){if(_0x19bc04){_0x53d519=_0x19bc04[_0xf535('0x41')];if(!_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x43')](_0xf535('0x44'))){_0x17375b[_0xf535('0x2c')]=qs['limit'](_0x5bfa9a['query'][_0xf535('0x2c')]);_0x17375b['offset']=qs[_0xf535('0x2b')](_0x5bfa9a[_0xf535('0x3b')][_0xf535('0x2b')]);}return _0x573d7c[_0xf535('0x55')](_0x17375b);}})[_0xf535('0x1c')](function(_0x341948){if(_0x341948){return _0x341948?{'count':_0x53d519,'rows':_0x341948}:null;}})[_0xf535('0x1c')](respondWithResult(_0x26e7b8,null))[_0xf535('0x25')](handleError(_0x26e7b8,null));};exports[_0xf535('0x57')]=function(_0xcc61c9,_0x3365a7,_0x94da4e){var _0xd2fc49={};var _0x17791d={};var _0x56786b;var _0x404eb3;return db[_0xf535('0x35')][_0xf535('0x51')]({'where':{'id':_0xcc61c9[_0xf535('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3365a7,null))[_0xf535('0x1c')](function(_0x7f1094){if(_0x7f1094){_0x56786b=_0x7f1094;_0x17791d['model']=_[_0xf535('0x3c')](db[_0xf535('0x52')][_0xf535('0x36')]);_0x17791d['query']=_[_0xf535('0x3c')](_0xcc61c9[_0xf535('0x3b')]);_0x17791d[_0xf535('0x3d')]=_[_0xf535('0x3e')](_0x17791d[_0xf535('0x3f')],_0x17791d['query']);_0xd2fc49[_0xf535('0x42')]=_['intersection'](_0x17791d[_0xf535('0x3f')],qs[_0xf535('0x40')](_0xcc61c9[_0xf535('0x3b')][_0xf535('0x40')]));_0xd2fc49[_0xf535('0x42')]=_0xd2fc49[_0xf535('0x42')][_0xf535('0x41')]?_0xd2fc49[_0xf535('0x42')]:_0x17791d[_0xf535('0x3f')];_0xd2fc49[_0xf535('0x56')]=qs[_0xf535('0x45')](_0xcc61c9[_0xf535('0x3b')]['sort']);_0xd2fc49[_0xf535('0x46')]=qs['filters'](_[_0xf535('0x53')](_0xcc61c9[_0xf535('0x3b')],_0x17791d['filters']));if(_0xcc61c9[_0xf535('0x3b')][_0xf535('0x54')]){_0xd2fc49['where']=_[_0xf535('0x47')](_0xd2fc49[_0xf535('0x46')],{'$or':_['map'](_0xd2fc49['attributes'],function(_0x3c1f73){var _0x5ca995={};_0x5ca995[_0x3c1f73]={'$like':'%'+_0xcc61c9[_0xf535('0x3b')]['filter']+'%'};return _0x5ca995;})});}_0xd2fc49=_[_0xf535('0x47')]({},_0xd2fc49,_0xcc61c9[_0xf535('0x4c')]);return _0x56786b[_0xf535('0x57')](_0xd2fc49);}})[_0xf535('0x1c')](function(_0x10f493){if(_0x10f493){_0x404eb3=_0x10f493[_0xf535('0x41')];if(!_0xcc61c9['query'][_0xf535('0x43')](_0xf535('0x44'))){_0xd2fc49[_0xf535('0x2c')]=qs[_0xf535('0x2c')](_0xcc61c9[_0xf535('0x3b')][_0xf535('0x2c')]);_0xd2fc49['offset']=qs[_0xf535('0x2b')](_0xcc61c9[_0xf535('0x3b')][_0xf535('0x2b')]);}return _0x56786b[_0xf535('0x57')](_0xd2fc49);}})[_0xf535('0x1c')](function(_0x3f5072){if(_0x3f5072){return _0x3f5072?{'count':_0x404eb3,'rows':_0x3f5072}:null;}})[_0xf535('0x1c')](respondWithResult(_0x3365a7,null))[_0xf535('0x25')](handleError(_0x3365a7,null));}; \ No newline at end of file +var _0x71ab=['create','body','find','findOne','FreshsalesField','getSubjects','getFields','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','intersection','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','FreshsalesConfiguration','includeAll','include','findAll','rows','show','params','keys','fields','options'];(function(_0x346795,_0x2e860e){var _0x2f10e3=function(_0xeda3a6){while(--_0xeda3a6){_0x346795['push'](_0x346795['shift']());}};_0x2f10e3(++_0x2e860e);}(_0x71ab,0x64));var _0xb71a=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x71ab[_0x465028];return _0xb783d4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb71a('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb71a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0xb71a('0x2'));var moment=require(_0xb71a('0x3'));var BPromise=require(_0xb71a('0x4'));var Mustache=require(_0xb71a('0x5'));var util=require(_0xb71a('0x6'));var path=require(_0xb71a('0x7'));var sox=require(_0xb71a('0x8'));var csv=require(_0xb71a('0x9'));var ejs=require(_0xb71a('0xa'));var fs=require('fs');var _=require(_0xb71a('0xb'));var squel=require(_0xb71a('0xc'));var crypto=require(_0xb71a('0xd'));var jsforce=require(_0xb71a('0xe'));var deskjs=require(_0xb71a('0xf'));var toCsv=require(_0xb71a('0x9'));var querystring=require(_0xb71a('0x10'));var Papa=require(_0xb71a('0x11'));var Redis=require(_0xb71a('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xb71a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb71a('0x14'));var logger=require(_0xb71a('0x15'))(_0xb71a('0x16'));var utils=require('../../config/utils');var config=require(_0xb71a('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xb71a('0x18'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x3346a5,_0x2f5fd5,_0x315ca8){if(_0x315ca8){var _0xd8d3ae=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xd8d3ae['test'](_0x2f5fd5)){return _0x3346a5;}else{throw new db['Sequelize']['ValidationError'](_0xb71a('0x19'));}}else{return _0x3346a5;}}function respondWithRpcPromise(_0xc189cd,_0x15252a,_0x42fc55,_0x3cd0f0){return new BPromise(function(_0x1e9363,_0x31def2){var _0x2ec64a=_0x3cd0f0||client;return _0x2ec64a[_0xb71a('0x1a')](_0xc189cd,_0x42fc55)['then'](function(_0x1ca65e){logger[_0xb71a('0x1b')](_0xb71a('0x1c'),_0x15252a,_0xb71a('0x1d'));logger[_0xb71a('0x1e')](_0xb71a('0x1f'),_0x15252a,_0xb71a('0x1d'),JSON[_0xb71a('0x20')](_0x1ca65e));if(_0x1ca65e[_0xb71a('0x21')]){if(_0x1ca65e[_0xb71a('0x21')][_0xb71a('0x22')]===0x1f4){logger['error']('FreshsalesConfiguration,\x20%s,\x20%s',_0x15252a,_0x1ca65e[_0xb71a('0x21')][_0xb71a('0x23')]);return _0x31def2(_0x1ca65e['error']['message']);}logger[_0xb71a('0x21')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x15252a,_0x1ca65e[_0xb71a('0x21')][_0xb71a('0x23')]);return _0x1e9363(_0x1ca65e[_0xb71a('0x21')][_0xb71a('0x23')]);}else{logger[_0xb71a('0x1b')](_0xb71a('0x1c'),_0x15252a,_0xb71a('0x1d'));_0x1e9363(_0x1ca65e[_0xb71a('0x24')]['message']);}})[_0xb71a('0x25')](function(_0x2c15bc){logger[_0xb71a('0x21')](_0xb71a('0x1c'),_0x15252a,_0x2c15bc);_0x31def2(_0x2c15bc);});});}function respondWithStatusCode(_0x3401f7,_0x1a010d){_0x1a010d=_0x1a010d||0xcc;return function(_0x20ed75){if(_0x20ed75){return _0x3401f7[_0xb71a('0x26')](_0x1a010d);}return _0x3401f7[_0xb71a('0x27')](_0x1a010d)[_0xb71a('0x28')]();};}function respondWithResult(_0x45b849,_0x17f8b2){_0x17f8b2=_0x17f8b2||0xc8;return function(_0x160f0f){if(_0x160f0f){return _0x45b849['status'](_0x17f8b2)[_0xb71a('0x29')](_0x160f0f);}};}function respondWithFilteredResult(_0x39d874,_0x1689ce){return function(_0x358954){if(_0x358954){var _0x2fbd73=_0x358954[_0xb71a('0x2a')],_0x38178c=_0x1689ce[_0xb71a('0x2b')],_0x44826e=_0x1689ce[_0xb71a('0x2b')]+_0x1689ce['limit'],_0x25364c;if(_0x44826e>=_0x2fbd73){_0x44826e=_0x2fbd73;_0x25364c=0xc8;}else{_0x25364c=0xce;}_0x39d874['status'](_0x25364c);return _0x39d874[_0xb71a('0x2c')]('Content-Range',_0x38178c+'-'+_0x44826e+'/'+_0x2fbd73)[_0xb71a('0x29')](_0x358954);}return null;};}function patchUpdates(_0x1b1aa8){return function(_0x4d9e1a){try{jsonpatch[_0xb71a('0x2d')](_0x4d9e1a,_0x1b1aa8,!![]);}catch(_0xa42f25){return BPromise[_0xb71a('0x2e')](_0xa42f25);}return _0x4d9e1a[_0xb71a('0x2f')]();};}function saveUpdates(_0x3d3d81,_0x2364c3){return function(_0x5dd779){if(_0x5dd779){return _0x5dd779[_0xb71a('0x30')](_0x3d3d81)[_0xb71a('0x31')](function(_0x256dbe){return _0x256dbe;});}return null;};}function removeEntity(_0x31e708,_0x5a0334){return function(_0x2ea22a){if(_0x2ea22a){return _0x2ea22a[_0xb71a('0x32')]()[_0xb71a('0x31')](function(){_0x31e708[_0xb71a('0x27')](0xcc)[_0xb71a('0x28')]();});}};}function handleEntityNotFound(_0x3d93fc,_0x2962a0){return function(_0x333280){if(!_0x333280){_0x3d93fc[_0xb71a('0x26')](0x194);}return _0x333280;};}function handleError(_0x3f5531,_0x47e7da){_0x47e7da=_0x47e7da||0x1f4;return function(_0x5a0920){logger[_0xb71a('0x21')](_0x5a0920[_0xb71a('0x33')]);if(_0x5a0920[_0xb71a('0x34')]){delete _0x5a0920[_0xb71a('0x34')];}_0x3f5531[_0xb71a('0x27')](_0x47e7da)[_0xb71a('0x35')](_0x5a0920);};}exports[_0xb71a('0x36')]=function(_0x564fd8,_0x990c82){var _0x57ad22={},_0x3143c9={},_0xaebdc3={'count':0x0,'rows':[]};var _0x147002=_[_0xb71a('0x37')](db['FreshsalesConfiguration'][_0xb71a('0x38')],function(_0x3ff4ed){return{'name':_0x3ff4ed[_0xb71a('0x39')],'type':_0x3ff4ed[_0xb71a('0x3a')][_0xb71a('0x3b')]};});_0x3143c9[_0xb71a('0x3c')]=_[_0xb71a('0x37')](_0x147002,_0xb71a('0x34'));_0x3143c9[_0xb71a('0x3d')]=_['keys'](_0x564fd8[_0xb71a('0x3d')]);_0x3143c9['filters']=_[_0xb71a('0x3e')](_0x3143c9[_0xb71a('0x3c')],_0x3143c9[_0xb71a('0x3d')]);_0x57ad22[_0xb71a('0x3f')]=_[_0xb71a('0x3e')](_0x3143c9[_0xb71a('0x3c')],qs['fields'](_0x564fd8['query']['fields']));_0x57ad22[_0xb71a('0x3f')]=_0x57ad22['attributes'][_0xb71a('0x40')]?_0x57ad22[_0xb71a('0x3f')]:_0x3143c9[_0xb71a('0x3c')];if(!_0x564fd8[_0xb71a('0x3d')][_0xb71a('0x41')](_0xb71a('0x42'))){_0x57ad22['limit']=qs[_0xb71a('0x43')](_0x564fd8[_0xb71a('0x3d')][_0xb71a('0x43')]);_0x57ad22[_0xb71a('0x2b')]=qs[_0xb71a('0x2b')](_0x564fd8[_0xb71a('0x3d')]['offset']);}_0x57ad22[_0xb71a('0x44')]=qs[_0xb71a('0x45')](_0x564fd8[_0xb71a('0x3d')][_0xb71a('0x45')]);_0x57ad22[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_[_0xb71a('0x48')](_0x564fd8['query'],_0x3143c9['filters']));if(_0x564fd8[_0xb71a('0x3d')][_0xb71a('0x49')]){_0x57ad22[_0xb71a('0x46')]=_[_0xb71a('0x4a')](_0x57ad22['where'],{'$or':_[_0xb71a('0x37')](_0x147002,function(_0x559ccf){if(_0x559ccf[_0xb71a('0x3a')]!==_0xb71a('0x4b')){var _0x58e039={};_0x58e039[_0x559ccf[_0xb71a('0x34')]]={'$like':'%'+_0x564fd8[_0xb71a('0x3d')][_0xb71a('0x49')]+'%'};return _0x58e039;}})});}_0x57ad22=_[_0xb71a('0x4a')]({},_0x57ad22,_0x564fd8['options']);var _0x188896={'where':_0x57ad22[_0xb71a('0x46')]};return db[_0xb71a('0x4c')]['count'](_0x188896)[_0xb71a('0x31')](function(_0x1cd434){_0xaebdc3[_0xb71a('0x2a')]=_0x1cd434;if(_0x564fd8['query'][_0xb71a('0x4d')]){_0x57ad22[_0xb71a('0x4e')]=[{'all':!![]}];}return db[_0xb71a('0x4c')][_0xb71a('0x4f')](_0x57ad22);})[_0xb71a('0x31')](function(_0x550a67){_0xaebdc3[_0xb71a('0x50')]=_0x550a67;return _0xaebdc3;})[_0xb71a('0x31')](respondWithFilteredResult(_0x990c82,_0x57ad22))[_0xb71a('0x25')](handleError(_0x990c82,null));};exports[_0xb71a('0x51')]=function(_0x489c1f,_0x48fbde){var _0x23b4c0={'raw':![],'where':{'id':_0x489c1f[_0xb71a('0x52')]['id']}},_0x2cd1d1={};_0x2cd1d1[_0xb71a('0x3c')]=_[_0xb71a('0x53')](db[_0xb71a('0x4c')][_0xb71a('0x38')]);_0x2cd1d1[_0xb71a('0x3d')]=_[_0xb71a('0x53')](_0x489c1f[_0xb71a('0x3d')]);_0x2cd1d1['filters']=_[_0xb71a('0x3e')](_0x2cd1d1[_0xb71a('0x3c')],_0x2cd1d1['query']);_0x23b4c0[_0xb71a('0x3f')]=_['intersection'](_0x2cd1d1[_0xb71a('0x3c')],qs[_0xb71a('0x54')](_0x489c1f[_0xb71a('0x3d')][_0xb71a('0x54')]));_0x23b4c0[_0xb71a('0x3f')]=_0x23b4c0['attributes'][_0xb71a('0x40')]?_0x23b4c0['attributes']:_0x2cd1d1[_0xb71a('0x3c')];if(_0x489c1f[_0xb71a('0x3d')]['includeAll']){_0x23b4c0['include']=[{'all':!![]}];}_0x23b4c0=_[_0xb71a('0x4a')]({},_0x23b4c0,_0x489c1f[_0xb71a('0x55')]);return db['FreshsalesConfiguration']['find'](_0x23b4c0)['then'](handleEntityNotFound(_0x48fbde,null))[_0xb71a('0x31')](respondWithResult(_0x48fbde,null))['catch'](handleError(_0x48fbde,null));};exports['create']=function(_0x333ed0,_0x536fad){return db[_0xb71a('0x4c')][_0xb71a('0x56')](_0x333ed0['body'],{})[_0xb71a('0x31')](respondWithResult(_0x536fad,0xc9))[_0xb71a('0x25')](handleError(_0x536fad,null));};exports[_0xb71a('0x30')]=function(_0x5b0770,_0x2ac617){if(_0x5b0770[_0xb71a('0x57')]['id']){delete _0x5b0770['body']['id'];}return db[_0xb71a('0x4c')][_0xb71a('0x58')]({'where':{'id':_0x5b0770[_0xb71a('0x52')]['id']}})['then'](handleEntityNotFound(_0x2ac617,null))[_0xb71a('0x31')](saveUpdates(_0x5b0770['body'],null))[_0xb71a('0x31')](respondWithResult(_0x2ac617,null))[_0xb71a('0x25')](handleError(_0x2ac617,null));};exports['destroy']=function(_0xeeadcb,_0x344d18){return db[_0xb71a('0x4c')][_0xb71a('0x58')]({'where':{'id':_0xeeadcb[_0xb71a('0x52')]['id']}})[_0xb71a('0x31')](handleEntityNotFound(_0x344d18,null))[_0xb71a('0x31')](removeEntity(_0x344d18,null))['catch'](handleError(_0x344d18,null));};exports['getSubjects']=function(_0x19c72d,_0x43e9ea,_0x2cf6a3){var _0x25e342={};var _0x4002fc={};var _0x4e897e;var _0x5a45df;return db[_0xb71a('0x4c')][_0xb71a('0x59')]({'where':{'id':_0x19c72d['params']['id']}})[_0xb71a('0x31')](handleEntityNotFound(_0x43e9ea,null))[_0xb71a('0x31')](function(_0x4a4b22){if(_0x4a4b22){_0x4e897e=_0x4a4b22;_0x4002fc[_0xb71a('0x3c')]=_[_0xb71a('0x53')](db[_0xb71a('0x5a')][_0xb71a('0x38')]);_0x4002fc['query']=_[_0xb71a('0x53')](_0x19c72d[_0xb71a('0x3d')]);_0x4002fc['filters']=_[_0xb71a('0x3e')](_0x4002fc[_0xb71a('0x3c')],_0x4002fc[_0xb71a('0x3d')]);_0x25e342[_0xb71a('0x3f')]=_[_0xb71a('0x3e')](_0x4002fc[_0xb71a('0x3c')],qs[_0xb71a('0x54')](_0x19c72d[_0xb71a('0x3d')]['fields']));_0x25e342[_0xb71a('0x3f')]=_0x25e342[_0xb71a('0x3f')]['length']?_0x25e342[_0xb71a('0x3f')]:_0x4002fc[_0xb71a('0x3c')];_0x25e342['order']=qs[_0xb71a('0x45')](_0x19c72d[_0xb71a('0x3d')][_0xb71a('0x45')]);_0x25e342[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_[_0xb71a('0x48')](_0x19c72d['query'],_0x4002fc['filters']));if(_0x19c72d[_0xb71a('0x3d')][_0xb71a('0x49')]){_0x25e342[_0xb71a('0x46')]=_['merge'](_0x25e342[_0xb71a('0x46')],{'$or':_['map'](_0x25e342[_0xb71a('0x3f')],function(_0x59d162){var _0x5c74af={};_0x5c74af[_0x59d162]={'$like':'%'+_0x19c72d[_0xb71a('0x3d')][_0xb71a('0x49')]+'%'};return _0x5c74af;})});}_0x25e342=_[_0xb71a('0x4a')]({},_0x25e342,_0x19c72d[_0xb71a('0x55')]);return _0x4e897e[_0xb71a('0x5b')](_0x25e342);}})['then'](function(_0x2b758b){if(_0x2b758b){_0x5a45df=_0x2b758b['length'];if(!_0x19c72d[_0xb71a('0x3d')][_0xb71a('0x41')](_0xb71a('0x42'))){_0x25e342['limit']=qs['limit'](_0x19c72d[_0xb71a('0x3d')][_0xb71a('0x43')]);_0x25e342[_0xb71a('0x2b')]=qs[_0xb71a('0x2b')](_0x19c72d[_0xb71a('0x3d')]['offset']);}return _0x4e897e[_0xb71a('0x5b')](_0x25e342);}})[_0xb71a('0x31')](function(_0x1063ab){if(_0x1063ab){return _0x1063ab?{'count':_0x5a45df,'rows':_0x1063ab}:null;}})[_0xb71a('0x31')](respondWithResult(_0x43e9ea,null))[_0xb71a('0x25')](handleError(_0x43e9ea,null));};exports['getDescriptions']=function(_0x4a18ab,_0x15b8be,_0x2dd470){var _0x38a8a1={};var _0x3a39be={};var _0x459d2d;var _0xa2081f;return db[_0xb71a('0x4c')]['findOne']({'where':{'id':_0x4a18ab[_0xb71a('0x52')]['id']}})[_0xb71a('0x31')](handleEntityNotFound(_0x15b8be,null))['then'](function(_0x3a21e2){if(_0x3a21e2){_0x459d2d=_0x3a21e2;_0x3a39be[_0xb71a('0x3c')]=_[_0xb71a('0x53')](db['FreshsalesField'][_0xb71a('0x38')]);_0x3a39be[_0xb71a('0x3d')]=_[_0xb71a('0x53')](_0x4a18ab['query']);_0x3a39be[_0xb71a('0x47')]=_[_0xb71a('0x3e')](_0x3a39be[_0xb71a('0x3c')],_0x3a39be[_0xb71a('0x3d')]);_0x38a8a1[_0xb71a('0x3f')]=_[_0xb71a('0x3e')](_0x3a39be[_0xb71a('0x3c')],qs[_0xb71a('0x54')](_0x4a18ab['query'][_0xb71a('0x54')]));_0x38a8a1[_0xb71a('0x3f')]=_0x38a8a1[_0xb71a('0x3f')][_0xb71a('0x40')]?_0x38a8a1[_0xb71a('0x3f')]:_0x3a39be[_0xb71a('0x3c')];_0x38a8a1[_0xb71a('0x44')]=qs['sort'](_0x4a18ab[_0xb71a('0x3d')]['sort']);_0x38a8a1[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_['pick'](_0x4a18ab[_0xb71a('0x3d')],_0x3a39be['filters']));if(_0x4a18ab[_0xb71a('0x3d')]['filter']){_0x38a8a1[_0xb71a('0x46')]=_[_0xb71a('0x4a')](_0x38a8a1[_0xb71a('0x46')],{'$or':_[_0xb71a('0x37')](_0x38a8a1['attributes'],function(_0x29b91f){var _0x2c0f6f={};_0x2c0f6f[_0x29b91f]={'$like':'%'+_0x4a18ab['query'][_0xb71a('0x49')]+'%'};return _0x2c0f6f;})});}_0x38a8a1=_['merge']({},_0x38a8a1,_0x4a18ab['options']);return _0x459d2d['getDescriptions'](_0x38a8a1);}})['then'](function(_0x37a38f){if(_0x37a38f){_0xa2081f=_0x37a38f[_0xb71a('0x40')];if(!_0x4a18ab[_0xb71a('0x3d')]['hasOwnProperty'](_0xb71a('0x42'))){_0x38a8a1[_0xb71a('0x43')]=qs['limit'](_0x4a18ab[_0xb71a('0x3d')][_0xb71a('0x43')]);_0x38a8a1[_0xb71a('0x2b')]=qs[_0xb71a('0x2b')](_0x4a18ab[_0xb71a('0x3d')][_0xb71a('0x2b')]);}return _0x459d2d['getDescriptions'](_0x38a8a1);}})[_0xb71a('0x31')](function(_0x2772f8){if(_0x2772f8){return _0x2772f8?{'count':_0xa2081f,'rows':_0x2772f8}:null;}})[_0xb71a('0x31')](respondWithResult(_0x15b8be,null))[_0xb71a('0x25')](handleError(_0x15b8be,null));};exports[_0xb71a('0x5c')]=function(_0x2eb7f7,_0x5086c0,_0x2a7570){var _0x2a464b={};var _0x50d641={};var _0x1e3966;var _0x3a9a97;return db[_0xb71a('0x4c')]['findOne']({'where':{'id':_0x2eb7f7[_0xb71a('0x52')]['id']}})[_0xb71a('0x31')](handleEntityNotFound(_0x5086c0,null))[_0xb71a('0x31')](function(_0x575a0a){if(_0x575a0a){_0x1e3966=_0x575a0a;_0x50d641[_0xb71a('0x3c')]=_[_0xb71a('0x53')](db['FreshsalesField'][_0xb71a('0x38')]);_0x50d641[_0xb71a('0x3d')]=_[_0xb71a('0x53')](_0x2eb7f7[_0xb71a('0x3d')]);_0x50d641['filters']=_[_0xb71a('0x3e')](_0x50d641[_0xb71a('0x3c')],_0x50d641[_0xb71a('0x3d')]);_0x2a464b[_0xb71a('0x3f')]=_['intersection'](_0x50d641[_0xb71a('0x3c')],qs[_0xb71a('0x54')](_0x2eb7f7['query'][_0xb71a('0x54')]));_0x2a464b[_0xb71a('0x3f')]=_0x2a464b['attributes'][_0xb71a('0x40')]?_0x2a464b[_0xb71a('0x3f')]:_0x50d641[_0xb71a('0x3c')];_0x2a464b['order']=qs[_0xb71a('0x45')](_0x2eb7f7[_0xb71a('0x3d')][_0xb71a('0x45')]);_0x2a464b[_0xb71a('0x46')]=qs[_0xb71a('0x47')](_[_0xb71a('0x48')](_0x2eb7f7[_0xb71a('0x3d')],_0x50d641[_0xb71a('0x47')]));if(_0x2eb7f7[_0xb71a('0x3d')]['filter']){_0x2a464b['where']=_[_0xb71a('0x4a')](_0x2a464b[_0xb71a('0x46')],{'$or':_[_0xb71a('0x37')](_0x2a464b[_0xb71a('0x3f')],function(_0xf6b137){var _0x1d87c2={};_0x1d87c2[_0xf6b137]={'$like':'%'+_0x2eb7f7['query'][_0xb71a('0x49')]+'%'};return _0x1d87c2;})});}_0x2a464b=_['merge']({},_0x2a464b,_0x2eb7f7[_0xb71a('0x55')]);return _0x1e3966['getFields'](_0x2a464b);}})[_0xb71a('0x31')](function(_0x2b5ef8){if(_0x2b5ef8){_0x3a9a97=_0x2b5ef8['length'];if(!_0x2eb7f7[_0xb71a('0x3d')][_0xb71a('0x41')](_0xb71a('0x42'))){_0x2a464b[_0xb71a('0x43')]=qs[_0xb71a('0x43')](_0x2eb7f7['query'][_0xb71a('0x43')]);_0x2a464b[_0xb71a('0x2b')]=qs['offset'](_0x2eb7f7[_0xb71a('0x3d')][_0xb71a('0x2b')]);}return _0x1e3966['getFields'](_0x2a464b);}})[_0xb71a('0x31')](function(_0x2e076f){if(_0x2e076f){return _0x2e076f?{'count':_0x3a9a97,'rows':_0x2e076f}:null;}})[_0xb71a('0x31')](respondWithResult(_0x5086c0,null))['catch'](handleError(_0x5086c0,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index b6b585e..af83a2a 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd634=['int_freshsales_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','FreshsalesConfiguration'];(function(_0x224202,_0x1122e6){var _0x47a35b=function(_0x47d1b2){while(--_0x47d1b2){_0x224202['push'](_0x224202['shift']());}};_0x47a35b(++_0x1122e6);}(_0xd634,0x151));var _0x4d63=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0xd634[_0x2bcb75];return _0x175345;};'use strict';var _=require(_0x4d63('0x0'));var util=require(_0x4d63('0x1'));var logger=require(_0x4d63('0x2'))(_0x4d63('0x3'));var moment=require(_0x4d63('0x4'));var BPromise=require(_0x4d63('0x5'));var rp=require(_0x4d63('0x6'));var fs=require('fs');var path=require(_0x4d63('0x7'));var rimraf=require(_0x4d63('0x8'));var config=require(_0x4d63('0x9'));var attributes=require('./intFreshsalesConfiguration.attributes');module[_0x4d63('0xa')]=function(_0x2c5bc6,_0x389e92){return _0x2c5bc6[_0x4d63('0xb')](_0x4d63('0xc'),attributes,{'tableName':_0x4d63('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6623=['moment','path','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','util','../../config/logger','api'];(function(_0x14bdc5,_0x2ead76){var _0x4369a2=function(_0x407aa6){while(--_0x407aa6){_0x14bdc5['push'](_0x14bdc5['shift']());}};_0x4369a2(++_0x2ead76);}(_0x6623,0x189));var _0x3662=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0x6623[_0x4fc9e6];return _0x551d28;};'use strict';var _=require('lodash');var util=require(_0x3662('0x0'));var logger=require(_0x3662('0x1'))(_0x3662('0x2'));var moment=require(_0x3662('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3662('0x4'));var rimraf=require(_0x3662('0x5'));var config=require(_0x3662('0x6'));var attributes=require(_0x3662('0x7'));module[_0x3662('0x8')]=function(_0xb2999d,_0x597421){return _0xb2999d[_0x3662('0x9')](_0x3662('0xa'),attributes,{'tableName':'int_freshsales_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index f4f9b84..9d84e24 100644 --- a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js +++ b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xe0c0=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','debug','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','result','catch','lodash'];(function(_0x5d6223,_0x56bd7a){var _0x39ef33=function(_0x3171fd){while(--_0x3171fd){_0x5d6223['push'](_0x5d6223['shift']());}};_0x39ef33(++_0x56bd7a);}(_0xe0c0,0xa7));var _0x0e0c=function(_0x797409,_0x4ac6d9){_0x797409=_0x797409-0x0;var _0x287d3d=_0xe0c0[_0x797409];return _0x287d3d;};'use strict';var _=require(_0x0e0c('0x0'));var util=require('util');var moment=require(_0x0e0c('0x1'));var BPromise=require(_0x0e0c('0x2'));var rs=require(_0x0e0c('0x3'));var fs=require('fs');var Redis=require(_0x0e0c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0e0c('0x5'));var logger=require(_0x0e0c('0x6'))(_0x0e0c('0x7'));var config=require('../../config/environment');var jayson=require(_0x0e0c('0x8'));var client=jayson[_0x0e0c('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x14e5de,_0xd67cf8,_0xf7de29){return new BPromise(function(_0x13e45d,_0xe3ccce){return client['request'](_0x14e5de,_0xf7de29)['then'](function(_0x518486){logger[_0x0e0c('0xa')]('FreshsalesConfiguration,\x20%s,\x20%s',_0xd67cf8,_0x0e0c('0xb'));logger[_0x0e0c('0xc')](_0x0e0c('0xd'),_0xd67cf8,_0x0e0c('0xb'),JSON[_0x0e0c('0xe')](_0x518486));if(_0x518486[_0x0e0c('0xf')]){if(_0x518486[_0x0e0c('0xf')][_0x0e0c('0x10')]===0x1f4){logger['error'](_0x0e0c('0x11'),_0xd67cf8,_0x518486['error']['message']);return _0xe3ccce(_0x518486[_0x0e0c('0xf')][_0x0e0c('0x12')]);}logger[_0x0e0c('0xf')](_0x0e0c('0x11'),_0xd67cf8,_0x518486[_0x0e0c('0xf')][_0x0e0c('0x12')]);return _0x13e45d(_0x518486['error'][_0x0e0c('0x12')]);}else{logger[_0x0e0c('0xa')](_0x0e0c('0x11'),_0xd67cf8,'request\x20sent');_0x13e45d(_0x518486[_0x0e0c('0x13')][_0x0e0c('0x12')]);}})[_0x0e0c('0x14')](function(_0x20f13d){logger[_0x0e0c('0xf')](_0x0e0c('0x11'),_0xd67cf8,_0x20f13d);_0xe3ccce(_0x20f13d);});});} \ No newline at end of file +var _0x453b=['stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1ee359,_0x27c991){var _0x1ab364=function(_0x52763f){while(--_0x52763f){_0x1ee359['push'](_0x1ee359['shift']());}};_0x1ab364(++_0x27c991);}(_0x453b,0x164));var _0xb453=function(_0x5e8c0f,_0x1f20d9){_0x5e8c0f=_0x5e8c0f-0x0;var _0x568dbe=_0x453b[_0x5e8c0f];return _0x568dbe;};'use strict';var _=require(_0xb453('0x0'));var util=require(_0xb453('0x1'));var moment=require(_0xb453('0x2'));var BPromise=require(_0xb453('0x3'));var rs=require(_0xb453('0x4'));var fs=require('fs');var Redis=require(_0xb453('0x5'));var db=require(_0xb453('0x6'))['db'];var utils=require(_0xb453('0x7'));var logger=require(_0xb453('0x8'))(_0xb453('0x9'));var config=require(_0xb453('0xa'));var jayson=require(_0xb453('0xb'));var client=jayson[_0xb453('0xc')][_0xb453('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1ab841,_0x2436a7,_0x4fdd93){return new BPromise(function(_0x12c490,_0x3486a8){return client['request'](_0x1ab841,_0x4fdd93)[_0xb453('0xe')](function(_0x51337f){logger[_0xb453('0xf')](_0xb453('0x10'),_0x2436a7,_0xb453('0x11'));logger[_0xb453('0x12')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x2436a7,_0xb453('0x11'),JSON[_0xb453('0x13')](_0x51337f));if(_0x51337f[_0xb453('0x14')]){if(_0x51337f[_0xb453('0x14')][_0xb453('0x15')]===0x1f4){logger[_0xb453('0x14')](_0xb453('0x10'),_0x2436a7,_0x51337f[_0xb453('0x14')][_0xb453('0x16')]);return _0x3486a8(_0x51337f['error']['message']);}logger['error'](_0xb453('0x10'),_0x2436a7,_0x51337f['error'][_0xb453('0x16')]);return _0x12c490(_0x51337f[_0xb453('0x14')][_0xb453('0x16')]);}else{logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x2436a7,_0xb453('0x11'));_0x12c490(_0x51337f[_0xb453('0x17')][_0xb453('0x16')]);}})[_0xb453('0x18')](function(_0x139ed2){logger[_0xb453('0x14')](_0xb453('0x10'),_0x2436a7,_0x139ed2);_0x3486a8(_0x139ed2);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 400b702..503654c 100644 --- a/server/api/intFreshsalesField/index.js +++ b/server/api/intFreshsalesField/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x472f=['update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','post','create','put'];(function(_0x4f49a7,_0x1606f8){var _0x2687d0=function(_0x3fef6c){while(--_0x3fef6c){_0x4f49a7['push'](_0x4f49a7['shift']());}};_0x2687d0(++_0x1606f8);}(_0x472f,0x1a6));var _0xf472=function(_0x15698c,_0x1f06ab){_0x15698c=_0x15698c-0x0;var _0x2d04e0=_0x472f[_0x15698c];return _0x2d04e0;};'use strict';var multer=require('multer');var util=require(_0xf472('0x0'));var path=require(_0xf472('0x1'));var timeout=require(_0xf472('0x2'));var express=require(_0xf472('0x3'));var router=express['Router']();var auth=require(_0xf472('0x4'));var interaction=require(_0xf472('0x5'));var config=require(_0xf472('0x6'));var controller=require('./intFreshsalesField.controller');router['get']('/',auth[_0xf472('0x7')](),controller[_0xf472('0x8')]);router[_0xf472('0x9')](_0xf472('0xa'),auth[_0xf472('0x7')](),controller[_0xf472('0xb')]);router[_0xf472('0xc')]('/',auth[_0xf472('0x7')](),controller[_0xf472('0xd')]);router[_0xf472('0xe')](_0xf472('0xa'),auth['isAuthenticated'](),controller[_0xf472('0xf')]);router[_0xf472('0x10')](_0xf472('0xa'),auth[_0xf472('0x7')](),controller[_0xf472('0x11')]);module[_0xf472('0x12')]=router; \ No newline at end of file +var _0x418e=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./intFreshsalesField.controller','get','isAuthenticated','/:id','post','create'];(function(_0x483900,_0x3d0078){var _0x406710=function(_0x27bc34){while(--_0x27bc34){_0x483900['push'](_0x483900['shift']());}};_0x406710(++_0x3d0078);}(_0x418e,0x1cf));var _0xe418=function(_0x3502bd,_0x568b73){_0x3502bd=_0x3502bd-0x0;var _0x103bd5=_0x418e[_0x3502bd];return _0x103bd5;};'use strict';var multer=require(_0xe418('0x0'));var util=require(_0xe418('0x1'));var path=require(_0xe418('0x2'));var timeout=require(_0xe418('0x3'));var express=require(_0xe418('0x4'));var router=express[_0xe418('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe418('0x6'));var config=require('../../config/environment');var controller=require(_0xe418('0x7'));router[_0xe418('0x8')]('/',auth[_0xe418('0x9')](),controller['index']);router[_0xe418('0x8')](_0xe418('0xa'),auth[_0xe418('0x9')](),controller['show']);router[_0xe418('0xb')]('/',auth[_0xe418('0x9')](),controller[_0xe418('0xc')]);router['put'](_0xe418('0xa'),auth[_0xe418('0x9')](),controller[_0xe418('0xd')]);router[_0xe418('0xe')](_0xe418('0xa'),auth[_0xe418('0x9')](),controller[_0xe418('0xf')]);module[_0xe418('0x10')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 1ddad2e..2e6c3b0 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.attributes.js +++ b/server/api/intFreshsalesField/intFreshsalesField.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x35cf=['exports','ENUM','customVariable','keyValue','string','STRING','variable','sequelize'];(function(_0x14ec75,_0x56a3d4){var _0x40b9e9=function(_0x4d2f39){while(--_0x4d2f39){_0x14ec75['push'](_0x14ec75['shift']());}};_0x40b9e9(++_0x56a3d4);}(_0x35cf,0xbf));var _0xf35c=function(_0x5cdacf,_0x7c82b1){_0x5cdacf=_0x5cdacf-0x0;var _0xa68a8b=_0x35cf[_0x5cdacf];return _0xa68a8b;};'use strict';var Sequelize=require(_0xf35c('0x0'));module[_0xf35c('0x1')]={'type':{'type':Sequelize[_0xf35c('0x2')]('string','variable',_0xf35c('0x3'),_0xf35c('0x4')),'defaultValue':_0xf35c('0x5')},'content':{'type':Sequelize[_0xf35c('0x6')]},'key':{'type':Sequelize[_0xf35c('0x6')]},'keyType':{'type':Sequelize[_0xf35c('0x2')](_0xf35c('0x5'),_0xf35c('0x7'),'customVariable')},'keyContent':{'type':Sequelize[_0xf35c('0x6')]},'idField':{'type':Sequelize[_0xf35c('0x6')]},'nameField':{'type':Sequelize[_0xf35c('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf35c('0x6')]}}; \ No newline at end of file +var _0xaf09=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x2f5564,_0xe97026){var _0x14d21d=function(_0x45c6){while(--_0x45c6){_0x2f5564['push'](_0x2f5564['shift']());}};_0x14d21d(++_0xe97026);}(_0xaf09,0x10d));var _0x9af0=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0xaf09[_0x42245d];return _0x4b211a;};'use strict';var Sequelize=require(_0x9af0('0x0'));module[_0x9af0('0x1')]={'type':{'type':Sequelize[_0x9af0('0x2')](_0x9af0('0x3'),_0x9af0('0x4'),_0x9af0('0x5'),_0x9af0('0x6')),'defaultValue':_0x9af0('0x3')},'content':{'type':Sequelize[_0x9af0('0x7')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x9af0('0x2')]('string',_0x9af0('0x4'),_0x9af0('0x5'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9af0('0x7')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9af0('0x7')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index 0768287..38c636c 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.controller.js +++ b/server/api/intFreshsalesField/intFreshsalesField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0647=['lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','map','rawAttributes','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','options','FreshsalesField','count','include','findAll','rows','catch','show','find','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs'];(function(_0x2e0443,_0x7e5974){var _0x52d450=function(_0x3a9985){while(--_0x3a9985){_0x2e0443['push'](_0x2e0443['shift']());}};_0x52d450(++_0x7e5974);}(_0x0647,0xd0));var _0x7064=function(_0x1c6ef2,_0x8d926a){_0x1c6ef2=_0x1c6ef2-0x0;var _0x404b8c=_0x0647[_0x1c6ef2];return _0x404b8c;};'use strict';var pdf=require(_0x7064('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7064('0x1'));var zipdir=require(_0x7064('0x2'));var jsonpatch=require(_0x7064('0x3'));var rp=require(_0x7064('0x4'));var moment=require(_0x7064('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7064('0x6'));var path=require(_0x7064('0x7'));var sox=require(_0x7064('0x8'));var csv=require(_0x7064('0x9'));var ejs=require(_0x7064('0xa'));var fs=require('fs');var _=require(_0x7064('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7064('0xc'));var deskjs=require(_0x7064('0xd'));var toCsv=require(_0x7064('0x9'));var querystring=require('querystring');var Papa=require(_0x7064('0xe'));var Redis=require(_0x7064('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x7064('0x10'));var as=require(_0x7064('0x11'));var hardwareService=require(_0x7064('0x12'));var logger=require('../../config/logger')(_0x7064('0x13'));var utils=require(_0x7064('0x14'));var config=require(_0x7064('0x15'));var db=require(_0x7064('0x16'))['db'];function respondWithStatusCode(_0x549684,_0x303dcd){_0x303dcd=_0x303dcd||0xcc;return function(_0x4151b6){if(_0x4151b6){return _0x549684[_0x7064('0x17')](_0x303dcd);}return _0x549684[_0x7064('0x18')](_0x303dcd)[_0x7064('0x19')]();};}function respondWithResult(_0x6ad467,_0x265aa6){_0x265aa6=_0x265aa6||0xc8;return function(_0x3badc8){if(_0x3badc8){return _0x6ad467['status'](_0x265aa6)['json'](_0x3badc8);}};}function respondWithFilteredResult(_0x58b369,_0x39f83b){return function(_0x15a1c0){if(_0x15a1c0){var _0x36378c=_0x15a1c0['count'],_0x4b39db=_0x39f83b[_0x7064('0x1a')],_0x22cd86=_0x39f83b[_0x7064('0x1a')]+_0x39f83b[_0x7064('0x1b')],_0x13552d;if(_0x22cd86>=_0x36378c){_0x22cd86=_0x36378c;_0x13552d=0xc8;}else{_0x13552d=0xce;}_0x58b369[_0x7064('0x18')](_0x13552d);return _0x58b369[_0x7064('0x1c')](_0x7064('0x1d'),_0x4b39db+'-'+_0x22cd86+'/'+_0x36378c)[_0x7064('0x1e')](_0x15a1c0);}return null;};}function patchUpdates(_0x3e8d73){return function(_0x2779fd){try{jsonpatch[_0x7064('0x1f')](_0x2779fd,_0x3e8d73,!![]);}catch(_0x3b6ace){return BPromise[_0x7064('0x20')](_0x3b6ace);}return _0x2779fd[_0x7064('0x21')]();};}function saveUpdates(_0x5c9de8,_0x431fac){return function(_0x141983){if(_0x141983){return _0x141983[_0x7064('0x22')](_0x5c9de8)[_0x7064('0x23')](function(_0x5919bd){return _0x5919bd;});}return null;};}function removeEntity(_0x174225,_0x51ae69){return function(_0x446730){if(_0x446730){return _0x446730[_0x7064('0x24')]()['then'](function(){_0x174225[_0x7064('0x18')](0xcc)[_0x7064('0x19')]();});}};}function handleEntityNotFound(_0x1a62a2,_0x464e8a){return function(_0x167149){if(!_0x167149){_0x1a62a2['sendStatus'](0x194);}return _0x167149;};}function handleError(_0x4dbf02,_0x33f470){_0x33f470=_0x33f470||0x1f4;return function(_0x4d424c){logger[_0x7064('0x25')](_0x4d424c[_0x7064('0x26')]);if(_0x4d424c[_0x7064('0x27')]){delete _0x4d424c['name'];}_0x4dbf02[_0x7064('0x18')](_0x33f470)[_0x7064('0x28')](_0x4d424c);};}exports[_0x7064('0x29')]=function(_0x99fa4b,_0x358e67){var _0x57039f={},_0x561186={},_0x4f7313={'count':0x0,'rows':[]};var _0x5e2a06=_[_0x7064('0x2a')](db['FreshsalesField'][_0x7064('0x2b')],function(_0x411c32){return{'name':_0x411c32['fieldName'],'type':_0x411c32[_0x7064('0x2c')][_0x7064('0x2d')]};});_0x561186[_0x7064('0x2e')]=_[_0x7064('0x2a')](_0x5e2a06,_0x7064('0x27'));_0x561186['query']=_[_0x7064('0x2f')](_0x99fa4b[_0x7064('0x30')]);_0x561186[_0x7064('0x31')]=_[_0x7064('0x32')](_0x561186['model'],_0x561186['query']);_0x57039f['attributes']=_[_0x7064('0x32')](_0x561186['model'],qs[_0x7064('0x33')](_0x99fa4b[_0x7064('0x30')]['fields']));_0x57039f[_0x7064('0x34')]=_0x57039f[_0x7064('0x34')][_0x7064('0x35')]?_0x57039f[_0x7064('0x34')]:_0x561186['model'];if(!_0x99fa4b['query'][_0x7064('0x36')]('nolimit')){_0x57039f[_0x7064('0x1b')]=qs[_0x7064('0x1b')](_0x99fa4b[_0x7064('0x30')]['limit']);_0x57039f[_0x7064('0x1a')]=qs[_0x7064('0x1a')](_0x99fa4b[_0x7064('0x30')][_0x7064('0x1a')]);}_0x57039f['order']=qs['sort'](_0x99fa4b[_0x7064('0x30')][_0x7064('0x37')]);_0x57039f['where']=qs[_0x7064('0x31')](_[_0x7064('0x38')](_0x99fa4b[_0x7064('0x30')],_0x561186[_0x7064('0x31')]));if(_0x99fa4b[_0x7064('0x30')][_0x7064('0x39')]){_0x57039f[_0x7064('0x3a')]=_[_0x7064('0x3b')](_0x57039f[_0x7064('0x3a')],{'$or':_[_0x7064('0x2a')](_0x5e2a06,function(_0xce5140){if(_0xce5140['type']!==_0x7064('0x3c')){var _0x3506f3={};_0x3506f3[_0xce5140[_0x7064('0x27')]]={'$like':'%'+_0x99fa4b[_0x7064('0x30')][_0x7064('0x39')]+'%'};return _0x3506f3;}})});}_0x57039f=_['merge']({},_0x57039f,_0x99fa4b[_0x7064('0x3d')]);var _0x28c5ff={'where':_0x57039f[_0x7064('0x3a')]};return db[_0x7064('0x3e')][_0x7064('0x3f')](_0x28c5ff)[_0x7064('0x23')](function(_0x4f2298){_0x4f7313[_0x7064('0x3f')]=_0x4f2298;if(_0x99fa4b[_0x7064('0x30')]['includeAll']){_0x57039f[_0x7064('0x40')]=[{'all':!![]}];}return db[_0x7064('0x3e')][_0x7064('0x41')](_0x57039f);})[_0x7064('0x23')](function(_0x2485af){_0x4f7313[_0x7064('0x42')]=_0x2485af;return _0x4f7313;})[_0x7064('0x23')](respondWithFilteredResult(_0x358e67,_0x57039f))[_0x7064('0x43')](handleError(_0x358e67,null));};exports[_0x7064('0x44')]=function(_0x466e07,_0x45d24c){var _0x329dfa={'raw':!![],'where':{'id':_0x466e07['params']['id']}},_0x243991={};_0x243991[_0x7064('0x2e')]=_[_0x7064('0x2f')](db['FreshsalesField'][_0x7064('0x2b')]);_0x243991[_0x7064('0x30')]=_[_0x7064('0x2f')](_0x466e07[_0x7064('0x30')]);_0x243991[_0x7064('0x31')]=_[_0x7064('0x32')](_0x243991['model'],_0x243991['query']);_0x329dfa[_0x7064('0x34')]=_[_0x7064('0x32')](_0x243991['model'],qs[_0x7064('0x33')](_0x466e07[_0x7064('0x30')]['fields']));_0x329dfa[_0x7064('0x34')]=_0x329dfa['attributes']['length']?_0x329dfa['attributes']:_0x243991[_0x7064('0x2e')];if(_0x466e07[_0x7064('0x30')]['includeAll']){_0x329dfa[_0x7064('0x40')]=[{'all':!![]}];}_0x329dfa=_[_0x7064('0x3b')]({},_0x329dfa,_0x466e07['options']);return db[_0x7064('0x3e')][_0x7064('0x45')](_0x329dfa)['then'](handleEntityNotFound(_0x45d24c,null))[_0x7064('0x23')](respondWithResult(_0x45d24c,null))[_0x7064('0x43')](handleError(_0x45d24c,null));};exports[_0x7064('0x46')]=function(_0x5483d2,_0x57b568){return db[_0x7064('0x3e')][_0x7064('0x46')](_0x5483d2[_0x7064('0x47')],{})[_0x7064('0x23')](respondWithResult(_0x57b568,0xc9))[_0x7064('0x43')](handleError(_0x57b568,null));};exports[_0x7064('0x22')]=function(_0x379aa0,_0x53fdd9){if(_0x379aa0['body']['id']){delete _0x379aa0[_0x7064('0x47')]['id'];}return db[_0x7064('0x3e')][_0x7064('0x45')]({'where':{'id':_0x379aa0[_0x7064('0x48')]['id']}})[_0x7064('0x23')](handleEntityNotFound(_0x53fdd9,null))[_0x7064('0x23')](saveUpdates(_0x379aa0[_0x7064('0x47')],null))['then'](respondWithResult(_0x53fdd9,null))['catch'](handleError(_0x53fdd9,null));};exports['destroy']=function(_0x4d0829,_0x58ee99){return db['FreshsalesField']['find']({'where':{'id':_0x4d0829[_0x7064('0x48')]['id']}})['then'](handleEntityNotFound(_0x58ee99,null))[_0x7064('0x23')](removeEntity(_0x58ee99,null))[_0x7064('0x43')](handleError(_0x58ee99,null));}; \ No newline at end of file +var _0xe1e3=['sendStatus','error','stack','name','send','index','map','rawAttributes','type','key','model','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','FreshsalesField','includeAll','include','catch','params','keys','create','body','find','html-pdf','eml-format','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','end'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xe1e3,0x1bb));var _0x3e1e=function(_0x34fd02,_0x21f7bf){_0x34fd02=_0x34fd02-0x0;var _0x3c1bd1=_0xe1e3[_0x34fd02];return _0x3c1bd1;};'use strict';var pdf=require(_0x3e1e('0x0'));var emlformat=require(_0x3e1e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3e1e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3e1e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x3e1e('0x4'));var util=require(_0x3e1e('0x5'));var path=require(_0x3e1e('0x6'));var sox=require(_0x3e1e('0x7'));var csv=require(_0x3e1e('0x8'));var ejs=require(_0x3e1e('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3e1e('0xa'));var crypto=require(_0x3e1e('0xb'));var jsforce=require(_0x3e1e('0xc'));var deskjs=require(_0x3e1e('0xd'));var toCsv=require(_0x3e1e('0x8'));var querystring=require(_0x3e1e('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3e1e('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3e1e('0x10'));var logger=require(_0x3e1e('0x11'))(_0x3e1e('0x12'));var utils=require('../../config/utils');var config=require(_0x3e1e('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fcd4f,_0x4e47b9){_0x4e47b9=_0x4e47b9||0xcc;return function(_0x536129){if(_0x536129){return _0x4fcd4f['sendStatus'](_0x4e47b9);}return _0x4fcd4f[_0x3e1e('0x14')](_0x4e47b9)['end']();};}function respondWithResult(_0x4d1e78,_0x3a9375){_0x3a9375=_0x3a9375||0xc8;return function(_0x8bd4cd){if(_0x8bd4cd){return _0x4d1e78[_0x3e1e('0x14')](_0x3a9375)['json'](_0x8bd4cd);}};}function respondWithFilteredResult(_0x5b34ec,_0x4131a1){return function(_0x1b62e6){if(_0x1b62e6){var _0x4dca60=_0x1b62e6[_0x3e1e('0x15')],_0x26cb35=_0x4131a1['offset'],_0x1f0af9=_0x4131a1[_0x3e1e('0x16')]+_0x4131a1[_0x3e1e('0x17')],_0x570212;if(_0x1f0af9>=_0x4dca60){_0x1f0af9=_0x4dca60;_0x570212=0xc8;}else{_0x570212=0xce;}_0x5b34ec[_0x3e1e('0x14')](_0x570212);return _0x5b34ec[_0x3e1e('0x18')](_0x3e1e('0x19'),_0x26cb35+'-'+_0x1f0af9+'/'+_0x4dca60)[_0x3e1e('0x1a')](_0x1b62e6);}return null;};}function patchUpdates(_0x569f49){return function(_0x5dccb8){try{jsonpatch['apply'](_0x5dccb8,_0x569f49,!![]);}catch(_0x428e4e){return BPromise[_0x3e1e('0x1b')](_0x428e4e);}return _0x5dccb8[_0x3e1e('0x1c')]();};}function saveUpdates(_0x57c660,_0x1c5acd){return function(_0x530815){if(_0x530815){return _0x530815[_0x3e1e('0x1d')](_0x57c660)[_0x3e1e('0x1e')](function(_0x474085){return _0x474085;});}return null;};}function removeEntity(_0x5f4e29,_0x53e051){return function(_0x96396){if(_0x96396){return _0x96396[_0x3e1e('0x1f')]()['then'](function(){_0x5f4e29['status'](0xcc)[_0x3e1e('0x20')]();});}};}function handleEntityNotFound(_0x1b5097,_0x488f9f){return function(_0x60e6bc){if(!_0x60e6bc){_0x1b5097[_0x3e1e('0x21')](0x194);}return _0x60e6bc;};}function handleError(_0x164b15,_0x33bf0f){_0x33bf0f=_0x33bf0f||0x1f4;return function(_0x8a4440){logger[_0x3e1e('0x22')](_0x8a4440[_0x3e1e('0x23')]);if(_0x8a4440[_0x3e1e('0x24')]){delete _0x8a4440['name'];}_0x164b15['status'](_0x33bf0f)[_0x3e1e('0x25')](_0x8a4440);};}exports[_0x3e1e('0x26')]=function(_0x55db8f,_0x4be84e){var _0x56b9a8={},_0x1a33bb={},_0x43ec88={'count':0x0,'rows':[]};var _0x5b1bd1=_[_0x3e1e('0x27')](db['FreshsalesField'][_0x3e1e('0x28')],function(_0x176bb4){return{'name':_0x176bb4['fieldName'],'type':_0x176bb4[_0x3e1e('0x29')][_0x3e1e('0x2a')]};});_0x1a33bb[_0x3e1e('0x2b')]=_['map'](_0x5b1bd1,_0x3e1e('0x24'));_0x1a33bb['query']=_['keys'](_0x55db8f['query']);_0x1a33bb[_0x3e1e('0x2c')]=_['intersection'](_0x1a33bb['model'],_0x1a33bb[_0x3e1e('0x2d')]);_0x56b9a8[_0x3e1e('0x2e')]=_[_0x3e1e('0x2f')](_0x1a33bb[_0x3e1e('0x2b')],qs[_0x3e1e('0x30')](_0x55db8f['query']['fields']));_0x56b9a8['attributes']=_0x56b9a8['attributes'][_0x3e1e('0x31')]?_0x56b9a8[_0x3e1e('0x2e')]:_0x1a33bb[_0x3e1e('0x2b')];if(!_0x55db8f[_0x3e1e('0x2d')][_0x3e1e('0x32')](_0x3e1e('0x33'))){_0x56b9a8[_0x3e1e('0x17')]=qs[_0x3e1e('0x17')](_0x55db8f['query'][_0x3e1e('0x17')]);_0x56b9a8[_0x3e1e('0x16')]=qs['offset'](_0x55db8f[_0x3e1e('0x2d')][_0x3e1e('0x16')]);}_0x56b9a8[_0x3e1e('0x34')]=qs[_0x3e1e('0x35')](_0x55db8f['query']['sort']);_0x56b9a8[_0x3e1e('0x36')]=qs[_0x3e1e('0x2c')](_['pick'](_0x55db8f[_0x3e1e('0x2d')],_0x1a33bb[_0x3e1e('0x2c')]));if(_0x55db8f['query'][_0x3e1e('0x37')]){_0x56b9a8[_0x3e1e('0x36')]=_[_0x3e1e('0x38')](_0x56b9a8[_0x3e1e('0x36')],{'$or':_[_0x3e1e('0x27')](_0x5b1bd1,function(_0x5ef730){if(_0x5ef730[_0x3e1e('0x29')]!==_0x3e1e('0x39')){var _0x1c622e={};_0x1c622e[_0x5ef730[_0x3e1e('0x24')]]={'$like':'%'+_0x55db8f['query'][_0x3e1e('0x37')]+'%'};return _0x1c622e;}})});}_0x56b9a8=_[_0x3e1e('0x38')]({},_0x56b9a8,_0x55db8f[_0x3e1e('0x3a')]);var _0xfc4f2a={'where':_0x56b9a8[_0x3e1e('0x36')]};return db[_0x3e1e('0x3b')][_0x3e1e('0x15')](_0xfc4f2a)['then'](function(_0x18132f){_0x43ec88['count']=_0x18132f;if(_0x55db8f['query'][_0x3e1e('0x3c')]){_0x56b9a8[_0x3e1e('0x3d')]=[{'all':!![]}];}return db[_0x3e1e('0x3b')]['findAll'](_0x56b9a8);})[_0x3e1e('0x1e')](function(_0xb030eb){_0x43ec88['rows']=_0xb030eb;return _0x43ec88;})[_0x3e1e('0x1e')](respondWithFilteredResult(_0x4be84e,_0x56b9a8))[_0x3e1e('0x3e')](handleError(_0x4be84e,null));};exports['show']=function(_0x48bd95,_0x309b65){var _0x49e4cb={'raw':!![],'where':{'id':_0x48bd95[_0x3e1e('0x3f')]['id']}},_0x4ff868={};_0x4ff868[_0x3e1e('0x2b')]=_[_0x3e1e('0x40')](db[_0x3e1e('0x3b')][_0x3e1e('0x28')]);_0x4ff868['query']=_['keys'](_0x48bd95[_0x3e1e('0x2d')]);_0x4ff868[_0x3e1e('0x2c')]=_[_0x3e1e('0x2f')](_0x4ff868['model'],_0x4ff868[_0x3e1e('0x2d')]);_0x49e4cb[_0x3e1e('0x2e')]=_[_0x3e1e('0x2f')](_0x4ff868['model'],qs[_0x3e1e('0x30')](_0x48bd95['query']['fields']));_0x49e4cb[_0x3e1e('0x2e')]=_0x49e4cb[_0x3e1e('0x2e')][_0x3e1e('0x31')]?_0x49e4cb[_0x3e1e('0x2e')]:_0x4ff868['model'];if(_0x48bd95['query']['includeAll']){_0x49e4cb['include']=[{'all':!![]}];}_0x49e4cb=_[_0x3e1e('0x38')]({},_0x49e4cb,_0x48bd95[_0x3e1e('0x3a')]);return db['FreshsalesField']['find'](_0x49e4cb)[_0x3e1e('0x1e')](handleEntityNotFound(_0x309b65,null))[_0x3e1e('0x1e')](respondWithResult(_0x309b65,null))[_0x3e1e('0x3e')](handleError(_0x309b65,null));};exports['create']=function(_0x30f1d0,_0x5eb15b){return db[_0x3e1e('0x3b')][_0x3e1e('0x41')](_0x30f1d0[_0x3e1e('0x42')],{})[_0x3e1e('0x1e')](respondWithResult(_0x5eb15b,0xc9))[_0x3e1e('0x3e')](handleError(_0x5eb15b,null));};exports[_0x3e1e('0x1d')]=function(_0x53d32b,_0x2f14b3){if(_0x53d32b[_0x3e1e('0x42')]['id']){delete _0x53d32b['body']['id'];}return db[_0x3e1e('0x3b')][_0x3e1e('0x43')]({'where':{'id':_0x53d32b['params']['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x2f14b3,null))[_0x3e1e('0x1e')](saveUpdates(_0x53d32b[_0x3e1e('0x42')],null))[_0x3e1e('0x1e')](respondWithResult(_0x2f14b3,null))['catch'](handleError(_0x2f14b3,null));};exports[_0x3e1e('0x1f')]=function(_0x3d7303,_0x29d23b){return db[_0x3e1e('0x3b')]['find']({'where':{'id':_0x3d7303[_0x3e1e('0x3f')]['id']}})[_0x3e1e('0x1e')](handleEntityNotFound(_0x29d23b,null))[_0x3e1e('0x1e')](removeEntity(_0x29d23b,null))[_0x3e1e('0x3e')](handleError(_0x29d23b,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 3e202da..a934952 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.model.js +++ b/server/api/intFreshsalesField/intFreshsalesField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfdc4=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intFreshsalesField.attributes','define','FreshsalesField','int_freshsales_fields','idField','FieldId','lodash'];(function(_0x37f58d,_0x46555d){var _0x10569e=function(_0x2f78ab){while(--_0x2f78ab){_0x37f58d['push'](_0x37f58d['shift']());}};_0x10569e(++_0x46555d);}(_0xfdc4,0x1ee));var _0x4fdc=function(_0x13896c,_0x4c1d46){_0x13896c=_0x13896c-0x0;var _0xb6f6f2=_0xfdc4[_0x13896c];return _0xb6f6f2;};'use strict';var _=require(_0x4fdc('0x0'));var util=require(_0x4fdc('0x1'));var logger=require(_0x4fdc('0x2'))(_0x4fdc('0x3'));var moment=require(_0x4fdc('0x4'));var BPromise=require(_0x4fdc('0x5'));var rp=require(_0x4fdc('0x6'));var fs=require('fs');var path=require(_0x4fdc('0x7'));var rimraf=require(_0x4fdc('0x8'));var config=require('../../config/environment');var attributes=require(_0x4fdc('0x9'));module['exports']=function(_0x550752,_0x16d4b6){return _0x550752[_0x4fdc('0xa')](_0x4fdc('0xb'),attributes,{'tableName':_0x4fdc('0xc'),'paranoid':![],'indexes':[{'name':'freshsales_unique_index','fields':[_0x4fdc('0xd'),_0x4fdc('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaafd=['freshsales_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','int_freshsales_fields'];(function(_0x3b20c2,_0x888661){var _0x5b4482=function(_0x15b274){while(--_0x15b274){_0x3b20c2['push'](_0x3b20c2['shift']());}};_0x5b4482(++_0x888661);}(_0xaafd,0x12f));var _0xdaaf=function(_0x2d284c,_0x59aa64){_0x2d284c=_0x2d284c-0x0;var _0x4f5756=_0xaafd[_0x2d284c];return _0x4f5756;};'use strict';var _=require(_0xdaaf('0x0'));var util=require(_0xdaaf('0x1'));var logger=require('../../config/logger')(_0xdaaf('0x2'));var moment=require(_0xdaaf('0x3'));var BPromise=require(_0xdaaf('0x4'));var rp=require(_0xdaaf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdaaf('0x6'));var config=require(_0xdaaf('0x7'));var attributes=require(_0xdaaf('0x8'));module[_0xdaaf('0x9')]=function(_0x8d59d5,_0x1d48ce){return _0x8d59d5[_0xdaaf('0xa')]('FreshsalesField',attributes,{'tableName':_0xdaaf('0xb'),'paranoid':![],'indexes':[{'name':_0xdaaf('0xc'),'fields':[_0xdaaf('0xd'),_0xdaaf('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.rpc.js b/server/api/intFreshsalesField/intFreshsalesField.rpc.js index 3c8e820..64d7e49 100644 --- a/server/api/intFreshsalesField/intFreshsalesField.rpc.js +++ b/server/api/intFreshsalesField/intFreshsalesField.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a3a=['client','http','request','then','info','FreshsalesField,\x20%s,\x20%s','request\x20sent','FreshsalesField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x4e91ba,_0x4d7833){var _0x5007cf=function(_0x52d436){while(--_0x52d436){_0x4e91ba['push'](_0x4e91ba['shift']());}};_0x5007cf(++_0x4d7833);}(_0x4a3a,0x72));var _0xa4a3=function(_0x1c595c,_0x51dfc4){_0x1c595c=_0x1c595c-0x0;var _0x74a84e=_0x4a3a[_0x1c595c];return _0x74a84e;};'use strict';var _=require(_0xa4a3('0x0'));var util=require(_0xa4a3('0x1'));var moment=require('moment');var BPromise=require(_0xa4a3('0x2'));var rs=require(_0xa4a3('0x3'));var fs=require('fs');var Redis=require(_0xa4a3('0x4'));var db=require(_0xa4a3('0x5'))['db'];var utils=require(_0xa4a3('0x6'));var logger=require(_0xa4a3('0x7'))(_0xa4a3('0x8'));var config=require(_0xa4a3('0x9'));var jayson=require(_0xa4a3('0xa'));var client=jayson[_0xa4a3('0xb')][_0xa4a3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x13ab69,_0x44371d,_0x30933a){return new BPromise(function(_0xa32658,_0x1bb262){return client[_0xa4a3('0xd')](_0x13ab69,_0x30933a)[_0xa4a3('0xe')](function(_0x1ee67a){logger[_0xa4a3('0xf')](_0xa4a3('0x10'),_0x44371d,_0xa4a3('0x11'));logger['debug'](_0xa4a3('0x12'),_0x44371d,_0xa4a3('0x11'),JSON[_0xa4a3('0x13')](_0x1ee67a));if(_0x1ee67a['error']){if(_0x1ee67a[_0xa4a3('0x14')][_0xa4a3('0x15')]===0x1f4){logger[_0xa4a3('0x14')](_0xa4a3('0x10'),_0x44371d,_0x1ee67a[_0xa4a3('0x14')][_0xa4a3('0x16')]);return _0x1bb262(_0x1ee67a[_0xa4a3('0x14')][_0xa4a3('0x16')]);}logger[_0xa4a3('0x14')](_0xa4a3('0x10'),_0x44371d,_0x1ee67a[_0xa4a3('0x14')]['message']);return _0xa32658(_0x1ee67a[_0xa4a3('0x14')][_0xa4a3('0x16')]);}else{logger[_0xa4a3('0xf')]('FreshsalesField,\x20%s,\x20%s',_0x44371d,_0xa4a3('0x11'));_0xa32658(_0x1ee67a[_0xa4a3('0x17')][_0xa4a3('0x16')]);}})[_0xa4a3('0x18')](function(_0x548e8b){logger['error'](_0xa4a3('0x10'),_0x44371d,_0x548e8b);_0x1bb262(_0x548e8b);});});} \ No newline at end of file +var _0x5a96=['http','request','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','client'];(function(_0x52f9b1,_0x2717c1){var _0x29493a=function(_0x1b7d18){while(--_0x1b7d18){_0x52f9b1['push'](_0x52f9b1['shift']());}};_0x29493a(++_0x2717c1);}(_0x5a96,0x83));var _0x65a9=function(_0x4f2c4e,_0x123dad){_0x4f2c4e=_0x4f2c4e-0x0;var _0x350308=_0x5a96[_0x4f2c4e];return _0x350308;};'use strict';var _=require(_0x65a9('0x0'));var util=require(_0x65a9('0x1'));var moment=require(_0x65a9('0x2'));var BPromise=require(_0x65a9('0x3'));var rs=require(_0x65a9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x65a9('0x5'));var logger=require('../../config/logger')(_0x65a9('0x6'));var config=require(_0x65a9('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x65a9('0x8')][_0x65a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x11a088,_0x1a1def,_0x9b4a4){return new BPromise(function(_0x47eab5,_0xdee5d){return client[_0x65a9('0xa')](_0x11a088,_0x9b4a4)['then'](function(_0x373b53){logger['info'](_0x65a9('0xb'),_0x1a1def,_0x65a9('0xc'));logger[_0x65a9('0xd')](_0x65a9('0xe'),_0x1a1def,_0x65a9('0xc'),JSON['stringify'](_0x373b53));if(_0x373b53[_0x65a9('0xf')]){if(_0x373b53[_0x65a9('0xf')]['code']===0x1f4){logger[_0x65a9('0xf')](_0x65a9('0xb'),_0x1a1def,_0x373b53[_0x65a9('0xf')]['message']);return _0xdee5d(_0x373b53[_0x65a9('0xf')]['message']);}logger['error'](_0x65a9('0xb'),_0x1a1def,_0x373b53[_0x65a9('0xf')][_0x65a9('0x10')]);return _0x47eab5(_0x373b53['error'][_0x65a9('0x10')]);}else{logger[_0x65a9('0x11')](_0x65a9('0xb'),_0x1a1def,_0x65a9('0xc'));_0x47eab5(_0x373b53[_0x65a9('0x12')][_0x65a9('0x10')]);}})[_0x65a9('0x13')](function(_0x1ce5aa){logger[_0x65a9('0xf')](_0x65a9('0xb'),_0x1a1def,_0x1ce5aa);_0xdee5d(_0x1ce5aa);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index e17d42a..ee4933b 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 _0x5cd5=['addConfiguration','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create'];(function(_0x399324,_0x5d4a29){var _0x3eb4eb=function(_0x47cb52){while(--_0x47cb52){_0x399324['push'](_0x399324['shift']());}};_0x3eb4eb(++_0x5d4a29);}(_0x5cd5,0x10b));var _0x55cd=function(_0x13dd17,_0x1b7faa){_0x13dd17=_0x13dd17-0x0;var _0x4fb5a1=_0x5cd5[_0x13dd17];return _0x4fb5a1;};'use strict';var multer=require(_0x55cd('0x0'));var util=require(_0x55cd('0x1'));var path=require(_0x55cd('0x2'));var timeout=require(_0x55cd('0x3'));var express=require(_0x55cd('0x4'));var router=express[_0x55cd('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x55cd('0x6'));var config=require(_0x55cd('0x7'));var controller=require(_0x55cd('0x8'));router[_0x55cd('0x9')]('/',auth[_0x55cd('0xa')](),controller[_0x55cd('0xb')]);router['get'](_0x55cd('0xc'),auth['isAuthenticated'](),controller[_0x55cd('0xd')]);router['get'](_0x55cd('0xe'),auth[_0x55cd('0xa')](),controller[_0x55cd('0xf')]);router['get']('/:id/fields',auth[_0x55cd('0xa')](),controller[_0x55cd('0x10')]);router[_0x55cd('0x11')]('/',auth[_0x55cd('0xa')](),controller[_0x55cd('0x12')]);router[_0x55cd('0x11')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x55cd('0x13')]);router['put'](_0x55cd('0xc'),auth[_0x55cd('0xa')](),controller['update']);router[_0x55cd('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x55cd('0x15')]);module['exports']=router; \ No newline at end of file +var _0x8d6f=['show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSalesforceAccount.controller','get','isAuthenticated','/:id'];(function(_0xb66224,_0x3a3f2f){var _0x346365=function(_0x51de16){while(--_0x51de16){_0xb66224['push'](_0xb66224['shift']());}};_0x346365(++_0x3a3f2f);}(_0x8d6f,0x1bb));var _0xf8d6=function(_0x2c8bb4,_0x48026a){_0x2c8bb4=_0x2c8bb4-0x0;var _0x30402c=_0x8d6f[_0x2c8bb4];return _0x30402c;};'use strict';var multer=require(_0xf8d6('0x0'));var util=require(_0xf8d6('0x1'));var path=require(_0xf8d6('0x2'));var timeout=require(_0xf8d6('0x3'));var express=require(_0xf8d6('0x4'));var router=express[_0xf8d6('0x5')]();var auth=require(_0xf8d6('0x6'));var interaction=require(_0xf8d6('0x7'));var config=require(_0xf8d6('0x8'));var controller=require(_0xf8d6('0x9'));router[_0xf8d6('0xa')]('/',auth[_0xf8d6('0xb')](),controller['index']);router['get'](_0xf8d6('0xc'),auth['isAuthenticated'](),controller[_0xf8d6('0xd')]);router[_0xf8d6('0xa')](_0xf8d6('0xe'),auth['isAuthenticated'](),controller[_0xf8d6('0xf')]);router[_0xf8d6('0xa')](_0xf8d6('0x10'),auth[_0xf8d6('0xb')](),controller[_0xf8d6('0x11')]);router[_0xf8d6('0x12')]('/',auth['isAuthenticated'](),controller[_0xf8d6('0x13')]);router['post'](_0xf8d6('0xe'),auth['isAuthenticated'](),controller['addConfiguration']);router[_0xf8d6('0x14')](_0xf8d6('0xc'),auth[_0xf8d6('0xb')](),controller[_0xf8d6('0x15')]);router[_0xf8d6('0x16')]('/:id',auth['isAuthenticated'](),controller[_0xf8d6('0x17')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index 5430bcf..52bb085 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 _0x1cb9=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x3008c5,_0x15d469){var _0x254655=function(_0x4ca1c8){while(--_0x4ca1c8){_0x3008c5['push'](_0x3008c5['shift']());}};_0x254655(++_0x15d469);}(_0x1cb9,0x14e));var _0x91cb=function(_0x2e8602,_0x1ac137){_0x2e8602=_0x2e8602-0x0;var _0x1734f2=_0x1cb9[_0x2e8602];return _0x1734f2;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')]},'description':{'type':Sequelize[_0x91cb('0x1')]},'username':{'type':Sequelize[_0x91cb('0x1')],'unique':_0x91cb('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91cb('0x1')]},'clientId':{'type':Sequelize[_0x91cb('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x91cb('0x1')]},'serverUrl':{'type':Sequelize[_0x91cb('0x1')]},'type':{'type':Sequelize[_0x91cb('0x3')](_0x91cb('0x4'),_0x91cb('0x5')),'defaultValue':_0x91cb('0x4')}}; \ No newline at end of file +var _0x1cb9=['username','ENUM','integrationTab','newTab','sequelize','STRING'];(function(_0x32abf3,_0x30e5aa){var _0x57176e=function(_0xe04803){while(--_0xe04803){_0x32abf3['push'](_0x32abf3['shift']());}};_0x57176e(++_0x30e5aa);}(_0x1cb9,0x14e));var _0x91cb=function(_0x20c508,_0x113ef2){_0x20c508=_0x20c508-0x0;var _0x421c24=_0x1cb9[_0x20c508];return _0x421c24;};'use strict';var Sequelize=require(_0x91cb('0x0'));module['exports']={'name':{'type':Sequelize[_0x91cb('0x1')]},'description':{'type':Sequelize[_0x91cb('0x1')]},'username':{'type':Sequelize[_0x91cb('0x1')],'unique':_0x91cb('0x2')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x91cb('0x1')]},'clientId':{'type':Sequelize[_0x91cb('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'securityToken':{'type':Sequelize[_0x91cb('0x1')]},'serverUrl':{'type':Sequelize[_0x91cb('0x1')]},'type':{'type':Sequelize[_0x91cb('0x3')](_0x91cb('0x4'),_0x91cb('0x5')),'defaultValue':_0x91cb('0x4')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index f112123..891970c 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 _0x53ec=['Priority','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','statusCode','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus','end','status','count','offset','limit','set','json','save','update','destroy','name','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','length','order','sort','filter','merge','where','type','VIRTUAL','options','includeAll','include','findAll','catch','show','params','keys','fields','find','create','body','getConfigurations','findOne','SalesforceConfiguration','pick','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','Descriptions','channel','getFields','Task','clientId','clientSecret','username','password','securityToken','remoteUri','substring','Connection','concat','isNil','ticketType','sobject','CallDisposition','CallDurationInSeconds','IsArchived','Status','Type','Origin','Reason'];(function(_0x578983,_0x75b1b5){var _0x26e375=function(_0x12b056){while(--_0x12b056){_0x578983['push'](_0x578983['shift']());}};_0x26e375(++_0x75b1b5);}(_0x53ec,0x192));var _0xc53e=function(_0xff5df6,_0x514e73){_0xff5df6=_0xff5df6-0x0;var _0x2634bb=_0x53ec[_0xff5df6];return _0x2634bb;};'use strict';var pdf=require(_0xc53e('0x0'));var emlformat=require(_0xc53e('0x1'));var rimraf=require(_0xc53e('0x2'));var zipdir=require(_0xc53e('0x3'));var jsonpatch=require(_0xc53e('0x4'));var rp=require(_0xc53e('0x5'));var moment=require('moment');var BPromise=require(_0xc53e('0x6'));var Mustache=require('mustache');var util=require(_0xc53e('0x7'));var path=require(_0xc53e('0x8'));var sox=require('sox');var csv=require(_0xc53e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc53e('0xa'));var squel=require(_0xc53e('0xb'));var crypto=require('crypto');var jsforce=require(_0xc53e('0xc'));var deskjs=require(_0xc53e('0xd'));var toCsv=require(_0xc53e('0x9'));var querystring=require(_0xc53e('0xe'));var Papa=require(_0xc53e('0xf'));var Redis=require(_0xc53e('0x10'));var authService=require(_0xc53e('0x11'));var qs=require(_0xc53e('0x12'));var as=require(_0xc53e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xc53e('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xc53e('0x15'))['db'];var integrations=require(_0xc53e('0x16'));var jayson=require(_0xc53e('0x17'));var client=jayson[_0xc53e('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x4e74c9,_0x1c06cd,_0x19a772){if(_0x19a772){var _0x7cd798=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7cd798[_0xc53e('0x19')](_0x1c06cd)){return _0x4e74c9;}else{throw new db[(_0xc53e('0x1a'))][(_0xc53e('0x1b'))](_0xc53e('0x1c'));}}else{return _0x4e74c9;}}function respondWithRpcPromise(_0x19c0d1,_0x455e4d,_0x2ad6eb,_0x5b0a88){return new BPromise(function(_0x8a522e,_0x191567){var _0x535cd4=_0x5b0a88||client;return _0x535cd4[_0xc53e('0x1d')](_0x19c0d1,_0x2ad6eb)[_0xc53e('0x1e')](function(_0x270c78){logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));logger['debug']('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x455e4d,_0xc53e('0x21'),JSON[_0xc53e('0x22')](_0x270c78));if(_0x270c78[_0xc53e('0x23')]){if(_0x270c78[_0xc53e('0x23')][_0xc53e('0x24')]===0x1f4){logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);return _0x191567(_0x270c78[_0xc53e('0x23')][_0xc53e('0x25')]);}logger[_0xc53e('0x23')](_0xc53e('0x20'),_0x455e4d,_0x270c78['error']['message']);return _0x8a522e(_0x270c78['error'][_0xc53e('0x25')]);}else{logger[_0xc53e('0x1f')](_0xc53e('0x20'),_0x455e4d,_0xc53e('0x21'));_0x8a522e(_0x270c78[_0xc53e('0x26')]['message']);}})['catch'](function(_0xe06e42){logger['error'](_0xc53e('0x20'),_0x455e4d,_0xe06e42);_0x191567(_0xe06e42);});});}function respondWithStatusCode(_0x3a5ce8,_0x443179){_0x443179=_0x443179||0xcc;return function(_0x1166e6){if(_0x1166e6){return _0x3a5ce8[_0xc53e('0x27')](_0x443179);}return _0x3a5ce8['status'](_0x443179)[_0xc53e('0x28')]();};}function respondWithResult(_0x4b9f6a,_0x4d9a68){_0x4d9a68=_0x4d9a68||0xc8;return function(_0x5c65d3){if(_0x5c65d3){return _0x4b9f6a[_0xc53e('0x29')](_0x4d9a68)['json'](_0x5c65d3);}};}function respondWithFilteredResult(_0x28240a,_0x4f203d){return function(_0x24a77e){if(_0x24a77e){var _0x5112d2=_0x24a77e[_0xc53e('0x2a')],_0x5ce216=_0x4f203d[_0xc53e('0x2b')],_0x8f0ee6=_0x4f203d[_0xc53e('0x2b')]+_0x4f203d[_0xc53e('0x2c')],_0x6a62b0;if(_0x8f0ee6>=_0x5112d2){_0x8f0ee6=_0x5112d2;_0x6a62b0=0xc8;}else{_0x6a62b0=0xce;}_0x28240a[_0xc53e('0x29')](_0x6a62b0);return _0x28240a[_0xc53e('0x2d')]('Content-Range',_0x5ce216+'-'+_0x8f0ee6+'/'+_0x5112d2)[_0xc53e('0x2e')](_0x24a77e);}return null;};}function patchUpdates(_0x311835){return function(_0x2d36c0){try{jsonpatch['apply'](_0x2d36c0,_0x311835,!![]);}catch(_0x4057f9){return BPromise['reject'](_0x4057f9);}return _0x2d36c0[_0xc53e('0x2f')]();};}function saveUpdates(_0x2467f4,_0x49ab9b){return function(_0x5a64e2){if(_0x5a64e2){return _0x5a64e2[_0xc53e('0x30')](_0x2467f4)[_0xc53e('0x1e')](function(_0x3f4547){return _0x3f4547;});}return null;};}function removeEntity(_0x30d037,_0x1b95c2){return function(_0x45fedc){if(_0x45fedc){return _0x45fedc[_0xc53e('0x31')]()[_0xc53e('0x1e')](function(){_0x30d037['status'](0xcc)[_0xc53e('0x28')]();});}};}function handleEntityNotFound(_0x3bae8a,_0x19020b){return function(_0x17ad32){if(!_0x17ad32){_0x3bae8a[_0xc53e('0x27')](0x194);}return _0x17ad32;};}function handleError(_0x12b32c,_0x1920c8){_0x1920c8=_0x1920c8||0x1f4;return function(_0x16942c){logger[_0xc53e('0x23')](_0x16942c['stack']);if(_0x16942c[_0xc53e('0x32')]){delete _0x16942c['name'];}_0x12b32c[_0xc53e('0x29')](_0x1920c8)[_0xc53e('0x33')](_0x16942c);};}exports['index']=function(_0x37452a,_0x154f8b){var _0x3254e9={},_0x5ed90b={},_0x4b82bb={'count':0x0,'rows':[]};var _0x17ec92=_[_0xc53e('0x34')](db[_0xc53e('0x35')][_0xc53e('0x36')],function(_0x143101){return{'name':_0x143101[_0xc53e('0x37')],'type':_0x143101['type'][_0xc53e('0x38')]};});_0x5ed90b[_0xc53e('0x39')]=_[_0xc53e('0x34')](_0x17ec92,'name');_0x5ed90b[_0xc53e('0x3a')]=_['keys'](_0x37452a[_0xc53e('0x3a')]);_0x5ed90b[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],_0x5ed90b[_0xc53e('0x3a')]);_0x3254e9['attributes']=_[_0xc53e('0x3c')](_0x5ed90b[_0xc53e('0x39')],qs['fields'](_0x37452a['query']['fields']));_0x3254e9['attributes']=_0x3254e9[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x3254e9['attributes']:_0x5ed90b[_0xc53e('0x39')];if(!_0x37452a['query']['hasOwnProperty']('nolimit')){_0x3254e9[_0xc53e('0x2c')]=qs['limit'](_0x37452a['query'][_0xc53e('0x2c')]);_0x3254e9['offset']=qs[_0xc53e('0x2b')](_0x37452a[_0xc53e('0x3a')]['offset']);}_0x3254e9[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x37452a['query'][_0xc53e('0x40')]);_0x3254e9['where']=qs['filters'](_['pick'](_0x37452a['query'],_0x5ed90b[_0xc53e('0x3b')]));if(_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x3254e9['where']=_[_0xc53e('0x42')](_0x3254e9[_0xc53e('0x43')],{'$or':_['map'](_0x17ec92,function(_0x58ede2){if(_0x58ede2[_0xc53e('0x44')]!==_0xc53e('0x45')){var _0x162acd={};_0x162acd[_0x58ede2['name']]={'$like':'%'+_0x37452a[_0xc53e('0x3a')][_0xc53e('0x41')]+'%'};return _0x162acd;}})});}_0x3254e9=_[_0xc53e('0x42')]({},_0x3254e9,_0x37452a[_0xc53e('0x46')]);var _0x1295cc={'where':_0x3254e9[_0xc53e('0x43')]};return db[_0xc53e('0x35')]['count'](_0x1295cc)[_0xc53e('0x1e')](function(_0x39c467){_0x4b82bb[_0xc53e('0x2a')]=_0x39c467;if(_0x37452a['query'][_0xc53e('0x47')]){_0x3254e9[_0xc53e('0x48')]=[{'all':!![]}];}return db[_0xc53e('0x35')][_0xc53e('0x49')](_0x3254e9);})[_0xc53e('0x1e')](function(_0x17cea5){_0x4b82bb['rows']=_0x17cea5;return _0x4b82bb;})[_0xc53e('0x1e')](respondWithFilteredResult(_0x154f8b,_0x3254e9))[_0xc53e('0x4a')](handleError(_0x154f8b,null));};exports[_0xc53e('0x4b')]=function(_0x5a6e41,_0x33d45c){var _0x1d2491={'raw':![],'where':{'id':_0x5a6e41[_0xc53e('0x4c')]['id']}},_0x1eeb65={};_0x1eeb65[_0xc53e('0x39')]=_[_0xc53e('0x4d')](db[_0xc53e('0x35')][_0xc53e('0x36')]);_0x1eeb65[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x5a6e41['query']);_0x1eeb65[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x1eeb65[_0xc53e('0x39')],_0x1eeb65[_0xc53e('0x3a')]);_0x1d2491[_0xc53e('0x3d')]=_['intersection'](_0x1eeb65['model'],qs[_0xc53e('0x4e')](_0x5a6e41['query'][_0xc53e('0x4e')]));_0x1d2491['attributes']=_0x1d2491[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x1d2491[_0xc53e('0x3d')]:_0x1eeb65['model'];if(_0x5a6e41[_0xc53e('0x3a')][_0xc53e('0x47')]){_0x1d2491[_0xc53e('0x48')]=[{'all':!![]}];}_0x1d2491=_['merge']({},_0x1d2491,_0x5a6e41[_0xc53e('0x46')]);return db['SalesforceAccount'][_0xc53e('0x4f')](_0x1d2491)[_0xc53e('0x1e')](handleEntityNotFound(_0x33d45c,null))['then'](respondWithResult(_0x33d45c,null))[_0xc53e('0x4a')](handleError(_0x33d45c,null));};exports[_0xc53e('0x50')]=function(_0x5bba72,_0x44f7cc){return db[_0xc53e('0x35')][_0xc53e('0x50')](_0x5bba72[_0xc53e('0x51')],{})[_0xc53e('0x1e')](respondWithResult(_0x44f7cc,0xc9))[_0xc53e('0x4a')](handleError(_0x44f7cc,null));};exports[_0xc53e('0x30')]=function(_0x117c9b,_0x8e5630){if(_0x117c9b[_0xc53e('0x51')]['id']){delete _0x117c9b[_0xc53e('0x51')]['id'];}return db['SalesforceAccount'][_0xc53e('0x4f')]({'where':{'id':_0x117c9b['params']['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x8e5630,null))['then'](saveUpdates(_0x117c9b[_0xc53e('0x51')],null))[_0xc53e('0x1e')](respondWithResult(_0x8e5630,null))['catch'](handleError(_0x8e5630,null));};exports[_0xc53e('0x31')]=function(_0x7f0bc0,_0x9c0112){return db[_0xc53e('0x35')]['find']({'where':{'id':_0x7f0bc0[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x9c0112,null))['then'](removeEntity(_0x9c0112,null))['catch'](handleError(_0x9c0112,null));};exports[_0xc53e('0x52')]=function(_0x51db9a,_0x5c62c7,_0x57c822){var _0x23a4ee={};var _0x5f5dad={};var _0x32b390;var _0x4ee995;return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x51db9a[_0xc53e('0x4c')]['id']}})[_0xc53e('0x1e')](handleEntityNotFound(_0x5c62c7,null))[_0xc53e('0x1e')](function(_0x4caf5f){if(_0x4caf5f){_0x32b390=_0x4caf5f;_0x5f5dad['model']=_[_0xc53e('0x4d')](db[_0xc53e('0x54')][_0xc53e('0x36')]);_0x5f5dad[_0xc53e('0x3a')]=_[_0xc53e('0x4d')](_0x51db9a[_0xc53e('0x3a')]);_0x5f5dad[_0xc53e('0x3b')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],_0x5f5dad[_0xc53e('0x3a')]);_0x23a4ee[_0xc53e('0x3d')]=_[_0xc53e('0x3c')](_0x5f5dad[_0xc53e('0x39')],qs['fields'](_0x51db9a[_0xc53e('0x3a')]['fields']));_0x23a4ee[_0xc53e('0x3d')]=_0x23a4ee[_0xc53e('0x3d')][_0xc53e('0x3e')]?_0x23a4ee[_0xc53e('0x3d')]:_0x5f5dad[_0xc53e('0x39')];_0x23a4ee[_0xc53e('0x3f')]=qs[_0xc53e('0x40')](_0x51db9a[_0xc53e('0x3a')]['sort']);_0x23a4ee['where']=qs['filters'](_[_0xc53e('0x55')](_0x51db9a[_0xc53e('0x3a')],_0x5f5dad[_0xc53e('0x3b')]));if(_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x41')]){_0x23a4ee[_0xc53e('0x43')]=_[_0xc53e('0x42')](_0x23a4ee['where'],{'$or':_['map'](_0x23a4ee['attributes'],function(_0x40c8ba){var _0x150212={};_0x150212[_0x40c8ba]={'$like':'%'+_0x51db9a['query'][_0xc53e('0x41')]+'%'};return _0x150212;})});}_0x23a4ee=_[_0xc53e('0x42')]({},_0x23a4ee,_0x51db9a[_0xc53e('0x46')]);return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})[_0xc53e('0x1e')](function(_0x20cb31){if(_0x20cb31){_0x4ee995=_0x20cb31['length'];if(!_0x51db9a['query'][_0xc53e('0x56')](_0xc53e('0x57'))){_0x23a4ee[_0xc53e('0x2c')]=qs[_0xc53e('0x2c')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2c')]);_0x23a4ee['offset']=qs[_0xc53e('0x2b')](_0x51db9a[_0xc53e('0x3a')][_0xc53e('0x2b')]);}return _0x32b390[_0xc53e('0x52')](_0x23a4ee);}})['then'](function(_0xdd851e){if(_0xdd851e){return _0xdd851e?{'count':_0x4ee995,'rows':_0xdd851e}:null;}})[_0xc53e('0x1e')](respondWithResult(_0x5c62c7,null))[_0xc53e('0x4a')](handleError(_0x5c62c7,null));};exports[_0xc53e('0x58')]=function(_0x32f954,_0x2d9803,_0x51638a){if(_0x32f954[_0xc53e('0x51')]['id']){delete _0x32f954[_0xc53e('0x51')]['id'];}return db[_0xc53e('0x35')][_0xc53e('0x53')]({'where':{'id':_0x32f954['params']['id']}})['then'](handleEntityNotFound(_0x2d9803,null))[_0xc53e('0x1e')](function(_0x340123){if(_0x340123){_0x32f954[_0xc53e('0x51')][_0xc53e('0x59')]=_0x340123['id'];_0x32f954['body'][_0xc53e('0x5a')]=integrations['getSubjects'](_0x32f954[_0xc53e('0x51')]['channel'],_0x32f954[_0xc53e('0x51')]['type']);_0x32f954[_0xc53e('0x51')][_0xc53e('0x5b')]=integrations['getDescriptions'](_0x32f954[_0xc53e('0x51')][_0xc53e('0x5c')],_0x32f954['body']['type']);return db[_0xc53e('0x54')][_0xc53e('0x50')](_0x32f954['body'],{'include':[{'model':db['SalesforceField'],'as':_0xc53e('0x5a')},{'model':db['SalesforceField'],'as':_0xc53e('0x5b')}]});}return null;})['then'](respondWithResult(_0x2d9803,null))[_0xc53e('0x4a')](handleError(_0x2d9803,null));};exports[_0xc53e('0x5d')]=function(_0x10167b,_0x388874,_0x45cee1){var _0x20067c;var _0x143f15='';var _0x15eac2=_0xc53e('0x5e');return db[_0xc53e('0x35')]['findOne']({'where':{'id':_0x10167b[_0xc53e('0x4c')]['id']},'attributes':['id','remoteUri',_0xc53e('0x5f'),_0xc53e('0x60'),_0xc53e('0x61'),_0xc53e('0x62'),_0xc53e('0x63')]})[_0xc53e('0x1e')](handleEntityNotFound(_0x388874,null))[_0xc53e('0x1e')](function(_0x3cc2c7){if(_0x3cc2c7){_0x143f15=_0x3cc2c7[_0xc53e('0x64')];var _0x1f572b=_0x143f15['slice'](-0x1);if(_0x1f572b==='/'){_0x143f15=_0x143f15[_0xc53e('0x65')](0x0,_0x143f15['lastIndexOf'](_0x1f572b));}_0x20067c=new jsforce[(_0xc53e('0x66'))]({'oauth2':{'loginUrl':_0x143f15,'clientId':_0x3cc2c7[_0xc53e('0x5f')],'clientSecret':_0x3cc2c7[_0xc53e('0x60')]}});return _0x20067c['login'](_0x3cc2c7[_0xc53e('0x61')],_0x3cc2c7[_0xc53e('0x62')][_0xc53e('0x67')](_0x3cc2c7[_0xc53e('0x63')]));}})[_0xc53e('0x1e')](function(_0x508671){if(_0x508671){if(!_[_0xc53e('0x68')](_0x10167b[_0xc53e('0x3a')]['ticketType'])){_0x15eac2=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')];}return _0x20067c[_0xc53e('0x6a')](_0x15eac2)['describe']();}})[_0xc53e('0x1e')](function(_0x499725){var _0x49bed2=[_0xc53e('0x6b'),_0xc53e('0x6c'),'CallObject','CallType',_0xc53e('0x6d'),'Priority',_0xc53e('0x6e'),_0xc53e('0x6f')];if(!_[_0xc53e('0x68')](_0x10167b['query'][_0xc53e('0x69')])&&_0x10167b[_0xc53e('0x3a')][_0xc53e('0x69')]==='Case'){_0x49bed2=[_0xc53e('0x6f'),_0xc53e('0x70'),_0xc53e('0x71'),_0xc53e('0x6e'),_0xc53e('0x72'),'IsEscalated',_0xc53e('0x73'),_0xc53e('0x74')];}if(_0x499725){_[_0xc53e('0x75')](_0x499725[_0xc53e('0x4e')],function(_0xe6a976){return _0xe6a976[_0xc53e('0x76')]===![]&&!_0x49bed2[_0xc53e('0x77')](_0xe6a976[_0xc53e('0x32')]);});return{'count':_0x499725[_0xc53e('0x4e')]['length'],'rows':_[_0xc53e('0x34')](_0x499725[_0xc53e('0x4e')],function(_0x1c06bc){return{'id':_0x1c06bc[_0xc53e('0x32')],'name':_0x1c06bc[_0xc53e('0x78')],'custom':_0x1c06bc[_0xc53e('0x76')],'options':_0x1c06bc[_0xc53e('0x79')][_0xc53e('0x3e')]>0x0?_[_0xc53e('0x34')](_0x1c06bc['picklistValues'],function(_0x3a54ef){return{'name':_0x3a54ef[_0xc53e('0x78')],'value':_0x3a54ef[_0xc53e('0x7a')]};}):_0x1c06bc[_0xc53e('0x44')]=='boolean'?[{'name':_0xc53e('0x7b'),'value':_0xc53e('0x7c')},{'name':_0xc53e('0x7d'),'value':_0xc53e('0x7e')}]:[]};})};}})['then'](respondWithResult(_0x388874,null))[_0xc53e('0x4a')](function(_0x138870){var _0xa90198=_0x10167b[_0xc53e('0x3a')][_0xc53e('0x19')]?0x1f4:_0x138870[_0xc53e('0x7f')]||0x1f4;logger[_0xc53e('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0xc53e('0x5d'),_0xa90198,JSON['stringify'](_0x138870));delete _0x138870[_0xc53e('0x32')];if(_0xa90198===0x191){_0xa90198=0x190;}_0x388874[_0xc53e('0x29')](_0xa90198)[_0xc53e('0x33')](_0x10167b['query'][_0xc53e('0x19')]?{'message':_0xc53e('0x80'),'statusCode':_0x138870[_0xc53e('0x7f')]}:_0x138870);});}; \ No newline at end of file +var _0x1261=['where','VIRTUAL','options','include','params','keys','length','includeAll','create','body','find','getConfigurations','findOne','SalesforceConfiguration','filter','merge','addConfiguration','AccountId','Subjects','getSubjects','type','Descriptions','getDescriptions','channel','SalesforceField','getFields','Task','remoteUri','clientId','securityToken','slice','lastIndexOf','Connection','clientSecret','login','password','concat','isNil','ticketType','sobject','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','Priority','Status','Type','Origin','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','picklistValues','label','value','boolean','False','getFields,\x20%s,\x20%s,\x20%s','statusCode','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','stringify','error','code','message','SalesforceAccount,\x20%s,\x20%s','catch','sendStatus','end','json','count','offset','status','apply','reject','save','update','destroy','stack','send','map','SalesforceAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','pick'];(function(_0x57486e,_0x32283b){var _0x5f110b=function(_0xa18fc3){while(--_0xa18fc3){_0x57486e['push'](_0x57486e['shift']());}};_0x5f110b(++_0x32283b);}(_0x1261,0x144));var _0x1126=function(_0x212b03,_0x1f1b50){_0x212b03=_0x212b03-0x0;var _0x423115=_0x1261[_0x212b03];return _0x423115;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];var integrations=require(_0x1126('0x17'));var jayson=require(_0x1126('0x18'));var client=jayson[_0x1126('0x19')][_0x1126('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x3f10e9,_0xd8ca42,_0x2048ad){if(_0x2048ad){var _0x43850b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x43850b['test'](_0xd8ca42)){return _0x3f10e9;}else{throw new db['Sequelize'][(_0x1126('0x1b'))](_0x1126('0x1c'));}}else{return _0x3f10e9;}}function respondWithRpcPromise(_0x279455,_0x4be0c6,_0x45149c,_0x4794a7){return new BPromise(function(_0x35fe9f,_0x42f379){var _0x257b5f=_0x4794a7||client;return _0x257b5f['request'](_0x279455,_0x45149c)[_0x1126('0x1d')](function(_0x1695f6){logger['info']('SalesforceAccount,\x20%s,\x20%s',_0x4be0c6,_0x1126('0x1e'));logger[_0x1126('0x1f')]('SalesforceAccount,\x20%s,\x20%s,\x20%s',_0x4be0c6,'request\x20sent',JSON[_0x1126('0x20')](_0x1695f6));if(_0x1695f6['error']){if(_0x1695f6[_0x1126('0x21')][_0x1126('0x22')]===0x1f4){logger[_0x1126('0x21')]('SalesforceAccount,\x20%s,\x20%s',_0x4be0c6,_0x1695f6[_0x1126('0x21')]['message']);return _0x42f379(_0x1695f6['error'][_0x1126('0x23')]);}logger[_0x1126('0x21')](_0x1126('0x24'),_0x4be0c6,_0x1695f6[_0x1126('0x21')]['message']);return _0x35fe9f(_0x1695f6[_0x1126('0x21')][_0x1126('0x23')]);}else{logger['info'](_0x1126('0x24'),_0x4be0c6,'request\x20sent');_0x35fe9f(_0x1695f6['result']['message']);}})[_0x1126('0x25')](function(_0x15bcc3){logger[_0x1126('0x21')](_0x1126('0x24'),_0x4be0c6,_0x15bcc3);_0x42f379(_0x15bcc3);});});}function respondWithStatusCode(_0x566c09,_0x1b07a7){_0x1b07a7=_0x1b07a7||0xcc;return function(_0xea0971){if(_0xea0971){return _0x566c09[_0x1126('0x26')](_0x1b07a7);}return _0x566c09['status'](_0x1b07a7)[_0x1126('0x27')]();};}function respondWithResult(_0x375e59,_0xa293f4){_0xa293f4=_0xa293f4||0xc8;return function(_0x5ddf63){if(_0x5ddf63){return _0x375e59['status'](_0xa293f4)[_0x1126('0x28')](_0x5ddf63);}};}function respondWithFilteredResult(_0x39bf0e,_0x55e195){return function(_0x2fb797){if(_0x2fb797){var _0x23d2bc=_0x2fb797[_0x1126('0x29')],_0x4a334a=_0x55e195['offset'],_0x3fa694=_0x55e195[_0x1126('0x2a')]+_0x55e195['limit'],_0x4bf807;if(_0x3fa694>=_0x23d2bc){_0x3fa694=_0x23d2bc;_0x4bf807=0xc8;}else{_0x4bf807=0xce;}_0x39bf0e[_0x1126('0x2b')](_0x4bf807);return _0x39bf0e['set']('Content-Range',_0x4a334a+'-'+_0x3fa694+'/'+_0x23d2bc)['json'](_0x2fb797);}return null;};}function patchUpdates(_0x17646e){return function(_0xa8906d){try{jsonpatch[_0x1126('0x2c')](_0xa8906d,_0x17646e,!![]);}catch(_0x5b8bea){return BPromise[_0x1126('0x2d')](_0x5b8bea);}return _0xa8906d[_0x1126('0x2e')]();};}function saveUpdates(_0x56f7f8,_0x3dd50e){return function(_0x1e80aa){if(_0x1e80aa){return _0x1e80aa[_0x1126('0x2f')](_0x56f7f8)[_0x1126('0x1d')](function(_0x5836a2){return _0x5836a2;});}return null;};}function removeEntity(_0x5ecbc3,_0x2a7edc){return function(_0x19e6e4){if(_0x19e6e4){return _0x19e6e4[_0x1126('0x30')]()[_0x1126('0x1d')](function(){_0x5ecbc3['status'](0xcc)[_0x1126('0x27')]();});}};}function handleEntityNotFound(_0x6f4312,_0x313ebe){return function(_0x22436c){if(!_0x22436c){_0x6f4312[_0x1126('0x26')](0x194);}return _0x22436c;};}function handleError(_0x5df232,_0x2a0dfe){_0x2a0dfe=_0x2a0dfe||0x1f4;return function(_0x457efd){logger[_0x1126('0x21')](_0x457efd[_0x1126('0x31')]);if(_0x457efd['name']){delete _0x457efd['name'];}_0x5df232[_0x1126('0x2b')](_0x2a0dfe)[_0x1126('0x32')](_0x457efd);};}exports['index']=function(_0xde37cf,_0xf3c21b){var _0x11b0f6={},_0x5c08b9={},_0x4b3859={'count':0x0,'rows':[]};var _0x522c14=_[_0x1126('0x33')](db[_0x1126('0x34')][_0x1126('0x35')],function(_0x4a202e){return{'name':_0x4a202e[_0x1126('0x36')],'type':_0x4a202e['type'][_0x1126('0x37')]};});_0x5c08b9[_0x1126('0x38')]=_[_0x1126('0x33')](_0x522c14,_0x1126('0x39'));_0x5c08b9[_0x1126('0x3a')]=_['keys'](_0xde37cf[_0x1126('0x3a')]);_0x5c08b9[_0x1126('0x3b')]=_[_0x1126('0x3c')](_0x5c08b9[_0x1126('0x38')],_0x5c08b9[_0x1126('0x3a')]);_0x11b0f6[_0x1126('0x3d')]=_[_0x1126('0x3c')](_0x5c08b9['model'],qs[_0x1126('0x3e')](_0xde37cf[_0x1126('0x3a')][_0x1126('0x3e')]));_0x11b0f6[_0x1126('0x3d')]=_0x11b0f6[_0x1126('0x3d')]['length']?_0x11b0f6['attributes']:_0x5c08b9[_0x1126('0x38')];if(!_0xde37cf[_0x1126('0x3a')][_0x1126('0x3f')](_0x1126('0x40'))){_0x11b0f6[_0x1126('0x41')]=qs[_0x1126('0x41')](_0xde37cf['query']['limit']);_0x11b0f6['offset']=qs[_0x1126('0x2a')](_0xde37cf['query'][_0x1126('0x2a')]);}_0x11b0f6[_0x1126('0x42')]=qs[_0x1126('0x43')](_0xde37cf[_0x1126('0x3a')]['sort']);_0x11b0f6['where']=qs[_0x1126('0x3b')](_[_0x1126('0x44')](_0xde37cf[_0x1126('0x3a')],_0x5c08b9['filters']));if(_0xde37cf[_0x1126('0x3a')]['filter']){_0x11b0f6[_0x1126('0x45')]=_['merge'](_0x11b0f6[_0x1126('0x45')],{'$or':_[_0x1126('0x33')](_0x522c14,function(_0x1006fb){if(_0x1006fb['type']!==_0x1126('0x46')){var _0x2ffccc={};_0x2ffccc[_0x1006fb[_0x1126('0x39')]]={'$like':'%'+_0xde37cf['query']['filter']+'%'};return _0x2ffccc;}})});}_0x11b0f6=_['merge']({},_0x11b0f6,_0xde37cf[_0x1126('0x47')]);var _0x520b62={'where':_0x11b0f6[_0x1126('0x45')]};return db['SalesforceAccount'][_0x1126('0x29')](_0x520b62)[_0x1126('0x1d')](function(_0x146066){_0x4b3859[_0x1126('0x29')]=_0x146066;if(_0xde37cf[_0x1126('0x3a')]['includeAll']){_0x11b0f6[_0x1126('0x48')]=[{'all':!![]}];}return db[_0x1126('0x34')]['findAll'](_0x11b0f6);})[_0x1126('0x1d')](function(_0x13dc39){_0x4b3859['rows']=_0x13dc39;return _0x4b3859;})[_0x1126('0x1d')](respondWithFilteredResult(_0xf3c21b,_0x11b0f6))[_0x1126('0x25')](handleError(_0xf3c21b,null));};exports['show']=function(_0x3e4eeb,_0xbdde58){var _0x213a76={'raw':![],'where':{'id':_0x3e4eeb[_0x1126('0x49')]['id']}},_0x59656d={};_0x59656d[_0x1126('0x38')]=_[_0x1126('0x4a')](db[_0x1126('0x34')][_0x1126('0x35')]);_0x59656d[_0x1126('0x3a')]=_[_0x1126('0x4a')](_0x3e4eeb[_0x1126('0x3a')]);_0x59656d['filters']=_[_0x1126('0x3c')](_0x59656d['model'],_0x59656d[_0x1126('0x3a')]);_0x213a76[_0x1126('0x3d')]=_['intersection'](_0x59656d['model'],qs[_0x1126('0x3e')](_0x3e4eeb[_0x1126('0x3a')][_0x1126('0x3e')]));_0x213a76['attributes']=_0x213a76[_0x1126('0x3d')][_0x1126('0x4b')]?_0x213a76[_0x1126('0x3d')]:_0x59656d[_0x1126('0x38')];if(_0x3e4eeb['query'][_0x1126('0x4c')]){_0x213a76[_0x1126('0x48')]=[{'all':!![]}];}_0x213a76=_['merge']({},_0x213a76,_0x3e4eeb['options']);return db['SalesforceAccount']['find'](_0x213a76)[_0x1126('0x1d')](handleEntityNotFound(_0xbdde58,null))[_0x1126('0x1d')](respondWithResult(_0xbdde58,null))['catch'](handleError(_0xbdde58,null));};exports[_0x1126('0x4d')]=function(_0x1c7a2b,_0x38093e){return db[_0x1126('0x34')][_0x1126('0x4d')](_0x1c7a2b['body'],{})[_0x1126('0x1d')](respondWithResult(_0x38093e,0xc9))[_0x1126('0x25')](handleError(_0x38093e,null));};exports['update']=function(_0x322016,_0x476aca){if(_0x322016[_0x1126('0x4e')]['id']){delete _0x322016[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')]['find']({'where':{'id':_0x322016[_0x1126('0x49')]['id']}})['then'](handleEntityNotFound(_0x476aca,null))[_0x1126('0x1d')](saveUpdates(_0x322016[_0x1126('0x4e')],null))[_0x1126('0x1d')](respondWithResult(_0x476aca,null))['catch'](handleError(_0x476aca,null));};exports[_0x1126('0x30')]=function(_0x2340f8,_0x5763b4){return db[_0x1126('0x34')][_0x1126('0x4f')]({'where':{'id':_0x2340f8[_0x1126('0x49')]['id']}})['then'](handleEntityNotFound(_0x5763b4,null))[_0x1126('0x1d')](removeEntity(_0x5763b4,null))[_0x1126('0x25')](handleError(_0x5763b4,null));};exports[_0x1126('0x50')]=function(_0x308ee4,_0x128c94,_0x26949c){var _0x30c848={};var _0x114be2={};var _0x47e53d;var _0x2b23e3;return db[_0x1126('0x34')][_0x1126('0x51')]({'where':{'id':_0x308ee4[_0x1126('0x49')]['id']}})[_0x1126('0x1d')](handleEntityNotFound(_0x128c94,null))['then'](function(_0xcc1a95){if(_0xcc1a95){_0x47e53d=_0xcc1a95;_0x114be2[_0x1126('0x38')]=_['keys'](db[_0x1126('0x52')]['rawAttributes']);_0x114be2[_0x1126('0x3a')]=_[_0x1126('0x4a')](_0x308ee4['query']);_0x114be2[_0x1126('0x3b')]=_[_0x1126('0x3c')](_0x114be2[_0x1126('0x38')],_0x114be2['query']);_0x30c848[_0x1126('0x3d')]=_['intersection'](_0x114be2['model'],qs[_0x1126('0x3e')](_0x308ee4[_0x1126('0x3a')][_0x1126('0x3e')]));_0x30c848[_0x1126('0x3d')]=_0x30c848[_0x1126('0x3d')][_0x1126('0x4b')]?_0x30c848[_0x1126('0x3d')]:_0x114be2['model'];_0x30c848[_0x1126('0x42')]=qs[_0x1126('0x43')](_0x308ee4[_0x1126('0x3a')][_0x1126('0x43')]);_0x30c848[_0x1126('0x45')]=qs[_0x1126('0x3b')](_['pick'](_0x308ee4['query'],_0x114be2[_0x1126('0x3b')]));if(_0x308ee4[_0x1126('0x3a')]['filter']){_0x30c848['where']=_['merge'](_0x30c848['where'],{'$or':_[_0x1126('0x33')](_0x30c848[_0x1126('0x3d')],function(_0x3440c5){var _0x50f9c7={};_0x50f9c7[_0x3440c5]={'$like':'%'+_0x308ee4[_0x1126('0x3a')][_0x1126('0x53')]+'%'};return _0x50f9c7;})});}_0x30c848=_[_0x1126('0x54')]({},_0x30c848,_0x308ee4[_0x1126('0x47')]);return _0x47e53d[_0x1126('0x50')](_0x30c848);}})[_0x1126('0x1d')](function(_0x131056){if(_0x131056){_0x2b23e3=_0x131056['length'];if(!_0x308ee4[_0x1126('0x3a')][_0x1126('0x3f')](_0x1126('0x40'))){_0x30c848[_0x1126('0x41')]=qs[_0x1126('0x41')](_0x308ee4['query']['limit']);_0x30c848[_0x1126('0x2a')]=qs[_0x1126('0x2a')](_0x308ee4['query'][_0x1126('0x2a')]);}return _0x47e53d[_0x1126('0x50')](_0x30c848);}})[_0x1126('0x1d')](function(_0x6a41c0){if(_0x6a41c0){return _0x6a41c0?{'count':_0x2b23e3,'rows':_0x6a41c0}:null;}})[_0x1126('0x1d')](respondWithResult(_0x128c94,null))[_0x1126('0x25')](handleError(_0x128c94,null));};exports[_0x1126('0x55')]=function(_0x247f12,_0xd20fbe,_0x3d5e15){if(_0x247f12[_0x1126('0x4e')]['id']){delete _0x247f12[_0x1126('0x4e')]['id'];}return db[_0x1126('0x34')]['findOne']({'where':{'id':_0x247f12[_0x1126('0x49')]['id']}})[_0x1126('0x1d')](handleEntityNotFound(_0xd20fbe,null))[_0x1126('0x1d')](function(_0x53ea9a){if(_0x53ea9a){_0x247f12['body'][_0x1126('0x56')]=_0x53ea9a['id'];_0x247f12[_0x1126('0x4e')][_0x1126('0x57')]=integrations[_0x1126('0x58')](_0x247f12['body']['channel'],_0x247f12['body'][_0x1126('0x59')]);_0x247f12[_0x1126('0x4e')][_0x1126('0x5a')]=integrations[_0x1126('0x5b')](_0x247f12['body'][_0x1126('0x5c')],_0x247f12['body'][_0x1126('0x59')]);return db[_0x1126('0x52')][_0x1126('0x4d')](_0x247f12[_0x1126('0x4e')],{'include':[{'model':db[_0x1126('0x5d')],'as':_0x1126('0x57')},{'model':db[_0x1126('0x5d')],'as':'Descriptions'}]});}return null;})[_0x1126('0x1d')](respondWithResult(_0xd20fbe,null))['catch'](handleError(_0xd20fbe,null));};exports[_0x1126('0x5e')]=function(_0x906531,_0x4dd275,_0x376175){var _0x372fbe;var _0x5f3b19='';var _0x29daa6=_0x1126('0x5f');return db['SalesforceAccount']['findOne']({'where':{'id':_0x906531[_0x1126('0x49')]['id']},'attributes':['id',_0x1126('0x60'),_0x1126('0x61'),'clientSecret','username','password',_0x1126('0x62')]})['then'](handleEntityNotFound(_0x4dd275,null))['then'](function(_0x2db627){if(_0x2db627){_0x5f3b19=_0x2db627['remoteUri'];var _0x1f320e=_0x5f3b19[_0x1126('0x63')](-0x1);if(_0x1f320e==='/'){_0x5f3b19=_0x5f3b19['substring'](0x0,_0x5f3b19[_0x1126('0x64')](_0x1f320e));}_0x372fbe=new jsforce[(_0x1126('0x65'))]({'oauth2':{'loginUrl':_0x5f3b19,'clientId':_0x2db627[_0x1126('0x61')],'clientSecret':_0x2db627[_0x1126('0x66')]}});return _0x372fbe[_0x1126('0x67')](_0x2db627['username'],_0x2db627[_0x1126('0x68')][_0x1126('0x69')](_0x2db627['securityToken']));}})[_0x1126('0x1d')](function(_0x2d6fcf){if(_0x2d6fcf){if(!_[_0x1126('0x6a')](_0x906531[_0x1126('0x3a')][_0x1126('0x6b')])){_0x29daa6=_0x906531[_0x1126('0x3a')][_0x1126('0x6b')];}return _0x372fbe[_0x1126('0x6c')](_0x29daa6)[_0x1126('0x6d')]();}})[_0x1126('0x1d')](function(_0xbe2a8f){var _0x3af321=[_0x1126('0x6e'),_0x1126('0x6f'),_0x1126('0x70'),_0x1126('0x71'),'IsArchived',_0x1126('0x72'),_0x1126('0x73'),_0x1126('0x74')];if(!_[_0x1126('0x6a')](_0x906531[_0x1126('0x3a')]['ticketType'])&&_0x906531[_0x1126('0x3a')]['ticketType']==='Case'){_0x3af321=[_0x1126('0x74'),_0x1126('0x75'),'Reason','Status',_0x1126('0x72'),_0x1126('0x76'),_0x1126('0x77'),_0x1126('0x78')];}if(_0xbe2a8f){_[_0x1126('0x79')](_0xbe2a8f[_0x1126('0x3e')],function(_0x2d7150){return _0x2d7150[_0x1126('0x7a')]===![]&&!_0x3af321[_0x1126('0x7b')](_0x2d7150['name']);});return{'count':_0xbe2a8f[_0x1126('0x3e')][_0x1126('0x4b')],'rows':_[_0x1126('0x33')](_0xbe2a8f[_0x1126('0x3e')],function(_0x23c4ab){return{'id':_0x23c4ab[_0x1126('0x39')],'name':_0x23c4ab['label'],'custom':_0x23c4ab[_0x1126('0x7a')],'options':_0x23c4ab[_0x1126('0x7c')][_0x1126('0x4b')]>0x0?_[_0x1126('0x33')](_0x23c4ab[_0x1126('0x7c')],function(_0x1796eb){return{'name':_0x1796eb[_0x1126('0x7d')],'value':_0x1796eb[_0x1126('0x7e')]};}):_0x23c4ab[_0x1126('0x59')]==_0x1126('0x7f')?[{'name':'True','value':'true'},{'name':_0x1126('0x80'),'value':'false'}]:[]};})};}})[_0x1126('0x1d')](respondWithResult(_0x4dd275,null))['catch'](function(_0x4461ae){var _0x5059d3=_0x906531[_0x1126('0x3a')]['test']?0x1f4:_0x4461ae['statusCode']||0x1f4;logger['error'](_0x1126('0x81'),_0x1126('0x5e'),_0x5059d3,JSON['stringify'](_0x4461ae));delete _0x4461ae['name'];if(_0x5059d3===0x191){_0x5059d3=0x190;}_0x4dd275[_0x1126('0x2b')](_0x5059d3)[_0x1126('0x32')](_0x906531[_0x1126('0x3a')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x4461ae[_0x1126('0x82')]}:_0x4461ae);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 8a0b86c..b8c5ba1 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 _0x72b6=['request-promise','rimraf','../../config/environment','./intSalesforceAccount.attributes','exports','define','SalesforceAccount','int_salesforce_accounts','util','../../config/logger','moment','bluebird'];(function(_0x2b78e3,_0x57aced){var _0x3e41f5=function(_0x2e5456){while(--_0x2e5456){_0x2b78e3['push'](_0x2b78e3['shift']());}};_0x3e41f5(++_0x57aced);}(_0x72b6,0x158));var _0x672b=function(_0xc9855f,_0x18003a){_0xc9855f=_0xc9855f-0x0;var _0x55c32d=_0x72b6[_0xc9855f];return _0x55c32d;};'use strict';var _=require('lodash');var util=require(_0x672b('0x0'));var logger=require(_0x672b('0x1'))('api');var moment=require(_0x672b('0x2'));var BPromise=require(_0x672b('0x3'));var rp=require(_0x672b('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x672b('0x5'));var config=require(_0x672b('0x6'));var attributes=require(_0x672b('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x672b('0x8')]=function(_0x448cb0,_0x558a32){return _0x448cb0[_0x672b('0x9')](_0x672b('0xa'),attributes,{'tableName':_0x672b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xafb3=['int_salesforce_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount'];(function(_0x54f526,_0x530115){var _0x589c1f=function(_0x4cdfcc){while(--_0x4cdfcc){_0x54f526['push'](_0x54f526['shift']());}};_0x589c1f(++_0x530115);}(_0xafb3,0x13c));var _0x3afb=function(_0x538067,_0x16dfd6){_0x538067=_0x538067-0x0;var _0x444f14=_0xafb3[_0x538067];return _0x444f14;};'use strict';var _=require(_0x3afb('0x0'));var util=require(_0x3afb('0x1'));var logger=require(_0x3afb('0x2'))(_0x3afb('0x3'));var moment=require(_0x3afb('0x4'));var BPromise=require(_0x3afb('0x5'));var rp=require(_0x3afb('0x6'));var fs=require('fs');var path=require(_0x3afb('0x7'));var rimraf=require(_0x3afb('0x8'));var config=require('../../config/environment');var attributes=require(_0x3afb('0x9'));var integrations=require(_0x3afb('0xa'));module[_0x3afb('0xb')]=function(_0x532fbf,_0x18274e){return _0x532fbf[_0x3afb('0xc')](_0x3afb('0xd'),attributes,{'tableName':_0x3afb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js b/server/api/intSalesforceAccount/intSalesforceAccount.rpc.js index 2dddc01..a65afd9 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 _0x2bc6=['request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','SalesforceAccount','options','raw','where','attributes','limit','include','map','model','catch','ShowSalesforceAccount','find','lodash','util','moment','../../config/utils','rpc','../../config/environment','client','http'];(function(_0x5e1636,_0x4ff69f){var _0x505ed2=function(_0x37ce35){while(--_0x37ce35){_0x5e1636['push'](_0x5e1636['shift']());}};_0x505ed2(++_0x4ff69f);}(_0x2bc6,0x163));var _0x62bc=function(_0x4546d7,_0x5bba6a){_0x4546d7=_0x4546d7-0x0;var _0x6572b=_0x2bc6[_0x4546d7];return _0x6572b;};'use strict';var _=require(_0x62bc('0x0'));var util=require(_0x62bc('0x1'));var moment=require(_0x62bc('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x62bc('0x3'));var logger=require('../../config/logger')(_0x62bc('0x4'));var config=require(_0x62bc('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x62bc('0x6')][_0x62bc('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x40af10,_0x3f3dc9,_0x3ed6ad){return new BPromise(function(_0x3f625c,_0x5bedeb){return client[_0x62bc('0x8')](_0x40af10,_0x3ed6ad)[_0x62bc('0x9')](function(_0x1917e1){logger[_0x62bc('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3f3dc9,_0x62bc('0xb'));logger[_0x62bc('0xc')](_0x62bc('0xd'),_0x3f3dc9,'request\x20sent',JSON[_0x62bc('0xe')](_0x1917e1));if(_0x1917e1[_0x62bc('0xf')]){if(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x10')]===0x1f4){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')]['message']);return _0x5bedeb(_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);}logger['error'](_0x62bc('0x11'),_0x3f3dc9,_0x1917e1[_0x62bc('0xf')][_0x62bc('0x12')]);return _0x3f625c(_0x1917e1['error'][_0x62bc('0x12')]);}else{logger[_0x62bc('0xa')]('SalesforceAccount,\x20%s,\x20%s',_0x3f3dc9,'request\x20sent');_0x3f625c(_0x1917e1[_0x62bc('0x13')][_0x62bc('0x12')]);}})['catch'](function(_0x278893){logger[_0x62bc('0xf')](_0x62bc('0x11'),_0x3f3dc9,_0x278893);_0x5bedeb(_0x278893);});});}exports[_0x62bc('0x14')]=function(_0xc95407){var _0x31dd9f=this;return new Promise(function(_0x1d3d8f,_0x3111ab){return db[_0x62bc('0x15')]['findAll']({'raw':_0xc95407['options']?_0xc95407[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0xc95407[_0x62bc('0x16')]?_0xc95407['options'][_0x62bc('0x18')]||null:null,'attributes':_0xc95407['options']?_0xc95407[_0x62bc('0x16')][_0x62bc('0x19')]||null:null,'limit':_0xc95407[_0x62bc('0x16')]?_0xc95407['options'][_0x62bc('0x1a')]||null:null,'include':_0xc95407[_0x62bc('0x16')]?_0xc95407[_0x62bc('0x16')][_0x62bc('0x1b')]?_[_0x62bc('0x1c')](_0xc95407[_0x62bc('0x16')]['include'],function(_0x70e428){return{'model':db[_0x70e428[_0x62bc('0x1d')]],'as':_0x70e428['as'],'attributes':_0x70e428[_0x62bc('0x19')],'include':_0x70e428[_0x62bc('0x1b')]?_[_0x62bc('0x1c')](_0x70e428['include'],function(_0x52ca86){return{'model':db[_0x52ca86[_0x62bc('0x1d')]],'as':_0x52ca86['as'],'attributes':_0x52ca86['attributes'],'include':_0x52ca86[_0x62bc('0x1b')]?_[_0x62bc('0x1c')](_0x52ca86[_0x62bc('0x1b')],function(_0x4a72d6){return{'model':db[_0x4a72d6[_0x62bc('0x1d')]],'as':_0x4a72d6['as'],'attributes':_0x4a72d6[_0x62bc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x62bc('0x9')](function(_0x5c03ac){logger['info'](_0x62bc('0x14'),_0xc95407);logger[_0x62bc('0xc')](_0x62bc('0x14'),_0xc95407,JSON['stringify'](_0x5c03ac));_0x1d3d8f(_0x5c03ac);})[_0x62bc('0x1e')](function(_0x1f2985){logger[_0x62bc('0xf')](_0x62bc('0x14'),_0x1f2985['message'],_0xc95407);_0x3111ab(_0x31dd9f[_0x62bc('0xf')](0x1f4,_0x1f2985['message']));});});};exports[_0x62bc('0x1f')]=function(_0x94eb32){var _0x32048f=this;return new Promise(function(_0x2dd7fd,_0x2c2aa3){return db[_0x62bc('0x15')][_0x62bc('0x20')]({'raw':_0x94eb32[_0x62bc('0x16')]?_0x94eb32[_0x62bc('0x16')][_0x62bc('0x17')]===undefined?!![]:![]:!![],'where':_0x94eb32[_0x62bc('0x16')]?_0x94eb32[_0x62bc('0x16')][_0x62bc('0x18')]||null:null,'attributes':_0x94eb32[_0x62bc('0x16')]?_0x94eb32[_0x62bc('0x16')][_0x62bc('0x19')]||null:null,'include':_0x94eb32[_0x62bc('0x16')]?_0x94eb32['options'][_0x62bc('0x1b')]?_['map'](_0x94eb32['options'][_0x62bc('0x1b')],function(_0x57b683){return{'model':db[_0x57b683['model']],'as':_0x57b683['as'],'attributes':_0x57b683['attributes'],'include':_0x57b683[_0x62bc('0x1b')]?_[_0x62bc('0x1c')](_0x57b683[_0x62bc('0x1b')],function(_0x4efabd){return{'model':db[_0x4efabd['model']],'as':_0x4efabd['as'],'attributes':_0x4efabd['attributes'],'include':_0x4efabd[_0x62bc('0x1b')]?_[_0x62bc('0x1c')](_0x4efabd['include'],function(_0x49b2b3){return{'model':db[_0x49b2b3[_0x62bc('0x1d')]],'as':_0x49b2b3['as'],'attributes':_0x49b2b3[_0x62bc('0x19')]};}):[]};}):[]};}):[]:[]})[_0x62bc('0x9')](function(_0x549013){logger[_0x62bc('0xa')](_0x62bc('0x1f'),_0x94eb32);logger[_0x62bc('0xc')](_0x62bc('0x1f'),_0x94eb32,JSON['stringify'](_0x549013));_0x2dd7fd(_0x549013);})[_0x62bc('0x1e')](function(_0x2caa71){logger['error'](_0x62bc('0x1f'),_0x2caa71[_0x62bc('0x12')],_0x94eb32);_0x2c2aa3(_0x32048f[_0x62bc('0xf')](0x1f4,_0x2caa71[_0x62bc('0x12')]));});});}; \ No newline at end of file +var _0xbec5=['jayson/promise','http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','SalesforceAccount,\x20%s,\x20%s','message','result','GetSalesforceAccount','findAll','options','raw','attributes','include','map','model','SalesforceAccount','find','where','ShowSalesforceAccount','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment'];(function(_0x30d87a,_0xf3a07f){var _0x48f64b=function(_0x2078b7){while(--_0x2078b7){_0x30d87a['push'](_0x30d87a['shift']());}};_0x48f64b(++_0xf3a07f);}(_0xbec5,0xe5));var _0x5bec=function(_0x510b98,_0x4c4cbb){_0x510b98=_0x510b98-0x0;var _0x45e775=_0xbec5[_0x510b98];return _0x45e775;};'use strict';var _=require(_0x5bec('0x0'));var util=require(_0x5bec('0x1'));var moment=require('moment');var BPromise=require(_0x5bec('0x2'));var rs=require(_0x5bec('0x3'));var fs=require('fs');var Redis=require(_0x5bec('0x4'));var db=require(_0x5bec('0x5'))['db'];var utils=require(_0x5bec('0x6'));var logger=require('../../config/logger')(_0x5bec('0x7'));var config=require(_0x5bec('0x8'));var jayson=require(_0x5bec('0x9'));var client=jayson['client'][_0x5bec('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28a427,_0x38456e,_0x406e65){return new BPromise(function(_0x43d96e,_0x302aae){return client[_0x5bec('0xb')](_0x28a427,_0x406e65)[_0x5bec('0xc')](function(_0x4d0d29){logger[_0x5bec('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x38456e,_0x5bec('0xe'));logger[_0x5bec('0xf')](_0x5bec('0x10'),_0x38456e,'request\x20sent',JSON[_0x5bec('0x11')](_0x4d0d29));if(_0x4d0d29[_0x5bec('0x12')]){if(_0x4d0d29[_0x5bec('0x12')]['code']===0x1f4){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29['error'][_0x5bec('0x14')]);return _0x302aae(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);return _0x43d96e(_0x4d0d29[_0x5bec('0x12')][_0x5bec('0x14')]);}else{logger[_0x5bec('0xd')](_0x5bec('0x13'),_0x38456e,_0x5bec('0xe'));_0x43d96e(_0x4d0d29[_0x5bec('0x15')]['message']);}})['catch'](function(_0x15af9b){logger[_0x5bec('0x12')](_0x5bec('0x13'),_0x38456e,_0x15af9b);_0x302aae(_0x15af9b);});});}exports[_0x5bec('0x16')]=function(_0x5cd7ae){var _0x5295f0=this;return new Promise(function(_0x3cd354,_0x6c0d35){return db['SalesforceAccount'][_0x5bec('0x17')]({'raw':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')][_0x5bec('0x19')]===undefined?!![]:![]:!![],'where':_0x5cd7ae['options']?_0x5cd7ae[_0x5bec('0x18')]['where']||null:null,'attributes':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')][_0x5bec('0x1a')]||null:null,'limit':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae[_0x5bec('0x18')]['limit']||null:null,'include':_0x5cd7ae[_0x5bec('0x18')]?_0x5cd7ae['options'][_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0x5cd7ae['options'][_0x5bec('0x1b')],function(_0xbef70b){return{'model':db[_0xbef70b['model']],'as':_0xbef70b['as'],'attributes':_0xbef70b[_0x5bec('0x1a')],'include':_0xbef70b[_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0xbef70b[_0x5bec('0x1b')],function(_0x226d55){return{'model':db[_0x226d55[_0x5bec('0x1d')]],'as':_0x226d55['as'],'attributes':_0x226d55[_0x5bec('0x1a')],'include':_0x226d55['include']?_['map'](_0x226d55['include'],function(_0x2961bd){return{'model':db[_0x2961bd[_0x5bec('0x1d')]],'as':_0x2961bd['as'],'attributes':_0x2961bd[_0x5bec('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2b3b2c){logger[_0x5bec('0xd')]('GetSalesforceAccount',_0x5cd7ae);logger[_0x5bec('0xf')](_0x5bec('0x16'),_0x5cd7ae,JSON['stringify'](_0x2b3b2c));_0x3cd354(_0x2b3b2c);})['catch'](function(_0x3575e7){logger[_0x5bec('0x12')](_0x5bec('0x16'),_0x3575e7[_0x5bec('0x14')],_0x5cd7ae);_0x6c0d35(_0x5295f0[_0x5bec('0x12')](0x1f4,_0x3575e7[_0x5bec('0x14')]));});});};exports['ShowSalesforceAccount']=function(_0x2987ca){var _0x59b5b6=this;return new Promise(function(_0x45863b,_0xafbd94){return db[_0x5bec('0x1e')][_0x5bec('0x1f')]({'raw':_0x2987ca['options']?_0x2987ca[_0x5bec('0x18')][_0x5bec('0x19')]===undefined?!![]:![]:!![],'where':_0x2987ca[_0x5bec('0x18')]?_0x2987ca['options'][_0x5bec('0x20')]||null:null,'attributes':_0x2987ca['options']?_0x2987ca[_0x5bec('0x18')][_0x5bec('0x1a')]||null:null,'include':_0x2987ca[_0x5bec('0x18')]?_0x2987ca['options'][_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0x2987ca['options'][_0x5bec('0x1b')],function(_0x2e5efc){return{'model':db[_0x2e5efc[_0x5bec('0x1d')]],'as':_0x2e5efc['as'],'attributes':_0x2e5efc[_0x5bec('0x1a')],'include':_0x2e5efc[_0x5bec('0x1b')]?_['map'](_0x2e5efc[_0x5bec('0x1b')],function(_0x583b96){return{'model':db[_0x583b96[_0x5bec('0x1d')]],'as':_0x583b96['as'],'attributes':_0x583b96[_0x5bec('0x1a')],'include':_0x583b96[_0x5bec('0x1b')]?_[_0x5bec('0x1c')](_0x583b96[_0x5bec('0x1b')],function(_0x1923fc){return{'model':db[_0x1923fc['model']],'as':_0x1923fc['as'],'attributes':_0x1923fc[_0x5bec('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x5bec('0xc')](function(_0x1d42b0){logger['info'](_0x5bec('0x21'),_0x2987ca);logger[_0x5bec('0xf')]('ShowSalesforceAccount',_0x2987ca,JSON[_0x5bec('0x11')](_0x1d42b0));_0x45863b(_0x1d42b0);})['catch'](function(_0x400e22){logger[_0x5bec('0x12')](_0x5bec('0x21'),_0x400e22['message'],_0x2987ca);_0xafbd94(_0x59b5b6[_0x5bec('0x12')](0x1f4,_0x400e22[_0x5bec('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index bd18901..386a629 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 _0x67d6=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','update','delete','destroy'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x67d6,0x12c));var _0x667d=function(_0x326e79,_0x33dc91){_0x326e79=_0x326e79-0x0;var _0x37eb89=_0x67d6[_0x326e79];return _0x37eb89;};'use strict';var multer=require(_0x667d('0x0'));var util=require(_0x667d('0x1'));var path=require(_0x667d('0x2'));var timeout=require(_0x667d('0x3'));var express=require(_0x667d('0x4'));var router=express[_0x667d('0x5')]();var auth=require(_0x667d('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x667d('0x7'));router[_0x667d('0x8')]('/',auth[_0x667d('0x9')](),controller[_0x667d('0xa')]);router[_0x667d('0x8')](_0x667d('0xb'),auth[_0x667d('0x9')](),controller[_0x667d('0xc')]);router[_0x667d('0x8')](_0x667d('0xd'),auth['isAuthenticated'](),controller[_0x667d('0xe')]);router[_0x667d('0x8')]('/:id/subjects',auth[_0x667d('0x9')](),controller[_0x667d('0xf')]);router[_0x667d('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x667d('0x10')]);router[_0x667d('0x11')]('/',auth[_0x667d('0x9')](),controller[_0x667d('0x12')]);router['put'](_0x667d('0xb'),auth[_0x667d('0x9')](),controller[_0x667d('0x13')]);router[_0x667d('0x14')](_0x667d('0xb'),auth[_0x667d('0x9')](),controller[_0x667d('0x15')]);module[_0x667d('0x16')]=router; \ No newline at end of file +var _0x4044=['exports','util','connect-timeout','express','Router','../../components/interaction/service','./intSalesforceConfiguration.controller','get','isAuthenticated','/:id','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','delete','destroy'];(function(_0x33fcfd,_0x2e4462){var _0x2976c0=function(_0xe2ec49){while(--_0xe2ec49){_0x33fcfd['push'](_0x33fcfd['shift']());}};_0x2976c0(++_0x2e4462);}(_0x4044,0xe5));var _0x4404=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x4044[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require('multer');var util=require(_0x4404('0x0'));var path=require('path');var timeout=require(_0x4404('0x1'));var express=require(_0x4404('0x2'));var router=express[_0x4404('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x4404('0x4'));var config=require('../../config/environment');var controller=require(_0x4404('0x5'));router[_0x4404('0x6')]('/',auth[_0x4404('0x7')](),controller['index']);router[_0x4404('0x6')](_0x4404('0x8'),auth['isAuthenticated'](),controller['show']);router['get']('/:id/fields',auth[_0x4404('0x7')](),controller['getFields']);router[_0x4404('0x6')](_0x4404('0x9'),auth['isAuthenticated'](),controller[_0x4404('0xa')]);router[_0x4404('0x6')](_0x4404('0xb'),auth[_0x4404('0x7')](),controller[_0x4404('0xc')]);router[_0x4404('0xd')]('/',auth[_0x4404('0x7')](),controller[_0x4404('0xe')]);router[_0x4404('0xf')](_0x4404('0x8'),auth[_0x4404('0x7')](),controller['update']);router[_0x4404('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x4404('0x11')]);module[_0x4404('0x12')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index d970cef..8902c0d 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 _0xde59=['Case','ENUM','contact_lead','nothing','lead','sequelize','exports','STRING'];(function(_0x10d6f2,_0x18ae62){var _0x59e5c7=function(_0x3edf41){while(--_0x3edf41){_0x10d6f2['push'](_0x10d6f2['shift']());}};_0x59e5c7(++_0x18ae62);}(_0xde59,0x85));var _0x9de5=function(_0x145275,_0x409662){_0x145275=_0x145275-0x0;var _0x519ea9=_0xde59[_0x145275];return _0x519ea9;};'use strict';var Sequelize=require(_0x9de5('0x0'));module[_0x9de5('0x1')]={'name':{'type':Sequelize[_0x9de5('0x2')]},'description':{'type':Sequelize[_0x9de5('0x2')]},'ticketType':{'type':Sequelize['ENUM']('Task',_0x9de5('0x3')),'defaultValue':'Task'},'moduleSearch':{'type':Sequelize[_0x9de5('0x4')](_0x9de5('0x5'),'contact','lead'),'defaultValue':_0x9de5('0x5')},'moduleCreate':{'type':Sequelize[_0x9de5('0x4')](_0x9de5('0x6'),'contact',_0x9de5('0x7')),'defaultValue':_0x9de5('0x7')}}; \ No newline at end of file +var _0xf372=['Case','contact_lead','lead','contact','sequelize','exports','STRING','ENUM','Task'];(function(_0xd8dbfd,_0xd7a1ce){var _0x3128a6=function(_0x28d8fd){while(--_0x28d8fd){_0xd8dbfd['push'](_0xd8dbfd['shift']());}};_0x3128a6(++_0xd7a1ce);}(_0xf372,0x1bd));var _0x2f37=function(_0x4baa69,_0x390d33){_0x4baa69=_0x4baa69-0x0;var _0x3bb516=_0xf372[_0x4baa69];return _0x3bb516;};'use strict';var Sequelize=require(_0x2f37('0x0'));module[_0x2f37('0x1')]={'name':{'type':Sequelize[_0x2f37('0x2')]},'description':{'type':Sequelize[_0x2f37('0x2')]},'ticketType':{'type':Sequelize[_0x2f37('0x3')](_0x2f37('0x4'),_0x2f37('0x5')),'defaultValue':_0x2f37('0x4')},'moduleSearch':{'type':Sequelize[_0x2f37('0x3')](_0x2f37('0x6'),'contact',_0x2f37('0x7')),'defaultValue':'contact_lead'},'moduleCreate':{'type':Sequelize[_0x2f37('0x3')]('nothing',_0x2f37('0x8'),_0x2f37('0x7')),'defaultValue':_0x2f37('0x7')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 704577b..f88e2cc 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 _0x32c2=['status','json','offset','apply','reject','save','update','destroy','stack','name','send','index','rawAttributes','fieldName','type','map','query','keys','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','count','includeAll','findAll','rows','catch','params','include','find','create','body','getFields','findOne','SalesforceField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','jayson/promise','http','test','Sequelize','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','sendStatus'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x32c2,0x1a3));var _0x232c=function(_0x494c55,_0x3d6e2a){_0x494c55=_0x494c55-0x0;var _0x5c753d=_0x32c2[_0x494c55];return _0x5c753d;};'use strict';var pdf=require(_0x232c('0x0'));var emlformat=require(_0x232c('0x1'));var rimraf=require(_0x232c('0x2'));var zipdir=require(_0x232c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x232c('0x4'));var moment=require(_0x232c('0x5'));var BPromise=require(_0x232c('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x232c('0x7'));var sox=require(_0x232c('0x8'));var csv=require(_0x232c('0x9'));var ejs=require(_0x232c('0xa'));var fs=require('fs');var _=require(_0x232c('0xb'));var squel=require(_0x232c('0xc'));var crypto=require(_0x232c('0xd'));var jsforce=require(_0x232c('0xe'));var deskjs=require(_0x232c('0xf'));var toCsv=require(_0x232c('0x9'));var querystring=require('querystring');var Papa=require(_0x232c('0x10'));var Redis=require(_0x232c('0x11'));var authService=require(_0x232c('0x12'));var qs=require(_0x232c('0x13'));var as=require(_0x232c('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x232c('0x15'));var utils=require(_0x232c('0x16'));var config=require(_0x232c('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0x232c('0x18'));var client=jayson['client'][_0x232c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x411781,_0x2e3570,_0x283b46){if(_0x283b46){var _0x3e349=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3e349[_0x232c('0x1a')](_0x2e3570)){return _0x411781;}else{throw new db[(_0x232c('0x1b'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x411781;}}function respondWithRpcPromise(_0x33cb8a,_0x485bbc,_0x518dc0,_0x215cb3){return new BPromise(function(_0x19274d,_0x2609b5){var _0x1ee4ba=_0x215cb3||client;return _0x1ee4ba[_0x232c('0x1c')](_0x33cb8a,_0x518dc0)[_0x232c('0x1d')](function(_0x28b4ba){logger[_0x232c('0x1e')](_0x232c('0x1f'),_0x485bbc,'request\x20sent');logger[_0x232c('0x20')](_0x232c('0x21'),_0x485bbc,_0x232c('0x22'),JSON[_0x232c('0x23')](_0x28b4ba));if(_0x28b4ba[_0x232c('0x24')]){if(_0x28b4ba[_0x232c('0x24')][_0x232c('0x25')]===0x1f4){logger[_0x232c('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0x485bbc,_0x28b4ba[_0x232c('0x24')]['message']);return _0x2609b5(_0x28b4ba[_0x232c('0x24')][_0x232c('0x26')]);}logger[_0x232c('0x24')](_0x232c('0x1f'),_0x485bbc,_0x28b4ba[_0x232c('0x24')][_0x232c('0x26')]);return _0x19274d(_0x28b4ba[_0x232c('0x24')][_0x232c('0x26')]);}else{logger[_0x232c('0x1e')](_0x232c('0x1f'),_0x485bbc,_0x232c('0x22'));_0x19274d(_0x28b4ba[_0x232c('0x27')][_0x232c('0x26')]);}})['catch'](function(_0x1587ee){logger['error'](_0x232c('0x1f'),_0x485bbc,_0x1587ee);_0x2609b5(_0x1587ee);});});}function respondWithStatusCode(_0x12f83c,_0x35e6f3){_0x35e6f3=_0x35e6f3||0xcc;return function(_0x203249){if(_0x203249){return _0x12f83c[_0x232c('0x28')](_0x35e6f3);}return _0x12f83c[_0x232c('0x29')](_0x35e6f3)['end']();};}function respondWithResult(_0x558ef6,_0x144621){_0x144621=_0x144621||0xc8;return function(_0x3b7c71){if(_0x3b7c71){return _0x558ef6[_0x232c('0x29')](_0x144621)[_0x232c('0x2a')](_0x3b7c71);}};}function respondWithFilteredResult(_0x5be056,_0x1cc955){return function(_0x31b073){if(_0x31b073){var _0x40095a=_0x31b073['count'],_0x14a9b9=_0x1cc955['offset'],_0x595d66=_0x1cc955[_0x232c('0x2b')]+_0x1cc955['limit'],_0x1b2107;if(_0x595d66>=_0x40095a){_0x595d66=_0x40095a;_0x1b2107=0xc8;}else{_0x1b2107=0xce;}_0x5be056[_0x232c('0x29')](_0x1b2107);return _0x5be056['set']('Content-Range',_0x14a9b9+'-'+_0x595d66+'/'+_0x40095a)[_0x232c('0x2a')](_0x31b073);}return null;};}function patchUpdates(_0x51ecdb){return function(_0x893cd9){try{jsonpatch[_0x232c('0x2c')](_0x893cd9,_0x51ecdb,!![]);}catch(_0x5de3cc){return BPromise[_0x232c('0x2d')](_0x5de3cc);}return _0x893cd9[_0x232c('0x2e')]();};}function saveUpdates(_0x575e4d,_0x10de1d){return function(_0xe9a636){if(_0xe9a636){return _0xe9a636[_0x232c('0x2f')](_0x575e4d)['then'](function(_0x386884){return _0x386884;});}return null;};}function removeEntity(_0x59e3b8,_0x40de59){return function(_0x387dc3){if(_0x387dc3){return _0x387dc3[_0x232c('0x30')]()[_0x232c('0x1d')](function(){_0x59e3b8[_0x232c('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd1c98c,_0x201021){return function(_0x43ae29){if(!_0x43ae29){_0xd1c98c[_0x232c('0x28')](0x194);}return _0x43ae29;};}function handleError(_0x32f17f,_0x45f841){_0x45f841=_0x45f841||0x1f4;return function(_0x3e4cf8){logger['error'](_0x3e4cf8[_0x232c('0x31')]);if(_0x3e4cf8[_0x232c('0x32')]){delete _0x3e4cf8['name'];}_0x32f17f['status'](_0x45f841)[_0x232c('0x33')](_0x3e4cf8);};}exports[_0x232c('0x34')]=function(_0x57da7f,_0xcce43b){var _0x34be44={},_0x59461a={},_0x179b78={'count':0x0,'rows':[]};var _0x2de76e=_['map'](db['SalesforceConfiguration'][_0x232c('0x35')],function(_0x5ea070){return{'name':_0x5ea070[_0x232c('0x36')],'type':_0x5ea070[_0x232c('0x37')]['key']};});_0x59461a['model']=_[_0x232c('0x38')](_0x2de76e,'name');_0x59461a[_0x232c('0x39')]=_[_0x232c('0x3a')](_0x57da7f[_0x232c('0x39')]);_0x59461a[_0x232c('0x3b')]=_[_0x232c('0x3c')](_0x59461a['model'],_0x59461a[_0x232c('0x39')]);_0x34be44[_0x232c('0x3d')]=_['intersection'](_0x59461a[_0x232c('0x3e')],qs[_0x232c('0x3f')](_0x57da7f[_0x232c('0x39')]['fields']));_0x34be44[_0x232c('0x3d')]=_0x34be44[_0x232c('0x3d')][_0x232c('0x40')]?_0x34be44[_0x232c('0x3d')]:_0x59461a['model'];if(!_0x57da7f[_0x232c('0x39')][_0x232c('0x41')](_0x232c('0x42'))){_0x34be44[_0x232c('0x43')]=qs[_0x232c('0x43')](_0x57da7f[_0x232c('0x39')][_0x232c('0x43')]);_0x34be44['offset']=qs[_0x232c('0x2b')](_0x57da7f[_0x232c('0x39')][_0x232c('0x2b')]);}_0x34be44[_0x232c('0x44')]=qs[_0x232c('0x45')](_0x57da7f[_0x232c('0x39')][_0x232c('0x45')]);_0x34be44[_0x232c('0x46')]=qs[_0x232c('0x3b')](_[_0x232c('0x47')](_0x57da7f[_0x232c('0x39')],_0x59461a[_0x232c('0x3b')]));if(_0x57da7f['query'][_0x232c('0x48')]){_0x34be44[_0x232c('0x46')]=_[_0x232c('0x49')](_0x34be44[_0x232c('0x46')],{'$or':_[_0x232c('0x38')](_0x2de76e,function(_0xfecbf6){if(_0xfecbf6[_0x232c('0x37')]!==_0x232c('0x4a')){var _0x4d9f75={};_0x4d9f75[_0xfecbf6[_0x232c('0x32')]]={'$like':'%'+_0x57da7f[_0x232c('0x39')]['filter']+'%'};return _0x4d9f75;}})});}_0x34be44=_[_0x232c('0x49')]({},_0x34be44,_0x57da7f[_0x232c('0x4b')]);var _0x240db1={'where':_0x34be44[_0x232c('0x46')]};return db[_0x232c('0x4c')][_0x232c('0x4d')](_0x240db1)[_0x232c('0x1d')](function(_0x541406){_0x179b78[_0x232c('0x4d')]=_0x541406;if(_0x57da7f[_0x232c('0x39')][_0x232c('0x4e')]){_0x34be44['include']=[{'all':!![]}];}return db[_0x232c('0x4c')][_0x232c('0x4f')](_0x34be44);})[_0x232c('0x1d')](function(_0x2a8c37){_0x179b78[_0x232c('0x50')]=_0x2a8c37;return _0x179b78;})[_0x232c('0x1d')](respondWithFilteredResult(_0xcce43b,_0x34be44))[_0x232c('0x51')](handleError(_0xcce43b,null));};exports['show']=function(_0x4a4bf5,_0x8bda11){var _0x2b866e={'raw':![],'where':{'id':_0x4a4bf5[_0x232c('0x52')]['id']}},_0x504c1d={};_0x504c1d[_0x232c('0x3e')]=_[_0x232c('0x3a')](db['SalesforceConfiguration'][_0x232c('0x35')]);_0x504c1d[_0x232c('0x39')]=_[_0x232c('0x3a')](_0x4a4bf5[_0x232c('0x39')]);_0x504c1d['filters']=_[_0x232c('0x3c')](_0x504c1d[_0x232c('0x3e')],_0x504c1d[_0x232c('0x39')]);_0x2b866e['attributes']=_[_0x232c('0x3c')](_0x504c1d[_0x232c('0x3e')],qs[_0x232c('0x3f')](_0x4a4bf5[_0x232c('0x39')][_0x232c('0x3f')]));_0x2b866e[_0x232c('0x3d')]=_0x2b866e['attributes'][_0x232c('0x40')]?_0x2b866e['attributes']:_0x504c1d['model'];if(_0x4a4bf5[_0x232c('0x39')][_0x232c('0x4e')]){_0x2b866e[_0x232c('0x53')]=[{'all':!![]}];}_0x2b866e=_[_0x232c('0x49')]({},_0x2b866e,_0x4a4bf5[_0x232c('0x4b')]);return db['SalesforceConfiguration'][_0x232c('0x54')](_0x2b866e)[_0x232c('0x1d')](handleEntityNotFound(_0x8bda11,null))[_0x232c('0x1d')](respondWithResult(_0x8bda11,null))[_0x232c('0x51')](handleError(_0x8bda11,null));};exports[_0x232c('0x55')]=function(_0x3d5d77,_0xf0ca88){return db[_0x232c('0x4c')][_0x232c('0x55')](_0x3d5d77['body'],{})[_0x232c('0x1d')](respondWithResult(_0xf0ca88,0xc9))['catch'](handleError(_0xf0ca88,null));};exports[_0x232c('0x2f')]=function(_0x3a15c6,_0x146bd5){if(_0x3a15c6[_0x232c('0x56')]['id']){delete _0x3a15c6[_0x232c('0x56')]['id'];}return db[_0x232c('0x4c')][_0x232c('0x54')]({'where':{'id':_0x3a15c6[_0x232c('0x52')]['id']}})[_0x232c('0x1d')](handleEntityNotFound(_0x146bd5,null))['then'](saveUpdates(_0x3a15c6[_0x232c('0x56')],null))[_0x232c('0x1d')](respondWithResult(_0x146bd5,null))['catch'](handleError(_0x146bd5,null));};exports[_0x232c('0x30')]=function(_0x3b4087,_0x5d0a27){return db[_0x232c('0x4c')]['find']({'where':{'id':_0x3b4087['params']['id']}})[_0x232c('0x1d')](handleEntityNotFound(_0x5d0a27,null))[_0x232c('0x1d')](removeEntity(_0x5d0a27,null))[_0x232c('0x51')](handleError(_0x5d0a27,null));};exports[_0x232c('0x57')]=function(_0x3000fd,_0x3d002c,_0x10be19){var _0x50dde8={};var _0x4d5feb={};var _0x22930d;var _0x480d25;return db[_0x232c('0x4c')][_0x232c('0x58')]({'where':{'id':_0x3000fd['params']['id']}})[_0x232c('0x1d')](handleEntityNotFound(_0x3d002c,null))[_0x232c('0x1d')](function(_0x2ad06f){if(_0x2ad06f){_0x22930d=_0x2ad06f;_0x4d5feb[_0x232c('0x3e')]=_[_0x232c('0x3a')](db[_0x232c('0x59')][_0x232c('0x35')]);_0x4d5feb['query']=_[_0x232c('0x3a')](_0x3000fd[_0x232c('0x39')]);_0x4d5feb['filters']=_[_0x232c('0x3c')](_0x4d5feb['model'],_0x4d5feb['query']);_0x50dde8[_0x232c('0x3d')]=_[_0x232c('0x3c')](_0x4d5feb[_0x232c('0x3e')],qs[_0x232c('0x3f')](_0x3000fd[_0x232c('0x39')][_0x232c('0x3f')]));_0x50dde8[_0x232c('0x3d')]=_0x50dde8[_0x232c('0x3d')][_0x232c('0x40')]?_0x50dde8[_0x232c('0x3d')]:_0x4d5feb[_0x232c('0x3e')];_0x50dde8[_0x232c('0x44')]=qs[_0x232c('0x45')](_0x3000fd[_0x232c('0x39')][_0x232c('0x45')]);_0x50dde8[_0x232c('0x46')]=qs['filters'](_[_0x232c('0x47')](_0x3000fd[_0x232c('0x39')],_0x4d5feb[_0x232c('0x3b')]));if(_0x3000fd[_0x232c('0x39')][_0x232c('0x48')]){_0x50dde8[_0x232c('0x46')]=_[_0x232c('0x49')](_0x50dde8['where'],{'$or':_[_0x232c('0x38')](_0x50dde8['attributes'],function(_0x21268e){var _0x3344ea={};_0x3344ea[_0x21268e]={'$like':'%'+_0x3000fd[_0x232c('0x39')][_0x232c('0x48')]+'%'};return _0x3344ea;})});}_0x50dde8=_[_0x232c('0x49')]({},_0x50dde8,_0x3000fd['options']);return _0x22930d[_0x232c('0x57')](_0x50dde8);}})[_0x232c('0x1d')](function(_0x587a1e){if(_0x587a1e){_0x480d25=_0x587a1e[_0x232c('0x40')];if(!_0x3000fd['query'][_0x232c('0x41')](_0x232c('0x42'))){_0x50dde8[_0x232c('0x43')]=qs['limit'](_0x3000fd['query']['limit']);_0x50dde8[_0x232c('0x2b')]=qs[_0x232c('0x2b')](_0x3000fd['query'][_0x232c('0x2b')]);}return _0x22930d[_0x232c('0x57')](_0x50dde8);}})[_0x232c('0x1d')](function(_0x175c70){if(_0x175c70){return _0x175c70?{'count':_0x480d25,'rows':_0x175c70}:null;}})[_0x232c('0x1d')](respondWithResult(_0x3d002c,null))[_0x232c('0x51')](handleError(_0x3d002c,null));};exports[_0x232c('0x5a')]=function(_0x3f344e,_0x9ce5c9,_0x4a4f3){var _0x42aca2={};var _0x5864bd={};var _0x5a83a5;var _0x3a22b3;return db[_0x232c('0x4c')][_0x232c('0x58')]({'where':{'id':_0x3f344e[_0x232c('0x52')]['id']}})[_0x232c('0x1d')](handleEntityNotFound(_0x9ce5c9,null))[_0x232c('0x1d')](function(_0x3728c3){if(_0x3728c3){_0x5a83a5=_0x3728c3;_0x5864bd['model']=_[_0x232c('0x3a')](db[_0x232c('0x59')]['rawAttributes']);_0x5864bd[_0x232c('0x39')]=_[_0x232c('0x3a')](_0x3f344e[_0x232c('0x39')]);_0x5864bd[_0x232c('0x3b')]=_['intersection'](_0x5864bd[_0x232c('0x3e')],_0x5864bd[_0x232c('0x39')]);_0x42aca2[_0x232c('0x3d')]=_[_0x232c('0x3c')](_0x5864bd[_0x232c('0x3e')],qs['fields'](_0x3f344e[_0x232c('0x39')][_0x232c('0x3f')]));_0x42aca2['attributes']=_0x42aca2[_0x232c('0x3d')][_0x232c('0x40')]?_0x42aca2[_0x232c('0x3d')]:_0x5864bd[_0x232c('0x3e')];_0x42aca2[_0x232c('0x44')]=qs[_0x232c('0x45')](_0x3f344e[_0x232c('0x39')][_0x232c('0x45')]);_0x42aca2[_0x232c('0x46')]=qs['filters'](_['pick'](_0x3f344e[_0x232c('0x39')],_0x5864bd[_0x232c('0x3b')]));if(_0x3f344e[_0x232c('0x39')][_0x232c('0x48')]){_0x42aca2[_0x232c('0x46')]=_[_0x232c('0x49')](_0x42aca2[_0x232c('0x46')],{'$or':_[_0x232c('0x38')](_0x42aca2[_0x232c('0x3d')],function(_0x4da588){var _0x5b15c8={};_0x5b15c8[_0x4da588]={'$like':'%'+_0x3f344e[_0x232c('0x39')]['filter']+'%'};return _0x5b15c8;})});}_0x42aca2=_[_0x232c('0x49')]({},_0x42aca2,_0x3f344e[_0x232c('0x4b')]);return _0x5a83a5['getSubjects'](_0x42aca2);}})[_0x232c('0x1d')](function(_0x51ed81){if(_0x51ed81){_0x3a22b3=_0x51ed81[_0x232c('0x40')];if(!_0x3f344e[_0x232c('0x39')][_0x232c('0x41')](_0x232c('0x42'))){_0x42aca2[_0x232c('0x43')]=qs[_0x232c('0x43')](_0x3f344e[_0x232c('0x39')]['limit']);_0x42aca2[_0x232c('0x2b')]=qs[_0x232c('0x2b')](_0x3f344e[_0x232c('0x39')][_0x232c('0x2b')]);}return _0x5a83a5[_0x232c('0x5a')](_0x42aca2);}})[_0x232c('0x1d')](function(_0x3ae169){if(_0x3ae169){return _0x3ae169?{'count':_0x3a22b3,'rows':_0x3ae169}:null;}})[_0x232c('0x1d')](respondWithResult(_0x9ce5c9,null))['catch'](handleError(_0x9ce5c9,null));};exports[_0x232c('0x5b')]=function(_0x2fd934,_0x4b0615,_0xfb5929){var _0x87df15={};var _0x3ac24f={};var _0x11a6b8;var _0xa5d73c;return db[_0x232c('0x4c')]['findOne']({'where':{'id':_0x2fd934['params']['id']}})['then'](handleEntityNotFound(_0x4b0615,null))['then'](function(_0x5c5be6){if(_0x5c5be6){_0x11a6b8=_0x5c5be6;_0x3ac24f[_0x232c('0x3e')]=_['keys'](db[_0x232c('0x59')][_0x232c('0x35')]);_0x3ac24f[_0x232c('0x39')]=_[_0x232c('0x3a')](_0x2fd934[_0x232c('0x39')]);_0x3ac24f[_0x232c('0x3b')]=_[_0x232c('0x3c')](_0x3ac24f[_0x232c('0x3e')],_0x3ac24f[_0x232c('0x39')]);_0x87df15['attributes']=_[_0x232c('0x3c')](_0x3ac24f[_0x232c('0x3e')],qs['fields'](_0x2fd934[_0x232c('0x39')][_0x232c('0x3f')]));_0x87df15[_0x232c('0x3d')]=_0x87df15[_0x232c('0x3d')][_0x232c('0x40')]?_0x87df15['attributes']:_0x3ac24f[_0x232c('0x3e')];_0x87df15[_0x232c('0x44')]=qs[_0x232c('0x45')](_0x2fd934['query'][_0x232c('0x45')]);_0x87df15[_0x232c('0x46')]=qs[_0x232c('0x3b')](_[_0x232c('0x47')](_0x2fd934[_0x232c('0x39')],_0x3ac24f[_0x232c('0x3b')]));if(_0x2fd934[_0x232c('0x39')]['filter']){_0x87df15['where']=_[_0x232c('0x49')](_0x87df15[_0x232c('0x46')],{'$or':_[_0x232c('0x38')](_0x87df15[_0x232c('0x3d')],function(_0xebc24a){var _0x3e88a9={};_0x3e88a9[_0xebc24a]={'$like':'%'+_0x2fd934[_0x232c('0x39')][_0x232c('0x48')]+'%'};return _0x3e88a9;})});}_0x87df15=_[_0x232c('0x49')]({},_0x87df15,_0x2fd934[_0x232c('0x4b')]);return _0x11a6b8[_0x232c('0x5b')](_0x87df15);}})[_0x232c('0x1d')](function(_0xf828a2){if(_0xf828a2){_0xa5d73c=_0xf828a2[_0x232c('0x40')];if(!_0x2fd934[_0x232c('0x39')][_0x232c('0x41')]('nolimit')){_0x87df15[_0x232c('0x43')]=qs[_0x232c('0x43')](_0x2fd934[_0x232c('0x39')][_0x232c('0x43')]);_0x87df15[_0x232c('0x2b')]=qs[_0x232c('0x2b')](_0x2fd934[_0x232c('0x39')][_0x232c('0x2b')]);}return _0x11a6b8[_0x232c('0x5b')](_0x87df15);}})['then'](function(_0x403b34){if(_0x403b34){return _0x403b34?{'count':_0xa5d73c,'rows':_0x403b34}:null;}})[_0x232c('0x1d')](respondWithResult(_0x4b0615,null))['catch'](handleError(_0x4b0615,null));}; \ No newline at end of file +var _0xf4ea=['getSubjects','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','json','reject','save','destroy','end','name','send','index','map','SalesforceConfiguration','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','keys','length','find','body','getFields','findOne','SalesforceField'];(function(_0x35d59c,_0x341ef9){var _0x18cd27=function(_0x16a9c4){while(--_0x16a9c4){_0x35d59c['push'](_0x35d59c['shift']());}};_0x18cd27(++_0x341ef9);}(_0xf4ea,0x173));var _0xaf4e=function(_0xe7281f,_0x2d77c3){_0xe7281f=_0xe7281f-0x0;var _0x90dc99=_0xf4ea[_0xe7281f];return _0x90dc99;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaf4e('0x0'));var rimraf=require(_0xaf4e('0x1'));var zipdir=require(_0xaf4e('0x2'));var jsonpatch=require(_0xaf4e('0x3'));var rp=require(_0xaf4e('0x4'));var moment=require(_0xaf4e('0x5'));var BPromise=require(_0xaf4e('0x6'));var Mustache=require(_0xaf4e('0x7'));var util=require(_0xaf4e('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xaf4e('0x9'));var fs=require('fs');var _=require(_0xaf4e('0xa'));var squel=require(_0xaf4e('0xb'));var crypto=require('crypto');var jsforce=require(_0xaf4e('0xc'));var deskjs=require(_0xaf4e('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaf4e('0xe'));var Papa=require(_0xaf4e('0xf'));var Redis=require(_0xaf4e('0x10'));var authService=require(_0xaf4e('0x11'));var qs=require(_0xaf4e('0x12'));var as=require(_0xaf4e('0x13'));var hardwareService=require(_0xaf4e('0x14'));var logger=require('../../config/logger')(_0xaf4e('0x15'));var utils=require(_0xaf4e('0x16'));var config=require(_0xaf4e('0x17'));var db=require(_0xaf4e('0x18'))['db'];var jayson=require(_0xaf4e('0x19'));var client=jayson['client'][_0xaf4e('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x27ab4d,_0xa4f84d,_0x5e4874){if(_0x5e4874){var _0x665610=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x665610[_0xaf4e('0x1b')](_0xa4f84d)){return _0x27ab4d;}else{throw new db[(_0xaf4e('0x1c'))][(_0xaf4e('0x1d'))](_0xaf4e('0x1e'));}}else{return _0x27ab4d;}}function respondWithRpcPromise(_0x1a2ab7,_0x28b1a1,_0x3b8bfa,_0x3c1ced){return new BPromise(function(_0xadcb90,_0x4becce){var _0xa9b836=_0x3c1ced||client;return _0xa9b836['request'](_0x1a2ab7,_0x3b8bfa)[_0xaf4e('0x1f')](function(_0x3d769a){logger[_0xaf4e('0x20')](_0xaf4e('0x21'),_0x28b1a1,_0xaf4e('0x22'));logger[_0xaf4e('0x23')](_0xaf4e('0x24'),_0x28b1a1,_0xaf4e('0x22'),JSON[_0xaf4e('0x25')](_0x3d769a));if(_0x3d769a['error']){if(_0x3d769a[_0xaf4e('0x26')][_0xaf4e('0x27')]===0x1f4){logger[_0xaf4e('0x26')]('SalesforceConfiguration,\x20%s,\x20%s',_0x28b1a1,_0x3d769a[_0xaf4e('0x26')][_0xaf4e('0x28')]);return _0x4becce(_0x3d769a[_0xaf4e('0x26')][_0xaf4e('0x28')]);}logger[_0xaf4e('0x26')](_0xaf4e('0x21'),_0x28b1a1,_0x3d769a[_0xaf4e('0x26')][_0xaf4e('0x28')]);return _0xadcb90(_0x3d769a[_0xaf4e('0x26')][_0xaf4e('0x28')]);}else{logger['info'](_0xaf4e('0x21'),_0x28b1a1,_0xaf4e('0x22'));_0xadcb90(_0x3d769a[_0xaf4e('0x29')][_0xaf4e('0x28')]);}})[_0xaf4e('0x2a')](function(_0x5685bd){logger[_0xaf4e('0x26')](_0xaf4e('0x21'),_0x28b1a1,_0x5685bd);_0x4becce(_0x5685bd);});});}function respondWithStatusCode(_0x570d16,_0x20e04c){_0x20e04c=_0x20e04c||0xcc;return function(_0xd5b0f9){if(_0xd5b0f9){return _0x570d16[_0xaf4e('0x2b')](_0x20e04c);}return _0x570d16[_0xaf4e('0x2c')](_0x20e04c)['end']();};}function respondWithResult(_0x23e6e2,_0xc6c68a){_0xc6c68a=_0xc6c68a||0xc8;return function(_0x4225da){if(_0x4225da){return _0x23e6e2[_0xaf4e('0x2c')](_0xc6c68a)['json'](_0x4225da);}};}function respondWithFilteredResult(_0x48a1a7,_0x16a50e){return function(_0x1801e9){if(_0x1801e9){var _0x29335c=_0x1801e9[_0xaf4e('0x2d')],_0x5d4f6a=_0x16a50e[_0xaf4e('0x2e')],_0x2a208d=_0x16a50e[_0xaf4e('0x2e')]+_0x16a50e[_0xaf4e('0x2f')],_0x16e78b;if(_0x2a208d>=_0x29335c){_0x2a208d=_0x29335c;_0x16e78b=0xc8;}else{_0x16e78b=0xce;}_0x48a1a7[_0xaf4e('0x2c')](_0x16e78b);return _0x48a1a7['set']('Content-Range',_0x5d4f6a+'-'+_0x2a208d+'/'+_0x29335c)[_0xaf4e('0x30')](_0x1801e9);}return null;};}function patchUpdates(_0x31095d){return function(_0x1c90c1){try{jsonpatch['apply'](_0x1c90c1,_0x31095d,!![]);}catch(_0x3bc080){return BPromise[_0xaf4e('0x31')](_0x3bc080);}return _0x1c90c1[_0xaf4e('0x32')]();};}function saveUpdates(_0x3f6d57,_0x4723a5){return function(_0xdab871){if(_0xdab871){return _0xdab871['update'](_0x3f6d57)[_0xaf4e('0x1f')](function(_0xffbc49){return _0xffbc49;});}return null;};}function removeEntity(_0x317d86,_0x405dec){return function(_0x2b3872){if(_0x2b3872){return _0x2b3872[_0xaf4e('0x33')]()[_0xaf4e('0x1f')](function(){_0x317d86[_0xaf4e('0x2c')](0xcc)[_0xaf4e('0x34')]();});}};}function handleEntityNotFound(_0x15b727,_0x1c59f1){return function(_0x2cf9a9){if(!_0x2cf9a9){_0x15b727[_0xaf4e('0x2b')](0x194);}return _0x2cf9a9;};}function handleError(_0x3f34fa,_0x52ccf0){_0x52ccf0=_0x52ccf0||0x1f4;return function(_0xb67e6c){logger['error'](_0xb67e6c['stack']);if(_0xb67e6c[_0xaf4e('0x35')]){delete _0xb67e6c[_0xaf4e('0x35')];}_0x3f34fa[_0xaf4e('0x2c')](_0x52ccf0)[_0xaf4e('0x36')](_0xb67e6c);};}exports[_0xaf4e('0x37')]=function(_0x1ac5a5,_0x268ade){var _0x1808f0={},_0x2a1974={},_0x4e8859={'count':0x0,'rows':[]};var _0x31fab6=_[_0xaf4e('0x38')](db[_0xaf4e('0x39')][_0xaf4e('0x3a')],function(_0x3e20f6){return{'name':_0x3e20f6[_0xaf4e('0x3b')],'type':_0x3e20f6[_0xaf4e('0x3c')][_0xaf4e('0x3d')]};});_0x2a1974[_0xaf4e('0x3e')]=_[_0xaf4e('0x38')](_0x31fab6,_0xaf4e('0x35'));_0x2a1974[_0xaf4e('0x3f')]=_['keys'](_0x1ac5a5['query']);_0x2a1974[_0xaf4e('0x40')]=_[_0xaf4e('0x41')](_0x2a1974[_0xaf4e('0x3e')],_0x2a1974['query']);_0x1808f0[_0xaf4e('0x42')]=_[_0xaf4e('0x41')](_0x2a1974['model'],qs[_0xaf4e('0x43')](_0x1ac5a5[_0xaf4e('0x3f')][_0xaf4e('0x43')]));_0x1808f0[_0xaf4e('0x42')]=_0x1808f0[_0xaf4e('0x42')]['length']?_0x1808f0[_0xaf4e('0x42')]:_0x2a1974[_0xaf4e('0x3e')];if(!_0x1ac5a5['query'][_0xaf4e('0x44')](_0xaf4e('0x45'))){_0x1808f0[_0xaf4e('0x2f')]=qs[_0xaf4e('0x2f')](_0x1ac5a5[_0xaf4e('0x3f')][_0xaf4e('0x2f')]);_0x1808f0['offset']=qs[_0xaf4e('0x2e')](_0x1ac5a5[_0xaf4e('0x3f')][_0xaf4e('0x2e')]);}_0x1808f0['order']=qs[_0xaf4e('0x46')](_0x1ac5a5[_0xaf4e('0x3f')]['sort']);_0x1808f0[_0xaf4e('0x47')]=qs[_0xaf4e('0x40')](_[_0xaf4e('0x48')](_0x1ac5a5[_0xaf4e('0x3f')],_0x2a1974[_0xaf4e('0x40')]));if(_0x1ac5a5['query'][_0xaf4e('0x49')]){_0x1808f0[_0xaf4e('0x47')]=_[_0xaf4e('0x4a')](_0x1808f0[_0xaf4e('0x47')],{'$or':_[_0xaf4e('0x38')](_0x31fab6,function(_0x2b8bf4){if(_0x2b8bf4[_0xaf4e('0x3c')]!==_0xaf4e('0x4b')){var _0x4ca692={};_0x4ca692[_0x2b8bf4[_0xaf4e('0x35')]]={'$like':'%'+_0x1ac5a5['query'][_0xaf4e('0x49')]+'%'};return _0x4ca692;}})});}_0x1808f0=_[_0xaf4e('0x4a')]({},_0x1808f0,_0x1ac5a5[_0xaf4e('0x4c')]);var _0x1ec1f4={'where':_0x1808f0[_0xaf4e('0x47')]};return db[_0xaf4e('0x39')]['count'](_0x1ec1f4)[_0xaf4e('0x1f')](function(_0x1eff50){_0x4e8859['count']=_0x1eff50;if(_0x1ac5a5[_0xaf4e('0x3f')][_0xaf4e('0x4d')]){_0x1808f0[_0xaf4e('0x4e')]=[{'all':!![]}];}return db[_0xaf4e('0x39')][_0xaf4e('0x4f')](_0x1808f0);})[_0xaf4e('0x1f')](function(_0x35f597){_0x4e8859['rows']=_0x35f597;return _0x4e8859;})['then'](respondWithFilteredResult(_0x268ade,_0x1808f0))[_0xaf4e('0x2a')](handleError(_0x268ade,null));};exports[_0xaf4e('0x50')]=function(_0x29f177,_0x2b52b3){var _0x37877a={'raw':![],'where':{'id':_0x29f177[_0xaf4e('0x51')]['id']}},_0x3b3110={};_0x3b3110[_0xaf4e('0x3e')]=_[_0xaf4e('0x52')](db[_0xaf4e('0x39')][_0xaf4e('0x3a')]);_0x3b3110[_0xaf4e('0x3f')]=_['keys'](_0x29f177[_0xaf4e('0x3f')]);_0x3b3110['filters']=_['intersection'](_0x3b3110[_0xaf4e('0x3e')],_0x3b3110[_0xaf4e('0x3f')]);_0x37877a[_0xaf4e('0x42')]=_['intersection'](_0x3b3110[_0xaf4e('0x3e')],qs[_0xaf4e('0x43')](_0x29f177['query'][_0xaf4e('0x43')]));_0x37877a[_0xaf4e('0x42')]=_0x37877a[_0xaf4e('0x42')][_0xaf4e('0x53')]?_0x37877a[_0xaf4e('0x42')]:_0x3b3110[_0xaf4e('0x3e')];if(_0x29f177[_0xaf4e('0x3f')]['includeAll']){_0x37877a[_0xaf4e('0x4e')]=[{'all':!![]}];}_0x37877a=_[_0xaf4e('0x4a')]({},_0x37877a,_0x29f177['options']);return db[_0xaf4e('0x39')][_0xaf4e('0x54')](_0x37877a)['then'](handleEntityNotFound(_0x2b52b3,null))[_0xaf4e('0x1f')](respondWithResult(_0x2b52b3,null))['catch'](handleError(_0x2b52b3,null));};exports['create']=function(_0x34b8c0,_0x20dde6){return db[_0xaf4e('0x39')]['create'](_0x34b8c0[_0xaf4e('0x55')],{})[_0xaf4e('0x1f')](respondWithResult(_0x20dde6,0xc9))[_0xaf4e('0x2a')](handleError(_0x20dde6,null));};exports['update']=function(_0x397f24,_0x112240){if(_0x397f24['body']['id']){delete _0x397f24[_0xaf4e('0x55')]['id'];}return db[_0xaf4e('0x39')][_0xaf4e('0x54')]({'where':{'id':_0x397f24['params']['id']}})[_0xaf4e('0x1f')](handleEntityNotFound(_0x112240,null))['then'](saveUpdates(_0x397f24['body'],null))[_0xaf4e('0x1f')](respondWithResult(_0x112240,null))['catch'](handleError(_0x112240,null));};exports['destroy']=function(_0x278945,_0x337f93){return db[_0xaf4e('0x39')]['find']({'where':{'id':_0x278945[_0xaf4e('0x51')]['id']}})[_0xaf4e('0x1f')](handleEntityNotFound(_0x337f93,null))[_0xaf4e('0x1f')](removeEntity(_0x337f93,null))[_0xaf4e('0x2a')](handleError(_0x337f93,null));};exports[_0xaf4e('0x56')]=function(_0x558f8d,_0x1ade89,_0x289c0d){var _0x2311b9={};var _0x4389e5={};var _0x3a7fe6;var _0x5e60e6;return db[_0xaf4e('0x39')][_0xaf4e('0x57')]({'where':{'id':_0x558f8d[_0xaf4e('0x51')]['id']}})[_0xaf4e('0x1f')](handleEntityNotFound(_0x1ade89,null))[_0xaf4e('0x1f')](function(_0x147a78){if(_0x147a78){_0x3a7fe6=_0x147a78;_0x4389e5['model']=_['keys'](db[_0xaf4e('0x58')][_0xaf4e('0x3a')]);_0x4389e5[_0xaf4e('0x3f')]=_[_0xaf4e('0x52')](_0x558f8d[_0xaf4e('0x3f')]);_0x4389e5[_0xaf4e('0x40')]=_[_0xaf4e('0x41')](_0x4389e5[_0xaf4e('0x3e')],_0x4389e5['query']);_0x2311b9['attributes']=_['intersection'](_0x4389e5[_0xaf4e('0x3e')],qs['fields'](_0x558f8d['query'][_0xaf4e('0x43')]));_0x2311b9[_0xaf4e('0x42')]=_0x2311b9['attributes'][_0xaf4e('0x53')]?_0x2311b9[_0xaf4e('0x42')]:_0x4389e5[_0xaf4e('0x3e')];_0x2311b9['order']=qs[_0xaf4e('0x46')](_0x558f8d[_0xaf4e('0x3f')][_0xaf4e('0x46')]);_0x2311b9[_0xaf4e('0x47')]=qs['filters'](_['pick'](_0x558f8d['query'],_0x4389e5['filters']));if(_0x558f8d['query'][_0xaf4e('0x49')]){_0x2311b9['where']=_[_0xaf4e('0x4a')](_0x2311b9['where'],{'$or':_['map'](_0x2311b9[_0xaf4e('0x42')],function(_0xe8556){var _0x1b9439={};_0x1b9439[_0xe8556]={'$like':'%'+_0x558f8d[_0xaf4e('0x3f')][_0xaf4e('0x49')]+'%'};return _0x1b9439;})});}_0x2311b9=_[_0xaf4e('0x4a')]({},_0x2311b9,_0x558f8d['options']);return _0x3a7fe6[_0xaf4e('0x56')](_0x2311b9);}})['then'](function(_0x328fb2){if(_0x328fb2){_0x5e60e6=_0x328fb2[_0xaf4e('0x53')];if(!_0x558f8d[_0xaf4e('0x3f')][_0xaf4e('0x44')](_0xaf4e('0x45'))){_0x2311b9[_0xaf4e('0x2f')]=qs[_0xaf4e('0x2f')](_0x558f8d[_0xaf4e('0x3f')][_0xaf4e('0x2f')]);_0x2311b9[_0xaf4e('0x2e')]=qs[_0xaf4e('0x2e')](_0x558f8d[_0xaf4e('0x3f')][_0xaf4e('0x2e')]);}return _0x3a7fe6[_0xaf4e('0x56')](_0x2311b9);}})[_0xaf4e('0x1f')](function(_0x47b395){if(_0x47b395){return _0x47b395?{'count':_0x5e60e6,'rows':_0x47b395}:null;}})[_0xaf4e('0x1f')](respondWithResult(_0x1ade89,null))[_0xaf4e('0x2a')](handleError(_0x1ade89,null));};exports[_0xaf4e('0x59')]=function(_0x69e759,_0x1c529b,_0x1c2258){var _0x103f8e={};var _0x5b5161={};var _0x1ca72b;var _0x58383a;return db['SalesforceConfiguration'][_0xaf4e('0x57')]({'where':{'id':_0x69e759[_0xaf4e('0x51')]['id']}})['then'](handleEntityNotFound(_0x1c529b,null))[_0xaf4e('0x1f')](function(_0x381d72){if(_0x381d72){_0x1ca72b=_0x381d72;_0x5b5161[_0xaf4e('0x3e')]=_[_0xaf4e('0x52')](db[_0xaf4e('0x58')][_0xaf4e('0x3a')]);_0x5b5161['query']=_['keys'](_0x69e759[_0xaf4e('0x3f')]);_0x5b5161[_0xaf4e('0x40')]=_[_0xaf4e('0x41')](_0x5b5161[_0xaf4e('0x3e')],_0x5b5161['query']);_0x103f8e[_0xaf4e('0x42')]=_[_0xaf4e('0x41')](_0x5b5161[_0xaf4e('0x3e')],qs[_0xaf4e('0x43')](_0x69e759[_0xaf4e('0x3f')]['fields']));_0x103f8e[_0xaf4e('0x42')]=_0x103f8e['attributes'][_0xaf4e('0x53')]?_0x103f8e[_0xaf4e('0x42')]:_0x5b5161[_0xaf4e('0x3e')];_0x103f8e['order']=qs['sort'](_0x69e759[_0xaf4e('0x3f')][_0xaf4e('0x46')]);_0x103f8e[_0xaf4e('0x47')]=qs[_0xaf4e('0x40')](_[_0xaf4e('0x48')](_0x69e759[_0xaf4e('0x3f')],_0x5b5161[_0xaf4e('0x40')]));if(_0x69e759[_0xaf4e('0x3f')]['filter']){_0x103f8e['where']=_['merge'](_0x103f8e[_0xaf4e('0x47')],{'$or':_['map'](_0x103f8e[_0xaf4e('0x42')],function(_0x27cf82){var _0x56c8d3={};_0x56c8d3[_0x27cf82]={'$like':'%'+_0x69e759[_0xaf4e('0x3f')][_0xaf4e('0x49')]+'%'};return _0x56c8d3;})});}_0x103f8e=_[_0xaf4e('0x4a')]({},_0x103f8e,_0x69e759[_0xaf4e('0x4c')]);return _0x1ca72b[_0xaf4e('0x59')](_0x103f8e);}})[_0xaf4e('0x1f')](function(_0x3d2bf6){if(_0x3d2bf6){_0x58383a=_0x3d2bf6[_0xaf4e('0x53')];if(!_0x69e759[_0xaf4e('0x3f')][_0xaf4e('0x44')]('nolimit')){_0x103f8e[_0xaf4e('0x2f')]=qs['limit'](_0x69e759[_0xaf4e('0x3f')][_0xaf4e('0x2f')]);_0x103f8e[_0xaf4e('0x2e')]=qs['offset'](_0x69e759[_0xaf4e('0x3f')][_0xaf4e('0x2e')]);}return _0x1ca72b[_0xaf4e('0x59')](_0x103f8e);}})[_0xaf4e('0x1f')](function(_0x279861){if(_0x279861){return _0x279861?{'count':_0x58383a,'rows':_0x279861}:null;}})[_0xaf4e('0x1f')](respondWithResult(_0x1c529b,null))[_0xaf4e('0x2a')](handleError(_0x1c529b,null));};exports['getDescriptions']=function(_0xf30994,_0x314545,_0x3b208f){var _0x3e8bd0={};var _0xa59949={};var _0x1cdd15;var _0x480ffa;return db[_0xaf4e('0x39')][_0xaf4e('0x57')]({'where':{'id':_0xf30994[_0xaf4e('0x51')]['id']}})[_0xaf4e('0x1f')](handleEntityNotFound(_0x314545,null))[_0xaf4e('0x1f')](function(_0x15606d){if(_0x15606d){_0x1cdd15=_0x15606d;_0xa59949[_0xaf4e('0x3e')]=_[_0xaf4e('0x52')](db[_0xaf4e('0x58')][_0xaf4e('0x3a')]);_0xa59949[_0xaf4e('0x3f')]=_['keys'](_0xf30994[_0xaf4e('0x3f')]);_0xa59949[_0xaf4e('0x40')]=_[_0xaf4e('0x41')](_0xa59949['model'],_0xa59949[_0xaf4e('0x3f')]);_0x3e8bd0[_0xaf4e('0x42')]=_['intersection'](_0xa59949['model'],qs[_0xaf4e('0x43')](_0xf30994['query']['fields']));_0x3e8bd0[_0xaf4e('0x42')]=_0x3e8bd0[_0xaf4e('0x42')]['length']?_0x3e8bd0['attributes']:_0xa59949[_0xaf4e('0x3e')];_0x3e8bd0[_0xaf4e('0x5a')]=qs[_0xaf4e('0x46')](_0xf30994[_0xaf4e('0x3f')]['sort']);_0x3e8bd0[_0xaf4e('0x47')]=qs['filters'](_[_0xaf4e('0x48')](_0xf30994[_0xaf4e('0x3f')],_0xa59949[_0xaf4e('0x40')]));if(_0xf30994['query'][_0xaf4e('0x49')]){_0x3e8bd0[_0xaf4e('0x47')]=_[_0xaf4e('0x4a')](_0x3e8bd0[_0xaf4e('0x47')],{'$or':_[_0xaf4e('0x38')](_0x3e8bd0[_0xaf4e('0x42')],function(_0xdc94ae){var _0x9a3537={};_0x9a3537[_0xdc94ae]={'$like':'%'+_0xf30994[_0xaf4e('0x3f')]['filter']+'%'};return _0x9a3537;})});}_0x3e8bd0=_['merge']({},_0x3e8bd0,_0xf30994[_0xaf4e('0x4c')]);return _0x1cdd15[_0xaf4e('0x5b')](_0x3e8bd0);}})['then'](function(_0x1fd2e3){if(_0x1fd2e3){_0x480ffa=_0x1fd2e3['length'];if(!_0xf30994['query'][_0xaf4e('0x44')]('nolimit')){_0x3e8bd0[_0xaf4e('0x2f')]=qs['limit'](_0xf30994[_0xaf4e('0x3f')][_0xaf4e('0x2f')]);_0x3e8bd0['offset']=qs[_0xaf4e('0x2e')](_0xf30994[_0xaf4e('0x3f')][_0xaf4e('0x2e')]);}return _0x1cdd15[_0xaf4e('0x5b')](_0x3e8bd0);}})[_0xaf4e('0x1f')](function(_0x43b377){if(_0x43b377){return _0x43b377?{'count':_0x480ffa,'rows':_0x43b377}:null;}})[_0xaf4e('0x1f')](respondWithResult(_0x314545,null))['catch'](handleError(_0x314545,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 095ccbb..13e6175 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 _0x78a8=['path','exports','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api','bluebird','request-promise'];(function(_0x2d48fa,_0x103065){var _0x4645b7=function(_0x5c8751){while(--_0x5c8751){_0x2d48fa['push'](_0x2d48fa['shift']());}};_0x4645b7(++_0x103065);}(_0x78a8,0x1a2));var _0x878a=function(_0x51274e,_0x87c217){_0x51274e=_0x51274e-0x0;var _0x59ba1c=_0x78a8[_0x51274e];return _0x59ba1c;};'use strict';var _=require('lodash');var util=require(_0x878a('0x0'));var logger=require(_0x878a('0x1'))(_0x878a('0x2'));var moment=require('moment');var BPromise=require(_0x878a('0x3'));var rp=require(_0x878a('0x4'));var fs=require('fs');var path=require(_0x878a('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./intSalesforceConfiguration.attributes');module[_0x878a('0x6')]=function(_0x2f10fe,_0x4366fb){return _0x2f10fe['define'](_0x878a('0x7'),attributes,{'tableName':_0x878a('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde60=['bluebird','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','define','SalesforceConfiguration','int_salesforce_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x171bf0,_0x3cb2ad){var _0x1b0099=function(_0x577ce7){while(--_0x577ce7){_0x171bf0['push'](_0x171bf0['shift']());}};_0x1b0099(++_0x3cb2ad);}(_0xde60,0x17b));var _0x0de6=function(_0x53d2d4,_0x1f63eb){_0x53d2d4=_0x53d2d4-0x0;var _0x2128d2=_0xde60[_0x53d2d4];return _0x2128d2;};'use strict';var _=require(_0x0de6('0x0'));var util=require(_0x0de6('0x1'));var logger=require(_0x0de6('0x2'))(_0x0de6('0x3'));var moment=require(_0x0de6('0x4'));var BPromise=require(_0x0de6('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x0de6('0x6'));var config=require(_0x0de6('0x7'));var attributes=require(_0x0de6('0x8'));module['exports']=function(_0x1ac624,_0x3d8953){return _0x1ac624[_0x0de6('0x9')](_0x0de6('0xa'),attributes,{'tableName':_0x0de6('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.rpc.js index 6da78ac..48b7d7a 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 _0xb6cd=['../../config/utils','../../config/logger','../../config/environment','client','http','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x1acb34,_0x2e14a9){var _0x3f56b3=function(_0x31a54d){while(--_0x31a54d){_0x1acb34['push'](_0x1acb34['shift']());}};_0x3f56b3(++_0x2e14a9);}(_0xb6cd,0x1c7));var _0xdb6c=function(_0x1e6e2e,_0x593e7d){_0x1e6e2e=_0x1e6e2e-0x0;var _0x1abbdc=_0xb6cd[_0x1e6e2e];return _0x1abbdc;};'use strict';var _=require('lodash');var util=require(_0xdb6c('0x0'));var moment=require(_0xdb6c('0x1'));var BPromise=require(_0xdb6c('0x2'));var rs=require(_0xdb6c('0x3'));var fs=require('fs');var Redis=require(_0xdb6c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb6c('0x5'));var logger=require(_0xdb6c('0x6'))('rpc');var config=require(_0xdb6c('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xdb6c('0x8')][_0xdb6c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x21cf0c,_0x401714,_0x92ed92){return new BPromise(function(_0x333ecd,_0x3c4c2f){return client[_0xdb6c('0xa')](_0x21cf0c,_0x92ed92)['then'](function(_0x333bd6){logger[_0xdb6c('0xb')](_0xdb6c('0xc'),_0x401714,_0xdb6c('0xd'));logger[_0xdb6c('0xe')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x401714,_0xdb6c('0xd'),JSON[_0xdb6c('0xf')](_0x333bd6));if(_0x333bd6[_0xdb6c('0x10')]){if(_0x333bd6[_0xdb6c('0x10')]['code']===0x1f4){logger[_0xdb6c('0x10')](_0xdb6c('0xc'),_0x401714,_0x333bd6['error'][_0xdb6c('0x11')]);return _0x3c4c2f(_0x333bd6[_0xdb6c('0x10')][_0xdb6c('0x11')]);}logger[_0xdb6c('0x10')](_0xdb6c('0xc'),_0x401714,_0x333bd6['error']['message']);return _0x333ecd(_0x333bd6[_0xdb6c('0x10')][_0xdb6c('0x11')]);}else{logger['info'](_0xdb6c('0xc'),_0x401714,_0xdb6c('0xd'));_0x333ecd(_0x333bd6[_0xdb6c('0x12')][_0xdb6c('0x11')]);}})[_0xdb6c('0x13')](function(_0x4f5292){logger[_0xdb6c('0x10')](_0xdb6c('0xc'),_0x401714,_0x4f5292);_0x3c4c2f(_0x4f5292);});});} \ No newline at end of file +var _0xcbad=['then','info','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SalesforceConfiguration,\x20%s,\x20%s','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xcbad,0xc8));var _0xdcba=function(_0x566156,_0x958b9b){_0x566156=_0x566156-0x0;var _0x42334c=_0xcbad[_0x566156];return _0x42334c;};'use strict';var _=require(_0xdcba('0x0'));var util=require('util');var moment=require(_0xdcba('0x1'));var BPromise=require(_0xdcba('0x2'));var rs=require(_0xdcba('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdcba('0x4'))['db'];var utils=require(_0xdcba('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xdcba('0x6'));var jayson=require(_0xdcba('0x7'));var client=jayson['client'][_0xdcba('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x63661f,_0x62975e,_0x534b94){return new BPromise(function(_0x33f517,_0x157c7f){return client[_0xdcba('0x9')](_0x63661f,_0x534b94)[_0xdcba('0xa')](function(_0x4b5eff){logger[_0xdcba('0xb')]('SalesforceConfiguration,\x20%s,\x20%s',_0x62975e,_0xdcba('0xc'));logger[_0xdcba('0xd')](_0xdcba('0xe'),_0x62975e,'request\x20sent',JSON[_0xdcba('0xf')](_0x4b5eff));if(_0x4b5eff[_0xdcba('0x10')]){if(_0x4b5eff['error'][_0xdcba('0x11')]===0x1f4){logger[_0xdcba('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x62975e,_0x4b5eff[_0xdcba('0x10')][_0xdcba('0x12')]);return _0x157c7f(_0x4b5eff[_0xdcba('0x10')][_0xdcba('0x12')]);}logger[_0xdcba('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x62975e,_0x4b5eff[_0xdcba('0x10')]['message']);return _0x33f517(_0x4b5eff[_0xdcba('0x10')]['message']);}else{logger[_0xdcba('0xb')](_0xdcba('0x13'),_0x62975e,_0xdcba('0xc'));_0x33f517(_0x4b5eff[_0xdcba('0x14')][_0xdcba('0x12')]);}})['catch'](function(_0x12a3e6){logger[_0xdcba('0x10')]('SalesforceConfiguration,\x20%s,\x20%s',_0x62975e,_0x12a3e6);_0x157c7f(_0x12a3e6);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index 5021868..b45ce1c 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 _0xa6b0=['../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','exports','multer','util','express','Router','../../components/auth/service'];(function(_0x4ae829,_0x2c842c){var _0x256b31=function(_0x34f104){while(--_0x34f104){_0x4ae829['push'](_0x4ae829['shift']());}};_0x256b31(++_0x2c842c);}(_0xa6b0,0xaf));var _0x0a6b=function(_0x333e4e,_0x2eb50d){_0x333e4e=_0x333e4e-0x0;var _0x2b4a64=_0xa6b0[_0x333e4e];return _0x2b4a64;};'use strict';var multer=require(_0x0a6b('0x0'));var util=require(_0x0a6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a6b('0x2'));var router=express[_0x0a6b('0x3')]();var auth=require(_0x0a6b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a6b('0x5'));var controller=require(_0x0a6b('0x6'));router[_0x0a6b('0x7')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x9')]);router[_0x0a6b('0x7')](_0x0a6b('0xa'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xb')]);router[_0x0a6b('0xc')]('/',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xd')]);router['put']('/:id',auth[_0x0a6b('0x8')](),controller[_0x0a6b('0xe')]);router[_0x0a6b('0xf')](_0x0a6b('0xa'),auth[_0x0a6b('0x8')](),controller[_0x0a6b('0x10')]);module[_0x0a6b('0x11')]=router; \ No newline at end of file +var _0xfdbd=['isAuthenticated','put','/:id','update','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','post'];(function(_0x1bfb42,_0x314a98){var _0x2874fd=function(_0x3562fe){while(--_0x3562fe){_0x1bfb42['push'](_0x1bfb42['shift']());}};_0x2874fd(++_0x314a98);}(_0xfdbd,0xf0));var _0xdfdb=function(_0x511b76,_0x4727fa){_0x511b76=_0x511b76-0x0;var _0x5424ff=_0xfdbd[_0x511b76];return _0x5424ff;};'use strict';var multer=require(_0xdfdb('0x0'));var util=require(_0xdfdb('0x1'));var path=require(_0xdfdb('0x2'));var timeout=require(_0xdfdb('0x3'));var express=require(_0xdfdb('0x4'));var router=express[_0xdfdb('0x5')]();var auth=require(_0xdfdb('0x6'));var interaction=require(_0xdfdb('0x7'));var config=require(_0xdfdb('0x8'));var controller=require('./intSalesforceField.controller');router[_0xdfdb('0x9')]('/',auth['isAuthenticated'](),controller[_0xdfdb('0xa')]);router[_0xdfdb('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xdfdb('0xb')]('/',auth[_0xdfdb('0xc')](),controller['create']);router[_0xdfdb('0xd')](_0xdfdb('0xe'),auth[_0xdfdb('0xc')](),controller[_0xdfdb('0xf')]);router[_0xdfdb('0x10')](_0xdfdb('0xe'),auth[_0xdfdb('0xc')](),controller['destroy']);module[_0xdfdb('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 2a9f690..a073ef8 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 _0x90d4=['ENUM','string','variable','STRING'];(function(_0x23018a,_0xc2ce29){var _0x295a10=function(_0x988d98){while(--_0x988d98){_0x23018a['push'](_0x23018a['shift']());}};_0x295a10(++_0xc2ce29);}(_0x90d4,0x8d));var _0x490d=function(_0x483291,_0x5bc362){_0x483291=_0x483291-0x0;var _0x383046=_0x90d4[_0x483291];return _0x383046;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize['ENUM'](_0x490d('0x0'),_0x490d('0x1'),'customVariable','keyValue'),'defaultValue':_0x490d('0x0')},'content':{'type':Sequelize[_0x490d('0x2')]},'key':{'type':Sequelize[_0x490d('0x2')]},'keyType':{'type':Sequelize[_0x490d('0x3')](_0x490d('0x0'),_0x490d('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0x490d('0x2')]},'idField':{'type':Sequelize['STRING']},'variableName':{'type':Sequelize[_0x490d('0x2')]}}; \ No newline at end of file +var _0xf54b=['STRING','exports','ENUM','string','variable','customVariable','keyValue'];(function(_0x56c64d,_0x3a882c){var _0x3eac32=function(_0x40c829){while(--_0x40c829){_0x56c64d['push'](_0x56c64d['shift']());}};_0x3eac32(++_0x3a882c);}(_0xf54b,0x14a));var _0xbf54=function(_0x56ca61,_0x187321){_0x56ca61=_0x56ca61-0x0;var _0x1e7bee=_0xf54b[_0x56ca61];return _0x1e7bee;};'use strict';var Sequelize=require('sequelize');module[_0xbf54('0x0')]={'type':{'type':Sequelize[_0xbf54('0x1')](_0xbf54('0x2'),_0xbf54('0x3'),_0xbf54('0x4'),_0xbf54('0x5')),'defaultValue':_0xbf54('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0xbf54('0x6')]},'keyType':{'type':Sequelize[_0xbf54('0x1')](_0xbf54('0x2'),_0xbf54('0x3'),_0xbf54('0x4'))},'keyContent':{'type':Sequelize[_0xbf54('0x6')]},'idField':{'type':Sequelize[_0xbf54('0x6')]},'variableName':{'type':Sequelize[_0xbf54('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 53f9986..ee435e9 100644 --- a/server/api/intSalesforceField/intSalesforceField.controller.js +++ b/server/api/intSalesforceField/intSalesforceField.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x51d13b,_0x298c30){var _0xd1bc87=function(_0x6b9176){while(--_0x6b9176){_0x51d13b['push'](_0x51d13b['shift']());}};_0xd1bc87(++_0x298c30);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34750b,_0x34aae5){_0x34750b=_0x34750b-0x0;var _0x244258=_0x0b0e[_0x34750b];return _0x244258;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file +var _0xadb5=['name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','order','sort','where','VIRTUAL','merge','options','SalesforceField','findAll','rows','catch','show','rawAttributes','fields','includeAll','include','find','create','body','update','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','save','then','destroy','stack'];(function(_0x1c9c8b,_0x43b7e6){var _0x23c898=function(_0xeb0b41){while(--_0xeb0b41){_0x1c9c8b['push'](_0x1c9c8b['shift']());}};_0x23c898(++_0x43b7e6);}(_0xadb5,0xad));var _0x5adb=function(_0x4cc18f,_0x5ac696){_0x4cc18f=_0x4cc18f-0x0;var _0x44f4ff=_0xadb5[_0x4cc18f];return _0x44f4ff;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];function respondWithStatusCode(_0x56012f,_0x2a0b70){_0x2a0b70=_0x2a0b70||0xcc;return function(_0x5433bf){if(_0x5433bf){return _0x56012f[_0x5adb('0x18')](_0x2a0b70);}return _0x56012f[_0x5adb('0x19')](_0x2a0b70)[_0x5adb('0x1a')]();};}function respondWithResult(_0x5c929a,_0x2a545b){_0x2a545b=_0x2a545b||0xc8;return function(_0x34af2c){if(_0x34af2c){return _0x5c929a[_0x5adb('0x19')](_0x2a545b)['json'](_0x34af2c);}};}function respondWithFilteredResult(_0x2312de,_0x518823){return function(_0x367d82){if(_0x367d82){var _0x42a482=_0x367d82[_0x5adb('0x1b')],_0x30614e=_0x518823[_0x5adb('0x1c')],_0x304784=_0x518823[_0x5adb('0x1c')]+_0x518823[_0x5adb('0x1d')],_0x1c0f97;if(_0x304784>=_0x42a482){_0x304784=_0x42a482;_0x1c0f97=0xc8;}else{_0x1c0f97=0xce;}_0x2312de['status'](_0x1c0f97);return _0x2312de[_0x5adb('0x1e')]('Content-Range',_0x30614e+'-'+_0x304784+'/'+_0x42a482)[_0x5adb('0x1f')](_0x367d82);}return null;};}function patchUpdates(_0x558f76){return function(_0x3ef465){try{jsonpatch['apply'](_0x3ef465,_0x558f76,!![]);}catch(_0x5e218c){return BPromise[_0x5adb('0x20')](_0x5e218c);}return _0x3ef465[_0x5adb('0x21')]();};}function saveUpdates(_0x438671,_0x1fd4a7){return function(_0x99bc6c){if(_0x99bc6c){return _0x99bc6c['update'](_0x438671)[_0x5adb('0x22')](function(_0x5c296e){return _0x5c296e;});}return null;};}function removeEntity(_0x4e9f16,_0x3754cc){return function(_0x379b33){if(_0x379b33){return _0x379b33[_0x5adb('0x23')]()[_0x5adb('0x22')](function(){_0x4e9f16[_0x5adb('0x19')](0xcc)[_0x5adb('0x1a')]();});}};}function handleEntityNotFound(_0xfd9bb9,_0x4ca150){return function(_0x4b1957){if(!_0x4b1957){_0xfd9bb9[_0x5adb('0x18')](0x194);}return _0x4b1957;};}function handleError(_0x3220cd,_0x3839fb){_0x3839fb=_0x3839fb||0x1f4;return function(_0xeb556c){logger['error'](_0xeb556c[_0x5adb('0x24')]);if(_0xeb556c[_0x5adb('0x25')]){delete _0xeb556c['name'];}_0x3220cd[_0x5adb('0x19')](_0x3839fb)[_0x5adb('0x26')](_0xeb556c);};}exports[_0x5adb('0x27')]=function(_0x55b40a,_0x13ad1d){var _0xbe21b1={},_0x3a4fca={},_0x2c64a3={'count':0x0,'rows':[]};var _0x36459b=_[_0x5adb('0x28')](db['SalesforceField']['rawAttributes'],function(_0x5d457e){return{'name':_0x5d457e[_0x5adb('0x29')],'type':_0x5d457e[_0x5adb('0x2a')][_0x5adb('0x2b')]};});_0x3a4fca[_0x5adb('0x2c')]=_[_0x5adb('0x28')](_0x36459b,'name');_0x3a4fca[_0x5adb('0x2d')]=_[_0x5adb('0x2e')](_0x55b40a[_0x5adb('0x2d')]);_0x3a4fca[_0x5adb('0x2f')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],_0x3a4fca[_0x5adb('0x2d')]);_0xbe21b1[_0x5adb('0x31')]=_[_0x5adb('0x30')](_0x3a4fca[_0x5adb('0x2c')],qs['fields'](_0x55b40a[_0x5adb('0x2d')]['fields']));_0xbe21b1[_0x5adb('0x31')]=_0xbe21b1[_0x5adb('0x31')]['length']?_0xbe21b1[_0x5adb('0x31')]:_0x3a4fca[_0x5adb('0x2c')];if(!_0x55b40a[_0x5adb('0x2d')]['hasOwnProperty'](_0x5adb('0x32'))){_0xbe21b1[_0x5adb('0x1d')]=qs['limit'](_0x55b40a['query'][_0x5adb('0x1d')]);_0xbe21b1['offset']=qs[_0x5adb('0x1c')](_0x55b40a[_0x5adb('0x2d')][_0x5adb('0x1c')]);}_0xbe21b1[_0x5adb('0x33')]=qs[_0x5adb('0x34')](_0x55b40a['query'][_0x5adb('0x34')]);_0xbe21b1[_0x5adb('0x35')]=qs[_0x5adb('0x2f')](_['pick'](_0x55b40a['query'],_0x3a4fca[_0x5adb('0x2f')]));if(_0x55b40a[_0x5adb('0x2d')]['filter']){_0xbe21b1[_0x5adb('0x35')]=_['merge'](_0xbe21b1[_0x5adb('0x35')],{'$or':_['map'](_0x36459b,function(_0x11cb37){if(_0x11cb37['type']!==_0x5adb('0x36')){var _0x23a1db={};_0x23a1db[_0x11cb37['name']]={'$like':'%'+_0x55b40a[_0x5adb('0x2d')]['filter']+'%'};return _0x23a1db;}})});}_0xbe21b1=_[_0x5adb('0x37')]({},_0xbe21b1,_0x55b40a[_0x5adb('0x38')]);var _0xd5660c={'where':_0xbe21b1['where']};return db[_0x5adb('0x39')][_0x5adb('0x1b')](_0xd5660c)[_0x5adb('0x22')](function(_0x132803){_0x2c64a3[_0x5adb('0x1b')]=_0x132803;if(_0x55b40a['query']['includeAll']){_0xbe21b1['include']=[{'all':!![]}];}return db['SalesforceField'][_0x5adb('0x3a')](_0xbe21b1);})[_0x5adb('0x22')](function(_0x3a104a){_0x2c64a3[_0x5adb('0x3b')]=_0x3a104a;return _0x2c64a3;})[_0x5adb('0x22')](respondWithFilteredResult(_0x13ad1d,_0xbe21b1))[_0x5adb('0x3c')](handleError(_0x13ad1d,null));};exports[_0x5adb('0x3d')]=function(_0x3bf282,_0x478a70){var _0x53f2c6={'raw':!![],'where':{'id':_0x3bf282['params']['id']}},_0x27dbb7={};_0x27dbb7[_0x5adb('0x2c')]=_[_0x5adb('0x2e')](db[_0x5adb('0x39')][_0x5adb('0x3e')]);_0x27dbb7[_0x5adb('0x2d')]=_['keys'](_0x3bf282[_0x5adb('0x2d')]);_0x27dbb7[_0x5adb('0x2f')]=_['intersection'](_0x27dbb7[_0x5adb('0x2c')],_0x27dbb7[_0x5adb('0x2d')]);_0x53f2c6['attributes']=_[_0x5adb('0x30')](_0x27dbb7[_0x5adb('0x2c')],qs[_0x5adb('0x3f')](_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x3f')]));_0x53f2c6[_0x5adb('0x31')]=_0x53f2c6[_0x5adb('0x31')]['length']?_0x53f2c6['attributes']:_0x27dbb7[_0x5adb('0x2c')];if(_0x3bf282[_0x5adb('0x2d')][_0x5adb('0x40')]){_0x53f2c6[_0x5adb('0x41')]=[{'all':!![]}];}_0x53f2c6=_['merge']({},_0x53f2c6,_0x3bf282['options']);return db[_0x5adb('0x39')][_0x5adb('0x42')](_0x53f2c6)[_0x5adb('0x22')](handleEntityNotFound(_0x478a70,null))[_0x5adb('0x22')](respondWithResult(_0x478a70,null))[_0x5adb('0x3c')](handleError(_0x478a70,null));};exports['create']=function(_0x182cbc,_0x437f52){return db['SalesforceField'][_0x5adb('0x43')](_0x182cbc[_0x5adb('0x44')],{})[_0x5adb('0x22')](respondWithResult(_0x437f52,0xc9))[_0x5adb('0x3c')](handleError(_0x437f52,null));};exports[_0x5adb('0x45')]=function(_0x3a5409,_0x39840e){if(_0x3a5409[_0x5adb('0x44')]['id']){delete _0x3a5409['body']['id'];}return db[_0x5adb('0x39')]['find']({'where':{'id':_0x3a5409['params']['id']}})['then'](handleEntityNotFound(_0x39840e,null))[_0x5adb('0x22')](saveUpdates(_0x3a5409[_0x5adb('0x44')],null))[_0x5adb('0x22')](respondWithResult(_0x39840e,null))['catch'](handleError(_0x39840e,null));};exports[_0x5adb('0x23')]=function(_0x5cbab5,_0x177a81){return db[_0x5adb('0x39')][_0x5adb('0x42')]({'where':{'id':_0x5cbab5['params']['id']}})[_0x5adb('0x22')](handleEntityNotFound(_0x177a81,null))['then'](removeEntity(_0x177a81,null))[_0x5adb('0x3c')](handleError(_0x177a81,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 5e9005a..03d50ce 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 _0x0141=['../../config/logger','bluebird','path','rimraf','exports','define','int_salesforce_fields','salesforce_unique_index','idField','FieldId','util'];(function(_0x1a36a5,_0x746928){var _0x746243=function(_0x481966){while(--_0x481966){_0x1a36a5['push'](_0x1a36a5['shift']());}};_0x746243(++_0x746928);}(_0x0141,0x107));var _0x1014=function(_0x33f31a,_0x53fbe6){_0x33f31a=_0x33f31a-0x0;var _0x377118=_0x0141[_0x33f31a];return _0x377118;};'use strict';var _=require('lodash');var util=require(_0x1014('0x0'));var logger=require(_0x1014('0x1'))('api');var moment=require('moment');var BPromise=require(_0x1014('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1014('0x3'));var rimraf=require(_0x1014('0x4'));var config=require('../../config/environment');var attributes=require('./intSalesforceField.attributes');module[_0x1014('0x5')]=function(_0x1afa28,_0x52a5d0){return _0x1afa28[_0x1014('0x6')]('SalesforceField',attributes,{'tableName':_0x1014('0x7'),'paranoid':![],'indexes':[{'name':_0x1014('0x8'),'fields':[_0x1014('0x9'),_0x1014('0xa')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0ca9=['bluebird','request-promise','rimraf','../../config/environment','./intSalesforceField.attributes','exports','define','SalesforceField','salesforce_unique_index','FieldId','lodash','util','api','moment'];(function(_0x3b8774,_0x301a46){var _0x5bcfcc=function(_0x5d9d2f){while(--_0x5d9d2f){_0x3b8774['push'](_0x3b8774['shift']());}};_0x5bcfcc(++_0x301a46);}(_0x0ca9,0x6c));var _0x90ca=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x0ca9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x90ca('0x0'));var util=require(_0x90ca('0x1'));var logger=require('../../config/logger')(_0x90ca('0x2'));var moment=require(_0x90ca('0x3'));var BPromise=require(_0x90ca('0x4'));var rp=require(_0x90ca('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x90ca('0x6'));var config=require(_0x90ca('0x7'));var attributes=require(_0x90ca('0x8'));module[_0x90ca('0x9')]=function(_0x311d0d,_0x4653b1){return _0x311d0d[_0x90ca('0xa')](_0x90ca('0xb'),attributes,{'tableName':'int_salesforce_fields','paranoid':![],'indexes':[{'name':_0x90ca('0xc'),'fields':['idField',_0x90ca('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 f8c5d0d..29969c0 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 _0x0bb5=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','SalesforceField,\x20%s,\x20%s','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x39d741,_0x5cacbb){var _0x39942c=function(_0x1bd361){while(--_0x1bd361){_0x39d741['push'](_0x39d741['shift']());}};_0x39942c(++_0x5cacbb);}(_0x0bb5,0x148));var _0x50bb=function(_0x2b0a9c,_0xfed5a){_0x2b0a9c=_0x2b0a9c-0x0;var _0xfa7e2c=_0x0bb5[_0x2b0a9c];return _0xfa7e2c;};'use strict';var _=require(_0x50bb('0x0'));var util=require(_0x50bb('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x50bb('0x2'));var fs=require('fs');var Redis=require(_0x50bb('0x3'));var db=require(_0x50bb('0x4'))['db'];var utils=require(_0x50bb('0x5'));var logger=require(_0x50bb('0x6'))(_0x50bb('0x7'));var config=require(_0x50bb('0x8'));var jayson=require(_0x50bb('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xfd7aeb,_0x35de5d,_0x2e5463){return new BPromise(function(_0x33ff54,_0x4f9172){return client['request'](_0xfd7aeb,_0x2e5463)[_0x50bb('0xa')](function(_0x1c2174){logger[_0x50bb('0xb')](_0x50bb('0xc'),_0x35de5d,'request\x20sent');logger[_0x50bb('0xd')](_0x50bb('0xe'),_0x35de5d,_0x50bb('0xf'),JSON[_0x50bb('0x10')](_0x1c2174));if(_0x1c2174[_0x50bb('0x11')]){if(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x12')]===0x1f4){logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174['error'][_0x50bb('0x13')]);return _0x4f9172(_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);}logger['error'](_0x50bb('0xc'),_0x35de5d,_0x1c2174[_0x50bb('0x11')][_0x50bb('0x13')]);return _0x33ff54(_0x1c2174['error'][_0x50bb('0x13')]);}else{logger['info'](_0x50bb('0xc'),_0x35de5d,_0x50bb('0xf'));_0x33ff54(_0x1c2174[_0x50bb('0x14')][_0x50bb('0x13')]);}})[_0x50bb('0x15')](function(_0x4f2897){logger[_0x50bb('0x11')](_0x50bb('0xc'),_0x35de5d,_0x4f2897);_0x4f9172(_0x4f2897);});});} \ No newline at end of file +var _0x9bde=['code','message','SalesforceField,\x20%s,\x20%s','result','catch','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','debug','SalesforceField,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x38a929,_0x173319){var _0x17981f=function(_0x471e97){while(--_0x471e97){_0x38a929['push'](_0x38a929['shift']());}};_0x17981f(++_0x173319);}(_0x9bde,0xe1));var _0xe9bd=function(_0x98e03f,_0x4fb1a8){_0x98e03f=_0x98e03f-0x0;var _0x1ac6d9=_0x9bde[_0x98e03f];return _0x1ac6d9;};'use strict';var _=require('lodash');var util=require(_0xe9bd('0x0'));var moment=require('moment');var BPromise=require(_0xe9bd('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe9bd('0x2'));var db=require(_0xe9bd('0x3'))['db'];var utils=require(_0xe9bd('0x4'));var logger=require(_0xe9bd('0x5'))(_0xe9bd('0x6'));var config=require(_0xe9bd('0x7'));var jayson=require(_0xe9bd('0x8'));var client=jayson['client'][_0xe9bd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5f18fe,_0x22a438,_0xa66ae2){return new BPromise(function(_0x2d5c75,_0x3ef9e3){return client[_0xe9bd('0xa')](_0x5f18fe,_0xa66ae2)[_0xe9bd('0xb')](function(_0x439abc){logger[_0xe9bd('0xc')]('SalesforceField,\x20%s,\x20%s',_0x22a438,'request\x20sent');logger[_0xe9bd('0xd')](_0xe9bd('0xe'),_0x22a438,_0xe9bd('0xf'),JSON['stringify'](_0x439abc));if(_0x439abc[_0xe9bd('0x10')]){if(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x11')]===0x1f4){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc[_0xe9bd('0x10')]['message']);return _0x3ef9e3(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x439abc['error'][_0xe9bd('0x12')]);return _0x2d5c75(_0x439abc[_0xe9bd('0x10')][_0xe9bd('0x12')]);}else{logger[_0xe9bd('0xc')](_0xe9bd('0x13'),_0x22a438,_0xe9bd('0xf'));_0x2d5c75(_0x439abc[_0xe9bd('0x14')]['message']);}})[_0xe9bd('0x15')](function(_0x464a1b){logger[_0xe9bd('0x10')]('SalesforceField,\x20%s,\x20%s',_0x22a438,_0x464a1b);_0x3ef9e3(_0x464a1b);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index 25c04f5..f0b1498 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 _0x8893=['util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller','get','index','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','put','update','delete','/:id','destroy','exports','multer'];(function(_0x2540e8,_0x271b02){var _0x37e597=function(_0x43f55f){while(--_0x43f55f){_0x2540e8['push'](_0x2540e8['shift']());}};_0x37e597(++_0x271b02);}(_0x8893,0x1a8));var _0x3889=function(_0x2cb0ac,_0x3d367f){_0x2cb0ac=_0x2cb0ac-0x0;var _0x4c757a=_0x8893[_0x2cb0ac];return _0x4c757a;};'use strict';var multer=require(_0x3889('0x0'));var util=require(_0x3889('0x1'));var path=require(_0x3889('0x2'));var timeout=require(_0x3889('0x3'));var express=require(_0x3889('0x4'));var router=express[_0x3889('0x5')]();var auth=require(_0x3889('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x3889('0x7'));var controller=require(_0x3889('0x8'));router[_0x3889('0x9')]('/',auth['isAuthenticated'](),controller[_0x3889('0xa')]);router[_0x3889('0x9')]('/:id',auth[_0x3889('0xb')](),controller[_0x3889('0xc')]);router[_0x3889('0x9')](_0x3889('0xd'),auth[_0x3889('0xb')](),controller[_0x3889('0xe')]);router[_0x3889('0x9')](_0x3889('0xf'),auth[_0x3889('0xb')](),controller[_0x3889('0x10')]);router[_0x3889('0x11')]('/',auth['isAuthenticated'](),controller[_0x3889('0x12')]);router['post'](_0x3889('0xd'),auth[_0x3889('0xb')](),controller['addConfiguration']);router[_0x3889('0x13')]('/:id',auth[_0x3889('0xb')](),controller[_0x3889('0x14')]);router[_0x3889('0x15')](_0x3889('0x16'),auth[_0x3889('0xb')](),controller[_0x3889('0x17')]);module[_0x3889('0x18')]=router; \ No newline at end of file +var _0x25f0=['./intServicenowAccount.controller','isAuthenticated','get','show','/:id/configurations','/:id/fields','addConfiguration','put','/:id','update','delete','exports','multer','util','Router','../../components/interaction/service'];(function(_0x59805e,_0x54875d){var _0x45d74f=function(_0x3e15f0){while(--_0x3e15f0){_0x59805e['push'](_0x59805e['shift']());}};_0x45d74f(++_0x54875d);}(_0x25f0,0x10c));var _0x025f=function(_0x274b26,_0x19eda9){_0x274b26=_0x274b26-0x0;var _0x119770=_0x25f0[_0x274b26];return _0x119770;};'use strict';var multer=require(_0x025f('0x0'));var util=require(_0x025f('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x025f('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x025f('0x3'));var config=require('../../config/environment');var controller=require(_0x025f('0x4'));router['get']('/',auth[_0x025f('0x5')](),controller['index']);router[_0x025f('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x025f('0x7')]);router[_0x025f('0x6')](_0x025f('0x8'),auth[_0x025f('0x5')](),controller['getConfigurations']);router[_0x025f('0x6')](_0x025f('0x9'),auth[_0x025f('0x5')](),controller['getFields']);router['post']('/',auth[_0x025f('0x5')](),controller['create']);router['post'](_0x025f('0x8'),auth[_0x025f('0x5')](),controller[_0x025f('0xa')]);router[_0x025f('0xb')](_0x025f('0xc'),auth[_0x025f('0x5')](),controller[_0x025f('0xd')]);router[_0x025f('0xe')](_0x025f('0xc'),auth[_0x025f('0x5')](),controller['destroy']);module[_0x025f('0xf')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 268fb8d..4de0d31 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 _0xdf3c=['exports','STRING','username','remoteUri','sequelize'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xdf3c,0xd1));var _0xcdf3=function(_0x1b6186,_0x1ec7f2){_0x1b6186=_0x1b6186-0x0;var _0x186121=_0xdf3c[_0x1b6186];return _0x186121;};'use strict';var Sequelize=require(_0xcdf3('0x0'));module[_0xcdf3('0x1')]={'name':{'type':Sequelize[_0xcdf3('0x2')]},'description':{'type':Sequelize[_0xcdf3('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xcdf3('0x3')},'password':{'type':Sequelize[_0xcdf3('0x2')]},'email':{'type':Sequelize[_0xcdf3('0x2')]},'remoteUri':{'type':Sequelize[_0xcdf3('0x2')],'unique':_0xcdf3('0x4')},'serverUrl':{'type':Sequelize[_0xcdf3('0x2')]}}; \ No newline at end of file +var _0xe96a=['sequelize','exports','STRING','username'];(function(_0x599172,_0x39d583){var _0x4e73dc=function(_0x37cf83){while(--_0x37cf83){_0x599172['push'](_0x599172['shift']());}};_0x4e73dc(++_0x39d583);}(_0xe96a,0xe4));var _0xae96=function(_0x4668a6,_0x4e8a1f){_0x4668a6=_0x4668a6-0x0;var _0x23215d=_0xe96a[_0x4668a6];return _0x23215d;};'use strict';var Sequelize=require(_0xae96('0x0'));module[_0xae96('0x1')]={'name':{'type':Sequelize[_0xae96('0x2')]},'description':{'type':Sequelize[_0xae96('0x2')]},'username':{'type':Sequelize['STRING'],'unique':_0xae96('0x3')},'password':{'type':Sequelize[_0xae96('0x2')]},'email':{'type':Sequelize[_0xae96('0x2')]},'remoteUri':{'type':Sequelize[_0xae96('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index 49b6a9f..a376d4a 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 _0x444b=['True','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','rimraf','fast-json-patch','moment','bluebird','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','end','stack','name','send','map','ServicenowAccount','rawAttributes','fieldName','type','model','keys','query','intersection','attributes','length','nolimit','order','sort','filters','pick','where','merge','VIRTUAL','options','includeAll','include','findAll','show','params','fields','find','create','body','getConfigurations','findOne','ServicenowConfiguration','filter','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','made_sla','hold_reason','knowledge','subcategory','close_code','incident_state','severity','category','parent','caused_by','upon_reject','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_created_on','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','active','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','business_duration','group_list','work_end','approval_set','work_notes','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','calendar_duration','notify','sys_class_name','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','company','reassignment_count','activity_due','comments','sla_due','approval','comments_and_work_notes','sys_mod_count','reopen_count','sys_tags','escalation','correlation_id','location','username','password','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','GET','incident?sysparm_display_value=all','assign','remove','includes','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','ServiceNow\x20error:\x20','test','statusCode','Wrong\x20credentials'];(function(_0x2d2258,_0x2ce510){var _0x18e155=function(_0x11949e){while(--_0x11949e){_0x2d2258['push'](_0x2d2258['shift']());}};_0x18e155(++_0x2ce510);}(_0x444b,0x189));var _0xb444=function(_0xb4d09,_0x217f30){_0xb4d09=_0xb4d09-0x0;var _0x42c323=_0x444b[_0xb4d09];return _0x42c323;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb444('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb444('0x1'));var rp=require('request-promise');var moment=require(_0xb444('0x2'));var BPromise=require(_0xb444('0x3'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb444('0x4'));var sox=require('sox');var csv=require(_0xb444('0x5'));var ejs=require(_0xb444('0x6'));var fs=require('fs');var _=require(_0xb444('0x7'));var squel=require(_0xb444('0x8'));var crypto=require('crypto');var jsforce=require(_0xb444('0x9'));var deskjs=require(_0xb444('0xa'));var toCsv=require(_0xb444('0x5'));var querystring=require('querystring');var Papa=require(_0xb444('0xb'));var Redis=require(_0xb444('0xc'));var authService=require(_0xb444('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0xb444('0xe'));var hardwareService=require(_0xb444('0xf'));var logger=require(_0xb444('0x10'))(_0xb444('0x11'));var utils=require(_0xb444('0x12'));var config=require(_0xb444('0x13'));var db=require('../../mysqldb')['db'];var integrations=require(_0xb444('0x14'));var jayson=require(_0xb444('0x15'));var client=jayson[_0xb444('0x16')][_0xb444('0x17')]({'port':0x232a});function checkPasswordPattern(_0x515f9c,_0x5c138e,_0x2a553f){if(_0x2a553f){var _0x77c307=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x77c307['test'](_0x5c138e)){return _0x515f9c;}else{throw new db[(_0xb444('0x18'))][(_0xb444('0x19'))](_0xb444('0x1a'));}}else{return _0x515f9c;}}function respondWithRpcPromise(_0x518846,_0x453a8e,_0x4e6cb2,_0x583687){return new BPromise(function(_0x3c5dd2,_0x18a55c){var _0x3ded69=_0x583687||client;return _0x3ded69[_0xb444('0x1b')](_0x518846,_0x4e6cb2)[_0xb444('0x1c')](function(_0x394e9e){logger[_0xb444('0x1d')](_0xb444('0x1e'),_0x453a8e,_0xb444('0x1f'));logger[_0xb444('0x20')](_0xb444('0x21'),_0x453a8e,_0xb444('0x1f'),JSON['stringify'](_0x394e9e));if(_0x394e9e[_0xb444('0x22')]){if(_0x394e9e['error']['code']===0x1f4){logger[_0xb444('0x22')](_0xb444('0x1e'),_0x453a8e,_0x394e9e[_0xb444('0x22')][_0xb444('0x23')]);return _0x18a55c(_0x394e9e[_0xb444('0x22')][_0xb444('0x23')]);}logger['error'](_0xb444('0x1e'),_0x453a8e,_0x394e9e[_0xb444('0x22')][_0xb444('0x23')]);return _0x3c5dd2(_0x394e9e[_0xb444('0x22')]['message']);}else{logger[_0xb444('0x1d')](_0xb444('0x1e'),_0x453a8e,_0xb444('0x1f'));_0x3c5dd2(_0x394e9e[_0xb444('0x24')][_0xb444('0x23')]);}})[_0xb444('0x25')](function(_0x3207b8){logger[_0xb444('0x22')]('ServicenowAccount,\x20%s,\x20%s',_0x453a8e,_0x3207b8);_0x18a55c(_0x3207b8);});});}function respondWithStatusCode(_0x451284,_0x39abc3){_0x39abc3=_0x39abc3||0xcc;return function(_0x231b9f){if(_0x231b9f){return _0x451284[_0xb444('0x26')](_0x39abc3);}return _0x451284[_0xb444('0x27')](_0x39abc3)['end']();};}function respondWithResult(_0x2dc9b5,_0x5bcdc1){_0x5bcdc1=_0x5bcdc1||0xc8;return function(_0x535b38){if(_0x535b38){return _0x2dc9b5['status'](_0x5bcdc1)[_0xb444('0x28')](_0x535b38);}};}function respondWithFilteredResult(_0x55be9d,_0x208151){return function(_0x4a90b7){if(_0x4a90b7){var _0x37a0d6=_0x4a90b7[_0xb444('0x29')],_0x270da0=_0x208151['offset'],_0x33ab6f=_0x208151[_0xb444('0x2a')]+_0x208151[_0xb444('0x2b')],_0x4bafec;if(_0x33ab6f>=_0x37a0d6){_0x33ab6f=_0x37a0d6;_0x4bafec=0xc8;}else{_0x4bafec=0xce;}_0x55be9d['status'](_0x4bafec);return _0x55be9d[_0xb444('0x2c')](_0xb444('0x2d'),_0x270da0+'-'+_0x33ab6f+'/'+_0x37a0d6)[_0xb444('0x28')](_0x4a90b7);}return null;};}function patchUpdates(_0x227832){return function(_0x367e0b){try{jsonpatch[_0xb444('0x2e')](_0x367e0b,_0x227832,!![]);}catch(_0x3e8004){return BPromise[_0xb444('0x2f')](_0x3e8004);}return _0x367e0b[_0xb444('0x30')]();};}function saveUpdates(_0x5d54e7,_0xe2e7b5){return function(_0x3ca662){if(_0x3ca662){return _0x3ca662[_0xb444('0x31')](_0x5d54e7)['then'](function(_0x4c5325){return _0x4c5325;});}return null;};}function removeEntity(_0x571a7b,_0xae6478){return function(_0x5050a6){if(_0x5050a6){return _0x5050a6['destroy']()[_0xb444('0x1c')](function(){_0x571a7b['status'](0xcc)[_0xb444('0x32')]();});}};}function handleEntityNotFound(_0x468368,_0x3f9f8b){return function(_0x11ad24){if(!_0x11ad24){_0x468368[_0xb444('0x26')](0x194);}return _0x11ad24;};}function handleError(_0x1c38f2,_0x3c232e){_0x3c232e=_0x3c232e||0x1f4;return function(_0x1215bd){logger[_0xb444('0x22')](_0x1215bd[_0xb444('0x33')]);if(_0x1215bd[_0xb444('0x34')]){delete _0x1215bd['name'];}_0x1c38f2[_0xb444('0x27')](_0x3c232e)[_0xb444('0x35')](_0x1215bd);};}exports['index']=function(_0x135473,_0x2bc09a){var _0x31ed3d={},_0x145cb0={},_0x3542e1={'count':0x0,'rows':[]};var _0x118642=_[_0xb444('0x36')](db[_0xb444('0x37')][_0xb444('0x38')],function(_0x4f723d){return{'name':_0x4f723d[_0xb444('0x39')],'type':_0x4f723d[_0xb444('0x3a')]['key']};});_0x145cb0[_0xb444('0x3b')]=_[_0xb444('0x36')](_0x118642,_0xb444('0x34'));_0x145cb0['query']=_[_0xb444('0x3c')](_0x135473[_0xb444('0x3d')]);_0x145cb0['filters']=_[_0xb444('0x3e')](_0x145cb0['model'],_0x145cb0[_0xb444('0x3d')]);_0x31ed3d[_0xb444('0x3f')]=_['intersection'](_0x145cb0[_0xb444('0x3b')],qs['fields'](_0x135473[_0xb444('0x3d')]['fields']));_0x31ed3d[_0xb444('0x3f')]=_0x31ed3d[_0xb444('0x3f')][_0xb444('0x40')]?_0x31ed3d[_0xb444('0x3f')]:_0x145cb0[_0xb444('0x3b')];if(!_0x135473[_0xb444('0x3d')]['hasOwnProperty'](_0xb444('0x41'))){_0x31ed3d[_0xb444('0x2b')]=qs['limit'](_0x135473[_0xb444('0x3d')]['limit']);_0x31ed3d[_0xb444('0x2a')]=qs[_0xb444('0x2a')](_0x135473[_0xb444('0x3d')]['offset']);}_0x31ed3d[_0xb444('0x42')]=qs[_0xb444('0x43')](_0x135473[_0xb444('0x3d')][_0xb444('0x43')]);_0x31ed3d['where']=qs[_0xb444('0x44')](_[_0xb444('0x45')](_0x135473['query'],_0x145cb0[_0xb444('0x44')]));if(_0x135473['query']['filter']){_0x31ed3d[_0xb444('0x46')]=_[_0xb444('0x47')](_0x31ed3d[_0xb444('0x46')],{'$or':_[_0xb444('0x36')](_0x118642,function(_0x3d0b2b){if(_0x3d0b2b[_0xb444('0x3a')]!==_0xb444('0x48')){var _0x35cf56={};_0x35cf56[_0x3d0b2b[_0xb444('0x34')]]={'$like':'%'+_0x135473[_0xb444('0x3d')]['filter']+'%'};return _0x35cf56;}})});}_0x31ed3d=_[_0xb444('0x47')]({},_0x31ed3d,_0x135473[_0xb444('0x49')]);var _0x5a5e01={'where':_0x31ed3d['where']};return db[_0xb444('0x37')][_0xb444('0x29')](_0x5a5e01)[_0xb444('0x1c')](function(_0x22a888){_0x3542e1[_0xb444('0x29')]=_0x22a888;if(_0x135473[_0xb444('0x3d')][_0xb444('0x4a')]){_0x31ed3d[_0xb444('0x4b')]=[{'all':!![]}];}return db['ServicenowAccount'][_0xb444('0x4c')](_0x31ed3d);})[_0xb444('0x1c')](function(_0x58028a){_0x3542e1['rows']=_0x58028a;return _0x3542e1;})[_0xb444('0x1c')](respondWithFilteredResult(_0x2bc09a,_0x31ed3d))[_0xb444('0x25')](handleError(_0x2bc09a,null));};exports[_0xb444('0x4d')]=function(_0x57bceb,_0x5acdb6){var _0x3587b8={'raw':![],'where':{'id':_0x57bceb[_0xb444('0x4e')]['id']}},_0x252b34={};_0x252b34[_0xb444('0x3b')]=_[_0xb444('0x3c')](db[_0xb444('0x37')][_0xb444('0x38')]);_0x252b34[_0xb444('0x3d')]=_[_0xb444('0x3c')](_0x57bceb[_0xb444('0x3d')]);_0x252b34[_0xb444('0x44')]=_[_0xb444('0x3e')](_0x252b34['model'],_0x252b34[_0xb444('0x3d')]);_0x3587b8[_0xb444('0x3f')]=_[_0xb444('0x3e')](_0x252b34['model'],qs[_0xb444('0x4f')](_0x57bceb[_0xb444('0x3d')][_0xb444('0x4f')]));_0x3587b8[_0xb444('0x3f')]=_0x3587b8[_0xb444('0x3f')][_0xb444('0x40')]?_0x3587b8[_0xb444('0x3f')]:_0x252b34['model'];if(_0x57bceb[_0xb444('0x3d')]['includeAll']){_0x3587b8[_0xb444('0x4b')]=[{'all':!![]}];}_0x3587b8=_[_0xb444('0x47')]({},_0x3587b8,_0x57bceb[_0xb444('0x49')]);return db[_0xb444('0x37')][_0xb444('0x50')](_0x3587b8)[_0xb444('0x1c')](handleEntityNotFound(_0x5acdb6,null))[_0xb444('0x1c')](respondWithResult(_0x5acdb6,null))[_0xb444('0x25')](handleError(_0x5acdb6,null));};exports[_0xb444('0x51')]=function(_0x1f92f8,_0x8b3987){return db[_0xb444('0x37')][_0xb444('0x51')](_0x1f92f8[_0xb444('0x52')],{})[_0xb444('0x1c')](respondWithResult(_0x8b3987,0xc9))[_0xb444('0x25')](handleError(_0x8b3987,null));};exports[_0xb444('0x31')]=function(_0x3b5901,_0x42070f){if(_0x3b5901[_0xb444('0x52')]['id']){delete _0x3b5901['body']['id'];}return db[_0xb444('0x37')][_0xb444('0x50')]({'where':{'id':_0x3b5901['params']['id']}})[_0xb444('0x1c')](handleEntityNotFound(_0x42070f,null))[_0xb444('0x1c')](saveUpdates(_0x3b5901[_0xb444('0x52')],null))['then'](respondWithResult(_0x42070f,null))[_0xb444('0x25')](handleError(_0x42070f,null));};exports['destroy']=function(_0x4c09f5,_0x494483){return db[_0xb444('0x37')][_0xb444('0x50')]({'where':{'id':_0x4c09f5[_0xb444('0x4e')]['id']}})[_0xb444('0x1c')](handleEntityNotFound(_0x494483,null))['then'](removeEntity(_0x494483,null))[_0xb444('0x25')](handleError(_0x494483,null));};exports[_0xb444('0x53')]=function(_0xa8e7cd,_0xcfebc,_0x1ad8ce){var _0x36b2cd={};var _0x5d126b={};var _0x520fc;var _0x2abb5b;return db[_0xb444('0x37')][_0xb444('0x54')]({'where':{'id':_0xa8e7cd['params']['id']}})[_0xb444('0x1c')](handleEntityNotFound(_0xcfebc,null))['then'](function(_0x47862a){if(_0x47862a){_0x520fc=_0x47862a;_0x5d126b[_0xb444('0x3b')]=_[_0xb444('0x3c')](db[_0xb444('0x55')][_0xb444('0x38')]);_0x5d126b[_0xb444('0x3d')]=_[_0xb444('0x3c')](_0xa8e7cd['query']);_0x5d126b[_0xb444('0x44')]=_['intersection'](_0x5d126b['model'],_0x5d126b[_0xb444('0x3d')]);_0x36b2cd['attributes']=_[_0xb444('0x3e')](_0x5d126b[_0xb444('0x3b')],qs[_0xb444('0x4f')](_0xa8e7cd[_0xb444('0x3d')][_0xb444('0x4f')]));_0x36b2cd[_0xb444('0x3f')]=_0x36b2cd[_0xb444('0x3f')][_0xb444('0x40')]?_0x36b2cd['attributes']:_0x5d126b['model'];_0x36b2cd[_0xb444('0x42')]=qs['sort'](_0xa8e7cd[_0xb444('0x3d')]['sort']);_0x36b2cd['where']=qs[_0xb444('0x44')](_[_0xb444('0x45')](_0xa8e7cd[_0xb444('0x3d')],_0x5d126b[_0xb444('0x44')]));if(_0xa8e7cd[_0xb444('0x3d')][_0xb444('0x56')]){_0x36b2cd[_0xb444('0x46')]=_['merge'](_0x36b2cd['where'],{'$or':_[_0xb444('0x36')](_0x36b2cd[_0xb444('0x3f')],function(_0x306cd7){var _0xf477e0={};_0xf477e0[_0x306cd7]={'$like':'%'+_0xa8e7cd[_0xb444('0x3d')][_0xb444('0x56')]+'%'};return _0xf477e0;})});}_0x36b2cd=_[_0xb444('0x47')]({},_0x36b2cd,_0xa8e7cd[_0xb444('0x49')]);return _0x520fc[_0xb444('0x53')](_0x36b2cd);}})[_0xb444('0x1c')](function(_0x1781be){if(_0x1781be){_0x2abb5b=_0x1781be[_0xb444('0x40')];if(!_0xa8e7cd['query']['hasOwnProperty'](_0xb444('0x41'))){_0x36b2cd[_0xb444('0x2b')]=qs['limit'](_0xa8e7cd[_0xb444('0x3d')][_0xb444('0x2b')]);_0x36b2cd['offset']=qs[_0xb444('0x2a')](_0xa8e7cd[_0xb444('0x3d')][_0xb444('0x2a')]);}return _0x520fc[_0xb444('0x53')](_0x36b2cd);}})[_0xb444('0x1c')](function(_0x239723){if(_0x239723){return _0x239723?{'count':_0x2abb5b,'rows':_0x239723}:null;}})[_0xb444('0x1c')](respondWithResult(_0xcfebc,null))[_0xb444('0x25')](handleError(_0xcfebc,null));};exports['addConfiguration']=function(_0x177ace,_0xa75722,_0x670506){if(_0x177ace[_0xb444('0x52')]['id']){delete _0x177ace['body']['id'];}return db[_0xb444('0x37')]['findOne']({'where':{'id':_0x177ace[_0xb444('0x4e')]['id']}})[_0xb444('0x1c')](handleEntityNotFound(_0xa75722,null))[_0xb444('0x1c')](function(_0x241d3a){if(_0x241d3a){_0x177ace[_0xb444('0x52')][_0xb444('0x57')]=_0x241d3a['id'];_0x177ace[_0xb444('0x52')][_0xb444('0x58')]=integrations[_0xb444('0x59')](_0x177ace[_0xb444('0x52')][_0xb444('0x5a')],_0x177ace[_0xb444('0x52')][_0xb444('0x3a')]);_0x177ace[_0xb444('0x52')]['Descriptions']=integrations['getDescriptions'](_0x177ace[_0xb444('0x52')]['channel'],_0x177ace['body'][_0xb444('0x3a')]);return db[_0xb444('0x55')]['create'](_0x177ace[_0xb444('0x52')],{'include':[{'model':db['ServicenowField'],'as':_0xb444('0x58')},{'model':db[_0xb444('0x5b')],'as':_0xb444('0x5c')}]});}return null;})['then'](respondWithResult(_0xa75722,null))['catch'](handleError(_0xa75722,null));};exports[_0xb444('0x5d')]=function(_0x4e81df,_0xfe5dc0,_0x3309ac){var _0x55e8de=[_0xb444('0x5e'),_0xb444('0x5f'),_0xb444('0x60'),_0xb444('0x61'),_0xb444('0x62'),'notify',_0xb444('0x63'),_0xb444('0x64'),_0xb444('0x65')];var _0xcde1da=[_0xb444('0x66'),_0xb444('0x5e'),_0xb444('0x67'),'watch_list',_0xb444('0x68'),'sys_updated_on',_0xb444('0x69'),_0xb444('0x5f'),_0xb444('0x6a'),_0xb444('0x6b'),_0xb444('0x6c'),_0xb444('0x6d'),_0xb444('0x6e'),_0xb444('0x6f'),_0xb444('0x70'),'sys_domain',_0xb444('0x71'),_0xb444('0x72'),_0xb444('0x60'),_0xb444('0x42'),_0xb444('0x73'),_0xb444('0x74'),_0xb444('0x75'),_0xb444('0x76'),'impact',_0xb444('0x77'),'work_notes_list',_0xb444('0x78'),_0xb444('0x79'),_0xb444('0x7a'),_0xb444('0x7b'),_0xb444('0x7c'),_0xb444('0x7d'),'opened_at',_0xb444('0x7e'),_0xb444('0x7f'),_0xb444('0x80'),'reopened_time','resolved_at','caller_id',_0xb444('0x81'),_0xb444('0x61'),_0xb444('0x82'),'short_description',_0xb444('0x62'),_0xb444('0x83'),'delivery_task',_0xb444('0x84'),_0xb444('0x85'),_0xb444('0x86'),_0xb444('0x87'),_0xb444('0x88'),_0xb444('0x89'),_0xb444('0x8a'),_0xb444('0x8b'),'close_notes',_0xb444('0x8c'),_0xb444('0x8d'),_0xb444('0x8e'),_0xb444('0x8f'),_0xb444('0x90'),_0xb444('0x91'),_0xb444('0x63'),_0xb444('0x92'),_0xb444('0x93'),_0xb444('0x94'),_0xb444('0x95'),_0xb444('0x96'),'assigned_to',_0xb444('0x64'),_0xb444('0x97'),_0xb444('0x98'),_0xb444('0x99'),_0xb444('0x9a'),'due_date',_0xb444('0x9b'),_0xb444('0x9c'),_0xb444('0x9d'),_0xb444('0x9e'),'upon_approval',_0xb444('0x9f'),_0xb444('0xa0'),_0xb444('0x65')];var _0x4645dc='';var _0x8add06='';var _0x4e5bc4=[];var _0x1a2e1f='';var _0x590e17='';var _0x30f57f=[];var _0x2e2aaf='';var _0x1076de='';var _0x330818={};var _0xeac52a='';return db[_0xb444('0x37')][_0xb444('0x54')]({'where':{'id':_0x4e81df['params']['id']},'attributes':['id',_0xb444('0xa1'),_0xb444('0xa2'),'email',_0xb444('0xa3'),'serverUrl']})[_0xb444('0x1c')](handleEntityNotFound(_0xfe5dc0,null))[_0xb444('0x1c')](function(_0x59ef3d){if(_0x59ef3d){_0xeac52a=_0x59ef3d[_0xb444('0xa3')];var _0x1c6f49=_0xeac52a[_0xb444('0xa4')](-0x1);if(_0x1c6f49==='/'){_0xeac52a=_0xeac52a[_0xb444('0xa5')](0x0,_0xeac52a[_0xb444('0xa6')](_0x1c6f49));}_0x1076de=util[_0xb444('0xa7')](_0xb444('0xa8'),_0xeac52a);_0x2e2aaf=util[_0xb444('0xa7')](_0xb444('0xa9'),_0xeac52a);_0x330818={'user':_0x59ef3d[_0xb444('0xa1')],'pass':_0x59ef3d[_0xb444('0xa2')]};var _0x3e7295={'method':_0xb444('0xaa'),'uri':_0x1076de+_0xb444('0xab'),'auth':_0x330818,'json':!![]};return rp(_0x3e7295);}})[_0xb444('0x1c')](function(_0x48b363){if(_0x48b363['result'][_0xb444('0x40')]>0x0){_0x4645dc=_0x48b363[_0xb444('0x24')];}console['log']('incident\x20table\x20objects',_0x4645dc);_0x30f57f=[];_0x8add06=Object[_0xb444('0xac')]([],_0x4645dc);_[_0xb444('0xad')](_0x8add06,function(_0x550d6b){return!_0x55e8de[_0xb444('0xae')](_0x550d6b['name']);});_0x8add06['forEach'](function(_0x3ee63b){var _0x258037=createFieldObject(_0x2e2aaf,_0x330818,_0x3ee63b['internalType'],_0x3ee63b[_0xb444('0x34')],_0x3ee63b[_0xb444('0xaf')],![]);_0x30f57f[_0xb444('0xb0')](_0x258037);});return Promise[_0xb444('0xb1')](_0x30f57f);})['then'](function(_0x4bd9d2){_0x4e5bc4=_0x4bd9d2;_0x1a2e1f=Object['assign']([],_0x4645dc);console[_0xb444('0xb2')](_0xb444('0xb3'),_0x4645dc);_['remove'](_0x1a2e1f,function(_0x411202){return _0xcde1da[_0xb444('0xae')](_0x411202['name']);});console['log'](_0xb444('0xb4'),_0x1a2e1f);_0x30f57f=[];_0x1a2e1f[_0xb444('0xb5')](function(_0x29cebf){var _0x14a562=createFieldObject(_0x2e2aaf,_0x330818,_0x29cebf['internalType'],_0x29cebf[_0xb444('0x34')],_0x29cebf[_0xb444('0xaf')],!![]);_0x30f57f[_0xb444('0xb0')](_0x14a562);});return Promise[_0xb444('0xb1')](_0x30f57f);})[_0xb444('0x1c')](function(_0x2d9bf2){_0x590e17=_0x2d9bf2;var _0x5144df=_0x4e5bc4['concat'](_0x590e17);return{'count':_0x5144df[_0xb444('0x40')],'rows':_0x5144df};})[_0xb444('0x1c')](respondWithResult(_0xfe5dc0,null))[_0xb444('0x25')](function(_0x5ba04e){console[_0xb444('0xb2')](_0xb444('0xb6')+_0x5ba04e);var _0x11312a=_0x4e81df[_0xb444('0x3d')][_0xb444('0xb7')]?0x1f4:_0x5ba04e[_0xb444('0xb8')]||0x1f4;logger[_0xb444('0x22')](_0x5ba04e['stack']);delete _0x5ba04e[_0xb444('0x34')];if(_0x11312a===0x191){_0x11312a=0x190;}_0xfe5dc0[_0xb444('0x27')](_0x11312a)['send'](_0x4e81df[_0xb444('0x3d')][_0xb444('0xb7')]?{'message':_0xb444('0xb9'),'statusCode':_0x5ba04e[_0xb444('0xb8')]}:_0x5ba04e);});};function createFieldObject(_0xf10b48,_0x478d2c,_0x4618b7,_0x381d1f,_0x27b609,_0x3241e0){return new Promise(function(_0x28d54b,_0x3f825e){var _0x2a429d={'id':_0x381d1f,'name':_0x27b609,'custom':_0x3241e0};if(_0x4618b7==='boolean'){_0x2a429d[_0xb444('0x49')]=[{'name':_0xb444('0xba'),'value':_0xb444('0xbb')},{'name':_0xb444('0xbc'),'value':_0xb444('0xbd')}];_0x28d54b(_0x2a429d);}else{var _0x51e0d9={'method':_0xb444('0xaa'),'uri':_0xf10b48+_0xb444('0xbe')+_0x381d1f,'auth':_0x478d2c,'json':!![]};return rp(_0x51e0d9)[_0xb444('0x1c')](function(_0x3a4c61){var _0x266950=[];if(_0x3a4c61[_0xb444('0x24')][_0xb444('0x40')]>0x0){_0x3a4c61[_0xb444('0x24')][_0xb444('0xb5')](function(_0x2b40fd){if(_0x2b40fd[_0xb444('0xbf')]===_0xb444('0xbd')){var _0x235069={'name':_0x2b40fd['label'],'value':_0x2b40fd[_0xb444('0xc0')]};_0x266950['push'](_0x235069);}});}_0x2a429d[_0xb444('0x49')]=_0x266950;if(_0x2a429d['options'][_0xb444('0x40')]>0x0){_0x28d54b(_0x2a429d);}else{if(_0x3241e0==![]){_0x28d54b();}else{_0x28d54b(_0x2a429d);}}});}});} \ No newline at end of file +var _0x98d3=['update','destroy','stack','name','send','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','length','attributes','hasOwnProperty','limit','order','sort','where','pick','merge','VIRTUAL','options','ServicenowAccount','includeAll','include','findAll','rows','params','keys','fields','create','body','find','getConfigurations','ServicenowConfiguration','filter','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','ServicenowField','Descriptions','getFields','hold_reason','knowledge','subcategory','close_code','severity','category','parent','made_sla','caused_by','watch_list','upon_reject','sys_updated_on','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','sys_created_on','sys_domain','sys_created_by','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','time_worked','expected_start','opened_at','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','work_start','assignment_group','business_stc','additional_assignee_list','description','notify','sys_class_name','close_notes','closed_by','follow_up','parent_incident','sys_id','contact_type','reopened_by','urgency','problem_id','reassignment_count','assigned_to','comments','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','email','serverUrl','remoteUri','slice','substring','lastIndexOf','format','%s/api/now/doc/table/schema/','%s/api/now/table/','username','GET','incident?sysparm_display_value=all','remove','includes','label','push','all','log','TCL:\x20_object','TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom','forEach','concat','ServiceNow\x20error:\x20','statusCode','Wrong\x20credentials','boolean','True','False','sys_choice?sysparm_query=name=incident^element=','inactive','false','value','html-pdf','eml-format','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','request','then','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set'];(function(_0x21520f,_0x5af4d8){var _0x476afa=function(_0xeead8f){while(--_0xeead8f){_0x21520f['push'](_0x21520f['shift']());}};_0x476afa(++_0x5af4d8);}(_0x98d3,0x157));var _0x398d=function(_0x2a4ef4,_0x12363d){_0x2a4ef4=_0x2a4ef4-0x0;var _0x101d98=_0x98d3[_0x2a4ef4];return _0x101d98;};'use strict';var pdf=require(_0x398d('0x0'));var emlformat=require(_0x398d('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x398d('0x2'));var rp=require(_0x398d('0x3'));var moment=require(_0x398d('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x398d('0x5'));var util=require(_0x398d('0x6'));var path=require(_0x398d('0x7'));var sox=require('sox');var csv=require(_0x398d('0x8'));var ejs=require(_0x398d('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x398d('0xa'));var crypto=require('crypto');var jsforce=require(_0x398d('0xb'));var deskjs=require(_0x398d('0xc'));var toCsv=require('to-csv');var querystring=require(_0x398d('0xd'));var Papa=require(_0x398d('0xe'));var Redis=require(_0x398d('0xf'));var authService=require(_0x398d('0x10'));var qs=require(_0x398d('0x11'));var as=require(_0x398d('0x12'));var hardwareService=require(_0x398d('0x13'));var logger=require(_0x398d('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x398d('0x15'));var db=require(_0x398d('0x16'))['db'];var integrations=require(_0x398d('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x398d('0x18')][_0x398d('0x19')]({'port':0x232a});function checkPasswordPattern(_0x3e484b,_0x1819e6,_0x15fa90){if(_0x15fa90){var _0x251393=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x251393[_0x398d('0x1a')](_0x1819e6)){return _0x3e484b;}else{throw new db['Sequelize'][(_0x398d('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3e484b;}}function respondWithRpcPromise(_0x11ccd2,_0x50dcd7,_0x39ce50,_0xf9642b){return new BPromise(function(_0x3a9267,_0x31df41){var _0x4e11bd=_0xf9642b||client;return _0x4e11bd[_0x398d('0x1c')](_0x11ccd2,_0x39ce50)[_0x398d('0x1d')](function(_0x3c0ace){logger[_0x398d('0x1e')](_0x398d('0x1f'),_0x50dcd7,_0x398d('0x20'));logger[_0x398d('0x21')](_0x398d('0x22'),_0x50dcd7,_0x398d('0x20'),JSON[_0x398d('0x23')](_0x3c0ace));if(_0x3c0ace[_0x398d('0x24')]){if(_0x3c0ace[_0x398d('0x24')]['code']===0x1f4){logger[_0x398d('0x24')](_0x398d('0x1f'),_0x50dcd7,_0x3c0ace[_0x398d('0x24')][_0x398d('0x25')]);return _0x31df41(_0x3c0ace[_0x398d('0x24')][_0x398d('0x25')]);}logger['error'](_0x398d('0x1f'),_0x50dcd7,_0x3c0ace[_0x398d('0x24')]['message']);return _0x3a9267(_0x3c0ace[_0x398d('0x24')][_0x398d('0x25')]);}else{logger[_0x398d('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x50dcd7,_0x398d('0x20'));_0x3a9267(_0x3c0ace[_0x398d('0x26')]['message']);}})[_0x398d('0x27')](function(_0xab86e0){logger[_0x398d('0x24')](_0x398d('0x1f'),_0x50dcd7,_0xab86e0);_0x31df41(_0xab86e0);});});}function respondWithStatusCode(_0x411217,_0x42d275){_0x42d275=_0x42d275||0xcc;return function(_0x3e6973){if(_0x3e6973){return _0x411217[_0x398d('0x28')](_0x42d275);}return _0x411217[_0x398d('0x29')](_0x42d275)[_0x398d('0x2a')]();};}function respondWithResult(_0x406822,_0xc4afc){_0xc4afc=_0xc4afc||0xc8;return function(_0x46ebd9){if(_0x46ebd9){return _0x406822[_0x398d('0x29')](_0xc4afc)[_0x398d('0x2b')](_0x46ebd9);}};}function respondWithFilteredResult(_0x241977,_0x244063){return function(_0x56a784){if(_0x56a784){var _0x5ac030=_0x56a784[_0x398d('0x2c')],_0xede82e=_0x244063[_0x398d('0x2d')],_0x32c37d=_0x244063[_0x398d('0x2d')]+_0x244063['limit'],_0x8ba6fb;if(_0x32c37d>=_0x5ac030){_0x32c37d=_0x5ac030;_0x8ba6fb=0xc8;}else{_0x8ba6fb=0xce;}_0x241977['status'](_0x8ba6fb);return _0x241977[_0x398d('0x2e')]('Content-Range',_0xede82e+'-'+_0x32c37d+'/'+_0x5ac030)[_0x398d('0x2b')](_0x56a784);}return null;};}function patchUpdates(_0x4fef84){return function(_0xcfdcb){try{jsonpatch['apply'](_0xcfdcb,_0x4fef84,!![]);}catch(_0x272bf7){return BPromise['reject'](_0x272bf7);}return _0xcfdcb['save']();};}function saveUpdates(_0x96dba9,_0x23ccf5){return function(_0x441ca6){if(_0x441ca6){return _0x441ca6[_0x398d('0x2f')](_0x96dba9)[_0x398d('0x1d')](function(_0x4e50bb){return _0x4e50bb;});}return null;};}function removeEntity(_0x141e6d,_0x26dc05){return function(_0x38d02f){if(_0x38d02f){return _0x38d02f[_0x398d('0x30')]()[_0x398d('0x1d')](function(){_0x141e6d['status'](0xcc)[_0x398d('0x2a')]();});}};}function handleEntityNotFound(_0x1bfc78,_0x5023f2){return function(_0x4d3241){if(!_0x4d3241){_0x1bfc78['sendStatus'](0x194);}return _0x4d3241;};}function handleError(_0x58064e,_0x106a9b){_0x106a9b=_0x106a9b||0x1f4;return function(_0x32e933){logger['error'](_0x32e933[_0x398d('0x31')]);if(_0x32e933[_0x398d('0x32')]){delete _0x32e933[_0x398d('0x32')];}_0x58064e[_0x398d('0x29')](_0x106a9b)[_0x398d('0x33')](_0x32e933);};}exports['index']=function(_0xd58b8d,_0x2d8bdb){var _0x273561={},_0x2f09b4={},_0x2fae07={'count':0x0,'rows':[]};var _0x49d9c7=_[_0x398d('0x34')](db['ServicenowAccount'][_0x398d('0x35')],function(_0x4b9b38){return{'name':_0x4b9b38[_0x398d('0x36')],'type':_0x4b9b38[_0x398d('0x37')][_0x398d('0x38')]};});_0x2f09b4[_0x398d('0x39')]=_['map'](_0x49d9c7,_0x398d('0x32'));_0x2f09b4[_0x398d('0x3a')]=_['keys'](_0xd58b8d[_0x398d('0x3a')]);_0x2f09b4[_0x398d('0x3b')]=_[_0x398d('0x3c')](_0x2f09b4[_0x398d('0x39')],_0x2f09b4[_0x398d('0x3a')]);_0x273561['attributes']=_[_0x398d('0x3c')](_0x2f09b4['model'],qs['fields'](_0xd58b8d[_0x398d('0x3a')]['fields']));_0x273561['attributes']=_0x273561['attributes'][_0x398d('0x3d')]?_0x273561[_0x398d('0x3e')]:_0x2f09b4['model'];if(!_0xd58b8d[_0x398d('0x3a')][_0x398d('0x3f')]('nolimit')){_0x273561['limit']=qs[_0x398d('0x40')](_0xd58b8d[_0x398d('0x3a')][_0x398d('0x40')]);_0x273561[_0x398d('0x2d')]=qs[_0x398d('0x2d')](_0xd58b8d[_0x398d('0x3a')][_0x398d('0x2d')]);}_0x273561[_0x398d('0x41')]=qs[_0x398d('0x42')](_0xd58b8d[_0x398d('0x3a')][_0x398d('0x42')]);_0x273561[_0x398d('0x43')]=qs[_0x398d('0x3b')](_[_0x398d('0x44')](_0xd58b8d[_0x398d('0x3a')],_0x2f09b4[_0x398d('0x3b')]));if(_0xd58b8d[_0x398d('0x3a')]['filter']){_0x273561[_0x398d('0x43')]=_[_0x398d('0x45')](_0x273561[_0x398d('0x43')],{'$or':_[_0x398d('0x34')](_0x49d9c7,function(_0x85c538){if(_0x85c538[_0x398d('0x37')]!==_0x398d('0x46')){var _0xa68b9={};_0xa68b9[_0x85c538[_0x398d('0x32')]]={'$like':'%'+_0xd58b8d[_0x398d('0x3a')]['filter']+'%'};return _0xa68b9;}})});}_0x273561=_['merge']({},_0x273561,_0xd58b8d[_0x398d('0x47')]);var _0x5bfa79={'where':_0x273561[_0x398d('0x43')]};return db[_0x398d('0x48')][_0x398d('0x2c')](_0x5bfa79)['then'](function(_0x5dd9d6){_0x2fae07[_0x398d('0x2c')]=_0x5dd9d6;if(_0xd58b8d['query'][_0x398d('0x49')]){_0x273561[_0x398d('0x4a')]=[{'all':!![]}];}return db[_0x398d('0x48')][_0x398d('0x4b')](_0x273561);})[_0x398d('0x1d')](function(_0xda59d9){_0x2fae07[_0x398d('0x4c')]=_0xda59d9;return _0x2fae07;})[_0x398d('0x1d')](respondWithFilteredResult(_0x2d8bdb,_0x273561))[_0x398d('0x27')](handleError(_0x2d8bdb,null));};exports['show']=function(_0x447485,_0x24ce27){var _0x41f716={'raw':![],'where':{'id':_0x447485[_0x398d('0x4d')]['id']}},_0x4671bf={};_0x4671bf['model']=_['keys'](db[_0x398d('0x48')]['rawAttributes']);_0x4671bf[_0x398d('0x3a')]=_[_0x398d('0x4e')](_0x447485['query']);_0x4671bf[_0x398d('0x3b')]=_['intersection'](_0x4671bf[_0x398d('0x39')],_0x4671bf['query']);_0x41f716[_0x398d('0x3e')]=_[_0x398d('0x3c')](_0x4671bf[_0x398d('0x39')],qs[_0x398d('0x4f')](_0x447485['query'][_0x398d('0x4f')]));_0x41f716[_0x398d('0x3e')]=_0x41f716[_0x398d('0x3e')][_0x398d('0x3d')]?_0x41f716[_0x398d('0x3e')]:_0x4671bf[_0x398d('0x39')];if(_0x447485['query'][_0x398d('0x49')]){_0x41f716[_0x398d('0x4a')]=[{'all':!![]}];}_0x41f716=_['merge']({},_0x41f716,_0x447485[_0x398d('0x47')]);return db[_0x398d('0x48')]['find'](_0x41f716)[_0x398d('0x1d')](handleEntityNotFound(_0x24ce27,null))[_0x398d('0x1d')](respondWithResult(_0x24ce27,null))[_0x398d('0x27')](handleError(_0x24ce27,null));};exports[_0x398d('0x50')]=function(_0x178b66,_0x385b8d){return db[_0x398d('0x48')]['create'](_0x178b66[_0x398d('0x51')],{})[_0x398d('0x1d')](respondWithResult(_0x385b8d,0xc9))[_0x398d('0x27')](handleError(_0x385b8d,null));};exports[_0x398d('0x2f')]=function(_0x7788ee,_0x49c8b3){if(_0x7788ee[_0x398d('0x51')]['id']){delete _0x7788ee[_0x398d('0x51')]['id'];}return db[_0x398d('0x48')][_0x398d('0x52')]({'where':{'id':_0x7788ee[_0x398d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x49c8b3,null))[_0x398d('0x1d')](saveUpdates(_0x7788ee[_0x398d('0x51')],null))['then'](respondWithResult(_0x49c8b3,null))['catch'](handleError(_0x49c8b3,null));};exports[_0x398d('0x30')]=function(_0x3bca0f,_0x609c62){return db[_0x398d('0x48')][_0x398d('0x52')]({'where':{'id':_0x3bca0f['params']['id']}})['then'](handleEntityNotFound(_0x609c62,null))[_0x398d('0x1d')](removeEntity(_0x609c62,null))['catch'](handleError(_0x609c62,null));};exports[_0x398d('0x53')]=function(_0x355447,_0x4c4198,_0x4c6d4f){var _0x52f736={};var _0x55b734={};var _0x1e08bb;var _0x539f6d;return db['ServicenowAccount']['findOne']({'where':{'id':_0x355447[_0x398d('0x4d')]['id']}})[_0x398d('0x1d')](handleEntityNotFound(_0x4c4198,null))[_0x398d('0x1d')](function(_0x1b5cee){if(_0x1b5cee){_0x1e08bb=_0x1b5cee;_0x55b734[_0x398d('0x39')]=_['keys'](db[_0x398d('0x54')][_0x398d('0x35')]);_0x55b734[_0x398d('0x3a')]=_[_0x398d('0x4e')](_0x355447['query']);_0x55b734[_0x398d('0x3b')]=_[_0x398d('0x3c')](_0x55b734['model'],_0x55b734[_0x398d('0x3a')]);_0x52f736[_0x398d('0x3e')]=_[_0x398d('0x3c')](_0x55b734[_0x398d('0x39')],qs['fields'](_0x355447[_0x398d('0x3a')][_0x398d('0x4f')]));_0x52f736[_0x398d('0x3e')]=_0x52f736['attributes'][_0x398d('0x3d')]?_0x52f736['attributes']:_0x55b734[_0x398d('0x39')];_0x52f736[_0x398d('0x41')]=qs['sort'](_0x355447[_0x398d('0x3a')][_0x398d('0x42')]);_0x52f736[_0x398d('0x43')]=qs[_0x398d('0x3b')](_[_0x398d('0x44')](_0x355447[_0x398d('0x3a')],_0x55b734[_0x398d('0x3b')]));if(_0x355447['query'][_0x398d('0x55')]){_0x52f736[_0x398d('0x43')]=_[_0x398d('0x45')](_0x52f736[_0x398d('0x43')],{'$or':_[_0x398d('0x34')](_0x52f736['attributes'],function(_0x16a184){var _0x223384={};_0x223384[_0x16a184]={'$like':'%'+_0x355447[_0x398d('0x3a')][_0x398d('0x55')]+'%'};return _0x223384;})});}_0x52f736=_[_0x398d('0x45')]({},_0x52f736,_0x355447['options']);return _0x1e08bb['getConfigurations'](_0x52f736);}})[_0x398d('0x1d')](function(_0xd55682){if(_0xd55682){_0x539f6d=_0xd55682[_0x398d('0x3d')];if(!_0x355447[_0x398d('0x3a')][_0x398d('0x3f')](_0x398d('0x56'))){_0x52f736[_0x398d('0x40')]=qs['limit'](_0x355447[_0x398d('0x3a')][_0x398d('0x40')]);_0x52f736['offset']=qs['offset'](_0x355447[_0x398d('0x3a')][_0x398d('0x2d')]);}return _0x1e08bb['getConfigurations'](_0x52f736);}})[_0x398d('0x1d')](function(_0xc6a860){if(_0xc6a860){return _0xc6a860?{'count':_0x539f6d,'rows':_0xc6a860}:null;}})[_0x398d('0x1d')](respondWithResult(_0x4c4198,null))[_0x398d('0x27')](handleError(_0x4c4198,null));};exports[_0x398d('0x57')]=function(_0x485caf,_0x238296,_0xe0040c){if(_0x485caf[_0x398d('0x51')]['id']){delete _0x485caf['body']['id'];}return db[_0x398d('0x48')]['findOne']({'where':{'id':_0x485caf[_0x398d('0x4d')]['id']}})['then'](handleEntityNotFound(_0x238296,null))[_0x398d('0x1d')](function(_0x260dc1){if(_0x260dc1){_0x485caf['body'][_0x398d('0x58')]=_0x260dc1['id'];_0x485caf[_0x398d('0x51')][_0x398d('0x59')]=integrations[_0x398d('0x5a')](_0x485caf[_0x398d('0x51')][_0x398d('0x5b')],_0x485caf[_0x398d('0x51')][_0x398d('0x37')]);_0x485caf['body']['Descriptions']=integrations['getDescriptions'](_0x485caf[_0x398d('0x51')][_0x398d('0x5b')],_0x485caf[_0x398d('0x51')][_0x398d('0x37')]);return db[_0x398d('0x54')][_0x398d('0x50')](_0x485caf[_0x398d('0x51')],{'include':[{'model':db[_0x398d('0x5c')],'as':_0x398d('0x59')},{'model':db[_0x398d('0x5c')],'as':_0x398d('0x5d')}]});}return null;})['then'](respondWithResult(_0x238296,null))['catch'](handleError(_0x238296,null));};exports[_0x398d('0x5e')]=function(_0x52cedd,_0x1c2150,_0x7ed615){var _0x1e13b3=['made_sla',_0x398d('0x5f'),_0x398d('0x60'),_0x398d('0x61'),_0x398d('0x62'),'notify','incident_state',_0x398d('0x63'),_0x398d('0x64')];var _0x1a0f7e=[_0x398d('0x65'),_0x398d('0x66'),_0x398d('0x67'),_0x398d('0x68'),_0x398d('0x69'),_0x398d('0x6a'),_0x398d('0x6b'),_0x398d('0x5f'),_0x398d('0x6c'),_0x398d('0x6d'),_0x398d('0x6e'),_0x398d('0x6f'),_0x398d('0x70'),'user_input',_0x398d('0x71'),_0x398d('0x72'),'state',_0x398d('0x73'),_0x398d('0x60'),'order',_0x398d('0x74'),'closed_at',_0x398d('0x75'),'delivery_plan',_0x398d('0x76'),_0x398d('0x77'),_0x398d('0x78'),_0x398d('0x79'),_0x398d('0x7a'),_0x398d('0x7b'),_0x398d('0x7c'),_0x398d('0x7d'),_0x398d('0x7e'),_0x398d('0x7f'),'business_duration','group_list','work_end',_0x398d('0x80'),_0x398d('0x81'),_0x398d('0x82'),_0x398d('0x83'),_0x398d('0x61'),_0x398d('0x84'),_0x398d('0x85'),_0x398d('0x62'),_0x398d('0x86'),'delivery_task',_0x398d('0x87'),_0x398d('0x88'),_0x398d('0x89'),_0x398d('0x8a'),_0x398d('0x8b'),'calendar_duration',_0x398d('0x8c'),_0x398d('0x8d'),_0x398d('0x8e'),_0x398d('0x8f'),_0x398d('0x90'),_0x398d('0x91'),_0x398d('0x92'),_0x398d('0x93'),_0x398d('0x94'),'incident_state',_0x398d('0x95'),_0x398d('0x96'),'company',_0x398d('0x97'),'activity_due',_0x398d('0x98'),_0x398d('0x63'),_0x398d('0x99'),_0x398d('0x9a'),_0x398d('0x9b'),_0x398d('0x9c'),_0x398d('0x9d'),_0x398d('0x9e'),_0x398d('0x9f'),_0x398d('0xa0'),_0x398d('0xa1'),_0x398d('0xa2'),'correlation_id','location',_0x398d('0x64')];var _0x52f056='';var _0x433210='';var _0x421e5c=[];var _0x29b5a1='';var _0x54c10d='';var _0x5a3094=[];var _0x201608='';var _0x61c2b1='';var _0x3db498={};var _0x5c5ec4='';return db[_0x398d('0x48')]['findOne']({'where':{'id':_0x52cedd[_0x398d('0x4d')]['id']},'attributes':['id','username','password',_0x398d('0xa3'),'remoteUri',_0x398d('0xa4')]})[_0x398d('0x1d')](handleEntityNotFound(_0x1c2150,null))[_0x398d('0x1d')](function(_0x459880){if(_0x459880){_0x5c5ec4=_0x459880[_0x398d('0xa5')];var _0x101fc3=_0x5c5ec4[_0x398d('0xa6')](-0x1);if(_0x101fc3==='/'){_0x5c5ec4=_0x5c5ec4[_0x398d('0xa7')](0x0,_0x5c5ec4[_0x398d('0xa8')](_0x101fc3));}_0x61c2b1=util[_0x398d('0xa9')](_0x398d('0xaa'),_0x5c5ec4);_0x201608=util[_0x398d('0xa9')](_0x398d('0xab'),_0x5c5ec4);_0x3db498={'user':_0x459880[_0x398d('0xac')],'pass':_0x459880['password']};var _0x55ae1e={'method':_0x398d('0xad'),'uri':_0x61c2b1+_0x398d('0xae'),'auth':_0x3db498,'json':!![]};return rp(_0x55ae1e);}})[_0x398d('0x1d')](function(_0x268d54){if(_0x268d54[_0x398d('0x26')][_0x398d('0x3d')]>0x0){_0x52f056=_0x268d54['result'];}console['log']('incident\x20table\x20objects',_0x52f056);_0x5a3094=[];_0x433210=Object['assign']([],_0x52f056);_[_0x398d('0xaf')](_0x433210,function(_0x2864a7){return!_0x1e13b3[_0x398d('0xb0')](_0x2864a7[_0x398d('0x32')]);});_0x433210['forEach'](function(_0x402532){var _0x1d76e3=createFieldObject(_0x201608,_0x3db498,_0x402532['internalType'],_0x402532[_0x398d('0x32')],_0x402532[_0x398d('0xb1')],![]);_0x5a3094[_0x398d('0xb2')](_0x1d76e3);});return Promise[_0x398d('0xb3')](_0x5a3094);})['then'](function(_0x617e8c){_0x421e5c=_0x617e8c;_0x29b5a1=Object['assign']([],_0x52f056);console[_0x398d('0xb4')](_0x398d('0xb5'),_0x52f056);_['remove'](_0x29b5a1,function(_0xdb4d81){return _0x1a0f7e[_0x398d('0xb0')](_0xdb4d81[_0x398d('0x32')]);});console[_0x398d('0xb4')](_0x398d('0xb6'),_0x29b5a1);_0x5a3094=[];_0x29b5a1[_0x398d('0xb7')](function(_0x136dcc){var _0x2353d8=createFieldObject(_0x201608,_0x3db498,_0x136dcc['internalType'],_0x136dcc[_0x398d('0x32')],_0x136dcc[_0x398d('0xb1')],!![]);_0x5a3094[_0x398d('0xb2')](_0x2353d8);});return Promise[_0x398d('0xb3')](_0x5a3094);})['then'](function(_0x456fc8){_0x54c10d=_0x456fc8;var _0x206a6b=_0x421e5c[_0x398d('0xb8')](_0x54c10d);return{'count':_0x206a6b[_0x398d('0x3d')],'rows':_0x206a6b};})['then'](respondWithResult(_0x1c2150,null))[_0x398d('0x27')](function(_0x394320){console[_0x398d('0xb4')](_0x398d('0xb9')+_0x394320);var _0x167bee=_0x52cedd[_0x398d('0x3a')][_0x398d('0x1a')]?0x1f4:_0x394320[_0x398d('0xba')]||0x1f4;logger[_0x398d('0x24')](_0x394320[_0x398d('0x31')]);delete _0x394320[_0x398d('0x32')];if(_0x167bee===0x191){_0x167bee=0x190;}_0x1c2150[_0x398d('0x29')](_0x167bee)[_0x398d('0x33')](_0x52cedd[_0x398d('0x3a')][_0x398d('0x1a')]?{'message':_0x398d('0xbb'),'statusCode':_0x394320['statusCode']}:_0x394320);});};function createFieldObject(_0x5e2436,_0x155117,_0xdc7d36,_0x7f796f,_0x1933a0,_0x4608da){return new Promise(function(_0x4cd9ba,_0x57aab7){var _0xd7aca0={'id':_0x7f796f,'name':_0x1933a0,'custom':_0x4608da};if(_0xdc7d36===_0x398d('0xbc')){_0xd7aca0[_0x398d('0x47')]=[{'name':_0x398d('0xbd'),'value':'true'},{'name':_0x398d('0xbe'),'value':'false'}];_0x4cd9ba(_0xd7aca0);}else{var _0x24c5c3={'method':_0x398d('0xad'),'uri':_0x5e2436+_0x398d('0xbf')+_0x7f796f,'auth':_0x155117,'json':!![]};return rp(_0x24c5c3)[_0x398d('0x1d')](function(_0x4a9208){var _0x1862de=[];if(_0x4a9208[_0x398d('0x26')][_0x398d('0x3d')]>0x0){_0x4a9208[_0x398d('0x26')][_0x398d('0xb7')](function(_0x2f3636){if(_0x2f3636[_0x398d('0xc0')]===_0x398d('0xc1')){var _0x307abe={'name':_0x2f3636[_0x398d('0xb1')],'value':_0x2f3636[_0x398d('0xc2')]};_0x1862de[_0x398d('0xb2')](_0x307abe);}});}_0xd7aca0[_0x398d('0x47')]=_0x1862de;if(_0xd7aca0[_0x398d('0x47')][_0x398d('0x3d')]>0x0){_0x4cd9ba(_0xd7aca0);}else{if(_0x4608da==![]){_0x4cd9ba();}else{_0x4cd9ba(_0xd7aca0);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index 30984c1..0e1bef1 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 _0xac31=['../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','exports','define','ServicenowAccount','lodash','util'];(function(_0x5ce148,_0x1c5191){var _0x4ff3cc=function(_0x452633){while(--_0x452633){_0x5ce148['push'](_0x5ce148['shift']());}};_0x4ff3cc(++_0x1c5191);}(_0xac31,0xca));var _0x1ac3=function(_0x4a150b,_0x535a38){_0x4a150b=_0x4a150b-0x0;var _0x2dc8a2=_0xac31[_0x4a150b];return _0x2dc8a2;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1ac3('0x7'));var config=require(_0x1ac3('0x8'));var attributes=require('./intServicenowAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x1ac3('0x9')]=function(_0x20027f,_0x2bf9b1){return _0x20027f[_0x1ac3('0xa')](_0x1ac3('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9b67=['path','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x9b67,0xf6));var _0x79b6=function(_0x6a9f06,_0x34770b){_0x6a9f06=_0x6a9f06-0x0;var _0x1e00e8=_0x9b67[_0x6a9f06];return _0x1e00e8;};'use strict';var _=require(_0x79b6('0x0'));var util=require(_0x79b6('0x1'));var logger=require(_0x79b6('0x2'))(_0x79b6('0x3'));var moment=require(_0x79b6('0x4'));var BPromise=require('bluebird');var rp=require(_0x79b6('0x5'));var fs=require('fs');var path=require(_0x79b6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x79b6('0x7'));var integrations=require(_0x79b6('0x8'));module[_0x79b6('0x9')]=function(_0xec367e,_0xfa6a05){return _0xec367e[_0x79b6('0xa')](_0x79b6('0xb'),attributes,{'tableName':'int_servicenow_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.rpc.js b/server/api/intServicenowAccount/intServicenowAccount.rpc.js index 923ec29..f61d6ad 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 _0x5012=['then','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','ServicenowAccount,\x20%s,\x20%s','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','ServicenowAccount','options','raw','where','attributes','limit','include','model','map','GetServicenowAccount','catch','ShowServicenowAccount','find'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0x5012,0x14e));var _0x2501=function(_0x3c57e9,_0x318a88){_0x3c57e9=_0x3c57e9-0x0;var _0x38f9a5=_0x5012[_0x3c57e9];return _0x38f9a5;};'use strict';var _=require(_0x2501('0x0'));var util=require(_0x2501('0x1'));var moment=require('moment');var BPromise=require(_0x2501('0x2'));var rs=require(_0x2501('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2501('0x4'))['db'];var utils=require(_0x2501('0x5'));var logger=require(_0x2501('0x6'))(_0x2501('0x7'));var config=require(_0x2501('0x8'));var jayson=require(_0x2501('0x9'));var client=jayson[_0x2501('0xa')][_0x2501('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fb346,_0x251259,_0x1c5692){return new BPromise(function(_0x44672d,_0x1d30f2){return client[_0x2501('0xc')](_0x2fb346,_0x1c5692)['then'](function(_0xfbe333){logger[_0x2501('0xd')](_0x2501('0xe'),_0x251259,_0x2501('0xf'));logger[_0x2501('0x10')](_0x2501('0x11'),_0x251259,'request\x20sent',JSON[_0x2501('0x12')](_0xfbe333));if(_0xfbe333['error']){if(_0xfbe333[_0x2501('0x13')][_0x2501('0x14')]===0x1f4){logger[_0x2501('0x13')](_0x2501('0xe'),_0x251259,_0xfbe333['error'][_0x2501('0x15')]);return _0x1d30f2(_0xfbe333[_0x2501('0x13')][_0x2501('0x15')]);}logger['error'](_0x2501('0xe'),_0x251259,_0xfbe333[_0x2501('0x13')][_0x2501('0x15')]);return _0x44672d(_0xfbe333[_0x2501('0x13')][_0x2501('0x15')]);}else{logger[_0x2501('0xd')](_0x2501('0xe'),_0x251259,'request\x20sent');_0x44672d(_0xfbe333[_0x2501('0x16')][_0x2501('0x15')]);}})['catch'](function(_0x2ed39e){logger[_0x2501('0x13')](_0x2501('0xe'),_0x251259,_0x2ed39e);_0x1d30f2(_0x2ed39e);});});}exports['GetServicenowAccount']=function(_0x58a3d5){var _0x156bfe=this;return new Promise(function(_0x17ef5f,_0x4b39b7){return db[_0x2501('0x17')]['findAll']({'raw':_0x58a3d5[_0x2501('0x18')]?_0x58a3d5[_0x2501('0x18')][_0x2501('0x19')]===undefined?!![]:![]:!![],'where':_0x58a3d5[_0x2501('0x18')]?_0x58a3d5[_0x2501('0x18')][_0x2501('0x1a')]||null:null,'attributes':_0x58a3d5['options']?_0x58a3d5[_0x2501('0x18')][_0x2501('0x1b')]||null:null,'limit':_0x58a3d5[_0x2501('0x18')]?_0x58a3d5[_0x2501('0x18')][_0x2501('0x1c')]||null:null,'include':_0x58a3d5[_0x2501('0x18')]?_0x58a3d5[_0x2501('0x18')][_0x2501('0x1d')]?_['map'](_0x58a3d5[_0x2501('0x18')]['include'],function(_0x10a3fa){return{'model':db[_0x10a3fa[_0x2501('0x1e')]],'as':_0x10a3fa['as'],'attributes':_0x10a3fa[_0x2501('0x1b')],'include':_0x10a3fa[_0x2501('0x1d')]?_[_0x2501('0x1f')](_0x10a3fa['include'],function(_0x42cc5f){return{'model':db[_0x42cc5f[_0x2501('0x1e')]],'as':_0x42cc5f['as'],'attributes':_0x42cc5f[_0x2501('0x1b')],'include':_0x42cc5f['include']?_[_0x2501('0x1f')](_0x42cc5f[_0x2501('0x1d')],function(_0x39012c){return{'model':db[_0x39012c[_0x2501('0x1e')]],'as':_0x39012c['as'],'attributes':_0x39012c[_0x2501('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2dabeb){logger[_0x2501('0xd')](_0x2501('0x20'),_0x58a3d5);logger[_0x2501('0x10')](_0x2501('0x20'),_0x58a3d5,JSON[_0x2501('0x12')](_0x2dabeb));_0x17ef5f(_0x2dabeb);})[_0x2501('0x21')](function(_0x4ce716){logger[_0x2501('0x13')]('GetServicenowAccount',_0x4ce716[_0x2501('0x15')],_0x58a3d5);_0x4b39b7(_0x156bfe[_0x2501('0x13')](0x1f4,_0x4ce716[_0x2501('0x15')]));});});};exports[_0x2501('0x22')]=function(_0x26370d){var _0x533f45=this;return new Promise(function(_0x31bd05,_0x210c93){return db[_0x2501('0x17')][_0x2501('0x23')]({'raw':_0x26370d[_0x2501('0x18')]?_0x26370d[_0x2501('0x18')][_0x2501('0x19')]===undefined?!![]:![]:!![],'where':_0x26370d[_0x2501('0x18')]?_0x26370d[_0x2501('0x18')][_0x2501('0x1a')]||null:null,'attributes':_0x26370d['options']?_0x26370d[_0x2501('0x18')][_0x2501('0x1b')]||null:null,'include':_0x26370d[_0x2501('0x18')]?_0x26370d[_0x2501('0x18')]['include']?_[_0x2501('0x1f')](_0x26370d[_0x2501('0x18')][_0x2501('0x1d')],function(_0x301b3b){return{'model':db[_0x301b3b[_0x2501('0x1e')]],'as':_0x301b3b['as'],'attributes':_0x301b3b[_0x2501('0x1b')],'include':_0x301b3b[_0x2501('0x1d')]?_[_0x2501('0x1f')](_0x301b3b[_0x2501('0x1d')],function(_0x1669a5){return{'model':db[_0x1669a5[_0x2501('0x1e')]],'as':_0x1669a5['as'],'attributes':_0x1669a5[_0x2501('0x1b')],'include':_0x1669a5[_0x2501('0x1d')]?_[_0x2501('0x1f')](_0x1669a5['include'],function(_0x206c72){return{'model':db[_0x206c72[_0x2501('0x1e')]],'as':_0x206c72['as'],'attributes':_0x206c72['attributes']};}):[]};}):[]};}):[]:[]})[_0x2501('0x24')](function(_0x407aa1){logger['info'](_0x2501('0x22'),_0x26370d);logger[_0x2501('0x10')]('ShowServicenowAccount',_0x26370d,JSON['stringify'](_0x407aa1));_0x31bd05(_0x407aa1);})['catch'](function(_0xc6130){logger[_0x2501('0x13')]('ShowServicenowAccount',_0xc6130[_0x2501('0x15')],_0x26370d);_0x210c93(_0x533f45[_0x2501('0x13')](0x1f4,_0xc6130['message']));});});}; \ No newline at end of file +var _0x7513=['info','stringify','ShowServicenowAccount','ServicenowAccount','find','debug','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','request\x20sent','ServicenowAccount,\x20%s,\x20%s,\x20%s','error','code','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','options','raw','where','limit','include','model','map','attributes'];(function(_0x277463,_0x5ecef6){var _0x27a5d8=function(_0x1882ec){while(--_0x1882ec){_0x277463['push'](_0x277463['shift']());}};_0x27a5d8(++_0x5ecef6);}(_0x7513,0x12e));var _0x3751=function(_0x2ca892,_0x11af43){_0x2ca892=_0x2ca892-0x0;var _0x3d3f77=_0x7513[_0x2ca892];return _0x3d3f77;};'use strict';var _=require(_0x3751('0x0'));var util=require(_0x3751('0x1'));var moment=require(_0x3751('0x2'));var BPromise=require('bluebird');var rs=require(_0x3751('0x3'));var fs=require('fs');var Redis=require(_0x3751('0x4'));var db=require(_0x3751('0x5'))['db'];var utils=require(_0x3751('0x6'));var logger=require(_0x3751('0x7'))(_0x3751('0x8'));var config=require('../../config/environment');var jayson=require(_0x3751('0x9'));var client=jayson[_0x3751('0xa')][_0x3751('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x541a14,_0x4328fc,_0xfc9d0d){return new BPromise(function(_0x4fb1eb,_0x3ad0ec){return client[_0x3751('0xc')](_0x541a14,_0xfc9d0d)[_0x3751('0xd')](function(_0x1d8375){logger['info']('ServicenowAccount,\x20%s,\x20%s',_0x4328fc,_0x3751('0xe'));logger['debug'](_0x3751('0xf'),_0x4328fc,_0x3751('0xe'),JSON['stringify'](_0x1d8375));if(_0x1d8375[_0x3751('0x10')]){if(_0x1d8375[_0x3751('0x10')][_0x3751('0x11')]===0x1f4){logger['error'](_0x3751('0x12'),_0x4328fc,_0x1d8375[_0x3751('0x10')]['message']);return _0x3ad0ec(_0x1d8375[_0x3751('0x10')][_0x3751('0x13')]);}logger[_0x3751('0x10')](_0x3751('0x12'),_0x4328fc,_0x1d8375['error'][_0x3751('0x13')]);return _0x4fb1eb(_0x1d8375[_0x3751('0x10')]['message']);}else{logger['info'](_0x3751('0x12'),_0x4328fc,_0x3751('0xe'));_0x4fb1eb(_0x1d8375[_0x3751('0x14')]['message']);}})[_0x3751('0x15')](function(_0x13a2a7){logger[_0x3751('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0x4328fc,_0x13a2a7);_0x3ad0ec(_0x13a2a7);});});}exports[_0x3751('0x16')]=function(_0x5627c3){var _0x2a698f=this;return new Promise(function(_0x300fe9,_0x59d908){return db['ServicenowAccount']['findAll']({'raw':_0x5627c3[_0x3751('0x17')]?_0x5627c3[_0x3751('0x17')][_0x3751('0x18')]===undefined?!![]:![]:!![],'where':_0x5627c3[_0x3751('0x17')]?_0x5627c3[_0x3751('0x17')][_0x3751('0x19')]||null:null,'attributes':_0x5627c3[_0x3751('0x17')]?_0x5627c3[_0x3751('0x17')]['attributes']||null:null,'limit':_0x5627c3['options']?_0x5627c3[_0x3751('0x17')][_0x3751('0x1a')]||null:null,'include':_0x5627c3[_0x3751('0x17')]?_0x5627c3['options']['include']?_['map'](_0x5627c3[_0x3751('0x17')][_0x3751('0x1b')],function(_0x437a15){return{'model':db[_0x437a15[_0x3751('0x1c')]],'as':_0x437a15['as'],'attributes':_0x437a15['attributes'],'include':_0x437a15[_0x3751('0x1b')]?_[_0x3751('0x1d')](_0x437a15[_0x3751('0x1b')],function(_0x1bb6b4){return{'model':db[_0x1bb6b4[_0x3751('0x1c')]],'as':_0x1bb6b4['as'],'attributes':_0x1bb6b4['attributes'],'include':_0x1bb6b4[_0x3751('0x1b')]?_[_0x3751('0x1d')](_0x1bb6b4[_0x3751('0x1b')],function(_0x3b458c){return{'model':db[_0x3b458c['model']],'as':_0x3b458c['as'],'attributes':_0x3b458c[_0x3751('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3751('0xd')](function(_0x3c1ee8){logger[_0x3751('0x1f')](_0x3751('0x16'),_0x5627c3);logger['debug']('GetServicenowAccount',_0x5627c3,JSON[_0x3751('0x20')](_0x3c1ee8));_0x300fe9(_0x3c1ee8);})['catch'](function(_0x14e4e7){logger['error']('GetServicenowAccount',_0x14e4e7[_0x3751('0x13')],_0x5627c3);_0x59d908(_0x2a698f[_0x3751('0x10')](0x1f4,_0x14e4e7[_0x3751('0x13')]));});});};exports[_0x3751('0x21')]=function(_0x4cf548){var _0x13b11a=this;return new Promise(function(_0x312c74,_0x1da863){return db[_0x3751('0x22')][_0x3751('0x23')]({'raw':_0x4cf548[_0x3751('0x17')]?_0x4cf548['options'][_0x3751('0x18')]===undefined?!![]:![]:!![],'where':_0x4cf548[_0x3751('0x17')]?_0x4cf548[_0x3751('0x17')][_0x3751('0x19')]||null:null,'attributes':_0x4cf548[_0x3751('0x17')]?_0x4cf548['options']['attributes']||null:null,'include':_0x4cf548[_0x3751('0x17')]?_0x4cf548[_0x3751('0x17')][_0x3751('0x1b')]?_['map'](_0x4cf548[_0x3751('0x17')]['include'],function(_0x3fad86){return{'model':db[_0x3fad86[_0x3751('0x1c')]],'as':_0x3fad86['as'],'attributes':_0x3fad86[_0x3751('0x1e')],'include':_0x3fad86[_0x3751('0x1b')]?_[_0x3751('0x1d')](_0x3fad86[_0x3751('0x1b')],function(_0x364ab5){return{'model':db[_0x364ab5[_0x3751('0x1c')]],'as':_0x364ab5['as'],'attributes':_0x364ab5[_0x3751('0x1e')],'include':_0x364ab5[_0x3751('0x1b')]?_[_0x3751('0x1d')](_0x364ab5[_0x3751('0x1b')],function(_0x4e164e){return{'model':db[_0x4e164e[_0x3751('0x1c')]],'as':_0x4e164e['as'],'attributes':_0x4e164e[_0x3751('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x3751('0xd')](function(_0x206189){logger[_0x3751('0x1f')](_0x3751('0x21'),_0x4cf548);logger[_0x3751('0x24')](_0x3751('0x21'),_0x4cf548,JSON['stringify'](_0x206189));_0x312c74(_0x206189);})[_0x3751('0x15')](function(_0xc4de1a){logger[_0x3751('0x10')](_0x3751('0x21'),_0xc4de1a[_0x3751('0x13')],_0x4cf548);_0x1da863(_0x13b11a[_0x3751('0x10')](0x1f4,_0xc4de1a['message']));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index 4c61a07..de3dbcd 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 _0x2dca=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','update','delete'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x2dca,0x10a));var _0xa2dc=function(_0x27dba4,_0x419253){_0x27dba4=_0x27dba4-0x0;var _0x35ec9d=_0x2dca[_0x27dba4];return _0x35ec9d;};'use strict';var multer=require(_0xa2dc('0x0'));var util=require(_0xa2dc('0x1'));var path=require('path');var timeout=require(_0xa2dc('0x2'));var express=require(_0xa2dc('0x3'));var router=express[_0xa2dc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa2dc('0x5'));var config=require(_0xa2dc('0x6'));var controller=require(_0xa2dc('0x7'));router[_0xa2dc('0x8')]('/',auth[_0xa2dc('0x9')](),controller['index']);router[_0xa2dc('0x8')](_0xa2dc('0xa'),auth[_0xa2dc('0x9')](),controller[_0xa2dc('0xb')]);router[_0xa2dc('0x8')](_0xa2dc('0xc'),auth[_0xa2dc('0x9')](),controller[_0xa2dc('0xd')]);router['get'](_0xa2dc('0xe'),auth['isAuthenticated'](),controller[_0xa2dc('0xf')]);router['get'](_0xa2dc('0x10'),auth['isAuthenticated'](),controller[_0xa2dc('0x11')]);router[_0xa2dc('0x12')]('/',auth[_0xa2dc('0x9')](),controller[_0xa2dc('0x13')]);router['put'](_0xa2dc('0xa'),auth['isAuthenticated'](),controller[_0xa2dc('0x14')]);router[_0xa2dc('0x15')]('/:id',auth[_0xa2dc('0x9')](),controller[_0xa2dc('0x16')]);module[_0xa2dc('0x17')]=router; \ No newline at end of file +var _0x1793=['getSubjects','create','put','/:id','delete','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','index','show','/:id/fields','getFields','/:id/subjects'];(function(_0x18e611,_0x21eb71){var _0x42df11=function(_0x1bbb52){while(--_0x1bbb52){_0x18e611['push'](_0x18e611['shift']());}};_0x42df11(++_0x21eb71);}(_0x1793,0xae));var _0x3179=function(_0xd13171,_0xc54453){_0xd13171=_0xd13171-0x0;var _0x452bd0=_0x1793[_0xd13171];return _0x452bd0;};'use strict';var multer=require('multer');var util=require(_0x3179('0x0'));var path=require(_0x3179('0x1'));var timeout=require(_0x3179('0x2'));var express=require(_0x3179('0x3'));var router=express['Router']();var auth=require(_0x3179('0x4'));var interaction=require(_0x3179('0x5'));var config=require(_0x3179('0x6'));var controller=require(_0x3179('0x7'));router[_0x3179('0x8')]('/',auth[_0x3179('0x9')](),controller[_0x3179('0xa')]);router[_0x3179('0x8')]('/:id',auth[_0x3179('0x9')](),controller[_0x3179('0xb')]);router[_0x3179('0x8')](_0x3179('0xc'),auth[_0x3179('0x9')](),controller[_0x3179('0xd')]);router[_0x3179('0x8')](_0x3179('0xe'),auth[_0x3179('0x9')](),controller[_0x3179('0xf')]);router[_0x3179('0x8')]('/:id/descriptions',auth[_0x3179('0x9')](),controller['getDescriptions']);router['post']('/',auth[_0x3179('0x9')](),controller[_0x3179('0x10')]);router[_0x3179('0x11')](_0x3179('0x12'),auth[_0x3179('0x9')](),controller['update']);router[_0x3179('0x13')](_0x3179('0x12'),auth[_0x3179('0x9')](),controller['destroy']);module[_0x3179('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 4c14dfb..c56cea4 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 _0xcbc6=['STRING','exports'];(function(_0x4b8959,_0x579a6d){var _0x1c49c0=function(_0x239a24){while(--_0x239a24){_0x4b8959['push'](_0x4b8959['shift']());}};_0x1c49c0(++_0x579a6d);}(_0xcbc6,0xbb));var _0x6cbc=function(_0x5d7774,_0x10e3db){_0x5d7774=_0x5d7774-0x0;var _0x100409=_0xcbc6[_0x5d7774];return _0x100409;};'use strict';var Sequelize=require('sequelize');module[_0x6cbc('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6cbc('0x1')]}}; \ No newline at end of file +var _0xc8e6=['exports','STRING'];(function(_0x43dece,_0xd66879){var _0x1290ba=function(_0x1d9b0f){while(--_0x1d9b0f){_0x43dece['push'](_0x43dece['shift']());}};_0x1290ba(++_0xd66879);}(_0xc8e6,0xbe));var _0x6c8e=function(_0x58a4fe,_0x11d439){_0x58a4fe=_0x58a4fe-0x0;var _0x697de2=_0xc8e6[_0x58a4fe];return _0x697de2;};'use strict';var Sequelize=require('sequelize');module[_0x6c8e('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6c8e('0x1')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index 5afa6cb..a610c95 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 _0xc29e=['ServicenowConfiguration,\x20%s,\x20%s','message','status','end','count','offset','limit','set','Content-Range','json','reject','save','update','destroy','stack','name','send','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','length','find','create','body','params','findOne','getFields','getSubjects','ServicenowField','pick','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','http','Sequelize','ValidationError','request','then','info','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x3bf043,_0x4ba551){var _0x386756=function(_0x153129){while(--_0x153129){_0x3bf043['push'](_0x3bf043['shift']());}};_0x386756(++_0x4ba551);}(_0xc29e,0x1ac));var _0xec29=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xc29e[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xec29('0x0'));var emlformat=require(_0xec29('0x1'));var rimraf=require(_0xec29('0x2'));var zipdir=require(_0xec29('0x3'));var jsonpatch=require(_0xec29('0x4'));var rp=require(_0xec29('0x5'));var moment=require(_0xec29('0x6'));var BPromise=require(_0xec29('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xec29('0x8'));var sox=require(_0xec29('0x9'));var csv=require('to-csv');var ejs=require(_0xec29('0xa'));var fs=require('fs');var _=require(_0xec29('0xb'));var squel=require(_0xec29('0xc'));var crypto=require(_0xec29('0xd'));var jsforce=require(_0xec29('0xe'));var deskjs=require(_0xec29('0xf'));var toCsv=require(_0xec29('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xec29('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xec29('0x12'));var as=require(_0xec29('0x13'));var hardwareService=require(_0xec29('0x14'));var logger=require(_0xec29('0x15'))(_0xec29('0x16'));var utils=require('../../config/utils');var config=require(_0xec29('0x17'));var db=require(_0xec29('0x18'))['db'];var jayson=require(_0xec29('0x19'));var client=jayson['client'][_0xec29('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb40ebf,_0x395121,_0x4a6d29){if(_0x4a6d29){var _0x46860b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x46860b['test'](_0x395121)){return _0xb40ebf;}else{throw new db[(_0xec29('0x1b'))][(_0xec29('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0xb40ebf;}}function respondWithRpcPromise(_0x30b55d,_0x2f9054,_0x3c9796,_0x56bdca){return new BPromise(function(_0x430f84,_0x455fb2){var _0x607cac=_0x56bdca||client;return _0x607cac[_0xec29('0x1d')](_0x30b55d,_0x3c9796)[_0xec29('0x1e')](function(_0xffd593){logger[_0xec29('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f9054,'request\x20sent');logger['debug'](_0xec29('0x20'),_0x2f9054,_0xec29('0x21'),JSON[_0xec29('0x22')](_0xffd593));if(_0xffd593[_0xec29('0x23')]){if(_0xffd593[_0xec29('0x23')][_0xec29('0x24')]===0x1f4){logger[_0xec29('0x23')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f9054,_0xffd593[_0xec29('0x23')]['message']);return _0x455fb2(_0xffd593[_0xec29('0x23')]['message']);}logger['error'](_0xec29('0x25'),_0x2f9054,_0xffd593['error'][_0xec29('0x26')]);return _0x430f84(_0xffd593[_0xec29('0x23')][_0xec29('0x26')]);}else{logger[_0xec29('0x1f')]('ServicenowConfiguration,\x20%s,\x20%s',_0x2f9054,'request\x20sent');_0x430f84(_0xffd593['result'][_0xec29('0x26')]);}})['catch'](function(_0x1462d3){logger[_0xec29('0x23')](_0xec29('0x25'),_0x2f9054,_0x1462d3);_0x455fb2(_0x1462d3);});});}function respondWithStatusCode(_0x5b88d1,_0x49d0c4){_0x49d0c4=_0x49d0c4||0xcc;return function(_0x3abaf6){if(_0x3abaf6){return _0x5b88d1['sendStatus'](_0x49d0c4);}return _0x5b88d1[_0xec29('0x27')](_0x49d0c4)[_0xec29('0x28')]();};}function respondWithResult(_0x12a1de,_0x70bba9){_0x70bba9=_0x70bba9||0xc8;return function(_0x256744){if(_0x256744){return _0x12a1de[_0xec29('0x27')](_0x70bba9)['json'](_0x256744);}};}function respondWithFilteredResult(_0x3640c1,_0x1ec207){return function(_0x592013){if(_0x592013){var _0x5bf8b1=_0x592013[_0xec29('0x29')],_0x38cccf=_0x1ec207[_0xec29('0x2a')],_0x599589=_0x1ec207[_0xec29('0x2a')]+_0x1ec207[_0xec29('0x2b')],_0x593351;if(_0x599589>=_0x5bf8b1){_0x599589=_0x5bf8b1;_0x593351=0xc8;}else{_0x593351=0xce;}_0x3640c1[_0xec29('0x27')](_0x593351);return _0x3640c1[_0xec29('0x2c')](_0xec29('0x2d'),_0x38cccf+'-'+_0x599589+'/'+_0x5bf8b1)[_0xec29('0x2e')](_0x592013);}return null;};}function patchUpdates(_0x52bdd5){return function(_0x311f36){try{jsonpatch['apply'](_0x311f36,_0x52bdd5,!![]);}catch(_0x132b34){return BPromise[_0xec29('0x2f')](_0x132b34);}return _0x311f36[_0xec29('0x30')]();};}function saveUpdates(_0x233e74,_0x41e621){return function(_0x4bb552){if(_0x4bb552){return _0x4bb552[_0xec29('0x31')](_0x233e74)['then'](function(_0x42c236){return _0x42c236;});}return null;};}function removeEntity(_0x441f1c,_0x360cf1){return function(_0xbe0cf7){if(_0xbe0cf7){return _0xbe0cf7[_0xec29('0x32')]()[_0xec29('0x1e')](function(){_0x441f1c[_0xec29('0x27')](0xcc)[_0xec29('0x28')]();});}};}function handleEntityNotFound(_0x54634a,_0x548c67){return function(_0x5a4f1b){if(!_0x5a4f1b){_0x54634a['sendStatus'](0x194);}return _0x5a4f1b;};}function handleError(_0x44e8a8,_0x8de2a2){_0x8de2a2=_0x8de2a2||0x1f4;return function(_0x5e24c5){logger['error'](_0x5e24c5[_0xec29('0x33')]);if(_0x5e24c5[_0xec29('0x34')]){delete _0x5e24c5['name'];}_0x44e8a8[_0xec29('0x27')](_0x8de2a2)[_0xec29('0x35')](_0x5e24c5);};}exports['index']=function(_0x30e292,_0x470bc9){var _0x1d8d03={},_0xcd8868={},_0x22ff81={'count':0x0,'rows':[]};var _0x38ae33=_[_0xec29('0x36')](db[_0xec29('0x37')][_0xec29('0x38')],function(_0x53ae36){return{'name':_0x53ae36[_0xec29('0x39')],'type':_0x53ae36[_0xec29('0x3a')][_0xec29('0x3b')]};});_0xcd8868[_0xec29('0x3c')]=_[_0xec29('0x36')](_0x38ae33,_0xec29('0x34'));_0xcd8868[_0xec29('0x3d')]=_[_0xec29('0x3e')](_0x30e292[_0xec29('0x3d')]);_0xcd8868[_0xec29('0x3f')]=_[_0xec29('0x40')](_0xcd8868[_0xec29('0x3c')],_0xcd8868['query']);_0x1d8d03[_0xec29('0x41')]=_[_0xec29('0x40')](_0xcd8868[_0xec29('0x3c')],qs[_0xec29('0x42')](_0x30e292[_0xec29('0x3d')][_0xec29('0x42')]));_0x1d8d03[_0xec29('0x41')]=_0x1d8d03[_0xec29('0x41')]['length']?_0x1d8d03[_0xec29('0x41')]:_0xcd8868[_0xec29('0x3c')];if(!_0x30e292[_0xec29('0x3d')][_0xec29('0x43')](_0xec29('0x44'))){_0x1d8d03[_0xec29('0x2b')]=qs[_0xec29('0x2b')](_0x30e292[_0xec29('0x3d')]['limit']);_0x1d8d03[_0xec29('0x2a')]=qs[_0xec29('0x2a')](_0x30e292[_0xec29('0x3d')]['offset']);}_0x1d8d03[_0xec29('0x45')]=qs[_0xec29('0x46')](_0x30e292[_0xec29('0x3d')][_0xec29('0x46')]);_0x1d8d03[_0xec29('0x47')]=qs[_0xec29('0x3f')](_['pick'](_0x30e292[_0xec29('0x3d')],_0xcd8868[_0xec29('0x3f')]));if(_0x30e292[_0xec29('0x3d')][_0xec29('0x48')]){_0x1d8d03[_0xec29('0x47')]=_[_0xec29('0x49')](_0x1d8d03['where'],{'$or':_[_0xec29('0x36')](_0x38ae33,function(_0x2422e7){if(_0x2422e7[_0xec29('0x3a')]!==_0xec29('0x4a')){var _0x102f29={};_0x102f29[_0x2422e7[_0xec29('0x34')]]={'$like':'%'+_0x30e292[_0xec29('0x3d')][_0xec29('0x48')]+'%'};return _0x102f29;}})});}_0x1d8d03=_['merge']({},_0x1d8d03,_0x30e292[_0xec29('0x4b')]);var _0x4ae5e7={'where':_0x1d8d03[_0xec29('0x47')]};return db[_0xec29('0x37')][_0xec29('0x29')](_0x4ae5e7)[_0xec29('0x1e')](function(_0x2974ad){_0x22ff81['count']=_0x2974ad;if(_0x30e292['query'][_0xec29('0x4c')]){_0x1d8d03[_0xec29('0x4d')]=[{'all':!![]}];}return db['ServicenowConfiguration'][_0xec29('0x4e')](_0x1d8d03);})[_0xec29('0x1e')](function(_0x46d468){_0x22ff81[_0xec29('0x4f')]=_0x46d468;return _0x22ff81;})['then'](respondWithFilteredResult(_0x470bc9,_0x1d8d03))[_0xec29('0x50')](handleError(_0x470bc9,null));};exports[_0xec29('0x51')]=function(_0x3d8bfa,_0x330ad1){var _0x566dc7={'raw':![],'where':{'id':_0x3d8bfa['params']['id']}},_0x3f2d33={};_0x3f2d33['model']=_[_0xec29('0x3e')](db[_0xec29('0x37')][_0xec29('0x38')]);_0x3f2d33[_0xec29('0x3d')]=_[_0xec29('0x3e')](_0x3d8bfa[_0xec29('0x3d')]);_0x3f2d33[_0xec29('0x3f')]=_[_0xec29('0x40')](_0x3f2d33[_0xec29('0x3c')],_0x3f2d33[_0xec29('0x3d')]);_0x566dc7[_0xec29('0x41')]=_[_0xec29('0x40')](_0x3f2d33['model'],qs['fields'](_0x3d8bfa['query']['fields']));_0x566dc7[_0xec29('0x41')]=_0x566dc7[_0xec29('0x41')][_0xec29('0x52')]?_0x566dc7[_0xec29('0x41')]:_0x3f2d33[_0xec29('0x3c')];if(_0x3d8bfa[_0xec29('0x3d')][_0xec29('0x4c')]){_0x566dc7[_0xec29('0x4d')]=[{'all':!![]}];}_0x566dc7=_[_0xec29('0x49')]({},_0x566dc7,_0x3d8bfa[_0xec29('0x4b')]);return db['ServicenowConfiguration'][_0xec29('0x53')](_0x566dc7)[_0xec29('0x1e')](handleEntityNotFound(_0x330ad1,null))[_0xec29('0x1e')](respondWithResult(_0x330ad1,null))[_0xec29('0x50')](handleError(_0x330ad1,null));};exports[_0xec29('0x54')]=function(_0x21ced3,_0x124398){return db[_0xec29('0x37')][_0xec29('0x54')](_0x21ced3[_0xec29('0x55')],{})['then'](respondWithResult(_0x124398,0xc9))[_0xec29('0x50')](handleError(_0x124398,null));};exports[_0xec29('0x31')]=function(_0x1cd7a8,_0x480a7c){if(_0x1cd7a8[_0xec29('0x55')]['id']){delete _0x1cd7a8[_0xec29('0x55')]['id'];}return db['ServicenowConfiguration']['find']({'where':{'id':_0x1cd7a8[_0xec29('0x56')]['id']}})[_0xec29('0x1e')](handleEntityNotFound(_0x480a7c,null))[_0xec29('0x1e')](saveUpdates(_0x1cd7a8[_0xec29('0x55')],null))[_0xec29('0x1e')](respondWithResult(_0x480a7c,null))[_0xec29('0x50')](handleError(_0x480a7c,null));};exports[_0xec29('0x32')]=function(_0x11325a,_0x294376){return db[_0xec29('0x37')][_0xec29('0x53')]({'where':{'id':_0x11325a['params']['id']}})[_0xec29('0x1e')](handleEntityNotFound(_0x294376,null))[_0xec29('0x1e')](removeEntity(_0x294376,null))['catch'](handleError(_0x294376,null));};exports['getFields']=function(_0x30bf7c,_0x5be209,_0x30d473){var _0x583a76={};var _0x5420ec={};var _0x46ae06;var _0x5d8218;return db[_0xec29('0x37')][_0xec29('0x57')]({'where':{'id':_0x30bf7c[_0xec29('0x56')]['id']}})[_0xec29('0x1e')](handleEntityNotFound(_0x5be209,null))[_0xec29('0x1e')](function(_0x4a6209){if(_0x4a6209){_0x46ae06=_0x4a6209;_0x5420ec[_0xec29('0x3c')]=_['keys'](db['ServicenowField'][_0xec29('0x38')]);_0x5420ec[_0xec29('0x3d')]=_[_0xec29('0x3e')](_0x30bf7c[_0xec29('0x3d')]);_0x5420ec['filters']=_[_0xec29('0x40')](_0x5420ec[_0xec29('0x3c')],_0x5420ec[_0xec29('0x3d')]);_0x583a76[_0xec29('0x41')]=_[_0xec29('0x40')](_0x5420ec[_0xec29('0x3c')],qs[_0xec29('0x42')](_0x30bf7c[_0xec29('0x3d')]['fields']));_0x583a76['attributes']=_0x583a76[_0xec29('0x41')][_0xec29('0x52')]?_0x583a76[_0xec29('0x41')]:_0x5420ec[_0xec29('0x3c')];_0x583a76[_0xec29('0x45')]=qs[_0xec29('0x46')](_0x30bf7c[_0xec29('0x3d')][_0xec29('0x46')]);_0x583a76[_0xec29('0x47')]=qs['filters'](_['pick'](_0x30bf7c[_0xec29('0x3d')],_0x5420ec[_0xec29('0x3f')]));if(_0x30bf7c[_0xec29('0x3d')][_0xec29('0x48')]){_0x583a76['where']=_[_0xec29('0x49')](_0x583a76[_0xec29('0x47')],{'$or':_[_0xec29('0x36')](_0x583a76[_0xec29('0x41')],function(_0x2dc2d7){var _0x44c243={};_0x44c243[_0x2dc2d7]={'$like':'%'+_0x30bf7c[_0xec29('0x3d')][_0xec29('0x48')]+'%'};return _0x44c243;})});}_0x583a76=_[_0xec29('0x49')]({},_0x583a76,_0x30bf7c['options']);return _0x46ae06[_0xec29('0x58')](_0x583a76);}})[_0xec29('0x1e')](function(_0x13465a){if(_0x13465a){_0x5d8218=_0x13465a[_0xec29('0x52')];if(!_0x30bf7c[_0xec29('0x3d')][_0xec29('0x43')]('nolimit')){_0x583a76[_0xec29('0x2b')]=qs['limit'](_0x30bf7c[_0xec29('0x3d')][_0xec29('0x2b')]);_0x583a76['offset']=qs[_0xec29('0x2a')](_0x30bf7c[_0xec29('0x3d')]['offset']);}return _0x46ae06[_0xec29('0x58')](_0x583a76);}})[_0xec29('0x1e')](function(_0x513152){if(_0x513152){return _0x513152?{'count':_0x5d8218,'rows':_0x513152}:null;}})['then'](respondWithResult(_0x5be209,null))[_0xec29('0x50')](handleError(_0x5be209,null));};exports[_0xec29('0x59')]=function(_0xce0b77,_0x4d3e26,_0x489e8f){var _0x2a5192={};var _0x54c284={};var _0x6f205e;var _0x16bfdb;return db['ServicenowConfiguration'][_0xec29('0x57')]({'where':{'id':_0xce0b77[_0xec29('0x56')]['id']}})['then'](handleEntityNotFound(_0x4d3e26,null))[_0xec29('0x1e')](function(_0x426748){if(_0x426748){_0x6f205e=_0x426748;_0x54c284[_0xec29('0x3c')]=_[_0xec29('0x3e')](db[_0xec29('0x5a')][_0xec29('0x38')]);_0x54c284[_0xec29('0x3d')]=_[_0xec29('0x3e')](_0xce0b77[_0xec29('0x3d')]);_0x54c284[_0xec29('0x3f')]=_[_0xec29('0x40')](_0x54c284[_0xec29('0x3c')],_0x54c284[_0xec29('0x3d')]);_0x2a5192[_0xec29('0x41')]=_[_0xec29('0x40')](_0x54c284['model'],qs[_0xec29('0x42')](_0xce0b77['query'][_0xec29('0x42')]));_0x2a5192[_0xec29('0x41')]=_0x2a5192['attributes'][_0xec29('0x52')]?_0x2a5192[_0xec29('0x41')]:_0x54c284[_0xec29('0x3c')];_0x2a5192[_0xec29('0x45')]=qs[_0xec29('0x46')](_0xce0b77['query'][_0xec29('0x46')]);_0x2a5192[_0xec29('0x47')]=qs[_0xec29('0x3f')](_[_0xec29('0x5b')](_0xce0b77[_0xec29('0x3d')],_0x54c284[_0xec29('0x3f')]));if(_0xce0b77[_0xec29('0x3d')]['filter']){_0x2a5192[_0xec29('0x47')]=_[_0xec29('0x49')](_0x2a5192[_0xec29('0x47')],{'$or':_[_0xec29('0x36')](_0x2a5192[_0xec29('0x41')],function(_0x44dd66){var _0x1de484={};_0x1de484[_0x44dd66]={'$like':'%'+_0xce0b77[_0xec29('0x3d')]['filter']+'%'};return _0x1de484;})});}_0x2a5192=_['merge']({},_0x2a5192,_0xce0b77[_0xec29('0x4b')]);return _0x6f205e['getSubjects'](_0x2a5192);}})[_0xec29('0x1e')](function(_0x446e81){if(_0x446e81){_0x16bfdb=_0x446e81[_0xec29('0x52')];if(!_0xce0b77['query'][_0xec29('0x43')](_0xec29('0x44'))){_0x2a5192[_0xec29('0x2b')]=qs[_0xec29('0x2b')](_0xce0b77[_0xec29('0x3d')]['limit']);_0x2a5192[_0xec29('0x2a')]=qs[_0xec29('0x2a')](_0xce0b77[_0xec29('0x3d')]['offset']);}return _0x6f205e['getSubjects'](_0x2a5192);}})[_0xec29('0x1e')](function(_0x571d2b){if(_0x571d2b){return _0x571d2b?{'count':_0x16bfdb,'rows':_0x571d2b}:null;}})['then'](respondWithResult(_0x4d3e26,null))[_0xec29('0x50')](handleError(_0x4d3e26,null));};exports['getDescriptions']=function(_0x4ca1c5,_0x24d0b1,_0x4be2f0){var _0x49b9d7={};var _0x51ebcc={};var _0x1d8d19;var _0x11066;return db[_0xec29('0x37')][_0xec29('0x57')]({'where':{'id':_0x4ca1c5[_0xec29('0x56')]['id']}})[_0xec29('0x1e')](handleEntityNotFound(_0x24d0b1,null))[_0xec29('0x1e')](function(_0x11ca87){if(_0x11ca87){_0x1d8d19=_0x11ca87;_0x51ebcc['model']=_[_0xec29('0x3e')](db[_0xec29('0x5a')][_0xec29('0x38')]);_0x51ebcc[_0xec29('0x3d')]=_[_0xec29('0x3e')](_0x4ca1c5[_0xec29('0x3d')]);_0x51ebcc['filters']=_[_0xec29('0x40')](_0x51ebcc[_0xec29('0x3c')],_0x51ebcc[_0xec29('0x3d')]);_0x49b9d7[_0xec29('0x41')]=_['intersection'](_0x51ebcc[_0xec29('0x3c')],qs[_0xec29('0x42')](_0x4ca1c5[_0xec29('0x3d')][_0xec29('0x42')]));_0x49b9d7['attributes']=_0x49b9d7['attributes'][_0xec29('0x52')]?_0x49b9d7[_0xec29('0x41')]:_0x51ebcc[_0xec29('0x3c')];_0x49b9d7[_0xec29('0x45')]=qs[_0xec29('0x46')](_0x4ca1c5[_0xec29('0x3d')]['sort']);_0x49b9d7[_0xec29('0x47')]=qs[_0xec29('0x3f')](_[_0xec29('0x5b')](_0x4ca1c5['query'],_0x51ebcc[_0xec29('0x3f')]));if(_0x4ca1c5[_0xec29('0x3d')][_0xec29('0x48')]){_0x49b9d7[_0xec29('0x47')]=_['merge'](_0x49b9d7[_0xec29('0x47')],{'$or':_[_0xec29('0x36')](_0x49b9d7[_0xec29('0x41')],function(_0x232793){var _0x209bdb={};_0x209bdb[_0x232793]={'$like':'%'+_0x4ca1c5[_0xec29('0x3d')][_0xec29('0x48')]+'%'};return _0x209bdb;})});}_0x49b9d7=_['merge']({},_0x49b9d7,_0x4ca1c5[_0xec29('0x4b')]);return _0x1d8d19[_0xec29('0x5c')](_0x49b9d7);}})[_0xec29('0x1e')](function(_0x1053f7){if(_0x1053f7){_0x11066=_0x1053f7[_0xec29('0x52')];if(!_0x4ca1c5[_0xec29('0x3d')][_0xec29('0x43')](_0xec29('0x44'))){_0x49b9d7[_0xec29('0x2b')]=qs[_0xec29('0x2b')](_0x4ca1c5['query'][_0xec29('0x2b')]);_0x49b9d7[_0xec29('0x2a')]=qs[_0xec29('0x2a')](_0x4ca1c5['query'][_0xec29('0x2a')]);}return _0x1d8d19[_0xec29('0x5c')](_0x49b9d7);}})['then'](function(_0x9f2651){if(_0x9f2651){return _0x9f2651?{'count':_0x11066,'rows':_0x9f2651}:null;}})[_0xec29('0x1e')](respondWithResult(_0x24d0b1,null))['catch'](handleError(_0x24d0b1,null));}; \ No newline at end of file +var _0xb028=['name','index','map','ServicenowConfiguration','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','findAll','params','includeAll','include','create','body','find','getFields','hasOwnProperty','getSubjects','findOne','ServicenowField','getDescriptions','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','ValidationError','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset','apply','reject','save','update','destroy','end'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0xb028,0x18b));var _0x8b02=function(_0x479011,_0x3f5155){_0x479011=_0x479011-0x0;var _0x4f3c39=_0xb028[_0x479011];return _0x4f3c39;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x8b02('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8b02('0x1'));var rp=require(_0x8b02('0x2'));var moment=require(_0x8b02('0x3'));var BPromise=require(_0x8b02('0x4'));var Mustache=require(_0x8b02('0x5'));var util=require(_0x8b02('0x6'));var path=require(_0x8b02('0x7'));var sox=require(_0x8b02('0x8'));var csv=require(_0x8b02('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8b02('0xa'));var squel=require(_0x8b02('0xb'));var crypto=require(_0x8b02('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8b02('0xd'));var toCsv=require(_0x8b02('0x9'));var querystring=require(_0x8b02('0xe'));var Papa=require(_0x8b02('0xf'));var Redis=require(_0x8b02('0x10'));var authService=require(_0x8b02('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8b02('0x12'));var logger=require(_0x8b02('0x13'))(_0x8b02('0x14'));var utils=require(_0x8b02('0x15'));var config=require(_0x8b02('0x16'));var db=require(_0x8b02('0x17'))['db'];var jayson=require(_0x8b02('0x18'));var client=jayson[_0x8b02('0x19')][_0x8b02('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x12595e,_0x54c527,_0x9c06e8){if(_0x9c06e8){var _0x5003d6=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5003d6[_0x8b02('0x1b')](_0x54c527)){return _0x12595e;}else{throw new db['Sequelize'][(_0x8b02('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x12595e;}}function respondWithRpcPromise(_0x1f9d41,_0x338979,_0x1bcdc4,_0x422134){return new BPromise(function(_0x318ad1,_0xff6817){var _0x2947bf=_0x422134||client;return _0x2947bf['request'](_0x1f9d41,_0x1bcdc4)[_0x8b02('0x1d')](function(_0xb37bff){logger[_0x8b02('0x1e')](_0x8b02('0x1f'),_0x338979,_0x8b02('0x20'));logger['debug'](_0x8b02('0x21'),_0x338979,_0x8b02('0x20'),JSON[_0x8b02('0x22')](_0xb37bff));if(_0xb37bff[_0x8b02('0x23')]){if(_0xb37bff[_0x8b02('0x23')][_0x8b02('0x24')]===0x1f4){logger[_0x8b02('0x23')](_0x8b02('0x1f'),_0x338979,_0xb37bff[_0x8b02('0x23')][_0x8b02('0x25')]);return _0xff6817(_0xb37bff['error']['message']);}logger[_0x8b02('0x23')](_0x8b02('0x1f'),_0x338979,_0xb37bff[_0x8b02('0x23')][_0x8b02('0x25')]);return _0x318ad1(_0xb37bff[_0x8b02('0x23')][_0x8b02('0x25')]);}else{logger[_0x8b02('0x1e')](_0x8b02('0x1f'),_0x338979,_0x8b02('0x20'));_0x318ad1(_0xb37bff['result'][_0x8b02('0x25')]);}})[_0x8b02('0x26')](function(_0x4577f1){logger[_0x8b02('0x23')](_0x8b02('0x1f'),_0x338979,_0x4577f1);_0xff6817(_0x4577f1);});});}function respondWithStatusCode(_0x3f603c,_0x5c55de){_0x5c55de=_0x5c55de||0xcc;return function(_0x15434c){if(_0x15434c){return _0x3f603c[_0x8b02('0x27')](_0x5c55de);}return _0x3f603c['status'](_0x5c55de)['end']();};}function respondWithResult(_0x118edb,_0x2ce269){_0x2ce269=_0x2ce269||0xc8;return function(_0x175718){if(_0x175718){return _0x118edb[_0x8b02('0x28')](_0x2ce269)[_0x8b02('0x29')](_0x175718);}};}function respondWithFilteredResult(_0x3aeb9c,_0x1543d2){return function(_0x1366c7){if(_0x1366c7){var _0x466ed3=_0x1366c7[_0x8b02('0x2a')],_0x70cb68=_0x1543d2[_0x8b02('0x2b')],_0x16c843=_0x1543d2[_0x8b02('0x2b')]+_0x1543d2['limit'],_0x1011a4;if(_0x16c843>=_0x466ed3){_0x16c843=_0x466ed3;_0x1011a4=0xc8;}else{_0x1011a4=0xce;}_0x3aeb9c['status'](_0x1011a4);return _0x3aeb9c['set']('Content-Range',_0x70cb68+'-'+_0x16c843+'/'+_0x466ed3)[_0x8b02('0x29')](_0x1366c7);}return null;};}function patchUpdates(_0x166430){return function(_0x5b75d6){try{jsonpatch[_0x8b02('0x2c')](_0x5b75d6,_0x166430,!![]);}catch(_0x1ce1e2){return BPromise[_0x8b02('0x2d')](_0x1ce1e2);}return _0x5b75d6[_0x8b02('0x2e')]();};}function saveUpdates(_0x3e1e3b,_0x4dc5fd){return function(_0x35aa3c){if(_0x35aa3c){return _0x35aa3c[_0x8b02('0x2f')](_0x3e1e3b)[_0x8b02('0x1d')](function(_0x495fee){return _0x495fee;});}return null;};}function removeEntity(_0xda249b,_0x1149cf){return function(_0x44f584){if(_0x44f584){return _0x44f584[_0x8b02('0x30')]()[_0x8b02('0x1d')](function(){_0xda249b[_0x8b02('0x28')](0xcc)[_0x8b02('0x31')]();});}};}function handleEntityNotFound(_0x218f40,_0x5b50c3){return function(_0x1f4774){if(!_0x1f4774){_0x218f40[_0x8b02('0x27')](0x194);}return _0x1f4774;};}function handleError(_0x19877c,_0x1fb25f){_0x1fb25f=_0x1fb25f||0x1f4;return function(_0x3c39f6){logger['error'](_0x3c39f6['stack']);if(_0x3c39f6[_0x8b02('0x32')]){delete _0x3c39f6[_0x8b02('0x32')];}_0x19877c['status'](_0x1fb25f)['send'](_0x3c39f6);};}exports[_0x8b02('0x33')]=function(_0xd2ed56,_0x5e74a6){var _0x25f34e={},_0x254aed={},_0x59fc9f={'count':0x0,'rows':[]};var _0x2a0bb1=_[_0x8b02('0x34')](db[_0x8b02('0x35')][_0x8b02('0x36')],function(_0x964319){return{'name':_0x964319[_0x8b02('0x37')],'type':_0x964319[_0x8b02('0x38')][_0x8b02('0x39')]};});_0x254aed[_0x8b02('0x3a')]=_[_0x8b02('0x34')](_0x2a0bb1,_0x8b02('0x32'));_0x254aed['query']=_[_0x8b02('0x3b')](_0xd2ed56[_0x8b02('0x3c')]);_0x254aed[_0x8b02('0x3d')]=_[_0x8b02('0x3e')](_0x254aed[_0x8b02('0x3a')],_0x254aed['query']);_0x25f34e['attributes']=_[_0x8b02('0x3e')](_0x254aed[_0x8b02('0x3a')],qs[_0x8b02('0x3f')](_0xd2ed56[_0x8b02('0x3c')]['fields']));_0x25f34e[_0x8b02('0x40')]=_0x25f34e['attributes'][_0x8b02('0x41')]?_0x25f34e['attributes']:_0x254aed['model'];if(!_0xd2ed56[_0x8b02('0x3c')]['hasOwnProperty'](_0x8b02('0x42'))){_0x25f34e[_0x8b02('0x43')]=qs[_0x8b02('0x43')](_0xd2ed56[_0x8b02('0x3c')]['limit']);_0x25f34e[_0x8b02('0x2b')]=qs[_0x8b02('0x2b')](_0xd2ed56[_0x8b02('0x3c')][_0x8b02('0x2b')]);}_0x25f34e[_0x8b02('0x44')]=qs[_0x8b02('0x45')](_0xd2ed56[_0x8b02('0x3c')]['sort']);_0x25f34e[_0x8b02('0x46')]=qs['filters'](_[_0x8b02('0x47')](_0xd2ed56[_0x8b02('0x3c')],_0x254aed[_0x8b02('0x3d')]));if(_0xd2ed56[_0x8b02('0x3c')][_0x8b02('0x48')]){_0x25f34e[_0x8b02('0x46')]=_[_0x8b02('0x49')](_0x25f34e[_0x8b02('0x46')],{'$or':_[_0x8b02('0x34')](_0x2a0bb1,function(_0x56f083){if(_0x56f083[_0x8b02('0x38')]!==_0x8b02('0x4a')){var _0x1e74e5={};_0x1e74e5[_0x56f083['name']]={'$like':'%'+_0xd2ed56[_0x8b02('0x3c')][_0x8b02('0x48')]+'%'};return _0x1e74e5;}})});}_0x25f34e=_['merge']({},_0x25f34e,_0xd2ed56[_0x8b02('0x4b')]);var _0x46195c={'where':_0x25f34e[_0x8b02('0x46')]};return db[_0x8b02('0x35')][_0x8b02('0x2a')](_0x46195c)[_0x8b02('0x1d')](function(_0x26de11){_0x59fc9f[_0x8b02('0x2a')]=_0x26de11;if(_0xd2ed56[_0x8b02('0x3c')]['includeAll']){_0x25f34e['include']=[{'all':!![]}];}return db['ServicenowConfiguration'][_0x8b02('0x4c')](_0x25f34e);})['then'](function(_0x5ec75c){_0x59fc9f['rows']=_0x5ec75c;return _0x59fc9f;})[_0x8b02('0x1d')](respondWithFilteredResult(_0x5e74a6,_0x25f34e))['catch'](handleError(_0x5e74a6,null));};exports['show']=function(_0x579133,_0x268c29){var _0xc93df5={'raw':![],'where':{'id':_0x579133[_0x8b02('0x4d')]['id']}},_0x516866={};_0x516866[_0x8b02('0x3a')]=_[_0x8b02('0x3b')](db[_0x8b02('0x35')][_0x8b02('0x36')]);_0x516866[_0x8b02('0x3c')]=_['keys'](_0x579133['query']);_0x516866[_0x8b02('0x3d')]=_[_0x8b02('0x3e')](_0x516866[_0x8b02('0x3a')],_0x516866[_0x8b02('0x3c')]);_0xc93df5[_0x8b02('0x40')]=_['intersection'](_0x516866[_0x8b02('0x3a')],qs[_0x8b02('0x3f')](_0x579133[_0x8b02('0x3c')]['fields']));_0xc93df5['attributes']=_0xc93df5['attributes']['length']?_0xc93df5[_0x8b02('0x40')]:_0x516866[_0x8b02('0x3a')];if(_0x579133[_0x8b02('0x3c')][_0x8b02('0x4e')]){_0xc93df5[_0x8b02('0x4f')]=[{'all':!![]}];}_0xc93df5=_[_0x8b02('0x49')]({},_0xc93df5,_0x579133[_0x8b02('0x4b')]);return db[_0x8b02('0x35')]['find'](_0xc93df5)[_0x8b02('0x1d')](handleEntityNotFound(_0x268c29,null))['then'](respondWithResult(_0x268c29,null))[_0x8b02('0x26')](handleError(_0x268c29,null));};exports[_0x8b02('0x50')]=function(_0x4fb4d3,_0x650b5d){return db[_0x8b02('0x35')]['create'](_0x4fb4d3[_0x8b02('0x51')],{})[_0x8b02('0x1d')](respondWithResult(_0x650b5d,0xc9))['catch'](handleError(_0x650b5d,null));};exports['update']=function(_0x3e8c52,_0x58fb4b){if(_0x3e8c52['body']['id']){delete _0x3e8c52['body']['id'];}return db[_0x8b02('0x35')][_0x8b02('0x52')]({'where':{'id':_0x3e8c52[_0x8b02('0x4d')]['id']}})[_0x8b02('0x1d')](handleEntityNotFound(_0x58fb4b,null))[_0x8b02('0x1d')](saveUpdates(_0x3e8c52[_0x8b02('0x51')],null))[_0x8b02('0x1d')](respondWithResult(_0x58fb4b,null))[_0x8b02('0x26')](handleError(_0x58fb4b,null));};exports[_0x8b02('0x30')]=function(_0x3cd3d1,_0x598fdc){return db[_0x8b02('0x35')][_0x8b02('0x52')]({'where':{'id':_0x3cd3d1[_0x8b02('0x4d')]['id']}})[_0x8b02('0x1d')](handleEntityNotFound(_0x598fdc,null))['then'](removeEntity(_0x598fdc,null))[_0x8b02('0x26')](handleError(_0x598fdc,null));};exports[_0x8b02('0x53')]=function(_0x1051aa,_0x105bc9,_0x54f2ff){var _0x3001a6={};var _0x15972c={};var _0x24d137;var _0x49df08;return db[_0x8b02('0x35')]['findOne']({'where':{'id':_0x1051aa['params']['id']}})[_0x8b02('0x1d')](handleEntityNotFound(_0x105bc9,null))[_0x8b02('0x1d')](function(_0x1be5c8){if(_0x1be5c8){_0x24d137=_0x1be5c8;_0x15972c[_0x8b02('0x3a')]=_[_0x8b02('0x3b')](db['ServicenowField']['rawAttributes']);_0x15972c[_0x8b02('0x3c')]=_['keys'](_0x1051aa['query']);_0x15972c['filters']=_[_0x8b02('0x3e')](_0x15972c[_0x8b02('0x3a')],_0x15972c[_0x8b02('0x3c')]);_0x3001a6[_0x8b02('0x40')]=_[_0x8b02('0x3e')](_0x15972c[_0x8b02('0x3a')],qs[_0x8b02('0x3f')](_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x3f')]));_0x3001a6['attributes']=_0x3001a6[_0x8b02('0x40')][_0x8b02('0x41')]?_0x3001a6['attributes']:_0x15972c[_0x8b02('0x3a')];_0x3001a6[_0x8b02('0x44')]=qs[_0x8b02('0x45')](_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x45')]);_0x3001a6[_0x8b02('0x46')]=qs[_0x8b02('0x3d')](_[_0x8b02('0x47')](_0x1051aa['query'],_0x15972c['filters']));if(_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x48')]){_0x3001a6['where']=_[_0x8b02('0x49')](_0x3001a6[_0x8b02('0x46')],{'$or':_[_0x8b02('0x34')](_0x3001a6[_0x8b02('0x40')],function(_0x4a1781){var _0x1a724c={};_0x1a724c[_0x4a1781]={'$like':'%'+_0x1051aa[_0x8b02('0x3c')]['filter']+'%'};return _0x1a724c;})});}_0x3001a6=_['merge']({},_0x3001a6,_0x1051aa[_0x8b02('0x4b')]);return _0x24d137['getFields'](_0x3001a6);}})[_0x8b02('0x1d')](function(_0x23cfa1){if(_0x23cfa1){_0x49df08=_0x23cfa1[_0x8b02('0x41')];if(!_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x54')](_0x8b02('0x42'))){_0x3001a6[_0x8b02('0x43')]=qs['limit'](_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x43')]);_0x3001a6['offset']=qs[_0x8b02('0x2b')](_0x1051aa[_0x8b02('0x3c')][_0x8b02('0x2b')]);}return _0x24d137[_0x8b02('0x53')](_0x3001a6);}})[_0x8b02('0x1d')](function(_0x303d81){if(_0x303d81){return _0x303d81?{'count':_0x49df08,'rows':_0x303d81}:null;}})[_0x8b02('0x1d')](respondWithResult(_0x105bc9,null))['catch'](handleError(_0x105bc9,null));};exports[_0x8b02('0x55')]=function(_0x9660f,_0x211e1f,_0x3029e6){var _0x3f55f4={};var _0x2befa0={};var _0x38d6af;var _0x487f4a;return db['ServicenowConfiguration'][_0x8b02('0x56')]({'where':{'id':_0x9660f[_0x8b02('0x4d')]['id']}})[_0x8b02('0x1d')](handleEntityNotFound(_0x211e1f,null))[_0x8b02('0x1d')](function(_0x5185cb){if(_0x5185cb){_0x38d6af=_0x5185cb;_0x2befa0[_0x8b02('0x3a')]=_[_0x8b02('0x3b')](db[_0x8b02('0x57')][_0x8b02('0x36')]);_0x2befa0[_0x8b02('0x3c')]=_[_0x8b02('0x3b')](_0x9660f[_0x8b02('0x3c')]);_0x2befa0[_0x8b02('0x3d')]=_[_0x8b02('0x3e')](_0x2befa0[_0x8b02('0x3a')],_0x2befa0['query']);_0x3f55f4['attributes']=_['intersection'](_0x2befa0[_0x8b02('0x3a')],qs[_0x8b02('0x3f')](_0x9660f[_0x8b02('0x3c')][_0x8b02('0x3f')]));_0x3f55f4['attributes']=_0x3f55f4[_0x8b02('0x40')][_0x8b02('0x41')]?_0x3f55f4[_0x8b02('0x40')]:_0x2befa0[_0x8b02('0x3a')];_0x3f55f4['order']=qs[_0x8b02('0x45')](_0x9660f[_0x8b02('0x3c')][_0x8b02('0x45')]);_0x3f55f4[_0x8b02('0x46')]=qs['filters'](_['pick'](_0x9660f[_0x8b02('0x3c')],_0x2befa0[_0x8b02('0x3d')]));if(_0x9660f['query'][_0x8b02('0x48')]){_0x3f55f4['where']=_[_0x8b02('0x49')](_0x3f55f4[_0x8b02('0x46')],{'$or':_['map'](_0x3f55f4[_0x8b02('0x40')],function(_0x21d69a){var _0x4e4d8d={};_0x4e4d8d[_0x21d69a]={'$like':'%'+_0x9660f[_0x8b02('0x3c')][_0x8b02('0x48')]+'%'};return _0x4e4d8d;})});}_0x3f55f4=_[_0x8b02('0x49')]({},_0x3f55f4,_0x9660f[_0x8b02('0x4b')]);return _0x38d6af[_0x8b02('0x55')](_0x3f55f4);}})[_0x8b02('0x1d')](function(_0x52be10){if(_0x52be10){_0x487f4a=_0x52be10[_0x8b02('0x41')];if(!_0x9660f[_0x8b02('0x3c')][_0x8b02('0x54')](_0x8b02('0x42'))){_0x3f55f4['limit']=qs[_0x8b02('0x43')](_0x9660f[_0x8b02('0x3c')]['limit']);_0x3f55f4['offset']=qs[_0x8b02('0x2b')](_0x9660f[_0x8b02('0x3c')]['offset']);}return _0x38d6af['getSubjects'](_0x3f55f4);}})[_0x8b02('0x1d')](function(_0x2eb360){if(_0x2eb360){return _0x2eb360?{'count':_0x487f4a,'rows':_0x2eb360}:null;}})[_0x8b02('0x1d')](respondWithResult(_0x211e1f,null))[_0x8b02('0x26')](handleError(_0x211e1f,null));};exports[_0x8b02('0x58')]=function(_0x7e9ebf,_0x2071a8,_0x3a827b){var _0x976d24={};var _0x9c6fe1={};var _0x32a5a8;var _0x46bd44;return db[_0x8b02('0x35')][_0x8b02('0x56')]({'where':{'id':_0x7e9ebf[_0x8b02('0x4d')]['id']}})[_0x8b02('0x1d')](handleEntityNotFound(_0x2071a8,null))[_0x8b02('0x1d')](function(_0x1beed5){if(_0x1beed5){_0x32a5a8=_0x1beed5;_0x9c6fe1['model']=_[_0x8b02('0x3b')](db[_0x8b02('0x57')]['rawAttributes']);_0x9c6fe1[_0x8b02('0x3c')]=_[_0x8b02('0x3b')](_0x7e9ebf[_0x8b02('0x3c')]);_0x9c6fe1['filters']=_[_0x8b02('0x3e')](_0x9c6fe1['model'],_0x9c6fe1[_0x8b02('0x3c')]);_0x976d24['attributes']=_[_0x8b02('0x3e')](_0x9c6fe1[_0x8b02('0x3a')],qs[_0x8b02('0x3f')](_0x7e9ebf[_0x8b02('0x3c')][_0x8b02('0x3f')]));_0x976d24[_0x8b02('0x40')]=_0x976d24[_0x8b02('0x40')][_0x8b02('0x41')]?_0x976d24['attributes']:_0x9c6fe1[_0x8b02('0x3a')];_0x976d24[_0x8b02('0x44')]=qs['sort'](_0x7e9ebf['query'][_0x8b02('0x45')]);_0x976d24[_0x8b02('0x46')]=qs['filters'](_[_0x8b02('0x47')](_0x7e9ebf['query'],_0x9c6fe1[_0x8b02('0x3d')]));if(_0x7e9ebf[_0x8b02('0x3c')][_0x8b02('0x48')]){_0x976d24[_0x8b02('0x46')]=_['merge'](_0x976d24[_0x8b02('0x46')],{'$or':_[_0x8b02('0x34')](_0x976d24[_0x8b02('0x40')],function(_0x19bf69){var _0x22d0c3={};_0x22d0c3[_0x19bf69]={'$like':'%'+_0x7e9ebf['query'][_0x8b02('0x48')]+'%'};return _0x22d0c3;})});}_0x976d24=_['merge']({},_0x976d24,_0x7e9ebf[_0x8b02('0x4b')]);return _0x32a5a8[_0x8b02('0x58')](_0x976d24);}})[_0x8b02('0x1d')](function(_0x23d38c){if(_0x23d38c){_0x46bd44=_0x23d38c[_0x8b02('0x41')];if(!_0x7e9ebf['query'][_0x8b02('0x54')](_0x8b02('0x42'))){_0x976d24[_0x8b02('0x43')]=qs[_0x8b02('0x43')](_0x7e9ebf[_0x8b02('0x3c')][_0x8b02('0x43')]);_0x976d24['offset']=qs[_0x8b02('0x2b')](_0x7e9ebf[_0x8b02('0x3c')]['offset']);}return _0x32a5a8[_0x8b02('0x58')](_0x976d24);}})[_0x8b02('0x1d')](function(_0x389f11){if(_0x389f11){return _0x389f11?{'count':_0x46bd44,'rows':_0x389f11}:null;}})['then'](respondWithResult(_0x2071a8,null))[_0x8b02('0x26')](handleError(_0x2071a8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 2754461..2be8026 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 _0xa374=['bluebird','request-promise','path','rimraf','../../config/environment','exports','define','int_servicenow_configurations','util','../../config/logger','api','moment'];(function(_0x47cf78,_0x223bbf){var _0x4ef223=function(_0x11c3f9){while(--_0x11c3f9){_0x47cf78['push'](_0x47cf78['shift']());}};_0x4ef223(++_0x223bbf);}(_0xa374,0x188));var _0x4a37=function(_0x17df5f,_0x37fe52){_0x17df5f=_0x17df5f-0x0;var _0x246579=_0xa374[_0x17df5f];return _0x246579;};'use strict';var _=require('lodash');var util=require(_0x4a37('0x0'));var logger=require(_0x4a37('0x1'))(_0x4a37('0x2'));var moment=require(_0x4a37('0x3'));var BPromise=require(_0x4a37('0x4'));var rp=require(_0x4a37('0x5'));var fs=require('fs');var path=require(_0x4a37('0x6'));var rimraf=require(_0x4a37('0x7'));var config=require(_0x4a37('0x8'));var attributes=require('./intServicenowConfiguration.attributes');module[_0x4a37('0x9')]=function(_0x1654e8,_0x5a5e16){return _0x1654e8[_0x4a37('0xa')]('ServicenowConfiguration',attributes,{'tableName':_0x4a37('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadb9=['moment','path','../../config/environment','./intServicenowConfiguration.attributes','exports','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api'];(function(_0x34aea4,_0x3c0bbc){var _0x367cf0=function(_0x30d1b8){while(--_0x30d1b8){_0x34aea4['push'](_0x34aea4['shift']());}};_0x367cf0(++_0x3c0bbc);}(_0xadb9,0x75));var _0x9adb=function(_0x182e09,_0x5cb1f1){_0x182e09=_0x182e09-0x0;var _0x5bb657=_0xadb9[_0x182e09];return _0x5bb657;};'use strict';var _=require(_0x9adb('0x0'));var util=require('util');var logger=require(_0x9adb('0x1'))(_0x9adb('0x2'));var moment=require(_0x9adb('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x9adb('0x4'));var rimraf=require('rimraf');var config=require(_0x9adb('0x5'));var attributes=require(_0x9adb('0x6'));module[_0x9adb('0x7')]=function(_0x130ea4,_0x55ec4d){return _0x130ea4['define'](_0x9adb('0x8'),attributes,{'tableName':_0x9adb('0x9'),'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 fd5ad12..567ccb8 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 _0x4980=['ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info'];(function(_0x54b396,_0x3612ee){var _0x532e6d=function(_0xc8286e){while(--_0xc8286e){_0x54b396['push'](_0x54b396['shift']());}};_0x532e6d(++_0x3612ee);}(_0x4980,0x168));var _0x0498=function(_0x345ac9,_0x575f02){_0x345ac9=_0x345ac9-0x0;var _0x447307=_0x4980[_0x345ac9];return _0x447307;};'use strict';var _=require(_0x0498('0x0'));var util=require(_0x0498('0x1'));var moment=require(_0x0498('0x2'));var BPromise=require(_0x0498('0x3'));var rs=require(_0x0498('0x4'));var fs=require('fs');var Redis=require(_0x0498('0x5'));var db=require(_0x0498('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0498('0x7'))(_0x0498('0x8'));var config=require(_0x0498('0x9'));var jayson=require(_0x0498('0xa'));var client=jayson[_0x0498('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe1c665,_0x4c62a9,_0x387e0d){return new BPromise(function(_0x3e84e4,_0x3128ee){return client[_0x0498('0xc')](_0xe1c665,_0x387e0d)[_0x0498('0xd')](function(_0x584307){logger[_0x0498('0xe')](_0x0498('0xf'),_0x4c62a9,_0x0498('0x10'));logger[_0x0498('0x11')](_0x0498('0x12'),_0x4c62a9,_0x0498('0x10'),JSON[_0x0498('0x13')](_0x584307));if(_0x584307[_0x0498('0x14')]){if(_0x584307[_0x0498('0x14')][_0x0498('0x15')]===0x1f4){logger['error'](_0x0498('0xf'),_0x4c62a9,_0x584307[_0x0498('0x14')]['message']);return _0x3128ee(_0x584307[_0x0498('0x14')]['message']);}logger['error'](_0x0498('0xf'),_0x4c62a9,_0x584307[_0x0498('0x14')]['message']);return _0x3e84e4(_0x584307[_0x0498('0x14')][_0x0498('0x16')]);}else{logger[_0x0498('0xe')](_0x0498('0xf'),_0x4c62a9,_0x0498('0x10'));_0x3e84e4(_0x584307[_0x0498('0x17')][_0x0498('0x16')]);}})[_0x0498('0x18')](function(_0x5d8b2b){logger['error'](_0x0498('0xf'),_0x4c62a9,_0x5d8b2b);_0x3128ee(_0x5d8b2b);});});} \ No newline at end of file +var _0x7581=['message','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x485e51,_0x421c2d){var _0x395298=function(_0x3eb352){while(--_0x3eb352){_0x485e51['push'](_0x485e51['shift']());}};_0x395298(++_0x421c2d);}(_0x7581,0xfe));var _0x1758=function(_0x3d5d31,_0x56c82b){_0x3d5d31=_0x3d5d31-0x0;var _0x4a1392=_0x7581[_0x3d5d31];return _0x4a1392;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x1758('0x0'));var rs=require(_0x1758('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1758('0x2'))['db'];var utils=require(_0x1758('0x3'));var logger=require(_0x1758('0x4'))('rpc');var config=require(_0x1758('0x5'));var jayson=require(_0x1758('0x6'));var client=jayson[_0x1758('0x7')][_0x1758('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2be9cc,_0x15a045,_0x30ea15){return new BPromise(function(_0x311c7a,_0x22b7e6){return client['request'](_0x2be9cc,_0x30ea15)['then'](function(_0x5d6dc8){logger[_0x1758('0x9')](_0x1758('0xa'),_0x15a045,_0x1758('0xb'));logger[_0x1758('0xc')](_0x1758('0xd'),_0x15a045,_0x1758('0xb'),JSON[_0x1758('0xe')](_0x5d6dc8));if(_0x5d6dc8[_0x1758('0xf')]){if(_0x5d6dc8[_0x1758('0xf')]['code']===0x1f4){logger[_0x1758('0xf')](_0x1758('0xa'),_0x15a045,_0x5d6dc8['error'][_0x1758('0x10')]);return _0x22b7e6(_0x5d6dc8['error'][_0x1758('0x10')]);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x15a045,_0x5d6dc8[_0x1758('0xf')][_0x1758('0x10')]);return _0x311c7a(_0x5d6dc8['error']['message']);}else{logger[_0x1758('0x9')](_0x1758('0xa'),_0x15a045,_0x1758('0xb'));_0x311c7a(_0x5d6dc8['result'][_0x1758('0x10')]);}})[_0x1758('0x11')](function(_0x4d34fc){logger[_0x1758('0xf')]('ServicenowConfiguration,\x20%s,\x20%s',_0x15a045,_0x4d34fc);_0x22b7e6(_0x4d34fc);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 024b569..3ae20a7 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 _0x7c3a=['./intServicenowField.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router'];(function(_0x263f58,_0x4a4ced){var _0x251c40=function(_0x2f1cc9){while(--_0x2f1cc9){_0x263f58['push'](_0x263f58['shift']());}};_0x251c40(++_0x4a4ced);}(_0x7c3a,0xd3));var _0xa7c3=function(_0x9d1e6b,_0x3bdc22){_0x9d1e6b=_0x9d1e6b-0x0;var _0x2b3070=_0x7c3a[_0x9d1e6b];return _0x2b3070;};'use strict';var multer=require(_0xa7c3('0x0'));var util=require('util');var path=require(_0xa7c3('0x1'));var timeout=require(_0xa7c3('0x2'));var express=require(_0xa7c3('0x3'));var router=express[_0xa7c3('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xa7c3('0x5'));router[_0xa7c3('0x6')]('/',auth[_0xa7c3('0x7')](),controller[_0xa7c3('0x8')]);router['get'](_0xa7c3('0x9'),auth['isAuthenticated'](),controller[_0xa7c3('0xa')]);router[_0xa7c3('0xb')]('/',auth['isAuthenticated'](),controller[_0xa7c3('0xc')]);router[_0xa7c3('0xd')]('/:id',auth[_0xa7c3('0x7')](),controller[_0xa7c3('0xe')]);router[_0xa7c3('0xf')](_0xa7c3('0x9'),auth['isAuthenticated'](),controller[_0xa7c3('0x10')]);module[_0xa7c3('0x11')]=router; \ No newline at end of file +var _0xbb30=['/:id','show','post','create','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intServicenowField.controller','get','isAuthenticated','index'];(function(_0x109407,_0x2d87fb){var _0x3ec159=function(_0x99aa19){while(--_0x99aa19){_0x109407['push'](_0x109407['shift']());}};_0x3ec159(++_0x2d87fb);}(_0xbb30,0x1a9));var _0x0bb3=function(_0x302acd,_0x10b83f){_0x302acd=_0x302acd-0x0;var _0x4df670=_0xbb30[_0x302acd];return _0x4df670;};'use strict';var multer=require(_0x0bb3('0x0'));var util=require('util');var path=require(_0x0bb3('0x1'));var timeout=require(_0x0bb3('0x2'));var express=require(_0x0bb3('0x3'));var router=express[_0x0bb3('0x4')]();var auth=require(_0x0bb3('0x5'));var interaction=require(_0x0bb3('0x6'));var config=require(_0x0bb3('0x7'));var controller=require(_0x0bb3('0x8'));router[_0x0bb3('0x9')]('/',auth[_0x0bb3('0xa')](),controller[_0x0bb3('0xb')]);router[_0x0bb3('0x9')](_0x0bb3('0xc'),auth['isAuthenticated'](),controller[_0x0bb3('0xd')]);router[_0x0bb3('0xe')]('/',auth[_0x0bb3('0xa')](),controller[_0x0bb3('0xf')]);router['put'](_0x0bb3('0xc'),auth[_0x0bb3('0xa')](),controller[_0x0bb3('0x10')]);router['delete'](_0x0bb3('0xc'),auth[_0x0bb3('0xa')](),controller[_0x0bb3('0x11')]);module[_0x0bb3('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index dafb49b..eb9c3fe 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 _0x1961=['ENUM','variable','customVariable','keyValue','string','STRING','BOOLEAN','sequelize','exports'];(function(_0x4a53d,_0x58a95e){var _0x27410e=function(_0x38fc90){while(--_0x38fc90){_0x4a53d['push'](_0x4a53d['shift']());}};_0x27410e(++_0x58a95e);}(_0x1961,0x10c));var _0x1196=function(_0x142128,_0x5d2200){_0x142128=_0x142128-0x0;var _0x706021=_0x1961[_0x142128];return _0x706021;};'use strict';var Sequelize=require(_0x1196('0x0'));module[_0x1196('0x1')]={'type':{'type':Sequelize[_0x1196('0x2')]('string',_0x1196('0x3'),_0x1196('0x4'),_0x1196('0x5')),'defaultValue':_0x1196('0x6')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1196('0x7')]},'keyType':{'type':Sequelize[_0x1196('0x2')]('string',_0x1196('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x1196('0x7')]},'customField':{'type':Sequelize[_0x1196('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1196('0x7')]}}; \ No newline at end of file +var _0x0bc1=['ENUM','string','keyValue','STRING','variable','customVariable','BOOLEAN','sequelize','exports'];(function(_0x232bbd,_0x4f6543){var _0x35d9c2=function(_0x255569){while(--_0x255569){_0x232bbd['push'](_0x232bbd['shift']());}};_0x35d9c2(++_0x4f6543);}(_0x0bc1,0x1ae));var _0x10bc=function(_0x5eb62d,_0x491c4e){_0x5eb62d=_0x5eb62d-0x0;var _0x5dc355=_0x0bc1[_0x5eb62d];return _0x5dc355;};'use strict';var Sequelize=require(_0x10bc('0x0'));module[_0x10bc('0x1')]={'type':{'type':Sequelize[_0x10bc('0x2')](_0x10bc('0x3'),'variable','customVariable',_0x10bc('0x4')),'defaultValue':_0x10bc('0x3')},'content':{'type':Sequelize[_0x10bc('0x5')]},'key':{'type':Sequelize[_0x10bc('0x5')]},'keyType':{'type':Sequelize[_0x10bc('0x2')]('string',_0x10bc('0x6'),_0x10bc('0x7'))},'keyContent':{'type':Sequelize[_0x10bc('0x5')]},'idField':{'type':Sequelize[_0x10bc('0x5')]},'nameField':{'type':Sequelize[_0x10bc('0x5')]},'customField':{'type':Sequelize[_0x10bc('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x10bc('0x5')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index 190df78..a6a8054 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 _0x11f4=['send','index','map','rawAttributes','type','key','model','query','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','VIRTUAL','filter','merge','ServicenowField','includeAll','include','rows','show','params','intersection','length','options','find','create','body','catch','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','stack','name'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x11f4,0x152));var _0x411f=function(_0xc96ce9,_0x39dab2){_0xc96ce9=_0xc96ce9-0x0;var _0x4f8966=_0x11f4[_0xc96ce9];return _0x4f8966;};'use strict';var pdf=require(_0x411f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x411f('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x411f('0x2'));var rp=require(_0x411f('0x3'));var moment=require(_0x411f('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x411f('0x5'));var util=require(_0x411f('0x6'));var path=require(_0x411f('0x7'));var sox=require(_0x411f('0x8'));var csv=require(_0x411f('0x9'));var ejs=require(_0x411f('0xa'));var fs=require('fs');var _=require(_0x411f('0xb'));var squel=require(_0x411f('0xc'));var crypto=require(_0x411f('0xd'));var jsforce=require(_0x411f('0xe'));var deskjs=require(_0x411f('0xf'));var toCsv=require(_0x411f('0x9'));var querystring=require(_0x411f('0x10'));var Papa=require(_0x411f('0x11'));var Redis=require(_0x411f('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x411f('0x13'));var as=require(_0x411f('0x14'));var hardwareService=require(_0x411f('0x15'));var logger=require(_0x411f('0x16'))(_0x411f('0x17'));var utils=require('../../config/utils');var config=require(_0x411f('0x18'));var db=require(_0x411f('0x19'))['db'];function respondWithStatusCode(_0x2167be,_0x42517b){_0x42517b=_0x42517b||0xcc;return function(_0x2f27e7){if(_0x2f27e7){return _0x2167be[_0x411f('0x1a')](_0x42517b);}return _0x2167be[_0x411f('0x1b')](_0x42517b)[_0x411f('0x1c')]();};}function respondWithResult(_0x5e5a73,_0xd593da){_0xd593da=_0xd593da||0xc8;return function(_0x45a8cf){if(_0x45a8cf){return _0x5e5a73[_0x411f('0x1b')](_0xd593da)[_0x411f('0x1d')](_0x45a8cf);}};}function respondWithFilteredResult(_0x282d15,_0x4cc618){return function(_0x379548){if(_0x379548){var _0x28fa0e=_0x379548[_0x411f('0x1e')],_0x3e2357=_0x4cc618[_0x411f('0x1f')],_0x2c196b=_0x4cc618['offset']+_0x4cc618['limit'],_0x19faab;if(_0x2c196b>=_0x28fa0e){_0x2c196b=_0x28fa0e;_0x19faab=0xc8;}else{_0x19faab=0xce;}_0x282d15['status'](_0x19faab);return _0x282d15['set'](_0x411f('0x20'),_0x3e2357+'-'+_0x2c196b+'/'+_0x28fa0e)['json'](_0x379548);}return null;};}function patchUpdates(_0x1c1226){return function(_0xd12e09){try{jsonpatch[_0x411f('0x21')](_0xd12e09,_0x1c1226,!![]);}catch(_0x4a5c71){return BPromise[_0x411f('0x22')](_0x4a5c71);}return _0xd12e09[_0x411f('0x23')]();};}function saveUpdates(_0x4b03c4,_0x54c4e5){return function(_0x17295b){if(_0x17295b){return _0x17295b[_0x411f('0x24')](_0x4b03c4)[_0x411f('0x25')](function(_0x238771){return _0x238771;});}return null;};}function removeEntity(_0xa2fb34,_0x516603){return function(_0x4cf890){if(_0x4cf890){return _0x4cf890[_0x411f('0x26')]()[_0x411f('0x25')](function(){_0xa2fb34[_0x411f('0x1b')](0xcc)[_0x411f('0x1c')]();});}};}function handleEntityNotFound(_0x31d85f,_0x28d912){return function(_0x196d0a){if(!_0x196d0a){_0x31d85f[_0x411f('0x1a')](0x194);}return _0x196d0a;};}function handleError(_0x272871,_0x4dbdd5){_0x4dbdd5=_0x4dbdd5||0x1f4;return function(_0x54604c){logger[_0x411f('0x27')](_0x54604c[_0x411f('0x28')]);if(_0x54604c[_0x411f('0x29')]){delete _0x54604c[_0x411f('0x29')];}_0x272871[_0x411f('0x1b')](_0x4dbdd5)[_0x411f('0x2a')](_0x54604c);};}exports[_0x411f('0x2b')]=function(_0x1c03e2,_0x45ab35){var _0x3d8233={},_0x29660e={},_0x1749da={'count':0x0,'rows':[]};var _0x487fc7=_[_0x411f('0x2c')](db['ServicenowField'][_0x411f('0x2d')],function(_0x2bf37d){return{'name':_0x2bf37d['fieldName'],'type':_0x2bf37d[_0x411f('0x2e')][_0x411f('0x2f')]};});_0x29660e[_0x411f('0x30')]=_['map'](_0x487fc7,_0x411f('0x29'));_0x29660e[_0x411f('0x31')]=_['keys'](_0x1c03e2[_0x411f('0x31')]);_0x29660e['filters']=_['intersection'](_0x29660e[_0x411f('0x30')],_0x29660e[_0x411f('0x31')]);_0x3d8233[_0x411f('0x32')]=_['intersection'](_0x29660e[_0x411f('0x30')],qs['fields'](_0x1c03e2[_0x411f('0x31')][_0x411f('0x33')]));_0x3d8233[_0x411f('0x32')]=_0x3d8233[_0x411f('0x32')]['length']?_0x3d8233[_0x411f('0x32')]:_0x29660e['model'];if(!_0x1c03e2[_0x411f('0x31')][_0x411f('0x34')](_0x411f('0x35'))){_0x3d8233[_0x411f('0x36')]=qs['limit'](_0x1c03e2[_0x411f('0x31')]['limit']);_0x3d8233[_0x411f('0x1f')]=qs['offset'](_0x1c03e2['query'][_0x411f('0x1f')]);}_0x3d8233[_0x411f('0x37')]=qs[_0x411f('0x38')](_0x1c03e2['query']['sort']);_0x3d8233[_0x411f('0x39')]=qs[_0x411f('0x3a')](_[_0x411f('0x3b')](_0x1c03e2[_0x411f('0x31')],_0x29660e[_0x411f('0x3a')]));if(_0x1c03e2[_0x411f('0x31')]['filter']){_0x3d8233[_0x411f('0x39')]=_['merge'](_0x3d8233[_0x411f('0x39')],{'$or':_[_0x411f('0x2c')](_0x487fc7,function(_0xfa4f1e){if(_0xfa4f1e[_0x411f('0x2e')]!==_0x411f('0x3c')){var _0x264e5b={};_0x264e5b[_0xfa4f1e[_0x411f('0x29')]]={'$like':'%'+_0x1c03e2[_0x411f('0x31')][_0x411f('0x3d')]+'%'};return _0x264e5b;}})});}_0x3d8233=_[_0x411f('0x3e')]({},_0x3d8233,_0x1c03e2['options']);var _0x1fd994={'where':_0x3d8233[_0x411f('0x39')]};return db[_0x411f('0x3f')][_0x411f('0x1e')](_0x1fd994)['then'](function(_0x352c8d){_0x1749da[_0x411f('0x1e')]=_0x352c8d;if(_0x1c03e2[_0x411f('0x31')][_0x411f('0x40')]){_0x3d8233[_0x411f('0x41')]=[{'all':!![]}];}return db[_0x411f('0x3f')]['findAll'](_0x3d8233);})[_0x411f('0x25')](function(_0x47193c){_0x1749da[_0x411f('0x42')]=_0x47193c;return _0x1749da;})[_0x411f('0x25')](respondWithFilteredResult(_0x45ab35,_0x3d8233))['catch'](handleError(_0x45ab35,null));};exports[_0x411f('0x43')]=function(_0x35f1e4,_0x8b8b09){var _0x1d1871={'raw':!![],'where':{'id':_0x35f1e4[_0x411f('0x44')]['id']}},_0x33d95f={};_0x33d95f[_0x411f('0x30')]=_['keys'](db[_0x411f('0x3f')][_0x411f('0x2d')]);_0x33d95f[_0x411f('0x31')]=_['keys'](_0x35f1e4[_0x411f('0x31')]);_0x33d95f['filters']=_[_0x411f('0x45')](_0x33d95f[_0x411f('0x30')],_0x33d95f['query']);_0x1d1871[_0x411f('0x32')]=_[_0x411f('0x45')](_0x33d95f['model'],qs[_0x411f('0x33')](_0x35f1e4['query']['fields']));_0x1d1871[_0x411f('0x32')]=_0x1d1871[_0x411f('0x32')][_0x411f('0x46')]?_0x1d1871[_0x411f('0x32')]:_0x33d95f[_0x411f('0x30')];if(_0x35f1e4[_0x411f('0x31')][_0x411f('0x40')]){_0x1d1871[_0x411f('0x41')]=[{'all':!![]}];}_0x1d1871=_[_0x411f('0x3e')]({},_0x1d1871,_0x35f1e4[_0x411f('0x47')]);return db[_0x411f('0x3f')][_0x411f('0x48')](_0x1d1871)[_0x411f('0x25')](handleEntityNotFound(_0x8b8b09,null))[_0x411f('0x25')](respondWithResult(_0x8b8b09,null))['catch'](handleError(_0x8b8b09,null));};exports[_0x411f('0x49')]=function(_0x38eb64,_0x361b32){return db[_0x411f('0x3f')][_0x411f('0x49')](_0x38eb64[_0x411f('0x4a')],{})[_0x411f('0x25')](respondWithResult(_0x361b32,0xc9))['catch'](handleError(_0x361b32,null));};exports[_0x411f('0x24')]=function(_0x23b3de,_0x1c9f1a){if(_0x23b3de[_0x411f('0x4a')]['id']){delete _0x23b3de[_0x411f('0x4a')]['id'];}return db[_0x411f('0x3f')][_0x411f('0x48')]({'where':{'id':_0x23b3de[_0x411f('0x44')]['id']}})[_0x411f('0x25')](handleEntityNotFound(_0x1c9f1a,null))[_0x411f('0x25')](saveUpdates(_0x23b3de['body'],null))[_0x411f('0x25')](respondWithResult(_0x1c9f1a,null))['catch'](handleError(_0x1c9f1a,null));};exports['destroy']=function(_0x16ee7b,_0x144554){return db[_0x411f('0x3f')][_0x411f('0x48')]({'where':{'id':_0x16ee7b[_0x411f('0x44')]['id']}})[_0x411f('0x25')](handleEntityNotFound(_0x144554,null))[_0x411f('0x25')](removeEntity(_0x144554,null))[_0x411f('0x4b')](handleError(_0x144554,null));}; \ No newline at end of file +var _0x619d=['path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','count','offset','limit','set','Content-Range','json','save','update','then','destroy','sendStatus','error','name','send','index','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','merge','VIRTUAL','filter','options','ServicenowField','includeAll','include','findAll','rows','show','params','find','create','catch','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x2c19c9,_0x1e4115){var _0x143051=function(_0x90dd69){while(--_0x90dd69){_0x2c19c9['push'](_0x2c19c9['shift']());}};_0x143051(++_0x1e4115);}(_0x619d,0xd9));var _0xd619=function(_0x3c68e1,_0x20b82d){_0x3c68e1=_0x3c68e1-0x0;var _0x1fb8e1=_0x619d[_0x3c68e1];return _0x1fb8e1;};'use strict';var pdf=require(_0xd619('0x0'));var emlformat=require(_0xd619('0x1'));var rimraf=require(_0xd619('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd619('0x3'));var rp=require(_0xd619('0x4'));var moment=require(_0xd619('0x5'));var BPromise=require(_0xd619('0x6'));var Mustache=require(_0xd619('0x7'));var util=require('util');var path=require(_0xd619('0x8'));var sox=require(_0xd619('0x9'));var csv=require(_0xd619('0xa'));var ejs=require(_0xd619('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd619('0xc'));var crypto=require(_0xd619('0xd'));var jsforce=require(_0xd619('0xe'));var deskjs=require(_0xd619('0xf'));var toCsv=require(_0xd619('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd619('0x10'));var authService=require(_0xd619('0x11'));var qs=require(_0xd619('0x12'));var as=require(_0xd619('0x13'));var hardwareService=require(_0xd619('0x14'));var logger=require('../../config/logger')(_0xd619('0x15'));var utils=require(_0xd619('0x16'));var config=require(_0xd619('0x17'));var db=require(_0xd619('0x18'))['db'];function respondWithStatusCode(_0x1a1865,_0x27c82b){_0x27c82b=_0x27c82b||0xcc;return function(_0x318cec){if(_0x318cec){return _0x1a1865['sendStatus'](_0x27c82b);}return _0x1a1865['status'](_0x27c82b)['end']();};}function respondWithResult(_0x24bcba,_0x3b5d94){_0x3b5d94=_0x3b5d94||0xc8;return function(_0xdfac3a){if(_0xdfac3a){return _0x24bcba[_0xd619('0x19')](_0x3b5d94)['json'](_0xdfac3a);}};}function respondWithFilteredResult(_0x5941f7,_0x6eb077){return function(_0x12944a){if(_0x12944a){var _0x3f976b=_0x12944a[_0xd619('0x1a')],_0x5d6ace=_0x6eb077[_0xd619('0x1b')],_0x46f0c5=_0x6eb077['offset']+_0x6eb077[_0xd619('0x1c')],_0x55a41a;if(_0x46f0c5>=_0x3f976b){_0x46f0c5=_0x3f976b;_0x55a41a=0xc8;}else{_0x55a41a=0xce;}_0x5941f7[_0xd619('0x19')](_0x55a41a);return _0x5941f7[_0xd619('0x1d')](_0xd619('0x1e'),_0x5d6ace+'-'+_0x46f0c5+'/'+_0x3f976b)[_0xd619('0x1f')](_0x12944a);}return null;};}function patchUpdates(_0x4101bf){return function(_0x6fc880){try{jsonpatch['apply'](_0x6fc880,_0x4101bf,!![]);}catch(_0x3af08d){return BPromise['reject'](_0x3af08d);}return _0x6fc880[_0xd619('0x20')]();};}function saveUpdates(_0x3c3d72,_0x3afbf0){return function(_0x19f1bf){if(_0x19f1bf){return _0x19f1bf[_0xd619('0x21')](_0x3c3d72)[_0xd619('0x22')](function(_0xc3b61c){return _0xc3b61c;});}return null;};}function removeEntity(_0x2fac90,_0x122dd0){return function(_0x45ec29){if(_0x45ec29){return _0x45ec29[_0xd619('0x23')]()['then'](function(){_0x2fac90[_0xd619('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bac93,_0x441530){return function(_0x3c9e8b){if(!_0x3c9e8b){_0x3bac93[_0xd619('0x24')](0x194);}return _0x3c9e8b;};}function handleError(_0x588b1c,_0x33adec){_0x33adec=_0x33adec||0x1f4;return function(_0x7bea8e){logger[_0xd619('0x25')](_0x7bea8e['stack']);if(_0x7bea8e['name']){delete _0x7bea8e[_0xd619('0x26')];}_0x588b1c[_0xd619('0x19')](_0x33adec)[_0xd619('0x27')](_0x7bea8e);};}exports[_0xd619('0x28')]=function(_0x1dcb3d,_0x546f12){var _0x5092c4={},_0x3674d8={},_0x2f9f29={'count':0x0,'rows':[]};var _0x7bed78=_['map'](db['ServicenowField'][_0xd619('0x29')],function(_0x34f9ff){return{'name':_0x34f9ff[_0xd619('0x2a')],'type':_0x34f9ff[_0xd619('0x2b')][_0xd619('0x2c')]};});_0x3674d8[_0xd619('0x2d')]=_[_0xd619('0x2e')](_0x7bed78,_0xd619('0x26'));_0x3674d8[_0xd619('0x2f')]=_[_0xd619('0x30')](_0x1dcb3d[_0xd619('0x2f')]);_0x3674d8['filters']=_[_0xd619('0x31')](_0x3674d8[_0xd619('0x2d')],_0x3674d8[_0xd619('0x2f')]);_0x5092c4[_0xd619('0x32')]=_['intersection'](_0x3674d8[_0xd619('0x2d')],qs[_0xd619('0x33')](_0x1dcb3d['query'][_0xd619('0x33')]));_0x5092c4[_0xd619('0x32')]=_0x5092c4[_0xd619('0x32')][_0xd619('0x34')]?_0x5092c4[_0xd619('0x32')]:_0x3674d8['model'];if(!_0x1dcb3d[_0xd619('0x2f')][_0xd619('0x35')](_0xd619('0x36'))){_0x5092c4[_0xd619('0x1c')]=qs[_0xd619('0x1c')](_0x1dcb3d[_0xd619('0x2f')][_0xd619('0x1c')]);_0x5092c4['offset']=qs[_0xd619('0x1b')](_0x1dcb3d[_0xd619('0x2f')][_0xd619('0x1b')]);}_0x5092c4[_0xd619('0x37')]=qs[_0xd619('0x38')](_0x1dcb3d['query'][_0xd619('0x38')]);_0x5092c4[_0xd619('0x39')]=qs[_0xd619('0x3a')](_[_0xd619('0x3b')](_0x1dcb3d[_0xd619('0x2f')],_0x3674d8[_0xd619('0x3a')]));if(_0x1dcb3d['query']['filter']){_0x5092c4[_0xd619('0x39')]=_[_0xd619('0x3c')](_0x5092c4[_0xd619('0x39')],{'$or':_[_0xd619('0x2e')](_0x7bed78,function(_0x5d768b){if(_0x5d768b[_0xd619('0x2b')]!==_0xd619('0x3d')){var _0xb26241={};_0xb26241[_0x5d768b[_0xd619('0x26')]]={'$like':'%'+_0x1dcb3d[_0xd619('0x2f')][_0xd619('0x3e')]+'%'};return _0xb26241;}})});}_0x5092c4=_['merge']({},_0x5092c4,_0x1dcb3d[_0xd619('0x3f')]);var _0x2ebbb6={'where':_0x5092c4[_0xd619('0x39')]};return db[_0xd619('0x40')]['count'](_0x2ebbb6)[_0xd619('0x22')](function(_0x5d9c55){_0x2f9f29[_0xd619('0x1a')]=_0x5d9c55;if(_0x1dcb3d[_0xd619('0x2f')][_0xd619('0x41')]){_0x5092c4[_0xd619('0x42')]=[{'all':!![]}];}return db['ServicenowField'][_0xd619('0x43')](_0x5092c4);})[_0xd619('0x22')](function(_0x3fe3a1){_0x2f9f29[_0xd619('0x44')]=_0x3fe3a1;return _0x2f9f29;})[_0xd619('0x22')](respondWithFilteredResult(_0x546f12,_0x5092c4))['catch'](handleError(_0x546f12,null));};exports[_0xd619('0x45')]=function(_0x39e96a,_0x5273dc){var _0x1b53f1={'raw':!![],'where':{'id':_0x39e96a[_0xd619('0x46')]['id']}},_0x4ab8d3={};_0x4ab8d3[_0xd619('0x2d')]=_[_0xd619('0x30')](db['ServicenowField'][_0xd619('0x29')]);_0x4ab8d3[_0xd619('0x2f')]=_['keys'](_0x39e96a[_0xd619('0x2f')]);_0x4ab8d3['filters']=_[_0xd619('0x31')](_0x4ab8d3[_0xd619('0x2d')],_0x4ab8d3[_0xd619('0x2f')]);_0x1b53f1[_0xd619('0x32')]=_[_0xd619('0x31')](_0x4ab8d3[_0xd619('0x2d')],qs[_0xd619('0x33')](_0x39e96a[_0xd619('0x2f')][_0xd619('0x33')]));_0x1b53f1[_0xd619('0x32')]=_0x1b53f1[_0xd619('0x32')]['length']?_0x1b53f1[_0xd619('0x32')]:_0x4ab8d3[_0xd619('0x2d')];if(_0x39e96a[_0xd619('0x2f')][_0xd619('0x41')]){_0x1b53f1[_0xd619('0x42')]=[{'all':!![]}];}_0x1b53f1=_[_0xd619('0x3c')]({},_0x1b53f1,_0x39e96a[_0xd619('0x3f')]);return db[_0xd619('0x40')][_0xd619('0x47')](_0x1b53f1)[_0xd619('0x22')](handleEntityNotFound(_0x5273dc,null))['then'](respondWithResult(_0x5273dc,null))['catch'](handleError(_0x5273dc,null));};exports['create']=function(_0x436ab9,_0x4bc789){return db[_0xd619('0x40')][_0xd619('0x48')](_0x436ab9['body'],{})[_0xd619('0x22')](respondWithResult(_0x4bc789,0xc9))[_0xd619('0x49')](handleError(_0x4bc789,null));};exports[_0xd619('0x21')]=function(_0x5715fe,_0x3c4f39){if(_0x5715fe[_0xd619('0x4a')]['id']){delete _0x5715fe[_0xd619('0x4a')]['id'];}return db['ServicenowField'][_0xd619('0x47')]({'where':{'id':_0x5715fe[_0xd619('0x46')]['id']}})[_0xd619('0x22')](handleEntityNotFound(_0x3c4f39,null))[_0xd619('0x22')](saveUpdates(_0x5715fe[_0xd619('0x4a')],null))['then'](respondWithResult(_0x3c4f39,null))[_0xd619('0x49')](handleError(_0x3c4f39,null));};exports[_0xd619('0x23')]=function(_0x22d86c,_0x4835c8){return db[_0xd619('0x40')][_0xd619('0x47')]({'where':{'id':_0x22d86c['params']['id']}})['then'](handleEntityNotFound(_0x4835c8,null))[_0xd619('0x22')](removeEntity(_0x4835c8,null))[_0xd619('0x49')](handleError(_0x4835c8,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index 7a90d36..641108f 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 _0x448d=['util','../../config/logger','api','path','rimraf','../../config/environment','exports','ServicenowField','int_servicenow_fields','servicenow_unique_index','idField','FieldId','lodash'];(function(_0x40147a,_0x46ed8b){var _0x5b776e=function(_0x20c29c){while(--_0x20c29c){_0x40147a['push'](_0x40147a['shift']());}};_0x5b776e(++_0x46ed8b);}(_0x448d,0x1e0));var _0xd448=function(_0x560f79,_0x369339){_0x560f79=_0x560f79-0x0;var _0x119208=_0x448d[_0x560f79];return _0x119208;};'use strict';var _=require(_0xd448('0x0'));var util=require(_0xd448('0x1'));var logger=require(_0xd448('0x2'))(_0xd448('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xd448('0x4'));var rimraf=require(_0xd448('0x5'));var config=require(_0xd448('0x6'));var attributes=require('./intServicenowField.attributes');module[_0xd448('0x7')]=function(_0x3b56b1,_0x49aba2){return _0x3b56b1['define'](_0xd448('0x8'),attributes,{'tableName':_0xd448('0x9'),'paranoid':![],'indexes':[{'name':_0xd448('0xa'),'fields':[_0xd448('0xb'),_0xd448('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xca42=['bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','idField','FieldId','util','../../config/logger','api','moment'];(function(_0x115d0a,_0x1305e7){var _0xc508cf=function(_0x563bd9){while(--_0x563bd9){_0x115d0a['push'](_0x115d0a['shift']());}};_0xc508cf(++_0x1305e7);}(_0xca42,0x1e6));var _0x2ca4=function(_0x5d1344,_0x12dd2c){_0x5d1344=_0x5d1344-0x0;var _0x7fd751=_0xca42[_0x5d1344];return _0x7fd751;};'use strict';var _=require('lodash');var util=require(_0x2ca4('0x0'));var logger=require(_0x2ca4('0x1'))(_0x2ca4('0x2'));var moment=require(_0x2ca4('0x3'));var BPromise=require(_0x2ca4('0x4'));var rp=require(_0x2ca4('0x5'));var fs=require('fs');var path=require(_0x2ca4('0x6'));var rimraf=require(_0x2ca4('0x7'));var config=require(_0x2ca4('0x8'));var attributes=require(_0x2ca4('0x9'));module[_0x2ca4('0xa')]=function(_0x32f8b9,_0x4d154c){return _0x32f8b9[_0x2ca4('0xb')]('ServicenowField',attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x2ca4('0xc'),_0x2ca4('0xd')],'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 313118e..9571c25 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 _0xc421=['randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowField,\x20%s,\x20%s','debug','ServicenowField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird'];(function(_0x537197,_0x59177c){var _0x402bfa=function(_0x128c05){while(--_0x128c05){_0x537197['push'](_0x537197['shift']());}};_0x402bfa(++_0x59177c);}(_0xc421,0xbe));var _0x1c42=function(_0x355314,_0x13b5f9){_0x355314=_0x355314-0x0;var _0x77c90d=_0xc421[_0x355314];return _0x77c90d;};'use strict';var _=require('lodash');var util=require(_0x1c42('0x0'));var moment=require('moment');var BPromise=require(_0x1c42('0x1'));var rs=require(_0x1c42('0x2'));var fs=require('fs');var Redis=require(_0x1c42('0x3'));var db=require(_0x1c42('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x1c42('0x5'))(_0x1c42('0x6'));var config=require(_0x1c42('0x7'));var jayson=require(_0x1c42('0x8'));var client=jayson[_0x1c42('0x9')][_0x1c42('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x932c3c,_0x1a141b,_0x5b15a4){return new BPromise(function(_0x341335,_0x32c189){return client[_0x1c42('0xb')](_0x932c3c,_0x5b15a4)[_0x1c42('0xc')](function(_0xade10d){logger[_0x1c42('0xd')](_0x1c42('0xe'),_0x1a141b,'request\x20sent');logger[_0x1c42('0xf')](_0x1c42('0x10'),_0x1a141b,_0x1c42('0x11'),JSON[_0x1c42('0x12')](_0xade10d));if(_0xade10d[_0x1c42('0x13')]){if(_0xade10d[_0x1c42('0x13')][_0x1c42('0x14')]===0x1f4){logger[_0x1c42('0x13')](_0x1c42('0xe'),_0x1a141b,_0xade10d[_0x1c42('0x13')][_0x1c42('0x15')]);return _0x32c189(_0xade10d[_0x1c42('0x13')]['message']);}logger[_0x1c42('0x13')](_0x1c42('0xe'),_0x1a141b,_0xade10d['error'][_0x1c42('0x15')]);return _0x341335(_0xade10d['error'][_0x1c42('0x15')]);}else{logger[_0x1c42('0xd')]('ServicenowField,\x20%s,\x20%s',_0x1a141b,'request\x20sent');_0x341335(_0xade10d[_0x1c42('0x16')]['message']);}})[_0x1c42('0x17')](function(_0x3a7378){logger[_0x1c42('0x13')](_0x1c42('0xe'),_0x1a141b,_0x3a7378);_0x32c189(_0x3a7378);});});} \ No newline at end of file +var _0x0c5a=['randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','request','info','request\x20sent','stringify','error','code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c5a,0xfa));var _0xa0c5=function(_0x28ade3,_0x3849b9){_0x28ade3=_0x28ade3-0x0;var _0x20ca87=_0x0c5a[_0x28ade3];return _0x20ca87;};'use strict';var _=require(_0xa0c5('0x0'));var util=require(_0xa0c5('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0c5('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa0c5('0x3'))['db'];var utils=require(_0xa0c5('0x4'));var logger=require(_0xa0c5('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa0c5('0x6'));var client=jayson['client'][_0xa0c5('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4eb6cb,_0x2360e0,_0x592a57){return new BPromise(function(_0x5b33b6,_0x24cb4c){return client[_0xa0c5('0x8')](_0x4eb6cb,_0x592a57)['then'](function(_0x202bfe){logger[_0xa0c5('0x9')]('ServicenowField,\x20%s,\x20%s',_0x2360e0,_0xa0c5('0xa'));logger['debug']('ServicenowField,\x20%s,\x20%s,\x20%s',_0x2360e0,_0xa0c5('0xa'),JSON[_0xa0c5('0xb')](_0x202bfe));if(_0x202bfe['error']){if(_0x202bfe[_0xa0c5('0xc')][_0xa0c5('0xd')]===0x1f4){logger[_0xa0c5('0xc')](_0xa0c5('0xe'),_0x2360e0,_0x202bfe[_0xa0c5('0xc')]['message']);return _0x24cb4c(_0x202bfe[_0xa0c5('0xc')][_0xa0c5('0xf')]);}logger[_0xa0c5('0xc')]('ServicenowField,\x20%s,\x20%s',_0x2360e0,_0x202bfe[_0xa0c5('0xc')][_0xa0c5('0xf')]);return _0x5b33b6(_0x202bfe[_0xa0c5('0xc')][_0xa0c5('0xf')]);}else{logger[_0xa0c5('0x9')](_0xa0c5('0xe'),_0x2360e0,'request\x20sent');_0x5b33b6(_0x202bfe[_0xa0c5('0x10')]['message']);}})[_0xa0c5('0x11')](function(_0x401ba3){logger[_0xa0c5('0xc')]('ServicenowField,\x20%s,\x20%s',_0x2360e0,_0x401ba3);_0x24cb4c(_0x401ba3);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index ec03a23..5fdbd78 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 _0x4231=['../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','show','/:id/configurations','/:id/fields','getFields','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x39cd60,_0x37a480){var _0x344b50=function(_0x2cd2ca){while(--_0x2cd2ca){_0x39cd60['push'](_0x39cd60['shift']());}};_0x344b50(++_0x37a480);}(_0x4231,0x13e));var _0x1423=function(_0xe69bf1,_0x487cbc){_0xe69bf1=_0xe69bf1-0x0;var _0x1259d1=_0x4231[_0xe69bf1];return _0x1259d1;};'use strict';var multer=require(_0x1423('0x0'));var util=require(_0x1423('0x1'));var path=require(_0x1423('0x2'));var timeout=require(_0x1423('0x3'));var express=require(_0x1423('0x4'));var router=express['Router']();var auth=require(_0x1423('0x5'));var interaction=require(_0x1423('0x6'));var config=require('../../config/environment');var controller=require('./intSugarcrmAccount.controller');router[_0x1423('0x7')]('/',auth[_0x1423('0x8')](),controller[_0x1423('0x9')]);router[_0x1423('0x7')]('/:id',auth[_0x1423('0x8')](),controller[_0x1423('0xa')]);router[_0x1423('0x7')](_0x1423('0xb'),auth[_0x1423('0x8')](),controller['getConfigurations']);router[_0x1423('0x7')](_0x1423('0xc'),auth['isAuthenticated'](),controller[_0x1423('0xd')]);router[_0x1423('0xe')]('/',auth['isAuthenticated'](),controller[_0x1423('0xf')]);router[_0x1423('0xe')](_0x1423('0xb'),auth[_0x1423('0x8')](),controller['addConfiguration']);router[_0x1423('0x10')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1423('0x11')]('/:id',auth[_0x1423('0x8')](),controller[_0x1423('0x12')]);module['exports']=router; \ No newline at end of file +var _0xc028=['delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','/:id/configurations','getConfigurations','/:id/fields','getFields','put','/:id'];(function(_0x48b4fc,_0x4b44c9){var _0x1248a9=function(_0x33f8ab){while(--_0x33f8ab){_0x48b4fc['push'](_0x48b4fc['shift']());}};_0x1248a9(++_0x4b44c9);}(_0xc028,0x192));var _0x8c02=function(_0x479216,_0x32ed1c){_0x479216=_0x479216-0x0;var _0x5c0832=_0xc028[_0x479216];return _0x5c0832;};'use strict';var multer=require(_0x8c02('0x0'));var util=require(_0x8c02('0x1'));var path=require(_0x8c02('0x2'));var timeout=require(_0x8c02('0x3'));var express=require(_0x8c02('0x4'));var router=express[_0x8c02('0x5')]();var auth=require(_0x8c02('0x6'));var interaction=require(_0x8c02('0x7'));var config=require(_0x8c02('0x8'));var controller=require(_0x8c02('0x9'));router[_0x8c02('0xa')]('/',auth[_0x8c02('0xb')](),controller['index']);router[_0x8c02('0xa')]('/:id',auth[_0x8c02('0xb')](),controller['show']);router[_0x8c02('0xa')](_0x8c02('0xc'),auth[_0x8c02('0xb')](),controller[_0x8c02('0xd')]);router[_0x8c02('0xa')](_0x8c02('0xe'),auth[_0x8c02('0xb')](),controller[_0x8c02('0xf')]);router['post']('/',auth[_0x8c02('0xb')](),controller['create']);router['post']('/:id/configurations',auth[_0x8c02('0xb')](),controller['addConfiguration']);router[_0x8c02('0x10')](_0x8c02('0x11'),auth[_0x8c02('0xb')](),controller['update']);router[_0x8c02('0x12')](_0x8c02('0x11'),auth[_0x8c02('0xb')](),controller[_0x8c02('0x13')]);module[_0x8c02('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 13dd3c3..3a4ccd3 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 _0x6d42=['username','STRING','sequelize'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x6d42,0x1a0));var _0x26d4=function(_0x1b3925,_0xd14ff6){_0x1b3925=_0x1b3925-0x0;var _0x141e05=_0x6d42[_0x1b3925];return _0x141e05;};'use strict';var Sequelize=require(_0x26d4('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize['STRING'],'unique':_0x26d4('0x1')},'password':{'type':Sequelize[_0x26d4('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x26d4('0x2')]}}; \ No newline at end of file +var _0xd85c=['exports','STRING','username','sequelize'];(function(_0x50f392,_0x1d8441){var _0x5926f2=function(_0x17df32){while(--_0x17df32){_0x50f392['push'](_0x50f392['shift']());}};_0x5926f2(++_0x1d8441);}(_0xd85c,0x15f));var _0xcd85=function(_0x3e7b59,_0x14a4cd){_0x3e7b59=_0x3e7b59-0x0;var _0x4bd64a=_0xd85c[_0x3e7b59];return _0x4bd64a;};'use strict';var Sequelize=require(_0xcd85('0x0'));module[_0xcd85('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xcd85('0x2')]},'username':{'type':Sequelize[_0xcd85('0x2')],'unique':_0xcd85('0x3')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xcd85('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xcd85('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 9de1eab..6eda8f6 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 _0x77a2=['error','code','SugarcrmAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','end','stack','name','send','map','SugarcrmAccount','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','order','sort','filter','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','rawAttributes','fields','length','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmField','getFields','assigned_user_id','created_by','date_start','duration_hours','duration_minutes','parent_id','parent_type','parent_name','username','password','remoteUri','slice','substring','lastIndexOf','POST','format','/service/v4_1/rest.php','stringify','PLAIN','Invalid\x20Login','%s%s','get_module_fields','JSON','values','module_fields','includes','label','endsWith','value','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','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','info','request\x20sent'];(function(_0x9fb085,_0x2251a3){var _0x400c75=function(_0x1455ed){while(--_0x1455ed){_0x9fb085['push'](_0x9fb085['shift']());}};_0x400c75(++_0x2251a3);}(_0x77a2,0xdf));var _0x277a=function(_0x27a510,_0x2f5932){_0x27a510=_0x27a510-0x0;var _0x34a749=_0x77a2[_0x27a510];return _0x34a749;};'use strict';var pdf=require(_0x277a('0x0'));var emlformat=require(_0x277a('0x1'));var rimraf=require(_0x277a('0x2'));var zipdir=require(_0x277a('0x3'));var jsonpatch=require(_0x277a('0x4'));var rp=require(_0x277a('0x5'));var moment=require(_0x277a('0x6'));var BPromise=require(_0x277a('0x7'));var Mustache=require(_0x277a('0x8'));var util=require(_0x277a('0x9'));var path=require(_0x277a('0xa'));var sox=require(_0x277a('0xb'));var csv=require(_0x277a('0xc'));var ejs=require(_0x277a('0xd'));var fs=require('fs');var _=require(_0x277a('0xe'));var squel=require('squel');var crypto=require(_0x277a('0xf'));var jsforce=require(_0x277a('0x10'));var deskjs=require(_0x277a('0x11'));var toCsv=require(_0x277a('0xc'));var querystring=require(_0x277a('0x12'));var Papa=require(_0x277a('0x13'));var Redis=require('ioredis');var authService=require(_0x277a('0x14'));var qs=require(_0x277a('0x15'));var as=require(_0x277a('0x16'));var hardwareService=require(_0x277a('0x17'));var logger=require(_0x277a('0x18'))(_0x277a('0x19'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x277a('0x1a'))['db'];var integrations=require(_0x277a('0x1b'));var jayson=require(_0x277a('0x1c'));var client=jayson['client'][_0x277a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x47a334,_0x593321,_0x1da838){if(_0x1da838){var _0xaaa601=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xaaa601[_0x277a('0x1e')](_0x593321)){return _0x47a334;}else{throw new db[(_0x277a('0x1f'))][(_0x277a('0x20'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x47a334;}}function respondWithRpcPromise(_0x15a999,_0x5fb45b,_0x37445e,_0x3482de){return new BPromise(function(_0x37ac17,_0x42161c){var _0x4e8c2f=_0x3482de||client;return _0x4e8c2f['request'](_0x15a999,_0x37445e)['then'](function(_0x339b1d){logger[_0x277a('0x21')]('SugarcrmAccount,\x20%s,\x20%s',_0x5fb45b,'request\x20sent');logger['debug']('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x5fb45b,_0x277a('0x22'),JSON['stringify'](_0x339b1d));if(_0x339b1d[_0x277a('0x23')]){if(_0x339b1d[_0x277a('0x23')][_0x277a('0x24')]===0x1f4){logger['error'](_0x277a('0x25'),_0x5fb45b,_0x339b1d[_0x277a('0x23')]['message']);return _0x42161c(_0x339b1d[_0x277a('0x23')]['message']);}logger[_0x277a('0x23')](_0x277a('0x25'),_0x5fb45b,_0x339b1d[_0x277a('0x23')][_0x277a('0x26')]);return _0x37ac17(_0x339b1d[_0x277a('0x23')][_0x277a('0x26')]);}else{logger[_0x277a('0x21')](_0x277a('0x25'),_0x5fb45b,_0x277a('0x22'));_0x37ac17(_0x339b1d[_0x277a('0x27')]['message']);}})[_0x277a('0x28')](function(_0xad8ff1){logger[_0x277a('0x23')]('SugarcrmAccount,\x20%s,\x20%s',_0x5fb45b,_0xad8ff1);_0x42161c(_0xad8ff1);});});}function respondWithStatusCode(_0x1fde93,_0x437c80){_0x437c80=_0x437c80||0xcc;return function(_0x6f642){if(_0x6f642){return _0x1fde93[_0x277a('0x29')](_0x437c80);}return _0x1fde93[_0x277a('0x2a')](_0x437c80)['end']();};}function respondWithResult(_0x2fa240,_0x2e5342){_0x2e5342=_0x2e5342||0xc8;return function(_0x1e139b){if(_0x1e139b){return _0x2fa240[_0x277a('0x2a')](_0x2e5342)[_0x277a('0x2b')](_0x1e139b);}};}function respondWithFilteredResult(_0x2b1ccc,_0xad5ee1){return function(_0x414af7){if(_0x414af7){var _0xfb0a87=_0x414af7[_0x277a('0x2c')],_0x5f1e38=_0xad5ee1[_0x277a('0x2d')],_0x48b863=_0xad5ee1['offset']+_0xad5ee1[_0x277a('0x2e')],_0x567318;if(_0x48b863>=_0xfb0a87){_0x48b863=_0xfb0a87;_0x567318=0xc8;}else{_0x567318=0xce;}_0x2b1ccc['status'](_0x567318);return _0x2b1ccc[_0x277a('0x2f')](_0x277a('0x30'),_0x5f1e38+'-'+_0x48b863+'/'+_0xfb0a87)[_0x277a('0x2b')](_0x414af7);}return null;};}function patchUpdates(_0x4c71a7){return function(_0x5e09cd){try{jsonpatch[_0x277a('0x31')](_0x5e09cd,_0x4c71a7,!![]);}catch(_0x4805f5){return BPromise[_0x277a('0x32')](_0x4805f5);}return _0x5e09cd['save']();};}function saveUpdates(_0x18893a,_0x4a5599){return function(_0x3a4574){if(_0x3a4574){return _0x3a4574[_0x277a('0x33')](_0x18893a)[_0x277a('0x34')](function(_0x2a5001){return _0x2a5001;});}return null;};}function removeEntity(_0x45f40a,_0x305dc0){return function(_0x24d251){if(_0x24d251){return _0x24d251[_0x277a('0x35')]()['then'](function(){_0x45f40a[_0x277a('0x2a')](0xcc)[_0x277a('0x36')]();});}};}function handleEntityNotFound(_0x538086,_0x1c34d2){return function(_0x3fe5cd){if(!_0x3fe5cd){_0x538086['sendStatus'](0x194);}return _0x3fe5cd;};}function handleError(_0x11a5ba,_0x4b6f49){_0x4b6f49=_0x4b6f49||0x1f4;return function(_0x46f814){logger[_0x277a('0x23')](_0x46f814[_0x277a('0x37')]);if(_0x46f814[_0x277a('0x38')]){delete _0x46f814[_0x277a('0x38')];}_0x11a5ba[_0x277a('0x2a')](_0x4b6f49)[_0x277a('0x39')](_0x46f814);};}exports['index']=function(_0x154c7b,_0x59bd9f){var _0x49ce67={},_0x41598b={},_0x16314a={'count':0x0,'rows':[]};var _0x501ab8=_[_0x277a('0x3a')](db[_0x277a('0x3b')]['rawAttributes'],function(_0x5b13a4){return{'name':_0x5b13a4[_0x277a('0x3c')],'type':_0x5b13a4[_0x277a('0x3d')][_0x277a('0x3e')]};});_0x41598b[_0x277a('0x3f')]=_['map'](_0x501ab8,_0x277a('0x38'));_0x41598b[_0x277a('0x40')]=_[_0x277a('0x41')](_0x154c7b[_0x277a('0x40')]);_0x41598b[_0x277a('0x42')]=_['intersection'](_0x41598b[_0x277a('0x3f')],_0x41598b[_0x277a('0x40')]);_0x49ce67[_0x277a('0x43')]=_[_0x277a('0x44')](_0x41598b[_0x277a('0x3f')],qs['fields'](_0x154c7b[_0x277a('0x40')]['fields']));_0x49ce67[_0x277a('0x43')]=_0x49ce67[_0x277a('0x43')]['length']?_0x49ce67[_0x277a('0x43')]:_0x41598b[_0x277a('0x3f')];if(!_0x154c7b[_0x277a('0x40')][_0x277a('0x45')]('nolimit')){_0x49ce67['limit']=qs['limit'](_0x154c7b[_0x277a('0x40')][_0x277a('0x2e')]);_0x49ce67[_0x277a('0x2d')]=qs[_0x277a('0x2d')](_0x154c7b[_0x277a('0x40')]['offset']);}_0x49ce67[_0x277a('0x46')]=qs[_0x277a('0x47')](_0x154c7b[_0x277a('0x40')][_0x277a('0x47')]);_0x49ce67['where']=qs['filters'](_['pick'](_0x154c7b['query'],_0x41598b[_0x277a('0x42')]));if(_0x154c7b['query'][_0x277a('0x48')]){_0x49ce67[_0x277a('0x49')]=_['merge'](_0x49ce67[_0x277a('0x49')],{'$or':_[_0x277a('0x3a')](_0x501ab8,function(_0x1551d1){if(_0x1551d1[_0x277a('0x3d')]!==_0x277a('0x4a')){var _0x4ba3b7={};_0x4ba3b7[_0x1551d1[_0x277a('0x38')]]={'$like':'%'+_0x154c7b[_0x277a('0x40')][_0x277a('0x48')]+'%'};return _0x4ba3b7;}})});}_0x49ce67=_[_0x277a('0x4b')]({},_0x49ce67,_0x154c7b[_0x277a('0x4c')]);var _0x5407f4={'where':_0x49ce67[_0x277a('0x49')]};return db[_0x277a('0x3b')][_0x277a('0x2c')](_0x5407f4)[_0x277a('0x34')](function(_0x26285a){_0x16314a[_0x277a('0x2c')]=_0x26285a;if(_0x154c7b[_0x277a('0x40')][_0x277a('0x4d')]){_0x49ce67[_0x277a('0x4e')]=[{'all':!![]}];}return db[_0x277a('0x3b')][_0x277a('0x4f')](_0x49ce67);})[_0x277a('0x34')](function(_0x3d6fd0){_0x16314a[_0x277a('0x50')]=_0x3d6fd0;return _0x16314a;})['then'](respondWithFilteredResult(_0x59bd9f,_0x49ce67))[_0x277a('0x28')](handleError(_0x59bd9f,null));};exports['show']=function(_0x3202cc,_0x35452d){var _0x29ed0f={'raw':![],'where':{'id':_0x3202cc['params']['id']}},_0x508109={};_0x508109[_0x277a('0x3f')]=_[_0x277a('0x41')](db['SugarcrmAccount'][_0x277a('0x51')]);_0x508109[_0x277a('0x40')]=_[_0x277a('0x41')](_0x3202cc['query']);_0x508109['filters']=_[_0x277a('0x44')](_0x508109[_0x277a('0x3f')],_0x508109[_0x277a('0x40')]);_0x29ed0f['attributes']=_[_0x277a('0x44')](_0x508109[_0x277a('0x3f')],qs[_0x277a('0x52')](_0x3202cc[_0x277a('0x40')][_0x277a('0x52')]));_0x29ed0f[_0x277a('0x43')]=_0x29ed0f[_0x277a('0x43')][_0x277a('0x53')]?_0x29ed0f['attributes']:_0x508109[_0x277a('0x3f')];if(_0x3202cc[_0x277a('0x40')][_0x277a('0x4d')]){_0x29ed0f['include']=[{'all':!![]}];}_0x29ed0f=_[_0x277a('0x4b')]({},_0x29ed0f,_0x3202cc[_0x277a('0x4c')]);return db[_0x277a('0x3b')][_0x277a('0x54')](_0x29ed0f)[_0x277a('0x34')](handleEntityNotFound(_0x35452d,null))[_0x277a('0x34')](respondWithResult(_0x35452d,null))['catch'](handleError(_0x35452d,null));};exports[_0x277a('0x55')]=function(_0x2ec411,_0x3c8a26){return db[_0x277a('0x3b')][_0x277a('0x55')](_0x2ec411[_0x277a('0x56')],{})['then'](respondWithResult(_0x3c8a26,0xc9))[_0x277a('0x28')](handleError(_0x3c8a26,null));};exports[_0x277a('0x33')]=function(_0x2bff8b,_0x28f642){if(_0x2bff8b[_0x277a('0x56')]['id']){delete _0x2bff8b[_0x277a('0x56')]['id'];}return db['SugarcrmAccount'][_0x277a('0x54')]({'where':{'id':_0x2bff8b[_0x277a('0x57')]['id']}})[_0x277a('0x34')](handleEntityNotFound(_0x28f642,null))[_0x277a('0x34')](saveUpdates(_0x2bff8b[_0x277a('0x56')],null))['then'](respondWithResult(_0x28f642,null))[_0x277a('0x28')](handleError(_0x28f642,null));};exports[_0x277a('0x35')]=function(_0x3982bb,_0xd21a8e){return db[_0x277a('0x3b')][_0x277a('0x54')]({'where':{'id':_0x3982bb[_0x277a('0x57')]['id']}})['then'](handleEntityNotFound(_0xd21a8e,null))['then'](removeEntity(_0xd21a8e,null))[_0x277a('0x28')](handleError(_0xd21a8e,null));};exports[_0x277a('0x58')]=function(_0x31535b,_0x1b8ec4,_0x592372){var _0x4d430f={};var _0x4ac2cf={};var _0x15b126;var _0x2ec491;return db[_0x277a('0x3b')][_0x277a('0x59')]({'where':{'id':_0x31535b[_0x277a('0x57')]['id']}})[_0x277a('0x34')](handleEntityNotFound(_0x1b8ec4,null))['then'](function(_0x49fc9e){if(_0x49fc9e){_0x15b126=_0x49fc9e;_0x4ac2cf['model']=_[_0x277a('0x41')](db[_0x277a('0x5a')][_0x277a('0x51')]);_0x4ac2cf[_0x277a('0x40')]=_[_0x277a('0x41')](_0x31535b[_0x277a('0x40')]);_0x4ac2cf[_0x277a('0x42')]=_[_0x277a('0x44')](_0x4ac2cf[_0x277a('0x3f')],_0x4ac2cf[_0x277a('0x40')]);_0x4d430f[_0x277a('0x43')]=_['intersection'](_0x4ac2cf['model'],qs[_0x277a('0x52')](_0x31535b[_0x277a('0x40')][_0x277a('0x52')]));_0x4d430f[_0x277a('0x43')]=_0x4d430f[_0x277a('0x43')]['length']?_0x4d430f[_0x277a('0x43')]:_0x4ac2cf[_0x277a('0x3f')];_0x4d430f['order']=qs[_0x277a('0x47')](_0x31535b[_0x277a('0x40')][_0x277a('0x47')]);_0x4d430f['where']=qs[_0x277a('0x42')](_['pick'](_0x31535b[_0x277a('0x40')],_0x4ac2cf[_0x277a('0x42')]));if(_0x31535b[_0x277a('0x40')]['filter']){_0x4d430f[_0x277a('0x49')]=_['merge'](_0x4d430f[_0x277a('0x49')],{'$or':_[_0x277a('0x3a')](_0x4d430f['attributes'],function(_0xf108d8){var _0x3677e5={};_0x3677e5[_0xf108d8]={'$like':'%'+_0x31535b[_0x277a('0x40')][_0x277a('0x48')]+'%'};return _0x3677e5;})});}_0x4d430f=_[_0x277a('0x4b')]({},_0x4d430f,_0x31535b[_0x277a('0x4c')]);return _0x15b126[_0x277a('0x58')](_0x4d430f);}})[_0x277a('0x34')](function(_0x397e27){if(_0x397e27){_0x2ec491=_0x397e27[_0x277a('0x53')];if(!_0x31535b[_0x277a('0x40')][_0x277a('0x45')]('nolimit')){_0x4d430f['limit']=qs[_0x277a('0x2e')](_0x31535b[_0x277a('0x40')][_0x277a('0x2e')]);_0x4d430f[_0x277a('0x2d')]=qs[_0x277a('0x2d')](_0x31535b['query'][_0x277a('0x2d')]);}return _0x15b126['getConfigurations'](_0x4d430f);}})[_0x277a('0x34')](function(_0x44697d){if(_0x44697d){return _0x44697d?{'count':_0x2ec491,'rows':_0x44697d}:null;}})[_0x277a('0x34')](respondWithResult(_0x1b8ec4,null))[_0x277a('0x28')](handleError(_0x1b8ec4,null));};exports[_0x277a('0x5b')]=function(_0x248ce8,_0x3df003,_0x24a869){if(_0x248ce8[_0x277a('0x56')]['id']){delete _0x248ce8[_0x277a('0x56')]['id'];}return db[_0x277a('0x3b')][_0x277a('0x59')]({'where':{'id':_0x248ce8[_0x277a('0x57')]['id']}})[_0x277a('0x34')](handleEntityNotFound(_0x3df003,null))['then'](function(_0x42278f){if(_0x42278f){_0x248ce8['body'][_0x277a('0x5c')]=_0x42278f['id'];_0x248ce8[_0x277a('0x56')][_0x277a('0x5d')]=integrations[_0x277a('0x5e')](_0x248ce8[_0x277a('0x56')][_0x277a('0x5f')],_0x248ce8[_0x277a('0x56')]['type']);_0x248ce8[_0x277a('0x56')][_0x277a('0x60')]=integrations[_0x277a('0x61')](_0x248ce8[_0x277a('0x56')][_0x277a('0x5f')],_0x248ce8['body'][_0x277a('0x3d')]);return db[_0x277a('0x5a')][_0x277a('0x55')](_0x248ce8[_0x277a('0x56')],{'include':[{'model':db[_0x277a('0x62')],'as':_0x277a('0x5d')},{'model':db[_0x277a('0x62')],'as':_0x277a('0x60')}]});}return null;})[_0x277a('0x34')](respondWithResult(_0x3df003,null))['catch'](handleError(_0x3df003,null));};exports[_0x277a('0x63')]=function(_0x2c04ff,_0x57060e,_0x50f4d1){var _0x173503='';var _0x4034a8=['id',_0x277a('0x38'),_0x277a('0x64'),_0x277a('0x65'),'description',_0x277a('0x66'),_0x277a('0x67'),_0x277a('0x68'),_0x277a('0x69'),_0x277a('0x6a'),_0x277a('0x6b'),'direction'];return db[_0x277a('0x3b')][_0x277a('0x59')]({'where':{'id':_0x2c04ff[_0x277a('0x57')]['id']},'attributes':['id',_0x277a('0x6c'),_0x277a('0x6d'),_0x277a('0x6e')]})[_0x277a('0x34')](handleEntityNotFound(_0x57060e,null))['then'](function(_0xbb6e59){if(_0xbb6e59){_0x173503=_0xbb6e59[_0x277a('0x6e')];var _0x4f31ef=_0x173503[_0x277a('0x6f')](-0x1);if(_0x4f31ef==='/'){_0x173503=_0x173503[_0x277a('0x70')](0x0,_0x173503[_0x277a('0x71')](_0x4f31ef));}return rp({'method':_0x277a('0x72'),'uri':util[_0x277a('0x73')]('%s%s',_0x173503,_0x277a('0x74')),'json':!![],'form':{'method':'login','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x277a('0x75')]({'user_auth':{'user_name':_0xbb6e59[_0x277a('0x6c')],'password':_0xbb6e59['password'],'encryption':_0x277a('0x76')},'application':'xCALLY\x20Motion\x20Integration'})}});}})['then'](function(_0x54485d){if(_0x54485d&&_0x54485d[_0x277a('0x38')]!==_0x277a('0x77')&&_0x54485d[_0x277a('0x38')]!=='Password\x20Expired'){return rp({'method':'POST','uri':util[_0x277a('0x73')](_0x277a('0x78'),_0x173503,_0x277a('0x74')),'json':!![],'form':{'method':_0x277a('0x79'),'input_type':_0x277a('0x7a'),'response_type':_0x277a('0x7a'),'rest_data':JSON[_0x277a('0x75')]({'session':_0x54485d['id'],'module_name':'Calls'})}})[_0x277a('0x34')](function(_0x40a04f){if(_0x40a04f){var _0x552e9d=_[_0x277a('0x7b')](_0x40a04f[_0x277a('0x7c')]);_['remove'](_0x552e9d,function(_0x4429e2){return _0x4034a8[_0x277a('0x7d')](_0x4429e2[_0x277a('0x38')]);});return{'count':_0x552e9d[_0x277a('0x53')],'rows':_[_0x277a('0x3a')](_0x552e9d,function(_0x474d7a){return{'id':_0x474d7a[_0x277a('0x38')],'name':_0x474d7a[_0x277a('0x7e')],'custom':_[_0x277a('0x7f')](_0x474d7a['name'],'_c')?!![]:![],'options':_0x474d7a[_0x277a('0x4c')]?_[_0x277a('0x3a')](_['values'](_0x474d7a[_0x277a('0x4c')]),function(_0x51e4bb){return{'name':_0x51e4bb[_0x277a('0x80')],'value':_0x51e4bb['name']};}):[]};})};}})[_0x277a('0x34')](respondWithResult(_0x57060e,null))[_0x277a('0x28')](function(_0x5c8675){var _0x1d3b8d=_0x2c04ff[_0x277a('0x40')][_0x277a('0x1e')]?0x1f4:_0x5c8675['statusCode']||0x1f4;logger[_0x277a('0x23')]('getFields,\x20%s,\x20%s,\x20%s',_0x277a('0x63'),_0x1d3b8d,JSON[_0x277a('0x75')](_0x5c8675));delete _0x5c8675[_0x277a('0x38')];if(_0x1d3b8d===0x191){_0x1d3b8d=0x190;}_0x57060e[_0x277a('0x2a')](_0x1d3b8d)[_0x277a('0x39')](_0x2c04ff[_0x277a('0x40')][_0x277a('0x1e')]?{'message':'Wrong\x20credentials','statusCode':_0x5c8675['statusCode']}:_0x5c8675);});}else{var _0x1e3cf7=0x1f4;_0x57060e[_0x277a('0x2a')](_0x1e3cf7)[_0x277a('0x39')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0x0e39=['name','index','SugarcrmAccount','rawAttributes','type','key','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','count','include','findAll','rows','length','includeAll','options','find','create','body','params','getConfigurations','findOne','SugarcrmConfiguration','AccountId','channel','Descriptions','Subjects','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','duration_minutes','parent_id','parent_name','direction','username','password','remoteUri','slice','substring','format','/service/v4_1/rest.php','JSON','stringify','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','%s%s','get_module_fields','Calls','values','module_fields','remove','label','endsWith','value','test','statusCode','send','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','mustache','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x0e39,0x1c8));var _0x90e3=function(_0x17fea7,_0x102927){_0x17fea7=_0x17fea7-0x0;var _0x3150c3=_0x0e39[_0x17fea7];return _0x3150c3;};'use strict';var pdf=require(_0x90e3('0x0'));var emlformat=require(_0x90e3('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x90e3('0x2'));var jsonpatch=require(_0x90e3('0x3'));var rp=require(_0x90e3('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x90e3('0x5'));var util=require('util');var path=require(_0x90e3('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x90e3('0x7'));var fs=require('fs');var _=require(_0x90e3('0x8'));var squel=require(_0x90e3('0x9'));var crypto=require(_0x90e3('0xa'));var jsforce=require(_0x90e3('0xb'));var deskjs=require(_0x90e3('0xc'));var toCsv=require(_0x90e3('0xd'));var querystring=require(_0x90e3('0xe'));var Papa=require('papaparse');var Redis=require(_0x90e3('0xf'));var authService=require(_0x90e3('0x10'));var qs=require(_0x90e3('0x11'));var as=require(_0x90e3('0x12'));var hardwareService=require(_0x90e3('0x13'));var logger=require('../../config/logger')(_0x90e3('0x14'));var utils=require(_0x90e3('0x15'));var config=require('../../config/environment');var db=require(_0x90e3('0x16'))['db'];var integrations=require(_0x90e3('0x17'));var jayson=require(_0x90e3('0x18'));var client=jayson[_0x90e3('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x10a5ce,_0x2ee173,_0x539e91){if(_0x539e91){var _0x1bf3e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1bf3e8['test'](_0x2ee173)){return _0x10a5ce;}else{throw new db[(_0x90e3('0x1a'))]['ValidationError'](_0x90e3('0x1b'));}}else{return _0x10a5ce;}}function respondWithRpcPromise(_0x1ef054,_0x5e8f07,_0xb046d8,_0x556965){return new BPromise(function(_0x470d8e,_0x3ccb8a){var _0x50e4b7=_0x556965||client;return _0x50e4b7[_0x90e3('0x1c')](_0x1ef054,_0xb046d8)['then'](function(_0x380c52){logger['info'](_0x90e3('0x1d'),_0x5e8f07,_0x90e3('0x1e'));logger['debug'](_0x90e3('0x1f'),_0x5e8f07,_0x90e3('0x1e'),JSON['stringify'](_0x380c52));if(_0x380c52[_0x90e3('0x20')]){if(_0x380c52[_0x90e3('0x20')][_0x90e3('0x21')]===0x1f4){logger[_0x90e3('0x20')](_0x90e3('0x1d'),_0x5e8f07,_0x380c52[_0x90e3('0x20')][_0x90e3('0x22')]);return _0x3ccb8a(_0x380c52[_0x90e3('0x20')][_0x90e3('0x22')]);}logger[_0x90e3('0x20')](_0x90e3('0x1d'),_0x5e8f07,_0x380c52[_0x90e3('0x20')]['message']);return _0x470d8e(_0x380c52[_0x90e3('0x20')][_0x90e3('0x22')]);}else{logger[_0x90e3('0x23')](_0x90e3('0x1d'),_0x5e8f07,_0x90e3('0x1e'));_0x470d8e(_0x380c52[_0x90e3('0x24')]['message']);}})[_0x90e3('0x25')](function(_0xd435ee){logger[_0x90e3('0x20')]('SugarcrmAccount,\x20%s,\x20%s',_0x5e8f07,_0xd435ee);_0x3ccb8a(_0xd435ee);});});}function respondWithStatusCode(_0x6edd8c,_0x88c68){_0x88c68=_0x88c68||0xcc;return function(_0x2f1f5b){if(_0x2f1f5b){return _0x6edd8c['sendStatus'](_0x88c68);}return _0x6edd8c[_0x90e3('0x26')](_0x88c68)[_0x90e3('0x27')]();};}function respondWithResult(_0x48055d,_0x3aa29a){_0x3aa29a=_0x3aa29a||0xc8;return function(_0x5ea0f8){if(_0x5ea0f8){return _0x48055d[_0x90e3('0x26')](_0x3aa29a)[_0x90e3('0x28')](_0x5ea0f8);}};}function respondWithFilteredResult(_0x4157c3,_0x3efe88){return function(_0x330e1c){if(_0x330e1c){var _0x47da8b=_0x330e1c['count'],_0x2b0de4=_0x3efe88[_0x90e3('0x29')],_0x200f05=_0x3efe88[_0x90e3('0x29')]+_0x3efe88[_0x90e3('0x2a')],_0x24ade1;if(_0x200f05>=_0x47da8b){_0x200f05=_0x47da8b;_0x24ade1=0xc8;}else{_0x24ade1=0xce;}_0x4157c3[_0x90e3('0x26')](_0x24ade1);return _0x4157c3[_0x90e3('0x2b')](_0x90e3('0x2c'),_0x2b0de4+'-'+_0x200f05+'/'+_0x47da8b)[_0x90e3('0x28')](_0x330e1c);}return null;};}function patchUpdates(_0x258f19){return function(_0x374119){try{jsonpatch[_0x90e3('0x2d')](_0x374119,_0x258f19,!![]);}catch(_0x53b9f6){return BPromise[_0x90e3('0x2e')](_0x53b9f6);}return _0x374119[_0x90e3('0x2f')]();};}function saveUpdates(_0x1d7327,_0x519064){return function(_0x45cd60){if(_0x45cd60){return _0x45cd60[_0x90e3('0x30')](_0x1d7327)[_0x90e3('0x31')](function(_0x141762){return _0x141762;});}return null;};}function removeEntity(_0xfdf4a5,_0x4b00e9){return function(_0x414f1f){if(_0x414f1f){return _0x414f1f[_0x90e3('0x32')]()[_0x90e3('0x31')](function(){_0xfdf4a5[_0x90e3('0x26')](0xcc)['end']();});}};}function handleEntityNotFound(_0x431600,_0x46a52e){return function(_0x2d6aea){if(!_0x2d6aea){_0x431600[_0x90e3('0x33')](0x194);}return _0x2d6aea;};}function handleError(_0x597b31,_0x1fbc08){_0x1fbc08=_0x1fbc08||0x1f4;return function(_0x15a2b2){logger[_0x90e3('0x20')](_0x15a2b2['stack']);if(_0x15a2b2[_0x90e3('0x34')]){delete _0x15a2b2[_0x90e3('0x34')];}_0x597b31[_0x90e3('0x26')](_0x1fbc08)['send'](_0x15a2b2);};}exports[_0x90e3('0x35')]=function(_0x29dc15,_0x1c99db){var _0x2ec28f={},_0xd854e7={},_0xb86f98={'count':0x0,'rows':[]};var _0x4bb085=_['map'](db[_0x90e3('0x36')][_0x90e3('0x37')],function(_0x305c86){return{'name':_0x305c86['fieldName'],'type':_0x305c86[_0x90e3('0x38')][_0x90e3('0x39')]};});_0xd854e7[_0x90e3('0x3a')]=_[_0x90e3('0x3b')](_0x4bb085,_0x90e3('0x34'));_0xd854e7[_0x90e3('0x3c')]=_[_0x90e3('0x3d')](_0x29dc15[_0x90e3('0x3c')]);_0xd854e7[_0x90e3('0x3e')]=_['intersection'](_0xd854e7[_0x90e3('0x3a')],_0xd854e7[_0x90e3('0x3c')]);_0x2ec28f[_0x90e3('0x3f')]=_[_0x90e3('0x40')](_0xd854e7['model'],qs[_0x90e3('0x41')](_0x29dc15[_0x90e3('0x3c')][_0x90e3('0x41')]));_0x2ec28f[_0x90e3('0x3f')]=_0x2ec28f[_0x90e3('0x3f')]['length']?_0x2ec28f[_0x90e3('0x3f')]:_0xd854e7[_0x90e3('0x3a')];if(!_0x29dc15[_0x90e3('0x3c')][_0x90e3('0x42')](_0x90e3('0x43'))){_0x2ec28f[_0x90e3('0x2a')]=qs[_0x90e3('0x2a')](_0x29dc15[_0x90e3('0x3c')]['limit']);_0x2ec28f[_0x90e3('0x29')]=qs['offset'](_0x29dc15[_0x90e3('0x3c')]['offset']);}_0x2ec28f[_0x90e3('0x44')]=qs[_0x90e3('0x45')](_0x29dc15[_0x90e3('0x3c')]['sort']);_0x2ec28f[_0x90e3('0x46')]=qs['filters'](_[_0x90e3('0x47')](_0x29dc15[_0x90e3('0x3c')],_0xd854e7['filters']));if(_0x29dc15[_0x90e3('0x3c')][_0x90e3('0x48')]){_0x2ec28f['where']=_['merge'](_0x2ec28f[_0x90e3('0x46')],{'$or':_[_0x90e3('0x3b')](_0x4bb085,function(_0x1f2c0b){if(_0x1f2c0b['type']!==_0x90e3('0x49')){var _0xe87835={};_0xe87835[_0x1f2c0b[_0x90e3('0x34')]]={'$like':'%'+_0x29dc15['query']['filter']+'%'};return _0xe87835;}})});}_0x2ec28f=_[_0x90e3('0x4a')]({},_0x2ec28f,_0x29dc15['options']);var _0x31e0ee={'where':_0x2ec28f[_0x90e3('0x46')]};return db[_0x90e3('0x36')][_0x90e3('0x4b')](_0x31e0ee)[_0x90e3('0x31')](function(_0x46198e){_0xb86f98[_0x90e3('0x4b')]=_0x46198e;if(_0x29dc15['query']['includeAll']){_0x2ec28f[_0x90e3('0x4c')]=[{'all':!![]}];}return db[_0x90e3('0x36')][_0x90e3('0x4d')](_0x2ec28f);})['then'](function(_0x5ddf57){_0xb86f98[_0x90e3('0x4e')]=_0x5ddf57;return _0xb86f98;})['then'](respondWithFilteredResult(_0x1c99db,_0x2ec28f))[_0x90e3('0x25')](handleError(_0x1c99db,null));};exports['show']=function(_0x516ced,_0x12bd71){var _0x54b1e3={'raw':![],'where':{'id':_0x516ced['params']['id']}},_0x4f9ddb={};_0x4f9ddb[_0x90e3('0x3a')]=_[_0x90e3('0x3d')](db[_0x90e3('0x36')]['rawAttributes']);_0x4f9ddb['query']=_[_0x90e3('0x3d')](_0x516ced['query']);_0x4f9ddb['filters']=_[_0x90e3('0x40')](_0x4f9ddb[_0x90e3('0x3a')],_0x4f9ddb['query']);_0x54b1e3[_0x90e3('0x3f')]=_[_0x90e3('0x40')](_0x4f9ddb['model'],qs[_0x90e3('0x41')](_0x516ced[_0x90e3('0x3c')][_0x90e3('0x41')]));_0x54b1e3[_0x90e3('0x3f')]=_0x54b1e3['attributes'][_0x90e3('0x4f')]?_0x54b1e3[_0x90e3('0x3f')]:_0x4f9ddb[_0x90e3('0x3a')];if(_0x516ced[_0x90e3('0x3c')][_0x90e3('0x50')]){_0x54b1e3[_0x90e3('0x4c')]=[{'all':!![]}];}_0x54b1e3=_[_0x90e3('0x4a')]({},_0x54b1e3,_0x516ced[_0x90e3('0x51')]);return db['SugarcrmAccount'][_0x90e3('0x52')](_0x54b1e3)[_0x90e3('0x31')](handleEntityNotFound(_0x12bd71,null))['then'](respondWithResult(_0x12bd71,null))[_0x90e3('0x25')](handleError(_0x12bd71,null));};exports[_0x90e3('0x53')]=function(_0x138334,_0x3496e1){return db[_0x90e3('0x36')]['create'](_0x138334['body'],{})[_0x90e3('0x31')](respondWithResult(_0x3496e1,0xc9))['catch'](handleError(_0x3496e1,null));};exports['update']=function(_0x2d6ad0,_0x1f0fef){if(_0x2d6ad0['body']['id']){delete _0x2d6ad0[_0x90e3('0x54')]['id'];}return db[_0x90e3('0x36')][_0x90e3('0x52')]({'where':{'id':_0x2d6ad0[_0x90e3('0x55')]['id']}})[_0x90e3('0x31')](handleEntityNotFound(_0x1f0fef,null))[_0x90e3('0x31')](saveUpdates(_0x2d6ad0[_0x90e3('0x54')],null))[_0x90e3('0x31')](respondWithResult(_0x1f0fef,null))[_0x90e3('0x25')](handleError(_0x1f0fef,null));};exports[_0x90e3('0x32')]=function(_0x2cc2ae,_0x2d7616){return db['SugarcrmAccount'][_0x90e3('0x52')]({'where':{'id':_0x2cc2ae[_0x90e3('0x55')]['id']}})[_0x90e3('0x31')](handleEntityNotFound(_0x2d7616,null))[_0x90e3('0x31')](removeEntity(_0x2d7616,null))['catch'](handleError(_0x2d7616,null));};exports[_0x90e3('0x56')]=function(_0x7048fd,_0x1428d6,_0x31b8b6){var _0x7e7696={};var _0x548a54={};var _0x20d688;var _0x1d48a0;return db[_0x90e3('0x36')][_0x90e3('0x57')]({'where':{'id':_0x7048fd['params']['id']}})[_0x90e3('0x31')](handleEntityNotFound(_0x1428d6,null))['then'](function(_0x4224c9){if(_0x4224c9){_0x20d688=_0x4224c9;_0x548a54['model']=_[_0x90e3('0x3d')](db[_0x90e3('0x58')][_0x90e3('0x37')]);_0x548a54['query']=_['keys'](_0x7048fd[_0x90e3('0x3c')]);_0x548a54[_0x90e3('0x3e')]=_[_0x90e3('0x40')](_0x548a54['model'],_0x548a54[_0x90e3('0x3c')]);_0x7e7696['attributes']=_[_0x90e3('0x40')](_0x548a54['model'],qs[_0x90e3('0x41')](_0x7048fd['query'][_0x90e3('0x41')]));_0x7e7696[_0x90e3('0x3f')]=_0x7e7696['attributes']['length']?_0x7e7696['attributes']:_0x548a54['model'];_0x7e7696[_0x90e3('0x44')]=qs[_0x90e3('0x45')](_0x7048fd[_0x90e3('0x3c')][_0x90e3('0x45')]);_0x7e7696[_0x90e3('0x46')]=qs['filters'](_[_0x90e3('0x47')](_0x7048fd[_0x90e3('0x3c')],_0x548a54['filters']));if(_0x7048fd['query'][_0x90e3('0x48')]){_0x7e7696[_0x90e3('0x46')]=_[_0x90e3('0x4a')](_0x7e7696[_0x90e3('0x46')],{'$or':_[_0x90e3('0x3b')](_0x7e7696[_0x90e3('0x3f')],function(_0x138247){var _0x3c07e8={};_0x3c07e8[_0x138247]={'$like':'%'+_0x7048fd[_0x90e3('0x3c')][_0x90e3('0x48')]+'%'};return _0x3c07e8;})});}_0x7e7696=_[_0x90e3('0x4a')]({},_0x7e7696,_0x7048fd[_0x90e3('0x51')]);return _0x20d688[_0x90e3('0x56')](_0x7e7696);}})[_0x90e3('0x31')](function(_0x5cc7cc){if(_0x5cc7cc){_0x1d48a0=_0x5cc7cc['length'];if(!_0x7048fd[_0x90e3('0x3c')][_0x90e3('0x42')](_0x90e3('0x43'))){_0x7e7696[_0x90e3('0x2a')]=qs[_0x90e3('0x2a')](_0x7048fd[_0x90e3('0x3c')][_0x90e3('0x2a')]);_0x7e7696[_0x90e3('0x29')]=qs[_0x90e3('0x29')](_0x7048fd['query']['offset']);}return _0x20d688[_0x90e3('0x56')](_0x7e7696);}})[_0x90e3('0x31')](function(_0x1d232a){if(_0x1d232a){return _0x1d232a?{'count':_0x1d48a0,'rows':_0x1d232a}:null;}})[_0x90e3('0x31')](respondWithResult(_0x1428d6,null))['catch'](handleError(_0x1428d6,null));};exports['addConfiguration']=function(_0x11174a,_0x184cf1,_0x55e8ab){if(_0x11174a[_0x90e3('0x54')]['id']){delete _0x11174a[_0x90e3('0x54')]['id'];}return db[_0x90e3('0x36')]['findOne']({'where':{'id':_0x11174a[_0x90e3('0x55')]['id']}})[_0x90e3('0x31')](handleEntityNotFound(_0x184cf1,null))[_0x90e3('0x31')](function(_0x4e8f89){if(_0x4e8f89){_0x11174a[_0x90e3('0x54')][_0x90e3('0x59')]=_0x4e8f89['id'];_0x11174a['body']['Subjects']=integrations['getSubjects'](_0x11174a[_0x90e3('0x54')][_0x90e3('0x5a')],_0x11174a[_0x90e3('0x54')]['type']);_0x11174a['body'][_0x90e3('0x5b')]=integrations['getDescriptions'](_0x11174a[_0x90e3('0x54')]['channel'],_0x11174a[_0x90e3('0x54')][_0x90e3('0x38')]);return db['SugarcrmConfiguration'][_0x90e3('0x53')](_0x11174a[_0x90e3('0x54')],{'include':[{'model':db['SugarcrmField'],'as':_0x90e3('0x5c')},{'model':db[_0x90e3('0x5d')],'as':_0x90e3('0x5b')}]});}return null;})[_0x90e3('0x31')](respondWithResult(_0x184cf1,null))[_0x90e3('0x25')](handleError(_0x184cf1,null));};exports[_0x90e3('0x5e')]=function(_0x28fb3f,_0x458caa,_0x9b286b){var _0x41db0c='';var _0x3a2bb2=['id','name',_0x90e3('0x5f'),_0x90e3('0x60'),_0x90e3('0x61'),_0x90e3('0x62'),'duration_hours',_0x90e3('0x63'),_0x90e3('0x64'),'parent_type',_0x90e3('0x65'),_0x90e3('0x66')];return db['SugarcrmAccount']['findOne']({'where':{'id':_0x28fb3f[_0x90e3('0x55')]['id']},'attributes':['id',_0x90e3('0x67'),_0x90e3('0x68'),'remoteUri']})['then'](handleEntityNotFound(_0x458caa,null))[_0x90e3('0x31')](function(_0x1ebf6e){if(_0x1ebf6e){_0x41db0c=_0x1ebf6e[_0x90e3('0x69')];var _0x1a3637=_0x41db0c[_0x90e3('0x6a')](-0x1);if(_0x1a3637==='/'){_0x41db0c=_0x41db0c[_0x90e3('0x6b')](0x0,_0x41db0c['lastIndexOf'](_0x1a3637));}return rp({'method':'POST','uri':util[_0x90e3('0x6c')]('%s%s',_0x41db0c,_0x90e3('0x6d')),'json':!![],'form':{'method':'login','input_type':_0x90e3('0x6e'),'response_type':_0x90e3('0x6e'),'rest_data':JSON[_0x90e3('0x6f')]({'user_auth':{'user_name':_0x1ebf6e[_0x90e3('0x67')],'password':_0x1ebf6e[_0x90e3('0x68')],'encryption':'PLAIN'},'application':_0x90e3('0x70')})}});}})[_0x90e3('0x31')](function(_0x2b494e){if(_0x2b494e&&_0x2b494e[_0x90e3('0x34')]!==_0x90e3('0x71')&&_0x2b494e[_0x90e3('0x34')]!==_0x90e3('0x72')){return rp({'method':'POST','uri':util['format'](_0x90e3('0x73'),_0x41db0c,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0x90e3('0x74'),'input_type':'JSON','response_type':_0x90e3('0x6e'),'rest_data':JSON['stringify']({'session':_0x2b494e['id'],'module_name':_0x90e3('0x75')})}})['then'](function(_0x119501){if(_0x119501){var _0xe15e94=_[_0x90e3('0x76')](_0x119501[_0x90e3('0x77')]);_[_0x90e3('0x78')](_0xe15e94,function(_0x49dea3){return _0x3a2bb2['includes'](_0x49dea3['name']);});return{'count':_0xe15e94[_0x90e3('0x4f')],'rows':_[_0x90e3('0x3b')](_0xe15e94,function(_0x5e593b){return{'id':_0x5e593b['name'],'name':_0x5e593b[_0x90e3('0x79')],'custom':_[_0x90e3('0x7a')](_0x5e593b['name'],'_c')?!![]:![],'options':_0x5e593b['options']?_[_0x90e3('0x3b')](_[_0x90e3('0x76')](_0x5e593b['options']),function(_0xb3abf5){return{'name':_0xb3abf5[_0x90e3('0x7b')],'value':_0xb3abf5['name']};}):[]};})};}})[_0x90e3('0x31')](respondWithResult(_0x458caa,null))[_0x90e3('0x25')](function(_0x3d1148){var _0x1791a9=_0x28fb3f[_0x90e3('0x3c')][_0x90e3('0x7c')]?0x1f4:_0x3d1148[_0x90e3('0x7d')]||0x1f4;logger[_0x90e3('0x20')]('getFields,\x20%s,\x20%s,\x20%s',_0x90e3('0x5e'),_0x1791a9,JSON['stringify'](_0x3d1148));delete _0x3d1148['name'];if(_0x1791a9===0x191){_0x1791a9=0x190;}_0x458caa[_0x90e3('0x26')](_0x1791a9)[_0x90e3('0x7e')](_0x28fb3f['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x3d1148['statusCode']}:_0x3d1148);});}else{var _0x39c613=0x1f4;_0x458caa[_0x90e3('0x26')](_0x39c613)[_0x90e3('0x7e')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.model.js index 5c991a7..6a5b75d 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 _0x0525=['../../config/logger','moment','path','rimraf','../../config/environment','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util'];(function(_0xf5a727,_0x3b5bad){var _0x471c0=function(_0x3b2409){while(--_0x3b2409){_0xf5a727['push'](_0xf5a727['shift']());}};_0x471c0(++_0x3b5bad);}(_0x0525,0x8d));var _0x5052=function(_0x4246bd,_0xdab764){_0x4246bd=_0x4246bd-0x0;var _0x20e0b7=_0x0525[_0x4246bd];return _0x20e0b7;};'use strict';var _=require(_0x5052('0x0'));var util=require(_0x5052('0x1'));var logger=require(_0x5052('0x2'))('api');var moment=require(_0x5052('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x5052('0x4'));var rimraf=require(_0x5052('0x5'));var config=require(_0x5052('0x6'));var attributes=require('./intSugarcrmAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x5052('0x7')]=function(_0x2155d7,_0x4c682e){return _0x2155d7[_0x5052('0x8')](_0x5052('0x9'),attributes,{'tableName':_0x5052('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd22=['rimraf','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0xf535d3,_0x1cd911){var _0x431cea=function(_0x39c074){while(--_0x39c074){_0xf535d3['push'](_0xf535d3['shift']());}};_0x431cea(++_0x1cd911);}(_0xdd22,0x166));var _0x2dd2=function(_0x55a2d9,_0x27060a){_0x55a2d9=_0x55a2d9-0x0;var _0x2216be=_0xdd22[_0x55a2d9];return _0x2216be;};'use strict';var _=require('lodash');var util=require(_0x2dd2('0x0'));var logger=require(_0x2dd2('0x1'))('api');var moment=require(_0x2dd2('0x2'));var BPromise=require(_0x2dd2('0x3'));var rp=require(_0x2dd2('0x4'));var fs=require('fs');var path=require(_0x2dd2('0x5'));var rimraf=require(_0x2dd2('0x6'));var config=require('../../config/environment');var attributes=require(_0x2dd2('0x7'));var integrations=require(_0x2dd2('0x8'));module[_0x2dd2('0x9')]=function(_0x398bd5,_0x13c60c){return _0x398bd5[_0x2dd2('0xa')](_0x2dd2('0xb'),attributes,{'tableName':_0x2dd2('0xc'),'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 634768f..e3659bf 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 _0x6252=['attributes','limit','include','model','map','ShowSugarcrmAccount','stringify','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where'];(function(_0x50a0c2,_0x4befab){var _0x5ebadd=function(_0x3a3342){while(--_0x3a3342){_0x50a0c2['push'](_0x50a0c2['shift']());}};_0x5ebadd(++_0x4befab);}(_0x6252,0x1c1));var _0x2625=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0x6252[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require('lodash');var util=require(_0x2625('0x0'));var moment=require(_0x2625('0x1'));var BPromise=require(_0x2625('0x2'));var rs=require(_0x2625('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2625('0x4'))['db'];var utils=require(_0x2625('0x5'));var logger=require('../../config/logger')(_0x2625('0x6'));var config=require(_0x2625('0x7'));var jayson=require(_0x2625('0x8'));var client=jayson[_0x2625('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10745f,_0x20167d,_0x3f012f){return new BPromise(function(_0x206bbe,_0x2c6434){return client[_0x2625('0xa')](_0x10745f,_0x3f012f)[_0x2625('0xb')](function(_0x1a08dc){logger[_0x2625('0xc')](_0x2625('0xd'),_0x20167d,_0x2625('0xe'));logger[_0x2625('0xf')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x20167d,'request\x20sent',JSON['stringify'](_0x1a08dc));if(_0x1a08dc[_0x2625('0x10')]){if(_0x1a08dc[_0x2625('0x10')][_0x2625('0x11')]===0x1f4){logger['error'](_0x2625('0xd'),_0x20167d,_0x1a08dc['error']['message']);return _0x2c6434(_0x1a08dc[_0x2625('0x10')][_0x2625('0x12')]);}logger[_0x2625('0x10')](_0x2625('0xd'),_0x20167d,_0x1a08dc[_0x2625('0x10')][_0x2625('0x12')]);return _0x206bbe(_0x1a08dc[_0x2625('0x10')][_0x2625('0x12')]);}else{logger[_0x2625('0xc')](_0x2625('0xd'),_0x20167d,_0x2625('0xe'));_0x206bbe(_0x1a08dc[_0x2625('0x13')][_0x2625('0x12')]);}})[_0x2625('0x14')](function(_0x5e30d8){logger[_0x2625('0x10')](_0x2625('0xd'),_0x20167d,_0x5e30d8);_0x2c6434(_0x5e30d8);});});}exports[_0x2625('0x15')]=function(_0xb34d88){var _0x11a8d4=this;return new Promise(function(_0x323084,_0x10e3d8){return db[_0x2625('0x16')][_0x2625('0x17')]({'raw':_0xb34d88[_0x2625('0x18')]?_0xb34d88[_0x2625('0x18')][_0x2625('0x19')]===undefined?!![]:![]:!![],'where':_0xb34d88['options']?_0xb34d88[_0x2625('0x18')][_0x2625('0x1a')]||null:null,'attributes':_0xb34d88['options']?_0xb34d88['options'][_0x2625('0x1b')]||null:null,'limit':_0xb34d88['options']?_0xb34d88[_0x2625('0x18')][_0x2625('0x1c')]||null:null,'include':_0xb34d88['options']?_0xb34d88[_0x2625('0x18')][_0x2625('0x1d')]?_['map'](_0xb34d88[_0x2625('0x18')][_0x2625('0x1d')],function(_0x24ef20){return{'model':db[_0x24ef20[_0x2625('0x1e')]],'as':_0x24ef20['as'],'attributes':_0x24ef20[_0x2625('0x1b')],'include':_0x24ef20[_0x2625('0x1d')]?_['map'](_0x24ef20[_0x2625('0x1d')],function(_0x53ebdf){return{'model':db[_0x53ebdf[_0x2625('0x1e')]],'as':_0x53ebdf['as'],'attributes':_0x53ebdf[_0x2625('0x1b')],'include':_0x53ebdf[_0x2625('0x1d')]?_[_0x2625('0x1f')](_0x53ebdf['include'],function(_0x27969f){return{'model':db[_0x27969f['model']],'as':_0x27969f['as'],'attributes':_0x27969f[_0x2625('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2625('0xb')](function(_0x202f82){logger['info']('GetSugarcrmAccount',_0xb34d88);logger[_0x2625('0xf')]('GetSugarcrmAccount',_0xb34d88,JSON['stringify'](_0x202f82));_0x323084(_0x202f82);})[_0x2625('0x14')](function(_0x58751e){logger[_0x2625('0x10')](_0x2625('0x15'),_0x58751e[_0x2625('0x12')],_0xb34d88);_0x10e3d8(_0x11a8d4[_0x2625('0x10')](0x1f4,_0x58751e[_0x2625('0x12')]));});});};exports[_0x2625('0x20')]=function(_0x2bea34){var _0x3322d4=this;return new Promise(function(_0x41ea36,_0x5d8a69){return db[_0x2625('0x16')]['find']({'raw':_0x2bea34['options']?_0x2bea34[_0x2625('0x18')][_0x2625('0x19')]===undefined?!![]:![]:!![],'where':_0x2bea34[_0x2625('0x18')]?_0x2bea34['options'][_0x2625('0x1a')]||null:null,'attributes':_0x2bea34['options']?_0x2bea34[_0x2625('0x18')]['attributes']||null:null,'include':_0x2bea34[_0x2625('0x18')]?_0x2bea34['options']['include']?_[_0x2625('0x1f')](_0x2bea34[_0x2625('0x18')][_0x2625('0x1d')],function(_0x111738){return{'model':db[_0x111738[_0x2625('0x1e')]],'as':_0x111738['as'],'attributes':_0x111738[_0x2625('0x1b')],'include':_0x111738['include']?_['map'](_0x111738['include'],function(_0x1301ea){return{'model':db[_0x1301ea[_0x2625('0x1e')]],'as':_0x1301ea['as'],'attributes':_0x1301ea[_0x2625('0x1b')],'include':_0x1301ea[_0x2625('0x1d')]?_[_0x2625('0x1f')](_0x1301ea[_0x2625('0x1d')],function(_0xc8c675){return{'model':db[_0xc8c675['model']],'as':_0xc8c675['as'],'attributes':_0xc8c675[_0x2625('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1479e0){logger['info']('ShowSugarcrmAccount',_0x2bea34);logger['debug'](_0x2625('0x20'),_0x2bea34,JSON[_0x2625('0x21')](_0x1479e0));_0x41ea36(_0x1479e0);})[_0x2625('0x14')](function(_0x31303b){logger[_0x2625('0x10')](_0x2625('0x20'),_0x31303b[_0x2625('0x12')],_0x2bea34);_0x5d8a69(_0x3322d4['error'](0x1f4,_0x31303b[_0x2625('0x12')]));});});}; \ No newline at end of file +var _0x4a84=['result','catch','GetSugarcrmAccount','SugarcrmAccount','findAll','options','raw','where','attributes','limit','include','map','model','then','stringify','ShowSugarcrmAccount','find','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','code','error','message','info'];(function(_0x1be59d,_0x45ed85){var _0x303cd9=function(_0x3c52f8){while(--_0x3c52f8){_0x1be59d['push'](_0x1be59d['shift']());}};_0x303cd9(++_0x45ed85);}(_0x4a84,0xc5));var _0x44a8=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x4a84[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require(_0x44a8('0x0'));var moment=require(_0x44a8('0x1'));var BPromise=require(_0x44a8('0x2'));var rs=require(_0x44a8('0x3'));var fs=require('fs');var Redis=require(_0x44a8('0x4'));var db=require(_0x44a8('0x5'))['db'];var utils=require(_0x44a8('0x6'));var logger=require(_0x44a8('0x7'))(_0x44a8('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x44a8('0x9')][_0x44a8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3adaee,_0x579d40,_0x4ba2dc){return new BPromise(function(_0x4285a9,_0x5794fd){return client[_0x44a8('0xb')](_0x3adaee,_0x4ba2dc)['then'](function(_0xf20f14){logger['info'](_0x44a8('0xc'),_0x579d40,'request\x20sent');logger[_0x44a8('0xd')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x579d40,_0x44a8('0xe'),JSON['stringify'](_0xf20f14));if(_0xf20f14['error']){if(_0xf20f14['error'][_0x44a8('0xf')]===0x1f4){logger[_0x44a8('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x579d40,_0xf20f14[_0x44a8('0x10')][_0x44a8('0x11')]);return _0x5794fd(_0xf20f14['error']['message']);}logger[_0x44a8('0x10')]('SugarcrmAccount,\x20%s,\x20%s',_0x579d40,_0xf20f14[_0x44a8('0x10')]['message']);return _0x4285a9(_0xf20f14[_0x44a8('0x10')][_0x44a8('0x11')]);}else{logger[_0x44a8('0x12')](_0x44a8('0xc'),_0x579d40,'request\x20sent');_0x4285a9(_0xf20f14[_0x44a8('0x13')][_0x44a8('0x11')]);}})[_0x44a8('0x14')](function(_0x2f3133){logger[_0x44a8('0x10')](_0x44a8('0xc'),_0x579d40,_0x2f3133);_0x5794fd(_0x2f3133);});});}exports[_0x44a8('0x15')]=function(_0x4d3623){var _0x52f368=this;return new Promise(function(_0x16849d,_0x47d067){return db[_0x44a8('0x16')][_0x44a8('0x17')]({'raw':_0x4d3623[_0x44a8('0x18')]?_0x4d3623['options'][_0x44a8('0x19')]===undefined?!![]:![]:!![],'where':_0x4d3623['options']?_0x4d3623[_0x44a8('0x18')][_0x44a8('0x1a')]||null:null,'attributes':_0x4d3623[_0x44a8('0x18')]?_0x4d3623[_0x44a8('0x18')][_0x44a8('0x1b')]||null:null,'limit':_0x4d3623[_0x44a8('0x18')]?_0x4d3623[_0x44a8('0x18')][_0x44a8('0x1c')]||null:null,'include':_0x4d3623[_0x44a8('0x18')]?_0x4d3623[_0x44a8('0x18')][_0x44a8('0x1d')]?_[_0x44a8('0x1e')](_0x4d3623[_0x44a8('0x18')][_0x44a8('0x1d')],function(_0x209e6f){return{'model':db[_0x209e6f['model']],'as':_0x209e6f['as'],'attributes':_0x209e6f[_0x44a8('0x1b')],'include':_0x209e6f[_0x44a8('0x1d')]?_[_0x44a8('0x1e')](_0x209e6f[_0x44a8('0x1d')],function(_0x142859){return{'model':db[_0x142859[_0x44a8('0x1f')]],'as':_0x142859['as'],'attributes':_0x142859[_0x44a8('0x1b')],'include':_0x142859['include']?_[_0x44a8('0x1e')](_0x142859['include'],function(_0x237687){return{'model':db[_0x237687['model']],'as':_0x237687['as'],'attributes':_0x237687['attributes']};}):[]};}):[]};}):[]:[]})[_0x44a8('0x20')](function(_0x250ff1){logger[_0x44a8('0x12')](_0x44a8('0x15'),_0x4d3623);logger[_0x44a8('0xd')](_0x44a8('0x15'),_0x4d3623,JSON[_0x44a8('0x21')](_0x250ff1));_0x16849d(_0x250ff1);})[_0x44a8('0x14')](function(_0x5612d5){logger[_0x44a8('0x10')](_0x44a8('0x15'),_0x5612d5[_0x44a8('0x11')],_0x4d3623);_0x47d067(_0x52f368[_0x44a8('0x10')](0x1f4,_0x5612d5[_0x44a8('0x11')]));});});};exports[_0x44a8('0x22')]=function(_0x1b40f){var _0x4fc267=this;return new Promise(function(_0x5e0bee,_0x1333af){return db[_0x44a8('0x16')][_0x44a8('0x23')]({'raw':_0x1b40f['options']?_0x1b40f[_0x44a8('0x18')][_0x44a8('0x19')]===undefined?!![]:![]:!![],'where':_0x1b40f[_0x44a8('0x18')]?_0x1b40f[_0x44a8('0x18')]['where']||null:null,'attributes':_0x1b40f[_0x44a8('0x18')]?_0x1b40f[_0x44a8('0x18')][_0x44a8('0x1b')]||null:null,'include':_0x1b40f['options']?_0x1b40f[_0x44a8('0x18')][_0x44a8('0x1d')]?_[_0x44a8('0x1e')](_0x1b40f['options']['include'],function(_0x234a91){return{'model':db[_0x234a91[_0x44a8('0x1f')]],'as':_0x234a91['as'],'attributes':_0x234a91[_0x44a8('0x1b')],'include':_0x234a91[_0x44a8('0x1d')]?_[_0x44a8('0x1e')](_0x234a91['include'],function(_0x260e23){return{'model':db[_0x260e23[_0x44a8('0x1f')]],'as':_0x260e23['as'],'attributes':_0x260e23['attributes'],'include':_0x260e23['include']?_['map'](_0x260e23[_0x44a8('0x1d')],function(_0x19f98f){return{'model':db[_0x19f98f[_0x44a8('0x1f')]],'as':_0x19f98f['as'],'attributes':_0x19f98f[_0x44a8('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x44a8('0x20')](function(_0xcdf408){logger[_0x44a8('0x12')](_0x44a8('0x22'),_0x1b40f);logger[_0x44a8('0xd')]('ShowSugarcrmAccount',_0x1b40f,JSON[_0x44a8('0x21')](_0xcdf408));_0x5e0bee(_0xcdf408);})[_0x44a8('0x14')](function(_0x5158c2){logger[_0x44a8('0x10')]('ShowSugarcrmAccount',_0x5158c2[_0x44a8('0x11')],_0x1b40f);_0x1333af(_0x4fc267[_0x44a8('0x10')](0x1f4,_0x5158c2['message']));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index ca58826..b2af191 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 _0x9d9d=['/:id/subjects','getSubjects','getDescriptions','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','./intSugarcrmConfiguration.controller','isAuthenticated','get','/:id','show','/:id/fields','getFields'];(function(_0x3ca396,_0x58466f){var _0x21309e=function(_0x269372){while(--_0x269372){_0x3ca396['push'](_0x3ca396['shift']());}};_0x21309e(++_0x58466f);}(_0x9d9d,0x12d));var _0xd9d9=function(_0x5bf9d0,_0x402030){_0x5bf9d0=_0x5bf9d0-0x0;var _0x328fe6=_0x9d9d[_0x5bf9d0];return _0x328fe6;};'use strict';var multer=require(_0xd9d9('0x0'));var util=require(_0xd9d9('0x1'));var path=require(_0xd9d9('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9d9('0x3'));var router=express[_0xd9d9('0x4')]();var auth=require(_0xd9d9('0x5'));var interaction=require(_0xd9d9('0x6'));var config=require('../../config/environment');var controller=require(_0xd9d9('0x7'));router['get']('/',auth[_0xd9d9('0x8')](),controller['index']);router[_0xd9d9('0x9')](_0xd9d9('0xa'),auth[_0xd9d9('0x8')](),controller[_0xd9d9('0xb')]);router['get'](_0xd9d9('0xc'),auth[_0xd9d9('0x8')](),controller[_0xd9d9('0xd')]);router['get'](_0xd9d9('0xe'),auth['isAuthenticated'](),controller[_0xd9d9('0xf')]);router[_0xd9d9('0x9')]('/:id/descriptions',auth[_0xd9d9('0x8')](),controller[_0xd9d9('0x10')]);router['post']('/',auth[_0xd9d9('0x8')](),controller['create']);router[_0xd9d9('0x11')](_0xd9d9('0xa'),auth[_0xd9d9('0x8')](),controller[_0xd9d9('0x12')]);router[_0xd9d9('0x13')](_0xd9d9('0xa'),auth['isAuthenticated'](),controller[_0xd9d9('0x14')]);module['exports']=router; \ No newline at end of file +var _0x65e4=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','isAuthenticated','index','get','/:id','show','/:id/fields','getFields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','update','delete','destroy','exports','multer','util'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x65e4,0x1b8));var _0x465e=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x65e4[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x465e('0x0'));var util=require(_0x465e('0x1'));var path=require(_0x465e('0x2'));var timeout=require(_0x465e('0x3'));var express=require(_0x465e('0x4'));var router=express[_0x465e('0x5')]();var auth=require(_0x465e('0x6'));var interaction=require(_0x465e('0x7'));var config=require(_0x465e('0x8'));var controller=require(_0x465e('0x9'));router['get']('/',auth[_0x465e('0xa')](),controller[_0x465e('0xb')]);router[_0x465e('0xc')](_0x465e('0xd'),auth[_0x465e('0xa')](),controller[_0x465e('0xe')]);router[_0x465e('0xc')](_0x465e('0xf'),auth[_0x465e('0xa')](),controller[_0x465e('0x10')]);router['get'](_0x465e('0x11'),auth[_0x465e('0xa')](),controller['getSubjects']);router[_0x465e('0xc')](_0x465e('0x12'),auth[_0x465e('0xa')](),controller[_0x465e('0x13')]);router[_0x465e('0x14')]('/',auth['isAuthenticated'](),controller[_0x465e('0x15')]);router['put'](_0x465e('0xd'),auth[_0x465e('0xa')](),controller[_0x465e('0x16')]);router[_0x465e('0x17')](_0x465e('0xd'),auth['isAuthenticated'](),controller[_0x465e('0x18')]);module[_0x465e('0x19')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.attributes.js index d1c7d0c..b4b8d70 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 _0x11bc=['sequelize'];(function(_0x2c18a8,_0x24eaa5){var _0x1e009a=function(_0x5dea3a){while(--_0x5dea3a){_0x2c18a8['push'](_0x2c18a8['shift']());}};_0x1e009a(++_0x24eaa5);}(_0x11bc,0x1a7));var _0xc11b=function(_0x52706f,_0x50d4a8){_0x52706f=_0x52706f-0x0;var _0x1c1633=_0x11bc[_0x52706f];return _0x1c1633;};'use strict';var Sequelize=require(_0xc11b('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x1ffd=['STRING'];(function(_0x8c27d,_0x58875c){var _0x2be549=function(_0x35ce87){while(--_0x35ce87){_0x8c27d['push'](_0x8c27d['shift']());}};_0x2be549(++_0x58875c);}(_0x1ffd,0xc1));var _0xd1ff=function(_0x403a74,_0x2c69d0){_0x403a74=_0x403a74-0x0;var _0x50fc56=_0x1ffd[_0x403a74];return _0x50fc56;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xd1ff('0x0')]},'description':{'type':Sequelize[_0xd1ff('0x0')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index e2d7cef..513180b 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 _0xd877=['VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','length','merge','find','create','body','update','destroy','getFields','findOne','SugarcrmField','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','client','test','ValidationError','info','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','SugarcrmConfiguration,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','stack','name','index','map','SugarcrmConfiguration','rawAttributes','type','query','filters','intersection','attributes','model','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter'];(function(_0x5ee92b,_0x3fdeb2){var _0x4cfca4=function(_0x19cb5f){while(--_0x19cb5f){_0x5ee92b['push'](_0x5ee92b['shift']());}};_0x4cfca4(++_0x3fdeb2);}(_0xd877,0xcd));var _0x7d87=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xd877[_0x5ddb1c];return _0x354adc;};'use strict';var pdf=require(_0x7d87('0x0'));var emlformat=require(_0x7d87('0x1'));var rimraf=require(_0x7d87('0x2'));var zipdir=require(_0x7d87('0x3'));var jsonpatch=require(_0x7d87('0x4'));var rp=require(_0x7d87('0x5'));var moment=require(_0x7d87('0x6'));var BPromise=require(_0x7d87('0x7'));var Mustache=require(_0x7d87('0x8'));var util=require('util');var path=require(_0x7d87('0x9'));var sox=require('sox');var csv=require(_0x7d87('0xa'));var ejs=require(_0x7d87('0xb'));var fs=require('fs');var _=require(_0x7d87('0xc'));var squel=require(_0x7d87('0xd'));var crypto=require(_0x7d87('0xe'));var jsforce=require(_0x7d87('0xf'));var deskjs=require(_0x7d87('0x10'));var toCsv=require(_0x7d87('0xa'));var querystring=require('querystring');var Papa=require(_0x7d87('0x11'));var Redis=require('ioredis');var authService=require(_0x7d87('0x12'));var qs=require(_0x7d87('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7d87('0x14'));var logger=require(_0x7d87('0x15'))(_0x7d87('0x16'));var utils=require(_0x7d87('0x17'));var config=require(_0x7d87('0x18'));var db=require('../../mysqldb')['db'];var jayson=require(_0x7d87('0x19'));var client=jayson[_0x7d87('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x1fdebb,_0x197636,_0x4cd709){if(_0x4cd709){var _0x119dcc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x119dcc[_0x7d87('0x1b')](_0x197636)){return _0x1fdebb;}else{throw new db['Sequelize'][(_0x7d87('0x1c'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x1fdebb;}}function respondWithRpcPromise(_0x3b230e,_0x586c5c,_0x1e369a,_0x4000db){return new BPromise(function(_0x3023bf,_0x6a0742){var _0x2cbe09=_0x4000db||client;return _0x2cbe09['request'](_0x3b230e,_0x1e369a)['then'](function(_0x14bd01){logger[_0x7d87('0x1d')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x586c5c,'request\x20sent');logger['debug'](_0x7d87('0x1e'),_0x586c5c,_0x7d87('0x1f'),JSON[_0x7d87('0x20')](_0x14bd01));if(_0x14bd01['error']){if(_0x14bd01[_0x7d87('0x21')]['code']===0x1f4){logger[_0x7d87('0x21')](_0x7d87('0x22'),_0x586c5c,_0x14bd01[_0x7d87('0x21')][_0x7d87('0x23')]);return _0x6a0742(_0x14bd01['error'][_0x7d87('0x23')]);}logger['error'](_0x7d87('0x22'),_0x586c5c,_0x14bd01['error'][_0x7d87('0x23')]);return _0x3023bf(_0x14bd01['error'][_0x7d87('0x23')]);}else{logger[_0x7d87('0x1d')](_0x7d87('0x22'),_0x586c5c,_0x7d87('0x1f'));_0x3023bf(_0x14bd01[_0x7d87('0x24')][_0x7d87('0x23')]);}})[_0x7d87('0x25')](function(_0x22c571){logger['error']('SugarcrmConfiguration,\x20%s,\x20%s',_0x586c5c,_0x22c571);_0x6a0742(_0x22c571);});});}function respondWithStatusCode(_0x5e953b,_0x3e71af){_0x3e71af=_0x3e71af||0xcc;return function(_0x3437bd){if(_0x3437bd){return _0x5e953b[_0x7d87('0x26')](_0x3e71af);}return _0x5e953b[_0x7d87('0x27')](_0x3e71af)[_0x7d87('0x28')]();};}function respondWithResult(_0x2a2cf9,_0x45b811){_0x45b811=_0x45b811||0xc8;return function(_0x2a52da){if(_0x2a52da){return _0x2a2cf9[_0x7d87('0x27')](_0x45b811)['json'](_0x2a52da);}};}function respondWithFilteredResult(_0x199024,_0x459985){return function(_0x3e203e){if(_0x3e203e){var _0x5df907=_0x3e203e[_0x7d87('0x29')],_0x317e25=_0x459985[_0x7d87('0x2a')],_0x5b5483=_0x459985[_0x7d87('0x2a')]+_0x459985[_0x7d87('0x2b')],_0x3fed91;if(_0x5b5483>=_0x5df907){_0x5b5483=_0x5df907;_0x3fed91=0xc8;}else{_0x3fed91=0xce;}_0x199024['status'](_0x3fed91);return _0x199024[_0x7d87('0x2c')](_0x7d87('0x2d'),_0x317e25+'-'+_0x5b5483+'/'+_0x5df907)[_0x7d87('0x2e')](_0x3e203e);}return null;};}function patchUpdates(_0x59196a){return function(_0x248e4e){try{jsonpatch[_0x7d87('0x2f')](_0x248e4e,_0x59196a,!![]);}catch(_0x3d27d5){return BPromise[_0x7d87('0x30')](_0x3d27d5);}return _0x248e4e[_0x7d87('0x31')]();};}function saveUpdates(_0x6e314c,_0x2884a3){return function(_0x31af41){if(_0x31af41){return _0x31af41['update'](_0x6e314c)[_0x7d87('0x32')](function(_0x4477d1){return _0x4477d1;});}return null;};}function removeEntity(_0x406d35,_0x15434f){return function(_0x3011ed){if(_0x3011ed){return _0x3011ed['destroy']()[_0x7d87('0x32')](function(){_0x406d35[_0x7d87('0x27')](0xcc)[_0x7d87('0x28')]();});}};}function handleEntityNotFound(_0x4fb26e,_0x3d227e){return function(_0xffce4e){if(!_0xffce4e){_0x4fb26e['sendStatus'](0x194);}return _0xffce4e;};}function handleError(_0x315804,_0x1cb440){_0x1cb440=_0x1cb440||0x1f4;return function(_0x1ead13){logger[_0x7d87('0x21')](_0x1ead13[_0x7d87('0x33')]);if(_0x1ead13[_0x7d87('0x34')]){delete _0x1ead13[_0x7d87('0x34')];}_0x315804[_0x7d87('0x27')](_0x1cb440)['send'](_0x1ead13);};}exports[_0x7d87('0x35')]=function(_0xcfa483,_0x49104b){var _0x3cc601={},_0x9a0ab3={},_0x56dd89={'count':0x0,'rows':[]};var _0x49f409=_[_0x7d87('0x36')](db[_0x7d87('0x37')][_0x7d87('0x38')],function(_0x215402){return{'name':_0x215402['fieldName'],'type':_0x215402[_0x7d87('0x39')]['key']};});_0x9a0ab3['model']=_[_0x7d87('0x36')](_0x49f409,'name');_0x9a0ab3[_0x7d87('0x3a')]=_['keys'](_0xcfa483['query']);_0x9a0ab3[_0x7d87('0x3b')]=_[_0x7d87('0x3c')](_0x9a0ab3['model'],_0x9a0ab3['query']);_0x3cc601[_0x7d87('0x3d')]=_[_0x7d87('0x3c')](_0x9a0ab3[_0x7d87('0x3e')],qs['fields'](_0xcfa483[_0x7d87('0x3a')][_0x7d87('0x3f')]));_0x3cc601[_0x7d87('0x3d')]=_0x3cc601['attributes']['length']?_0x3cc601[_0x7d87('0x3d')]:_0x9a0ab3['model'];if(!_0xcfa483[_0x7d87('0x3a')][_0x7d87('0x40')](_0x7d87('0x41'))){_0x3cc601[_0x7d87('0x2b')]=qs[_0x7d87('0x2b')](_0xcfa483[_0x7d87('0x3a')][_0x7d87('0x2b')]);_0x3cc601['offset']=qs[_0x7d87('0x2a')](_0xcfa483[_0x7d87('0x3a')]['offset']);}_0x3cc601[_0x7d87('0x42')]=qs[_0x7d87('0x43')](_0xcfa483[_0x7d87('0x3a')][_0x7d87('0x43')]);_0x3cc601[_0x7d87('0x44')]=qs[_0x7d87('0x3b')](_[_0x7d87('0x45')](_0xcfa483[_0x7d87('0x3a')],_0x9a0ab3[_0x7d87('0x3b')]));if(_0xcfa483['query'][_0x7d87('0x46')]){_0x3cc601[_0x7d87('0x44')]=_['merge'](_0x3cc601[_0x7d87('0x44')],{'$or':_[_0x7d87('0x36')](_0x49f409,function(_0x3ce4d2){if(_0x3ce4d2[_0x7d87('0x39')]!==_0x7d87('0x47')){var _0x34590a={};_0x34590a[_0x3ce4d2['name']]={'$like':'%'+_0xcfa483['query'][_0x7d87('0x46')]+'%'};return _0x34590a;}})});}_0x3cc601=_['merge']({},_0x3cc601,_0xcfa483[_0x7d87('0x48')]);var _0x5b4bae={'where':_0x3cc601[_0x7d87('0x44')]};return db[_0x7d87('0x37')][_0x7d87('0x29')](_0x5b4bae)['then'](function(_0x3f143b){_0x56dd89[_0x7d87('0x29')]=_0x3f143b;if(_0xcfa483[_0x7d87('0x3a')][_0x7d87('0x49')]){_0x3cc601[_0x7d87('0x4a')]=[{'all':!![]}];}return db[_0x7d87('0x37')][_0x7d87('0x4b')](_0x3cc601);})[_0x7d87('0x32')](function(_0x5963ad){_0x56dd89[_0x7d87('0x4c')]=_0x5963ad;return _0x56dd89;})[_0x7d87('0x32')](respondWithFilteredResult(_0x49104b,_0x3cc601))[_0x7d87('0x25')](handleError(_0x49104b,null));};exports[_0x7d87('0x4d')]=function(_0x2d27ea,_0x2da1ad){var _0x10067b={'raw':![],'where':{'id':_0x2d27ea[_0x7d87('0x4e')]['id']}},_0x19c947={};_0x19c947[_0x7d87('0x3e')]=_[_0x7d87('0x4f')](db[_0x7d87('0x37')][_0x7d87('0x38')]);_0x19c947[_0x7d87('0x3a')]=_['keys'](_0x2d27ea[_0x7d87('0x3a')]);_0x19c947[_0x7d87('0x3b')]=_[_0x7d87('0x3c')](_0x19c947[_0x7d87('0x3e')],_0x19c947[_0x7d87('0x3a')]);_0x10067b['attributes']=_[_0x7d87('0x3c')](_0x19c947[_0x7d87('0x3e')],qs[_0x7d87('0x3f')](_0x2d27ea[_0x7d87('0x3a')][_0x7d87('0x3f')]));_0x10067b['attributes']=_0x10067b[_0x7d87('0x3d')][_0x7d87('0x50')]?_0x10067b[_0x7d87('0x3d')]:_0x19c947['model'];if(_0x2d27ea[_0x7d87('0x3a')][_0x7d87('0x49')]){_0x10067b[_0x7d87('0x4a')]=[{'all':!![]}];}_0x10067b=_[_0x7d87('0x51')]({},_0x10067b,_0x2d27ea[_0x7d87('0x48')]);return db[_0x7d87('0x37')][_0x7d87('0x52')](_0x10067b)[_0x7d87('0x32')](handleEntityNotFound(_0x2da1ad,null))[_0x7d87('0x32')](respondWithResult(_0x2da1ad,null))[_0x7d87('0x25')](handleError(_0x2da1ad,null));};exports['create']=function(_0x2a78a2,_0x5de813){return db[_0x7d87('0x37')][_0x7d87('0x53')](_0x2a78a2[_0x7d87('0x54')],{})[_0x7d87('0x32')](respondWithResult(_0x5de813,0xc9))[_0x7d87('0x25')](handleError(_0x5de813,null));};exports[_0x7d87('0x55')]=function(_0x54f0c5,_0x15e026){if(_0x54f0c5[_0x7d87('0x54')]['id']){delete _0x54f0c5[_0x7d87('0x54')]['id'];}return db[_0x7d87('0x37')][_0x7d87('0x52')]({'where':{'id':_0x54f0c5['params']['id']}})['then'](handleEntityNotFound(_0x15e026,null))[_0x7d87('0x32')](saveUpdates(_0x54f0c5[_0x7d87('0x54')],null))[_0x7d87('0x32')](respondWithResult(_0x15e026,null))[_0x7d87('0x25')](handleError(_0x15e026,null));};exports[_0x7d87('0x56')]=function(_0xc89810,_0x2b0dec){return db[_0x7d87('0x37')]['find']({'where':{'id':_0xc89810[_0x7d87('0x4e')]['id']}})[_0x7d87('0x32')](handleEntityNotFound(_0x2b0dec,null))['then'](removeEntity(_0x2b0dec,null))[_0x7d87('0x25')](handleError(_0x2b0dec,null));};exports[_0x7d87('0x57')]=function(_0x1f8c00,_0x23615e,_0x1ad901){var _0x3cec22={};var _0x577138={};var _0x54c4b8;var _0x35b096;return db[_0x7d87('0x37')][_0x7d87('0x58')]({'where':{'id':_0x1f8c00[_0x7d87('0x4e')]['id']}})[_0x7d87('0x32')](handleEntityNotFound(_0x23615e,null))[_0x7d87('0x32')](function(_0x5bc331){if(_0x5bc331){_0x54c4b8=_0x5bc331;_0x577138['model']=_[_0x7d87('0x4f')](db[_0x7d87('0x59')][_0x7d87('0x38')]);_0x577138[_0x7d87('0x3a')]=_[_0x7d87('0x4f')](_0x1f8c00[_0x7d87('0x3a')]);_0x577138[_0x7d87('0x3b')]=_[_0x7d87('0x3c')](_0x577138['model'],_0x577138[_0x7d87('0x3a')]);_0x3cec22[_0x7d87('0x3d')]=_[_0x7d87('0x3c')](_0x577138[_0x7d87('0x3e')],qs['fields'](_0x1f8c00[_0x7d87('0x3a')]['fields']));_0x3cec22['attributes']=_0x3cec22[_0x7d87('0x3d')][_0x7d87('0x50')]?_0x3cec22[_0x7d87('0x3d')]:_0x577138['model'];_0x3cec22['order']=qs['sort'](_0x1f8c00[_0x7d87('0x3a')][_0x7d87('0x43')]);_0x3cec22[_0x7d87('0x44')]=qs[_0x7d87('0x3b')](_[_0x7d87('0x45')](_0x1f8c00[_0x7d87('0x3a')],_0x577138[_0x7d87('0x3b')]));if(_0x1f8c00[_0x7d87('0x3a')]['filter']){_0x3cec22['where']=_[_0x7d87('0x51')](_0x3cec22[_0x7d87('0x44')],{'$or':_[_0x7d87('0x36')](_0x3cec22[_0x7d87('0x3d')],function(_0x5c84a3){var _0x3572fb={};_0x3572fb[_0x5c84a3]={'$like':'%'+_0x1f8c00[_0x7d87('0x3a')][_0x7d87('0x46')]+'%'};return _0x3572fb;})});}_0x3cec22=_['merge']({},_0x3cec22,_0x1f8c00['options']);return _0x54c4b8[_0x7d87('0x57')](_0x3cec22);}})[_0x7d87('0x32')](function(_0x42ae77){if(_0x42ae77){_0x35b096=_0x42ae77['length'];if(!_0x1f8c00['query'][_0x7d87('0x40')](_0x7d87('0x41'))){_0x3cec22['limit']=qs[_0x7d87('0x2b')](_0x1f8c00[_0x7d87('0x3a')]['limit']);_0x3cec22[_0x7d87('0x2a')]=qs[_0x7d87('0x2a')](_0x1f8c00[_0x7d87('0x3a')][_0x7d87('0x2a')]);}return _0x54c4b8[_0x7d87('0x57')](_0x3cec22);}})[_0x7d87('0x32')](function(_0x5c51bb){if(_0x5c51bb){return _0x5c51bb?{'count':_0x35b096,'rows':_0x5c51bb}:null;}})[_0x7d87('0x32')](respondWithResult(_0x23615e,null))[_0x7d87('0x25')](handleError(_0x23615e,null));};exports['getSubjects']=function(_0x2f2581,_0x24f900,_0x4047c6){var _0x167843={};var _0x18825a={};var _0x53c6bf;var _0x5840d8;return db[_0x7d87('0x37')][_0x7d87('0x58')]({'where':{'id':_0x2f2581[_0x7d87('0x4e')]['id']}})[_0x7d87('0x32')](handleEntityNotFound(_0x24f900,null))[_0x7d87('0x32')](function(_0x4cdc09){if(_0x4cdc09){_0x53c6bf=_0x4cdc09;_0x18825a[_0x7d87('0x3e')]=_['keys'](db['SugarcrmField'][_0x7d87('0x38')]);_0x18825a[_0x7d87('0x3a')]=_[_0x7d87('0x4f')](_0x2f2581[_0x7d87('0x3a')]);_0x18825a['filters']=_[_0x7d87('0x3c')](_0x18825a[_0x7d87('0x3e')],_0x18825a['query']);_0x167843['attributes']=_[_0x7d87('0x3c')](_0x18825a[_0x7d87('0x3e')],qs[_0x7d87('0x3f')](_0x2f2581[_0x7d87('0x3a')]['fields']));_0x167843[_0x7d87('0x3d')]=_0x167843[_0x7d87('0x3d')]['length']?_0x167843[_0x7d87('0x3d')]:_0x18825a[_0x7d87('0x3e')];_0x167843['order']=qs[_0x7d87('0x43')](_0x2f2581['query']['sort']);_0x167843[_0x7d87('0x44')]=qs[_0x7d87('0x3b')](_[_0x7d87('0x45')](_0x2f2581[_0x7d87('0x3a')],_0x18825a[_0x7d87('0x3b')]));if(_0x2f2581[_0x7d87('0x3a')][_0x7d87('0x46')]){_0x167843['where']=_[_0x7d87('0x51')](_0x167843[_0x7d87('0x44')],{'$or':_['map'](_0x167843[_0x7d87('0x3d')],function(_0x11d145){var _0x38f586={};_0x38f586[_0x11d145]={'$like':'%'+_0x2f2581[_0x7d87('0x3a')]['filter']+'%'};return _0x38f586;})});}_0x167843=_[_0x7d87('0x51')]({},_0x167843,_0x2f2581[_0x7d87('0x48')]);return _0x53c6bf[_0x7d87('0x5a')](_0x167843);}})[_0x7d87('0x32')](function(_0x468475){if(_0x468475){_0x5840d8=_0x468475[_0x7d87('0x50')];if(!_0x2f2581['query'][_0x7d87('0x40')]('nolimit')){_0x167843[_0x7d87('0x2b')]=qs['limit'](_0x2f2581[_0x7d87('0x3a')]['limit']);_0x167843[_0x7d87('0x2a')]=qs[_0x7d87('0x2a')](_0x2f2581[_0x7d87('0x3a')]['offset']);}return _0x53c6bf[_0x7d87('0x5a')](_0x167843);}})[_0x7d87('0x32')](function(_0x1abbd9){if(_0x1abbd9){return _0x1abbd9?{'count':_0x5840d8,'rows':_0x1abbd9}:null;}})[_0x7d87('0x32')](respondWithResult(_0x24f900,null))[_0x7d87('0x25')](handleError(_0x24f900,null));};exports[_0x7d87('0x5b')]=function(_0x33815a,_0x3318aa,_0x3e1725){var _0x50b537={};var _0x4ea99b={};var _0xc7c83a;var _0x48389c;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x33815a[_0x7d87('0x4e')]['id']}})[_0x7d87('0x32')](handleEntityNotFound(_0x3318aa,null))[_0x7d87('0x32')](function(_0x3ada17){if(_0x3ada17){_0xc7c83a=_0x3ada17;_0x4ea99b[_0x7d87('0x3e')]=_['keys'](db['SugarcrmField'][_0x7d87('0x38')]);_0x4ea99b[_0x7d87('0x3a')]=_['keys'](_0x33815a[_0x7d87('0x3a')]);_0x4ea99b[_0x7d87('0x3b')]=_[_0x7d87('0x3c')](_0x4ea99b['model'],_0x4ea99b[_0x7d87('0x3a')]);_0x50b537[_0x7d87('0x3d')]=_[_0x7d87('0x3c')](_0x4ea99b[_0x7d87('0x3e')],qs[_0x7d87('0x3f')](_0x33815a[_0x7d87('0x3a')][_0x7d87('0x3f')]));_0x50b537[_0x7d87('0x3d')]=_0x50b537['attributes'][_0x7d87('0x50')]?_0x50b537[_0x7d87('0x3d')]:_0x4ea99b[_0x7d87('0x3e')];_0x50b537[_0x7d87('0x42')]=qs[_0x7d87('0x43')](_0x33815a[_0x7d87('0x3a')][_0x7d87('0x43')]);_0x50b537['where']=qs[_0x7d87('0x3b')](_[_0x7d87('0x45')](_0x33815a[_0x7d87('0x3a')],_0x4ea99b[_0x7d87('0x3b')]));if(_0x33815a[_0x7d87('0x3a')][_0x7d87('0x46')]){_0x50b537[_0x7d87('0x44')]=_[_0x7d87('0x51')](_0x50b537[_0x7d87('0x44')],{'$or':_[_0x7d87('0x36')](_0x50b537['attributes'],function(_0xd704d5){var _0x584229={};_0x584229[_0xd704d5]={'$like':'%'+_0x33815a['query'][_0x7d87('0x46')]+'%'};return _0x584229;})});}_0x50b537=_['merge']({},_0x50b537,_0x33815a[_0x7d87('0x48')]);return _0xc7c83a[_0x7d87('0x5b')](_0x50b537);}})['then'](function(_0x2db685){if(_0x2db685){_0x48389c=_0x2db685[_0x7d87('0x50')];if(!_0x33815a[_0x7d87('0x3a')][_0x7d87('0x40')](_0x7d87('0x41'))){_0x50b537[_0x7d87('0x2b')]=qs[_0x7d87('0x2b')](_0x33815a[_0x7d87('0x3a')]['limit']);_0x50b537[_0x7d87('0x2a')]=qs[_0x7d87('0x2a')](_0x33815a[_0x7d87('0x3a')][_0x7d87('0x2a')]);}return _0xc7c83a[_0x7d87('0x5b')](_0x50b537);}})['then'](function(_0x1230d6){if(_0x1230d6){return _0x1230d6?{'count':_0x48389c,'rows':_0x1230d6}:null;}})[_0x7d87('0x32')](respondWithResult(_0x3318aa,null))['catch'](handleError(_0x3318aa,null));}; \ No newline at end of file +var _0x52f6=['SugarcrmConfiguration,\x20%s,\x20%s','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','end','json','offset','limit','status','Content-Range','apply','save','update','destroy','name','send','map','SugarcrmConfiguration','rawAttributes','fieldName','type','key','query','keys','filters','model','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','where','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','params','find','create','body','getFields','findOne','sort','pick','options','getSubjects','SugarcrmField','getDescriptions','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info'];(function(_0x4736ea,_0x9256c4){var _0x29ee17=function(_0x1e949b){while(--_0x1e949b){_0x4736ea['push'](_0x4736ea['shift']());}};_0x29ee17(++_0x9256c4);}(_0x52f6,0x150));var _0x652f=function(_0x582783,_0x15bd71){_0x582783=_0x582783-0x0;var _0x1fa86e=_0x52f6[_0x582783];return _0x1fa86e;};'use strict';var pdf=require(_0x652f('0x0'));var emlformat=require(_0x652f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x652f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x652f('0x3'));var moment=require(_0x652f('0x4'));var BPromise=require(_0x652f('0x5'));var Mustache=require(_0x652f('0x6'));var util=require(_0x652f('0x7'));var path=require(_0x652f('0x8'));var sox=require(_0x652f('0x9'));var csv=require(_0x652f('0xa'));var ejs=require(_0x652f('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x652f('0xc'));var jsforce=require(_0x652f('0xd'));var deskjs=require(_0x652f('0xe'));var toCsv=require(_0x652f('0xa'));var querystring=require(_0x652f('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x652f('0x10'));var qs=require(_0x652f('0x11'));var as=require(_0x652f('0x12'));var hardwareService=require(_0x652f('0x13'));var logger=require(_0x652f('0x14'))(_0x652f('0x15'));var utils=require('../../config/utils');var config=require(_0x652f('0x16'));var db=require(_0x652f('0x17'))['db'];var jayson=require(_0x652f('0x18'));var client=jayson[_0x652f('0x19')][_0x652f('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xbb79b8,_0x20a438,_0x390368){if(_0x390368){var _0x261efb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x261efb['test'](_0x20a438)){return _0xbb79b8;}else{throw new db['Sequelize'][(_0x652f('0x1b'))](_0x652f('0x1c'));}}else{return _0xbb79b8;}}function respondWithRpcPromise(_0x314264,_0x1c75b8,_0x341386,_0x51892a){return new BPromise(function(_0x2d9ed5,_0x582b35){var _0x1b346f=_0x51892a||client;return _0x1b346f[_0x652f('0x1d')](_0x314264,_0x341386)[_0x652f('0x1e')](function(_0x22754e){logger[_0x652f('0x1f')](_0x652f('0x20'),_0x1c75b8,'request\x20sent');logger[_0x652f('0x21')](_0x652f('0x22'),_0x1c75b8,_0x652f('0x23'),JSON[_0x652f('0x24')](_0x22754e));if(_0x22754e['error']){if(_0x22754e['error'][_0x652f('0x25')]===0x1f4){logger[_0x652f('0x26')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c75b8,_0x22754e[_0x652f('0x26')][_0x652f('0x27')]);return _0x582b35(_0x22754e[_0x652f('0x26')]['message']);}logger[_0x652f('0x26')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c75b8,_0x22754e[_0x652f('0x26')][_0x652f('0x27')]);return _0x2d9ed5(_0x22754e['error'][_0x652f('0x27')]);}else{logger['info'](_0x652f('0x20'),_0x1c75b8,_0x652f('0x23'));_0x2d9ed5(_0x22754e[_0x652f('0x28')][_0x652f('0x27')]);}})['catch'](function(_0xb8cca6){logger[_0x652f('0x26')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x1c75b8,_0xb8cca6);_0x582b35(_0xb8cca6);});});}function respondWithStatusCode(_0x4425f7,_0xd9e82d){_0xd9e82d=_0xd9e82d||0xcc;return function(_0x19ae82){if(_0x19ae82){return _0x4425f7['sendStatus'](_0xd9e82d);}return _0x4425f7['status'](_0xd9e82d)[_0x652f('0x29')]();};}function respondWithResult(_0x7b2862,_0x21dd16){_0x21dd16=_0x21dd16||0xc8;return function(_0xb5479b){if(_0xb5479b){return _0x7b2862['status'](_0x21dd16)[_0x652f('0x2a')](_0xb5479b);}};}function respondWithFilteredResult(_0x4c95d8,_0x47a9d8){return function(_0x2fbe05){if(_0x2fbe05){var _0xfde3f5=_0x2fbe05['count'],_0x1315e3=_0x47a9d8[_0x652f('0x2b')],_0x8f714d=_0x47a9d8[_0x652f('0x2b')]+_0x47a9d8[_0x652f('0x2c')],_0x1e33bd;if(_0x8f714d>=_0xfde3f5){_0x8f714d=_0xfde3f5;_0x1e33bd=0xc8;}else{_0x1e33bd=0xce;}_0x4c95d8[_0x652f('0x2d')](_0x1e33bd);return _0x4c95d8['set'](_0x652f('0x2e'),_0x1315e3+'-'+_0x8f714d+'/'+_0xfde3f5)[_0x652f('0x2a')](_0x2fbe05);}return null;};}function patchUpdates(_0x40bfe8){return function(_0x5bc146){try{jsonpatch[_0x652f('0x2f')](_0x5bc146,_0x40bfe8,!![]);}catch(_0x44fdc9){return BPromise['reject'](_0x44fdc9);}return _0x5bc146[_0x652f('0x30')]();};}function saveUpdates(_0x7feed4,_0x186da3){return function(_0x452f49){if(_0x452f49){return _0x452f49[_0x652f('0x31')](_0x7feed4)[_0x652f('0x1e')](function(_0x218d6a){return _0x218d6a;});}return null;};}function removeEntity(_0x8c38d2,_0xf8cd99){return function(_0xd2305f){if(_0xd2305f){return _0xd2305f[_0x652f('0x32')]()['then'](function(){_0x8c38d2[_0x652f('0x2d')](0xcc)[_0x652f('0x29')]();});}};}function handleEntityNotFound(_0x4da591,_0x813c16){return function(_0x1c02db){if(!_0x1c02db){_0x4da591['sendStatus'](0x194);}return _0x1c02db;};}function handleError(_0x1d50e1,_0x2bd4b9){_0x2bd4b9=_0x2bd4b9||0x1f4;return function(_0x286a39){logger[_0x652f('0x26')](_0x286a39['stack']);if(_0x286a39[_0x652f('0x33')]){delete _0x286a39['name'];}_0x1d50e1['status'](_0x2bd4b9)[_0x652f('0x34')](_0x286a39);};}exports['index']=function(_0x32257e,_0x49ec24){var _0x2e05f3={},_0x48c099={},_0x253ad1={'count':0x0,'rows':[]};var _0x83498d=_[_0x652f('0x35')](db[_0x652f('0x36')][_0x652f('0x37')],function(_0x44bd79){return{'name':_0x44bd79[_0x652f('0x38')],'type':_0x44bd79[_0x652f('0x39')][_0x652f('0x3a')]};});_0x48c099['model']=_['map'](_0x83498d,_0x652f('0x33'));_0x48c099[_0x652f('0x3b')]=_[_0x652f('0x3c')](_0x32257e['query']);_0x48c099[_0x652f('0x3d')]=_['intersection'](_0x48c099[_0x652f('0x3e')],_0x48c099[_0x652f('0x3b')]);_0x2e05f3['attributes']=_[_0x652f('0x3f')](_0x48c099[_0x652f('0x3e')],qs[_0x652f('0x40')](_0x32257e[_0x652f('0x3b')][_0x652f('0x40')]));_0x2e05f3[_0x652f('0x41')]=_0x2e05f3[_0x652f('0x41')][_0x652f('0x42')]?_0x2e05f3[_0x652f('0x41')]:_0x48c099[_0x652f('0x3e')];if(!_0x32257e[_0x652f('0x3b')][_0x652f('0x43')](_0x652f('0x44'))){_0x2e05f3[_0x652f('0x2c')]=qs[_0x652f('0x2c')](_0x32257e[_0x652f('0x3b')][_0x652f('0x2c')]);_0x2e05f3[_0x652f('0x2b')]=qs['offset'](_0x32257e['query']['offset']);}_0x2e05f3[_0x652f('0x45')]=qs['sort'](_0x32257e['query']['sort']);_0x2e05f3[_0x652f('0x46')]=qs['filters'](_['pick'](_0x32257e[_0x652f('0x3b')],_0x48c099[_0x652f('0x3d')]));if(_0x32257e[_0x652f('0x3b')][_0x652f('0x47')]){_0x2e05f3[_0x652f('0x46')]=_[_0x652f('0x48')](_0x2e05f3[_0x652f('0x46')],{'$or':_[_0x652f('0x35')](_0x83498d,function(_0x58cdc8){if(_0x58cdc8[_0x652f('0x39')]!==_0x652f('0x49')){var _0x31f02b={};_0x31f02b[_0x58cdc8[_0x652f('0x33')]]={'$like':'%'+_0x32257e[_0x652f('0x3b')][_0x652f('0x47')]+'%'};return _0x31f02b;}})});}_0x2e05f3=_[_0x652f('0x48')]({},_0x2e05f3,_0x32257e['options']);var _0x24b32c={'where':_0x2e05f3[_0x652f('0x46')]};return db[_0x652f('0x36')][_0x652f('0x4a')](_0x24b32c)['then'](function(_0x55756a){_0x253ad1[_0x652f('0x4a')]=_0x55756a;if(_0x32257e[_0x652f('0x3b')][_0x652f('0x4b')]){_0x2e05f3[_0x652f('0x4c')]=[{'all':!![]}];}return db[_0x652f('0x36')][_0x652f('0x4d')](_0x2e05f3);})['then'](function(_0x469917){_0x253ad1[_0x652f('0x4e')]=_0x469917;return _0x253ad1;})['then'](respondWithFilteredResult(_0x49ec24,_0x2e05f3))[_0x652f('0x4f')](handleError(_0x49ec24,null));};exports['show']=function(_0x288916,_0x329c64){var _0x1fe1b1={'raw':![],'where':{'id':_0x288916[_0x652f('0x50')]['id']}},_0x29fd8c={};_0x29fd8c[_0x652f('0x3e')]=_[_0x652f('0x3c')](db[_0x652f('0x36')][_0x652f('0x37')]);_0x29fd8c[_0x652f('0x3b')]=_[_0x652f('0x3c')](_0x288916['query']);_0x29fd8c[_0x652f('0x3d')]=_[_0x652f('0x3f')](_0x29fd8c['model'],_0x29fd8c['query']);_0x1fe1b1[_0x652f('0x41')]=_[_0x652f('0x3f')](_0x29fd8c[_0x652f('0x3e')],qs['fields'](_0x288916['query'][_0x652f('0x40')]));_0x1fe1b1[_0x652f('0x41')]=_0x1fe1b1[_0x652f('0x41')][_0x652f('0x42')]?_0x1fe1b1[_0x652f('0x41')]:_0x29fd8c[_0x652f('0x3e')];if(_0x288916[_0x652f('0x3b')][_0x652f('0x4b')]){_0x1fe1b1[_0x652f('0x4c')]=[{'all':!![]}];}_0x1fe1b1=_[_0x652f('0x48')]({},_0x1fe1b1,_0x288916['options']);return db['SugarcrmConfiguration'][_0x652f('0x51')](_0x1fe1b1)[_0x652f('0x1e')](handleEntityNotFound(_0x329c64,null))['then'](respondWithResult(_0x329c64,null))[_0x652f('0x4f')](handleError(_0x329c64,null));};exports[_0x652f('0x52')]=function(_0x5c22b2,_0x16ca26){return db['SugarcrmConfiguration'][_0x652f('0x52')](_0x5c22b2[_0x652f('0x53')],{})[_0x652f('0x1e')](respondWithResult(_0x16ca26,0xc9))[_0x652f('0x4f')](handleError(_0x16ca26,null));};exports[_0x652f('0x31')]=function(_0x285aaf,_0x36a2ce){if(_0x285aaf[_0x652f('0x53')]['id']){delete _0x285aaf[_0x652f('0x53')]['id'];}return db[_0x652f('0x36')][_0x652f('0x51')]({'where':{'id':_0x285aaf[_0x652f('0x50')]['id']}})[_0x652f('0x1e')](handleEntityNotFound(_0x36a2ce,null))[_0x652f('0x1e')](saveUpdates(_0x285aaf['body'],null))[_0x652f('0x1e')](respondWithResult(_0x36a2ce,null))['catch'](handleError(_0x36a2ce,null));};exports[_0x652f('0x32')]=function(_0x51dc80,_0x32fce9){return db[_0x652f('0x36')][_0x652f('0x51')]({'where':{'id':_0x51dc80['params']['id']}})[_0x652f('0x1e')](handleEntityNotFound(_0x32fce9,null))[_0x652f('0x1e')](removeEntity(_0x32fce9,null))[_0x652f('0x4f')](handleError(_0x32fce9,null));};exports[_0x652f('0x54')]=function(_0x3ad60e,_0x341f81,_0x322f3e){var _0x48af43={};var _0x33ca71={};var _0x3a4290;var _0x543bd3;return db[_0x652f('0x36')][_0x652f('0x55')]({'where':{'id':_0x3ad60e['params']['id']}})[_0x652f('0x1e')](handleEntityNotFound(_0x341f81,null))[_0x652f('0x1e')](function(_0x301a6d){if(_0x301a6d){_0x3a4290=_0x301a6d;_0x33ca71['model']=_['keys'](db['SugarcrmField'][_0x652f('0x37')]);_0x33ca71[_0x652f('0x3b')]=_[_0x652f('0x3c')](_0x3ad60e[_0x652f('0x3b')]);_0x33ca71[_0x652f('0x3d')]=_['intersection'](_0x33ca71[_0x652f('0x3e')],_0x33ca71[_0x652f('0x3b')]);_0x48af43['attributes']=_[_0x652f('0x3f')](_0x33ca71[_0x652f('0x3e')],qs[_0x652f('0x40')](_0x3ad60e[_0x652f('0x3b')]['fields']));_0x48af43[_0x652f('0x41')]=_0x48af43[_0x652f('0x41')][_0x652f('0x42')]?_0x48af43[_0x652f('0x41')]:_0x33ca71[_0x652f('0x3e')];_0x48af43[_0x652f('0x45')]=qs[_0x652f('0x56')](_0x3ad60e['query'][_0x652f('0x56')]);_0x48af43[_0x652f('0x46')]=qs['filters'](_[_0x652f('0x57')](_0x3ad60e['query'],_0x33ca71[_0x652f('0x3d')]));if(_0x3ad60e[_0x652f('0x3b')][_0x652f('0x47')]){_0x48af43[_0x652f('0x46')]=_[_0x652f('0x48')](_0x48af43['where'],{'$or':_['map'](_0x48af43[_0x652f('0x41')],function(_0x8efceb){var _0x2d88e5={};_0x2d88e5[_0x8efceb]={'$like':'%'+_0x3ad60e[_0x652f('0x3b')]['filter']+'%'};return _0x2d88e5;})});}_0x48af43=_[_0x652f('0x48')]({},_0x48af43,_0x3ad60e[_0x652f('0x58')]);return _0x3a4290[_0x652f('0x54')](_0x48af43);}})['then'](function(_0x3aff70){if(_0x3aff70){_0x543bd3=_0x3aff70['length'];if(!_0x3ad60e[_0x652f('0x3b')][_0x652f('0x43')](_0x652f('0x44'))){_0x48af43[_0x652f('0x2c')]=qs['limit'](_0x3ad60e[_0x652f('0x3b')]['limit']);_0x48af43[_0x652f('0x2b')]=qs[_0x652f('0x2b')](_0x3ad60e['query'][_0x652f('0x2b')]);}return _0x3a4290[_0x652f('0x54')](_0x48af43);}})['then'](function(_0x575a80){if(_0x575a80){return _0x575a80?{'count':_0x543bd3,'rows':_0x575a80}:null;}})[_0x652f('0x1e')](respondWithResult(_0x341f81,null))[_0x652f('0x4f')](handleError(_0x341f81,null));};exports[_0x652f('0x59')]=function(_0x2494c7,_0x330051,_0x3dcf24){var _0x16a4dd={};var _0x109a5d={};var _0x133202;var _0x37d6ce;return db[_0x652f('0x36')][_0x652f('0x55')]({'where':{'id':_0x2494c7[_0x652f('0x50')]['id']}})['then'](handleEntityNotFound(_0x330051,null))[_0x652f('0x1e')](function(_0x3f3204){if(_0x3f3204){_0x133202=_0x3f3204;_0x109a5d[_0x652f('0x3e')]=_['keys'](db[_0x652f('0x5a')][_0x652f('0x37')]);_0x109a5d[_0x652f('0x3b')]=_['keys'](_0x2494c7[_0x652f('0x3b')]);_0x109a5d[_0x652f('0x3d')]=_[_0x652f('0x3f')](_0x109a5d[_0x652f('0x3e')],_0x109a5d['query']);_0x16a4dd[_0x652f('0x41')]=_[_0x652f('0x3f')](_0x109a5d[_0x652f('0x3e')],qs[_0x652f('0x40')](_0x2494c7[_0x652f('0x3b')]['fields']));_0x16a4dd[_0x652f('0x41')]=_0x16a4dd['attributes'][_0x652f('0x42')]?_0x16a4dd['attributes']:_0x109a5d[_0x652f('0x3e')];_0x16a4dd[_0x652f('0x45')]=qs[_0x652f('0x56')](_0x2494c7[_0x652f('0x3b')][_0x652f('0x56')]);_0x16a4dd['where']=qs[_0x652f('0x3d')](_[_0x652f('0x57')](_0x2494c7[_0x652f('0x3b')],_0x109a5d[_0x652f('0x3d')]));if(_0x2494c7[_0x652f('0x3b')][_0x652f('0x47')]){_0x16a4dd['where']=_[_0x652f('0x48')](_0x16a4dd[_0x652f('0x46')],{'$or':_[_0x652f('0x35')](_0x16a4dd[_0x652f('0x41')],function(_0x50510b){var _0x2166e5={};_0x2166e5[_0x50510b]={'$like':'%'+_0x2494c7[_0x652f('0x3b')]['filter']+'%'};return _0x2166e5;})});}_0x16a4dd=_['merge']({},_0x16a4dd,_0x2494c7[_0x652f('0x58')]);return _0x133202[_0x652f('0x59')](_0x16a4dd);}})['then'](function(_0x26428b){if(_0x26428b){_0x37d6ce=_0x26428b[_0x652f('0x42')];if(!_0x2494c7[_0x652f('0x3b')][_0x652f('0x43')](_0x652f('0x44'))){_0x16a4dd[_0x652f('0x2c')]=qs[_0x652f('0x2c')](_0x2494c7['query'][_0x652f('0x2c')]);_0x16a4dd[_0x652f('0x2b')]=qs[_0x652f('0x2b')](_0x2494c7[_0x652f('0x3b')]['offset']);}return _0x133202['getSubjects'](_0x16a4dd);}})[_0x652f('0x1e')](function(_0x5953fd){if(_0x5953fd){return _0x5953fd?{'count':_0x37d6ce,'rows':_0x5953fd}:null;}})[_0x652f('0x1e')](respondWithResult(_0x330051,null))[_0x652f('0x4f')](handleError(_0x330051,null));};exports[_0x652f('0x5b')]=function(_0x274cf6,_0x2100ee,_0x43244b){var _0x3bfb45={};var _0x5538f7={};var _0x3cd0b1;var _0x35ecc5;return db[_0x652f('0x36')][_0x652f('0x55')]({'where':{'id':_0x274cf6[_0x652f('0x50')]['id']}})[_0x652f('0x1e')](handleEntityNotFound(_0x2100ee,null))['then'](function(_0x22cde9){if(_0x22cde9){_0x3cd0b1=_0x22cde9;_0x5538f7[_0x652f('0x3e')]=_['keys'](db[_0x652f('0x5a')][_0x652f('0x37')]);_0x5538f7['query']=_['keys'](_0x274cf6[_0x652f('0x3b')]);_0x5538f7['filters']=_['intersection'](_0x5538f7[_0x652f('0x3e')],_0x5538f7[_0x652f('0x3b')]);_0x3bfb45['attributes']=_[_0x652f('0x3f')](_0x5538f7['model'],qs[_0x652f('0x40')](_0x274cf6[_0x652f('0x3b')][_0x652f('0x40')]));_0x3bfb45[_0x652f('0x41')]=_0x3bfb45[_0x652f('0x41')][_0x652f('0x42')]?_0x3bfb45[_0x652f('0x41')]:_0x5538f7['model'];_0x3bfb45[_0x652f('0x45')]=qs['sort'](_0x274cf6['query'][_0x652f('0x56')]);_0x3bfb45[_0x652f('0x46')]=qs[_0x652f('0x3d')](_['pick'](_0x274cf6[_0x652f('0x3b')],_0x5538f7[_0x652f('0x3d')]));if(_0x274cf6['query'][_0x652f('0x47')]){_0x3bfb45[_0x652f('0x46')]=_[_0x652f('0x48')](_0x3bfb45['where'],{'$or':_['map'](_0x3bfb45['attributes'],function(_0x2ca4ad){var _0x1cb751={};_0x1cb751[_0x2ca4ad]={'$like':'%'+_0x274cf6['query'][_0x652f('0x47')]+'%'};return _0x1cb751;})});}_0x3bfb45=_['merge']({},_0x3bfb45,_0x274cf6[_0x652f('0x58')]);return _0x3cd0b1[_0x652f('0x5b')](_0x3bfb45);}})[_0x652f('0x1e')](function(_0x4677b8){if(_0x4677b8){_0x35ecc5=_0x4677b8['length'];if(!_0x274cf6['query'][_0x652f('0x43')]('nolimit')){_0x3bfb45[_0x652f('0x2c')]=qs[_0x652f('0x2c')](_0x274cf6[_0x652f('0x3b')][_0x652f('0x2c')]);_0x3bfb45[_0x652f('0x2b')]=qs[_0x652f('0x2b')](_0x274cf6[_0x652f('0x3b')][_0x652f('0x2b')]);}return _0x3cd0b1[_0x652f('0x5b')](_0x3bfb45);}})['then'](function(_0xfb8a14){if(_0xfb8a14){return _0xfb8a14?{'count':_0x35ecc5,'rows':_0xfb8a14}:null;}})[_0x652f('0x1e')](respondWithResult(_0x2100ee,null))[_0x652f('0x4f')](handleError(_0x2100ee,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index 233e2a2..657abde 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 _0x4fdc=['exports','define','SugarcrmConfiguration','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes'];(function(_0x425ecd,_0x1e1bed){var _0xddc406=function(_0x179638){while(--_0x179638){_0x425ecd['push'](_0x425ecd['shift']());}};_0xddc406(++_0x1e1bed);}(_0x4fdc,0x1b0));var _0xc4fd=function(_0x39891c,_0x1555c6){_0x39891c=_0x39891c-0x0;var _0x11fc2c=_0x4fdc[_0x39891c];return _0x11fc2c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc4fd('0x0'))(_0xc4fd('0x1'));var moment=require(_0xc4fd('0x2'));var BPromise=require(_0xc4fd('0x3'));var rp=require(_0xc4fd('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xc4fd('0x5'));var config=require(_0xc4fd('0x6'));var attributes=require(_0xc4fd('0x7'));module[_0xc4fd('0x8')]=function(_0x32a232,_0x4ce528){return _0x32a232[_0xc4fd('0x9')](_0xc4fd('0xa'),attributes,{'tableName':'int_sugarcrm_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xefaa=['rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations','../../config/logger','moment'];(function(_0x47eb91,_0x1fbbb4){var _0x35ec23=function(_0x4daa47){while(--_0x4daa47){_0x47eb91['push'](_0x47eb91['shift']());}};_0x35ec23(++_0x1fbbb4);}(_0xefaa,0x106));var _0xaefa=function(_0x5bd426,_0x4878e5){_0x5bd426=_0x5bd426-0x0;var _0x23a7eb=_0xefaa[_0x5bd426];return _0x23a7eb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xaefa('0x0'))('api');var moment=require(_0xaefa('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xaefa('0x2'));var config=require(_0xaefa('0x3'));var attributes=require(_0xaefa('0x4'));module['exports']=function(_0x328c6a,_0x37a73c){return _0x328c6a[_0xaefa('0x5')](_0xaefa('0x6'),attributes,{'tableName':_0xaefa('0x7'),'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 bdcc6c4..b47a11f 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 _0x1977=['code','SugarcrmConfiguration,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','then','request\x20sent','stringify','error'];(function(_0x152121,_0x120c53){var _0x592a85=function(_0x241cab){while(--_0x241cab){_0x152121['push'](_0x152121['shift']());}};_0x592a85(++_0x120c53);}(_0x1977,0x69));var _0x7197=function(_0x20d4c7,_0x48e7a2){_0x20d4c7=_0x20d4c7-0x0;var _0x5c2f69=_0x1977[_0x20d4c7];return _0x5c2f69;};'use strict';var _=require(_0x7197('0x0'));var util=require(_0x7197('0x1'));var moment=require(_0x7197('0x2'));var BPromise=require(_0x7197('0x3'));var rs=require(_0x7197('0x4'));var fs=require('fs');var Redis=require(_0x7197('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x7197('0x6'));var logger=require(_0x7197('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7197('0x8'));var client=jayson[_0x7197('0x9')][_0x7197('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x10f498,_0x2da9b6,_0x174b26){return new BPromise(function(_0x38386c,_0x413d84){return client['request'](_0x10f498,_0x174b26)[_0x7197('0xb')](function(_0x1437b5){logger['info']('SugarcrmConfiguration,\x20%s,\x20%s',_0x2da9b6,_0x7197('0xc'));logger['debug']('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x2da9b6,_0x7197('0xc'),JSON[_0x7197('0xd')](_0x1437b5));if(_0x1437b5[_0x7197('0xe')]){if(_0x1437b5[_0x7197('0xe')][_0x7197('0xf')]===0x1f4){logger['error'](_0x7197('0x10'),_0x2da9b6,_0x1437b5[_0x7197('0xe')]['message']);return _0x413d84(_0x1437b5[_0x7197('0xe')][_0x7197('0x11')]);}logger[_0x7197('0xe')](_0x7197('0x10'),_0x2da9b6,_0x1437b5[_0x7197('0xe')][_0x7197('0x11')]);return _0x38386c(_0x1437b5[_0x7197('0xe')][_0x7197('0x11')]);}else{logger[_0x7197('0x12')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x2da9b6,'request\x20sent');_0x38386c(_0x1437b5[_0x7197('0x13')][_0x7197('0x11')]);}})['catch'](function(_0xc37cd8){logger[_0x7197('0xe')](_0x7197('0x10'),_0x2da9b6,_0xc37cd8);_0x413d84(_0xc37cd8);});});} \ No newline at end of file +var _0x1215=['ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3ff9a9,_0x469643){var _0x105dfd=function(_0x21346e){while(--_0x21346e){_0x3ff9a9['push'](_0x3ff9a9['shift']());}};_0x105dfd(++_0x469643);}(_0x1215,0x10c));var _0x5121=function(_0x197fdd,_0x48aac0){_0x197fdd=_0x197fdd-0x0;var _0x501ce8=_0x1215[_0x197fdd];return _0x501ce8;};'use strict';var _=require(_0x5121('0x0'));var util=require(_0x5121('0x1'));var moment=require(_0x5121('0x2'));var BPromise=require(_0x5121('0x3'));var rs=require(_0x5121('0x4'));var fs=require('fs');var Redis=require(_0x5121('0x5'));var db=require(_0x5121('0x6'))['db'];var utils=require(_0x5121('0x7'));var logger=require('../../config/logger')(_0x5121('0x8'));var config=require('../../config/environment');var jayson=require(_0x5121('0x9'));var client=jayson[_0x5121('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x41b7e4,_0x8f4e5c,_0x67e568){return new BPromise(function(_0x59b1fb,_0x2cb8c7){return client['request'](_0x41b7e4,_0x67e568)[_0x5121('0xb')](function(_0x51b36a){logger[_0x5121('0xc')](_0x5121('0xd'),_0x8f4e5c,_0x5121('0xe'));logger[_0x5121('0xf')](_0x5121('0x10'),_0x8f4e5c,'request\x20sent',JSON[_0x5121('0x11')](_0x51b36a));if(_0x51b36a[_0x5121('0x12')]){if(_0x51b36a['error']['code']===0x1f4){logger[_0x5121('0x12')](_0x5121('0xd'),_0x8f4e5c,_0x51b36a['error'][_0x5121('0x13')]);return _0x2cb8c7(_0x51b36a[_0x5121('0x12')][_0x5121('0x13')]);}logger[_0x5121('0x12')](_0x5121('0xd'),_0x8f4e5c,_0x51b36a['error'][_0x5121('0x13')]);return _0x59b1fb(_0x51b36a[_0x5121('0x12')]['message']);}else{logger[_0x5121('0xc')](_0x5121('0xd'),_0x8f4e5c,_0x5121('0xe'));_0x59b1fb(_0x51b36a['result'][_0x5121('0x13')]);}})[_0x5121('0x14')](function(_0x406aa9){logger[_0x5121('0x12')](_0x5121('0xd'),_0x8f4e5c,_0x406aa9);_0x2cb8c7(_0x406aa9);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index e9a3467..fe52a0f 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 _0x4aee=['exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','post','create','put','/:id','update','destroy'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x4aee,0x71));var _0xe4ae=function(_0x1ee87c,_0x16c441){_0x1ee87c=_0x1ee87c-0x0;var _0x26a817=_0x4aee[_0x1ee87c];return _0x26a817;};'use strict';var multer=require(_0xe4ae('0x0'));var util=require(_0xe4ae('0x1'));var path=require(_0xe4ae('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe4ae('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xe4ae('0x4'));var config=require(_0xe4ae('0x5'));var controller=require(_0xe4ae('0x6'));router['get']('/',auth[_0xe4ae('0x7')](),controller[_0xe4ae('0x8')]);router['get']('/:id',auth[_0xe4ae('0x7')](),controller['show']);router[_0xe4ae('0x9')]('/',auth[_0xe4ae('0x7')](),controller[_0xe4ae('0xa')]);router[_0xe4ae('0xb')](_0xe4ae('0xc'),auth[_0xe4ae('0x7')](),controller[_0xe4ae('0xd')]);router['delete'](_0xe4ae('0xc'),auth[_0xe4ae('0x7')](),controller[_0xe4ae('0xe')]);module[_0xe4ae('0xf')]=router; \ No newline at end of file +var _0x0ac6=['exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','isAuthenticated','index','/:id','show','post','create','delete','destroy'];(function(_0x38b2d9,_0x19fd42){var _0x23a3e1=function(_0xd8192f){while(--_0xd8192f){_0x38b2d9['push'](_0x38b2d9['shift']());}};_0x23a3e1(++_0x19fd42);}(_0x0ac6,0x19f));var _0x60ac=function(_0x502982,_0x32d146){_0x502982=_0x502982-0x0;var _0x6864cf=_0x0ac6[_0x502982];return _0x6864cf;};'use strict';var multer=require(_0x60ac('0x0'));var util=require(_0x60ac('0x1'));var path=require(_0x60ac('0x2'));var timeout=require('connect-timeout');var express=require(_0x60ac('0x3'));var router=express[_0x60ac('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x60ac('0x5'));var config=require(_0x60ac('0x6'));var controller=require(_0x60ac('0x7'));router[_0x60ac('0x8')]('/',auth[_0x60ac('0x9')](),controller[_0x60ac('0xa')]);router[_0x60ac('0x8')](_0x60ac('0xb'),auth[_0x60ac('0x9')](),controller[_0x60ac('0xc')]);router[_0x60ac('0xd')]('/',auth[_0x60ac('0x9')](),controller[_0x60ac('0xe')]);router['put'](_0x60ac('0xb'),auth[_0x60ac('0x9')](),controller['update']);router[_0x60ac('0xf')](_0x60ac('0xb'),auth[_0x60ac('0x9')](),controller[_0x60ac('0x10')]);module[_0x60ac('0x11')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index cd44b5b..a3c7311 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 _0x6c7b=['ENUM','customVariable','BOOLEAN','sequelize','variable','keyValue','string','STRING'];(function(_0x31cc0e,_0x24ba4c){var _0x144862=function(_0x4d236e){while(--_0x4d236e){_0x31cc0e['push'](_0x31cc0e['shift']());}};_0x144862(++_0x24ba4c);}(_0x6c7b,0x10b));var _0xb6c7=function(_0x593141,_0x55b80b){_0x593141=_0x593141-0x0;var _0x3e49da=_0x6c7b[_0x593141];return _0x3e49da;};'use strict';var Sequelize=require(_0xb6c7('0x0'));module['exports']={'type':{'type':Sequelize['ENUM']('string',_0xb6c7('0x1'),'customVariable',_0xb6c7('0x2')),'defaultValue':_0xb6c7('0x3')},'content':{'type':Sequelize[_0xb6c7('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xb6c7('0x5')](_0xb6c7('0x3'),_0xb6c7('0x1'),_0xb6c7('0x6'))},'keyContent':{'type':Sequelize[_0xb6c7('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb6c7('0x4')]},'customField':{'type':Sequelize[_0xb6c7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb6c7('0x4')]}}; \ No newline at end of file +var _0x0dec=['customVariable','STRING','variable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0xc3ae49,_0xdbdac){var _0x312813=function(_0xb79399){while(--_0xb79399){_0xc3ae49['push'](_0xc3ae49['shift']());}};_0x312813(++_0xdbdac);}(_0x0dec,0x11c));var _0xc0de=function(_0x3018ab,_0x4fdd9c){_0x3018ab=_0x3018ab-0x0;var _0x2f0631=_0x0dec[_0x3018ab];return _0x2f0631;};'use strict';var Sequelize=require(_0xc0de('0x0'));module[_0xc0de('0x1')]={'type':{'type':Sequelize[_0xc0de('0x2')](_0xc0de('0x3'),'variable',_0xc0de('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize[_0xc0de('0x5')]},'key':{'type':Sequelize[_0xc0de('0x5')]},'keyType':{'type':Sequelize[_0xc0de('0x2')](_0xc0de('0x3'),_0xc0de('0x6'),_0xc0de('0x4'))},'keyContent':{'type':Sequelize[_0xc0de('0x5')]},'idField':{'type':Sequelize[_0xc0de('0x5')]},'nameField':{'type':Sequelize[_0xc0de('0x5')]},'customField':{'type':Sequelize[_0xc0de('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xc0de('0x5')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 61c8323..bfd2cf5 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 _0x81d2=['json','apply','reject','update','then','sendStatus','error','stack','name','send','index','map','SugarcrmField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','params','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range'];(function(_0x40fbeb,_0x11d2d2){var _0x55f6d0=function(_0x38e588){while(--_0x38e588){_0x40fbeb['push'](_0x40fbeb['shift']());}};_0x55f6d0(++_0x11d2d2);}(_0x81d2,0x14d));var _0x281d=function(_0x190c7d,_0x56fdba){_0x190c7d=_0x190c7d-0x0;var _0x3918e8=_0x81d2[_0x190c7d];return _0x3918e8;};'use strict';var pdf=require(_0x281d('0x0'));var emlformat=require(_0x281d('0x1'));var rimraf=require(_0x281d('0x2'));var zipdir=require(_0x281d('0x3'));var jsonpatch=require(_0x281d('0x4'));var rp=require(_0x281d('0x5'));var moment=require(_0x281d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x281d('0x7'));var util=require('util');var path=require(_0x281d('0x8'));var sox=require(_0x281d('0x9'));var csv=require(_0x281d('0xa'));var ejs=require(_0x281d('0xb'));var fs=require('fs');var _=require(_0x281d('0xc'));var squel=require(_0x281d('0xd'));var crypto=require(_0x281d('0xe'));var jsforce=require(_0x281d('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x281d('0xa'));var querystring=require(_0x281d('0x10'));var Papa=require(_0x281d('0x11'));var Redis=require(_0x281d('0x12'));var authService=require(_0x281d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x281d('0x14'));var hardwareService=require(_0x281d('0x15'));var logger=require(_0x281d('0x16'))(_0x281d('0x17'));var utils=require(_0x281d('0x18'));var config=require(_0x281d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e312b,_0x5ad136){_0x5ad136=_0x5ad136||0xcc;return function(_0x507fac){if(_0x507fac){return _0x5e312b['sendStatus'](_0x5ad136);}return _0x5e312b[_0x281d('0x1a')](_0x5ad136)[_0x281d('0x1b')]();};}function respondWithResult(_0x2c0b58,_0x454b5e){_0x454b5e=_0x454b5e||0xc8;return function(_0x4b390e){if(_0x4b390e){return _0x2c0b58[_0x281d('0x1a')](_0x454b5e)['json'](_0x4b390e);}};}function respondWithFilteredResult(_0x2f1662,_0x191bb2){return function(_0x2fbee8){if(_0x2fbee8){var _0x3a2ca2=_0x2fbee8[_0x281d('0x1c')],_0x1d9aa1=_0x191bb2[_0x281d('0x1d')],_0x300546=_0x191bb2[_0x281d('0x1d')]+_0x191bb2[_0x281d('0x1e')],_0x3ed35d;if(_0x300546>=_0x3a2ca2){_0x300546=_0x3a2ca2;_0x3ed35d=0xc8;}else{_0x3ed35d=0xce;}_0x2f1662['status'](_0x3ed35d);return _0x2f1662['set'](_0x281d('0x1f'),_0x1d9aa1+'-'+_0x300546+'/'+_0x3a2ca2)[_0x281d('0x20')](_0x2fbee8);}return null;};}function patchUpdates(_0x5464e2){return function(_0xe2d26d){try{jsonpatch[_0x281d('0x21')](_0xe2d26d,_0x5464e2,!![]);}catch(_0xf8debd){return BPromise[_0x281d('0x22')](_0xf8debd);}return _0xe2d26d['save']();};}function saveUpdates(_0x4f884f,_0x597993){return function(_0x42b981){if(_0x42b981){return _0x42b981[_0x281d('0x23')](_0x4f884f)[_0x281d('0x24')](function(_0x1b8d36){return _0x1b8d36;});}return null;};}function removeEntity(_0x1e2747,_0x523484){return function(_0x1b2845){if(_0x1b2845){return _0x1b2845['destroy']()[_0x281d('0x24')](function(){_0x1e2747[_0x281d('0x1a')](0xcc)[_0x281d('0x1b')]();});}};}function handleEntityNotFound(_0x4589b9,_0x2d3b23){return function(_0x1d6968){if(!_0x1d6968){_0x4589b9[_0x281d('0x25')](0x194);}return _0x1d6968;};}function handleError(_0x2037c3,_0x3633b1){_0x3633b1=_0x3633b1||0x1f4;return function(_0xabe14b){logger[_0x281d('0x26')](_0xabe14b[_0x281d('0x27')]);if(_0xabe14b[_0x281d('0x28')]){delete _0xabe14b['name'];}_0x2037c3[_0x281d('0x1a')](_0x3633b1)[_0x281d('0x29')](_0xabe14b);};}exports[_0x281d('0x2a')]=function(_0x5d99ae,_0x20f8b8){var _0x76768c={},_0x99e747={},_0x55ff96={'count':0x0,'rows':[]};var _0x35fa8e=_[_0x281d('0x2b')](db[_0x281d('0x2c')]['rawAttributes'],function(_0x48d424){return{'name':_0x48d424[_0x281d('0x2d')],'type':_0x48d424[_0x281d('0x2e')][_0x281d('0x2f')]};});_0x99e747[_0x281d('0x30')]=_[_0x281d('0x2b')](_0x35fa8e,'name');_0x99e747[_0x281d('0x31')]=_[_0x281d('0x32')](_0x5d99ae[_0x281d('0x31')]);_0x99e747[_0x281d('0x33')]=_[_0x281d('0x34')](_0x99e747[_0x281d('0x30')],_0x99e747['query']);_0x76768c[_0x281d('0x35')]=_[_0x281d('0x34')](_0x99e747[_0x281d('0x30')],qs[_0x281d('0x36')](_0x5d99ae[_0x281d('0x31')][_0x281d('0x36')]));_0x76768c['attributes']=_0x76768c[_0x281d('0x35')][_0x281d('0x37')]?_0x76768c['attributes']:_0x99e747[_0x281d('0x30')];if(!_0x5d99ae[_0x281d('0x31')]['hasOwnProperty'](_0x281d('0x38'))){_0x76768c[_0x281d('0x1e')]=qs['limit'](_0x5d99ae[_0x281d('0x31')][_0x281d('0x1e')]);_0x76768c[_0x281d('0x1d')]=qs['offset'](_0x5d99ae[_0x281d('0x31')]['offset']);}_0x76768c['order']=qs['sort'](_0x5d99ae[_0x281d('0x31')][_0x281d('0x39')]);_0x76768c[_0x281d('0x3a')]=qs[_0x281d('0x33')](_[_0x281d('0x3b')](_0x5d99ae[_0x281d('0x31')],_0x99e747['filters']));if(_0x5d99ae['query'][_0x281d('0x3c')]){_0x76768c[_0x281d('0x3a')]=_[_0x281d('0x3d')](_0x76768c['where'],{'$or':_[_0x281d('0x2b')](_0x35fa8e,function(_0x3d73be){if(_0x3d73be[_0x281d('0x2e')]!=='VIRTUAL'){var _0x30caf4={};_0x30caf4[_0x3d73be[_0x281d('0x28')]]={'$like':'%'+_0x5d99ae[_0x281d('0x31')]['filter']+'%'};return _0x30caf4;}})});}_0x76768c=_[_0x281d('0x3d')]({},_0x76768c,_0x5d99ae['options']);var _0x57d29e={'where':_0x76768c['where']};return db['SugarcrmField'][_0x281d('0x1c')](_0x57d29e)['then'](function(_0x250a4b){_0x55ff96[_0x281d('0x1c')]=_0x250a4b;if(_0x5d99ae[_0x281d('0x31')][_0x281d('0x3e')]){_0x76768c[_0x281d('0x3f')]=[{'all':!![]}];}return db[_0x281d('0x2c')][_0x281d('0x40')](_0x76768c);})[_0x281d('0x24')](function(_0xd39caf){_0x55ff96[_0x281d('0x41')]=_0xd39caf;return _0x55ff96;})['then'](respondWithFilteredResult(_0x20f8b8,_0x76768c))[_0x281d('0x42')](handleError(_0x20f8b8,null));};exports[_0x281d('0x43')]=function(_0x3d6091,_0x303d58){var _0x4b846f={'raw':!![],'where':{'id':_0x3d6091[_0x281d('0x44')]['id']}},_0x1e1cf4={};_0x1e1cf4['model']=_[_0x281d('0x32')](db[_0x281d('0x2c')]['rawAttributes']);_0x1e1cf4[_0x281d('0x31')]=_[_0x281d('0x32')](_0x3d6091[_0x281d('0x31')]);_0x1e1cf4[_0x281d('0x33')]=_[_0x281d('0x34')](_0x1e1cf4[_0x281d('0x30')],_0x1e1cf4[_0x281d('0x31')]);_0x4b846f['attributes']=_[_0x281d('0x34')](_0x1e1cf4[_0x281d('0x30')],qs['fields'](_0x3d6091[_0x281d('0x31')][_0x281d('0x36')]));_0x4b846f[_0x281d('0x35')]=_0x4b846f[_0x281d('0x35')][_0x281d('0x37')]?_0x4b846f[_0x281d('0x35')]:_0x1e1cf4[_0x281d('0x30')];if(_0x3d6091[_0x281d('0x31')][_0x281d('0x3e')]){_0x4b846f[_0x281d('0x3f')]=[{'all':!![]}];}_0x4b846f=_[_0x281d('0x3d')]({},_0x4b846f,_0x3d6091['options']);return db[_0x281d('0x2c')][_0x281d('0x45')](_0x4b846f)['then'](handleEntityNotFound(_0x303d58,null))[_0x281d('0x24')](respondWithResult(_0x303d58,null))[_0x281d('0x42')](handleError(_0x303d58,null));};exports[_0x281d('0x46')]=function(_0x50567b,_0x4f638e){return db[_0x281d('0x2c')][_0x281d('0x46')](_0x50567b['body'],{})['then'](respondWithResult(_0x4f638e,0xc9))[_0x281d('0x42')](handleError(_0x4f638e,null));};exports[_0x281d('0x23')]=function(_0x271085,_0x25605f){if(_0x271085[_0x281d('0x47')]['id']){delete _0x271085[_0x281d('0x47')]['id'];}return db[_0x281d('0x2c')][_0x281d('0x45')]({'where':{'id':_0x271085[_0x281d('0x44')]['id']}})[_0x281d('0x24')](handleEntityNotFound(_0x25605f,null))['then'](saveUpdates(_0x271085[_0x281d('0x47')],null))['then'](respondWithResult(_0x25605f,null))['catch'](handleError(_0x25605f,null));};exports[_0x281d('0x48')]=function(_0x382be3,_0x160d25){return db['SugarcrmField'][_0x281d('0x45')]({'where':{'id':_0x382be3[_0x281d('0x44')]['id']}})['then'](handleEntityNotFound(_0x160d25,null))[_0x281d('0x24')](removeEntity(_0x160d25,null))[_0x281d('0x42')](handleError(_0x160d25,null));}; \ No newline at end of file +var _0xff8f=['type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','include','SugarcrmField','findAll','rows','catch','show','params','keys','options','create','body','find','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','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x548af0,_0x2f9fd8){var _0x595aeb=function(_0x25ba45){while(--_0x25ba45){_0x548af0['push'](_0x548af0['shift']());}};_0x595aeb(++_0x2f9fd8);}(_0xff8f,0x155));var _0xfff8=function(_0x22f052,_0x83641d){_0x22f052=_0x22f052-0x0;var _0x43b5f6=_0xff8f[_0x22f052];return _0x43b5f6;};'use strict';var pdf=require(_0xfff8('0x0'));var emlformat=require(_0xfff8('0x1'));var rimraf=require(_0xfff8('0x2'));var zipdir=require(_0xfff8('0x3'));var jsonpatch=require(_0xfff8('0x4'));var rp=require(_0xfff8('0x5'));var moment=require(_0xfff8('0x6'));var BPromise=require(_0xfff8('0x7'));var Mustache=require(_0xfff8('0x8'));var util=require(_0xfff8('0x9'));var path=require(_0xfff8('0xa'));var sox=require(_0xfff8('0xb'));var csv=require(_0xfff8('0xc'));var ejs=require(_0xfff8('0xd'));var fs=require('fs');var _=require(_0xfff8('0xe'));var squel=require(_0xfff8('0xf'));var crypto=require(_0xfff8('0x10'));var jsforce=require(_0xfff8('0x11'));var deskjs=require(_0xfff8('0x12'));var toCsv=require('to-csv');var querystring=require(_0xfff8('0x13'));var Papa=require(_0xfff8('0x14'));var Redis=require(_0xfff8('0x15'));var authService=require(_0xfff8('0x16'));var qs=require(_0xfff8('0x17'));var as=require(_0xfff8('0x18'));var hardwareService=require(_0xfff8('0x19'));var logger=require('../../config/logger')(_0xfff8('0x1a'));var utils=require(_0xfff8('0x1b'));var config=require(_0xfff8('0x1c'));var db=require(_0xfff8('0x1d'))['db'];function respondWithStatusCode(_0x1ab6cc,_0x561e37){_0x561e37=_0x561e37||0xcc;return function(_0x4425c2){if(_0x4425c2){return _0x1ab6cc[_0xfff8('0x1e')](_0x561e37);}return _0x1ab6cc[_0xfff8('0x1f')](_0x561e37)[_0xfff8('0x20')]();};}function respondWithResult(_0x395284,_0x22de9d){_0x22de9d=_0x22de9d||0xc8;return function(_0x1b3b34){if(_0x1b3b34){return _0x395284[_0xfff8('0x1f')](_0x22de9d)[_0xfff8('0x21')](_0x1b3b34);}};}function respondWithFilteredResult(_0x3c22c8,_0x418f3c){return function(_0x13b6b6){if(_0x13b6b6){var _0x150586=_0x13b6b6[_0xfff8('0x22')],_0x2a57cd=_0x418f3c[_0xfff8('0x23')],_0x2de74a=_0x418f3c[_0xfff8('0x23')]+_0x418f3c[_0xfff8('0x24')],_0x42a34a;if(_0x2de74a>=_0x150586){_0x2de74a=_0x150586;_0x42a34a=0xc8;}else{_0x42a34a=0xce;}_0x3c22c8[_0xfff8('0x1f')](_0x42a34a);return _0x3c22c8['set']('Content-Range',_0x2a57cd+'-'+_0x2de74a+'/'+_0x150586)[_0xfff8('0x21')](_0x13b6b6);}return null;};}function patchUpdates(_0x472e68){return function(_0x4d3787){try{jsonpatch[_0xfff8('0x25')](_0x4d3787,_0x472e68,!![]);}catch(_0x2926e4){return BPromise[_0xfff8('0x26')](_0x2926e4);}return _0x4d3787[_0xfff8('0x27')]();};}function saveUpdates(_0x169230,_0x21172f){return function(_0x5cb882){if(_0x5cb882){return _0x5cb882[_0xfff8('0x28')](_0x169230)[_0xfff8('0x29')](function(_0x55321d){return _0x55321d;});}return null;};}function removeEntity(_0x59b3c6,_0xcc546){return function(_0x45fb9f){if(_0x45fb9f){return _0x45fb9f[_0xfff8('0x2a')]()['then'](function(){_0x59b3c6[_0xfff8('0x1f')](0xcc)[_0xfff8('0x20')]();});}};}function handleEntityNotFound(_0x5edf5a,_0x4ca390){return function(_0x44b2a2){if(!_0x44b2a2){_0x5edf5a[_0xfff8('0x1e')](0x194);}return _0x44b2a2;};}function handleError(_0x55a4c9,_0x1d87cc){_0x1d87cc=_0x1d87cc||0x1f4;return function(_0x3a90ca){logger[_0xfff8('0x2b')](_0x3a90ca[_0xfff8('0x2c')]);if(_0x3a90ca['name']){delete _0x3a90ca[_0xfff8('0x2d')];}_0x55a4c9[_0xfff8('0x1f')](_0x1d87cc)[_0xfff8('0x2e')](_0x3a90ca);};}exports[_0xfff8('0x2f')]=function(_0x298436,_0x432170){var _0x21e61e={},_0x20a53b={},_0x131b46={'count':0x0,'rows':[]};var _0x109282=_[_0xfff8('0x30')](db['SugarcrmField']['rawAttributes'],function(_0x406ebc){return{'name':_0x406ebc['fieldName'],'type':_0x406ebc[_0xfff8('0x31')][_0xfff8('0x32')]};});_0x20a53b['model']=_[_0xfff8('0x30')](_0x109282,_0xfff8('0x2d'));_0x20a53b['query']=_['keys'](_0x298436[_0xfff8('0x33')]);_0x20a53b['filters']=_[_0xfff8('0x34')](_0x20a53b[_0xfff8('0x35')],_0x20a53b[_0xfff8('0x33')]);_0x21e61e[_0xfff8('0x36')]=_[_0xfff8('0x34')](_0x20a53b[_0xfff8('0x35')],qs[_0xfff8('0x37')](_0x298436[_0xfff8('0x33')][_0xfff8('0x37')]));_0x21e61e[_0xfff8('0x36')]=_0x21e61e[_0xfff8('0x36')][_0xfff8('0x38')]?_0x21e61e[_0xfff8('0x36')]:_0x20a53b[_0xfff8('0x35')];if(!_0x298436[_0xfff8('0x33')][_0xfff8('0x39')](_0xfff8('0x3a'))){_0x21e61e[_0xfff8('0x24')]=qs[_0xfff8('0x24')](_0x298436[_0xfff8('0x33')][_0xfff8('0x24')]);_0x21e61e[_0xfff8('0x23')]=qs[_0xfff8('0x23')](_0x298436['query'][_0xfff8('0x23')]);}_0x21e61e[_0xfff8('0x3b')]=qs[_0xfff8('0x3c')](_0x298436[_0xfff8('0x33')]['sort']);_0x21e61e[_0xfff8('0x3d')]=qs[_0xfff8('0x3e')](_['pick'](_0x298436['query'],_0x20a53b[_0xfff8('0x3e')]));if(_0x298436['query'][_0xfff8('0x3f')]){_0x21e61e['where']=_[_0xfff8('0x40')](_0x21e61e[_0xfff8('0x3d')],{'$or':_['map'](_0x109282,function(_0x289165){if(_0x289165[_0xfff8('0x31')]!=='VIRTUAL'){var _0x781cd0={};_0x781cd0[_0x289165[_0xfff8('0x2d')]]={'$like':'%'+_0x298436[_0xfff8('0x33')][_0xfff8('0x3f')]+'%'};return _0x781cd0;}})});}_0x21e61e=_[_0xfff8('0x40')]({},_0x21e61e,_0x298436['options']);var _0x3c9385={'where':_0x21e61e['where']};return db['SugarcrmField'][_0xfff8('0x22')](_0x3c9385)[_0xfff8('0x29')](function(_0x4ea60a){_0x131b46['count']=_0x4ea60a;if(_0x298436[_0xfff8('0x33')][_0xfff8('0x41')]){_0x21e61e[_0xfff8('0x42')]=[{'all':!![]}];}return db[_0xfff8('0x43')][_0xfff8('0x44')](_0x21e61e);})[_0xfff8('0x29')](function(_0xed0428){_0x131b46[_0xfff8('0x45')]=_0xed0428;return _0x131b46;})['then'](respondWithFilteredResult(_0x432170,_0x21e61e))[_0xfff8('0x46')](handleError(_0x432170,null));};exports[_0xfff8('0x47')]=function(_0x13b53b,_0xf126c7){var _0x24770c={'raw':!![],'where':{'id':_0x13b53b[_0xfff8('0x48')]['id']}},_0x1e2a74={};_0x1e2a74[_0xfff8('0x35')]=_[_0xfff8('0x49')](db[_0xfff8('0x43')]['rawAttributes']);_0x1e2a74[_0xfff8('0x33')]=_[_0xfff8('0x49')](_0x13b53b['query']);_0x1e2a74[_0xfff8('0x3e')]=_[_0xfff8('0x34')](_0x1e2a74['model'],_0x1e2a74['query']);_0x24770c[_0xfff8('0x36')]=_[_0xfff8('0x34')](_0x1e2a74[_0xfff8('0x35')],qs[_0xfff8('0x37')](_0x13b53b['query']['fields']));_0x24770c[_0xfff8('0x36')]=_0x24770c['attributes'][_0xfff8('0x38')]?_0x24770c[_0xfff8('0x36')]:_0x1e2a74[_0xfff8('0x35')];if(_0x13b53b['query'][_0xfff8('0x41')]){_0x24770c[_0xfff8('0x42')]=[{'all':!![]}];}_0x24770c=_[_0xfff8('0x40')]({},_0x24770c,_0x13b53b[_0xfff8('0x4a')]);return db[_0xfff8('0x43')]['find'](_0x24770c)['then'](handleEntityNotFound(_0xf126c7,null))[_0xfff8('0x29')](respondWithResult(_0xf126c7,null))['catch'](handleError(_0xf126c7,null));};exports[_0xfff8('0x4b')]=function(_0x5110dd,_0x31e2a2){return db[_0xfff8('0x43')][_0xfff8('0x4b')](_0x5110dd['body'],{})[_0xfff8('0x29')](respondWithResult(_0x31e2a2,0xc9))[_0xfff8('0x46')](handleError(_0x31e2a2,null));};exports[_0xfff8('0x28')]=function(_0x1407dd,_0x3bfd3e){if(_0x1407dd[_0xfff8('0x4c')]['id']){delete _0x1407dd[_0xfff8('0x4c')]['id'];}return db[_0xfff8('0x43')][_0xfff8('0x4d')]({'where':{'id':_0x1407dd['params']['id']}})[_0xfff8('0x29')](handleEntityNotFound(_0x3bfd3e,null))[_0xfff8('0x29')](saveUpdates(_0x1407dd[_0xfff8('0x4c')],null))[_0xfff8('0x29')](respondWithResult(_0x3bfd3e,null))[_0xfff8('0x46')](handleError(_0x3bfd3e,null));};exports[_0xfff8('0x2a')]=function(_0x401e31,_0x4158c3){return db['SugarcrmField'][_0xfff8('0x4d')]({'where':{'id':_0x401e31[_0xfff8('0x48')]['id']}})[_0xfff8('0x29')](handleEntityNotFound(_0x4158c3,null))[_0xfff8('0x29')](removeEntity(_0x4158c3,null))['catch'](handleError(_0x4158c3,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 03f9197..a47dd2c 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 _0xe580=['int_sugarcrm_fields','sugarcrm_unique_index','FieldId','api','moment','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField'];(function(_0x4e5970,_0x30d897){var _0x30b9fa=function(_0x5bc6f2){while(--_0x5bc6f2){_0x4e5970['push'](_0x4e5970['shift']());}};_0x30b9fa(++_0x30d897);}(_0xe580,0xdb));var _0x0e58=function(_0x4d2876,_0xee3f7b){_0x4d2876=_0x4d2876-0x0;var _0x7038f1=_0xe580[_0x4d2876];return _0x7038f1;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x0e58('0x0'));var moment=require(_0x0e58('0x1'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x0e58('0x2'));var rimraf=require(_0x0e58('0x3'));var config=require(_0x0e58('0x4'));var attributes=require(_0x0e58('0x5'));module[_0x0e58('0x6')]=function(_0x52a040,_0x2b0f68){return _0x52a040[_0x0e58('0x7')](_0x0e58('0x8'),attributes,{'tableName':_0x0e58('0x9'),'paranoid':![],'indexes':[{'name':_0x0e58('0xa'),'fields':['idField',_0x0e58('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x92c9=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmField.attributes','exports','define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index'];(function(_0x8f2a5b,_0x294ac4){var _0x1e5c91=function(_0x24640b){while(--_0x24640b){_0x8f2a5b['push'](_0x8f2a5b['shift']());}};_0x1e5c91(++_0x294ac4);}(_0x92c9,0xc4));var _0x992c=function(_0x90b1b1,_0x3c996d){_0x90b1b1=_0x90b1b1-0x0;var _0x2f23dc=_0x92c9[_0x90b1b1];return _0x2f23dc;};'use strict';var _=require(_0x992c('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x992c('0x1'));var moment=require(_0x992c('0x2'));var BPromise=require(_0x992c('0x3'));var rp=require(_0x992c('0x4'));var fs=require('fs');var path=require(_0x992c('0x5'));var rimraf=require(_0x992c('0x6'));var config=require(_0x992c('0x7'));var attributes=require(_0x992c('0x8'));module[_0x992c('0x9')]=function(_0x23588a,_0x9c50bc){return _0x23588a[_0x992c('0xa')](_0x992c('0xb'),attributes,{'tableName':_0x992c('0xc'),'paranoid':![],'indexes':[{'name':_0x992c('0xd'),'fields':['idField','FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.rpc.js b/server/api/intSugarcrmField/intSugarcrmField.rpc.js index 2e41e4b..d8a811c 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 _0x14a0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','then','debug','request\x20sent','stringify','error','code','SugarcrmField,\x20%s,\x20%s','message','info','result','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x2b6e4b,_0x1cb37a){var _0x36f0a9=function(_0x4bf61c){while(--_0x4bf61c){_0x2b6e4b['push'](_0x2b6e4b['shift']());}};_0x36f0a9(++_0x1cb37a);}(_0x14a0,0x8e));var _0x014a=function(_0x4f1029,_0x8d1b61){_0x4f1029=_0x4f1029-0x0;var _0x2d9245=_0x14a0[_0x4f1029];return _0x2d9245;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5a61ac,_0x11b8ce,_0x6d05f2){return new BPromise(function(_0x22f17c,_0x4d943b){return client['request'](_0x5a61ac,_0x6d05f2)[_0x014a('0xa')](function(_0x4f5506){logger['info']('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,'request\x20sent');logger[_0x014a('0xb')]('SugarcrmField,\x20%s,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'),JSON[_0x014a('0xd')](_0x4f5506));if(_0x4f5506['error']){if(_0x4f5506[_0x014a('0xe')][_0x014a('0xf')]===0x1f4){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x4d943b(_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);}logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x4f5506[_0x014a('0xe')][_0x014a('0x11')]);return _0x22f17c(_0x4f5506['error'][_0x014a('0x11')]);}else{logger[_0x014a('0x12')]('SugarcrmField,\x20%s,\x20%s',_0x11b8ce,_0x014a('0xc'));_0x22f17c(_0x4f5506[_0x014a('0x13')]['message']);}})[_0x014a('0x14')](function(_0x17e4be){logger[_0x014a('0xe')](_0x014a('0x10'),_0x11b8ce,_0x17e4be);_0x4d943b(_0x17e4be);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x531369,_0x60c9e5){var _0x263fcb=function(_0x4c2489){while(--_0x4c2489){_0x531369['push'](_0x531369['shift']());}};_0x263fcb(++_0x60c9e5);}(_0xb10b,0x12a));var _0xbb10=function(_0x96b6a,_0x12471d){_0x96b6a=_0x96b6a-0x0;var _0x3e16f3=_0xb10b[_0x96b6a];return _0x3e16f3;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index 1bde52e..d0614c9 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 _0x3ba3=['delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerAccount.controller','isAuthenticated','index','get','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','update'];(function(_0x366a15,_0x185b91){var _0x4ca3d5=function(_0x20a75c){while(--_0x20a75c){_0x366a15['push'](_0x366a15['shift']());}};_0x4ca3d5(++_0x185b91);}(_0x3ba3,0x92));var _0x33ba=function(_0x46ad9e,_0xe81d7a){_0x46ad9e=_0x46ad9e-0x0;var _0x188f3c=_0x3ba3[_0x46ad9e];return _0x188f3c;};'use strict';var multer=require(_0x33ba('0x0'));var util=require(_0x33ba('0x1'));var path=require(_0x33ba('0x2'));var timeout=require('connect-timeout');var express=require(_0x33ba('0x3'));var router=express[_0x33ba('0x4')]();var auth=require(_0x33ba('0x5'));var interaction=require(_0x33ba('0x6'));var config=require(_0x33ba('0x7'));var controller=require(_0x33ba('0x8'));router['get']('/',auth[_0x33ba('0x9')](),controller[_0x33ba('0xa')]);router[_0x33ba('0xb')](_0x33ba('0xc'),auth[_0x33ba('0x9')](),controller['show']);router[_0x33ba('0xb')](_0x33ba('0xd'),auth['isAuthenticated'](),controller[_0x33ba('0xe')]);router['get'](_0x33ba('0xf'),auth[_0x33ba('0x9')](),controller[_0x33ba('0x10')]);router[_0x33ba('0x11')]('/',auth[_0x33ba('0x9')](),controller[_0x33ba('0x12')]);router[_0x33ba('0x11')]('/:id/configurations',auth[_0x33ba('0x9')](),controller[_0x33ba('0x13')]);router[_0x33ba('0x14')](_0x33ba('0xc'),auth[_0x33ba('0x9')](),controller[_0x33ba('0x15')]);router[_0x33ba('0x16')](_0x33ba('0xc'),auth[_0x33ba('0x9')](),controller[_0x33ba('0x17')]);module['exports']=router; \ No newline at end of file +var _0xf020=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','delete'];(function(_0x4595fe,_0x4fa157){var _0x1c59f4=function(_0xb658fe){while(--_0xb658fe){_0x4595fe['push'](_0x4595fe['shift']());}};_0x1c59f4(++_0x4fa157);}(_0xf020,0xe8));var _0x0f02=function(_0x1469d6,_0xf3bfe0){_0x1469d6=_0x1469d6-0x0;var _0x43c674=_0xf020[_0x1469d6];return _0x43c674;};'use strict';var multer=require(_0x0f02('0x0'));var util=require(_0x0f02('0x1'));var path=require(_0x0f02('0x2'));var timeout=require(_0x0f02('0x3'));var express=require(_0x0f02('0x4'));var router=express[_0x0f02('0x5')]();var auth=require(_0x0f02('0x6'));var interaction=require(_0x0f02('0x7'));var config=require(_0x0f02('0x8'));var controller=require('./intVtigerAccount.controller');router[_0x0f02('0x9')]('/',auth[_0x0f02('0xa')](),controller[_0x0f02('0xb')]);router['get'](_0x0f02('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x0f02('0x9')](_0x0f02('0xd'),auth[_0x0f02('0xa')](),controller[_0x0f02('0xe')]);router[_0x0f02('0x9')]('/:id/fields',auth[_0x0f02('0xa')](),controller[_0x0f02('0xf')]);router[_0x0f02('0x10')]('/',auth['isAuthenticated'](),controller[_0x0f02('0x11')]);router[_0x0f02('0x10')](_0x0f02('0xd'),auth[_0x0f02('0xa')](),controller[_0x0f02('0x12')]);router[_0x0f02('0x13')](_0x0f02('0xc'),auth[_0x0f02('0xa')](),controller['update']);router[_0x0f02('0x14')](_0x0f02('0xc'),auth[_0x0f02('0xa')](),controller[_0x0f02('0x15')]);module[_0x0f02('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index 61fea0d..9ad46d1 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 _0xda2e=['STRING','HelpDesk','sequelize','exports'];(function(_0x4ab2a4,_0x4059a8){var _0x2d3851=function(_0x106de7){while(--_0x106de7){_0x4ab2a4['push'](_0x4ab2a4['shift']());}};_0x2d3851(++_0x4059a8);}(_0xda2e,0x11e));var _0xeda2=function(_0x2bafde,_0x39326c){_0x2bafde=_0x2bafde-0x0;var _0x5733dc=_0xda2e[_0x2bafde];return _0x5733dc;};'use strict';var Sequelize=require(_0xeda2('0x0'));module[_0xeda2('0x1')]={'name':{'type':Sequelize[_0xeda2('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xeda2('0x2')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0xeda2('0x2')],'allowNull':![],'defaultValue':_0xeda2('0x3')},'remoteUri':{'type':Sequelize[_0xeda2('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xeda2('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file +var _0x9121=['STRING','HelpDesk','sequelize','exports'];(function(_0x516ab7,_0xa4f854){var _0x9e50bb=function(_0xc295ef){while(--_0xc295ef){_0x516ab7['push'](_0x516ab7['shift']());}};_0x9e50bb(++_0xa4f854);}(_0x9121,0xba));var _0x1912=function(_0x3dcca0,_0x1bb0e9){_0x3dcca0=_0x3dcca0-0x0;var _0x35f8ad=_0x9121[_0x3dcca0];return _0x35f8ad;};'use strict';var Sequelize=require(_0x1912('0x0'));module[_0x1912('0x1')]={'name':{'type':Sequelize[_0x1912('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x1912('0x2')],'allowNull':![]},'moduleName':{'type':Sequelize[_0x1912('0x2')],'allowNull':![],'defaultValue':_0x1912('0x3')},'remoteUri':{'type':Sequelize[_0x1912('0x2')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x1912('0x2')]},'accessKey':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index 2ba41f3..b586d2b 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 _0x3ccb=['destroy','end','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','nolimit','offset','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','show','params','options','create','body','find','findOne','order','sort','getConfigurations','hasOwnProperty','AccountId','getSubjects','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','Subjects','md5','username','description','remoteUri','serverUrl','accessKey','moduleName','slice','substring','lastIndexOf','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','reference','owner','remove','includes','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','stringify','Wrong\x20credentials','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','Sequelize','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','VtigerAccount,\x20%s,\x20%s','message','result','catch','sendStatus','status','json','count','limit','set','reject','update','then'];(function(_0x54d506,_0x3f0796){var _0x3a0e91=function(_0x37996d){while(--_0x37996d){_0x54d506['push'](_0x54d506['shift']());}};_0x3a0e91(++_0x3f0796);}(_0x3ccb,0xd3));var _0xb3cc=function(_0x406618,_0xef5e1){_0x406618=_0x406618-0x0;var _0x58d993=_0x3ccb[_0x406618];return _0x58d993;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xb3cc('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xb3cc('0x1'));var jsonpatch=require(_0xb3cc('0x2'));var rp=require('request-promise');var moment=require(_0xb3cc('0x3'));var BPromise=require(_0xb3cc('0x4'));var Mustache=require(_0xb3cc('0x5'));var util=require(_0xb3cc('0x6'));var path=require(_0xb3cc('0x7'));var sox=require(_0xb3cc('0x8'));var csv=require('to-csv');var ejs=require(_0xb3cc('0x9'));var fs=require('fs');var _=require(_0xb3cc('0xa'));var squel=require(_0xb3cc('0xb'));var crypto=require(_0xb3cc('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xb3cc('0xd'));var querystring=require(_0xb3cc('0xe'));var Papa=require(_0xb3cc('0xf'));var Redis=require(_0xb3cc('0x10'));var authService=require(_0xb3cc('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb3cc('0x12'));var hardwareService=require(_0xb3cc('0x13'));var logger=require(_0xb3cc('0x14'))(_0xb3cc('0x15'));var utils=require(_0xb3cc('0x16'));var config=require(_0xb3cc('0x17'));var db=require(_0xb3cc('0x18'))['db'];var integrations=require(_0xb3cc('0x19'));var jayson=require(_0xb3cc('0x1a'));var client=jayson[_0xb3cc('0x1b')][_0xb3cc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x7aa745,_0x4defff,_0x1c5b7e){if(_0x1c5b7e){var _0x2c27c3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c27c3[_0xb3cc('0x1d')](_0x4defff)){return _0x7aa745;}else{throw new db[(_0xb3cc('0x1e'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x7aa745;}}function respondWithRpcPromise(_0x29cdee,_0x1f5c6f,_0x2f28f2,_0x379a8e){return new BPromise(function(_0x1ac99b,_0x1075db){var _0x753bdf=_0x379a8e||client;return _0x753bdf['request'](_0x29cdee,_0x2f28f2)['then'](function(_0x2264bc){logger[_0xb3cc('0x1f')]('VtigerAccount,\x20%s,\x20%s',_0x1f5c6f,_0xb3cc('0x20'));logger[_0xb3cc('0x21')](_0xb3cc('0x22'),_0x1f5c6f,'request\x20sent',JSON['stringify'](_0x2264bc));if(_0x2264bc[_0xb3cc('0x23')]){if(_0x2264bc[_0xb3cc('0x23')]['code']===0x1f4){logger['error'](_0xb3cc('0x24'),_0x1f5c6f,_0x2264bc['error'][_0xb3cc('0x25')]);return _0x1075db(_0x2264bc['error']['message']);}logger[_0xb3cc('0x23')](_0xb3cc('0x24'),_0x1f5c6f,_0x2264bc[_0xb3cc('0x23')][_0xb3cc('0x25')]);return _0x1ac99b(_0x2264bc[_0xb3cc('0x23')]['message']);}else{logger[_0xb3cc('0x1f')](_0xb3cc('0x24'),_0x1f5c6f,'request\x20sent');_0x1ac99b(_0x2264bc[_0xb3cc('0x26')][_0xb3cc('0x25')]);}})[_0xb3cc('0x27')](function(_0x163994){logger['error']('VtigerAccount,\x20%s,\x20%s',_0x1f5c6f,_0x163994);_0x1075db(_0x163994);});});}function respondWithStatusCode(_0x45e805,_0x4c863d){_0x4c863d=_0x4c863d||0xcc;return function(_0xbe365a){if(_0xbe365a){return _0x45e805[_0xb3cc('0x28')](_0x4c863d);}return _0x45e805[_0xb3cc('0x29')](_0x4c863d)['end']();};}function respondWithResult(_0x55e953,_0x21ccb1){_0x21ccb1=_0x21ccb1||0xc8;return function(_0x44067e){if(_0x44067e){return _0x55e953[_0xb3cc('0x29')](_0x21ccb1)[_0xb3cc('0x2a')](_0x44067e);}};}function respondWithFilteredResult(_0x3ab3e2,_0xb2270a){return function(_0xe7da70){if(_0xe7da70){var _0x105547=_0xe7da70[_0xb3cc('0x2b')],_0xfbcb30=_0xb2270a['offset'],_0x2a6a9d=_0xb2270a['offset']+_0xb2270a[_0xb3cc('0x2c')],_0x419c05;if(_0x2a6a9d>=_0x105547){_0x2a6a9d=_0x105547;_0x419c05=0xc8;}else{_0x419c05=0xce;}_0x3ab3e2['status'](_0x419c05);return _0x3ab3e2[_0xb3cc('0x2d')]('Content-Range',_0xfbcb30+'-'+_0x2a6a9d+'/'+_0x105547)['json'](_0xe7da70);}return null;};}function patchUpdates(_0x2e3d1d){return function(_0x1ddd6c){try{jsonpatch['apply'](_0x1ddd6c,_0x2e3d1d,!![]);}catch(_0x51b92a){return BPromise[_0xb3cc('0x2e')](_0x51b92a);}return _0x1ddd6c['save']();};}function saveUpdates(_0x445aff,_0x3654bc){return function(_0x57ed9a){if(_0x57ed9a){return _0x57ed9a[_0xb3cc('0x2f')](_0x445aff)[_0xb3cc('0x30')](function(_0x1b694e){return _0x1b694e;});}return null;};}function removeEntity(_0x4bbdd7,_0x305dfb){return function(_0x1d0451){if(_0x1d0451){return _0x1d0451[_0xb3cc('0x31')]()[_0xb3cc('0x30')](function(){_0x4bbdd7[_0xb3cc('0x29')](0xcc)[_0xb3cc('0x32')]();});}};}function handleEntityNotFound(_0x49cf33,_0x562c72){return function(_0x555b1a){if(!_0x555b1a){_0x49cf33['sendStatus'](0x194);}return _0x555b1a;};}function handleError(_0x5b46fd,_0x428f9d){_0x428f9d=_0x428f9d||0x1f4;return function(_0x3b3e47){logger[_0xb3cc('0x23')](_0x3b3e47['stack']);if(_0x3b3e47['name']){delete _0x3b3e47[_0xb3cc('0x33')];}_0x5b46fd['status'](_0x428f9d)[_0xb3cc('0x34')](_0x3b3e47);};}exports[_0xb3cc('0x35')]=function(_0x439185,_0x22bdc8){var _0x345626={},_0x20b4d9={},_0x51d662={'count':0x0,'rows':[]};var _0xb06878=_[_0xb3cc('0x36')](db[_0xb3cc('0x37')][_0xb3cc('0x38')],function(_0x5e3a51){return{'name':_0x5e3a51[_0xb3cc('0x39')],'type':_0x5e3a51[_0xb3cc('0x3a')]['key']};});_0x20b4d9[_0xb3cc('0x3b')]=_[_0xb3cc('0x36')](_0xb06878,'name');_0x20b4d9[_0xb3cc('0x3c')]=_[_0xb3cc('0x3d')](_0x439185[_0xb3cc('0x3c')]);_0x20b4d9[_0xb3cc('0x3e')]=_[_0xb3cc('0x3f')](_0x20b4d9[_0xb3cc('0x3b')],_0x20b4d9[_0xb3cc('0x3c')]);_0x345626['attributes']=_[_0xb3cc('0x3f')](_0x20b4d9[_0xb3cc('0x3b')],qs[_0xb3cc('0x40')](_0x439185[_0xb3cc('0x3c')][_0xb3cc('0x40')]));_0x345626[_0xb3cc('0x41')]=_0x345626['attributes'][_0xb3cc('0x42')]?_0x345626[_0xb3cc('0x41')]:_0x20b4d9[_0xb3cc('0x3b')];if(!_0x439185[_0xb3cc('0x3c')]['hasOwnProperty'](_0xb3cc('0x43'))){_0x345626[_0xb3cc('0x2c')]=qs[_0xb3cc('0x2c')](_0x439185[_0xb3cc('0x3c')][_0xb3cc('0x2c')]);_0x345626[_0xb3cc('0x44')]=qs[_0xb3cc('0x44')](_0x439185['query'][_0xb3cc('0x44')]);}_0x345626['order']=qs['sort'](_0x439185[_0xb3cc('0x3c')]['sort']);_0x345626[_0xb3cc('0x45')]=qs[_0xb3cc('0x3e')](_[_0xb3cc('0x46')](_0x439185[_0xb3cc('0x3c')],_0x20b4d9[_0xb3cc('0x3e')]));if(_0x439185[_0xb3cc('0x3c')][_0xb3cc('0x47')]){_0x345626[_0xb3cc('0x45')]=_[_0xb3cc('0x48')](_0x345626[_0xb3cc('0x45')],{'$or':_[_0xb3cc('0x36')](_0xb06878,function(_0x354286){if(_0x354286[_0xb3cc('0x3a')]!==_0xb3cc('0x49')){var _0xdde341={};_0xdde341[_0x354286[_0xb3cc('0x33')]]={'$like':'%'+_0x439185['query'][_0xb3cc('0x47')]+'%'};return _0xdde341;}})});}_0x345626=_['merge']({},_0x345626,_0x439185['options']);var _0x9931f8={'where':_0x345626[_0xb3cc('0x45')]};return db[_0xb3cc('0x37')][_0xb3cc('0x2b')](_0x9931f8)['then'](function(_0x37e49a){_0x51d662[_0xb3cc('0x2b')]=_0x37e49a;if(_0x439185['query'][_0xb3cc('0x4a')]){_0x345626['include']=[{'all':!![]}];}return db[_0xb3cc('0x37')][_0xb3cc('0x4b')](_0x345626);})[_0xb3cc('0x30')](function(_0x1acaac){_0x51d662[_0xb3cc('0x4c')]=_0x1acaac;return _0x51d662;})[_0xb3cc('0x30')](respondWithFilteredResult(_0x22bdc8,_0x345626))[_0xb3cc('0x27')](handleError(_0x22bdc8,null));};exports[_0xb3cc('0x4d')]=function(_0x49b229,_0x2e99f1){var _0x116860={'raw':![],'where':{'id':_0x49b229[_0xb3cc('0x4e')]['id']}},_0x30e1c6={};_0x30e1c6[_0xb3cc('0x3b')]=_['keys'](db['VtigerAccount'][_0xb3cc('0x38')]);_0x30e1c6[_0xb3cc('0x3c')]=_[_0xb3cc('0x3d')](_0x49b229[_0xb3cc('0x3c')]);_0x30e1c6[_0xb3cc('0x3e')]=_[_0xb3cc('0x3f')](_0x30e1c6['model'],_0x30e1c6['query']);_0x116860[_0xb3cc('0x41')]=_[_0xb3cc('0x3f')](_0x30e1c6[_0xb3cc('0x3b')],qs[_0xb3cc('0x40')](_0x49b229['query'][_0xb3cc('0x40')]));_0x116860[_0xb3cc('0x41')]=_0x116860[_0xb3cc('0x41')][_0xb3cc('0x42')]?_0x116860['attributes']:_0x30e1c6['model'];if(_0x49b229[_0xb3cc('0x3c')]['includeAll']){_0x116860['include']=[{'all':!![]}];}_0x116860=_[_0xb3cc('0x48')]({},_0x116860,_0x49b229[_0xb3cc('0x4f')]);return db['VtigerAccount']['find'](_0x116860)[_0xb3cc('0x30')](handleEntityNotFound(_0x2e99f1,null))[_0xb3cc('0x30')](respondWithResult(_0x2e99f1,null))[_0xb3cc('0x27')](handleError(_0x2e99f1,null));};exports['create']=function(_0x4e6b31,_0x2389c1){return db[_0xb3cc('0x37')][_0xb3cc('0x50')](_0x4e6b31['body'],{})[_0xb3cc('0x30')](respondWithResult(_0x2389c1,0xc9))[_0xb3cc('0x27')](handleError(_0x2389c1,null));};exports['update']=function(_0x239df5,_0xb4673d){if(_0x239df5[_0xb3cc('0x51')]['id']){delete _0x239df5[_0xb3cc('0x51')]['id'];}return db['VtigerAccount'][_0xb3cc('0x52')]({'where':{'id':_0x239df5[_0xb3cc('0x4e')]['id']}})[_0xb3cc('0x30')](handleEntityNotFound(_0xb4673d,null))['then'](saveUpdates(_0x239df5[_0xb3cc('0x51')],null))[_0xb3cc('0x30')](respondWithResult(_0xb4673d,null))['catch'](handleError(_0xb4673d,null));};exports[_0xb3cc('0x31')]=function(_0x36434f,_0x47bdf7){return db[_0xb3cc('0x37')]['find']({'where':{'id':_0x36434f[_0xb3cc('0x4e')]['id']}})[_0xb3cc('0x30')](handleEntityNotFound(_0x47bdf7,null))[_0xb3cc('0x30')](removeEntity(_0x47bdf7,null))[_0xb3cc('0x27')](handleError(_0x47bdf7,null));};exports['getConfigurations']=function(_0x378d86,_0x382cac,_0x49f2dc){var _0x46fa88={};var _0x37f8d8={};var _0x933abb;var _0x392ba7;return db[_0xb3cc('0x37')][_0xb3cc('0x53')]({'where':{'id':_0x378d86[_0xb3cc('0x4e')]['id']}})[_0xb3cc('0x30')](handleEntityNotFound(_0x382cac,null))[_0xb3cc('0x30')](function(_0x34f433){if(_0x34f433){_0x933abb=_0x34f433;_0x37f8d8['model']=_[_0xb3cc('0x3d')](db['VtigerConfiguration'][_0xb3cc('0x38')]);_0x37f8d8[_0xb3cc('0x3c')]=_['keys'](_0x378d86[_0xb3cc('0x3c')]);_0x37f8d8[_0xb3cc('0x3e')]=_[_0xb3cc('0x3f')](_0x37f8d8[_0xb3cc('0x3b')],_0x37f8d8[_0xb3cc('0x3c')]);_0x46fa88[_0xb3cc('0x41')]=_[_0xb3cc('0x3f')](_0x37f8d8[_0xb3cc('0x3b')],qs['fields'](_0x378d86[_0xb3cc('0x3c')][_0xb3cc('0x40')]));_0x46fa88[_0xb3cc('0x41')]=_0x46fa88[_0xb3cc('0x41')][_0xb3cc('0x42')]?_0x46fa88[_0xb3cc('0x41')]:_0x37f8d8[_0xb3cc('0x3b')];_0x46fa88[_0xb3cc('0x54')]=qs[_0xb3cc('0x55')](_0x378d86[_0xb3cc('0x3c')][_0xb3cc('0x55')]);_0x46fa88['where']=qs[_0xb3cc('0x3e')](_[_0xb3cc('0x46')](_0x378d86[_0xb3cc('0x3c')],_0x37f8d8[_0xb3cc('0x3e')]));if(_0x378d86['query'][_0xb3cc('0x47')]){_0x46fa88['where']=_['merge'](_0x46fa88[_0xb3cc('0x45')],{'$or':_[_0xb3cc('0x36')](_0x46fa88[_0xb3cc('0x41')],function(_0x1f56ea){var _0x4bf1fa={};_0x4bf1fa[_0x1f56ea]={'$like':'%'+_0x378d86['query']['filter']+'%'};return _0x4bf1fa;})});}_0x46fa88=_[_0xb3cc('0x48')]({},_0x46fa88,_0x378d86[_0xb3cc('0x4f')]);return _0x933abb[_0xb3cc('0x56')](_0x46fa88);}})[_0xb3cc('0x30')](function(_0x4aef38){if(_0x4aef38){_0x392ba7=_0x4aef38['length'];if(!_0x378d86[_0xb3cc('0x3c')][_0xb3cc('0x57')]('nolimit')){_0x46fa88[_0xb3cc('0x2c')]=qs[_0xb3cc('0x2c')](_0x378d86['query'][_0xb3cc('0x2c')]);_0x46fa88[_0xb3cc('0x44')]=qs[_0xb3cc('0x44')](_0x378d86[_0xb3cc('0x3c')][_0xb3cc('0x44')]);}return _0x933abb['getConfigurations'](_0x46fa88);}})[_0xb3cc('0x30')](function(_0x23c981){if(_0x23c981){return _0x23c981?{'count':_0x392ba7,'rows':_0x23c981}:null;}})[_0xb3cc('0x30')](respondWithResult(_0x382cac,null))[_0xb3cc('0x27')](handleError(_0x382cac,null));};exports['addConfiguration']=function(_0x31612,_0x27c990,_0x342621){if(_0x31612['body']['id']){delete _0x31612[_0xb3cc('0x51')]['id'];}return db[_0xb3cc('0x37')][_0xb3cc('0x53')]({'where':{'id':_0x31612['params']['id']}})[_0xb3cc('0x30')](handleEntityNotFound(_0x27c990,null))[_0xb3cc('0x30')](function(_0x294247){if(_0x294247){_0x31612[_0xb3cc('0x51')][_0xb3cc('0x58')]=_0x294247['id'];_0x31612[_0xb3cc('0x51')]['Subjects']=integrations[_0xb3cc('0x59')](_0x31612[_0xb3cc('0x51')]['channel'],_0x31612[_0xb3cc('0x51')][_0xb3cc('0x3a')]);_0x31612['body'][_0xb3cc('0x5a')]=integrations[_0xb3cc('0x5b')](_0x31612[_0xb3cc('0x51')]['channel'],_0x31612[_0xb3cc('0x51')]['type']);return db[_0xb3cc('0x5c')][_0xb3cc('0x50')](_0x31612[_0xb3cc('0x51')],{'include':[{'model':db[_0xb3cc('0x5d')],'as':_0xb3cc('0x5e')},{'model':db[_0xb3cc('0x5d')],'as':_0xb3cc('0x5a')}]});}return null;})[_0xb3cc('0x30')](respondWithResult(_0x27c990,null))[_0xb3cc('0x27')](handleError(_0x27c990,null));};var md5=require(_0xb3cc('0x5f'));exports['getFields']=function(_0x414fe9,_0x586f5c,_0x1f10ff){var _0x3fc033=null;var _0x61db7b=null;var _0x12e95f=null;var _0x266e44=null;var _0x23f1eb='';return db['VtigerAccount']['findOne']({'where':{'id':_0x414fe9[_0xb3cc('0x4e')]['id']},'attributes':['id','name',_0xb3cc('0x60'),_0xb3cc('0x61'),'moduleName',_0xb3cc('0x62'),_0xb3cc('0x63'),_0xb3cc('0x64')]})[_0xb3cc('0x30')](handleEntityNotFound(_0x586f5c,null))[_0xb3cc('0x30')](function(_0x1f07e8){if(_0x1f07e8){_0x3fc033=_0x1f07e8['username'];_0x61db7b=_0x1f07e8['accessKey'];_0x12e95f=_0x1f07e8[_0xb3cc('0x65')];_0x23f1eb=_0x1f07e8[_0xb3cc('0x62')];var _0x500238=_0x23f1eb[_0xb3cc('0x66')](-0x1);if(_0x500238==='/'){_0x23f1eb=_0x23f1eb[_0xb3cc('0x67')](0x0,_0x23f1eb[_0xb3cc('0x68')](_0x500238));}_0x266e44=util['format'](_0xb3cc('0x69'),_0x23f1eb);var _0x2bfd03={'method':_0xb3cc('0x6a'),'uri':_0x266e44,'qs':{'operation':_0xb3cc('0x6b'),'username':_0x1f07e8[_0xb3cc('0x60')]},'json':!![]};return rp(_0x2bfd03);}})[_0xb3cc('0x30')](function(_0x4cafb4){if(_0x4cafb4[_0xb3cc('0x6c')]){var _0x375ffa={'method':_0xb3cc('0x6d'),'uri':_0x266e44,'form':{'operation':_0xb3cc('0x6e'),'username':_0x3fc033,'accessKey':md5(_0x4cafb4[_0xb3cc('0x26')][_0xb3cc('0x6f')]+_0x61db7b)},'json':!![]};return rp(_0x375ffa);}})['then'](function(_0x12beb8){if(_0x12beb8[_0xb3cc('0x6c')]){var _0x904c2f={'method':'GET','uri':_0x266e44,'qs':{'operation':_0xb3cc('0x70'),'username':_0x3fc033,'sessionName':_0x12beb8[_0xb3cc('0x26')]['sessionName'],'elementType':_0x12e95f},'json':!![]};return rp(_0x904c2f);}})[_0xb3cc('0x30')](function(_0x185606){if(_0x185606[_0xb3cc('0x6c')]){var _0xcbd903=['autogenerated',_0xb3cc('0x71'),_0xb3cc('0x72')];_[_0xb3cc('0x73')](_0x185606[_0xb3cc('0x26')][_0xb3cc('0x40')],function(_0x12e7af){return _0xcbd903[_0xb3cc('0x74')](_0x12e7af[_0xb3cc('0x3a')][_0xb3cc('0x33')]);});_[_0xb3cc('0x73')](_0x185606[_0xb3cc('0x26')][_0xb3cc('0x40')],function(_0x542edc){return _0x542edc['editable']==='false';});return{'count':_0x185606[_0xb3cc('0x26')]['fields'][_0xb3cc('0x42')],'rows':_['map'](_0x185606[_0xb3cc('0x26')][_0xb3cc('0x40')],function(_0x11263e){return{'id':_0x11263e[_0xb3cc('0x33')],'name':_0x11263e[_0xb3cc('0x75')],'custom':_[_0xb3cc('0x76')](_0x11263e[_0xb3cc('0x33')],_0xb3cc('0x77'))?!![]:![],'options':_0x11263e[_0xb3cc('0x3a')][_0xb3cc('0x33')]===_0xb3cc('0x78')&&_0x11263e[_0xb3cc('0x3a')][_0xb3cc('0x79')][_0xb3cc('0x42')]>0x0?_[_0xb3cc('0x36')](_0x11263e[_0xb3cc('0x3a')][_0xb3cc('0x79')],function(_0x481e0a){return{'name':_0x481e0a[_0xb3cc('0x75')],'value':_0x481e0a[_0xb3cc('0x7a')]};}):[]};})};}})[_0xb3cc('0x30')](respondWithResult(_0x586f5c,null))[_0xb3cc('0x27')](function(_0x1b4263){console[_0xb3cc('0x7b')](_0xb3cc('0x7c')+_0x1b4263);var _0x13945c=_0x414fe9[_0xb3cc('0x3c')][_0xb3cc('0x1d')]?0x1f4:_0x1b4263[_0xb3cc('0x7d')]||0x1f4;logger[_0xb3cc('0x23')](_0xb3cc('0x7e'),_0xb3cc('0x7f'),_0x13945c,JSON[_0xb3cc('0x80')](_0x1b4263));delete _0x1b4263[_0xb3cc('0x33')];if(_0x13945c===0x191){_0x13945c=0x190;}_0x586f5c[_0xb3cc('0x29')](_0x13945c)['send'](_0x414fe9[_0xb3cc('0x3c')][_0xb3cc('0x1d')]?{'message':_0xb3cc('0x81'),'statusCode':_0x1b4263[_0xb3cc('0x7d')]}:_0x1b4263);});}; \ No newline at end of file +var _0x5c01=['format','getchallenge','success','POST','login','result','token','GET','describe','sessionName','autogenerated','reference','owner','remove','label','startsWith','cf_','picklist','picklistValues','value','log','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','rimraf','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','error','code','message','catch','status','end','offset','limit','Content-Range','json','apply','reject','save','destroy','sendStatus','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','count','includeAll','include','findAll','rows','params','options','find','create','update','body','findOne','filter','getConfigurations','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','VtigerConfiguration','VtigerField','getFields','description','moduleName','remoteUri','serverUrl','username','accessKey','slice','lastIndexOf'];(function(_0x17ebef,_0x6c1b2d){var _0x2d8a27=function(_0x6b4281){while(--_0x6b4281){_0x17ebef['push'](_0x17ebef['shift']());}};_0x2d8a27(++_0x6c1b2d);}(_0x5c01,0x9c));var _0x15c0=function(_0x43e732,_0x20dfef){_0x43e732=_0x43e732-0x0;var _0x163425=_0x5c01[_0x43e732];return _0x163425;};'use strict';var pdf=require(_0x15c0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x15c0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x15c0('0x2'));var rp=require('request-promise');var moment=require(_0x15c0('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x15c0('0x4'));var util=require(_0x15c0('0x5'));var path=require('path');var sox=require(_0x15c0('0x6'));var csv=require(_0x15c0('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x15c0('0x8'));var squel=require(_0x15c0('0x9'));var crypto=require(_0x15c0('0xa'));var jsforce=require(_0x15c0('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x15c0('0x7'));var querystring=require(_0x15c0('0xc'));var Papa=require(_0x15c0('0xd'));var Redis=require(_0x15c0('0xe'));var authService=require(_0x15c0('0xf'));var qs=require(_0x15c0('0x10'));var as=require(_0x15c0('0x11'));var hardwareService=require(_0x15c0('0x12'));var logger=require(_0x15c0('0x13'))('api');var utils=require(_0x15c0('0x14'));var config=require(_0x15c0('0x15'));var db=require(_0x15c0('0x16'))['db'];var integrations=require(_0x15c0('0x17'));var jayson=require('jayson/promise');var client=jayson['client'][_0x15c0('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4368ed,_0x147136,_0x4d5be5){if(_0x4d5be5){var _0x53071b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53071b['test'](_0x147136)){return _0x4368ed;}else{throw new db[(_0x15c0('0x19'))][(_0x15c0('0x1a'))](_0x15c0('0x1b'));}}else{return _0x4368ed;}}function respondWithRpcPromise(_0x5e6c3c,_0x5f2441,_0x967689,_0x594173){return new BPromise(function(_0xad7dcd,_0x2da0d1){var _0x1f3cb8=_0x594173||client;return _0x1f3cb8[_0x15c0('0x1c')](_0x5e6c3c,_0x967689)[_0x15c0('0x1d')](function(_0x51d795){logger[_0x15c0('0x1e')](_0x15c0('0x1f'),_0x5f2441,_0x15c0('0x20'));logger[_0x15c0('0x21')](_0x15c0('0x22'),_0x5f2441,_0x15c0('0x20'),JSON['stringify'](_0x51d795));if(_0x51d795[_0x15c0('0x23')]){if(_0x51d795['error'][_0x15c0('0x24')]===0x1f4){logger[_0x15c0('0x23')](_0x15c0('0x1f'),_0x5f2441,_0x51d795[_0x15c0('0x23')][_0x15c0('0x25')]);return _0x2da0d1(_0x51d795[_0x15c0('0x23')][_0x15c0('0x25')]);}logger['error'](_0x15c0('0x1f'),_0x5f2441,_0x51d795['error'][_0x15c0('0x25')]);return _0xad7dcd(_0x51d795[_0x15c0('0x23')]['message']);}else{logger[_0x15c0('0x1e')]('VtigerAccount,\x20%s,\x20%s',_0x5f2441,_0x15c0('0x20'));_0xad7dcd(_0x51d795['result']['message']);}})[_0x15c0('0x26')](function(_0x4296af){logger[_0x15c0('0x23')](_0x15c0('0x1f'),_0x5f2441,_0x4296af);_0x2da0d1(_0x4296af);});});}function respondWithStatusCode(_0x50528c,_0x722ca1){_0x722ca1=_0x722ca1||0xcc;return function(_0x4c5206){if(_0x4c5206){return _0x50528c['sendStatus'](_0x722ca1);}return _0x50528c[_0x15c0('0x27')](_0x722ca1)[_0x15c0('0x28')]();};}function respondWithResult(_0x489772,_0x4b7f48){_0x4b7f48=_0x4b7f48||0xc8;return function(_0x49ee5b){if(_0x49ee5b){return _0x489772[_0x15c0('0x27')](_0x4b7f48)['json'](_0x49ee5b);}};}function respondWithFilteredResult(_0x45e97c,_0x1b21ba){return function(_0x2c279f){if(_0x2c279f){var _0x458f78=_0x2c279f['count'],_0x3b2953=_0x1b21ba[_0x15c0('0x29')],_0x4e5f8f=_0x1b21ba[_0x15c0('0x29')]+_0x1b21ba[_0x15c0('0x2a')],_0x33e777;if(_0x4e5f8f>=_0x458f78){_0x4e5f8f=_0x458f78;_0x33e777=0xc8;}else{_0x33e777=0xce;}_0x45e97c[_0x15c0('0x27')](_0x33e777);return _0x45e97c['set'](_0x15c0('0x2b'),_0x3b2953+'-'+_0x4e5f8f+'/'+_0x458f78)[_0x15c0('0x2c')](_0x2c279f);}return null;};}function patchUpdates(_0x342808){return function(_0x121c26){try{jsonpatch[_0x15c0('0x2d')](_0x121c26,_0x342808,!![]);}catch(_0x5ba71f){return BPromise[_0x15c0('0x2e')](_0x5ba71f);}return _0x121c26[_0x15c0('0x2f')]();};}function saveUpdates(_0x329bab,_0x307032){return function(_0x2eca32){if(_0x2eca32){return _0x2eca32['update'](_0x329bab)[_0x15c0('0x1d')](function(_0x103aad){return _0x103aad;});}return null;};}function removeEntity(_0x12c132,_0x272234){return function(_0x38dc3b){if(_0x38dc3b){return _0x38dc3b[_0x15c0('0x30')]()[_0x15c0('0x1d')](function(){_0x12c132['status'](0xcc)[_0x15c0('0x28')]();});}};}function handleEntityNotFound(_0x1d5015,_0x1bc730){return function(_0xf37bad){if(!_0xf37bad){_0x1d5015[_0x15c0('0x31')](0x194);}return _0xf37bad;};}function handleError(_0x4f8a4c,_0xde88d4){_0xde88d4=_0xde88d4||0x1f4;return function(_0xea552c){logger[_0x15c0('0x23')](_0xea552c[_0x15c0('0x32')]);if(_0xea552c[_0x15c0('0x33')]){delete _0xea552c[_0x15c0('0x33')];}_0x4f8a4c[_0x15c0('0x27')](_0xde88d4)[_0x15c0('0x34')](_0xea552c);};}exports[_0x15c0('0x35')]=function(_0x5260bd,_0x4091c5){var _0x21be42={},_0x527bca={},_0x2c3172={'count':0x0,'rows':[]};var _0x1547da=_[_0x15c0('0x36')](db[_0x15c0('0x37')][_0x15c0('0x38')],function(_0x5a11c0){return{'name':_0x5a11c0[_0x15c0('0x39')],'type':_0x5a11c0[_0x15c0('0x3a')][_0x15c0('0x3b')]};});_0x527bca[_0x15c0('0x3c')]=_[_0x15c0('0x36')](_0x1547da,'name');_0x527bca[_0x15c0('0x3d')]=_[_0x15c0('0x3e')](_0x5260bd['query']);_0x527bca[_0x15c0('0x3f')]=_['intersection'](_0x527bca[_0x15c0('0x3c')],_0x527bca[_0x15c0('0x3d')]);_0x21be42[_0x15c0('0x40')]=_[_0x15c0('0x41')](_0x527bca[_0x15c0('0x3c')],qs[_0x15c0('0x42')](_0x5260bd[_0x15c0('0x3d')][_0x15c0('0x42')]));_0x21be42['attributes']=_0x21be42[_0x15c0('0x40')][_0x15c0('0x43')]?_0x21be42[_0x15c0('0x40')]:_0x527bca[_0x15c0('0x3c')];if(!_0x5260bd['query'][_0x15c0('0x44')](_0x15c0('0x45'))){_0x21be42[_0x15c0('0x2a')]=qs[_0x15c0('0x2a')](_0x5260bd[_0x15c0('0x3d')][_0x15c0('0x2a')]);_0x21be42[_0x15c0('0x29')]=qs[_0x15c0('0x29')](_0x5260bd[_0x15c0('0x3d')]['offset']);}_0x21be42[_0x15c0('0x46')]=qs[_0x15c0('0x47')](_0x5260bd[_0x15c0('0x3d')][_0x15c0('0x47')]);_0x21be42[_0x15c0('0x48')]=qs[_0x15c0('0x3f')](_[_0x15c0('0x49')](_0x5260bd['query'],_0x527bca['filters']));if(_0x5260bd[_0x15c0('0x3d')]['filter']){_0x21be42[_0x15c0('0x48')]=_[_0x15c0('0x4a')](_0x21be42[_0x15c0('0x48')],{'$or':_['map'](_0x1547da,function(_0x1d95bd){if(_0x1d95bd[_0x15c0('0x3a')]!=='VIRTUAL'){var _0x4d7484={};_0x4d7484[_0x1d95bd[_0x15c0('0x33')]]={'$like':'%'+_0x5260bd[_0x15c0('0x3d')]['filter']+'%'};return _0x4d7484;}})});}_0x21be42=_[_0x15c0('0x4a')]({},_0x21be42,_0x5260bd['options']);var _0x304cd3={'where':_0x21be42[_0x15c0('0x48')]};return db['VtigerAccount']['count'](_0x304cd3)['then'](function(_0xe3d808){_0x2c3172[_0x15c0('0x4b')]=_0xe3d808;if(_0x5260bd['query'][_0x15c0('0x4c')]){_0x21be42[_0x15c0('0x4d')]=[{'all':!![]}];}return db[_0x15c0('0x37')][_0x15c0('0x4e')](_0x21be42);})[_0x15c0('0x1d')](function(_0x2a86aa){_0x2c3172[_0x15c0('0x4f')]=_0x2a86aa;return _0x2c3172;})['then'](respondWithFilteredResult(_0x4091c5,_0x21be42))['catch'](handleError(_0x4091c5,null));};exports['show']=function(_0x5a61cf,_0xbcf68a){var _0x41539a={'raw':![],'where':{'id':_0x5a61cf[_0x15c0('0x50')]['id']}},_0x3eeee9={};_0x3eeee9[_0x15c0('0x3c')]=_[_0x15c0('0x3e')](db[_0x15c0('0x37')]['rawAttributes']);_0x3eeee9[_0x15c0('0x3d')]=_[_0x15c0('0x3e')](_0x5a61cf[_0x15c0('0x3d')]);_0x3eeee9[_0x15c0('0x3f')]=_[_0x15c0('0x41')](_0x3eeee9[_0x15c0('0x3c')],_0x3eeee9[_0x15c0('0x3d')]);_0x41539a['attributes']=_[_0x15c0('0x41')](_0x3eeee9['model'],qs[_0x15c0('0x42')](_0x5a61cf[_0x15c0('0x3d')][_0x15c0('0x42')]));_0x41539a[_0x15c0('0x40')]=_0x41539a[_0x15c0('0x40')]['length']?_0x41539a[_0x15c0('0x40')]:_0x3eeee9[_0x15c0('0x3c')];if(_0x5a61cf[_0x15c0('0x3d')][_0x15c0('0x4c')]){_0x41539a[_0x15c0('0x4d')]=[{'all':!![]}];}_0x41539a=_[_0x15c0('0x4a')]({},_0x41539a,_0x5a61cf[_0x15c0('0x51')]);return db['VtigerAccount'][_0x15c0('0x52')](_0x41539a)[_0x15c0('0x1d')](handleEntityNotFound(_0xbcf68a,null))[_0x15c0('0x1d')](respondWithResult(_0xbcf68a,null))[_0x15c0('0x26')](handleError(_0xbcf68a,null));};exports[_0x15c0('0x53')]=function(_0x4f98e3,_0x4a90db){return db[_0x15c0('0x37')][_0x15c0('0x53')](_0x4f98e3['body'],{})[_0x15c0('0x1d')](respondWithResult(_0x4a90db,0xc9))[_0x15c0('0x26')](handleError(_0x4a90db,null));};exports[_0x15c0('0x54')]=function(_0x48ea52,_0x490a05){if(_0x48ea52[_0x15c0('0x55')]['id']){delete _0x48ea52['body']['id'];}return db[_0x15c0('0x37')][_0x15c0('0x52')]({'where':{'id':_0x48ea52[_0x15c0('0x50')]['id']}})['then'](handleEntityNotFound(_0x490a05,null))[_0x15c0('0x1d')](saveUpdates(_0x48ea52[_0x15c0('0x55')],null))[_0x15c0('0x1d')](respondWithResult(_0x490a05,null))[_0x15c0('0x26')](handleError(_0x490a05,null));};exports[_0x15c0('0x30')]=function(_0x4397e4,_0x1d8090){return db[_0x15c0('0x37')]['find']({'where':{'id':_0x4397e4[_0x15c0('0x50')]['id']}})[_0x15c0('0x1d')](handleEntityNotFound(_0x1d8090,null))[_0x15c0('0x1d')](removeEntity(_0x1d8090,null))['catch'](handleError(_0x1d8090,null));};exports['getConfigurations']=function(_0xb8fa93,_0x3299ea,_0x4bb817){var _0x499ae6={};var _0xf6865f={};var _0x1aebc7;var _0x472dbe;return db['VtigerAccount'][_0x15c0('0x56')]({'where':{'id':_0xb8fa93[_0x15c0('0x50')]['id']}})['then'](handleEntityNotFound(_0x3299ea,null))[_0x15c0('0x1d')](function(_0x2f13ce){if(_0x2f13ce){_0x1aebc7=_0x2f13ce;_0xf6865f[_0x15c0('0x3c')]=_[_0x15c0('0x3e')](db['VtigerConfiguration'][_0x15c0('0x38')]);_0xf6865f[_0x15c0('0x3d')]=_['keys'](_0xb8fa93[_0x15c0('0x3d')]);_0xf6865f[_0x15c0('0x3f')]=_['intersection'](_0xf6865f['model'],_0xf6865f[_0x15c0('0x3d')]);_0x499ae6[_0x15c0('0x40')]=_[_0x15c0('0x41')](_0xf6865f['model'],qs[_0x15c0('0x42')](_0xb8fa93[_0x15c0('0x3d')][_0x15c0('0x42')]));_0x499ae6['attributes']=_0x499ae6[_0x15c0('0x40')][_0x15c0('0x43')]?_0x499ae6[_0x15c0('0x40')]:_0xf6865f['model'];_0x499ae6['order']=qs[_0x15c0('0x47')](_0xb8fa93['query'][_0x15c0('0x47')]);_0x499ae6[_0x15c0('0x48')]=qs[_0x15c0('0x3f')](_[_0x15c0('0x49')](_0xb8fa93[_0x15c0('0x3d')],_0xf6865f['filters']));if(_0xb8fa93['query'][_0x15c0('0x57')]){_0x499ae6[_0x15c0('0x48')]=_[_0x15c0('0x4a')](_0x499ae6[_0x15c0('0x48')],{'$or':_[_0x15c0('0x36')](_0x499ae6[_0x15c0('0x40')],function(_0x3ae659){var _0xb60c97={};_0xb60c97[_0x3ae659]={'$like':'%'+_0xb8fa93[_0x15c0('0x3d')][_0x15c0('0x57')]+'%'};return _0xb60c97;})});}_0x499ae6=_[_0x15c0('0x4a')]({},_0x499ae6,_0xb8fa93[_0x15c0('0x51')]);return _0x1aebc7[_0x15c0('0x58')](_0x499ae6);}})[_0x15c0('0x1d')](function(_0x22baef){if(_0x22baef){_0x472dbe=_0x22baef[_0x15c0('0x43')];if(!_0xb8fa93[_0x15c0('0x3d')]['hasOwnProperty'](_0x15c0('0x45'))){_0x499ae6['limit']=qs['limit'](_0xb8fa93[_0x15c0('0x3d')]['limit']);_0x499ae6[_0x15c0('0x29')]=qs[_0x15c0('0x29')](_0xb8fa93[_0x15c0('0x3d')][_0x15c0('0x29')]);}return _0x1aebc7[_0x15c0('0x58')](_0x499ae6);}})['then'](function(_0x53e60f){if(_0x53e60f){return _0x53e60f?{'count':_0x472dbe,'rows':_0x53e60f}:null;}})[_0x15c0('0x1d')](respondWithResult(_0x3299ea,null))[_0x15c0('0x26')](handleError(_0x3299ea,null));};exports[_0x15c0('0x59')]=function(_0x5d0f16,_0x94cbcf,_0x3e228c){if(_0x5d0f16['body']['id']){delete _0x5d0f16[_0x15c0('0x55')]['id'];}return db[_0x15c0('0x37')][_0x15c0('0x56')]({'where':{'id':_0x5d0f16[_0x15c0('0x50')]['id']}})[_0x15c0('0x1d')](handleEntityNotFound(_0x94cbcf,null))[_0x15c0('0x1d')](function(_0x1de25c){if(_0x1de25c){_0x5d0f16[_0x15c0('0x55')][_0x15c0('0x5a')]=_0x1de25c['id'];_0x5d0f16[_0x15c0('0x55')]['Subjects']=integrations[_0x15c0('0x5b')](_0x5d0f16[_0x15c0('0x55')][_0x15c0('0x5c')],_0x5d0f16[_0x15c0('0x55')][_0x15c0('0x3a')]);_0x5d0f16[_0x15c0('0x55')][_0x15c0('0x5d')]=integrations[_0x15c0('0x5e')](_0x5d0f16['body']['channel'],_0x5d0f16[_0x15c0('0x55')][_0x15c0('0x3a')]);return db[_0x15c0('0x5f')][_0x15c0('0x53')](_0x5d0f16[_0x15c0('0x55')],{'include':[{'model':db[_0x15c0('0x60')],'as':'Subjects'},{'model':db[_0x15c0('0x60')],'as':_0x15c0('0x5d')}]});}return null;})[_0x15c0('0x1d')](respondWithResult(_0x94cbcf,null))[_0x15c0('0x26')](handleError(_0x94cbcf,null));};var md5=require('md5');exports[_0x15c0('0x61')]=function(_0x2ec5e3,_0x4113ea,_0x5a335c){var _0x42bed7=null;var _0x2c78c6=null;var _0x3a0546=null;var _0xf4a612=null;var _0x12f9c2='';return db['VtigerAccount'][_0x15c0('0x56')]({'where':{'id':_0x2ec5e3[_0x15c0('0x50')]['id']},'attributes':['id','name','username',_0x15c0('0x62'),_0x15c0('0x63'),_0x15c0('0x64'),_0x15c0('0x65'),'accessKey']})['then'](handleEntityNotFound(_0x4113ea,null))[_0x15c0('0x1d')](function(_0x1a24e6){if(_0x1a24e6){_0x42bed7=_0x1a24e6[_0x15c0('0x66')];_0x2c78c6=_0x1a24e6[_0x15c0('0x67')];_0x3a0546=_0x1a24e6[_0x15c0('0x63')];_0x12f9c2=_0x1a24e6[_0x15c0('0x64')];var _0x15a3de=_0x12f9c2[_0x15c0('0x68')](-0x1);if(_0x15a3de==='/'){_0x12f9c2=_0x12f9c2['substring'](0x0,_0x12f9c2[_0x15c0('0x69')](_0x15a3de));}_0xf4a612=util[_0x15c0('0x6a')]('%s/webservice.php',_0x12f9c2);var _0x4bff52={'method':'GET','uri':_0xf4a612,'qs':{'operation':_0x15c0('0x6b'),'username':_0x1a24e6[_0x15c0('0x66')]},'json':!![]};return rp(_0x4bff52);}})[_0x15c0('0x1d')](function(_0x3e83d0){if(_0x3e83d0[_0x15c0('0x6c')]){var _0x27bfff={'method':_0x15c0('0x6d'),'uri':_0xf4a612,'form':{'operation':_0x15c0('0x6e'),'username':_0x42bed7,'accessKey':md5(_0x3e83d0[_0x15c0('0x6f')][_0x15c0('0x70')]+_0x2c78c6)},'json':!![]};return rp(_0x27bfff);}})[_0x15c0('0x1d')](function(_0x5d5b8d){if(_0x5d5b8d[_0x15c0('0x6c')]){var _0xd75484={'method':_0x15c0('0x71'),'uri':_0xf4a612,'qs':{'operation':_0x15c0('0x72'),'username':_0x42bed7,'sessionName':_0x5d5b8d[_0x15c0('0x6f')][_0x15c0('0x73')],'elementType':_0x3a0546},'json':!![]};return rp(_0xd75484);}})[_0x15c0('0x1d')](function(_0x3ab04d){if(_0x3ab04d[_0x15c0('0x6c')]){var _0x497e42=[_0x15c0('0x74'),_0x15c0('0x75'),_0x15c0('0x76')];_[_0x15c0('0x77')](_0x3ab04d['result']['fields'],function(_0x2d796c){return _0x497e42['includes'](_0x2d796c['type'][_0x15c0('0x33')]);});_[_0x15c0('0x77')](_0x3ab04d['result']['fields'],function(_0x4c34cf){return _0x4c34cf['editable']==='false';});return{'count':_0x3ab04d[_0x15c0('0x6f')][_0x15c0('0x42')]['length'],'rows':_[_0x15c0('0x36')](_0x3ab04d[_0x15c0('0x6f')][_0x15c0('0x42')],function(_0x1664db){return{'id':_0x1664db[_0x15c0('0x33')],'name':_0x1664db[_0x15c0('0x78')],'custom':_[_0x15c0('0x79')](_0x1664db[_0x15c0('0x33')],_0x15c0('0x7a'))?!![]:![],'options':_0x1664db[_0x15c0('0x3a')]['name']===_0x15c0('0x7b')&&_0x1664db[_0x15c0('0x3a')]['picklistValues'][_0x15c0('0x43')]>0x0?_[_0x15c0('0x36')](_0x1664db[_0x15c0('0x3a')][_0x15c0('0x7c')],function(_0x5b970c){return{'name':_0x5b970c[_0x15c0('0x78')],'value':_0x5b970c[_0x15c0('0x7d')]};}):[]};})};}})['then'](respondWithResult(_0x4113ea,null))[_0x15c0('0x26')](function(_0x172d56){console[_0x15c0('0x7e')](_0x15c0('0x7f')+_0x172d56);var _0x478729=_0x2ec5e3[_0x15c0('0x3d')]['test']?0x1f4:_0x172d56[_0x15c0('0x80')]||0x1f4;logger[_0x15c0('0x23')](_0x15c0('0x81'),'getFields',_0x478729,JSON[_0x15c0('0x82')](_0x172d56));delete _0x172d56[_0x15c0('0x33')];if(_0x478729===0x191){_0x478729=0x190;}_0x4113ea[_0x15c0('0x27')](_0x478729)[_0x15c0('0x34')](_0x2ec5e3['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x172d56[_0x15c0('0x80')]}:_0x172d56);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 7b4cd3a..4864c63 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 _0xc374=['../../components/integrations/configuration','exports','VtigerAccount','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x30e8dd,_0x707efd){var _0x1c5e0d=function(_0x340f68){while(--_0x340f68){_0x30e8dd['push'](_0x30e8dd['shift']());}};_0x1c5e0d(++_0x707efd);}(_0xc374,0x87));var _0x4c37=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc374[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x4c37('0x0'));var util=require('util');var logger=require(_0x4c37('0x1'))(_0x4c37('0x2'));var moment=require(_0x4c37('0x3'));var BPromise=require(_0x4c37('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4c37('0x5'));var rimraf=require(_0x4c37('0x6'));var config=require(_0x4c37('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x4c37('0x8'));module[_0x4c37('0x9')]=function(_0x8662a7,_0x28c831){return _0x8662a7['define'](_0x4c37('0xa'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x644f=['exports','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./intVtigerAccount.attributes','../../components/integrations/configuration'];(function(_0x25ba6a,_0x4422d6){var _0x1be09a=function(_0x308e7b){while(--_0x308e7b){_0x25ba6a['push'](_0x25ba6a['shift']());}};_0x1be09a(++_0x4422d6);}(_0x644f,0x91));var _0xf644=function(_0x420b24,_0x382adc){_0x420b24=_0x420b24-0x0;var _0x4da552=_0x644f[_0x420b24];return _0x4da552;};'use strict';var _=require(_0xf644('0x0'));var util=require(_0xf644('0x1'));var logger=require(_0xf644('0x2'))(_0xf644('0x3'));var moment=require(_0xf644('0x4'));var BPromise=require(_0xf644('0x5'));var rp=require(_0xf644('0x6'));var fs=require('fs');var path=require(_0xf644('0x7'));var rimraf=require('rimraf');var config=require(_0xf644('0x8'));var attributes=require(_0xf644('0x9'));var integrations=require(_0xf644('0xa'));module[_0xf644('0xb')]=function(_0x2accd0,_0x415ca1){return _0x2accd0['define']('VtigerAccount',attributes,{'tableName':'int_vtiger_accounts','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 a2b912e..0cc2fc5 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 _0xe4e4=['catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','result','GetVtigerAccount','VtigerAccount','findAll','options','raw','where','attributes','limit','include','model','map','ShowVtigerAccount','find'];(function(_0xfa634c,_0x414e0e){var _0x73e478=function(_0xac2a51){while(--_0xac2a51){_0xfa634c['push'](_0xfa634c['shift']());}};_0x73e478(++_0x414e0e);}(_0xe4e4,0xd3));var _0x4e4e=function(_0x35d058,_0x3c3a16){_0x35d058=_0x35d058-0x0;var _0x58f132=_0xe4e4[_0x35d058];return _0x58f132;};'use strict';var _=require(_0x4e4e('0x0'));var util=require('util');var moment=require(_0x4e4e('0x1'));var BPromise=require(_0x4e4e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4e4e('0x3'));var db=require(_0x4e4e('0x4'))['db'];var utils=require(_0x4e4e('0x5'));var logger=require(_0x4e4e('0x6'))(_0x4e4e('0x7'));var config=require('../../config/environment');var jayson=require(_0x4e4e('0x8'));var client=jayson[_0x4e4e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4c232b,_0x36331a,_0x3a9856){return new BPromise(function(_0x5eb2c6,_0x2b3117){return client[_0x4e4e('0xa')](_0x4c232b,_0x3a9856)[_0x4e4e('0xb')](function(_0x424c65){logger[_0x4e4e('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x36331a,_0x4e4e('0xd'));logger[_0x4e4e('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x36331a,_0x4e4e('0xd'),JSON[_0x4e4e('0xf')](_0x424c65));if(_0x424c65['error']){if(_0x424c65[_0x4e4e('0x10')][_0x4e4e('0x11')]===0x1f4){logger['error'](_0x4e4e('0x12'),_0x36331a,_0x424c65[_0x4e4e('0x10')][_0x4e4e('0x13')]);return _0x2b3117(_0x424c65[_0x4e4e('0x10')][_0x4e4e('0x13')]);}logger[_0x4e4e('0x10')](_0x4e4e('0x12'),_0x36331a,_0x424c65[_0x4e4e('0x10')]['message']);return _0x5eb2c6(_0x424c65[_0x4e4e('0x10')]['message']);}else{logger[_0x4e4e('0xc')](_0x4e4e('0x12'),_0x36331a,_0x4e4e('0xd'));_0x5eb2c6(_0x424c65[_0x4e4e('0x14')][_0x4e4e('0x13')]);}})['catch'](function(_0x5b1e28){logger[_0x4e4e('0x10')](_0x4e4e('0x12'),_0x36331a,_0x5b1e28);_0x2b3117(_0x5b1e28);});});}exports[_0x4e4e('0x15')]=function(_0x11e0d7){var _0x45307d=this;return new Promise(function(_0x19e6e3,_0x289c30){return db[_0x4e4e('0x16')][_0x4e4e('0x17')]({'raw':_0x11e0d7['options']?_0x11e0d7[_0x4e4e('0x18')][_0x4e4e('0x19')]===undefined?!![]:![]:!![],'where':_0x11e0d7[_0x4e4e('0x18')]?_0x11e0d7[_0x4e4e('0x18')][_0x4e4e('0x1a')]||null:null,'attributes':_0x11e0d7[_0x4e4e('0x18')]?_0x11e0d7['options'][_0x4e4e('0x1b')]||null:null,'limit':_0x11e0d7['options']?_0x11e0d7['options'][_0x4e4e('0x1c')]||null:null,'include':_0x11e0d7[_0x4e4e('0x18')]?_0x11e0d7[_0x4e4e('0x18')][_0x4e4e('0x1d')]?_['map'](_0x11e0d7[_0x4e4e('0x18')][_0x4e4e('0x1d')],function(_0xdfe26){return{'model':db[_0xdfe26[_0x4e4e('0x1e')]],'as':_0xdfe26['as'],'attributes':_0xdfe26[_0x4e4e('0x1b')],'include':_0xdfe26[_0x4e4e('0x1d')]?_[_0x4e4e('0x1f')](_0xdfe26[_0x4e4e('0x1d')],function(_0x372a39){return{'model':db[_0x372a39[_0x4e4e('0x1e')]],'as':_0x372a39['as'],'attributes':_0x372a39[_0x4e4e('0x1b')],'include':_0x372a39[_0x4e4e('0x1d')]?_[_0x4e4e('0x1f')](_0x372a39[_0x4e4e('0x1d')],function(_0x7c9077){return{'model':db[_0x7c9077['model']],'as':_0x7c9077['as'],'attributes':_0x7c9077['attributes']};}):[]};}):[]};}):[]:[]})[_0x4e4e('0xb')](function(_0xee70dd){logger[_0x4e4e('0xc')](_0x4e4e('0x15'),_0x11e0d7);logger[_0x4e4e('0xe')](_0x4e4e('0x15'),_0x11e0d7,JSON[_0x4e4e('0xf')](_0xee70dd));_0x19e6e3(_0xee70dd);})['catch'](function(_0x5a14f8){logger['error'](_0x4e4e('0x15'),_0x5a14f8[_0x4e4e('0x13')],_0x11e0d7);_0x289c30(_0x45307d[_0x4e4e('0x10')](0x1f4,_0x5a14f8[_0x4e4e('0x13')]));});});};exports[_0x4e4e('0x20')]=function(_0x5510b3){var _0x2afeb3=this;return new Promise(function(_0x38b7cb,_0x30dd98){return db['VtigerAccount'][_0x4e4e('0x21')]({'raw':_0x5510b3[_0x4e4e('0x18')]?_0x5510b3[_0x4e4e('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x5510b3['options']?_0x5510b3[_0x4e4e('0x18')]['where']||null:null,'attributes':_0x5510b3[_0x4e4e('0x18')]?_0x5510b3[_0x4e4e('0x18')][_0x4e4e('0x1b')]||null:null,'include':_0x5510b3['options']?_0x5510b3['options'][_0x4e4e('0x1d')]?_['map'](_0x5510b3[_0x4e4e('0x18')][_0x4e4e('0x1d')],function(_0x2f2c7b){return{'model':db[_0x2f2c7b[_0x4e4e('0x1e')]],'as':_0x2f2c7b['as'],'attributes':_0x2f2c7b[_0x4e4e('0x1b')],'include':_0x2f2c7b[_0x4e4e('0x1d')]?_[_0x4e4e('0x1f')](_0x2f2c7b['include'],function(_0x47cf3a){return{'model':db[_0x47cf3a[_0x4e4e('0x1e')]],'as':_0x47cf3a['as'],'attributes':_0x47cf3a[_0x4e4e('0x1b')],'include':_0x47cf3a[_0x4e4e('0x1d')]?_[_0x4e4e('0x1f')](_0x47cf3a[_0x4e4e('0x1d')],function(_0x29f7bb){return{'model':db[_0x29f7bb['model']],'as':_0x29f7bb['as'],'attributes':_0x29f7bb[_0x4e4e('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x4e4e('0xb')](function(_0x5abc0a){logger[_0x4e4e('0xc')](_0x4e4e('0x20'),_0x5510b3);logger[_0x4e4e('0xe')]('ShowVtigerAccount',_0x5510b3,JSON['stringify'](_0x5abc0a));_0x38b7cb(_0x5abc0a);})[_0x4e4e('0x22')](function(_0x59a674){logger[_0x4e4e('0x10')](_0x4e4e('0x20'),_0x59a674['message'],_0x5510b3);_0x30dd98(_0x2afeb3[_0x4e4e('0x10')](0x1f4,_0x59a674[_0x4e4e('0x13')]));});});}; \ No newline at end of file +var _0x6dca=['VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVtigerAccount','findAll','options','where','attributes','limit','include','map','model','ShowVtigerAccount','find','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','info'];(function(_0x92ad86,_0x3c09c3){var _0x188fbb=function(_0x3af3fe){while(--_0x3af3fe){_0x92ad86['push'](_0x92ad86['shift']());}};_0x188fbb(++_0x3c09c3);}(_0x6dca,0x15f));var _0xa6dc=function(_0x12fb07,_0x4864f2){_0x12fb07=_0x12fb07-0x0;var _0x38f8f6=_0x6dca[_0x12fb07];return _0x38f8f6;};'use strict';var _=require(_0xa6dc('0x0'));var util=require(_0xa6dc('0x1'));var moment=require(_0xa6dc('0x2'));var BPromise=require(_0xa6dc('0x3'));var rs=require(_0xa6dc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa6dc('0x5'))['db'];var utils=require(_0xa6dc('0x6'));var logger=require('../../config/logger')(_0xa6dc('0x7'));var config=require('../../config/environment');var jayson=require(_0xa6dc('0x8'));var client=jayson[_0xa6dc('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3e7869,_0x56e044,_0x12605d){return new BPromise(function(_0x48a2bf,_0x58cf6c){return client[_0xa6dc('0xa')](_0x3e7869,_0x12605d)['then'](function(_0x4882b9){logger[_0xa6dc('0xb')](_0xa6dc('0xc'),_0x56e044,_0xa6dc('0xd'));logger[_0xa6dc('0xe')](_0xa6dc('0xf'),_0x56e044,_0xa6dc('0xd'),JSON[_0xa6dc('0x10')](_0x4882b9));if(_0x4882b9[_0xa6dc('0x11')]){if(_0x4882b9[_0xa6dc('0x11')][_0xa6dc('0x12')]===0x1f4){logger[_0xa6dc('0x11')]('VtigerAccount,\x20%s,\x20%s',_0x56e044,_0x4882b9[_0xa6dc('0x11')][_0xa6dc('0x13')]);return _0x58cf6c(_0x4882b9[_0xa6dc('0x11')][_0xa6dc('0x13')]);}logger['error'](_0xa6dc('0xc'),_0x56e044,_0x4882b9[_0xa6dc('0x11')][_0xa6dc('0x13')]);return _0x48a2bf(_0x4882b9['error']['message']);}else{logger[_0xa6dc('0xb')](_0xa6dc('0xc'),_0x56e044,_0xa6dc('0xd'));_0x48a2bf(_0x4882b9[_0xa6dc('0x14')]['message']);}})[_0xa6dc('0x15')](function(_0x461140){logger[_0xa6dc('0x11')](_0xa6dc('0xc'),_0x56e044,_0x461140);_0x58cf6c(_0x461140);});});}exports[_0xa6dc('0x16')]=function(_0x492ee5){var _0x37659b=this;return new Promise(function(_0x43976d,_0x2565cc){return db['VtigerAccount'][_0xa6dc('0x17')]({'raw':_0x492ee5[_0xa6dc('0x18')]?_0x492ee5[_0xa6dc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x492ee5[_0xa6dc('0x18')]?_0x492ee5[_0xa6dc('0x18')][_0xa6dc('0x19')]||null:null,'attributes':_0x492ee5[_0xa6dc('0x18')]?_0x492ee5['options'][_0xa6dc('0x1a')]||null:null,'limit':_0x492ee5['options']?_0x492ee5[_0xa6dc('0x18')][_0xa6dc('0x1b')]||null:null,'include':_0x492ee5[_0xa6dc('0x18')]?_0x492ee5[_0xa6dc('0x18')][_0xa6dc('0x1c')]?_['map'](_0x492ee5[_0xa6dc('0x18')][_0xa6dc('0x1c')],function(_0x1bb9e4){return{'model':db[_0x1bb9e4['model']],'as':_0x1bb9e4['as'],'attributes':_0x1bb9e4[_0xa6dc('0x1a')],'include':_0x1bb9e4[_0xa6dc('0x1c')]?_[_0xa6dc('0x1d')](_0x1bb9e4[_0xa6dc('0x1c')],function(_0x5b4e97){return{'model':db[_0x5b4e97[_0xa6dc('0x1e')]],'as':_0x5b4e97['as'],'attributes':_0x5b4e97['attributes'],'include':_0x5b4e97[_0xa6dc('0x1c')]?_[_0xa6dc('0x1d')](_0x5b4e97[_0xa6dc('0x1c')],function(_0x18935c){return{'model':db[_0x18935c[_0xa6dc('0x1e')]],'as':_0x18935c['as'],'attributes':_0x18935c[_0xa6dc('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x257c60){logger[_0xa6dc('0xb')](_0xa6dc('0x16'),_0x492ee5);logger['debug'](_0xa6dc('0x16'),_0x492ee5,JSON[_0xa6dc('0x10')](_0x257c60));_0x43976d(_0x257c60);})[_0xa6dc('0x15')](function(_0x581021){logger[_0xa6dc('0x11')](_0xa6dc('0x16'),_0x581021[_0xa6dc('0x13')],_0x492ee5);_0x2565cc(_0x37659b['error'](0x1f4,_0x581021[_0xa6dc('0x13')]));});});};exports[_0xa6dc('0x1f')]=function(_0x92594e){var _0x2c35d5=this;return new Promise(function(_0x29fc73,_0x50cd85){return db['VtigerAccount'][_0xa6dc('0x20')]({'raw':_0x92594e[_0xa6dc('0x18')]?_0x92594e[_0xa6dc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x92594e[_0xa6dc('0x18')]?_0x92594e[_0xa6dc('0x18')][_0xa6dc('0x19')]||null:null,'attributes':_0x92594e[_0xa6dc('0x18')]?_0x92594e['options']['attributes']||null:null,'include':_0x92594e[_0xa6dc('0x18')]?_0x92594e[_0xa6dc('0x18')][_0xa6dc('0x1c')]?_['map'](_0x92594e[_0xa6dc('0x18')][_0xa6dc('0x1c')],function(_0xc3da2a){return{'model':db[_0xc3da2a[_0xa6dc('0x1e')]],'as':_0xc3da2a['as'],'attributes':_0xc3da2a[_0xa6dc('0x1a')],'include':_0xc3da2a[_0xa6dc('0x1c')]?_[_0xa6dc('0x1d')](_0xc3da2a['include'],function(_0x3cc6d7){return{'model':db[_0x3cc6d7[_0xa6dc('0x1e')]],'as':_0x3cc6d7['as'],'attributes':_0x3cc6d7[_0xa6dc('0x1a')],'include':_0x3cc6d7[_0xa6dc('0x1c')]?_[_0xa6dc('0x1d')](_0x3cc6d7['include'],function(_0x3b74e6){return{'model':db[_0x3b74e6['model']],'as':_0x3b74e6['as'],'attributes':_0x3b74e6['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b2a1b){logger[_0xa6dc('0xb')](_0xa6dc('0x1f'),_0x92594e);logger[_0xa6dc('0xe')](_0xa6dc('0x1f'),_0x92594e,JSON[_0xa6dc('0x10')](_0x5b2a1b));_0x29fc73(_0x5b2a1b);})['catch'](function(_0x39ae88){logger[_0xa6dc('0x11')](_0xa6dc('0x1f'),_0x39ae88[_0xa6dc('0x13')],_0x92594e);_0x50cd85(_0x2c35d5[_0xa6dc('0x11')](0x1f4,_0x39ae88[_0xa6dc('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index f7c3e5c..c9cd2c6 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 _0x5f2f=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create'];(function(_0x2dde9f,_0x349e3f){var _0x4da31f=function(_0x2f4234){while(--_0x2f4234){_0x2dde9f['push'](_0x2dde9f['shift']());}};_0x4da31f(++_0x349e3f);}(_0x5f2f,0x73));var _0xf5f2=function(_0x276131,_0x4c105d){_0x276131=_0x276131-0x0;var _0x47966b=_0x5f2f[_0x276131];return _0x47966b;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./intVtigerConfiguration.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['getFields']);router[_0xf5f2('0x8')](_0xf5f2('0xd'),auth[_0xf5f2('0x9')](),controller['getSubjects']);router[_0xf5f2('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0xf5f2('0xe')]);router[_0xf5f2('0xf')]('/',auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);router[_0xf5f2('0x11')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x12')]);router[_0xf5f2('0x13')]('/:id',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0x14')]);module[_0xf5f2('0x15')]=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(_0x23ec06,_0x561142){var _0x2831d4=function(_0x3802bc){while(--_0x3802bc){_0x23ec06['push'](_0x23ec06['shift']());}};_0x2831d4(++_0x561142);}(_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 75a3f6b..44840b8 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 _0x1165=['sequelize','STRING'];(function(_0x27a2bd,_0x5db9ff){var _0x1c7565=function(_0x388c6e){while(--_0x388c6e){_0x27a2bd['push'](_0x27a2bd['shift']());}};_0x1c7565(++_0x5db9ff);}(_0x1165,0x15c));var _0x5116=function(_0x1532e1,_0x1a9b08){_0x1532e1=_0x1532e1-0x0;var _0x37fb4f=_0x1165[_0x1532e1];return _0x37fb4f;};'use strict';var Sequelize=require(_0x5116('0x0'));module['exports']={'name':{'type':Sequelize[_0x5116('0x1')]},'description':{'type':Sequelize[_0x5116('0x1')]}}; \ No newline at end of file +var _0xd45f=['STRING','exports'];(function(_0x3afd09,_0x52634e){var _0x451138=function(_0xbc8280){while(--_0xbc8280){_0x3afd09['push'](_0x3afd09['shift']());}};_0x451138(++_0x52634e);}(_0xd45f,0x14b));var _0xfd45=function(_0x461aef,_0x491dbd){_0x461aef=_0x461aef-0x0;var _0x5b1560=_0xd45f[_0x461aef];return _0x5b1560;};'use strict';var Sequelize=require('sequelize');module[_0xfd45('0x0')]={'name':{'type':Sequelize[_0xfd45('0x1')]},'description':{'type':Sequelize[_0xfd45('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index d1ebe39..bb300d2 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 _0x7d13=['params','create','body','find','findOne','getFields','getSubjects','VtigerField','order','getDescriptions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','index','map','rawAttributes','fieldName','type','key','keys','filters','intersection','model','query','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VtigerConfiguration','includeAll','include','findAll','rows','catch'];(function(_0x349367,_0x1cede2){var _0x14179b=function(_0x38a191){while(--_0x38a191){_0x349367['push'](_0x349367['shift']());}};_0x14179b(++_0x1cede2);}(_0x7d13,0xcc));var _0x37d1=function(_0x12a24f,_0x819b79){_0x12a24f=_0x12a24f-0x0;var _0x526080=_0x7d13[_0x12a24f];return _0x526080;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x37d1('0x0'));var rimraf=require(_0x37d1('0x1'));var zipdir=require(_0x37d1('0x2'));var jsonpatch=require(_0x37d1('0x3'));var rp=require(_0x37d1('0x4'));var moment=require(_0x37d1('0x5'));var BPromise=require(_0x37d1('0x6'));var Mustache=require(_0x37d1('0x7'));var util=require('util');var path=require(_0x37d1('0x8'));var sox=require(_0x37d1('0x9'));var csv=require(_0x37d1('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x37d1('0xb'));var squel=require('squel');var crypto=require(_0x37d1('0xc'));var jsforce=require(_0x37d1('0xd'));var deskjs=require(_0x37d1('0xe'));var toCsv=require(_0x37d1('0xa'));var querystring=require(_0x37d1('0xf'));var Papa=require(_0x37d1('0x10'));var Redis=require(_0x37d1('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x37d1('0x12'));var as=require(_0x37d1('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x37d1('0x14'))(_0x37d1('0x15'));var utils=require(_0x37d1('0x16'));var config=require(_0x37d1('0x17'));var db=require(_0x37d1('0x18'))['db'];var jayson=require(_0x37d1('0x19'));var client=jayson[_0x37d1('0x1a')][_0x37d1('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x379873,_0x1df569,_0x22e15c){if(_0x22e15c){var _0x5e1461=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e1461[_0x37d1('0x1c')](_0x1df569)){return _0x379873;}else{throw new db[(_0x37d1('0x1d'))][(_0x37d1('0x1e'))](_0x37d1('0x1f'));}}else{return _0x379873;}}function respondWithRpcPromise(_0x328875,_0xafc168,_0x2dee28,_0x4fc2eb){return new BPromise(function(_0x48be7b,_0x124cfd){var _0xa8ed3f=_0x4fc2eb||client;return _0xa8ed3f['request'](_0x328875,_0x2dee28)[_0x37d1('0x20')](function(_0x58e568){logger[_0x37d1('0x21')](_0x37d1('0x22'),_0xafc168,_0x37d1('0x23'));logger[_0x37d1('0x24')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0xafc168,_0x37d1('0x23'),JSON[_0x37d1('0x25')](_0x58e568));if(_0x58e568[_0x37d1('0x26')]){if(_0x58e568[_0x37d1('0x26')]['code']===0x1f4){logger[_0x37d1('0x26')](_0x37d1('0x22'),_0xafc168,_0x58e568[_0x37d1('0x26')][_0x37d1('0x27')]);return _0x124cfd(_0x58e568['error'][_0x37d1('0x27')]);}logger[_0x37d1('0x26')](_0x37d1('0x22'),_0xafc168,_0x58e568[_0x37d1('0x26')][_0x37d1('0x27')]);return _0x48be7b(_0x58e568[_0x37d1('0x26')][_0x37d1('0x27')]);}else{logger['info'](_0x37d1('0x22'),_0xafc168,_0x37d1('0x23'));_0x48be7b(_0x58e568[_0x37d1('0x28')]['message']);}})['catch'](function(_0x21e519){logger[_0x37d1('0x26')](_0x37d1('0x22'),_0xafc168,_0x21e519);_0x124cfd(_0x21e519);});});}function respondWithStatusCode(_0x23af00,_0x4ad54d){_0x4ad54d=_0x4ad54d||0xcc;return function(_0x53ca06){if(_0x53ca06){return _0x23af00['sendStatus'](_0x4ad54d);}return _0x23af00['status'](_0x4ad54d)[_0x37d1('0x29')]();};}function respondWithResult(_0x4ee471,_0x3be2e7){_0x3be2e7=_0x3be2e7||0xc8;return function(_0x25cb3d){if(_0x25cb3d){return _0x4ee471[_0x37d1('0x2a')](_0x3be2e7)[_0x37d1('0x2b')](_0x25cb3d);}};}function respondWithFilteredResult(_0x3afd76,_0x3d22a0){return function(_0x2c5828){if(_0x2c5828){var _0x567b20=_0x2c5828[_0x37d1('0x2c')],_0x3710af=_0x3d22a0[_0x37d1('0x2d')],_0x49a9e0=_0x3d22a0[_0x37d1('0x2d')]+_0x3d22a0[_0x37d1('0x2e')],_0x48fb48;if(_0x49a9e0>=_0x567b20){_0x49a9e0=_0x567b20;_0x48fb48=0xc8;}else{_0x48fb48=0xce;}_0x3afd76['status'](_0x48fb48);return _0x3afd76[_0x37d1('0x2f')](_0x37d1('0x30'),_0x3710af+'-'+_0x49a9e0+'/'+_0x567b20)['json'](_0x2c5828);}return null;};}function patchUpdates(_0x142ae8){return function(_0x558b9d){try{jsonpatch[_0x37d1('0x31')](_0x558b9d,_0x142ae8,!![]);}catch(_0x2b30f5){return BPromise[_0x37d1('0x32')](_0x2b30f5);}return _0x558b9d[_0x37d1('0x33')]();};}function saveUpdates(_0x5ccd9d,_0x3b717c){return function(_0x436526){if(_0x436526){return _0x436526[_0x37d1('0x34')](_0x5ccd9d)[_0x37d1('0x20')](function(_0x2b0ba){return _0x2b0ba;});}return null;};}function removeEntity(_0x3a4a1b,_0x458a92){return function(_0x15bfd0){if(_0x15bfd0){return _0x15bfd0[_0x37d1('0x35')]()[_0x37d1('0x20')](function(){_0x3a4a1b[_0x37d1('0x2a')](0xcc)[_0x37d1('0x29')]();});}};}function handleEntityNotFound(_0x212beb,_0x1709cd){return function(_0xbe9631){if(!_0xbe9631){_0x212beb[_0x37d1('0x36')](0x194);}return _0xbe9631;};}function handleError(_0x2c0b9d,_0x55aeb4){_0x55aeb4=_0x55aeb4||0x1f4;return function(_0x3ed42e){logger['error'](_0x3ed42e[_0x37d1('0x37')]);if(_0x3ed42e[_0x37d1('0x38')]){delete _0x3ed42e[_0x37d1('0x38')];}_0x2c0b9d[_0x37d1('0x2a')](_0x55aeb4)[_0x37d1('0x39')](_0x3ed42e);};}exports[_0x37d1('0x3a')]=function(_0x47caeb,_0x1ffba1){var _0x272eff={},_0x1fde67={},_0x1e60c1={'count':0x0,'rows':[]};var _0x56be4f=_[_0x37d1('0x3b')](db['VtigerConfiguration'][_0x37d1('0x3c')],function(_0x5f13de){return{'name':_0x5f13de[_0x37d1('0x3d')],'type':_0x5f13de[_0x37d1('0x3e')][_0x37d1('0x3f')]};});_0x1fde67['model']=_['map'](_0x56be4f,_0x37d1('0x38'));_0x1fde67['query']=_[_0x37d1('0x40')](_0x47caeb['query']);_0x1fde67[_0x37d1('0x41')]=_[_0x37d1('0x42')](_0x1fde67[_0x37d1('0x43')],_0x1fde67[_0x37d1('0x44')]);_0x272eff[_0x37d1('0x45')]=_[_0x37d1('0x42')](_0x1fde67[_0x37d1('0x43')],qs[_0x37d1('0x46')](_0x47caeb[_0x37d1('0x44')]['fields']));_0x272eff['attributes']=_0x272eff[_0x37d1('0x45')][_0x37d1('0x47')]?_0x272eff['attributes']:_0x1fde67[_0x37d1('0x43')];if(!_0x47caeb[_0x37d1('0x44')][_0x37d1('0x48')](_0x37d1('0x49'))){_0x272eff[_0x37d1('0x2e')]=qs[_0x37d1('0x2e')](_0x47caeb['query'][_0x37d1('0x2e')]);_0x272eff[_0x37d1('0x2d')]=qs[_0x37d1('0x2d')](_0x47caeb[_0x37d1('0x44')][_0x37d1('0x2d')]);}_0x272eff['order']=qs[_0x37d1('0x4a')](_0x47caeb[_0x37d1('0x44')][_0x37d1('0x4a')]);_0x272eff[_0x37d1('0x4b')]=qs[_0x37d1('0x41')](_[_0x37d1('0x4c')](_0x47caeb['query'],_0x1fde67['filters']));if(_0x47caeb['query'][_0x37d1('0x4d')]){_0x272eff[_0x37d1('0x4b')]=_[_0x37d1('0x4e')](_0x272eff[_0x37d1('0x4b')],{'$or':_[_0x37d1('0x3b')](_0x56be4f,function(_0x433017){if(_0x433017[_0x37d1('0x3e')]!==_0x37d1('0x4f')){var _0xbdc5a9={};_0xbdc5a9[_0x433017[_0x37d1('0x38')]]={'$like':'%'+_0x47caeb[_0x37d1('0x44')]['filter']+'%'};return _0xbdc5a9;}})});}_0x272eff=_[_0x37d1('0x4e')]({},_0x272eff,_0x47caeb[_0x37d1('0x50')]);var _0x5c87a={'where':_0x272eff[_0x37d1('0x4b')]};return db[_0x37d1('0x51')][_0x37d1('0x2c')](_0x5c87a)[_0x37d1('0x20')](function(_0x19ea36){_0x1e60c1[_0x37d1('0x2c')]=_0x19ea36;if(_0x47caeb[_0x37d1('0x44')][_0x37d1('0x52')]){_0x272eff[_0x37d1('0x53')]=[{'all':!![]}];}return db['VtigerConfiguration'][_0x37d1('0x54')](_0x272eff);})[_0x37d1('0x20')](function(_0x4463a5){_0x1e60c1[_0x37d1('0x55')]=_0x4463a5;return _0x1e60c1;})[_0x37d1('0x20')](respondWithFilteredResult(_0x1ffba1,_0x272eff))[_0x37d1('0x56')](handleError(_0x1ffba1,null));};exports['show']=function(_0x40c58b,_0x1b4c7d){var _0x2dedb5={'raw':![],'where':{'id':_0x40c58b[_0x37d1('0x57')]['id']}},_0x1272a7={};_0x1272a7[_0x37d1('0x43')]=_['keys'](db[_0x37d1('0x51')][_0x37d1('0x3c')]);_0x1272a7['query']=_[_0x37d1('0x40')](_0x40c58b[_0x37d1('0x44')]);_0x1272a7[_0x37d1('0x41')]=_[_0x37d1('0x42')](_0x1272a7[_0x37d1('0x43')],_0x1272a7[_0x37d1('0x44')]);_0x2dedb5[_0x37d1('0x45')]=_[_0x37d1('0x42')](_0x1272a7['model'],qs['fields'](_0x40c58b[_0x37d1('0x44')][_0x37d1('0x46')]));_0x2dedb5[_0x37d1('0x45')]=_0x2dedb5['attributes'][_0x37d1('0x47')]?_0x2dedb5[_0x37d1('0x45')]:_0x1272a7['model'];if(_0x40c58b['query']['includeAll']){_0x2dedb5['include']=[{'all':!![]}];}_0x2dedb5=_[_0x37d1('0x4e')]({},_0x2dedb5,_0x40c58b[_0x37d1('0x50')]);return db['VtigerConfiguration']['find'](_0x2dedb5)[_0x37d1('0x20')](handleEntityNotFound(_0x1b4c7d,null))[_0x37d1('0x20')](respondWithResult(_0x1b4c7d,null))[_0x37d1('0x56')](handleError(_0x1b4c7d,null));};exports[_0x37d1('0x58')]=function(_0x2223a3,_0x20c695){return db['VtigerConfiguration'][_0x37d1('0x58')](_0x2223a3[_0x37d1('0x59')],{})['then'](respondWithResult(_0x20c695,0xc9))[_0x37d1('0x56')](handleError(_0x20c695,null));};exports[_0x37d1('0x34')]=function(_0x23beb3,_0x15972b){if(_0x23beb3[_0x37d1('0x59')]['id']){delete _0x23beb3[_0x37d1('0x59')]['id'];}return db[_0x37d1('0x51')]['find']({'where':{'id':_0x23beb3[_0x37d1('0x57')]['id']}})['then'](handleEntityNotFound(_0x15972b,null))[_0x37d1('0x20')](saveUpdates(_0x23beb3['body'],null))[_0x37d1('0x20')](respondWithResult(_0x15972b,null))[_0x37d1('0x56')](handleError(_0x15972b,null));};exports[_0x37d1('0x35')]=function(_0x3f2bae,_0x8bc644){return db[_0x37d1('0x51')][_0x37d1('0x5a')]({'where':{'id':_0x3f2bae[_0x37d1('0x57')]['id']}})[_0x37d1('0x20')](handleEntityNotFound(_0x8bc644,null))['then'](removeEntity(_0x8bc644,null))[_0x37d1('0x56')](handleError(_0x8bc644,null));};exports['getFields']=function(_0x43cbf0,_0x2e5a68,_0x482aa5){var _0x46e6c1={};var _0x1840e5={};var _0x57f11a;var _0x7b3ac3;return db['VtigerConfiguration'][_0x37d1('0x5b')]({'where':{'id':_0x43cbf0[_0x37d1('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e5a68,null))[_0x37d1('0x20')](function(_0x3e5e8b){if(_0x3e5e8b){_0x57f11a=_0x3e5e8b;_0x1840e5['model']=_[_0x37d1('0x40')](db['VtigerField'][_0x37d1('0x3c')]);_0x1840e5[_0x37d1('0x44')]=_[_0x37d1('0x40')](_0x43cbf0['query']);_0x1840e5[_0x37d1('0x41')]=_[_0x37d1('0x42')](_0x1840e5[_0x37d1('0x43')],_0x1840e5[_0x37d1('0x44')]);_0x46e6c1['attributes']=_[_0x37d1('0x42')](_0x1840e5[_0x37d1('0x43')],qs[_0x37d1('0x46')](_0x43cbf0[_0x37d1('0x44')][_0x37d1('0x46')]));_0x46e6c1[_0x37d1('0x45')]=_0x46e6c1[_0x37d1('0x45')][_0x37d1('0x47')]?_0x46e6c1[_0x37d1('0x45')]:_0x1840e5[_0x37d1('0x43')];_0x46e6c1['order']=qs['sort'](_0x43cbf0['query'][_0x37d1('0x4a')]);_0x46e6c1['where']=qs[_0x37d1('0x41')](_[_0x37d1('0x4c')](_0x43cbf0['query'],_0x1840e5[_0x37d1('0x41')]));if(_0x43cbf0[_0x37d1('0x44')][_0x37d1('0x4d')]){_0x46e6c1[_0x37d1('0x4b')]=_[_0x37d1('0x4e')](_0x46e6c1[_0x37d1('0x4b')],{'$or':_[_0x37d1('0x3b')](_0x46e6c1[_0x37d1('0x45')],function(_0x8d1f48){var _0x547785={};_0x547785[_0x8d1f48]={'$like':'%'+_0x43cbf0['query'][_0x37d1('0x4d')]+'%'};return _0x547785;})});}_0x46e6c1=_[_0x37d1('0x4e')]({},_0x46e6c1,_0x43cbf0['options']);return _0x57f11a[_0x37d1('0x5c')](_0x46e6c1);}})[_0x37d1('0x20')](function(_0x33a0be){if(_0x33a0be){_0x7b3ac3=_0x33a0be['length'];if(!_0x43cbf0[_0x37d1('0x44')][_0x37d1('0x48')](_0x37d1('0x49'))){_0x46e6c1[_0x37d1('0x2e')]=qs[_0x37d1('0x2e')](_0x43cbf0[_0x37d1('0x44')]['limit']);_0x46e6c1[_0x37d1('0x2d')]=qs[_0x37d1('0x2d')](_0x43cbf0[_0x37d1('0x44')][_0x37d1('0x2d')]);}return _0x57f11a['getFields'](_0x46e6c1);}})['then'](function(_0x3c54d1){if(_0x3c54d1){return _0x3c54d1?{'count':_0x7b3ac3,'rows':_0x3c54d1}:null;}})[_0x37d1('0x20')](respondWithResult(_0x2e5a68,null))['catch'](handleError(_0x2e5a68,null));};exports[_0x37d1('0x5d')]=function(_0x1a6740,_0x525869,_0x202d5c){var _0x7514c8={};var _0x35b6bb={};var _0x5a072e;var _0x540e70;return db[_0x37d1('0x51')][_0x37d1('0x5b')]({'where':{'id':_0x1a6740[_0x37d1('0x57')]['id']}})[_0x37d1('0x20')](handleEntityNotFound(_0x525869,null))[_0x37d1('0x20')](function(_0x5165eb){if(_0x5165eb){_0x5a072e=_0x5165eb;_0x35b6bb[_0x37d1('0x43')]=_[_0x37d1('0x40')](db[_0x37d1('0x5e')][_0x37d1('0x3c')]);_0x35b6bb[_0x37d1('0x44')]=_[_0x37d1('0x40')](_0x1a6740['query']);_0x35b6bb[_0x37d1('0x41')]=_[_0x37d1('0x42')](_0x35b6bb[_0x37d1('0x43')],_0x35b6bb['query']);_0x7514c8[_0x37d1('0x45')]=_[_0x37d1('0x42')](_0x35b6bb[_0x37d1('0x43')],qs[_0x37d1('0x46')](_0x1a6740[_0x37d1('0x44')][_0x37d1('0x46')]));_0x7514c8['attributes']=_0x7514c8[_0x37d1('0x45')]['length']?_0x7514c8[_0x37d1('0x45')]:_0x35b6bb[_0x37d1('0x43')];_0x7514c8[_0x37d1('0x5f')]=qs['sort'](_0x1a6740[_0x37d1('0x44')]['sort']);_0x7514c8['where']=qs[_0x37d1('0x41')](_[_0x37d1('0x4c')](_0x1a6740[_0x37d1('0x44')],_0x35b6bb['filters']));if(_0x1a6740[_0x37d1('0x44')][_0x37d1('0x4d')]){_0x7514c8[_0x37d1('0x4b')]=_[_0x37d1('0x4e')](_0x7514c8[_0x37d1('0x4b')],{'$or':_[_0x37d1('0x3b')](_0x7514c8[_0x37d1('0x45')],function(_0x2e3ff5){var _0x523155={};_0x523155[_0x2e3ff5]={'$like':'%'+_0x1a6740[_0x37d1('0x44')][_0x37d1('0x4d')]+'%'};return _0x523155;})});}_0x7514c8=_['merge']({},_0x7514c8,_0x1a6740[_0x37d1('0x50')]);return _0x5a072e['getSubjects'](_0x7514c8);}})['then'](function(_0x2e3e2b){if(_0x2e3e2b){_0x540e70=_0x2e3e2b['length'];if(!_0x1a6740['query'][_0x37d1('0x48')](_0x37d1('0x49'))){_0x7514c8[_0x37d1('0x2e')]=qs[_0x37d1('0x2e')](_0x1a6740['query'][_0x37d1('0x2e')]);_0x7514c8[_0x37d1('0x2d')]=qs[_0x37d1('0x2d')](_0x1a6740[_0x37d1('0x44')][_0x37d1('0x2d')]);}return _0x5a072e[_0x37d1('0x5d')](_0x7514c8);}})['then'](function(_0x4c293a){if(_0x4c293a){return _0x4c293a?{'count':_0x540e70,'rows':_0x4c293a}:null;}})[_0x37d1('0x20')](respondWithResult(_0x525869,null))[_0x37d1('0x56')](handleError(_0x525869,null));};exports[_0x37d1('0x60')]=function(_0x31c360,_0x311d59,_0xa1bfb4){var _0x6613a={};var _0x5ae693={};var _0x35401f;var _0x503513;return db[_0x37d1('0x51')]['findOne']({'where':{'id':_0x31c360[_0x37d1('0x57')]['id']}})[_0x37d1('0x20')](handleEntityNotFound(_0x311d59,null))[_0x37d1('0x20')](function(_0x1a9193){if(_0x1a9193){_0x35401f=_0x1a9193;_0x5ae693[_0x37d1('0x43')]=_[_0x37d1('0x40')](db[_0x37d1('0x5e')][_0x37d1('0x3c')]);_0x5ae693[_0x37d1('0x44')]=_['keys'](_0x31c360[_0x37d1('0x44')]);_0x5ae693[_0x37d1('0x41')]=_['intersection'](_0x5ae693[_0x37d1('0x43')],_0x5ae693[_0x37d1('0x44')]);_0x6613a[_0x37d1('0x45')]=_['intersection'](_0x5ae693[_0x37d1('0x43')],qs[_0x37d1('0x46')](_0x31c360[_0x37d1('0x44')][_0x37d1('0x46')]));_0x6613a[_0x37d1('0x45')]=_0x6613a[_0x37d1('0x45')]['length']?_0x6613a[_0x37d1('0x45')]:_0x5ae693[_0x37d1('0x43')];_0x6613a['order']=qs[_0x37d1('0x4a')](_0x31c360[_0x37d1('0x44')][_0x37d1('0x4a')]);_0x6613a['where']=qs[_0x37d1('0x41')](_[_0x37d1('0x4c')](_0x31c360[_0x37d1('0x44')],_0x5ae693[_0x37d1('0x41')]));if(_0x31c360[_0x37d1('0x44')]['filter']){_0x6613a[_0x37d1('0x4b')]=_['merge'](_0x6613a[_0x37d1('0x4b')],{'$or':_[_0x37d1('0x3b')](_0x6613a[_0x37d1('0x45')],function(_0x2653a7){var _0x39c480={};_0x39c480[_0x2653a7]={'$like':'%'+_0x31c360[_0x37d1('0x44')]['filter']+'%'};return _0x39c480;})});}_0x6613a=_[_0x37d1('0x4e')]({},_0x6613a,_0x31c360[_0x37d1('0x50')]);return _0x35401f[_0x37d1('0x60')](_0x6613a);}})[_0x37d1('0x20')](function(_0x2828c9){if(_0x2828c9){_0x503513=_0x2828c9['length'];if(!_0x31c360[_0x37d1('0x44')]['hasOwnProperty'](_0x37d1('0x49'))){_0x6613a[_0x37d1('0x2e')]=qs['limit'](_0x31c360[_0x37d1('0x44')]['limit']);_0x6613a[_0x37d1('0x2d')]=qs[_0x37d1('0x2d')](_0x31c360['query'][_0x37d1('0x2d')]);}return _0x35401f['getDescriptions'](_0x6613a);}})['then'](function(_0x5c09f7){if(_0x5c09f7){return _0x5c09f7?{'count':_0x503513,'rows':_0x5c09f7}:null;}})[_0x37d1('0x20')](respondWithResult(_0x311d59,null))[_0x37d1('0x56')](handleError(_0x311d59,null));}; \ No newline at end of file +var _0xdbb2=['type','key','map','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','include','rows','show','rawAttributes','fields','length','create','body','find','params','getFields','findOne','getSubjects','VtigerField','getDescriptions','html-pdf','eml-format','rimraf','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','VtigerConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','sendStatus','stack','name','send','index','VtigerConfiguration','fieldName'];(function(_0x590de9,_0x13de5d){var _0x1416d1=function(_0x92c8bf){while(--_0x92c8bf){_0x590de9['push'](_0x590de9['shift']());}};_0x1416d1(++_0x13de5d);}(_0xdbb2,0x134));var _0x2dbb=function(_0x43cc69,_0x401eea){_0x43cc69=_0x43cc69-0x0;var _0xde43ae=_0xdbb2[_0x43cc69];return _0xde43ae;};'use strict';var pdf=require(_0x2dbb('0x0'));var emlformat=require(_0x2dbb('0x1'));var rimraf=require(_0x2dbb('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2dbb('0x3'));var BPromise=require(_0x2dbb('0x4'));var Mustache=require(_0x2dbb('0x5'));var util=require('util');var path=require(_0x2dbb('0x6'));var sox=require(_0x2dbb('0x7'));var csv=require(_0x2dbb('0x8'));var ejs=require(_0x2dbb('0x9'));var fs=require('fs');var _=require(_0x2dbb('0xa'));var squel=require('squel');var crypto=require(_0x2dbb('0xb'));var jsforce=require(_0x2dbb('0xc'));var deskjs=require(_0x2dbb('0xd'));var toCsv=require(_0x2dbb('0x8'));var querystring=require('querystring');var Papa=require(_0x2dbb('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x2dbb('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2dbb('0x10'));var logger=require(_0x2dbb('0x11'))(_0x2dbb('0x12'));var utils=require(_0x2dbb('0x13'));var config=require('../../config/environment');var db=require(_0x2dbb('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x2dbb('0x15')][_0x2dbb('0x16')]({'port':0x232a});function checkPasswordPattern(_0xfab1a5,_0x4b3a18,_0x3dac29){if(_0x3dac29){var _0x3727d8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3727d8[_0x2dbb('0x17')](_0x4b3a18)){return _0xfab1a5;}else{throw new db['Sequelize'][(_0x2dbb('0x18'))](_0x2dbb('0x19'));}}else{return _0xfab1a5;}}function respondWithRpcPromise(_0x975d44,_0x888db0,_0x4f5a68,_0x5682a5){return new BPromise(function(_0x171505,_0x51715e){var _0x2f1388=_0x5682a5||client;return _0x2f1388[_0x2dbb('0x1a')](_0x975d44,_0x4f5a68)['then'](function(_0x3c404c){logger[_0x2dbb('0x1b')](_0x2dbb('0x1c'),_0x888db0,'request\x20sent');logger[_0x2dbb('0x1d')]('VtigerConfiguration,\x20%s,\x20%s,\x20%s',_0x888db0,_0x2dbb('0x1e'),JSON[_0x2dbb('0x1f')](_0x3c404c));if(_0x3c404c[_0x2dbb('0x20')]){if(_0x3c404c[_0x2dbb('0x20')][_0x2dbb('0x21')]===0x1f4){logger[_0x2dbb('0x20')](_0x2dbb('0x1c'),_0x888db0,_0x3c404c[_0x2dbb('0x20')]['message']);return _0x51715e(_0x3c404c[_0x2dbb('0x20')][_0x2dbb('0x22')]);}logger[_0x2dbb('0x20')](_0x2dbb('0x1c'),_0x888db0,_0x3c404c[_0x2dbb('0x20')][_0x2dbb('0x22')]);return _0x171505(_0x3c404c[_0x2dbb('0x20')][_0x2dbb('0x22')]);}else{logger[_0x2dbb('0x1b')](_0x2dbb('0x1c'),_0x888db0,_0x2dbb('0x1e'));_0x171505(_0x3c404c[_0x2dbb('0x23')][_0x2dbb('0x22')]);}})[_0x2dbb('0x24')](function(_0x26acd1){logger[_0x2dbb('0x20')]('VtigerConfiguration,\x20%s,\x20%s',_0x888db0,_0x26acd1);_0x51715e(_0x26acd1);});});}function respondWithStatusCode(_0x213d47,_0x3646d5){_0x3646d5=_0x3646d5||0xcc;return function(_0x20c630){if(_0x20c630){return _0x213d47['sendStatus'](_0x3646d5);}return _0x213d47[_0x2dbb('0x25')](_0x3646d5)[_0x2dbb('0x26')]();};}function respondWithResult(_0xb3512a,_0x16d09e){_0x16d09e=_0x16d09e||0xc8;return function(_0x46c741){if(_0x46c741){return _0xb3512a[_0x2dbb('0x25')](_0x16d09e)[_0x2dbb('0x27')](_0x46c741);}};}function respondWithFilteredResult(_0x38fa2f,_0x2a0ec5){return function(_0x47590b){if(_0x47590b){var _0x4e6e81=_0x47590b[_0x2dbb('0x28')],_0x392cb0=_0x2a0ec5[_0x2dbb('0x29')],_0x4c139e=_0x2a0ec5[_0x2dbb('0x29')]+_0x2a0ec5[_0x2dbb('0x2a')],_0x37e68c;if(_0x4c139e>=_0x4e6e81){_0x4c139e=_0x4e6e81;_0x37e68c=0xc8;}else{_0x37e68c=0xce;}_0x38fa2f[_0x2dbb('0x25')](_0x37e68c);return _0x38fa2f[_0x2dbb('0x2b')]('Content-Range',_0x392cb0+'-'+_0x4c139e+'/'+_0x4e6e81)[_0x2dbb('0x27')](_0x47590b);}return null;};}function patchUpdates(_0x26f459){return function(_0x3419f6){try{jsonpatch[_0x2dbb('0x2c')](_0x3419f6,_0x26f459,!![]);}catch(_0x37e332){return BPromise['reject'](_0x37e332);}return _0x3419f6[_0x2dbb('0x2d')]();};}function saveUpdates(_0x5c83e4,_0x3016e7){return function(_0x214161){if(_0x214161){return _0x214161[_0x2dbb('0x2e')](_0x5c83e4)[_0x2dbb('0x2f')](function(_0x12f0fc){return _0x12f0fc;});}return null;};}function removeEntity(_0x9de795,_0x141cfc){return function(_0x446e19){if(_0x446e19){return _0x446e19[_0x2dbb('0x30')]()[_0x2dbb('0x2f')](function(){_0x9de795[_0x2dbb('0x25')](0xcc)[_0x2dbb('0x26')]();});}};}function handleEntityNotFound(_0x5dedc9,_0x181ae9){return function(_0x2a184f){if(!_0x2a184f){_0x5dedc9[_0x2dbb('0x31')](0x194);}return _0x2a184f;};}function handleError(_0x37e8ca,_0x27658b){_0x27658b=_0x27658b||0x1f4;return function(_0x14ebdf){logger[_0x2dbb('0x20')](_0x14ebdf[_0x2dbb('0x32')]);if(_0x14ebdf['name']){delete _0x14ebdf[_0x2dbb('0x33')];}_0x37e8ca[_0x2dbb('0x25')](_0x27658b)[_0x2dbb('0x34')](_0x14ebdf);};}exports[_0x2dbb('0x35')]=function(_0x372b7f,_0x4a8181){var _0x2df49e={},_0x23c6b3={},_0x19b16e={'count':0x0,'rows':[]};var _0x4794da=_['map'](db[_0x2dbb('0x36')]['rawAttributes'],function(_0x3eeaa1){return{'name':_0x3eeaa1[_0x2dbb('0x37')],'type':_0x3eeaa1[_0x2dbb('0x38')][_0x2dbb('0x39')]};});_0x23c6b3['model']=_[_0x2dbb('0x3a')](_0x4794da,'name');_0x23c6b3[_0x2dbb('0x3b')]=_[_0x2dbb('0x3c')](_0x372b7f['query']);_0x23c6b3[_0x2dbb('0x3d')]=_[_0x2dbb('0x3e')](_0x23c6b3[_0x2dbb('0x3f')],_0x23c6b3['query']);_0x2df49e[_0x2dbb('0x40')]=_['intersection'](_0x23c6b3[_0x2dbb('0x3f')],qs['fields'](_0x372b7f[_0x2dbb('0x3b')]['fields']));_0x2df49e[_0x2dbb('0x40')]=_0x2df49e['attributes']['length']?_0x2df49e['attributes']:_0x23c6b3[_0x2dbb('0x3f')];if(!_0x372b7f['query'][_0x2dbb('0x41')](_0x2dbb('0x42'))){_0x2df49e[_0x2dbb('0x2a')]=qs['limit'](_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x2a')]);_0x2df49e['offset']=qs[_0x2dbb('0x29')](_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x29')]);}_0x2df49e[_0x2dbb('0x43')]=qs[_0x2dbb('0x44')](_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x44')]);_0x2df49e[_0x2dbb('0x45')]=qs['filters'](_[_0x2dbb('0x46')](_0x372b7f[_0x2dbb('0x3b')],_0x23c6b3['filters']));if(_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x47')]){_0x2df49e[_0x2dbb('0x45')]=_['merge'](_0x2df49e[_0x2dbb('0x45')],{'$or':_[_0x2dbb('0x3a')](_0x4794da,function(_0x333ed1){if(_0x333ed1['type']!==_0x2dbb('0x48')){var _0x53f8b5={};_0x53f8b5[_0x333ed1[_0x2dbb('0x33')]]={'$like':'%'+_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x47')]+'%'};return _0x53f8b5;}})});}_0x2df49e=_[_0x2dbb('0x49')]({},_0x2df49e,_0x372b7f[_0x2dbb('0x4a')]);var _0x32040b={'where':_0x2df49e[_0x2dbb('0x45')]};return db['VtigerConfiguration'][_0x2dbb('0x28')](_0x32040b)['then'](function(_0x212046){_0x19b16e[_0x2dbb('0x28')]=_0x212046;if(_0x372b7f[_0x2dbb('0x3b')][_0x2dbb('0x4b')]){_0x2df49e[_0x2dbb('0x4c')]=[{'all':!![]}];}return db['VtigerConfiguration']['findAll'](_0x2df49e);})[_0x2dbb('0x2f')](function(_0x3640c9){_0x19b16e[_0x2dbb('0x4d')]=_0x3640c9;return _0x19b16e;})['then'](respondWithFilteredResult(_0x4a8181,_0x2df49e))['catch'](handleError(_0x4a8181,null));};exports[_0x2dbb('0x4e')]=function(_0x51b732,_0x4ac89c){var _0x1a672f={'raw':![],'where':{'id':_0x51b732['params']['id']}},_0x3e6012={};_0x3e6012[_0x2dbb('0x3f')]=_[_0x2dbb('0x3c')](db[_0x2dbb('0x36')][_0x2dbb('0x4f')]);_0x3e6012[_0x2dbb('0x3b')]=_[_0x2dbb('0x3c')](_0x51b732[_0x2dbb('0x3b')]);_0x3e6012[_0x2dbb('0x3d')]=_['intersection'](_0x3e6012['model'],_0x3e6012[_0x2dbb('0x3b')]);_0x1a672f[_0x2dbb('0x40')]=_[_0x2dbb('0x3e')](_0x3e6012[_0x2dbb('0x3f')],qs['fields'](_0x51b732[_0x2dbb('0x3b')][_0x2dbb('0x50')]));_0x1a672f[_0x2dbb('0x40')]=_0x1a672f[_0x2dbb('0x40')][_0x2dbb('0x51')]?_0x1a672f[_0x2dbb('0x40')]:_0x3e6012['model'];if(_0x51b732[_0x2dbb('0x3b')][_0x2dbb('0x4b')]){_0x1a672f[_0x2dbb('0x4c')]=[{'all':!![]}];}_0x1a672f=_[_0x2dbb('0x49')]({},_0x1a672f,_0x51b732[_0x2dbb('0x4a')]);return db['VtigerConfiguration']['find'](_0x1a672f)['then'](handleEntityNotFound(_0x4ac89c,null))['then'](respondWithResult(_0x4ac89c,null))[_0x2dbb('0x24')](handleError(_0x4ac89c,null));};exports[_0x2dbb('0x52')]=function(_0x34e8c3,_0x547294){return db[_0x2dbb('0x36')]['create'](_0x34e8c3[_0x2dbb('0x53')],{})[_0x2dbb('0x2f')](respondWithResult(_0x547294,0xc9))[_0x2dbb('0x24')](handleError(_0x547294,null));};exports['update']=function(_0x1110a7,_0x3e07a1){if(_0x1110a7[_0x2dbb('0x53')]['id']){delete _0x1110a7['body']['id'];}return db[_0x2dbb('0x36')][_0x2dbb('0x54')]({'where':{'id':_0x1110a7[_0x2dbb('0x55')]['id']}})[_0x2dbb('0x2f')](handleEntityNotFound(_0x3e07a1,null))['then'](saveUpdates(_0x1110a7[_0x2dbb('0x53')],null))[_0x2dbb('0x2f')](respondWithResult(_0x3e07a1,null))[_0x2dbb('0x24')](handleError(_0x3e07a1,null));};exports[_0x2dbb('0x30')]=function(_0x4743f0,_0x43121e){return db[_0x2dbb('0x36')][_0x2dbb('0x54')]({'where':{'id':_0x4743f0[_0x2dbb('0x55')]['id']}})[_0x2dbb('0x2f')](handleEntityNotFound(_0x43121e,null))['then'](removeEntity(_0x43121e,null))[_0x2dbb('0x24')](handleError(_0x43121e,null));};exports[_0x2dbb('0x56')]=function(_0x76b6e5,_0x2825a0,_0x9b9013){var _0x46dd9b={};var _0x10d1e5={};var _0x32d84a;var _0x5a8375;return db[_0x2dbb('0x36')][_0x2dbb('0x57')]({'where':{'id':_0x76b6e5[_0x2dbb('0x55')]['id']}})['then'](handleEntityNotFound(_0x2825a0,null))[_0x2dbb('0x2f')](function(_0x1d79eb){if(_0x1d79eb){_0x32d84a=_0x1d79eb;_0x10d1e5['model']=_[_0x2dbb('0x3c')](db['VtigerField'][_0x2dbb('0x4f')]);_0x10d1e5[_0x2dbb('0x3b')]=_[_0x2dbb('0x3c')](_0x76b6e5[_0x2dbb('0x3b')]);_0x10d1e5[_0x2dbb('0x3d')]=_[_0x2dbb('0x3e')](_0x10d1e5['model'],_0x10d1e5[_0x2dbb('0x3b')]);_0x46dd9b[_0x2dbb('0x40')]=_['intersection'](_0x10d1e5['model'],qs[_0x2dbb('0x50')](_0x76b6e5[_0x2dbb('0x3b')]['fields']));_0x46dd9b[_0x2dbb('0x40')]=_0x46dd9b[_0x2dbb('0x40')][_0x2dbb('0x51')]?_0x46dd9b['attributes']:_0x10d1e5[_0x2dbb('0x3f')];_0x46dd9b[_0x2dbb('0x43')]=qs[_0x2dbb('0x44')](_0x76b6e5[_0x2dbb('0x3b')][_0x2dbb('0x44')]);_0x46dd9b[_0x2dbb('0x45')]=qs[_0x2dbb('0x3d')](_['pick'](_0x76b6e5[_0x2dbb('0x3b')],_0x10d1e5[_0x2dbb('0x3d')]));if(_0x76b6e5[_0x2dbb('0x3b')][_0x2dbb('0x47')]){_0x46dd9b[_0x2dbb('0x45')]=_[_0x2dbb('0x49')](_0x46dd9b[_0x2dbb('0x45')],{'$or':_['map'](_0x46dd9b[_0x2dbb('0x40')],function(_0x4036c0){var _0x418d91={};_0x418d91[_0x4036c0]={'$like':'%'+_0x76b6e5[_0x2dbb('0x3b')][_0x2dbb('0x47')]+'%'};return _0x418d91;})});}_0x46dd9b=_[_0x2dbb('0x49')]({},_0x46dd9b,_0x76b6e5[_0x2dbb('0x4a')]);return _0x32d84a['getFields'](_0x46dd9b);}})[_0x2dbb('0x2f')](function(_0x4a4123){if(_0x4a4123){_0x5a8375=_0x4a4123[_0x2dbb('0x51')];if(!_0x76b6e5['query'][_0x2dbb('0x41')](_0x2dbb('0x42'))){_0x46dd9b[_0x2dbb('0x2a')]=qs['limit'](_0x76b6e5[_0x2dbb('0x3b')]['limit']);_0x46dd9b[_0x2dbb('0x29')]=qs[_0x2dbb('0x29')](_0x76b6e5[_0x2dbb('0x3b')][_0x2dbb('0x29')]);}return _0x32d84a[_0x2dbb('0x56')](_0x46dd9b);}})[_0x2dbb('0x2f')](function(_0x3387a0){if(_0x3387a0){return _0x3387a0?{'count':_0x5a8375,'rows':_0x3387a0}:null;}})[_0x2dbb('0x2f')](respondWithResult(_0x2825a0,null))[_0x2dbb('0x24')](handleError(_0x2825a0,null));};exports[_0x2dbb('0x58')]=function(_0x118473,_0x3b52e9,_0x281fe7){var _0x356031={};var _0xe3f51d={};var _0x2c716d;var _0xd8a755;return db[_0x2dbb('0x36')][_0x2dbb('0x57')]({'where':{'id':_0x118473[_0x2dbb('0x55')]['id']}})[_0x2dbb('0x2f')](handleEntityNotFound(_0x3b52e9,null))[_0x2dbb('0x2f')](function(_0x4cadda){if(_0x4cadda){_0x2c716d=_0x4cadda;_0xe3f51d[_0x2dbb('0x3f')]=_['keys'](db[_0x2dbb('0x59')][_0x2dbb('0x4f')]);_0xe3f51d['query']=_['keys'](_0x118473['query']);_0xe3f51d[_0x2dbb('0x3d')]=_[_0x2dbb('0x3e')](_0xe3f51d[_0x2dbb('0x3f')],_0xe3f51d[_0x2dbb('0x3b')]);_0x356031[_0x2dbb('0x40')]=_['intersection'](_0xe3f51d[_0x2dbb('0x3f')],qs[_0x2dbb('0x50')](_0x118473[_0x2dbb('0x3b')][_0x2dbb('0x50')]));_0x356031[_0x2dbb('0x40')]=_0x356031[_0x2dbb('0x40')]['length']?_0x356031[_0x2dbb('0x40')]:_0xe3f51d['model'];_0x356031[_0x2dbb('0x43')]=qs[_0x2dbb('0x44')](_0x118473[_0x2dbb('0x3b')][_0x2dbb('0x44')]);_0x356031[_0x2dbb('0x45')]=qs[_0x2dbb('0x3d')](_[_0x2dbb('0x46')](_0x118473[_0x2dbb('0x3b')],_0xe3f51d[_0x2dbb('0x3d')]));if(_0x118473[_0x2dbb('0x3b')][_0x2dbb('0x47')]){_0x356031[_0x2dbb('0x45')]=_['merge'](_0x356031[_0x2dbb('0x45')],{'$or':_[_0x2dbb('0x3a')](_0x356031[_0x2dbb('0x40')],function(_0x240afe){var _0x14bd96={};_0x14bd96[_0x240afe]={'$like':'%'+_0x118473['query'][_0x2dbb('0x47')]+'%'};return _0x14bd96;})});}_0x356031=_[_0x2dbb('0x49')]({},_0x356031,_0x118473[_0x2dbb('0x4a')]);return _0x2c716d[_0x2dbb('0x58')](_0x356031);}})[_0x2dbb('0x2f')](function(_0x256ecf){if(_0x256ecf){_0xd8a755=_0x256ecf['length'];if(!_0x118473[_0x2dbb('0x3b')][_0x2dbb('0x41')]('nolimit')){_0x356031[_0x2dbb('0x2a')]=qs[_0x2dbb('0x2a')](_0x118473['query'][_0x2dbb('0x2a')]);_0x356031[_0x2dbb('0x29')]=qs[_0x2dbb('0x29')](_0x118473['query'][_0x2dbb('0x29')]);}return _0x2c716d[_0x2dbb('0x58')](_0x356031);}})[_0x2dbb('0x2f')](function(_0x5d3167){if(_0x5d3167){return _0x5d3167?{'count':_0xd8a755,'rows':_0x5d3167}:null;}})['then'](respondWithResult(_0x3b52e9,null))[_0x2dbb('0x24')](handleError(_0x3b52e9,null));};exports[_0x2dbb('0x5a')]=function(_0x330dce,_0x33aeee,_0x4c973b){var _0x3905c1={};var _0x5b95c6={};var _0x5e3460;var _0x59d884;return db[_0x2dbb('0x36')]['findOne']({'where':{'id':_0x330dce['params']['id']}})['then'](handleEntityNotFound(_0x33aeee,null))[_0x2dbb('0x2f')](function(_0x3b52b1){if(_0x3b52b1){_0x5e3460=_0x3b52b1;_0x5b95c6[_0x2dbb('0x3f')]=_[_0x2dbb('0x3c')](db[_0x2dbb('0x59')][_0x2dbb('0x4f')]);_0x5b95c6[_0x2dbb('0x3b')]=_[_0x2dbb('0x3c')](_0x330dce[_0x2dbb('0x3b')]);_0x5b95c6[_0x2dbb('0x3d')]=_[_0x2dbb('0x3e')](_0x5b95c6[_0x2dbb('0x3f')],_0x5b95c6[_0x2dbb('0x3b')]);_0x3905c1[_0x2dbb('0x40')]=_['intersection'](_0x5b95c6['model'],qs[_0x2dbb('0x50')](_0x330dce[_0x2dbb('0x3b')][_0x2dbb('0x50')]));_0x3905c1[_0x2dbb('0x40')]=_0x3905c1[_0x2dbb('0x40')][_0x2dbb('0x51')]?_0x3905c1[_0x2dbb('0x40')]:_0x5b95c6[_0x2dbb('0x3f')];_0x3905c1[_0x2dbb('0x43')]=qs[_0x2dbb('0x44')](_0x330dce['query'][_0x2dbb('0x44')]);_0x3905c1['where']=qs[_0x2dbb('0x3d')](_[_0x2dbb('0x46')](_0x330dce[_0x2dbb('0x3b')],_0x5b95c6[_0x2dbb('0x3d')]));if(_0x330dce[_0x2dbb('0x3b')]['filter']){_0x3905c1[_0x2dbb('0x45')]=_[_0x2dbb('0x49')](_0x3905c1['where'],{'$or':_['map'](_0x3905c1['attributes'],function(_0x271223){var _0x4b4dc7={};_0x4b4dc7[_0x271223]={'$like':'%'+_0x330dce[_0x2dbb('0x3b')][_0x2dbb('0x47')]+'%'};return _0x4b4dc7;})});}_0x3905c1=_[_0x2dbb('0x49')]({},_0x3905c1,_0x330dce['options']);return _0x5e3460['getDescriptions'](_0x3905c1);}})[_0x2dbb('0x2f')](function(_0xac5e3){if(_0xac5e3){_0x59d884=_0xac5e3[_0x2dbb('0x51')];if(!_0x330dce[_0x2dbb('0x3b')]['hasOwnProperty']('nolimit')){_0x3905c1[_0x2dbb('0x2a')]=qs['limit'](_0x330dce[_0x2dbb('0x3b')]['limit']);_0x3905c1[_0x2dbb('0x29')]=qs[_0x2dbb('0x29')](_0x330dce[_0x2dbb('0x3b')][_0x2dbb('0x29')]);}return _0x5e3460[_0x2dbb('0x5a')](_0x3905c1);}})['then'](function(_0x2dbfba){if(_0x2dbfba){return _0x2dbfba?{'count':_0x59d884,'rows':_0x2dbfba}:null;}})[_0x2dbb('0x2f')](respondWithResult(_0x33aeee,null))[_0x2dbb('0x24')](handleError(_0x33aeee,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index b80c2cf..9e2352c 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 _0x20e0=['../../config/environment','./intVtigerConfiguration.attributes','exports','VtigerConfiguration','lodash','util','../../config/logger','api','moment','path'];(function(_0x7f96cb,_0x11b2da){var _0x1b3010=function(_0x50b981){while(--_0x50b981){_0x7f96cb['push'](_0x7f96cb['shift']());}};_0x1b3010(++_0x11b2da);}(_0x20e0,0x16c));var _0x020e=function(_0x9c8140,_0xa2c07a){_0x9c8140=_0x9c8140-0x0;var _0x1a382e=_0x20e0[_0x9c8140];return _0x1a382e;};'use strict';var _=require(_0x020e('0x0'));var util=require(_0x020e('0x1'));var logger=require(_0x020e('0x2'))(_0x020e('0x3'));var moment=require(_0x020e('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x020e('0x5'));var rimraf=require('rimraf');var config=require(_0x020e('0x6'));var attributes=require(_0x020e('0x7'));module[_0x020e('0x8')]=function(_0x44135c,_0x32748a){return _0x44135c['define'](_0x020e('0x9'),attributes,{'tableName':'int_vtiger_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x803d=['rimraf','../../config/environment','./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','../../config/logger','api','moment'];(function(_0x37ded3,_0x371ebb){var _0x51e49e=function(_0x30cc78){while(--_0x30cc78){_0x37ded3['push'](_0x37ded3['shift']());}};_0x51e49e(++_0x371ebb);}(_0x803d,0x18d));var _0xd803=function(_0x1d63c0,_0x2079e8){_0x1d63c0=_0x1d63c0-0x0;var _0x4b3e9d=_0x803d[_0x1d63c0];return _0x4b3e9d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd803('0x0'))(_0xd803('0x1'));var moment=require(_0xd803('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd803('0x3'));var config=require(_0xd803('0x4'));var attributes=require(_0xd803('0x5'));module[_0xd803('0x6')]=function(_0x6f753,_0x2b180f){return _0x6f753[_0xd803('0x7')](_0xd803('0x8'),attributes,{'tableName':_0xd803('0x9'),'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 8b8a919..ac7458b 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 _0xd220=['request','info','request\x20sent','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerConfiguration,\x20%s,\x20%s','message','result','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','client','http'];(function(_0x35ed9f,_0x27f073){var _0x185587=function(_0x49e29b){while(--_0x49e29b){_0x35ed9f['push'](_0x35ed9f['shift']());}};_0x185587(++_0x27f073);}(_0xd220,0x109));var _0x0d22=function(_0x3faa78,_0x493a1f){_0x3faa78=_0x3faa78-0x0;var _0x12b299=_0xd220[_0x3faa78];return _0x12b299;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x0d22('0x0'));var rs=require(_0x0d22('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0d22('0x2'))['db'];var utils=require(_0x0d22('0x3'));var logger=require('../../config/logger')(_0x0d22('0x4'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d22('0x5')][_0x0d22('0x6')]({'port':0x232a});function respondWithRpcPromise(_0xf779d4,_0x22fccc,_0x5674e1){return new BPromise(function(_0x667f45,_0x51cd8f){return client[_0x0d22('0x7')](_0xf779d4,_0x5674e1)['then'](function(_0x22d6e7){logger[_0x0d22('0x8')]('VtigerConfiguration,\x20%s,\x20%s',_0x22fccc,_0x0d22('0x9'));logger['debug'](_0x0d22('0xa'),_0x22fccc,'request\x20sent',JSON[_0x0d22('0xb')](_0x22d6e7));if(_0x22d6e7['error']){if(_0x22d6e7[_0x0d22('0xc')][_0x0d22('0xd')]===0x1f4){logger['error'](_0x0d22('0xe'),_0x22fccc,_0x22d6e7[_0x0d22('0xc')][_0x0d22('0xf')]);return _0x51cd8f(_0x22d6e7['error'][_0x0d22('0xf')]);}logger[_0x0d22('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x22fccc,_0x22d6e7[_0x0d22('0xc')][_0x0d22('0xf')]);return _0x667f45(_0x22d6e7['error'][_0x0d22('0xf')]);}else{logger[_0x0d22('0x8')](_0x0d22('0xe'),_0x22fccc,_0x0d22('0x9'));_0x667f45(_0x22d6e7[_0x0d22('0x10')][_0x0d22('0xf')]);}})['catch'](function(_0x1509fb){logger[_0x0d22('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x22fccc,_0x1509fb);_0x51cd8f(_0x1509fb);});});} \ No newline at end of file +var _0x44d6=['code','message','VtigerConfiguration,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x5c5217,_0x51ba15){var _0x1b7131=function(_0x3a8754){while(--_0x3a8754){_0x5c5217['push'](_0x5c5217['shift']());}};_0x1b7131(++_0x51ba15);}(_0x44d6,0x1d1));var _0x644d=function(_0x525886,_0x5af525){_0x525886=_0x525886-0x0;var _0x3a0ea9=_0x44d6[_0x525886];return _0x3a0ea9;};'use strict';var _=require(_0x644d('0x0'));var util=require('util');var moment=require(_0x644d('0x1'));var BPromise=require(_0x644d('0x2'));var rs=require(_0x644d('0x3'));var fs=require('fs');var Redis=require(_0x644d('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x644d('0x5'))('rpc');var config=require(_0x644d('0x6'));var jayson=require(_0x644d('0x7'));var client=jayson[_0x644d('0x8')][_0x644d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4cc2f9,_0x31a425,_0xa56d92){return new BPromise(function(_0xc35b8,_0x74ee54){return client[_0x644d('0xa')](_0x4cc2f9,_0xa56d92)[_0x644d('0xb')](function(_0x591495){logger[_0x644d('0xc')]('VtigerConfiguration,\x20%s,\x20%s',_0x31a425,_0x644d('0xd'));logger[_0x644d('0xe')](_0x644d('0xf'),_0x31a425,_0x644d('0xd'),JSON[_0x644d('0x10')](_0x591495));if(_0x591495[_0x644d('0x11')]){if(_0x591495[_0x644d('0x11')][_0x644d('0x12')]===0x1f4){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x31a425,_0x591495[_0x644d('0x11')][_0x644d('0x13')]);return _0x74ee54(_0x591495[_0x644d('0x11')][_0x644d('0x13')]);}logger[_0x644d('0x11')](_0x644d('0x14'),_0x31a425,_0x591495[_0x644d('0x11')]['message']);return _0xc35b8(_0x591495[_0x644d('0x11')][_0x644d('0x13')]);}else{logger['info'](_0x644d('0x14'),_0x31a425,_0x644d('0xd'));_0xc35b8(_0x591495[_0x644d('0x15')][_0x644d('0x13')]);}})[_0x644d('0x16')](function(_0x3340cf){logger['error']('VtigerConfiguration,\x20%s,\x20%s',_0x31a425,_0x3340cf);_0x74ee54(_0x3340cf);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index 15ecd8b..2d3e591 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 _0xbfc6=['./intVtigerField.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x38f796,_0x146879){var _0x156922=function(_0x59e056){while(--_0x59e056){_0x38f796['push'](_0x38f796['shift']());}};_0x156922(++_0x146879);}(_0xbfc6,0x181));var _0x6bfc=function(_0x218898,_0x360d62){_0x218898=_0x218898-0x0;var _0x598245=_0xbfc6[_0x218898];return _0x598245;};'use strict';var multer=require(_0x6bfc('0x0'));var util=require('util');var path=require(_0x6bfc('0x1'));var timeout=require('connect-timeout');var express=require(_0x6bfc('0x2'));var router=express['Router']();var auth=require(_0x6bfc('0x3'));var interaction=require(_0x6bfc('0x4'));var config=require(_0x6bfc('0x5'));var controller=require(_0x6bfc('0x6'));router[_0x6bfc('0x7')]('/',auth[_0x6bfc('0x8')](),controller['index']);router['get'](_0x6bfc('0x9'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xa')]);router[_0x6bfc('0xb')]('/',auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xc')]);router[_0x6bfc('0xd')](_0x6bfc('0x9'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0xe')]);router[_0x6bfc('0xf')](_0x6bfc('0x9'),auth[_0x6bfc('0x8')](),controller[_0x6bfc('0x10')]);module['exports']=router; \ No newline at end of file +var _0x3e07=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerField.controller','get','index','isAuthenticated','post','create','/:id','update'];(function(_0x233468,_0x4afa22){var _0x197b41=function(_0x3a6be3){while(--_0x3a6be3){_0x233468['push'](_0x233468['shift']());}};_0x197b41(++_0x4afa22);}(_0x3e07,0xec));var _0x73e0=function(_0x3ae843,_0x2ab609){_0x3ae843=_0x3ae843-0x0;var _0xc63a33=_0x3e07[_0x3ae843];return _0xc63a33;};'use strict';var multer=require(_0x73e0('0x0'));var util=require(_0x73e0('0x1'));var path=require('path');var timeout=require(_0x73e0('0x2'));var express=require(_0x73e0('0x3'));var router=express[_0x73e0('0x4')]();var auth=require(_0x73e0('0x5'));var interaction=require(_0x73e0('0x6'));var config=require(_0x73e0('0x7'));var controller=require(_0x73e0('0x8'));router[_0x73e0('0x9')]('/',auth['isAuthenticated'](),controller[_0x73e0('0xa')]);router[_0x73e0('0x9')]('/:id',auth[_0x73e0('0xb')](),controller['show']);router[_0x73e0('0xc')]('/',auth[_0x73e0('0xb')](),controller[_0x73e0('0xd')]);router['put'](_0x73e0('0xe'),auth[_0x73e0('0xb')](),controller[_0x73e0('0xf')]);router['delete'](_0x73e0('0xe'),auth['isAuthenticated'](),controller[_0x73e0('0x10')]);module[_0x73e0('0x11')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index 90f941a..803fd85 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 _0xdb13=['customVariable','keyValue','STRING','BOOLEAN','exports','ENUM','string','variable'];(function(_0xe1b5f6,_0x210c09){var _0x44636e=function(_0x3a3212){while(--_0x3a3212){_0xe1b5f6['push'](_0xe1b5f6['shift']());}};_0x44636e(++_0x210c09);}(_0xdb13,0x10c));var _0x3db1=function(_0x23e99f,_0x45acc1){_0x23e99f=_0x23e99f-0x0;var _0x527983=_0xdb13[_0x23e99f];return _0x527983;};'use strict';var Sequelize=require('sequelize');module[_0x3db1('0x0')]={'type':{'type':Sequelize[_0x3db1('0x1')](_0x3db1('0x2'),_0x3db1('0x3'),_0x3db1('0x4'),_0x3db1('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x3db1('0x6')]},'key':{'type':Sequelize[_0x3db1('0x6')]},'keyType':{'type':Sequelize[_0x3db1('0x1')](_0x3db1('0x2'),_0x3db1('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x3db1('0x6')]},'idField':{'type':Sequelize[_0x3db1('0x6')]},'nameField':{'type':Sequelize[_0x3db1('0x6')]},'customField':{'type':Sequelize[_0x3db1('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x3db1('0x6')]}}; \ No newline at end of file +var _0xd2bb=['ENUM','BOOLEAN','exports','string','variable','customVariable','keyValue','STRING'];(function(_0x46459e,_0x5c6971){var _0x29d105=function(_0x1d7676){while(--_0x1d7676){_0x46459e['push'](_0x46459e['shift']());}};_0x29d105(++_0x5c6971);}(_0xd2bb,0x9a));var _0xbd2b=function(_0x19c37d,_0x536a3e){_0x19c37d=_0x19c37d-0x0;var _0x15daf4=_0xd2bb[_0x19c37d];return _0x15daf4;};'use strict';var Sequelize=require('sequelize');module[_0xbd2b('0x0')]={'type':{'type':Sequelize['ENUM'](_0xbd2b('0x1'),_0xbd2b('0x2'),_0xbd2b('0x3'),_0xbd2b('0x4')),'defaultValue':_0xbd2b('0x1')},'content':{'type':Sequelize[_0xbd2b('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xbd2b('0x6')](_0xbd2b('0x1'),_0xbd2b('0x2'),_0xbd2b('0x3'))},'keyContent':{'type':Sequelize[_0xbd2b('0x5')]},'idField':{'type':Sequelize[_0xbd2b('0x5')]},'nameField':{'type':Sequelize[_0xbd2b('0x5')]},'customField':{'type':Sequelize[_0xbd2b('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbd2b('0x5')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index e39fb76..de51540 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 _0x2c64=['update','then','destroy','error','stack','name','send','index','map','VtigerField','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','type','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','rawAttributes','merge','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save'];(function(_0x22e38f,_0x17687d){var _0x1cf07a=function(_0x45da2f){while(--_0x45da2f){_0x22e38f['push'](_0x22e38f['shift']());}};_0x1cf07a(++_0x17687d);}(_0x2c64,0xc3));var _0x42c6=function(_0x59befa,_0x4af99b){_0x59befa=_0x59befa-0x0;var _0x1dd63d=_0x2c64[_0x59befa];return _0x1dd63d;};'use strict';var pdf=require(_0x42c6('0x0'));var emlformat=require(_0x42c6('0x1'));var rimraf=require(_0x42c6('0x2'));var zipdir=require(_0x42c6('0x3'));var jsonpatch=require(_0x42c6('0x4'));var rp=require('request-promise');var moment=require(_0x42c6('0x5'));var BPromise=require(_0x42c6('0x6'));var Mustache=require(_0x42c6('0x7'));var util=require('util');var path=require(_0x42c6('0x8'));var sox=require(_0x42c6('0x9'));var csv=require(_0x42c6('0xa'));var ejs=require(_0x42c6('0xb'));var fs=require('fs');var _=require(_0x42c6('0xc'));var squel=require(_0x42c6('0xd'));var crypto=require('crypto');var jsforce=require(_0x42c6('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x42c6('0xa'));var querystring=require(_0x42c6('0xf'));var Papa=require('papaparse');var Redis=require(_0x42c6('0x10'));var authService=require(_0x42c6('0x11'));var qs=require(_0x42c6('0x12'));var as=require(_0x42c6('0x13'));var hardwareService=require(_0x42c6('0x14'));var logger=require(_0x42c6('0x15'))(_0x42c6('0x16'));var utils=require(_0x42c6('0x17'));var config=require(_0x42c6('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2371fd,_0x4d2aea){_0x4d2aea=_0x4d2aea||0xcc;return function(_0x346a3c){if(_0x346a3c){return _0x2371fd[_0x42c6('0x19')](_0x4d2aea);}return _0x2371fd[_0x42c6('0x1a')](_0x4d2aea)[_0x42c6('0x1b')]();};}function respondWithResult(_0x346676,_0x1d0d11){_0x1d0d11=_0x1d0d11||0xc8;return function(_0xc98ed9){if(_0xc98ed9){return _0x346676[_0x42c6('0x1a')](_0x1d0d11)[_0x42c6('0x1c')](_0xc98ed9);}};}function respondWithFilteredResult(_0xa38d17,_0x323a61){return function(_0x6cafce){if(_0x6cafce){var _0x49ca06=_0x6cafce[_0x42c6('0x1d')],_0xf8d1b9=_0x323a61[_0x42c6('0x1e')],_0x4f4089=_0x323a61['offset']+_0x323a61[_0x42c6('0x1f')],_0x1a9b20;if(_0x4f4089>=_0x49ca06){_0x4f4089=_0x49ca06;_0x1a9b20=0xc8;}else{_0x1a9b20=0xce;}_0xa38d17[_0x42c6('0x1a')](_0x1a9b20);return _0xa38d17[_0x42c6('0x20')](_0x42c6('0x21'),_0xf8d1b9+'-'+_0x4f4089+'/'+_0x49ca06)[_0x42c6('0x1c')](_0x6cafce);}return null;};}function patchUpdates(_0x340f34){return function(_0x43bbac){try{jsonpatch['apply'](_0x43bbac,_0x340f34,!![]);}catch(_0x125190){return BPromise[_0x42c6('0x22')](_0x125190);}return _0x43bbac[_0x42c6('0x23')]();};}function saveUpdates(_0x478bc2,_0x15a662){return function(_0x376335){if(_0x376335){return _0x376335[_0x42c6('0x24')](_0x478bc2)[_0x42c6('0x25')](function(_0x28b7ee){return _0x28b7ee;});}return null;};}function removeEntity(_0x5aefcc,_0x288462){return function(_0x15f1d4){if(_0x15f1d4){return _0x15f1d4[_0x42c6('0x26')]()[_0x42c6('0x25')](function(){_0x5aefcc[_0x42c6('0x1a')](0xcc)[_0x42c6('0x1b')]();});}};}function handleEntityNotFound(_0x481cee,_0x4a19f7){return function(_0x5e8632){if(!_0x5e8632){_0x481cee['sendStatus'](0x194);}return _0x5e8632;};}function handleError(_0x338606,_0x117e20){_0x117e20=_0x117e20||0x1f4;return function(_0x29d4b7){logger[_0x42c6('0x27')](_0x29d4b7[_0x42c6('0x28')]);if(_0x29d4b7[_0x42c6('0x29')]){delete _0x29d4b7['name'];}_0x338606[_0x42c6('0x1a')](_0x117e20)[_0x42c6('0x2a')](_0x29d4b7);};}exports[_0x42c6('0x2b')]=function(_0x5c5bad,_0x277368){var _0x265414={},_0x4c18d3={},_0x346657={'count':0x0,'rows':[]};var _0x48a159=_[_0x42c6('0x2c')](db[_0x42c6('0x2d')]['rawAttributes'],function(_0x2c744b){return{'name':_0x2c744b[_0x42c6('0x2e')],'type':_0x2c744b['type'][_0x42c6('0x2f')]};});_0x4c18d3[_0x42c6('0x30')]=_[_0x42c6('0x2c')](_0x48a159,_0x42c6('0x29'));_0x4c18d3[_0x42c6('0x31')]=_[_0x42c6('0x32')](_0x5c5bad[_0x42c6('0x31')]);_0x4c18d3[_0x42c6('0x33')]=_[_0x42c6('0x34')](_0x4c18d3[_0x42c6('0x30')],_0x4c18d3['query']);_0x265414[_0x42c6('0x35')]=_['intersection'](_0x4c18d3[_0x42c6('0x30')],qs[_0x42c6('0x36')](_0x5c5bad[_0x42c6('0x31')]['fields']));_0x265414[_0x42c6('0x35')]=_0x265414[_0x42c6('0x35')][_0x42c6('0x37')]?_0x265414[_0x42c6('0x35')]:_0x4c18d3[_0x42c6('0x30')];if(!_0x5c5bad[_0x42c6('0x31')][_0x42c6('0x38')](_0x42c6('0x39'))){_0x265414[_0x42c6('0x1f')]=qs['limit'](_0x5c5bad['query'][_0x42c6('0x1f')]);_0x265414[_0x42c6('0x1e')]=qs['offset'](_0x5c5bad[_0x42c6('0x31')]['offset']);}_0x265414[_0x42c6('0x3a')]=qs[_0x42c6('0x3b')](_0x5c5bad[_0x42c6('0x31')][_0x42c6('0x3b')]);_0x265414[_0x42c6('0x3c')]=qs['filters'](_[_0x42c6('0x3d')](_0x5c5bad[_0x42c6('0x31')],_0x4c18d3[_0x42c6('0x33')]));if(_0x5c5bad[_0x42c6('0x31')]['filter']){_0x265414[_0x42c6('0x3c')]=_['merge'](_0x265414['where'],{'$or':_[_0x42c6('0x2c')](_0x48a159,function(_0xa98b66){if(_0xa98b66[_0x42c6('0x3e')]!==_0x42c6('0x3f')){var _0x31c50f={};_0x31c50f[_0xa98b66[_0x42c6('0x29')]]={'$like':'%'+_0x5c5bad[_0x42c6('0x31')][_0x42c6('0x40')]+'%'};return _0x31c50f;}})});}_0x265414=_['merge']({},_0x265414,_0x5c5bad[_0x42c6('0x41')]);var _0x41d224={'where':_0x265414[_0x42c6('0x3c')]};return db[_0x42c6('0x2d')][_0x42c6('0x1d')](_0x41d224)['then'](function(_0x67c5bc){_0x346657[_0x42c6('0x1d')]=_0x67c5bc;if(_0x5c5bad['query'][_0x42c6('0x42')]){_0x265414[_0x42c6('0x43')]=[{'all':!![]}];}return db['VtigerField'][_0x42c6('0x44')](_0x265414);})[_0x42c6('0x25')](function(_0x3e6652){_0x346657['rows']=_0x3e6652;return _0x346657;})[_0x42c6('0x25')](respondWithFilteredResult(_0x277368,_0x265414))[_0x42c6('0x45')](handleError(_0x277368,null));};exports[_0x42c6('0x46')]=function(_0x150e2e,_0x2449ff){var _0xe8037={'raw':!![],'where':{'id':_0x150e2e[_0x42c6('0x47')]['id']}},_0x498b25={};_0x498b25[_0x42c6('0x30')]=_[_0x42c6('0x32')](db['VtigerField'][_0x42c6('0x48')]);_0x498b25['query']=_[_0x42c6('0x32')](_0x150e2e[_0x42c6('0x31')]);_0x498b25[_0x42c6('0x33')]=_['intersection'](_0x498b25[_0x42c6('0x30')],_0x498b25['query']);_0xe8037[_0x42c6('0x35')]=_[_0x42c6('0x34')](_0x498b25[_0x42c6('0x30')],qs['fields'](_0x150e2e[_0x42c6('0x31')]['fields']));_0xe8037[_0x42c6('0x35')]=_0xe8037[_0x42c6('0x35')][_0x42c6('0x37')]?_0xe8037['attributes']:_0x498b25['model'];if(_0x150e2e['query'][_0x42c6('0x42')]){_0xe8037[_0x42c6('0x43')]=[{'all':!![]}];}_0xe8037=_[_0x42c6('0x49')]({},_0xe8037,_0x150e2e[_0x42c6('0x41')]);return db[_0x42c6('0x2d')]['find'](_0xe8037)[_0x42c6('0x25')](handleEntityNotFound(_0x2449ff,null))[_0x42c6('0x25')](respondWithResult(_0x2449ff,null))[_0x42c6('0x45')](handleError(_0x2449ff,null));};exports[_0x42c6('0x4a')]=function(_0x17d7a8,_0x2013c4){return db[_0x42c6('0x2d')][_0x42c6('0x4a')](_0x17d7a8[_0x42c6('0x4b')],{})[_0x42c6('0x25')](respondWithResult(_0x2013c4,0xc9))[_0x42c6('0x45')](handleError(_0x2013c4,null));};exports['update']=function(_0x338a23,_0x5b1ebd){if(_0x338a23[_0x42c6('0x4b')]['id']){delete _0x338a23[_0x42c6('0x4b')]['id'];}return db[_0x42c6('0x2d')][_0x42c6('0x4c')]({'where':{'id':_0x338a23['params']['id']}})[_0x42c6('0x25')](handleEntityNotFound(_0x5b1ebd,null))[_0x42c6('0x25')](saveUpdates(_0x338a23['body'],null))['then'](respondWithResult(_0x5b1ebd,null))[_0x42c6('0x45')](handleError(_0x5b1ebd,null));};exports[_0x42c6('0x26')]=function(_0x4240f9,_0x5b2d79){return db[_0x42c6('0x2d')][_0x42c6('0x4c')]({'where':{'id':_0x4240f9['params']['id']}})[_0x42c6('0x25')](handleEntityNotFound(_0x5b2d79,null))[_0x42c6('0x25')](removeEntity(_0x5b2d79,null))[_0x42c6('0x45')](handleError(_0x5b2d79,null));}; \ No newline at end of file +var _0x7743=['findAll','rows','catch','show','params','keys','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','VtigerField','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include'];(function(_0x522189,_0x58d7c3){var _0x49cdab=function(_0xf1a9ea){while(--_0xf1a9ea){_0x522189['push'](_0x522189['shift']());}};_0x49cdab(++_0x58d7c3);}(_0x7743,0xff));var _0x3774=function(_0x3a8e02,_0x1ae17b){_0x3a8e02=_0x3a8e02-0x0;var _0x7ad460=_0x7743[_0x3a8e02];return _0x7ad460;};'use strict';var pdf=require(_0x3774('0x0'));var emlformat=require(_0x3774('0x1'));var rimraf=require(_0x3774('0x2'));var zipdir=require(_0x3774('0x3'));var jsonpatch=require(_0x3774('0x4'));var rp=require(_0x3774('0x5'));var moment=require(_0x3774('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3774('0x7'));var path=require(_0x3774('0x8'));var sox=require(_0x3774('0x9'));var csv=require('to-csv');var ejs=require(_0x3774('0xa'));var fs=require('fs');var _=require(_0x3774('0xb'));var squel=require('squel');var crypto=require(_0x3774('0xc'));var jsforce=require(_0x3774('0xd'));var deskjs=require(_0x3774('0xe'));var toCsv=require(_0x3774('0xf'));var querystring=require(_0x3774('0x10'));var Papa=require(_0x3774('0x11'));var Redis=require(_0x3774('0x12'));var authService=require(_0x3774('0x13'));var qs=require(_0x3774('0x14'));var as=require(_0x3774('0x15'));var hardwareService=require(_0x3774('0x16'));var logger=require(_0x3774('0x17'))(_0x3774('0x18'));var utils=require(_0x3774('0x19'));var config=require(_0x3774('0x1a'));var db=require(_0x3774('0x1b'))['db'];function respondWithStatusCode(_0x1162e1,_0x61ec10){_0x61ec10=_0x61ec10||0xcc;return function(_0x17c8c3){if(_0x17c8c3){return _0x1162e1['sendStatus'](_0x61ec10);}return _0x1162e1[_0x3774('0x1c')](_0x61ec10)[_0x3774('0x1d')]();};}function respondWithResult(_0x51a3e2,_0x4bd43d){_0x4bd43d=_0x4bd43d||0xc8;return function(_0x489f00){if(_0x489f00){return _0x51a3e2[_0x3774('0x1c')](_0x4bd43d)['json'](_0x489f00);}};}function respondWithFilteredResult(_0x14990a,_0x343a0f){return function(_0x558a56){if(_0x558a56){var _0xcee5dc=_0x558a56[_0x3774('0x1e')],_0x1bb7c2=_0x343a0f[_0x3774('0x1f')],_0x23cb64=_0x343a0f[_0x3774('0x1f')]+_0x343a0f[_0x3774('0x20')],_0x1c859e;if(_0x23cb64>=_0xcee5dc){_0x23cb64=_0xcee5dc;_0x1c859e=0xc8;}else{_0x1c859e=0xce;}_0x14990a[_0x3774('0x1c')](_0x1c859e);return _0x14990a[_0x3774('0x21')](_0x3774('0x22'),_0x1bb7c2+'-'+_0x23cb64+'/'+_0xcee5dc)[_0x3774('0x23')](_0x558a56);}return null;};}function patchUpdates(_0x3feb8f){return function(_0x1a4128){try{jsonpatch[_0x3774('0x24')](_0x1a4128,_0x3feb8f,!![]);}catch(_0x3e96de){return BPromise[_0x3774('0x25')](_0x3e96de);}return _0x1a4128[_0x3774('0x26')]();};}function saveUpdates(_0x284be9,_0x4dc2d6){return function(_0x25501c){if(_0x25501c){return _0x25501c[_0x3774('0x27')](_0x284be9)[_0x3774('0x28')](function(_0xd500e3){return _0xd500e3;});}return null;};}function removeEntity(_0x5b4e12,_0x36ddcd){return function(_0x1eb77d){if(_0x1eb77d){return _0x1eb77d[_0x3774('0x29')]()[_0x3774('0x28')](function(){_0x5b4e12['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x15d70b,_0x4ddca4){return function(_0x5df262){if(!_0x5df262){_0x15d70b[_0x3774('0x2a')](0x194);}return _0x5df262;};}function handleError(_0x52adf7,_0x3cd118){_0x3cd118=_0x3cd118||0x1f4;return function(_0x1750ed){logger[_0x3774('0x2b')](_0x1750ed[_0x3774('0x2c')]);if(_0x1750ed[_0x3774('0x2d')]){delete _0x1750ed[_0x3774('0x2d')];}_0x52adf7['status'](_0x3cd118)[_0x3774('0x2e')](_0x1750ed);};}exports[_0x3774('0x2f')]=function(_0x12d2d3,_0xa3b983){var _0x9182d8={},_0x33d4ff={},_0x335b0e={'count':0x0,'rows':[]};var _0x2b0dc0=_[_0x3774('0x30')](db[_0x3774('0x31')][_0x3774('0x32')],function(_0x2e91ee){return{'name':_0x2e91ee[_0x3774('0x33')],'type':_0x2e91ee['type'][_0x3774('0x34')]};});_0x33d4ff[_0x3774('0x35')]=_['map'](_0x2b0dc0,_0x3774('0x2d'));_0x33d4ff[_0x3774('0x36')]=_['keys'](_0x12d2d3[_0x3774('0x36')]);_0x33d4ff[_0x3774('0x37')]=_[_0x3774('0x38')](_0x33d4ff['model'],_0x33d4ff[_0x3774('0x36')]);_0x9182d8[_0x3774('0x39')]=_[_0x3774('0x38')](_0x33d4ff['model'],qs[_0x3774('0x3a')](_0x12d2d3[_0x3774('0x36')][_0x3774('0x3a')]));_0x9182d8[_0x3774('0x39')]=_0x9182d8[_0x3774('0x39')][_0x3774('0x3b')]?_0x9182d8[_0x3774('0x39')]:_0x33d4ff[_0x3774('0x35')];if(!_0x12d2d3[_0x3774('0x36')][_0x3774('0x3c')](_0x3774('0x3d'))){_0x9182d8[_0x3774('0x20')]=qs[_0x3774('0x20')](_0x12d2d3[_0x3774('0x36')][_0x3774('0x20')]);_0x9182d8[_0x3774('0x1f')]=qs[_0x3774('0x1f')](_0x12d2d3['query'][_0x3774('0x1f')]);}_0x9182d8[_0x3774('0x3e')]=qs[_0x3774('0x3f')](_0x12d2d3[_0x3774('0x36')][_0x3774('0x3f')]);_0x9182d8[_0x3774('0x40')]=qs[_0x3774('0x37')](_[_0x3774('0x41')](_0x12d2d3[_0x3774('0x36')],_0x33d4ff[_0x3774('0x37')]));if(_0x12d2d3['query']['filter']){_0x9182d8['where']=_[_0x3774('0x42')](_0x9182d8[_0x3774('0x40')],{'$or':_[_0x3774('0x30')](_0x2b0dc0,function(_0x12f81a){if(_0x12f81a[_0x3774('0x43')]!==_0x3774('0x44')){var _0x127811={};_0x127811[_0x12f81a[_0x3774('0x2d')]]={'$like':'%'+_0x12d2d3[_0x3774('0x36')][_0x3774('0x45')]+'%'};return _0x127811;}})});}_0x9182d8=_[_0x3774('0x42')]({},_0x9182d8,_0x12d2d3[_0x3774('0x46')]);var _0x523f48={'where':_0x9182d8[_0x3774('0x40')]};return db['VtigerField'][_0x3774('0x1e')](_0x523f48)[_0x3774('0x28')](function(_0x5e466a){_0x335b0e[_0x3774('0x1e')]=_0x5e466a;if(_0x12d2d3[_0x3774('0x36')][_0x3774('0x47')]){_0x9182d8[_0x3774('0x48')]=[{'all':!![]}];}return db['VtigerField'][_0x3774('0x49')](_0x9182d8);})[_0x3774('0x28')](function(_0x43e11e){_0x335b0e[_0x3774('0x4a')]=_0x43e11e;return _0x335b0e;})[_0x3774('0x28')](respondWithFilteredResult(_0xa3b983,_0x9182d8))[_0x3774('0x4b')](handleError(_0xa3b983,null));};exports[_0x3774('0x4c')]=function(_0x345910,_0xce430c){var _0x2d26e8={'raw':!![],'where':{'id':_0x345910[_0x3774('0x4d')]['id']}},_0x412a21={};_0x412a21['model']=_[_0x3774('0x4e')](db['VtigerField'][_0x3774('0x32')]);_0x412a21[_0x3774('0x36')]=_['keys'](_0x345910['query']);_0x412a21[_0x3774('0x37')]=_['intersection'](_0x412a21[_0x3774('0x35')],_0x412a21[_0x3774('0x36')]);_0x2d26e8[_0x3774('0x39')]=_['intersection'](_0x412a21[_0x3774('0x35')],qs[_0x3774('0x3a')](_0x345910[_0x3774('0x36')][_0x3774('0x3a')]));_0x2d26e8['attributes']=_0x2d26e8['attributes'][_0x3774('0x3b')]?_0x2d26e8[_0x3774('0x39')]:_0x412a21[_0x3774('0x35')];if(_0x345910[_0x3774('0x36')][_0x3774('0x47')]){_0x2d26e8[_0x3774('0x48')]=[{'all':!![]}];}_0x2d26e8=_[_0x3774('0x42')]({},_0x2d26e8,_0x345910[_0x3774('0x46')]);return db[_0x3774('0x31')][_0x3774('0x4f')](_0x2d26e8)[_0x3774('0x28')](handleEntityNotFound(_0xce430c,null))['then'](respondWithResult(_0xce430c,null))[_0x3774('0x4b')](handleError(_0xce430c,null));};exports[_0x3774('0x50')]=function(_0x532b87,_0x49e0d3){return db[_0x3774('0x31')][_0x3774('0x50')](_0x532b87[_0x3774('0x51')],{})[_0x3774('0x28')](respondWithResult(_0x49e0d3,0xc9))[_0x3774('0x4b')](handleError(_0x49e0d3,null));};exports[_0x3774('0x27')]=function(_0x5dff98,_0x55c75b){if(_0x5dff98[_0x3774('0x51')]['id']){delete _0x5dff98[_0x3774('0x51')]['id'];}return db[_0x3774('0x31')]['find']({'where':{'id':_0x5dff98[_0x3774('0x4d')]['id']}})['then'](handleEntityNotFound(_0x55c75b,null))[_0x3774('0x28')](saveUpdates(_0x5dff98[_0x3774('0x51')],null))[_0x3774('0x28')](respondWithResult(_0x55c75b,null))[_0x3774('0x4b')](handleError(_0x55c75b,null));};exports[_0x3774('0x29')]=function(_0x4ffaaf,_0x49f536){return db[_0x3774('0x31')][_0x3774('0x4f')]({'where':{'id':_0x4ffaaf[_0x3774('0x4d')]['id']}})[_0x3774('0x28')](handleEntityNotFound(_0x49f536,null))[_0x3774('0x28')](removeEntity(_0x49f536,null))[_0x3774('0x4b')](handleError(_0x49f536,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index 6e55c89..e4fc0d4 100644 --- a/server/api/intVtigerField/intVtigerField.model.js +++ b/server/api/intVtigerField/intVtigerField.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x36aaa1,_0x22e737){var _0x509327=function(_0x3b383d){while(--_0x3b383d){_0x36aaa1['push'](_0x36aaa1['shift']());}};_0x509327(++_0x22e737);}(_0x7a54,0x106));var _0x47a5=function(_0x448909,_0x35681e){_0x448909=_0x448909-0x0;var _0x49e716=_0x7a54[_0x448909];return _0x49e716;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x3858c3,_0x57afe8){var _0x9b08e7=function(_0x14f938){while(--_0x14f938){_0x3858c3['push'](_0x3858c3['shift']());}};_0x9b08e7(++_0x57afe8);}(_0x7a54,0x106));var _0x47a5=function(_0x1c0bd7,_0x53bd16){_0x1c0bd7=_0x1c0bd7-0x0;var _0x4af13b=_0x7a54[_0x1c0bd7];return _0x4af13b;};'use strict';var _=require(_0x47a5('0x0'));var util=require(_0x47a5('0x1'));var logger=require(_0x47a5('0x2'))('api');var moment=require(_0x47a5('0x3'));var BPromise=require(_0x47a5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x47a5('0x5'));var rimraf=require(_0x47a5('0x6'));var config=require(_0x47a5('0x7'));var attributes=require(_0x47a5('0x8'));module[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629){return _0x545a97['define'](_0x47a5('0xa'),attributes,{'tableName':_0x47a5('0xb'),'paranoid':![],'indexes':[{'name':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 76c847b..9dd5b7a 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 _0x282b=['stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VtigerField,\x20%s,\x20%s','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x28aea5,_0x3bb12e){var _0x6a55f9=function(_0xf6ece8){while(--_0xf6ece8){_0x28aea5['push'](_0x28aea5['shift']());}};_0x6a55f9(++_0x3bb12e);}(_0x282b,0xec));var _0xb282=function(_0x775162,_0x1ec483){_0x775162=_0x775162-0x0;var _0x4287a4=_0x282b[_0x775162];return _0x4287a4;};'use strict';var _=require(_0xb282('0x0'));var util=require(_0xb282('0x1'));var moment=require(_0xb282('0x2'));var BPromise=require(_0xb282('0x3'));var rs=require(_0xb282('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xb282('0x5'));var logger=require('../../config/logger')(_0xb282('0x6'));var config=require(_0xb282('0x7'));var jayson=require(_0xb282('0x8'));var client=jayson[_0xb282('0x9')][_0xb282('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x33635f,_0x4f0410,_0x4a0d28){return new BPromise(function(_0x17fba1,_0x436eaa){return client['request'](_0x33635f,_0x4a0d28)[_0xb282('0xb')](function(_0x20f517){logger[_0xb282('0xc')](_0xb282('0xd'),_0x4f0410,'request\x20sent');logger['debug'](_0xb282('0xe'),_0x4f0410,_0xb282('0xf'),JSON[_0xb282('0x10')](_0x20f517));if(_0x20f517[_0xb282('0x11')]){if(_0x20f517[_0xb282('0x11')]['code']===0x1f4){logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);return _0x436eaa(_0x20f517[_0xb282('0x11')][_0xb282('0x12')]);}logger['error'](_0xb282('0xd'),_0x4f0410,_0x20f517['error'][_0xb282('0x12')]);return _0x17fba1(_0x20f517[_0xb282('0x11')]['message']);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x4f0410,_0xb282('0xf'));_0x17fba1(_0x20f517[_0xb282('0x13')][_0xb282('0x12')]);}})[_0xb282('0x14')](function(_0x438a05){logger['error'](_0xb282('0xd'),_0x4f0410,_0x438a05);_0x436eaa(_0x438a05);});});} \ No newline at end of file +var _0xc692=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VtigerField,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xc692,0x15f));var _0x2c69=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0xc692[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0x2c69('0x0'));var util=require(_0x2c69('0x1'));var moment=require(_0x2c69('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2c69('0x3'));var db=require(_0x2c69('0x4'))['db'];var utils=require(_0x2c69('0x5'));var logger=require(_0x2c69('0x6'))(_0x2c69('0x7'));var config=require(_0x2c69('0x8'));var jayson=require(_0x2c69('0x9'));var client=jayson['client'][_0x2c69('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4da70c,_0x5c1260,_0x31688a){return new BPromise(function(_0x7a913a,_0xfc5ebb){return client[_0x2c69('0xb')](_0x4da70c,_0x31688a)[_0x2c69('0xc')](function(_0x131313){logger['info'](_0x2c69('0xd'),_0x5c1260,'request\x20sent');logger[_0x2c69('0xe')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'),JSON[_0x2c69('0x10')](_0x131313));if(_0x131313[_0x2c69('0x11')]){if(_0x131313[_0x2c69('0x11')][_0x2c69('0x12')]===0x1f4){logger[_0x2c69('0x11')]('VtigerField,\x20%s,\x20%s',_0x5c1260,_0x131313[_0x2c69('0x11')]['message']);return _0xfc5ebb(_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);}logger[_0x2c69('0x11')](_0x2c69('0xd'),_0x5c1260,_0x131313[_0x2c69('0x11')][_0x2c69('0x13')]);return _0x7a913a(_0x131313['error'][_0x2c69('0x13')]);}else{logger['info']('VtigerField,\x20%s,\x20%s',_0x5c1260,_0x2c69('0xf'));_0x7a913a(_0x131313['result'][_0x2c69('0x13')]);}})[_0x2c69('0x14')](function(_0x59e48a){logger['error'](_0x2c69('0xd'),_0x5c1260,_0x59e48a);_0xfc5ebb(_0x59e48a);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index e227f30..55c4bf9 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 _0x5dcf=['multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','index','/:id','isAuthenticated','/:id/configurations','/:id/fields','post','put','destroy'];(function(_0x2e86a0,_0x2a9c3b){var _0x43d0cb=function(_0x29e7a0){while(--_0x29e7a0){_0x2e86a0['push'](_0x2e86a0['shift']());}};_0x43d0cb(++_0x2a9c3b);}(_0x5dcf,0x170));var _0xf5dc=function(_0x445e5c,_0x67a9ae){_0x445e5c=_0x445e5c-0x0;var _0x5513e5=_0x5dcf[_0x445e5c];return _0x5513e5;};'use strict';var multer=require(_0xf5dc('0x0'));var util=require(_0xf5dc('0x1'));var path=require(_0xf5dc('0x2'));var timeout=require(_0xf5dc('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf5dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xf5dc('0x5'));var controller=require(_0xf5dc('0x6'));router[_0xf5dc('0x7')]('/',auth['isAuthenticated'](),controller[_0xf5dc('0x8')]);router[_0xf5dc('0x7')](_0xf5dc('0x9'),auth[_0xf5dc('0xa')](),controller['show']);router[_0xf5dc('0x7')](_0xf5dc('0xb'),auth[_0xf5dc('0xa')](),controller['getConfigurations']);router[_0xf5dc('0x7')](_0xf5dc('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0xf5dc('0xd')]('/',auth[_0xf5dc('0xa')](),controller['create']);router[_0xf5dc('0xd')](_0xf5dc('0xb'),auth[_0xf5dc('0xa')](),controller['addConfiguration']);router[_0xf5dc('0xe')](_0xf5dc('0x9'),auth[_0xf5dc('0xa')](),controller['update']);router['delete'](_0xf5dc('0x9'),auth[_0xf5dc('0xa')](),controller[_0xf5dc('0xf')]);module['exports']=router; \ No newline at end of file +var _0xe737=['../../components/auth/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','/:id','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','connect-timeout','express','Router'];(function(_0x177f77,_0x1deb27){var _0xea93d=function(_0x39ea3e){while(--_0x39ea3e){_0x177f77['push'](_0x177f77['shift']());}};_0xea93d(++_0x1deb27);}(_0xe737,0x9c));var _0x7e73=function(_0x1c9edd,_0x513e88){_0x1c9edd=_0x1c9edd-0x0;var _0x4d2ef5=_0xe737[_0x1c9edd];return _0x4d2ef5;};'use strict';var multer=require(_0x7e73('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x7e73('0x1'));var express=require(_0x7e73('0x2'));var router=express[_0x7e73('0x3')]();var auth=require(_0x7e73('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7e73('0x5'));var controller=require(_0x7e73('0x6'));router[_0x7e73('0x7')]('/',auth[_0x7e73('0x8')](),controller['index']);router[_0x7e73('0x7')](_0x7e73('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x7e73('0x7')](_0x7e73('0xa'),auth[_0x7e73('0x8')](),controller[_0x7e73('0xb')]);router[_0x7e73('0x7')](_0x7e73('0xc'),auth[_0x7e73('0x8')](),controller[_0x7e73('0xd')]);router[_0x7e73('0xe')]('/',auth[_0x7e73('0x8')](),controller[_0x7e73('0xf')]);router[_0x7e73('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x7e73('0x10')]);router[_0x7e73('0x11')](_0x7e73('0x9'),auth[_0x7e73('0x8')](),controller['update']);router[_0x7e73('0x12')](_0x7e73('0x9'),auth[_0x7e73('0x8')](),controller['destroy']);module[_0x7e73('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 4ad9440..244c82d 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 _0x51a2=['newTab','exports','STRING','username','remoteUri','ENUM','password','token','integrationTab'];(function(_0x22a417,_0x180d44){var _0xad1eb9=function(_0x235dee){while(--_0x235dee){_0x22a417['push'](_0x22a417['shift']());}};_0xad1eb9(++_0x180d44);}(_0x51a2,0x76));var _0x251a=function(_0x258b94,_0x294a49){_0x258b94=_0x258b94-0x0;var _0x2bf521=_0x51a2[_0x258b94];return _0x2bf521;};'use strict';var Sequelize=require('sequelize');module[_0x251a('0x0')]={'name':{'type':Sequelize[_0x251a('0x1')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0x251a('0x1')],'unique':_0x251a('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize[_0x251a('0x1')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x251a('0x3')},'authType':{'type':Sequelize[_0x251a('0x4')](_0x251a('0x5'),_0x251a('0x6')),'defaultValue':_0x251a('0x5')},'serverUrl':{'type':Sequelize[_0x251a('0x1')]},'type':{'type':Sequelize[_0x251a('0x4')](_0x251a('0x7'),_0x251a('0x8')),'defaultValue':_0x251a('0x7')}}; \ No newline at end of file +var _0xcbb6=['username','remoteUri','ENUM','password','token','integrationTab','exports','STRING'];(function(_0x19c106,_0x238007){var _0x3341d6=function(_0xf6f459){while(--_0xf6f459){_0x19c106['push'](_0x19c106['shift']());}};_0x3341d6(++_0x238007);}(_0xcbb6,0x186));var _0x6cbb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xcbb6[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x6cbb('0x0')]={'name':{'type':Sequelize[_0x6cbb('0x1')]},'description':{'type':Sequelize[_0x6cbb('0x1')]},'username':{'type':Sequelize[_0x6cbb('0x1')],'unique':_0x6cbb('0x2')},'password':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x6cbb('0x3')},'authType':{'type':Sequelize[_0x6cbb('0x4')](_0x6cbb('0x5'),_0x6cbb('0x6')),'defaultValue':_0x6cbb('0x5')},'serverUrl':{'type':Sequelize[_0x6cbb('0x1')]},'type':{'type':Sequelize[_0x6cbb('0x4')](_0x6cbb('0x7'),'newTab'),'defaultValue':'integrationTab'}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index ce5706b..3476e87 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 _0xb7f4=['request\x20sent','debug','ZendeskAccount,\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','update','stack','name','send','map','ZendeskAccount','rawAttributes','fieldName','type','key','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','include','show','params','includeAll','find','create','body','destroy','getConfigurations','findOne','addConfiguration','AccountId','getSubjects','channel','getDescriptions','ZendeskConfiguration','ZendeskField','Subjects','Descriptions','username','password','token','authType','substring','lastIndexOf','GET','format','%s/%s','headers','Basic\x20%s','toString','base64','%s/token:%s','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','ticket_fields','includes','position','title','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../components/integrations/configuration','jayson/promise','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s'];(function(_0x306d60,_0xb4ab5a){var _0x3dffd0=function(_0x35a7b1){while(--_0x35a7b1){_0x306d60['push'](_0x306d60['shift']());}};_0x3dffd0(++_0xb4ab5a);}(_0xb7f4,0x162));var _0x4b7f=function(_0x2e7a02,_0x2a017d){_0x2e7a02=_0x2e7a02-0x0;var _0x33a56b=_0xb7f4[_0x2e7a02];return _0x33a56b;};'use strict';var pdf=require(_0x4b7f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4b7f('0x1'));var zipdir=require(_0x4b7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x4b7f('0x3'));var Mustache=require('mustache');var util=require(_0x4b7f('0x4'));var path=require(_0x4b7f('0x5'));var sox=require(_0x4b7f('0x6'));var csv=require(_0x4b7f('0x7'));var ejs=require(_0x4b7f('0x8'));var fs=require('fs');var _=require(_0x4b7f('0x9'));var squel=require(_0x4b7f('0xa'));var crypto=require('crypto');var jsforce=require(_0x4b7f('0xb'));var deskjs=require(_0x4b7f('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4b7f('0xd'));var Redis=require(_0x4b7f('0xe'));var authService=require(_0x4b7f('0xf'));var qs=require(_0x4b7f('0x10'));var as=require(_0x4b7f('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4b7f('0x12'))(_0x4b7f('0x13'));var utils=require('../../config/utils');var config=require(_0x4b7f('0x14'));var db=require('../../mysqldb')['db'];var integrations=require(_0x4b7f('0x15'));var jayson=require(_0x4b7f('0x16'));var client=jayson['client'][_0x4b7f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x3e8f87,_0x1d2a7a,_0x29e80c){if(_0x29e80c){var _0x470c78=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x470c78[_0x4b7f('0x18')](_0x1d2a7a)){return _0x3e8f87;}else{throw new db['Sequelize']['ValidationError'](_0x4b7f('0x19'));}}else{return _0x3e8f87;}}function respondWithRpcPromise(_0x2cb6f3,_0x39c93b,_0x2a11f3,_0x4cd68e){return new BPromise(function(_0x9d2d2a,_0x184cea){var _0x44ae45=_0x4cd68e||client;return _0x44ae45[_0x4b7f('0x1a')](_0x2cb6f3,_0x2a11f3)[_0x4b7f('0x1b')](function(_0x5de253){logger[_0x4b7f('0x1c')](_0x4b7f('0x1d'),_0x39c93b,_0x4b7f('0x1e'));logger[_0x4b7f('0x1f')](_0x4b7f('0x20'),_0x39c93b,'request\x20sent',JSON[_0x4b7f('0x21')](_0x5de253));if(_0x5de253[_0x4b7f('0x22')]){if(_0x5de253[_0x4b7f('0x22')][_0x4b7f('0x23')]===0x1f4){logger[_0x4b7f('0x22')](_0x4b7f('0x1d'),_0x39c93b,_0x5de253[_0x4b7f('0x22')][_0x4b7f('0x24')]);return _0x184cea(_0x5de253[_0x4b7f('0x22')]['message']);}logger[_0x4b7f('0x22')](_0x4b7f('0x1d'),_0x39c93b,_0x5de253[_0x4b7f('0x22')]['message']);return _0x9d2d2a(_0x5de253[_0x4b7f('0x22')][_0x4b7f('0x24')]);}else{logger[_0x4b7f('0x1c')]('ZendeskAccount,\x20%s,\x20%s',_0x39c93b,_0x4b7f('0x1e'));_0x9d2d2a(_0x5de253[_0x4b7f('0x25')]['message']);}})[_0x4b7f('0x26')](function(_0x3649e2){logger['error'](_0x4b7f('0x1d'),_0x39c93b,_0x3649e2);_0x184cea(_0x3649e2);});});}function respondWithStatusCode(_0x48fb7c,_0x250243){_0x250243=_0x250243||0xcc;return function(_0xeb1f61){if(_0xeb1f61){return _0x48fb7c[_0x4b7f('0x27')](_0x250243);}return _0x48fb7c[_0x4b7f('0x28')](_0x250243)[_0x4b7f('0x29')]();};}function respondWithResult(_0x5eaa99,_0x9ea959){_0x9ea959=_0x9ea959||0xc8;return function(_0x462ad2){if(_0x462ad2){return _0x5eaa99[_0x4b7f('0x28')](_0x9ea959)[_0x4b7f('0x2a')](_0x462ad2);}};}function respondWithFilteredResult(_0x597b37,_0x3edf28){return function(_0x19d08e){if(_0x19d08e){var _0x187638=_0x19d08e[_0x4b7f('0x2b')],_0x1cc374=_0x3edf28['offset'],_0x3f23be=_0x3edf28[_0x4b7f('0x2c')]+_0x3edf28[_0x4b7f('0x2d')],_0x2d1879;if(_0x3f23be>=_0x187638){_0x3f23be=_0x187638;_0x2d1879=0xc8;}else{_0x2d1879=0xce;}_0x597b37[_0x4b7f('0x28')](_0x2d1879);return _0x597b37[_0x4b7f('0x2e')](_0x4b7f('0x2f'),_0x1cc374+'-'+_0x3f23be+'/'+_0x187638)[_0x4b7f('0x2a')](_0x19d08e);}return null;};}function patchUpdates(_0xcbc927){return function(_0x59469e){try{jsonpatch[_0x4b7f('0x30')](_0x59469e,_0xcbc927,!![]);}catch(_0x5b814e){return BPromise[_0x4b7f('0x31')](_0x5b814e);}return _0x59469e[_0x4b7f('0x32')]();};}function saveUpdates(_0x537c79,_0x180e5e){return function(_0x5b434e){if(_0x5b434e){return _0x5b434e[_0x4b7f('0x33')](_0x537c79)[_0x4b7f('0x1b')](function(_0x3b6361){return _0x3b6361;});}return null;};}function removeEntity(_0xcd63b2,_0x38af3e){return function(_0x45d192){if(_0x45d192){return _0x45d192['destroy']()['then'](function(){_0xcd63b2[_0x4b7f('0x28')](0xcc)[_0x4b7f('0x29')]();});}};}function handleEntityNotFound(_0x54c9c7,_0x3c1b23){return function(_0x145ace){if(!_0x145ace){_0x54c9c7['sendStatus'](0x194);}return _0x145ace;};}function handleError(_0x1cf152,_0x5b5767){_0x5b5767=_0x5b5767||0x1f4;return function(_0x105eee){logger['error'](_0x105eee[_0x4b7f('0x34')]);if(_0x105eee[_0x4b7f('0x35')]){delete _0x105eee['name'];}_0x1cf152[_0x4b7f('0x28')](_0x5b5767)[_0x4b7f('0x36')](_0x105eee);};}exports['index']=function(_0x122b32,_0x4802e7){var _0x2d32bf={},_0x3a4613={},_0x46ec58={'count':0x0,'rows':[]};var _0x28b006=_[_0x4b7f('0x37')](db[_0x4b7f('0x38')][_0x4b7f('0x39')],function(_0x1ad4b4){return{'name':_0x1ad4b4[_0x4b7f('0x3a')],'type':_0x1ad4b4[_0x4b7f('0x3b')][_0x4b7f('0x3c')]};});_0x3a4613[_0x4b7f('0x3d')]=_[_0x4b7f('0x37')](_0x28b006,_0x4b7f('0x35'));_0x3a4613[_0x4b7f('0x3e')]=_[_0x4b7f('0x3f')](_0x122b32[_0x4b7f('0x3e')]);_0x3a4613['filters']=_['intersection'](_0x3a4613[_0x4b7f('0x3d')],_0x3a4613['query']);_0x2d32bf[_0x4b7f('0x40')]=_[_0x4b7f('0x41')](_0x3a4613[_0x4b7f('0x3d')],qs[_0x4b7f('0x42')](_0x122b32['query'][_0x4b7f('0x42')]));_0x2d32bf['attributes']=_0x2d32bf[_0x4b7f('0x40')][_0x4b7f('0x43')]?_0x2d32bf[_0x4b7f('0x40')]:_0x3a4613[_0x4b7f('0x3d')];if(!_0x122b32[_0x4b7f('0x3e')][_0x4b7f('0x44')](_0x4b7f('0x45'))){_0x2d32bf['limit']=qs[_0x4b7f('0x2d')](_0x122b32[_0x4b7f('0x3e')][_0x4b7f('0x2d')]);_0x2d32bf[_0x4b7f('0x2c')]=qs[_0x4b7f('0x2c')](_0x122b32[_0x4b7f('0x3e')][_0x4b7f('0x2c')]);}_0x2d32bf[_0x4b7f('0x46')]=qs[_0x4b7f('0x47')](_0x122b32['query'][_0x4b7f('0x47')]);_0x2d32bf[_0x4b7f('0x48')]=qs[_0x4b7f('0x49')](_[_0x4b7f('0x4a')](_0x122b32['query'],_0x3a4613[_0x4b7f('0x49')]));if(_0x122b32[_0x4b7f('0x3e')][_0x4b7f('0x4b')]){_0x2d32bf[_0x4b7f('0x48')]=_['merge'](_0x2d32bf[_0x4b7f('0x48')],{'$or':_[_0x4b7f('0x37')](_0x28b006,function(_0x269adf){if(_0x269adf['type']!==_0x4b7f('0x4c')){var _0x5552f7={};_0x5552f7[_0x269adf['name']]={'$like':'%'+_0x122b32[_0x4b7f('0x3e')][_0x4b7f('0x4b')]+'%'};return _0x5552f7;}})});}_0x2d32bf=_[_0x4b7f('0x4d')]({},_0x2d32bf,_0x122b32[_0x4b7f('0x4e')]);var _0x2e46a0={'where':_0x2d32bf[_0x4b7f('0x48')]};return db[_0x4b7f('0x38')][_0x4b7f('0x2b')](_0x2e46a0)[_0x4b7f('0x1b')](function(_0x185f16){_0x46ec58['count']=_0x185f16;if(_0x122b32[_0x4b7f('0x3e')]['includeAll']){_0x2d32bf[_0x4b7f('0x4f')]=[{'all':!![]}];}return db['ZendeskAccount']['findAll'](_0x2d32bf);})[_0x4b7f('0x1b')](function(_0x56da47){_0x46ec58['rows']=_0x56da47;return _0x46ec58;})[_0x4b7f('0x1b')](respondWithFilteredResult(_0x4802e7,_0x2d32bf))[_0x4b7f('0x26')](handleError(_0x4802e7,null));};exports[_0x4b7f('0x50')]=function(_0x2c4140,_0x5f263f){var _0x5a9cb4={'raw':![],'where':{'id':_0x2c4140[_0x4b7f('0x51')]['id']}},_0x41a34e={};_0x41a34e[_0x4b7f('0x3d')]=_[_0x4b7f('0x3f')](db['ZendeskAccount'][_0x4b7f('0x39')]);_0x41a34e[_0x4b7f('0x3e')]=_[_0x4b7f('0x3f')](_0x2c4140[_0x4b7f('0x3e')]);_0x41a34e[_0x4b7f('0x49')]=_['intersection'](_0x41a34e[_0x4b7f('0x3d')],_0x41a34e[_0x4b7f('0x3e')]);_0x5a9cb4['attributes']=_['intersection'](_0x41a34e[_0x4b7f('0x3d')],qs[_0x4b7f('0x42')](_0x2c4140[_0x4b7f('0x3e')][_0x4b7f('0x42')]));_0x5a9cb4[_0x4b7f('0x40')]=_0x5a9cb4[_0x4b7f('0x40')][_0x4b7f('0x43')]?_0x5a9cb4[_0x4b7f('0x40')]:_0x41a34e[_0x4b7f('0x3d')];if(_0x2c4140[_0x4b7f('0x3e')][_0x4b7f('0x52')]){_0x5a9cb4[_0x4b7f('0x4f')]=[{'all':!![]}];}_0x5a9cb4=_['merge']({},_0x5a9cb4,_0x2c4140[_0x4b7f('0x4e')]);return db['ZendeskAccount'][_0x4b7f('0x53')](_0x5a9cb4)[_0x4b7f('0x1b')](handleEntityNotFound(_0x5f263f,null))[_0x4b7f('0x1b')](respondWithResult(_0x5f263f,null))[_0x4b7f('0x26')](handleError(_0x5f263f,null));};exports[_0x4b7f('0x54')]=function(_0xde7d11,_0x14608c){return db[_0x4b7f('0x38')][_0x4b7f('0x54')](_0xde7d11[_0x4b7f('0x55')],{})[_0x4b7f('0x1b')](respondWithResult(_0x14608c,0xc9))[_0x4b7f('0x26')](handleError(_0x14608c,null));};exports['update']=function(_0x526a9b,_0x350f7c){if(_0x526a9b[_0x4b7f('0x55')]['id']){delete _0x526a9b[_0x4b7f('0x55')]['id'];}return db[_0x4b7f('0x38')][_0x4b7f('0x53')]({'where':{'id':_0x526a9b['params']['id']}})[_0x4b7f('0x1b')](handleEntityNotFound(_0x350f7c,null))[_0x4b7f('0x1b')](saveUpdates(_0x526a9b[_0x4b7f('0x55')],null))[_0x4b7f('0x1b')](respondWithResult(_0x350f7c,null))[_0x4b7f('0x26')](handleError(_0x350f7c,null));};exports[_0x4b7f('0x56')]=function(_0x436c8a,_0x163b55){return db[_0x4b7f('0x38')][_0x4b7f('0x53')]({'where':{'id':_0x436c8a['params']['id']}})[_0x4b7f('0x1b')](handleEntityNotFound(_0x163b55,null))[_0x4b7f('0x1b')](removeEntity(_0x163b55,null))[_0x4b7f('0x26')](handleError(_0x163b55,null));};exports[_0x4b7f('0x57')]=function(_0x3cfc9c,_0x37bb99,_0x53d29a){var _0x3c2d6f={};var _0x1ee21c={};var _0x51fbac;var _0xaef17e;return db[_0x4b7f('0x38')][_0x4b7f('0x58')]({'where':{'id':_0x3cfc9c['params']['id']}})[_0x4b7f('0x1b')](handleEntityNotFound(_0x37bb99,null))['then'](function(_0x27dfe3){if(_0x27dfe3){_0x51fbac=_0x27dfe3;_0x1ee21c[_0x4b7f('0x3d')]=_[_0x4b7f('0x3f')](db['ZendeskConfiguration'][_0x4b7f('0x39')]);_0x1ee21c[_0x4b7f('0x3e')]=_[_0x4b7f('0x3f')](_0x3cfc9c[_0x4b7f('0x3e')]);_0x1ee21c[_0x4b7f('0x49')]=_[_0x4b7f('0x41')](_0x1ee21c[_0x4b7f('0x3d')],_0x1ee21c[_0x4b7f('0x3e')]);_0x3c2d6f[_0x4b7f('0x40')]=_[_0x4b7f('0x41')](_0x1ee21c[_0x4b7f('0x3d')],qs['fields'](_0x3cfc9c[_0x4b7f('0x3e')][_0x4b7f('0x42')]));_0x3c2d6f[_0x4b7f('0x40')]=_0x3c2d6f[_0x4b7f('0x40')][_0x4b7f('0x43')]?_0x3c2d6f[_0x4b7f('0x40')]:_0x1ee21c[_0x4b7f('0x3d')];_0x3c2d6f[_0x4b7f('0x46')]=qs['sort'](_0x3cfc9c[_0x4b7f('0x3e')][_0x4b7f('0x47')]);_0x3c2d6f[_0x4b7f('0x48')]=qs[_0x4b7f('0x49')](_['pick'](_0x3cfc9c[_0x4b7f('0x3e')],_0x1ee21c['filters']));if(_0x3cfc9c[_0x4b7f('0x3e')][_0x4b7f('0x4b')]){_0x3c2d6f[_0x4b7f('0x48')]=_[_0x4b7f('0x4d')](_0x3c2d6f['where'],{'$or':_[_0x4b7f('0x37')](_0x3c2d6f[_0x4b7f('0x40')],function(_0x965d53){var _0x3e8c66={};_0x3e8c66[_0x965d53]={'$like':'%'+_0x3cfc9c[_0x4b7f('0x3e')]['filter']+'%'};return _0x3e8c66;})});}_0x3c2d6f=_[_0x4b7f('0x4d')]({},_0x3c2d6f,_0x3cfc9c[_0x4b7f('0x4e')]);return _0x51fbac['getConfigurations'](_0x3c2d6f);}})[_0x4b7f('0x1b')](function(_0x57755b){if(_0x57755b){_0xaef17e=_0x57755b[_0x4b7f('0x43')];if(!_0x3cfc9c[_0x4b7f('0x3e')]['hasOwnProperty'](_0x4b7f('0x45'))){_0x3c2d6f[_0x4b7f('0x2d')]=qs[_0x4b7f('0x2d')](_0x3cfc9c[_0x4b7f('0x3e')][_0x4b7f('0x2d')]);_0x3c2d6f[_0x4b7f('0x2c')]=qs[_0x4b7f('0x2c')](_0x3cfc9c[_0x4b7f('0x3e')]['offset']);}return _0x51fbac[_0x4b7f('0x57')](_0x3c2d6f);}})[_0x4b7f('0x1b')](function(_0x412ac4){if(_0x412ac4){return _0x412ac4?{'count':_0xaef17e,'rows':_0x412ac4}:null;}})['then'](respondWithResult(_0x37bb99,null))['catch'](handleError(_0x37bb99,null));};exports[_0x4b7f('0x59')]=function(_0x3089c2,_0x31dddb,_0x3b6263){if(_0x3089c2[_0x4b7f('0x55')]['id']){delete _0x3089c2[_0x4b7f('0x55')]['id'];}return db[_0x4b7f('0x38')][_0x4b7f('0x58')]({'where':{'id':_0x3089c2[_0x4b7f('0x51')]['id']}})['then'](handleEntityNotFound(_0x31dddb,null))['then'](function(_0x537644){if(_0x537644){_0x3089c2[_0x4b7f('0x55')][_0x4b7f('0x5a')]=_0x537644['id'];_0x3089c2[_0x4b7f('0x55')]['Subjects']=integrations[_0x4b7f('0x5b')](_0x3089c2[_0x4b7f('0x55')][_0x4b7f('0x5c')],_0x3089c2[_0x4b7f('0x55')][_0x4b7f('0x3b')]);_0x3089c2[_0x4b7f('0x55')]['Descriptions']=integrations[_0x4b7f('0x5d')](_0x3089c2[_0x4b7f('0x55')][_0x4b7f('0x5c')],_0x3089c2[_0x4b7f('0x55')][_0x4b7f('0x3b')]);return db[_0x4b7f('0x5e')][_0x4b7f('0x54')](_0x3089c2[_0x4b7f('0x55')],{'include':[{'model':db[_0x4b7f('0x5f')],'as':_0x4b7f('0x60')},{'model':db[_0x4b7f('0x5f')],'as':_0x4b7f('0x61')}]});}return null;})['then'](respondWithResult(_0x31dddb,null))[_0x4b7f('0x26')](handleError(_0x31dddb,null));};exports['getFields']=function(_0x3a36d7,_0xfb062f,_0x35fef7){var _0xfb199a='';return db[_0x4b7f('0x38')][_0x4b7f('0x58')]({'where':{'id':_0x3a36d7[_0x4b7f('0x51')]['id']},'attributes':['id',_0x4b7f('0x62'),_0x4b7f('0x63'),_0x4b7f('0x64'),_0x4b7f('0x65'),'remoteUri']})[_0x4b7f('0x1b')](handleEntityNotFound(_0xfb062f,null))[_0x4b7f('0x1b')](function(_0x2668ce){if(_0x2668ce){_0xfb199a=_0x2668ce['remoteUri'];var _0x54693b=_0xfb199a['slice'](-0x1);if(_0x54693b==='/'){_0xfb199a=_0xfb199a[_0x4b7f('0x66')](0x0,_0xfb199a[_0x4b7f('0x67')](_0x54693b));}var _0x1fbd1d={'method':_0x4b7f('0x68'),'uri':util[_0x4b7f('0x69')](_0x4b7f('0x6a'),_0xfb199a,'ticket_fields'),'json':!![]};switch(_0x2668ce[_0x4b7f('0x65')]){case _0x4b7f('0x63'):_0x1fbd1d[_0x4b7f('0x6b')]={'Authorization':util[_0x4b7f('0x69')](_0x4b7f('0x6c'),new Buffer(util['format']('%s:%s',_0x2668ce[_0x4b7f('0x62')],_0x2668ce[_0x4b7f('0x63')]))[_0x4b7f('0x6d')](_0x4b7f('0x6e')))};break;case _0x4b7f('0x64'):_0x1fbd1d[_0x4b7f('0x6b')]={'Authorization':util[_0x4b7f('0x69')](_0x4b7f('0x6c'),new Buffer(util[_0x4b7f('0x69')](_0x4b7f('0x6f'),_0x2668ce[_0x4b7f('0x62')],_0x2668ce['token']))[_0x4b7f('0x6d')](_0x4b7f('0x6e')))};break;default:throw new db[(_0x4b7f('0x70'))][(_0x4b7f('0x71'))](_0x4b7f('0x72'));}return rp(_0x1fbd1d);}})['then'](function(_0x3d4341){if(_0x3d4341){var _0x4891fe=[_0x4b7f('0x73'),_0x4b7f('0x74'),_0x4b7f('0x75'),_0x4b7f('0x76')];_[_0x4b7f('0x77')](_0x3d4341[_0x4b7f('0x78')],function(_0x2f79b2){return _0x4891fe[_0x4b7f('0x79')](_0x2f79b2[_0x4b7f('0x3b')]);});return{'count':_0x3d4341[_0x4b7f('0x78')][_0x4b7f('0x43')],'rows':_['map'](_0x3d4341[_0x4b7f('0x78')],function(_0x183290){return{'id':_0x183290['id'],'name':_0x183290[_0x4b7f('0x7a')]>0x7?_0x183290[_0x4b7f('0x7b')]:_0x183290[_0x4b7f('0x3b')],'custom':_0x183290[_0x4b7f('0x7a')]>0x7?!![]:![],'options':_0x183290['system_field_options']?_0x183290['system_field_options']:_0x183290[_0x4b7f('0x7c')]?_0x183290['custom_field_options']:[]};})};}})[_0x4b7f('0x1b')](respondWithResult(_0xfb062f,null))[_0x4b7f('0x26')](function(_0x50f9ac){var _0xf3dace=_0x3a36d7['query'][_0x4b7f('0x18')]?0x1f4:_0x50f9ac['statusCode']||0x1f4;logger['error'](_0x4b7f('0x7d'),'getFields',_0xf3dace,JSON[_0x4b7f('0x21')](_0x50f9ac));delete _0x50f9ac['name'];if(_0xf3dace===0x191){_0xf3dace=0x190;}_0xfb062f[_0x4b7f('0x28')](_0xf3dace)[_0x4b7f('0x36')](_0x3a36d7['query'][_0x4b7f('0x18')]?{'message':_0x4b7f('0x7e'),'statusCode':_0x50f9ac[_0x4b7f('0x7f')]}:_0x50f9ac);});}; \ No newline at end of file +var _0x95c0=['http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','ZendeskAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','set','Content-Range','apply','reject','save','end','sendStatus','name','send','index','map','ZendeskAccount','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','params','keys','find','create','body','update','destroy','getConfigurations','findOne','ZendeskConfiguration','hasOwnProperty','addConfiguration','getSubjects','channel','Descriptions','Subjects','ZendeskField','username','token','authType','remoteUri','slice','substring','lastIndexOf','format','%s/%s','headers','Basic\x20%s','%s:%s','password','toString','base64','%s/token:%s','description','assignee','remove','ticket_fields','includes','position','title','system_field_options','custom_field_options','getFields,\x20%s,\x20%s,\x20%s','getFields','Wrong\x20credentials','statusCode','eml-format','zip-dir','moment','mustache','util','path','sox','ejs','lodash','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client'];(function(_0x2e1eee,_0x504870){var _0x22027c=function(_0x209f64){while(--_0x209f64){_0x2e1eee['push'](_0x2e1eee['shift']());}};_0x22027c(++_0x504870);}(_0x95c0,0x16d));var _0x095c=function(_0x46d78d,_0x30b9a8){_0x46d78d=_0x46d78d-0x0;var _0x419112=_0x95c0[_0x46d78d];return _0x419112;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x095c('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x095c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x095c('0x2'));var BPromise=require('bluebird');var Mustache=require(_0x095c('0x3'));var util=require(_0x095c('0x4'));var path=require(_0x095c('0x5'));var sox=require(_0x095c('0x6'));var csv=require('to-csv');var ejs=require(_0x095c('0x7'));var fs=require('fs');var _=require(_0x095c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x095c('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x095c('0xa'));var querystring=require('querystring');var Papa=require(_0x095c('0xb'));var Redis=require(_0x095c('0xc'));var authService=require(_0x095c('0xd'));var qs=require(_0x095c('0xe'));var as=require(_0x095c('0xf'));var hardwareService=require(_0x095c('0x10'));var logger=require(_0x095c('0x11'))(_0x095c('0x12'));var utils=require(_0x095c('0x13'));var config=require(_0x095c('0x14'));var db=require(_0x095c('0x15'))['db'];var integrations=require(_0x095c('0x16'));var jayson=require(_0x095c('0x17'));var client=jayson[_0x095c('0x18')][_0x095c('0x19')]({'port':0x232a});function checkPasswordPattern(_0x5c8831,_0x55921b,_0x365173){if(_0x365173){var _0x362165=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x362165[_0x095c('0x1a')](_0x55921b)){return _0x5c8831;}else{throw new db[(_0x095c('0x1b'))][(_0x095c('0x1c'))](_0x095c('0x1d'));}}else{return _0x5c8831;}}function respondWithRpcPromise(_0x308cd6,_0x40b92d,_0x3f9c65,_0x1b9281){return new BPromise(function(_0xe12a58,_0x36d7b8){var _0x1f3d1a=_0x1b9281||client;return _0x1f3d1a[_0x095c('0x1e')](_0x308cd6,_0x3f9c65)[_0x095c('0x1f')](function(_0x161695){logger[_0x095c('0x20')]('ZendeskAccount,\x20%s,\x20%s',_0x40b92d,'request\x20sent');logger[_0x095c('0x21')](_0x095c('0x22'),_0x40b92d,_0x095c('0x23'),JSON[_0x095c('0x24')](_0x161695));if(_0x161695[_0x095c('0x25')]){if(_0x161695[_0x095c('0x25')][_0x095c('0x26')]===0x1f4){logger[_0x095c('0x25')](_0x095c('0x27'),_0x40b92d,_0x161695[_0x095c('0x25')][_0x095c('0x28')]);return _0x36d7b8(_0x161695[_0x095c('0x25')][_0x095c('0x28')]);}logger[_0x095c('0x25')]('ZendeskAccount,\x20%s,\x20%s',_0x40b92d,_0x161695[_0x095c('0x25')]['message']);return _0xe12a58(_0x161695[_0x095c('0x25')][_0x095c('0x28')]);}else{logger[_0x095c('0x20')](_0x095c('0x27'),_0x40b92d,_0x095c('0x23'));_0xe12a58(_0x161695[_0x095c('0x29')]['message']);}})[_0x095c('0x2a')](function(_0x4a4f29){logger[_0x095c('0x25')]('ZendeskAccount,\x20%s,\x20%s',_0x40b92d,_0x4a4f29);_0x36d7b8(_0x4a4f29);});});}function respondWithStatusCode(_0x48aa3e,_0x303007){_0x303007=_0x303007||0xcc;return function(_0x21133e){if(_0x21133e){return _0x48aa3e['sendStatus'](_0x303007);}return _0x48aa3e[_0x095c('0x2b')](_0x303007)['end']();};}function respondWithResult(_0xfa543c,_0x2cf349){_0x2cf349=_0x2cf349||0xc8;return function(_0x4358bf){if(_0x4358bf){return _0xfa543c['status'](_0x2cf349)[_0x095c('0x2c')](_0x4358bf);}};}function respondWithFilteredResult(_0x24056a,_0x5280f0){return function(_0x2e0e07){if(_0x2e0e07){var _0x85c33=_0x2e0e07['count'],_0x3e66c7=_0x5280f0[_0x095c('0x2d')],_0xa701c3=_0x5280f0[_0x095c('0x2d')]+_0x5280f0[_0x095c('0x2e')],_0x5261c2;if(_0xa701c3>=_0x85c33){_0xa701c3=_0x85c33;_0x5261c2=0xc8;}else{_0x5261c2=0xce;}_0x24056a['status'](_0x5261c2);return _0x24056a[_0x095c('0x2f')](_0x095c('0x30'),_0x3e66c7+'-'+_0xa701c3+'/'+_0x85c33)['json'](_0x2e0e07);}return null;};}function patchUpdates(_0x4f2223){return function(_0x53bbc0){try{jsonpatch[_0x095c('0x31')](_0x53bbc0,_0x4f2223,!![]);}catch(_0x4a763b){return BPromise[_0x095c('0x32')](_0x4a763b);}return _0x53bbc0[_0x095c('0x33')]();};}function saveUpdates(_0x1d7e1b,_0x4623c4){return function(_0x1eee6b){if(_0x1eee6b){return _0x1eee6b['update'](_0x1d7e1b)['then'](function(_0x205e2a){return _0x205e2a;});}return null;};}function removeEntity(_0x261b3a,_0xd34a7a){return function(_0x1aad30){if(_0x1aad30){return _0x1aad30['destroy']()['then'](function(){_0x261b3a[_0x095c('0x2b')](0xcc)[_0x095c('0x34')]();});}};}function handleEntityNotFound(_0x1d26c7,_0x42fa72){return function(_0x4fc473){if(!_0x4fc473){_0x1d26c7[_0x095c('0x35')](0x194);}return _0x4fc473;};}function handleError(_0xb7a4b2,_0x1a9aca){_0x1a9aca=_0x1a9aca||0x1f4;return function(_0x3914bb){logger[_0x095c('0x25')](_0x3914bb['stack']);if(_0x3914bb[_0x095c('0x36')]){delete _0x3914bb['name'];}_0xb7a4b2[_0x095c('0x2b')](_0x1a9aca)[_0x095c('0x37')](_0x3914bb);};}exports[_0x095c('0x38')]=function(_0x3bf0df,_0x1ed0f3){var _0x6f370e={},_0x29e8fc={},_0xb4f250={'count':0x0,'rows':[]};var _0x49d22e=_[_0x095c('0x39')](db[_0x095c('0x3a')][_0x095c('0x3b')],function(_0x5d4852){return{'name':_0x5d4852[_0x095c('0x3c')],'type':_0x5d4852[_0x095c('0x3d')]['key']};});_0x29e8fc['model']=_[_0x095c('0x39')](_0x49d22e,_0x095c('0x36'));_0x29e8fc[_0x095c('0x3e')]=_['keys'](_0x3bf0df[_0x095c('0x3e')]);_0x29e8fc[_0x095c('0x3f')]=_[_0x095c('0x40')](_0x29e8fc[_0x095c('0x41')],_0x29e8fc[_0x095c('0x3e')]);_0x6f370e[_0x095c('0x42')]=_[_0x095c('0x40')](_0x29e8fc[_0x095c('0x41')],qs[_0x095c('0x43')](_0x3bf0df[_0x095c('0x3e')][_0x095c('0x43')]));_0x6f370e['attributes']=_0x6f370e[_0x095c('0x42')][_0x095c('0x44')]?_0x6f370e[_0x095c('0x42')]:_0x29e8fc['model'];if(!_0x3bf0df[_0x095c('0x3e')]['hasOwnProperty'](_0x095c('0x45'))){_0x6f370e[_0x095c('0x2e')]=qs['limit'](_0x3bf0df[_0x095c('0x3e')][_0x095c('0x2e')]);_0x6f370e[_0x095c('0x2d')]=qs[_0x095c('0x2d')](_0x3bf0df['query'][_0x095c('0x2d')]);}_0x6f370e[_0x095c('0x46')]=qs[_0x095c('0x47')](_0x3bf0df[_0x095c('0x3e')][_0x095c('0x47')]);_0x6f370e[_0x095c('0x48')]=qs[_0x095c('0x3f')](_[_0x095c('0x49')](_0x3bf0df['query'],_0x29e8fc[_0x095c('0x3f')]));if(_0x3bf0df['query'][_0x095c('0x4a')]){_0x6f370e['where']=_[_0x095c('0x4b')](_0x6f370e[_0x095c('0x48')],{'$or':_[_0x095c('0x39')](_0x49d22e,function(_0x427298){if(_0x427298[_0x095c('0x3d')]!==_0x095c('0x4c')){var _0x43e21c={};_0x43e21c[_0x427298['name']]={'$like':'%'+_0x3bf0df[_0x095c('0x3e')][_0x095c('0x4a')]+'%'};return _0x43e21c;}})});}_0x6f370e=_[_0x095c('0x4b')]({},_0x6f370e,_0x3bf0df[_0x095c('0x4d')]);var _0x11b135={'where':_0x6f370e[_0x095c('0x48')]};return db[_0x095c('0x3a')][_0x095c('0x4e')](_0x11b135)[_0x095c('0x1f')](function(_0x47d111){_0xb4f250[_0x095c('0x4e')]=_0x47d111;if(_0x3bf0df[_0x095c('0x3e')][_0x095c('0x4f')]){_0x6f370e[_0x095c('0x50')]=[{'all':!![]}];}return db[_0x095c('0x3a')][_0x095c('0x51')](_0x6f370e);})[_0x095c('0x1f')](function(_0x519940){_0xb4f250[_0x095c('0x52')]=_0x519940;return _0xb4f250;})[_0x095c('0x1f')](respondWithFilteredResult(_0x1ed0f3,_0x6f370e))[_0x095c('0x2a')](handleError(_0x1ed0f3,null));};exports[_0x095c('0x53')]=function(_0x99d2a0,_0xdf9d08){var _0x164b47={'raw':![],'where':{'id':_0x99d2a0[_0x095c('0x54')]['id']}},_0x59bd49={};_0x59bd49[_0x095c('0x41')]=_['keys'](db[_0x095c('0x3a')][_0x095c('0x3b')]);_0x59bd49['query']=_[_0x095c('0x55')](_0x99d2a0[_0x095c('0x3e')]);_0x59bd49[_0x095c('0x3f')]=_[_0x095c('0x40')](_0x59bd49[_0x095c('0x41')],_0x59bd49[_0x095c('0x3e')]);_0x164b47['attributes']=_[_0x095c('0x40')](_0x59bd49[_0x095c('0x41')],qs[_0x095c('0x43')](_0x99d2a0[_0x095c('0x3e')]['fields']));_0x164b47[_0x095c('0x42')]=_0x164b47[_0x095c('0x42')][_0x095c('0x44')]?_0x164b47[_0x095c('0x42')]:_0x59bd49[_0x095c('0x41')];if(_0x99d2a0[_0x095c('0x3e')][_0x095c('0x4f')]){_0x164b47['include']=[{'all':!![]}];}_0x164b47=_[_0x095c('0x4b')]({},_0x164b47,_0x99d2a0['options']);return db['ZendeskAccount'][_0x095c('0x56')](_0x164b47)[_0x095c('0x1f')](handleEntityNotFound(_0xdf9d08,null))[_0x095c('0x1f')](respondWithResult(_0xdf9d08,null))[_0x095c('0x2a')](handleError(_0xdf9d08,null));};exports[_0x095c('0x57')]=function(_0xad04d9,_0x561954){return db[_0x095c('0x3a')]['create'](_0xad04d9[_0x095c('0x58')],{})[_0x095c('0x1f')](respondWithResult(_0x561954,0xc9))['catch'](handleError(_0x561954,null));};exports[_0x095c('0x59')]=function(_0x3da462,_0x5e0fbb){if(_0x3da462[_0x095c('0x58')]['id']){delete _0x3da462[_0x095c('0x58')]['id'];}return db[_0x095c('0x3a')][_0x095c('0x56')]({'where':{'id':_0x3da462[_0x095c('0x54')]['id']}})['then'](handleEntityNotFound(_0x5e0fbb,null))[_0x095c('0x1f')](saveUpdates(_0x3da462[_0x095c('0x58')],null))['then'](respondWithResult(_0x5e0fbb,null))['catch'](handleError(_0x5e0fbb,null));};exports[_0x095c('0x5a')]=function(_0x483408,_0x2c741c){return db[_0x095c('0x3a')][_0x095c('0x56')]({'where':{'id':_0x483408[_0x095c('0x54')]['id']}})[_0x095c('0x1f')](handleEntityNotFound(_0x2c741c,null))[_0x095c('0x1f')](removeEntity(_0x2c741c,null))[_0x095c('0x2a')](handleError(_0x2c741c,null));};exports[_0x095c('0x5b')]=function(_0x314770,_0x25d410,_0x4936c3){var _0x29f8ce={};var _0x618fab={};var _0xd031b8;var _0x2f4ed1;return db[_0x095c('0x3a')][_0x095c('0x5c')]({'where':{'id':_0x314770[_0x095c('0x54')]['id']}})[_0x095c('0x1f')](handleEntityNotFound(_0x25d410,null))[_0x095c('0x1f')](function(_0x573793){if(_0x573793){_0xd031b8=_0x573793;_0x618fab['model']=_['keys'](db[_0x095c('0x5d')][_0x095c('0x3b')]);_0x618fab['query']=_[_0x095c('0x55')](_0x314770['query']);_0x618fab['filters']=_[_0x095c('0x40')](_0x618fab['model'],_0x618fab[_0x095c('0x3e')]);_0x29f8ce['attributes']=_[_0x095c('0x40')](_0x618fab[_0x095c('0x41')],qs['fields'](_0x314770['query'][_0x095c('0x43')]));_0x29f8ce['attributes']=_0x29f8ce[_0x095c('0x42')]['length']?_0x29f8ce['attributes']:_0x618fab[_0x095c('0x41')];_0x29f8ce['order']=qs['sort'](_0x314770['query']['sort']);_0x29f8ce[_0x095c('0x48')]=qs[_0x095c('0x3f')](_[_0x095c('0x49')](_0x314770[_0x095c('0x3e')],_0x618fab[_0x095c('0x3f')]));if(_0x314770[_0x095c('0x3e')][_0x095c('0x4a')]){_0x29f8ce[_0x095c('0x48')]=_[_0x095c('0x4b')](_0x29f8ce['where'],{'$or':_['map'](_0x29f8ce['attributes'],function(_0x1e9d5c){var _0x43d19d={};_0x43d19d[_0x1e9d5c]={'$like':'%'+_0x314770['query'][_0x095c('0x4a')]+'%'};return _0x43d19d;})});}_0x29f8ce=_['merge']({},_0x29f8ce,_0x314770[_0x095c('0x4d')]);return _0xd031b8[_0x095c('0x5b')](_0x29f8ce);}})[_0x095c('0x1f')](function(_0x3a7921){if(_0x3a7921){_0x2f4ed1=_0x3a7921['length'];if(!_0x314770[_0x095c('0x3e')][_0x095c('0x5e')](_0x095c('0x45'))){_0x29f8ce['limit']=qs[_0x095c('0x2e')](_0x314770['query']['limit']);_0x29f8ce[_0x095c('0x2d')]=qs[_0x095c('0x2d')](_0x314770['query'][_0x095c('0x2d')]);}return _0xd031b8[_0x095c('0x5b')](_0x29f8ce);}})[_0x095c('0x1f')](function(_0x2777be){if(_0x2777be){return _0x2777be?{'count':_0x2f4ed1,'rows':_0x2777be}:null;}})[_0x095c('0x1f')](respondWithResult(_0x25d410,null))[_0x095c('0x2a')](handleError(_0x25d410,null));};exports[_0x095c('0x5f')]=function(_0x374631,_0x29157f,_0x142193){if(_0x374631[_0x095c('0x58')]['id']){delete _0x374631[_0x095c('0x58')]['id'];}return db[_0x095c('0x3a')][_0x095c('0x5c')]({'where':{'id':_0x374631[_0x095c('0x54')]['id']}})[_0x095c('0x1f')](handleEntityNotFound(_0x29157f,null))['then'](function(_0x360b56){if(_0x360b56){_0x374631[_0x095c('0x58')]['AccountId']=_0x360b56['id'];_0x374631[_0x095c('0x58')]['Subjects']=integrations[_0x095c('0x60')](_0x374631[_0x095c('0x58')][_0x095c('0x61')],_0x374631[_0x095c('0x58')][_0x095c('0x3d')]);_0x374631[_0x095c('0x58')][_0x095c('0x62')]=integrations['getDescriptions'](_0x374631[_0x095c('0x58')][_0x095c('0x61')],_0x374631[_0x095c('0x58')][_0x095c('0x3d')]);return db[_0x095c('0x5d')]['create'](_0x374631[_0x095c('0x58')],{'include':[{'model':db['ZendeskField'],'as':_0x095c('0x63')},{'model':db[_0x095c('0x64')],'as':_0x095c('0x62')}]});}return null;})[_0x095c('0x1f')](respondWithResult(_0x29157f,null))['catch'](handleError(_0x29157f,null));};exports['getFields']=function(_0x33034f,_0x358643,_0x25ea8c){var _0x13ba30='';return db[_0x095c('0x3a')]['findOne']({'where':{'id':_0x33034f['params']['id']},'attributes':['id',_0x095c('0x65'),'password',_0x095c('0x66'),_0x095c('0x67'),_0x095c('0x68')]})[_0x095c('0x1f')](handleEntityNotFound(_0x358643,null))[_0x095c('0x1f')](function(_0x2f8db6){if(_0x2f8db6){_0x13ba30=_0x2f8db6[_0x095c('0x68')];var _0x2491b1=_0x13ba30[_0x095c('0x69')](-0x1);if(_0x2491b1==='/'){_0x13ba30=_0x13ba30[_0x095c('0x6a')](0x0,_0x13ba30[_0x095c('0x6b')](_0x2491b1));}var _0x419942={'method':'GET','uri':util[_0x095c('0x6c')](_0x095c('0x6d'),_0x13ba30,'ticket_fields'),'json':!![]};switch(_0x2f8db6['authType']){case'password':_0x419942[_0x095c('0x6e')]={'Authorization':util[_0x095c('0x6c')](_0x095c('0x6f'),new Buffer(util['format'](_0x095c('0x70'),_0x2f8db6[_0x095c('0x65')],_0x2f8db6[_0x095c('0x71')]))[_0x095c('0x72')](_0x095c('0x73')))};break;case _0x095c('0x66'):_0x419942['headers']={'Authorization':util[_0x095c('0x6c')](_0x095c('0x6f'),new Buffer(util[_0x095c('0x6c')](_0x095c('0x74'),_0x2f8db6['username'],_0x2f8db6[_0x095c('0x66')]))[_0x095c('0x72')](_0x095c('0x73')))};break;default:throw new db[(_0x095c('0x1b'))][(_0x095c('0x1c'))]('Unknown\x20authentication\x20type');}return rp(_0x419942);}})[_0x095c('0x1f')](function(_0x4adc04){if(_0x4adc04){var _0x22b9cd=['subject',_0x095c('0x75'),'group',_0x095c('0x76')];_[_0x095c('0x77')](_0x4adc04[_0x095c('0x78')],function(_0x1b9b5a){return _0x22b9cd[_0x095c('0x79')](_0x1b9b5a[_0x095c('0x3d')]);});return{'count':_0x4adc04['ticket_fields']['length'],'rows':_['map'](_0x4adc04[_0x095c('0x78')],function(_0x18354c){return{'id':_0x18354c['id'],'name':_0x18354c[_0x095c('0x7a')]>0x7?_0x18354c[_0x095c('0x7b')]:_0x18354c['type'],'custom':_0x18354c[_0x095c('0x7a')]>0x7?!![]:![],'options':_0x18354c[_0x095c('0x7c')]?_0x18354c['system_field_options']:_0x18354c[_0x095c('0x7d')]?_0x18354c['custom_field_options']:[]};})};}})[_0x095c('0x1f')](respondWithResult(_0x358643,null))[_0x095c('0x2a')](function(_0xa297f2){var _0x2c69c2=_0x33034f['query'][_0x095c('0x1a')]?0x1f4:_0xa297f2['statusCode']||0x1f4;logger[_0x095c('0x25')](_0x095c('0x7e'),_0x095c('0x7f'),_0x2c69c2,JSON[_0x095c('0x24')](_0xa297f2));delete _0xa297f2[_0x095c('0x36')];if(_0x2c69c2===0x191){_0x2c69c2=0x190;}_0x358643[_0x095c('0x2b')](_0x2c69c2)[_0x095c('0x37')](_0x33034f['query'][_0x095c('0x1a')]?{'message':_0x095c('0x80'),'statusCode':_0xa297f2[_0x095c('0x81')]}:_0xa297f2);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index a925d40..0f0e9aa 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 _0x3896=['api','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','int_zendesk_accounts','lodash','util'];(function(_0x4cf6d5,_0x11e732){var _0x328a90=function(_0x188a01){while(--_0x188a01){_0x4cf6d5['push'](_0x4cf6d5['shift']());}};_0x328a90(++_0x11e732);}(_0x3896,0x111));var _0x6389=function(_0x40bb50,_0x568df0){_0x40bb50=_0x40bb50-0x0;var _0x312603=_0x3896[_0x40bb50];return _0x312603;};'use strict';var _=require(_0x6389('0x0'));var util=require(_0x6389('0x1'));var logger=require('../../config/logger')(_0x6389('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6389('0x3'));var fs=require('fs');var path=require(_0x6389('0x4'));var rimraf=require(_0x6389('0x5'));var config=require(_0x6389('0x6'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x6389('0x7'));module[_0x6389('0x8')]=function(_0x95eb12,_0x402ef1){return _0x95eb12[_0x6389('0x9')]('ZendeskAccount',attributes,{'tableName':_0x6389('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x30f0=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','../../components/integrations/configuration','define','int_zendesk_accounts','lodash'];(function(_0x17f18c,_0x349444){var _0x1e641a=function(_0x19ea65){while(--_0x19ea65){_0x17f18c['push'](_0x17f18c['shift']());}};_0x1e641a(++_0x349444);}(_0x30f0,0x77));var _0x030f=function(_0x526d5c,_0xd5645d){_0x526d5c=_0x526d5c-0x0;var _0x4f9200=_0x30f0[_0x526d5c];return _0x4f9200;};'use strict';var _=require(_0x030f('0x0'));var util=require(_0x030f('0x1'));var logger=require(_0x030f('0x2'))(_0x030f('0x3'));var moment=require(_0x030f('0x4'));var BPromise=require(_0x030f('0x5'));var rp=require(_0x030f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x030f('0x7'));var config=require(_0x030f('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require(_0x030f('0x9'));module['exports']=function(_0x579b45,_0x41007d){return _0x579b45[_0x030f('0xa')]('ZendeskAccount',attributes,{'tableName':_0x030f('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 92e26b1..177ebbf 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 _0xe706=['options','raw','where','attributes','limit','include','map','model','stringify','ShowZendeskAccount','ZendeskAccount','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetZendeskAccount','findAll'];(function(_0x30ecd2,_0x1f80df){var _0x273354=function(_0x8c989f){while(--_0x8c989f){_0x30ecd2['push'](_0x30ecd2['shift']());}};_0x273354(++_0x1f80df);}(_0xe706,0xa3));var _0x6e70=function(_0x198247,_0x491c12){_0x198247=_0x198247-0x0;var _0x2b18bc=_0xe706[_0x198247];return _0x2b18bc;};'use strict';var _=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var moment=require(_0x6e70('0x2'));var BPromise=require('bluebird');var rs=require(_0x6e70('0x3'));var fs=require('fs');var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];var utils=require(_0x6e70('0x6'));var logger=require(_0x6e70('0x7'))(_0x6e70('0x8'));var config=require(_0x6e70('0x9'));var jayson=require(_0x6e70('0xa'));var client=jayson[_0x6e70('0xb')][_0x6e70('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36357b,_0x293ce7,_0x45a2d4){return new BPromise(function(_0x188ed3,_0x3c4843){return client[_0x6e70('0xd')](_0x36357b,_0x45a2d4)[_0x6e70('0xe')](function(_0x25e61c){logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,_0x6e70('0x11'));logger[_0x6e70('0x12')](_0x6e70('0x13'),_0x293ce7,_0x6e70('0x11'),JSON['stringify'](_0x25e61c));if(_0x25e61c['error']){if(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x15')]===0x1f4){logger[_0x6e70('0x14')](_0x6e70('0x10'),_0x293ce7,_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);return _0x3c4843(_0x25e61c[_0x6e70('0x14')][_0x6e70('0x16')]);}logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x25e61c['error'][_0x6e70('0x16')]);return _0x188ed3(_0x25e61c['error']['message']);}else{logger[_0x6e70('0xf')](_0x6e70('0x10'),_0x293ce7,'request\x20sent');_0x188ed3(_0x25e61c[_0x6e70('0x17')]['message']);}})[_0x6e70('0x18')](function(_0x161f23){logger['error']('ZendeskAccount,\x20%s,\x20%s',_0x293ce7,_0x161f23);_0x3c4843(_0x161f23);});});}exports[_0x6e70('0x19')]=function(_0x5ea7a5){var _0x28a21f=this;return new Promise(function(_0x173afe,_0x53acdc){return db['ZendeskAccount'][_0x6e70('0x1a')]({'raw':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'limit':_0x5ea7a5['options']?_0x5ea7a5[_0x6e70('0x1b')][_0x6e70('0x1f')]||null:null,'include':_0x5ea7a5[_0x6e70('0x1b')]?_0x5ea7a5['options'][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x5ea7a5[_0x6e70('0x1b')]['include'],function(_0x10fc91){return{'model':db[_0x10fc91['model']],'as':_0x10fc91['as'],'attributes':_0x10fc91['attributes'],'include':_0x10fc91['include']?_[_0x6e70('0x21')](_0x10fc91[_0x6e70('0x20')],function(_0x51d292){return{'model':db[_0x51d292[_0x6e70('0x22')]],'as':_0x51d292['as'],'attributes':_0x51d292[_0x6e70('0x1e')],'include':_0x51d292['include']?_[_0x6e70('0x21')](_0x51d292[_0x6e70('0x20')],function(_0x2bb231){return{'model':db[_0x2bb231['model']],'as':_0x2bb231['as'],'attributes':_0x2bb231['attributes']};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x3af17f){logger[_0x6e70('0xf')](_0x6e70('0x19'),_0x5ea7a5);logger[_0x6e70('0x12')]('GetZendeskAccount',_0x5ea7a5,JSON[_0x6e70('0x23')](_0x3af17f));_0x173afe(_0x3af17f);})[_0x6e70('0x18')](function(_0xecf336){logger[_0x6e70('0x14')](_0x6e70('0x19'),_0xecf336[_0x6e70('0x16')],_0x5ea7a5);_0x53acdc(_0x28a21f[_0x6e70('0x14')](0x1f4,_0xecf336[_0x6e70('0x16')]));});});};exports[_0x6e70('0x24')]=function(_0x3a5d30){var _0x4b1229=this;return new Promise(function(_0x1b27d8,_0x50d60b){return db[_0x6e70('0x25')]['find']({'raw':_0x3a5d30[_0x6e70('0x1b')]?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1c')]===undefined?!![]:![]:!![],'where':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1d')]||null:null,'attributes':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x1e')]||null:null,'include':_0x3a5d30['options']?_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3a5d30[_0x6e70('0x1b')][_0x6e70('0x20')],function(_0x1e3e76){return{'model':db[_0x1e3e76[_0x6e70('0x22')]],'as':_0x1e3e76['as'],'attributes':_0x1e3e76[_0x6e70('0x1e')],'include':_0x1e3e76[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x1e3e76['include'],function(_0x3b9c06){return{'model':db[_0x3b9c06['model']],'as':_0x3b9c06['as'],'attributes':_0x3b9c06[_0x6e70('0x1e')],'include':_0x3b9c06[_0x6e70('0x20')]?_[_0x6e70('0x21')](_0x3b9c06[_0x6e70('0x20')],function(_0x233a83){return{'model':db[_0x233a83[_0x6e70('0x22')]],'as':_0x233a83['as'],'attributes':_0x233a83[_0x6e70('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x6e70('0xe')](function(_0x80bebb){logger[_0x6e70('0xf')](_0x6e70('0x24'),_0x3a5d30);logger[_0x6e70('0x12')](_0x6e70('0x24'),_0x3a5d30,JSON['stringify'](_0x80bebb));_0x1b27d8(_0x80bebb);})['catch'](function(_0x5424eb){logger[_0x6e70('0x14')](_0x6e70('0x24'),_0x5424eb[_0x6e70('0x16')],_0x3a5d30);_0x50d60b(_0x4b1229[_0x6e70('0x14')](0x1f4,_0x5424eb[_0x6e70('0x16')]));});});}; \ No newline at end of file +var _0xa9e0=['code','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x231dda,_0x5b04cc){var _0x3f88cb=function(_0x16eb77){while(--_0x16eb77){_0x231dda['push'](_0x231dda['shift']());}};_0x3f88cb(++_0x5b04cc);}(_0xa9e0,0x123));var _0x0a9e=function(_0x484e36,_0x4482d8){_0x484e36=_0x484e36-0x0;var _0xafc85d=_0xa9e0[_0x484e36];return _0xafc85d;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['GetZendeskAccount']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')]({'raw':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x459eb1[_0x0a9e('0x16')]?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x18')]||null:null,'attributes':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x19')]||null:null,'limit':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')]['limit']||null:null,'include':_0x459eb1['options']?_0x459eb1[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x459eb1[_0x0a9e('0x16')]['include'],function(_0xfb6e48){return{'model':db[_0xfb6e48[_0x0a9e('0x1c')]],'as':_0xfb6e48['as'],'attributes':_0xfb6e48[_0x0a9e('0x19')],'include':_0xfb6e48[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0xfb6e48[_0x0a9e('0x1a')],function(_0x16b1ca){return{'model':db[_0x16b1ca['model']],'as':_0x16b1ca['as'],'attributes':_0x16b1ca['attributes'],'include':_0x16b1ca[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x16b1ca[_0x0a9e('0x1a')],function(_0x33161b){return{'model':db[_0x33161b['model']],'as':_0x33161b['as'],'attributes':_0x33161b[_0x0a9e('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x45a1e7){logger['info'](_0x0a9e('0x1d'),_0x459eb1);logger[_0x0a9e('0xd')](_0x0a9e('0x1d'),_0x459eb1,JSON[_0x0a9e('0x1e')](_0x45a1e7));_0x106033(_0x45a1e7);})[_0x0a9e('0x13')](function(_0x1538a4){logger[_0x0a9e('0x10')](_0x0a9e('0x1d'),_0x1538a4['message'],_0x459eb1);_0x205fd6(_0x478723[_0x0a9e('0x10')](0x1f4,_0x1538a4[_0x0a9e('0x11')]));});});};exports[_0x0a9e('0x1f')]=function(_0x2ec755){var _0x5c877d=this;return new Promise(function(_0x15b200,_0x40e7a3){return db[_0x0a9e('0x14')][_0x0a9e('0x20')]({'raw':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x17')]===undefined?!![]:![]:!![],'where':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')]['where']||null:null,'attributes':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755['options'][_0x0a9e('0x19')]||null:null,'include':_0x2ec755[_0x0a9e('0x16')]?_0x2ec755[_0x0a9e('0x16')][_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x2ec755['options'][_0x0a9e('0x1a')],function(_0x46f0a5){return{'model':db[_0x46f0a5[_0x0a9e('0x1c')]],'as':_0x46f0a5['as'],'attributes':_0x46f0a5[_0x0a9e('0x19')],'include':_0x46f0a5[_0x0a9e('0x1a')]?_[_0x0a9e('0x1b')](_0x46f0a5[_0x0a9e('0x1a')],function(_0x39e565){return{'model':db[_0x39e565['model']],'as':_0x39e565['as'],'attributes':_0x39e565[_0x0a9e('0x19')],'include':_0x39e565['include']?_[_0x0a9e('0x1b')](_0x39e565[_0x0a9e('0x1a')],function(_0x2b7e7f){return{'model':db[_0x2b7e7f[_0x0a9e('0x1c')]],'as':_0x2b7e7f['as'],'attributes':_0x2b7e7f['attributes']};}):[]};}):[]};}):[]:[]})[_0x0a9e('0x21')](function(_0xd1836d){logger[_0x0a9e('0xa')](_0x0a9e('0x1f'),_0x2ec755);logger['debug']('ShowZendeskAccount',_0x2ec755,JSON[_0x0a9e('0x1e')](_0xd1836d));_0x15b200(_0xd1836d);})['catch'](function(_0x24936a){logger[_0x0a9e('0x10')](_0x0a9e('0x1f'),_0x24936a[_0x0a9e('0x11')],_0x2ec755);_0x40e7a3(_0x5c877d['error'](0x1f4,_0x24936a[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index 2f32cf8..382b1f7 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 _0x1b46=['destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','getFields','/:id/subjects','getDescriptions','/:id/tags','getTags','create','post','put','update','delete'];(function(_0x1f9f37,_0x18776e){var _0x21c080=function(_0x4acb93){while(--_0x4acb93){_0x1f9f37['push'](_0x1f9f37['shift']());}};_0x21c080(++_0x18776e);}(_0x1b46,0x1d6));var _0x61b4=function(_0x446323,_0x3673a1){_0x446323=_0x446323-0x0;var _0x2fb6ae=_0x1b46[_0x446323];return _0x2fb6ae;};'use strict';var multer=require(_0x61b4('0x0'));var util=require(_0x61b4('0x1'));var path=require('path');var timeout=require(_0x61b4('0x2'));var express=require(_0x61b4('0x3'));var router=express[_0x61b4('0x4')]();var auth=require(_0x61b4('0x5'));var interaction=require(_0x61b4('0x6'));var config=require(_0x61b4('0x7'));var controller=require(_0x61b4('0x8'));router[_0x61b4('0x9')]('/',auth[_0x61b4('0xa')](),controller[_0x61b4('0xb')]);router[_0x61b4('0x9')](_0x61b4('0xc'),auth[_0x61b4('0xa')](),controller[_0x61b4('0xd')]);router[_0x61b4('0x9')]('/:id/fields',auth[_0x61b4('0xa')](),controller[_0x61b4('0xe')]);router['get'](_0x61b4('0xf'),auth[_0x61b4('0xa')](),controller['getSubjects']);router['get']('/:id/descriptions',auth['isAuthenticated'](),controller[_0x61b4('0x10')]);router[_0x61b4('0x9')](_0x61b4('0x11'),auth[_0x61b4('0xa')](),controller[_0x61b4('0x12')]);router['post']('/',auth[_0x61b4('0xa')](),controller[_0x61b4('0x13')]);router[_0x61b4('0x14')](_0x61b4('0x11'),auth[_0x61b4('0xa')](),controller['setTags']);router[_0x61b4('0x15')]('/:id',auth[_0x61b4('0xa')](),controller[_0x61b4('0x16')]);router[_0x61b4('0x17')](_0x61b4('0xc'),auth[_0x61b4('0xa')](),controller[_0x61b4('0x18')]);module[_0x61b4('0x19')]=router; \ No newline at end of file +var _0x3267=['../../components/auth/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','getTags','post','create','/:id/tags','setTags','put','update','delete','destroy','multer','util','connect-timeout','express','Router'];(function(_0x4b5683,_0x490034){var _0x49bae8=function(_0x54f7cd){while(--_0x54f7cd){_0x4b5683['push'](_0x4b5683['shift']());}};_0x49bae8(++_0x490034);}(_0x3267,0x15a));var _0x7326=function(_0x1034ca,_0x14ecd6){_0x1034ca=_0x1034ca-0x0;var _0x1a023a=_0x3267[_0x1034ca];return _0x1a023a;};'use strict';var multer=require(_0x7326('0x0'));var util=require(_0x7326('0x1'));var path=require('path');var timeout=require(_0x7326('0x2'));var express=require(_0x7326('0x3'));var router=express[_0x7326('0x4')]();var auth=require(_0x7326('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x7326('0x6'));var controller=require(_0x7326('0x7'));router[_0x7326('0x8')]('/',auth[_0x7326('0x9')](),controller[_0x7326('0xa')]);router[_0x7326('0x8')](_0x7326('0xb'),auth['isAuthenticated'](),controller[_0x7326('0xc')]);router['get'](_0x7326('0xd'),auth[_0x7326('0x9')](),controller[_0x7326('0xe')]);router[_0x7326('0x8')](_0x7326('0xf'),auth[_0x7326('0x9')](),controller[_0x7326('0x10')]);router[_0x7326('0x8')]('/:id/descriptions',auth[_0x7326('0x9')](),controller[_0x7326('0x11')]);router[_0x7326('0x8')]('/:id/tags',auth[_0x7326('0x9')](),controller[_0x7326('0x12')]);router[_0x7326('0x13')]('/',auth[_0x7326('0x9')](),controller[_0x7326('0x14')]);router[_0x7326('0x13')](_0x7326('0x15'),auth[_0x7326('0x9')](),controller[_0x7326('0x16')]);router[_0x7326('0x17')](_0x7326('0xb'),auth['isAuthenticated'](),controller[_0x7326('0x18')]);router[_0x7326('0x19')](_0x7326('0xb'),auth[_0x7326('0x9')](),controller[_0x7326('0x1a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 39e9f5e..68cfff3 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 _0x2f29=['STRING'];(function(_0x190859,_0x52c54b){var _0x39e79c=function(_0x2c72b7){while(--_0x2c72b7){_0x190859['push'](_0x190859['shift']());}};_0x39e79c(++_0x52c54b);}(_0x2f29,0xc6));var _0x92f2=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x2f29[_0x46698a];return _0x356db0;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x92f2('0x0')]},'description':{'type':Sequelize[_0x92f2('0x0')]}}; \ No newline at end of file +var _0x4e07=['STRING','sequelize','exports'];(function(_0x1f44b9,_0x1a7ebd){var _0xdea7aa=function(_0x13e81b){while(--_0x13e81b){_0x1f44b9['push'](_0x1f44b9['shift']());}};_0xdea7aa(++_0x1a7ebd);}(_0x4e07,0x70));var _0x74e0=function(_0x3fa681,_0x279c0b){_0x3fa681=_0x3fa681-0x0;var _0x3cb1bf=_0x4e07[_0x3fa681];return _0x3cb1bf;};'use strict';var Sequelize=require(_0x74e0('0x0'));module[_0x74e0('0x1')]={'name':{'type':Sequelize[_0x74e0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 41e8828..22d8d13 100644 --- a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js +++ b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xc4aa=['ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','map','ZendeskConfiguration','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','count','includeAll','rows','show','rawAttributes','include','create','body','find','params','getFields','ZendeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize'];(function(_0xfc406a,_0x4479e1){var _0x395473=function(_0x1fe8b6){while(--_0x1fe8b6){_0xfc406a['push'](_0xfc406a['shift']());}};_0x395473(++_0x4479e1);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0xc4aa[_0x68c979];return _0x4f0001;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');var _=require(_0xac4a('0xb'));var squel=require(_0xac4a('0xc'));var crypto=require(_0xac4a('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xac4a('0x9'));var querystring=require(_0xac4a('0xe'));var Papa=require(_0xac4a('0xf'));var Redis=require('ioredis');var authService=require(_0xac4a('0x10'));var qs=require(_0xac4a('0x11'));var as=require(_0xac4a('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac4a('0x13'))('api');var utils=require(_0xac4a('0x14'));var config=require('../../config/environment');var db=require(_0xac4a('0x15'))['db'];var jayson=require(_0xac4a('0x16'));var client=jayson[_0xac4a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x21a79,_0x68424a,_0x247b78){if(_0x247b78){var _0x6e00d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e00d4[_0xac4a('0x18')](_0x68424a)){return _0x21a79;}else{throw new db[(_0xac4a('0x19'))][(_0xac4a('0x1a'))](_0xac4a('0x1b'));}}else{return _0x21a79;}}function respondWithRpcPromise(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8){return new BPromise(function(_0x4a2119,_0x402fff){var _0x34d797=_0x26dbb8||client;return _0x34d797[_0xac4a('0x1c')](_0x190418,_0x11e101)[_0xac4a('0x1d')](function(_0x3e88e3){logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42c7fc,_0xac4a('0x20'),JSON[_0xac4a('0x21')](_0x3e88e3));if(_0x3e88e3[_0xac4a('0x22')]){if(_0x3e88e3['error'][_0xac4a('0x23')]===0x1f4){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x402fff(_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);}logger[_0xac4a('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x4a2119(_0x3e88e3['error'][_0xac4a('0x24')]);}else{logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));_0x4a2119(_0x3e88e3['result'][_0xac4a('0x24')]);}})[_0xac4a('0x25')](function(_0x15435c){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x15435c);_0x402fff(_0x15435c);});});}function respondWithStatusCode(_0x2b0dc2,_0x222507){_0x222507=_0x222507||0xcc;return function(_0x36054a){if(_0x36054a){return _0x2b0dc2[_0xac4a('0x26')](_0x222507);}return _0x2b0dc2[_0xac4a('0x27')](_0x222507)[_0xac4a('0x28')]();};}function respondWithResult(_0x215a31,_0x14832b){_0x14832b=_0x14832b||0xc8;return function(_0x472c57){if(_0x472c57){return _0x215a31[_0xac4a('0x27')](_0x14832b)[_0xac4a('0x29')](_0x472c57);}};}function respondWithFilteredResult(_0x4e17ce,_0x23b061){return function(_0x267a22){if(_0x267a22){var _0x42a33c=_0x267a22['count'],_0x2772fe=_0x23b061[_0xac4a('0x2a')],_0x116700=_0x23b061[_0xac4a('0x2a')]+_0x23b061[_0xac4a('0x2b')],_0x4a5a9e;if(_0x116700>=_0x42a33c){_0x116700=_0x42a33c;_0x4a5a9e=0xc8;}else{_0x4a5a9e=0xce;}_0x4e17ce['status'](_0x4a5a9e);return _0x4e17ce['set'](_0xac4a('0x2c'),_0x2772fe+'-'+_0x116700+'/'+_0x42a33c)[_0xac4a('0x29')](_0x267a22);}return null;};}function patchUpdates(_0x228629){return function(_0x432066){try{jsonpatch[_0xac4a('0x2d')](_0x432066,_0x228629,!![]);}catch(_0x53d3a5){return BPromise[_0xac4a('0x2e')](_0x53d3a5);}return _0x432066['save']();};}function saveUpdates(_0x30364b,_0x57adcf){return function(_0x17e6de){if(_0x17e6de){return _0x17e6de[_0xac4a('0x2f')](_0x30364b)[_0xac4a('0x1d')](function(_0x228aa7){return _0x228aa7;});}return null;};}function removeEntity(_0x34577f,_0x61e552){return function(_0xbd4591){if(_0xbd4591){return _0xbd4591[_0xac4a('0x30')]()[_0xac4a('0x1d')](function(){_0x34577f[_0xac4a('0x27')](0xcc)[_0xac4a('0x28')]();});}};}function handleEntityNotFound(_0x1634df,_0x1a9be2){return function(_0x1a9d4e){if(!_0x1a9d4e){_0x1634df['sendStatus'](0x194);}return _0x1a9d4e;};}function handleError(_0x30442d,_0x1c41fb){_0x1c41fb=_0x1c41fb||0x1f4;return function(_0x5a4e2b){logger[_0xac4a('0x22')](_0x5a4e2b[_0xac4a('0x31')]);if(_0x5a4e2b['name']){delete _0x5a4e2b['name'];}_0x30442d[_0xac4a('0x27')](_0x1c41fb)[_0xac4a('0x32')](_0x5a4e2b);};}exports[_0xac4a('0x33')]=function(_0x3de9e2,_0x4f5986){var _0x453d02={},_0x2e56c6={},_0x4e7630={'count':0x0,'rows':[]};var _0x37f2ee=_[_0xac4a('0x34')](db[_0xac4a('0x35')]['rawAttributes'],function(_0x121328){return{'name':_0x121328[_0xac4a('0x36')],'type':_0x121328[_0xac4a('0x37')]['key']};});_0x2e56c6[_0xac4a('0x38')]=_[_0xac4a('0x34')](_0x37f2ee,'name');_0x2e56c6['query']=_[_0xac4a('0x39')](_0x3de9e2['query']);_0x2e56c6['filters']=_['intersection'](_0x2e56c6['model'],_0x2e56c6[_0xac4a('0x3a')]);_0x453d02[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2e56c6[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x453d02[_0xac4a('0x3b')]=_0x453d02[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x453d02[_0xac4a('0x3b')]:_0x2e56c6[_0xac4a('0x38')];if(!_0x3de9e2['query']['hasOwnProperty']('nolimit')){_0x453d02[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x453d02[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2a')]);}_0x453d02[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x3de9e2['query'][_0xac4a('0x40')]);_0x453d02[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x3de9e2[_0xac4a('0x3a')],_0x2e56c6['filters']));if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x453d02['where']=_[_0xac4a('0x45')](_0x453d02['where'],{'$or':_[_0xac4a('0x34')](_0x37f2ee,function(_0x65494e){if(_0x65494e[_0xac4a('0x37')]!==_0xac4a('0x46')){var _0x520e4a={};_0x520e4a[_0x65494e[_0xac4a('0x47')]]={'$like':'%'+_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x520e4a;}})});}_0x453d02=_[_0xac4a('0x45')]({},_0x453d02,_0x3de9e2[_0xac4a('0x48')]);var _0x4fa9eb={'where':_0x453d02[_0xac4a('0x41')]};return db['ZendeskConfiguration'][_0xac4a('0x49')](_0x4fa9eb)[_0xac4a('0x1d')](function(_0xeca4e9){_0x4e7630['count']=_0xeca4e9;if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x453d02['include']=[{'all':!![]}];}return db[_0xac4a('0x35')]['findAll'](_0x453d02);})[_0xac4a('0x1d')](function(_0xe620f6){_0x4e7630[_0xac4a('0x4b')]=_0xe620f6;return _0x4e7630;})['then'](respondWithFilteredResult(_0x4f5986,_0x453d02))['catch'](handleError(_0x4f5986,null));};exports[_0xac4a('0x4c')]=function(_0x4aaeff,_0x18ae96){var _0x566258={'raw':![],'where':{'id':_0x4aaeff['params']['id']}},_0x3d2aaf={};_0x3d2aaf[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x35')][_0xac4a('0x4d')]);_0x3d2aaf['query']=_[_0xac4a('0x39')](_0x4aaeff[_0xac4a('0x3a')]);_0x3d2aaf[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x3d2aaf[_0xac4a('0x38')],_0x3d2aaf[_0xac4a('0x3a')]);_0x566258[_0xac4a('0x3b')]=_['intersection'](_0x3d2aaf[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x4aaeff['query'][_0xac4a('0x3d')]));_0x566258[_0xac4a('0x3b')]=_0x566258[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x566258['attributes']:_0x3d2aaf[_0xac4a('0x38')];if(_0x4aaeff[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x566258[_0xac4a('0x4e')]=[{'all':!![]}];}_0x566258=_[_0xac4a('0x45')]({},_0x566258,_0x4aaeff['options']);return db[_0xac4a('0x35')]['find'](_0x566258)[_0xac4a('0x1d')](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x1d')](respondWithResult(_0x18ae96,null))['catch'](handleError(_0x18ae96,null));};exports['create']=function(_0x437466,_0x70fdc3){return db['ZendeskConfiguration'][_0xac4a('0x4f')](_0x437466[_0xac4a('0x50')],{})[_0xac4a('0x1d')](respondWithResult(_0x70fdc3,0xc9))[_0xac4a('0x25')](handleError(_0x70fdc3,null));};exports['update']=function(_0x3057d6,_0x108f7c){if(_0x3057d6[_0xac4a('0x50')]['id']){delete _0x3057d6[_0xac4a('0x50')]['id'];}return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x3057d6[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x108f7c,null))[_0xac4a('0x1d')](saveUpdates(_0x3057d6[_0xac4a('0x50')],null))[_0xac4a('0x1d')](respondWithResult(_0x108f7c,null))[_0xac4a('0x25')](handleError(_0x108f7c,null));};exports[_0xac4a('0x30')]=function(_0x2ac1e9,_0x213df2){return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x2ac1e9[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x213df2,null))[_0xac4a('0x1d')](removeEntity(_0x213df2,null))[_0xac4a('0x25')](handleError(_0x213df2,null));};exports[_0xac4a('0x53')]=function(_0x5222f3,_0x11c753,_0x492aae){var _0x13a577={};var _0x479ebc={};var _0x2d598e;var _0x4b7f79;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x5222f3[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11c753,null))['then'](function(_0x52c957){if(_0x52c957){_0x2d598e=_0x52c957;_0x479ebc[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x54')][_0xac4a('0x4d')]);_0x479ebc[_0xac4a('0x3a')]=_['keys'](_0x5222f3[_0xac4a('0x3a')]);_0x479ebc['filters']=_[_0xac4a('0x3c')](_0x479ebc['model'],_0x479ebc[_0xac4a('0x3a')]);_0x13a577[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x479ebc[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x13a577[_0xac4a('0x3b')]=_0x13a577[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x13a577[_0xac4a('0x3b')]:_0x479ebc[_0xac4a('0x38')];_0x13a577[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x40')]);_0x13a577[_0xac4a('0x41')]=qs['filters'](_[_0xac4a('0x43')](_0x5222f3[_0xac4a('0x3a')],_0x479ebc['filters']));if(_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x13a577[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x13a577[_0xac4a('0x41')],{'$or':_['map'](_0x13a577['attributes'],function(_0x45f3c3){var _0x11bb54={};_0x11bb54[_0x45f3c3]={'$like':'%'+_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x11bb54;})});}_0x13a577=_[_0xac4a('0x45')]({},_0x13a577,_0x5222f3[_0xac4a('0x48')]);return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0x44c60b){if(_0x44c60b){_0x4b7f79=_0x44c60b[_0xac4a('0x3e')];if(!_0x5222f3[_0xac4a('0x3a')]['hasOwnProperty']('nolimit')){_0x13a577[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x13a577[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0xb09b89){if(_0xb09b89){return _0xb09b89?{'count':_0x4b7f79,'rows':_0xb09b89}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x11c753,null))['catch'](handleError(_0x11c753,null));};exports[_0xac4a('0x55')]=function(_0xc74ce8,_0x26bd31,_0x231932){var _0x513976={};var _0xc61e94={};var _0x5a30af;var _0xab4305;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0xc74ce8['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x26bd31,null))[_0xac4a('0x1d')](function(_0x13097f){if(_0x13097f){_0x5a30af=_0x13097f;_0xc61e94['model']=_[_0xac4a('0x39')](db['ZendeskField'][_0xac4a('0x4d')]);_0xc61e94['query']=_['keys'](_0xc74ce8[_0xac4a('0x3a')]);_0xc61e94['filters']=_[_0xac4a('0x3c')](_0xc61e94['model'],_0xc61e94[_0xac4a('0x3a')]);_0x513976[_0xac4a('0x3b')]=_['intersection'](_0xc61e94[_0xac4a('0x38')],qs['fields'](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x513976['attributes']=_0x513976[_0xac4a('0x3b')]['length']?_0x513976['attributes']:_0xc61e94[_0xac4a('0x38')];_0x513976['order']=qs[_0xac4a('0x40')](_0xc74ce8['query']['sort']);_0x513976[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0xc74ce8['query'],_0xc61e94['filters']));if(_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x513976['where']=_['merge'](_0x513976[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x513976[_0xac4a('0x3b')],function(_0x36df3d){var _0x1810f7={};_0x1810f7[_0x36df3d]={'$like':'%'+_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x1810f7;})});}_0x513976=_[_0xac4a('0x45')]({},_0x513976,_0xc74ce8[_0xac4a('0x48')]);return _0x5a30af['getSubjects'](_0x513976);}})[_0xac4a('0x1d')](function(_0x440dc4){if(_0x440dc4){_0xab4305=_0x440dc4[_0xac4a('0x3e')];if(!_0xc74ce8['query'][_0xac4a('0x56')](_0xac4a('0x57'))){_0x513976[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0xc74ce8[_0xac4a('0x3a')]['limit']);_0x513976[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x5a30af[_0xac4a('0x55')](_0x513976);}})[_0xac4a('0x1d')](function(_0xd7bdd6){if(_0xd7bdd6){return _0xd7bdd6?{'count':_0xab4305,'rows':_0xd7bdd6}:null;}})['then'](respondWithResult(_0x26bd31,null))[_0xac4a('0x25')](handleError(_0x26bd31,null));};exports[_0xac4a('0x58')]=function(_0x19bd6f,_0x35a97c,_0x1bb24d){var _0x171c47={};var _0x547eec={};var _0x318bee;var _0x29c772;return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x19bd6f['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x35a97c,null))['then'](function(_0x4447b5){if(_0x4447b5){_0x318bee=_0x4447b5;_0x547eec[_0xac4a('0x38')]=_['keys'](db['ZendeskField'][_0xac4a('0x4d')]);_0x547eec[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x19bd6f['query']);_0x547eec[_0xac4a('0x42')]=_['intersection'](_0x547eec[_0xac4a('0x38')],_0x547eec[_0xac4a('0x3a')]);_0x171c47[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x547eec[_0xac4a('0x38')],qs['fields'](_0x19bd6f['query'][_0xac4a('0x3d')]));_0x171c47[_0xac4a('0x3b')]=_0x171c47[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x171c47[_0xac4a('0x3b')]:_0x547eec[_0xac4a('0x38')];_0x171c47[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x19bd6f['query']['sort']);_0x171c47[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x19bd6f[_0xac4a('0x3a')],_0x547eec[_0xac4a('0x42')]));if(_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x171c47[_0xac4a('0x41')]=_['merge'](_0x171c47['where'],{'$or':_[_0xac4a('0x34')](_0x171c47[_0xac4a('0x3b')],function(_0x22804e){var _0x371e06={};_0x371e06[_0x22804e]={'$like':'%'+_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x371e06;})});}_0x171c47=_[_0xac4a('0x45')]({},_0x171c47,_0x19bd6f['options']);return _0x318bee[_0xac4a('0x58')](_0x171c47);}})[_0xac4a('0x1d')](function(_0x3439f3){if(_0x3439f3){_0x29c772=_0x3439f3['length'];if(!_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x56')](_0xac4a('0x57'))){_0x171c47[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x171c47[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x19bd6f['query'][_0xac4a('0x2a')]);}return _0x318bee['getDescriptions'](_0x171c47);}})[_0xac4a('0x1d')](function(_0x1199f6){if(_0x1199f6){return _0x1199f6?{'count':_0x29c772,'rows':_0x1199f6}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x35a97c,null))[_0xac4a('0x25')](handleError(_0x35a97c,null));};exports[_0xac4a('0x5a')]=function(_0x337da7,_0x19766a,_0x5266d3){var _0x2b883a={};var _0x42b3f7={};var _0x279f9b;var _0x3315e7;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x337da7[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x19766a,null))['then'](function(_0x55af32){if(_0x55af32){_0x279f9b=_0x55af32;_0x42b3f7[_0xac4a('0x38')]=_[_0xac4a('0x39')](db['Tag'][_0xac4a('0x4d')]);_0x42b3f7[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x337da7[_0xac4a('0x3a')]);_0x42b3f7[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],_0x42b3f7[_0xac4a('0x3a')]);_0x2b883a[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],qs[_0xac4a('0x3d')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x2b883a[_0xac4a('0x3b')]=_0x2b883a[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x2b883a['attributes']:_0x42b3f7[_0xac4a('0x38')];_0x2b883a[_0xac4a('0x3f')]=qs['sort'](_0x337da7[_0xac4a('0x3a')]['sort']);_0x2b883a[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_['pick'](_0x337da7[_0xac4a('0x3a')],_0x42b3f7['filters']));if(_0x337da7[_0xac4a('0x3a')]['filter']){_0x2b883a[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x2b883a[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x2b883a[_0xac4a('0x3b')],function(_0x36d8ff){var _0x7e403a={};_0x7e403a[_0x36d8ff]={'$like':'%'+_0x337da7[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x7e403a;})});}_0x2b883a=_[_0xac4a('0x45')]({},_0x2b883a,_0x337da7[_0xac4a('0x48')]);return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x4217df){if(_0x4217df){_0x3315e7=_0x4217df['length'];if(!_0x337da7[_0xac4a('0x3a')][_0xac4a('0x56')]('nolimit')){_0x2b883a[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x2b883a[_0xac4a('0x2a')]=qs['offset'](_0x337da7[_0xac4a('0x3a')]['offset']);}return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x240ff1){if(_0x240ff1){return _0x240ff1?{'count':_0x3315e7,'rows':_0x240ff1}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x19766a,null))['catch'](handleError(_0x19766a,null));};exports[_0xac4a('0x5b')]=function(_0x55866d,_0x277fd1,_0x40d363){if(_0x55866d[_0xac4a('0x50')]['id']){delete _0x55866d['body']['id'];}return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x55866d[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x277fd1,null))[_0xac4a('0x1d')](function(_0x25639a){if(_0x25639a){return _0x25639a[_0xac4a('0x5b')](_0x55866d[_0xac4a('0x50')][_0xac4a('0x5c')]||[]);}return null;})[_0xac4a('0x1d')](respondWithResult(_0x277fd1,null))[_0xac4a('0x25')](handleError(_0x277fd1,null));}; \ No newline at end of file +var _0x326f=['VIRTUAL','filter','ZendeskConfiguration','count','includeAll','include','findAll','rows','show','params','options','find','create','body','destroy','getFields','findOne','hasOwnProperty','getSubjects','ZendeskField','getDescriptions','Tag','getTags','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','client','http','test','ValidationError','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','save','update','name','map','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge'];(function(_0x3ab89c,_0x3d6b04){var _0x141ec6=function(_0x47e338){while(--_0x47e338){_0x3ab89c['push'](_0x3ab89c['shift']());}};_0x141ec6(++_0x3d6b04);}(_0x326f,0xd1));var _0xf326=function(_0x403802,_0x17b771){_0x403802=_0x403802-0x0;var _0x20cb3a=_0x326f[_0x403802];return _0x20cb3a;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xf326('0x17')][_0xf326('0x18')]({'port':0x232a});function checkPasswordPattern(_0x4b3966,_0x342fe5,_0x472632){if(_0x472632){var _0x3504eb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3504eb[_0xf326('0x19')](_0x342fe5)){return _0x4b3966;}else{throw new db['Sequelize'][(_0xf326('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b3966;}}function respondWithRpcPromise(_0x54bd1a,_0xdf21d9,_0x11f6d2,_0x1f2e5a){return new BPromise(function(_0xa63d1a,_0x292f4b){var _0x287a2a=_0x1f2e5a||client;return _0x287a2a[_0xf326('0x1b')](_0x54bd1a,_0x11f6d2)[_0xf326('0x1c')](function(_0x5a682a){logger[_0xf326('0x1d')](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));logger[_0xf326('0x20')](_0xf326('0x21'),_0xdf21d9,_0xf326('0x1f'),JSON['stringify'](_0x5a682a));if(_0x5a682a['error']){if(_0x5a682a['error'][_0xf326('0x22')]===0x1f4){logger[_0xf326('0x23')]('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x5a682a['error'][_0xf326('0x24')]);return _0x292f4b(_0x5a682a['error']['message']);}logger[_0xf326('0x23')](_0xf326('0x1e'),_0xdf21d9,_0x5a682a['error']['message']);return _0xa63d1a(_0x5a682a[_0xf326('0x23')][_0xf326('0x24')]);}else{logger['info'](_0xf326('0x1e'),_0xdf21d9,_0xf326('0x1f'));_0xa63d1a(_0x5a682a[_0xf326('0x25')][_0xf326('0x24')]);}})[_0xf326('0x26')](function(_0x2049ec){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0xdf21d9,_0x2049ec);_0x292f4b(_0x2049ec);});});}function respondWithStatusCode(_0x4f31f6,_0x520d85){_0x520d85=_0x520d85||0xcc;return function(_0x1a2c4e){if(_0x1a2c4e){return _0x4f31f6[_0xf326('0x27')](_0x520d85);}return _0x4f31f6[_0xf326('0x28')](_0x520d85)[_0xf326('0x29')]();};}function respondWithResult(_0x410237,_0x5217d4){_0x5217d4=_0x5217d4||0xc8;return function(_0x201d28){if(_0x201d28){return _0x410237[_0xf326('0x28')](_0x5217d4)[_0xf326('0x2a')](_0x201d28);}};}function respondWithFilteredResult(_0x581531,_0x1617d2){return function(_0x55ad0f){if(_0x55ad0f){var _0x4a9abf=_0x55ad0f['count'],_0x6a8e89=_0x1617d2[_0xf326('0x2b')],_0x1ae23a=_0x1617d2[_0xf326('0x2b')]+_0x1617d2['limit'],_0x2fa28e;if(_0x1ae23a>=_0x4a9abf){_0x1ae23a=_0x4a9abf;_0x2fa28e=0xc8;}else{_0x2fa28e=0xce;}_0x581531[_0xf326('0x28')](_0x2fa28e);return _0x581531[_0xf326('0x2c')](_0xf326('0x2d'),_0x6a8e89+'-'+_0x1ae23a+'/'+_0x4a9abf)[_0xf326('0x2a')](_0x55ad0f);}return null;};}function patchUpdates(_0xa80156){return function(_0x269be9){try{jsonpatch[_0xf326('0x2e')](_0x269be9,_0xa80156,!![]);}catch(_0x39a1e2){return BPromise[_0xf326('0x2f')](_0x39a1e2);}return _0x269be9[_0xf326('0x30')]();};}function saveUpdates(_0x4b52f2,_0x1035ed){return function(_0x424104){if(_0x424104){return _0x424104[_0xf326('0x31')](_0x4b52f2)['then'](function(_0x2c0cac){return _0x2c0cac;});}return null;};}function removeEntity(_0x1721fd,_0x303dc6){return function(_0x4df451){if(_0x4df451){return _0x4df451['destroy']()[_0xf326('0x1c')](function(){_0x1721fd[_0xf326('0x28')](0xcc)[_0xf326('0x29')]();});}};}function handleEntityNotFound(_0xf53cf3,_0x30694f){return function(_0x2e8a64){if(!_0x2e8a64){_0xf53cf3[_0xf326('0x27')](0x194);}return _0x2e8a64;};}function handleError(_0x2d5f20,_0x580374){_0x580374=_0x580374||0x1f4;return function(_0x461e93){logger[_0xf326('0x23')](_0x461e93['stack']);if(_0x461e93[_0xf326('0x32')]){delete _0x461e93['name'];}_0x2d5f20[_0xf326('0x28')](_0x580374)['send'](_0x461e93);};}exports['index']=function(_0xadb020,_0x4d8eac){var _0x40dcb4={},_0x57aa27={},_0x310dbb={'count':0x0,'rows':[]};var _0x409260=_[_0xf326('0x33')](db['ZendeskConfiguration'][_0xf326('0x34')],function(_0x4095e6){return{'name':_0x4095e6['fieldName'],'type':_0x4095e6[_0xf326('0x35')][_0xf326('0x36')]};});_0x57aa27[_0xf326('0x37')]=_[_0xf326('0x33')](_0x409260,'name');_0x57aa27[_0xf326('0x38')]=_[_0xf326('0x39')](_0xadb020[_0xf326('0x38')]);_0x57aa27[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x57aa27['model'],_0x57aa27[_0xf326('0x38')]);_0x40dcb4[_0xf326('0x3c')]=_['intersection'](_0x57aa27['model'],qs[_0xf326('0x3d')](_0xadb020['query']['fields']));_0x40dcb4[_0xf326('0x3c')]=_0x40dcb4['attributes'][_0xf326('0x3e')]?_0x40dcb4[_0xf326('0x3c')]:_0x57aa27[_0xf326('0x37')];if(!_0xadb020[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x40dcb4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0xadb020[_0xf326('0x38')][_0xf326('0x40')]);_0x40dcb4[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0xadb020[_0xf326('0x38')][_0xf326('0x2b')]);}_0x40dcb4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0xadb020[_0xf326('0x38')]['sort']);_0x40dcb4[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0xadb020[_0xf326('0x38')],_0x57aa27[_0xf326('0x3a')]));if(_0xadb020[_0xf326('0x38')]['filter']){_0x40dcb4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x40dcb4['where'],{'$or':_[_0xf326('0x33')](_0x409260,function(_0x819bf6){if(_0x819bf6[_0xf326('0x35')]!==_0xf326('0x46')){var _0x427c34={};_0x427c34[_0x819bf6['name']]={'$like':'%'+_0xadb020['query'][_0xf326('0x47')]+'%'};return _0x427c34;}})});}_0x40dcb4=_[_0xf326('0x45')]({},_0x40dcb4,_0xadb020['options']);var _0x4bd865={'where':_0x40dcb4[_0xf326('0x43')]};return db[_0xf326('0x48')][_0xf326('0x49')](_0x4bd865)['then'](function(_0x301e65){_0x310dbb[_0xf326('0x49')]=_0x301e65;if(_0xadb020[_0xf326('0x38')][_0xf326('0x4a')]){_0x40dcb4[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x48')][_0xf326('0x4c')](_0x40dcb4);})[_0xf326('0x1c')](function(_0x3df9a8){_0x310dbb[_0xf326('0x4d')]=_0x3df9a8;return _0x310dbb;})[_0xf326('0x1c')](respondWithFilteredResult(_0x4d8eac,_0x40dcb4))[_0xf326('0x26')](handleError(_0x4d8eac,null));};exports[_0xf326('0x4e')]=function(_0x395b1e,_0xeac1a1){var _0x59f9a7={'raw':![],'where':{'id':_0x395b1e[_0xf326('0x4f')]['id']}},_0x199f8b={};_0x199f8b[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskConfiguration'][_0xf326('0x34')]);_0x199f8b[_0xf326('0x38')]=_[_0xf326('0x39')](_0x395b1e[_0xf326('0x38')]);_0x199f8b['filters']=_[_0xf326('0x3b')](_0x199f8b[_0xf326('0x37')],_0x199f8b[_0xf326('0x38')]);_0x59f9a7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x199f8b['model'],qs['fields'](_0x395b1e[_0xf326('0x38')][_0xf326('0x3d')]));_0x59f9a7[_0xf326('0x3c')]=_0x59f9a7['attributes'][_0xf326('0x3e')]?_0x59f9a7[_0xf326('0x3c')]:_0x199f8b[_0xf326('0x37')];if(_0x395b1e['query']['includeAll']){_0x59f9a7[_0xf326('0x4b')]=[{'all':!![]}];}_0x59f9a7=_['merge']({},_0x59f9a7,_0x395b1e[_0xf326('0x50')]);return db['ZendeskConfiguration'][_0xf326('0x51')](_0x59f9a7)[_0xf326('0x1c')](handleEntityNotFound(_0xeac1a1,null))[_0xf326('0x1c')](respondWithResult(_0xeac1a1,null))[_0xf326('0x26')](handleError(_0xeac1a1,null));};exports[_0xf326('0x52')]=function(_0x35d3c8,_0x7f7ece){return db['ZendeskConfiguration'][_0xf326('0x52')](_0x35d3c8[_0xf326('0x53')],{})[_0xf326('0x1c')](respondWithResult(_0x7f7ece,0xc9))['catch'](handleError(_0x7f7ece,null));};exports[_0xf326('0x31')]=function(_0x3a832f,_0x3b8635){if(_0x3a832f[_0xf326('0x53')]['id']){delete _0x3a832f[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x3a832f[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x3b8635,null))[_0xf326('0x1c')](saveUpdates(_0x3a832f['body'],null))[_0xf326('0x1c')](respondWithResult(_0x3b8635,null))[_0xf326('0x26')](handleError(_0x3b8635,null));};exports[_0xf326('0x54')]=function(_0x29e52e,_0x4d3b9e){return db['ZendeskConfiguration'][_0xf326('0x51')]({'where':{'id':_0x29e52e[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4d3b9e,null))[_0xf326('0x1c')](removeEntity(_0x4d3b9e,null))[_0xf326('0x26')](handleError(_0x4d3b9e,null));};exports[_0xf326('0x55')]=function(_0x1258d1,_0x5765b0,_0xb1c18c){var _0x5657b7={};var _0x5dbeb9={};var _0x9d84c3;var _0x51d466;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x1258d1[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x5765b0,null))['then'](function(_0x1fd9c9){if(_0x1fd9c9){_0x9d84c3=_0x1fd9c9;_0x5dbeb9[_0xf326('0x37')]=_[_0xf326('0x39')](db['ZendeskField'][_0xf326('0x34')]);_0x5dbeb9['query']=_[_0xf326('0x39')](_0x1258d1[_0xf326('0x38')]);_0x5dbeb9[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],_0x5dbeb9[_0xf326('0x38')]);_0x5657b7[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x5dbeb9[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x1258d1[_0xf326('0x38')][_0xf326('0x3d')]));_0x5657b7[_0xf326('0x3c')]=_0x5657b7['attributes'][_0xf326('0x3e')]?_0x5657b7['attributes']:_0x5dbeb9[_0xf326('0x37')];_0x5657b7[_0xf326('0x41')]=qs['sort'](_0x1258d1[_0xf326('0x38')]['sort']);_0x5657b7[_0xf326('0x43')]=qs[_0xf326('0x3a')](_[_0xf326('0x44')](_0x1258d1[_0xf326('0x38')],_0x5dbeb9[_0xf326('0x3a')]));if(_0x1258d1['query']['filter']){_0x5657b7[_0xf326('0x43')]=_[_0xf326('0x45')](_0x5657b7[_0xf326('0x43')],{'$or':_[_0xf326('0x33')](_0x5657b7[_0xf326('0x3c')],function(_0x579d2c){var _0x28c4f2={};_0x28c4f2[_0x579d2c]={'$like':'%'+_0x1258d1[_0xf326('0x38')]['filter']+'%'};return _0x28c4f2;})});}_0x5657b7=_['merge']({},_0x5657b7,_0x1258d1['options']);return _0x9d84c3[_0xf326('0x55')](_0x5657b7);}})[_0xf326('0x1c')](function(_0x4150fa){if(_0x4150fa){_0x51d466=_0x4150fa[_0xf326('0x3e')];if(!_0x1258d1[_0xf326('0x38')][_0xf326('0x57')](_0xf326('0x3f'))){_0x5657b7['limit']=qs[_0xf326('0x40')](_0x1258d1[_0xf326('0x38')][_0xf326('0x40')]);_0x5657b7[_0xf326('0x2b')]=qs['offset'](_0x1258d1[_0xf326('0x38')]['offset']);}return _0x9d84c3['getFields'](_0x5657b7);}})[_0xf326('0x1c')](function(_0x540fa0){if(_0x540fa0){return _0x540fa0?{'count':_0x51d466,'rows':_0x540fa0}:null;}})[_0xf326('0x1c')](respondWithResult(_0x5765b0,null))[_0xf326('0x26')](handleError(_0x5765b0,null));};exports[_0xf326('0x58')]=function(_0x2ea5a2,_0x17cd36,_0x541491){var _0x4a053c={};var _0x48d84a={};var _0xeeea57;var _0x307441;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2ea5a2[_0xf326('0x4f')]['id']}})['then'](handleEntityNotFound(_0x17cd36,null))[_0xf326('0x1c')](function(_0x372dc8){if(_0x372dc8){_0xeeea57=_0x372dc8;_0x48d84a[_0xf326('0x37')]=_['keys'](db['ZendeskField'][_0xf326('0x34')]);_0x48d84a[_0xf326('0x38')]=_['keys'](_0x2ea5a2['query']);_0x48d84a[_0xf326('0x3a')]=_['intersection'](_0x48d84a[_0xf326('0x37')],_0x48d84a['query']);_0x4a053c['attributes']=_['intersection'](_0x48d84a[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2ea5a2[_0xf326('0x38')]['fields']));_0x4a053c[_0xf326('0x3c')]=_0x4a053c[_0xf326('0x3c')][_0xf326('0x3e')]?_0x4a053c[_0xf326('0x3c')]:_0x48d84a[_0xf326('0x37')];_0x4a053c[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x42')]);_0x4a053c['where']=qs[_0xf326('0x3a')](_['pick'](_0x2ea5a2[_0xf326('0x38')],_0x48d84a[_0xf326('0x3a')]));if(_0x2ea5a2[_0xf326('0x38')]['filter']){_0x4a053c[_0xf326('0x43')]=_[_0xf326('0x45')](_0x4a053c[_0xf326('0x43')],{'$or':_['map'](_0x4a053c[_0xf326('0x3c')],function(_0x4057e1){var _0x3bbe4c={};_0x3bbe4c[_0x4057e1]={'$like':'%'+_0x2ea5a2[_0xf326('0x38')]['filter']+'%'};return _0x3bbe4c;})});}_0x4a053c=_[_0xf326('0x45')]({},_0x4a053c,_0x2ea5a2['options']);return _0xeeea57['getSubjects'](_0x4a053c);}})[_0xf326('0x1c')](function(_0x2c36d3){if(_0x2c36d3){_0x307441=_0x2c36d3['length'];if(!_0x2ea5a2['query']['hasOwnProperty'](_0xf326('0x3f'))){_0x4a053c['limit']=qs[_0xf326('0x40')](_0x2ea5a2[_0xf326('0x38')][_0xf326('0x40')]);_0x4a053c[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x2ea5a2[_0xf326('0x38')]['offset']);}return _0xeeea57[_0xf326('0x58')](_0x4a053c);}})[_0xf326('0x1c')](function(_0x5f1724){if(_0x5f1724){return _0x5f1724?{'count':_0x307441,'rows':_0x5f1724}:null;}})['then'](respondWithResult(_0x17cd36,null))[_0xf326('0x26')](handleError(_0x17cd36,null));};exports['getDescriptions']=function(_0x35a7c9,_0x147d51,_0x153027){var _0x363e64={};var _0x19d676={};var _0x6e662;var _0x293600;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x35a7c9['params']['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x147d51,null))[_0xf326('0x1c')](function(_0x4ac90e){if(_0x4ac90e){_0x6e662=_0x4ac90e;_0x19d676[_0xf326('0x37')]=_['keys'](db[_0xf326('0x59')][_0xf326('0x34')]);_0x19d676[_0xf326('0x38')]=_['keys'](_0x35a7c9[_0xf326('0x38')]);_0x19d676[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],_0x19d676[_0xf326('0x38')]);_0x363e64[_0xf326('0x3c')]=_[_0xf326('0x3b')](_0x19d676[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x3d')]));_0x363e64[_0xf326('0x3c')]=_0x363e64[_0xf326('0x3c')][_0xf326('0x3e')]?_0x363e64[_0xf326('0x3c')]:_0x19d676['model'];_0x363e64[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x35a7c9['query'][_0xf326('0x42')]);_0x363e64[_0xf326('0x43')]=qs['filters'](_[_0xf326('0x44')](_0x35a7c9[_0xf326('0x38')],_0x19d676[_0xf326('0x3a')]));if(_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]){_0x363e64[_0xf326('0x43')]=_[_0xf326('0x45')](_0x363e64['where'],{'$or':_[_0xf326('0x33')](_0x363e64[_0xf326('0x3c')],function(_0x323fb1){var _0x3c33d1={};_0x3c33d1[_0x323fb1]={'$like':'%'+_0x35a7c9[_0xf326('0x38')][_0xf326('0x47')]+'%'};return _0x3c33d1;})});}_0x363e64=_[_0xf326('0x45')]({},_0x363e64,_0x35a7c9[_0xf326('0x50')]);return _0x6e662['getDescriptions'](_0x363e64);}})[_0xf326('0x1c')](function(_0x2e2103){if(_0x2e2103){_0x293600=_0x2e2103['length'];if(!_0x35a7c9[_0xf326('0x38')]['hasOwnProperty'](_0xf326('0x3f'))){_0x363e64[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x40')]);_0x363e64[_0xf326('0x2b')]=qs[_0xf326('0x2b')](_0x35a7c9[_0xf326('0x38')][_0xf326('0x2b')]);}return _0x6e662[_0xf326('0x5a')](_0x363e64);}})[_0xf326('0x1c')](function(_0x3face2){if(_0x3face2){return _0x3face2?{'count':_0x293600,'rows':_0x3face2}:null;}})[_0xf326('0x1c')](respondWithResult(_0x147d51,null))[_0xf326('0x26')](handleError(_0x147d51,null));};exports['getTags']=function(_0x2bb6f0,_0xdb6e40,_0x27c569){var _0x3d3bd4={};var _0xdb2ad8={};var _0x550f34;var _0x1ec128;return db[_0xf326('0x48')][_0xf326('0x56')]({'where':{'id':_0x2bb6f0[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0xdb6e40,null))['then'](function(_0x4b6ec0){if(_0x4b6ec0){_0x550f34=_0x4b6ec0;_0xdb2ad8[_0xf326('0x37')]=_['keys'](db[_0xf326('0x5b')][_0xf326('0x34')]);_0xdb2ad8[_0xf326('0x38')]=_['keys'](_0x2bb6f0['query']);_0xdb2ad8[_0xf326('0x3a')]=_[_0xf326('0x3b')](_0xdb2ad8[_0xf326('0x37')],_0xdb2ad8[_0xf326('0x38')]);_0x3d3bd4[_0xf326('0x3c')]=_['intersection'](_0xdb2ad8[_0xf326('0x37')],qs[_0xf326('0x3d')](_0x2bb6f0[_0xf326('0x38')]['fields']));_0x3d3bd4['attributes']=_0x3d3bd4['attributes'][_0xf326('0x3e')]?_0x3d3bd4[_0xf326('0x3c')]:_0xdb2ad8[_0xf326('0x37')];_0x3d3bd4[_0xf326('0x41')]=qs[_0xf326('0x42')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x42')]);_0x3d3bd4['where']=qs['filters'](_[_0xf326('0x44')](_0x2bb6f0[_0xf326('0x38')],_0xdb2ad8[_0xf326('0x3a')]));if(_0x2bb6f0['query'][_0xf326('0x47')]){_0x3d3bd4[_0xf326('0x43')]=_[_0xf326('0x45')](_0x3d3bd4['where'],{'$or':_[_0xf326('0x33')](_0x3d3bd4[_0xf326('0x3c')],function(_0x267bae){var _0x3d728a={};_0x3d728a[_0x267bae]={'$like':'%'+_0x2bb6f0['query']['filter']+'%'};return _0x3d728a;})});}_0x3d3bd4=_['merge']({},_0x3d3bd4,_0x2bb6f0[_0xf326('0x50')]);return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0x5f0b45){if(_0x5f0b45){_0x1ec128=_0x5f0b45[_0xf326('0x3e')];if(!_0x2bb6f0[_0xf326('0x38')][_0xf326('0x57')]('nolimit')){_0x3d3bd4[_0xf326('0x40')]=qs[_0xf326('0x40')](_0x2bb6f0[_0xf326('0x38')][_0xf326('0x40')]);_0x3d3bd4['offset']=qs[_0xf326('0x2b')](_0x2bb6f0['query'][_0xf326('0x2b')]);}return _0x550f34[_0xf326('0x5c')](_0x3d3bd4);}})[_0xf326('0x1c')](function(_0xd45708){if(_0xd45708){return _0xd45708?{'count':_0x1ec128,'rows':_0xd45708}:null;}})['then'](respondWithResult(_0xdb6e40,null))[_0xf326('0x26')](handleError(_0xdb6e40,null));};exports['setTags']=function(_0x499316,_0x1ec34d,_0x1d6962){if(_0x499316[_0xf326('0x53')]['id']){delete _0x499316[_0xf326('0x53')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x499316[_0xf326('0x4f')]['id']}})[_0xf326('0x1c')](handleEntityNotFound(_0x1ec34d,null))[_0xf326('0x1c')](function(_0xc67315){if(_0xc67315){return _0xc67315['setTags'](_0x499316[_0xf326('0x53')]['ids']||[]);}return null;})[_0xf326('0x1c')](respondWithResult(_0x1ec34d,null))[_0xf326('0x26')](handleError(_0x1ec34d,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index e57b8b5..461349b 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 _0x2288=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x4d829d,_0x583866){var _0x292c64=function(_0x208ec5){while(--_0x208ec5){_0x4d829d['push'](_0x4d829d['shift']());}};_0x292c64(++_0x583866);}(_0x2288,0xe4));var _0x8228=function(_0x4c46d6,_0x284f02){_0x4c46d6=_0x4c46d6-0x0;var _0x1d7f86=_0x2288[_0x4c46d6];return _0x1d7f86;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x8228('0x0'))(_0x8228('0x1'));var moment=require(_0x8228('0x2'));var BPromise=require('bluebird');var rp=require(_0x8228('0x3'));var fs=require('fs');var path=require(_0x8228('0x4'));var rimraf=require(_0x8228('0x5'));var config=require(_0x8228('0x6'));var attributes=require(_0x8228('0x7'));module[_0x8228('0x8')]=function(_0xb13d5e,_0x5e5dae){return _0xb13d5e[_0x8228('0x9')](_0x8228('0xa'),attributes,{'tableName':_0x8228('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xcc24=['int_zendesk_configurations','lodash','util','bluebird','path','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration'];(function(_0x64c483,_0x2c6ad8){var _0x2f78c6=function(_0x115c1b){while(--_0x115c1b){_0x64c483['push'](_0x64c483['shift']());}};_0x2f78c6(++_0x2c6ad8);}(_0xcc24,0x1e1));var _0x4cc2=function(_0x2e7bd6,_0x275f1d){_0x2e7bd6=_0x2e7bd6-0x0;var _0x35e8b7=_0xcc24[_0x2e7bd6];return _0x35e8b7;};'use strict';var _=require(_0x4cc2('0x0'));var util=require(_0x4cc2('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4cc2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4cc2('0x3'));var rimraf=require('rimraf');var config=require(_0x4cc2('0x4'));var attributes=require(_0x4cc2('0x5'));module[_0x4cc2('0x6')]=function(_0x82c9af,_0x35a80a){return _0x82c9af[_0x4cc2('0x7')](_0x4cc2('0x8'),attributes,{'tableName':_0x4cc2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.rpc.js index 217f542..ff3387a 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 _0xfeda=['rpc','../../config/environment','jayson/promise','client','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2c26e8,_0x392265){var _0x25d356=function(_0x3a3a8e){while(--_0x3a3a8e){_0x2c26e8['push'](_0x2c26e8['shift']());}};_0x25d356(++_0x392265);}(_0xfeda,0x88));var _0xafed=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0xfeda[_0x13e741];return _0x3f8bb3;};'use strict';var _=require(_0xafed('0x0'));var util=require('util');var moment=require(_0xafed('0x1'));var BPromise=require(_0xafed('0x2'));var rs=require(_0xafed('0x3'));var fs=require('fs');var Redis=require(_0xafed('0x4'));var db=require(_0xafed('0x5'))['db'];var utils=require(_0xafed('0x6'));var logger=require(_0xafed('0x7'))(_0xafed('0x8'));var config=require(_0xafed('0x9'));var jayson=require(_0xafed('0xa'));var client=jayson[_0xafed('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x137d20,_0x574a62,_0x29589f){return new BPromise(function(_0x5a33d1,_0xaec08e){return client['request'](_0x137d20,_0x29589f)[_0xafed('0xc')](function(_0x612efe){logger[_0xafed('0xd')](_0xafed('0xe'),_0x574a62,_0xafed('0xf'));logger[_0xafed('0x10')](_0xafed('0x11'),_0x574a62,_0xafed('0xf'),JSON[_0xafed('0x12')](_0x612efe));if(_0x612efe['error']){if(_0x612efe['error'][_0xafed('0x13')]===0x1f4){logger['error'](_0xafed('0xe'),_0x574a62,_0x612efe['error'][_0xafed('0x14')]);return _0xaec08e(_0x612efe['error'][_0xafed('0x14')]);}logger[_0xafed('0x15')](_0xafed('0xe'),_0x574a62,_0x612efe[_0xafed('0x15')][_0xafed('0x14')]);return _0x5a33d1(_0x612efe[_0xafed('0x15')]['message']);}else{logger['info']('ZendeskConfiguration,\x20%s,\x20%s',_0x574a62,'request\x20sent');_0x5a33d1(_0x612efe[_0xafed('0x16')][_0xafed('0x14')]);}})[_0xafed('0x17')](function(_0x1a9969){logger[_0xafed('0x15')]('ZendeskConfiguration,\x20%s,\x20%s',_0x574a62,_0x1a9969);_0xaec08e(_0x1a9969);});});} \ No newline at end of file +var _0x42ff=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42ff,0x194));var _0xf42f=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x42ff[_0x49b207];return _0x2dc8fa;};'use strict';var _=require('lodash');var util=require(_0xf42f('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf42f('0x1'));var db=require(_0xf42f('0x2'))['db'];var utils=require(_0xf42f('0x3'));var logger=require(_0xf42f('0x4'))(_0xf42f('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xf42f('0x6')][_0xf42f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15b027,_0x1eb6ab,_0x373e67){return new BPromise(function(_0x4c33c7,_0x3f9fd6){return client['request'](_0x15b027,_0x373e67)['then'](function(_0x18772e){logger[_0xf42f('0x8')](_0xf42f('0x9'),_0x1eb6ab,_0xf42f('0xa'));logger[_0xf42f('0xb')](_0xf42f('0xc'),_0x1eb6ab,_0xf42f('0xa'),JSON['stringify'](_0x18772e));if(_0x18772e[_0xf42f('0xd')]){if(_0x18772e[_0xf42f('0xd')][_0xf42f('0xe')]===0x1f4){logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1eb6ab,_0x18772e[_0xf42f('0xd')][_0xf42f('0xf')]);return _0x3f9fd6(_0x18772e[_0xf42f('0xd')]['message']);}logger['error']('ZendeskConfiguration,\x20%s,\x20%s',_0x1eb6ab,_0x18772e[_0xf42f('0xd')]['message']);return _0x4c33c7(_0x18772e[_0xf42f('0xd')][_0xf42f('0xf')]);}else{logger[_0xf42f('0x8')](_0xf42f('0x9'),_0x1eb6ab,_0xf42f('0xa'));_0x4c33c7(_0x18772e[_0xf42f('0x10')][_0xf42f('0xf')]);}})[_0xf42f('0x11')](function(_0x5aa672){logger['error'](_0xf42f('0x9'),_0x1eb6ab,_0x5aa672);_0x3f9fd6(_0x5aa672);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index 2944c14..b65693f 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 _0xd3a6=['destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','isAuthenticated','index','/:id','show','post','update','delete'];(function(_0x39f7d0,_0x53bf76){var _0x5a06c3=function(_0x18214b){while(--_0x18214b){_0x39f7d0['push'](_0x39f7d0['shift']());}};_0x5a06c3(++_0x53bf76);}(_0xd3a6,0x181));var _0x6d3a=function(_0x254358,_0xcd65b8){_0x254358=_0x254358-0x0;var _0x1f845a=_0xd3a6[_0x254358];return _0x1f845a;};'use strict';var multer=require(_0x6d3a('0x0'));var util=require('util');var path=require(_0x6d3a('0x1'));var timeout=require(_0x6d3a('0x2'));var express=require(_0x6d3a('0x3'));var router=express[_0x6d3a('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x6d3a('0x5'));var config=require(_0x6d3a('0x6'));var controller=require(_0x6d3a('0x7'));router['get']('/',auth[_0x6d3a('0x8')](),controller[_0x6d3a('0x9')]);router['get'](_0x6d3a('0xa'),auth[_0x6d3a('0x8')](),controller[_0x6d3a('0xb')]);router[_0x6d3a('0xc')]('/',auth[_0x6d3a('0x8')](),controller['create']);router['put']('/:id',auth[_0x6d3a('0x8')](),controller[_0x6d3a('0xd')]);router[_0x6d3a('0xe')](_0x6d3a('0xa'),auth[_0x6d3a('0x8')](),controller[_0x6d3a('0xf')]);module['exports']=router; \ No newline at end of file +var _0x8b04=['multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x431ae1,_0x385f06){var _0x27fcbd=function(_0x16e71f){while(--_0x16e71f){_0x431ae1['push'](_0x431ae1['shift']());}};_0x27fcbd(++_0x385f06);}(_0x8b04,0x130));var _0x48b0=function(_0x2e2b9e,_0x35c733){_0x2e2b9e=_0x2e2b9e-0x0;var _0x20589f=_0x8b04[_0x2e2b9e];return _0x20589f;};'use strict';var multer=require(_0x48b0('0x0'));var util=require(_0x48b0('0x1'));var path=require('path');var timeout=require(_0x48b0('0x2'));var express=require('express');var router=express[_0x48b0('0x3')]();var auth=require(_0x48b0('0x4'));var interaction=require(_0x48b0('0x5'));var config=require(_0x48b0('0x6'));var controller=require(_0x48b0('0x7'));router[_0x48b0('0x8')]('/',auth[_0x48b0('0x9')](),controller[_0x48b0('0xa')]);router[_0x48b0('0x8')](_0x48b0('0xb'),auth['isAuthenticated'](),controller[_0x48b0('0xc')]);router[_0x48b0('0xd')]('/',auth[_0x48b0('0x9')](),controller[_0x48b0('0xe')]);router[_0x48b0('0xf')](_0x48b0('0xb'),auth[_0x48b0('0x9')](),controller['update']);router[_0x48b0('0x10')](_0x48b0('0xb'),auth['isAuthenticated'](),controller[_0x48b0('0x11')]);module[_0x48b0('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 89e9ee1..254a19c 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 _0xb0bf=['string','STRING','ENUM','BOOLEAN','exports','variable'];(function(_0x75eee4,_0x5d6f80){var _0x8747dc=function(_0x43dc5e){while(--_0x43dc5e){_0x75eee4['push'](_0x75eee4['shift']());}};_0x8747dc(++_0x5d6f80);}(_0xb0bf,0xf4));var _0xfb0b=function(_0x43b99a,_0x327ce5){_0x43b99a=_0x43b99a-0x0;var _0x13085b=_0xb0bf[_0x43b99a];return _0x13085b;};'use strict';var Sequelize=require('sequelize');module[_0xfb0b('0x0')]={'type':{'type':Sequelize['ENUM']('string',_0xfb0b('0x1'),'customVariable','keyValue'),'defaultValue':_0xfb0b('0x2')},'content':{'type':Sequelize[_0xfb0b('0x3')]},'key':{'type':Sequelize[_0xfb0b('0x3')]},'keyType':{'type':Sequelize[_0xfb0b('0x4')](_0xfb0b('0x2'),_0xfb0b('0x1'),'customVariable')},'keyContent':{'type':Sequelize[_0xfb0b('0x3')]},'idField':{'type':Sequelize[_0xfb0b('0x3')]},'nameField':{'type':Sequelize[_0xfb0b('0x3')]},'customField':{'type':Sequelize[_0xfb0b('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xfb0b('0x3')]}}; \ No newline at end of file +var _0xb43b=['ENUM','string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize'];(function(_0x1337f7,_0x2d6dbd){var _0x4eca4b=function(_0x2211b0){while(--_0x2211b0){_0x1337f7['push'](_0x1337f7['shift']());}};_0x4eca4b(++_0x2d6dbd);}(_0xb43b,0xbf));var _0xbb43=function(_0x5ac867,_0x105170){_0x5ac867=_0x5ac867-0x0;var _0x361d2a=_0xb43b[_0x5ac867];return _0x361d2a;};'use strict';var Sequelize=require(_0xbb43('0x0'));module['exports']={'type':{'type':Sequelize[_0xbb43('0x1')](_0xbb43('0x2'),_0xbb43('0x3'),_0xbb43('0x4'),_0xbb43('0x5')),'defaultValue':_0xbb43('0x2')},'content':{'type':Sequelize[_0xbb43('0x6')]},'key':{'type':Sequelize[_0xbb43('0x6')]},'keyType':{'type':Sequelize[_0xbb43('0x1')](_0xbb43('0x2'),_0xbb43('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0xbb43('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xbb43('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xbb43('0x6')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index de8084c..54a2cf7 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 _0x6630=['hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','findAll','rows','catch','intersection','length','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','name','send','map','ZendeskField','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','fields'];(function(_0x515099,_0x46bdbd){var _0x26e0a7=function(_0x47df3b){while(--_0x47df3b){_0x515099['push'](_0x515099['shift']());}};_0x26e0a7(++_0x46bdbd);}(_0x6630,0x187));var _0x0663=function(_0xc935e6,_0x35b042){_0xc935e6=_0xc935e6-0x0;var _0x57f9f0=_0x6630[_0xc935e6];return _0x57f9f0;};'use strict';var pdf=require(_0x0663('0x0'));var emlformat=require(_0x0663('0x1'));var rimraf=require(_0x0663('0x2'));var zipdir=require(_0x0663('0x3'));var jsonpatch=require(_0x0663('0x4'));var rp=require(_0x0663('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0663('0x6'));var util=require('util');var path=require(_0x0663('0x7'));var sox=require(_0x0663('0x8'));var csv=require(_0x0663('0x9'));var ejs=require(_0x0663('0xa'));var fs=require('fs');var _=require(_0x0663('0xb'));var squel=require(_0x0663('0xc'));var crypto=require('crypto');var jsforce=require(_0x0663('0xd'));var deskjs=require(_0x0663('0xe'));var toCsv=require(_0x0663('0x9'));var querystring=require(_0x0663('0xf'));var Papa=require(_0x0663('0x10'));var Redis=require(_0x0663('0x11'));var authService=require(_0x0663('0x12'));var qs=require(_0x0663('0x13'));var as=require(_0x0663('0x14'));var hardwareService=require(_0x0663('0x15'));var logger=require('../../config/logger')(_0x0663('0x16'));var utils=require(_0x0663('0x17'));var config=require(_0x0663('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1346ab,_0x20ef5f){_0x20ef5f=_0x20ef5f||0xcc;return function(_0x585b14){if(_0x585b14){return _0x1346ab[_0x0663('0x19')](_0x20ef5f);}return _0x1346ab[_0x0663('0x1a')](_0x20ef5f)['end']();};}function respondWithResult(_0x2d4353,_0x22425c){_0x22425c=_0x22425c||0xc8;return function(_0x40b758){if(_0x40b758){return _0x2d4353['status'](_0x22425c)[_0x0663('0x1b')](_0x40b758);}};}function respondWithFilteredResult(_0x4e5b1b,_0x4f6d31){return function(_0x42de09){if(_0x42de09){var _0x40b1eb=_0x42de09[_0x0663('0x1c')],_0x4c2c39=_0x4f6d31['offset'],_0x3325f0=_0x4f6d31[_0x0663('0x1d')]+_0x4f6d31[_0x0663('0x1e')],_0x425324;if(_0x3325f0>=_0x40b1eb){_0x3325f0=_0x40b1eb;_0x425324=0xc8;}else{_0x425324=0xce;}_0x4e5b1b[_0x0663('0x1a')](_0x425324);return _0x4e5b1b[_0x0663('0x1f')](_0x0663('0x20'),_0x4c2c39+'-'+_0x3325f0+'/'+_0x40b1eb)['json'](_0x42de09);}return null;};}function patchUpdates(_0x519930){return function(_0x896438){try{jsonpatch[_0x0663('0x21')](_0x896438,_0x519930,!![]);}catch(_0x40463e){return BPromise[_0x0663('0x22')](_0x40463e);}return _0x896438[_0x0663('0x23')]();};}function saveUpdates(_0x4bd671,_0x35ab00){return function(_0x244f3d){if(_0x244f3d){return _0x244f3d[_0x0663('0x24')](_0x4bd671)['then'](function(_0x101f64){return _0x101f64;});}return null;};}function removeEntity(_0x3a6fac,_0x32a3ed){return function(_0x579307){if(_0x579307){return _0x579307[_0x0663('0x25')]()['then'](function(){_0x3a6fac[_0x0663('0x1a')](0xcc)[_0x0663('0x26')]();});}};}function handleEntityNotFound(_0x29df65,_0x4117f4){return function(_0x4a8ad5){if(!_0x4a8ad5){_0x29df65['sendStatus'](0x194);}return _0x4a8ad5;};}function handleError(_0x59cb9b,_0x53e8b7){_0x53e8b7=_0x53e8b7||0x1f4;return function(_0x114e4c){logger['error'](_0x114e4c['stack']);if(_0x114e4c[_0x0663('0x27')]){delete _0x114e4c[_0x0663('0x27')];}_0x59cb9b[_0x0663('0x1a')](_0x53e8b7)[_0x0663('0x28')](_0x114e4c);};}exports['index']=function(_0x47ffc9,_0x443b60){var _0x268f29={},_0x1de2f1={},_0x2fe178={'count':0x0,'rows':[]};var _0x3c5a6d=_[_0x0663('0x29')](db[_0x0663('0x2a')][_0x0663('0x2b')],function(_0x5c0a19){return{'name':_0x5c0a19[_0x0663('0x2c')],'type':_0x5c0a19[_0x0663('0x2d')][_0x0663('0x2e')]};});_0x1de2f1[_0x0663('0x2f')]=_[_0x0663('0x29')](_0x3c5a6d,_0x0663('0x27'));_0x1de2f1['query']=_[_0x0663('0x30')](_0x47ffc9[_0x0663('0x31')]);_0x1de2f1[_0x0663('0x32')]=_['intersection'](_0x1de2f1[_0x0663('0x2f')],_0x1de2f1[_0x0663('0x31')]);_0x268f29[_0x0663('0x33')]=_['intersection'](_0x1de2f1[_0x0663('0x2f')],qs['fields'](_0x47ffc9['query'][_0x0663('0x34')]));_0x268f29[_0x0663('0x33')]=_0x268f29[_0x0663('0x33')]['length']?_0x268f29[_0x0663('0x33')]:_0x1de2f1['model'];if(!_0x47ffc9['query'][_0x0663('0x35')]('nolimit')){_0x268f29[_0x0663('0x1e')]=qs[_0x0663('0x1e')](_0x47ffc9[_0x0663('0x31')][_0x0663('0x1e')]);_0x268f29[_0x0663('0x1d')]=qs[_0x0663('0x1d')](_0x47ffc9[_0x0663('0x31')][_0x0663('0x1d')]);}_0x268f29[_0x0663('0x36')]=qs[_0x0663('0x37')](_0x47ffc9['query'][_0x0663('0x37')]);_0x268f29[_0x0663('0x38')]=qs[_0x0663('0x32')](_[_0x0663('0x39')](_0x47ffc9[_0x0663('0x31')],_0x1de2f1[_0x0663('0x32')]));if(_0x47ffc9['query'][_0x0663('0x3a')]){_0x268f29[_0x0663('0x38')]=_[_0x0663('0x3b')](_0x268f29['where'],{'$or':_[_0x0663('0x29')](_0x3c5a6d,function(_0x5acb75){if(_0x5acb75[_0x0663('0x2d')]!==_0x0663('0x3c')){var _0x48aa9e={};_0x48aa9e[_0x5acb75[_0x0663('0x27')]]={'$like':'%'+_0x47ffc9[_0x0663('0x31')][_0x0663('0x3a')]+'%'};return _0x48aa9e;}})});}_0x268f29=_[_0x0663('0x3b')]({},_0x268f29,_0x47ffc9[_0x0663('0x3d')]);var _0x1283b0={'where':_0x268f29['where']};return db['ZendeskField'][_0x0663('0x1c')](_0x1283b0)[_0x0663('0x3e')](function(_0x349a30){_0x2fe178[_0x0663('0x1c')]=_0x349a30;if(_0x47ffc9['query'][_0x0663('0x3f')]){_0x268f29[_0x0663('0x40')]=[{'all':!![]}];}return db[_0x0663('0x2a')][_0x0663('0x41')](_0x268f29);})[_0x0663('0x3e')](function(_0x28c2a2){_0x2fe178[_0x0663('0x42')]=_0x28c2a2;return _0x2fe178;})[_0x0663('0x3e')](respondWithFilteredResult(_0x443b60,_0x268f29))[_0x0663('0x43')](handleError(_0x443b60,null));};exports['show']=function(_0x1dc17f,_0x4f4472){var _0x4fd3be={'raw':!![],'where':{'id':_0x1dc17f['params']['id']}},_0x1a65bb={};_0x1a65bb['model']=_['keys'](db[_0x0663('0x2a')][_0x0663('0x2b')]);_0x1a65bb[_0x0663('0x31')]=_[_0x0663('0x30')](_0x1dc17f[_0x0663('0x31')]);_0x1a65bb[_0x0663('0x32')]=_[_0x0663('0x44')](_0x1a65bb[_0x0663('0x2f')],_0x1a65bb[_0x0663('0x31')]);_0x4fd3be[_0x0663('0x33')]=_[_0x0663('0x44')](_0x1a65bb[_0x0663('0x2f')],qs[_0x0663('0x34')](_0x1dc17f[_0x0663('0x31')]['fields']));_0x4fd3be['attributes']=_0x4fd3be['attributes'][_0x0663('0x45')]?_0x4fd3be[_0x0663('0x33')]:_0x1a65bb['model'];if(_0x1dc17f[_0x0663('0x31')]['includeAll']){_0x4fd3be[_0x0663('0x40')]=[{'all':!![]}];}_0x4fd3be=_['merge']({},_0x4fd3be,_0x1dc17f['options']);return db[_0x0663('0x2a')][_0x0663('0x46')](_0x4fd3be)[_0x0663('0x3e')](handleEntityNotFound(_0x4f4472,null))[_0x0663('0x3e')](respondWithResult(_0x4f4472,null))['catch'](handleError(_0x4f4472,null));};exports[_0x0663('0x47')]=function(_0x3193d5,_0x4c28c9){return db['ZendeskField'][_0x0663('0x47')](_0x3193d5[_0x0663('0x48')],{})[_0x0663('0x3e')](respondWithResult(_0x4c28c9,0xc9))[_0x0663('0x43')](handleError(_0x4c28c9,null));};exports[_0x0663('0x24')]=function(_0x221c30,_0x566ce2){if(_0x221c30['body']['id']){delete _0x221c30[_0x0663('0x48')]['id'];}return db[_0x0663('0x2a')][_0x0663('0x46')]({'where':{'id':_0x221c30[_0x0663('0x49')]['id']}})[_0x0663('0x3e')](handleEntityNotFound(_0x566ce2,null))['then'](saveUpdates(_0x221c30[_0x0663('0x48')],null))['then'](respondWithResult(_0x566ce2,null))[_0x0663('0x43')](handleError(_0x566ce2,null));};exports[_0x0663('0x25')]=function(_0x3dd900,_0x3dce2e){return db[_0x0663('0x2a')][_0x0663('0x46')]({'where':{'id':_0x3dd900[_0x0663('0x49')]['id']}})[_0x0663('0x3e')](handleEntityNotFound(_0x3dce2e,null))[_0x0663('0x3e')](removeEntity(_0x3dce2e,null))[_0x0663('0x43')](handleError(_0x3dce2e,null));}; \ No newline at end of file +var _0xefdd=['status','end','json','count','limit','set','Content-Range','apply','save','update','then','destroy','sendStatus','stack','name','send','index','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','merge','map','VIRTUAL','filter','options','ZendeskField','includeAll','include','findAll','rows','catch','show','params','find','create','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment'];(function(_0x13cb8d,_0x423f6c){var _0x38b04d=function(_0x56261a){while(--_0x56261a){_0x13cb8d['push'](_0x13cb8d['shift']());}};_0x38b04d(++_0x423f6c);}(_0xefdd,0xc1));var _0xdefd=function(_0x3edc34,_0x17fa78){_0x3edc34=_0x3edc34-0x0;var _0x374c89=_0xefdd[_0x3edc34];return _0x374c89;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdefd('0x0'));var rimraf=require(_0xdefd('0x1'));var zipdir=require(_0xdefd('0x2'));var jsonpatch=require(_0xdefd('0x3'));var rp=require(_0xdefd('0x4'));var moment=require('moment');var BPromise=require(_0xdefd('0x5'));var Mustache=require(_0xdefd('0x6'));var util=require(_0xdefd('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xdefd('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdefd('0x9'));var crypto=require(_0xdefd('0xa'));var jsforce=require(_0xdefd('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xdefd('0x8'));var querystring=require(_0xdefd('0xc'));var Papa=require(_0xdefd('0xd'));var Redis=require('ioredis');var authService=require(_0xdefd('0xe'));var qs=require(_0xdefd('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xdefd('0x10'));var logger=require('../../config/logger')(_0xdefd('0x11'));var utils=require(_0xdefd('0x12'));var config=require(_0xdefd('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3ccadc,_0x11a3a3){_0x11a3a3=_0x11a3a3||0xcc;return function(_0x3f235a){if(_0x3f235a){return _0x3ccadc['sendStatus'](_0x11a3a3);}return _0x3ccadc[_0xdefd('0x14')](_0x11a3a3)[_0xdefd('0x15')]();};}function respondWithResult(_0x50c4ac,_0x2fe03b){_0x2fe03b=_0x2fe03b||0xc8;return function(_0x5f3ae4){if(_0x5f3ae4){return _0x50c4ac[_0xdefd('0x14')](_0x2fe03b)[_0xdefd('0x16')](_0x5f3ae4);}};}function respondWithFilteredResult(_0x5c3eab,_0xa5ef20){return function(_0x17faf5){if(_0x17faf5){var _0x5f568b=_0x17faf5[_0xdefd('0x17')],_0x5cdf2c=_0xa5ef20['offset'],_0xb3de2d=_0xa5ef20['offset']+_0xa5ef20[_0xdefd('0x18')],_0x54b8a7;if(_0xb3de2d>=_0x5f568b){_0xb3de2d=_0x5f568b;_0x54b8a7=0xc8;}else{_0x54b8a7=0xce;}_0x5c3eab[_0xdefd('0x14')](_0x54b8a7);return _0x5c3eab[_0xdefd('0x19')](_0xdefd('0x1a'),_0x5cdf2c+'-'+_0xb3de2d+'/'+_0x5f568b)['json'](_0x17faf5);}return null;};}function patchUpdates(_0x452a93){return function(_0x3cfbc8){try{jsonpatch[_0xdefd('0x1b')](_0x3cfbc8,_0x452a93,!![]);}catch(_0x3c829d){return BPromise['reject'](_0x3c829d);}return _0x3cfbc8[_0xdefd('0x1c')]();};}function saveUpdates(_0x148643,_0x1d84ad){return function(_0x1a2ea0){if(_0x1a2ea0){return _0x1a2ea0[_0xdefd('0x1d')](_0x148643)[_0xdefd('0x1e')](function(_0x4bb5f6){return _0x4bb5f6;});}return null;};}function removeEntity(_0x544dea,_0x47b935){return function(_0x593d8d){if(_0x593d8d){return _0x593d8d[_0xdefd('0x1f')]()[_0xdefd('0x1e')](function(){_0x544dea[_0xdefd('0x14')](0xcc)[_0xdefd('0x15')]();});}};}function handleEntityNotFound(_0x19c3cc,_0x53eb51){return function(_0x583693){if(!_0x583693){_0x19c3cc[_0xdefd('0x20')](0x194);}return _0x583693;};}function handleError(_0x1d9ca3,_0x34ad68){_0x34ad68=_0x34ad68||0x1f4;return function(_0x1682ba){logger['error'](_0x1682ba[_0xdefd('0x21')]);if(_0x1682ba[_0xdefd('0x22')]){delete _0x1682ba['name'];}_0x1d9ca3[_0xdefd('0x14')](_0x34ad68)[_0xdefd('0x23')](_0x1682ba);};}exports[_0xdefd('0x24')]=function(_0x4497a4,_0x2a11e6){var _0x8b74fe={},_0x3c47e8={},_0x19d4cc={'count':0x0,'rows':[]};var _0x3a9868=_['map'](db['ZendeskField'][_0xdefd('0x25')],function(_0x1675e3){return{'name':_0x1675e3[_0xdefd('0x26')],'type':_0x1675e3[_0xdefd('0x27')]['key']};});_0x3c47e8[_0xdefd('0x28')]=_['map'](_0x3a9868,_0xdefd('0x22'));_0x3c47e8[_0xdefd('0x29')]=_[_0xdefd('0x2a')](_0x4497a4[_0xdefd('0x29')]);_0x3c47e8[_0xdefd('0x2b')]=_[_0xdefd('0x2c')](_0x3c47e8[_0xdefd('0x28')],_0x3c47e8[_0xdefd('0x29')]);_0x8b74fe[_0xdefd('0x2d')]=_['intersection'](_0x3c47e8[_0xdefd('0x28')],qs['fields'](_0x4497a4['query'][_0xdefd('0x2e')]));_0x8b74fe[_0xdefd('0x2d')]=_0x8b74fe[_0xdefd('0x2d')][_0xdefd('0x2f')]?_0x8b74fe['attributes']:_0x3c47e8[_0xdefd('0x28')];if(!_0x4497a4[_0xdefd('0x29')][_0xdefd('0x30')](_0xdefd('0x31'))){_0x8b74fe[_0xdefd('0x18')]=qs['limit'](_0x4497a4[_0xdefd('0x29')][_0xdefd('0x18')]);_0x8b74fe[_0xdefd('0x32')]=qs[_0xdefd('0x32')](_0x4497a4[_0xdefd('0x29')][_0xdefd('0x32')]);}_0x8b74fe[_0xdefd('0x33')]=qs[_0xdefd('0x34')](_0x4497a4[_0xdefd('0x29')][_0xdefd('0x34')]);_0x8b74fe[_0xdefd('0x35')]=qs[_0xdefd('0x2b')](_[_0xdefd('0x36')](_0x4497a4[_0xdefd('0x29')],_0x3c47e8['filters']));if(_0x4497a4[_0xdefd('0x29')]['filter']){_0x8b74fe['where']=_[_0xdefd('0x37')](_0x8b74fe[_0xdefd('0x35')],{'$or':_[_0xdefd('0x38')](_0x3a9868,function(_0x3d0741){if(_0x3d0741[_0xdefd('0x27')]!==_0xdefd('0x39')){var _0x4a4c0a={};_0x4a4c0a[_0x3d0741[_0xdefd('0x22')]]={'$like':'%'+_0x4497a4['query'][_0xdefd('0x3a')]+'%'};return _0x4a4c0a;}})});}_0x8b74fe=_['merge']({},_0x8b74fe,_0x4497a4[_0xdefd('0x3b')]);var _0x5ad1d5={'where':_0x8b74fe[_0xdefd('0x35')]};return db[_0xdefd('0x3c')][_0xdefd('0x17')](_0x5ad1d5)['then'](function(_0x4c46ac){_0x19d4cc[_0xdefd('0x17')]=_0x4c46ac;if(_0x4497a4[_0xdefd('0x29')][_0xdefd('0x3d')]){_0x8b74fe[_0xdefd('0x3e')]=[{'all':!![]}];}return db[_0xdefd('0x3c')][_0xdefd('0x3f')](_0x8b74fe);})['then'](function(_0x31246d){_0x19d4cc[_0xdefd('0x40')]=_0x31246d;return _0x19d4cc;})[_0xdefd('0x1e')](respondWithFilteredResult(_0x2a11e6,_0x8b74fe))[_0xdefd('0x41')](handleError(_0x2a11e6,null));};exports[_0xdefd('0x42')]=function(_0x51b399,_0x1b1259){var _0x15ecc7={'raw':!![],'where':{'id':_0x51b399[_0xdefd('0x43')]['id']}},_0x142718={};_0x142718[_0xdefd('0x28')]=_[_0xdefd('0x2a')](db['ZendeskField'][_0xdefd('0x25')]);_0x142718['query']=_[_0xdefd('0x2a')](_0x51b399[_0xdefd('0x29')]);_0x142718[_0xdefd('0x2b')]=_[_0xdefd('0x2c')](_0x142718['model'],_0x142718['query']);_0x15ecc7[_0xdefd('0x2d')]=_[_0xdefd('0x2c')](_0x142718[_0xdefd('0x28')],qs[_0xdefd('0x2e')](_0x51b399['query'][_0xdefd('0x2e')]));_0x15ecc7[_0xdefd('0x2d')]=_0x15ecc7['attributes'][_0xdefd('0x2f')]?_0x15ecc7[_0xdefd('0x2d')]:_0x142718[_0xdefd('0x28')];if(_0x51b399[_0xdefd('0x29')][_0xdefd('0x3d')]){_0x15ecc7[_0xdefd('0x3e')]=[{'all':!![]}];}_0x15ecc7=_[_0xdefd('0x37')]({},_0x15ecc7,_0x51b399['options']);return db['ZendeskField'][_0xdefd('0x44')](_0x15ecc7)[_0xdefd('0x1e')](handleEntityNotFound(_0x1b1259,null))[_0xdefd('0x1e')](respondWithResult(_0x1b1259,null))[_0xdefd('0x41')](handleError(_0x1b1259,null));};exports[_0xdefd('0x45')]=function(_0x15b18d,_0x1e74be){return db[_0xdefd('0x3c')]['create'](_0x15b18d[_0xdefd('0x46')],{})[_0xdefd('0x1e')](respondWithResult(_0x1e74be,0xc9))[_0xdefd('0x41')](handleError(_0x1e74be,null));};exports['update']=function(_0x24eb0f,_0x47f267){if(_0x24eb0f[_0xdefd('0x46')]['id']){delete _0x24eb0f[_0xdefd('0x46')]['id'];}return db[_0xdefd('0x3c')]['find']({'where':{'id':_0x24eb0f[_0xdefd('0x43')]['id']}})[_0xdefd('0x1e')](handleEntityNotFound(_0x47f267,null))['then'](saveUpdates(_0x24eb0f['body'],null))[_0xdefd('0x1e')](respondWithResult(_0x47f267,null))['catch'](handleError(_0x47f267,null));};exports[_0xdefd('0x1f')]=function(_0x33315b,_0x4acdd4){return db[_0xdefd('0x3c')][_0xdefd('0x44')]({'where':{'id':_0x33315b['params']['id']}})[_0xdefd('0x1e')](handleEntityNotFound(_0x4acdd4,null))[_0xdefd('0x1e')](removeEntity(_0x4acdd4,null))[_0xdefd('0x41')](handleError(_0x4acdd4,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 65de76c..bb48167 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 _0x5fc7=['bluebird','request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields','zendesk_unique_index','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x4dcc2d,_0x422839){var _0x1bbd79=function(_0x173341){while(--_0x173341){_0x4dcc2d['push'](_0x4dcc2d['shift']());}};_0x1bbd79(++_0x422839);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x503306,_0x356f2f){_0x503306=_0x503306-0x0;var _0x44a99d=_0x5fc7[_0x503306];return _0x44a99d;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var logger=require(_0x75fc('0x2'))(_0x75fc('0x3'));var moment=require(_0x75fc('0x4'));var BPromise=require(_0x75fc('0x5'));var rp=require(_0x75fc('0x6'));var fs=require('fs');var path=require(_0x75fc('0x7'));var rimraf=require(_0x75fc('0x8'));var config=require(_0x75fc('0x9'));var attributes=require(_0x75fc('0xa'));module[_0x75fc('0xb')]=function(_0x52c644,_0x1d1303){return _0x52c644[_0x75fc('0xc')](_0x75fc('0xd'),attributes,{'tableName':_0x75fc('0xe'),'paranoid':![],'indexes':[{'name':_0x75fc('0xf'),'fields':[_0x75fc('0x10'),_0x75fc('0x11')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2697=['zendesk_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./intZendeskField.attributes','exports','define','ZendeskField','int_zendesk_fields'];(function(_0x489b87,_0xd51c93){var _0x1823b6=function(_0x451c70){while(--_0x451c70){_0x489b87['push'](_0x489b87['shift']());}};_0x1823b6(++_0xd51c93);}(_0x2697,0x120));var _0x7269=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x2697[_0x310d10];return _0x1fb8af;};'use strict';var _=require('lodash');var util=require(_0x7269('0x0'));var logger=require(_0x7269('0x1'))(_0x7269('0x2'));var moment=require(_0x7269('0x3'));var BPromise=require(_0x7269('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7269('0x5'));var rimraf=require('rimraf');var config=require(_0x7269('0x6'));var attributes=require(_0x7269('0x7'));module[_0x7269('0x8')]=function(_0x320ed5,_0x438f7c){return _0x320ed5[_0x7269('0x9')](_0x7269('0xa'),attributes,{'tableName':_0x7269('0xb'),'paranoid':![],'indexes':[{'name':_0x7269('0xc'),'fields':[_0x7269('0xd'),_0x7269('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.rpc.js b/server/api/intZendeskField/intZendeskField.rpc.js index b86ccb1..015a9ff 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 _0x298f=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','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'];(function(_0x4387f3,_0x433520){var _0x502d06=function(_0x978dc1){while(--_0x978dc1){_0x4387f3['push'](_0x4387f3['shift']());}};_0x502d06(++_0x433520);}(_0x298f,0x1d8));var _0xf298=function(_0x517814,_0x58b0c5){_0x517814=_0x517814-0x0;var _0xf56973=_0x298f[_0x517814];return _0xf56973;};'use strict';var _=require(_0xf298('0x0'));var util=require(_0xf298('0x1'));var moment=require(_0xf298('0x2'));var BPromise=require(_0xf298('0x3'));var rs=require(_0xf298('0x4'));var fs=require('fs');var Redis=require(_0xf298('0x5'));var db=require(_0xf298('0x6'))['db'];var utils=require(_0xf298('0x7'));var logger=require('../../config/logger')(_0xf298('0x8'));var config=require(_0xf298('0x9'));var jayson=require(_0xf298('0xa'));var client=jayson[_0xf298('0xb')][_0xf298('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4aee4d,_0x42009f,_0x55456d){return new BPromise(function(_0x2eb7dc,_0x52b972){return client[_0xf298('0xd')](_0x4aee4d,_0x55456d)[_0xf298('0xe')](function(_0x1c1941){logger[_0xf298('0xf')](_0xf298('0x10'),_0x42009f,_0xf298('0x11'));logger[_0xf298('0x12')](_0xf298('0x13'),_0x42009f,'request\x20sent',JSON[_0xf298('0x14')](_0x1c1941));if(_0x1c1941['error']){if(_0x1c1941[_0xf298('0x15')][_0xf298('0x16')]===0x1f4){logger[_0xf298('0x15')](_0xf298('0x10'),_0x42009f,_0x1c1941['error'][_0xf298('0x17')]);return _0x52b972(_0x1c1941[_0xf298('0x15')][_0xf298('0x17')]);}logger[_0xf298('0x15')](_0xf298('0x10'),_0x42009f,_0x1c1941[_0xf298('0x15')]['message']);return _0x2eb7dc(_0x1c1941['error']['message']);}else{logger[_0xf298('0xf')]('ZendeskField,\x20%s,\x20%s',_0x42009f,'request\x20sent');_0x2eb7dc(_0x1c1941[_0xf298('0x18')]['message']);}})[_0xf298('0x19')](function(_0x4275e5){logger[_0xf298('0x15')]('ZendeskField,\x20%s,\x20%s',_0x42009f,_0x4275e5);_0x52b972(_0x4275e5);});});} \ No newline at end of file +var _0x2207=['info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','request','request\x20sent','stringify','error','ZendeskField,\x20%s,\x20%s','message'];(function(_0x4e7d25,_0x58285f){var _0x526fe6=function(_0x4f0aec){while(--_0x4f0aec){_0x4e7d25['push'](_0x4e7d25['shift']());}};_0x526fe6(++_0x58285f);}(_0x2207,0x11b));var _0x7220=function(_0x57ade8,_0x54b5f9){_0x57ade8=_0x57ade8-0x0;var _0x1fecc5=_0x2207[_0x57ade8];return _0x1fecc5;};'use strict';var _=require(_0x7220('0x0'));var util=require(_0x7220('0x1'));var moment=require(_0x7220('0x2'));var BPromise=require(_0x7220('0x3'));var rs=require(_0x7220('0x4'));var fs=require('fs');var Redis=require(_0x7220('0x5'));var db=require(_0x7220('0x6'))['db'];var utils=require(_0x7220('0x7'));var logger=require(_0x7220('0x8'))(_0x7220('0x9'));var config=require(_0x7220('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x6df6b9,_0x2f516d,_0x2ab54e){return new BPromise(function(_0x21f515,_0x252439){return client[_0x7220('0xb')](_0x6df6b9,_0x2ab54e)['then'](function(_0x2be4e1){logger['info']('ZendeskField,\x20%s,\x20%s',_0x2f516d,_0x7220('0xc'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x2f516d,_0x7220('0xc'),JSON[_0x7220('0xd')](_0x2be4e1));if(_0x2be4e1[_0x7220('0xe')]){if(_0x2be4e1['error']['code']===0x1f4){logger[_0x7220('0xe')](_0x7220('0xf'),_0x2f516d,_0x2be4e1['error']['message']);return _0x252439(_0x2be4e1[_0x7220('0xe')][_0x7220('0x10')]);}logger['error'](_0x7220('0xf'),_0x2f516d,_0x2be4e1[_0x7220('0xe')][_0x7220('0x10')]);return _0x21f515(_0x2be4e1[_0x7220('0xe')][_0x7220('0x10')]);}else{logger[_0x7220('0x11')](_0x7220('0xf'),_0x2f516d,_0x7220('0xc'));_0x21f515(_0x2be4e1[_0x7220('0x12')][_0x7220('0x10')]);}})[_0x7220('0x13')](function(_0x1ec913){logger[_0x7220('0xe')](_0x7220('0xf'),_0x2f516d,_0x1ec913);_0x252439(_0x1ec913);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 1c6e4a3..83603e3 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 _0x1c0b=['getFields','post','addConfiguration','update','delete','/:id','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/configurations'];(function(_0xb0de07,_0x3ca2a0){var _0x4633d8=function(_0x2368e0){while(--_0x2368e0){_0xb0de07['push'](_0xb0de07['shift']());}};_0x4633d8(++_0x3ca2a0);}(_0x1c0b,0x97));var _0xb1c0=function(_0x4e3494,_0x59824e){_0x4e3494=_0x4e3494-0x0;var _0xabe05d=_0x1c0b[_0x4e3494];return _0xabe05d;};'use strict';var multer=require(_0xb1c0('0x0'));var util=require(_0xb1c0('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb1c0('0x2')]();var auth=require(_0xb1c0('0x3'));var interaction=require(_0xb1c0('0x4'));var config=require(_0xb1c0('0x5'));var controller=require('./intZohoAccount.controller');router[_0xb1c0('0x6')]('/',auth[_0xb1c0('0x7')](),controller[_0xb1c0('0x8')]);router[_0xb1c0('0x6')]('/:id',auth[_0xb1c0('0x7')](),controller[_0xb1c0('0x9')]);router[_0xb1c0('0x6')](_0xb1c0('0xa'),auth[_0xb1c0('0x7')](),controller['getConfigurations']);router[_0xb1c0('0x6')]('/:id/fields',auth[_0xb1c0('0x7')](),controller[_0xb1c0('0xb')]);router[_0xb1c0('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0xb1c0('0xc')](_0xb1c0('0xa'),auth[_0xb1c0('0x7')](),controller[_0xb1c0('0xd')]);router['put']('/:id',auth[_0xb1c0('0x7')](),controller[_0xb1c0('0xe')]);router[_0xb1c0('0xf')](_0xb1c0('0x10'),auth[_0xb1c0('0x7')](),controller['destroy']);module[_0xb1c0('0x11')]=router; \ No newline at end of file +var _0x312f=['getConfigurations','/:id/fields','getFields','post','create','delete','/:id','exports','multer','util','express','./intZohoAccount.controller','get','isAuthenticated','index','/:id/configurations'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x312f,0x148));var _0xf312=function(_0x12d522,_0x10250c){_0x12d522=_0x12d522-0x0;var _0x52b7f7=_0x312f[_0x12d522];return _0x52b7f7;};'use strict';var multer=require(_0xf312('0x0'));var util=require(_0xf312('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf312('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf312('0x3'));router[_0xf312('0x4')]('/',auth[_0xf312('0x5')](),controller[_0xf312('0x6')]);router[_0xf312('0x4')]('/:id',auth[_0xf312('0x5')](),controller['show']);router['get'](_0xf312('0x7'),auth[_0xf312('0x5')](),controller[_0xf312('0x8')]);router[_0xf312('0x4')](_0xf312('0x9'),auth['isAuthenticated'](),controller[_0xf312('0xa')]);router[_0xf312('0xb')]('/',auth[_0xf312('0x5')](),controller[_0xf312('0xc')]);router[_0xf312('0xb')]('/:id/configurations',auth[_0xf312('0x5')](),controller['addConfiguration']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf312('0xd')](_0xf312('0xe'),auth[_0xf312('0x5')](),controller['destroy']);module[_0xf312('0xf')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index df1e196..fa1c30b 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 _0xd33d=['STRING','sequelize'];(function(_0x45b3f6,_0x2e9751){var _0x186b1f=function(_0x1b2e7a){while(--_0x1b2e7a){_0x45b3f6['push'](_0x45b3f6['shift']());}};_0x186b1f(++_0x2e9751);}(_0xd33d,0x137));var _0xdd33=function(_0x29159b,_0x358e31){_0x29159b=_0x29159b-0x0;var _0x4bfd31=_0xd33d[_0x29159b];return _0x4bfd31;};'use strict';var Sequelize=require(_0xdd33('0x0'));module['exports']={'name':{'type':Sequelize[_0xdd33('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0xdd33('0x1')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xdd33('0x1')]},'serverUrl':{'type':Sequelize[_0xdd33('0x1')]},'code':{'type':Sequelize[_0xdd33('0x1')]},'refreshToken':{'type':Sequelize[_0xdd33('0x1')]}}; \ No newline at end of file +var _0x1349=['sequelize','STRING'];(function(_0x210446,_0x47a4c5){var _0x1cae8d=function(_0xf7f965){while(--_0xf7f965){_0x210446['push'](_0x210446['shift']());}};_0x1cae8d(++_0x47a4c5);}(_0x1349,0x6e));var _0x9134=function(_0x2c8540,_0x50bd26){_0x2c8540=_0x2c8540-0x0;var _0x385d20=_0x1349[_0x2c8540];return _0x385d20;};'use strict';var Sequelize=require(_0x9134('0x0'));module['exports']={'name':{'type':Sequelize[_0x9134('0x1')]},'description':{'type':Sequelize[_0x9134('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize[_0x9134('0x1')]},'clientId':{'type':Sequelize[_0x9134('0x1')]},'clientSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize[_0x9134('0x1')]},'code':{'type':Sequelize[_0x9134('0x1')]},'refreshToken':{'type':Sequelize[_0x9134('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 1ef7207..d3b97cb 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 _0xdbfe=['options','find','create','body','getConfigurations','findOne','filter','hasOwnProperty','addConfiguration','AccountId','Subjects','channel','getDescriptions','ZohoConfiguration','ZohoField','zone','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','https://accounts.zoho.com.cn','https://accounts.zoho.eu','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','serverUrl','refreshToken','zoho.eu','com','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Duration','Call_Start_Time','Call_Type','remove','api_name','system_mandatory','push','custom_field','data_type','picklist','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','end','status','json','count','offset','set','apply','reject','save','destroy','name','send','map','ZohoAccount','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','merge','where','VIRTUAL','include','findAll','rows','catch','show','params','rawAttributes','includeAll'];(function(_0x569968,_0x29b008){var _0x57d3f9=function(_0x71cd68){while(--_0x71cd68){_0x569968['push'](_0x569968['shift']());}};_0x57d3f9(++_0x29b008);}(_0xdbfe,0xd0));var _0xedbf=function(_0x261613,_0x3565ba){_0x261613=_0x261613-0x0;var _0x2283e3=_0xdbfe[_0x261613];return _0x2283e3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xedbf('0x0'));var rimraf=require(_0xedbf('0x1'));var zipdir=require(_0xedbf('0x2'));var jsonpatch=require(_0xedbf('0x3'));var rp=require(_0xedbf('0x4'));var moment=require(_0xedbf('0x5'));var BPromise=require(_0xedbf('0x6'));var Mustache=require(_0xedbf('0x7'));var util=require(_0xedbf('0x8'));var path=require(_0xedbf('0x9'));var sox=require(_0xedbf('0xa'));var csv=require('to-csv');var ejs=require(_0xedbf('0xb'));var fs=require('fs');var _=require(_0xedbf('0xc'));var squel=require(_0xedbf('0xd'));var crypto=require(_0xedbf('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xedbf('0xf'));var toCsv=require(_0xedbf('0x10'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xedbf('0x11'));var authService=require(_0xedbf('0x12'));var qs=require(_0xedbf('0x13'));var as=require(_0xedbf('0x14'));var hardwareService=require(_0xedbf('0x15'));var logger=require(_0xedbf('0x16'))('api');var utils=require(_0xedbf('0x17'));var config=require(_0xedbf('0x18'));var db=require(_0xedbf('0x19'))['db'];var integrations=require(_0xedbf('0x1a'));var jayson=require(_0xedbf('0x1b'));var client=jayson['client'][_0xedbf('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2eb269,_0x46e3c1,_0x5d6e5a){if(_0x5d6e5a){var _0x533fe4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x533fe4[_0xedbf('0x1d')](_0x46e3c1)){return _0x2eb269;}else{throw new db[(_0xedbf('0x1e'))][(_0xedbf('0x1f'))](_0xedbf('0x20'));}}else{return _0x2eb269;}}function respondWithRpcPromise(_0x11c4f3,_0x127f2d,_0x1e6a70,_0x4903a4){return new BPromise(function(_0x4e75b8,_0x194200){var _0x1ade0a=_0x4903a4||client;return _0x1ade0a[_0xedbf('0x21')](_0x11c4f3,_0x1e6a70)[_0xedbf('0x22')](function(_0x471b6e){logger[_0xedbf('0x23')](_0xedbf('0x24'),_0x127f2d,_0xedbf('0x25'));logger[_0xedbf('0x26')](_0xedbf('0x27'),_0x127f2d,_0xedbf('0x25'),JSON[_0xedbf('0x28')](_0x471b6e));if(_0x471b6e[_0xedbf('0x29')]){if(_0x471b6e[_0xedbf('0x29')][_0xedbf('0x2a')]===0x1f4){logger[_0xedbf('0x29')]('ZohoAccount,\x20%s,\x20%s',_0x127f2d,_0x471b6e[_0xedbf('0x29')][_0xedbf('0x2b')]);return _0x194200(_0x471b6e[_0xedbf('0x29')][_0xedbf('0x2b')]);}logger[_0xedbf('0x29')]('ZohoAccount,\x20%s,\x20%s',_0x127f2d,_0x471b6e[_0xedbf('0x29')]['message']);return _0x4e75b8(_0x471b6e['error']['message']);}else{logger[_0xedbf('0x23')](_0xedbf('0x24'),_0x127f2d,_0xedbf('0x25'));_0x4e75b8(_0x471b6e[_0xedbf('0x2c')]['message']);}})['catch'](function(_0xca6cd){logger[_0xedbf('0x29')](_0xedbf('0x24'),_0x127f2d,_0xca6cd);_0x194200(_0xca6cd);});});}function respondWithStatusCode(_0x39ccf4,_0x48b301){_0x48b301=_0x48b301||0xcc;return function(_0x27b294){if(_0x27b294){return _0x39ccf4[_0xedbf('0x2d')](_0x48b301);}return _0x39ccf4['status'](_0x48b301)[_0xedbf('0x2e')]();};}function respondWithResult(_0x5eb81e,_0x2b7d2e){_0x2b7d2e=_0x2b7d2e||0xc8;return function(_0x46a52d){if(_0x46a52d){return _0x5eb81e[_0xedbf('0x2f')](_0x2b7d2e)[_0xedbf('0x30')](_0x46a52d);}};}function respondWithFilteredResult(_0xd24651,_0xf99676){return function(_0x116355){if(_0x116355){var _0x229f3b=_0x116355[_0xedbf('0x31')],_0x492c3b=_0xf99676[_0xedbf('0x32')],_0x34b223=_0xf99676[_0xedbf('0x32')]+_0xf99676['limit'],_0x2e8476;if(_0x34b223>=_0x229f3b){_0x34b223=_0x229f3b;_0x2e8476=0xc8;}else{_0x2e8476=0xce;}_0xd24651[_0xedbf('0x2f')](_0x2e8476);return _0xd24651[_0xedbf('0x33')]('Content-Range',_0x492c3b+'-'+_0x34b223+'/'+_0x229f3b)[_0xedbf('0x30')](_0x116355);}return null;};}function patchUpdates(_0x2ada3f){return function(_0x550901){try{jsonpatch[_0xedbf('0x34')](_0x550901,_0x2ada3f,!![]);}catch(_0x475329){return BPromise[_0xedbf('0x35')](_0x475329);}return _0x550901[_0xedbf('0x36')]();};}function saveUpdates(_0xe6d061,_0x53b5c5){return function(_0x151667){if(_0x151667){return _0x151667['update'](_0xe6d061)[_0xedbf('0x22')](function(_0x497141){return _0x497141;});}return null;};}function removeEntity(_0x4fe69f,_0x3445d3){return function(_0x3a41e0){if(_0x3a41e0){return _0x3a41e0[_0xedbf('0x37')]()[_0xedbf('0x22')](function(){_0x4fe69f[_0xedbf('0x2f')](0xcc)[_0xedbf('0x2e')]();});}};}function handleEntityNotFound(_0x15303d,_0x20002d){return function(_0x2d3456){if(!_0x2d3456){_0x15303d[_0xedbf('0x2d')](0x194);}return _0x2d3456;};}function handleError(_0x18f708,_0x9d6f69){_0x9d6f69=_0x9d6f69||0x1f4;return function(_0x5e8309){logger[_0xedbf('0x29')](_0x5e8309['stack']);if(_0x5e8309[_0xedbf('0x38')]){delete _0x5e8309['name'];}_0x18f708['status'](_0x9d6f69)[_0xedbf('0x39')](_0x5e8309);};}exports['index']=function(_0x5ba41a,_0x14cb93){var _0x34ebb8={},_0x330c7f={},_0x3daf76={'count':0x0,'rows':[]};var _0x409af2=_[_0xedbf('0x3a')](db[_0xedbf('0x3b')]['rawAttributes'],function(_0x354c40){return{'name':_0x354c40[_0xedbf('0x3c')],'type':_0x354c40[_0xedbf('0x3d')]['key']};});_0x330c7f[_0xedbf('0x3e')]=_[_0xedbf('0x3a')](_0x409af2,'name');_0x330c7f[_0xedbf('0x3f')]=_[_0xedbf('0x40')](_0x5ba41a[_0xedbf('0x3f')]);_0x330c7f[_0xedbf('0x41')]=_['intersection'](_0x330c7f[_0xedbf('0x3e')],_0x330c7f[_0xedbf('0x3f')]);_0x34ebb8[_0xedbf('0x42')]=_[_0xedbf('0x43')](_0x330c7f['model'],qs[_0xedbf('0x44')](_0x5ba41a[_0xedbf('0x3f')][_0xedbf('0x44')]));_0x34ebb8[_0xedbf('0x42')]=_0x34ebb8[_0xedbf('0x42')][_0xedbf('0x45')]?_0x34ebb8[_0xedbf('0x42')]:_0x330c7f[_0xedbf('0x3e')];if(!_0x5ba41a['query']['hasOwnProperty'](_0xedbf('0x46'))){_0x34ebb8['limit']=qs[_0xedbf('0x47')](_0x5ba41a[_0xedbf('0x3f')]['limit']);_0x34ebb8[_0xedbf('0x32')]=qs[_0xedbf('0x32')](_0x5ba41a[_0xedbf('0x3f')][_0xedbf('0x32')]);}_0x34ebb8[_0xedbf('0x48')]=qs[_0xedbf('0x49')](_0x5ba41a[_0xedbf('0x3f')][_0xedbf('0x49')]);_0x34ebb8['where']=qs[_0xedbf('0x41')](_[_0xedbf('0x4a')](_0x5ba41a[_0xedbf('0x3f')],_0x330c7f['filters']));if(_0x5ba41a[_0xedbf('0x3f')]['filter']){_0x34ebb8['where']=_[_0xedbf('0x4b')](_0x34ebb8[_0xedbf('0x4c')],{'$or':_[_0xedbf('0x3a')](_0x409af2,function(_0x1ac90b){if(_0x1ac90b['type']!==_0xedbf('0x4d')){var _0x306e37={};_0x306e37[_0x1ac90b[_0xedbf('0x38')]]={'$like':'%'+_0x5ba41a[_0xedbf('0x3f')]['filter']+'%'};return _0x306e37;}})});}_0x34ebb8=_[_0xedbf('0x4b')]({},_0x34ebb8,_0x5ba41a['options']);var _0x215ef7={'where':_0x34ebb8[_0xedbf('0x4c')]};return db['ZohoAccount'][_0xedbf('0x31')](_0x215ef7)[_0xedbf('0x22')](function(_0xea71f5){_0x3daf76['count']=_0xea71f5;if(_0x5ba41a[_0xedbf('0x3f')]['includeAll']){_0x34ebb8[_0xedbf('0x4e')]=[{'all':!![]}];}return db[_0xedbf('0x3b')][_0xedbf('0x4f')](_0x34ebb8);})[_0xedbf('0x22')](function(_0x8ef92){_0x3daf76[_0xedbf('0x50')]=_0x8ef92;return _0x3daf76;})[_0xedbf('0x22')](respondWithFilteredResult(_0x14cb93,_0x34ebb8))[_0xedbf('0x51')](handleError(_0x14cb93,null));};exports[_0xedbf('0x52')]=function(_0x3129a0,_0xe019df){var _0x2a6955={'raw':![],'where':{'id':_0x3129a0[_0xedbf('0x53')]['id']}},_0x22a94e={};_0x22a94e[_0xedbf('0x3e')]=_[_0xedbf('0x40')](db['ZohoAccount'][_0xedbf('0x54')]);_0x22a94e[_0xedbf('0x3f')]=_[_0xedbf('0x40')](_0x3129a0[_0xedbf('0x3f')]);_0x22a94e['filters']=_[_0xedbf('0x43')](_0x22a94e[_0xedbf('0x3e')],_0x22a94e[_0xedbf('0x3f')]);_0x2a6955[_0xedbf('0x42')]=_['intersection'](_0x22a94e[_0xedbf('0x3e')],qs['fields'](_0x3129a0[_0xedbf('0x3f')][_0xedbf('0x44')]));_0x2a6955[_0xedbf('0x42')]=_0x2a6955[_0xedbf('0x42')][_0xedbf('0x45')]?_0x2a6955[_0xedbf('0x42')]:_0x22a94e[_0xedbf('0x3e')];if(_0x3129a0[_0xedbf('0x3f')][_0xedbf('0x55')]){_0x2a6955[_0xedbf('0x4e')]=[{'all':!![]}];}_0x2a6955=_[_0xedbf('0x4b')]({},_0x2a6955,_0x3129a0[_0xedbf('0x56')]);return db[_0xedbf('0x3b')][_0xedbf('0x57')](_0x2a6955)[_0xedbf('0x22')](handleEntityNotFound(_0xe019df,null))[_0xedbf('0x22')](respondWithResult(_0xe019df,null))['catch'](handleError(_0xe019df,null));};exports['create']=function(_0x4deddf,_0x5fb0cc){return db[_0xedbf('0x3b')][_0xedbf('0x58')](_0x4deddf[_0xedbf('0x59')],{})[_0xedbf('0x22')](respondWithResult(_0x5fb0cc,0xc9))[_0xedbf('0x51')](handleError(_0x5fb0cc,null));};exports['update']=function(_0x6a79c5,_0x4c0cc5){if(_0x6a79c5[_0xedbf('0x59')]['id']){delete _0x6a79c5['body']['id'];}return db[_0xedbf('0x3b')][_0xedbf('0x57')]({'where':{'id':_0x6a79c5[_0xedbf('0x53')]['id']}})[_0xedbf('0x22')](handleEntityNotFound(_0x4c0cc5,null))['then'](saveUpdates(_0x6a79c5['body'],null))[_0xedbf('0x22')](respondWithResult(_0x4c0cc5,null))[_0xedbf('0x51')](handleError(_0x4c0cc5,null));};exports[_0xedbf('0x37')]=function(_0x555ab7,_0x4fc88e){return db[_0xedbf('0x3b')]['find']({'where':{'id':_0x555ab7[_0xedbf('0x53')]['id']}})[_0xedbf('0x22')](handleEntityNotFound(_0x4fc88e,null))[_0xedbf('0x22')](removeEntity(_0x4fc88e,null))['catch'](handleError(_0x4fc88e,null));};exports[_0xedbf('0x5a')]=function(_0x8837fa,_0x20a722,_0x2bb90b){var _0x400dbb={};var _0x275db4={};var _0x10bd29;var _0x5a878a;return db[_0xedbf('0x3b')][_0xedbf('0x5b')]({'where':{'id':_0x8837fa[_0xedbf('0x53')]['id']}})[_0xedbf('0x22')](handleEntityNotFound(_0x20a722,null))[_0xedbf('0x22')](function(_0x3fcbea){if(_0x3fcbea){_0x10bd29=_0x3fcbea;_0x275db4[_0xedbf('0x3e')]=_[_0xedbf('0x40')](db['ZohoConfiguration']['rawAttributes']);_0x275db4['query']=_[_0xedbf('0x40')](_0x8837fa[_0xedbf('0x3f')]);_0x275db4['filters']=_['intersection'](_0x275db4['model'],_0x275db4[_0xedbf('0x3f')]);_0x400dbb[_0xedbf('0x42')]=_[_0xedbf('0x43')](_0x275db4[_0xedbf('0x3e')],qs[_0xedbf('0x44')](_0x8837fa[_0xedbf('0x3f')]['fields']));_0x400dbb['attributes']=_0x400dbb[_0xedbf('0x42')]['length']?_0x400dbb[_0xedbf('0x42')]:_0x275db4[_0xedbf('0x3e')];_0x400dbb[_0xedbf('0x48')]=qs[_0xedbf('0x49')](_0x8837fa[_0xedbf('0x3f')][_0xedbf('0x49')]);_0x400dbb[_0xedbf('0x4c')]=qs[_0xedbf('0x41')](_[_0xedbf('0x4a')](_0x8837fa['query'],_0x275db4[_0xedbf('0x41')]));if(_0x8837fa[_0xedbf('0x3f')][_0xedbf('0x5c')]){_0x400dbb[_0xedbf('0x4c')]=_[_0xedbf('0x4b')](_0x400dbb[_0xedbf('0x4c')],{'$or':_[_0xedbf('0x3a')](_0x400dbb[_0xedbf('0x42')],function(_0x37ff60){var _0x31c15a={};_0x31c15a[_0x37ff60]={'$like':'%'+_0x8837fa['query']['filter']+'%'};return _0x31c15a;})});}_0x400dbb=_[_0xedbf('0x4b')]({},_0x400dbb,_0x8837fa['options']);return _0x10bd29[_0xedbf('0x5a')](_0x400dbb);}})['then'](function(_0xf251e8){if(_0xf251e8){_0x5a878a=_0xf251e8[_0xedbf('0x45')];if(!_0x8837fa[_0xedbf('0x3f')][_0xedbf('0x5d')](_0xedbf('0x46'))){_0x400dbb[_0xedbf('0x47')]=qs[_0xedbf('0x47')](_0x8837fa['query'][_0xedbf('0x47')]);_0x400dbb[_0xedbf('0x32')]=qs[_0xedbf('0x32')](_0x8837fa['query']['offset']);}return _0x10bd29[_0xedbf('0x5a')](_0x400dbb);}})[_0xedbf('0x22')](function(_0x3a0f75){if(_0x3a0f75){return _0x3a0f75?{'count':_0x5a878a,'rows':_0x3a0f75}:null;}})[_0xedbf('0x22')](respondWithResult(_0x20a722,null))[_0xedbf('0x51')](handleError(_0x20a722,null));};exports[_0xedbf('0x5e')]=function(_0x1776d5,_0x1daf4c,_0x48e2ae){if(_0x1776d5[_0xedbf('0x59')]['id']){delete _0x1776d5['body']['id'];}return db['ZohoAccount'][_0xedbf('0x5b')]({'where':{'id':_0x1776d5['params']['id']}})[_0xedbf('0x22')](handleEntityNotFound(_0x1daf4c,null))[_0xedbf('0x22')](function(_0x5189a7){if(_0x5189a7){_0x1776d5[_0xedbf('0x59')][_0xedbf('0x5f')]=_0x5189a7['id'];_0x1776d5[_0xedbf('0x59')][_0xedbf('0x60')]=integrations['getSubjects'](_0x1776d5[_0xedbf('0x59')][_0xedbf('0x61')],_0x1776d5[_0xedbf('0x59')][_0xedbf('0x3d')]);_0x1776d5[_0xedbf('0x59')]['Descriptions']=integrations[_0xedbf('0x62')](_0x1776d5[_0xedbf('0x59')]['channel'],_0x1776d5[_0xedbf('0x59')][_0xedbf('0x3d')]);return db[_0xedbf('0x63')]['create'](_0x1776d5[_0xedbf('0x59')],{'include':[{'model':db[_0xedbf('0x64')],'as':_0xedbf('0x60')},{'model':db[_0xedbf('0x64')],'as':'Descriptions'}]});}return null;})[_0xedbf('0x22')](respondWithResult(_0x1daf4c,null))[_0xedbf('0x51')](handleError(_0x1daf4c,null));};function getAccessToken(_0x11b061){return new Promise(function(_0xdf98ee,_0xa77af5){var _0x50219a;switch(_0x11b061[_0xedbf('0x65')]){case'US':_0x50219a=_0xedbf('0x66');break;case'AU':_0x50219a=_0xedbf('0x67');break;case'EU':_0x50219a='https://accounts.zoho.eu';break;case'IN':_0x50219a=_0xedbf('0x68');break;case'CN':_0x50219a=_0xedbf('0x69');break;default:_0x50219a=_0xedbf('0x6a');break;}var _0x12f25f={'method':_0xedbf('0x6b'),'uri':_0x50219a+_0xedbf('0x6c'),'qs':{'refresh_token':_0x11b061['refreshToken'],'client_id':_0x11b061[_0xedbf('0x6d')],'client_secret':_0x11b061[_0xedbf('0x6e')],'grant_type':_0xedbf('0x6f')},'json':!![]};return rp(_0x12f25f)[_0xedbf('0x22')](function(_0x3f6e44){if(_0x3f6e44[_0xedbf('0x70')]){_0xdf98ee(_0x3f6e44[_0xedbf('0x70')]);}else{_0xa77af5(_0xedbf('0x71'));}})[_0xedbf('0x51')](function(_0x88bd33){_0xa77af5(_0x88bd33);});});}exports[_0xedbf('0x72')]=function(_0x188136,_0x31c422,_0x25c00e){var _0x21dfd6,_0x195814,_0x28cad4,_0x2ada9c,_0xa0c12d;return db[_0xedbf('0x3b')][_0xedbf('0x5b')]({'where':{'id':_0x188136[_0xedbf('0x53')]['id']},'attributes':['id',_0xedbf('0x73'),_0xedbf('0x65'),_0xedbf('0x6d'),_0xedbf('0x6e'),_0xedbf('0x74'),'code',_0xedbf('0x75')]})[_0xedbf('0x22')](handleEntityNotFound(_0x31c422,null))[_0xedbf('0x22')](function(_0x14984f){_0xa0c12d=_0x14984f;_0x21dfd6=_0xa0c12d[_0xedbf('0x73')];_0x195814=_0x21dfd6===_0xedbf('0x76')?'eu':_0xedbf('0x77');_0x28cad4=_0xa0c12d[_0xedbf('0x74')];var _0x373e37=_0x28cad4[_0xedbf('0x78')](-0x1);if(_0x373e37==='/'||_0x373e37==='\x5c'||_0x373e37===':'){_0x28cad4=_0x28cad4[_0xedbf('0x79')](0x0,_0x28cad4[_0xedbf('0x7a')](_0x373e37));}if(!_0xa0c12d[_0xedbf('0x75')]){throw new Error(_0xedbf('0x7b'));}return getAccessToken(_0xa0c12d);})[_0xedbf('0x22')](function(_0x1c6803){if(_0x1c6803){return rp({'method':_0xedbf('0x7c'),'uri':util[_0xedbf('0x7d')](_0xedbf('0x7e'),_0x195814),'qs':{'module':_0xedbf('0x7f')},'headers':{'Authorization':_0xedbf('0x80')+_0x1c6803},'json':!![]});}})['then'](function(_0x497e34){if(_0x497e34){if(_0x497e34[_0xedbf('0x81')]&&_0x497e34[_0xedbf('0x81')]['error']){throw new Error(_0x497e34[_0xedbf('0x81')]['error'][_0xedbf('0x2b')]);}var _0x1a9acd=[];var _0x2f11e7=[];var _0x4edb1a=[_0xedbf('0x82'),_0xedbf('0x83'),'Description',_0xedbf('0x84'),_0xedbf('0x85'),'Call_Result',_0xedbf('0x86'),_0xedbf('0x87')];_0x2f11e7=_[_0xedbf('0x88')](_0x497e34[_0xedbf('0x44')],function(_0x1f866e){return _0x4edb1a['includes'](_0x1f866e[_0xedbf('0x89')]);});for(var _0x4f00c9=0x0;_0x4f00c9<_0x2f11e7['length'];_0x4f00c9++){if(_0x2f11e7[_0x4f00c9][_0xedbf('0x8a')]===![]){_0x1a9acd[_0xedbf('0x8b')]({'id':_0x2f11e7[_0x4f00c9]['id'],'name':_0x2f11e7[_0x4f00c9]['display_label'],'custom':_0x2f11e7[_0x4f00c9][_0xedbf('0x8c')],'options':_0x2f11e7[_0x4f00c9][_0xedbf('0x8d')]===_0xedbf('0x8e')&&_0x2f11e7[_0x4f00c9][_0xedbf('0x8f')]['length']>-0x1?_[_0xedbf('0x3a')](_0x2f11e7[_0x4f00c9][_0xedbf('0x8f')],function(_0x353ec0){return{'name':_0x353ec0,'value':_0x353ec0};}):[]});}}return{'count':_0x1a9acd[_0xedbf('0x45')],'rows':_0x1a9acd};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithResult(_0x31c422,null))[_0xedbf('0x51')](function(_0x476913){var _0x4639df=_0x188136[_0xedbf('0x3f')][_0xedbf('0x1d')]?0x1f4:_0x476913[_0xedbf('0x90')]||0x1f4;logger['error'](_0xedbf('0x91'),_0xedbf('0x72'),_0x4639df,JSON[_0xedbf('0x28')](_0x476913));delete _0x476913[_0xedbf('0x38')];if(_0x4639df===0x191){_0x4639df=0x190;}_0x31c422[_0xedbf('0x2f')](_0x4639df)['send'](_0x188136[_0xedbf('0x3f')][_0xedbf('0x1d')]?{'message':_0xedbf('0x92'),'statusCode':_0x476913['statusCode']}:_0x476913);});}; \ No newline at end of file +var _0x468f=['Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','custom_field','pick_list_values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','ZohoAccount,\x20%s,\x20%s','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','catch','sendStatus','status','end','json','offset','set','Content-Range','apply','reject','update','stack','name','send','map','ZohoAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','include','findAll','includeAll','find','create','body','params','destroy','findOne','ZohoConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','getDescriptions','channel','https://accounts.zoho.com','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','getFields','host','zone','clientSecret','serverUrl','zoho.eu','com','substring','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','format','Calls','Zoho-oauthtoken\x20','response','Owner','Subject','WhoId','Call_Duration','Call_Result'];(function(_0xb9063d,_0x2cda45){var _0x5befef=function(_0x1cea9b){while(--_0x1cea9b){_0xb9063d['push'](_0xb9063d['shift']());}};_0x5befef(++_0x2cda45);}(_0x468f,0x97));var _0xf468=function(_0x2d9a23,_0x481dc4){_0x2d9a23=_0x2d9a23-0x0;var _0x5198ee=_0x468f[_0x2d9a23];return _0x5198ee;};'use strict';var pdf=require(_0xf468('0x0'));var emlformat=require(_0xf468('0x1'));var rimraf=require(_0xf468('0x2'));var zipdir=require(_0xf468('0x3'));var jsonpatch=require(_0xf468('0x4'));var rp=require(_0xf468('0x5'));var moment=require(_0xf468('0x6'));var BPromise=require(_0xf468('0x7'));var Mustache=require(_0xf468('0x8'));var util=require(_0xf468('0x9'));var path=require(_0xf468('0xa'));var sox=require('sox');var csv=require(_0xf468('0xb'));var ejs=require(_0xf468('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf468('0xd'));var crypto=require('crypto');var jsforce=require(_0xf468('0xe'));var deskjs=require(_0xf468('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf468('0x10'));var Papa=require(_0xf468('0x11'));var Redis=require(_0xf468('0x12'));var authService=require(_0xf468('0x13'));var qs=require(_0xf468('0x14'));var as=require(_0xf468('0x15'));var hardwareService=require(_0xf468('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0xf468('0x17'));var config=require(_0xf468('0x18'));var db=require(_0xf468('0x19'))['db'];var integrations=require(_0xf468('0x1a'));var jayson=require('jayson/promise');var client=jayson[_0xf468('0x1b')][_0xf468('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x2f390b,_0x3d2776,_0x67e935){if(_0x67e935){var _0x2c661c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c661c[_0xf468('0x1d')](_0x3d2776)){return _0x2f390b;}else{throw new db['Sequelize'][(_0xf468('0x1e'))](_0xf468('0x1f'));}}else{return _0x2f390b;}}function respondWithRpcPromise(_0x1d920f,_0x4be1fe,_0x20ec5d,_0x549ee8){return new BPromise(function(_0x4b660e,_0x2e7ea3){var _0x32b4c7=_0x549ee8||client;return _0x32b4c7['request'](_0x1d920f,_0x20ec5d)[_0xf468('0x20')](function(_0x445652){logger['info'](_0xf468('0x21'),_0x4be1fe,'request\x20sent');logger[_0xf468('0x22')](_0xf468('0x23'),_0x4be1fe,_0xf468('0x24'),JSON[_0xf468('0x25')](_0x445652));if(_0x445652['error']){if(_0x445652[_0xf468('0x26')][_0xf468('0x27')]===0x1f4){logger[_0xf468('0x26')](_0xf468('0x21'),_0x4be1fe,_0x445652[_0xf468('0x26')][_0xf468('0x28')]);return _0x2e7ea3(_0x445652['error'][_0xf468('0x28')]);}logger[_0xf468('0x26')](_0xf468('0x21'),_0x4be1fe,_0x445652[_0xf468('0x26')][_0xf468('0x28')]);return _0x4b660e(_0x445652[_0xf468('0x26')][_0xf468('0x28')]);}else{logger[_0xf468('0x29')](_0xf468('0x21'),_0x4be1fe,_0xf468('0x24'));_0x4b660e(_0x445652['result'][_0xf468('0x28')]);}})[_0xf468('0x2a')](function(_0x2b875a){logger['error']('ZohoAccount,\x20%s,\x20%s',_0x4be1fe,_0x2b875a);_0x2e7ea3(_0x2b875a);});});}function respondWithStatusCode(_0x546f5b,_0x143cb5){_0x143cb5=_0x143cb5||0xcc;return function(_0x1c925e){if(_0x1c925e){return _0x546f5b[_0xf468('0x2b')](_0x143cb5);}return _0x546f5b[_0xf468('0x2c')](_0x143cb5)[_0xf468('0x2d')]();};}function respondWithResult(_0x5b5d50,_0x42120e){_0x42120e=_0x42120e||0xc8;return function(_0x514c1e){if(_0x514c1e){return _0x5b5d50[_0xf468('0x2c')](_0x42120e)[_0xf468('0x2e')](_0x514c1e);}};}function respondWithFilteredResult(_0x47df10,_0x3704d2){return function(_0x353ac8){if(_0x353ac8){var _0x36eb50=_0x353ac8['count'],_0x57b38f=_0x3704d2[_0xf468('0x2f')],_0x2a9933=_0x3704d2[_0xf468('0x2f')]+_0x3704d2['limit'],_0xc357e1;if(_0x2a9933>=_0x36eb50){_0x2a9933=_0x36eb50;_0xc357e1=0xc8;}else{_0xc357e1=0xce;}_0x47df10['status'](_0xc357e1);return _0x47df10[_0xf468('0x30')](_0xf468('0x31'),_0x57b38f+'-'+_0x2a9933+'/'+_0x36eb50)['json'](_0x353ac8);}return null;};}function patchUpdates(_0x57d571){return function(_0x3eae37){try{jsonpatch[_0xf468('0x32')](_0x3eae37,_0x57d571,!![]);}catch(_0x435eb7){return BPromise[_0xf468('0x33')](_0x435eb7);}return _0x3eae37['save']();};}function saveUpdates(_0x18a0c8,_0x5e1c1a){return function(_0x4ee37c){if(_0x4ee37c){return _0x4ee37c[_0xf468('0x34')](_0x18a0c8)[_0xf468('0x20')](function(_0x5d1d0a){return _0x5d1d0a;});}return null;};}function removeEntity(_0x1167a0,_0x5617e0){return function(_0x2e9c35){if(_0x2e9c35){return _0x2e9c35['destroy']()[_0xf468('0x20')](function(){_0x1167a0['status'](0xcc)[_0xf468('0x2d')]();});}};}function handleEntityNotFound(_0x44e455,_0x190e11){return function(_0x180a79){if(!_0x180a79){_0x44e455[_0xf468('0x2b')](0x194);}return _0x180a79;};}function handleError(_0x5a7398,_0x362491){_0x362491=_0x362491||0x1f4;return function(_0x357326){logger[_0xf468('0x26')](_0x357326[_0xf468('0x35')]);if(_0x357326[_0xf468('0x36')]){delete _0x357326[_0xf468('0x36')];}_0x5a7398[_0xf468('0x2c')](_0x362491)[_0xf468('0x37')](_0x357326);};}exports['index']=function(_0x20fe33,_0x295894){var _0x1fb65d={},_0xf598f={},_0x54d7cc={'count':0x0,'rows':[]};var _0x305912=_[_0xf468('0x38')](db[_0xf468('0x39')][_0xf468('0x3a')],function(_0x15c41e){return{'name':_0x15c41e[_0xf468('0x3b')],'type':_0x15c41e[_0xf468('0x3c')][_0xf468('0x3d')]};});_0xf598f[_0xf468('0x3e')]=_[_0xf468('0x38')](_0x305912,_0xf468('0x36'));_0xf598f[_0xf468('0x3f')]=_[_0xf468('0x40')](_0x20fe33[_0xf468('0x3f')]);_0xf598f[_0xf468('0x41')]=_[_0xf468('0x42')](_0xf598f[_0xf468('0x3e')],_0xf598f['query']);_0x1fb65d['attributes']=_['intersection'](_0xf598f[_0xf468('0x3e')],qs['fields'](_0x20fe33[_0xf468('0x3f')][_0xf468('0x43')]));_0x1fb65d[_0xf468('0x44')]=_0x1fb65d[_0xf468('0x44')][_0xf468('0x45')]?_0x1fb65d[_0xf468('0x44')]:_0xf598f['model'];if(!_0x20fe33[_0xf468('0x3f')][_0xf468('0x46')](_0xf468('0x47'))){_0x1fb65d[_0xf468('0x48')]=qs[_0xf468('0x48')](_0x20fe33['query']['limit']);_0x1fb65d[_0xf468('0x2f')]=qs[_0xf468('0x2f')](_0x20fe33[_0xf468('0x3f')]['offset']);}_0x1fb65d[_0xf468('0x49')]=qs['sort'](_0x20fe33[_0xf468('0x3f')][_0xf468('0x4a')]);_0x1fb65d[_0xf468('0x4b')]=qs[_0xf468('0x41')](_[_0xf468('0x4c')](_0x20fe33[_0xf468('0x3f')],_0xf598f[_0xf468('0x41')]));if(_0x20fe33['query'][_0xf468('0x4d')]){_0x1fb65d[_0xf468('0x4b')]=_['merge'](_0x1fb65d['where'],{'$or':_[_0xf468('0x38')](_0x305912,function(_0x77364e){if(_0x77364e[_0xf468('0x3c')]!=='VIRTUAL'){var _0x4f17f8={};_0x4f17f8[_0x77364e['name']]={'$like':'%'+_0x20fe33[_0xf468('0x3f')][_0xf468('0x4d')]+'%'};return _0x4f17f8;}})});}_0x1fb65d=_[_0xf468('0x4e')]({},_0x1fb65d,_0x20fe33[_0xf468('0x4f')]);var _0x42db56={'where':_0x1fb65d[_0xf468('0x4b')]};return db[_0xf468('0x39')][_0xf468('0x50')](_0x42db56)[_0xf468('0x20')](function(_0x582b30){_0x54d7cc['count']=_0x582b30;if(_0x20fe33[_0xf468('0x3f')]['includeAll']){_0x1fb65d[_0xf468('0x51')]=[{'all':!![]}];}return db['ZohoAccount'][_0xf468('0x52')](_0x1fb65d);})[_0xf468('0x20')](function(_0x470e2f){_0x54d7cc['rows']=_0x470e2f;return _0x54d7cc;})['then'](respondWithFilteredResult(_0x295894,_0x1fb65d))[_0xf468('0x2a')](handleError(_0x295894,null));};exports['show']=function(_0x3d38a4,_0x5f43d5){var _0x4c454d={'raw':![],'where':{'id':_0x3d38a4['params']['id']}},_0x1417bc={};_0x1417bc[_0xf468('0x3e')]=_[_0xf468('0x40')](db['ZohoAccount'][_0xf468('0x3a')]);_0x1417bc[_0xf468('0x3f')]=_[_0xf468('0x40')](_0x3d38a4[_0xf468('0x3f')]);_0x1417bc[_0xf468('0x41')]=_[_0xf468('0x42')](_0x1417bc['model'],_0x1417bc[_0xf468('0x3f')]);_0x4c454d[_0xf468('0x44')]=_[_0xf468('0x42')](_0x1417bc[_0xf468('0x3e')],qs[_0xf468('0x43')](_0x3d38a4['query'][_0xf468('0x43')]));_0x4c454d[_0xf468('0x44')]=_0x4c454d[_0xf468('0x44')][_0xf468('0x45')]?_0x4c454d[_0xf468('0x44')]:_0x1417bc[_0xf468('0x3e')];if(_0x3d38a4['query'][_0xf468('0x53')]){_0x4c454d[_0xf468('0x51')]=[{'all':!![]}];}_0x4c454d=_['merge']({},_0x4c454d,_0x3d38a4[_0xf468('0x4f')]);return db['ZohoAccount'][_0xf468('0x54')](_0x4c454d)[_0xf468('0x20')](handleEntityNotFound(_0x5f43d5,null))[_0xf468('0x20')](respondWithResult(_0x5f43d5,null))[_0xf468('0x2a')](handleError(_0x5f43d5,null));};exports[_0xf468('0x55')]=function(_0x762002,_0x69058){return db[_0xf468('0x39')][_0xf468('0x55')](_0x762002[_0xf468('0x56')],{})[_0xf468('0x20')](respondWithResult(_0x69058,0xc9))['catch'](handleError(_0x69058,null));};exports[_0xf468('0x34')]=function(_0x2338dd,_0x19bb02){if(_0x2338dd[_0xf468('0x56')]['id']){delete _0x2338dd[_0xf468('0x56')]['id'];}return db[_0xf468('0x39')][_0xf468('0x54')]({'where':{'id':_0x2338dd[_0xf468('0x57')]['id']}})[_0xf468('0x20')](handleEntityNotFound(_0x19bb02,null))['then'](saveUpdates(_0x2338dd[_0xf468('0x56')],null))[_0xf468('0x20')](respondWithResult(_0x19bb02,null))[_0xf468('0x2a')](handleError(_0x19bb02,null));};exports[_0xf468('0x58')]=function(_0x52b4f4,_0x942470){return db[_0xf468('0x39')]['find']({'where':{'id':_0x52b4f4[_0xf468('0x57')]['id']}})[_0xf468('0x20')](handleEntityNotFound(_0x942470,null))['then'](removeEntity(_0x942470,null))[_0xf468('0x2a')](handleError(_0x942470,null));};exports['getConfigurations']=function(_0x4c6cac,_0x5bcf78,_0x4e1824){var _0x100428={};var _0x5172fc={};var _0x92f5b3;var _0xdb7e2f;return db[_0xf468('0x39')][_0xf468('0x59')]({'where':{'id':_0x4c6cac[_0xf468('0x57')]['id']}})[_0xf468('0x20')](handleEntityNotFound(_0x5bcf78,null))['then'](function(_0x3173f2){if(_0x3173f2){_0x92f5b3=_0x3173f2;_0x5172fc[_0xf468('0x3e')]=_['keys'](db[_0xf468('0x5a')][_0xf468('0x3a')]);_0x5172fc['query']=_[_0xf468('0x40')](_0x4c6cac[_0xf468('0x3f')]);_0x5172fc[_0xf468('0x41')]=_[_0xf468('0x42')](_0x5172fc[_0xf468('0x3e')],_0x5172fc['query']);_0x100428[_0xf468('0x44')]=_['intersection'](_0x5172fc[_0xf468('0x3e')],qs[_0xf468('0x43')](_0x4c6cac[_0xf468('0x3f')][_0xf468('0x43')]));_0x100428[_0xf468('0x44')]=_0x100428[_0xf468('0x44')]['length']?_0x100428[_0xf468('0x44')]:_0x5172fc['model'];_0x100428[_0xf468('0x49')]=qs['sort'](_0x4c6cac[_0xf468('0x3f')][_0xf468('0x4a')]);_0x100428[_0xf468('0x4b')]=qs[_0xf468('0x41')](_['pick'](_0x4c6cac[_0xf468('0x3f')],_0x5172fc[_0xf468('0x41')]));if(_0x4c6cac[_0xf468('0x3f')][_0xf468('0x4d')]){_0x100428[_0xf468('0x4b')]=_[_0xf468('0x4e')](_0x100428[_0xf468('0x4b')],{'$or':_[_0xf468('0x38')](_0x100428[_0xf468('0x44')],function(_0x5b3d22){var _0x2fcb78={};_0x2fcb78[_0x5b3d22]={'$like':'%'+_0x4c6cac['query']['filter']+'%'};return _0x2fcb78;})});}_0x100428=_[_0xf468('0x4e')]({},_0x100428,_0x4c6cac[_0xf468('0x4f')]);return _0x92f5b3[_0xf468('0x5b')](_0x100428);}})['then'](function(_0x4e5c4c){if(_0x4e5c4c){_0xdb7e2f=_0x4e5c4c[_0xf468('0x45')];if(!_0x4c6cac[_0xf468('0x3f')]['hasOwnProperty'](_0xf468('0x47'))){_0x100428['limit']=qs[_0xf468('0x48')](_0x4c6cac[_0xf468('0x3f')]['limit']);_0x100428[_0xf468('0x2f')]=qs['offset'](_0x4c6cac[_0xf468('0x3f')][_0xf468('0x2f')]);}return _0x92f5b3[_0xf468('0x5b')](_0x100428);}})[_0xf468('0x20')](function(_0x275ecb){if(_0x275ecb){return _0x275ecb?{'count':_0xdb7e2f,'rows':_0x275ecb}:null;}})[_0xf468('0x20')](respondWithResult(_0x5bcf78,null))[_0xf468('0x2a')](handleError(_0x5bcf78,null));};exports[_0xf468('0x5c')]=function(_0x1d0afe,_0x217e8f,_0x1ccee6){if(_0x1d0afe[_0xf468('0x56')]['id']){delete _0x1d0afe[_0xf468('0x56')]['id'];}return db[_0xf468('0x39')][_0xf468('0x59')]({'where':{'id':_0x1d0afe[_0xf468('0x57')]['id']}})[_0xf468('0x20')](handleEntityNotFound(_0x217e8f,null))[_0xf468('0x20')](function(_0x415260){if(_0x415260){_0x1d0afe[_0xf468('0x56')][_0xf468('0x5d')]=_0x415260['id'];_0x1d0afe[_0xf468('0x56')][_0xf468('0x5e')]=integrations[_0xf468('0x5f')](_0x1d0afe[_0xf468('0x56')]['channel'],_0x1d0afe[_0xf468('0x56')]['type']);_0x1d0afe[_0xf468('0x56')][_0xf468('0x60')]=integrations[_0xf468('0x61')](_0x1d0afe[_0xf468('0x56')][_0xf468('0x62')],_0x1d0afe[_0xf468('0x56')][_0xf468('0x3c')]);return db[_0xf468('0x5a')][_0xf468('0x55')](_0x1d0afe[_0xf468('0x56')],{'include':[{'model':db['ZohoField'],'as':'Subjects'},{'model':db['ZohoField'],'as':_0xf468('0x60')}]});}return null;})['then'](respondWithResult(_0x217e8f,null))[_0xf468('0x2a')](handleError(_0x217e8f,null));};function getAccessToken(_0x567498){return new Promise(function(_0xc5a802,_0x5c2daf){var _0x472217;switch(_0x567498['zone']){case'US':_0x472217=_0xf468('0x63');break;case'AU':_0x472217='https://accounts.zoho.com.au';break;case'EU':_0x472217=_0xf468('0x64');break;case'IN':_0x472217=_0xf468('0x65');break;case'CN':_0x472217=_0xf468('0x66');break;default:_0x472217='https://accounts.zoho.eu';break;}var _0x5266e0={'method':'POST','uri':_0x472217+_0xf468('0x67'),'qs':{'refresh_token':_0x567498[_0xf468('0x68')],'client_id':_0x567498[_0xf468('0x69')],'client_secret':_0x567498['clientSecret'],'grant_type':_0xf468('0x6a')},'json':!![]};return rp(_0x5266e0)[_0xf468('0x20')](function(_0x4616b9){if(_0x4616b9[_0xf468('0x6b')]){_0xc5a802(_0x4616b9[_0xf468('0x6b')]);}else{_0x5c2daf(_0xf468('0x6c'));}})[_0xf468('0x2a')](function(_0x41e249){_0x5c2daf(_0x41e249);});});}exports[_0xf468('0x6d')]=function(_0x84605c,_0x148fa0,_0x32a5ea){var _0x26f81b,_0xa72e1a,_0xe8367b,_0x14c5f6,_0x2c5cc7;return db[_0xf468('0x39')][_0xf468('0x59')]({'where':{'id':_0x84605c[_0xf468('0x57')]['id']},'attributes':['id',_0xf468('0x6e'),_0xf468('0x6f'),'clientId',_0xf468('0x70'),_0xf468('0x71'),_0xf468('0x27'),_0xf468('0x68')]})[_0xf468('0x20')](handleEntityNotFound(_0x148fa0,null))[_0xf468('0x20')](function(_0x404026){_0x2c5cc7=_0x404026;_0x26f81b=_0x2c5cc7[_0xf468('0x6e')];_0xa72e1a=_0x26f81b===_0xf468('0x72')?'eu':_0xf468('0x73');_0xe8367b=_0x2c5cc7[_0xf468('0x71')];var _0x349599=_0xe8367b['slice'](-0x1);if(_0x349599==='/'||_0x349599==='\x5c'||_0x349599===':'){_0xe8367b=_0xe8367b[_0xf468('0x74')](0x0,_0xe8367b['lastIndexOf'](_0x349599));}if(!_0x2c5cc7[_0xf468('0x68')]){throw new Error(_0xf468('0x75'));}return getAccessToken(_0x2c5cc7);})[_0xf468('0x20')](function(_0x21ed64){if(_0x21ed64){return rp({'method':'GET','uri':util[_0xf468('0x76')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0xa72e1a),'qs':{'module':_0xf468('0x77')},'headers':{'Authorization':_0xf468('0x78')+_0x21ed64},'json':!![]});}})['then'](function(_0x2eb154){if(_0x2eb154){if(_0x2eb154['response']&&_0x2eb154[_0xf468('0x79')][_0xf468('0x26')]){throw new Error(_0x2eb154['response'][_0xf468('0x26')][_0xf468('0x28')]);}var _0x207f00=[];var _0x5d452f=[];var _0x46f372=[_0xf468('0x7a'),_0xf468('0x7b'),'Description',_0xf468('0x7c'),_0xf468('0x7d'),_0xf468('0x7e'),_0xf468('0x7f'),_0xf468('0x80')];_0x5d452f=_[_0xf468('0x81')](_0x2eb154[_0xf468('0x43')],function(_0x2ad7e1){return _0x46f372[_0xf468('0x82')](_0x2ad7e1[_0xf468('0x83')]);});for(var _0x50f4f3=0x0;_0x50f4f3<_0x5d452f[_0xf468('0x45')];_0x50f4f3++){if(_0x5d452f[_0x50f4f3][_0xf468('0x84')]===![]){_0x207f00[_0xf468('0x85')]({'id':_0x5d452f[_0x50f4f3]['id'],'name':_0x5d452f[_0x50f4f3]['display_label'],'custom':_0x5d452f[_0x50f4f3][_0xf468('0x86')],'options':_0x5d452f[_0x50f4f3]['data_type']==='picklist'&&_0x5d452f[_0x50f4f3][_0xf468('0x87')][_0xf468('0x45')]>-0x1?_[_0xf468('0x38')](_0x5d452f[_0x50f4f3][_0xf468('0x87')],function(_0x584f88){return{'name':_0x584f88,'value':_0x584f88};}):[]});}}return{'count':_0x207f00['length'],'rows':_0x207f00};}else{return{'count':0x0,'rows':[]};}})[_0xf468('0x20')](respondWithResult(_0x148fa0,null))['catch'](function(_0x58c146){var _0x4a9c70=_0x84605c[_0xf468('0x3f')]['test']?0x1f4:_0x58c146[_0xf468('0x88')]||0x1f4;logger[_0xf468('0x26')](_0xf468('0x89'),'getFields',_0x4a9c70,JSON[_0xf468('0x25')](_0x58c146));delete _0x58c146['name'];if(_0x4a9c70===0x191){_0x4a9c70=0x190;}_0x148fa0[_0xf468('0x2c')](_0x4a9c70)[_0xf468('0x37')](_0x84605c['query'][_0xf468('0x1d')]?{'message':_0xf468('0x8a'),'statusCode':_0x58c146[_0xf468('0x88')]}:_0x58c146);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index 58d0ccf..01b2797 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 _0x8e7a=['path','../../config/environment','../../components/integrations/configuration','exports','define','int_zoho_accounts','changed','clientId','code','host','slice','substring','zone','https://accounts.zoho.com','https://accounts.zoho.in','https://accounts.zoho.eu','POST','/oauth/v2/token','clientSecret','serverUrl','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','name','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','inspect','catch','https://accounts.zoho.com.au','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','lodash','../../config/logger','api','bluebird'];(function(_0x5e8386,_0x3634fd){var _0x2a3dff=function(_0x50fe04){while(--_0x50fe04){_0x5e8386['push'](_0x5e8386['shift']());}};_0x2a3dff(++_0x3634fd);}(_0x8e7a,0x152));var _0xa8e7=function(_0x2c319f,_0x52bb13){_0x2c319f=_0x2c319f-0x0;var _0x11a6a6=_0x8e7a[_0x2c319f];return _0x11a6a6;};'use strict';var _=require(_0xa8e7('0x0'));var util=require('util');var logger=require(_0xa8e7('0x1'))(_0xa8e7('0x2'));var moment=require('moment');var BPromise=require(_0xa8e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa8e7('0x4'));var rimraf=require('rimraf');var config=require(_0xa8e7('0x5'));var attributes=require('./intZohoAccount.attributes');var integrations=require(_0xa8e7('0x6'));module[_0xa8e7('0x7')]=function(_0x31b317,_0x52ac9e){return _0x31b317[_0xa8e7('0x8')]('ZohoAccount',attributes,{'tableName':_0xa8e7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x177ca3,_0x3ccb56,_0x497a23){if(_0x177ca3[_0xa8e7('0xa')]('zone')||_0x177ca3[_0xa8e7('0xa')]('serverUrl')||_0x177ca3[_0xa8e7('0xa')](_0xa8e7('0xb'))||_0x177ca3['changed']('clientSecret')||_0x177ca3['changed'](_0xa8e7('0xc'))||_0x177ca3[_0xa8e7('0xa')](_0xa8e7('0xd'))){var _0x2e47aa,_0x5c4cd9;_0x2e47aa=_0x177ca3['serverUrl'];var _0x4ad6f5=_0x2e47aa[_0xa8e7('0xe')](-0x1);if(_0x4ad6f5==='/'||_0x4ad6f5==='\x5c'||_0x4ad6f5===':'){_0x2e47aa=_0x2e47aa[_0xa8e7('0xf')](0x0,_0x2e47aa['lastIndexOf'](_0x4ad6f5));}switch(_0x177ca3[_0xa8e7('0x10')]){case'US':_0x5c4cd9=_0xa8e7('0x11');break;case'AU':_0x5c4cd9='https://accounts.zoho.com.au';break;case'IN':_0x5c4cd9=_0xa8e7('0x12');break;case'CN':_0x5c4cd9='https://accounts.zoho.com.cn';break;default:_0x5c4cd9=_0xa8e7('0x13');break;}var _0xfcabb8={'method':_0xa8e7('0x14'),'uri':_0x5c4cd9+_0xa8e7('0x15'),'form':{'grant_type':'authorization_code','client_id':_0x177ca3[_0xa8e7('0xb')],'client_secret':_0x177ca3[_0xa8e7('0x16')],'redirect_uri':_0x177ca3[_0xa8e7('0x17')],'code':_0x177ca3[_0xa8e7('0xc')]},'headers':{'Content-Type':_0xa8e7('0x18')}};return rp(_0xfcabb8)[_0xa8e7('0x19')](function(_0x3eb09b){var _0x1ca1e5=JSON[_0xa8e7('0x1a')](_0x3eb09b);if(_0x1ca1e5[_0xa8e7('0x1b')]){_0x177ca3[_0xa8e7('0x1c')]=_0x1ca1e5['refresh_token'];logger[_0xa8e7('0x1d')](util[_0xa8e7('0x1e')]('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x177ca3[_0xa8e7('0x1f')],_0x177ca3['id']));}else{logger[_0xa8e7('0x20')](util[_0xa8e7('0x1e')](_0xa8e7('0x21'),_0x177ca3[_0xa8e7('0x1f')],_0x177ca3['id']),util[_0xa8e7('0x22')](_0x1ca1e5,{'showHidden':![],'depth':null}));}return _0x497a23(null,_0x3ccb56);})[_0xa8e7('0x23')](function(_0x5e8a38){logger[_0xa8e7('0x20')](util[_0xa8e7('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x177ca3[_0xa8e7('0x1f')],_0x177ca3['id']),util['inspect'](parsedResult,{'showHidden':![],'depth':null}));return _0x497a23(_0x5e8a38);});}else{return _0x497a23(null,_0x3ccb56);}},'beforeUpdate':function(_0x5033b4,_0x55f0eb,_0x3445ab){if(_0x5033b4[_0xa8e7('0xa')](_0xa8e7('0x10'))||_0x5033b4[_0xa8e7('0xa')](_0xa8e7('0x17'))||_0x5033b4[_0xa8e7('0xa')](_0xa8e7('0xb'))||_0x5033b4[_0xa8e7('0xa')](_0xa8e7('0x16'))||_0x5033b4['changed'](_0xa8e7('0xc'))||_0x5033b4[_0xa8e7('0xa')](_0xa8e7('0xd'))){var _0x574253,_0x38b12c;_0x574253=_0x5033b4['serverUrl'];var _0x559e80=_0x574253[_0xa8e7('0xe')](-0x1);if(_0x559e80==='/'||_0x559e80==='\x5c'||_0x559e80===':'){_0x574253=_0x574253['substring'](0x0,_0x574253['lastIndexOf'](_0x559e80));}switch(_0x5033b4['zone']){case'US':_0x38b12c=_0xa8e7('0x11');break;case'AU':_0x38b12c=_0xa8e7('0x24');break;case'IN':_0x38b12c=_0xa8e7('0x12');break;case'CN':_0x38b12c='https://accounts.zoho.com.cn';break;default:_0x38b12c=_0xa8e7('0x13');break;}var _0x4585fb={'method':_0xa8e7('0x14'),'uri':_0x38b12c+_0xa8e7('0x15'),'form':{'grant_type':'authorization_code','client_id':_0x5033b4[_0xa8e7('0xb')],'client_secret':_0x5033b4[_0xa8e7('0x16')],'redirect_uri':_0x5033b4[_0xa8e7('0x17')],'code':_0x5033b4[_0xa8e7('0xc')]},'headers':{'Content-Type':_0xa8e7('0x18')}};return rp(_0x4585fb)['then'](function(_0x282857){var _0x1ff3b0=JSON[_0xa8e7('0x1a')](_0x282857);if(_0x1ff3b0[_0xa8e7('0x1b')]){_0x5033b4[_0xa8e7('0x1c')]=_0x1ff3b0[_0xa8e7('0x1b')];logger[_0xa8e7('0x1d')](util[_0xa8e7('0x1e')](_0xa8e7('0x25'),_0x5033b4[_0xa8e7('0x1f')],_0x5033b4['id']));}else{logger['error'](util[_0xa8e7('0x1e')](_0xa8e7('0x21'),_0x5033b4['name'],_0x5033b4['id']),util[_0xa8e7('0x22')](_0x1ff3b0,{'showHidden':![],'depth':null}));}return _0x3445ab(null,_0x55f0eb);})[_0xa8e7('0x23')](function(_0x41f2c0){logger[_0xa8e7('0x20')](util[_0xa8e7('0x1e')](_0xa8e7('0x21'),_0x5033b4[_0xa8e7('0x1f')],_0x5033b4['id']),util[_0xa8e7('0x22')](parsedResult,{'showHidden':![],'depth':null}));return _0x3445ab(_0x41f2c0);});}else{return _0x3445ab(null,_0x55f0eb);}}}});}; \ No newline at end of file +var _0x7ff3=['substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.in','POST','/oauth/v2/token','clientId','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','info','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','error','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','inspect','https://accounts.zoho.eu','authorization_code','catch','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','zone','changed','serverUrl','clientSecret','code','host','slice'];(function(_0xc6f89b,_0x1ae823){var _0x39d35c=function(_0x5d1b23){while(--_0x5d1b23){_0xc6f89b['push'](_0xc6f89b['shift']());}};_0x39d35c(++_0x1ae823);}(_0x7ff3,0xf8));var _0x37ff=function(_0x2742db,_0x58e00c){_0x2742db=_0x2742db-0x0;var _0x18659e=_0x7ff3[_0x2742db];return _0x18659e;};'use strict';var _=require(_0x37ff('0x0'));var util=require(_0x37ff('0x1'));var logger=require(_0x37ff('0x2'))(_0x37ff('0x3'));var moment=require('moment');var BPromise=require(_0x37ff('0x4'));var rp=require(_0x37ff('0x5'));var fs=require('fs');var path=require(_0x37ff('0x6'));var rimraf=require(_0x37ff('0x7'));var config=require(_0x37ff('0x8'));var attributes=require(_0x37ff('0x9'));var integrations=require(_0x37ff('0xa'));module[_0x37ff('0xb')]=function(_0xf4bedc,_0x6178be){return _0xf4bedc[_0x37ff('0xc')](_0x37ff('0xd'),attributes,{'tableName':_0x37ff('0xe'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x21c309,_0x39682d,_0x1a90eb){if(_0x21c309['changed'](_0x37ff('0xf'))||_0x21c309[_0x37ff('0x10')](_0x37ff('0x11'))||_0x21c309[_0x37ff('0x10')]('clientId')||_0x21c309[_0x37ff('0x10')](_0x37ff('0x12'))||_0x21c309[_0x37ff('0x10')](_0x37ff('0x13'))||_0x21c309[_0x37ff('0x10')](_0x37ff('0x14'))){var _0x557ade,_0x58a957;_0x557ade=_0x21c309[_0x37ff('0x11')];var _0x38c551=_0x557ade[_0x37ff('0x15')](-0x1);if(_0x38c551==='/'||_0x38c551==='\x5c'||_0x38c551===':'){_0x557ade=_0x557ade[_0x37ff('0x16')](0x0,_0x557ade[_0x37ff('0x17')](_0x38c551));}switch(_0x21c309[_0x37ff('0xf')]){case'US':_0x58a957=_0x37ff('0x18');break;case'AU':_0x58a957=_0x37ff('0x19');break;case'IN':_0x58a957=_0x37ff('0x1a');break;case'CN':_0x58a957='https://accounts.zoho.com.cn';break;default:_0x58a957='https://accounts.zoho.eu';break;}var _0x5c7a9b={'method':_0x37ff('0x1b'),'uri':_0x58a957+_0x37ff('0x1c'),'form':{'grant_type':'authorization_code','client_id':_0x21c309[_0x37ff('0x1d')],'client_secret':_0x21c309[_0x37ff('0x12')],'redirect_uri':_0x21c309['serverUrl'],'code':_0x21c309[_0x37ff('0x13')]},'headers':{'Content-Type':_0x37ff('0x1e')}};return rp(_0x5c7a9b)[_0x37ff('0x1f')](function(_0x6ff767){var _0x5b8a4b=JSON[_0x37ff('0x20')](_0x6ff767);if(_0x5b8a4b[_0x37ff('0x21')]){_0x21c309[_0x37ff('0x22')]=_0x5b8a4b[_0x37ff('0x21')];logger[_0x37ff('0x23')](util[_0x37ff('0x24')](_0x37ff('0x25'),_0x21c309['name'],_0x21c309['id']));}else{logger[_0x37ff('0x26')](util[_0x37ff('0x24')](_0x37ff('0x27'),_0x21c309[_0x37ff('0x28')],_0x21c309['id']),util[_0x37ff('0x29')](_0x5b8a4b,{'showHidden':![],'depth':null}));}return _0x1a90eb(null,_0x39682d);})['catch'](function(_0x33553f){logger[_0x37ff('0x26')](util[_0x37ff('0x24')](_0x37ff('0x27'),_0x21c309[_0x37ff('0x28')],_0x21c309['id']),util[_0x37ff('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x1a90eb(_0x33553f);});}else{return _0x1a90eb(null,_0x39682d);}},'beforeUpdate':function(_0x2158ea,_0x1eaf4d,_0x23d428){if(_0x2158ea['changed']('zone')||_0x2158ea[_0x37ff('0x10')](_0x37ff('0x11'))||_0x2158ea[_0x37ff('0x10')](_0x37ff('0x1d'))||_0x2158ea[_0x37ff('0x10')]('clientSecret')||_0x2158ea['changed'](_0x37ff('0x13'))||_0x2158ea[_0x37ff('0x10')]('host')){var _0x3c10db,_0x14a9d;_0x3c10db=_0x2158ea[_0x37ff('0x11')];var _0x51acc7=_0x3c10db[_0x37ff('0x15')](-0x1);if(_0x51acc7==='/'||_0x51acc7==='\x5c'||_0x51acc7===':'){_0x3c10db=_0x3c10db[_0x37ff('0x16')](0x0,_0x3c10db[_0x37ff('0x17')](_0x51acc7));}switch(_0x2158ea[_0x37ff('0xf')]){case'US':_0x14a9d=_0x37ff('0x18');break;case'AU':_0x14a9d='https://accounts.zoho.com.au';break;case'IN':_0x14a9d=_0x37ff('0x1a');break;case'CN':_0x14a9d='https://accounts.zoho.com.cn';break;default:_0x14a9d=_0x37ff('0x2a');break;}var _0x3e0bc3={'method':'POST','uri':_0x14a9d+_0x37ff('0x1c'),'form':{'grant_type':_0x37ff('0x2b'),'client_id':_0x2158ea[_0x37ff('0x1d')],'client_secret':_0x2158ea[_0x37ff('0x12')],'redirect_uri':_0x2158ea[_0x37ff('0x11')],'code':_0x2158ea[_0x37ff('0x13')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x3e0bc3)['then'](function(_0x5a1efb){var _0x3a3d2d=JSON[_0x37ff('0x20')](_0x5a1efb);if(_0x3a3d2d[_0x37ff('0x21')]){_0x2158ea[_0x37ff('0x22')]=_0x3a3d2d[_0x37ff('0x21')];logger[_0x37ff('0x23')](util[_0x37ff('0x24')](_0x37ff('0x25'),_0x2158ea[_0x37ff('0x28')],_0x2158ea['id']));}else{logger[_0x37ff('0x26')](util[_0x37ff('0x24')](_0x37ff('0x27'),_0x2158ea[_0x37ff('0x28')],_0x2158ea['id']),util[_0x37ff('0x29')](_0x3a3d2d,{'showHidden':![],'depth':null}));}return _0x23d428(null,_0x1eaf4d);})[_0x37ff('0x2c')](function(_0x35f7a4){logger[_0x37ff('0x26')](util[_0x37ff('0x24')](_0x37ff('0x27'),_0x2158ea[_0x37ff('0x28')],_0x2158ea['id']),util[_0x37ff('0x29')](parsedResult,{'showHidden':![],'depth':null}));return _0x23d428(_0x35f7a4);});}else{return _0x23d428(null,_0x1eaf4d);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index 7524480..3d49a93 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 _0x3d74=['stringify','ShowZohoAccount','ZohoAccount','find','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','GetZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug'];(function(_0x19a9e1,_0x157ec3){var _0x2dc567=function(_0x5000dc){while(--_0x5000dc){_0x19a9e1['push'](_0x19a9e1['shift']());}};_0x2dc567(++_0x157ec3);}(_0x3d74,0x149));var _0x43d7=function(_0x4dda16,_0x335c00){_0x4dda16=_0x4dda16-0x0;var _0x40d0b6=_0x3d74[_0x4dda16];return _0x40d0b6;};'use strict';var _=require(_0x43d7('0x0'));var util=require(_0x43d7('0x1'));var moment=require(_0x43d7('0x2'));var BPromise=require(_0x43d7('0x3'));var rs=require(_0x43d7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x43d7('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x43d7('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x43d7('0x7'));var client=jayson[_0x43d7('0x8')][_0x43d7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2dd33c,_0x3d2fea,_0x2d2218){return new BPromise(function(_0x212c92,_0x23e06a){return client[_0x43d7('0xa')](_0x2dd33c,_0x2d2218)[_0x43d7('0xb')](function(_0x5048ec){logger[_0x43d7('0xc')](_0x43d7('0xd'),_0x3d2fea,_0x43d7('0xe'));logger['debug'](_0x43d7('0xf'),_0x3d2fea,_0x43d7('0xe'),JSON['stringify'](_0x5048ec));if(_0x5048ec[_0x43d7('0x10')]){if(_0x5048ec[_0x43d7('0x10')][_0x43d7('0x11')]===0x1f4){logger[_0x43d7('0x10')](_0x43d7('0xd'),_0x3d2fea,_0x5048ec[_0x43d7('0x10')][_0x43d7('0x12')]);return _0x23e06a(_0x5048ec['error'][_0x43d7('0x12')]);}logger[_0x43d7('0x10')](_0x43d7('0xd'),_0x3d2fea,_0x5048ec[_0x43d7('0x10')][_0x43d7('0x12')]);return _0x212c92(_0x5048ec[_0x43d7('0x10')]['message']);}else{logger[_0x43d7('0xc')](_0x43d7('0xd'),_0x3d2fea,_0x43d7('0xe'));_0x212c92(_0x5048ec[_0x43d7('0x13')]['message']);}})['catch'](function(_0x46bae2){logger[_0x43d7('0x10')]('ZohoAccount,\x20%s,\x20%s',_0x3d2fea,_0x46bae2);_0x23e06a(_0x46bae2);});});}exports[_0x43d7('0x14')]=function(_0x4e6fad){var _0x3e29a9=this;return new Promise(function(_0x5b02db,_0x7aafbd){return db['ZohoAccount'][_0x43d7('0x15')]({'raw':_0x4e6fad[_0x43d7('0x16')]?_0x4e6fad[_0x43d7('0x16')][_0x43d7('0x17')]===undefined?!![]:![]:!![],'where':_0x4e6fad[_0x43d7('0x16')]?_0x4e6fad[_0x43d7('0x16')][_0x43d7('0x18')]||null:null,'attributes':_0x4e6fad['options']?_0x4e6fad[_0x43d7('0x16')][_0x43d7('0x19')]||null:null,'limit':_0x4e6fad['options']?_0x4e6fad['options'][_0x43d7('0x1a')]||null:null,'include':_0x4e6fad[_0x43d7('0x16')]?_0x4e6fad['options'][_0x43d7('0x1b')]?_[_0x43d7('0x1c')](_0x4e6fad[_0x43d7('0x16')]['include'],function(_0x327d5b){return{'model':db[_0x327d5b[_0x43d7('0x1d')]],'as':_0x327d5b['as'],'attributes':_0x327d5b['attributes'],'include':_0x327d5b['include']?_[_0x43d7('0x1c')](_0x327d5b[_0x43d7('0x1b')],function(_0x4a33a6){return{'model':db[_0x4a33a6[_0x43d7('0x1d')]],'as':_0x4a33a6['as'],'attributes':_0x4a33a6[_0x43d7('0x19')],'include':_0x4a33a6[_0x43d7('0x1b')]?_[_0x43d7('0x1c')](_0x4a33a6['include'],function(_0x58819d){return{'model':db[_0x58819d[_0x43d7('0x1d')]],'as':_0x58819d['as'],'attributes':_0x58819d['attributes']};}):[]};}):[]};}):[]:[]})[_0x43d7('0xb')](function(_0x31efd3){logger[_0x43d7('0xc')](_0x43d7('0x14'),_0x4e6fad);logger[_0x43d7('0x1e')](_0x43d7('0x14'),_0x4e6fad,JSON[_0x43d7('0x1f')](_0x31efd3));_0x5b02db(_0x31efd3);})['catch'](function(_0x5dd364){logger['error']('GetZohoAccount',_0x5dd364['message'],_0x4e6fad);_0x7aafbd(_0x3e29a9[_0x43d7('0x10')](0x1f4,_0x5dd364[_0x43d7('0x12')]));});});};exports[_0x43d7('0x20')]=function(_0x398b17){var _0x2b0b42=this;return new Promise(function(_0x2ea804,_0x443f79){return db[_0x43d7('0x21')][_0x43d7('0x22')]({'raw':_0x398b17[_0x43d7('0x16')]?_0x398b17[_0x43d7('0x16')][_0x43d7('0x17')]===undefined?!![]:![]:!![],'where':_0x398b17[_0x43d7('0x16')]?_0x398b17[_0x43d7('0x16')][_0x43d7('0x18')]||null:null,'attributes':_0x398b17['options']?_0x398b17[_0x43d7('0x16')][_0x43d7('0x19')]||null:null,'include':_0x398b17[_0x43d7('0x16')]?_0x398b17[_0x43d7('0x16')]['include']?_['map'](_0x398b17['options'][_0x43d7('0x1b')],function(_0x524ef1){return{'model':db[_0x524ef1[_0x43d7('0x1d')]],'as':_0x524ef1['as'],'attributes':_0x524ef1[_0x43d7('0x19')],'include':_0x524ef1[_0x43d7('0x1b')]?_[_0x43d7('0x1c')](_0x524ef1['include'],function(_0x3bb5ab){return{'model':db[_0x3bb5ab[_0x43d7('0x1d')]],'as':_0x3bb5ab['as'],'attributes':_0x3bb5ab['attributes'],'include':_0x3bb5ab['include']?_[_0x43d7('0x1c')](_0x3bb5ab[_0x43d7('0x1b')],function(_0x1c087d){return{'model':db[_0x1c087d[_0x43d7('0x1d')]],'as':_0x1c087d['as'],'attributes':_0x1c087d[_0x43d7('0x19')]};}):[]};}):[]};}):[]:[]})[_0x43d7('0xb')](function(_0x10474f){logger[_0x43d7('0xc')](_0x43d7('0x20'),_0x398b17);logger[_0x43d7('0x1e')]('ShowZohoAccount',_0x398b17,JSON[_0x43d7('0x1f')](_0x10474f));_0x2ea804(_0x10474f);})[_0x43d7('0x23')](function(_0x51fbbc){logger[_0x43d7('0x10')](_0x43d7('0x20'),_0x51fbbc[_0x43d7('0x12')],_0x398b17);_0x443f79(_0x2b0b42[_0x43d7('0x10')](0x1f4,_0x51fbbc[_0x43d7('0x12')]));});});}; \ No newline at end of file +var _0x8863=['ZohoAccount,\x20%s,\x20%s','request\x20sent','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetZohoAccount','debug','ShowZohoAccount','util','moment','bluebird','randomstring','rpc','../../config/environment','client','http','then','info'];(function(_0x509185,_0x28a5d9){var _0x3cbdbc=function(_0x410b77){while(--_0x410b77){_0x509185['push'](_0x509185['shift']());}};_0x3cbdbc(++_0x28a5d9);}(_0x8863,0x1b6));var _0x3886=function(_0x4a67b4,_0x3baecc){_0x4a67b4=_0x4a67b4-0x0;var _0x2b4e0d=_0x8863[_0x4a67b4];return _0x2b4e0d;};'use strict';var _=require('lodash');var util=require(_0x3886('0x0'));var moment=require(_0x3886('0x1'));var BPromise=require(_0x3886('0x2'));var rs=require(_0x3886('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3886('0x4'));var config=require(_0x3886('0x5'));var jayson=require('jayson/promise');var client=jayson[_0x3886('0x6')][_0x3886('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x566503,_0x25d62e,_0x6edf8a){return new BPromise(function(_0x3a7943,_0x2718ec){return client['request'](_0x566503,_0x6edf8a)[_0x3886('0x8')](function(_0x2dbdc1){logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,_0x3886('0xb'));logger['debug'](_0x3886('0xc'),_0x25d62e,_0x3886('0xb'),JSON[_0x3886('0xd')](_0x2dbdc1));if(_0x2dbdc1['error']){if(_0x2dbdc1['error'][_0x3886('0xe')]===0x1f4){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x2718ec(_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);}logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0x2dbdc1[_0x3886('0xf')][_0x3886('0x10')]);return _0x3a7943(_0x2dbdc1[_0x3886('0xf')]['message']);}else{logger[_0x3886('0x9')](_0x3886('0xa'),_0x25d62e,'request\x20sent');_0x3a7943(_0x2dbdc1[_0x3886('0x11')]['message']);}})[_0x3886('0x12')](function(_0xdbb8c){logger[_0x3886('0xf')](_0x3886('0xa'),_0x25d62e,_0xdbb8c);_0x2718ec(_0xdbb8c);});});}exports['GetZohoAccount']=function(_0x5d4761){var _0x42f22d=this;return new Promise(function(_0x3d4e74,_0xe87c86){return db[_0x3886('0x13')][_0x3886('0x14')]({'raw':_0x5d4761[_0x3886('0x15')]?_0x5d4761[_0x3886('0x15')][_0x3886('0x16')]===undefined?!![]:![]:!![],'where':_0x5d4761[_0x3886('0x15')]?_0x5d4761[_0x3886('0x15')][_0x3886('0x17')]||null:null,'attributes':_0x5d4761['options']?_0x5d4761[_0x3886('0x15')][_0x3886('0x18')]||null:null,'limit':_0x5d4761[_0x3886('0x15')]?_0x5d4761['options'][_0x3886('0x19')]||null:null,'include':_0x5d4761[_0x3886('0x15')]?_0x5d4761[_0x3886('0x15')][_0x3886('0x1a')]?_[_0x3886('0x1b')](_0x5d4761[_0x3886('0x15')][_0x3886('0x1a')],function(_0x554d78){return{'model':db[_0x554d78[_0x3886('0x1c')]],'as':_0x554d78['as'],'attributes':_0x554d78[_0x3886('0x18')],'include':_0x554d78['include']?_[_0x3886('0x1b')](_0x554d78['include'],function(_0xe75870){return{'model':db[_0xe75870['model']],'as':_0xe75870['as'],'attributes':_0xe75870['attributes'],'include':_0xe75870[_0x3886('0x1a')]?_[_0x3886('0x1b')](_0xe75870[_0x3886('0x1a')],function(_0x12cb2f){return{'model':db[_0x12cb2f[_0x3886('0x1c')]],'as':_0x12cb2f['as'],'attributes':_0x12cb2f[_0x3886('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3886('0x8')](function(_0x1b8a62){logger[_0x3886('0x9')](_0x3886('0x1d'),_0x5d4761);logger[_0x3886('0x1e')](_0x3886('0x1d'),_0x5d4761,JSON[_0x3886('0xd')](_0x1b8a62));_0x3d4e74(_0x1b8a62);})[_0x3886('0x12')](function(_0x2eecab){logger[_0x3886('0xf')](_0x3886('0x1d'),_0x2eecab[_0x3886('0x10')],_0x5d4761);_0xe87c86(_0x42f22d[_0x3886('0xf')](0x1f4,_0x2eecab['message']));});});};exports[_0x3886('0x1f')]=function(_0x2feca4){var _0x34ed81=this;return new Promise(function(_0x348909,_0x384e91){return db[_0x3886('0x13')]['find']({'raw':_0x2feca4[_0x3886('0x15')]?_0x2feca4[_0x3886('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x2feca4[_0x3886('0x15')]?_0x2feca4[_0x3886('0x15')][_0x3886('0x17')]||null:null,'attributes':_0x2feca4[_0x3886('0x15')]?_0x2feca4[_0x3886('0x15')][_0x3886('0x18')]||null:null,'include':_0x2feca4[_0x3886('0x15')]?_0x2feca4[_0x3886('0x15')][_0x3886('0x1a')]?_['map'](_0x2feca4[_0x3886('0x15')][_0x3886('0x1a')],function(_0x37e4cd){return{'model':db[_0x37e4cd['model']],'as':_0x37e4cd['as'],'attributes':_0x37e4cd[_0x3886('0x18')],'include':_0x37e4cd[_0x3886('0x1a')]?_['map'](_0x37e4cd[_0x3886('0x1a')],function(_0x3e5cf2){return{'model':db[_0x3e5cf2[_0x3886('0x1c')]],'as':_0x3e5cf2['as'],'attributes':_0x3e5cf2[_0x3886('0x18')],'include':_0x3e5cf2[_0x3886('0x1a')]?_['map'](_0x3e5cf2['include'],function(_0x5ac766){return{'model':db[_0x5ac766['model']],'as':_0x5ac766['as'],'attributes':_0x5ac766[_0x3886('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3886('0x8')](function(_0x2d0dea){logger[_0x3886('0x9')](_0x3886('0x1f'),_0x2feca4);logger[_0x3886('0x1e')]('ShowZohoAccount',_0x2feca4,JSON[_0x3886('0xd')](_0x2d0dea));_0x348909(_0x2d0dea);})[_0x3886('0x12')](function(_0x25035c){logger[_0x3886('0xf')](_0x3886('0x1f'),_0x25035c[_0x3886('0x10')],_0x2feca4);_0x384e91(_0x34ed81['error'](0x1f4,_0x25035c[_0x3886('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index b957a36..f858d83 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 _0xf46a=['show','/:id/fields','getFields','getSubjects','getDescriptions','post','create','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoConfiguration.controller','get','isAuthenticated','index','/:id'];(function(_0x4d55cb,_0x34111a){var _0x4b8f3f=function(_0x50444d){while(--_0x50444d){_0x4d55cb['push'](_0x4d55cb['shift']());}};_0x4b8f3f(++_0x34111a);}(_0xf46a,0xa4));var _0xaf46=function(_0x559ce8,_0x39e99d){_0x559ce8=_0x559ce8-0x0;var _0x5bbeb4=_0xf46a[_0x559ce8];return _0x5bbeb4;};'use strict';var multer=require(_0xaf46('0x0'));var util=require('util');var path=require(_0xaf46('0x1'));var timeout=require(_0xaf46('0x2'));var express=require('express');var router=express[_0xaf46('0x3')]();var auth=require(_0xaf46('0x4'));var interaction=require(_0xaf46('0x5'));var config=require(_0xaf46('0x6'));var controller=require(_0xaf46('0x7'));router[_0xaf46('0x8')]('/',auth[_0xaf46('0x9')](),controller[_0xaf46('0xa')]);router[_0xaf46('0x8')](_0xaf46('0xb'),auth[_0xaf46('0x9')](),controller[_0xaf46('0xc')]);router[_0xaf46('0x8')](_0xaf46('0xd'),auth['isAuthenticated'](),controller[_0xaf46('0xe')]);router['get']('/:id/subjects',auth['isAuthenticated'](),controller[_0xaf46('0xf')]);router[_0xaf46('0x8')]('/:id/descriptions',auth[_0xaf46('0x9')](),controller[_0xaf46('0x10')]);router[_0xaf46('0x11')]('/',auth['isAuthenticated'](),controller[_0xaf46('0x12')]);router['put'](_0xaf46('0xb'),auth['isAuthenticated'](),controller[_0xaf46('0x13')]);router['delete'](_0xaf46('0xb'),auth[_0xaf46('0x9')](),controller[_0xaf46('0x14')]);module[_0xaf46('0x15')]=router; \ No newline at end of file +var _0xcc40=['/:id/fields','/:id/subjects','/:id/descriptions','getDescriptions','post','create','put','/:id','update','delete','destroy','multer','connect-timeout','express','../../components/auth/service','../../config/environment','./intZohoConfiguration.controller','isAuthenticated','get','show'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xcc40,0x97));var _0x0cc4=function(_0x4ded89,_0xa0fade){_0x4ded89=_0x4ded89-0x0;var _0x1a1075=_0xcc40[_0x4ded89];return _0x1a1075;};'use strict';var multer=require(_0x0cc4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x0cc4('0x1'));var express=require(_0x0cc4('0x2'));var router=express['Router']();var auth=require(_0x0cc4('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0cc4('0x4'));var controller=require(_0x0cc4('0x5'));router['get']('/',auth[_0x0cc4('0x6')](),controller['index']);router[_0x0cc4('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x0cc4('0x8')]);router[_0x0cc4('0x7')](_0x0cc4('0x9'),auth['isAuthenticated'](),controller['getFields']);router[_0x0cc4('0x7')](_0x0cc4('0xa'),auth['isAuthenticated'](),controller['getSubjects']);router[_0x0cc4('0x7')](_0x0cc4('0xb'),auth[_0x0cc4('0x6')](),controller[_0x0cc4('0xc')]);router[_0x0cc4('0xd')]('/',auth[_0x0cc4('0x6')](),controller[_0x0cc4('0xe')]);router[_0x0cc4('0xf')](_0x0cc4('0x10'),auth[_0x0cc4('0x6')](),controller[_0x0cc4('0x11')]);router[_0x0cc4('0x12')](_0x0cc4('0x10'),auth[_0x0cc4('0x6')](),controller[_0x0cc4('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index c18fdc2..18449dc 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 _0x71f9=['contact','nothing','lead','ENUM','contact_lead','sequelize','exports','STRING'];(function(_0x2ed5e3,_0x3c11fa){var _0x3aea48=function(_0x262f42){while(--_0x262f42){_0x2ed5e3['push'](_0x2ed5e3['shift']());}};_0x3aea48(++_0x3c11fa);}(_0x71f9,0xdd));var _0x971f=function(_0x2bb090,_0x3b3c23){_0x2bb090=_0x2bb090-0x0;var _0x37e61e=_0x71f9[_0x2bb090];return _0x37e61e;};'use strict';var Sequelize=require(_0x971f('0x0'));module[_0x971f('0x1')]={'name':{'type':Sequelize[_0x971f('0x2')]},'moduleCreate':{'type':Sequelize['ENUM']('lead',_0x971f('0x3'),_0x971f('0x4')),'defaultValue':_0x971f('0x5')},'moduleSearch':{'type':Sequelize[_0x971f('0x6')](_0x971f('0x7'),_0x971f('0x3'),_0x971f('0x5')),'defaultValue':_0x971f('0x7')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x30db=['STRING','ENUM','contact','nothing','lead','contact_lead','sequelize','exports'];(function(_0x3d5e72,_0x3ab167){var _0x2230e4=function(_0x4ede86){while(--_0x4ede86){_0x3d5e72['push'](_0x3d5e72['shift']());}};_0x2230e4(++_0x3ab167);}(_0x30db,0x6e));var _0xb30d=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x30db[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xb30d('0x0'));module[_0xb30d('0x1')]={'name':{'type':Sequelize[_0xb30d('0x2')]},'moduleCreate':{'type':Sequelize[_0xb30d('0x3')]('lead',_0xb30d('0x4'),_0xb30d('0x5')),'defaultValue':_0xb30d('0x6')},'moduleSearch':{'type':Sequelize[_0xb30d('0x3')](_0xb30d('0x7'),_0xb30d('0x4'),_0xb30d('0x6')),'defaultValue':_0xb30d('0x7')},'description':{'type':Sequelize[_0xb30d('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index de4aa85..5f52ef9 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 _0x55ca=['attributes','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','includeAll','findAll','rows','catch','params','keys','length','include','options','find','create','body','getFields','findOne','ZohoField','pick','getSubjects','getDescriptions','html-pdf','eml-format','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','stack','name','index','ZohoConfiguration','rawAttributes','type','key','map','query','intersection','model','fields'];(function(_0x170941,_0x38d105){var _0x50e48d=function(_0x1eb49a){while(--_0x1eb49a){_0x170941['push'](_0x170941['shift']());}};_0x50e48d(++_0x38d105);}(_0x55ca,0x126));var _0xa55c=function(_0x34e030,_0x57c46d){_0x34e030=_0x34e030-0x0;var _0x1a6406=_0x55ca[_0x34e030];return _0x1a6406;};'use strict';var pdf=require(_0xa55c('0x0'));var emlformat=require(_0xa55c('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xa55c('0x2'));var moment=require(_0xa55c('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xa55c('0x4'));var util=require(_0xa55c('0x5'));var path=require(_0xa55c('0x6'));var sox=require(_0xa55c('0x7'));var csv=require(_0xa55c('0x8'));var ejs=require(_0xa55c('0x9'));var fs=require('fs');var _=require(_0xa55c('0xa'));var squel=require('squel');var crypto=require(_0xa55c('0xb'));var jsforce=require(_0xa55c('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa55c('0x8'));var querystring=require(_0xa55c('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xa55c('0xe'));var qs=require(_0xa55c('0xf'));var as=require(_0xa55c('0x10'));var hardwareService=require(_0xa55c('0x11'));var logger=require(_0xa55c('0x12'))(_0xa55c('0x13'));var utils=require(_0xa55c('0x14'));var config=require(_0xa55c('0x15'));var db=require(_0xa55c('0x16'))['db'];var jayson=require(_0xa55c('0x17'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x2a35be,_0x576044,_0x5a3672){if(_0x5a3672){var _0x59ea8d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59ea8d[_0xa55c('0x18')](_0x576044)){return _0x2a35be;}else{throw new db[(_0xa55c('0x19'))][(_0xa55c('0x1a'))](_0xa55c('0x1b'));}}else{return _0x2a35be;}}function respondWithRpcPromise(_0x458480,_0x247e77,_0x4e0b2f,_0x3ccf65){return new BPromise(function(_0x3dcf4f,_0x25934f){var _0x31e10d=_0x3ccf65||client;return _0x31e10d[_0xa55c('0x1c')](_0x458480,_0x4e0b2f)[_0xa55c('0x1d')](function(_0x51590e){logger[_0xa55c('0x1e')](_0xa55c('0x1f'),_0x247e77,'request\x20sent');logger[_0xa55c('0x20')](_0xa55c('0x21'),_0x247e77,_0xa55c('0x22'),JSON[_0xa55c('0x23')](_0x51590e));if(_0x51590e[_0xa55c('0x24')]){if(_0x51590e[_0xa55c('0x24')]['code']===0x1f4){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x25934f(_0x51590e['error'][_0xa55c('0x25')]);}logger[_0xa55c('0x24')]('ZohoConfiguration,\x20%s,\x20%s',_0x247e77,_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);return _0x3dcf4f(_0x51590e[_0xa55c('0x24')][_0xa55c('0x25')]);}else{logger[_0xa55c('0x1e')]('ZohoConfiguration,\x20%s,\x20%s',_0x247e77,_0xa55c('0x22'));_0x3dcf4f(_0x51590e['result']['message']);}})['catch'](function(_0x19ae88){logger['error'](_0xa55c('0x1f'),_0x247e77,_0x19ae88);_0x25934f(_0x19ae88);});});}function respondWithStatusCode(_0x190757,_0x3f64de){_0x3f64de=_0x3f64de||0xcc;return function(_0xf0e574){if(_0xf0e574){return _0x190757[_0xa55c('0x26')](_0x3f64de);}return _0x190757[_0xa55c('0x27')](_0x3f64de)[_0xa55c('0x28')]();};}function respondWithResult(_0x11e7f7,_0x192df2){_0x192df2=_0x192df2||0xc8;return function(_0x3cd152){if(_0x3cd152){return _0x11e7f7[_0xa55c('0x27')](_0x192df2)['json'](_0x3cd152);}};}function respondWithFilteredResult(_0x430d55,_0x28814f){return function(_0x1c9f6b){if(_0x1c9f6b){var _0x906caa=_0x1c9f6b[_0xa55c('0x29')],_0x5d940d=_0x28814f[_0xa55c('0x2a')],_0x1377b0=_0x28814f[_0xa55c('0x2a')]+_0x28814f[_0xa55c('0x2b')],_0x22f6b6;if(_0x1377b0>=_0x906caa){_0x1377b0=_0x906caa;_0x22f6b6=0xc8;}else{_0x22f6b6=0xce;}_0x430d55['status'](_0x22f6b6);return _0x430d55[_0xa55c('0x2c')]('Content-Range',_0x5d940d+'-'+_0x1377b0+'/'+_0x906caa)[_0xa55c('0x2d')](_0x1c9f6b);}return null;};}function patchUpdates(_0x1d730b){return function(_0x1cc53e){try{jsonpatch[_0xa55c('0x2e')](_0x1cc53e,_0x1d730b,!![]);}catch(_0x4d8416){return BPromise[_0xa55c('0x2f')](_0x4d8416);}return _0x1cc53e[_0xa55c('0x30')]();};}function saveUpdates(_0x331e58,_0x20da31){return function(_0x10f4b7){if(_0x10f4b7){return _0x10f4b7[_0xa55c('0x31')](_0x331e58)[_0xa55c('0x1d')](function(_0x24d44d){return _0x24d44d;});}return null;};}function removeEntity(_0x2808e9,_0xcbaf2e){return function(_0x197099){if(_0x197099){return _0x197099['destroy']()['then'](function(){_0x2808e9[_0xa55c('0x27')](0xcc)[_0xa55c('0x28')]();});}};}function handleEntityNotFound(_0x4932d0,_0x30fadd){return function(_0x2f0110){if(!_0x2f0110){_0x4932d0[_0xa55c('0x26')](0x194);}return _0x2f0110;};}function handleError(_0x1839ac,_0x30d4f8){_0x30d4f8=_0x30d4f8||0x1f4;return function(_0x38ff96){logger[_0xa55c('0x24')](_0x38ff96[_0xa55c('0x32')]);if(_0x38ff96[_0xa55c('0x33')]){delete _0x38ff96['name'];}_0x1839ac['status'](_0x30d4f8)['send'](_0x38ff96);};}exports[_0xa55c('0x34')]=function(_0x18e00e,_0x2bb4f0){var _0x5802e4={},_0x768408={},_0x547930={'count':0x0,'rows':[]};var _0x119220=_['map'](db[_0xa55c('0x35')][_0xa55c('0x36')],function(_0x3c0ec1){return{'name':_0x3c0ec1['fieldName'],'type':_0x3c0ec1[_0xa55c('0x37')][_0xa55c('0x38')]};});_0x768408['model']=_[_0xa55c('0x39')](_0x119220,_0xa55c('0x33'));_0x768408['query']=_['keys'](_0x18e00e[_0xa55c('0x3a')]);_0x768408['filters']=_[_0xa55c('0x3b')](_0x768408[_0xa55c('0x3c')],_0x768408['query']);_0x5802e4['attributes']=_['intersection'](_0x768408['model'],qs[_0xa55c('0x3d')](_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x5802e4[_0xa55c('0x3e')]=_0x5802e4[_0xa55c('0x3e')]['length']?_0x5802e4[_0xa55c('0x3e')]:_0x768408[_0xa55c('0x3c')];if(!_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0x5802e4[_0xa55c('0x2b')]=qs['limit'](_0x18e00e[_0xa55c('0x3a')]['limit']);_0x5802e4['offset']=qs[_0xa55c('0x2a')](_0x18e00e[_0xa55c('0x3a')]['offset']);}_0x5802e4[_0xa55c('0x41')]=qs['sort'](_0x18e00e['query'][_0xa55c('0x42')]);_0x5802e4[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_['pick'](_0x18e00e[_0xa55c('0x3a')],_0x768408[_0xa55c('0x44')]));if(_0x18e00e['query'][_0xa55c('0x45')]){_0x5802e4['where']=_[_0xa55c('0x46')](_0x5802e4[_0xa55c('0x43')],{'$or':_['map'](_0x119220,function(_0x66d1de){if(_0x66d1de[_0xa55c('0x37')]!=='VIRTUAL'){var _0x40c352={};_0x40c352[_0x66d1de[_0xa55c('0x33')]]={'$like':'%'+_0x18e00e[_0xa55c('0x3a')]['filter']+'%'};return _0x40c352;}})});}_0x5802e4=_[_0xa55c('0x46')]({},_0x5802e4,_0x18e00e['options']);var _0x2f9717={'where':_0x5802e4[_0xa55c('0x43')]};return db[_0xa55c('0x35')]['count'](_0x2f9717)[_0xa55c('0x1d')](function(_0x106adb){_0x547930['count']=_0x106adb;if(_0x18e00e[_0xa55c('0x3a')][_0xa55c('0x47')]){_0x5802e4['include']=[{'all':!![]}];}return db[_0xa55c('0x35')][_0xa55c('0x48')](_0x5802e4);})['then'](function(_0x46f839){_0x547930[_0xa55c('0x49')]=_0x46f839;return _0x547930;})[_0xa55c('0x1d')](respondWithFilteredResult(_0x2bb4f0,_0x5802e4))[_0xa55c('0x4a')](handleError(_0x2bb4f0,null));};exports['show']=function(_0x143989,_0x58a7ea){var _0x2157d6={'raw':![],'where':{'id':_0x143989[_0xa55c('0x4b')]['id']}},_0x213100={};_0x213100['model']=_[_0xa55c('0x4c')](db[_0xa55c('0x35')]['rawAttributes']);_0x213100[_0xa55c('0x3a')]=_[_0xa55c('0x4c')](_0x143989[_0xa55c('0x3a')]);_0x213100[_0xa55c('0x44')]=_[_0xa55c('0x3b')](_0x213100[_0xa55c('0x3c')],_0x213100[_0xa55c('0x3a')]);_0x2157d6[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x213100[_0xa55c('0x3c')],qs['fields'](_0x143989[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x2157d6[_0xa55c('0x3e')]=_0x2157d6['attributes'][_0xa55c('0x4d')]?_0x2157d6[_0xa55c('0x3e')]:_0x213100['model'];if(_0x143989[_0xa55c('0x3a')]['includeAll']){_0x2157d6[_0xa55c('0x4e')]=[{'all':!![]}];}_0x2157d6=_[_0xa55c('0x46')]({},_0x2157d6,_0x143989[_0xa55c('0x4f')]);return db[_0xa55c('0x35')][_0xa55c('0x50')](_0x2157d6)['then'](handleEntityNotFound(_0x58a7ea,null))[_0xa55c('0x1d')](respondWithResult(_0x58a7ea,null))[_0xa55c('0x4a')](handleError(_0x58a7ea,null));};exports['create']=function(_0x3929a6,_0x2291e0){return db[_0xa55c('0x35')][_0xa55c('0x51')](_0x3929a6['body'],{})['then'](respondWithResult(_0x2291e0,0xc9))[_0xa55c('0x4a')](handleError(_0x2291e0,null));};exports[_0xa55c('0x31')]=function(_0x3ca5b8,_0x44ac57){if(_0x3ca5b8['body']['id']){delete _0x3ca5b8[_0xa55c('0x52')]['id'];}return db['ZohoConfiguration'][_0xa55c('0x50')]({'where':{'id':_0x3ca5b8[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x44ac57,null))[_0xa55c('0x1d')](saveUpdates(_0x3ca5b8[_0xa55c('0x52')],null))['then'](respondWithResult(_0x44ac57,null))[_0xa55c('0x4a')](handleError(_0x44ac57,null));};exports['destroy']=function(_0x23f67f,_0x157afe){return db[_0xa55c('0x35')][_0xa55c('0x50')]({'where':{'id':_0x23f67f[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x157afe,null))[_0xa55c('0x1d')](removeEntity(_0x157afe,null))['catch'](handleError(_0x157afe,null));};exports[_0xa55c('0x53')]=function(_0x449e00,_0x2f2d21,_0x23a30e){var _0x3fa00f={};var _0x5ba2b0={};var _0xa72718;var _0x3cd40d;return db[_0xa55c('0x35')][_0xa55c('0x54')]({'where':{'id':_0x449e00[_0xa55c('0x4b')]['id']}})['then'](handleEntityNotFound(_0x2f2d21,null))[_0xa55c('0x1d')](function(_0x21725b){if(_0x21725b){_0xa72718=_0x21725b;_0x5ba2b0[_0xa55c('0x3c')]=_[_0xa55c('0x4c')](db[_0xa55c('0x55')]['rawAttributes']);_0x5ba2b0[_0xa55c('0x3a')]=_['keys'](_0x449e00[_0xa55c('0x3a')]);_0x5ba2b0['filters']=_[_0xa55c('0x3b')](_0x5ba2b0['model'],_0x5ba2b0[_0xa55c('0x3a')]);_0x3fa00f[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x5ba2b0[_0xa55c('0x3c')],qs[_0xa55c('0x3d')](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0x3fa00f[_0xa55c('0x3e')]=_0x3fa00f[_0xa55c('0x3e')][_0xa55c('0x4d')]?_0x3fa00f['attributes']:_0x5ba2b0[_0xa55c('0x3c')];_0x3fa00f[_0xa55c('0x41')]=qs['sort'](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x42')]);_0x3fa00f[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x449e00[_0xa55c('0x3a')],_0x5ba2b0[_0xa55c('0x44')]));if(_0x449e00[_0xa55c('0x3a')]['filter']){_0x3fa00f[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0x3fa00f[_0xa55c('0x43')],{'$or':_[_0xa55c('0x39')](_0x3fa00f[_0xa55c('0x3e')],function(_0x1bcb40){var _0x2f1237={};_0x2f1237[_0x1bcb40]={'$like':'%'+_0x449e00[_0xa55c('0x3a')][_0xa55c('0x45')]+'%'};return _0x2f1237;})});}_0x3fa00f=_['merge']({},_0x3fa00f,_0x449e00[_0xa55c('0x4f')]);return _0xa72718[_0xa55c('0x53')](_0x3fa00f);}})[_0xa55c('0x1d')](function(_0x26606c){if(_0x26606c){_0x3cd40d=_0x26606c[_0xa55c('0x4d')];if(!_0x449e00[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0x3fa00f[_0xa55c('0x2b')]=qs[_0xa55c('0x2b')](_0x449e00[_0xa55c('0x3a')]['limit']);_0x3fa00f[_0xa55c('0x2a')]=qs['offset'](_0x449e00[_0xa55c('0x3a')][_0xa55c('0x2a')]);}return _0xa72718[_0xa55c('0x53')](_0x3fa00f);}})['then'](function(_0x4d9722){if(_0x4d9722){return _0x4d9722?{'count':_0x3cd40d,'rows':_0x4d9722}:null;}})[_0xa55c('0x1d')](respondWithResult(_0x2f2d21,null))[_0xa55c('0x4a')](handleError(_0x2f2d21,null));};exports[_0xa55c('0x57')]=function(_0x42529f,_0x4c7ee1,_0x149cb9){var _0xd02251={};var _0x8ea1c6={};var _0x3a9910;var _0x21fc9b;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x42529f[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x4c7ee1,null))[_0xa55c('0x1d')](function(_0x36ee32){if(_0x36ee32){_0x3a9910=_0x36ee32;_0x8ea1c6[_0xa55c('0x3c')]=_['keys'](db[_0xa55c('0x55')][_0xa55c('0x36')]);_0x8ea1c6['query']=_[_0xa55c('0x4c')](_0x42529f[_0xa55c('0x3a')]);_0x8ea1c6[_0xa55c('0x44')]=_['intersection'](_0x8ea1c6[_0xa55c('0x3c')],_0x8ea1c6[_0xa55c('0x3a')]);_0xd02251[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x8ea1c6[_0xa55c('0x3c')],qs['fields'](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x3d')]));_0xd02251['attributes']=_0xd02251['attributes'][_0xa55c('0x4d')]?_0xd02251['attributes']:_0x8ea1c6[_0xa55c('0x3c')];_0xd02251[_0xa55c('0x41')]=qs[_0xa55c('0x42')](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x42')]);_0xd02251[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x42529f[_0xa55c('0x3a')],_0x8ea1c6['filters']));if(_0x42529f[_0xa55c('0x3a')][_0xa55c('0x45')]){_0xd02251[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0xd02251['where'],{'$or':_[_0xa55c('0x39')](_0xd02251[_0xa55c('0x3e')],function(_0x1baa8b){var _0x2298ac={};_0x2298ac[_0x1baa8b]={'$like':'%'+_0x42529f['query']['filter']+'%'};return _0x2298ac;})});}_0xd02251=_[_0xa55c('0x46')]({},_0xd02251,_0x42529f[_0xa55c('0x4f')]);return _0x3a9910[_0xa55c('0x57')](_0xd02251);}})[_0xa55c('0x1d')](function(_0x5e87cb){if(_0x5e87cb){_0x21fc9b=_0x5e87cb['length'];if(!_0x42529f[_0xa55c('0x3a')][_0xa55c('0x3f')](_0xa55c('0x40'))){_0xd02251[_0xa55c('0x2b')]=qs[_0xa55c('0x2b')](_0x42529f[_0xa55c('0x3a')][_0xa55c('0x2b')]);_0xd02251['offset']=qs[_0xa55c('0x2a')](_0x42529f['query'][_0xa55c('0x2a')]);}return _0x3a9910['getSubjects'](_0xd02251);}})[_0xa55c('0x1d')](function(_0x313cdc){if(_0x313cdc){return _0x313cdc?{'count':_0x21fc9b,'rows':_0x313cdc}:null;}})[_0xa55c('0x1d')](respondWithResult(_0x4c7ee1,null))[_0xa55c('0x4a')](handleError(_0x4c7ee1,null));};exports[_0xa55c('0x58')]=function(_0x402f02,_0x1ea5b6,_0x2c71ca){var _0x576a1b={};var _0x59414d={};var _0x14cb74;var _0x2948b1;return db[_0xa55c('0x35')][_0xa55c('0x54')]({'where':{'id':_0x402f02[_0xa55c('0x4b')]['id']}})[_0xa55c('0x1d')](handleEntityNotFound(_0x1ea5b6,null))['then'](function(_0x889869){if(_0x889869){_0x14cb74=_0x889869;_0x59414d[_0xa55c('0x3c')]=_[_0xa55c('0x4c')](db[_0xa55c('0x55')][_0xa55c('0x36')]);_0x59414d[_0xa55c('0x3a')]=_[_0xa55c('0x4c')](_0x402f02[_0xa55c('0x3a')]);_0x59414d['filters']=_[_0xa55c('0x3b')](_0x59414d[_0xa55c('0x3c')],_0x59414d[_0xa55c('0x3a')]);_0x576a1b[_0xa55c('0x3e')]=_[_0xa55c('0x3b')](_0x59414d['model'],qs[_0xa55c('0x3d')](_0x402f02[_0xa55c('0x3a')]['fields']));_0x576a1b['attributes']=_0x576a1b[_0xa55c('0x3e')][_0xa55c('0x4d')]?_0x576a1b['attributes']:_0x59414d['model'];_0x576a1b['order']=qs['sort'](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x42')]);_0x576a1b[_0xa55c('0x43')]=qs[_0xa55c('0x44')](_[_0xa55c('0x56')](_0x402f02[_0xa55c('0x3a')],_0x59414d['filters']));if(_0x402f02[_0xa55c('0x3a')][_0xa55c('0x45')]){_0x576a1b[_0xa55c('0x43')]=_[_0xa55c('0x46')](_0x576a1b['where'],{'$or':_[_0xa55c('0x39')](_0x576a1b[_0xa55c('0x3e')],function(_0x36824c){var _0x4cc104={};_0x4cc104[_0x36824c]={'$like':'%'+_0x402f02[_0xa55c('0x3a')]['filter']+'%'};return _0x4cc104;})});}_0x576a1b=_['merge']({},_0x576a1b,_0x402f02[_0xa55c('0x4f')]);return _0x14cb74[_0xa55c('0x58')](_0x576a1b);}})[_0xa55c('0x1d')](function(_0x249b0c){if(_0x249b0c){_0x2948b1=_0x249b0c[_0xa55c('0x4d')];if(!_0x402f02[_0xa55c('0x3a')][_0xa55c('0x3f')]('nolimit')){_0x576a1b['limit']=qs[_0xa55c('0x2b')](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x2b')]);_0x576a1b[_0xa55c('0x2a')]=qs[_0xa55c('0x2a')](_0x402f02[_0xa55c('0x3a')][_0xa55c('0x2a')]);}return _0x14cb74[_0xa55c('0x58')](_0x576a1b);}})[_0xa55c('0x1d')](function(_0x115fc4){if(_0x115fc4){return _0x115fc4?{'count':_0x2948b1,'rows':_0x115fc4}:null;}})['then'](respondWithResult(_0x1ea5b6,null))[_0xa55c('0x4a')](handleError(_0x1ea5b6,null));}; \ No newline at end of file +var _0x7217=['fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZohoConfiguration','includeAll','rows','show','rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZohoField','getSubjects','hasOwnProperty','getDescriptions','findOne','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7217,0x19e));var _0x7721=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x7217[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZohoConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZohoConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZohoConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index 7df4881..06ba981 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 _0xa1eb=['api','bluebird','request-promise','path','./intZohoConfiguration.attributes','exports','int_zoho_configurations','lodash','../../config/logger'];(function(_0x13b8f3,_0x442821){var _0x1a6d06=function(_0x5126f2){while(--_0x5126f2){_0x13b8f3['push'](_0x13b8f3['shift']());}};_0x1a6d06(++_0x442821);}(_0xa1eb,0x1c9));var _0xba1e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa1eb[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xba1e('0x0'));var util=require('util');var logger=require(_0xba1e('0x1'))(_0xba1e('0x2'));var moment=require('moment');var BPromise=require(_0xba1e('0x3'));var rp=require(_0xba1e('0x4'));var fs=require('fs');var path=require(_0xba1e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xba1e('0x6'));module[_0xba1e('0x7')]=function(_0x3bf3fe,_0x347684){return _0x3bf3fe['define']('ZohoConfiguration',attributes,{'tableName':_0xba1e('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x15a6=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','moment'];(function(_0x38511a,_0x226b17){var _0x165d9e=function(_0x142362){while(--_0x142362){_0x38511a['push'](_0x38511a['shift']());}};_0x165d9e(++_0x226b17);}(_0x15a6,0x167));var _0x615a=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x15a6[_0x37c22c];return _0x119d79;};'use strict';var _=require(_0x615a('0x0'));var util=require(_0x615a('0x1'));var logger=require(_0x615a('0x2'))(_0x615a('0x3'));var moment=require(_0x615a('0x4'));var BPromise=require(_0x615a('0x5'));var rp=require(_0x615a('0x6'));var fs=require('fs');var path=require(_0x615a('0x7'));var rimraf=require('rimraf');var config=require(_0x615a('0x8'));var attributes=require(_0x615a('0x9'));module[_0x615a('0xa')]=function(_0x456c9f,_0xcfc036){return _0x456c9f[_0x615a('0xb')](_0x615a('0xc'),attributes,{'tableName':_0x615a('0xd'),'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 af1d3d3..f364338 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 _0x8a8f=['request','then','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','info','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x3ae82e,_0x37c973){var _0x3eaa2d=function(_0x3ec29f){while(--_0x3ec29f){_0x3ae82e['push'](_0x3ae82e['shift']());}};_0x3eaa2d(++_0x37c973);}(_0x8a8f,0x17b));var _0xf8a8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x8a8f[_0x5f309e];return _0x487b5e;};'use strict';var _=require(_0xf8a8('0x0'));var util=require(_0xf8a8('0x1'));var moment=require('moment');var BPromise=require(_0xf8a8('0x2'));var rs=require(_0xf8a8('0x3'));var fs=require('fs');var Redis=require(_0xf8a8('0x4'));var db=require(_0xf8a8('0x5'))['db'];var utils=require(_0xf8a8('0x6'));var logger=require(_0xf8a8('0x7'))(_0xf8a8('0x8'));var config=require(_0xf8a8('0x9'));var jayson=require(_0xf8a8('0xa'));var client=jayson['client'][_0xf8a8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2d93c7,_0x367bcc,_0x306967){return new BPromise(function(_0x145ecb,_0xe71be7){return client[_0xf8a8('0xc')](_0x2d93c7,_0x306967)[_0xf8a8('0xd')](function(_0x4e52b8){logger['info'](_0xf8a8('0xe'),_0x367bcc,_0xf8a8('0xf'));logger[_0xf8a8('0x10')](_0xf8a8('0x11'),_0x367bcc,'request\x20sent',JSON[_0xf8a8('0x12')](_0x4e52b8));if(_0x4e52b8[_0xf8a8('0x13')]){if(_0x4e52b8['error']['code']===0x1f4){logger[_0xf8a8('0x13')](_0xf8a8('0xe'),_0x367bcc,_0x4e52b8[_0xf8a8('0x13')][_0xf8a8('0x14')]);return _0xe71be7(_0x4e52b8[_0xf8a8('0x13')][_0xf8a8('0x14')]);}logger['error'](_0xf8a8('0xe'),_0x367bcc,_0x4e52b8[_0xf8a8('0x13')]['message']);return _0x145ecb(_0x4e52b8['error']['message']);}else{logger[_0xf8a8('0x15')](_0xf8a8('0xe'),_0x367bcc,'request\x20sent');_0x145ecb(_0x4e52b8['result'][_0xf8a8('0x14')]);}})[_0xf8a8('0x16')](function(_0x496122){logger[_0xf8a8('0x13')](_0xf8a8('0xe'),_0x367bcc,_0x496122);_0xe71be7(_0x496122);});});} \ No newline at end of file +var _0x2225=['info','ZohoConfiguration,\x20%s,\x20%s','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then'];(function(_0x314e22,_0x891517){var _0x4ac0f5=function(_0x43aa65){while(--_0x43aa65){_0x314e22['push'](_0x314e22['shift']());}};_0x4ac0f5(++_0x891517);}(_0x2225,0xda));var _0x5222=function(_0x79c35d,_0x5ee4e6){_0x79c35d=_0x79c35d-0x0;var _0x253b21=_0x2225[_0x79c35d];return _0x253b21;};'use strict';var _=require('lodash');var util=require(_0x5222('0x0'));var moment=require('moment');var BPromise=require(_0x5222('0x1'));var rs=require(_0x5222('0x2'));var fs=require('fs');var Redis=require(_0x5222('0x3'));var db=require(_0x5222('0x4'))['db'];var utils=require(_0x5222('0x5'));var logger=require(_0x5222('0x6'))(_0x5222('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5222('0x8')][_0x5222('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1efe6e,_0x3d52be,_0x7a4331){return new BPromise(function(_0x15de78,_0x9e388f){return client[_0x5222('0xa')](_0x1efe6e,_0x7a4331)[_0x5222('0xb')](function(_0x272401){logger[_0x5222('0xc')](_0x5222('0xd'),_0x3d52be,'request\x20sent');logger[_0x5222('0xe')](_0x5222('0xf'),_0x3d52be,_0x5222('0x10'),JSON[_0x5222('0x11')](_0x272401));if(_0x272401[_0x5222('0x12')]){if(_0x272401[_0x5222('0x12')][_0x5222('0x13')]===0x1f4){logger[_0x5222('0x12')]('ZohoConfiguration,\x20%s,\x20%s',_0x3d52be,_0x272401['error'][_0x5222('0x14')]);return _0x9e388f(_0x272401[_0x5222('0x12')][_0x5222('0x14')]);}logger[_0x5222('0x12')](_0x5222('0xd'),_0x3d52be,_0x272401[_0x5222('0x12')][_0x5222('0x14')]);return _0x15de78(_0x272401[_0x5222('0x12')][_0x5222('0x14')]);}else{logger[_0x5222('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x3d52be,'request\x20sent');_0x15de78(_0x272401[_0x5222('0x15')][_0x5222('0x14')]);}})[_0x5222('0x16')](function(_0x360125){logger[_0x5222('0x12')](_0x5222('0xd'),_0x3d52be,_0x360125);_0x9e388f(_0x360125);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index 306b776..9f6e7d2 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 _0xaebd=['./intZohoField.controller','get','isAuthenticated','index','/:id','create','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment'];(function(_0x2b6453,_0xbaeaf){var _0x3fa2dc=function(_0x5225a1){while(--_0x5225a1){_0x2b6453['push'](_0x2b6453['shift']());}};_0x3fa2dc(++_0xbaeaf);}(_0xaebd,0x1e9));var _0xdaeb=function(_0x188dc5,_0x56631f){_0x188dc5=_0x188dc5-0x0;var _0x450d46=_0xaebd[_0x188dc5];return _0x450d46;};'use strict';var multer=require(_0xdaeb('0x0'));var util=require('util');var path=require(_0xdaeb('0x1'));var timeout=require(_0xdaeb('0x2'));var express=require(_0xdaeb('0x3'));var router=express[_0xdaeb('0x4')]();var auth=require(_0xdaeb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xdaeb('0x6'));var controller=require(_0xdaeb('0x7'));router[_0xdaeb('0x8')]('/',auth[_0xdaeb('0x9')](),controller[_0xdaeb('0xa')]);router['get'](_0xdaeb('0xb'),auth[_0xdaeb('0x9')](),controller['show']);router['post']('/',auth[_0xdaeb('0x9')](),controller[_0xdaeb('0xc')]);router[_0xdaeb('0xd')]('/:id',auth[_0xdaeb('0x9')](),controller['update']);router[_0xdaeb('0xe')]('/:id',auth[_0xdaeb('0x9')](),controller['destroy']);module[_0xdaeb('0xf')]=router; \ No newline at end of file +var _0x524e=['/:id','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','get','isAuthenticated'];(function(_0xc89191,_0x189c00){var _0x3f5bff=function(_0x1ca6a6){while(--_0x1ca6a6){_0xc89191['push'](_0xc89191['shift']());}};_0x3f5bff(++_0x189c00);}(_0x524e,0x15e));var _0xe524=function(_0xaf6c57,_0x4a7ed9){_0xaf6c57=_0xaf6c57-0x0;var _0x1ded35=_0x524e[_0xaf6c57];return _0x1ded35;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xe524('0x0'));var timeout=require(_0xe524('0x1'));var express=require(_0xe524('0x2'));var router=express[_0xe524('0x3')]();var auth=require(_0xe524('0x4'));var interaction=require(_0xe524('0x5'));var config=require(_0xe524('0x6'));var controller=require(_0xe524('0x7'));router[_0xe524('0x8')]('/',auth[_0xe524('0x9')](),controller['index']);router[_0xe524('0x8')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller['show']);router[_0xe524('0xb')]('/',auth[_0xe524('0x9')](),controller[_0xe524('0xc')]);router[_0xe524('0xd')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0xe')]);router[_0xe524('0xf')](_0xe524('0xa'),auth[_0xe524('0x9')](),controller[_0xe524('0x10')]);module[_0xe524('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index a647aac..b11ded7 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 _0x0a52=['variable','customVariable','STRING','ENUM','sequelize','exports','string'];(function(_0x30c391,_0x579f49){var _0x383151=function(_0x3bbdf8){while(--_0x3bbdf8){_0x30c391['push'](_0x30c391['shift']());}};_0x383151(++_0x579f49);}(_0x0a52,0xe4));var _0x20a5=function(_0x56bfcd,_0x334f49){_0x56bfcd=_0x56bfcd-0x0;var _0x3dbecc=_0x0a52[_0x56bfcd];return _0x3dbecc;};'use strict';var Sequelize=require(_0x20a5('0x0'));module[_0x20a5('0x1')]={'type':{'type':Sequelize['ENUM'](_0x20a5('0x2'),_0x20a5('0x3'),_0x20a5('0x4'),'keyValue'),'defaultValue':_0x20a5('0x2')},'content':{'type':Sequelize[_0x20a5('0x5')]},'key':{'type':Sequelize[_0x20a5('0x5')]},'keyType':{'type':Sequelize[_0x20a5('0x6')](_0x20a5('0x2'),_0x20a5('0x3'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x20a5('0x5')]},'nameField':{'type':Sequelize[_0x20a5('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x20a5('0x5')]}}; \ No newline at end of file +var _0x3dc1=['BOOLEAN','ENUM','customVariable','keyValue','string','STRING','variable'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3dc1,0x127));var _0x13dc=function(_0x4c3087,_0x165581){_0x4c3087=_0x4c3087-0x0;var _0x1e4742=_0x3dc1[_0x4c3087];return _0x1e4742;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x13dc('0x0')]('string','variable',_0x13dc('0x1'),_0x13dc('0x2')),'defaultValue':_0x13dc('0x3')},'content':{'type':Sequelize[_0x13dc('0x4')]},'key':{'type':Sequelize[_0x13dc('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x13dc('0x3'),_0x13dc('0x5'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x13dc('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x13dc('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x13dc('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index 40abb5c..3db9554 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 _0xf286=['sendStatus','error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','type','key','query','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','keys','find','create','body','html-pdf','zip-dir','request-promise','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy'];(function(_0x537269,_0x20330f){var _0x151ce4=function(_0x91397e){while(--_0x91397e){_0x537269['push'](_0x537269['shift']());}};_0x151ce4(++_0x20330f);}(_0xf286,0x1ca));var _0x6f28=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0xf286[_0x12d033];return _0x3b4e80;};'use strict';var pdf=require(_0x6f28('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x6f28('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f28('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x6f28('0x3'));var util=require(_0x6f28('0x4'));var path=require('path');var sox=require(_0x6f28('0x5'));var csv=require(_0x6f28('0x6'));var ejs=require(_0x6f28('0x7'));var fs=require('fs');var _=require(_0x6f28('0x8'));var squel=require(_0x6f28('0x9'));var crypto=require(_0x6f28('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6f28('0xb'));var toCsv=require(_0x6f28('0x6'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6f28('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6f28('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6f28('0xe'));var logger=require(_0x6f28('0xf'))(_0x6f28('0x10'));var utils=require('../../config/utils');var config=require(_0x6f28('0x11'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1367dc,_0x219b5b){_0x219b5b=_0x219b5b||0xcc;return function(_0x19124a){if(_0x19124a){return _0x1367dc['sendStatus'](_0x219b5b);}return _0x1367dc['status'](_0x219b5b)[_0x6f28('0x12')]();};}function respondWithResult(_0x3cfebe,_0x4a21c8){_0x4a21c8=_0x4a21c8||0xc8;return function(_0xbf3b99){if(_0xbf3b99){return _0x3cfebe[_0x6f28('0x13')](_0x4a21c8)[_0x6f28('0x14')](_0xbf3b99);}};}function respondWithFilteredResult(_0x816655,_0x5c9b73){return function(_0x2b7076){if(_0x2b7076){var _0x273096=_0x2b7076[_0x6f28('0x15')],_0x2c5779=_0x5c9b73['offset'],_0x37c5c0=_0x5c9b73[_0x6f28('0x16')]+_0x5c9b73[_0x6f28('0x17')],_0x1ca71d;if(_0x37c5c0>=_0x273096){_0x37c5c0=_0x273096;_0x1ca71d=0xc8;}else{_0x1ca71d=0xce;}_0x816655[_0x6f28('0x13')](_0x1ca71d);return _0x816655[_0x6f28('0x18')](_0x6f28('0x19'),_0x2c5779+'-'+_0x37c5c0+'/'+_0x273096)[_0x6f28('0x14')](_0x2b7076);}return null;};}function patchUpdates(_0x556a40){return function(_0x288f72){try{jsonpatch[_0x6f28('0x1a')](_0x288f72,_0x556a40,!![]);}catch(_0x2a901c){return BPromise[_0x6f28('0x1b')](_0x2a901c);}return _0x288f72[_0x6f28('0x1c')]();};}function saveUpdates(_0x3600f2,_0xb43274){return function(_0x3ad95b){if(_0x3ad95b){return _0x3ad95b[_0x6f28('0x1d')](_0x3600f2)[_0x6f28('0x1e')](function(_0x4fa0c8){return _0x4fa0c8;});}return null;};}function removeEntity(_0x250ab1,_0x26e9c4){return function(_0x5e795c){if(_0x5e795c){return _0x5e795c[_0x6f28('0x1f')]()[_0x6f28('0x1e')](function(){_0x250ab1['status'](0xcc)[_0x6f28('0x12')]();});}};}function handleEntityNotFound(_0x573624,_0x429781){return function(_0x5ae8fd){if(!_0x5ae8fd){_0x573624[_0x6f28('0x20')](0x194);}return _0x5ae8fd;};}function handleError(_0x19031e,_0x52acc5){_0x52acc5=_0x52acc5||0x1f4;return function(_0x4ae150){logger[_0x6f28('0x21')](_0x4ae150[_0x6f28('0x22')]);if(_0x4ae150[_0x6f28('0x23')]){delete _0x4ae150[_0x6f28('0x23')];}_0x19031e[_0x6f28('0x13')](_0x52acc5)[_0x6f28('0x24')](_0x4ae150);};}exports[_0x6f28('0x25')]=function(_0x430e68,_0x290ca5){var _0x31dfdf={},_0x197c69={},_0x3c4710={'count':0x0,'rows':[]};var _0x3f75b4=_[_0x6f28('0x26')](db[_0x6f28('0x27')][_0x6f28('0x28')],function(_0x46746f){return{'name':_0x46746f[_0x6f28('0x29')],'type':_0x46746f[_0x6f28('0x2a')][_0x6f28('0x2b')]};});_0x197c69['model']=_[_0x6f28('0x26')](_0x3f75b4,_0x6f28('0x23'));_0x197c69['query']=_['keys'](_0x430e68[_0x6f28('0x2c')]);_0x197c69['filters']=_[_0x6f28('0x2d')](_0x197c69[_0x6f28('0x2e')],_0x197c69[_0x6f28('0x2c')]);_0x31dfdf[_0x6f28('0x2f')]=_[_0x6f28('0x2d')](_0x197c69[_0x6f28('0x2e')],qs[_0x6f28('0x30')](_0x430e68[_0x6f28('0x2c')][_0x6f28('0x30')]));_0x31dfdf[_0x6f28('0x2f')]=_0x31dfdf[_0x6f28('0x2f')][_0x6f28('0x31')]?_0x31dfdf[_0x6f28('0x2f')]:_0x197c69[_0x6f28('0x2e')];if(!_0x430e68['query'][_0x6f28('0x32')](_0x6f28('0x33'))){_0x31dfdf[_0x6f28('0x17')]=qs[_0x6f28('0x17')](_0x430e68[_0x6f28('0x2c')][_0x6f28('0x17')]);_0x31dfdf[_0x6f28('0x16')]=qs['offset'](_0x430e68[_0x6f28('0x2c')]['offset']);}_0x31dfdf[_0x6f28('0x34')]=qs[_0x6f28('0x35')](_0x430e68[_0x6f28('0x2c')][_0x6f28('0x35')]);_0x31dfdf[_0x6f28('0x36')]=qs[_0x6f28('0x37')](_['pick'](_0x430e68[_0x6f28('0x2c')],_0x197c69[_0x6f28('0x37')]));if(_0x430e68['query'][_0x6f28('0x38')]){_0x31dfdf['where']=_[_0x6f28('0x39')](_0x31dfdf[_0x6f28('0x36')],{'$or':_[_0x6f28('0x26')](_0x3f75b4,function(_0x9c8cf5){if(_0x9c8cf5['type']!==_0x6f28('0x3a')){var _0x462970={};_0x462970[_0x9c8cf5['name']]={'$like':'%'+_0x430e68[_0x6f28('0x2c')][_0x6f28('0x38')]+'%'};return _0x462970;}})});}_0x31dfdf=_[_0x6f28('0x39')]({},_0x31dfdf,_0x430e68[_0x6f28('0x3b')]);var _0x4603d0={'where':_0x31dfdf[_0x6f28('0x36')]};return db['ZohoField']['count'](_0x4603d0)[_0x6f28('0x1e')](function(_0x4c3c07){_0x3c4710[_0x6f28('0x15')]=_0x4c3c07;if(_0x430e68[_0x6f28('0x2c')]['includeAll']){_0x31dfdf[_0x6f28('0x3c')]=[{'all':!![]}];}return db['ZohoField'][_0x6f28('0x3d')](_0x31dfdf);})[_0x6f28('0x1e')](function(_0x27afba){_0x3c4710[_0x6f28('0x3e')]=_0x27afba;return _0x3c4710;})[_0x6f28('0x1e')](respondWithFilteredResult(_0x290ca5,_0x31dfdf))[_0x6f28('0x3f')](handleError(_0x290ca5,null));};exports[_0x6f28('0x40')]=function(_0x3253dc,_0x39b117){var _0x4f8bf0={'raw':!![],'where':{'id':_0x3253dc[_0x6f28('0x41')]['id']}},_0x44f752={};_0x44f752[_0x6f28('0x2e')]=_[_0x6f28('0x42')](db[_0x6f28('0x27')]['rawAttributes']);_0x44f752['query']=_[_0x6f28('0x42')](_0x3253dc[_0x6f28('0x2c')]);_0x44f752['filters']=_[_0x6f28('0x2d')](_0x44f752[_0x6f28('0x2e')],_0x44f752[_0x6f28('0x2c')]);_0x4f8bf0[_0x6f28('0x2f')]=_[_0x6f28('0x2d')](_0x44f752[_0x6f28('0x2e')],qs[_0x6f28('0x30')](_0x3253dc[_0x6f28('0x2c')][_0x6f28('0x30')]));_0x4f8bf0[_0x6f28('0x2f')]=_0x4f8bf0[_0x6f28('0x2f')][_0x6f28('0x31')]?_0x4f8bf0['attributes']:_0x44f752[_0x6f28('0x2e')];if(_0x3253dc[_0x6f28('0x2c')]['includeAll']){_0x4f8bf0[_0x6f28('0x3c')]=[{'all':!![]}];}_0x4f8bf0=_[_0x6f28('0x39')]({},_0x4f8bf0,_0x3253dc[_0x6f28('0x3b')]);return db[_0x6f28('0x27')][_0x6f28('0x43')](_0x4f8bf0)[_0x6f28('0x1e')](handleEntityNotFound(_0x39b117,null))['then'](respondWithResult(_0x39b117,null))[_0x6f28('0x3f')](handleError(_0x39b117,null));};exports['create']=function(_0x42c900,_0x286924){return db['ZohoField'][_0x6f28('0x44')](_0x42c900[_0x6f28('0x45')],{})[_0x6f28('0x1e')](respondWithResult(_0x286924,0xc9))[_0x6f28('0x3f')](handleError(_0x286924,null));};exports['update']=function(_0x4aa77f,_0x2d6224){if(_0x4aa77f[_0x6f28('0x45')]['id']){delete _0x4aa77f[_0x6f28('0x45')]['id'];}return db[_0x6f28('0x27')][_0x6f28('0x43')]({'where':{'id':_0x4aa77f['params']['id']}})[_0x6f28('0x1e')](handleEntityNotFound(_0x2d6224,null))['then'](saveUpdates(_0x4aa77f[_0x6f28('0x45')],null))['then'](respondWithResult(_0x2d6224,null))[_0x6f28('0x3f')](handleError(_0x2d6224,null));};exports['destroy']=function(_0x57fe71,_0x2b2660){return db['ZohoField'][_0x6f28('0x43')]({'where':{'id':_0x57fe71[_0x6f28('0x41')]['id']}})[_0x6f28('0x1e')](handleEntityNotFound(_0x2b2660,null))['then'](removeEntity(_0x2b2660,null))[_0x6f28('0x3f')](handleError(_0x2b2660,null));}; \ No newline at end of file +var _0x1d6f=['key','model','keys','filters','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','filter','merge','where','options','count','includeAll','ZohoField','findAll','rows','catch','params','rawAttributes','include','find','create','body','update','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','offset','set','Content-Range','json','apply','reject','save','then','end','name','send','index','map','fieldName','type'];(function(_0x9adcd6,_0x36278b){var _0xdf8ff2=function(_0x4f7087){while(--_0x4f7087){_0x9adcd6['push'](_0x9adcd6['shift']());}};_0xdf8ff2(++_0x36278b);}(_0x1d6f,0xf7));var _0xf1d6=function(_0x2b07e2,_0xbc5304){_0x2b07e2=_0x2b07e2-0x0;var _0x2376d6=_0x1d6f[_0x2b07e2];return _0x2376d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf1d6('0x0'));var rimraf=require(_0xf1d6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1d6('0x2'));var rp=require(_0xf1d6('0x3'));var moment=require(_0xf1d6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xf1d6('0x5'));var util=require(_0xf1d6('0x6'));var path=require(_0xf1d6('0x7'));var sox=require(_0xf1d6('0x8'));var csv=require(_0xf1d6('0x9'));var ejs=require(_0xf1d6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xf1d6('0xb'));var crypto=require(_0xf1d6('0xc'));var jsforce=require(_0xf1d6('0xd'));var deskjs=require(_0xf1d6('0xe'));var toCsv=require(_0xf1d6('0x9'));var querystring=require('querystring');var Papa=require(_0xf1d6('0xf'));var Redis=require(_0xf1d6('0x10'));var authService=require(_0xf1d6('0x11'));var qs=require(_0xf1d6('0x12'));var as=require(_0xf1d6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf1d6('0x14'))('api');var utils=require(_0xf1d6('0x15'));var config=require(_0xf1d6('0x16'));var db=require(_0xf1d6('0x17'))['db'];function respondWithStatusCode(_0x324234,_0x530e4f){_0x530e4f=_0x530e4f||0xcc;return function(_0x3b278c){if(_0x3b278c){return _0x324234[_0xf1d6('0x18')](_0x530e4f);}return _0x324234[_0xf1d6('0x19')](_0x530e4f)['end']();};}function respondWithResult(_0x321299,_0x531f7b){_0x531f7b=_0x531f7b||0xc8;return function(_0xde12e0){if(_0xde12e0){return _0x321299[_0xf1d6('0x19')](_0x531f7b)['json'](_0xde12e0);}};}function respondWithFilteredResult(_0x1e5366,_0x2e9994){return function(_0x398989){if(_0x398989){var _0x5a960c=_0x398989['count'],_0x3f7b04=_0x2e9994[_0xf1d6('0x1a')],_0x3a00e2=_0x2e9994[_0xf1d6('0x1a')]+_0x2e9994['limit'],_0x256b4b;if(_0x3a00e2>=_0x5a960c){_0x3a00e2=_0x5a960c;_0x256b4b=0xc8;}else{_0x256b4b=0xce;}_0x1e5366[_0xf1d6('0x19')](_0x256b4b);return _0x1e5366[_0xf1d6('0x1b')](_0xf1d6('0x1c'),_0x3f7b04+'-'+_0x3a00e2+'/'+_0x5a960c)[_0xf1d6('0x1d')](_0x398989);}return null;};}function patchUpdates(_0x50a477){return function(_0x360f27){try{jsonpatch[_0xf1d6('0x1e')](_0x360f27,_0x50a477,!![]);}catch(_0x32c16d){return BPromise[_0xf1d6('0x1f')](_0x32c16d);}return _0x360f27[_0xf1d6('0x20')]();};}function saveUpdates(_0x3cd1ce,_0x16edb2){return function(_0x4dc973){if(_0x4dc973){return _0x4dc973['update'](_0x3cd1ce)[_0xf1d6('0x21')](function(_0x55f31e){return _0x55f31e;});}return null;};}function removeEntity(_0x22a417,_0x37d1d3){return function(_0xe00377){if(_0xe00377){return _0xe00377['destroy']()[_0xf1d6('0x21')](function(){_0x22a417[_0xf1d6('0x19')](0xcc)[_0xf1d6('0x22')]();});}};}function handleEntityNotFound(_0x38b11a,_0x2bf625){return function(_0x1cdfc1){if(!_0x1cdfc1){_0x38b11a[_0xf1d6('0x18')](0x194);}return _0x1cdfc1;};}function handleError(_0x2796c9,_0x44d74a){_0x44d74a=_0x44d74a||0x1f4;return function(_0x4e97fc){logger['error'](_0x4e97fc['stack']);if(_0x4e97fc[_0xf1d6('0x23')]){delete _0x4e97fc[_0xf1d6('0x23')];}_0x2796c9[_0xf1d6('0x19')](_0x44d74a)[_0xf1d6('0x24')](_0x4e97fc);};}exports[_0xf1d6('0x25')]=function(_0x556f92,_0x51a80b){var _0x4d95d0={},_0x2d4165={},_0x39cb11={'count':0x0,'rows':[]};var _0x3cd71f=_[_0xf1d6('0x26')](db['ZohoField']['rawAttributes'],function(_0x55394d){return{'name':_0x55394d[_0xf1d6('0x27')],'type':_0x55394d[_0xf1d6('0x28')][_0xf1d6('0x29')]};});_0x2d4165[_0xf1d6('0x2a')]=_[_0xf1d6('0x26')](_0x3cd71f,_0xf1d6('0x23'));_0x2d4165['query']=_[_0xf1d6('0x2b')](_0x556f92['query']);_0x2d4165[_0xf1d6('0x2c')]=_['intersection'](_0x2d4165[_0xf1d6('0x2a')],_0x2d4165[_0xf1d6('0x2d')]);_0x4d95d0[_0xf1d6('0x2e')]=_[_0xf1d6('0x2f')](_0x2d4165[_0xf1d6('0x2a')],qs[_0xf1d6('0x30')](_0x556f92[_0xf1d6('0x2d')]['fields']));_0x4d95d0[_0xf1d6('0x2e')]=_0x4d95d0[_0xf1d6('0x2e')][_0xf1d6('0x31')]?_0x4d95d0['attributes']:_0x2d4165[_0xf1d6('0x2a')];if(!_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x32')](_0xf1d6('0x33'))){_0x4d95d0[_0xf1d6('0x34')]=qs[_0xf1d6('0x34')](_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x34')]);_0x4d95d0[_0xf1d6('0x1a')]=qs[_0xf1d6('0x1a')](_0x556f92['query'][_0xf1d6('0x1a')]);}_0x4d95d0[_0xf1d6('0x35')]=qs[_0xf1d6('0x36')](_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x36')]);_0x4d95d0['where']=qs['filters'](_['pick'](_0x556f92[_0xf1d6('0x2d')],_0x2d4165['filters']));if(_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x37')]){_0x4d95d0['where']=_[_0xf1d6('0x38')](_0x4d95d0[_0xf1d6('0x39')],{'$or':_['map'](_0x3cd71f,function(_0x46e255){if(_0x46e255[_0xf1d6('0x28')]!=='VIRTUAL'){var _0x172b1d={};_0x172b1d[_0x46e255['name']]={'$like':'%'+_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x37')]+'%'};return _0x172b1d;}})});}_0x4d95d0=_[_0xf1d6('0x38')]({},_0x4d95d0,_0x556f92[_0xf1d6('0x3a')]);var _0x381adc={'where':_0x4d95d0[_0xf1d6('0x39')]};return db['ZohoField'][_0xf1d6('0x3b')](_0x381adc)[_0xf1d6('0x21')](function(_0x5c4a7d){_0x39cb11[_0xf1d6('0x3b')]=_0x5c4a7d;if(_0x556f92[_0xf1d6('0x2d')][_0xf1d6('0x3c')]){_0x4d95d0['include']=[{'all':!![]}];}return db[_0xf1d6('0x3d')][_0xf1d6('0x3e')](_0x4d95d0);})[_0xf1d6('0x21')](function(_0x43a613){_0x39cb11[_0xf1d6('0x3f')]=_0x43a613;return _0x39cb11;})[_0xf1d6('0x21')](respondWithFilteredResult(_0x51a80b,_0x4d95d0))[_0xf1d6('0x40')](handleError(_0x51a80b,null));};exports['show']=function(_0x3d02e2,_0x515e78){var _0x571971={'raw':!![],'where':{'id':_0x3d02e2[_0xf1d6('0x41')]['id']}},_0x5d20be={};_0x5d20be[_0xf1d6('0x2a')]=_[_0xf1d6('0x2b')](db['ZohoField'][_0xf1d6('0x42')]);_0x5d20be['query']=_[_0xf1d6('0x2b')](_0x3d02e2[_0xf1d6('0x2d')]);_0x5d20be['filters']=_[_0xf1d6('0x2f')](_0x5d20be['model'],_0x5d20be[_0xf1d6('0x2d')]);_0x571971[_0xf1d6('0x2e')]=_[_0xf1d6('0x2f')](_0x5d20be[_0xf1d6('0x2a')],qs[_0xf1d6('0x30')](_0x3d02e2['query']['fields']));_0x571971[_0xf1d6('0x2e')]=_0x571971[_0xf1d6('0x2e')][_0xf1d6('0x31')]?_0x571971[_0xf1d6('0x2e')]:_0x5d20be[_0xf1d6('0x2a')];if(_0x3d02e2[_0xf1d6('0x2d')][_0xf1d6('0x3c')]){_0x571971[_0xf1d6('0x43')]=[{'all':!![]}];}_0x571971=_['merge']({},_0x571971,_0x3d02e2[_0xf1d6('0x3a')]);return db[_0xf1d6('0x3d')][_0xf1d6('0x44')](_0x571971)['then'](handleEntityNotFound(_0x515e78,null))['then'](respondWithResult(_0x515e78,null))['catch'](handleError(_0x515e78,null));};exports[_0xf1d6('0x45')]=function(_0x12d9a4,_0x2483d5){return db[_0xf1d6('0x3d')][_0xf1d6('0x45')](_0x12d9a4[_0xf1d6('0x46')],{})[_0xf1d6('0x21')](respondWithResult(_0x2483d5,0xc9))[_0xf1d6('0x40')](handleError(_0x2483d5,null));};exports[_0xf1d6('0x47')]=function(_0x26539b,_0x4edf60){if(_0x26539b['body']['id']){delete _0x26539b[_0xf1d6('0x46')]['id'];}return db[_0xf1d6('0x3d')][_0xf1d6('0x44')]({'where':{'id':_0x26539b[_0xf1d6('0x41')]['id']}})[_0xf1d6('0x21')](handleEntityNotFound(_0x4edf60,null))[_0xf1d6('0x21')](saveUpdates(_0x26539b[_0xf1d6('0x46')],null))[_0xf1d6('0x21')](respondWithResult(_0x4edf60,null))['catch'](handleError(_0x4edf60,null));};exports['destroy']=function(_0x4cf53e,_0x3f2ea1){return db['ZohoField']['find']({'where':{'id':_0x4cf53e[_0xf1d6('0x41')]['id']}})[_0xf1d6('0x21')](handleEntityNotFound(_0x3f2ea1,null))[_0xf1d6('0x21')](removeEntity(_0x3f2ea1,null))['catch'](handleError(_0x3f2ea1,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 01da050..df158e4 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 _0x2e67=['moment','bluebird','request-promise','path','rimraf','./intZohoField.attributes','exports','define','ZohoField','zoho_unique_index','FieldId','util','../../config/logger'];(function(_0x2cba71,_0x4d21c7){var _0x446595=function(_0x5b871a){while(--_0x5b871a){_0x2cba71['push'](_0x2cba71['shift']());}};_0x446595(++_0x4d21c7);}(_0x2e67,0xf5));var _0x72e6=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2e67[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x72e6('0x0'));var logger=require(_0x72e6('0x1'))('api');var moment=require(_0x72e6('0x2'));var BPromise=require(_0x72e6('0x3'));var rp=require(_0x72e6('0x4'));var fs=require('fs');var path=require(_0x72e6('0x5'));var rimraf=require(_0x72e6('0x6'));var config=require('../../config/environment');var attributes=require(_0x72e6('0x7'));module[_0x72e6('0x8')]=function(_0xc51458,_0x4bbee9){return _0xc51458[_0x72e6('0x9')](_0x72e6('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0x72e6('0xb'),'fields':['idField',_0x72e6('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2e73=['idField','FieldId','lodash','util','../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoField.attributes','define','ZohoField'];(function(_0x4c285f,_0x21c26b){var _0x2d51ab=function(_0x12ef8c){while(--_0x12ef8c){_0x4c285f['push'](_0x4c285f['shift']());}};_0x2d51ab(++_0x21c26b);}(_0x2e73,0xd2));var _0x32e7=function(_0x5a19fc,_0x58f9f4){_0x5a19fc=_0x5a19fc-0x0;var _0x34b413=_0x2e73[_0x5a19fc];return _0x34b413;};'use strict';var _=require(_0x32e7('0x0'));var util=require(_0x32e7('0x1'));var logger=require(_0x32e7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x32e7('0x3'));var rp=require(_0x32e7('0x4'));var fs=require('fs');var path=require(_0x32e7('0x5'));var rimraf=require(_0x32e7('0x6'));var config=require(_0x32e7('0x7'));var attributes=require(_0x32e7('0x8'));module['exports']=function(_0x3bb1b2,_0x5d6ec3){return _0x3bb1b2[_0x32e7('0x9')](_0x32e7('0xa'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':'zoho_unique_index','fields':[_0x32e7('0xb'),_0x32e7('0xc')],'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 b6b09fd..e952e54 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 _0xf3cd=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','info','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','stringify','error','code','ZohoField,\x20%s,\x20%s','message','result'];(function(_0x499076,_0x3ad5f9){var _0x3150c9=function(_0x47c5c4){while(--_0x47c5c4){_0x499076['push'](_0x499076['shift']());}};_0x3150c9(++_0x3ad5f9);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x1e03e4,_0x362f76){_0x1e03e4=_0x1e03e4-0x0;var _0x4a887e=_0xf3cd[_0x1e03e4];return _0x4a887e;};'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')]('ZohoField,\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')]('ZohoField,\x20%s,\x20%s',_0x106021,_0x2986d0);_0x15705d(_0x2986d0);});});} \ No newline at end of file +var _0xa8a8=['stringify','error','code','ZohoField,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug'];(function(_0x348e8d,_0x5e0eff){var _0x13b3da=function(_0x1b2cc9){while(--_0x1b2cc9){_0x348e8d['push'](_0x348e8d['shift']());}};_0x13b3da(++_0x5e0eff);}(_0xa8a8,0xec));var _0x8a8a=function(_0x21c12f,_0x28e919){_0x21c12f=_0x21c12f-0x0;var _0x42eb67=_0xa8a8[_0x21c12f];return _0x42eb67;};'use strict';var _=require(_0x8a8a('0x0'));var util=require(_0x8a8a('0x1'));var moment=require(_0x8a8a('0x2'));var BPromise=require(_0x8a8a('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a8a('0x4'));var db=require(_0x8a8a('0x5'))['db'];var utils=require(_0x8a8a('0x6'));var logger=require(_0x8a8a('0x7'))(_0x8a8a('0x8'));var config=require(_0x8a8a('0x9'));var jayson=require(_0x8a8a('0xa'));var client=jayson[_0x8a8a('0xb')][_0x8a8a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x315fe9,_0x1d7121,_0x8e7aa0){return new BPromise(function(_0x4225b9,_0xecaa6f){return client[_0x8a8a('0xd')](_0x315fe9,_0x8e7aa0)['then'](function(_0x576ef9){logger[_0x8a8a('0xe')]('ZohoField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));logger[_0x8a8a('0x10')]('ZohoField,\x20%s,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'),JSON[_0x8a8a('0x11')](_0x576ef9));if(_0x576ef9[_0x8a8a('0x12')]){if(_0x576ef9['error'][_0x8a8a('0x13')]===0x1f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')]['message']);return _0xecaa6f(_0x576ef9[_0x8a8a('0x12')]['message']);}logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);return _0x4225b9(_0x576ef9[_0x8a8a('0x12')][_0x8a8a('0x15')]);}else{logger[_0x8a8a('0xe')]('ZohoField,\x20%s,\x20%s',_0x1d7121,_0x8a8a('0xf'));_0x4225b9(_0x576ef9['result'][_0x8a8a('0x15')]);}})[_0x8a8a('0x16')](function(_0x46a4f4){logger[_0x8a8a('0x12')](_0x8a8a('0x14'),_0x1d7121,_0x46a4f4);_0xecaa6f(_0x46a4f4);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index d3d75b6..870fe83 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 _0x4036=['multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports'];(function(_0x1443eb,_0x203408){var _0x2b8810=function(_0x48bc4e){while(--_0x48bc4e){_0x1443eb['push'](_0x1443eb['shift']());}};_0x2b8810(++_0x203408);}(_0x4036,0xf8));var _0x6403=function(_0x3ec9bf,_0x4b3dbb){_0x3ec9bf=_0x3ec9bf-0x0;var _0x3c081b=_0x4036[_0x3ec9bf];return _0x3c081b;};'use strict';var multer=require(_0x6403('0x0'));var util=require('util');var path=require(_0x6403('0x1'));var timeout=require(_0x6403('0x2'));var express=require(_0x6403('0x3'));var router=express[_0x6403('0x4')]();var auth=require(_0x6403('0x5'));var interaction=require(_0x6403('0x6'));var config=require('../../config/environment');module[_0x6403('0x7')]=router; \ No newline at end of file +var _0xcd97=['exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x2bfea2,_0x255cbd){var _0x53c8d9=function(_0x416dfd){while(--_0x416dfd){_0x2bfea2['push'](_0x2bfea2['shift']());}};_0x53c8d9(++_0x255cbd);}(_0xcd97,0x189));var _0x7cd9=function(_0x1909c7,_0x1f55b6){_0x1909c7=_0x1909c7-0x0;var _0x409d37=_0xcd97[_0x1909c7];return _0x409d37;};'use strict';var multer=require(_0x7cd9('0x0'));var util=require('util');var path=require(_0x7cd9('0x1'));var timeout=require('connect-timeout');var express=require(_0x7cd9('0x2'));var router=express[_0x7cd9('0x3')]();var auth=require(_0x7cd9('0x4'));var interaction=require(_0x7cd9('0x5'));var config=require(_0x7cd9('0x6'));module[_0x7cd9('0x7')]=router; \ No newline at end of file diff --git a/server/api/integration/integration.attributes.js b/server/api/integration/integration.attributes.js index 2ebb47a..68412f3 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 _0x0e04=['app.js','INTEGER','state','sequelize','unique_name_and_version','STRING'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x0e04,0x111));var _0x40e0=function(_0x5a1a8f,_0xd9ea1f){_0x5a1a8f=_0x5a1a8f-0x0;var _0x140305=_0x0e04[_0x5a1a8f];return _0x140305;};'use strict';var Sequelize=require(_0x40e0('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x40e0('0x1')},'version':{'type':Sequelize[_0x40e0('0x2')],'allowNull':![],'unique':_0x40e0('0x1')},'main':{'type':Sequelize[_0x40e0('0x2')],'defaultValue':_0x40e0('0x3')},'filename':{'type':Sequelize[_0x40e0('0x2')]},'path':{'type':Sequelize[_0x40e0('0x2')]},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x40e0('0x4')]},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'author':{'type':Sequelize[_0x40e0('0x2')]},'logo':{'type':Sequelize['STRING']},'state':{'type':Sequelize[_0x40e0('0x2')],'unique':_0x40e0('0x5')},'description':{'type':Sequelize[_0x40e0('0x2')]},'title':{'type':Sequelize[_0x40e0('0x2')]},'remoteUri':{'type':Sequelize[_0x40e0('0x2')]},'link':{'type':Sequelize[_0x40e0('0x2')],'defaultValue':'#'}}; \ No newline at end of file +var _0x05e3=['unique_name_and_version','app.js','INTEGER','BOOLEAN','state','exports','STRING'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x05e3,0xf3));var _0x305e=function(_0x5418ad,_0x40742f){_0x5418ad=_0x5418ad-0x0;var _0x2cae56=_0x05e3[_0x5418ad];return _0x2cae56;};'use strict';var Sequelize=require('sequelize');module[_0x305e('0x0')]={'name':{'type':Sequelize[_0x305e('0x1')],'allowNull':![],'unique':_0x305e('0x2')},'version':{'type':Sequelize[_0x305e('0x1')],'allowNull':![],'unique':_0x305e('0x2')},'main':{'type':Sequelize['STRING'],'defaultValue':_0x305e('0x3')},'filename':{'type':Sequelize[_0x305e('0x1')]},'path':{'type':Sequelize[_0x305e('0x1')]},'type':{'type':Sequelize[_0x305e('0x1')]},'size':{'type':Sequelize[_0x305e('0x4')]},'active':{'type':Sequelize[_0x305e('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x305e('0x1')]},'logo':{'type':Sequelize[_0x305e('0x1')]},'state':{'type':Sequelize[_0x305e('0x1')],'unique':_0x305e('0x6')},'description':{'type':Sequelize[_0x305e('0x1')]},'title':{'type':Sequelize[_0x305e('0x1')]},'remoteUri':{'type':Sequelize[_0x305e('0x1')]},'link':{'type':Sequelize['STRING'],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 8e16cda..0ea9746 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 _0x2f46=['update','then','destroy','sendStatus','error','stack','name','send','index','Integration','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','map','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save'];(function(_0x13b9c7,_0x4b3976){var _0xb1cd10=function(_0x2bf152){while(--_0x2bf152){_0x13b9c7['push'](_0x13b9c7['shift']());}};_0xb1cd10(++_0x4b3976);}(_0x2f46,0xb4));var _0x62f4=function(_0xb182db,_0x57e733){_0xb182db=_0xb182db-0x0;var _0x18d47a=_0x2f46[_0xb182db];return _0x18d47a;};'use strict';var pdf=require(_0x62f4('0x0'));var emlformat=require(_0x62f4('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x62f4('0x2'));var moment=require('moment');var BPromise=require(_0x62f4('0x3'));var Mustache=require(_0x62f4('0x4'));var util=require(_0x62f4('0x5'));var path=require(_0x62f4('0x6'));var sox=require(_0x62f4('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x62f4('0x8'));var crypto=require(_0x62f4('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x62f4('0xa'));var toCsv=require(_0x62f4('0xb'));var querystring=require(_0x62f4('0xc'));var Papa=require(_0x62f4('0xd'));var Redis=require(_0x62f4('0xe'));var authService=require(_0x62f4('0xf'));var qs=require(_0x62f4('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x62f4('0x11'));var logger=require('../../config/logger')(_0x62f4('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x62f4('0x13'))['db'];function respondWithStatusCode(_0x45f0c1,_0x57dbe1){_0x57dbe1=_0x57dbe1||0xcc;return function(_0x5bc9a3){if(_0x5bc9a3){return _0x45f0c1['sendStatus'](_0x57dbe1);}return _0x45f0c1[_0x62f4('0x14')](_0x57dbe1)[_0x62f4('0x15')]();};}function respondWithResult(_0x50cf6,_0x3893bd){_0x3893bd=_0x3893bd||0xc8;return function(_0x76204b){if(_0x76204b){return _0x50cf6['status'](_0x3893bd)[_0x62f4('0x16')](_0x76204b);}};}function respondWithFilteredResult(_0x319a9a,_0x315b42){return function(_0x5f5708){if(_0x5f5708){var _0x55744c=_0x5f5708[_0x62f4('0x17')],_0x3d6651=_0x315b42[_0x62f4('0x18')],_0x3543d8=_0x315b42[_0x62f4('0x18')]+_0x315b42[_0x62f4('0x19')],_0x5840a4;if(_0x3543d8>=_0x55744c){_0x3543d8=_0x55744c;_0x5840a4=0xc8;}else{_0x5840a4=0xce;}_0x319a9a[_0x62f4('0x14')](_0x5840a4);return _0x319a9a[_0x62f4('0x1a')]('Content-Range',_0x3d6651+'-'+_0x3543d8+'/'+_0x55744c)[_0x62f4('0x16')](_0x5f5708);}return null;};}function patchUpdates(_0x561f0c){return function(_0x9e6a67){try{jsonpatch[_0x62f4('0x1b')](_0x9e6a67,_0x561f0c,!![]);}catch(_0x518085){return BPromise[_0x62f4('0x1c')](_0x518085);}return _0x9e6a67[_0x62f4('0x1d')]();};}function saveUpdates(_0x17eb52,_0x205517){return function(_0x6ac91c){if(_0x6ac91c){return _0x6ac91c[_0x62f4('0x1e')](_0x17eb52)[_0x62f4('0x1f')](function(_0xee46f6){return _0xee46f6;});}return null;};}function removeEntity(_0x377901,_0x203d1f){return function(_0x4ebd98){if(_0x4ebd98){return _0x4ebd98[_0x62f4('0x20')]()[_0x62f4('0x1f')](function(){_0x377901['status'](0xcc)[_0x62f4('0x15')]();});}};}function handleEntityNotFound(_0x5189f0,_0x2a39ed){return function(_0x3e95d0){if(!_0x3e95d0){_0x5189f0[_0x62f4('0x21')](0x194);}return _0x3e95d0;};}function handleError(_0x2e4da5,_0x197cb9){_0x197cb9=_0x197cb9||0x1f4;return function(_0x3d7434){logger[_0x62f4('0x22')](_0x3d7434[_0x62f4('0x23')]);if(_0x3d7434['name']){delete _0x3d7434[_0x62f4('0x24')];}_0x2e4da5['status'](_0x197cb9)[_0x62f4('0x25')](_0x3d7434);};}exports[_0x62f4('0x26')]=function(_0xae9091,_0x373d81){var _0xa231ff={},_0x40a31a={},_0x448252={'count':0x0,'rows':[]};var _0x376d4d=_['map'](db[_0x62f4('0x27')][_0x62f4('0x28')],function(_0x50e265){return{'name':_0x50e265['fieldName'],'type':_0x50e265[_0x62f4('0x29')][_0x62f4('0x2a')]};});_0x40a31a[_0x62f4('0x2b')]=_['map'](_0x376d4d,'name');_0x40a31a[_0x62f4('0x2c')]=_[_0x62f4('0x2d')](_0xae9091['query']);_0x40a31a[_0x62f4('0x2e')]=_[_0x62f4('0x2f')](_0x40a31a[_0x62f4('0x2b')],_0x40a31a['query']);_0xa231ff[_0x62f4('0x30')]=_[_0x62f4('0x2f')](_0x40a31a[_0x62f4('0x2b')],qs[_0x62f4('0x31')](_0xae9091[_0x62f4('0x2c')][_0x62f4('0x31')]));_0xa231ff['attributes']=_0xa231ff[_0x62f4('0x30')][_0x62f4('0x32')]?_0xa231ff[_0x62f4('0x30')]:_0x40a31a[_0x62f4('0x2b')];if(!_0xae9091['query'][_0x62f4('0x33')](_0x62f4('0x34'))){_0xa231ff[_0x62f4('0x19')]=qs[_0x62f4('0x19')](_0xae9091['query'][_0x62f4('0x19')]);_0xa231ff[_0x62f4('0x18')]=qs[_0x62f4('0x18')](_0xae9091[_0x62f4('0x2c')]['offset']);}_0xa231ff[_0x62f4('0x35')]=qs[_0x62f4('0x36')](_0xae9091['query'][_0x62f4('0x36')]);_0xa231ff['where']=qs['filters'](_['pick'](_0xae9091[_0x62f4('0x2c')],_0x40a31a[_0x62f4('0x2e')]));if(_0xae9091[_0x62f4('0x2c')]['filter']){_0xa231ff[_0x62f4('0x37')]=_[_0x62f4('0x38')](_0xa231ff[_0x62f4('0x37')],{'$or':_[_0x62f4('0x39')](_0x376d4d,function(_0x133e65){if(_0x133e65[_0x62f4('0x29')]!==_0x62f4('0x3a')){var _0x390208={};_0x390208[_0x133e65[_0x62f4('0x24')]]={'$like':'%'+_0xae9091[_0x62f4('0x2c')][_0x62f4('0x3b')]+'%'};return _0x390208;}})});}_0xa231ff=_[_0x62f4('0x38')]({},_0xa231ff,_0xae9091[_0x62f4('0x3c')]);var _0x3af31e={'where':_0xa231ff[_0x62f4('0x37')]};return db[_0x62f4('0x27')][_0x62f4('0x17')](_0x3af31e)['then'](function(_0x180b04){_0x448252[_0x62f4('0x17')]=_0x180b04;if(_0xae9091[_0x62f4('0x2c')][_0x62f4('0x3d')]){_0xa231ff[_0x62f4('0x3e')]=[{'all':!![]}];}return db[_0x62f4('0x27')][_0x62f4('0x3f')](_0xa231ff);})[_0x62f4('0x1f')](function(_0x3573c7){_0x448252[_0x62f4('0x40')]=_0x3573c7;return _0x448252;})['then'](respondWithFilteredResult(_0x373d81,_0xa231ff))[_0x62f4('0x41')](handleError(_0x373d81,null));};exports['show']=function(_0x20e7c6,_0x569ee7){var _0x5f2912={'raw':![],'where':{'id':_0x20e7c6[_0x62f4('0x42')]['id']}},_0x2f00b2={};_0x2f00b2[_0x62f4('0x2b')]=_[_0x62f4('0x2d')](db[_0x62f4('0x27')][_0x62f4('0x28')]);_0x2f00b2[_0x62f4('0x2c')]=_[_0x62f4('0x2d')](_0x20e7c6[_0x62f4('0x2c')]);_0x2f00b2['filters']=_[_0x62f4('0x2f')](_0x2f00b2['model'],_0x2f00b2[_0x62f4('0x2c')]);_0x5f2912[_0x62f4('0x30')]=_[_0x62f4('0x2f')](_0x2f00b2['model'],qs[_0x62f4('0x31')](_0x20e7c6['query']['fields']));_0x5f2912[_0x62f4('0x30')]=_0x5f2912[_0x62f4('0x30')][_0x62f4('0x32')]?_0x5f2912[_0x62f4('0x30')]:_0x2f00b2[_0x62f4('0x2b')];if(_0x20e7c6[_0x62f4('0x2c')]['includeAll']){_0x5f2912[_0x62f4('0x3e')]=[{'all':!![]}];}_0x5f2912=_[_0x62f4('0x38')]({},_0x5f2912,_0x20e7c6[_0x62f4('0x3c')]);return db['Integration'][_0x62f4('0x43')](_0x5f2912)[_0x62f4('0x1f')](handleEntityNotFound(_0x569ee7,null))[_0x62f4('0x1f')](respondWithResult(_0x569ee7,null))['catch'](handleError(_0x569ee7,null));};exports['create']=function(_0x5a59bd,_0x557e09){return db[_0x62f4('0x27')][_0x62f4('0x44')](_0x5a59bd[_0x62f4('0x45')],{})[_0x62f4('0x1f')](respondWithResult(_0x557e09,0xc9))['catch'](handleError(_0x557e09,null));};exports[_0x62f4('0x1e')]=function(_0x24cd0a,_0x522288){if(_0x24cd0a['body']['id']){delete _0x24cd0a[_0x62f4('0x45')]['id'];}return db[_0x62f4('0x27')][_0x62f4('0x43')]({'where':{'id':_0x24cd0a[_0x62f4('0x42')]['id']}})['then'](handleEntityNotFound(_0x522288,null))['then'](saveUpdates(_0x24cd0a['body'],null))['then'](respondWithResult(_0x522288,null))[_0x62f4('0x41')](handleError(_0x522288,null));};exports[_0x62f4('0x20')]=function(_0x3fe6d4,_0xd0fe24){return db[_0x62f4('0x27')][_0x62f4('0x43')]({'where':{'id':_0x3fe6d4[_0x62f4('0x42')]['id']}})[_0x62f4('0x1f')](handleEntityNotFound(_0xd0fe24,null))['then'](removeEntity(_0xd0fe24,null))['catch'](handleError(_0xd0fe24,null));}; \ No newline at end of file +var _0xba41=['findAll','rows','catch','params','keys','create','body','find','eml-format','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','Integration','rawAttributes','type','key','model','filters','attributes','intersection','fields','length','query','hasOwnProperty','limit','order','sort','where','merge','VIRTUAL','options','includeAll','include'];(function(_0x2dd5b5,_0x109cb2){var _0x3e476f=function(_0x5dc254){while(--_0x5dc254){_0x2dd5b5['push'](_0x2dd5b5['shift']());}};_0x3e476f(++_0x109cb2);}(_0xba41,0x94));var _0x1ba4=function(_0x4dc7b9,_0x319d5a){_0x4dc7b9=_0x4dc7b9-0x0;var _0x3ab114=_0xba41[_0x4dc7b9];return _0x3ab114;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1ba4('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x1ba4('0x1'));var jsonpatch=require(_0x1ba4('0x2'));var rp=require('request-promise');var moment=require(_0x1ba4('0x3'));var BPromise=require(_0x1ba4('0x4'));var Mustache=require('mustache');var util=require(_0x1ba4('0x5'));var path=require(_0x1ba4('0x6'));var sox=require(_0x1ba4('0x7'));var csv=require(_0x1ba4('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ba4('0x9'));var squel=require(_0x1ba4('0xa'));var crypto=require(_0x1ba4('0xb'));var jsforce=require(_0x1ba4('0xc'));var deskjs=require(_0x1ba4('0xd'));var toCsv=require(_0x1ba4('0x8'));var querystring=require(_0x1ba4('0xe'));var Papa=require('papaparse');var Redis=require(_0x1ba4('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x1ba4('0x10'));var as=require(_0x1ba4('0x11'));var hardwareService=require(_0x1ba4('0x12'));var logger=require('../../config/logger')(_0x1ba4('0x13'));var utils=require(_0x1ba4('0x14'));var config=require('../../config/environment');var db=require(_0x1ba4('0x15'))['db'];function respondWithStatusCode(_0x4a0ec5,_0x5f44da){_0x5f44da=_0x5f44da||0xcc;return function(_0xdb43e0){if(_0xdb43e0){return _0x4a0ec5[_0x1ba4('0x16')](_0x5f44da);}return _0x4a0ec5[_0x1ba4('0x17')](_0x5f44da)[_0x1ba4('0x18')]();};}function respondWithResult(_0x31552e,_0x313e66){_0x313e66=_0x313e66||0xc8;return function(_0x1b81ca){if(_0x1b81ca){return _0x31552e[_0x1ba4('0x17')](_0x313e66)[_0x1ba4('0x19')](_0x1b81ca);}};}function respondWithFilteredResult(_0x3eed7f,_0x520e85){return function(_0x155e5d){if(_0x155e5d){var _0x18ed2a=_0x155e5d[_0x1ba4('0x1a')],_0x237ca2=_0x520e85[_0x1ba4('0x1b')],_0x545966=_0x520e85['offset']+_0x520e85['limit'],_0x13c520;if(_0x545966>=_0x18ed2a){_0x545966=_0x18ed2a;_0x13c520=0xc8;}else{_0x13c520=0xce;}_0x3eed7f[_0x1ba4('0x17')](_0x13c520);return _0x3eed7f[_0x1ba4('0x1c')]('Content-Range',_0x237ca2+'-'+_0x545966+'/'+_0x18ed2a)[_0x1ba4('0x19')](_0x155e5d);}return null;};}function patchUpdates(_0x4fbfaf){return function(_0x42124c){try{jsonpatch[_0x1ba4('0x1d')](_0x42124c,_0x4fbfaf,!![]);}catch(_0x5cf310){return BPromise[_0x1ba4('0x1e')](_0x5cf310);}return _0x42124c[_0x1ba4('0x1f')]();};}function saveUpdates(_0x287ab0,_0x36f52b){return function(_0x5b7752){if(_0x5b7752){return _0x5b7752[_0x1ba4('0x20')](_0x287ab0)['then'](function(_0x307f7a){return _0x307f7a;});}return null;};}function removeEntity(_0x46fd3b,_0x197516){return function(_0x1d54e2){if(_0x1d54e2){return _0x1d54e2[_0x1ba4('0x21')]()[_0x1ba4('0x22')](function(){_0x46fd3b[_0x1ba4('0x17')](0xcc)[_0x1ba4('0x18')]();});}};}function handleEntityNotFound(_0x46da22,_0x521247){return function(_0x1fe614){if(!_0x1fe614){_0x46da22[_0x1ba4('0x16')](0x194);}return _0x1fe614;};}function handleError(_0x29cd7c,_0x3751ff){_0x3751ff=_0x3751ff||0x1f4;return function(_0x52dc95){logger[_0x1ba4('0x23')](_0x52dc95[_0x1ba4('0x24')]);if(_0x52dc95[_0x1ba4('0x25')]){delete _0x52dc95[_0x1ba4('0x25')];}_0x29cd7c['status'](_0x3751ff)[_0x1ba4('0x26')](_0x52dc95);};}exports[_0x1ba4('0x27')]=function(_0x5cd1cf,_0x3c3d90){var _0x483f94={},_0x5d61e5={},_0x573cd0={'count':0x0,'rows':[]};var _0x248003=_[_0x1ba4('0x28')](db[_0x1ba4('0x29')][_0x1ba4('0x2a')],function(_0x1e33ac){return{'name':_0x1e33ac['fieldName'],'type':_0x1e33ac[_0x1ba4('0x2b')][_0x1ba4('0x2c')]};});_0x5d61e5[_0x1ba4('0x2d')]=_[_0x1ba4('0x28')](_0x248003,_0x1ba4('0x25'));_0x5d61e5['query']=_['keys'](_0x5cd1cf['query']);_0x5d61e5[_0x1ba4('0x2e')]=_['intersection'](_0x5d61e5[_0x1ba4('0x2d')],_0x5d61e5['query']);_0x483f94[_0x1ba4('0x2f')]=_[_0x1ba4('0x30')](_0x5d61e5['model'],qs[_0x1ba4('0x31')](_0x5cd1cf['query']['fields']));_0x483f94[_0x1ba4('0x2f')]=_0x483f94[_0x1ba4('0x2f')][_0x1ba4('0x32')]?_0x483f94[_0x1ba4('0x2f')]:_0x5d61e5[_0x1ba4('0x2d')];if(!_0x5cd1cf[_0x1ba4('0x33')][_0x1ba4('0x34')]('nolimit')){_0x483f94[_0x1ba4('0x35')]=qs['limit'](_0x5cd1cf['query'][_0x1ba4('0x35')]);_0x483f94[_0x1ba4('0x1b')]=qs['offset'](_0x5cd1cf[_0x1ba4('0x33')][_0x1ba4('0x1b')]);}_0x483f94[_0x1ba4('0x36')]=qs[_0x1ba4('0x37')](_0x5cd1cf[_0x1ba4('0x33')]['sort']);_0x483f94[_0x1ba4('0x38')]=qs[_0x1ba4('0x2e')](_['pick'](_0x5cd1cf['query'],_0x5d61e5['filters']));if(_0x5cd1cf[_0x1ba4('0x33')]['filter']){_0x483f94['where']=_[_0x1ba4('0x39')](_0x483f94[_0x1ba4('0x38')],{'$or':_['map'](_0x248003,function(_0x125c02){if(_0x125c02['type']!==_0x1ba4('0x3a')){var _0x4a7e08={};_0x4a7e08[_0x125c02[_0x1ba4('0x25')]]={'$like':'%'+_0x5cd1cf[_0x1ba4('0x33')]['filter']+'%'};return _0x4a7e08;}})});}_0x483f94=_[_0x1ba4('0x39')]({},_0x483f94,_0x5cd1cf[_0x1ba4('0x3b')]);var _0x996830={'where':_0x483f94[_0x1ba4('0x38')]};return db[_0x1ba4('0x29')][_0x1ba4('0x1a')](_0x996830)[_0x1ba4('0x22')](function(_0x3cc839){_0x573cd0[_0x1ba4('0x1a')]=_0x3cc839;if(_0x5cd1cf[_0x1ba4('0x33')][_0x1ba4('0x3c')]){_0x483f94[_0x1ba4('0x3d')]=[{'all':!![]}];}return db[_0x1ba4('0x29')][_0x1ba4('0x3e')](_0x483f94);})[_0x1ba4('0x22')](function(_0x230cdf){_0x573cd0[_0x1ba4('0x3f')]=_0x230cdf;return _0x573cd0;})[_0x1ba4('0x22')](respondWithFilteredResult(_0x3c3d90,_0x483f94))[_0x1ba4('0x40')](handleError(_0x3c3d90,null));};exports['show']=function(_0x2f9140,_0x9c91d0){var _0x4f3915={'raw':![],'where':{'id':_0x2f9140[_0x1ba4('0x41')]['id']}},_0xd3a1ca={};_0xd3a1ca[_0x1ba4('0x2d')]=_[_0x1ba4('0x42')](db[_0x1ba4('0x29')][_0x1ba4('0x2a')]);_0xd3a1ca[_0x1ba4('0x33')]=_[_0x1ba4('0x42')](_0x2f9140[_0x1ba4('0x33')]);_0xd3a1ca[_0x1ba4('0x2e')]=_[_0x1ba4('0x30')](_0xd3a1ca[_0x1ba4('0x2d')],_0xd3a1ca[_0x1ba4('0x33')]);_0x4f3915[_0x1ba4('0x2f')]=_[_0x1ba4('0x30')](_0xd3a1ca['model'],qs[_0x1ba4('0x31')](_0x2f9140[_0x1ba4('0x33')][_0x1ba4('0x31')]));_0x4f3915[_0x1ba4('0x2f')]=_0x4f3915[_0x1ba4('0x2f')]['length']?_0x4f3915[_0x1ba4('0x2f')]:_0xd3a1ca[_0x1ba4('0x2d')];if(_0x2f9140[_0x1ba4('0x33')][_0x1ba4('0x3c')]){_0x4f3915['include']=[{'all':!![]}];}_0x4f3915=_[_0x1ba4('0x39')]({},_0x4f3915,_0x2f9140[_0x1ba4('0x3b')]);return db['Integration']['find'](_0x4f3915)['then'](handleEntityNotFound(_0x9c91d0,null))[_0x1ba4('0x22')](respondWithResult(_0x9c91d0,null))[_0x1ba4('0x40')](handleError(_0x9c91d0,null));};exports[_0x1ba4('0x43')]=function(_0x2b620c,_0x420413){return db[_0x1ba4('0x29')][_0x1ba4('0x43')](_0x2b620c[_0x1ba4('0x44')],{})['then'](respondWithResult(_0x420413,0xc9))[_0x1ba4('0x40')](handleError(_0x420413,null));};exports['update']=function(_0x4c43c9,_0x98f0af){if(_0x4c43c9[_0x1ba4('0x44')]['id']){delete _0x4c43c9[_0x1ba4('0x44')]['id'];}return db[_0x1ba4('0x29')][_0x1ba4('0x45')]({'where':{'id':_0x4c43c9[_0x1ba4('0x41')]['id']}})[_0x1ba4('0x22')](handleEntityNotFound(_0x98f0af,null))[_0x1ba4('0x22')](saveUpdates(_0x4c43c9['body'],null))['then'](respondWithResult(_0x98f0af,null))[_0x1ba4('0x40')](handleError(_0x98f0af,null));};exports[_0x1ba4('0x21')]=function(_0x5049aa,_0x162446){return db[_0x1ba4('0x29')][_0x1ba4('0x45')]({'where':{'id':_0x5049aa['params']['id']}})[_0x1ba4('0x22')](handleEntityNotFound(_0x162446,null))[_0x1ba4('0x22')](removeEntity(_0x162446,null))[_0x1ba4('0x40')](handleError(_0x162446,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index c31a243..4b8f281 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 _0xeca6=['path','rimraf','../../config/environment','exports','define','Integration','integrations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2705fc,_0x86a624){var _0x47c903=function(_0x390d35){while(--_0x390d35){_0x2705fc['push'](_0x2705fc['shift']());}};_0x47c903(++_0x86a624);}(_0xeca6,0x173));var _0x6eca=function(_0x98f9eb,_0x1b02b2){_0x98f9eb=_0x98f9eb-0x0;var _0x244a11=_0xeca6[_0x98f9eb];return _0x244a11;};'use strict';var _=require(_0x6eca('0x0'));var util=require(_0x6eca('0x1'));var logger=require(_0x6eca('0x2'))(_0x6eca('0x3'));var moment=require(_0x6eca('0x4'));var BPromise=require(_0x6eca('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6eca('0x6'));var rimraf=require(_0x6eca('0x7'));var config=require(_0x6eca('0x8'));var attributes=require('./integration.attributes');module[_0x6eca('0x9')]=function(_0xa98499,_0x2022f6){return _0xa98499[_0x6eca('0xa')](_0x6eca('0xb'),attributes,{'tableName':_0x6eca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x884a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./integration.attributes','exports','define','Integration'];(function(_0x14a513,_0x3239f){var _0x47236c=function(_0x394191){while(--_0x394191){_0x14a513['push'](_0x14a513['shift']());}};_0x47236c(++_0x3239f);}(_0x884a,0xe0));var _0xa884=function(_0x16acff,_0xb7f670){_0x16acff=_0x16acff-0x0;var _0x341456=_0x884a[_0x16acff];return _0x341456;};'use strict';var _=require(_0xa884('0x0'));var util=require(_0xa884('0x1'));var logger=require(_0xa884('0x2'))(_0xa884('0x3'));var moment=require(_0xa884('0x4'));var BPromise=require(_0xa884('0x5'));var rp=require(_0xa884('0x6'));var fs=require('fs');var path=require(_0xa884('0x7'));var rimraf=require(_0xa884('0x8'));var config=require(_0xa884('0x9'));var attributes=require(_0xa884('0xa'));module[_0xa884('0xb')]=function(_0x25be67,_0x4fc301){return _0x25be67[_0xa884('0xc')](_0xa884('0xd'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integration/integration.rpc.js b/server/api/integration/integration.rpc.js index b898320..86e3e94 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 _0xed08=['request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x2d0508,_0x5dc92b){var _0x40bc8f=function(_0x3891ce){while(--_0x3891ce){_0x2d0508['push'](_0x2d0508['shift']());}};_0x40bc8f(++_0x5dc92b);}(_0xed08,0x67));var _0x8ed0=function(_0x3b2521,_0x7f9fc0){_0x3b2521=_0x3b2521-0x0;var _0x80eb40=_0xed08[_0x3b2521];return _0x80eb40;};'use strict';var _=require('lodash');var util=require(_0x8ed0('0x0'));var moment=require(_0x8ed0('0x1'));var BPromise=require(_0x8ed0('0x2'));var rs=require(_0x8ed0('0x3'));var fs=require('fs');var Redis=require(_0x8ed0('0x4'));var db=require(_0x8ed0('0x5'))['db'];var utils=require(_0x8ed0('0x6'));var logger=require(_0x8ed0('0x7'))(_0x8ed0('0x8'));var config=require(_0x8ed0('0x9'));var jayson=require(_0x8ed0('0xa'));var client=jayson[_0x8ed0('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15f266,_0x2eb70c,_0x1c86e6){return new BPromise(function(_0x39642a,_0x18d07d){return client[_0x8ed0('0xc')](_0x15f266,_0x1c86e6)[_0x8ed0('0xd')](function(_0x4f1083){logger[_0x8ed0('0xe')](_0x8ed0('0xf'),_0x2eb70c,_0x8ed0('0x10'));logger[_0x8ed0('0x11')]('Integration,\x20%s,\x20%s,\x20%s',_0x2eb70c,_0x8ed0('0x10'),JSON[_0x8ed0('0x12')](_0x4f1083));if(_0x4f1083[_0x8ed0('0x13')]){if(_0x4f1083[_0x8ed0('0x13')][_0x8ed0('0x14')]===0x1f4){logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x4f1083[_0x8ed0('0x13')][_0x8ed0('0x15')]);return _0x18d07d(_0x4f1083[_0x8ed0('0x13')]['message']);}logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x4f1083['error'][_0x8ed0('0x15')]);return _0x39642a(_0x4f1083[_0x8ed0('0x13')]['message']);}else{logger[_0x8ed0('0xe')](_0x8ed0('0xf'),_0x2eb70c,'request\x20sent');_0x39642a(_0x4f1083[_0x8ed0('0x16')][_0x8ed0('0x15')]);}})['catch'](function(_0x2792c8){logger[_0x8ed0('0x13')](_0x8ed0('0xf'),_0x2eb70c,_0x2792c8);_0x18d07d(_0x2792c8);});});} \ No newline at end of file +var _0xbf07=['request','then','info','Integration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/environment'];(function(_0x3acbde,_0x2b424b){var _0x564636=function(_0x41b235){while(--_0x41b235){_0x3acbde['push'](_0x3acbde['shift']());}};_0x564636(++_0x2b424b);}(_0xbf07,0x77));var _0x7bf0=function(_0x340380,_0x4bd2a8){_0x340380=_0x340380-0x0;var _0x49ce1c=_0xbf07[_0x340380];return _0x49ce1c;};'use strict';var _=require(_0x7bf0('0x0'));var util=require(_0x7bf0('0x1'));var moment=require(_0x7bf0('0x2'));var BPromise=require(_0x7bf0('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7bf0('0x4'));var db=require(_0x7bf0('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7bf0('0x6'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x44f656,_0x50e680,_0x263964){return new BPromise(function(_0x536214,_0x415291){return client[_0x7bf0('0x7')](_0x44f656,_0x263964)[_0x7bf0('0x8')](function(_0x2565c7){logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,'request\x20sent');logger[_0x7bf0('0xb')]('Integration,\x20%s,\x20%s,\x20%s',_0x50e680,_0x7bf0('0xc'),JSON[_0x7bf0('0xd')](_0x2565c7));if(_0x2565c7[_0x7bf0('0xe')]){if(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0xf')]===0x1f4){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x415291(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);return _0x536214(_0x2565c7[_0x7bf0('0xe')][_0x7bf0('0x10')]);}else{logger[_0x7bf0('0x9')](_0x7bf0('0xa'),_0x50e680,_0x7bf0('0xc'));_0x536214(_0x2565c7['result'][_0x7bf0('0x10')]);}})[_0x7bf0('0x11')](function(_0x187489){logger[_0x7bf0('0xe')](_0x7bf0('0xa'),_0x50e680,_0x187489);_0x415291(_0x187489);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 175a7c4..723167f 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 _0x305b=['index','/describe','/:id','show','post','create','put','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated'];(function(_0x2ba5a2,_0x4a5605){var _0x387a24=function(_0x105731){while(--_0x105731){_0x2ba5a2['push'](_0x2ba5a2['shift']());}};_0x387a24(++_0x4a5605);}(_0x305b,0x81));var _0xb305=function(_0x50e40b,_0x338d17){_0x50e40b=_0x50e40b-0x0;var _0x2608b7=_0x305b[_0x50e40b];return _0x2608b7;};'use strict';var multer=require(_0xb305('0x0'));var util=require(_0xb305('0x1'));var path=require(_0xb305('0x2'));var timeout=require('connect-timeout');var express=require(_0xb305('0x3'));var router=express[_0xb305('0x4')]();var auth=require(_0xb305('0x5'));var interaction=require(_0xb305('0x6'));var config=require(_0xb305('0x7'));var controller=require(_0xb305('0x8'));router[_0xb305('0x9')]('/',auth[_0xb305('0xa')](),controller[_0xb305('0xb')]);router[_0xb305('0x9')](_0xb305('0xc'),auth[_0xb305('0xa')](),controller['describe']);router['get'](_0xb305('0xd'),auth['isAuthenticated'](),controller[_0xb305('0xe')]);router[_0xb305('0xf')]('/',auth[_0xb305('0xa')](),controller[_0xb305('0x10')]);router[_0xb305('0x11')]('/:id',auth['isAuthenticated'](),controller['update']);router['delete'](_0xb305('0xd'),auth['isAuthenticated'](),controller[_0xb305('0x12')]);module[_0xb305('0x13')]=router; \ No newline at end of file +var _0x8109=['/describe','/:id','show','post','create','put','update','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./integrationReport.controller','get','isAuthenticated','index'];(function(_0x9809c3,_0x570133){var _0x196f85=function(_0xc925cd){while(--_0xc925cd){_0x9809c3['push'](_0x9809c3['shift']());}};_0x196f85(++_0x570133);}(_0x8109,0xa9));var _0x9810=function(_0x25df9e,_0x19b7fe){_0x25df9e=_0x25df9e-0x0;var _0x4e9e69=_0x8109[_0x25df9e];return _0x4e9e69;};'use strict';var multer=require(_0x9810('0x0'));var util=require('util');var path=require(_0x9810('0x1'));var timeout=require(_0x9810('0x2'));var express=require('express');var router=express[_0x9810('0x3')]();var auth=require(_0x9810('0x4'));var interaction=require(_0x9810('0x5'));var config=require(_0x9810('0x6'));var controller=require(_0x9810('0x7'));router[_0x9810('0x8')]('/',auth[_0x9810('0x9')](),controller[_0x9810('0xa')]);router[_0x9810('0x8')](_0x9810('0xb'),auth[_0x9810('0x9')](),controller['describe']);router[_0x9810('0x8')](_0x9810('0xc'),auth[_0x9810('0x9')](),controller[_0x9810('0xd')]);router[_0x9810('0xe')]('/',auth['isAuthenticated'](),controller[_0x9810('0xf')]);router[_0x9810('0x10')](_0x9810('0xc'),auth['isAuthenticated'](),controller[_0x9810('0x11')]);router['delete']('/:id',auth[_0x9810('0x9')](),controller[_0x9810('0x12')]);module[_0x9810('0x13')]=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index f0e25fd..ec7f9f7 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 _0x5c50=['DATE','INTEGER','BOOLEAN','TEXT','SENT','SENDING','RECEIVED','FAILED','sequelize','exports','STRING'];(function(_0x5042e9,_0x428a02){var _0x5aa6dc=function(_0x417f3e){while(--_0x417f3e){_0x5042e9['push'](_0x5042e9['shift']());}};_0x5aa6dc(++_0x428a02);}(_0x5c50,0x11b));var _0x05c5=function(_0x7c1a77,_0x1cefe3){_0x7c1a77=_0x7c1a77-0x0;var _0x3496d7=_0x5c50[_0x7c1a77];return _0x3496d7;};'use strict';var Sequelize=require(_0x05c5('0x0'));module[_0x05c5('0x1')]={'integration':{'type':Sequelize[_0x05c5('0x2')]},'eventChannel':{'type':Sequelize[_0x05c5('0x2')]},'exitStatus':{'type':Sequelize[_0x05c5('0x2')]},'ticketId':{'type':Sequelize[_0x05c5('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x05c5('0x2')]},'uniqueid':{'type':Sequelize[_0x05c5('0x2')]},'calleridnum':{'type':Sequelize[_0x05c5('0x2')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x05c5('0x2')]},'membername':{'type':Sequelize[_0x05c5('0x2')]},'agentcalledAt':{'type':Sequelize[_0x05c5('0x3')]},'agentconnectAt':{'type':Sequelize[_0x05c5('0x3')]},'holdtime':{'type':Sequelize[_0x05c5('0x4')]},'agentcomplete':{'type':Sequelize[_0x05c5('0x5')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x05c5('0x3')]},'talktime':{'type':Sequelize[_0x05c5('0x4')]},'agentacw':{'type':Sequelize[_0x05c5('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x05c5('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x05c5('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize['DATE']},'agentdump':{'type':Sequelize[_0x05c5('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize[_0x05c5('0x2')]},'channel':{'type':Sequelize[_0x05c5('0x2')]},'channelstate':{'type':Sequelize[_0x05c5('0x4')]},'channelstatedesc':{'type':Sequelize[_0x05c5('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x05c5('0x2')]},'language':{'type':Sequelize[_0x05c5('0x2')]},'accountcode':{'type':Sequelize[_0x05c5('0x2')]},'context':{'type':Sequelize[_0x05c5('0x2')]},'exten':{'type':Sequelize[_0x05c5('0x2')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x05c5('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize[_0x05c5('0x2')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x05c5('0x2')]},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x05c5('0x2')]},'destaccountcode':{'type':Sequelize[_0x05c5('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x05c5('0x2')]},'destpriority':{'type':Sequelize[_0x05c5('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x05c5('0x2')]},'inReplyTo':{'type':Sequelize[_0x05c5('0x2')]},'subject':{'type':Sequelize[_0x05c5('0x2')]},'from':{'type':Sequelize[_0x05c5('0x2')]},'to':{'type':Sequelize[_0x05c5('0x2')]},'cc':{'type':Sequelize[_0x05c5('0x2')]},'attachment':{'type':Sequelize[_0x05c5('0x6')]},'html':{'type':Sequelize[_0x05c5('0x6')]},'text':{'type':Sequelize[_0x05c5('0x6')]},'status':{'type':Sequelize['ENUM'](_0x05c5('0x7'),_0x05c5('0x8'),_0x05c5('0x9'),_0x05c5('0xa'))},'url':{'type':Sequelize[_0x05c5('0x2')]},'app':{'type':Sequelize[_0x05c5('0x2')]},'appdata':{'type':Sequelize[_0x05c5('0x2')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5b09=['sequelize','STRING','INTEGER','DATE','BOOLEAN','TEXT','RECEIVED','FAILED'];(function(_0x365e54,_0x44be74){var _0x13317a=function(_0x2d917f){while(--_0x2d917f){_0x365e54['push'](_0x365e54['shift']());}};_0x13317a(++_0x44be74);}(_0x5b09,0x130));var _0x95b0=function(_0x458482,_0x1681c3){_0x458482=_0x458482-0x0;var _0x2281f7=_0x5b09[_0x458482];return _0x2281f7;};'use strict';var Sequelize=require(_0x95b0('0x0'));module['exports']={'integration':{'type':Sequelize[_0x95b0('0x1')]},'eventChannel':{'type':Sequelize['STRING']},'exitStatus':{'type':Sequelize['STRING']},'ticketId':{'type':Sequelize[_0x95b0('0x1')]},'integrationId':{'type':Sequelize[_0x95b0('0x2')]},'contacts':{'type':Sequelize[_0x95b0('0x1')]},'uniqueid':{'type':Sequelize[_0x95b0('0x1')]},'calleridnum':{'type':Sequelize[_0x95b0('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'interface':{'type':Sequelize[_0x95b0('0x1')]},'membername':{'type':Sequelize[_0x95b0('0x1')]},'agentcalledAt':{'type':Sequelize[_0x95b0('0x3')]},'agentconnectAt':{'type':Sequelize[_0x95b0('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x95b0('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x95b0('0x3')]},'talktime':{'type':Sequelize[_0x95b0('0x2')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x95b0('0x2')]},'reason':{'type':Sequelize['STRING']},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x95b0('0x3')]},'agentdump':{'type':Sequelize[_0x95b0('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x95b0('0x3')]},'lastevent':{'type':Sequelize[_0x95b0('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x95b0('0x2')]},'channelstatedesc':{'type':Sequelize[_0x95b0('0x1')]},'connectedlinenum':{'type':Sequelize[_0x95b0('0x1')]},'connectedlinename':{'type':Sequelize[_0x95b0('0x1')]},'language':{'type':Sequelize[_0x95b0('0x1')]},'accountcode':{'type':Sequelize[_0x95b0('0x1')]},'context':{'type':Sequelize[_0x95b0('0x1')]},'exten':{'type':Sequelize[_0x95b0('0x1')]},'priority':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x95b0('0x1')]},'destchannelstate':{'type':Sequelize[_0x95b0('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x95b0('0x1')]},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize[_0x95b0('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x95b0('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x95b0('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize[_0x95b0('0x1')]},'destexten':{'type':Sequelize[_0x95b0('0x1')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x95b0('0x1')]},'messageId':{'type':Sequelize[_0x95b0('0x1')]},'inReplyTo':{'type':Sequelize[_0x95b0('0x1')]},'subject':{'type':Sequelize[_0x95b0('0x1')]},'from':{'type':Sequelize[_0x95b0('0x1')]},'to':{'type':Sequelize[_0x95b0('0x1')]},'cc':{'type':Sequelize[_0x95b0('0x1')]},'attachment':{'type':Sequelize[_0x95b0('0x5')]},'html':{'type':Sequelize[_0x95b0('0x5')]},'text':{'type':Sequelize[_0x95b0('0x5')]},'status':{'type':Sequelize['ENUM']('SENT','SENDING',_0x95b0('0x6'),_0x95b0('0x7'))},'url':{'type':Sequelize[_0x95b0('0x1')]},'app':{'type':Sequelize[_0x95b0('0x1')]},'appdata':{'type':Sequelize[_0x95b0('0x1')]},'projectId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index 05f77db..2118e33 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 _0xf970=['fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','include','findAll','rows','catch','show','params','keys','rawAttributes','includeAll','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','name','send','index','map','IntegrationReport','fieldName','type','key','model','query','filters','intersection','attributes'];(function(_0x586145,_0x49ae34){var _0x2a482e=function(_0x435055){while(--_0x435055){_0x586145['push'](_0x586145['shift']());}};_0x2a482e(++_0x49ae34);}(_0xf970,0x1d9));var _0x0f97=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf970[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x0f97('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0f97('0x1'));var zipdir=require(_0x0f97('0x2'));var jsonpatch=require(_0x0f97('0x3'));var rp=require(_0x0f97('0x4'));var moment=require(_0x0f97('0x5'));var BPromise=require(_0x0f97('0x6'));var Mustache=require(_0x0f97('0x7'));var util=require('util');var path=require(_0x0f97('0x8'));var sox=require(_0x0f97('0x9'));var csv=require(_0x0f97('0xa'));var ejs=require(_0x0f97('0xb'));var fs=require('fs');var _=require(_0x0f97('0xc'));var squel=require(_0x0f97('0xd'));var crypto=require(_0x0f97('0xe'));var jsforce=require(_0x0f97('0xf'));var deskjs=require(_0x0f97('0x10'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0f97('0x11'));var Redis=require('ioredis');var authService=require(_0x0f97('0x12'));var qs=require(_0x0f97('0x13'));var as=require(_0x0f97('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0f97('0x15'))('api');var utils=require(_0x0f97('0x16'));var config=require(_0x0f97('0x17'));var db=require(_0x0f97('0x18'))['db'];function respondWithStatusCode(_0x431cf5,_0x38ae73){_0x38ae73=_0x38ae73||0xcc;return function(_0x4934af){if(_0x4934af){return _0x431cf5[_0x0f97('0x19')](_0x38ae73);}return _0x431cf5[_0x0f97('0x1a')](_0x38ae73)[_0x0f97('0x1b')]();};}function respondWithResult(_0xa35fd,_0x2aeeed){_0x2aeeed=_0x2aeeed||0xc8;return function(_0x300f29){if(_0x300f29){return _0xa35fd[_0x0f97('0x1a')](_0x2aeeed)['json'](_0x300f29);}};}function respondWithFilteredResult(_0x4c34fc,_0x2a1fb8){return function(_0x2392c0){if(_0x2392c0){var _0x1448f9=_0x2392c0[_0x0f97('0x1c')],_0xe92b09=_0x2a1fb8[_0x0f97('0x1d')],_0x5e3f3a=_0x2a1fb8[_0x0f97('0x1d')]+_0x2a1fb8[_0x0f97('0x1e')],_0x58cb79;if(_0x5e3f3a>=_0x1448f9){_0x5e3f3a=_0x1448f9;_0x58cb79=0xc8;}else{_0x58cb79=0xce;}_0x4c34fc[_0x0f97('0x1a')](_0x58cb79);return _0x4c34fc[_0x0f97('0x1f')]('Content-Range',_0xe92b09+'-'+_0x5e3f3a+'/'+_0x1448f9)['json'](_0x2392c0);}return null;};}function patchUpdates(_0x35a341){return function(_0x132d2f){try{jsonpatch[_0x0f97('0x20')](_0x132d2f,_0x35a341,!![]);}catch(_0x425d97){return BPromise[_0x0f97('0x21')](_0x425d97);}return _0x132d2f[_0x0f97('0x22')]();};}function saveUpdates(_0x4a50a8,_0x27b771){return function(_0x15a1ef){if(_0x15a1ef){return _0x15a1ef[_0x0f97('0x23')](_0x4a50a8)[_0x0f97('0x24')](function(_0x13c7ed){return _0x13c7ed;});}return null;};}function removeEntity(_0x316e84,_0x21784d){return function(_0x52dde8){if(_0x52dde8){return _0x52dde8[_0x0f97('0x25')]()[_0x0f97('0x24')](function(){_0x316e84[_0x0f97('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31d384,_0x25d1ef){return function(_0x4ec6d0){if(!_0x4ec6d0){_0x31d384[_0x0f97('0x19')](0x194);}return _0x4ec6d0;};}function handleError(_0x15df5c,_0x4ef5bc){_0x4ef5bc=_0x4ef5bc||0x1f4;return function(_0x489e1e){logger['error'](_0x489e1e[_0x0f97('0x26')]);if(_0x489e1e[_0x0f97('0x27')]){delete _0x489e1e['name'];}_0x15df5c[_0x0f97('0x1a')](_0x4ef5bc)[_0x0f97('0x28')](_0x489e1e);};}exports[_0x0f97('0x29')]=function(_0x30d33d,_0x10f71c){var _0x23f078={},_0x51a376={},_0x164ad6={'count':0x0,'rows':[]};var _0x1e688d=_[_0x0f97('0x2a')](db[_0x0f97('0x2b')]['rawAttributes'],function(_0x2f17ef){return{'name':_0x2f17ef[_0x0f97('0x2c')],'type':_0x2f17ef[_0x0f97('0x2d')][_0x0f97('0x2e')]};});_0x51a376[_0x0f97('0x2f')]=_[_0x0f97('0x2a')](_0x1e688d,_0x0f97('0x27'));_0x51a376[_0x0f97('0x30')]=_['keys'](_0x30d33d['query']);_0x51a376[_0x0f97('0x31')]=_[_0x0f97('0x32')](_0x51a376[_0x0f97('0x2f')],_0x51a376[_0x0f97('0x30')]);_0x23f078[_0x0f97('0x33')]=_[_0x0f97('0x32')](_0x51a376[_0x0f97('0x2f')],qs[_0x0f97('0x34')](_0x30d33d[_0x0f97('0x30')][_0x0f97('0x34')]));_0x23f078[_0x0f97('0x33')]=_0x23f078['attributes'][_0x0f97('0x35')]?_0x23f078[_0x0f97('0x33')]:_0x51a376[_0x0f97('0x2f')];if(!_0x30d33d[_0x0f97('0x30')][_0x0f97('0x36')]('nolimit')){_0x23f078[_0x0f97('0x1e')]=qs['limit'](_0x30d33d[_0x0f97('0x30')]['limit']);_0x23f078[_0x0f97('0x1d')]=qs[_0x0f97('0x1d')](_0x30d33d[_0x0f97('0x30')][_0x0f97('0x1d')]);}_0x23f078[_0x0f97('0x37')]=qs['sort'](_0x30d33d['query'][_0x0f97('0x38')]);_0x23f078[_0x0f97('0x39')]=qs['filters'](_[_0x0f97('0x3a')](_0x30d33d[_0x0f97('0x30')],_0x51a376[_0x0f97('0x31')]));if(_0x30d33d[_0x0f97('0x30')]['filter']){_0x23f078[_0x0f97('0x39')]=_[_0x0f97('0x3b')](_0x23f078[_0x0f97('0x39')],{'$or':_[_0x0f97('0x2a')](_0x1e688d,function(_0x38c42e){if(_0x38c42e['type']!==_0x0f97('0x3c')){var _0x36effc={};_0x36effc[_0x38c42e[_0x0f97('0x27')]]={'$like':'%'+_0x30d33d[_0x0f97('0x30')][_0x0f97('0x3d')]+'%'};return _0x36effc;}})});}_0x23f078=_[_0x0f97('0x3b')]({},_0x23f078,_0x30d33d['options']);var _0x516e3b={'where':_0x23f078[_0x0f97('0x39')]};return db[_0x0f97('0x2b')][_0x0f97('0x1c')](_0x516e3b)['then'](function(_0x19b24e){_0x164ad6[_0x0f97('0x1c')]=_0x19b24e;if(_0x30d33d[_0x0f97('0x30')]['includeAll']){_0x23f078[_0x0f97('0x3e')]=[{'all':!![]}];}return db[_0x0f97('0x2b')][_0x0f97('0x3f')](_0x23f078);})[_0x0f97('0x24')](function(_0x3c84f7){_0x164ad6[_0x0f97('0x40')]=_0x3c84f7;return _0x164ad6;})[_0x0f97('0x24')](respondWithFilteredResult(_0x10f71c,_0x23f078))[_0x0f97('0x41')](handleError(_0x10f71c,null));};exports[_0x0f97('0x42')]=function(_0x79aa92,_0x3087af){var _0x5c1cd1={'raw':![],'where':{'id':_0x79aa92[_0x0f97('0x43')]['id']}},_0x22c424={};_0x22c424['model']=_[_0x0f97('0x44')](db['IntegrationReport'][_0x0f97('0x45')]);_0x22c424[_0x0f97('0x30')]=_[_0x0f97('0x44')](_0x79aa92['query']);_0x22c424['filters']=_[_0x0f97('0x32')](_0x22c424[_0x0f97('0x2f')],_0x22c424[_0x0f97('0x30')]);_0x5c1cd1[_0x0f97('0x33')]=_[_0x0f97('0x32')](_0x22c424['model'],qs['fields'](_0x79aa92[_0x0f97('0x30')][_0x0f97('0x34')]));_0x5c1cd1[_0x0f97('0x33')]=_0x5c1cd1[_0x0f97('0x33')][_0x0f97('0x35')]?_0x5c1cd1[_0x0f97('0x33')]:_0x22c424[_0x0f97('0x2f')];if(_0x79aa92[_0x0f97('0x30')][_0x0f97('0x46')]){_0x5c1cd1['include']=[{'all':!![]}];}_0x5c1cd1=_[_0x0f97('0x3b')]({},_0x5c1cd1,_0x79aa92['options']);return db[_0x0f97('0x2b')][_0x0f97('0x47')](_0x5c1cd1)[_0x0f97('0x24')](handleEntityNotFound(_0x3087af,null))['then'](respondWithResult(_0x3087af,null))['catch'](handleError(_0x3087af,null));};exports[_0x0f97('0x48')]=function(_0x267629,_0x40ea51){return db['IntegrationReport']['create'](_0x267629['body'],{})[_0x0f97('0x24')](respondWithResult(_0x40ea51,0xc9))[_0x0f97('0x41')](handleError(_0x40ea51,null));};exports[_0x0f97('0x23')]=function(_0xf95e68,_0x13e08c){if(_0xf95e68[_0x0f97('0x49')]['id']){delete _0xf95e68[_0x0f97('0x49')]['id'];}return db[_0x0f97('0x2b')][_0x0f97('0x47')]({'where':{'id':_0xf95e68[_0x0f97('0x43')]['id']}})[_0x0f97('0x24')](handleEntityNotFound(_0x13e08c,null))['then'](saveUpdates(_0xf95e68[_0x0f97('0x49')],null))['then'](respondWithResult(_0x13e08c,null))['catch'](handleError(_0x13e08c,null));};exports[_0x0f97('0x25')]=function(_0x5d0fec,_0x1a2f25){return db[_0x0f97('0x2b')][_0x0f97('0x47')]({'where':{'id':_0x5d0fec[_0x0f97('0x43')]['id']}})[_0x0f97('0x24')](handleEntityNotFound(_0x1a2f25,null))['then'](removeEntity(_0x1a2f25,null))['catch'](handleError(_0x1a2f25,null));};exports[_0x0f97('0x4a')]=function(_0xf5fedc,_0x517ea0){return db[_0x0f97('0x2b')][_0x0f97('0x4a')]()[_0x0f97('0x24')](respondWithResult(_0x517ea0,null))[_0x0f97('0x41')](handleError(_0x517ea0,null));}; \ No newline at end of file +var _0xfef3=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','IntegrationReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','catch','show','params','find','create','body','describe','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring'];(function(_0x12ca5f,_0x223d98){var _0xfc3ae9=function(_0x1928fb){while(--_0x1928fb){_0x12ca5f['push'](_0x12ca5f['shift']());}};_0xfc3ae9(++_0x223d98);}(_0xfef3,0x118));var _0x3fef=function(_0x50f158,_0x1b49ef){_0x50f158=_0x50f158-0x0;var _0x380590=_0xfef3[_0x50f158];return _0x380590;};'use strict';var pdf=require(_0x3fef('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3fef('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x3fef('0x2'));var rp=require(_0x3fef('0x3'));var moment=require('moment');var BPromise=require(_0x3fef('0x4'));var Mustache=require(_0x3fef('0x5'));var util=require('util');var path=require(_0x3fef('0x6'));var sox=require(_0x3fef('0x7'));var csv=require('to-csv');var ejs=require(_0x3fef('0x8'));var fs=require('fs');var _=require(_0x3fef('0x9'));var squel=require(_0x3fef('0xa'));var crypto=require(_0x3fef('0xb'));var jsforce=require(_0x3fef('0xc'));var deskjs=require(_0x3fef('0xd'));var toCsv=require(_0x3fef('0xe'));var querystring=require(_0x3fef('0xf'));var Papa=require(_0x3fef('0x10'));var Redis=require(_0x3fef('0x11'));var authService=require(_0x3fef('0x12'));var qs=require(_0x3fef('0x13'));var as=require(_0x3fef('0x14'));var hardwareService=require(_0x3fef('0x15'));var logger=require('../../config/logger')(_0x3fef('0x16'));var utils=require(_0x3fef('0x17'));var config=require(_0x3fef('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1c20b3,_0x4c4a47){_0x4c4a47=_0x4c4a47||0xcc;return function(_0x2c99ff){if(_0x2c99ff){return _0x1c20b3[_0x3fef('0x19')](_0x4c4a47);}return _0x1c20b3[_0x3fef('0x1a')](_0x4c4a47)['end']();};}function respondWithResult(_0x42c3d2,_0x4be62f){_0x4be62f=_0x4be62f||0xc8;return function(_0x15b757){if(_0x15b757){return _0x42c3d2[_0x3fef('0x1a')](_0x4be62f)['json'](_0x15b757);}};}function respondWithFilteredResult(_0x2dec1b,_0x177e28){return function(_0x40b479){if(_0x40b479){var _0x79b617=_0x40b479[_0x3fef('0x1b')],_0x395df0=_0x177e28[_0x3fef('0x1c')],_0x2af1ba=_0x177e28[_0x3fef('0x1c')]+_0x177e28[_0x3fef('0x1d')],_0x5c899f;if(_0x2af1ba>=_0x79b617){_0x2af1ba=_0x79b617;_0x5c899f=0xc8;}else{_0x5c899f=0xce;}_0x2dec1b[_0x3fef('0x1a')](_0x5c899f);return _0x2dec1b[_0x3fef('0x1e')]('Content-Range',_0x395df0+'-'+_0x2af1ba+'/'+_0x79b617)[_0x3fef('0x1f')](_0x40b479);}return null;};}function patchUpdates(_0x3eb287){return function(_0x53d4fd){try{jsonpatch[_0x3fef('0x20')](_0x53d4fd,_0x3eb287,!![]);}catch(_0x51a554){return BPromise[_0x3fef('0x21')](_0x51a554);}return _0x53d4fd[_0x3fef('0x22')]();};}function saveUpdates(_0x245332,_0x2b5226){return function(_0x451d11){if(_0x451d11){return _0x451d11[_0x3fef('0x23')](_0x245332)[_0x3fef('0x24')](function(_0xd64bf4){return _0xd64bf4;});}return null;};}function removeEntity(_0x1f5aaf,_0x3bb110){return function(_0x2eb578){if(_0x2eb578){return _0x2eb578[_0x3fef('0x25')]()[_0x3fef('0x24')](function(){_0x1f5aaf['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x50025f,_0x378b03){return function(_0x3ba38d){if(!_0x3ba38d){_0x50025f[_0x3fef('0x19')](0x194);}return _0x3ba38d;};}function handleError(_0x5f047c,_0x4d462c){_0x4d462c=_0x4d462c||0x1f4;return function(_0x56c542){logger[_0x3fef('0x26')](_0x56c542[_0x3fef('0x27')]);if(_0x56c542[_0x3fef('0x28')]){delete _0x56c542[_0x3fef('0x28')];}_0x5f047c[_0x3fef('0x1a')](_0x4d462c)['send'](_0x56c542);};}exports['index']=function(_0x563556,_0x121ff0){var _0x3baa52={},_0x4ea2ab={},_0x462ee7={'count':0x0,'rows':[]};var _0x6d08cd=_['map'](db[_0x3fef('0x29')][_0x3fef('0x2a')],function(_0xf892bb){return{'name':_0xf892bb[_0x3fef('0x2b')],'type':_0xf892bb[_0x3fef('0x2c')][_0x3fef('0x2d')]};});_0x4ea2ab[_0x3fef('0x2e')]=_['map'](_0x6d08cd,_0x3fef('0x28'));_0x4ea2ab[_0x3fef('0x2f')]=_[_0x3fef('0x30')](_0x563556[_0x3fef('0x2f')]);_0x4ea2ab['filters']=_[_0x3fef('0x31')](_0x4ea2ab['model'],_0x4ea2ab[_0x3fef('0x2f')]);_0x3baa52[_0x3fef('0x32')]=_[_0x3fef('0x31')](_0x4ea2ab[_0x3fef('0x2e')],qs[_0x3fef('0x33')](_0x563556[_0x3fef('0x2f')][_0x3fef('0x33')]));_0x3baa52[_0x3fef('0x32')]=_0x3baa52[_0x3fef('0x32')][_0x3fef('0x34')]?_0x3baa52['attributes']:_0x4ea2ab['model'];if(!_0x563556[_0x3fef('0x2f')]['hasOwnProperty'](_0x3fef('0x35'))){_0x3baa52[_0x3fef('0x1d')]=qs[_0x3fef('0x1d')](_0x563556[_0x3fef('0x2f')][_0x3fef('0x1d')]);_0x3baa52[_0x3fef('0x1c')]=qs[_0x3fef('0x1c')](_0x563556[_0x3fef('0x2f')][_0x3fef('0x1c')]);}_0x3baa52[_0x3fef('0x36')]=qs[_0x3fef('0x37')](_0x563556[_0x3fef('0x2f')][_0x3fef('0x37')]);_0x3baa52[_0x3fef('0x38')]=qs['filters'](_[_0x3fef('0x39')](_0x563556[_0x3fef('0x2f')],_0x4ea2ab[_0x3fef('0x3a')]));if(_0x563556[_0x3fef('0x2f')][_0x3fef('0x3b')]){_0x3baa52[_0x3fef('0x38')]=_['merge'](_0x3baa52['where'],{'$or':_[_0x3fef('0x3c')](_0x6d08cd,function(_0x163de0){if(_0x163de0[_0x3fef('0x2c')]!==_0x3fef('0x3d')){var _0x69e494={};_0x69e494[_0x163de0[_0x3fef('0x28')]]={'$like':'%'+_0x563556[_0x3fef('0x2f')][_0x3fef('0x3b')]+'%'};return _0x69e494;}})});}_0x3baa52=_[_0x3fef('0x3e')]({},_0x3baa52,_0x563556[_0x3fef('0x3f')]);var _0x391053={'where':_0x3baa52['where']};return db[_0x3fef('0x29')][_0x3fef('0x1b')](_0x391053)['then'](function(_0x54e329){_0x462ee7[_0x3fef('0x1b')]=_0x54e329;if(_0x563556[_0x3fef('0x2f')][_0x3fef('0x40')]){_0x3baa52[_0x3fef('0x41')]=[{'all':!![]}];}return db[_0x3fef('0x29')][_0x3fef('0x42')](_0x3baa52);})[_0x3fef('0x24')](function(_0x42e43d){_0x462ee7['rows']=_0x42e43d;return _0x462ee7;})[_0x3fef('0x24')](respondWithFilteredResult(_0x121ff0,_0x3baa52))[_0x3fef('0x43')](handleError(_0x121ff0,null));};exports[_0x3fef('0x44')]=function(_0x3dceed,_0x1fe9ee){var _0x2143ec={'raw':![],'where':{'id':_0x3dceed[_0x3fef('0x45')]['id']}},_0x545154={};_0x545154[_0x3fef('0x2e')]=_[_0x3fef('0x30')](db[_0x3fef('0x29')][_0x3fef('0x2a')]);_0x545154[_0x3fef('0x2f')]=_[_0x3fef('0x30')](_0x3dceed[_0x3fef('0x2f')]);_0x545154['filters']=_[_0x3fef('0x31')](_0x545154[_0x3fef('0x2e')],_0x545154[_0x3fef('0x2f')]);_0x2143ec[_0x3fef('0x32')]=_[_0x3fef('0x31')](_0x545154[_0x3fef('0x2e')],qs['fields'](_0x3dceed[_0x3fef('0x2f')]['fields']));_0x2143ec[_0x3fef('0x32')]=_0x2143ec[_0x3fef('0x32')]['length']?_0x2143ec[_0x3fef('0x32')]:_0x545154['model'];if(_0x3dceed[_0x3fef('0x2f')][_0x3fef('0x40')]){_0x2143ec[_0x3fef('0x41')]=[{'all':!![]}];}_0x2143ec=_[_0x3fef('0x3e')]({},_0x2143ec,_0x3dceed[_0x3fef('0x3f')]);return db[_0x3fef('0x29')][_0x3fef('0x46')](_0x2143ec)[_0x3fef('0x24')](handleEntityNotFound(_0x1fe9ee,null))[_0x3fef('0x24')](respondWithResult(_0x1fe9ee,null))[_0x3fef('0x43')](handleError(_0x1fe9ee,null));};exports[_0x3fef('0x47')]=function(_0x3e96c9,_0xce173f){return db['IntegrationReport'][_0x3fef('0x47')](_0x3e96c9[_0x3fef('0x48')],{})['then'](respondWithResult(_0xce173f,0xc9))[_0x3fef('0x43')](handleError(_0xce173f,null));};exports[_0x3fef('0x23')]=function(_0x2f00c0,_0x505680){if(_0x2f00c0[_0x3fef('0x48')]['id']){delete _0x2f00c0[_0x3fef('0x48')]['id'];}return db['IntegrationReport'][_0x3fef('0x46')]({'where':{'id':_0x2f00c0['params']['id']}})['then'](handleEntityNotFound(_0x505680,null))[_0x3fef('0x24')](saveUpdates(_0x2f00c0['body'],null))[_0x3fef('0x24')](respondWithResult(_0x505680,null))[_0x3fef('0x43')](handleError(_0x505680,null));};exports['destroy']=function(_0x4535e8,_0x2823f4){return db[_0x3fef('0x29')]['find']({'where':{'id':_0x4535e8[_0x3fef('0x45')]['id']}})[_0x3fef('0x24')](handleEntityNotFound(_0x2823f4,null))[_0x3fef('0x24')](removeEntity(_0x2823f4,null))['catch'](handleError(_0x2823f4,null));};exports[_0x3fef('0x49')]=function(_0x154311,_0x2a6b71){return db[_0x3fef('0x29')][_0x3fef('0x49')]()['then'](respondWithResult(_0x2a6b71,null))[_0x3fef('0x43')](handleError(_0x2a6b71,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index 0aa63d2..db3df2d 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 _0xde3e=['IntegrationReport','lodash','util','../../config/logger','path','rimraf','./integrationReport.attributes','exports'];(function(_0x4ce0af,_0x22148e){var _0x2e38d5=function(_0x5eed75){while(--_0x5eed75){_0x4ce0af['push'](_0x4ce0af['shift']());}};_0x2e38d5(++_0x22148e);}(_0xde3e,0x71));var _0xede3=function(_0x243b59,_0x3f9495){_0x243b59=_0x243b59-0x0;var _0x3e1676=_0xde3e[_0x243b59];return _0x3e1676;};'use strict';var _=require(_0xede3('0x0'));var util=require(_0xede3('0x1'));var logger=require(_0xede3('0x2'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xede3('0x3'));var rimraf=require(_0xede3('0x4'));var config=require('../../config/environment');var attributes=require(_0xede3('0x5'));module[_0xede3('0x6')]=function(_0x18f47d,_0x37c79f){return _0x18f47d['define'](_0xede3('0x7'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3cc4=['request-promise','rimraf','../../config/environment','exports','IntegrationReport','report_integration','util','../../config/logger','bluebird'];(function(_0x4bfc65,_0x70602){var _0x36d09c=function(_0xd7b568){while(--_0xd7b568){_0x4bfc65['push'](_0x4bfc65['shift']());}};_0x36d09c(++_0x70602);}(_0x3cc4,0x189));var _0x43cc=function(_0x419cd1,_0x252568){_0x419cd1=_0x419cd1-0x0;var _0x2f4515=_0x3cc4[_0x419cd1];return _0x2f4515;};'use strict';var _=require('lodash');var util=require(_0x43cc('0x0'));var logger=require(_0x43cc('0x1'))('api');var moment=require('moment');var BPromise=require(_0x43cc('0x2'));var rp=require(_0x43cc('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x43cc('0x4'));var config=require(_0x43cc('0x5'));var attributes=require('./integrationReport.attributes');module[_0x43cc('0x6')]=function(_0x3b4800,_0x32deff){return _0x3b4800['define'](_0x43cc('0x7'),attributes,{'tableName':_0x43cc('0x8'),'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 5e11412..5c5f758 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 _0x4fc2=['bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x456fb1,_0x859a1d){var _0x4083d6=function(_0xe1d0f2){while(--_0xe1d0f2){_0x456fb1['push'](_0x456fb1['shift']());}};_0x4083d6(++_0x859a1d);}(_0x4fc2,0x111));var _0x24fc=function(_0x197954,_0x3f61d0){_0x197954=_0x197954-0x0;var _0x231d54=_0x4fc2[_0x197954];return _0x231d54;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('IntegrationReport,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x3cc29f,_0x353898){var _0x5609de=function(_0x1cb9ae){while(--_0x1cb9ae){_0x3cc29f['push'](_0x3cc29f['shift']());}};_0x5609de(++_0x353898);}(_0xda2d,0x102));var _0xdda2=function(_0x593d18,_0x3fabae){_0x593d18=_0x593d18-0x0;var _0x1369cc=_0xda2d[_0x593d18];return _0x1369cc;};'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']('IntegrationReport,\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')]('IntegrationReport,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index a386aef..8ee6e1d 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 _0x3e74=['isAuthenticated','index','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','put','/:id','update','destroy','exports','multer','path','connect-timeout','express','../../components/interaction/service','./interval.controller','get'];(function(_0x5c8c7f,_0x3acfde){var _0x514e60=function(_0x1c7258){while(--_0x1c7258){_0x5c8c7f['push'](_0x5c8c7f['shift']());}};_0x514e60(++_0x3acfde);}(_0x3e74,0x175));var _0x43e7=function(_0xc3a47c,_0x50763e){_0xc3a47c=_0xc3a47c-0x0;var _0x1feede=_0x3e74[_0xc3a47c];return _0x1feede;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['getIntervals']);router[_0x43e7('0xb')]('/',auth['isAuthenticated'](),controller['create']);router[_0x43e7('0xb')](_0x43e7('0xa'),auth['isAuthenticated'](),controller[_0x43e7('0xc')]);router['post'](_0x43e7('0xd'),auth[_0x43e7('0x7')](),controller['addIntervals']);router[_0x43e7('0xe')](_0x43e7('0xf'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router['delete']('/:id',auth[_0x43e7('0x7')](),controller[_0x43e7('0x11')]);module[_0x43e7('0x12')]=router; \ No newline at end of file +var _0x9957=['../../config/environment','get','isAuthenticated','index','/:id','/:id/sub_intervals','getIntervals','post','create','/:id/sub_intervals/create_many','addIntervals','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x45d3f0,_0x4be53f){var _0x314b79=function(_0x563d32){while(--_0x563d32){_0x45d3f0['push'](_0x45d3f0['shift']());}};_0x314b79(++_0x4be53f);}(_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('./interval.controller');router[_0x7995('0x8')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xa')]);router[_0x7995('0x8')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller['show']);router[_0x7995('0x8')](_0x7995('0xc'),auth['isAuthenticated'](),controller[_0x7995('0xd')]);router[_0x7995('0xe')]('/',auth[_0x7995('0x9')](),controller[_0x7995('0xf')]);router[_0x7995('0xe')](_0x7995('0xc'),auth[_0x7995('0x9')](),controller['addInterval']);router[_0x7995('0xe')](_0x7995('0x10'),auth['isAuthenticated'](),controller[_0x7995('0x11')]);router[_0x7995('0x12')](_0x7995('0xb'),auth[_0x7995('0x9')](),controller[_0x7995('0x13')]);router[_0x7995('0x14')](_0x7995('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x7995('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index 3cafacb..e22ab65 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 _0xfc44=['STRING','sequelize','exports'];(function(_0x477eb0,_0x258b92){var _0x72dc21=function(_0x49f310){while(--_0x49f310){_0x477eb0['push'](_0x477eb0['shift']());}};_0x72dc21(++_0x258b92);}(_0xfc44,0x18d));var _0x4fc4=function(_0x1812fb,_0x54a4b2){_0x1812fb=_0x1812fb-0x0;var _0xcf33fc=_0xfc44[_0x1812fb];return _0xcf33fc;};'use strict';var Sequelize=require(_0x4fc4('0x0'));module[_0x4fc4('0x1')]={'name':{'type':Sequelize[_0x4fc4('0x2')]},'description':{'type':Sequelize[_0x4fc4('0x2')]},'interval':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0x89a0=['exports'];(function(_0x3e4e3c,_0x76f441){var _0x5cd3f3=function(_0x314fc5){while(--_0x314fc5){_0x3e4e3c['push'](_0x3e4e3c['shift']());}};_0x5cd3f3(++_0x76f441);}(_0x89a0,0x13b));var _0x089a=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x89a0[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require('sequelize');module[_0x089a('0x0')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'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 1c8fcc3..48145ec 100644 --- a/server/api/interval/interval.controller.js +++ b/server/api/interval/interval.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x4c7149,_0x335342){var _0x200122=function(_0x358259){while(--_0x358259){_0x4c7149['push'](_0x4c7149['shift']());}};_0x200122(++_0x335342);}(_0x008c,0x188));var _0xc008=function(_0x162f62,_0x1a0ab1){_0x162f62=_0x162f62-0x0;var _0x26c56e=_0x008c[_0x162f62];return _0x26c56e;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file +var _0xa9e0=['rows','catch','show','params','includeAll','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','get','UserProfileSection','find','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addInterval','IntervalId','getIntervals','pick','nolimit','addIntervals','findOne','transaction','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','../../components/extensions/rewrite','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','Intervals','UserProfileResource','stack','name','send','index','map','Interval','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','filter','merge','where','VIRTUAL','count','include','findAll'];(function(_0x1d2e28,_0x2655d5){var _0x1cb062=function(_0x525479){while(--_0x525479){_0x1d2e28['push'](_0x1d2e28['shift']());}};_0x1cb062(++_0x2655d5);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xa9e0[_0x2763f2];return _0x3ef471;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');var _=require(_0x0a9e('0xa'));var squel=require(_0x0a9e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x0a9e('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0a9e('0xd'));var Redis=require(_0x0a9e('0xe'));var authService=require(_0x0a9e('0xf'));var qs=require(_0x0a9e('0x10'));var as=require(_0x0a9e('0x11'));var hardwareService=require(_0x0a9e('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x0a9e('0x13'))['db'];var extensions=require(_0x0a9e('0x14'));function respondWithStatusCode(_0xd5b662,_0x26d672){_0x26d672=_0x26d672||0xcc;return function(_0x32d742){if(_0x32d742){return _0xd5b662[_0x0a9e('0x15')](_0x26d672);}return _0xd5b662['status'](_0x26d672)[_0x0a9e('0x16')]();};}function respondWithResult(_0x239b12,_0x2b4227){_0x2b4227=_0x2b4227||0xc8;return function(_0x281129){if(_0x281129){return _0x239b12[_0x0a9e('0x17')](_0x2b4227)[_0x0a9e('0x18')](_0x281129);}};}function respondWithFilteredResult(_0x52a03d,_0x22dccb){return function(_0x5d0880){if(_0x5d0880){var _0x1985b6=_0x5d0880['count'],_0x519dfd=_0x22dccb[_0x0a9e('0x19')],_0x16033c=_0x22dccb['offset']+_0x22dccb[_0x0a9e('0x1a')],_0x12066b;if(_0x16033c>=_0x1985b6){_0x16033c=_0x1985b6;_0x12066b=0xc8;}else{_0x12066b=0xce;}_0x52a03d[_0x0a9e('0x17')](_0x12066b);return _0x52a03d[_0x0a9e('0x1b')](_0x0a9e('0x1c'),_0x519dfd+'-'+_0x16033c+'/'+_0x1985b6)[_0x0a9e('0x18')](_0x5d0880);}return null;};}function patchUpdates(_0x2eb11f){return function(_0x530eb7){try{jsonpatch[_0x0a9e('0x1d')](_0x530eb7,_0x2eb11f,!![]);}catch(_0x1314ae){return BPromise[_0x0a9e('0x1e')](_0x1314ae);}return _0x530eb7[_0x0a9e('0x1f')]();};}function saveUpdates(_0x105080,_0x4bb1e3){return function(_0x2c3407){if(_0x2c3407){return _0x2c3407[_0x0a9e('0x20')](_0x105080)['then'](function(_0x20f109){return _0x20f109;});}return null;};}function removeEntity(_0x5a09ef,_0x588269){return function(_0x3a02e1){if(_0x3a02e1){return _0x3a02e1[_0x0a9e('0x21')]()[_0x0a9e('0x22')](function(){var _0x30bae6=_0x3a02e1['get']({'plain':!![]});var _0xfb6e48=_0x0a9e('0x23');return db[_0x0a9e('0x24')][_0x0a9e('0x21')]({'where':{'type':_0xfb6e48,'resourceId':_0x30bae6['id']}})[_0x0a9e('0x22')](function(){return _0x3a02e1;});})[_0x0a9e('0x22')](function(){_0x5a09ef[_0x0a9e('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x59181e,_0x197ec0){return function(_0x3a8e58){if(!_0x3a8e58){_0x59181e[_0x0a9e('0x15')](0x194);}return _0x3a8e58;};}function handleError(_0x33161b,_0x526cf3){_0x526cf3=_0x526cf3||0x1f4;return function(_0x384319){logger['error'](_0x384319[_0x0a9e('0x25')]);if(_0x384319['name']){delete _0x384319[_0x0a9e('0x26')];}_0x33161b[_0x0a9e('0x17')](_0x526cf3)[_0x0a9e('0x27')](_0x384319);};}exports[_0x0a9e('0x28')]=function(_0x140511,_0x1538a4){var _0x11c3b6={},_0x14de77={},_0x5a101a={'count':0x0,'rows':[]};var _0x3652a7=_[_0x0a9e('0x29')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')],function(_0x5c877d){return{'name':_0x5c877d[_0x0a9e('0x2c')],'type':_0x5c877d[_0x0a9e('0x2d')][_0x0a9e('0x2e')]};});_0x14de77[_0x0a9e('0x2f')]=_[_0x0a9e('0x29')](_0x3652a7,_0x0a9e('0x26'));_0x14de77[_0x0a9e('0x30')]=_[_0x0a9e('0x31')](_0x140511[_0x0a9e('0x30')]);_0x14de77['filters']=_[_0x0a9e('0x32')](_0x14de77['model'],_0x14de77[_0x0a9e('0x30')]);_0x11c3b6[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x14de77[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0x140511['query'][_0x0a9e('0x34')]));_0x11c3b6[_0x0a9e('0x33')]=_0x11c3b6[_0x0a9e('0x33')][_0x0a9e('0x35')]?_0x11c3b6[_0x0a9e('0x33')]:_0x14de77[_0x0a9e('0x2f')];if(!_0x140511[_0x0a9e('0x30')][_0x0a9e('0x36')]('nolimit')){_0x11c3b6[_0x0a9e('0x1a')]=qs['limit'](_0x140511[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x11c3b6[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x140511['query'][_0x0a9e('0x19')]);}_0x11c3b6[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x140511[_0x0a9e('0x30')]['sort']);_0x11c3b6['where']=qs[_0x0a9e('0x39')](_['pick'](_0x140511[_0x0a9e('0x30')],_0x14de77[_0x0a9e('0x39')]));if(_0x140511[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x11c3b6['where']=_[_0x0a9e('0x3b')](_0x11c3b6[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x3652a7,function(_0x533942){if(_0x533942[_0x0a9e('0x2d')]!==_0x0a9e('0x3d')){var _0x289467={};_0x289467[_0x533942['name']]={'$like':'%'+_0x140511['query'][_0x0a9e('0x3a')]+'%'};return _0x289467;}})});}_0x11c3b6=_[_0x0a9e('0x3b')]({},_0x11c3b6,_0x140511['options']);var _0x2b814e={'where':_0x11c3b6[_0x0a9e('0x3c')]};return db[_0x0a9e('0x2a')][_0x0a9e('0x3e')](_0x2b814e)['then'](function(_0x5a594b){_0x5a101a[_0x0a9e('0x3e')]=_0x5a594b;if(_0x140511[_0x0a9e('0x30')]['includeAll']){_0x11c3b6[_0x0a9e('0x3f')]=[{'all':!![]}];}return db[_0x0a9e('0x2a')][_0x0a9e('0x40')](_0x11c3b6);})['then'](function(_0x316c8f){_0x5a101a[_0x0a9e('0x41')]=_0x316c8f;return _0x5a101a;})[_0x0a9e('0x22')](respondWithFilteredResult(_0x1538a4,_0x11c3b6))[_0x0a9e('0x42')](handleError(_0x1538a4,null));};exports[_0x0a9e('0x43')]=function(_0xeaa5e5,_0x2881b3){var _0x45a9b8={'raw':!![],'where':{'id':_0xeaa5e5[_0x0a9e('0x44')]['id']}},_0x23b089={};_0x23b089[_0x0a9e('0x2f')]=_[_0x0a9e('0x31')](db[_0x0a9e('0x2a')][_0x0a9e('0x2b')]);_0x23b089[_0x0a9e('0x30')]=_['keys'](_0xeaa5e5['query']);_0x23b089[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],_0x23b089[_0x0a9e('0x30')]);_0x45a9b8[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x23b089[_0x0a9e('0x2f')],qs[_0x0a9e('0x34')](_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x34')]));_0x45a9b8[_0x0a9e('0x33')]=_0x45a9b8[_0x0a9e('0x33')]['length']?_0x45a9b8[_0x0a9e('0x33')]:_0x23b089[_0x0a9e('0x2f')];if(_0xeaa5e5[_0x0a9e('0x30')][_0x0a9e('0x45')]){_0x45a9b8[_0x0a9e('0x3f')]=[{'all':!![]}];}_0x45a9b8=_[_0x0a9e('0x3b')]({},_0x45a9b8,_0xeaa5e5[_0x0a9e('0x46')]);return db[_0x0a9e('0x2a')]['find'](_0x45a9b8)[_0x0a9e('0x22')](handleEntityNotFound(_0x2881b3,null))['then'](respondWithResult(_0x2881b3,null))[_0x0a9e('0x42')](handleError(_0x2881b3,null));};exports[_0x0a9e('0x47')]=function(_0x8d6dd1,_0x562fb4){return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x8d6dd1[_0x0a9e('0x48')],{})[_0x0a9e('0x22')](function(_0x45c845){var _0x37be73=_0x8d6dd1[_0x0a9e('0x49')]['get']({'plain':!![]});if(!_0x37be73)throw new Error(_0x0a9e('0x4a'));if(_0x37be73[_0x0a9e('0x4b')]===_0x0a9e('0x49')){var _0x16f976=_0x45c845[_0x0a9e('0x4c')]({'plain':!![]});var _0x992c77=_0x0a9e('0x23');return db[_0x0a9e('0x4d')][_0x0a9e('0x4e')]({'where':{'name':_0x992c77,'userProfileId':_0x37be73['userProfileId']},'raw':!![]})[_0x0a9e('0x22')](function(_0x3fe430){if(_0x3fe430&&_0x3fe430['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x16f976[_0x0a9e('0x26')],'resourceId':_0x16f976['id'],'type':_0x3fe430[_0x0a9e('0x26')],'sectionId':_0x3fe430['id']},{})[_0x0a9e('0x22')](function(){return _0x45c845;});}else{return _0x45c845;}})[_0x0a9e('0x42')](function(_0x61bb17){logger[_0x0a9e('0x4f')](_0x0a9e('0x50'),_0x61bb17);throw _0x61bb17;});}return _0x45c845;})[_0x0a9e('0x22')](respondWithResult(_0x562fb4,0xc9))['catch'](handleError(_0x562fb4,null));};exports['update']=function(_0x53975a,_0x39d77d){if(_0x53975a[_0x0a9e('0x48')]['id']){delete _0x53975a[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x53975a[_0x0a9e('0x44')]['id']}})['then'](handleEntityNotFound(_0x39d77d,null))['then'](saveUpdates(_0x53975a[_0x0a9e('0x48')],null))['then'](respondWithResult(_0x39d77d,null))[_0x0a9e('0x42')](handleError(_0x39d77d,null));};exports['destroy']=function(_0x2e5e62,_0x3c20b2){return db[_0x0a9e('0x2a')]['find']({'where':{'id':_0x2e5e62[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x3c20b2,null))['then'](removeEntity(_0x3c20b2,null))['catch'](handleError(_0x3c20b2,null));};exports[_0x0a9e('0x51')]=function(_0x3aedd0,_0x49c095,_0x145931){if(_0x3aedd0['body']['id']){delete _0x3aedd0[_0x0a9e('0x48')]['id'];}return db['Interval'][_0x0a9e('0x4e')]({'where':{'id':_0x3aedd0['params']['id']}})['then'](handleEntityNotFound(_0x49c095,null))['then'](function(_0x2da03c){if(_0x2da03c){_0x3aedd0['body'][_0x0a9e('0x52')]=_0x2da03c['id'];return db[_0x0a9e('0x2a')][_0x0a9e('0x47')](_0x3aedd0[_0x0a9e('0x48')]);}})[_0x0a9e('0x22')](respondWithResult(_0x49c095,null))[_0x0a9e('0x42')](handleError(_0x49c095,null));};exports[_0x0a9e('0x53')]=function(_0x28d814,_0x4e67ab,_0x1c693e){var _0x121cef={};var _0x2642bb={};var _0x30c491;var _0xb83dfd;return db[_0x0a9e('0x2a')]['findOne']({'where':{'id':_0x28d814[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4e67ab,null))['then'](function(_0x3649cc){if(_0x3649cc){_0x30c491=_0x3649cc;_0x2642bb['model']=_[_0x0a9e('0x31')](db['Interval']['rawAttributes']);_0x2642bb['query']=_[_0x0a9e('0x31')](_0x28d814['query']);_0x2642bb[_0x0a9e('0x39')]=_[_0x0a9e('0x32')](_0x2642bb[_0x0a9e('0x2f')],_0x2642bb[_0x0a9e('0x30')]);_0x121cef[_0x0a9e('0x33')]=_[_0x0a9e('0x32')](_0x2642bb['model'],qs[_0x0a9e('0x34')](_0x28d814['query'][_0x0a9e('0x34')]));_0x121cef[_0x0a9e('0x33')]=_0x121cef[_0x0a9e('0x33')]['length']?_0x121cef[_0x0a9e('0x33')]:_0x2642bb[_0x0a9e('0x2f')];_0x121cef[_0x0a9e('0x37')]=qs[_0x0a9e('0x38')](_0x28d814['query'][_0x0a9e('0x38')]);_0x121cef[_0x0a9e('0x3c')]=qs['filters'](_[_0x0a9e('0x54')](_0x28d814[_0x0a9e('0x30')],_0x2642bb[_0x0a9e('0x39')]));if(_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x3a')]){_0x121cef['where']=_[_0x0a9e('0x3b')](_0x121cef[_0x0a9e('0x3c')],{'$or':_[_0x0a9e('0x29')](_0x121cef['attributes'],function(_0x3528b7){var _0x4f1e60={};_0x4f1e60[_0x3528b7]={'$like':'%'+_0x28d814['query'][_0x0a9e('0x3a')]+'%'};return _0x4f1e60;})});}_0x121cef=_[_0x0a9e('0x3b')]({},_0x121cef,_0x28d814[_0x0a9e('0x46')]);return _0x30c491[_0x0a9e('0x53')](_0x121cef);}})[_0x0a9e('0x22')](function(_0xc8c264){if(_0xc8c264){_0xb83dfd=_0xc8c264[_0x0a9e('0x35')];if(!_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x36')](_0x0a9e('0x55'))){_0x121cef[_0x0a9e('0x1a')]=qs[_0x0a9e('0x1a')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x1a')]);_0x121cef[_0x0a9e('0x19')]=qs[_0x0a9e('0x19')](_0x28d814[_0x0a9e('0x30')][_0x0a9e('0x19')]);}return _0x30c491['getIntervals'](_0x121cef);}})[_0x0a9e('0x22')](function(_0x295763){if(_0x295763){return _0x295763?{'count':_0xb83dfd,'rows':_0x295763}:null;}})[_0x0a9e('0x22')](respondWithResult(_0x4e67ab,null))['catch'](handleError(_0x4e67ab,null));};exports[_0x0a9e('0x56')]=function(_0x30944e,_0x4b341d,_0x83f0b2){return db[_0x0a9e('0x2a')][_0x0a9e('0x57')]({'where':{'id':_0x30944e[_0x0a9e('0x44')]['id']}})[_0x0a9e('0x22')](handleEntityNotFound(_0x4b341d,null))['then'](function(_0x50cdce){if(_0x50cdce){return db['sequelize'][_0x0a9e('0x58')](function(_0x18bf5d){return db[_0x0a9e('0x2a')][_0x0a9e('0x21')]({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']},'transaction':_0x18bf5d})[_0x0a9e('0x22')](function(_0xeef20){var _0x1a0677=_['map'](_0x30944e[_0x0a9e('0x48')],function(_0xcbc8b2){delete _0xcbc8b2['id'];_0xcbc8b2[_0x0a9e('0x52')]=_0x30944e['params']['id'];return _0xcbc8b2;});return db[_0x0a9e('0x2a')]['bulkCreate'](_0x1a0677,{'transaction':_0x18bf5d});});})[_0x0a9e('0x22')](function(){return db[_0x0a9e('0x2a')]['findAll']({'where':{'IntervalId':_0x30944e[_0x0a9e('0x44')]['id']}});});}})[_0x0a9e('0x22')](respondWithResult(_0x4b341d,null))[_0x0a9e('0x42')](handleError(_0x4b341d,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index ccd1316..f6f9663 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 _0xf04c=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util'];(function(_0x1c414e,_0x1fa05c){var _0x2bb7ca=function(_0x2437d0){while(--_0x2437d0){_0x1c414e['push'](_0x1c414e['shift']());}};_0x2bb7ca(++_0x1fa05c);}(_0xf04c,0xfd));var _0xcf04=function(_0x2e24d3,_0x4aa947){_0x2e24d3=_0x2e24d3-0x0;var _0x279570=_0xf04c[_0x2e24d3];return _0x279570;};'use strict';var _=require(_0xcf04('0x0'));var util=require(_0xcf04('0x1'));var logger=require(_0xcf04('0x2'))(_0xcf04('0x3'));var moment=require(_0xcf04('0x4'));var BPromise=require('bluebird');var rp=require(_0xcf04('0x5'));var fs=require('fs');var path=require(_0xcf04('0x6'));var rimraf=require(_0xcf04('0x7'));var config=require(_0xcf04('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0xcf04('0x9'));module[_0xcf04('0xa')]=function(_0x52ce4d,_0x5d26a7){return _0x52ce4d[_0xcf04('0xb')](_0xcf04('0xc'),attributes,{'tableName':_0xcf04('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x5023cc,_0x2fe04b){extensions[_0xcf04('0xe')](_0x52ce4d,_0x5023cc);},'afterBulkCreate':function(_0x2598ed,_0x58278b,_0x546af6){_0x546af6();extensions[_0xcf04('0xe')](_0x52ce4d,_0x2598ed[0x0]);},'afterUpdate':function(_0x204b8,_0x116a63){extensions['rewrite'](_0x52ce4d,_0x204b8);},'afterDestroy':function(_0x4ad788,_0x33f2f9){extensions[_0xcf04('0xe')](_0x52ce4d,_0x4ad788);}}});}; \ No newline at end of file +var _0x7d19=['define','rewrite','lodash','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports'];(function(_0x4f8330,_0x5e60e1){var _0x49748c=function(_0x4f748c){while(--_0x4f748c){_0x4f8330['push'](_0x4f8330['shift']());}};_0x49748c(++_0x5e60e1);}(_0x7d19,0x9e));var _0x97d1=function(_0x527733,_0x16051c){_0x527733=_0x527733-0x0;var _0x5400ba=_0x7d19[_0x527733];return _0x5400ba;};'use strict';var _=require(_0x97d1('0x0'));var util=require('util');var logger=require(_0x97d1('0x1'))(_0x97d1('0x2'));var moment=require(_0x97d1('0x3'));var BPromise=require(_0x97d1('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97d1('0x5'));var rimraf=require(_0x97d1('0x6'));var config=require(_0x97d1('0x7'));var attributes=require(_0x97d1('0x8'));var extensions=require(_0x97d1('0x9'));module[_0x97d1('0xa')]=function(_0x1b7ea5,_0x3c26e0){return _0x1b7ea5[_0x97d1('0xb')]('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f0b27,_0x18647c){extensions[_0x97d1('0xc')](_0x1b7ea5,_0x2f0b27);},'afterBulkCreate':function(_0x25ed01,_0x1b5c4a,_0x2e7a3a){_0x2e7a3a();extensions['rewrite'](_0x1b7ea5,_0x25ed01[0x0]);},'afterUpdate':function(_0x59c052,_0x457767){extensions[_0x97d1('0xc')](_0x1b7ea5,_0x59c052);},'afterDestroy':function(_0x2064b3,_0x3acdf4){extensions[_0x97d1('0xc')](_0x1b7ea5,_0x2064b3);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index f0b329a..d869c68 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 _0x3b8b=['info','Interval,\x20%s,\x20%s','debug','error','code','message','request\x20sent','result','catch','findAll','options','raw','where','limit','include','model','map','attributes','GetInterval','stringify','ShowInterval','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x333ffb,_0x5a4ee7){var _0x25005b=function(_0x5c99f1){while(--_0x5c99f1){_0x333ffb['push'](_0x333ffb['shift']());}};_0x25005b(++_0x5a4ee7);}(_0x3b8b,0x9e));var _0xb3b8=function(_0x482214,_0x2550ff){_0x482214=_0x482214-0x0;var _0x38d0cb=_0x3b8b[_0x482214];return _0x38d0cb;};'use strict';var _=require(_0xb3b8('0x0'));var util=require(_0xb3b8('0x1'));var moment=require(_0xb3b8('0x2'));var BPromise=require(_0xb3b8('0x3'));var rs=require(_0xb3b8('0x4'));var fs=require('fs');var Redis=require(_0xb3b8('0x5'));var db=require(_0xb3b8('0x6'))['db'];var utils=require(_0xb3b8('0x7'));var logger=require(_0xb3b8('0x8'))(_0xb3b8('0x9'));var config=require(_0xb3b8('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb3b8('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2c2aaa,_0x48970e,_0x3f8829){return new BPromise(function(_0x46f5ea,_0x4c6a55){return client['request'](_0x2c2aaa,_0x3f8829)['then'](function(_0x290560){logger[_0xb3b8('0xc')](_0xb3b8('0xd'),_0x48970e,'request\x20sent');logger[_0xb3b8('0xe')]('Interval,\x20%s,\x20%s,\x20%s',_0x48970e,'request\x20sent',JSON['stringify'](_0x290560));if(_0x290560[_0xb3b8('0xf')]){if(_0x290560[_0xb3b8('0xf')][_0xb3b8('0x10')]===0x1f4){logger[_0xb3b8('0xf')](_0xb3b8('0xd'),_0x48970e,_0x290560[_0xb3b8('0xf')]['message']);return _0x4c6a55(_0x290560[_0xb3b8('0xf')]['message']);}logger['error'](_0xb3b8('0xd'),_0x48970e,_0x290560[_0xb3b8('0xf')][_0xb3b8('0x11')]);return _0x46f5ea(_0x290560[_0xb3b8('0xf')][_0xb3b8('0x11')]);}else{logger[_0xb3b8('0xc')](_0xb3b8('0xd'),_0x48970e,_0xb3b8('0x12'));_0x46f5ea(_0x290560[_0xb3b8('0x13')][_0xb3b8('0x11')]);}})[_0xb3b8('0x14')](function(_0x44a1e6){logger[_0xb3b8('0xf')](_0xb3b8('0xd'),_0x48970e,_0x44a1e6);_0x4c6a55(_0x44a1e6);});});}exports['GetInterval']=function(_0x362dec){var _0x572a52=this;return new Promise(function(_0x563f8a,_0xd024dc){return db['Interval'][_0xb3b8('0x15')]({'raw':_0x362dec[_0xb3b8('0x16')]?_0x362dec[_0xb3b8('0x16')][_0xb3b8('0x17')]===undefined?!![]:![]:!![],'where':_0x362dec[_0xb3b8('0x16')]?_0x362dec[_0xb3b8('0x16')][_0xb3b8('0x18')]||null:null,'attributes':_0x362dec['options']?_0x362dec[_0xb3b8('0x16')]['attributes']||null:null,'limit':_0x362dec[_0xb3b8('0x16')]?_0x362dec[_0xb3b8('0x16')][_0xb3b8('0x19')]||null:null,'include':_0x362dec[_0xb3b8('0x16')]?_0x362dec['options'][_0xb3b8('0x1a')]?_['map'](_0x362dec['options']['include'],function(_0x1f988b){return{'model':db[_0x1f988b[_0xb3b8('0x1b')]],'as':_0x1f988b['as'],'attributes':_0x1f988b['attributes'],'include':_0x1f988b['include']?_[_0xb3b8('0x1c')](_0x1f988b[_0xb3b8('0x1a')],function(_0xe99ed5){return{'model':db[_0xe99ed5['model']],'as':_0xe99ed5['as'],'attributes':_0xe99ed5['attributes'],'include':_0xe99ed5[_0xb3b8('0x1a')]?_[_0xb3b8('0x1c')](_0xe99ed5[_0xb3b8('0x1a')],function(_0x53f1a8){return{'model':db[_0x53f1a8[_0xb3b8('0x1b')]],'as':_0x53f1a8['as'],'attributes':_0x53f1a8[_0xb3b8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5c9709){logger['info'](_0xb3b8('0x1e'),_0x362dec);logger['debug'](_0xb3b8('0x1e'),_0x362dec,JSON[_0xb3b8('0x1f')](_0x5c9709));_0x563f8a(_0x5c9709);})[_0xb3b8('0x14')](function(_0x19fc1b){logger[_0xb3b8('0xf')](_0xb3b8('0x1e'),_0x19fc1b[_0xb3b8('0x11')],_0x362dec);_0xd024dc(_0x572a52[_0xb3b8('0xf')](0x1f4,_0x19fc1b[_0xb3b8('0x11')]));});});};exports[_0xb3b8('0x20')]=function(_0x20a799){var _0x23f186=this;return new Promise(function(_0xd0e908,_0x251057){return db['Interval'][_0xb3b8('0x21')]({'raw':_0x20a799[_0xb3b8('0x16')]?_0x20a799[_0xb3b8('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x20a799[_0xb3b8('0x16')]?_0x20a799[_0xb3b8('0x16')][_0xb3b8('0x18')]||null:null,'attributes':_0x20a799[_0xb3b8('0x16')]?_0x20a799['options'][_0xb3b8('0x1d')]||null:null,'include':_0x20a799[_0xb3b8('0x16')]?_0x20a799[_0xb3b8('0x16')][_0xb3b8('0x1a')]?_[_0xb3b8('0x1c')](_0x20a799[_0xb3b8('0x16')]['include'],function(_0x154296){return{'model':db[_0x154296[_0xb3b8('0x1b')]],'as':_0x154296['as'],'attributes':_0x154296[_0xb3b8('0x1d')],'include':_0x154296[_0xb3b8('0x1a')]?_[_0xb3b8('0x1c')](_0x154296[_0xb3b8('0x1a')],function(_0x17190f){return{'model':db[_0x17190f[_0xb3b8('0x1b')]],'as':_0x17190f['as'],'attributes':_0x17190f[_0xb3b8('0x1d')],'include':_0x17190f[_0xb3b8('0x1a')]?_['map'](_0x17190f['include'],function(_0x2d0527){return{'model':db[_0x2d0527['model']],'as':_0x2d0527['as'],'attributes':_0x2d0527[_0xb3b8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x19b9d8){logger['info']('ShowInterval',_0x20a799);logger[_0xb3b8('0xe')](_0xb3b8('0x20'),_0x20a799,JSON['stringify'](_0x19b9d8));_0xd0e908(_0x19b9d8);})[_0xb3b8('0x14')](function(_0x47b778){logger[_0xb3b8('0xf')](_0xb3b8('0x20'),_0x47b778['message'],_0x20a799);_0x251057(_0x23f186['error'](0x1f4,_0x47b778[_0xb3b8('0x11')]));});});}; \ No newline at end of file +var _0x55e6=['findAll','options','raw','where','limit','map','model','attributes','include','then','ShowInterval','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Interval,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','GetInterval'];(function(_0x40f07c,_0x41546b){var _0x35186a=function(_0x1b24f6){while(--_0x1b24f6){_0x40f07c['push'](_0x40f07c['shift']());}};_0x35186a(++_0x41546b);}(_0x55e6,0x74));var _0x655e=function(_0x2adffa,_0x4114fd){_0x2adffa=_0x2adffa-0x0;var _0x374441=_0x55e6[_0x2adffa];return _0x374441;};'use strict';var _=require(_0x655e('0x0'));var util=require(_0x655e('0x1'));var moment=require(_0x655e('0x2'));var BPromise=require(_0x655e('0x3'));var rs=require(_0x655e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x655e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x655e('0x6'))(_0x655e('0x7'));var config=require(_0x655e('0x8'));var jayson=require(_0x655e('0x9'));var client=jayson[_0x655e('0xa')][_0x655e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x880aa2,_0x22daa9,_0x3d1817){return new BPromise(function(_0x25c956,_0x5d25b3){return client[_0x655e('0xc')](_0x880aa2,_0x3d1817)['then'](function(_0xc65c14){logger[_0x655e('0xd')](_0x655e('0xe'),_0x22daa9,'request\x20sent');logger[_0x655e('0xf')]('Interval,\x20%s,\x20%s,\x20%s',_0x22daa9,_0x655e('0x10'),JSON[_0x655e('0x11')](_0xc65c14));if(_0xc65c14[_0x655e('0x12')]){if(_0xc65c14[_0x655e('0x12')][_0x655e('0x13')]===0x1f4){logger[_0x655e('0x12')]('Interval,\x20%s,\x20%s',_0x22daa9,_0xc65c14['error'][_0x655e('0x14')]);return _0x5d25b3(_0xc65c14['error'][_0x655e('0x14')]);}logger['error'](_0x655e('0xe'),_0x22daa9,_0xc65c14[_0x655e('0x12')][_0x655e('0x14')]);return _0x25c956(_0xc65c14[_0x655e('0x12')][_0x655e('0x14')]);}else{logger[_0x655e('0xd')](_0x655e('0xe'),_0x22daa9,_0x655e('0x10'));_0x25c956(_0xc65c14[_0x655e('0x15')]['message']);}})[_0x655e('0x16')](function(_0x5d46da){logger[_0x655e('0x12')](_0x655e('0xe'),_0x22daa9,_0x5d46da);_0x5d25b3(_0x5d46da);});});}exports[_0x655e('0x17')]=function(_0x19887d){var _0x42d177=this;return new Promise(function(_0x2d5f76,_0x356350){return db['Interval'][_0x655e('0x18')]({'raw':_0x19887d[_0x655e('0x19')]?_0x19887d[_0x655e('0x19')][_0x655e('0x1a')]===undefined?!![]:![]:!![],'where':_0x19887d[_0x655e('0x19')]?_0x19887d[_0x655e('0x19')][_0x655e('0x1b')]||null:null,'attributes':_0x19887d[_0x655e('0x19')]?_0x19887d['options']['attributes']||null:null,'limit':_0x19887d[_0x655e('0x19')]?_0x19887d[_0x655e('0x19')][_0x655e('0x1c')]||null:null,'include':_0x19887d[_0x655e('0x19')]?_0x19887d[_0x655e('0x19')]['include']?_[_0x655e('0x1d')](_0x19887d[_0x655e('0x19')]['include'],function(_0xca76b9){return{'model':db[_0xca76b9[_0x655e('0x1e')]],'as':_0xca76b9['as'],'attributes':_0xca76b9[_0x655e('0x1f')],'include':_0xca76b9[_0x655e('0x20')]?_[_0x655e('0x1d')](_0xca76b9[_0x655e('0x20')],function(_0x1c4eac){return{'model':db[_0x1c4eac[_0x655e('0x1e')]],'as':_0x1c4eac['as'],'attributes':_0x1c4eac[_0x655e('0x1f')],'include':_0x1c4eac[_0x655e('0x20')]?_['map'](_0x1c4eac[_0x655e('0x20')],function(_0x410e8d){return{'model':db[_0x410e8d[_0x655e('0x1e')]],'as':_0x410e8d['as'],'attributes':_0x410e8d[_0x655e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x655e('0x21')](function(_0x474334){logger[_0x655e('0xd')]('GetInterval',_0x19887d);logger[_0x655e('0xf')](_0x655e('0x17'),_0x19887d,JSON[_0x655e('0x11')](_0x474334));_0x2d5f76(_0x474334);})[_0x655e('0x16')](function(_0x5bd7bc){logger[_0x655e('0x12')]('GetInterval',_0x5bd7bc['message'],_0x19887d);_0x356350(_0x42d177[_0x655e('0x12')](0x1f4,_0x5bd7bc[_0x655e('0x14')]));});});};exports['ShowInterval']=function(_0x39bdf5){var _0x31ce27=this;return new Promise(function(_0x35a84f,_0x16f143){return db['Interval']['find']({'raw':_0x39bdf5[_0x655e('0x19')]?_0x39bdf5[_0x655e('0x19')][_0x655e('0x1a')]===undefined?!![]:![]:!![],'where':_0x39bdf5[_0x655e('0x19')]?_0x39bdf5[_0x655e('0x19')][_0x655e('0x1b')]||null:null,'attributes':_0x39bdf5['options']?_0x39bdf5[_0x655e('0x19')]['attributes']||null:null,'include':_0x39bdf5['options']?_0x39bdf5['options'][_0x655e('0x20')]?_['map'](_0x39bdf5[_0x655e('0x19')][_0x655e('0x20')],function(_0x3816b6){return{'model':db[_0x3816b6[_0x655e('0x1e')]],'as':_0x3816b6['as'],'attributes':_0x3816b6[_0x655e('0x1f')],'include':_0x3816b6[_0x655e('0x20')]?_[_0x655e('0x1d')](_0x3816b6[_0x655e('0x20')],function(_0x1f3ae3){return{'model':db[_0x1f3ae3[_0x655e('0x1e')]],'as':_0x1f3ae3['as'],'attributes':_0x1f3ae3[_0x655e('0x1f')],'include':_0x1f3ae3[_0x655e('0x20')]?_[_0x655e('0x1d')](_0x1f3ae3['include'],function(_0x3d4d26){return{'model':db[_0x3d4d26[_0x655e('0x1e')]],'as':_0x3d4d26['as'],'attributes':_0x3d4d26[_0x655e('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x655e('0x21')](function(_0x100c20){logger[_0x655e('0xd')](_0x655e('0x22'),_0x39bdf5);logger[_0x655e('0xf')](_0x655e('0x22'),_0x39bdf5,JSON[_0x655e('0x11')](_0x100c20));_0x35a84f(_0x100c20);})[_0x655e('0x16')](function(_0x3dbf6f){logger[_0x655e('0x12')](_0x655e('0x22'),_0x3dbf6f[_0x655e('0x14')],_0x39bdf5);_0x16f143(_0x31ce27[_0x655e('0x12')](0x1f4,_0x3dbf6f[_0x655e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index 5ab49de..ee2361e 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 _0xb510=['express','Router','../../components/auth/service','./jira.controller','post','send','exports'];(function(_0x4ca050,_0x326563){var _0x45dc61=function(_0x3472){while(--_0x3472){_0x4ca050['push'](_0x4ca050['shift']());}};_0x45dc61(++_0x326563);}(_0xb510,0x173));var _0x0b51=function(_0x4a61bd,_0x1e0773){_0x4a61bd=_0x4a61bd-0x0;var _0x2f3d08=_0xb510[_0x4a61bd];return _0x2f3d08;};'use strict';var express=require(_0x0b51('0x0'));var router=express[_0x0b51('0x1')]();var auth=require(_0x0b51('0x2'));var controller=require(_0x0b51('0x3'));router[_0x0b51('0x4')]('/',auth['isAuthenticated'](),controller[_0x0b51('0x5')]);module[_0x0b51('0x6')]=router; \ No newline at end of file +var _0xc635=['exports','express','Router','../../components/auth/service','./jira.controller','post','send'];(function(_0x44b53a,_0x103ad2){var _0x283009=function(_0x319c76){while(--_0x319c76){_0x44b53a['push'](_0x44b53a['shift']());}};_0x283009(++_0x103ad2);}(_0xc635,0x1b3));var _0x5c63=function(_0x5dd6b5,_0x48209a){_0x5dd6b5=_0x5dd6b5-0x0;var _0x7e3fa2=_0xc635[_0x5dd6b5];return _0x7e3fa2;};'use strict';var express=require(_0x5c63('0x0'));var router=express[_0x5c63('0x1')]();var auth=require(_0x5c63('0x2'));var controller=require(_0x5c63('0x3'));router[_0x5c63('0x4')]('/',auth['isAuthenticated'](),controller[_0x5c63('0x5')]);module[_0x5c63('0x6')]=router; \ No newline at end of file diff --git a/server/api/jira/jira.controller.js b/server/api/jira/jira.controller.js index 6f3164a..29fc36f 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 _0x8c65=['email','customfield_11501','oldToken','customfield_11502','customfield_11504','reason','customfield_10102','/rest/api/2/issue','POST','application/json','base64','stringify','request','setEncoding','utf8','data','end','status','json','parse','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body','x-forwarded-for','connection','socket','remoteAddress','bluebird','https','../../config/logger','api','support','3eAmWpBVP0','key','MOTGUI','\x20from\x20','description','issuetype','fields','customfield_11500'];(function(_0x5d308f,_0xb03877){var _0x46652f=function(_0x2d2288){while(--_0x2d2288){_0x5d308f['push'](_0x5d308f['shift']());}};_0x46652f(++_0xb03877);}(_0x8c65,0x197));var _0x58c6=function(_0x38616d,_0x22fbe5){_0x38616d=_0x38616d-0x0;var _0x505626=_0x8c65[_0x38616d];return _0x505626;};'use strict';var BPromise=require(_0x58c6('0x0'));var https=require(_0x58c6('0x1'));var logger=require(_0x58c6('0x2'))(_0x58c6('0x3'));var USERNAME=_0x58c6('0x4');var PASSWORD=_0x58c6('0x5');function openIssue(_0x5e2309,_0x4f03de){var _0x3d743d={'fields':{'project':{'key':_0x5e2309[_0x58c6('0x6')]||_0x58c6('0x7')},'summary':(_0x5e2309['summary']||'Report')+_0x58c6('0x8')+_0x5e2309['ip'],'description':_0x5e2309[_0x58c6('0x9')]||JSON['stringify'](_0x5e2309),'issuetype':{'name':_0x5e2309[_0x58c6('0xa')]||'Bug'}}};_0x3d743d[_0x58c6('0xb')][_0x58c6('0xc')]=_0x5e2309[_0x58c6('0xd')];_0x3d743d[_0x58c6('0xb')][_0x58c6('0xe')]=_0x5e2309[_0x58c6('0xf')];_0x3d743d[_0x58c6('0xb')][_0x58c6('0x10')]=_0x5e2309['newToken'];_0x3d743d[_0x58c6('0xb')]['customfield_11503']=_0x5e2309['name'];_0x3d743d[_0x58c6('0xb')][_0x58c6('0x11')]=_0x5e2309[_0x58c6('0x12')];_0x3d743d[_0x58c6('0xb')][_0x58c6('0x13')]=_0x5e2309['ip'];var _0x2fda87={'host':'track.xcallymotion.com','port':0x1bb,'path':_0x58c6('0x14'),'method':_0x58c6('0x15'),'timeout':0x4e20,'headers':{'Content-Type':_0x58c6('0x16'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x58c6('0x17'))}};var _0x1cc340=JSON[_0x58c6('0x18')](_0x3d743d);var _0x520138=https[_0x58c6('0x19')](_0x2fda87,function(_0x237fe2){_0x237fe2[_0x58c6('0x1a')](_0x58c6('0x1b'));var _0x12aa2b='';_0x237fe2['on'](_0x58c6('0x1c'),function(_0x468d83){_0x12aa2b+=_0x468d83;});_0x237fe2['on'](_0x58c6('0x1d'),function(){if(_0x4f03de){return _0x4f03de[_0x58c6('0x1e')](_0x237fe2['statusCode'])[_0x58c6('0x1f')](JSON[_0x58c6('0x20')](_0x12aa2b));}});});_0x520138['on']('error',function(_0x377eb5){if(_0x4f03de){return _0x4f03de[_0x58c6('0x1e')](0x1f4)[_0x58c6('0x1f')]({'errors':[{'message':_0x58c6('0x21'),'type':_0x58c6('0x22')}]});}});_0x520138['write'](_0x1cc340);_0x520138[_0x58c6('0x1d')]();}exports[_0x58c6('0x23')]=openIssue;exports[_0x58c6('0x24')]=function(_0x3f422c,_0x4e753b){_0x3f422c[_0x58c6('0x25')]['ip']=_0x3f422c['headers'][_0x58c6('0x26')]||_0x3f422c[_0x58c6('0x27')]['remoteAddress']||_0x3f422c[_0x58c6('0x28')][_0x58c6('0x29')]||_0x3f422c[_0x58c6('0x27')][_0x58c6('0x28')]['remoteAddress'];return openIssue(_0x3f422c[_0x58c6('0x25')],_0x4e753b);}; \ No newline at end of file +var _0xa355=['openIssue','send','headers','x-forwarded-for','connection','remoteAddress','socket','body','bluebird','https','../../config/logger','support','3eAmWpBVP0','MOTGUI','summary','Report','\x20from\x20','description','stringify','issuetype','fields','customfield_11500','email','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','application/json','Basic\x20','base64','setEncoding','data','end','status','statusCode','json','parse','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','write'];(function(_0x4ef1b4,_0x34b613){var _0x154dac=function(_0xcdb173){while(--_0xcdb173){_0x4ef1b4['push'](_0x4ef1b4['shift']());}};_0x154dac(++_0x34b613);}(_0xa355,0x122));var _0x5a35=function(_0x243172,_0x3386fd){_0x243172=_0x243172-0x0;var _0x9ff5ef=_0xa355[_0x243172];return _0x9ff5ef;};'use strict';var BPromise=require(_0x5a35('0x0'));var https=require(_0x5a35('0x1'));var logger=require(_0x5a35('0x2'))('api');var USERNAME=_0x5a35('0x3');var PASSWORD=_0x5a35('0x4');function openIssue(_0x7b5906,_0x3849f7){var _0x559568={'fields':{'project':{'key':_0x7b5906['key']||_0x5a35('0x5')},'summary':(_0x7b5906[_0x5a35('0x6')]||_0x5a35('0x7'))+_0x5a35('0x8')+_0x7b5906['ip'],'description':_0x7b5906[_0x5a35('0x9')]||JSON[_0x5a35('0xa')](_0x7b5906),'issuetype':{'name':_0x7b5906[_0x5a35('0xb')]||'Bug'}}};_0x559568[_0x5a35('0xc')][_0x5a35('0xd')]=_0x7b5906[_0x5a35('0xe')];_0x559568[_0x5a35('0xc')][_0x5a35('0xf')]=_0x7b5906[_0x5a35('0x10')];_0x559568[_0x5a35('0xc')][_0x5a35('0x11')]=_0x7b5906[_0x5a35('0x12')];_0x559568[_0x5a35('0xc')][_0x5a35('0x13')]=_0x7b5906[_0x5a35('0x14')];_0x559568[_0x5a35('0xc')]['customfield_11504']=_0x7b5906[_0x5a35('0x15')];_0x559568[_0x5a35('0xc')][_0x5a35('0x16')]=_0x7b5906['ip'];var _0x2f50aa={'host':_0x5a35('0x17'),'port':0x1bb,'path':_0x5a35('0x18'),'method':'POST','timeout':0x4e20,'headers':{'Content-Type':_0x5a35('0x19'),'Authorization':_0x5a35('0x1a')+new Buffer(USERNAME+':'+PASSWORD)['toString'](_0x5a35('0x1b'))}};var _0x31aa1f=JSON[_0x5a35('0xa')](_0x559568);var _0x4d8d70=https['request'](_0x2f50aa,function(_0x2db2bd){_0x2db2bd[_0x5a35('0x1c')]('utf8');var _0x1e35a9='';_0x2db2bd['on'](_0x5a35('0x1d'),function(_0x1cbd93){_0x1e35a9+=_0x1cbd93;});_0x2db2bd['on'](_0x5a35('0x1e'),function(){if(_0x3849f7){return _0x3849f7[_0x5a35('0x1f')](_0x2db2bd[_0x5a35('0x20')])[_0x5a35('0x21')](JSON[_0x5a35('0x22')](_0x1e35a9));}});});_0x4d8d70['on'](_0x5a35('0x23'),function(_0x5a0465){if(_0x3849f7){return _0x3849f7[_0x5a35('0x1f')](0x1f4)['json']({'errors':[{'message':_0x5a35('0x24'),'type':_0x5a35('0x25')}]});}});_0x4d8d70[_0x5a35('0x26')](_0x31aa1f);_0x4d8d70[_0x5a35('0x1e')]();}exports[_0x5a35('0x27')]=openIssue;exports[_0x5a35('0x28')]=function(_0x9b0dd7,_0x2077a8){_0x9b0dd7['body']['ip']=_0x9b0dd7[_0x5a35('0x29')][_0x5a35('0x2a')]||_0x9b0dd7[_0x5a35('0x2b')][_0x5a35('0x2c')]||_0x9b0dd7[_0x5a35('0x2d')][_0x5a35('0x2c')]||_0x9b0dd7[_0x5a35('0x2b')][_0x5a35('0x2d')][_0x5a35('0x2c')];return openIssue(_0x9b0dd7[_0x5a35('0x2e')],_0x2077a8);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index 918feaa..8e051c2 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 _0x4796=['../../components/interaction/service','../../config/environment','isAuthenticated','get','describe','/:id','create','put','update','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x3b0bf2,_0x204b92){var _0x4f4964=function(_0x4f94da){while(--_0x4f94da){_0x3b0bf2['push'](_0x3b0bf2['shift']());}};_0x4f4964(++_0x204b92);}(_0x4796,0x11b));var _0x6479=function(_0x37dec6,_0x1df423){_0x37dec6=_0x37dec6-0x0;var _0x1eb70a=_0x4796[_0x37dec6];return _0x1eb70a;};'use strict';var multer=require(_0x6479('0x0'));var util=require(_0x6479('0x1'));var path=require('path');var timeout=require(_0x6479('0x2'));var express=require(_0x6479('0x3'));var router=express[_0x6479('0x4')]();var auth=require(_0x6479('0x5'));var interaction=require(_0x6479('0x6'));var config=require(_0x6479('0x7'));var controller=require('./jscriptyAnswerReport.controller');router['get']('/',auth[_0x6479('0x8')](),controller['index']);router[_0x6479('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x6479('0xa')]);router[_0x6479('0x9')](_0x6479('0xb'),auth[_0x6479('0x8')](),controller['show']);router['post']('/',auth[_0x6479('0x8')](),controller[_0x6479('0xc')]);router[_0x6479('0xd')](_0x6479('0xb'),auth[_0x6479('0x8')](),controller[_0x6479('0xe')]);router[_0x6479('0xf')](_0x6479('0xb'),auth[_0x6479('0x8')](),controller['destroy']);module[_0x6479('0x10')]=router; \ No newline at end of file +var _0xdf2e=['express','Router','../../components/auth/service','get','isAuthenticated','index','/describe','describe','show','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x2c28ea,_0x354859){var _0x2aedad=function(_0x31a5ed){while(--_0x31a5ed){_0x2c28ea['push'](_0x2c28ea['shift']());}};_0x2aedad(++_0x354859);}(_0xdf2e,0xa7));var _0xedf2=function(_0xe2c95e,_0x3e6545){_0xe2c95e=_0xe2c95e-0x0;var _0x42ce6f=_0xdf2e[_0xe2c95e];return _0x42ce6f;};'use strict';var multer=require(_0xedf2('0x0'));var util=require(_0xedf2('0x1'));var path=require(_0xedf2('0x2'));var timeout=require(_0xedf2('0x3'));var express=require(_0xedf2('0x4'));var router=express[_0xedf2('0x5')]();var auth=require(_0xedf2('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyAnswerReport.controller');router[_0xedf2('0x7')]('/',auth[_0xedf2('0x8')](),controller[_0xedf2('0x9')]);router[_0xedf2('0x7')](_0xedf2('0xa'),auth[_0xedf2('0x8')](),controller[_0xedf2('0xb')]);router[_0xedf2('0x7')]('/:id',auth[_0xedf2('0x8')](),controller[_0xedf2('0xc')]);router[_0xedf2('0xd')]('/',auth[_0xedf2('0x8')](),controller[_0xedf2('0xe')]);router[_0xedf2('0xf')]('/:id',auth[_0xedf2('0x8')](),controller['update']);router[_0xedf2('0x10')]('/:id',auth[_0xedf2('0x8')](),controller[_0xedf2('0x11')]);module[_0xedf2('0x12')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index fa56d09..3ba8a41 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 _0x4e34=['TEXT','long','sequelize','exports','STRING'];(function(_0x2eb370,_0x4f62b5){var _0x473c1=function(_0x4377e9){while(--_0x4377e9){_0x2eb370['push'](_0x2eb370['shift']());}};_0x473c1(++_0x4f62b5);}(_0x4e34,0x1f1));var _0x44e3=function(_0x37ce18,_0x20e215){_0x37ce18=_0x37ce18-0x0;var _0x504c93=_0x4e34[_0x37ce18];return _0x504c93;};'use strict';var Sequelize=require(_0x44e3('0x0'));module[_0x44e3('0x1')]={'question':{'type':Sequelize[_0x44e3('0x2')]},'answer':{'type':Sequelize[_0x44e3('0x3')](_0x44e3('0x4'))},'membername':{'type':Sequelize[_0x44e3('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x44e3('0x2')]},'uniqueid':{'type':Sequelize[_0x44e3('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x44e3('0x2')]},'questionId':{'type':Sequelize[_0x44e3('0x2')]}}; \ No newline at end of file +var _0xdaae=['STRING','sequelize','TEXT'];(function(_0x56916d,_0x37b935){var _0x2b7f1f=function(_0x206eb1){while(--_0x206eb1){_0x56916d['push'](_0x56916d['shift']());}};_0x2b7f1f(++_0x37b935);}(_0xdaae,0x88));var _0xedaa=function(_0x4648ff,_0x582172){_0x4648ff=_0x4648ff-0x0;var _0x26070b=_0xdaae[_0x4648ff];return _0x26070b;};'use strict';var Sequelize=require(_0xedaa('0x0'));module['exports']={'question':{'type':Sequelize['STRING']},'answer':{'type':Sequelize[_0xedaa('0x1')]('long')},'membername':{'type':Sequelize[_0xedaa('0x2')]},'projectname':{'type':Sequelize[_0xedaa('0x2')]},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index 96a95e9..e6b50d9 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 _0xfbbb=['sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','apply','save','update','then','error','stack','name','send','index','map','rawAttributes','fieldName','type','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','JscriptyAnswerReport','includeAll','include','findAll','catch','params','length','create','body','find','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0xb8cd27,_0x568e9e){var _0x5e0d1a=function(_0xd1c20){while(--_0xd1c20){_0xb8cd27['push'](_0xb8cd27['shift']());}};_0x5e0d1a(++_0x568e9e);}(_0xfbbb,0x1b3));var _0xbfbb=function(_0x4cde67,_0x1f58b8){_0x4cde67=_0x4cde67-0x0;var _0xd80b56=_0xfbbb[_0x4cde67];return _0xd80b56;};'use strict';var pdf=require(_0xbfbb('0x0'));var emlformat=require(_0xbfbb('0x1'));var rimraf=require(_0xbfbb('0x2'));var zipdir=require(_0xbfbb('0x3'));var jsonpatch=require(_0xbfbb('0x4'));var rp=require(_0xbfbb('0x5'));var moment=require(_0xbfbb('0x6'));var BPromise=require(_0xbfbb('0x7'));var Mustache=require(_0xbfbb('0x8'));var util=require('util');var path=require('path');var sox=require(_0xbfbb('0x9'));var csv=require('to-csv');var ejs=require(_0xbfbb('0xa'));var fs=require('fs');var _=require(_0xbfbb('0xb'));var squel=require(_0xbfbb('0xc'));var crypto=require('crypto');var jsforce=require(_0xbfbb('0xd'));var deskjs=require(_0xbfbb('0xe'));var toCsv=require(_0xbfbb('0xf'));var querystring=require(_0xbfbb('0x10'));var Papa=require(_0xbfbb('0x11'));var Redis=require(_0xbfbb('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xbfbb('0x13'));var as=require(_0xbfbb('0x14'));var hardwareService=require(_0xbfbb('0x15'));var logger=require(_0xbfbb('0x16'))('api');var utils=require(_0xbfbb('0x17'));var config=require(_0xbfbb('0x18'));var db=require(_0xbfbb('0x19'))['db'];function respondWithStatusCode(_0x390314,_0x45ef3b){_0x45ef3b=_0x45ef3b||0xcc;return function(_0x294ffd){if(_0x294ffd){return _0x390314[_0xbfbb('0x1a')](_0x45ef3b);}return _0x390314[_0xbfbb('0x1b')](_0x45ef3b)['end']();};}function respondWithResult(_0xfa2314,_0x3fbd10){_0x3fbd10=_0x3fbd10||0xc8;return function(_0x271139){if(_0x271139){return _0xfa2314[_0xbfbb('0x1b')](_0x3fbd10)[_0xbfbb('0x1c')](_0x271139);}};}function respondWithFilteredResult(_0x59c1f2,_0x28db60){return function(_0x3e046e){if(_0x3e046e){var _0x3db1d6=_0x3e046e[_0xbfbb('0x1d')],_0xe0e3aa=_0x28db60['offset'],_0x200810=_0x28db60['offset']+_0x28db60[_0xbfbb('0x1e')],_0x422c91;if(_0x200810>=_0x3db1d6){_0x200810=_0x3db1d6;_0x422c91=0xc8;}else{_0x422c91=0xce;}_0x59c1f2['status'](_0x422c91);return _0x59c1f2[_0xbfbb('0x1f')]('Content-Range',_0xe0e3aa+'-'+_0x200810+'/'+_0x3db1d6)[_0xbfbb('0x1c')](_0x3e046e);}return null;};}function patchUpdates(_0x34be5f){return function(_0x15c74b){try{jsonpatch[_0xbfbb('0x20')](_0x15c74b,_0x34be5f,!![]);}catch(_0x19acc5){return BPromise['reject'](_0x19acc5);}return _0x15c74b[_0xbfbb('0x21')]();};}function saveUpdates(_0x4a9ffc,_0x26c69f){return function(_0x44c544){if(_0x44c544){return _0x44c544[_0xbfbb('0x22')](_0x4a9ffc)[_0xbfbb('0x23')](function(_0x448988){return _0x448988;});}return null;};}function removeEntity(_0x2417d9,_0x150325){return function(_0x1c9943){if(_0x1c9943){return _0x1c9943['destroy']()[_0xbfbb('0x23')](function(){_0x2417d9[_0xbfbb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22e3ec,_0x15e362){return function(_0x44bf61){if(!_0x44bf61){_0x22e3ec[_0xbfbb('0x1a')](0x194);}return _0x44bf61;};}function handleError(_0x5adf09,_0x1116d1){_0x1116d1=_0x1116d1||0x1f4;return function(_0x5dc47a){logger[_0xbfbb('0x24')](_0x5dc47a[_0xbfbb('0x25')]);if(_0x5dc47a[_0xbfbb('0x26')]){delete _0x5dc47a[_0xbfbb('0x26')];}_0x5adf09[_0xbfbb('0x1b')](_0x1116d1)[_0xbfbb('0x27')](_0x5dc47a);};}exports[_0xbfbb('0x28')]=function(_0x10631a,_0x1bb8d6){var _0x3db9c6={},_0x217750={},_0x3b5cbc={'count':0x0,'rows':[]};var _0x28c7bb=_[_0xbfbb('0x29')](db['JscriptyAnswerReport'][_0xbfbb('0x2a')],function(_0xdcd56){return{'name':_0xdcd56[_0xbfbb('0x2b')],'type':_0xdcd56[_0xbfbb('0x2c')]['key']};});_0x217750[_0xbfbb('0x2d')]=_[_0xbfbb('0x29')](_0x28c7bb,_0xbfbb('0x26'));_0x217750['query']=_[_0xbfbb('0x2e')](_0x10631a[_0xbfbb('0x2f')]);_0x217750[_0xbfbb('0x30')]=_[_0xbfbb('0x31')](_0x217750[_0xbfbb('0x2d')],_0x217750[_0xbfbb('0x2f')]);_0x3db9c6[_0xbfbb('0x32')]=_[_0xbfbb('0x31')](_0x217750[_0xbfbb('0x2d')],qs['fields'](_0x10631a['query'][_0xbfbb('0x33')]));_0x3db9c6[_0xbfbb('0x32')]=_0x3db9c6[_0xbfbb('0x32')]['length']?_0x3db9c6[_0xbfbb('0x32')]:_0x217750[_0xbfbb('0x2d')];if(!_0x10631a[_0xbfbb('0x2f')][_0xbfbb('0x34')]('nolimit')){_0x3db9c6[_0xbfbb('0x1e')]=qs[_0xbfbb('0x1e')](_0x10631a['query'][_0xbfbb('0x1e')]);_0x3db9c6[_0xbfbb('0x35')]=qs[_0xbfbb('0x35')](_0x10631a['query']['offset']);}_0x3db9c6[_0xbfbb('0x36')]=qs[_0xbfbb('0x37')](_0x10631a['query'][_0xbfbb('0x37')]);_0x3db9c6[_0xbfbb('0x38')]=qs['filters'](_[_0xbfbb('0x39')](_0x10631a['query'],_0x217750[_0xbfbb('0x30')]));if(_0x10631a['query'][_0xbfbb('0x3a')]){_0x3db9c6['where']=_[_0xbfbb('0x3b')](_0x3db9c6[_0xbfbb('0x38')],{'$or':_[_0xbfbb('0x29')](_0x28c7bb,function(_0x174b99){if(_0x174b99[_0xbfbb('0x2c')]!==_0xbfbb('0x3c')){var _0x4e6cd9={};_0x4e6cd9[_0x174b99[_0xbfbb('0x26')]]={'$like':'%'+_0x10631a[_0xbfbb('0x2f')][_0xbfbb('0x3a')]+'%'};return _0x4e6cd9;}})});}_0x3db9c6=_[_0xbfbb('0x3b')]({},_0x3db9c6,_0x10631a[_0xbfbb('0x3d')]);var _0x1e9c02={'where':_0x3db9c6[_0xbfbb('0x38')]};return db[_0xbfbb('0x3e')][_0xbfbb('0x1d')](_0x1e9c02)[_0xbfbb('0x23')](function(_0x1d1dea){_0x3b5cbc[_0xbfbb('0x1d')]=_0x1d1dea;if(_0x10631a[_0xbfbb('0x2f')][_0xbfbb('0x3f')]){_0x3db9c6[_0xbfbb('0x40')]=[{'all':!![]}];}return db[_0xbfbb('0x3e')][_0xbfbb('0x41')](_0x3db9c6);})[_0xbfbb('0x23')](function(_0x1b6c5e){_0x3b5cbc['rows']=_0x1b6c5e;return _0x3b5cbc;})['then'](respondWithFilteredResult(_0x1bb8d6,_0x3db9c6))[_0xbfbb('0x42')](handleError(_0x1bb8d6,null));};exports['show']=function(_0x15dcb6,_0x20523f){var _0x325105={'raw':!![],'where':{'id':_0x15dcb6[_0xbfbb('0x43')]['id']}},_0x36718b={};_0x36718b[_0xbfbb('0x2d')]=_[_0xbfbb('0x2e')](db[_0xbfbb('0x3e')][_0xbfbb('0x2a')]);_0x36718b[_0xbfbb('0x2f')]=_[_0xbfbb('0x2e')](_0x15dcb6[_0xbfbb('0x2f')]);_0x36718b[_0xbfbb('0x30')]=_['intersection'](_0x36718b[_0xbfbb('0x2d')],_0x36718b[_0xbfbb('0x2f')]);_0x325105[_0xbfbb('0x32')]=_['intersection'](_0x36718b[_0xbfbb('0x2d')],qs[_0xbfbb('0x33')](_0x15dcb6[_0xbfbb('0x2f')][_0xbfbb('0x33')]));_0x325105[_0xbfbb('0x32')]=_0x325105[_0xbfbb('0x32')][_0xbfbb('0x44')]?_0x325105[_0xbfbb('0x32')]:_0x36718b['model'];if(_0x15dcb6[_0xbfbb('0x2f')][_0xbfbb('0x3f')]){_0x325105[_0xbfbb('0x40')]=[{'all':!![]}];}_0x325105=_['merge']({},_0x325105,_0x15dcb6[_0xbfbb('0x3d')]);return db['JscriptyAnswerReport']['find'](_0x325105)['then'](handleEntityNotFound(_0x20523f,null))[_0xbfbb('0x23')](respondWithResult(_0x20523f,null))[_0xbfbb('0x42')](handleError(_0x20523f,null));};exports[_0xbfbb('0x45')]=function(_0x469cde,_0x45ce5a){return db[_0xbfbb('0x3e')]['create'](_0x469cde[_0xbfbb('0x46')],{})['then'](respondWithResult(_0x45ce5a,0xc9))[_0xbfbb('0x42')](handleError(_0x45ce5a,null));};exports[_0xbfbb('0x22')]=function(_0x214a07,_0xd5d131){if(_0x214a07[_0xbfbb('0x46')]['id']){delete _0x214a07[_0xbfbb('0x46')]['id'];}return db[_0xbfbb('0x3e')][_0xbfbb('0x47')]({'where':{'id':_0x214a07[_0xbfbb('0x43')]['id']}})[_0xbfbb('0x23')](handleEntityNotFound(_0xd5d131,null))[_0xbfbb('0x23')](saveUpdates(_0x214a07[_0xbfbb('0x46')],null))[_0xbfbb('0x23')](respondWithResult(_0xd5d131,null))[_0xbfbb('0x42')](handleError(_0xd5d131,null));};exports[_0xbfbb('0x48')]=function(_0x39d7ac,_0x26597a){return db[_0xbfbb('0x3e')][_0xbfbb('0x47')]({'where':{'id':_0x39d7ac['params']['id']}})[_0xbfbb('0x23')](handleEntityNotFound(_0x26597a,null))[_0xbfbb('0x23')](removeEntity(_0x26597a,null))[_0xbfbb('0x42')](handleError(_0x26597a,null));};exports[_0xbfbb('0x49')]=function(_0x34325c,_0x5b1af2){return db[_0xbfbb('0x3e')]['describe']()[_0xbfbb('0x23')](respondWithResult(_0x5b1af2,null))[_0xbfbb('0x42')](handleError(_0x5b1af2,null));}; \ No newline at end of file +var _0xf8d1=['save','update','destroy','then','error','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','offset','limit','set','Content-Range','apply'];(function(_0x4f0b8d,_0x388f85){var _0x16a1d2=function(_0x133e30){while(--_0x133e30){_0x4f0b8d['push'](_0x4f0b8d['shift']());}};_0x16a1d2(++_0x388f85);}(_0xf8d1,0x7a));var _0x1f8d=function(_0x339eae,_0x351aa8){_0x339eae=_0x339eae-0x0;var _0x2b01dd=_0xf8d1[_0x339eae];return _0x2b01dd;};'use strict';var pdf=require(_0x1f8d('0x0'));var emlformat=require(_0x1f8d('0x1'));var rimraf=require(_0x1f8d('0x2'));var zipdir=require(_0x1f8d('0x3'));var jsonpatch=require(_0x1f8d('0x4'));var rp=require(_0x1f8d('0x5'));var moment=require(_0x1f8d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x1f8d('0x7'));var util=require(_0x1f8d('0x8'));var path=require(_0x1f8d('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1f8d('0xa'));var fs=require('fs');var _=require(_0x1f8d('0xb'));var squel=require(_0x1f8d('0xc'));var crypto=require(_0x1f8d('0xd'));var jsforce=require(_0x1f8d('0xe'));var deskjs=require(_0x1f8d('0xf'));var toCsv=require(_0x1f8d('0x10'));var querystring=require(_0x1f8d('0x11'));var Papa=require('papaparse');var Redis=require(_0x1f8d('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1f8d('0x13'));var as=require(_0x1f8d('0x14'));var hardwareService=require(_0x1f8d('0x15'));var logger=require(_0x1f8d('0x16'))(_0x1f8d('0x17'));var utils=require(_0x1f8d('0x18'));var config=require(_0x1f8d('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xefc74b,_0x19e371){_0x19e371=_0x19e371||0xcc;return function(_0x57776f){if(_0x57776f){return _0xefc74b[_0x1f8d('0x1a')](_0x19e371);}return _0xefc74b[_0x1f8d('0x1b')](_0x19e371)[_0x1f8d('0x1c')]();};}function respondWithResult(_0xe51a20,_0x48310f){_0x48310f=_0x48310f||0xc8;return function(_0x58eaa8){if(_0x58eaa8){return _0xe51a20[_0x1f8d('0x1b')](_0x48310f)['json'](_0x58eaa8);}};}function respondWithFilteredResult(_0x633194,_0x391dd5){return function(_0x7f4399){if(_0x7f4399){var _0x3f0185=_0x7f4399['count'],_0x3a8442=_0x391dd5[_0x1f8d('0x1d')],_0x434507=_0x391dd5[_0x1f8d('0x1d')]+_0x391dd5[_0x1f8d('0x1e')],_0x1e6a9b;if(_0x434507>=_0x3f0185){_0x434507=_0x3f0185;_0x1e6a9b=0xc8;}else{_0x1e6a9b=0xce;}_0x633194['status'](_0x1e6a9b);return _0x633194[_0x1f8d('0x1f')](_0x1f8d('0x20'),_0x3a8442+'-'+_0x434507+'/'+_0x3f0185)['json'](_0x7f4399);}return null;};}function patchUpdates(_0x4dca04){return function(_0x14750a){try{jsonpatch[_0x1f8d('0x21')](_0x14750a,_0x4dca04,!![]);}catch(_0x5f2c6e){return BPromise['reject'](_0x5f2c6e);}return _0x14750a[_0x1f8d('0x22')]();};}function saveUpdates(_0x4cdbda,_0x131f71){return function(_0x33c0c3){if(_0x33c0c3){return _0x33c0c3[_0x1f8d('0x23')](_0x4cdbda)['then'](function(_0x5b3f31){return _0x5b3f31;});}return null;};}function removeEntity(_0x479323,_0xd55ad){return function(_0x210d30){if(_0x210d30){return _0x210d30[_0x1f8d('0x24')]()[_0x1f8d('0x25')](function(){_0x479323[_0x1f8d('0x1b')](0xcc)[_0x1f8d('0x1c')]();});}};}function handleEntityNotFound(_0x25b528,_0x3b8e25){return function(_0x537caf){if(!_0x537caf){_0x25b528[_0x1f8d('0x1a')](0x194);}return _0x537caf;};}function handleError(_0x24101e,_0x27fc58){_0x27fc58=_0x27fc58||0x1f4;return function(_0x57f321){logger[_0x1f8d('0x26')](_0x57f321[_0x1f8d('0x27')]);if(_0x57f321[_0x1f8d('0x28')]){delete _0x57f321[_0x1f8d('0x28')];}_0x24101e[_0x1f8d('0x1b')](_0x27fc58)[_0x1f8d('0x29')](_0x57f321);};}exports[_0x1f8d('0x2a')]=function(_0x43d6e6,_0x5b4f35){var _0x3fd0fe={},_0x35c4d0={},_0x39bbff={'count':0x0,'rows':[]};var _0x31367c=_[_0x1f8d('0x2b')](db[_0x1f8d('0x2c')][_0x1f8d('0x2d')],function(_0x258737){return{'name':_0x258737[_0x1f8d('0x2e')],'type':_0x258737[_0x1f8d('0x2f')][_0x1f8d('0x30')]};});_0x35c4d0[_0x1f8d('0x31')]=_['map'](_0x31367c,_0x1f8d('0x28'));_0x35c4d0[_0x1f8d('0x32')]=_[_0x1f8d('0x33')](_0x43d6e6[_0x1f8d('0x32')]);_0x35c4d0['filters']=_[_0x1f8d('0x34')](_0x35c4d0[_0x1f8d('0x31')],_0x35c4d0[_0x1f8d('0x32')]);_0x3fd0fe['attributes']=_['intersection'](_0x35c4d0[_0x1f8d('0x31')],qs[_0x1f8d('0x35')](_0x43d6e6[_0x1f8d('0x32')]['fields']));_0x3fd0fe[_0x1f8d('0x36')]=_0x3fd0fe['attributes'][_0x1f8d('0x37')]?_0x3fd0fe[_0x1f8d('0x36')]:_0x35c4d0['model'];if(!_0x43d6e6[_0x1f8d('0x32')][_0x1f8d('0x38')](_0x1f8d('0x39'))){_0x3fd0fe[_0x1f8d('0x1e')]=qs['limit'](_0x43d6e6[_0x1f8d('0x32')][_0x1f8d('0x1e')]);_0x3fd0fe['offset']=qs['offset'](_0x43d6e6[_0x1f8d('0x32')]['offset']);}_0x3fd0fe[_0x1f8d('0x3a')]=qs['sort'](_0x43d6e6['query'][_0x1f8d('0x3b')]);_0x3fd0fe[_0x1f8d('0x3c')]=qs['filters'](_[_0x1f8d('0x3d')](_0x43d6e6[_0x1f8d('0x32')],_0x35c4d0[_0x1f8d('0x3e')]));if(_0x43d6e6[_0x1f8d('0x32')][_0x1f8d('0x3f')]){_0x3fd0fe[_0x1f8d('0x3c')]=_['merge'](_0x3fd0fe['where'],{'$or':_[_0x1f8d('0x2b')](_0x31367c,function(_0x4d1839){if(_0x4d1839[_0x1f8d('0x2f')]!=='VIRTUAL'){var _0x531045={};_0x531045[_0x4d1839[_0x1f8d('0x28')]]={'$like':'%'+_0x43d6e6[_0x1f8d('0x32')][_0x1f8d('0x3f')]+'%'};return _0x531045;}})});}_0x3fd0fe=_[_0x1f8d('0x40')]({},_0x3fd0fe,_0x43d6e6[_0x1f8d('0x41')]);var _0x20ce2b={'where':_0x3fd0fe[_0x1f8d('0x3c')]};return db[_0x1f8d('0x2c')][_0x1f8d('0x42')](_0x20ce2b)[_0x1f8d('0x25')](function(_0x5c5c41){_0x39bbff[_0x1f8d('0x42')]=_0x5c5c41;if(_0x43d6e6['query'][_0x1f8d('0x43')]){_0x3fd0fe[_0x1f8d('0x44')]=[{'all':!![]}];}return db[_0x1f8d('0x2c')][_0x1f8d('0x45')](_0x3fd0fe);})[_0x1f8d('0x25')](function(_0x3464cb){_0x39bbff[_0x1f8d('0x46')]=_0x3464cb;return _0x39bbff;})[_0x1f8d('0x25')](respondWithFilteredResult(_0x5b4f35,_0x3fd0fe))[_0x1f8d('0x47')](handleError(_0x5b4f35,null));};exports[_0x1f8d('0x48')]=function(_0x39918b,_0x37fe10){var _0x62ef03={'raw':!![],'where':{'id':_0x39918b[_0x1f8d('0x49')]['id']}},_0xf65df={};_0xf65df[_0x1f8d('0x31')]=_[_0x1f8d('0x33')](db[_0x1f8d('0x2c')]['rawAttributes']);_0xf65df[_0x1f8d('0x32')]=_[_0x1f8d('0x33')](_0x39918b[_0x1f8d('0x32')]);_0xf65df[_0x1f8d('0x3e')]=_['intersection'](_0xf65df[_0x1f8d('0x31')],_0xf65df[_0x1f8d('0x32')]);_0x62ef03[_0x1f8d('0x36')]=_[_0x1f8d('0x34')](_0xf65df['model'],qs[_0x1f8d('0x35')](_0x39918b['query'][_0x1f8d('0x35')]));_0x62ef03[_0x1f8d('0x36')]=_0x62ef03['attributes']['length']?_0x62ef03[_0x1f8d('0x36')]:_0xf65df['model'];if(_0x39918b[_0x1f8d('0x32')]['includeAll']){_0x62ef03[_0x1f8d('0x44')]=[{'all':!![]}];}_0x62ef03=_[_0x1f8d('0x40')]({},_0x62ef03,_0x39918b['options']);return db[_0x1f8d('0x2c')][_0x1f8d('0x4a')](_0x62ef03)[_0x1f8d('0x25')](handleEntityNotFound(_0x37fe10,null))[_0x1f8d('0x25')](respondWithResult(_0x37fe10,null))[_0x1f8d('0x47')](handleError(_0x37fe10,null));};exports[_0x1f8d('0x4b')]=function(_0x5e5f25,_0x2b9400){return db[_0x1f8d('0x2c')][_0x1f8d('0x4b')](_0x5e5f25['body'],{})['then'](respondWithResult(_0x2b9400,0xc9))[_0x1f8d('0x47')](handleError(_0x2b9400,null));};exports[_0x1f8d('0x23')]=function(_0x257086,_0x53a0d0){if(_0x257086[_0x1f8d('0x4c')]['id']){delete _0x257086[_0x1f8d('0x4c')]['id'];}return db[_0x1f8d('0x2c')][_0x1f8d('0x4a')]({'where':{'id':_0x257086[_0x1f8d('0x49')]['id']}})[_0x1f8d('0x25')](handleEntityNotFound(_0x53a0d0,null))[_0x1f8d('0x25')](saveUpdates(_0x257086[_0x1f8d('0x4c')],null))['then'](respondWithResult(_0x53a0d0,null))[_0x1f8d('0x47')](handleError(_0x53a0d0,null));};exports['destroy']=function(_0x325fa9,_0x148de0){return db[_0x1f8d('0x2c')][_0x1f8d('0x4a')]({'where':{'id':_0x325fa9['params']['id']}})['then'](handleEntityNotFound(_0x148de0,null))[_0x1f8d('0x25')](removeEntity(_0x148de0,null))[_0x1f8d('0x47')](handleError(_0x148de0,null));};exports[_0x1f8d('0x4d')]=function(_0x34b216,_0x40a074){return db[_0x1f8d('0x2c')]['describe']()[_0x1f8d('0x25')](respondWithResult(_0x40a074,null))['catch'](handleError(_0x40a074,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index bd5c5b7..6e80632 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 _0x3378=['rimraf','../../config/environment','./jscriptyAnswerReport.attributes','exports','define','JscriptyAnswerReport','util','../../config/logger','moment','bluebird'];(function(_0x5b2283,_0x390c03){var _0x5a3089=function(_0xeea4bd){while(--_0xeea4bd){_0x5b2283['push'](_0x5b2283['shift']());}};_0x5a3089(++_0x390c03);}(_0x3378,0x1b4));var _0x8337=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x3378[_0x13d07a];return _0x5ee0ee;};'use strict';var _=require('lodash');var util=require(_0x8337('0x0'));var logger=require(_0x8337('0x1'))('api');var moment=require(_0x8337('0x2'));var BPromise=require(_0x8337('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8337('0x4'));var config=require(_0x8337('0x5'));var attributes=require(_0x8337('0x6'));module[_0x8337('0x7')]=function(_0x58e700,_0x361a2b){return _0x58e700[_0x8337('0x8')](_0x8337('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x854e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','report_jscripty_answers'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x854e,0xdd));var _0xe854=function(_0x5aad42,_0x13df01){_0x5aad42=_0x5aad42-0x0;var _0x36d4d7=_0x854e[_0x5aad42];return _0x36d4d7;};'use strict';var _=require(_0xe854('0x0'));var util=require(_0xe854('0x1'));var logger=require(_0xe854('0x2'))(_0xe854('0x3'));var moment=require(_0xe854('0x4'));var BPromise=require(_0xe854('0x5'));var rp=require(_0xe854('0x6'));var fs=require('fs');var path=require(_0xe854('0x7'));var rimraf=require(_0xe854('0x8'));var config=require(_0xe854('0x9'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xe854('0xa')]=function(_0x4fcc2a,_0x3920e6){return _0x4fcc2a[_0xe854('0xb')]('JscriptyAnswerReport',attributes,{'tableName':_0xe854('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index b149f9e..2b21f4b 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 _0x4f6b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','util'];(function(_0x22ee1e,_0x3eff80){var _0x49a5c9=function(_0x373480){while(--_0x373480){_0x22ee1e['push'](_0x22ee1e['shift']());}};_0x49a5c9(++_0x3eff80);}(_0x4f6b,0x14f));var _0xb4f6=function(_0x1d1779,_0x284147){_0x1d1779=_0x1d1779-0x0;var _0x2377e9=_0x4f6b[_0x1d1779];return _0x2377e9;};'use strict';var _=require('lodash');var util=require(_0xb4f6('0x0'));var moment=require('moment');var BPromise=require(_0xb4f6('0x1'));var rs=require(_0xb4f6('0x2'));var fs=require('fs');var Redis=require(_0xb4f6('0x3'));var db=require(_0xb4f6('0x4'))['db'];var utils=require(_0xb4f6('0x5'));var logger=require(_0xb4f6('0x6'))('rpc');var config=require(_0xb4f6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb4f6('0x8')][_0xb4f6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bf876,_0x431e45,_0x217121){return new BPromise(function(_0x478755,_0x4c43fa){return client['request'](_0x2bf876,_0x217121)[_0xb4f6('0xa')](function(_0x25df8b){logger['info'](_0xb4f6('0xb'),_0x431e45,_0xb4f6('0xc'));logger[_0xb4f6('0xd')](_0xb4f6('0xe'),_0x431e45,'request\x20sent',JSON[_0xb4f6('0xf')](_0x25df8b));if(_0x25df8b[_0xb4f6('0x10')]){if(_0x25df8b[_0xb4f6('0x10')][_0xb4f6('0x11')]===0x1f4){logger[_0xb4f6('0x10')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x431e45,_0x25df8b[_0xb4f6('0x10')][_0xb4f6('0x12')]);return _0x4c43fa(_0x25df8b[_0xb4f6('0x10')][_0xb4f6('0x12')]);}logger[_0xb4f6('0x10')](_0xb4f6('0xb'),_0x431e45,_0x25df8b['error'][_0xb4f6('0x12')]);return _0x478755(_0x25df8b[_0xb4f6('0x10')][_0xb4f6('0x12')]);}else{logger[_0xb4f6('0x13')](_0xb4f6('0xb'),_0x431e45,'request\x20sent');_0x478755(_0x25df8b['result']['message']);}})[_0xb4f6('0x14')](function(_0x2e3711){logger[_0xb4f6('0x10')](_0xb4f6('0xb'),_0x431e45,_0x2e3711);_0x4c43fa(_0x2e3711);});});} \ No newline at end of file +var _0xb5ec=['../../config/logger','rpc','../../config/environment','http','then','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x5adf97,_0x48d09b){var _0x2f3bbf=function(_0xaac119){while(--_0xaac119){_0x5adf97['push'](_0x5adf97['shift']());}};_0x2f3bbf(++_0x48d09b);}(_0xb5ec,0x144));var _0xcb5e=function(_0x2a7e99,_0xc69258){_0x2a7e99=_0x2a7e99-0x0;var _0x1a25a9=_0xb5ec[_0x2a7e99];return _0x1a25a9;};'use strict';var _=require(_0xcb5e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcb5e('0x1'));var rs=require(_0xcb5e('0x2'));var fs=require('fs');var Redis=require(_0xcb5e('0x3'));var db=require(_0xcb5e('0x4'))['db'];var utils=require(_0xcb5e('0x5'));var logger=require(_0xcb5e('0x6'))(_0xcb5e('0x7'));var config=require(_0xcb5e('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcb5e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2b8fa5,_0x144d22,_0x1e803e){return new BPromise(function(_0x3568a4,_0x4a74d7){return client['request'](_0x2b8fa5,_0x1e803e)[_0xcb5e('0xa')](function(_0x5ec26b){logger['info'](_0xcb5e('0xb'),_0x144d22,_0xcb5e('0xc'));logger[_0xcb5e('0xd')](_0xcb5e('0xe'),_0x144d22,_0xcb5e('0xc'),JSON[_0xcb5e('0xf')](_0x5ec26b));if(_0x5ec26b[_0xcb5e('0x10')]){if(_0x5ec26b[_0xcb5e('0x10')][_0xcb5e('0x11')]===0x1f4){logger[_0xcb5e('0x10')](_0xcb5e('0xb'),_0x144d22,_0x5ec26b['error'][_0xcb5e('0x12')]);return _0x4a74d7(_0x5ec26b[_0xcb5e('0x10')]['message']);}logger[_0xcb5e('0x10')](_0xcb5e('0xb'),_0x144d22,_0x5ec26b[_0xcb5e('0x10')][_0xcb5e('0x12')]);return _0x3568a4(_0x5ec26b[_0xcb5e('0x10')]['message']);}else{logger[_0xcb5e('0x13')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x144d22,_0xcb5e('0xc'));_0x3568a4(_0x5ec26b[_0xcb5e('0x14')]['message']);}})[_0xcb5e('0x15')](function(_0x3f9178){logger['error'](_0xcb5e('0xb'),_0x144d22,_0x3f9178);_0x4a74d7(_0x3f9178);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 3ef6146..55ad13e 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 _0xeab8=['isAuthenticated','index','show','/:id/sessions','getAnswers','/:id/summary','30s','getSummary','post','/:id/clone','clone','/:id','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptyProject.controller','get'];(function(_0x3728f1,_0x12a4f9){var _0x6c515b=function(_0x2310ef){while(--_0x2310ef){_0x3728f1['push'](_0x3728f1['shift']());}};_0x6c515b(++_0x12a4f9);}(_0xeab8,0x147));var _0x8eab=function(_0x1bb115,_0x2a49f0){_0x1bb115=_0x1bb115-0x0;var _0x4a31de=_0xeab8[_0x1bb115];return _0x4a31de;};'use strict';var multer=require(_0x8eab('0x0'));var util=require('util');var path=require(_0x8eab('0x1'));var timeout=require(_0x8eab('0x2'));var express=require('express');var router=express[_0x8eab('0x3')]();var auth=require(_0x8eab('0x4'));var interaction=require(_0x8eab('0x5'));var config=require(_0x8eab('0x6'));var controller=require(_0x8eab('0x7'));router[_0x8eab('0x8')]('/',auth[_0x8eab('0x9')](),controller[_0x8eab('0xa')]);router['get']('/:id',auth[_0x8eab('0x9')](),controller[_0x8eab('0xb')]);router[_0x8eab('0x8')](_0x8eab('0xc'),auth[_0x8eab('0x9')](),controller['getSessions']);router[_0x8eab('0x8')]('/:id/answers',auth[_0x8eab('0x9')](),controller[_0x8eab('0xd')]);router[_0x8eab('0x8')](_0x8eab('0xe'),auth[_0x8eab('0x9')](),timeout(_0x8eab('0xf')),controller[_0x8eab('0x10')]);router[_0x8eab('0x11')]('/',auth[_0x8eab('0x9')](),controller['create']);router[_0x8eab('0x11')](_0x8eab('0x12'),auth[_0x8eab('0x9')](),controller[_0x8eab('0x13')]);router['put'](_0x8eab('0x14'),auth['isAuthenticated'](),controller['update']);router[_0x8eab('0x15')](_0x8eab('0x14'),auth[_0x8eab('0x9')](),controller[_0x8eab('0x16')]);module[_0x8eab('0x17')]=router; \ No newline at end of file +var _0x8671=['./jscriptyProject.controller','isAuthenticated','get','/:id','/:id/sessions','/:id/answers','getAnswers','/:id/summary','30s','getSummary','create','post','/:id/clone','clone','put','update','delete','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x342baa,_0x4a110f){var _0x1208f3=function(_0x56a645){while(--_0x56a645){_0x342baa['push'](_0x342baa['shift']());}};_0x1208f3(++_0x4a110f);}(_0x8671,0x1ed));var _0x1867=function(_0x37bd26,_0x5ad346){_0x37bd26=_0x37bd26-0x0;var _0xe83dc4=_0x8671[_0x37bd26];return _0xe83dc4;};'use strict';var multer=require(_0x1867('0x0'));var util=require('util');var path=require(_0x1867('0x1'));var timeout=require(_0x1867('0x2'));var express=require(_0x1867('0x3'));var router=express['Router']();var auth=require(_0x1867('0x4'));var interaction=require(_0x1867('0x5'));var config=require(_0x1867('0x6'));var controller=require(_0x1867('0x7'));router['get']('/',auth[_0x1867('0x8')](),controller['index']);router[_0x1867('0x9')](_0x1867('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1867('0x9')](_0x1867('0xb'),auth[_0x1867('0x8')](),controller['getSessions']);router[_0x1867('0x9')](_0x1867('0xc'),auth[_0x1867('0x8')](),controller[_0x1867('0xd')]);router['get'](_0x1867('0xe'),auth[_0x1867('0x8')](),timeout(_0x1867('0xf')),controller[_0x1867('0x10')]);router['post']('/',auth[_0x1867('0x8')](),controller[_0x1867('0x11')]);router[_0x1867('0x12')](_0x1867('0x13'),auth[_0x1867('0x8')](),controller[_0x1867('0x14')]);router[_0x1867('0x15')](_0x1867('0xa'),auth['isAuthenticated'](),controller[_0x1867('0x16')]);router[_0x1867('0x17')](_0x1867('0xa'),auth['isAuthenticated'](),controller[_0x1867('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index c9c26c0..36a4188 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 _0xfa73=['getDataValue','description','BOOLEAN','sequelize','lodash','STRING','name','long','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}'];(function(_0x56bdab,_0x236de1){var _0x4746b0=function(_0x4b207d){while(--_0x4b207d){_0x56bdab['push'](_0x56bdab['shift']());}};_0x4746b0(++_0x236de1);}(_0xfa73,0x8f));var _0x3fa7=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xfa73[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x3fa7('0x0'));var _=require(_0x3fa7('0x1'));var util=require('util');module['exports']={'name':{'type':Sequelize[_0x3fa7('0x2')],'unique':_0x3fa7('0x3')},'description':{'type':Sequelize[_0x3fa7('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x3fa7('0x4')),'set':function(_0x48e684){if(_['isObjectLike'](_0x48e684)){this[_0x3fa7('0x5')](_0x3fa7('0x6'),JSON[_0x3fa7('0x7')](_0x48e684));}else if(_[_0x3fa7('0x8')](_0x48e684)){this[_0x3fa7('0x5')](_0x3fa7('0x6'),_0x48e684);}else{this[_0x3fa7('0x5')](_0x3fa7('0x6'),util[_0x3fa7('0x9')](_0x3fa7('0xa'),this[_0x3fa7('0xb')](_0x3fa7('0x3'))||'',this['getDataValue'](_0x3fa7('0xc'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x3fa7('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x3fa7('0xd')],'defaultValue':![]}}; \ No newline at end of file +var _0xc979=['TEXT','long','isObjectLike','setDataValue','stringify','isString','formData','format','getDataValue','BOOLEAN','util','exports','STRING','name'];(function(_0x8abd64,_0x539570){var _0xd2511e=function(_0x9fef7d){while(--_0x9fef7d){_0x8abd64['push'](_0x8abd64['shift']());}};_0xd2511e(++_0x539570);}(_0xc979,0x1bc));var _0x9c97=function(_0xd9cb46,_0xed0eee){_0xd9cb46=_0xd9cb46-0x0;var _0x4ef022=_0xc979[_0xd9cb46];return _0x4ef022;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');var util=require(_0x9c97('0x0'));module[_0x9c97('0x1')]={'name':{'type':Sequelize[_0x9c97('0x2')],'unique':_0x9c97('0x3')},'description':{'type':Sequelize[_0x9c97('0x2')]},'formData':{'type':Sequelize[_0x9c97('0x4')](_0x9c97('0x5')),'set':function(_0x33c665){if(_[_0x9c97('0x6')](_0x33c665)){this[_0x9c97('0x7')]('formData',JSON[_0x9c97('0x8')](_0x33c665));}else if(_[_0x9c97('0x9')](_0x33c665)){this[_0x9c97('0x7')](_0x9c97('0xa'),_0x33c665);}else{this[_0x9c97('0x7')]('formData',util[_0x9c97('0xb')]('{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}',this[_0x9c97('0xc')](_0x9c97('0x3'))||'',this[_0x9c97('0xc')]('description')||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x9c97('0xd')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x9c97('0xd')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index f26858b..50a6f3b 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 _0xd89d=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','update','destroy','get','Projects','then','name','index','JscriptyProject','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','map','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','body','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','UserProfileResource','getSessions','findOne','JscriptySessionReport','ProjectId','getAnswers','JscriptyAnswerReport','toString','indexOf','replace','startTime','parse','JscriptyQuestionReport','-createdAt','questionId','question','starttime','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','now','writeFileSync','setHeader','Content-disposition','attachment;\x20filename=','text/csv','download','/tmp/Jscripty_Project_%d_Summary_%s.csv','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd89d,0x144));var _0xdd89=function(_0x1bd3fa,_0x4fdc1c){_0x1bd3fa=_0x1bd3fa-0x0;var _0x4ea542=_0xd89d[_0x1bd3fa];return _0x4ea542;};'use strict';var pdf=require(_0xdd89('0x0'));var emlformat=require(_0xdd89('0x1'));var rimraf=require(_0xdd89('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xdd89('0x3'));var moment=require('moment');var BPromise=require(_0xdd89('0x4'));var Mustache=require(_0xdd89('0x5'));var util=require(_0xdd89('0x6'));var path=require(_0xdd89('0x7'));var sox=require('sox');var csv=require(_0xdd89('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd89('0x9'));var squel=require(_0xdd89('0xa'));var crypto=require('crypto');var jsforce=require(_0xdd89('0xb'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xdd89('0xc'));var Papa=require(_0xdd89('0xd'));var Redis=require(_0xdd89('0xe'));var authService=require(_0xdd89('0xf'));var qs=require(_0xdd89('0x10'));var as=require(_0xdd89('0x11'));var hardwareService=require(_0xdd89('0x12'));var logger=require(_0xdd89('0x13'))(_0xdd89('0x14'));var utils=require(_0xdd89('0x15'));var config=require(_0xdd89('0x16'));var db=require(_0xdd89('0x17'))['db'];function respondWithStatusCode(_0x30de5c,_0x1fb05e){_0x1fb05e=_0x1fb05e||0xcc;return function(_0x103a2a){if(_0x103a2a){return _0x30de5c[_0xdd89('0x18')](_0x1fb05e);}return _0x30de5c['status'](_0x1fb05e)[_0xdd89('0x19')]();};}function respondWithResult(_0x4cf036,_0x524bee){_0x524bee=_0x524bee||0xc8;return function(_0xa1a011){if(_0xa1a011){return _0x4cf036[_0xdd89('0x1a')](_0x524bee)[_0xdd89('0x1b')](_0xa1a011);}};}function respondWithFilteredResult(_0x597051,_0x7c123b){return function(_0x8da322){if(_0x8da322){var _0x55b34d=_0x8da322[_0xdd89('0x1c')],_0x2f9007=_0x7c123b[_0xdd89('0x1d')],_0x2182d5=_0x7c123b[_0xdd89('0x1d')]+_0x7c123b[_0xdd89('0x1e')],_0x58f820;if(_0x2182d5>=_0x55b34d){_0x2182d5=_0x55b34d;_0x58f820=0xc8;}else{_0x58f820=0xce;}_0x597051[_0xdd89('0x1a')](_0x58f820);return _0x597051[_0xdd89('0x1f')]('Content-Range',_0x2f9007+'-'+_0x2182d5+'/'+_0x55b34d)[_0xdd89('0x1b')](_0x8da322);}return null;};}function patchUpdates(_0x16e066){return function(_0x61fdc5){try{jsonpatch[_0xdd89('0x20')](_0x61fdc5,_0x16e066,!![]);}catch(_0x2c12a1){return BPromise['reject'](_0x2c12a1);}return _0x61fdc5['save']();};}function saveUpdates(_0x323fbd,_0x354543){return function(_0x252ff0){if(_0x252ff0){return _0x252ff0[_0xdd89('0x21')](_0x323fbd)['then'](function(_0x19e0f0){return _0x19e0f0;});}return null;};}function removeEntity(_0x2cf1c7,_0x117863){return function(_0x11ca4c){if(_0x11ca4c){return _0x11ca4c[_0xdd89('0x22')]()['then'](function(){var _0x511de4=_0x11ca4c[_0xdd89('0x23')]({'plain':!![]});var _0x3511d4=_0xdd89('0x24');return db['UserProfileResource'][_0xdd89('0x22')]({'where':{'type':_0x3511d4,'resourceId':_0x511de4['id']}})[_0xdd89('0x25')](function(){return _0x11ca4c;});})[_0xdd89('0x25')](function(){_0x2cf1c7[_0xdd89('0x1a')](0xcc)[_0xdd89('0x19')]();});}};}function handleEntityNotFound(_0x24f5b9,_0x428883){return function(_0x309032){if(!_0x309032){_0x24f5b9['sendStatus'](0x194);}return _0x309032;};}function handleError(_0x5e1115,_0x4d347e){_0x4d347e=_0x4d347e||0x1f4;return function(_0x547701){logger['error'](_0x547701['stack']);if(_0x547701[_0xdd89('0x26')]){delete _0x547701['name'];}_0x5e1115[_0xdd89('0x1a')](_0x4d347e)['send'](_0x547701);};}exports[_0xdd89('0x27')]=function(_0x5c2e7e,_0x5ab69a){var _0x2fd368={},_0x307934={},_0x53aaf9={'count':0x0,'rows':[]};var _0x3f0853=_['map'](db[_0xdd89('0x28')][_0xdd89('0x29')],function(_0x3a5b26){return{'name':_0x3a5b26[_0xdd89('0x2a')],'type':_0x3a5b26[_0xdd89('0x2b')][_0xdd89('0x2c')]};});_0x307934[_0xdd89('0x2d')]=_['map'](_0x3f0853,_0xdd89('0x26'));_0x307934['query']=_[_0xdd89('0x2e')](_0x5c2e7e[_0xdd89('0x2f')]);_0x307934[_0xdd89('0x30')]=_[_0xdd89('0x31')](_0x307934[_0xdd89('0x2d')],_0x307934['query']);_0x2fd368[_0xdd89('0x32')]=_[_0xdd89('0x31')](_0x307934[_0xdd89('0x2d')],qs['fields'](_0x5c2e7e[_0xdd89('0x2f')][_0xdd89('0x33')]));_0x2fd368[_0xdd89('0x32')]=_0x2fd368[_0xdd89('0x32')][_0xdd89('0x34')]?_0x2fd368[_0xdd89('0x32')]:_0x307934[_0xdd89('0x2d')];if(!_0x5c2e7e['query'][_0xdd89('0x35')](_0xdd89('0x36'))){_0x2fd368[_0xdd89('0x1e')]=qs[_0xdd89('0x1e')](_0x5c2e7e['query']['limit']);_0x2fd368[_0xdd89('0x1d')]=qs[_0xdd89('0x1d')](_0x5c2e7e[_0xdd89('0x2f')][_0xdd89('0x1d')]);}_0x2fd368[_0xdd89('0x37')]=qs[_0xdd89('0x38')](_0x5c2e7e[_0xdd89('0x2f')][_0xdd89('0x38')]);_0x2fd368[_0xdd89('0x39')]=qs[_0xdd89('0x30')](_[_0xdd89('0x3a')](_0x5c2e7e[_0xdd89('0x2f')],_0x307934[_0xdd89('0x30')]));if(_0x5c2e7e[_0xdd89('0x2f')][_0xdd89('0x3b')]){_0x2fd368[_0xdd89('0x39')]=_[_0xdd89('0x3c')](_0x2fd368[_0xdd89('0x39')],{'$or':_[_0xdd89('0x3d')](_0x3f0853,function(_0x2123f8){if(_0x2123f8[_0xdd89('0x2b')]!==_0xdd89('0x3e')){var _0x4935c8={};_0x4935c8[_0x2123f8[_0xdd89('0x26')]]={'$like':'%'+_0x5c2e7e['query'][_0xdd89('0x3b')]+'%'};return _0x4935c8;}})});}_0x2fd368=_['merge']({},_0x2fd368,_0x5c2e7e[_0xdd89('0x3f')]);var _0x5d75d3={'where':_0x2fd368[_0xdd89('0x39')]};return db[_0xdd89('0x28')]['count'](_0x5d75d3)[_0xdd89('0x25')](function(_0xeb2f91){_0x53aaf9[_0xdd89('0x1c')]=_0xeb2f91;if(_0x5c2e7e['query'][_0xdd89('0x40')]){_0x2fd368[_0xdd89('0x41')]=[{'all':!![]}];}return db[_0xdd89('0x28')][_0xdd89('0x42')](_0x2fd368);})[_0xdd89('0x25')](function(_0x554676){_0x53aaf9[_0xdd89('0x43')]=_0x554676;return _0x53aaf9;})[_0xdd89('0x25')](respondWithFilteredResult(_0x5ab69a,_0x2fd368))[_0xdd89('0x44')](handleError(_0x5ab69a,null));};exports['show']=function(_0x3c64d1,_0x2a4830){var _0x5ed8eb={'raw':![],'where':{'id':_0x3c64d1[_0xdd89('0x45')]['id']}},_0x555bd6={};_0x555bd6['model']=_[_0xdd89('0x2e')](db[_0xdd89('0x28')][_0xdd89('0x29')]);_0x555bd6[_0xdd89('0x2f')]=_[_0xdd89('0x2e')](_0x3c64d1['query']);_0x555bd6[_0xdd89('0x30')]=_[_0xdd89('0x31')](_0x555bd6[_0xdd89('0x2d')],_0x555bd6[_0xdd89('0x2f')]);_0x5ed8eb[_0xdd89('0x32')]=_[_0xdd89('0x31')](_0x555bd6[_0xdd89('0x2d')],qs[_0xdd89('0x33')](_0x3c64d1[_0xdd89('0x2f')][_0xdd89('0x33')]));_0x5ed8eb[_0xdd89('0x32')]=_0x5ed8eb[_0xdd89('0x32')][_0xdd89('0x34')]?_0x5ed8eb[_0xdd89('0x32')]:_0x555bd6[_0xdd89('0x2d')];if(_0x3c64d1['query'][_0xdd89('0x40')]){_0x5ed8eb[_0xdd89('0x41')]=[{'all':!![]}];}_0x5ed8eb=_[_0xdd89('0x3c')]({},_0x5ed8eb,_0x3c64d1['options']);return db[_0xdd89('0x28')][_0xdd89('0x46')](_0x5ed8eb)[_0xdd89('0x25')](handleEntityNotFound(_0x2a4830,null))['then'](respondWithResult(_0x2a4830,null))[_0xdd89('0x44')](handleError(_0x2a4830,null));};exports[_0xdd89('0x47')]=function(_0x21e980,_0xc10d56){return db['JscriptyProject'][_0xdd89('0x47')](_0x21e980['body'],{})[_0xdd89('0x25')](function(_0xa0efda){var _0xd61e56=_0x21e980['user'][_0xdd89('0x23')]({'plain':!![]});if(!_0xd61e56)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xd61e56[_0xdd89('0x48')]===_0xdd89('0x49')){var _0x8c902d=_0xa0efda[_0xdd89('0x23')]({'plain':!![]});var _0x394aba=_0xdd89('0x24');return db[_0xdd89('0x4a')][_0xdd89('0x46')]({'where':{'name':_0x394aba,'userProfileId':_0xd61e56[_0xdd89('0x4b')]},'raw':!![]})[_0xdd89('0x25')](function(_0x3be921){if(_0x3be921&&_0x3be921['autoAssociation']===0x0){return db['UserProfileResource'][_0xdd89('0x47')]({'name':_0x8c902d[_0xdd89('0x26')],'resourceId':_0x8c902d['id'],'type':_0x3be921[_0xdd89('0x26')],'sectionId':_0x3be921['id']},{})[_0xdd89('0x25')](function(){return _0xa0efda;});}else{return _0xa0efda;}})['catch'](function(_0x3535fd){logger['error'](_0xdd89('0x4c'),_0x3535fd);throw _0x3535fd;});}return _0xa0efda;})['then'](respondWithResult(_0xc10d56,0xc9))[_0xdd89('0x44')](handleError(_0xc10d56,null));};exports['clone']=function(_0x43e534,_0x403308){var _0x583e17={'where':{'id':_0x43e534[_0xdd89('0x45')]['id']}},_0x44cc30={};_0x44cc30[_0xdd89('0x2d')]=_[_0xdd89('0x2e')](db[_0xdd89('0x28')][_0xdd89('0x29')]);_0x583e17['attributes']=_[_0xdd89('0x31')](_0x44cc30[_0xdd89('0x2d')],qs[_0xdd89('0x33')](_0x43e534[_0xdd89('0x2f')]['fields']));_0x583e17[_0xdd89('0x32')]=_0x583e17[_0xdd89('0x32')][_0xdd89('0x34')]?_0x583e17[_0xdd89('0x32')]:_0x44cc30[_0xdd89('0x2d')];if(_0x43e534[_0xdd89('0x2f')][_0xdd89('0x40')]){_0x583e17['include']=[{'all':!![]}];}_0x583e17=_[_0xdd89('0x3c')]({},_0x583e17,_0x43e534['options']);return db['JscriptyProject'][_0xdd89('0x46')](_0x583e17)[_0xdd89('0x25')](handleEntityNotFound(_0x403308,null))[_0xdd89('0x25')](function(_0xf78cee){if(_0xf78cee){var _0x236564=_0xf78cee['get']({'plain':!![]});_0x236564=qs[_0xdd89('0x4d')](_0x236564,['id','createdAt',_0xdd89('0x4e')]);_0x43e534[_0xdd89('0x4f')]=_[_0xdd89('0x4d')](_0x43e534[_0xdd89('0x4f')],['id',_0xdd89('0x50'),_0xdd89('0x4e')]);return db[_0xdd89('0x28')]['create'](_[_0xdd89('0x3c')](_0x236564,_0x43e534['body']),{'include':_0x43e534[_0xdd89('0x2f')][_0xdd89('0x40')]?[{'all':!![]}]:undefined})['then'](function(_0x4046b6){var _0x6cacbd=_0x43e534['user'][_0xdd89('0x23')]({'plain':!![]});if(!_0x6cacbd)throw new Error(_0xdd89('0x51'));if(_0x6cacbd['role']===_0xdd89('0x49')){var _0x1b7165=_0x4046b6['get']({'plain':!![]});var _0x438807=_0xdd89('0x24');return db[_0xdd89('0x4a')][_0xdd89('0x46')]({'where':{'name':_0x438807,'userProfileId':_0x6cacbd['userProfileId']},'raw':!![]})[_0xdd89('0x25')](function(_0x5bb923){if(_0x5bb923&&_0x5bb923[_0xdd89('0x52')]===0x0){return db[_0xdd89('0x53')][_0xdd89('0x47')]({'name':_0x1b7165[_0xdd89('0x26')],'resourceId':_0x1b7165['id'],'type':_0x5bb923['name'],'sectionId':_0x5bb923['id']},{})[_0xdd89('0x25')](function(){return _0x4046b6;});}else{return _0x4046b6;}})[_0xdd89('0x44')](function(_0x5b8b9c){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5b8b9c);throw _0x5b8b9c;});}return _0x4046b6;});}})[_0xdd89('0x25')](respondWithResult(_0x403308,0xc9))[_0xdd89('0x44')](handleError(_0x403308,null));};exports[_0xdd89('0x21')]=function(_0x427520,_0x130227){if(_0x427520[_0xdd89('0x4f')]['id']){delete _0x427520['body']['id'];}return db[_0xdd89('0x28')]['find']({'where':{'id':_0x427520[_0xdd89('0x45')]['id']}})[_0xdd89('0x25')](handleEntityNotFound(_0x130227,null))['then'](saveUpdates(_0x427520['body'],null))['then'](respondWithResult(_0x130227,null))[_0xdd89('0x44')](handleError(_0x130227,null));};exports['destroy']=function(_0x7cd931,_0x24e5ec){return db[_0xdd89('0x28')][_0xdd89('0x46')]({'where':{'id':_0x7cd931[_0xdd89('0x45')]['id']}})[_0xdd89('0x25')](handleEntityNotFound(_0x24e5ec,null))[_0xdd89('0x25')](removeEntity(_0x24e5ec,null))[_0xdd89('0x44')](handleError(_0x24e5ec,null));};exports[_0xdd89('0x54')]=function(_0x400378,_0x55c520,_0xbe3051){var _0x180c21={'raw':!![],'where':{}};var _0x1114b3={};var _0x43fcbd={'count':0x0,'rows':[]};return db[_0xdd89('0x28')][_0xdd89('0x55')]({'where':{'id':_0x400378[_0xdd89('0x45')]['id']}})[_0xdd89('0x25')](handleEntityNotFound(_0x55c520,null))[_0xdd89('0x25')](function(_0x46ba1a){if(_0x46ba1a){_0x1114b3[_0xdd89('0x2d')]=_[_0xdd89('0x2e')](db[_0xdd89('0x56')][_0xdd89('0x29')]);_0x1114b3[_0xdd89('0x2f')]=_[_0xdd89('0x2e')](_0x400378[_0xdd89('0x2f')]);_0x1114b3[_0xdd89('0x30')]=_[_0xdd89('0x31')](_0x1114b3[_0xdd89('0x2d')],_0x1114b3['query']);_0x180c21['attributes']=_[_0xdd89('0x31')](_0x1114b3[_0xdd89('0x2d')],qs[_0xdd89('0x33')](_0x400378[_0xdd89('0x2f')][_0xdd89('0x33')]));_0x180c21['attributes']=_0x180c21[_0xdd89('0x32')]['length']?_0x180c21[_0xdd89('0x32')]:_0x1114b3[_0xdd89('0x2d')];if(!_0x400378[_0xdd89('0x2f')]['hasOwnProperty']('nolimit')){_0x180c21[_0xdd89('0x1e')]=qs[_0xdd89('0x1e')](_0x400378['query'][_0xdd89('0x1e')]);_0x180c21['offset']=qs[_0xdd89('0x1d')](_0x400378[_0xdd89('0x2f')][_0xdd89('0x1d')]);}_0x180c21[_0xdd89('0x37')]=qs['sort'](_0x400378[_0xdd89('0x2f')][_0xdd89('0x38')]);_0x180c21[_0xdd89('0x39')]=qs['filters'](_[_0xdd89('0x3a')](_0x400378[_0xdd89('0x2f')],_0x1114b3['filters']));_0x180c21[_0xdd89('0x39')][_0xdd89('0x57')]=_0x46ba1a['id'];if(_0x400378[_0xdd89('0x2f')][_0xdd89('0x3b')]){_0x180c21['where']=_[_0xdd89('0x3c')](_0x180c21[_0xdd89('0x39')],{'$or':_[_0xdd89('0x3d')](_0x180c21[_0xdd89('0x32')],function(_0x2e81f9){var _0x1f2930={};_0x1f2930[_0x2e81f9]={'$like':'%'+_0x400378[_0xdd89('0x2f')][_0xdd89('0x3b')]+'%'};return _0x1f2930;})});}_0x180c21=_[_0xdd89('0x3c')]({},_0x180c21,_0x400378[_0xdd89('0x3f')]);return db[_0xdd89('0x56')][_0xdd89('0x1c')]({'where':_0x180c21['where']})['then'](function(_0xc056b0){_0x43fcbd['count']=_0xc056b0;if(_0x400378['query'][_0xdd89('0x40')]){_0x180c21[_0xdd89('0x41')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0xdd89('0x42')](_0x180c21);})[_0xdd89('0x25')](function(_0x3e812f){_0x43fcbd['rows']=_0x3e812f;return _0x43fcbd;});}})[_0xdd89('0x25')](respondWithFilteredResult(_0x55c520,_0x180c21))[_0xdd89('0x44')](handleError(_0x55c520,null));};exports[_0xdd89('0x58')]=function(_0x3676dd,_0x44854f,_0x4b691d){var _0x532bdc={'raw':!![],'where':{}};var _0x362571={};var _0x27215e={'count':0x0,'rows':[]};return db['JscriptyProject']['findOne']({'where':{'id':_0x3676dd['params']['id']}})[_0xdd89('0x25')](handleEntityNotFound(_0x44854f,null))[_0xdd89('0x25')](function(_0x4c96e5){if(_0x4c96e5){_0x362571[_0xdd89('0x2d')]=_[_0xdd89('0x2e')](db[_0xdd89('0x59')][_0xdd89('0x29')]);_0x362571['query']=_[_0xdd89('0x2e')](_0x3676dd['query']);_0x362571[_0xdd89('0x30')]=_['intersection'](_0x362571[_0xdd89('0x2d')],_0x362571[_0xdd89('0x2f')]);_0x532bdc[_0xdd89('0x32')]=_[_0xdd89('0x31')](_0x362571[_0xdd89('0x2d')],qs[_0xdd89('0x33')](_0x3676dd['query'][_0xdd89('0x33')]));_0x532bdc['attributes']=_0x532bdc[_0xdd89('0x32')][_0xdd89('0x34')]?_0x532bdc[_0xdd89('0x32')]:_0x362571[_0xdd89('0x2d')];if(!_0x3676dd[_0xdd89('0x2f')][_0xdd89('0x35')](_0xdd89('0x36'))){_0x532bdc[_0xdd89('0x1e')]=qs[_0xdd89('0x1e')](_0x3676dd[_0xdd89('0x2f')][_0xdd89('0x1e')]);_0x532bdc[_0xdd89('0x1d')]=qs['offset'](_0x3676dd['query'][_0xdd89('0x1d')]);}_0x532bdc[_0xdd89('0x37')]=qs[_0xdd89('0x38')](_0x3676dd[_0xdd89('0x2f')][_0xdd89('0x38')]);_0x532bdc['where']=qs[_0xdd89('0x30')](_[_0xdd89('0x3a')](_0x3676dd[_0xdd89('0x2f')],_0x362571[_0xdd89('0x30')]));_0x532bdc[_0xdd89('0x39')][_0xdd89('0x57')]=_0x4c96e5['id'];if(_0x3676dd[_0xdd89('0x2f')][_0xdd89('0x3b')]){_0x532bdc[_0xdd89('0x39')]=_[_0xdd89('0x3c')](_0x532bdc[_0xdd89('0x39')],{'$or':_['map'](_0x532bdc['attributes'],function(_0x7bd8b6){var _0x51d167={};_0x51d167[_0x7bd8b6]={'$like':'%'+_0x3676dd[_0xdd89('0x2f')][_0xdd89('0x3b')]+'%'};return _0x51d167;})});}_0x532bdc=_[_0xdd89('0x3c')]({},_0x532bdc,_0x3676dd[_0xdd89('0x3f')]);return db[_0xdd89('0x59')][_0xdd89('0x1c')]({'where':_0x532bdc[_0xdd89('0x39')]})[_0xdd89('0x25')](function(_0x181b65){_0x27215e[_0xdd89('0x1c')]=_0x181b65;if(_0x3676dd['query'][_0xdd89('0x40')]){_0x532bdc[_0xdd89('0x41')]=[{'all':!![]}];}return db[_0xdd89('0x59')][_0xdd89('0x42')](_0x532bdc);})[_0xdd89('0x25')](function(_0x4231d8){_0x27215e[_0xdd89('0x43')]=_0x4231d8;return _0x27215e;});}})[_0xdd89('0x25')](respondWithFilteredResult(_0x44854f,_0x532bdc))[_0xdd89('0x44')](handleError(_0x44854f,null));};function char(_0xce3b0d){return'number'===typeof _0xce3b0d?String['fromCharCode']['apply'](null,arguments):_0xce3b0d;}function needsEncapsulation(_0x26fb29){return!!_0x26fb29&&(_0x26fb29[_0xdd89('0x5a')]()[_0xdd89('0x5b')](char(0xd))>=0x0||_0x26fb29[_0xdd89('0x5a')]()[_0xdd89('0x5b')](char(0xa))>=0x0||_0x26fb29[_0xdd89('0x5a')]()[_0xdd89('0x5b')](char(0x2c))>=0x0||_0x26fb29[_0xdd89('0x5a')]()[_0xdd89('0x5b')](char(0x22))>=0x0);}function encapsulate(_0xb91c79){var _0x503afc=char(0x22),_0xcbf9d0='\x5c'+char(0x22),_0x246f0e=_0xb91c79[_0xdd89('0x5a')]()[_0xdd89('0x5c')](new RegExp(_0x503afc,'g'),_0xcbf9d0);return _0x503afc+_0x246f0e+_0x503afc;}exports['getSummary']=function(_0x156383,_0x37401f,_0x5458f3){var _0x12fa57,_0x21e77c;var _0x1f82d5={'where':{'ProjectId':_0x156383[_0xdd89('0x45')]['id']}};if(_0x156383[_0xdd89('0x2f')][_0xdd89('0x5d')]){_0x1f82d5[_0xdd89('0x39')]['starttime']=JSON[_0xdd89('0x5e')](_0x156383[_0xdd89('0x2f')][_0xdd89('0x5d')]);}return db[_0xdd89('0x56')]['findAll'](_0x1f82d5)['then'](handleEntityNotFound(_0x37401f,null))[_0xdd89('0x25')](function(_0x653c2e){if(_0x653c2e){_0x12fa57=_0x653c2e;return db[_0xdd89('0x5f')][_0xdd89('0x42')]({'where':{'SessionId':{'$in':_[_0xdd89('0x3d')](_0x12fa57,'id')},'ProjectId':_0x156383[_0xdd89('0x45')]['id']},'order':_0xdd89('0x60')});}})[_0xdd89('0x25')](handleEntityNotFound(_0x37401f,null))[_0xdd89('0x25')](function(_0x53c598){if(_0x53c598){_0x21e77c=_0x53c598;var _0x2af084={};for(var _0x42295e=0x0,_0x17e079=_0x21e77c[_0xdd89('0x34')];_0x42295e<_0x17e079;_0x42295e++){if(!_0x2af084[_0xdd89('0x35')](_0x21e77c[_0x42295e][_0xdd89('0x61')])){_0x2af084[_0x21e77c[_0x42295e][_0xdd89('0x61')]]=needsEncapsulation(_0x21e77c[_0x42295e][_0xdd89('0x62')])?encapsulate(_0x21e77c[_0x42295e][_0xdd89('0x62')]):_0x21e77c[_0x42295e][_0xdd89('0x62')];}}var _0x94c89f=[],_0x3cd463={};for(var _0x6e15c7=0x0,_0x25a7ed=_0x12fa57['length'];_0x6e15c7<_0x25a7ed;_0x6e15c7++){_0x3cd463={'ProjectId':_0x156383['params']['id'],'SessionId':_0x12fa57[_0x6e15c7]['id'],'StartTime':moment(_0x12fa57[_0x6e15c7][_0xdd89('0x63')])[_0xdd89('0x64')](_0xdd89('0x65'))};for(var _0x10105d=0x0,_0x3d87c3=_0x21e77c[_0xdd89('0x34')];_0x10105d<_0x3d87c3;_0x10105d++){if(_0x21e77c[_0x10105d][_0xdd89('0x66')]==_0x12fa57[_0x6e15c7]['id']&&_0x2af084[_0xdd89('0x35')](_0x21e77c[_0x10105d]['questionId'])){_0x3cd463[_0x2af084[_0x21e77c[_0x10105d]['questionId']]]=_0x21e77c[_0x10105d]['answer'];}}for(var _0x30c34d in _0x2af084){if(!_0x3cd463['hasOwnProperty'](_0x2af084[_0x30c34d])){_0x3cd463[_0x2af084[_0x30c34d]]=null;}}_0x94c89f[_0xdd89('0x67')](_0x3cd463);}return _0x94c89f;}})[_0xdd89('0x25')](function(_0x473571){if(!_['isEmpty'](_0x473571)){var _0x6dc78a=toCsv(_0x473571);var _0x22abe6=Date[_0xdd89('0x68')]();fs[_0xdd89('0x69')](util[_0xdd89('0x64')]('/tmp/Jscripty_Project_%d_Summary_%s.csv',_0x156383['params']['id'],_0x22abe6),_0x6dc78a);_0x37401f[_0xdd89('0x6a')](_0xdd89('0x6b'),_0xdd89('0x6c')+util[_0xdd89('0x64')]('Jscripty_Project_%d_Summary_%s.csv',_0x156383[_0xdd89('0x45')]['id'],_0x22abe6));_0x37401f['setHeader']('Content-type',_0xdd89('0x6d'));return _0x37401f[_0xdd89('0x6e')](util[_0xdd89('0x64')](_0xdd89('0x6f'),_0x156383[_0xdd89('0x45')]['id'],_0x22abe6));}else{return _0x37401f[_0xdd89('0x18')](0xcc);}})[_0xdd89('0x44')](handleError(_0x37401f,null));}; \ No newline at end of file +var _0x54fc=['destroy','get','UserProfileResource','error','stack','name','send','index','JscriptyProject','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','where','map','type','merge','options','includeAll','findAll','catch','include','find','create','body','user','Projects','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','omit','createdAt','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','params','getSessions','findOne','ProjectId','JscriptySessionReport','rows','getAnswers','JscriptyAnswerReport','number','fromCharCode','toString','indexOf','getSummary','starttime','parse','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','answer','push','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','attachment;\x20filename=','Content-type','text/csv','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','end','count','offset','limit','status','Content-Range','json','apply','reject','update','then'];(function(_0x405e20,_0x4981b3){var _0x55d176=function(_0x188da1){while(--_0x188da1){_0x405e20['push'](_0x405e20['shift']());}};_0x55d176(++_0x4981b3);}(_0x54fc,0x1a8));var _0xc54f=function(_0x5956c4,_0x5b932a){_0x5956c4=_0x5956c4-0x0;var _0x4b36ed=_0x54fc[_0x5956c4];return _0x4b36ed;};'use strict';var pdf=require(_0xc54f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc54f('0x1'));var zipdir=require(_0xc54f('0x2'));var jsonpatch=require(_0xc54f('0x3'));var rp=require(_0xc54f('0x4'));var moment=require(_0xc54f('0x5'));var BPromise=require(_0xc54f('0x6'));var Mustache=require(_0xc54f('0x7'));var util=require('util');var path=require(_0xc54f('0x8'));var sox=require(_0xc54f('0x9'));var csv=require(_0xc54f('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc54f('0xb'));var squel=require(_0xc54f('0xc'));var crypto=require(_0xc54f('0xd'));var jsforce=require(_0xc54f('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xc54f('0xa'));var querystring=require(_0xc54f('0xf'));var Papa=require(_0xc54f('0x10'));var Redis=require(_0xc54f('0x11'));var authService=require(_0xc54f('0x12'));var qs=require(_0xc54f('0x13'));var as=require(_0xc54f('0x14'));var hardwareService=require(_0xc54f('0x15'));var logger=require(_0xc54f('0x16'))('api');var utils=require(_0xc54f('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5af78c,_0x7ac484){_0x7ac484=_0x7ac484||0xcc;return function(_0x378336){if(_0x378336){return _0x5af78c[_0xc54f('0x18')](_0x7ac484);}return _0x5af78c['status'](_0x7ac484)[_0xc54f('0x19')]();};}function respondWithResult(_0x5e89fb,_0x135845){_0x135845=_0x135845||0xc8;return function(_0x3b22fd){if(_0x3b22fd){return _0x5e89fb['status'](_0x135845)['json'](_0x3b22fd);}};}function respondWithFilteredResult(_0x331bca,_0x36c51e){return function(_0xef2f4e){if(_0xef2f4e){var _0x3eed3a=_0xef2f4e[_0xc54f('0x1a')],_0xd615dd=_0x36c51e[_0xc54f('0x1b')],_0x1c2bcb=_0x36c51e['offset']+_0x36c51e[_0xc54f('0x1c')],_0x337dc5;if(_0x1c2bcb>=_0x3eed3a){_0x1c2bcb=_0x3eed3a;_0x337dc5=0xc8;}else{_0x337dc5=0xce;}_0x331bca[_0xc54f('0x1d')](_0x337dc5);return _0x331bca['set'](_0xc54f('0x1e'),_0xd615dd+'-'+_0x1c2bcb+'/'+_0x3eed3a)[_0xc54f('0x1f')](_0xef2f4e);}return null;};}function patchUpdates(_0x408f38){return function(_0x5e2327){try{jsonpatch[_0xc54f('0x20')](_0x5e2327,_0x408f38,!![]);}catch(_0x2752f1){return BPromise[_0xc54f('0x21')](_0x2752f1);}return _0x5e2327['save']();};}function saveUpdates(_0x19c184,_0xad2a5b){return function(_0x372d33){if(_0x372d33){return _0x372d33[_0xc54f('0x22')](_0x19c184)[_0xc54f('0x23')](function(_0x1a1bd7){return _0x1a1bd7;});}return null;};}function removeEntity(_0x460c81,_0x1d52cc){return function(_0x5ab401){if(_0x5ab401){return _0x5ab401[_0xc54f('0x24')]()[_0xc54f('0x23')](function(){var _0x7f8477=_0x5ab401[_0xc54f('0x25')]({'plain':!![]});var _0x15a04b='Projects';return db[_0xc54f('0x26')][_0xc54f('0x24')]({'where':{'type':_0x15a04b,'resourceId':_0x7f8477['id']}})[_0xc54f('0x23')](function(){return _0x5ab401;});})[_0xc54f('0x23')](function(){_0x460c81['status'](0xcc)[_0xc54f('0x19')]();});}};}function handleEntityNotFound(_0x435910,_0x2fc9a3){return function(_0x4625fb){if(!_0x4625fb){_0x435910['sendStatus'](0x194);}return _0x4625fb;};}function handleError(_0x6e8b2a,_0x422393){_0x422393=_0x422393||0x1f4;return function(_0xb371f8){logger[_0xc54f('0x27')](_0xb371f8[_0xc54f('0x28')]);if(_0xb371f8[_0xc54f('0x29')]){delete _0xb371f8[_0xc54f('0x29')];}_0x6e8b2a[_0xc54f('0x1d')](_0x422393)[_0xc54f('0x2a')](_0xb371f8);};}exports[_0xc54f('0x2b')]=function(_0x566b7d,_0x5ccfa9){var _0x4c1c3f={},_0x482a98={},_0x543323={'count':0x0,'rows':[]};var _0x563383=_['map'](db[_0xc54f('0x2c')][_0xc54f('0x2d')],function(_0x45a546){return{'name':_0x45a546[_0xc54f('0x2e')],'type':_0x45a546['type'][_0xc54f('0x2f')]};});_0x482a98[_0xc54f('0x30')]=_['map'](_0x563383,_0xc54f('0x29'));_0x482a98[_0xc54f('0x31')]=_[_0xc54f('0x32')](_0x566b7d['query']);_0x482a98[_0xc54f('0x33')]=_[_0xc54f('0x34')](_0x482a98[_0xc54f('0x30')],_0x482a98[_0xc54f('0x31')]);_0x4c1c3f[_0xc54f('0x35')]=_[_0xc54f('0x34')](_0x482a98[_0xc54f('0x30')],qs[_0xc54f('0x36')](_0x566b7d[_0xc54f('0x31')][_0xc54f('0x36')]));_0x4c1c3f[_0xc54f('0x35')]=_0x4c1c3f[_0xc54f('0x35')][_0xc54f('0x37')]?_0x4c1c3f[_0xc54f('0x35')]:_0x482a98[_0xc54f('0x30')];if(!_0x566b7d[_0xc54f('0x31')][_0xc54f('0x38')]('nolimit')){_0x4c1c3f[_0xc54f('0x1c')]=qs[_0xc54f('0x1c')](_0x566b7d[_0xc54f('0x31')]['limit']);_0x4c1c3f[_0xc54f('0x1b')]=qs[_0xc54f('0x1b')](_0x566b7d[_0xc54f('0x31')][_0xc54f('0x1b')]);}_0x4c1c3f[_0xc54f('0x39')]=qs[_0xc54f('0x3a')](_0x566b7d['query']['sort']);_0x4c1c3f['where']=qs['filters'](_[_0xc54f('0x3b')](_0x566b7d[_0xc54f('0x31')],_0x482a98['filters']));if(_0x566b7d[_0xc54f('0x31')][_0xc54f('0x3c')]){_0x4c1c3f['where']=_['merge'](_0x4c1c3f[_0xc54f('0x3d')],{'$or':_[_0xc54f('0x3e')](_0x563383,function(_0x31b4eb){if(_0x31b4eb[_0xc54f('0x3f')]!=='VIRTUAL'){var _0x1b9a50={};_0x1b9a50[_0x31b4eb[_0xc54f('0x29')]]={'$like':'%'+_0x566b7d[_0xc54f('0x31')]['filter']+'%'};return _0x1b9a50;}})});}_0x4c1c3f=_[_0xc54f('0x40')]({},_0x4c1c3f,_0x566b7d[_0xc54f('0x41')]);var _0x3b343e={'where':_0x4c1c3f['where']};return db[_0xc54f('0x2c')][_0xc54f('0x1a')](_0x3b343e)[_0xc54f('0x23')](function(_0x327c18){_0x543323[_0xc54f('0x1a')]=_0x327c18;if(_0x566b7d[_0xc54f('0x31')][_0xc54f('0x42')]){_0x4c1c3f['include']=[{'all':!![]}];}return db[_0xc54f('0x2c')][_0xc54f('0x43')](_0x4c1c3f);})['then'](function(_0x15d9ea){_0x543323['rows']=_0x15d9ea;return _0x543323;})[_0xc54f('0x23')](respondWithFilteredResult(_0x5ccfa9,_0x4c1c3f))[_0xc54f('0x44')](handleError(_0x5ccfa9,null));};exports['show']=function(_0x2b20b6,_0x19c76e){var _0x151020={'raw':![],'where':{'id':_0x2b20b6['params']['id']}},_0x552fdf={};_0x552fdf[_0xc54f('0x30')]=_[_0xc54f('0x32')](db[_0xc54f('0x2c')]['rawAttributes']);_0x552fdf[_0xc54f('0x31')]=_[_0xc54f('0x32')](_0x2b20b6[_0xc54f('0x31')]);_0x552fdf[_0xc54f('0x33')]=_[_0xc54f('0x34')](_0x552fdf[_0xc54f('0x30')],_0x552fdf[_0xc54f('0x31')]);_0x151020['attributes']=_[_0xc54f('0x34')](_0x552fdf[_0xc54f('0x30')],qs['fields'](_0x2b20b6[_0xc54f('0x31')][_0xc54f('0x36')]));_0x151020['attributes']=_0x151020[_0xc54f('0x35')]['length']?_0x151020['attributes']:_0x552fdf[_0xc54f('0x30')];if(_0x2b20b6[_0xc54f('0x31')]['includeAll']){_0x151020[_0xc54f('0x45')]=[{'all':!![]}];}_0x151020=_['merge']({},_0x151020,_0x2b20b6[_0xc54f('0x41')]);return db[_0xc54f('0x2c')][_0xc54f('0x46')](_0x151020)[_0xc54f('0x23')](handleEntityNotFound(_0x19c76e,null))['then'](respondWithResult(_0x19c76e,null))[_0xc54f('0x44')](handleError(_0x19c76e,null));};exports[_0xc54f('0x47')]=function(_0x2429c5,_0x47ad97){return db[_0xc54f('0x2c')][_0xc54f('0x47')](_0x2429c5[_0xc54f('0x48')],{})[_0xc54f('0x23')](function(_0x11d1ce){var _0x32a23c=_0x2429c5[_0xc54f('0x49')][_0xc54f('0x25')]({'plain':!![]});if(!_0x32a23c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x32a23c['role']===_0xc54f('0x49')){var _0x3ee919=_0x11d1ce[_0xc54f('0x25')]({'plain':!![]});var _0x58f7cc=_0xc54f('0x4a');return db['UserProfileSection'][_0xc54f('0x46')]({'where':{'name':_0x58f7cc,'userProfileId':_0x32a23c[_0xc54f('0x4b')]},'raw':!![]})[_0xc54f('0x23')](function(_0x2fe8f7){if(_0x2fe8f7&&_0x2fe8f7[_0xc54f('0x4c')]===0x0){return db[_0xc54f('0x26')][_0xc54f('0x47')]({'name':_0x3ee919[_0xc54f('0x29')],'resourceId':_0x3ee919['id'],'type':_0x2fe8f7[_0xc54f('0x29')],'sectionId':_0x2fe8f7['id']},{})[_0xc54f('0x23')](function(){return _0x11d1ce;});}else{return _0x11d1ce;}})[_0xc54f('0x44')](function(_0x505b38){logger[_0xc54f('0x27')](_0xc54f('0x4d'),_0x505b38);throw _0x505b38;});}return _0x11d1ce;})[_0xc54f('0x23')](respondWithResult(_0x47ad97,0xc9))['catch'](handleError(_0x47ad97,null));};exports[_0xc54f('0x4e')]=function(_0x4a6b25,_0x50f5a0){var _0x55d6fb={'where':{'id':_0x4a6b25['params']['id']}},_0x1db811={};_0x1db811['model']=_[_0xc54f('0x32')](db['JscriptyProject'][_0xc54f('0x2d')]);_0x55d6fb[_0xc54f('0x35')]=_[_0xc54f('0x34')](_0x1db811[_0xc54f('0x30')],qs[_0xc54f('0x36')](_0x4a6b25[_0xc54f('0x31')][_0xc54f('0x36')]));_0x55d6fb['attributes']=_0x55d6fb[_0xc54f('0x35')][_0xc54f('0x37')]?_0x55d6fb[_0xc54f('0x35')]:_0x1db811[_0xc54f('0x30')];if(_0x4a6b25[_0xc54f('0x31')][_0xc54f('0x42')]){_0x55d6fb[_0xc54f('0x45')]=[{'all':!![]}];}_0x55d6fb=_[_0xc54f('0x40')]({},_0x55d6fb,_0x4a6b25[_0xc54f('0x41')]);return db[_0xc54f('0x2c')]['find'](_0x55d6fb)[_0xc54f('0x23')](handleEntityNotFound(_0x50f5a0,null))[_0xc54f('0x23')](function(_0x7493aa){if(_0x7493aa){var _0x2fda73=_0x7493aa['get']({'plain':!![]});_0x2fda73=qs[_0xc54f('0x4f')](_0x2fda73,['id',_0xc54f('0x50'),_0xc54f('0x51')]);_0x4a6b25['body']=_['omit'](_0x4a6b25[_0xc54f('0x48')],['id',_0xc54f('0x50'),_0xc54f('0x51')]);return db[_0xc54f('0x2c')]['create'](_['merge'](_0x2fda73,_0x4a6b25[_0xc54f('0x48')]),{'include':_0x4a6b25[_0xc54f('0x31')][_0xc54f('0x42')]?[{'all':!![]}]:undefined})[_0xc54f('0x23')](function(_0x5db09e){var _0x1b8082=_0x4a6b25[_0xc54f('0x49')][_0xc54f('0x25')]({'plain':!![]});if(!_0x1b8082)throw new Error(_0xc54f('0x52'));if(_0x1b8082[_0xc54f('0x53')]==='user'){var _0x44ad43=_0x5db09e['get']({'plain':!![]});var _0x3ee880=_0xc54f('0x4a');return db['UserProfileSection']['find']({'where':{'name':_0x3ee880,'userProfileId':_0x1b8082[_0xc54f('0x4b')]},'raw':!![]})[_0xc54f('0x23')](function(_0x2576ec){if(_0x2576ec&&_0x2576ec[_0xc54f('0x4c')]===0x0){return db['UserProfileResource'][_0xc54f('0x47')]({'name':_0x44ad43['name'],'resourceId':_0x44ad43['id'],'type':_0x2576ec[_0xc54f('0x29')],'sectionId':_0x2576ec['id']},{})[_0xc54f('0x23')](function(){return _0x5db09e;});}else{return _0x5db09e;}})[_0xc54f('0x44')](function(_0x2cf220){logger[_0xc54f('0x27')](_0xc54f('0x4d'),_0x2cf220);throw _0x2cf220;});}return _0x5db09e;});}})[_0xc54f('0x23')](respondWithResult(_0x50f5a0,0xc9))['catch'](handleError(_0x50f5a0,null));};exports[_0xc54f('0x22')]=function(_0x4e26a1,_0x32e9d4){if(_0x4e26a1['body']['id']){delete _0x4e26a1[_0xc54f('0x48')]['id'];}return db['JscriptyProject'][_0xc54f('0x46')]({'where':{'id':_0x4e26a1['params']['id']}})[_0xc54f('0x23')](handleEntityNotFound(_0x32e9d4,null))[_0xc54f('0x23')](saveUpdates(_0x4e26a1[_0xc54f('0x48')],null))['then'](respondWithResult(_0x32e9d4,null))[_0xc54f('0x44')](handleError(_0x32e9d4,null));};exports[_0xc54f('0x24')]=function(_0xa95c41,_0x7ae969){return db[_0xc54f('0x2c')]['find']({'where':{'id':_0xa95c41[_0xc54f('0x54')]['id']}})['then'](handleEntityNotFound(_0x7ae969,null))[_0xc54f('0x23')](removeEntity(_0x7ae969,null))[_0xc54f('0x44')](handleError(_0x7ae969,null));};exports[_0xc54f('0x55')]=function(_0x380d86,_0x11027a,_0x24ca03){var _0x5bfdf7={'raw':!![],'where':{}};var _0x187d96={};var _0x109718={'count':0x0,'rows':[]};return db[_0xc54f('0x2c')][_0xc54f('0x56')]({'where':{'id':_0x380d86[_0xc54f('0x54')]['id']}})[_0xc54f('0x23')](handleEntityNotFound(_0x11027a,null))[_0xc54f('0x23')](function(_0x45b170){if(_0x45b170){_0x187d96['model']=_[_0xc54f('0x32')](db['JscriptySessionReport'][_0xc54f('0x2d')]);_0x187d96[_0xc54f('0x31')]=_[_0xc54f('0x32')](_0x380d86[_0xc54f('0x31')]);_0x187d96['filters']=_[_0xc54f('0x34')](_0x187d96[_0xc54f('0x30')],_0x187d96[_0xc54f('0x31')]);_0x5bfdf7['attributes']=_[_0xc54f('0x34')](_0x187d96[_0xc54f('0x30')],qs[_0xc54f('0x36')](_0x380d86[_0xc54f('0x31')][_0xc54f('0x36')]));_0x5bfdf7[_0xc54f('0x35')]=_0x5bfdf7[_0xc54f('0x35')]['length']?_0x5bfdf7['attributes']:_0x187d96['model'];if(!_0x380d86[_0xc54f('0x31')]['hasOwnProperty']('nolimit')){_0x5bfdf7['limit']=qs['limit'](_0x380d86[_0xc54f('0x31')][_0xc54f('0x1c')]);_0x5bfdf7[_0xc54f('0x1b')]=qs['offset'](_0x380d86[_0xc54f('0x31')]['offset']);}_0x5bfdf7[_0xc54f('0x39')]=qs[_0xc54f('0x3a')](_0x380d86['query'][_0xc54f('0x3a')]);_0x5bfdf7['where']=qs['filters'](_[_0xc54f('0x3b')](_0x380d86[_0xc54f('0x31')],_0x187d96[_0xc54f('0x33')]));_0x5bfdf7[_0xc54f('0x3d')][_0xc54f('0x57')]=_0x45b170['id'];if(_0x380d86[_0xc54f('0x31')]['filter']){_0x5bfdf7[_0xc54f('0x3d')]=_['merge'](_0x5bfdf7[_0xc54f('0x3d')],{'$or':_[_0xc54f('0x3e')](_0x5bfdf7[_0xc54f('0x35')],function(_0x2660d9){var _0xd4bf0a={};_0xd4bf0a[_0x2660d9]={'$like':'%'+_0x380d86['query'][_0xc54f('0x3c')]+'%'};return _0xd4bf0a;})});}_0x5bfdf7=_[_0xc54f('0x40')]({},_0x5bfdf7,_0x380d86[_0xc54f('0x41')]);return db[_0xc54f('0x58')][_0xc54f('0x1a')]({'where':_0x5bfdf7[_0xc54f('0x3d')]})[_0xc54f('0x23')](function(_0xefa168){_0x109718['count']=_0xefa168;if(_0x380d86['query'][_0xc54f('0x42')]){_0x5bfdf7['include']=[{'all':!![]}];}return db['JscriptySessionReport']['findAll'](_0x5bfdf7);})[_0xc54f('0x23')](function(_0x31e096){_0x109718[_0xc54f('0x59')]=_0x31e096;return _0x109718;});}})[_0xc54f('0x23')](respondWithFilteredResult(_0x11027a,_0x5bfdf7))['catch'](handleError(_0x11027a,null));};exports[_0xc54f('0x5a')]=function(_0x5253ae,_0x19756b,_0x41f4a1){var _0x20853c={'raw':!![],'where':{}};var _0x33f5c4={};var _0x2c24c6={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xc54f('0x56')]({'where':{'id':_0x5253ae[_0xc54f('0x54')]['id']}})[_0xc54f('0x23')](handleEntityNotFound(_0x19756b,null))[_0xc54f('0x23')](function(_0x216f82){if(_0x216f82){_0x33f5c4['model']=_['keys'](db[_0xc54f('0x5b')]['rawAttributes']);_0x33f5c4['query']=_['keys'](_0x5253ae[_0xc54f('0x31')]);_0x33f5c4[_0xc54f('0x33')]=_[_0xc54f('0x34')](_0x33f5c4[_0xc54f('0x30')],_0x33f5c4[_0xc54f('0x31')]);_0x20853c[_0xc54f('0x35')]=_[_0xc54f('0x34')](_0x33f5c4[_0xc54f('0x30')],qs[_0xc54f('0x36')](_0x5253ae[_0xc54f('0x31')]['fields']));_0x20853c['attributes']=_0x20853c[_0xc54f('0x35')][_0xc54f('0x37')]?_0x20853c[_0xc54f('0x35')]:_0x33f5c4[_0xc54f('0x30')];if(!_0x5253ae[_0xc54f('0x31')][_0xc54f('0x38')]('nolimit')){_0x20853c['limit']=qs[_0xc54f('0x1c')](_0x5253ae[_0xc54f('0x31')][_0xc54f('0x1c')]);_0x20853c[_0xc54f('0x1b')]=qs['offset'](_0x5253ae[_0xc54f('0x31')][_0xc54f('0x1b')]);}_0x20853c[_0xc54f('0x39')]=qs[_0xc54f('0x3a')](_0x5253ae[_0xc54f('0x31')][_0xc54f('0x3a')]);_0x20853c[_0xc54f('0x3d')]=qs[_0xc54f('0x33')](_[_0xc54f('0x3b')](_0x5253ae[_0xc54f('0x31')],_0x33f5c4['filters']));_0x20853c[_0xc54f('0x3d')][_0xc54f('0x57')]=_0x216f82['id'];if(_0x5253ae[_0xc54f('0x31')]['filter']){_0x20853c[_0xc54f('0x3d')]=_[_0xc54f('0x40')](_0x20853c[_0xc54f('0x3d')],{'$or':_[_0xc54f('0x3e')](_0x20853c[_0xc54f('0x35')],function(_0x1bdbfa){var _0x2623c7={};_0x2623c7[_0x1bdbfa]={'$like':'%'+_0x5253ae[_0xc54f('0x31')][_0xc54f('0x3c')]+'%'};return _0x2623c7;})});}_0x20853c=_['merge']({},_0x20853c,_0x5253ae[_0xc54f('0x41')]);return db[_0xc54f('0x5b')]['count']({'where':_0x20853c[_0xc54f('0x3d')]})[_0xc54f('0x23')](function(_0x1e7b3f){_0x2c24c6['count']=_0x1e7b3f;if(_0x5253ae[_0xc54f('0x31')][_0xc54f('0x42')]){_0x20853c[_0xc54f('0x45')]=[{'all':!![]}];}return db[_0xc54f('0x5b')]['findAll'](_0x20853c);})[_0xc54f('0x23')](function(_0x5e706a){_0x2c24c6[_0xc54f('0x59')]=_0x5e706a;return _0x2c24c6;});}})[_0xc54f('0x23')](respondWithFilteredResult(_0x19756b,_0x20853c))[_0xc54f('0x44')](handleError(_0x19756b,null));};function char(_0x2bd951){return _0xc54f('0x5c')===typeof _0x2bd951?String[_0xc54f('0x5d')][_0xc54f('0x20')](null,arguments):_0x2bd951;}function needsEncapsulation(_0x452953){return!!_0x452953&&(_0x452953[_0xc54f('0x5e')]()[_0xc54f('0x5f')](char(0xd))>=0x0||_0x452953[_0xc54f('0x5e')]()['indexOf'](char(0xa))>=0x0||_0x452953[_0xc54f('0x5e')]()[_0xc54f('0x5f')](char(0x2c))>=0x0||_0x452953[_0xc54f('0x5e')]()[_0xc54f('0x5f')](char(0x22))>=0x0);}function encapsulate(_0x93f824){var _0x260818=char(0x22),_0x8a7ec7='\x5c'+char(0x22),_0x212356=_0x93f824['toString']()['replace'](new RegExp(_0x260818,'g'),_0x8a7ec7);return _0x260818+_0x212356+_0x260818;}exports[_0xc54f('0x60')]=function(_0x30c1ae,_0x3e4c3e,_0x253632){var _0x484cc9,_0x26add2;var _0x566cc4={'where':{'ProjectId':_0x30c1ae[_0xc54f('0x54')]['id']}};if(_0x30c1ae[_0xc54f('0x31')]['startTime']){_0x566cc4[_0xc54f('0x3d')][_0xc54f('0x61')]=JSON[_0xc54f('0x62')](_0x30c1ae[_0xc54f('0x31')][_0xc54f('0x63')]);}return db[_0xc54f('0x58')][_0xc54f('0x43')](_0x566cc4)[_0xc54f('0x23')](handleEntityNotFound(_0x3e4c3e,null))[_0xc54f('0x23')](function(_0xa11573){if(_0xa11573){_0x484cc9=_0xa11573;return db[_0xc54f('0x64')]['findAll']({'where':{'SessionId':{'$in':_['map'](_0x484cc9,'id')},'ProjectId':_0x30c1ae[_0xc54f('0x54')]['id']},'order':_0xc54f('0x65')});}})[_0xc54f('0x23')](handleEntityNotFound(_0x3e4c3e,null))['then'](function(_0x3eedba){if(_0x3eedba){_0x26add2=_0x3eedba;var _0x58389a={};for(var _0x2a3d7b=0x0,_0x2bdf19=_0x26add2[_0xc54f('0x37')];_0x2a3d7b<_0x2bdf19;_0x2a3d7b++){if(!_0x58389a[_0xc54f('0x38')](_0x26add2[_0x2a3d7b][_0xc54f('0x66')])){_0x58389a[_0x26add2[_0x2a3d7b]['questionId']]=needsEncapsulation(_0x26add2[_0x2a3d7b][_0xc54f('0x67')])?encapsulate(_0x26add2[_0x2a3d7b]['question']):_0x26add2[_0x2a3d7b][_0xc54f('0x67')];}}var _0x3682fe=[],_0x33b622={};for(var _0x2c13d0=0x0,_0x43252a=_0x484cc9[_0xc54f('0x37')];_0x2c13d0<_0x43252a;_0x2c13d0++){_0x33b622={'ProjectId':_0x30c1ae[_0xc54f('0x54')]['id'],'SessionId':_0x484cc9[_0x2c13d0]['id'],'StartTime':moment(_0x484cc9[_0x2c13d0][_0xc54f('0x61')])[_0xc54f('0x68')](_0xc54f('0x69'))};for(var _0x38f7af=0x0,_0x5dd8af=_0x26add2[_0xc54f('0x37')];_0x38f7af<_0x5dd8af;_0x38f7af++){if(_0x26add2[_0x38f7af][_0xc54f('0x6a')]==_0x484cc9[_0x2c13d0]['id']&&_0x58389a[_0xc54f('0x38')](_0x26add2[_0x38f7af][_0xc54f('0x66')])){_0x33b622[_0x58389a[_0x26add2[_0x38f7af][_0xc54f('0x66')]]]=_0x26add2[_0x38f7af][_0xc54f('0x6b')];}}for(var _0x39e86c in _0x58389a){if(!_0x33b622['hasOwnProperty'](_0x58389a[_0x39e86c])){_0x33b622[_0x58389a[_0x39e86c]]=null;}}_0x3682fe[_0xc54f('0x6c')](_0x33b622);}return _0x3682fe;}})['then'](function(_0x7680c2){if(!_['isEmpty'](_0x7680c2)){var _0x582dcd=toCsv(_0x7680c2);var _0x36a7a0=Date['now']();fs[_0xc54f('0x6d')](util['format'](_0xc54f('0x6e'),_0x30c1ae[_0xc54f('0x54')]['id'],_0x36a7a0),_0x582dcd);_0x3e4c3e[_0xc54f('0x6f')]('Content-disposition',_0xc54f('0x70')+util['format']('Jscripty_Project_%d_Summary_%s.csv',_0x30c1ae[_0xc54f('0x54')]['id'],_0x36a7a0));_0x3e4c3e[_0xc54f('0x6f')](_0xc54f('0x71'),_0xc54f('0x72'));return _0x3e4c3e['download'](util[_0xc54f('0x68')](_0xc54f('0x6e'),_0x30c1ae['params']['id'],_0x36a7a0));}else{return _0x3e4c3e[_0xc54f('0x18')](0xcc);}})[_0xc54f('0x44')](handleError(_0x3e4c3e,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 680465b..294e3df 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 _0x4e82=['request-promise','path','rimraf','../../config/environment','./jscriptyProject.attributes','exports','define','jscripty_projects','lodash','util','api','bluebird'];(function(_0x330feb,_0x299e22){var _0x53756b=function(_0x1b5a94){while(--_0x1b5a94){_0x330feb['push'](_0x330feb['shift']());}};_0x53756b(++_0x299e22);}(_0x4e82,0x17c));var _0x24e8=function(_0x124a00,_0x5061b8){_0x124a00=_0x124a00-0x0;var _0x2bffff=_0x4e82[_0x124a00];return _0x2bffff;};'use strict';var _=require(_0x24e8('0x0'));var util=require(_0x24e8('0x1'));var logger=require('../../config/logger')(_0x24e8('0x2'));var moment=require('moment');var BPromise=require(_0x24e8('0x3'));var rp=require(_0x24e8('0x4'));var fs=require('fs');var path=require(_0x24e8('0x5'));var rimraf=require(_0x24e8('0x6'));var config=require(_0x24e8('0x7'));var attributes=require(_0x24e8('0x8'));module[_0x24e8('0x9')]=function(_0x3419e7,_0x3be9c3){return _0x3419e7[_0x24e8('0xa')]('JscriptyProject',attributes,{'tableName':_0x24e8('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd129=['exports','jscripty_projects','lodash','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x20e702,_0x37eafd){var _0x4cd3a0=function(_0x90105a){while(--_0x90105a){_0x20e702['push'](_0x20e702['shift']());}};_0x4cd3a0(++_0x37eafd);}(_0xd129,0x134));var _0x9d12=function(_0x4cb444,_0x2c9c2a){_0x4cb444=_0x4cb444-0x0;var _0x1ffc7e=_0xd129[_0x4cb444];return _0x1ffc7e;};'use strict';var _=require(_0x9d12('0x0'));var util=require('util');var logger=require(_0x9d12('0x1'))(_0x9d12('0x2'));var moment=require(_0x9d12('0x3'));var BPromise=require(_0x9d12('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9d12('0x5'));var rimraf=require(_0x9d12('0x6'));var config=require('../../config/environment');var attributes=require('./jscriptyProject.attributes');module[_0x9d12('0x7')]=function(_0x44df39,_0x4ce38c){return _0x44df39['define']('JscriptyProject',attributes,{'tableName':_0x9d12('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 2a99b88..1d19d99 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 _0x314d=['request','then','info','JscriptyProject,\x20%s,\x20%s','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x20c9b2,_0x55d7b1){var _0x2c6030=function(_0x10845f){while(--_0x10845f){_0x20c9b2['push'](_0x20c9b2['shift']());}};_0x2c6030(++_0x55d7b1);}(_0x314d,0x71));var _0xd314=function(_0x40cec8,_0x39edb4){_0x40cec8=_0x40cec8-0x0;var _0x3be939=_0x314d[_0x40cec8];return _0x3be939;};'use strict';var _=require('lodash');var util=require(_0xd314('0x0'));var moment=require(_0xd314('0x1'));var BPromise=require(_0xd314('0x2'));var rs=require(_0xd314('0x3'));var fs=require('fs');var Redis=require(_0xd314('0x4'));var db=require(_0xd314('0x5'))['db'];var utils=require(_0xd314('0x6'));var logger=require('../../config/logger')(_0xd314('0x7'));var config=require(_0xd314('0x8'));var jayson=require(_0xd314('0x9'));var client=jayson[_0xd314('0xa')][_0xd314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bc69f,_0x211320,_0x1c424c){return new BPromise(function(_0x22eeb5,_0x152a78){return client[_0xd314('0xc')](_0x1bc69f,_0x1c424c)[_0xd314('0xd')](function(_0x4884cb){logger[_0xd314('0xe')](_0xd314('0xf'),_0x211320,_0xd314('0x10'));logger[_0xd314('0x11')](_0xd314('0x12'),_0x211320,'request\x20sent',JSON[_0xd314('0x13')](_0x4884cb));if(_0x4884cb[_0xd314('0x14')]){if(_0x4884cb['error'][_0xd314('0x15')]===0x1f4){logger['error'](_0xd314('0xf'),_0x211320,_0x4884cb[_0xd314('0x14')]['message']);return _0x152a78(_0x4884cb[_0xd314('0x14')][_0xd314('0x16')]);}logger[_0xd314('0x14')](_0xd314('0xf'),_0x211320,_0x4884cb['error'][_0xd314('0x16')]);return _0x22eeb5(_0x4884cb['error'][_0xd314('0x16')]);}else{logger[_0xd314('0xe')](_0xd314('0xf'),_0x211320,'request\x20sent');_0x22eeb5(_0x4884cb[_0xd314('0x17')][_0xd314('0x16')]);}})[_0xd314('0x18')](function(_0x5d9511){logger['error'](_0xd314('0xf'),_0x211320,_0x5d9511);_0x152a78(_0x5d9511);});});} \ No newline at end of file +var _0x0770=['code','message','request\x20sent','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','JscriptyProject,\x20%s,\x20%s','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x0770,0x1e3));var _0x0077=function(_0x3e844c,_0x188bc2){_0x3e844c=_0x3e844c-0x0;var _0x4e7c8a=_0x0770[_0x3e844c];return _0x4e7c8a;};'use strict';var _=require(_0x0077('0x0'));var util=require(_0x0077('0x1'));var moment=require(_0x0077('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0077('0x3'));var db=require(_0x0077('0x4'))['db'];var utils=require(_0x0077('0x5'));var logger=require(_0x0077('0x6'))('rpc');var config=require(_0x0077('0x7'));var jayson=require(_0x0077('0x8'));var client=jayson[_0x0077('0x9')][_0x0077('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5dfec7,_0x28ffee,_0x340373){return new BPromise(function(_0x1509ad,_0x380800){return client[_0x0077('0xb')](_0x5dfec7,_0x340373)['then'](function(_0xf7195d){logger[_0x0077('0xc')](_0x0077('0xd'),_0x28ffee,'request\x20sent');logger['debug'](_0x0077('0xe'),_0x28ffee,'request\x20sent',JSON[_0x0077('0xf')](_0xf7195d));if(_0xf7195d[_0x0077('0x10')]){if(_0xf7195d['error'][_0x0077('0x11')]===0x1f4){logger['error'](_0x0077('0xd'),_0x28ffee,_0xf7195d[_0x0077('0x10')]['message']);return _0x380800(_0xf7195d['error'][_0x0077('0x12')]);}logger['error']('JscriptyProject,\x20%s,\x20%s',_0x28ffee,_0xf7195d[_0x0077('0x10')][_0x0077('0x12')]);return _0x1509ad(_0xf7195d[_0x0077('0x10')][_0x0077('0x12')]);}else{logger['info'](_0x0077('0xd'),_0x28ffee,_0x0077('0x13'));_0x1509ad(_0xf7195d['result']['message']);}})['catch'](function(_0x30a1b5){logger[_0x0077('0x10')]('JscriptyProject,\x20%s,\x20%s',_0x28ffee,_0x30a1b5);_0x380800(_0x30a1b5);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index c04a863..1ac8d67 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 _0xf7f4=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','index','/describe','isAuthenticated','describe','/:id','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x4bc039,_0x13003a){var _0x3f37fa=function(_0x279b3f){while(--_0x279b3f){_0x4bc039['push'](_0x4bc039['shift']());}};_0x3f37fa(++_0x13003a);}(_0xf7f4,0x78));var _0x4f7f=function(_0x1970a2,_0x364f77){_0x1970a2=_0x1970a2-0x0;var _0x167294=_0xf7f4[_0x1970a2];return _0x167294;};'use strict';var multer=require(_0x4f7f('0x0'));var util=require(_0x4f7f('0x1'));var path=require(_0x4f7f('0x2'));var timeout=require(_0x4f7f('0x3'));var express=require(_0x4f7f('0x4'));var router=express[_0x4f7f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x4f7f('0x6'));var config=require(_0x4f7f('0x7'));var controller=require(_0x4f7f('0x8'));router[_0x4f7f('0x9')]('/',auth['isAuthenticated'](),controller[_0x4f7f('0xa')]);router['get'](_0x4f7f('0xb'),auth[_0x4f7f('0xc')](),controller[_0x4f7f('0xd')]);router[_0x4f7f('0x9')](_0x4f7f('0xe'),auth[_0x4f7f('0xc')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x4f7f('0xf')]);router[_0x4f7f('0x10')](_0x4f7f('0xe'),auth[_0x4f7f('0xc')](),controller[_0x4f7f('0x11')]);router[_0x4f7f('0x12')](_0x4f7f('0xe'),auth['isAuthenticated'](),controller[_0x4f7f('0x13')]);module[_0x4f7f('0x14')]=router; \ No newline at end of file +var _0x551b=['../../components/interaction/service','../../config/environment','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','/:id','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service'];(function(_0x563741,_0x201806){var _0x3832e6=function(_0x6f2cdc){while(--_0x6f2cdc){_0x563741['push'](_0x563741['shift']());}};_0x3832e6(++_0x201806);}(_0x551b,0x113));var _0xb551=function(_0x421196,_0x1cbd94){_0x421196=_0x421196-0x0;var _0x2738af=_0x551b[_0x421196];return _0x2738af;};'use strict';var multer=require(_0xb551('0x0'));var util=require('util');var path=require(_0xb551('0x1'));var timeout=require(_0xb551('0x2'));var express=require(_0xb551('0x3'));var router=express['Router']();var auth=require(_0xb551('0x4'));var interaction=require(_0xb551('0x5'));var config=require(_0xb551('0x6'));var controller=require(_0xb551('0x7'));router[_0xb551('0x8')]('/',auth[_0xb551('0x9')](),controller[_0xb551('0xa')]);router[_0xb551('0x8')](_0xb551('0xb'),auth['isAuthenticated'](),controller[_0xb551('0xc')]);router[_0xb551('0x8')](_0xb551('0xd'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xb551('0x9')](),controller[_0xb551('0xe')]);router[_0xb551('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb551('0x10')]);router[_0xb551('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xb551('0x12')]);module[_0xb551('0x13')]=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index bcfbf86..11f9606 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 _0xe76f=['long','STRING'];(function(_0x2c3514,_0x5604d4){var _0x22ab07=function(_0x21acce){while(--_0x21acce){_0x2c3514['push'](_0x2c3514['shift']());}};_0x22ab07(++_0x5604d4);}(_0xe76f,0xcd));var _0xfe76=function(_0x2dadb9,_0x42cfe6){_0x2dadb9=_0x2dadb9-0x0;var _0x2f0097=_0xe76f[_0x2dadb9];return _0x2f0097;};'use strict';var Sequelize=require('sequelize');module['exports']={'question':{'type':Sequelize[_0xfe76('0x0')]},'answer':{'type':Sequelize['TEXT'](_0xfe76('0x1'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0xfe76('0x0')]},'queue':{'type':Sequelize[_0xfe76('0x0')]},'uniqueid':{'type':Sequelize[_0xfe76('0x0')]},'calleridname':{'type':Sequelize[_0xfe76('0x0')]},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x33f9=['STRING','TEXT','sequelize'];(function(_0x2e4e19,_0x493b50){var _0x9ba20b=function(_0x2f6456){while(--_0x2f6456){_0x2e4e19['push'](_0x2e4e19['shift']());}};_0x9ba20b(++_0x493b50);}(_0x33f9,0x19d));var _0x933f=function(_0x3d058d,_0x50d354){_0x3d058d=_0x3d058d-0x0;var _0x37b466=_0x33f9[_0x3d058d];return _0x37b466;};'use strict';var Sequelize=require(_0x933f('0x0'));module['exports']={'question':{'type':Sequelize[_0x933f('0x1')]},'answer':{'type':Sequelize[_0x933f('0x2')]('long')},'membername':{'type':Sequelize[_0x933f('0x1')]},'projectname':{'type':Sequelize[_0x933f('0x1')]},'queue':{'type':Sequelize[_0x933f('0x1')]},'uniqueid':{'type':Sequelize[_0x933f('0x1')]},'calleridname':{'type':Sequelize[_0x933f('0x1')]},'calleridnum':{'type':Sequelize[_0x933f('0x1')]},'questionId':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 522abce..2273bdd 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 _0x2f98=['filters','attributes','intersection','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','fields','includeAll','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','to-csv','ejs','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','fieldName','type','key','model','query'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2f98,0x186));var _0x82f9=function(_0x9699a2,_0x379958){_0x9699a2=_0x9699a2-0x0;var _0x498a81=_0x2f98[_0x9699a2];return _0x498a81;};'use strict';var pdf=require(_0x82f9('0x0'));var emlformat=require(_0x82f9('0x1'));var rimraf=require(_0x82f9('0x2'));var zipdir=require(_0x82f9('0x3'));var jsonpatch=require(_0x82f9('0x4'));var rp=require('request-promise');var moment=require(_0x82f9('0x5'));var BPromise=require(_0x82f9('0x6'));var Mustache=require(_0x82f9('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x82f9('0x8'));var ejs=require(_0x82f9('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x82f9('0xa'));var deskjs=require(_0x82f9('0xb'));var toCsv=require('to-csv');var querystring=require(_0x82f9('0xc'));var Papa=require(_0x82f9('0xd'));var Redis=require('ioredis');var authService=require(_0x82f9('0xe'));var qs=require(_0x82f9('0xf'));var as=require(_0x82f9('0x10'));var hardwareService=require(_0x82f9('0x11'));var logger=require(_0x82f9('0x12'))(_0x82f9('0x13'));var utils=require(_0x82f9('0x14'));var config=require(_0x82f9('0x15'));var db=require(_0x82f9('0x16'))['db'];function respondWithStatusCode(_0x5d4dfd,_0x314319){_0x314319=_0x314319||0xcc;return function(_0x1dc5b7){if(_0x1dc5b7){return _0x5d4dfd[_0x82f9('0x17')](_0x314319);}return _0x5d4dfd['status'](_0x314319)[_0x82f9('0x18')]();};}function respondWithResult(_0x3961fb,_0x2230cd){_0x2230cd=_0x2230cd||0xc8;return function(_0x3552b6){if(_0x3552b6){return _0x3961fb[_0x82f9('0x19')](_0x2230cd)[_0x82f9('0x1a')](_0x3552b6);}};}function respondWithFilteredResult(_0x2f2547,_0x37d668){return function(_0x40ebea){if(_0x40ebea){var _0x1f4373=_0x40ebea[_0x82f9('0x1b')],_0xc7673d=_0x37d668[_0x82f9('0x1c')],_0x500add=_0x37d668[_0x82f9('0x1c')]+_0x37d668[_0x82f9('0x1d')],_0x4d4fda;if(_0x500add>=_0x1f4373){_0x500add=_0x1f4373;_0x4d4fda=0xc8;}else{_0x4d4fda=0xce;}_0x2f2547[_0x82f9('0x19')](_0x4d4fda);return _0x2f2547['set'](_0x82f9('0x1e'),_0xc7673d+'-'+_0x500add+'/'+_0x1f4373)[_0x82f9('0x1a')](_0x40ebea);}return null;};}function patchUpdates(_0x2d047b){return function(_0x53a815){try{jsonpatch['apply'](_0x53a815,_0x2d047b,!![]);}catch(_0x3285b5){return BPromise[_0x82f9('0x1f')](_0x3285b5);}return _0x53a815[_0x82f9('0x20')]();};}function saveUpdates(_0x23e4f0,_0x4f6aab){return function(_0x40d499){if(_0x40d499){return _0x40d499[_0x82f9('0x21')](_0x23e4f0)[_0x82f9('0x22')](function(_0x9e64ba){return _0x9e64ba;});}return null;};}function removeEntity(_0x4115cb,_0x1afde9){return function(_0x2843d6){if(_0x2843d6){return _0x2843d6[_0x82f9('0x23')]()[_0x82f9('0x22')](function(){_0x4115cb[_0x82f9('0x19')](0xcc)[_0x82f9('0x18')]();});}};}function handleEntityNotFound(_0x244ca7,_0x1e5e15){return function(_0x23e218){if(!_0x23e218){_0x244ca7[_0x82f9('0x17')](0x194);}return _0x23e218;};}function handleError(_0x3018bd,_0x1c1965){_0x1c1965=_0x1c1965||0x1f4;return function(_0x2ab3ff){logger[_0x82f9('0x24')](_0x2ab3ff[_0x82f9('0x25')]);if(_0x2ab3ff[_0x82f9('0x26')]){delete _0x2ab3ff['name'];}_0x3018bd['status'](_0x1c1965)['send'](_0x2ab3ff);};}exports[_0x82f9('0x27')]=function(_0x1a3a48,_0xbeabe){var _0x5943c7={},_0x49a621={},_0x4066a8={'count':0x0,'rows':[]};var _0x107a29=_[_0x82f9('0x28')](db[_0x82f9('0x29')][_0x82f9('0x2a')],function(_0x30c496){return{'name':_0x30c496[_0x82f9('0x2b')],'type':_0x30c496[_0x82f9('0x2c')][_0x82f9('0x2d')]};});_0x49a621[_0x82f9('0x2e')]=_[_0x82f9('0x28')](_0x107a29,_0x82f9('0x26'));_0x49a621[_0x82f9('0x2f')]=_['keys'](_0x1a3a48[_0x82f9('0x2f')]);_0x49a621[_0x82f9('0x30')]=_['intersection'](_0x49a621[_0x82f9('0x2e')],_0x49a621[_0x82f9('0x2f')]);_0x5943c7[_0x82f9('0x31')]=_[_0x82f9('0x32')](_0x49a621[_0x82f9('0x2e')],qs['fields'](_0x1a3a48[_0x82f9('0x2f')]['fields']));_0x5943c7['attributes']=_0x5943c7['attributes'][_0x82f9('0x33')]?_0x5943c7[_0x82f9('0x31')]:_0x49a621[_0x82f9('0x2e')];if(!_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x34')]('nolimit')){_0x5943c7['limit']=qs[_0x82f9('0x1d')](_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x1d')]);_0x5943c7[_0x82f9('0x1c')]=qs[_0x82f9('0x1c')](_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x1c')]);}_0x5943c7[_0x82f9('0x35')]=qs[_0x82f9('0x36')](_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x36')]);_0x5943c7[_0x82f9('0x37')]=qs[_0x82f9('0x30')](_[_0x82f9('0x38')](_0x1a3a48['query'],_0x49a621['filters']));if(_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x39')]){_0x5943c7[_0x82f9('0x37')]=_[_0x82f9('0x3a')](_0x5943c7['where'],{'$or':_[_0x82f9('0x28')](_0x107a29,function(_0x496c95){if(_0x496c95[_0x82f9('0x2c')]!==_0x82f9('0x3b')){var _0x458982={};_0x458982[_0x496c95[_0x82f9('0x26')]]={'$like':'%'+_0x1a3a48[_0x82f9('0x2f')][_0x82f9('0x39')]+'%'};return _0x458982;}})});}_0x5943c7=_[_0x82f9('0x3a')]({},_0x5943c7,_0x1a3a48[_0x82f9('0x3c')]);var _0xa9651={'where':_0x5943c7[_0x82f9('0x37')]};return db[_0x82f9('0x29')][_0x82f9('0x1b')](_0xa9651)[_0x82f9('0x22')](function(_0x4b08b2){_0x4066a8[_0x82f9('0x1b')]=_0x4b08b2;if(_0x1a3a48[_0x82f9('0x2f')]['includeAll']){_0x5943c7[_0x82f9('0x3d')]=[{'all':!![]}];}return db[_0x82f9('0x29')][_0x82f9('0x3e')](_0x5943c7);})[_0x82f9('0x22')](function(_0x27d408){_0x4066a8[_0x82f9('0x3f')]=_0x27d408;return _0x4066a8;})[_0x82f9('0x22')](respondWithFilteredResult(_0xbeabe,_0x5943c7))['catch'](handleError(_0xbeabe,null));};exports[_0x82f9('0x40')]=function(_0x4ddf5c,_0x92bbd3){var _0x4b8919={'raw':!![],'where':{'id':_0x4ddf5c[_0x82f9('0x41')]['id']}},_0x1fe75c={};_0x1fe75c[_0x82f9('0x2e')]=_[_0x82f9('0x42')](db[_0x82f9('0x29')][_0x82f9('0x2a')]);_0x1fe75c[_0x82f9('0x2f')]=_[_0x82f9('0x42')](_0x4ddf5c[_0x82f9('0x2f')]);_0x1fe75c['filters']=_[_0x82f9('0x32')](_0x1fe75c['model'],_0x1fe75c['query']);_0x4b8919[_0x82f9('0x31')]=_[_0x82f9('0x32')](_0x1fe75c[_0x82f9('0x2e')],qs[_0x82f9('0x43')](_0x4ddf5c['query'][_0x82f9('0x43')]));_0x4b8919[_0x82f9('0x31')]=_0x4b8919['attributes'][_0x82f9('0x33')]?_0x4b8919[_0x82f9('0x31')]:_0x1fe75c['model'];if(_0x4ddf5c[_0x82f9('0x2f')][_0x82f9('0x44')]){_0x4b8919['include']=[{'all':!![]}];}_0x4b8919=_['merge']({},_0x4b8919,_0x4ddf5c[_0x82f9('0x3c')]);return db[_0x82f9('0x29')]['find'](_0x4b8919)['then'](handleEntityNotFound(_0x92bbd3,null))['then'](respondWithResult(_0x92bbd3,null))[_0x82f9('0x45')](handleError(_0x92bbd3,null));};exports[_0x82f9('0x46')]=function(_0xbe8091,_0x3296d5){return db[_0x82f9('0x29')]['create'](_0xbe8091[_0x82f9('0x47')],{})[_0x82f9('0x22')](respondWithResult(_0x3296d5,0xc9))[_0x82f9('0x45')](handleError(_0x3296d5,null));};exports[_0x82f9('0x21')]=function(_0x1155ef,_0xb6e2a4){if(_0x1155ef[_0x82f9('0x47')]['id']){delete _0x1155ef[_0x82f9('0x47')]['id'];}return db[_0x82f9('0x29')]['find']({'where':{'id':_0x1155ef['params']['id']}})[_0x82f9('0x22')](handleEntityNotFound(_0xb6e2a4,null))[_0x82f9('0x22')](saveUpdates(_0x1155ef[_0x82f9('0x47')],null))[_0x82f9('0x22')](respondWithResult(_0xb6e2a4,null))['catch'](handleError(_0xb6e2a4,null));};exports[_0x82f9('0x23')]=function(_0x40d739,_0x30285c){return db[_0x82f9('0x29')]['find']({'where':{'id':_0x40d739[_0x82f9('0x41')]['id']}})[_0x82f9('0x22')](handleEntityNotFound(_0x30285c,null))[_0x82f9('0x22')](removeEntity(_0x30285c,null))[_0x82f9('0x45')](handleError(_0x30285c,null));};exports[_0x82f9('0x48')]=function(_0x3ee264,_0x5576ab){return db[_0x82f9('0x29')][_0x82f9('0x48')]()[_0x82f9('0x22')](respondWithResult(_0x5576ab,null))[_0x82f9('0x45')](handleError(_0x5576ab,null));}; \ No newline at end of file +var _0x8cdb=['querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','Content-Range','save','update','then','error','stack','name','index','map','JscriptyQuestionReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','destroy','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv'];(function(_0x2961b7,_0x5abd93){var _0x5b07cb=function(_0x4535f4){while(--_0x4535f4){_0x2961b7['push'](_0x2961b7['shift']());}};_0x5b07cb(++_0x5abd93);}(_0x8cdb,0x111));var _0xb8cd=function(_0x35c1b6,_0x3a14af){_0x35c1b6=_0x35c1b6-0x0;var _0x461003=_0x8cdb[_0x35c1b6];return _0x461003;};'use strict';var pdf=require(_0xb8cd('0x0'));var emlformat=require(_0xb8cd('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb8cd('0x2'));var jsonpatch=require(_0xb8cd('0x3'));var rp=require(_0xb8cd('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xb8cd('0x5'));var path=require(_0xb8cd('0x6'));var sox=require(_0xb8cd('0x7'));var csv=require('to-csv');var ejs=require(_0xb8cd('0x8'));var fs=require('fs');var _=require(_0xb8cd('0x9'));var squel=require(_0xb8cd('0xa'));var crypto=require(_0xb8cd('0xb'));var jsforce=require(_0xb8cd('0xc'));var deskjs=require(_0xb8cd('0xd'));var toCsv=require(_0xb8cd('0xe'));var querystring=require(_0xb8cd('0xf'));var Papa=require(_0xb8cd('0x10'));var Redis=require(_0xb8cd('0x11'));var authService=require(_0xb8cd('0x12'));var qs=require(_0xb8cd('0x13'));var as=require(_0xb8cd('0x14'));var hardwareService=require(_0xb8cd('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0xb8cd('0x16'));var config=require(_0xb8cd('0x17'));var db=require(_0xb8cd('0x18'))['db'];function respondWithStatusCode(_0x4b1fba,_0x578624){_0x578624=_0x578624||0xcc;return function(_0x3ee42f){if(_0x3ee42f){return _0x4b1fba[_0xb8cd('0x19')](_0x578624);}return _0x4b1fba[_0xb8cd('0x1a')](_0x578624)[_0xb8cd('0x1b')]();};}function respondWithResult(_0x112387,_0x5362fa){_0x5362fa=_0x5362fa||0xc8;return function(_0x18e68c){if(_0x18e68c){return _0x112387['status'](_0x5362fa)[_0xb8cd('0x1c')](_0x18e68c);}};}function respondWithFilteredResult(_0x384c82,_0x591e06){return function(_0x484c48){if(_0x484c48){var _0x402d82=_0x484c48[_0xb8cd('0x1d')],_0x4ab71e=_0x591e06['offset'],_0x225b2b=_0x591e06['offset']+_0x591e06[_0xb8cd('0x1e')],_0x3d47c6;if(_0x225b2b>=_0x402d82){_0x225b2b=_0x402d82;_0x3d47c6=0xc8;}else{_0x3d47c6=0xce;}_0x384c82[_0xb8cd('0x1a')](_0x3d47c6);return _0x384c82[_0xb8cd('0x1f')](_0xb8cd('0x20'),_0x4ab71e+'-'+_0x225b2b+'/'+_0x402d82)[_0xb8cd('0x1c')](_0x484c48);}return null;};}function patchUpdates(_0x23de70){return function(_0x5c8f83){try{jsonpatch['apply'](_0x5c8f83,_0x23de70,!![]);}catch(_0x29135a){return BPromise['reject'](_0x29135a);}return _0x5c8f83[_0xb8cd('0x21')]();};}function saveUpdates(_0x3add1d,_0x135d75){return function(_0x452b02){if(_0x452b02){return _0x452b02[_0xb8cd('0x22')](_0x3add1d)[_0xb8cd('0x23')](function(_0x567bd6){return _0x567bd6;});}return null;};}function removeEntity(_0x14b168,_0x2d8c3a){return function(_0x7c1777){if(_0x7c1777){return _0x7c1777['destroy']()[_0xb8cd('0x23')](function(){_0x14b168[_0xb8cd('0x1a')](0xcc)[_0xb8cd('0x1b')]();});}};}function handleEntityNotFound(_0x2e7955,_0x21382b){return function(_0xc9ee4e){if(!_0xc9ee4e){_0x2e7955[_0xb8cd('0x19')](0x194);}return _0xc9ee4e;};}function handleError(_0x251075,_0x3255a1){_0x3255a1=_0x3255a1||0x1f4;return function(_0x3b1433){logger[_0xb8cd('0x24')](_0x3b1433[_0xb8cd('0x25')]);if(_0x3b1433[_0xb8cd('0x26')]){delete _0x3b1433[_0xb8cd('0x26')];}_0x251075[_0xb8cd('0x1a')](_0x3255a1)['send'](_0x3b1433);};}exports[_0xb8cd('0x27')]=function(_0x4cb1da,_0x3e206a){var _0x3967ec={},_0x1509d9={},_0x1659dd={'count':0x0,'rows':[]};var _0x3a6474=_[_0xb8cd('0x28')](db[_0xb8cd('0x29')][_0xb8cd('0x2a')],function(_0x2f0e80){return{'name':_0x2f0e80['fieldName'],'type':_0x2f0e80['type']['key']};});_0x1509d9[_0xb8cd('0x2b')]=_[_0xb8cd('0x28')](_0x3a6474,_0xb8cd('0x26'));_0x1509d9[_0xb8cd('0x2c')]=_[_0xb8cd('0x2d')](_0x4cb1da[_0xb8cd('0x2c')]);_0x1509d9[_0xb8cd('0x2e')]=_[_0xb8cd('0x2f')](_0x1509d9['model'],_0x1509d9['query']);_0x3967ec[_0xb8cd('0x30')]=_[_0xb8cd('0x2f')](_0x1509d9['model'],qs[_0xb8cd('0x31')](_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x31')]));_0x3967ec['attributes']=_0x3967ec['attributes']['length']?_0x3967ec[_0xb8cd('0x30')]:_0x1509d9[_0xb8cd('0x2b')];if(!_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x32')](_0xb8cd('0x33'))){_0x3967ec[_0xb8cd('0x1e')]=qs[_0xb8cd('0x1e')](_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x1e')]);_0x3967ec[_0xb8cd('0x34')]=qs[_0xb8cd('0x34')](_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x34')]);}_0x3967ec[_0xb8cd('0x35')]=qs[_0xb8cd('0x36')](_0x4cb1da['query'][_0xb8cd('0x36')]);_0x3967ec[_0xb8cd('0x37')]=qs[_0xb8cd('0x2e')](_[_0xb8cd('0x38')](_0x4cb1da['query'],_0x1509d9[_0xb8cd('0x2e')]));if(_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x39')]){_0x3967ec[_0xb8cd('0x37')]=_[_0xb8cd('0x3a')](_0x3967ec[_0xb8cd('0x37')],{'$or':_[_0xb8cd('0x28')](_0x3a6474,function(_0x4447f5){if(_0x4447f5['type']!==_0xb8cd('0x3b')){var _0xae4e34={};_0xae4e34[_0x4447f5[_0xb8cd('0x26')]]={'$like':'%'+_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x39')]+'%'};return _0xae4e34;}})});}_0x3967ec=_[_0xb8cd('0x3a')]({},_0x3967ec,_0x4cb1da['options']);var _0x2c862d={'where':_0x3967ec[_0xb8cd('0x37')]};return db[_0xb8cd('0x29')][_0xb8cd('0x1d')](_0x2c862d)['then'](function(_0x43d34f){_0x1659dd['count']=_0x43d34f;if(_0x4cb1da[_0xb8cd('0x2c')][_0xb8cd('0x3c')]){_0x3967ec['include']=[{'all':!![]}];}return db[_0xb8cd('0x29')][_0xb8cd('0x3d')](_0x3967ec);})[_0xb8cd('0x23')](function(_0x140264){_0x1659dd[_0xb8cd('0x3e')]=_0x140264;return _0x1659dd;})['then'](respondWithFilteredResult(_0x3e206a,_0x3967ec))[_0xb8cd('0x3f')](handleError(_0x3e206a,null));};exports[_0xb8cd('0x40')]=function(_0x5603fc,_0x17a448){var _0x3c2637={'raw':!![],'where':{'id':_0x5603fc[_0xb8cd('0x41')]['id']}},_0x271b5b={};_0x271b5b[_0xb8cd('0x2b')]=_[_0xb8cd('0x2d')](db[_0xb8cd('0x29')][_0xb8cd('0x2a')]);_0x271b5b[_0xb8cd('0x2c')]=_[_0xb8cd('0x2d')](_0x5603fc[_0xb8cd('0x2c')]);_0x271b5b['filters']=_[_0xb8cd('0x2f')](_0x271b5b[_0xb8cd('0x2b')],_0x271b5b['query']);_0x3c2637[_0xb8cd('0x30')]=_['intersection'](_0x271b5b['model'],qs['fields'](_0x5603fc[_0xb8cd('0x2c')][_0xb8cd('0x31')]));_0x3c2637[_0xb8cd('0x30')]=_0x3c2637[_0xb8cd('0x30')]['length']?_0x3c2637[_0xb8cd('0x30')]:_0x271b5b[_0xb8cd('0x2b')];if(_0x5603fc['query'][_0xb8cd('0x3c')]){_0x3c2637['include']=[{'all':!![]}];}_0x3c2637=_[_0xb8cd('0x3a')]({},_0x3c2637,_0x5603fc[_0xb8cd('0x42')]);return db[_0xb8cd('0x29')][_0xb8cd('0x43')](_0x3c2637)[_0xb8cd('0x23')](handleEntityNotFound(_0x17a448,null))[_0xb8cd('0x23')](respondWithResult(_0x17a448,null))[_0xb8cd('0x3f')](handleError(_0x17a448,null));};exports[_0xb8cd('0x44')]=function(_0x533717,_0x3a58aa){return db[_0xb8cd('0x29')][_0xb8cd('0x44')](_0x533717['body'],{})[_0xb8cd('0x23')](respondWithResult(_0x3a58aa,0xc9))['catch'](handleError(_0x3a58aa,null));};exports[_0xb8cd('0x22')]=function(_0x4671a4,_0x2ee6eb){if(_0x4671a4[_0xb8cd('0x45')]['id']){delete _0x4671a4[_0xb8cd('0x45')]['id'];}return db[_0xb8cd('0x29')][_0xb8cd('0x43')]({'where':{'id':_0x4671a4[_0xb8cd('0x41')]['id']}})[_0xb8cd('0x23')](handleEntityNotFound(_0x2ee6eb,null))[_0xb8cd('0x23')](saveUpdates(_0x4671a4[_0xb8cd('0x45')],null))['then'](respondWithResult(_0x2ee6eb,null))[_0xb8cd('0x3f')](handleError(_0x2ee6eb,null));};exports[_0xb8cd('0x46')]=function(_0x2a4a00,_0x21755c){return db[_0xb8cd('0x29')][_0xb8cd('0x43')]({'where':{'id':_0x2a4a00[_0xb8cd('0x41')]['id']}})[_0xb8cd('0x23')](handleEntityNotFound(_0x21755c,null))['then'](removeEntity(_0x21755c,null))[_0xb8cd('0x3f')](handleError(_0x21755c,null));};exports[_0xb8cd('0x47')]=function(_0x389a02,_0x59d218){return db[_0xb8cd('0x29')][_0xb8cd('0x47')]()[_0xb8cd('0x23')](respondWithResult(_0x59d218,null))[_0xb8cd('0x3f')](handleError(_0x59d218,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index 129a23d..f946b74 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 _0xb3d2=['util','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptyQuestionReport.attributes','define','JscriptyQuestionReport','report_jscripty_questions','lodash'];(function(_0x4d8ed9,_0x2ae284){var _0x1e2140=function(_0x9cca89){while(--_0x9cca89){_0x4d8ed9['push'](_0x4d8ed9['shift']());}};_0x1e2140(++_0x2ae284);}(_0xb3d2,0x167));var _0x2b3d=function(_0x51e43e,_0x506d55){_0x51e43e=_0x51e43e-0x0;var _0x210ef4=_0xb3d2[_0x51e43e];return _0x210ef4;};'use strict';var _=require(_0x2b3d('0x0'));var util=require(_0x2b3d('0x1'));var logger=require('../../config/logger')(_0x2b3d('0x2'));var moment=require(_0x2b3d('0x3'));var BPromise=require(_0x2b3d('0x4'));var rp=require(_0x2b3d('0x5'));var fs=require('fs');var path=require(_0x2b3d('0x6'));var rimraf=require('rimraf');var config=require(_0x2b3d('0x7'));var attributes=require(_0x2b3d('0x8'));module['exports']=function(_0x1afa8b,_0x3567bd){return _0x1afa8b[_0x2b3d('0x9')](_0x2b3d('0xa'),attributes,{'tableName':_0x2b3d('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1e01=['exports','define','report_jscripty_questions','util','api','moment','request-promise','rimraf','../../config/environment','./jscriptyQuestionReport.attributes'];(function(_0x303889,_0x57189c){var _0x15fc36=function(_0x4c78d3){while(--_0x4c78d3){_0x303889['push'](_0x303889['shift']());}};_0x15fc36(++_0x57189c);}(_0x1e01,0x189));var _0x11e0=function(_0x573640,_0x1fe9dd){_0x573640=_0x573640-0x0;var _0x95f0ca=_0x1e01[_0x573640];return _0x95f0ca;};'use strict';var _=require('lodash');var util=require(_0x11e0('0x0'));var logger=require('../../config/logger')(_0x11e0('0x1'));var moment=require(_0x11e0('0x2'));var BPromise=require('bluebird');var rp=require(_0x11e0('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x11e0('0x4'));var config=require(_0x11e0('0x5'));var attributes=require(_0x11e0('0x6'));module[_0x11e0('0x7')]=function(_0x234b16,_0x11359e){return _0x234b16[_0x11e0('0x8')]('JscriptyQuestionReport',attributes,{'tableName':_0x11e0('0x9'),'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 b9bbf09..cebe612 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 _0xe999=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x352faf,_0x7f002a){var _0x4ec757=function(_0x384610){while(--_0x384610){_0x352faf['push'](_0x352faf['shift']());}};_0x4ec757(++_0x7f002a);}(_0xe999,0xf6));var _0x9e99=function(_0x278ff9,_0x4dccde){_0x278ff9=_0x278ff9-0x0;var _0x2849f0=_0xe999[_0x278ff9];return _0x2849f0;};'use strict';var _=require(_0x9e99('0x0'));var util=require(_0x9e99('0x1'));var moment=require(_0x9e99('0x2'));var BPromise=require(_0x9e99('0x3'));var rs=require(_0x9e99('0x4'));var fs=require('fs');var Redis=require(_0x9e99('0x5'));var db=require(_0x9e99('0x6'))['db'];var utils=require(_0x9e99('0x7'));var logger=require(_0x9e99('0x8'))(_0x9e99('0x9'));var config=require(_0x9e99('0xa'));var jayson=require(_0x9e99('0xb'));var client=jayson[_0x9e99('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16d284,_0x59eadc,_0x1c6e53){return new BPromise(function(_0x44cf29,_0x1f6af3){return client['request'](_0x16d284,_0x1c6e53)[_0x9e99('0xd')](function(_0x3dad58){logger[_0x9e99('0xe')](_0x9e99('0xf'),_0x59eadc,_0x9e99('0x10'));logger[_0x9e99('0x11')](_0x9e99('0x12'),_0x59eadc,_0x9e99('0x10'),JSON[_0x9e99('0x13')](_0x3dad58));if(_0x3dad58[_0x9e99('0x14')]){if(_0x3dad58[_0x9e99('0x14')][_0x9e99('0x15')]===0x1f4){logger[_0x9e99('0x14')](_0x9e99('0xf'),_0x59eadc,_0x3dad58[_0x9e99('0x14')][_0x9e99('0x16')]);return _0x1f6af3(_0x3dad58['error'][_0x9e99('0x16')]);}logger[_0x9e99('0x14')](_0x9e99('0xf'),_0x59eadc,_0x3dad58[_0x9e99('0x14')][_0x9e99('0x16')]);return _0x44cf29(_0x3dad58['error'][_0x9e99('0x16')]);}else{logger['info'](_0x9e99('0xf'),_0x59eadc,_0x9e99('0x10'));_0x44cf29(_0x3dad58['result'][_0x9e99('0x16')]);}})['catch'](function(_0x7e54ba){logger[_0x9e99('0x14')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x59eadc,_0x7e54ba);_0x1f6af3(_0x7e54ba);});});} \ No newline at end of file +var _0xdb0b=['http','then','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x23b2cd,_0x3b894d){var _0x28aa68=function(_0x4f709c){while(--_0x4f709c){_0x23b2cd['push'](_0x23b2cd['shift']());}};_0x28aa68(++_0x3b894d);}(_0xdb0b,0x7f));var _0xbdb0=function(_0x27ccb7,_0x2a98b6){_0x27ccb7=_0x27ccb7-0x0;var _0x577e52=_0xdb0b[_0x27ccb7];return _0x577e52;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbdb0('0x0'));var BPromise=require(_0xbdb0('0x1'));var rs=require(_0xbdb0('0x2'));var fs=require('fs');var Redis=require(_0xbdb0('0x3'));var db=require(_0xbdb0('0x4'))['db'];var utils=require(_0xbdb0('0x5'));var logger=require(_0xbdb0('0x6'))(_0xbdb0('0x7'));var config=require(_0xbdb0('0x8'));var jayson=require(_0xbdb0('0x9'));var client=jayson[_0xbdb0('0xa')][_0xbdb0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x55ed8d,_0x485a0c,_0x5b9629){return new BPromise(function(_0x1d7d7a,_0x4ec236){return client['request'](_0x55ed8d,_0x5b9629)[_0xbdb0('0xc')](function(_0x11197e){logger['info'](_0xbdb0('0xd'),_0x485a0c,_0xbdb0('0xe'));logger[_0xbdb0('0xf')](_0xbdb0('0x10'),_0x485a0c,_0xbdb0('0xe'),JSON[_0xbdb0('0x11')](_0x11197e));if(_0x11197e[_0xbdb0('0x12')]){if(_0x11197e['error'][_0xbdb0('0x13')]===0x1f4){logger[_0xbdb0('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x485a0c,_0x11197e['error'][_0xbdb0('0x14')]);return _0x4ec236(_0x11197e[_0xbdb0('0x12')]['message']);}logger[_0xbdb0('0x12')]('JscriptyQuestionReport,\x20%s,\x20%s',_0x485a0c,_0x11197e[_0xbdb0('0x12')][_0xbdb0('0x14')]);return _0x1d7d7a(_0x11197e[_0xbdb0('0x12')]['message']);}else{logger[_0xbdb0('0x15')](_0xbdb0('0xd'),_0x485a0c,'request\x20sent');_0x1d7d7a(_0x11197e[_0xbdb0('0x16')][_0xbdb0('0x14')]);}})['catch'](function(_0xd24a97){logger[_0xbdb0('0x12')](_0xbdb0('0xd'),_0x485a0c,_0xd24a97);_0x4ec236(_0xd24a97);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index ee6d654..02adb96 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 _0x6658=['../../components/auth/service','../../components/interaction/service','./jscriptySessionReport.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/questions','getQuestions','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router'];(function(_0x5bd426,_0x4878e5){var _0x23a7eb=function(_0x594b42){while(--_0x594b42){_0x5bd426['push'](_0x5bd426['shift']());}};_0x23a7eb(++_0x4878e5);}(_0x6658,0x198));var _0x8665=function(_0xfa7a11,_0x12ae09){_0xfa7a11=_0xfa7a11-0x0;var _0x4cad1d=_0x6658[_0xfa7a11];return _0x4cad1d;};'use strict';var multer=require(_0x8665('0x0'));var util=require(_0x8665('0x1'));var path=require(_0x8665('0x2'));var timeout=require(_0x8665('0x3'));var express=require(_0x8665('0x4'));var router=express[_0x8665('0x5')]();var auth=require(_0x8665('0x6'));var interaction=require(_0x8665('0x7'));var config=require('../../config/environment');var controller=require(_0x8665('0x8'));router[_0x8665('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x8665('0x9')](_0x8665('0xa'),auth[_0x8665('0xb')](),controller[_0x8665('0xc')]);router[_0x8665('0x9')](_0x8665('0xd'),auth[_0x8665('0xb')](),controller[_0x8665('0xe')]);router['get'](_0x8665('0xf'),auth[_0x8665('0xb')](),controller[_0x8665('0x10')]);router[_0x8665('0x11')]('/',auth[_0x8665('0xb')](),controller[_0x8665('0x12')]);router[_0x8665('0x13')](_0x8665('0xd'),auth[_0x8665('0xb')](),controller[_0x8665('0x14')]);router[_0x8665('0x15')](_0x8665('0xd'),auth[_0x8665('0xb')](),controller[_0x8665('0x16')]);module['exports']=router; \ No newline at end of file +var _0xca8d=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','/describe','describe','show','getQuestions','post','create','put','/:id','update'];(function(_0x47e593,_0x13a2e5){var _0xe99310=function(_0x63414a){while(--_0x63414a){_0x47e593['push'](_0x47e593['shift']());}};_0xe99310(++_0x13a2e5);}(_0xca8d,0x172));var _0xdca8=function(_0x32f193,_0x612afc){_0x32f193=_0x32f193-0x0;var _0x5bb92e=_0xca8d[_0x32f193];return _0x5bb92e;};'use strict';var multer=require(_0xdca8('0x0'));var util=require(_0xdca8('0x1'));var path=require(_0xdca8('0x2'));var timeout=require(_0xdca8('0x3'));var express=require(_0xdca8('0x4'));var router=express[_0xdca8('0x5')]();var auth=require(_0xdca8('0x6'));var interaction=require(_0xdca8('0x7'));var config=require(_0xdca8('0x8'));var controller=require(_0xdca8('0x9'));router[_0xdca8('0xa')]('/',auth[_0xdca8('0xb')](),controller['index']);router[_0xdca8('0xa')](_0xdca8('0xc'),auth[_0xdca8('0xb')](),controller[_0xdca8('0xd')]);router[_0xdca8('0xa')]('/:id',auth[_0xdca8('0xb')](),controller[_0xdca8('0xe')]);router[_0xdca8('0xa')]('/:id/questions',auth[_0xdca8('0xb')](),controller[_0xdca8('0xf')]);router[_0xdca8('0x10')]('/',auth[_0xdca8('0xb')](),controller[_0xdca8('0x11')]);router[_0xdca8('0x12')](_0xdca8('0x13'),auth[_0xdca8('0xb')](),controller[_0xdca8('0x14')]);router['delete']('/:id',auth[_0xdca8('0xb')](),controller[_0xdca8('0x15')]);module[_0xdca8('0x16')]=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index 44c0c66..dca20ca 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 _0xf8e2=['sequelize','setDataValue','YYYY-MM-DD\x20HH:mm:ss','STRING','moment'];(function(_0x22d53d,_0x339808){var _0x40dd91=function(_0x1ea0a6){while(--_0x1ea0a6){_0x22d53d['push'](_0x22d53d['shift']());}};_0x40dd91(++_0x339808);}(_0xf8e2,0x6d));var _0x2f8e=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0xf8e2[_0x3b380d];return _0x54502b;};'use strict';var moment=require(_0x2f8e('0x0'));var Sequelize=require(_0x2f8e('0x1'));module['exports']={'starttime':{'type':Sequelize['DATE'],'set':function(_0x545709){this[_0x2f8e('0x2')]('starttime',_0x545709);this[_0x2f8e('0x2')]('endtime',moment()['format'](_0x2f8e('0x3')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x2f8e('0x4')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2f8e('0x4')]},'uniqueid':{'type':Sequelize[_0x2f8e('0x4')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x2f8e('0x4')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xf948=['format','YYYY-MM-DD\x20HH:mm:ss','STRING','BOOLEAN','moment','sequelize','DATE','setDataValue','endtime'];(function(_0x1863a7,_0x7e03be){var _0x36f96f=function(_0x3485a9){while(--_0x3485a9){_0x1863a7['push'](_0x1863a7['shift']());}};_0x36f96f(++_0x7e03be);}(_0xf948,0xb8));var _0x8f94=function(_0x4b292f,_0x4037ce){_0x4b292f=_0x4b292f-0x0;var _0x5c821b=_0xf948[_0x4b292f];return _0x5c821b;};'use strict';var moment=require(_0x8f94('0x0'));var Sequelize=require(_0x8f94('0x1'));module['exports']={'starttime':{'type':Sequelize[_0x8f94('0x2')],'set':function(_0x479849){this[_0x8f94('0x3')]('starttime',_0x479849);this[_0x8f94('0x3')](_0x8f94('0x4'),moment()[_0x8f94('0x5')](_0x8f94('0x6')));}},'endtime':{'type':Sequelize['DATE']},'membername':{'type':Sequelize[_0x8f94('0x7')]},'projectname':{'type':Sequelize[_0x8f94('0x7')]},'queue':{'type':Sequelize[_0x8f94('0x7')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x8f94('0x7')]},'calleridnum':{'type':Sequelize['STRING']},'completed':{'type':Sequelize[_0x8f94('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 0ea32ce..e018bc9 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 _0xd36f=['name','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','where','options','JscriptySessionReport','count','includeAll','findAll','catch','show','params','include','merge','find','create','body','update','describe','findOne','rawAttributes','sort','filter','rows','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','offset','set','json','reject','then','destroy','error','stack'];(function(_0x35a7c1,_0x460869){var _0x42c77d=function(_0x439bb3){while(--_0x439bb3){_0x35a7c1['push'](_0x35a7c1['shift']());}};_0x42c77d(++_0x460869);}(_0xd36f,0x1e9));var _0xfd36=function(_0x5f34ea,_0x49317a){_0x5f34ea=_0x5f34ea-0x0;var _0x51afd9=_0xd36f[_0x5f34ea];return _0x51afd9;};'use strict';var pdf=require(_0xfd36('0x0'));var emlformat=require(_0xfd36('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfd36('0x2'));var jsonpatch=require(_0xfd36('0x3'));var rp=require(_0xfd36('0x4'));var moment=require(_0xfd36('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfd36('0x6'));var util=require(_0xfd36('0x7'));var path=require('path');var sox=require(_0xfd36('0x8'));var csv=require(_0xfd36('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfd36('0xa'));var squel=require(_0xfd36('0xb'));var crypto=require(_0xfd36('0xc'));var jsforce=require(_0xfd36('0xd'));var deskjs=require(_0xfd36('0xe'));var toCsv=require(_0xfd36('0x9'));var querystring=require(_0xfd36('0xf'));var Papa=require(_0xfd36('0x10'));var Redis=require(_0xfd36('0x11'));var authService=require(_0xfd36('0x12'));var qs=require(_0xfd36('0x13'));var as=require(_0xfd36('0x14'));var hardwareService=require(_0xfd36('0x15'));var logger=require(_0xfd36('0x16'))(_0xfd36('0x17'));var utils=require(_0xfd36('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4fd873,_0x34e3f9){_0x34e3f9=_0x34e3f9||0xcc;return function(_0x4da084){if(_0x4da084){return _0x4fd873[_0xfd36('0x19')](_0x34e3f9);}return _0x4fd873[_0xfd36('0x1a')](_0x34e3f9)[_0xfd36('0x1b')]();};}function respondWithResult(_0x89c6e8,_0x60b6a6){_0x60b6a6=_0x60b6a6||0xc8;return function(_0x2edb48){if(_0x2edb48){return _0x89c6e8[_0xfd36('0x1a')](_0x60b6a6)['json'](_0x2edb48);}};}function respondWithFilteredResult(_0x8a9557,_0x125e00){return function(_0x2e7237){if(_0x2e7237){var _0x29ea69=_0x2e7237['count'],_0x5947a4=_0x125e00['offset'],_0x54e8a9=_0x125e00[_0xfd36('0x1c')]+_0x125e00['limit'],_0x24a374;if(_0x54e8a9>=_0x29ea69){_0x54e8a9=_0x29ea69;_0x24a374=0xc8;}else{_0x24a374=0xce;}_0x8a9557[_0xfd36('0x1a')](_0x24a374);return _0x8a9557[_0xfd36('0x1d')]('Content-Range',_0x5947a4+'-'+_0x54e8a9+'/'+_0x29ea69)[_0xfd36('0x1e')](_0x2e7237);}return null;};}function patchUpdates(_0x4654aa){return function(_0xd800b0){try{jsonpatch['apply'](_0xd800b0,_0x4654aa,!![]);}catch(_0x142b5b){return BPromise[_0xfd36('0x1f')](_0x142b5b);}return _0xd800b0['save']();};}function saveUpdates(_0x499782,_0x1b9332){return function(_0x55c940){if(_0x55c940){return _0x55c940['update'](_0x499782)[_0xfd36('0x20')](function(_0x351057){return _0x351057;});}return null;};}function removeEntity(_0x3c7be9,_0x2f0ce9){return function(_0x5b3626){if(_0x5b3626){return _0x5b3626[_0xfd36('0x21')]()[_0xfd36('0x20')](function(){_0x3c7be9['status'](0xcc)[_0xfd36('0x1b')]();});}};}function handleEntityNotFound(_0x2b4b06,_0x3acf62){return function(_0x51abcb){if(!_0x51abcb){_0x2b4b06[_0xfd36('0x19')](0x194);}return _0x51abcb;};}function handleError(_0x3814cc,_0x59a744){_0x59a744=_0x59a744||0x1f4;return function(_0x124b3f){logger[_0xfd36('0x22')](_0x124b3f[_0xfd36('0x23')]);if(_0x124b3f['name']){delete _0x124b3f[_0xfd36('0x24')];}_0x3814cc[_0xfd36('0x1a')](_0x59a744)['send'](_0x124b3f);};}exports[_0xfd36('0x25')]=function(_0x5949db,_0x3bb7ec){var _0x5a1d06={},_0x112f77={},_0x50563e={'count':0x0,'rows':[]};var _0x1321da=_[_0xfd36('0x26')](db['JscriptySessionReport']['rawAttributes'],function(_0x5c2a91){return{'name':_0x5c2a91[_0xfd36('0x27')],'type':_0x5c2a91[_0xfd36('0x28')][_0xfd36('0x29')]};});_0x112f77[_0xfd36('0x2a')]=_[_0xfd36('0x26')](_0x1321da,_0xfd36('0x24'));_0x112f77[_0xfd36('0x2b')]=_[_0xfd36('0x2c')](_0x5949db[_0xfd36('0x2b')]);_0x112f77[_0xfd36('0x2d')]=_[_0xfd36('0x2e')](_0x112f77[_0xfd36('0x2a')],_0x112f77[_0xfd36('0x2b')]);_0x5a1d06['attributes']=_['intersection'](_0x112f77[_0xfd36('0x2a')],qs[_0xfd36('0x2f')](_0x5949db['query']['fields']));_0x5a1d06[_0xfd36('0x30')]=_0x5a1d06['attributes'][_0xfd36('0x31')]?_0x5a1d06[_0xfd36('0x30')]:_0x112f77[_0xfd36('0x2a')];if(!_0x5949db[_0xfd36('0x2b')][_0xfd36('0x32')](_0xfd36('0x33'))){_0x5a1d06[_0xfd36('0x34')]=qs[_0xfd36('0x34')](_0x5949db[_0xfd36('0x2b')][_0xfd36('0x34')]);_0x5a1d06[_0xfd36('0x1c')]=qs['offset'](_0x5949db[_0xfd36('0x2b')][_0xfd36('0x1c')]);}_0x5a1d06[_0xfd36('0x35')]=qs['sort'](_0x5949db[_0xfd36('0x2b')]['sort']);_0x5a1d06['where']=qs[_0xfd36('0x2d')](_['pick'](_0x5949db['query'],_0x112f77[_0xfd36('0x2d')]));if(_0x5949db[_0xfd36('0x2b')]['filter']){_0x5a1d06[_0xfd36('0x36')]=_['merge'](_0x5a1d06[_0xfd36('0x36')],{'$or':_[_0xfd36('0x26')](_0x1321da,function(_0x26a0b){if(_0x26a0b[_0xfd36('0x28')]!=='VIRTUAL'){var _0xe581dc={};_0xe581dc[_0x26a0b[_0xfd36('0x24')]]={'$like':'%'+_0x5949db[_0xfd36('0x2b')]['filter']+'%'};return _0xe581dc;}})});}_0x5a1d06=_['merge']({},_0x5a1d06,_0x5949db[_0xfd36('0x37')]);var _0x37a653={'where':_0x5a1d06[_0xfd36('0x36')]};return db[_0xfd36('0x38')][_0xfd36('0x39')](_0x37a653)[_0xfd36('0x20')](function(_0x14e104){_0x50563e[_0xfd36('0x39')]=_0x14e104;if(_0x5949db[_0xfd36('0x2b')][_0xfd36('0x3a')]){_0x5a1d06['include']=[{'all':!![]}];}return db[_0xfd36('0x38')][_0xfd36('0x3b')](_0x5a1d06);})[_0xfd36('0x20')](function(_0x318af5){_0x50563e['rows']=_0x318af5;return _0x50563e;})[_0xfd36('0x20')](respondWithFilteredResult(_0x3bb7ec,_0x5a1d06))[_0xfd36('0x3c')](handleError(_0x3bb7ec,null));};exports[_0xfd36('0x3d')]=function(_0x2daa2d,_0x9143f7){var _0x498b0e={'raw':!![],'where':{'id':_0x2daa2d[_0xfd36('0x3e')]['id']}},_0x318b17={};_0x318b17[_0xfd36('0x2a')]=_[_0xfd36('0x2c')](db['JscriptySessionReport']['rawAttributes']);_0x318b17[_0xfd36('0x2b')]=_[_0xfd36('0x2c')](_0x2daa2d[_0xfd36('0x2b')]);_0x318b17['filters']=_['intersection'](_0x318b17[_0xfd36('0x2a')],_0x318b17['query']);_0x498b0e['attributes']=_[_0xfd36('0x2e')](_0x318b17['model'],qs[_0xfd36('0x2f')](_0x2daa2d[_0xfd36('0x2b')][_0xfd36('0x2f')]));_0x498b0e[_0xfd36('0x30')]=_0x498b0e[_0xfd36('0x30')][_0xfd36('0x31')]?_0x498b0e[_0xfd36('0x30')]:_0x318b17[_0xfd36('0x2a')];if(_0x2daa2d[_0xfd36('0x2b')]['includeAll']){_0x498b0e[_0xfd36('0x3f')]=[{'all':!![]}];}_0x498b0e=_[_0xfd36('0x40')]({},_0x498b0e,_0x2daa2d[_0xfd36('0x37')]);return db[_0xfd36('0x38')][_0xfd36('0x41')](_0x498b0e)[_0xfd36('0x20')](handleEntityNotFound(_0x9143f7,null))[_0xfd36('0x20')](respondWithResult(_0x9143f7,null))[_0xfd36('0x3c')](handleError(_0x9143f7,null));};exports['create']=function(_0xe03a3d,_0x41392f){return db[_0xfd36('0x38')][_0xfd36('0x42')](_0xe03a3d[_0xfd36('0x43')],{})[_0xfd36('0x20')](respondWithResult(_0x41392f,0xc9))[_0xfd36('0x3c')](handleError(_0x41392f,null));};exports[_0xfd36('0x44')]=function(_0x21c0fa,_0x46f2a2){if(_0x21c0fa['body']['id']){delete _0x21c0fa[_0xfd36('0x43')]['id'];}return db[_0xfd36('0x38')][_0xfd36('0x41')]({'where':{'id':_0x21c0fa['params']['id']}})[_0xfd36('0x20')](handleEntityNotFound(_0x46f2a2,null))[_0xfd36('0x20')](saveUpdates(_0x21c0fa[_0xfd36('0x43')],null))[_0xfd36('0x20')](respondWithResult(_0x46f2a2,null))['catch'](handleError(_0x46f2a2,null));};exports['destroy']=function(_0xff9790,_0x3a2d5f){return db['JscriptySessionReport'][_0xfd36('0x41')]({'where':{'id':_0xff9790[_0xfd36('0x3e')]['id']}})[_0xfd36('0x20')](handleEntityNotFound(_0x3a2d5f,null))[_0xfd36('0x20')](removeEntity(_0x3a2d5f,null))[_0xfd36('0x3c')](handleError(_0x3a2d5f,null));};exports[_0xfd36('0x45')]=function(_0x42e018,_0x2cd4d2){return db[_0xfd36('0x38')][_0xfd36('0x45')]()['then'](respondWithResult(_0x2cd4d2,null))[_0xfd36('0x3c')](handleError(_0x2cd4d2,null));};exports['getQuestions']=function(_0xd90a84,_0x511c24,_0x59c9be){var _0x37dd08={'raw':!![],'where':{}};var _0x1ec35f={};var _0x1082e8={'count':0x0,'rows':[]};return db[_0xfd36('0x38')][_0xfd36('0x46')]({'where':{'id':_0xd90a84[_0xfd36('0x3e')]['id']}})['then'](handleEntityNotFound(_0x511c24,null))[_0xfd36('0x20')](function(_0x5748bb){if(_0x5748bb){_0x1ec35f[_0xfd36('0x2a')]=_[_0xfd36('0x2c')](db['JscriptyQuestionReport'][_0xfd36('0x47')]);_0x1ec35f[_0xfd36('0x2b')]=_[_0xfd36('0x2c')](_0xd90a84[_0xfd36('0x2b')]);_0x1ec35f[_0xfd36('0x2d')]=_[_0xfd36('0x2e')](_0x1ec35f[_0xfd36('0x2a')],_0x1ec35f['query']);_0x37dd08[_0xfd36('0x30')]=_[_0xfd36('0x2e')](_0x1ec35f[_0xfd36('0x2a')],qs['fields'](_0xd90a84['query'][_0xfd36('0x2f')]));_0x37dd08[_0xfd36('0x30')]=_0x37dd08[_0xfd36('0x30')]['length']?_0x37dd08['attributes']:_0x1ec35f[_0xfd36('0x2a')];if(!_0xd90a84[_0xfd36('0x2b')][_0xfd36('0x32')](_0xfd36('0x33'))){_0x37dd08[_0xfd36('0x34')]=qs[_0xfd36('0x34')](_0xd90a84[_0xfd36('0x2b')][_0xfd36('0x34')]);_0x37dd08[_0xfd36('0x1c')]=qs[_0xfd36('0x1c')](_0xd90a84[_0xfd36('0x2b')][_0xfd36('0x1c')]);}_0x37dd08['order']=qs['sort'](_0xd90a84['query'][_0xfd36('0x48')]);_0x37dd08[_0xfd36('0x36')]=qs[_0xfd36('0x2d')](_['pick'](_0xd90a84[_0xfd36('0x2b')],_0x1ec35f[_0xfd36('0x2d')]));_0x37dd08[_0xfd36('0x36')]['SessionId']=_0x5748bb['id'];if(_0xd90a84[_0xfd36('0x2b')]['filter']){_0x37dd08[_0xfd36('0x36')]=_['merge'](_0x37dd08[_0xfd36('0x36')],{'$or':_[_0xfd36('0x26')](_0x37dd08['attributes'],function(_0x34ffad){var _0x1d53a8={};_0x1d53a8[_0x34ffad]={'$like':'%'+_0xd90a84[_0xfd36('0x2b')][_0xfd36('0x49')]+'%'};return _0x1d53a8;})});}_0x37dd08=_[_0xfd36('0x40')]({},_0x37dd08,_0xd90a84[_0xfd36('0x37')]);return db['JscriptyQuestionReport'][_0xfd36('0x39')]({'where':_0x37dd08[_0xfd36('0x36')]})['then'](function(_0x5db17c){_0x1082e8[_0xfd36('0x39')]=_0x5db17c;if(_0xd90a84[_0xfd36('0x2b')][_0xfd36('0x3a')]){_0x37dd08['include']=[{'all':!![]}];}return db['JscriptyQuestionReport'][_0xfd36('0x3b')](_0x37dd08);})[_0xfd36('0x20')](function(_0x23a4c5){_0x1082e8[_0xfd36('0x4a')]=_0x23a4c5;return _0x1082e8;});}})['then'](respondWithFilteredResult(_0x511c24,_0x37dd08))[_0xfd36('0x3c')](handleError(_0x511c24,null));}; \ No newline at end of file +var _0x2ad6=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','show','params','find','create','body','catch','describe','getQuestions','JscriptyQuestionReport','SessionId','count','rows','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','JscriptySessionReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x151f6d,_0x570594){var _0x2c953c=function(_0x20fc99){while(--_0x20fc99){_0x151f6d['push'](_0x151f6d['shift']());}};_0x2c953c(++_0x570594);}(_0x2ad6,0x162));var _0x62ad=function(_0x2631f6,_0x2cbf58){_0x2631f6=_0x2631f6-0x0;var _0x498c4d=_0x2ad6[_0x2631f6];return _0x498c4d;};'use strict';var pdf=require(_0x62ad('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x62ad('0x1'));var zipdir=require(_0x62ad('0x2'));var jsonpatch=require(_0x62ad('0x3'));var rp=require(_0x62ad('0x4'));var moment=require(_0x62ad('0x5'));var BPromise=require(_0x62ad('0x6'));var Mustache=require(_0x62ad('0x7'));var util=require(_0x62ad('0x8'));var path=require('path');var sox=require(_0x62ad('0x9'));var csv=require('to-csv');var ejs=require(_0x62ad('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x62ad('0xb'));var crypto=require(_0x62ad('0xc'));var jsforce=require(_0x62ad('0xd'));var deskjs=require(_0x62ad('0xe'));var toCsv=require(_0x62ad('0xf'));var querystring=require(_0x62ad('0x10'));var Papa=require(_0x62ad('0x11'));var Redis=require(_0x62ad('0x12'));var authService=require(_0x62ad('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x62ad('0x14'));var hardwareService=require(_0x62ad('0x15'));var logger=require(_0x62ad('0x16'))(_0x62ad('0x17'));var utils=require(_0x62ad('0x18'));var config=require('../../config/environment');var db=require(_0x62ad('0x19'))['db'];function respondWithStatusCode(_0xd2cf3b,_0x820258){_0x820258=_0x820258||0xcc;return function(_0x5ef18e){if(_0x5ef18e){return _0xd2cf3b[_0x62ad('0x1a')](_0x820258);}return _0xd2cf3b[_0x62ad('0x1b')](_0x820258)[_0x62ad('0x1c')]();};}function respondWithResult(_0x4b8a4c,_0x106240){_0x106240=_0x106240||0xc8;return function(_0x43402e){if(_0x43402e){return _0x4b8a4c[_0x62ad('0x1b')](_0x106240)[_0x62ad('0x1d')](_0x43402e);}};}function respondWithFilteredResult(_0x53ff23,_0x3e1959){return function(_0xd3402){if(_0xd3402){var _0x16014c=_0xd3402['count'],_0x258b17=_0x3e1959[_0x62ad('0x1e')],_0xb0e984=_0x3e1959['offset']+_0x3e1959[_0x62ad('0x1f')],_0x28c0df;if(_0xb0e984>=_0x16014c){_0xb0e984=_0x16014c;_0x28c0df=0xc8;}else{_0x28c0df=0xce;}_0x53ff23['status'](_0x28c0df);return _0x53ff23[_0x62ad('0x20')](_0x62ad('0x21'),_0x258b17+'-'+_0xb0e984+'/'+_0x16014c)['json'](_0xd3402);}return null;};}function patchUpdates(_0x360261){return function(_0x223672){try{jsonpatch[_0x62ad('0x22')](_0x223672,_0x360261,!![]);}catch(_0x2066e0){return BPromise['reject'](_0x2066e0);}return _0x223672[_0x62ad('0x23')]();};}function saveUpdates(_0xa2a7e1,_0x1a7805){return function(_0x1967aa){if(_0x1967aa){return _0x1967aa[_0x62ad('0x24')](_0xa2a7e1)[_0x62ad('0x25')](function(_0x3f8cf2){return _0x3f8cf2;});}return null;};}function removeEntity(_0x25e6a1,_0xab762d){return function(_0x1f4dc8){if(_0x1f4dc8){return _0x1f4dc8[_0x62ad('0x26')]()[_0x62ad('0x25')](function(){_0x25e6a1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4b4ede,_0x150e86){return function(_0x1e947d){if(!_0x1e947d){_0x4b4ede[_0x62ad('0x1a')](0x194);}return _0x1e947d;};}function handleError(_0x5c2e4c,_0x55b7be){_0x55b7be=_0x55b7be||0x1f4;return function(_0x39da9f){logger[_0x62ad('0x27')](_0x39da9f[_0x62ad('0x28')]);if(_0x39da9f['name']){delete _0x39da9f[_0x62ad('0x29')];}_0x5c2e4c[_0x62ad('0x1b')](_0x55b7be)[_0x62ad('0x2a')](_0x39da9f);};}exports[_0x62ad('0x2b')]=function(_0x40cc23,_0x32122e){var _0x114d4d={},_0x3de899={},_0x3bf1cf={'count':0x0,'rows':[]};var _0x4d50d5=_[_0x62ad('0x2c')](db[_0x62ad('0x2d')][_0x62ad('0x2e')],function(_0x1aba76){return{'name':_0x1aba76[_0x62ad('0x2f')],'type':_0x1aba76['type'][_0x62ad('0x30')]};});_0x3de899[_0x62ad('0x31')]=_[_0x62ad('0x2c')](_0x4d50d5,_0x62ad('0x29'));_0x3de899[_0x62ad('0x32')]=_[_0x62ad('0x33')](_0x40cc23[_0x62ad('0x32')]);_0x3de899[_0x62ad('0x34')]=_[_0x62ad('0x35')](_0x3de899[_0x62ad('0x31')],_0x3de899[_0x62ad('0x32')]);_0x114d4d[_0x62ad('0x36')]=_[_0x62ad('0x35')](_0x3de899['model'],qs[_0x62ad('0x37')](_0x40cc23['query'][_0x62ad('0x37')]));_0x114d4d[_0x62ad('0x36')]=_0x114d4d[_0x62ad('0x36')][_0x62ad('0x38')]?_0x114d4d['attributes']:_0x3de899[_0x62ad('0x31')];if(!_0x40cc23[_0x62ad('0x32')][_0x62ad('0x39')](_0x62ad('0x3a'))){_0x114d4d['limit']=qs[_0x62ad('0x1f')](_0x40cc23[_0x62ad('0x32')][_0x62ad('0x1f')]);_0x114d4d[_0x62ad('0x1e')]=qs['offset'](_0x40cc23[_0x62ad('0x32')][_0x62ad('0x1e')]);}_0x114d4d[_0x62ad('0x3b')]=qs[_0x62ad('0x3c')](_0x40cc23['query'][_0x62ad('0x3c')]);_0x114d4d[_0x62ad('0x3d')]=qs['filters'](_['pick'](_0x40cc23[_0x62ad('0x32')],_0x3de899[_0x62ad('0x34')]));if(_0x40cc23[_0x62ad('0x32')][_0x62ad('0x3e')]){_0x114d4d['where']=_[_0x62ad('0x3f')](_0x114d4d[_0x62ad('0x3d')],{'$or':_[_0x62ad('0x2c')](_0x4d50d5,function(_0x14e769){if(_0x14e769[_0x62ad('0x40')]!==_0x62ad('0x41')){var _0x14c723={};_0x14c723[_0x14e769[_0x62ad('0x29')]]={'$like':'%'+_0x40cc23[_0x62ad('0x32')]['filter']+'%'};return _0x14c723;}})});}_0x114d4d=_[_0x62ad('0x3f')]({},_0x114d4d,_0x40cc23[_0x62ad('0x42')]);var _0x51c4d={'where':_0x114d4d[_0x62ad('0x3d')]};return db[_0x62ad('0x2d')]['count'](_0x51c4d)[_0x62ad('0x25')](function(_0x50c867){_0x3bf1cf['count']=_0x50c867;if(_0x40cc23[_0x62ad('0x32')][_0x62ad('0x43')]){_0x114d4d[_0x62ad('0x44')]=[{'all':!![]}];}return db[_0x62ad('0x2d')][_0x62ad('0x45')](_0x114d4d);})[_0x62ad('0x25')](function(_0x243239){_0x3bf1cf['rows']=_0x243239;return _0x3bf1cf;})[_0x62ad('0x25')](respondWithFilteredResult(_0x32122e,_0x114d4d))['catch'](handleError(_0x32122e,null));};exports[_0x62ad('0x46')]=function(_0x51f1cd,_0x44a320){var _0x56ed62={'raw':!![],'where':{'id':_0x51f1cd[_0x62ad('0x47')]['id']}},_0x4add65={};_0x4add65[_0x62ad('0x31')]=_['keys'](db[_0x62ad('0x2d')][_0x62ad('0x2e')]);_0x4add65['query']=_[_0x62ad('0x33')](_0x51f1cd[_0x62ad('0x32')]);_0x4add65[_0x62ad('0x34')]=_[_0x62ad('0x35')](_0x4add65[_0x62ad('0x31')],_0x4add65[_0x62ad('0x32')]);_0x56ed62[_0x62ad('0x36')]=_['intersection'](_0x4add65['model'],qs[_0x62ad('0x37')](_0x51f1cd[_0x62ad('0x32')][_0x62ad('0x37')]));_0x56ed62[_0x62ad('0x36')]=_0x56ed62[_0x62ad('0x36')][_0x62ad('0x38')]?_0x56ed62[_0x62ad('0x36')]:_0x4add65['model'];if(_0x51f1cd['query'][_0x62ad('0x43')]){_0x56ed62[_0x62ad('0x44')]=[{'all':!![]}];}_0x56ed62=_[_0x62ad('0x3f')]({},_0x56ed62,_0x51f1cd['options']);return db['JscriptySessionReport'][_0x62ad('0x48')](_0x56ed62)['then'](handleEntityNotFound(_0x44a320,null))[_0x62ad('0x25')](respondWithResult(_0x44a320,null))['catch'](handleError(_0x44a320,null));};exports[_0x62ad('0x49')]=function(_0x1fa893,_0x4fa512){return db[_0x62ad('0x2d')][_0x62ad('0x49')](_0x1fa893[_0x62ad('0x4a')],{})[_0x62ad('0x25')](respondWithResult(_0x4fa512,0xc9))['catch'](handleError(_0x4fa512,null));};exports[_0x62ad('0x24')]=function(_0x3ceea2,_0x31ee7){if(_0x3ceea2[_0x62ad('0x4a')]['id']){delete _0x3ceea2[_0x62ad('0x4a')]['id'];}return db[_0x62ad('0x2d')][_0x62ad('0x48')]({'where':{'id':_0x3ceea2[_0x62ad('0x47')]['id']}})['then'](handleEntityNotFound(_0x31ee7,null))[_0x62ad('0x25')](saveUpdates(_0x3ceea2[_0x62ad('0x4a')],null))[_0x62ad('0x25')](respondWithResult(_0x31ee7,null))[_0x62ad('0x4b')](handleError(_0x31ee7,null));};exports[_0x62ad('0x26')]=function(_0x11e569,_0xa33c71){return db[_0x62ad('0x2d')][_0x62ad('0x48')]({'where':{'id':_0x11e569[_0x62ad('0x47')]['id']}})['then'](handleEntityNotFound(_0xa33c71,null))[_0x62ad('0x25')](removeEntity(_0xa33c71,null))[_0x62ad('0x4b')](handleError(_0xa33c71,null));};exports[_0x62ad('0x4c')]=function(_0x8238c8,_0x1857d0){return db[_0x62ad('0x2d')][_0x62ad('0x4c')]()['then'](respondWithResult(_0x1857d0,null))[_0x62ad('0x4b')](handleError(_0x1857d0,null));};exports[_0x62ad('0x4d')]=function(_0x31decc,_0x2a538d,_0x14d640){var _0x2e13ae={'raw':!![],'where':{}};var _0x229091={};var _0x1eff50={'count':0x0,'rows':[]};return db['JscriptySessionReport']['findOne']({'where':{'id':_0x31decc[_0x62ad('0x47')]['id']}})[_0x62ad('0x25')](handleEntityNotFound(_0x2a538d,null))[_0x62ad('0x25')](function(_0x1d5ffd){if(_0x1d5ffd){_0x229091[_0x62ad('0x31')]=_[_0x62ad('0x33')](db[_0x62ad('0x4e')][_0x62ad('0x2e')]);_0x229091[_0x62ad('0x32')]=_[_0x62ad('0x33')](_0x31decc[_0x62ad('0x32')]);_0x229091['filters']=_[_0x62ad('0x35')](_0x229091[_0x62ad('0x31')],_0x229091['query']);_0x2e13ae[_0x62ad('0x36')]=_[_0x62ad('0x35')](_0x229091['model'],qs[_0x62ad('0x37')](_0x31decc[_0x62ad('0x32')]['fields']));_0x2e13ae[_0x62ad('0x36')]=_0x2e13ae[_0x62ad('0x36')][_0x62ad('0x38')]?_0x2e13ae[_0x62ad('0x36')]:_0x229091[_0x62ad('0x31')];if(!_0x31decc[_0x62ad('0x32')]['hasOwnProperty']('nolimit')){_0x2e13ae['limit']=qs[_0x62ad('0x1f')](_0x31decc['query'][_0x62ad('0x1f')]);_0x2e13ae[_0x62ad('0x1e')]=qs[_0x62ad('0x1e')](_0x31decc[_0x62ad('0x32')][_0x62ad('0x1e')]);}_0x2e13ae[_0x62ad('0x3b')]=qs[_0x62ad('0x3c')](_0x31decc[_0x62ad('0x32')][_0x62ad('0x3c')]);_0x2e13ae['where']=qs[_0x62ad('0x34')](_['pick'](_0x31decc[_0x62ad('0x32')],_0x229091[_0x62ad('0x34')]));_0x2e13ae[_0x62ad('0x3d')][_0x62ad('0x4f')]=_0x1d5ffd['id'];if(_0x31decc['query']['filter']){_0x2e13ae[_0x62ad('0x3d')]=_[_0x62ad('0x3f')](_0x2e13ae['where'],{'$or':_[_0x62ad('0x2c')](_0x2e13ae[_0x62ad('0x36')],function(_0x3557a4){var _0x324439={};_0x324439[_0x3557a4]={'$like':'%'+_0x31decc[_0x62ad('0x32')][_0x62ad('0x3e')]+'%'};return _0x324439;})});}_0x2e13ae=_[_0x62ad('0x3f')]({},_0x2e13ae,_0x31decc[_0x62ad('0x42')]);return db[_0x62ad('0x4e')][_0x62ad('0x50')]({'where':_0x2e13ae[_0x62ad('0x3d')]})[_0x62ad('0x25')](function(_0x185873){_0x1eff50['count']=_0x185873;if(_0x31decc['query'][_0x62ad('0x43')]){_0x2e13ae['include']=[{'all':!![]}];}return db[_0x62ad('0x4e')]['findAll'](_0x2e13ae);})[_0x62ad('0x25')](function(_0x38da27){_0x1eff50[_0x62ad('0x51')]=_0x38da27;return _0x1eff50;});}})[_0x62ad('0x25')](respondWithFilteredResult(_0x2a538d,_0x2e13ae))[_0x62ad('0x4b')](handleError(_0x2a538d,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index ad85e9b..f67bbbb 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 _0x514a=['./jscriptySessionReport.attributes','define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x277eb4,_0x3076f9){var _0x41dfb7=function(_0x426f2f){while(--_0x426f2f){_0x277eb4['push'](_0x277eb4['shift']());}};_0x41dfb7(++_0x3076f9);}(_0x514a,0x18a));var _0xa514=function(_0x2333d8,_0x3b7e9c){_0x2333d8=_0x2333d8-0x0;var _0x5b1efe=_0x514a[_0x2333d8];return _0x5b1efe;};'use strict';var _=require(_0xa514('0x0'));var util=require(_0xa514('0x1'));var logger=require(_0xa514('0x2'))(_0xa514('0x3'));var moment=require(_0xa514('0x4'));var BPromise=require(_0xa514('0x5'));var rp=require(_0xa514('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xa514('0x7'));var config=require(_0xa514('0x8'));var attributes=require(_0xa514('0x9'));module['exports']=function(_0xed7d9,_0x14570a){return _0xed7d9[_0xa514('0xa')](_0xa514('0xb'),attributes,{'tableName':_0xa514('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xad9a=['JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./jscriptySessionReport.attributes'];(function(_0x24a458,_0x5ba61f){var _0x49c6b1=function(_0x15259b){while(--_0x15259b){_0x24a458['push'](_0x24a458['shift']());}};_0x49c6b1(++_0x5ba61f);}(_0xad9a,0x116));var _0xaad9=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xad9a[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xaad9('0x0'));var util=require(_0xaad9('0x1'));var logger=require(_0xaad9('0x2'))(_0xaad9('0x3'));var moment=require(_0xaad9('0x4'));var BPromise=require(_0xaad9('0x5'));var rp=require(_0xaad9('0x6'));var fs=require('fs');var path=require(_0xaad9('0x7'));var rimraf=require('rimraf');var config=require(_0xaad9('0x8'));var attributes=require(_0xaad9('0x9'));module['exports']=function(_0x22ca30,_0x335889){return _0x22ca30['define'](_0xaad9('0xa'),attributes,{'tableName':_0xaad9('0xb'),'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 f060a15..0723234 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 _0xd2bb=['stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2d763a,_0x25179d){var _0x372d32=function(_0x221534){while(--_0x221534){_0x2d763a['push'](_0x2d763a['shift']());}};_0x372d32(++_0x25179d);}(_0xd2bb,0x1d2));var _0xbd2b=function(_0x4f7195,_0x23a20f){_0x4f7195=_0x4f7195-0x0;var _0x171c22=_0xd2bb[_0x4f7195];return _0x171c22;};'use strict';var _=require(_0xbd2b('0x0'));var util=require(_0xbd2b('0x1'));var moment=require(_0xbd2b('0x2'));var BPromise=require(_0xbd2b('0x3'));var rs=require(_0xbd2b('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbd2b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbd2b('0x6'))(_0xbd2b('0x7'));var config=require(_0xbd2b('0x8'));var jayson=require(_0xbd2b('0x9'));var client=jayson[_0xbd2b('0xa')][_0xbd2b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x552bb1,_0x2338f2,_0x1dba43){return new BPromise(function(_0x491a3f,_0x3d56e0){return client[_0xbd2b('0xc')](_0x552bb1,_0x1dba43)['then'](function(_0x44a122){logger[_0xbd2b('0xd')](_0xbd2b('0xe'),_0x2338f2,_0xbd2b('0xf'));logger[_0xbd2b('0x10')]('JscriptySessionReport,\x20%s,\x20%s,\x20%s',_0x2338f2,'request\x20sent',JSON[_0xbd2b('0x11')](_0x44a122));if(_0x44a122[_0xbd2b('0x12')]){if(_0x44a122[_0xbd2b('0x12')]['code']===0x1f4){logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x2338f2,_0x44a122[_0xbd2b('0x12')]['message']);return _0x3d56e0(_0x44a122[_0xbd2b('0x12')][_0xbd2b('0x13')]);}logger[_0xbd2b('0x12')](_0xbd2b('0xe'),_0x2338f2,_0x44a122['error'][_0xbd2b('0x13')]);return _0x491a3f(_0x44a122['error'][_0xbd2b('0x13')]);}else{logger[_0xbd2b('0xd')](_0xbd2b('0xe'),_0x2338f2,_0xbd2b('0xf'));_0x491a3f(_0x44a122[_0xbd2b('0x14')]['message']);}})['catch'](function(_0x5cd393){logger[_0xbd2b('0x12')](_0xbd2b('0xe'),_0x2338f2,_0x5cd393);_0x3d56e0(_0x5cd393);});});} \ No newline at end of file +var _0x40f5=['client','http','request','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x52972c,_0x50aab5){var _0x528839=function(_0x1a134c){while(--_0x1a134c){_0x52972c['push'](_0x52972c['shift']());}};_0x528839(++_0x50aab5);}(_0x40f5,0x13a));var _0x540f=function(_0xdd598a,_0x2f4169){_0xdd598a=_0xdd598a-0x0;var _0x18c8d7=_0x40f5[_0xdd598a];return _0x18c8d7;};'use strict';var _=require('lodash');var util=require(_0x540f('0x0'));var moment=require(_0x540f('0x1'));var BPromise=require(_0x540f('0x2'));var rs=require(_0x540f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x540f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x540f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x540f('0x6')][_0x540f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x57d987,_0x44c51a,_0xa82ae2){return new BPromise(function(_0x1bcaf9,_0x54e907){return client[_0x540f('0x8')](_0x57d987,_0xa82ae2)['then'](function(_0x25882e){logger['info'](_0x540f('0x9'),_0x44c51a,_0x540f('0xa'));logger[_0x540f('0xb')](_0x540f('0xc'),_0x44c51a,_0x540f('0xa'),JSON[_0x540f('0xd')](_0x25882e));if(_0x25882e[_0x540f('0xe')]){if(_0x25882e[_0x540f('0xe')][_0x540f('0xf')]===0x1f4){logger[_0x540f('0xe')]('JscriptySessionReport,\x20%s,\x20%s',_0x44c51a,_0x25882e['error'][_0x540f('0x10')]);return _0x54e907(_0x25882e[_0x540f('0xe')][_0x540f('0x10')]);}logger[_0x540f('0xe')](_0x540f('0x9'),_0x44c51a,_0x25882e[_0x540f('0xe')][_0x540f('0x10')]);return _0x1bcaf9(_0x25882e['error'][_0x540f('0x10')]);}else{logger[_0x540f('0x11')](_0x540f('0x9'),_0x44c51a,_0x540f('0xa'));_0x1bcaf9(_0x25882e[_0x540f('0x12')][_0x540f('0x10')]);}})[_0x540f('0x13')](function(_0x1aad03){logger[_0x540f('0xe')](_0x540f('0x9'),_0x44c51a,_0x1aad03);_0x54e907(_0x1aad03);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index e2a8727..fe4eaea 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 _0xfca4=['./license.controller','index','put','/:id','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x23b9ff,_0x19bd0b){var _0x29d109=function(_0x2ec088){while(--_0x2ec088){_0x23b9ff['push'](_0x23b9ff['shift']());}};_0x29d109(++_0x19bd0b);}(_0xfca4,0x124));var _0x4fca=function(_0x482846,_0x590591){_0x482846=_0x482846-0x0;var _0x8e06ee=_0xfca4[_0x482846];return _0x8e06ee;};'use strict';var multer=require(_0x4fca('0x0'));var util=require(_0x4fca('0x1'));var path=require(_0x4fca('0x2'));var timeout=require(_0x4fca('0x3'));var express=require(_0x4fca('0x4'));var router=express['Router']();var auth=require(_0x4fca('0x5'));var interaction=require(_0x4fca('0x6'));var config=require(_0x4fca('0x7'));var controller=require(_0x4fca('0x8'));router['get']('/',controller[_0x4fca('0x9')]);router[_0x4fca('0xa')](_0x4fca('0xb'),auth[_0x4fca('0xc')](),controller[_0x4fca('0xd')]);module[_0x4fca('0xe')]=router; \ No newline at end of file +var _0x5a60=['index','put','isAuthenticated','update','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x4eeaeb,_0x3a37e3){var _0xe86e20=function(_0x49ed7c){while(--_0x49ed7c){_0x4eeaeb['push'](_0x4eeaeb['shift']());}};_0xe86e20(++_0x3a37e3);}(_0x5a60,0x14e));var _0x05a6=function(_0x358533,_0x114103){_0x358533=_0x358533-0x0;var _0x5bf407=_0x5a60[_0x358533];return _0x5bf407;};'use strict';var multer=require(_0x05a6('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x05a6('0x1'));var router=express[_0x05a6('0x2')]();var auth=require(_0x05a6('0x3'));var interaction=require(_0x05a6('0x4'));var config=require(_0x05a6('0x5'));var controller=require('./license.controller');router[_0x05a6('0x6')]('/',controller[_0x05a6('0x7')]);router[_0x05a6('0x8')]('/:id',auth[_0x05a6('0x9')](),controller[_0x05a6('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 0813a9a..f187630 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 _0xc4aa=['exports','TEXT','STRING','INTEGER','sequelize'];(function(_0x379ffb,_0x15fd8f){var _0x580a86=function(_0x36ebb7){while(--_0x36ebb7){_0x379ffb['push'](_0x379ffb['shift']());}};_0x580a86(++_0x15fd8f);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc4aa[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'license':{'type':Sequelize[_0xac4a('0x2')]},'data1':{'type':Sequelize[_0xac4a('0x3')]},'data2':{'type':Sequelize[_0xac4a('0x3')]},'chatLicenseExceeded':{'type':Sequelize[_0xac4a('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x687b=['TEXT','STRING','sequelize','exports'];(function(_0x2f58ea,_0x2c8f38){var _0x514770=function(_0xd39816){while(--_0xd39816){_0x2f58ea['push'](_0x2f58ea['shift']());}};_0x514770(++_0x2c8f38);}(_0x687b,0x14a));var _0xb687=function(_0x23c31a,_0xdc4107){_0x23c31a=_0x23c31a-0x0;var _0x4d5585=_0x687b[_0x23c31a];return _0x4d5585;};'use strict';var Sequelize=require(_0xb687('0x0'));module[_0xb687('0x1')]={'license':{'type':Sequelize[_0xb687('0x2')]},'data1':{'type':Sequelize[_0xb687('0x3')]},'data2':{'type':Sequelize['STRING']},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index ec4d53f..6bb051f 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 _0x3585=['apply','save','update','then','destroy','error','stack','name','../../config/license/util','model','keys','License','rawAttributes','filters','query','intersection','fields','attributes','length','options','getLicense','catch','body','find','params','checkLicense','key','demo','html-pdf','eml-format','rimraf','zip-dir','bluebird','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','json'];(function(_0xe057df,_0x49c828){var _0x518ae4=function(_0x365ce3){while(--_0x365ce3){_0xe057df['push'](_0xe057df['shift']());}};_0x518ae4(++_0x49c828);}(_0x3585,0x108));var _0x5358=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3585[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5358('0x0'));var emlformat=require(_0x5358('0x1'));var rimraf=require(_0x5358('0x2'));var zipdir=require(_0x5358('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5358('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x5358('0x5'));var sox=require(_0x5358('0x6'));var csv=require(_0x5358('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5358('0x8'));var squel=require(_0x5358('0x9'));var crypto=require('crypto');var jsforce=require(_0x5358('0xa'));var deskjs=require(_0x5358('0xb'));var toCsv=require('to-csv');var querystring=require(_0x5358('0xc'));var Papa=require(_0x5358('0xd'));var Redis=require(_0x5358('0xe'));var authService=require(_0x5358('0xf'));var qs=require(_0x5358('0x10'));var as=require(_0x5358('0x11'));var hardwareService=require(_0x5358('0x12'));var logger=require(_0x5358('0x13'))(_0x5358('0x14'));var utils=require(_0x5358('0x15'));var config=require(_0x5358('0x16'));var db=require(_0x5358('0x17'))['db'];function respondWithStatusCode(_0x3a4d63,_0x1f10d6){_0x1f10d6=_0x1f10d6||0xcc;return function(_0x42a4c5){if(_0x42a4c5){return _0x3a4d63[_0x5358('0x18')](_0x1f10d6);}return _0x3a4d63[_0x5358('0x19')](_0x1f10d6)[_0x5358('0x1a')]();};}function respondWithResult(_0x44dac6,_0x2f30b9){_0x2f30b9=_0x2f30b9||0xc8;return function(_0x14b43e){if(_0x14b43e){return _0x44dac6[_0x5358('0x19')](_0x2f30b9)['json'](_0x14b43e);}};}function respondWithFilteredResult(_0x1940fe,_0x153c4e){return function(_0x529d12){if(_0x529d12){var _0x3d2c4e=_0x529d12[_0x5358('0x1b')],_0x4006dc=_0x153c4e[_0x5358('0x1c')],_0x4b9def=_0x153c4e[_0x5358('0x1c')]+_0x153c4e[_0x5358('0x1d')],_0x5bacce;if(_0x4b9def>=_0x3d2c4e){_0x4b9def=_0x3d2c4e;_0x5bacce=0xc8;}else{_0x5bacce=0xce;}_0x1940fe['status'](_0x5bacce);return _0x1940fe['set']('Content-Range',_0x4006dc+'-'+_0x4b9def+'/'+_0x3d2c4e)[_0x5358('0x1e')](_0x529d12);}return null;};}function patchUpdates(_0x202705){return function(_0x43e425){try{jsonpatch[_0x5358('0x1f')](_0x43e425,_0x202705,!![]);}catch(_0x235398){return BPromise['reject'](_0x235398);}return _0x43e425[_0x5358('0x20')]();};}function saveUpdates(_0x8067de,_0x2abd1a){return function(_0x552734){if(_0x552734){return _0x552734[_0x5358('0x21')](_0x8067de)[_0x5358('0x22')](function(_0x468b30){return _0x468b30;});}return null;};}function removeEntity(_0xb8bf03,_0x51ecf8){return function(_0x764c9a){if(_0x764c9a){return _0x764c9a[_0x5358('0x23')]()[_0x5358('0x22')](function(){_0xb8bf03['status'](0xcc)[_0x5358('0x1a')]();});}};}function handleEntityNotFound(_0x556ad5,_0x264776){return function(_0x55b74d){if(!_0x55b74d){_0x556ad5[_0x5358('0x18')](0x194);}return _0x55b74d;};}function handleError(_0xacad3c,_0x50bfed){_0x50bfed=_0x50bfed||0x1f4;return function(_0x5b9848){logger[_0x5358('0x24')](_0x5b9848[_0x5358('0x25')]);if(_0x5b9848['name']){delete _0x5b9848[_0x5358('0x26')];}_0xacad3c[_0x5358('0x19')](_0x50bfed)['send'](_0x5b9848);};}var utilLicense=require(_0x5358('0x27'));exports['index']=function(_0x8513a9,_0x356368){var _0x4a1268={'raw':!![],'where':{'id':0x1}},_0x11d9dc={};_0x11d9dc[_0x5358('0x28')]=_[_0x5358('0x29')](db[_0x5358('0x2a')][_0x5358('0x2b')]);_0x11d9dc['query']=_['keys'](_0x8513a9['query']);_0x11d9dc[_0x5358('0x2c')]=_['intersection'](_0x11d9dc['model'],_0x11d9dc[_0x5358('0x2d')]);_0x4a1268['attributes']=_[_0x5358('0x2e')](_0x11d9dc[_0x5358('0x28')],qs[_0x5358('0x2f')](_0x8513a9['query']['fields']));_0x4a1268[_0x5358('0x30')]=_0x4a1268[_0x5358('0x30')][_0x5358('0x31')]?_0x4a1268[_0x5358('0x30')]:_0x11d9dc[_0x5358('0x28')];_0x4a1268=_['merge']({},_0x4a1268,_0x8513a9[_0x5358('0x32')]);return utilLicense[_0x5358('0x33')](_0x4a1268)[_0x5358('0x22')](respondWithResult(_0x356368,null))[_0x5358('0x34')](handleError(_0x356368,null));};exports[_0x5358('0x21')]=function(_0x193457,_0x12db56){if(_0x193457['body']['id']){delete _0x193457[_0x5358('0x35')]['id'];}return db[_0x5358('0x2a')][_0x5358('0x36')]({'where':{'id':_0x193457[_0x5358('0x37')]['id']}})[_0x5358('0x22')](handleEntityNotFound(_0x12db56,null))[_0x5358('0x22')](function(_0x32d948){var _0x5a89e7=_0x32d948['get']({'plain':!![]});return utilLicense[_0x5358('0x38')](_0x5a89e7,_0x193457[_0x5358('0x35')][_0x5358('0x39')]);})[_0x5358('0x22')](function(_0x22c4c4){if(!_0x22c4c4[_0x5358('0x3a')]){return saveUpdates(_0x193457[_0x5358('0x35')],null);}return _0x22c4c4;})[_0x5358('0x22')](respondWithResult(_0x12db56,null))['catch'](handleError(_0x12db56,null));}; \ No newline at end of file +var _0x748e=['../../config/environment','sendStatus','end','status','json','count','offset','limit','save','update','then','destroy','name','../../config/license/util','index','model','License','rawAttributes','query','keys','filters','intersection','fields','attributes','length','merge','getLicense','catch','body','find','params','checkLicense','key','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api'];(function(_0x30e79f,_0x5180a6){var _0x4f8a95=function(_0x3cd17a){while(--_0x3cd17a){_0x30e79f['push'](_0x30e79f['shift']());}};_0x4f8a95(++_0x5180a6);}(_0x748e,0xcc));var _0xe748=function(_0x13ae3b,_0x4ddd7c){_0x13ae3b=_0x13ae3b-0x0;var _0x145764=_0x748e[_0x13ae3b];return _0x145764;};'use strict';var pdf=require(_0xe748('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe748('0x1'));var zipdir=require(_0xe748('0x2'));var jsonpatch=require(_0xe748('0x3'));var rp=require(_0xe748('0x4'));var moment=require('moment');var BPromise=require(_0xe748('0x5'));var Mustache=require(_0xe748('0x6'));var util=require(_0xe748('0x7'));var path=require(_0xe748('0x8'));var sox=require(_0xe748('0x9'));var csv=require(_0xe748('0xa'));var ejs=require(_0xe748('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe748('0xc'));var crypto=require(_0xe748('0xd'));var jsforce=require(_0xe748('0xe'));var deskjs=require(_0xe748('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe748('0x10'));var Papa=require(_0xe748('0x11'));var Redis=require(_0xe748('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xe748('0x13'));var as=require(_0xe748('0x14'));var hardwareService=require(_0xe748('0x15'));var logger=require(_0xe748('0x16'))(_0xe748('0x17'));var utils=require('../../config/utils');var config=require(_0xe748('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1757fd,_0x552908){_0x552908=_0x552908||0xcc;return function(_0xcab0b7){if(_0xcab0b7){return _0x1757fd[_0xe748('0x19')](_0x552908);}return _0x1757fd['status'](_0x552908)[_0xe748('0x1a')]();};}function respondWithResult(_0x1d549f,_0x7b9970){_0x7b9970=_0x7b9970||0xc8;return function(_0x1619dd){if(_0x1619dd){return _0x1d549f[_0xe748('0x1b')](_0x7b9970)[_0xe748('0x1c')](_0x1619dd);}};}function respondWithFilteredResult(_0x5ef0ec,_0x477306){return function(_0x2f2832){if(_0x2f2832){var _0x2bd9f1=_0x2f2832[_0xe748('0x1d')],_0x505114=_0x477306[_0xe748('0x1e')],_0x3e472d=_0x477306['offset']+_0x477306[_0xe748('0x1f')],_0x432f5d;if(_0x3e472d>=_0x2bd9f1){_0x3e472d=_0x2bd9f1;_0x432f5d=0xc8;}else{_0x432f5d=0xce;}_0x5ef0ec[_0xe748('0x1b')](_0x432f5d);return _0x5ef0ec['set']('Content-Range',_0x505114+'-'+_0x3e472d+'/'+_0x2bd9f1)['json'](_0x2f2832);}return null;};}function patchUpdates(_0x1b99a5){return function(_0x5d2228){try{jsonpatch['apply'](_0x5d2228,_0x1b99a5,!![]);}catch(_0x38b22d){return BPromise['reject'](_0x38b22d);}return _0x5d2228[_0xe748('0x20')]();};}function saveUpdates(_0x4b6d30,_0x3a9476){return function(_0x4d1d6c){if(_0x4d1d6c){return _0x4d1d6c[_0xe748('0x21')](_0x4b6d30)[_0xe748('0x22')](function(_0x4fe3d8){return _0x4fe3d8;});}return null;};}function removeEntity(_0x31fdda,_0x1dd7ad){return function(_0x32fa09){if(_0x32fa09){return _0x32fa09[_0xe748('0x23')]()[_0xe748('0x22')](function(){_0x31fdda[_0xe748('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x479f89,_0x1bdfc5){return function(_0x52f9a0){if(!_0x52f9a0){_0x479f89['sendStatus'](0x194);}return _0x52f9a0;};}function handleError(_0x16f5aa,_0x2f3b5f){_0x2f3b5f=_0x2f3b5f||0x1f4;return function(_0x1a329d){logger['error'](_0x1a329d['stack']);if(_0x1a329d[_0xe748('0x24')]){delete _0x1a329d[_0xe748('0x24')];}_0x16f5aa[_0xe748('0x1b')](_0x2f3b5f)['send'](_0x1a329d);};}var utilLicense=require(_0xe748('0x25'));exports[_0xe748('0x26')]=function(_0x571c65,_0x4a3335){var _0x2cbfa4={'raw':!![],'where':{'id':0x1}},_0x522f48={};_0x522f48[_0xe748('0x27')]=_['keys'](db[_0xe748('0x28')][_0xe748('0x29')]);_0x522f48[_0xe748('0x2a')]=_[_0xe748('0x2b')](_0x571c65[_0xe748('0x2a')]);_0x522f48[_0xe748('0x2c')]=_[_0xe748('0x2d')](_0x522f48[_0xe748('0x27')],_0x522f48['query']);_0x2cbfa4['attributes']=_[_0xe748('0x2d')](_0x522f48[_0xe748('0x27')],qs['fields'](_0x571c65[_0xe748('0x2a')][_0xe748('0x2e')]));_0x2cbfa4[_0xe748('0x2f')]=_0x2cbfa4[_0xe748('0x2f')][_0xe748('0x30')]?_0x2cbfa4[_0xe748('0x2f')]:_0x522f48[_0xe748('0x27')];_0x2cbfa4=_[_0xe748('0x31')]({},_0x2cbfa4,_0x571c65['options']);return utilLicense[_0xe748('0x32')](_0x2cbfa4)[_0xe748('0x22')](respondWithResult(_0x4a3335,null))[_0xe748('0x33')](handleError(_0x4a3335,null));};exports[_0xe748('0x21')]=function(_0xe2ff78,_0x376dfd){if(_0xe2ff78[_0xe748('0x34')]['id']){delete _0xe2ff78[_0xe748('0x34')]['id'];}return db['License'][_0xe748('0x35')]({'where':{'id':_0xe2ff78[_0xe748('0x36')]['id']}})[_0xe748('0x22')](handleEntityNotFound(_0x376dfd,null))['then'](function(_0x387e9f){var _0x285123=_0x387e9f['get']({'plain':!![]});return utilLicense[_0xe748('0x37')](_0x285123,_0xe2ff78[_0xe748('0x34')][_0xe748('0x38')]);})[_0xe748('0x22')](function(_0xb4d5be){if(!_0xb4d5be['demo']){return saveUpdates(_0xe2ff78[_0xe748('0x34')],null);}return _0xb4d5be;})[_0xe748('0x22')](respondWithResult(_0x376dfd,null))['catch'](handleError(_0x376dfd,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index cfca27d..2c5c1e6 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 _0x0f93=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','exports','define','License','util','../../config/logger'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0f93,0x66));var _0x30f9=function(_0x506bae,_0x38445f){_0x506bae=_0x506bae-0x0;var _0x4d3fa4=_0x0f93[_0x506bae];return _0x4d3fa4;};'use strict';var _=require('lodash');var util=require(_0x30f9('0x0'));var logger=require(_0x30f9('0x1'))(_0x30f9('0x2'));var moment=require(_0x30f9('0x3'));var BPromise=require(_0x30f9('0x4'));var rp=require(_0x30f9('0x5'));var fs=require('fs');var path=require(_0x30f9('0x6'));var rimraf=require(_0x30f9('0x7'));var config=require(_0x30f9('0x8'));var attributes=require(_0x30f9('0x9'));module[_0x30f9('0xa')]=function(_0x4d6276,_0xaad949){return _0x4d6276[_0x30f9('0xb')](_0x30f9('0xc'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x177a=['./license.attributes','exports','define','License','license','lodash','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0x177a,0xdd));var _0xa177=function(_0xe1b811,_0x4473ea){_0xe1b811=_0xe1b811-0x0;var _0x1f8127=_0x177a[_0xe1b811];return _0x1f8127;};'use strict';var _=require(_0xa177('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa177('0x1'));var moment=require(_0xa177('0x2'));var BPromise=require(_0xa177('0x3'));var rp=require(_0xa177('0x4'));var fs=require('fs');var path=require(_0xa177('0x5'));var rimraf=require(_0xa177('0x6'));var config=require('../../config/environment');var attributes=require(_0xa177('0x7'));module[_0xa177('0x8')]=function(_0x1f37b0,_0x455737){return _0x1f37b0[_0xa177('0x9')](_0xa177('0xa'),attributes,{'tableName':_0xa177('0xb'),'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 221a14e..5c43cef 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 _0x8fcf=['client','http','request','then','info','License,\x20%s,\x20%s','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment','randomstring','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x5c9f9c,_0x2193ed){var _0x20350a=function(_0x4b7419){while(--_0x4b7419){_0x5c9f9c['push'](_0x5c9f9c['shift']());}};_0x20350a(++_0x2193ed);}(_0x8fcf,0x1db));var _0xf8fc=function(_0x30be38,_0x11e31e){_0x30be38=_0x30be38-0x0;var _0x57f04b=_0x8fcf[_0x30be38];return _0x57f04b;};'use strict';var _=require(_0xf8fc('0x0'));var util=require(_0xf8fc('0x1'));var moment=require(_0xf8fc('0x2'));var BPromise=require('bluebird');var rs=require(_0xf8fc('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf8fc('0x4'))(_0xf8fc('0x5'));var config=require(_0xf8fc('0x6'));var jayson=require(_0xf8fc('0x7'));var client=jayson[_0xf8fc('0x8')][_0xf8fc('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1448de,_0x43719b,_0x59c401){return new BPromise(function(_0x13c2a7,_0x5b91e9){return client[_0xf8fc('0xa')](_0x1448de,_0x59c401)[_0xf8fc('0xb')](function(_0xf2e390){logger[_0xf8fc('0xc')](_0xf8fc('0xd'),_0x43719b,'request\x20sent');logger[_0xf8fc('0xe')](_0xf8fc('0xf'),_0x43719b,'request\x20sent',JSON[_0xf8fc('0x10')](_0xf2e390));if(_0xf2e390[_0xf8fc('0x11')]){if(_0xf2e390[_0xf8fc('0x11')][_0xf8fc('0x12')]===0x1f4){logger[_0xf8fc('0x11')](_0xf8fc('0xd'),_0x43719b,_0xf2e390['error'][_0xf8fc('0x13')]);return _0x5b91e9(_0xf2e390[_0xf8fc('0x11')][_0xf8fc('0x13')]);}logger[_0xf8fc('0x11')]('License,\x20%s,\x20%s',_0x43719b,_0xf2e390['error']['message']);return _0x13c2a7(_0xf2e390['error'][_0xf8fc('0x13')]);}else{logger[_0xf8fc('0xc')](_0xf8fc('0xd'),_0x43719b,_0xf8fc('0x14'));_0x13c2a7(_0xf2e390[_0xf8fc('0x15')]['message']);}})[_0xf8fc('0x16')](function(_0x3230cc){logger[_0xf8fc('0x11')](_0xf8fc('0xd'),_0x43719b,_0x3230cc);_0x5b91e9(_0x3230cc);});});} \ No newline at end of file +var _0x205d=['License,\x20%s,\x20%s','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x50da6b,_0x5b4e89){var _0x2f2bca=function(_0x7eb2d3){while(--_0x7eb2d3){_0x50da6b['push'](_0x50da6b['shift']());}};_0x2f2bca(++_0x5b4e89);}(_0x205d,0xf6));var _0xd205=function(_0x2a960f,_0x5aab73){_0x2a960f=_0x2a960f-0x0;var _0x5027df=_0x205d[_0x2a960f];return _0x5027df;};'use strict';var _=require(_0xd205('0x0'));var util=require(_0xd205('0x1'));var moment=require(_0xd205('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd205('0x3'));var db=require(_0xd205('0x4'))['db'];var utils=require(_0xd205('0x5'));var logger=require('../../config/logger')(_0xd205('0x6'));var config=require(_0xd205('0x7'));var jayson=require(_0xd205('0x8'));var client=jayson[_0xd205('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2614e7,_0x2b6078,_0xdb99a8){return new BPromise(function(_0x372211,_0x3ce946){return client[_0xd205('0xa')](_0x2614e7,_0xdb99a8)[_0xd205('0xb')](function(_0x1cd484){logger[_0xd205('0xc')]('License,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));logger[_0xd205('0xe')](_0xd205('0xf'),_0x2b6078,_0xd205('0xd'),JSON['stringify'](_0x1cd484));if(_0x1cd484[_0xd205('0x10')]){if(_0x1cd484[_0xd205('0x10')][_0xd205('0x11')]===0x1f4){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484[_0xd205('0x10')][_0xd205('0x13')]);return _0x3ce946(_0x1cd484['error'][_0xd205('0x13')]);}logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x1cd484['error']['message']);return _0x372211(_0x1cd484[_0xd205('0x10')]['message']);}else{logger[_0xd205('0xc')]('License,\x20%s,\x20%s',_0x2b6078,_0xd205('0xd'));_0x372211(_0x1cd484[_0xd205('0x14')][_0xd205('0x13')]);}})[_0xd205('0x15')](function(_0x57201a){logger[_0xd205('0x10')](_0xd205('0x12'),_0x2b6078,_0x57201a);_0x3ce946(_0x57201a);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index c0ce18c..37020d6 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 _0x2ea5=['get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/verify','getAgents','post','addAnswer','create','addImap','addSmtp','send','addAgents','update','delete','removeAnswers','removeSmtp','destroy','removeAgents','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./mailAccount.controller'];(function(_0x1da1bc,_0x5602c3){var _0x104657=function(_0x13f23a){while(--_0x13f23a){_0x1da1bc['push'](_0x1da1bc['shift']());}};_0x104657(++_0x5602c3);}(_0x2ea5,0x169));var _0x52ea=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x2ea5[_0x3b380d];return _0x54502b;};'use strict';var multer=require(_0x52ea('0x0'));var util=require(_0x52ea('0x1'));var path=require(_0x52ea('0x2'));var timeout=require(_0x52ea('0x3'));var express=require(_0x52ea('0x4'));var router=express[_0x52ea('0x5')]();var auth=require(_0x52ea('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x52ea('0x7'));router[_0x52ea('0x8')]('/',auth[_0x52ea('0x9')](),controller[_0x52ea('0xa')]);router[_0x52ea('0x8')](_0x52ea('0xb'),auth[_0x52ea('0x9')](),controller[_0x52ea('0xc')]);router[_0x52ea('0x8')](_0x52ea('0xd'),auth['isAuthenticated'](),controller[_0x52ea('0xe')]);router[_0x52ea('0x8')](_0x52ea('0xf'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x52ea('0x8')](_0x52ea('0x10'),auth['isAuthenticated'](),controller[_0x52ea('0x11')]);router[_0x52ea('0x8')](_0x52ea('0x12'),auth['isAuthenticated'](),controller[_0x52ea('0x13')]);router['get'](_0x52ea('0x14'),auth[_0x52ea('0x9')](),controller['getSmtp']);router[_0x52ea('0x8')](_0x52ea('0x15'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x16')]);router['get'](_0x52ea('0x17'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x18')]);router[_0x52ea('0x8')]('/:id/messages',auth[_0x52ea('0x9')](),controller[_0x52ea('0x19')]);router[_0x52ea('0x8')](_0x52ea('0x1a'),auth[_0x52ea('0x9')](),controller['verifySmtp']);router[_0x52ea('0x8')]('/:id/users',auth[_0x52ea('0x9')](),controller[_0x52ea('0x1b')]);router[_0x52ea('0x1c')]('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router[_0x52ea('0x1c')](_0x52ea('0x10'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x1d')]);router[_0x52ea('0x1c')]('/',auth[_0x52ea('0x9')](),controller[_0x52ea('0x1e')]);router[_0x52ea('0x1c')](_0x52ea('0x12'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x1f')]);router['post'](_0x52ea('0x14'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x20')]);router[_0x52ea('0x1c')]('/:id/interactions',auth[_0x52ea('0x9')](),controller['addInteraction']);router[_0x52ea('0x1c')](_0x52ea('0x17'),auth['isAuthenticated'](),controller['addApplications']);router[_0x52ea('0x1c')]('/:id/send',auth['isAuthenticated'](),controller[_0x52ea('0x21')]);router[_0x52ea('0x1c')]('/:id/users',auth['isAuthenticated'](),controller[_0x52ea('0x22')]);router['put']('/:id',auth[_0x52ea('0x9')](),controller[_0x52ea('0x23')]);router[_0x52ea('0x24')](_0x52ea('0xf'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0x52ea('0x24')]('/:id/canned_answers',auth[_0x52ea('0x9')](),controller[_0x52ea('0x25')]);router[_0x52ea('0x24')](_0x52ea('0x12'),auth[_0x52ea('0x9')](),controller['removeImap']);router[_0x52ea('0x24')]('/:id/out_servers',auth[_0x52ea('0x9')](),controller[_0x52ea('0x26')]);router[_0x52ea('0x24')](_0x52ea('0xd'),auth[_0x52ea('0x9')](),controller[_0x52ea('0x27')]);router['delete']('/:id/users',auth[_0x52ea('0x9')](),controller[_0x52ea('0x28')]);module['exports']=router; \ No newline at end of file +var _0x441f=['addDisposition','post','create','addSmtp','/:id/interactions','addApplications','/:id/send','send','addAgents','put','update','delete','removeAnswers','removeImap','destroy','removeAgents','multer','util','path','connect-timeout','Router','../../components/auth/service','./mailAccount.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap','/:id/out_servers','getSmtp','getInteractions','/:id/applications','/:id/messages','getMessages','/:id/verify','/:id/users','getAgents'];(function(_0x465dc3,_0x4a7447){var _0x204a3f=function(_0x4fb3f2){while(--_0x4fb3f2){_0x465dc3['push'](_0x465dc3['shift']());}};_0x204a3f(++_0x4a7447);}(_0x441f,0x1e9));var _0xf441=function(_0x810e4d,_0x909ef4){_0x810e4d=_0x810e4d-0x0;var _0x13f01c=_0x441f[_0x810e4d];return _0x13f01c;};'use strict';var multer=require(_0xf441('0x0'));var util=require(_0xf441('0x1'));var path=require(_0xf441('0x2'));var timeout=require(_0xf441('0x3'));var express=require('express');var router=express[_0xf441('0x4')]();var auth=require(_0xf441('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf441('0x6'));router[_0xf441('0x7')]('/',auth['isAuthenticated'](),controller[_0xf441('0x8')]);router['get'](_0xf441('0x9'),auth[_0xf441('0xa')](),controller[_0xf441('0xb')]);router[_0xf441('0x7')](_0xf441('0xc'),auth[_0xf441('0xa')](),controller['show']);router['get'](_0xf441('0xd'),auth[_0xf441('0xa')](),controller['getDispositions']);router[_0xf441('0x7')](_0xf441('0xe'),auth[_0xf441('0xa')](),controller[_0xf441('0xf')]);router[_0xf441('0x7')](_0xf441('0x10'),auth[_0xf441('0xa')](),controller[_0xf441('0x11')]);router[_0xf441('0x7')](_0xf441('0x12'),auth[_0xf441('0xa')](),controller[_0xf441('0x13')]);router[_0xf441('0x7')]('/:id/interactions',auth[_0xf441('0xa')](),controller[_0xf441('0x14')]);router[_0xf441('0x7')](_0xf441('0x15'),auth[_0xf441('0xa')](),controller['getApplications']);router[_0xf441('0x7')](_0xf441('0x16'),auth[_0xf441('0xa')](),controller[_0xf441('0x17')]);router[_0xf441('0x7')](_0xf441('0x18'),auth[_0xf441('0xa')](),controller['verifySmtp']);router[_0xf441('0x7')](_0xf441('0x19'),auth['isAuthenticated'](),controller[_0xf441('0x1a')]);router['post'](_0xf441('0xd'),auth[_0xf441('0xa')](),controller[_0xf441('0x1b')]);router[_0xf441('0x1c')](_0xf441('0xe'),auth[_0xf441('0xa')](),controller['addAnswer']);router[_0xf441('0x1c')]('/',auth[_0xf441('0xa')](),controller[_0xf441('0x1d')]);router[_0xf441('0x1c')](_0xf441('0x10'),auth['isAuthenticated'](),controller['addImap']);router[_0xf441('0x1c')]('/:id/out_servers',auth[_0xf441('0xa')](),controller[_0xf441('0x1e')]);router[_0xf441('0x1c')](_0xf441('0x1f'),auth['isAuthenticated'](),controller['addInteraction']);router[_0xf441('0x1c')](_0xf441('0x15'),auth[_0xf441('0xa')](),controller[_0xf441('0x20')]);router[_0xf441('0x1c')](_0xf441('0x21'),auth['isAuthenticated'](),controller[_0xf441('0x22')]);router[_0xf441('0x1c')](_0xf441('0x19'),auth['isAuthenticated'](),controller[_0xf441('0x23')]);router[_0xf441('0x24')]('/:id',auth[_0xf441('0xa')](),controller[_0xf441('0x25')]);router['delete'](_0xf441('0xd'),auth['isAuthenticated'](),controller['removeDispositions']);router[_0xf441('0x26')](_0xf441('0xe'),auth[_0xf441('0xa')](),controller[_0xf441('0x27')]);router[_0xf441('0x26')](_0xf441('0x10'),auth[_0xf441('0xa')](),controller[_0xf441('0x28')]);router['delete'](_0xf441('0x12'),auth[_0xf441('0xa')](),controller['removeSmtp']);router[_0xf441('0x26')]('/:id',auth[_0xf441('0xa')](),controller[_0xf441('0x29')]);router[_0xf441('0x26')](_0xf441('0x19'),auth['isAuthenticated'](),controller[_0xf441('0x2a')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 35323ad..07a1752 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 _0xc09a=['INTEGER','UNSIGNED','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif'];(function(_0x601d31,_0x2f1eba){var _0x2c710e=function(_0x4c9414){while(--_0x4c9414){_0x601d31['push'](_0x601d31['shift']());}};_0x2c710e(++_0x2f1eba);}(_0xc09a,0x14a));var _0xac09=function(_0x1a2a7f,_0x5111c6){_0x1a2a7f=_0x1a2a7f-0x0;var _0x241059=_0xc09a[_0x1a2a7f];return _0x241059;};'use strict';var Sequelize=require(_0xac09('0x0'));module[_0xac09('0x1')]={'description':{'type':Sequelize[_0xac09('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0xac09('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xac09('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'key':{'type':Sequelize[_0xac09('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0xac09('0x4')]},'markAsUnread':{'type':Sequelize[_0xac09('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0xac09('0x2')],'allowNull':![],'defaultValue':_0xac09('0x5')},'fontSize':{'type':Sequelize[_0xac09('0x6')](0x2)[_0xac09('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0xac09('0x4')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}';}},'notificationSound':{'type':Sequelize[_0xac09('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xac09('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xac09('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0xac09('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0xac09('0x6')],'allowNull':!![],'defaultValue':null,'comment':_0xac09('0x8')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xf15641){if(!_0xf15641)this[_0xac09('0x9')](_0xac09('0xa'),null);this['setDataValue'](_0xac09('0xb'),_0xf15641);}}}; \ No newline at end of file +var _0x3800=['mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue'];(function(_0x33d138,_0xe77cd6){var _0x1c7aa0=function(_0x385b58){while(--_0x385b58){_0x33d138['push'](_0x33d138['shift']());}};_0x1c7aa0(++_0xe77cd6);}(_0x3800,0x1b4));var _0x0380=function(_0x2ad169,_0x2f65f3){_0x2ad169=_0x2ad169-0x0;var _0x51e9f9=_0x3800[_0x2ad169];return _0x51e9f9;};'use strict';var Sequelize=require(_0x0380('0x0'));module[_0x0380('0x1')]={'description':{'type':Sequelize[_0x0380('0x2')]},'name':{'type':Sequelize['STRING'],'allowNull':![]},'service':{'type':Sequelize[_0x0380('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x0380('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x0380('0x3')],'defaultValue':!![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'template':{'type':Sequelize[_0x0380('0x4')]},'markAsUnread':{'type':Sequelize[_0x0380('0x3')],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x0380('0x2')],'allowNull':![],'defaultValue':_0x0380('0x5')},'fontSize':{'type':Sequelize[_0x0380('0x6')](0x2)[_0x0380('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x0380('0x4')],'defaultValue':function(){return _0x0380('0x8');}},'notificationSound':{'type':Sequelize[_0x0380('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x0380('0x3')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x0380('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x0380('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x0380('0x3')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x0380('0x9')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':_0x0380('0xa'),'set':function(_0x3363d8){if(!_0x3363d8)this[_0x0380('0xb')](_0x0380('0xc'),null);this[_0x0380('0xb')](_0x0380('0xd'),_0x3363d8);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 878e487..440eed0 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 _0x1c75=['moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailAccount.socket','register','jayson/promise','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','MailServerIn','Imap','Smtp','Pause','mandatoryDispositionPause','MailAccount','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','show','params','MailServerOut','rawAttributes','options','body','addDisposition','MailAccountId','Disposition','create','find','removeDispositions','ids','addAnswer','CannedAnswer','findOne','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','cpassword','authentication','host','port','service','pass','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','MailAccounts','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','CmContact','Contact','User','Owner','fullname','internal','Tag','Tags','color','tag','sequelize','MailApplication','bulkCreate','findAndCountAll','priority','getApplications','MailMessage','$gte','split','format','YYYY-MM-DD\x20HH:mm:ss','CmList','List','updatedAt','DESC','from','%s\x20<%s>','attachments','root','basename','auth','secure','SendMail','Contacts','List\x20not\x20found','messageId','subject','out','Interaction','Messages','verifySmtp','VerifySmtp','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','spread','removeAgents','isArray','emit','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','request-promise'];(function(_0x469218,_0x440d05){var _0x187b4a=function(_0x72ec86){while(--_0x72ec86){_0x469218['push'](_0x469218['shift']());}};_0x187b4a(++_0x440d05);}(_0x1c75,0xc0));var _0x51c7=function(_0x5a95fa,_0x4a2fc9){_0x5a95fa=_0x5a95fa-0x0;var _0x1a61b8=_0x1c75[_0x5a95fa];return _0x1a61b8;};'use strict';var pdf=require(_0x51c7('0x0'));var emlformat=require(_0x51c7('0x1'));var rimraf=require(_0x51c7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x51c7('0x3'));var moment=require(_0x51c7('0x4'));var BPromise=require(_0x51c7('0x5'));var Mustache=require(_0x51c7('0x6'));var util=require(_0x51c7('0x7'));var path=require(_0x51c7('0x8'));var sox=require(_0x51c7('0x9'));var csv=require(_0x51c7('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x51c7('0xb'));var squel=require(_0x51c7('0xc'));var crypto=require(_0x51c7('0xd'));var jsforce=require(_0x51c7('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x51c7('0xa'));var querystring=require(_0x51c7('0xf'));var Papa=require(_0x51c7('0x10'));var Redis=require(_0x51c7('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x51c7('0x12'));var as=require(_0x51c7('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x51c7('0x14'));var utils=require(_0x51c7('0x15'));var config=require(_0x51c7('0x16'));var db=require(_0x51c7('0x17'))['db'];config['redis']=_[_0x51c7('0x18')](config[_0x51c7('0x19')],{'host':_0x51c7('0x1a'),'port':0x18eb});var socket=require(_0x51c7('0x1b'))(new Redis(config['redis']));require(_0x51c7('0x1c'))[_0x51c7('0x1d')](socket);var jayson=require(_0x51c7('0x1e'));var client=jayson[_0x51c7('0x1f')][_0x51c7('0x20')]({'port':0x232b});function checkPasswordPattern(_0x235044,_0x4c4ecc,_0x3b88da){if(_0x3b88da){var _0x1a03bf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a03bf[_0x51c7('0x21')](_0x4c4ecc)){return _0x235044;}else{throw new db[(_0x51c7('0x22'))]['ValidationError'](_0x51c7('0x23'));}}else{return _0x235044;}}function respondWithRpcPromise(_0x5b3e9a,_0x22c8d9,_0x1a2219,_0x5122ac){return new BPromise(function(_0x15c931,_0x29368a){var _0x453593=_0x5122ac||client;return _0x453593[_0x51c7('0x24')](_0x5b3e9a,_0x1a2219)[_0x51c7('0x25')](function(_0x2e21f2){logger[_0x51c7('0x26')](_0x51c7('0x27'),_0x22c8d9,'request\x20sent');logger[_0x51c7('0x28')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x22c8d9,'request\x20sent',JSON[_0x51c7('0x29')](_0x2e21f2));if(_0x2e21f2[_0x51c7('0x2a')]){if(_0x2e21f2[_0x51c7('0x2a')][_0x51c7('0x2b')]===0x1f4){logger[_0x51c7('0x2a')]('MailAccount,\x20%s,\x20%s',_0x22c8d9,_0x2e21f2[_0x51c7('0x2a')]['message']);return _0x29368a(_0x2e21f2[_0x51c7('0x2a')][_0x51c7('0x2c')]);}logger[_0x51c7('0x2a')](_0x51c7('0x27'),_0x22c8d9,_0x2e21f2[_0x51c7('0x2a')][_0x51c7('0x2c')]);return _0x15c931(_0x2e21f2[_0x51c7('0x2a')][_0x51c7('0x2c')]);}else{logger['info'](_0x51c7('0x27'),_0x22c8d9,_0x51c7('0x2d'));_0x15c931(_0x2e21f2[_0x51c7('0x2e')][_0x51c7('0x2c')]);}})[_0x51c7('0x2f')](function(_0x121382){logger['error'](_0x51c7('0x27'),_0x22c8d9,_0x121382);_0x29368a(_0x121382);});});}function respondWithStatusCode(_0x51c499,_0x1f3498){_0x1f3498=_0x1f3498||0xcc;return function(_0x20016a){if(_0x20016a){return _0x51c499[_0x51c7('0x30')](_0x1f3498);}return _0x51c499[_0x51c7('0x31')](_0x1f3498)[_0x51c7('0x32')]();};}function respondWithResult(_0x3d857a,_0x38156e){_0x38156e=_0x38156e||0xc8;return function(_0x19f54f){if(_0x19f54f){return _0x3d857a[_0x51c7('0x31')](_0x38156e)[_0x51c7('0x33')](_0x19f54f);}};}function respondWithFilteredResult(_0x403212,_0x324dd7){return function(_0x3da02f){if(_0x3da02f){var _0xe8365a=_0x3da02f[_0x51c7('0x34')],_0x3e99a8=_0x324dd7['offset'],_0x5e6e21=_0x324dd7[_0x51c7('0x35')]+_0x324dd7[_0x51c7('0x36')],_0x39f672;if(_0x5e6e21>=_0xe8365a){_0x5e6e21=_0xe8365a;_0x39f672=0xc8;}else{_0x39f672=0xce;}_0x403212['status'](_0x39f672);return _0x403212[_0x51c7('0x37')](_0x51c7('0x38'),_0x3e99a8+'-'+_0x5e6e21+'/'+_0xe8365a)[_0x51c7('0x33')](_0x3da02f);}return null;};}function patchUpdates(_0x58ce39){return function(_0x5b4c64){try{jsonpatch[_0x51c7('0x39')](_0x5b4c64,_0x58ce39,!![]);}catch(_0x4b579e){return BPromise[_0x51c7('0x3a')](_0x4b579e);}return _0x5b4c64[_0x51c7('0x3b')]();};}function saveUpdates(_0x40a9c3,_0x10abd8){return function(_0x47f9c7){if(_0x47f9c7){return _0x47f9c7[_0x51c7('0x3c')](_0x40a9c3)[_0x51c7('0x25')](function(_0x841f10){return _0x841f10;});}return null;};}function removeEntity(_0x32c5bf,_0x45440e){return function(_0x200032){if(_0x200032){return _0x200032[_0x51c7('0x3d')]()['then'](function(){var _0x4abb3a=_0x200032['get']({'plain':!![]});var _0x49303c='MailAccounts';return db['UserProfileResource']['destroy']({'where':{'type':_0x49303c,'resourceId':_0x4abb3a['id']}})[_0x51c7('0x25')](function(){return _0x200032;});})['then'](function(){_0x32c5bf[_0x51c7('0x31')](0xcc)[_0x51c7('0x32')]();});}};}function handleEntityNotFound(_0x59dd50,_0x28f487){return function(_0x502d61){if(!_0x502d61){_0x59dd50['sendStatus'](0x194);}return _0x502d61;};}function handleError(_0x2ba75f,_0x2940c4){_0x2940c4=_0x2940c4||0x1f4;return function(_0x13de03){logger['error'](_0x13de03[_0x51c7('0x3e')]);if(_0x13de03['name']){delete _0x13de03[_0x51c7('0x3f')];}_0x2ba75f[_0x51c7('0x31')](_0x2940c4)[_0x51c7('0x40')](_0x13de03);};}exports['index']=function(_0x593854,_0x24a8e5){var _0x305468={'include':[{'model':db[_0x51c7('0x41')],'as':_0x51c7('0x42')},{'model':db['MailServerOut'],'as':_0x51c7('0x43')},{'model':db[_0x51c7('0x44')],'as':_0x51c7('0x45')}]},_0x482d08={},_0x4ab876={'count':0x0,'rows':[]};var _0x2d41ee=_['map'](db[_0x51c7('0x46')]['rawAttributes'],function(_0x48267c){return{'name':_0x48267c['fieldName'],'type':_0x48267c[_0x51c7('0x47')][_0x51c7('0x48')]};});_0x482d08[_0x51c7('0x49')]=_[_0x51c7('0x4a')](_0x2d41ee,_0x51c7('0x3f'));_0x482d08[_0x51c7('0x4b')]=_[_0x51c7('0x4c')](_0x593854['query']);_0x482d08[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0x482d08['model'],_0x482d08[_0x51c7('0x4b')]);_0x305468[_0x51c7('0x4f')]=_['intersection'](_0x482d08['model'],qs['fields'](_0x593854[_0x51c7('0x4b')][_0x51c7('0x50')]));_0x305468[_0x51c7('0x4f')]=_0x305468['attributes'][_0x51c7('0x51')]?_0x305468[_0x51c7('0x4f')]:_0x482d08['model'];if(!_0x593854[_0x51c7('0x4b')][_0x51c7('0x52')](_0x51c7('0x53'))){_0x305468[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0x593854[_0x51c7('0x4b')][_0x51c7('0x36')]);_0x305468[_0x51c7('0x35')]=qs[_0x51c7('0x35')](_0x593854['query'][_0x51c7('0x35')]);}_0x305468[_0x51c7('0x54')]=qs[_0x51c7('0x55')](_0x593854[_0x51c7('0x4b')]['sort']);_0x305468[_0x51c7('0x56')]=qs[_0x51c7('0x4d')](_[_0x51c7('0x57')](_0x593854['query'],_0x482d08[_0x51c7('0x4d')]));if(_0x593854[_0x51c7('0x4b')][_0x51c7('0x58')]){_0x305468['where']=_[_0x51c7('0x59')](_0x305468[_0x51c7('0x56')],{'$or':_['map'](_0x2d41ee,function(_0x3cc1ce){if(_0x3cc1ce[_0x51c7('0x47')]!=='VIRTUAL'){var _0x1cde2d={};_0x1cde2d[_0x3cc1ce['name']]={'$like':'%'+_0x593854[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x1cde2d;}})});}_0x305468=_['merge']({},_0x305468,_0x593854['options']);var _0x4ac546={'where':_0x305468['where']};return db[_0x51c7('0x46')]['count'](_0x4ac546)[_0x51c7('0x25')](function(_0x8d7271){_0x4ab876[_0x51c7('0x34')]=_0x8d7271;if(_0x593854[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x305468[_0x51c7('0x5b')]=[{'all':!![]}];}return db[_0x51c7('0x46')][_0x51c7('0x5c')](_0x305468);})['then'](function(_0x47ff59){_0x4ab876[_0x51c7('0x5d')]=_0x47ff59;return _0x4ab876;})[_0x51c7('0x25')](respondWithFilteredResult(_0x24a8e5,_0x305468))[_0x51c7('0x2f')](handleError(_0x24a8e5,null));};exports[_0x51c7('0x5e')]=function(_0x3be26f,_0x2e8eee){var _0x1d924b={'raw':![],'where':{'id':_0x3be26f[_0x51c7('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x51c7('0x60')],'as':_0x51c7('0x43')},{'model':db[_0x51c7('0x44')],'as':'mandatoryDispositionPause'}]},_0x920e80={};_0x920e80[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db[_0x51c7('0x46')][_0x51c7('0x61')]);_0x920e80[_0x51c7('0x4b')]=_['keys'](_0x3be26f[_0x51c7('0x4b')]);_0x920e80[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0x920e80[_0x51c7('0x49')],_0x920e80['query']);_0x1d924b[_0x51c7('0x4f')]=_[_0x51c7('0x4e')](_0x920e80[_0x51c7('0x49')],qs[_0x51c7('0x50')](_0x3be26f[_0x51c7('0x4b')]['fields']));_0x1d924b[_0x51c7('0x4f')]=_0x1d924b['attributes']['length']?_0x1d924b[_0x51c7('0x4f')]:_0x920e80[_0x51c7('0x49')];if(_0x3be26f[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x1d924b['include']=[{'all':!![]}];}_0x1d924b=_[_0x51c7('0x59')]({},_0x1d924b,_0x3be26f[_0x51c7('0x62')]);return db['MailAccount']['find'](_0x1d924b)[_0x51c7('0x25')](handleEntityNotFound(_0x2e8eee,null))[_0x51c7('0x25')](respondWithResult(_0x2e8eee,null))['catch'](handleError(_0x2e8eee,null));};exports[_0x51c7('0x3c')]=function(_0x5daa48,_0x5ac0ef){if(_0x5daa48[_0x51c7('0x63')]['id']){delete _0x5daa48['body']['id'];}return db['MailAccount']['find']({'where':{'id':_0x5daa48[_0x51c7('0x5f')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db[_0x51c7('0x60')],'as':_0x51c7('0x43')},{'model':db[_0x51c7('0x44')],'as':_0x51c7('0x45')}]})[_0x51c7('0x25')](handleEntityNotFound(_0x5ac0ef,null))['then'](saveUpdates(_0x5daa48[_0x51c7('0x63')],null))['then'](function(_0x198ea6){if(_0x198ea6&&_0x5daa48[_0x51c7('0x63')]['Imap']){return db['MailServerIn'][_0x51c7('0x3c')](_0x5daa48['body'][_0x51c7('0x42')],{'where':{'MailAccountId':_0x198ea6['id']}})[_0x51c7('0x25')](function(){return _0x198ea6;});}return _0x198ea6;})[_0x51c7('0x25')](function(_0x3c1447){if(_0x3c1447&&_0x5daa48[_0x51c7('0x63')][_0x51c7('0x43')]){return db['MailServerOut'][_0x51c7('0x3c')](_0x5daa48[_0x51c7('0x63')]['Smtp'],{'where':{'MailAccountId':_0x3c1447['id']}})[_0x51c7('0x25')](function(){return _0x3c1447;});}return _0x3c1447;})[_0x51c7('0x25')](respondWithResult(_0x5ac0ef,null))['catch'](handleError(_0x5ac0ef,null));};exports['describe']=function(_0x2d2878,_0x1bc2db){return db[_0x51c7('0x46')]['describe']()['then'](respondWithResult(_0x1bc2db,null))['catch'](handleError(_0x1bc2db,null));};exports[_0x51c7('0x64')]=function(_0x2638a5,_0x5b6aff,_0x186b9c){if(_0x2638a5[_0x51c7('0x63')]['id']){delete _0x2638a5['body']['id'];}return db[_0x51c7('0x46')]['find']({'where':{'id':_0x2638a5[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x5b6aff,null))['then'](function(_0x3e4747){if(_0x3e4747){_0x2638a5[_0x51c7('0x63')][_0x51c7('0x65')]=_0x3e4747['id'];return db[_0x51c7('0x66')][_0x51c7('0x67')](_0x2638a5['body']);}})['then'](respondWithResult(_0x5b6aff,null))['catch'](handleError(_0x5b6aff,null));};exports['getDispositions']=function(_0x37ad58,_0x1a6c93,_0x2214d0){var _0x56e9e2={'raw':![],'where':{}};var _0x2aeda4={};var _0x3f15b6={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x37ad58[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x1a6c93,null))[_0x51c7('0x25')](function(_0x5d8328){if(_0x5d8328){_0x2aeda4[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db[_0x51c7('0x66')][_0x51c7('0x61')]);_0x2aeda4['query']=_[_0x51c7('0x4c')](_0x37ad58[_0x51c7('0x4b')]);_0x2aeda4[_0x51c7('0x4d')]=_['intersection'](_0x2aeda4[_0x51c7('0x49')],_0x2aeda4['query']);_0x56e9e2['attributes']=_['intersection'](_0x2aeda4['model'],qs[_0x51c7('0x50')](_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x50')]));_0x56e9e2[_0x51c7('0x4f')]=_0x56e9e2[_0x51c7('0x4f')][_0x51c7('0x51')]?_0x56e9e2[_0x51c7('0x4f')]:_0x2aeda4[_0x51c7('0x49')];if(!_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x52')](_0x51c7('0x53'))){_0x56e9e2[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x36')]);_0x56e9e2[_0x51c7('0x35')]=qs[_0x51c7('0x35')](_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x35')]);}_0x56e9e2[_0x51c7('0x54')]=qs['sort'](_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x55')]);_0x56e9e2[_0x51c7('0x56')]=qs['filters'](_[_0x51c7('0x57')](_0x37ad58[_0x51c7('0x4b')],_0x2aeda4[_0x51c7('0x4d')]));_0x56e9e2['where'][_0x51c7('0x65')]=_0x5d8328['id'];if(_0x37ad58['query'][_0x51c7('0x58')]){_0x56e9e2[_0x51c7('0x56')]=_['merge'](_0x56e9e2[_0x51c7('0x56')],{'$or':_[_0x51c7('0x4a')](_0x56e9e2[_0x51c7('0x4f')],function(_0x299d19){var _0x54340f={};_0x54340f[_0x299d19]={'$like':'%'+_0x37ad58['query'][_0x51c7('0x58')]+'%'};return _0x54340f;})});}_0x56e9e2=_[_0x51c7('0x59')]({},_0x56e9e2,_0x37ad58[_0x51c7('0x62')]);return db['Disposition'][_0x51c7('0x34')]({'where':_0x56e9e2[_0x51c7('0x56')]})['then'](function(_0x4c1384){_0x3f15b6[_0x51c7('0x34')]=_0x4c1384;if(_0x37ad58[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x56e9e2['include']=[{'all':!![]}];}return db[_0x51c7('0x66')]['findAll'](_0x56e9e2);})['then'](function(_0x12a1ed){_0x3f15b6[_0x51c7('0x5d')]=_0x12a1ed;return _0x3f15b6;});}})[_0x51c7('0x25')](respondWithFilteredResult(_0x1a6c93,_0x56e9e2))[_0x51c7('0x2f')](handleError(_0x1a6c93,null));};exports['removeDispositions']=function(_0x34f458,_0x5ca30d,_0x4ee888){return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x34f458[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x5ca30d,null))[_0x51c7('0x25')](function(_0x431fb3){if(_0x431fb3){return _0x431fb3[_0x51c7('0x69')](_0x34f458[_0x51c7('0x4b')][_0x51c7('0x6a')]);}})[_0x51c7('0x25')](respondWithStatusCode(_0x5ca30d,null))[_0x51c7('0x2f')](handleError(_0x5ca30d,null));};exports[_0x51c7('0x6b')]=function(_0x4cd8d0,_0x3be7da,_0x4784c4){if(_0x4cd8d0[_0x51c7('0x63')]['id']){delete _0x4cd8d0['body']['id'];}return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x4cd8d0['params']['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x3be7da,null))[_0x51c7('0x25')](function(_0x4362bc){if(_0x4362bc){_0x4cd8d0[_0x51c7('0x63')]['MailAccountId']=_0x4362bc['id'];return db[_0x51c7('0x6c')][_0x51c7('0x67')](_0x4cd8d0[_0x51c7('0x63')]);}})[_0x51c7('0x25')](respondWithResult(_0x3be7da,null))[_0x51c7('0x2f')](handleError(_0x3be7da,null));};exports['getAnswers']=function(_0xcd0cab,_0x8390f9,_0x16f00c){var _0x10811a={'raw':![],'where':{}};var _0x5c1e6b={};var _0x4d485b={'count':0x0,'rows':[]};return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0xcd0cab[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x8390f9,null))[_0x51c7('0x25')](function(_0x4b0144){if(_0x4b0144){_0x5c1e6b['model']=_[_0x51c7('0x4c')](db[_0x51c7('0x6c')][_0x51c7('0x61')]);_0x5c1e6b[_0x51c7('0x4b')]=_['keys'](_0xcd0cab[_0x51c7('0x4b')]);_0x5c1e6b[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0x5c1e6b[_0x51c7('0x49')],_0x5c1e6b[_0x51c7('0x4b')]);_0x10811a['attributes']=_[_0x51c7('0x4e')](_0x5c1e6b[_0x51c7('0x49')],qs[_0x51c7('0x50')](_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x50')]));_0x10811a[_0x51c7('0x4f')]=_0x10811a[_0x51c7('0x4f')][_0x51c7('0x51')]?_0x10811a[_0x51c7('0x4f')]:_0x5c1e6b['model'];if(!_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x52')](_0x51c7('0x53'))){_0x10811a[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x36')]);_0x10811a['offset']=qs['offset'](_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x35')]);}_0x10811a[_0x51c7('0x54')]=qs[_0x51c7('0x55')](_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x55')]);_0x10811a[_0x51c7('0x56')]=qs[_0x51c7('0x4d')](_['pick'](_0xcd0cab[_0x51c7('0x4b')],_0x5c1e6b[_0x51c7('0x4d')]));_0x10811a['where'][_0x51c7('0x65')]=_0x4b0144['id'];if(_0xcd0cab['query'][_0x51c7('0x58')]){_0x10811a[_0x51c7('0x56')]=_[_0x51c7('0x59')](_0x10811a[_0x51c7('0x56')],{'$or':_['map'](_0x10811a[_0x51c7('0x4f')],function(_0x48c55e){var _0x273058={};_0x273058[_0x48c55e]={'$like':'%'+_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x273058;})});}_0x10811a=_[_0x51c7('0x59')]({},_0x10811a,_0xcd0cab[_0x51c7('0x62')]);return db[_0x51c7('0x6c')]['count']({'where':_0x10811a[_0x51c7('0x56')]})[_0x51c7('0x25')](function(_0x29a9db){_0x4d485b['count']=_0x29a9db;if(_0xcd0cab[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x10811a[_0x51c7('0x5b')]=[{'all':!![]}];}return db[_0x51c7('0x6c')][_0x51c7('0x5c')](_0x10811a);})[_0x51c7('0x25')](function(_0xfd8245){_0x4d485b[_0x51c7('0x5d')]=_0xfd8245;return _0x4d485b;});}})['then'](respondWithFilteredResult(_0x8390f9,_0x10811a))[_0x51c7('0x2f')](handleError(_0x8390f9,null));};exports['removeAnswers']=function(_0x16e453,_0x4ecefc,_0x32bb40){return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x16e453['params']['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x4ecefc,null))['then'](function(_0x108bd2){if(_0x108bd2){return _0x108bd2['removeAnswers'](_0x16e453[_0x51c7('0x4b')]['ids']);}})['then'](respondWithStatusCode(_0x4ecefc,null))['catch'](handleError(_0x4ecefc,null));};exports['create']=function(_0x356521,_0xf2deb7){var _0x1348ab={'name':_0x356521[_0x51c7('0x63')][_0x51c7('0x3f')],'key':_0x356521[_0x51c7('0x63')][_0x51c7('0x48')],'email':_0x356521[_0x51c7('0x63')][_0x51c7('0x6e')],'ListId':_0x356521[_0x51c7('0x63')][_0x51c7('0x6f')],'active':!_[_0x51c7('0x70')](_0x356521['body'][_0x51c7('0x71')])?_0x356521[_0x51c7('0x63')][_0x51c7('0x71')]:!![],'description':_0x356521[_0x51c7('0x63')][_0x51c7('0x72')]||null,'Imap':{},'Smtp':{}};if(_[_0x51c7('0x70')](_0x356521[_0x51c7('0x63')][_0x51c7('0x73')])){if(_0x356521[_0x51c7('0x63')][_0x51c7('0x74')]){_0x1348ab[_0x51c7('0x42')][_0x51c7('0x75')]=_0x1348ab['Smtp'][_0x51c7('0x75')]=_0x356521[_0x51c7('0x63')][_0x51c7('0x76')];_0x1348ab[_0x51c7('0x42')][_0x51c7('0x77')]=_0x1348ab[_0x51c7('0x43')]['pass']=_0x356521[_0x51c7('0x63')][_0x51c7('0x78')];}else{_0x1348ab[_0x51c7('0x42')][_0x51c7('0x79')]=_0x1348ab[_0x51c7('0x43')][_0x51c7('0x79')]=![];}_0x1348ab[_0x51c7('0x42')]['host']=_0x356521['body'][_0x51c7('0x42')][_0x51c7('0x7a')];_0x1348ab[_0x51c7('0x42')][_0x51c7('0x7b')]=_0x356521[_0x51c7('0x63')]['Imap'][_0x51c7('0x7b')];_0x1348ab[_0x51c7('0x43')]['host']=_0x356521['body'][_0x51c7('0x43')][_0x51c7('0x7a')];_0x1348ab[_0x51c7('0x43')][_0x51c7('0x7b')]=_0x356521[_0x51c7('0x63')]['Smtp'][_0x51c7('0x7b')];}else{_0x1348ab[_0x51c7('0x42')][_0x51c7('0x7c')]=_0x1348ab[_0x51c7('0x43')]['service']=_0x356521[_0x51c7('0x63')][_0x51c7('0x73')];_0x1348ab['Imap'][_0x51c7('0x75')]=_0x1348ab[_0x51c7('0x43')][_0x51c7('0x75')]=_0x356521[_0x51c7('0x63')]['cuser'];_0x1348ab['Imap'][_0x51c7('0x77')]=_0x1348ab['Smtp'][_0x51c7('0x7d')]=_0x356521[_0x51c7('0x63')][_0x51c7('0x78')];}return db[_0x51c7('0x46')][_0x51c7('0x67')](_0x1348ab,{'include':[{'model':db['MailServerOut'],'as':_0x51c7('0x43')},{'model':db[_0x51c7('0x41')],'as':_0x51c7('0x42')}]})[_0x51c7('0x25')](function(_0x2347fa){var _0x2b3d1f=_0x356521[_0x51c7('0x75')][_0x51c7('0x7e')]({'plain':!![]});if(!_0x2b3d1f)throw new Error(_0x51c7('0x7f'));if(_0x2b3d1f['role']===_0x51c7('0x75')){var _0x2e4c81=_0x2347fa[_0x51c7('0x7e')]({'plain':!![]});return db[_0x51c7('0x80')][_0x51c7('0x68')]({'where':{'name':_0x51c7('0x81'),'userProfileId':_0x2b3d1f[_0x51c7('0x82')]},'raw':!![]})[_0x51c7('0x25')](function(_0x26880a){if(_0x26880a&&_0x26880a['autoAssociation']===0x0){return db[_0x51c7('0x83')]['create']({'name':_0x2e4c81[_0x51c7('0x3f')],'resourceId':_0x2e4c81['id'],'type':_0x26880a[_0x51c7('0x3f')],'sectionId':_0x26880a['id']},{})[_0x51c7('0x25')](function(){return _0x2347fa;});}else{return _0x2347fa;}})[_0x51c7('0x2f')](function(_0x342778){logger[_0x51c7('0x2a')](_0x51c7('0x84'),_0x342778);throw _0x342778;});}return _0x2347fa;})[_0x51c7('0x25')](respondWithResult(_0xf2deb7,0xc9))[_0x51c7('0x2f')](handleError(_0xf2deb7,null));};exports[_0x51c7('0x85')]=function(_0x53a7d2,_0x585f77,_0x3278b9){return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x53a7d2['params']['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x585f77,null))[_0x51c7('0x25')](function(_0x538b95){if(_0x538b95){return _0x538b95[_0x51c7('0x85')]();}return null;})['then'](respondWithResult(_0x585f77,null))[_0x51c7('0x2f')](handleError(_0x585f77,null));};exports[_0x51c7('0x86')]=function(_0x339cec,_0x2b3192,_0x1f3e87){if(_0x339cec[_0x51c7('0x63')]['id']){delete _0x339cec[_0x51c7('0x63')]['id'];}return db['MailAccount'][_0x51c7('0x68')]({'where':{'id':_0x339cec[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x2b3192,null))[_0x51c7('0x25')](function(_0x83da70){if(_0x83da70){_0x339cec[_0x51c7('0x63')][_0x51c7('0x65')]=_0x83da70['id'];return db[_0x51c7('0x41')][_0x51c7('0x67')](_0x339cec['body']);}})[_0x51c7('0x25')](respondWithResult(_0x2b3192,null))[_0x51c7('0x2f')](handleError(_0x2b3192,null));};exports[_0x51c7('0x87')]=function(_0x324730,_0x4d44ed,_0x5464af){return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x324730[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x4d44ed,null))[_0x51c7('0x25')](function(_0x12125d){if(_0x12125d){return _0x12125d[_0x51c7('0x88')](null);}return null;})[_0x51c7('0x25')](respondWithStatusCode(_0x4d44ed,null))['catch'](handleError(_0x4d44ed,null));};exports['getSmtp']=function(_0x475577,_0x4277fb,_0x2983a0){return db['MailAccount']['findOne']({'where':{'id':_0x475577[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x4277fb,null))[_0x51c7('0x25')](function(_0x170516){if(_0x170516){return _0x170516[_0x51c7('0x89')]();}return null;})[_0x51c7('0x25')](respondWithResult(_0x4277fb,null))[_0x51c7('0x2f')](handleError(_0x4277fb,null));};exports[_0x51c7('0x8a')]=function(_0x13dc25,_0x30ad75,_0x3ed7fe){if(_0x13dc25['body']['id']){delete _0x13dc25[_0x51c7('0x63')]['id'];}return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x13dc25[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x30ad75,null))[_0x51c7('0x25')](function(_0x59605f){if(_0x59605f){_0x13dc25[_0x51c7('0x63')]['MailAccountId']=_0x59605f['id'];return db[_0x51c7('0x60')][_0x51c7('0x67')](_0x13dc25[_0x51c7('0x63')]);}})[_0x51c7('0x25')](respondWithResult(_0x30ad75,null))['catch'](handleError(_0x30ad75,null));};exports[_0x51c7('0x8b')]=function(_0x5e237b,_0x2cd419,_0x32ccde){return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x5e237b[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x2cd419,null))[_0x51c7('0x25')](function(_0x58b7ce){if(_0x58b7ce){return _0x58b7ce[_0x51c7('0x8c')](null);}return null;})['then'](respondWithStatusCode(_0x2cd419,null))['catch'](handleError(_0x2cd419,null));};exports[_0x51c7('0x8d')]=function(_0x34905c,_0x16e9ba,_0x26f51b){return db[_0x51c7('0x8e')][_0x51c7('0x68')]({'where':{'id':_0x34905c[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x16e9ba,null))[_0x51c7('0x25')](function(_0x5c3172){if(_0x5c3172){return _0x5c3172[_0x51c7('0x8d')](_0x34905c[_0x51c7('0x63')]['ids'],_[_0x51c7('0x8f')](_0x34905c[_0x51c7('0x63')],['ids','id'])||{});}})[_0x51c7('0x25')](respondWithResult(_0x16e9ba,null))['catch'](handleError(_0x16e9ba,null));};exports[_0x51c7('0x90')]=function(_0x3d536a,_0x435d5e,_0x269292){var _0x56e638={'raw':![],'where':{}};var _0x398baf={};var _0x129aa4={'count':0x0,'rows':[]};return db[_0x51c7('0x46')]['findOne']({'where':{'id':_0x3d536a[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x435d5e,null))['then'](function(_0x484a2d){if(_0x484a2d){_0x398baf[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db['MailInteraction'][_0x51c7('0x61')]);_0x398baf[_0x51c7('0x4b')]=_[_0x51c7('0x4c')](_0x3d536a[_0x51c7('0x4b')]);_0x398baf[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0x398baf['model'],_0x398baf[_0x51c7('0x4b')]);_0x56e638[_0x51c7('0x4f')]=_[_0x51c7('0x4e')](_0x398baf[_0x51c7('0x49')],qs[_0x51c7('0x50')](_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x50')]));_0x56e638[_0x51c7('0x4f')]=_0x56e638[_0x51c7('0x4f')][_0x51c7('0x51')]?_0x56e638[_0x51c7('0x4f')]:_0x398baf[_0x51c7('0x49')];if(!_0x3d536a['query'][_0x51c7('0x52')](_0x51c7('0x53'))){_0x56e638[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x36')]);_0x56e638[_0x51c7('0x35')]=qs[_0x51c7('0x35')](_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x35')]);}_0x56e638['order']=qs[_0x51c7('0x55')](_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x55')]);_0x56e638['where']=qs['filters'](_[_0x51c7('0x57')](_0x3d536a[_0x51c7('0x4b')],_0x398baf[_0x51c7('0x4d')]));_0x56e638[_0x51c7('0x56')]['MailAccountId']=_0x484a2d['id'];if(_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x58')]){_0x56e638[_0x51c7('0x56')]=_[_0x51c7('0x59')](_0x56e638[_0x51c7('0x56')],{'$or':_[_0x51c7('0x4a')](_0x56e638[_0x51c7('0x4f')],function(_0x57de0d){var _0x4c25ac={};_0x4c25ac[_0x57de0d]={'$like':'%'+_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x4c25ac;})});}_0x56e638=_[_0x51c7('0x59')]({},_0x56e638,_0x3d536a[_0x51c7('0x62')]);return db[_0x51c7('0x8e')]['count']({'where':_0x56e638[_0x51c7('0x56')]})[_0x51c7('0x25')](function(_0x58116e){_0x129aa4[_0x51c7('0x34')]=_0x58116e;if(_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x56e638['include']=[{'model':db[_0x51c7('0x91')],'as':_0x51c7('0x92'),'required':![]},{'model':db[_0x51c7('0x93')],'as':_0x51c7('0x94'),'attributes':[_0x51c7('0x3f'),_0x51c7('0x95'),_0x51c7('0x96')],'required':![]},{'model':db[_0x51c7('0x97')],'as':_0x51c7('0x98'),'attributes':['id',_0x51c7('0x3f'),_0x51c7('0x99')],'where':_0x3d536a['query'][_0x51c7('0x9a')]?{'id':_0x3d536a['query']['tag']}:undefined,'required':_0x3d536a[_0x51c7('0x4b')][_0x51c7('0x9a')]?!![]:![]}];}return db[_0x51c7('0x8e')][_0x51c7('0x5c')](_0x56e638);})[_0x51c7('0x25')](function(_0xb78536){_0x129aa4[_0x51c7('0x5d')]=_0xb78536;return _0x129aa4;});}})[_0x51c7('0x25')](respondWithFilteredResult(_0x435d5e,_0x56e638))['catch'](handleError(_0x435d5e,null));};exports['addApplications']=function(_0x1c0ce8,_0x306354,_0x1a7ef3){return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x1c0ce8[_0x51c7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x306354,null))[_0x51c7('0x25')](function(_0x6bd06e){if(_0x6bd06e){return db[_0x51c7('0x9b')]['transaction'](function(_0x34c6c4){return db['MailApplication'][_0x51c7('0x3d')]({'where':{'MailAccountId':_0x1c0ce8['params']['id']},'transaction':_0x34c6c4})[_0x51c7('0x25')](function(_0x31fa24){var _0x448788=_[_0x51c7('0x4a')](_0x1c0ce8[_0x51c7('0x63')],function(_0x292940){_0x292940[_0x51c7('0x65')]=_0x1c0ce8[_0x51c7('0x5f')]['id'];return _0x292940;});return db[_0x51c7('0x9c')][_0x51c7('0x9d')](_0x448788,{'transaction':_0x34c6c4});});})[_0x51c7('0x25')](function(){return db[_0x51c7('0x9c')][_0x51c7('0x9e')]({'where':{'MailAccountId':_0x1c0ce8['params']['id']},'order':_0x51c7('0x9f')});});}})[_0x51c7('0x25')](respondWithResult(_0x306354,null))[_0x51c7('0x2f')](handleError(_0x306354,null));};exports[_0x51c7('0xa0')]=function(_0x2ed7f6,_0x37a26c,_0x1f4019){var _0x5070bd={};var _0x1ee95d={};var _0xbd9d34;var _0x428669;return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x2ed7f6['params']['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x37a26c,null))[_0x51c7('0x25')](function(_0x2be369){if(_0x2be369){_0xbd9d34=_0x2be369;_0x1ee95d[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db[_0x51c7('0x9c')][_0x51c7('0x61')]);_0x1ee95d['query']=_[_0x51c7('0x4c')](_0x2ed7f6[_0x51c7('0x4b')]);_0x1ee95d[_0x51c7('0x4d')]=_['intersection'](_0x1ee95d[_0x51c7('0x49')],_0x1ee95d[_0x51c7('0x4b')]);_0x5070bd[_0x51c7('0x4f')]=_[_0x51c7('0x4e')](_0x1ee95d[_0x51c7('0x49')],qs['fields'](_0x2ed7f6['query']['fields']));_0x5070bd[_0x51c7('0x4f')]=_0x5070bd[_0x51c7('0x4f')]['length']?_0x5070bd['attributes']:_0x1ee95d[_0x51c7('0x49')];_0x5070bd[_0x51c7('0x54')]=qs['sort'](_0x2ed7f6['query'][_0x51c7('0x55')]);_0x5070bd[_0x51c7('0x56')]=qs['filters'](_[_0x51c7('0x57')](_0x2ed7f6[_0x51c7('0x4b')],_0x1ee95d[_0x51c7('0x4d')]));if(_0x2ed7f6[_0x51c7('0x4b')][_0x51c7('0x58')]){_0x5070bd['where']=_[_0x51c7('0x59')](_0x5070bd[_0x51c7('0x56')],{'$or':_[_0x51c7('0x4a')](_0x5070bd[_0x51c7('0x4f')],function(_0x5ee5f5){var _0x32e7ac={};_0x32e7ac[_0x5ee5f5]={'$like':'%'+_0x2ed7f6[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x32e7ac;})});}_0x5070bd=_[_0x51c7('0x59')]({},_0x5070bd,_0x2ed7f6['options']);return _0xbd9d34[_0x51c7('0xa0')](_0x5070bd);}})[_0x51c7('0x25')](function(_0x2579b1){if(_0x2579b1){_0x428669=_0x2579b1[_0x51c7('0x51')];if(!_0x2ed7f6['query'][_0x51c7('0x52')]('nolimit')){_0x5070bd[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0x2ed7f6['query'][_0x51c7('0x36')]);_0x5070bd[_0x51c7('0x35')]=qs[_0x51c7('0x35')](_0x2ed7f6[_0x51c7('0x4b')][_0x51c7('0x35')]);}return _0xbd9d34[_0x51c7('0xa0')](_0x5070bd);}})['then'](function(_0x10584c){if(_0x10584c){return _0x10584c?{'count':_0x428669,'rows':_0x10584c}:null;}})['then'](respondWithResult(_0x37a26c,null))[_0x51c7('0x2f')](handleError(_0x37a26c,null));};exports['getMessages']=function(_0x5abed1,_0x3dae2e,_0x278bd5){var _0x294053={'raw':!![],'where':{}};var _0xef91ef={};var _0x1ddaba={'count':0x0,'rows':[]};return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x5abed1[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x3dae2e,null))[_0x51c7('0x25')](function(_0x424641){if(_0x424641){_0xef91ef[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db[_0x51c7('0xa1')][_0x51c7('0x61')]);_0xef91ef['query']=_[_0x51c7('0x4c')](_0x5abed1[_0x51c7('0x4b')]);_0xef91ef[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0xef91ef[_0x51c7('0x49')],_0xef91ef[_0x51c7('0x4b')]);_0x294053[_0x51c7('0x4f')]=_[_0x51c7('0x4e')](_0xef91ef[_0x51c7('0x49')],qs[_0x51c7('0x50')](_0x5abed1[_0x51c7('0x4b')][_0x51c7('0x50')]));_0x294053['attributes']=_0x294053[_0x51c7('0x4f')][_0x51c7('0x51')]?_0x294053[_0x51c7('0x4f')]:_0xef91ef['model'];if(!_0x5abed1['query']['hasOwnProperty']('nolimit')){_0x294053[_0x51c7('0x36')]=qs[_0x51c7('0x36')](_0x5abed1[_0x51c7('0x4b')]['limit']);_0x294053['offset']=qs[_0x51c7('0x35')](_0x5abed1[_0x51c7('0x4b')][_0x51c7('0x35')]);}_0x294053[_0x51c7('0x54')]=qs['sort'](_0x5abed1[_0x51c7('0x4b')][_0x51c7('0x55')]);_0x294053[_0x51c7('0x56')]=qs[_0x51c7('0x4d')](_[_0x51c7('0x57')](_0x5abed1[_0x51c7('0x4b')],_0xef91ef[_0x51c7('0x4d')]));_0x294053['where']['MailAccountId']=_0x424641['id'];if(_0x5abed1[_0x51c7('0x4b')]['filter']){_0x294053[_0x51c7('0x56')]=_[_0x51c7('0x59')](_0x294053[_0x51c7('0x56')],{'$or':_[_0x51c7('0x4a')](_0x294053[_0x51c7('0x4f')],function(_0x19dfa2){var _0x5b1e66={};_0x5b1e66[_0x19dfa2]={'$like':'%'+_0x5abed1[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x5b1e66;})});}if(_0x5abed1[_0x51c7('0x4b')][_0x51c7('0xa2')]){var _0x94cdf0=_0x5abed1[_0x51c7('0x4b')][_0x51c7('0xa2')][_0x51c7('0xa3')](',');var _0x1920b9={};_0x1920b9[_0x94cdf0[0x0]]={'$gte':moment(_0x94cdf0[0x1])[_0x51c7('0xa4')](_0x51c7('0xa5'))};_0x294053[_0x51c7('0x56')]=_[_0x51c7('0x59')](_0x294053[_0x51c7('0x56')],_0x1920b9);}_0x294053=_['merge']({},_0x294053,_0x5abed1['options']);return db[_0x51c7('0xa1')][_0x51c7('0x34')]({'where':_0x294053[_0x51c7('0x56')]})[_0x51c7('0x25')](function(_0x1ee625){_0x1ddaba[_0x51c7('0x34')]=_0x1ee625;if(_0x5abed1[_0x51c7('0x4b')][_0x51c7('0x5a')]){_0x294053['include']=[{'all':!![]}];}return db[_0x51c7('0xa1')][_0x51c7('0x5c')](_0x294053);})[_0x51c7('0x25')](function(_0x3bf510){_0x1ddaba['rows']=_0x3bf510;return _0x1ddaba;});}})[_0x51c7('0x25')](respondWithFilteredResult(_0x3dae2e,_0x294053))['catch'](handleError(_0x3dae2e,null));};exports[_0x51c7('0x40')]=function(_0x26bfdb,_0x7a6e8b,_0x40dc92){var _0x5c2b65,_0x4ca8e8={},_0x6b5fac;if(_0x26bfdb[_0x51c7('0x63')]['to']){_0x6b5fac=_0x26bfdb[_0x51c7('0x63')]['to'][_0x51c7('0xa3')](',')[0x0];}return db['MailAccount'][_0x51c7('0x68')]({'where':{'id':_0x26bfdb[_0x51c7('0x5f')]['id']},'include':[{'model':db[_0x51c7('0xa6')],'as':_0x51c7('0xa7'),'include':[{'model':db[_0x51c7('0x91')],'as':'Contacts','where':{'email':_0x6b5fac},'limit':0x1,'order':[[_0x51c7('0xa8'),_0x51c7('0xa9')]]}]},{'model':db[_0x51c7('0x60')],'as':_0x51c7('0x43'),'raw':!![]}]})[_0x51c7('0x25')](handleEntityNotFound(_0x7a6e8b,null))[_0x51c7('0x25')](function(_0x35ca74){if(_0x35ca74){_0x5c2b65=_0x35ca74;if(_0x35ca74[_0x51c7('0x43')]){if(_[_0x51c7('0x70')](_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xaa')])){_0x26bfdb['body'][_0x51c7('0xaa')]=util[_0x51c7('0xa4')](_0x51c7('0xab'),_0x35ca74['name'],_0x35ca74[_0x51c7('0x6e')]||_0x35ca74[_0x51c7('0x43')]['user']);}if(_0x26bfdb['body'][_0x51c7('0xac')]&&_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xac')][_0x51c7('0x51')]){for(var _0x171f76=0x0;_0x171f76<_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xac')][_0x51c7('0x51')];_0x171f76+=0x1){_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xac')][_0x171f76]={'filename':_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xac')][_0x171f76]['name'],'path':path['join'](config[_0x51c7('0xad')],'server/files/attachments',_0x26bfdb['body'][_0x51c7('0xac')][_0x171f76][_0x51c7('0xae')])};}}var _0x16691f={'tls':{'rejectUnauthorized':![]}};if(_[_0x51c7('0x70')](_0x35ca74[_0x51c7('0x43')]['service'])){if(_0x35ca74[_0x51c7('0x43')][_0x51c7('0x79')]){_0x16691f[_0x51c7('0xaf')]={'user':_0x35ca74['Smtp'][_0x51c7('0x75')],'pass':_0x35ca74[_0x51c7('0x43')][_0x51c7('0x7d')]};}_0x16691f[_0x51c7('0x7a')]=_0x35ca74[_0x51c7('0x43')][_0x51c7('0x7a')];_0x16691f[_0x51c7('0x7b')]=_0x35ca74['Smtp'][_0x51c7('0x7b')];_0x16691f['secure']=_0x35ca74[_0x51c7('0x43')][_0x51c7('0xb0')];}else{_0x16691f['service']=_0x35ca74[_0x51c7('0x43')][_0x51c7('0x7c')];_0x16691f['auth']={'user':_0x35ca74[_0x51c7('0x43')]['user'],'pass':_0x35ca74[_0x51c7('0x43')]['pass']};}return respondWithRpcPromise(_0x51c7('0xb1'),'sendMail',{'account':_0x16691f,'message':_0x26bfdb[_0x51c7('0x63')]});}else{throw new Error('List\x20not\x20found');}}})['then'](function(_0x14de1f){if(_0x14de1f){_0x4ca8e8=_0x14de1f;if(_0x5c2b65[_0x51c7('0xa7')]){if(_0x5c2b65[_0x51c7('0xa7')]['Contacts'][_0x51c7('0x51')]){return _0x5c2b65[_0x51c7('0xa7')][_0x51c7('0xb2')][0x0];}else{return db[_0x51c7('0x91')]['create'](_[_0x51c7('0x18')](_0x26bfdb[_0x51c7('0x63')],{'firstName':_0x26bfdb[_0x51c7('0x63')]['to'],'email':_0x26bfdb[_0x51c7('0x63')]['to'],'phone':_0x26bfdb['body']['to'],'ListId':_0x5c2b65[_0x51c7('0x6f')]}));}}else{throw new Error(_0x51c7('0xb3'));}}})[_0x51c7('0x25')](function(_0x4bc5e9){if(_0x4bc5e9){var _0x332d46={'UserId':_0x26bfdb[_0x51c7('0x75')]['id'],'ContactId':_0x4bc5e9['id'],'MailAccountId':_0x5c2b65['id'],'inReplyTo':_0x4ca8e8[_0x51c7('0xb4')],'to':_0x26bfdb['body'][_0x51c7('0xaa')],'cc':_0x26bfdb[_0x51c7('0x63')]['cc'],'subject':_0x26bfdb['body'][_0x51c7('0xb5')],'attach':_0x26bfdb[_0x51c7('0x63')]['attach'],'firstMsgDirection':_0x51c7('0xb6'),'lastMsgAt':moment()[_0x51c7('0xa4')](_0x51c7('0xa5')),'lastMsgDirection':_0x51c7('0xb6'),'lastMsgBody':_0x26bfdb[_0x51c7('0x63')][_0x51c7('0x63')],'Messages':[_[_0x51c7('0x59')](_0x26bfdb[_0x51c7('0x63')],{'messageId':_0x4ca8e8[_0x51c7('0xb4')],'sentAt':moment()['format'](_0x51c7('0xa5')),'read':!![],'MailAccountId':_0x5c2b65['id'],'UserId':_0x26bfdb[_0x51c7('0x75')]['id'],'ContactId':_0x4bc5e9['id']})]};if(_0x26bfdb[_0x51c7('0x63')][_0x51c7('0xb7')]){_0x332d46=_[_0x51c7('0x59')](_0x332d46,_0x26bfdb['body']['Interaction']);}return db[_0x51c7('0x8e')][_0x51c7('0x67')](_0x332d46,{'include':[{'model':db[_0x51c7('0xa1')],'as':_0x51c7('0xb8')}]});}})[_0x51c7('0x25')](respondWithResult(_0x7a6e8b,null))[_0x51c7('0x2f')](handleError(_0x7a6e8b,null));};exports[_0x51c7('0xb9')]=function(_0x2c9999,_0x3b3d8a,_0x1f3047){return db['MailAccount']['find']({'where':{'id':_0x2c9999[_0x51c7('0x5f')]['id']},'include':[{'model':db[_0x51c7('0x60')],'as':'Smtp','raw':!![]}]})[_0x51c7('0x25')](handleEntityNotFound(_0x3b3d8a,null))[_0x51c7('0x25')](function(_0x4b608a){if(_0x4b608a&&_0x4b608a[_0x51c7('0x43')]){var _0x49ac47={'id':_0x4b608a['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4b608a[_0x51c7('0x43')]['service']){_0x49ac47['service']=_0x4b608a[_0x51c7('0x43')]['service'];}else{_0x49ac47[_0x51c7('0x7a')]=_0x4b608a[_0x51c7('0x43')]['host'];_0x49ac47[_0x51c7('0x7b')]=_0x4b608a['Smtp'][_0x51c7('0x7b')];_0x49ac47[_0x51c7('0xb0')]=_0x4b608a[_0x51c7('0x43')][_0x51c7('0xb0')];}if(_0x4b608a[_0x51c7('0x43')][_0x51c7('0x79')]){_0x49ac47[_0x51c7('0xaf')]={'user':_0x4b608a[_0x51c7('0x43')][_0x51c7('0x75')],'pass':_0x4b608a[_0x51c7('0x43')][_0x51c7('0x7d')]};}return respondWithRpcPromise(_0x51c7('0xba'),'verifySmtp',{'account':_0x49ac47});}})[_0x51c7('0x25')](respondWithResult(_0x3b3d8a,null))[_0x51c7('0x2f')](handleError(_0x3b3d8a,null));};exports[_0x51c7('0x3d')]=function(_0x546522,_0x5dc2b7){return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x546522[_0x51c7('0x5f')]['id']}})['then'](handleEntityNotFound(_0x5dc2b7,null))[_0x51c7('0x25')](function(_0x1d0f8a){if(_0x1d0f8a&&_0x1d0f8a[_0x51c7('0x7c')]){throw new db[(_0x51c7('0x22'))][(_0x51c7('0xbb'))](_0x51c7('0xbc'));}return _0x1d0f8a;})[_0x51c7('0x25')](removeEntity(_0x5dc2b7,null))[_0x51c7('0x2f')](handleError(_0x5dc2b7,null));};exports[_0x51c7('0xbd')]=function(_0x12b94c,_0x577716,_0x31d028){return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x12b94c[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x577716,null))[_0x51c7('0x25')](function(_0x3fa15f){if(_0x3fa15f){return _0x3fa15f['addAgents'](_0x12b94c[_0x51c7('0x63')][_0x51c7('0x6a')],_['omit'](_0x12b94c[_0x51c7('0x63')],[_0x51c7('0x6a'),'id'])||{})[_0x51c7('0xbe')](function(_0x10680b){for(var _0x2b92b2=0x0;_0x2b92b2<_0x12b94c['body'][_0x51c7('0x6a')]['length'];_0x2b92b2+=0x1){socket['emit']('userMailAccount:save',{'UserId':_0x12b94c[_0x51c7('0x63')][_0x51c7('0x6a')][_0x2b92b2],'MailAccountId':_0x12b94c[_0x51c7('0x5f')]['id']});}return _0x10680b;});}})[_0x51c7('0x25')](respondWithResult(_0x577716,null))[_0x51c7('0x2f')](handleError(_0x577716,null));};exports[_0x51c7('0xbf')]=function(_0x4bb341,_0x515315,_0x34124b){return db[_0x51c7('0x46')][_0x51c7('0x68')]({'where':{'id':_0x4bb341[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x515315,null))[_0x51c7('0x25')](function(_0x2be71c){if(_0x2be71c){return _0x2be71c[_0x51c7('0xbf')](_0x4bb341['query']['ids'])[_0x51c7('0x25')](function(){if(_[_0x51c7('0xc0')](_0x4bb341['query']['ids'])){for(var _0x425c53=0x0;_0x425c53<_0x4bb341[_0x51c7('0x4b')]['ids'][_0x51c7('0x51')];_0x425c53+=0x1){socket[_0x51c7('0xc1')](_0x51c7('0xc2'),{'UserId':Number(_0x4bb341[_0x51c7('0x4b')][_0x51c7('0x6a')][_0x425c53]),'MailAccountId':Number(_0x4bb341[_0x51c7('0x5f')]['id'])});}}else{socket['emit'](_0x51c7('0xc2'),{'UserId':Number(_0x4bb341['query'][_0x51c7('0x6a')]),'MailAccountId':Number(_0x4bb341[_0x51c7('0x5f')]['id'])});}});}})[_0x51c7('0x25')](respondWithStatusCode(_0x515315,null))[_0x51c7('0x2f')](handleError(_0x515315,null));};exports[_0x51c7('0xc3')]=function(_0x6a12ce,_0x1fe70b,_0x3a8651){var _0x548320={};var _0x1fd00a={};var _0x37fa79;var _0x68f5ff;return db[_0x51c7('0x46')][_0x51c7('0x6d')]({'where':{'id':_0x6a12ce[_0x51c7('0x5f')]['id']}})[_0x51c7('0x25')](handleEntityNotFound(_0x1fe70b,null))[_0x51c7('0x25')](function(_0x93098c){if(_0x93098c){_0x37fa79=_0x93098c;_0x1fd00a[_0x51c7('0x49')]=_[_0x51c7('0x4c')](db['User'][_0x51c7('0x61')]);_0x1fd00a['query']=_[_0x51c7('0x4c')](_0x6a12ce['query']);_0x1fd00a[_0x51c7('0x4d')]=_[_0x51c7('0x4e')](_0x1fd00a['model'],_0x1fd00a[_0x51c7('0x4b')]);_0x548320[_0x51c7('0x4f')]=_['intersection'](_0x1fd00a[_0x51c7('0x49')],qs['fields'](_0x6a12ce[_0x51c7('0x4b')]['fields']));_0x548320[_0x51c7('0x4f')]=_0x548320[_0x51c7('0x4f')][_0x51c7('0x51')]?_0x548320[_0x51c7('0x4f')]:_0x1fd00a[_0x51c7('0x49')];_0x548320[_0x51c7('0x54')]=qs[_0x51c7('0x55')](_0x6a12ce[_0x51c7('0x4b')][_0x51c7('0x55')]);_0x548320[_0x51c7('0x56')]=qs['filters'](_[_0x51c7('0x57')](_0x6a12ce[_0x51c7('0x4b')],_0x1fd00a[_0x51c7('0x4d')]));if(_0x6a12ce[_0x51c7('0x4b')]['filter']){_0x548320[_0x51c7('0x56')]=_[_0x51c7('0x59')](_0x548320[_0x51c7('0x56')],{'$or':_[_0x51c7('0x4a')](_0x548320['attributes'],function(_0x13df5d){var _0x4e98db={};_0x4e98db[_0x13df5d]={'$like':'%'+_0x6a12ce[_0x51c7('0x4b')][_0x51c7('0x58')]+'%'};return _0x4e98db;})});}_0x548320=_['merge']({},_0x548320,_0x6a12ce[_0x51c7('0x62')]);return _0x37fa79[_0x51c7('0xc3')](_0x548320);}})[_0x51c7('0x25')](function(_0x43669d){if(_0x43669d){_0x68f5ff=_0x43669d[_0x51c7('0x51')];if(!_0x6a12ce[_0x51c7('0x4b')][_0x51c7('0x52')](_0x51c7('0x53'))){_0x548320['limit']=qs[_0x51c7('0x36')](_0x6a12ce[_0x51c7('0x4b')][_0x51c7('0x36')]);_0x548320[_0x51c7('0x35')]=qs[_0x51c7('0x35')](_0x6a12ce[_0x51c7('0x4b')]['offset']);}return _0x37fa79[_0x51c7('0xc3')](_0x548320);}})[_0x51c7('0x25')](function(_0x1674ee){if(_0x1674ee){return _0x1674ee?{'count':_0x68f5ff,'rows':_0x1674ee}:null;}})[_0x51c7('0x25')](respondWithResult(_0x1fe70b,null))[_0x51c7('0x2f')](handleError(_0x1fe70b,null));}; \ No newline at end of file +var _0x62b1=['Content-Range','save','update','then','MailAccounts','UserProfileResource','destroy','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','Pause','mandatoryDispositionPause','map','MailAccount','rawAttributes','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','filter','type','VIRTUAL','merge','options','includeAll','include','findAll','rows','params','body','find','describe','create','getDispositions','findOne','Disposition','pick','MailAccountId','removeDispositions','ids','getAnswers','CannedAnswer','email','ListId','isNil','active','description','cservice','cauthentication','user','cuser','password','pass','authentication','host','port','service','cpassword','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','addInteraction','omit','MailInteraction','CmContact','Contact','User','Tags','tag','addApplications','sequelize','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','$gte','split','format','MailMessage','List','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','server/files/attachments','auth','SendMail','sendMail','List\x20not\x20found','Contacts','defaults','subject','attach','out','YYYY-MM-DD\x20HH:mm:ss','messageId','Interaction','Messages','verifySmtp','secure','VerifySmtp','Sequelize','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','userMailAccount:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','redis','socket.io-emitter','./mailAccount.socket','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','request\x20sent','error','code','MailAccount,\x20%s,\x20%s','message','info','result','catch','sendStatus','status','end','json','count','offset'];(function(_0x2da716,_0x5631a6){var _0x462676=function(_0x537451){while(--_0x537451){_0x2da716['push'](_0x2da716['shift']());}};_0x462676(++_0x5631a6);}(_0x62b1,0x143));var _0x162b=function(_0x233119,_0x42d50d){_0x233119=_0x233119-0x0;var _0x31bff8=_0x62b1[_0x233119];return _0x31bff8;};'use strict';var pdf=require(_0x162b('0x0'));var emlformat=require(_0x162b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x162b('0x2'));var jsonpatch=require(_0x162b('0x3'));var rp=require(_0x162b('0x4'));var moment=require(_0x162b('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x162b('0x6'));var util=require(_0x162b('0x7'));var path=require('path');var sox=require(_0x162b('0x8'));var csv=require(_0x162b('0x9'));var ejs=require(_0x162b('0xa'));var fs=require('fs');var _=require(_0x162b('0xb'));var squel=require('squel');var crypto=require(_0x162b('0xc'));var jsforce=require(_0x162b('0xd'));var deskjs=require(_0x162b('0xe'));var toCsv=require(_0x162b('0x9'));var querystring=require(_0x162b('0xf'));var Papa=require(_0x162b('0x10'));var Redis=require('ioredis');var authService=require(_0x162b('0x11'));var qs=require(_0x162b('0x12'));var as=require(_0x162b('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x162b('0x14'))(_0x162b('0x15'));var utils=require(_0x162b('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0x162b('0x17')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x162b('0x18'))(new Redis(config[_0x162b('0x17')]));require(_0x162b('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x162b('0x1a')]['http']({'port':0x232b});function checkPasswordPattern(_0x3e9621,_0x43c9c0,_0x7c76f){if(_0x7c76f){var _0x158442=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x158442[_0x162b('0x1b')](_0x43c9c0)){return _0x3e9621;}else{throw new db['Sequelize'][(_0x162b('0x1c'))](_0x162b('0x1d'));}}else{return _0x3e9621;}}function respondWithRpcPromise(_0x213a26,_0x4f7085,_0x4f730c,_0x87cff){return new BPromise(function(_0x48d66a,_0x2261f7){var _0x1c6da0=_0x87cff||client;return _0x1c6da0[_0x162b('0x1e')](_0x213a26,_0x4f730c)['then'](function(_0x219366){logger['info']('MailAccount,\x20%s,\x20%s',_0x4f7085,_0x162b('0x1f'));logger['debug']('MailAccount,\x20%s,\x20%s,\x20%s',_0x4f7085,_0x162b('0x1f'),JSON['stringify'](_0x219366));if(_0x219366['error']){if(_0x219366[_0x162b('0x20')][_0x162b('0x21')]===0x1f4){logger['error'](_0x162b('0x22'),_0x4f7085,_0x219366[_0x162b('0x20')][_0x162b('0x23')]);return _0x2261f7(_0x219366['error']['message']);}logger['error'](_0x162b('0x22'),_0x4f7085,_0x219366[_0x162b('0x20')]['message']);return _0x48d66a(_0x219366['error'][_0x162b('0x23')]);}else{logger[_0x162b('0x24')](_0x162b('0x22'),_0x4f7085,_0x162b('0x1f'));_0x48d66a(_0x219366[_0x162b('0x25')][_0x162b('0x23')]);}})[_0x162b('0x26')](function(_0x24d2f6){logger[_0x162b('0x20')]('MailAccount,\x20%s,\x20%s',_0x4f7085,_0x24d2f6);_0x2261f7(_0x24d2f6);});});}function respondWithStatusCode(_0x349e2d,_0xf00f0b){_0xf00f0b=_0xf00f0b||0xcc;return function(_0x191c77){if(_0x191c77){return _0x349e2d[_0x162b('0x27')](_0xf00f0b);}return _0x349e2d[_0x162b('0x28')](_0xf00f0b)[_0x162b('0x29')]();};}function respondWithResult(_0x3be777,_0x80629f){_0x80629f=_0x80629f||0xc8;return function(_0x35e9a6){if(_0x35e9a6){return _0x3be777['status'](_0x80629f)[_0x162b('0x2a')](_0x35e9a6);}};}function respondWithFilteredResult(_0x90ce28,_0x5930f8){return function(_0x240d8b){if(_0x240d8b){var _0x37e83b=_0x240d8b[_0x162b('0x2b')],_0x4c5f75=_0x5930f8[_0x162b('0x2c')],_0x14023f=_0x5930f8[_0x162b('0x2c')]+_0x5930f8['limit'],_0x559398;if(_0x14023f>=_0x37e83b){_0x14023f=_0x37e83b;_0x559398=0xc8;}else{_0x559398=0xce;}_0x90ce28['status'](_0x559398);return _0x90ce28['set'](_0x162b('0x2d'),_0x4c5f75+'-'+_0x14023f+'/'+_0x37e83b)['json'](_0x240d8b);}return null;};}function patchUpdates(_0x379793){return function(_0x226c94){try{jsonpatch['apply'](_0x226c94,_0x379793,!![]);}catch(_0x3ea05d){return BPromise['reject'](_0x3ea05d);}return _0x226c94[_0x162b('0x2e')]();};}function saveUpdates(_0x5d9fea,_0x3e4723){return function(_0x5416ff){if(_0x5416ff){return _0x5416ff[_0x162b('0x2f')](_0x5d9fea)[_0x162b('0x30')](function(_0x56c35d){return _0x56c35d;});}return null;};}function removeEntity(_0x5c3fe7,_0x31865f){return function(_0x5c293f){if(_0x5c293f){return _0x5c293f['destroy']()[_0x162b('0x30')](function(){var _0x170fc3=_0x5c293f['get']({'plain':!![]});var _0x35b488=_0x162b('0x31');return db[_0x162b('0x32')][_0x162b('0x33')]({'where':{'type':_0x35b488,'resourceId':_0x170fc3['id']}})[_0x162b('0x30')](function(){return _0x5c293f;});})[_0x162b('0x30')](function(){_0x5c3fe7[_0x162b('0x28')](0xcc)[_0x162b('0x29')]();});}};}function handleEntityNotFound(_0x21fb48,_0x1ad25c){return function(_0x293934){if(!_0x293934){_0x21fb48[_0x162b('0x27')](0x194);}return _0x293934;};}function handleError(_0x1527d9,_0x515390){_0x515390=_0x515390||0x1f4;return function(_0xcf494d){logger[_0x162b('0x20')](_0xcf494d[_0x162b('0x34')]);if(_0xcf494d['name']){delete _0xcf494d[_0x162b('0x35')];}_0x1527d9['status'](_0x515390)[_0x162b('0x36')](_0xcf494d);};}exports[_0x162b('0x37')]=function(_0x7fd3cd,_0xa636bd){var _0x1dab0e={'include':[{'model':db[_0x162b('0x38')],'as':_0x162b('0x39')},{'model':db[_0x162b('0x3a')],'as':_0x162b('0x3b')},{'model':db[_0x162b('0x3c')],'as':_0x162b('0x3d')}]},_0x270f8f={},_0x12f882={'count':0x0,'rows':[]};var _0x17da61=_[_0x162b('0x3e')](db[_0x162b('0x3f')][_0x162b('0x40')],function(_0x5e68cd){return{'name':_0x5e68cd['fieldName'],'type':_0x5e68cd['type'][_0x162b('0x41')]};});_0x270f8f[_0x162b('0x42')]=_[_0x162b('0x3e')](_0x17da61,_0x162b('0x35'));_0x270f8f[_0x162b('0x43')]=_[_0x162b('0x44')](_0x7fd3cd[_0x162b('0x43')]);_0x270f8f['filters']=_[_0x162b('0x45')](_0x270f8f[_0x162b('0x42')],_0x270f8f[_0x162b('0x43')]);_0x1dab0e[_0x162b('0x46')]=_[_0x162b('0x45')](_0x270f8f['model'],qs['fields'](_0x7fd3cd['query'][_0x162b('0x47')]));_0x1dab0e[_0x162b('0x46')]=_0x1dab0e[_0x162b('0x46')][_0x162b('0x48')]?_0x1dab0e[_0x162b('0x46')]:_0x270f8f[_0x162b('0x42')];if(!_0x7fd3cd[_0x162b('0x43')][_0x162b('0x49')](_0x162b('0x4a'))){_0x1dab0e[_0x162b('0x4b')]=qs['limit'](_0x7fd3cd[_0x162b('0x43')][_0x162b('0x4b')]);_0x1dab0e['offset']=qs[_0x162b('0x2c')](_0x7fd3cd[_0x162b('0x43')][_0x162b('0x2c')]);}_0x1dab0e[_0x162b('0x4c')]=qs[_0x162b('0x4d')](_0x7fd3cd[_0x162b('0x43')][_0x162b('0x4d')]);_0x1dab0e[_0x162b('0x4e')]=qs[_0x162b('0x4f')](_['pick'](_0x7fd3cd[_0x162b('0x43')],_0x270f8f[_0x162b('0x4f')]));if(_0x7fd3cd[_0x162b('0x43')][_0x162b('0x50')]){_0x1dab0e[_0x162b('0x4e')]=_['merge'](_0x1dab0e[_0x162b('0x4e')],{'$or':_['map'](_0x17da61,function(_0x90a7b7){if(_0x90a7b7[_0x162b('0x51')]!==_0x162b('0x52')){var _0x513daf={};_0x513daf[_0x90a7b7[_0x162b('0x35')]]={'$like':'%'+_0x7fd3cd[_0x162b('0x43')][_0x162b('0x50')]+'%'};return _0x513daf;}})});}_0x1dab0e=_[_0x162b('0x53')]({},_0x1dab0e,_0x7fd3cd[_0x162b('0x54')]);var _0x11f6d0={'where':_0x1dab0e['where']};return db[_0x162b('0x3f')]['count'](_0x11f6d0)[_0x162b('0x30')](function(_0x3bba12){_0x12f882[_0x162b('0x2b')]=_0x3bba12;if(_0x7fd3cd[_0x162b('0x43')][_0x162b('0x55')]){_0x1dab0e[_0x162b('0x56')]=[{'all':!![]}];}return db[_0x162b('0x3f')][_0x162b('0x57')](_0x1dab0e);})['then'](function(_0x8dc1fd){_0x12f882[_0x162b('0x58')]=_0x8dc1fd;return _0x12f882;})[_0x162b('0x30')](respondWithFilteredResult(_0xa636bd,_0x1dab0e))['catch'](handleError(_0xa636bd,null));};exports['show']=function(_0x42b646,_0x1bc491){var _0x28b689={'raw':![],'where':{'id':_0x42b646[_0x162b('0x59')]['id']},'include':[{'model':db['MailServerIn'],'as':_0x162b('0x39')},{'model':db[_0x162b('0x3a')],'as':'Smtp'},{'model':db[_0x162b('0x3c')],'as':'mandatoryDispositionPause'}]},_0x5215ec={};_0x5215ec[_0x162b('0x42')]=_[_0x162b('0x44')](db['MailAccount'][_0x162b('0x40')]);_0x5215ec[_0x162b('0x43')]=_[_0x162b('0x44')](_0x42b646['query']);_0x5215ec[_0x162b('0x4f')]=_[_0x162b('0x45')](_0x5215ec[_0x162b('0x42')],_0x5215ec[_0x162b('0x43')]);_0x28b689[_0x162b('0x46')]=_[_0x162b('0x45')](_0x5215ec[_0x162b('0x42')],qs[_0x162b('0x47')](_0x42b646[_0x162b('0x43')]['fields']));_0x28b689[_0x162b('0x46')]=_0x28b689[_0x162b('0x46')][_0x162b('0x48')]?_0x28b689['attributes']:_0x5215ec[_0x162b('0x42')];if(_0x42b646[_0x162b('0x43')]['includeAll']){_0x28b689[_0x162b('0x56')]=[{'all':!![]}];}_0x28b689=_[_0x162b('0x53')]({},_0x28b689,_0x42b646[_0x162b('0x54')]);return db[_0x162b('0x3f')]['find'](_0x28b689)[_0x162b('0x30')](handleEntityNotFound(_0x1bc491,null))['then'](respondWithResult(_0x1bc491,null))[_0x162b('0x26')](handleError(_0x1bc491,null));};exports[_0x162b('0x2f')]=function(_0x1516cf,_0x3dc1a3){if(_0x1516cf[_0x162b('0x5a')]['id']){delete _0x1516cf['body']['id'];}return db[_0x162b('0x3f')][_0x162b('0x5b')]({'where':{'id':_0x1516cf['params']['id']},'include':[{'model':db[_0x162b('0x38')],'as':_0x162b('0x39')},{'model':db[_0x162b('0x3a')],'as':_0x162b('0x3b')},{'model':db[_0x162b('0x3c')],'as':_0x162b('0x3d')}]})['then'](handleEntityNotFound(_0x3dc1a3,null))['then'](saveUpdates(_0x1516cf[_0x162b('0x5a')],null))[_0x162b('0x30')](function(_0x4eaed9){if(_0x4eaed9&&_0x1516cf[_0x162b('0x5a')]['Imap']){return db['MailServerIn'][_0x162b('0x2f')](_0x1516cf['body'][_0x162b('0x39')],{'where':{'MailAccountId':_0x4eaed9['id']}})['then'](function(){return _0x4eaed9;});}return _0x4eaed9;})['then'](function(_0x547cd6){if(_0x547cd6&&_0x1516cf[_0x162b('0x5a')][_0x162b('0x3b')]){return db[_0x162b('0x3a')][_0x162b('0x2f')](_0x1516cf[_0x162b('0x5a')]['Smtp'],{'where':{'MailAccountId':_0x547cd6['id']}})[_0x162b('0x30')](function(){return _0x547cd6;});}return _0x547cd6;})[_0x162b('0x30')](respondWithResult(_0x3dc1a3,null))[_0x162b('0x26')](handleError(_0x3dc1a3,null));};exports[_0x162b('0x5c')]=function(_0x3c9764,_0x43ac2b){return db[_0x162b('0x3f')][_0x162b('0x5c')]()['then'](respondWithResult(_0x43ac2b,null))['catch'](handleError(_0x43ac2b,null));};exports['addDisposition']=function(_0x165b20,_0x5d57ff,_0x99f5d8){if(_0x165b20[_0x162b('0x5a')]['id']){delete _0x165b20[_0x162b('0x5a')]['id'];}return db[_0x162b('0x3f')]['find']({'where':{'id':_0x165b20[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x5d57ff,null))[_0x162b('0x30')](function(_0x59f770){if(_0x59f770){_0x165b20['body']['MailAccountId']=_0x59f770['id'];return db['Disposition'][_0x162b('0x5d')](_0x165b20[_0x162b('0x5a')]);}})[_0x162b('0x30')](respondWithResult(_0x5d57ff,null))[_0x162b('0x26')](handleError(_0x5d57ff,null));};exports[_0x162b('0x5e')]=function(_0x15ffa9,_0x4def40,_0x264bd9){var _0x505b51={'raw':![],'where':{}};var _0x2850d9={};var _0x13e64a={'count':0x0,'rows':[]};return db['MailAccount'][_0x162b('0x5f')]({'where':{'id':_0x15ffa9[_0x162b('0x59')]['id']}})['then'](handleEntityNotFound(_0x4def40,null))[_0x162b('0x30')](function(_0x20487e){if(_0x20487e){_0x2850d9[_0x162b('0x42')]=_[_0x162b('0x44')](db[_0x162b('0x60')][_0x162b('0x40')]);_0x2850d9['query']=_['keys'](_0x15ffa9[_0x162b('0x43')]);_0x2850d9[_0x162b('0x4f')]=_[_0x162b('0x45')](_0x2850d9[_0x162b('0x42')],_0x2850d9[_0x162b('0x43')]);_0x505b51[_0x162b('0x46')]=_[_0x162b('0x45')](_0x2850d9[_0x162b('0x42')],qs['fields'](_0x15ffa9[_0x162b('0x43')][_0x162b('0x47')]));_0x505b51['attributes']=_0x505b51[_0x162b('0x46')][_0x162b('0x48')]?_0x505b51['attributes']:_0x2850d9[_0x162b('0x42')];if(!_0x15ffa9['query'][_0x162b('0x49')]('nolimit')){_0x505b51[_0x162b('0x4b')]=qs[_0x162b('0x4b')](_0x15ffa9[_0x162b('0x43')][_0x162b('0x4b')]);_0x505b51[_0x162b('0x2c')]=qs[_0x162b('0x2c')](_0x15ffa9[_0x162b('0x43')][_0x162b('0x2c')]);}_0x505b51['order']=qs['sort'](_0x15ffa9[_0x162b('0x43')][_0x162b('0x4d')]);_0x505b51[_0x162b('0x4e')]=qs[_0x162b('0x4f')](_[_0x162b('0x61')](_0x15ffa9['query'],_0x2850d9[_0x162b('0x4f')]));_0x505b51['where'][_0x162b('0x62')]=_0x20487e['id'];if(_0x15ffa9[_0x162b('0x43')][_0x162b('0x50')]){_0x505b51[_0x162b('0x4e')]=_[_0x162b('0x53')](_0x505b51[_0x162b('0x4e')],{'$or':_[_0x162b('0x3e')](_0x505b51[_0x162b('0x46')],function(_0x2e5de0){var _0x8d13ff={};_0x8d13ff[_0x2e5de0]={'$like':'%'+_0x15ffa9[_0x162b('0x43')][_0x162b('0x50')]+'%'};return _0x8d13ff;})});}_0x505b51=_[_0x162b('0x53')]({},_0x505b51,_0x15ffa9['options']);return db[_0x162b('0x60')]['count']({'where':_0x505b51[_0x162b('0x4e')]})['then'](function(_0x1f28e8){_0x13e64a[_0x162b('0x2b')]=_0x1f28e8;if(_0x15ffa9[_0x162b('0x43')][_0x162b('0x55')]){_0x505b51[_0x162b('0x56')]=[{'all':!![]}];}return db[_0x162b('0x60')][_0x162b('0x57')](_0x505b51);})['then'](function(_0x5130b0){_0x13e64a['rows']=_0x5130b0;return _0x13e64a;});}})[_0x162b('0x30')](respondWithFilteredResult(_0x4def40,_0x505b51))[_0x162b('0x26')](handleError(_0x4def40,null));};exports[_0x162b('0x63')]=function(_0x31bfd3,_0x49d99b,_0x454903){return db[_0x162b('0x3f')][_0x162b('0x5b')]({'where':{'id':_0x31bfd3[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x49d99b,null))['then'](function(_0x36deca){if(_0x36deca){return _0x36deca[_0x162b('0x63')](_0x31bfd3[_0x162b('0x43')][_0x162b('0x64')]);}})[_0x162b('0x30')](respondWithStatusCode(_0x49d99b,null))[_0x162b('0x26')](handleError(_0x49d99b,null));};exports['addAnswer']=function(_0x280b0c,_0x35f7f1,_0x58f2f4){if(_0x280b0c['body']['id']){delete _0x280b0c[_0x162b('0x5a')]['id'];}return db[_0x162b('0x3f')]['find']({'where':{'id':_0x280b0c['params']['id']}})['then'](handleEntityNotFound(_0x35f7f1,null))['then'](function(_0x3da028){if(_0x3da028){_0x280b0c['body'][_0x162b('0x62')]=_0x3da028['id'];return db['CannedAnswer'][_0x162b('0x5d')](_0x280b0c[_0x162b('0x5a')]);}})[_0x162b('0x30')](respondWithResult(_0x35f7f1,null))[_0x162b('0x26')](handleError(_0x35f7f1,null));};exports[_0x162b('0x65')]=function(_0x2cdcd4,_0x711c53,_0x1ebc0f){var _0x5458a0={'raw':![],'where':{}};var _0x147128={};var _0x12ac60={'count':0x0,'rows':[]};return db[_0x162b('0x3f')]['findOne']({'where':{'id':_0x2cdcd4['params']['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x711c53,null))[_0x162b('0x30')](function(_0x5f5bde){if(_0x5f5bde){_0x147128[_0x162b('0x42')]=_[_0x162b('0x44')](db['CannedAnswer']['rawAttributes']);_0x147128[_0x162b('0x43')]=_[_0x162b('0x44')](_0x2cdcd4[_0x162b('0x43')]);_0x147128[_0x162b('0x4f')]=_['intersection'](_0x147128['model'],_0x147128[_0x162b('0x43')]);_0x5458a0['attributes']=_[_0x162b('0x45')](_0x147128['model'],qs['fields'](_0x2cdcd4[_0x162b('0x43')][_0x162b('0x47')]));_0x5458a0['attributes']=_0x5458a0[_0x162b('0x46')]['length']?_0x5458a0[_0x162b('0x46')]:_0x147128['model'];if(!_0x2cdcd4[_0x162b('0x43')]['hasOwnProperty']('nolimit')){_0x5458a0['limit']=qs[_0x162b('0x4b')](_0x2cdcd4[_0x162b('0x43')][_0x162b('0x4b')]);_0x5458a0[_0x162b('0x2c')]=qs['offset'](_0x2cdcd4[_0x162b('0x43')][_0x162b('0x2c')]);}_0x5458a0[_0x162b('0x4c')]=qs['sort'](_0x2cdcd4[_0x162b('0x43')][_0x162b('0x4d')]);_0x5458a0[_0x162b('0x4e')]=qs[_0x162b('0x4f')](_[_0x162b('0x61')](_0x2cdcd4[_0x162b('0x43')],_0x147128[_0x162b('0x4f')]));_0x5458a0[_0x162b('0x4e')][_0x162b('0x62')]=_0x5f5bde['id'];if(_0x2cdcd4[_0x162b('0x43')][_0x162b('0x50')]){_0x5458a0[_0x162b('0x4e')]=_[_0x162b('0x53')](_0x5458a0[_0x162b('0x4e')],{'$or':_['map'](_0x5458a0['attributes'],function(_0x258ccf){var _0x33ccef={};_0x33ccef[_0x258ccf]={'$like':'%'+_0x2cdcd4[_0x162b('0x43')]['filter']+'%'};return _0x33ccef;})});}_0x5458a0=_['merge']({},_0x5458a0,_0x2cdcd4[_0x162b('0x54')]);return db[_0x162b('0x66')][_0x162b('0x2b')]({'where':_0x5458a0['where']})[_0x162b('0x30')](function(_0x355f31){_0x12ac60[_0x162b('0x2b')]=_0x355f31;if(_0x2cdcd4['query']['includeAll']){_0x5458a0['include']=[{'all':!![]}];}return db[_0x162b('0x66')][_0x162b('0x57')](_0x5458a0);})['then'](function(_0x140e8e){_0x12ac60[_0x162b('0x58')]=_0x140e8e;return _0x12ac60;});}})['then'](respondWithFilteredResult(_0x711c53,_0x5458a0))['catch'](handleError(_0x711c53,null));};exports['removeAnswers']=function(_0x17c39e,_0x29a46f,_0x270534){return db[_0x162b('0x3f')][_0x162b('0x5b')]({'where':{'id':_0x17c39e[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x29a46f,null))[_0x162b('0x30')](function(_0x37e06d){if(_0x37e06d){return _0x37e06d['removeAnswers'](_0x17c39e[_0x162b('0x43')][_0x162b('0x64')]);}})['then'](respondWithStatusCode(_0x29a46f,null))['catch'](handleError(_0x29a46f,null));};exports[_0x162b('0x5d')]=function(_0x549b51,_0x4fe212){var _0x4e79c4={'name':_0x549b51[_0x162b('0x5a')][_0x162b('0x35')],'key':_0x549b51['body']['key'],'email':_0x549b51[_0x162b('0x5a')][_0x162b('0x67')],'ListId':_0x549b51[_0x162b('0x5a')][_0x162b('0x68')],'active':!_[_0x162b('0x69')](_0x549b51[_0x162b('0x5a')][_0x162b('0x6a')])?_0x549b51[_0x162b('0x5a')][_0x162b('0x6a')]:!![],'description':_0x549b51['body'][_0x162b('0x6b')]||null,'Imap':{},'Smtp':{}};if(_[_0x162b('0x69')](_0x549b51[_0x162b('0x5a')][_0x162b('0x6c')])){if(_0x549b51['body'][_0x162b('0x6d')]){_0x4e79c4['Imap'][_0x162b('0x6e')]=_0x4e79c4[_0x162b('0x3b')]['user']=_0x549b51[_0x162b('0x5a')][_0x162b('0x6f')];_0x4e79c4[_0x162b('0x39')][_0x162b('0x70')]=_0x4e79c4[_0x162b('0x3b')][_0x162b('0x71')]=_0x549b51[_0x162b('0x5a')]['cpassword'];}else{_0x4e79c4[_0x162b('0x39')]['authentication']=_0x4e79c4['Smtp'][_0x162b('0x72')]=![];}_0x4e79c4['Imap'][_0x162b('0x73')]=_0x549b51[_0x162b('0x5a')][_0x162b('0x39')]['host'];_0x4e79c4[_0x162b('0x39')]['port']=_0x549b51['body']['Imap'][_0x162b('0x74')];_0x4e79c4['Smtp'][_0x162b('0x73')]=_0x549b51['body'][_0x162b('0x3b')][_0x162b('0x73')];_0x4e79c4[_0x162b('0x3b')]['port']=_0x549b51[_0x162b('0x5a')][_0x162b('0x3b')][_0x162b('0x74')];}else{_0x4e79c4[_0x162b('0x39')][_0x162b('0x75')]=_0x4e79c4[_0x162b('0x3b')][_0x162b('0x75')]=_0x549b51[_0x162b('0x5a')][_0x162b('0x6c')];_0x4e79c4[_0x162b('0x39')][_0x162b('0x6e')]=_0x4e79c4[_0x162b('0x3b')][_0x162b('0x6e')]=_0x549b51[_0x162b('0x5a')][_0x162b('0x6f')];_0x4e79c4[_0x162b('0x39')][_0x162b('0x70')]=_0x4e79c4[_0x162b('0x3b')]['pass']=_0x549b51['body'][_0x162b('0x76')];}return db[_0x162b('0x3f')][_0x162b('0x5d')](_0x4e79c4,{'include':[{'model':db[_0x162b('0x3a')],'as':_0x162b('0x3b')},{'model':db[_0x162b('0x38')],'as':_0x162b('0x39')}]})['then'](function(_0x1b49b7){var _0x5bc723=_0x549b51[_0x162b('0x6e')][_0x162b('0x77')]({'plain':!![]});if(!_0x5bc723)throw new Error(_0x162b('0x78'));if(_0x5bc723[_0x162b('0x79')]===_0x162b('0x6e')){var _0x1a61c9=_0x1b49b7[_0x162b('0x77')]({'plain':!![]});return db[_0x162b('0x7a')][_0x162b('0x5b')]({'where':{'name':'MailAccounts','userProfileId':_0x5bc723[_0x162b('0x7b')]},'raw':!![]})['then'](function(_0x312576){if(_0x312576&&_0x312576['autoAssociation']===0x0){return db[_0x162b('0x32')][_0x162b('0x5d')]({'name':_0x1a61c9['name'],'resourceId':_0x1a61c9['id'],'type':_0x312576[_0x162b('0x35')],'sectionId':_0x312576['id']},{})['then'](function(){return _0x1b49b7;});}else{return _0x1b49b7;}})[_0x162b('0x26')](function(_0x2c6c88){logger[_0x162b('0x20')](_0x162b('0x7c'),_0x2c6c88);throw _0x2c6c88;});}return _0x1b49b7;})['then'](respondWithResult(_0x4fe212,0xc9))[_0x162b('0x26')](handleError(_0x4fe212,null));};exports[_0x162b('0x7d')]=function(_0x27cba2,_0x2ea276,_0x319582){return db[_0x162b('0x3f')][_0x162b('0x5f')]({'where':{'id':_0x27cba2[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x2ea276,null))['then'](function(_0x2db87e){if(_0x2db87e){return _0x2db87e[_0x162b('0x7d')]();}return null;})[_0x162b('0x30')](respondWithResult(_0x2ea276,null))[_0x162b('0x26')](handleError(_0x2ea276,null));};exports['addImap']=function(_0x2889e4,_0x60bd01,_0xd45d70){if(_0x2889e4[_0x162b('0x5a')]['id']){delete _0x2889e4[_0x162b('0x5a')]['id'];}return db['MailAccount'][_0x162b('0x5b')]({'where':{'id':_0x2889e4['params']['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x60bd01,null))['then'](function(_0x361ce1){if(_0x361ce1){_0x2889e4['body'][_0x162b('0x62')]=_0x361ce1['id'];return db[_0x162b('0x38')][_0x162b('0x5d')](_0x2889e4[_0x162b('0x5a')]);}})['then'](respondWithResult(_0x60bd01,null))[_0x162b('0x26')](handleError(_0x60bd01,null));};exports[_0x162b('0x7e')]=function(_0x350ac8,_0x53d090,_0x5cc621){return db[_0x162b('0x3f')][_0x162b('0x5f')]({'where':{'id':_0x350ac8[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x53d090,null))[_0x162b('0x30')](function(_0x2bcdad){if(_0x2bcdad){return _0x2bcdad[_0x162b('0x7f')](null);}return null;})[_0x162b('0x30')](respondWithStatusCode(_0x53d090,null))[_0x162b('0x26')](handleError(_0x53d090,null));};exports[_0x162b('0x80')]=function(_0x283ab9,_0x250ee7,_0x5289ec){return db[_0x162b('0x3f')][_0x162b('0x5f')]({'where':{'id':_0x283ab9[_0x162b('0x59')]['id']}})['then'](handleEntityNotFound(_0x250ee7,null))[_0x162b('0x30')](function(_0x464e4c){if(_0x464e4c){return _0x464e4c[_0x162b('0x80')]();}return null;})[_0x162b('0x30')](respondWithResult(_0x250ee7,null))[_0x162b('0x26')](handleError(_0x250ee7,null));};exports[_0x162b('0x81')]=function(_0x501629,_0x2a5b08,_0x140190){if(_0x501629[_0x162b('0x5a')]['id']){delete _0x501629[_0x162b('0x5a')]['id'];}return db['MailAccount'][_0x162b('0x5b')]({'where':{'id':_0x501629[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x2a5b08,null))[_0x162b('0x30')](function(_0x24eac7){if(_0x24eac7){_0x501629[_0x162b('0x5a')][_0x162b('0x62')]=_0x24eac7['id'];return db[_0x162b('0x3a')][_0x162b('0x5d')](_0x501629[_0x162b('0x5a')]);}})['then'](respondWithResult(_0x2a5b08,null))['catch'](handleError(_0x2a5b08,null));};exports[_0x162b('0x82')]=function(_0x159bb2,_0x231656,_0x148bcf){return db['MailAccount'][_0x162b('0x5f')]({'where':{'id':_0x159bb2[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x231656,null))['then'](function(_0x37b1af){if(_0x37b1af){return _0x37b1af['setSmtp'](null);}return null;})[_0x162b('0x30')](respondWithStatusCode(_0x231656,null))[_0x162b('0x26')](handleError(_0x231656,null));};exports[_0x162b('0x83')]=function(_0xcfb96d,_0x32e74f,_0x1a77d4){return db['MailInteraction'][_0x162b('0x5b')]({'where':{'id':_0xcfb96d[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x32e74f,null))[_0x162b('0x30')](function(_0x24899a){if(_0x24899a){return _0x24899a[_0x162b('0x83')](_0xcfb96d[_0x162b('0x5a')][_0x162b('0x64')],_[_0x162b('0x84')](_0xcfb96d[_0x162b('0x5a')],[_0x162b('0x64'),'id'])||{});}})['then'](respondWithResult(_0x32e74f,null))['catch'](handleError(_0x32e74f,null));};exports['getInteractions']=function(_0x5b8dfb,_0x54e4d9,_0x4c50d0){var _0x5e34e7={'raw':![],'where':{}};var _0x584f62={};var _0x377a2e={'count':0x0,'rows':[]};return db['MailAccount']['findOne']({'where':{'id':_0x5b8dfb[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x54e4d9,null))[_0x162b('0x30')](function(_0x2ed08d){if(_0x2ed08d){_0x584f62[_0x162b('0x42')]=_[_0x162b('0x44')](db['MailInteraction']['rawAttributes']);_0x584f62['query']=_[_0x162b('0x44')](_0x5b8dfb[_0x162b('0x43')]);_0x584f62[_0x162b('0x4f')]=_['intersection'](_0x584f62['model'],_0x584f62[_0x162b('0x43')]);_0x5e34e7[_0x162b('0x46')]=_[_0x162b('0x45')](_0x584f62[_0x162b('0x42')],qs['fields'](_0x5b8dfb['query'][_0x162b('0x47')]));_0x5e34e7['attributes']=_0x5e34e7[_0x162b('0x46')][_0x162b('0x48')]?_0x5e34e7[_0x162b('0x46')]:_0x584f62[_0x162b('0x42')];if(!_0x5b8dfb[_0x162b('0x43')][_0x162b('0x49')](_0x162b('0x4a'))){_0x5e34e7[_0x162b('0x4b')]=qs[_0x162b('0x4b')](_0x5b8dfb['query'][_0x162b('0x4b')]);_0x5e34e7[_0x162b('0x2c')]=qs[_0x162b('0x2c')](_0x5b8dfb['query']['offset']);}_0x5e34e7[_0x162b('0x4c')]=qs[_0x162b('0x4d')](_0x5b8dfb[_0x162b('0x43')]['sort']);_0x5e34e7['where']=qs['filters'](_[_0x162b('0x61')](_0x5b8dfb[_0x162b('0x43')],_0x584f62['filters']));_0x5e34e7[_0x162b('0x4e')][_0x162b('0x62')]=_0x2ed08d['id'];if(_0x5b8dfb[_0x162b('0x43')][_0x162b('0x50')]){_0x5e34e7[_0x162b('0x4e')]=_[_0x162b('0x53')](_0x5e34e7['where'],{'$or':_[_0x162b('0x3e')](_0x5e34e7[_0x162b('0x46')],function(_0x37e509){var _0x62c2ca={};_0x62c2ca[_0x37e509]={'$like':'%'+_0x5b8dfb['query']['filter']+'%'};return _0x62c2ca;})});}_0x5e34e7=_[_0x162b('0x53')]({},_0x5e34e7,_0x5b8dfb[_0x162b('0x54')]);return db[_0x162b('0x85')][_0x162b('0x2b')]({'where':_0x5e34e7['where']})[_0x162b('0x30')](function(_0x59a64a){_0x377a2e[_0x162b('0x2b')]=_0x59a64a;if(_0x5b8dfb[_0x162b('0x43')][_0x162b('0x55')]){_0x5e34e7[_0x162b('0x56')]=[{'model':db[_0x162b('0x86')],'as':_0x162b('0x87'),'required':![]},{'model':db[_0x162b('0x88')],'as':'Owner','attributes':[_0x162b('0x35'),'fullname','internal'],'required':![]},{'model':db['Tag'],'as':_0x162b('0x89'),'attributes':['id',_0x162b('0x35'),'color'],'where':_0x5b8dfb[_0x162b('0x43')][_0x162b('0x8a')]?{'id':_0x5b8dfb['query'][_0x162b('0x8a')]}:undefined,'required':_0x5b8dfb[_0x162b('0x43')][_0x162b('0x8a')]?!![]:![]}];}return db['MailInteraction'][_0x162b('0x57')](_0x5e34e7);})[_0x162b('0x30')](function(_0x358190){_0x377a2e[_0x162b('0x58')]=_0x358190;return _0x377a2e;});}})[_0x162b('0x30')](respondWithFilteredResult(_0x54e4d9,_0x5e34e7))[_0x162b('0x26')](handleError(_0x54e4d9,null));};exports[_0x162b('0x8b')]=function(_0x54a6ab,_0x3bd954,_0x21be8c){return db[_0x162b('0x3f')][_0x162b('0x5f')]({'where':{'id':_0x54a6ab[_0x162b('0x59')]['id']}})['then'](handleEntityNotFound(_0x3bd954,null))[_0x162b('0x30')](function(_0x4be72b){if(_0x4be72b){return db[_0x162b('0x8c')][_0x162b('0x8d')](function(_0x439f69){return db[_0x162b('0x8e')][_0x162b('0x33')]({'where':{'MailAccountId':_0x54a6ab[_0x162b('0x59')]['id']},'transaction':_0x439f69})[_0x162b('0x30')](function(_0x23ff6e){var _0x1f8cea=_['map'](_0x54a6ab[_0x162b('0x5a')],function(_0x459c1d){_0x459c1d[_0x162b('0x62')]=_0x54a6ab[_0x162b('0x59')]['id'];return _0x459c1d;});return db[_0x162b('0x8e')]['bulkCreate'](_0x1f8cea,{'transaction':_0x439f69});});})['then'](function(){return db[_0x162b('0x8e')][_0x162b('0x8f')]({'where':{'MailAccountId':_0x54a6ab['params']['id']},'order':_0x162b('0x90')});});}})[_0x162b('0x30')](respondWithResult(_0x3bd954,null))[_0x162b('0x26')](handleError(_0x3bd954,null));};exports[_0x162b('0x91')]=function(_0xce4b19,_0x5276c0,_0x465698){var _0x3f0dfb={};var _0x4f5baa={};var _0x23a941;var _0x44e8a7;return db['MailAccount']['findOne']({'where':{'id':_0xce4b19[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x5276c0,null))[_0x162b('0x30')](function(_0x47e0dc){if(_0x47e0dc){_0x23a941=_0x47e0dc;_0x4f5baa['model']=_[_0x162b('0x44')](db[_0x162b('0x8e')][_0x162b('0x40')]);_0x4f5baa[_0x162b('0x43')]=_[_0x162b('0x44')](_0xce4b19[_0x162b('0x43')]);_0x4f5baa[_0x162b('0x4f')]=_[_0x162b('0x45')](_0x4f5baa[_0x162b('0x42')],_0x4f5baa[_0x162b('0x43')]);_0x3f0dfb[_0x162b('0x46')]=_[_0x162b('0x45')](_0x4f5baa[_0x162b('0x42')],qs[_0x162b('0x47')](_0xce4b19[_0x162b('0x43')][_0x162b('0x47')]));_0x3f0dfb[_0x162b('0x46')]=_0x3f0dfb[_0x162b('0x46')][_0x162b('0x48')]?_0x3f0dfb['attributes']:_0x4f5baa[_0x162b('0x42')];_0x3f0dfb['order']=qs[_0x162b('0x4d')](_0xce4b19['query']['sort']);_0x3f0dfb[_0x162b('0x4e')]=qs[_0x162b('0x4f')](_[_0x162b('0x61')](_0xce4b19['query'],_0x4f5baa[_0x162b('0x4f')]));if(_0xce4b19[_0x162b('0x43')]['filter']){_0x3f0dfb['where']=_[_0x162b('0x53')](_0x3f0dfb[_0x162b('0x4e')],{'$or':_['map'](_0x3f0dfb['attributes'],function(_0x5a0573){var _0x915afc={};_0x915afc[_0x5a0573]={'$like':'%'+_0xce4b19[_0x162b('0x43')][_0x162b('0x50')]+'%'};return _0x915afc;})});}_0x3f0dfb=_['merge']({},_0x3f0dfb,_0xce4b19[_0x162b('0x54')]);return _0x23a941[_0x162b('0x91')](_0x3f0dfb);}})[_0x162b('0x30')](function(_0x38a4f3){if(_0x38a4f3){_0x44e8a7=_0x38a4f3['length'];if(!_0xce4b19[_0x162b('0x43')]['hasOwnProperty']('nolimit')){_0x3f0dfb['limit']=qs[_0x162b('0x4b')](_0xce4b19[_0x162b('0x43')][_0x162b('0x4b')]);_0x3f0dfb[_0x162b('0x2c')]=qs['offset'](_0xce4b19[_0x162b('0x43')][_0x162b('0x2c')]);}return _0x23a941[_0x162b('0x91')](_0x3f0dfb);}})[_0x162b('0x30')](function(_0x469b11){if(_0x469b11){return _0x469b11?{'count':_0x44e8a7,'rows':_0x469b11}:null;}})[_0x162b('0x30')](respondWithResult(_0x5276c0,null))[_0x162b('0x26')](handleError(_0x5276c0,null));};exports[_0x162b('0x92')]=function(_0x2b947f,_0x1cc845,_0x1308a6){var _0x4ace89={'raw':!![],'where':{}};var _0x3e163e={};var _0x245cb7={'count':0x0,'rows':[]};return db['MailAccount'][_0x162b('0x5f')]({'where':{'id':_0x2b947f[_0x162b('0x59')]['id']}})['then'](handleEntityNotFound(_0x1cc845,null))['then'](function(_0x1e6fe7){if(_0x1e6fe7){_0x3e163e[_0x162b('0x42')]=_[_0x162b('0x44')](db['MailMessage'][_0x162b('0x40')]);_0x3e163e[_0x162b('0x43')]=_[_0x162b('0x44')](_0x2b947f[_0x162b('0x43')]);_0x3e163e[_0x162b('0x4f')]=_[_0x162b('0x45')](_0x3e163e['model'],_0x3e163e['query']);_0x4ace89['attributes']=_[_0x162b('0x45')](_0x3e163e[_0x162b('0x42')],qs[_0x162b('0x47')](_0x2b947f[_0x162b('0x43')][_0x162b('0x47')]));_0x4ace89[_0x162b('0x46')]=_0x4ace89[_0x162b('0x46')][_0x162b('0x48')]?_0x4ace89['attributes']:_0x3e163e['model'];if(!_0x2b947f[_0x162b('0x43')]['hasOwnProperty']('nolimit')){_0x4ace89[_0x162b('0x4b')]=qs[_0x162b('0x4b')](_0x2b947f[_0x162b('0x43')]['limit']);_0x4ace89[_0x162b('0x2c')]=qs['offset'](_0x2b947f[_0x162b('0x43')][_0x162b('0x2c')]);}_0x4ace89['order']=qs[_0x162b('0x4d')](_0x2b947f[_0x162b('0x43')][_0x162b('0x4d')]);_0x4ace89[_0x162b('0x4e')]=qs[_0x162b('0x4f')](_[_0x162b('0x61')](_0x2b947f['query'],_0x3e163e[_0x162b('0x4f')]));_0x4ace89['where'][_0x162b('0x62')]=_0x1e6fe7['id'];if(_0x2b947f['query'][_0x162b('0x50')]){_0x4ace89['where']=_[_0x162b('0x53')](_0x4ace89[_0x162b('0x4e')],{'$or':_[_0x162b('0x3e')](_0x4ace89[_0x162b('0x46')],function(_0x7def09){var _0x1f23a1={};_0x1f23a1[_0x7def09]={'$like':'%'+_0x2b947f[_0x162b('0x43')][_0x162b('0x50')]+'%'};return _0x1f23a1;})});}if(_0x2b947f[_0x162b('0x43')]['$gte']){var _0x3edd8e=_0x2b947f[_0x162b('0x43')][_0x162b('0x93')][_0x162b('0x94')](',');var _0x27f459={};_0x27f459[_0x3edd8e[0x0]]={'$gte':moment(_0x3edd8e[0x1])[_0x162b('0x95')]('YYYY-MM-DD\x20HH:mm:ss')};_0x4ace89['where']=_[_0x162b('0x53')](_0x4ace89[_0x162b('0x4e')],_0x27f459);}_0x4ace89=_['merge']({},_0x4ace89,_0x2b947f[_0x162b('0x54')]);return db[_0x162b('0x96')]['count']({'where':_0x4ace89[_0x162b('0x4e')]})[_0x162b('0x30')](function(_0x53fa13){_0x245cb7[_0x162b('0x2b')]=_0x53fa13;if(_0x2b947f[_0x162b('0x43')]['includeAll']){_0x4ace89[_0x162b('0x56')]=[{'all':!![]}];}return db[_0x162b('0x96')]['findAll'](_0x4ace89);})[_0x162b('0x30')](function(_0x26a464){_0x245cb7['rows']=_0x26a464;return _0x245cb7;});}})[_0x162b('0x30')](respondWithFilteredResult(_0x1cc845,_0x4ace89))[_0x162b('0x26')](handleError(_0x1cc845,null));};exports[_0x162b('0x36')]=function(_0x452d36,_0x853c66,_0x1ca45e){var _0x2a370d,_0x57d631={},_0x2ff421;if(_0x452d36[_0x162b('0x5a')]['to']){_0x2ff421=_0x452d36[_0x162b('0x5a')]['to'][_0x162b('0x94')](',')[0x0];}return db[_0x162b('0x3f')]['find']({'where':{'id':_0x452d36[_0x162b('0x59')]['id']},'include':[{'model':db['CmList'],'as':_0x162b('0x97'),'include':[{'model':db[_0x162b('0x86')],'as':'Contacts','where':{'email':_0x2ff421},'limit':0x1,'order':[[_0x162b('0x98'),_0x162b('0x99')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x162b('0x30')](handleEntityNotFound(_0x853c66,null))[_0x162b('0x30')](function(_0x218eb3){if(_0x218eb3){_0x2a370d=_0x218eb3;if(_0x218eb3['Smtp']){if(_[_0x162b('0x69')](_0x452d36[_0x162b('0x5a')][_0x162b('0x9a')])){_0x452d36[_0x162b('0x5a')][_0x162b('0x9a')]=util[_0x162b('0x95')](_0x162b('0x9b'),_0x218eb3[_0x162b('0x35')],_0x218eb3[_0x162b('0x67')]||_0x218eb3[_0x162b('0x3b')][_0x162b('0x6e')]);}if(_0x452d36[_0x162b('0x5a')]['attachments']&&_0x452d36[_0x162b('0x5a')][_0x162b('0x9c')][_0x162b('0x48')]){for(var _0x37bdc2=0x0;_0x37bdc2<_0x452d36[_0x162b('0x5a')]['attachments'][_0x162b('0x48')];_0x37bdc2+=0x1){_0x452d36['body'][_0x162b('0x9c')][_0x37bdc2]={'filename':_0x452d36['body']['attachments'][_0x37bdc2]['name'],'path':path[_0x162b('0x9d')](config[_0x162b('0x9e')],_0x162b('0x9f'),_0x452d36['body']['attachments'][_0x37bdc2]['basename'])};}}var _0x352e21={'tls':{'rejectUnauthorized':![]}};if(_[_0x162b('0x69')](_0x218eb3[_0x162b('0x3b')]['service'])){if(_0x218eb3[_0x162b('0x3b')]['authentication']){_0x352e21[_0x162b('0xa0')]={'user':_0x218eb3[_0x162b('0x3b')]['user'],'pass':_0x218eb3[_0x162b('0x3b')][_0x162b('0x71')]};}_0x352e21['host']=_0x218eb3['Smtp']['host'];_0x352e21['port']=_0x218eb3[_0x162b('0x3b')][_0x162b('0x74')];_0x352e21['secure']=_0x218eb3[_0x162b('0x3b')]['secure'];}else{_0x352e21[_0x162b('0x75')]=_0x218eb3['Smtp'][_0x162b('0x75')];_0x352e21[_0x162b('0xa0')]={'user':_0x218eb3['Smtp'][_0x162b('0x6e')],'pass':_0x218eb3['Smtp'][_0x162b('0x71')]};}return respondWithRpcPromise(_0x162b('0xa1'),_0x162b('0xa2'),{'account':_0x352e21,'message':_0x452d36[_0x162b('0x5a')]});}else{throw new Error(_0x162b('0xa3'));}}})['then'](function(_0x541d62){if(_0x541d62){_0x57d631=_0x541d62;if(_0x2a370d[_0x162b('0x97')]){if(_0x2a370d[_0x162b('0x97')]['Contacts']['length']){return _0x2a370d[_0x162b('0x97')][_0x162b('0xa4')][0x0];}else{return db['CmContact'][_0x162b('0x5d')](_[_0x162b('0xa5')](_0x452d36[_0x162b('0x5a')],{'firstName':_0x452d36[_0x162b('0x5a')]['to'],'email':_0x452d36[_0x162b('0x5a')]['to'],'phone':_0x452d36['body']['to'],'ListId':_0x2a370d[_0x162b('0x68')]}));}}else{throw new Error(_0x162b('0xa3'));}}})['then'](function(_0x417e4c){if(_0x417e4c){var _0x21167f={'UserId':_0x452d36[_0x162b('0x6e')]['id'],'ContactId':_0x417e4c['id'],'MailAccountId':_0x2a370d['id'],'inReplyTo':_0x57d631['messageId'],'to':_0x452d36[_0x162b('0x5a')][_0x162b('0x9a')],'cc':_0x452d36['body']['cc'],'subject':_0x452d36[_0x162b('0x5a')][_0x162b('0xa6')],'attach':_0x452d36[_0x162b('0x5a')][_0x162b('0xa7')],'firstMsgDirection':_0x162b('0xa8'),'lastMsgAt':moment()[_0x162b('0x95')](_0x162b('0xa9')),'lastMsgDirection':_0x162b('0xa8'),'lastMsgBody':_0x452d36[_0x162b('0x5a')][_0x162b('0x5a')],'Messages':[_['merge'](_0x452d36['body'],{'messageId':_0x57d631[_0x162b('0xaa')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'read':!![],'MailAccountId':_0x2a370d['id'],'UserId':_0x452d36[_0x162b('0x6e')]['id'],'ContactId':_0x417e4c['id']})]};if(_0x452d36['body'][_0x162b('0xab')]){_0x21167f=_[_0x162b('0x53')](_0x21167f,_0x452d36['body'][_0x162b('0xab')]);}return db[_0x162b('0x85')][_0x162b('0x5d')](_0x21167f,{'include':[{'model':db['MailMessage'],'as':_0x162b('0xac')}]});}})[_0x162b('0x30')](respondWithResult(_0x853c66,null))['catch'](handleError(_0x853c66,null));};exports[_0x162b('0xad')]=function(_0x519966,_0x36b8ec,_0x180671){return db[_0x162b('0x3f')][_0x162b('0x5b')]({'where':{'id':_0x519966['params']['id']},'include':[{'model':db[_0x162b('0x3a')],'as':_0x162b('0x3b'),'raw':!![]}]})[_0x162b('0x30')](handleEntityNotFound(_0x36b8ec,null))[_0x162b('0x30')](function(_0x594a83){if(_0x594a83&&_0x594a83['Smtp']){var _0x2956f6={'id':_0x594a83['id'],'tls':{'rejectUnauthorized':![]}};if(_0x594a83[_0x162b('0x3b')]['service']){_0x2956f6[_0x162b('0x75')]=_0x594a83[_0x162b('0x3b')][_0x162b('0x75')];}else{_0x2956f6[_0x162b('0x73')]=_0x594a83[_0x162b('0x3b')][_0x162b('0x73')];_0x2956f6[_0x162b('0x74')]=_0x594a83[_0x162b('0x3b')][_0x162b('0x74')];_0x2956f6[_0x162b('0xae')]=_0x594a83[_0x162b('0x3b')]['secure'];}if(_0x594a83['Smtp'][_0x162b('0x72')]){_0x2956f6['auth']={'user':_0x594a83[_0x162b('0x3b')][_0x162b('0x6e')],'pass':_0x594a83[_0x162b('0x3b')][_0x162b('0x71')]};}return respondWithRpcPromise(_0x162b('0xaf'),_0x162b('0xad'),{'account':_0x2956f6});}})['then'](respondWithResult(_0x36b8ec,null))[_0x162b('0x26')](handleError(_0x36b8ec,null));};exports[_0x162b('0x33')]=function(_0x42a6a4,_0x5d1b98){return db[_0x162b('0x3f')]['find']({'where':{'id':_0x42a6a4[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x5d1b98,null))[_0x162b('0x30')](function(_0x76d901){if(_0x76d901&&_0x76d901['service']){throw new db[(_0x162b('0xb0'))][(_0x162b('0x1c'))](_0x162b('0xb1'));}return _0x76d901;})[_0x162b('0x30')](removeEntity(_0x5d1b98,null))['catch'](handleError(_0x5d1b98,null));};exports[_0x162b('0xb2')]=function(_0x562f9c,_0x35a1a5,_0x4de55c){return db['MailAccount'][_0x162b('0x5b')]({'where':{'id':_0x562f9c[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x35a1a5,null))['then'](function(_0x300314){if(_0x300314){return _0x300314[_0x162b('0xb2')](_0x562f9c[_0x162b('0x5a')][_0x162b('0x64')],_[_0x162b('0x84')](_0x562f9c['body'],[_0x162b('0x64'),'id'])||{})['spread'](function(_0x4350df){for(var _0x1e15f3=0x0;_0x1e15f3<_0x562f9c[_0x162b('0x5a')][_0x162b('0x64')][_0x162b('0x48')];_0x1e15f3+=0x1){socket[_0x162b('0xb3')](_0x162b('0xb4'),{'UserId':_0x562f9c['body'][_0x162b('0x64')][_0x1e15f3],'MailAccountId':_0x562f9c[_0x162b('0x59')]['id']});}return _0x4350df;});}})[_0x162b('0x30')](respondWithResult(_0x35a1a5,null))[_0x162b('0x26')](handleError(_0x35a1a5,null));};exports[_0x162b('0xb5')]=function(_0x11b1df,_0x12beb8,_0x41db06){return db['MailAccount'][_0x162b('0x5b')]({'where':{'id':_0x11b1df[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x12beb8,null))[_0x162b('0x30')](function(_0x47d699){if(_0x47d699){return _0x47d699[_0x162b('0xb5')](_0x11b1df[_0x162b('0x43')][_0x162b('0x64')])['then'](function(){if(_['isArray'](_0x11b1df[_0x162b('0x43')][_0x162b('0x64')])){for(var _0x576d72=0x0;_0x576d72<_0x11b1df[_0x162b('0x43')]['ids'][_0x162b('0x48')];_0x576d72+=0x1){socket[_0x162b('0xb3')](_0x162b('0xb6'),{'UserId':Number(_0x11b1df[_0x162b('0x43')][_0x162b('0x64')][_0x576d72]),'MailAccountId':Number(_0x11b1df[_0x162b('0x59')]['id'])});}}else{socket[_0x162b('0xb3')](_0x162b('0xb6'),{'UserId':Number(_0x11b1df[_0x162b('0x43')][_0x162b('0x64')]),'MailAccountId':Number(_0x11b1df['params']['id'])});}});}})['then'](respondWithStatusCode(_0x12beb8,null))[_0x162b('0x26')](handleError(_0x12beb8,null));};exports['getAgents']=function(_0x3e5d73,_0x14ccb0,_0x4962f0){var _0x3b60bf={};var _0x35eafc={};var _0x365322;var _0x4693f9;return db['MailAccount'][_0x162b('0x5f')]({'where':{'id':_0x3e5d73[_0x162b('0x59')]['id']}})[_0x162b('0x30')](handleEntityNotFound(_0x14ccb0,null))['then'](function(_0x35a8bf){if(_0x35a8bf){_0x365322=_0x35a8bf;_0x35eafc[_0x162b('0x42')]=_[_0x162b('0x44')](db[_0x162b('0x88')][_0x162b('0x40')]);_0x35eafc['query']=_[_0x162b('0x44')](_0x3e5d73[_0x162b('0x43')]);_0x35eafc[_0x162b('0x4f')]=_['intersection'](_0x35eafc[_0x162b('0x42')],_0x35eafc['query']);_0x3b60bf[_0x162b('0x46')]=_['intersection'](_0x35eafc[_0x162b('0x42')],qs['fields'](_0x3e5d73[_0x162b('0x43')][_0x162b('0x47')]));_0x3b60bf['attributes']=_0x3b60bf['attributes'][_0x162b('0x48')]?_0x3b60bf[_0x162b('0x46')]:_0x35eafc[_0x162b('0x42')];_0x3b60bf[_0x162b('0x4c')]=qs['sort'](_0x3e5d73[_0x162b('0x43')]['sort']);_0x3b60bf['where']=qs['filters'](_[_0x162b('0x61')](_0x3e5d73['query'],_0x35eafc[_0x162b('0x4f')]));if(_0x3e5d73[_0x162b('0x43')][_0x162b('0x50')]){_0x3b60bf[_0x162b('0x4e')]=_[_0x162b('0x53')](_0x3b60bf['where'],{'$or':_[_0x162b('0x3e')](_0x3b60bf[_0x162b('0x46')],function(_0x136380){var _0x31f578={};_0x31f578[_0x136380]={'$like':'%'+_0x3e5d73['query'][_0x162b('0x50')]+'%'};return _0x31f578;})});}_0x3b60bf=_[_0x162b('0x53')]({},_0x3b60bf,_0x3e5d73['options']);return _0x365322[_0x162b('0xb7')](_0x3b60bf);}})[_0x162b('0x30')](function(_0x47894b){if(_0x47894b){_0x4693f9=_0x47894b[_0x162b('0x48')];if(!_0x3e5d73[_0x162b('0x43')][_0x162b('0x49')](_0x162b('0x4a'))){_0x3b60bf[_0x162b('0x4b')]=qs[_0x162b('0x4b')](_0x3e5d73['query'][_0x162b('0x4b')]);_0x3b60bf[_0x162b('0x2c')]=qs[_0x162b('0x2c')](_0x3e5d73['query']['offset']);}return _0x365322[_0x162b('0xb7')](_0x3b60bf);}})[_0x162b('0x30')](function(_0x6ca2ab){if(_0x6ca2ab){return _0x6ca2ab?{'count':_0x4693f9,'rows':_0x6ca2ab}:null;}})[_0x162b('0x30')](respondWithResult(_0x14ccb0,null))['catch'](handleError(_0x14ccb0,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index ddf8b2f..385ecd1 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 _0xff33=['save','remove','emit','hasOwnProperty','exports','events','../../mysqldb','MailAccount','setMaxListeners'];(function(_0x487ef7,_0x2d4ac4){var _0x272446=function(_0x47b8bd){while(--_0x47b8bd){_0x487ef7['push'](_0x487ef7['shift']());}};_0x272446(++_0x2d4ac4);}(_0xff33,0x1a3));var _0x3ff3=function(_0x5f1617,_0x46277b){_0x5f1617=_0x5f1617-0x0;var _0x3af5da=_0xff33[_0x5f1617];return _0x3af5da;};'use strict';var EventEmitter=require(_0x3ff3('0x0'));var MailAccount=require(_0x3ff3('0x1'))['db'][_0x3ff3('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0x3ff3('0x3')](0x0);var events={'afterCreate':_0x3ff3('0x4'),'afterUpdate':'update','afterDestroy':_0x3ff3('0x5')};function emitEvent(_0x40c0c1){return function(_0x1df02c,_0x45184b,_0x35c3f1){MailAccountEvents[_0x3ff3('0x6')](_0x40c0c1+':'+_0x1df02c['id'],_0x1df02c);MailAccountEvents[_0x3ff3('0x6')](_0x40c0c1,_0x1df02c);_0x35c3f1(null);};}for(var e in events){if(events[_0x3ff3('0x7')](e)){var event=events[e];MailAccount['hook'](e,emitEvent(event));}}module[_0x3ff3('0x8')]=MailAccountEvents; \ No newline at end of file +var _0x3c72=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update','remove'];(function(_0x12e3cb,_0x56b424){var _0x381e17=function(_0x34f495){while(--_0x34f495){_0x12e3cb['push'](_0x12e3cb['shift']());}};_0x381e17(++_0x56b424);}(_0x3c72,0x1ee));var _0x23c7=function(_0x13d541,_0x1df5ba){_0x13d541=_0x13d541-0x0;var _0x25e69a=_0x3c72[_0x13d541];return _0x25e69a;};'use strict';var EventEmitter=require(_0x23c7('0x0'));var MailAccount=require(_0x23c7('0x1'))['db'][_0x23c7('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x23c7('0x3'),'afterUpdate':_0x23c7('0x4'),'afterDestroy':_0x23c7('0x5')};function emitEvent(_0x4c72e2){return function(_0x350708,_0xbe9c8a,_0x4e853b){MailAccountEvents[_0x23c7('0x6')](_0x4c72e2+':'+_0x350708['id'],_0x350708);MailAccountEvents[_0x23c7('0x6')](_0x4c72e2,_0x350708);_0x4e853b(null);};}for(var e in events){if(events[_0x23c7('0x7')](e)){var event=events[e];MailAccount[_0x23c7('0x8')](e,emitEvent(event));}}module[_0x23c7('0x9')]=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index c427b27..36c967f 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 _0x52a6=['util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./mailAccount.attributes','exports','MailAccount','mail_accounts','lodash'];(function(_0xe5742c,_0x11503e){var _0x3db329=function(_0x2afb66){while(--_0x2afb66){_0xe5742c['push'](_0xe5742c['shift']());}};_0x3db329(++_0x11503e);}(_0x52a6,0xe3));var _0x652a=function(_0x440fea,_0x167a14){_0x440fea=_0x440fea-0x0;var _0x5e09ab=_0x52a6[_0x440fea];return _0x5e09ab;};'use strict';var _=require(_0x652a('0x0'));var util=require(_0x652a('0x1'));var logger=require(_0x652a('0x2'))(_0x652a('0x3'));var moment=require('moment');var BPromise=require(_0x652a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x652a('0x5'));var rimraf=require(_0x652a('0x6'));var config=require(_0x652a('0x7'));var attributes=require(_0x652a('0x8'));module[_0x652a('0x9')]=function(_0x3e69a1,_0x1c538e){return _0x3e69a1['define'](_0x652a('0xa'),attributes,{'tableName':_0x652a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd1a8=['lodash','moment','bluebird','request-promise','path','rimraf','./mailAccount.attributes','exports','define','MailAccount','mail_accounts'];(function(_0x158ad3,_0x3a5116){var _0x4fd00e=function(_0x2255e0){while(--_0x2255e0){_0x158ad3['push'](_0x158ad3['shift']());}};_0x4fd00e(++_0x3a5116);}(_0xd1a8,0x9a));var _0x8d1a=function(_0x39b78f,_0x24a531){_0x39b78f=_0x39b78f-0x0;var _0xa81f6f=_0xd1a8[_0x39b78f];return _0xa81f6f;};'use strict';var _=require(_0x8d1a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x8d1a('0x1'));var BPromise=require(_0x8d1a('0x2'));var rp=require(_0x8d1a('0x3'));var fs=require('fs');var path=require(_0x8d1a('0x4'));var rimraf=require(_0x8d1a('0x5'));var config=require('../../config/environment');var attributes=require(_0x8d1a('0x6'));module[_0x8d1a('0x7')]=function(_0x409868,_0x396689){return _0x409868[_0x8d1a('0x8')](_0x8d1a('0x9'),attributes,{'tableName':_0x8d1a('0xa'),'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 eda534a..357e02b 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 _0xf151=['include','map','model','attributes','debug','GetMailAccount','ShowMailAccount','find','where','NotifyMailAccount','mail','difference','keys','CmContact','updatedAt','ListId','body','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','from','CmList','List','Contacts','DESC','MailApplication','Applications','MailServerOut','get','account','omit','list','applications','orderBy','priority','asc','autoclose','push','length','*,*,*,*','List\x20not\x20found','contact','messageId','generate','subject','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','Messages','inReplyTo','spread','update','attach','interaction','created','MailMessage','originTo','originCc','bcc','Attachment','name','UserId','unshift','agent','waitForTheAssignedAgent','Start','startRouting','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','redis','localhost','./mailAccount.socket','then','info','MailAccount,\x20%s,\x20%s','MailAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','MailAccount','findAll','options','raw','limit'];(function(_0x48d6f1,_0x23f072){var _0x22abdf=function(_0x1d231f){while(--_0x1d231f){_0x48d6f1['push'](_0x48d6f1['shift']());}};_0x22abdf(++_0x23f072);}(_0xf151,0xab));var _0x1f15=function(_0x39284d,_0x638ad){_0x39284d=_0x39284d-0x0;var _0x3ca51a=_0xf151[_0x39284d];return _0x3ca51a;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x1f15('0x0'));var BPromise=require(_0x1f15('0x1'));var rs=require(_0x1f15('0x2'));var fs=require('fs');var Redis=require(_0x1f15('0x3'));var db=require(_0x1f15('0x4'))['db'];var utils=require(_0x1f15('0x5'));var logger=require(_0x1f15('0x6'))(_0x1f15('0x7'));var config=require('../../config/environment');var jayson=require(_0x1f15('0x8'));var client=jayson['client']['http']({'port':0x232c});config['redis']=_[_0x1f15('0x9')](config[_0x1f15('0xa')],{'host':_0x1f15('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1f15('0xa')]));require(_0x1f15('0xc'))['register'](socket);function respondWithRpcPromise(_0x4e6f42,_0x111a59,_0x2baa12){return new BPromise(function(_0x151020,_0x435cf2){return client['request'](_0x4e6f42,_0x2baa12)[_0x1f15('0xd')](function(_0x25d5f3){logger[_0x1f15('0xe')](_0x1f15('0xf'),_0x111a59,'request\x20sent');logger['debug'](_0x1f15('0x10'),_0x111a59,_0x1f15('0x11'),JSON[_0x1f15('0x12')](_0x25d5f3));if(_0x25d5f3[_0x1f15('0x13')]){if(_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x14')]===0x1f4){logger['error'](_0x1f15('0xf'),_0x111a59,_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x15')]);return _0x435cf2(_0x25d5f3[_0x1f15('0x13')]['message']);}logger[_0x1f15('0x13')]('MailAccount,\x20%s,\x20%s',_0x111a59,_0x25d5f3[_0x1f15('0x13')][_0x1f15('0x15')]);return _0x151020(_0x25d5f3[_0x1f15('0x13')]['message']);}else{logger['info'](_0x1f15('0xf'),_0x111a59,_0x1f15('0x11'));_0x151020(_0x25d5f3[_0x1f15('0x16')]['message']);}})[_0x1f15('0x17')](function(_0x4c1b19){logger[_0x1f15('0x13')](_0x1f15('0xf'),_0x111a59,_0x4c1b19);_0x435cf2(_0x4c1b19);});});}exports['GetMailAccount']=function(_0x566a61){var _0x274273=this;return new Promise(function(_0x5d2140,_0x4542a8){return db[_0x1f15('0x18')][_0x1f15('0x19')]({'raw':_0x566a61[_0x1f15('0x1a')]?_0x566a61[_0x1f15('0x1a')][_0x1f15('0x1b')]===undefined?!![]:![]:!![],'where':_0x566a61[_0x1f15('0x1a')]?_0x566a61['options']['where']||null:null,'attributes':_0x566a61[_0x1f15('0x1a')]?_0x566a61[_0x1f15('0x1a')]['attributes']||null:null,'limit':_0x566a61['options']?_0x566a61[_0x1f15('0x1a')][_0x1f15('0x1c')]||null:null,'include':_0x566a61[_0x1f15('0x1a')]?_0x566a61['options'][_0x1f15('0x1d')]?_[_0x1f15('0x1e')](_0x566a61[_0x1f15('0x1a')][_0x1f15('0x1d')],function(_0x262121){return{'model':db[_0x262121[_0x1f15('0x1f')]],'as':_0x262121['as'],'attributes':_0x262121[_0x1f15('0x20')],'include':_0x262121[_0x1f15('0x1d')]?_[_0x1f15('0x1e')](_0x262121['include'],function(_0x159de2){return{'model':db[_0x159de2['model']],'as':_0x159de2['as'],'attributes':_0x159de2[_0x1f15('0x20')],'include':_0x159de2[_0x1f15('0x1d')]?_['map'](_0x159de2[_0x1f15('0x1d')],function(_0x610939){return{'model':db[_0x610939[_0x1f15('0x1f')]],'as':_0x610939['as'],'attributes':_0x610939['attributes']};}):[]};}):[]};}):[]:[]})[_0x1f15('0xd')](function(_0x14f9f4){logger[_0x1f15('0xe')]('GetMailAccount',_0x566a61);logger[_0x1f15('0x21')]('GetMailAccount',_0x566a61,JSON[_0x1f15('0x12')](_0x14f9f4));_0x5d2140(_0x14f9f4);})['catch'](function(_0x3835f1){logger[_0x1f15('0x13')](_0x1f15('0x22'),_0x3835f1[_0x1f15('0x15')],_0x566a61);_0x4542a8(_0x274273[_0x1f15('0x13')](0x1f4,_0x3835f1[_0x1f15('0x15')]));});});};exports[_0x1f15('0x23')]=function(_0x4343e7){var _0x5666e4=this;return new Promise(function(_0x4a3e2a,_0x3847b4){return db[_0x1f15('0x18')][_0x1f15('0x24')]({'raw':_0x4343e7[_0x1f15('0x1a')]?_0x4343e7[_0x1f15('0x1a')][_0x1f15('0x1b')]===undefined?!![]:![]:!![],'where':_0x4343e7['options']?_0x4343e7[_0x1f15('0x1a')][_0x1f15('0x25')]||null:null,'attributes':_0x4343e7[_0x1f15('0x1a')]?_0x4343e7[_0x1f15('0x1a')]['attributes']||null:null,'include':_0x4343e7['options']?_0x4343e7['options']['include']?_[_0x1f15('0x1e')](_0x4343e7[_0x1f15('0x1a')][_0x1f15('0x1d')],function(_0x23c1d9){return{'model':db[_0x23c1d9['model']],'as':_0x23c1d9['as'],'attributes':_0x23c1d9[_0x1f15('0x20')],'include':_0x23c1d9['include']?_[_0x1f15('0x1e')](_0x23c1d9[_0x1f15('0x1d')],function(_0x14eb07){return{'model':db[_0x14eb07[_0x1f15('0x1f')]],'as':_0x14eb07['as'],'attributes':_0x14eb07[_0x1f15('0x20')],'include':_0x14eb07[_0x1f15('0x1d')]?_['map'](_0x14eb07[_0x1f15('0x1d')],function(_0x24ea8f){return{'model':db[_0x24ea8f['model']],'as':_0x24ea8f['as'],'attributes':_0x24ea8f[_0x1f15('0x20')]};}):[]};}):[]};}):[]:[]})[_0x1f15('0xd')](function(_0x40308b){logger['info'](_0x1f15('0x23'),_0x4343e7);logger[_0x1f15('0x21')]('ShowMailAccount',_0x4343e7,JSON['stringify'](_0x40308b));_0x4a3e2a(_0x40308b);})[_0x1f15('0x17')](function(_0x42d9ca){logger['error'](_0x1f15('0x23'),_0x42d9ca[_0x1f15('0x15')],_0x4343e7);_0x3847b4(_0x5666e4['error'](0x1f4,_0x42d9ca[_0x1f15('0x15')]));});});};exports[_0x1f15('0x26')]=function(_0x5c566e){var _0x112b38=this;return new Promise(function(_0x52924f,_0x5b6512){var _0x5156fb={'body':_0x5c566e['body'],'channel':_0x1f15('0x27')};var _0x1a0c9e=_[_0x1f15('0x28')](_[_0x1f15('0x29')](db[_0x1f15('0x2a')]['rawAttributes']),['createdAt',_0x1f15('0x2b'),'CompanyId',_0x1f15('0x2c')]);var _0x58c43e=![];if(_0x5c566e[_0x1f15('0x2d')]['id']){delete _0x5c566e[_0x1f15('0x2d')]['id'];}if(_[_0x1f15('0x2e')](_0x5c566e[_0x1f15('0x2d')]['from'])){return _0x5b6512(_0x112b38[_0x1f15('0x13')](0x1f4,_0x1f15('0x2f')));}if(_[_0x1f15('0x2e')](_0x5c566e[_0x1f15('0x2d')]['body'])||_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x2d')]===''){return _0x5b6512(_0x112b38['error'](0x1f4,_0x1f15('0x30')));}if(_['isNil'](_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x31')])){return _0x5b6512(_0x112b38[_0x1f15('0x13')](0x1f4,_0x1f15('0x32')+_0x1a0c9e));}if(!_[_0x1f15('0x33')](_0x1a0c9e,_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x31')])){return _0x5b6512(_0x112b38[_0x1f15('0x13')](0x1f4,_0x1f15('0x34')+_0x1a0c9e));}var _0x54a63f={};_0x54a63f[_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x31')]]=_0x5c566e['body'][_0x1f15('0x35')];return db[_0x1f15('0x18')][_0x1f15('0x24')]({'where':{'id':_0x5c566e['account']['id']},'include':[{'model':db[_0x1f15('0x36')],'as':_0x1f15('0x37'),'include':[{'model':db['CmContact'],'as':_0x1f15('0x38'),'where':_0x54a63f,'limit':0x1,'order':[['updatedAt',_0x1f15('0x39')]]}]},{'model':db[_0x1f15('0x3a')],'as':_0x1f15('0x3b')},{'model':db[_0x1f15('0x3c')],'as':'Smtp'}]})[_0x1f15('0xd')](function(_0x383004){if(_0x383004&&_0x383004[_0x1f15('0x37')]){var _0x36a5f5=_0x383004[_0x1f15('0x3d')]({'plain':!![]});_0x5156fb[_0x1f15('0x3e')]=_[_0x1f15('0x3f')](_0x36a5f5,[_0x1f15('0x3b'),_0x1f15('0x37')]);_0x5156fb['applications']=_0x36a5f5[_0x1f15('0x3b')];_0x5156fb[_0x1f15('0x40')]=_0x36a5f5['List'];_0x5156fb[_0x1f15('0x41')]=_[_0x1f15('0x42')](_0x5156fb[_0x1f15('0x41')],[_0x1f15('0x43')],[_0x1f15('0x44')]);if(_0x5156fb['account']&&_0x5156fb[_0x1f15('0x3e')][_0x1f15('0x45')]){_0x5156fb[_0x1f15('0x41')][_0x1f15('0x46')]({'id':0x0,'priority':_0x5156fb[_0x1f15('0x41')][_0x1f15('0x47')]+0x1,'app':'close','appdata':_0x1f15('0x45'),'interval':_0x1f15('0x48')});}if(_0x5156fb[_0x1f15('0x3e')][_0x1f15('0x3b')]){delete _0x5156fb[_0x1f15('0x3e')][_0x1f15('0x3b')];}if(_0x5156fb[_0x1f15('0x3e')]['List']){delete _0x5156fb['account'][_0x1f15('0x37')];}if(_0x36a5f5[_0x1f15('0x37')][_0x1f15('0x38')][_0x1f15('0x47')]){return _0x36a5f5[_0x1f15('0x37')][_0x1f15('0x38')][0x0];}var _0x4eacc5=_[_0x1f15('0x9')](_0x5c566e[_0x1f15('0x2d')],{'firstName':_0x5c566e[_0x1f15('0x2d')]['from'],'ListId':_0x36a5f5['ListId']});_0x4eacc5[_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x31')]]=_0x5c566e['body'][_0x1f15('0x35')];return db['CmContact']['create'](_0x4eacc5);}else{throw new Error(_0x1f15('0x49'));}})[_0x1f15('0xd')](function(_0x3038d9){_0x5156fb[_0x1f15('0x4a')]=_0x3038d9;if(_0x3038d9){if(!_0x5c566e['body'][_0x1f15('0x15')][_0x1f15('0x4b')]){_0x5c566e['body'][_0x1f15('0x15')][_0x1f15('0x4b')]=rs[_0x1f15('0x4c')]()+'\x20'+_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x35')];}var _0x29d749={'ContactId':_0x3038d9['id'],'MailAccountId':_0x5c566e[_0x1f15('0x3e')]['id'],'inReplyTo':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x4b')],'to':_0x5c566e[_0x1f15('0x2d')]['message']['from'],'cc':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['cc'],'subject':_0x5c566e['body'][_0x1f15('0x15')][_0x1f15('0x4d')],'attach':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['attach'],'lastMsgAt':moment()[_0x1f15('0x4e')](_0x1f15('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x5c566e['body'][_0x1f15('0x2d')]};return db[_0x1f15('0x50')]['find']({'where':{'closed':![],'MailAccountId':_0x5c566e[_0x1f15('0x3e')]['id']},'include':[{'model':db['MailMessage'],'as':_0x1f15('0x51'),'attributes':[_0x1f15('0x4b')],'where':{'messageId':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x52')]}}]})['then'](function(_0x36c580){if(_0x36c580){return[_0x36c580,![]];}return db['MailInteraction']['create'](_0x29d749)[_0x1f15('0xd')](function(_0x3f9b3a){return[_0x3f9b3a,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0x1f15('0x53')](function(_0x38e39a,_0x375396){if(_0x38e39a){_0x58c43e=_0x375396;if(!_0x375396){return _0x38e39a[_0x1f15('0x54')]({'inReplyTo':_0x5c566e['body'][_0x1f15('0x15')][_0x1f15('0x4b')],'to':_0x5c566e[_0x1f15('0x2d')]['message'][_0x1f15('0x35')],'cc':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['cc'],'subject':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x4d')],'attach':_0x38e39a[_0x1f15('0x55')]?_0x38e39a[_0x1f15('0x55')]:_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x55')],'substatus':null,'substatusAt':moment()[_0x1f15('0x4e')](_0x1f15('0x4f')),'lastMsgAt':moment()['format'](_0x1f15('0x4f')),'lastMsgDirection':'in','lastMsgBody':_0x5c566e[_0x1f15('0x2d')]['body']});}else{return _0x38e39a;}}})['then'](function(_0x3243b4){_0x5156fb[_0x1f15('0x56')]=_0x3243b4[_0x1f15('0x3d')]({'plain':!![]});_0x5156fb['interaction'][_0x1f15('0x57')]=_0x58c43e;return db[_0x1f15('0x58')]['create']({'body':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x2d')],'MailAccountId':_0x5c566e[_0x1f15('0x3e')]['id'],'MailInteractionId':_0x3243b4['id'],'direction':'in','ContactId':_0x5156fb[_0x1f15('0x4a')]['id'],'messageId':_0x5c566e['body']['message'][_0x1f15('0x4b')],'from':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['from'],'to':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['to'],'cc':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['cc'],'subject':_0x5c566e[_0x1f15('0x2d')]['message']['subject'],'attach':_0x5c566e['body'][_0x1f15('0x15')]['attach'],'Attachments':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')]['attachments'],'originTo':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x59')],'originCc':_0x5c566e[_0x1f15('0x2d')][_0x1f15('0x15')][_0x1f15('0x5a')],'bcc':_0x5c566e['body'][_0x1f15('0x15')][_0x1f15('0x5b')]},{'include':[{'model':db[_0x1f15('0x5c')],'as':'Attachments'}]});})[_0x1f15('0xd')](function(_0x399eb7){_0x5156fb['message']=_0x399eb7;if(_0x5156fb[_0x1f15('0x56')]['UserId']){return db['User'][_0x1f15('0x24')]({'attributes':['id',_0x1f15('0x5d')],'where':{'id':_0x5156fb['interaction'][_0x1f15('0x5e')]}})[_0x1f15('0xd')](function(_0x96b7e){if(_0x96b7e){_0x5156fb[_0x1f15('0x41')][_0x1f15('0x5f')]({'id':0x0,'priority':0x0,'app':_0x1f15('0x60'),'appdata':_0x96b7e['name']+','+(_0x5156fb[_0x1f15('0x3e')][_0x1f15('0x61')]||0xa),'interval':_0x1f15('0x48')});}return respondWithRpcPromise(_0x1f15('0x62'),'startRouting',_0x5156fb);});}return respondWithRpcPromise('Start',_0x1f15('0x63'),_0x5156fb);})[_0x1f15('0xd')](function(_0x58c209){_0x52924f(_0x58c209);})[_0x1f15('0x17')](function(_0x38332a){_0x5b6512(_0x112b38[_0x1f15('0x13')](0x1f4,_0x38332a[_0x1f15('0x15')]));});});}; \ No newline at end of file +var _0x1978=['./mailAccount.socket','register','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','GetMailAccount','MailAccount','options','raw','where','attributes','include','model','map','ShowMailAccount','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','createdAt','updatedAt','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','Contacts','DESC','MailApplication','Applications','MailServerOut','Smtp','List','get','omit','list','applications','autoclose','length','close','*,*,*,*','ListId','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','update','interaction','created','originTo','originCc','name','UserId','waitForTheAssignedAgent','Start','startRouting','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x44b8d2,_0x57c149){var _0x13d088=function(_0x37da05){while(--_0x37da05){_0x44b8d2['push'](_0x44b8d2['shift']());}};_0x13d088(++_0x57c149);}(_0x1978,0x174));var _0x8197=function(_0x43af79,_0x7069ef){_0x43af79=_0x43af79-0x0;var _0x1c5fe1=_0x1978[_0x43af79];return _0x1c5fe1;};'use strict';var _=require('lodash');var util=require(_0x8197('0x0'));var moment=require(_0x8197('0x1'));var BPromise=require(_0x8197('0x2'));var rs=require(_0x8197('0x3'));var fs=require('fs');var Redis=require(_0x8197('0x4'));var db=require(_0x8197('0x5'))['db'];var utils=require(_0x8197('0x6'));var logger=require(_0x8197('0x7'))(_0x8197('0x8'));var config=require(_0x8197('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8197('0xa')][_0x8197('0xb')]({'port':0x232c});config[_0x8197('0xc')]=_[_0x8197('0xd')](config[_0x8197('0xc')],{'host':_0x8197('0xe'),'port':0x18eb});var socket=require(_0x8197('0xf'))(new Redis(config[_0x8197('0xc')]));require(_0x8197('0x10'))[_0x8197('0x11')](socket);function respondWithRpcPromise(_0x471393,_0x20fb39,_0x3d62ac){return new BPromise(function(_0x143695,_0x2e20a2){return client['request'](_0x471393,_0x3d62ac)[_0x8197('0x12')](function(_0x3da9b7){logger[_0x8197('0x13')](_0x8197('0x14'),_0x20fb39,_0x8197('0x15'));logger[_0x8197('0x16')]('MailAccount,\x20%s,\x20%s,\x20%s',_0x20fb39,'request\x20sent',JSON[_0x8197('0x17')](_0x3da9b7));if(_0x3da9b7[_0x8197('0x18')]){if(_0x3da9b7[_0x8197('0x18')][_0x8197('0x19')]===0x1f4){logger[_0x8197('0x18')]('MailAccount,\x20%s,\x20%s',_0x20fb39,_0x3da9b7[_0x8197('0x18')]['message']);return _0x2e20a2(_0x3da9b7[_0x8197('0x18')]['message']);}logger[_0x8197('0x18')]('MailAccount,\x20%s,\x20%s',_0x20fb39,_0x3da9b7[_0x8197('0x18')][_0x8197('0x1a')]);return _0x143695(_0x3da9b7['error'][_0x8197('0x1a')]);}else{logger['info']('MailAccount,\x20%s,\x20%s',_0x20fb39,_0x8197('0x15'));_0x143695(_0x3da9b7['result'][_0x8197('0x1a')]);}})[_0x8197('0x1b')](function(_0x4d858a){logger[_0x8197('0x18')]('MailAccount,\x20%s,\x20%s',_0x20fb39,_0x4d858a);_0x2e20a2(_0x4d858a);});});}exports[_0x8197('0x1c')]=function(_0x2938df){var _0x43fdf0=this;return new Promise(function(_0x6506c7,_0x22e831){return db[_0x8197('0x1d')]['findAll']({'raw':_0x2938df[_0x8197('0x1e')]?_0x2938df[_0x8197('0x1e')][_0x8197('0x1f')]===undefined?!![]:![]:!![],'where':_0x2938df['options']?_0x2938df['options'][_0x8197('0x20')]||null:null,'attributes':_0x2938df[_0x8197('0x1e')]?_0x2938df[_0x8197('0x1e')][_0x8197('0x21')]||null:null,'limit':_0x2938df[_0x8197('0x1e')]?_0x2938df[_0x8197('0x1e')]['limit']||null:null,'include':_0x2938df[_0x8197('0x1e')]?_0x2938df[_0x8197('0x1e')][_0x8197('0x22')]?_['map'](_0x2938df[_0x8197('0x1e')][_0x8197('0x22')],function(_0x276d45){return{'model':db[_0x276d45[_0x8197('0x23')]],'as':_0x276d45['as'],'attributes':_0x276d45[_0x8197('0x21')],'include':_0x276d45[_0x8197('0x22')]?_[_0x8197('0x24')](_0x276d45['include'],function(_0x88c64e){return{'model':db[_0x88c64e[_0x8197('0x23')]],'as':_0x88c64e['as'],'attributes':_0x88c64e[_0x8197('0x21')],'include':_0x88c64e[_0x8197('0x22')]?_[_0x8197('0x24')](_0x88c64e[_0x8197('0x22')],function(_0x4b8729){return{'model':db[_0x4b8729[_0x8197('0x23')]],'as':_0x4b8729['as'],'attributes':_0x4b8729[_0x8197('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x456d95){logger[_0x8197('0x13')]('GetMailAccount',_0x2938df);logger[_0x8197('0x16')](_0x8197('0x1c'),_0x2938df,JSON[_0x8197('0x17')](_0x456d95));_0x6506c7(_0x456d95);})[_0x8197('0x1b')](function(_0x47a3f2){logger[_0x8197('0x18')](_0x8197('0x1c'),_0x47a3f2['message'],_0x2938df);_0x22e831(_0x43fdf0['error'](0x1f4,_0x47a3f2['message']));});});};exports[_0x8197('0x25')]=function(_0x1db715){var _0x1b8d92=this;return new Promise(function(_0x494326,_0x23740e){return db[_0x8197('0x1d')]['find']({'raw':_0x1db715['options']?_0x1db715[_0x8197('0x1e')][_0x8197('0x1f')]===undefined?!![]:![]:!![],'where':_0x1db715['options']?_0x1db715['options'][_0x8197('0x20')]||null:null,'attributes':_0x1db715[_0x8197('0x1e')]?_0x1db715[_0x8197('0x1e')][_0x8197('0x21')]||null:null,'include':_0x1db715[_0x8197('0x1e')]?_0x1db715[_0x8197('0x1e')][_0x8197('0x22')]?_[_0x8197('0x24')](_0x1db715[_0x8197('0x1e')][_0x8197('0x22')],function(_0x3ef50a){return{'model':db[_0x3ef50a[_0x8197('0x23')]],'as':_0x3ef50a['as'],'attributes':_0x3ef50a[_0x8197('0x21')],'include':_0x3ef50a[_0x8197('0x22')]?_[_0x8197('0x24')](_0x3ef50a[_0x8197('0x22')],function(_0x423c6c){return{'model':db[_0x423c6c[_0x8197('0x23')]],'as':_0x423c6c['as'],'attributes':_0x423c6c[_0x8197('0x21')],'include':_0x423c6c[_0x8197('0x22')]?_[_0x8197('0x24')](_0x423c6c[_0x8197('0x22')],function(_0x318baf){return{'model':db[_0x318baf['model']],'as':_0x318baf['as'],'attributes':_0x318baf[_0x8197('0x21')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x478566){logger['info'](_0x8197('0x25'),_0x1db715);logger[_0x8197('0x16')](_0x8197('0x25'),_0x1db715,JSON[_0x8197('0x17')](_0x478566));_0x494326(_0x478566);})[_0x8197('0x1b')](function(_0x150fd6){logger[_0x8197('0x18')](_0x8197('0x25'),_0x150fd6['message'],_0x1db715);_0x23740e(_0x1b8d92[_0x8197('0x18')](0x1f4,_0x150fd6[_0x8197('0x1a')]));});});};exports[_0x8197('0x26')]=function(_0x450c6b){var _0x15e6c2=this;return new Promise(function(_0x1a2d7e,_0x57cfe6){var _0x16e5a0={'body':_0x450c6b[_0x8197('0x27')],'channel':_0x8197('0x28')};var _0x883712=_[_0x8197('0x29')](_[_0x8197('0x2a')](db[_0x8197('0x2b')][_0x8197('0x2c')]),[_0x8197('0x2d'),_0x8197('0x2e'),'CompanyId','ListId']);var _0x44f452=![];if(_0x450c6b[_0x8197('0x27')]['id']){delete _0x450c6b[_0x8197('0x27')]['id'];}if(_[_0x8197('0x2f')](_0x450c6b[_0x8197('0x27')][_0x8197('0x30')])){return _0x57cfe6(_0x15e6c2[_0x8197('0x18')](0x1f4,_0x8197('0x31')));}if(_[_0x8197('0x2f')](_0x450c6b[_0x8197('0x27')][_0x8197('0x27')])||_0x450c6b['body']['body']===''){return _0x57cfe6(_0x15e6c2[_0x8197('0x18')](0x1f4,_0x8197('0x32')));}if(_['isNil'](_0x450c6b['body'][_0x8197('0x33')])){return _0x57cfe6(_0x15e6c2['error'](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x883712));}if(!_[_0x8197('0x34')](_0x883712,_0x450c6b['body'][_0x8197('0x33')])){return _0x57cfe6(_0x15e6c2[_0x8197('0x18')](0x1f4,_0x8197('0x35')+_0x883712));}var _0x2534fd={};_0x2534fd[_0x450c6b[_0x8197('0x27')][_0x8197('0x33')]]=_0x450c6b[_0x8197('0x27')][_0x8197('0x30')];return db[_0x8197('0x1d')][_0x8197('0x36')]({'where':{'id':_0x450c6b[_0x8197('0x37')]['id']},'include':[{'model':db[_0x8197('0x38')],'as':'List','include':[{'model':db[_0x8197('0x2b')],'as':_0x8197('0x39'),'where':_0x2534fd,'limit':0x1,'order':[[_0x8197('0x2e'),_0x8197('0x3a')]]}]},{'model':db[_0x8197('0x3b')],'as':_0x8197('0x3c')},{'model':db[_0x8197('0x3d')],'as':_0x8197('0x3e')}]})[_0x8197('0x12')](function(_0x46788b){if(_0x46788b&&_0x46788b[_0x8197('0x3f')]){var _0x17f2cf=_0x46788b[_0x8197('0x40')]({'plain':!![]});_0x16e5a0[_0x8197('0x37')]=_[_0x8197('0x41')](_0x17f2cf,[_0x8197('0x3c'),'List']);_0x16e5a0['applications']=_0x17f2cf[_0x8197('0x3c')];_0x16e5a0[_0x8197('0x42')]=_0x17f2cf['List'];_0x16e5a0['applications']=_['orderBy'](_0x16e5a0[_0x8197('0x43')],['priority'],['asc']);if(_0x16e5a0['account']&&_0x16e5a0['account'][_0x8197('0x44')]){_0x16e5a0[_0x8197('0x43')]['push']({'id':0x0,'priority':_0x16e5a0[_0x8197('0x43')][_0x8197('0x45')]+0x1,'app':_0x8197('0x46'),'appdata':'autoclose','interval':_0x8197('0x47')});}if(_0x16e5a0[_0x8197('0x37')][_0x8197('0x3c')]){delete _0x16e5a0[_0x8197('0x37')][_0x8197('0x3c')];}if(_0x16e5a0[_0x8197('0x37')]['List']){delete _0x16e5a0[_0x8197('0x37')][_0x8197('0x3f')];}if(_0x17f2cf[_0x8197('0x3f')][_0x8197('0x39')][_0x8197('0x45')]){return _0x17f2cf['List'][_0x8197('0x39')][0x0];}var _0x3dee76=_['defaults'](_0x450c6b['body'],{'firstName':_0x450c6b['body']['from'],'ListId':_0x17f2cf[_0x8197('0x48')]});_0x3dee76[_0x450c6b[_0x8197('0x27')][_0x8197('0x33')]]=_0x450c6b['body']['from'];return db['CmContact'][_0x8197('0x49')](_0x3dee76);}else{throw new Error(_0x8197('0x4a'));}})[_0x8197('0x12')](function(_0x5bd0d1){_0x16e5a0[_0x8197('0x4b')]=_0x5bd0d1;if(_0x5bd0d1){if(!_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['messageId']){_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4c')]=rs[_0x8197('0x4d')]()+'\x20'+_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x30')];}var _0x555a45={'ContactId':_0x5bd0d1['id'],'MailAccountId':_0x450c6b[_0x8197('0x37')]['id'],'inReplyTo':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4c')],'to':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x30')],'cc':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['cc'],'subject':_0x450c6b[_0x8197('0x27')]['message'][_0x8197('0x4e')],'attach':_0x450c6b[_0x8197('0x27')]['message'][_0x8197('0x4f')],'lastMsgAt':moment()[_0x8197('0x50')](_0x8197('0x51')),'lastMsgDirection':'in','lastMsgBody':_0x450c6b[_0x8197('0x27')][_0x8197('0x27')]};return db[_0x8197('0x52')][_0x8197('0x36')]({'where':{'closed':![],'MailAccountId':_0x450c6b['account']['id']},'include':[{'model':db[_0x8197('0x53')],'as':_0x8197('0x54'),'attributes':[_0x8197('0x4c')],'where':{'messageId':_0x450c6b[_0x8197('0x27')]['message'][_0x8197('0x55')]}}]})['then'](function(_0x4876ed){if(_0x4876ed){return[_0x4876ed,![]];}return db[_0x8197('0x52')]['create'](_0x555a45)['then'](function(_0x13638c){return[_0x13638c,!![]];});});}else{throw new Error(_0x8197('0x56'));}})['spread'](function(_0x1dc7a2,_0x15e950){if(_0x1dc7a2){_0x44f452=_0x15e950;if(!_0x15e950){return _0x1dc7a2[_0x8197('0x57')]({'inReplyTo':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4c')],'to':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x30')],'cc':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['cc'],'subject':_0x450c6b['body'][_0x8197('0x1a')][_0x8197('0x4e')],'attach':_0x1dc7a2[_0x8197('0x4f')]?_0x1dc7a2[_0x8197('0x4f')]:_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4f')],'substatus':null,'substatusAt':moment()[_0x8197('0x50')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x450c6b[_0x8197('0x27')]['body']});}else{return _0x1dc7a2;}}})[_0x8197('0x12')](function(_0x44e212){_0x16e5a0['interaction']=_0x44e212['get']({'plain':!![]});_0x16e5a0[_0x8197('0x58')][_0x8197('0x59')]=_0x44f452;return db[_0x8197('0x53')][_0x8197('0x49')]({'body':_0x450c6b['body'][_0x8197('0x27')],'MailAccountId':_0x450c6b[_0x8197('0x37')]['id'],'MailInteractionId':_0x44e212['id'],'direction':'in','ContactId':_0x16e5a0['contact']['id'],'messageId':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4c')],'from':_0x450c6b['body']['message'][_0x8197('0x30')],'to':_0x450c6b[_0x8197('0x27')]['message']['to'],'cc':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['cc'],'subject':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4e')],'attach':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x4f')],'Attachments':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['attachments'],'originTo':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x5a')],'originCc':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')][_0x8197('0x5b')],'bcc':_0x450c6b[_0x8197('0x27')][_0x8197('0x1a')]['bcc']},{'include':[{'model':db['Attachment'],'as':'Attachments'}]});})[_0x8197('0x12')](function(_0x4f0ef9){_0x16e5a0[_0x8197('0x1a')]=_0x4f0ef9;if(_0x16e5a0[_0x8197('0x58')]['UserId']){return db['User'][_0x8197('0x36')]({'attributes':['id',_0x8197('0x5c')],'where':{'id':_0x16e5a0[_0x8197('0x58')][_0x8197('0x5d')]}})[_0x8197('0x12')](function(_0x3f372e){if(_0x3f372e){_0x16e5a0['applications']['unshift']({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3f372e[_0x8197('0x5c')]+','+(_0x16e5a0[_0x8197('0x37')][_0x8197('0x5e')]||0xa),'interval':_0x8197('0x47')});}return respondWithRpcPromise(_0x8197('0x5f'),'startRouting',_0x16e5a0);});}return respondWithRpcPromise(_0x8197('0x5f'),_0x8197('0x60'),_0x16e5a0);})[_0x8197('0x12')](function(_0x513303){_0x1a2d7e(_0x513303);})[_0x8197('0x1b')](function(_0x47261f){_0x57cfe6(_0x15e6c2[_0x8197('0x18')](0x1f4,_0x47261f[_0x8197('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index 3eb717c..d44d6ab 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 _0x4873=['removeListener','register','mailAccount:','./mailAccount.events','save','remove','emit'];(function(_0x5b9cc1,_0x4c8db4){var _0x16e39e=function(_0x524df9){while(--_0x524df9){_0x5b9cc1['push'](_0x5b9cc1['shift']());}};_0x16e39e(++_0x4c8db4);}(_0x4873,0x1df));var _0x3487=function(_0x4ec70e,_0x380b25){_0x4ec70e=_0x4ec70e-0x0;var _0x24d2fa=_0x4873[_0x4ec70e];return _0x24d2fa;};'use strict';var MailAccountEvents=require(_0x3487('0x0'));var events=[_0x3487('0x1'),_0x3487('0x2'),'update'];function createListener(_0x10ebd5,_0x4876b8){return function(_0x565778){_0x4876b8[_0x3487('0x3')](_0x10ebd5,_0x565778);};}function removeListener(_0xbc64e7,_0x54ff70){return function(){MailAccountEvents[_0x3487('0x4')](_0xbc64e7,_0x54ff70);};}exports[_0x3487('0x5')]=function(_0xbe12a4){for(var _0x2611dc=0x0,_0x193589=events['length'];_0x2611dc<_0x193589;_0x2611dc++){var _0x1d4cae=events[_0x2611dc];var _0x3df081=createListener(_0x3487('0x6')+_0x1d4cae,_0xbe12a4);MailAccountEvents['on'](_0x1d4cae,_0x3df081);}}; \ No newline at end of file +var _0x254a=['emit','register','./mailAccount.events','save','remove'];(function(_0xbf8ebe,_0x3b69a5){var _0x1e25e8=function(_0x40c390){while(--_0x40c390){_0xbf8ebe['push'](_0xbf8ebe['shift']());}};_0x1e25e8(++_0x3b69a5);}(_0x254a,0x138));var _0xa254=function(_0x2a3ca4,_0x39a7e8){_0x2a3ca4=_0x2a3ca4-0x0;var _0x374c52=_0x254a[_0x2a3ca4];return _0x374c52;};'use strict';var MailAccountEvents=require(_0xa254('0x0'));var events=[_0xa254('0x1'),_0xa254('0x2'),'update'];function createListener(_0xdd386c,_0x3e56d3){return function(_0x34467a){_0x3e56d3[_0xa254('0x3')](_0xdd386c,_0x34467a);};}function removeListener(_0x500e29,_0x8fbfaf){return function(){MailAccountEvents['removeListener'](_0x500e29,_0x8fbfaf);};}exports[_0xa254('0x4')]=function(_0x3d5886){for(var _0x1201ae=0x0,_0x597d72=events['length'];_0x1201ae<_0x597d72;_0x1201ae++){var _0xaeed42=events[_0x1201ae];var _0x352a44=createListener('mailAccount:'+_0xaeed42,_0x3d5886);MailAccountEvents['on'](_0xaeed42,_0x352a44);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index 2e285c5..aab962e 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 _0xb688=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./mailApplication.controller','get','/:id','show','isAuthenticated','update','delete','destroy','exports','util'];(function(_0x2b4a06,_0xedba9){var _0x2c9c8a=function(_0x25401a){while(--_0x25401a){_0x2b4a06['push'](_0x2b4a06['shift']());}};_0x2c9c8a(++_0xedba9);}(_0xb688,0xcf));var _0x8b68=function(_0x53ea22,_0xb35462){_0x53ea22=_0x53ea22-0x0;var _0x55393a=_0xb688[_0x53ea22];return _0x55393a;};'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')](_0x8b68('0x9'),auth['isAuthenticated'](),controller[_0x8b68('0xa')]);router['put'](_0x8b68('0x9'),auth[_0x8b68('0xb')](),controller[_0x8b68('0xc')]);router[_0x8b68('0xd')](_0x8b68('0x9'),auth[_0x8b68('0xb')](),controller[_0x8b68('0xe')]);module[_0x8b68('0xf')]=router; \ No newline at end of file +var _0x1339=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','update','delete','destroy','exports','path','connect-timeout'];(function(_0x2bf5d5,_0x366ece){var _0x505ee3=function(_0x5b1192){while(--_0x5b1192){_0x2bf5d5['push'](_0x2bf5d5['shift']());}};_0x505ee3(++_0x366ece);}(_0x1339,0x1ed));var _0x9133=function(_0x59c113,_0x5c7bf9){_0x59c113=_0x59c113-0x0;var _0x313a01=_0x1339[_0x59c113];return _0x313a01;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x9133('0x0'));var timeout=require(_0x9133('0x1'));var express=require(_0x9133('0x2'));var router=express[_0x9133('0x3')]();var auth=require(_0x9133('0x4'));var interaction=require(_0x9133('0x5'));var config=require(_0x9133('0x6'));var controller=require(_0x9133('0x7'));router['get'](_0x9133('0x8'),auth[_0x9133('0x9')](),controller[_0x9133('0xa')]);router['put'](_0x9133('0x8'),auth[_0x9133('0x9')](),controller[_0x9133('0xb')]);router[_0x9133('0xc')](_0x9133('0x8'),auth[_0x9133('0x9')](),controller[_0x9133('0xd')]);module[_0x9133('0xe')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 6f0581a..8360b13 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 _0xf336=['STRING','noop','exports'];(function(_0x3b0731,_0xcf9925){var _0x4204d7=function(_0x635ac5){while(--_0x635ac5){_0x3b0731['push'](_0x3b0731['shift']());}};_0x4204d7(++_0xcf9925);}(_0xf336,0x1e8));var _0x6f33=function(_0x5969f2,_0xbc6f97){_0x5969f2=_0x5969f2-0x0;var _0x3f779e=_0xf336[_0x5969f2];return _0x3f779e;};'use strict';var Sequelize=require('sequelize');module[_0x6f33('0x0')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x6f33('0x1')],'allowNull':![],'defaultValue':_0x6f33('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x6f33('0x1')]},'interval':{'type':Sequelize[_0x6f33('0x1')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0xb997=['noop','*,*,*,*','sequelize','INTEGER','STRING'];(function(_0x96f29e,_0xd84d7a){var _0x3b0b5b=function(_0x50ca08){while(--_0x50ca08){_0x96f29e['push'](_0x96f29e['shift']());}};_0x3b0b5b(++_0xd84d7a);}(_0xb997,0x11f));var _0x7b99=function(_0x1e3069,_0x4e064d){_0x1e3069=_0x1e3069-0x0;var _0x45c282=_0xb997[_0x1e3069];return _0x45c282;};'use strict';var Sequelize=require(_0x7b99('0x0'));module['exports']={'priority':{'type':Sequelize[_0x7b99('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x7b99('0x2')],'allowNull':![],'defaultValue':_0x7b99('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x7b99('0x2')]},'interval':{'type':Sequelize[_0x7b99('0x2')],'defaultValue':_0x7b99('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index cfed627..b757855 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 _0xa03c=['save','update','then','destroy','end','sendStatus','stack','name','send','show','model','MailApplication','rawAttributes','query','filters','intersection','fields','attributes','length','include','merge','options','find','catch','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','status','json','offset','set','reject'];(function(_0x3492a7,_0xdc1d02){var _0x13256a=function(_0xc9f41b){while(--_0xc9f41b){_0x3492a7['push'](_0x3492a7['shift']());}};_0x13256a(++_0xdc1d02);}(_0xa03c,0x16a));var _0xca03=function(_0x3df568,_0xd33422){_0x3df568=_0x3df568-0x0;var _0x5473c5=_0xa03c[_0x3df568];return _0x5473c5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xca03('0x0'));var rimraf=require(_0xca03('0x1'));var zipdir=require(_0xca03('0x2'));var jsonpatch=require(_0xca03('0x3'));var rp=require(_0xca03('0x4'));var moment=require(_0xca03('0x5'));var BPromise=require(_0xca03('0x6'));var Mustache=require(_0xca03('0x7'));var util=require(_0xca03('0x8'));var path=require(_0xca03('0x9'));var sox=require(_0xca03('0xa'));var csv=require('to-csv');var ejs=require(_0xca03('0xb'));var fs=require('fs');var _=require(_0xca03('0xc'));var squel=require(_0xca03('0xd'));var crypto=require('crypto');var jsforce=require(_0xca03('0xe'));var deskjs=require(_0xca03('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xca03('0x10'));var Redis=require(_0xca03('0x11'));var authService=require(_0xca03('0x12'));var qs=require(_0xca03('0x13'));var as=require(_0xca03('0x14'));var hardwareService=require(_0xca03('0x15'));var logger=require(_0xca03('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xca03('0x17'));var db=require(_0xca03('0x18'))['db'];function respondWithStatusCode(_0x4c284a,_0x4b5c40){_0x4b5c40=_0x4b5c40||0xcc;return function(_0x349da5){if(_0x349da5){return _0x4c284a['sendStatus'](_0x4b5c40);}return _0x4c284a[_0xca03('0x19')](_0x4b5c40)['end']();};}function respondWithResult(_0x39b00f,_0x35351b){_0x35351b=_0x35351b||0xc8;return function(_0x251113){if(_0x251113){return _0x39b00f[_0xca03('0x19')](_0x35351b)[_0xca03('0x1a')](_0x251113);}};}function respondWithFilteredResult(_0x49d313,_0x3d16af){return function(_0x4e0075){if(_0x4e0075){var _0x3c69cd=_0x4e0075['count'],_0x1f35a3=_0x3d16af[_0xca03('0x1b')],_0x50e3df=_0x3d16af['offset']+_0x3d16af['limit'],_0x47e56f;if(_0x50e3df>=_0x3c69cd){_0x50e3df=_0x3c69cd;_0x47e56f=0xc8;}else{_0x47e56f=0xce;}_0x49d313[_0xca03('0x19')](_0x47e56f);return _0x49d313[_0xca03('0x1c')]('Content-Range',_0x1f35a3+'-'+_0x50e3df+'/'+_0x3c69cd)['json'](_0x4e0075);}return null;};}function patchUpdates(_0xea5f54){return function(_0xaae7ab){try{jsonpatch['apply'](_0xaae7ab,_0xea5f54,!![]);}catch(_0x30fcc6){return BPromise[_0xca03('0x1d')](_0x30fcc6);}return _0xaae7ab[_0xca03('0x1e')]();};}function saveUpdates(_0x343e79,_0x400f60){return function(_0x17191a){if(_0x17191a){return _0x17191a[_0xca03('0x1f')](_0x343e79)[_0xca03('0x20')](function(_0x4e1d52){return _0x4e1d52;});}return null;};}function removeEntity(_0x574ae0,_0x2bba2b){return function(_0x163e9b){if(_0x163e9b){return _0x163e9b[_0xca03('0x21')]()['then'](function(){_0x574ae0[_0xca03('0x19')](0xcc)[_0xca03('0x22')]();});}};}function handleEntityNotFound(_0x3826aa,_0x5402c4){return function(_0x58342d){if(!_0x58342d){_0x3826aa[_0xca03('0x23')](0x194);}return _0x58342d;};}function handleError(_0x149a32,_0x3df24a){_0x3df24a=_0x3df24a||0x1f4;return function(_0x4a4859){logger['error'](_0x4a4859[_0xca03('0x24')]);if(_0x4a4859[_0xca03('0x25')]){delete _0x4a4859[_0xca03('0x25')];}_0x149a32[_0xca03('0x19')](_0x3df24a)[_0xca03('0x26')](_0x4a4859);};}exports[_0xca03('0x27')]=function(_0x41ec3d,_0x47c318){var _0x471067={'raw':!![],'where':{'id':_0x41ec3d['params']['id']}},_0x43f030={};_0x43f030[_0xca03('0x28')]=_['keys'](db[_0xca03('0x29')][_0xca03('0x2a')]);_0x43f030[_0xca03('0x2b')]=_['keys'](_0x41ec3d[_0xca03('0x2b')]);_0x43f030[_0xca03('0x2c')]=_['intersection'](_0x43f030[_0xca03('0x28')],_0x43f030[_0xca03('0x2b')]);_0x471067['attributes']=_[_0xca03('0x2d')](_0x43f030[_0xca03('0x28')],qs[_0xca03('0x2e')](_0x41ec3d[_0xca03('0x2b')][_0xca03('0x2e')]));_0x471067[_0xca03('0x2f')]=_0x471067[_0xca03('0x2f')][_0xca03('0x30')]?_0x471067[_0xca03('0x2f')]:_0x43f030[_0xca03('0x28')];if(_0x41ec3d[_0xca03('0x2b')]['includeAll']){_0x471067[_0xca03('0x31')]=[{'all':!![]}];}_0x471067=_[_0xca03('0x32')]({},_0x471067,_0x41ec3d[_0xca03('0x33')]);return db[_0xca03('0x29')][_0xca03('0x34')](_0x471067)[_0xca03('0x20')](handleEntityNotFound(_0x47c318,null))[_0xca03('0x20')](respondWithResult(_0x47c318,null))[_0xca03('0x35')](handleError(_0x47c318,null));};exports['update']=function(_0x5c2efa,_0x4a3eb1){if(_0x5c2efa[_0xca03('0x36')]['id']){delete _0x5c2efa['body']['id'];}return db['MailApplication'][_0xca03('0x34')]({'where':{'id':_0x5c2efa[_0xca03('0x37')]['id']}})['then'](handleEntityNotFound(_0x4a3eb1,null))[_0xca03('0x20')](saveUpdates(_0x5c2efa[_0xca03('0x36')],null))[_0xca03('0x20')](respondWithResult(_0x4a3eb1,null))[_0xca03('0x35')](handleError(_0x4a3eb1,null));};exports[_0xca03('0x21')]=function(_0x4f13d2,_0x18ecbc){return db[_0xca03('0x29')][_0xca03('0x34')]({'where':{'id':_0x4f13d2[_0xca03('0x37')]['id']}})[_0xca03('0x20')](handleEntityNotFound(_0x18ecbc,null))[_0xca03('0x20')](removeEntity(_0x18ecbc,null))[_0xca03('0x35')](handleError(_0x18ecbc,null));}; \ No newline at end of file +var _0x4ae5=['querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','include','merge','find','catch','body','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','squel','crypto','desk.js','to-csv'];(function(_0x4a2346,_0x41d9ff){var _0x3b840d=function(_0x3f181c){while(--_0x3f181c){_0x4a2346['push'](_0x4a2346['shift']());}};_0x3b840d(++_0x41d9ff);}(_0x4ae5,0x189));var _0x54ae=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x4ae5[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0x54ae('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x54ae('0x1'));var zipdir=require(_0x54ae('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x54ae('0x3'));var moment=require(_0x54ae('0x4'));var BPromise=require(_0x54ae('0x5'));var Mustache=require(_0x54ae('0x6'));var util=require('util');var path=require(_0x54ae('0x7'));var sox=require(_0x54ae('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x54ae('0x9'));var crypto=require(_0x54ae('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x54ae('0xb'));var toCsv=require(_0x54ae('0xc'));var querystring=require(_0x54ae('0xd'));var Papa=require(_0x54ae('0xe'));var Redis=require('ioredis');var authService=require(_0x54ae('0xf'));var qs=require(_0x54ae('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x54ae('0x11'));var logger=require(_0x54ae('0x12'))(_0x54ae('0x13'));var utils=require(_0x54ae('0x14'));var config=require(_0x54ae('0x15'));var db=require(_0x54ae('0x16'))['db'];function respondWithStatusCode(_0x31ded2,_0x5f4059){_0x5f4059=_0x5f4059||0xcc;return function(_0x394105){if(_0x394105){return _0x31ded2[_0x54ae('0x17')](_0x5f4059);}return _0x31ded2[_0x54ae('0x18')](_0x5f4059)[_0x54ae('0x19')]();};}function respondWithResult(_0x274881,_0x291a41){_0x291a41=_0x291a41||0xc8;return function(_0x1ff66d){if(_0x1ff66d){return _0x274881['status'](_0x291a41)[_0x54ae('0x1a')](_0x1ff66d);}};}function respondWithFilteredResult(_0x47fd6c,_0x96e1f){return function(_0x5214dc){if(_0x5214dc){var _0x11e131=_0x5214dc[_0x54ae('0x1b')],_0xd17e73=_0x96e1f[_0x54ae('0x1c')],_0x520df5=_0x96e1f[_0x54ae('0x1c')]+_0x96e1f[_0x54ae('0x1d')],_0x113421;if(_0x520df5>=_0x11e131){_0x520df5=_0x11e131;_0x113421=0xc8;}else{_0x113421=0xce;}_0x47fd6c['status'](_0x113421);return _0x47fd6c['set'](_0x54ae('0x1e'),_0xd17e73+'-'+_0x520df5+'/'+_0x11e131)[_0x54ae('0x1a')](_0x5214dc);}return null;};}function patchUpdates(_0x2bb5cb){return function(_0x31882a){try{jsonpatch['apply'](_0x31882a,_0x2bb5cb,!![]);}catch(_0x2db65c){return BPromise[_0x54ae('0x1f')](_0x2db65c);}return _0x31882a[_0x54ae('0x20')]();};}function saveUpdates(_0xd03ea4,_0x40acbd){return function(_0x43cb04){if(_0x43cb04){return _0x43cb04[_0x54ae('0x21')](_0xd03ea4)[_0x54ae('0x22')](function(_0x2ed324){return _0x2ed324;});}return null;};}function removeEntity(_0x575c04,_0x16e573){return function(_0x5e2593){if(_0x5e2593){return _0x5e2593[_0x54ae('0x23')]()['then'](function(){_0x575c04[_0x54ae('0x18')](0xcc)[_0x54ae('0x19')]();});}};}function handleEntityNotFound(_0x3c0bce,_0x3d6b6e){return function(_0x5ee9e8){if(!_0x5ee9e8){_0x3c0bce['sendStatus'](0x194);}return _0x5ee9e8;};}function handleError(_0x527e92,_0x12fb09){_0x12fb09=_0x12fb09||0x1f4;return function(_0x29606e){logger[_0x54ae('0x24')](_0x29606e[_0x54ae('0x25')]);if(_0x29606e[_0x54ae('0x26')]){delete _0x29606e[_0x54ae('0x26')];}_0x527e92['status'](_0x12fb09)[_0x54ae('0x27')](_0x29606e);};}exports[_0x54ae('0x28')]=function(_0x241394,_0x65e42b){var _0x58a4e1={'raw':!![],'where':{'id':_0x241394[_0x54ae('0x29')]['id']}},_0x5bb479={};_0x5bb479[_0x54ae('0x2a')]=_[_0x54ae('0x2b')](db[_0x54ae('0x2c')][_0x54ae('0x2d')]);_0x5bb479[_0x54ae('0x2e')]=_[_0x54ae('0x2b')](_0x241394['query']);_0x5bb479[_0x54ae('0x2f')]=_[_0x54ae('0x30')](_0x5bb479[_0x54ae('0x2a')],_0x5bb479['query']);_0x58a4e1[_0x54ae('0x31')]=_[_0x54ae('0x30')](_0x5bb479['model'],qs[_0x54ae('0x32')](_0x241394[_0x54ae('0x2e')][_0x54ae('0x32')]));_0x58a4e1[_0x54ae('0x31')]=_0x58a4e1[_0x54ae('0x31')][_0x54ae('0x33')]?_0x58a4e1[_0x54ae('0x31')]:_0x5bb479[_0x54ae('0x2a')];if(_0x241394[_0x54ae('0x2e')][_0x54ae('0x34')]){_0x58a4e1[_0x54ae('0x35')]=[{'all':!![]}];}_0x58a4e1=_[_0x54ae('0x36')]({},_0x58a4e1,_0x241394['options']);return db[_0x54ae('0x2c')][_0x54ae('0x37')](_0x58a4e1)[_0x54ae('0x22')](handleEntityNotFound(_0x65e42b,null))[_0x54ae('0x22')](respondWithResult(_0x65e42b,null))[_0x54ae('0x38')](handleError(_0x65e42b,null));};exports[_0x54ae('0x21')]=function(_0xce0ba9,_0x394514){if(_0xce0ba9[_0x54ae('0x39')]['id']){delete _0xce0ba9[_0x54ae('0x39')]['id'];}return db['MailApplication']['find']({'where':{'id':_0xce0ba9['params']['id']}})['then'](handleEntityNotFound(_0x394514,null))[_0x54ae('0x22')](saveUpdates(_0xce0ba9['body'],null))['then'](respondWithResult(_0x394514,null))[_0x54ae('0x38')](handleError(_0x394514,null));};exports[_0x54ae('0x23')]=function(_0x5728b6,_0x1e1ff3){return db[_0x54ae('0x2c')][_0x54ae('0x37')]({'where':{'id':_0x5728b6[_0x54ae('0x29')]['id']}})[_0x54ae('0x22')](handleEntityNotFound(_0x1e1ff3,null))[_0x54ae('0x22')](removeEntity(_0x1e1ff3,null))[_0x54ae('0x38')](handleError(_0x1e1ff3,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index f8e9bad..ef67905 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 _0x4123=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./mailApplication.attributes','exports','define','MailApplication','mail_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x45d567,_0x2af502){var _0x51f928=function(_0x23dfb1){while(--_0x23dfb1){_0x45d567['push'](_0x45d567['shift']());}};_0x51f928(++_0x2af502);}(_0x4123,0x87));var _0x3412=function(_0x52b016,_0x33ec6e){_0x52b016=_0x52b016-0x0;var _0x13e797=_0x4123[_0x52b016];return _0x13e797;};'use strict';var _=require(_0x3412('0x0'));var util=require(_0x3412('0x1'));var logger=require(_0x3412('0x2'))(_0x3412('0x3'));var moment=require(_0x3412('0x4'));var BPromise=require(_0x3412('0x5'));var rp=require(_0x3412('0x6'));var fs=require('fs');var path=require(_0x3412('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3412('0x8'));module[_0x3412('0x9')]=function(_0x48eb88,_0x11aa67){return _0x48eb88[_0x3412('0xa')](_0x3412('0xb'),attributes,{'tableName':_0x3412('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x3412('0xd'),'collate':_0x3412('0xe')});}; \ No newline at end of file +var _0x0c2b=['utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./mailApplication.attributes','exports','define','MailApplication','mail_applications'];(function(_0x125714,_0x1f35b2){var _0x2534fe=function(_0x5a3e4c){while(--_0x5a3e4c){_0x125714['push'](_0x125714['shift']());}};_0x2534fe(++_0x1f35b2);}(_0x0c2b,0x194));var _0xb0c2=function(_0x446ad9,_0xbfdd8c){_0x446ad9=_0x446ad9-0x0;var _0x46ef3c=_0x0c2b[_0x446ad9];return _0x46ef3c;};'use strict';var _=require(_0xb0c2('0x0'));var util=require(_0xb0c2('0x1'));var logger=require('../../config/logger')(_0xb0c2('0x2'));var moment=require(_0xb0c2('0x3'));var BPromise=require(_0xb0c2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb0c2('0x5'));var config=require(_0xb0c2('0x6'));var attributes=require(_0xb0c2('0x7'));module[_0xb0c2('0x8')]=function(_0x1ba842,_0x5f102a){return _0x1ba842[_0xb0c2('0x9')](_0xb0c2('0xa'),attributes,{'tableName':_0xb0c2('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xb0c2('0xc')});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index c014d75..2f1cfa8 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 _0xc1e9=['catch','UpdateMailApplication','body','options','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','error','code','MailApplication,\x20%s,\x20%s','message','result'];(function(_0x2cdf39,_0x190c7a){var _0x40e4fa=function(_0x39e80b){while(--_0x39e80b){_0x2cdf39['push'](_0x2cdf39['shift']());}};_0x40e4fa(++_0x190c7a);}(_0xc1e9,0x19d));var _0x9c1e=function(_0x483e9a,_0x40e669){_0x483e9a=_0x483e9a-0x0;var _0x3a4139=_0xc1e9[_0x483e9a];return _0x3a4139;};'use strict';var _=require('lodash');var util=require(_0x9c1e('0x0'));var moment=require(_0x9c1e('0x1'));var BPromise=require(_0x9c1e('0x2'));var rs=require(_0x9c1e('0x3'));var fs=require('fs');var Redis=require(_0x9c1e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9c1e('0x5'));var logger=require(_0x9c1e('0x6'))(_0x9c1e('0x7'));var config=require(_0x9c1e('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x9c1e('0x9')][_0x9c1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2c8c8e,_0x56b78b,_0x254298){return new BPromise(function(_0x6de76c,_0x50f964){return client[_0x9c1e('0xb')](_0x2c8c8e,_0x254298)[_0x9c1e('0xc')](function(_0x51969c){logger[_0x9c1e('0xd')]('MailApplication,\x20%s,\x20%s',_0x56b78b,_0x9c1e('0xe'));logger[_0x9c1e('0xf')](_0x9c1e('0x10'),_0x56b78b,_0x9c1e('0xe'),JSON['stringify'](_0x51969c));if(_0x51969c[_0x9c1e('0x11')]){if(_0x51969c[_0x9c1e('0x11')][_0x9c1e('0x12')]===0x1f4){logger['error'](_0x9c1e('0x13'),_0x56b78b,_0x51969c[_0x9c1e('0x11')][_0x9c1e('0x14')]);return _0x50f964(_0x51969c['error']['message']);}logger[_0x9c1e('0x11')](_0x9c1e('0x13'),_0x56b78b,_0x51969c[_0x9c1e('0x11')][_0x9c1e('0x14')]);return _0x6de76c(_0x51969c[_0x9c1e('0x11')][_0x9c1e('0x14')]);}else{logger[_0x9c1e('0xd')]('MailApplication,\x20%s,\x20%s',_0x56b78b,_0x9c1e('0xe'));_0x6de76c(_0x51969c[_0x9c1e('0x15')]['message']);}})[_0x9c1e('0x16')](function(_0x3dd170){logger[_0x9c1e('0x11')](_0x9c1e('0x13'),_0x56b78b,_0x3dd170);_0x50f964(_0x3dd170);});});}exports[_0x9c1e('0x17')]=function(_0x59763c){var _0x498da7=this;return new Promise(function(_0x41d4df,_0x5726c5){return db['MailApplication']['update'](_0x59763c[_0x9c1e('0x18')],{'raw':_0x59763c[_0x9c1e('0x19')]?_0x59763c['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x59763c[_0x9c1e('0x19')]?_0x59763c['options'][_0x9c1e('0x1a')]||null:null,'attributes':_0x59763c['options']?_0x59763c['options'][_0x9c1e('0x1b')]||null:null,'limit':_0x59763c[_0x9c1e('0x19')]?_0x59763c['options'][_0x9c1e('0x1c')]||null:null})['then'](function(_0x2d78e3){logger['info'](_0x9c1e('0x17'),_0x59763c);logger[_0x9c1e('0xf')](_0x9c1e('0x17'),_0x59763c,JSON['stringify'](_0x2d78e3));_0x41d4df(_0x2d78e3);})[_0x9c1e('0x16')](function(_0x6a96d7){logger[_0x9c1e('0x11')]('UpdateMailApplication',_0x6a96d7[_0x9c1e('0x14')],_0x59763c);_0x5726c5(_0x498da7[_0x9c1e('0x11')](0x1f4,_0x6a96d7['message']));});});}; \ No newline at end of file +var _0x8b04=['error','message','catch','UpdateMailApplication','MailApplication','update','body','options','raw','where','attributes','limit','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s'];(function(_0x55a6ea,_0x422ae3){var _0x43389a=function(_0x4f171b){while(--_0x4f171b){_0x55a6ea['push'](_0x55a6ea['shift']());}};_0x43389a(++_0x422ae3);}(_0x8b04,0x9d));var _0x48b0=function(_0x457d36,_0x3b43e5){_0x457d36=_0x457d36-0x0;var _0x1098b2=_0x8b04[_0x457d36];return _0x1098b2;};'use strict';var _=require('lodash');var util=require(_0x48b0('0x0'));var moment=require(_0x48b0('0x1'));var BPromise=require(_0x48b0('0x2'));var rs=require(_0x48b0('0x3'));var fs=require('fs');var Redis=require(_0x48b0('0x4'));var db=require(_0x48b0('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x48b0('0x6'))(_0x48b0('0x7'));var config=require(_0x48b0('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x48b0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f475,_0x13869a,_0x3ae1ca){return new BPromise(function(_0x17c698,_0xf5d03e){return client[_0x48b0('0xa')](_0x53f475,_0x3ae1ca)[_0x48b0('0xb')](function(_0x5a4795){logger[_0x48b0('0xc')](_0x48b0('0xd'),_0x13869a,_0x48b0('0xe'));logger[_0x48b0('0xf')](_0x48b0('0x10'),_0x13869a,'request\x20sent',JSON['stringify'](_0x5a4795));if(_0x5a4795[_0x48b0('0x11')]){if(_0x5a4795[_0x48b0('0x11')]['code']===0x1f4){logger['error'](_0x48b0('0xd'),_0x13869a,_0x5a4795[_0x48b0('0x11')][_0x48b0('0x12')]);return _0xf5d03e(_0x5a4795['error'][_0x48b0('0x12')]);}logger['error'](_0x48b0('0xd'),_0x13869a,_0x5a4795[_0x48b0('0x11')]['message']);return _0x17c698(_0x5a4795[_0x48b0('0x11')][_0x48b0('0x12')]);}else{logger[_0x48b0('0xc')](_0x48b0('0xd'),_0x13869a,'request\x20sent');_0x17c698(_0x5a4795['result'][_0x48b0('0x12')]);}})[_0x48b0('0x13')](function(_0x3c76dd){logger[_0x48b0('0x11')]('MailApplication,\x20%s,\x20%s',_0x13869a,_0x3c76dd);_0xf5d03e(_0x3c76dd);});});}exports[_0x48b0('0x14')]=function(_0x499b73){var _0x4983e8=this;return new Promise(function(_0x927d27,_0x28d84a){return db[_0x48b0('0x15')][_0x48b0('0x16')](_0x499b73[_0x48b0('0x17')],{'raw':_0x499b73[_0x48b0('0x18')]?_0x499b73[_0x48b0('0x18')][_0x48b0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x499b73[_0x48b0('0x18')]?_0x499b73[_0x48b0('0x18')][_0x48b0('0x1a')]||null:null,'attributes':_0x499b73['options']?_0x499b73['options'][_0x48b0('0x1b')]||null:null,'limit':_0x499b73[_0x48b0('0x18')]?_0x499b73[_0x48b0('0x18')][_0x48b0('0x1c')]||null:null})[_0x48b0('0xb')](function(_0x14d11b){logger['info'](_0x48b0('0x14'),_0x499b73);logger[_0x48b0('0xf')]('UpdateMailApplication',_0x499b73,JSON['stringify'](_0x14d11b));_0x927d27(_0x14d11b);})[_0x48b0('0x13')](function(_0x404da1){logger['error'](_0x48b0('0x14'),_0x404da1[_0x48b0('0x12')],_0x499b73);_0x28d84a(_0x4983e8[_0x48b0('0x11')](0x1f4,_0x404da1[_0x48b0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 2ca914b..8009ced 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 _0xec12=['delete','mailinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','show','getMessages','/:id/download','download','post','create','/:id/messages','addMessage','/:id/tags','tracked','mailinteraction:addtags','put','mail','update'];(function(_0x1105c6,_0x283616){var _0x1c2868=function(_0x49c7ba){while(--_0x49c7ba){_0x1105c6['push'](_0x1105c6['shift']());}};_0x1c2868(++_0x283616);}(_0xec12,0x1bf));var _0x2ec1=function(_0x557980,_0x323304){_0x557980=_0x557980-0x0;var _0x54ad07=_0xec12[_0x557980];return _0x54ad07;};'use strict';var multer=require(_0x2ec1('0x0'));var util=require(_0x2ec1('0x1'));var path=require('path');var timeout=require(_0x2ec1('0x2'));var express=require(_0x2ec1('0x3'));var router=express[_0x2ec1('0x4')]();var auth=require(_0x2ec1('0x5'));var interaction=require(_0x2ec1('0x6'));var config=require(_0x2ec1('0x7'));var controller=require(_0x2ec1('0x8'));router['get']('/',auth[_0x2ec1('0x9')](),controller[_0x2ec1('0xa')]);router[_0x2ec1('0xb')](_0x2ec1('0xc'),auth[_0x2ec1('0x9')](),controller[_0x2ec1('0xd')]);router[_0x2ec1('0xb')](_0x2ec1('0xe'),auth[_0x2ec1('0x9')](),controller[_0x2ec1('0xf')]);router[_0x2ec1('0xb')]('/:id/messages',auth[_0x2ec1('0x9')](),controller[_0x2ec1('0x10')]);router[_0x2ec1('0xb')](_0x2ec1('0x11'),auth[_0x2ec1('0x9')](),controller[_0x2ec1('0x12')]);router[_0x2ec1('0x13')]('/',auth[_0x2ec1('0x9')](),controller[_0x2ec1('0x14')]);router['post'](_0x2ec1('0x15'),auth['isAuthenticated'](),controller[_0x2ec1('0x16')]);router[_0x2ec1('0x13')](_0x2ec1('0x17'),auth[_0x2ec1('0x9')](),interaction[_0x2ec1('0x18')]('mail',_0x2ec1('0x19')),controller['addTags']);router[_0x2ec1('0x1a')]('/:id',auth[_0x2ec1('0x9')](),interaction[_0x2ec1('0x18')](_0x2ec1('0x1b'),'mailinteraction:update'),controller[_0x2ec1('0x1c')]);router[_0x2ec1('0x1d')](_0x2ec1('0xe'),auth[_0x2ec1('0x9')](),interaction[_0x2ec1('0x18')](_0x2ec1('0x1b'),_0x2ec1('0x1e')),controller[_0x2ec1('0x1f')]);router[_0x2ec1('0x1d')](_0x2ec1('0x17'),auth['isAuthenticated'](),controller[_0x2ec1('0x20')]);module[_0x2ec1('0x21')]=router; \ No newline at end of file +var _0x3b47=['getMessages','/:id/download','download','post','addMessage','/:id/tags','tracked','mail','mailinteraction:addtags','put','mailinteraction:destroy','destroy','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','index','/describe','describe','/:id','isAuthenticated','/:id/messages'];(function(_0xf0bc07,_0x510ebf){var _0x1c50c2=function(_0x2e2bdf){while(--_0x2e2bdf){_0xf0bc07['push'](_0xf0bc07['shift']());}};_0x1c50c2(++_0x510ebf);}(_0x3b47,0x1ce));var _0x73b4=function(_0x53f58c,_0x1fa6df){_0x53f58c=_0x53f58c-0x0;var _0x5d1ce0=_0x3b47[_0x53f58c];return _0x5d1ce0;};'use strict';var multer=require(_0x73b4('0x0'));var util=require(_0x73b4('0x1'));var path=require('path');var timeout=require(_0x73b4('0x2'));var express=require(_0x73b4('0x3'));var router=express[_0x73b4('0x4')]();var auth=require(_0x73b4('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x73b4('0x6'));var controller=require('./mailInteraction.controller');router[_0x73b4('0x7')]('/',auth['isAuthenticated'](),controller[_0x73b4('0x8')]);router[_0x73b4('0x7')](_0x73b4('0x9'),auth['isAuthenticated'](),controller[_0x73b4('0xa')]);router[_0x73b4('0x7')](_0x73b4('0xb'),auth[_0x73b4('0xc')](),controller['show']);router[_0x73b4('0x7')](_0x73b4('0xd'),auth[_0x73b4('0xc')](),controller[_0x73b4('0xe')]);router[_0x73b4('0x7')](_0x73b4('0xf'),auth[_0x73b4('0xc')](),controller[_0x73b4('0x10')]);router[_0x73b4('0x11')]('/',auth[_0x73b4('0xc')](),controller['create']);router['post'](_0x73b4('0xd'),auth[_0x73b4('0xc')](),controller[_0x73b4('0x12')]);router[_0x73b4('0x11')](_0x73b4('0x13'),auth['isAuthenticated'](),interaction[_0x73b4('0x14')](_0x73b4('0x15'),_0x73b4('0x16')),controller['addTags']);router[_0x73b4('0x17')](_0x73b4('0xb'),auth[_0x73b4('0xc')](),interaction[_0x73b4('0x14')](_0x73b4('0x15'),'mailinteraction:update'),controller['update']);router['delete'](_0x73b4('0xb'),auth[_0x73b4('0xc')](),interaction[_0x73b4('0x14')](_0x73b4('0x15'),_0x73b4('0x18')),controller[_0x73b4('0x19')]);router[_0x73b4('0x1a')]('/:id/tags',auth[_0x73b4('0xc')](),controller['removeTags']);module[_0x73b4('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index afebf96..2ca3349 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 _0x0d86=['sequelize','iconv','BOOLEAN','DATE','STRING','TEXT','ENUM','out','long'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x0d86,0x1b0));var _0x60d8=function(_0x3c2e0d,_0x27e631){_0x3c2e0d=_0x3c2e0d-0x0;var _0x9e670b=_0x0d86[_0x3c2e0d];return _0x9e670b;};'use strict';var Sequelize=require(_0x60d8('0x0'));var iconv=require(_0x60d8('0x1'));module['exports']={'closed':{'type':Sequelize[_0x60d8('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x60d8('0x3')]},'disposition':{'type':Sequelize[_0x60d8('0x4')]},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x60d8('0x4')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x60d8('0x5')]('long')},'subject':{'type':Sequelize[_0x60d8('0x5')]()},'attach':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x60d8('0x3')]},'substatus':{'type':Sequelize[_0x60d8('0x4')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0x60d8('0x6')]('in',_0x60d8('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x60d8('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x60d8('0x6')]('in',_0x60d8('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize['TEXT'](_0x60d8('0x8'))},'lastMsgText':{'type':Sequelize['TEXT'](_0x60d8('0x8'))}}; \ No newline at end of file +var _0x556a=['long','BOOLEAN','DATE','ENUM','out','sequelize','iconv','exports','STRING','TEXT'];(function(_0x307df8,_0x4a8839){var _0x183f9d=function(_0x4fc35d){while(--_0x4fc35d){_0x307df8['push'](_0x307df8['shift']());}};_0x183f9d(++_0x4a8839);}(_0x556a,0x14f));var _0xa556=function(_0x38b6bb,_0x2c665b){_0x38b6bb=_0x38b6bb-0x0;var _0x2acc76=_0x556a[_0x38b6bb];return _0x2acc76;};'use strict';var Sequelize=require(_0xa556('0x0'));var iconv=require(_0xa556('0x1'));module[_0xa556('0x2')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0xa556('0x3')]},'note':{'type':Sequelize[_0xa556('0x3')]},'inReplyTo':{'type':Sequelize['STRING'](0x1fe)},'to':{'type':Sequelize[_0xa556('0x3')]},'cc':{'type':Sequelize[_0xa556('0x4')](_0xa556('0x5'))},'subject':{'type':Sequelize[_0xa556('0x4')]()},'attach':{'type':Sequelize[_0xa556('0x6')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0xa556('0x7')]},'substatus':{'type':Sequelize[_0xa556('0x3')](0x3c)},'substatusAt':{'type':Sequelize['DATE']},'firstMsgDirection':{'type':Sequelize[_0xa556('0x8')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa556('0x7')]},'lastMsgDirection':{'type':Sequelize[_0xa556('0x8')]('in',_0xa556('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0xa556('0x4')](_0xa556('0x5'))},'lastMsgText':{'type':Sequelize[_0xa556('0x4')](_0xa556('0x5'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index 425f9e0..1b5b014 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 _0xb761=['getMessages','format','YYYY-MM-DD\x20HH:mm:ss','includeAll','addTags','setTags','spread','removeTags','download','unix','join','root','server','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','subject','Messages','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Bcc','basename','existsSync','readFileSync','writeFileSync','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','html-to-text','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','apply','save','then','destroy','error','stack','name','Users','map','fullname','Tags','TagIds','split','findOne','trimStart','catch','index','MailInteraction','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.id','ui.MailInteractionId','user_has_mail_interactions','u.id\x20=\x20ui.UserId','mail_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','left_join','users','o.id\x20=\x20i.UserId','mail_accounts','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','expr','search','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','forEach','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','some','compact','isEmpty','MailAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','fields','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.lastMsgAt','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.to','i.ContactId','Contact.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','groupBy','MailInteractionId','Setting','enableEmailPreview','push','all','rows','show','rawAttributes','intersection','options','create','body','update','params','describe','addMessage','MailMessage','ids','omit'];(function(_0x3251ac,_0x26b6a4){var _0x579b8b=function(_0x2f72fb){while(--_0x2f72fb){_0x3251ac['push'](_0x3251ac['shift']());}};_0x579b8b(++_0x26b6a4);}(_0xb761,0x113));var _0x1b76=function(_0xf26c2e,_0x56c3ea){_0xf26c2e=_0xf26c2e-0x0;var _0x46ecb4=_0xb761[_0xf26c2e];return _0x46ecb4;};'use strict';var pdf=require(_0x1b76('0x0'));var emlformat=require(_0x1b76('0x1'));var rimraf=require(_0x1b76('0x2'));var zipdir=require(_0x1b76('0x3'));var jsonpatch=require(_0x1b76('0x4'));var rp=require(_0x1b76('0x5'));var moment=require(_0x1b76('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x1b76('0x7'));var ejs=require(_0x1b76('0x8'));var fs=require('fs');var _=require(_0x1b76('0x9'));var squel=require(_0x1b76('0xa'));var crypto=require(_0x1b76('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x1b76('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1b76('0xd'));var Papa=require(_0x1b76('0xe'));var htmlToText=require(_0x1b76('0xf'));var Redis=require(_0x1b76('0x10'));var authService=require(_0x1b76('0x11'));var qs=require(_0x1b76('0x12'));var as=require(_0x1b76('0x13'));var hardwareService=require(_0x1b76('0x14'));var logger=require(_0x1b76('0x15'))(_0x1b76('0x16'));var utils=require('../../config/utils');var config=require(_0x1b76('0x17'));var db=require(_0x1b76('0x18'))['db'];config[_0x1b76('0x19')]=_[_0x1b76('0x1a')](config[_0x1b76('0x19')],{'host':_0x1b76('0x1b'),'port':0x18eb});var socket=require(_0x1b76('0x1c'))(new Redis(config[_0x1b76('0x19')]));require(_0x1b76('0x1d'))[_0x1b76('0x1e')](socket);function respondWithStatusCode(_0x1009bf,_0x13b766){_0x13b766=_0x13b766||0xcc;return function(_0xb0b269){if(_0xb0b269){return _0x1009bf[_0x1b76('0x1f')](_0x13b766);}return _0x1009bf[_0x1b76('0x20')](_0x13b766)[_0x1b76('0x21')]();};}function respondWithResult(_0x2243e5,_0x58a02e){_0x58a02e=_0x58a02e||0xc8;return function(_0x41f5fc){if(_0x41f5fc){return _0x2243e5['status'](_0x58a02e)[_0x1b76('0x22')](_0x41f5fc);}};}function respondWithFilteredResult(_0x574103,_0x11227c){return function(_0xd9cf8e){if(_0xd9cf8e){var _0x358788=_0xd9cf8e[_0x1b76('0x23')],_0xfb6890=_0x11227c[_0x1b76('0x24')],_0x528dd6=_0x11227c[_0x1b76('0x24')]+_0x11227c[_0x1b76('0x25')],_0x1cf189;if(_0x528dd6>=_0x358788){_0x528dd6=_0x358788;_0x1cf189=0xc8;}else{_0x1cf189=0xce;}_0x574103[_0x1b76('0x20')](_0x1cf189);return _0x574103[_0x1b76('0x26')]('Content-Range',_0xfb6890+'-'+_0x528dd6+'/'+_0x358788)[_0x1b76('0x22')](_0xd9cf8e);}return null;};}function patchUpdates(_0xb7f549){return function(_0xef7f2d){try{jsonpatch[_0x1b76('0x27')](_0xef7f2d,_0xb7f549,!![]);}catch(_0x3918c3){return BPromise['reject'](_0x3918c3);}return _0xef7f2d[_0x1b76('0x28')]();};}function saveUpdates(_0xc51b77,_0x542f28){return function(_0xc7e20f){if(_0xc7e20f){return _0xc7e20f['update'](_0xc51b77)[_0x1b76('0x29')](function(_0x1696c3){return _0x1696c3;});}return null;};}function removeEntity(_0x299652,_0x19025c){return function(_0x414cb1){if(_0x414cb1){return _0x414cb1[_0x1b76('0x2a')]()[_0x1b76('0x29')](function(){_0x299652['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3bf0ae,_0x155c04){return function(_0x4ec5a7){if(!_0x4ec5a7){_0x3bf0ae['sendStatus'](0x194);}return _0x4ec5a7;};}function handleError(_0x3a24b9,_0x1658ed){_0x1658ed=_0x1658ed||0x1f4;return function(_0x587aad){logger[_0x1b76('0x2b')](_0x587aad[_0x1b76('0x2c')]);if(_0x587aad['name']){delete _0x587aad[_0x1b76('0x2d')];}_0x3a24b9[_0x1b76('0x20')](_0x1658ed)['send'](_0x587aad);};}function getInteractionUsers(_0x373464,_0x155025){return new BPromise(function(_0x4a3aa8,_0x4cde28){try{if(_0x155025[_0x373464['id']]){_0x373464[_0x1b76('0x2e')]=_[_0x1b76('0x2f')](_0x155025[_0x373464['id']],function(_0x31d70e){return{'id':_0x31d70e['id'],'fullname':_0x31d70e[_0x1b76('0x30')]};});}}catch(_0x36e045){_0x4cde28(_0x36e045);}_0x4a3aa8(_0x373464);});}function getInteractionTags(_0x1e2b3a,_0x5ee87f){return new BPromise(function(_0x3aeb36,_0x4a75d1){try{if(_0x1e2b3a['TagIds']){_0x1e2b3a[_0x1b76('0x31')]=[];_0x1e2b3a[_0x1b76('0x32')][_0x1b76('0x33')](',')['forEach'](function(_0x243f77){_0x1e2b3a[_0x1b76('0x31')]['push'](_0x5ee87f[_0x243f77]);});}delete _0x1e2b3a[_0x1b76('0x32')];}catch(_0x257428){_0x4a75d1(_0x257428);}_0x3aeb36(_0x1e2b3a);});}function getLastMessageText(_0x45d828){return new BPromise(function(_0x4e514b,_0x3bdb3d){return db['MailInteraction'][_0x1b76('0x34')]({'where':{'id':_0x45d828['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0x1b76('0x29')](function(_0x952723){if(!_0x952723['lastMsgText']){_0x45d828['lastMsgText']=_[_0x1b76('0x35')](htmlToText['fromString'](_0x952723['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x45d828['lastMsgText']=_0x952723['lastMsgText'];}_0x4e514b(_0x45d828);})['catch'](function(_0x45e6a2){_0x3bdb3d(_0x45e6a2);});});}function updateMailInteraction(_0x11cd75,_0x52479f,_0x5731fd,_0x186ea){return new BPromise(function(_0x50a1d0,_0x256e7d){return getInteractionUsers(_0x11cd75,_0x5731fd)['then'](function(_0x21218c){return getInteractionTags(_0x21218c,_0x52479f);})[_0x1b76('0x29')](function(_0xfc3219){if(_0x186ea){_0x50a1d0(getLastMessageText(_0xfc3219));}else{_0x50a1d0(_0xfc3219);}})[_0x1b76('0x36')](function(_0x4f4d0a){_0x256e7d(_0x4f4d0a);});});}exports[_0x1b76('0x37')]=function(_0x4660b1,_0x46fb02){var _0x73cbae={},_0x46b57b={},_0x388e30={'count':0x0,'rows':[]};var _0x425808=_[_0x1b76('0x2f')](db[_0x1b76('0x38')]['rawAttributes'],function(_0x45d920){return{'name':_0x45d920['fieldName'],'type':_0x45d920[_0x1b76('0x39')][_0x1b76('0x3a')]};});_0x46b57b[_0x1b76('0x3b')]=_[_0x1b76('0x2f')](_0x425808,'name');_0x46b57b[_0x1b76('0x3c')]=_[_0x1b76('0x3d')](_0x4660b1['query']);_0x46b57b[_0x1b76('0x3e')]=_['intersection'](_0x46b57b[_0x1b76('0x3b')],_0x46b57b[_0x1b76('0x3c')]);_0x73cbae[_0x1b76('0x3f')]=_['intersection'](_0x46b57b['model'],qs['fields'](_0x4660b1[_0x1b76('0x3c')]['fields']));_0x73cbae['attributes']=_0x73cbae['attributes'][_0x1b76('0x40')]?_0x73cbae[_0x1b76('0x3f')]:_0x46b57b[_0x1b76('0x3b')];if(!_0x4660b1['query'][_0x1b76('0x41')](_0x1b76('0x42'))){_0x73cbae[_0x1b76('0x25')]=qs[_0x1b76('0x25')](_0x4660b1['query'][_0x1b76('0x25')]);_0x73cbae[_0x1b76('0x24')]=qs[_0x1b76('0x24')](_0x4660b1['query'][_0x1b76('0x24')]);}_0x73cbae[_0x1b76('0x43')]=qs['sort'](_0x4660b1['query'][_0x1b76('0x44')]);_0x73cbae[_0x1b76('0x45')]=qs[_0x1b76('0x3e')](_[_0x1b76('0x46')](_0x4660b1[_0x1b76('0x3c')],_0x46b57b[_0x1b76('0x3e')]));var _0x58f066=[];var _0x219bd7=squel[_0x1b76('0x47')]()['field']('id')[_0x1b76('0x48')](_0x1b76('0x2d'))['field']('color')[_0x1b76('0x49')](_0x1b76('0x4a'));var _0x4036d7=squel['select']()[_0x1b76('0x48')](_0x1b76('0x4b'))['field']('u.fullname')[_0x1b76('0x48')](_0x1b76('0x4c'))['from'](_0x1b76('0x4d'),'ui')['left_join']('users','u',_0x1b76('0x4e'));var _0x362ba8=squel[_0x1b76('0x47')]()['from'](_0x1b76('0x4f'),'i')['left_join'](_0x1b76('0x50'),'c',_0x1b76('0x51'))[_0x1b76('0x52')](_0x1b76('0x53'),'o',_0x1b76('0x54'))['left_join'](_0x1b76('0x55'),'a','a.id\x20=\x20i.MailAccountId')[_0x1b76('0x52')]('mail_messages','me',_0x1b76('0x56'))[_0x1b76('0x52')](_0x1b76('0x57'),'it',_0x1b76('0x58'))[_0x1b76('0x52')](_0x1b76('0x4a'),'t','t.id\x20=\x20it.TagId');var _0x5d1c1d=squel['expr']();var _0x5e9a36=[];var _0x52b012=squel[_0x1b76('0x59')]();var _0x3c2d1e;if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x5a')]){_0x3c2d1e=as['parseSearch'](_0x4660b1[_0x1b76('0x3c')]['search']);var _0x488ad0=_0x3c2d1e['sqlOperator'];for(var _0x214d3f=0x0;_0x214d3f<_0x3c2d1e[_0x1b76('0x5b')]['length'];_0x214d3f++){var _0x589303=_0x3c2d1e[_0x1b76('0x5b')][_0x214d3f];var _0x4e978e='i';var _0xb1231a=_[_0x1b76('0x5c')](_0x425808,[_0x1b76('0x2d'),_0x589303['field']]);if(!_0xb1231a){switch(_0x589303[_0x1b76('0x48')]){case _0x1b76('0x5d'):if(_0x589303[_0x1b76('0x5e')]==0x1){_0x362ba8[_0x1b76('0x5f')]('`'+_0x589303[_0x1b76('0x48')]+_0x1b76('0x60'));}else{_0x362ba8['having']('`'+_0x589303[_0x1b76('0x48')]+_0x1b76('0x61'));}break;case _0x1b76('0x62'):if(_0x589303[_0x1b76('0x63')]===_0x1b76('0x64')){if(_0x589303['value'][_0x1b76('0x33')]('\x20')[_0x1b76('0x40')]>0x1){_0x5d1c1d[_0x488ad0](_0x1b76('0x65'),qs[_0x1b76('0x66')](_0x589303[_0x1b76('0x5e')]),null);}else{var _0xdb82f8='%'+_0x589303['value']+'%';_0x5d1c1d[_0x488ad0](_0x1b76('0x67'),_0xdb82f8,_0xdb82f8,_0xdb82f8);}}else{_0xb1231a=_[_0x1b76('0x5c')](_0x425808,[_0x1b76('0x2d'),_0x1b76('0x68')]);_0x589303[_0x1b76('0x48')]=_0x1b76('0x68');_0x34a499=as[_0x1b76('0x69')](_0x4e978e,_0xb1231a['type'],_0x589303);_0x5d1c1d[_0x488ad0](_0x34a499[_0x1b76('0x6a')],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x6b')],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x21')]);}break;case _0x1b76('0x6c'):var _0x53c461=_0x589303['value'][_0x1b76('0x33')](',')[_0x1b76('0x2f')](function(_0x585d20){return Number(_0x585d20);});_0x53c461[_0x1b76('0x6d')](function(_0xdfa781){_0x52b012['or'](_0x1b76('0x6e'),'%,'+_0xdfa781+',%');});_0x5e9a36=_[_0x1b76('0x6f')](_0x5e9a36,_0x53c461);break;case _0x1b76('0x70'):if(_0x589303['operator']===_0x1b76('0x64')){_0x5d1c1d[_0x488ad0](_0x1b76('0x71'),'%'+_0x589303[_0x1b76('0x5e')]+'%',null);}else{_0xb1231a=_[_0x1b76('0x5c')](_0x425808,[_0x1b76('0x2d'),_0x1b76('0x72')]);_0x589303[_0x1b76('0x48')]='UserId';_0x34a499=as['buildExpression'](_0x4e978e,_0xb1231a[_0x1b76('0x39')],_0x589303);_0x5d1c1d[_0x488ad0](_0x34a499['text'],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x6b')],_0x34a499[_0x1b76('0x5e')]['end']);}break;case _0x1b76('0x73'):_0x34a499=as[_0x1b76('0x69')]('me',null,_0x589303);_0x5d1c1d[_0x488ad0](_0x34a499[_0x1b76('0x6a')],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x6b')],_0x34a499[_0x1b76('0x5e')]['end']);break;}}else{var _0x34a499=as[_0x1b76('0x69')](_0x4e978e,_0xb1231a['type'],_0x589303);_0x5d1c1d[_0x488ad0](_0x34a499[_0x1b76('0x6a')],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x6b')],_0x34a499[_0x1b76('0x5e')][_0x1b76('0x21')]);}}}else{var _0x4b2847=_(_0x4660b1[_0x1b76('0x3c')])[_0x1b76('0x3d')]()[_0x1b76('0x2f')](function(_0x1b8de1){return _[_0x1b76('0x74')](_0x425808,[_0x1b76('0x2d'),_0x1b8de1])?_0x1b8de1:undefined;})[_0x1b76('0x75')]()[_0x1b76('0x5e')]();if(!_[_0x1b76('0x76')](_0x4b2847)){_0x4b2847[_0x1b76('0x6d')](function(_0x3bf134){if(_0x3bf134===_0x1b76('0x77')){_0x362ba8['where']('i.MailAccountId\x20IN\x20?',[]['concat'](_0x4660b1[_0x1b76('0x3c')][_0x3bf134]));}else if(_0x3bf134===_0x1b76('0x78')){var _0x17f1bc=JSON[_0x1b76('0x79')](_0x4660b1[_0x1b76('0x3c')][_0x3bf134])[_0x1b76('0x7a')];var _0x36cf06=JSON['parse'](_0x4660b1[_0x1b76('0x3c')][_0x3bf134])[_0x1b76('0x7b')];_0x362ba8[_0x1b76('0x45')](_0x1b76('0x7c'),_0x17f1bc,_0x36cf06);}else{if(_0x4660b1[_0x1b76('0x3c')][_0x3bf134]===_0x1b76('0x7d')){_0x362ba8[_0x1b76('0x45')]('i.'+_0x3bf134+_0x1b76('0x7e'));}else{_0x362ba8[_0x1b76('0x45')]('i.'+_0x3bf134+_0x1b76('0x7f'),_0x4660b1[_0x1b76('0x3c')][_0x3bf134]);}}});}if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x80')]){if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x80')]==0x1){_0x362ba8[_0x1b76('0x5f')](_0x1b76('0x81'));}else{_0x362ba8[_0x1b76('0x5f')](_0x1b76('0x82'));}}if(_0x4660b1['query'][_0x1b76('0x83')]){_0x5e9a36=_[_0x1b76('0x84')](_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x83')])?_0x4660b1[_0x1b76('0x3c')]['tag']:new Array(_0x4660b1[_0x1b76('0x3c')]['tag']);_0x5e9a36[_0x1b76('0x6d')](function(_0x58bc22){_0x52b012['or'](_0x1b76('0x6e'),'%,'+_0x58bc22+',%');});}if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x85')]){var _0x2e8a90=_0x4660b1['query'][_0x1b76('0x85')]['replace']('\x5c','\x5c\x5c')[_0x1b76('0x86')]('\x27\x27',_0x1b76('0x87'));if(qs[_0x1b76('0x88')](_0x2e8a90)){_0x5d1c1d['or'](_0x1b76('0x89'),_0x2e8a90+'%');}else if(qs[_0x1b76('0x8a')](_0x2e8a90)){_0x5d1c1d['or'](_0x1b76('0x8b'),_0x2e8a90+'%');}else{_0x5d1c1d['or'](_0x1b76('0x8c'),qs['getFullTextValue'](_0x2e8a90))['or'](_0x1b76('0x8d'),qs[_0x1b76('0x66')](_0x2e8a90));}}}_0x362ba8[_0x1b76('0x45')](_0x5d1c1d);_0x362ba8[_0x1b76('0x8e')](_0x1b76('0x8f'));var _0x49e535={'type':db[_0x1b76('0x90')]['QueryTypes'][_0x1b76('0x91')],'raw':!![]};var _0x5d85a0=_0x362ba8[_0x1b76('0x92')]();_0x5d85a0['field'](_0x1b76('0x8f'));_0x5d85a0[_0x1b76('0x48')](_0x1b76('0x93'),_0x1b76('0x5d'));if(_0x73cbae[_0x1b76('0x43')]){_0x73cbae['order'][_0x1b76('0x6d')](function(_0x35311f){_0x362ba8[_0x1b76('0x43')]('i.'+_0x35311f[0x0],_0x35311f[0x1]===_0x1b76('0x94')?![]:!![]);});}if(!_[_0x1b76('0x76')](_0x5e9a36)){_0x362ba8[_0x1b76('0x5f')](_0x52b012);_0x5d85a0[_0x1b76('0x45')](_0x1b76('0x95'),_0x5e9a36);}BPromise['resolve']()[_0x1b76('0x29')](function(){if(!_0x3c2d1e){if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x77')]||_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x96')])return;_0x5d85a0[_0x1b76('0x45')](_0x1b76('0x97'));_0x362ba8[_0x1b76('0x45')](_0x1b76('0x97'));return;}return _0x4660b1[_0x1b76('0x98')][_0x1b76('0x99')]({'attributes':['id'],'raw':!![]})['then'](function(_0x36b547){if(_[_0x1b76('0x76')](_0x36b547)){_0x5d85a0[_0x1b76('0x45')]('i.MailAccountId\x20IS\x20NULL');_0x362ba8[_0x1b76('0x45')]('i.MailAccountId\x20IS\x20NULL');}else{_0x5d85a0[_0x1b76('0x45')](_0x1b76('0x9a'),_['map'](_0x36b547,'id'));_0x362ba8[_0x1b76('0x45')](_0x1b76('0x9a'),_['map'](_0x36b547,'id'));}});})[_0x1b76('0x29')](function(){db[_0x1b76('0x9b')][_0x1b76('0x3c')](_0x5d85a0[_0x1b76('0x9c')](),_0x49e535)[_0x1b76('0x29')](function(_0x9f2ab5){_0x388e30['count']=_0x9f2ab5[_0x1b76('0x40')];if(_0x388e30[_0x1b76('0x23')]===0x0)return[];return db[_0x1b76('0x9b')][_0x1b76('0x3c')](_0x219bd7[_0x1b76('0x9c')](),_0x49e535)['then'](function(_0x44a2f6){_0x58f066=_[_0x1b76('0x9d')](_0x44a2f6,'id');_0x49e535=_[_0x1b76('0x9e')](_0x49e535,{'model':db[_0x1b76('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4660b1[_0x1b76('0x3c')][_0x1b76('0x9f')]){_0x73cbae[_0x1b76('0x3f')]['forEach'](function(_0xa1a40f){_0x362ba8[_0x1b76('0x48')]('i.'+_0xa1a40f);});}else{_0x362ba8[_0x1b76('0x48')](_0x1b76('0x93'),_0x1b76('0x5d'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa0'),'Account.key');_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa1'),_0x1b76('0xa2'));_0x362ba8['field'](_0x1b76('0x8f'));_0x362ba8['field'](_0x1b76('0xa3'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa4'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa5'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa6'));_0x362ba8['field']('i.attach');_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa7'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa8'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xa9'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xaa'));_0x362ba8['field'](_0x1b76('0xab'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xac'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xad'));_0x362ba8[_0x1b76('0x48')]('i.MailAccountId');_0x362ba8[_0x1b76('0x48')]('i.UserId');_0x362ba8[_0x1b76('0x48')]('c.firstName',_0x1b76('0xae'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xaf'),_0x1b76('0xb0'));_0x362ba8[_0x1b76('0x48')]('c.email',_0x1b76('0xb1'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xb2'),_0x1b76('0xb3'));_0x362ba8['field'](_0x1b76('0xb4'),_0x1b76('0xb5'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xb6'),_0x1b76('0xb7'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xb8'),_0x1b76('0xb9'));_0x362ba8[_0x1b76('0x48')](_0x1b76('0xba'),'Owner.internal');_0x362ba8[_0x1b76('0x48')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0x1b76('0x32'));}_0x362ba8['limit'](_0x73cbae[_0x1b76('0x25')]);_0x362ba8[_0x1b76('0x24')](_0x73cbae['offset']);return db[_0x1b76('0x9b')][_0x1b76('0x3c')](_0x362ba8[_0x1b76('0x9c')](),_0x49e535);})[_0x1b76('0x29')](function(_0x4e9c43){_0x4036d7[_0x1b76('0x45')]('ui.MailInteractionId\x20IN\x20?',_['map'](_0x4e9c43,'id'));return db['sequelize'][_0x1b76('0x3c')](_0x4036d7['toString'](),_0x49e535)[_0x1b76('0x29')](function(_0x43ef53){var _0x31be7d=_[_0x1b76('0xbb')](_0x43ef53,_0x1b76('0xbc'));var _0x3c5795=[];return db[_0x1b76('0xbd')][_0x1b76('0x34')]({'attributes':['enableEmailPreview'],'raw':!![]})[_0x1b76('0x29')](function(_0x39c839){var _0x168d20=_0x39c839[_0x1b76('0xbe')];_0x4e9c43[_0x1b76('0x6d')](function(_0xfcb64c){_0x3c5795[_0x1b76('0xbf')](updateMailInteraction(_0xfcb64c,_0x58f066,_0x31be7d,_0x168d20));});return BPromise[_0x1b76('0xc0')](_0x3c5795);});});});})['then'](function(_0x4ef659){_0x388e30[_0x1b76('0xc1')]=_0x4ef659;return _0x388e30;})[_0x1b76('0x29')](respondWithFilteredResult(_0x46fb02,_0x73cbae));})[_0x1b76('0x36')](handleError(_0x46fb02,null));};exports[_0x1b76('0xc2')]=function(_0x5939db,_0xf87d23){var _0x24de88={'raw':![],'where':{'id':_0x5939db['params']['id']}},_0x328e7c={};_0x328e7c[_0x1b76('0x3b')]=_['keys'](db[_0x1b76('0x38')][_0x1b76('0xc3')]);_0x328e7c[_0x1b76('0x3c')]=_[_0x1b76('0x3d')](_0x5939db[_0x1b76('0x3c')]);_0x328e7c['filters']=_[_0x1b76('0xc4')](_0x328e7c[_0x1b76('0x3b')],_0x328e7c['query']);_0x24de88['attributes']=_[_0x1b76('0xc4')](_0x328e7c[_0x1b76('0x3b')],qs[_0x1b76('0x9f')](_0x5939db[_0x1b76('0x3c')][_0x1b76('0x9f')]));_0x24de88['attributes']=_0x24de88['attributes'][_0x1b76('0x40')]?_0x24de88['attributes']:_0x328e7c[_0x1b76('0x3b')];if(_0x5939db[_0x1b76('0x3c')]['includeAll']){_0x24de88['include']=[{'all':!![]}];}_0x24de88=_[_0x1b76('0x9e')]({},_0x24de88,_0x5939db[_0x1b76('0xc5')]);return db[_0x1b76('0x38')][_0x1b76('0x5c')](_0x24de88)[_0x1b76('0x29')](handleEntityNotFound(_0xf87d23,null))[_0x1b76('0x29')](respondWithResult(_0xf87d23,null))[_0x1b76('0x36')](handleError(_0xf87d23,null));};exports['create']=function(_0x34b81a,_0x5711e0){return db[_0x1b76('0x38')][_0x1b76('0xc6')](_0x34b81a[_0x1b76('0xc7')],{})[_0x1b76('0x29')](respondWithResult(_0x5711e0,0xc9))[_0x1b76('0x36')](handleError(_0x5711e0,null));};exports[_0x1b76('0xc8')]=function(_0x38909d,_0x593c44){if(_0x38909d[_0x1b76('0xc7')]['id']){delete _0x38909d[_0x1b76('0xc7')]['id'];}return db[_0x1b76('0x38')][_0x1b76('0x5c')]({'where':{'id':_0x38909d[_0x1b76('0xc9')]['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x593c44,null))['then'](saveUpdates(_0x38909d['body'],null))['then'](respondWithResult(_0x593c44,null))['catch'](handleError(_0x593c44,null));};exports[_0x1b76('0x2a')]=function(_0x56e392,_0x5732af){return db[_0x1b76('0x38')][_0x1b76('0x5c')]({'where':{'id':_0x56e392[_0x1b76('0xc9')]['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x5732af,null))[_0x1b76('0x29')](removeEntity(_0x5732af,null))['catch'](handleError(_0x5732af,null));};exports[_0x1b76('0xca')]=function(_0x92eb49,_0x1b8cbc){return db[_0x1b76('0x38')][_0x1b76('0xca')]()[_0x1b76('0x29')](respondWithResult(_0x1b8cbc,null))[_0x1b76('0x36')](handleError(_0x1b8cbc,null));};exports[_0x1b76('0xcb')]=function(_0x28b4e4,_0x4c1595,_0x48d6bc){return db[_0x1b76('0xcc')][_0x1b76('0x5c')]({'where':{'id':_0x28b4e4[_0x1b76('0xc9')]['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x4c1595,null))[_0x1b76('0x29')](function(_0x2a9472){if(_0x2a9472){return _0x2a9472[_0x1b76('0xcb')](_0x28b4e4[_0x1b76('0xc7')][_0x1b76('0xcd')],_[_0x1b76('0xce')](_0x28b4e4['body'],[_0x1b76('0xcd'),'id'])||{});}})[_0x1b76('0x29')](respondWithResult(_0x4c1595,null))[_0x1b76('0x36')](handleError(_0x4c1595,null));};exports[_0x1b76('0xcf')]=function(_0x3a676e,_0x2facf1,_0x3008f7){var _0x3008ac={'raw':![],'where':{}};var _0x3acccd={};var _0x278969={'count':0x0,'rows':[]};return db[_0x1b76('0x38')][_0x1b76('0x34')]({'where':{'id':_0x3a676e['params']['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x2facf1,null))['then'](function(_0x2518be){if(_0x2518be){_0x3acccd[_0x1b76('0x3b')]=_[_0x1b76('0x3d')](db[_0x1b76('0xcc')][_0x1b76('0xc3')]);_0x3acccd[_0x1b76('0x3c')]=_[_0x1b76('0x3d')](_0x3a676e['query']);_0x3acccd[_0x1b76('0x3e')]=_['intersection'](_0x3acccd[_0x1b76('0x3b')],_0x3acccd[_0x1b76('0x3c')]);_0x3008ac['attributes']=_['intersection'](_0x3acccd['model'],qs[_0x1b76('0x9f')](_0x3a676e['query'][_0x1b76('0x9f')]));_0x3008ac['attributes']=_0x3008ac['attributes']['length']?_0x3008ac[_0x1b76('0x3f')]:_0x3acccd[_0x1b76('0x3b')];if(!_0x3a676e[_0x1b76('0x3c')][_0x1b76('0x41')]('nolimit')){_0x3008ac[_0x1b76('0x25')]=qs[_0x1b76('0x25')](_0x3a676e['query'][_0x1b76('0x25')]);_0x3008ac['offset']=qs[_0x1b76('0x24')](_0x3a676e[_0x1b76('0x3c')]['offset']);}_0x3008ac['order']=qs[_0x1b76('0x44')](_0x3a676e['query'][_0x1b76('0x44')]);_0x3008ac[_0x1b76('0x45')]=qs[_0x1b76('0x3e')](_[_0x1b76('0x46')](_0x3a676e[_0x1b76('0x3c')],_0x3acccd[_0x1b76('0x3e')]));_0x3008ac[_0x1b76('0x45')][_0x1b76('0xbc')]=_0x2518be['id'];if(_0x3a676e['query'][_0x1b76('0x85')]){_0x3008ac[_0x1b76('0x45')]=_[_0x1b76('0x9e')](_0x3008ac[_0x1b76('0x45')],{'$or':_['map'](_0x3008ac['attributes'],function(_0x1f7957){var _0x66aba6={};_0x66aba6[_0x1f7957]={'$like':'%'+_0x3a676e[_0x1b76('0x3c')][_0x1b76('0x85')]+'%'};return _0x66aba6;})});}if(_0x3a676e[_0x1b76('0x3c')][_0x1b76('0x7a')]){var _0x1f1cb2=_0x3a676e[_0x1b76('0x3c')]['$gte'][_0x1b76('0x33')](',');var _0x5641df={};_0x5641df[_0x1f1cb2[0x0]]={'$gte':moment(_0x1f1cb2[0x1])[_0x1b76('0xd0')](_0x1b76('0xd1'))};_0x3008ac[_0x1b76('0x45')]=_[_0x1b76('0x9e')](_0x3008ac['where'],_0x5641df);}_0x3008ac=_['merge']({},_0x3008ac,_0x3a676e['options']);return db[_0x1b76('0xcc')][_0x1b76('0x23')]({'where':_0x3008ac[_0x1b76('0x45')]})[_0x1b76('0x29')](function(_0x52e23b){_0x278969[_0x1b76('0x23')]=_0x52e23b;if(_0x3a676e['query'][_0x1b76('0xd2')]){_0x3008ac['include']=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x3008ac);})[_0x1b76('0x29')](function(_0x4b1406){_0x278969[_0x1b76('0xc1')]=_0x4b1406;return _0x278969;});}})[_0x1b76('0x29')](respondWithFilteredResult(_0x2facf1,_0x3008ac))[_0x1b76('0x36')](handleError(_0x2facf1,null));};exports[_0x1b76('0xd3')]=function(_0x1a3c58,_0x545c55,_0x1657da){return db[_0x1b76('0x38')]['find']({'where':{'id':_0x1a3c58[_0x1b76('0xc9')]['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x545c55,null))[_0x1b76('0x29')](function(_0x59de63){if(_0x59de63){return _0x59de63[_0x1b76('0xd4')](_0x1a3c58[_0x1b76('0xc7')][_0x1b76('0xcd')],_[_0x1b76('0xce')](_0x1a3c58[_0x1b76('0xc7')],['ids','id'])||{})[_0x1b76('0xd5')](function(){return db[_0x1b76('0x6c')]['findAll']({'attributes':['id',_0x1b76('0x2d'),'color'],'where':{'id':_0x1a3c58[_0x1b76('0xc7')][_0x1b76('0xcd')]}});})[_0x1b76('0x29')](function(_0x69f006){socket['emit']('mailInteractionTags:save',{'id':Number(_0x1a3c58[_0x1b76('0xc9')]['id']),'tags':_0x69f006||[]});return{'id':Number(_0x1a3c58[_0x1b76('0xc9')]['id']),'tags':_0x69f006||[]};});}})[_0x1b76('0x29')](respondWithResult(_0x545c55,null))[_0x1b76('0x36')](handleError(_0x545c55,null));};exports[_0x1b76('0xd6')]=function(_0xa71d35,_0x8445f8,_0x145417){return db[_0x1b76('0x38')][_0x1b76('0x5c')]({'where':{'id':_0xa71d35[_0x1b76('0xc9')]['id']}})[_0x1b76('0x29')](handleEntityNotFound(_0x8445f8,null))[_0x1b76('0x29')](function(_0x37d081){if(_0x37d081){return _0x37d081[_0x1b76('0xd6')](_0xa71d35[_0x1b76('0x3c')]['ids']);}})[_0x1b76('0x29')](respondWithStatusCode(_0x8445f8,null))[_0x1b76('0x36')](handleError(_0x8445f8,null));};exports[_0x1b76('0xd7')]=function(_0x3a93cd,_0x49beed){var _0x4d92da=moment()[_0x1b76('0xd8')]()[_0x1b76('0x9c')]();var _0x51ae76=path[_0x1b76('0xd9')](config[_0x1b76('0xda')],_0x1b76('0xdb'),'files','tmp');var _0x405d19=path[_0x1b76('0xd9')](config[_0x1b76('0xda')],'server',_0x1b76('0xdc'),_0x1b76('0xdd'));var _0x4b0e0b=path[_0x1b76('0xd9')](_0x51ae76,_0x4d92da);var _0x4559e6=util[_0x1b76('0xd0')](_0x1b76('0xde'),_0x3a93cd[_0x1b76('0xc9')]['id'],_0x4d92da);var _0x27adc2=path[_0x1b76('0xd9')](_0x51ae76,_0x4559e6);var _0x12b53a=[];if(_0x3a93cd[_0x1b76('0x3c')][_0x1b76('0xdd')]){_0x12b53a[_0x1b76('0xbf')]({'model':db[_0x1b76('0xdf')],'as':_0x1b76('0xe0'),'raw':!![]});}var _0x48dfc3=[{'model':db[_0x1b76('0xcc')],'as':'Messages','attributes':['id',_0x1b76('0xc7'),'from','to','cc','bcc',_0x1b76('0xe1'),_0x1b76('0x78')],'where':{'secret':![]},'order':qs[_0x1b76('0x44')]('id'),'include':_0x12b53a}];return db['MailInteraction'][_0x1b76('0x5c')]({'where':{'id':_0x3a93cd[_0x1b76('0xc9')]['id']},'include':_0x48dfc3})[_0x1b76('0x29')](handleEntityNotFound(_0x49beed,null))['then'](function(_0x172b32){if(_0x172b32&&_0x172b32[_0x1b76('0xe2')]){var _0x20b23a=_0x172b32[_0x1b76('0xe3')]({'plain':!![]});fs[_0x1b76('0xe4')](_0x4b0e0b);return BPromise[_0x1b76('0xe5')](_0x20b23a['Messages'],function(_0x55e9c5,_0x4d5db8){var _0x21fb25={'from':_0x55e9c5[_0x1b76('0x49')],'to':_0x55e9c5['to'],'subject':_0x55e9c5[_0x1b76('0xe1')],'html':_0x55e9c5[_0x1b76('0xc7')],'headers':{'Date':moment(_0x55e9c5[_0x1b76('0x78')])['format'](_0x1b76('0xe6'))},'attachments':[]};if(_0x55e9c5['cc']){_0x21fb25['headers']['Cc']=_0x55e9c5['cc'];}if(_0x55e9c5[_0x1b76('0xe7')]){_0x21fb25[_0x1b76('0xe8')][_0x1b76('0xe9')]=_0x55e9c5[_0x1b76('0xe7')];}return new BPromise(function(_0x345c4f,_0x2b1bd6){if(_0x55e9c5[_0x1b76('0xe0')]){for(var _0x59713d=0x0;_0x59713d<_0x55e9c5['Attachments']['length'];_0x59713d++){var _0x35a65b=_0x55e9c5[_0x1b76('0xe0')][_0x59713d];var _0x3c91c4=path[_0x1b76('0xd9')](_0x405d19,_0x35a65b[_0x1b76('0xea')]);if(fs[_0x1b76('0xeb')](_0x3c91c4)){_0x21fb25['attachments'][_0x1b76('0xbf')]({'name':_0x35a65b['name'],'contentType':_0x35a65b[_0x1b76('0x39')],'data':fs[_0x1b76('0xec')](_0x3c91c4)});}}}emlformat['build'](_0x21fb25,function(_0xf85e16,_0x29ac79){if(_0xf85e16)return _0x2b1bd6(_0xf85e16);fs[_0x1b76('0xed')](path[_0x1b76('0xd9')](_0x4b0e0b,util[_0x1b76('0xd0')]('message%d.eml',_0x4d5db8)),_0x29ac79);return _0x345c4f(_0x29ac79);});});})[_0x1b76('0x29')](function(){return new BPromise(function(_0x32f4f4,_0x17d310){zipdir(_0x4b0e0b,{'saveTo':_0x27adc2},function(_0x3e63b9,_0x2ebe3d){if(_0x3e63b9)return _0x17d310(_0x3e63b9);return _0x32f4f4(_0x2ebe3d);});})[_0x1b76('0x29')](function(){return new BPromise(function(_0x5da66a,_0x5e625f){rimraf(_0x4b0e0b,function(_0xc1e063){if(_0xc1e063)_0x5e625f(_0xc1e063);return _0x5da66a();});});})[_0x1b76('0x29')](function(){return _0x49beed['download'](_0x27adc2,_0x4559e6,function(_0x23d4d6){if(_0x23d4d6){console[_0x1b76('0xee')](_0x1b76('0xef'),_0x23d4d6);}else{fs[_0x1b76('0xf0')](_0x27adc2);}});});});}else{return _0x49beed['sendStatus'](0xc8);}})[_0x1b76('0x36')](handleError(_0x49beed,null));}; \ No newline at end of file +var _0xb968=['model','fields','length','order','sort','where','pick','select','tools_tags','field','u.fullname','from','user_has_mail_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','me.MailInteractionId\x20=\x20i.id','mail_interaction_has_tags','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','start','Tag','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','plainBody','some','compact','isEmpty','forEach','MailAccountId','i.MailAccountId\x20IN\x20?','concat','createdAt','$gte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','QueryTypes','SELECT','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','journey','i.MailAccountId\x20IS\x20NOT\x20NULL','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','a.key','Account.key','i.createdAt','i.updatedAt','i.closedAt','i.attach','i.lastMsgDirection','i.subject','i.disposition','i.substatus','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','c.email','c.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','groupBy','MailInteractionId','Setting','enableEmailPreview','all','rows','show','intersection','includeAll','include','options','create','body','params','destroy','describe','addMessage','ids','omit','MailMessage','hasOwnProperty','nolimit','merge','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','emit','mailInteractionTags:save','removeTags','download','unix','join','root','server','tmp','files','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','bcc','subject','get','mkdirSync','each','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','existsSync','readFileSync','build','writeFileSync','message%d.eml','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','querystring','html-to-text','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./mailInteraction.socket','register','status','end','count','offset','limit','set','Content-Range','json','apply','then','sendStatus','error','name','Users','map','TagIds','Tags','push','MailInteraction','findOne','lastMsgBody','lastMsgText','catch','index','rawAttributes','fieldName','type','key','query','keys','filters','attributes'];(function(_0x40b48b,_0x5c29e7){var _0x5cbd32=function(_0x5f4e5a){while(--_0x5f4e5a){_0x40b48b['push'](_0x40b48b['shift']());}};_0x5cbd32(++_0x5c29e7);}(_0xb968,0x18e));var _0x8b96=function(_0x3eea1d,_0x45de31){_0x3eea1d=_0x3eea1d-0x0;var _0x193dc9=_0xb968[_0x3eea1d];return _0x193dc9;};'use strict';var pdf=require(_0x8b96('0x0'));var emlformat=require(_0x8b96('0x1'));var rimraf=require(_0x8b96('0x2'));var zipdir=require(_0x8b96('0x3'));var jsonpatch=require(_0x8b96('0x4'));var rp=require('request-promise');var moment=require(_0x8b96('0x5'));var BPromise=require(_0x8b96('0x6'));var Mustache=require(_0x8b96('0x7'));var util=require(_0x8b96('0x8'));var path=require(_0x8b96('0x9'));var sox=require(_0x8b96('0xa'));var csv=require(_0x8b96('0xb'));var ejs=require(_0x8b96('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x8b96('0xd'));var jsforce=require(_0x8b96('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x8b96('0xb'));var querystring=require(_0x8b96('0xf'));var Papa=require('papaparse');var htmlToText=require(_0x8b96('0x10'));var Redis=require(_0x8b96('0x11'));var authService=require(_0x8b96('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x8b96('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8b96('0x14'));var utils=require(_0x8b96('0x15'));var config=require(_0x8b96('0x16'));var db=require(_0x8b96('0x17'))['db'];config[_0x8b96('0x18')]=_['defaults'](config[_0x8b96('0x18')],{'host':_0x8b96('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8b96('0x18')]));require(_0x8b96('0x1a'))[_0x8b96('0x1b')](socket);function respondWithStatusCode(_0xa835e8,_0x59fdc2){_0x59fdc2=_0x59fdc2||0xcc;return function(_0x297a58){if(_0x297a58){return _0xa835e8['sendStatus'](_0x59fdc2);}return _0xa835e8[_0x8b96('0x1c')](_0x59fdc2)[_0x8b96('0x1d')]();};}function respondWithResult(_0x4a0d35,_0x238007){_0x238007=_0x238007||0xc8;return function(_0x1f6204){if(_0x1f6204){return _0x4a0d35[_0x8b96('0x1c')](_0x238007)['json'](_0x1f6204);}};}function respondWithFilteredResult(_0x31d468,_0x3f7f70){return function(_0x13a595){if(_0x13a595){var _0x5607bd=_0x13a595[_0x8b96('0x1e')],_0x91c41f=_0x3f7f70[_0x8b96('0x1f')],_0x52fbe6=_0x3f7f70[_0x8b96('0x1f')]+_0x3f7f70[_0x8b96('0x20')],_0x56ab9b;if(_0x52fbe6>=_0x5607bd){_0x52fbe6=_0x5607bd;_0x56ab9b=0xc8;}else{_0x56ab9b=0xce;}_0x31d468[_0x8b96('0x1c')](_0x56ab9b);return _0x31d468[_0x8b96('0x21')](_0x8b96('0x22'),_0x91c41f+'-'+_0x52fbe6+'/'+_0x5607bd)[_0x8b96('0x23')](_0x13a595);}return null;};}function patchUpdates(_0x9487c7){return function(_0x177d8f){try{jsonpatch[_0x8b96('0x24')](_0x177d8f,_0x9487c7,!![]);}catch(_0x625f7c){return BPromise['reject'](_0x625f7c);}return _0x177d8f['save']();};}function saveUpdates(_0x8bb879,_0x170a6b){return function(_0x44a428){if(_0x44a428){return _0x44a428['update'](_0x8bb879)[_0x8b96('0x25')](function(_0x3676d1){return _0x3676d1;});}return null;};}function removeEntity(_0x15e144,_0x5b31b9){return function(_0x160f14){if(_0x160f14){return _0x160f14['destroy']()['then'](function(){_0x15e144[_0x8b96('0x1c')](0xcc)[_0x8b96('0x1d')]();});}};}function handleEntityNotFound(_0x1414da,_0x53423d){return function(_0x38f5d4){if(!_0x38f5d4){_0x1414da[_0x8b96('0x26')](0x194);}return _0x38f5d4;};}function handleError(_0x57dcee,_0x5e65f2){_0x5e65f2=_0x5e65f2||0x1f4;return function(_0x72fdf5){logger[_0x8b96('0x27')](_0x72fdf5['stack']);if(_0x72fdf5['name']){delete _0x72fdf5[_0x8b96('0x28')];}_0x57dcee[_0x8b96('0x1c')](_0x5e65f2)['send'](_0x72fdf5);};}function getInteractionUsers(_0x38d822,_0x253c8b){return new BPromise(function(_0x392dd6,_0x33f074){try{if(_0x253c8b[_0x38d822['id']]){_0x38d822[_0x8b96('0x29')]=_[_0x8b96('0x2a')](_0x253c8b[_0x38d822['id']],function(_0x540fd9){return{'id':_0x540fd9['id'],'fullname':_0x540fd9['fullname']};});}}catch(_0x38f8ad){_0x33f074(_0x38f8ad);}_0x392dd6(_0x38d822);});}function getInteractionTags(_0x3e09b5,_0x32c71a){return new BPromise(function(_0x19724c,_0xafc67b){try{if(_0x3e09b5[_0x8b96('0x2b')]){_0x3e09b5[_0x8b96('0x2c')]=[];_0x3e09b5['TagIds']['split'](',')['forEach'](function(_0x30fb56){_0x3e09b5[_0x8b96('0x2c')][_0x8b96('0x2d')](_0x32c71a[_0x30fb56]);});}delete _0x3e09b5[_0x8b96('0x2b')];}catch(_0x3e2fc6){_0xafc67b(_0x3e2fc6);}_0x19724c(_0x3e09b5);});}function getLastMessageText(_0x28a9f6){return new BPromise(function(_0xaa0455,_0x578876){return db[_0x8b96('0x2e')][_0x8b96('0x2f')]({'where':{'id':_0x28a9f6['id']},'attributes':[_0x8b96('0x30'),_0x8b96('0x31')],'raw':!![]})[_0x8b96('0x25')](function(_0x348c0a){if(!_0x348c0a[_0x8b96('0x31')]){_0x28a9f6[_0x8b96('0x31')]=_['trimStart'](htmlToText['fromString'](_0x348c0a[_0x8b96('0x30')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x28a9f6[_0x8b96('0x31')]=_0x348c0a[_0x8b96('0x31')];}_0xaa0455(_0x28a9f6);})[_0x8b96('0x32')](function(_0x115287){_0x578876(_0x115287);});});}function updateMailInteraction(_0xe5a9ab,_0x106970,_0x16dde3,_0x55960f){return new BPromise(function(_0x342a42,_0x1c1d29){return getInteractionUsers(_0xe5a9ab,_0x16dde3)['then'](function(_0x38dd63){return getInteractionTags(_0x38dd63,_0x106970);})[_0x8b96('0x25')](function(_0x1bd83c){if(_0x55960f){_0x342a42(getLastMessageText(_0x1bd83c));}else{_0x342a42(_0x1bd83c);}})[_0x8b96('0x32')](function(_0x4e42fa){_0x1c1d29(_0x4e42fa);});});}exports[_0x8b96('0x33')]=function(_0x4c09ae,_0x161f84){var _0x416d80={},_0x1a4ead={},_0x4cd025={'count':0x0,'rows':[]};var _0x472ab7=_[_0x8b96('0x2a')](db[_0x8b96('0x2e')][_0x8b96('0x34')],function(_0x458afd){return{'name':_0x458afd[_0x8b96('0x35')],'type':_0x458afd[_0x8b96('0x36')][_0x8b96('0x37')]};});_0x1a4ead['model']=_[_0x8b96('0x2a')](_0x472ab7,_0x8b96('0x28'));_0x1a4ead[_0x8b96('0x38')]=_[_0x8b96('0x39')](_0x4c09ae[_0x8b96('0x38')]);_0x1a4ead[_0x8b96('0x3a')]=_['intersection'](_0x1a4ead['model'],_0x1a4ead[_0x8b96('0x38')]);_0x416d80[_0x8b96('0x3b')]=_['intersection'](_0x1a4ead[_0x8b96('0x3c')],qs[_0x8b96('0x3d')](_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x3d')]));_0x416d80[_0x8b96('0x3b')]=_0x416d80[_0x8b96('0x3b')][_0x8b96('0x3e')]?_0x416d80[_0x8b96('0x3b')]:_0x1a4ead['model'];if(!_0x4c09ae[_0x8b96('0x38')]['hasOwnProperty']('nolimit')){_0x416d80[_0x8b96('0x20')]=qs['limit'](_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x20')]);_0x416d80[_0x8b96('0x1f')]=qs[_0x8b96('0x1f')](_0x4c09ae[_0x8b96('0x38')]['offset']);}_0x416d80[_0x8b96('0x3f')]=qs[_0x8b96('0x40')](_0x4c09ae[_0x8b96('0x38')]['sort']);_0x416d80[_0x8b96('0x41')]=qs[_0x8b96('0x3a')](_[_0x8b96('0x42')](_0x4c09ae[_0x8b96('0x38')],_0x1a4ead[_0x8b96('0x3a')]));var _0x5a41fb=[];var _0x5e94b5=squel[_0x8b96('0x43')]()['field']('id')['field'](_0x8b96('0x28'))['field']('color')['from'](_0x8b96('0x44'));var _0xab1d0b=squel[_0x8b96('0x43')]()['field']('u.id')[_0x8b96('0x45')](_0x8b96('0x46'))[_0x8b96('0x45')]('ui.MailInteractionId')[_0x8b96('0x47')](_0x8b96('0x48'),'ui')[_0x8b96('0x49')](_0x8b96('0x4a'),'u',_0x8b96('0x4b'));var _0x25e069=squel['select']()[_0x8b96('0x47')]('mail_interactions','i')['left_join'](_0x8b96('0x4c'),'c',_0x8b96('0x4d'))['left_join']('users','o','o.id\x20=\x20i.UserId')[_0x8b96('0x49')](_0x8b96('0x4e'),'a',_0x8b96('0x4f'))[_0x8b96('0x49')](_0x8b96('0x50'),'me',_0x8b96('0x51'))[_0x8b96('0x49')](_0x8b96('0x52'),'it',_0x8b96('0x53'))[_0x8b96('0x49')](_0x8b96('0x44'),'t',_0x8b96('0x54'));var _0x575944=squel[_0x8b96('0x55')]();var _0x3066cc=[];var _0x46d05c=squel[_0x8b96('0x55')]();var _0x40abb9;if(_0x4c09ae['query'][_0x8b96('0x56')]){_0x40abb9=as['parseSearch'](_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x56')]);var _0x597880=_0x40abb9[_0x8b96('0x57')];for(var _0x4a4d61=0x0;_0x4a4d61<_0x40abb9['conditions'][_0x8b96('0x3e')];_0x4a4d61++){var _0x3899e0=_0x40abb9[_0x8b96('0x58')][_0x4a4d61];var _0x5a29ed='i';var _0x33938e=_[_0x8b96('0x59')](_0x472ab7,['name',_0x3899e0[_0x8b96('0x45')]]);if(!_0x33938e){switch(_0x3899e0['field']){case _0x8b96('0x5a'):if(_0x3899e0[_0x8b96('0x5b')]==0x1){_0x25e069[_0x8b96('0x5c')]('`'+_0x3899e0['field']+_0x8b96('0x5d'));}else{_0x25e069[_0x8b96('0x5c')]('`'+_0x3899e0[_0x8b96('0x45')]+_0x8b96('0x5e'));}break;case _0x8b96('0x5f'):if(_0x3899e0[_0x8b96('0x60')]==='$substring'){if(_0x3899e0['value'][_0x8b96('0x61')]('\x20')[_0x8b96('0x3e')]>0x1){_0x575944[_0x597880](_0x8b96('0x62'),qs[_0x8b96('0x63')](_0x3899e0[_0x8b96('0x5b')]),null);}else{var _0x1a5c1d='%'+_0x3899e0['value']+'%';_0x575944[_0x597880]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x1a5c1d,_0x1a5c1d,_0x1a5c1d);}}else{_0x33938e=_[_0x8b96('0x59')](_0x472ab7,['name',_0x8b96('0x64')]);_0x3899e0[_0x8b96('0x45')]=_0x8b96('0x64');_0x49060b=as[_0x8b96('0x65')](_0x5a29ed,_0x33938e[_0x8b96('0x36')],_0x3899e0);_0x575944[_0x597880](_0x49060b[_0x8b96('0x66')],_0x49060b[_0x8b96('0x5b')][_0x8b96('0x67')],_0x49060b[_0x8b96('0x5b')][_0x8b96('0x1d')]);}break;case _0x8b96('0x68'):var _0x1c5886=_0x3899e0[_0x8b96('0x5b')]['split'](',')[_0x8b96('0x2a')](function(_0x3f3f99){return Number(_0x3f3f99);});_0x1c5886['forEach'](function(_0x35a1c2){_0x46d05c['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x35a1c2+',%');});_0x3066cc=_[_0x8b96('0x69')](_0x3066cc,_0x1c5886);break;case _0x8b96('0x6a'):if(_0x3899e0[_0x8b96('0x60')]===_0x8b96('0x6b')){_0x575944[_0x597880](_0x8b96('0x6c'),'%'+_0x3899e0[_0x8b96('0x5b')]+'%',null);}else{_0x33938e=_[_0x8b96('0x59')](_0x472ab7,[_0x8b96('0x28'),_0x8b96('0x6d')]);_0x3899e0['field']=_0x8b96('0x6d');_0x49060b=as[_0x8b96('0x65')](_0x5a29ed,_0x33938e[_0x8b96('0x36')],_0x3899e0);_0x575944[_0x597880](_0x49060b[_0x8b96('0x66')],_0x49060b['value']['start'],_0x49060b[_0x8b96('0x5b')]['end']);}break;case _0x8b96('0x6e'):_0x49060b=as['buildExpression']('me',null,_0x3899e0);_0x575944[_0x597880](_0x49060b[_0x8b96('0x66')],_0x49060b[_0x8b96('0x5b')][_0x8b96('0x67')],_0x49060b[_0x8b96('0x5b')]['end']);break;}}else{var _0x49060b=as[_0x8b96('0x65')](_0x5a29ed,_0x33938e[_0x8b96('0x36')],_0x3899e0);_0x575944[_0x597880](_0x49060b[_0x8b96('0x66')],_0x49060b['value'][_0x8b96('0x67')],_0x49060b[_0x8b96('0x5b')][_0x8b96('0x1d')]);}}}else{var _0x3760b3=_(_0x4c09ae[_0x8b96('0x38')])[_0x8b96('0x39')]()[_0x8b96('0x2a')](function(_0x1af17f){return _[_0x8b96('0x6f')](_0x472ab7,[_0x8b96('0x28'),_0x1af17f])?_0x1af17f:undefined;})[_0x8b96('0x70')]()[_0x8b96('0x5b')]();if(!_[_0x8b96('0x71')](_0x3760b3)){_0x3760b3[_0x8b96('0x72')](function(_0x4649c1){if(_0x4649c1===_0x8b96('0x73')){_0x25e069[_0x8b96('0x41')](_0x8b96('0x74'),[][_0x8b96('0x75')](_0x4c09ae[_0x8b96('0x38')][_0x4649c1]));}else if(_0x4649c1===_0x8b96('0x76')){var _0x3dc9a2=JSON['parse'](_0x4c09ae[_0x8b96('0x38')][_0x4649c1])[_0x8b96('0x77')];var _0x273846=JSON['parse'](_0x4c09ae[_0x8b96('0x38')][_0x4649c1])['$lte'];_0x25e069['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x3dc9a2,_0x273846);}else{if(_0x4c09ae[_0x8b96('0x38')][_0x4649c1]===_0x8b96('0x78')){_0x25e069[_0x8b96('0x41')]('i.'+_0x4649c1+_0x8b96('0x79'));}else{_0x25e069['where']('i.'+_0x4649c1+_0x8b96('0x7a'),_0x4c09ae[_0x8b96('0x38')][_0x4649c1]);}}});}if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x7b')]){if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x7b')]==0x1){_0x25e069[_0x8b96('0x5c')](_0x8b96('0x7c'));}else{_0x25e069['having']('`unreadMessages`\x20>\x200');}}if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x7d')]){_0x3066cc=_[_0x8b96('0x7e')](_0x4c09ae[_0x8b96('0x38')]['tag'])?_0x4c09ae['query']['tag']:new Array(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x7d')]);_0x3066cc['forEach'](function(_0xcd24c6){_0x46d05c['or'](_0x8b96('0x7f'),'%,'+_0xcd24c6+',%');});}if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x80')]){var _0x5a0234=_0x4c09ae['query'][_0x8b96('0x80')][_0x8b96('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x8b96('0x82'));if(qs[_0x8b96('0x83')](_0x5a0234)){_0x575944['or']('i.id\x20LIKE\x20?',_0x5a0234+'%');}else if(qs['isEmail'](_0x5a0234)){_0x575944['or'](_0x8b96('0x84'),_0x5a0234+'%');}else{_0x575944['or'](_0x8b96('0x85'),qs[_0x8b96('0x63')](_0x5a0234))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x8b96('0x63')](_0x5a0234));}}}_0x25e069['where'](_0x575944);_0x25e069[_0x8b96('0x86')](_0x8b96('0x87'));var _0x501995={'type':db['Sequelize'][_0x8b96('0x88')][_0x8b96('0x89')],'raw':!![]};var _0x27d1f4=_0x25e069['clone']();_0x27d1f4['field'](_0x8b96('0x87'));_0x27d1f4['field'](_0x8b96('0x8a'),_0x8b96('0x5a'));if(_0x416d80[_0x8b96('0x3f')]){_0x416d80[_0x8b96('0x3f')][_0x8b96('0x72')](function(_0x3a981b){_0x25e069[_0x8b96('0x3f')]('i.'+_0x3a981b[0x0],_0x3a981b[0x1]===_0x8b96('0x8b')?![]:!![]);});}if(!_[_0x8b96('0x71')](_0x3066cc)){_0x25e069[_0x8b96('0x5c')](_0x46d05c);_0x27d1f4[_0x8b96('0x41')](_0x8b96('0x8c'),_0x3066cc);}BPromise[_0x8b96('0x8d')]()[_0x8b96('0x25')](function(){if(!_0x40abb9){if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x73')]||_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x8e')])return;_0x27d1f4[_0x8b96('0x41')](_0x8b96('0x8f'));_0x25e069[_0x8b96('0x41')](_0x8b96('0x8f'));return;}return _0x4c09ae[_0x8b96('0x90')][_0x8b96('0x91')]({'attributes':['id'],'raw':!![]})[_0x8b96('0x25')](function(_0x43cb0f){if(_[_0x8b96('0x71')](_0x43cb0f)){_0x27d1f4[_0x8b96('0x41')](_0x8b96('0x92'));_0x25e069[_0x8b96('0x41')]('i.MailAccountId\x20IS\x20NULL');}else{_0x27d1f4[_0x8b96('0x41')](_0x8b96('0x74'),_[_0x8b96('0x2a')](_0x43cb0f,'id'));_0x25e069['where'](_0x8b96('0x74'),_[_0x8b96('0x2a')](_0x43cb0f,'id'));}});})[_0x8b96('0x25')](function(){db[_0x8b96('0x93')][_0x8b96('0x38')](_0x27d1f4[_0x8b96('0x94')](),_0x501995)['then'](function(_0x3f5137){_0x4cd025[_0x8b96('0x1e')]=_0x3f5137['length'];if(_0x4cd025[_0x8b96('0x1e')]===0x0)return[];return db[_0x8b96('0x93')][_0x8b96('0x38')](_0x5e94b5['toString'](),_0x501995)['then'](function(_0x4b4584){_0x5a41fb=_['keyBy'](_0x4b4584,'id');_0x501995=_['merge'](_0x501995,{'model':db[_0x8b96('0x2e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4c09ae[_0x8b96('0x38')][_0x8b96('0x3d')]){_0x416d80[_0x8b96('0x3b')][_0x8b96('0x72')](function(_0x161fb9){_0x25e069['field']('i.'+_0x161fb9);});}else{_0x25e069[_0x8b96('0x45')](_0x8b96('0x8a'),_0x8b96('0x5a'));_0x25e069['field'](_0x8b96('0x95'),_0x8b96('0x96'));_0x25e069[_0x8b96('0x45')]('a.mandatoryDisposition','Account.mandatoryDisposition');_0x25e069[_0x8b96('0x45')](_0x8b96('0x87'));_0x25e069['field'](_0x8b96('0x97'));_0x25e069[_0x8b96('0x45')](_0x8b96('0x98'));_0x25e069[_0x8b96('0x45')]('i.closed');_0x25e069[_0x8b96('0x45')](_0x8b96('0x99'));_0x25e069[_0x8b96('0x45')](_0x8b96('0x9a'));_0x25e069['field']('i.lastMsgAt');_0x25e069[_0x8b96('0x45')](_0x8b96('0x9b'));_0x25e069['field'](_0x8b96('0x9c'));_0x25e069[_0x8b96('0x45')](_0x8b96('0x9d'));_0x25e069['field'](_0x8b96('0x9e'));_0x25e069[_0x8b96('0x45')]('i.to');_0x25e069[_0x8b96('0x45')]('i.ContactId');_0x25e069[_0x8b96('0x45')](_0x8b96('0x9f'));_0x25e069[_0x8b96('0x45')](_0x8b96('0xa0'));_0x25e069[_0x8b96('0x45')](_0x8b96('0xa1'),_0x8b96('0xa2'));_0x25e069[_0x8b96('0x45')]('c.lastName','Contact.lastName');_0x25e069['field'](_0x8b96('0xa3'),'Contact.email');_0x25e069[_0x8b96('0x45')](_0x8b96('0xa4'),'Contact.phone');_0x25e069['field'](_0x8b96('0xa5'),_0x8b96('0xa6'));_0x25e069[_0x8b96('0x45')](_0x8b96('0xa7'),'Contact.fax');_0x25e069['field'](_0x8b96('0xa8'),_0x8b96('0xa9'));_0x25e069[_0x8b96('0x45')]('o.internal','Owner.internal');_0x25e069[_0x8b96('0x45')](_0x8b96('0xaa'),_0x8b96('0x2b'));}_0x25e069[_0x8b96('0x20')](_0x416d80[_0x8b96('0x20')]);_0x25e069[_0x8b96('0x1f')](_0x416d80[_0x8b96('0x1f')]);return db[_0x8b96('0x93')][_0x8b96('0x38')](_0x25e069[_0x8b96('0x94')](),_0x501995);})[_0x8b96('0x25')](function(_0x491671){_0xab1d0b[_0x8b96('0x41')](_0x8b96('0xab'),_[_0x8b96('0x2a')](_0x491671,'id'));return db['sequelize'][_0x8b96('0x38')](_0xab1d0b['toString'](),_0x501995)[_0x8b96('0x25')](function(_0x416bc1){var _0x42ec7f=_[_0x8b96('0xac')](_0x416bc1,_0x8b96('0xad'));var _0x14f185=[];return db[_0x8b96('0xae')][_0x8b96('0x2f')]({'attributes':[_0x8b96('0xaf')],'raw':!![]})[_0x8b96('0x25')](function(_0x4f0bda){var _0x388bd0=_0x4f0bda[_0x8b96('0xaf')];_0x491671['forEach'](function(_0x2f6b5d){_0x14f185[_0x8b96('0x2d')](updateMailInteraction(_0x2f6b5d,_0x5a41fb,_0x42ec7f,_0x388bd0));});return BPromise[_0x8b96('0xb0')](_0x14f185);});});});})[_0x8b96('0x25')](function(_0x2f61f4){_0x4cd025[_0x8b96('0xb1')]=_0x2f61f4;return _0x4cd025;})[_0x8b96('0x25')](respondWithFilteredResult(_0x161f84,_0x416d80));})['catch'](handleError(_0x161f84,null));};exports[_0x8b96('0xb2')]=function(_0x510ced,_0x28423d){var _0x475650={'raw':![],'where':{'id':_0x510ced['params']['id']}},_0x63dc1d={};_0x63dc1d[_0x8b96('0x3c')]=_['keys'](db[_0x8b96('0x2e')][_0x8b96('0x34')]);_0x63dc1d[_0x8b96('0x38')]=_[_0x8b96('0x39')](_0x510ced['query']);_0x63dc1d[_0x8b96('0x3a')]=_[_0x8b96('0xb3')](_0x63dc1d[_0x8b96('0x3c')],_0x63dc1d[_0x8b96('0x38')]);_0x475650[_0x8b96('0x3b')]=_[_0x8b96('0xb3')](_0x63dc1d[_0x8b96('0x3c')],qs[_0x8b96('0x3d')](_0x510ced['query']['fields']));_0x475650['attributes']=_0x475650['attributes'][_0x8b96('0x3e')]?_0x475650[_0x8b96('0x3b')]:_0x63dc1d[_0x8b96('0x3c')];if(_0x510ced[_0x8b96('0x38')][_0x8b96('0xb4')]){_0x475650[_0x8b96('0xb5')]=[{'all':!![]}];}_0x475650=_['merge']({},_0x475650,_0x510ced[_0x8b96('0xb6')]);return db[_0x8b96('0x2e')][_0x8b96('0x59')](_0x475650)[_0x8b96('0x25')](handleEntityNotFound(_0x28423d,null))[_0x8b96('0x25')](respondWithResult(_0x28423d,null))[_0x8b96('0x32')](handleError(_0x28423d,null));};exports['create']=function(_0x6f2f7b,_0x41acda){return db[_0x8b96('0x2e')][_0x8b96('0xb7')](_0x6f2f7b[_0x8b96('0xb8')],{})[_0x8b96('0x25')](respondWithResult(_0x41acda,0xc9))[_0x8b96('0x32')](handleError(_0x41acda,null));};exports['update']=function(_0x3beaad,_0x4f6e9b){if(_0x3beaad[_0x8b96('0xb8')]['id']){delete _0x3beaad[_0x8b96('0xb8')]['id'];}return db['MailInteraction'][_0x8b96('0x59')]({'where':{'id':_0x3beaad[_0x8b96('0xb9')]['id']}})[_0x8b96('0x25')](handleEntityNotFound(_0x4f6e9b,null))['then'](saveUpdates(_0x3beaad[_0x8b96('0xb8')],null))[_0x8b96('0x25')](respondWithResult(_0x4f6e9b,null))['catch'](handleError(_0x4f6e9b,null));};exports[_0x8b96('0xba')]=function(_0x33485e,_0xe08970){return db[_0x8b96('0x2e')][_0x8b96('0x59')]({'where':{'id':_0x33485e[_0x8b96('0xb9')]['id']}})[_0x8b96('0x25')](handleEntityNotFound(_0xe08970,null))[_0x8b96('0x25')](removeEntity(_0xe08970,null))['catch'](handleError(_0xe08970,null));};exports[_0x8b96('0xbb')]=function(_0xdba862,_0xd66f80){return db[_0x8b96('0x2e')][_0x8b96('0xbb')]()['then'](respondWithResult(_0xd66f80,null))['catch'](handleError(_0xd66f80,null));};exports['addMessage']=function(_0x382301,_0x1b925b,_0x195200){return db['MailMessage'][_0x8b96('0x59')]({'where':{'id':_0x382301[_0x8b96('0xb9')]['id']}})[_0x8b96('0x25')](handleEntityNotFound(_0x1b925b,null))[_0x8b96('0x25')](function(_0x11a484){if(_0x11a484){return _0x11a484[_0x8b96('0xbc')](_0x382301[_0x8b96('0xb8')][_0x8b96('0xbd')],_[_0x8b96('0xbe')](_0x382301[_0x8b96('0xb8')],[_0x8b96('0xbd'),'id'])||{});}})['then'](respondWithResult(_0x1b925b,null))[_0x8b96('0x32')](handleError(_0x1b925b,null));};exports['getMessages']=function(_0x42eb50,_0x17e1d0,_0x56fc3a){var _0x3d84ba={'raw':![],'where':{}};var _0x4145a5={};var _0x285e98={'count':0x0,'rows':[]};return db['MailInteraction']['findOne']({'where':{'id':_0x42eb50[_0x8b96('0xb9')]['id']}})[_0x8b96('0x25')](handleEntityNotFound(_0x17e1d0,null))[_0x8b96('0x25')](function(_0x126393){if(_0x126393){_0x4145a5['model']=_['keys'](db[_0x8b96('0xbf')]['rawAttributes']);_0x4145a5['query']=_['keys'](_0x42eb50['query']);_0x4145a5[_0x8b96('0x3a')]=_[_0x8b96('0xb3')](_0x4145a5['model'],_0x4145a5['query']);_0x3d84ba['attributes']=_['intersection'](_0x4145a5[_0x8b96('0x3c')],qs[_0x8b96('0x3d')](_0x42eb50[_0x8b96('0x38')][_0x8b96('0x3d')]));_0x3d84ba[_0x8b96('0x3b')]=_0x3d84ba['attributes']['length']?_0x3d84ba[_0x8b96('0x3b')]:_0x4145a5[_0x8b96('0x3c')];if(!_0x42eb50['query'][_0x8b96('0xc0')](_0x8b96('0xc1'))){_0x3d84ba['limit']=qs[_0x8b96('0x20')](_0x42eb50['query'][_0x8b96('0x20')]);_0x3d84ba[_0x8b96('0x1f')]=qs['offset'](_0x42eb50[_0x8b96('0x38')][_0x8b96('0x1f')]);}_0x3d84ba['order']=qs[_0x8b96('0x40')](_0x42eb50[_0x8b96('0x38')]['sort']);_0x3d84ba[_0x8b96('0x41')]=qs['filters'](_[_0x8b96('0x42')](_0x42eb50[_0x8b96('0x38')],_0x4145a5[_0x8b96('0x3a')]));_0x3d84ba[_0x8b96('0x41')][_0x8b96('0xad')]=_0x126393['id'];if(_0x42eb50['query'][_0x8b96('0x80')]){_0x3d84ba[_0x8b96('0x41')]=_[_0x8b96('0xc2')](_0x3d84ba[_0x8b96('0x41')],{'$or':_[_0x8b96('0x2a')](_0x3d84ba[_0x8b96('0x3b')],function(_0x58c0b3){var _0x1bdf86={};_0x1bdf86[_0x58c0b3]={'$like':'%'+_0x42eb50[_0x8b96('0x38')][_0x8b96('0x80')]+'%'};return _0x1bdf86;})});}if(_0x42eb50[_0x8b96('0x38')]['$gte']){var _0x8623ba=_0x42eb50['query'][_0x8b96('0x77')][_0x8b96('0x61')](',');var _0x4d1e19={};_0x4d1e19[_0x8623ba[0x0]]={'$gte':moment(_0x8623ba[0x1])[_0x8b96('0xc3')](_0x8b96('0xc4'))};_0x3d84ba['where']=_[_0x8b96('0xc2')](_0x3d84ba['where'],_0x4d1e19);}_0x3d84ba=_[_0x8b96('0xc2')]({},_0x3d84ba,_0x42eb50[_0x8b96('0xb6')]);return db[_0x8b96('0xbf')][_0x8b96('0x1e')]({'where':_0x3d84ba[_0x8b96('0x41')]})[_0x8b96('0x25')](function(_0x5acc55){_0x285e98[_0x8b96('0x1e')]=_0x5acc55;if(_0x42eb50[_0x8b96('0x38')][_0x8b96('0xb4')]){_0x3d84ba[_0x8b96('0xb5')]=[{'all':!![]}];}return db['MailMessage'][_0x8b96('0xc5')](_0x3d84ba);})[_0x8b96('0x25')](function(_0x2c1e5d){_0x285e98[_0x8b96('0xb1')]=_0x2c1e5d;return _0x285e98;});}})[_0x8b96('0x25')](respondWithFilteredResult(_0x17e1d0,_0x3d84ba))['catch'](handleError(_0x17e1d0,null));};exports[_0x8b96('0xc6')]=function(_0x414773,_0x1d33c8,_0x15fe32){return db['MailInteraction']['find']({'where':{'id':_0x414773[_0x8b96('0xb9')]['id']}})['then'](handleEntityNotFound(_0x1d33c8,null))[_0x8b96('0x25')](function(_0x3e468b){if(_0x3e468b){return _0x3e468b['setTags'](_0x414773[_0x8b96('0xb8')][_0x8b96('0xbd')],_['omit'](_0x414773[_0x8b96('0xb8')],['ids','id'])||{})[_0x8b96('0xc7')](function(){return db[_0x8b96('0x68')][_0x8b96('0xc5')]({'attributes':['id','name','color'],'where':{'id':_0x414773[_0x8b96('0xb8')][_0x8b96('0xbd')]}});})[_0x8b96('0x25')](function(_0x3ce891){socket[_0x8b96('0xc8')](_0x8b96('0xc9'),{'id':Number(_0x414773['params']['id']),'tags':_0x3ce891||[]});return{'id':Number(_0x414773['params']['id']),'tags':_0x3ce891||[]};});}})[_0x8b96('0x25')](respondWithResult(_0x1d33c8,null))[_0x8b96('0x32')](handleError(_0x1d33c8,null));};exports['removeTags']=function(_0x48f379,_0x31a618,_0x45d7d7){return db['MailInteraction']['find']({'where':{'id':_0x48f379[_0x8b96('0xb9')]['id']}})[_0x8b96('0x25')](handleEntityNotFound(_0x31a618,null))[_0x8b96('0x25')](function(_0x154395){if(_0x154395){return _0x154395[_0x8b96('0xca')](_0x48f379['query'][_0x8b96('0xbd')]);}})['then'](respondWithStatusCode(_0x31a618,null))[_0x8b96('0x32')](handleError(_0x31a618,null));};exports[_0x8b96('0xcb')]=function(_0x3ee266,_0x14dbe7){var _0x42674c=moment()[_0x8b96('0xcc')]()['toString']();var _0x515a91=path[_0x8b96('0xcd')](config[_0x8b96('0xce')],_0x8b96('0xcf'),'files',_0x8b96('0xd0'));var _0xc83cc1=path[_0x8b96('0xcd')](config[_0x8b96('0xce')],'server',_0x8b96('0xd1'),_0x8b96('0xd2'));var _0x465faa=path[_0x8b96('0xcd')](_0x515a91,_0x42674c);var _0x50706e=util[_0x8b96('0xc3')](_0x8b96('0xd3'),_0x3ee266[_0x8b96('0xb9')]['id'],_0x42674c);var _0x493a21=path['join'](_0x515a91,_0x50706e);var _0x107949=[];if(_0x3ee266[_0x8b96('0x38')][_0x8b96('0xd2')]){_0x107949[_0x8b96('0x2d')]({'model':db[_0x8b96('0xd4')],'as':_0x8b96('0xd5'),'raw':!![]});}var _0x1d3559=[{'model':db[_0x8b96('0xbf')],'as':_0x8b96('0xd6'),'attributes':['id',_0x8b96('0xb8'),'from','to','cc',_0x8b96('0xd7'),_0x8b96('0xd8'),_0x8b96('0x76')],'where':{'secret':![]},'order':qs[_0x8b96('0x40')]('id'),'include':_0x107949}];return db[_0x8b96('0x2e')][_0x8b96('0x59')]({'where':{'id':_0x3ee266[_0x8b96('0xb9')]['id']},'include':_0x1d3559})[_0x8b96('0x25')](handleEntityNotFound(_0x14dbe7,null))[_0x8b96('0x25')](function(_0x437540){if(_0x437540&&_0x437540['Messages']){var _0x1814a1=_0x437540[_0x8b96('0xd9')]({'plain':!![]});fs[_0x8b96('0xda')](_0x465faa);return BPromise[_0x8b96('0xdb')](_0x1814a1['Messages'],function(_0x40587b,_0x5581a4){var _0x4a3aeb={'from':_0x40587b[_0x8b96('0x47')],'to':_0x40587b['to'],'subject':_0x40587b[_0x8b96('0xd8')],'html':_0x40587b['body'],'headers':{'Date':moment(_0x40587b[_0x8b96('0x76')])[_0x8b96('0xc3')](_0x8b96('0xdc'))},'attachments':[]};if(_0x40587b['cc']){_0x4a3aeb[_0x8b96('0xdd')]['Cc']=_0x40587b['cc'];}if(_0x40587b[_0x8b96('0xd7')]){_0x4a3aeb[_0x8b96('0xdd')][_0x8b96('0xde')]=_0x40587b[_0x8b96('0xd7')];}return new BPromise(function(_0x3ff59e,_0x373965){if(_0x40587b[_0x8b96('0xd5')]){for(var _0x414673=0x0;_0x414673<_0x40587b['Attachments'][_0x8b96('0x3e')];_0x414673++){var _0x509946=_0x40587b['Attachments'][_0x414673];var _0x305a56=path[_0x8b96('0xcd')](_0xc83cc1,_0x509946['basename']);if(fs[_0x8b96('0xdf')](_0x305a56)){_0x4a3aeb[_0x8b96('0xd2')][_0x8b96('0x2d')]({'name':_0x509946[_0x8b96('0x28')],'contentType':_0x509946[_0x8b96('0x36')],'data':fs[_0x8b96('0xe0')](_0x305a56)});}}}emlformat[_0x8b96('0xe1')](_0x4a3aeb,function(_0x4b2ed7,_0x1ae582){if(_0x4b2ed7)return _0x373965(_0x4b2ed7);fs[_0x8b96('0xe2')](path[_0x8b96('0xcd')](_0x465faa,util[_0x8b96('0xc3')](_0x8b96('0xe3'),_0x5581a4)),_0x1ae582);return _0x3ff59e(_0x1ae582);});});})[_0x8b96('0x25')](function(){return new BPromise(function(_0x4abb86,_0x556e6c){zipdir(_0x465faa,{'saveTo':_0x493a21},function(_0x37d32a,_0x5b37e1){if(_0x37d32a)return _0x556e6c(_0x37d32a);return _0x4abb86(_0x5b37e1);});})[_0x8b96('0x25')](function(){return new BPromise(function(_0x10e851,_0x30972b){rimraf(_0x465faa,function(_0x3f6a16){if(_0x3f6a16)_0x30972b(_0x3f6a16);return _0x10e851();});});})[_0x8b96('0x25')](function(){return _0x14dbe7[_0x8b96('0xcb')](_0x493a21,_0x50706e,function(_0x460ab7){if(_0x460ab7){console['log']('err',_0x460ab7);}else{fs[_0x8b96('0xe4')](_0x493a21);}});});});}else{return _0x14dbe7[_0x8b96('0x26')](0xc8);}})[_0x8b96('0x32')](handleError(_0x14dbe7,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index d2b3c6b..e03e7ed 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 _0xd4c3=['MailInteraction','../../mysqldb','setMaxListeners','save','remove','getUsers','setDataValue','Users','map','findAll','then','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x34aaaf,_0x923675){var _0x5d5a10=function(_0x4559ac){while(--_0x4559ac){_0x34aaaf['push'](_0x34aaaf['shift']());}};_0x5d5a10(++_0x923675);}(_0xd4c3,0x1ba));var _0x3d4c=function(_0x246148,_0x1358ee){_0x246148=_0x246148-0x0;var _0x453d94=_0xd4c3[_0x246148];return _0x453d94;};'use strict';var EventEmitter=require('events');var MailInteraction=require('../../mysqldb')['db'][_0x3d4c('0x0')];var MailMessage=require(_0x3d4c('0x1'))['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x3d4c('0x2')](0x0);var events={'afterCreate':_0x3d4c('0x3'),'afterUpdate':'update','afterDestroy':_0x3d4c('0x4')};function emitEvent(_0x10d754){return function(_0x1d7c39,_0x58a934,_0x27be7a){_0x1d7c39[_0x3d4c('0x5')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2002f0){_0x1d7c39[_0x3d4c('0x6')](_0x3d4c('0x7'),_0x2002f0[_0x3d4c('0x8')](function(_0x723c63){return{'id':_0x723c63['id']};}));return MailMessage[_0x3d4c('0x9')]({'where':{'MailInteractionId':_0x1d7c39['id'],'direction':'in','read':![]},'raw':!![]});})[_0x3d4c('0xa')](function(_0x71ace2){_0x1d7c39[_0x3d4c('0x6')]('unreadMessages',_0x71ace2[_0x3d4c('0xb')]);MailInteractionEvents['emit'](_0x10d754+':'+_0x1d7c39['id'],_0x1d7c39);MailInteractionEvents[_0x3d4c('0xc')](_0x10d754,_0x1d7c39);_0x27be7a(null);})[_0x3d4c('0xd')](_0x27be7a(null));};}for(var e in events){if(events[_0x3d4c('0xe')](e)){var event=events[e];MailInteraction[_0x3d4c('0xf')](e,emitEvent(event));}}module[_0x3d4c('0x10')]=MailInteractionEvents; \ No newline at end of file +var _0x5c13=['setDataValue','Users','map','findAll','length','catch','hasOwnProperty','exports','events','../../mysqldb','MailInteraction','setMaxListeners','remove','getUsers','then'];(function(_0x515283,_0x813dea){var _0x38f836=function(_0x40c8f4){while(--_0x40c8f4){_0x515283['push'](_0x515283['shift']());}};_0x38f836(++_0x813dea);}(_0x5c13,0x9e));var _0x35c1=function(_0x15bc81,_0x4d4f77){_0x15bc81=_0x15bc81-0x0;var _0x59440e=_0x5c13[_0x15bc81];return _0x59440e;};'use strict';var EventEmitter=require(_0x35c1('0x0'));var MailInteraction=require(_0x35c1('0x1'))['db'][_0x35c1('0x2')];var MailMessage=require('../../mysqldb')['db']['MailMessage'];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x35c1('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x35c1('0x4')};function emitEvent(_0x2b4a5a){return function(_0x45eeae,_0x429f3f,_0xcf3bab){_0x45eeae[_0x35c1('0x5')]({'attributes':['id'],'raw':!![]})[_0x35c1('0x6')](function(_0x1b948c){_0x45eeae[_0x35c1('0x7')](_0x35c1('0x8'),_0x1b948c[_0x35c1('0x9')](function(_0x2374c5){return{'id':_0x2374c5['id']};}));return MailMessage[_0x35c1('0xa')]({'where':{'MailInteractionId':_0x45eeae['id'],'direction':'in','read':![]},'raw':!![]});})[_0x35c1('0x6')](function(_0x318d4b){_0x45eeae['setDataValue']('unreadMessages',_0x318d4b[_0x35c1('0xb')]);MailInteractionEvents['emit'](_0x2b4a5a+':'+_0x45eeae['id'],_0x45eeae);MailInteractionEvents['emit'](_0x2b4a5a,_0x45eeae);_0xcf3bab(null);})[_0x35c1('0xc')](_0xcf3bab(null));};}for(var e in events){if(events[_0x35c1('0xd')](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0x35c1('0xe')]=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index c12ca4d..74b29ce 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 _0x2179=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailInteraction.attributes','exports','define','mail_interactions','fti_mail_interactions','subject','FULLTEXT','substatus','format','YYYY-MM-DD\x20HH:mm:ss','closed','changed','substatusAt','closedAt','models','get','MailMessage','update','then','catch','utf8mb4','utf8mb4_unicode_ci'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x2179,0xc0));var _0x9217=function(_0x33efcc,_0x2ebf86){_0x33efcc=_0x33efcc-0x0;var _0x2e9f19=_0x2179[_0x33efcc];return _0x2e9f19;};'use strict';var _=require(_0x9217('0x0'));var util=require(_0x9217('0x1'));var logger=require(_0x9217('0x2'))(_0x9217('0x3'));var moment=require(_0x9217('0x4'));var BPromise=require(_0x9217('0x5'));var rp=require(_0x9217('0x6'));var fs=require('fs');var path=require(_0x9217('0x7'));var rimraf=require(_0x9217('0x8'));var config=require(_0x9217('0x9'));var attributes=require(_0x9217('0xa'));module[_0x9217('0xb')]=function(_0x471e4c,_0x17a107){return _0x471e4c[_0x9217('0xc')]('MailInteraction',attributes,{'tableName':_0x9217('0xd'),'paranoid':![],'indexes':[{'name':_0x9217('0xe'),'fields':[_0x9217('0xf'),'to'],'type':_0x9217('0x10')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x2286b8,_0x5e7d99,_0x496fb7){if(_0x2286b8[_0x9217('0x11')]){_0x2286b8['substatusAt']=moment()[_0x9217('0x12')](_0x9217('0x13'));}if(_0x2286b8[_0x9217('0x14')]){_0x2286b8['closedAt']=moment()[_0x9217('0x12')](_0x9217('0x13'));}_0x496fb7(null,_0x5e7d99);},'beforeUpdate':function(_0x322e8c,_0x23b7aa,_0x203aa8){if(_0x322e8c[_0x9217('0x15')](_0x9217('0x11'))){_0x322e8c[_0x9217('0x16')]=_0x322e8c['substatus']?moment()[_0x9217('0x12')]('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x322e8c[_0x9217('0x15')](_0x9217('0x14'))){_0x322e8c[_0x9217('0x17')]=moment()[_0x9217('0x12')](_0x9217('0x13'));_0x322e8c[_0x9217('0x11')]=null;_0x322e8c[_0x9217('0x16')]=null;}_0x203aa8(null,_0x322e8c);},'afterUpdate':function(_0x13c330,_0x2c3ba9,_0x1cfea4){var _0x3b367b=_0x471e4c[_0x9217('0x18')];var _0x179379=_0x13c330[_0x9217('0x19')]({'plain':!![]});if(_0x179379[_0x9217('0x14')]){return _0x3b367b[_0x9217('0x1a')][_0x9217('0x1b')]({'read':!![]},{'where':{'MailInteractionId':_0x179379['id']}})[_0x9217('0x1c')](function(){_0x1cfea4();})[_0x9217('0x1d')](function(_0x314fac){_0x1cfea4(_0x314fac);});}else{_0x1cfea4();}}},'charset':_0x9217('0x1e'),'collate':_0x9217('0x1f')});}; \ No newline at end of file +var _0xe6eb=['changed','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','MailInteraction','mail_interactions','fti_mail_interactions','substatus','substatusAt','format','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4995f6,_0x35d3d4){var _0x41be8f=function(_0x10bebb){while(--_0x10bebb){_0x4995f6['push'](_0x4995f6['shift']());}};_0x41be8f(++_0x35d3d4);}(_0xe6eb,0xd7));var _0xbe6e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe6eb[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xbe6e('0x0'));var util=require(_0xbe6e('0x1'));var logger=require(_0xbe6e('0x2'))(_0xbe6e('0x3'));var moment=require(_0xbe6e('0x4'));var BPromise=require(_0xbe6e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe6e('0x6'));var rimraf=require(_0xbe6e('0x7'));var config=require(_0xbe6e('0x8'));var attributes=require('./mailInteraction.attributes');module[_0xbe6e('0x9')]=function(_0x4f57ca,_0x5b3321){return _0x4f57ca['define'](_0xbe6e('0xa'),attributes,{'tableName':_0xbe6e('0xb'),'paranoid':![],'indexes':[{'name':_0xbe6e('0xc'),'fields':['subject','to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x26c518,_0x1a4bb6,_0x339048){if(_0x26c518[_0xbe6e('0xd')]){_0x26c518[_0xbe6e('0xe')]=moment()[_0xbe6e('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}if(_0x26c518[_0xbe6e('0x10')]){_0x26c518[_0xbe6e('0x11')]=moment()[_0xbe6e('0xf')](_0xbe6e('0x12'));}_0x339048(null,_0x1a4bb6);},'beforeUpdate':function(_0x1eee36,_0x3e6449,_0x4adeda){if(_0x1eee36[_0xbe6e('0x13')](_0xbe6e('0xd'))){_0x1eee36['substatusAt']=_0x1eee36[_0xbe6e('0xd')]?moment()[_0xbe6e('0xf')](_0xbe6e('0x12')):null;}if(_0x1eee36[_0xbe6e('0x13')](_0xbe6e('0x10'))){_0x1eee36['closedAt']=moment()[_0xbe6e('0xf')](_0xbe6e('0x12'));_0x1eee36['substatus']=null;_0x1eee36[_0xbe6e('0xe')]=null;}_0x4adeda(null,_0x1eee36);},'afterUpdate':function(_0x13e7c1,_0x44c97f,_0x5dfe11){var _0x49ee2a=_0x4f57ca['models'];var _0x329d9c=_0x13e7c1[_0xbe6e('0x14')]({'plain':!![]});if(_0x329d9c['closed']){return _0x49ee2a[_0xbe6e('0x15')][_0xbe6e('0x16')]({'read':!![]},{'where':{'MailInteractionId':_0x329d9c['id']}})[_0xbe6e('0x17')](function(){_0x5dfe11();})[_0xbe6e('0x18')](function(_0x59d9ad){_0x5dfe11(_0x59d9ad);});}else{_0x5dfe11();}}},'charset':'utf8mb4','collate':_0xbe6e('0x19')});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index 0e4200c..dd524dd 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 _0xac55=['message','result','MailInteraction','body','options','raw','where','attributes','limit','then','catch','UpdateMailInteraction','find','ids','omit','AddTags','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','MailInteraction,\x20%s,\x20%s'];(function(_0x125720,_0x3cbcbf){var _0x5884c5=function(_0x42db84){while(--_0x42db84){_0x125720['push'](_0x125720['shift']());}};_0x5884c5(++_0x3cbcbf);}(_0xac55,0x1c8));var _0x5ac5=function(_0x27d874,_0x990b10){_0x27d874=_0x27d874-0x0;var _0x53d019=_0xac55[_0x27d874];return _0x53d019;};'use strict';var _=require(_0x5ac5('0x0'));var util=require(_0x5ac5('0x1'));var moment=require(_0x5ac5('0x2'));var BPromise=require(_0x5ac5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5ac5('0x4'));var db=require(_0x5ac5('0x5'))['db'];var utils=require(_0x5ac5('0x6'));var logger=require(_0x5ac5('0x7'))(_0x5ac5('0x8'));var config=require(_0x5ac5('0x9'));var jayson=require(_0x5ac5('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0x5ac5('0xb')]=_[_0x5ac5('0xc')](config[_0x5ac5('0xb')],{'host':_0x5ac5('0xd'),'port':0x18eb});var socket=require(_0x5ac5('0xe'))(new Redis(config[_0x5ac5('0xb')]));require(_0x5ac5('0xf'))['register'](socket);function respondWithRpcPromise(_0x5ea6f4,_0x2414f9,_0x13ef10){return new BPromise(function(_0x4ec845,_0x127342){return client[_0x5ac5('0x10')](_0x5ea6f4,_0x13ef10)['then'](function(_0x2b70ed){logger[_0x5ac5('0x11')]('MailInteraction,\x20%s,\x20%s',_0x2414f9,_0x5ac5('0x12'));logger[_0x5ac5('0x13')](_0x5ac5('0x14'),_0x2414f9,_0x5ac5('0x12'),JSON[_0x5ac5('0x15')](_0x2b70ed));if(_0x2b70ed['error']){if(_0x2b70ed[_0x5ac5('0x16')]['code']===0x1f4){logger[_0x5ac5('0x16')](_0x5ac5('0x17'),_0x2414f9,_0x2b70ed['error'][_0x5ac5('0x18')]);return _0x127342(_0x2b70ed['error'][_0x5ac5('0x18')]);}logger[_0x5ac5('0x16')](_0x5ac5('0x17'),_0x2414f9,_0x2b70ed[_0x5ac5('0x16')][_0x5ac5('0x18')]);return _0x4ec845(_0x2b70ed[_0x5ac5('0x16')][_0x5ac5('0x18')]);}else{logger['info'](_0x5ac5('0x17'),_0x2414f9,'request\x20sent');_0x4ec845(_0x2b70ed[_0x5ac5('0x19')][_0x5ac5('0x18')]);}})['catch'](function(_0x340976){logger['error'](_0x5ac5('0x17'),_0x2414f9,_0x340976);_0x127342(_0x340976);});});}exports['UpdateMailInteraction']=function(_0x5aa45d){var _0x439288=this;return new Promise(function(_0x4c57e0,_0x39f3cf){return db[_0x5ac5('0x1a')]['update'](_0x5aa45d[_0x5ac5('0x1b')],{'raw':_0x5aa45d['options']?_0x5aa45d[_0x5ac5('0x1c')][_0x5ac5('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5aa45d['options']?_0x5aa45d['options'][_0x5ac5('0x1e')]||null:null,'attributes':_0x5aa45d[_0x5ac5('0x1c')]?_0x5aa45d[_0x5ac5('0x1c')][_0x5ac5('0x1f')]||null:null,'limit':_0x5aa45d[_0x5ac5('0x1c')]?_0x5aa45d['options'][_0x5ac5('0x20')]||null:null})[_0x5ac5('0x21')](function(_0x387487){logger[_0x5ac5('0x11')]('UpdateMailInteraction',_0x5aa45d);logger[_0x5ac5('0x13')]('UpdateMailInteraction',_0x5aa45d,JSON[_0x5ac5('0x15')](_0x387487));_0x4c57e0(_0x387487);})[_0x5ac5('0x22')](function(_0x1d78cf){logger[_0x5ac5('0x16')](_0x5ac5('0x23'),_0x1d78cf[_0x5ac5('0x18')],_0x5aa45d);_0x39f3cf(_0x439288['error'](0x1f4,_0x1d78cf[_0x5ac5('0x18')]));});});};exports['AddTagsToMailInteraction']=function(_0x24e8c7){return new Promise(function(_0x3d0e6f,_0x35535f){return db['MailInteraction'][_0x5ac5('0x24')]({'where':_0x24e8c7[_0x5ac5('0x1c')]?_0x24e8c7[_0x5ac5('0x1c')][_0x5ac5('0x1e')]||null:null})['then'](function(_0x16c472){if(_0x16c472){return _0x16c472['addTags'](_0x24e8c7[_0x5ac5('0x1b')][_0x5ac5('0x25')],_[_0x5ac5('0x26')](_0x24e8c7[_0x5ac5('0x1b')],[_0x5ac5('0x25'),'id'])||{});}})['spread'](function(_0x4c381e){logger[_0x5ac5('0x11')](_0x5ac5('0x27'),_0x24e8c7);logger['debug'](_0x5ac5('0x27'),_0x24e8c7,JSON['stringify'](_0x4c381e));_0x3d0e6f(_0x4c381e);})[_0x5ac5('0x22')](function(_0x15ef21){logger[_0x5ac5('0x16')](_0x5ac5('0x27'),_0x15ef21[_0x5ac5('0x18')],_0x24e8c7);_0x35535f(_this['error'](0x1f4,_0x15ef21[_0x5ac5('0x18')]));});});}; \ No newline at end of file +var _0x2e54=['ids','omit','spread','AddTags','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','defaults','localhost','redis','./mailInteraction.socket','register','request','info','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','MailInteraction,\x20%s,\x20%s','message','result','UpdateMailInteraction','MailInteraction','update','body','options','attributes','then','catch','AddTagsToMailInteraction','find','where','addTags'];(function(_0x5aef81,_0x3ffc89){var _0x395296=function(_0x119d2e){while(--_0x119d2e){_0x5aef81['push'](_0x5aef81['shift']());}};_0x395296(++_0x3ffc89);}(_0x2e54,0x1dd));var _0x42e5=function(_0x20c8cc,_0x4863b1){_0x20c8cc=_0x20c8cc-0x0;var _0x4b3716=_0x2e54[_0x20c8cc];return _0x4b3716;};'use strict';var _=require(_0x42e5('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x42e5('0x1'));var rs=require(_0x42e5('0x2'));var fs=require('fs');var Redis=require(_0x42e5('0x3'));var db=require(_0x42e5('0x4'))['db'];var utils=require(_0x42e5('0x5'));var logger=require(_0x42e5('0x6'))(_0x42e5('0x7'));var config=require('../../config/environment');var jayson=require(_0x42e5('0x8'));var client=jayson[_0x42e5('0x9')][_0x42e5('0xa')]({'port':0x232a});config['redis']=_[_0x42e5('0xb')](config['redis'],{'host':_0x42e5('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x42e5('0xd')]));require(_0x42e5('0xe'))[_0x42e5('0xf')](socket);function respondWithRpcPromise(_0x15f9f1,_0x206bf3,_0x1e5d2d){return new BPromise(function(_0xe1ab4b,_0x2fa2f0){return client[_0x42e5('0x10')](_0x15f9f1,_0x1e5d2d)['then'](function(_0x456298){logger[_0x42e5('0x11')]('MailInteraction,\x20%s,\x20%s',_0x206bf3,_0x42e5('0x12'));logger[_0x42e5('0x13')](_0x42e5('0x14'),_0x206bf3,_0x42e5('0x12'),JSON[_0x42e5('0x15')](_0x456298));if(_0x456298[_0x42e5('0x16')]){if(_0x456298[_0x42e5('0x16')][_0x42e5('0x17')]===0x1f4){logger[_0x42e5('0x16')](_0x42e5('0x18'),_0x206bf3,_0x456298['error'][_0x42e5('0x19')]);return _0x2fa2f0(_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);}logger[_0x42e5('0x16')](_0x42e5('0x18'),_0x206bf3,_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);return _0xe1ab4b(_0x456298[_0x42e5('0x16')][_0x42e5('0x19')]);}else{logger[_0x42e5('0x11')](_0x42e5('0x18'),_0x206bf3,_0x42e5('0x12'));_0xe1ab4b(_0x456298[_0x42e5('0x1a')][_0x42e5('0x19')]);}})['catch'](function(_0x1460c0){logger['error']('MailInteraction,\x20%s,\x20%s',_0x206bf3,_0x1460c0);_0x2fa2f0(_0x1460c0);});});}exports[_0x42e5('0x1b')]=function(_0x499f77){var _0x5a1de2=this;return new Promise(function(_0x41a823,_0x39a3e2){return db[_0x42e5('0x1c')][_0x42e5('0x1d')](_0x499f77[_0x42e5('0x1e')],{'raw':_0x499f77[_0x42e5('0x1f')]?_0x499f77[_0x42e5('0x1f')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x499f77['options']?_0x499f77[_0x42e5('0x1f')]['where']||null:null,'attributes':_0x499f77[_0x42e5('0x1f')]?_0x499f77[_0x42e5('0x1f')][_0x42e5('0x20')]||null:null,'limit':_0x499f77[_0x42e5('0x1f')]?_0x499f77[_0x42e5('0x1f')]['limit']||null:null})[_0x42e5('0x21')](function(_0xf29221){logger[_0x42e5('0x11')](_0x42e5('0x1b'),_0x499f77);logger[_0x42e5('0x13')]('UpdateMailInteraction',_0x499f77,JSON['stringify'](_0xf29221));_0x41a823(_0xf29221);})[_0x42e5('0x22')](function(_0x534a26){logger['error'](_0x42e5('0x1b'),_0x534a26['message'],_0x499f77);_0x39a3e2(_0x5a1de2[_0x42e5('0x16')](0x1f4,_0x534a26[_0x42e5('0x19')]));});});};exports[_0x42e5('0x23')]=function(_0x1c8ee4){return new Promise(function(_0x27ae27,_0x2f1edc){return db['MailInteraction'][_0x42e5('0x24')]({'where':_0x1c8ee4[_0x42e5('0x1f')]?_0x1c8ee4[_0x42e5('0x1f')][_0x42e5('0x25')]||null:null})[_0x42e5('0x21')](function(_0xd62a0f){if(_0xd62a0f){return _0xd62a0f[_0x42e5('0x26')](_0x1c8ee4[_0x42e5('0x1e')][_0x42e5('0x27')],_[_0x42e5('0x28')](_0x1c8ee4[_0x42e5('0x1e')],[_0x42e5('0x27'),'id'])||{});}})[_0x42e5('0x29')](function(_0x599750){logger[_0x42e5('0x11')](_0x42e5('0x2a'),_0x1c8ee4);logger[_0x42e5('0x13')](_0x42e5('0x2a'),_0x1c8ee4,JSON['stringify'](_0x599750));_0x27ae27(_0x599750);})['catch'](function(_0x21d933){logger['error'](_0x42e5('0x2a'),_0x21d933['message'],_0x1c8ee4);_0x2f1edc(_this[_0x42e5('0x16')](0x1f4,_0x21d933[_0x42e5('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index e9fadc1..d9b4f05 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 _0xac85=['register','length','save','update'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xac85,0x176));var _0x5ac8=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xac85[_0x3dd15e];return _0x231fd0;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x5ac8('0x0'),'remove',_0x5ac8('0x1')];function createListener(_0x101652,_0xff72c8){return function(_0x238c40){_0xff72c8['emit'](_0x101652,_0x238c40);};}function removeListener(_0x24526d,_0x40b46d){return function(){MailInteractionEvents['removeListener'](_0x24526d,_0x40b46d);};}exports[_0x5ac8('0x2')]=function(_0x2731e0){for(var _0x728f2=0x0,_0x40dfbe=events[_0x5ac8('0x3')];_0x728f2<_0x40dfbe;_0x728f2++){var _0x4dae0d=events[_0x728f2];var _0x28333f=createListener('mailInteraction:'+_0x4dae0d,_0x2731e0);MailInteractionEvents['on'](_0x4dae0d,_0x28333f);}}; \ No newline at end of file +var _0x3c92=['./mailInteraction.events','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x5d6e81,_0x54b5a7){var _0xcd92a=function(_0x1bfb70){while(--_0x1bfb70){_0x5d6e81['push'](_0x5d6e81['shift']());}};_0xcd92a(++_0x54b5a7);}(_0x3c92,0xd8));var _0x23c9=function(_0x2ac9c4,_0x2edf32){_0x2ac9c4=_0x2ac9c4-0x0;var _0x5c2ea8=_0x3c92[_0x2ac9c4];return _0x5c2ea8;};'use strict';var MailInteractionEvents=require(_0x23c9('0x0'));var events=['save',_0x23c9('0x1'),_0x23c9('0x2')];function createListener(_0x27c597,_0x5f4e85){return function(_0x36bfa6){_0x5f4e85[_0x23c9('0x3')](_0x27c597,_0x36bfa6);};}function removeListener(_0x44f1bb,_0x3b6efd){return function(){MailInteractionEvents[_0x23c9('0x4')](_0x44f1bb,_0x3b6efd);};}exports[_0x23c9('0x5')]=function(_0x31bcc4){for(var _0x27d0f9=0x0,_0x411be8=events[_0x23c9('0x6')];_0x27d0f9<_0x411be8;_0x27d0f9++){var _0x4bc516=events[_0x27d0f9];var _0x129ee6=createListener(_0x23c9('0x7')+_0x4bc516,_0x31bcc4);MailInteractionEvents['on'](_0x4bc516,_0x129ee6);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index a4a7d13..4330365 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 _0xd6d6=['mailmessage:create','update','put','/:id/accept','accept','reject','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','isAuthenticated','/describe','describe','/:id','/:id/download','download','post','mail'];(function(_0x2a1f30,_0x5731e9){var _0x2b12ef=function(_0x18b9f0){while(--_0x18b9f0){_0x2a1f30['push'](_0x2a1f30['shift']());}};_0x2b12ef(++_0x5731e9);}(_0xd6d6,0xbe));var _0x6d6d=function(_0x4c471f,_0x547637){_0x4c471f=_0x4c471f-0x0;var _0x801b7c=_0xd6d6[_0x4c471f];return _0x801b7c;};'use strict';var multer=require(_0x6d6d('0x0'));var util=require(_0x6d6d('0x1'));var path=require(_0x6d6d('0x2'));var timeout=require(_0x6d6d('0x3'));var express=require('express');var router=express[_0x6d6d('0x4')]();var auth=require(_0x6d6d('0x5'));var interaction=require(_0x6d6d('0x6'));var config=require(_0x6d6d('0x7'));var controller=require(_0x6d6d('0x8'));router[_0x6d6d('0x9')]('/',auth[_0x6d6d('0xa')](),controller['index']);router[_0x6d6d('0x9')](_0x6d6d('0xb'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xc')]);router[_0x6d6d('0x9')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['show']);router['get'](_0x6d6d('0xe'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0xf')]);router[_0x6d6d('0x10')]('/',auth[_0x6d6d('0xa')](),interaction['tracked'](_0x6d6d('0x11'),_0x6d6d('0x12')),controller['create']);router['put'](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x13')]);router[_0x6d6d('0x14')](_0x6d6d('0x15'),auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x16')]);router[_0x6d6d('0x14')]('/:id/reject',auth[_0x6d6d('0xa')](),controller[_0x6d6d('0x17')]);router[_0x6d6d('0x18')](_0x6d6d('0xd'),auth[_0x6d6d('0xa')](),controller['destroy']);module[_0x6d6d('0x19')]=router; \ No newline at end of file +var _0x54ef=['tracked','mail','mailmessage:create','create','/:id','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailMessage.controller','get','/describe','isAuthenticated','show','/:id/download','download','post'];(function(_0x172b06,_0x5a177d){var _0x12aa65=function(_0xde67b6){while(--_0xde67b6){_0x172b06['push'](_0x172b06['shift']());}};_0x12aa65(++_0x5a177d);}(_0x54ef,0x112));var _0xf54e=function(_0x4f10b4,_0x4c737c){_0x4f10b4=_0x4f10b4-0x0;var _0x9b9c81=_0x54ef[_0x4f10b4];return _0x9b9c81;};'use strict';var multer=require(_0xf54e('0x0'));var util=require(_0xf54e('0x1'));var path=require(_0xf54e('0x2'));var timeout=require('connect-timeout');var express=require(_0xf54e('0x3'));var router=express[_0xf54e('0x4')]();var auth=require(_0xf54e('0x5'));var interaction=require(_0xf54e('0x6'));var config=require(_0xf54e('0x7'));var controller=require(_0xf54e('0x8'));router[_0xf54e('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0xf54e('0x9')](_0xf54e('0xa'),auth[_0xf54e('0xb')](),controller['describe']);router[_0xf54e('0x9')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0xc')]);router['get'](_0xf54e('0xd'),auth[_0xf54e('0xb')](),controller[_0xf54e('0xe')]);router[_0xf54e('0xf')]('/',auth['isAuthenticated'](),interaction[_0xf54e('0x10')](_0xf54e('0x11'),_0xf54e('0x12')),controller[_0xf54e('0x13')]);router['put'](_0xf54e('0x14'),auth['isAuthenticated'](),controller['update']);router[_0xf54e('0x15')](_0xf54e('0x16'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x17')]);router['put'](_0xf54e('0x18'),auth[_0xf54e('0xb')](),controller[_0xf54e('0x19')]);router[_0xf54e('0x1a')]('/:id',auth[_0xf54e('0xb')](),controller[_0xf54e('0x1b')]);module[_0xf54e('0x1c')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 4307c2f..a49bcea 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 _0x5454=['long','DATE','INTEGER','TEXT','BOOLEAN','ENUM','out','STRING'];(function(_0xdc37a1,_0x53ebb9){var _0x99b4fe=function(_0x2811e3){while(--_0x2811e3){_0xdc37a1['push'](_0xdc37a1['shift']());}};_0x99b4fe(++_0x53ebb9);}(_0x5454,0x15b));var _0x4545=function(_0x1e3b5e,_0x593cea){_0x1e3b5e=_0x1e3b5e-0x0;var _0x1c236c=_0x5454[_0x1e3b5e];return _0x1c236c;};'use strict';var Sequelize=require('sequelize');var _=require('lodash');module['exports']={'body':{'type':Sequelize[_0x4545('0x0')]('long'),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0x4545('0x1')],'defaultValue':![]},'direction':{'type':Sequelize[_0x4545('0x2')]('in',_0x4545('0x3')),'defaultValue':_0x4545('0x3'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0x1fe)},'from':{'type':Sequelize[_0x4545('0x4')]},'to':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'cc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'bcc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))},'subject':{'type':Sequelize[_0x4545('0x0')]},'sentAt':{'type':Sequelize[_0x4545('0x6')]},'attach':{'type':Sequelize[_0x4545('0x7')],'defaultValue':0x0},'secret':{'type':Sequelize[_0x4545('0x1')],'defaultValue':![]},'readAt':{'type':Sequelize[_0x4545('0x6')]},'originTo':{'type':Sequelize[_0x4545('0x0')]('long')},'originCc':{'type':Sequelize[_0x4545('0x0')](_0x4545('0x5'))}}; \ No newline at end of file +var _0xa9e1=['STRING','DATE','sequelize','lodash','TEXT','long','BOOLEAN','out'];(function(_0x169012,_0x5c7a1e){var _0x1c35f4=function(_0x18f59f){while(--_0x18f59f){_0x169012['push'](_0x169012['shift']());}};_0x1c35f4(++_0x5c7a1e);}(_0xa9e1,0x7a));var _0x1a9e=function(_0x4ca6a4,_0x5e9694){_0x4ca6a4=_0x4ca6a4-0x0;var _0x120555=_0xa9e1[_0x4ca6a4];return _0x120555;};'use strict';var Sequelize=require(_0x1a9e('0x0'));var _=require(_0x1a9e('0x1'));module['exports']={'body':{'type':Sequelize[_0x1a9e('0x2')](_0x1a9e('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize[_0x1a9e('0x2')]('medium')},'read':{'type':Sequelize[_0x1a9e('0x4')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1a9e('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0x1a9e('0x6')](0x1fe)},'from':{'type':Sequelize[_0x1a9e('0x6')]},'to':{'type':Sequelize[_0x1a9e('0x2')](_0x1a9e('0x3'))},'cc':{'type':Sequelize[_0x1a9e('0x2')](_0x1a9e('0x3'))},'bcc':{'type':Sequelize[_0x1a9e('0x2')](_0x1a9e('0x3'))},'subject':{'type':Sequelize[_0x1a9e('0x2')]},'sentAt':{'type':Sequelize[_0x1a9e('0x7')]},'attach':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'secret':{'type':Sequelize[_0x1a9e('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize['TEXT']('long')},'originCc':{'type':Sequelize[_0x1a9e('0x2')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index 9fca5ea..21ba309 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 _0x1539=['writeFileSync','log','html-pdf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','stringify','error','code','MailMessage,\x20%s,\x20%s','message','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','stack','name','map','rawAttributes','key','model','query','keys','attributes','intersection','fields','nolimit','order','sort','where','filters','filter','merge','options','MailMessage','includeAll','include','rows','length','find','body','destroy','params','describe','create','direction','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','isNil','service','host','port','secure','authentication','auth','user','pass','attachments','join','root','basename','ListId','List\x20not\x20found','SendMail','sendMail','update','messageId','format','accept','read','YYYY-MM-DD\x20HH:mm:ss','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','../../config/logger','mail','agent','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','server','files','tmp','message-%s.eml','from','createdAt','Attachment','subject','headers','bcc','existsSync','type','readFileSync','build'];(function(_0x411a6b,_0x1f6888){var _0xedfab3=function(_0x1fbb1f){while(--_0x1fbb1f){_0x411a6b['push'](_0x411a6b['shift']());}};_0xedfab3(++_0x1f6888);}(_0x1539,0x1dc));var _0x9153=function(_0x3d9c0b,_0x50230e){_0x3d9c0b=_0x3d9c0b-0x0;var _0x1ca920=_0x1539[_0x3d9c0b];return _0x1ca920;};'use strict';var pdf=require(_0x9153('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x9153('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9153('0x2'));var moment=require(_0x9153('0x3'));var BPromise=require(_0x9153('0x4'));var Mustache=require(_0x9153('0x5'));var util=require(_0x9153('0x6'));var path=require(_0x9153('0x7'));var sox=require(_0x9153('0x8'));var csv=require(_0x9153('0x9'));var ejs=require(_0x9153('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9153('0xb'));var crypto=require(_0x9153('0xc'));var jsforce=require(_0x9153('0xd'));var deskjs=require(_0x9153('0xe'));var toCsv=require('to-csv');var querystring=require(_0x9153('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x9153('0x10'));var qs=require(_0x9153('0x11'));var as=require(_0x9153('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x9153('0x13'));var utils=require('../../config/utils');var config=require(_0x9153('0x14'));var db=require(_0x9153('0x15'))['db'];config[_0x9153('0x16')]=_['defaults'](config['redis'],{'host':_0x9153('0x17'),'port':0x18eb});var socket=require(_0x9153('0x18'))(new Redis(config[_0x9153('0x16')]));require(_0x9153('0x19'))['register'](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x9153('0x1a')]({'port':0x232c});var client9003=jayson['client'][_0x9153('0x1a')]({'port':0x232b});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x113d46,_0x1ca066,_0x44af57){if(_0x44af57){var _0x436b5d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x436b5d['test'](_0x1ca066)){return _0x113d46;}else{throw new db['Sequelize']['ValidationError'](_0x9153('0x1b'));}}else{return _0x113d46;}}function respondWithRpcPromise(_0xa8281f,_0x4f5572,_0x45735f,_0x15d854){return new BPromise(function(_0x141369,_0x2597e0){var _0x185859=_0x15d854||client;return _0x185859[_0x9153('0x1c')](_0xa8281f,_0x45735f)[_0x9153('0x1d')](function(_0x3ccb7f){logger[_0x9153('0x1e')]('MailMessage,\x20%s,\x20%s',_0x4f5572,_0x9153('0x1f'));logger['debug']('MailMessage,\x20%s,\x20%s,\x20%s',_0x4f5572,_0x9153('0x1f'),JSON[_0x9153('0x20')](_0x3ccb7f));if(_0x3ccb7f[_0x9153('0x21')]){if(_0x3ccb7f[_0x9153('0x21')][_0x9153('0x22')]===0x1f4){logger[_0x9153('0x21')](_0x9153('0x23'),_0x4f5572,_0x3ccb7f[_0x9153('0x21')]['message']);return _0x2597e0(_0x3ccb7f[_0x9153('0x21')][_0x9153('0x24')]);}logger[_0x9153('0x21')](_0x9153('0x23'),_0x4f5572,_0x3ccb7f['error'][_0x9153('0x24')]);return _0x141369(_0x3ccb7f[_0x9153('0x21')]['message']);}else{logger[_0x9153('0x1e')](_0x9153('0x23'),_0x4f5572,_0x9153('0x1f'));_0x141369(_0x3ccb7f['result'][_0x9153('0x24')]);}})[_0x9153('0x25')](function(_0x3d84d2){logger[_0x9153('0x21')](_0x9153('0x23'),_0x4f5572,_0x3d84d2);_0x2597e0(_0x3d84d2);});});}function respondWithStatusCode(_0x4f51e4,_0x18c6be){_0x18c6be=_0x18c6be||0xcc;return function(_0x4fb96c){if(_0x4fb96c){return _0x4f51e4[_0x9153('0x26')](_0x18c6be);}return _0x4f51e4[_0x9153('0x27')](_0x18c6be)[_0x9153('0x28')]();};}function respondWithResult(_0x546ac8,_0x3d153a){_0x3d153a=_0x3d153a||0xc8;return function(_0x365cb1){if(_0x365cb1){return _0x546ac8['status'](_0x3d153a)['json'](_0x365cb1);}};}function respondWithFilteredResult(_0xb4e2c9,_0x175d8d){return function(_0x3041d8){if(_0x3041d8){var _0x53ae40=_0x3041d8[_0x9153('0x29')],_0x15af84=_0x175d8d[_0x9153('0x2a')],_0x1c4eb5=_0x175d8d['offset']+_0x175d8d[_0x9153('0x2b')],_0x11e14f;if(_0x1c4eb5>=_0x53ae40){_0x1c4eb5=_0x53ae40;_0x11e14f=0xc8;}else{_0x11e14f=0xce;}_0xb4e2c9[_0x9153('0x27')](_0x11e14f);return _0xb4e2c9[_0x9153('0x2c')](_0x9153('0x2d'),_0x15af84+'-'+_0x1c4eb5+'/'+_0x53ae40)[_0x9153('0x2e')](_0x3041d8);}return null;};}function patchUpdates(_0x23bee7){return function(_0x3b96b6){try{jsonpatch[_0x9153('0x2f')](_0x3b96b6,_0x23bee7,!![]);}catch(_0x27fa56){return BPromise[_0x9153('0x30')](_0x27fa56);}return _0x3b96b6[_0x9153('0x31')]();};}function saveUpdates(_0x1f2de1,_0xc2f3cd){return function(_0x49ecb7){if(_0x49ecb7){return _0x49ecb7['update'](_0x1f2de1)[_0x9153('0x1d')](function(_0x38013f){return _0x38013f;});}return null;};}function removeEntity(_0x22013a,_0x5b50f6){return function(_0x580336){if(_0x580336){return _0x580336['destroy']()['then'](function(){_0x22013a['status'](0xcc)[_0x9153('0x28')]();});}};}function handleEntityNotFound(_0x5e1fbe,_0x57b7df){return function(_0x3cc9e0){if(!_0x3cc9e0){_0x5e1fbe[_0x9153('0x26')](0x194);}return _0x3cc9e0;};}function handleError(_0x44e7c1,_0xfa427f){_0xfa427f=_0xfa427f||0x1f4;return function(_0x301f5b){logger[_0x9153('0x21')](_0x301f5b[_0x9153('0x32')]);if(_0x301f5b[_0x9153('0x33')]){delete _0x301f5b[_0x9153('0x33')];}_0x44e7c1[_0x9153('0x27')](_0xfa427f)['send'](_0x301f5b);};}exports['index']=function(_0x3f1a74,_0x56af9d){var _0x205b61={},_0x320199={},_0x28ac8d={'count':0x0,'rows':[]};var _0xe5a6fd=_[_0x9153('0x34')](db['MailMessage'][_0x9153('0x35')],function(_0x199855){return{'name':_0x199855['fieldName'],'type':_0x199855['type'][_0x9153('0x36')]};});_0x320199[_0x9153('0x37')]=_['map'](_0xe5a6fd,_0x9153('0x33'));_0x320199[_0x9153('0x38')]=_[_0x9153('0x39')](_0x3f1a74[_0x9153('0x38')]);_0x320199['filters']=_['intersection'](_0x320199[_0x9153('0x37')],_0x320199[_0x9153('0x38')]);_0x205b61[_0x9153('0x3a')]=_[_0x9153('0x3b')](_0x320199[_0x9153('0x37')],qs[_0x9153('0x3c')](_0x3f1a74['query'][_0x9153('0x3c')]));_0x205b61[_0x9153('0x3a')]=_0x205b61['attributes']['length']?_0x205b61[_0x9153('0x3a')]:_0x320199[_0x9153('0x37')];if(!_0x3f1a74[_0x9153('0x38')]['hasOwnProperty'](_0x9153('0x3d'))){_0x205b61[_0x9153('0x2b')]=qs[_0x9153('0x2b')](_0x3f1a74[_0x9153('0x38')]['limit']);_0x205b61[_0x9153('0x2a')]=qs[_0x9153('0x2a')](_0x3f1a74[_0x9153('0x38')][_0x9153('0x2a')]);}_0x205b61[_0x9153('0x3e')]=qs[_0x9153('0x3f')](_0x3f1a74[_0x9153('0x38')][_0x9153('0x3f')]);_0x205b61[_0x9153('0x40')]=qs[_0x9153('0x41')](_['pick'](_0x3f1a74[_0x9153('0x38')],_0x320199[_0x9153('0x41')]));if(_0x3f1a74[_0x9153('0x38')][_0x9153('0x42')]){_0x205b61[_0x9153('0x40')]=_[_0x9153('0x43')](_0x205b61['where'],{'$or':_[_0x9153('0x34')](_0xe5a6fd,function(_0x1d6775){if(_0x1d6775['type']!=='VIRTUAL'){var _0xa47b52={};_0xa47b52[_0x1d6775[_0x9153('0x33')]]={'$like':'%'+_0x3f1a74[_0x9153('0x38')][_0x9153('0x42')]+'%'};return _0xa47b52;}})});}_0x205b61=_['merge']({},_0x205b61,_0x3f1a74[_0x9153('0x44')]);var _0x25e0be={'where':_0x205b61[_0x9153('0x40')]};return db[_0x9153('0x45')][_0x9153('0x29')](_0x25e0be)['then'](function(_0x1c0085){_0x28ac8d[_0x9153('0x29')]=_0x1c0085;if(_0x3f1a74[_0x9153('0x38')][_0x9153('0x46')]){_0x205b61[_0x9153('0x47')]=[{'all':!![]}];}return db[_0x9153('0x45')]['findAll'](_0x205b61);})[_0x9153('0x1d')](function(_0x48c3d5){_0x28ac8d[_0x9153('0x48')]=_0x48c3d5;return _0x28ac8d;})[_0x9153('0x1d')](respondWithFilteredResult(_0x56af9d,_0x205b61))[_0x9153('0x25')](handleError(_0x56af9d,null));};exports['show']=function(_0x407941,_0x47fdf3){var _0x47488e={'raw':!![],'where':{'id':_0x407941['params']['id']}},_0x1eab4a={};_0x1eab4a[_0x9153('0x37')]=_[_0x9153('0x39')](db[_0x9153('0x45')]['rawAttributes']);_0x1eab4a[_0x9153('0x38')]=_[_0x9153('0x39')](_0x407941['query']);_0x1eab4a[_0x9153('0x41')]=_[_0x9153('0x3b')](_0x1eab4a['model'],_0x1eab4a['query']);_0x47488e['attributes']=_[_0x9153('0x3b')](_0x1eab4a['model'],qs[_0x9153('0x3c')](_0x407941['query'][_0x9153('0x3c')]));_0x47488e[_0x9153('0x3a')]=_0x47488e['attributes'][_0x9153('0x49')]?_0x47488e[_0x9153('0x3a')]:_0x1eab4a[_0x9153('0x37')];if(_0x407941[_0x9153('0x38')][_0x9153('0x46')]){_0x47488e[_0x9153('0x47')]=[{'all':!![]}];}_0x47488e=_[_0x9153('0x43')]({},_0x47488e,_0x407941[_0x9153('0x44')]);return db['MailMessage'][_0x9153('0x4a')](_0x47488e)[_0x9153('0x1d')](handleEntityNotFound(_0x47fdf3,null))[_0x9153('0x1d')](respondWithResult(_0x47fdf3,null))[_0x9153('0x25')](handleError(_0x47fdf3,null));};exports['update']=function(_0x2914a8,_0x386c18){if(_0x2914a8[_0x9153('0x4b')]['id']){delete _0x2914a8[_0x9153('0x4b')]['id'];}return db['MailMessage'][_0x9153('0x4a')]({'where':{'id':_0x2914a8['params']['id']}})['then'](handleEntityNotFound(_0x386c18,null))[_0x9153('0x1d')](saveUpdates(_0x2914a8[_0x9153('0x4b')],null))[_0x9153('0x1d')](respondWithResult(_0x386c18,null))[_0x9153('0x25')](handleError(_0x386c18,null));};exports[_0x9153('0x4c')]=function(_0x273f1d,_0x225cfb){return db[_0x9153('0x45')][_0x9153('0x4a')]({'where':{'id':_0x273f1d[_0x9153('0x4d')]['id']}})[_0x9153('0x1d')](handleEntityNotFound(_0x225cfb,null))[_0x9153('0x1d')](removeEntity(_0x225cfb,null))[_0x9153('0x25')](handleError(_0x225cfb,null));};exports['describe']=function(_0x1c7e48,_0x521518){return db[_0x9153('0x45')][_0x9153('0x4e')]()[_0x9153('0x1d')](respondWithResult(_0x521518,null))['catch'](handleError(_0x521518,null));};exports[_0x9153('0x4f')]=function(_0x4e7183,_0x6bcf94){return db[_0x9153('0x45')][_0x9153('0x4f')](_0x4e7183['body'])[_0x9153('0x1d')](function(_0x3795d0){if(_0x3795d0){if(_0x3795d0[_0x9153('0x50')]==='out'&&!_0x3795d0['secret']){var _0x294d18,_0x303792,_0x44435d;if(_0x4e7183['body']['to']){_0x303792=_0x4e7183['body']['to']['split'](',')[0x0];}return db[_0x9153('0x51')][_0x9153('0x52')]({'where':{'id':_0x3795d0[_0x9153('0x53')]},'include':[{'model':db[_0x9153('0x54')],'as':_0x9153('0x55'),'include':[{'model':db[_0x9153('0x56')],'as':_0x9153('0x57'),'where':{'email':_0x303792},'limit':0x1,'order':[[_0x9153('0x58'),_0x9153('0x59')]]}]},{'model':db[_0x9153('0x5a')],'as':_0x9153('0x5b'),'raw':!![]}]})['then'](function(_0x1168b2){_0x294d18=_0x1168b2;if(_0x294d18&&_0x294d18[_0x9153('0x5b')]){var _0x56281b={'tls':{'rejectUnauthorized':![]}};if(_[_0x9153('0x5c')](_0x294d18['Smtp'][_0x9153('0x5d')])){_0x56281b[_0x9153('0x5e')]=_0x294d18[_0x9153('0x5b')][_0x9153('0x5e')];_0x56281b[_0x9153('0x5f')]=_0x294d18['Smtp'][_0x9153('0x5f')];_0x56281b[_0x9153('0x60')]=_0x294d18[_0x9153('0x5b')][_0x9153('0x60')];if(_0x294d18['Smtp'][_0x9153('0x61')]){_0x56281b[_0x9153('0x62')]={'user':_0x294d18[_0x9153('0x5b')][_0x9153('0x63')],'pass':_0x294d18[_0x9153('0x5b')]['pass']};}}else{_0x56281b[_0x9153('0x5d')]=_0x294d18[_0x9153('0x5b')][_0x9153('0x5d')];_0x56281b['auth']={'user':_0x294d18[_0x9153('0x5b')][_0x9153('0x63')],'pass':_0x294d18[_0x9153('0x5b')][_0x9153('0x64')]};_0x56281b[_0x9153('0x60')]=_0x294d18[_0x9153('0x5b')]['secure'];}if(_0x4e7183[_0x9153('0x4b')][_0x9153('0x65')]&&_0x4e7183[_0x9153('0x4b')][_0x9153('0x65')][_0x9153('0x49')]){for(var _0x4fdd7e=0x0;_0x4fdd7e<_0x4e7183[_0x9153('0x4b')][_0x9153('0x65')][_0x9153('0x49')];_0x4fdd7e+=0x1){_0x4e7183[_0x9153('0x4b')][_0x9153('0x65')][_0x4fdd7e]={'filename':_0x4e7183[_0x9153('0x4b')][_0x9153('0x65')][_0x4fdd7e][_0x9153('0x33')],'path':path[_0x9153('0x66')](config[_0x9153('0x67')],'server/files/attachments',_0x4e7183['body']['attachments'][_0x4fdd7e][_0x9153('0x68')])};}}_0x44435d={'account':_0x56281b,'message':_0x4e7183[_0x9153('0x4b')]};return;}})[_0x9153('0x1d')](function(){if(_0x294d18[_0x9153('0x55')]){if(_0x294d18[_0x9153('0x55')]['Contacts'][_0x9153('0x49')]){return _0x294d18[_0x9153('0x55')]['Contacts'][0x0];}else{return db[_0x9153('0x56')][_0x9153('0x4f')](_['defaults'](_0x4e7183[_0x9153('0x4b')],{'firstName':_0x4e7183['body']['to'],'email':_0x4e7183[_0x9153('0x4b')]['to'],'phone':_0x4e7183['body']['to'],'ListId':_0x294d18[_0x9153('0x69')]}));}}else{throw new Error(_0x9153('0x6a'));}})[_0x9153('0x1d')](function(){if(_0x44435d){return respondWithRpcPromise(_0x9153('0x6b'),_0x9153('0x6c'),_0x44435d,client9003)[_0x9153('0x1d')](function(_0xb5c991){return _0x3795d0[_0x9153('0x6d')]({'read':!![],'messageId':_0xb5c991[_0x9153('0x6e')],'sentAt':moment()[_0x9153('0x6f')]('YYYY-MM-DD\x20HH:mm:ss')});})['catch'](function(_0x1fd68e){logger[_0x9153('0x21')]('%s',JSON[_0x9153('0x20')](_0x1fd68e));return _0x3795d0;});}return _0x3795d0;});}return _0x3795d0;}})[_0x9153('0x1d')](respondWithResult(_0x6bcf94,0xc9))[_0x9153('0x25')](handleError(_0x6bcf94,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x9153('0x70')]=function(_0x49a215,_0x56e5ed,_0x3b09f1){var _0x28f326={'channel':'mail'};if(_0x49a215[_0x9153('0x4b')]['id']){delete _0x49a215[_0x9153('0x4b')]['id'];}_0x49a215[_0x9153('0x4b')][_0x9153('0x71')]=!![];_0x49a215[_0x9153('0x4b')]['readAt']=moment()[_0x9153('0x6f')](_0x9153('0x72'));_0x49a215[_0x9153('0x4b')][_0x9153('0x73')]=_0x49a215[_0x9153('0x4b')][_0x9153('0x73')]||_0x49a215[_0x9153('0x63')]['id'];return db['MailMessage'][_0x9153('0x4a')]({'where':{'id':_0x49a215['params']['id'],'UserId':null},'include':[{'model':db[_0x9153('0x56')],'as':_0x9153('0x74')}]})[_0x9153('0x1d')](handleEntityNotFound(_0x56e5ed,null))[_0x9153('0x1d')](saveUpdates(_0x49a215[_0x9153('0x4b')],null))[_0x9153('0x1d')](function(_0x4e7687){if(_0x4e7687){_0x28f326['message']=_0x4e7687[_0x9153('0x75')]({'plain':!![]});return db[_0x9153('0x76')][_0x9153('0x4a')]({'where':{'id':_0x4e7687[_0x9153('0x77')]}});}return null;})['then'](handleEntityNotFound(_0x56e5ed,null))[_0x9153('0x1d')](function(_0x3ce259){if(_0x3ce259){return _0x3ce259[_0x9153('0x6d')]({'UserId':_0x49a215[_0x9153('0x4b')]['UserId'],'read1stAt':_[_0x9153('0x5c')](_0x3ce259[_0x9153('0x78')])?moment()[_0x9153('0x6f')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x9153('0x1d')](function(_0x177ce8){if(_0x177ce8){_0x28f326['interaction']=_0x177ce8[_0x9153('0x75')]({'plain':!![]});interaction_log[_0x9153('0x1e')](_0x9153('0x79'),_0x49a215[_0x9153('0x63')]['id'],_0x49a215[_0x9153('0x63')][_0x9153('0x33')],_0x49a215['user'][_0x9153('0x7a')],_0x28f326['interaction']['id'],_0x49a215[_0x9153('0x4b')]?JSON[_0x9153('0x20')](_0x49a215['body']):_0x9153('0x7b'));return respondWithRpcPromise('AcceptMessage',_0x9153('0x7c'),_0x28f326);}return null;})['then'](function(_0x3aa18d){if(_0x3aa18d){if(_0x49a215[_0x9153('0x4b')][_0x9153('0x7d')]){_0x28f326[_0x9153('0x24')][_0x9153('0x7e')]=util[_0x9153('0x6f')](_0x9153('0x7f'),_0x49a215[_0x9153('0x63')]['name']);_0x28f326[_0x9153('0x24')][_0x9153('0x80')]=_0x28f326[_0x9153('0x80')];_0x28f326[_0x9153('0x24')][_0x9153('0x81')]='accept';return respondWithRpcPromise(_0x9153('0x82'),_0x9153('0x82'),{'event':'acceptmessage','message':_0x28f326['message']},client9002)[_0x9153('0x1d')](function(){return _0x28f326;});}return _0x28f326;}return null;})[_0x9153('0x1d')](respondWithResult(_0x56e5ed,null))[_0x9153('0x25')](handleError(_0x56e5ed,null));};var interaction_log=require(_0x9153('0x83'))('mail-interactions');exports[_0x9153('0x30')]=function(_0x2da34f,_0xea22e5,_0x2603c8){var _0x303904={'agent':{},'channel':_0x9153('0x84')};if(_0x2da34f[_0x9153('0x4b')]['id']){delete _0x2da34f['body']['id'];}_0x2da34f[_0x9153('0x4b')][_0x9153('0x73')]=_0x2da34f[_0x9153('0x4b')][_0x9153('0x73')]||_0x2da34f[_0x9153('0x63')]['id'];_0x303904[_0x9153('0x85')]['id']=_0x2da34f[_0x9153('0x4b')]['UserId'];return db['MailMessage'][_0x9153('0x4a')]({'where':{'id':_0x2da34f['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0xea22e5,null))[_0x9153('0x1d')](function(_0x13d996){if(_0x13d996){_0x303904['message']=_0x13d996[_0x9153('0x75')]({'plain':!![]});return db[_0x9153('0x76')][_0x9153('0x4a')]({'where':{'id':_0x13d996[_0x9153('0x77')]}});}return null;})[_0x9153('0x1d')](handleEntityNotFound(_0xea22e5,null))[_0x9153('0x1d')](function(_0x5d0d17){if(_0x5d0d17){_0x303904[_0x9153('0x86')]=_0x5d0d17['get']({'plain':!![]});interaction_log[_0x9153('0x1e')](_0x9153('0x87'),_0x2da34f[_0x9153('0x63')]['id'],_0x2da34f['user'][_0x9153('0x33')],_0x2da34f['user']['role'],_0x303904[_0x9153('0x86')]['id'],_0x2da34f[_0x9153('0x4b')]?JSON[_0x9153('0x20')](_0x2da34f[_0x9153('0x4b')]):_0x9153('0x7b'));return respondWithRpcPromise(_0x9153('0x88'),_0x9153('0x89'),_0x303904);}return null;})['then'](function(_0xd3d371){if(_0xd3d371){_0xd3d371['message'][_0x9153('0x7e')]=util[_0x9153('0x6f')](_0x9153('0x7f'),_0x2da34f[_0x9153('0x63')][_0x9153('0x33')]);_0xd3d371[_0x9153('0x24')][_0x9153('0x80')]=_0x303904[_0x9153('0x80')];_0xd3d371[_0x9153('0x24')][_0x9153('0x81')]=_0x9153('0x30');respondWithRpcPromise('EventManager','EventManager',{'event':_0x9153('0x8a'),'message':_0xd3d371[_0x9153('0x24')]},client9002);return _0x303904;}return null;})[_0x9153('0x1d')](respondWithResult(_0xea22e5,null))[_0x9153('0x25')](handleError(_0xea22e5,null));};exports[_0x9153('0x8b')]=function(_0x2ec88f,_0x168d8c){var _0x4494a6=moment()[_0x9153('0x8c')]()[_0x9153('0x8d')]();var _0x331d8f=path[_0x9153('0x66')](config['root'],_0x9153('0x8e'),_0x9153('0x8f'),_0x9153('0x90'));var _0x5cc070=path[_0x9153('0x66')](config[_0x9153('0x67')],'server',_0x9153('0x8f'),_0x9153('0x65'));var _0x5c90d8=util[_0x9153('0x6f')](_0x9153('0x91'),_0x4494a6);return db[_0x9153('0x45')][_0x9153('0x4a')]({'where':{'id':_0x2ec88f['params']['id']},'attributes':['id','body',_0x9153('0x92'),'to','cc','bcc','subject',_0x9153('0x93')],'include':_0x2ec88f[_0x9153('0x38')][_0x9153('0x65')]?[{'model':db[_0x9153('0x94')],'as':'Attachments'}]:undefined})[_0x9153('0x1d')](handleEntityNotFound(_0x168d8c,null))['then'](function(_0x312b01){if(_0x312b01){var _0x357589=_0x312b01;var _0x3470ba={'from':_0x357589[_0x9153('0x92')],'to':_0x357589['to'],'subject':_0x357589[_0x9153('0x95')],'html':_0x357589[_0x9153('0x4b')],'headers':{'Date':moment(_0x357589[_0x9153('0x93')])[_0x9153('0x6f')]('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x312b01['cc']){_0x3470ba[_0x9153('0x96')]['Cc']=_0x312b01['cc'];}if(_0x312b01[_0x9153('0x97')]){_0x3470ba[_0x9153('0x96')]['Bcc']=_0x312b01[_0x9153('0x97')];}return new BPromise(function(_0xdb1a1,_0x3217ee){if(_0x312b01['Attachments']){for(var _0x3647cf=0x0;_0x3647cf<_0x312b01['Attachments'][_0x9153('0x49')];_0x3647cf++){var _0x1216bb=_0x312b01['Attachments'][_0x3647cf];var _0x2e5b10=path[_0x9153('0x66')](_0x5cc070,_0x1216bb[_0x9153('0x68')]);if(fs[_0x9153('0x98')](_0x2e5b10)){_0x3470ba[_0x9153('0x65')]['push']({'name':_0x1216bb[_0x9153('0x33')],'contentType':_0x1216bb[_0x9153('0x99')],'data':fs[_0x9153('0x9a')](_0x2e5b10)});}}}emlformat[_0x9153('0x9b')](_0x3470ba,function(_0xaaf8a6,_0x1b22e5){if(_0xaaf8a6)return _0x3217ee(_0xaaf8a6);fs[_0x9153('0x9c')](path[_0x9153('0x66')](_0x331d8f,_0x5c90d8),_0x1b22e5);return _0xdb1a1(_0x1b22e5);});});}})[_0x9153('0x1d')](function(_0x5bfc51){if(_0x5bfc51){return _0x168d8c['download'](path[_0x9153('0x66')](_0x331d8f,_0x5c90d8),_0x5c90d8,function(_0x24c9dc){if(_0x24c9dc){console[_0x9153('0x9d')]('err',_0x24c9dc);}else{fs['unlinkSync'](path['join'](_0x331d8f,_0x5c90d8));}});}})[_0x9153('0x25')](handleError(_0x168d8c,null));}; \ No newline at end of file +var _0x2051=['error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','destroy','name','send','MailMessage','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','merge','options','includeAll','include','findAll','show','params','find','update','body','describe','create','direction','out','secret','split','MailAccount','findOne','MailAccountId','CmList','List','Contacts','updatedAt','DESC','Smtp','isNil','service','host','port','secure','authentication','user','pass','auth','attachments','join','root','server/files/attachments','basename','CmContact','defaults','List\x20not\x20found','SendMail','sendMail','messageId','format','stringify','read','readAt','UserId','Contact','get','MailInteraction','MailInteractionId','read1stAt','YYYY-MM-DD\x20HH:mm:ss','interaction','role','null','AcceptMessage','manual','SIP/%s','channel','accept','acceptmessage','mail','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectMessage','event','reject','EventManager','rejectmessage','unix','toString','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','build','writeFileSync','download','log','err','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','register','jayson/promise','client','http','test','Sequelize','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0x2051,0x1ed));var _0x1205=function(_0x1cb4c3,_0x2f9d17){_0x1cb4c3=_0x1cb4c3-0x0;var _0x11c8ea=_0x2051[_0x1cb4c3];return _0x11c8ea;};'use strict';var pdf=require(_0x1205('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1205('0x1'));var zipdir=require(_0x1205('0x2'));var jsonpatch=require(_0x1205('0x3'));var rp=require(_0x1205('0x4'));var moment=require('moment');var BPromise=require(_0x1205('0x5'));var Mustache=require(_0x1205('0x6'));var util=require(_0x1205('0x7'));var path=require(_0x1205('0x8'));var sox=require(_0x1205('0x9'));var csv=require(_0x1205('0xa'));var ejs=require(_0x1205('0xb'));var fs=require('fs');var _=require(_0x1205('0xc'));var squel=require(_0x1205('0xd'));var crypto=require(_0x1205('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x1205('0xf'));var toCsv=require(_0x1205('0xa'));var querystring=require(_0x1205('0x10'));var Papa=require(_0x1205('0x11'));var Redis=require(_0x1205('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x1205('0x13'));var as=require(_0x1205('0x14'));var hardwareService=require(_0x1205('0x15'));var logger=require(_0x1205('0x16'))(_0x1205('0x17'));var utils=require(_0x1205('0x18'));var config=require(_0x1205('0x19'));var db=require(_0x1205('0x1a'))['db'];config['redis']=_['defaults'](config[_0x1205('0x1b')],{'host':_0x1205('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1205('0x1b')]));require('./mailMessage.socket')[_0x1205('0x1d')](socket);var jayson=require(_0x1205('0x1e'));var client=jayson[_0x1205('0x1f')][_0x1205('0x20')]({'port':0x232c});var client9003=jayson[_0x1205('0x1f')]['http']({'port':0x232b});var client9002=jayson[_0x1205('0x1f')][_0x1205('0x20')]({'port':0x232a});function checkPasswordPattern(_0x280cf9,_0x3eeb5f,_0x572a4d){if(_0x572a4d){var _0x195838=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x195838[_0x1205('0x21')](_0x3eeb5f)){return _0x280cf9;}else{throw new db[(_0x1205('0x22'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x280cf9;}}function respondWithRpcPromise(_0x7661bd,_0x10a0db,_0x5ab70c,_0x3a8a1e){return new BPromise(function(_0x1e8daf,_0x41d4ef){var _0x5873da=_0x3a8a1e||client;return _0x5873da[_0x1205('0x23')](_0x7661bd,_0x5ab70c)[_0x1205('0x24')](function(_0x2a0e03){logger[_0x1205('0x25')](_0x1205('0x26'),_0x10a0db,_0x1205('0x27'));logger['debug'](_0x1205('0x28'),_0x10a0db,_0x1205('0x27'),JSON['stringify'](_0x2a0e03));if(_0x2a0e03[_0x1205('0x29')]){if(_0x2a0e03['error'][_0x1205('0x2a')]===0x1f4){logger['error'](_0x1205('0x26'),_0x10a0db,_0x2a0e03[_0x1205('0x29')][_0x1205('0x2b')]);return _0x41d4ef(_0x2a0e03[_0x1205('0x29')]['message']);}logger[_0x1205('0x29')](_0x1205('0x26'),_0x10a0db,_0x2a0e03[_0x1205('0x29')][_0x1205('0x2b')]);return _0x1e8daf(_0x2a0e03[_0x1205('0x29')][_0x1205('0x2b')]);}else{logger[_0x1205('0x25')]('MailMessage,\x20%s,\x20%s',_0x10a0db,_0x1205('0x27'));_0x1e8daf(_0x2a0e03[_0x1205('0x2c')][_0x1205('0x2b')]);}})[_0x1205('0x2d')](function(_0x32fe22){logger[_0x1205('0x29')](_0x1205('0x26'),_0x10a0db,_0x32fe22);_0x41d4ef(_0x32fe22);});});}function respondWithStatusCode(_0x466708,_0x1de0a9){_0x1de0a9=_0x1de0a9||0xcc;return function(_0x100bd2){if(_0x100bd2){return _0x466708[_0x1205('0x2e')](_0x1de0a9);}return _0x466708[_0x1205('0x2f')](_0x1de0a9)[_0x1205('0x30')]();};}function respondWithResult(_0x162de3,_0x147a24){_0x147a24=_0x147a24||0xc8;return function(_0xc72d52){if(_0xc72d52){return _0x162de3['status'](_0x147a24)[_0x1205('0x31')](_0xc72d52);}};}function respondWithFilteredResult(_0x6889a8,_0x4bfcf1){return function(_0x4f3b33){if(_0x4f3b33){var _0x502482=_0x4f3b33[_0x1205('0x32')],_0x713ad0=_0x4bfcf1[_0x1205('0x33')],_0x42aec7=_0x4bfcf1[_0x1205('0x33')]+_0x4bfcf1[_0x1205('0x34')],_0x2b3a90;if(_0x42aec7>=_0x502482){_0x42aec7=_0x502482;_0x2b3a90=0xc8;}else{_0x2b3a90=0xce;}_0x6889a8[_0x1205('0x2f')](_0x2b3a90);return _0x6889a8[_0x1205('0x35')](_0x1205('0x36'),_0x713ad0+'-'+_0x42aec7+'/'+_0x502482)[_0x1205('0x31')](_0x4f3b33);}return null;};}function patchUpdates(_0x18d58c){return function(_0x3d3fbc){try{jsonpatch[_0x1205('0x37')](_0x3d3fbc,_0x18d58c,!![]);}catch(_0x18b71b){return BPromise['reject'](_0x18b71b);}return _0x3d3fbc[_0x1205('0x38')]();};}function saveUpdates(_0xd0d80c,_0x150f29){return function(_0x2015f1){if(_0x2015f1){return _0x2015f1['update'](_0xd0d80c)[_0x1205('0x24')](function(_0x5bf44c){return _0x5bf44c;});}return null;};}function removeEntity(_0x2a5574,_0x17a762){return function(_0x4bd062){if(_0x4bd062){return _0x4bd062[_0x1205('0x39')]()[_0x1205('0x24')](function(){_0x2a5574[_0x1205('0x2f')](0xcc)[_0x1205('0x30')]();});}};}function handleEntityNotFound(_0x45c383,_0x948c17){return function(_0x235261){if(!_0x235261){_0x45c383['sendStatus'](0x194);}return _0x235261;};}function handleError(_0x1eaf72,_0x373655){_0x373655=_0x373655||0x1f4;return function(_0xd5e1cf){logger[_0x1205('0x29')](_0xd5e1cf['stack']);if(_0xd5e1cf[_0x1205('0x3a')]){delete _0xd5e1cf[_0x1205('0x3a')];}_0x1eaf72[_0x1205('0x2f')](_0x373655)[_0x1205('0x3b')](_0xd5e1cf);};}exports['index']=function(_0x5417a0,_0x237ad8){var _0x14b71e={},_0x112e05={},_0x43ce5d={'count':0x0,'rows':[]};var _0x57228f=_['map'](db[_0x1205('0x3c')][_0x1205('0x3d')],function(_0x2bf9d9){return{'name':_0x2bf9d9[_0x1205('0x3e')],'type':_0x2bf9d9[_0x1205('0x3f')][_0x1205('0x40')]};});_0x112e05[_0x1205('0x41')]=_[_0x1205('0x42')](_0x57228f,'name');_0x112e05[_0x1205('0x43')]=_[_0x1205('0x44')](_0x5417a0[_0x1205('0x43')]);_0x112e05['filters']=_[_0x1205('0x45')](_0x112e05[_0x1205('0x41')],_0x112e05[_0x1205('0x43')]);_0x14b71e[_0x1205('0x46')]=_[_0x1205('0x45')](_0x112e05['model'],qs['fields'](_0x5417a0[_0x1205('0x43')][_0x1205('0x47')]));_0x14b71e[_0x1205('0x46')]=_0x14b71e['attributes'][_0x1205('0x48')]?_0x14b71e[_0x1205('0x46')]:_0x112e05['model'];if(!_0x5417a0['query'][_0x1205('0x49')](_0x1205('0x4a'))){_0x14b71e['limit']=qs['limit'](_0x5417a0[_0x1205('0x43')][_0x1205('0x34')]);_0x14b71e[_0x1205('0x33')]=qs[_0x1205('0x33')](_0x5417a0[_0x1205('0x43')][_0x1205('0x33')]);}_0x14b71e[_0x1205('0x4b')]=qs['sort'](_0x5417a0['query'][_0x1205('0x4c')]);_0x14b71e[_0x1205('0x4d')]=qs[_0x1205('0x4e')](_[_0x1205('0x4f')](_0x5417a0[_0x1205('0x43')],_0x112e05[_0x1205('0x4e')]));if(_0x5417a0[_0x1205('0x43')][_0x1205('0x50')]){_0x14b71e[_0x1205('0x4d')]=_['merge'](_0x14b71e[_0x1205('0x4d')],{'$or':_[_0x1205('0x42')](_0x57228f,function(_0xf82dce){if(_0xf82dce['type']!==_0x1205('0x51')){var _0x20928f={};_0x20928f[_0xf82dce[_0x1205('0x3a')]]={'$like':'%'+_0x5417a0[_0x1205('0x43')][_0x1205('0x50')]+'%'};return _0x20928f;}})});}_0x14b71e=_[_0x1205('0x52')]({},_0x14b71e,_0x5417a0[_0x1205('0x53')]);var _0x509bf1={'where':_0x14b71e[_0x1205('0x4d')]};return db['MailMessage'][_0x1205('0x32')](_0x509bf1)[_0x1205('0x24')](function(_0x34434e){_0x43ce5d[_0x1205('0x32')]=_0x34434e;if(_0x5417a0[_0x1205('0x43')][_0x1205('0x54')]){_0x14b71e[_0x1205('0x55')]=[{'all':!![]}];}return db[_0x1205('0x3c')][_0x1205('0x56')](_0x14b71e);})[_0x1205('0x24')](function(_0x1d03b5){_0x43ce5d['rows']=_0x1d03b5;return _0x43ce5d;})[_0x1205('0x24')](respondWithFilteredResult(_0x237ad8,_0x14b71e))[_0x1205('0x2d')](handleError(_0x237ad8,null));};exports[_0x1205('0x57')]=function(_0x22bd18,_0x589189){var _0x89ead7={'raw':!![],'where':{'id':_0x22bd18[_0x1205('0x58')]['id']}},_0x4f816a={};_0x4f816a[_0x1205('0x41')]=_[_0x1205('0x44')](db[_0x1205('0x3c')]['rawAttributes']);_0x4f816a[_0x1205('0x43')]=_['keys'](_0x22bd18[_0x1205('0x43')]);_0x4f816a['filters']=_[_0x1205('0x45')](_0x4f816a[_0x1205('0x41')],_0x4f816a[_0x1205('0x43')]);_0x89ead7[_0x1205('0x46')]=_[_0x1205('0x45')](_0x4f816a['model'],qs[_0x1205('0x47')](_0x22bd18['query'][_0x1205('0x47')]));_0x89ead7['attributes']=_0x89ead7['attributes'][_0x1205('0x48')]?_0x89ead7['attributes']:_0x4f816a['model'];if(_0x22bd18[_0x1205('0x43')][_0x1205('0x54')]){_0x89ead7['include']=[{'all':!![]}];}_0x89ead7=_[_0x1205('0x52')]({},_0x89ead7,_0x22bd18[_0x1205('0x53')]);return db['MailMessage'][_0x1205('0x59')](_0x89ead7)[_0x1205('0x24')](handleEntityNotFound(_0x589189,null))[_0x1205('0x24')](respondWithResult(_0x589189,null))[_0x1205('0x2d')](handleError(_0x589189,null));};exports[_0x1205('0x5a')]=function(_0x148a24,_0x51f4dc){if(_0x148a24['body']['id']){delete _0x148a24[_0x1205('0x5b')]['id'];}return db[_0x1205('0x3c')][_0x1205('0x59')]({'where':{'id':_0x148a24[_0x1205('0x58')]['id']}})[_0x1205('0x24')](handleEntityNotFound(_0x51f4dc,null))['then'](saveUpdates(_0x148a24[_0x1205('0x5b')],null))[_0x1205('0x24')](respondWithResult(_0x51f4dc,null))['catch'](handleError(_0x51f4dc,null));};exports[_0x1205('0x39')]=function(_0x3dcd68,_0x375653){return db[_0x1205('0x3c')][_0x1205('0x59')]({'where':{'id':_0x3dcd68[_0x1205('0x58')]['id']}})[_0x1205('0x24')](handleEntityNotFound(_0x375653,null))['then'](removeEntity(_0x375653,null))[_0x1205('0x2d')](handleError(_0x375653,null));};exports[_0x1205('0x5c')]=function(_0x392098,_0x301491){return db['MailMessage'][_0x1205('0x5c')]()[_0x1205('0x24')](respondWithResult(_0x301491,null))[_0x1205('0x2d')](handleError(_0x301491,null));};exports[_0x1205('0x5d')]=function(_0x44e247,_0x54dc01){return db[_0x1205('0x3c')]['create'](_0x44e247[_0x1205('0x5b')])[_0x1205('0x24')](function(_0x769148){if(_0x769148){if(_0x769148[_0x1205('0x5e')]===_0x1205('0x5f')&&!_0x769148[_0x1205('0x60')]){var _0x2f366b,_0x4f793d,_0x31e4be;if(_0x44e247[_0x1205('0x5b')]['to']){_0x4f793d=_0x44e247[_0x1205('0x5b')]['to'][_0x1205('0x61')](',')[0x0];}return db[_0x1205('0x62')][_0x1205('0x63')]({'where':{'id':_0x769148[_0x1205('0x64')]},'include':[{'model':db[_0x1205('0x65')],'as':_0x1205('0x66'),'include':[{'model':db['CmContact'],'as':_0x1205('0x67'),'where':{'email':_0x4f793d},'limit':0x1,'order':[[_0x1205('0x68'),_0x1205('0x69')]]}]},{'model':db['MailServerOut'],'as':'Smtp','raw':!![]}]})[_0x1205('0x24')](function(_0x261fab){_0x2f366b=_0x261fab;if(_0x2f366b&&_0x2f366b[_0x1205('0x6a')]){var _0x136e67={'tls':{'rejectUnauthorized':![]}};if(_[_0x1205('0x6b')](_0x2f366b[_0x1205('0x6a')][_0x1205('0x6c')])){_0x136e67[_0x1205('0x6d')]=_0x2f366b['Smtp'][_0x1205('0x6d')];_0x136e67['port']=_0x2f366b['Smtp'][_0x1205('0x6e')];_0x136e67[_0x1205('0x6f')]=_0x2f366b[_0x1205('0x6a')][_0x1205('0x6f')];if(_0x2f366b['Smtp'][_0x1205('0x70')]){_0x136e67['auth']={'user':_0x2f366b[_0x1205('0x6a')][_0x1205('0x71')],'pass':_0x2f366b['Smtp'][_0x1205('0x72')]};}}else{_0x136e67['service']=_0x2f366b[_0x1205('0x6a')]['service'];_0x136e67[_0x1205('0x73')]={'user':_0x2f366b[_0x1205('0x6a')][_0x1205('0x71')],'pass':_0x2f366b[_0x1205('0x6a')][_0x1205('0x72')]};_0x136e67[_0x1205('0x6f')]=_0x2f366b[_0x1205('0x6a')]['secure'];}if(_0x44e247[_0x1205('0x5b')][_0x1205('0x74')]&&_0x44e247['body'][_0x1205('0x74')][_0x1205('0x48')]){for(var _0x13aae2=0x0;_0x13aae2<_0x44e247[_0x1205('0x5b')][_0x1205('0x74')][_0x1205('0x48')];_0x13aae2+=0x1){_0x44e247[_0x1205('0x5b')][_0x1205('0x74')][_0x13aae2]={'filename':_0x44e247['body'][_0x1205('0x74')][_0x13aae2][_0x1205('0x3a')],'path':path[_0x1205('0x75')](config[_0x1205('0x76')],_0x1205('0x77'),_0x44e247[_0x1205('0x5b')]['attachments'][_0x13aae2][_0x1205('0x78')])};}}_0x31e4be={'account':_0x136e67,'message':_0x44e247[_0x1205('0x5b')]};return;}})[_0x1205('0x24')](function(){if(_0x2f366b['List']){if(_0x2f366b[_0x1205('0x66')][_0x1205('0x67')][_0x1205('0x48')]){return _0x2f366b['List'][_0x1205('0x67')][0x0];}else{return db[_0x1205('0x79')][_0x1205('0x5d')](_[_0x1205('0x7a')](_0x44e247[_0x1205('0x5b')],{'firstName':_0x44e247['body']['to'],'email':_0x44e247[_0x1205('0x5b')]['to'],'phone':_0x44e247[_0x1205('0x5b')]['to'],'ListId':_0x2f366b['ListId']}));}}else{throw new Error(_0x1205('0x7b'));}})[_0x1205('0x24')](function(){if(_0x31e4be){return respondWithRpcPromise(_0x1205('0x7c'),_0x1205('0x7d'),_0x31e4be,client9003)[_0x1205('0x24')](function(_0x4e512a){return _0x769148['update']({'read':!![],'messageId':_0x4e512a[_0x1205('0x7e')],'sentAt':moment()[_0x1205('0x7f')]('YYYY-MM-DD\x20HH:mm:ss')});})[_0x1205('0x2d')](function(_0x1752cc){logger['error']('%s',JSON[_0x1205('0x80')](_0x1752cc));return _0x769148;});}return _0x769148;});}return _0x769148;}})[_0x1205('0x24')](respondWithResult(_0x54dc01,0xc9))[_0x1205('0x2d')](handleError(_0x54dc01,null));};var interaction_log=require(_0x1205('0x16'))('mail-interactions');exports['accept']=function(_0x327b30,_0x300298,_0x3e0adb){var _0x21d2ec={'channel':'mail'};if(_0x327b30[_0x1205('0x5b')]['id']){delete _0x327b30[_0x1205('0x5b')]['id'];}_0x327b30[_0x1205('0x5b')][_0x1205('0x81')]=!![];_0x327b30['body'][_0x1205('0x82')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x327b30[_0x1205('0x5b')]['UserId']=_0x327b30[_0x1205('0x5b')][_0x1205('0x83')]||_0x327b30['user']['id'];return db[_0x1205('0x3c')][_0x1205('0x59')]({'where':{'id':_0x327b30[_0x1205('0x58')]['id'],'UserId':null},'include':[{'model':db[_0x1205('0x79')],'as':_0x1205('0x84')}]})[_0x1205('0x24')](handleEntityNotFound(_0x300298,null))[_0x1205('0x24')](saveUpdates(_0x327b30[_0x1205('0x5b')],null))[_0x1205('0x24')](function(_0x176310){if(_0x176310){_0x21d2ec[_0x1205('0x2b')]=_0x176310[_0x1205('0x85')]({'plain':!![]});return db[_0x1205('0x86')][_0x1205('0x59')]({'where':{'id':_0x176310[_0x1205('0x87')]}});}return null;})['then'](handleEntityNotFound(_0x300298,null))[_0x1205('0x24')](function(_0x20d378){if(_0x20d378){return _0x20d378[_0x1205('0x5a')]({'UserId':_0x327b30[_0x1205('0x5b')][_0x1205('0x83')],'read1stAt':_['isNil'](_0x20d378[_0x1205('0x88')])?moment()['format'](_0x1205('0x89')):undefined});}return null;})[_0x1205('0x24')](function(_0xb5e8ed){if(_0xb5e8ed){_0x21d2ec[_0x1205('0x8a')]=_0xb5e8ed[_0x1205('0x85')]({'plain':!![]});interaction_log[_0x1205('0x25')]('[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x327b30[_0x1205('0x71')]['id'],_0x327b30[_0x1205('0x71')][_0x1205('0x3a')],_0x327b30[_0x1205('0x71')][_0x1205('0x8b')],_0x21d2ec[_0x1205('0x8a')]['id'],_0x327b30['body']?JSON[_0x1205('0x80')](_0x327b30[_0x1205('0x5b')]):_0x1205('0x8c'));return respondWithRpcPromise(_0x1205('0x8d'),'acceptMessage',_0x21d2ec);}return null;})['then'](function(_0x1ee04e){if(_0x1ee04e){if(_0x327b30[_0x1205('0x5b')][_0x1205('0x8e')]){_0x21d2ec[_0x1205('0x2b')]['interface']=util[_0x1205('0x7f')](_0x1205('0x8f'),_0x327b30['user'][_0x1205('0x3a')]);_0x21d2ec[_0x1205('0x2b')][_0x1205('0x90')]=_0x21d2ec[_0x1205('0x90')];_0x21d2ec[_0x1205('0x2b')]['event']=_0x1205('0x91');return respondWithRpcPromise('EventManager','EventManager',{'event':_0x1205('0x92'),'message':_0x21d2ec['message']},client9002)['then'](function(){return _0x21d2ec;});}return _0x21d2ec;}return null;})[_0x1205('0x24')](respondWithResult(_0x300298,null))[_0x1205('0x2d')](handleError(_0x300298,null));};var interaction_log=require(_0x1205('0x16'))('mail-interactions');exports['reject']=function(_0x342a99,_0x2ec26d,_0x40b6f2){var _0x5afdec={'agent':{},'channel':_0x1205('0x93')};if(_0x342a99[_0x1205('0x5b')]['id']){delete _0x342a99[_0x1205('0x5b')]['id'];}_0x342a99[_0x1205('0x5b')][_0x1205('0x83')]=_0x342a99[_0x1205('0x5b')]['UserId']||_0x342a99[_0x1205('0x71')]['id'];_0x5afdec['agent']['id']=_0x342a99[_0x1205('0x5b')][_0x1205('0x83')];return db['MailMessage'][_0x1205('0x59')]({'where':{'id':_0x342a99[_0x1205('0x58')]['id'],'UserId':null}})[_0x1205('0x24')](handleEntityNotFound(_0x2ec26d,null))[_0x1205('0x24')](function(_0x2d2028){if(_0x2d2028){_0x5afdec[_0x1205('0x2b')]=_0x2d2028[_0x1205('0x85')]({'plain':!![]});return db[_0x1205('0x86')][_0x1205('0x59')]({'where':{'id':_0x2d2028[_0x1205('0x87')]}});}return null;})[_0x1205('0x24')](handleEntityNotFound(_0x2ec26d,null))[_0x1205('0x24')](function(_0x1df59){if(_0x1df59){_0x5afdec[_0x1205('0x8a')]=_0x1df59[_0x1205('0x85')]({'plain':!![]});interaction_log[_0x1205('0x25')](_0x1205('0x94'),_0x342a99['user']['id'],_0x342a99[_0x1205('0x71')]['name'],_0x342a99[_0x1205('0x71')]['role'],_0x5afdec[_0x1205('0x8a')]['id'],_0x342a99[_0x1205('0x5b')]?JSON[_0x1205('0x80')](_0x342a99[_0x1205('0x5b')]):_0x1205('0x8c'));return respondWithRpcPromise('RejectMessage',_0x1205('0x95'),_0x5afdec);}return null;})['then'](function(_0x1d8c2c){if(_0x1d8c2c){_0x1d8c2c[_0x1205('0x2b')]['interface']=util['format'](_0x1205('0x8f'),_0x342a99[_0x1205('0x71')][_0x1205('0x3a')]);_0x1d8c2c[_0x1205('0x2b')][_0x1205('0x90')]=_0x5afdec[_0x1205('0x90')];_0x1d8c2c[_0x1205('0x2b')][_0x1205('0x96')]=_0x1205('0x97');respondWithRpcPromise(_0x1205('0x98'),'EventManager',{'event':_0x1205('0x99'),'message':_0x1d8c2c[_0x1205('0x2b')]},client9002);return _0x5afdec;}return null;})[_0x1205('0x24')](respondWithResult(_0x2ec26d,null))['catch'](handleError(_0x2ec26d,null));};exports['download']=function(_0x43aeb9,_0x216e18){var _0x31ccfb=moment()[_0x1205('0x9a')]()[_0x1205('0x9b')]();var _0x18a319=path[_0x1205('0x75')](config[_0x1205('0x76')],_0x1205('0x9c'),_0x1205('0x9d'),_0x1205('0x9e'));var _0x4c5e1f=path[_0x1205('0x75')](config['root'],_0x1205('0x9c'),_0x1205('0x9d'),'attachments');var _0x3aa494=util[_0x1205('0x7f')](_0x1205('0x9f'),_0x31ccfb);return db['MailMessage']['find']({'where':{'id':_0x43aeb9[_0x1205('0x58')]['id']},'attributes':['id',_0x1205('0x5b'),_0x1205('0xa0'),'to','cc',_0x1205('0xa1'),_0x1205('0xa2'),_0x1205('0xa3')],'include':_0x43aeb9['query'][_0x1205('0x74')]?[{'model':db[_0x1205('0xa4')],'as':'Attachments'}]:undefined})[_0x1205('0x24')](handleEntityNotFound(_0x216e18,null))[_0x1205('0x24')](function(_0x375bc6){if(_0x375bc6){var _0x1dbf03=_0x375bc6;var _0x4ca7a9={'from':_0x1dbf03[_0x1205('0xa0')],'to':_0x1dbf03['to'],'subject':_0x1dbf03[_0x1205('0xa2')],'html':_0x1dbf03['body'],'headers':{'Date':moment(_0x1dbf03[_0x1205('0xa3')])[_0x1205('0x7f')](_0x1205('0xa5'))},'attachments':[]};if(_0x375bc6['cc']){_0x4ca7a9[_0x1205('0xa6')]['Cc']=_0x375bc6['cc'];}if(_0x375bc6[_0x1205('0xa1')]){_0x4ca7a9['headers'][_0x1205('0xa7')]=_0x375bc6['bcc'];}return new BPromise(function(_0x1498c7,_0x3eab5a){if(_0x375bc6[_0x1205('0xa8')]){for(var _0x55379f=0x0;_0x55379f<_0x375bc6[_0x1205('0xa8')][_0x1205('0x48')];_0x55379f++){var _0x3bc065=_0x375bc6[_0x1205('0xa8')][_0x55379f];var _0x2fec17=path[_0x1205('0x75')](_0x4c5e1f,_0x3bc065[_0x1205('0x78')]);if(fs[_0x1205('0xa9')](_0x2fec17)){_0x4ca7a9[_0x1205('0x74')][_0x1205('0xaa')]({'name':_0x3bc065[_0x1205('0x3a')],'contentType':_0x3bc065[_0x1205('0x3f')],'data':fs[_0x1205('0xab')](_0x2fec17)});}}}emlformat[_0x1205('0xac')](_0x4ca7a9,function(_0x3d758d,_0x3ad2cf){if(_0x3d758d)return _0x3eab5a(_0x3d758d);fs[_0x1205('0xad')](path[_0x1205('0x75')](_0x18a319,_0x3aa494),_0x3ad2cf);return _0x1498c7(_0x3ad2cf);});});}})[_0x1205('0x24')](function(_0xe6940b){if(_0xe6940b){return _0x216e18[_0x1205('0xae')](path['join'](_0x18a319,_0x3aa494),_0x3aa494,function(_0x4f571a){if(_0x4f571a){console[_0x1205('0xaf')](_0x1205('0xb0'),_0x4f571a);}else{fs[_0x1205('0xb1')](path[_0x1205('0x75')](_0x18a319,_0x3aa494));}});}})[_0x1205('0x2d')](handleError(_0x216e18,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 4e66ad0..170a793 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 _0xe307=['setMaxListeners','emit','hook','exports','events','../../mysqldb','MailMessage'];(function(_0x387edf,_0x2cba82){var _0x26be2c=function(_0x32b4fe){while(--_0x32b4fe){_0x387edf['push'](_0x387edf['shift']());}};_0x26be2c(++_0x2cba82);}(_0xe307,0xd6));var _0x7e30=function(_0x5b498b,_0x4fd0a4){_0x5b498b=_0x5b498b-0x0;var _0x249ce9=_0xe307[_0x5b498b];return _0x249ce9;};'use strict';var EventEmitter=require(_0x7e30('0x0'));var MailMessage=require(_0x7e30('0x1'))['db'][_0x7e30('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x7e30('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xb31365){return function(_0x33bbf9,_0x106244,_0x107c91){MailMessageEvents['emit'](_0xb31365+':'+_0x33bbf9['id'],_0x33bbf9);MailMessageEvents[_0x7e30('0x4')](_0xb31365,_0x33bbf9);_0x107c91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailMessage[_0x7e30('0x5')](e,emitEvent(event));}}module[_0x7e30('0x6')]=MailMessageEvents; \ No newline at end of file +var _0x76c2=['emit','hasOwnProperty','hook','events','MailMessage','setMaxListeners','save','update','remove'];(function(_0x407c1b,_0x52bebf){var _0x94f5cc=function(_0x4c23d9){while(--_0x4c23d9){_0x407c1b['push'](_0x407c1b['shift']());}};_0x94f5cc(++_0x52bebf);}(_0x76c2,0x108));var _0x276c=function(_0x4dfb08,_0x1650ad){_0x4dfb08=_0x4dfb08-0x0;var _0xf00ce6=_0x76c2[_0x4dfb08];return _0xf00ce6;};'use strict';var EventEmitter=require(_0x276c('0x0'));var MailMessage=require('../../mysqldb')['db'][_0x276c('0x1')];var MailMessageEvents=new EventEmitter();MailMessageEvents[_0x276c('0x2')](0x0);var events={'afterCreate':_0x276c('0x3'),'afterUpdate':_0x276c('0x4'),'afterDestroy':_0x276c('0x5')};function emitEvent(_0x1ec4d6){return function(_0x484bee,_0x45d0ce,_0x402791){MailMessageEvents[_0x276c('0x6')](_0x1ec4d6+':'+_0x484bee['id'],_0x484bee);MailMessageEvents[_0x276c('0x6')](_0x1ec4d6,_0x484bee);_0x402791(null);};}for(var e in events){if(events[_0x276c('0x7')](e)){var event=events[e];MailMessage[_0x276c('0x8')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.model.js b/server/api/mailMessage/mailMessage.model.js index a0654ff..6b698be 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 _0x9afc=['messageId','plainBody','subject','body','fromString','models','get','direction','toLowerCase','out','secret','UserId','MailInteraction','findOne','MailInteractionId','then','update','createdAt','catch','error','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','MailMessage','mail_messages'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x9afc,0x1cf));var _0xc9af=function(_0x4f8d4b,_0x1b739d){_0x4f8d4b=_0x4f8d4b-0x0;var _0x19c786=_0x9afc[_0x4f8d4b];return _0x19c786;};'use strict';var _=require(_0xc9af('0x0'));var util=require(_0xc9af('0x1'));var logger=require('../../config/logger')(_0xc9af('0x2'));var moment=require(_0xc9af('0x3'));var BPromise=require(_0xc9af('0x4'));var rp=require(_0xc9af('0x5'));var htmlToText=require(_0xc9af('0x6'));var fs=require('fs');var path=require(_0xc9af('0x7'));var rimraf=require(_0xc9af('0x8'));var config=require(_0xc9af('0x9'));var attributes=require(_0xc9af('0xa'));module['exports']=function(_0x14ccdd,_0x25302e){return _0x14ccdd['define'](_0xc9af('0xb'),attributes,{'tableName':_0xc9af('0xc'),'paranoid':![],'indexes':[{'name':_0xc9af('0xd'),'fields':[_0xc9af('0xd')]},{'name':'fti_mail_messages','fields':[_0xc9af('0xe'),_0xc9af('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x49d9bb,_0x280cff,_0x5a7935){if(_0x49d9bb[_0xc9af('0x10')]){_0x49d9bb[_0xc9af('0xe')]=htmlToText[_0xc9af('0x11')](_0x49d9bb['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x5a7935(null,_0x280cff);},'afterCreate':function(_0x319dc0,_0x4ff4e6,_0x4f2243){var _0x2356c5=_0x14ccdd[_0xc9af('0x12')];var _0x5dee48=_0x319dc0[_0xc9af('0x13')]({'plain':!![]});if(_0x5dee48[_0xc9af('0x14')][_0xc9af('0x15')]()==='in'||_0x5dee48[_0xc9af('0x14')][_0xc9af('0x15')]()===_0xc9af('0x16')&&!_0x5dee48[_0xc9af('0x17')]&&!_['isNil'](_0x5dee48[_0xc9af('0x18')])){_0x2356c5[_0xc9af('0x19')][_0xc9af('0x1a')]({'where':{'id':_0x5dee48[_0xc9af('0x1b')]}})[_0xc9af('0x1c')](function(_0x1a07ca){if(_0x1a07ca){_0x1a07ca[_0xc9af('0x1d')]({'lastMsgAt':_0x5dee48[_0xc9af('0x1e')],'lastMsgDirection':_0x5dee48['direction']['toLowerCase'](),'lastMsgBody':_0x5dee48[_0xc9af('0x10')]});}})[_0xc9af('0x1f')](function(_0x38cec9){console[_0xc9af('0x20')](_0x38cec9);});}_0x4f2243();}},'charset':'utf8mb4','collate':_0xc9af('0x21')});}; \ No newline at end of file +var _0x06e5=['MailMessage','mail_messages','messageId','fti_mail_messages','plainBody','subject','FULLTEXT','fromString','body','models','toLowerCase','direction','out','secret','isNil','MailInteraction','MailInteractionId','update','catch','utf8mb4_unicode_ci','lodash','api','request-promise','html-to-text','path','../../config/environment','./mailMessage.attributes','exports'];(function(_0x1f4eaa,_0x4f30ce){var _0x4609e4=function(_0x11ad25){while(--_0x11ad25){_0x1f4eaa['push'](_0x1f4eaa['shift']());}};_0x4609e4(++_0x4f30ce);}(_0x06e5,0x148));var _0x506e=function(_0x2b7764,_0x2606f1){_0x2b7764=_0x2b7764-0x0;var _0x848dcb=_0x06e5[_0x2b7764];return _0x848dcb;};'use strict';var _=require(_0x506e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x506e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x506e('0x2'));var htmlToText=require(_0x506e('0x3'));var fs=require('fs');var path=require(_0x506e('0x4'));var rimraf=require('rimraf');var config=require(_0x506e('0x5'));var attributes=require(_0x506e('0x6'));module[_0x506e('0x7')]=function(_0x15b705,_0x20888c){return _0x15b705['define'](_0x506e('0x8'),attributes,{'tableName':_0x506e('0x9'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0x506e('0xa')]},{'name':_0x506e('0xb'),'fields':[_0x506e('0xc'),_0x506e('0xd')],'type':_0x506e('0xe')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x1f332e,_0x22df15,_0x23991d){if(_0x1f332e['body']){_0x1f332e[_0x506e('0xc')]=htmlToText[_0x506e('0xf')](_0x1f332e[_0x506e('0x10')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x23991d(null,_0x22df15);},'afterCreate':function(_0x51e683,_0x9f9566,_0x127ceb){var _0x5a285e=_0x15b705[_0x506e('0x11')];var _0x261550=_0x51e683['get']({'plain':!![]});if(_0x261550['direction'][_0x506e('0x12')]()==='in'||_0x261550[_0x506e('0x13')][_0x506e('0x12')]()===_0x506e('0x14')&&!_0x261550[_0x506e('0x15')]&&!_[_0x506e('0x16')](_0x261550['UserId'])){_0x5a285e[_0x506e('0x17')]['findOne']({'where':{'id':_0x261550[_0x506e('0x18')]}})['then'](function(_0x39ad6c){if(_0x39ad6c){_0x39ad6c[_0x506e('0x19')]({'lastMsgAt':_0x261550['createdAt'],'lastMsgDirection':_0x261550[_0x506e('0x13')][_0x506e('0x12')](),'lastMsgBody':_0x261550[_0x506e('0x10')]});}})[_0x506e('0x1a')](function(_0x1dfb0d){console['error'](_0x1dfb0d);});}_0x127ceb();}},'charset':'utf8mb4','collate':_0x506e('0x1b')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index 901d181..19ab101 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 _0x01d9=['catch','CreateMailMessage','create','body','options','raw','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','request','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result'];(function(_0x1ae109,_0x22ff67){var _0xce95c3=function(_0x4d619d){while(--_0x4d619d){_0x1ae109['push'](_0x1ae109['shift']());}};_0xce95c3(++_0x22ff67);}(_0x01d9,0x6c));var _0x901d=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x01d9[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0x901d('0x0'));var util=require(_0x901d('0x1'));var moment=require(_0x901d('0x2'));var BPromise=require(_0x901d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x901d('0x4'));var db=require(_0x901d('0x5'))['db'];var utils=require(_0x901d('0x6'));var logger=require(_0x901d('0x7'))(_0x901d('0x8'));var config=require(_0x901d('0x9'));var jayson=require(_0x901d('0xa'));var client=jayson['client'][_0x901d('0xb')]({'port':0x232a});config[_0x901d('0xc')]=_[_0x901d('0xd')](config[_0x901d('0xc')],{'host':_0x901d('0xe'),'port':0x18eb});var socket=require(_0x901d('0xf'))(new Redis(config[_0x901d('0xc')]));require(_0x901d('0x10'))[_0x901d('0x11')](socket);function respondWithRpcPromise(_0xacff40,_0x440fb0,_0xd819f0){return new BPromise(function(_0x1d3137,_0x5d74e2){return client[_0x901d('0x12')](_0xacff40,_0xd819f0)['then'](function(_0x220153){logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));logger[_0x901d('0x16')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x440fb0,_0x901d('0x15'),JSON[_0x901d('0x17')](_0x220153));if(_0x220153[_0x901d('0x18')]){if(_0x220153[_0x901d('0x18')][_0x901d('0x19')]===0x1f4){logger[_0x901d('0x18')]('MailMessage,\x20%s,\x20%s',_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x5d74e2(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}logger[_0x901d('0x18')](_0x901d('0x14'),_0x440fb0,_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);return _0x1d3137(_0x220153[_0x901d('0x18')][_0x901d('0x1a')]);}else{logger[_0x901d('0x13')](_0x901d('0x14'),_0x440fb0,_0x901d('0x15'));_0x1d3137(_0x220153[_0x901d('0x1b')][_0x901d('0x1a')]);}})[_0x901d('0x1c')](function(_0xf3c66a){logger[_0x901d('0x18')]('MailMessage,\x20%s,\x20%s',_0x440fb0,_0xf3c66a);_0x5d74e2(_0xf3c66a);});});}exports[_0x901d('0x1d')]=function(_0x2f32f8){var _0x4d27db=this;return new Promise(function(_0x5bdff4,_0x496a06){return db['MailMessage'][_0x901d('0x1e')](_0x2f32f8[_0x901d('0x1f')],{'raw':_0x2f32f8['options']?_0x2f32f8[_0x901d('0x20')][_0x901d('0x21')]===undefined?!![]:![]:!![]})['then'](function(_0x20778b){logger[_0x901d('0x13')](_0x901d('0x1d'),_0x2f32f8);logger[_0x901d('0x16')](_0x901d('0x1d'),_0x2f32f8,JSON[_0x901d('0x17')](_0x20778b));_0x5bdff4(_0x20778b);})[_0x901d('0x1c')](function(_0x45b6a8){logger['error'](_0x901d('0x1d'),_0x45b6a8[_0x901d('0x1a')],_0x2f32f8);_0x496a06(_0x4d27db[_0x901d('0x18')](0x1f4,_0x45b6a8[_0x901d('0x1a')]));});});}; \ No newline at end of file +var _0xcf12=['create','body','options','raw','debug','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','register','then','info','request\x20sent','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','MailMessage,\x20%s,\x20%s','message','result','catch','CreateMailMessage','MailMessage'];(function(_0x46ae5a,_0x2a38d0){var _0x434986=function(_0x22735d){while(--_0x22735d){_0x46ae5a['push'](_0x46ae5a['shift']());}};_0x434986(++_0x2a38d0);}(_0xcf12,0x140));var _0x2cf1=function(_0x3aefc3,_0x22778b){_0x3aefc3=_0x3aefc3-0x0;var _0x200be9=_0xcf12[_0x3aefc3];return _0x200be9;};'use strict';var _=require('lodash');var util=require(_0x2cf1('0x0'));var moment=require('moment');var BPromise=require(_0x2cf1('0x1'));var rs=require(_0x2cf1('0x2'));var fs=require('fs');var Redis=require(_0x2cf1('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x2cf1('0x4'));var logger=require(_0x2cf1('0x5'))(_0x2cf1('0x6'));var config=require(_0x2cf1('0x7'));var jayson=require(_0x2cf1('0x8'));var client=jayson[_0x2cf1('0x9')][_0x2cf1('0xa')]({'port':0x232a});config[_0x2cf1('0xb')]=_[_0x2cf1('0xc')](config['redis'],{'host':_0x2cf1('0xd'),'port':0x18eb});var socket=require(_0x2cf1('0xe'))(new Redis(config[_0x2cf1('0xb')]));require(_0x2cf1('0xf'))[_0x2cf1('0x10')](socket);function respondWithRpcPromise(_0x25b0af,_0x4c9779,_0x5458d7){return new BPromise(function(_0x4a4a08,_0x34a404){return client['request'](_0x25b0af,_0x5458d7)[_0x2cf1('0x11')](function(_0x25a814){logger[_0x2cf1('0x12')]('MailMessage,\x20%s,\x20%s',_0x4c9779,_0x2cf1('0x13'));logger['debug'](_0x2cf1('0x14'),_0x4c9779,_0x2cf1('0x13'),JSON[_0x2cf1('0x15')](_0x25a814));if(_0x25a814[_0x2cf1('0x16')]){if(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x17')]===0x1f4){logger[_0x2cf1('0x16')](_0x2cf1('0x18'),_0x4c9779,_0x25a814[_0x2cf1('0x16')]['message']);return _0x34a404(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);}logger['error'](_0x2cf1('0x18'),_0x4c9779,_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);return _0x4a4a08(_0x25a814[_0x2cf1('0x16')][_0x2cf1('0x19')]);}else{logger[_0x2cf1('0x12')](_0x2cf1('0x18'),_0x4c9779,_0x2cf1('0x13'));_0x4a4a08(_0x25a814[_0x2cf1('0x1a')][_0x2cf1('0x19')]);}})[_0x2cf1('0x1b')](function(_0x4a6dc3){logger[_0x2cf1('0x16')]('MailMessage,\x20%s,\x20%s',_0x4c9779,_0x4a6dc3);_0x34a404(_0x4a6dc3);});});}exports[_0x2cf1('0x1c')]=function(_0x5845b){var _0x1e5dcf=this;return new Promise(function(_0x321afb,_0x16f681){return db[_0x2cf1('0x1d')][_0x2cf1('0x1e')](_0x5845b[_0x2cf1('0x1f')],{'raw':_0x5845b['options']?_0x5845b[_0x2cf1('0x20')][_0x2cf1('0x21')]===undefined?!![]:![]:!![]})[_0x2cf1('0x11')](function(_0x5dd55b){logger[_0x2cf1('0x12')]('CreateMailMessage',_0x5845b);logger[_0x2cf1('0x22')](_0x2cf1('0x1c'),_0x5845b,JSON[_0x2cf1('0x15')](_0x5dd55b));_0x321afb(_0x5dd55b);})[_0x2cf1('0x1b')](function(_0x4c3ac3){logger[_0x2cf1('0x16')](_0x2cf1('0x1c'),_0x4c3ac3[_0x2cf1('0x19')],_0x5845b);_0x16f681(_0x1e5dcf[_0x2cf1('0x16')](0x1f4,_0x4c3ac3['message']));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index a06cff1..7d7a180 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 _0xab53=['register','./mailMessage.events','save','remove','update'];(function(_0x4dfaad,_0x5a7b52){var _0x51146d=function(_0x3ee06f){while(--_0x3ee06f){_0x4dfaad['push'](_0x4dfaad['shift']());}};_0x51146d(++_0x5a7b52);}(_0xab53,0x12d));var _0x3ab5=function(_0x4017b0,_0x4347db){_0x4017b0=_0x4017b0-0x0;var _0x5ed4f7=_0xab53[_0x4017b0];return _0x5ed4f7;};'use strict';var MailMessageEvents=require(_0x3ab5('0x0'));var events=[_0x3ab5('0x1'),_0x3ab5('0x2'),_0x3ab5('0x3')];function createListener(_0x327f4b,_0x1a7925){return function(_0x157b32){_0x1a7925['emit'](_0x327f4b,_0x157b32);};}function removeListener(_0x1a7140,_0x466378){return function(){MailMessageEvents['removeListener'](_0x1a7140,_0x466378);};}exports[_0x3ab5('0x4')]=function(_0x6fd74c){for(var _0x43fb64=0x0,_0x40a157=events['length'];_0x43fb64<_0x40a157;_0x43fb64++){var _0x564577=events[_0x43fb64];var _0x4c460e=createListener('mailMessage:'+_0x564577,_0x6fd74c);MailMessageEvents['on'](_0x564577,_0x4c460e);}}; \ No newline at end of file +var _0x921c=['./mailMessage.events','save','remove','update','emit','register','mailMessage:'];(function(_0x18ae84,_0x301e1a){var _0x222c5e=function(_0x2ff2b5){while(--_0x2ff2b5){_0x18ae84['push'](_0x18ae84['shift']());}};_0x222c5e(++_0x301e1a);}(_0x921c,0x1ab));var _0xc921=function(_0x20af94,_0x5c6768){_0x20af94=_0x20af94-0x0;var _0x1846d1=_0x921c[_0x20af94];return _0x1846d1;};'use strict';var MailMessageEvents=require(_0xc921('0x0'));var events=[_0xc921('0x1'),_0xc921('0x2'),_0xc921('0x3')];function createListener(_0x117203,_0x21ec2c){return function(_0x1b4468){_0x21ec2c[_0xc921('0x4')](_0x117203,_0x1b4468);};}function removeListener(_0x405f60,_0x3dce55){return function(){MailMessageEvents['removeListener'](_0x405f60,_0x3dce55);};}exports[_0xc921('0x5')]=function(_0x248034){for(var _0x386a8c=0x0,_0x1419e0=events['length'];_0x386a8c<_0x1419e0;_0x386a8c++){var _0x14312a=events[_0x386a8c];var _0x22224d=createListener(_0xc921('0x6')+_0x14312a,_0x248034);MailMessageEvents['on'](_0x14312a,_0x22224d);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index b499d98..6221952 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 _0x587e=['/:id','show','/:id/members','getMembers','/:id/teams','/:id/users','getAgents','post','addTeams','addAgents','update','delete','destroy','removeTeams','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./mailQueue.controller','get','isAuthenticated','index','/describe'];(function(_0x113e5f,_0x5b7f8f){var _0x436251=function(_0x1de0b4){while(--_0x1de0b4){_0x113e5f['push'](_0x113e5f['shift']());}};_0x436251(++_0x5b7f8f);}(_0x587e,0xcc));var _0xe587=function(_0x1b6747,_0x2a67cf){_0x1b6747=_0x1b6747-0x0;var _0x220390=_0x587e[_0x1b6747];return _0x220390;};'use strict';var multer=require(_0xe587('0x0'));var util=require(_0xe587('0x1'));var path=require(_0xe587('0x2'));var timeout=require(_0xe587('0x3'));var express=require(_0xe587('0x4'));var router=express[_0xe587('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe587('0x6'));var config=require('../../config/environment');var controller=require(_0xe587('0x7'));router[_0xe587('0x8')]('/',auth[_0xe587('0x9')](),controller[_0xe587('0xa')]);router[_0xe587('0x8')](_0xe587('0xb'),auth[_0xe587('0x9')](),controller['describe']);router[_0xe587('0x8')](_0xe587('0xc'),auth['isAuthenticated'](),controller[_0xe587('0xd')]);router[_0xe587('0x8')](_0xe587('0xe'),auth[_0xe587('0x9')](),controller[_0xe587('0xf')]);router[_0xe587('0x8')](_0xe587('0x10'),auth['isAuthenticated'](),controller['getTeams']);router[_0xe587('0x8')](_0xe587('0x11'),auth[_0xe587('0x9')](),controller[_0xe587('0x12')]);router[_0xe587('0x13')]('/',auth[_0xe587('0x9')](),controller['create']);router[_0xe587('0x13')](_0xe587('0x10'),auth[_0xe587('0x9')](),controller[_0xe587('0x14')]);router[_0xe587('0x13')](_0xe587('0x11'),auth['isAuthenticated'](),controller[_0xe587('0x15')]);router['put']('/:id',auth[_0xe587('0x9')](),controller[_0xe587('0x16')]);router[_0xe587('0x17')](_0xe587('0xc'),auth[_0xe587('0x9')](),controller[_0xe587('0x18')]);router['delete'](_0xe587('0x10'),auth[_0xe587('0x9')](),controller[_0xe587('0x19')]);router[_0xe587('0x17')](_0xe587('0x11'),auth[_0xe587('0x9')](),controller['removeAgents']);module[_0xe587('0x1a')]=router; \ No newline at end of file +var _0x2702=['getTeams','/:id/users','getAgents','create','post','addTeams','addAgents','/:id','update','delete','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./mailQueue.controller','get','index','show','isAuthenticated','getMembers','/:id/teams'];(function(_0xee3338,_0x49aa57){var _0x4479ce=function(_0x1adc03){while(--_0x1adc03){_0xee3338['push'](_0xee3338['shift']());}};_0x4479ce(++_0x49aa57);}(_0x2702,0x1ac));var _0x2270=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x2702[_0x46aff0];return _0x9d78cf;};'use strict';var multer=require(_0x2270('0x0'));var util=require(_0x2270('0x1'));var path=require(_0x2270('0x2'));var timeout=require(_0x2270('0x3'));var express=require(_0x2270('0x4'));var router=express[_0x2270('0x5')]();var auth=require(_0x2270('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2270('0x7'));router[_0x2270('0x8')]('/',auth['isAuthenticated'](),controller[_0x2270('0x9')]);router[_0x2270('0x8')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x2270('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x2270('0xa')]);router[_0x2270('0x8')]('/:id/members',auth[_0x2270('0xb')](),controller[_0x2270('0xc')]);router[_0x2270('0x8')](_0x2270('0xd'),auth['isAuthenticated'](),controller[_0x2270('0xe')]);router[_0x2270('0x8')](_0x2270('0xf'),auth['isAuthenticated'](),controller[_0x2270('0x10')]);router['post']('/',auth[_0x2270('0xb')](),controller[_0x2270('0x11')]);router[_0x2270('0x12')]('/:id/teams',auth[_0x2270('0xb')](),controller[_0x2270('0x13')]);router[_0x2270('0x12')](_0x2270('0xf'),auth[_0x2270('0xb')](),controller[_0x2270('0x14')]);router['put'](_0x2270('0x15'),auth[_0x2270('0xb')](),controller[_0x2270('0x16')]);router[_0x2270('0x17')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x2270('0x17')](_0x2270('0xd'),auth[_0x2270('0xb')](),controller['removeTeams']);router[_0x2270('0x17')](_0x2270('0xf'),auth[_0x2270('0xb')](),controller[_0x2270('0x18')]);module[_0x2270('0x19')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 3ccbec9..b8f90ba 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 _0xd763=['beepall','sequelize','name','STRING','INTEGER','ENUM','rrmemory'];(function(_0x5a353f,_0x3bb5c7){var _0x176530=function(_0x179361){while(--_0x179361){_0x5a353f['push'](_0x5a353f['shift']());}};_0x176530(++_0x3bb5c7);}(_0xd763,0xda));var _0x3d76=function(_0x42bdad,_0x12836c){_0x42bdad=_0x42bdad-0x0;var _0x122626=_0xd763[_0x42bdad];return _0x122626;};'use strict';var Sequelize=require(_0x3d76('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x3d76('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3d76('0x2')]},'timeout':{'type':Sequelize[_0x3d76('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x3d76('0x4')](_0x3d76('0x5'),_0x3d76('0x6'),'roundrobin')}}; \ No newline at end of file +var _0x8acc=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x4e9c6f,_0xe50a55){var _0x155aa8=function(_0x452f7c){while(--_0x452f7c){_0x4e9c6f['push'](_0x4e9c6f['shift']());}};_0x155aa8(++_0xe50a55);}(_0x8acc,0xdb));var _0xc8ac=function(_0x2e8833,_0x42625e){_0x2e8833=_0x2e8833-0x0;var _0x32d50e=_0x8acc[_0x2e8833];return _0x32d50e;};'use strict';var Sequelize=require('sequelize');module[_0xc8ac('0x0')]={'name':{'type':Sequelize[_0xc8ac('0x1')],'unique':_0xc8ac('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xc8ac('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xc8ac('0x4')]('rrmemory',_0xc8ac('0x5'),_0xc8ac('0x6'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index 1c46cee..0248151 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 _0xcb79=['bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailQueue.socket','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','get','MailQueues','UserProfileResource','sendStatus','stack','name','send','index','map','MailQueue','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','where','pick','merge','VIRTUAL','filter','options','findAll','rows','catch','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','UserMailQueue','nolimit','sort','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','SIP','findOne','Team','getTeams','addTeams','User','online','voicePause','interface','flatMap','Agents','sequelize','findOrCreate','forEach','ids','select','field','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','TeamId','includes','all','compact','value','transaction','removeTeams','removeAgents','emit','userMailQueue:remove','addAgents','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment'];(function(_0x3bfb4c,_0x43761b){var _0x421c3b=function(_0x5a7141){while(--_0x5a7141){_0x3bfb4c['push'](_0x3bfb4c['shift']());}};_0x421c3b(++_0x43761b);}(_0xcb79,0x112));var _0x9cb7=function(_0x2d699e,_0xff91eb){_0x2d699e=_0x2d699e-0x0;var _0x39ef41=_0xcb79[_0x2d699e];return _0x39ef41;};'use strict';var pdf=require(_0x9cb7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9cb7('0x1'));var zipdir=require(_0x9cb7('0x2'));var jsonpatch=require(_0x9cb7('0x3'));var rp=require(_0x9cb7('0x4'));var moment=require(_0x9cb7('0x5'));var BPromise=require(_0x9cb7('0x6'));var Mustache=require(_0x9cb7('0x7'));var util=require('util');var path=require(_0x9cb7('0x8'));var sox=require(_0x9cb7('0x9'));var csv=require(_0x9cb7('0xa'));var ejs=require(_0x9cb7('0xb'));var fs=require('fs');var _=require(_0x9cb7('0xc'));var squel=require(_0x9cb7('0xd'));var crypto=require('crypto');var jsforce=require(_0x9cb7('0xe'));var deskjs=require(_0x9cb7('0xf'));var toCsv=require(_0x9cb7('0xa'));var querystring=require(_0x9cb7('0x10'));var Papa=require(_0x9cb7('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x9cb7('0x12'));var as=require(_0x9cb7('0x13'));var hardwareService=require(_0x9cb7('0x14'));var logger=require(_0x9cb7('0x15'))(_0x9cb7('0x16'));var utils=require('../../config/utils');var config=require(_0x9cb7('0x17'));var db=require(_0x9cb7('0x18'))['db'];config[_0x9cb7('0x19')]=_[_0x9cb7('0x1a')](config[_0x9cb7('0x19')],{'host':_0x9cb7('0x1b'),'port':0x18eb});var socket=require(_0x9cb7('0x1c'))(new Redis(config[_0x9cb7('0x19')]));require(_0x9cb7('0x1d'))['register'](socket);function respondWithStatusCode(_0x575f2f,_0x3a804f){_0x3a804f=_0x3a804f||0xcc;return function(_0x20464c){if(_0x20464c){return _0x575f2f['sendStatus'](_0x3a804f);}return _0x575f2f[_0x9cb7('0x1e')](_0x3a804f)[_0x9cb7('0x1f')]();};}function respondWithResult(_0x4cc391,_0x1b831e){_0x1b831e=_0x1b831e||0xc8;return function(_0x4bca0){if(_0x4bca0){return _0x4cc391[_0x9cb7('0x1e')](_0x1b831e)[_0x9cb7('0x20')](_0x4bca0);}};}function respondWithFilteredResult(_0x584838,_0x696e08){return function(_0x55c95d){if(_0x55c95d){var _0x24dd73=_0x55c95d[_0x9cb7('0x21')],_0x2d2905=_0x696e08['offset'],_0x4474d9=_0x696e08[_0x9cb7('0x22')]+_0x696e08['limit'],_0x557168;if(_0x4474d9>=_0x24dd73){_0x4474d9=_0x24dd73;_0x557168=0xc8;}else{_0x557168=0xce;}_0x584838[_0x9cb7('0x1e')](_0x557168);return _0x584838['set'](_0x9cb7('0x23'),_0x2d2905+'-'+_0x4474d9+'/'+_0x24dd73)[_0x9cb7('0x20')](_0x55c95d);}return null;};}function patchUpdates(_0x1b2416){return function(_0x224493){try{jsonpatch[_0x9cb7('0x24')](_0x224493,_0x1b2416,!![]);}catch(_0x5e8329){return BPromise[_0x9cb7('0x25')](_0x5e8329);}return _0x224493[_0x9cb7('0x26')]();};}function saveUpdates(_0x31bda7,_0x5aa5ad){return function(_0x59e854){if(_0x59e854){return _0x59e854[_0x9cb7('0x27')](_0x31bda7)[_0x9cb7('0x28')](function(_0x40d890){return _0x40d890;});}return null;};}function removeEntity(_0x407355,_0x2ef934){return function(_0x214544){if(_0x214544){return _0x214544[_0x9cb7('0x29')]()[_0x9cb7('0x28')](function(){var _0xdb1058=_0x214544[_0x9cb7('0x2a')]({'plain':!![]});var _0x55a87f=_0x9cb7('0x2b');return db[_0x9cb7('0x2c')][_0x9cb7('0x29')]({'where':{'type':_0x55a87f,'resourceId':_0xdb1058['id']}})[_0x9cb7('0x28')](function(){return _0x214544;});})[_0x9cb7('0x28')](function(){_0x407355[_0x9cb7('0x1e')](0xcc)[_0x9cb7('0x1f')]();});}};}function handleEntityNotFound(_0x1d5b0c,_0x30ae80){return function(_0x5adfe4){if(!_0x5adfe4){_0x1d5b0c[_0x9cb7('0x2d')](0x194);}return _0x5adfe4;};}function handleError(_0x18b937,_0xe8bbab){_0xe8bbab=_0xe8bbab||0x1f4;return function(_0x3735e6){logger['error'](_0x3735e6[_0x9cb7('0x2e')]);if(_0x3735e6[_0x9cb7('0x2f')]){delete _0x3735e6['name'];}_0x18b937[_0x9cb7('0x1e')](_0xe8bbab)[_0x9cb7('0x30')](_0x3735e6);};}exports[_0x9cb7('0x31')]=function(_0x5368a8,_0x4cf11f){var _0x412be5={},_0x361b02={},_0x35ace9={'count':0x0,'rows':[]};var _0x5a34ff=_[_0x9cb7('0x32')](db[_0x9cb7('0x33')][_0x9cb7('0x34')],function(_0xc81c3a){return{'name':_0xc81c3a[_0x9cb7('0x35')],'type':_0xc81c3a[_0x9cb7('0x36')][_0x9cb7('0x37')]};});_0x361b02[_0x9cb7('0x38')]=_[_0x9cb7('0x32')](_0x5a34ff,_0x9cb7('0x2f'));_0x361b02[_0x9cb7('0x39')]=_[_0x9cb7('0x3a')](_0x5368a8[_0x9cb7('0x39')]);_0x361b02[_0x9cb7('0x3b')]=_['intersection'](_0x361b02[_0x9cb7('0x38')],_0x361b02[_0x9cb7('0x39')]);_0x412be5['attributes']=_[_0x9cb7('0x3c')](_0x361b02[_0x9cb7('0x38')],qs[_0x9cb7('0x3d')](_0x5368a8[_0x9cb7('0x39')][_0x9cb7('0x3d')]));_0x412be5[_0x9cb7('0x3e')]=_0x412be5['attributes'][_0x9cb7('0x3f')]?_0x412be5[_0x9cb7('0x3e')]:_0x361b02[_0x9cb7('0x38')];if(!_0x5368a8[_0x9cb7('0x39')][_0x9cb7('0x40')]('nolimit')){_0x412be5['limit']=qs[_0x9cb7('0x41')](_0x5368a8[_0x9cb7('0x39')][_0x9cb7('0x41')]);_0x412be5['offset']=qs[_0x9cb7('0x22')](_0x5368a8[_0x9cb7('0x39')][_0x9cb7('0x22')]);}_0x412be5[_0x9cb7('0x42')]=qs['sort'](_0x5368a8[_0x9cb7('0x39')]['sort']);_0x412be5[_0x9cb7('0x43')]=qs[_0x9cb7('0x3b')](_[_0x9cb7('0x44')](_0x5368a8[_0x9cb7('0x39')],_0x361b02[_0x9cb7('0x3b')]));if(_0x5368a8[_0x9cb7('0x39')]['filter']){_0x412be5[_0x9cb7('0x43')]=_[_0x9cb7('0x45')](_0x412be5[_0x9cb7('0x43')],{'$or':_[_0x9cb7('0x32')](_0x5a34ff,function(_0x5f5c06){if(_0x5f5c06[_0x9cb7('0x36')]!==_0x9cb7('0x46')){var _0x4714cf={};_0x4714cf[_0x5f5c06[_0x9cb7('0x2f')]]={'$like':'%'+_0x5368a8[_0x9cb7('0x39')][_0x9cb7('0x47')]+'%'};return _0x4714cf;}})});}_0x412be5=_['merge']({},_0x412be5,_0x5368a8[_0x9cb7('0x48')]);var _0x5cdeea={'where':_0x412be5[_0x9cb7('0x43')]};return db['MailQueue'][_0x9cb7('0x21')](_0x5cdeea)[_0x9cb7('0x28')](function(_0x278fc3){_0x35ace9[_0x9cb7('0x21')]=_0x278fc3;if(_0x5368a8[_0x9cb7('0x39')]['includeAll']){_0x412be5['include']=[{'all':!![]}];}return db['MailQueue'][_0x9cb7('0x49')](_0x412be5);})[_0x9cb7('0x28')](function(_0x8b815c){_0x35ace9[_0x9cb7('0x4a')]=_0x8b815c;return _0x35ace9;})[_0x9cb7('0x28')](respondWithFilteredResult(_0x4cf11f,_0x412be5))[_0x9cb7('0x4b')](handleError(_0x4cf11f,null));};exports['show']=function(_0x58f7c4,_0x53702e){var _0x418823={'raw':!![],'where':{'id':_0x58f7c4[_0x9cb7('0x4c')]['id']}},_0x5c89d6={};_0x5c89d6[_0x9cb7('0x38')]=_['keys'](db[_0x9cb7('0x33')][_0x9cb7('0x34')]);_0x5c89d6[_0x9cb7('0x39')]=_[_0x9cb7('0x3a')](_0x58f7c4[_0x9cb7('0x39')]);_0x5c89d6['filters']=_[_0x9cb7('0x3c')](_0x5c89d6[_0x9cb7('0x38')],_0x5c89d6[_0x9cb7('0x39')]);_0x418823['attributes']=_[_0x9cb7('0x3c')](_0x5c89d6[_0x9cb7('0x38')],qs[_0x9cb7('0x3d')](_0x58f7c4[_0x9cb7('0x39')][_0x9cb7('0x3d')]));_0x418823[_0x9cb7('0x3e')]=_0x418823['attributes'][_0x9cb7('0x3f')]?_0x418823[_0x9cb7('0x3e')]:_0x5c89d6[_0x9cb7('0x38')];if(_0x58f7c4[_0x9cb7('0x39')]['includeAll']){_0x418823[_0x9cb7('0x4d')]=[{'all':!![]}];}_0x418823=_[_0x9cb7('0x45')]({},_0x418823,_0x58f7c4[_0x9cb7('0x48')]);return db[_0x9cb7('0x33')][_0x9cb7('0x4e')](_0x418823)['then'](handleEntityNotFound(_0x53702e,null))[_0x9cb7('0x28')](respondWithResult(_0x53702e,null))[_0x9cb7('0x4b')](handleError(_0x53702e,null));};exports[_0x9cb7('0x4f')]=function(_0x2062c2,_0x2c5ca9){return db[_0x9cb7('0x33')][_0x9cb7('0x4f')](_0x2062c2[_0x9cb7('0x50')],{})['then'](function(_0x1178d7){var _0x381dcb=_0x2062c2[_0x9cb7('0x51')]['get']({'plain':!![]});if(!_0x381dcb)throw new Error(_0x9cb7('0x52'));if(_0x381dcb['role']==='user'){var _0x4100bb=_0x1178d7[_0x9cb7('0x2a')]({'plain':!![]});var _0x31ae97=_0x9cb7('0x2b');return db[_0x9cb7('0x53')]['find']({'where':{'name':_0x31ae97,'userProfileId':_0x381dcb['userProfileId']},'raw':!![]})['then'](function(_0x38dbd4){if(_0x38dbd4&&_0x38dbd4['autoAssociation']===0x0){return db['UserProfileResource'][_0x9cb7('0x4f')]({'name':_0x4100bb[_0x9cb7('0x2f')],'resourceId':_0x4100bb['id'],'type':_0x38dbd4['name'],'sectionId':_0x38dbd4['id']},{})[_0x9cb7('0x28')](function(){return _0x1178d7;});}else{return _0x1178d7;}})[_0x9cb7('0x4b')](function(_0x3fbd12){logger[_0x9cb7('0x54')](_0x9cb7('0x55'),_0x3fbd12);throw _0x3fbd12;});}return _0x1178d7;})[_0x9cb7('0x28')](respondWithResult(_0x2c5ca9,0xc9))['catch'](handleError(_0x2c5ca9,null));};exports[_0x9cb7('0x27')]=function(_0x56b72d,_0x5fc354){if(_0x56b72d['body']['id']){delete _0x56b72d[_0x9cb7('0x50')]['id'];}return db[_0x9cb7('0x33')][_0x9cb7('0x4e')]({'where':{'id':_0x56b72d['params']['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x5fc354,null))[_0x9cb7('0x28')](saveUpdates(_0x56b72d[_0x9cb7('0x50')],null))[_0x9cb7('0x28')](respondWithResult(_0x5fc354,null))['catch'](handleError(_0x5fc354,null));};exports['destroy']=function(_0x4dbbb4,_0x185699){return db[_0x9cb7('0x33')][_0x9cb7('0x4e')]({'where':{'id':_0x4dbbb4['params']['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x185699,null))[_0x9cb7('0x28')](removeEntity(_0x185699,null))[_0x9cb7('0x4b')](handleError(_0x185699,null));};exports[_0x9cb7('0x56')]=function(_0x5a1c51,_0x4740fd){return db[_0x9cb7('0x33')][_0x9cb7('0x56')]()[_0x9cb7('0x28')](respondWithResult(_0x4740fd,null))[_0x9cb7('0x4b')](handleError(_0x4740fd,null));};exports[_0x9cb7('0x57')]=function(_0x878f4,_0x55cc08,_0x46e72b){var _0x32b5ae={'raw':!![],'where':{}},_0x5c1a4d={},_0xc38882;return db[_0x9cb7('0x33')]['findOne']({'where':{'id':_0x878f4[_0x9cb7('0x4c')]['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x55cc08,null))[_0x9cb7('0x28')](function(_0x5ac078){if(_0x5ac078){_0xc38882=_0x5ac078[_0x9cb7('0x2a')]({'plain':!![]});_0x5c1a4d[_0x9cb7('0x38')]=_[_0x9cb7('0x3a')](db[_0x9cb7('0x58')][_0x9cb7('0x34')]);_0x5c1a4d[_0x9cb7('0x39')]=_[_0x9cb7('0x3a')](_0x878f4[_0x9cb7('0x39')]);_0x5c1a4d['filters']=_[_0x9cb7('0x3c')](_0x5c1a4d[_0x9cb7('0x38')],_0x5c1a4d[_0x9cb7('0x39')]);_0x32b5ae['attributes']=_[_0x9cb7('0x3c')](_0x5c1a4d[_0x9cb7('0x38')],qs[_0x9cb7('0x3d')](_0x878f4[_0x9cb7('0x39')][_0x9cb7('0x3d')]));_0x32b5ae[_0x9cb7('0x3e')]=_0x32b5ae[_0x9cb7('0x3e')][_0x9cb7('0x3f')]?_0x32b5ae['attributes']:_0x5c1a4d[_0x9cb7('0x38')];if(!_0x878f4[_0x9cb7('0x39')]['hasOwnProperty'](_0x9cb7('0x59'))){_0x32b5ae['limit']=qs['limit'](_0x878f4[_0x9cb7('0x39')][_0x9cb7('0x41')]);_0x32b5ae['offset']=qs[_0x9cb7('0x22')](_0x878f4[_0x9cb7('0x39')][_0x9cb7('0x22')]);}_0x32b5ae[_0x9cb7('0x42')]=qs[_0x9cb7('0x5a')](_0x878f4['query'][_0x9cb7('0x5a')]);_0x32b5ae[_0x9cb7('0x43')]=qs[_0x9cb7('0x3b')](_[_0x9cb7('0x44')](_0x878f4[_0x9cb7('0x39')],_0x5c1a4d['filters']));_0x32b5ae[_0x9cb7('0x43')]['MailQueueId']=_0x5ac078['id'];if(_0x878f4[_0x9cb7('0x39')][_0x9cb7('0x47')]){_0x32b5ae[_0x9cb7('0x43')]=_[_0x9cb7('0x45')](_0x32b5ae[_0x9cb7('0x43')],{'$or':_[_0x9cb7('0x32')](_0x32b5ae[_0x9cb7('0x3e')],function(_0x1c27b9){var _0x5ed24b={};_0x5ed24b[_0x1c27b9]={'$like':'%'+_0x878f4[_0x9cb7('0x39')]['filter']+'%'};return _0x5ed24b;})});}_0x32b5ae=_[_0x9cb7('0x45')]({},_0x32b5ae,_0x878f4[_0x9cb7('0x48')]);return db[_0x9cb7('0x58')][_0x9cb7('0x49')](_0x32b5ae);}})[_0x9cb7('0x28')](function(_0xadf8){if(_0xadf8){return db['User'][_0x9cb7('0x5b')]({'where':{'id':_[_0x9cb7('0x32')](_0xadf8,_0x9cb7('0x5c')),'role':_0x9cb7('0x5d')},'attributes':['id',_0x9cb7('0x2f'),_0x9cb7('0x5e'),_0x9cb7('0x5f'),_0x9cb7('0x60')]});}})[_0x9cb7('0x28')](function(_0x2e2641){if(_0x2e2641){return{'count':_0x2e2641[_0x9cb7('0x21')],'rows':_[_0x9cb7('0x32')](_0x2e2641[_0x9cb7('0x4a')],function(_0x1f8195){return{'membername':_0x1f8195[_0x9cb7('0x2f')],'UserId':_0x1f8195['id'],'queue_name':_0xc38882['name'],'MailQueueId':_0xc38882['id'],'interface':util[_0x9cb7('0x61')](_0x9cb7('0x62'),_0x9cb7('0x63'),_0x1f8195[_0x9cb7('0x2f')]),'penalty':0x0,'paused':_0x1f8195['mailPause'],'createdAt':_0x1f8195['createdAt'],'updatedAt':_0x1f8195[_0x9cb7('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x9cb7('0x28')](respondWithFilteredResult(_0x55cc08,_0x32b5ae))[_0x9cb7('0x4b')](handleError(_0x55cc08,null));};exports['getTeams']=function(_0xa4d43e,_0x3780fb,_0x469652){var _0xb77f92={};var _0x3b5100={};var _0x406a92;var _0x25ca90;return db['MailQueue'][_0x9cb7('0x64')]({'where':{'id':_0xa4d43e[_0x9cb7('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3780fb,null))[_0x9cb7('0x28')](function(_0x4d1c2b){if(_0x4d1c2b){_0x406a92=_0x4d1c2b;_0x3b5100[_0x9cb7('0x38')]=_[_0x9cb7('0x3a')](db[_0x9cb7('0x65')][_0x9cb7('0x34')]);_0x3b5100['query']=_[_0x9cb7('0x3a')](_0xa4d43e[_0x9cb7('0x39')]);_0x3b5100[_0x9cb7('0x3b')]=_['intersection'](_0x3b5100[_0x9cb7('0x38')],_0x3b5100[_0x9cb7('0x39')]);_0xb77f92['attributes']=_[_0x9cb7('0x3c')](_0x3b5100[_0x9cb7('0x38')],qs['fields'](_0xa4d43e['query'][_0x9cb7('0x3d')]));_0xb77f92['attributes']=_0xb77f92[_0x9cb7('0x3e')][_0x9cb7('0x3f')]?_0xb77f92['attributes']:_0x3b5100[_0x9cb7('0x38')];_0xb77f92[_0x9cb7('0x42')]=qs['sort'](_0xa4d43e['query'][_0x9cb7('0x5a')]);_0xb77f92[_0x9cb7('0x43')]=qs['filters'](_['pick'](_0xa4d43e[_0x9cb7('0x39')],_0x3b5100['filters']));if(_0xa4d43e['query'][_0x9cb7('0x47')]){_0xb77f92[_0x9cb7('0x43')]=_[_0x9cb7('0x45')](_0xb77f92[_0x9cb7('0x43')],{'$or':_[_0x9cb7('0x32')](_0xb77f92[_0x9cb7('0x3e')],function(_0x11f6b0){var _0x455b04={};_0x455b04[_0x11f6b0]={'$like':'%'+_0xa4d43e['query'][_0x9cb7('0x47')]+'%'};return _0x455b04;})});}_0xb77f92=_['merge']({},_0xb77f92,_0xa4d43e['options']);return _0x406a92[_0x9cb7('0x66')](_0xb77f92);}})[_0x9cb7('0x28')](function(_0x4665a5){if(_0x4665a5){_0x25ca90=_0x4665a5[_0x9cb7('0x3f')];if(!_0xa4d43e[_0x9cb7('0x39')][_0x9cb7('0x40')](_0x9cb7('0x59'))){_0xb77f92[_0x9cb7('0x41')]=qs[_0x9cb7('0x41')](_0xa4d43e[_0x9cb7('0x39')][_0x9cb7('0x41')]);_0xb77f92[_0x9cb7('0x22')]=qs[_0x9cb7('0x22')](_0xa4d43e[_0x9cb7('0x39')][_0x9cb7('0x22')]);}return _0x406a92['getTeams'](_0xb77f92);}})[_0x9cb7('0x28')](function(_0x1796b3){if(_0x1796b3){return _0x1796b3?{'count':_0x25ca90,'rows':_0x1796b3}:null;}})[_0x9cb7('0x28')](respondWithResult(_0x3780fb,null))['catch'](handleError(_0x3780fb,null));};exports[_0x9cb7('0x67')]=function(_0x46f58a,_0x47d48b,_0x35d4f1){var _0x3ba2a2=_0x46f58a[_0x9cb7('0x50')]['ids'];return db[_0x9cb7('0x65')][_0x9cb7('0x49')]({'where':{'id':_0x3ba2a2},'attributes':['id'],'include':[{'model':db[_0x9cb7('0x68')],'as':'Agents','attributes':['id','name',_0x9cb7('0x69'),_0x9cb7('0x6a'),_0x9cb7('0x6b')],'raw':!![]}]})[_0x9cb7('0x28')](function(_0xd514f7){if(_0xd514f7){var _0x39ed17=_[_0x9cb7('0x6c')](_0xd514f7,function(_0xb63f30){var _0x197a8e=_0xb63f30[_0x9cb7('0x2a')]({'plain':!![]});return _0x197a8e[_0x9cb7('0x6d')];});return db['MailQueue'][_0x9cb7('0x4e')]({'where':{'id':_0x46f58a[_0x9cb7('0x4c')]['id']}})[_0x9cb7('0x28')](function(_0x5a9a94){return db[_0x9cb7('0x6e')]['transaction'](function(_0x5a7ec9){return _0x5a9a94[_0x9cb7('0x67')](_0x3ba2a2,{'transaction':_0x5a7ec9})[_0x9cb7('0x28')](function(){return BPromise['each'](_0x39ed17,function(_0xfc8c89){return db[_0x9cb7('0x58')][_0x9cb7('0x6f')]({'where':{'UserId':_0xfc8c89['id'],'MailQueueId':_0x46f58a[_0x9cb7('0x4c')]['id']},'transaction':_0x5a7ec9});});})[_0x9cb7('0x28')](function(){_0x39ed17[_0x9cb7('0x70')](function(_0x58a5c9){socket['emit']('userMailQueue:save',{'UserId':_0x58a5c9['id'],'MailQueueId':_0x5a9a94['id']});});});});});}})['then'](respondWithStatusCode(_0x47d48b,null))['catch'](handleError(_0x47d48b,null));};exports['removeTeams']=function(_0x173cef,_0x36e2cc,_0x545d35){return db[_0x9cb7('0x65')][_0x9cb7('0x49')]({'where':{'id':_0x173cef[_0x9cb7('0x39')][_0x9cb7('0x71')]},'attributes':['id'],'include':[{'model':db[_0x9cb7('0x68')],'as':_0x9cb7('0x6d'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x36e2cc,null))[_0x9cb7('0x28')](function(_0xddf1c2){var _0x3d04e5=_['map'](_0xddf1c2,'id');var _0x2b0d66=[];var _0x3b6615=[];var _0x3809c5=squel[_0x9cb7('0x72')]();_0x3809c5[_0x9cb7('0x73')]('tq.TeamId')[_0x9cb7('0x74')](_0x9cb7('0x75'),'tq')[_0x9cb7('0x76')](_0x9cb7('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x9cb7('0x78'),_0x173cef[_0x9cb7('0x4c')]['id']);for(var _0x37946b=0x0;_0x37946b<_0xddf1c2[_0x9cb7('0x3f')];_0x37946b+=0x1){let _0x4351b6=_0xddf1c2[_0x37946b];for(var _0x424e93=0x0;_0x424e93<_0x4351b6[_0x9cb7('0x6d')]['length'];_0x424e93+=0x1){let _0x19a243=_0x4351b6[_0x9cb7('0x6d')][_0x424e93];var _0x9fcb61=_0x3809c5[_0x9cb7('0x79')]();_0x9fcb61[_0x9cb7('0x43')](_0x9cb7('0x7a'),_0x19a243['id']);_0x3b6615[_0x9cb7('0x7b')](db[_0x9cb7('0x6e')][_0x9cb7('0x39')](_0x9fcb61[_0x9cb7('0x7c')](),{'type':db[_0x9cb7('0x6e')][_0x9cb7('0x7d')][_0x9cb7('0x7e')]})[_0x9cb7('0x28')](function(_0x401478){if(_0x401478[_0x9cb7('0x3f')]===0x1){return _0x19a243['id'];}else{var _0x251561=_['every'](_[_0x9cb7('0x32')](_0x401478,_0x9cb7('0x7f')),function(_0x25ce46){return _[_0x9cb7('0x80')](_0x3d04e5,_0x25ce46);});if(_0x251561){return _0x19a243['id'];}}}));}}return BPromise[_0x9cb7('0x81')](_0x3b6615)[_0x9cb7('0x28')](function(_0x27fd47){_0x2b0d66=_(_0x2b0d66)['union'](_0x27fd47)[_0x9cb7('0x82')]()[_0x9cb7('0x83')]();return db[_0x9cb7('0x33')][_0x9cb7('0x4e')]({'where':{'id':_0x173cef['params']['id']}})['then'](function(_0x3126a3){return db['sequelize'][_0x9cb7('0x84')](function(_0x14a7c5){return _0x3126a3[_0x9cb7('0x85')](_0x173cef[_0x9cb7('0x39')][_0x9cb7('0x71')],{'transaction':_0x14a7c5})[_0x9cb7('0x28')](function(){if(!_['isEmpty'](_0x2b0d66)){return _0x3126a3[_0x9cb7('0x86')](_0x2b0d66,{'transaction':_0x14a7c5});}})[_0x9cb7('0x28')](function(){_0x2b0d66['forEach'](function(_0x2d7843){socket[_0x9cb7('0x87')](_0x9cb7('0x88'),{'UserId':_0x2d7843,'MailQueueId':_0x3126a3['id']});});});});});});})[_0x9cb7('0x28')](respondWithStatusCode(_0x36e2cc,null))[_0x9cb7('0x4b')](handleError(_0x36e2cc,null));};exports[_0x9cb7('0x89')]=function(_0x478ef7,_0x3271a3,_0x180d4a){return db[_0x9cb7('0x33')]['find']({'where':{'id':_0x478ef7[_0x9cb7('0x4c')]['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x3271a3,null))[_0x9cb7('0x28')](function(_0x2d045e){if(_0x2d045e){return _0x2d045e[_0x9cb7('0x89')](_0x478ef7[_0x9cb7('0x50')][_0x9cb7('0x71')],_['omit'](_0x478ef7[_0x9cb7('0x50')],[_0x9cb7('0x71'),'id'])||{})['spread'](function(_0x5cd64f){for(var _0x6e16b6=0x0;_0x6e16b6<_0x478ef7[_0x9cb7('0x50')]['ids'][_0x9cb7('0x3f')];_0x6e16b6+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x478ef7['body']['ids'][_0x6e16b6],'MailQueueId':_0x478ef7['params']['id']});}return _0x5cd64f;});}})[_0x9cb7('0x28')](respondWithResult(_0x3271a3,null))[_0x9cb7('0x4b')](handleError(_0x3271a3,null));};exports[_0x9cb7('0x86')]=function(_0x4c7289,_0x4dcb53,_0x518f7e){return db[_0x9cb7('0x33')][_0x9cb7('0x4e')]({'where':{'id':_0x4c7289[_0x9cb7('0x4c')]['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x4dcb53,null))[_0x9cb7('0x28')](function(_0x54fe54){if(_0x54fe54){return _0x54fe54[_0x9cb7('0x86')](_0x4c7289[_0x9cb7('0x39')][_0x9cb7('0x71')])['then'](function(){if(_[_0x9cb7('0x8a')](_0x4c7289[_0x9cb7('0x39')][_0x9cb7('0x71')])){for(var _0x3a89c7=0x0;_0x3a89c7<_0x4c7289['query'][_0x9cb7('0x71')][_0x9cb7('0x3f')];_0x3a89c7+=0x1){socket[_0x9cb7('0x87')](_0x9cb7('0x88'),{'UserId':Number(_0x4c7289[_0x9cb7('0x39')][_0x9cb7('0x71')][_0x3a89c7]),'MailQueueId':Number(_0x4c7289[_0x9cb7('0x4c')]['id'])});}}else{socket[_0x9cb7('0x87')](_0x9cb7('0x88'),{'UserId':Number(_0x4c7289['query'][_0x9cb7('0x71')]),'MailQueueId':Number(_0x4c7289['params']['id'])});}});}})[_0x9cb7('0x28')](respondWithStatusCode(_0x4dcb53,null))[_0x9cb7('0x4b')](handleError(_0x4dcb53,null));};exports[_0x9cb7('0x8b')]=function(_0x58c1eb,_0x492541,_0x3e6df8){var _0x4605b4={};var _0x313fa3={};var _0x4e1612;var _0x55f0a9;return db['MailQueue'][_0x9cb7('0x64')]({'where':{'id':_0x58c1eb['params']['id']}})[_0x9cb7('0x28')](handleEntityNotFound(_0x492541,null))[_0x9cb7('0x28')](function(_0x5dc4cb){if(_0x5dc4cb){_0x4e1612=_0x5dc4cb;_0x313fa3[_0x9cb7('0x38')]=_[_0x9cb7('0x3a')](db[_0x9cb7('0x68')][_0x9cb7('0x34')]);_0x313fa3[_0x9cb7('0x39')]=_[_0x9cb7('0x3a')](_0x58c1eb[_0x9cb7('0x39')]);_0x313fa3[_0x9cb7('0x3b')]=_[_0x9cb7('0x3c')](_0x313fa3[_0x9cb7('0x38')],_0x313fa3['query']);_0x4605b4['attributes']=_[_0x9cb7('0x3c')](_0x313fa3['model'],qs[_0x9cb7('0x3d')](_0x58c1eb[_0x9cb7('0x39')][_0x9cb7('0x3d')]));_0x4605b4[_0x9cb7('0x3e')]=_0x4605b4[_0x9cb7('0x3e')]['length']?_0x4605b4[_0x9cb7('0x3e')]:_0x313fa3['model'];_0x4605b4['order']=qs[_0x9cb7('0x5a')](_0x58c1eb[_0x9cb7('0x39')][_0x9cb7('0x5a')]);_0x4605b4[_0x9cb7('0x43')]=qs[_0x9cb7('0x3b')](_[_0x9cb7('0x44')](_0x58c1eb[_0x9cb7('0x39')],_0x313fa3[_0x9cb7('0x3b')]));if(_0x58c1eb[_0x9cb7('0x39')][_0x9cb7('0x47')]){_0x4605b4[_0x9cb7('0x43')]=_[_0x9cb7('0x45')](_0x4605b4[_0x9cb7('0x43')],{'$or':_['map'](_0x4605b4[_0x9cb7('0x3e')],function(_0x39115e){var _0x4ff2f6={};_0x4ff2f6[_0x39115e]={'$like':'%'+_0x58c1eb[_0x9cb7('0x39')][_0x9cb7('0x47')]+'%'};return _0x4ff2f6;})});}_0x4605b4=_[_0x9cb7('0x45')]({},_0x4605b4,_0x58c1eb[_0x9cb7('0x48')]);return _0x4e1612[_0x9cb7('0x8b')](_0x4605b4);}})['then'](function(_0x473df2){if(_0x473df2){_0x55f0a9=_0x473df2[_0x9cb7('0x3f')];if(!_0x58c1eb['query'][_0x9cb7('0x40')](_0x9cb7('0x59'))){_0x4605b4['limit']=qs[_0x9cb7('0x41')](_0x58c1eb[_0x9cb7('0x39')]['limit']);_0x4605b4['offset']=qs[_0x9cb7('0x22')](_0x58c1eb[_0x9cb7('0x39')][_0x9cb7('0x22')]);}return _0x4e1612[_0x9cb7('0x8b')](_0x4605b4);}})['then'](function(_0x4f918d){if(_0x4f918d){return _0x4f918d?{'count':_0x55f0a9,'rows':_0x4f918d}:null;}})[_0x9cb7('0x28')](respondWithResult(_0x492541,null))[_0x9cb7('0x4b')](handleError(_0x492541,null));}; \ No newline at end of file +var _0xd4e0=['json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','MailQueues','UserProfileResource','sendStatus','error','stack','name','send','MailQueue','rawAttributes','fieldName','type','key','map','query','keys','filters','attributes','intersection','model','fields','length','hasOwnProperty','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','catch','show','params','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserMailQueue','nolimit','sort','MailQueueId','findAll','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','mailPause','getTeams','Team','Agents','online','voicePause','interface','flatMap','sequelize','transaction','addTeams','each','findOrCreate','forEach','emit','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','MailQueueId\x20=\x20?','ut.UserId\x20=\x20?','toString','SELECT','every','includes','all','union','compact','value','removeTeams','ids','isEmpty','userMailQueue:remove','addAgents','omit','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','squel','crypto','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','defaults','redis','localhost','register','status','end'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0xd4e0,0x194));var _0x0d4e=function(_0x3d64c7,_0x56090c){_0x3d64c7=_0x3d64c7-0x0;var _0x148544=_0xd4e0[_0x3d64c7];return _0x148544;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d4e('0x0'));var rimraf=require(_0x0d4e('0x1'));var zipdir=require(_0x0d4e('0x2'));var jsonpatch=require(_0x0d4e('0x3'));var rp=require(_0x0d4e('0x4'));var moment=require(_0x0d4e('0x5'));var BPromise=require(_0x0d4e('0x6'));var Mustache=require(_0x0d4e('0x7'));var util=require(_0x0d4e('0x8'));var path=require('path');var sox=require(_0x0d4e('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x0d4e('0xa'));var squel=require(_0x0d4e('0xb'));var crypto=require(_0x0d4e('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x0d4e('0xd'));var querystring=require(_0x0d4e('0xe'));var Papa=require('papaparse');var Redis=require(_0x0d4e('0xf'));var authService=require(_0x0d4e('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0d4e('0x11'));var logger=require(_0x0d4e('0x12'))(_0x0d4e('0x13'));var utils=require(_0x0d4e('0x14'));var config=require(_0x0d4e('0x15'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x0d4e('0x16')](config[_0x0d4e('0x17')],{'host':_0x0d4e('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x0d4e('0x17')]));require('./mailQueue.socket')[_0x0d4e('0x19')](socket);function respondWithStatusCode(_0xfdeb57,_0x17cc99){_0x17cc99=_0x17cc99||0xcc;return function(_0x5df2a6){if(_0x5df2a6){return _0xfdeb57['sendStatus'](_0x17cc99);}return _0xfdeb57[_0x0d4e('0x1a')](_0x17cc99)[_0x0d4e('0x1b')]();};}function respondWithResult(_0x4dab9a,_0x535b67){_0x535b67=_0x535b67||0xc8;return function(_0x33cbcd){if(_0x33cbcd){return _0x4dab9a['status'](_0x535b67)[_0x0d4e('0x1c')](_0x33cbcd);}};}function respondWithFilteredResult(_0x1139d1,_0xdc5772){return function(_0x1393b0){if(_0x1393b0){var _0x58c1ec=_0x1393b0[_0x0d4e('0x1d')],_0x242531=_0xdc5772[_0x0d4e('0x1e')],_0xfc6a92=_0xdc5772[_0x0d4e('0x1e')]+_0xdc5772[_0x0d4e('0x1f')],_0x4ccf68;if(_0xfc6a92>=_0x58c1ec){_0xfc6a92=_0x58c1ec;_0x4ccf68=0xc8;}else{_0x4ccf68=0xce;}_0x1139d1[_0x0d4e('0x1a')](_0x4ccf68);return _0x1139d1[_0x0d4e('0x20')](_0x0d4e('0x21'),_0x242531+'-'+_0xfc6a92+'/'+_0x58c1ec)[_0x0d4e('0x1c')](_0x1393b0);}return null;};}function patchUpdates(_0x38edfb){return function(_0x430b1d){try{jsonpatch[_0x0d4e('0x22')](_0x430b1d,_0x38edfb,!![]);}catch(_0x3834a2){return BPromise[_0x0d4e('0x23')](_0x3834a2);}return _0x430b1d[_0x0d4e('0x24')]();};}function saveUpdates(_0x5e2c6b,_0x32d645){return function(_0x18728d){if(_0x18728d){return _0x18728d[_0x0d4e('0x25')](_0x5e2c6b)[_0x0d4e('0x26')](function(_0x4f07a9){return _0x4f07a9;});}return null;};}function removeEntity(_0x36820e,_0x7faff4){return function(_0x1f8068){if(_0x1f8068){return _0x1f8068[_0x0d4e('0x27')]()['then'](function(){var _0x57d86e=_0x1f8068['get']({'plain':!![]});var _0x584154=_0x0d4e('0x28');return db[_0x0d4e('0x29')]['destroy']({'where':{'type':_0x584154,'resourceId':_0x57d86e['id']}})[_0x0d4e('0x26')](function(){return _0x1f8068;});})['then'](function(){_0x36820e[_0x0d4e('0x1a')](0xcc)[_0x0d4e('0x1b')]();});}};}function handleEntityNotFound(_0x484490,_0x2a8974){return function(_0x5a6122){if(!_0x5a6122){_0x484490[_0x0d4e('0x2a')](0x194);}return _0x5a6122;};}function handleError(_0x5162b5,_0x4992d0){_0x4992d0=_0x4992d0||0x1f4;return function(_0xe17930){logger[_0x0d4e('0x2b')](_0xe17930[_0x0d4e('0x2c')]);if(_0xe17930[_0x0d4e('0x2d')]){delete _0xe17930['name'];}_0x5162b5[_0x0d4e('0x1a')](_0x4992d0)[_0x0d4e('0x2e')](_0xe17930);};}exports['index']=function(_0x2fbedd,_0x795f1c){var _0x209fd4={},_0x409756={},_0x482e49={'count':0x0,'rows':[]};var _0x51410a=_['map'](db[_0x0d4e('0x2f')][_0x0d4e('0x30')],function(_0x3bf118){return{'name':_0x3bf118[_0x0d4e('0x31')],'type':_0x3bf118[_0x0d4e('0x32')][_0x0d4e('0x33')]};});_0x409756['model']=_[_0x0d4e('0x34')](_0x51410a,'name');_0x409756[_0x0d4e('0x35')]=_[_0x0d4e('0x36')](_0x2fbedd[_0x0d4e('0x35')]);_0x409756[_0x0d4e('0x37')]=_['intersection'](_0x409756['model'],_0x409756['query']);_0x209fd4[_0x0d4e('0x38')]=_[_0x0d4e('0x39')](_0x409756[_0x0d4e('0x3a')],qs['fields'](_0x2fbedd['query'][_0x0d4e('0x3b')]));_0x209fd4[_0x0d4e('0x38')]=_0x209fd4[_0x0d4e('0x38')][_0x0d4e('0x3c')]?_0x209fd4[_0x0d4e('0x38')]:_0x409756[_0x0d4e('0x3a')];if(!_0x2fbedd[_0x0d4e('0x35')][_0x0d4e('0x3d')]('nolimit')){_0x209fd4[_0x0d4e('0x1f')]=qs[_0x0d4e('0x1f')](_0x2fbedd['query']['limit']);_0x209fd4[_0x0d4e('0x1e')]=qs[_0x0d4e('0x1e')](_0x2fbedd['query'][_0x0d4e('0x1e')]);}_0x209fd4[_0x0d4e('0x3e')]=qs['sort'](_0x2fbedd['query']['sort']);_0x209fd4[_0x0d4e('0x3f')]=qs[_0x0d4e('0x37')](_[_0x0d4e('0x40')](_0x2fbedd[_0x0d4e('0x35')],_0x409756['filters']));if(_0x2fbedd[_0x0d4e('0x35')][_0x0d4e('0x41')]){_0x209fd4[_0x0d4e('0x3f')]=_[_0x0d4e('0x42')](_0x209fd4[_0x0d4e('0x3f')],{'$or':_[_0x0d4e('0x34')](_0x51410a,function(_0x1726ea){if(_0x1726ea['type']!==_0x0d4e('0x43')){var _0x42871f={};_0x42871f[_0x1726ea[_0x0d4e('0x2d')]]={'$like':'%'+_0x2fbedd[_0x0d4e('0x35')][_0x0d4e('0x41')]+'%'};return _0x42871f;}})});}_0x209fd4=_[_0x0d4e('0x42')]({},_0x209fd4,_0x2fbedd[_0x0d4e('0x44')]);var _0x3dfa06={'where':_0x209fd4[_0x0d4e('0x3f')]};return db[_0x0d4e('0x2f')]['count'](_0x3dfa06)['then'](function(_0x4e8906){_0x482e49[_0x0d4e('0x1d')]=_0x4e8906;if(_0x2fbedd[_0x0d4e('0x35')][_0x0d4e('0x45')]){_0x209fd4[_0x0d4e('0x46')]=[{'all':!![]}];}return db[_0x0d4e('0x2f')]['findAll'](_0x209fd4);})[_0x0d4e('0x26')](function(_0x27e7e7){_0x482e49['rows']=_0x27e7e7;return _0x482e49;})['then'](respondWithFilteredResult(_0x795f1c,_0x209fd4))[_0x0d4e('0x47')](handleError(_0x795f1c,null));};exports[_0x0d4e('0x48')]=function(_0x2d0232,_0x4a9111){var _0x2c78c7={'raw':!![],'where':{'id':_0x2d0232[_0x0d4e('0x49')]['id']}},_0x4816d7={};_0x4816d7['model']=_[_0x0d4e('0x36')](db[_0x0d4e('0x2f')][_0x0d4e('0x30')]);_0x4816d7[_0x0d4e('0x35')]=_[_0x0d4e('0x36')](_0x2d0232[_0x0d4e('0x35')]);_0x4816d7[_0x0d4e('0x37')]=_[_0x0d4e('0x39')](_0x4816d7[_0x0d4e('0x3a')],_0x4816d7[_0x0d4e('0x35')]);_0x2c78c7[_0x0d4e('0x38')]=_['intersection'](_0x4816d7['model'],qs['fields'](_0x2d0232[_0x0d4e('0x35')][_0x0d4e('0x3b')]));_0x2c78c7[_0x0d4e('0x38')]=_0x2c78c7[_0x0d4e('0x38')][_0x0d4e('0x3c')]?_0x2c78c7['attributes']:_0x4816d7['model'];if(_0x2d0232[_0x0d4e('0x35')][_0x0d4e('0x45')]){_0x2c78c7[_0x0d4e('0x46')]=[{'all':!![]}];}_0x2c78c7=_[_0x0d4e('0x42')]({},_0x2c78c7,_0x2d0232['options']);return db[_0x0d4e('0x2f')][_0x0d4e('0x4a')](_0x2c78c7)[_0x0d4e('0x26')](handleEntityNotFound(_0x4a9111,null))[_0x0d4e('0x26')](respondWithResult(_0x4a9111,null))['catch'](handleError(_0x4a9111,null));};exports[_0x0d4e('0x4b')]=function(_0x5aee71,_0x251f68){return db[_0x0d4e('0x2f')]['create'](_0x5aee71[_0x0d4e('0x4c')],{})[_0x0d4e('0x26')](function(_0x1ae869){var _0x208a80=_0x5aee71[_0x0d4e('0x4d')][_0x0d4e('0x4e')]({'plain':!![]});if(!_0x208a80)throw new Error(_0x0d4e('0x4f'));if(_0x208a80[_0x0d4e('0x50')]===_0x0d4e('0x4d')){var _0x140374=_0x1ae869[_0x0d4e('0x4e')]({'plain':!![]});var _0x278cb2=_0x0d4e('0x28');return db[_0x0d4e('0x51')]['find']({'where':{'name':_0x278cb2,'userProfileId':_0x208a80[_0x0d4e('0x52')]},'raw':!![]})[_0x0d4e('0x26')](function(_0x164ebe){if(_0x164ebe&&_0x164ebe[_0x0d4e('0x53')]===0x0){return db[_0x0d4e('0x29')][_0x0d4e('0x4b')]({'name':_0x140374['name'],'resourceId':_0x140374['id'],'type':_0x164ebe[_0x0d4e('0x2d')],'sectionId':_0x164ebe['id']},{})[_0x0d4e('0x26')](function(){return _0x1ae869;});}else{return _0x1ae869;}})[_0x0d4e('0x47')](function(_0x26fc80){logger[_0x0d4e('0x2b')](_0x0d4e('0x54'),_0x26fc80);throw _0x26fc80;});}return _0x1ae869;})[_0x0d4e('0x26')](respondWithResult(_0x251f68,0xc9))[_0x0d4e('0x47')](handleError(_0x251f68,null));};exports['update']=function(_0x5551c6,_0x168ef9){if(_0x5551c6[_0x0d4e('0x4c')]['id']){delete _0x5551c6[_0x0d4e('0x4c')]['id'];}return db[_0x0d4e('0x2f')][_0x0d4e('0x4a')]({'where':{'id':_0x5551c6['params']['id']}})[_0x0d4e('0x26')](handleEntityNotFound(_0x168ef9,null))[_0x0d4e('0x26')](saveUpdates(_0x5551c6[_0x0d4e('0x4c')],null))[_0x0d4e('0x26')](respondWithResult(_0x168ef9,null))[_0x0d4e('0x47')](handleError(_0x168ef9,null));};exports[_0x0d4e('0x27')]=function(_0x26a8d3,_0x61ce0e){return db['MailQueue'][_0x0d4e('0x4a')]({'where':{'id':_0x26a8d3['params']['id']}})[_0x0d4e('0x26')](handleEntityNotFound(_0x61ce0e,null))[_0x0d4e('0x26')](removeEntity(_0x61ce0e,null))[_0x0d4e('0x47')](handleError(_0x61ce0e,null));};exports[_0x0d4e('0x55')]=function(_0xc2a63,_0x48c2d5){return db[_0x0d4e('0x2f')][_0x0d4e('0x55')]()['then'](respondWithResult(_0x48c2d5,null))[_0x0d4e('0x47')](handleError(_0x48c2d5,null));};exports[_0x0d4e('0x56')]=function(_0x5a7548,_0x1f3cc3,_0x2305d1){var _0x5df7c5={'raw':!![],'where':{}},_0x432d66={},_0x5131c7;return db[_0x0d4e('0x2f')][_0x0d4e('0x57')]({'where':{'id':_0x5a7548[_0x0d4e('0x49')]['id']}})[_0x0d4e('0x26')](handleEntityNotFound(_0x1f3cc3,null))[_0x0d4e('0x26')](function(_0x26e210){if(_0x26e210){_0x5131c7=_0x26e210[_0x0d4e('0x4e')]({'plain':!![]});_0x432d66[_0x0d4e('0x3a')]=_[_0x0d4e('0x36')](db[_0x0d4e('0x58')][_0x0d4e('0x30')]);_0x432d66[_0x0d4e('0x35')]=_[_0x0d4e('0x36')](_0x5a7548[_0x0d4e('0x35')]);_0x432d66[_0x0d4e('0x37')]=_[_0x0d4e('0x39')](_0x432d66[_0x0d4e('0x3a')],_0x432d66[_0x0d4e('0x35')]);_0x5df7c5['attributes']=_[_0x0d4e('0x39')](_0x432d66['model'],qs[_0x0d4e('0x3b')](_0x5a7548[_0x0d4e('0x35')]['fields']));_0x5df7c5[_0x0d4e('0x38')]=_0x5df7c5['attributes']['length']?_0x5df7c5[_0x0d4e('0x38')]:_0x432d66[_0x0d4e('0x3a')];if(!_0x5a7548[_0x0d4e('0x35')]['hasOwnProperty'](_0x0d4e('0x59'))){_0x5df7c5[_0x0d4e('0x1f')]=qs[_0x0d4e('0x1f')](_0x5a7548[_0x0d4e('0x35')][_0x0d4e('0x1f')]);_0x5df7c5[_0x0d4e('0x1e')]=qs[_0x0d4e('0x1e')](_0x5a7548[_0x0d4e('0x35')]['offset']);}_0x5df7c5[_0x0d4e('0x3e')]=qs[_0x0d4e('0x5a')](_0x5a7548[_0x0d4e('0x35')][_0x0d4e('0x5a')]);_0x5df7c5[_0x0d4e('0x3f')]=qs[_0x0d4e('0x37')](_[_0x0d4e('0x40')](_0x5a7548[_0x0d4e('0x35')],_0x432d66[_0x0d4e('0x37')]));_0x5df7c5[_0x0d4e('0x3f')][_0x0d4e('0x5b')]=_0x26e210['id'];if(_0x5a7548['query'][_0x0d4e('0x41')]){_0x5df7c5[_0x0d4e('0x3f')]=_[_0x0d4e('0x42')](_0x5df7c5['where'],{'$or':_[_0x0d4e('0x34')](_0x5df7c5[_0x0d4e('0x38')],function(_0x2d8b38){var _0x2f11aa={};_0x2f11aa[_0x2d8b38]={'$like':'%'+_0x5a7548[_0x0d4e('0x35')][_0x0d4e('0x41')]+'%'};return _0x2f11aa;})});}_0x5df7c5=_[_0x0d4e('0x42')]({},_0x5df7c5,_0x5a7548[_0x0d4e('0x44')]);return db[_0x0d4e('0x58')][_0x0d4e('0x5c')](_0x5df7c5);}})[_0x0d4e('0x26')](function(_0x2bb2ec){if(_0x2bb2ec){return db[_0x0d4e('0x5d')][_0x0d4e('0x5e')]({'where':{'id':_[_0x0d4e('0x34')](_0x2bb2ec,_0x0d4e('0x5f')),'role':_0x0d4e('0x60')},'attributes':['id',_0x0d4e('0x2d'),'mailPause',_0x0d4e('0x61'),_0x0d4e('0x62')]});}})[_0x0d4e('0x26')](function(_0xbdb810){if(_0xbdb810){return{'count':_0xbdb810[_0x0d4e('0x1d')],'rows':_[_0x0d4e('0x34')](_0xbdb810[_0x0d4e('0x63')],function(_0x3978c1){return{'membername':_0x3978c1[_0x0d4e('0x2d')],'UserId':_0x3978c1['id'],'queue_name':_0x5131c7[_0x0d4e('0x2d')],'MailQueueId':_0x5131c7['id'],'interface':util[_0x0d4e('0x64')]('%s/%s','SIP',_0x3978c1[_0x0d4e('0x2d')]),'penalty':0x0,'paused':_0x3978c1[_0x0d4e('0x65')],'createdAt':_0x3978c1[_0x0d4e('0x62')],'updatedAt':_0x3978c1[_0x0d4e('0x61')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x0d4e('0x26')](respondWithFilteredResult(_0x1f3cc3,_0x5df7c5))[_0x0d4e('0x47')](handleError(_0x1f3cc3,null));};exports[_0x0d4e('0x66')]=function(_0x496037,_0x1c68a3,_0xa11110){var _0x336921={};var _0x537e9e={};var _0x1bf2fb;var _0x56f8ed;return db[_0x0d4e('0x2f')][_0x0d4e('0x57')]({'where':{'id':_0x496037[_0x0d4e('0x49')]['id']}})['then'](handleEntityNotFound(_0x1c68a3,null))['then'](function(_0x5f0d65){if(_0x5f0d65){_0x1bf2fb=_0x5f0d65;_0x537e9e[_0x0d4e('0x3a')]=_['keys'](db[_0x0d4e('0x67')]['rawAttributes']);_0x537e9e['query']=_[_0x0d4e('0x36')](_0x496037[_0x0d4e('0x35')]);_0x537e9e[_0x0d4e('0x37')]=_[_0x0d4e('0x39')](_0x537e9e[_0x0d4e('0x3a')],_0x537e9e['query']);_0x336921[_0x0d4e('0x38')]=_[_0x0d4e('0x39')](_0x537e9e[_0x0d4e('0x3a')],qs[_0x0d4e('0x3b')](_0x496037[_0x0d4e('0x35')][_0x0d4e('0x3b')]));_0x336921['attributes']=_0x336921['attributes'][_0x0d4e('0x3c')]?_0x336921[_0x0d4e('0x38')]:_0x537e9e[_0x0d4e('0x3a')];_0x336921[_0x0d4e('0x3e')]=qs[_0x0d4e('0x5a')](_0x496037[_0x0d4e('0x35')]['sort']);_0x336921[_0x0d4e('0x3f')]=qs[_0x0d4e('0x37')](_[_0x0d4e('0x40')](_0x496037['query'],_0x537e9e['filters']));if(_0x496037[_0x0d4e('0x35')][_0x0d4e('0x41')]){_0x336921['where']=_[_0x0d4e('0x42')](_0x336921[_0x0d4e('0x3f')],{'$or':_[_0x0d4e('0x34')](_0x336921[_0x0d4e('0x38')],function(_0xded036){var _0x15dde5={};_0x15dde5[_0xded036]={'$like':'%'+_0x496037['query'][_0x0d4e('0x41')]+'%'};return _0x15dde5;})});}_0x336921=_[_0x0d4e('0x42')]({},_0x336921,_0x496037[_0x0d4e('0x44')]);return _0x1bf2fb[_0x0d4e('0x66')](_0x336921);}})[_0x0d4e('0x26')](function(_0x217599){if(_0x217599){_0x56f8ed=_0x217599[_0x0d4e('0x3c')];if(!_0x496037[_0x0d4e('0x35')][_0x0d4e('0x3d')](_0x0d4e('0x59'))){_0x336921[_0x0d4e('0x1f')]=qs[_0x0d4e('0x1f')](_0x496037['query'][_0x0d4e('0x1f')]);_0x336921[_0x0d4e('0x1e')]=qs['offset'](_0x496037[_0x0d4e('0x35')][_0x0d4e('0x1e')]);}return _0x1bf2fb[_0x0d4e('0x66')](_0x336921);}})[_0x0d4e('0x26')](function(_0x5af652){if(_0x5af652){return _0x5af652?{'count':_0x56f8ed,'rows':_0x5af652}:null;}})[_0x0d4e('0x26')](respondWithResult(_0x1c68a3,null))[_0x0d4e('0x47')](handleError(_0x1c68a3,null));};exports['addTeams']=function(_0x16839e,_0x1ba1b1,_0x167e2c){var _0x1837d0=_0x16839e[_0x0d4e('0x4c')]['ids'];return db[_0x0d4e('0x67')][_0x0d4e('0x5c')]({'where':{'id':_0x1837d0},'attributes':['id'],'include':[{'model':db[_0x0d4e('0x5d')],'as':_0x0d4e('0x68'),'attributes':['id',_0x0d4e('0x2d'),_0x0d4e('0x69'),_0x0d4e('0x6a'),_0x0d4e('0x6b')],'raw':!![]}]})[_0x0d4e('0x26')](function(_0x561935){if(_0x561935){var _0x4b307a=_[_0x0d4e('0x6c')](_0x561935,function(_0xcc2b68){var _0x1cce1e=_0xcc2b68['get']({'plain':!![]});return _0x1cce1e[_0x0d4e('0x68')];});return db['MailQueue'][_0x0d4e('0x4a')]({'where':{'id':_0x16839e[_0x0d4e('0x49')]['id']}})[_0x0d4e('0x26')](function(_0x23162b){return db[_0x0d4e('0x6d')][_0x0d4e('0x6e')](function(_0x51ae6d){return _0x23162b[_0x0d4e('0x6f')](_0x1837d0,{'transaction':_0x51ae6d})[_0x0d4e('0x26')](function(){return BPromise[_0x0d4e('0x70')](_0x4b307a,function(_0x131c91){return db[_0x0d4e('0x58')][_0x0d4e('0x71')]({'where':{'UserId':_0x131c91['id'],'MailQueueId':_0x16839e[_0x0d4e('0x49')]['id']},'transaction':_0x51ae6d});});})[_0x0d4e('0x26')](function(){_0x4b307a[_0x0d4e('0x72')](function(_0x37b3c9){socket[_0x0d4e('0x73')]('userMailQueue:save',{'UserId':_0x37b3c9['id'],'MailQueueId':_0x23162b['id']});});});});});}})[_0x0d4e('0x26')](respondWithStatusCode(_0x1ba1b1,null))[_0x0d4e('0x47')](handleError(_0x1ba1b1,null));};exports['removeTeams']=function(_0x2465e3,_0x4bc22c,_0x5e8d00){return db[_0x0d4e('0x67')]['findAll']({'where':{'id':_0x2465e3['query']['ids']},'attributes':['id'],'include':[{'model':db[_0x0d4e('0x5d')],'as':_0x0d4e('0x68'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x4bc22c,null))[_0x0d4e('0x26')](function(_0x2ba34a){var _0x4e1e80=_[_0x0d4e('0x34')](_0x2ba34a,'id');var _0x365c71=[];var _0x3b38fc=[];var _0xd88e4e=squel[_0x0d4e('0x74')]();_0xd88e4e[_0x0d4e('0x75')](_0x0d4e('0x76'))[_0x0d4e('0x77')](_0x0d4e('0x78'),'tq')[_0x0d4e('0x79')](_0x0d4e('0x7a'),'ut',_0x0d4e('0x7b'))[_0x0d4e('0x3f')](_0x0d4e('0x7c'),_0x2465e3['params']['id']);for(var _0x41398a=0x0;_0x41398a<_0x2ba34a['length'];_0x41398a+=0x1){let _0x2e399a=_0x2ba34a[_0x41398a];for(var _0x3f3836=0x0;_0x3f3836<_0x2e399a[_0x0d4e('0x68')][_0x0d4e('0x3c')];_0x3f3836+=0x1){let _0x209e6a=_0x2e399a[_0x0d4e('0x68')][_0x3f3836];var _0xe0a96b=_0xd88e4e['clone']();_0xe0a96b[_0x0d4e('0x3f')](_0x0d4e('0x7d'),_0x209e6a['id']);_0x3b38fc['push'](db['sequelize'][_0x0d4e('0x35')](_0xe0a96b[_0x0d4e('0x7e')](),{'type':db[_0x0d4e('0x6d')]['QueryTypes'][_0x0d4e('0x7f')]})[_0x0d4e('0x26')](function(_0xd89a8f){if(_0xd89a8f[_0x0d4e('0x3c')]===0x1){return _0x209e6a['id'];}else{var _0x27034a=_[_0x0d4e('0x80')](_[_0x0d4e('0x34')](_0xd89a8f,'TeamId'),function(_0x1f4326){return _[_0x0d4e('0x81')](_0x4e1e80,_0x1f4326);});if(_0x27034a){return _0x209e6a['id'];}}}));}}return BPromise[_0x0d4e('0x82')](_0x3b38fc)[_0x0d4e('0x26')](function(_0x618be5){_0x365c71=_(_0x365c71)[_0x0d4e('0x83')](_0x618be5)[_0x0d4e('0x84')]()[_0x0d4e('0x85')]();return db[_0x0d4e('0x2f')]['find']({'where':{'id':_0x2465e3[_0x0d4e('0x49')]['id']}})[_0x0d4e('0x26')](function(_0x59bbb9){return db['sequelize']['transaction'](function(_0x45dacb){return _0x59bbb9[_0x0d4e('0x86')](_0x2465e3[_0x0d4e('0x35')][_0x0d4e('0x87')],{'transaction':_0x45dacb})[_0x0d4e('0x26')](function(){if(!_[_0x0d4e('0x88')](_0x365c71)){return _0x59bbb9['removeAgents'](_0x365c71,{'transaction':_0x45dacb});}})[_0x0d4e('0x26')](function(){_0x365c71[_0x0d4e('0x72')](function(_0x433fe8){socket[_0x0d4e('0x73')](_0x0d4e('0x89'),{'UserId':_0x433fe8,'MailQueueId':_0x59bbb9['id']});});});});});});})[_0x0d4e('0x26')](respondWithStatusCode(_0x4bc22c,null))[_0x0d4e('0x47')](handleError(_0x4bc22c,null));};exports['addAgents']=function(_0x1cda52,_0x53c7fb,_0x30f54b){return db[_0x0d4e('0x2f')]['find']({'where':{'id':_0x1cda52[_0x0d4e('0x49')]['id']}})[_0x0d4e('0x26')](handleEntityNotFound(_0x53c7fb,null))[_0x0d4e('0x26')](function(_0x1c7e6f){if(_0x1c7e6f){return _0x1c7e6f[_0x0d4e('0x8a')](_0x1cda52[_0x0d4e('0x4c')][_0x0d4e('0x87')],_[_0x0d4e('0x8b')](_0x1cda52[_0x0d4e('0x4c')],[_0x0d4e('0x87'),'id'])||{})[_0x0d4e('0x8c')](function(_0x281e33){for(var _0x49cf7c=0x0;_0x49cf7c<_0x1cda52[_0x0d4e('0x4c')][_0x0d4e('0x87')][_0x0d4e('0x3c')];_0x49cf7c+=0x1){socket[_0x0d4e('0x73')]('userMailQueue:save',{'UserId':_0x1cda52[_0x0d4e('0x4c')][_0x0d4e('0x87')][_0x49cf7c],'MailQueueId':_0x1cda52[_0x0d4e('0x49')]['id']});}return _0x281e33;});}})[_0x0d4e('0x26')](respondWithResult(_0x53c7fb,null))[_0x0d4e('0x47')](handleError(_0x53c7fb,null));};exports['removeAgents']=function(_0x225d5d,_0x38aa93,_0x32eca4){return db[_0x0d4e('0x2f')]['find']({'where':{'id':_0x225d5d[_0x0d4e('0x49')]['id']}})[_0x0d4e('0x26')](handleEntityNotFound(_0x38aa93,null))[_0x0d4e('0x26')](function(_0x512522){if(_0x512522){return _0x512522[_0x0d4e('0x8d')](_0x225d5d[_0x0d4e('0x35')][_0x0d4e('0x87')])[_0x0d4e('0x26')](function(){if(_[_0x0d4e('0x8e')](_0x225d5d['query']['ids'])){for(var _0x2511f8=0x0;_0x2511f8<_0x225d5d[_0x0d4e('0x35')]['ids'][_0x0d4e('0x3c')];_0x2511f8+=0x1){socket['emit'](_0x0d4e('0x89'),{'UserId':Number(_0x225d5d[_0x0d4e('0x35')][_0x0d4e('0x87')][_0x2511f8]),'MailQueueId':Number(_0x225d5d['params']['id'])});}}else{socket['emit'](_0x0d4e('0x89'),{'UserId':Number(_0x225d5d[_0x0d4e('0x35')][_0x0d4e('0x87')]),'MailQueueId':Number(_0x225d5d[_0x0d4e('0x49')]['id'])});}});}})[_0x0d4e('0x26')](respondWithStatusCode(_0x38aa93,null))[_0x0d4e('0x47')](handleError(_0x38aa93,null));};exports[_0x0d4e('0x8f')]=function(_0x285caf,_0x299a9e,_0x40ea34){var _0x28827b={};var _0x277f80={};var _0x584ba4;var _0x1db531;return db[_0x0d4e('0x2f')][_0x0d4e('0x57')]({'where':{'id':_0x285caf[_0x0d4e('0x49')]['id']}})['then'](handleEntityNotFound(_0x299a9e,null))[_0x0d4e('0x26')](function(_0x13744b){if(_0x13744b){_0x584ba4=_0x13744b;_0x277f80[_0x0d4e('0x3a')]=_['keys'](db['User'][_0x0d4e('0x30')]);_0x277f80['query']=_[_0x0d4e('0x36')](_0x285caf[_0x0d4e('0x35')]);_0x277f80[_0x0d4e('0x37')]=_[_0x0d4e('0x39')](_0x277f80[_0x0d4e('0x3a')],_0x277f80[_0x0d4e('0x35')]);_0x28827b[_0x0d4e('0x38')]=_['intersection'](_0x277f80[_0x0d4e('0x3a')],qs[_0x0d4e('0x3b')](_0x285caf[_0x0d4e('0x35')][_0x0d4e('0x3b')]));_0x28827b['attributes']=_0x28827b[_0x0d4e('0x38')][_0x0d4e('0x3c')]?_0x28827b[_0x0d4e('0x38')]:_0x277f80[_0x0d4e('0x3a')];_0x28827b[_0x0d4e('0x3e')]=qs[_0x0d4e('0x5a')](_0x285caf[_0x0d4e('0x35')][_0x0d4e('0x5a')]);_0x28827b['where']=qs[_0x0d4e('0x37')](_[_0x0d4e('0x40')](_0x285caf['query'],_0x277f80[_0x0d4e('0x37')]));if(_0x285caf[_0x0d4e('0x35')][_0x0d4e('0x41')]){_0x28827b[_0x0d4e('0x3f')]=_[_0x0d4e('0x42')](_0x28827b[_0x0d4e('0x3f')],{'$or':_[_0x0d4e('0x34')](_0x28827b[_0x0d4e('0x38')],function(_0x4e44c3){var _0x263170={};_0x263170[_0x4e44c3]={'$like':'%'+_0x285caf['query'][_0x0d4e('0x41')]+'%'};return _0x263170;})});}_0x28827b=_[_0x0d4e('0x42')]({},_0x28827b,_0x285caf['options']);return _0x584ba4['getAgents'](_0x28827b);}})['then'](function(_0x295065){if(_0x295065){_0x1db531=_0x295065[_0x0d4e('0x3c')];if(!_0x285caf[_0x0d4e('0x35')][_0x0d4e('0x3d')]('nolimit')){_0x28827b['limit']=qs[_0x0d4e('0x1f')](_0x285caf['query']['limit']);_0x28827b[_0x0d4e('0x1e')]=qs[_0x0d4e('0x1e')](_0x285caf['query'][_0x0d4e('0x1e')]);}return _0x584ba4[_0x0d4e('0x8f')](_0x28827b);}})[_0x0d4e('0x26')](function(_0x1c45e0){if(_0x1c45e0){return _0x1c45e0?{'count':_0x1db531,'rows':_0x1c45e0}:null;}})[_0x0d4e('0x26')](respondWithResult(_0x299a9e,null))[_0x0d4e('0x47')](handleError(_0x299a9e,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index b8a8088..d619c2f 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 _0x51d4=['exports','events','update','remove','emit','hook'];(function(_0x21c80a,_0x275d41){var _0x4a7719=function(_0xffe07b){while(--_0xffe07b){_0x21c80a['push'](_0x21c80a['shift']());}};_0x4a7719(++_0x275d41);}(_0x51d4,0xc1));var _0x451d=function(_0x28588b,_0x4d895b){_0x28588b=_0x28588b-0x0;var _0xea1489=_0x51d4[_0x28588b];return _0xea1489;};'use strict';var EventEmitter=require(_0x451d('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x451d('0x1'),'afterDestroy':_0x451d('0x2')};function emitEvent(_0x5ae7c6){return function(_0x4ce4af,_0x44b76e,_0x5dd734){MailQueueEvents[_0x451d('0x3')](_0x5ae7c6+':'+_0x4ce4af['id'],_0x4ce4af);MailQueueEvents['emit'](_0x5ae7c6,_0x4ce4af);_0x5dd734(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailQueue[_0x451d('0x4')](e,emitEvent(event));}}module[_0x451d('0x5')]=MailQueueEvents; \ No newline at end of file +var _0xbf2e=['events','../../mysqldb','MailQueue','setMaxListeners','emit','hasOwnProperty'];(function(_0x328b88,_0xec34fb){var _0x48d832=function(_0xf2a3a5){while(--_0xf2a3a5){_0x328b88['push'](_0x328b88['shift']());}};_0x48d832(++_0xec34fb);}(_0xbf2e,0x1d4));var _0xebf2=function(_0x589327,_0x37d52b){_0x589327=_0x589327-0x0;var _0x2c84af=_0xbf2e[_0x589327];return _0x2c84af;};'use strict';var EventEmitter=require(_0xebf2('0x0'));var MailQueue=require(_0xebf2('0x1'))['db'][_0xebf2('0x2')];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0xebf2('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x42a424){return function(_0x41b0d,_0x1a1126,_0x541ff3){MailQueueEvents[_0xebf2('0x4')](_0x42a424+':'+_0x41b0d['id'],_0x41b0d);MailQueueEvents[_0xebf2('0x4')](_0x42a424,_0x41b0d);_0x541ff3(null);};}for(var e in events){if(events[_0xebf2('0x5')](e)){var event=events[e];MailQueue['hook'](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 c5545a9..0e5d099 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 _0xb41d=['define','MailQueue','mail_queues','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x13e726,_0x337e72){var _0x566174=function(_0x2b0668){while(--_0x2b0668){_0x13e726['push'](_0x13e726['shift']());}};_0x566174(++_0x337e72);}(_0xb41d,0x155));var _0xdb41=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xb41d[_0x5a79e2];return _0x266c45;};'use strict';var _=require(_0xdb41('0x0'));var util=require(_0xdb41('0x1'));var logger=require('../../config/logger')(_0xdb41('0x2'));var moment=require(_0xdb41('0x3'));var BPromise=require(_0xdb41('0x4'));var rp=require(_0xdb41('0x5'));var fs=require('fs');var path=require(_0xdb41('0x6'));var rimraf=require(_0xdb41('0x7'));var config=require(_0xdb41('0x8'));var attributes=require('./mailQueue.attributes');module[_0xdb41('0x9')]=function(_0x279441,_0x4a23ec){return _0x279441[_0xdb41('0xa')](_0xdb41('0xb'),attributes,{'tableName':_0xdb41('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x41a6=['./mailQueue.attributes','exports','define','MailQueue','mail_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x41a6,0x163));var _0x641a=function(_0x941268,_0x152948){_0x941268=_0x941268-0x0;var _0x19f905=_0x41a6[_0x941268];return _0x19f905;};'use strict';var _=require(_0x641a('0x0'));var util=require(_0x641a('0x1'));var logger=require(_0x641a('0x2'))(_0x641a('0x3'));var moment=require(_0x641a('0x4'));var BPromise=require(_0x641a('0x5'));var rp=require(_0x641a('0x6'));var fs=require('fs');var path=require(_0x641a('0x7'));var rimraf=require(_0x641a('0x8'));var config=require('../../config/environment');var attributes=require(_0x641a('0x9'));module[_0x641a('0xa')]=function(_0x478317,_0x3a3434){return _0x478317[_0x641a('0xb')](_0x641a('0xc'),attributes,{'tableName':_0x641a('0xd'),'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 a20247c..1aac872 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 _0x8c66=['attributes','include','map','model','ShowMailQueue','find','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./mailQueue.socket','request','then','info','MailQueue,\x20%s,\x20%s','debug','stringify','error','code','message','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where'];(function(_0x3a3e38,_0x3d38c5){var _0x254943=function(_0x4417bd){while(--_0x4417bd){_0x3a3e38['push'](_0x3a3e38['shift']());}};_0x254943(++_0x3d38c5);}(_0x8c66,0x78));var _0x68c6=function(_0x31548e,_0x590a05){_0x31548e=_0x31548e-0x0;var _0x201187=_0x8c66[_0x31548e];return _0x201187;};'use strict';var _=require(_0x68c6('0x0'));var util=require(_0x68c6('0x1'));var moment=require('moment');var BPromise=require(_0x68c6('0x2'));var rs=require(_0x68c6('0x3'));var fs=require('fs');var Redis=require(_0x68c6('0x4'));var db=require(_0x68c6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x68c6('0x6'));var config=require(_0x68c6('0x7'));var jayson=require(_0x68c6('0x8'));var client=jayson[_0x68c6('0x9')][_0x68c6('0xa')]({'port':0x232a});config[_0x68c6('0xb')]=_['defaults'](config[_0x68c6('0xb')],{'host':_0x68c6('0xc'),'port':0x18eb});var socket=require(_0x68c6('0xd'))(new Redis(config[_0x68c6('0xb')]));require(_0x68c6('0xe'))['register'](socket);function respondWithRpcPromise(_0x12cc43,_0x994314,_0x51d1d2){return new BPromise(function(_0x492cba,_0x42b6ae){return client[_0x68c6('0xf')](_0x12cc43,_0x51d1d2)[_0x68c6('0x10')](function(_0x10ef92){logger[_0x68c6('0x11')](_0x68c6('0x12'),_0x994314,'request\x20sent');logger[_0x68c6('0x13')]('MailQueue,\x20%s,\x20%s,\x20%s',_0x994314,'request\x20sent',JSON[_0x68c6('0x14')](_0x10ef92));if(_0x10ef92[_0x68c6('0x15')]){if(_0x10ef92[_0x68c6('0x15')][_0x68c6('0x16')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x994314,_0x10ef92[_0x68c6('0x15')][_0x68c6('0x17')]);return _0x42b6ae(_0x10ef92[_0x68c6('0x15')][_0x68c6('0x17')]);}logger[_0x68c6('0x15')](_0x68c6('0x12'),_0x994314,_0x10ef92[_0x68c6('0x15')]['message']);return _0x492cba(_0x10ef92[_0x68c6('0x15')][_0x68c6('0x17')]);}else{logger['info'](_0x68c6('0x12'),_0x994314,'request\x20sent');_0x492cba(_0x10ef92[_0x68c6('0x18')][_0x68c6('0x17')]);}})[_0x68c6('0x19')](function(_0x2d7cac){logger['error'](_0x68c6('0x12'),_0x994314,_0x2d7cac);_0x42b6ae(_0x2d7cac);});});}exports[_0x68c6('0x1a')]=function(_0x4eaf21){var _0x594afd=this;return new Promise(function(_0xd1fe6c,_0x54d5d0){return db[_0x68c6('0x1b')][_0x68c6('0x1c')]({'raw':_0x4eaf21[_0x68c6('0x1d')]?_0x4eaf21[_0x68c6('0x1d')][_0x68c6('0x1e')]===undefined?!![]:![]:!![],'where':_0x4eaf21[_0x68c6('0x1d')]?_0x4eaf21['options'][_0x68c6('0x1f')]||null:null,'attributes':_0x4eaf21[_0x68c6('0x1d')]?_0x4eaf21[_0x68c6('0x1d')][_0x68c6('0x20')]||null:null,'limit':_0x4eaf21[_0x68c6('0x1d')]?_0x4eaf21[_0x68c6('0x1d')]['limit']||null:null,'include':_0x4eaf21[_0x68c6('0x1d')]?_0x4eaf21[_0x68c6('0x1d')][_0x68c6('0x21')]?_[_0x68c6('0x22')](_0x4eaf21[_0x68c6('0x1d')]['include'],function(_0x35f57b){return{'model':db[_0x35f57b[_0x68c6('0x23')]],'as':_0x35f57b['as'],'attributes':_0x35f57b[_0x68c6('0x20')],'include':_0x35f57b[_0x68c6('0x21')]?_[_0x68c6('0x22')](_0x35f57b[_0x68c6('0x21')],function(_0x2606a3){return{'model':db[_0x2606a3[_0x68c6('0x23')]],'as':_0x2606a3['as'],'attributes':_0x2606a3['attributes'],'include':_0x2606a3[_0x68c6('0x21')]?_[_0x68c6('0x22')](_0x2606a3[_0x68c6('0x21')],function(_0x48f887){return{'model':db[_0x48f887['model']],'as':_0x48f887['as'],'attributes':_0x48f887[_0x68c6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x68c6('0x10')](function(_0x433ea3){logger[_0x68c6('0x11')](_0x68c6('0x1a'),_0x4eaf21);logger[_0x68c6('0x13')](_0x68c6('0x1a'),_0x4eaf21,JSON[_0x68c6('0x14')](_0x433ea3));_0xd1fe6c(_0x433ea3);})[_0x68c6('0x19')](function(_0x2932c2){logger[_0x68c6('0x15')](_0x68c6('0x1a'),_0x2932c2['message'],_0x4eaf21);_0x54d5d0(_0x594afd[_0x68c6('0x15')](0x1f4,_0x2932c2['message']));});});};exports[_0x68c6('0x24')]=function(_0x348748){var _0x310a03=this;return new Promise(function(_0x4af8af,_0x2f85f8){return db[_0x68c6('0x1b')][_0x68c6('0x25')]({'raw':_0x348748[_0x68c6('0x1d')]?_0x348748[_0x68c6('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x348748[_0x68c6('0x1d')]?_0x348748['options'][_0x68c6('0x1f')]||null:null,'attributes':_0x348748[_0x68c6('0x1d')]?_0x348748['options'][_0x68c6('0x20')]||null:null,'include':_0x348748[_0x68c6('0x1d')]?_0x348748[_0x68c6('0x1d')][_0x68c6('0x21')]?_['map'](_0x348748[_0x68c6('0x1d')][_0x68c6('0x21')],function(_0x3247d0){return{'model':db[_0x3247d0[_0x68c6('0x23')]],'as':_0x3247d0['as'],'attributes':_0x3247d0['attributes'],'include':_0x3247d0[_0x68c6('0x21')]?_[_0x68c6('0x22')](_0x3247d0['include'],function(_0x4f529a){return{'model':db[_0x4f529a['model']],'as':_0x4f529a['as'],'attributes':_0x4f529a[_0x68c6('0x20')],'include':_0x4f529a['include']?_['map'](_0x4f529a[_0x68c6('0x21')],function(_0x2b1084){return{'model':db[_0x2b1084[_0x68c6('0x23')]],'as':_0x2b1084['as'],'attributes':_0x2b1084[_0x68c6('0x20')]};}):[]};}):[]};}):[]:[]})[_0x68c6('0x10')](function(_0x339e88){logger[_0x68c6('0x11')](_0x68c6('0x24'),_0x348748);logger['debug'](_0x68c6('0x24'),_0x348748,JSON[_0x68c6('0x14')](_0x339e88));_0x4af8af(_0x339e88);})['catch'](function(_0x280ab8){logger[_0x68c6('0x15')](_0x68c6('0x24'),_0x280ab8[_0x68c6('0x17')],_0x348748);_0x2f85f8(_0x310a03['error'](0x1f4,_0x280ab8[_0x68c6('0x17')]));});});}; \ No newline at end of file +var _0xf184=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','./mailQueue.socket','register','then','info','MailQueue,\x20%s,\x20%s','debug','MailQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','GetMailQueue','findAll','options','raw','where','attributes','include','map','model','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf184,0x148));var _0x4f18=function(_0x6a7421,_0x20b4f5){_0x6a7421=_0x6a7421-0x0;var _0x33f5d1=_0xf184[_0x6a7421];return _0x33f5d1;};'use strict';var _=require(_0x4f18('0x0'));var util=require('util');var moment=require(_0x4f18('0x1'));var BPromise=require(_0x4f18('0x2'));var rs=require(_0x4f18('0x3'));var fs=require('fs');var Redis=require(_0x4f18('0x4'));var db=require(_0x4f18('0x5'))['db'];var utils=require(_0x4f18('0x6'));var logger=require(_0x4f18('0x7'))('rpc');var config=require(_0x4f18('0x8'));var jayson=require(_0x4f18('0x9'));var client=jayson[_0x4f18('0xa')][_0x4f18('0xb')]({'port':0x232a});config[_0x4f18('0xc')]=_[_0x4f18('0xd')](config[_0x4f18('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x4f18('0xc')]));require(_0x4f18('0xe'))[_0x4f18('0xf')](socket);function respondWithRpcPromise(_0xeb5ab4,_0x3b4c5f,_0x217f6a){return new BPromise(function(_0x232766,_0x2bc074){return client['request'](_0xeb5ab4,_0x217f6a)[_0x4f18('0x10')](function(_0x385bbc){logger[_0x4f18('0x11')](_0x4f18('0x12'),_0x3b4c5f,'request\x20sent');logger[_0x4f18('0x13')](_0x4f18('0x14'),_0x3b4c5f,_0x4f18('0x15'),JSON[_0x4f18('0x16')](_0x385bbc));if(_0x385bbc['error']){if(_0x385bbc[_0x4f18('0x17')]['code']===0x1f4){logger[_0x4f18('0x17')](_0x4f18('0x12'),_0x3b4c5f,_0x385bbc[_0x4f18('0x17')]['message']);return _0x2bc074(_0x385bbc[_0x4f18('0x17')][_0x4f18('0x18')]);}logger[_0x4f18('0x17')](_0x4f18('0x12'),_0x3b4c5f,_0x385bbc[_0x4f18('0x17')][_0x4f18('0x18')]);return _0x232766(_0x385bbc[_0x4f18('0x17')]['message']);}else{logger[_0x4f18('0x11')](_0x4f18('0x12'),_0x3b4c5f,_0x4f18('0x15'));_0x232766(_0x385bbc[_0x4f18('0x19')]['message']);}})[_0x4f18('0x1a')](function(_0x566017){logger[_0x4f18('0x17')](_0x4f18('0x12'),_0x3b4c5f,_0x566017);_0x2bc074(_0x566017);});});}exports[_0x4f18('0x1b')]=function(_0x1371ba){var _0x22ed36=this;return new Promise(function(_0x14d283,_0x49e6ff){return db['MailQueue'][_0x4f18('0x1c')]({'raw':_0x1371ba[_0x4f18('0x1d')]?_0x1371ba[_0x4f18('0x1d')][_0x4f18('0x1e')]===undefined?!![]:![]:!![],'where':_0x1371ba[_0x4f18('0x1d')]?_0x1371ba[_0x4f18('0x1d')][_0x4f18('0x1f')]||null:null,'attributes':_0x1371ba[_0x4f18('0x1d')]?_0x1371ba[_0x4f18('0x1d')][_0x4f18('0x20')]||null:null,'limit':_0x1371ba[_0x4f18('0x1d')]?_0x1371ba[_0x4f18('0x1d')]['limit']||null:null,'include':_0x1371ba['options']?_0x1371ba[_0x4f18('0x1d')][_0x4f18('0x21')]?_[_0x4f18('0x22')](_0x1371ba[_0x4f18('0x1d')][_0x4f18('0x21')],function(_0x26bae){return{'model':db[_0x26bae[_0x4f18('0x23')]],'as':_0x26bae['as'],'attributes':_0x26bae['attributes'],'include':_0x26bae[_0x4f18('0x21')]?_[_0x4f18('0x22')](_0x26bae['include'],function(_0x4b1cf8){return{'model':db[_0x4b1cf8[_0x4f18('0x23')]],'as':_0x4b1cf8['as'],'attributes':_0x4b1cf8[_0x4f18('0x20')],'include':_0x4b1cf8['include']?_[_0x4f18('0x22')](_0x4b1cf8[_0x4f18('0x21')],function(_0x37c60b){return{'model':db[_0x37c60b[_0x4f18('0x23')]],'as':_0x37c60b['as'],'attributes':_0x37c60b['attributes']};}):[]};}):[]};}):[]:[]})[_0x4f18('0x10')](function(_0xf1021d){logger[_0x4f18('0x11')]('GetMailQueue',_0x1371ba);logger[_0x4f18('0x13')](_0x4f18('0x1b'),_0x1371ba,JSON[_0x4f18('0x16')](_0xf1021d));_0x14d283(_0xf1021d);})[_0x4f18('0x1a')](function(_0x583197){logger[_0x4f18('0x17')](_0x4f18('0x1b'),_0x583197[_0x4f18('0x18')],_0x1371ba);_0x49e6ff(_0x22ed36[_0x4f18('0x17')](0x1f4,_0x583197[_0x4f18('0x18')]));});});};exports['ShowMailQueue']=function(_0x2e824e){var _0x3ce656=this;return new Promise(function(_0x1f3cda,_0x4121bf){return db['MailQueue']['find']({'raw':_0x2e824e[_0x4f18('0x1d')]?_0x2e824e['options'][_0x4f18('0x1e')]===undefined?!![]:![]:!![],'where':_0x2e824e[_0x4f18('0x1d')]?_0x2e824e['options'][_0x4f18('0x1f')]||null:null,'attributes':_0x2e824e['options']?_0x2e824e['options']['attributes']||null:null,'include':_0x2e824e[_0x4f18('0x1d')]?_0x2e824e['options'][_0x4f18('0x21')]?_[_0x4f18('0x22')](_0x2e824e[_0x4f18('0x1d')][_0x4f18('0x21')],function(_0x3c4cf5){return{'model':db[_0x3c4cf5[_0x4f18('0x23')]],'as':_0x3c4cf5['as'],'attributes':_0x3c4cf5[_0x4f18('0x20')],'include':_0x3c4cf5[_0x4f18('0x21')]?_[_0x4f18('0x22')](_0x3c4cf5[_0x4f18('0x21')],function(_0x3120d8){return{'model':db[_0x3120d8['model']],'as':_0x3120d8['as'],'attributes':_0x3120d8[_0x4f18('0x20')],'include':_0x3120d8[_0x4f18('0x21')]?_[_0x4f18('0x22')](_0x3120d8[_0x4f18('0x21')],function(_0x46e494){return{'model':db[_0x46e494[_0x4f18('0x23')]],'as':_0x46e494['as'],'attributes':_0x46e494[_0x4f18('0x20')]};}):[]};}):[]};}):[]:[]})[_0x4f18('0x10')](function(_0x1df0c0){logger[_0x4f18('0x11')](_0x4f18('0x24'),_0x2e824e);logger[_0x4f18('0x13')](_0x4f18('0x24'),_0x2e824e,JSON[_0x4f18('0x16')](_0x1df0c0));_0x1f3cda(_0x1df0c0);})[_0x4f18('0x1a')](function(_0x1954ef){logger[_0x4f18('0x17')](_0x4f18('0x24'),_0x1954ef['message'],_0x2e824e);_0x4121bf(_0x3ce656['error'](0x1f4,_0x1954ef[_0x4f18('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 0a9ccb0..6ee233c 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 _0xd14c=['length','mailQueue:','./mailQueue.events','save','update','emit','removeListener','register'];(function(_0x4de9e6,_0x504ddc){var _0x59aedf=function(_0x2808e9){while(--_0x2808e9){_0x4de9e6['push'](_0x4de9e6['shift']());}};_0x59aedf(++_0x504ddc);}(_0xd14c,0x122));var _0xcd14=function(_0x475af0,_0x3a74c0){_0x475af0=_0x475af0-0x0;var _0x11cfdb=_0xd14c[_0x475af0];return _0x11cfdb;};'use strict';var MailQueueEvents=require(_0xcd14('0x0'));var events=[_0xcd14('0x1'),'remove',_0xcd14('0x2')];function createListener(_0xbbc55e,_0x16a4d4){return function(_0x490f78){_0x16a4d4[_0xcd14('0x3')](_0xbbc55e,_0x490f78);};}function removeListener(_0x595157,_0x4de9a8){return function(){MailQueueEvents[_0xcd14('0x4')](_0x595157,_0x4de9a8);};}exports[_0xcd14('0x5')]=function(_0x1ebf10){for(var _0x2d9f28=0x0,_0x7220cc=events[_0xcd14('0x6')];_0x2d9f28<_0x7220cc;_0x2d9f28++){var _0x37ac45=events[_0x2d9f28];var _0x194555=createListener(_0xcd14('0x7')+_0x37ac45,_0x1ebf10);MailQueueEvents['on'](_0x37ac45,_0x194555);}}; \ No newline at end of file +var _0x2a64=['./mailQueue.events','save','remove','update','emit','removeListener','register','length','mailQueue:'];(function(_0x52c4e9,_0x5412d0){var _0x252a03=function(_0x57857c){while(--_0x57857c){_0x52c4e9['push'](_0x52c4e9['shift']());}};_0x252a03(++_0x5412d0);}(_0x2a64,0x1b0));var _0x42a6=function(_0x58a484,_0x3c0cb4){_0x58a484=_0x58a484-0x0;var _0x4a6e63=_0x2a64[_0x58a484];return _0x4a6e63;};'use strict';var MailQueueEvents=require(_0x42a6('0x0'));var events=[_0x42a6('0x1'),_0x42a6('0x2'),_0x42a6('0x3')];function createListener(_0x39604e,_0xb4f8fa){return function(_0x43337a){_0xb4f8fa[_0x42a6('0x4')](_0x39604e,_0x43337a);};}function removeListener(_0x52c32d,_0x15659b){return function(){MailQueueEvents[_0x42a6('0x5')](_0x52c32d,_0x15659b);};}exports[_0x42a6('0x6')]=function(_0x4155c8){for(var _0x3963b0=0x0,_0x294331=events[_0x42a6('0x7')];_0x3963b0<_0x294331;_0x3963b0++){var _0x2b308e=events[_0x3963b0];var _0x421886=createListener(_0x42a6('0x8')+_0x2b308e,_0x4155c8);MailQueueEvents['on'](_0x2b308e,_0x421886);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index fbf7128..a0a282c 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 _0xde9d=['get','isAuthenticated','index','describe','/:id','show','post','update','delete','destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0xde9d,0xfa));var _0xdde9=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0xde9d[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0xdde9('0x0'));var util=require('util');var path=require(_0xdde9('0x1'));var timeout=require(_0xdde9('0x2'));var express=require('express');var router=express[_0xdde9('0x3')]();var auth=require(_0xdde9('0x4'));var interaction=require(_0xdde9('0x5'));var config=require('../../config/environment');var controller=require('./mailQueueReport.controller');router[_0xdde9('0x6')]('/',auth[_0xdde9('0x7')](),controller[_0xdde9('0x8')]);router['get']('/describe',auth[_0xdde9('0x7')](),controller[_0xdde9('0x9')]);router[_0xdde9('0x6')](_0xdde9('0xa'),auth[_0xdde9('0x7')](),controller[_0xdde9('0xb')]);router[_0xdde9('0xc')]('/',auth[_0xdde9('0x7')](),controller['create']);router['put'](_0xdde9('0xa'),auth[_0xdde9('0x7')](),controller[_0xdde9('0xd')]);router[_0xdde9('0xe')](_0xdde9('0xa'),auth[_0xdde9('0x7')](),controller[_0xdde9('0xf')]);module['exports']=router; \ No newline at end of file +var _0x90af=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailQueueReport.controller','get','isAuthenticated','describe','/:id','show','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x2df724,_0x411382){var _0x1b2504=function(_0x1d3cd1){while(--_0x1d3cd1){_0x2df724['push'](_0x2df724['shift']());}};_0x1b2504(++_0x411382);}(_0x90af,0x1e0));var _0xf90a=function(_0x261301,_0x297660){_0x261301=_0x261301-0x0;var _0x48673f=_0x90af[_0x261301];return _0x48673f;};'use strict';var multer=require(_0xf90a('0x0'));var util=require(_0xf90a('0x1'));var path=require(_0xf90a('0x2'));var timeout=require(_0xf90a('0x3'));var express=require(_0xf90a('0x4'));var router=express[_0xf90a('0x5')]();var auth=require(_0xf90a('0x6'));var interaction=require(_0xf90a('0x7'));var config=require(_0xf90a('0x8'));var controller=require(_0xf90a('0x9'));router[_0xf90a('0xa')]('/',auth[_0xf90a('0xb')](),controller['index']);router['get']('/describe',auth[_0xf90a('0xb')](),controller[_0xf90a('0xc')]);router['get'](_0xf90a('0xd'),auth[_0xf90a('0xb')](),controller[_0xf90a('0xe')]);router['post']('/',auth['isAuthenticated'](),controller[_0xf90a('0xf')]);router[_0xf90a('0x10')](_0xf90a('0xd'),auth[_0xf90a('0xb')](),controller[_0xf90a('0x11')]);router[_0xf90a('0x12')](_0xf90a('0xd'),auth[_0xf90a('0xb')](),controller[_0xf90a('0x13')]);module[_0xf90a('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 31bff65..f1dd14b 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 _0xdf80=['moment','STRING','DATE'];(function(_0x484f7e,_0x591ae2){var _0x39e1b7=function(_0x295709){while(--_0x295709){_0x484f7e['push'](_0x484f7e['shift']());}};_0x39e1b7(++_0x591ae2);}(_0xdf80,0xdb));var _0x0df8=function(_0x32f657,_0x3bcd12){_0x32f657=_0x32f657-0x0;var _0x2dd60e=_0xdf80[_0x32f657];return _0x2dd60e;};'use strict';var moment=require(_0x0df8('0x0'));var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0x0df8('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x0df8('0x1')]},'joinAt':{'type':Sequelize[_0x0df8('0x2')]},'leaveAt':{'type':Sequelize[_0x0df8('0x2')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0df8('0x2')]},'reason':{'type':Sequelize[_0x0df8('0x1')]}}; \ No newline at end of file +var _0xba00=['exports','STRING','DATE','moment'];(function(_0x1686d0,_0x3e135f){var _0x59930a=function(_0x4899c2){while(--_0x4899c2){_0x1686d0['push'](_0x1686d0['shift']());}};_0x59930a(++_0x3e135f);}(_0xba00,0xef));var _0x0ba0=function(_0x38f740,_0x580b36){_0x38f740=_0x38f740-0x0;var _0x52db81=_0xba00[_0x38f740];return _0x52db81;};'use strict';var moment=require(_0x0ba0('0x0'));var Sequelize=require('sequelize');module[_0x0ba0('0x1')]={'uniqueid':{'type':Sequelize[_0x0ba0('0x2')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x0ba0('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x0ba0('0x3')]},'reason':{'type':Sequelize[_0x0ba0('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index e66edc7..d30f862 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 _0x3a39=['params','find','describe','eml-format','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','status','end','count','offset','limit','Content-Range','json','apply','reject','update','then','destroy','sendStatus','error','name','send','index','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','filter','merge','options','MailQueueReport','include','findAll','rows','catch','show','rawAttributes','create','body'];(function(_0x223b61,_0x1eb5f8){var _0x271b2b=function(_0x51ce94){while(--_0x51ce94){_0x223b61['push'](_0x223b61['shift']());}};_0x271b2b(++_0x1eb5f8);}(_0x3a39,0x113));var _0x93a3=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x3a39[_0x2641f9];return _0x585741;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x93a3('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x93a3('0x1'));var rp=require('request-promise');var moment=require(_0x93a3('0x2'));var BPromise=require(_0x93a3('0x3'));var Mustache=require(_0x93a3('0x4'));var util=require('util');var path=require(_0x93a3('0x5'));var sox=require(_0x93a3('0x6'));var csv=require(_0x93a3('0x7'));var ejs=require(_0x93a3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x93a3('0x9'));var crypto=require(_0x93a3('0xa'));var jsforce=require(_0x93a3('0xb'));var deskjs=require(_0x93a3('0xc'));var toCsv=require('to-csv');var querystring=require(_0x93a3('0xd'));var Papa=require('papaparse');var Redis=require(_0x93a3('0xe'));var authService=require(_0x93a3('0xf'));var qs=require(_0x93a3('0x10'));var as=require(_0x93a3('0x11'));var hardwareService=require(_0x93a3('0x12'));var logger=require(_0x93a3('0x13'))(_0x93a3('0x14'));var utils=require(_0x93a3('0x15'));var config=require('../../config/environment');var db=require(_0x93a3('0x16'))['db'];function respondWithStatusCode(_0x51fddb,_0x42f052){_0x42f052=_0x42f052||0xcc;return function(_0x574b9d){if(_0x574b9d){return _0x51fddb['sendStatus'](_0x42f052);}return _0x51fddb[_0x93a3('0x17')](_0x42f052)[_0x93a3('0x18')]();};}function respondWithResult(_0x306c40,_0x81d512){_0x81d512=_0x81d512||0xc8;return function(_0x47e9ed){if(_0x47e9ed){return _0x306c40[_0x93a3('0x17')](_0x81d512)['json'](_0x47e9ed);}};}function respondWithFilteredResult(_0x2bdd34,_0x812ae2){return function(_0x3037b4){if(_0x3037b4){var _0x2fe375=_0x3037b4[_0x93a3('0x19')],_0x4bd377=_0x812ae2[_0x93a3('0x1a')],_0x5527bb=_0x812ae2[_0x93a3('0x1a')]+_0x812ae2[_0x93a3('0x1b')],_0x5b689c;if(_0x5527bb>=_0x2fe375){_0x5527bb=_0x2fe375;_0x5b689c=0xc8;}else{_0x5b689c=0xce;}_0x2bdd34['status'](_0x5b689c);return _0x2bdd34['set'](_0x93a3('0x1c'),_0x4bd377+'-'+_0x5527bb+'/'+_0x2fe375)[_0x93a3('0x1d')](_0x3037b4);}return null;};}function patchUpdates(_0x2a0f4e){return function(_0x513517){try{jsonpatch[_0x93a3('0x1e')](_0x513517,_0x2a0f4e,!![]);}catch(_0x35c030){return BPromise[_0x93a3('0x1f')](_0x35c030);}return _0x513517['save']();};}function saveUpdates(_0x54dd59,_0x343f1e){return function(_0x5e9399){if(_0x5e9399){return _0x5e9399[_0x93a3('0x20')](_0x54dd59)[_0x93a3('0x21')](function(_0x37311a){return _0x37311a;});}return null;};}function removeEntity(_0x5656ec,_0x118c57){return function(_0x57ff1e){if(_0x57ff1e){return _0x57ff1e[_0x93a3('0x22')]()[_0x93a3('0x21')](function(){_0x5656ec[_0x93a3('0x17')](0xcc)[_0x93a3('0x18')]();});}};}function handleEntityNotFound(_0x2022a5,_0x160f91){return function(_0x1095d7){if(!_0x1095d7){_0x2022a5[_0x93a3('0x23')](0x194);}return _0x1095d7;};}function handleError(_0x12d606,_0x22f11b){_0x22f11b=_0x22f11b||0x1f4;return function(_0x285ef4){logger[_0x93a3('0x24')](_0x285ef4['stack']);if(_0x285ef4['name']){delete _0x285ef4[_0x93a3('0x25')];}_0x12d606[_0x93a3('0x17')](_0x22f11b)[_0x93a3('0x26')](_0x285ef4);};}exports[_0x93a3('0x27')]=function(_0x431829,_0x33d7b3){var _0x4b4742={},_0x3e2da5={},_0xdc4296={'count':0x0,'rows':[]};var _0x118020=_['map'](db['MailQueueReport']['rawAttributes'],function(_0x1389f2){return{'name':_0x1389f2['fieldName'],'type':_0x1389f2[_0x93a3('0x28')][_0x93a3('0x29')]};});_0x3e2da5[_0x93a3('0x2a')]=_['map'](_0x118020,_0x93a3('0x25'));_0x3e2da5[_0x93a3('0x2b')]=_[_0x93a3('0x2c')](_0x431829[_0x93a3('0x2b')]);_0x3e2da5[_0x93a3('0x2d')]=_['intersection'](_0x3e2da5['model'],_0x3e2da5[_0x93a3('0x2b')]);_0x4b4742[_0x93a3('0x2e')]=_[_0x93a3('0x2f')](_0x3e2da5[_0x93a3('0x2a')],qs[_0x93a3('0x30')](_0x431829[_0x93a3('0x2b')]['fields']));_0x4b4742[_0x93a3('0x2e')]=_0x4b4742[_0x93a3('0x2e')][_0x93a3('0x31')]?_0x4b4742[_0x93a3('0x2e')]:_0x3e2da5[_0x93a3('0x2a')];if(!_0x431829[_0x93a3('0x2b')][_0x93a3('0x32')]('nolimit')){_0x4b4742[_0x93a3('0x1b')]=qs[_0x93a3('0x1b')](_0x431829[_0x93a3('0x2b')][_0x93a3('0x1b')]);_0x4b4742[_0x93a3('0x1a')]=qs['offset'](_0x431829[_0x93a3('0x2b')][_0x93a3('0x1a')]);}_0x4b4742[_0x93a3('0x33')]=qs['sort'](_0x431829[_0x93a3('0x2b')]['sort']);_0x4b4742[_0x93a3('0x34')]=qs[_0x93a3('0x2d')](_['pick'](_0x431829[_0x93a3('0x2b')],_0x3e2da5[_0x93a3('0x2d')]));if(_0x431829[_0x93a3('0x2b')][_0x93a3('0x35')]){_0x4b4742['where']=_[_0x93a3('0x36')](_0x4b4742['where'],{'$or':_['map'](_0x118020,function(_0xf1578c){if(_0xf1578c[_0x93a3('0x28')]!=='VIRTUAL'){var _0x126f16={};_0x126f16[_0xf1578c[_0x93a3('0x25')]]={'$like':'%'+_0x431829[_0x93a3('0x2b')][_0x93a3('0x35')]+'%'};return _0x126f16;}})});}_0x4b4742=_[_0x93a3('0x36')]({},_0x4b4742,_0x431829[_0x93a3('0x37')]);var _0xeeaf4a={'where':_0x4b4742[_0x93a3('0x34')]};return db[_0x93a3('0x38')][_0x93a3('0x19')](_0xeeaf4a)['then'](function(_0x588066){_0xdc4296[_0x93a3('0x19')]=_0x588066;if(_0x431829[_0x93a3('0x2b')]['includeAll']){_0x4b4742[_0x93a3('0x39')]=[{'all':!![]}];}return db[_0x93a3('0x38')][_0x93a3('0x3a')](_0x4b4742);})[_0x93a3('0x21')](function(_0x3b03b9){_0xdc4296[_0x93a3('0x3b')]=_0x3b03b9;return _0xdc4296;})[_0x93a3('0x21')](respondWithFilteredResult(_0x33d7b3,_0x4b4742))[_0x93a3('0x3c')](handleError(_0x33d7b3,null));};exports[_0x93a3('0x3d')]=function(_0x29f260,_0x48074c){var _0x3f0b88={'raw':!![],'where':{'id':_0x29f260['params']['id']}},_0x4177a0={};_0x4177a0['model']=_['keys'](db[_0x93a3('0x38')][_0x93a3('0x3e')]);_0x4177a0[_0x93a3('0x2b')]=_[_0x93a3('0x2c')](_0x29f260[_0x93a3('0x2b')]);_0x4177a0[_0x93a3('0x2d')]=_[_0x93a3('0x2f')](_0x4177a0[_0x93a3('0x2a')],_0x4177a0[_0x93a3('0x2b')]);_0x3f0b88[_0x93a3('0x2e')]=_[_0x93a3('0x2f')](_0x4177a0['model'],qs[_0x93a3('0x30')](_0x29f260['query']['fields']));_0x3f0b88[_0x93a3('0x2e')]=_0x3f0b88[_0x93a3('0x2e')][_0x93a3('0x31')]?_0x3f0b88[_0x93a3('0x2e')]:_0x4177a0[_0x93a3('0x2a')];if(_0x29f260['query']['includeAll']){_0x3f0b88[_0x93a3('0x39')]=[{'all':!![]}];}_0x3f0b88=_[_0x93a3('0x36')]({},_0x3f0b88,_0x29f260[_0x93a3('0x37')]);return db['MailQueueReport']['find'](_0x3f0b88)[_0x93a3('0x21')](handleEntityNotFound(_0x48074c,null))['then'](respondWithResult(_0x48074c,null))[_0x93a3('0x3c')](handleError(_0x48074c,null));};exports[_0x93a3('0x3f')]=function(_0x129994,_0xce76e8){return db['MailQueueReport']['create'](_0x129994[_0x93a3('0x40')],{})['then'](respondWithResult(_0xce76e8,0xc9))[_0x93a3('0x3c')](handleError(_0xce76e8,null));};exports[_0x93a3('0x20')]=function(_0x40f57d,_0x23ea42){if(_0x40f57d['body']['id']){delete _0x40f57d[_0x93a3('0x40')]['id'];}return db[_0x93a3('0x38')]['find']({'where':{'id':_0x40f57d[_0x93a3('0x41')]['id']}})[_0x93a3('0x21')](handleEntityNotFound(_0x23ea42,null))[_0x93a3('0x21')](saveUpdates(_0x40f57d['body'],null))['then'](respondWithResult(_0x23ea42,null))['catch'](handleError(_0x23ea42,null));};exports[_0x93a3('0x22')]=function(_0x3354a1,_0x1465e7){return db[_0x93a3('0x38')][_0x93a3('0x42')]({'where':{'id':_0x3354a1['params']['id']}})[_0x93a3('0x21')](handleEntityNotFound(_0x1465e7,null))['then'](removeEntity(_0x1465e7,null))[_0x93a3('0x3c')](handleError(_0x1465e7,null));};exports[_0x93a3('0x43')]=function(_0x34cf35,_0x1c5c5b){return db['MailQueueReport'][_0x93a3('0x43')]()[_0x93a3('0x21')](respondWithResult(_0x1c5c5b,null))[_0x93a3('0x3c')](handleError(_0x1c5c5b,null));}; \ No newline at end of file +var _0x97bd=['sort','where','merge','VIRTUAL','filter','options','includeAll','findAll','rows','catch','show','params','include','find','create','body','update','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','limit','set','apply','reject','save','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','offset'];(function(_0x111e35,_0x27bbc8){var _0x4a3aee=function(_0x1fb0bf){while(--_0x1fb0bf){_0x111e35['push'](_0x111e35['shift']());}};_0x4a3aee(++_0x27bbc8);}(_0x97bd,0xf0));var _0xd97b=function(_0x1b88fd,_0x3fc359){_0x1b88fd=_0x1b88fd-0x0;var _0x287cd1=_0x97bd[_0x1b88fd];return _0x287cd1;};'use strict';var pdf=require(_0xd97b('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd97b('0x1'));var zipdir=require(_0xd97b('0x2'));var jsonpatch=require(_0xd97b('0x3'));var rp=require(_0xd97b('0x4'));var moment=require('moment');var BPromise=require(_0xd97b('0x5'));var Mustache=require(_0xd97b('0x6'));var util=require(_0xd97b('0x7'));var path=require(_0xd97b('0x8'));var sox=require(_0xd97b('0x9'));var csv=require('to-csv');var ejs=require(_0xd97b('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd97b('0xb'));var crypto=require(_0xd97b('0xc'));var jsforce=require(_0xd97b('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd97b('0xe'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd97b('0xf'));var authService=require(_0xd97b('0x10'));var qs=require(_0xd97b('0x11'));var as=require(_0xd97b('0x12'));var hardwareService=require(_0xd97b('0x13'));var logger=require('../../config/logger')(_0xd97b('0x14'));var utils=require(_0xd97b('0x15'));var config=require(_0xd97b('0x16'));var db=require(_0xd97b('0x17'))['db'];function respondWithStatusCode(_0x3819f2,_0x395754){_0x395754=_0x395754||0xcc;return function(_0x4c564d){if(_0x4c564d){return _0x3819f2[_0xd97b('0x18')](_0x395754);}return _0x3819f2[_0xd97b('0x19')](_0x395754)[_0xd97b('0x1a')]();};}function respondWithResult(_0x3356a0,_0x5cb055){_0x5cb055=_0x5cb055||0xc8;return function(_0x10fa4a){if(_0x10fa4a){return _0x3356a0['status'](_0x5cb055)[_0xd97b('0x1b')](_0x10fa4a);}};}function respondWithFilteredResult(_0xdbf3d5,_0x260065){return function(_0x485069){if(_0x485069){var _0x5273a8=_0x485069[_0xd97b('0x1c')],_0x5d2ccd=_0x260065['offset'],_0x5ad99f=_0x260065['offset']+_0x260065[_0xd97b('0x1d')],_0x2a67b8;if(_0x5ad99f>=_0x5273a8){_0x5ad99f=_0x5273a8;_0x2a67b8=0xc8;}else{_0x2a67b8=0xce;}_0xdbf3d5[_0xd97b('0x19')](_0x2a67b8);return _0xdbf3d5[_0xd97b('0x1e')]('Content-Range',_0x5d2ccd+'-'+_0x5ad99f+'/'+_0x5273a8)[_0xd97b('0x1b')](_0x485069);}return null;};}function patchUpdates(_0x4cd1c3){return function(_0x2d2577){try{jsonpatch[_0xd97b('0x1f')](_0x2d2577,_0x4cd1c3,!![]);}catch(_0x2e8e86){return BPromise[_0xd97b('0x20')](_0x2e8e86);}return _0x2d2577[_0xd97b('0x21')]();};}function saveUpdates(_0x1ef4e9,_0x2e1310){return function(_0x266bd2){if(_0x266bd2){return _0x266bd2['update'](_0x1ef4e9)[_0xd97b('0x22')](function(_0x36d050){return _0x36d050;});}return null;};}function removeEntity(_0x365b93,_0x1880ae){return function(_0x57828c){if(_0x57828c){return _0x57828c[_0xd97b('0x23')]()[_0xd97b('0x22')](function(){_0x365b93[_0xd97b('0x19')](0xcc)[_0xd97b('0x1a')]();});}};}function handleEntityNotFound(_0x118654,_0x14febf){return function(_0x19dc9f){if(!_0x19dc9f){_0x118654[_0xd97b('0x18')](0x194);}return _0x19dc9f;};}function handleError(_0xc20a7,_0x3f3398){_0x3f3398=_0x3f3398||0x1f4;return function(_0x63a99f){logger[_0xd97b('0x24')](_0x63a99f[_0xd97b('0x25')]);if(_0x63a99f[_0xd97b('0x26')]){delete _0x63a99f['name'];}_0xc20a7['status'](_0x3f3398)[_0xd97b('0x27')](_0x63a99f);};}exports[_0xd97b('0x28')]=function(_0x11176a,_0xcca63c){var _0x4bfdd9={},_0x4c5eaf={},_0x53e6bc={'count':0x0,'rows':[]};var _0x2427dd=_[_0xd97b('0x29')](db[_0xd97b('0x2a')][_0xd97b('0x2b')],function(_0x537e35){return{'name':_0x537e35[_0xd97b('0x2c')],'type':_0x537e35[_0xd97b('0x2d')][_0xd97b('0x2e')]};});_0x4c5eaf[_0xd97b('0x2f')]=_['map'](_0x2427dd,_0xd97b('0x26'));_0x4c5eaf['query']=_[_0xd97b('0x30')](_0x11176a[_0xd97b('0x31')]);_0x4c5eaf[_0xd97b('0x32')]=_[_0xd97b('0x33')](_0x4c5eaf[_0xd97b('0x2f')],_0x4c5eaf[_0xd97b('0x31')]);_0x4bfdd9['attributes']=_['intersection'](_0x4c5eaf['model'],qs[_0xd97b('0x34')](_0x11176a[_0xd97b('0x31')]['fields']));_0x4bfdd9[_0xd97b('0x35')]=_0x4bfdd9[_0xd97b('0x35')][_0xd97b('0x36')]?_0x4bfdd9[_0xd97b('0x35')]:_0x4c5eaf[_0xd97b('0x2f')];if(!_0x11176a[_0xd97b('0x31')]['hasOwnProperty']('nolimit')){_0x4bfdd9['limit']=qs['limit'](_0x11176a[_0xd97b('0x31')][_0xd97b('0x1d')]);_0x4bfdd9[_0xd97b('0x37')]=qs['offset'](_0x11176a[_0xd97b('0x31')][_0xd97b('0x37')]);}_0x4bfdd9['order']=qs[_0xd97b('0x38')](_0x11176a['query']['sort']);_0x4bfdd9[_0xd97b('0x39')]=qs[_0xd97b('0x32')](_['pick'](_0x11176a['query'],_0x4c5eaf[_0xd97b('0x32')]));if(_0x11176a[_0xd97b('0x31')]['filter']){_0x4bfdd9['where']=_[_0xd97b('0x3a')](_0x4bfdd9['where'],{'$or':_['map'](_0x2427dd,function(_0x53f3c4){if(_0x53f3c4['type']!==_0xd97b('0x3b')){var _0x57ffaa={};_0x57ffaa[_0x53f3c4[_0xd97b('0x26')]]={'$like':'%'+_0x11176a[_0xd97b('0x31')][_0xd97b('0x3c')]+'%'};return _0x57ffaa;}})});}_0x4bfdd9=_['merge']({},_0x4bfdd9,_0x11176a[_0xd97b('0x3d')]);var _0x495490={'where':_0x4bfdd9[_0xd97b('0x39')]};return db['MailQueueReport'][_0xd97b('0x1c')](_0x495490)[_0xd97b('0x22')](function(_0x960cb8){_0x53e6bc[_0xd97b('0x1c')]=_0x960cb8;if(_0x11176a[_0xd97b('0x31')][_0xd97b('0x3e')]){_0x4bfdd9['include']=[{'all':!![]}];}return db[_0xd97b('0x2a')][_0xd97b('0x3f')](_0x4bfdd9);})[_0xd97b('0x22')](function(_0x12f4a4){_0x53e6bc[_0xd97b('0x40')]=_0x12f4a4;return _0x53e6bc;})[_0xd97b('0x22')](respondWithFilteredResult(_0xcca63c,_0x4bfdd9))[_0xd97b('0x41')](handleError(_0xcca63c,null));};exports[_0xd97b('0x42')]=function(_0x53b729,_0x33bfc9){var _0x2fe4ca={'raw':!![],'where':{'id':_0x53b729[_0xd97b('0x43')]['id']}},_0x334d3c={};_0x334d3c['model']=_[_0xd97b('0x30')](db['MailQueueReport']['rawAttributes']);_0x334d3c['query']=_[_0xd97b('0x30')](_0x53b729[_0xd97b('0x31')]);_0x334d3c['filters']=_['intersection'](_0x334d3c['model'],_0x334d3c[_0xd97b('0x31')]);_0x2fe4ca['attributes']=_['intersection'](_0x334d3c['model'],qs[_0xd97b('0x34')](_0x53b729[_0xd97b('0x31')][_0xd97b('0x34')]));_0x2fe4ca[_0xd97b('0x35')]=_0x2fe4ca[_0xd97b('0x35')][_0xd97b('0x36')]?_0x2fe4ca[_0xd97b('0x35')]:_0x334d3c[_0xd97b('0x2f')];if(_0x53b729[_0xd97b('0x31')][_0xd97b('0x3e')]){_0x2fe4ca[_0xd97b('0x44')]=[{'all':!![]}];}_0x2fe4ca=_[_0xd97b('0x3a')]({},_0x2fe4ca,_0x53b729[_0xd97b('0x3d')]);return db['MailQueueReport'][_0xd97b('0x45')](_0x2fe4ca)['then'](handleEntityNotFound(_0x33bfc9,null))[_0xd97b('0x22')](respondWithResult(_0x33bfc9,null))['catch'](handleError(_0x33bfc9,null));};exports['create']=function(_0x3332d5,_0x25c8c7){return db[_0xd97b('0x2a')][_0xd97b('0x46')](_0x3332d5[_0xd97b('0x47')],{})[_0xd97b('0x22')](respondWithResult(_0x25c8c7,0xc9))[_0xd97b('0x41')](handleError(_0x25c8c7,null));};exports[_0xd97b('0x48')]=function(_0x5acb0b,_0x36c777){if(_0x5acb0b[_0xd97b('0x47')]['id']){delete _0x5acb0b['body']['id'];}return db[_0xd97b('0x2a')]['find']({'where':{'id':_0x5acb0b[_0xd97b('0x43')]['id']}})[_0xd97b('0x22')](handleEntityNotFound(_0x36c777,null))[_0xd97b('0x22')](saveUpdates(_0x5acb0b['body'],null))[_0xd97b('0x22')](respondWithResult(_0x36c777,null))[_0xd97b('0x41')](handleError(_0x36c777,null));};exports[_0xd97b('0x23')]=function(_0x12aa3e,_0x2fc800){return db['MailQueueReport']['find']({'where':{'id':_0x12aa3e[_0xd97b('0x43')]['id']}})[_0xd97b('0x22')](handleEntityNotFound(_0x2fc800,null))[_0xd97b('0x22')](removeEntity(_0x2fc800,null))[_0xd97b('0x41')](handleError(_0x2fc800,null));};exports[_0xd97b('0x49')]=function(_0x321dff,_0x43d063){return db[_0xd97b('0x2a')][_0xd97b('0x49')]()['then'](respondWithResult(_0x43d063,null))['catch'](handleError(_0x43d063,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 1bc7a0d..bc95132 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 _0xb9b3=['report_mail_queue','uniqueid','lodash','util','api','moment','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport'];(function(_0x363505,_0x24f1f4){var _0x28809f=function(_0x26cb6e){while(--_0x26cb6e){_0x363505['push'](_0x363505['shift']());}};_0x28809f(++_0x24f1f4);}(_0xb9b3,0x1a6));var _0x3b9b=function(_0x3a41e8,_0x52d949){_0x3a41e8=_0x3a41e8-0x0;var _0x514d71=_0xb9b3[_0x3a41e8];return _0x514d71;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var logger=require('../../config/logger')(_0x3b9b('0x2'));var moment=require(_0x3b9b('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3b9b('0x4'));var rimraf=require(_0x3b9b('0x5'));var config=require(_0x3b9b('0x6'));var attributes=require(_0x3b9b('0x7'));module[_0x3b9b('0x8')]=function(_0x5988c3,_0xad5cd){return _0x5988c3['define'](_0x3b9b('0x9'),attributes,{'tableName':_0x3b9b('0xa'),'paranoid':![],'indexes':[{'name':_0x3b9b('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x9b34=['path','rimraf','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','util','moment','bluebird','request-promise'];(function(_0x15faef,_0x147686){var _0xa9c94=function(_0x51ed2e){while(--_0x51ed2e){_0x15faef['push'](_0x15faef['shift']());}};_0xa9c94(++_0x147686);}(_0x9b34,0xd4));var _0x49b3=function(_0xeab5e0,_0x402b00){_0xeab5e0=_0xeab5e0-0x0;var _0x1ecddc=_0x9b34[_0xeab5e0];return _0x1ecddc;};'use strict';var _=require('lodash');var util=require(_0x49b3('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x49b3('0x1'));var BPromise=require(_0x49b3('0x2'));var rp=require(_0x49b3('0x3'));var fs=require('fs');var path=require(_0x49b3('0x4'));var rimraf=require(_0x49b3('0x5'));var config=require('../../config/environment');var attributes=require(_0x49b3('0x6'));module[_0x49b3('0x7')]=function(_0x287c43,_0x4a6716){return _0x287c43[_0x49b3('0x8')](_0x49b3('0x9'),attributes,{'tableName':_0x49b3('0xa'),'paranoid':![],'indexes':[{'name':_0x49b3('0xb'),'fields':[_0x49b3('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index cf16fc8..dec0cdc 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 _0x524e=['info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','MailQueueReport','create','options','CreateMailQueueReport','catch','UpdateMailQueueReport','update','body','raw','attributes','limit','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x3e5086,_0x48f4a2){var _0xfeb102=function(_0x5a945f){while(--_0x5a945f){_0x3e5086['push'](_0x3e5086['shift']());}};_0xfeb102(++_0x48f4a2);}(_0x524e,0x15e));var _0xe524=function(_0x549250,_0x5dbf27){_0x549250=_0x549250-0x0;var _0x24a7c7=_0x524e[_0x549250];return _0x24a7c7;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xe524('0x0'));var BPromise=require(_0xe524('0x1'));var rs=require(_0xe524('0x2'));var fs=require('fs');var Redis=require(_0xe524('0x3'));var db=require(_0xe524('0x4'))['db'];var utils=require(_0xe524('0x5'));var logger=require(_0xe524('0x6'))(_0xe524('0x7'));var config=require(_0xe524('0x8'));var jayson=require(_0xe524('0x9'));var client=jayson['client'][_0xe524('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41e1a3,_0x347bed,_0x533c14){return new BPromise(function(_0x384935,_0x3e4cda){return client[_0xe524('0xb')](_0x41e1a3,_0x533c14)[_0xe524('0xc')](function(_0x991924){logger[_0xe524('0xd')](_0xe524('0xe'),_0x347bed,_0xe524('0xf'));logger[_0xe524('0x10')](_0xe524('0x11'),_0x347bed,_0xe524('0xf'),JSON[_0xe524('0x12')](_0x991924));if(_0x991924[_0xe524('0x13')]){if(_0x991924[_0xe524('0x13')][_0xe524('0x14')]===0x1f4){logger[_0xe524('0x13')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x3e4cda(_0x991924[_0xe524('0x13')][_0xe524('0x15')]);}logger[_0xe524('0x13')](_0xe524('0xe'),_0x347bed,_0x991924['error'][_0xe524('0x15')]);return _0x384935(_0x991924['error'][_0xe524('0x15')]);}else{logger[_0xe524('0xd')]('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0xe524('0xf'));_0x384935(_0x991924['result'][_0xe524('0x15')]);}})['catch'](function(_0x29a031){logger['error']('MailQueueReport,\x20%s,\x20%s',_0x347bed,_0x29a031);_0x3e4cda(_0x29a031);});});}exports['CreateMailQueueReport']=function(_0x3a4027){var _0x4f1dfb=this;return new Promise(function(_0x11b2a1,_0x238f8f){return db[_0xe524('0x16')][_0xe524('0x17')](_0x3a4027['body'],{'raw':_0x3a4027[_0xe524('0x18')]?_0x3a4027[_0xe524('0x18')]['raw']===undefined?!![]:![]:!![]})[_0xe524('0xc')](function(_0x309f85){logger[_0xe524('0xd')](_0xe524('0x19'),_0x3a4027);logger[_0xe524('0x10')](_0xe524('0x19'),_0x3a4027,JSON[_0xe524('0x12')](_0x309f85));_0x11b2a1(_0x309f85);})[_0xe524('0x1a')](function(_0x7dfe97){logger['error'](_0xe524('0x19'),_0x7dfe97['message'],_0x3a4027);_0x238f8f(_0x4f1dfb['error'](0x1f4,_0x7dfe97[_0xe524('0x15')]));});});};exports[_0xe524('0x1b')]=function(_0x1ad106){var _0x85fc51=this;return new Promise(function(_0x599d5d,_0x158f07){return db['MailQueueReport'][_0xe524('0x1c')](_0x1ad106[_0xe524('0x1d')],{'raw':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')]['where']||null:null,'attributes':_0x1ad106['options']?_0x1ad106[_0xe524('0x18')][_0xe524('0x1f')]||null:null,'limit':_0x1ad106[_0xe524('0x18')]?_0x1ad106[_0xe524('0x18')][_0xe524('0x20')]||null:null})['then'](function(_0x52f140){logger[_0xe524('0xd')](_0xe524('0x1b'),_0x1ad106);logger[_0xe524('0x10')](_0xe524('0x1b'),_0x1ad106,JSON[_0xe524('0x12')](_0x52f140));_0x599d5d(_0x52f140);})['catch'](function(_0x365a1f){logger[_0xe524('0x13')]('UpdateMailQueueReport',_0x365a1f['message'],_0x1ad106);_0x158f07(_0x85fc51[_0xe524('0x13')](0x1f4,_0x365a1f[_0xe524('0x15')]));});});}; \ No newline at end of file +var _0x1623=['catch','CreateMailQueueReport','MailQueueReport','create','body','options','update','raw','where','limit','UpdateMailQueueReport','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','MailQueueReport,\x20%s,\x20%s','message','result'];(function(_0x3a19d4,_0x3f19a4){var _0x5b858b=function(_0x4ddce5){while(--_0x4ddce5){_0x3a19d4['push'](_0x3a19d4['shift']());}};_0x5b858b(++_0x3f19a4);}(_0x1623,0xab));var _0x3162=function(_0x4167ca,_0x38fbcf){_0x4167ca=_0x4167ca-0x0;var _0x4a4b59=_0x1623[_0x4167ca];return _0x4a4b59;};'use strict';var _=require(_0x3162('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3162('0x1'));var rs=require(_0x3162('0x2'));var fs=require('fs');var Redis=require(_0x3162('0x3'));var db=require(_0x3162('0x4'))['db'];var utils=require(_0x3162('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x3162('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3162('0x7')][_0x3162('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x53260d,_0xffe9b6,_0x2dc07e){return new BPromise(function(_0x26ee32,_0x36609e){return client[_0x3162('0x9')](_0x53260d,_0x2dc07e)[_0x3162('0xa')](function(_0xe43099){logger[_0x3162('0xb')]('MailQueueReport,\x20%s,\x20%s',_0xffe9b6,'request\x20sent');logger[_0x3162('0xc')](_0x3162('0xd'),_0xffe9b6,_0x3162('0xe'),JSON[_0x3162('0xf')](_0xe43099));if(_0xe43099[_0x3162('0x10')]){if(_0xe43099[_0x3162('0x10')][_0x3162('0x11')]===0x1f4){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x36609e(_0xe43099['error'][_0x3162('0x13')]);}logger[_0x3162('0x10')]('MailQueueReport,\x20%s,\x20%s',_0xffe9b6,_0xe43099['error'][_0x3162('0x13')]);return _0x26ee32(_0xe43099[_0x3162('0x10')][_0x3162('0x13')]);}else{logger['info'](_0x3162('0x12'),_0xffe9b6,_0x3162('0xe'));_0x26ee32(_0xe43099[_0x3162('0x14')]['message']);}})[_0x3162('0x15')](function(_0x42cf7d){logger[_0x3162('0x10')](_0x3162('0x12'),_0xffe9b6,_0x42cf7d);_0x36609e(_0x42cf7d);});});}exports[_0x3162('0x16')]=function(_0x1eed46){var _0x391d97=this;return new Promise(function(_0x4b2bf3,_0x42f283){return db[_0x3162('0x17')][_0x3162('0x18')](_0x1eed46[_0x3162('0x19')],{'raw':_0x1eed46['options']?_0x1eed46[_0x3162('0x1a')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xa5c62b){logger[_0x3162('0xb')](_0x3162('0x16'),_0x1eed46);logger['debug']('CreateMailQueueReport',_0x1eed46,JSON[_0x3162('0xf')](_0xa5c62b));_0x4b2bf3(_0xa5c62b);})[_0x3162('0x15')](function(_0x32c051){logger[_0x3162('0x10')](_0x3162('0x16'),_0x32c051[_0x3162('0x13')],_0x1eed46);_0x42f283(_0x391d97[_0x3162('0x10')](0x1f4,_0x32c051[_0x3162('0x13')]));});});};exports['UpdateMailQueueReport']=function(_0xd283d6){var _0x2433f8=this;return new Promise(function(_0x3919e7,_0x1fd76f){return db[_0x3162('0x17')][_0x3162('0x1b')](_0xd283d6[_0x3162('0x19')],{'raw':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1d')]||null:null,'attributes':_0xd283d6['options']?_0xd283d6[_0x3162('0x1a')]['attributes']||null:null,'limit':_0xd283d6[_0x3162('0x1a')]?_0xd283d6[_0x3162('0x1a')][_0x3162('0x1e')]||null:null})['then'](function(_0x4903e7){logger[_0x3162('0xb')](_0x3162('0x1f'),_0xd283d6);logger[_0x3162('0xc')](_0x3162('0x1f'),_0xd283d6,JSON[_0x3162('0xf')](_0x4903e7));_0x3919e7(_0x4903e7);})['catch'](function(_0x8a7bce){logger['error'](_0x3162('0x1f'),_0x8a7bce[_0x3162('0x13')],_0xd283d6);_0x1fd76f(_0x2433f8[_0x3162('0x10')](0x1f4,_0x8a7bce[_0x3162('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 259cd5c..e172d0b 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 _0xf42e=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','multer','path'];(function(_0x29bbd7,_0x1a8615){var _0x4a4edf=function(_0x3aecbe){while(--_0x3aecbe){_0x29bbd7['push'](_0x29bbd7['shift']());}};_0x4a4edf(++_0x1a8615);}(_0xf42e,0xd0));var _0xef42=function(_0xcae521,_0x5a1676){_0xcae521=_0xcae521-0x0;var _0x45df4d=_0xf42e[_0xcae521];return _0x45df4d;};'use strict';var multer=require(_0xef42('0x0'));var util=require('util');var path=require(_0xef42('0x1'));var timeout=require(_0xef42('0x2'));var express=require('express');var router=express[_0xef42('0x3')]();var auth=require(_0xef42('0x4'));var interaction=require(_0xef42('0x5'));var config=require(_0xef42('0x6'));module['exports']=router; \ No newline at end of file +var _0xe632=['Router','../../components/auth/service','path','express'];(function(_0x32fc16,_0x26b884){var _0x262a81=function(_0x5a5941){while(--_0x5a5941){_0x32fc16['push'](_0x32fc16['shift']());}};_0x262a81(++_0x26b884);}(_0xe632,0x15a));var _0x2e63=function(_0x26bf04,_0x163dcb){_0x26bf04=_0x26bf04-0x0;var _0x1245f5=_0xe632[_0x26bf04];return _0x1245f5;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2e63('0x0'));var timeout=require('connect-timeout');var express=require(_0x2e63('0x1'));var router=express[_0x2e63('0x2')]();var auth=require(_0x2e63('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');module['exports']=router; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.attributes.js b/server/api/mailServerIn/mailServerIn.attributes.js index 9972e9e..ffda5c5 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 _0x96c7=['INBOX','sequelize','exports','STRING','BOOLEAN','username','INTEGER'];(function(_0x322c92,_0x105b45){var _0x23c1b7=function(_0x235120){while(--_0x235120){_0x322c92['push'](_0x322c92['shift']());}};_0x23c1b7(++_0x105b45);}(_0x96c7,0x119));var _0x796c=function(_0x59110b,_0x33d4f3){_0x59110b=_0x59110b-0x0;var _0xf69b32=_0x96c7[_0x59110b];return _0xf69b32;};'use strict';var Sequelize=require(_0x796c('0x0'));module[_0x796c('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x796c('0x2')]},'authentication':{'type':Sequelize[_0x796c('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x796c('0x2')],'unique':_0x796c('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x796c('0x5')]},'tls':{'type':Sequelize[_0x796c('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0x796c('0x6')},'connTimeout':{'type':Sequelize[_0x796c('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'service':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xde3e=['STRING','BOOLEAN','INTEGER','INBOX','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xde3e,0x1ad));var _0xede3=function(_0x1ae5ab,_0xc5d441){_0x1ae5ab=_0x1ae5ab-0x0;var _0x1ce001=_0xde3e[_0x1ae5ab];return _0x1ce001;};'use strict';var Sequelize=require(_0xede3('0x0'));module['exports']={'description':{'type':Sequelize[_0xede3('0x1')]},'host':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0xede3('0x2')],'defaultValue':!![]},'user':{'type':Sequelize[_0xede3('0x1')],'unique':'username'},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0xede3('0x3')]},'tls':{'type':Sequelize[_0xede3('0x2')],'defaultValue':!![]},'mailbox':{'type':Sequelize['STRING'],'defaultValue':_0xede3('0x4')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xede3('0x3')],'defaultValue':0x5},'service':{'type':Sequelize[_0xede3('0x1')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 55b9e24..f1dcb69 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 _0x0490=['exports','define','mail_servers_in','util','request-promise','path','rimraf','../../config/environment','./mailServerIn.attributes'];(function(_0xcdc54a,_0x216771){var _0x4c40c4=function(_0x4240f8){while(--_0x4240f8){_0xcdc54a['push'](_0xcdc54a['shift']());}};_0x4c40c4(++_0x216771);}(_0x0490,0x147));var _0x0049=function(_0x3ad08c,_0x25269d){_0x3ad08c=_0x3ad08c-0x0;var _0x310e06=_0x0490[_0x3ad08c];return _0x310e06;};'use strict';var _=require('lodash');var util=require(_0x0049('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x0049('0x1'));var fs=require('fs');var path=require(_0x0049('0x2'));var rimraf=require(_0x0049('0x3'));var config=require(_0x0049('0x4'));var attributes=require(_0x0049('0x5'));module[_0x0049('0x6')]=function(_0x2957b6,_0x4dde1){return _0x2957b6[_0x0049('0x7')]('MailServerIn',attributes,{'tableName':_0x0049('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6017=['../../config/environment','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x43c200,_0x317ad5){var _0x5e3c8e=function(_0x2f77bc){while(--_0x2f77bc){_0x43c200['push'](_0x43c200['shift']());}};_0x5e3c8e(++_0x317ad5);}(_0x6017,0xae));var _0x7601=function(_0x1007aa,_0x59410f){_0x1007aa=_0x1007aa-0x0;var _0x5869e1=_0x6017[_0x1007aa];return _0x5869e1;};'use strict';var _=require(_0x7601('0x0'));var util=require(_0x7601('0x1'));var logger=require(_0x7601('0x2'))('api');var moment=require(_0x7601('0x3'));var BPromise=require(_0x7601('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7601('0x5'));var rimraf=require('rimraf');var config=require(_0x7601('0x6'));var attributes=require('./mailServerIn.attributes');module['exports']=function(_0x425bf9,_0xc62b2c){return _0x425bf9[_0x7601('0x7')](_0x7601('0x8'),attributes,{'tableName':_0x7601('0x9'),'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 de2b645..a794034 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 _0x135e=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetMailServerIn','MailServerIn','findAll','options','raw','where','attributes','limit','include','model','map','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2e73ae,_0x503ec6){var _0xa3ae86=function(_0x1a5fc3){while(--_0x1a5fc3){_0x2e73ae['push'](_0x2e73ae['shift']());}};_0xa3ae86(++_0x503ec6);}(_0x135e,0x111));var _0xe135=function(_0x59e721,_0x42c1b8){_0x59e721=_0x59e721-0x0;var _0x446144=_0x135e[_0x59e721];return _0x446144;};'use strict';var _=require(_0xe135('0x0'));var util=require(_0xe135('0x1'));var moment=require(_0xe135('0x2'));var BPromise=require(_0xe135('0x3'));var rs=require(_0xe135('0x4'));var fs=require('fs');var Redis=require(_0xe135('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xe135('0x6'));var logger=require(_0xe135('0x7'))(_0xe135('0x8'));var config=require(_0xe135('0x9'));var jayson=require(_0xe135('0xa'));var client=jayson['client'][_0xe135('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x31e735,_0xa5d658,_0x5726e4){return new BPromise(function(_0x59b08d,_0x692d48){return client[_0xe135('0xc')](_0x31e735,_0x5726e4)[_0xe135('0xd')](function(_0x484912){logger[_0xe135('0xe')](_0xe135('0xf'),_0xa5d658,_0xe135('0x10'));logger[_0xe135('0x11')](_0xe135('0x12'),_0xa5d658,_0xe135('0x10'),JSON[_0xe135('0x13')](_0x484912));if(_0x484912[_0xe135('0x14')]){if(_0x484912['error'][_0xe135('0x15')]===0x1f4){logger['error'](_0xe135('0xf'),_0xa5d658,_0x484912[_0xe135('0x14')][_0xe135('0x16')]);return _0x692d48(_0x484912[_0xe135('0x14')][_0xe135('0x16')]);}logger['error'](_0xe135('0xf'),_0xa5d658,_0x484912[_0xe135('0x14')][_0xe135('0x16')]);return _0x59b08d(_0x484912[_0xe135('0x14')][_0xe135('0x16')]);}else{logger[_0xe135('0xe')](_0xe135('0xf'),_0xa5d658,'request\x20sent');_0x59b08d(_0x484912['result'][_0xe135('0x16')]);}})[_0xe135('0x17')](function(_0x413148){logger[_0xe135('0x14')](_0xe135('0xf'),_0xa5d658,_0x413148);_0x692d48(_0x413148);});});}exports[_0xe135('0x18')]=function(_0x29de93){var _0x183b5b=this;return new Promise(function(_0x3d78ce,_0x119f12){return db[_0xe135('0x19')][_0xe135('0x1a')]({'raw':_0x29de93[_0xe135('0x1b')]?_0x29de93['options'][_0xe135('0x1c')]===undefined?!![]:![]:!![],'where':_0x29de93[_0xe135('0x1b')]?_0x29de93[_0xe135('0x1b')][_0xe135('0x1d')]||null:null,'attributes':_0x29de93[_0xe135('0x1b')]?_0x29de93['options'][_0xe135('0x1e')]||null:null,'limit':_0x29de93[_0xe135('0x1b')]?_0x29de93[_0xe135('0x1b')][_0xe135('0x1f')]||null:null,'include':_0x29de93['options']?_0x29de93[_0xe135('0x1b')][_0xe135('0x20')]?_['map'](_0x29de93[_0xe135('0x1b')]['include'],function(_0x49ce06){return{'model':db[_0x49ce06[_0xe135('0x21')]],'as':_0x49ce06['as'],'attributes':_0x49ce06[_0xe135('0x1e')],'include':_0x49ce06[_0xe135('0x20')]?_[_0xe135('0x22')](_0x49ce06['include'],function(_0x126311){return{'model':db[_0x126311[_0xe135('0x21')]],'as':_0x126311['as'],'attributes':_0x126311[_0xe135('0x1e')],'include':_0x126311['include']?_[_0xe135('0x22')](_0x126311['include'],function(_0x193c04){return{'model':db[_0x193c04['model']],'as':_0x193c04['as'],'attributes':_0x193c04[_0xe135('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xe135('0xd')](function(_0x29361e){logger['info'](_0xe135('0x18'),_0x29de93);logger['debug'](_0xe135('0x18'),_0x29de93,JSON['stringify'](_0x29361e));_0x3d78ce(_0x29361e);})[_0xe135('0x17')](function(_0x5d1190){logger['error']('GetMailServerIn',_0x5d1190[_0xe135('0x16')],_0x29de93);_0x119f12(_0x183b5b[_0xe135('0x14')](0x1f4,_0x5d1190[_0xe135('0x16')]));});});}; \ No newline at end of file +var _0x237e=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','then','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','MailServerIn','findAll','options','raw','include','attributes','map','model','GetMailServerIn','stringify'];(function(_0x58a769,_0x1befa6){var _0xfa17b4=function(_0x14494e){while(--_0x14494e){_0x58a769['push'](_0x58a769['shift']());}};_0xfa17b4(++_0x1befa6);}(_0x237e,0x70));var _0xe237=function(_0x8f4683,_0x2fac23){_0x8f4683=_0x8f4683-0x0;var _0x236e46=_0x237e[_0x8f4683];return _0x236e46;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe237('0x0'));var fs=require('fs');var Redis=require(_0xe237('0x1'));var db=require(_0xe237('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xe237('0x3'))('rpc');var config=require(_0xe237('0x4'));var jayson=require(_0xe237('0x5'));var client=jayson[_0xe237('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1218ba,_0x3289cf,_0x4b11f6){return new BPromise(function(_0x2dfb6b,_0x2818dd){return client['request'](_0x1218ba,_0x4b11f6)[_0xe237('0x7')](function(_0x4d6c0c){logger[_0xe237('0x8')](_0xe237('0x9'),_0x3289cf,_0xe237('0xa'));logger[_0xe237('0xb')](_0xe237('0xc'),_0x3289cf,_0xe237('0xa'),JSON['stringify'](_0x4d6c0c));if(_0x4d6c0c[_0xe237('0xd')]){if(_0x4d6c0c[_0xe237('0xd')][_0xe237('0xe')]===0x1f4){logger[_0xe237('0xd')](_0xe237('0x9'),_0x3289cf,_0x4d6c0c['error'][_0xe237('0xf')]);return _0x2818dd(_0x4d6c0c[_0xe237('0xd')][_0xe237('0xf')]);}logger[_0xe237('0xd')]('MailServerIn,\x20%s,\x20%s',_0x3289cf,_0x4d6c0c['error'][_0xe237('0xf')]);return _0x2dfb6b(_0x4d6c0c[_0xe237('0xd')][_0xe237('0xf')]);}else{logger[_0xe237('0x8')](_0xe237('0x9'),_0x3289cf,_0xe237('0xa'));_0x2dfb6b(_0x4d6c0c[_0xe237('0x10')]['message']);}})[_0xe237('0x11')](function(_0x3e855b){logger[_0xe237('0xd')](_0xe237('0x9'),_0x3289cf,_0x3e855b);_0x2818dd(_0x3e855b);});});}exports['GetMailServerIn']=function(_0x1487aa){var _0x2365cb=this;return new Promise(function(_0xec9ec9,_0x63f8d5){return db[_0xe237('0x12')][_0xe237('0x13')]({'raw':_0x1487aa[_0xe237('0x14')]?_0x1487aa['options'][_0xe237('0x15')]===undefined?!![]:![]:!![],'where':_0x1487aa[_0xe237('0x14')]?_0x1487aa[_0xe237('0x14')]['where']||null:null,'attributes':_0x1487aa['options']?_0x1487aa[_0xe237('0x14')]['attributes']||null:null,'limit':_0x1487aa['options']?_0x1487aa[_0xe237('0x14')]['limit']||null:null,'include':_0x1487aa['options']?_0x1487aa[_0xe237('0x14')][_0xe237('0x16')]?_['map'](_0x1487aa['options']['include'],function(_0x4b1d56){return{'model':db[_0x4b1d56['model']],'as':_0x4b1d56['as'],'attributes':_0x4b1d56[_0xe237('0x17')],'include':_0x4b1d56[_0xe237('0x16')]?_[_0xe237('0x18')](_0x4b1d56['include'],function(_0x159719){return{'model':db[_0x159719[_0xe237('0x19')]],'as':_0x159719['as'],'attributes':_0x159719['attributes'],'include':_0x159719[_0xe237('0x16')]?_[_0xe237('0x18')](_0x159719[_0xe237('0x16')],function(_0x496de7){return{'model':db[_0x496de7[_0xe237('0x19')]],'as':_0x496de7['as'],'attributes':_0x496de7['attributes']};}):[]};}):[]};}):[]:[]})[_0xe237('0x7')](function(_0x57c5bc){logger[_0xe237('0x8')](_0xe237('0x1a'),_0x1487aa);logger[_0xe237('0xb')](_0xe237('0x1a'),_0x1487aa,JSON[_0xe237('0x1b')](_0x57c5bc));_0xec9ec9(_0x57c5bc);})[_0xe237('0x11')](function(_0x4ecf80){logger['error'](_0xe237('0x1a'),_0x4ecf80[_0xe237('0xf')],_0x1487aa);_0x63f8d5(_0x2365cb[_0xe237('0xd')](0x1f4,_0x4ecf80[_0xe237('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index a0f644e..dd83654 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 _0xcea7=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index','show','post','put','/:id','exports','multer','util'];(function(_0x5b37f9,_0x311ec1){var _0x5945e2=function(_0x5af157){while(--_0x5af157){_0x5b37f9['push'](_0x5b37f9['shift']());}};_0x5945e2(++_0x311ec1);}(_0xcea7,0xce));var _0x7cea=function(_0x4a33d2,_0x86761d){_0x4a33d2=_0x4a33d2-0x0;var _0x4c1e85=_0xcea7[_0x4a33d2];return _0x4c1e85;};'use strict';var multer=require(_0x7cea('0x0'));var util=require(_0x7cea('0x1'));var path=require(_0x7cea('0x2'));var timeout=require(_0x7cea('0x3'));var express=require(_0x7cea('0x4'));var router=express[_0x7cea('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7cea('0x6'));var config=require(_0x7cea('0x7'));var controller=require(_0x7cea('0x8'));router['get']('/',auth[_0x7cea('0x9')](),controller[_0x7cea('0xa')]);router['get']('/:id',auth[_0x7cea('0x9')](),controller[_0x7cea('0xb')]);router[_0x7cea('0xc')]('/',auth[_0x7cea('0x9')](),controller['create']);router[_0x7cea('0xd')](_0x7cea('0xe'),auth[_0x7cea('0x9')](),controller['update']);router['delete'](_0x7cea('0xe'),auth[_0x7cea('0x9')](),controller['destroy']);module[_0x7cea('0xf')]=router; \ No newline at end of file +var _0x8a3e=['/:id','show','post','create','update','delete','destroy','exports','multer','util','path','Router','../../config/environment','get','isAuthenticated','index'];(function(_0x3e6016,_0x46f40f){var _0x2f2190=function(_0x288f26){while(--_0x288f26){_0x3e6016['push'](_0x3e6016['shift']());}};_0x2f2190(++_0x46f40f);}(_0x8a3e,0xb8));var _0xe8a3=function(_0x2292c8,_0x37a9fc){_0x2292c8=_0x2292c8-0x0;var _0x21bc97=_0x8a3e[_0x2292c8];return _0x21bc97;};'use strict';var multer=require(_0xe8a3('0x0'));var util=require(_0xe8a3('0x1'));var path=require(_0xe8a3('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xe8a3('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xe8a3('0x4'));var controller=require('./mailServerOut.controller');router[_0xe8a3('0x5')]('/',auth[_0xe8a3('0x6')](),controller[_0xe8a3('0x7')]);router[_0xe8a3('0x5')](_0xe8a3('0x8'),auth[_0xe8a3('0x6')](),controller[_0xe8a3('0x9')]);router[_0xe8a3('0xa')]('/',auth[_0xe8a3('0x6')](),controller[_0xe8a3('0xb')]);router['put'](_0xe8a3('0x8'),auth[_0xe8a3('0x6')](),controller[_0xe8a3('0xc')]);router[_0xe8a3('0xd')](_0xe8a3('0x8'),auth[_0xe8a3('0x6')](),controller[_0xe8a3('0xe')]);module[_0xe8a3('0xf')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index c82ff8a..f62062e 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 _0x4819=['BOOLEAN','exports','STRING','INTEGER'];(function(_0x297d59,_0x5da5c1){var _0x7e8f68=function(_0xb76b03){while(--_0xb76b03){_0x297d59['push'](_0x297d59['shift']());}};_0x7e8f68(++_0x5da5c1);}(_0x4819,0xcd));var _0x9481=function(_0x233282,_0x305444){_0x233282=_0x233282-0x0;var _0x387f16=_0x4819[_0x233282];return _0x387f16;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'description':{'type':Sequelize[_0x9481('0x1')]},'host':{'type':Sequelize[_0x9481('0x1')]},'user':{'type':Sequelize[_0x9481('0x1')]},'pass':{'type':Sequelize[_0x9481('0x1')]},'port':{'type':Sequelize[_0x9481('0x2')]},'secure':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0x9481('0x1')]},'authentication':{'type':Sequelize[_0x9481('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x1ffe=['sequelize','exports','STRING','INTEGER','BOOLEAN'];(function(_0x31b2a5,_0x2480b4){var _0x198fa4=function(_0x1414b9){while(--_0x1414b9){_0x31b2a5['push'](_0x31b2a5['shift']());}};_0x198fa4(++_0x2480b4);}(_0x1ffe,0xa5));var _0xe1ff=function(_0x57cd60,_0x447e69){_0x57cd60=_0x57cd60-0x0;var _0x28fc41=_0x1ffe[_0x57cd60];return _0x28fc41;};'use strict';var Sequelize=require(_0xe1ff('0x0'));module[_0xe1ff('0x1')]={'description':{'type':Sequelize[_0xe1ff('0x2')]},'host':{'type':Sequelize[_0xe1ff('0x2')]},'user':{'type':Sequelize[_0xe1ff('0x2')]},'pass':{'type':Sequelize[_0xe1ff('0x2')]},'port':{'type':Sequelize[_0xe1ff('0x3')]},'secure':{'type':Sequelize[_0xe1ff('0x4')],'defaultValue':![]},'service':{'type':Sequelize[_0xe1ff('0x2')]},'authentication':{'type':Sequelize[_0xe1ff('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 11c976d..1b091f6 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 _0x6173=['Content-Range','apply','reject','save','then','error','stack','name','index','map','MailServerOut','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter','merge','options','where','includeAll','include','rows','show','params','keys','find','catch','body','destroy','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set'];(function(_0x423da1,_0x51ea72){var _0x2320c1=function(_0x34b9f5){while(--_0x34b9f5){_0x423da1['push'](_0x423da1['shift']());}};_0x2320c1(++_0x51ea72);}(_0x6173,0x74));var _0x3617=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x6173[_0x199572];return _0x13cfa3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3617('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x3617('0x1'));var jsonpatch=require(_0x3617('0x2'));var rp=require(_0x3617('0x3'));var moment=require(_0x3617('0x4'));var BPromise=require(_0x3617('0x5'));var Mustache=require(_0x3617('0x6'));var util=require(_0x3617('0x7'));var path=require(_0x3617('0x8'));var sox=require(_0x3617('0x9'));var csv=require(_0x3617('0xa'));var ejs=require(_0x3617('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3617('0xc'));var crypto=require(_0x3617('0xd'));var jsforce=require(_0x3617('0xe'));var deskjs=require(_0x3617('0xf'));var toCsv=require(_0x3617('0xa'));var querystring=require(_0x3617('0x10'));var Papa=require('papaparse');var Redis=require(_0x3617('0x11'));var authService=require(_0x3617('0x12'));var qs=require(_0x3617('0x13'));var as=require(_0x3617('0x14'));var hardwareService=require(_0x3617('0x15'));var logger=require('../../config/logger')(_0x3617('0x16'));var utils=require(_0x3617('0x17'));var config=require(_0x3617('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31388a,_0x391561){_0x391561=_0x391561||0xcc;return function(_0x49e574){if(_0x49e574){return _0x31388a[_0x3617('0x19')](_0x391561);}return _0x31388a[_0x3617('0x1a')](_0x391561)[_0x3617('0x1b')]();};}function respondWithResult(_0x18d885,_0x546a87){_0x546a87=_0x546a87||0xc8;return function(_0x2d9a2c){if(_0x2d9a2c){return _0x18d885['status'](_0x546a87)[_0x3617('0x1c')](_0x2d9a2c);}};}function respondWithFilteredResult(_0x165c84,_0x4c7b23){return function(_0x150071){if(_0x150071){var _0x126e38=_0x150071[_0x3617('0x1d')],_0x4ddd9d=_0x4c7b23[_0x3617('0x1e')],_0x48075c=_0x4c7b23[_0x3617('0x1e')]+_0x4c7b23['limit'],_0x4c600d;if(_0x48075c>=_0x126e38){_0x48075c=_0x126e38;_0x4c600d=0xc8;}else{_0x4c600d=0xce;}_0x165c84[_0x3617('0x1a')](_0x4c600d);return _0x165c84[_0x3617('0x1f')](_0x3617('0x20'),_0x4ddd9d+'-'+_0x48075c+'/'+_0x126e38)['json'](_0x150071);}return null;};}function patchUpdates(_0x48a8ea){return function(_0x3d6677){try{jsonpatch[_0x3617('0x21')](_0x3d6677,_0x48a8ea,!![]);}catch(_0x893f9e){return BPromise[_0x3617('0x22')](_0x893f9e);}return _0x3d6677[_0x3617('0x23')]();};}function saveUpdates(_0x368ecf,_0x45f0df){return function(_0x36f097){if(_0x36f097){return _0x36f097['update'](_0x368ecf)[_0x3617('0x24')](function(_0x26d694){return _0x26d694;});}return null;};}function removeEntity(_0x314406,_0x2cd003){return function(_0x158eca){if(_0x158eca){return _0x158eca['destroy']()['then'](function(){_0x314406[_0x3617('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd4265a,_0x2311fd){return function(_0x5c5f45){if(!_0x5c5f45){_0xd4265a[_0x3617('0x19')](0x194);}return _0x5c5f45;};}function handleError(_0x1a8088,_0x28442a){_0x28442a=_0x28442a||0x1f4;return function(_0x3856ac){logger[_0x3617('0x25')](_0x3856ac[_0x3617('0x26')]);if(_0x3856ac[_0x3617('0x27')]){delete _0x3856ac[_0x3617('0x27')];}_0x1a8088['status'](_0x28442a)['send'](_0x3856ac);};}exports[_0x3617('0x28')]=function(_0x45e9c6,_0x5acc79){var _0xae32be={},_0x1ec4d2={},_0x92445e={'count':0x0,'rows':[]};var _0x2ed7a4=_[_0x3617('0x29')](db[_0x3617('0x2a')][_0x3617('0x2b')],function(_0x183107){return{'name':_0x183107[_0x3617('0x2c')],'type':_0x183107[_0x3617('0x2d')][_0x3617('0x2e')]};});_0x1ec4d2[_0x3617('0x2f')]=_[_0x3617('0x29')](_0x2ed7a4,_0x3617('0x27'));_0x1ec4d2[_0x3617('0x30')]=_['keys'](_0x45e9c6['query']);_0x1ec4d2[_0x3617('0x31')]=_[_0x3617('0x32')](_0x1ec4d2['model'],_0x1ec4d2[_0x3617('0x30')]);_0xae32be[_0x3617('0x33')]=_[_0x3617('0x32')](_0x1ec4d2[_0x3617('0x2f')],qs['fields'](_0x45e9c6[_0x3617('0x30')][_0x3617('0x34')]));_0xae32be['attributes']=_0xae32be[_0x3617('0x33')][_0x3617('0x35')]?_0xae32be[_0x3617('0x33')]:_0x1ec4d2[_0x3617('0x2f')];if(!_0x45e9c6[_0x3617('0x30')][_0x3617('0x36')](_0x3617('0x37'))){_0xae32be[_0x3617('0x38')]=qs[_0x3617('0x38')](_0x45e9c6['query']['limit']);_0xae32be[_0x3617('0x1e')]=qs[_0x3617('0x1e')](_0x45e9c6[_0x3617('0x30')]['offset']);}_0xae32be[_0x3617('0x39')]=qs['sort'](_0x45e9c6[_0x3617('0x30')][_0x3617('0x3a')]);_0xae32be['where']=qs[_0x3617('0x31')](_[_0x3617('0x3b')](_0x45e9c6['query'],_0x1ec4d2[_0x3617('0x31')]));if(_0x45e9c6[_0x3617('0x30')][_0x3617('0x3c')]){_0xae32be['where']=_[_0x3617('0x3d')](_0xae32be['where'],{'$or':_[_0x3617('0x29')](_0x2ed7a4,function(_0x416704){if(_0x416704[_0x3617('0x2d')]!=='VIRTUAL'){var _0x5e07a0={};_0x5e07a0[_0x416704['name']]={'$like':'%'+_0x45e9c6[_0x3617('0x30')][_0x3617('0x3c')]+'%'};return _0x5e07a0;}})});}_0xae32be=_['merge']({},_0xae32be,_0x45e9c6[_0x3617('0x3e')]);var _0x525d99={'where':_0xae32be[_0x3617('0x3f')]};return db[_0x3617('0x2a')][_0x3617('0x1d')](_0x525d99)[_0x3617('0x24')](function(_0x3ee461){_0x92445e[_0x3617('0x1d')]=_0x3ee461;if(_0x45e9c6['query'][_0x3617('0x40')]){_0xae32be[_0x3617('0x41')]=[{'all':!![]}];}return db[_0x3617('0x2a')]['findAll'](_0xae32be);})[_0x3617('0x24')](function(_0x4d8920){_0x92445e[_0x3617('0x42')]=_0x4d8920;return _0x92445e;})[_0x3617('0x24')](respondWithFilteredResult(_0x5acc79,_0xae32be))['catch'](handleError(_0x5acc79,null));};exports[_0x3617('0x43')]=function(_0xb280c9,_0x345eca){var _0x1e5571={'raw':!![],'where':{'id':_0xb280c9[_0x3617('0x44')]['id']}},_0x4afe78={};_0x4afe78[_0x3617('0x2f')]=_[_0x3617('0x45')](db[_0x3617('0x2a')][_0x3617('0x2b')]);_0x4afe78['query']=_[_0x3617('0x45')](_0xb280c9[_0x3617('0x30')]);_0x4afe78[_0x3617('0x31')]=_['intersection'](_0x4afe78[_0x3617('0x2f')],_0x4afe78[_0x3617('0x30')]);_0x1e5571[_0x3617('0x33')]=_[_0x3617('0x32')](_0x4afe78[_0x3617('0x2f')],qs['fields'](_0xb280c9[_0x3617('0x30')][_0x3617('0x34')]));_0x1e5571[_0x3617('0x33')]=_0x1e5571[_0x3617('0x33')][_0x3617('0x35')]?_0x1e5571['attributes']:_0x4afe78['model'];if(_0xb280c9[_0x3617('0x30')][_0x3617('0x40')]){_0x1e5571[_0x3617('0x41')]=[{'all':!![]}];}_0x1e5571=_[_0x3617('0x3d')]({},_0x1e5571,_0xb280c9[_0x3617('0x3e')]);return db[_0x3617('0x2a')][_0x3617('0x46')](_0x1e5571)[_0x3617('0x24')](handleEntityNotFound(_0x345eca,null))[_0x3617('0x24')](respondWithResult(_0x345eca,null))[_0x3617('0x47')](handleError(_0x345eca,null));};exports['create']=function(_0x41eab4,_0x4cfcc1){return db[_0x3617('0x2a')]['create'](_0x41eab4[_0x3617('0x48')],{})[_0x3617('0x24')](respondWithResult(_0x4cfcc1,0xc9))[_0x3617('0x47')](handleError(_0x4cfcc1,null));};exports['update']=function(_0x560e41,_0x208ec4){if(_0x560e41[_0x3617('0x48')]['id']){delete _0x560e41[_0x3617('0x48')]['id'];}return db[_0x3617('0x2a')][_0x3617('0x46')]({'where':{'id':_0x560e41[_0x3617('0x44')]['id']}})[_0x3617('0x24')](handleEntityNotFound(_0x208ec4,null))['then'](saveUpdates(_0x560e41[_0x3617('0x48')],null))[_0x3617('0x24')](respondWithResult(_0x208ec4,null))[_0x3617('0x47')](handleError(_0x208ec4,null));};exports[_0x3617('0x49')]=function(_0x4e8e1b,_0x4de31e){return db[_0x3617('0x2a')][_0x3617('0x46')]({'where':{'id':_0x4e8e1b[_0x3617('0x44')]['id']}})[_0x3617('0x24')](handleEntityNotFound(_0x4de31e,null))[_0x3617('0x24')](removeEntity(_0x4de31e,null))[_0x3617('0x47')](handleError(_0x4de31e,null));}; \ No newline at end of file +var _0x0297=['VIRTUAL','filter','options','include','findAll','catch','show','params','includeAll','merge','create','body','update','find','destroy','eml-format','rimraf','zip-dir','bluebird','mustache','util','path','to-csv','ejs','squel','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error','stack','name','send','index','map','MailServerOut','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x2157ab,_0x379b9d){var _0x4d1011=function(_0x2652fa){while(--_0x2652fa){_0x2157ab['push'](_0x2157ab['shift']());}};_0x4d1011(++_0x379b9d);}(_0x0297,0x1a7));var _0x7029=function(_0x253ccf,_0x2a0b82){_0x253ccf=_0x253ccf-0x0;var _0x4061da=_0x0297[_0x253ccf];return _0x4061da;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7029('0x0'));var rimraf=require(_0x7029('0x1'));var zipdir=require(_0x7029('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7029('0x3'));var Mustache=require(_0x7029('0x4'));var util=require(_0x7029('0x5'));var path=require(_0x7029('0x6'));var sox=require('sox');var csv=require(_0x7029('0x7'));var ejs=require(_0x7029('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7029('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7029('0xa'));var toCsv=require(_0x7029('0x7'));var querystring=require(_0x7029('0xb'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x7029('0xc'));var as=require(_0x7029('0xd'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7029('0xe'))('api');var utils=require(_0x7029('0xf'));var config=require('../../config/environment');var db=require(_0x7029('0x10'))['db'];function respondWithStatusCode(_0x402e3b,_0x44dee3){_0x44dee3=_0x44dee3||0xcc;return function(_0x2345cf){if(_0x2345cf){return _0x402e3b[_0x7029('0x11')](_0x44dee3);}return _0x402e3b[_0x7029('0x12')](_0x44dee3)[_0x7029('0x13')]();};}function respondWithResult(_0x59b99a,_0x4eaf20){_0x4eaf20=_0x4eaf20||0xc8;return function(_0x91f31d){if(_0x91f31d){return _0x59b99a['status'](_0x4eaf20)[_0x7029('0x14')](_0x91f31d);}};}function respondWithFilteredResult(_0x4126e1,_0x59dbbf){return function(_0x3e9bfd){if(_0x3e9bfd){var _0x2344db=_0x3e9bfd[_0x7029('0x15')],_0x4b8149=_0x59dbbf[_0x7029('0x16')],_0x30ef38=_0x59dbbf[_0x7029('0x16')]+_0x59dbbf[_0x7029('0x17')],_0x292e3e;if(_0x30ef38>=_0x2344db){_0x30ef38=_0x2344db;_0x292e3e=0xc8;}else{_0x292e3e=0xce;}_0x4126e1[_0x7029('0x12')](_0x292e3e);return _0x4126e1[_0x7029('0x18')](_0x7029('0x19'),_0x4b8149+'-'+_0x30ef38+'/'+_0x2344db)[_0x7029('0x14')](_0x3e9bfd);}return null;};}function patchUpdates(_0x543e88){return function(_0xda0a8f){try{jsonpatch[_0x7029('0x1a')](_0xda0a8f,_0x543e88,!![]);}catch(_0x353922){return BPromise[_0x7029('0x1b')](_0x353922);}return _0xda0a8f[_0x7029('0x1c')]();};}function saveUpdates(_0x47fa00,_0x590762){return function(_0x2069b7){if(_0x2069b7){return _0x2069b7['update'](_0x47fa00)[_0x7029('0x1d')](function(_0x7de7fc){return _0x7de7fc;});}return null;};}function removeEntity(_0xfb5289,_0xc6eb9d){return function(_0x30b667){if(_0x30b667){return _0x30b667['destroy']()[_0x7029('0x1d')](function(){_0xfb5289[_0x7029('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3813ed,_0x3a1394){return function(_0xf7ad1a){if(!_0xf7ad1a){_0x3813ed[_0x7029('0x11')](0x194);}return _0xf7ad1a;};}function handleError(_0x1c8691,_0x136609){_0x136609=_0x136609||0x1f4;return function(_0x571dbf){logger[_0x7029('0x1e')](_0x571dbf[_0x7029('0x1f')]);if(_0x571dbf['name']){delete _0x571dbf[_0x7029('0x20')];}_0x1c8691[_0x7029('0x12')](_0x136609)[_0x7029('0x21')](_0x571dbf);};}exports[_0x7029('0x22')]=function(_0x42b626,_0x581d5f){var _0x1c12bf={},_0x210f11={},_0x54ac4f={'count':0x0,'rows':[]};var _0x15aabe=_[_0x7029('0x23')](db[_0x7029('0x24')]['rawAttributes'],function(_0x1675d2){return{'name':_0x1675d2['fieldName'],'type':_0x1675d2[_0x7029('0x25')][_0x7029('0x26')]};});_0x210f11[_0x7029('0x27')]=_['map'](_0x15aabe,_0x7029('0x20'));_0x210f11[_0x7029('0x28')]=_[_0x7029('0x29')](_0x42b626[_0x7029('0x28')]);_0x210f11[_0x7029('0x2a')]=_[_0x7029('0x2b')](_0x210f11[_0x7029('0x27')],_0x210f11['query']);_0x1c12bf[_0x7029('0x2c')]=_['intersection'](_0x210f11[_0x7029('0x27')],qs[_0x7029('0x2d')](_0x42b626[_0x7029('0x28')][_0x7029('0x2d')]));_0x1c12bf[_0x7029('0x2c')]=_0x1c12bf[_0x7029('0x2c')][_0x7029('0x2e')]?_0x1c12bf[_0x7029('0x2c')]:_0x210f11[_0x7029('0x27')];if(!_0x42b626[_0x7029('0x28')][_0x7029('0x2f')](_0x7029('0x30'))){_0x1c12bf[_0x7029('0x17')]=qs[_0x7029('0x17')](_0x42b626[_0x7029('0x28')]['limit']);_0x1c12bf['offset']=qs[_0x7029('0x16')](_0x42b626[_0x7029('0x28')][_0x7029('0x16')]);}_0x1c12bf[_0x7029('0x31')]=qs[_0x7029('0x32')](_0x42b626[_0x7029('0x28')][_0x7029('0x32')]);_0x1c12bf[_0x7029('0x33')]=qs[_0x7029('0x2a')](_[_0x7029('0x34')](_0x42b626['query'],_0x210f11['filters']));if(_0x42b626['query']['filter']){_0x1c12bf[_0x7029('0x33')]=_['merge'](_0x1c12bf['where'],{'$or':_[_0x7029('0x23')](_0x15aabe,function(_0x59b031){if(_0x59b031[_0x7029('0x25')]!==_0x7029('0x35')){var _0x577de4={};_0x577de4[_0x59b031['name']]={'$like':'%'+_0x42b626['query'][_0x7029('0x36')]+'%'};return _0x577de4;}})});}_0x1c12bf=_['merge']({},_0x1c12bf,_0x42b626[_0x7029('0x37')]);var _0x16c65b={'where':_0x1c12bf[_0x7029('0x33')]};return db[_0x7029('0x24')]['count'](_0x16c65b)[_0x7029('0x1d')](function(_0xaadcd5){_0x54ac4f['count']=_0xaadcd5;if(_0x42b626['query']['includeAll']){_0x1c12bf[_0x7029('0x38')]=[{'all':!![]}];}return db['MailServerOut'][_0x7029('0x39')](_0x1c12bf);})['then'](function(_0xbc6cbe){_0x54ac4f['rows']=_0xbc6cbe;return _0x54ac4f;})['then'](respondWithFilteredResult(_0x581d5f,_0x1c12bf))[_0x7029('0x3a')](handleError(_0x581d5f,null));};exports[_0x7029('0x3b')]=function(_0x151ad1,_0x290f29){var _0x55083f={'raw':!![],'where':{'id':_0x151ad1[_0x7029('0x3c')]['id']}},_0x25c039={};_0x25c039['model']=_[_0x7029('0x29')](db['MailServerOut']['rawAttributes']);_0x25c039[_0x7029('0x28')]=_[_0x7029('0x29')](_0x151ad1[_0x7029('0x28')]);_0x25c039[_0x7029('0x2a')]=_[_0x7029('0x2b')](_0x25c039[_0x7029('0x27')],_0x25c039['query']);_0x55083f[_0x7029('0x2c')]=_[_0x7029('0x2b')](_0x25c039['model'],qs[_0x7029('0x2d')](_0x151ad1[_0x7029('0x28')][_0x7029('0x2d')]));_0x55083f['attributes']=_0x55083f[_0x7029('0x2c')][_0x7029('0x2e')]?_0x55083f['attributes']:_0x25c039[_0x7029('0x27')];if(_0x151ad1[_0x7029('0x28')][_0x7029('0x3d')]){_0x55083f['include']=[{'all':!![]}];}_0x55083f=_[_0x7029('0x3e')]({},_0x55083f,_0x151ad1[_0x7029('0x37')]);return db[_0x7029('0x24')]['find'](_0x55083f)[_0x7029('0x1d')](handleEntityNotFound(_0x290f29,null))['then'](respondWithResult(_0x290f29,null))[_0x7029('0x3a')](handleError(_0x290f29,null));};exports[_0x7029('0x3f')]=function(_0x3d6c67,_0x201bfb){return db['MailServerOut'][_0x7029('0x3f')](_0x3d6c67[_0x7029('0x40')],{})[_0x7029('0x1d')](respondWithResult(_0x201bfb,0xc9))[_0x7029('0x3a')](handleError(_0x201bfb,null));};exports[_0x7029('0x41')]=function(_0x42ba73,_0x29fe6d){if(_0x42ba73[_0x7029('0x40')]['id']){delete _0x42ba73[_0x7029('0x40')]['id'];}return db[_0x7029('0x24')][_0x7029('0x42')]({'where':{'id':_0x42ba73['params']['id']}})['then'](handleEntityNotFound(_0x29fe6d,null))['then'](saveUpdates(_0x42ba73[_0x7029('0x40')],null))[_0x7029('0x1d')](respondWithResult(_0x29fe6d,null))[_0x7029('0x3a')](handleError(_0x29fe6d,null));};exports[_0x7029('0x43')]=function(_0x3bf983,_0x1e166d){return db[_0x7029('0x24')][_0x7029('0x42')]({'where':{'id':_0x3bf983['params']['id']}})[_0x7029('0x1d')](handleEntityNotFound(_0x1e166d,null))['then'](removeEntity(_0x1e166d,null))[_0x7029('0x3a')](handleError(_0x1e166d,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index 704ff38..ea0047b 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 _0x187d=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x3c271e,_0x2c708e){var _0x315128=function(_0x315fe0){while(--_0x315fe0){_0x3c271e['push'](_0x3c271e['shift']());}};_0x315128(++_0x2c708e);}(_0x187d,0x93));var _0xd187=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x187d[_0x6131cd];return _0x47e916;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdc97=['path','../../config/environment','./mailServerOut.attributes','exports','define','lodash','util','../../config/logger','moment','request-promise'];(function(_0x2e7426,_0x21caa7){var _0x4ddeb6=function(_0x37c23c){while(--_0x37c23c){_0x2e7426['push'](_0x2e7426['shift']());}};_0x4ddeb6(++_0x21caa7);}(_0xdc97,0x13b));var _0x7dc9=function(_0x2b2f50,_0x2b86d){_0x2b2f50=_0x2b2f50-0x0;var _0xf333d6=_0xdc97[_0x2b2f50];return _0xf333d6;};'use strict';var _=require(_0x7dc9('0x0'));var util=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('api');var moment=require(_0x7dc9('0x3'));var BPromise=require('bluebird');var rp=require(_0x7dc9('0x4'));var fs=require('fs');var path=require(_0x7dc9('0x5'));var rimraf=require('rimraf');var config=require(_0x7dc9('0x6'));var attributes=require(_0x7dc9('0x7'));module[_0x7dc9('0x8')]=function(_0x3ba3ca,_0x589f02){return _0x3ba3ca[_0x7dc9('0x9')]('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 0866456..26b84c6 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 _0x3979=['message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','then','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code'];(function(_0x2761e0,_0x45ee98){var _0x183622=function(_0x5646b4){while(--_0x5646b4){_0x2761e0['push'](_0x2761e0['shift']());}};_0x183622(++_0x45ee98);}(_0x3979,0xe0));var _0x9397=function(_0x31be34,_0x37ca7c){_0x31be34=_0x31be34-0x0;var _0x10492d=_0x3979[_0x31be34];return _0x10492d;};'use strict';var _=require(_0x9397('0x0'));var util=require(_0x9397('0x1'));var moment=require(_0x9397('0x2'));var BPromise=require(_0x9397('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9397('0x4'));var db=require(_0x9397('0x5'))['db'];var utils=require(_0x9397('0x6'));var logger=require(_0x9397('0x7'))(_0x9397('0x8'));var config=require('../../config/environment');var jayson=require(_0x9397('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd4b6d5,_0x4ad42c,_0x2a94d0){return new BPromise(function(_0x1d9a82,_0x39a017){return client[_0x9397('0xa')](_0xd4b6d5,_0x2a94d0)[_0x9397('0xb')](function(_0x42a152){logger['info'](_0x9397('0xc'),_0x4ad42c,_0x9397('0xd'));logger[_0x9397('0xe')]('MailServerOut,\x20%s,\x20%s,\x20%s',_0x4ad42c,'request\x20sent',JSON[_0x9397('0xf')](_0x42a152));if(_0x42a152[_0x9397('0x10')]){if(_0x42a152[_0x9397('0x10')][_0x9397('0x11')]===0x1f4){logger[_0x9397('0x10')](_0x9397('0xc'),_0x4ad42c,_0x42a152[_0x9397('0x10')]['message']);return _0x39a017(_0x42a152[_0x9397('0x10')][_0x9397('0x12')]);}logger[_0x9397('0x10')]('MailServerOut,\x20%s,\x20%s',_0x4ad42c,_0x42a152[_0x9397('0x10')]['message']);return _0x1d9a82(_0x42a152['error'][_0x9397('0x12')]);}else{logger[_0x9397('0x13')]('MailServerOut,\x20%s,\x20%s',_0x4ad42c,_0x9397('0xd'));_0x1d9a82(_0x42a152[_0x9397('0x14')][_0x9397('0x12')]);}})[_0x9397('0x15')](function(_0x305220){logger[_0x9397('0x10')](_0x9397('0xc'),_0x4ad42c,_0x305220);_0x39a017(_0x305220);});});} \ No newline at end of file +var _0x1b56=['MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x4b7b62,_0x4920a9){var _0x2280df=function(_0x21e1f8){while(--_0x21e1f8){_0x4b7b62['push'](_0x4b7b62['shift']());}};_0x2280df(++_0x4920a9);}(_0x1b56,0xd8));var _0x61b5=function(_0x599e60,_0x5b6519){_0x599e60=_0x599e60-0x0;var _0x468e19=_0x1b56[_0x599e60];return _0x468e19;};'use strict';var _=require(_0x61b5('0x0'));var util=require('util');var moment=require(_0x61b5('0x1'));var BPromise=require(_0x61b5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x61b5('0x3'));var db=require(_0x61b5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x61b5('0x5'));var config=require(_0x61b5('0x6'));var jayson=require(_0x61b5('0x7'));var client=jayson[_0x61b5('0x8')][_0x61b5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2c7c6e,_0x1c4354,_0x48db8a){return new BPromise(function(_0x30d088,_0x13fd1e){return client[_0x61b5('0xa')](_0x2c7c6e,_0x48db8a)[_0x61b5('0xb')](function(_0x46a665){logger['info'](_0x61b5('0xc'),_0x1c4354,_0x61b5('0xd'));logger['debug'](_0x61b5('0xe'),_0x1c4354,_0x61b5('0xd'),JSON['stringify'](_0x46a665));if(_0x46a665[_0x61b5('0xf')]){if(_0x46a665[_0x61b5('0xf')][_0x61b5('0x10')]===0x1f4){logger[_0x61b5('0xf')](_0x61b5('0xc'),_0x1c4354,_0x46a665[_0x61b5('0xf')][_0x61b5('0x11')]);return _0x13fd1e(_0x46a665[_0x61b5('0xf')][_0x61b5('0x11')]);}logger['error']('MailServerOut,\x20%s,\x20%s',_0x1c4354,_0x46a665[_0x61b5('0xf')][_0x61b5('0x11')]);return _0x30d088(_0x46a665[_0x61b5('0xf')][_0x61b5('0x11')]);}else{logger['info'](_0x61b5('0xc'),_0x1c4354,_0x61b5('0xd'));_0x30d088(_0x46a665['result'][_0x61b5('0x11')]);}})[_0x61b5('0x12')](function(_0x940caa){logger[_0x61b5('0xf')](_0x61b5('0xc'),_0x1c4354,_0x940caa);_0x13fd1e(_0x940caa);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index ca3d8cb..58399e2 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 _0xda16=['describe','/:id','show','post','create','put','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','/describe'];(function(_0x5453ca,_0x1aee47){var _0x40d607=function(_0x4cd8b6){while(--_0x4cd8b6){_0x5453ca['push'](_0x5453ca['shift']());}};_0x40d607(++_0x1aee47);}(_0xda16,0xb2));var _0x6da1=function(_0x2af9f4,_0x3121c0){_0x2af9f4=_0x2af9f4-0x0;var _0xc69f8=_0xda16[_0x2af9f4];return _0xc69f8;};'use strict';var multer=require(_0x6da1('0x0'));var util=require(_0x6da1('0x1'));var path=require(_0x6da1('0x2'));var timeout=require('connect-timeout');var express=require(_0x6da1('0x3'));var router=express[_0x6da1('0x4')]();var auth=require(_0x6da1('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x6da1('0x6'));var controller=require(_0x6da1('0x7'));router[_0x6da1('0x8')]('/',auth[_0x6da1('0x9')](),controller[_0x6da1('0xa')]);router[_0x6da1('0x8')](_0x6da1('0xb'),auth['isAuthenticated'](),controller[_0x6da1('0xc')]);router[_0x6da1('0x8')](_0x6da1('0xd'),auth[_0x6da1('0x9')](),controller[_0x6da1('0xe')]);router[_0x6da1('0xf')]('/',auth[_0x6da1('0x9')](),controller[_0x6da1('0x10')]);router[_0x6da1('0x11')]('/:id',auth[_0x6da1('0x9')](),controller['update']);router['delete'](_0x6da1('0xd'),auth[_0x6da1('0x9')](),controller[_0x6da1('0x12')]);module['exports']=router; \ No newline at end of file +var _0x7bfa=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller'];(function(_0x1d49da,_0x4b8203){var _0x206b1d=function(_0x2a1f68){while(--_0x2a1f68){_0x1d49da['push'](_0x1d49da['shift']());}};_0x206b1d(++_0x4b8203);}(_0x7bfa,0x173));var _0xa7bf=function(_0x48a928,_0x430727){_0x48a928=_0x48a928-0x0;var _0x11c1e9=_0x7bfa[_0x48a928];return _0x11c1e9;};'use strict';var multer=require(_0xa7bf('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa7bf('0x1'));var express=require(_0xa7bf('0x2'));var router=express['Router']();var auth=require(_0xa7bf('0x3'));var interaction=require(_0xa7bf('0x4'));var config=require(_0xa7bf('0x5'));var controller=require(_0xa7bf('0x6'));router[_0xa7bf('0x7')]('/',auth[_0xa7bf('0x8')](),controller[_0xa7bf('0x9')]);router[_0xa7bf('0x7')](_0xa7bf('0xa'),auth[_0xa7bf('0x8')](),controller[_0xa7bf('0xb')]);router['get']('/:id',auth[_0xa7bf('0x8')](),controller[_0xa7bf('0xc')]);router[_0xa7bf('0xd')]('/',auth[_0xa7bf('0x8')](),controller[_0xa7bf('0xe')]);router[_0xa7bf('0xf')](_0xa7bf('0x10'),auth['isAuthenticated'](),controller[_0xa7bf('0x11')]);router[_0xa7bf('0x12')]('/:id',auth[_0xa7bf('0x8')](),controller[_0xa7bf('0x13')]);module[_0xa7bf('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index 8d4fe1e..bddd99a 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 _0x110f=['sequelize','exports'];(function(_0x543084,_0x4337f5){var _0x306a57=function(_0x2769ed){while(--_0x2769ed){_0x543084['push'](_0x543084['shift']());}};_0x306a57(++_0x4337f5);}(_0x110f,0x1e6));var _0xf110=function(_0xf4893,_0x536d95){_0xf4893=_0xf4893-0x0;var _0x2de824=_0x110f[_0xf4893];return _0x2de824;};'use strict';var Sequelize=require(_0xf110('0x0'));module[_0xf110('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xdf5d=['STRING','name','sequelize','exports'];(function(_0xf4ca46,_0x26abaf){var _0x1da154=function(_0x3aeddd){while(--_0x3aeddd){_0xf4ca46['push'](_0xf4ca46['shift']());}};_0x1da154(++_0x26abaf);}(_0xdf5d,0x126));var _0xddf5=function(_0x358112,_0xb77338){_0x358112=_0x358112-0x0;var _0x3c155c=_0xdf5d[_0x358112];return _0x3c155c;};'use strict';var Sequelize=require(_0xddf5('0x0'));module[_0xddf5('0x1')]={'name':{'type':Sequelize[_0xddf5('0x2')],'unique':_0xddf5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xddf5('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index f816773..15fc001 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailSubstatus','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x1394f6,_0x7c9ccc){var _0x445151=function(_0xe9f683){while(--_0xe9f683){_0x1394f6['push'](_0x1394f6['shift']());}};_0x445151(++_0x7c9ccc);}(_0x7a54,0x106));var _0x47a5=function(_0x4f2a96,_0x36da81){_0x4f2a96=_0x4f2a96-0x0;var _0x5440eb=_0x7a54[_0x4f2a96];return _0x5440eb;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailSubstatus'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailSubstatus'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0xdbf5=['intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','count','includeAll','include','findAll','show','find','create','body','update','params','catch','describe','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','end','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','MailSubstatus','rawAttributes','fieldName','type','key','model','query','keys','filters'];(function(_0x579daa,_0x53440f){var _0x23ced1=function(_0x177f83){while(--_0x177f83){_0x579daa['push'](_0x579daa['shift']());}};_0x23ced1(++_0x53440f);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x4a66c3,_0xfd9b2f){_0x4a66c3=_0x4a66c3-0x0;var _0x22e046=_0xdbf5[_0x4a66c3];return _0x22e046;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5dbf('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x5dbf('0x1'));var rp=require(_0x5dbf('0x2'));var moment=require(_0x5dbf('0x3'));var BPromise=require(_0x5dbf('0x4'));var Mustache=require(_0x5dbf('0x5'));var util=require(_0x5dbf('0x6'));var path=require(_0x5dbf('0x7'));var sox=require(_0x5dbf('0x8'));var csv=require(_0x5dbf('0x9'));var ejs=require(_0x5dbf('0xa'));var fs=require('fs');var _=require(_0x5dbf('0xb'));var squel=require(_0x5dbf('0xc'));var crypto=require(_0x5dbf('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5dbf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x5dbf('0xf'));var Papa=require(_0x5dbf('0x10'));var Redis=require(_0x5dbf('0x11'));var authService=require(_0x5dbf('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x5dbf('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x5dbf('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5dbf('0x15'))['db'];function respondWithStatusCode(_0x490b38,_0x182cec){_0x182cec=_0x182cec||0xcc;return function(_0x2bb7ed){if(_0x2bb7ed){return _0x490b38[_0x5dbf('0x16')](_0x182cec);}return _0x490b38[_0x5dbf('0x17')](_0x182cec)[_0x5dbf('0x18')]();};}function respondWithResult(_0x587e58,_0x4803ca){_0x4803ca=_0x4803ca||0xc8;return function(_0x2b4e1c){if(_0x2b4e1c){return _0x587e58[_0x5dbf('0x17')](_0x4803ca)['json'](_0x2b4e1c);}};}function respondWithFilteredResult(_0x19624e,_0x248e3c){return function(_0x23f763){if(_0x23f763){var _0x2dfa44=_0x23f763['count'],_0x181816=_0x248e3c['offset'],_0x472eb9=_0x248e3c[_0x5dbf('0x19')]+_0x248e3c[_0x5dbf('0x1a')],_0x2d32cc;if(_0x472eb9>=_0x2dfa44){_0x472eb9=_0x2dfa44;_0x2d32cc=0xc8;}else{_0x2d32cc=0xce;}_0x19624e[_0x5dbf('0x17')](_0x2d32cc);return _0x19624e[_0x5dbf('0x1b')](_0x5dbf('0x1c'),_0x181816+'-'+_0x472eb9+'/'+_0x2dfa44)['json'](_0x23f763);}return null;};}function patchUpdates(_0x11cd00){return function(_0x4dd03c){try{jsonpatch['apply'](_0x4dd03c,_0x11cd00,!![]);}catch(_0x577ca2){return BPromise[_0x5dbf('0x1d')](_0x577ca2);}return _0x4dd03c[_0x5dbf('0x1e')]();};}function saveUpdates(_0x358d46,_0x2ab57c){return function(_0x1e3cce){if(_0x1e3cce){return _0x1e3cce['update'](_0x358d46)[_0x5dbf('0x1f')](function(_0x58e9ac){return _0x58e9ac;});}return null;};}function removeEntity(_0xb68f92,_0x11cc67){return function(_0x14d133){if(_0x14d133){return _0x14d133[_0x5dbf('0x20')]()[_0x5dbf('0x1f')](function(){_0xb68f92[_0x5dbf('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4027c3,_0x3e3a2d){return function(_0x2d3e1b){if(!_0x2d3e1b){_0x4027c3[_0x5dbf('0x16')](0x194);}return _0x2d3e1b;};}function handleError(_0x2763ec,_0x226b93){_0x226b93=_0x226b93||0x1f4;return function(_0x290456){logger[_0x5dbf('0x21')](_0x290456[_0x5dbf('0x22')]);if(_0x290456[_0x5dbf('0x23')]){delete _0x290456[_0x5dbf('0x23')];}_0x2763ec[_0x5dbf('0x17')](_0x226b93)[_0x5dbf('0x24')](_0x290456);};}exports[_0x5dbf('0x25')]=function(_0x729d8f,_0x17f135){var _0x466985={},_0x3f8341={},_0x159e61={'count':0x0,'rows':[]};var _0x22ec42=_[_0x5dbf('0x26')](db[_0x5dbf('0x27')][_0x5dbf('0x28')],function(_0x5768b7){return{'name':_0x5768b7[_0x5dbf('0x29')],'type':_0x5768b7[_0x5dbf('0x2a')][_0x5dbf('0x2b')]};});_0x3f8341[_0x5dbf('0x2c')]=_[_0x5dbf('0x26')](_0x22ec42,_0x5dbf('0x23'));_0x3f8341[_0x5dbf('0x2d')]=_[_0x5dbf('0x2e')](_0x729d8f[_0x5dbf('0x2d')]);_0x3f8341[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x3f8341['model'],_0x3f8341['query']);_0x466985[_0x5dbf('0x31')]=_[_0x5dbf('0x30')](_0x3f8341[_0x5dbf('0x2c')],qs[_0x5dbf('0x32')](_0x729d8f[_0x5dbf('0x2d')]['fields']));_0x466985['attributes']=_0x466985[_0x5dbf('0x31')][_0x5dbf('0x33')]?_0x466985['attributes']:_0x3f8341[_0x5dbf('0x2c')];if(!_0x729d8f[_0x5dbf('0x2d')][_0x5dbf('0x34')](_0x5dbf('0x35'))){_0x466985[_0x5dbf('0x1a')]=qs['limit'](_0x729d8f[_0x5dbf('0x2d')][_0x5dbf('0x1a')]);_0x466985[_0x5dbf('0x19')]=qs[_0x5dbf('0x19')](_0x729d8f[_0x5dbf('0x2d')]['offset']);}_0x466985[_0x5dbf('0x36')]=qs[_0x5dbf('0x37')](_0x729d8f[_0x5dbf('0x2d')][_0x5dbf('0x37')]);_0x466985['where']=qs[_0x5dbf('0x2f')](_[_0x5dbf('0x38')](_0x729d8f[_0x5dbf('0x2d')],_0x3f8341[_0x5dbf('0x2f')]));if(_0x729d8f[_0x5dbf('0x2d')][_0x5dbf('0x39')]){_0x466985[_0x5dbf('0x3a')]=_[_0x5dbf('0x3b')](_0x466985[_0x5dbf('0x3a')],{'$or':_[_0x5dbf('0x26')](_0x22ec42,function(_0x1ba835){if(_0x1ba835['type']!==_0x5dbf('0x3c')){var _0xefc995={};_0xefc995[_0x1ba835[_0x5dbf('0x23')]]={'$like':'%'+_0x729d8f['query'][_0x5dbf('0x39')]+'%'};return _0xefc995;}})});}_0x466985=_[_0x5dbf('0x3b')]({},_0x466985,_0x729d8f[_0x5dbf('0x3d')]);var _0x5b3738={'where':_0x466985[_0x5dbf('0x3a')]};return db[_0x5dbf('0x27')][_0x5dbf('0x3e')](_0x5b3738)['then'](function(_0x4527fb){_0x159e61[_0x5dbf('0x3e')]=_0x4527fb;if(_0x729d8f[_0x5dbf('0x2d')][_0x5dbf('0x3f')]){_0x466985[_0x5dbf('0x40')]=[{'all':!![]}];}return db[_0x5dbf('0x27')][_0x5dbf('0x41')](_0x466985);})[_0x5dbf('0x1f')](function(_0x4b71c1){_0x159e61['rows']=_0x4b71c1;return _0x159e61;})['then'](respondWithFilteredResult(_0x17f135,_0x466985))['catch'](handleError(_0x17f135,null));};exports[_0x5dbf('0x42')]=function(_0x21122d,_0x54e5e7){var _0x3ef0eb={'raw':!![],'where':{'id':_0x21122d['params']['id']}},_0x229abf={};_0x229abf[_0x5dbf('0x2c')]=_[_0x5dbf('0x2e')](db[_0x5dbf('0x27')][_0x5dbf('0x28')]);_0x229abf[_0x5dbf('0x2d')]=_[_0x5dbf('0x2e')](_0x21122d[_0x5dbf('0x2d')]);_0x229abf[_0x5dbf('0x2f')]=_[_0x5dbf('0x30')](_0x229abf[_0x5dbf('0x2c')],_0x229abf['query']);_0x3ef0eb[_0x5dbf('0x31')]=_[_0x5dbf('0x30')](_0x229abf[_0x5dbf('0x2c')],qs['fields'](_0x21122d[_0x5dbf('0x2d')][_0x5dbf('0x32')]));_0x3ef0eb[_0x5dbf('0x31')]=_0x3ef0eb[_0x5dbf('0x31')]['length']?_0x3ef0eb[_0x5dbf('0x31')]:_0x229abf['model'];if(_0x21122d[_0x5dbf('0x2d')][_0x5dbf('0x3f')]){_0x3ef0eb[_0x5dbf('0x40')]=[{'all':!![]}];}_0x3ef0eb=_[_0x5dbf('0x3b')]({},_0x3ef0eb,_0x21122d['options']);return db['MailSubstatus'][_0x5dbf('0x43')](_0x3ef0eb)[_0x5dbf('0x1f')](handleEntityNotFound(_0x54e5e7,null))[_0x5dbf('0x1f')](respondWithResult(_0x54e5e7,null))['catch'](handleError(_0x54e5e7,null));};exports[_0x5dbf('0x44')]=function(_0x4a9a80,_0x4d8df1){return db['MailSubstatus']['create'](_0x4a9a80[_0x5dbf('0x45')],{})[_0x5dbf('0x1f')](respondWithResult(_0x4d8df1,0xc9))['catch'](handleError(_0x4d8df1,null));};exports[_0x5dbf('0x46')]=function(_0x3ba5cb,_0x4b6f30){if(_0x3ba5cb[_0x5dbf('0x45')]['id']){delete _0x3ba5cb[_0x5dbf('0x45')]['id'];}return db['MailSubstatus'][_0x5dbf('0x43')]({'where':{'id':_0x3ba5cb['params']['id']}})['then'](handleEntityNotFound(_0x4b6f30,null))[_0x5dbf('0x1f')](saveUpdates(_0x3ba5cb[_0x5dbf('0x45')],null))[_0x5dbf('0x1f')](respondWithResult(_0x4b6f30,null))['catch'](handleError(_0x4b6f30,null));};exports['destroy']=function(_0x442a43,_0x3e8612){return db[_0x5dbf('0x27')][_0x5dbf('0x43')]({'where':{'id':_0x442a43[_0x5dbf('0x47')]['id']}})[_0x5dbf('0x1f')](handleEntityNotFound(_0x3e8612,null))[_0x5dbf('0x1f')](removeEntity(_0x3e8612,null))[_0x5dbf('0x48')](handleError(_0x3e8612,null));};exports['describe']=function(_0x3f38a0,_0x387eb7){return db[_0x5dbf('0x27')][_0x5dbf('0x49')]()[_0x5dbf('0x1f')](respondWithResult(_0x387eb7,null))[_0x5dbf('0x48')](handleError(_0x387eb7,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 5287062..539fe4d 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 _0xc6a2=['rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2813fa,_0x3211d4){var _0x8a2acb=function(_0x4a9602){while(--_0x4a9602){_0x2813fa['push'](_0x2813fa['shift']());}};_0x8a2acb(++_0x3211d4);}(_0xc6a2,0x69));var _0x2c6a=function(_0x654aea,_0x5a35dc){_0x654aea=_0x654aea-0x0;var _0x46d609=_0xc6a2[_0x654aea];return _0x46d609;};'use strict';var _=require(_0x2c6a('0x0'));var util=require(_0x2c6a('0x1'));var logger=require('../../config/logger')(_0x2c6a('0x2'));var moment=require(_0x2c6a('0x3'));var BPromise=require(_0x2c6a('0x4'));var rp=require(_0x2c6a('0x5'));var fs=require('fs');var path=require(_0x2c6a('0x6'));var rimraf=require(_0x2c6a('0x7'));var config=require(_0x2c6a('0x8'));var attributes=require(_0x2c6a('0x9'));module[_0x2c6a('0xa')]=function(_0x3c7e44,_0x4559d8){return _0x3c7e44[_0x2c6a('0xb')](_0x2c6a('0xc'),attributes,{'tableName':_0x2c6a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa3e8=['request-promise','path','rimraf','define','mail_substatuses','lodash','util','../../config/logger','moment','bluebird'];(function(_0x16bee2,_0x2d3a79){var _0x393c93=function(_0x3ccd87){while(--_0x3ccd87){_0x16bee2['push'](_0x16bee2['shift']());}};_0x393c93(++_0x2d3a79);}(_0xa3e8,0x127));var _0x8a3e=function(_0x238cda,_0x37ab41){_0x238cda=_0x238cda-0x0;var _0x354701=_0xa3e8[_0x238cda];return _0x354701;};'use strict';var _=require(_0x8a3e('0x0'));var util=require(_0x8a3e('0x1'));var logger=require(_0x8a3e('0x2'))('api');var moment=require(_0x8a3e('0x3'));var BPromise=require(_0x8a3e('0x4'));var rp=require(_0x8a3e('0x5'));var fs=require('fs');var path=require(_0x8a3e('0x6'));var rimraf=require(_0x8a3e('0x7'));var config=require('../../config/environment');var attributes=require('./mailSubstatus.attributes');module['exports']=function(_0x920901,_0xe682f5){return _0x920901[_0x8a3e('0x8')]('MailSubstatus',attributes,{'tableName':_0x8a3e('0x9'),'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 99b5007..149c2a9 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 _0xd2ea=['../../config/environment','jayson/promise','client','request','MailSubstatus,\x20%s,\x20%s','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x215a6c,_0x158386){var _0xef0e02=function(_0x10f71c){while(--_0x10f71c){_0x215a6c['push'](_0x215a6c['shift']());}};_0xef0e02(++_0x158386);}(_0xd2ea,0x15f));var _0xad2e=function(_0x46c54b,_0x24577e){_0x46c54b=_0x46c54b-0x0;var _0x3c9c24=_0xd2ea[_0x46c54b];return _0x3c9c24;};'use strict';var _=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var moment=require(_0xad2e('0x2'));var BPromise=require(_0xad2e('0x3'));var rs=require(_0xad2e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xad2e('0x5'))['db'];var utils=require(_0xad2e('0x6'));var logger=require(_0xad2e('0x7'))(_0xad2e('0x8'));var config=require(_0xad2e('0x9'));var jayson=require(_0xad2e('0xa'));var client=jayson[_0xad2e('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b5170,_0x3e3d1f,_0x2ff7b2){return new BPromise(function(_0x5710ac,_0x1e0e9e){return client[_0xad2e('0xc')](_0x3b5170,_0x2ff7b2)['then'](function(_0x1eed2f){logger['info'](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));logger[_0xad2e('0xf')](_0xad2e('0x10'),_0x3e3d1f,'request\x20sent',JSON[_0xad2e('0x11')](_0x1eed2f));if(_0x1eed2f['error']){if(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x13')]===0x1f4){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0x1eed2f['error'][_0xad2e('0x14')]);return _0x1e0e9e(_0x1eed2f['error'][_0xad2e('0x14')]);}logger['error']('MailSubstatus,\x20%s,\x20%s',_0x3e3d1f,_0x1eed2f['error']['message']);return _0x5710ac(_0x1eed2f[_0xad2e('0x12')][_0xad2e('0x14')]);}else{logger[_0xad2e('0x15')](_0xad2e('0xd'),_0x3e3d1f,_0xad2e('0xe'));_0x5710ac(_0x1eed2f[_0xad2e('0x16')][_0xad2e('0x14')]);}})[_0xad2e('0x17')](function(_0xd40b31){logger[_0xad2e('0x12')](_0xad2e('0xd'),_0x3e3d1f,_0xd40b31);_0x1e0e9e(_0xd40b31);});});} \ No newline at end of file +var _0x6f7a=['http','request','then','info','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code','MailSubstatus,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x4a9148,_0x4a699e){var _0x27057a=function(_0xbbaad3){while(--_0xbbaad3){_0x4a9148['push'](_0x4a9148['shift']());}};_0x27057a(++_0x4a699e);}(_0x6f7a,0x1ae));var _0xa6f7=function(_0x218860,_0x172b72){_0x218860=_0x218860-0x0;var _0x41c215=_0x6f7a[_0x218860];return _0x41c215;};'use strict';var _=require(_0xa6f7('0x0'));var util=require(_0xa6f7('0x1'));var moment=require(_0xa6f7('0x2'));var BPromise=require(_0xa6f7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa6f7('0x4'));var db=require(_0xa6f7('0x5'))['db'];var utils=require(_0xa6f7('0x6'));var logger=require(_0xa6f7('0x7'))(_0xa6f7('0x8'));var config=require(_0xa6f7('0x9'));var jayson=require(_0xa6f7('0xa'));var client=jayson[_0xa6f7('0xb')][_0xa6f7('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x335aaa,_0x1a06d1,_0x481a8c){return new BPromise(function(_0x4b4f9e,_0x30f2a7){return client[_0xa6f7('0xd')](_0x335aaa,_0x481a8c)[_0xa6f7('0xe')](function(_0x362404){logger[_0xa6f7('0xf')]('MailSubstatus,\x20%s,\x20%s',_0x1a06d1,'request\x20sent');logger[_0xa6f7('0x10')](_0xa6f7('0x11'),_0x1a06d1,'request\x20sent',JSON[_0xa6f7('0x12')](_0x362404));if(_0x362404['error']){if(_0x362404[_0xa6f7('0x13')][_0xa6f7('0x14')]===0x1f4){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x30f2a7(_0x362404['error'][_0xa6f7('0x16')]);}logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x362404['error'][_0xa6f7('0x16')]);return _0x4b4f9e(_0x362404['error'][_0xa6f7('0x16')]);}else{logger['info'](_0xa6f7('0x15'),_0x1a06d1,_0xa6f7('0x17'));_0x4b4f9e(_0x362404[_0xa6f7('0x18')]['message']);}})[_0xa6f7('0x19')](function(_0x22635e){logger[_0xa6f7('0x13')](_0xa6f7('0x15'),_0x1a06d1,_0x22635e);_0x30f2a7(_0x22635e);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index 669b801..2193eb2 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 _0x80f5=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./mailTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','post','create','update','delete','destroy','exports','multer','util'];(function(_0x3cb18d,_0x51fbc9){var _0x31bced=function(_0x26b6c6){while(--_0x26b6c6){_0x3cb18d['push'](_0x3cb18d['shift']());}};_0x31bced(++_0x51fbc9);}(_0x80f5,0x132));var _0x580f=function(_0x364a36,_0x1e2677){_0x364a36=_0x364a36-0x0;var _0x5cd6fa=_0x80f5[_0x364a36];return _0x5cd6fa;};'use strict';var multer=require(_0x580f('0x0'));var util=require(_0x580f('0x1'));var path=require(_0x580f('0x2'));var timeout=require(_0x580f('0x3'));var express=require(_0x580f('0x4'));var router=express[_0x580f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x580f('0x6'));var config=require(_0x580f('0x7'));var controller=require(_0x580f('0x8'));router[_0x580f('0x9')]('/',auth['isAuthenticated'](),controller[_0x580f('0xa')]);router[_0x580f('0x9')](_0x580f('0xb'),auth[_0x580f('0xc')](),controller[_0x580f('0xd')]);router[_0x580f('0x9')](_0x580f('0xe'),auth[_0x580f('0xc')](),controller[_0x580f('0xf')]);router[_0x580f('0x10')]('/',auth['isAuthenticated'](),controller[_0x580f('0x11')]);router['put']('/:id',auth[_0x580f('0xc')](),controller[_0x580f('0x12')]);router[_0x580f('0x13')](_0x580f('0xe'),auth[_0x580f('0xc')](),controller[_0x580f('0x14')]);module[_0x580f('0x15')]=router; \ No newline at end of file +var _0xe1e9=['create','destroy','multer','express','Router','../../config/environment','./mailTransferReport.controller','get','isAuthenticated','describe','/:id','show'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe1e9,0x1b2));var _0x9e1e=function(_0x47204d,_0x48ec4f){_0x47204d=_0x47204d-0x0;var _0x8ba4d4=_0xe1e9[_0x47204d];return _0x8ba4d4;};'use strict';var multer=require(_0x9e1e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9e1e('0x1'));var router=express[_0x9e1e('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9e1e('0x3'));var controller=require(_0x9e1e('0x4'));router[_0x9e1e('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9e1e('0x5')]('/describe',auth[_0x9e1e('0x6')](),controller[_0x9e1e('0x7')]);router[_0x9e1e('0x5')](_0x9e1e('0x8'),auth['isAuthenticated'](),controller[_0x9e1e('0x9')]);router['post']('/',auth[_0x9e1e('0x6')](),controller[_0x9e1e('0xa')]);router['put'](_0x9e1e('0x8'),auth[_0x9e1e('0x6')](),controller['update']);router['delete'](_0x9e1e('0x8'),auth[_0x9e1e('0x6')](),controller[_0x9e1e('0xb')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index 85fa53d..f1c7476 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 _0x5728=['DATE','NOW','moment','exports','STRING','ENUM','queue'];(function(_0x4c5e87,_0x461d39){var _0x556c1f=function(_0x20749e){while(--_0x20749e){_0x4c5e87['push'](_0x4c5e87['shift']());}};_0x556c1f(++_0x461d39);}(_0x5728,0x64));var _0x8572=function(_0x1c6bd3,_0x2b1533){_0x1c6bd3=_0x1c6bd3-0x0;var _0x3aa527=_0x5728[_0x1c6bd3];return _0x3aa527;};'use strict';var moment=require(_0x8572('0x0'));var Sequelize=require('sequelize');module[_0x8572('0x1')]={'uniqueid':{'type':Sequelize[_0x8572('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x8572('0x3')]('account','agent',_0x8572('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x8572('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x8572('0x6')]}}; \ No newline at end of file +var _0xe9db=['ENUM','account','agent','queue','NOW','STRING'];(function(_0x71c852,_0x23c13c){var _0x55c103=function(_0xbd2e63){while(--_0xbd2e63){_0x71c852['push'](_0x71c852['shift']());}};_0x55c103(++_0x23c13c);}(_0xe9db,0x1a3));var _0xbe9d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xe9db[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize[_0xbe9d('0x0')],'allowNull':![]},'type':{'type':Sequelize[_0xbe9d('0x1')](_0xbe9d('0x2'),_0xbe9d('0x3'),_0xbe9d('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xbe9d('0x5')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index 8ee5e7f..653fd45 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 _0x9957=['eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','pick','filter','where','merge','VIRTUAL','options','MailTransferReport','count','includeAll','include','findAll','rows','show','find','catch','create','body','update','params','describe','html-pdf'];(function(_0x26806a,_0x35b2da){var _0x222ca6=function(_0x4f4f4f){while(--_0x4f4f4f){_0x26806a['push'](_0x26806a['shift']());}};_0x222ca6(++_0x35b2da);}(_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 Redis=require(_0x7995('0x12'));var authService=require(_0x7995('0x13'));var qs=require(_0x7995('0x14'));var as=require(_0x7995('0x15'));var hardwareService=require(_0x7995('0x16'));var logger=require('../../config/logger')(_0x7995('0x17'));var utils=require(_0x7995('0x18'));var config=require('../../config/environment');var db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){_0x350fd9[_0x7995('0x1b')](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x204507,_0x285437){return function(_0x563799){if(!_0x563799){_0x204507[_0x7995('0x1a')](0x194);}return _0x563799;};}function handleError(_0x475351,_0x472195){_0x472195=_0x472195||0x1f4;return function(_0x59405a){logger[_0x7995('0x26')](_0x59405a[_0x7995('0x27')]);if(_0x59405a[_0x7995('0x28')]){delete _0x59405a[_0x7995('0x28')];}_0x475351[_0x7995('0x1b')](_0x472195)[_0x7995('0x29')](_0x59405a);};}exports['index']=function(_0x47625f,_0x5911c3){var _0x229742={},_0x49bc7e={},_0xf16cc2={'count':0x0,'rows':[]};var _0x132a42=_[_0x7995('0x2a')](db['MailTransferReport'][_0x7995('0x2b')],function(_0x514445){return{'name':_0x514445[_0x7995('0x2c')],'type':_0x514445[_0x7995('0x2d')][_0x7995('0x2e')]};});_0x49bc7e['model']=_['map'](_0x132a42,'name');_0x49bc7e[_0x7995('0x2f')]=_[_0x7995('0x30')](_0x47625f[_0x7995('0x2f')]);_0x49bc7e[_0x7995('0x31')]=_[_0x7995('0x32')](_0x49bc7e[_0x7995('0x33')],_0x49bc7e['query']);_0x229742['attributes']=_[_0x7995('0x32')](_0x49bc7e['model'],qs[_0x7995('0x34')](_0x47625f[_0x7995('0x2f')][_0x7995('0x34')]));_0x229742[_0x7995('0x35')]=_0x229742[_0x7995('0x35')]['length']?_0x229742[_0x7995('0x35')]:_0x49bc7e[_0x7995('0x33')];if(!_0x47625f['query']['hasOwnProperty']('nolimit')){_0x229742[_0x7995('0x1f')]=qs[_0x7995('0x1f')](_0x47625f['query'][_0x7995('0x1f')]);_0x229742['offset']=qs[_0x7995('0x1e')](_0x47625f[_0x7995('0x2f')][_0x7995('0x1e')]);}_0x229742['order']=qs['sort'](_0x47625f[_0x7995('0x2f')]['sort']);_0x229742['where']=qs[_0x7995('0x31')](_[_0x7995('0x36')](_0x47625f['query'],_0x49bc7e[_0x7995('0x31')]));if(_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]){_0x229742[_0x7995('0x38')]=_[_0x7995('0x39')](_0x229742['where'],{'$or':_[_0x7995('0x2a')](_0x132a42,function(_0x242713){if(_0x242713[_0x7995('0x2d')]!==_0x7995('0x3a')){var _0x4b1541={};_0x4b1541[_0x242713[_0x7995('0x28')]]={'$like':'%'+_0x47625f[_0x7995('0x2f')][_0x7995('0x37')]+'%'};return _0x4b1541;}})});}_0x229742=_[_0x7995('0x39')]({},_0x229742,_0x47625f[_0x7995('0x3b')]);var _0x1035dc={'where':_0x229742['where']};return db[_0x7995('0x3c')][_0x7995('0x3d')](_0x1035dc)[_0x7995('0x24')](function(_0x2ea47f){_0xf16cc2[_0x7995('0x3d')]=_0x2ea47f;if(_0x47625f[_0x7995('0x2f')][_0x7995('0x3e')]){_0x229742[_0x7995('0x3f')]=[{'all':!![]}];}return db[_0x7995('0x3c')][_0x7995('0x40')](_0x229742);})[_0x7995('0x24')](function(_0x270d52){_0xf16cc2[_0x7995('0x41')]=_0x270d52;return _0xf16cc2;})['then'](respondWithFilteredResult(_0x5911c3,_0x229742))['catch'](handleError(_0x5911c3,null));};exports[_0x7995('0x42')]=function(_0x7325e8,_0x58523e){var _0x4b0855={'raw':!![],'where':{'id':_0x7325e8['params']['id']}},_0x3f8522={};_0x3f8522['model']=_[_0x7995('0x30')](db[_0x7995('0x3c')][_0x7995('0x2b')]);_0x3f8522['query']=_[_0x7995('0x30')](_0x7325e8['query']);_0x3f8522[_0x7995('0x31')]=_['intersection'](_0x3f8522['model'],_0x3f8522[_0x7995('0x2f')]);_0x4b0855[_0x7995('0x35')]=_[_0x7995('0x32')](_0x3f8522[_0x7995('0x33')],qs['fields'](_0x7325e8[_0x7995('0x2f')][_0x7995('0x34')]));_0x4b0855[_0x7995('0x35')]=_0x4b0855[_0x7995('0x35')]['length']?_0x4b0855['attributes']:_0x3f8522[_0x7995('0x33')];if(_0x7325e8['query'][_0x7995('0x3e')]){_0x4b0855['include']=[{'all':!![]}];}_0x4b0855=_[_0x7995('0x39')]({},_0x4b0855,_0x7325e8['options']);return db[_0x7995('0x3c')][_0x7995('0x43')](_0x4b0855)['then'](handleEntityNotFound(_0x58523e,null))[_0x7995('0x24')](respondWithResult(_0x58523e,null))[_0x7995('0x44')](handleError(_0x58523e,null));};exports[_0x7995('0x45')]=function(_0xb70a51,_0x4c6837){return db[_0x7995('0x3c')][_0x7995('0x45')](_0xb70a51[_0x7995('0x46')],{})['then'](respondWithResult(_0x4c6837,0xc9))[_0x7995('0x44')](handleError(_0x4c6837,null));};exports[_0x7995('0x47')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x46')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3c')][_0x7995('0x43')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x46')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x44')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3c')]['find']({'where':{'id':_0xddf537[_0x7995('0x48')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x49')]=function(_0x1fe77e,_0x12d4b8){return db['MailTransferReport']['describe']()['then'](respondWithResult(_0x12d4b8,null))[_0x7995('0x44')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x14fedc,_0x559b05){var _0x2b79bc=function(_0x5dcac5){while(--_0x5dcac5){_0x14fedc['push'](_0x14fedc['shift']());}};_0x2b79bc(++_0x559b05);}(_0x7a54,0x106));var _0x47a5=function(_0x1cf5ef,_0x3a53b9){_0x1cf5ef=_0x1cf5ef-0x0;var _0x3aab61=_0x7a54[_0x1cf5ef];return _0x3aab61;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index c4ee550..09fcdaf 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 _0x14a5=['bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports','define','uniqueid','lodash','util','../../config/logger','api'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x14a5,0x15b));var _0x514a=function(_0x652066,_0x236447){_0x652066=_0x652066-0x0;var _0x91c086=_0x14a5[_0x652066];return _0x91c086;};'use strict';var _=require(_0x514a('0x0'));var util=require(_0x514a('0x1'));var logger=require(_0x514a('0x2'))(_0x514a('0x3'));var moment=require('moment');var BPromise=require(_0x514a('0x4'));var rp=require(_0x514a('0x5'));var fs=require('fs');var path=require(_0x514a('0x6'));var rimraf=require(_0x514a('0x7'));var config=require(_0x514a('0x8'));var attributes=require(_0x514a('0x9'));module[_0x514a('0xa')]=function(_0x5d1d97,_0x1c8801){return _0x5d1d97[_0x514a('0xb')]('MailTransferReport',attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x514a('0xc'),'fields':[_0x514a('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xf7d1=['../../config/logger','moment','bluebird','request-promise','path','./mailTransferReport.attributes','exports','define','MailTransferReport','report_mail_transfer','uniqueid','lodash'];(function(_0xa0fa85,_0x4dbf9a){var _0xa2086a=function(_0x3ad4f8){while(--_0x3ad4f8){_0xa0fa85['push'](_0xa0fa85['shift']());}};_0xa2086a(++_0x4dbf9a);}(_0xf7d1,0x137));var _0x1f7d=function(_0x130340,_0x2bb2a9){_0x130340=_0x130340-0x0;var _0x2d06ee=_0xf7d1[_0x130340];return _0x2d06ee;};'use strict';var _=require(_0x1f7d('0x0'));var util=require('util');var logger=require(_0x1f7d('0x1'))('api');var moment=require(_0x1f7d('0x2'));var BPromise=require(_0x1f7d('0x3'));var rp=require(_0x1f7d('0x4'));var fs=require('fs');var path=require(_0x1f7d('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x1f7d('0x6'));module[_0x1f7d('0x7')]=function(_0x4d68ef,_0x4c678e){return _0x4d68ef[_0x1f7d('0x8')](_0x1f7d('0x9'),attributes,{'tableName':_0x1f7d('0xa'),'paranoid':![],'indexes':[{'name':_0x1f7d('0xb'),'fields':[_0x1f7d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index 6276d24..767c0ca 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 _0x7000=['info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','then'];(function(_0x2181b1,_0x569637){var _0x530548=function(_0x4b31f1){while(--_0x4b31f1){_0x2181b1['push'](_0x2181b1['shift']());}};_0x530548(++_0x569637);}(_0x7000,0x1c2));var _0x0700=function(_0x28d8bd,_0x2a9333){_0x28d8bd=_0x28d8bd-0x0;var _0x4eacd4=_0x7000[_0x28d8bd];return _0x4eacd4;};'use strict';var _=require('lodash');var util=require(_0x0700('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x0700('0x1'));var fs=require('fs');var Redis=require(_0x0700('0x2'));var db=require(_0x0700('0x3'))['db'];var utils=require(_0x0700('0x4'));var logger=require('../../config/logger')(_0x0700('0x5'));var config=require(_0x0700('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x0700('0x7')][_0x0700('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ed21c,_0xc1a2ad,_0x5aeb74){return new BPromise(function(_0x2011b3,_0x40488b){return client['request'](_0x3ed21c,_0x5aeb74)[_0x0700('0x9')](function(_0x345b87){logger[_0x0700('0xa')](_0x0700('0xb'),_0xc1a2ad,_0x0700('0xc'));logger[_0x0700('0xd')](_0x0700('0xe'),_0xc1a2ad,_0x0700('0xc'),JSON[_0x0700('0xf')](_0x345b87));if(_0x345b87[_0x0700('0x10')]){if(_0x345b87[_0x0700('0x10')][_0x0700('0x11')]===0x1f4){logger[_0x0700('0x10')]('MailTransferReport,\x20%s,\x20%s',_0xc1a2ad,_0x345b87[_0x0700('0x10')]['message']);return _0x40488b(_0x345b87[_0x0700('0x10')][_0x0700('0x12')]);}logger[_0x0700('0x10')](_0x0700('0xb'),_0xc1a2ad,_0x345b87[_0x0700('0x10')][_0x0700('0x12')]);return _0x2011b3(_0x345b87['error']['message']);}else{logger[_0x0700('0xa')](_0x0700('0xb'),_0xc1a2ad,'request\x20sent');_0x2011b3(_0x345b87['result'][_0x0700('0x12')]);}})[_0x0700('0x13')](function(_0x22706d){logger[_0x0700('0x10')](_0x0700('0xb'),_0xc1a2ad,_0x22706d);_0x40488b(_0x22706d);});});} \ No newline at end of file +var _0x60d2=['request','then','debug','request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x124d23,_0x1543d3){var _0x1f02ed=function(_0x48dcf9){while(--_0x48dcf9){_0x124d23['push'](_0x124d23['shift']());}};_0x1f02ed(++_0x1543d3);}(_0x60d2,0x11f));var _0x260d=function(_0x8a969d,_0x339d9f){_0x8a969d=_0x8a969d-0x0;var _0x1d8dc7=_0x60d2[_0x8a969d];return _0x1d8dc7;};'use strict';var _=require(_0x260d('0x0'));var util=require(_0x260d('0x1'));var moment=require(_0x260d('0x2'));var BPromise=require(_0x260d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x260d('0x4'));var db=require(_0x260d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x260d('0x6'))(_0x260d('0x7'));var config=require(_0x260d('0x8'));var jayson=require(_0x260d('0x9'));var client=jayson[_0x260d('0xa')][_0x260d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x268f7c,_0x1625d6,_0x29b83e){return new BPromise(function(_0x146e98,_0x145682){return client[_0x260d('0xc')](_0x268f7c,_0x29b83e)[_0x260d('0xd')](function(_0xdb7921){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x1625d6,'request\x20sent');logger[_0x260d('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1625d6,_0x260d('0xf'),JSON[_0x260d('0x10')](_0xdb7921));if(_0xdb7921[_0x260d('0x11')]){if(_0xdb7921[_0x260d('0x11')][_0x260d('0x12')]===0x1f4){logger[_0x260d('0x11')](_0x260d('0x13'),_0x1625d6,_0xdb7921[_0x260d('0x11')][_0x260d('0x14')]);return _0x145682(_0xdb7921['error'][_0x260d('0x14')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1625d6,_0xdb7921[_0x260d('0x11')][_0x260d('0x14')]);return _0x146e98(_0xdb7921['error'][_0x260d('0x14')]);}else{logger[_0x260d('0x15')](_0x260d('0x13'),_0x1625d6,'request\x20sent');_0x146e98(_0xdb7921[_0x260d('0x16')][_0x260d('0x14')]);}})['catch'](function(_0x353960){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x1625d6,_0x353960);_0x145682(_0x353960);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 0753a8e..a5e1b82 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 _0x2851=['../../components/interaction/service','./memberReport.controller','get','isAuthenticated','/describe','/:id','show','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x2a6809,_0x44edde){var _0x11c371=function(_0x1a4888){while(--_0x1a4888){_0x2a6809['push'](_0x2a6809['shift']());}};_0x11c371(++_0x44edde);}(_0x2851,0x104));var _0x1285=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2851[_0x17d9e3];return _0x14192d;};'use strict';var multer=require(_0x1285('0x0'));var util=require(_0x1285('0x1'));var path=require(_0x1285('0x2'));var timeout=require(_0x1285('0x3'));var express=require(_0x1285('0x4'));var router=express[_0x1285('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x1285('0x6'));var config=require('../../config/environment');var controller=require(_0x1285('0x7'));router[_0x1285('0x8')]('/',auth[_0x1285('0x9')](),controller['index']);router[_0x1285('0x8')](_0x1285('0xa'),auth[_0x1285('0x9')](),controller['describe']);router[_0x1285('0x8')](_0x1285('0xb'),auth[_0x1285('0x9')](),controller[_0x1285('0xc')]);router[_0x1285('0xd')]('/',auth[_0x1285('0x9')](),controller['create']);router[_0x1285('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x1285('0xf')]);router[_0x1285('0x10')](_0x1285('0xb'),auth['isAuthenticated'](),controller[_0x1285('0x11')]);module[_0x1285('0x12')]=router; \ No newline at end of file +var _0x2b90=['show','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id'];(function(_0x3fb5d0,_0x2bf0a8){var _0x5a8ef9=function(_0x2c3988){while(--_0x2c3988){_0x3fb5d0['push'](_0x3fb5d0['shift']());}};_0x5a8ef9(++_0x2bf0a8);}(_0x2b90,0xcf));var _0x02b9=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2b90[_0xb0f7c3];return _0x28ea68;};'use strict';var multer=require(_0x02b9('0x0'));var util=require(_0x02b9('0x1'));var path=require(_0x02b9('0x2'));var timeout=require(_0x02b9('0x3'));var express=require(_0x02b9('0x4'));var router=express[_0x02b9('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x02b9('0x6'));var controller=require('./memberReport.controller');router[_0x02b9('0x7')]('/',auth[_0x02b9('0x8')](),controller[_0x02b9('0x9')]);router[_0x02b9('0x7')](_0x02b9('0xa'),auth[_0x02b9('0x8')](),controller[_0x02b9('0xb')]);router['get'](_0x02b9('0xc'),auth['isAuthenticated'](),controller[_0x02b9('0xd')]);router[_0x02b9('0xe')]('/',auth[_0x02b9('0x8')](),controller[_0x02b9('0xf')]);router[_0x02b9('0x10')](_0x02b9('0xc'),auth[_0x02b9('0x8')](),controller[_0x02b9('0x11')]);router['delete'](_0x02b9('0xc'),auth[_0x02b9('0x8')](),controller[_0x02b9('0x12')]);module[_0x02b9('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 8adbebf..ec6763d 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 _0xe572=['INTEGER','DATE','getDataValue','diff','seconds','exitAt','setDataValue','talk:[start]','talk:[destination]','talk:[dial\x20string]','sequelize','moment','exports','STRING','DEFAULT\x20PAUSE'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0xe572,0x19f));var _0x2e57=function(_0x5ea5ab,_0x5c284e){_0x5ea5ab=_0x5ea5ab-0x0;var _0x2014f1=_0xe572[_0x5ea5ab];return _0x2014f1;};'use strict';var Sequelize=require(_0x2e57('0x0'));var moment=require(_0x2e57('0x1'));module[_0x2e57('0x2')]={'channel':{'type':Sequelize[_0x2e57('0x3')]},'membername':{'type':Sequelize[_0x2e57('0x3')]},'interface':{'type':Sequelize[_0x2e57('0x3')]},'type':{'type':Sequelize[_0x2e57('0x3')],'defaultValue':_0x2e57('0x4'),'comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x2e57('0x5')]},'enterAt':{'type':Sequelize[_0x2e57('0x6')]},'exitAt':{'type':Sequelize[_0x2e57('0x6')],'set':function(_0x101590){var _0x28b163=moment(_0x101590);var _0x11ae06=moment(this[_0x2e57('0x7')]('enterAt'));var _0x4c1446=_0x28b163[_0x2e57('0x8')](_0x11ae06,_0x2e57('0x9'));this['setDataValue'](_0x2e57('0xa'),_0x101590);this[_0x2e57('0xb')]('duration',_0x4c1446||null);}},'data1':{'type':Sequelize[_0x2e57('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0x2e57('0x3')],'comment':_0x2e57('0xc')},'data3':{'type':Sequelize[_0x2e57('0x3')],'comment':_0x2e57('0xd')},'data4':{'type':Sequelize[_0x2e57('0x3')],'comment':_0x2e57('0xe')},'data5':{'type':Sequelize['STRING'],'comment':'talk:[queue]'},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x2e57('0x5')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x16e4=['STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','getDataValue','enterAt','diff','setDataValue','exitAt','duration','talk:[inbound,\x20outbound],\x20pause:[reason]','talk:[start]','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize','moment'];(function(_0x2c1dcd,_0x350452){var _0x158ce5=function(_0x5c1c57){while(--_0x5c1c57){_0x2c1dcd['push'](_0x2c1dcd['shift']());}};_0x158ce5(++_0x350452);}(_0x16e4,0x10e));var _0x416e=function(_0x10a038,_0x1c2799){_0x10a038=_0x10a038-0x0;var _0x5868c1=_0x16e4[_0x10a038];return _0x5868c1;};'use strict';var Sequelize=require(_0x416e('0x0'));var moment=require(_0x416e('0x1'));module['exports']={'channel':{'type':Sequelize[_0x416e('0x2')]},'membername':{'type':Sequelize[_0x416e('0x2')]},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0x416e('0x3')},'duration':{'type':Sequelize[_0x416e('0x4')]},'enterAt':{'type':Sequelize[_0x416e('0x5')]},'exitAt':{'type':Sequelize[_0x416e('0x5')],'set':function(_0x5afa2c){var _0x482bd5=moment(_0x5afa2c);var _0xe384da=moment(this[_0x416e('0x6')](_0x416e('0x7')));var _0x262c9f=_0x482bd5[_0x416e('0x8')](_0xe384da,'seconds');this[_0x416e('0x9')](_0x416e('0xa'),_0x5afa2c);this[_0x416e('0x9')](_0x416e('0xb'),_0x262c9f||null);}},'data1':{'type':Sequelize['STRING'],'comment':_0x416e('0xc')},'data2':{'type':Sequelize[_0x416e('0x2')],'comment':_0x416e('0xd')},'data3':{'type':Sequelize[_0x416e('0x2')],'comment':_0x416e('0xe')},'data4':{'type':Sequelize[_0x416e('0x2')],'comment':_0x416e('0xf')},'data5':{'type':Sequelize['STRING'],'comment':_0x416e('0x10')},'role':{'type':Sequelize['STRING']},'internal':{'type':Sequelize[_0x416e('0x4')]},'uniqueid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.controller.js b/server/api/memberReport/memberReport.controller.js index 641a57b..2557066 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 _0x5419=['show','params','keys','rawAttributes','intersection','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','MemberReport','fieldName','type','key','model','map','query','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x1e4f2d,_0x22e2bb){var _0xd05ce5=function(_0x4c7b43){while(--_0x4c7b43){_0x1e4f2d['push'](_0x1e4f2d['shift']());}};_0xd05ce5(++_0x22e2bb);}(_0x5419,0xf1));var _0x9541=function(_0x508ab9,_0x7c0fb3){_0x508ab9=_0x508ab9-0x0;var _0x2afb14=_0x5419[_0x508ab9];return _0x2afb14;};'use strict';var pdf=require(_0x9541('0x0'));var emlformat=require(_0x9541('0x1'));var rimraf=require(_0x9541('0x2'));var zipdir=require(_0x9541('0x3'));var jsonpatch=require(_0x9541('0x4'));var rp=require(_0x9541('0x5'));var moment=require('moment');var BPromise=require(_0x9541('0x6'));var Mustache=require(_0x9541('0x7'));var util=require(_0x9541('0x8'));var path=require(_0x9541('0x9'));var sox=require(_0x9541('0xa'));var csv=require(_0x9541('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x9541('0xc'));var squel=require('squel');var crypto=require(_0x9541('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x9541('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9541('0xf'));var Redis=require(_0x9541('0x10'));var authService=require(_0x9541('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9541('0x12'));var hardwareService=require(_0x9541('0x13'));var logger=require(_0x9541('0x14'))('api');var utils=require(_0x9541('0x15'));var config=require(_0x9541('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x55078b,_0xf31bb6){_0xf31bb6=_0xf31bb6||0xcc;return function(_0xd831a5){if(_0xd831a5){return _0x55078b[_0x9541('0x17')](_0xf31bb6);}return _0x55078b[_0x9541('0x18')](_0xf31bb6)[_0x9541('0x19')]();};}function respondWithResult(_0x14e77b,_0x4a744c){_0x4a744c=_0x4a744c||0xc8;return function(_0x11434f){if(_0x11434f){return _0x14e77b[_0x9541('0x18')](_0x4a744c)[_0x9541('0x1a')](_0x11434f);}};}function respondWithFilteredResult(_0x24cfd5,_0x36f23a){return function(_0x4bd9f1){if(_0x4bd9f1){var _0x1ca5d4=_0x4bd9f1[_0x9541('0x1b')],_0x2152f8=_0x36f23a['offset'],_0x104e66=_0x36f23a[_0x9541('0x1c')]+_0x36f23a[_0x9541('0x1d')],_0x3a11ff;if(_0x104e66>=_0x1ca5d4){_0x104e66=_0x1ca5d4;_0x3a11ff=0xc8;}else{_0x3a11ff=0xce;}_0x24cfd5['status'](_0x3a11ff);return _0x24cfd5[_0x9541('0x1e')](_0x9541('0x1f'),_0x2152f8+'-'+_0x104e66+'/'+_0x1ca5d4)[_0x9541('0x1a')](_0x4bd9f1);}return null;};}function patchUpdates(_0x10dd90){return function(_0xcc36d2){try{jsonpatch[_0x9541('0x20')](_0xcc36d2,_0x10dd90,!![]);}catch(_0x444d88){return BPromise[_0x9541('0x21')](_0x444d88);}return _0xcc36d2[_0x9541('0x22')]();};}function saveUpdates(_0x2636b4,_0x4f9f1b){return function(_0x2a0ad0){if(_0x2a0ad0){return _0x2a0ad0['update'](_0x2636b4)[_0x9541('0x23')](function(_0x5e7a5d){return _0x5e7a5d;});}return null;};}function removeEntity(_0xfc369c,_0x15bfec){return function(_0x20d0ca){if(_0x20d0ca){return _0x20d0ca[_0x9541('0x24')]()[_0x9541('0x23')](function(){_0xfc369c[_0x9541('0x18')](0xcc)[_0x9541('0x19')]();});}};}function handleEntityNotFound(_0x5b5150,_0x36aa1e){return function(_0x508712){if(!_0x508712){_0x5b5150['sendStatus'](0x194);}return _0x508712;};}function handleError(_0xf7ce82,_0x5e4fd7){_0x5e4fd7=_0x5e4fd7||0x1f4;return function(_0x4f88d9){logger[_0x9541('0x25')](_0x4f88d9[_0x9541('0x26')]);if(_0x4f88d9[_0x9541('0x27')]){delete _0x4f88d9['name'];}_0xf7ce82[_0x9541('0x18')](_0x5e4fd7)[_0x9541('0x28')](_0x4f88d9);};}exports[_0x9541('0x29')]=function(_0x261ef9,_0x11e89b){var _0x16ef62={},_0x47a330={},_0x51dabf={'count':0x0,'rows':[]};var _0x1392ff=_['map'](db[_0x9541('0x2a')]['rawAttributes'],function(_0x36ba01){return{'name':_0x36ba01[_0x9541('0x2b')],'type':_0x36ba01[_0x9541('0x2c')][_0x9541('0x2d')]};});_0x47a330[_0x9541('0x2e')]=_[_0x9541('0x2f')](_0x1392ff,_0x9541('0x27'));_0x47a330[_0x9541('0x30')]=_['keys'](_0x261ef9[_0x9541('0x30')]);_0x47a330[_0x9541('0x31')]=_['intersection'](_0x47a330[_0x9541('0x2e')],_0x47a330['query']);_0x16ef62[_0x9541('0x32')]=_['intersection'](_0x47a330[_0x9541('0x2e')],qs[_0x9541('0x33')](_0x261ef9[_0x9541('0x30')][_0x9541('0x33')]));_0x16ef62[_0x9541('0x32')]=_0x16ef62[_0x9541('0x32')][_0x9541('0x34')]?_0x16ef62[_0x9541('0x32')]:_0x47a330[_0x9541('0x2e')];if(!_0x261ef9[_0x9541('0x30')][_0x9541('0x35')](_0x9541('0x36'))){_0x16ef62[_0x9541('0x1d')]=qs[_0x9541('0x1d')](_0x261ef9['query'][_0x9541('0x1d')]);_0x16ef62[_0x9541('0x1c')]=qs[_0x9541('0x1c')](_0x261ef9['query'][_0x9541('0x1c')]);}_0x16ef62['order']=qs[_0x9541('0x37')](_0x261ef9['query'][_0x9541('0x37')]);_0x16ef62[_0x9541('0x38')]=qs[_0x9541('0x31')](_[_0x9541('0x39')](_0x261ef9[_0x9541('0x30')],_0x47a330[_0x9541('0x31')]));if(_0x261ef9[_0x9541('0x30')]['filter']){_0x16ef62[_0x9541('0x38')]=_['merge'](_0x16ef62[_0x9541('0x38')],{'$or':_[_0x9541('0x2f')](_0x1392ff,function(_0x1ef402){if(_0x1ef402[_0x9541('0x2c')]!==_0x9541('0x3a')){var _0x47ec6d={};_0x47ec6d[_0x1ef402[_0x9541('0x27')]]={'$like':'%'+_0x261ef9[_0x9541('0x30')][_0x9541('0x3b')]+'%'};return _0x47ec6d;}})});}_0x16ef62=_[_0x9541('0x3c')]({},_0x16ef62,_0x261ef9[_0x9541('0x3d')]);var _0x1c1279={'where':_0x16ef62[_0x9541('0x38')]};return db['MemberReport'][_0x9541('0x1b')](_0x1c1279)[_0x9541('0x23')](function(_0x5ce809){_0x51dabf['count']=_0x5ce809;if(_0x261ef9['query'][_0x9541('0x3e')]){_0x16ef62[_0x9541('0x3f')]=[{'all':!![]}];}return db['MemberReport'][_0x9541('0x40')](_0x16ef62);})[_0x9541('0x23')](function(_0x5442f9){_0x51dabf[_0x9541('0x41')]=_0x5442f9;return _0x51dabf;})[_0x9541('0x23')](respondWithFilteredResult(_0x11e89b,_0x16ef62))[_0x9541('0x42')](handleError(_0x11e89b,null));};exports[_0x9541('0x43')]=function(_0x382694,_0x3cb5e7){var _0x247ecd={'raw':!![],'where':{'id':_0x382694[_0x9541('0x44')]['id']}},_0x34ac8c={};_0x34ac8c[_0x9541('0x2e')]=_[_0x9541('0x45')](db[_0x9541('0x2a')][_0x9541('0x46')]);_0x34ac8c[_0x9541('0x30')]=_[_0x9541('0x45')](_0x382694[_0x9541('0x30')]);_0x34ac8c[_0x9541('0x31')]=_[_0x9541('0x47')](_0x34ac8c[_0x9541('0x2e')],_0x34ac8c['query']);_0x247ecd[_0x9541('0x32')]=_[_0x9541('0x47')](_0x34ac8c[_0x9541('0x2e')],qs['fields'](_0x382694['query'][_0x9541('0x33')]));_0x247ecd['attributes']=_0x247ecd[_0x9541('0x32')]['length']?_0x247ecd['attributes']:_0x34ac8c['model'];if(_0x382694['query']['includeAll']){_0x247ecd[_0x9541('0x3f')]=[{'all':!![]}];}_0x247ecd=_[_0x9541('0x3c')]({},_0x247ecd,_0x382694['options']);return db[_0x9541('0x2a')]['find'](_0x247ecd)[_0x9541('0x23')](handleEntityNotFound(_0x3cb5e7,null))[_0x9541('0x23')](respondWithResult(_0x3cb5e7,null))[_0x9541('0x42')](handleError(_0x3cb5e7,null));};exports[_0x9541('0x48')]=function(_0x46b9fb,_0x5ab3da){return db[_0x9541('0x2a')]['create'](_0x46b9fb[_0x9541('0x49')],{})[_0x9541('0x23')](respondWithResult(_0x5ab3da,0xc9))[_0x9541('0x42')](handleError(_0x5ab3da,null));};exports[_0x9541('0x4a')]=function(_0x21f91b,_0x245a41){if(_0x21f91b[_0x9541('0x49')]['id']){delete _0x21f91b['body']['id'];}return db[_0x9541('0x2a')][_0x9541('0x4b')]({'where':{'id':_0x21f91b[_0x9541('0x44')]['id']}})[_0x9541('0x23')](handleEntityNotFound(_0x245a41,null))['then'](saveUpdates(_0x21f91b[_0x9541('0x49')],null))[_0x9541('0x23')](respondWithResult(_0x245a41,null))['catch'](handleError(_0x245a41,null));};exports[_0x9541('0x24')]=function(_0x3c8f31,_0x381f8c){return db[_0x9541('0x2a')][_0x9541('0x4b')]({'where':{'id':_0x3c8f31[_0x9541('0x44')]['id']}})['then'](handleEntityNotFound(_0x381f8c,null))[_0x9541('0x23')](removeEntity(_0x381f8c,null))[_0x9541('0x42')](handleError(_0x381f8c,null));};exports['describe']=function(_0xfd45ab,_0x54ec05){return db[_0x9541('0x2a')][_0x9541('0x4c')]()[_0x9541('0x23')](respondWithResult(_0x54ec05,null))[_0x9541('0x42')](handleError(_0x54ec05,null));}; \ No newline at end of file +var _0x4c47=['index','MemberReport','rawAttributes','type','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','end','stack','name','send'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4c47,0xb6));var _0x74c4=function(_0x5036cf,_0x1aacfa){_0x5036cf=_0x5036cf-0x0;var _0x23a5dd=_0x4c47[_0x5036cf];return _0x23a5dd;};'use strict';var pdf=require(_0x74c4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x74c4('0x1'));var zipdir=require(_0x74c4('0x2'));var jsonpatch=require(_0x74c4('0x3'));var rp=require(_0x74c4('0x4'));var moment=require('moment');var BPromise=require(_0x74c4('0x5'));var Mustache=require(_0x74c4('0x6'));var util=require(_0x74c4('0x7'));var path=require(_0x74c4('0x8'));var sox=require(_0x74c4('0x9'));var csv=require(_0x74c4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x74c4('0xb'));var squel=require(_0x74c4('0xc'));var crypto=require(_0x74c4('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x74c4('0xe'));var toCsv=require(_0x74c4('0xa'));var querystring=require('querystring');var Papa=require(_0x74c4('0xf'));var Redis=require(_0x74c4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x74c4('0x11'));var as=require(_0x74c4('0x12'));var hardwareService=require(_0x74c4('0x13'));var logger=require(_0x74c4('0x14'))(_0x74c4('0x15'));var utils=require(_0x74c4('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x42025a,_0x3257f5){_0x3257f5=_0x3257f5||0xcc;return function(_0x18cc5d){if(_0x18cc5d){return _0x42025a[_0x74c4('0x17')](_0x3257f5);}return _0x42025a[_0x74c4('0x18')](_0x3257f5)['end']();};}function respondWithResult(_0x3c1b3a,_0x1a9a04){_0x1a9a04=_0x1a9a04||0xc8;return function(_0x226bda){if(_0x226bda){return _0x3c1b3a[_0x74c4('0x18')](_0x1a9a04)['json'](_0x226bda);}};}function respondWithFilteredResult(_0xf0a7cc,_0x24e925){return function(_0xb06ebe){if(_0xb06ebe){var _0x407501=_0xb06ebe[_0x74c4('0x19')],_0x5de18c=_0x24e925['offset'],_0x20408d=_0x24e925[_0x74c4('0x1a')]+_0x24e925['limit'],_0x21bd5a;if(_0x20408d>=_0x407501){_0x20408d=_0x407501;_0x21bd5a=0xc8;}else{_0x21bd5a=0xce;}_0xf0a7cc['status'](_0x21bd5a);return _0xf0a7cc[_0x74c4('0x1b')](_0x74c4('0x1c'),_0x5de18c+'-'+_0x20408d+'/'+_0x407501)[_0x74c4('0x1d')](_0xb06ebe);}return null;};}function patchUpdates(_0x2747e2){return function(_0x236a38){try{jsonpatch[_0x74c4('0x1e')](_0x236a38,_0x2747e2,!![]);}catch(_0x5ed995){return BPromise[_0x74c4('0x1f')](_0x5ed995);}return _0x236a38[_0x74c4('0x20')]();};}function saveUpdates(_0x1a97ef,_0x5f0a8f){return function(_0xac1c55){if(_0xac1c55){return _0xac1c55[_0x74c4('0x21')](_0x1a97ef)[_0x74c4('0x22')](function(_0x142764){return _0x142764;});}return null;};}function removeEntity(_0x3bb990,_0xc5e6b6){return function(_0x3f6187){if(_0x3f6187){return _0x3f6187[_0x74c4('0x23')]()[_0x74c4('0x22')](function(){_0x3bb990['status'](0xcc)[_0x74c4('0x24')]();});}};}function handleEntityNotFound(_0x2d7a1b,_0x2f2b6d){return function(_0x3acb0c){if(!_0x3acb0c){_0x2d7a1b[_0x74c4('0x17')](0x194);}return _0x3acb0c;};}function handleError(_0x1df0f9,_0x4e44e4){_0x4e44e4=_0x4e44e4||0x1f4;return function(_0xc075d8){logger['error'](_0xc075d8[_0x74c4('0x25')]);if(_0xc075d8[_0x74c4('0x26')]){delete _0xc075d8['name'];}_0x1df0f9[_0x74c4('0x18')](_0x4e44e4)[_0x74c4('0x27')](_0xc075d8);};}exports[_0x74c4('0x28')]=function(_0x42de9a,_0x3deee3){var _0x1be75b={},_0x273368={},_0x82caf8={'count':0x0,'rows':[]};var _0x6be13f=_['map'](db[_0x74c4('0x29')][_0x74c4('0x2a')],function(_0x5ac63b){return{'name':_0x5ac63b['fieldName'],'type':_0x5ac63b[_0x74c4('0x2b')][_0x74c4('0x2c')]};});_0x273368[_0x74c4('0x2d')]=_[_0x74c4('0x2e')](_0x6be13f,_0x74c4('0x26'));_0x273368[_0x74c4('0x2f')]=_[_0x74c4('0x30')](_0x42de9a[_0x74c4('0x2f')]);_0x273368['filters']=_[_0x74c4('0x31')](_0x273368[_0x74c4('0x2d')],_0x273368[_0x74c4('0x2f')]);_0x1be75b[_0x74c4('0x32')]=_[_0x74c4('0x31')](_0x273368[_0x74c4('0x2d')],qs[_0x74c4('0x33')](_0x42de9a['query'][_0x74c4('0x33')]));_0x1be75b['attributes']=_0x1be75b[_0x74c4('0x32')][_0x74c4('0x34')]?_0x1be75b['attributes']:_0x273368['model'];if(!_0x42de9a[_0x74c4('0x2f')][_0x74c4('0x35')]('nolimit')){_0x1be75b[_0x74c4('0x36')]=qs[_0x74c4('0x36')](_0x42de9a['query'][_0x74c4('0x36')]);_0x1be75b[_0x74c4('0x1a')]=qs['offset'](_0x42de9a[_0x74c4('0x2f')][_0x74c4('0x1a')]);}_0x1be75b[_0x74c4('0x37')]=qs[_0x74c4('0x38')](_0x42de9a[_0x74c4('0x2f')]['sort']);_0x1be75b['where']=qs[_0x74c4('0x39')](_[_0x74c4('0x3a')](_0x42de9a[_0x74c4('0x2f')],_0x273368[_0x74c4('0x39')]));if(_0x42de9a[_0x74c4('0x2f')][_0x74c4('0x3b')]){_0x1be75b[_0x74c4('0x3c')]=_[_0x74c4('0x3d')](_0x1be75b[_0x74c4('0x3c')],{'$or':_[_0x74c4('0x2e')](_0x6be13f,function(_0x14e549){if(_0x14e549[_0x74c4('0x2b')]!=='VIRTUAL'){var _0x3d41c4={};_0x3d41c4[_0x14e549[_0x74c4('0x26')]]={'$like':'%'+_0x42de9a['query'][_0x74c4('0x3b')]+'%'};return _0x3d41c4;}})});}_0x1be75b=_[_0x74c4('0x3d')]({},_0x1be75b,_0x42de9a[_0x74c4('0x3e')]);var _0x2a8125={'where':_0x1be75b[_0x74c4('0x3c')]};return db['MemberReport'][_0x74c4('0x19')](_0x2a8125)[_0x74c4('0x22')](function(_0x2913d2){_0x82caf8['count']=_0x2913d2;if(_0x42de9a[_0x74c4('0x2f')][_0x74c4('0x3f')]){_0x1be75b[_0x74c4('0x40')]=[{'all':!![]}];}return db[_0x74c4('0x29')][_0x74c4('0x41')](_0x1be75b);})[_0x74c4('0x22')](function(_0x3414ec){_0x82caf8[_0x74c4('0x42')]=_0x3414ec;return _0x82caf8;})[_0x74c4('0x22')](respondWithFilteredResult(_0x3deee3,_0x1be75b))[_0x74c4('0x43')](handleError(_0x3deee3,null));};exports[_0x74c4('0x44')]=function(_0xfbc7e6,_0xab2f5e){var _0x2899dd={'raw':!![],'where':{'id':_0xfbc7e6[_0x74c4('0x45')]['id']}},_0x12472c={};_0x12472c['model']=_[_0x74c4('0x30')](db['MemberReport']['rawAttributes']);_0x12472c[_0x74c4('0x2f')]=_[_0x74c4('0x30')](_0xfbc7e6['query']);_0x12472c[_0x74c4('0x39')]=_['intersection'](_0x12472c['model'],_0x12472c['query']);_0x2899dd[_0x74c4('0x32')]=_[_0x74c4('0x31')](_0x12472c[_0x74c4('0x2d')],qs[_0x74c4('0x33')](_0xfbc7e6[_0x74c4('0x2f')][_0x74c4('0x33')]));_0x2899dd[_0x74c4('0x32')]=_0x2899dd[_0x74c4('0x32')][_0x74c4('0x34')]?_0x2899dd['attributes']:_0x12472c[_0x74c4('0x2d')];if(_0xfbc7e6[_0x74c4('0x2f')][_0x74c4('0x3f')]){_0x2899dd[_0x74c4('0x40')]=[{'all':!![]}];}_0x2899dd=_['merge']({},_0x2899dd,_0xfbc7e6['options']);return db[_0x74c4('0x29')][_0x74c4('0x46')](_0x2899dd)[_0x74c4('0x22')](handleEntityNotFound(_0xab2f5e,null))[_0x74c4('0x22')](respondWithResult(_0xab2f5e,null))[_0x74c4('0x43')](handleError(_0xab2f5e,null));};exports[_0x74c4('0x47')]=function(_0x525f3d,_0x158649){return db[_0x74c4('0x29')]['create'](_0x525f3d[_0x74c4('0x48')],{})[_0x74c4('0x22')](respondWithResult(_0x158649,0xc9))[_0x74c4('0x43')](handleError(_0x158649,null));};exports[_0x74c4('0x21')]=function(_0x67ba69,_0x2a3c5e){if(_0x67ba69[_0x74c4('0x48')]['id']){delete _0x67ba69[_0x74c4('0x48')]['id'];}return db['MemberReport'][_0x74c4('0x46')]({'where':{'id':_0x67ba69[_0x74c4('0x45')]['id']}})[_0x74c4('0x22')](handleEntityNotFound(_0x2a3c5e,null))[_0x74c4('0x22')](saveUpdates(_0x67ba69['body'],null))[_0x74c4('0x22')](respondWithResult(_0x2a3c5e,null))[_0x74c4('0x43')](handleError(_0x2a3c5e,null));};exports[_0x74c4('0x23')]=function(_0x5ec73d,_0x523103){return db[_0x74c4('0x29')][_0x74c4('0x46')]({'where':{'id':_0x5ec73d['params']['id']}})['then'](handleEntityNotFound(_0x523103,null))['then'](removeEntity(_0x523103,null))[_0x74c4('0x43')](handleError(_0x523103,null));};exports[_0x74c4('0x49')]=function(_0x2cbb41,_0x194805){return db['MemberReport'][_0x74c4('0x49')]()[_0x74c4('0x22')](respondWithResult(_0x194805,null))['catch'](handleError(_0x194805,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 4d45f33..291a587 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 _0xb1a8=['moment','bluebird','request-promise','path','../../config/environment','./memberReport.attributes','exports','MemberReport','membername_interface','membername','util','../../config/logger'];(function(_0x548513,_0x2c7366){var _0x1bfa07=function(_0x1f6fe9){while(--_0x1f6fe9){_0x548513['push'](_0x548513['shift']());}};_0x1bfa07(++_0x2c7366);}(_0xb1a8,0x142));var _0x8b1a=function(_0x320e94,_0x4140b1){_0x320e94=_0x320e94-0x0;var _0x1002be=_0xb1a8[_0x320e94];return _0x1002be;};'use strict';var _=require('lodash');var util=require(_0x8b1a('0x0'));var logger=require(_0x8b1a('0x1'))('api');var moment=require(_0x8b1a('0x2'));var BPromise=require(_0x8b1a('0x3'));var rp=require(_0x8b1a('0x4'));var fs=require('fs');var path=require(_0x8b1a('0x5'));var rimraf=require('rimraf');var config=require(_0x8b1a('0x6'));var attributes=require(_0x8b1a('0x7'));module[_0x8b1a('0x8')]=function(_0x185120,_0x234a9d){return _0x185120['define'](_0x8b1a('0x9'),attributes,{'tableName':'report_member','paranoid':![],'indexes':[{'name':_0x8b1a('0xa'),'fields':[_0x8b1a('0xb'),'interface']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe2e2=['request-promise','path','rimraf','../../config/environment','./memberReport.attributes','exports','define','report_member','membername_interface','membername','interface','lodash','util','api','moment','bluebird'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xe2e2,0x13b));var _0x2e2e=function(_0x553fcc,_0x11c3e6){_0x553fcc=_0x553fcc-0x0;var _0xacf625=_0xe2e2[_0x553fcc];return _0xacf625;};'use strict';var _=require(_0x2e2e('0x0'));var util=require(_0x2e2e('0x1'));var logger=require('../../config/logger')(_0x2e2e('0x2'));var moment=require(_0x2e2e('0x3'));var BPromise=require(_0x2e2e('0x4'));var rp=require(_0x2e2e('0x5'));var fs=require('fs');var path=require(_0x2e2e('0x6'));var rimraf=require(_0x2e2e('0x7'));var config=require(_0x2e2e('0x8'));var attributes=require(_0x2e2e('0x9'));module[_0x2e2e('0xa')]=function(_0x4538b6,_0x8398f6){return _0x4538b6[_0x2e2e('0xb')]('MemberReport',attributes,{'tableName':_0x2e2e('0xc'),'paranoid':![],'indexes':[{'name':_0x2e2e('0xd'),'fields':[_0x2e2e('0xe'),_0x2e2e('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 1dd5fd0..5b0a6c7 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 _0xce47=['info','MemberReport,\x20%s,\x20%s','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','MemberReport','options','raw','where','limit','include','model','map','attributes','GetMemberReport','catch','create','body','CreateMemberReport','UpdateMemberReport','update','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','client','request','then'];(function(_0x591e16,_0x5aefc1){var _0x543b35=function(_0x81e3be){while(--_0x81e3be){_0x591e16['push'](_0x591e16['shift']());}};_0x543b35(++_0x5aefc1);}(_0xce47,0xf1));var _0x7ce4=function(_0x53d77a,_0x2790cc){_0x53d77a=_0x53d77a-0x0;var _0x22b07f=_0xce47[_0x53d77a];return _0x22b07f;};'use strict';var _=require(_0x7ce4('0x0'));var util=require(_0x7ce4('0x1'));var moment=require('moment');var BPromise=require(_0x7ce4('0x2'));var rs=require(_0x7ce4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7ce4('0x4'))['db'];var utils=require(_0x7ce4('0x5'));var logger=require('../../config/logger')(_0x7ce4('0x6'));var config=require(_0x7ce4('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x7ce4('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x57b86d,_0x1376e4,_0x540f82){return new BPromise(function(_0x66248c,_0xef5552){return client[_0x7ce4('0x9')](_0x57b86d,_0x540f82)[_0x7ce4('0xa')](function(_0x46d54d){logger[_0x7ce4('0xb')](_0x7ce4('0xc'),_0x1376e4,'request\x20sent');logger[_0x7ce4('0xd')](_0x7ce4('0xe'),_0x1376e4,_0x7ce4('0xf'),JSON[_0x7ce4('0x10')](_0x46d54d));if(_0x46d54d[_0x7ce4('0x11')]){if(_0x46d54d[_0x7ce4('0x11')][_0x7ce4('0x12')]===0x1f4){logger['error']('MemberReport,\x20%s,\x20%s',_0x1376e4,_0x46d54d['error'][_0x7ce4('0x13')]);return _0xef5552(_0x46d54d[_0x7ce4('0x11')][_0x7ce4('0x13')]);}logger[_0x7ce4('0x11')]('MemberReport,\x20%s,\x20%s',_0x1376e4,_0x46d54d[_0x7ce4('0x11')][_0x7ce4('0x13')]);return _0x66248c(_0x46d54d[_0x7ce4('0x11')][_0x7ce4('0x13')]);}else{logger[_0x7ce4('0xb')](_0x7ce4('0xc'),_0x1376e4,'request\x20sent');_0x66248c(_0x46d54d['result'][_0x7ce4('0x13')]);}})['catch'](function(_0x3abbad){logger['error']('MemberReport,\x20%s,\x20%s',_0x1376e4,_0x3abbad);_0xef5552(_0x3abbad);});});}exports['GetMemberReport']=function(_0xf72ba9){var _0x55b88b=this;return new Promise(function(_0x369631,_0x20bdf6){return db[_0x7ce4('0x14')]['findAll']({'raw':_0xf72ba9[_0x7ce4('0x15')]?_0xf72ba9[_0x7ce4('0x15')][_0x7ce4('0x16')]===undefined?!![]:![]:!![],'where':_0xf72ba9['options']?_0xf72ba9[_0x7ce4('0x15')][_0x7ce4('0x17')]||null:null,'attributes':_0xf72ba9['options']?_0xf72ba9[_0x7ce4('0x15')]['attributes']||null:null,'limit':_0xf72ba9[_0x7ce4('0x15')]?_0xf72ba9[_0x7ce4('0x15')][_0x7ce4('0x18')]||null:null,'include':_0xf72ba9[_0x7ce4('0x15')]?_0xf72ba9[_0x7ce4('0x15')][_0x7ce4('0x19')]?_['map'](_0xf72ba9[_0x7ce4('0x15')][_0x7ce4('0x19')],function(_0x28c75a){return{'model':db[_0x28c75a[_0x7ce4('0x1a')]],'as':_0x28c75a['as'],'attributes':_0x28c75a['attributes'],'include':_0x28c75a[_0x7ce4('0x19')]?_[_0x7ce4('0x1b')](_0x28c75a[_0x7ce4('0x19')],function(_0x528716){return{'model':db[_0x528716[_0x7ce4('0x1a')]],'as':_0x528716['as'],'attributes':_0x528716[_0x7ce4('0x1c')],'include':_0x528716['include']?_['map'](_0x528716[_0x7ce4('0x19')],function(_0x5b6f06){return{'model':db[_0x5b6f06[_0x7ce4('0x1a')]],'as':_0x5b6f06['as'],'attributes':_0x5b6f06[_0x7ce4('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7ce4('0xa')](function(_0x56c3b9){logger[_0x7ce4('0xb')](_0x7ce4('0x1d'),_0xf72ba9);logger[_0x7ce4('0xd')](_0x7ce4('0x1d'),_0xf72ba9,JSON[_0x7ce4('0x10')](_0x56c3b9));_0x369631(_0x56c3b9);})[_0x7ce4('0x1e')](function(_0x4285bd){logger[_0x7ce4('0x11')](_0x7ce4('0x1d'),_0x4285bd[_0x7ce4('0x13')],_0xf72ba9);_0x20bdf6(_0x55b88b['error'](0x1f4,_0x4285bd[_0x7ce4('0x13')]));});});};exports['CreateMemberReport']=function(_0x195f9e){var _0x2c6adc=this;return new Promise(function(_0x53fe3e,_0x5d4370){return db[_0x7ce4('0x14')][_0x7ce4('0x1f')](_0x195f9e[_0x7ce4('0x20')],{'raw':_0x195f9e[_0x7ce4('0x15')]?_0x195f9e[_0x7ce4('0x15')][_0x7ce4('0x16')]===undefined?!![]:![]:!![]})[_0x7ce4('0xa')](function(_0x44738c){logger[_0x7ce4('0xb')](_0x7ce4('0x21'),_0x195f9e);logger['debug'](_0x7ce4('0x21'),_0x195f9e,JSON[_0x7ce4('0x10')](_0x44738c));_0x53fe3e(_0x44738c);})[_0x7ce4('0x1e')](function(_0x573355){logger[_0x7ce4('0x11')](_0x7ce4('0x21'),_0x573355[_0x7ce4('0x13')],_0x195f9e);_0x5d4370(_0x2c6adc[_0x7ce4('0x11')](0x1f4,_0x573355[_0x7ce4('0x13')]));});});};exports[_0x7ce4('0x22')]=function(_0x1bc839){var _0x290630=this;return new Promise(function(_0x4db7bf,_0x49651e){return db[_0x7ce4('0x14')][_0x7ce4('0x23')](_0x1bc839[_0x7ce4('0x20')],{'raw':_0x1bc839['options']?_0x1bc839[_0x7ce4('0x15')][_0x7ce4('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bc839[_0x7ce4('0x15')]?_0x1bc839[_0x7ce4('0x15')][_0x7ce4('0x17')]||null:null,'attributes':_0x1bc839['options']?_0x1bc839[_0x7ce4('0x15')][_0x7ce4('0x1c')]||null:null,'limit':_0x1bc839[_0x7ce4('0x15')]?_0x1bc839[_0x7ce4('0x15')][_0x7ce4('0x18')]||null:null})[_0x7ce4('0xa')](function(_0x159f03){logger['info'](_0x7ce4('0x22'),_0x1bc839);logger[_0x7ce4('0xd')](_0x7ce4('0x22'),_0x1bc839,JSON[_0x7ce4('0x10')](_0x159f03));_0x4db7bf(_0x159f03);})[_0x7ce4('0x1e')](function(_0x2a899e){logger[_0x7ce4('0x11')](_0x7ce4('0x22'),_0x2a899e['message'],_0x1bc839);_0x49651e(_0x290630[_0x7ce4('0x11')](0x1f4,_0x2a899e['message']));});});}; \ No newline at end of file +var _0x9c84=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','debug','MemberReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MemberReport,\x20%s,\x20%s','result','GetMemberReport','MemberReport','findAll','options','raw','where','attributes','limit','include','map','model','CreateMemberReport','create','body','catch','update','util','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x9c84,0x192));var _0x49c8=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x9c84[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require(_0x49c8('0x0'));var moment=require('moment');var BPromise=require(_0x49c8('0x1'));var rs=require(_0x49c8('0x2'));var fs=require('fs');var Redis=require(_0x49c8('0x3'));var db=require(_0x49c8('0x4'))['db'];var utils=require(_0x49c8('0x5'));var logger=require(_0x49c8('0x6'))(_0x49c8('0x7'));var config=require(_0x49c8('0x8'));var jayson=require(_0x49c8('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xba7c56,_0x3bf8b6,_0x2aae26){return new BPromise(function(_0x2b343a,_0x51333b){return client[_0x49c8('0xa')](_0xba7c56,_0x2aae26)[_0x49c8('0xb')](function(_0x3bb8ac){logger[_0x49c8('0xc')]('MemberReport,\x20%s,\x20%s',_0x3bf8b6,'request\x20sent');logger[_0x49c8('0xd')](_0x49c8('0xe'),_0x3bf8b6,_0x49c8('0xf'),JSON[_0x49c8('0x10')](_0x3bb8ac));if(_0x3bb8ac[_0x49c8('0x11')]){if(_0x3bb8ac['error']['code']===0x1f4){logger[_0x49c8('0x11')]('MemberReport,\x20%s,\x20%s',_0x3bf8b6,_0x3bb8ac['error'][_0x49c8('0x12')]);return _0x51333b(_0x3bb8ac['error']['message']);}logger[_0x49c8('0x11')]('MemberReport,\x20%s,\x20%s',_0x3bf8b6,_0x3bb8ac[_0x49c8('0x11')][_0x49c8('0x12')]);return _0x2b343a(_0x3bb8ac[_0x49c8('0x11')][_0x49c8('0x12')]);}else{logger[_0x49c8('0xc')](_0x49c8('0x13'),_0x3bf8b6,_0x49c8('0xf'));_0x2b343a(_0x3bb8ac[_0x49c8('0x14')][_0x49c8('0x12')]);}})['catch'](function(_0x598335){logger[_0x49c8('0x11')](_0x49c8('0x13'),_0x3bf8b6,_0x598335);_0x51333b(_0x598335);});});}exports[_0x49c8('0x15')]=function(_0x57b459){var _0x10626c=this;return new Promise(function(_0x118e7b,_0x476240){return db[_0x49c8('0x16')][_0x49c8('0x17')]({'raw':_0x57b459[_0x49c8('0x18')]?_0x57b459[_0x49c8('0x18')][_0x49c8('0x19')]===undefined?!![]:![]:!![],'where':_0x57b459['options']?_0x57b459[_0x49c8('0x18')][_0x49c8('0x1a')]||null:null,'attributes':_0x57b459[_0x49c8('0x18')]?_0x57b459['options'][_0x49c8('0x1b')]||null:null,'limit':_0x57b459['options']?_0x57b459['options'][_0x49c8('0x1c')]||null:null,'include':_0x57b459[_0x49c8('0x18')]?_0x57b459[_0x49c8('0x18')][_0x49c8('0x1d')]?_[_0x49c8('0x1e')](_0x57b459[_0x49c8('0x18')][_0x49c8('0x1d')],function(_0x32198c){return{'model':db[_0x32198c[_0x49c8('0x1f')]],'as':_0x32198c['as'],'attributes':_0x32198c[_0x49c8('0x1b')],'include':_0x32198c['include']?_[_0x49c8('0x1e')](_0x32198c['include'],function(_0x248f72){return{'model':db[_0x248f72[_0x49c8('0x1f')]],'as':_0x248f72['as'],'attributes':_0x248f72[_0x49c8('0x1b')],'include':_0x248f72[_0x49c8('0x1d')]?_[_0x49c8('0x1e')](_0x248f72[_0x49c8('0x1d')],function(_0x3524bb){return{'model':db[_0x3524bb[_0x49c8('0x1f')]],'as':_0x3524bb['as'],'attributes':_0x3524bb[_0x49c8('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x24edab){logger[_0x49c8('0xc')](_0x49c8('0x15'),_0x57b459);logger[_0x49c8('0xd')]('GetMemberReport',_0x57b459,JSON['stringify'](_0x24edab));_0x118e7b(_0x24edab);})['catch'](function(_0x3802c8){logger[_0x49c8('0x11')](_0x49c8('0x15'),_0x3802c8[_0x49c8('0x12')],_0x57b459);_0x476240(_0x10626c[_0x49c8('0x11')](0x1f4,_0x3802c8[_0x49c8('0x12')]));});});};exports[_0x49c8('0x20')]=function(_0x4dadde){var _0x2a1733=this;return new Promise(function(_0x57030c,_0x47c826){return db['MemberReport'][_0x49c8('0x21')](_0x4dadde[_0x49c8('0x22')],{'raw':_0x4dadde[_0x49c8('0x18')]?_0x4dadde[_0x49c8('0x18')][_0x49c8('0x19')]===undefined?!![]:![]:!![]})[_0x49c8('0xb')](function(_0x460ef5){logger[_0x49c8('0xc')](_0x49c8('0x20'),_0x4dadde);logger['debug'](_0x49c8('0x20'),_0x4dadde,JSON[_0x49c8('0x10')](_0x460ef5));_0x57030c(_0x460ef5);})[_0x49c8('0x23')](function(_0x38abf0){logger[_0x49c8('0x11')](_0x49c8('0x20'),_0x38abf0[_0x49c8('0x12')],_0x4dadde);_0x47c826(_0x2a1733[_0x49c8('0x11')](0x1f4,_0x38abf0[_0x49c8('0x12')]));});});};exports['UpdateMemberReport']=function(_0x2a82dc){var _0x1873d7=this;return new Promise(function(_0x58c58b,_0x29fed7){return db[_0x49c8('0x16')][_0x49c8('0x24')](_0x2a82dc[_0x49c8('0x22')],{'raw':_0x2a82dc[_0x49c8('0x18')]?_0x2a82dc[_0x49c8('0x18')][_0x49c8('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2a82dc['options']?_0x2a82dc['options'][_0x49c8('0x1a')]||null:null,'attributes':_0x2a82dc[_0x49c8('0x18')]?_0x2a82dc['options']['attributes']||null:null,'limit':_0x2a82dc[_0x49c8('0x18')]?_0x2a82dc[_0x49c8('0x18')][_0x49c8('0x1c')]||null:null})[_0x49c8('0xb')](function(_0x504a71){logger[_0x49c8('0xc')]('UpdateMemberReport',_0x2a82dc);logger[_0x49c8('0xd')]('UpdateMemberReport',_0x2a82dc,JSON[_0x49c8('0x10')](_0x504a71));_0x58c58b(_0x504a71);})[_0x49c8('0x23')](function(_0x306cc5){logger[_0x49c8('0x11')]('UpdateMemberReport',_0x306cc5[_0x49c8('0x12')],_0x2a82dc);_0x29fed7(_0x1873d7[_0x49c8('0x11')](0x1f4,_0x306cc5[_0x49c8('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 9ccb26e..7f7f805 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 _0x3266=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','exports','multer','util','path','connect-timeout'];(function(_0x5bc6fe,_0x574c7d){var _0xdf2c95=function(_0x575328){while(--_0x575328){_0x5bc6fe['push'](_0x5bc6fe['shift']());}};_0xdf2c95(++_0x574c7d);}(_0x3266,0x6a));var _0x6326=function(_0x32b542,_0x4512fa){_0x32b542=_0x32b542-0x0;var _0x554d54=_0x3266[_0x32b542];return _0x554d54;};'use strict';var multer=require(_0x6326('0x0'));var util=require(_0x6326('0x1'));var path=require(_0x6326('0x2'));var timeout=require(_0x6326('0x3'));var express=require(_0x6326('0x4'));var router=express[_0x6326('0x5')]();var auth=require(_0x6326('0x6'));var interaction=require(_0x6326('0x7'));var config=require(_0x6326('0x8'));var controller=require('./migration.controller');router[_0x6326('0x9')]('/',controller['index']);module[_0x6326('0xa')]=router; \ No newline at end of file +var _0x5ec6=['util','path','express','../../components/auth/service','../../config/environment','get','exports','multer'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x5ec6,0x7f));var _0x65ec=function(_0x1c23cb,_0x5856e3){_0x1c23cb=_0x1c23cb-0x0;var _0x3122cc=_0x5ec6[_0x1c23cb];return _0x3122cc;};'use strict';var multer=require(_0x65ec('0x0'));var util=require(_0x65ec('0x1'));var path=require(_0x65ec('0x2'));var timeout=require('connect-timeout');var express=require(_0x65ec('0x3'));var router=express['Router']();var auth=require(_0x65ec('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x65ec('0x5'));var controller=require('./migration.controller');router[_0x65ec('0x6')]('/',controller['index']);module[_0x65ec('0x7')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 45dd27b..e031e38 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 _0xc134=['version','exports','STRING'];(function(_0x4901cb,_0x42edbd){var _0x811450=function(_0x12d514){while(--_0x12d514){_0x4901cb['push'](_0x4901cb['shift']());}};_0x811450(++_0x42edbd);}(_0xc134,0x91));var _0x4c13=function(_0x494a3a,_0x59c655){_0x494a3a=_0x494a3a-0x0;var _0x598f8e=_0xc134[_0x494a3a];return _0x598f8e;};'use strict';var Sequelize=require('sequelize');module[_0x4c13('0x0')]={'version':{'type':Sequelize[_0x4c13('0x1')],'unique':_0x4c13('0x2')}}; \ No newline at end of file +var _0xc833=['sequelize','exports','version'];(function(_0x45e09e,_0x59081c){var _0x1f8d93=function(_0x494436){while(--_0x494436){_0x45e09e['push'](_0x45e09e['shift']());}};_0x1f8d93(++_0x59081c);}(_0xc833,0x150));var _0x3c83=function(_0x4f463a,_0x899672){_0x4f463a=_0x4f463a-0x0;var _0x23ddda=_0xc833[_0x4f463a];return _0x23ddda;};'use strict';var Sequelize=require(_0x3c83('0x0'));module[_0x3c83('0x1')]={'version':{'type':Sequelize['STRING'],'unique':_0x3c83('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index 60f3804..16ba0ed 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 _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0x599918,_0x2f55d8){var _0x1a964e=function(_0x1740e3){while(--_0x1740e3){_0x599918['push'](_0x599918['shift']());}};_0x1a964e(++_0x2f55d8);}(_0x5f2f,0x73));var _0xf5f2=function(_0xc7518c,_0x42149d){_0xc7518c=_0xc7518c-0x0;var _0x10d4b4=_0x5f2f[_0xc7518c];return _0x10d4b4;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');var _=require(_0xf5f2('0xc'));var squel=require(_0xf5f2('0xd'));var crypto=require('crypto');var jsforce=require(_0xf5f2('0xe'));var deskjs=require(_0xf5f2('0xf'));var toCsv=require(_0xf5f2('0xa'));var querystring=require('querystring');var Papa=require(_0xf5f2('0x10'));var Redis=require(_0xf5f2('0x11'));var authService=require(_0xf5f2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xf5f2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf5f2('0x14'));var utils=require(_0xf5f2('0x15'));var config=require('../../config/environment');var db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file +var _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x4f9c85,_0x49a069){var _0x59b90c=function(_0x444466){while(--_0x444466){_0x4f9c85['push'](_0x4f9c85['shift']());}};_0x59b90c(++_0x49a069);}(_0x7a54,0x106));var _0x47a5=function(_0x5ab6ac,_0x41384e){_0x5ab6ac=_0x5ab6ac-0x0;var _0xdf3a83=_0x7a54[_0x5ab6ac];return _0xdf3a83;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x47a5('0xb'));var crypto=require(_0x47a5('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x47a5('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47a5('0xe'));var authService=require(_0x47a5('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x47a5('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x47a5('0x11'));var utils=require(_0x47a5('0x12'));var config=require(_0x47a5('0x13'));var db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 742ee9b..9803b1f 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 _0x2ad6=['path','rimraf','../../config/environment','define','migrations','lodash','util','api','moment','bluebird','request-promise'];(function(_0x47a3ab,_0x4e90e2){var _0x11ef65=function(_0x28047e){while(--_0x28047e){_0x47a3ab['push'](_0x47a3ab['shift']());}};_0x11ef65(++_0x4e90e2);}(_0x2ad6,0x186));var _0x62ad=function(_0x2ae83a,_0x3846c4){_0x2ae83a=_0x2ae83a-0x0;var _0x4cfc27=_0x2ad6[_0x2ae83a];return _0x4cfc27;};'use strict';var _=require(_0x62ad('0x0'));var util=require(_0x62ad('0x1'));var logger=require('../../config/logger')(_0x62ad('0x2'));var moment=require(_0x62ad('0x3'));var BPromise=require(_0x62ad('0x4'));var rp=require(_0x62ad('0x5'));var fs=require('fs');var path=require(_0x62ad('0x6'));var rimraf=require(_0x62ad('0x7'));var config=require(_0x62ad('0x8'));var attributes=require('./migration.attributes');module['exports']=function(_0x166e4c,_0x1d59ae){return _0x166e4c[_0x62ad('0x9')]('Migration',attributes,{'tableName':_0x62ad('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf553=['../../config/environment','./migration.attributes','define','Migration','migrations','lodash','util','moment','bluebird','path','rimraf'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xf553,0xb5));var _0x3f55=function(_0x24618a,_0x2cd0f4){_0x24618a=_0x24618a-0x0;var _0x2e3d64=_0xf553[_0x24618a];return _0x2e3d64;};'use strict';var _=require(_0x3f55('0x0'));var util=require(_0x3f55('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3f55('0x2'));var BPromise=require(_0x3f55('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3f55('0x4'));var rimraf=require(_0x3f55('0x5'));var config=require(_0x3f55('0x6'));var attributes=require(_0x3f55('0x7'));module['exports']=function(_0xee3d89,_0x44880e){return _0xee3d89[_0x3f55('0x8')](_0x3f55('0x9'),attributes,{'tableName':_0x3f55('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/migration/migration.rpc.js b/server/api/migration/migration.rpc.js index cab506b..6533733 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 _0xe5cd=['debug','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Migration,\x20%s,\x20%s','request\x20sent'];(function(_0x280007,_0x2abb37){var _0x48bb31=function(_0x314271){while(--_0x314271){_0x280007['push'](_0x280007['shift']());}};_0x48bb31(++_0x2abb37);}(_0xe5cd,0x13f));var _0xde5c=function(_0x6b823f,_0x414adb){_0x6b823f=_0x6b823f-0x0;var _0x24eff1=_0xe5cd[_0x6b823f];return _0x24eff1;};'use strict';var _=require(_0xde5c('0x0'));var util=require(_0xde5c('0x1'));var moment=require(_0xde5c('0x2'));var BPromise=require(_0xde5c('0x3'));var rs=require(_0xde5c('0x4'));var fs=require('fs');var Redis=require(_0xde5c('0x5'));var db=require(_0xde5c('0x6'))['db'];var utils=require(_0xde5c('0x7'));var logger=require(_0xde5c('0x8'))('rpc');var config=require(_0xde5c('0x9'));var jayson=require(_0xde5c('0xa'));var client=jayson[_0xde5c('0xb')][_0xde5c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1ca4f9,_0x586991,_0x5946a1){return new BPromise(function(_0x218448,_0x5506e6){return client[_0xde5c('0xd')](_0x1ca4f9,_0x5946a1)[_0xde5c('0xe')](function(_0xdd47aa){logger['info'](_0xde5c('0xf'),_0x586991,_0xde5c('0x10'));logger[_0xde5c('0x11')]('Migration,\x20%s,\x20%s,\x20%s',_0x586991,_0xde5c('0x10'),JSON[_0xde5c('0x12')](_0xdd47aa));if(_0xdd47aa[_0xde5c('0x13')]){if(_0xdd47aa[_0xde5c('0x13')][_0xde5c('0x14')]===0x1f4){logger['error'](_0xde5c('0xf'),_0x586991,_0xdd47aa[_0xde5c('0x13')][_0xde5c('0x15')]);return _0x5506e6(_0xdd47aa[_0xde5c('0x13')][_0xde5c('0x15')]);}logger[_0xde5c('0x13')](_0xde5c('0xf'),_0x586991,_0xdd47aa['error'][_0xde5c('0x15')]);return _0x218448(_0xdd47aa['error'][_0xde5c('0x15')]);}else{logger[_0xde5c('0x16')](_0xde5c('0xf'),_0x586991,_0xde5c('0x10'));_0x218448(_0xdd47aa[_0xde5c('0x17')]['message']);}})['catch'](function(_0xef16fe){logger[_0xde5c('0x13')](_0xde5c('0xf'),_0x586991,_0xef16fe);_0x5506e6(_0xef16fe);});});} \ No newline at end of file +var _0x5554=['result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','Migration,\x20%s,\x20%s,\x20%s','error','code','message','Migration,\x20%s,\x20%s'];(function(_0x513d66,_0x150c20){var _0x692b04=function(_0x28ab5c){while(--_0x28ab5c){_0x513d66['push'](_0x513d66['shift']());}};_0x692b04(++_0x150c20);}(_0x5554,0x70));var _0x4555=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0x5554[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0x4555('0x0'));var util=require(_0x4555('0x1'));var moment=require(_0x4555('0x2'));var BPromise=require(_0x4555('0x3'));var rs=require(_0x4555('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4555('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4555('0x6'))(_0x4555('0x7'));var config=require('../../config/environment');var jayson=require(_0x4555('0x8'));var client=jayson[_0x4555('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ee5c1,_0x5c8ff1,_0x1ab9e0){return new BPromise(function(_0x464df1,_0x199ebd){return client[_0x4555('0xa')](_0x3ee5c1,_0x1ab9e0)[_0x4555('0xb')](function(_0x360823){logger[_0x4555('0xc')]('Migration,\x20%s,\x20%s',_0x5c8ff1,_0x4555('0xd'));logger[_0x4555('0xe')](_0x4555('0xf'),_0x5c8ff1,_0x4555('0xd'),JSON['stringify'](_0x360823));if(_0x360823[_0x4555('0x10')]){if(_0x360823[_0x4555('0x10')][_0x4555('0x11')]===0x1f4){logger[_0x4555('0x10')]('Migration,\x20%s,\x20%s',_0x5c8ff1,_0x360823[_0x4555('0x10')][_0x4555('0x12')]);return _0x199ebd(_0x360823[_0x4555('0x10')]['message']);}logger['error'](_0x4555('0x13'),_0x5c8ff1,_0x360823[_0x4555('0x10')][_0x4555('0x12')]);return _0x464df1(_0x360823[_0x4555('0x10')][_0x4555('0x12')]);}else{logger[_0x4555('0xc')](_0x4555('0x13'),_0x5c8ff1,_0x4555('0xd'));_0x464df1(_0x360823[_0x4555('0x14')]['message']);}})[_0x4555('0x15')](function(_0x19ab32){logger['error']('Migration,\x20%s,\x20%s',_0x5c8ff1,_0x19ab32);_0x199ebd(_0x19ab32);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 8a22700..f54cc93 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 _0x3ae7=['update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./network.controller','get','/:id','isAuthenticated','create'];(function(_0x30cc1a,_0x162bbc){var _0xb3f18f=function(_0x26bdfe){while(--_0x26bdfe){_0x30cc1a['push'](_0x30cc1a['shift']());}};_0xb3f18f(++_0x162bbc);}(_0x3ae7,0x1e4));var _0x73ae=function(_0xd963e2,_0x548c9d){_0xd963e2=_0xd963e2-0x0;var _0x3f515a=_0x3ae7[_0xd963e2];return _0x3f515a;};'use strict';var multer=require(_0x73ae('0x0'));var util=require(_0x73ae('0x1'));var path=require(_0x73ae('0x2'));var timeout=require(_0x73ae('0x3'));var express=require('express');var router=express[_0x73ae('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x73ae('0x5'));var config=require('../../config/environment');var controller=require(_0x73ae('0x6'));router[_0x73ae('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x73ae('0x7')](_0x73ae('0x8'),auth[_0x73ae('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0x73ae('0xa')]);router['put'](_0x73ae('0x8'),auth[_0x73ae('0x9')](),controller[_0x73ae('0xb')]);router[_0x73ae('0xc')](_0x73ae('0x8'),auth[_0x73ae('0x9')](),controller[_0x73ae('0xd')]);module[_0x73ae('0xe')]=router; \ No newline at end of file +var _0xb280=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','destroy','exports','path','connect-timeout'];(function(_0x3378b0,_0x28cc56){var _0xdf1ea1=function(_0x30ad3d){while(--_0x30ad3d){_0x3378b0['push'](_0x3378b0['shift']());}};_0xdf1ea1(++_0x28cc56);}(_0xb280,0x148));var _0x0b28=function(_0xbc0ba4,_0x3a715a){_0xbc0ba4=_0xbc0ba4-0x0;var _0x5df3ae=_0xb280[_0xbc0ba4];return _0x5df3ae;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x0b28('0x0'));var timeout=require(_0x0b28('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x0b28('0x2'));var interaction=require(_0x0b28('0x3'));var config=require('../../config/environment');var controller=require('./network.controller');router[_0x0b28('0x4')]('/',auth['isAuthenticated'](),controller[_0x0b28('0x5')]);router[_0x0b28('0x4')](_0x0b28('0x6'),auth[_0x0b28('0x7')](),controller[_0x0b28('0x8')]);router[_0x0b28('0x9')]('/',auth[_0x0b28('0x7')](),controller[_0x0b28('0xa')]);router[_0x0b28('0xb')](_0x0b28('0x6'),auth[_0x0b28('0x7')](),controller[_0x0b28('0xc')]);router['delete'](_0x0b28('0x6'),auth['isAuthenticated'](),controller[_0x0b28('0xd')]);module[_0x0b28('0xe')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 16a5a36..a28960c 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 _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x4b695d,_0x5811b3){var _0x1a8d1e=function(_0x17fff2){while(--_0x17fff2){_0x4b695d['push'](_0x4b695d['shift']());}};_0x1a8d1e(++_0x5811b3);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c4737,_0x2329ec){_0x3c4737=_0x3c4737-0x0;var _0x2bb926=_0xa9e0[_0x3c4737];return _0x2bb926;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','ENUM','stun'];(function(_0x2aa168,_0x3f5f14){var _0x2560b0=function(_0x5281a5){while(--_0x5281a5){_0x2aa168['push'](_0x2aa168['shift']());}};_0x2560b0(++_0x3f5f14);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4dbaad,_0x730318){_0x4dbaad=_0x4dbaad-0x0;var _0x226c72=_0xa9e0[_0x4dbaad];return _0x226c72;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'type':{'type':Sequelize[_0x0a9e('0x2')]('localnet','externip',_0x0a9e('0x3'),'turn')},'value':{'type':Sequelize[_0x0a9e('0x4')]},'username':{'type':Sequelize[_0x0a9e('0x4')]},'password':{'type':Sequelize[_0x0a9e('0x4')]}}; \ No newline at end of file diff --git a/server/api/network/network.controller.js b/server/api/network/network.controller.js index 19a337d..f33bedf 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 _0x71cc=['set','Content-Range','save','update','destroy','name','send','index','map','Network','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','includeAll','include','params','rawAttributes','fields','options','find','create','sequelize','body','findAll','toUpperCase','STUN','readFileSync','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','res_stun_monitor.so','server/files/templates/turn_multiple.ejs','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','format','transaction','TURN','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','html-pdf','zip-dir','fast-json-patch','request-promise','moment','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','sendStatus','end','status','json','count','offset','limit'];(function(_0x3ac215,_0x7ca8ae){var _0x423237=function(_0x579959){while(--_0x579959){_0x3ac215['push'](_0x3ac215['shift']());}};_0x423237(++_0x7ca8ae);}(_0x71cc,0x16d));var _0xc71c=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x71cc[_0x4f9b18];return _0x29f20c;};'use strict';var pdf=require(_0xc71c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xc71c('0x1'));var jsonpatch=require(_0xc71c('0x2'));var rp=require(_0xc71c('0x3'));var moment=require(_0xc71c('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xc71c('0x5'));var sox=require(_0xc71c('0x6'));var csv=require(_0xc71c('0x7'));var ejs=require(_0xc71c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc71c('0x9'));var crypto=require(_0xc71c('0xa'));var jsforce=require(_0xc71c('0xb'));var deskjs=require(_0xc71c('0xc'));var toCsv=require(_0xc71c('0x7'));var querystring=require('querystring');var Papa=require(_0xc71c('0xd'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc71c('0xe'));var logger=require(_0xc71c('0xf'))(_0xc71c('0x10'));var utils=require(_0xc71c('0x11'));var config=require(_0xc71c('0x12'));var db=require(_0xc71c('0x13'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xc71c('0x14')]({'port':0x232a});function checkPasswordPattern(_0x31d11b,_0x3b5500,_0x2c2a69){if(_0x2c2a69){var _0x5cd07c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5cd07c[_0xc71c('0x15')](_0x3b5500)){return _0x31d11b;}else{throw new db['Sequelize'][(_0xc71c('0x16'))](_0xc71c('0x17'));}}else{return _0x31d11b;}}function respondWithRpcPromise(_0xd45d2d,_0x20170b,_0x3310dc,_0xa1e05c){return new BPromise(function(_0x2400c9,_0x45414f){var _0x48ee68=_0xa1e05c||client;return _0x48ee68[_0xc71c('0x18')](_0xd45d2d,_0x3310dc)[_0xc71c('0x19')](function(_0x226ee8){logger[_0xc71c('0x1a')](_0xc71c('0x1b'),_0x20170b,_0xc71c('0x1c'));logger[_0xc71c('0x1d')](_0xc71c('0x1e'),_0x20170b,_0xc71c('0x1c'),JSON[_0xc71c('0x1f')](_0x226ee8));if(_0x226ee8['error']){if(_0x226ee8['error'][_0xc71c('0x20')]===0x1f4){logger[_0xc71c('0x21')](_0xc71c('0x1b'),_0x20170b,_0x226ee8['error'][_0xc71c('0x22')]);return _0x45414f(_0x226ee8['error'][_0xc71c('0x22')]);}logger['error'](_0xc71c('0x1b'),_0x20170b,_0x226ee8[_0xc71c('0x21')][_0xc71c('0x22')]);return _0x2400c9(_0x226ee8['error'][_0xc71c('0x22')]);}else{logger[_0xc71c('0x1a')](_0xc71c('0x1b'),_0x20170b,'request\x20sent');_0x2400c9(_0x226ee8['result'][_0xc71c('0x22')]);}})[_0xc71c('0x23')](function(_0x327d29){logger[_0xc71c('0x21')](_0xc71c('0x1b'),_0x20170b,_0x327d29);_0x45414f(_0x327d29);});});}function respondWithStatusCode(_0x5129e8,_0x2fdde2){_0x2fdde2=_0x2fdde2||0xcc;return function(_0x360f0f){if(_0x360f0f){return _0x5129e8[_0xc71c('0x24')](_0x2fdde2);}return _0x5129e8['status'](_0x2fdde2)[_0xc71c('0x25')]();};}function respondWithResult(_0x493f2a,_0x3f6f55){_0x3f6f55=_0x3f6f55||0xc8;return function(_0x370370){if(_0x370370){return _0x493f2a[_0xc71c('0x26')](_0x3f6f55)[_0xc71c('0x27')](_0x370370);}};}function respondWithFilteredResult(_0x430368,_0x5b2cd7){return function(_0x1fcb69){if(_0x1fcb69){var _0x1d9d22=_0x1fcb69[_0xc71c('0x28')],_0x4dcaa6=_0x5b2cd7[_0xc71c('0x29')],_0xf7b3bd=_0x5b2cd7[_0xc71c('0x29')]+_0x5b2cd7[_0xc71c('0x2a')],_0x1d5c1c;if(_0xf7b3bd>=_0x1d9d22){_0xf7b3bd=_0x1d9d22;_0x1d5c1c=0xc8;}else{_0x1d5c1c=0xce;}_0x430368[_0xc71c('0x26')](_0x1d5c1c);return _0x430368[_0xc71c('0x2b')](_0xc71c('0x2c'),_0x4dcaa6+'-'+_0xf7b3bd+'/'+_0x1d9d22)[_0xc71c('0x27')](_0x1fcb69);}return null;};}function patchUpdates(_0x4e41ba){return function(_0x40b6c1){try{jsonpatch['apply'](_0x40b6c1,_0x4e41ba,!![]);}catch(_0x267ad9){return BPromise['reject'](_0x267ad9);}return _0x40b6c1[_0xc71c('0x2d')]();};}function saveUpdates(_0x3b6d71,_0x452b61){return function(_0x328252){if(_0x328252){return _0x328252[_0xc71c('0x2e')](_0x3b6d71)[_0xc71c('0x19')](function(_0xf45691){return _0xf45691;});}return null;};}function removeEntity(_0x47fb9c,_0x7a7e2d){return function(_0x5c8f7a){if(_0x5c8f7a){return _0x5c8f7a[_0xc71c('0x2f')]()[_0xc71c('0x19')](function(){_0x47fb9c[_0xc71c('0x26')](0xcc)[_0xc71c('0x25')]();});}};}function handleEntityNotFound(_0x3cc0b1,_0x1943ba){return function(_0x5356c3){if(!_0x5356c3){_0x3cc0b1[_0xc71c('0x24')](0x194);}return _0x5356c3;};}function handleError(_0x197a97,_0x5daaee){_0x5daaee=_0x5daaee||0x1f4;return function(_0x158993){logger[_0xc71c('0x21')](_0x158993['stack']);if(_0x158993[_0xc71c('0x30')]){delete _0x158993['name'];}_0x197a97['status'](_0x5daaee)[_0xc71c('0x31')](_0x158993);};}exports[_0xc71c('0x32')]=function(_0x599540,_0x3d29e2){var _0x424340={},_0x4e9ba3={},_0x5b347d={'count':0x0,'rows':[]};var _0x2134a8=_[_0xc71c('0x33')](db[_0xc71c('0x34')]['rawAttributes'],function(_0x4b09a3){return{'name':_0x4b09a3['fieldName'],'type':_0x4b09a3[_0xc71c('0x35')][_0xc71c('0x36')]};});_0x4e9ba3[_0xc71c('0x37')]=_[_0xc71c('0x33')](_0x2134a8,'name');_0x4e9ba3[_0xc71c('0x38')]=_[_0xc71c('0x39')](_0x599540['query']);_0x4e9ba3[_0xc71c('0x3a')]=_[_0xc71c('0x3b')](_0x4e9ba3[_0xc71c('0x37')],_0x4e9ba3[_0xc71c('0x38')]);_0x424340[_0xc71c('0x3c')]=_[_0xc71c('0x3b')](_0x4e9ba3[_0xc71c('0x37')],qs['fields'](_0x599540['query']['fields']));_0x424340[_0xc71c('0x3c')]=_0x424340['attributes'][_0xc71c('0x3d')]?_0x424340[_0xc71c('0x3c')]:_0x4e9ba3['model'];if(!_0x599540['query']['hasOwnProperty'](_0xc71c('0x3e'))){_0x424340[_0xc71c('0x2a')]=qs[_0xc71c('0x2a')](_0x599540[_0xc71c('0x38')][_0xc71c('0x2a')]);_0x424340[_0xc71c('0x29')]=qs[_0xc71c('0x29')](_0x599540[_0xc71c('0x38')]['offset']);}_0x424340[_0xc71c('0x3f')]=qs[_0xc71c('0x40')](_0x599540[_0xc71c('0x38')][_0xc71c('0x40')]);_0x424340[_0xc71c('0x41')]=qs[_0xc71c('0x3a')](_[_0xc71c('0x42')](_0x599540[_0xc71c('0x38')],_0x4e9ba3['filters']));if(_0x599540[_0xc71c('0x38')]['filter']){_0x424340['where']=_[_0xc71c('0x43')](_0x424340[_0xc71c('0x41')],{'$or':_[_0xc71c('0x33')](_0x2134a8,function(_0xc7d423){if(_0xc7d423['type']!==_0xc71c('0x44')){var _0xf25a55={};_0xf25a55[_0xc7d423[_0xc71c('0x30')]]={'$like':'%'+_0x599540[_0xc71c('0x38')][_0xc71c('0x45')]+'%'};return _0xf25a55;}})});}_0x424340=_[_0xc71c('0x43')]({},_0x424340,_0x599540['options']);var _0x1a4bee={'where':_0x424340[_0xc71c('0x41')]};return db['Network'][_0xc71c('0x28')](_0x1a4bee)[_0xc71c('0x19')](function(_0x3fe5aa){_0x5b347d['count']=_0x3fe5aa;if(_0x599540['query'][_0xc71c('0x46')]){_0x424340[_0xc71c('0x47')]=[{'all':!![]}];}return db[_0xc71c('0x34')]['findAll'](_0x424340);})[_0xc71c('0x19')](function(_0x42fae0){_0x5b347d['rows']=_0x42fae0;return _0x5b347d;})[_0xc71c('0x19')](respondWithFilteredResult(_0x3d29e2,_0x424340))[_0xc71c('0x23')](handleError(_0x3d29e2,null));};exports['show']=function(_0xc28743,_0x9ce67b){var _0x18aacd={'raw':!![],'where':{'id':_0xc28743[_0xc71c('0x48')]['id']}},_0x161989={};_0x161989[_0xc71c('0x37')]=_[_0xc71c('0x39')](db[_0xc71c('0x34')][_0xc71c('0x49')]);_0x161989[_0xc71c('0x38')]=_['keys'](_0xc28743[_0xc71c('0x38')]);_0x161989['filters']=_['intersection'](_0x161989[_0xc71c('0x37')],_0x161989[_0xc71c('0x38')]);_0x18aacd[_0xc71c('0x3c')]=_['intersection'](_0x161989[_0xc71c('0x37')],qs['fields'](_0xc28743[_0xc71c('0x38')][_0xc71c('0x4a')]));_0x18aacd[_0xc71c('0x3c')]=_0x18aacd[_0xc71c('0x3c')][_0xc71c('0x3d')]?_0x18aacd[_0xc71c('0x3c')]:_0x161989['model'];if(_0xc28743['query'][_0xc71c('0x46')]){_0x18aacd['include']=[{'all':!![]}];}_0x18aacd=_[_0xc71c('0x43')]({},_0x18aacd,_0xc28743[_0xc71c('0x4b')]);return db[_0xc71c('0x34')][_0xc71c('0x4c')](_0x18aacd)[_0xc71c('0x19')](handleEntityNotFound(_0x9ce67b,null))['then'](respondWithResult(_0x9ce67b,null))[_0xc71c('0x23')](handleError(_0x9ce67b,null));};exports[_0xc71c('0x4d')]=function(_0x2bdd8a,_0x20bb2c,_0x32a57b){var _0x464f51;return db[_0xc71c('0x4e')]['transaction'](function(_0x48fdbf){return db['Network'][_0xc71c('0x4d')](_0x2bdd8a[_0xc71c('0x4f')],{'raw':!![]})[_0xc71c('0x19')](function(_0x3fea1c){_0x464f51=_0x3fea1c;return db['Network'][_0xc71c('0x50')]({'where':{'type':_0x2bdd8a[_0xc71c('0x4f')][_0xc71c('0x35')]},'raw':!![]});})[_0xc71c('0x19')](function(_0x5915d3){if(_0x464f51[_0xc71c('0x35')][_0xc71c('0x51')]()==_0xc71c('0x52')){var _0x2b1d2b=fs[_0xc71c('0x53')](path[_0xc71c('0x54')](config[_0xc71c('0x55')],_0xc71c('0x56')),_0xc71c('0x57'));var _0x2d7fac=ejs[_0xc71c('0x58')](_0x2b1d2b,{'networks':_0x5915d3||[]});fs[_0xc71c('0x59')](_0xc71c('0x5a'),_0x2d7fac);return respondWithRpcPromise(_0xc71c('0x5b'),_0xc71c('0x4d'),{'module':_0xc71c('0x5c')});}else if(_0x464f51[_0xc71c('0x35')][_0xc71c('0x51')]()=='TURN'){var _0x5322f9=fs['readFileSync'](path[_0xc71c('0x54')](config[_0xc71c('0x55')],_0xc71c('0x5d')),'utf8');var _0x90e82c=ejs['render'](_0x5322f9,{'networks':_0x5915d3||[]});fs[_0xc71c('0x59')](_0xc71c('0x5e'),_0x90e82c);return respondWithRpcPromise('Reload',_0xc71c('0x4d'),{'module':_0xc71c('0x5c')});}else{var _0x5818ff=fs[_0xc71c('0x53')](path[_0xc71c('0x54')](config[_0xc71c('0x55')],_0xc71c('0x5f')),_0xc71c('0x57'));var _0xab2bb7=ejs[_0xc71c('0x58')](_0x5818ff,{'networks':_0x5915d3||[]});fs[_0xc71c('0x59')](util[_0xc71c('0x60')]('/etc/asterisk/sip_xcally_%s.conf',_0x2bdd8a['body'][_0xc71c('0x35')]['toLowerCase']()),_0xab2bb7);return respondWithRpcPromise(_0xc71c('0x5b'),_0xc71c('0x4d'),{'module':'chan_sip.so'});}return null;})[_0xc71c('0x19')](function(){return _0x464f51;});})[_0xc71c('0x19')](respondWithResult(_0x20bb2c,0xc9))[_0xc71c('0x23')](handleError(_0x20bb2c,null));};exports[_0xc71c('0x2e')]=function(_0x1f12fe,_0x33a571,_0x87f881){var _0x262658;return db[_0xc71c('0x4e')][_0xc71c('0x61')](function(_0x452b87){return db[_0xc71c('0x34')]['find']({'where':{'id':_0x1f12fe[_0xc71c('0x48')]['id']}})['then'](handleEntityNotFound(_0x33a571,null))[_0xc71c('0x19')](saveUpdates(_0x1f12fe[_0xc71c('0x4f')],null))[_0xc71c('0x19')](function(_0x3e83f3){if(_0x3e83f3){_0x262658=_0x3e83f3;return db[_0xc71c('0x34')][_0xc71c('0x50')]({'where':{'type':_0x262658['type']},'raw':!![]});}return null;})[_0xc71c('0x19')](function(_0x4fcb1a){if(_0x262658[_0xc71c('0x35')][_0xc71c('0x51')]()==_0xc71c('0x52')){var _0x59d9b7=fs['readFileSync'](path['join'](config[_0xc71c('0x55')],'server/files/templates/stun_multiple.ejs'),_0xc71c('0x57'));var _0x5d44db=ejs['render'](_0x59d9b7,{'networks':_0x4fcb1a||[]});fs['writeFileSync'](_0xc71c('0x5a'),_0x5d44db);return respondWithRpcPromise('Reload',_0xc71c('0x2e'),{'module':_0xc71c('0x5c')});}else if(_0x262658['type'][_0xc71c('0x51')]()==_0xc71c('0x62')){var _0x370e85=fs[_0xc71c('0x53')](path[_0xc71c('0x54')](config[_0xc71c('0x55')],_0xc71c('0x5d')),_0xc71c('0x57'));var _0x2658fb=ejs[_0xc71c('0x58')](_0x370e85,{'networks':_0x4fcb1a||[]});fs[_0xc71c('0x59')](_0xc71c('0x5e'),_0x2658fb);return respondWithRpcPromise(_0xc71c('0x5b'),_0xc71c('0x2e'),{'module':_0xc71c('0x5c')});}else{var _0x587131=fs[_0xc71c('0x53')](path['join'](config[_0xc71c('0x55')],_0xc71c('0x5f')),_0xc71c('0x57'));var _0x511624=ejs[_0xc71c('0x58')](_0x587131,{'networks':_0x4fcb1a||[]});fs[_0xc71c('0x59')](util[_0xc71c('0x60')](_0xc71c('0x63'),_0x1f12fe[_0xc71c('0x4f')][_0xc71c('0x35')][_0xc71c('0x64')]()),_0x511624);return respondWithRpcPromise('Reload',_0xc71c('0x2e'),{'module':'chan_sip.so'});}return null;})[_0xc71c('0x19')](function(_0x3b95c7){if(_0x3b95c7){return _0x262658;}return null;});})[_0xc71c('0x19')](respondWithResult(_0x33a571,null))['catch'](handleError(_0x33a571,null));};exports['destroy']=function(_0x63625,_0x5e2be2,_0x434c54){var _0x568713;return db[_0xc71c('0x34')]['find']({'where':{'id':_0x63625[_0xc71c('0x48')]['id']}})[_0xc71c('0x19')](function(_0x253616){_0x568713=_0x253616;return _0x253616;})[_0xc71c('0x19')](handleEntityNotFound(_0x5e2be2,null))[_0xc71c('0x19')](removeEntity(_0x5e2be2,null))[_0xc71c('0x19')](function(){if(_0x568713){return db[_0xc71c('0x34')][_0xc71c('0x50')]({'where':{'type':_0x568713[_0xc71c('0x35')]},'raw':!![]});}})[_0xc71c('0x19')](function(_0x5f3912){if(_0x568713['type'][_0xc71c('0x51')]()==_0xc71c('0x52')){var _0x536de5=fs['readFileSync'](path[_0xc71c('0x54')](config[_0xc71c('0x55')],_0xc71c('0x56')),_0xc71c('0x57'));var _0x19ba61=ejs[_0xc71c('0x58')](_0x536de5,{'networks':_0x5f3912||[]});fs[_0xc71c('0x59')](_0xc71c('0x5a'),_0x19ba61);return respondWithRpcPromise(_0xc71c('0x5b'),_0xc71c('0x2f'),{'module':_0xc71c('0x5c')});}else if(_0x568713['type'][_0xc71c('0x51')]()==_0xc71c('0x62')){var _0x29488f=fs['readFileSync'](path[_0xc71c('0x54')](config[_0xc71c('0x55')],'server/files/templates/turn_multiple.ejs'),_0xc71c('0x57'));var _0x1076f8=ejs['render'](_0x29488f,{'networks':_0x5f3912||[]});fs[_0xc71c('0x59')](_0xc71c('0x5e'),_0x1076f8);return respondWithRpcPromise('Reload',_0xc71c('0x2f'),{'module':_0xc71c('0x5c')});}else{var _0x2e1d49=fs[_0xc71c('0x53')](path[_0xc71c('0x54')](config[_0xc71c('0x55')],'server/files/templates/network.ejs'),_0xc71c('0x57'));var _0x3e5e40=ejs['render'](_0x2e1d49,{'networks':_0x5f3912||[]});fs[_0xc71c('0x59')](util[_0xc71c('0x60')](_0xc71c('0x63'),_0x63625[_0xc71c('0x4f')][_0xc71c('0x35')][_0xc71c('0x64')]()),_0x3e5e40);return respondWithRpcPromise(_0xc71c('0x5b'),_0xc71c('0x2f'),{'module':_0xc71c('0x65')});}return null;})['catch'](handleError(_0x5e2be2,null));}; \ No newline at end of file +var _0x3e79=['options','find','transaction','create','body','toUpperCase','join','root','server/files/templates/stun_multiple.ejs','utf8','render','writeFileSync','/etc/asterisk/stun_xcally.conf','Reload','TURN','readFileSync','/etc/asterisk/turn_xcally.conf','server/files/templates/network.ejs','chan_sip.so','STUN','res_stun_monitor.so','format','toLowerCase','params','server/files/templates/turn_multiple.ejs','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','then','info','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','map','Network','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','show','length'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x3e79,0x154));var _0x93e7=function(_0x1d30a3,_0x5f428c){_0x1d30a3=_0x1d30a3-0x0;var _0x32bba1=_0x3e79[_0x1d30a3];return _0x32bba1;};'use strict';var pdf=require(_0x93e7('0x0'));var emlformat=require(_0x93e7('0x1'));var rimraf=require(_0x93e7('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x93e7('0x3'));var rp=require(_0x93e7('0x4'));var moment=require(_0x93e7('0x5'));var BPromise=require(_0x93e7('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x93e7('0x7'));var sox=require(_0x93e7('0x8'));var csv=require(_0x93e7('0x9'));var ejs=require(_0x93e7('0xa'));var fs=require('fs');var _=require(_0x93e7('0xb'));var squel=require('squel');var crypto=require(_0x93e7('0xc'));var jsforce=require(_0x93e7('0xd'));var deskjs=require(_0x93e7('0xe'));var toCsv=require(_0x93e7('0x9'));var querystring=require('querystring');var Papa=require(_0x93e7('0xf'));var Redis=require('ioredis');var authService=require(_0x93e7('0x10'));var qs=require(_0x93e7('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x93e7('0x12'));var logger=require('../../config/logger')('api');var utils=require(_0x93e7('0x13'));var config=require(_0x93e7('0x14'));var db=require(_0x93e7('0x15'))['db'];var jayson=require(_0x93e7('0x16'));var client=jayson[_0x93e7('0x17')][_0x93e7('0x18')]({'port':0x232a});function checkPasswordPattern(_0x5dc018,_0x4c56de,_0x8709a4){if(_0x8709a4){var _0x2cfec8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cfec8['test'](_0x4c56de)){return _0x5dc018;}else{throw new db[(_0x93e7('0x19'))][(_0x93e7('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5dc018;}}function respondWithRpcPromise(_0x262075,_0x5a64ed,_0x5ef664,_0x3863fc){return new BPromise(function(_0xbe01be,_0x462bcc){var _0x592227=_0x3863fc||client;return _0x592227['request'](_0x262075,_0x5ef664)[_0x93e7('0x1b')](function(_0x2e4488){logger[_0x93e7('0x1c')](_0x93e7('0x1d'),_0x5a64ed,_0x93e7('0x1e'));logger[_0x93e7('0x1f')](_0x93e7('0x20'),_0x5a64ed,_0x93e7('0x1e'),JSON[_0x93e7('0x21')](_0x2e4488));if(_0x2e4488['error']){if(_0x2e4488[_0x93e7('0x22')][_0x93e7('0x23')]===0x1f4){logger[_0x93e7('0x22')](_0x93e7('0x1d'),_0x5a64ed,_0x2e4488[_0x93e7('0x22')]['message']);return _0x462bcc(_0x2e4488[_0x93e7('0x22')]['message']);}logger[_0x93e7('0x22')](_0x93e7('0x1d'),_0x5a64ed,_0x2e4488['error'][_0x93e7('0x24')]);return _0xbe01be(_0x2e4488[_0x93e7('0x22')][_0x93e7('0x24')]);}else{logger[_0x93e7('0x1c')]('Network,\x20%s,\x20%s',_0x5a64ed,_0x93e7('0x1e'));_0xbe01be(_0x2e4488['result'][_0x93e7('0x24')]);}})[_0x93e7('0x25')](function(_0x5781a6){logger[_0x93e7('0x22')]('Network,\x20%s,\x20%s',_0x5a64ed,_0x5781a6);_0x462bcc(_0x5781a6);});});}function respondWithStatusCode(_0x4677d7,_0x4a95cf){_0x4a95cf=_0x4a95cf||0xcc;return function(_0x4def78){if(_0x4def78){return _0x4677d7[_0x93e7('0x26')](_0x4a95cf);}return _0x4677d7[_0x93e7('0x27')](_0x4a95cf)['end']();};}function respondWithResult(_0x49b6f3,_0x26a742){_0x26a742=_0x26a742||0xc8;return function(_0x17fc8b){if(_0x17fc8b){return _0x49b6f3[_0x93e7('0x27')](_0x26a742)[_0x93e7('0x28')](_0x17fc8b);}};}function respondWithFilteredResult(_0x445428,_0x51dd71){return function(_0x3c53ac){if(_0x3c53ac){var _0x194f30=_0x3c53ac[_0x93e7('0x29')],_0x2e81d4=_0x51dd71[_0x93e7('0x2a')],_0x2b7f3d=_0x51dd71[_0x93e7('0x2a')]+_0x51dd71[_0x93e7('0x2b')],_0x3f0e2d;if(_0x2b7f3d>=_0x194f30){_0x2b7f3d=_0x194f30;_0x3f0e2d=0xc8;}else{_0x3f0e2d=0xce;}_0x445428[_0x93e7('0x27')](_0x3f0e2d);return _0x445428[_0x93e7('0x2c')](_0x93e7('0x2d'),_0x2e81d4+'-'+_0x2b7f3d+'/'+_0x194f30)['json'](_0x3c53ac);}return null;};}function patchUpdates(_0x469682){return function(_0x2bb415){try{jsonpatch[_0x93e7('0x2e')](_0x2bb415,_0x469682,!![]);}catch(_0x5a5a87){return BPromise[_0x93e7('0x2f')](_0x5a5a87);}return _0x2bb415[_0x93e7('0x30')]();};}function saveUpdates(_0x425470,_0x44d6d6){return function(_0x102529){if(_0x102529){return _0x102529[_0x93e7('0x31')](_0x425470)['then'](function(_0x36c7dd){return _0x36c7dd;});}return null;};}function removeEntity(_0x1e7811,_0x404f7d){return function(_0xaaade0){if(_0xaaade0){return _0xaaade0[_0x93e7('0x32')]()[_0x93e7('0x1b')](function(){_0x1e7811['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x54375a,_0x534845){return function(_0x52bca2){if(!_0x52bca2){_0x54375a[_0x93e7('0x26')](0x194);}return _0x52bca2;};}function handleError(_0x2b8a10,_0x4e2cd7){_0x4e2cd7=_0x4e2cd7||0x1f4;return function(_0x300ec3){logger['error'](_0x300ec3[_0x93e7('0x33')]);if(_0x300ec3[_0x93e7('0x34')]){delete _0x300ec3['name'];}_0x2b8a10['status'](_0x4e2cd7)[_0x93e7('0x35')](_0x300ec3);};}exports['index']=function(_0x4d6801,_0x1ffba5){var _0x1bb800={},_0x57a923={},_0x35da81={'count':0x0,'rows':[]};var _0x280b50=_[_0x93e7('0x36')](db[_0x93e7('0x37')]['rawAttributes'],function(_0x58d7be){return{'name':_0x58d7be[_0x93e7('0x38')],'type':_0x58d7be[_0x93e7('0x39')][_0x93e7('0x3a')]};});_0x57a923['model']=_['map'](_0x280b50,_0x93e7('0x34'));_0x57a923[_0x93e7('0x3b')]=_[_0x93e7('0x3c')](_0x4d6801[_0x93e7('0x3b')]);_0x57a923[_0x93e7('0x3d')]=_['intersection'](_0x57a923['model'],_0x57a923[_0x93e7('0x3b')]);_0x1bb800['attributes']=_[_0x93e7('0x3e')](_0x57a923[_0x93e7('0x3f')],qs[_0x93e7('0x40')](_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x40')]));_0x1bb800[_0x93e7('0x41')]=_0x1bb800[_0x93e7('0x41')]['length']?_0x1bb800[_0x93e7('0x41')]:_0x57a923[_0x93e7('0x3f')];if(!_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x42')](_0x93e7('0x43'))){_0x1bb800['limit']=qs[_0x93e7('0x2b')](_0x4d6801[_0x93e7('0x3b')]['limit']);_0x1bb800[_0x93e7('0x2a')]=qs[_0x93e7('0x2a')](_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x2a')]);}_0x1bb800[_0x93e7('0x44')]=qs[_0x93e7('0x45')](_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x45')]);_0x1bb800['where']=qs[_0x93e7('0x3d')](_[_0x93e7('0x46')](_0x4d6801[_0x93e7('0x3b')],_0x57a923[_0x93e7('0x3d')]));if(_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x47')]){_0x1bb800[_0x93e7('0x48')]=_[_0x93e7('0x49')](_0x1bb800[_0x93e7('0x48')],{'$or':_['map'](_0x280b50,function(_0x56d63e){if(_0x56d63e[_0x93e7('0x39')]!==_0x93e7('0x4a')){var _0x79c036={};_0x79c036[_0x56d63e[_0x93e7('0x34')]]={'$like':'%'+_0x4d6801['query'][_0x93e7('0x47')]+'%'};return _0x79c036;}})});}_0x1bb800=_[_0x93e7('0x49')]({},_0x1bb800,_0x4d6801['options']);var _0x6ced5f={'where':_0x1bb800['where']};return db[_0x93e7('0x37')][_0x93e7('0x29')](_0x6ced5f)[_0x93e7('0x1b')](function(_0x1137a7){_0x35da81[_0x93e7('0x29')]=_0x1137a7;if(_0x4d6801[_0x93e7('0x3b')][_0x93e7('0x4b')]){_0x1bb800[_0x93e7('0x4c')]=[{'all':!![]}];}return db[_0x93e7('0x37')][_0x93e7('0x4d')](_0x1bb800);})['then'](function(_0x47d59a){_0x35da81['rows']=_0x47d59a;return _0x35da81;})[_0x93e7('0x1b')](respondWithFilteredResult(_0x1ffba5,_0x1bb800))[_0x93e7('0x25')](handleError(_0x1ffba5,null));};exports[_0x93e7('0x4e')]=function(_0x4b958f,_0x549115){var _0x1c6ae4={'raw':!![],'where':{'id':_0x4b958f['params']['id']}},_0x137d18={};_0x137d18[_0x93e7('0x3f')]=_['keys'](db['Network']['rawAttributes']);_0x137d18[_0x93e7('0x3b')]=_[_0x93e7('0x3c')](_0x4b958f[_0x93e7('0x3b')]);_0x137d18[_0x93e7('0x3d')]=_[_0x93e7('0x3e')](_0x137d18[_0x93e7('0x3f')],_0x137d18['query']);_0x1c6ae4[_0x93e7('0x41')]=_['intersection'](_0x137d18[_0x93e7('0x3f')],qs[_0x93e7('0x40')](_0x4b958f[_0x93e7('0x3b')]['fields']));_0x1c6ae4['attributes']=_0x1c6ae4['attributes'][_0x93e7('0x4f')]?_0x1c6ae4['attributes']:_0x137d18[_0x93e7('0x3f')];if(_0x4b958f['query'][_0x93e7('0x4b')]){_0x1c6ae4['include']=[{'all':!![]}];}_0x1c6ae4=_[_0x93e7('0x49')]({},_0x1c6ae4,_0x4b958f[_0x93e7('0x50')]);return db[_0x93e7('0x37')][_0x93e7('0x51')](_0x1c6ae4)[_0x93e7('0x1b')](handleEntityNotFound(_0x549115,null))[_0x93e7('0x1b')](respondWithResult(_0x549115,null))['catch'](handleError(_0x549115,null));};exports['create']=function(_0x446b7c,_0x358f79,_0xaac622){var _0x4f68c0;return db['sequelize'][_0x93e7('0x52')](function(_0x9bce02){return db['Network'][_0x93e7('0x53')](_0x446b7c[_0x93e7('0x54')],{'raw':!![]})[_0x93e7('0x1b')](function(_0x3f62b5){_0x4f68c0=_0x3f62b5;return db[_0x93e7('0x37')][_0x93e7('0x4d')]({'where':{'type':_0x446b7c[_0x93e7('0x54')][_0x93e7('0x39')]},'raw':!![]});})[_0x93e7('0x1b')](function(_0x1e3a79){if(_0x4f68c0[_0x93e7('0x39')][_0x93e7('0x55')]()=='STUN'){var _0xfeb560=fs['readFileSync'](path[_0x93e7('0x56')](config[_0x93e7('0x57')],_0x93e7('0x58')),_0x93e7('0x59'));var _0x40b8b1=ejs[_0x93e7('0x5a')](_0xfeb560,{'networks':_0x1e3a79||[]});fs[_0x93e7('0x5b')](_0x93e7('0x5c'),_0x40b8b1);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x53'),{'module':'res_stun_monitor.so'});}else if(_0x4f68c0[_0x93e7('0x39')][_0x93e7('0x55')]()==_0x93e7('0x5e')){var _0x56f35a=fs[_0x93e7('0x5f')](path[_0x93e7('0x56')](config[_0x93e7('0x57')],'server/files/templates/turn_multiple.ejs'),_0x93e7('0x59'));var _0x406575=ejs[_0x93e7('0x5a')](_0x56f35a,{'networks':_0x1e3a79||[]});fs['writeFileSync'](_0x93e7('0x60'),_0x406575);return respondWithRpcPromise(_0x93e7('0x5d'),'create',{'module':'res_stun_monitor.so'});}else{var _0x82b2bf=fs[_0x93e7('0x5f')](path[_0x93e7('0x56')](config['root'],_0x93e7('0x61')),_0x93e7('0x59'));var _0x58b0f6=ejs['render'](_0x82b2bf,{'networks':_0x1e3a79||[]});fs[_0x93e7('0x5b')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x446b7c['body'][_0x93e7('0x39')]['toLowerCase']()),_0x58b0f6);return respondWithRpcPromise(_0x93e7('0x5d'),'create',{'module':_0x93e7('0x62')});}return null;})[_0x93e7('0x1b')](function(){return _0x4f68c0;});})['then'](respondWithResult(_0x358f79,0xc9))['catch'](handleError(_0x358f79,null));};exports[_0x93e7('0x31')]=function(_0x3c7911,_0x2090b6,_0x47a7dc){var _0x3e4279;return db['sequelize'][_0x93e7('0x52')](function(_0x194740){return db[_0x93e7('0x37')]['find']({'where':{'id':_0x3c7911['params']['id']}})[_0x93e7('0x1b')](handleEntityNotFound(_0x2090b6,null))[_0x93e7('0x1b')](saveUpdates(_0x3c7911['body'],null))[_0x93e7('0x1b')](function(_0x19e145){if(_0x19e145){_0x3e4279=_0x19e145;return db[_0x93e7('0x37')][_0x93e7('0x4d')]({'where':{'type':_0x3e4279[_0x93e7('0x39')]},'raw':!![]});}return null;})[_0x93e7('0x1b')](function(_0xdbdb6c){if(_0x3e4279[_0x93e7('0x39')][_0x93e7('0x55')]()==_0x93e7('0x63')){var _0x148505=fs[_0x93e7('0x5f')](path[_0x93e7('0x56')](config['root'],'server/files/templates/stun_multiple.ejs'),_0x93e7('0x59'));var _0x2a293d=ejs[_0x93e7('0x5a')](_0x148505,{'networks':_0xdbdb6c||[]});fs[_0x93e7('0x5b')](_0x93e7('0x5c'),_0x2a293d);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x31'),{'module':'res_stun_monitor.so'});}else if(_0x3e4279[_0x93e7('0x39')]['toUpperCase']()==_0x93e7('0x5e')){var _0xa44c8b=fs[_0x93e7('0x5f')](path['join'](config[_0x93e7('0x57')],'server/files/templates/turn_multiple.ejs'),_0x93e7('0x59'));var _0x586c1d=ejs['render'](_0xa44c8b,{'networks':_0xdbdb6c||[]});fs[_0x93e7('0x5b')](_0x93e7('0x60'),_0x586c1d);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x31'),{'module':_0x93e7('0x64')});}else{var _0x32404c=fs['readFileSync'](path[_0x93e7('0x56')](config[_0x93e7('0x57')],_0x93e7('0x61')),_0x93e7('0x59'));var _0x33d505=ejs[_0x93e7('0x5a')](_0x32404c,{'networks':_0xdbdb6c||[]});fs[_0x93e7('0x5b')](util[_0x93e7('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x3c7911[_0x93e7('0x54')][_0x93e7('0x39')][_0x93e7('0x66')]()),_0x33d505);return respondWithRpcPromise('Reload',_0x93e7('0x31'),{'module':_0x93e7('0x62')});}return null;})['then'](function(_0x1b8990){if(_0x1b8990){return _0x3e4279;}return null;});})[_0x93e7('0x1b')](respondWithResult(_0x2090b6,null))[_0x93e7('0x25')](handleError(_0x2090b6,null));};exports[_0x93e7('0x32')]=function(_0x39b3f4,_0x55085b,_0x442141){var _0x313bb8;return db['Network'][_0x93e7('0x51')]({'where':{'id':_0x39b3f4[_0x93e7('0x67')]['id']}})['then'](function(_0xe4df95){_0x313bb8=_0xe4df95;return _0xe4df95;})['then'](handleEntityNotFound(_0x55085b,null))[_0x93e7('0x1b')](removeEntity(_0x55085b,null))['then'](function(){if(_0x313bb8){return db['Network']['findAll']({'where':{'type':_0x313bb8[_0x93e7('0x39')]},'raw':!![]});}})['then'](function(_0x3805b3){if(_0x313bb8[_0x93e7('0x39')][_0x93e7('0x55')]()==_0x93e7('0x63')){var _0x1f6dd7=fs[_0x93e7('0x5f')](path['join'](config['root'],'server/files/templates/stun_multiple.ejs'),_0x93e7('0x59'));var _0x44eb8b=ejs[_0x93e7('0x5a')](_0x1f6dd7,{'networks':_0x3805b3||[]});fs[_0x93e7('0x5b')](_0x93e7('0x5c'),_0x44eb8b);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x32'),{'module':_0x93e7('0x64')});}else if(_0x313bb8['type'][_0x93e7('0x55')]()==_0x93e7('0x5e')){var _0x7b38e=fs[_0x93e7('0x5f')](path[_0x93e7('0x56')](config[_0x93e7('0x57')],_0x93e7('0x68')),_0x93e7('0x59'));var _0x355673=ejs[_0x93e7('0x5a')](_0x7b38e,{'networks':_0x3805b3||[]});fs[_0x93e7('0x5b')]('/etc/asterisk/turn_xcally.conf',_0x355673);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x32'),{'module':'res_stun_monitor.so'});}else{var _0x38c45a=fs['readFileSync'](path[_0x93e7('0x56')](config['root'],_0x93e7('0x61')),_0x93e7('0x59'));var _0x1a117=ejs[_0x93e7('0x5a')](_0x38c45a,{'networks':_0x3805b3||[]});fs['writeFileSync'](util[_0x93e7('0x65')]('/etc/asterisk/sip_xcally_%s.conf',_0x39b3f4['body']['type'][_0x93e7('0x66')]()),_0x1a117);return respondWithRpcPromise(_0x93e7('0x5d'),_0x93e7('0x32'),{'module':_0x93e7('0x62')});}return null;})[_0x93e7('0x25')](handleError(_0x55085b,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index f86da36..e38d896 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 _0xb288=['util','moment','bluebird','request-promise','rimraf','./network.attributes','exports','define','Network','network'];(function(_0x5a2b19,_0x10269f){var _0x4cde0d=function(_0x132309){while(--_0x132309){_0x5a2b19['push'](_0x5a2b19['shift']());}};_0x4cde0d(++_0x10269f);}(_0xb288,0x186));var _0x8b28=function(_0x55934d,_0x2ddbed){_0x55934d=_0x55934d-0x0;var _0x2da632=_0xb288[_0x55934d];return _0x2da632;};'use strict';var _=require('lodash');var util=require(_0x8b28('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x8b28('0x1'));var BPromise=require(_0x8b28('0x2'));var rp=require(_0x8b28('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b28('0x4'));var config=require('../../config/environment');var attributes=require(_0x8b28('0x5'));module[_0x8b28('0x6')]=function(_0x4e109d,_0x2a32b4){return _0x4e109d[_0x8b28('0x7')](_0x8b28('0x8'),attributes,{'tableName':_0x8b28('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xc003=['path','rimraf','./network.attributes','exports','define','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0xa13796,_0x13a62f){var _0x592290=function(_0x157cce){while(--_0x157cce){_0xa13796['push'](_0xa13796['shift']());}};_0x592290(++_0x13a62f);}(_0xc003,0xb5));var _0x3c00=function(_0x377dd0,_0x3da2b6){_0x377dd0=_0x377dd0-0x0;var _0x4a6d45=_0xc003[_0x377dd0];return _0x4a6d45;};'use strict';var _=require('lodash');var util=require(_0x3c00('0x0'));var logger=require(_0x3c00('0x1'))(_0x3c00('0x2'));var moment=require(_0x3c00('0x3'));var BPromise=require(_0x3c00('0x4'));var rp=require(_0x3c00('0x5'));var fs=require('fs');var path=require(_0x3c00('0x6'));var rimraf=require(_0x3c00('0x7'));var config=require('../../config/environment');var attributes=require(_0x3c00('0x8'));module[_0x3c00('0x9')]=function(_0x7cc33e,_0x6b3535){return _0x7cc33e[_0x3c00('0xa')]('Network',attributes,{'tableName':'network','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/network/network.rpc.js b/server/api/network/network.rpc.js index 00e455d..5533fa6 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 _0x5597=['jayson/promise','client','http','request','Network,\x20%s,\x20%s','request\x20sent','debug','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x4529a7,_0x33f6eb){var _0x434db1=function(_0x1dc944){while(--_0x1dc944){_0x4529a7['push'](_0x4529a7['shift']());}};_0x434db1(++_0x33f6eb);}(_0x5597,0xeb));var _0x7559=function(_0x12c2e8,_0x5c3408){_0x12c2e8=_0x12c2e8-0x0;var _0x5f0309=_0x5597[_0x12c2e8];return _0x5f0309;};'use strict';var _=require(_0x7559('0x0'));var util=require(_0x7559('0x1'));var moment=require(_0x7559('0x2'));var BPromise=require('bluebird');var rs=require(_0x7559('0x3'));var fs=require('fs');var Redis=require(_0x7559('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7559('0x5'));var logger=require(_0x7559('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x7559('0x7'));var client=jayson[_0x7559('0x8')][_0x7559('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x394e6c,_0x19437d,_0x68651){return new BPromise(function(_0x50f8b1,_0x14e7c0){return client[_0x7559('0xa')](_0x394e6c,_0x68651)['then'](function(_0x4967fd){logger['info'](_0x7559('0xb'),_0x19437d,_0x7559('0xc'));logger[_0x7559('0xd')](_0x7559('0xe'),_0x19437d,_0x7559('0xc'),JSON[_0x7559('0xf')](_0x4967fd));if(_0x4967fd[_0x7559('0x10')]){if(_0x4967fd[_0x7559('0x10')][_0x7559('0x11')]===0x1f4){logger['error'](_0x7559('0xb'),_0x19437d,_0x4967fd[_0x7559('0x10')][_0x7559('0x12')]);return _0x14e7c0(_0x4967fd['error'][_0x7559('0x12')]);}logger[_0x7559('0x10')](_0x7559('0xb'),_0x19437d,_0x4967fd['error'][_0x7559('0x12')]);return _0x50f8b1(_0x4967fd['error']['message']);}else{logger[_0x7559('0x13')](_0x7559('0xb'),_0x19437d,'request\x20sent');_0x50f8b1(_0x4967fd[_0x7559('0x14')][_0x7559('0x12')]);}})[_0x7559('0x15')](function(_0x33f43c){logger['error']('Network,\x20%s,\x20%s',_0x19437d,_0x33f43c);_0x14e7c0(_0x33f43c);});});} \ No newline at end of file +var _0x6f9d=['Network,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Network,\x20%s,\x20%s','request\x20sent','debug'];(function(_0xc76630,_0x3b6c9f){var _0x36020e=function(_0x1fa321){while(--_0x1fa321){_0xc76630['push'](_0xc76630['shift']());}};_0x36020e(++_0x3b6c9f);}(_0x6f9d,0x127));var _0xd6f9=function(_0x54aff6,_0xc4c096){_0x54aff6=_0x54aff6-0x0;var _0x487a36=_0x6f9d[_0x54aff6];return _0x487a36;};'use strict';var _=require(_0xd6f9('0x0'));var util=require(_0xd6f9('0x1'));var moment=require(_0xd6f9('0x2'));var BPromise=require('bluebird');var rs=require(_0xd6f9('0x3'));var fs=require('fs');var Redis=require(_0xd6f9('0x4'));var db=require(_0xd6f9('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xd6f9('0x6'))(_0xd6f9('0x7'));var config=require(_0xd6f9('0x8'));var jayson=require(_0xd6f9('0x9'));var client=jayson[_0xd6f9('0xa')][_0xd6f9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x24af66,_0x2b1668,_0x530769){return new BPromise(function(_0x32cb4c,_0x55568e){return client['request'](_0x24af66,_0x530769)[_0xd6f9('0xc')](function(_0x1f3ed6){logger[_0xd6f9('0xd')](_0xd6f9('0xe'),_0x2b1668,_0xd6f9('0xf'));logger[_0xd6f9('0x10')](_0xd6f9('0x11'),_0x2b1668,_0xd6f9('0xf'),JSON[_0xd6f9('0x12')](_0x1f3ed6));if(_0x1f3ed6[_0xd6f9('0x13')]){if(_0x1f3ed6[_0xd6f9('0x13')][_0xd6f9('0x14')]===0x1f4){logger[_0xd6f9('0x13')](_0xd6f9('0xe'),_0x2b1668,_0x1f3ed6[_0xd6f9('0x13')][_0xd6f9('0x15')]);return _0x55568e(_0x1f3ed6[_0xd6f9('0x13')][_0xd6f9('0x15')]);}logger[_0xd6f9('0x13')]('Network,\x20%s,\x20%s',_0x2b1668,_0x1f3ed6[_0xd6f9('0x13')][_0xd6f9('0x15')]);return _0x32cb4c(_0x1f3ed6[_0xd6f9('0x13')][_0xd6f9('0x15')]);}else{logger[_0xd6f9('0xd')]('Network,\x20%s,\x20%s',_0x2b1668,'request\x20sent');_0x32cb4c(_0x1f3ed6[_0xd6f9('0x16')]['message']);}})[_0xd6f9('0x17')](function(_0x1bff26){logger[_0xd6f9('0x13')](_0xd6f9('0xe'),_0x2b1668,_0x1bff26);_0x55568e(_0x1bff26);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index e75d889..3aef07d 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 _0xc97e=['/:id/canned_answers','/:id/applications','getApplications','/:id/interactions','getInteractions','/:id/users','getAgents','post','addDisposition','addAnswer','notify','addApplications','/:id/send','destroy','delete','removeDispositions','removeAnswers','removeAgents','multer','util','path','express','Router','../../components/auth/service','../../config/environment','isAuthenticated','describe','get','/:id','/:id/dispositions','getDispositions'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xc97e,0xeb));var _0xec97=function(_0x10c89d,_0x4366b2){_0x10c89d=_0x10c89d-0x0;var _0x38a11e=_0xc97e[_0x10c89d];return _0x38a11e;};'use strict';var multer=require(_0xec97('0x0'));var util=require(_0xec97('0x1'));var path=require(_0xec97('0x2'));var timeout=require('connect-timeout');var express=require(_0xec97('0x3'));var router=express[_0xec97('0x4')]();var auth=require(_0xec97('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xec97('0x6'));var controller=require('./openchannelAccount.controller');router['get']('/',auth[_0xec97('0x7')](),controller['index']);router['get']('/describe',auth[_0xec97('0x7')](),controller[_0xec97('0x8')]);router[_0xec97('0x9')](_0xec97('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xec97('0x9')](_0xec97('0xb'),auth['isAuthenticated'](),controller[_0xec97('0xc')]);router[_0xec97('0x9')](_0xec97('0xd'),auth[_0xec97('0x7')](),controller['getAnswers']);router['get'](_0xec97('0xe'),auth[_0xec97('0x7')](),controller[_0xec97('0xf')]);router[_0xec97('0x9')](_0xec97('0x10'),auth['isAuthenticated'](),controller[_0xec97('0x11')]);router[_0xec97('0x9')](_0xec97('0x12'),auth['isAuthenticated'](),controller[_0xec97('0x13')]);router[_0xec97('0x14')]('/',auth[_0xec97('0x7')](),controller['create']);router[_0xec97('0x14')](_0xec97('0xb'),auth[_0xec97('0x7')](),controller[_0xec97('0x15')]);router[_0xec97('0x14')](_0xec97('0xd'),auth['isAuthenticated'](),controller[_0xec97('0x16')]);router[_0xec97('0x14')]('/:id/notify',controller[_0xec97('0x17')]);router[_0xec97('0x14')](_0xec97('0xe'),auth['isAuthenticated'](),controller[_0xec97('0x18')]);router['post']('/:id/users',auth[_0xec97('0x7')](),controller['addAgents']);router[_0xec97('0x14')](_0xec97('0x19'),auth['isAuthenticated'](),controller['send']);router['put'](_0xec97('0xa'),auth[_0xec97('0x7')](),controller['update']);router['delete']('/:id',auth[_0xec97('0x7')](),controller[_0xec97('0x1a')]);router[_0xec97('0x1b')](_0xec97('0xb'),auth['isAuthenticated'](),controller[_0xec97('0x1c')]);router[_0xec97('0x1b')](_0xec97('0xd'),auth[_0xec97('0x7')](),controller[_0xec97('0x1d')]);router[_0xec97('0x1b')]('/:id/users',auth[_0xec97('0x7')](),controller[_0xec97('0x1e')]);module['exports']=router; \ No newline at end of file +var _0x7559=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','get','index','/describe','isAuthenticated','/:id','show','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','/:id/users','/:id/send','send','put','update','delete','removeDispositions','removeAnswers'];(function(_0x35f715,_0x391885){var _0x133e62=function(_0x2d3b26){while(--_0x2d3b26){_0x35f715['push'](_0x35f715['shift']());}};_0x133e62(++_0x391885);}(_0x7559,0x182));var _0x9755=function(_0x4f2c1c,_0x4b4f97){_0x4f2c1c=_0x4f2c1c-0x0;var _0x4e6069=_0x7559[_0x4f2c1c];return _0x4e6069;};'use strict';var multer=require(_0x9755('0x0'));var util=require(_0x9755('0x1'));var path=require(_0x9755('0x2'));var timeout=require(_0x9755('0x3'));var express=require(_0x9755('0x4'));var router=express[_0x9755('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9755('0x6'));var config=require('../../config/environment');var controller=require('./openchannelAccount.controller');router[_0x9755('0x7')]('/',auth['isAuthenticated'](),controller[_0x9755('0x8')]);router['get'](_0x9755('0x9'),auth[_0x9755('0xa')](),controller['describe']);router[_0x9755('0x7')](_0x9755('0xb'),auth[_0x9755('0xa')](),controller[_0x9755('0xc')]);router['get']('/:id/dispositions',auth[_0x9755('0xa')](),controller[_0x9755('0xd')]);router[_0x9755('0x7')](_0x9755('0xe'),auth[_0x9755('0xa')](),controller[_0x9755('0xf')]);router[_0x9755('0x7')](_0x9755('0x10'),auth[_0x9755('0xa')](),controller[_0x9755('0x11')]);router[_0x9755('0x7')]('/:id/interactions',auth[_0x9755('0xa')](),controller['getInteractions']);router[_0x9755('0x7')]('/:id/users',auth[_0x9755('0xa')](),controller[_0x9755('0x12')]);router[_0x9755('0x13')]('/',auth[_0x9755('0xa')](),controller[_0x9755('0x14')]);router[_0x9755('0x13')]('/:id/dispositions',auth[_0x9755('0xa')](),controller[_0x9755('0x15')]);router[_0x9755('0x13')](_0x9755('0xe'),auth[_0x9755('0xa')](),controller[_0x9755('0x16')]);router[_0x9755('0x13')](_0x9755('0x17'),controller[_0x9755('0x18')]);router['post']('/:id/applications',auth[_0x9755('0xa')](),controller[_0x9755('0x19')]);router[_0x9755('0x13')](_0x9755('0x1a'),auth[_0x9755('0xa')](),controller['addAgents']);router[_0x9755('0x13')](_0x9755('0x1b'),auth[_0x9755('0xa')](),controller[_0x9755('0x1c')]);router[_0x9755('0x1d')](_0x9755('0xb'),auth['isAuthenticated'](),controller[_0x9755('0x1e')]);router[_0x9755('0x1f')]('/:id',auth[_0x9755('0xa')](),controller['destroy']);router['delete']('/:id/dispositions',auth[_0x9755('0xa')](),controller[_0x9755('0x20')]);router[_0x9755('0x1f')](_0x9755('0xe'),auth[_0x9755('0xa')](),controller[_0x9755('0x21')]);router[_0x9755('0x1f')](_0x9755('0x1a'),auth[_0x9755('0xa')](),controller['removeAgents']);module[_0x9755('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index bad2689..2e13368 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 _0xb2a7=['STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','BOOLEAN','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x126dcb,_0x25d635){var _0x42234d=function(_0xbd41c0){while(--_0xbd41c0){_0x126dcb['push'](_0x126dcb['shift']());}};_0x42234d(++_0x25d635);}(_0xb2a7,0x1d1));var _0x7b2a=function(_0x268bae,_0x76db79){_0x268bae=_0x268bae-0x0;var _0x5a06c3=_0xb2a7[_0x268bae];return _0x5a06c3;};'use strict';var Sequelize=require(_0x7b2a('0x0'));var rs=require(_0x7b2a('0x1'));module[_0x7b2a('0x2')]={'name':{'type':Sequelize[_0x7b2a('0x3')],'unique':_0x7b2a('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x7b2a('0x3')]},'token':{'type':Sequelize[_0x7b2a('0x3')],'defaultValue':function(){return rs[_0x7b2a('0x5')]();}},'replyUri':{'type':Sequelize[_0x7b2a('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x7b2a('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x7b2a('0x6')],'defaultValue':function(){return _0x7b2a('0x7');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x7b2a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x7b2a('0x3')]},'queueTransfer':{'type':Sequelize[_0x7b2a('0x9')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7b2a('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7b2a('0x9')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7b2a('0x8')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x7b2a('0x9')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x3c8b53){if(!_0x3c8b53)this[_0x7b2a('0xa')](_0x7b2a('0xb'),null);this['setDataValue'](_0x7b2a('0xc'),_0x3c8b53);}}}; \ No newline at end of file +var _0x5709=['randomstring','exports','STRING','name','generate','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5709,0x1b1));var _0x9570=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5709[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9570('0x0'));var rs=require(_0x9570('0x1'));module[_0x9570('0x2')]={'name':{'type':Sequelize[_0x9570('0x3')],'unique':_0x9570('0x4'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0x9570('0x5')]();}},'replyUri':{'type':Sequelize[_0x9570('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x9570('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x9570('0x6');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x9570('0x7')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x9570('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x9570('0x3')]},'queueTransfer':{'type':Sequelize[_0x9570('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x9570('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x9570('0x8')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x9570('0x8')],'allowNull':!![],'defaultValue':null,'comment':_0x9570('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x9570('0x7')],'defaultValue':![],'comment':_0x9570('0xa'),'set':function(_0x324fd6){if(!_0x324fd6)this[_0x9570('0xb')](_0x9570('0xc'),null);this[_0x9570('0xb')](_0x9570('0xd'),_0x324fd6);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index ae97b06..4ef0110 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 _0x9cce=['interaction','created','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','unshift','agent','forcedOwnership','Start','startRouting','EventManager','transaction','OpenchannelApplication','bulkCreate','findAndCountAll','priority','getApplications','getInteractions','Contact','User','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','Messages','dataValues','push','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','redis','defaults','socket.io-emitter','./openchannelAccount.socket','register','jayson/promise','client','http','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','sendStatus','status','end','json','offset','set','Content-Range','reject','update','then','destroy','OpenchannelAccounts','UserProfileResource','stack','name','send','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','attributes','fields','limit','order','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','length','include','options','find','create','user','get','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','sort','pick','OpenchannelAccountId','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','nolimit','removeAnswers','notify','openchannel','CmContact','no\x20available\x20attributes','createdAt','updatedAt','difference','CompanyId','ListId','isNil','from','Sequelize','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','Contacts','Applications','account','applications','list','orderBy','asc','contact','lastName','threadId','externalUrl','OpenchannelInteraction','ContactId','firstName','messageId'];(function(_0x3ad804,_0x226036){var _0x284011=function(_0xa0d05a){while(--_0xa0d05a){_0x3ad804['push'](_0x3ad804['shift']());}};_0x284011(++_0x226036);}(_0x9cce,0xe6));var _0xe9cc=function(_0xbe2c48,_0x56f783){_0xbe2c48=_0xbe2c48-0x0;var _0x4b9e35=_0x9cce[_0xbe2c48];return _0x4b9e35;};'use strict';var pdf=require(_0xe9cc('0x0'));var emlformat=require(_0xe9cc('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe9cc('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9cc('0x3'));var Mustache=require(_0xe9cc('0x4'));var util=require(_0xe9cc('0x5'));var path=require(_0xe9cc('0x6'));var sox=require(_0xe9cc('0x7'));var csv=require(_0xe9cc('0x8'));var ejs=require(_0xe9cc('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe9cc('0xa'));var crypto=require(_0xe9cc('0xb'));var jsforce=require(_0xe9cc('0xc'));var deskjs=require(_0xe9cc('0xd'));var toCsv=require(_0xe9cc('0x8'));var querystring=require(_0xe9cc('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xe9cc('0xf'));var as=require(_0xe9cc('0x10'));var hardwareService=require(_0xe9cc('0x11'));var logger=require(_0xe9cc('0x12'))(_0xe9cc('0x13'));var utils=require(_0xe9cc('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xe9cc('0x15')]=_[_0xe9cc('0x16')](config[_0xe9cc('0x15')],{'host':'localhost','port':0x18eb});var socket=require(_0xe9cc('0x17'))(new Redis(config['redis']));require(_0xe9cc('0x18'))[_0xe9cc('0x19')](socket);var jayson=require(_0xe9cc('0x1a'));var client=jayson[_0xe9cc('0x1b')][_0xe9cc('0x1c')]({'port':0x232c});var client9002=jayson[_0xe9cc('0x1b')][_0xe9cc('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3629d2,_0x4e51d6,_0x4db46a){if(_0x4db46a){var _0x56af22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x56af22[_0xe9cc('0x1d')](_0x4e51d6)){return _0x3629d2;}else{throw new db['Sequelize'][(_0xe9cc('0x1e'))](_0xe9cc('0x1f'));}}else{return _0x3629d2;}}function respondWithRpcPromise(_0x382ebd,_0x585081,_0x583289,_0x1a9b33){return new BPromise(function(_0x1c59d5,_0x250acd){var _0x43ea60=_0x1a9b33||client;return _0x43ea60[_0xe9cc('0x20')](_0x382ebd,_0x583289)['then'](function(_0x53d572){logger[_0xe9cc('0x21')](_0xe9cc('0x22'),_0x585081,_0xe9cc('0x23'));logger[_0xe9cc('0x24')](_0xe9cc('0x25'),_0x585081,_0xe9cc('0x23'),JSON[_0xe9cc('0x26')](_0x53d572));if(_0x53d572[_0xe9cc('0x27')]){if(_0x53d572[_0xe9cc('0x27')][_0xe9cc('0x28')]===0x1f4){logger[_0xe9cc('0x27')](_0xe9cc('0x22'),_0x585081,_0x53d572[_0xe9cc('0x27')][_0xe9cc('0x29')]);return _0x250acd(_0x53d572['error'][_0xe9cc('0x29')]);}logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x585081,_0x53d572[_0xe9cc('0x27')][_0xe9cc('0x29')]);return _0x1c59d5(_0x53d572[_0xe9cc('0x27')]['message']);}else{logger[_0xe9cc('0x21')]('OpenchannelAccount,\x20%s,\x20%s',_0x585081,'request\x20sent');_0x1c59d5(_0x53d572[_0xe9cc('0x2a')][_0xe9cc('0x29')]);}})['catch'](function(_0x38e2d9){logger[_0xe9cc('0x27')](_0xe9cc('0x22'),_0x585081,_0x38e2d9);_0x250acd(_0x38e2d9);});});}function respondWithStatusCode(_0xc9300b,_0x46dd33){_0x46dd33=_0x46dd33||0xcc;return function(_0x306c4c){if(_0x306c4c){return _0xc9300b[_0xe9cc('0x2b')](_0x46dd33);}return _0xc9300b[_0xe9cc('0x2c')](_0x46dd33)[_0xe9cc('0x2d')]();};}function respondWithResult(_0x336d53,_0x1adfb7){_0x1adfb7=_0x1adfb7||0xc8;return function(_0x57a550){if(_0x57a550){return _0x336d53[_0xe9cc('0x2c')](_0x1adfb7)[_0xe9cc('0x2e')](_0x57a550);}};}function respondWithFilteredResult(_0x1a3697,_0x291d3f){return function(_0x4c4b85){if(_0x4c4b85){var _0x25fbc4=_0x4c4b85['count'],_0x186379=_0x291d3f[_0xe9cc('0x2f')],_0x191189=_0x291d3f[_0xe9cc('0x2f')]+_0x291d3f['limit'],_0x23aa49;if(_0x191189>=_0x25fbc4){_0x191189=_0x25fbc4;_0x23aa49=0xc8;}else{_0x23aa49=0xce;}_0x1a3697[_0xe9cc('0x2c')](_0x23aa49);return _0x1a3697[_0xe9cc('0x30')](_0xe9cc('0x31'),_0x186379+'-'+_0x191189+'/'+_0x25fbc4)[_0xe9cc('0x2e')](_0x4c4b85);}return null;};}function patchUpdates(_0x3fa2fb){return function(_0x14e4a7){try{jsonpatch['apply'](_0x14e4a7,_0x3fa2fb,!![]);}catch(_0x23df03){return BPromise[_0xe9cc('0x32')](_0x23df03);}return _0x14e4a7['save']();};}function saveUpdates(_0x2acf7e,_0x12f805){return function(_0x1d704c){if(_0x1d704c){return _0x1d704c[_0xe9cc('0x33')](_0x2acf7e)[_0xe9cc('0x34')](function(_0x3942c6){return _0x3942c6;});}return null;};}function removeEntity(_0x1cda35,_0x195f6e){return function(_0x147d23){if(_0x147d23){return _0x147d23[_0xe9cc('0x35')]()[_0xe9cc('0x34')](function(){var _0x1871ab=_0x147d23['get']({'plain':!![]});var _0x37d372=_0xe9cc('0x36');return db[_0xe9cc('0x37')][_0xe9cc('0x35')]({'where':{'type':_0x37d372,'resourceId':_0x1871ab['id']}})[_0xe9cc('0x34')](function(){return _0x147d23;});})[_0xe9cc('0x34')](function(){_0x1cda35[_0xe9cc('0x2c')](0xcc)[_0xe9cc('0x2d')]();});}};}function handleEntityNotFound(_0x4c6b67,_0x97dc34){return function(_0x140733){if(!_0x140733){_0x4c6b67[_0xe9cc('0x2b')](0x194);}return _0x140733;};}function handleError(_0xc7ba0c,_0x59b174){_0x59b174=_0x59b174||0x1f4;return function(_0x2d7618){logger['error'](_0x2d7618[_0xe9cc('0x38')]);if(_0x2d7618[_0xe9cc('0x39')]){delete _0x2d7618['name'];}_0xc7ba0c[_0xe9cc('0x2c')](_0x59b174)[_0xe9cc('0x3a')](_0x2d7618);};}exports['index']=function(_0x34c8ad,_0x4646de){var _0x3db883={'include':[{'model':db['Pause'],'as':_0xe9cc('0x3b')}]},_0x28a9e7={},_0x3466f={'count':0x0,'rows':[]};var _0x4aef7f=_[_0xe9cc('0x3c')](db[_0xe9cc('0x3d')][_0xe9cc('0x3e')],function(_0x404b7d){return{'name':_0x404b7d[_0xe9cc('0x3f')],'type':_0x404b7d[_0xe9cc('0x40')][_0xe9cc('0x41')]};});_0x28a9e7[_0xe9cc('0x42')]=_['map'](_0x4aef7f,_0xe9cc('0x39'));_0x28a9e7['query']=_[_0xe9cc('0x43')](_0x34c8ad[_0xe9cc('0x44')]);_0x28a9e7[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x28a9e7[_0xe9cc('0x42')],_0x28a9e7[_0xe9cc('0x44')]);_0x3db883[_0xe9cc('0x47')]=_[_0xe9cc('0x46')](_0x28a9e7[_0xe9cc('0x42')],qs[_0xe9cc('0x48')](_0x34c8ad[_0xe9cc('0x44')]['fields']));_0x3db883[_0xe9cc('0x47')]=_0x3db883[_0xe9cc('0x47')]['length']?_0x3db883[_0xe9cc('0x47')]:_0x28a9e7[_0xe9cc('0x42')];if(!_0x34c8ad[_0xe9cc('0x44')]['hasOwnProperty']('nolimit')){_0x3db883[_0xe9cc('0x49')]=qs[_0xe9cc('0x49')](_0x34c8ad['query'][_0xe9cc('0x49')]);_0x3db883[_0xe9cc('0x2f')]=qs['offset'](_0x34c8ad[_0xe9cc('0x44')][_0xe9cc('0x2f')]);}_0x3db883[_0xe9cc('0x4a')]=qs['sort'](_0x34c8ad['query']['sort']);_0x3db883['where']=qs[_0xe9cc('0x45')](_['pick'](_0x34c8ad[_0xe9cc('0x44')],_0x28a9e7[_0xe9cc('0x45')]));if(_0x34c8ad[_0xe9cc('0x44')][_0xe9cc('0x4b')]){_0x3db883[_0xe9cc('0x4c')]=_[_0xe9cc('0x4d')](_0x3db883[_0xe9cc('0x4c')],{'$or':_[_0xe9cc('0x3c')](_0x4aef7f,function(_0x5580cd){if(_0x5580cd[_0xe9cc('0x40')]!==_0xe9cc('0x4e')){var _0xde4afa={};_0xde4afa[_0x5580cd['name']]={'$like':'%'+_0x34c8ad[_0xe9cc('0x44')][_0xe9cc('0x4b')]+'%'};return _0xde4afa;}})});}_0x3db883=_[_0xe9cc('0x4d')]({},_0x3db883,_0x34c8ad['options']);var _0x1d6235={'where':_0x3db883[_0xe9cc('0x4c')]};return db[_0xe9cc('0x3d')][_0xe9cc('0x4f')](_0x1d6235)[_0xe9cc('0x34')](function(_0x2c25c6){_0x3466f[_0xe9cc('0x4f')]=_0x2c25c6;if(_0x34c8ad['query'][_0xe9cc('0x50')]){_0x3db883['include']=[{'all':!![]}];}return db[_0xe9cc('0x3d')][_0xe9cc('0x51')](_0x3db883);})[_0xe9cc('0x34')](function(_0x352710){_0x3466f[_0xe9cc('0x52')]=_0x352710;return _0x3466f;})[_0xe9cc('0x34')](respondWithFilteredResult(_0x4646de,_0x3db883))[_0xe9cc('0x53')](handleError(_0x4646de,null));};exports['show']=function(_0x13ea6f,_0x5d7fb1){var _0x3c780d={'raw':![],'where':{'id':_0x13ea6f['params']['id']},'include':[{'model':db['Pause'],'as':_0xe9cc('0x3b')}]},_0x4e3f6f={};_0x4e3f6f[_0xe9cc('0x42')]=_[_0xe9cc('0x43')](db[_0xe9cc('0x3d')][_0xe9cc('0x3e')]);_0x4e3f6f['query']=_[_0xe9cc('0x43')](_0x13ea6f[_0xe9cc('0x44')]);_0x4e3f6f['filters']=_[_0xe9cc('0x46')](_0x4e3f6f[_0xe9cc('0x42')],_0x4e3f6f[_0xe9cc('0x44')]);_0x3c780d['attributes']=_[_0xe9cc('0x46')](_0x4e3f6f[_0xe9cc('0x42')],qs[_0xe9cc('0x48')](_0x13ea6f[_0xe9cc('0x44')][_0xe9cc('0x48')]));_0x3c780d[_0xe9cc('0x47')]=_0x3c780d['attributes'][_0xe9cc('0x54')]?_0x3c780d['attributes']:_0x4e3f6f[_0xe9cc('0x42')];if(_0x13ea6f['query'][_0xe9cc('0x50')]){_0x3c780d[_0xe9cc('0x55')]=[{'all':!![]}];}_0x3c780d=_['merge']({},_0x3c780d,_0x13ea6f[_0xe9cc('0x56')]);return db[_0xe9cc('0x3d')][_0xe9cc('0x57')](_0x3c780d)[_0xe9cc('0x34')](handleEntityNotFound(_0x5d7fb1,null))['then'](respondWithResult(_0x5d7fb1,null))[_0xe9cc('0x53')](handleError(_0x5d7fb1,null));};exports[_0xe9cc('0x58')]=function(_0x1fe320,_0x27ace5){return db['OpenchannelAccount']['create'](_0x1fe320['body'],{})['then'](function(_0x319d93){var _0x5f0dd7=_0x1fe320[_0xe9cc('0x59')][_0xe9cc('0x5a')]({'plain':!![]});if(!_0x5f0dd7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5f0dd7[_0xe9cc('0x5b')]===_0xe9cc('0x59')){var _0x49cafa=_0x319d93[_0xe9cc('0x5a')]({'plain':!![]});var _0xf386a4=_0xe9cc('0x36');return db[_0xe9cc('0x5c')][_0xe9cc('0x57')]({'where':{'name':_0xf386a4,'userProfileId':_0x5f0dd7[_0xe9cc('0x5d')]},'raw':!![]})['then'](function(_0x6b3bfa){if(_0x6b3bfa&&_0x6b3bfa['autoAssociation']===0x0){return db[_0xe9cc('0x37')]['create']({'name':_0x49cafa['name'],'resourceId':_0x49cafa['id'],'type':_0x6b3bfa[_0xe9cc('0x39')],'sectionId':_0x6b3bfa['id']},{})[_0xe9cc('0x34')](function(){return _0x319d93;});}else{return _0x319d93;}})['catch'](function(_0x23bffa){logger[_0xe9cc('0x27')](_0xe9cc('0x5e'),_0x23bffa);throw _0x23bffa;});}return _0x319d93;})[_0xe9cc('0x34')](respondWithResult(_0x27ace5,0xc9))[_0xe9cc('0x53')](handleError(_0x27ace5,null));};exports[_0xe9cc('0x33')]=function(_0x4bec5d,_0x16b672){if(_0x4bec5d[_0xe9cc('0x5f')]['id']){delete _0x4bec5d['body']['id'];}return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x4bec5d[_0xe9cc('0x60')]['id']},'include':[{'model':db['Pause'],'as':_0xe9cc('0x3b')}]})[_0xe9cc('0x34')](handleEntityNotFound(_0x16b672,null))[_0xe9cc('0x34')](saveUpdates(_0x4bec5d[_0xe9cc('0x5f')],null))[_0xe9cc('0x34')](respondWithResult(_0x16b672,null))['catch'](handleError(_0x16b672,null));};exports['destroy']=function(_0x39529a,_0x28d655){return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x39529a[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x28d655,null))[_0xe9cc('0x34')](removeEntity(_0x28d655,null))[_0xe9cc('0x53')](handleError(_0x28d655,null));};exports[_0xe9cc('0x61')]=function(_0x2ef97d,_0x10ef48){return db[_0xe9cc('0x3d')][_0xe9cc('0x61')]()[_0xe9cc('0x34')](respondWithResult(_0x10ef48,null))[_0xe9cc('0x53')](handleError(_0x10ef48,null));};exports['addDisposition']=function(_0x17697e,_0x227cad,_0xfc105c){if(_0x17697e['body']['id']){delete _0x17697e['body']['id'];}return db[_0xe9cc('0x3d')]['find']({'where':{'id':_0x17697e['params']['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x227cad,null))[_0xe9cc('0x34')](function(_0x4b58b9){if(_0x4b58b9){_0x17697e['body'][_0xe9cc('0x62')]=_0x4b58b9['id'];return db[_0xe9cc('0x63')]['create'](_0x17697e['body']);}})[_0xe9cc('0x34')](respondWithResult(_0x227cad,null))[_0xe9cc('0x53')](handleError(_0x227cad,null));};exports[_0xe9cc('0x64')]=function(_0x204cb5,_0x35e721,_0x1e8603){var _0x910499={'raw':![],'where':{}};var _0x13be74={};var _0x5d3f75={'count':0x0,'rows':[]};return db[_0xe9cc('0x3d')][_0xe9cc('0x65')]({'where':{'id':_0x204cb5['params']['id']}})['then'](handleEntityNotFound(_0x35e721,null))[_0xe9cc('0x34')](function(_0x2756ad){if(_0x2756ad){_0x13be74[_0xe9cc('0x42')]=_[_0xe9cc('0x43')](db[_0xe9cc('0x63')][_0xe9cc('0x3e')]);_0x13be74[_0xe9cc('0x44')]=_['keys'](_0x204cb5[_0xe9cc('0x44')]);_0x13be74[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x13be74['model'],_0x13be74[_0xe9cc('0x44')]);_0x910499[_0xe9cc('0x47')]=_[_0xe9cc('0x46')](_0x13be74['model'],qs['fields'](_0x204cb5['query'][_0xe9cc('0x48')]));_0x910499[_0xe9cc('0x47')]=_0x910499['attributes'][_0xe9cc('0x54')]?_0x910499[_0xe9cc('0x47')]:_0x13be74[_0xe9cc('0x42')];if(!_0x204cb5[_0xe9cc('0x44')][_0xe9cc('0x66')]('nolimit')){_0x910499['limit']=qs['limit'](_0x204cb5[_0xe9cc('0x44')][_0xe9cc('0x49')]);_0x910499[_0xe9cc('0x2f')]=qs['offset'](_0x204cb5[_0xe9cc('0x44')][_0xe9cc('0x2f')]);}_0x910499[_0xe9cc('0x4a')]=qs[_0xe9cc('0x67')](_0x204cb5['query'][_0xe9cc('0x67')]);_0x910499[_0xe9cc('0x4c')]=qs[_0xe9cc('0x45')](_[_0xe9cc('0x68')](_0x204cb5[_0xe9cc('0x44')],_0x13be74['filters']));_0x910499[_0xe9cc('0x4c')][_0xe9cc('0x69')]=_0x2756ad['id'];if(_0x204cb5[_0xe9cc('0x44')]['filter']){_0x910499[_0xe9cc('0x4c')]=_[_0xe9cc('0x4d')](_0x910499[_0xe9cc('0x4c')],{'$or':_[_0xe9cc('0x3c')](_0x910499[_0xe9cc('0x47')],function(_0x3cde0d){var _0x2f846e={};_0x2f846e[_0x3cde0d]={'$like':'%'+_0x204cb5[_0xe9cc('0x44')][_0xe9cc('0x4b')]+'%'};return _0x2f846e;})});}_0x910499=_['merge']({},_0x910499,_0x204cb5[_0xe9cc('0x56')]);return db[_0xe9cc('0x63')]['count']({'where':_0x910499['where']})[_0xe9cc('0x34')](function(_0x3599ec){_0x5d3f75[_0xe9cc('0x4f')]=_0x3599ec;if(_0x204cb5[_0xe9cc('0x44')][_0xe9cc('0x50')]){_0x910499[_0xe9cc('0x55')]=[{'all':!![]}];}return db[_0xe9cc('0x63')][_0xe9cc('0x51')](_0x910499);})[_0xe9cc('0x34')](function(_0x198e1e){_0x5d3f75['rows']=_0x198e1e;return _0x5d3f75;});}})[_0xe9cc('0x34')](respondWithFilteredResult(_0x35e721,_0x910499))[_0xe9cc('0x53')](handleError(_0x35e721,null));};exports[_0xe9cc('0x6a')]=function(_0x1b23c9,_0x596562,_0x1f6fb1){return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x1b23c9[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x596562,null))[_0xe9cc('0x34')](function(_0x449d9d){if(_0x449d9d){return _0x449d9d[_0xe9cc('0x6a')](_0x1b23c9[_0xe9cc('0x44')][_0xe9cc('0x6b')]);}})[_0xe9cc('0x34')](respondWithStatusCode(_0x596562,null))['catch'](handleError(_0x596562,null));};exports[_0xe9cc('0x6c')]=function(_0x42fe10,_0xe03c82,_0x25c1aa){if(_0x42fe10[_0xe9cc('0x5f')]['id']){delete _0x42fe10[_0xe9cc('0x5f')]['id'];}return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x42fe10['params']['id']}})['then'](handleEntityNotFound(_0xe03c82,null))[_0xe9cc('0x34')](function(_0x398c52){if(_0x398c52){_0x42fe10[_0xe9cc('0x5f')]['OpenchannelAccountId']=_0x398c52['id'];return db[_0xe9cc('0x6d')]['create'](_0x42fe10[_0xe9cc('0x5f')]);}})[_0xe9cc('0x34')](respondWithResult(_0xe03c82,null))[_0xe9cc('0x53')](handleError(_0xe03c82,null));};exports[_0xe9cc('0x6e')]=function(_0x34b960,_0x5e6d02,_0x25fc54){var _0x533b80={'raw':![],'where':{}};var _0x3a7bfa={};var _0x19c069={'count':0x0,'rows':[]};return db[_0xe9cc('0x3d')][_0xe9cc('0x65')]({'where':{'id':_0x34b960['params']['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x5e6d02,null))[_0xe9cc('0x34')](function(_0x56457d){if(_0x56457d){_0x3a7bfa[_0xe9cc('0x42')]=_[_0xe9cc('0x43')](db[_0xe9cc('0x6d')][_0xe9cc('0x3e')]);_0x3a7bfa[_0xe9cc('0x44')]=_[_0xe9cc('0x43')](_0x34b960[_0xe9cc('0x44')]);_0x3a7bfa[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x3a7bfa[_0xe9cc('0x42')],_0x3a7bfa['query']);_0x533b80[_0xe9cc('0x47')]=_['intersection'](_0x3a7bfa['model'],qs[_0xe9cc('0x48')](_0x34b960['query'][_0xe9cc('0x48')]));_0x533b80[_0xe9cc('0x47')]=_0x533b80[_0xe9cc('0x47')][_0xe9cc('0x54')]?_0x533b80[_0xe9cc('0x47')]:_0x3a7bfa['model'];if(!_0x34b960['query'][_0xe9cc('0x66')](_0xe9cc('0x6f'))){_0x533b80[_0xe9cc('0x49')]=qs[_0xe9cc('0x49')](_0x34b960[_0xe9cc('0x44')][_0xe9cc('0x49')]);_0x533b80[_0xe9cc('0x2f')]=qs['offset'](_0x34b960[_0xe9cc('0x44')][_0xe9cc('0x2f')]);}_0x533b80[_0xe9cc('0x4a')]=qs[_0xe9cc('0x67')](_0x34b960[_0xe9cc('0x44')]['sort']);_0x533b80['where']=qs[_0xe9cc('0x45')](_[_0xe9cc('0x68')](_0x34b960['query'],_0x3a7bfa[_0xe9cc('0x45')]));_0x533b80[_0xe9cc('0x4c')]['OpenchannelAccountId']=_0x56457d['id'];if(_0x34b960[_0xe9cc('0x44')][_0xe9cc('0x4b')]){_0x533b80[_0xe9cc('0x4c')]=_['merge'](_0x533b80[_0xe9cc('0x4c')],{'$or':_[_0xe9cc('0x3c')](_0x533b80[_0xe9cc('0x47')],function(_0x529c74){var _0x42d44f={};_0x42d44f[_0x529c74]={'$like':'%'+_0x34b960[_0xe9cc('0x44')][_0xe9cc('0x4b')]+'%'};return _0x42d44f;})});}_0x533b80=_[_0xe9cc('0x4d')]({},_0x533b80,_0x34b960[_0xe9cc('0x56')]);return db[_0xe9cc('0x6d')][_0xe9cc('0x4f')]({'where':_0x533b80[_0xe9cc('0x4c')]})[_0xe9cc('0x34')](function(_0x44aa12){_0x19c069[_0xe9cc('0x4f')]=_0x44aa12;if(_0x34b960['query'][_0xe9cc('0x50')]){_0x533b80['include']=[{'all':!![]}];}return db[_0xe9cc('0x6d')][_0xe9cc('0x51')](_0x533b80);})[_0xe9cc('0x34')](function(_0x55371e){_0x19c069[_0xe9cc('0x52')]=_0x55371e;return _0x19c069;});}})['then'](respondWithFilteredResult(_0x5e6d02,_0x533b80))[_0xe9cc('0x53')](handleError(_0x5e6d02,null));};exports[_0xe9cc('0x70')]=function(_0x482ef9,_0x58f178,_0x159318){return db[_0xe9cc('0x3d')]['find']({'where':{'id':_0x482ef9[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x58f178,null))[_0xe9cc('0x34')](function(_0x364142){if(_0x364142){return _0x364142['removeAnswers'](_0x482ef9[_0xe9cc('0x44')][_0xe9cc('0x6b')]);}})[_0xe9cc('0x34')](respondWithStatusCode(_0x58f178,null))[_0xe9cc('0x53')](handleError(_0x58f178,null));};exports[_0xe9cc('0x71')]=function(_0x1e6493,_0x10bbcf,_0x59a914){var _0x3740e6={'body':_0x1e6493[_0xe9cc('0x5f')],'channel':_0xe9cc('0x72')};var _0x3df24b=[];var _0x305d4f=[];var _0x146f19={};var _0x2e6e38=![];return db[_0xe9cc('0x73')][_0xe9cc('0x61')]()[_0xe9cc('0x34')](function(_0x10078e){if(!_0x10078e){throw new db['Sequelize'][(_0xe9cc('0x1e'))](_0xe9cc('0x74'));}_0x3df24b=_['difference'](_['keys'](_0x10078e),[_0xe9cc('0x75'),_0xe9cc('0x76')]);_0x305d4f=_[_0xe9cc('0x77')](_[_0xe9cc('0x43')](_0x10078e),['createdAt',_0xe9cc('0x76'),_0xe9cc('0x78'),_0xe9cc('0x79')]);if(_0x1e6493['body']['id']){delete _0x1e6493[_0xe9cc('0x5f')]['id'];}if(_[_0xe9cc('0x7a')](_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7b')])){throw new db[(_0xe9cc('0x7c'))][(_0xe9cc('0x1e'))]('from\x20is\x20mandatory');}if(_[_0xe9cc('0x7a')](_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x5f')])||_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x5f')]===''){throw new db[(_0xe9cc('0x7c'))][(_0xe9cc('0x1e'))](_0xe9cc('0x7d'));}if(_[_0xe9cc('0x7a')](_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7e')])){throw new db['Sequelize'][(_0xe9cc('0x1e'))](_0xe9cc('0x7f')+_0x305d4f);}if(!_['includes'](_0x305d4f,_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7e')])){throw new db['Sequelize'][(_0xe9cc('0x1e'))](_0xe9cc('0x80')+_0x305d4f);}_0x146f19[_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7e')]]=_0x1e6493[_0xe9cc('0x5f')]['from'];})[_0xe9cc('0x34')](function(){return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x1e6493['params']['id']},'include':[{'model':db[_0xe9cc('0x81')],'as':_0xe9cc('0x82'),'include':[{'model':db[_0xe9cc('0x73')],'as':_0xe9cc('0x83'),'where':_0x146f19,'limit':0x1,'order':[[_0xe9cc('0x76'),'DESC']]}]},{'model':db['OpenchannelApplication'],'as':_0xe9cc('0x84')}]});})['then'](handleEntityNotFound(_0x10bbcf,null))[_0xe9cc('0x34')](function(_0x555e56){if(_0x555e56&&_0x555e56[_0xe9cc('0x82')]){_0x3740e6[_0xe9cc('0x85')]=_0x555e56;_0x3740e6[_0xe9cc('0x86')]=_0x555e56['Applications'];_0x3740e6[_0xe9cc('0x87')]=_0x555e56[_0xe9cc('0x82')];_0x3740e6[_0xe9cc('0x86')]=_[_0xe9cc('0x88')](_0x3740e6[_0xe9cc('0x86')],['priority'],[_0xe9cc('0x89')]);if(_0x3740e6[_0xe9cc('0x85')][_0xe9cc('0x84')]){delete _0x3740e6['account']['Applications'];}if(_0x3740e6['account'][_0xe9cc('0x82')]&&_0x3740e6[_0xe9cc('0x85')]['List'][_0xe9cc('0x83')][_0xe9cc('0x54')]){return _0x3740e6[_0xe9cc('0x85')][_0xe9cc('0x82')][_0xe9cc('0x83')][0x0];}var _0x1134f2=_[_0xe9cc('0x16')](_0x1e6493['body'],{'firstName':_0x1e6493['body']['from'],'ListId':_0x555e56[_0xe9cc('0x79')]});_0x1134f2[_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7e')]]=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x7b')];return db[_0xe9cc('0x73')][_0xe9cc('0x58')](_0x1134f2,{'fields':_0x3df24b,'raw':!![]});}})[_0xe9cc('0x34')](handleEntityNotFound(_0x10bbcf,null))[_0xe9cc('0x34')](function(_0x479e87){_0x3740e6[_0xe9cc('0x8a')]=_0x479e87;if(_0x479e87){var _0x1c6371={'ContactId':_0x479e87['id'],'OpenchannelAccountId':_0x1e6493[_0xe9cc('0x60')]['id'],'from':(_0x479e87['firstName']||'')+'\x20'+(_0x479e87[_0xe9cc('0x8b')]||'')};var _0x5008ea={'OpenchannelAccountId':_0x1e6493[_0xe9cc('0x60')]['id'],'closed':![]};if(_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8c')]){_0x5008ea[_0xe9cc('0x8c')]=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8c')];return db['OpenchannelInteraction'][_0xe9cc('0x57')]({'where':_0x5008ea})['then'](function(_0x15b9c6){if(_0x15b9c6){return[_0x15b9c6,![]];}_0x1c6371[_0xe9cc('0x8c')]=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8c')];_0x1c6371[_0xe9cc('0x8d')]=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8d')];return db[_0xe9cc('0x8e')][_0xe9cc('0x58')](_0x1c6371)[_0xe9cc('0x34')](function(_0x4baae1){return[_0x4baae1,!![]];});});}else{_0x5008ea[_0xe9cc('0x8c')]=null;}_0x5008ea[_0xe9cc('0x8f')]=_0x479e87['id'];return db[_0xe9cc('0x8e')][_0xe9cc('0x57')]({'where':_0x5008ea})['then'](function(_0x18fed0){if(_0x18fed0){return[_0x18fed0,![]];}return db[_0xe9cc('0x8e')]['create'](_0x1c6371)['then'](function(_0x1d7e50){return[_0x1d7e50,!![]];});});}})['spread'](function(_0xe5dc48,_0x1d039b){if(_0xe5dc48){_0x2e6e38=_0x1d039b;if(!_0x1d039b){var _0x554f4a={'from':(_0x3740e6[_0xe9cc('0x8a')][_0xe9cc('0x90')]||'')+'\x20'+(_0x3740e6['contact'][_0xe9cc('0x8b')]||'')};if(_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8c')]&&_0x1e6493['body'][_0xe9cc('0x91')]&&_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x8c')]!=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x91')]){_0x554f4a[_0xe9cc('0x8c')]=_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x91')];}return _0xe5dc48[_0xe9cc('0x33')](_0x554f4a);}else{return _0xe5dc48;}}})['then'](function(_0x585bd0){_0x3740e6[_0xe9cc('0x92')]=_0x585bd0[_0xe9cc('0x5a')]({'plain':!![]});_0x3740e6['interaction'][_0xe9cc('0x93')]=_0x2e6e38;if(_0x3740e6[_0xe9cc('0x92')][_0xe9cc('0x93')]){if(_0x3740e6['account']['autoclose']){_0x3740e6[_0xe9cc('0x86')]['push']({'id':0x0,'priority':_0x3740e6[_0xe9cc('0x86')]['length']+0x1,'app':_0xe9cc('0x94'),'appdata':_0xe9cc('0x95'),'interval':_0xe9cc('0x96')});}}return db[_0xe9cc('0x97')][_0xe9cc('0x58')]({'body':_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x5f')],'OpenchannelAccountId':_0x1e6493[_0xe9cc('0x60')]['id'],'OpenchannelInteractionId':_0x585bd0['id'],'direction':'in','ContactId':_0x3740e6[_0xe9cc('0x8a')]['id'],'AttachmentId':_0x1e6493[_0xe9cc('0x5f')][_0xe9cc('0x98')]});})[_0xe9cc('0x34')](function(_0x929aed){_0x3740e6[_0xe9cc('0x29')]=_0x929aed;if(_0x3740e6[_0xe9cc('0x92')]['UserId']){return db['User'][_0xe9cc('0x57')]({'attributes':['id',_0xe9cc('0x39')],'where':{'id':_0x3740e6['interaction'][_0xe9cc('0x99')]}})['then'](function(_0x333c7c){if(_0x333c7c){_0x3740e6[_0xe9cc('0x86')][_0xe9cc('0x9a')]({'id':0x0,'priority':0x0,'app':_0xe9cc('0x9b'),'appdata':_0x333c7c[_0xe9cc('0x39')]+','+(_0x3740e6['account']['waitForTheAssignedAgent']||0xa),'interval':_0xe9cc('0x96')});_0x3740e6[_0xe9cc('0x9c')]=![];}return respondWithRpcPromise(_0xe9cc('0x9d'),_0xe9cc('0x9e'),_0x3740e6);});}return respondWithRpcPromise(_0xe9cc('0x9d'),_0xe9cc('0x9e'),_0x3740e6);})[_0xe9cc('0x34')](function(_0x24bec4){respondWithRpcPromise(_0xe9cc('0x9f'),_0xe9cc('0x9f'),{'event':'notify','message':_0x24bec4},client9002);return _0x24bec4;})[_0xe9cc('0x34')](respondWithResult(_0x10bbcf,null))[_0xe9cc('0x53')](handleError(_0x10bbcf,null));};exports['addApplications']=function(_0x4d1a5f,_0xc8399a,_0x4f4034){return db['OpenchannelAccount']['findOne']({'where':{'id':_0x4d1a5f[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0xc8399a,null))[_0xe9cc('0x34')](function(_0x25e1c8){if(_0x25e1c8){return db['sequelize'][_0xe9cc('0xa0')](function(_0x2da14b){return db['OpenchannelApplication']['destroy']({'where':{'OpenchannelAccountId':_0x4d1a5f[_0xe9cc('0x60')]['id']},'transaction':_0x2da14b})[_0xe9cc('0x34')](function(_0x368468){var _0x4c3564=_[_0xe9cc('0x3c')](_0x4d1a5f[_0xe9cc('0x5f')],function(_0x1dc256){_0x1dc256[_0xe9cc('0x69')]=_0x4d1a5f[_0xe9cc('0x60')]['id'];return _0x1dc256;});return db[_0xe9cc('0xa1')][_0xe9cc('0xa2')](_0x4c3564,{'transaction':_0x2da14b});});})[_0xe9cc('0x34')](function(){return db[_0xe9cc('0xa1')][_0xe9cc('0xa3')]({'where':{'OpenchannelAccountId':_0x4d1a5f[_0xe9cc('0x60')]['id']},'order':_0xe9cc('0xa4')});});}})[_0xe9cc('0x34')](respondWithResult(_0xc8399a,null))[_0xe9cc('0x53')](handleError(_0xc8399a,null));};exports[_0xe9cc('0xa5')]=function(_0x539ce1,_0x3b06b4,_0x119791){var _0x655aca={};var _0x54616b={};var _0x15ad62;var _0xe7b870;return db[_0xe9cc('0x3d')][_0xe9cc('0x65')]({'where':{'id':_0x539ce1[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x3b06b4,null))['then'](function(_0x58503f){if(_0x58503f){_0x15ad62=_0x58503f;_0x54616b[_0xe9cc('0x42')]=_[_0xe9cc('0x43')](db[_0xe9cc('0xa1')]['rawAttributes']);_0x54616b['query']=_['keys'](_0x539ce1[_0xe9cc('0x44')]);_0x54616b[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x54616b[_0xe9cc('0x42')],_0x54616b['query']);_0x655aca[_0xe9cc('0x47')]=_[_0xe9cc('0x46')](_0x54616b[_0xe9cc('0x42')],qs['fields'](_0x539ce1[_0xe9cc('0x44')]['fields']));_0x655aca[_0xe9cc('0x47')]=_0x655aca[_0xe9cc('0x47')][_0xe9cc('0x54')]?_0x655aca[_0xe9cc('0x47')]:_0x54616b[_0xe9cc('0x42')];_0x655aca['order']=qs[_0xe9cc('0x67')](_0x539ce1[_0xe9cc('0x44')][_0xe9cc('0x67')]);_0x655aca[_0xe9cc('0x4c')]=qs[_0xe9cc('0x45')](_[_0xe9cc('0x68')](_0x539ce1[_0xe9cc('0x44')],_0x54616b['filters']));if(_0x539ce1[_0xe9cc('0x44')]['filter']){_0x655aca[_0xe9cc('0x4c')]=_[_0xe9cc('0x4d')](_0x655aca[_0xe9cc('0x4c')],{'$or':_[_0xe9cc('0x3c')](_0x655aca[_0xe9cc('0x47')],function(_0x5dfe18){var _0x182ef6={};_0x182ef6[_0x5dfe18]={'$like':'%'+_0x539ce1['query'][_0xe9cc('0x4b')]+'%'};return _0x182ef6;})});}_0x655aca=_[_0xe9cc('0x4d')]({},_0x655aca,_0x539ce1[_0xe9cc('0x56')]);return _0x15ad62[_0xe9cc('0xa5')](_0x655aca);}})[_0xe9cc('0x34')](function(_0x14f690){if(_0x14f690){_0xe7b870=_0x14f690[_0xe9cc('0x54')];if(!_0x539ce1[_0xe9cc('0x44')][_0xe9cc('0x66')](_0xe9cc('0x6f'))){_0x655aca[_0xe9cc('0x49')]=qs['limit'](_0x539ce1['query'][_0xe9cc('0x49')]);_0x655aca['offset']=qs['offset'](_0x539ce1[_0xe9cc('0x44')][_0xe9cc('0x2f')]);}return _0x15ad62[_0xe9cc('0xa5')](_0x655aca);}})[_0xe9cc('0x34')](function(_0x56964d){if(_0x56964d){return _0x56964d?{'count':_0xe7b870,'rows':_0x56964d}:null;}})[_0xe9cc('0x34')](respondWithResult(_0x3b06b4,null))[_0xe9cc('0x53')](handleError(_0x3b06b4,null));};exports[_0xe9cc('0xa6')]=function(_0x5befc6,_0x55dd6d,_0x43b234){var _0x3a4d3f={'raw':![],'where':{}};var _0x1a33bb={};var _0x25d603={'count':0x0,'rows':[]};return db[_0xe9cc('0x3d')]['findOne']({'where':{'id':_0x5befc6['params']['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x55dd6d,null))[_0xe9cc('0x34')](function(_0x405a32){if(_0x405a32){_0x1a33bb['model']=_[_0xe9cc('0x43')](db[_0xe9cc('0x8e')][_0xe9cc('0x3e')]);_0x1a33bb[_0xe9cc('0x44')]=_[_0xe9cc('0x43')](_0x5befc6[_0xe9cc('0x44')]);_0x1a33bb[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x1a33bb['model'],_0x1a33bb[_0xe9cc('0x44')]);_0x3a4d3f[_0xe9cc('0x47')]=_[_0xe9cc('0x46')](_0x1a33bb[_0xe9cc('0x42')],qs['fields'](_0x5befc6[_0xe9cc('0x44')][_0xe9cc('0x48')]));_0x3a4d3f[_0xe9cc('0x47')]=_0x3a4d3f[_0xe9cc('0x47')][_0xe9cc('0x54')]?_0x3a4d3f['attributes']:_0x1a33bb[_0xe9cc('0x42')];if(!_0x5befc6['query'][_0xe9cc('0x66')]('nolimit')){_0x3a4d3f['limit']=qs[_0xe9cc('0x49')](_0x5befc6[_0xe9cc('0x44')]['limit']);_0x3a4d3f[_0xe9cc('0x2f')]=qs['offset'](_0x5befc6[_0xe9cc('0x44')][_0xe9cc('0x2f')]);}_0x3a4d3f[_0xe9cc('0x4a')]=qs['sort'](_0x5befc6['query']['sort']);_0x3a4d3f[_0xe9cc('0x4c')]=qs['filters'](_[_0xe9cc('0x68')](_0x5befc6[_0xe9cc('0x44')],_0x1a33bb['filters']));_0x3a4d3f[_0xe9cc('0x4c')]['OpenchannelAccountId']=_0x405a32['id'];if(_0x5befc6['query'][_0xe9cc('0x4b')]){_0x3a4d3f[_0xe9cc('0x4c')]=_[_0xe9cc('0x4d')](_0x3a4d3f[_0xe9cc('0x4c')],{'$or':_[_0xe9cc('0x3c')](_0x3a4d3f[_0xe9cc('0x47')],function(_0x23906c){var _0x420588={};_0x420588[_0x23906c]={'$like':'%'+_0x5befc6[_0xe9cc('0x44')][_0xe9cc('0x4b')]+'%'};return _0x420588;})});}_0x3a4d3f=_['merge']({},_0x3a4d3f,_0x5befc6[_0xe9cc('0x56')]);return db[_0xe9cc('0x8e')][_0xe9cc('0x4f')]({'where':_0x3a4d3f[_0xe9cc('0x4c')]})[_0xe9cc('0x34')](function(_0x2e9283){_0x25d603[_0xe9cc('0x4f')]=_0x2e9283;if(_0x5befc6[_0xe9cc('0x44')]['includeAll']){_0x3a4d3f[_0xe9cc('0x55')]=[{'model':db['CmContact'],'as':_0xe9cc('0xa7'),'required':![]},{'model':db[_0xe9cc('0xa8')],'as':_0xe9cc('0xa9'),'attributes':[_0xe9cc('0x39'),_0xe9cc('0xaa'),_0xe9cc('0xab')],'required':![]},{'model':db[_0xe9cc('0xac')],'as':'Tags','attributes':['id','name',_0xe9cc('0xad')],'where':_0x5befc6['query'][_0xe9cc('0xae')]?{'id':_0x5befc6[_0xe9cc('0x44')][_0xe9cc('0xae')]}:undefined,'required':_0x5befc6[_0xe9cc('0x44')]['tag']?!![]:![]}];}return db[_0xe9cc('0x8e')][_0xe9cc('0x51')](_0x3a4d3f);})[_0xe9cc('0x34')](function(_0x287a99){_0x25d603[_0xe9cc('0x52')]=_0x287a99;return _0x25d603;});}})[_0xe9cc('0x34')](respondWithFilteredResult(_0x55dd6d,_0x3a4d3f))[_0xe9cc('0x53')](handleError(_0x55dd6d,null));};exports[_0xe9cc('0xaf')]=function(_0x408068,_0x2159a3,_0x41c524){return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x408068[_0xe9cc('0x60')]['id']}})['then'](handleEntityNotFound(_0x2159a3,null))['then'](function(_0x1d6787){if(_0x1d6787){return _0x1d6787[_0xe9cc('0xaf')](_0x408068['body'][_0xe9cc('0x6b')],_[_0xe9cc('0xb0')](_0x408068['body'],[_0xe9cc('0x6b'),'id'])||{})[_0xe9cc('0xb1')](function(_0x17edf9){for(var _0x1e8879=0x0;_0x1e8879<_0x408068[_0xe9cc('0x5f')][_0xe9cc('0x6b')][_0xe9cc('0x54')];_0x1e8879+=0x1){socket[_0xe9cc('0xb2')](_0xe9cc('0xb3'),{'UserId':_0x408068[_0xe9cc('0x5f')][_0xe9cc('0x6b')][_0x1e8879],'OpenchannelAccountId':_0x408068[_0xe9cc('0x60')]['id']});}return _0x17edf9;});}})[_0xe9cc('0x34')](respondWithResult(_0x2159a3,null))['catch'](handleError(_0x2159a3,null));};exports[_0xe9cc('0xb4')]=function(_0x292198,_0x4a3fac,_0x6c5fce){return db[_0xe9cc('0x3d')][_0xe9cc('0x57')]({'where':{'id':_0x292198[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x4a3fac,null))['then'](function(_0xe23b92){if(_0xe23b92){return _0xe23b92['removeAgents'](_0x292198['query'][_0xe9cc('0x6b')])[_0xe9cc('0x34')](function(){if(_[_0xe9cc('0xb5')](_0x292198[_0xe9cc('0x44')][_0xe9cc('0x6b')])){for(var _0x2d916e=0x0;_0x2d916e<_0x292198[_0xe9cc('0x44')][_0xe9cc('0x6b')]['length'];_0x2d916e+=0x1){socket[_0xe9cc('0xb2')]('userOpenchannelAccount:remove',{'UserId':Number(_0x292198[_0xe9cc('0x44')][_0xe9cc('0x6b')][_0x2d916e]),'OpenchannelAccountId':Number(_0x292198['params']['id'])});}}else{socket[_0xe9cc('0xb2')](_0xe9cc('0xb6'),{'UserId':Number(_0x292198[_0xe9cc('0x44')][_0xe9cc('0x6b')]),'OpenchannelAccountId':Number(_0x292198[_0xe9cc('0x60')]['id'])});}});}})[_0xe9cc('0x34')](respondWithStatusCode(_0x4a3fac,null))[_0xe9cc('0x53')](handleError(_0x4a3fac,null));};exports[_0xe9cc('0xb7')]=function(_0x252536,_0x5be9a8,_0x54b11e){var _0x48b2c7={};var _0x5d6e20={};var _0x262f73;var _0x2ad365;return db[_0xe9cc('0x3d')][_0xe9cc('0x65')]({'where':{'id':_0x252536[_0xe9cc('0x60')]['id']}})['then'](handleEntityNotFound(_0x5be9a8,null))[_0xe9cc('0x34')](function(_0x396dc3){if(_0x396dc3){_0x262f73=_0x396dc3;_0x5d6e20['model']=_[_0xe9cc('0x43')](db[_0xe9cc('0xa8')]['rawAttributes']);_0x5d6e20[_0xe9cc('0x44')]=_[_0xe9cc('0x43')](_0x252536[_0xe9cc('0x44')]);_0x5d6e20[_0xe9cc('0x45')]=_[_0xe9cc('0x46')](_0x5d6e20[_0xe9cc('0x42')],_0x5d6e20['query']);_0x48b2c7[_0xe9cc('0x47')]=_[_0xe9cc('0x46')](_0x5d6e20['model'],qs[_0xe9cc('0x48')](_0x252536[_0xe9cc('0x44')][_0xe9cc('0x48')]));_0x48b2c7[_0xe9cc('0x47')]=_0x48b2c7[_0xe9cc('0x47')][_0xe9cc('0x54')]?_0x48b2c7[_0xe9cc('0x47')]:_0x5d6e20[_0xe9cc('0x42')];_0x48b2c7[_0xe9cc('0x4a')]=qs[_0xe9cc('0x67')](_0x252536['query']['sort']);_0x48b2c7[_0xe9cc('0x4c')]=qs[_0xe9cc('0x45')](_[_0xe9cc('0x68')](_0x252536[_0xe9cc('0x44')],_0x5d6e20[_0xe9cc('0x45')]));if(_0x252536[_0xe9cc('0x44')][_0xe9cc('0x4b')]){_0x48b2c7[_0xe9cc('0x4c')]=_[_0xe9cc('0x4d')](_0x48b2c7['where'],{'$or':_[_0xe9cc('0x3c')](_0x48b2c7[_0xe9cc('0x47')],function(_0x47bead){var _0x53097a={};_0x53097a[_0x47bead]={'$like':'%'+_0x252536[_0xe9cc('0x44')][_0xe9cc('0x4b')]+'%'};return _0x53097a;})});}_0x48b2c7=_[_0xe9cc('0x4d')]({},_0x48b2c7,_0x252536[_0xe9cc('0x56')]);return _0x262f73['getAgents'](_0x48b2c7);}})[_0xe9cc('0x34')](function(_0x3d4c48){if(_0x3d4c48){_0x2ad365=_0x3d4c48[_0xe9cc('0x54')];if(!_0x252536[_0xe9cc('0x44')][_0xe9cc('0x66')](_0xe9cc('0x6f'))){_0x48b2c7['limit']=qs[_0xe9cc('0x49')](_0x252536[_0xe9cc('0x44')]['limit']);_0x48b2c7[_0xe9cc('0x2f')]=qs[_0xe9cc('0x2f')](_0x252536[_0xe9cc('0x44')]['offset']);}return _0x262f73[_0xe9cc('0xb7')](_0x48b2c7);}})['then'](function(_0x5e4ca0){if(_0x5e4ca0){return _0x5e4ca0?{'count':_0x2ad365,'rows':_0x5e4ca0}:null;}})['then'](respondWithResult(_0x5be9a8,null))[_0xe9cc('0x53')](handleError(_0x5be9a8,null));};exports[_0xe9cc('0x3a')]=function(_0x265a75,_0x12880a,_0x2404ef){var _0x59bbe7,_0x3745c8,_0x30a60f;if(_['isNil'](_0x265a75['body']['body'])||_0x265a75['body'][_0xe9cc('0x5f')]===''){throw new db[(_0xe9cc('0x7c'))][(_0xe9cc('0x1e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xe9cc('0x7a')](_0x265a75[_0xe9cc('0x5f')]['to'])){}_0x59bbe7=_0x265a75[_0xe9cc('0x5f')]['to'];return db['OpenchannelAccount'][_0xe9cc('0x65')]({'where':{'id':_0x265a75[_0xe9cc('0x60')]['id']}})[_0xe9cc('0x34')](handleEntityNotFound(_0x12880a,null))[_0xe9cc('0x34')](function(_0x5debeb){if(_0x5debeb){return db[_0xe9cc('0x3d')]['find']({'where':{'id':_0x5debeb['id']},'include':[{'model':db[_0xe9cc('0x81')],'as':_0xe9cc('0x82'),'include':[{'model':db[_0xe9cc('0x73')],'as':_0xe9cc('0x83'),'where':{[_0x5debeb['mapKey']]:_0x59bbe7},'limit':0x1,'order':[[_0xe9cc('0x76'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x12880a,null))[_0xe9cc('0x34')](function(_0x53779f){if(_0x53779f&&_0x53779f[_0xe9cc('0x82')]){_0x3745c8=_0x53779f[_0xe9cc('0x5a')]({'plain':!![]});if(_0x3745c8['List']&&_0x3745c8[_0xe9cc('0x82')][_0xe9cc('0x83')][_0xe9cc('0x54')]){return _0x3745c8[_0xe9cc('0x82')]['Contacts'][0x0];}return db[_0xe9cc('0x73')][_0xe9cc('0x58')](_['defaults'](_0x265a75[_0xe9cc('0x5f')],{'firstName':_0x59bbe7,[_0x53779f[_0xe9cc('0x7e')]]:_0x59bbe7,'phone':_0x59bbe7,'ListId':_0x3745c8[_0xe9cc('0x79')]}));}})['then'](handleEntityNotFound(_0x12880a,null))[_0xe9cc('0x34')](function(_0xa39757){if(_0xa39757){_0x30a60f=_0xa39757;return db[_0xe9cc('0x8e')][_0xe9cc('0x57')]({'where':{'ContactId':_0x30a60f['id'],'closed':![],'OpenchannelAccountId':_0x3745c8['id']}})[_0xe9cc('0x34')](function(_0x3a4b75){if(_0x3a4b75){return[_0x3a4b75,![]];}return db['OpenchannelInteraction']['create']({'UserId':_0x265a75[_0xe9cc('0x59')]['id'],'ContactId':_0x30a60f['id'],'OpenchannelAccountId':_0x3745c8['id'],'lastMsgDirection':_0xe9cc('0xb8'),'Messages':[_[_0xe9cc('0x4d')](_0x265a75['body'],{'read':![],'body':_0x265a75[_0xe9cc('0x5f')][_0xe9cc('0x5f')],'OpenchannelAccountId':_0x3745c8['id'],'UserId':_0x265a75['user']['id'],'ContactId':_0x30a60f['id']})]},{'include':[{'model':db[_0xe9cc('0x97')],'as':_0xe9cc('0xb9')}]})[_0xe9cc('0x34')](function(_0x4dd05e){return[_0x4dd05e,!![]];});});}})[_0xe9cc('0xb1')](function(_0x22c48d,_0x38e41d){if(_0x38e41d){return _0x22c48d;}return db[_0xe9cc('0x97')]['create'](_['merge'](_0x265a75[_0xe9cc('0x5f')],{'read':![],'body':_0x265a75['body'][_0xe9cc('0x5f')],'OpenchannelAccountId':_0x3745c8['id'],'OpenchannelInteractionId':_0x22c48d['id'],'UserId':_0x265a75['user']['id'],'ContactId':_0x30a60f['id']}))[_0xe9cc('0x34')](function(_0x3d81ef){_0x22c48d['dataValues'][_0xe9cc('0xb9')]=[];_0x22c48d[_0xe9cc('0xba')][_0xe9cc('0xb9')][_0xe9cc('0xbb')](_0x3d81ef['dataValues']);return _0x22c48d;});});}})[_0xe9cc('0x34')](respondWithResult(_0x12880a,null))[_0xe9cc('0x53')](handleError(_0x12880a,null));}; \ No newline at end of file +var _0x99e8=['catch','end','json','count','offset','status','set','apply','save','get','UserProfileResource','sendStatus','stack','name','Pause','mandatoryDispositionPause','map','OpenchannelAccount','rawAttributes','fieldName','key','model','filters','intersection','fields','query','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','type','rows','show','keys','includeAll','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelAccounts','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','destroy','params','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','hasOwnProperty','OpenchannelAccountId','options','findAll','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','notify','openchannel','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','CmList','List','Contacts','DESC','Applications','list','applications','priority','asc','account','from','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','lastName','messageId','interaction','created','autoclose','push','close','*,*,*,*','OpenchannelMessage','AttachmentId','User','unshift','waitForTheAssignedAgent','forcedOwnership','Start','startRouting','addApplications','sequelize','transaction','OpenchannelApplication','findAndCountAll','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','color','tag','addAgents','spread','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','send','defaults','out','Messages','dataValues','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','redis','socket.io-emitter','./openchannelAccount.socket','register','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x40e797,_0x380a64){var _0xbf3f27=function(_0x520c13){while(--_0x520c13){_0x40e797['push'](_0x40e797['shift']());}};_0xbf3f27(++_0x380a64);}(_0x99e8,0x14e));var _0x899e=function(_0xd789df,_0x266387){_0xd789df=_0xd789df-0x0;var _0x4db055=_0x99e8[_0xd789df];return _0x4db055;};'use strict';var pdf=require(_0x899e('0x0'));var emlformat=require(_0x899e('0x1'));var rimraf=require(_0x899e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x899e('0x3'));var rp=require('request-promise');var moment=require(_0x899e('0x4'));var BPromise=require(_0x899e('0x5'));var Mustache=require(_0x899e('0x6'));var util=require(_0x899e('0x7'));var path=require(_0x899e('0x8'));var sox=require('sox');var csv=require(_0x899e('0x9'));var ejs=require(_0x899e('0xa'));var fs=require('fs');var _=require(_0x899e('0xb'));var squel=require('squel');var crypto=require(_0x899e('0xc'));var jsforce=require(_0x899e('0xd'));var deskjs=require(_0x899e('0xe'));var toCsv=require(_0x899e('0x9'));var querystring=require(_0x899e('0xf'));var Papa=require(_0x899e('0x10'));var Redis=require(_0x899e('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x899e('0x12'));var as=require(_0x899e('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x899e('0x14'));var config=require(_0x899e('0x15'));var db=require('../../mysqldb')['db'];config[_0x899e('0x16')]=_['defaults'](config[_0x899e('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x899e('0x17'))(new Redis(config[_0x899e('0x16')]));require(_0x899e('0x18'))[_0x899e('0x19')](socket);var jayson=require('jayson/promise');var client=jayson['client'][_0x899e('0x1a')]({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x29d79f,_0x4f0d51,_0x17d193){if(_0x17d193){var _0x17f0aa=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17f0aa[_0x899e('0x1b')](_0x4f0d51)){return _0x29d79f;}else{throw new db[(_0x899e('0x1c'))][(_0x899e('0x1d'))](_0x899e('0x1e'));}}else{return _0x29d79f;}}function respondWithRpcPromise(_0x288989,_0x205571,_0x28d006,_0x538278){return new BPromise(function(_0x34c2db,_0x31dadc){var _0x431bf2=_0x538278||client;return _0x431bf2[_0x899e('0x1f')](_0x288989,_0x28d006)[_0x899e('0x20')](function(_0xf0e135){logger[_0x899e('0x21')](_0x899e('0x22'),_0x205571,_0x899e('0x23'));logger[_0x899e('0x24')](_0x899e('0x25'),_0x205571,_0x899e('0x23'),JSON[_0x899e('0x26')](_0xf0e135));if(_0xf0e135[_0x899e('0x27')]){if(_0xf0e135[_0x899e('0x27')][_0x899e('0x28')]===0x1f4){logger['error'](_0x899e('0x22'),_0x205571,_0xf0e135[_0x899e('0x27')][_0x899e('0x29')]);return _0x31dadc(_0xf0e135['error'][_0x899e('0x29')]);}logger[_0x899e('0x27')](_0x899e('0x22'),_0x205571,_0xf0e135[_0x899e('0x27')][_0x899e('0x29')]);return _0x34c2db(_0xf0e135[_0x899e('0x27')][_0x899e('0x29')]);}else{logger[_0x899e('0x21')](_0x899e('0x22'),_0x205571,'request\x20sent');_0x34c2db(_0xf0e135['result'][_0x899e('0x29')]);}})[_0x899e('0x2a')](function(_0x59db63){logger[_0x899e('0x27')](_0x899e('0x22'),_0x205571,_0x59db63);_0x31dadc(_0x59db63);});});}function respondWithStatusCode(_0x1f6b4a,_0x342f0a){_0x342f0a=_0x342f0a||0xcc;return function(_0x46f490){if(_0x46f490){return _0x1f6b4a['sendStatus'](_0x342f0a);}return _0x1f6b4a['status'](_0x342f0a)[_0x899e('0x2b')]();};}function respondWithResult(_0x7beafc,_0x2864b1){_0x2864b1=_0x2864b1||0xc8;return function(_0x28850d){if(_0x28850d){return _0x7beafc['status'](_0x2864b1)[_0x899e('0x2c')](_0x28850d);}};}function respondWithFilteredResult(_0xe70994,_0x54ebc6){return function(_0x860134){if(_0x860134){var _0x54bbc2=_0x860134[_0x899e('0x2d')],_0x2c2347=_0x54ebc6[_0x899e('0x2e')],_0x40748d=_0x54ebc6['offset']+_0x54ebc6['limit'],_0x1c9fbf;if(_0x40748d>=_0x54bbc2){_0x40748d=_0x54bbc2;_0x1c9fbf=0xc8;}else{_0x1c9fbf=0xce;}_0xe70994[_0x899e('0x2f')](_0x1c9fbf);return _0xe70994[_0x899e('0x30')]('Content-Range',_0x2c2347+'-'+_0x40748d+'/'+_0x54bbc2)[_0x899e('0x2c')](_0x860134);}return null;};}function patchUpdates(_0x420853){return function(_0x27217){try{jsonpatch[_0x899e('0x31')](_0x27217,_0x420853,!![]);}catch(_0x1fd604){return BPromise['reject'](_0x1fd604);}return _0x27217[_0x899e('0x32')]();};}function saveUpdates(_0x43ab93,_0x4f49fc){return function(_0x24b19e){if(_0x24b19e){return _0x24b19e['update'](_0x43ab93)[_0x899e('0x20')](function(_0x269f63){return _0x269f63;});}return null;};}function removeEntity(_0x529b49,_0x158f3f){return function(_0x2b5409){if(_0x2b5409){return _0x2b5409['destroy']()['then'](function(){var _0x2b53a9=_0x2b5409[_0x899e('0x33')]({'plain':!![]});var _0x41e9c8='OpenchannelAccounts';return db[_0x899e('0x34')]['destroy']({'where':{'type':_0x41e9c8,'resourceId':_0x2b53a9['id']}})['then'](function(){return _0x2b5409;});})[_0x899e('0x20')](function(){_0x529b49[_0x899e('0x2f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ce585,_0x26e6e8){return function(_0x5ebf59){if(!_0x5ebf59){_0x2ce585[_0x899e('0x35')](0x194);}return _0x5ebf59;};}function handleError(_0x54b04d,_0x2e61ea){_0x2e61ea=_0x2e61ea||0x1f4;return function(_0x994bae){logger[_0x899e('0x27')](_0x994bae[_0x899e('0x36')]);if(_0x994bae[_0x899e('0x37')]){delete _0x994bae[_0x899e('0x37')];}_0x54b04d[_0x899e('0x2f')](_0x2e61ea)['send'](_0x994bae);};}exports['index']=function(_0x3edfe5,_0x1bf98b){var _0x5b5485={'include':[{'model':db[_0x899e('0x38')],'as':_0x899e('0x39')}]},_0x297908={},_0x42a345={'count':0x0,'rows':[]};var _0x12c526=_[_0x899e('0x3a')](db[_0x899e('0x3b')][_0x899e('0x3c')],function(_0x457742){return{'name':_0x457742[_0x899e('0x3d')],'type':_0x457742['type'][_0x899e('0x3e')]};});_0x297908[_0x899e('0x3f')]=_[_0x899e('0x3a')](_0x12c526,_0x899e('0x37'));_0x297908['query']=_['keys'](_0x3edfe5['query']);_0x297908[_0x899e('0x40')]=_[_0x899e('0x41')](_0x297908[_0x899e('0x3f')],_0x297908['query']);_0x5b5485['attributes']=_[_0x899e('0x41')](_0x297908[_0x899e('0x3f')],qs[_0x899e('0x42')](_0x3edfe5[_0x899e('0x43')][_0x899e('0x42')]));_0x5b5485[_0x899e('0x44')]=_0x5b5485[_0x899e('0x44')][_0x899e('0x45')]?_0x5b5485[_0x899e('0x44')]:_0x297908[_0x899e('0x3f')];if(!_0x3edfe5[_0x899e('0x43')]['hasOwnProperty'](_0x899e('0x46'))){_0x5b5485[_0x899e('0x47')]=qs[_0x899e('0x47')](_0x3edfe5[_0x899e('0x43')]['limit']);_0x5b5485[_0x899e('0x2e')]=qs[_0x899e('0x2e')](_0x3edfe5['query'][_0x899e('0x2e')]);}_0x5b5485[_0x899e('0x48')]=qs[_0x899e('0x49')](_0x3edfe5[_0x899e('0x43')][_0x899e('0x49')]);_0x5b5485[_0x899e('0x4a')]=qs[_0x899e('0x40')](_[_0x899e('0x4b')](_0x3edfe5[_0x899e('0x43')],_0x297908[_0x899e('0x40')]));if(_0x3edfe5[_0x899e('0x43')][_0x899e('0x4c')]){_0x5b5485[_0x899e('0x4a')]=_[_0x899e('0x4d')](_0x5b5485[_0x899e('0x4a')],{'$or':_['map'](_0x12c526,function(_0x263ef9){if(_0x263ef9[_0x899e('0x4e')]!=='VIRTUAL'){var _0x426281={};_0x426281[_0x263ef9['name']]={'$like':'%'+_0x3edfe5[_0x899e('0x43')][_0x899e('0x4c')]+'%'};return _0x426281;}})});}_0x5b5485=_[_0x899e('0x4d')]({},_0x5b5485,_0x3edfe5['options']);var _0x4ec23b={'where':_0x5b5485[_0x899e('0x4a')]};return db[_0x899e('0x3b')]['count'](_0x4ec23b)['then'](function(_0x2ee121){_0x42a345[_0x899e('0x2d')]=_0x2ee121;if(_0x3edfe5[_0x899e('0x43')]['includeAll']){_0x5b5485['include']=[{'all':!![]}];}return db[_0x899e('0x3b')]['findAll'](_0x5b5485);})[_0x899e('0x20')](function(_0x1fb885){_0x42a345[_0x899e('0x4f')]=_0x1fb885;return _0x42a345;})[_0x899e('0x20')](respondWithFilteredResult(_0x1bf98b,_0x5b5485))[_0x899e('0x2a')](handleError(_0x1bf98b,null));};exports[_0x899e('0x50')]=function(_0x2e7765,_0x1c11d1){var _0x2d9be7={'raw':![],'where':{'id':_0x2e7765['params']['id']},'include':[{'model':db[_0x899e('0x38')],'as':_0x899e('0x39')}]},_0x489985={};_0x489985[_0x899e('0x3f')]=_[_0x899e('0x51')](db[_0x899e('0x3b')][_0x899e('0x3c')]);_0x489985[_0x899e('0x43')]=_[_0x899e('0x51')](_0x2e7765[_0x899e('0x43')]);_0x489985[_0x899e('0x40')]=_[_0x899e('0x41')](_0x489985[_0x899e('0x3f')],_0x489985['query']);_0x2d9be7[_0x899e('0x44')]=_['intersection'](_0x489985[_0x899e('0x3f')],qs[_0x899e('0x42')](_0x2e7765[_0x899e('0x43')]['fields']));_0x2d9be7[_0x899e('0x44')]=_0x2d9be7['attributes']['length']?_0x2d9be7[_0x899e('0x44')]:_0x489985[_0x899e('0x3f')];if(_0x2e7765[_0x899e('0x43')][_0x899e('0x52')]){_0x2d9be7[_0x899e('0x53')]=[{'all':!![]}];}_0x2d9be7=_['merge']({},_0x2d9be7,_0x2e7765['options']);return db[_0x899e('0x3b')]['find'](_0x2d9be7)['then'](handleEntityNotFound(_0x1c11d1,null))['then'](respondWithResult(_0x1c11d1,null))[_0x899e('0x2a')](handleError(_0x1c11d1,null));};exports[_0x899e('0x54')]=function(_0x4a209c,_0x12dfe2){return db[_0x899e('0x3b')]['create'](_0x4a209c[_0x899e('0x55')],{})[_0x899e('0x20')](function(_0x2a988c){var _0x279709=_0x4a209c[_0x899e('0x56')][_0x899e('0x33')]({'plain':!![]});if(!_0x279709)throw new Error(_0x899e('0x57'));if(_0x279709[_0x899e('0x58')]===_0x899e('0x56')){var _0x36b633=_0x2a988c['get']({'plain':!![]});var _0x263e08=_0x899e('0x59');return db['UserProfileSection'][_0x899e('0x5a')]({'where':{'name':_0x263e08,'userProfileId':_0x279709[_0x899e('0x5b')]},'raw':!![]})[_0x899e('0x20')](function(_0x1e8c5d){if(_0x1e8c5d&&_0x1e8c5d[_0x899e('0x5c')]===0x0){return db[_0x899e('0x34')][_0x899e('0x54')]({'name':_0x36b633[_0x899e('0x37')],'resourceId':_0x36b633['id'],'type':_0x1e8c5d['name'],'sectionId':_0x1e8c5d['id']},{})['then'](function(){return _0x2a988c;});}else{return _0x2a988c;}})[_0x899e('0x2a')](function(_0x25dd28){logger['error'](_0x899e('0x5d'),_0x25dd28);throw _0x25dd28;});}return _0x2a988c;})[_0x899e('0x20')](respondWithResult(_0x12dfe2,0xc9))[_0x899e('0x2a')](handleError(_0x12dfe2,null));};exports[_0x899e('0x5e')]=function(_0x1265dd,_0x4ba2d4){if(_0x1265dd[_0x899e('0x55')]['id']){delete _0x1265dd['body']['id'];}return db[_0x899e('0x3b')][_0x899e('0x5a')]({'where':{'id':_0x1265dd['params']['id']},'include':[{'model':db[_0x899e('0x38')],'as':'mandatoryDispositionPause'}]})[_0x899e('0x20')](handleEntityNotFound(_0x4ba2d4,null))[_0x899e('0x20')](saveUpdates(_0x1265dd[_0x899e('0x55')],null))['then'](respondWithResult(_0x4ba2d4,null))['catch'](handleError(_0x4ba2d4,null));};exports[_0x899e('0x5f')]=function(_0x2ac5be,_0x39751d){return db[_0x899e('0x3b')][_0x899e('0x5a')]({'where':{'id':_0x2ac5be[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x39751d,null))[_0x899e('0x20')](removeEntity(_0x39751d,null))[_0x899e('0x2a')](handleError(_0x39751d,null));};exports['describe']=function(_0x4b1de1,_0x44e6d8){return db[_0x899e('0x3b')][_0x899e('0x61')]()[_0x899e('0x20')](respondWithResult(_0x44e6d8,null))[_0x899e('0x2a')](handleError(_0x44e6d8,null));};exports['addDisposition']=function(_0x355ca2,_0x25113e,_0x20c5bb){if(_0x355ca2[_0x899e('0x55')]['id']){delete _0x355ca2[_0x899e('0x55')]['id'];}return db['OpenchannelAccount'][_0x899e('0x5a')]({'where':{'id':_0x355ca2[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x25113e,null))[_0x899e('0x20')](function(_0xc6e022){if(_0xc6e022){_0x355ca2[_0x899e('0x55')][_0x899e('0x62')]=_0xc6e022['id'];return db[_0x899e('0x63')][_0x899e('0x54')](_0x355ca2['body']);}})['then'](respondWithResult(_0x25113e,null))[_0x899e('0x2a')](handleError(_0x25113e,null));};exports[_0x899e('0x64')]=function(_0x416d43,_0xaaa8e1,_0x129a1d){var _0x5a7d98={'raw':![],'where':{}};var _0x443611={};var _0x158972={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0x899e('0x65')]({'where':{'id':_0x416d43[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0xaaa8e1,null))[_0x899e('0x20')](function(_0x3166b4){if(_0x3166b4){_0x443611[_0x899e('0x3f')]=_[_0x899e('0x51')](db[_0x899e('0x63')][_0x899e('0x3c')]);_0x443611[_0x899e('0x43')]=_[_0x899e('0x51')](_0x416d43[_0x899e('0x43')]);_0x443611[_0x899e('0x40')]=_[_0x899e('0x41')](_0x443611[_0x899e('0x3f')],_0x443611['query']);_0x5a7d98[_0x899e('0x44')]=_['intersection'](_0x443611[_0x899e('0x3f')],qs[_0x899e('0x42')](_0x416d43[_0x899e('0x43')][_0x899e('0x42')]));_0x5a7d98[_0x899e('0x44')]=_0x5a7d98['attributes']['length']?_0x5a7d98[_0x899e('0x44')]:_0x443611[_0x899e('0x3f')];if(!_0x416d43[_0x899e('0x43')][_0x899e('0x66')](_0x899e('0x46'))){_0x5a7d98[_0x899e('0x47')]=qs[_0x899e('0x47')](_0x416d43['query'][_0x899e('0x47')]);_0x5a7d98[_0x899e('0x2e')]=qs['offset'](_0x416d43['query'][_0x899e('0x2e')]);}_0x5a7d98['order']=qs[_0x899e('0x49')](_0x416d43[_0x899e('0x43')][_0x899e('0x49')]);_0x5a7d98[_0x899e('0x4a')]=qs[_0x899e('0x40')](_[_0x899e('0x4b')](_0x416d43[_0x899e('0x43')],_0x443611[_0x899e('0x40')]));_0x5a7d98['where'][_0x899e('0x67')]=_0x3166b4['id'];if(_0x416d43['query']['filter']){_0x5a7d98['where']=_[_0x899e('0x4d')](_0x5a7d98[_0x899e('0x4a')],{'$or':_['map'](_0x5a7d98[_0x899e('0x44')],function(_0x5b40f8){var _0x2c0bb0={};_0x2c0bb0[_0x5b40f8]={'$like':'%'+_0x416d43['query'][_0x899e('0x4c')]+'%'};return _0x2c0bb0;})});}_0x5a7d98=_[_0x899e('0x4d')]({},_0x5a7d98,_0x416d43[_0x899e('0x68')]);return db[_0x899e('0x63')][_0x899e('0x2d')]({'where':_0x5a7d98['where']})['then'](function(_0x32fc4e){_0x158972[_0x899e('0x2d')]=_0x32fc4e;if(_0x416d43['query'][_0x899e('0x52')]){_0x5a7d98[_0x899e('0x53')]=[{'all':!![]}];}return db['Disposition'][_0x899e('0x69')](_0x5a7d98);})[_0x899e('0x20')](function(_0xa9871b){_0x158972['rows']=_0xa9871b;return _0x158972;});}})['then'](respondWithFilteredResult(_0xaaa8e1,_0x5a7d98))[_0x899e('0x2a')](handleError(_0xaaa8e1,null));};exports[_0x899e('0x6a')]=function(_0x53bdef,_0x66aa3b,_0x261ef4){return db[_0x899e('0x3b')][_0x899e('0x5a')]({'where':{'id':_0x53bdef[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x66aa3b,null))[_0x899e('0x20')](function(_0xb6475c){if(_0xb6475c){return _0xb6475c[_0x899e('0x6a')](_0x53bdef[_0x899e('0x43')]['ids']);}})['then'](respondWithStatusCode(_0x66aa3b,null))[_0x899e('0x2a')](handleError(_0x66aa3b,null));};exports[_0x899e('0x6b')]=function(_0x2b4cd7,_0x45a192,_0x35e137){if(_0x2b4cd7[_0x899e('0x55')]['id']){delete _0x2b4cd7['body']['id'];}return db[_0x899e('0x3b')][_0x899e('0x5a')]({'where':{'id':_0x2b4cd7[_0x899e('0x60')]['id']}})['then'](handleEntityNotFound(_0x45a192,null))[_0x899e('0x20')](function(_0x49a7e8){if(_0x49a7e8){_0x2b4cd7[_0x899e('0x55')][_0x899e('0x67')]=_0x49a7e8['id'];return db[_0x899e('0x6c')]['create'](_0x2b4cd7[_0x899e('0x55')]);}})[_0x899e('0x20')](respondWithResult(_0x45a192,null))[_0x899e('0x2a')](handleError(_0x45a192,null));};exports[_0x899e('0x6d')]=function(_0x138f1a,_0x39221b,_0x53475c){var _0x27f6a3={'raw':![],'where':{}};var _0x13fe02={};var _0x46c6f3={'count':0x0,'rows':[]};return db[_0x899e('0x3b')][_0x899e('0x65')]({'where':{'id':_0x138f1a['params']['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x39221b,null))[_0x899e('0x20')](function(_0x1ca4b7){if(_0x1ca4b7){_0x13fe02[_0x899e('0x3f')]=_[_0x899e('0x51')](db['CannedAnswer']['rawAttributes']);_0x13fe02[_0x899e('0x43')]=_[_0x899e('0x51')](_0x138f1a['query']);_0x13fe02['filters']=_[_0x899e('0x41')](_0x13fe02[_0x899e('0x3f')],_0x13fe02['query']);_0x27f6a3['attributes']=_[_0x899e('0x41')](_0x13fe02[_0x899e('0x3f')],qs['fields'](_0x138f1a[_0x899e('0x43')][_0x899e('0x42')]));_0x27f6a3[_0x899e('0x44')]=_0x27f6a3['attributes'][_0x899e('0x45')]?_0x27f6a3[_0x899e('0x44')]:_0x13fe02[_0x899e('0x3f')];if(!_0x138f1a[_0x899e('0x43')][_0x899e('0x66')](_0x899e('0x46'))){_0x27f6a3[_0x899e('0x47')]=qs['limit'](_0x138f1a['query'][_0x899e('0x47')]);_0x27f6a3[_0x899e('0x2e')]=qs['offset'](_0x138f1a[_0x899e('0x43')][_0x899e('0x2e')]);}_0x27f6a3[_0x899e('0x48')]=qs[_0x899e('0x49')](_0x138f1a[_0x899e('0x43')][_0x899e('0x49')]);_0x27f6a3['where']=qs['filters'](_['pick'](_0x138f1a[_0x899e('0x43')],_0x13fe02[_0x899e('0x40')]));_0x27f6a3[_0x899e('0x4a')][_0x899e('0x67')]=_0x1ca4b7['id'];if(_0x138f1a[_0x899e('0x43')][_0x899e('0x4c')]){_0x27f6a3[_0x899e('0x4a')]=_[_0x899e('0x4d')](_0x27f6a3['where'],{'$or':_['map'](_0x27f6a3[_0x899e('0x44')],function(_0x2c38f3){var _0x33af0f={};_0x33af0f[_0x2c38f3]={'$like':'%'+_0x138f1a['query'][_0x899e('0x4c')]+'%'};return _0x33af0f;})});}_0x27f6a3=_[_0x899e('0x4d')]({},_0x27f6a3,_0x138f1a[_0x899e('0x68')]);return db[_0x899e('0x6c')][_0x899e('0x2d')]({'where':_0x27f6a3[_0x899e('0x4a')]})[_0x899e('0x20')](function(_0x5b565e){_0x46c6f3[_0x899e('0x2d')]=_0x5b565e;if(_0x138f1a[_0x899e('0x43')][_0x899e('0x52')]){_0x27f6a3['include']=[{'all':!![]}];}return db['CannedAnswer'][_0x899e('0x69')](_0x27f6a3);})[_0x899e('0x20')](function(_0x40a59e){_0x46c6f3[_0x899e('0x4f')]=_0x40a59e;return _0x46c6f3;});}})['then'](respondWithFilteredResult(_0x39221b,_0x27f6a3))[_0x899e('0x2a')](handleError(_0x39221b,null));};exports[_0x899e('0x6e')]=function(_0x357aa0,_0x27a62b,_0x5649f5){return db[_0x899e('0x3b')]['find']({'where':{'id':_0x357aa0[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x27a62b,null))[_0x899e('0x20')](function(_0x5beea6){if(_0x5beea6){return _0x5beea6['removeAnswers'](_0x357aa0['query'][_0x899e('0x6f')]);}})[_0x899e('0x20')](respondWithStatusCode(_0x27a62b,null))[_0x899e('0x2a')](handleError(_0x27a62b,null));};exports[_0x899e('0x70')]=function(_0x3de8af,_0x32d8cd,_0x4f9bbc){var _0x4ae656={'body':_0x3de8af[_0x899e('0x55')],'channel':_0x899e('0x71')};var _0x15b886=[];var _0xcefc8e=[];var _0x1d995f={};var _0x30a55a=![];return db[_0x899e('0x72')][_0x899e('0x61')]()[_0x899e('0x20')](function(_0x486e8c){if(!_0x486e8c){throw new db['Sequelize'][(_0x899e('0x1d'))](_0x899e('0x73'));}_0x15b886=_[_0x899e('0x74')](_['keys'](_0x486e8c),[_0x899e('0x75'),_0x899e('0x76')]);_0xcefc8e=_['difference'](_[_0x899e('0x51')](_0x486e8c),[_0x899e('0x75'),_0x899e('0x76'),_0x899e('0x77'),_0x899e('0x78')]);if(_0x3de8af['body']['id']){delete _0x3de8af[_0x899e('0x55')]['id'];}if(_[_0x899e('0x79')](_0x3de8af['body']['from'])){throw new db[(_0x899e('0x1c'))][(_0x899e('0x1d'))](_0x899e('0x7a'));}if(_[_0x899e('0x79')](_0x3de8af[_0x899e('0x55')][_0x899e('0x55')])||_0x3de8af[_0x899e('0x55')][_0x899e('0x55')]===''){throw new db[(_0x899e('0x1c'))][(_0x899e('0x1d'))](_0x899e('0x7b'));}if(_[_0x899e('0x79')](_0x3de8af['body'][_0x899e('0x7c')])){throw new db[(_0x899e('0x1c'))][(_0x899e('0x1d'))](_0x899e('0x7d')+_0xcefc8e);}if(!_[_0x899e('0x7e')](_0xcefc8e,_0x3de8af[_0x899e('0x55')][_0x899e('0x7c')])){throw new db[(_0x899e('0x1c'))]['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0xcefc8e);}_0x1d995f[_0x3de8af[_0x899e('0x55')]['mapKey']]=_0x3de8af[_0x899e('0x55')]['from'];})[_0x899e('0x20')](function(){return db['OpenchannelAccount'][_0x899e('0x5a')]({'where':{'id':_0x3de8af[_0x899e('0x60')]['id']},'include':[{'model':db[_0x899e('0x7f')],'as':_0x899e('0x80'),'include':[{'model':db['CmContact'],'as':_0x899e('0x81'),'where':_0x1d995f,'limit':0x1,'order':[[_0x899e('0x76'),_0x899e('0x82')]]}]},{'model':db['OpenchannelApplication'],'as':'Applications'}]});})[_0x899e('0x20')](handleEntityNotFound(_0x32d8cd,null))['then'](function(_0xf314b5){if(_0xf314b5&&_0xf314b5[_0x899e('0x80')]){_0x4ae656['account']=_0xf314b5;_0x4ae656['applications']=_0xf314b5[_0x899e('0x83')];_0x4ae656[_0x899e('0x84')]=_0xf314b5[_0x899e('0x80')];_0x4ae656[_0x899e('0x85')]=_['orderBy'](_0x4ae656['applications'],[_0x899e('0x86')],[_0x899e('0x87')]);if(_0x4ae656['account'][_0x899e('0x83')]){delete _0x4ae656['account'][_0x899e('0x83')];}if(_0x4ae656[_0x899e('0x88')]['List']&&_0x4ae656[_0x899e('0x88')]['List']['Contacts'][_0x899e('0x45')]){return _0x4ae656['account']['List']['Contacts'][0x0];}var _0x2e6bf4=_['defaults'](_0x3de8af['body'],{'firstName':_0x3de8af[_0x899e('0x55')][_0x899e('0x89')],'ListId':_0xf314b5[_0x899e('0x78')]});_0x2e6bf4[_0x3de8af[_0x899e('0x55')][_0x899e('0x7c')]]=_0x3de8af[_0x899e('0x55')][_0x899e('0x89')];return db[_0x899e('0x72')][_0x899e('0x54')](_0x2e6bf4,{'fields':_0x15b886,'raw':!![]});}})[_0x899e('0x20')](handleEntityNotFound(_0x32d8cd,null))[_0x899e('0x20')](function(_0x821569){_0x4ae656[_0x899e('0x8a')]=_0x821569;if(_0x821569){var _0x1a6d53={'ContactId':_0x821569['id'],'OpenchannelAccountId':_0x3de8af['params']['id'],'from':(_0x821569[_0x899e('0x8b')]||'')+'\x20'+(_0x821569['lastName']||'')};var _0x239560={'OpenchannelAccountId':_0x3de8af['params']['id'],'closed':![]};if(_0x3de8af[_0x899e('0x55')]['threadId']){_0x239560[_0x899e('0x8c')]=_0x3de8af[_0x899e('0x55')]['threadId'];return db[_0x899e('0x8d')]['find']({'where':_0x239560})[_0x899e('0x20')](function(_0x2934f0){if(_0x2934f0){return[_0x2934f0,![]];}_0x1a6d53[_0x899e('0x8c')]=_0x3de8af[_0x899e('0x55')][_0x899e('0x8c')];_0x1a6d53[_0x899e('0x8e')]=_0x3de8af[_0x899e('0x55')][_0x899e('0x8e')];return db['OpenchannelInteraction'][_0x899e('0x54')](_0x1a6d53)[_0x899e('0x20')](function(_0x2f39f5){return[_0x2f39f5,!![]];});});}else{_0x239560[_0x899e('0x8c')]=null;}_0x239560[_0x899e('0x8f')]=_0x821569['id'];return db['OpenchannelInteraction'][_0x899e('0x5a')]({'where':_0x239560})[_0x899e('0x20')](function(_0x4515fe){if(_0x4515fe){return[_0x4515fe,![]];}return db[_0x899e('0x8d')]['create'](_0x1a6d53)[_0x899e('0x20')](function(_0x54fe9a){return[_0x54fe9a,!![]];});});}})['spread'](function(_0x1e1a5b,_0x28ba97){if(_0x1e1a5b){_0x30a55a=_0x28ba97;if(!_0x28ba97){var _0x16f178={'from':(_0x4ae656[_0x899e('0x8a')][_0x899e('0x8b')]||'')+'\x20'+(_0x4ae656[_0x899e('0x8a')][_0x899e('0x90')]||'')};if(_0x3de8af[_0x899e('0x55')][_0x899e('0x8c')]&&_0x3de8af[_0x899e('0x55')][_0x899e('0x91')]&&_0x3de8af['body'][_0x899e('0x8c')]!=_0x3de8af[_0x899e('0x55')][_0x899e('0x91')]){_0x16f178[_0x899e('0x8c')]=_0x3de8af['body'][_0x899e('0x91')];}return _0x1e1a5b[_0x899e('0x5e')](_0x16f178);}else{return _0x1e1a5b;}}})[_0x899e('0x20')](function(_0x16f117){_0x4ae656['interaction']=_0x16f117[_0x899e('0x33')]({'plain':!![]});_0x4ae656[_0x899e('0x92')]['created']=_0x30a55a;if(_0x4ae656[_0x899e('0x92')][_0x899e('0x93')]){if(_0x4ae656[_0x899e('0x88')][_0x899e('0x94')]){_0x4ae656[_0x899e('0x85')][_0x899e('0x95')]({'id':0x0,'priority':_0x4ae656[_0x899e('0x85')][_0x899e('0x45')]+0x1,'app':_0x899e('0x96'),'appdata':'unmanaged','interval':_0x899e('0x97')});}}return db[_0x899e('0x98')][_0x899e('0x54')]({'body':_0x3de8af[_0x899e('0x55')][_0x899e('0x55')],'OpenchannelAccountId':_0x3de8af[_0x899e('0x60')]['id'],'OpenchannelInteractionId':_0x16f117['id'],'direction':'in','ContactId':_0x4ae656[_0x899e('0x8a')]['id'],'AttachmentId':_0x3de8af['body'][_0x899e('0x99')]});})[_0x899e('0x20')](function(_0x2d12d0){_0x4ae656[_0x899e('0x29')]=_0x2d12d0;if(_0x4ae656[_0x899e('0x92')]['UserId']){return db[_0x899e('0x9a')][_0x899e('0x5a')]({'attributes':['id',_0x899e('0x37')],'where':{'id':_0x4ae656['interaction']['UserId']}})[_0x899e('0x20')](function(_0x4bc04c){if(_0x4bc04c){_0x4ae656['applications'][_0x899e('0x9b')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x4bc04c[_0x899e('0x37')]+','+(_0x4ae656[_0x899e('0x88')][_0x899e('0x9c')]||0xa),'interval':_0x899e('0x97')});_0x4ae656[_0x899e('0x9d')]=![];}return respondWithRpcPromise(_0x899e('0x9e'),_0x899e('0x9f'),_0x4ae656);});}return respondWithRpcPromise(_0x899e('0x9e'),_0x899e('0x9f'),_0x4ae656);})['then'](function(_0x1a5f7a){respondWithRpcPromise('EventManager','EventManager',{'event':_0x899e('0x70'),'message':_0x1a5f7a},client9002);return _0x1a5f7a;})[_0x899e('0x20')](respondWithResult(_0x32d8cd,null))[_0x899e('0x2a')](handleError(_0x32d8cd,null));};exports[_0x899e('0xa0')]=function(_0x20b26d,_0x16b378,_0x214cb2){return db[_0x899e('0x3b')][_0x899e('0x65')]({'where':{'id':_0x20b26d[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x16b378,null))['then'](function(_0x4904b0){if(_0x4904b0){return db[_0x899e('0xa1')][_0x899e('0xa2')](function(_0x3db665){return db['OpenchannelApplication'][_0x899e('0x5f')]({'where':{'OpenchannelAccountId':_0x20b26d[_0x899e('0x60')]['id']},'transaction':_0x3db665})[_0x899e('0x20')](function(_0x53ab06){var _0x161578=_['map'](_0x20b26d[_0x899e('0x55')],function(_0x16c6fc){_0x16c6fc[_0x899e('0x67')]=_0x20b26d[_0x899e('0x60')]['id'];return _0x16c6fc;});return db['OpenchannelApplication']['bulkCreate'](_0x161578,{'transaction':_0x3db665});});})[_0x899e('0x20')](function(){return db[_0x899e('0xa3')][_0x899e('0xa4')]({'where':{'OpenchannelAccountId':_0x20b26d['params']['id']},'order':_0x899e('0x86')});});}})[_0x899e('0x20')](respondWithResult(_0x16b378,null))['catch'](handleError(_0x16b378,null));};exports['getApplications']=function(_0x14ef81,_0x30d715,_0x2594df){var _0x2663f0={};var _0x3ac703={};var _0x2b4a14;var _0x275ed5;return db[_0x899e('0x3b')][_0x899e('0x65')]({'where':{'id':_0x14ef81['params']['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x30d715,null))[_0x899e('0x20')](function(_0x5af9f7){if(_0x5af9f7){_0x2b4a14=_0x5af9f7;_0x3ac703[_0x899e('0x3f')]=_[_0x899e('0x51')](db[_0x899e('0xa3')][_0x899e('0x3c')]);_0x3ac703[_0x899e('0x43')]=_[_0x899e('0x51')](_0x14ef81[_0x899e('0x43')]);_0x3ac703[_0x899e('0x40')]=_[_0x899e('0x41')](_0x3ac703[_0x899e('0x3f')],_0x3ac703['query']);_0x2663f0[_0x899e('0x44')]=_[_0x899e('0x41')](_0x3ac703[_0x899e('0x3f')],qs['fields'](_0x14ef81[_0x899e('0x43')][_0x899e('0x42')]));_0x2663f0[_0x899e('0x44')]=_0x2663f0[_0x899e('0x44')]['length']?_0x2663f0[_0x899e('0x44')]:_0x3ac703['model'];_0x2663f0[_0x899e('0x48')]=qs['sort'](_0x14ef81[_0x899e('0x43')]['sort']);_0x2663f0[_0x899e('0x4a')]=qs['filters'](_[_0x899e('0x4b')](_0x14ef81[_0x899e('0x43')],_0x3ac703[_0x899e('0x40')]));if(_0x14ef81['query']['filter']){_0x2663f0[_0x899e('0x4a')]=_['merge'](_0x2663f0['where'],{'$or':_[_0x899e('0x3a')](_0x2663f0[_0x899e('0x44')],function(_0x22931b){var _0x31f8e5={};_0x31f8e5[_0x22931b]={'$like':'%'+_0x14ef81[_0x899e('0x43')][_0x899e('0x4c')]+'%'};return _0x31f8e5;})});}_0x2663f0=_['merge']({},_0x2663f0,_0x14ef81['options']);return _0x2b4a14[_0x899e('0xa5')](_0x2663f0);}})[_0x899e('0x20')](function(_0x1232eb){if(_0x1232eb){_0x275ed5=_0x1232eb[_0x899e('0x45')];if(!_0x14ef81[_0x899e('0x43')][_0x899e('0x66')](_0x899e('0x46'))){_0x2663f0[_0x899e('0x47')]=qs[_0x899e('0x47')](_0x14ef81[_0x899e('0x43')][_0x899e('0x47')]);_0x2663f0[_0x899e('0x2e')]=qs[_0x899e('0x2e')](_0x14ef81['query'][_0x899e('0x2e')]);}return _0x2b4a14[_0x899e('0xa5')](_0x2663f0);}})['then'](function(_0x4fa065){if(_0x4fa065){return _0x4fa065?{'count':_0x275ed5,'rows':_0x4fa065}:null;}})['then'](respondWithResult(_0x30d715,null))[_0x899e('0x2a')](handleError(_0x30d715,null));};exports[_0x899e('0xa6')]=function(_0x4689ca,_0x98aac6,_0x3b2edf){var _0x2cbebd={'raw':![],'where':{}};var _0x306e21={};var _0x1ebba8={'count':0x0,'rows':[]};return db[_0x899e('0x3b')]['findOne']({'where':{'id':_0x4689ca[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x98aac6,null))['then'](function(_0x1ff873){if(_0x1ff873){_0x306e21['model']=_[_0x899e('0x51')](db['OpenchannelInteraction'][_0x899e('0x3c')]);_0x306e21[_0x899e('0x43')]=_[_0x899e('0x51')](_0x4689ca[_0x899e('0x43')]);_0x306e21[_0x899e('0x40')]=_['intersection'](_0x306e21['model'],_0x306e21[_0x899e('0x43')]);_0x2cbebd[_0x899e('0x44')]=_['intersection'](_0x306e21[_0x899e('0x3f')],qs[_0x899e('0x42')](_0x4689ca[_0x899e('0x43')]['fields']));_0x2cbebd['attributes']=_0x2cbebd[_0x899e('0x44')]['length']?_0x2cbebd['attributes']:_0x306e21['model'];if(!_0x4689ca['query'][_0x899e('0x66')](_0x899e('0x46'))){_0x2cbebd[_0x899e('0x47')]=qs[_0x899e('0x47')](_0x4689ca[_0x899e('0x43')][_0x899e('0x47')]);_0x2cbebd[_0x899e('0x2e')]=qs[_0x899e('0x2e')](_0x4689ca[_0x899e('0x43')]['offset']);}_0x2cbebd[_0x899e('0x48')]=qs[_0x899e('0x49')](_0x4689ca['query'][_0x899e('0x49')]);_0x2cbebd[_0x899e('0x4a')]=qs[_0x899e('0x40')](_[_0x899e('0x4b')](_0x4689ca[_0x899e('0x43')],_0x306e21[_0x899e('0x40')]));_0x2cbebd[_0x899e('0x4a')][_0x899e('0x67')]=_0x1ff873['id'];if(_0x4689ca[_0x899e('0x43')][_0x899e('0x4c')]){_0x2cbebd[_0x899e('0x4a')]=_[_0x899e('0x4d')](_0x2cbebd[_0x899e('0x4a')],{'$or':_[_0x899e('0x3a')](_0x2cbebd[_0x899e('0x44')],function(_0xf77a75){var _0x269536={};_0x269536[_0xf77a75]={'$like':'%'+_0x4689ca[_0x899e('0x43')][_0x899e('0x4c')]+'%'};return _0x269536;})});}_0x2cbebd=_['merge']({},_0x2cbebd,_0x4689ca[_0x899e('0x68')]);return db['OpenchannelInteraction']['count']({'where':_0x2cbebd[_0x899e('0x4a')]})['then'](function(_0x450ed2){_0x1ebba8['count']=_0x450ed2;if(_0x4689ca[_0x899e('0x43')][_0x899e('0x52')]){_0x2cbebd[_0x899e('0x53')]=[{'model':db[_0x899e('0x72')],'as':_0x899e('0xa7'),'required':![]},{'model':db[_0x899e('0x9a')],'as':_0x899e('0xa8'),'attributes':[_0x899e('0x37'),_0x899e('0xa9'),_0x899e('0xaa')],'required':![]},{'model':db[_0x899e('0xab')],'as':_0x899e('0xac'),'attributes':['id',_0x899e('0x37'),_0x899e('0xad')],'where':_0x4689ca[_0x899e('0x43')][_0x899e('0xae')]?{'id':_0x4689ca[_0x899e('0x43')][_0x899e('0xae')]}:undefined,'required':_0x4689ca[_0x899e('0x43')][_0x899e('0xae')]?!![]:![]}];}return db['OpenchannelInteraction'][_0x899e('0x69')](_0x2cbebd);})[_0x899e('0x20')](function(_0x57028b){_0x1ebba8[_0x899e('0x4f')]=_0x57028b;return _0x1ebba8;});}})[_0x899e('0x20')](respondWithFilteredResult(_0x98aac6,_0x2cbebd))['catch'](handleError(_0x98aac6,null));};exports[_0x899e('0xaf')]=function(_0xf6740f,_0x57abde,_0x31d5bb){return db[_0x899e('0x3b')][_0x899e('0x5a')]({'where':{'id':_0xf6740f[_0x899e('0x60')]['id']}})['then'](handleEntityNotFound(_0x57abde,null))[_0x899e('0x20')](function(_0x54f08f){if(_0x54f08f){return _0x54f08f[_0x899e('0xaf')](_0xf6740f[_0x899e('0x55')][_0x899e('0x6f')],_['omit'](_0xf6740f[_0x899e('0x55')],[_0x899e('0x6f'),'id'])||{})[_0x899e('0xb0')](function(_0x2f74e7){for(var _0x4d8285=0x0;_0x4d8285<_0xf6740f[_0x899e('0x55')][_0x899e('0x6f')][_0x899e('0x45')];_0x4d8285+=0x1){socket[_0x899e('0xb1')](_0x899e('0xb2'),{'UserId':_0xf6740f[_0x899e('0x55')][_0x899e('0x6f')][_0x4d8285],'OpenchannelAccountId':_0xf6740f[_0x899e('0x60')]['id']});}return _0x2f74e7;});}})['then'](respondWithResult(_0x57abde,null))[_0x899e('0x2a')](handleError(_0x57abde,null));};exports[_0x899e('0xb3')]=function(_0x5ac34f,_0x25df75,_0x545613){return db[_0x899e('0x3b')]['find']({'where':{'id':_0x5ac34f['params']['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x25df75,null))['then'](function(_0x1ee0ee){if(_0x1ee0ee){return _0x1ee0ee[_0x899e('0xb3')](_0x5ac34f['query'][_0x899e('0x6f')])[_0x899e('0x20')](function(){if(_[_0x899e('0xb4')](_0x5ac34f[_0x899e('0x43')][_0x899e('0x6f')])){for(var _0x4bbbdf=0x0;_0x4bbbdf<_0x5ac34f['query'][_0x899e('0x6f')][_0x899e('0x45')];_0x4bbbdf+=0x1){socket[_0x899e('0xb1')](_0x899e('0xb5'),{'UserId':Number(_0x5ac34f[_0x899e('0x43')][_0x899e('0x6f')][_0x4bbbdf]),'OpenchannelAccountId':Number(_0x5ac34f[_0x899e('0x60')]['id'])});}}else{socket[_0x899e('0xb1')](_0x899e('0xb5'),{'UserId':Number(_0x5ac34f[_0x899e('0x43')][_0x899e('0x6f')]),'OpenchannelAccountId':Number(_0x5ac34f[_0x899e('0x60')]['id'])});}});}})[_0x899e('0x20')](respondWithStatusCode(_0x25df75,null))[_0x899e('0x2a')](handleError(_0x25df75,null));};exports[_0x899e('0xb6')]=function(_0x56df01,_0x54ca45,_0x5037f5){var _0x29a89c={};var _0x2f31ee={};var _0x22480b;var _0x4fd3b1;return db[_0x899e('0x3b')][_0x899e('0x65')]({'where':{'id':_0x56df01[_0x899e('0x60')]['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x54ca45,null))['then'](function(_0x58f30f){if(_0x58f30f){_0x22480b=_0x58f30f;_0x2f31ee[_0x899e('0x3f')]=_[_0x899e('0x51')](db[_0x899e('0x9a')][_0x899e('0x3c')]);_0x2f31ee[_0x899e('0x43')]=_[_0x899e('0x51')](_0x56df01[_0x899e('0x43')]);_0x2f31ee[_0x899e('0x40')]=_[_0x899e('0x41')](_0x2f31ee[_0x899e('0x3f')],_0x2f31ee['query']);_0x29a89c[_0x899e('0x44')]=_[_0x899e('0x41')](_0x2f31ee[_0x899e('0x3f')],qs['fields'](_0x56df01[_0x899e('0x43')][_0x899e('0x42')]));_0x29a89c[_0x899e('0x44')]=_0x29a89c[_0x899e('0x44')][_0x899e('0x45')]?_0x29a89c[_0x899e('0x44')]:_0x2f31ee[_0x899e('0x3f')];_0x29a89c[_0x899e('0x48')]=qs['sort'](_0x56df01[_0x899e('0x43')]['sort']);_0x29a89c['where']=qs[_0x899e('0x40')](_[_0x899e('0x4b')](_0x56df01['query'],_0x2f31ee[_0x899e('0x40')]));if(_0x56df01['query'][_0x899e('0x4c')]){_0x29a89c[_0x899e('0x4a')]=_[_0x899e('0x4d')](_0x29a89c[_0x899e('0x4a')],{'$or':_[_0x899e('0x3a')](_0x29a89c[_0x899e('0x44')],function(_0x1721e2){var _0x7e8ace={};_0x7e8ace[_0x1721e2]={'$like':'%'+_0x56df01[_0x899e('0x43')]['filter']+'%'};return _0x7e8ace;})});}_0x29a89c=_[_0x899e('0x4d')]({},_0x29a89c,_0x56df01[_0x899e('0x68')]);return _0x22480b[_0x899e('0xb6')](_0x29a89c);}})[_0x899e('0x20')](function(_0x217b02){if(_0x217b02){_0x4fd3b1=_0x217b02[_0x899e('0x45')];if(!_0x56df01[_0x899e('0x43')]['hasOwnProperty'](_0x899e('0x46'))){_0x29a89c[_0x899e('0x47')]=qs[_0x899e('0x47')](_0x56df01['query'][_0x899e('0x47')]);_0x29a89c[_0x899e('0x2e')]=qs['offset'](_0x56df01[_0x899e('0x43')][_0x899e('0x2e')]);}return _0x22480b['getAgents'](_0x29a89c);}})[_0x899e('0x20')](function(_0x58ba41){if(_0x58ba41){return _0x58ba41?{'count':_0x4fd3b1,'rows':_0x58ba41}:null;}})[_0x899e('0x20')](respondWithResult(_0x54ca45,null))[_0x899e('0x2a')](handleError(_0x54ca45,null));};exports[_0x899e('0xb7')]=function(_0x2a6113,_0x39188b,_0x848810){var _0x1b76da,_0x25e99f,_0x3f5f4b;if(_[_0x899e('0x79')](_0x2a6113[_0x899e('0x55')][_0x899e('0x55')])||_0x2a6113[_0x899e('0x55')][_0x899e('0x55')]===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x899e('0x79')](_0x2a6113['body']['to'])){}_0x1b76da=_0x2a6113[_0x899e('0x55')]['to'];return db[_0x899e('0x3b')][_0x899e('0x65')]({'where':{'id':_0x2a6113['params']['id']}})[_0x899e('0x20')](handleEntityNotFound(_0x39188b,null))[_0x899e('0x20')](function(_0x10a968){if(_0x10a968){return db[_0x899e('0x3b')]['find']({'where':{'id':_0x10a968['id']},'include':[{'model':db[_0x899e('0x7f')],'as':_0x899e('0x80'),'include':[{'model':db['CmContact'],'as':_0x899e('0x81'),'where':{[_0x10a968[_0x899e('0x7c')]]:_0x1b76da},'limit':0x1,'order':[[_0x899e('0x76'),_0x899e('0x82')]]}]}]})[_0x899e('0x20')](handleEntityNotFound(_0x39188b,null))[_0x899e('0x20')](function(_0x273139){if(_0x273139&&_0x273139[_0x899e('0x80')]){_0x25e99f=_0x273139['get']({'plain':!![]});if(_0x25e99f[_0x899e('0x80')]&&_0x25e99f[_0x899e('0x80')][_0x899e('0x81')][_0x899e('0x45')]){return _0x25e99f['List'][_0x899e('0x81')][0x0];}return db['CmContact'][_0x899e('0x54')](_[_0x899e('0xb8')](_0x2a6113[_0x899e('0x55')],{'firstName':_0x1b76da,[_0x273139[_0x899e('0x7c')]]:_0x1b76da,'phone':_0x1b76da,'ListId':_0x25e99f[_0x899e('0x78')]}));}})[_0x899e('0x20')](handleEntityNotFound(_0x39188b,null))[_0x899e('0x20')](function(_0x530e89){if(_0x530e89){_0x3f5f4b=_0x530e89;return db['OpenchannelInteraction']['find']({'where':{'ContactId':_0x3f5f4b['id'],'closed':![],'OpenchannelAccountId':_0x25e99f['id']}})[_0x899e('0x20')](function(_0x397c9b){if(_0x397c9b){return[_0x397c9b,![]];}return db['OpenchannelInteraction'][_0x899e('0x54')]({'UserId':_0x2a6113['user']['id'],'ContactId':_0x3f5f4b['id'],'OpenchannelAccountId':_0x25e99f['id'],'lastMsgDirection':_0x899e('0xb9'),'Messages':[_[_0x899e('0x4d')](_0x2a6113[_0x899e('0x55')],{'read':![],'body':_0x2a6113['body'][_0x899e('0x55')],'OpenchannelAccountId':_0x25e99f['id'],'UserId':_0x2a6113['user']['id'],'ContactId':_0x3f5f4b['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':_0x899e('0xba')}]})[_0x899e('0x20')](function(_0x3d6774){return[_0x3d6774,!![]];});});}})[_0x899e('0xb0')](function(_0x510b34,_0x2ba034){if(_0x2ba034){return _0x510b34;}return db['OpenchannelMessage'][_0x899e('0x54')](_[_0x899e('0x4d')](_0x2a6113[_0x899e('0x55')],{'read':![],'body':_0x2a6113['body']['body'],'OpenchannelAccountId':_0x25e99f['id'],'OpenchannelInteractionId':_0x510b34['id'],'UserId':_0x2a6113[_0x899e('0x56')]['id'],'ContactId':_0x3f5f4b['id']}))[_0x899e('0x20')](function(_0x1323f7){_0x510b34[_0x899e('0xbb')][_0x899e('0xba')]=[];_0x510b34[_0x899e('0xbb')][_0x899e('0xba')][_0x899e('0x95')](_0x1323f7[_0x899e('0xbb')]);return _0x510b34;});});}})[_0x899e('0x20')](respondWithResult(_0x39188b,null))[_0x899e('0x2a')](handleError(_0x39188b,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 30c5e7c..f9a3437 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 _0x90cd=['hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','remove','emit'];(function(_0x374ccf,_0xa945c4){var _0x443cde=function(_0x27ff10){while(--_0x27ff10){_0x374ccf['push'](_0x374ccf['shift']());}};_0x443cde(++_0xa945c4);}(_0x90cd,0x1d1));var _0xd90c=function(_0x55472d,_0x32e784){_0x55472d=_0x55472d-0x0;var _0x31a336=_0x90cd[_0x55472d];return _0x31a336;};'use strict';var EventEmitter=require(_0xd90c('0x0'));var OpenchannelAccount=require(_0xd90c('0x1'))['db'][_0xd90c('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xd90c('0x3')](0x0);var events={'afterCreate':_0xd90c('0x4'),'afterUpdate':_0xd90c('0x5'),'afterDestroy':_0xd90c('0x6')};function emitEvent(_0x38aaa7){return function(_0x122080,_0x20da71,_0xe8a1a){OpenchannelAccountEvents[_0xd90c('0x7')](_0x38aaa7+':'+_0x122080['id'],_0x122080);OpenchannelAccountEvents[_0xd90c('0x7')](_0x38aaa7,_0x122080);_0xe8a1a(null);};}for(var e in events){if(events[_0xd90c('0x8')](e)){var event=events[e];OpenchannelAccount[_0xd90c('0x9')](e,emitEvent(event));}}module[_0xd90c('0xa')]=OpenchannelAccountEvents; \ No newline at end of file +var _0xbb1e=['update','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelAccount','setMaxListeners','save'];(function(_0x1dad2e,_0x3012e8){var _0x136d10=function(_0x57ddeb){while(--_0x57ddeb){_0x1dad2e['push'](_0x1dad2e['shift']());}};_0x136d10(++_0x3012e8);}(_0xbb1e,0x148));var _0xebb1=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xbb1e[_0x1ac595];return _0x455fff;};'use strict';var EventEmitter=require(_0xebb1('0x0'));var OpenchannelAccount=require(_0xebb1('0x1'))['db'][_0xebb1('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xebb1('0x3')](0x0);var events={'afterCreate':_0xebb1('0x4'),'afterUpdate':_0xebb1('0x5'),'afterDestroy':'remove'};function emitEvent(_0x509592){return function(_0x192180,_0x2b65a4,_0x357f6a){OpenchannelAccountEvents['emit'](_0x509592+':'+_0x192180['id'],_0x192180);OpenchannelAccountEvents['emit'](_0x509592,_0x192180);_0x357f6a(null);};}for(var e in events){if(events[_0xebb1('0x6')](e)){var event=events[e];OpenchannelAccount[_0xebb1('0x7')](e,emitEvent(event));}}module[_0xebb1('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index bc20e32..14597fc 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 _0x5393=['../../config/environment','./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','moment','request-promise','path','rimraf'];(function(_0x433fa5,_0x884980){var _0x36b69b=function(_0x152567){while(--_0x152567){_0x433fa5['push'](_0x433fa5['shift']());}};_0x36b69b(++_0x884980);}(_0x5393,0x1b6));var _0x3539=function(_0x5b2cd5,_0x37ff63){_0x5b2cd5=_0x5b2cd5-0x0;var _0x24c5cf=_0x5393[_0x5b2cd5];return _0x24c5cf;};'use strict';var _=require(_0x3539('0x0'));var util=require(_0x3539('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3539('0x2'));var BPromise=require('bluebird');var rp=require(_0x3539('0x3'));var fs=require('fs');var path=require(_0x3539('0x4'));var rimraf=require(_0x3539('0x5'));var config=require(_0x3539('0x6'));var attributes=require(_0x3539('0x7'));module[_0x3539('0x8')]=function(_0x5c2e3e,_0x5bb450){return _0x5c2e3e[_0x3539('0x9')](_0x3539('0xa'),attributes,{'tableName':_0x3539('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x73be=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelAccount.attributes','OpenchannelAccount','openchannel_accounts','lodash','util'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x73be,0x1ea));var _0xe73b=function(_0x5520eb,_0x4eceba){_0x5520eb=_0x5520eb-0x0;var _0x2616e3=_0x73be[_0x5520eb];return _0x2616e3;};'use strict';var _=require(_0xe73b('0x0'));var util=require(_0xe73b('0x1'));var logger=require('../../config/logger')(_0xe73b('0x2'));var moment=require(_0xe73b('0x3'));var BPromise=require(_0xe73b('0x4'));var rp=require(_0xe73b('0x5'));var fs=require('fs');var path=require(_0xe73b('0x6'));var rimraf=require(_0xe73b('0x7'));var config=require(_0xe73b('0x8'));var attributes=require(_0xe73b('0x9'));module['exports']=function(_0xaac34,_0x28c09d){return _0xaac34['define'](_0xe73b('0xa'),attributes,{'tableName':_0xe73b('0xb'),'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 4ee616b..8fbc884 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 _0x519a=['socket.io-emitter','register','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost'];(function(_0x2d592b,_0x7d4e04){var _0x23c243=function(_0x278053){while(--_0x278053){_0x2d592b['push'](_0x2d592b['shift']());}};_0x23c243(++_0x7d4e04);}(_0x519a,0xff));var _0xa519=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x519a[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0xa519('0x0'));var util=require(_0xa519('0x1'));var moment=require(_0xa519('0x2'));var BPromise=require(_0xa519('0x3'));var rs=require(_0xa519('0x4'));var fs=require('fs');var Redis=require(_0xa519('0x5'));var db=require(_0xa519('0x6'))['db'];var utils=require(_0xa519('0x7'));var logger=require('../../config/logger')(_0xa519('0x8'));var config=require(_0xa519('0x9'));var jayson=require(_0xa519('0xa'));var client=jayson['client'][_0xa519('0xb')]({'port':0x232a});config[_0xa519('0xc')]=_[_0xa519('0xd')](config[_0xa519('0xc')],{'host':_0xa519('0xe'),'port':0x18eb});var socket=require(_0xa519('0xf'))(new Redis(config[_0xa519('0xc')]));require('./openchannelAccount.socket')[_0xa519('0x10')](socket);function respondWithRpcPromise(_0x5be3fd,_0x4e1d8f,_0x53eaaf){return new BPromise(function(_0x127f1b,_0x39a85c){return client['request'](_0x5be3fd,_0x53eaaf)['then'](function(_0x581b1e){logger['info'](_0xa519('0x11'),_0x4e1d8f,_0xa519('0x12'));logger['debug'](_0xa519('0x13'),_0x4e1d8f,_0xa519('0x12'),JSON[_0xa519('0x14')](_0x581b1e));if(_0x581b1e['error']){if(_0x581b1e['error'][_0xa519('0x15')]===0x1f4){logger[_0xa519('0x16')]('OpenchannelAccount,\x20%s,\x20%s',_0x4e1d8f,_0x581b1e['error'][_0xa519('0x17')]);return _0x39a85c(_0x581b1e['error']['message']);}logger[_0xa519('0x16')](_0xa519('0x11'),_0x4e1d8f,_0x581b1e[_0xa519('0x16')][_0xa519('0x17')]);return _0x127f1b(_0x581b1e[_0xa519('0x16')][_0xa519('0x17')]);}else{logger[_0xa519('0x18')](_0xa519('0x11'),_0x4e1d8f,'request\x20sent');_0x127f1b(_0x581b1e[_0xa519('0x19')][_0xa519('0x17')]);}})[_0xa519('0x1a')](function(_0x307594){logger[_0xa519('0x16')](_0xa519('0x11'),_0x4e1d8f,_0x307594);_0x39a85c(_0x307594);});});} \ No newline at end of file +var _0xc4fa=['register','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','client','http','redis','socket.io-emitter','./openchannelAccount.socket'];(function(_0x2a3e61,_0x4bbc4c){var _0x22cc53=function(_0x3f1b36){while(--_0x3f1b36){_0x2a3e61['push'](_0x2a3e61['shift']());}};_0x22cc53(++_0x4bbc4c);}(_0xc4fa,0x143));var _0xac4f=function(_0x13afc9,_0x346a46){_0x13afc9=_0x13afc9-0x0;var _0x1a9da5=_0xc4fa[_0x13afc9];return _0x1a9da5;};'use strict';var _=require('lodash');var util=require(_0xac4f('0x0'));var moment=require(_0xac4f('0x1'));var BPromise=require(_0xac4f('0x2'));var rs=require(_0xac4f('0x3'));var fs=require('fs');var Redis=require(_0xac4f('0x4'));var db=require(_0xac4f('0x5'))['db'];var utils=require(_0xac4f('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xac4f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xac4f('0x8')][_0xac4f('0x9')]({'port':0x232a});config[_0xac4f('0xa')]=_['defaults'](config[_0xac4f('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xac4f('0xb'))(new Redis(config[_0xac4f('0xa')]));require(_0xac4f('0xc'))[_0xac4f('0xd')](socket);function respondWithRpcPromise(_0x16b148,_0x4f11ae,_0x1602ed){return new BPromise(function(_0x26787d,_0xa9780d){return client['request'](_0x16b148,_0x1602ed)[_0xac4f('0xe')](function(_0x1403ab){logger[_0xac4f('0xf')](_0xac4f('0x10'),_0x4f11ae,_0xac4f('0x11'));logger[_0xac4f('0x12')]('OpenchannelAccount,\x20%s,\x20%s,\x20%s',_0x4f11ae,'request\x20sent',JSON[_0xac4f('0x13')](_0x1403ab));if(_0x1403ab[_0xac4f('0x14')]){if(_0x1403ab['error']['code']===0x1f4){logger[_0xac4f('0x14')](_0xac4f('0x10'),_0x4f11ae,_0x1403ab[_0xac4f('0x14')][_0xac4f('0x15')]);return _0xa9780d(_0x1403ab[_0xac4f('0x14')][_0xac4f('0x15')]);}logger[_0xac4f('0x14')]('OpenchannelAccount,\x20%s,\x20%s',_0x4f11ae,_0x1403ab[_0xac4f('0x14')][_0xac4f('0x15')]);return _0x26787d(_0x1403ab[_0xac4f('0x14')]['message']);}else{logger['info'](_0xac4f('0x10'),_0x4f11ae,_0xac4f('0x11'));_0x26787d(_0x1403ab[_0xac4f('0x16')][_0xac4f('0x15')]);}})[_0xac4f('0x17')](function(_0xcee832){logger[_0xac4f('0x14')](_0xac4f('0x10'),_0x4f11ae,_0xcee832);_0xa9780d(_0xcee832);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index c95542d..88f80a8 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 _0x2e37=['save','remove','update','emit','removeListener','length','openchannelAccount:'];(function(_0x5f0488,_0x6c662f){var _0x27740d=function(_0xf30fbe){while(--_0xf30fbe){_0x5f0488['push'](_0x5f0488['shift']());}};_0x27740d(++_0x6c662f);}(_0x2e37,0x126));var _0x72e3=function(_0x1abb09,_0x18ee91){_0x1abb09=_0x1abb09-0x0;var _0xea1c07=_0x2e37[_0x1abb09];return _0xea1c07;};'use strict';var OpenchannelAccountEvents=require('./openchannelAccount.events');var events=[_0x72e3('0x0'),_0x72e3('0x1'),_0x72e3('0x2')];function createListener(_0x231fd8,_0x25360d){return function(_0x11a9bf){_0x25360d[_0x72e3('0x3')](_0x231fd8,_0x11a9bf);};}function removeListener(_0x4d82df,_0x12f4e5){return function(){OpenchannelAccountEvents[_0x72e3('0x4')](_0x4d82df,_0x12f4e5);};}exports['register']=function(_0xad493f){for(var _0x4e40f3=0x0,_0x4b7631=events[_0x72e3('0x5')];_0x4e40f3<_0x4b7631;_0x4e40f3++){var _0x29ee52=events[_0x4e40f3];var _0x560494=createListener(_0x72e3('0x6')+_0x29ee52,_0xad493f);OpenchannelAccountEvents['on'](_0x29ee52,_0x560494);}}; \ No newline at end of file +var _0xae90=['save','remove','update','emit','removeListener','register','length','openchannelAccount:','./openchannelAccount.events'];(function(_0x3f4dd9,_0xe0b819){var _0x31c54a=function(_0x25e6c6){while(--_0x25e6c6){_0x3f4dd9['push'](_0x3f4dd9['shift']());}};_0x31c54a(++_0xe0b819);}(_0xae90,0x6b));var _0x0ae9=function(_0x3a5708,_0x37fc8f){_0x3a5708=_0x3a5708-0x0;var _0x3fc06f=_0xae90[_0x3a5708];return _0x3fc06f;};'use strict';var OpenchannelAccountEvents=require(_0x0ae9('0x0'));var events=[_0x0ae9('0x1'),_0x0ae9('0x2'),_0x0ae9('0x3')];function createListener(_0x1684c4,_0x4fda8a){return function(_0x134e89){_0x4fda8a[_0x0ae9('0x4')](_0x1684c4,_0x134e89);};}function removeListener(_0x37f54a,_0x12b194){return function(){OpenchannelAccountEvents[_0x0ae9('0x5')](_0x37f54a,_0x12b194);};}exports[_0x0ae9('0x6')]=function(_0x25d011){for(var _0x30fb1a=0x0,_0x4d770e=events[_0x0ae9('0x7')];_0x30fb1a<_0x4d770e;_0x30fb1a++){var _0x261daa=events[_0x30fb1a];var _0x185105=createListener(_0x0ae9('0x8')+_0x261daa,_0x25d011);OpenchannelAccountEvents['on'](_0x261daa,_0x185105);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 69e00d1..1d12a14 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 _0xa678=['exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','create','put','update','delete','destroy'];(function(_0x538625,_0xae7406){var _0x782797=function(_0x181ce0){while(--_0x181ce0){_0x538625['push'](_0x538625['shift']());}};_0x782797(++_0xae7406);}(_0xa678,0x1b6));var _0x8a67=function(_0x37e872,_0x2c33b6){_0x37e872=_0x37e872-0x0;var _0x5c372d=_0xa678[_0x37e872];return _0x5c372d;};'use strict';var multer=require(_0x8a67('0x0'));var util=require(_0x8a67('0x1'));var path=require('path');var timeout=require(_0x8a67('0x2'));var express=require(_0x8a67('0x3'));var router=express['Router']();var auth=require(_0x8a67('0x4'));var interaction=require(_0x8a67('0x5'));var config=require(_0x8a67('0x6'));var controller=require(_0x8a67('0x7'));router[_0x8a67('0x8')]('/',auth[_0x8a67('0x9')](),controller[_0x8a67('0xa')]);router[_0x8a67('0x8')](_0x8a67('0xb'),auth[_0x8a67('0x9')](),controller[_0x8a67('0xc')]);router['post']('/',auth[_0x8a67('0x9')](),controller[_0x8a67('0xd')]);router[_0x8a67('0xe')](_0x8a67('0xb'),auth['isAuthenticated'](),controller[_0x8a67('0xf')]);router[_0x8a67('0x10')](_0x8a67('0xb'),auth['isAuthenticated'](),controller[_0x8a67('0x11')]);module[_0x8a67('0x12')]=router; \ No newline at end of file +var _0x7eba=['../../config/environment','./openchannelApplication.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5923ce,_0x398178){var _0x55f37d=function(_0xefbd0d){while(--_0xefbd0d){_0x5923ce['push'](_0x5923ce['shift']());}};_0x55f37d(++_0x398178);}(_0x7eba,0x1c6));var _0xa7eb=function(_0x369f7f,_0x4af724){_0x369f7f=_0x369f7f-0x0;var _0x57e310=_0x7eba[_0x369f7f];return _0x57e310;};'use strict';var multer=require(_0xa7eb('0x0'));var util=require(_0xa7eb('0x1'));var path=require(_0xa7eb('0x2'));var timeout=require(_0xa7eb('0x3'));var express=require(_0xa7eb('0x4'));var router=express[_0xa7eb('0x5')]();var auth=require(_0xa7eb('0x6'));var interaction=require(_0xa7eb('0x7'));var config=require(_0xa7eb('0x8'));var controller=require(_0xa7eb('0x9'));router[_0xa7eb('0xa')]('/',auth[_0xa7eb('0xb')](),controller[_0xa7eb('0xc')]);router[_0xa7eb('0xa')](_0xa7eb('0xd'),auth[_0xa7eb('0xb')](),controller[_0xa7eb('0xe')]);router[_0xa7eb('0xf')]('/',auth[_0xa7eb('0xb')](),controller[_0xa7eb('0x10')]);router[_0xa7eb('0x11')](_0xa7eb('0xd'),auth[_0xa7eb('0xb')](),controller[_0xa7eb('0x12')]);router[_0xa7eb('0x13')](_0xa7eb('0xd'),auth[_0xa7eb('0xb')](),controller[_0xa7eb('0x14')]);module[_0xa7eb('0x15')]=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index 0dd5fc3..756c4cd 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 _0xadfb=['TEXT','*,*,*,*','sequelize','exports','INTEGER','STRING','noop'];(function(_0x35d120,_0x43bf7f){var _0x308362=function(_0x408826){while(--_0x408826){_0x35d120['push'](_0x35d120['shift']());}};_0x308362(++_0x43bf7f);}(_0xadfb,0x160));var _0xbadf=function(_0x592178,_0xed31e5){_0x592178=_0x592178-0x0;var _0x39d4a9=_0xadfb[_0x592178];return _0x39d4a9;};'use strict';var Sequelize=require(_0xbadf('0x0'));module[_0xbadf('0x1')]={'priority':{'type':Sequelize[_0xbadf('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xbadf('0x3')],'allowNull':![],'defaultValue':_0xbadf('0x4')},'appdata':{'type':Sequelize[_0xbadf('0x5')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xbadf('0x3')],'defaultValue':_0xbadf('0x6')}}; \ No newline at end of file +var _0xd291=['*,*,*,*','sequelize','exports','STRING','TEXT'];(function(_0x1cabd0,_0xa20682){var _0x44c5b8=function(_0x232f3a){while(--_0x232f3a){_0x1cabd0['push'](_0x1cabd0['shift']());}};_0x44c5b8(++_0xa20682);}(_0xd291,0x1af));var _0x1d29=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd291[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x1d29('0x0'));module[_0x1d29('0x1')]={'priority':{'type':Sequelize['INTEGER'],'allowNull':![]},'app':{'type':Sequelize[_0x1d29('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x1d29('0x3')]()},'description':{'type':Sequelize[_0x1d29('0x2')]},'interval':{'type':Sequelize[_0x1d29('0x2')],'defaultValue':_0x1d29('0x4')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 9b74f84..0de9d59 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 _0xea21=['filter','merge','options','findAll','rows','show','rawAttributes','includeAll','include','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','error','stack','name','index','OpenchannelApplication','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','where','map','type','VIRTUAL'];(function(_0x62c2b8,_0x1210e6){var _0x37810f=function(_0x424096){while(--_0x424096){_0x62c2b8['push'](_0x62c2b8['shift']());}};_0x37810f(++_0x1210e6);}(_0xea21,0xac));var _0x1ea2=function(_0x2b766c,_0x15c765){_0x2b766c=_0x2b766c-0x0;var _0x1c1ea5=_0xea21[_0x2b766c];return _0x1c1ea5;};'use strict';var pdf=require(_0x1ea2('0x0'));var emlformat=require(_0x1ea2('0x1'));var rimraf=require(_0x1ea2('0x2'));var zipdir=require(_0x1ea2('0x3'));var jsonpatch=require(_0x1ea2('0x4'));var rp=require(_0x1ea2('0x5'));var moment=require(_0x1ea2('0x6'));var BPromise=require(_0x1ea2('0x7'));var Mustache=require(_0x1ea2('0x8'));var util=require('util');var path=require(_0x1ea2('0x9'));var sox=require(_0x1ea2('0xa'));var csv=require(_0x1ea2('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1ea2('0xc'));var squel=require(_0x1ea2('0xd'));var crypto=require(_0x1ea2('0xe'));var jsforce=require(_0x1ea2('0xf'));var deskjs=require(_0x1ea2('0x10'));var toCsv=require(_0x1ea2('0xb'));var querystring=require('querystring');var Papa=require(_0x1ea2('0x11'));var Redis=require(_0x1ea2('0x12'));var authService=require(_0x1ea2('0x13'));var qs=require(_0x1ea2('0x14'));var as=require(_0x1ea2('0x15'));var hardwareService=require(_0x1ea2('0x16'));var logger=require(_0x1ea2('0x17'))(_0x1ea2('0x18'));var utils=require(_0x1ea2('0x19'));var config=require(_0x1ea2('0x1a'));var db=require(_0x1ea2('0x1b'))['db'];function respondWithStatusCode(_0x2a7646,_0x237017){_0x237017=_0x237017||0xcc;return function(_0xefdd33){if(_0xefdd33){return _0x2a7646[_0x1ea2('0x1c')](_0x237017);}return _0x2a7646[_0x1ea2('0x1d')](_0x237017)[_0x1ea2('0x1e')]();};}function respondWithResult(_0x2f3664,_0x23a39f){_0x23a39f=_0x23a39f||0xc8;return function(_0x40c99c){if(_0x40c99c){return _0x2f3664['status'](_0x23a39f)[_0x1ea2('0x1f')](_0x40c99c);}};}function respondWithFilteredResult(_0x463622,_0x3accb0){return function(_0x3f8536){if(_0x3f8536){var _0x1eabfb=_0x3f8536[_0x1ea2('0x20')],_0x19fa08=_0x3accb0[_0x1ea2('0x21')],_0x456404=_0x3accb0[_0x1ea2('0x21')]+_0x3accb0[_0x1ea2('0x22')],_0xe18b6f;if(_0x456404>=_0x1eabfb){_0x456404=_0x1eabfb;_0xe18b6f=0xc8;}else{_0xe18b6f=0xce;}_0x463622[_0x1ea2('0x1d')](_0xe18b6f);return _0x463622[_0x1ea2('0x23')](_0x1ea2('0x24'),_0x19fa08+'-'+_0x456404+'/'+_0x1eabfb)['json'](_0x3f8536);}return null;};}function patchUpdates(_0x3b96d1){return function(_0x20abae){try{jsonpatch[_0x1ea2('0x25')](_0x20abae,_0x3b96d1,!![]);}catch(_0x58504c){return BPromise[_0x1ea2('0x26')](_0x58504c);}return _0x20abae[_0x1ea2('0x27')]();};}function saveUpdates(_0x408792,_0x60c656){return function(_0x22f8b7){if(_0x22f8b7){return _0x22f8b7[_0x1ea2('0x28')](_0x408792)[_0x1ea2('0x29')](function(_0x28dfa8){return _0x28dfa8;});}return null;};}function removeEntity(_0x259a4f,_0x815e8d){return function(_0x10b58d){if(_0x10b58d){return _0x10b58d[_0x1ea2('0x2a')]()[_0x1ea2('0x29')](function(){_0x259a4f[_0x1ea2('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4ad6d6,_0x12fae8){return function(_0x445c0c){if(!_0x445c0c){_0x4ad6d6[_0x1ea2('0x1c')](0x194);}return _0x445c0c;};}function handleError(_0x22a6de,_0x85d50c){_0x85d50c=_0x85d50c||0x1f4;return function(_0x44f76e){logger[_0x1ea2('0x2b')](_0x44f76e[_0x1ea2('0x2c')]);if(_0x44f76e['name']){delete _0x44f76e[_0x1ea2('0x2d')];}_0x22a6de[_0x1ea2('0x1d')](_0x85d50c)['send'](_0x44f76e);};}exports[_0x1ea2('0x2e')]=function(_0x4fa742,_0xa30b8f){var _0xbf13de={},_0x8f9b00={},_0x5d5586={'count':0x0,'rows':[]};var _0x5881b1=_['map'](db[_0x1ea2('0x2f')]['rawAttributes'],function(_0x5acd21){return{'name':_0x5acd21['fieldName'],'type':_0x5acd21['type'][_0x1ea2('0x30')]};});_0x8f9b00[_0x1ea2('0x31')]=_['map'](_0x5881b1,'name');_0x8f9b00[_0x1ea2('0x32')]=_[_0x1ea2('0x33')](_0x4fa742[_0x1ea2('0x32')]);_0x8f9b00['filters']=_[_0x1ea2('0x34')](_0x8f9b00[_0x1ea2('0x31')],_0x8f9b00[_0x1ea2('0x32')]);_0xbf13de[_0x1ea2('0x35')]=_['intersection'](_0x8f9b00[_0x1ea2('0x31')],qs[_0x1ea2('0x36')](_0x4fa742[_0x1ea2('0x32')]['fields']));_0xbf13de[_0x1ea2('0x35')]=_0xbf13de['attributes'][_0x1ea2('0x37')]?_0xbf13de[_0x1ea2('0x35')]:_0x8f9b00[_0x1ea2('0x31')];if(!_0x4fa742[_0x1ea2('0x32')][_0x1ea2('0x38')](_0x1ea2('0x39'))){_0xbf13de[_0x1ea2('0x22')]=qs['limit'](_0x4fa742[_0x1ea2('0x32')]['limit']);_0xbf13de[_0x1ea2('0x21')]=qs['offset'](_0x4fa742[_0x1ea2('0x32')][_0x1ea2('0x21')]);}_0xbf13de[_0x1ea2('0x3a')]=qs[_0x1ea2('0x3b')](_0x4fa742[_0x1ea2('0x32')][_0x1ea2('0x3b')]);_0xbf13de['where']=qs[_0x1ea2('0x3c')](_['pick'](_0x4fa742[_0x1ea2('0x32')],_0x8f9b00[_0x1ea2('0x3c')]));if(_0x4fa742[_0x1ea2('0x32')]['filter']){_0xbf13de['where']=_['merge'](_0xbf13de[_0x1ea2('0x3d')],{'$or':_[_0x1ea2('0x3e')](_0x5881b1,function(_0x5ceadb){if(_0x5ceadb[_0x1ea2('0x3f')]!==_0x1ea2('0x40')){var _0x16a35e={};_0x16a35e[_0x5ceadb[_0x1ea2('0x2d')]]={'$like':'%'+_0x4fa742[_0x1ea2('0x32')][_0x1ea2('0x41')]+'%'};return _0x16a35e;}})});}_0xbf13de=_[_0x1ea2('0x42')]({},_0xbf13de,_0x4fa742[_0x1ea2('0x43')]);var _0x15fb25={'where':_0xbf13de[_0x1ea2('0x3d')]};return db[_0x1ea2('0x2f')]['count'](_0x15fb25)[_0x1ea2('0x29')](function(_0x2f7b12){_0x5d5586[_0x1ea2('0x20')]=_0x2f7b12;if(_0x4fa742[_0x1ea2('0x32')]['includeAll']){_0xbf13de['include']=[{'all':!![]}];}return db[_0x1ea2('0x2f')][_0x1ea2('0x44')](_0xbf13de);})[_0x1ea2('0x29')](function(_0x50c9bc){_0x5d5586[_0x1ea2('0x45')]=_0x50c9bc;return _0x5d5586;})[_0x1ea2('0x29')](respondWithFilteredResult(_0xa30b8f,_0xbf13de))['catch'](handleError(_0xa30b8f,null));};exports[_0x1ea2('0x46')]=function(_0x351564,_0xd57f46){var _0x5a6a7c={'raw':!![],'where':{'id':_0x351564['params']['id']}},_0x38669c={};_0x38669c[_0x1ea2('0x31')]=_['keys'](db[_0x1ea2('0x2f')][_0x1ea2('0x47')]);_0x38669c[_0x1ea2('0x32')]=_[_0x1ea2('0x33')](_0x351564['query']);_0x38669c[_0x1ea2('0x3c')]=_[_0x1ea2('0x34')](_0x38669c['model'],_0x38669c[_0x1ea2('0x32')]);_0x5a6a7c[_0x1ea2('0x35')]=_[_0x1ea2('0x34')](_0x38669c['model'],qs[_0x1ea2('0x36')](_0x351564['query'][_0x1ea2('0x36')]));_0x5a6a7c[_0x1ea2('0x35')]=_0x5a6a7c[_0x1ea2('0x35')][_0x1ea2('0x37')]?_0x5a6a7c[_0x1ea2('0x35')]:_0x38669c[_0x1ea2('0x31')];if(_0x351564[_0x1ea2('0x32')][_0x1ea2('0x48')]){_0x5a6a7c[_0x1ea2('0x49')]=[{'all':!![]}];}_0x5a6a7c=_[_0x1ea2('0x42')]({},_0x5a6a7c,_0x351564['options']);return db[_0x1ea2('0x2f')][_0x1ea2('0x4a')](_0x5a6a7c)[_0x1ea2('0x29')](handleEntityNotFound(_0xd57f46,null))['then'](respondWithResult(_0xd57f46,null))[_0x1ea2('0x4b')](handleError(_0xd57f46,null));};exports[_0x1ea2('0x4c')]=function(_0x187651,_0x36848e){return db[_0x1ea2('0x2f')]['create'](_0x187651['body'],{})[_0x1ea2('0x29')](respondWithResult(_0x36848e,0xc9))[_0x1ea2('0x4b')](handleError(_0x36848e,null));};exports[_0x1ea2('0x28')]=function(_0x377afc,_0x2a1ea){if(_0x377afc[_0x1ea2('0x4d')]['id']){delete _0x377afc['body']['id'];}return db[_0x1ea2('0x2f')][_0x1ea2('0x4a')]({'where':{'id':_0x377afc[_0x1ea2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2a1ea,null))[_0x1ea2('0x29')](saveUpdates(_0x377afc[_0x1ea2('0x4d')],null))['then'](respondWithResult(_0x2a1ea,null))[_0x1ea2('0x4b')](handleError(_0x2a1ea,null));};exports[_0x1ea2('0x2a')]=function(_0x1342ba,_0x114c8d){return db[_0x1ea2('0x2f')][_0x1ea2('0x4a')]({'where':{'id':_0x1342ba[_0x1ea2('0x4e')]['id']}})[_0x1ea2('0x29')](handleEntityNotFound(_0x114c8d,null))[_0x1ea2('0x29')](removeEntity(_0x114c8d,null))['catch'](handleError(_0x114c8d,null));}; \ No newline at end of file +var _0x7079=['find','create','body','update','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','save','then','destroy','sendStatus','error','stack','name','send','index','map','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','where','merge','options','OpenchannelApplication','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection'];(function(_0x14d132,_0x34dd2f){var _0x73c6b9=function(_0x29f384){while(--_0x29f384){_0x14d132['push'](_0x14d132['shift']());}};_0x73c6b9(++_0x34dd2f);}(_0x7079,0xdc));var _0x9707=function(_0x175c0e,_0x302513){_0x175c0e=_0x175c0e-0x0;var _0x1a2e04=_0x7079[_0x175c0e];return _0x1a2e04;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9707('0x0'));var rimraf=require(_0x9707('0x1'));var zipdir=require(_0x9707('0x2'));var jsonpatch=require(_0x9707('0x3'));var rp=require(_0x9707('0x4'));var moment=require(_0x9707('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x9707('0x6'));var sox=require(_0x9707('0x7'));var csv=require('to-csv');var ejs=require(_0x9707('0x8'));var fs=require('fs');var _=require(_0x9707('0x9'));var squel=require(_0x9707('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9707('0xb'));var querystring=require(_0x9707('0xc'));var Papa=require(_0x9707('0xd'));var Redis=require(_0x9707('0xe'));var authService=require(_0x9707('0xf'));var qs=require(_0x9707('0x10'));var as=require(_0x9707('0x11'));var hardwareService=require(_0x9707('0x12'));var logger=require('../../config/logger')(_0x9707('0x13'));var utils=require(_0x9707('0x14'));var config=require(_0x9707('0x15'));var db=require(_0x9707('0x16'))['db'];function respondWithStatusCode(_0x490c3e,_0x18d534){_0x18d534=_0x18d534||0xcc;return function(_0xabdf81){if(_0xabdf81){return _0x490c3e['sendStatus'](_0x18d534);}return _0x490c3e['status'](_0x18d534)[_0x9707('0x17')]();};}function respondWithResult(_0x38d5c4,_0x5d32b2){_0x5d32b2=_0x5d32b2||0xc8;return function(_0x514465){if(_0x514465){return _0x38d5c4[_0x9707('0x18')](_0x5d32b2)[_0x9707('0x19')](_0x514465);}};}function respondWithFilteredResult(_0x5c5c8f,_0x98516b){return function(_0x3d5850){if(_0x3d5850){var _0x45b577=_0x3d5850['count'],_0x563da2=_0x98516b[_0x9707('0x1a')],_0x530e1b=_0x98516b[_0x9707('0x1a')]+_0x98516b[_0x9707('0x1b')],_0x3a2ee1;if(_0x530e1b>=_0x45b577){_0x530e1b=_0x45b577;_0x3a2ee1=0xc8;}else{_0x3a2ee1=0xce;}_0x5c5c8f[_0x9707('0x18')](_0x3a2ee1);return _0x5c5c8f[_0x9707('0x1c')](_0x9707('0x1d'),_0x563da2+'-'+_0x530e1b+'/'+_0x45b577)[_0x9707('0x19')](_0x3d5850);}return null;};}function patchUpdates(_0x4445c3){return function(_0x21a7b1){try{jsonpatch['apply'](_0x21a7b1,_0x4445c3,!![]);}catch(_0x36edd6){return BPromise['reject'](_0x36edd6);}return _0x21a7b1[_0x9707('0x1e')]();};}function saveUpdates(_0x18051f,_0x7b0e2b){return function(_0x22c277){if(_0x22c277){return _0x22c277['update'](_0x18051f)[_0x9707('0x1f')](function(_0x6f3578){return _0x6f3578;});}return null;};}function removeEntity(_0x548b58,_0x26b532){return function(_0x17ef87){if(_0x17ef87){return _0x17ef87[_0x9707('0x20')]()[_0x9707('0x1f')](function(){_0x548b58['status'](0xcc)[_0x9707('0x17')]();});}};}function handleEntityNotFound(_0x3d061b,_0x3c566a){return function(_0x13ba51){if(!_0x13ba51){_0x3d061b[_0x9707('0x21')](0x194);}return _0x13ba51;};}function handleError(_0x13ce4f,_0x47ec3b){_0x47ec3b=_0x47ec3b||0x1f4;return function(_0x47bf9e){logger[_0x9707('0x22')](_0x47bf9e[_0x9707('0x23')]);if(_0x47bf9e[_0x9707('0x24')]){delete _0x47bf9e[_0x9707('0x24')];}_0x13ce4f[_0x9707('0x18')](_0x47ec3b)[_0x9707('0x25')](_0x47bf9e);};}exports[_0x9707('0x26')]=function(_0x596561,_0x216757){var _0x38c4a8={},_0xffa964={},_0x543c92={'count':0x0,'rows':[]};var _0x3fbb16=_[_0x9707('0x27')](db['OpenchannelApplication']['rawAttributes'],function(_0x210336){return{'name':_0x210336[_0x9707('0x28')],'type':_0x210336[_0x9707('0x29')][_0x9707('0x2a')]};});_0xffa964[_0x9707('0x2b')]=_[_0x9707('0x27')](_0x3fbb16,_0x9707('0x24'));_0xffa964[_0x9707('0x2c')]=_[_0x9707('0x2d')](_0x596561[_0x9707('0x2c')]);_0xffa964[_0x9707('0x2e')]=_['intersection'](_0xffa964[_0x9707('0x2b')],_0xffa964[_0x9707('0x2c')]);_0x38c4a8[_0x9707('0x2f')]=_['intersection'](_0xffa964[_0x9707('0x2b')],qs[_0x9707('0x30')](_0x596561[_0x9707('0x2c')][_0x9707('0x30')]));_0x38c4a8['attributes']=_0x38c4a8['attributes'][_0x9707('0x31')]?_0x38c4a8[_0x9707('0x2f')]:_0xffa964[_0x9707('0x2b')];if(!_0x596561['query'][_0x9707('0x32')](_0x9707('0x33'))){_0x38c4a8[_0x9707('0x1b')]=qs[_0x9707('0x1b')](_0x596561[_0x9707('0x2c')][_0x9707('0x1b')]);_0x38c4a8['offset']=qs['offset'](_0x596561[_0x9707('0x2c')][_0x9707('0x1a')]);}_0x38c4a8['order']=qs[_0x9707('0x34')](_0x596561['query'][_0x9707('0x34')]);_0x38c4a8['where']=qs[_0x9707('0x2e')](_[_0x9707('0x35')](_0x596561['query'],_0xffa964['filters']));if(_0x596561['query']['filter']){_0x38c4a8[_0x9707('0x36')]=_[_0x9707('0x37')](_0x38c4a8[_0x9707('0x36')],{'$or':_[_0x9707('0x27')](_0x3fbb16,function(_0x8f14be){if(_0x8f14be[_0x9707('0x29')]!=='VIRTUAL'){var _0x174c56={};_0x174c56[_0x8f14be[_0x9707('0x24')]]={'$like':'%'+_0x596561[_0x9707('0x2c')]['filter']+'%'};return _0x174c56;}})});}_0x38c4a8=_[_0x9707('0x37')]({},_0x38c4a8,_0x596561[_0x9707('0x38')]);var _0x454f0a={'where':_0x38c4a8[_0x9707('0x36')]};return db[_0x9707('0x39')][_0x9707('0x3a')](_0x454f0a)[_0x9707('0x1f')](function(_0x4b6022){_0x543c92[_0x9707('0x3a')]=_0x4b6022;if(_0x596561[_0x9707('0x2c')][_0x9707('0x3b')]){_0x38c4a8[_0x9707('0x3c')]=[{'all':!![]}];}return db[_0x9707('0x39')][_0x9707('0x3d')](_0x38c4a8);})[_0x9707('0x1f')](function(_0x5c5546){_0x543c92[_0x9707('0x3e')]=_0x5c5546;return _0x543c92;})['then'](respondWithFilteredResult(_0x216757,_0x38c4a8))[_0x9707('0x3f')](handleError(_0x216757,null));};exports[_0x9707('0x40')]=function(_0x28dcdb,_0x36f9f6){var _0x3fff78={'raw':!![],'where':{'id':_0x28dcdb[_0x9707('0x41')]['id']}},_0x2d2054={};_0x2d2054[_0x9707('0x2b')]=_[_0x9707('0x2d')](db['OpenchannelApplication'][_0x9707('0x42')]);_0x2d2054['query']=_[_0x9707('0x2d')](_0x28dcdb['query']);_0x2d2054[_0x9707('0x2e')]=_[_0x9707('0x43')](_0x2d2054[_0x9707('0x2b')],_0x2d2054[_0x9707('0x2c')]);_0x3fff78[_0x9707('0x2f')]=_[_0x9707('0x43')](_0x2d2054['model'],qs[_0x9707('0x30')](_0x28dcdb[_0x9707('0x2c')]['fields']));_0x3fff78[_0x9707('0x2f')]=_0x3fff78[_0x9707('0x2f')]['length']?_0x3fff78[_0x9707('0x2f')]:_0x2d2054['model'];if(_0x28dcdb[_0x9707('0x2c')][_0x9707('0x3b')]){_0x3fff78[_0x9707('0x3c')]=[{'all':!![]}];}_0x3fff78=_[_0x9707('0x37')]({},_0x3fff78,_0x28dcdb[_0x9707('0x38')]);return db[_0x9707('0x39')][_0x9707('0x44')](_0x3fff78)['then'](handleEntityNotFound(_0x36f9f6,null))[_0x9707('0x1f')](respondWithResult(_0x36f9f6,null))[_0x9707('0x3f')](handleError(_0x36f9f6,null));};exports[_0x9707('0x45')]=function(_0x5b98a3,_0xe260ee){return db['OpenchannelApplication'][_0x9707('0x45')](_0x5b98a3[_0x9707('0x46')],{})[_0x9707('0x1f')](respondWithResult(_0xe260ee,0xc9))[_0x9707('0x3f')](handleError(_0xe260ee,null));};exports[_0x9707('0x47')]=function(_0x530b44,_0xbc83dd){if(_0x530b44[_0x9707('0x46')]['id']){delete _0x530b44[_0x9707('0x46')]['id'];}return db['OpenchannelApplication'][_0x9707('0x44')]({'where':{'id':_0x530b44[_0x9707('0x41')]['id']}})[_0x9707('0x1f')](handleEntityNotFound(_0xbc83dd,null))['then'](saveUpdates(_0x530b44['body'],null))[_0x9707('0x1f')](respondWithResult(_0xbc83dd,null))['catch'](handleError(_0xbc83dd,null));};exports['destroy']=function(_0x243095,_0x5a4cd8){return db['OpenchannelApplication']['find']({'where':{'id':_0x243095[_0x9707('0x41')]['id']}})['then'](handleEntityNotFound(_0x5a4cd8,null))['then'](removeEntity(_0x5a4cd8,null))[_0x9707('0x3f')](handleError(_0x5a4cd8,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index b381afa..06346ce 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 _0xd474=['../../config/environment','./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','request-promise'];(function(_0x1a40c9,_0x164646){var _0x34ee9d=function(_0x193f8d){while(--_0x193f8d){_0x1a40c9['push'](_0x1a40c9['shift']());}};_0x34ee9d(++_0x164646);}(_0xd474,0x174));var _0x4d47=function(_0x1f8053,_0x111077){_0x1f8053=_0x1f8053-0x0;var _0x174fd8=_0xd474[_0x1f8053];return _0x174fd8;};'use strict';var _=require('lodash');var util=require(_0x4d47('0x0'));var logger=require(_0x4d47('0x1'))(_0x4d47('0x2'));var moment=require(_0x4d47('0x3'));var BPromise=require('bluebird');var rp=require(_0x4d47('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x4d47('0x5'));var attributes=require(_0x4d47('0x6'));module[_0x4d47('0x7')]=function(_0x3c8306,_0x6b58eb){return _0x3c8306[_0x4d47('0x8')](_0x4d47('0x9'),attributes,{'tableName':_0x4d47('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x4d47('0xb'),'collate':_0x4d47('0xc')});}; \ No newline at end of file +var _0x079d=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelApplication.attributes','exports','define','openchannel_applications','utf8mb4_unicode_ci','lodash'];(function(_0x303864,_0x1a0eaf){var _0x250c15=function(_0x362a9a){while(--_0x362a9a){_0x303864['push'](_0x303864['shift']());}};_0x250c15(++_0x1a0eaf);}(_0x079d,0x15d));var _0xd079=function(_0x2d5ba5,_0x50ddf0){_0x2d5ba5=_0x2d5ba5-0x0;var _0x5a4e93=_0x079d[_0x2d5ba5];return _0x5a4e93;};'use strict';var _=require(_0xd079('0x0'));var util=require('util');var logger=require(_0xd079('0x1'))(_0xd079('0x2'));var moment=require(_0xd079('0x3'));var BPromise=require(_0xd079('0x4'));var rp=require(_0xd079('0x5'));var fs=require('fs');var path=require(_0xd079('0x6'));var rimraf=require(_0xd079('0x7'));var config=require(_0xd079('0x8'));var attributes=require(_0xd079('0x9'));module[_0xd079('0xa')]=function(_0x20f335,_0x1bce7d){return _0x20f335[_0xd079('0xb')]('OpenchannelApplication',attributes,{'tableName':_0xd079('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xd079('0xd')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index 9372075..2dc4199 100644 --- a/server/api/openchannelApplication/openchannelApplication.rpc.js +++ b/server/api/openchannelApplication/openchannelApplication.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x710ca0,_0x105983){var _0x3b65db=function(_0x5adbde){while(--_0x5adbde){_0x710ca0['push'](_0x710ca0['shift']());}};_0x3b65db(++_0x105983);}(_0xb10b,0x12a));var _0xbb10=function(_0x95975e,_0x51412c){_0x95975e=_0x95975e-0x0;var _0x5d4933=_0xb10b[_0x95975e];return _0x5d4933;};'use strict';var _=require(_0xbb10('0x0'));var util=require('util');var moment=require(_0xbb10('0x1'));var BPromise=require(_0xbb10('0x2'));var rs=require(_0xbb10('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbb10('0x4'))['db'];var utils=require(_0xbb10('0x5'));var logger=require(_0xbb10('0x6'))(_0xbb10('0x7'));var config=require(_0xbb10('0x8'));var jayson=require(_0xbb10('0x9'));var client=jayson['client'][_0xbb10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3cdd53,_0x513741,_0x1b9e94){return new BPromise(function(_0x3fb675,_0x21370f){return client[_0xbb10('0xb')](_0x3cdd53,_0x1b9e94)[_0xbb10('0xc')](function(_0x1ce33e){logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,'request\x20sent');logger['debug'](_0xbb10('0xf'),_0x513741,_0xbb10('0x10'),JSON[_0xbb10('0x11')](_0x1ce33e));if(_0x1ce33e['error']){if(_0x1ce33e[_0xbb10('0x12')]['code']===0x1f4){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x21370f(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}logger['error'](_0xbb10('0xe'),_0x513741,_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);return _0x3fb675(_0x1ce33e[_0xbb10('0x12')][_0xbb10('0x13')]);}else{logger[_0xbb10('0xd')](_0xbb10('0xe'),_0x513741,_0xbb10('0x10'));_0x3fb675(_0x1ce33e[_0xbb10('0x14')][_0xbb10('0x13')]);}})['catch'](function(_0x2eca0f){logger[_0xbb10('0x12')](_0xbb10('0xe'),_0x513741,_0x2eca0f);_0x21370f(_0x2eca0f);});});}exports[_0xbb10('0x15')]=function(_0x378da8){var _0x1682a4=this;return new Promise(function(_0x575cca,_0x30efc6){return db[_0xbb10('0x16')][_0xbb10('0x17')](_0x378da8['body'],{'raw':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xd8b0=['OpenchannelApplication','body','options','raw','where','lodash','util','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','OpenchannelApplication,\x20%s,\x20%s','request\x20sent','debug','OpenchannelApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','UpdateOpenchannelApplication'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});}exports[_0x0d8b('0x16')]=function(_0x5fecbd){var _0x333674=this;return new Promise(function(_0x18dd2d,_0x264b39){return db[_0x0d8b('0x17')]['update'](_0x5fecbd[_0x0d8b('0x18')],{'raw':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd[_0x0d8b('0x19')][_0x0d8b('0x1b')]||null:null,'attributes':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['attributes']||null:null,'limit':_0x5fecbd[_0x0d8b('0x19')]?_0x5fecbd['options']['limit']||null:null})['then'](function(_0x238728){logger[_0x0d8b('0xb')](_0x0d8b('0x16'),_0x5fecbd);logger[_0x0d8b('0xe')](_0x0d8b('0x16'),_0x5fecbd,JSON[_0x0d8b('0x10')](_0x238728));_0x18dd2d(_0x238728);})[_0x0d8b('0x15')](function(_0x4562cb){logger[_0x0d8b('0x11')]('UpdateOpenchannelApplication',_0x4562cb[_0x0d8b('0x13')],_0x5fecbd);_0x264b39(_0x333674[_0x0d8b('0x11')](0x1f4,_0x4562cb['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 11e0df5..38e95e1 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 _0x66c7=['destroy','removeTags','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','show','/:id/messages','/:id/download','download','post','addMessage','/:id/tags','tracked','put','/:id','openchannelinteraction:update','update','delete','openchannel','openchannelinteraction:destroy'];(function(_0x1a7f1e,_0x1cf0a9){var _0x5f0e1f=function(_0x3ebe94){while(--_0x3ebe94){_0x1a7f1e['push'](_0x1a7f1e['shift']());}};_0x5f0e1f(++_0x1cf0a9);}(_0x66c7,0x1e3));var _0x766c=function(_0x1ffe00,_0x74405d){_0x1ffe00=_0x1ffe00-0x0;var _0x1ed438=_0x66c7[_0x1ffe00];return _0x1ed438;};'use strict';var multer=require(_0x766c('0x0'));var util=require(_0x766c('0x1'));var path=require(_0x766c('0x2'));var timeout=require('connect-timeout');var express=require(_0x766c('0x3'));var router=express[_0x766c('0x4')]();var auth=require(_0x766c('0x5'));var interaction=require(_0x766c('0x6'));var config=require(_0x766c('0x7'));var controller=require('./openchannelInteraction.controller');router[_0x766c('0x8')]('/',auth['isAuthenticated'](),controller[_0x766c('0x9')]);router[_0x766c('0x8')](_0x766c('0xa'),auth[_0x766c('0xb')](),controller['describe']);router['get']('/:id',auth[_0x766c('0xb')](),controller[_0x766c('0xc')]);router[_0x766c('0x8')](_0x766c('0xd'),auth[_0x766c('0xb')](),controller['getMessages']);router[_0x766c('0x8')](_0x766c('0xe'),auth[_0x766c('0xb')](),controller[_0x766c('0xf')]);router[_0x766c('0x10')]('/',auth['isAuthenticated'](),controller['create']);router[_0x766c('0x10')](_0x766c('0xd'),auth['isAuthenticated'](),controller[_0x766c('0x11')]);router['post'](_0x766c('0x12'),auth['isAuthenticated'](),interaction[_0x766c('0x13')]('openchannel','openchannelinteraction:addtags'),controller['addTags']);router[_0x766c('0x14')](_0x766c('0x15'),auth[_0x766c('0xb')](),interaction[_0x766c('0x13')]('openchannel',_0x766c('0x16')),controller[_0x766c('0x17')]);router[_0x766c('0x18')](_0x766c('0x15'),auth['isAuthenticated'](),interaction[_0x766c('0x13')](_0x766c('0x19'),_0x766c('0x1a')),controller[_0x766c('0x1b')]);router['delete'](_0x766c('0x12'),auth[_0x766c('0xb')](),controller[_0x766c('0x1c')]);module[_0x766c('0x1d')]=router; \ No newline at end of file +var _0x7fa9=['isAuthenticated','/describe','describe','/:id','getMessages','download','post','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','openchannelinteraction:update','update','delete','openchannelinteraction:destroy','multer','util','path','connect-timeout','express','../../components/auth/service','./openchannelInteraction.controller','get'];(function(_0x59fee2,_0x35c51b){var _0x12ddac=function(_0x5c2da5){while(--_0x5c2da5){_0x59fee2['push'](_0x59fee2['shift']());}};_0x12ddac(++_0x35c51b);}(_0x7fa9,0x1b2));var _0x97fa=function(_0x4b3ad2,_0x2752a4){_0x4b3ad2=_0x4b3ad2-0x0;var _0x35d9c4=_0x7fa9[_0x4b3ad2];return _0x35d9c4;};'use strict';var multer=require(_0x97fa('0x0'));var util=require(_0x97fa('0x1'));var path=require(_0x97fa('0x2'));var timeout=require(_0x97fa('0x3'));var express=require(_0x97fa('0x4'));var router=express['Router']();var auth=require(_0x97fa('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x97fa('0x6'));router[_0x97fa('0x7')]('/',auth[_0x97fa('0x8')](),controller['index']);router['get'](_0x97fa('0x9'),auth['isAuthenticated'](),controller[_0x97fa('0xa')]);router[_0x97fa('0x7')](_0x97fa('0xb'),auth[_0x97fa('0x8')](),controller['show']);router[_0x97fa('0x7')]('/:id/messages',auth['isAuthenticated'](),controller[_0x97fa('0xc')]);router[_0x97fa('0x7')]('/:id/download',auth[_0x97fa('0x8')](),controller[_0x97fa('0xd')]);router[_0x97fa('0xe')]('/',auth[_0x97fa('0x8')](),controller['create']);router['post']('/:id/messages',auth[_0x97fa('0x8')](),controller[_0x97fa('0xf')]);router['post'](_0x97fa('0x10'),auth[_0x97fa('0x8')](),interaction[_0x97fa('0x11')](_0x97fa('0x12'),_0x97fa('0x13')),controller[_0x97fa('0x14')]);router[_0x97fa('0x15')](_0x97fa('0xb'),auth[_0x97fa('0x8')](),interaction[_0x97fa('0x11')](_0x97fa('0x12'),_0x97fa('0x16')),controller[_0x97fa('0x17')]);router[_0x97fa('0x18')](_0x97fa('0xb'),auth[_0x97fa('0x8')](),interaction[_0x97fa('0x11')]('openchannel',_0x97fa('0x19')),controller['destroy']);router['delete']('/:id/tags',auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 4861ba6..8551fc8 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 _0x85ad=['exports','BOOLEAN','DATE','STRING','out','sequelize'];(function(_0x45bf86,_0x75586e){var _0x1f02b7=function(_0x1ea8a3){while(--_0x1ea8a3){_0x45bf86['push'](_0x45bf86['shift']());}};_0x1f02b7(++_0x75586e);}(_0x85ad,0x6b));var _0xd85a=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x85ad[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0xd85a('0x0'));module[_0xd85a('0x1')]={'closed':{'type':Sequelize[_0xd85a('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd85a('0x3')]},'disposition':{'type':Sequelize[_0xd85a('0x4')]},'note':{'type':Sequelize[_0xd85a('0x4')]},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize['STRING']},'externalUrl':{'type':Sequelize['STRING']},'lastMsgAt':{'type':Sequelize[_0xd85a('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xd85a('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xd85a('0x4')]}}; \ No newline at end of file +var _0xf196=['exports','STRING','DATE','ENUM','out','sequelize'];(function(_0x4b73a2,_0x40b5fe){var _0x383c66=function(_0x3917ae){while(--_0x3917ae){_0x4b73a2['push'](_0x4b73a2['shift']());}};_0x383c66(++_0x40b5fe);}(_0xf196,0xb9));var _0x6f19=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0xf196[_0x59ee6f];return _0x4c0979;};'use strict';var Sequelize=require(_0x6f19('0x0'));module[_0x6f19('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x6f19('0x2')]},'note':{'type':Sequelize[_0x6f19('0x2')]},'read1stAt':{'type':Sequelize[_0x6f19('0x3')]},'threadId':{'type':Sequelize[_0x6f19('0x2')]},'externalUrl':{'type':Sequelize[_0x6f19('0x2')]},'lastMsgAt':{'type':Sequelize[_0x6f19('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x6f19('0x4')]('in',_0x6f19('0x5')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x6f19('0x2')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index 939f443..c4a7d2a 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 _0x33f7=['text','start','body','some','compact','OpenchannelAccountId','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','isEmpty','t.id\x20IN\x20?','resolve','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.phone','Contact.mobile','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','OpenchannelInteractionId','all','rows','show','params','includeAll','create','destroy','describe','addMessage','OpenchannelMessage','ids','getMessages','findOne','$gte','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','openchannelInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','transcript-%d-%s.zip','CmContact','firstName','attachments','Attachment','direction','OpenchannelAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','format','YYYY-MM-DD','Openchannel','closed','closedAt','disposition','threadId','Public','Private','basename','createReadStream','pipe','createWriteStream','System','lastName','out','secret','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','update','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','forEach','push','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','field','color','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','from','user_has_openchannel_interactions','left_join','users','u.id\x20=\x20ui.UserId','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','having','`\x20>\x200','Contact','$substring','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','union','User','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x3d5f52,_0x26cfbe){var _0x3fa146=function(_0x3af1f1){while(--_0x3af1f1){_0x3d5f52['push'](_0x3d5f52['shift']());}};_0x3fa146(++_0x26cfbe);}(_0x33f7,0x7f));var _0x733f=function(_0xb66df,_0x4fb5ce){_0xb66df=_0xb66df-0x0;var _0x42a702=_0x33f7[_0xb66df];return _0x42a702;};'use strict';var pdf=require(_0x733f('0x0'));var emlformat=require(_0x733f('0x1'));var rimraf=require(_0x733f('0x2'));var zipdir=require(_0x733f('0x3'));var jsonpatch=require(_0x733f('0x4'));var rp=require(_0x733f('0x5'));var moment=require(_0x733f('0x6'));var BPromise=require(_0x733f('0x7'));var Mustache=require(_0x733f('0x8'));var util=require(_0x733f('0x9'));var path=require(_0x733f('0xa'));var sox=require(_0x733f('0xb'));var csv=require(_0x733f('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x733f('0xd'));var crypto=require(_0x733f('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x733f('0xf'));var toCsv=require(_0x733f('0xc'));var querystring=require(_0x733f('0x10'));var Papa=require(_0x733f('0x11'));var Redis=require(_0x733f('0x12'));var authService=require(_0x733f('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x733f('0x14'));var hardwareService=require(_0x733f('0x15'));var logger=require(_0x733f('0x16'))(_0x733f('0x17'));var utils=require(_0x733f('0x18'));var config=require(_0x733f('0x19'));var db=require(_0x733f('0x1a'))['db'];config['redis']=_[_0x733f('0x1b')](config[_0x733f('0x1c')],{'host':_0x733f('0x1d'),'port':0x18eb});var socket=require(_0x733f('0x1e'))(new Redis(config[_0x733f('0x1c')]));require(_0x733f('0x1f'))[_0x733f('0x20')](socket);function respondWithStatusCode(_0x116a33,_0xafc2e){_0xafc2e=_0xafc2e||0xcc;return function(_0x3d7e63){if(_0x3d7e63){return _0x116a33[_0x733f('0x21')](_0xafc2e);}return _0x116a33[_0x733f('0x22')](_0xafc2e)[_0x733f('0x23')]();};}function respondWithResult(_0x75dd10,_0x2229fe){_0x2229fe=_0x2229fe||0xc8;return function(_0x3d0fa3){if(_0x3d0fa3){return _0x75dd10[_0x733f('0x22')](_0x2229fe)[_0x733f('0x24')](_0x3d0fa3);}};}function respondWithFilteredResult(_0x8dbc48,_0x4707e5){return function(_0x5e8196){if(_0x5e8196){var _0x1ec019=_0x5e8196[_0x733f('0x25')],_0x2162a4=_0x4707e5[_0x733f('0x26')],_0x3678b7=_0x4707e5['offset']+_0x4707e5[_0x733f('0x27')],_0x243c20;if(_0x3678b7>=_0x1ec019){_0x3678b7=_0x1ec019;_0x243c20=0xc8;}else{_0x243c20=0xce;}_0x8dbc48[_0x733f('0x22')](_0x243c20);return _0x8dbc48[_0x733f('0x28')](_0x733f('0x29'),_0x2162a4+'-'+_0x3678b7+'/'+_0x1ec019)['json'](_0x5e8196);}return null;};}function patchUpdates(_0x3aadc0){return function(_0x80399b){try{jsonpatch['apply'](_0x80399b,_0x3aadc0,!![]);}catch(_0x4b5d43){return BPromise[_0x733f('0x2a')](_0x4b5d43);}return _0x80399b['save']();};}function saveUpdates(_0x15ad84,_0xe377c6){return function(_0x39b05a){if(_0x39b05a){return _0x39b05a[_0x733f('0x2b')](_0x15ad84)['then'](function(_0x3a413e){return _0x3a413e;});}return null;};}function removeEntity(_0x3ca0d9,_0x34e14b){return function(_0x2df98f){if(_0x2df98f){return _0x2df98f['destroy']()[_0x733f('0x2c')](function(){_0x3ca0d9['status'](0xcc)[_0x733f('0x23')]();});}};}function handleEntityNotFound(_0x19b6bc,_0x2bc121){return function(_0x1655d9){if(!_0x1655d9){_0x19b6bc[_0x733f('0x21')](0x194);}return _0x1655d9;};}function handleError(_0x132c76,_0x5d2a24){_0x5d2a24=_0x5d2a24||0x1f4;return function(_0x50aa14){logger[_0x733f('0x2d')](_0x50aa14[_0x733f('0x2e')]);if(_0x50aa14[_0x733f('0x2f')]){delete _0x50aa14[_0x733f('0x2f')];}_0x132c76[_0x733f('0x22')](_0x5d2a24)[_0x733f('0x30')](_0x50aa14);};}function getInteractionUsers(_0x4c4b5f,_0x41e585){return new BPromise(function(_0x2af69e,_0x3f8082){try{if(_0x41e585[_0x4c4b5f['id']]){_0x4c4b5f[_0x733f('0x31')]=_[_0x733f('0x32')](_0x41e585[_0x4c4b5f['id']],function(_0x1a378e){return{'id':_0x1a378e['id'],'fullname':_0x1a378e[_0x733f('0x33')]};});}}catch(_0x797421){_0x3f8082(_0x797421);}_0x2af69e(_0x4c4b5f);});}function getInteractionTags(_0xeba4a4,_0x4fdc24){return new BPromise(function(_0x37417c,_0x37f42a){try{if(_0xeba4a4[_0x733f('0x34')]){_0xeba4a4[_0x733f('0x35')]=[];_0xeba4a4[_0x733f('0x34')][_0x733f('0x36')](',')[_0x733f('0x37')](function(_0x261dee){_0xeba4a4['Tags'][_0x733f('0x38')](_0x4fdc24[_0x261dee]);});}delete _0xeba4a4['TagIds'];}catch(_0x47854d){_0x37f42a(_0x47854d);}_0x37417c(_0xeba4a4);});}function updateOpenchannelInteraction(_0x42cbad,_0x4913aa,_0x47881e){return new BPromise(function(_0x403c0f,_0x26412f){return getInteractionUsers(_0x42cbad,_0x47881e)[_0x733f('0x2c')](function(_0x332954){return getInteractionTags(_0x332954,_0x4913aa);})[_0x733f('0x2c')](function(_0x5eb091){_0x403c0f(_0x5eb091);})[_0x733f('0x39')](function(_0x46f133){_0x26412f(_0x46f133);});});}exports[_0x733f('0x3a')]=function(_0x17a37b,_0x10c0e2){var _0x2fd1af={},_0x2d200e={},_0x39f3f9={'count':0x0,'rows':[]};var _0x59398f=_[_0x733f('0x32')](db[_0x733f('0x3b')][_0x733f('0x3c')],function(_0x53a895){return{'name':_0x53a895[_0x733f('0x3d')],'type':_0x53a895[_0x733f('0x3e')][_0x733f('0x3f')]};});_0x2d200e[_0x733f('0x40')]=_[_0x733f('0x32')](_0x59398f,_0x733f('0x2f'));_0x2d200e[_0x733f('0x41')]=_[_0x733f('0x42')](_0x17a37b['query']);_0x2d200e[_0x733f('0x43')]=_['intersection'](_0x2d200e[_0x733f('0x40')],_0x2d200e[_0x733f('0x41')]);_0x2fd1af[_0x733f('0x44')]=_[_0x733f('0x45')](_0x2d200e['model'],qs['fields'](_0x17a37b[_0x733f('0x41')][_0x733f('0x46')]));_0x2fd1af[_0x733f('0x44')]=_0x2fd1af[_0x733f('0x44')][_0x733f('0x47')]?_0x2fd1af[_0x733f('0x44')]:_0x2d200e[_0x733f('0x40')];if(!_0x17a37b[_0x733f('0x41')][_0x733f('0x48')](_0x733f('0x49'))){_0x2fd1af[_0x733f('0x27')]=qs[_0x733f('0x27')](_0x17a37b[_0x733f('0x41')]['limit']);_0x2fd1af['offset']=qs[_0x733f('0x26')](_0x17a37b[_0x733f('0x41')]['offset']);}_0x2fd1af['order']=qs[_0x733f('0x4a')](_0x17a37b[_0x733f('0x41')][_0x733f('0x4a')]);_0x2fd1af[_0x733f('0x4b')]=qs[_0x733f('0x43')](_[_0x733f('0x4c')](_0x17a37b['query'],_0x2d200e[_0x733f('0x43')]));var _0x2c4163=[];var _0xb179f8=squel['select']()[_0x733f('0x4d')]('id')[_0x733f('0x4d')](_0x733f('0x2f'))[_0x733f('0x4d')](_0x733f('0x4e'))['from'](_0x733f('0x4f'));var _0x9c4d66=squel[_0x733f('0x50')]()[_0x733f('0x4d')](_0x733f('0x51'))[_0x733f('0x4d')](_0x733f('0x52'))[_0x733f('0x4d')](_0x733f('0x53'))[_0x733f('0x54')](_0x733f('0x55'),'ui')[_0x733f('0x56')](_0x733f('0x57'),'u',_0x733f('0x58'));var _0x7079f7=squel[_0x733f('0x50')]()['from']('openchannel_interactions','i')[_0x733f('0x56')](_0x733f('0x59'),'c',_0x733f('0x5a'))['left_join'](_0x733f('0x57'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x733f('0x5b'),'a',_0x733f('0x5c'))[_0x733f('0x56')](_0x733f('0x5d'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0x733f('0x56')](_0x733f('0x5e'),'it',_0x733f('0x5f'))[_0x733f('0x56')](_0x733f('0x4f'),'t','t.id\x20=\x20it.TagId');var _0x134c4d=squel[_0x733f('0x60')]();var _0x4d603d=[];var _0x5481db=squel[_0x733f('0x60')]();var _0x7ed5ee;if(_0x17a37b[_0x733f('0x41')][_0x733f('0x61')]){_0x7ed5ee=as['parseSearch'](_0x17a37b[_0x733f('0x41')][_0x733f('0x61')]);var _0x1c30b3=_0x7ed5ee[_0x733f('0x62')];for(var _0xf104de=0x0;_0xf104de<_0x7ed5ee[_0x733f('0x63')][_0x733f('0x47')];_0xf104de++){var _0x449d12=_0x7ed5ee[_0x733f('0x63')][_0xf104de];var _0x3ffe8f='i';var _0xed465e=_[_0x733f('0x64')](_0x59398f,['name',_0x449d12[_0x733f('0x4d')]]);if(!_0xed465e){switch(_0x449d12[_0x733f('0x4d')]){case _0x733f('0x65'):if(_0x449d12[_0x733f('0x66')]==0x1){_0x7079f7['having']('`'+_0x449d12[_0x733f('0x4d')]+_0x733f('0x67'));}else{_0x7079f7[_0x733f('0x68')]('`'+_0x449d12[_0x733f('0x4d')]+_0x733f('0x69'));}break;case _0x733f('0x6a'):if(_0x449d12['operator']===_0x733f('0x6b')){if(_0x449d12[_0x733f('0x66')][_0x733f('0x36')]('\x20')['length']>0x1){_0x134c4d[_0x1c30b3]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x733f('0x6c')](_0x449d12[_0x733f('0x66')]),null);}else{var _0x41495e='%'+_0x449d12['value']+'%';_0x134c4d[_0x1c30b3](_0x733f('0x6d'),_0x41495e,_0x41495e,_0x41495e);}}else{_0xed465e=_[_0x733f('0x64')](_0x59398f,[_0x733f('0x2f'),_0x733f('0x6e')]);_0x449d12[_0x733f('0x4d')]=_0x733f('0x6e');_0x15a8f6=as[_0x733f('0x6f')](_0x3ffe8f,_0xed465e[_0x733f('0x3e')],_0x449d12);_0x134c4d[_0x1c30b3](_0x15a8f6['text'],_0x15a8f6[_0x733f('0x66')]['start'],_0x15a8f6[_0x733f('0x66')][_0x733f('0x23')]);}break;case'Tag':var _0x56c4e9=_0x449d12['value'][_0x733f('0x36')](',')[_0x733f('0x32')](function(_0x2ad0f9){return Number(_0x2ad0f9);});_0x56c4e9[_0x733f('0x37')](function(_0x40e5b0){_0x5481db['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x40e5b0+',%');});_0x4d603d=_[_0x733f('0x70')](_0x4d603d,_0x56c4e9);break;case _0x733f('0x71'):if(_0x449d12[_0x733f('0x72')]===_0x733f('0x6b')){_0x134c4d[_0x1c30b3](_0x733f('0x73'),'%'+_0x449d12[_0x733f('0x66')]+'%',null);}else{_0xed465e=_[_0x733f('0x64')](_0x59398f,[_0x733f('0x2f'),_0x733f('0x74')]);_0x449d12[_0x733f('0x4d')]=_0x733f('0x74');_0x15a8f6=as[_0x733f('0x6f')](_0x3ffe8f,_0xed465e['type'],_0x449d12);_0x134c4d[_0x1c30b3](_0x15a8f6[_0x733f('0x75')],_0x15a8f6[_0x733f('0x66')][_0x733f('0x76')],_0x15a8f6[_0x733f('0x66')][_0x733f('0x23')]);}break;case _0x733f('0x77'):_0x15a8f6=as['buildExpression']('me',null,_0x449d12);_0x134c4d[_0x1c30b3](_0x15a8f6[_0x733f('0x75')],_0x15a8f6[_0x733f('0x66')]['start'],_0x15a8f6[_0x733f('0x66')][_0x733f('0x23')]);break;}}else{var _0x15a8f6=as[_0x733f('0x6f')](_0x3ffe8f,_0xed465e['type'],_0x449d12);_0x134c4d[_0x1c30b3](_0x15a8f6[_0x733f('0x75')],_0x15a8f6[_0x733f('0x66')][_0x733f('0x76')],_0x15a8f6[_0x733f('0x66')][_0x733f('0x23')]);}}}else{var _0x8b552f=_(_0x17a37b[_0x733f('0x41')])['keys']()['map'](function(_0x36fba7){return _[_0x733f('0x78')](_0x59398f,[_0x733f('0x2f'),_0x36fba7])?_0x36fba7:undefined;})[_0x733f('0x79')]()[_0x733f('0x66')]();if(!_['isEmpty'](_0x8b552f)){_0x8b552f['forEach'](function(_0xac54cf){if(_0xac54cf===_0x733f('0x7a')){_0x7079f7[_0x733f('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',[][_0x733f('0x7b')](_0x17a37b[_0x733f('0x41')][_0xac54cf]));}else if(_0xac54cf===_0x733f('0x7c')){var _0x45c11f=JSON[_0x733f('0x7d')](_0x17a37b[_0x733f('0x41')][_0xac54cf])['$gte'];var _0x596ee3=JSON[_0x733f('0x7d')](_0x17a37b['query'][_0xac54cf])[_0x733f('0x7e')];_0x7079f7[_0x733f('0x4b')](_0x733f('0x7f'),_0x45c11f,_0x596ee3);}else{if(_0x17a37b[_0x733f('0x41')][_0xac54cf]===_0x733f('0x80')){_0x7079f7['where']('i.'+_0xac54cf+'\x20IS\x20NULL');}else{_0x7079f7[_0x733f('0x4b')]('i.'+_0xac54cf+_0x733f('0x81'),_0x17a37b[_0x733f('0x41')][_0xac54cf]);}}});}if(_0x17a37b[_0x733f('0x41')][_0x733f('0x82')]){if(_0x17a37b[_0x733f('0x41')][_0x733f('0x82')]==0x1){_0x7079f7[_0x733f('0x68')](_0x733f('0x83'));}else{_0x7079f7[_0x733f('0x68')](_0x733f('0x84'));}}if(_0x17a37b[_0x733f('0x41')][_0x733f('0x85')]){_0x4d603d=_[_0x733f('0x86')](_0x17a37b[_0x733f('0x41')][_0x733f('0x85')])?_0x17a37b[_0x733f('0x41')][_0x733f('0x85')]:new Array(_0x17a37b[_0x733f('0x41')][_0x733f('0x85')]);_0x4d603d[_0x733f('0x37')](function(_0x3a9f9e){_0x5481db['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x3a9f9e+',%');});}if(_0x17a37b[_0x733f('0x41')]['filter']){var _0x441591=_0x17a37b[_0x733f('0x41')][_0x733f('0x87')][_0x733f('0x88')]('\x5c','\x5c\x5c')[_0x733f('0x88')]('\x27\x27',_0x733f('0x89'));if(qs[_0x733f('0x8a')](_0x441591)){_0x134c4d['or'](_0x733f('0x8b'),_0x441591+'%');}else{_0x134c4d['or'](_0x733f('0x8c'),qs[_0x733f('0x6c')](_0x441591))['or']('i.from\x20LIKE\x20?',_0x441591+'%')['or'](_0x733f('0x8d'),_0x441591+'%');}}}_0x7079f7[_0x733f('0x4b')](_0x134c4d);_0x7079f7['group'](_0x733f('0x8e'));var _0x551a8b={'type':db[_0x733f('0x8f')]['QueryTypes'][_0x733f('0x90')],'raw':!![]};var _0x4895fb=_0x7079f7[_0x733f('0x91')]();_0x4895fb[_0x733f('0x4d')]('i.id');_0x4895fb['field'](_0x733f('0x92'),_0x733f('0x65'));if(_0x2fd1af[_0x733f('0x93')]){_0x2fd1af[_0x733f('0x93')][_0x733f('0x37')](function(_0x1642df){_0x7079f7[_0x733f('0x93')]('i.'+_0x1642df[0x0],_0x1642df[0x1]===_0x733f('0x94')?![]:!![]);});}if(!_[_0x733f('0x95')](_0x4d603d)){_0x7079f7[_0x733f('0x68')](_0x5481db);_0x4895fb[_0x733f('0x4b')](_0x733f('0x96'),_0x4d603d);}BPromise[_0x733f('0x97')]()[_0x733f('0x2c')](function(){if(!_0x7ed5ee){if(_0x17a37b[_0x733f('0x41')][_0x733f('0x7a')]||_0x17a37b[_0x733f('0x41')]['journey'])return;_0x4895fb['where'](_0x733f('0x98'));_0x7079f7[_0x733f('0x4b')](_0x733f('0x98'));return;}return _0x17a37b['user'][_0x733f('0x99')]({'attributes':['id'],'raw':!![]})[_0x733f('0x2c')](function(_0x3af0df){if(_[_0x733f('0x95')](_0x3af0df)){_0x4895fb[_0x733f('0x4b')](_0x733f('0x9a'));_0x7079f7[_0x733f('0x4b')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x4895fb[_0x733f('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',_['map'](_0x3af0df,'id'));_0x7079f7[_0x733f('0x4b')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x733f('0x32')](_0x3af0df,'id'));}});})[_0x733f('0x2c')](function(){db[_0x733f('0x9b')]['query'](_0x4895fb[_0x733f('0x9c')](),_0x551a8b)[_0x733f('0x2c')](function(_0x2138ea){_0x39f3f9[_0x733f('0x25')]=_0x2138ea[_0x733f('0x47')];if(_0x39f3f9[_0x733f('0x25')]===0x0)return[];return db[_0x733f('0x9b')]['query'](_0xb179f8[_0x733f('0x9c')](),_0x551a8b)[_0x733f('0x2c')](function(_0x5c9a29){_0x2c4163=_[_0x733f('0x9d')](_0x5c9a29,'id');_0x551a8b=_[_0x733f('0x9e')](_0x551a8b,{'model':db[_0x733f('0x3b')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x17a37b[_0x733f('0x41')][_0x733f('0x46')]){_0x2fd1af[_0x733f('0x44')][_0x733f('0x37')](function(_0xa5953a){_0x7079f7['field']('i.'+_0xa5953a);});}else{_0x7079f7[_0x733f('0x4d')](_0x733f('0x92'),_0x733f('0x65'));_0x7079f7[_0x733f('0x4d')](_0x733f('0x9f'),'Account.key');_0x7079f7['field'](_0x733f('0xa0'),_0x733f('0xa1'));_0x7079f7[_0x733f('0x4d')](_0x733f('0xa2'));_0x7079f7['field'](_0x733f('0xa3'),_0x733f('0xa4'));_0x7079f7['field'](_0x733f('0xa5'),_0x733f('0xa6'));_0x7079f7[_0x733f('0x4d')](_0x733f('0xa7'),'Contact.email');_0x7079f7['field']('c.phone',_0x733f('0xa8'));_0x7079f7[_0x733f('0x4d')]('c.mobile',_0x733f('0xa9'));_0x7079f7[_0x733f('0x4d')]('c.fax',_0x733f('0xaa'));_0x7079f7['field'](_0x733f('0xab'),'Owner.fullname');_0x7079f7[_0x733f('0x4d')](_0x733f('0xac'),_0x733f('0xad'));_0x7079f7[_0x733f('0x4d')](_0x733f('0xae'),'TagIds');}_0x7079f7[_0x733f('0x27')](_0x2fd1af[_0x733f('0x27')]);_0x7079f7['offset'](_0x2fd1af[_0x733f('0x26')]);return db['sequelize']['query'](_0x7079f7['toString'](),_0x551a8b);})[_0x733f('0x2c')](function(_0x2bc8b6){_0x9c4d66[_0x733f('0x4b')]('ui.OpenchannelInteractionId\x20IN\x20?',_['map'](_0x2bc8b6,'id'));return db[_0x733f('0x9b')]['query'](_0x9c4d66['toString'](),_0x551a8b)[_0x733f('0x2c')](function(_0x373d9a){var _0x1f434b=_[_0x733f('0xaf')](_0x373d9a,_0x733f('0xb0'));var _0x42fe8e=[];_0x2bc8b6[_0x733f('0x37')](function(_0x14c2e3){_0x42fe8e[_0x733f('0x38')](updateOpenchannelInteraction(_0x14c2e3,_0x2c4163,_0x1f434b));});return BPromise[_0x733f('0xb1')](_0x42fe8e);});});})[_0x733f('0x2c')](function(_0x40ed9d){_0x39f3f9[_0x733f('0xb2')]=_0x40ed9d;return _0x39f3f9;})['then'](respondWithFilteredResult(_0x10c0e2,_0x2fd1af));})[_0x733f('0x39')](handleError(_0x10c0e2,null));};exports[_0x733f('0xb3')]=function(_0x2918f7,_0x2475a9){var _0x1e7cc5={'raw':![],'where':{'id':_0x2918f7[_0x733f('0xb4')]['id']}},_0x3d50ea={};_0x3d50ea[_0x733f('0x40')]=_[_0x733f('0x42')](db[_0x733f('0x3b')][_0x733f('0x3c')]);_0x3d50ea['query']=_[_0x733f('0x42')](_0x2918f7[_0x733f('0x41')]);_0x3d50ea[_0x733f('0x43')]=_['intersection'](_0x3d50ea[_0x733f('0x40')],_0x3d50ea['query']);_0x1e7cc5['attributes']=_[_0x733f('0x45')](_0x3d50ea[_0x733f('0x40')],qs['fields'](_0x2918f7['query'][_0x733f('0x46')]));_0x1e7cc5[_0x733f('0x44')]=_0x1e7cc5[_0x733f('0x44')][_0x733f('0x47')]?_0x1e7cc5[_0x733f('0x44')]:_0x3d50ea['model'];if(_0x2918f7['query'][_0x733f('0xb5')]){_0x1e7cc5['include']=[{'all':!![]}];}_0x1e7cc5=_[_0x733f('0x9e')]({},_0x1e7cc5,_0x2918f7['options']);return db[_0x733f('0x3b')][_0x733f('0x64')](_0x1e7cc5)['then'](handleEntityNotFound(_0x2475a9,null))[_0x733f('0x2c')](respondWithResult(_0x2475a9,null))[_0x733f('0x39')](handleError(_0x2475a9,null));};exports[_0x733f('0xb6')]=function(_0x246e47,_0x404d93){return db[_0x733f('0x3b')][_0x733f('0xb6')](_0x246e47[_0x733f('0x77')],{})[_0x733f('0x2c')](respondWithResult(_0x404d93,0xc9))[_0x733f('0x39')](handleError(_0x404d93,null));};exports[_0x733f('0x2b')]=function(_0x277e0d,_0x299345){if(_0x277e0d['body']['id']){delete _0x277e0d[_0x733f('0x77')]['id'];}return db['OpenchannelInteraction'][_0x733f('0x64')]({'where':{'id':_0x277e0d[_0x733f('0xb4')]['id']}})['then'](handleEntityNotFound(_0x299345,null))[_0x733f('0x2c')](saveUpdates(_0x277e0d['body'],null))[_0x733f('0x2c')](respondWithResult(_0x299345,null))[_0x733f('0x39')](handleError(_0x299345,null));};exports[_0x733f('0xb7')]=function(_0x2fb671,_0x5af13c){return db['OpenchannelInteraction']['find']({'where':{'id':_0x2fb671[_0x733f('0xb4')]['id']}})['then'](handleEntityNotFound(_0x5af13c,null))[_0x733f('0x2c')](removeEntity(_0x5af13c,null))[_0x733f('0x39')](handleError(_0x5af13c,null));};exports[_0x733f('0xb8')]=function(_0x40eb85,_0x34d203){return db[_0x733f('0x3b')][_0x733f('0xb8')]()[_0x733f('0x2c')](respondWithResult(_0x34d203,null))[_0x733f('0x39')](handleError(_0x34d203,null));};exports[_0x733f('0xb9')]=function(_0x5e4a5b,_0x497a92,_0x4e9e65){return db[_0x733f('0xba')][_0x733f('0x64')]({'where':{'id':_0x5e4a5b[_0x733f('0xb4')]['id']}})[_0x733f('0x2c')](handleEntityNotFound(_0x497a92,null))[_0x733f('0x2c')](function(_0x3ef074){if(_0x3ef074){return _0x3ef074[_0x733f('0xb9')](_0x5e4a5b[_0x733f('0x77')][_0x733f('0xbb')],_['omit'](_0x5e4a5b[_0x733f('0x77')],[_0x733f('0xbb'),'id'])||{});}})['then'](respondWithResult(_0x497a92,null))['catch'](handleError(_0x497a92,null));};exports[_0x733f('0xbc')]=function(_0x10bf4f,_0x415f4e,_0x31f4fe){var _0x184910={'raw':![],'where':{}};var _0x198e57={};var _0x1b3f21={'count':0x0,'rows':[]};return db[_0x733f('0x3b')][_0x733f('0xbd')]({'where':{'id':_0x10bf4f[_0x733f('0xb4')]['id']}})['then'](handleEntityNotFound(_0x415f4e,null))[_0x733f('0x2c')](function(_0x184c03){if(_0x184c03){_0x198e57['model']=_[_0x733f('0x42')](db[_0x733f('0xba')][_0x733f('0x3c')]);_0x198e57[_0x733f('0x41')]=_['keys'](_0x10bf4f['query']);_0x198e57['filters']=_[_0x733f('0x45')](_0x198e57[_0x733f('0x40')],_0x198e57['query']);_0x184910[_0x733f('0x44')]=_[_0x733f('0x45')](_0x198e57[_0x733f('0x40')],qs['fields'](_0x10bf4f[_0x733f('0x41')][_0x733f('0x46')]));_0x184910['attributes']=_0x184910[_0x733f('0x44')][_0x733f('0x47')]?_0x184910[_0x733f('0x44')]:_0x198e57['model'];if(!_0x10bf4f['query'][_0x733f('0x48')](_0x733f('0x49'))){_0x184910[_0x733f('0x27')]=qs[_0x733f('0x27')](_0x10bf4f[_0x733f('0x41')][_0x733f('0x27')]);_0x184910[_0x733f('0x26')]=qs[_0x733f('0x26')](_0x10bf4f[_0x733f('0x41')][_0x733f('0x26')]);}_0x184910['order']=qs['sort'](_0x10bf4f[_0x733f('0x41')][_0x733f('0x4a')]);_0x184910[_0x733f('0x4b')]=qs['filters'](_['pick'](_0x10bf4f[_0x733f('0x41')],_0x198e57['filters']));_0x184910[_0x733f('0x4b')][_0x733f('0xb0')]=_0x184c03['id'];if(_0x10bf4f[_0x733f('0x41')]['filter']){_0x184910[_0x733f('0x4b')]=_[_0x733f('0x9e')](_0x184910[_0x733f('0x4b')],{'$or':_[_0x733f('0x32')](_0x184910[_0x733f('0x44')],function(_0x1aa6ae){var _0xd72720={};_0xd72720[_0x1aa6ae]={'$like':'%'+_0x10bf4f[_0x733f('0x41')][_0x733f('0x87')]+'%'};return _0xd72720;})});}if(_0x10bf4f[_0x733f('0x41')][_0x733f('0xbe')]){var _0x1a72b2=_0x10bf4f[_0x733f('0x41')][_0x733f('0xbe')][_0x733f('0x36')](',');var _0x344978={};_0x344978[_0x1a72b2[0x0]]={'$gte':moment(_0x1a72b2[0x1])['format'](_0x733f('0xbf'))};_0x184910[_0x733f('0x4b')]=_[_0x733f('0x9e')](_0x184910['where'],_0x344978);}_0x184910=_[_0x733f('0x9e')]({},_0x184910,_0x10bf4f['options']);return db['OpenchannelMessage'][_0x733f('0x25')]({'where':_0x184910[_0x733f('0x4b')]})[_0x733f('0x2c')](function(_0x378460){_0x1b3f21[_0x733f('0x25')]=_0x378460;if(_0x10bf4f['query'][_0x733f('0xb5')]){_0x184910['include']=[{'all':!![]}];}return db[_0x733f('0xba')][_0x733f('0xc0')](_0x184910);})[_0x733f('0x2c')](function(_0xf35046){_0x1b3f21[_0x733f('0xb2')]=_0xf35046;return _0x1b3f21;});}})[_0x733f('0x2c')](respondWithFilteredResult(_0x415f4e,_0x184910))[_0x733f('0x39')](handleError(_0x415f4e,null));};exports['addTags']=function(_0x477777,_0xbc7ba3,_0x54bbcf){return db[_0x733f('0x3b')]['find']({'where':{'id':_0x477777[_0x733f('0xb4')]['id']}})[_0x733f('0x2c')](handleEntityNotFound(_0xbc7ba3,null))['then'](function(_0xb4629b){if(_0xb4629b){return _0xb4629b[_0x733f('0xc1')](_0x477777[_0x733f('0x77')][_0x733f('0xbb')],_[_0x733f('0xc2')](_0x477777[_0x733f('0x77')],['ids','id'])||{})[_0x733f('0xc3')](function(){return db['Tag'][_0x733f('0xc0')]({'attributes':['id',_0x733f('0x2f'),_0x733f('0x4e')],'where':{'id':_0x477777[_0x733f('0x77')][_0x733f('0xbb')]}});})[_0x733f('0x2c')](function(_0x25ca29){socket['emit'](_0x733f('0xc4'),{'id':Number(_0x477777['params']['id']),'tags':_0x25ca29||[]});return{'id':Number(_0x477777[_0x733f('0xb4')]['id']),'tags':_0x25ca29||[]};});}})[_0x733f('0x2c')](respondWithResult(_0xbc7ba3,null))[_0x733f('0x39')](handleError(_0xbc7ba3,null));};exports[_0x733f('0xc5')]=function(_0x31509d,_0x5fef3f,_0x331b99){return db[_0x733f('0x3b')]['find']({'where':{'id':_0x31509d[_0x733f('0xb4')]['id']}})[_0x733f('0x2c')](handleEntityNotFound(_0x5fef3f,null))[_0x733f('0x2c')](function(_0x2b2dec){if(_0x2b2dec){return _0x2b2dec[_0x733f('0xc5')](_0x31509d[_0x733f('0x41')][_0x733f('0xbb')]);}})[_0x733f('0x2c')](respondWithStatusCode(_0x5fef3f,null))[_0x733f('0x39')](handleError(_0x5fef3f,null));};exports[_0x733f('0xc6')]=function(_0x109fbc,_0x3b5cd6){var _0x853f26=moment()[_0x733f('0xc7')]()[_0x733f('0x9c')]();var _0x2f4006=path[_0x733f('0xc8')](config['root'],_0x733f('0xc9'),_0x733f('0xca'),_0x733f('0xcb'));var _0x4e8369=path[_0x733f('0xc8')](config[_0x733f('0xcc')],_0x733f('0xc9'),_0x733f('0xca'),'attachments');var _0x5bd619=path[_0x733f('0xc8')](_0x2f4006,_0x853f26);var _0x289f58=util['format'](_0x733f('0xcd'),_0x109fbc['params']['id'],_0x853f26);var _0x13ed8f=path[_0x733f('0xc8')](_0x2f4006,_0x289f58);var _0x108820=[];_0x108820[_0x733f('0x38')]({'model':db[_0x733f('0x71')],'as':_0x733f('0x71'),'attributes':['id',_0x733f('0x33')],'raw':!![]});_0x108820['push']({'model':db[_0x733f('0xce')],'as':_0x733f('0x6a'),'attributes':['id',_0x733f('0xcf'),'lastName'],'raw':!![]});if(_0x109fbc['query'][_0x733f('0xd0')]){_0x108820['push']({'model':db[_0x733f('0xd1')],'as':'Attachment','raw':!![]});}var _0x94e5bd=[{'model':db[_0x733f('0xba')],'as':'Messages','attributes':['id','body',_0x733f('0x7c'),_0x733f('0xd2'),'secret',_0x733f('0x82')],'include':_0x108820}];_0x94e5bd[_0x733f('0x38')]({'model':db[_0x733f('0xd3')],'as':_0x733f('0xd4'),'attributes':['id',_0x733f('0x2f')]});_0x94e5bd[_0x733f('0x38')]({'model':db['User'],'as':_0x733f('0xd5'),'attributes':['id',_0x733f('0x33')]});return db[_0x733f('0x3b')][_0x733f('0x64')]({'where':{'id':_0x109fbc[_0x733f('0xb4')]['id']},'include':_0x94e5bd})[_0x733f('0x2c')](handleEntityNotFound(_0x3b5cd6,null))[_0x733f('0x2c')](function(_0x5e6cfe){if(_0x5e6cfe){var _0x614958=_0x5e6cfe[_0x733f('0xd6')]({'plain':!![]});fs[_0x733f('0xd7')](_0x5bd619);var _0x36273b={'format':'A4','border':_0x733f('0xd8'),'header':{'height':'40px','contents':{'first':_0x733f('0xd9')}},'footer':{'height':_0x733f('0xda'),'contents':{'default':util[_0x733f('0xdb')]('\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',util[_0x733f('0xdb')]('%s\x20#%d','Openchannel',_0x614958['id']),moment()[_0x733f('0xdb')](_0x733f('0xdc'))['toString']())}}};var _0x8d2904={'channel':_0x733f('0xdd'),'account':_0x614958[_0x733f('0xd4')][_0x733f('0x2f')],'agent':_0x614958['Owner']?_0x614958[_0x733f('0xd5')][_0x733f('0x33')]:'N.A.','createdAt':moment(_0x614958[_0x733f('0x7c')])[_0x733f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')[_0x733f('0x9c')](),'closedAt':_0x614958[_0x733f('0xde')]?moment(_0x614958[_0x733f('0xdf')])[_0x733f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x614958[_0x733f('0xe0')],'visibility':_0x614958[_0x733f('0xe1')]?_0x733f('0xe2'):_0x733f('0xe3'),'messages':_(_0x614958['Messages'])[_0x733f('0x87')]({'secret':![]})[_0x733f('0x32')](function(_0x2c8679){if(_0x2c8679['Attachment']){var _0x508666=path['join'](_0x4e8369,_0x2c8679[_0x733f('0xd1')][_0x733f('0xe4')]);if(fs['existsSync'](_0x508666)){fs[_0x733f('0xe5')](_0x508666)[_0x733f('0xe6')](fs[_0x733f('0xe7')](path[_0x733f('0xc8')](_0x5bd619,_0x2c8679[_0x733f('0xd1')][_0x733f('0xe4')])));}}return{'date':moment(_0x2c8679[_0x733f('0x7c')])[_0x733f('0xdb')]('YYYY-MM-DD\x20HH:mm:ss')['toString'](),'sender':_0x2c8679[_0x733f('0xd2')]==='out'?_0x2c8679[_0x733f('0x71')]?_0x2c8679[_0x733f('0x71')][_0x733f('0x33')]:_0x733f('0xe8'):_0x2c8679[_0x733f('0x6a')][_0x733f('0xcf')]+(_0x2c8679['Contact'][_0x733f('0xe9')]?'\x20'+_0x2c8679[_0x733f('0x6a')][_0x733f('0xe9')]:''),'body':_0x2c8679[_0x733f('0xd1')]?_0x2c8679[_0x733f('0xd1')][_0x733f('0xe4')]:_0x2c8679[_0x733f('0x77')],'direction':_0x2c8679[_0x733f('0xd2')]===_0x733f('0xea')?'A':'C','secret':_0x2c8679[_0x733f('0xeb')],'read':_0x2c8679[_0x733f('0x82')],'attachment':_0x2c8679[_0x733f('0xd1')]};})[_0x733f('0x66')]()};return ejs[_0x733f('0xec')](path[_0x733f('0xc8')](config['root'],'server',_0x733f('0xed'),_0x733f('0xee')),{'interaction':_0x8d2904})[_0x733f('0x2c')](function(_0x4dac20){return new BPromise(function(_0x15297a,_0x4b82ff){pdf[_0x733f('0xb6')](_0x4dac20,_0x36273b)[_0x733f('0xef')](path[_0x733f('0xc8')](_0x5bd619,_0x733f('0xf0')+_0x614958['id']+'-'+_0x853f26+_0x733f('0xf1')),function(_0x3d99f3,_0x3bd1a5){if(_0x3d99f3)return _0x4b82ff(_0x3d99f3);_0x15297a(_0x3bd1a5);});});})['then'](function(){return new BPromise(function(_0x4806d4,_0x59a0cf){zipdir(_0x5bd619,{'saveTo':_0x13ed8f},function(_0x1b59d2,_0x509e3b){if(_0x1b59d2)return _0x59a0cf(_0x1b59d2);return _0x4806d4(_0x509e3b);});})['then'](function(){return new BPromise(function(_0x324db2,_0x22ae77){rimraf(_0x5bd619,function(_0xb6ccfb){if(_0xb6ccfb)_0x22ae77(_0xb6ccfb);return _0x324db2();});});})[_0x733f('0x2c')](function(){return _0x3b5cd6[_0x733f('0xc6')](_0x13ed8f,_0x289f58,function(_0xc3e322){if(_0xc3e322){console[_0x733f('0xf2')](_0x733f('0xf3'),_0xc3e322);}else{fs['unlinkSync'](_0x13ed8f);}});});});}else{return _0x3b5cd6[_0x733f('0x21')](0xc8);}})[_0x733f('0x39')](handleError(_0x3b5cd6,null));}; \ No newline at end of file +var _0xb35a=['offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','catch','index','OpenchannelInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','select','field','color','from','u.id','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','openchannel_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId','openchannel_messages','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','text','body','some','isEmpty','i.OpenchannelAccountId\x20IN\x20?','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','i.from\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','resolve','OpenchannelAccountId','i.OpenchannelAccountId\x20IS\x20NOT\x20NULL','user','getOpenchannelAccounts','i.OpenchannelAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','c.lastName','Contact.lastName','Contact.email','Contact.phone','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','push','all','rows','show','params','includeAll','include','options','create','describe','addMessage','OpenchannelMessage','ids','omit','getMessages','format','YYYY-MM-DD\x20HH:mm:ss','addTags','spread','findAll','emit','openchannelInteractionTags:save','removeTags','join','root','server','files','attachments','transcript-%d-%s.zip','fullname','CmContact','firstName','lastName','direction','secret','Account','mkdirSync','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','Owner','closed','disposition','threadId','Public','Messages','Attachment','basename','existsSync','pipe','createWriteStream','out','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','download','log','err','unlinkSync','sendStatus','html-pdf','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','./openchannelInteraction.socket','status','end','json','count'];(function(_0x35fc18,_0x1bc2d0){var _0x50d96d=function(_0xbd46a2){while(--_0xbd46a2){_0x35fc18['push'](_0x35fc18['shift']());}};_0x50d96d(++_0x1bc2d0);}(_0xb35a,0x1b6));var _0xab35=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xb35a[_0x441563];return _0x2369ec;};'use strict';var pdf=require(_0xab35('0x0'));var emlformat=require(_0xab35('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xab35('0x2'));var jsonpatch=require(_0xab35('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xab35('0x4'));var Mustache=require(_0xab35('0x5'));var util=require(_0xab35('0x6'));var path=require(_0xab35('0x7'));var sox=require('sox');var csv=require(_0xab35('0x8'));var ejs=require(_0xab35('0x9'));var fs=require('fs');var _=require(_0xab35('0xa'));var squel=require(_0xab35('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xab35('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xab35('0xd'));var Redis=require(_0xab35('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xab35('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xab35('0x10'))(_0xab35('0x11'));var utils=require(_0xab35('0x12'));var config=require(_0xab35('0x13'));var db=require(_0xab35('0x14'))['db'];config['redis']=_[_0xab35('0x15')](config['redis'],{'host':_0xab35('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xab35('0x17'))['register'](socket);function respondWithStatusCode(_0x574d4b,_0x7a50c2){_0x7a50c2=_0x7a50c2||0xcc;return function(_0x97837f){if(_0x97837f){return _0x574d4b['sendStatus'](_0x7a50c2);}return _0x574d4b[_0xab35('0x18')](_0x7a50c2)[_0xab35('0x19')]();};}function respondWithResult(_0x1e74b9,_0x28cb8e){_0x28cb8e=_0x28cb8e||0xc8;return function(_0x5097a5){if(_0x5097a5){return _0x1e74b9[_0xab35('0x18')](_0x28cb8e)[_0xab35('0x1a')](_0x5097a5);}};}function respondWithFilteredResult(_0x324510,_0xfb378a){return function(_0x58a26c){if(_0x58a26c){var _0x2c04ac=_0x58a26c[_0xab35('0x1b')],_0x32aa7c=_0xfb378a[_0xab35('0x1c')],_0x14efce=_0xfb378a[_0xab35('0x1c')]+_0xfb378a[_0xab35('0x1d')],_0x4574be;if(_0x14efce>=_0x2c04ac){_0x14efce=_0x2c04ac;_0x4574be=0xc8;}else{_0x4574be=0xce;}_0x324510['status'](_0x4574be);return _0x324510[_0xab35('0x1e')](_0xab35('0x1f'),_0x32aa7c+'-'+_0x14efce+'/'+_0x2c04ac)[_0xab35('0x1a')](_0x58a26c);}return null;};}function patchUpdates(_0x193767){return function(_0x2a34fc){try{jsonpatch[_0xab35('0x20')](_0x2a34fc,_0x193767,!![]);}catch(_0x624c3a){return BPromise[_0xab35('0x21')](_0x624c3a);}return _0x2a34fc[_0xab35('0x22')]();};}function saveUpdates(_0x3a6707,_0x2526a0){return function(_0x509ed1){if(_0x509ed1){return _0x509ed1[_0xab35('0x23')](_0x3a6707)['then'](function(_0x1b7783){return _0x1b7783;});}return null;};}function removeEntity(_0x4f9eb6,_0x34223c){return function(_0x353e88){if(_0x353e88){return _0x353e88[_0xab35('0x24')]()[_0xab35('0x25')](function(){_0x4f9eb6['status'](0xcc)[_0xab35('0x19')]();});}};}function handleEntityNotFound(_0x526b2f,_0x42aea8){return function(_0x216b3e){if(!_0x216b3e){_0x526b2f['sendStatus'](0x194);}return _0x216b3e;};}function handleError(_0x5b38a6,_0x24757f){_0x24757f=_0x24757f||0x1f4;return function(_0x39cfd3){logger[_0xab35('0x26')](_0x39cfd3[_0xab35('0x27')]);if(_0x39cfd3[_0xab35('0x28')]){delete _0x39cfd3[_0xab35('0x28')];}_0x5b38a6[_0xab35('0x18')](_0x24757f)[_0xab35('0x29')](_0x39cfd3);};}function getInteractionUsers(_0x45bddb,_0x16294f){return new BPromise(function(_0x429c0c,_0x306ed5){try{if(_0x16294f[_0x45bddb['id']]){_0x45bddb[_0xab35('0x2a')]=_[_0xab35('0x2b')](_0x16294f[_0x45bddb['id']],function(_0x4b82ef){return{'id':_0x4b82ef['id'],'fullname':_0x4b82ef['fullname']};});}}catch(_0x3a5f0f){_0x306ed5(_0x3a5f0f);}_0x429c0c(_0x45bddb);});}function getInteractionTags(_0x3f7103,_0x641a5b){return new BPromise(function(_0x5090b6,_0x477743){try{if(_0x3f7103[_0xab35('0x2c')]){_0x3f7103['Tags']=[];_0x3f7103[_0xab35('0x2c')][_0xab35('0x2d')](',')[_0xab35('0x2e')](function(_0x1bc719){_0x3f7103[_0xab35('0x2f')]['push'](_0x641a5b[_0x1bc719]);});}delete _0x3f7103[_0xab35('0x2c')];}catch(_0x4feca4){_0x477743(_0x4feca4);}_0x5090b6(_0x3f7103);});}function updateOpenchannelInteraction(_0x356c8f,_0x2d2de0,_0x541dab){return new BPromise(function(_0x2995aa,_0x1e2ba4){return getInteractionUsers(_0x356c8f,_0x541dab)[_0xab35('0x25')](function(_0x3b7f31){return getInteractionTags(_0x3b7f31,_0x2d2de0);})[_0xab35('0x25')](function(_0x54b1d9){_0x2995aa(_0x54b1d9);})[_0xab35('0x30')](function(_0x38d3a4){_0x1e2ba4(_0x38d3a4);});});}exports[_0xab35('0x31')]=function(_0x51d93f,_0x46a443){var _0x4fbd7e={},_0x4b9239={},_0x4b430b={'count':0x0,'rows':[]};var _0x292221=_['map'](db[_0xab35('0x32')][_0xab35('0x33')],function(_0x13061e){return{'name':_0x13061e[_0xab35('0x34')],'type':_0x13061e[_0xab35('0x35')][_0xab35('0x36')]};});_0x4b9239[_0xab35('0x37')]=_[_0xab35('0x2b')](_0x292221,_0xab35('0x28'));_0x4b9239[_0xab35('0x38')]=_[_0xab35('0x39')](_0x51d93f[_0xab35('0x38')]);_0x4b9239[_0xab35('0x3a')]=_[_0xab35('0x3b')](_0x4b9239[_0xab35('0x37')],_0x4b9239[_0xab35('0x38')]);_0x4fbd7e[_0xab35('0x3c')]=_[_0xab35('0x3b')](_0x4b9239[_0xab35('0x37')],qs['fields'](_0x51d93f[_0xab35('0x38')][_0xab35('0x3d')]));_0x4fbd7e[_0xab35('0x3c')]=_0x4fbd7e[_0xab35('0x3c')][_0xab35('0x3e')]?_0x4fbd7e[_0xab35('0x3c')]:_0x4b9239[_0xab35('0x37')];if(!_0x51d93f[_0xab35('0x38')][_0xab35('0x3f')](_0xab35('0x40'))){_0x4fbd7e[_0xab35('0x1d')]=qs[_0xab35('0x1d')](_0x51d93f[_0xab35('0x38')][_0xab35('0x1d')]);_0x4fbd7e[_0xab35('0x1c')]=qs[_0xab35('0x1c')](_0x51d93f[_0xab35('0x38')][_0xab35('0x1c')]);}_0x4fbd7e['order']=qs[_0xab35('0x41')](_0x51d93f[_0xab35('0x38')][_0xab35('0x41')]);_0x4fbd7e[_0xab35('0x42')]=qs['filters'](_[_0xab35('0x43')](_0x51d93f[_0xab35('0x38')],_0x4b9239[_0xab35('0x3a')]));var _0x1b1690=[];var _0x53b465=squel[_0xab35('0x44')]()[_0xab35('0x45')]('id')[_0xab35('0x45')](_0xab35('0x28'))['field'](_0xab35('0x46'))[_0xab35('0x47')]('tools_tags');var _0x4be1a9=squel[_0xab35('0x44')]()[_0xab35('0x45')](_0xab35('0x48'))[_0xab35('0x45')]('u.fullname')[_0xab35('0x45')](_0xab35('0x49'))[_0xab35('0x47')](_0xab35('0x4a'),'ui')[_0xab35('0x4b')]('users','u',_0xab35('0x4c'));var _0x20bce0=squel[_0xab35('0x44')]()[_0xab35('0x47')](_0xab35('0x4d'),'i')[_0xab35('0x4b')](_0xab35('0x4e'),'c',_0xab35('0x4f'))[_0xab35('0x4b')](_0xab35('0x50'),'o',_0xab35('0x51'))[_0xab35('0x4b')](_0xab35('0x52'),'a',_0xab35('0x53'))[_0xab35('0x4b')](_0xab35('0x54'),'me','me.OpenchannelInteractionId\x20=\x20i.id')[_0xab35('0x4b')](_0xab35('0x55'),'it',_0xab35('0x56'))['left_join']('tools_tags','t',_0xab35('0x57'));var _0x174d13=squel[_0xab35('0x58')]();var _0x56be85=[];var _0x4ef89e=squel[_0xab35('0x58')]();var _0x4c3cb9;if(_0x51d93f[_0xab35('0x38')][_0xab35('0x59')]){_0x4c3cb9=as[_0xab35('0x5a')](_0x51d93f[_0xab35('0x38')][_0xab35('0x59')]);var _0x2d6b69=_0x4c3cb9['sqlOperator'];for(var _0x32dfc5=0x0;_0x32dfc5<_0x4c3cb9[_0xab35('0x5b')]['length'];_0x32dfc5++){var _0x25ae73=_0x4c3cb9['conditions'][_0x32dfc5];var _0x57d2af='i';var _0x54aa52=_[_0xab35('0x5c')](_0x292221,[_0xab35('0x28'),_0x25ae73[_0xab35('0x45')]]);if(!_0x54aa52){switch(_0x25ae73['field']){case _0xab35('0x5d'):if(_0x25ae73[_0xab35('0x5e')]==0x1){_0x20bce0[_0xab35('0x5f')]('`'+_0x25ae73[_0xab35('0x45')]+_0xab35('0x60'));}else{_0x20bce0[_0xab35('0x5f')]('`'+_0x25ae73[_0xab35('0x45')]+_0xab35('0x61'));}break;case _0xab35('0x62'):if(_0x25ae73[_0xab35('0x63')]===_0xab35('0x64')){if(_0x25ae73[_0xab35('0x5e')]['split']('\x20')['length']>0x1){_0x174d13[_0x2d6b69](_0xab35('0x65'),qs['getFullTextValue'](_0x25ae73[_0xab35('0x5e')]),null);}else{var _0x4df156='%'+_0x25ae73[_0xab35('0x5e')]+'%';_0x174d13[_0x2d6b69](_0xab35('0x66'),_0x4df156,_0x4df156,_0x4df156);}}else{_0x54aa52=_[_0xab35('0x5c')](_0x292221,[_0xab35('0x28'),'ContactId']);_0x25ae73[_0xab35('0x45')]=_0xab35('0x67');_0x47fc38=as['buildExpression'](_0x57d2af,_0x54aa52[_0xab35('0x35')],_0x25ae73);_0x174d13[_0x2d6b69](_0x47fc38['text'],_0x47fc38[_0xab35('0x5e')][_0xab35('0x68')],_0x47fc38[_0xab35('0x5e')][_0xab35('0x19')]);}break;case _0xab35('0x69'):var _0x9d03a9=_0x25ae73[_0xab35('0x5e')][_0xab35('0x2d')](',')[_0xab35('0x2b')](function(_0x4009cd){return Number(_0x4009cd);});_0x9d03a9[_0xab35('0x2e')](function(_0x552f64){_0x4ef89e['or'](_0xab35('0x6a'),'%,'+_0x552f64+',%');});_0x56be85=_[_0xab35('0x6b')](_0x56be85,_0x9d03a9);break;case _0xab35('0x6c'):if(_0x25ae73[_0xab35('0x63')]==='$substring'){_0x174d13[_0x2d6b69](_0xab35('0x6d'),'%'+_0x25ae73[_0xab35('0x5e')]+'%',null);}else{_0x54aa52=_[_0xab35('0x5c')](_0x292221,[_0xab35('0x28'),_0xab35('0x6e')]);_0x25ae73['field']='UserId';_0x47fc38=as[_0xab35('0x6f')](_0x57d2af,_0x54aa52[_0xab35('0x35')],_0x25ae73);_0x174d13[_0x2d6b69](_0x47fc38[_0xab35('0x70')],_0x47fc38[_0xab35('0x5e')]['start'],_0x47fc38['value'][_0xab35('0x19')]);}break;case _0xab35('0x71'):_0x47fc38=as['buildExpression']('me',null,_0x25ae73);_0x174d13[_0x2d6b69](_0x47fc38[_0xab35('0x70')],_0x47fc38['value']['start'],_0x47fc38[_0xab35('0x5e')][_0xab35('0x19')]);break;}}else{var _0x47fc38=as['buildExpression'](_0x57d2af,_0x54aa52[_0xab35('0x35')],_0x25ae73);_0x174d13[_0x2d6b69](_0x47fc38['text'],_0x47fc38[_0xab35('0x5e')]['start'],_0x47fc38[_0xab35('0x5e')][_0xab35('0x19')]);}}}else{var _0x1fc24b=_(_0x51d93f[_0xab35('0x38')])[_0xab35('0x39')]()[_0xab35('0x2b')](function(_0x7f9043){return _[_0xab35('0x72')](_0x292221,[_0xab35('0x28'),_0x7f9043])?_0x7f9043:undefined;})['compact']()[_0xab35('0x5e')]();if(!_[_0xab35('0x73')](_0x1fc24b)){_0x1fc24b[_0xab35('0x2e')](function(_0x506ad9){if(_0x506ad9==='OpenchannelAccountId'){_0x20bce0[_0xab35('0x42')](_0xab35('0x74'),[]['concat'](_0x51d93f['query'][_0x506ad9]));}else if(_0x506ad9===_0xab35('0x75')){var _0x51385b=JSON[_0xab35('0x76')](_0x51d93f[_0xab35('0x38')][_0x506ad9])[_0xab35('0x77')];var _0x3edfbd=JSON['parse'](_0x51d93f[_0xab35('0x38')][_0x506ad9])['$lte'];_0x20bce0[_0xab35('0x42')](_0xab35('0x78'),_0x51385b,_0x3edfbd);}else{if(_0x51d93f[_0xab35('0x38')][_0x506ad9]===_0xab35('0x79')){_0x20bce0[_0xab35('0x42')]('i.'+_0x506ad9+'\x20IS\x20NULL');}else{_0x20bce0['where']('i.'+_0x506ad9+_0xab35('0x7a'),_0x51d93f[_0xab35('0x38')][_0x506ad9]);}}});}if(_0x51d93f[_0xab35('0x38')][_0xab35('0x7b')]){if(_0x51d93f['query'][_0xab35('0x7b')]==0x1){_0x20bce0[_0xab35('0x5f')]('`unreadMessages`\x20=\x200');}else{_0x20bce0[_0xab35('0x5f')](_0xab35('0x7c'));}}if(_0x51d93f['query'][_0xab35('0x7d')]){_0x56be85=_[_0xab35('0x7e')](_0x51d93f[_0xab35('0x38')][_0xab35('0x7d')])?_0x51d93f[_0xab35('0x38')][_0xab35('0x7d')]:new Array(_0x51d93f[_0xab35('0x38')][_0xab35('0x7d')]);_0x56be85[_0xab35('0x2e')](function(_0x20931b){_0x4ef89e['or'](_0xab35('0x6a'),'%,'+_0x20931b+',%');});}if(_0x51d93f[_0xab35('0x38')]['filter']){var _0x4d3a10=_0x51d93f[_0xab35('0x38')][_0xab35('0x7f')][_0xab35('0x80')]('\x5c','\x5c\x5c')[_0xab35('0x80')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0xab35('0x81')](_0x4d3a10)){_0x174d13['or'](_0xab35('0x82'),_0x4d3a10+'%');}else{_0x174d13['or'](_0xab35('0x83'),qs[_0xab35('0x84')](_0x4d3a10))['or'](_0xab35('0x85'),_0x4d3a10+'%')['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x4d3a10+'%');}}}_0x20bce0['where'](_0x174d13);_0x20bce0[_0xab35('0x86')](_0xab35('0x87'));var _0x5d25c1={'type':db[_0xab35('0x88')][_0xab35('0x89')][_0xab35('0x8a')],'raw':!![]};var _0x4e2bb8=_0x20bce0[_0xab35('0x8b')]();_0x4e2bb8[_0xab35('0x45')](_0xab35('0x87'));_0x4e2bb8[_0xab35('0x45')](_0xab35('0x8c'),_0xab35('0x5d'));if(_0x4fbd7e[_0xab35('0x8d')]){_0x4fbd7e[_0xab35('0x8d')]['forEach'](function(_0x50ac90){_0x20bce0['order']('i.'+_0x50ac90[0x0],_0x50ac90[0x1]===_0xab35('0x8e')?![]:!![]);});}if(!_[_0xab35('0x73')](_0x56be85)){_0x20bce0[_0xab35('0x5f')](_0x4ef89e);_0x4e2bb8[_0xab35('0x42')]('t.id\x20IN\x20?',_0x56be85);}BPromise[_0xab35('0x8f')]()[_0xab35('0x25')](function(){if(!_0x4c3cb9){if(_0x51d93f[_0xab35('0x38')][_0xab35('0x90')]||_0x51d93f[_0xab35('0x38')]['journey'])return;_0x4e2bb8['where'](_0xab35('0x91'));_0x20bce0['where'](_0xab35('0x91'));return;}return _0x51d93f[_0xab35('0x92')][_0xab35('0x93')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5897de){if(_[_0xab35('0x73')](_0x5897de)){_0x4e2bb8['where'](_0xab35('0x94'));_0x20bce0[_0xab35('0x42')](_0xab35('0x94'));}else{_0x4e2bb8[_0xab35('0x42')](_0xab35('0x74'),_['map'](_0x5897de,'id'));_0x20bce0[_0xab35('0x42')](_0xab35('0x74'),_[_0xab35('0x2b')](_0x5897de,'id'));}});})['then'](function(){db[_0xab35('0x95')][_0xab35('0x38')](_0x4e2bb8[_0xab35('0x96')](),_0x5d25c1)[_0xab35('0x25')](function(_0x15a2dc){_0x4b430b[_0xab35('0x1b')]=_0x15a2dc[_0xab35('0x3e')];if(_0x4b430b[_0xab35('0x1b')]===0x0)return[];return db['sequelize'][_0xab35('0x38')](_0x53b465[_0xab35('0x96')](),_0x5d25c1)[_0xab35('0x25')](function(_0x1bb92f){_0x1b1690=_['keyBy'](_0x1bb92f,'id');_0x5d25c1=_[_0xab35('0x97')](_0x5d25c1,{'model':db['OpenchannelInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x51d93f['query'][_0xab35('0x3d')]){_0x4fbd7e[_0xab35('0x3c')]['forEach'](function(_0x2548ec){_0x20bce0['field']('i.'+_0x2548ec);});}else{_0x20bce0[_0xab35('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xab35('0x5d'));_0x20bce0[_0xab35('0x45')]('a.key',_0xab35('0x98'));_0x20bce0[_0xab35('0x45')](_0xab35('0x99'),_0xab35('0x9a'));_0x20bce0[_0xab35('0x45')](_0xab35('0x9b'));_0x20bce0[_0xab35('0x45')]('c.firstName',_0xab35('0x9c'));_0x20bce0['field'](_0xab35('0x9d'),_0xab35('0x9e'));_0x20bce0[_0xab35('0x45')]('c.email',_0xab35('0x9f'));_0x20bce0[_0xab35('0x45')]('c.phone',_0xab35('0xa0'));_0x20bce0[_0xab35('0x45')]('c.mobile',_0xab35('0xa1'));_0x20bce0[_0xab35('0x45')](_0xab35('0xa2'),'Contact.fax');_0x20bce0['field'](_0xab35('0xa3'),_0xab35('0xa4'));_0x20bce0['field'](_0xab35('0xa5'),'Owner.internal');_0x20bce0[_0xab35('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)',_0xab35('0x2c'));}_0x20bce0[_0xab35('0x1d')](_0x4fbd7e['limit']);_0x20bce0[_0xab35('0x1c')](_0x4fbd7e[_0xab35('0x1c')]);return db[_0xab35('0x95')][_0xab35('0x38')](_0x20bce0[_0xab35('0x96')](),_0x5d25c1);})[_0xab35('0x25')](function(_0x5afc55){_0x4be1a9['where'](_0xab35('0xa6'),_[_0xab35('0x2b')](_0x5afc55,'id'));return db[_0xab35('0x95')][_0xab35('0x38')](_0x4be1a9[_0xab35('0x96')](),_0x5d25c1)[_0xab35('0x25')](function(_0x28426f){var _0xd4ee0c=_[_0xab35('0xa7')](_0x28426f,_0xab35('0xa8'));var _0x561af1=[];_0x5afc55[_0xab35('0x2e')](function(_0x366cd7){_0x561af1[_0xab35('0xa9')](updateOpenchannelInteraction(_0x366cd7,_0x1b1690,_0xd4ee0c));});return BPromise[_0xab35('0xaa')](_0x561af1);});});})[_0xab35('0x25')](function(_0x10eff0){_0x4b430b[_0xab35('0xab')]=_0x10eff0;return _0x4b430b;})['then'](respondWithFilteredResult(_0x46a443,_0x4fbd7e));})[_0xab35('0x30')](handleError(_0x46a443,null));};exports[_0xab35('0xac')]=function(_0x54c6df,_0x531c33){var _0x1813f6={'raw':![],'where':{'id':_0x54c6df[_0xab35('0xad')]['id']}},_0x32c322={};_0x32c322['model']=_[_0xab35('0x39')](db[_0xab35('0x32')]['rawAttributes']);_0x32c322['query']=_[_0xab35('0x39')](_0x54c6df[_0xab35('0x38')]);_0x32c322[_0xab35('0x3a')]=_[_0xab35('0x3b')](_0x32c322[_0xab35('0x37')],_0x32c322[_0xab35('0x38')]);_0x1813f6[_0xab35('0x3c')]=_[_0xab35('0x3b')](_0x32c322[_0xab35('0x37')],qs[_0xab35('0x3d')](_0x54c6df[_0xab35('0x38')][_0xab35('0x3d')]));_0x1813f6[_0xab35('0x3c')]=_0x1813f6[_0xab35('0x3c')][_0xab35('0x3e')]?_0x1813f6[_0xab35('0x3c')]:_0x32c322['model'];if(_0x54c6df[_0xab35('0x38')][_0xab35('0xae')]){_0x1813f6[_0xab35('0xaf')]=[{'all':!![]}];}_0x1813f6=_[_0xab35('0x97')]({},_0x1813f6,_0x54c6df[_0xab35('0xb0')]);return db['OpenchannelInteraction'][_0xab35('0x5c')](_0x1813f6)[_0xab35('0x25')](handleEntityNotFound(_0x531c33,null))['then'](respondWithResult(_0x531c33,null))['catch'](handleError(_0x531c33,null));};exports[_0xab35('0xb1')]=function(_0x5dd28b,_0x24872d){return db[_0xab35('0x32')]['create'](_0x5dd28b[_0xab35('0x71')],{})['then'](respondWithResult(_0x24872d,0xc9))['catch'](handleError(_0x24872d,null));};exports[_0xab35('0x23')]=function(_0x4ea410,_0xfe49f4){if(_0x4ea410[_0xab35('0x71')]['id']){delete _0x4ea410[_0xab35('0x71')]['id'];}return db[_0xab35('0x32')][_0xab35('0x5c')]({'where':{'id':_0x4ea410[_0xab35('0xad')]['id']}})[_0xab35('0x25')](handleEntityNotFound(_0xfe49f4,null))['then'](saveUpdates(_0x4ea410[_0xab35('0x71')],null))['then'](respondWithResult(_0xfe49f4,null))['catch'](handleError(_0xfe49f4,null));};exports['destroy']=function(_0x3ab0bc,_0x416314){return db[_0xab35('0x32')][_0xab35('0x5c')]({'where':{'id':_0x3ab0bc['params']['id']}})[_0xab35('0x25')](handleEntityNotFound(_0x416314,null))['then'](removeEntity(_0x416314,null))['catch'](handleError(_0x416314,null));};exports['describe']=function(_0x34de82,_0x2c0277){return db[_0xab35('0x32')][_0xab35('0xb2')]()[_0xab35('0x25')](respondWithResult(_0x2c0277,null))[_0xab35('0x30')](handleError(_0x2c0277,null));};exports[_0xab35('0xb3')]=function(_0x2ea95f,_0x2e99b5,_0x33d5e9){return db[_0xab35('0xb4')][_0xab35('0x5c')]({'where':{'id':_0x2ea95f[_0xab35('0xad')]['id']}})[_0xab35('0x25')](handleEntityNotFound(_0x2e99b5,null))[_0xab35('0x25')](function(_0x5d2587){if(_0x5d2587){return _0x5d2587['addMessage'](_0x2ea95f['body'][_0xab35('0xb5')],_[_0xab35('0xb6')](_0x2ea95f[_0xab35('0x71')],[_0xab35('0xb5'),'id'])||{});}})[_0xab35('0x25')](respondWithResult(_0x2e99b5,null))[_0xab35('0x30')](handleError(_0x2e99b5,null));};exports[_0xab35('0xb7')]=function(_0x21fb42,_0x53c8e6,_0x88fa42){var _0x13c9fe={'raw':![],'where':{}};var _0x455008={};var _0x327677={'count':0x0,'rows':[]};return db['OpenchannelInteraction']['findOne']({'where':{'id':_0x21fb42['params']['id']}})[_0xab35('0x25')](handleEntityNotFound(_0x53c8e6,null))[_0xab35('0x25')](function(_0x1566ea){if(_0x1566ea){_0x455008[_0xab35('0x37')]=_['keys'](db['OpenchannelMessage'][_0xab35('0x33')]);_0x455008[_0xab35('0x38')]=_[_0xab35('0x39')](_0x21fb42[_0xab35('0x38')]);_0x455008[_0xab35('0x3a')]=_[_0xab35('0x3b')](_0x455008[_0xab35('0x37')],_0x455008[_0xab35('0x38')]);_0x13c9fe[_0xab35('0x3c')]=_[_0xab35('0x3b')](_0x455008[_0xab35('0x37')],qs['fields'](_0x21fb42['query']['fields']));_0x13c9fe[_0xab35('0x3c')]=_0x13c9fe['attributes'][_0xab35('0x3e')]?_0x13c9fe['attributes']:_0x455008[_0xab35('0x37')];if(!_0x21fb42['query'][_0xab35('0x3f')](_0xab35('0x40'))){_0x13c9fe[_0xab35('0x1d')]=qs[_0xab35('0x1d')](_0x21fb42['query'][_0xab35('0x1d')]);_0x13c9fe[_0xab35('0x1c')]=qs[_0xab35('0x1c')](_0x21fb42[_0xab35('0x38')][_0xab35('0x1c')]);}_0x13c9fe[_0xab35('0x8d')]=qs[_0xab35('0x41')](_0x21fb42[_0xab35('0x38')][_0xab35('0x41')]);_0x13c9fe['where']=qs['filters'](_['pick'](_0x21fb42[_0xab35('0x38')],_0x455008['filters']));_0x13c9fe[_0xab35('0x42')][_0xab35('0xa8')]=_0x1566ea['id'];if(_0x21fb42[_0xab35('0x38')][_0xab35('0x7f')]){_0x13c9fe[_0xab35('0x42')]=_[_0xab35('0x97')](_0x13c9fe[_0xab35('0x42')],{'$or':_[_0xab35('0x2b')](_0x13c9fe[_0xab35('0x3c')],function(_0xedcfba){var _0x433d14={};_0x433d14[_0xedcfba]={'$like':'%'+_0x21fb42[_0xab35('0x38')][_0xab35('0x7f')]+'%'};return _0x433d14;})});}if(_0x21fb42[_0xab35('0x38')]['$gte']){var _0x7d4a02=_0x21fb42[_0xab35('0x38')][_0xab35('0x77')][_0xab35('0x2d')](',');var _0x44f878={};_0x44f878[_0x7d4a02[0x0]]={'$gte':moment(_0x7d4a02[0x1])[_0xab35('0xb8')](_0xab35('0xb9'))};_0x13c9fe[_0xab35('0x42')]=_[_0xab35('0x97')](_0x13c9fe['where'],_0x44f878);}_0x13c9fe=_[_0xab35('0x97')]({},_0x13c9fe,_0x21fb42[_0xab35('0xb0')]);return db['OpenchannelMessage'][_0xab35('0x1b')]({'where':_0x13c9fe['where']})[_0xab35('0x25')](function(_0xebfefb){_0x327677[_0xab35('0x1b')]=_0xebfefb;if(_0x21fb42[_0xab35('0x38')][_0xab35('0xae')]){_0x13c9fe[_0xab35('0xaf')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x13c9fe);})[_0xab35('0x25')](function(_0x5a156c){_0x327677[_0xab35('0xab')]=_0x5a156c;return _0x327677;});}})[_0xab35('0x25')](respondWithFilteredResult(_0x53c8e6,_0x13c9fe))[_0xab35('0x30')](handleError(_0x53c8e6,null));};exports[_0xab35('0xba')]=function(_0x22aa83,_0x27df18,_0x2b042b){return db[_0xab35('0x32')]['find']({'where':{'id':_0x22aa83[_0xab35('0xad')]['id']}})['then'](handleEntityNotFound(_0x27df18,null))['then'](function(_0x176702){if(_0x176702){return _0x176702['setTags'](_0x22aa83['body'][_0xab35('0xb5')],_[_0xab35('0xb6')](_0x22aa83[_0xab35('0x71')],['ids','id'])||{})[_0xab35('0xbb')](function(){return db['Tag'][_0xab35('0xbc')]({'attributes':['id',_0xab35('0x28'),_0xab35('0x46')],'where':{'id':_0x22aa83[_0xab35('0x71')][_0xab35('0xb5')]}});})['then'](function(_0x5f4aac){socket[_0xab35('0xbd')](_0xab35('0xbe'),{'id':Number(_0x22aa83[_0xab35('0xad')]['id']),'tags':_0x5f4aac||[]});return{'id':Number(_0x22aa83['params']['id']),'tags':_0x5f4aac||[]};});}})[_0xab35('0x25')](respondWithResult(_0x27df18,null))[_0xab35('0x30')](handleError(_0x27df18,null));};exports[_0xab35('0xbf')]=function(_0x1fba65,_0x2bf99f,_0x46fe60){return db[_0xab35('0x32')][_0xab35('0x5c')]({'where':{'id':_0x1fba65[_0xab35('0xad')]['id']}})[_0xab35('0x25')](handleEntityNotFound(_0x2bf99f,null))[_0xab35('0x25')](function(_0x3ad6cc){if(_0x3ad6cc){return _0x3ad6cc[_0xab35('0xbf')](_0x1fba65[_0xab35('0x38')][_0xab35('0xb5')]);}})[_0xab35('0x25')](respondWithStatusCode(_0x2bf99f,null))[_0xab35('0x30')](handleError(_0x2bf99f,null));};exports['download']=function(_0x311dda,_0xaa6005){var _0x250a70=moment()['unix']()[_0xab35('0x96')]();var _0x37dd49=path[_0xab35('0xc0')](config[_0xab35('0xc1')],_0xab35('0xc2'),'files','tmp');var _0x38993b=path[_0xab35('0xc0')](config['root'],_0xab35('0xc2'),_0xab35('0xc3'),_0xab35('0xc4'));var _0x55b536=path[_0xab35('0xc0')](_0x37dd49,_0x250a70);var _0x4dbc7e=util[_0xab35('0xb8')](_0xab35('0xc5'),_0x311dda[_0xab35('0xad')]['id'],_0x250a70);var _0x426ca5=path[_0xab35('0xc0')](_0x37dd49,_0x4dbc7e);var _0x2f7191=[];_0x2f7191[_0xab35('0xa9')]({'model':db['User'],'as':'User','attributes':['id',_0xab35('0xc6')],'raw':!![]});_0x2f7191[_0xab35('0xa9')]({'model':db[_0xab35('0xc7')],'as':'Contact','attributes':['id',_0xab35('0xc8'),_0xab35('0xc9')],'raw':!![]});if(_0x311dda[_0xab35('0x38')][_0xab35('0xc4')]){_0x2f7191[_0xab35('0xa9')]({'model':db['Attachment'],'as':'Attachment','raw':!![]});}var _0x104f9c=[{'model':db[_0xab35('0xb4')],'as':'Messages','attributes':['id',_0xab35('0x71'),'createdAt',_0xab35('0xca'),_0xab35('0xcb'),_0xab35('0x7b')],'include':_0x2f7191}];_0x104f9c[_0xab35('0xa9')]({'model':db['OpenchannelAccount'],'as':_0xab35('0xcc'),'attributes':['id',_0xab35('0x28')]});_0x104f9c[_0xab35('0xa9')]({'model':db[_0xab35('0x6c')],'as':'Owner','attributes':['id','fullname']});return db[_0xab35('0x32')][_0xab35('0x5c')]({'where':{'id':_0x311dda[_0xab35('0xad')]['id']},'include':_0x104f9c})[_0xab35('0x25')](handleEntityNotFound(_0xaa6005,null))[_0xab35('0x25')](function(_0xdf904d){if(_0xdf904d){var _0x3b1e28=_0xdf904d['get']({'plain':!![]});fs[_0xab35('0xcd')](_0x55b536);var _0x372e73={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':_0xab35('0xce')}},'footer':{'height':_0xab35('0xcf'),'contents':{'default':util[_0xab35('0xb8')](_0xab35('0xd0'),util['format']('%s\x20#%d',_0xab35('0xd1'),_0x3b1e28['id']),moment()[_0xab35('0xb8')](_0xab35('0xd2'))[_0xab35('0x96')]())}}};var _0x38a2ed={'channel':_0xab35('0xd1'),'account':_0x3b1e28[_0xab35('0xcc')][_0xab35('0x28')],'agent':_0x3b1e28[_0xab35('0xd3')]?_0x3b1e28[_0xab35('0xd3')][_0xab35('0xc6')]:'N.A.','createdAt':moment(_0x3b1e28['createdAt'])['format'](_0xab35('0xb9'))[_0xab35('0x96')](),'closedAt':_0x3b1e28[_0xab35('0xd4')]?moment(_0x3b1e28['closedAt'])[_0xab35('0xb8')](_0xab35('0xb9'))['toString']():'','disposition':_0x3b1e28[_0xab35('0xd5')],'visibility':_0x3b1e28[_0xab35('0xd6')]?_0xab35('0xd7'):'Private','messages':_(_0x3b1e28[_0xab35('0xd8')])[_0xab35('0x7f')]({'secret':![]})[_0xab35('0x2b')](function(_0x2903b4){if(_0x2903b4[_0xab35('0xd9')]){var _0x7ea7af=path[_0xab35('0xc0')](_0x38993b,_0x2903b4[_0xab35('0xd9')][_0xab35('0xda')]);if(fs[_0xab35('0xdb')](_0x7ea7af)){fs['createReadStream'](_0x7ea7af)[_0xab35('0xdc')](fs[_0xab35('0xdd')](path[_0xab35('0xc0')](_0x55b536,_0x2903b4[_0xab35('0xd9')][_0xab35('0xda')])));}}return{'date':moment(_0x2903b4['createdAt'])[_0xab35('0xb8')](_0xab35('0xb9'))[_0xab35('0x96')](),'sender':_0x2903b4[_0xab35('0xca')]===_0xab35('0xde')?_0x2903b4['User']?_0x2903b4['User'][_0xab35('0xc6')]:'System':_0x2903b4[_0xab35('0x62')][_0xab35('0xc8')]+(_0x2903b4[_0xab35('0x62')][_0xab35('0xc9')]?'\x20'+_0x2903b4['Contact']['lastName']:''),'body':_0x2903b4['Attachment']?_0x2903b4[_0xab35('0xd9')][_0xab35('0xda')]:_0x2903b4[_0xab35('0x71')],'direction':_0x2903b4['direction']===_0xab35('0xde')?'A':'C','secret':_0x2903b4[_0xab35('0xcb')],'read':_0x2903b4[_0xab35('0x7b')],'attachment':_0x2903b4[_0xab35('0xd9')]};})['value']()};return ejs[_0xab35('0xdf')](path['join'](config[_0xab35('0xc1')],_0xab35('0xc2'),'views',_0xab35('0xe0')),{'interaction':_0x38a2ed})[_0xab35('0x25')](function(_0x1e7fa6){return new BPromise(function(_0x12fb05,_0x4d88c9){pdf[_0xab35('0xb1')](_0x1e7fa6,_0x372e73)[_0xab35('0xe1')](path[_0xab35('0xc0')](_0x55b536,_0xab35('0xe2')+_0x3b1e28['id']+'-'+_0x250a70+_0xab35('0xe3')),function(_0x5acf6c,_0x54bdf6){if(_0x5acf6c)return _0x4d88c9(_0x5acf6c);_0x12fb05(_0x54bdf6);});});})[_0xab35('0x25')](function(){return new BPromise(function(_0x37ab9b,_0x2bfdfc){zipdir(_0x55b536,{'saveTo':_0x426ca5},function(_0x20fb40,_0x9b44ab){if(_0x20fb40)return _0x2bfdfc(_0x20fb40);return _0x37ab9b(_0x9b44ab);});})['then'](function(){return new BPromise(function(_0x4c9ca2,_0x3a0a1e){rimraf(_0x55b536,function(_0x270a8f){if(_0x270a8f)_0x3a0a1e(_0x270a8f);return _0x4c9ca2();});});})[_0xab35('0x25')](function(){return _0xaa6005[_0xab35('0xe4')](_0x426ca5,_0x4dbc7e,function(_0x409081){if(_0x409081){console[_0xab35('0xe5')](_0xab35('0xe6'),_0x409081);}else{fs[_0xab35('0xe7')](_0x426ca5);}});});});}else{return _0xaa6005[_0xab35('0xe8')](0xc8);}})['catch'](handleError(_0xaa6005,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index e927e69..0ea27b2 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 _0x7652=['Users','map','findAll','setDataValue','unreadMessages','emit','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','then'];(function(_0x117b67,_0x2492af){var _0x4e47a6=function(_0xed4bb){while(--_0xed4bb){_0x117b67['push'](_0x117b67['shift']());}};_0x4e47a6(++_0x2492af);}(_0x7652,0x1a0));var _0x2765=function(_0x4f3e52,_0x3325b5){_0x4f3e52=_0x4f3e52-0x0;var _0x3c0716=_0x7652[_0x4f3e52];return _0x3c0716;};'use strict';var EventEmitter=require(_0x2765('0x0'));var OpenchannelInteraction=require(_0x2765('0x1'))['db'][_0x2765('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x2765('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x2765('0x4')](0x0);var events={'afterCreate':_0x2765('0x5'),'afterUpdate':_0x2765('0x6'),'afterDestroy':_0x2765('0x7')};function emitEvent(_0x3df3d4){return function(_0x1311e0,_0x25633e,_0x14de13){_0x1311e0['getUsers']({'attributes':['id'],'raw':!![]})[_0x2765('0x8')](function(_0x4afa2a){_0x1311e0['setDataValue'](_0x2765('0x9'),_0x4afa2a[_0x2765('0xa')](function(_0x8b8d18){return{'id':_0x8b8d18['id']};}));return OpenchannelMessage[_0x2765('0xb')]({'where':{'OpenchannelInteractionId':_0x1311e0['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5efee2){_0x1311e0[_0x2765('0xc')](_0x2765('0xd'),_0x5efee2['length']);OpenchannelInteractionEvents['emit'](_0x3df3d4+':'+_0x1311e0['id'],_0x1311e0);OpenchannelInteractionEvents[_0x2765('0xe')](_0x3df3d4,_0x1311e0);_0x14de13(null);})['catch'](_0x14de13(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x2765('0xf')](e,emitEvent(event));}}module[_0x2765('0x10')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xf559=['Users','then','length','emit','catch','events','../../mysqldb','OpenchannelInteraction','setMaxListeners','save','update','setDataValue'];(function(_0x5cbed5,_0xd11e5e){var _0x572276=function(_0x1c8581){while(--_0x1c8581){_0x5cbed5['push'](_0x5cbed5['shift']());}};_0x572276(++_0xd11e5e);}(_0xf559,0xf5));var _0x9f55=function(_0x191bec,_0x36c423){_0x191bec=_0x191bec-0x0;var _0x578a8e=_0xf559[_0x191bec];return _0x578a8e;};'use strict';var EventEmitter=require(_0x9f55('0x0'));var OpenchannelInteraction=require(_0x9f55('0x1'))['db'][_0x9f55('0x2')];var OpenchannelMessage=require(_0x9f55('0x1'))['db']['OpenchannelMessage'];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9f55('0x3')](0x0);var events={'afterCreate':_0x9f55('0x4'),'afterUpdate':_0x9f55('0x5'),'afterDestroy':'remove'};function emitEvent(_0x3cf193){return function(_0x56e40e,_0xb98b76,_0x3a1cb2){_0x56e40e['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0xc1bbe3){_0x56e40e[_0x9f55('0x6')](_0x9f55('0x7'),_0xc1bbe3['map'](function(_0x30875b){return{'id':_0x30875b['id']};}));return OpenchannelMessage['findAll']({'where':{'OpenchannelInteractionId':_0x56e40e['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9f55('0x8')](function(_0x352343){_0x56e40e[_0x9f55('0x6')]('unreadMessages',_0x352343[_0x9f55('0x9')]);OpenchannelInteractionEvents[_0x9f55('0xa')](_0x3cf193+':'+_0x56e40e['id'],_0x56e40e);OpenchannelInteractionEvents['emit'](_0x3cf193,_0x56e40e);_0x3a1cb2(null);})[_0x9f55('0xb')](_0x3a1cb2(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction['hook'](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 f4a6880..b03022b 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 _0x56e7=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelInteraction.attributes','define','OpenchannelInteraction','changed','closed','closedAt','util','../../config/logger','moment'];(function(_0x9457d7,_0x54a7ab){var _0x535bfe=function(_0x302ae7){while(--_0x302ae7){_0x9457d7['push'](_0x9457d7['shift']());}};_0x535bfe(++_0x54a7ab);}(_0x56e7,0x7b));var _0x756e=function(_0x14e1cb,_0xd3465e){_0x14e1cb=_0x14e1cb-0x0;var _0x18a337=_0x56e7[_0x14e1cb];return _0x18a337;};'use strict';var _=require('lodash');var util=require(_0x756e('0x0'));var logger=require(_0x756e('0x1'))('api');var moment=require(_0x756e('0x2'));var BPromise=require(_0x756e('0x3'));var rp=require(_0x756e('0x4'));var fs=require('fs');var path=require(_0x756e('0x5'));var rimraf=require(_0x756e('0x6'));var config=require(_0x756e('0x7'));var attributes=require(_0x756e('0x8'));module['exports']=function(_0x3b3b8f,_0x404189){return _0x3b3b8f[_0x756e('0x9')](_0x756e('0xa'),attributes,{'tableName':'openchannel_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c6a22,_0x5c2db4,_0x4460c7){if(_0x1c6a22[_0x756e('0xb')](_0x756e('0xc'))){_0x1c6a22[_0x756e('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x4460c7(null,_0x1c6a22);}}});}; \ No newline at end of file +var _0xd101=['request-promise','path','rimraf','../../config/environment','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','moment','bluebird'];(function(_0x3420c3,_0xe997fc){var _0x316566=function(_0x51b97a){while(--_0x51b97a){_0x3420c3['push'](_0x3420c3['shift']());}};_0x316566(++_0xe997fc);}(_0xd101,0xc1));var _0x1d10=function(_0x3ce6e6,_0x2f3116){_0x3ce6e6=_0x3ce6e6-0x0;var _0x5d0fa2=_0xd101[_0x3ce6e6];return _0x5d0fa2;};'use strict';var _=require(_0x1d10('0x0'));var util=require('util');var logger=require(_0x1d10('0x1'))(_0x1d10('0x2'));var moment=require(_0x1d10('0x3'));var BPromise=require(_0x1d10('0x4'));var rp=require(_0x1d10('0x5'));var fs=require('fs');var path=require(_0x1d10('0x6'));var rimraf=require(_0x1d10('0x7'));var config=require(_0x1d10('0x8'));var attributes=require('./openchannelInteraction.attributes');module[_0x1d10('0x9')]=function(_0x203072,_0x2a4e2d){return _0x203072[_0x1d10('0xa')](_0x1d10('0xb'),attributes,{'tableName':_0x1d10('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x6d6def,_0x43df2c,_0x3a15c8){if(_0x6d6def[_0x1d10('0xd')](_0x1d10('0xe'))){_0x6d6def[_0x1d10('0xf')]=moment()[_0x1d10('0x10')](_0x1d10('0x11'));}_0x3a15c8(null,_0x6d6def);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index 34b282e..35430dc 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 _0xfa82=['jayson/promise','http','redis','localhost','socket.io-emitter','register','then','OpenchannelInteraction,\x20%s,\x20%s','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','find','addTags','ids','spread','AddTags','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment'];(function(_0x46698a,_0x8de1e4){var _0x356db0=function(_0x19e83c){while(--_0x19e83c){_0x46698a['push'](_0x46698a['shift']());}};_0x356db0(++_0x8de1e4);}(_0xfa82,0x1da));var _0x2fa8=function(_0x509b3c,_0x99d171){_0x509b3c=_0x509b3c-0x0;var _0x2e7bde=_0xfa82[_0x509b3c];return _0x2e7bde;};'use strict';var _=require(_0x2fa8('0x0'));var util=require(_0x2fa8('0x1'));var moment=require('moment');var BPromise=require(_0x2fa8('0x2'));var rs=require(_0x2fa8('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2fa8('0x4'));var logger=require('../../config/logger')(_0x2fa8('0x5'));var config=require(_0x2fa8('0x6'));var jayson=require(_0x2fa8('0x7'));var client=jayson['client'][_0x2fa8('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x2fa8('0x9')],{'host':_0x2fa8('0xa'),'port':0x18eb});var socket=require(_0x2fa8('0xb'))(new Redis(config[_0x2fa8('0x9')]));require('./openchannelInteraction.socket')[_0x2fa8('0xc')](socket);function respondWithRpcPromise(_0x28eff3,_0x58aea6,_0x2de4e0){return new BPromise(function(_0x335244,_0x3352b7){return client['request'](_0x28eff3,_0x2de4e0)[_0x2fa8('0xd')](function(_0x21afca){logger['info'](_0x2fa8('0xe'),_0x58aea6,'request\x20sent');logger[_0x2fa8('0xf')](_0x2fa8('0x10'),_0x58aea6,_0x2fa8('0x11'),JSON[_0x2fa8('0x12')](_0x21afca));if(_0x21afca[_0x2fa8('0x13')]){if(_0x21afca[_0x2fa8('0x13')]['code']===0x1f4){logger[_0x2fa8('0x13')](_0x2fa8('0xe'),_0x58aea6,_0x21afca[_0x2fa8('0x13')]['message']);return _0x3352b7(_0x21afca[_0x2fa8('0x13')][_0x2fa8('0x14')]);}logger[_0x2fa8('0x13')](_0x2fa8('0xe'),_0x58aea6,_0x21afca[_0x2fa8('0x13')]['message']);return _0x335244(_0x21afca[_0x2fa8('0x13')][_0x2fa8('0x14')]);}else{logger[_0x2fa8('0x15')](_0x2fa8('0xe'),_0x58aea6,_0x2fa8('0x11'));_0x335244(_0x21afca[_0x2fa8('0x16')][_0x2fa8('0x14')]);}})[_0x2fa8('0x17')](function(_0x118522){logger[_0x2fa8('0x13')](_0x2fa8('0xe'),_0x58aea6,_0x118522);_0x3352b7(_0x118522);});});}exports[_0x2fa8('0x18')]=function(_0x359aba){var _0x587833=this;return new Promise(function(_0x3d3525,_0x2ff2d9){return db[_0x2fa8('0x19')][_0x2fa8('0x1a')](_0x359aba[_0x2fa8('0x1b')],{'raw':_0x359aba['options']?_0x359aba[_0x2fa8('0x1c')][_0x2fa8('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x359aba[_0x2fa8('0x1c')]?_0x359aba['options'][_0x2fa8('0x1e')]||null:null,'attributes':_0x359aba[_0x2fa8('0x1c')]?_0x359aba[_0x2fa8('0x1c')][_0x2fa8('0x1f')]||null:null,'limit':_0x359aba[_0x2fa8('0x1c')]?_0x359aba[_0x2fa8('0x1c')]['limit']||null:null})[_0x2fa8('0xd')](function(_0x4b0492){logger['info'](_0x2fa8('0x18'),_0x359aba);logger[_0x2fa8('0xf')]('UpdateOpenchannelInteraction',_0x359aba,JSON[_0x2fa8('0x12')](_0x4b0492));_0x3d3525(_0x4b0492);})['catch'](function(_0x4f8b35){logger[_0x2fa8('0x13')]('UpdateOpenchannelInteraction',_0x4f8b35[_0x2fa8('0x14')],_0x359aba);_0x2ff2d9(_0x587833[_0x2fa8('0x13')](0x1f4,_0x4f8b35[_0x2fa8('0x14')]));});});};exports['AddTagsToOpenchannelInteraction']=function(_0x5cad0a){return new Promise(function(_0x50b904,_0xf7cefc){return db[_0x2fa8('0x19')][_0x2fa8('0x20')]({'where':_0x5cad0a['options']?_0x5cad0a[_0x2fa8('0x1c')][_0x2fa8('0x1e')]||null:null})[_0x2fa8('0xd')](function(_0x5428cb){if(_0x5428cb){return _0x5428cb[_0x2fa8('0x21')](_0x5cad0a[_0x2fa8('0x1b')]['ids'],_['omit'](_0x5cad0a[_0x2fa8('0x1b')],[_0x2fa8('0x22'),'id'])||{});}})[_0x2fa8('0x23')](function(_0x424004){logger[_0x2fa8('0x15')]('AddTags',_0x5cad0a);logger['debug'](_0x2fa8('0x24'),_0x5cad0a,JSON[_0x2fa8('0x12')](_0x424004));_0x50b904(_0x424004);})[_0x2fa8('0x17')](function(_0x259717){logger['error'](_0x2fa8('0x24'),_0x259717['message'],_0x5cad0a);_0xf7cefc(_this[_0x2fa8('0x13')](0x1f4,_0x259717[_0x2fa8('0x14')]));});});}; \ No newline at end of file +var _0xc594=['AddTags','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','redis','localhost','socket.io-emitter','register','request','info','OpenchannelInteraction,\x20%s,\x20%s','debug','request\x20sent','error','code','message','result','catch','OpenchannelInteraction','update','options','where','attributes','limit','then','UpdateOpenchannelInteraction','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','body','spread'];(function(_0x355663,_0x33a3e1){var _0x5b9e9f=function(_0xbb2c17){while(--_0xbb2c17){_0x355663['push'](_0x355663['shift']());}};_0x5b9e9f(++_0x33a3e1);}(_0xc594,0x191));var _0x4c59=function(_0x2e8068,_0x5b9173){_0x2e8068=_0x2e8068-0x0;var _0x8e3dbf=_0xc594[_0x2e8068];return _0x8e3dbf;};'use strict';var _=require(_0x4c59('0x0'));var util=require(_0x4c59('0x1'));var moment=require('moment');var BPromise=require(_0x4c59('0x2'));var rs=require(_0x4c59('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4c59('0x4'))['db'];var utils=require(_0x4c59('0x5'));var logger=require(_0x4c59('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x4c59('0x7'));var client=jayson[_0x4c59('0x8')][_0x4c59('0x9')]({'port':0x232a});config[_0x4c59('0xa')]=_['defaults'](config[_0x4c59('0xa')],{'host':_0x4c59('0xb'),'port':0x18eb});var socket=require(_0x4c59('0xc'))(new Redis(config['redis']));require('./openchannelInteraction.socket')[_0x4c59('0xd')](socket);function respondWithRpcPromise(_0x30df16,_0x3f2643,_0x5e6c7f){return new BPromise(function(_0x3ba6cf,_0x7040ad){return client[_0x4c59('0xe')](_0x30df16,_0x5e6c7f)['then'](function(_0x4faffe){logger[_0x4c59('0xf')](_0x4c59('0x10'),_0x3f2643,'request\x20sent');logger[_0x4c59('0x11')]('OpenchannelInteraction,\x20%s,\x20%s,\x20%s',_0x3f2643,_0x4c59('0x12'),JSON['stringify'](_0x4faffe));if(_0x4faffe[_0x4c59('0x13')]){if(_0x4faffe[_0x4c59('0x13')][_0x4c59('0x14')]===0x1f4){logger[_0x4c59('0x13')](_0x4c59('0x10'),_0x3f2643,_0x4faffe[_0x4c59('0x13')][_0x4c59('0x15')]);return _0x7040ad(_0x4faffe['error']['message']);}logger[_0x4c59('0x13')](_0x4c59('0x10'),_0x3f2643,_0x4faffe[_0x4c59('0x13')][_0x4c59('0x15')]);return _0x3ba6cf(_0x4faffe[_0x4c59('0x13')][_0x4c59('0x15')]);}else{logger[_0x4c59('0xf')](_0x4c59('0x10'),_0x3f2643,'request\x20sent');_0x3ba6cf(_0x4faffe[_0x4c59('0x16')]['message']);}})[_0x4c59('0x17')](function(_0x715f93){logger[_0x4c59('0x13')](_0x4c59('0x10'),_0x3f2643,_0x715f93);_0x7040ad(_0x715f93);});});}exports['UpdateOpenchannelInteraction']=function(_0x1582cf){var _0x200d75=this;return new Promise(function(_0xa01ad2,_0x5974e0){return db[_0x4c59('0x18')][_0x4c59('0x19')](_0x1582cf['body'],{'raw':_0x1582cf[_0x4c59('0x1a')]?_0x1582cf[_0x4c59('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1582cf[_0x4c59('0x1a')]?_0x1582cf[_0x4c59('0x1a')][_0x4c59('0x1b')]||null:null,'attributes':_0x1582cf[_0x4c59('0x1a')]?_0x1582cf[_0x4c59('0x1a')][_0x4c59('0x1c')]||null:null,'limit':_0x1582cf['options']?_0x1582cf['options'][_0x4c59('0x1d')]||null:null})[_0x4c59('0x1e')](function(_0xa9f161){logger[_0x4c59('0xf')](_0x4c59('0x1f'),_0x1582cf);logger[_0x4c59('0x11')](_0x4c59('0x1f'),_0x1582cf,JSON['stringify'](_0xa9f161));_0xa01ad2(_0xa9f161);})['catch'](function(_0x111c63){logger['error']('UpdateOpenchannelInteraction',_0x111c63[_0x4c59('0x15')],_0x1582cf);_0x5974e0(_0x200d75[_0x4c59('0x13')](0x1f4,_0x111c63[_0x4c59('0x15')]));});});};exports[_0x4c59('0x20')]=function(_0xeab596){return new Promise(function(_0x183216,_0x3653d4){return db['OpenchannelInteraction'][_0x4c59('0x21')]({'where':_0xeab596[_0x4c59('0x1a')]?_0xeab596[_0x4c59('0x1a')]['where']||null:null})[_0x4c59('0x1e')](function(_0x5012b8){if(_0x5012b8){return _0x5012b8[_0x4c59('0x22')](_0xeab596['body'][_0x4c59('0x23')],_[_0x4c59('0x24')](_0xeab596[_0x4c59('0x25')],[_0x4c59('0x23'),'id'])||{});}})[_0x4c59('0x26')](function(_0x254eaf){logger[_0x4c59('0xf')](_0x4c59('0x27'),_0xeab596);logger[_0x4c59('0x11')](_0x4c59('0x27'),_0xeab596,JSON['stringify'](_0x254eaf));_0x183216(_0x254eaf);})[_0x4c59('0x17')](function(_0xf6c6bb){logger[_0x4c59('0x13')](_0x4c59('0x27'),_0xf6c6bb[_0x4c59('0x15')],_0xeab596);_0x3653d4(_this[_0x4c59('0x13')](0x1f4,_0xf6c6bb[_0x4c59('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index 9c4b9e1..2ddd1a1 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 _0xbf53=['save','remove','register','openchannelInteraction:','./openchannelInteraction.events'];(function(_0x468607,_0x3f6ef9){var _0x102763=function(_0x34f379){while(--_0x34f379){_0x468607['push'](_0x468607['shift']());}};_0x102763(++_0x3f6ef9);}(_0xbf53,0x7c));var _0x3bf5=function(_0x43de86,_0x34edd7){_0x43de86=_0x43de86-0x0;var _0x1bc154=_0xbf53[_0x43de86];return _0x1bc154;};'use strict';var OpenchannelInteractionEvents=require(_0x3bf5('0x0'));var events=[_0x3bf5('0x1'),_0x3bf5('0x2'),'update'];function createListener(_0x2027cf,_0x3587ee){return function(_0x41db27){_0x3587ee['emit'](_0x2027cf,_0x41db27);};}function removeListener(_0x5c8b48,_0x475638){return function(){OpenchannelInteractionEvents['removeListener'](_0x5c8b48,_0x475638);};}exports[_0x3bf5('0x3')]=function(_0x196964){for(var _0x1c488e=0x0,_0x43e172=events['length'];_0x1c488e<_0x43e172;_0x1c488e++){var _0x28075a=events[_0x1c488e];var _0x35ea7a=createListener(_0x3bf5('0x4')+_0x28075a,_0x196964);OpenchannelInteractionEvents['on'](_0x28075a,_0x35ea7a);}}; \ No newline at end of file +var _0x47f6=['emit','removeListener','register','length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update'];(function(_0x30f0e9,_0x4976a1){var _0x382486=function(_0x5560bb){while(--_0x5560bb){_0x30f0e9['push'](_0x30f0e9['shift']());}};_0x382486(++_0x4976a1);}(_0x47f6,0x12e));var _0x647f=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x47f6[_0x3dd15e];return _0x231fd0;};'use strict';var OpenchannelInteractionEvents=require(_0x647f('0x0'));var events=[_0x647f('0x1'),_0x647f('0x2'),_0x647f('0x3')];function createListener(_0x3560c8,_0x3f6946){return function(_0x1a4fc0){_0x3f6946[_0x647f('0x4')](_0x3560c8,_0x1a4fc0);};}function removeListener(_0x462f87,_0x1d8fa1){return function(){OpenchannelInteractionEvents[_0x647f('0x5')](_0x462f87,_0x1d8fa1);};}exports[_0x647f('0x6')]=function(_0x11bff3){for(var _0xe794b4=0x0,_0x8d3d8d=events[_0x647f('0x7')];_0xe794b4<_0x8d3d8d;_0xe794b4++){var _0x244dcd=events[_0xe794b4];var _0x42b56b=createListener(_0x647f('0x8')+_0x244dcd,_0x11bff3);OpenchannelInteractionEvents['on'](_0x244dcd,_0x42b56b);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 84b05dd..3a74b8b 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 _0x0e9d=['/:id','show','post','tracked','create','put','update','/:id/accept','accept','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe'];(function(_0x189cdf,_0x5558f9){var _0x16513d=function(_0x50c1f7){while(--_0x50c1f7){_0x189cdf['push'](_0x189cdf['shift']());}};_0x16513d(++_0x5558f9);}(_0x0e9d,0x15f));var _0xd0e9=function(_0x27f547,_0x340682){_0x27f547=_0x27f547-0x0;var _0x582258=_0x0e9d[_0x27f547];return _0x582258;};'use strict';var multer=require(_0xd0e9('0x0'));var util=require(_0xd0e9('0x1'));var path=require(_0xd0e9('0x2'));var timeout=require(_0xd0e9('0x3'));var express=require(_0xd0e9('0x4'));var router=express[_0xd0e9('0x5')]();var auth=require(_0xd0e9('0x6'));var interaction=require(_0xd0e9('0x7'));var config=require(_0xd0e9('0x8'));var controller=require('./openchannelMessage.controller');router[_0xd0e9('0x9')]('/',auth[_0xd0e9('0xa')](),controller['index']);router['get'](_0xd0e9('0xb'),auth[_0xd0e9('0xa')](),controller[_0xd0e9('0xc')]);router[_0xd0e9('0x9')](_0xd0e9('0xd'),auth[_0xd0e9('0xa')](),controller[_0xd0e9('0xe')]);router[_0xd0e9('0xf')]('/',auth[_0xd0e9('0xa')](),interaction[_0xd0e9('0x10')]('openchannel','openchannelmessage:create'),controller[_0xd0e9('0x11')]);router[_0xd0e9('0x12')](_0xd0e9('0xd'),auth['isAuthenticated'](),controller[_0xd0e9('0x13')]);router[_0xd0e9('0x12')](_0xd0e9('0x14'),auth[_0xd0e9('0xa')](),controller[_0xd0e9('0x15')]);router[_0xd0e9('0x12')]('/:id/reject',auth[_0xd0e9('0xa')](),controller[_0xd0e9('0x16')]);router[_0xd0e9('0x17')]('/:id',auth['isAuthenticated'](),controller[_0xd0e9('0x18')]);module[_0xd0e9('0x19')]=router; \ No newline at end of file +var _0x771f=['../../components/auth/service','../../components/interaction/service','./openchannelMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','tracked','openchannelmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express'];(function(_0x400635,_0x49a764){var _0x5b0c61=function(_0x2cb18a){while(--_0x2cb18a){_0x400635['push'](_0x400635['shift']());}};_0x5b0c61(++_0x49a764);}(_0x771f,0x6b));var _0xf771=function(_0x45afc4,_0xeaa0e3){_0x45afc4=_0x45afc4-0x0;var _0x43e32b=_0x771f[_0x45afc4];return _0x43e32b;};'use strict';var multer=require(_0xf771('0x0'));var util=require(_0xf771('0x1'));var path=require(_0xf771('0x2'));var timeout=require(_0xf771('0x3'));var express=require(_0xf771('0x4'));var router=express['Router']();var auth=require(_0xf771('0x5'));var interaction=require(_0xf771('0x6'));var config=require('../../config/environment');var controller=require(_0xf771('0x7'));router['get']('/',auth[_0xf771('0x8')](),controller[_0xf771('0x9')]);router[_0xf771('0xa')](_0xf771('0xb'),auth['isAuthenticated'](),controller[_0xf771('0xc')]);router[_0xf771('0xa')](_0xf771('0xd'),auth['isAuthenticated'](),controller[_0xf771('0xe')]);router[_0xf771('0xf')]('/',auth[_0xf771('0x8')](),interaction[_0xf771('0x10')]('openchannel',_0xf771('0x11')),controller[_0xf771('0x12')]);router[_0xf771('0x13')](_0xf771('0xd'),auth['isAuthenticated'](),controller[_0xf771('0x14')]);router[_0xf771('0x13')](_0xf771('0x15'),auth[_0xf771('0x8')](),controller[_0xf771('0x16')]);router[_0xf771('0x13')](_0xf771('0x17'),auth[_0xf771('0x8')](),controller[_0xf771('0x18')]);router[_0xf771('0x19')](_0xf771('0xd'),auth[_0xf771('0x8')](),controller[_0xf771('0x1a')]);module[_0xf771('0x1b')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 7943cc6..03bfa9f 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 _0xf24c=['out','sequelize','exports','TEXT','medium','BOOLEAN','ENUM'];(function(_0x20ea89,_0x1bfce6){var _0x1f06a8=function(_0xc541ce){while(--_0xc541ce){_0x20ea89['push'](_0x20ea89['shift']());}};_0x1f06a8(++_0x1bfce6);}(_0xf24c,0x112));var _0xcf24=function(_0x361751,_0x1cdc76){_0x361751=_0x361751-0x0;var _0x65769b=_0xf24c[_0x361751];return _0x65769b;};'use strict';var Sequelize=require(_0xcf24('0x0'));module[_0xcf24('0x1')]={'body':{'type':Sequelize[_0xcf24('0x2')](_0xcf24('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0xcf24('0x4')],'defaultValue':![]},'secret':{'type':Sequelize[_0xcf24('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xcf24('0x5')]('in','out'),'defaultValue':_0xcf24('0x6'),'allowNull':![]},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0x9108=['out','DATE','sequelize','TEXT','medium','BOOLEAN','ENUM'];(function(_0x2692b8,_0x454d47){var _0x17f020=function(_0x3d4bae){while(--_0x3d4bae){_0x2692b8['push'](_0x2692b8['shift']());}};_0x17f020(++_0x454d47);}(_0x9108,0x175));var _0x8910=function(_0x26ccfe,_0x3f8f73){_0x26ccfe=_0x26ccfe-0x0;var _0x151096=_0x9108[_0x26ccfe];return _0x151096;};'use strict';var Sequelize=require(_0x8910('0x0'));module['exports']={'body':{'type':Sequelize[_0x8910('0x1')](_0x8910('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8910('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8910('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8910('0x4')]('in',_0x8910('0x5')),'defaultValue':_0x8910('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8910('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index eb85fda..39c094e 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 _0x478b=['zip-dir','fast-json-patch','request-promise','bluebird','path','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','name','send','OpenchannelMessage','rawAttributes','fieldName','key','model','keys','query','filters','intersection','attributes','fields','sort','where','pick','filter','map','merge','options','includeAll','include','findAll','rows','show','params','find','create','body','describe','openchannel-interactions','accept','openchannel','read','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','Contact','get','OpenchannelInteraction','interaction','role','null','AcceptMessage','acceptMessage','interface','SIP/%s','channel','event','EventManager','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','rejectmessage','html-pdf','eml-format','rimraf'];(function(_0x2ba015,_0x2e95bb){var _0x2f2ec9=function(_0x130b10){while(--_0x130b10){_0x2ba015['push'](_0x2ba015['shift']());}};_0x2f2ec9(++_0x2e95bb);}(_0x478b,0x162));var _0xb478=function(_0x4bd59f,_0x5e6786){_0x4bd59f=_0x4bd59f-0x0;var _0x1f8774=_0x478b[_0x4bd59f];return _0x1f8774;};'use strict';var pdf=require(_0xb478('0x0'));var emlformat=require(_0xb478('0x1'));var rimraf=require(_0xb478('0x2'));var zipdir=require(_0xb478('0x3'));var jsonpatch=require(_0xb478('0x4'));var rp=require(_0xb478('0x5'));var moment=require('moment');var BPromise=require(_0xb478('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xb478('0x7'));var sox=require('sox');var csv=require(_0xb478('0x8'));var ejs=require(_0xb478('0x9'));var fs=require('fs');var _=require(_0xb478('0xa'));var squel=require(_0xb478('0xb'));var crypto=require(_0xb478('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xb478('0xd'));var toCsv=require(_0xb478('0x8'));var querystring=require('querystring');var Papa=require(_0xb478('0xe'));var Redis=require(_0xb478('0xf'));var authService=require(_0xb478('0x10'));var qs=require(_0xb478('0x11'));var as=require(_0xb478('0x12'));var hardwareService=require(_0xb478('0x13'));var logger=require(_0xb478('0x14'))(_0xb478('0x15'));var utils=require(_0xb478('0x16'));var config=require('../../config/environment');var db=require(_0xb478('0x17'))['db'];config[_0xb478('0x18')]=_[_0xb478('0x19')](config[_0xb478('0x18')],{'host':_0xb478('0x1a'),'port':0x18eb});var socket=require(_0xb478('0x1b'))(new Redis(config[_0xb478('0x18')]));require('./openchannelMessage.socket')[_0xb478('0x1c')](socket);var jayson=require(_0xb478('0x1d'));var client=jayson[_0xb478('0x1e')][_0xb478('0x1f')]({'port':0x232c});var client9002=jayson[_0xb478('0x1e')][_0xb478('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x141d53,_0x4ced12,_0x562a78){if(_0x562a78){var _0x14a982=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x14a982['test'](_0x4ced12)){return _0x141d53;}else{throw new db[(_0xb478('0x20'))][(_0xb478('0x21'))](_0xb478('0x22'));}}else{return _0x141d53;}}function respondWithRpcPromise(_0x92b253,_0x343566,_0x5f19a9,_0x27d59a){return new BPromise(function(_0x3ff35a,_0x25d605){var _0x2ed731=_0x27d59a||client;return _0x2ed731[_0xb478('0x23')](_0x92b253,_0x5f19a9)[_0xb478('0x24')](function(_0x3b91b6){logger[_0xb478('0x25')]('OpenchannelMessage,\x20%s,\x20%s',_0x343566,_0xb478('0x26'));logger[_0xb478('0x27')](_0xb478('0x28'),_0x343566,_0xb478('0x26'),JSON[_0xb478('0x29')](_0x3b91b6));if(_0x3b91b6[_0xb478('0x2a')]){if(_0x3b91b6['error'][_0xb478('0x2b')]===0x1f4){logger[_0xb478('0x2a')](_0xb478('0x2c'),_0x343566,_0x3b91b6[_0xb478('0x2a')][_0xb478('0x2d')]);return _0x25d605(_0x3b91b6['error'][_0xb478('0x2d')]);}logger['error'](_0xb478('0x2c'),_0x343566,_0x3b91b6['error'][_0xb478('0x2d')]);return _0x3ff35a(_0x3b91b6['error'][_0xb478('0x2d')]);}else{logger['info'](_0xb478('0x2c'),_0x343566,_0xb478('0x26'));_0x3ff35a(_0x3b91b6[_0xb478('0x2e')]['message']);}})[_0xb478('0x2f')](function(_0x2088dc){logger[_0xb478('0x2a')](_0xb478('0x2c'),_0x343566,_0x2088dc);_0x25d605(_0x2088dc);});});}function respondWithStatusCode(_0x3e513b,_0xf12e10){_0xf12e10=_0xf12e10||0xcc;return function(_0xc9820c){if(_0xc9820c){return _0x3e513b[_0xb478('0x30')](_0xf12e10);}return _0x3e513b[_0xb478('0x31')](_0xf12e10)[_0xb478('0x32')]();};}function respondWithResult(_0x38ba5f,_0xd4d363){_0xd4d363=_0xd4d363||0xc8;return function(_0x3e4e87){if(_0x3e4e87){return _0x38ba5f['status'](_0xd4d363)[_0xb478('0x33')](_0x3e4e87);}};}function respondWithFilteredResult(_0x45a456,_0x4778c0){return function(_0x5514c2){if(_0x5514c2){var _0x11661a=_0x5514c2[_0xb478('0x34')],_0x527ad4=_0x4778c0[_0xb478('0x35')],_0x2e2d7f=_0x4778c0['offset']+_0x4778c0[_0xb478('0x36')],_0x25fbee;if(_0x2e2d7f>=_0x11661a){_0x2e2d7f=_0x11661a;_0x25fbee=0xc8;}else{_0x25fbee=0xce;}_0x45a456[_0xb478('0x31')](_0x25fbee);return _0x45a456[_0xb478('0x37')](_0xb478('0x38'),_0x527ad4+'-'+_0x2e2d7f+'/'+_0x11661a)['json'](_0x5514c2);}return null;};}function patchUpdates(_0x25ff37){return function(_0x48861f){try{jsonpatch[_0xb478('0x39')](_0x48861f,_0x25ff37,!![]);}catch(_0x49bb7f){return BPromise[_0xb478('0x3a')](_0x49bb7f);}return _0x48861f[_0xb478('0x3b')]();};}function saveUpdates(_0xb08449,_0x1d804c){return function(_0x4bb251){if(_0x4bb251){return _0x4bb251[_0xb478('0x3c')](_0xb08449)[_0xb478('0x24')](function(_0x459168){return _0x459168;});}return null;};}function removeEntity(_0x351717,_0x571841){return function(_0xe1d4df){if(_0xe1d4df){return _0xe1d4df[_0xb478('0x3d')]()['then'](function(){_0x351717['status'](0xcc)[_0xb478('0x32')]();});}};}function handleEntityNotFound(_0x281fe9,_0x4305d4){return function(_0x9f555a){if(!_0x9f555a){_0x281fe9[_0xb478('0x30')](0x194);}return _0x9f555a;};}function handleError(_0x2b0fe0,_0x37e4bf){_0x37e4bf=_0x37e4bf||0x1f4;return function(_0x4b9b0a){logger['error'](_0x4b9b0a['stack']);if(_0x4b9b0a[_0xb478('0x3e')]){delete _0x4b9b0a[_0xb478('0x3e')];}_0x2b0fe0[_0xb478('0x31')](_0x37e4bf)[_0xb478('0x3f')](_0x4b9b0a);};}exports['index']=function(_0x158fc3,_0x50a93d){var _0x11a9cc={},_0x170eb1={},_0x4e0985={'count':0x0,'rows':[]};var _0xb4c4af=_['map'](db[_0xb478('0x40')][_0xb478('0x41')],function(_0x306151){return{'name':_0x306151[_0xb478('0x42')],'type':_0x306151['type'][_0xb478('0x43')]};});_0x170eb1[_0xb478('0x44')]=_['map'](_0xb4c4af,_0xb478('0x3e'));_0x170eb1['query']=_[_0xb478('0x45')](_0x158fc3[_0xb478('0x46')]);_0x170eb1[_0xb478('0x47')]=_[_0xb478('0x48')](_0x170eb1[_0xb478('0x44')],_0x170eb1['query']);_0x11a9cc[_0xb478('0x49')]=_[_0xb478('0x48')](_0x170eb1[_0xb478('0x44')],qs[_0xb478('0x4a')](_0x158fc3[_0xb478('0x46')]['fields']));_0x11a9cc[_0xb478('0x49')]=_0x11a9cc['attributes']['length']?_0x11a9cc[_0xb478('0x49')]:_0x170eb1[_0xb478('0x44')];if(!_0x158fc3[_0xb478('0x46')]['hasOwnProperty']('nolimit')){_0x11a9cc[_0xb478('0x36')]=qs[_0xb478('0x36')](_0x158fc3[_0xb478('0x46')]['limit']);_0x11a9cc[_0xb478('0x35')]=qs[_0xb478('0x35')](_0x158fc3[_0xb478('0x46')][_0xb478('0x35')]);}_0x11a9cc['order']=qs[_0xb478('0x4b')](_0x158fc3[_0xb478('0x46')]['sort']);_0x11a9cc[_0xb478('0x4c')]=qs[_0xb478('0x47')](_[_0xb478('0x4d')](_0x158fc3[_0xb478('0x46')],_0x170eb1[_0xb478('0x47')]));if(_0x158fc3[_0xb478('0x46')][_0xb478('0x4e')]){_0x11a9cc[_0xb478('0x4c')]=_['merge'](_0x11a9cc[_0xb478('0x4c')],{'$or':_[_0xb478('0x4f')](_0xb4c4af,function(_0x61b6a1){if(_0x61b6a1['type']!=='VIRTUAL'){var _0xbe388e={};_0xbe388e[_0x61b6a1[_0xb478('0x3e')]]={'$like':'%'+_0x158fc3['query'][_0xb478('0x4e')]+'%'};return _0xbe388e;}})});}_0x11a9cc=_[_0xb478('0x50')]({},_0x11a9cc,_0x158fc3[_0xb478('0x51')]);var _0x24bdcd={'where':_0x11a9cc[_0xb478('0x4c')]};return db[_0xb478('0x40')]['count'](_0x24bdcd)[_0xb478('0x24')](function(_0x587780){_0x4e0985[_0xb478('0x34')]=_0x587780;if(_0x158fc3['query'][_0xb478('0x52')]){_0x11a9cc[_0xb478('0x53')]=[{'all':!![]}];}return db[_0xb478('0x40')][_0xb478('0x54')](_0x11a9cc);})[_0xb478('0x24')](function(_0x23cbf6){_0x4e0985[_0xb478('0x55')]=_0x23cbf6;return _0x4e0985;})[_0xb478('0x24')](respondWithFilteredResult(_0x50a93d,_0x11a9cc))[_0xb478('0x2f')](handleError(_0x50a93d,null));};exports[_0xb478('0x56')]=function(_0x2b846a,_0x36af5b){var _0x13bf15={'raw':!![],'where':{'id':_0x2b846a[_0xb478('0x57')]['id']}},_0x2c76c4={};_0x2c76c4['model']=_[_0xb478('0x45')](db['OpenchannelMessage'][_0xb478('0x41')]);_0x2c76c4[_0xb478('0x46')]=_['keys'](_0x2b846a[_0xb478('0x46')]);_0x2c76c4[_0xb478('0x47')]=_['intersection'](_0x2c76c4[_0xb478('0x44')],_0x2c76c4[_0xb478('0x46')]);_0x13bf15[_0xb478('0x49')]=_[_0xb478('0x48')](_0x2c76c4[_0xb478('0x44')],qs[_0xb478('0x4a')](_0x2b846a[_0xb478('0x46')]['fields']));_0x13bf15[_0xb478('0x49')]=_0x13bf15[_0xb478('0x49')]['length']?_0x13bf15[_0xb478('0x49')]:_0x2c76c4[_0xb478('0x44')];if(_0x2b846a[_0xb478('0x46')][_0xb478('0x52')]){_0x13bf15[_0xb478('0x53')]=[{'all':!![]}];}_0x13bf15=_[_0xb478('0x50')]({},_0x13bf15,_0x2b846a['options']);return db[_0xb478('0x40')][_0xb478('0x58')](_0x13bf15)[_0xb478('0x24')](handleEntityNotFound(_0x36af5b,null))[_0xb478('0x24')](respondWithResult(_0x36af5b,null))[_0xb478('0x2f')](handleError(_0x36af5b,null));};exports[_0xb478('0x59')]=function(_0x48f304,_0x2b0343){return db['OpenchannelMessage'][_0xb478('0x59')](_0x48f304['body'],{})[_0xb478('0x24')](respondWithResult(_0x2b0343,0xc9))[_0xb478('0x2f')](handleError(_0x2b0343,null));};exports[_0xb478('0x3c')]=function(_0xfe7edd,_0x2f531a){if(_0xfe7edd[_0xb478('0x5a')]['id']){delete _0xfe7edd[_0xb478('0x5a')]['id'];}return db[_0xb478('0x40')][_0xb478('0x58')]({'where':{'id':_0xfe7edd['params']['id']}})[_0xb478('0x24')](handleEntityNotFound(_0x2f531a,null))['then'](saveUpdates(_0xfe7edd['body'],null))[_0xb478('0x24')](respondWithResult(_0x2f531a,null))[_0xb478('0x2f')](handleError(_0x2f531a,null));};exports[_0xb478('0x3d')]=function(_0x35b2fb,_0x3ff87f){return db['OpenchannelMessage'][_0xb478('0x58')]({'where':{'id':_0x35b2fb[_0xb478('0x57')]['id']}})['then'](handleEntityNotFound(_0x3ff87f,null))[_0xb478('0x24')](removeEntity(_0x3ff87f,null))[_0xb478('0x2f')](handleError(_0x3ff87f,null));};exports[_0xb478('0x5b')]=function(_0x128912,_0x504132){return db[_0xb478('0x40')]['describe']()[_0xb478('0x24')](respondWithResult(_0x504132,null))['catch'](handleError(_0x504132,null));};var interaction_log=require(_0xb478('0x14'))(_0xb478('0x5c'));exports[_0xb478('0x5d')]=function(_0x2d13da,_0x495600,_0x48e551){var _0x337389={'channel':_0xb478('0x5e')};if(_0x2d13da[_0xb478('0x5a')]['id']){delete _0x2d13da[_0xb478('0x5a')]['id'];}_0x2d13da[_0xb478('0x5a')][_0xb478('0x5f')]=!![];_0x2d13da[_0xb478('0x5a')]['readAt']=moment()[_0xb478('0x60')](_0xb478('0x61'));_0x2d13da['body'][_0xb478('0x62')]=_0x2d13da['body'][_0xb478('0x62')]||_0x2d13da[_0xb478('0x63')]['id'];return db['OpenchannelMessage'][_0xb478('0x58')]({'where':{'id':_0x2d13da['params']['id'],'UserId':null},'include':[{'model':db['CmContact'],'as':_0xb478('0x64')}]})['then'](handleEntityNotFound(_0x495600,null))[_0xb478('0x24')](saveUpdates(_0x2d13da[_0xb478('0x5a')],null))[_0xb478('0x24')](function(_0x362f08){if(_0x362f08){_0x337389['message']=_0x362f08[_0xb478('0x65')]({'plain':!![]});return db[_0xb478('0x66')]['find']({'where':{'id':_0x362f08['OpenchannelInteractionId']}});}return null;})[_0xb478('0x24')](handleEntityNotFound(_0x495600,null))['then'](function(_0x10e4c2){if(_0x10e4c2){return _0x10e4c2[_0xb478('0x3c')]({'UserId':_0x2d13da[_0xb478('0x5a')]['UserId'],'read1stAt':_['isNil'](_0x10e4c2['read1stAt'])?moment()['format'](_0xb478('0x61')):undefined});}return null;})[_0xb478('0x24')](function(_0x3ec10f){if(_0x3ec10f){_0x337389[_0xb478('0x67')]=_0x3ec10f[_0xb478('0x65')]({'plain':!![]});interaction_log[_0xb478('0x25')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x2d13da[_0xb478('0x63')]['id'],_0x2d13da[_0xb478('0x63')][_0xb478('0x3e')],_0x2d13da[_0xb478('0x63')][_0xb478('0x68')],_0x337389['interaction']['id'],_0x2d13da[_0xb478('0x5a')]?JSON['stringify'](_0x2d13da[_0xb478('0x5a')]):_0xb478('0x69'));return respondWithRpcPromise(_0xb478('0x6a'),_0xb478('0x6b'),_0x337389);}return null;})[_0xb478('0x24')](function(_0x15ba68){if(_0x15ba68){if(_0x2d13da[_0xb478('0x5a')]['manual']){_0x337389['message'][_0xb478('0x6c')]=util[_0xb478('0x60')](_0xb478('0x6d'),_0x2d13da[_0xb478('0x63')]['name']);_0x337389[_0xb478('0x2d')]['channel']=_0x337389[_0xb478('0x6e')];_0x337389[_0xb478('0x2d')][_0xb478('0x6f')]=_0xb478('0x5d');return respondWithRpcPromise('EventManager',_0xb478('0x70'),{'event':'acceptmessage','message':_0x337389[_0xb478('0x2d')]},client9002)[_0xb478('0x24')](function(){return _0x337389;});}return _0x337389;}return null;})[_0xb478('0x24')](respondWithResult(_0x495600,null))['catch'](handleError(_0x495600,null));};var interaction_log=require(_0xb478('0x14'))('openchannel-interactions');exports['reject']=function(_0x3824fd,_0xf1e64b,_0x43e8de){var _0xd074c8={'agent':{},'channel':'openchannel'};if(_0x3824fd[_0xb478('0x5a')]['id']){delete _0x3824fd['body']['id'];}_0x3824fd[_0xb478('0x5a')]['UserId']=_0x3824fd[_0xb478('0x5a')][_0xb478('0x62')]||_0x3824fd['user']['id'];_0xd074c8[_0xb478('0x71')]['id']=_0x3824fd[_0xb478('0x5a')][_0xb478('0x62')];return db[_0xb478('0x40')][_0xb478('0x58')]({'where':{'id':_0x3824fd[_0xb478('0x57')]['id'],'UserId':null}})[_0xb478('0x24')](handleEntityNotFound(_0xf1e64b,null))[_0xb478('0x24')](function(_0x23058a){if(_0x23058a){_0xd074c8[_0xb478('0x2d')]=_0x23058a[_0xb478('0x65')]({'plain':!![]});return db['OpenchannelInteraction'][_0xb478('0x58')]({'where':{'id':_0x23058a[_0xb478('0x72')]}});}return null;})[_0xb478('0x24')](handleEntityNotFound(_0xf1e64b,null))[_0xb478('0x24')](function(_0x2bde71){if(_0x2bde71){_0xd074c8[_0xb478('0x67')]=_0x2bde71[_0xb478('0x65')]({'plain':!![]});interaction_log[_0xb478('0x25')](_0xb478('0x73'),_0x3824fd['user']['id'],_0x3824fd['user'][_0xb478('0x3e')],_0x3824fd[_0xb478('0x63')][_0xb478('0x68')],_0xd074c8[_0xb478('0x67')]['id'],_0x3824fd[_0xb478('0x5a')]?JSON[_0xb478('0x29')](_0x3824fd[_0xb478('0x5a')]):'null');return respondWithRpcPromise(_0xb478('0x74'),_0xb478('0x75'),_0xd074c8);}return null;})[_0xb478('0x24')](function(_0x5a8488){if(_0x5a8488){_0x5a8488[_0xb478('0x2d')]['interface']=util[_0xb478('0x60')](_0xb478('0x6d'),_0x3824fd[_0xb478('0x63')]['name']);_0x5a8488[_0xb478('0x2d')]['channel']=_0xd074c8[_0xb478('0x6e')];_0x5a8488[_0xb478('0x2d')][_0xb478('0x6f')]=_0xb478('0x3a');respondWithRpcPromise(_0xb478('0x70'),_0xb478('0x70'),{'event':_0xb478('0x76'),'message':_0x5a8488[_0xb478('0x2d')]},client9002);return _0xd074c8;}return null;})[_0xb478('0x24')](respondWithResult(_0xf1e64b,null))[_0xb478('0x2f')](handleError(_0xf1e64b,null));}; \ No newline at end of file +var _0x114f=['null','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','agent','OpenchannelInteractionId','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','zip-dir','fast-json-patch','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','jayson/promise','client','http','test','Sequelize','request','info','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelMessage,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','where','pick','filter','merge','VIRTUAL','options','then','include','findAll','show','params','includeAll','body','find','describe','openchannel-interactions','openchannel','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','get','OpenchannelInteraction','isNil','read1stAt','interaction','user','role'];(function(_0x2272f6,_0x168055){var _0x16ce9b=function(_0x5bc758){while(--_0x5bc758){_0x2272f6['push'](_0x2272f6['shift']());}};_0x16ce9b(++_0x168055);}(_0x114f,0x10c));var _0xf114=function(_0xb6e2ea,_0x3b26e9){_0xb6e2ea=_0xb6e2ea-0x0;var _0x2a57bb=_0x114f[_0xb6e2ea];return _0x2a57bb;};'use strict';var pdf=require(_0xf114('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf114('0x1'));var jsonpatch=require(_0xf114('0x2'));var rp=require('request-promise');var moment=require(_0xf114('0x3'));var BPromise=require(_0xf114('0x4'));var Mustache=require('mustache');var util=require(_0xf114('0x5'));var path=require(_0xf114('0x6'));var sox=require('sox');var csv=require(_0xf114('0x7'));var ejs=require(_0xf114('0x8'));var fs=require('fs');var _=require(_0xf114('0x9'));var squel=require(_0xf114('0xa'));var crypto=require('crypto');var jsforce=require(_0xf114('0xb'));var deskjs=require(_0xf114('0xc'));var toCsv=require(_0xf114('0x7'));var querystring=require(_0xf114('0xd'));var Papa=require(_0xf114('0xe'));var Redis=require(_0xf114('0xf'));var authService=require(_0xf114('0x10'));var qs=require(_0xf114('0x11'));var as=require(_0xf114('0x12'));var hardwareService=require(_0xf114('0x13'));var logger=require(_0xf114('0x14'))(_0xf114('0x15'));var utils=require(_0xf114('0x16'));var config=require(_0xf114('0x17'));var db=require(_0xf114('0x18'))['db'];config[_0xf114('0x19')]=_[_0xf114('0x1a')](config['redis'],{'host':_0xf114('0x1b'),'port':0x18eb});var socket=require(_0xf114('0x1c'))(new Redis(config[_0xf114('0x19')]));require(_0xf114('0x1d'))['register'](socket);var jayson=require(_0xf114('0x1e'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xf114('0x1f')][_0xf114('0x20')]({'port':0x232a});function checkPasswordPattern(_0x2fcee1,_0x56151c,_0x188648){if(_0x188648){var _0x598093=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x598093[_0xf114('0x21')](_0x56151c)){return _0x2fcee1;}else{throw new db[(_0xf114('0x22'))]['ValidationError']('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2fcee1;}}function respondWithRpcPromise(_0x244f22,_0x388a4f,_0x580a33,_0x14f330){return new BPromise(function(_0x51931d,_0x626166){var _0x40b993=_0x14f330||client;return _0x40b993[_0xf114('0x23')](_0x244f22,_0x580a33)['then'](function(_0x129761){logger[_0xf114('0x24')]('OpenchannelMessage,\x20%s,\x20%s',_0x388a4f,_0xf114('0x25'));logger[_0xf114('0x26')](_0xf114('0x27'),_0x388a4f,_0xf114('0x25'),JSON[_0xf114('0x28')](_0x129761));if(_0x129761[_0xf114('0x29')]){if(_0x129761[_0xf114('0x29')][_0xf114('0x2a')]===0x1f4){logger[_0xf114('0x29')](_0xf114('0x2b'),_0x388a4f,_0x129761[_0xf114('0x29')][_0xf114('0x2c')]);return _0x626166(_0x129761[_0xf114('0x29')]['message']);}logger[_0xf114('0x29')](_0xf114('0x2b'),_0x388a4f,_0x129761[_0xf114('0x29')][_0xf114('0x2c')]);return _0x51931d(_0x129761['error'][_0xf114('0x2c')]);}else{logger[_0xf114('0x24')](_0xf114('0x2b'),_0x388a4f,_0xf114('0x25'));_0x51931d(_0x129761[_0xf114('0x2d')]['message']);}})[_0xf114('0x2e')](function(_0x52fcf4){logger['error'](_0xf114('0x2b'),_0x388a4f,_0x52fcf4);_0x626166(_0x52fcf4);});});}function respondWithStatusCode(_0xece911,_0x132c52){_0x132c52=_0x132c52||0xcc;return function(_0x558583){if(_0x558583){return _0xece911[_0xf114('0x2f')](_0x132c52);}return _0xece911[_0xf114('0x30')](_0x132c52)[_0xf114('0x31')]();};}function respondWithResult(_0x100514,_0x3bbfab){_0x3bbfab=_0x3bbfab||0xc8;return function(_0x4cc351){if(_0x4cc351){return _0x100514[_0xf114('0x30')](_0x3bbfab)[_0xf114('0x32')](_0x4cc351);}};}function respondWithFilteredResult(_0x1c0956,_0x149cb1){return function(_0x4d36db){if(_0x4d36db){var _0x1e0edf=_0x4d36db[_0xf114('0x33')],_0x51ad6f=_0x149cb1[_0xf114('0x34')],_0x875751=_0x149cb1['offset']+_0x149cb1['limit'],_0xfa7a70;if(_0x875751>=_0x1e0edf){_0x875751=_0x1e0edf;_0xfa7a70=0xc8;}else{_0xfa7a70=0xce;}_0x1c0956[_0xf114('0x30')](_0xfa7a70);return _0x1c0956[_0xf114('0x35')](_0xf114('0x36'),_0x51ad6f+'-'+_0x875751+'/'+_0x1e0edf)[_0xf114('0x32')](_0x4d36db);}return null;};}function patchUpdates(_0x227699){return function(_0x1611ce){try{jsonpatch[_0xf114('0x37')](_0x1611ce,_0x227699,!![]);}catch(_0x395878){return BPromise[_0xf114('0x38')](_0x395878);}return _0x1611ce[_0xf114('0x39')]();};}function saveUpdates(_0x6bad80,_0x14631f){return function(_0x12bafa){if(_0x12bafa){return _0x12bafa[_0xf114('0x3a')](_0x6bad80)['then'](function(_0x396030){return _0x396030;});}return null;};}function removeEntity(_0x583ad8,_0xfc462f){return function(_0x3efd10){if(_0x3efd10){return _0x3efd10[_0xf114('0x3b')]()['then'](function(){_0x583ad8[_0xf114('0x30')](0xcc)[_0xf114('0x31')]();});}};}function handleEntityNotFound(_0x1d0708,_0xb345e0){return function(_0x3878c9){if(!_0x3878c9){_0x1d0708[_0xf114('0x2f')](0x194);}return _0x3878c9;};}function handleError(_0x1644a4,_0x4270b2){_0x4270b2=_0x4270b2||0x1f4;return function(_0x1a0971){logger[_0xf114('0x29')](_0x1a0971['stack']);if(_0x1a0971[_0xf114('0x3c')]){delete _0x1a0971[_0xf114('0x3c')];}_0x1644a4[_0xf114('0x30')](_0x4270b2)[_0xf114('0x3d')](_0x1a0971);};}exports[_0xf114('0x3e')]=function(_0x4e07d4,_0x3a13d1){var _0x59ed86={},_0x39271={},_0x3f72b9={'count':0x0,'rows':[]};var _0x201f07=_[_0xf114('0x3f')](db[_0xf114('0x40')][_0xf114('0x41')],function(_0x5dc5e4){return{'name':_0x5dc5e4[_0xf114('0x42')],'type':_0x5dc5e4[_0xf114('0x43')][_0xf114('0x44')]};});_0x39271[_0xf114('0x45')]=_[_0xf114('0x3f')](_0x201f07,_0xf114('0x3c'));_0x39271[_0xf114('0x46')]=_[_0xf114('0x47')](_0x4e07d4['query']);_0x39271[_0xf114('0x48')]=_[_0xf114('0x49')](_0x39271[_0xf114('0x45')],_0x39271[_0xf114('0x46')]);_0x59ed86[_0xf114('0x4a')]=_['intersection'](_0x39271[_0xf114('0x45')],qs[_0xf114('0x4b')](_0x4e07d4[_0xf114('0x46')][_0xf114('0x4b')]));_0x59ed86[_0xf114('0x4a')]=_0x59ed86[_0xf114('0x4a')][_0xf114('0x4c')]?_0x59ed86[_0xf114('0x4a')]:_0x39271[_0xf114('0x45')];if(!_0x4e07d4['query']['hasOwnProperty'](_0xf114('0x4d'))){_0x59ed86[_0xf114('0x4e')]=qs[_0xf114('0x4e')](_0x4e07d4['query'][_0xf114('0x4e')]);_0x59ed86[_0xf114('0x34')]=qs[_0xf114('0x34')](_0x4e07d4['query'][_0xf114('0x34')]);}_0x59ed86[_0xf114('0x4f')]=qs['sort'](_0x4e07d4['query']['sort']);_0x59ed86[_0xf114('0x50')]=qs[_0xf114('0x48')](_[_0xf114('0x51')](_0x4e07d4[_0xf114('0x46')],_0x39271[_0xf114('0x48')]));if(_0x4e07d4['query'][_0xf114('0x52')]){_0x59ed86[_0xf114('0x50')]=_[_0xf114('0x53')](_0x59ed86['where'],{'$or':_[_0xf114('0x3f')](_0x201f07,function(_0x31aaea){if(_0x31aaea[_0xf114('0x43')]!==_0xf114('0x54')){var _0x1d8b17={};_0x1d8b17[_0x31aaea[_0xf114('0x3c')]]={'$like':'%'+_0x4e07d4[_0xf114('0x46')][_0xf114('0x52')]+'%'};return _0x1d8b17;}})});}_0x59ed86=_[_0xf114('0x53')]({},_0x59ed86,_0x4e07d4[_0xf114('0x55')]);var _0x2e3f26={'where':_0x59ed86['where']};return db[_0xf114('0x40')][_0xf114('0x33')](_0x2e3f26)[_0xf114('0x56')](function(_0x5c9d18){_0x3f72b9[_0xf114('0x33')]=_0x5c9d18;if(_0x4e07d4['query']['includeAll']){_0x59ed86[_0xf114('0x57')]=[{'all':!![]}];}return db['OpenchannelMessage'][_0xf114('0x58')](_0x59ed86);})[_0xf114('0x56')](function(_0x3c4fac){_0x3f72b9['rows']=_0x3c4fac;return _0x3f72b9;})[_0xf114('0x56')](respondWithFilteredResult(_0x3a13d1,_0x59ed86))[_0xf114('0x2e')](handleError(_0x3a13d1,null));};exports[_0xf114('0x59')]=function(_0x2edb81,_0x141fa0){var _0x1ba66c={'raw':!![],'where':{'id':_0x2edb81[_0xf114('0x5a')]['id']}},_0x3d01cc={};_0x3d01cc[_0xf114('0x45')]=_[_0xf114('0x47')](db['OpenchannelMessage']['rawAttributes']);_0x3d01cc['query']=_['keys'](_0x2edb81[_0xf114('0x46')]);_0x3d01cc[_0xf114('0x48')]=_[_0xf114('0x49')](_0x3d01cc[_0xf114('0x45')],_0x3d01cc[_0xf114('0x46')]);_0x1ba66c[_0xf114('0x4a')]=_[_0xf114('0x49')](_0x3d01cc[_0xf114('0x45')],qs[_0xf114('0x4b')](_0x2edb81['query'][_0xf114('0x4b')]));_0x1ba66c[_0xf114('0x4a')]=_0x1ba66c[_0xf114('0x4a')][_0xf114('0x4c')]?_0x1ba66c[_0xf114('0x4a')]:_0x3d01cc['model'];if(_0x2edb81[_0xf114('0x46')][_0xf114('0x5b')]){_0x1ba66c[_0xf114('0x57')]=[{'all':!![]}];}_0x1ba66c=_[_0xf114('0x53')]({},_0x1ba66c,_0x2edb81[_0xf114('0x55')]);return db[_0xf114('0x40')]['find'](_0x1ba66c)['then'](handleEntityNotFound(_0x141fa0,null))[_0xf114('0x56')](respondWithResult(_0x141fa0,null))[_0xf114('0x2e')](handleError(_0x141fa0,null));};exports['create']=function(_0x36eca2,_0x26d7ae){return db[_0xf114('0x40')]['create'](_0x36eca2['body'],{})[_0xf114('0x56')](respondWithResult(_0x26d7ae,0xc9))['catch'](handleError(_0x26d7ae,null));};exports[_0xf114('0x3a')]=function(_0x2f3757,_0x4e4253){if(_0x2f3757[_0xf114('0x5c')]['id']){delete _0x2f3757[_0xf114('0x5c')]['id'];}return db[_0xf114('0x40')][_0xf114('0x5d')]({'where':{'id':_0x2f3757[_0xf114('0x5a')]['id']}})[_0xf114('0x56')](handleEntityNotFound(_0x4e4253,null))[_0xf114('0x56')](saveUpdates(_0x2f3757[_0xf114('0x5c')],null))['then'](respondWithResult(_0x4e4253,null))[_0xf114('0x2e')](handleError(_0x4e4253,null));};exports[_0xf114('0x3b')]=function(_0x149631,_0xd44e49){return db[_0xf114('0x40')][_0xf114('0x5d')]({'where':{'id':_0x149631['params']['id']}})[_0xf114('0x56')](handleEntityNotFound(_0xd44e49,null))[_0xf114('0x56')](removeEntity(_0xd44e49,null))[_0xf114('0x2e')](handleError(_0xd44e49,null));};exports[_0xf114('0x5e')]=function(_0x2252ae,_0x564368){return db[_0xf114('0x40')][_0xf114('0x5e')]()[_0xf114('0x56')](respondWithResult(_0x564368,null))[_0xf114('0x2e')](handleError(_0x564368,null));};var interaction_log=require('../../config/logger')(_0xf114('0x5f'));exports['accept']=function(_0x251555,_0x38946b,_0x17f21c){var _0x43840c={'channel':_0xf114('0x60')};if(_0x251555[_0xf114('0x5c')]['id']){delete _0x251555[_0xf114('0x5c')]['id'];}_0x251555[_0xf114('0x5c')][_0xf114('0x61')]=!![];_0x251555[_0xf114('0x5c')][_0xf114('0x62')]=moment()[_0xf114('0x63')](_0xf114('0x64'));_0x251555[_0xf114('0x5c')]['UserId']=_0x251555[_0xf114('0x5c')][_0xf114('0x65')]||_0x251555['user']['id'];return db['OpenchannelMessage'][_0xf114('0x5d')]({'where':{'id':_0x251555['params']['id'],'UserId':null},'include':[{'model':db[_0xf114('0x66')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x38946b,null))[_0xf114('0x56')](saveUpdates(_0x251555[_0xf114('0x5c')],null))['then'](function(_0x36a5c4){if(_0x36a5c4){_0x43840c[_0xf114('0x2c')]=_0x36a5c4[_0xf114('0x67')]({'plain':!![]});return db[_0xf114('0x68')][_0xf114('0x5d')]({'where':{'id':_0x36a5c4['OpenchannelInteractionId']}});}return null;})[_0xf114('0x56')](handleEntityNotFound(_0x38946b,null))['then'](function(_0x3262c3){if(_0x3262c3){return _0x3262c3[_0xf114('0x3a')]({'UserId':_0x251555[_0xf114('0x5c')][_0xf114('0x65')],'read1stAt':_[_0xf114('0x69')](_0x3262c3[_0xf114('0x6a')])?moment()['format'](_0xf114('0x64')):undefined});}return null;})[_0xf114('0x56')](function(_0x2c4670){if(_0x2c4670){_0x43840c[_0xf114('0x6b')]=_0x2c4670[_0xf114('0x67')]({'plain':!![]});interaction_log[_0xf114('0x24')]('[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x251555[_0xf114('0x6c')]['id'],_0x251555[_0xf114('0x6c')][_0xf114('0x3c')],_0x251555[_0xf114('0x6c')][_0xf114('0x6d')],_0x43840c[_0xf114('0x6b')]['id'],_0x251555[_0xf114('0x5c')]?JSON['stringify'](_0x251555[_0xf114('0x5c')]):_0xf114('0x6e'));return respondWithRpcPromise(_0xf114('0x6f'),_0xf114('0x70'),_0x43840c);}return null;})[_0xf114('0x56')](function(_0x2d2429){if(_0x2d2429){if(_0x251555['body']['manual']){_0x43840c[_0xf114('0x2c')]['interface']=util[_0xf114('0x63')](_0xf114('0x71'),_0x251555[_0xf114('0x6c')][_0xf114('0x3c')]);_0x43840c['message'][_0xf114('0x72')]=_0x43840c[_0xf114('0x72')];_0x43840c['message'][_0xf114('0x73')]=_0xf114('0x74');return respondWithRpcPromise(_0xf114('0x75'),_0xf114('0x75'),{'event':_0xf114('0x76'),'message':_0x43840c[_0xf114('0x2c')]},client9002)[_0xf114('0x56')](function(){return _0x43840c;});}return _0x43840c;}return null;})[_0xf114('0x56')](respondWithResult(_0x38946b,null))[_0xf114('0x2e')](handleError(_0x38946b,null));};var interaction_log=require('../../config/logger')(_0xf114('0x5f'));exports['reject']=function(_0x22db5a,_0x2cac4b,_0x4e85b6){var _0x3e7480={'agent':{},'channel':_0xf114('0x60')};if(_0x22db5a[_0xf114('0x5c')]['id']){delete _0x22db5a['body']['id'];}_0x22db5a[_0xf114('0x5c')]['UserId']=_0x22db5a[_0xf114('0x5c')][_0xf114('0x65')]||_0x22db5a[_0xf114('0x6c')]['id'];_0x3e7480[_0xf114('0x77')]['id']=_0x22db5a[_0xf114('0x5c')][_0xf114('0x65')];return db['OpenchannelMessage'][_0xf114('0x5d')]({'where':{'id':_0x22db5a[_0xf114('0x5a')]['id'],'UserId':null}})[_0xf114('0x56')](handleEntityNotFound(_0x2cac4b,null))[_0xf114('0x56')](function(_0x2c4219){if(_0x2c4219){_0x3e7480[_0xf114('0x2c')]=_0x2c4219['get']({'plain':!![]});return db[_0xf114('0x68')][_0xf114('0x5d')]({'where':{'id':_0x2c4219[_0xf114('0x78')]}});}return null;})[_0xf114('0x56')](handleEntityNotFound(_0x2cac4b,null))[_0xf114('0x56')](function(_0x2520f0){if(_0x2520f0){_0x3e7480[_0xf114('0x6b')]=_0x2520f0['get']({'plain':!![]});interaction_log[_0xf114('0x24')](_0xf114('0x79'),_0x22db5a[_0xf114('0x6c')]['id'],_0x22db5a[_0xf114('0x6c')][_0xf114('0x3c')],_0x22db5a['user']['role'],_0x3e7480[_0xf114('0x6b')]['id'],_0x22db5a[_0xf114('0x5c')]?JSON[_0xf114('0x28')](_0x22db5a['body']):'null');return respondWithRpcPromise(_0xf114('0x7a'),_0xf114('0x7b'),_0x3e7480);}return null;})[_0xf114('0x56')](function(_0x30babd){if(_0x30babd){_0x30babd[_0xf114('0x2c')][_0xf114('0x7c')]=util[_0xf114('0x63')](_0xf114('0x71'),_0x22db5a['user']['name']);_0x30babd[_0xf114('0x2c')]['channel']=_0x3e7480[_0xf114('0x72')];_0x30babd['message']['event']=_0xf114('0x38');respondWithRpcPromise('EventManager','EventManager',{'event':_0xf114('0x7d'),'message':_0x30babd[_0xf114('0x2c')]},client9002);return _0x3e7480;}return null;})[_0xf114('0x56')](respondWithResult(_0x2cac4b,null))[_0xf114('0x2e')](handleError(_0x2cac4b,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 9a28626..4fe77e3 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 _0x4174=['hook','exports','events','../../mysqldb','save','update','emit'];(function(_0x13c249,_0x5bfd97){var _0x59e79f=function(_0x5e471b){while(--_0x5e471b){_0x13c249['push'](_0x13c249['shift']());}};_0x59e79f(++_0x5bfd97);}(_0x4174,0x18a));var _0x4417=function(_0x18719d,_0x1557d2){_0x18719d=_0x18719d-0x0;var _0x111a39=_0x4174[_0x18719d];return _0x111a39;};'use strict';var EventEmitter=require(_0x4417('0x0'));var OpenchannelMessage=require(_0x4417('0x1'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x4417('0x2'),'afterUpdate':_0x4417('0x3'),'afterDestroy':'remove'};function emitEvent(_0x25a149){return function(_0x16db21,_0x4b6831,_0x5b1d32){OpenchannelMessageEvents[_0x4417('0x4')](_0x25a149+':'+_0x16db21['id'],_0x16db21);OpenchannelMessageEvents[_0x4417('0x4')](_0x25a149,_0x16db21);_0x5b1d32(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage[_0x4417('0x5')](e,emitEvent(event));}}module[_0x4417('0x6')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xe349=['setMaxListeners','save','update','remove','emit','hasOwnProperty','../../mysqldb'];(function(_0x5150d2,_0x44d26f){var _0x580e8b=function(_0x1f79b1){while(--_0x1f79b1){_0x5150d2['push'](_0x5150d2['shift']());}};_0x580e8b(++_0x44d26f);}(_0xe349,0x180));var _0x9e34=function(_0x40f9a0,_0x3458cc){_0x40f9a0=_0x40f9a0-0x0;var _0x3e3144=_0xe349[_0x40f9a0];return _0x3e3144;};'use strict';var EventEmitter=require('events');var OpenchannelMessage=require(_0x9e34('0x0'))['db']['OpenchannelMessage'];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0x9e34('0x1')](0x0);var events={'afterCreate':_0x9e34('0x2'),'afterUpdate':_0x9e34('0x3'),'afterDestroy':_0x9e34('0x4')};function emitEvent(_0x23c368){return function(_0x384d85,_0x5b8c89,_0x379554){OpenchannelMessageEvents[_0x9e34('0x5')](_0x23c368+':'+_0x384d85['id'],_0x384d85);OpenchannelMessageEvents[_0x9e34('0x5')](_0x23c368,_0x384d85);_0x379554(null);};}for(var e in events){if(events[_0x9e34('0x6')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index afb46d6..0ae3e60 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 _0x7588=['Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','omit','Contact','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','OpenchannelMessage,\x20%s,\x20%s','inspect','finally','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','get','toLowerCase','direction','out','secret','UserId','OpenchannelInteraction','findOne','OpenchannelInteractionId','then','update','catch','OpenchannelAccount','find','OpenchannelAccountId','CmContact','replyUri','afterCreate','format'];(function(_0x143565,_0x54d887){var _0x4dc1d9=function(_0x5e8838){while(--_0x5e8838){_0x143565['push'](_0x143565['shift']());}};_0x4dc1d9(++_0x54d887);}(_0x7588,0x142));var _0x8758=function(_0x55a8d4,_0x3fa263){_0x55a8d4=_0x55a8d4-0x0;var _0x34d8bd=_0x7588[_0x55a8d4];return _0x34d8bd;};'use strict';var _=require('lodash');var util=require(_0x8758('0x0'));var logger=require(_0x8758('0x1'))(_0x8758('0x2'));var moment=require(_0x8758('0x3'));var BPromise=require(_0x8758('0x4'));var rp=require(_0x8758('0x5'));var fs=require('fs');var path=require(_0x8758('0x6'));var rimraf=require(_0x8758('0x7'));var config=require(_0x8758('0x8'));var attributes=require(_0x8758('0x9'));module[_0x8758('0xa')]=function(_0x1b114b,_0x2d8a9b){return _0x1b114b['define'](_0x8758('0xb'),attributes,{'tableName':_0x8758('0xc'),'paranoid':![],'indexes':[{'name':_0x8758('0xd'),'fields':[_0x8758('0xe')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x37c6dc,_0x781e1c,_0xa5fe1d){var _0x3d22c5=_0x1b114b[_0x8758('0xf')];var _0x42fe23=_0x37c6dc[_0x8758('0x10')]({'plain':!![]});if(_0x42fe23['direction'][_0x8758('0x11')]()==='in'||_0x42fe23[_0x8758('0x12')][_0x8758('0x11')]()===_0x8758('0x13')&&!_0x42fe23[_0x8758('0x14')]&&!_['isNil'](_0x42fe23[_0x8758('0x15')])){_0x3d22c5[_0x8758('0x16')][_0x8758('0x17')]({'where':{'id':_0x42fe23[_0x8758('0x18')]}})[_0x8758('0x19')](function(_0x1f57f4){if(_0x1f57f4){_0x1f57f4[_0x8758('0x1a')]({'lastMsgAt':_0x42fe23['createdAt'],'lastMsgDirection':_0x42fe23[_0x8758('0x12')][_0x8758('0x11')]()});}})[_0x8758('0x1b')](function(_0x460ed9){console['error'](_0x460ed9);});}if(_0x42fe23['direction']===_0x8758('0x13')&&!_0x42fe23[_0x8758('0x14')]){var _0x3cc074;_0x3d22c5['CmContact']['describe']()['then'](function(_0x8d494a){return _0x3d22c5[_0x8758('0x1c')][_0x8758('0x1d')]({'where':{'id':_0x42fe23[_0x8758('0x1e')]},'include':[{'model':_0x3d22c5[_0x8758('0x16')],'as':'Interactions','where':{'id':_0x42fe23[_0x8758('0x18')]},'limit':0x1,'include':[{'model':_0x3d22c5[_0x8758('0x1f')],'as':'Contact','attributes':_['keys'](_0x8d494a)}]}]});})[_0x8758('0x19')](function(_0x1e8e32){_0x3cc074=_0x1e8e32['get']({'plain':!![]});if(_0x3cc074&&_0x3cc074[_0x8758('0x20')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8758('0x21'),util[_0x8758('0x22')](_0x8758('0x23'),_0x42fe23['id'],_0x3cc074[_0x8758('0x20')]));if(_0x3cc074['Interactions']&&_0x3cc074[_0x8758('0x24')][_0x8758('0x25')]){_0x42fe23[_0x8758('0x26')]=_[_0x8758('0x27')](_0x3cc074[_0x8758('0x24')][0x0],'Contact');_0x42fe23['Contact']=_0x3cc074['Interactions'][0x0][_0x8758('0x28')];}var _0x781e1c={'method':_0x8758('0x29'),'uri':encodeURI(_0x3cc074[_0x8758('0x20')]),'json':!![],'resolveWithFullResponse':!![]};switch(_0x781e1c[_0x8758('0x2a')]){case _0x8758('0x2b'):_0x781e1c['qs']=_0x42fe23;break;case _0x8758('0x29'):_0x781e1c['body']=_0x42fe23;break;}return rp(_0x781e1c)[_0x8758('0x19')](function(_0x2f0a27){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x8758('0x21'),util[_0x8758('0x22')](_0x8758('0x2c'),_0x42fe23['id'],_0x3cc074[_0x8758('0x20')]));if(_0x2f0a27[_0x8758('0xe')][_0x8758('0x2d')]&&_0x2f0a27[_0x8758('0xe')]['threadId']!=_0x42fe23[_0x8758('0x26')][_0x8758('0x2d')]){return _0x3d22c5[_0x8758('0x16')][_0x8758('0x1a')]({'threadId':_0x2f0a27[_0x8758('0xe')]['threadId']},{'logging':!![],'where':{'id':_0x42fe23[_0x8758('0x26')]['id']}});}else{return;}})[_0x8758('0x19')](function(){return _0x37c6dc[_0x8758('0x1a')]({'read':!![]});})['catch'](function(_0x4b9b14){logger[_0x8758('0x2e')](_0x8758('0x2f'),'afterCreate',util[_0x8758('0x30')](_0x4b9b14,{'showHidden':![],'depth':null}));_0xa5fe1d();});}else{_0xa5fe1d();}})[_0x8758('0x31')](function(){_0xa5fe1d();});}else{_0xa5fe1d();}}},'charset':'utf8mb4','collate':_0x8758('0x32')});}; \ No newline at end of file +var _0x4d18=['OpenchannelMessage,\x20%s,\x20%s','Message\x20%d\x20forwarded\x20to\x20%s','threadId','error','utf8mb4_unicode_ci','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','OpenchannelMessage','openchannel_messages','fti_openchannel_messages','body','models','direction','toLowerCase','out','secret','OpenchannelInteraction','OpenchannelInteractionId','then','update','catch','find','Interactions','CmContact','get','replyUri','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interaction','omit','Contact','POST','GET','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x4d18,0x188));var _0x84d1=function(_0x2324af,_0x246119){_0x2324af=_0x2324af-0x0;var _0xb6175a=_0x4d18[_0x2324af];return _0xb6175a;};'use strict';var _=require(_0x84d1('0x0'));var util=require(_0x84d1('0x1'));var logger=require(_0x84d1('0x2'))('api');var moment=require(_0x84d1('0x3'));var BPromise=require(_0x84d1('0x4'));var rp=require(_0x84d1('0x5'));var fs=require('fs');var path=require(_0x84d1('0x6'));var rimraf=require(_0x84d1('0x7'));var config=require(_0x84d1('0x8'));var attributes=require('./openchannelMessage.attributes');module[_0x84d1('0x9')]=function(_0x1f2e1b,_0x109ad6){return _0x1f2e1b['define'](_0x84d1('0xa'),attributes,{'tableName':_0x84d1('0xb'),'paranoid':![],'indexes':[{'name':_0x84d1('0xc'),'fields':[_0x84d1('0xd')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x215fd9,_0x34b8db,_0x4cf002){var _0x160594=_0x1f2e1b[_0x84d1('0xe')];var _0x2adf40=_0x215fd9['get']({'plain':!![]});if(_0x2adf40[_0x84d1('0xf')][_0x84d1('0x10')]()==='in'||_0x2adf40['direction'][_0x84d1('0x10')]()===_0x84d1('0x11')&&!_0x2adf40[_0x84d1('0x12')]&&!_['isNil'](_0x2adf40['UserId'])){_0x160594[_0x84d1('0x13')]['findOne']({'where':{'id':_0x2adf40[_0x84d1('0x14')]}})[_0x84d1('0x15')](function(_0x22a28a){if(_0x22a28a){_0x22a28a[_0x84d1('0x16')]({'lastMsgAt':_0x2adf40['createdAt'],'lastMsgDirection':_0x2adf40[_0x84d1('0xf')][_0x84d1('0x10')]()});}})[_0x84d1('0x17')](function(_0x48cdf8){console['error'](_0x48cdf8);});}if(_0x2adf40[_0x84d1('0xf')]===_0x84d1('0x11')&&!_0x2adf40[_0x84d1('0x12')]){var _0x20f314;_0x160594['CmContact']['describe']()[_0x84d1('0x15')](function(_0x4894f2){return _0x160594['OpenchannelAccount'][_0x84d1('0x18')]({'where':{'id':_0x2adf40['OpenchannelAccountId']},'include':[{'model':_0x160594['OpenchannelInteraction'],'as':_0x84d1('0x19'),'where':{'id':_0x2adf40[_0x84d1('0x14')]},'limit':0x1,'include':[{'model':_0x160594[_0x84d1('0x1a')],'as':'Contact','attributes':_['keys'](_0x4894f2)}]}]});})[_0x84d1('0x15')](function(_0x17c86a){_0x20f314=_0x17c86a[_0x84d1('0x1b')]({'plain':!![]});if(_0x20f314&&_0x20f314[_0x84d1('0x1c')]){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x84d1('0x1d'),util[_0x84d1('0x1e')](_0x84d1('0x1f'),_0x2adf40['id'],_0x20f314[_0x84d1('0x1c')]));if(_0x20f314[_0x84d1('0x19')]&&_0x20f314[_0x84d1('0x19')]['length']){_0x2adf40[_0x84d1('0x20')]=_[_0x84d1('0x21')](_0x20f314['Interactions'][0x0],_0x84d1('0x22'));_0x2adf40['Contact']=_0x20f314[_0x84d1('0x19')][0x0][_0x84d1('0x22')];}var _0x34b8db={'method':_0x84d1('0x23'),'uri':encodeURI(_0x20f314['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x34b8db['method']){case _0x84d1('0x24'):_0x34b8db['qs']=_0x2adf40;break;case _0x84d1('0x23'):_0x34b8db['body']=_0x2adf40;break;}return rp(_0x34b8db)[_0x84d1('0x15')](function(_0x15515c){logger[_0x84d1('0x25')](_0x84d1('0x26'),_0x84d1('0x1d'),util[_0x84d1('0x1e')](_0x84d1('0x27'),_0x2adf40['id'],_0x20f314[_0x84d1('0x1c')]));if(_0x15515c[_0x84d1('0xd')][_0x84d1('0x28')]&&_0x15515c[_0x84d1('0xd')]['threadId']!=_0x2adf40[_0x84d1('0x20')][_0x84d1('0x28')]){return _0x160594['OpenchannelInteraction'][_0x84d1('0x16')]({'threadId':_0x15515c[_0x84d1('0xd')][_0x84d1('0x28')]},{'logging':!![],'where':{'id':_0x2adf40[_0x84d1('0x20')]['id']}});}else{return;}})['then'](function(){return _0x215fd9[_0x84d1('0x16')]({'read':!![]});})[_0x84d1('0x17')](function(_0x27e1f2){logger[_0x84d1('0x29')](_0x84d1('0x26'),_0x84d1('0x1d'),util['inspect'](_0x27e1f2,{'showHidden':![],'depth':null}));_0x4cf002();});}else{_0x4cf002();}})['finally'](function(){_0x4cf002();});}else{_0x4cf002();}}},'charset':'utf8mb4','collate':_0x84d1('0x2a')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 110b620..a07a0da 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 _0x11f3=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','http','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','request','then','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','CreateOpenchannelMessage','create','options','raw','lodash'];(function(_0x16fc40,_0x47f83c){var _0x4fc75b=function(_0x448b36){while(--_0x448b36){_0x16fc40['push'](_0x16fc40['shift']());}};_0x4fc75b(++_0x47f83c);}(_0x11f3,0x149));var _0x311f=function(_0x4f5658,_0x53e66f){_0x4f5658=_0x4f5658-0x0;var _0x284a69=_0x11f3[_0x4f5658];return _0x284a69;};'use strict';var _=require(_0x311f('0x0'));var util=require(_0x311f('0x1'));var moment=require(_0x311f('0x2'));var BPromise=require('bluebird');var rs=require(_0x311f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x311f('0x4'))['db'];var utils=require(_0x311f('0x5'));var logger=require(_0x311f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x311f('0x7'));var client=jayson['client'][_0x311f('0x8')]({'port':0x232a});config[_0x311f('0x9')]=_[_0x311f('0xa')](config[_0x311f('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x311f('0xb'))(new Redis(config[_0x311f('0x9')]));require(_0x311f('0xc'))[_0x311f('0xd')](socket);function respondWithRpcPromise(_0x7cd779,_0x495f48,_0x20de65){return new BPromise(function(_0x292325,_0x2e45d1){return client[_0x311f('0xe')](_0x7cd779,_0x20de65)[_0x311f('0xf')](function(_0x1d70ea){logger[_0x311f('0x10')](_0x311f('0x11'),_0x495f48,_0x311f('0x12'));logger[_0x311f('0x13')](_0x311f('0x14'),_0x495f48,_0x311f('0x12'),JSON[_0x311f('0x15')](_0x1d70ea));if(_0x1d70ea[_0x311f('0x16')]){if(_0x1d70ea[_0x311f('0x16')][_0x311f('0x17')]===0x1f4){logger[_0x311f('0x16')](_0x311f('0x11'),_0x495f48,_0x1d70ea[_0x311f('0x16')]['message']);return _0x2e45d1(_0x1d70ea['error']['message']);}logger[_0x311f('0x16')](_0x311f('0x11'),_0x495f48,_0x1d70ea[_0x311f('0x16')][_0x311f('0x18')]);return _0x292325(_0x1d70ea[_0x311f('0x16')][_0x311f('0x18')]);}else{logger[_0x311f('0x10')](_0x311f('0x11'),_0x495f48,_0x311f('0x12'));_0x292325(_0x1d70ea['result'][_0x311f('0x18')]);}})[_0x311f('0x19')](function(_0x3b9ca8){logger[_0x311f('0x16')](_0x311f('0x11'),_0x495f48,_0x3b9ca8);_0x2e45d1(_0x3b9ca8);});});}exports[_0x311f('0x1a')]=function(_0x2e6974){var _0x22729c=this;return new Promise(function(_0x3fc713,_0x67ea17){return db['OpenchannelMessage'][_0x311f('0x1b')](_0x2e6974['body'],{'raw':_0x2e6974[_0x311f('0x1c')]?_0x2e6974['options'][_0x311f('0x1d')]===undefined?!![]:![]:!![]})[_0x311f('0xf')](function(_0x2ab71f){logger[_0x311f('0x10')](_0x311f('0x1a'),_0x2e6974);logger[_0x311f('0x13')]('CreateOpenchannelMessage',_0x2e6974,JSON['stringify'](_0x2ab71f));_0x3fc713(_0x2ab71f);})['catch'](function(_0x271f1a){logger[_0x311f('0x16')]('CreateOpenchannelMessage',_0x271f1a[_0x311f('0x18')],_0x2e6974);_0x67ea17(_0x22729c[_0x311f('0x16')](0x1f4,_0x271f1a[_0x311f('0x18')]));});});}; \ No newline at end of file +var _0xba34=['../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelMessage.socket','register','then','OpenchannelMessage,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','CreateOpenchannelMessage','create','body','options','raw','lodash','util','moment','bluebird','randomstring','../../config/logger','rpc'];(function(_0xe29cb5,_0x5ba4df){var _0xdfd69=function(_0xfecf06){while(--_0xfecf06){_0xe29cb5['push'](_0xe29cb5['shift']());}};_0xdfd69(++_0x5ba4df);}(_0xba34,0x119));var _0x4ba3=function(_0x1c3c44,_0x2843a7){_0x1c3c44=_0x1c3c44-0x0;var _0x4086da=_0xba34[_0x1c3c44];return _0x4086da;};'use strict';var _=require(_0x4ba3('0x0'));var util=require(_0x4ba3('0x1'));var moment=require(_0x4ba3('0x2'));var BPromise=require(_0x4ba3('0x3'));var rs=require(_0x4ba3('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x4ba3('0x5'))(_0x4ba3('0x6'));var config=require(_0x4ba3('0x7'));var jayson=require(_0x4ba3('0x8'));var client=jayson[_0x4ba3('0x9')][_0x4ba3('0xa')]({'port':0x232a});config[_0x4ba3('0xb')]=_['defaults'](config[_0x4ba3('0xb')],{'host':_0x4ba3('0xc'),'port':0x18eb});var socket=require(_0x4ba3('0xd'))(new Redis(config[_0x4ba3('0xb')]));require(_0x4ba3('0xe'))[_0x4ba3('0xf')](socket);function respondWithRpcPromise(_0x292f58,_0x3f653c,_0x2ed106){return new BPromise(function(_0x14ebf2,_0x2d215b){return client['request'](_0x292f58,_0x2ed106)[_0x4ba3('0x10')](function(_0x9071){logger['info'](_0x4ba3('0x11'),_0x3f653c,'request\x20sent');logger[_0x4ba3('0x12')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x3f653c,_0x4ba3('0x13'),JSON[_0x4ba3('0x14')](_0x9071));if(_0x9071[_0x4ba3('0x15')]){if(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x16')]===0x1f4){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x2d215b(_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);}logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0x9071[_0x4ba3('0x15')][_0x4ba3('0x17')]);return _0x14ebf2(_0x9071[_0x4ba3('0x15')]['message']);}else{logger[_0x4ba3('0x18')](_0x4ba3('0x11'),_0x3f653c,_0x4ba3('0x13'));_0x14ebf2(_0x9071[_0x4ba3('0x19')]['message']);}})[_0x4ba3('0x1a')](function(_0xe4eff9){logger[_0x4ba3('0x15')](_0x4ba3('0x11'),_0x3f653c,_0xe4eff9);_0x2d215b(_0xe4eff9);});});}exports[_0x4ba3('0x1b')]=function(_0x125944){var _0x4b2791=this;return new Promise(function(_0x57de6a,_0x2278b0){return db['OpenchannelMessage'][_0x4ba3('0x1c')](_0x125944[_0x4ba3('0x1d')],{'raw':_0x125944[_0x4ba3('0x1e')]?_0x125944[_0x4ba3('0x1e')][_0x4ba3('0x1f')]===undefined?!![]:![]:!![]})[_0x4ba3('0x10')](function(_0x4a0823){logger[_0x4ba3('0x18')](_0x4ba3('0x1b'),_0x125944);logger['debug'](_0x4ba3('0x1b'),_0x125944,JSON['stringify'](_0x4a0823));_0x57de6a(_0x4a0823);})[_0x4ba3('0x1a')](function(_0x18abb3){logger[_0x4ba3('0x15')](_0x4ba3('0x1b'),_0x18abb3[_0x4ba3('0x17')],_0x125944);_0x2278b0(_0x4b2791[_0x4ba3('0x15')](0x1f4,_0x18abb3[_0x4ba3('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index f140be9..48bdbb0 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 _0xcb91=['remove','update','emit','removeListener','register'];(function(_0xa4d883,_0x241cbc){var _0x4fbb2e=function(_0x4ae671){while(--_0x4ae671){_0xa4d883['push'](_0xa4d883['shift']());}};_0x4fbb2e(++_0x241cbc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x476c7,_0x298ee0){_0x476c7=_0x476c7-0x0;var _0x47ae56=_0xcb91[_0x476c7];return _0x47ae56;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=['save',_0x1cb9('0x0'),_0x1cb9('0x1')];function createListener(_0x17d4ec,_0x22c4b8){return function(_0x4c37e8){_0x22c4b8[_0x1cb9('0x2')](_0x17d4ec,_0x4c37e8);};}function removeListener(_0x2c17b8,_0x545a34){return function(){OpenchannelMessageEvents[_0x1cb9('0x3')](_0x2c17b8,_0x545a34);};}exports[_0x1cb9('0x4')]=function(_0x53ffbd){for(var _0x226b69=0x0,_0x3f7deb=events['length'];_0x226b69<_0x3f7deb;_0x226b69++){var _0x38737d=events[_0x226b69];var _0x12567c=createListener('openchannelMessage:'+_0x38737d,_0x53ffbd);OpenchannelMessageEvents['on'](_0x38737d,_0x12567c);}}; \ No newline at end of file +var _0x9bde=['openchannelMessage:','save','update','emit','removeListener','register','length'];(function(_0x1e3671,_0x9ae4fc){var _0x48d5f5=function(_0xfab713){while(--_0xfab713){_0x1e3671['push'](_0x1e3671['shift']());}};_0x48d5f5(++_0x9ae4fc);}(_0x9bde,0xe1));var _0xe9bd=function(_0x218847,_0x1f7454){_0x218847=_0x218847-0x0;var _0x8c76e6=_0x9bde[_0x218847];return _0x8c76e6;};'use strict';var OpenchannelMessageEvents=require('./openchannelMessage.events');var events=[_0xe9bd('0x0'),'remove',_0xe9bd('0x1')];function createListener(_0x4c63ca,_0x51786f){return function(_0x3005aa){_0x51786f[_0xe9bd('0x2')](_0x4c63ca,_0x3005aa);};}function removeListener(_0x1c1b34,_0x10822d){return function(){OpenchannelMessageEvents[_0xe9bd('0x3')](_0x1c1b34,_0x10822d);};}exports[_0xe9bd('0x4')]=function(_0x4fd7b8){for(var _0x4763e9=0x0,_0x5f18fe=events[_0xe9bd('0x5')];_0x4763e9<_0x5f18fe;_0x4763e9++){var _0xa66ae2=events[_0x4763e9];var _0x2d5c75=createListener(_0xe9bd('0x6')+_0xa66ae2,_0x4fd7b8);OpenchannelMessageEvents['on'](_0xa66ae2,_0x2d5c75);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index e98fc37..70ef1fb 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 _0x744c=['/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','put','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','/:id','show'];(function(_0x35d8af,_0x14fd75){var _0x1d08b0=function(_0x36b437){while(--_0x36b437){_0x35d8af['push'](_0x35d8af['shift']());}};_0x1d08b0(++_0x14fd75);}(_0x744c,0xa0));var _0xc744=function(_0x3efd98,_0x5a231a){_0x3efd98=_0x3efd98-0x0;var _0x3d99b7=_0x744c[_0x3efd98];return _0x3d99b7;};'use strict';var multer=require(_0xc744('0x0'));var util=require(_0xc744('0x1'));var path=require(_0xc744('0x2'));var timeout=require(_0xc744('0x3'));var express=require('express');var router=express[_0xc744('0x4')]();var auth=require(_0xc744('0x5'));var interaction=require(_0xc744('0x6'));var config=require(_0xc744('0x7'));var controller=require('./openchannelQueue.controller');router['get']('/',auth[_0xc744('0x8')](),controller[_0xc744('0x9')]);router[_0xc744('0xa')](_0xc744('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xc744('0xa')](_0xc744('0xc'),auth['isAuthenticated'](),controller[_0xc744('0xd')]);router[_0xc744('0xa')](_0xc744('0xe'),auth[_0xc744('0x8')](),controller[_0xc744('0xf')]);router[_0xc744('0xa')](_0xc744('0x10'),auth['isAuthenticated'](),controller[_0xc744('0x11')]);router[_0xc744('0xa')](_0xc744('0x12'),auth[_0xc744('0x8')](),controller[_0xc744('0x13')]);router[_0xc744('0x14')]('/',auth['isAuthenticated'](),controller[_0xc744('0x15')]);router['post'](_0xc744('0x10'),auth[_0xc744('0x8')](),controller[_0xc744('0x16')]);router['post']('/:id/users',auth['isAuthenticated'](),controller['addAgents']);router[_0xc744('0x17')](_0xc744('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xc744('0x18')](_0xc744('0xc'),auth[_0xc744('0x8')](),controller[_0xc744('0x19')]);router['delete'](_0xc744('0x10'),auth[_0xc744('0x8')](),controller[_0xc744('0x1a')]);router[_0xc744('0x18')]('/:id/users',auth[_0xc744('0x8')](),controller[_0xc744('0x1b')]);module[_0xc744('0x1c')]=router; \ No newline at end of file +var _0x05bc=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./openchannelQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams','exports'];(function(_0x22f8ab,_0x15d8ff){var _0x2a70e5=function(_0x5e6895){while(--_0x5e6895){_0x22f8ab['push'](_0x22f8ab['shift']());}};_0x2a70e5(++_0x15d8ff);}(_0x05bc,0xae));var _0xc05b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x05bc[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0xc05b('0x0'));var path=require('path');var timeout=require(_0xc05b('0x1'));var express=require(_0xc05b('0x2'));var router=express['Router']();var auth=require(_0xc05b('0x3'));var interaction=require(_0xc05b('0x4'));var config=require(_0xc05b('0x5'));var controller=require(_0xc05b('0x6'));router[_0xc05b('0x7')]('/',auth[_0xc05b('0x8')](),controller[_0xc05b('0x9')]);router[_0xc05b('0x7')](_0xc05b('0xa'),auth[_0xc05b('0x8')](),controller[_0xc05b('0xb')]);router[_0xc05b('0x7')](_0xc05b('0xc'),auth[_0xc05b('0x8')](),controller['show']);router['get'](_0xc05b('0xd'),auth[_0xc05b('0x8')](),controller[_0xc05b('0xe')]);router[_0xc05b('0x7')](_0xc05b('0xf'),auth[_0xc05b('0x8')](),controller[_0xc05b('0x10')]);router[_0xc05b('0x7')](_0xc05b('0x11'),auth['isAuthenticated'](),controller[_0xc05b('0x12')]);router[_0xc05b('0x13')]('/',auth[_0xc05b('0x8')](),controller[_0xc05b('0x14')]);router[_0xc05b('0x13')](_0xc05b('0xf'),auth['isAuthenticated'](),controller[_0xc05b('0x15')]);router[_0xc05b('0x13')]('/:id/users',auth['isAuthenticated'](),controller[_0xc05b('0x16')]);router[_0xc05b('0x17')](_0xc05b('0xc'),auth[_0xc05b('0x8')](),controller[_0xc05b('0x18')]);router[_0xc05b('0x19')](_0xc05b('0xc'),auth['isAuthenticated'](),controller[_0xc05b('0x1a')]);router[_0xc05b('0x19')](_0xc05b('0xf'),auth[_0xc05b('0x8')](),controller[_0xc05b('0x1b')]);router[_0xc05b('0x19')]('/:id/users',auth[_0xc05b('0x8')](),controller['removeAgents']);module[_0xc05b('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 3f0fafc..e2a50d2 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 _0x626d=['STRING','name','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x306911,_0xc7b614){var _0x31b065=function(_0x3047b1){while(--_0x3047b1){_0x306911['push'](_0x306911['shift']());}};_0x31b065(++_0xc7b614);}(_0x626d,0xa0));var _0xd626=function(_0x4fbc7f,_0x14a391){_0x4fbc7f=_0x4fbc7f-0x0;var _0x432483=_0x626d[_0x4fbc7f];return _0x432483;};'use strict';var Sequelize=require(_0xd626('0x0'));module['exports']={'name':{'type':Sequelize[_0xd626('0x1')],'unique':_0xd626('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xd626('0x1')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xd626('0x3')](_0xd626('0x4'),_0xd626('0x5'),_0xd626('0x6'))}}; \ No newline at end of file +var _0x55f9=['exports','STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','sequelize'];(function(_0x390e23,_0x59057e){var _0x287d68=function(_0x57b6da){while(--_0x57b6da){_0x390e23['push'](_0x390e23['shift']());}};_0x287d68(++_0x59057e);}(_0x55f9,0x1b8));var _0x955f=function(_0x3b6753,_0x5c5d77){_0x3b6753=_0x3b6753-0x0;var _0x5c18e0=_0x55f9[_0x3b6753];return _0x5c18e0;};'use strict';var Sequelize=require(_0x955f('0x0'));module[_0x955f('0x1')]={'name':{'type':Sequelize[_0x955f('0x2')],'unique':_0x955f('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x955f('0x2')]},'timeout':{'type':Sequelize[_0x955f('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x955f('0x5')](_0x955f('0x6'),_0x955f('0x7'),_0x955f('0x8'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index f9be589..c72aab4 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 _0xe674=['rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','count','offset','limit','set','Content-Range','json','save','then','destroy','get','OpenchannelQueues','error','name','send','rawAttributes','fieldName','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','filter','where','map','type','merge','options','OpenchannelQueue','includeAll','include','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','findOne','length','sort','pick','OpenchannelQueueId','UserOpenchannelQueue','findAndCountAll','UserId','agent','openchannelPause','updatedAt','format','%s/%s','SIP','createdAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','forEach','emit','userOpenchannelQueue:save','removeTeams','select','tq.TeamId','from','team_has_openchannel_queues','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','SELECT','every','TeamId','includes','all','compact','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','getAgents','eml-format'];(function(_0x10265e,_0xf3d38c){var _0x491c0e=function(_0x35b007){while(--_0x35b007){_0x10265e['push'](_0x10265e['shift']());}};_0x491c0e(++_0xf3d38c);}(_0xe674,0x84));var _0x4e67=function(_0x1e0631,_0x460c01){_0x1e0631=_0x1e0631-0x0;var _0x3178ef=_0xe674[_0x1e0631];return _0x3178ef;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4e67('0x0'));var rimraf=require(_0x4e67('0x1'));var zipdir=require(_0x4e67('0x2'));var jsonpatch=require(_0x4e67('0x3'));var rp=require(_0x4e67('0x4'));var moment=require(_0x4e67('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x4e67('0x6'));var util=require('util');var path=require(_0x4e67('0x7'));var sox=require(_0x4e67('0x8'));var csv=require(_0x4e67('0x9'));var ejs=require(_0x4e67('0xa'));var fs=require('fs');var _=require(_0x4e67('0xb'));var squel=require(_0x4e67('0xc'));var crypto=require(_0x4e67('0xd'));var jsforce=require(_0x4e67('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4e67('0x9'));var querystring=require(_0x4e67('0xf'));var Papa=require(_0x4e67('0x10'));var Redis=require(_0x4e67('0x11'));var authService=require(_0x4e67('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x4e67('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4e67('0x14'))(_0x4e67('0x15'));var utils=require(_0x4e67('0x16'));var config=require(_0x4e67('0x17'));var db=require(_0x4e67('0x18'))['db'];config[_0x4e67('0x19')]=_[_0x4e67('0x1a')](config[_0x4e67('0x19')],{'host':_0x4e67('0x1b'),'port':0x18eb});var socket=require(_0x4e67('0x1c'))(new Redis(config[_0x4e67('0x19')]));require('./openchannelQueue.socket')[_0x4e67('0x1d')](socket);function respondWithStatusCode(_0x315300,_0x9eb2af){_0x9eb2af=_0x9eb2af||0xcc;return function(_0x57c7ac){if(_0x57c7ac){return _0x315300[_0x4e67('0x1e')](_0x9eb2af);}return _0x315300[_0x4e67('0x1f')](_0x9eb2af)['end']();};}function respondWithResult(_0x28e7de,_0x52c78a){_0x52c78a=_0x52c78a||0xc8;return function(_0x445e0f){if(_0x445e0f){return _0x28e7de[_0x4e67('0x1f')](_0x52c78a)['json'](_0x445e0f);}};}function respondWithFilteredResult(_0x8763d8,_0x537912){return function(_0x48ca76){if(_0x48ca76){var _0x126be6=_0x48ca76[_0x4e67('0x20')],_0x1f1654=_0x537912[_0x4e67('0x21')],_0x16d92f=_0x537912[_0x4e67('0x21')]+_0x537912[_0x4e67('0x22')],_0x361da8;if(_0x16d92f>=_0x126be6){_0x16d92f=_0x126be6;_0x361da8=0xc8;}else{_0x361da8=0xce;}_0x8763d8[_0x4e67('0x1f')](_0x361da8);return _0x8763d8[_0x4e67('0x23')](_0x4e67('0x24'),_0x1f1654+'-'+_0x16d92f+'/'+_0x126be6)[_0x4e67('0x25')](_0x48ca76);}return null;};}function patchUpdates(_0x2a89d4){return function(_0x3cd9e8){try{jsonpatch['apply'](_0x3cd9e8,_0x2a89d4,!![]);}catch(_0x4af6fa){return BPromise['reject'](_0x4af6fa);}return _0x3cd9e8[_0x4e67('0x26')]();};}function saveUpdates(_0x591f24,_0x5923b3){return function(_0x4d2594){if(_0x4d2594){return _0x4d2594['update'](_0x591f24)[_0x4e67('0x27')](function(_0x320f30){return _0x320f30;});}return null;};}function removeEntity(_0x33e125,_0x5d3a20){return function(_0x1fca9e){if(_0x1fca9e){return _0x1fca9e[_0x4e67('0x28')]()[_0x4e67('0x27')](function(){var _0x37eef7=_0x1fca9e[_0x4e67('0x29')]({'plain':!![]});var _0x8b6c2c=_0x4e67('0x2a');return db['UserProfileResource'][_0x4e67('0x28')]({'where':{'type':_0x8b6c2c,'resourceId':_0x37eef7['id']}})[_0x4e67('0x27')](function(){return _0x1fca9e;});})['then'](function(){_0x33e125['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dd545,_0x3de258){return function(_0x52595d){if(!_0x52595d){_0x1dd545[_0x4e67('0x1e')](0x194);}return _0x52595d;};}function handleError(_0x2de9b2,_0x211bc3){_0x211bc3=_0x211bc3||0x1f4;return function(_0x461b88){logger[_0x4e67('0x2b')](_0x461b88['stack']);if(_0x461b88[_0x4e67('0x2c')]){delete _0x461b88[_0x4e67('0x2c')];}_0x2de9b2[_0x4e67('0x1f')](_0x211bc3)[_0x4e67('0x2d')](_0x461b88);};}exports['index']=function(_0x95214b,_0x7ab22d){var _0x197684={},_0x3de6bf={},_0x2e09e5={'count':0x0,'rows':[]};var _0x204df3=_['map'](db['OpenchannelQueue'][_0x4e67('0x2e')],function(_0x26ca61){return{'name':_0x26ca61[_0x4e67('0x2f')],'type':_0x26ca61['type']['key']};});_0x3de6bf[_0x4e67('0x30')]=_['map'](_0x204df3,_0x4e67('0x2c'));_0x3de6bf[_0x4e67('0x31')]=_[_0x4e67('0x32')](_0x95214b['query']);_0x3de6bf[_0x4e67('0x33')]=_['intersection'](_0x3de6bf[_0x4e67('0x30')],_0x3de6bf[_0x4e67('0x31')]);_0x197684[_0x4e67('0x34')]=_[_0x4e67('0x35')](_0x3de6bf[_0x4e67('0x30')],qs['fields'](_0x95214b[_0x4e67('0x31')][_0x4e67('0x36')]));_0x197684[_0x4e67('0x34')]=_0x197684['attributes']['length']?_0x197684[_0x4e67('0x34')]:_0x3de6bf[_0x4e67('0x30')];if(!_0x95214b[_0x4e67('0x31')][_0x4e67('0x37')](_0x4e67('0x38'))){_0x197684['limit']=qs[_0x4e67('0x22')](_0x95214b[_0x4e67('0x31')]['limit']);_0x197684[_0x4e67('0x21')]=qs['offset'](_0x95214b[_0x4e67('0x31')][_0x4e67('0x21')]);}_0x197684[_0x4e67('0x39')]=qs['sort'](_0x95214b['query']['sort']);_0x197684['where']=qs[_0x4e67('0x33')](_['pick'](_0x95214b['query'],_0x3de6bf['filters']));if(_0x95214b[_0x4e67('0x31')][_0x4e67('0x3a')]){_0x197684[_0x4e67('0x3b')]=_['merge'](_0x197684['where'],{'$or':_[_0x4e67('0x3c')](_0x204df3,function(_0x610286){if(_0x610286[_0x4e67('0x3d')]!=='VIRTUAL'){var _0x109598={};_0x109598[_0x610286[_0x4e67('0x2c')]]={'$like':'%'+_0x95214b[_0x4e67('0x31')][_0x4e67('0x3a')]+'%'};return _0x109598;}})});}_0x197684=_[_0x4e67('0x3e')]({},_0x197684,_0x95214b[_0x4e67('0x3f')]);var _0x1bcdb4={'where':_0x197684[_0x4e67('0x3b')]};return db[_0x4e67('0x40')]['count'](_0x1bcdb4)[_0x4e67('0x27')](function(_0xb8bca4){_0x2e09e5['count']=_0xb8bca4;if(_0x95214b[_0x4e67('0x31')][_0x4e67('0x41')]){_0x197684[_0x4e67('0x42')]=[{'all':!![]}];}return db['OpenchannelQueue'][_0x4e67('0x43')](_0x197684);})[_0x4e67('0x27')](function(_0x11c68a){_0x2e09e5[_0x4e67('0x44')]=_0x11c68a;return _0x2e09e5;})[_0x4e67('0x27')](respondWithFilteredResult(_0x7ab22d,_0x197684))[_0x4e67('0x45')](handleError(_0x7ab22d,null));};exports[_0x4e67('0x46')]=function(_0x2d7a0a,_0x29a5d5){var _0x615472={'raw':!![],'where':{'id':_0x2d7a0a[_0x4e67('0x47')]['id']}},_0x16f12b={};_0x16f12b[_0x4e67('0x30')]=_[_0x4e67('0x32')](db['OpenchannelQueue'][_0x4e67('0x2e')]);_0x16f12b[_0x4e67('0x31')]=_[_0x4e67('0x32')](_0x2d7a0a[_0x4e67('0x31')]);_0x16f12b['filters']=_[_0x4e67('0x35')](_0x16f12b['model'],_0x16f12b['query']);_0x615472[_0x4e67('0x34')]=_[_0x4e67('0x35')](_0x16f12b[_0x4e67('0x30')],qs[_0x4e67('0x36')](_0x2d7a0a['query']['fields']));_0x615472['attributes']=_0x615472['attributes']['length']?_0x615472[_0x4e67('0x34')]:_0x16f12b[_0x4e67('0x30')];if(_0x2d7a0a[_0x4e67('0x31')][_0x4e67('0x41')]){_0x615472['include']=[{'all':!![]}];}_0x615472=_[_0x4e67('0x3e')]({},_0x615472,_0x2d7a0a[_0x4e67('0x3f')]);return db[_0x4e67('0x40')][_0x4e67('0x48')](_0x615472)[_0x4e67('0x27')](handleEntityNotFound(_0x29a5d5,null))[_0x4e67('0x27')](respondWithResult(_0x29a5d5,null))[_0x4e67('0x45')](handleError(_0x29a5d5,null));};exports[_0x4e67('0x49')]=function(_0x45092a,_0x38e946){return db['OpenchannelQueue'][_0x4e67('0x49')](_0x45092a[_0x4e67('0x4a')],{})[_0x4e67('0x27')](function(_0x51da37){var _0x5ec19c=_0x45092a['user'][_0x4e67('0x29')]({'plain':!![]});if(!_0x5ec19c)throw new Error(_0x4e67('0x4b'));if(_0x5ec19c[_0x4e67('0x4c')]==='user'){var _0x235dd7=_0x51da37[_0x4e67('0x29')]({'plain':!![]});var _0x35ed37=_0x4e67('0x2a');return db[_0x4e67('0x4d')][_0x4e67('0x48')]({'where':{'name':_0x35ed37,'userProfileId':_0x5ec19c['userProfileId']},'raw':!![]})[_0x4e67('0x27')](function(_0x3a2b16){if(_0x3a2b16&&_0x3a2b16['autoAssociation']===0x0){return db[_0x4e67('0x4e')]['create']({'name':_0x235dd7[_0x4e67('0x2c')],'resourceId':_0x235dd7['id'],'type':_0x3a2b16[_0x4e67('0x2c')],'sectionId':_0x3a2b16['id']},{})['then'](function(){return _0x51da37;});}else{return _0x51da37;}})[_0x4e67('0x45')](function(_0xed6d2){logger[_0x4e67('0x2b')](_0x4e67('0x4f'),_0xed6d2);throw _0xed6d2;});}return _0x51da37;})['then'](respondWithResult(_0x38e946,0xc9))[_0x4e67('0x45')](handleError(_0x38e946,null));};exports['update']=function(_0x1c6112,_0x1478a5){if(_0x1c6112['body']['id']){delete _0x1c6112[_0x4e67('0x4a')]['id'];}return db[_0x4e67('0x40')][_0x4e67('0x48')]({'where':{'id':_0x1c6112[_0x4e67('0x47')]['id']}})['then'](handleEntityNotFound(_0x1478a5,null))[_0x4e67('0x27')](saveUpdates(_0x1c6112[_0x4e67('0x4a')],null))['then'](respondWithResult(_0x1478a5,null))['catch'](handleError(_0x1478a5,null));};exports[_0x4e67('0x28')]=function(_0xb916d5,_0xf86fb4){return db[_0x4e67('0x40')][_0x4e67('0x48')]({'where':{'id':_0xb916d5[_0x4e67('0x47')]['id']}})['then'](handleEntityNotFound(_0xf86fb4,null))['then'](removeEntity(_0xf86fb4,null))[_0x4e67('0x45')](handleError(_0xf86fb4,null));};exports['describe']=function(_0x12ffed,_0x47edac){return db[_0x4e67('0x40')]['describe']()[_0x4e67('0x27')](respondWithResult(_0x47edac,null))[_0x4e67('0x45')](handleError(_0x47edac,null));};exports['getMembers']=function(_0x1c314e,_0x1c3cc5,_0x1cee63){var _0x54ceb1={'raw':!![],'where':{}},_0x53d36d={},_0x4012d6;return db['OpenchannelQueue'][_0x4e67('0x50')]({'where':{'id':_0x1c314e[_0x4e67('0x47')]['id']}})[_0x4e67('0x27')](handleEntityNotFound(_0x1c3cc5,null))[_0x4e67('0x27')](function(_0x4c4ae6){if(_0x4c4ae6){_0x4012d6=_0x4c4ae6[_0x4e67('0x29')]({'plain':!![]});_0x53d36d[_0x4e67('0x30')]=_[_0x4e67('0x32')](db['UserOpenchannelQueue'][_0x4e67('0x2e')]);_0x53d36d[_0x4e67('0x31')]=_[_0x4e67('0x32')](_0x1c314e[_0x4e67('0x31')]);_0x53d36d[_0x4e67('0x33')]=_[_0x4e67('0x35')](_0x53d36d[_0x4e67('0x30')],_0x53d36d['query']);_0x54ceb1[_0x4e67('0x34')]=_['intersection'](_0x53d36d['model'],qs['fields'](_0x1c314e['query'][_0x4e67('0x36')]));_0x54ceb1[_0x4e67('0x34')]=_0x54ceb1['attributes'][_0x4e67('0x51')]?_0x54ceb1[_0x4e67('0x34')]:_0x53d36d['model'];if(!_0x1c314e[_0x4e67('0x31')]['hasOwnProperty'](_0x4e67('0x38'))){_0x54ceb1['limit']=qs[_0x4e67('0x22')](_0x1c314e[_0x4e67('0x31')][_0x4e67('0x22')]);_0x54ceb1['offset']=qs[_0x4e67('0x21')](_0x1c314e[_0x4e67('0x31')][_0x4e67('0x21')]);}_0x54ceb1[_0x4e67('0x39')]=qs[_0x4e67('0x52')](_0x1c314e[_0x4e67('0x31')]['sort']);_0x54ceb1['where']=qs[_0x4e67('0x33')](_[_0x4e67('0x53')](_0x1c314e['query'],_0x53d36d['filters']));_0x54ceb1[_0x4e67('0x3b')][_0x4e67('0x54')]=_0x4c4ae6['id'];if(_0x1c314e['query'][_0x4e67('0x3a')]){_0x54ceb1['where']=_[_0x4e67('0x3e')](_0x54ceb1[_0x4e67('0x3b')],{'$or':_[_0x4e67('0x3c')](_0x54ceb1['attributes'],function(_0x43b25b){var _0x180120={};_0x180120[_0x43b25b]={'$like':'%'+_0x1c314e[_0x4e67('0x31')][_0x4e67('0x3a')]+'%'};return _0x180120;})});}_0x54ceb1=_[_0x4e67('0x3e')]({},_0x54ceb1,_0x1c314e['options']);return db[_0x4e67('0x55')][_0x4e67('0x43')](_0x54ceb1);}})['then'](function(_0x2a32b8){if(_0x2a32b8){return db['User'][_0x4e67('0x56')]({'where':{'id':_['map'](_0x2a32b8,_0x4e67('0x57')),'role':_0x4e67('0x58')},'attributes':['id',_0x4e67('0x2c'),_0x4e67('0x59'),_0x4e67('0x5a'),'createdAt']});}})[_0x4e67('0x27')](function(_0x444f4c){if(_0x444f4c){return{'count':_0x444f4c[_0x4e67('0x20')],'rows':_[_0x4e67('0x3c')](_0x444f4c[_0x4e67('0x44')],function(_0x3f67b9){return{'membername':_0x3f67b9[_0x4e67('0x2c')],'UserId':_0x3f67b9['id'],'queue_name':_0x4012d6[_0x4e67('0x2c')],'OpenchannelQueueId':_0x4012d6['id'],'interface':util[_0x4e67('0x5b')](_0x4e67('0x5c'),_0x4e67('0x5d'),_0x3f67b9[_0x4e67('0x2c')]),'penalty':0x0,'paused':_0x3f67b9[_0x4e67('0x59')],'createdAt':_0x3f67b9[_0x4e67('0x5e')],'updatedAt':_0x3f67b9[_0x4e67('0x5a')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x4e67('0x27')](respondWithFilteredResult(_0x1c3cc5,_0x54ceb1))[_0x4e67('0x45')](handleError(_0x1c3cc5,null));};exports['getTeams']=function(_0x263fa2,_0xe9d9ea,_0x206832){var _0x3fd43e={};var _0xd50858={};var _0x5a4689;var _0x35907d;return db[_0x4e67('0x40')][_0x4e67('0x50')]({'where':{'id':_0x263fa2['params']['id']}})[_0x4e67('0x27')](handleEntityNotFound(_0xe9d9ea,null))[_0x4e67('0x27')](function(_0x1e7e1e){if(_0x1e7e1e){_0x5a4689=_0x1e7e1e;_0xd50858[_0x4e67('0x30')]=_[_0x4e67('0x32')](db[_0x4e67('0x5f')][_0x4e67('0x2e')]);_0xd50858['query']=_['keys'](_0x263fa2['query']);_0xd50858[_0x4e67('0x33')]=_[_0x4e67('0x35')](_0xd50858['model'],_0xd50858[_0x4e67('0x31')]);_0x3fd43e['attributes']=_['intersection'](_0xd50858[_0x4e67('0x30')],qs[_0x4e67('0x36')](_0x263fa2[_0x4e67('0x31')][_0x4e67('0x36')]));_0x3fd43e['attributes']=_0x3fd43e[_0x4e67('0x34')][_0x4e67('0x51')]?_0x3fd43e['attributes']:_0xd50858[_0x4e67('0x30')];_0x3fd43e[_0x4e67('0x39')]=qs[_0x4e67('0x52')](_0x263fa2[_0x4e67('0x31')][_0x4e67('0x52')]);_0x3fd43e['where']=qs['filters'](_[_0x4e67('0x53')](_0x263fa2['query'],_0xd50858['filters']));if(_0x263fa2[_0x4e67('0x31')][_0x4e67('0x3a')]){_0x3fd43e[_0x4e67('0x3b')]=_[_0x4e67('0x3e')](_0x3fd43e[_0x4e67('0x3b')],{'$or':_[_0x4e67('0x3c')](_0x3fd43e[_0x4e67('0x34')],function(_0x1078e9){var _0x1602ab={};_0x1602ab[_0x1078e9]={'$like':'%'+_0x263fa2[_0x4e67('0x31')][_0x4e67('0x3a')]+'%'};return _0x1602ab;})});}_0x3fd43e=_[_0x4e67('0x3e')]({},_0x3fd43e,_0x263fa2[_0x4e67('0x3f')]);return _0x5a4689['getTeams'](_0x3fd43e);}})['then'](function(_0x306ee2){if(_0x306ee2){_0x35907d=_0x306ee2[_0x4e67('0x51')];if(!_0x263fa2['query']['hasOwnProperty'](_0x4e67('0x38'))){_0x3fd43e['limit']=qs[_0x4e67('0x22')](_0x263fa2[_0x4e67('0x31')][_0x4e67('0x22')]);_0x3fd43e['offset']=qs[_0x4e67('0x21')](_0x263fa2[_0x4e67('0x31')][_0x4e67('0x21')]);}return _0x5a4689[_0x4e67('0x60')](_0x3fd43e);}})[_0x4e67('0x27')](function(_0x47a907){if(_0x47a907){return _0x47a907?{'count':_0x35907d,'rows':_0x47a907}:null;}})[_0x4e67('0x27')](respondWithResult(_0xe9d9ea,null))[_0x4e67('0x45')](handleError(_0xe9d9ea,null));};exports[_0x4e67('0x61')]=function(_0x281d72,_0x1fee51,_0x4aa11b){var _0x15c3d8=_0x281d72[_0x4e67('0x4a')][_0x4e67('0x62')];return db[_0x4e67('0x5f')][_0x4e67('0x43')]({'where':{'id':_0x15c3d8},'attributes':['id'],'include':[{'model':db[_0x4e67('0x63')],'as':_0x4e67('0x64'),'attributes':['id',_0x4e67('0x2c'),_0x4e67('0x65'),_0x4e67('0x66'),_0x4e67('0x67')],'raw':!![]}]})[_0x4e67('0x27')](function(_0x2cf288){if(_0x2cf288){var _0x36e15e=_[_0x4e67('0x68')](_0x2cf288,function(_0x624129){var _0x5a9d17=_0x624129[_0x4e67('0x29')]({'plain':!![]});return _0x5a9d17[_0x4e67('0x64')];});return db[_0x4e67('0x40')][_0x4e67('0x48')]({'where':{'id':_0x281d72['params']['id']}})[_0x4e67('0x27')](function(_0x3f7f81){return db[_0x4e67('0x69')][_0x4e67('0x6a')](function(_0x270b07){return _0x3f7f81[_0x4e67('0x61')](_0x15c3d8,{'transaction':_0x270b07})[_0x4e67('0x27')](function(){return BPromise[_0x4e67('0x6b')](_0x36e15e,function(_0x2bd071){return db['UserOpenchannelQueue']['findOrCreate']({'where':{'UserId':_0x2bd071['id'],'OpenchannelQueueId':_0x281d72['params']['id']},'transaction':_0x270b07});});})[_0x4e67('0x27')](function(){_0x36e15e[_0x4e67('0x6c')](function(_0x2f5562){socket[_0x4e67('0x6d')](_0x4e67('0x6e'),{'UserId':_0x2f5562['id'],'OpenchannelQueueId':_0x3f7f81['id']});});});});});}})[_0x4e67('0x27')](respondWithStatusCode(_0x1fee51,null))[_0x4e67('0x45')](handleError(_0x1fee51,null));};exports[_0x4e67('0x6f')]=function(_0x277ee3,_0x56a8a4,_0xb42ccd){return db['Team']['findAll']({'where':{'id':_0x277ee3['query'][_0x4e67('0x62')]},'attributes':['id'],'include':[{'model':db[_0x4e67('0x63')],'as':_0x4e67('0x64'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x56a8a4,null))[_0x4e67('0x27')](function(_0xceaf8b){var _0x5adb22=_[_0x4e67('0x3c')](_0xceaf8b,'id');var _0x7498f2=[];var _0x155d3d=[];var _0x133766=squel[_0x4e67('0x70')]();_0x133766['field'](_0x4e67('0x71'))[_0x4e67('0x72')](_0x4e67('0x73'),'tq')['join'](_0x4e67('0x74'),'ut',_0x4e67('0x75'))[_0x4e67('0x3b')](_0x4e67('0x76'),_0x277ee3[_0x4e67('0x47')]['id']);for(var _0x2fe651=0x0;_0x2fe651<_0xceaf8b['length'];_0x2fe651+=0x1){let _0xb06524=_0xceaf8b[_0x2fe651];for(var _0x34df8a=0x0;_0x34df8a<_0xb06524[_0x4e67('0x64')][_0x4e67('0x51')];_0x34df8a+=0x1){let _0x3502f5=_0xb06524[_0x4e67('0x64')][_0x34df8a];var _0x196d3e=_0x133766[_0x4e67('0x77')]();_0x196d3e['where']('ut.UserId\x20=\x20?',_0x3502f5['id']);_0x155d3d[_0x4e67('0x78')](db[_0x4e67('0x69')][_0x4e67('0x31')](_0x196d3e['toString'](),{'type':db[_0x4e67('0x69')]['QueryTypes'][_0x4e67('0x79')]})[_0x4e67('0x27')](function(_0x562017){if(_0x562017[_0x4e67('0x51')]===0x1){return _0x3502f5['id'];}else{var _0x1b91d5=_[_0x4e67('0x7a')](_[_0x4e67('0x3c')](_0x562017,_0x4e67('0x7b')),function(_0x41326a){return _[_0x4e67('0x7c')](_0x5adb22,_0x41326a);});if(_0x1b91d5){return _0x3502f5['id'];}}}));}}return BPromise[_0x4e67('0x7d')](_0x155d3d)['then'](function(_0x56750b){_0x7498f2=_(_0x7498f2)['union'](_0x56750b)[_0x4e67('0x7e')]()['value']();return db[_0x4e67('0x40')][_0x4e67('0x48')]({'where':{'id':_0x277ee3['params']['id']}})[_0x4e67('0x27')](function(_0x113732){return db[_0x4e67('0x69')]['transaction'](function(_0x1fc324){return _0x113732['removeTeams'](_0x277ee3[_0x4e67('0x31')][_0x4e67('0x62')],{'transaction':_0x1fc324})[_0x4e67('0x27')](function(){if(!_[_0x4e67('0x7f')](_0x7498f2)){return _0x113732[_0x4e67('0x80')](_0x7498f2,{'transaction':_0x1fc324});}})[_0x4e67('0x27')](function(){_0x7498f2[_0x4e67('0x6c')](function(_0x4d5721){socket[_0x4e67('0x6d')](_0x4e67('0x81'),{'UserId':_0x4d5721,'OpenchannelQueueId':_0x113732['id']});});});});});});})[_0x4e67('0x27')](respondWithStatusCode(_0x56a8a4,null))[_0x4e67('0x45')](handleError(_0x56a8a4,null));};exports[_0x4e67('0x82')]=function(_0x39226a,_0x7ec101,_0x5be284){return db[_0x4e67('0x40')][_0x4e67('0x48')]({'where':{'id':_0x39226a[_0x4e67('0x47')]['id']}})[_0x4e67('0x27')](handleEntityNotFound(_0x7ec101,null))[_0x4e67('0x27')](function(_0x2f9030){if(_0x2f9030){return _0x2f9030['addAgents'](_0x39226a[_0x4e67('0x4a')]['ids'],_[_0x4e67('0x83')](_0x39226a[_0x4e67('0x4a')],[_0x4e67('0x62'),'id'])||{})['spread'](function(_0x377b00){for(var _0x145734=0x0;_0x145734<_0x39226a['body']['ids']['length'];_0x145734+=0x1){socket[_0x4e67('0x6d')]('userOpenchannelQueue:save',{'UserId':_0x39226a[_0x4e67('0x4a')]['ids'][_0x145734],'OpenchannelQueueId':_0x39226a['params']['id']});}return _0x377b00;});}})[_0x4e67('0x27')](respondWithResult(_0x7ec101,null))[_0x4e67('0x45')](handleError(_0x7ec101,null));};exports[_0x4e67('0x80')]=function(_0x3a7548,_0x5ee488,_0x78d6ba){return db['OpenchannelQueue'][_0x4e67('0x48')]({'where':{'id':_0x3a7548[_0x4e67('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ee488,null))[_0x4e67('0x27')](function(_0x263d2a){if(_0x263d2a){return _0x263d2a['removeAgents'](_0x3a7548[_0x4e67('0x31')]['ids'])['then'](function(){if(_['isArray'](_0x3a7548[_0x4e67('0x31')][_0x4e67('0x62')])){for(var _0xe790fe=0x0;_0xe790fe<_0x3a7548[_0x4e67('0x31')][_0x4e67('0x62')][_0x4e67('0x51')];_0xe790fe+=0x1){socket['emit'](_0x4e67('0x81'),{'UserId':Number(_0x3a7548[_0x4e67('0x31')][_0x4e67('0x62')][_0xe790fe]),'OpenchannelQueueId':Number(_0x3a7548['params']['id'])});}}else{socket[_0x4e67('0x6d')](_0x4e67('0x81'),{'UserId':Number(_0x3a7548[_0x4e67('0x31')][_0x4e67('0x62')]),'OpenchannelQueueId':Number(_0x3a7548['params']['id'])});}});}})['then'](respondWithStatusCode(_0x5ee488,null))[_0x4e67('0x45')](handleError(_0x5ee488,null));};exports['getAgents']=function(_0x20e25c,_0x3140c2,_0x3f4d03){var _0x44762a={};var _0x47b6d5={};var _0x1b9ea0;var _0x2471b1;return db['OpenchannelQueue'][_0x4e67('0x50')]({'where':{'id':_0x20e25c[_0x4e67('0x47')]['id']}})['then'](handleEntityNotFound(_0x3140c2,null))[_0x4e67('0x27')](function(_0x4a7944){if(_0x4a7944){_0x1b9ea0=_0x4a7944;_0x47b6d5[_0x4e67('0x30')]=_[_0x4e67('0x32')](db[_0x4e67('0x63')][_0x4e67('0x2e')]);_0x47b6d5[_0x4e67('0x31')]=_[_0x4e67('0x32')](_0x20e25c[_0x4e67('0x31')]);_0x47b6d5[_0x4e67('0x33')]=_['intersection'](_0x47b6d5[_0x4e67('0x30')],_0x47b6d5['query']);_0x44762a['attributes']=_[_0x4e67('0x35')](_0x47b6d5['model'],qs[_0x4e67('0x36')](_0x20e25c[_0x4e67('0x31')][_0x4e67('0x36')]));_0x44762a['attributes']=_0x44762a[_0x4e67('0x34')][_0x4e67('0x51')]?_0x44762a[_0x4e67('0x34')]:_0x47b6d5[_0x4e67('0x30')];_0x44762a[_0x4e67('0x39')]=qs[_0x4e67('0x52')](_0x20e25c[_0x4e67('0x31')][_0x4e67('0x52')]);_0x44762a[_0x4e67('0x3b')]=qs[_0x4e67('0x33')](_[_0x4e67('0x53')](_0x20e25c[_0x4e67('0x31')],_0x47b6d5[_0x4e67('0x33')]));if(_0x20e25c[_0x4e67('0x31')][_0x4e67('0x3a')]){_0x44762a[_0x4e67('0x3b')]=_[_0x4e67('0x3e')](_0x44762a[_0x4e67('0x3b')],{'$or':_[_0x4e67('0x3c')](_0x44762a[_0x4e67('0x34')],function(_0x5cae73){var _0x3b752f={};_0x3b752f[_0x5cae73]={'$like':'%'+_0x20e25c[_0x4e67('0x31')][_0x4e67('0x3a')]+'%'};return _0x3b752f;})});}_0x44762a=_[_0x4e67('0x3e')]({},_0x44762a,_0x20e25c[_0x4e67('0x3f')]);return _0x1b9ea0[_0x4e67('0x84')](_0x44762a);}})['then'](function(_0x57b0bc){if(_0x57b0bc){_0x2471b1=_0x57b0bc[_0x4e67('0x51')];if(!_0x20e25c[_0x4e67('0x31')][_0x4e67('0x37')](_0x4e67('0x38'))){_0x44762a[_0x4e67('0x22')]=qs['limit'](_0x20e25c[_0x4e67('0x31')][_0x4e67('0x22')]);_0x44762a[_0x4e67('0x21')]=qs[_0x4e67('0x21')](_0x20e25c[_0x4e67('0x31')]['offset']);}return _0x1b9ea0[_0x4e67('0x84')](_0x44762a);}})[_0x4e67('0x27')](function(_0x20e58b){if(_0x20e58b){return _0x20e58b?{'count':_0x2471b1,'rows':_0x20e58b}:null;}})[_0x4e67('0x27')](respondWithResult(_0x3140c2,null))['catch'](handleError(_0x3140c2,null));}; \ No newline at end of file +var _0xda9e=['emit','ids','field','tq.TeamId','from','team_has_openchannel_queues','join','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','push','sequelize','toString','QueryTypes','SELECT','every','TeamId','includes','all','compact','value','isEmpty','removeAgents','userOpenchannelQueue:remove','addAgents','omit','userOpenchannelQueue:save','isArray','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./openchannelQueue.socket','status','json','count','offset','limit','set','reject','save','then','destroy','OpenchannelQueues','UserProfileResource','sendStatus','name','send','index','map','OpenchannelQueue','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','type','includeAll','include','findAll','rows','params','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','findOne','get','UserOpenchannelQueue','OpenchannelQueueId','agent','openchannelPause','format','%s/%s','updatedAt','getTeams','Team','rawAttributes','nolimit','addTeams','User','Agents','voicePause','interface','transaction','each','findOrCreate','forEach'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xda9e,0x129));var _0xeda9=function(_0x1c3907,_0x41e1a7){_0x1c3907=_0x1c3907-0x0;var _0x27fcd6=_0xda9e[_0x1c3907];return _0x27fcd6;};'use strict';var pdf=require(_0xeda9('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xeda9('0x1'));var zipdir=require(_0xeda9('0x2'));var jsonpatch=require(_0xeda9('0x3'));var rp=require(_0xeda9('0x4'));var moment=require(_0xeda9('0x5'));var BPromise=require(_0xeda9('0x6'));var Mustache=require(_0xeda9('0x7'));var util=require(_0xeda9('0x8'));var path=require(_0xeda9('0x9'));var sox=require(_0xeda9('0xa'));var csv=require(_0xeda9('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xeda9('0xc'));var squel=require(_0xeda9('0xd'));var crypto=require('crypto');var jsforce=require(_0xeda9('0xe'));var deskjs=require(_0xeda9('0xf'));var toCsv=require(_0xeda9('0xb'));var querystring=require(_0xeda9('0x10'));var Papa=require(_0xeda9('0x11'));var Redis=require('ioredis');var authService=require(_0xeda9('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeda9('0x13'));var logger=require(_0xeda9('0x14'))(_0xeda9('0x15'));var utils=require('../../config/utils');var config=require(_0xeda9('0x16'));var db=require(_0xeda9('0x17'))['db'];config['redis']=_[_0xeda9('0x18')](config[_0xeda9('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xeda9('0x1a'))(new Redis(config[_0xeda9('0x19')]));require(_0xeda9('0x1b'))['register'](socket);function respondWithStatusCode(_0x2903fe,_0x128221){_0x128221=_0x128221||0xcc;return function(_0x88ea8a){if(_0x88ea8a){return _0x2903fe['sendStatus'](_0x128221);}return _0x2903fe[_0xeda9('0x1c')](_0x128221)['end']();};}function respondWithResult(_0xbae07e,_0x3ef9ed){_0x3ef9ed=_0x3ef9ed||0xc8;return function(_0x1e535c){if(_0x1e535c){return _0xbae07e[_0xeda9('0x1c')](_0x3ef9ed)[_0xeda9('0x1d')](_0x1e535c);}};}function respondWithFilteredResult(_0x32f190,_0x33022a){return function(_0x3d8e11){if(_0x3d8e11){var _0x34eb81=_0x3d8e11[_0xeda9('0x1e')],_0x17cf14=_0x33022a[_0xeda9('0x1f')],_0x1857a6=_0x33022a[_0xeda9('0x1f')]+_0x33022a[_0xeda9('0x20')],_0x4b168b;if(_0x1857a6>=_0x34eb81){_0x1857a6=_0x34eb81;_0x4b168b=0xc8;}else{_0x4b168b=0xce;}_0x32f190['status'](_0x4b168b);return _0x32f190[_0xeda9('0x21')]('Content-Range',_0x17cf14+'-'+_0x1857a6+'/'+_0x34eb81)[_0xeda9('0x1d')](_0x3d8e11);}return null;};}function patchUpdates(_0x4ba62e){return function(_0x1c9cf0){try{jsonpatch['apply'](_0x1c9cf0,_0x4ba62e,!![]);}catch(_0x47cc1c){return BPromise[_0xeda9('0x22')](_0x47cc1c);}return _0x1c9cf0[_0xeda9('0x23')]();};}function saveUpdates(_0xfd1c52,_0x50a1f8){return function(_0x210be7){if(_0x210be7){return _0x210be7['update'](_0xfd1c52)[_0xeda9('0x24')](function(_0x4b6b74){return _0x4b6b74;});}return null;};}function removeEntity(_0x17a917,_0x510bbf){return function(_0x4e3bb4){if(_0x4e3bb4){return _0x4e3bb4[_0xeda9('0x25')]()[_0xeda9('0x24')](function(){var _0x3f289e=_0x4e3bb4['get']({'plain':!![]});var _0x3c129e=_0xeda9('0x26');return db[_0xeda9('0x27')][_0xeda9('0x25')]({'where':{'type':_0x3c129e,'resourceId':_0x3f289e['id']}})[_0xeda9('0x24')](function(){return _0x4e3bb4;});})[_0xeda9('0x24')](function(){_0x17a917[_0xeda9('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1924c5,_0x79024b){return function(_0x2e1c1b){if(!_0x2e1c1b){_0x1924c5[_0xeda9('0x28')](0x194);}return _0x2e1c1b;};}function handleError(_0x5874e5,_0x31c166){_0x31c166=_0x31c166||0x1f4;return function(_0x2e6c30){logger['error'](_0x2e6c30['stack']);if(_0x2e6c30['name']){delete _0x2e6c30[_0xeda9('0x29')];}_0x5874e5[_0xeda9('0x1c')](_0x31c166)[_0xeda9('0x2a')](_0x2e6c30);};}exports[_0xeda9('0x2b')]=function(_0x5c6c14,_0x12d5fb){var _0x5a4351={},_0x948f13={},_0x20d2de={'count':0x0,'rows':[]};var _0x18d791=_[_0xeda9('0x2c')](db[_0xeda9('0x2d')]['rawAttributes'],function(_0x1cc89f){return{'name':_0x1cc89f[_0xeda9('0x2e')],'type':_0x1cc89f['type'][_0xeda9('0x2f')]};});_0x948f13[_0xeda9('0x30')]=_['map'](_0x18d791,_0xeda9('0x29'));_0x948f13[_0xeda9('0x31')]=_[_0xeda9('0x32')](_0x5c6c14[_0xeda9('0x31')]);_0x948f13[_0xeda9('0x33')]=_[_0xeda9('0x34')](_0x948f13[_0xeda9('0x30')],_0x948f13[_0xeda9('0x31')]);_0x5a4351[_0xeda9('0x35')]=_[_0xeda9('0x34')](_0x948f13['model'],qs[_0xeda9('0x36')](_0x5c6c14['query'][_0xeda9('0x36')]));_0x5a4351['attributes']=_0x5a4351['attributes'][_0xeda9('0x37')]?_0x5a4351[_0xeda9('0x35')]:_0x948f13[_0xeda9('0x30')];if(!_0x5c6c14[_0xeda9('0x31')][_0xeda9('0x38')]('nolimit')){_0x5a4351[_0xeda9('0x20')]=qs[_0xeda9('0x20')](_0x5c6c14[_0xeda9('0x31')][_0xeda9('0x20')]);_0x5a4351[_0xeda9('0x1f')]=qs[_0xeda9('0x1f')](_0x5c6c14[_0xeda9('0x31')]['offset']);}_0x5a4351[_0xeda9('0x39')]=qs[_0xeda9('0x3a')](_0x5c6c14[_0xeda9('0x31')][_0xeda9('0x3a')]);_0x5a4351[_0xeda9('0x3b')]=qs[_0xeda9('0x33')](_[_0xeda9('0x3c')](_0x5c6c14['query'],_0x948f13[_0xeda9('0x33')]));if(_0x5c6c14[_0xeda9('0x31')][_0xeda9('0x3d')]){_0x5a4351[_0xeda9('0x3b')]=_[_0xeda9('0x3e')](_0x5a4351[_0xeda9('0x3b')],{'$or':_[_0xeda9('0x2c')](_0x18d791,function(_0x537942){if(_0x537942[_0xeda9('0x3f')]!=='VIRTUAL'){var _0x108c9d={};_0x108c9d[_0x537942[_0xeda9('0x29')]]={'$like':'%'+_0x5c6c14[_0xeda9('0x31')]['filter']+'%'};return _0x108c9d;}})});}_0x5a4351=_[_0xeda9('0x3e')]({},_0x5a4351,_0x5c6c14['options']);var _0x1573b0={'where':_0x5a4351['where']};return db[_0xeda9('0x2d')][_0xeda9('0x1e')](_0x1573b0)[_0xeda9('0x24')](function(_0x5651ec){_0x20d2de[_0xeda9('0x1e')]=_0x5651ec;if(_0x5c6c14['query'][_0xeda9('0x40')]){_0x5a4351[_0xeda9('0x41')]=[{'all':!![]}];}return db[_0xeda9('0x2d')][_0xeda9('0x42')](_0x5a4351);})[_0xeda9('0x24')](function(_0x20abfa){_0x20d2de[_0xeda9('0x43')]=_0x20abfa;return _0x20d2de;})[_0xeda9('0x24')](respondWithFilteredResult(_0x12d5fb,_0x5a4351))['catch'](handleError(_0x12d5fb,null));};exports['show']=function(_0x48b45e,_0x1d63d8){var _0x2fcaba={'raw':!![],'where':{'id':_0x48b45e[_0xeda9('0x44')]['id']}},_0xc6987f={};_0xc6987f[_0xeda9('0x30')]=_['keys'](db[_0xeda9('0x2d')]['rawAttributes']);_0xc6987f[_0xeda9('0x31')]=_[_0xeda9('0x32')](_0x48b45e[_0xeda9('0x31')]);_0xc6987f[_0xeda9('0x33')]=_[_0xeda9('0x34')](_0xc6987f[_0xeda9('0x30')],_0xc6987f[_0xeda9('0x31')]);_0x2fcaba[_0xeda9('0x35')]=_[_0xeda9('0x34')](_0xc6987f[_0xeda9('0x30')],qs[_0xeda9('0x36')](_0x48b45e[_0xeda9('0x31')]['fields']));_0x2fcaba['attributes']=_0x2fcaba[_0xeda9('0x35')]['length']?_0x2fcaba['attributes']:_0xc6987f[_0xeda9('0x30')];if(_0x48b45e[_0xeda9('0x31')][_0xeda9('0x40')]){_0x2fcaba[_0xeda9('0x41')]=[{'all':!![]}];}_0x2fcaba=_['merge']({},_0x2fcaba,_0x48b45e[_0xeda9('0x45')]);return db[_0xeda9('0x2d')][_0xeda9('0x46')](_0x2fcaba)[_0xeda9('0x24')](handleEntityNotFound(_0x1d63d8,null))[_0xeda9('0x24')](respondWithResult(_0x1d63d8,null))['catch'](handleError(_0x1d63d8,null));};exports[_0xeda9('0x47')]=function(_0x20d2e4,_0x343ac3){return db[_0xeda9('0x2d')][_0xeda9('0x47')](_0x20d2e4[_0xeda9('0x48')],{})[_0xeda9('0x24')](function(_0x14da19){var _0x27a392=_0x20d2e4[_0xeda9('0x49')]['get']({'plain':!![]});if(!_0x27a392)throw new Error(_0xeda9('0x4a'));if(_0x27a392[_0xeda9('0x4b')]==='user'){var _0x2bdedb=_0x14da19['get']({'plain':!![]});var _0x153b0c=_0xeda9('0x26');return db[_0xeda9('0x4c')][_0xeda9('0x46')]({'where':{'name':_0x153b0c,'userProfileId':_0x27a392['userProfileId']},'raw':!![]})[_0xeda9('0x24')](function(_0x51beab){if(_0x51beab&&_0x51beab[_0xeda9('0x4d')]===0x0){return db['UserProfileResource'][_0xeda9('0x47')]({'name':_0x2bdedb['name'],'resourceId':_0x2bdedb['id'],'type':_0x51beab[_0xeda9('0x29')],'sectionId':_0x51beab['id']},{})[_0xeda9('0x24')](function(){return _0x14da19;});}else{return _0x14da19;}})[_0xeda9('0x4e')](function(_0xb56506){logger[_0xeda9('0x4f')](_0xeda9('0x50'),_0xb56506);throw _0xb56506;});}return _0x14da19;})[_0xeda9('0x24')](respondWithResult(_0x343ac3,0xc9))[_0xeda9('0x4e')](handleError(_0x343ac3,null));};exports[_0xeda9('0x51')]=function(_0x54866c,_0x405f0e){if(_0x54866c['body']['id']){delete _0x54866c[_0xeda9('0x48')]['id'];}return db[_0xeda9('0x2d')][_0xeda9('0x46')]({'where':{'id':_0x54866c[_0xeda9('0x44')]['id']}})['then'](handleEntityNotFound(_0x405f0e,null))['then'](saveUpdates(_0x54866c[_0xeda9('0x48')],null))['then'](respondWithResult(_0x405f0e,null))[_0xeda9('0x4e')](handleError(_0x405f0e,null));};exports['destroy']=function(_0x4818d9,_0x78d29a){return db[_0xeda9('0x2d')][_0xeda9('0x46')]({'where':{'id':_0x4818d9[_0xeda9('0x44')]['id']}})[_0xeda9('0x24')](handleEntityNotFound(_0x78d29a,null))['then'](removeEntity(_0x78d29a,null))['catch'](handleError(_0x78d29a,null));};exports[_0xeda9('0x52')]=function(_0x4bf30d,_0x20fad9){return db[_0xeda9('0x2d')][_0xeda9('0x52')]()[_0xeda9('0x24')](respondWithResult(_0x20fad9,null))[_0xeda9('0x4e')](handleError(_0x20fad9,null));};exports['getMembers']=function(_0x643a57,_0x15a57b,_0x420a0c){var _0x59c5ca={'raw':!![],'where':{}},_0x473edb={},_0x240258;return db[_0xeda9('0x2d')][_0xeda9('0x53')]({'where':{'id':_0x643a57[_0xeda9('0x44')]['id']}})[_0xeda9('0x24')](handleEntityNotFound(_0x15a57b,null))[_0xeda9('0x24')](function(_0x3c1901){if(_0x3c1901){_0x240258=_0x3c1901[_0xeda9('0x54')]({'plain':!![]});_0x473edb[_0xeda9('0x30')]=_[_0xeda9('0x32')](db[_0xeda9('0x55')]['rawAttributes']);_0x473edb['query']=_[_0xeda9('0x32')](_0x643a57[_0xeda9('0x31')]);_0x473edb[_0xeda9('0x33')]=_['intersection'](_0x473edb[_0xeda9('0x30')],_0x473edb['query']);_0x59c5ca['attributes']=_[_0xeda9('0x34')](_0x473edb[_0xeda9('0x30')],qs[_0xeda9('0x36')](_0x643a57[_0xeda9('0x31')][_0xeda9('0x36')]));_0x59c5ca['attributes']=_0x59c5ca[_0xeda9('0x35')][_0xeda9('0x37')]?_0x59c5ca[_0xeda9('0x35')]:_0x473edb['model'];if(!_0x643a57[_0xeda9('0x31')][_0xeda9('0x38')]('nolimit')){_0x59c5ca['limit']=qs[_0xeda9('0x20')](_0x643a57['query']['limit']);_0x59c5ca[_0xeda9('0x1f')]=qs[_0xeda9('0x1f')](_0x643a57[_0xeda9('0x31')][_0xeda9('0x1f')]);}_0x59c5ca[_0xeda9('0x39')]=qs[_0xeda9('0x3a')](_0x643a57[_0xeda9('0x31')][_0xeda9('0x3a')]);_0x59c5ca['where']=qs[_0xeda9('0x33')](_[_0xeda9('0x3c')](_0x643a57['query'],_0x473edb[_0xeda9('0x33')]));_0x59c5ca[_0xeda9('0x3b')][_0xeda9('0x56')]=_0x3c1901['id'];if(_0x643a57['query'][_0xeda9('0x3d')]){_0x59c5ca['where']=_[_0xeda9('0x3e')](_0x59c5ca[_0xeda9('0x3b')],{'$or':_[_0xeda9('0x2c')](_0x59c5ca['attributes'],function(_0x1109ab){var _0x593e04={};_0x593e04[_0x1109ab]={'$like':'%'+_0x643a57[_0xeda9('0x31')]['filter']+'%'};return _0x593e04;})});}_0x59c5ca=_[_0xeda9('0x3e')]({},_0x59c5ca,_0x643a57['options']);return db[_0xeda9('0x55')]['findAll'](_0x59c5ca);}})[_0xeda9('0x24')](function(_0x3a1ed4){if(_0x3a1ed4){return db['User']['findAndCountAll']({'where':{'id':_[_0xeda9('0x2c')](_0x3a1ed4,'UserId'),'role':_0xeda9('0x57')},'attributes':['id',_0xeda9('0x29'),_0xeda9('0x58'),'updatedAt','createdAt']});}})['then'](function(_0x124517){if(_0x124517){return{'count':_0x124517[_0xeda9('0x1e')],'rows':_[_0xeda9('0x2c')](_0x124517[_0xeda9('0x43')],function(_0x267026){return{'membername':_0x267026[_0xeda9('0x29')],'UserId':_0x267026['id'],'queue_name':_0x240258[_0xeda9('0x29')],'OpenchannelQueueId':_0x240258['id'],'interface':util[_0xeda9('0x59')](_0xeda9('0x5a'),'SIP',_0x267026[_0xeda9('0x29')]),'penalty':0x0,'paused':_0x267026['openchannelPause'],'createdAt':_0x267026['createdAt'],'updatedAt':_0x267026[_0xeda9('0x5b')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xeda9('0x24')](respondWithFilteredResult(_0x15a57b,_0x59c5ca))[_0xeda9('0x4e')](handleError(_0x15a57b,null));};exports[_0xeda9('0x5c')]=function(_0x383e16,_0x141afc,_0x36c54e){var _0x11118d={};var _0x251a0c={};var _0x358611;var _0x3deb94;return db[_0xeda9('0x2d')]['findOne']({'where':{'id':_0x383e16['params']['id']}})[_0xeda9('0x24')](handleEntityNotFound(_0x141afc,null))[_0xeda9('0x24')](function(_0x42076e){if(_0x42076e){_0x358611=_0x42076e;_0x251a0c[_0xeda9('0x30')]=_[_0xeda9('0x32')](db[_0xeda9('0x5d')][_0xeda9('0x5e')]);_0x251a0c[_0xeda9('0x31')]=_['keys'](_0x383e16[_0xeda9('0x31')]);_0x251a0c['filters']=_[_0xeda9('0x34')](_0x251a0c['model'],_0x251a0c[_0xeda9('0x31')]);_0x11118d[_0xeda9('0x35')]=_['intersection'](_0x251a0c[_0xeda9('0x30')],qs[_0xeda9('0x36')](_0x383e16['query'][_0xeda9('0x36')]));_0x11118d[_0xeda9('0x35')]=_0x11118d[_0xeda9('0x35')][_0xeda9('0x37')]?_0x11118d[_0xeda9('0x35')]:_0x251a0c[_0xeda9('0x30')];_0x11118d[_0xeda9('0x39')]=qs[_0xeda9('0x3a')](_0x383e16[_0xeda9('0x31')][_0xeda9('0x3a')]);_0x11118d[_0xeda9('0x3b')]=qs[_0xeda9('0x33')](_[_0xeda9('0x3c')](_0x383e16[_0xeda9('0x31')],_0x251a0c[_0xeda9('0x33')]));if(_0x383e16[_0xeda9('0x31')]['filter']){_0x11118d[_0xeda9('0x3b')]=_['merge'](_0x11118d[_0xeda9('0x3b')],{'$or':_[_0xeda9('0x2c')](_0x11118d['attributes'],function(_0x5f18e3){var _0x38a6e1={};_0x38a6e1[_0x5f18e3]={'$like':'%'+_0x383e16[_0xeda9('0x31')][_0xeda9('0x3d')]+'%'};return _0x38a6e1;})});}_0x11118d=_[_0xeda9('0x3e')]({},_0x11118d,_0x383e16['options']);return _0x358611[_0xeda9('0x5c')](_0x11118d);}})['then'](function(_0x1cbe2c){if(_0x1cbe2c){_0x3deb94=_0x1cbe2c[_0xeda9('0x37')];if(!_0x383e16[_0xeda9('0x31')][_0xeda9('0x38')](_0xeda9('0x5f'))){_0x11118d[_0xeda9('0x20')]=qs[_0xeda9('0x20')](_0x383e16['query']['limit']);_0x11118d[_0xeda9('0x1f')]=qs[_0xeda9('0x1f')](_0x383e16[_0xeda9('0x31')]['offset']);}return _0x358611['getTeams'](_0x11118d);}})['then'](function(_0x258095){if(_0x258095){return _0x258095?{'count':_0x3deb94,'rows':_0x258095}:null;}})[_0xeda9('0x24')](respondWithResult(_0x141afc,null))[_0xeda9('0x4e')](handleError(_0x141afc,null));};exports[_0xeda9('0x60')]=function(_0x114d28,_0x35ef53,_0x13191d){var _0x4f57d4=_0x114d28['body']['ids'];return db[_0xeda9('0x5d')][_0xeda9('0x42')]({'where':{'id':_0x4f57d4},'attributes':['id'],'include':[{'model':db[_0xeda9('0x61')],'as':_0xeda9('0x62'),'attributes':['id',_0xeda9('0x29'),'online',_0xeda9('0x63'),_0xeda9('0x64')],'raw':!![]}]})[_0xeda9('0x24')](function(_0x1b85eb){if(_0x1b85eb){var _0x1d0cc7=_['flatMap'](_0x1b85eb,function(_0x6eab2b){var _0x5c50e6=_0x6eab2b[_0xeda9('0x54')]({'plain':!![]});return _0x5c50e6[_0xeda9('0x62')];});return db['OpenchannelQueue']['find']({'where':{'id':_0x114d28['params']['id']}})[_0xeda9('0x24')](function(_0x5a40ea){return db['sequelize'][_0xeda9('0x65')](function(_0x3ad04e){return _0x5a40ea[_0xeda9('0x60')](_0x4f57d4,{'transaction':_0x3ad04e})['then'](function(){return BPromise[_0xeda9('0x66')](_0x1d0cc7,function(_0x46ecc1){return db['UserOpenchannelQueue'][_0xeda9('0x67')]({'where':{'UserId':_0x46ecc1['id'],'OpenchannelQueueId':_0x114d28['params']['id']},'transaction':_0x3ad04e});});})['then'](function(){_0x1d0cc7[_0xeda9('0x68')](function(_0x438017){socket[_0xeda9('0x69')]('userOpenchannelQueue:save',{'UserId':_0x438017['id'],'OpenchannelQueueId':_0x5a40ea['id']});});});});});}})[_0xeda9('0x24')](respondWithStatusCode(_0x35ef53,null))[_0xeda9('0x4e')](handleError(_0x35ef53,null));};exports['removeTeams']=function(_0x5e5961,_0x57f729,_0x19d81f){return db[_0xeda9('0x5d')][_0xeda9('0x42')]({'where':{'id':_0x5e5961[_0xeda9('0x31')][_0xeda9('0x6a')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xeda9('0x62'),'attributes':['id'],'raw':!![]}]})[_0xeda9('0x24')](handleEntityNotFound(_0x57f729,null))[_0xeda9('0x24')](function(_0x4257c7){var _0x43a8d5=_[_0xeda9('0x2c')](_0x4257c7,'id');var _0x19e784=[];var _0x5b38dc=[];var _0x315607=squel['select']();_0x315607[_0xeda9('0x6b')](_0xeda9('0x6c'))[_0xeda9('0x6d')](_0xeda9('0x6e'),'tq')[_0xeda9('0x6f')]('user_has_teams','ut',_0xeda9('0x70'))[_0xeda9('0x3b')](_0xeda9('0x71'),_0x5e5961[_0xeda9('0x44')]['id']);for(var _0x3abb28=0x0;_0x3abb28<_0x4257c7[_0xeda9('0x37')];_0x3abb28+=0x1){let _0x2b030c=_0x4257c7[_0x3abb28];for(var _0x5a965c=0x0;_0x5a965c<_0x2b030c[_0xeda9('0x62')][_0xeda9('0x37')];_0x5a965c+=0x1){let _0x11449f=_0x2b030c[_0xeda9('0x62')][_0x5a965c];var _0x37322c=_0x315607[_0xeda9('0x72')]();_0x37322c[_0xeda9('0x3b')]('ut.UserId\x20=\x20?',_0x11449f['id']);_0x5b38dc[_0xeda9('0x73')](db[_0xeda9('0x74')]['query'](_0x37322c[_0xeda9('0x75')](),{'type':db['sequelize'][_0xeda9('0x76')][_0xeda9('0x77')]})[_0xeda9('0x24')](function(_0x1d983a){if(_0x1d983a[_0xeda9('0x37')]===0x1){return _0x11449f['id'];}else{var _0x115c62=_[_0xeda9('0x78')](_[_0xeda9('0x2c')](_0x1d983a,_0xeda9('0x79')),function(_0x371d48){return _[_0xeda9('0x7a')](_0x43a8d5,_0x371d48);});if(_0x115c62){return _0x11449f['id'];}}}));}}return BPromise[_0xeda9('0x7b')](_0x5b38dc)[_0xeda9('0x24')](function(_0x40dab8){_0x19e784=_(_0x19e784)['union'](_0x40dab8)[_0xeda9('0x7c')]()[_0xeda9('0x7d')]();return db['OpenchannelQueue'][_0xeda9('0x46')]({'where':{'id':_0x5e5961[_0xeda9('0x44')]['id']}})['then'](function(_0x4e6681){return db['sequelize'][_0xeda9('0x65')](function(_0x2c74e0){return _0x4e6681['removeTeams'](_0x5e5961['query'][_0xeda9('0x6a')],{'transaction':_0x2c74e0})[_0xeda9('0x24')](function(){if(!_[_0xeda9('0x7e')](_0x19e784)){return _0x4e6681[_0xeda9('0x7f')](_0x19e784,{'transaction':_0x2c74e0});}})[_0xeda9('0x24')](function(){_0x19e784[_0xeda9('0x68')](function(_0x60e465){socket[_0xeda9('0x69')](_0xeda9('0x80'),{'UserId':_0x60e465,'OpenchannelQueueId':_0x4e6681['id']});});});});});});})[_0xeda9('0x24')](respondWithStatusCode(_0x57f729,null))[_0xeda9('0x4e')](handleError(_0x57f729,null));};exports[_0xeda9('0x81')]=function(_0x3dc1e6,_0x413c3d,_0x240a19){return db[_0xeda9('0x2d')][_0xeda9('0x46')]({'where':{'id':_0x3dc1e6[_0xeda9('0x44')]['id']}})[_0xeda9('0x24')](handleEntityNotFound(_0x413c3d,null))['then'](function(_0x5a7293){if(_0x5a7293){return _0x5a7293[_0xeda9('0x81')](_0x3dc1e6[_0xeda9('0x48')][_0xeda9('0x6a')],_[_0xeda9('0x82')](_0x3dc1e6[_0xeda9('0x48')],['ids','id'])||{})['spread'](function(_0x45994b){for(var _0x47d8b1=0x0;_0x47d8b1<_0x3dc1e6['body'][_0xeda9('0x6a')][_0xeda9('0x37')];_0x47d8b1+=0x1){socket[_0xeda9('0x69')](_0xeda9('0x83'),{'UserId':_0x3dc1e6[_0xeda9('0x48')][_0xeda9('0x6a')][_0x47d8b1],'OpenchannelQueueId':_0x3dc1e6[_0xeda9('0x44')]['id']});}return _0x45994b;});}})[_0xeda9('0x24')](respondWithResult(_0x413c3d,null))[_0xeda9('0x4e')](handleError(_0x413c3d,null));};exports[_0xeda9('0x7f')]=function(_0x2673a4,_0x2f213f,_0x5ad2a5){return db[_0xeda9('0x2d')][_0xeda9('0x46')]({'where':{'id':_0x2673a4[_0xeda9('0x44')]['id']}})['then'](handleEntityNotFound(_0x2f213f,null))[_0xeda9('0x24')](function(_0x1469db){if(_0x1469db){return _0x1469db[_0xeda9('0x7f')](_0x2673a4[_0xeda9('0x31')][_0xeda9('0x6a')])[_0xeda9('0x24')](function(){if(_[_0xeda9('0x84')](_0x2673a4[_0xeda9('0x31')]['ids'])){for(var _0x1761f6=0x0;_0x1761f6<_0x2673a4[_0xeda9('0x31')][_0xeda9('0x6a')]['length'];_0x1761f6+=0x1){socket[_0xeda9('0x69')]('userOpenchannelQueue:remove',{'UserId':Number(_0x2673a4[_0xeda9('0x31')][_0xeda9('0x6a')][_0x1761f6]),'OpenchannelQueueId':Number(_0x2673a4[_0xeda9('0x44')]['id'])});}}else{socket[_0xeda9('0x69')](_0xeda9('0x80'),{'UserId':Number(_0x2673a4['query'][_0xeda9('0x6a')]),'OpenchannelQueueId':Number(_0x2673a4[_0xeda9('0x44')]['id'])});}});}})[_0xeda9('0x24')](respondWithStatusCode(_0x2f213f,null))['catch'](handleError(_0x2f213f,null));};exports[_0xeda9('0x85')]=function(_0x5354e9,_0x477205,_0x505407){var _0x2121dc={};var _0x3f8630={};var _0x9013af;var _0x507e1e;return db[_0xeda9('0x2d')]['findOne']({'where':{'id':_0x5354e9[_0xeda9('0x44')]['id']}})[_0xeda9('0x24')](handleEntityNotFound(_0x477205,null))['then'](function(_0x291d60){if(_0x291d60){_0x9013af=_0x291d60;_0x3f8630[_0xeda9('0x30')]=_[_0xeda9('0x32')](db['User'][_0xeda9('0x5e')]);_0x3f8630[_0xeda9('0x31')]=_['keys'](_0x5354e9['query']);_0x3f8630[_0xeda9('0x33')]=_[_0xeda9('0x34')](_0x3f8630['model'],_0x3f8630[_0xeda9('0x31')]);_0x2121dc[_0xeda9('0x35')]=_[_0xeda9('0x34')](_0x3f8630[_0xeda9('0x30')],qs['fields'](_0x5354e9[_0xeda9('0x31')][_0xeda9('0x36')]));_0x2121dc[_0xeda9('0x35')]=_0x2121dc['attributes'][_0xeda9('0x37')]?_0x2121dc[_0xeda9('0x35')]:_0x3f8630[_0xeda9('0x30')];_0x2121dc[_0xeda9('0x39')]=qs[_0xeda9('0x3a')](_0x5354e9['query']['sort']);_0x2121dc[_0xeda9('0x3b')]=qs[_0xeda9('0x33')](_[_0xeda9('0x3c')](_0x5354e9['query'],_0x3f8630['filters']));if(_0x5354e9['query'][_0xeda9('0x3d')]){_0x2121dc[_0xeda9('0x3b')]=_[_0xeda9('0x3e')](_0x2121dc[_0xeda9('0x3b')],{'$or':_[_0xeda9('0x2c')](_0x2121dc['attributes'],function(_0x45b647){var _0x3e8976={};_0x3e8976[_0x45b647]={'$like':'%'+_0x5354e9['query'][_0xeda9('0x3d')]+'%'};return _0x3e8976;})});}_0x2121dc=_[_0xeda9('0x3e')]({},_0x2121dc,_0x5354e9[_0xeda9('0x45')]);return _0x9013af[_0xeda9('0x85')](_0x2121dc);}})[_0xeda9('0x24')](function(_0x43e7a3){if(_0x43e7a3){_0x507e1e=_0x43e7a3['length'];if(!_0x5354e9['query'][_0xeda9('0x38')](_0xeda9('0x5f'))){_0x2121dc[_0xeda9('0x20')]=qs['limit'](_0x5354e9[_0xeda9('0x31')][_0xeda9('0x20')]);_0x2121dc[_0xeda9('0x1f')]=qs[_0xeda9('0x1f')](_0x5354e9[_0xeda9('0x31')]['offset']);}return _0x9013af[_0xeda9('0x85')](_0x2121dc);}})['then'](function(_0x2abe6a){if(_0x2abe6a){return _0x2abe6a?{'count':_0x507e1e,'rows':_0x2abe6a}:null;}})['then'](respondWithResult(_0x477205,null))[_0xeda9('0x4e')](handleError(_0x477205,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 26e433e..26c8c7b 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 _0xf56b=['remove','emit','hasOwnProperty','exports','events','setMaxListeners','save','update'];(function(_0x23fd7f,_0x2b1684){var _0x3c6f37=function(_0x2b8bff){while(--_0x2b8bff){_0x23fd7f['push'](_0x23fd7f['shift']());}};_0x3c6f37(++_0x2b1684);}(_0xf56b,0x14c));var _0xbf56=function(_0x31de3f,_0x5623c5){_0x31de3f=_0x31de3f-0x0;var _0x2e9f3c=_0xf56b[_0x31de3f];return _0x2e9f3c;};'use strict';var EventEmitter=require(_0xbf56('0x0'));var OpenchannelQueue=require('../../mysqldb')['db']['OpenchannelQueue'];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xbf56('0x1')](0x0);var events={'afterCreate':_0xbf56('0x2'),'afterUpdate':_0xbf56('0x3'),'afterDestroy':_0xbf56('0x4')};function emitEvent(_0x414ea5){return function(_0x355929,_0x3310b1,_0x299748){OpenchannelQueueEvents[_0xbf56('0x5')](_0x414ea5+':'+_0x355929['id'],_0x355929);OpenchannelQueueEvents[_0xbf56('0x5')](_0x414ea5,_0x355929);_0x299748(null);};}for(var e in events){if(events[_0xbf56('0x6')](e)){var event=events[e];OpenchannelQueue['hook'](e,emitEvent(event));}}module[_0xbf56('0x7')]=OpenchannelQueueEvents; \ No newline at end of file +var _0x4df1=['setMaxListeners','save','update','remove','emit','hook','exports','events','../../mysqldb','OpenchannelQueue'];(function(_0x5e36d1,_0x471178){var _0x950b9e=function(_0x1872f3){while(--_0x1872f3){_0x5e36d1['push'](_0x5e36d1['shift']());}};_0x950b9e(++_0x471178);}(_0x4df1,0x165));var _0x14df=function(_0x4e9bfc,_0x5ba7d4){_0x4e9bfc=_0x4e9bfc-0x0;var _0x37a598=_0x4df1[_0x4e9bfc];return _0x37a598;};'use strict';var EventEmitter=require(_0x14df('0x0'));var OpenchannelQueue=require(_0x14df('0x1'))['db'][_0x14df('0x2')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0x14df('0x3')](0x0);var events={'afterCreate':_0x14df('0x4'),'afterUpdate':_0x14df('0x5'),'afterDestroy':_0x14df('0x6')};function emitEvent(_0x93bdaf){return function(_0x239aa1,_0x4350dc,_0x2d5543){OpenchannelQueueEvents[_0x14df('0x7')](_0x93bdaf+':'+_0x239aa1['id'],_0x239aa1);OpenchannelQueueEvents['emit'](_0x93bdaf,_0x239aa1);_0x2d5543(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelQueue[_0x14df('0x8')](e,emitEvent(event));}}module[_0x14df('0x9')]=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 6c6e344..a2b9e93 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 _0x3db9=['../../config/environment','./openchannelQueue.attributes','exports','define','OpenchannelQueue','openchannel_queues','util','api','moment','bluebird','rimraf'];(function(_0x15d704,_0xc68169){var _0x42de9e=function(_0x147967){while(--_0x147967){_0x15d704['push'](_0x15d704['shift']());}};_0x42de9e(++_0xc68169);}(_0x3db9,0xcc));var _0x93db=function(_0x44fdc2,_0x58f3f7){_0x44fdc2=_0x44fdc2-0x0;var _0x29d28a=_0x3db9[_0x44fdc2];return _0x29d28a;};'use strict';var _=require('lodash');var util=require(_0x93db('0x0'));var logger=require('../../config/logger')(_0x93db('0x1'));var moment=require(_0x93db('0x2'));var BPromise=require(_0x93db('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x93db('0x4'));var config=require(_0x93db('0x5'));var attributes=require(_0x93db('0x6'));module[_0x93db('0x7')]=function(_0x287126,_0x1d8fdc){return _0x287126[_0x93db('0x8')](_0x93db('0x9'),attributes,{'tableName':_0x93db('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4343=['./openchannelQueue.attributes','exports','openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x1cbf0a,_0x2bd910){var _0x4dd61e=function(_0xfff821){while(--_0xfff821){_0x1cbf0a['push'](_0x1cbf0a['shift']());}};_0x4dd61e(++_0x2bd910);}(_0x4343,0x158));var _0x3434=function(_0x406dfb,_0x14d0c7){_0x406dfb=_0x406dfb-0x0;var _0x3a79bb=_0x4343[_0x406dfb];return _0x3a79bb;};'use strict';var _=require(_0x3434('0x0'));var util=require('util');var logger=require(_0x3434('0x1'))(_0x3434('0x2'));var moment=require(_0x3434('0x3'));var BPromise=require(_0x3434('0x4'));var rp=require(_0x3434('0x5'));var fs=require('fs');var path=require(_0x3434('0x6'));var rimraf=require(_0x3434('0x7'));var config=require('../../config/environment');var attributes=require(_0x3434('0x8'));module[_0x3434('0x9')]=function(_0x438e70,_0x367ffb){return _0x438e70['define']('OpenchannelQueue',attributes,{'tableName':_0x3434('0xa'),'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 06e1486..944dfcf 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 _0x2b31=['localhost','socket.io-emitter','request','then','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelQueue,\x20%s,\x20%s','message','info','catch','GetOpenchannelQueue','findAll','options','raw','where','include','map','model','attributes','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x2b31,0x1eb));var _0x12b3=function(_0x52813e,_0x257530){_0x52813e=_0x52813e-0x0;var _0x33f514=_0x2b31[_0x52813e];return _0x33f514;};'use strict';var _=require(_0x12b3('0x0'));var util=require(_0x12b3('0x1'));var moment=require(_0x12b3('0x2'));var BPromise=require(_0x12b3('0x3'));var rs=require(_0x12b3('0x4'));var fs=require('fs');var Redis=require(_0x12b3('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x12b3('0x6'))(_0x12b3('0x7'));var config=require(_0x12b3('0x8'));var jayson=require(_0x12b3('0x9'));var client=jayson[_0x12b3('0xa')][_0x12b3('0xb')]({'port':0x232a});config[_0x12b3('0xc')]=_['defaults'](config[_0x12b3('0xc')],{'host':_0x12b3('0xd'),'port':0x18eb});var socket=require(_0x12b3('0xe'))(new Redis(config['redis']));require('./openchannelQueue.socket')['register'](socket);function respondWithRpcPromise(_0x5736d5,_0x594f3c,_0x1aa4c0){return new BPromise(function(_0x228657,_0x274439){return client[_0x12b3('0xf')](_0x5736d5,_0x1aa4c0)[_0x12b3('0x10')](function(_0x5d0b59){logger['info']('OpenchannelQueue,\x20%s,\x20%s',_0x594f3c,_0x12b3('0x11'));logger[_0x12b3('0x12')](_0x12b3('0x13'),_0x594f3c,_0x12b3('0x11'),JSON[_0x12b3('0x14')](_0x5d0b59));if(_0x5d0b59[_0x12b3('0x15')]){if(_0x5d0b59[_0x12b3('0x15')]['code']===0x1f4){logger[_0x12b3('0x15')](_0x12b3('0x16'),_0x594f3c,_0x5d0b59[_0x12b3('0x15')][_0x12b3('0x17')]);return _0x274439(_0x5d0b59[_0x12b3('0x15')][_0x12b3('0x17')]);}logger[_0x12b3('0x15')](_0x12b3('0x16'),_0x594f3c,_0x5d0b59['error'][_0x12b3('0x17')]);return _0x228657(_0x5d0b59[_0x12b3('0x15')][_0x12b3('0x17')]);}else{logger[_0x12b3('0x18')](_0x12b3('0x16'),_0x594f3c,'request\x20sent');_0x228657(_0x5d0b59['result']['message']);}})[_0x12b3('0x19')](function(_0x3a6a70){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x594f3c,_0x3a6a70);_0x274439(_0x3a6a70);});});}exports[_0x12b3('0x1a')]=function(_0x30543f){var _0x10d1fd=this;return new Promise(function(_0x568d7c,_0x406980){return db['OpenchannelQueue'][_0x12b3('0x1b')]({'raw':_0x30543f['options']?_0x30543f[_0x12b3('0x1c')][_0x12b3('0x1d')]===undefined?!![]:![]:!![],'where':_0x30543f['options']?_0x30543f[_0x12b3('0x1c')][_0x12b3('0x1e')]||null:null,'attributes':_0x30543f[_0x12b3('0x1c')]?_0x30543f['options']['attributes']||null:null,'limit':_0x30543f[_0x12b3('0x1c')]?_0x30543f['options']['limit']||null:null,'include':_0x30543f[_0x12b3('0x1c')]?_0x30543f[_0x12b3('0x1c')][_0x12b3('0x1f')]?_[_0x12b3('0x20')](_0x30543f[_0x12b3('0x1c')][_0x12b3('0x1f')],function(_0x331603){return{'model':db[_0x331603[_0x12b3('0x21')]],'as':_0x331603['as'],'attributes':_0x331603['attributes'],'include':_0x331603[_0x12b3('0x1f')]?_[_0x12b3('0x20')](_0x331603[_0x12b3('0x1f')],function(_0x56d7f1){return{'model':db[_0x56d7f1[_0x12b3('0x21')]],'as':_0x56d7f1['as'],'attributes':_0x56d7f1[_0x12b3('0x22')],'include':_0x56d7f1[_0x12b3('0x1f')]?_[_0x12b3('0x20')](_0x56d7f1['include'],function(_0x376fc3){return{'model':db[_0x376fc3[_0x12b3('0x21')]],'as':_0x376fc3['as'],'attributes':_0x376fc3[_0x12b3('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xa32b65){logger['info'](_0x12b3('0x1a'),_0x30543f);logger[_0x12b3('0x12')](_0x12b3('0x1a'),_0x30543f,JSON[_0x12b3('0x14')](_0xa32b65));_0x568d7c(_0xa32b65);})['catch'](function(_0x2dd82e){logger[_0x12b3('0x15')](_0x12b3('0x1a'),_0x2dd82e[_0x12b3('0x17')],_0x30543f);_0x406980(_0x10d1fd[_0x12b3('0x15')](0x1f4,_0x2dd82e[_0x12b3('0x17')]));});});};exports[_0x12b3('0x23')]=function(_0x3b7dcc){var _0x359626=this;return new Promise(function(_0xbb32a1,_0xc809c2){return db['OpenchannelQueue']['find']({'raw':_0x3b7dcc[_0x12b3('0x1c')]?_0x3b7dcc['options']['raw']===undefined?!![]:![]:!![],'where':_0x3b7dcc[_0x12b3('0x1c')]?_0x3b7dcc['options'][_0x12b3('0x1e')]||null:null,'attributes':_0x3b7dcc['options']?_0x3b7dcc[_0x12b3('0x1c')][_0x12b3('0x22')]||null:null,'include':_0x3b7dcc[_0x12b3('0x1c')]?_0x3b7dcc[_0x12b3('0x1c')][_0x12b3('0x1f')]?_[_0x12b3('0x20')](_0x3b7dcc[_0x12b3('0x1c')]['include'],function(_0x569af0){return{'model':db[_0x569af0[_0x12b3('0x21')]],'as':_0x569af0['as'],'attributes':_0x569af0[_0x12b3('0x22')],'include':_0x569af0[_0x12b3('0x1f')]?_[_0x12b3('0x20')](_0x569af0['include'],function(_0x3acbf6){return{'model':db[_0x3acbf6[_0x12b3('0x21')]],'as':_0x3acbf6['as'],'attributes':_0x3acbf6['attributes'],'include':_0x3acbf6['include']?_[_0x12b3('0x20')](_0x3acbf6[_0x12b3('0x1f')],function(_0x24b747){return{'model':db[_0x24b747[_0x12b3('0x21')]],'as':_0x24b747['as'],'attributes':_0x24b747[_0x12b3('0x22')]};}):[]};}):[]};}):[]:[]})[_0x12b3('0x10')](function(_0x1b1260){logger[_0x12b3('0x18')](_0x12b3('0x23'),_0x3b7dcc);logger[_0x12b3('0x12')](_0x12b3('0x23'),_0x3b7dcc,JSON[_0x12b3('0x14')](_0x1b1260));_0xbb32a1(_0x1b1260);})['catch'](function(_0x7da055){logger['error'](_0x12b3('0x23'),_0x7da055[_0x12b3('0x17')],_0x3b7dcc);_0xc809c2(_0x359626[_0x12b3('0x15')](0x1f4,_0x7da055[_0x12b3('0x17')]));});});}; \ No newline at end of file +var _0x6906=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','GetOpenchannelQueue','OpenchannelQueue','findAll','options','raw','where','include','model','map','then','debug','catch','ShowOpenchannelQueue','find','attributes','lodash','util','moment'];(function(_0x2e4c5b,_0xae6e84){var _0x2860a2=function(_0xaf21bc){while(--_0xaf21bc){_0x2e4c5b['push'](_0x2e4c5b['shift']());}};_0x2860a2(++_0xae6e84);}(_0x6906,0x75));var _0x6690=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x6906[_0x3bf83f];return _0x22c4a9;};'use strict';var _=require(_0x6690('0x0'));var util=require(_0x6690('0x1'));var moment=require(_0x6690('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6690('0x3'));var db=require(_0x6690('0x4'))['db'];var utils=require(_0x6690('0x5'));var logger=require(_0x6690('0x6'))('rpc');var config=require(_0x6690('0x7'));var jayson=require(_0x6690('0x8'));var client=jayson[_0x6690('0x9')][_0x6690('0xa')]({'port':0x232a});config['redis']=_[_0x6690('0xb')](config[_0x6690('0xc')],{'host':_0x6690('0xd'),'port':0x18eb});var socket=require(_0x6690('0xe'))(new Redis(config[_0x6690('0xc')]));require(_0x6690('0xf'))[_0x6690('0x10')](socket);function respondWithRpcPromise(_0x3b66e7,_0x4f5475,_0x29c878){return new BPromise(function(_0x492274,_0x4c3125){return client[_0x6690('0x11')](_0x3b66e7,_0x29c878)['then'](function(_0x4d6822){logger[_0x6690('0x12')](_0x6690('0x13'),_0x4f5475,_0x6690('0x14'));logger['debug']('OpenchannelQueue,\x20%s,\x20%s,\x20%s',_0x4f5475,_0x6690('0x14'),JSON[_0x6690('0x15')](_0x4d6822));if(_0x4d6822[_0x6690('0x16')]){if(_0x4d6822[_0x6690('0x16')]['code']===0x1f4){logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4f5475,_0x4d6822[_0x6690('0x16')][_0x6690('0x17')]);return _0x4c3125(_0x4d6822[_0x6690('0x16')][_0x6690('0x17')]);}logger['error']('OpenchannelQueue,\x20%s,\x20%s',_0x4f5475,_0x4d6822[_0x6690('0x16')][_0x6690('0x17')]);return _0x492274(_0x4d6822['error'][_0x6690('0x17')]);}else{logger['info'](_0x6690('0x13'),_0x4f5475,_0x6690('0x14'));_0x492274(_0x4d6822[_0x6690('0x18')][_0x6690('0x17')]);}})['catch'](function(_0x2d82e9){logger['error'](_0x6690('0x13'),_0x4f5475,_0x2d82e9);_0x4c3125(_0x2d82e9);});});}exports[_0x6690('0x19')]=function(_0x34ab10){var _0x33aa40=this;return new Promise(function(_0x33882c,_0x4375e6){return db[_0x6690('0x1a')][_0x6690('0x1b')]({'raw':_0x34ab10[_0x6690('0x1c')]?_0x34ab10[_0x6690('0x1c')][_0x6690('0x1d')]===undefined?!![]:![]:!![],'where':_0x34ab10[_0x6690('0x1c')]?_0x34ab10[_0x6690('0x1c')][_0x6690('0x1e')]||null:null,'attributes':_0x34ab10[_0x6690('0x1c')]?_0x34ab10[_0x6690('0x1c')]['attributes']||null:null,'limit':_0x34ab10[_0x6690('0x1c')]?_0x34ab10[_0x6690('0x1c')]['limit']||null:null,'include':_0x34ab10[_0x6690('0x1c')]?_0x34ab10['options'][_0x6690('0x1f')]?_['map'](_0x34ab10[_0x6690('0x1c')][_0x6690('0x1f')],function(_0x3de038){return{'model':db[_0x3de038[_0x6690('0x20')]],'as':_0x3de038['as'],'attributes':_0x3de038['attributes'],'include':_0x3de038['include']?_[_0x6690('0x21')](_0x3de038[_0x6690('0x1f')],function(_0x506761){return{'model':db[_0x506761[_0x6690('0x20')]],'as':_0x506761['as'],'attributes':_0x506761['attributes'],'include':_0x506761[_0x6690('0x1f')]?_[_0x6690('0x21')](_0x506761[_0x6690('0x1f')],function(_0x225f93){return{'model':db[_0x225f93[_0x6690('0x20')]],'as':_0x225f93['as'],'attributes':_0x225f93['attributes']};}):[]};}):[]};}):[]:[]})[_0x6690('0x22')](function(_0x1a3846){logger[_0x6690('0x12')](_0x6690('0x19'),_0x34ab10);logger[_0x6690('0x23')](_0x6690('0x19'),_0x34ab10,JSON['stringify'](_0x1a3846));_0x33882c(_0x1a3846);})[_0x6690('0x24')](function(_0x15dcfc){logger['error'](_0x6690('0x19'),_0x15dcfc[_0x6690('0x17')],_0x34ab10);_0x4375e6(_0x33aa40[_0x6690('0x16')](0x1f4,_0x15dcfc[_0x6690('0x17')]));});});};exports[_0x6690('0x25')]=function(_0x359cc1){var _0xd37845=this;return new Promise(function(_0x2d6d88,_0x113a09){return db[_0x6690('0x1a')][_0x6690('0x26')]({'raw':_0x359cc1[_0x6690('0x1c')]?_0x359cc1[_0x6690('0x1c')][_0x6690('0x1d')]===undefined?!![]:![]:!![],'where':_0x359cc1[_0x6690('0x1c')]?_0x359cc1[_0x6690('0x1c')]['where']||null:null,'attributes':_0x359cc1[_0x6690('0x1c')]?_0x359cc1[_0x6690('0x1c')][_0x6690('0x27')]||null:null,'include':_0x359cc1[_0x6690('0x1c')]?_0x359cc1[_0x6690('0x1c')][_0x6690('0x1f')]?_[_0x6690('0x21')](_0x359cc1[_0x6690('0x1c')][_0x6690('0x1f')],function(_0x3d010c){return{'model':db[_0x3d010c[_0x6690('0x20')]],'as':_0x3d010c['as'],'attributes':_0x3d010c['attributes'],'include':_0x3d010c[_0x6690('0x1f')]?_[_0x6690('0x21')](_0x3d010c[_0x6690('0x1f')],function(_0x591ea4){return{'model':db[_0x591ea4[_0x6690('0x20')]],'as':_0x591ea4['as'],'attributes':_0x591ea4[_0x6690('0x27')],'include':_0x591ea4['include']?_[_0x6690('0x21')](_0x591ea4['include'],function(_0x3277de){return{'model':db[_0x3277de[_0x6690('0x20')]],'as':_0x3277de['as'],'attributes':_0x3277de[_0x6690('0x27')]};}):[]};}):[]};}):[]:[]})[_0x6690('0x22')](function(_0x174cb6){logger[_0x6690('0x12')]('ShowOpenchannelQueue',_0x359cc1);logger[_0x6690('0x23')]('ShowOpenchannelQueue',_0x359cc1,JSON[_0x6690('0x15')](_0x174cb6));_0x2d6d88(_0x174cb6);})[_0x6690('0x24')](function(_0x12ad14){logger['error'](_0x6690('0x25'),_0x12ad14[_0x6690('0x17')],_0x359cc1);_0x113a09(_0xd37845[_0x6690('0x16')](0x1f4,_0x12ad14[_0x6690('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index b4a4aee..72dbaa7 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 _0x9fc8=['length','./openchannelQueue.events','save','update','emit','removeListener','register'];(function(_0xf50820,_0x56f041){var _0x2a9b10=function(_0x33f0f4){while(--_0x33f0f4){_0xf50820['push'](_0xf50820['shift']());}};_0x2a9b10(++_0x56f041);}(_0x9fc8,0x120));var _0x89fc=function(_0x4bb1d3,_0x1a2690){_0x4bb1d3=_0x4bb1d3-0x0;var _0x3fb1a7=_0x9fc8[_0x4bb1d3];return _0x3fb1a7;};'use strict';var OpenchannelQueueEvents=require(_0x89fc('0x0'));var events=[_0x89fc('0x1'),'remove',_0x89fc('0x2')];function createListener(_0x423e2c,_0x36209d){return function(_0x237c4a){_0x36209d[_0x89fc('0x3')](_0x423e2c,_0x237c4a);};}function removeListener(_0x58708e,_0x3ee201){return function(){OpenchannelQueueEvents[_0x89fc('0x4')](_0x58708e,_0x3ee201);};}exports[_0x89fc('0x5')]=function(_0x524a45){for(var _0x476952=0x0,_0x498132=events[_0x89fc('0x6')];_0x476952<_0x498132;_0x476952++){var _0x33dfd7=events[_0x476952];var _0x7065e0=createListener('openchannelQueue:'+_0x33dfd7,_0x524a45);OpenchannelQueueEvents['on'](_0x33dfd7,_0x7065e0);}}; \ No newline at end of file +var _0x2d30=['emit','removeListener','register','length','save','update'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0x2d30,0x13c));var _0x02d3=function(_0x483e77,_0x433e9b){_0x483e77=_0x483e77-0x0;var _0x359df0=_0x2d30[_0x483e77];return _0x359df0;};'use strict';var OpenchannelQueueEvents=require('./openchannelQueue.events');var events=[_0x02d3('0x0'),'remove',_0x02d3('0x1')];function createListener(_0x22540e,_0x381142){return function(_0x4396a1){_0x381142[_0x02d3('0x2')](_0x22540e,_0x4396a1);};}function removeListener(_0x3013b0,_0x449931){return function(){OpenchannelQueueEvents[_0x02d3('0x3')](_0x3013b0,_0x449931);};}exports[_0x02d3('0x4')]=function(_0x545656){for(var _0x1d7ab1=0x0,_0x3a3b2c=events[_0x02d3('0x5')];_0x1d7ab1<_0x3a3b2c;_0x1d7ab1++){var _0x46c1b8=events[_0x1d7ab1];var _0x416772=createListener('openchannelQueue:'+_0x46c1b8,_0x545656);OpenchannelQueueEvents['on'](_0x46c1b8,_0x416772);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index 5d18fb2..25edf39 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 _0xc67d=['/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated','describe'];(function(_0x3b05ae,_0x847806){var _0x35b2f1=function(_0x73a33a){while(--_0x73a33a){_0x3b05ae['push'](_0x3b05ae['shift']());}};_0x35b2f1(++_0x847806);}(_0xc67d,0x1ed));var _0xdc67=function(_0x514c6f,_0x419d63){_0x514c6f=_0x514c6f-0x0;var _0x4c0930=_0xc67d[_0x514c6f];return _0x4c0930;};'use strict';var multer=require(_0xdc67('0x0'));var util=require(_0xdc67('0x1'));var path=require(_0xdc67('0x2'));var timeout=require(_0xdc67('0x3'));var express=require(_0xdc67('0x4'));var router=express[_0xdc67('0x5')]();var auth=require(_0xdc67('0x6'));var interaction=require(_0xdc67('0x7'));var config=require('../../config/environment');var controller=require('./openchannelQueueReport.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xdc67('0x8')]);router[_0xdc67('0x9')](_0xdc67('0xa'),auth[_0xdc67('0xb')](),controller[_0xdc67('0xc')]);router['get'](_0xdc67('0xd'),auth[_0xdc67('0xb')](),controller[_0xdc67('0xe')]);router[_0xdc67('0xf')]('/',auth[_0xdc67('0xb')](),controller[_0xdc67('0x10')]);router[_0xdc67('0x11')](_0xdc67('0xd'),auth[_0xdc67('0xb')](),controller[_0xdc67('0x12')]);router[_0xdc67('0x13')](_0xdc67('0xd'),auth[_0xdc67('0xb')](),controller[_0xdc67('0x14')]);module[_0xdc67('0x15')]=router; \ No newline at end of file +var _0x0f50=['isAuthenticated','/describe','describe','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get'];(function(_0x543001,_0x46e6b7){var _0x39ad10=function(_0x108b12){while(--_0x108b12){_0x543001['push'](_0x543001['shift']());}};_0x39ad10(++_0x46e6b7);}(_0x0f50,0x6f));var _0x00f5=function(_0x205466,_0x36873b){_0x205466=_0x205466-0x0;var _0x1d7b25=_0x0f50[_0x205466];return _0x1d7b25;};'use strict';var multer=require('multer');var util=require(_0x00f5('0x0'));var path=require(_0x00f5('0x1'));var timeout=require(_0x00f5('0x2'));var express=require(_0x00f5('0x3'));var router=express[_0x00f5('0x4')]();var auth=require(_0x00f5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x00f5('0x6'));var controller=require(_0x00f5('0x7'));router[_0x00f5('0x8')]('/',auth[_0x00f5('0x9')](),controller['index']);router[_0x00f5('0x8')](_0x00f5('0xa'),auth[_0x00f5('0x9')](),controller[_0x00f5('0xb')]);router[_0x00f5('0x8')](_0x00f5('0xc'),auth[_0x00f5('0x9')](),controller['show']);router[_0x00f5('0xd')]('/',auth[_0x00f5('0x9')](),controller[_0x00f5('0xe')]);router[_0x00f5('0xf')]('/:id',auth[_0x00f5('0x9')](),controller[_0x00f5('0x10')]);router[_0x00f5('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x00f5('0x12')]);module[_0x00f5('0x13')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index c7bf947..01a5fba 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 _0xe217=['exports','STRING','DATE'];(function(_0x249286,_0x50c861){var _0x1e03ac=function(_0x40e91c){while(--_0x40e91c){_0x249286['push'](_0x249286['shift']());}};_0x1e03ac(++_0x50c861);}(_0xe217,0xe1));var _0x7e21=function(_0x2ee990,_0x1e917d){_0x2ee990=_0x2ee990-0x0;var _0xa012ab=_0xe217[_0x2ee990];return _0xa012ab;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x7e21('0x0')]={'uniqueid':{'type':Sequelize[_0x7e21('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x7e21('0x1')]},'joinAt':{'type':Sequelize[_0x7e21('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0x7e21('0x2')]},'reason':{'type':Sequelize[_0x7e21('0x1')]}}; \ No newline at end of file +var _0xaff7=['STRING','DATE','moment','exports'];(function(_0x2aeb6f,_0x38a4f3){var _0x29154d=function(_0x237419){while(--_0x237419){_0x2aeb6f['push'](_0x2aeb6f['shift']());}};_0x29154d(++_0x38a4f3);}(_0xaff7,0x136));var _0x7aff=function(_0x2bf5bd,_0x120787){_0x2bf5bd=_0x2bf5bd-0x0;var _0xc810c0=_0xaff7[_0x2bf5bd];return _0xc810c0;};'use strict';var moment=require(_0x7aff('0x0'));var Sequelize=require('sequelize');module[_0x7aff('0x1')]={'uniqueid':{'type':Sequelize[_0x7aff('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7aff('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x7aff('0x3')]},'acceptAt':{'type':Sequelize[_0x7aff('0x3')]},'exitAt':{'type':Sequelize[_0x7aff('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index a9d2cc8..85e0cee 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 _0x73a1=['crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','limit','Content-Range','apply','reject','save','update','destroy','then','end','error','stack','name','send','map','OpenchannelQueueReport','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','nolimit','offset','order','sort','where','pick','filter','type','merge','options','count','includeAll','include','findAll','rows','catch','show','params','find','create','body','describe','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel'];(function(_0x1db766,_0x35c2e9){var _0x4def9e=function(_0x578c04){while(--_0x578c04){_0x1db766['push'](_0x1db766['shift']());}};_0x4def9e(++_0x35c2e9);}(_0x73a1,0x161));var _0x173a=function(_0x591a90,_0x5525b0){_0x591a90=_0x591a90-0x0;var _0x551587=_0x73a1[_0x591a90];return _0x551587;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x173a('0x0'));var zipdir=require(_0x173a('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x173a('0x2'));var moment=require(_0x173a('0x3'));var BPromise=require(_0x173a('0x4'));var Mustache=require(_0x173a('0x5'));var util=require(_0x173a('0x6'));var path=require('path');var sox=require(_0x173a('0x7'));var csv=require(_0x173a('0x8'));var ejs=require(_0x173a('0x9'));var fs=require('fs');var _=require(_0x173a('0xa'));var squel=require(_0x173a('0xb'));var crypto=require(_0x173a('0xc'));var jsforce=require(_0x173a('0xd'));var deskjs=require(_0x173a('0xe'));var toCsv=require(_0x173a('0x8'));var querystring=require(_0x173a('0xf'));var Papa=require(_0x173a('0x10'));var Redis=require(_0x173a('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x173a('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x173a('0x13'));var logger=require(_0x173a('0x14'))(_0x173a('0x15'));var utils=require(_0x173a('0x16'));var config=require('../../config/environment');var db=require(_0x173a('0x17'))['db'];function respondWithStatusCode(_0x53bfd0,_0x28b560){_0x28b560=_0x28b560||0xcc;return function(_0x540cfd){if(_0x540cfd){return _0x53bfd0[_0x173a('0x18')](_0x28b560);}return _0x53bfd0[_0x173a('0x19')](_0x28b560)['end']();};}function respondWithResult(_0x1cbfdc,_0x3d49ea){_0x3d49ea=_0x3d49ea||0xc8;return function(_0x17f38e){if(_0x17f38e){return _0x1cbfdc[_0x173a('0x19')](_0x3d49ea)[_0x173a('0x1a')](_0x17f38e);}};}function respondWithFilteredResult(_0x410dfc,_0x69fe68){return function(_0x309879){if(_0x309879){var _0x5e4252=_0x309879['count'],_0xb8e6b=_0x69fe68['offset'],_0x3bcc3a=_0x69fe68['offset']+_0x69fe68[_0x173a('0x1b')],_0x19c5fc;if(_0x3bcc3a>=_0x5e4252){_0x3bcc3a=_0x5e4252;_0x19c5fc=0xc8;}else{_0x19c5fc=0xce;}_0x410dfc['status'](_0x19c5fc);return _0x410dfc['set'](_0x173a('0x1c'),_0xb8e6b+'-'+_0x3bcc3a+'/'+_0x5e4252)[_0x173a('0x1a')](_0x309879);}return null;};}function patchUpdates(_0x54985d){return function(_0x2d1a42){try{jsonpatch[_0x173a('0x1d')](_0x2d1a42,_0x54985d,!![]);}catch(_0x44eec5){return BPromise[_0x173a('0x1e')](_0x44eec5);}return _0x2d1a42[_0x173a('0x1f')]();};}function saveUpdates(_0x2ff5eb,_0x47b362){return function(_0xa58b66){if(_0xa58b66){return _0xa58b66[_0x173a('0x20')](_0x2ff5eb)['then'](function(_0x23de65){return _0x23de65;});}return null;};}function removeEntity(_0x4f45e1,_0x4a46bb){return function(_0x457f9d){if(_0x457f9d){return _0x457f9d[_0x173a('0x21')]()[_0x173a('0x22')](function(){_0x4f45e1['status'](0xcc)[_0x173a('0x23')]();});}};}function handleEntityNotFound(_0x3207ef,_0x2a7f65){return function(_0xe5334){if(!_0xe5334){_0x3207ef[_0x173a('0x18')](0x194);}return _0xe5334;};}function handleError(_0xa4d402,_0x582f6b){_0x582f6b=_0x582f6b||0x1f4;return function(_0x4b3bfc){logger[_0x173a('0x24')](_0x4b3bfc[_0x173a('0x25')]);if(_0x4b3bfc[_0x173a('0x26')]){delete _0x4b3bfc[_0x173a('0x26')];}_0xa4d402[_0x173a('0x19')](_0x582f6b)[_0x173a('0x27')](_0x4b3bfc);};}exports['index']=function(_0x4785b7,_0x4106ac){var _0x469646={},_0x451695={},_0x15b98e={'count':0x0,'rows':[]};var _0x313821=_[_0x173a('0x28')](db[_0x173a('0x29')][_0x173a('0x2a')],function(_0x456551){return{'name':_0x456551['fieldName'],'type':_0x456551['type']['key']};});_0x451695[_0x173a('0x2b')]=_[_0x173a('0x28')](_0x313821,_0x173a('0x26'));_0x451695[_0x173a('0x2c')]=_[_0x173a('0x2d')](_0x4785b7['query']);_0x451695[_0x173a('0x2e')]=_[_0x173a('0x2f')](_0x451695['model'],_0x451695[_0x173a('0x2c')]);_0x469646[_0x173a('0x30')]=_[_0x173a('0x2f')](_0x451695['model'],qs[_0x173a('0x31')](_0x4785b7['query'][_0x173a('0x31')]));_0x469646['attributes']=_0x469646['attributes'][_0x173a('0x32')]?_0x469646[_0x173a('0x30')]:_0x451695[_0x173a('0x2b')];if(!_0x4785b7[_0x173a('0x2c')]['hasOwnProperty'](_0x173a('0x33'))){_0x469646[_0x173a('0x1b')]=qs['limit'](_0x4785b7[_0x173a('0x2c')]['limit']);_0x469646[_0x173a('0x34')]=qs[_0x173a('0x34')](_0x4785b7[_0x173a('0x2c')][_0x173a('0x34')]);}_0x469646[_0x173a('0x35')]=qs[_0x173a('0x36')](_0x4785b7[_0x173a('0x2c')]['sort']);_0x469646[_0x173a('0x37')]=qs[_0x173a('0x2e')](_[_0x173a('0x38')](_0x4785b7[_0x173a('0x2c')],_0x451695['filters']));if(_0x4785b7[_0x173a('0x2c')][_0x173a('0x39')]){_0x469646[_0x173a('0x37')]=_['merge'](_0x469646[_0x173a('0x37')],{'$or':_[_0x173a('0x28')](_0x313821,function(_0x141d3f){if(_0x141d3f[_0x173a('0x3a')]!=='VIRTUAL'){var _0x47d0c2={};_0x47d0c2[_0x141d3f[_0x173a('0x26')]]={'$like':'%'+_0x4785b7[_0x173a('0x2c')][_0x173a('0x39')]+'%'};return _0x47d0c2;}})});}_0x469646=_[_0x173a('0x3b')]({},_0x469646,_0x4785b7[_0x173a('0x3c')]);var _0x1ed5e3={'where':_0x469646[_0x173a('0x37')]};return db[_0x173a('0x29')]['count'](_0x1ed5e3)[_0x173a('0x22')](function(_0x2cae2f){_0x15b98e[_0x173a('0x3d')]=_0x2cae2f;if(_0x4785b7[_0x173a('0x2c')][_0x173a('0x3e')]){_0x469646[_0x173a('0x3f')]=[{'all':!![]}];}return db[_0x173a('0x29')][_0x173a('0x40')](_0x469646);})[_0x173a('0x22')](function(_0x3097bd){_0x15b98e[_0x173a('0x41')]=_0x3097bd;return _0x15b98e;})[_0x173a('0x22')](respondWithFilteredResult(_0x4106ac,_0x469646))[_0x173a('0x42')](handleError(_0x4106ac,null));};exports[_0x173a('0x43')]=function(_0x47cb7b,_0x18b907){var _0x508e9b={'raw':!![],'where':{'id':_0x47cb7b[_0x173a('0x44')]['id']}},_0x6dce32={};_0x6dce32['model']=_['keys'](db[_0x173a('0x29')]['rawAttributes']);_0x6dce32[_0x173a('0x2c')]=_[_0x173a('0x2d')](_0x47cb7b[_0x173a('0x2c')]);_0x6dce32['filters']=_[_0x173a('0x2f')](_0x6dce32[_0x173a('0x2b')],_0x6dce32[_0x173a('0x2c')]);_0x508e9b['attributes']=_[_0x173a('0x2f')](_0x6dce32[_0x173a('0x2b')],qs[_0x173a('0x31')](_0x47cb7b['query'][_0x173a('0x31')]));_0x508e9b[_0x173a('0x30')]=_0x508e9b['attributes'][_0x173a('0x32')]?_0x508e9b[_0x173a('0x30')]:_0x6dce32['model'];if(_0x47cb7b[_0x173a('0x2c')]['includeAll']){_0x508e9b[_0x173a('0x3f')]=[{'all':!![]}];}_0x508e9b=_['merge']({},_0x508e9b,_0x47cb7b[_0x173a('0x3c')]);return db[_0x173a('0x29')][_0x173a('0x45')](_0x508e9b)[_0x173a('0x22')](handleEntityNotFound(_0x18b907,null))['then'](respondWithResult(_0x18b907,null))[_0x173a('0x42')](handleError(_0x18b907,null));};exports[_0x173a('0x46')]=function(_0x1958b8,_0x20f574){return db[_0x173a('0x29')][_0x173a('0x46')](_0x1958b8[_0x173a('0x47')],{})['then'](respondWithResult(_0x20f574,0xc9))[_0x173a('0x42')](handleError(_0x20f574,null));};exports['update']=function(_0x103c98,_0x1bfe60){if(_0x103c98[_0x173a('0x47')]['id']){delete _0x103c98[_0x173a('0x47')]['id'];}return db['OpenchannelQueueReport']['find']({'where':{'id':_0x103c98[_0x173a('0x44')]['id']}})[_0x173a('0x22')](handleEntityNotFound(_0x1bfe60,null))[_0x173a('0x22')](saveUpdates(_0x103c98[_0x173a('0x47')],null))[_0x173a('0x22')](respondWithResult(_0x1bfe60,null))[_0x173a('0x42')](handleError(_0x1bfe60,null));};exports[_0x173a('0x21')]=function(_0x3c93e1,_0x156835){return db[_0x173a('0x29')][_0x173a('0x45')]({'where':{'id':_0x3c93e1[_0x173a('0x44')]['id']}})[_0x173a('0x22')](handleEntityNotFound(_0x156835,null))['then'](removeEntity(_0x156835,null))['catch'](handleError(_0x156835,null));};exports['describe']=function(_0x2a5a99,_0x365371){return db[_0x173a('0x29')][_0x173a('0x48')]()['then'](respondWithResult(_0x365371,null))[_0x173a('0x42')](handleError(_0x365371,null));}; \ No newline at end of file +var _0x1c3d=['ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','send','map','fieldName','type','key','model','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','options','OpenchannelQueueReport','includeAll','include','findAll','rows','show','keys','rawAttributes','find','create','catch','body','params','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv'];(function(_0x1be5d4,_0x10aa38){var _0x357c10=function(_0xe80a70){while(--_0xe80a70){_0x1be5d4['push'](_0x1be5d4['shift']());}};_0x357c10(++_0x10aa38);}(_0x1c3d,0x1b8));var _0xd1c3=function(_0x514a08,_0x28a8c7){_0x514a08=_0x514a08-0x0;var _0x8da53a=_0x1c3d[_0x514a08];return _0x8da53a;};'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 Redis=require(_0xd1c3('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xd1c3('0x11'));var hardwareService=require(_0xd1c3('0x12'));var logger=require(_0xd1c3('0x13'))(_0xd1c3('0x14'));var utils=require(_0xd1c3('0x15'));var config=require(_0xd1c3('0x16'));var db=require(_0xd1c3('0x17'))['db'];function respondWithStatusCode(_0x280405,_0x159691){_0x159691=_0x159691||0xcc;return function(_0x489c34){if(_0x489c34){return _0x280405[_0xd1c3('0x18')](_0x159691);}return _0x280405['status'](_0x159691)['end']();};}function respondWithResult(_0x11d1f3,_0x57a55e){_0x57a55e=_0x57a55e||0xc8;return function(_0x2403c8){if(_0x2403c8){return _0x11d1f3[_0xd1c3('0x19')](_0x57a55e)[_0xd1c3('0x1a')](_0x2403c8);}};}function respondWithFilteredResult(_0x52e7bc,_0xaaa259){return function(_0x4230f7){if(_0x4230f7){var _0x127067=_0x4230f7[_0xd1c3('0x1b')],_0x3bc2b=_0xaaa259[_0xd1c3('0x1c')],_0x42ba11=_0xaaa259[_0xd1c3('0x1c')]+_0xaaa259[_0xd1c3('0x1d')],_0xb5af75;if(_0x42ba11>=_0x127067){_0x42ba11=_0x127067;_0xb5af75=0xc8;}else{_0xb5af75=0xce;}_0x52e7bc['status'](_0xb5af75);return _0x52e7bc['set'](_0xd1c3('0x1e'),_0x3bc2b+'-'+_0x42ba11+'/'+_0x127067)[_0xd1c3('0x1a')](_0x4230f7);}return null;};}function patchUpdates(_0x3f1df3){return function(_0x54a450){try{jsonpatch[_0xd1c3('0x1f')](_0x54a450,_0x3f1df3,!![]);}catch(_0x4b0a45){return BPromise[_0xd1c3('0x20')](_0x4b0a45);}return _0x54a450[_0xd1c3('0x21')]();};}function saveUpdates(_0x1dcb29,_0x588f4e){return function(_0x4b3efc){if(_0x4b3efc){return _0x4b3efc[_0xd1c3('0x22')](_0x1dcb29)[_0xd1c3('0x23')](function(_0x4f8277){return _0x4f8277;});}return null;};}function removeEntity(_0x4b2f00,_0x1b5732){return function(_0xc45d5d){if(_0xc45d5d){return _0xc45d5d[_0xd1c3('0x24')]()[_0xd1c3('0x23')](function(){_0x4b2f00[_0xd1c3('0x19')](0xcc)[_0xd1c3('0x25')]();});}};}function handleEntityNotFound(_0x137fd5,_0xaa7580){return function(_0x33c380){if(!_0x33c380){_0x137fd5[_0xd1c3('0x18')](0x194);}return _0x33c380;};}function handleError(_0x5a9d5d,_0x56091a){_0x56091a=_0x56091a||0x1f4;return function(_0x28f039){logger[_0xd1c3('0x26')](_0x28f039[_0xd1c3('0x27')]);if(_0x28f039[_0xd1c3('0x28')]){delete _0x28f039['name'];}_0x5a9d5d[_0xd1c3('0x19')](_0x56091a)[_0xd1c3('0x29')](_0x28f039);};}exports['index']=function(_0xcb5283,_0x3f5206){var _0x6f912b={},_0x173cb9={},_0x10be91={'count':0x0,'rows':[]};var _0x423f84=_[_0xd1c3('0x2a')](db['OpenchannelQueueReport']['rawAttributes'],function(_0x564ca2){return{'name':_0x564ca2[_0xd1c3('0x2b')],'type':_0x564ca2[_0xd1c3('0x2c')][_0xd1c3('0x2d')]};});_0x173cb9[_0xd1c3('0x2e')]=_['map'](_0x423f84,_0xd1c3('0x28'));_0x173cb9[_0xd1c3('0x2f')]=_['keys'](_0xcb5283[_0xd1c3('0x2f')]);_0x173cb9['filters']=_[_0xd1c3('0x30')](_0x173cb9[_0xd1c3('0x2e')],_0x173cb9[_0xd1c3('0x2f')]);_0x6f912b[_0xd1c3('0x31')]=_[_0xd1c3('0x30')](_0x173cb9[_0xd1c3('0x2e')],qs[_0xd1c3('0x32')](_0xcb5283[_0xd1c3('0x2f')][_0xd1c3('0x32')]));_0x6f912b['attributes']=_0x6f912b[_0xd1c3('0x31')][_0xd1c3('0x33')]?_0x6f912b['attributes']:_0x173cb9[_0xd1c3('0x2e')];if(!_0xcb5283['query'][_0xd1c3('0x34')](_0xd1c3('0x35'))){_0x6f912b[_0xd1c3('0x1d')]=qs['limit'](_0xcb5283[_0xd1c3('0x2f')][_0xd1c3('0x1d')]);_0x6f912b[_0xd1c3('0x1c')]=qs[_0xd1c3('0x1c')](_0xcb5283[_0xd1c3('0x2f')][_0xd1c3('0x1c')]);}_0x6f912b[_0xd1c3('0x36')]=qs[_0xd1c3('0x37')](_0xcb5283[_0xd1c3('0x2f')]['sort']);_0x6f912b['where']=qs[_0xd1c3('0x38')](_['pick'](_0xcb5283[_0xd1c3('0x2f')],_0x173cb9[_0xd1c3('0x38')]));if(_0xcb5283[_0xd1c3('0x2f')][_0xd1c3('0x39')]){_0x6f912b[_0xd1c3('0x3a')]=_[_0xd1c3('0x3b')](_0x6f912b['where'],{'$or':_[_0xd1c3('0x2a')](_0x423f84,function(_0x54b77a){if(_0x54b77a[_0xd1c3('0x2c')]!=='VIRTUAL'){var _0x292a57={};_0x292a57[_0x54b77a['name']]={'$like':'%'+_0xcb5283['query'][_0xd1c3('0x39')]+'%'};return _0x292a57;}})});}_0x6f912b=_[_0xd1c3('0x3b')]({},_0x6f912b,_0xcb5283[_0xd1c3('0x3c')]);var _0x57b57f={'where':_0x6f912b[_0xd1c3('0x3a')]};return db[_0xd1c3('0x3d')][_0xd1c3('0x1b')](_0x57b57f)['then'](function(_0x222bf3){_0x10be91[_0xd1c3('0x1b')]=_0x222bf3;if(_0xcb5283[_0xd1c3('0x2f')][_0xd1c3('0x3e')]){_0x6f912b[_0xd1c3('0x3f')]=[{'all':!![]}];}return db[_0xd1c3('0x3d')][_0xd1c3('0x40')](_0x6f912b);})['then'](function(_0x20c891){_0x10be91[_0xd1c3('0x41')]=_0x20c891;return _0x10be91;})['then'](respondWithFilteredResult(_0x3f5206,_0x6f912b))['catch'](handleError(_0x3f5206,null));};exports[_0xd1c3('0x42')]=function(_0x2ca2b3,_0x46d374){var _0x426e1d={'raw':!![],'where':{'id':_0x2ca2b3['params']['id']}},_0x1c7bb6={};_0x1c7bb6[_0xd1c3('0x2e')]=_[_0xd1c3('0x43')](db[_0xd1c3('0x3d')][_0xd1c3('0x44')]);_0x1c7bb6[_0xd1c3('0x2f')]=_[_0xd1c3('0x43')](_0x2ca2b3[_0xd1c3('0x2f')]);_0x1c7bb6[_0xd1c3('0x38')]=_[_0xd1c3('0x30')](_0x1c7bb6[_0xd1c3('0x2e')],_0x1c7bb6['query']);_0x426e1d[_0xd1c3('0x31')]=_['intersection'](_0x1c7bb6[_0xd1c3('0x2e')],qs[_0xd1c3('0x32')](_0x2ca2b3[_0xd1c3('0x2f')]['fields']));_0x426e1d[_0xd1c3('0x31')]=_0x426e1d[_0xd1c3('0x31')][_0xd1c3('0x33')]?_0x426e1d[_0xd1c3('0x31')]:_0x1c7bb6[_0xd1c3('0x2e')];if(_0x2ca2b3['query']['includeAll']){_0x426e1d[_0xd1c3('0x3f')]=[{'all':!![]}];}_0x426e1d=_['merge']({},_0x426e1d,_0x2ca2b3[_0xd1c3('0x3c')]);return db[_0xd1c3('0x3d')][_0xd1c3('0x45')](_0x426e1d)[_0xd1c3('0x23')](handleEntityNotFound(_0x46d374,null))['then'](respondWithResult(_0x46d374,null))['catch'](handleError(_0x46d374,null));};exports[_0xd1c3('0x46')]=function(_0x227078,_0x375bd5){return db['OpenchannelQueueReport'][_0xd1c3('0x46')](_0x227078['body'],{})[_0xd1c3('0x23')](respondWithResult(_0x375bd5,0xc9))[_0xd1c3('0x47')](handleError(_0x375bd5,null));};exports[_0xd1c3('0x22')]=function(_0x163406,_0x5ae29b){if(_0x163406['body']['id']){delete _0x163406[_0xd1c3('0x48')]['id'];}return db[_0xd1c3('0x3d')][_0xd1c3('0x45')]({'where':{'id':_0x163406[_0xd1c3('0x49')]['id']}})[_0xd1c3('0x23')](handleEntityNotFound(_0x5ae29b,null))[_0xd1c3('0x23')](saveUpdates(_0x163406[_0xd1c3('0x48')],null))[_0xd1c3('0x23')](respondWithResult(_0x5ae29b,null))['catch'](handleError(_0x5ae29b,null));};exports[_0xd1c3('0x24')]=function(_0xdfdf4d,_0x453441){return db[_0xd1c3('0x3d')][_0xd1c3('0x45')]({'where':{'id':_0xdfdf4d['params']['id']}})['then'](handleEntityNotFound(_0x453441,null))[_0xd1c3('0x23')](removeEntity(_0x453441,null))['catch'](handleError(_0x453441,null));};exports[_0xd1c3('0x4a')]=function(_0x29691e,_0x1d643a){return db['OpenchannelQueueReport'][_0xd1c3('0x4a')]()[_0xd1c3('0x23')](respondWithResult(_0x1d643a,null))[_0xd1c3('0x47')](handleError(_0x1d643a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index edf4d71..8e4a1d0 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 _0x2123=['bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','uniqueid','lodash','util','../../config/logger','api','moment'];(function(_0x1c16f2,_0x39b4c7){var _0x84dd64=function(_0x45d5cd){while(--_0x45d5cd){_0x1c16f2['push'](_0x1c16f2['shift']());}};_0x84dd64(++_0x39b4c7);}(_0x2123,0x190));var _0x3212=function(_0x32b273,_0x162394){_0x32b273=_0x32b273-0x0;var _0x1c8901=_0x2123[_0x32b273];return _0x1c8901;};'use strict';var _=require(_0x3212('0x0'));var util=require(_0x3212('0x1'));var logger=require(_0x3212('0x2'))(_0x3212('0x3'));var moment=require(_0x3212('0x4'));var BPromise=require(_0x3212('0x5'));var rp=require(_0x3212('0x6'));var fs=require('fs');var path=require(_0x3212('0x7'));var rimraf=require(_0x3212('0x8'));var config=require(_0x3212('0x9'));var attributes=require(_0x3212('0xa'));module[_0x3212('0xb')]=function(_0x5d9d36,_0x3859e4){return _0x5d9d36[_0x3212('0xc')](_0x3212('0xd'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0x3212('0xe'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe50a=['../../config/logger','moment','request-promise','path','../../config/environment','./openchannelQueueReport.attributes','exports','OpenchannelQueueReport','uniqueid','lodash','util'];(function(_0x1ad289,_0x1b898f){var _0x420176=function(_0x342f3e){while(--_0x342f3e){_0x1ad289['push'](_0x1ad289['shift']());}};_0x420176(++_0x1b898f);}(_0xe50a,0xf0));var _0xae50=function(_0x4e1d03,_0x786f3a){_0x4e1d03=_0x4e1d03-0x0;var _0x362d4b=_0xe50a[_0x4e1d03];return _0x362d4b;};'use strict';var _=require(_0xae50('0x0'));var util=require(_0xae50('0x1'));var logger=require(_0xae50('0x2'))('api');var moment=require(_0xae50('0x3'));var BPromise=require('bluebird');var rp=require(_0xae50('0x4'));var fs=require('fs');var path=require(_0xae50('0x5'));var rimraf=require('rimraf');var config=require(_0xae50('0x6'));var attributes=require(_0xae50('0x7'));module[_0xae50('0x8')]=function(_0x536668,_0x16481a){return _0x536668['define'](_0xae50('0x9'),attributes,{'tableName':'report_openchannel_queue','paranoid':![],'indexes':[{'name':_0xae50('0xa'),'fields':[_0xae50('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 577f5ed..b5ba7dc 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 _0x55c3=['info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateOpenchannelQueueReport','options','raw','OpenchannelQueueReport','update','body','where','limit','UpdateOpenchannelQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0xf7e858,_0x19832f){var _0x26f144=function(_0x18fcfa){while(--_0x18fcfa){_0xf7e858['push'](_0xf7e858['shift']());}};_0x26f144(++_0x19832f);}(_0x55c3,0x189));var _0x355c=function(_0x33ae38,_0xd2d288){_0x33ae38=_0x33ae38-0x0;var _0x160a54=_0x55c3[_0x33ae38];return _0x160a54;};'use strict';var _=require('lodash');var util=require(_0x355c('0x0'));var moment=require(_0x355c('0x1'));var BPromise=require(_0x355c('0x2'));var rs=require(_0x355c('0x3'));var fs=require('fs');var Redis=require(_0x355c('0x4'));var db=require(_0x355c('0x5'))['db'];var utils=require(_0x355c('0x6'));var logger=require(_0x355c('0x7'))(_0x355c('0x8'));var config=require(_0x355c('0x9'));var jayson=require(_0x355c('0xa'));var client=jayson[_0x355c('0xb')][_0x355c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x167fb1,_0x4cd7f0,_0x567edb){return new BPromise(function(_0x3fe34b,_0x248f02){return client[_0x355c('0xd')](_0x167fb1,_0x567edb)[_0x355c('0xe')](function(_0x40ead2){logger[_0x355c('0xf')](_0x355c('0x10'),_0x4cd7f0,_0x355c('0x11'));logger[_0x355c('0x12')](_0x355c('0x13'),_0x4cd7f0,_0x355c('0x11'),JSON[_0x355c('0x14')](_0x40ead2));if(_0x40ead2[_0x355c('0x15')]){if(_0x40ead2[_0x355c('0x15')]['code']===0x1f4){logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x40ead2['error'][_0x355c('0x16')]);return _0x248f02(_0x40ead2['error'][_0x355c('0x16')]);}logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x40ead2[_0x355c('0x15')]['message']);return _0x3fe34b(_0x40ead2[_0x355c('0x15')]['message']);}else{logger['info'](_0x355c('0x10'),_0x4cd7f0,_0x355c('0x11'));_0x3fe34b(_0x40ead2[_0x355c('0x17')][_0x355c('0x16')]);}})[_0x355c('0x18')](function(_0x25369a){logger[_0x355c('0x15')](_0x355c('0x10'),_0x4cd7f0,_0x25369a);_0x248f02(_0x25369a);});});}exports[_0x355c('0x19')]=function(_0x559577){var _0xc051c7=this;return new Promise(function(_0x2610c5,_0x537586){return db['OpenchannelQueueReport']['create'](_0x559577['body'],{'raw':_0x559577[_0x355c('0x1a')]?_0x559577[_0x355c('0x1a')][_0x355c('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x42323a){logger[_0x355c('0xf')](_0x355c('0x19'),_0x559577);logger[_0x355c('0x12')](_0x355c('0x19'),_0x559577,JSON[_0x355c('0x14')](_0x42323a));_0x2610c5(_0x42323a);})[_0x355c('0x18')](function(_0x363257){logger['error']('CreateOpenchannelQueueReport',_0x363257[_0x355c('0x16')],_0x559577);_0x537586(_0xc051c7[_0x355c('0x15')](0x1f4,_0x363257[_0x355c('0x16')]));});});};exports['UpdateOpenchannelQueueReport']=function(_0x26fd36){var _0x535e10=this;return new Promise(function(_0x3be2fa,_0x285c0b){return db[_0x355c('0x1c')][_0x355c('0x1d')](_0x26fd36[_0x355c('0x1e')],{'raw':_0x26fd36['options']?_0x26fd36[_0x355c('0x1a')][_0x355c('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26fd36[_0x355c('0x1a')]?_0x26fd36[_0x355c('0x1a')][_0x355c('0x1f')]||null:null,'attributes':_0x26fd36['options']?_0x26fd36[_0x355c('0x1a')]['attributes']||null:null,'limit':_0x26fd36[_0x355c('0x1a')]?_0x26fd36[_0x355c('0x1a')][_0x355c('0x20')]||null:null})[_0x355c('0xe')](function(_0x213289){logger[_0x355c('0xf')](_0x355c('0x21'),_0x26fd36);logger['debug'](_0x355c('0x21'),_0x26fd36,JSON[_0x355c('0x14')](_0x213289));_0x3be2fa(_0x213289);})[_0x355c('0x18')](function(_0x34eb79){logger[_0x355c('0x15')](_0x355c('0x21'),_0x34eb79[_0x355c('0x16')],_0x26fd36);_0x285c0b(_0x535e10[_0x355c('0x15')](0x1f4,_0x34eb79['message']));});});}; \ No newline at end of file +var _0x1a38=['UpdateOpenchannelQueueReport','update','raw','where','attributes','limit','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','OpenchannelQueueReport','create','body','options','CreateOpenchannelQueueReport','debug'];(function(_0x251776,_0xdac21e){var _0x182457=function(_0x6986e6){while(--_0x6986e6){_0x251776['push'](_0x251776['shift']());}};_0x182457(++_0xdac21e);}(_0x1a38,0xb0));var _0x81a3=function(_0x1406ae,_0x292395){_0x1406ae=_0x1406ae-0x0;var _0x23a076=_0x1a38[_0x1406ae];return _0x23a076;};'use strict';var _=require(_0x81a3('0x0'));var util=require(_0x81a3('0x1'));var moment=require(_0x81a3('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x81a3('0x3'))['db'];var utils=require(_0x81a3('0x4'));var logger=require(_0x81a3('0x5'))(_0x81a3('0x6'));var config=require(_0x81a3('0x7'));var jayson=require(_0x81a3('0x8'));var client=jayson[_0x81a3('0x9')][_0x81a3('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3153ee,_0x2d331e,_0x207345){return new BPromise(function(_0xe10e0a,_0x3be616){return client['request'](_0x3153ee,_0x207345)[_0x81a3('0xb')](function(_0x252685){logger[_0x81a3('0xc')](_0x81a3('0xd'),_0x2d331e,_0x81a3('0xe'));logger['debug'](_0x81a3('0xf'),_0x2d331e,_0x81a3('0xe'),JSON[_0x81a3('0x10')](_0x252685));if(_0x252685['error']){if(_0x252685['error'][_0x81a3('0x11')]===0x1f4){logger[_0x81a3('0x12')](_0x81a3('0xd'),_0x2d331e,_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);return _0x3be616(_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);}logger[_0x81a3('0x12')](_0x81a3('0xd'),_0x2d331e,_0x252685[_0x81a3('0x12')][_0x81a3('0x13')]);return _0xe10e0a(_0x252685[_0x81a3('0x12')]['message']);}else{logger[_0x81a3('0xc')](_0x81a3('0xd'),_0x2d331e,_0x81a3('0xe'));_0xe10e0a(_0x252685[_0x81a3('0x14')]['message']);}})[_0x81a3('0x15')](function(_0x18fc8d){logger['error'](_0x81a3('0xd'),_0x2d331e,_0x18fc8d);_0x3be616(_0x18fc8d);});});}exports['CreateOpenchannelQueueReport']=function(_0x4d4b86){var _0x984158=this;return new Promise(function(_0x1cd821,_0x8422ee){return db[_0x81a3('0x16')][_0x81a3('0x17')](_0x4d4b86[_0x81a3('0x18')],{'raw':_0x4d4b86[_0x81a3('0x19')]?_0x4d4b86[_0x81a3('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x81a3('0xb')](function(_0x324706){logger['info'](_0x81a3('0x1a'),_0x4d4b86);logger[_0x81a3('0x1b')](_0x81a3('0x1a'),_0x4d4b86,JSON[_0x81a3('0x10')](_0x324706));_0x1cd821(_0x324706);})['catch'](function(_0x316d48){logger[_0x81a3('0x12')](_0x81a3('0x1a'),_0x316d48['message'],_0x4d4b86);_0x8422ee(_0x984158['error'](0x1f4,_0x316d48[_0x81a3('0x13')]));});});};exports[_0x81a3('0x1c')]=function(_0x19d2e1){var _0x40aaec=this;return new Promise(function(_0x4b6ae6,_0x57dcca){return db['OpenchannelQueueReport'][_0x81a3('0x1d')](_0x19d2e1[_0x81a3('0x18')],{'raw':_0x19d2e1[_0x81a3('0x19')]?_0x19d2e1[_0x81a3('0x19')][_0x81a3('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x19d2e1[_0x81a3('0x19')]?_0x19d2e1[_0x81a3('0x19')][_0x81a3('0x1f')]||null:null,'attributes':_0x19d2e1[_0x81a3('0x19')]?_0x19d2e1[_0x81a3('0x19')][_0x81a3('0x20')]||null:null,'limit':_0x19d2e1[_0x81a3('0x19')]?_0x19d2e1['options'][_0x81a3('0x21')]||null:null})[_0x81a3('0xb')](function(_0x398213){logger['info']('UpdateOpenchannelQueueReport',_0x19d2e1);logger[_0x81a3('0x1b')](_0x81a3('0x1c'),_0x19d2e1,JSON['stringify'](_0x398213));_0x4b6ae6(_0x398213);})['catch'](function(_0x515aff){logger[_0x81a3('0x12')](_0x81a3('0x1c'),_0x515aff[_0x81a3('0x13')],_0x19d2e1);_0x57dcca(_0x40aaec[_0x81a3('0x12')](0x1f4,_0x515aff[_0x81a3('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index 819a91d..6c46f1b 100644 --- a/server/api/openchannelTransferReport/index.js +++ b/server/api/openchannelTransferReport/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x3826ad,_0x49a30d){var _0x17b900=function(_0x38474f){while(--_0x38474f){_0x3826ad['push'](_0x3826ad['shift']());}};_0x17b900(++_0x49a30d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbe200f,_0x4b50eb){_0xbe200f=_0xbe200f-0x0;var _0x192597=_0xa9e0[_0xbe200f];return _0x192597;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1b349a,_0x22222c){_0x1b349a=_0x1b349a-0x0;var _0x5d1f7c=_0xa9e0[_0x1b349a];return _0x5d1f7c;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index b694d83..9066511 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 _0x2931=['queue','DATE','moment','sequelize','exports','STRING','ENUM','account'];(function(_0x51f30d,_0x503325){var _0x4b7395=function(_0x21a724){while(--_0x21a724){_0x51f30d['push'](_0x51f30d['shift']());}};_0x4b7395(++_0x503325);}(_0x2931,0xa2));var _0x1293=function(_0x3cef5b,_0x26a552){_0x3cef5b=_0x3cef5b-0x0;var _0x71a978=_0x2931[_0x3cef5b];return _0x71a978;};'use strict';var moment=require(_0x1293('0x0'));var Sequelize=require(_0x1293('0x1'));module[_0x1293('0x2')]={'uniqueid':{'type':Sequelize[_0x1293('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x1293('0x4')](_0x1293('0x5'),'agent',_0x1293('0x6')),'allowNull':![],'defaultValue':_0x1293('0x6')},'transferredAt':{'type':Sequelize[_0x1293('0x7')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xb562=['moment','sequelize','exports','agent','queue','NOW'];(function(_0x3bc1b6,_0x91a3c7){var _0x300781=function(_0x422fae){while(--_0x422fae){_0x3bc1b6['push'](_0x3bc1b6['shift']());}};_0x300781(++_0x91a3c7);}(_0xb562,0x102));var _0x2b56=function(_0x22f08b,_0x208b7e){_0x22f08b=_0x22f08b-0x0;var _0x704024=_0xb562[_0x22f08b];return _0x704024;};'use strict';var moment=require(_0x2b56('0x0'));var Sequelize=require(_0x2b56('0x1'));module[_0x2b56('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize['ENUM']('account',_0x2b56('0x3'),_0x2b56('0x4')),'allowNull':![],'defaultValue':_0x2b56('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x2b56('0x5')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index fe2e786..8e302a3 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 _0x28d9=['create','body','find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','reject','save','update','destroy','then','stack','name','send','index','map','OpenchannelTransferReport','fieldName','type','key','model','query','keys','filters','attributes','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','intersection','fields','catch'];(function(_0x2e92cd,_0x284773){var _0x586283=function(_0x37180f){while(--_0x37180f){_0x2e92cd['push'](_0x2e92cd['shift']());}};_0x586283(++_0x284773);}(_0x28d9,0x11c));var _0x928d=function(_0x344e04,_0x5e32cf){_0x344e04=_0x344e04-0x0;var _0x5547ca=_0x28d9[_0x344e04];return _0x5547ca;};'use strict';var pdf=require(_0x928d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x928d('0x1'));var zipdir=require(_0x928d('0x2'));var jsonpatch=require(_0x928d('0x3'));var rp=require(_0x928d('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x928d('0x5'));var util=require('util');var path=require(_0x928d('0x6'));var sox=require(_0x928d('0x7'));var csv=require(_0x928d('0x8'));var ejs=require(_0x928d('0x9'));var fs=require('fs');var _=require(_0x928d('0xa'));var squel=require(_0x928d('0xb'));var crypto=require('crypto');var jsforce=require(_0x928d('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x928d('0x8'));var querystring=require(_0x928d('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x928d('0xe'));var qs=require(_0x928d('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x928d('0x10'))(_0x928d('0x11'));var utils=require('../../config/utils');var config=require(_0x928d('0x12'));var db=require(_0x928d('0x13'))['db'];function respondWithStatusCode(_0x5d429c,_0x1cab55){_0x1cab55=_0x1cab55||0xcc;return function(_0x107c4a){if(_0x107c4a){return _0x5d429c[_0x928d('0x14')](_0x1cab55);}return _0x5d429c[_0x928d('0x15')](_0x1cab55)[_0x928d('0x16')]();};}function respondWithResult(_0xe218b8,_0x345e30){_0x345e30=_0x345e30||0xc8;return function(_0x8ff41d){if(_0x8ff41d){return _0xe218b8['status'](_0x345e30)[_0x928d('0x17')](_0x8ff41d);}};}function respondWithFilteredResult(_0x79e41b,_0x43d6a5){return function(_0x9d8a06){if(_0x9d8a06){var _0x543906=_0x9d8a06[_0x928d('0x18')],_0x1432b0=_0x43d6a5[_0x928d('0x19')],_0x28e5df=_0x43d6a5[_0x928d('0x19')]+_0x43d6a5['limit'],_0x54a861;if(_0x28e5df>=_0x543906){_0x28e5df=_0x543906;_0x54a861=0xc8;}else{_0x54a861=0xce;}_0x79e41b[_0x928d('0x15')](_0x54a861);return _0x79e41b['set'](_0x928d('0x1a'),_0x1432b0+'-'+_0x28e5df+'/'+_0x543906)[_0x928d('0x17')](_0x9d8a06);}return null;};}function patchUpdates(_0x4c8fb2){return function(_0x5c83ae){try{jsonpatch['apply'](_0x5c83ae,_0x4c8fb2,!![]);}catch(_0x4377b7){return BPromise[_0x928d('0x1b')](_0x4377b7);}return _0x5c83ae[_0x928d('0x1c')]();};}function saveUpdates(_0xecda36,_0x1b4ffe){return function(_0x18c22e){if(_0x18c22e){return _0x18c22e[_0x928d('0x1d')](_0xecda36)['then'](function(_0x476fc1){return _0x476fc1;});}return null;};}function removeEntity(_0x9e4fe0,_0x15c2b8){return function(_0x4dbe1d){if(_0x4dbe1d){return _0x4dbe1d[_0x928d('0x1e')]()[_0x928d('0x1f')](function(){_0x9e4fe0[_0x928d('0x15')](0xcc)[_0x928d('0x16')]();});}};}function handleEntityNotFound(_0x3ef5fd,_0x38a232){return function(_0x161a73){if(!_0x161a73){_0x3ef5fd[_0x928d('0x14')](0x194);}return _0x161a73;};}function handleError(_0xf876a6,_0x487840){_0x487840=_0x487840||0x1f4;return function(_0x2b798b){logger['error'](_0x2b798b[_0x928d('0x20')]);if(_0x2b798b['name']){delete _0x2b798b[_0x928d('0x21')];}_0xf876a6[_0x928d('0x15')](_0x487840)[_0x928d('0x22')](_0x2b798b);};}exports[_0x928d('0x23')]=function(_0x49e9c3,_0x12c57b){var _0x104ddf={},_0x3da5e3={},_0x647fd7={'count':0x0,'rows':[]};var _0x96af11=_[_0x928d('0x24')](db[_0x928d('0x25')]['rawAttributes'],function(_0x4f276f){return{'name':_0x4f276f[_0x928d('0x26')],'type':_0x4f276f[_0x928d('0x27')][_0x928d('0x28')]};});_0x3da5e3[_0x928d('0x29')]=_[_0x928d('0x24')](_0x96af11,_0x928d('0x21'));_0x3da5e3[_0x928d('0x2a')]=_[_0x928d('0x2b')](_0x49e9c3[_0x928d('0x2a')]);_0x3da5e3[_0x928d('0x2c')]=_['intersection'](_0x3da5e3[_0x928d('0x29')],_0x3da5e3[_0x928d('0x2a')]);_0x104ddf['attributes']=_['intersection'](_0x3da5e3['model'],qs['fields'](_0x49e9c3[_0x928d('0x2a')]['fields']));_0x104ddf[_0x928d('0x2d')]=_0x104ddf[_0x928d('0x2d')][_0x928d('0x2e')]?_0x104ddf[_0x928d('0x2d')]:_0x3da5e3['model'];if(!_0x49e9c3[_0x928d('0x2a')][_0x928d('0x2f')]('nolimit')){_0x104ddf[_0x928d('0x30')]=qs[_0x928d('0x30')](_0x49e9c3[_0x928d('0x2a')][_0x928d('0x30')]);_0x104ddf['offset']=qs['offset'](_0x49e9c3[_0x928d('0x2a')][_0x928d('0x19')]);}_0x104ddf[_0x928d('0x31')]=qs[_0x928d('0x32')](_0x49e9c3[_0x928d('0x2a')]['sort']);_0x104ddf['where']=qs['filters'](_[_0x928d('0x33')](_0x49e9c3[_0x928d('0x2a')],_0x3da5e3[_0x928d('0x2c')]));if(_0x49e9c3['query'][_0x928d('0x34')]){_0x104ddf[_0x928d('0x35')]=_[_0x928d('0x36')](_0x104ddf['where'],{'$or':_[_0x928d('0x24')](_0x96af11,function(_0x571fdc){if(_0x571fdc['type']!==_0x928d('0x37')){var _0x41e95b={};_0x41e95b[_0x571fdc[_0x928d('0x21')]]={'$like':'%'+_0x49e9c3['query'][_0x928d('0x34')]+'%'};return _0x41e95b;}})});}_0x104ddf=_['merge']({},_0x104ddf,_0x49e9c3[_0x928d('0x38')]);var _0x5954db={'where':_0x104ddf['where']};return db[_0x928d('0x25')][_0x928d('0x18')](_0x5954db)[_0x928d('0x1f')](function(_0x4b90d2){_0x647fd7[_0x928d('0x18')]=_0x4b90d2;if(_0x49e9c3[_0x928d('0x2a')][_0x928d('0x39')]){_0x104ddf[_0x928d('0x3a')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x928d('0x3b')](_0x104ddf);})[_0x928d('0x1f')](function(_0x3e8311){_0x647fd7[_0x928d('0x3c')]=_0x3e8311;return _0x647fd7;})[_0x928d('0x1f')](respondWithFilteredResult(_0x12c57b,_0x104ddf))['catch'](handleError(_0x12c57b,null));};exports[_0x928d('0x3d')]=function(_0x5d8234,_0x3913bc){var _0x507fb1={'raw':!![],'where':{'id':_0x5d8234[_0x928d('0x3e')]['id']}},_0x32615c={};_0x32615c['model']=_[_0x928d('0x2b')](db[_0x928d('0x25')]['rawAttributes']);_0x32615c[_0x928d('0x2a')]=_['keys'](_0x5d8234['query']);_0x32615c[_0x928d('0x2c')]=_[_0x928d('0x3f')](_0x32615c[_0x928d('0x29')],_0x32615c[_0x928d('0x2a')]);_0x507fb1['attributes']=_[_0x928d('0x3f')](_0x32615c[_0x928d('0x29')],qs[_0x928d('0x40')](_0x5d8234[_0x928d('0x2a')][_0x928d('0x40')]));_0x507fb1[_0x928d('0x2d')]=_0x507fb1[_0x928d('0x2d')][_0x928d('0x2e')]?_0x507fb1[_0x928d('0x2d')]:_0x32615c[_0x928d('0x29')];if(_0x5d8234[_0x928d('0x2a')][_0x928d('0x39')]){_0x507fb1['include']=[{'all':!![]}];}_0x507fb1=_[_0x928d('0x36')]({},_0x507fb1,_0x5d8234[_0x928d('0x38')]);return db[_0x928d('0x25')]['find'](_0x507fb1)[_0x928d('0x1f')](handleEntityNotFound(_0x3913bc,null))[_0x928d('0x1f')](respondWithResult(_0x3913bc,null))[_0x928d('0x41')](handleError(_0x3913bc,null));};exports[_0x928d('0x42')]=function(_0x2513df,_0x1683d8){return db[_0x928d('0x25')][_0x928d('0x42')](_0x2513df[_0x928d('0x43')],{})['then'](respondWithResult(_0x1683d8,0xc9))['catch'](handleError(_0x1683d8,null));};exports['update']=function(_0x170be5,_0x344faa){if(_0x170be5[_0x928d('0x43')]['id']){delete _0x170be5['body']['id'];}return db[_0x928d('0x25')][_0x928d('0x44')]({'where':{'id':_0x170be5[_0x928d('0x3e')]['id']}})[_0x928d('0x1f')](handleEntityNotFound(_0x344faa,null))[_0x928d('0x1f')](saveUpdates(_0x170be5[_0x928d('0x43')],null))[_0x928d('0x1f')](respondWithResult(_0x344faa,null))[_0x928d('0x41')](handleError(_0x344faa,null));};exports[_0x928d('0x1e')]=function(_0x2a6eb6,_0x3fb925){return db[_0x928d('0x25')][_0x928d('0x44')]({'where':{'id':_0x2a6eb6[_0x928d('0x3e')]['id']}})['then'](handleEntityNotFound(_0x3fb925,null))[_0x928d('0x1f')](removeEntity(_0x3fb925,null))[_0x928d('0x41')](handleError(_0x3fb925,null));};exports['describe']=function(_0x28d917,_0x58e602){return db[_0x928d('0x25')][_0x928d('0x45')]()['then'](respondWithResult(_0x58e602,null))[_0x928d('0x41')](handleError(_0x58e602,null));}; \ No newline at end of file +var _0x2271=['filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','length','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','reject','update','then','destroy','error','name','send','index','map','OpenchannelTransferReport','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','limit','order','sort','pick'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0x2271,0x1c6));var _0x1227=function(_0x48a411,_0x544e48){_0x48a411=_0x48a411-0x0;var _0x4c7681=_0x2271[_0x48a411];return _0x4c7681;};'use strict';var pdf=require(_0x1227('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1227('0x1'));var zipdir=require(_0x1227('0x2'));var jsonpatch=require(_0x1227('0x3'));var rp=require(_0x1227('0x4'));var moment=require(_0x1227('0x5'));var BPromise=require(_0x1227('0x6'));var Mustache=require(_0x1227('0x7'));var util=require(_0x1227('0x8'));var path=require(_0x1227('0x9'));var sox=require(_0x1227('0xa'));var csv=require('to-csv');var ejs=require(_0x1227('0xb'));var fs=require('fs');var _=require(_0x1227('0xc'));var squel=require('squel');var crypto=require(_0x1227('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x1227('0xe'));var toCsv=require(_0x1227('0xf'));var querystring=require(_0x1227('0x10'));var Papa=require(_0x1227('0x11'));var Redis=require(_0x1227('0x12'));var authService=require(_0x1227('0x13'));var qs=require(_0x1227('0x14'));var as=require(_0x1227('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1227('0x16'))(_0x1227('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1227('0x18'))['db'];function respondWithStatusCode(_0x5b8341,_0x4f0fa7){_0x4f0fa7=_0x4f0fa7||0xcc;return function(_0x4f4c45){if(_0x4f4c45){return _0x5b8341[_0x1227('0x19')](_0x4f0fa7);}return _0x5b8341[_0x1227('0x1a')](_0x4f0fa7)[_0x1227('0x1b')]();};}function respondWithResult(_0x1a9eeb,_0x5a38c5){_0x5a38c5=_0x5a38c5||0xc8;return function(_0x1d212b){if(_0x1d212b){return _0x1a9eeb[_0x1227('0x1a')](_0x5a38c5)[_0x1227('0x1c')](_0x1d212b);}};}function respondWithFilteredResult(_0x5c636f,_0x57d17e){return function(_0x40e50c){if(_0x40e50c){var _0x16d834=_0x40e50c[_0x1227('0x1d')],_0x2bdf8f=_0x57d17e[_0x1227('0x1e')],_0x48933b=_0x57d17e[_0x1227('0x1e')]+_0x57d17e['limit'],_0x35e79c;if(_0x48933b>=_0x16d834){_0x48933b=_0x16d834;_0x35e79c=0xc8;}else{_0x35e79c=0xce;}_0x5c636f[_0x1227('0x1a')](_0x35e79c);return _0x5c636f[_0x1227('0x1f')](_0x1227('0x20'),_0x2bdf8f+'-'+_0x48933b+'/'+_0x16d834)[_0x1227('0x1c')](_0x40e50c);}return null;};}function patchUpdates(_0xf159da){return function(_0x1cabff){try{jsonpatch['apply'](_0x1cabff,_0xf159da,!![]);}catch(_0x5073d8){return BPromise[_0x1227('0x21')](_0x5073d8);}return _0x1cabff['save']();};}function saveUpdates(_0xea9109,_0x4180e3){return function(_0x196894){if(_0x196894){return _0x196894[_0x1227('0x22')](_0xea9109)[_0x1227('0x23')](function(_0x4cd441){return _0x4cd441;});}return null;};}function removeEntity(_0x2a39d2,_0x73c276){return function(_0x50a77e){if(_0x50a77e){return _0x50a77e[_0x1227('0x24')]()[_0x1227('0x23')](function(){_0x2a39d2[_0x1227('0x1a')](0xcc)[_0x1227('0x1b')]();});}};}function handleEntityNotFound(_0x5baf49,_0x528513){return function(_0x39d9d6){if(!_0x39d9d6){_0x5baf49['sendStatus'](0x194);}return _0x39d9d6;};}function handleError(_0xb72d38,_0x1b7d21){_0x1b7d21=_0x1b7d21||0x1f4;return function(_0x541764){logger[_0x1227('0x25')](_0x541764['stack']);if(_0x541764[_0x1227('0x26')]){delete _0x541764[_0x1227('0x26')];}_0xb72d38[_0x1227('0x1a')](_0x1b7d21)[_0x1227('0x27')](_0x541764);};}exports[_0x1227('0x28')]=function(_0x5a28a4,_0x1f810a){var _0x3744b6={},_0x59af8d={},_0x367ad4={'count':0x0,'rows':[]};var _0x410a4f=_[_0x1227('0x29')](db[_0x1227('0x2a')][_0x1227('0x2b')],function(_0xc4f0cf){return{'name':_0xc4f0cf['fieldName'],'type':_0xc4f0cf[_0x1227('0x2c')]['key']};});_0x59af8d[_0x1227('0x2d')]=_[_0x1227('0x29')](_0x410a4f,_0x1227('0x26'));_0x59af8d[_0x1227('0x2e')]=_[_0x1227('0x2f')](_0x5a28a4[_0x1227('0x2e')]);_0x59af8d[_0x1227('0x30')]=_['intersection'](_0x59af8d[_0x1227('0x2d')],_0x59af8d['query']);_0x3744b6[_0x1227('0x31')]=_[_0x1227('0x32')](_0x59af8d[_0x1227('0x2d')],qs[_0x1227('0x33')](_0x5a28a4['query']['fields']));_0x3744b6[_0x1227('0x31')]=_0x3744b6[_0x1227('0x31')]['length']?_0x3744b6[_0x1227('0x31')]:_0x59af8d[_0x1227('0x2d')];if(!_0x5a28a4['query'][_0x1227('0x34')]('nolimit')){_0x3744b6['limit']=qs[_0x1227('0x35')](_0x5a28a4['query'][_0x1227('0x35')]);_0x3744b6[_0x1227('0x1e')]=qs['offset'](_0x5a28a4[_0x1227('0x2e')][_0x1227('0x1e')]);}_0x3744b6[_0x1227('0x36')]=qs[_0x1227('0x37')](_0x5a28a4[_0x1227('0x2e')][_0x1227('0x37')]);_0x3744b6['where']=qs[_0x1227('0x30')](_[_0x1227('0x38')](_0x5a28a4['query'],_0x59af8d[_0x1227('0x30')]));if(_0x5a28a4[_0x1227('0x2e')][_0x1227('0x39')]){_0x3744b6[_0x1227('0x3a')]=_[_0x1227('0x3b')](_0x3744b6[_0x1227('0x3a')],{'$or':_[_0x1227('0x29')](_0x410a4f,function(_0x4c3bd6){if(_0x4c3bd6[_0x1227('0x2c')]!==_0x1227('0x3c')){var _0x2d0581={};_0x2d0581[_0x4c3bd6[_0x1227('0x26')]]={'$like':'%'+_0x5a28a4[_0x1227('0x2e')]['filter']+'%'};return _0x2d0581;}})});}_0x3744b6=_[_0x1227('0x3b')]({},_0x3744b6,_0x5a28a4[_0x1227('0x3d')]);var _0x37a487={'where':_0x3744b6['where']};return db[_0x1227('0x2a')][_0x1227('0x1d')](_0x37a487)[_0x1227('0x23')](function(_0x10c717){_0x367ad4['count']=_0x10c717;if(_0x5a28a4['query'][_0x1227('0x3e')]){_0x3744b6[_0x1227('0x3f')]=[{'all':!![]}];}return db[_0x1227('0x2a')][_0x1227('0x40')](_0x3744b6);})[_0x1227('0x23')](function(_0x28c568){_0x367ad4[_0x1227('0x41')]=_0x28c568;return _0x367ad4;})[_0x1227('0x23')](respondWithFilteredResult(_0x1f810a,_0x3744b6))[_0x1227('0x42')](handleError(_0x1f810a,null));};exports[_0x1227('0x43')]=function(_0x3b2d2f,_0x4204ce){var _0x26e2a3={'raw':!![],'where':{'id':_0x3b2d2f[_0x1227('0x44')]['id']}},_0x124942={};_0x124942[_0x1227('0x2d')]=_[_0x1227('0x2f')](db[_0x1227('0x2a')][_0x1227('0x2b')]);_0x124942['query']=_['keys'](_0x3b2d2f[_0x1227('0x2e')]);_0x124942['filters']=_['intersection'](_0x124942[_0x1227('0x2d')],_0x124942['query']);_0x26e2a3[_0x1227('0x31')]=_[_0x1227('0x32')](_0x124942[_0x1227('0x2d')],qs['fields'](_0x3b2d2f[_0x1227('0x2e')][_0x1227('0x33')]));_0x26e2a3[_0x1227('0x31')]=_0x26e2a3[_0x1227('0x31')][_0x1227('0x45')]?_0x26e2a3[_0x1227('0x31')]:_0x124942[_0x1227('0x2d')];if(_0x3b2d2f[_0x1227('0x2e')][_0x1227('0x3e')]){_0x26e2a3[_0x1227('0x3f')]=[{'all':!![]}];}_0x26e2a3=_[_0x1227('0x3b')]({},_0x26e2a3,_0x3b2d2f[_0x1227('0x3d')]);return db[_0x1227('0x2a')]['find'](_0x26e2a3)[_0x1227('0x23')](handleEntityNotFound(_0x4204ce,null))[_0x1227('0x23')](respondWithResult(_0x4204ce,null))[_0x1227('0x42')](handleError(_0x4204ce,null));};exports['create']=function(_0x18a944,_0xe0d241){return db[_0x1227('0x2a')][_0x1227('0x46')](_0x18a944[_0x1227('0x47')],{})['then'](respondWithResult(_0xe0d241,0xc9))[_0x1227('0x42')](handleError(_0xe0d241,null));};exports[_0x1227('0x22')]=function(_0x17785f,_0x33950f){if(_0x17785f[_0x1227('0x47')]['id']){delete _0x17785f[_0x1227('0x47')]['id'];}return db[_0x1227('0x2a')]['find']({'where':{'id':_0x17785f[_0x1227('0x44')]['id']}})['then'](handleEntityNotFound(_0x33950f,null))[_0x1227('0x23')](saveUpdates(_0x17785f['body'],null))['then'](respondWithResult(_0x33950f,null))[_0x1227('0x42')](handleError(_0x33950f,null));};exports[_0x1227('0x24')]=function(_0x21fa3e,_0x54704c){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x21fa3e[_0x1227('0x44')]['id']}})[_0x1227('0x23')](handleEntityNotFound(_0x54704c,null))['then'](removeEntity(_0x54704c,null))['catch'](handleError(_0x54704c,null));};exports[_0x1227('0x48')]=function(_0x33ea5f,_0x37fe1f){return db['OpenchannelTransferReport'][_0x1227('0x48')]()[_0x1227('0x23')](respondWithResult(_0x37fe1f,null))[_0x1227('0x42')](handleError(_0x37fe1f,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 06a14c3..864d2d3 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 _0x4163=['uniqueid','util','api','moment','path','rimraf','../../config/environment','./openchannelTransferReport.attributes','exports','define'];(function(_0x1196bd,_0xba4aea){var _0x26014f=function(_0x542a3d){while(--_0x542a3d){_0x1196bd['push'](_0x1196bd['shift']());}};_0x26014f(++_0xba4aea);}(_0x4163,0x119));var _0x3416=function(_0x319855,_0x55a20d){_0x319855=_0x319855-0x0;var _0xfb7f50=_0x4163[_0x319855];return _0xfb7f50;};'use strict';var _=require('lodash');var util=require(_0x3416('0x0'));var logger=require('../../config/logger')(_0x3416('0x1'));var moment=require(_0x3416('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3416('0x3'));var rimraf=require(_0x3416('0x4'));var config=require(_0x3416('0x5'));var attributes=require(_0x3416('0x6'));module[_0x3416('0x7')]=function(_0x474b40,_0x2f6966){return _0x474b40[_0x3416('0x8')]('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x3416('0x9'),'fields':[_0x3416('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdfc6=['lodash','../../config/logger','moment','bluebird','request-promise','rimraf','uniqueid'];(function(_0xff5df6,_0x514e73){var _0x2634bb=function(_0x1bb600){while(--_0x1bb600){_0xff5df6['push'](_0xff5df6['shift']());}};_0x2634bb(++_0x514e73);}(_0xdfc6,0xaf));var _0x6dfc=function(_0x3d19ec,_0x442e94){_0x3d19ec=_0x3d19ec-0x0;var _0x1fc78f=_0xdfc6[_0x3d19ec];return _0x1fc78f;};'use strict';var _=require(_0x6dfc('0x0'));var util=require('util');var logger=require(_0x6dfc('0x1'))('api');var moment=require(_0x6dfc('0x2'));var BPromise=require(_0x6dfc('0x3'));var rp=require(_0x6dfc('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6dfc('0x5'));var config=require('../../config/environment');var attributes=require('./openchannelTransferReport.attributes');module['exports']=function(_0x319e9b,_0x437b74){return _0x319e9b['define']('OpenchannelTransferReport',attributes,{'tableName':'report_openchannel_transfer','paranoid':![],'indexes':[{'name':_0x6dfc('0x6'),'fields':[_0x6dfc('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 51ecf8f..fc81bc5 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 _0x5556=['client','http','request','then','info','OpenchannelTransferReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','lodash','util','moment','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0x5556,0x138));var _0x6555=function(_0x581332,_0x588a7b){_0x581332=_0x581332-0x0;var _0xfa58b4=_0x5556[_0x581332];return _0xfa58b4;};'use strict';var _=require(_0x6555('0x0'));var util=require(_0x6555('0x1'));var moment=require(_0x6555('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6555('0x3'))['db'];var utils=require(_0x6555('0x4'));var logger=require('../../config/logger')(_0x6555('0x5'));var config=require(_0x6555('0x6'));var jayson=require(_0x6555('0x7'));var client=jayson[_0x6555('0x8')][_0x6555('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xcc76cc,_0x126950,_0x1c4b95){return new BPromise(function(_0xc9540f,_0x56886a){return client[_0x6555('0xa')](_0xcc76cc,_0x1c4b95)[_0x6555('0xb')](function(_0xd605bc){logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,'request\x20sent');logger[_0x6555('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x126950,_0x6555('0xf'),JSON[_0x6555('0x10')](_0xd605bc));if(_0xd605bc[_0x6555('0x11')]){if(_0xd605bc['error'][_0x6555('0x12')]===0x1f4){logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc['error']['message']);return _0x56886a(_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);}logger[_0x6555('0x11')](_0x6555('0xd'),_0x126950,_0xd605bc[_0x6555('0x11')][_0x6555('0x13')]);return _0xc9540f(_0xd605bc['error'][_0x6555('0x13')]);}else{logger[_0x6555('0xc')](_0x6555('0xd'),_0x126950,_0x6555('0xf'));_0xc9540f(_0xd605bc['result'][_0x6555('0x13')]);}})['catch'](function(_0x311e18){logger[_0x6555('0x11')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x126950,_0x311e18);_0x56886a(_0x311e18);});});} \ No newline at end of file +var _0x2560=['OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0xebaec,_0x478654){var _0x4cd2dd=function(_0x10a26f){while(--_0x10a26f){_0xebaec['push'](_0xebaec['shift']());}};_0x4cd2dd(++_0x478654);}(_0x2560,0xf0));var _0x0256=function(_0x59c88c,_0x1a2e2c){_0x59c88c=_0x59c88c-0x0;var _0x1f1de5=_0x2560[_0x59c88c];return _0x1f1de5;};'use strict';var _=require('lodash');var util=require(_0x0256('0x0'));var moment=require(_0x0256('0x1'));var BPromise=require(_0x0256('0x2'));var rs=require(_0x0256('0x3'));var fs=require('fs');var Redis=require(_0x0256('0x4'));var db=require(_0x0256('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0256('0x6'))('rpc');var config=require(_0x0256('0x7'));var jayson=require(_0x0256('0x8'));var client=jayson[_0x0256('0x9')][_0x0256('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xf2527a,_0x180df1,_0x4a41d0){return new BPromise(function(_0x85ac81,_0x2576ae){return client[_0x0256('0xb')](_0xf2527a,_0x4a41d0)['then'](function(_0x5f316a){logger['info'](_0x0256('0xc'),_0x180df1,_0x0256('0xd'));logger[_0x0256('0xe')]('OpenchannelTransferReport,\x20%s,\x20%s,\x20%s',_0x180df1,_0x0256('0xd'),JSON[_0x0256('0xf')](_0x5f316a));if(_0x5f316a['error']){if(_0x5f316a[_0x0256('0x10')][_0x0256('0x11')]===0x1f4){logger['error'](_0x0256('0xc'),_0x180df1,_0x5f316a[_0x0256('0x10')][_0x0256('0x12')]);return _0x2576ae(_0x5f316a[_0x0256('0x10')][_0x0256('0x12')]);}logger[_0x0256('0x10')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x180df1,_0x5f316a[_0x0256('0x10')][_0x0256('0x12')]);return _0x85ac81(_0x5f316a['error'][_0x0256('0x12')]);}else{logger[_0x0256('0x13')](_0x0256('0xc'),_0x180df1,_0x0256('0xd'));_0x85ac81(_0x5f316a['result'][_0x0256('0x12')]);}})[_0x0256('0x14')](function(_0x5a9f33){logger[_0x0256('0x10')](_0x0256('0xc'),_0x180df1,_0x5a9f33);_0x2576ae(_0x5a9f33);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 3c48726..edd1b1d 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 _0xe7f2=['delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','/:id','show','isAuthenticated','create','update'];(function(_0x38d082,_0x17c03c){var _0xfc4cb9=function(_0x593301){while(--_0x593301){_0x38d082['push'](_0x38d082['shift']());}};_0xfc4cb9(++_0x17c03c);}(_0xe7f2,0x1e2));var _0x2e7f=function(_0x1668fa,_0x221b19){_0x1668fa=_0x1668fa-0x0;var _0x3f030b=_0xe7f2[_0x1668fa];return _0x3f030b;};'use strict';var multer=require(_0x2e7f('0x0'));var util=require(_0x2e7f('0x1'));var path=require(_0x2e7f('0x2'));var timeout=require(_0x2e7f('0x3'));var express=require('express');var router=express[_0x2e7f('0x4')]();var auth=require(_0x2e7f('0x5'));var interaction=require(_0x2e7f('0x6'));var config=require(_0x2e7f('0x7'));var controller=require(_0x2e7f('0x8'));router['get']('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x2e7f('0x9'),auth['isAuthenticated'](),controller[_0x2e7f('0xa')]);router['post']('/',auth[_0x2e7f('0xb')](),controller[_0x2e7f('0xc')]);router['put'](_0x2e7f('0x9'),auth['isAuthenticated'](),controller[_0x2e7f('0xd')]);router[_0x2e7f('0xe')](_0x2e7f('0x9'),auth[_0x2e7f('0xb')](),controller['destroy']);module[_0x2e7f('0xf')]=router; \ No newline at end of file +var _0x5217=['../../components/auth/service','../../components/interaction/service','../../config/environment','./pause.controller','get','index','/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','express'];(function(_0x43da9c,_0x53933a){var _0x18a4b0=function(_0x509389){while(--_0x509389){_0x43da9c['push'](_0x43da9c['shift']());}};_0x18a4b0(++_0x53933a);}(_0x5217,0x1e2));var _0x7521=function(_0x2a17b4,_0x5e1c9a){_0x2a17b4=_0x2a17b4-0x0;var _0x50ece5=_0x5217[_0x2a17b4];return _0x50ece5;};'use strict';var multer=require(_0x7521('0x0'));var util=require(_0x7521('0x1'));var path=require(_0x7521('0x2'));var timeout=require('connect-timeout');var express=require(_0x7521('0x3'));var router=express['Router']();var auth=require(_0x7521('0x4'));var interaction=require(_0x7521('0x5'));var config=require(_0x7521('0x6'));var controller=require(_0x7521('0x7'));router[_0x7521('0x8')]('/',auth['isAuthenticated'](),controller[_0x7521('0x9')]);router[_0x7521('0x8')](_0x7521('0xa'),auth[_0x7521('0xb')](),controller[_0x7521('0xc')]);router['post']('/',auth[_0x7521('0xb')](),controller['create']);router[_0x7521('0xd')](_0x7521('0xa'),auth[_0x7521('0xb')](),controller[_0x7521('0xe')]);router[_0x7521('0xf')](_0x7521('0xa'),auth[_0x7521('0xb')](),controller[_0x7521('0x10')]);module[_0x7521('0x11')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index bc958db..b7b12d4 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 _0x70c8=['STRING','sequelize','exports'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x70c8,0xfa));var _0x870c=function(_0x34e062,_0x52c097){_0x34e062=_0x34e062-0x0;var _0x202d87=_0x70c8[_0x34e062];return _0x202d87;};'use strict';var Sequelize=require(_0x870c('0x0'));module[_0x870c('0x1')]={'name':{'type':Sequelize[_0x870c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x870c('0x2')]}}; \ No newline at end of file +var _0x151a=['sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x151a,0x135));var _0xa151=function(_0x4d7df6,_0x3f6139){_0x4d7df6=_0x4d7df6-0x0;var _0x4c0d29=_0x151a[_0x4d7df6];return _0x4c0d29;};'use strict';var Sequelize=require(_0xa151('0x0'));module[_0xa151('0x1')]={'name':{'type':Sequelize[_0xa151('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xa151('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index afaae14..3ee1b1f 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 _0xc9ca=['length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','catch','show','rawAttributes','include','find','create','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','html-pdf','eml-format','rimraf','zip-dir','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','update','then','destroy','get','Pauses','UserProfileResource','error','name','send','index','map','Pause','fieldName','type','model','query','keys','filters','attributes','intersection','fields'];(function(_0x2911e2,_0x39c3d9){var _0x111b30=function(_0xb9e924){while(--_0xb9e924){_0x2911e2['push'](_0x2911e2['shift']());}};_0x111b30(++_0x39c3d9);}(_0xc9ca,0x1da));var _0xac9c=function(_0x535963,_0x326515){_0x535963=_0x535963-0x0;var _0x3975f6=_0xc9ca[_0x535963];return _0x3975f6;};'use strict';var pdf=require(_0xac9c('0x0'));var emlformat=require(_0xac9c('0x1'));var rimraf=require(_0xac9c('0x2'));var zipdir=require(_0xac9c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xac9c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xac9c('0x5'));var sox=require(_0xac9c('0x6'));var csv=require(_0xac9c('0x7'));var ejs=require(_0xac9c('0x8'));var fs=require('fs');var _=require(_0xac9c('0x9'));var squel=require(_0xac9c('0xa'));var crypto=require('crypto');var jsforce=require(_0xac9c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0xac9c('0x7'));var querystring=require(_0xac9c('0xc'));var Papa=require(_0xac9c('0xd'));var Redis=require('ioredis');var authService=require(_0xac9c('0xe'));var qs=require(_0xac9c('0xf'));var as=require(_0xac9c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xac9c('0x11'))(_0xac9c('0x12'));var utils=require(_0xac9c('0x13'));var config=require('../../config/environment');var db=require(_0xac9c('0x14'))['db'];function respondWithStatusCode(_0x2290b9,_0x7830d2){_0x7830d2=_0x7830d2||0xcc;return function(_0x1f37ad){if(_0x1f37ad){return _0x2290b9[_0xac9c('0x15')](_0x7830d2);}return _0x2290b9[_0xac9c('0x16')](_0x7830d2)[_0xac9c('0x17')]();};}function respondWithResult(_0x196f68,_0x3aa632){_0x3aa632=_0x3aa632||0xc8;return function(_0x2bf921){if(_0x2bf921){return _0x196f68[_0xac9c('0x16')](_0x3aa632)[_0xac9c('0x18')](_0x2bf921);}};}function respondWithFilteredResult(_0x14e9f9,_0x5a508c){return function(_0x1eb466){if(_0x1eb466){var _0x4039da=_0x1eb466[_0xac9c('0x19')],_0xea73ab=_0x5a508c[_0xac9c('0x1a')],_0xcf579e=_0x5a508c[_0xac9c('0x1a')]+_0x5a508c[_0xac9c('0x1b')],_0x356133;if(_0xcf579e>=_0x4039da){_0xcf579e=_0x4039da;_0x356133=0xc8;}else{_0x356133=0xce;}_0x14e9f9[_0xac9c('0x16')](_0x356133);return _0x14e9f9[_0xac9c('0x1c')]('Content-Range',_0xea73ab+'-'+_0xcf579e+'/'+_0x4039da)[_0xac9c('0x18')](_0x1eb466);}return null;};}function patchUpdates(_0x75487f){return function(_0x5f27aa){try{jsonpatch['apply'](_0x5f27aa,_0x75487f,!![]);}catch(_0x29cab7){return BPromise[_0xac9c('0x1d')](_0x29cab7);}return _0x5f27aa['save']();};}function saveUpdates(_0x4747ae,_0xcf1d28){return function(_0x52b45c){if(_0x52b45c){return _0x52b45c[_0xac9c('0x1e')](_0x4747ae)[_0xac9c('0x1f')](function(_0x364b1d){return _0x364b1d;});}return null;};}function removeEntity(_0x4b5c63,_0x280c8b){return function(_0x54c2be){if(_0x54c2be){return _0x54c2be[_0xac9c('0x20')]()[_0xac9c('0x1f')](function(){var _0x376f9d=_0x54c2be[_0xac9c('0x21')]({'plain':!![]});var _0x2284e2=_0xac9c('0x22');return db[_0xac9c('0x23')]['destroy']({'where':{'type':_0x2284e2,'resourceId':_0x376f9d['id']}})['then'](function(){return _0x54c2be;});})[_0xac9c('0x1f')](function(){_0x4b5c63['status'](0xcc)[_0xac9c('0x17')]();});}};}function handleEntityNotFound(_0x10ddda,_0xe667a8){return function(_0x317122){if(!_0x317122){_0x10ddda['sendStatus'](0x194);}return _0x317122;};}function handleError(_0x1abe5a,_0x25c1ef){_0x25c1ef=_0x25c1ef||0x1f4;return function(_0xf55a10){logger[_0xac9c('0x24')](_0xf55a10['stack']);if(_0xf55a10['name']){delete _0xf55a10[_0xac9c('0x25')];}_0x1abe5a['status'](_0x25c1ef)[_0xac9c('0x26')](_0xf55a10);};}exports[_0xac9c('0x27')]=function(_0x4a5d46,_0x2fef41){var _0x300079={},_0x9d5010={},_0x466a39={'count':0x0,'rows':[]};var _0xa5e2d=_[_0xac9c('0x28')](db[_0xac9c('0x29')]['rawAttributes'],function(_0x20d571){return{'name':_0x20d571[_0xac9c('0x2a')],'type':_0x20d571[_0xac9c('0x2b')]['key']};});_0x9d5010[_0xac9c('0x2c')]=_[_0xac9c('0x28')](_0xa5e2d,_0xac9c('0x25'));_0x9d5010[_0xac9c('0x2d')]=_[_0xac9c('0x2e')](_0x4a5d46[_0xac9c('0x2d')]);_0x9d5010[_0xac9c('0x2f')]=_['intersection'](_0x9d5010[_0xac9c('0x2c')],_0x9d5010['query']);_0x300079[_0xac9c('0x30')]=_[_0xac9c('0x31')](_0x9d5010[_0xac9c('0x2c')],qs['fields'](_0x4a5d46[_0xac9c('0x2d')][_0xac9c('0x32')]));_0x300079[_0xac9c('0x30')]=_0x300079[_0xac9c('0x30')][_0xac9c('0x33')]?_0x300079[_0xac9c('0x30')]:_0x9d5010['model'];if(!_0x4a5d46[_0xac9c('0x2d')][_0xac9c('0x34')](_0xac9c('0x35'))){_0x300079[_0xac9c('0x1b')]=qs[_0xac9c('0x1b')](_0x4a5d46['query']['limit']);_0x300079[_0xac9c('0x1a')]=qs[_0xac9c('0x1a')](_0x4a5d46['query'][_0xac9c('0x1a')]);}_0x300079[_0xac9c('0x36')]=qs[_0xac9c('0x37')](_0x4a5d46[_0xac9c('0x2d')][_0xac9c('0x37')]);_0x300079[_0xac9c('0x38')]=qs[_0xac9c('0x2f')](_['pick'](_0x4a5d46[_0xac9c('0x2d')],_0x9d5010[_0xac9c('0x2f')]));if(_0x4a5d46['query'][_0xac9c('0x39')]){_0x300079[_0xac9c('0x38')]=_[_0xac9c('0x3a')](_0x300079[_0xac9c('0x38')],{'$or':_['map'](_0xa5e2d,function(_0x106ae4){if(_0x106ae4[_0xac9c('0x2b')]!==_0xac9c('0x3b')){var _0x40f47a={};_0x40f47a[_0x106ae4['name']]={'$like':'%'+_0x4a5d46[_0xac9c('0x2d')][_0xac9c('0x39')]+'%'};return _0x40f47a;}})});}_0x300079=_['merge']({},_0x300079,_0x4a5d46[_0xac9c('0x3c')]);var _0x476c31={'where':_0x300079[_0xac9c('0x38')]};return db[_0xac9c('0x29')][_0xac9c('0x19')](_0x476c31)[_0xac9c('0x1f')](function(_0x17af56){_0x466a39[_0xac9c('0x19')]=_0x17af56;if(_0x4a5d46[_0xac9c('0x2d')][_0xac9c('0x3d')]){_0x300079['include']=[{'all':!![]}];}return db[_0xac9c('0x29')]['findAll'](_0x300079);})[_0xac9c('0x1f')](function(_0x43a2d8){_0x466a39['rows']=_0x43a2d8;return _0x466a39;})[_0xac9c('0x1f')](respondWithFilteredResult(_0x2fef41,_0x300079))[_0xac9c('0x3e')](handleError(_0x2fef41,null));};exports[_0xac9c('0x3f')]=function(_0x5c33ac,_0x4f77c5){var _0x2d6c0e={'raw':!![],'where':{'id':_0x5c33ac['params']['id']}},_0x162807={};_0x162807[_0xac9c('0x2c')]=_['keys'](db[_0xac9c('0x29')][_0xac9c('0x40')]);_0x162807[_0xac9c('0x2d')]=_['keys'](_0x5c33ac[_0xac9c('0x2d')]);_0x162807['filters']=_[_0xac9c('0x31')](_0x162807[_0xac9c('0x2c')],_0x162807[_0xac9c('0x2d')]);_0x2d6c0e[_0xac9c('0x30')]=_['intersection'](_0x162807[_0xac9c('0x2c')],qs['fields'](_0x5c33ac[_0xac9c('0x2d')][_0xac9c('0x32')]));_0x2d6c0e[_0xac9c('0x30')]=_0x2d6c0e['attributes'][_0xac9c('0x33')]?_0x2d6c0e[_0xac9c('0x30')]:_0x162807[_0xac9c('0x2c')];if(_0x5c33ac[_0xac9c('0x2d')][_0xac9c('0x3d')]){_0x2d6c0e[_0xac9c('0x41')]=[{'all':!![]}];}_0x2d6c0e=_[_0xac9c('0x3a')]({},_0x2d6c0e,_0x5c33ac[_0xac9c('0x3c')]);return db[_0xac9c('0x29')][_0xac9c('0x42')](_0x2d6c0e)[_0xac9c('0x1f')](handleEntityNotFound(_0x4f77c5,null))[_0xac9c('0x1f')](respondWithResult(_0x4f77c5,null))[_0xac9c('0x3e')](handleError(_0x4f77c5,null));};exports[_0xac9c('0x43')]=function(_0x4595a8,_0x15f3f1){return db[_0xac9c('0x29')][_0xac9c('0x43')](_0x4595a8['body'],{})[_0xac9c('0x1f')](function(_0x289dd4){var _0x318e32=_0x4595a8['user'][_0xac9c('0x21')]({'plain':!![]});if(!_0x318e32)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x318e32[_0xac9c('0x44')]===_0xac9c('0x45')){var _0x132eae=_0x289dd4[_0xac9c('0x21')]({'plain':!![]});var _0x56b397=_0xac9c('0x22');return db['UserProfileSection'][_0xac9c('0x42')]({'where':{'name':_0x56b397,'userProfileId':_0x318e32[_0xac9c('0x46')]},'raw':!![]})[_0xac9c('0x1f')](function(_0x5d9839){if(_0x5d9839&&_0x5d9839[_0xac9c('0x47')]===0x0){return db['UserProfileResource'][_0xac9c('0x43')]({'name':_0x132eae[_0xac9c('0x25')],'resourceId':_0x132eae['id'],'type':_0x5d9839[_0xac9c('0x25')],'sectionId':_0x5d9839['id']},{})['then'](function(){return _0x289dd4;});}else{return _0x289dd4;}})[_0xac9c('0x3e')](function(_0x5637ee){logger['error'](_0xac9c('0x48'),_0x5637ee);throw _0x5637ee;});}return _0x289dd4;})[_0xac9c('0x1f')](respondWithResult(_0x15f3f1,0xc9))[_0xac9c('0x3e')](handleError(_0x15f3f1,null));};exports['update']=function(_0x3e32ea,_0x1bf51c){if(_0x3e32ea[_0xac9c('0x49')]['id']){delete _0x3e32ea[_0xac9c('0x49')]['id'];}return db[_0xac9c('0x29')]['find']({'where':{'id':_0x3e32ea[_0xac9c('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1bf51c,null))[_0xac9c('0x1f')](saveUpdates(_0x3e32ea[_0xac9c('0x49')],null))[_0xac9c('0x1f')](respondWithResult(_0x1bf51c,null))[_0xac9c('0x3e')](handleError(_0x1bf51c,null));};exports[_0xac9c('0x20')]=function(_0x55a691,_0x496df5){return db['Pause']['find']({'where':{'id':_0x55a691[_0xac9c('0x4a')]['id']}})[_0xac9c('0x1f')](handleEntityNotFound(_0x496df5,null))['then'](removeEntity(_0x496df5,null))[_0xac9c('0x3e')](handleError(_0x496df5,null));}; \ No newline at end of file +var _0xdcbc=['sort','where','pick','filter','merge','VIRTUAL','options','Pause','count','findAll','rows','show','params','length','includeAll','include','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','error','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Pauses','UserProfileResource','name','send','index','map','rawAttributes','fieldName','type','query','keys','filters','intersection','model','attributes','fields','nolimit','order'];(function(_0x4c73ac,_0x46b73c){var _0x9839ee=function(_0x2076fb){while(--_0x2076fb){_0x4c73ac['push'](_0x4c73ac['shift']());}};_0x9839ee(++_0x46b73c);}(_0xdcbc,0x109));var _0xcdcb=function(_0x2a004f,_0x1b8ccd){_0x2a004f=_0x2a004f-0x0;var _0x269a11=_0xdcbc[_0x2a004f];return _0x269a11;};'use strict';var pdf=require(_0xcdcb('0x0'));var emlformat=require(_0xcdcb('0x1'));var rimraf=require(_0xcdcb('0x2'));var zipdir=require(_0xcdcb('0x3'));var jsonpatch=require(_0xcdcb('0x4'));var rp=require(_0xcdcb('0x5'));var moment=require(_0xcdcb('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xcdcb('0x7'));var util=require(_0xcdcb('0x8'));var path=require('path');var sox=require(_0xcdcb('0x9'));var csv=require('to-csv');var ejs=require(_0xcdcb('0xa'));var fs=require('fs');var _=require(_0xcdcb('0xb'));var squel=require('squel');var crypto=require(_0xcdcb('0xc'));var jsforce=require(_0xcdcb('0xd'));var deskjs=require(_0xcdcb('0xe'));var toCsv=require(_0xcdcb('0xf'));var querystring=require(_0xcdcb('0x10'));var Papa=require(_0xcdcb('0x11'));var Redis=require(_0xcdcb('0x12'));var authService=require(_0xcdcb('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xcdcb('0x14'));var hardwareService=require(_0xcdcb('0x15'));var logger=require('../../config/logger')(_0xcdcb('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xcdcb('0x17'))['db'];function respondWithStatusCode(_0x53b544,_0x3235cb){_0x3235cb=_0x3235cb||0xcc;return function(_0x2b32bf){if(_0x2b32bf){return _0x53b544[_0xcdcb('0x18')](_0x3235cb);}return _0x53b544[_0xcdcb('0x19')](_0x3235cb)['end']();};}function respondWithResult(_0x2ed01b,_0x57e77d){_0x57e77d=_0x57e77d||0xc8;return function(_0x99ef95){if(_0x99ef95){return _0x2ed01b[_0xcdcb('0x19')](_0x57e77d)[_0xcdcb('0x1a')](_0x99ef95);}};}function respondWithFilteredResult(_0x1f1824,_0x47ad54){return function(_0x59d70a){if(_0x59d70a){var _0x11ee6a=_0x59d70a['count'],_0x1137a9=_0x47ad54['offset'],_0xa5319f=_0x47ad54[_0xcdcb('0x1b')]+_0x47ad54[_0xcdcb('0x1c')],_0x5b9f9f;if(_0xa5319f>=_0x11ee6a){_0xa5319f=_0x11ee6a;_0x5b9f9f=0xc8;}else{_0x5b9f9f=0xce;}_0x1f1824[_0xcdcb('0x19')](_0x5b9f9f);return _0x1f1824[_0xcdcb('0x1d')](_0xcdcb('0x1e'),_0x1137a9+'-'+_0xa5319f+'/'+_0x11ee6a)[_0xcdcb('0x1a')](_0x59d70a);}return null;};}function patchUpdates(_0x51ca9e){return function(_0x49d81b){try{jsonpatch['apply'](_0x49d81b,_0x51ca9e,!![]);}catch(_0x29ea54){return BPromise[_0xcdcb('0x1f')](_0x29ea54);}return _0x49d81b[_0xcdcb('0x20')]();};}function saveUpdates(_0x32452a,_0x2af99b){return function(_0x4695e0){if(_0x4695e0){return _0x4695e0[_0xcdcb('0x21')](_0x32452a)[_0xcdcb('0x22')](function(_0x5a309f){return _0x5a309f;});}return null;};}function removeEntity(_0x57a6a6,_0x340328){return function(_0x10dcb8){if(_0x10dcb8){return _0x10dcb8[_0xcdcb('0x23')]()[_0xcdcb('0x22')](function(){var _0x15ee2a=_0x10dcb8[_0xcdcb('0x24')]({'plain':!![]});var _0x45ba8d=_0xcdcb('0x25');return db[_0xcdcb('0x26')][_0xcdcb('0x23')]({'where':{'type':_0x45ba8d,'resourceId':_0x15ee2a['id']}})[_0xcdcb('0x22')](function(){return _0x10dcb8;});})['then'](function(){_0x57a6a6[_0xcdcb('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x283be9,_0x499248){return function(_0x2a91a3){if(!_0x2a91a3){_0x283be9['sendStatus'](0x194);}return _0x2a91a3;};}function handleError(_0x4505fe,_0x76cab){_0x76cab=_0x76cab||0x1f4;return function(_0x592dfd){logger['error'](_0x592dfd['stack']);if(_0x592dfd[_0xcdcb('0x27')]){delete _0x592dfd[_0xcdcb('0x27')];}_0x4505fe[_0xcdcb('0x19')](_0x76cab)[_0xcdcb('0x28')](_0x592dfd);};}exports[_0xcdcb('0x29')]=function(_0xf8b12b,_0x4de65d){var _0xc74274={},_0x408c02={},_0x5b6868={'count':0x0,'rows':[]};var _0x178d94=_[_0xcdcb('0x2a')](db['Pause'][_0xcdcb('0x2b')],function(_0x36b86f){return{'name':_0x36b86f[_0xcdcb('0x2c')],'type':_0x36b86f[_0xcdcb('0x2d')]['key']};});_0x408c02['model']=_[_0xcdcb('0x2a')](_0x178d94,_0xcdcb('0x27'));_0x408c02[_0xcdcb('0x2e')]=_[_0xcdcb('0x2f')](_0xf8b12b['query']);_0x408c02[_0xcdcb('0x30')]=_[_0xcdcb('0x31')](_0x408c02[_0xcdcb('0x32')],_0x408c02[_0xcdcb('0x2e')]);_0xc74274[_0xcdcb('0x33')]=_[_0xcdcb('0x31')](_0x408c02[_0xcdcb('0x32')],qs[_0xcdcb('0x34')](_0xf8b12b[_0xcdcb('0x2e')][_0xcdcb('0x34')]));_0xc74274['attributes']=_0xc74274['attributes']['length']?_0xc74274[_0xcdcb('0x33')]:_0x408c02[_0xcdcb('0x32')];if(!_0xf8b12b['query']['hasOwnProperty'](_0xcdcb('0x35'))){_0xc74274[_0xcdcb('0x1c')]=qs[_0xcdcb('0x1c')](_0xf8b12b[_0xcdcb('0x2e')][_0xcdcb('0x1c')]);_0xc74274[_0xcdcb('0x1b')]=qs['offset'](_0xf8b12b[_0xcdcb('0x2e')][_0xcdcb('0x1b')]);}_0xc74274[_0xcdcb('0x36')]=qs[_0xcdcb('0x37')](_0xf8b12b[_0xcdcb('0x2e')][_0xcdcb('0x37')]);_0xc74274[_0xcdcb('0x38')]=qs[_0xcdcb('0x30')](_[_0xcdcb('0x39')](_0xf8b12b['query'],_0x408c02[_0xcdcb('0x30')]));if(_0xf8b12b[_0xcdcb('0x2e')][_0xcdcb('0x3a')]){_0xc74274[_0xcdcb('0x38')]=_[_0xcdcb('0x3b')](_0xc74274['where'],{'$or':_[_0xcdcb('0x2a')](_0x178d94,function(_0x291740){if(_0x291740['type']!==_0xcdcb('0x3c')){var _0x3a07a7={};_0x3a07a7[_0x291740['name']]={'$like':'%'+_0xf8b12b['query'][_0xcdcb('0x3a')]+'%'};return _0x3a07a7;}})});}_0xc74274=_[_0xcdcb('0x3b')]({},_0xc74274,_0xf8b12b[_0xcdcb('0x3d')]);var _0xf0681c={'where':_0xc74274[_0xcdcb('0x38')]};return db[_0xcdcb('0x3e')]['count'](_0xf0681c)[_0xcdcb('0x22')](function(_0x132114){_0x5b6868[_0xcdcb('0x3f')]=_0x132114;if(_0xf8b12b[_0xcdcb('0x2e')]['includeAll']){_0xc74274['include']=[{'all':!![]}];}return db[_0xcdcb('0x3e')][_0xcdcb('0x40')](_0xc74274);})[_0xcdcb('0x22')](function(_0x35fa1b){_0x5b6868[_0xcdcb('0x41')]=_0x35fa1b;return _0x5b6868;})[_0xcdcb('0x22')](respondWithFilteredResult(_0x4de65d,_0xc74274))['catch'](handleError(_0x4de65d,null));};exports[_0xcdcb('0x42')]=function(_0x535c5d,_0x4c08e1){var _0x5324e6={'raw':!![],'where':{'id':_0x535c5d[_0xcdcb('0x43')]['id']}},_0x596693={};_0x596693[_0xcdcb('0x32')]=_['keys'](db[_0xcdcb('0x3e')][_0xcdcb('0x2b')]);_0x596693[_0xcdcb('0x2e')]=_[_0xcdcb('0x2f')](_0x535c5d['query']);_0x596693[_0xcdcb('0x30')]=_[_0xcdcb('0x31')](_0x596693['model'],_0x596693[_0xcdcb('0x2e')]);_0x5324e6[_0xcdcb('0x33')]=_[_0xcdcb('0x31')](_0x596693[_0xcdcb('0x32')],qs[_0xcdcb('0x34')](_0x535c5d[_0xcdcb('0x2e')]['fields']));_0x5324e6['attributes']=_0x5324e6['attributes'][_0xcdcb('0x44')]?_0x5324e6[_0xcdcb('0x33')]:_0x596693[_0xcdcb('0x32')];if(_0x535c5d[_0xcdcb('0x2e')][_0xcdcb('0x45')]){_0x5324e6[_0xcdcb('0x46')]=[{'all':!![]}];}_0x5324e6=_[_0xcdcb('0x3b')]({},_0x5324e6,_0x535c5d[_0xcdcb('0x3d')]);return db['Pause']['find'](_0x5324e6)[_0xcdcb('0x22')](handleEntityNotFound(_0x4c08e1,null))['then'](respondWithResult(_0x4c08e1,null))[_0xcdcb('0x47')](handleError(_0x4c08e1,null));};exports[_0xcdcb('0x48')]=function(_0x4aaab8,_0x210a5e){return db['Pause'][_0xcdcb('0x48')](_0x4aaab8[_0xcdcb('0x49')],{})[_0xcdcb('0x22')](function(_0x36828b){var _0x6e8a0c=_0x4aaab8['user'][_0xcdcb('0x24')]({'plain':!![]});if(!_0x6e8a0c)throw new Error(_0xcdcb('0x4a'));if(_0x6e8a0c[_0xcdcb('0x4b')]===_0xcdcb('0x4c')){var _0xda9d1a=_0x36828b['get']({'plain':!![]});var _0x4f7118=_0xcdcb('0x25');return db[_0xcdcb('0x4d')][_0xcdcb('0x4e')]({'where':{'name':_0x4f7118,'userProfileId':_0x6e8a0c['userProfileId']},'raw':!![]})['then'](function(_0x531673){if(_0x531673&&_0x531673['autoAssociation']===0x0){return db[_0xcdcb('0x26')][_0xcdcb('0x48')]({'name':_0xda9d1a[_0xcdcb('0x27')],'resourceId':_0xda9d1a['id'],'type':_0x531673['name'],'sectionId':_0x531673['id']},{})[_0xcdcb('0x22')](function(){return _0x36828b;});}else{return _0x36828b;}})['catch'](function(_0x69c749){logger[_0xcdcb('0x4f')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x69c749);throw _0x69c749;});}return _0x36828b;})['then'](respondWithResult(_0x210a5e,0xc9))['catch'](handleError(_0x210a5e,null));};exports[_0xcdcb('0x21')]=function(_0x3c289f,_0x3bd281){if(_0x3c289f[_0xcdcb('0x49')]['id']){delete _0x3c289f[_0xcdcb('0x49')]['id'];}return db[_0xcdcb('0x3e')][_0xcdcb('0x4e')]({'where':{'id':_0x3c289f[_0xcdcb('0x43')]['id']}})[_0xcdcb('0x22')](handleEntityNotFound(_0x3bd281,null))['then'](saveUpdates(_0x3c289f[_0xcdcb('0x49')],null))[_0xcdcb('0x22')](respondWithResult(_0x3bd281,null))[_0xcdcb('0x47')](handleError(_0x3bd281,null));};exports[_0xcdcb('0x23')]=function(_0x289585,_0x4d4acb){return db[_0xcdcb('0x3e')][_0xcdcb('0x4e')]({'where':{'id':_0x289585['params']['id']}})['then'](handleEntityNotFound(_0x4d4acb,null))[_0xcdcb('0x22')](removeEntity(_0x4d4acb,null))[_0xcdcb('0x47')](handleError(_0x4d4acb,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index 5e7f0ed..9d02c58 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 _0x583c=['util','../../config/logger','api','bluebird','request-promise','../../config/environment','./pause.attributes','define','Pause','lodash'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x583c,0x12b));var _0xc583=function(_0x31cc0e,_0x24ba4c){_0x31cc0e=_0x31cc0e-0x0;var _0x144862=_0x583c[_0x31cc0e];return _0x144862;};'use strict';var _=require(_0xc583('0x0'));var util=require(_0xc583('0x1'));var logger=require(_0xc583('0x2'))(_0xc583('0x3'));var moment=require('moment');var BPromise=require(_0xc583('0x4'));var rp=require(_0xc583('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc583('0x6'));var attributes=require(_0xc583('0x7'));module['exports']=function(_0xd3a750,_0x365ed6){return _0xd3a750[_0xc583('0x8')](_0xc583('0x9'),attributes,{'tableName':'tools_pauses','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8ed7=['path','rimraf','../../config/environment','./pause.attributes','exports','define','tools_pauses','util','../../config/logger','api','request-promise'];(function(_0x54b458,_0x4da21b){var _0x18d704=function(_0x3ca278){while(--_0x3ca278){_0x54b458['push'](_0x54b458['shift']());}};_0x18d704(++_0x4da21b);}(_0x8ed7,0x8b));var _0x78ed=function(_0x2c624e,_0x1338f0){_0x2c624e=_0x2c624e-0x0;var _0x278868=_0x8ed7[_0x2c624e];return _0x278868;};'use strict';var _=require('lodash');var util=require(_0x78ed('0x0'));var logger=require(_0x78ed('0x1'))(_0x78ed('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x78ed('0x3'));var fs=require('fs');var path=require(_0x78ed('0x4'));var rimraf=require(_0x78ed('0x5'));var config=require(_0x78ed('0x6'));var attributes=require(_0x78ed('0x7'));module[_0x78ed('0x8')]=function(_0x3d8efa,_0x42094f){return _0x3d8efa[_0x78ed('0x9')]('Pause',attributes,{'tableName':_0x78ed('0xa'),'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 964a461..b209947 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 _0x141a=['error','code','message','result','Pause','options','raw','where','attributes','include','map','model','ShowPause','stringify','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s'];(function(_0x5b1daa,_0x60119b){var _0x270f02=function(_0x5702ca){while(--_0x5702ca){_0x5b1daa['push'](_0x5b1daa['shift']());}};_0x270f02(++_0x60119b);}(_0x141a,0xfd));var _0xa141=function(_0x35cf4b,_0x29d60f){_0x35cf4b=_0x35cf4b-0x0;var _0x15d7d4=_0x141a[_0x35cf4b];return _0x15d7d4;};'use strict';var _=require(_0xa141('0x0'));var util=require(_0xa141('0x1'));var moment=require('moment');var BPromise=require(_0xa141('0x2'));var rs=require(_0xa141('0x3'));var fs=require('fs');var Redis=require(_0xa141('0x4'));var db=require(_0xa141('0x5'))['db'];var utils=require(_0xa141('0x6'));var logger=require(_0xa141('0x7'))(_0xa141('0x8'));var config=require(_0xa141('0x9'));var jayson=require(_0xa141('0xa'));var client=jayson[_0xa141('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x128ec0,_0x1c1ccd,_0x239479){return new BPromise(function(_0x18a05d,_0x5ee0d8){return client[_0xa141('0xc')](_0x128ec0,_0x239479)[_0xa141('0xd')](function(_0xa1f4b4){logger[_0xa141('0xe')](_0xa141('0xf'),_0x1c1ccd,_0xa141('0x10'));logger[_0xa141('0x11')](_0xa141('0x12'),_0x1c1ccd,_0xa141('0x10'),JSON['stringify'](_0xa1f4b4));if(_0xa1f4b4[_0xa141('0x13')]){if(_0xa1f4b4[_0xa141('0x13')][_0xa141('0x14')]===0x1f4){logger[_0xa141('0x13')](_0xa141('0xf'),_0x1c1ccd,_0xa1f4b4['error'][_0xa141('0x15')]);return _0x5ee0d8(_0xa1f4b4['error']['message']);}logger[_0xa141('0x13')](_0xa141('0xf'),_0x1c1ccd,_0xa1f4b4[_0xa141('0x13')]['message']);return _0x18a05d(_0xa1f4b4[_0xa141('0x13')]['message']);}else{logger[_0xa141('0xe')]('Pause,\x20%s,\x20%s',_0x1c1ccd,_0xa141('0x10'));_0x18a05d(_0xa1f4b4[_0xa141('0x16')]['message']);}})['catch'](function(_0x364d30){logger[_0xa141('0x13')]('Pause,\x20%s,\x20%s',_0x1c1ccd,_0x364d30);_0x5ee0d8(_0x364d30);});});}exports['ShowPause']=function(_0x1249f7){var _0x5085b2=this;return new Promise(function(_0x2196e7,_0xb33878){return db[_0xa141('0x17')]['find']({'raw':_0x1249f7[_0xa141('0x18')]?_0x1249f7[_0xa141('0x18')][_0xa141('0x19')]===undefined?!![]:![]:!![],'where':_0x1249f7['options']?_0x1249f7[_0xa141('0x18')][_0xa141('0x1a')]||null:null,'attributes':_0x1249f7[_0xa141('0x18')]?_0x1249f7[_0xa141('0x18')][_0xa141('0x1b')]||null:null,'include':_0x1249f7[_0xa141('0x18')]?_0x1249f7[_0xa141('0x18')][_0xa141('0x1c')]?_[_0xa141('0x1d')](_0x1249f7['options'][_0xa141('0x1c')],function(_0x58b74e){return{'model':db[_0x58b74e[_0xa141('0x1e')]],'as':_0x58b74e['as'],'attributes':_0x58b74e[_0xa141('0x1b')],'include':_0x58b74e[_0xa141('0x1c')]?_['map'](_0x58b74e[_0xa141('0x1c')],function(_0x379732){return{'model':db[_0x379732['model']],'as':_0x379732['as'],'attributes':_0x379732[_0xa141('0x1b')],'include':_0x379732['include']?_['map'](_0x379732[_0xa141('0x1c')],function(_0xb74de5){return{'model':db[_0xb74de5['model']],'as':_0xb74de5['as'],'attributes':_0xb74de5[_0xa141('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x90ed78){logger[_0xa141('0xe')](_0xa141('0x1f'),_0x1249f7);logger['debug'](_0xa141('0x1f'),_0x1249f7,JSON[_0xa141('0x20')](_0x90ed78));_0x2196e7(_0x90ed78);})[_0xa141('0x21')](function(_0x1b83f3){logger['error']('ShowPause',_0x1b83f3[_0xa141('0x15')],_0x1249f7);_0xb33878(_0x5085b2[_0xa141('0x13')](0x1f4,_0x1b83f3[_0xa141('0x15')]));});});}; \ No newline at end of file +var _0xf1e1=['rpc','../../config/environment','jayson/promise','client','http','request','info','Pause,\x20%s,\x20%s','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowPause','Pause','find','options','where','attributes','include','model','map','then','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x3686f4,_0xd4a373){var _0x168f2b=function(_0x352038){while(--_0x352038){_0x3686f4['push'](_0x3686f4['shift']());}};_0x168f2b(++_0xd4a373);}(_0xf1e1,0x102));var _0x1f1e=function(_0x21cb7f,_0x48cd16){_0x21cb7f=_0x21cb7f-0x0;var _0x5a079a=_0xf1e1[_0x21cb7f];return _0x5a079a;};'use strict';var _=require(_0x1f1e('0x0'));var util=require('util');var moment=require(_0x1f1e('0x1'));var BPromise=require('bluebird');var rs=require(_0x1f1e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1f1e('0x3'))['db'];var utils=require(_0x1f1e('0x4'));var logger=require(_0x1f1e('0x5'))(_0x1f1e('0x6'));var config=require(_0x1f1e('0x7'));var jayson=require(_0x1f1e('0x8'));var client=jayson[_0x1f1e('0x9')][_0x1f1e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1db643,_0x38585e,_0x46e32b){return new BPromise(function(_0x3699d2,_0x6ab45b){return client[_0x1f1e('0xb')](_0x1db643,_0x46e32b)['then'](function(_0x44e626){logger[_0x1f1e('0xc')](_0x1f1e('0xd'),_0x38585e,_0x1f1e('0xe'));logger[_0x1f1e('0xf')](_0x1f1e('0x10'),_0x38585e,_0x1f1e('0xe'),JSON[_0x1f1e('0x11')](_0x44e626));if(_0x44e626[_0x1f1e('0x12')]){if(_0x44e626['error'][_0x1f1e('0x13')]===0x1f4){logger[_0x1f1e('0x12')](_0x1f1e('0xd'),_0x38585e,_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);return _0x6ab45b(_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);}logger['error'](_0x1f1e('0xd'),_0x38585e,_0x44e626[_0x1f1e('0x12')]['message']);return _0x3699d2(_0x44e626[_0x1f1e('0x12')][_0x1f1e('0x14')]);}else{logger['info'](_0x1f1e('0xd'),_0x38585e,_0x1f1e('0xe'));_0x3699d2(_0x44e626[_0x1f1e('0x15')][_0x1f1e('0x14')]);}})[_0x1f1e('0x16')](function(_0x3f978f){logger[_0x1f1e('0x12')](_0x1f1e('0xd'),_0x38585e,_0x3f978f);_0x6ab45b(_0x3f978f);});});}exports[_0x1f1e('0x17')]=function(_0x4d0882){var _0x4b876c=this;return new Promise(function(_0x14f812,_0x5702db){return db[_0x1f1e('0x18')][_0x1f1e('0x19')]({'raw':_0x4d0882[_0x1f1e('0x1a')]?_0x4d0882['options']['raw']===undefined?!![]:![]:!![],'where':_0x4d0882['options']?_0x4d0882[_0x1f1e('0x1a')][_0x1f1e('0x1b')]||null:null,'attributes':_0x4d0882[_0x1f1e('0x1a')]?_0x4d0882[_0x1f1e('0x1a')][_0x1f1e('0x1c')]||null:null,'include':_0x4d0882[_0x1f1e('0x1a')]?_0x4d0882[_0x1f1e('0x1a')][_0x1f1e('0x1d')]?_['map'](_0x4d0882['options']['include'],function(_0x413b14){return{'model':db[_0x413b14[_0x1f1e('0x1e')]],'as':_0x413b14['as'],'attributes':_0x413b14[_0x1f1e('0x1c')],'include':_0x413b14[_0x1f1e('0x1d')]?_['map'](_0x413b14[_0x1f1e('0x1d')],function(_0x17dc6c){return{'model':db[_0x17dc6c[_0x1f1e('0x1e')]],'as':_0x17dc6c['as'],'attributes':_0x17dc6c['attributes'],'include':_0x17dc6c['include']?_[_0x1f1e('0x1f')](_0x17dc6c[_0x1f1e('0x1d')],function(_0x430310){return{'model':db[_0x430310['model']],'as':_0x430310['as'],'attributes':_0x430310[_0x1f1e('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x1f1e('0x20')](function(_0x5294bf){logger[_0x1f1e('0xc')]('ShowPause',_0x4d0882);logger[_0x1f1e('0xf')](_0x1f1e('0x17'),_0x4d0882,JSON[_0x1f1e('0x11')](_0x5294bf));_0x14f812(_0x5294bf);})[_0x1f1e('0x16')](function(_0xa2076c){logger[_0x1f1e('0x12')]('ShowPause',_0xa2076c[_0x1f1e('0x14')],_0x4d0882);_0x5702db(_0x4b876c[_0x1f1e('0x12')](0x1f4,_0xa2076c[_0x1f1e('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index 88e29f1..3e8aff9 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 _0xaef0=['format','basename','now','extname','single','file','upload','webhookPost','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','get','isAuthenticated','index','/webhook','webhookGet','/:id','/:id/download','download','join','root','server/files/plugins','originalname'];(function(_0x5e9a69,_0x40c0ec){var _0x5979c8=function(_0x293da2){while(--_0x293da2){_0x5e9a69['push'](_0x5e9a69['shift']());}};_0x5979c8(++_0x40c0ec);}(_0xaef0,0x65));var _0x0aef=function(_0x50cfc3,_0x526cc6){_0x50cfc3=_0x50cfc3-0x0;var _0x5c11ef=_0xaef0[_0x50cfc3];return _0x5c11ef;};'use strict';var multer=require(_0x0aef('0x0'));var util=require(_0x0aef('0x1'));var path=require(_0x0aef('0x2'));var timeout=require(_0x0aef('0x3'));var express=require(_0x0aef('0x4'));var router=express[_0x0aef('0x5')]();var auth=require(_0x0aef('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./plugin.controller');router[_0x0aef('0x7')]('/',auth[_0x0aef('0x8')](),controller[_0x0aef('0x9')]);router[_0x0aef('0x7')](_0x0aef('0xa'),controller[_0x0aef('0xb')]);router[_0x0aef('0x7')](_0x0aef('0xc'),auth[_0x0aef('0x8')](),controller['show']);router[_0x0aef('0x7')](_0x0aef('0xd'),auth[_0x0aef('0x8')](),controller[_0x0aef('0xe')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x21d669,_0x322c52,_0x5a2a5e){_0x5a2a5e(null,path[_0x0aef('0xf')](config[_0x0aef('0x10')],_0x0aef('0x11')));},'filename':function(_0x3e26ba,_0x118d1a,_0x548849){_0x118d1a[_0x0aef('0x12')]=_0x118d1a[_0x0aef('0x12')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x548849(null,util[_0x0aef('0x13')]('%s-%s%s',path[_0x0aef('0x14')](_0x118d1a['originalname'],path['extname'](_0x118d1a[_0x0aef('0x12')])),Date[_0x0aef('0x15')](),path[_0x0aef('0x16')](_0x118d1a['originalname'])));}})});router['post']('/',upload[_0x0aef('0x17')](_0x0aef('0x18')),controller[_0x0aef('0x19')]);router['post'](_0x0aef('0xa'),controller[_0x0aef('0x1a')]);router[_0x0aef('0x1b')](_0x0aef('0xc'),auth['isAuthenticated'](),controller[_0x0aef('0x1c')]);router[_0x0aef('0x1d')]('/:id',auth[_0x0aef('0x8')](),controller[_0x0aef('0x1d')]);module['exports']=router; \ No newline at end of file +var _0x8b1f=['post','file','put','update','delete','exports','multer','util','path','connect-timeout','../../components/auth/service','./plugin.controller','get','isAuthenticated','/webhook','webhookGet','/:id','show','download','diskStorage','join','originalname','replace','format','%s-%s%s','basename','extname','now'];(function(_0x25c9bd,_0x5e8bbf){var _0x27035e=function(_0x16ae1a){while(--_0x16ae1a){_0x25c9bd['push'](_0x25c9bd['shift']());}};_0x27035e(++_0x5e8bbf);}(_0x8b1f,0x1c6));var _0xf8b1=function(_0x39aaae,_0xb759bf){_0x39aaae=_0x39aaae-0x0;var _0x201706=_0x8b1f[_0x39aaae];return _0x201706;};'use strict';var multer=require(_0xf8b1('0x0'));var util=require(_0xf8b1('0x1'));var path=require(_0xf8b1('0x2'));var timeout=require(_0xf8b1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xf8b1('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf8b1('0x5'));router[_0xf8b1('0x6')]('/',auth[_0xf8b1('0x7')](),controller['index']);router[_0xf8b1('0x6')](_0xf8b1('0x8'),controller[_0xf8b1('0x9')]);router[_0xf8b1('0x6')](_0xf8b1('0xa'),auth[_0xf8b1('0x7')](),controller[_0xf8b1('0xb')]);router[_0xf8b1('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0xf8b1('0xc')]);var upload=multer({'storage':multer[_0xf8b1('0xd')]({'destination':function(_0x5c67a5,_0x71c976,_0x5b421c){_0x5b421c(null,path[_0xf8b1('0xe')](config['root'],'server/files/plugins'));},'filename':function(_0x1a2331,_0x30f361,_0x1e1e13){_0x30f361[_0xf8b1('0xf')]=_0x30f361[_0xf8b1('0xf')][_0xf8b1('0x10')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1e1e13(null,util[_0xf8b1('0x11')](_0xf8b1('0x12'),path[_0xf8b1('0x13')](_0x30f361['originalname'],path[_0xf8b1('0x14')](_0x30f361['originalname'])),Date[_0xf8b1('0x15')](),path['extname'](_0x30f361[_0xf8b1('0xf')])));}})});router[_0xf8b1('0x16')]('/',upload['single'](_0xf8b1('0x17')),controller['upload']);router['post'](_0xf8b1('0x8'),controller['webhookPost']);router[_0xf8b1('0x18')](_0xf8b1('0xa'),auth['isAuthenticated'](),controller[_0xf8b1('0x19')]);router[_0xf8b1('0x1a')]('/:id',auth[_0xf8b1('0x7')](),controller[_0xf8b1('0x1a')]);module[_0xf8b1('0x1b')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index d3951b1..8a7257c 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 _0x9613=['BOOLEAN','adminOnly','agentOnly','always','never','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.','sequelize','STRING','html','script','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'];(function(_0x3437fb,_0x591ee6){var _0x52cbde=function(_0x3341a0){while(--_0x3341a0){_0x3437fb['push'](_0x3437fb['shift']());}};_0x52cbde(++_0x591ee6);}(_0x9613,0x17a));var _0x3961=function(_0x3a3c82,_0x4dac11){_0x3a3c82=_0x3a3c82-0x0;var _0x10a587=_0x9613[_0x3a3c82];return _0x10a587;};'use strict';var Sequelize=require(_0x3961('0x0'));module['exports']={'name':{'type':Sequelize[_0x3961('0x1')]},'type':{'type':Sequelize['ENUM'](_0x3961('0x2'),_0x3961('0x3'))},'description':{'type':Sequelize[_0x3961('0x4')]},'version':{'type':Sequelize[_0x3961('0x4')]},'path':{'type':Sequelize[_0x3961('0x1')],'comment':_0x3961('0x5')},'active':{'type':Sequelize[_0x3961('0x6')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize['ENUM'](_0x3961('0x7'),_0x3961('0x8'),_0x3961('0x9'),_0x3961('0xa')),'defaultValue':_0x3961('0x9'),'comment':_0x3961('0xb')},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x3961('0x1')]},'scriptName':{'type':Sequelize[_0x3961('0x1')]},'scriptPath':{'type':Sequelize[_0x3961('0x1')]}}; \ No newline at end of file +var _0x3487=['sequelize','exports','STRING','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','ENUM','adminOnly','always','Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'];(function(_0x67c774,_0xeb56c7){var _0x4ee08d=function(_0x224290){while(--_0x224290){_0x67c774['push'](_0x67c774['shift']());}};_0x4ee08d(++_0xeb56c7);}(_0x3487,0xd8));var _0x7348=function(_0x1b745b,_0x3e2d40){_0x1b745b=_0x1b745b-0x0;var _0x120a9d=_0x3487[_0x1b745b];return _0x120a9d;};'use strict';var Sequelize=require(_0x7348('0x0'));module[_0x7348('0x1')]={'name':{'type':Sequelize[_0x7348('0x2')]},'type':{'type':Sequelize['ENUM'](_0x7348('0x3'),_0x7348('0x4'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x7348('0x5')]},'path':{'type':Sequelize[_0x7348('0x2')],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x7348('0x6')],'defaultValue':0x0,'comment':_0x7348('0x7')},'sidebar':{'type':Sequelize[_0x7348('0x8')](_0x7348('0x9'),'agentOnly',_0x7348('0xa'),'never'),'defaultValue':'always','comment':_0x7348('0xb')},'icon':{'type':Sequelize[_0x7348('0x2')]},'adminUrl':{'type':Sequelize['STRING']},'agentUrl':{'type':Sequelize[_0x7348('0x2')]},'scriptName':{'type':Sequelize['STRING']},'scriptPath':{'type':Sequelize[_0x7348('0x2')]}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index f88f23d..0d1704c 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 _0x50f5=['glob','**/*','server/files/plugins','dirname','attachments/**/*','finalize','existsSync','download','format','%s.zip','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','Invalid\x20plugin\x20structure','lstatSync','isFile','isDirectory','readdirSync','some','Plugin\x20manifest\x20missing','manifest.json','undefined','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','views','Invalid\x20manifest:\x20views\x20missing','admin','agent','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','always','icon','icon-apps','html','Warning:\x20admin\x20view\x20not\x20specified','test','plugins','scriptPath','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','send','Zip\x20archive\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','archiver','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','count','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','index','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','Plugin','includeAll','include','findAll','catch','show','fields','length','find','params','join','root','basename','zip','warning','code','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','pipe'];(function(_0x45f07b,_0x2a3ad7){var _0x4ebd3d=function(_0x2cff0f){while(--_0x2cff0f){_0x45f07b['push'](_0x45f07b['shift']());}};_0x4ebd3d(++_0x2a3ad7);}(_0x50f5,0x1a4));var _0x550f=function(_0x1b0e80,_0x1af030){_0x1b0e80=_0x1b0e80-0x0;var _0x4c5331=_0x50f5[_0x1b0e80];return _0x4c5331;};'use strict';var pdf=require(_0x550f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x550f('0x1'));var zipdir=require(_0x550f('0x2'));var jsonpatch=require(_0x550f('0x3'));var rp=require('request-promise');var moment=require(_0x550f('0x4'));var BPromise=require(_0x550f('0x5'));var Mustache=require('mustache');var util=require(_0x550f('0x6'));var path=require(_0x550f('0x7'));var sox=require(_0x550f('0x8'));var csv=require('to-csv');var ejs=require(_0x550f('0x9'));var fs=require('fs');var _=require(_0x550f('0xa'));var squel=require(_0x550f('0xb'));var crypto=require(_0x550f('0xc'));var jsforce=require(_0x550f('0xd'));var deskjs=require(_0x550f('0xe'));var toCsv=require(_0x550f('0xf'));var querystring=require('querystring');var Papa=require(_0x550f('0x10'));var extract=require('extract-zip');var rimraf=require(_0x550f('0x1'));var archiver=require(_0x550f('0x11'));var Redis=require(_0x550f('0x12'));var authService=require(_0x550f('0x13'));var qs=require(_0x550f('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x550f('0x15'))(_0x550f('0x16'));var utils=require(_0x550f('0x17'));var config=require(_0x550f('0x18'));var db=require(_0x550f('0x19'))['db'];config['redis']=_[_0x550f('0x1a')](config[_0x550f('0x1b')],{'host':'localhost','port':0x18eb});var socket=require(_0x550f('0x1c'))(new Redis(config[_0x550f('0x1b')]));require(_0x550f('0x1d'))[_0x550f('0x1e')](socket);function respondWithStatusCode(_0x52b63c,_0x392638){_0x392638=_0x392638||0xcc;return function(_0x5c1a4a){if(_0x5c1a4a){return _0x52b63c[_0x550f('0x1f')](_0x392638);}return _0x52b63c[_0x550f('0x20')](_0x392638)['end']();};}function respondWithResult(_0x1b6851,_0x582665){_0x582665=_0x582665||0xc8;return function(_0x535540){if(_0x535540){return _0x1b6851['status'](_0x582665)['json'](_0x535540);}};}function respondWithFilteredResult(_0x1d34ce,_0x5ce4a0){return function(_0x4a916b){if(_0x4a916b){var _0x2d0dd4=_0x4a916b[_0x550f('0x21')],_0x1ecd8e=_0x5ce4a0['offset'],_0xd9e188=_0x5ce4a0['offset']+_0x5ce4a0[_0x550f('0x22')],_0x596105;if(_0xd9e188>=_0x2d0dd4){_0xd9e188=_0x2d0dd4;_0x596105=0xc8;}else{_0x596105=0xce;}_0x1d34ce[_0x550f('0x20')](_0x596105);return _0x1d34ce[_0x550f('0x23')](_0x550f('0x24'),_0x1ecd8e+'-'+_0xd9e188+'/'+_0x2d0dd4)[_0x550f('0x25')](_0x4a916b);}return null;};}function patchUpdates(_0x3d8fca){return function(_0x19425c){try{jsonpatch[_0x550f('0x26')](_0x19425c,_0x3d8fca,!![]);}catch(_0xcef05c){return BPromise[_0x550f('0x27')](_0xcef05c);}return _0x19425c[_0x550f('0x28')]();};}function saveUpdates(_0xf92f50,_0x54951c){return function(_0xf6b400){if(_0xf6b400){return _0xf6b400[_0x550f('0x29')](_0xf92f50)[_0x550f('0x2a')](function(_0x338899){return _0x338899;});}return null;};}function removeEntity(_0x502882,_0x565377){return function(_0x1f78cb){if(_0x1f78cb){return _0x1f78cb['destroy']()[_0x550f('0x2a')](function(){var _0x22a474=_0x1f78cb['get']({'plain':!![]});var _0x47579d='Plugins';return db['UserProfileResource'][_0x550f('0x2b')]({'where':{'type':_0x47579d,'resourceId':_0x22a474['id']}})[_0x550f('0x2a')](function(){return _0x1f78cb;});})['then'](function(){_0x502882[_0x550f('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe81e5c,_0xa89fd7){return function(_0x326f18){if(!_0x326f18){_0xe81e5c[_0x550f('0x1f')](0x194);}return _0x326f18;};}function handleError(_0x495f77,_0x159042){_0x159042=_0x159042||0x1f4;return function(_0x2b9047){logger[_0x550f('0x2c')](_0x2b9047[_0x550f('0x2d')]);if(_0x2b9047['name']){delete _0x2b9047[_0x550f('0x2e')];}_0x495f77[_0x550f('0x20')](_0x159042)['send'](_0x2b9047);};}exports[_0x550f('0x2f')]=function(_0x4c3fd3,_0x444631){var _0x315aae={},_0x2c7e51={},_0x1979ea={'count':0x0,'rows':[]};var _0x45f970=_[_0x550f('0x30')](db['Plugin'][_0x550f('0x31')],function(_0x5b0cb6){return{'name':_0x5b0cb6[_0x550f('0x32')],'type':_0x5b0cb6[_0x550f('0x33')][_0x550f('0x34')]};});_0x2c7e51['model']=_['map'](_0x45f970,_0x550f('0x2e'));_0x2c7e51[_0x550f('0x35')]=_[_0x550f('0x36')](_0x4c3fd3['query']);_0x2c7e51[_0x550f('0x37')]=_[_0x550f('0x38')](_0x2c7e51[_0x550f('0x39')],_0x2c7e51[_0x550f('0x35')]);_0x315aae[_0x550f('0x3a')]=_['intersection'](_0x2c7e51[_0x550f('0x39')],qs['fields'](_0x4c3fd3[_0x550f('0x35')]['fields']));_0x315aae[_0x550f('0x3a')]=_0x315aae[_0x550f('0x3a')]['length']?_0x315aae[_0x550f('0x3a')]:_0x2c7e51[_0x550f('0x39')];if(!_0x4c3fd3[_0x550f('0x35')][_0x550f('0x3b')](_0x550f('0x3c'))){_0x315aae[_0x550f('0x22')]=qs[_0x550f('0x22')](_0x4c3fd3[_0x550f('0x35')][_0x550f('0x22')]);_0x315aae['offset']=qs[_0x550f('0x3d')](_0x4c3fd3[_0x550f('0x35')]['offset']);}_0x315aae[_0x550f('0x3e')]=qs['sort'](_0x4c3fd3[_0x550f('0x35')][_0x550f('0x3f')]);_0x315aae[_0x550f('0x40')]=qs[_0x550f('0x37')](_[_0x550f('0x41')](_0x4c3fd3[_0x550f('0x35')],_0x2c7e51['filters']));if(_0x4c3fd3[_0x550f('0x35')][_0x550f('0x42')]){_0x315aae[_0x550f('0x40')]=_[_0x550f('0x43')](_0x315aae[_0x550f('0x40')],{'$or':_['map'](_0x45f970,function(_0x17b074){if(_0x17b074[_0x550f('0x33')]!==_0x550f('0x44')){var _0x532050={};_0x532050[_0x17b074[_0x550f('0x2e')]]={'$like':'%'+_0x4c3fd3[_0x550f('0x35')][_0x550f('0x42')]+'%'};return _0x532050;}})});}_0x315aae=_[_0x550f('0x43')]({},_0x315aae,_0x4c3fd3[_0x550f('0x45')]);var _0x32ee4a={'where':_0x315aae['where']};return db[_0x550f('0x46')]['count'](_0x32ee4a)[_0x550f('0x2a')](function(_0x56647a){_0x1979ea[_0x550f('0x21')]=_0x56647a;if(_0x4c3fd3[_0x550f('0x35')][_0x550f('0x47')]){_0x315aae[_0x550f('0x48')]=[{'all':!![]}];}return db[_0x550f('0x46')][_0x550f('0x49')](_0x315aae);})[_0x550f('0x2a')](function(_0x427979){_0x1979ea['rows']=_0x427979;return _0x1979ea;})[_0x550f('0x2a')](respondWithFilteredResult(_0x444631,_0x315aae))[_0x550f('0x4a')](handleError(_0x444631,null));};exports[_0x550f('0x4b')]=function(_0x2a7533,_0x107bb3){var _0xe909e2={'raw':!![],'where':{'id':_0x2a7533['params']['id']}},_0x5e1e86={};_0x5e1e86[_0x550f('0x39')]=_[_0x550f('0x36')](db[_0x550f('0x46')][_0x550f('0x31')]);_0x5e1e86[_0x550f('0x35')]=_[_0x550f('0x36')](_0x2a7533[_0x550f('0x35')]);_0x5e1e86[_0x550f('0x37')]=_[_0x550f('0x38')](_0x5e1e86[_0x550f('0x39')],_0x5e1e86['query']);_0xe909e2[_0x550f('0x3a')]=_['intersection'](_0x5e1e86[_0x550f('0x39')],qs[_0x550f('0x4c')](_0x2a7533[_0x550f('0x35')][_0x550f('0x4c')]));_0xe909e2[_0x550f('0x3a')]=_0xe909e2[_0x550f('0x3a')][_0x550f('0x4d')]?_0xe909e2[_0x550f('0x3a')]:_0x5e1e86[_0x550f('0x39')];if(_0x2a7533[_0x550f('0x35')]['includeAll']){_0xe909e2[_0x550f('0x48')]=[{'all':!![]}];}_0xe909e2=_['merge']({},_0xe909e2,_0x2a7533[_0x550f('0x45')]);return db['Plugin']['find'](_0xe909e2)[_0x550f('0x2a')](handleEntityNotFound(_0x107bb3,null))[_0x550f('0x2a')](respondWithResult(_0x107bb3,null))['catch'](handleError(_0x107bb3,null));};exports['download']=function(_0x4d5f9a,_0x559221,_0x5c47bb){return db[_0x550f('0x46')][_0x550f('0x4e')]({'where':{'id':_0x4d5f9a[_0x550f('0x4f')]['id']},'attributes':[_0x550f('0x2e'),_0x550f('0x7')],'raw':!![]})['then'](handleEntityNotFound(_0x559221,null))[_0x550f('0x2a')](function(_0x2cd9da){if(_0x2cd9da){var _0x248827=path[_0x550f('0x50')](config[_0x550f('0x51')],'server/files/plugins',util['format']('%s.zip',path[_0x550f('0x52')](_0x2cd9da[_0x550f('0x7')])));var _0x24f984=fs['createWriteStream'](_0x248827);var _0x19f671=archiver(_0x550f('0x53'),{'zlib':{'level':0x9}});_0x19f671['on'](_0x550f('0x54'),function(_0x5ba04d){if(_0x5ba04d[_0x550f('0x55')]==='ENOENT'){logger[_0x550f('0x2c')](_0x5ba04d);}else{throw new db[(_0x550f('0x56'))][(_0x550f('0x57'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x19f671['on']('error',function(_0x29b083){throw new db[(_0x550f('0x56'))]['Error'](_0x550f('0x58'));});_0x19f671[_0x550f('0x59')](_0x24f984);_0x19f671[_0x550f('0x5a')](_0x550f('0x5b'),{'cwd':path[_0x550f('0x50')](config[_0x550f('0x51')],_0x550f('0x5c'),path[_0x550f('0x5d')](_0x2cd9da[_0x550f('0x7')])),'ignore':[path[_0x550f('0x50')](path[_0x550f('0x52')](_0x2cd9da[_0x550f('0x7')]),'node_modules/**/*'),path[_0x550f('0x50')](path[_0x550f('0x52')](_0x2cd9da['path']),_0x550f('0x5e'))],'nodir':!![]})[_0x550f('0x5f')]();_0x24f984['on']('close',function(){if(!fs[_0x550f('0x60')](_0x248827)){throw new db['Sequelize'][(_0x550f('0x57'))]('Plugin\x20not\x20found');}return _0x559221[_0x550f('0x61')](_0x248827,util[_0x550f('0x62')](_0x550f('0x63'),path[_0x550f('0x52')](_0x2cd9da['path'])),function(_0x1c5cc7){if(_0x1c5cc7){throw new db[(_0x550f('0x56'))][(_0x550f('0x57'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0x550f('0x64')](_0x248827);logger[_0x550f('0x65')](_0x550f('0x66'));logger[_0x550f('0x65')](_0x550f('0x67'));});});}return null;})['catch'](handleError(_0x559221,null));};exports[_0x550f('0x68')]=function(_0xb5b830,_0x3984dc,_0x215095){var _0x150d1f=path[_0x550f('0x52')](_0xb5b830[_0x550f('0x69')][_0x550f('0x6a')],path[_0x550f('0x6b')](_0xb5b830['file'][_0x550f('0x6a')]));var _0x2ebdd6=path[_0x550f('0x50')](config['root'],'server/files/plugins',_0xb5b830[_0x550f('0x69')][_0x550f('0x6a')]);var _0x203492=path['join'](config[_0x550f('0x51')],_0x550f('0x5c'),_0x150d1f);logger[_0x550f('0x65')](_0x550f('0x6c'),_0x2ebdd6);logger[_0x550f('0x65')](_0x550f('0x6d'),_0x203492);try{fs[_0x550f('0x6e')](_0x2ebdd6,parseInt(_0x550f('0x6f'),0x8));extract(_0x2ebdd6,{'dir':_0x203492},function(_0x508ca8){if(_0x508ca8){logger[_0x550f('0x2c')](_0x508ca8);handleError(_0x508ca8,!![]);};var _0x5a4039=fs['readdirSync'](_0x203492);if(_0x5a4039[_0x550f('0x4d')]>0x1){removeReferences(_0x2ebdd6,_0x203492);logger[_0x550f('0x2c')](_0x550f('0x70'));return _0x215095(new Error(_0x550f('0x70')));}var _0x36c93c=fs[_0x550f('0x71')](path['join'](_0x203492,_0x5a4039[0x0]));if(_0x36c93c[_0x550f('0x72')]()){removeReferences(_0x2ebdd6,_0x203492);logger[_0x550f('0x2c')](_0x550f('0x70'));return _0x215095(new Error(_0x550f('0x70')));}if(_0x36c93c[_0x550f('0x73')]()){var _0xbbaeb8=fs[_0x550f('0x74')](path['join'](_0x203492,_0x5a4039[0x0]));if(_0xbbaeb8[_0x550f('0x4d')]===0x0){removeReferences(_0x2ebdd6,_0x203492);logger[_0x550f('0x2c')]('Invalid\x20plugin\x20structure');return _0x215095(new Error(_0x550f('0x70')));}var _0x1daa57=_0xbbaeb8[_0x550f('0x75')](function(_0xe17b48){return _0xe17b48==='manifest.json';});if(!_0x1daa57){return _0x215095(new Error(_0x550f('0x76')));}var _0x28200b=fs['readFileSync'](path[_0x550f('0x50')](_0x203492,_0x5a4039[0x0],_0x550f('0x77')));var _0x51cc44=JSON['parse'](_0x28200b);if('undefined'==typeof _0x51cc44[_0x550f('0x2e')]){return _0x215095(new Error('Invalid\x20manifest:\x20name\x20missing'));}if(_0x550f('0x78')==typeof _0x51cc44[_0x550f('0x33')]){return _0x215095(new Error('Invalid\x20manifest:\x20type\x20missing'));}if(_0x550f('0x78')==typeof _0x51cc44[_0x550f('0x79')]){return _0x215095(new Error(_0x550f('0x7a')));}if('undefined'==typeof _0x51cc44[_0x550f('0x7b')]){return _0x215095(new Error('Invalid\x20manifest:\x20parameters\x20missing'));}if(_0x51cc44[_0x550f('0x33')]==='html'){if(_0x550f('0x78')==typeof _0x51cc44[_0x550f('0x7b')][_0x550f('0x7c')]){return _0x215095(new Error(_0x550f('0x7d')));}if(_0x550f('0x78')==typeof _0x51cc44[_0x550f('0x7b')][_0x550f('0x7c')][_0x550f('0x7e')]&&'undefined'==typeof _0x51cc44['parameters'][_0x550f('0x7c')][_0x550f('0x7f')]){return _0x215095(new Error('Invalid\x20manifest:\x20no\x20view\x20specified'));}}else if(_0x51cc44[_0x550f('0x33')]===_0x550f('0x80')){if(_0x550f('0x78')==typeof _0x51cc44['parameters'][_0x550f('0x81')]){return _0x215095(new Error(_0x550f('0x82')));}if(_0x550f('0x78')==typeof _0x51cc44[_0x550f('0x7b')]['scriptPath']){return _0x215095(new Error(_0x550f('0x83')));}}else{return _0x215095(new Error(_0x550f('0x84')));}var _0x1d403e=_0x51cc44[_0x550f('0x2e')];var _0x13fa15=_0x51cc44[_0x550f('0x85')];var _0xbec6fe=_0x51cc44[_0x550f('0x33')];var _0x37c812=_0x51cc44[_0x550f('0x86')]?_0x51cc44[_0x550f('0x86')]:_0x550f('0x87');var _0x58bf15=_0x51cc44[_0x550f('0x88')]?_0x51cc44[_0x550f('0x88')]:_0x550f('0x89');var _0x4072c4='';var _0x1dfaef='';var _0x55f3fa='';var _0x574800='';var _0x32e598=_0x51cc44[_0x550f('0x79')];if(_0xbec6fe===_0x550f('0x8a')){if('undefined'!=typeof _0x51cc44[_0x550f('0x7b')]['views'][_0x550f('0x7e')]){var _0x2963b2=_0x51cc44['parameters'][_0x550f('0x7c')][_0x550f('0x7e')];if(!/^(f|ht)tps?:\/\//i['test'](_0x2963b2)){_0x4072c4=path[_0x550f('0x50')]('plugins',_0x150d1f,_0x5a4039[0x0],_0x2963b2);}else{_0x4072c4=_0x2963b2;}}else{logger['info'](_0x550f('0x8b'));}if(_0x550f('0x78')!=typeof _0x51cc44['parameters'][_0x550f('0x7c')][_0x550f('0x7f')]){var _0x23b362=_0x51cc44['parameters']['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x550f('0x8c')](_0x23b362)){_0x1dfaef=path[_0x550f('0x50')](_0x550f('0x8d'),_0x150d1f,_0x5a4039[0x0],_0x23b362);}else{_0x1dfaef=_0x23b362;}}else{logger[_0x550f('0x65')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0xbec6fe===_0x550f('0x80')){_0x55f3fa=_0x51cc44['parameters']['scriptName'];_0x574800=_0x51cc44[_0x550f('0x7b')][_0x550f('0x8e')];if('undefined'!=typeof _0x51cc44['parameters']['views']){if(_0x550f('0x78')!=typeof _0x51cc44[_0x550f('0x7b')][_0x550f('0x7c')][_0x550f('0x7e')]){var _0x2963b2=_0x51cc44[_0x550f('0x7b')][_0x550f('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i['test'](_0x2963b2)){_0x4072c4=path['join'](_0x550f('0x8d'),_0x150d1f,_0x5a4039[0x0],_0x2963b2);}else{_0x4072c4=_0x2963b2;}}if(_0x550f('0x78')!=typeof _0x51cc44[_0x550f('0x7b')]['views'][_0x550f('0x7f')]){var _0x23b362=_0x51cc44['parameters'][_0x550f('0x7c')][_0x550f('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x550f('0x8c')](_0x23b362)){_0x1dfaef=path['join'](_0x550f('0x8d'),_0x150d1f,_0x5a4039[0x0],_0x23b362);}else{_0x1dfaef=_0x23b362;}}}}var _0x343980={'name':_0x1d403e,'description':_0x13fa15,'path':path[_0x550f('0x50')](_0x150d1f,_0x5a4039[0x0]),'type':_0xbec6fe,'sidebar':_0x37c812,'icon':_0x58bf15,'adminUrl':_0x4072c4,'agentUrl':_0x1dfaef,'scriptName':_0x55f3fa,'scriptPath':_0x574800,'version':_0x32e598};removeReferences(_0x2ebdd6,null);return db['Plugin']['create'](_0x343980)[_0x550f('0x2a')](function(_0x2965a0){var _0x416f67={'role':_0xb5b830[_0x550f('0x8f')][_0x550f('0x90')],'userProfileId':_0xb5b830[_0x550f('0x8f')][_0x550f('0x91')]};if(!_0x416f67)throw new Error(_0x550f('0x92'));if(_0x416f67[_0x550f('0x90')]===_0x550f('0x93')){var _0x10ff0f=_0x2965a0[_0x550f('0x94')]({'plain':!![]});return db[_0x550f('0x95')]['find']({'where':{'name':'Plugins','userProfileId':_0x416f67[_0x550f('0x91')]},'raw':!![]})[_0x550f('0x2a')](function(_0x28f1c9){if(_0x28f1c9&&_0x28f1c9[_0x550f('0x96')]===0x0){return db['UserProfileResource']['create']({'name':_0x10ff0f[_0x550f('0x2e')],'resourceId':_0x10ff0f['id'],'type':_0x28f1c9[_0x550f('0x2e')],'sectionId':_0x28f1c9['id']},{})['then'](function(){return _0x2965a0;});}else{return _0x2965a0;}})[_0x550f('0x4a')](function(_0x297565){logger[_0x550f('0x2c')](_0x550f('0x97'),_0x297565);throw _0x297565;});}return _0x2965a0;})['then'](respondWithResult(_0x3984dc,null))[_0x550f('0x4a')](handleError(_0x3984dc,null));}});}catch(_0x7ea3c6){_0x3984dc[_0x550f('0x20')](0x1f4)[_0x550f('0x98')](_0x7ea3c6);}};function removeReferences(_0x47e852,_0x575147){try{if(_0x47e852){fs[_0x550f('0x64')](_0x47e852);logger[_0x550f('0x65')](_0x550f('0x99'));}if(_0x575147){rimraf(_0x575147,function(){});logger[_0x550f('0x65')]('Extracted\x20folder\x20removed');}}catch(_0x4e5bbf){logger[_0x550f('0x2c')](_0x4e5bbf);}}exports[_0x550f('0x29')]=function(_0x37c991,_0x284750,_0x436bc5){return db[_0x550f('0x46')][_0x550f('0x4e')]({'where':{'id':_0x37c991[_0x550f('0x4f')]['id']}})[_0x550f('0x2a')](handleEntityNotFound(_0x284750,null))[_0x550f('0x2a')](saveUpdates(_0x37c991[_0x550f('0x8f')],null))[_0x550f('0x2a')](respondWithResult(_0x284750,null))[_0x550f('0x4a')](handleError(_0x284750,null));};exports['delete']=function(_0x5347a3,_0x34c8b1,_0x50f44b){return db[_0x550f('0x46')][_0x550f('0x4e')]({'where':{'id':_0x5347a3[_0x550f('0x4f')]['id']}})['then'](function(_0x24ab35){if(_0x24ab35){return _0x24ab35[_0x550f('0x2b')]();}})[_0x550f('0x2a')](function(_0x14461d){rimraf(path['join'](config[_0x550f('0x51')],_0x550f('0x5c'),path[_0x550f('0x5d')](_0x14461d[_0x550f('0x7')])),function(){});return _0x14461d;})[_0x550f('0x2a')](handleEntityNotFound(_0x34c8b1,null))[_0x550f('0x2a')](respondWithStatusCode(_0x34c8b1,null))[_0x550f('0x4a')](handleError(_0x34c8b1,null));};exports[_0x550f('0x9a')]=function(_0x21a578,_0x3f3c78,_0x5e3c57){return BPromise[_0x550f('0x9b')]()[_0x550f('0x2a')](function(){if(!_0x21a578[_0x550f('0x35')]['path']){throw new Error(_0x550f('0x9c'));}if(!_0x21a578[_0x550f('0x35')][_0x550f('0x9d')]){throw new Error(_0x550f('0x9e'));}var _0x46f23=_0x21a578['query'][_0x550f('0x9f')]?_0x21a578[_0x550f('0x35')]['hostname']+':'+_0x21a578[_0x550f('0x35')]['port']:_0x550f('0xa0')+_0x21a578[_0x550f('0x35')][_0x550f('0x9d')];var _0x44e89a=_0x21a578[_0x550f('0x35')][_0x550f('0x25')]?_0x21a578[_0x550f('0x35')][_0x550f('0x25')]:!![];var _0x364b55=_0x21a578[_0x550f('0x35')]['encoding']?_0x21a578[_0x550f('0x35')][_0x550f('0xa1')]:null;var _0x2eb0a0={'method':_0x21a578[_0x550f('0xa2')],'uri':util['format'](_0x550f('0xa3'),_0x46f23,_0x21a578['query'][_0x550f('0x7')]),'json':_0x44e89a,'resolveWithFullResponse':!![],'encoding':_0x364b55,'qs':_0x21a578[_0x550f('0x35')]};if(_0x21a578['headers']){_0x2eb0a0[_0x550f('0xa4')]=_0x21a578[_0x550f('0xa4')];if(_0x2eb0a0[_0x550f('0xa4')][_0x550f('0xa5')]){delete _0x2eb0a0[_0x550f('0xa4')][_0x550f('0xa5')];}}if(_0x2eb0a0['headers'][_0x550f('0xa6')]){delete _0x2eb0a0[_0x550f('0xa4')]['content-type'];}return rp(_0x2eb0a0);})[_0x550f('0x2a')](function(_0xfd4331){if(_0xfd4331){_0x3f3c78[_0x550f('0x23')](_0xfd4331[_0x550f('0xa4')]);logger[_0x550f('0x65')](_0xfd4331[_0x550f('0x8f')]);if(_[_0x550f('0xa7')](_0x21a578['query'][_0x550f('0x7')],'download')&&_0xfd4331[_0x550f('0xa8')]==0x1f4){return _0x3f3c78['sendStatus'](_0xfd4331[_0x550f('0xa8')]);}else{return _0x3f3c78[_0x550f('0x20')](_0xfd4331[_0x550f('0xa8')])[_0x550f('0x98')](_0xfd4331['body']);}}else{return _0x3f3c78[_0x550f('0x1f')](0xc8);}})['catch'](handleError(_0x3f3c78,null));};exports[_0x550f('0xa9')]=function(_0x1ffec9,_0x184293,_0x2537f5){return BPromise['resolve']()[_0x550f('0x2a')](function(){if(!_0x1ffec9['query'][_0x550f('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x1ffec9[_0x550f('0x35')]['port']){throw new Error(_0x550f('0x9e'));}var _0x4a5065=_0x1ffec9[_0x550f('0x35')][_0x550f('0x9f')]?_0x1ffec9[_0x550f('0x35')][_0x550f('0x9f')]+':'+_0x1ffec9[_0x550f('0x35')][_0x550f('0x9d')]:'http://localhost:'+_0x1ffec9['query']['port'];var _0x3fbda7=_0x1ffec9[_0x550f('0x35')][_0x550f('0x25')]?_0x1ffec9[_0x550f('0x35')]['json']:!![];var _0x3f9649=_0x1ffec9['query']['encoding']?_0x1ffec9[_0x550f('0x35')][_0x550f('0xa1')]:null;var _0x37c9b9={'method':_0x1ffec9[_0x550f('0xa2')],'uri':util[_0x550f('0x62')](_0x550f('0xa3'),_0x4a5065,_0x1ffec9[_0x550f('0x35')][_0x550f('0x7')]),'json':_0x3fbda7,'resolveWithFullResponse':!![],'encoding':_0x3f9649,'body':_0x1ffec9[_0x550f('0x8f')]};if(_0x1ffec9['headers']){_0x37c9b9['headers']=_0x1ffec9[_0x550f('0xa4')];if(_0x37c9b9[_0x550f('0xa4')][_0x550f('0xa5')]){delete _0x37c9b9[_0x550f('0xa4')][_0x550f('0xa5')];}}if(_0x37c9b9['headers'][_0x550f('0xa6')]){delete _0x37c9b9[_0x550f('0xa4')][_0x550f('0xa6')];}return rp(_0x37c9b9);})[_0x550f('0x2a')](function(_0x5093f7){if(_0x5093f7){_0x184293[_0x550f('0x23')](_0x5093f7[_0x550f('0xa4')]);logger[_0x550f('0x65')](_0x5093f7['body']);return _0x184293[_0x550f('0x20')](_0x5093f7['statusCode'])['send'](_0x5093f7['body']);}else{return _0x184293[_0x550f('0x1f')](0xc8);}})[_0x550f('0x4a')](handleError(_0x184293,null));}; \ No newline at end of file +var _0x81c5=['Invalid\x20manifest:\x20invalid\x20type','sidebar','always','icon','version','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','script','scriptName','create','role','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','Extracted\x20folder\x20removed','webhookGet','resolve','\x27PATH\x27\x20parameter\x20not\x20specified','port','hostname','http://localhost:','method','format','%s%s','headers','content-length','content-type','statusCode','webhookPost','\x27PORT\x27\x20parameter\x20not\x20specified','encoding','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','archiver','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./plugin.socket','register','sendStatus','end','status','json','offset','limit','set','Content-Range','apply','save','update','then','get','Plugins','UserProfileResource','destroy','error','stack','name','send','index','map','Plugin','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','options','count','include','findAll','rows','catch','params','keys','rawAttributes','includeAll','find','download','join','root','server/files/plugins','zip','warning','code','Sequelize','Error\x20while\x20generating\x20the\x20zip\x20archive','Error','glob','dirname','basename','node_modules/**/*','attachments/**/*','close','existsSync','Error\x20while\x20downloading\x20the\x20plugin','unlinkSync','Download\x20completed','info','upload','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','readdirSync','length','Invalid\x20plugin\x20structure','isFile','some','manifest.json','Plugin\x20manifest\x20missing','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20type\x20missing','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','admin','agent','Invalid\x20manifest:\x20no\x20view\x20specified','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x81c5,0x172));var _0x581c=function(_0x1b0900,_0x59933a){_0x1b0900=_0x1b0900-0x0;var _0x43ce88=_0x81c5[_0x1b0900];return _0x43ce88;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x581c('0x0'));var rimraf=require(_0x581c('0x1'));var zipdir=require(_0x581c('0x2'));var jsonpatch=require(_0x581c('0x3'));var rp=require(_0x581c('0x4'));var moment=require(_0x581c('0x5'));var BPromise=require(_0x581c('0x6'));var Mustache=require(_0x581c('0x7'));var util=require(_0x581c('0x8'));var path=require(_0x581c('0x9'));var sox=require(_0x581c('0xa'));var csv=require(_0x581c('0xb'));var ejs=require(_0x581c('0xc'));var fs=require('fs');var _=require(_0x581c('0xd'));var squel=require(_0x581c('0xe'));var crypto=require(_0x581c('0xf'));var jsforce=require(_0x581c('0x10'));var deskjs=require(_0x581c('0x11'));var toCsv=require(_0x581c('0xb'));var querystring=require(_0x581c('0x12'));var Papa=require(_0x581c('0x13'));var extract=require('extract-zip');var rimraf=require(_0x581c('0x1'));var archiver=require(_0x581c('0x14'));var Redis=require(_0x581c('0x15'));var authService=require('../../components/auth/service');var qs=require(_0x581c('0x16'));var as=require(_0x581c('0x17'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x581c('0x18'));var utils=require(_0x581c('0x19'));var config=require(_0x581c('0x1a'));var db=require('../../mysqldb')['db'];config[_0x581c('0x1b')]=_[_0x581c('0x1c')](config[_0x581c('0x1b')],{'host':_0x581c('0x1d'),'port':0x18eb});var socket=require(_0x581c('0x1e'))(new Redis(config[_0x581c('0x1b')]));require(_0x581c('0x1f'))[_0x581c('0x20')](socket);function respondWithStatusCode(_0x2d07c1,_0x1638ac){_0x1638ac=_0x1638ac||0xcc;return function(_0xac4b5){if(_0xac4b5){return _0x2d07c1[_0x581c('0x21')](_0x1638ac);}return _0x2d07c1['status'](_0x1638ac)[_0x581c('0x22')]();};}function respondWithResult(_0x5d557d,_0x10580a){_0x10580a=_0x10580a||0xc8;return function(_0x42ccd7){if(_0x42ccd7){return _0x5d557d[_0x581c('0x23')](_0x10580a)[_0x581c('0x24')](_0x42ccd7);}};}function respondWithFilteredResult(_0x4fbcc9,_0x2262ee){return function(_0x57f3d6){if(_0x57f3d6){var _0x40c34b=_0x57f3d6['count'],_0xa485=_0x2262ee['offset'],_0x34f200=_0x2262ee[_0x581c('0x25')]+_0x2262ee[_0x581c('0x26')],_0x1ab635;if(_0x34f200>=_0x40c34b){_0x34f200=_0x40c34b;_0x1ab635=0xc8;}else{_0x1ab635=0xce;}_0x4fbcc9[_0x581c('0x23')](_0x1ab635);return _0x4fbcc9[_0x581c('0x27')](_0x581c('0x28'),_0xa485+'-'+_0x34f200+'/'+_0x40c34b)['json'](_0x57f3d6);}return null;};}function patchUpdates(_0x3f139d){return function(_0x31993b){try{jsonpatch[_0x581c('0x29')](_0x31993b,_0x3f139d,!![]);}catch(_0x2404ca){return BPromise['reject'](_0x2404ca);}return _0x31993b[_0x581c('0x2a')]();};}function saveUpdates(_0x12d944,_0x276f27){return function(_0x30b5f1){if(_0x30b5f1){return _0x30b5f1[_0x581c('0x2b')](_0x12d944)[_0x581c('0x2c')](function(_0x515e9a){return _0x515e9a;});}return null;};}function removeEntity(_0x164fe9,_0xfe171c){return function(_0x1f6907){if(_0x1f6907){return _0x1f6907['destroy']()[_0x581c('0x2c')](function(){var _0x3f843f=_0x1f6907[_0x581c('0x2d')]({'plain':!![]});var _0x5d3ead=_0x581c('0x2e');return db[_0x581c('0x2f')][_0x581c('0x30')]({'where':{'type':_0x5d3ead,'resourceId':_0x3f843f['id']}})[_0x581c('0x2c')](function(){return _0x1f6907;});})[_0x581c('0x2c')](function(){_0x164fe9[_0x581c('0x23')](0xcc)[_0x581c('0x22')]();});}};}function handleEntityNotFound(_0x25a780,_0x50c6c1){return function(_0xe23c9e){if(!_0xe23c9e){_0x25a780[_0x581c('0x21')](0x194);}return _0xe23c9e;};}function handleError(_0x52b8f4,_0x931224){_0x931224=_0x931224||0x1f4;return function(_0xab129){logger[_0x581c('0x31')](_0xab129[_0x581c('0x32')]);if(_0xab129[_0x581c('0x33')]){delete _0xab129['name'];}_0x52b8f4[_0x581c('0x23')](_0x931224)[_0x581c('0x34')](_0xab129);};}exports[_0x581c('0x35')]=function(_0x580973,_0x537fb2){var _0x26c56e={},_0x1d9d7e={},_0x1fc34a={'count':0x0,'rows':[]};var _0xc560dd=_[_0x581c('0x36')](db[_0x581c('0x37')]['rawAttributes'],function(_0x52ba4d){return{'name':_0x52ba4d[_0x581c('0x38')],'type':_0x52ba4d['type'][_0x581c('0x39')]};});_0x1d9d7e[_0x581c('0x3a')]=_[_0x581c('0x36')](_0xc560dd,_0x581c('0x33'));_0x1d9d7e['query']=_['keys'](_0x580973[_0x581c('0x3b')]);_0x1d9d7e[_0x581c('0x3c')]=_[_0x581c('0x3d')](_0x1d9d7e[_0x581c('0x3a')],_0x1d9d7e[_0x581c('0x3b')]);_0x26c56e[_0x581c('0x3e')]=_[_0x581c('0x3d')](_0x1d9d7e[_0x581c('0x3a')],qs[_0x581c('0x3f')](_0x580973[_0x581c('0x3b')][_0x581c('0x3f')]));_0x26c56e[_0x581c('0x3e')]=_0x26c56e[_0x581c('0x3e')]['length']?_0x26c56e[_0x581c('0x3e')]:_0x1d9d7e['model'];if(!_0x580973[_0x581c('0x3b')][_0x581c('0x40')](_0x581c('0x41'))){_0x26c56e[_0x581c('0x26')]=qs['limit'](_0x580973[_0x581c('0x3b')]['limit']);_0x26c56e[_0x581c('0x25')]=qs[_0x581c('0x25')](_0x580973[_0x581c('0x3b')][_0x581c('0x25')]);}_0x26c56e[_0x581c('0x42')]=qs[_0x581c('0x43')](_0x580973['query'][_0x581c('0x43')]);_0x26c56e['where']=qs[_0x581c('0x3c')](_[_0x581c('0x44')](_0x580973[_0x581c('0x3b')],_0x1d9d7e['filters']));if(_0x580973['query']['filter']){_0x26c56e[_0x581c('0x45')]=_[_0x581c('0x46')](_0x26c56e['where'],{'$or':_[_0x581c('0x36')](_0xc560dd,function(_0x5203fb){if(_0x5203fb[_0x581c('0x47')]!==_0x581c('0x48')){var _0x2ca5e7={};_0x2ca5e7[_0x5203fb[_0x581c('0x33')]]={'$like':'%'+_0x580973['query'][_0x581c('0x49')]+'%'};return _0x2ca5e7;}})});}_0x26c56e=_[_0x581c('0x46')]({},_0x26c56e,_0x580973[_0x581c('0x4a')]);var _0x1e8369={'where':_0x26c56e[_0x581c('0x45')]};return db[_0x581c('0x37')][_0x581c('0x4b')](_0x1e8369)[_0x581c('0x2c')](function(_0x3b9f8e){_0x1fc34a[_0x581c('0x4b')]=_0x3b9f8e;if(_0x580973[_0x581c('0x3b')]['includeAll']){_0x26c56e[_0x581c('0x4c')]=[{'all':!![]}];}return db[_0x581c('0x37')][_0x581c('0x4d')](_0x26c56e);})[_0x581c('0x2c')](function(_0x44263e){_0x1fc34a[_0x581c('0x4e')]=_0x44263e;return _0x1fc34a;})[_0x581c('0x2c')](respondWithFilteredResult(_0x537fb2,_0x26c56e))[_0x581c('0x4f')](handleError(_0x537fb2,null));};exports['show']=function(_0x3d093a,_0x1e9dfe){var _0x45602f={'raw':!![],'where':{'id':_0x3d093a[_0x581c('0x50')]['id']}},_0x46b4b2={};_0x46b4b2[_0x581c('0x3a')]=_[_0x581c('0x51')](db['Plugin'][_0x581c('0x52')]);_0x46b4b2['query']=_[_0x581c('0x51')](_0x3d093a[_0x581c('0x3b')]);_0x46b4b2[_0x581c('0x3c')]=_[_0x581c('0x3d')](_0x46b4b2[_0x581c('0x3a')],_0x46b4b2[_0x581c('0x3b')]);_0x45602f['attributes']=_[_0x581c('0x3d')](_0x46b4b2[_0x581c('0x3a')],qs[_0x581c('0x3f')](_0x3d093a[_0x581c('0x3b')][_0x581c('0x3f')]));_0x45602f[_0x581c('0x3e')]=_0x45602f[_0x581c('0x3e')]['length']?_0x45602f[_0x581c('0x3e')]:_0x46b4b2[_0x581c('0x3a')];if(_0x3d093a[_0x581c('0x3b')][_0x581c('0x53')]){_0x45602f[_0x581c('0x4c')]=[{'all':!![]}];}_0x45602f=_[_0x581c('0x46')]({},_0x45602f,_0x3d093a['options']);return db[_0x581c('0x37')][_0x581c('0x54')](_0x45602f)[_0x581c('0x2c')](handleEntityNotFound(_0x1e9dfe,null))[_0x581c('0x2c')](respondWithResult(_0x1e9dfe,null))[_0x581c('0x4f')](handleError(_0x1e9dfe,null));};exports[_0x581c('0x55')]=function(_0x151b4b,_0xd5c06f,_0x545653){return db[_0x581c('0x37')][_0x581c('0x54')]({'where':{'id':_0x151b4b['params']['id']},'attributes':[_0x581c('0x33'),_0x581c('0x9')],'raw':!![]})[_0x581c('0x2c')](handleEntityNotFound(_0xd5c06f,null))[_0x581c('0x2c')](function(_0x1bd45a){if(_0x1bd45a){var _0x4d6834=path[_0x581c('0x56')](config[_0x581c('0x57')],_0x581c('0x58'),util['format']('%s.zip',path['basename'](_0x1bd45a[_0x581c('0x9')])));var _0x13965b=fs['createWriteStream'](_0x4d6834);var _0x3a2987=archiver(_0x581c('0x59'),{'zlib':{'level':0x9}});_0x3a2987['on'](_0x581c('0x5a'),function(_0x454b14){if(_0x454b14[_0x581c('0x5b')]==='ENOENT'){logger[_0x581c('0x31')](_0x454b14);}else{throw new db[(_0x581c('0x5c'))]['Error'](_0x581c('0x5d'));}});_0x3a2987['on'](_0x581c('0x31'),function(_0x37b4ce){throw new db['Sequelize'][(_0x581c('0x5e'))](_0x581c('0x5d'));});_0x3a2987['pipe'](_0x13965b);_0x3a2987[_0x581c('0x5f')]('**/*',{'cwd':path[_0x581c('0x56')](config[_0x581c('0x57')],_0x581c('0x58'),path[_0x581c('0x60')](_0x1bd45a[_0x581c('0x9')])),'ignore':[path[_0x581c('0x56')](path[_0x581c('0x61')](_0x1bd45a[_0x581c('0x9')]),_0x581c('0x62')),path['join'](path[_0x581c('0x61')](_0x1bd45a[_0x581c('0x9')]),_0x581c('0x63'))],'nodir':!![]})['finalize']();_0x13965b['on'](_0x581c('0x64'),function(){if(!fs[_0x581c('0x65')](_0x4d6834)){throw new db['Sequelize'][(_0x581c('0x5e'))]('Plugin\x20not\x20found');}return _0xd5c06f[_0x581c('0x55')](_0x4d6834,util['format']('%s.zip',path['basename'](_0x1bd45a[_0x581c('0x9')])),function(_0x181db9){if(_0x181db9){throw new db[(_0x581c('0x5c'))][(_0x581c('0x5e'))](_0x581c('0x66'));}fs[_0x581c('0x67')](_0x4d6834);logger['info'](_0x581c('0x68'));logger[_0x581c('0x69')]('Temporary\x20file\x20removed');});});}return null;})[_0x581c('0x4f')](handleError(_0xd5c06f,null));};exports[_0x581c('0x6a')]=function(_0x3c8fd7,_0x2c6824,_0x27c042){var _0x558281=path[_0x581c('0x61')](_0x3c8fd7[_0x581c('0x6b')][_0x581c('0x6c')],path[_0x581c('0x6d')](_0x3c8fd7[_0x581c('0x6b')][_0x581c('0x6c')]));var _0x5c817a=path[_0x581c('0x56')](config[_0x581c('0x57')],'server/files/plugins',_0x3c8fd7['file'][_0x581c('0x6c')]);var _0x619680=path[_0x581c('0x56')](config[_0x581c('0x57')],'server/files/plugins',_0x558281);logger['info'](_0x581c('0x6e'),_0x5c817a);logger[_0x581c('0x69')]('Plugin\x20upload\x20destination:\x20%s',_0x619680);try{fs['chmodSync'](_0x5c817a,parseInt('0777',0x8));extract(_0x5c817a,{'dir':_0x619680},function(_0x52a7cd){if(_0x52a7cd){logger[_0x581c('0x31')](_0x52a7cd);handleError(_0x52a7cd,!![]);};var _0x145748=fs[_0x581c('0x6f')](_0x619680);if(_0x145748[_0x581c('0x70')]>0x1){removeReferences(_0x5c817a,_0x619680);logger[_0x581c('0x31')](_0x581c('0x71'));return _0x27c042(new Error(_0x581c('0x71')));}var _0x3d0a0d=fs['lstatSync'](path[_0x581c('0x56')](_0x619680,_0x145748[0x0]));if(_0x3d0a0d[_0x581c('0x72')]()){removeReferences(_0x5c817a,_0x619680);logger[_0x581c('0x31')](_0x581c('0x71'));return _0x27c042(new Error(_0x581c('0x71')));}if(_0x3d0a0d['isDirectory']()){var _0x5b7721=fs[_0x581c('0x6f')](path[_0x581c('0x56')](_0x619680,_0x145748[0x0]));if(_0x5b7721['length']===0x0){removeReferences(_0x5c817a,_0x619680);logger[_0x581c('0x31')](_0x581c('0x71'));return _0x27c042(new Error(_0x581c('0x71')));}var _0x3e88c6=_0x5b7721[_0x581c('0x73')](function(_0x3acb81){return _0x3acb81===_0x581c('0x74');});if(!_0x3e88c6){return _0x27c042(new Error(_0x581c('0x75')));}var _0x89f11=fs['readFileSync'](path[_0x581c('0x56')](_0x619680,_0x145748[0x0],'manifest.json'));var _0x207b65=JSON[_0x581c('0x76')](_0x89f11);if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x33')]){return _0x27c042(new Error(_0x581c('0x78')));}if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x47')]){return _0x27c042(new Error(_0x581c('0x79')));}if(_0x581c('0x77')==typeof _0x207b65['version']){return _0x27c042(new Error('Invalid\x20manifest:\x20version\x20not\x20specified'));}if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x7a')]){return _0x27c042(new Error(_0x581c('0x7b')));}if(_0x207b65[_0x581c('0x47')]===_0x581c('0x7c')){if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x7a')][_0x581c('0x7d')]){return _0x27c042(new Error('Invalid\x20manifest:\x20views\x20missing'));}if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x7a')][_0x581c('0x7d')][_0x581c('0x7e')]&&_0x581c('0x77')==typeof _0x207b65[_0x581c('0x7a')][_0x581c('0x7d')][_0x581c('0x7f')]){return _0x27c042(new Error(_0x581c('0x80')));}}else if(_0x207b65['type']==='script'){if(_0x581c('0x77')==typeof _0x207b65[_0x581c('0x7a')]['scriptName']){return _0x27c042(new Error(_0x581c('0x81')));}if('undefined'==typeof _0x207b65[_0x581c('0x7a')][_0x581c('0x82')]){return _0x27c042(new Error('Invalid\x20manifest:\x20script\x20path\x20missing'));}}else{return _0x27c042(new Error(_0x581c('0x83')));}var _0x160244=_0x207b65[_0x581c('0x33')];var _0xe2a934=_0x207b65['description'];var _0x1e271a=_0x207b65['type'];var _0x1551a5=_0x207b65[_0x581c('0x84')]?_0x207b65['sidebar']:_0x581c('0x85');var _0x322b50=_0x207b65[_0x581c('0x86')]?_0x207b65[_0x581c('0x86')]:'icon-apps';var _0x1eec7e='';var _0xabfe84='';var _0x5c8648='';var _0x5e94fe='';var _0x9e4675=_0x207b65[_0x581c('0x87')];if(_0x1e271a===_0x581c('0x7c')){if('undefined'!=typeof _0x207b65['parameters'][_0x581c('0x7d')]['admin']){var _0x1d6374=_0x207b65[_0x581c('0x7a')][_0x581c('0x7d')][_0x581c('0x7e')];if(!/^(f|ht)tps?:\/\//i[_0x581c('0x88')](_0x1d6374)){_0x1eec7e=path[_0x581c('0x56')](_0x581c('0x89'),_0x558281,_0x145748[0x0],_0x1d6374);}else{_0x1eec7e=_0x1d6374;}}else{logger[_0x581c('0x69')](_0x581c('0x8a'));}if(_0x581c('0x77')!=typeof _0x207b65[_0x581c('0x7a')][_0x581c('0x7d')][_0x581c('0x7f')]){var _0x219d14=_0x207b65[_0x581c('0x7a')][_0x581c('0x7d')][_0x581c('0x7f')];if(!/^(f|ht)tps?:\/\//i[_0x581c('0x88')](_0x219d14)){_0xabfe84=path[_0x581c('0x56')]('plugins',_0x558281,_0x145748[0x0],_0x219d14);}else{_0xabfe84=_0x219d14;}}else{logger[_0x581c('0x69')](_0x581c('0x8b'));}}else if(_0x1e271a===_0x581c('0x8c')){_0x5c8648=_0x207b65[_0x581c('0x7a')][_0x581c('0x8d')];_0x5e94fe=_0x207b65[_0x581c('0x7a')][_0x581c('0x82')];if(_0x581c('0x77')!=typeof _0x207b65['parameters'][_0x581c('0x7d')]){if(_0x581c('0x77')!=typeof _0x207b65['parameters'][_0x581c('0x7d')][_0x581c('0x7e')]){var _0x1d6374=_0x207b65[_0x581c('0x7a')][_0x581c('0x7d')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x581c('0x88')](_0x1d6374)){_0x1eec7e=path['join'](_0x581c('0x89'),_0x558281,_0x145748[0x0],_0x1d6374);}else{_0x1eec7e=_0x1d6374;}}if(_0x581c('0x77')!=typeof _0x207b65['parameters']['views']['agent']){var _0x219d14=_0x207b65[_0x581c('0x7a')]['views']['agent'];if(!/^(f|ht)tps?:\/\//i[_0x581c('0x88')](_0x219d14)){_0xabfe84=path[_0x581c('0x56')](_0x581c('0x89'),_0x558281,_0x145748[0x0],_0x219d14);}else{_0xabfe84=_0x219d14;}}}}var _0x2a0fe4={'name':_0x160244,'description':_0xe2a934,'path':path['join'](_0x558281,_0x145748[0x0]),'type':_0x1e271a,'sidebar':_0x1551a5,'icon':_0x322b50,'adminUrl':_0x1eec7e,'agentUrl':_0xabfe84,'scriptName':_0x5c8648,'scriptPath':_0x5e94fe,'version':_0x9e4675};removeReferences(_0x5c817a,null);return db['Plugin'][_0x581c('0x8e')](_0x2a0fe4)[_0x581c('0x2c')](function(_0x67eeae){var _0x4ef474={'role':_0x3c8fd7['body'][_0x581c('0x8f')],'userProfileId':_0x3c8fd7[_0x581c('0x90')][_0x581c('0x91')]};if(!_0x4ef474)throw new Error(_0x581c('0x92'));if(_0x4ef474[_0x581c('0x8f')]===_0x581c('0x93')){var _0x3870e3=_0x67eeae[_0x581c('0x2d')]({'plain':!![]});return db[_0x581c('0x94')][_0x581c('0x54')]({'where':{'name':_0x581c('0x2e'),'userProfileId':_0x4ef474[_0x581c('0x91')]},'raw':!![]})[_0x581c('0x2c')](function(_0x1da213){if(_0x1da213&&_0x1da213[_0x581c('0x95')]===0x0){return db[_0x581c('0x2f')][_0x581c('0x8e')]({'name':_0x3870e3[_0x581c('0x33')],'resourceId':_0x3870e3['id'],'type':_0x1da213['name'],'sectionId':_0x1da213['id']},{})[_0x581c('0x2c')](function(){return _0x67eeae;});}else{return _0x67eeae;}})['catch'](function(_0x5d3910){logger[_0x581c('0x31')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5d3910);throw _0x5d3910;});}return _0x67eeae;})[_0x581c('0x2c')](respondWithResult(_0x2c6824,null))['catch'](handleError(_0x2c6824,null));}});}catch(_0x4a274d){_0x2c6824[_0x581c('0x23')](0x1f4)['send'](_0x4a274d);}};function removeReferences(_0x59ad14,_0x4f6772){try{if(_0x59ad14){fs[_0x581c('0x67')](_0x59ad14);logger[_0x581c('0x69')]('Zip\x20archive\x20removed');}if(_0x4f6772){rimraf(_0x4f6772,function(){});logger['info'](_0x581c('0x96'));}}catch(_0x33a10e){logger[_0x581c('0x31')](_0x33a10e);}}exports[_0x581c('0x2b')]=function(_0x245f79,_0x48938a,_0x460364){return db['Plugin']['find']({'where':{'id':_0x245f79[_0x581c('0x50')]['id']}})[_0x581c('0x2c')](handleEntityNotFound(_0x48938a,null))[_0x581c('0x2c')](saveUpdates(_0x245f79[_0x581c('0x90')],null))['then'](respondWithResult(_0x48938a,null))[_0x581c('0x4f')](handleError(_0x48938a,null));};exports['delete']=function(_0x363801,_0x90f8af,_0x4d5687){return db[_0x581c('0x37')][_0x581c('0x54')]({'where':{'id':_0x363801['params']['id']}})[_0x581c('0x2c')](function(_0x3edc70){if(_0x3edc70){return _0x3edc70[_0x581c('0x30')]();}})[_0x581c('0x2c')](function(_0x365032){rimraf(path[_0x581c('0x56')](config[_0x581c('0x57')],_0x581c('0x58'),path[_0x581c('0x60')](_0x365032[_0x581c('0x9')])),function(){});return _0x365032;})[_0x581c('0x2c')](handleEntityNotFound(_0x90f8af,null))[_0x581c('0x2c')](respondWithStatusCode(_0x90f8af,null))[_0x581c('0x4f')](handleError(_0x90f8af,null));};exports[_0x581c('0x97')]=function(_0x634ca4,_0x5ab0a4,_0xe4b796){return BPromise[_0x581c('0x98')]()[_0x581c('0x2c')](function(){if(!_0x634ca4[_0x581c('0x3b')][_0x581c('0x9')]){throw new Error(_0x581c('0x99'));}if(!_0x634ca4[_0x581c('0x3b')][_0x581c('0x9a')]){throw new Error('\x27PORT\x27\x20parameter\x20not\x20specified');}var _0x3dcfa5=_0x634ca4[_0x581c('0x3b')][_0x581c('0x9b')]?_0x634ca4[_0x581c('0x3b')][_0x581c('0x9b')]+':'+_0x634ca4[_0x581c('0x3b')][_0x581c('0x9a')]:_0x581c('0x9c')+_0x634ca4[_0x581c('0x3b')][_0x581c('0x9a')];var _0x19deba=_0x634ca4[_0x581c('0x3b')][_0x581c('0x24')]?_0x634ca4[_0x581c('0x3b')]['json']:!![];var _0x4bd58c=_0x634ca4[_0x581c('0x3b')]['encoding']?_0x634ca4[_0x581c('0x3b')]['encoding']:null;var _0x2368a1={'method':_0x634ca4[_0x581c('0x9d')],'uri':util[_0x581c('0x9e')](_0x581c('0x9f'),_0x3dcfa5,_0x634ca4[_0x581c('0x3b')][_0x581c('0x9')]),'json':_0x19deba,'resolveWithFullResponse':!![],'encoding':_0x4bd58c,'qs':_0x634ca4[_0x581c('0x3b')]};if(_0x634ca4[_0x581c('0xa0')]){_0x2368a1[_0x581c('0xa0')]=_0x634ca4['headers'];if(_0x2368a1['headers'][_0x581c('0xa1')]){delete _0x2368a1[_0x581c('0xa0')][_0x581c('0xa1')];}}if(_0x2368a1['headers'][_0x581c('0xa2')]){delete _0x2368a1[_0x581c('0xa0')][_0x581c('0xa2')];}return rp(_0x2368a1);})[_0x581c('0x2c')](function(_0x1d8576){if(_0x1d8576){_0x5ab0a4['set'](_0x1d8576[_0x581c('0xa0')]);logger[_0x581c('0x69')](_0x1d8576['body']);if(_['endsWith'](_0x634ca4[_0x581c('0x3b')][_0x581c('0x9')],_0x581c('0x55'))&&_0x1d8576['statusCode']==0x1f4){return _0x5ab0a4['sendStatus'](_0x1d8576[_0x581c('0xa3')]);}else{return _0x5ab0a4[_0x581c('0x23')](_0x1d8576['statusCode'])[_0x581c('0x34')](_0x1d8576[_0x581c('0x90')]);}}else{return _0x5ab0a4[_0x581c('0x21')](0xc8);}})[_0x581c('0x4f')](handleError(_0x5ab0a4,null));};exports[_0x581c('0xa4')]=function(_0x22302a,_0x107c7a,_0x505817){return BPromise[_0x581c('0x98')]()[_0x581c('0x2c')](function(){if(!_0x22302a[_0x581c('0x3b')]['path']){throw new Error(_0x581c('0x99'));}if(!_0x22302a['query'][_0x581c('0x9a')]){throw new Error(_0x581c('0xa5'));}var _0x133302=_0x22302a['query'][_0x581c('0x9b')]?_0x22302a[_0x581c('0x3b')][_0x581c('0x9b')]+':'+_0x22302a[_0x581c('0x3b')]['port']:_0x581c('0x9c')+_0x22302a[_0x581c('0x3b')][_0x581c('0x9a')];var _0xb9ea60=_0x22302a['query']['json']?_0x22302a['query'][_0x581c('0x24')]:!![];var _0xca52ca=_0x22302a[_0x581c('0x3b')][_0x581c('0xa6')]?_0x22302a[_0x581c('0x3b')]['encoding']:null;var _0x5882c1={'method':_0x22302a['method'],'uri':util[_0x581c('0x9e')](_0x581c('0x9f'),_0x133302,_0x22302a['query'][_0x581c('0x9')]),'json':_0xb9ea60,'resolveWithFullResponse':!![],'encoding':_0xca52ca,'body':_0x22302a[_0x581c('0x90')]};if(_0x22302a[_0x581c('0xa0')]){_0x5882c1[_0x581c('0xa0')]=_0x22302a['headers'];if(_0x5882c1[_0x581c('0xa0')][_0x581c('0xa1')]){delete _0x5882c1[_0x581c('0xa0')]['content-length'];}}if(_0x5882c1[_0x581c('0xa0')]['content-type']){delete _0x5882c1[_0x581c('0xa0')][_0x581c('0xa2')];}return rp(_0x5882c1);})[_0x581c('0x2c')](function(_0x174419){if(_0x174419){_0x107c7a['set'](_0x174419['headers']);logger[_0x581c('0x69')](_0x174419['body']);return _0x107c7a[_0x581c('0x23')](_0x174419[_0x581c('0xa3')])['send'](_0x174419[_0x581c('0x90')]);}else{return _0x107c7a[_0x581c('0x21')](0xc8);}})[_0x581c('0x4f')](handleError(_0x107c7a,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index 63fa659..2014ad7 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 _0x6d11=['hook','exports','events','../../mysqldb','Plugin','save','remove','emit','hasOwnProperty'];(function(_0x225a6a,_0x4daddc){var _0x2ffc1d=function(_0x2b5f4a){while(--_0x2b5f4a){_0x225a6a['push'](_0x225a6a['shift']());}};_0x2ffc1d(++_0x4daddc);}(_0x6d11,0xbf));var _0x16d1=function(_0x1fbcb4,_0x541e0c){_0x1fbcb4=_0x1fbcb4-0x0;var _0x83e085=_0x6d11[_0x1fbcb4];return _0x83e085;};'use strict';var EventEmitter=require(_0x16d1('0x0'));var Plugin=require(_0x16d1('0x1'))['db'][_0x16d1('0x2')];var PluginEvents=new EventEmitter();PluginEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x16d1('0x3'),'afterUpdate':'update','afterDestroy':_0x16d1('0x4')};function emitEvent(_0x2e1a35){return function(_0x4bce83,_0x48754e,_0x3e0e86){PluginEvents[_0x16d1('0x5')](_0x2e1a35+':'+_0x4bce83['id'],_0x4bce83);PluginEvents[_0x16d1('0x5')](_0x2e1a35,_0x4bce83);_0x3e0e86(null);};}for(var e in events){if(events[_0x16d1('0x6')](e)){var event=events[e];Plugin[_0x16d1('0x7')](e,emitEvent(event));}}module[_0x16d1('0x8')]=PluginEvents; \ No newline at end of file +var _0x2272=['save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','Plugin','setMaxListeners'];(function(_0x46cb35,_0x2b92ab){var _0x847507=function(_0x29b091){while(--_0x29b091){_0x46cb35['push'](_0x46cb35['shift']());}};_0x847507(++_0x2b92ab);}(_0x2272,0xd8));var _0x2227=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x2272[_0x17d9e3];return _0x14192d;};'use strict';var EventEmitter=require(_0x2227('0x0'));var Plugin=require(_0x2227('0x1'))['db'][_0x2227('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x2227('0x3')](0x0);var events={'afterCreate':_0x2227('0x4'),'afterUpdate':'update','afterDestroy':_0x2227('0x5')};function emitEvent(_0x3bb7ba){return function(_0x1f5a4a,_0x4c17c2,_0x4ebde3){PluginEvents[_0x2227('0x6')](_0x3bb7ba+':'+_0x1f5a4a['id'],_0x1f5a4a);PluginEvents[_0x2227('0x6')](_0x3bb7ba,_0x1f5a4a);_0x4ebde3(null);};}for(var e in events){if(events[_0x2227('0x7')](e)){var event=events[e];Plugin[_0x2227('0x8')](e,emitEvent(event));}}module[_0x2227('0x9')]=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index e48ef86..b5f1041 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 _0xae24=['../../config/logger','moment','bluebird','rimraf','./plugin.attributes','exports','define','Plugin','lodash'];(function(_0x4ad643,_0x3bfa11){var _0x445a25=function(_0x43ca66){while(--_0x43ca66){_0x4ad643['push'](_0x4ad643['shift']());}};_0x445a25(++_0x3bfa11);}(_0xae24,0x182));var _0x4ae2=function(_0x8345fa,_0x281377){_0x8345fa=_0x8345fa-0x0;var _0x3109f6=_0xae24[_0x8345fa];return _0x3109f6;};'use strict';var _=require(_0x4ae2('0x0'));var util=require('util');var logger=require(_0x4ae2('0x1'))('api');var moment=require(_0x4ae2('0x2'));var BPromise=require(_0x4ae2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4ae2('0x4'));var config=require('../../config/environment');var attributes=require(_0x4ae2('0x5'));module[_0x4ae2('0x6')]=function(_0x20c85c,_0x3e6055){return _0x20c85c[_0x4ae2('0x7')](_0x4ae2('0x8'),attributes,{'tableName':'plugins','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf3cd=['path','rimraf','../../config/environment','exports','define','Plugin','plugins','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2583ac,_0x263b1a){var _0x2d5767=function(_0x166895){while(--_0x166895){_0x2583ac['push'](_0x2583ac['shift']());}};_0x2d5767(++_0x263b1a);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x8c1005,_0x1f3f16){_0x8c1005=_0x8c1005-0x0;var _0x175354=_0xf3cd[_0x8c1005];return _0x175354;};'use strict';var _=require(_0xdf3c('0x0'));var util=require(_0xdf3c('0x1'));var logger=require(_0xdf3c('0x2'))(_0xdf3c('0x3'));var moment=require(_0xdf3c('0x4'));var BPromise=require(_0xdf3c('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdf3c('0x6'));var rimraf=require(_0xdf3c('0x7'));var config=require(_0xdf3c('0x8'));var attributes=require('./plugin.attributes');module[_0xdf3c('0x9')]=function(_0x17d42a,_0x1313d5){return _0x17d42a[_0xdf3c('0xa')](_0xdf3c('0xb'),attributes,{'tableName':_0xdf3c('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 010937a..acf8177 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 _0x377e=['CreatePlugin','create','body','options','raw','then','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./plugin.socket','register','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0xa86bb9,_0x4032c4){var _0x478591=function(_0x180439){while(--_0x180439){_0xa86bb9['push'](_0xa86bb9['shift']());}};_0x478591(++_0x4032c4);}(_0x377e,0x1c0));var _0xe377=function(_0x2ef291,_0x11d6f5){_0x2ef291=_0x2ef291-0x0;var _0x2c374b=_0x377e[_0x2ef291];return _0x2c374b;};'use strict';var _=require('lodash');var util=require(_0xe377('0x0'));var moment=require(_0xe377('0x1'));var BPromise=require(_0xe377('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe377('0x3'));var db=require(_0xe377('0x4'))['db'];var utils=require(_0xe377('0x5'));var logger=require(_0xe377('0x6'))(_0xe377('0x7'));var config=require(_0xe377('0x8'));var jayson=require(_0xe377('0x9'));var client=jayson[_0xe377('0xa')][_0xe377('0xb')]({'port':0x232a});config[_0xe377('0xc')]=_[_0xe377('0xd')](config[_0xe377('0xc')],{'host':_0xe377('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe377('0xf'))[_0xe377('0x10')](socket);function respondWithRpcPromise(_0x26a2ed,_0x24b70f,_0x5670c0){return new BPromise(function(_0x57fc12,_0x7427d9){return client['request'](_0x26a2ed,_0x5670c0)['then'](function(_0x33f3dc){logger[_0xe377('0x11')](_0xe377('0x12'),_0x24b70f,_0xe377('0x13'));logger[_0xe377('0x14')](_0xe377('0x15'),_0x24b70f,_0xe377('0x13'),JSON[_0xe377('0x16')](_0x33f3dc));if(_0x33f3dc['error']){if(_0x33f3dc[_0xe377('0x17')][_0xe377('0x18')]===0x1f4){logger[_0xe377('0x17')](_0xe377('0x12'),_0x24b70f,_0x33f3dc[_0xe377('0x17')][_0xe377('0x19')]);return _0x7427d9(_0x33f3dc[_0xe377('0x17')][_0xe377('0x19')]);}logger['error'](_0xe377('0x12'),_0x24b70f,_0x33f3dc[_0xe377('0x17')][_0xe377('0x19')]);return _0x57fc12(_0x33f3dc['error'][_0xe377('0x19')]);}else{logger[_0xe377('0x11')](_0xe377('0x12'),_0x24b70f,_0xe377('0x13'));_0x57fc12(_0x33f3dc[_0xe377('0x1a')]['message']);}})[_0xe377('0x1b')](function(_0x1a85af){logger[_0xe377('0x17')]('Plugin,\x20%s,\x20%s',_0x24b70f,_0x1a85af);_0x7427d9(_0x1a85af);});});}exports[_0xe377('0x1c')]=function(_0x90ec37){var _0x3d8990=this;return new Promise(function(_0x5d8b24,_0x55c19c){return db['Plugin'][_0xe377('0x1d')](_0x90ec37[_0xe377('0x1e')],{'raw':_0x90ec37['options']?_0x90ec37[_0xe377('0x1f')][_0xe377('0x20')]===undefined?!![]:![]:!![]})[_0xe377('0x21')](function(_0x3310ba){logger[_0xe377('0x11')](_0xe377('0x1c'),_0x90ec37);logger[_0xe377('0x14')]('CreatePlugin',_0x90ec37,JSON[_0xe377('0x16')](_0x3310ba));_0x5d8b24(_0x3310ba);})[_0xe377('0x1b')](function(_0x5b260b){logger[_0xe377('0x17')](_0xe377('0x1c'),_0x5b260b[_0xe377('0x19')],_0x90ec37);_0x55c19c(_0x3d8990[_0xe377('0x17')](0x1f4,_0x5b260b[_0xe377('0x19')]));});});}; \ No newline at end of file +var _0x138f=['register','request','then','Plugin,\x20%s,\x20%s','request\x20sent','debug','Plugin,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','Plugin','create','body','options','raw','CreatePlugin','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','redis','socket.io-emitter'];(function(_0x475429,_0x28ce00){var _0x2dba0d=function(_0x19653c){while(--_0x19653c){_0x475429['push'](_0x475429['shift']());}};_0x2dba0d(++_0x28ce00);}(_0x138f,0x194));var _0xf138=function(_0x455bbf,_0x487eb1){_0x455bbf=_0x455bbf-0x0;var _0x31cc6a=_0x138f[_0x455bbf];return _0x31cc6a;};'use strict';var _=require('lodash');var util=require(_0xf138('0x0'));var moment=require(_0xf138('0x1'));var BPromise=require(_0xf138('0x2'));var rs=require(_0xf138('0x3'));var fs=require('fs');var Redis=require(_0xf138('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf138('0x5'));var logger=require(_0xf138('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf138('0x7'));var client=jayson[_0xf138('0x8')][_0xf138('0x9')]({'port':0x232a});config[_0xf138('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xf138('0xb'))(new Redis(config[_0xf138('0xa')]));require('./plugin.socket')[_0xf138('0xc')](socket);function respondWithRpcPromise(_0x1cefc0,_0x3a5db8,_0x144f04){return new BPromise(function(_0x74da18,_0x19af26){return client[_0xf138('0xd')](_0x1cefc0,_0x144f04)[_0xf138('0xe')](function(_0x4cf3b5){logger['info'](_0xf138('0xf'),_0x3a5db8,_0xf138('0x10'));logger[_0xf138('0x11')](_0xf138('0x12'),_0x3a5db8,_0xf138('0x10'),JSON[_0xf138('0x13')](_0x4cf3b5));if(_0x4cf3b5[_0xf138('0x14')]){if(_0x4cf3b5[_0xf138('0x14')][_0xf138('0x15')]===0x1f4){logger[_0xf138('0x14')](_0xf138('0xf'),_0x3a5db8,_0x4cf3b5['error'][_0xf138('0x16')]);return _0x19af26(_0x4cf3b5[_0xf138('0x14')][_0xf138('0x16')]);}logger[_0xf138('0x14')](_0xf138('0xf'),_0x3a5db8,_0x4cf3b5[_0xf138('0x14')]['message']);return _0x74da18(_0x4cf3b5[_0xf138('0x14')][_0xf138('0x16')]);}else{logger[_0xf138('0x17')]('Plugin,\x20%s,\x20%s',_0x3a5db8,_0xf138('0x10'));_0x74da18(_0x4cf3b5[_0xf138('0x18')]['message']);}})['catch'](function(_0x304ca6){logger[_0xf138('0x14')](_0xf138('0xf'),_0x3a5db8,_0x304ca6);_0x19af26(_0x304ca6);});});}exports['CreatePlugin']=function(_0x16a3e0){var _0x2503ef=this;return new Promise(function(_0x153a2a,_0x34213c){return db[_0xf138('0x19')][_0xf138('0x1a')](_0x16a3e0[_0xf138('0x1b')],{'raw':_0x16a3e0[_0xf138('0x1c')]?_0x16a3e0[_0xf138('0x1c')][_0xf138('0x1d')]===undefined?!![]:![]:!![]})[_0xf138('0xe')](function(_0x2af1dd){logger[_0xf138('0x17')](_0xf138('0x1e'),_0x16a3e0);logger[_0xf138('0x11')](_0xf138('0x1e'),_0x16a3e0,JSON[_0xf138('0x13')](_0x2af1dd));_0x153a2a(_0x2af1dd);})[_0xf138('0x1f')](function(_0x11d076){logger[_0xf138('0x14')](_0xf138('0x1e'),_0x11d076[_0xf138('0x16')],_0x16a3e0);_0x34213c(_0x2503ef[_0xf138('0x14')](0x1f4,_0x11d076['message']));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index f2c5a05..8772a90 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 _0xd3d3=['length','plugin:','remove','update','emit','register'];(function(_0x1b51a1,_0x36e565){var _0x3e48c8=function(_0x481ed0){while(--_0x481ed0){_0x1b51a1['push'](_0x1b51a1['shift']());}};_0x3e48c8(++_0x36e565);}(_0xd3d3,0x19a));var _0x3d3d=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xd3d3[_0x3d42d8];return _0x27fc41;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0x3d3d('0x0'),_0x3d3d('0x1')];function createListener(_0x4ca907,_0x5400fd){return function(_0x5a4782){_0x5400fd[_0x3d3d('0x2')](_0x4ca907,_0x5a4782);};}function removeListener(_0xf51158,_0x2fceb1){return function(){PluginEvents['removeListener'](_0xf51158,_0x2fceb1);};}exports[_0x3d3d('0x3')]=function(_0x5de1f8){for(var _0x228033=0x0,_0x2b6c5a=events[_0x3d3d('0x4')];_0x228033<_0x2b6c5a;_0x228033++){var _0x217fc6=events[_0x228033];var _0x3c491d=createListener(_0x3d3d('0x5')+_0x217fc6,_0x5de1f8);PluginEvents['on'](_0x217fc6,_0x3c491d);}}; \ No newline at end of file +var _0x0a2c=['removeListener','register','length','plugin:','remove','update','emit'];(function(_0x4c2956,_0x2fadf0){var _0x457c98=function(_0x7cc49){while(--_0x7cc49){_0x4c2956['push'](_0x4c2956['shift']());}};_0x457c98(++_0x2fadf0);}(_0x0a2c,0xb3));var _0xc0a2=function(_0x12de43,_0x59ec0c){_0x12de43=_0x12de43-0x0;var _0x113808=_0x0a2c[_0x12de43];return _0x113808;};'use strict';var PluginEvents=require('./plugin.events');var events=['save',_0xc0a2('0x0'),_0xc0a2('0x1')];function createListener(_0x77dd79,_0x4655dd){return function(_0x5de9a4){_0x4655dd[_0xc0a2('0x2')](_0x77dd79,_0x5de9a4);};}function removeListener(_0x5813b1,_0x2cab8c){return function(){PluginEvents[_0xc0a2('0x3')](_0x5813b1,_0x2cab8c);};}exports[_0xc0a2('0x4')]=function(_0x116674){for(var _0x72c9f2=0x0,_0x587931=events[_0xc0a2('0x5')];_0x72c9f2<_0x587931;_0x72c9f2++){var _0x2d3d79=events[_0x72c9f2];var _0x5744f1=createListener(_0xc0a2('0x6')+_0x2d3d79,_0x116674);PluginEvents['on'](_0x2d3d79,_0x5744f1);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 82a0027..8ad9008 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 _0xdbc7=['./pm2.controller','get','isAuthenticated','index','show','post','put','/:id','update','delete','destroy','exports','express','Router','../../components/auth/service'];(function(_0x22750,_0x34092a){var _0xa1b6e9=function(_0x1b7dca){while(--_0x1b7dca){_0x22750['push'](_0x22750['shift']());}};_0xa1b6e9(++_0x34092a);}(_0xdbc7,0x93));var _0x7dbc=function(_0x20b29c,_0xe22528){_0x20b29c=_0x20b29c-0x0;var _0x20d81b=_0xdbc7[_0x20b29c];return _0x20d81b;};'use strict';var express=require(_0x7dbc('0x0'));var router=express[_0x7dbc('0x1')]();var auth=require(_0x7dbc('0x2'));var controller=require(_0x7dbc('0x3'));router[_0x7dbc('0x4')]('/',auth[_0x7dbc('0x5')](),controller[_0x7dbc('0x6')]);router[_0x7dbc('0x4')]('/:id',auth[_0x7dbc('0x5')](),controller[_0x7dbc('0x7')]);router[_0x7dbc('0x8')]('/',auth[_0x7dbc('0x5')](),controller['create']);router[_0x7dbc('0x9')](_0x7dbc('0xa'),auth[_0x7dbc('0x5')](),controller[_0x7dbc('0xb')]);router[_0x7dbc('0xc')](_0x7dbc('0xa'),auth[_0x7dbc('0x5')](),controller[_0x7dbc('0xd')]);module[_0x7dbc('0xe')]=router; \ No newline at end of file +var _0x500e=['../../components/auth/service','isAuthenticated','index','get','/:id','show','post','create','put','delete','destroy','exports','Router'];(function(_0x229a09,_0x421cf7){var _0xca4cc1=function(_0x170ea0){while(--_0x170ea0){_0x229a09['push'](_0x229a09['shift']());}};_0xca4cc1(++_0x421cf7);}(_0x500e,0x1ac));var _0xe500=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x500e[_0x14add3];return _0x4a174f;};'use strict';var express=require('express');var router=express[_0xe500('0x0')]();var auth=require(_0xe500('0x1'));var controller=require('./pm2.controller');router['get']('/',auth[_0xe500('0x2')](),controller[_0xe500('0x3')]);router[_0xe500('0x4')](_0xe500('0x5'),auth['isAuthenticated'](),controller[_0xe500('0x6')]);router[_0xe500('0x7')]('/',auth['isAuthenticated'](),controller[_0xe500('0x8')]);router[_0xe500('0x9')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xe500('0xa')](_0xe500('0x5'),auth[_0xe500('0x2')](),controller[_0xe500('0xb')]);module[_0xe500('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 d0972de..32f609b 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 _0x5888=['create','body','script','join','../../files/plugins','chdir','dirname','start','dump','update','stop','hasOwnProperty','Unknown\x20status','destroy','delete','Unknown\x20id','lodash','../../config/pm2','api','child_process','exec','sendStatus','status','json','error','stack','name','send','npm\x20install','info','index','list','then','reject','express','motion2','length','show','describe','params','catch'];(function(_0x4ea69d,_0x290f53){var _0x5318e0=function(_0x18e081){while(--_0x18e081){_0x4ea69d['push'](_0x4ea69d['shift']());}};_0x5318e0(++_0x290f53);}(_0x5888,0x158));var _0x8588=function(_0x274638,_0x578968){_0x274638=_0x274638-0x0;var _0x5755df=_0x5888[_0x274638];return _0x5755df;};'use strict';var _=require(_0x8588('0x0'));var pm2=require(_0x8588('0x1'));var logger=require('../../config/logger')(_0x8588('0x2'));var path=require('path');var exec=require(_0x8588('0x3'))[_0x8588('0x4')];var BPromise=require('bluebird');function handleEntityNotFound(_0x57e994,_0x3edf33){return function(_0x1ac79f){if(!_0x1ac79f){_0x57e994[_0x8588('0x5')](0x194);;}return _0x1ac79f;};}function respondWithResult(_0x2fb3a4,_0x5bea5b){_0x5bea5b=_0x5bea5b||0xc8;return function(_0x259001){if(_0x259001){return _0x2fb3a4[_0x8588('0x6')](_0x5bea5b)[_0x8588('0x7')](_0x259001);}return null;};}function handleError(_0x409bd3,_0x2556b2){_0x2556b2=_0x2556b2||0x1f4;return function(_0x5314ed){logger[_0x8588('0x8')](_0x5314ed[_0x8588('0x9')]);if(_0x5314ed[_0x8588('0xa')]){delete _0x5314ed[_0x8588('0xa')];}_0x409bd3[_0x8588('0x6')](_0x2556b2)[_0x8588('0xb')](_0x5314ed);};}function execChildProcess(){return new BPromise(function(_0x2ba3de,_0x6ef7af){exec(_0x8588('0xc'),function(_0x3ab95a,_0x4265c5,_0x32354d){logger[_0x8588('0xd')](_0x4265c5);logger['info'](_0x32354d);if(_0x3ab95a){logger['error'](_0x3ab95a);return _0x6ef7af(_0x3ab95a);}return _0x2ba3de(_0x4265c5);});});}exports[_0x8588('0xe')]=function(_0x5b02fa,_0x5292a2){return pm2[_0x8588('0xf')]()[_0x8588('0x10')](function(_0x56fbb1){if(_0x56fbb1){var _0x575c8e=_[_0x8588('0x11')](_0x56fbb1,function(_0x1129af){return _0x1129af[_0x8588('0xa')]===_0x8588('0x12')||_0x1129af[_0x8588('0xa')]===_0x8588('0x13');});return{'rows':_0x575c8e,'count':_0x575c8e[_0x8588('0x14')]};}return null;})['then'](respondWithResult(_0x5292a2,null))['catch'](handleError(_0x5292a2,null));};exports[_0x8588('0x15')]=function(_0x367637,_0x3b7311){return pm2[_0x8588('0x16')](_0x367637[_0x8588('0x17')]['id'])[_0x8588('0x10')](respondWithResult(_0x3b7311,null))['then'](handleEntityNotFound(_0x3b7311,null))[_0x8588('0x18')](handleError(_0x3b7311,null));};exports[_0x8588('0x19')]=function(_0x2fd677,_0x29070c){if(_0x2fd677[_0x8588('0x1a')]['name']&&_0x2fd677[_0x8588('0x1a')][_0x8588('0x1b')]){var _0x3d211a=path[_0x8588('0x1c')](__dirname,_0x8588('0x1d'),_0x2fd677[_0x8588('0x1a')]['script']);var _0x53fc43=process['cwd']();process[_0x8588('0x1e')](path[_0x8588('0x1f')](_0x3d211a));return execChildProcess()[_0x8588('0x10')](function(_0x2d1a96){process[_0x8588('0x1e')](_0x53fc43);return pm2[_0x8588('0x20')]({'name':_0x2fd677[_0x8588('0x1a')][_0x8588('0xa')],'script':_0x3d211a});})[_0x8588('0x10')](function(_0x594870){pm2[_0x8588('0x21')]();return _0x594870[0x0];})[_0x8588('0x10')](respondWithResult(_0x29070c,0xc9))['catch'](handleError(_0x29070c,null));}else{return _0x29070c[_0x8588('0x6')](0x1f4)[_0x8588('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports[_0x8588('0x22')]=function(_0x401c82,_0x3f553e){if(_0x401c82[_0x8588('0x1a')]['id']){delete _0x401c82['body']['id'];}var _0x45d6db={'online':'restart','stopped':_0x8588('0x23')};if(_0x45d6db[_0x8588('0x24')](_0x401c82[_0x8588('0x1a')][_0x8588('0x6')])){return pm2[_0x45d6db[_0x401c82[_0x8588('0x1a')][_0x8588('0x6')]]](_0x401c82['params']['id'])[_0x8588('0x10')](respondWithResult(_0x3f553e,0xc8))[_0x8588('0x18')](handleError(_0x3f553e,null));}else{return _0x3f553e[_0x8588('0x6')](0x1f4)[_0x8588('0xb')]({'message':_0x8588('0x25')});}};exports[_0x8588('0x26')]=function(_0x3e5b05,_0x48d6f7){if(_0x3e5b05[_0x8588('0x1a')]['id']){delete _0x3e5b05['body']['id'];}if(_0x3e5b05['params']['id']){return pm2[_0x8588('0x27')](_0x3e5b05['params']['id'])['then'](function(_0x2667ff){pm2[_0x8588('0x21')]();return _0x2667ff[0x0];})[_0x8588('0x10')](respondWithResult(_0x48d6f7,null))['catch'](handleError(_0x48d6f7,null));}else{return _0x48d6f7['status'](0x1f4)[_0x8588('0xb')]({'message':_0x8588('0x28')});}}; \ No newline at end of file +var _0x721a=['then','reject','express','motion2','length','catch','show','describe','create','body','script','join','../../files/plugins','cwd','chdir','dirname','dump','restart','stop','Unknown\x20status','destroy','params','../../config/pm2','../../config/logger','api','path','child_process','bluebird','sendStatus','status','error','stack','name','send','npm\x20install','info','index','list'];(function(_0x5b5700,_0x3c510c){var _0xf17c52=function(_0x7414f4){while(--_0x7414f4){_0x5b5700['push'](_0x5b5700['shift']());}};_0xf17c52(++_0x3c510c);}(_0x721a,0x192));var _0xa721=function(_0x4d0958,_0x561bca){_0x4d0958=_0x4d0958-0x0;var _0x4fe836=_0x721a[_0x4d0958];return _0x4fe836;};'use strict';var _=require('lodash');var pm2=require(_0xa721('0x0'));var logger=require(_0xa721('0x1'))(_0xa721('0x2'));var path=require(_0xa721('0x3'));var exec=require(_0xa721('0x4'))['exec'];var BPromise=require(_0xa721('0x5'));function handleEntityNotFound(_0x2dd0c5,_0x5717d1){return function(_0x450e36){if(!_0x450e36){_0x2dd0c5[_0xa721('0x6')](0x194);;}return _0x450e36;};}function respondWithResult(_0x456aab,_0x34208a){_0x34208a=_0x34208a||0xc8;return function(_0x4cfada){if(_0x4cfada){return _0x456aab[_0xa721('0x7')](_0x34208a)['json'](_0x4cfada);}return null;};}function handleError(_0xa86c2d,_0x40c462){_0x40c462=_0x40c462||0x1f4;return function(_0x5b0a1e){logger[_0xa721('0x8')](_0x5b0a1e[_0xa721('0x9')]);if(_0x5b0a1e['name']){delete _0x5b0a1e[_0xa721('0xa')];}_0xa86c2d[_0xa721('0x7')](_0x40c462)[_0xa721('0xb')](_0x5b0a1e);};}function execChildProcess(){return new BPromise(function(_0x18ddff,_0x3e1235){exec(_0xa721('0xc'),function(_0x468131,_0x3bdfc4,_0x18cec9){logger['info'](_0x3bdfc4);logger[_0xa721('0xd')](_0x18cec9);if(_0x468131){logger['error'](_0x468131);return _0x3e1235(_0x468131);}return _0x18ddff(_0x3bdfc4);});});}exports[_0xa721('0xe')]=function(_0x28290b,_0x28c324){return pm2[_0xa721('0xf')]()[_0xa721('0x10')](function(_0xb827d6){if(_0xb827d6){var _0x33b252=_[_0xa721('0x11')](_0xb827d6,function(_0x4a068b){return _0x4a068b[_0xa721('0xa')]===_0xa721('0x12')||_0x4a068b[_0xa721('0xa')]===_0xa721('0x13');});return{'rows':_0x33b252,'count':_0x33b252[_0xa721('0x14')]};}return null;})[_0xa721('0x10')](respondWithResult(_0x28c324,null))[_0xa721('0x15')](handleError(_0x28c324,null));};exports[_0xa721('0x16')]=function(_0x30fecf,_0x404c18){return pm2[_0xa721('0x17')](_0x30fecf['params']['id'])[_0xa721('0x10')](respondWithResult(_0x404c18,null))[_0xa721('0x10')](handleEntityNotFound(_0x404c18,null))['catch'](handleError(_0x404c18,null));};exports[_0xa721('0x18')]=function(_0x4f131c,_0x1f6f32){if(_0x4f131c[_0xa721('0x19')][_0xa721('0xa')]&&_0x4f131c[_0xa721('0x19')][_0xa721('0x1a')]){var _0x51c887=path[_0xa721('0x1b')](__dirname,_0xa721('0x1c'),_0x4f131c[_0xa721('0x19')]['script']);var _0x1483d1=process[_0xa721('0x1d')]();process[_0xa721('0x1e')](path[_0xa721('0x1f')](_0x51c887));return execChildProcess()[_0xa721('0x10')](function(_0x29add5){process[_0xa721('0x1e')](_0x1483d1);return pm2['start']({'name':_0x4f131c[_0xa721('0x19')][_0xa721('0xa')],'script':_0x51c887});})[_0xa721('0x10')](function(_0x5d072f){pm2[_0xa721('0x20')]();return _0x5d072f[0x0];})['then'](respondWithResult(_0x1f6f32,0xc9))[_0xa721('0x15')](handleError(_0x1f6f32,null));}else{return _0x1f6f32[_0xa721('0x7')](0x1f4)[_0xa721('0xb')]({'message':'Missing\x20name\x20and/or\x20path'});}};exports['update']=function(_0x43ec43,_0x306ff9){if(_0x43ec43['body']['id']){delete _0x43ec43[_0xa721('0x19')]['id'];}var _0x2447d7={'online':_0xa721('0x21'),'stopped':_0xa721('0x22')};if(_0x2447d7['hasOwnProperty'](_0x43ec43['body'][_0xa721('0x7')])){return pm2[_0x2447d7[_0x43ec43[_0xa721('0x19')][_0xa721('0x7')]]](_0x43ec43['params']['id'])['then'](respondWithResult(_0x306ff9,0xc8))[_0xa721('0x15')](handleError(_0x306ff9,null));}else{return _0x306ff9[_0xa721('0x7')](0x1f4)['send']({'message':_0xa721('0x23')});}};exports[_0xa721('0x24')]=function(_0x2f36fc,_0x52c33c){if(_0x2f36fc['body']['id']){delete _0x2f36fc['body']['id'];}if(_0x2f36fc[_0xa721('0x25')]['id']){return pm2['delete'](_0x2f36fc[_0xa721('0x25')]['id'])[_0xa721('0x10')](function(_0x56ce5e){pm2[_0xa721('0x20')]();return _0x56ce5e[0x0];})['then'](respondWithResult(_0x52c33c,null))['catch'](handleError(_0x52c33c,null));}else{return _0x52c33c[_0xa721('0x7')](0x1f4)[_0xa721('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 d00551c..48f3028 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 _0x350d=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x5338fe,_0x5e71d1){var _0xf0a1be=function(_0x306a01){while(--_0x306a01){_0x5338fe['push'](_0x5338fe['shift']());}};_0xf0a1be(++_0x5e71d1);}(_0x350d,0x17b));var _0xd350=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x350d[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xd350('0x0'));var util=require(_0xd350('0x1'));var path=require(_0xd350('0x2'));var timeout=require(_0xd350('0x3'));var express=require(_0xd350('0x4'));var router=express[_0xd350('0x5')]();var auth=require(_0xd350('0x6'));var interaction=require(_0xd350('0x7'));var config=require(_0xd350('0x8'));module[_0xd350('0x9')]=router; \ No newline at end of file +var _0x3886=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','path','connect-timeout','express'];(function(_0x1c1a12,_0x1b448b){var _0x4d7dee=function(_0x485671){while(--_0x485671){_0x1c1a12['push'](_0x1c1a12['shift']());}};_0x4d7dee(++_0x1b448b);}(_0x3886,0x149));var _0x6388=function(_0x63f06a,_0x393626){_0x63f06a=_0x63f06a-0x0;var _0x13e296=_0x3886[_0x63f06a];return _0x13e296;};'use strict';var multer=require('multer');var util=require(_0x6388('0x0'));var path=require(_0x6388('0x1'));var timeout=require(_0x6388('0x2'));var express=require(_0x6388('0x3'));var router=express[_0x6388('0x4')]();var auth=require(_0x6388('0x5'));var interaction=require(_0x6388('0x6'));var config=require(_0x6388('0x7'));module[_0x6388('0x8')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 1125a6c..e9601f5 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 _0xf308=['STRING','DATE'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xf308,0x142));var _0x8f30=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xf308[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require('sequelize');module['exports']={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x8f30('0x0')]},'scheduledat':{'type':Sequelize[_0x8f30('0x1')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x8f30('0x1')]},'responsetime':{'type':Sequelize[_0x8f30('0x1')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x8f30('0x0')]}}; \ No newline at end of file +var _0x5186=['DATE','exports','INTEGER','STRING'];(function(_0x1ae5ab,_0xc5d441){var _0x1ce001=function(_0x5ef96d){while(--_0x5ef96d){_0x1ae5ab['push'](_0x1ae5ab['shift']());}};_0x1ce001(++_0xc5d441);}(_0x5186,0x1e5));var _0x6518=function(_0x1401b5,_0x490fec){_0x1401b5=_0x1401b5-0x0;var _0x1f0b26=_0x5186[_0x1401b5];return _0x1f0b26;};'use strict';var Sequelize=require('sequelize');module[_0x6518('0x0')]={'state':{'type':Sequelize[_0x6518('0x1')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize['DATE']},'uniqueid':{'type':Sequelize[_0x6518('0x2')]},'starttime':{'type':Sequelize[_0x6518('0x3')]},'responsetime':{'type':Sequelize[_0x6518('0x3')]},'ringtime':{'type':Sequelize[_0x6518('0x1')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0x6518('0x2')]},'campaigntype':{'type':Sequelize[_0x6518('0x2')]},'membername':{'type':Sequelize[_0x6518('0x2')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 29d8fa5..05e858a 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 _0x6072=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api'];(function(_0x5dc24d,_0x51c956){var _0x5f4df8=function(_0xe15e09){while(--_0xe15e09){_0x5dc24d['push'](_0x5dc24d['shift']());}};_0x5f4df8(++_0x51c956);}(_0x6072,0xc8));var _0x2607=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x6072[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x2607('0x0'));var util=require(_0x2607('0x1'));var logger=require(_0x2607('0x2'))(_0x2607('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x2607('0x4'));var fs=require('fs');var path=require(_0x2607('0x5'));var rimraf=require(_0x2607('0x6'));var config=require(_0x2607('0x7'));var attributes=require(_0x2607('0x8'));module[_0x2607('0x9')]=function(_0x45bec6,_0x3f0389){return _0x45bec6['define'](_0x2607('0xa'),attributes,{'tableName':_0x2607('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x82a5=['api','moment','bluebird','request-promise','path','../../config/environment','./reportAgentPreview.attributes','exports','define','ReportAgentPreview','lodash','../../config/logger'];(function(_0x28e90d,_0x3d6244){var _0x103d54=function(_0x21bd66){while(--_0x21bd66){_0x28e90d['push'](_0x28e90d['shift']());}};_0x103d54(++_0x3d6244);}(_0x82a5,0x1ba));var _0x582a=function(_0x3a4651,_0x3f6576){_0x3a4651=_0x3a4651-0x0;var _0x2c8801=_0x82a5[_0x3a4651];return _0x2c8801;};'use strict';var _=require(_0x582a('0x0'));var util=require('util');var logger=require(_0x582a('0x1'))(_0x582a('0x2'));var moment=require(_0x582a('0x3'));var BPromise=require(_0x582a('0x4'));var rp=require(_0x582a('0x5'));var fs=require('fs');var path=require(_0x582a('0x6'));var rimraf=require('rimraf');var config=require(_0x582a('0x7'));var attributes=require(_0x582a('0x8'));module[_0x582a('0x9')]=function(_0x3acae1,_0x7f315d){return _0x3acae1[_0x582a('0xa')](_0x582a('0xb'),attributes,{'tableName':'report_agent_preview','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.rpc.js b/server/api/reportAgentPreview/reportAgentPreview.rpc.js index 6176a1e..e1e9f60 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 _0x23f0=['catch','CreateReportAgentPreview','ReportAgentPreview','create','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','ReportAgentPreview,\x20%s,\x20%s','message','result'];(function(_0x61e214,_0x4c4e23){var _0x3ebca5=function(_0x57bab8){while(--_0x57bab8){_0x61e214['push'](_0x61e214['shift']());}};_0x3ebca5(++_0x4c4e23);}(_0x23f0,0x1c9));var _0x023f=function(_0x21b7e2,_0x31f5bc){_0x21b7e2=_0x21b7e2-0x0;var _0x4bd51f=_0x23f0[_0x21b7e2];return _0x4bd51f;};'use strict';var _=require(_0x023f('0x0'));var util=require(_0x023f('0x1'));var moment=require(_0x023f('0x2'));var BPromise=require(_0x023f('0x3'));var rs=require(_0x023f('0x4'));var fs=require('fs');var Redis=require(_0x023f('0x5'));var db=require(_0x023f('0x6'))['db'];var utils=require(_0x023f('0x7'));var logger=require(_0x023f('0x8'))(_0x023f('0x9'));var config=require(_0x023f('0xa'));var jayson=require(_0x023f('0xb'));var client=jayson[_0x023f('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x333c8b,_0x5d50a0,_0x2bbc4c){return new BPromise(function(_0x2ae2ad,_0x3c5ed8){return client[_0x023f('0xd')](_0x333c8b,_0x2bbc4c)['then'](function(_0xa22bff){logger[_0x023f('0xe')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d50a0,_0x023f('0xf'));logger[_0x023f('0x10')](_0x023f('0x11'),_0x5d50a0,_0x023f('0xf'),JSON[_0x023f('0x12')](_0xa22bff));if(_0xa22bff[_0x023f('0x13')]){if(_0xa22bff[_0x023f('0x13')]['code']===0x1f4){logger[_0x023f('0x13')](_0x023f('0x14'),_0x5d50a0,_0xa22bff['error'][_0x023f('0x15')]);return _0x3c5ed8(_0xa22bff[_0x023f('0x13')][_0x023f('0x15')]);}logger[_0x023f('0x13')]('ReportAgentPreview,\x20%s,\x20%s',_0x5d50a0,_0xa22bff['error'][_0x023f('0x15')]);return _0x2ae2ad(_0xa22bff[_0x023f('0x13')][_0x023f('0x15')]);}else{logger[_0x023f('0xe')](_0x023f('0x14'),_0x5d50a0,_0x023f('0xf'));_0x2ae2ad(_0xa22bff[_0x023f('0x16')][_0x023f('0x15')]);}})[_0x023f('0x17')](function(_0x3a6609){logger[_0x023f('0x13')](_0x023f('0x14'),_0x5d50a0,_0x3a6609);_0x3c5ed8(_0x3a6609);});});}exports[_0x023f('0x18')]=function(_0x46a0bd){var _0x922364=this;return new Promise(function(_0x13a1c2,_0xe0e585){return db[_0x023f('0x19')][_0x023f('0x1a')](_0x46a0bd[_0x023f('0x1b')],{'raw':_0x46a0bd['options']?_0x46a0bd['options'][_0x023f('0x1c')]===undefined?!![]:![]:!![]})[_0x023f('0x1d')](function(_0x49fd81){logger[_0x023f('0xe')]('CreateReportAgentPreview',_0x46a0bd);logger[_0x023f('0x10')](_0x023f('0x18'),_0x46a0bd,JSON[_0x023f('0x12')](_0x49fd81));_0x13a1c2(_0x49fd81);})['catch'](function(_0x33c78c){logger[_0x023f('0x13')](_0x023f('0x18'),_0x33c78c[_0x023f('0x15')],_0x46a0bd);_0xe0e585(_0x922364[_0x023f('0x13')](0x1f4,_0x33c78c['message']));});});}; \ No newline at end of file +var _0x8696=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','ReportAgentPreview,\x20%s,\x20%s','ReportAgentPreview,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','catch','CreateReportAgentPreview','ReportAgentPreview','create','body','options','then','debug','stringify','lodash','bluebird'];(function(_0x4c35de,_0x4e45a2){var _0x1f6fb9=function(_0x3c961c){while(--_0x3c961c){_0x4c35de['push'](_0x4c35de['shift']());}};_0x1f6fb9(++_0x4e45a2);}(_0x8696,0x1da));var _0x6869=function(_0x2100ab,_0x511a6c){_0x2100ab=_0x2100ab-0x0;var _0x12c01b=_0x8696[_0x2100ab];return _0x12c01b;};'use strict';var _=require(_0x6869('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6869('0x1'));var rs=require(_0x6869('0x2'));var fs=require('fs');var Redis=require(_0x6869('0x3'));var db=require(_0x6869('0x4'))['db'];var utils=require(_0x6869('0x5'));var logger=require(_0x6869('0x6'))(_0x6869('0x7'));var config=require(_0x6869('0x8'));var jayson=require(_0x6869('0x9'));var client=jayson[_0x6869('0xa')][_0x6869('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b1c44,_0x5bf075,_0x5887bd){return new BPromise(function(_0x141e09,_0x58427e){return client['request'](_0x3b1c44,_0x5887bd)['then'](function(_0xf7cdd3){logger[_0x6869('0xc')](_0x6869('0xd'),_0x5bf075,'request\x20sent');logger['debug'](_0x6869('0xe'),_0x5bf075,_0x6869('0xf'),JSON['stringify'](_0xf7cdd3));if(_0xf7cdd3[_0x6869('0x10')]){if(_0xf7cdd3[_0x6869('0x10')][_0x6869('0x11')]===0x1f4){logger[_0x6869('0x10')](_0x6869('0xd'),_0x5bf075,_0xf7cdd3[_0x6869('0x10')][_0x6869('0x12')]);return _0x58427e(_0xf7cdd3['error'][_0x6869('0x12')]);}logger['error'](_0x6869('0xd'),_0x5bf075,_0xf7cdd3['error']['message']);return _0x141e09(_0xf7cdd3['error'][_0x6869('0x12')]);}else{logger[_0x6869('0xc')](_0x6869('0xd'),_0x5bf075,'request\x20sent');_0x141e09(_0xf7cdd3['result'][_0x6869('0x12')]);}})[_0x6869('0x13')](function(_0xdeb533){logger[_0x6869('0x10')]('ReportAgentPreview,\x20%s,\x20%s',_0x5bf075,_0xdeb533);_0x58427e(_0xdeb533);});});}exports[_0x6869('0x14')]=function(_0x4fe238){var _0x1f9f75=this;return new Promise(function(_0x514578,_0x5165a3){return db[_0x6869('0x15')][_0x6869('0x16')](_0x4fe238[_0x6869('0x17')],{'raw':_0x4fe238[_0x6869('0x18')]?_0x4fe238['options']['raw']===undefined?!![]:![]:!![]})[_0x6869('0x19')](function(_0xcf71c8){logger[_0x6869('0xc')]('CreateReportAgentPreview',_0x4fe238);logger[_0x6869('0x1a')](_0x6869('0x14'),_0x4fe238,JSON[_0x6869('0x1b')](_0xcf71c8));_0x514578(_0xcf71c8);})[_0x6869('0x13')](function(_0x36a407){logger[_0x6869('0x10')](_0x6869('0x14'),_0x36a407[_0x6869('0x12')],_0x4fe238);_0x5165a3(_0x1f9f75[_0x6869('0x10')](0x1f4,_0x36a407[_0x6869('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 32e4933..0de8f6f 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 _0x5458=['/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify','queueNotify','mail','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','/sms/queues/:id','showSmsQueues','agentNotify','multer','util','path','Router','../../components/auth/service','get','/voice/channels','isAuthenticated','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','/mail/queues','/mail/accounts','mailAccounts','/openchannel/queues','openchannelQueues','smsQueues','/fax/queues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','/voice/queues/:id','showVoiceQueues','/outbound','outbound','outboundChannels','agents','put','/agents/:id/capacity','agentCapacity','/telephones','trunks','campaigns'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x5458,0x1c7));var _0x8545=function(_0x41b8d1,_0x3cc4c3){_0x41b8d1=_0x41b8d1-0x0;var _0x2c87ef=_0x5458[_0x41b8d1];return _0x2c87ef;};'use strict';var multer=require(_0x8545('0x0'));var util=require(_0x8545('0x1'));var path=require(_0x8545('0x2'));var express=require('express');var router=express[_0x8545('0x3')]();var auth=require(_0x8545('0x4'));var controller=require('./rpc.controller');router[_0x8545('0x5')](_0x8545('0x6'),auth[_0x8545('0x7')](),controller['voiceChannels']);router[_0x8545('0x5')](_0x8545('0x8'),auth[_0x8545('0x7')](),controller[_0x8545('0x9')]);router['get'](_0x8545('0xa'),auth['isAuthenticated'](),controller[_0x8545('0xb')]);router[_0x8545('0x5')](_0x8545('0xc'),auth[_0x8545('0x7')](),controller[_0x8545('0xd')]);router[_0x8545('0x5')](_0x8545('0xe'),auth[_0x8545('0x7')](),controller['chatQueues']);router[_0x8545('0x5')](_0x8545('0xf'),auth[_0x8545('0x7')](),controller['mailQueues']);router[_0x8545('0x5')](_0x8545('0x10'),auth[_0x8545('0x7')](),controller[_0x8545('0x11')]);router[_0x8545('0x5')](_0x8545('0x12'),auth[_0x8545('0x7')](),controller[_0x8545('0x13')]);router[_0x8545('0x5')]('/sms/queues',auth[_0x8545('0x7')](),controller[_0x8545('0x14')]);router['get'](_0x8545('0x15'),auth[_0x8545('0x7')](),controller[_0x8545('0x16')]);router['get'](_0x8545('0x17'),auth[_0x8545('0x7')](),controller[_0x8545('0x18')]);router['get']('/voice/queues/channels',auth[_0x8545('0x7')](),controller[_0x8545('0x19')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0x8545('0x1a')]);router[_0x8545('0x5')](_0x8545('0x1b'),auth[_0x8545('0x7')](),controller[_0x8545('0x1c')]);router[_0x8545('0x5')](_0x8545('0x1d'),auth[_0x8545('0x7')](),controller['voiceQueuesChannelRedirect']);router[_0x8545('0x5')](_0x8545('0x1e'),auth[_0x8545('0x7')](),controller[_0x8545('0x1f')]);router[_0x8545('0x5')](_0x8545('0x20'),auth['isAuthenticated'](),controller[_0x8545('0x21')]);router['get']('/outbound/channels',auth[_0x8545('0x7')](),controller[_0x8545('0x22')]);router[_0x8545('0x5')]('/agents',auth[_0x8545('0x7')](),controller[_0x8545('0x23')]);router[_0x8545('0x24')](_0x8545('0x25'),auth['isAuthenticated'](),controller[_0x8545('0x26')]);router[_0x8545('0x5')](_0x8545('0x27'),auth[_0x8545('0x7')](),controller['telephones']);router['get']('/trunks',auth[_0x8545('0x7')](),controller[_0x8545('0x28')]);router[_0x8545('0x5')]('/campaigns',auth['isAuthenticated'](),controller[_0x8545('0x29')]);router[_0x8545('0x5')](_0x8545('0x2a'),auth[_0x8545('0x7')](),controller[_0x8545('0x2b')]);router[_0x8545('0x5')](_0x8545('0x2c'),auth[_0x8545('0x7')](),controller[_0x8545('0x2d')]);router[_0x8545('0x5')](_0x8545('0x2e'),auth[_0x8545('0x7')](),controller[_0x8545('0x2f')]);router[_0x8545('0x5')]('/openchannel/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x8545('0x30')]);router[_0x8545('0x5')](_0x8545('0x31'),auth[_0x8545('0x7')](),controller[_0x8545('0x32')]);router[_0x8545('0x5')](_0x8545('0x33'),auth[_0x8545('0x7')](),controller[_0x8545('0x34')]);router[_0x8545('0x35')](_0x8545('0x36'),auth[_0x8545('0x7')](),controller[_0x8545('0x37')](_0x8545('0x38')));router[_0x8545('0x5')]('/mail/queues/:id',auth[_0x8545('0x7')](),controller['showMailQueues']);router['post'](_0x8545('0x39'),auth['isAuthenticated'](),controller[_0x8545('0x37')]('chat'));router[_0x8545('0x5')](_0x8545('0x3a'),auth['isAuthenticated'](),controller[_0x8545('0x3b')]);router['post']('/fax/queues/:id/notify',auth[_0x8545('0x7')](),controller[_0x8545('0x37')](_0x8545('0x3c')));router['get'](_0x8545('0x3d'),auth[_0x8545('0x7')](),controller[_0x8545('0x3e')]);router['post'](_0x8545('0x3f'),auth[_0x8545('0x7')](),controller[_0x8545('0x37')](_0x8545('0x40')));router['get'](_0x8545('0x41'),auth[_0x8545('0x7')](),controller[_0x8545('0x42')]);router[_0x8545('0x35')](_0x8545('0x43'),auth[_0x8545('0x7')](),controller[_0x8545('0x37')]('sms'));router[_0x8545('0x5')](_0x8545('0x44'),auth['isAuthenticated'](),controller[_0x8545('0x45')]);router['post']('/agents/:id/notify',auth[_0x8545('0x7')](),controller[_0x8545('0x46')]);module['exports']=router; \ No newline at end of file +var _0x718f=['./rpc.controller','/voice/channels','isAuthenticated','voiceChannels','get','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','/voice/channels/:uniqueid/stopmixmonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','/chat/queues','chatQueues','/mail/accounts','mailAccounts','/openchannel/queues','smsQueues','/fax/queues','/voice/queues/preview/:id','/voice/queues/channels','voiceQueuesChannels','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','showVoiceQueues','/outbound','/outbound/channels','outboundChannels','/agents','put','/agents/:id/capacity','agentCapacity','telephones','/trunks','trunks','campaigns','/fax/accounts','faxAccounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','queueNotify','post','/chat/queues/:id/notify','chat','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/openchannel/queues/:id/notify','showOpenchannelQueues','/sms/queues/:id/notify','sms','showSmsQueues','exports','path','express','Router','../../components/auth/service'];(function(_0x23284b,_0x22a02b){var _0x3b8e38=function(_0x455e63){while(--_0x455e63){_0x23284b['push'](_0x23284b['shift']());}};_0x3b8e38(++_0x22a02b);}(_0x718f,0x84));var _0xf718=function(_0x4c7d8b,_0x572388){_0x4c7d8b=_0x4c7d8b-0x0;var _0x187158=_0x718f[_0x4c7d8b];return _0x187158;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xf718('0x0'));var express=require(_0xf718('0x1'));var router=express[_0xf718('0x2')]();var auth=require(_0xf718('0x3'));var controller=require(_0xf718('0x4'));router['get'](_0xf718('0x5'),auth[_0xf718('0x6')](),controller[_0xf718('0x7')]);router[_0xf718('0x8')](_0xf718('0x9'),auth[_0xf718('0x6')](),controller[_0xf718('0xa')]);router['get'](_0xf718('0xb'),auth[_0xf718('0x6')](),controller[_0xf718('0xc')]);router[_0xf718('0x8')](_0xf718('0xd'),auth['isAuthenticated'](),controller[_0xf718('0xe')]);router[_0xf718('0x8')](_0xf718('0xf'),auth['isAuthenticated'](),controller[_0xf718('0x10')]);router['get']('/mail/queues',auth[_0xf718('0x6')](),controller['mailQueues']);router[_0xf718('0x8')](_0xf718('0x11'),auth[_0xf718('0x6')](),controller[_0xf718('0x12')]);router[_0xf718('0x8')](_0xf718('0x13'),auth[_0xf718('0x6')](),controller['openchannelQueues']);router[_0xf718('0x8')]('/sms/queues',auth[_0xf718('0x6')](),controller[_0xf718('0x14')]);router[_0xf718('0x8')](_0xf718('0x15'),auth['isAuthenticated'](),controller['faxQueues']);router[_0xf718('0x8')](_0xf718('0x16'),auth[_0xf718('0x6')](),controller['voiceQueuesPreview']);router['get'](_0xf718('0x17'),auth['isAuthenticated'](),controller[_0xf718('0x18')]);router['get']('/voice/queues/channels/:uniqueid',auth['isAuthenticated'](),controller[_0xf718('0x19')]);router['get'](_0xf718('0x1a'),auth[_0xf718('0x6')](),controller[_0xf718('0x1b')]);router[_0xf718('0x8')](_0xf718('0x1c'),auth[_0xf718('0x6')](),controller[_0xf718('0x1d')]);router['get'](_0xf718('0x1e'),auth[_0xf718('0x6')](),controller[_0xf718('0x1f')]);router[_0xf718('0x8')](_0xf718('0x20'),auth[_0xf718('0x6')](),controller['outbound']);router[_0xf718('0x8')](_0xf718('0x21'),auth[_0xf718('0x6')](),controller[_0xf718('0x22')]);router['get'](_0xf718('0x23'),auth[_0xf718('0x6')](),controller['agents']);router[_0xf718('0x24')](_0xf718('0x25'),auth[_0xf718('0x6')](),controller[_0xf718('0x26')]);router['get']('/telephones',auth[_0xf718('0x6')](),controller[_0xf718('0x27')]);router[_0xf718('0x8')](_0xf718('0x28'),auth[_0xf718('0x6')](),controller[_0xf718('0x29')]);router[_0xf718('0x8')]('/campaigns',auth[_0xf718('0x6')](),controller[_0xf718('0x2a')]);router['get'](_0xf718('0x2b'),auth[_0xf718('0x6')](),controller[_0xf718('0x2c')]);router[_0xf718('0x8')](_0xf718('0x2d'),auth[_0xf718('0x6')](),controller[_0xf718('0x2e')]);router['get'](_0xf718('0x2f'),auth[_0xf718('0x6')](),controller[_0xf718('0x30')]);router[_0xf718('0x8')](_0xf718('0x31'),auth[_0xf718('0x6')](),controller[_0xf718('0x32')]);router[_0xf718('0x8')](_0xf718('0x33'),auth[_0xf718('0x6')](),controller['smsQueuesWaitingInteractions']);router[_0xf718('0x8')](_0xf718('0x34'),auth[_0xf718('0x6')](),controller[_0xf718('0x35')]);router['post']('/mail/queues/:id/notify',auth[_0xf718('0x6')](),controller[_0xf718('0x36')]('mail'));router[_0xf718('0x8')]('/mail/queues/:id',auth[_0xf718('0x6')](),controller['showMailQueues']);router[_0xf718('0x37')](_0xf718('0x38'),auth['isAuthenticated'](),controller[_0xf718('0x36')](_0xf718('0x39')));router[_0xf718('0x8')](_0xf718('0x3a'),auth['isAuthenticated'](),controller[_0xf718('0x3b')]);router[_0xf718('0x37')](_0xf718('0x3c'),auth[_0xf718('0x6')](),controller[_0xf718('0x36')](_0xf718('0x3d')));router[_0xf718('0x8')]('/fax/queues/:id',auth['isAuthenticated'](),controller['showFaxQueues']);router[_0xf718('0x37')](_0xf718('0x3e'),auth['isAuthenticated'](),controller[_0xf718('0x36')]('openchannel'));router[_0xf718('0x8')]('/openchannel/queues/:id',auth[_0xf718('0x6')](),controller[_0xf718('0x3f')]);router[_0xf718('0x37')](_0xf718('0x40'),auth[_0xf718('0x6')](),controller['queueNotify'](_0xf718('0x41')));router['get']('/sms/queues/:id',auth['isAuthenticated'](),controller[_0xf718('0x42')]);router[_0xf718('0x37')]('/agents/:id/notify',auth[_0xf718('0x6')](),controller['agentNotify']);module[_0xf718('0x43')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 7896e7b..9468780 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 _0x8559=['findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','agent','AgentCapacity','capacity','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','ChatQueues','showChatQueues','MailQueues','showMailQueues','openchannelQueues','OpenchannelQueues','showOpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','showFaxQueues','FaxQueues','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','\x20Queue\x20not\x20found','findOne','messageId','Interaction','update','queue','MessageId','From','QueueId','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','channel','User','Agent\x20not\x20found','Message','\x20Message\x20not\x20found','create','agentTransferTimeout','moment','lodash','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','result','catch','status','sendStatus','stack','name','send','isNil','rows','find','voiceChannels','query','voiceChannelMixMonitor','merge','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','showVoiceQueues','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','body','interaction','user','hasOwnProperty'];(function(_0x152944,_0x77801c){var _0x30b901=function(_0x12ebad){while(--_0x12ebad){_0x152944['push'](_0x152944['shift']());}};_0x30b901(++_0x77801c);}(_0x8559,0x192));var _0x9855=function(_0x3e12dd,_0x5e933e){_0x3e12dd=_0x3e12dd-0x0;var _0x1bfca1=_0x8559[_0x3e12dd];return _0x1bfca1;};'use strict';var BPromise=require('bluebird');var moment=require(_0x9855('0x0'));var _=require(_0x9855('0x1'));var util=require('util');var db=require('../../mysqldb')['db'];var logger=require(_0x9855('0x2'))(_0x9855('0x3'));var jayson=require(_0x9855('0x4'));var amiClient=jayson[_0x9855('0x5')][_0x9855('0x6')]({'port':0x232a});var mailClient=jayson[_0x9855('0x5')][_0x9855('0x6')]({'port':0x232b});var routingClient=jayson[_0x9855('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0x2a338f,_0x5514d3,_0xd31edb){return new BPromise(function(_0x3b7004,_0x55fffb){var _0x16dbc3=_0xd31edb?_0xd31edb:amiClient;return _0x16dbc3[_0x9855('0x7')](_0x2a338f,_0x5514d3)[_0x9855('0x8')](function(_0x5f3eec){if(_0x5f3eec['error']){if(_0x5f3eec[_0x9855('0x9')][_0x9855('0xa')]===0x1f4){return _0x55fffb(_0x5f3eec[_0x9855('0x9')][_0x9855('0xb')]);}return _0x3b7004(_0x5f3eec['error'][_0x9855('0xb')]);}else{_0x3b7004(_0x5f3eec[_0x9855('0xc')]);}})[_0x9855('0xd')](function(_0xdc35b1){_0x55fffb(_0xdc35b1);});});}function respondWithResult(_0x3f387d,_0x2daab){_0x2daab=_0x2daab||0xc8;return function(_0x36016a){if(_0x36016a){return _0x3f387d[_0x9855('0xe')](_0x2daab)['json'](_0x36016a);}return _0x3f387d[_0x9855('0xf')](0x194);};}function handleError(_0x2fe068,_0x5687c1){_0x5687c1=_0x5687c1||0x1f4;return function(_0x70aac3){logger[_0x9855('0x9')](_0x70aac3[_0x9855('0x10')]);if(_0x70aac3['name']){delete _0x70aac3[_0x9855('0x11')];}_0x2fe068[_0x9855('0xe')](_0x5687c1)[_0x9855('0x12')](_0x70aac3);};}function findById(_0x4056b4){return function(_0x2174fc){if(!_[_0x9855('0x13')](_0x4056b4)&&!_[_0x9855('0x13')](_0x2174fc)&&!_[_0x9855('0x13')](_0x2174fc[_0x9855('0x14')])){return _[_0x9855('0x15')](_0x2174fc['rows'],function(_0x415282){return _0x415282['id']==_0x4056b4;});}return null;};}exports[_0x9855('0x16')]=function(_0x458ab3,_0x1c5216){return respondWithRpcPromise('VoiceChannels',_0x458ab3[_0x9855('0x17')])[_0x9855('0x8')](respondWithResult(_0x1c5216,null))['catch'](handleError(_0x1c5216,null));};exports[_0x9855('0x18')]=function(_0x4bd469,_0x42a1ed){return respondWithRpcPromise('VoiceChannelMixMonitor',_[_0x9855('0x19')](_0x4bd469['query'],_0x4bd469[_0x9855('0x1a')]))[_0x9855('0x8')](respondWithResult(_0x42a1ed,null))[_0x9855('0xd')](handleError(_0x42a1ed,null));};exports[_0x9855('0x1b')]=function(_0x4d5b7b,_0xfef94d){return respondWithRpcPromise(_0x9855('0x1c'),_[_0x9855('0x19')](_0x4d5b7b[_0x9855('0x17')],_0x4d5b7b[_0x9855('0x1a')]))[_0x9855('0x8')](respondWithResult(_0xfef94d,null))[_0x9855('0xd')](handleError(_0xfef94d,null));};exports['voiceQueues']=function(_0xd36056,_0xbc3109){return respondWithRpcPromise('VoiceQueues',_0xd36056[_0x9855('0x17')])[_0x9855('0x8')](respondWithResult(_0xbc3109,null))['catch'](handleError(_0xbc3109,null));};exports[_0x9855('0x1d')]=function(_0x32dc9d,_0x3e6a73){return respondWithRpcPromise('VoiceQueues',_0x32dc9d[_0x9855('0x17')])[_0x9855('0x8')](findById(_0x32dc9d[_0x9855('0x1a')]['id']))[_0x9855('0x8')](respondWithResult(_0x3e6a73,null))[_0x9855('0xd')](handleError(_0x3e6a73,null));};exports['voiceQueuesPreview']=function(_0x35b935,_0x3b3f76){return respondWithRpcPromise(_0x9855('0x1e'),_[_0x9855('0x19')](_0x35b935['query'],_0x35b935[_0x9855('0x1a')]))[_0x9855('0x8')](respondWithResult(_0x3b3f76,null))[_0x9855('0xd')](handleError(_0x3b3f76,null));};exports[_0x9855('0x1f')]=function(_0xfc4021,_0x242154){return respondWithRpcPromise(_0x9855('0x20'),_0xfc4021['query'])[_0x9855('0x8')](respondWithResult(_0x242154,null))[_0x9855('0xd')](handleError(_0x242154,null));};exports[_0x9855('0x21')]=function(_0x4f5f1d,_0x349597){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x9855('0x19')](_0x4f5f1d['query'],_0x4f5f1d[_0x9855('0x1a')]))[_0x9855('0x8')](respondWithResult(_0x349597,null))[_0x9855('0xd')](handleError(_0x349597,null));};exports[_0x9855('0x22')]=function(_0xe94e4e,_0x18f086){return respondWithRpcPromise('VoiceQueuesChannelHangup',_[_0x9855('0x19')](_0xe94e4e['query'],_0xe94e4e[_0x9855('0x1a')]))[_0x9855('0x8')](respondWithResult(_0x18f086,null))[_0x9855('0xd')](handleError(_0x18f086,null));};exports[_0x9855('0x23')]=function(_0x428820,_0x23596a){return respondWithRpcPromise(_0x9855('0x24'),_[_0x9855('0x19')](_0x428820[_0x9855('0x17')],_0x428820['params']))[_0x9855('0x8')](respondWithResult(_0x23596a,null))[_0x9855('0xd')](handleError(_0x23596a,null));};exports[_0x9855('0x25')]=function(_0x10a338,_0x2166b1){return respondWithRpcPromise(_0x9855('0x26'),_0x10a338[_0x9855('0x17')])['then'](respondWithResult(_0x2166b1,null))['catch'](handleError(_0x2166b1,null));};exports['outboundChannels']=function(_0xc73761,_0x40400e){return respondWithRpcPromise(_0x9855('0x27'),_0xc73761[_0x9855('0x17')])['then'](respondWithResult(_0x40400e,null))[_0x9855('0xd')](handleError(_0x40400e,null));};exports[_0x9855('0x28')]=function(_0x4b9400,_0x1ce050){var _0x269053;return respondWithRpcPromise(_0x9855('0x29'),_0x4b9400[_0x9855('0x17')])['then'](function(_0xd01387){_0x269053=_0xd01387;return respondWithRpcPromise(_0x9855('0x29'),_0x4b9400[_0x9855('0x17')],routingClient);})[_0x9855('0x8')](function(_0x547910){return _[_0x9855('0x19')]({},_0x547910,_0x269053);})[_0x9855('0x8')](respondWithResult(_0x1ce050,null))[_0x9855('0xd')](handleError(_0x1ce050,null));};exports['agentCapacity']=function(_0x2ed351,_0x2f2f2e){if(_0x2ed351[_0x9855('0x2a')]&&_0x2ed351['body'][_0x9855('0x2b')]&&_0x2ed351[_0x9855('0x2c')]&&_0x2ed351[_0x9855('0x2c')]['name']){for(var _0xf68098 in _0x2ed351[_0x9855('0x2a')][_0x9855('0x2b')]){if(_0x2ed351['body'][_0x9855('0x2b')][_0x9855('0x2d')](_0xf68098)){db['MemberReport'][_0x9855('0x2e')]({'where':{'channel':_0xf68098,'membername':_0x2ed351[_0x9855('0x2c')][_0x9855('0x11')],'type':_0x9855('0x2f'),'exitAt':null,'uniqueid':_0x2ed351[_0x9855('0x2a')]['interaction'][_0xf68098]&&_0x2ed351[_0x9855('0x2a')][_0x9855('0x2b')][_0xf68098][_0x9855('0x30')]?{'$notIn':_0x2ed351['body'][_0x9855('0x2b')][_0xf68098]}:{'$ne':null}}})[_0x9855('0x8')](function(_0x45b004){var _0x48fd49=moment()[_0x9855('0x31')](_0x9855('0x32'));for(var _0x269e5d=0x0,_0x4b59ff=_0x45b004['length'];_0x269e5d<_0x4b59ff;_0x269e5d+=0x1){_0x45b004[_0x269e5d][_0x9855('0x33')]({'exitAt':_0x48fd49});}});for(var _0x562c94=0x0;_0x562c94<_0x2ed351[_0x9855('0x2a')][_0x9855('0x2b')][_0xf68098][_0x9855('0x30')];_0x562c94+=0x1){db[_0x9855('0x34')][_0x9855('0x35')]({'where':{'channel':_0xf68098,'membername':_0x2ed351[_0x9855('0x2c')][_0x9855('0x11')],'type':'INTERACTION','uniqueid':_0x2ed351['body']['interaction'][_0xf68098][_0x562c94],'exitAt':null},'defaults':{'channel':_0xf68098,'membername':_0x2ed351[_0x9855('0x2c')][_0x9855('0x11')],'interface':_[_0x9855('0x13')](_0x2ed351['user'][_0x9855('0x36')])?util[_0x9855('0x31')]('SIP/%s',_0x2ed351[_0x9855('0x2c')][_0x9855('0x11')]):_0x2ed351[_0x9855('0x2c')][_0x9855('0x36')],'type':_0x9855('0x2f'),'enterAt':moment()[_0x9855('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x9855('0x37'),'internal':_0x2ed351['user']['internal'],'uniqueid':_0x2ed351[_0x9855('0x2a')][_0x9855('0x2b')][_0xf68098][_0x562c94]}});}}}}return respondWithRpcPromise(_0x9855('0x38'),{'id':_0x2ed351[_0x9855('0x1a')]['id'],'capacity':_0x2ed351['body'][_0x9855('0x39')]},routingClient)['then'](respondWithResult(_0x2f2f2e,null))[_0x9855('0xd')](handleError(_0x2f2f2e,null));};exports['telephones']=function(_0x453cb8,_0x4994c5){return respondWithRpcPromise(_0x9855('0x3a'),_0x453cb8[_0x9855('0x17')])[_0x9855('0x8')](respondWithResult(_0x4994c5,null))['catch'](handleError(_0x4994c5,null));};exports[_0x9855('0x3b')]=function(_0x87f0fe,_0x340bb4){return respondWithRpcPromise(_0x9855('0x3c'),_0x87f0fe['query'])[_0x9855('0x8')](respondWithResult(_0x340bb4,null))[_0x9855('0xd')](handleError(_0x340bb4,null));};exports[_0x9855('0x3d')]=function(_0x2433f6,_0x20157d){return respondWithRpcPromise(_0x9855('0x3e'),_0x2433f6[_0x9855('0x17')])['then'](respondWithResult(_0x20157d,null))[_0x9855('0xd')](handleError(_0x20157d,null));};exports[_0x9855('0x3f')]=function(_0x4bbd41,_0x526e10){return respondWithRpcPromise(_0x9855('0x40'),_0x4bbd41['query'],routingClient)[_0x9855('0x8')](respondWithResult(_0x526e10,null))['catch'](handleError(_0x526e10,null));};exports[_0x9855('0x41')]=function(_0x4611f2,_0xced6dd){return respondWithRpcPromise(_0x9855('0x40'),_0x4611f2[_0x9855('0x17')],routingClient)['then'](findById(_0x4611f2[_0x9855('0x1a')]['id']))['then'](respondWithResult(_0xced6dd,null))[_0x9855('0xd')](handleError(_0xced6dd,null));};exports['mailQueues']=function(_0x49b83d,_0x105b6b){return respondWithRpcPromise(_0x9855('0x42'),_0x49b83d['query'],routingClient)[_0x9855('0x8')](respondWithResult(_0x105b6b,null))[_0x9855('0xd')](handleError(_0x105b6b,null));};exports[_0x9855('0x43')]=function(_0x5e0ffc,_0x40cdeb){return respondWithRpcPromise('MailQueues',_0x5e0ffc[_0x9855('0x17')],routingClient)[_0x9855('0x8')](findById(_0x5e0ffc['params']['id']))[_0x9855('0x8')](respondWithResult(_0x40cdeb,null))[_0x9855('0xd')](handleError(_0x40cdeb,null));};exports['mailAccounts']=function(_0x1b6798,_0x13d1fb){return respondWithRpcPromise('MailAccounts',_0x1b6798[_0x9855('0x17')],mailClient)[_0x9855('0x8')](respondWithResult(_0x13d1fb,null))[_0x9855('0xd')](handleError(_0x13d1fb,null));};exports[_0x9855('0x44')]=function(_0x5ef17e,_0x176126){return respondWithRpcPromise(_0x9855('0x45'),_0x5ef17e[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0x176126,null))[_0x9855('0xd')](handleError(_0x176126,null));};exports[_0x9855('0x46')]=function(_0x42cc5b,_0x1fc5a4){return respondWithRpcPromise(_0x9855('0x45'),_0x42cc5b[_0x9855('0x17')],routingClient)[_0x9855('0x8')](findById(_0x42cc5b[_0x9855('0x1a')]['id']))['then'](respondWithResult(_0x1fc5a4,null))[_0x9855('0xd')](handleError(_0x1fc5a4,null));};exports[_0x9855('0x47')]=function(_0x2aa99d,_0x6125e7){return respondWithRpcPromise(_0x9855('0x48'),_0x2aa99d[_0x9855('0x17')],routingClient)['then'](respondWithResult(_0x6125e7,null))['catch'](handleError(_0x6125e7,null));};exports[_0x9855('0x49')]=function(_0x1aef92,_0x3dd367){return respondWithRpcPromise(_0x9855('0x48'),_0x1aef92[_0x9855('0x17')],routingClient)[_0x9855('0x8')](findById(_0x1aef92[_0x9855('0x1a')]['id']))[_0x9855('0x8')](respondWithResult(_0x3dd367,null))[_0x9855('0xd')](handleError(_0x3dd367,null));};exports[_0x9855('0x4a')]=function(_0x3c87bd,_0x313c10){return respondWithRpcPromise('FaxQueues',_0x3c87bd[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0x313c10,null))['catch'](handleError(_0x313c10,null));};exports[_0x9855('0x4b')]=function(_0x225ba0,_0x3ffaf0){return respondWithRpcPromise(_0x9855('0x4c'),_0x225ba0[_0x9855('0x17')],routingClient)[_0x9855('0x8')](findById(_0x225ba0[_0x9855('0x1a')]['id']))[_0x9855('0x8')](respondWithResult(_0x3ffaf0,null))['catch'](handleError(_0x3ffaf0,null));};exports['faxAccounts']=function(_0x3f5fcd,_0x3e38e5){return respondWithRpcPromise('FaxAccounts',_0x3f5fcd[_0x9855('0x17')])[_0x9855('0x8')](respondWithResult(_0x3e38e5,null))['catch'](handleError(_0x3e38e5,null));};exports[_0x9855('0x4d')]=function(_0x2680d5,_0xbe8ec7){return respondWithRpcPromise(_0x9855('0x4e'),_0x2680d5[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0xbe8ec7,null))[_0x9855('0xd')](handleError(_0xbe8ec7,null));};exports[_0x9855('0x4f')]=function(_0x47ebe6,_0x5e897c){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x47ebe6['query'],routingClient)['then'](respondWithResult(_0x5e897c,null))[_0x9855('0xd')](handleError(_0x5e897c,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x355540,_0x3d7263){return respondWithRpcPromise(_0x9855('0x50'),_0x355540[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0x3d7263,null))[_0x9855('0xd')](handleError(_0x3d7263,null));};exports[_0x9855('0x51')]=function(_0x1cd321,_0x37b68c){return respondWithRpcPromise(_0x9855('0x52'),_0x1cd321[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0x37b68c,null))['catch'](handleError(_0x37b68c,null));};exports[_0x9855('0x53')]=function(_0x37692c,_0x4249ec){return respondWithRpcPromise(_0x9855('0x54'),_0x37692c[_0x9855('0x17')],routingClient)[_0x9855('0x8')](respondWithResult(_0x4249ec,null))['catch'](handleError(_0x4249ec,null));};exports[_0x9855('0x55')]=function(_0x257038){return function(_0x31eab4,_0x449c8f){var _0x13b2d4,_0x376d48;var _0x122489=_[_0x9855('0x56')](_0x257038);var _0x1d6085=_0x257038===_0x9855('0x57')?_0x9855('0x58'):_0x9855('0x59');return db[_0x122489+_0x9855('0x5a')]['findOne']({'raw':!![],'where':{'id':_0x31eab4['params']['id']}})[_0x9855('0x8')](function(_0x397c85){if(_[_0x9855('0x13')](_0x397c85)){throw new Error(_0x122489+_0x9855('0x5b'));}_0x13b2d4=_0x397c85;return db[_0x122489+'Message'][_0x9855('0x5c')]({'where':{'id':_0x31eab4[_0x9855('0x2a')][_0x9855('0x5d')]},'include':[{'model':db[_0x122489+_0x9855('0x5e')],'as':_0x9855('0x5e')},{'model':db[_0x122489+_0x1d6085],'as':_0x9855('0x59')}]});})[_0x9855('0x8')](function(_0x23c407){if(_['isNil'](_0x23c407)){throw new Error(_0x122489+'\x20Message\x20not\x20found');}_0x376d48=_0x23c407;return _0x23c407[_0x9855('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})[_0x9855('0x8')](function(){var _0x4cd290={'uniqueid':_0x257038+'.'+_0x376d48['id']+'.'+_0x376d48[_0x9855('0x5e')]['id'],'FromUserId':_0x31eab4[_0x9855('0x2c')]['id'],'type':_0x9855('0x60')};_0x4cd290[_0x122489+_0x9855('0x61')]=_0x376d48['id'];_0x4cd290[_0x122489+'InteractionId']=_0x376d48[_0x9855('0x5e')]['id'];_0x4cd290[_0x9855('0x62')+_0x122489+_0x1d6085+'Id']=_0x376d48[_0x9855('0x59')]['id'];_0x4cd290['To'+_0x122489+_0x9855('0x63')]=_0x13b2d4['id'];return db[_0x122489+_0x9855('0x64')]['create'](_0x4cd290);})['then'](function(){return respondWithRpcPromise(_0x9855('0x65'),{'channel':_0x257038,'interaction':_0x376d48[_0x9855('0x5e')],'message':_0x376d48,'account':_0x376d48[_0x9855('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':_0x9855('0x60'),'appdata':_0x13b2d4[_0x9855('0x11')]+','+(_0x376d48[_0x9855('0x59')][_0x9855('0x66')]||0x12c),'interval':_0x9855('0x67')}]},routingClient);})[_0x9855('0x8')](respondWithResult(_0x449c8f,null))[_0x9855('0xd')](handleError(_0x449c8f,null));};};exports[_0x9855('0x68')]=function(_0x6cb94b,_0x2119a9){var _0x24159d,_0x59b6d7;if(_[_0x9855('0x13')](_0x6cb94b[_0x9855('0x2a')][_0x9855('0x69')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x58651b=_0x6cb94b[_0x9855('0x2a')][_0x9855('0x69')];var _0x5aca96=_[_0x9855('0x56')](_0x58651b);var _0xd82dab=_0x58651b===_0x9855('0x57')?_0x9855('0x58'):'Account';return db[_0x9855('0x6a')][_0x9855('0x5c')]({'raw':!![],'where':{'id':_0x6cb94b[_0x9855('0x1a')]['id'],'role':_0x9855('0x37')}})[_0x9855('0x8')](function(_0x4bf5ee){if(_[_0x9855('0x13')](_0x4bf5ee)){throw new Error(_0x9855('0x6b'));}_0x24159d=_0x4bf5ee;return db[_0x5aca96+_0x9855('0x6c')][_0x9855('0x5c')]({'where':{'id':_0x6cb94b[_0x9855('0x2a')][_0x9855('0x5d')]},'include':[{'model':db[_0x5aca96+_0x9855('0x5e')],'as':_0x9855('0x5e')},{'model':db[_0x5aca96+_0xd82dab],'as':_0x9855('0x59')}]});})['then'](function(_0x54f734){if(_[_0x9855('0x13')](_0x54f734)){throw new Error(_0x5aca96+_0x9855('0x6d'));}_0x59b6d7=_0x54f734;return _0x54f734[_0x9855('0x5f')]({'read':0x0,'readAt':null,'UserId':null});})['then'](function(){var _0x426b85={'uniqueid':_0x58651b+'.'+_0x59b6d7['id']+'.'+_0x59b6d7[_0x9855('0x5e')]['id'],'FromUserId':_0x6cb94b[_0x9855('0x2c')]['id'],'type':_0x9855('0x60'),'ToUserId':_0x24159d['id']};_0x426b85[_0x5aca96+_0x9855('0x61')]=_0x59b6d7['id'];_0x426b85[_0x5aca96+'InteractionId']=_0x59b6d7[_0x9855('0x5e')]['id'];_0x426b85[_0x9855('0x62')+_0x5aca96+_0xd82dab+'Id']=_0x59b6d7[_0x9855('0x59')]['id'];return db[_0x5aca96+_0x9855('0x64')][_0x9855('0x6e')](_0x426b85);})['then'](function(){return respondWithRpcPromise(_0x9855('0x65'),{'channel':_0x58651b,'interaction':_0x59b6d7[_0x9855('0x5e')],'message':_0x59b6d7,'account':_0x59b6d7[_0x9855('0x59')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x24159d[_0x9855('0x11')]+','+(_0x59b6d7[_0x9855('0x59')][_0x9855('0x6f')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})['then'](respondWithResult(_0x2119a9,null))[_0x9855('0xd')](handleError(_0x2119a9,null));}; \ No newline at end of file +var _0xfb06=['outbound','outboundChannels','OutboundChannels','Agents','agentCapacity','body','interaction','user','hasOwnProperty','MemberReport','INTERACTION','updateAttributes','findOrCreate','format','SIP/%s','interface','YYYY-MM-DD\x20HH:mm:ss','internal','AgentCapacity','capacity','telephones','Telephones','trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','openchannelQueues','OpenchannelQueues','smsQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','FaxAccounts','chatQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','messageId','Interaction','\x20Message\x20not\x20found','update','queue','MessageId','InteractionId','From','QueueId','TransferReport','create','Start','queueTransferTimeout','agentNotify','channel','User','agent','agentTransferTimeout','bluebird','moment','lodash','util','../../config/logger','api','jayson/promise','client','http','request','then','error','code','message','catch','json','sendStatus','name','status','send','isNil','rows','find','VoiceChannels','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','voiceQueues','showVoiceQueues','VoiceQueues','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','VoiceQueuesChannelRedirect'];(function(_0x389c97,_0x32aaab){var _0x5b15bf=function(_0x70ec1){while(--_0x70ec1){_0x389c97['push'](_0x389c97['shift']());}};_0x5b15bf(++_0x32aaab);}(_0xfb06,0x19c));var _0x6fb0=function(_0x1e4f2f,_0x35edfa){_0x1e4f2f=_0x1e4f2f-0x0;var _0xccea89=_0xfb06[_0x1e4f2f];return _0xccea89;};'use strict';var BPromise=require(_0x6fb0('0x0'));var moment=require(_0x6fb0('0x1'));var _=require(_0x6fb0('0x2'));var util=require(_0x6fb0('0x3'));var db=require('../../mysqldb')['db'];var logger=require(_0x6fb0('0x4'))(_0x6fb0('0x5'));var jayson=require(_0x6fb0('0x6'));var amiClient=jayson[_0x6fb0('0x7')][_0x6fb0('0x8')]({'port':0x232a});var mailClient=jayson[_0x6fb0('0x7')][_0x6fb0('0x8')]({'port':0x232b});var routingClient=jayson['client'][_0x6fb0('0x8')]({'port':0x232c});function respondWithRpcPromise(_0x51e2bc,_0x4232ec,_0x326dfc){return new BPromise(function(_0x3c9259,_0x1512c3){var _0x278a95=_0x326dfc?_0x326dfc:amiClient;return _0x278a95[_0x6fb0('0x9')](_0x51e2bc,_0x4232ec)[_0x6fb0('0xa')](function(_0x519778){if(_0x519778[_0x6fb0('0xb')]){if(_0x519778[_0x6fb0('0xb')][_0x6fb0('0xc')]===0x1f4){return _0x1512c3(_0x519778[_0x6fb0('0xb')][_0x6fb0('0xd')]);}return _0x3c9259(_0x519778['error'][_0x6fb0('0xd')]);}else{_0x3c9259(_0x519778['result']);}})[_0x6fb0('0xe')](function(_0x40e758){_0x1512c3(_0x40e758);});});}function respondWithResult(_0x3d48e3,_0x2dbf6a){_0x2dbf6a=_0x2dbf6a||0xc8;return function(_0x3a48d6){if(_0x3a48d6){return _0x3d48e3['status'](_0x2dbf6a)[_0x6fb0('0xf')](_0x3a48d6);}return _0x3d48e3[_0x6fb0('0x10')](0x194);};}function handleError(_0x8fb034,_0x2835e5){_0x2835e5=_0x2835e5||0x1f4;return function(_0x9efe28){logger[_0x6fb0('0xb')](_0x9efe28['stack']);if(_0x9efe28[_0x6fb0('0x11')]){delete _0x9efe28[_0x6fb0('0x11')];}_0x8fb034[_0x6fb0('0x12')](_0x2835e5)[_0x6fb0('0x13')](_0x9efe28);};}function findById(_0x44e618){return function(_0x18a50b){if(!_[_0x6fb0('0x14')](_0x44e618)&&!_['isNil'](_0x18a50b)&&!_['isNil'](_0x18a50b[_0x6fb0('0x15')])){return _[_0x6fb0('0x16')](_0x18a50b[_0x6fb0('0x15')],function(_0xf2e7c6){return _0xf2e7c6['id']==_0x44e618;});}return null;};}exports['voiceChannels']=function(_0x2fec60,_0x2758ea){return respondWithRpcPromise(_0x6fb0('0x17'),_0x2fec60['query'])[_0x6fb0('0xa')](respondWithResult(_0x2758ea,null))['catch'](handleError(_0x2758ea,null));};exports[_0x6fb0('0x18')]=function(_0x3d5184,_0x206495){return respondWithRpcPromise(_0x6fb0('0x19'),_[_0x6fb0('0x1a')](_0x3d5184[_0x6fb0('0x1b')],_0x3d5184[_0x6fb0('0x1c')]))[_0x6fb0('0xa')](respondWithResult(_0x206495,null))['catch'](handleError(_0x206495,null));};exports[_0x6fb0('0x1d')]=function(_0x468919,_0x1ab185){return respondWithRpcPromise('VoiceChannelStopMixMonitor',_[_0x6fb0('0x1a')](_0x468919[_0x6fb0('0x1b')],_0x468919[_0x6fb0('0x1c')]))['then'](respondWithResult(_0x1ab185,null))[_0x6fb0('0xe')](handleError(_0x1ab185,null));};exports[_0x6fb0('0x1e')]=function(_0x31a4f4,_0x1dfe6c){return respondWithRpcPromise('VoiceQueues',_0x31a4f4[_0x6fb0('0x1b')])['then'](respondWithResult(_0x1dfe6c,null))[_0x6fb0('0xe')](handleError(_0x1dfe6c,null));};exports[_0x6fb0('0x1f')]=function(_0x296f41,_0x3f8e15){return respondWithRpcPromise(_0x6fb0('0x20'),_0x296f41['query'])[_0x6fb0('0xa')](findById(_0x296f41['params']['id']))[_0x6fb0('0xa')](respondWithResult(_0x3f8e15,null))['catch'](handleError(_0x3f8e15,null));};exports['voiceQueuesPreview']=function(_0x58b001,_0x123aa9){return respondWithRpcPromise('VoiceQueuesPreview',_[_0x6fb0('0x1a')](_0x58b001[_0x6fb0('0x1b')],_0x58b001[_0x6fb0('0x1c')]))[_0x6fb0('0xa')](respondWithResult(_0x123aa9,null))[_0x6fb0('0xe')](handleError(_0x123aa9,null));};exports[_0x6fb0('0x21')]=function(_0x42efe9,_0x424398){return respondWithRpcPromise(_0x6fb0('0x22'),_0x42efe9[_0x6fb0('0x1b')])[_0x6fb0('0xa')](respondWithResult(_0x424398,null))[_0x6fb0('0xe')](handleError(_0x424398,null));};exports[_0x6fb0('0x23')]=function(_0x2fd812,_0x4d1494){return respondWithRpcPromise('VoiceQueuesChannel',_[_0x6fb0('0x1a')](_0x2fd812[_0x6fb0('0x1b')],_0x2fd812['params']))[_0x6fb0('0xa')](respondWithResult(_0x4d1494,null))['catch'](handleError(_0x4d1494,null));};exports[_0x6fb0('0x24')]=function(_0x5e0d3e,_0x55ae7f){return respondWithRpcPromise(_0x6fb0('0x25'),_['merge'](_0x5e0d3e[_0x6fb0('0x1b')],_0x5e0d3e['params']))[_0x6fb0('0xa')](respondWithResult(_0x55ae7f,null))['catch'](handleError(_0x55ae7f,null));};exports[_0x6fb0('0x26')]=function(_0x53ea34,_0x31ca7a){return respondWithRpcPromise(_0x6fb0('0x27'),_['merge'](_0x53ea34[_0x6fb0('0x1b')],_0x53ea34['params']))[_0x6fb0('0xa')](respondWithResult(_0x31ca7a,null))[_0x6fb0('0xe')](handleError(_0x31ca7a,null));};exports[_0x6fb0('0x28')]=function(_0x365e4e,_0x5d11ea){return respondWithRpcPromise('Outbound',_0x365e4e[_0x6fb0('0x1b')])[_0x6fb0('0xa')](respondWithResult(_0x5d11ea,null))[_0x6fb0('0xe')](handleError(_0x5d11ea,null));};exports[_0x6fb0('0x29')]=function(_0x262c57,_0x1bbf32){return respondWithRpcPromise(_0x6fb0('0x2a'),_0x262c57[_0x6fb0('0x1b')])['then'](respondWithResult(_0x1bbf32,null))[_0x6fb0('0xe')](handleError(_0x1bbf32,null));};exports['agents']=function(_0x106a92,_0xfe79a2){var _0x4e773f;return respondWithRpcPromise('Agents',_0x106a92[_0x6fb0('0x1b')])[_0x6fb0('0xa')](function(_0x1782e4){_0x4e773f=_0x1782e4;return respondWithRpcPromise(_0x6fb0('0x2b'),_0x106a92[_0x6fb0('0x1b')],routingClient);})[_0x6fb0('0xa')](function(_0x1c1785){return _[_0x6fb0('0x1a')]({},_0x1c1785,_0x4e773f);})[_0x6fb0('0xa')](respondWithResult(_0xfe79a2,null))[_0x6fb0('0xe')](handleError(_0xfe79a2,null));};exports[_0x6fb0('0x2c')]=function(_0x25351f,_0x33b231){if(_0x25351f['body']&&_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')]&&_0x25351f['user']&&_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x11')]){for(var _0x577360 in _0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')]){if(_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')][_0x6fb0('0x30')](_0x577360)){db[_0x6fb0('0x31')]['findAll']({'where':{'channel':_0x577360,'membername':_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x11')],'type':_0x6fb0('0x32'),'exitAt':null,'uniqueid':_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')][_0x577360]&&_0x25351f[_0x6fb0('0x2d')]['interaction'][_0x577360]['length']?{'$notIn':_0x25351f[_0x6fb0('0x2d')]['interaction'][_0x577360]}:{'$ne':null}}})[_0x6fb0('0xa')](function(_0x55817e){var _0x177c94=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');for(var _0x267522=0x0,_0x4facc4=_0x55817e['length'];_0x267522<_0x4facc4;_0x267522+=0x1){_0x55817e[_0x267522][_0x6fb0('0x33')]({'exitAt':_0x177c94});}});for(var _0x1ccdeb=0x0;_0x1ccdeb<_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')][_0x577360]['length'];_0x1ccdeb+=0x1){db[_0x6fb0('0x31')][_0x6fb0('0x34')]({'where':{'channel':_0x577360,'membername':_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x11')],'type':_0x6fb0('0x32'),'uniqueid':_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')][_0x577360][_0x1ccdeb],'exitAt':null},'defaults':{'channel':_0x577360,'membername':_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x11')],'interface':_[_0x6fb0('0x14')](_0x25351f[_0x6fb0('0x2f')]['interface'])?util[_0x6fb0('0x35')](_0x6fb0('0x36'),_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x11')]):_0x25351f['user'][_0x6fb0('0x37')],'type':'INTERACTION','enterAt':moment()[_0x6fb0('0x35')](_0x6fb0('0x38')),'role':'agent','internal':_0x25351f[_0x6fb0('0x2f')][_0x6fb0('0x39')],'uniqueid':_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x2e')][_0x577360][_0x1ccdeb]}});}}}}return respondWithRpcPromise(_0x6fb0('0x3a'),{'id':_0x25351f[_0x6fb0('0x1c')]['id'],'capacity':_0x25351f[_0x6fb0('0x2d')][_0x6fb0('0x3b')]},routingClient)['then'](respondWithResult(_0x33b231,null))[_0x6fb0('0xe')](handleError(_0x33b231,null));};exports[_0x6fb0('0x3c')]=function(_0x187d91,_0x45b2a2){return respondWithRpcPromise(_0x6fb0('0x3d'),_0x187d91[_0x6fb0('0x1b')])['then'](respondWithResult(_0x45b2a2,null))[_0x6fb0('0xe')](handleError(_0x45b2a2,null));};exports[_0x6fb0('0x3e')]=function(_0x3433e6,_0x38c8a7){return respondWithRpcPromise('Trunks',_0x3433e6[_0x6fb0('0x1b')])[_0x6fb0('0xa')](respondWithResult(_0x38c8a7,null))[_0x6fb0('0xe')](handleError(_0x38c8a7,null));};exports[_0x6fb0('0x3f')]=function(_0x180eb7,_0x3e4708){return respondWithRpcPromise(_0x6fb0('0x40'),_0x180eb7[_0x6fb0('0x1b')])[_0x6fb0('0xa')](respondWithResult(_0x3e4708,null))[_0x6fb0('0xe')](handleError(_0x3e4708,null));};exports[_0x6fb0('0x41')]=function(_0x535ead,_0x50681c){return respondWithRpcPromise('ChatQueues',_0x535ead[_0x6fb0('0x1b')],routingClient)['then'](respondWithResult(_0x50681c,null))[_0x6fb0('0xe')](handleError(_0x50681c,null));};exports[_0x6fb0('0x42')]=function(_0x5bf29f,_0x558d6c){return respondWithRpcPromise(_0x6fb0('0x43'),_0x5bf29f[_0x6fb0('0x1b')],routingClient)['then'](findById(_0x5bf29f[_0x6fb0('0x1c')]['id']))[_0x6fb0('0xa')](respondWithResult(_0x558d6c,null))[_0x6fb0('0xe')](handleError(_0x558d6c,null));};exports[_0x6fb0('0x44')]=function(_0x4ff963,_0x3364c7){return respondWithRpcPromise(_0x6fb0('0x45'),_0x4ff963[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x3364c7,null))['catch'](handleError(_0x3364c7,null));};exports[_0x6fb0('0x46')]=function(_0x5e4861,_0x11bbf7){return respondWithRpcPromise('MailQueues',_0x5e4861[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](findById(_0x5e4861[_0x6fb0('0x1c')]['id']))['then'](respondWithResult(_0x11bbf7,null))[_0x6fb0('0xe')](handleError(_0x11bbf7,null));};exports[_0x6fb0('0x47')]=function(_0x59cee9,_0x23d99f){return respondWithRpcPromise(_0x6fb0('0x48'),_0x59cee9['query'],mailClient)[_0x6fb0('0xa')](respondWithResult(_0x23d99f,null))[_0x6fb0('0xe')](handleError(_0x23d99f,null));};exports[_0x6fb0('0x49')]=function(_0x5afb24,_0x4b9343){return respondWithRpcPromise(_0x6fb0('0x4a'),_0x5afb24[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x4b9343,null))['catch'](handleError(_0x4b9343,null));};exports['showOpenchannelQueues']=function(_0x3abf3e,_0x50e378){return respondWithRpcPromise('OpenchannelQueues',_0x3abf3e['query'],routingClient)[_0x6fb0('0xa')](findById(_0x3abf3e[_0x6fb0('0x1c')]['id']))[_0x6fb0('0xa')](respondWithResult(_0x50e378,null))[_0x6fb0('0xe')](handleError(_0x50e378,null));};exports[_0x6fb0('0x4b')]=function(_0x30ae31,_0x46c5d0){return respondWithRpcPromise(_0x6fb0('0x4c'),_0x30ae31[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x46c5d0,null))['catch'](handleError(_0x46c5d0,null));};exports[_0x6fb0('0x4d')]=function(_0x22960e,_0x303417){return respondWithRpcPromise(_0x6fb0('0x4c'),_0x22960e['query'],routingClient)[_0x6fb0('0xa')](findById(_0x22960e['params']['id']))['then'](respondWithResult(_0x303417,null))[_0x6fb0('0xe')](handleError(_0x303417,null));};exports[_0x6fb0('0x4e')]=function(_0x22e9b9,_0x3bac21){return respondWithRpcPromise(_0x6fb0('0x4f'),_0x22e9b9['query'],routingClient)['then'](respondWithResult(_0x3bac21,null))[_0x6fb0('0xe')](handleError(_0x3bac21,null));};exports['showFaxQueues']=function(_0x48790f,_0x24325f){return respondWithRpcPromise(_0x6fb0('0x4f'),_0x48790f[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](findById(_0x48790f[_0x6fb0('0x1c')]['id']))['then'](respondWithResult(_0x24325f,null))[_0x6fb0('0xe')](handleError(_0x24325f,null));};exports['faxAccounts']=function(_0x162d01,_0x43f0f4){return respondWithRpcPromise(_0x6fb0('0x50'),_0x162d01['query'])[_0x6fb0('0xa')](respondWithResult(_0x43f0f4,null))[_0x6fb0('0xe')](handleError(_0x43f0f4,null));};exports[_0x6fb0('0x51')]=function(_0x340c6e,_0x2bcf84){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x340c6e[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x2bcf84,null))['catch'](handleError(_0x2bcf84,null));};exports['mailQueuesWaitingInteractions']=function(_0x1bb7cd,_0x428f76){return respondWithRpcPromise('MailQueuesWaitingInteractions',_0x1bb7cd[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x428f76,null))[_0x6fb0('0xe')](handleError(_0x428f76,null));};exports[_0x6fb0('0x52')]=function(_0x4ca83f,_0x4ba5f5){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x4ca83f[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x4ba5f5,null))[_0x6fb0('0xe')](handleError(_0x4ba5f5,null));};exports[_0x6fb0('0x53')]=function(_0x30d235,_0xc8cec9){return respondWithRpcPromise(_0x6fb0('0x54'),_0x30d235[_0x6fb0('0x1b')],routingClient)['then'](respondWithResult(_0xc8cec9,null))[_0x6fb0('0xe')](handleError(_0xc8cec9,null));};exports[_0x6fb0('0x55')]=function(_0x10fb2e,_0x43ccd6){return respondWithRpcPromise(_0x6fb0('0x56'),_0x10fb2e[_0x6fb0('0x1b')],routingClient)[_0x6fb0('0xa')](respondWithResult(_0x43ccd6,null))[_0x6fb0('0xe')](handleError(_0x43ccd6,null));};exports[_0x6fb0('0x57')]=function(_0x5e478c){return function(_0x44ad02,_0x109cff){var _0x40cf4f,_0xdc9cc0;var _0x28a8f4=_[_0x6fb0('0x58')](_0x5e478c);var _0x281018=_0x5e478c==='chat'?_0x6fb0('0x59'):_0x6fb0('0x5a');return db[_0x28a8f4+_0x6fb0('0x5b')][_0x6fb0('0x5c')]({'raw':!![],'where':{'id':_0x44ad02[_0x6fb0('0x1c')]['id']}})['then'](function(_0x34f22f){if(_[_0x6fb0('0x14')](_0x34f22f)){throw new Error(_0x28a8f4+_0x6fb0('0x5d'));}_0x40cf4f=_0x34f22f;return db[_0x28a8f4+_0x6fb0('0x5e')][_0x6fb0('0x5c')]({'where':{'id':_0x44ad02[_0x6fb0('0x2d')][_0x6fb0('0x5f')]},'include':[{'model':db[_0x28a8f4+_0x6fb0('0x60')],'as':_0x6fb0('0x60')},{'model':db[_0x28a8f4+_0x281018],'as':_0x6fb0('0x5a')}]});})[_0x6fb0('0xa')](function(_0xb0f709){if(_[_0x6fb0('0x14')](_0xb0f709)){throw new Error(_0x28a8f4+_0x6fb0('0x61'));}_0xdc9cc0=_0xb0f709;return _0xb0f709[_0x6fb0('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6fb0('0xa')](function(){var _0x417ecc={'uniqueid':_0x5e478c+'.'+_0xdc9cc0['id']+'.'+_0xdc9cc0[_0x6fb0('0x60')]['id'],'FromUserId':_0x44ad02[_0x6fb0('0x2f')]['id'],'type':_0x6fb0('0x63')};_0x417ecc[_0x28a8f4+_0x6fb0('0x64')]=_0xdc9cc0['id'];_0x417ecc[_0x28a8f4+_0x6fb0('0x65')]=_0xdc9cc0['Interaction']['id'];_0x417ecc[_0x6fb0('0x66')+_0x28a8f4+_0x281018+'Id']=_0xdc9cc0[_0x6fb0('0x5a')]['id'];_0x417ecc['To'+_0x28a8f4+_0x6fb0('0x67')]=_0x40cf4f['id'];return db[_0x28a8f4+_0x6fb0('0x68')][_0x6fb0('0x69')](_0x417ecc);})[_0x6fb0('0xa')](function(){return respondWithRpcPromise(_0x6fb0('0x6a'),{'channel':_0x5e478c,'interaction':_0xdc9cc0['Interaction'],'message':_0xdc9cc0,'account':_0xdc9cc0['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6fb0('0x63'),'appdata':_0x40cf4f[_0x6fb0('0x11')]+','+(_0xdc9cc0[_0x6fb0('0x5a')][_0x6fb0('0x6b')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6fb0('0xa')](respondWithResult(_0x109cff,null))[_0x6fb0('0xe')](handleError(_0x109cff,null));};};exports[_0x6fb0('0x6c')]=function(_0x14d908,_0x5c8590){var _0x5aa36a,_0x27352e;if(_['isNil'](_0x14d908[_0x6fb0('0x2d')]['channel'])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x9129fd=_0x14d908[_0x6fb0('0x2d')][_0x6fb0('0x6d')];var _0x587f70=_[_0x6fb0('0x58')](_0x9129fd);var _0x3db38f=_0x9129fd==='chat'?_0x6fb0('0x59'):_0x6fb0('0x5a');return db[_0x6fb0('0x6e')][_0x6fb0('0x5c')]({'raw':!![],'where':{'id':_0x14d908[_0x6fb0('0x1c')]['id'],'role':'agent'}})['then'](function(_0x5626d4){if(_[_0x6fb0('0x14')](_0x5626d4)){throw new Error('Agent\x20not\x20found');}_0x5aa36a=_0x5626d4;return db[_0x587f70+_0x6fb0('0x5e')][_0x6fb0('0x5c')]({'where':{'id':_0x14d908[_0x6fb0('0x2d')][_0x6fb0('0x5f')]},'include':[{'model':db[_0x587f70+_0x6fb0('0x60')],'as':'Interaction'},{'model':db[_0x587f70+_0x3db38f],'as':'Account'}]});})['then'](function(_0x37f081){if(_['isNil'](_0x37f081)){throw new Error(_0x587f70+_0x6fb0('0x61'));}_0x27352e=_0x37f081;return _0x37f081[_0x6fb0('0x62')]({'read':0x0,'readAt':null,'UserId':null});})[_0x6fb0('0xa')](function(){var _0x43c5d0={'uniqueid':_0x9129fd+'.'+_0x27352e['id']+'.'+_0x27352e[_0x6fb0('0x60')]['id'],'FromUserId':_0x14d908['user']['id'],'type':_0x6fb0('0x63'),'ToUserId':_0x5aa36a['id']};_0x43c5d0[_0x587f70+_0x6fb0('0x64')]=_0x27352e['id'];_0x43c5d0[_0x587f70+_0x6fb0('0x65')]=_0x27352e[_0x6fb0('0x60')]['id'];_0x43c5d0[_0x6fb0('0x66')+_0x587f70+_0x3db38f+'Id']=_0x27352e[_0x6fb0('0x5a')]['id'];return db[_0x587f70+_0x6fb0('0x68')][_0x6fb0('0x69')](_0x43c5d0);})[_0x6fb0('0xa')](function(){return respondWithRpcPromise('Start',{'channel':_0x9129fd,'interaction':_0x27352e[_0x6fb0('0x60')],'message':_0x27352e,'account':_0x27352e['Account'],'applications':[{'id':0x0,'priority':0x1,'app':_0x6fb0('0x6f'),'appdata':_0x5aa36a['name']+','+(_0x27352e['Account'][_0x6fb0('0x70')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0x6fb0('0xa')](respondWithResult(_0x5c8590,null))['catch'](handleError(_0x5c8590,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index 1a35167..b106087 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 _0xb9fc=['show','/:id/run','run','post','put','/:id','delete','destroy','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./schedule.controller','get','isAuthenticated','index'];(function(_0x33d9c5,_0x2c159d){var _0x28f547=function(_0x61fc92){while(--_0x61fc92){_0x33d9c5['push'](_0x33d9c5['shift']());}};_0x28f547(++_0x2c159d);}(_0xb9fc,0x182));var _0xcb9f=function(_0x2db9c3,_0x3343dc){_0x2db9c3=_0x2db9c3-0x0;var _0x1bb4a3=_0xb9fc[_0x2db9c3];return _0x1bb4a3;};'use strict';var multer=require('multer');var util=require(_0xcb9f('0x0'));var path=require(_0xcb9f('0x1'));var timeout=require(_0xcb9f('0x2'));var express=require('express');var router=express[_0xcb9f('0x3')]();var auth=require(_0xcb9f('0x4'));var interaction=require(_0xcb9f('0x5'));var config=require('../../config/environment');var controller=require(_0xcb9f('0x6'));router[_0xcb9f('0x7')]('/',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x9')]);router[_0xcb9f('0x7')]('/:id',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0xa')]);router['get'](_0xcb9f('0xb'),auth[_0xcb9f('0x8')](),controller[_0xcb9f('0xc')]);router[_0xcb9f('0xd')]('/',auth[_0xcb9f('0x8')](),controller['create']);router[_0xcb9f('0xe')](_0xcb9f('0xf'),auth[_0xcb9f('0x8')](),controller['update']);router[_0xcb9f('0x10')]('/:id',auth[_0xcb9f('0x8')](),controller[_0xcb9f('0x11')]);module['exports']=router; \ No newline at end of file +var _0x4805=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./schedule.controller','get','isAuthenticated','index','/:id','show','/:id/run','post','update','delete'];(function(_0x385e20,_0x1b1605){var _0x535ffc=function(_0x46c170){while(--_0x46c170){_0x385e20['push'](_0x385e20['shift']());}};_0x535ffc(++_0x1b1605);}(_0x4805,0x90));var _0x5480=function(_0x41a23b,_0x4c0271){_0x41a23b=_0x41a23b-0x0;var _0x354e58=_0x4805[_0x41a23b];return _0x354e58;};'use strict';var multer=require('multer');var util=require(_0x5480('0x0'));var path=require(_0x5480('0x1'));var timeout=require(_0x5480('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x5480('0x3'));var interaction=require(_0x5480('0x4'));var config=require(_0x5480('0x5'));var controller=require(_0x5480('0x6'));router[_0x5480('0x7')]('/',auth[_0x5480('0x8')](),controller[_0x5480('0x9')]);router[_0x5480('0x7')](_0x5480('0xa'),auth['isAuthenticated'](),controller[_0x5480('0xb')]);router[_0x5480('0x7')](_0x5480('0xc'),auth['isAuthenticated'](),controller['run']);router[_0x5480('0xd')]('/',auth[_0x5480('0x8')](),controller['create']);router['put'](_0x5480('0xa'),auth[_0x5480('0x8')](),controller[_0x5480('0xe')]);router[_0x5480('0xf')]('/:id',auth[_0x5480('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 dbf9ffd..77de5c9 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 _0xa498=['BOOLEAN','TEXT','exports','STRING','0\x200\x20*\x20*\x20*','DATE','INTEGER','years','months','weeks','days','minutes','ENUM','csv','pdf','xlsx','custom','default'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xa498,0x1d6));var _0x8a49=function(_0x568f96,_0x32d489){_0x568f96=_0x568f96-0x0;var _0x5a053a=_0xa498[_0x568f96];return _0x5a053a;};'use strict';var Sequelize=require('sequelize');module[_0x8a49('0x0')]={'name':{'type':Sequelize[_0x8a49('0x1')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x8a49('0x1')],'allowNull':![],'defaultValue':_0x8a49('0x2')},'startAt':{'type':Sequelize[_0x8a49('0x3')],'allowNull':![]},'endAt':{'type':Sequelize[_0x8a49('0x3')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x8a49('0x4')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM'](_0x8a49('0x5'),'quarters',_0x8a49('0x6'),_0x8a49('0x7'),_0x8a49('0x8'),'hours',_0x8a49('0x9')),'allowNull':![],'defaultValue':_0x8a49('0x8')},'output':{'type':Sequelize[_0x8a49('0xa')](_0x8a49('0xb'),_0x8a49('0xc'),_0x8a49('0xd')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x8a49('0xa')](_0x8a49('0xe'),_0x8a49('0xf')),'allowNull':![],'defaultValue':_0x8a49('0xe')},'sendMail':{'type':Sequelize[_0x8a49('0x10')],'defaultValue':![]},'email':{'type':Sequelize[_0x8a49('0x1')]},'cc':{'type':Sequelize[_0x8a49('0x11')]},'bcc':{'type':Sequelize[_0x8a49('0x11')]},'sendIfEmpty':{'type':Sequelize[_0x8a49('0x10')],'defaultValue':!![]}}; \ No newline at end of file +var _0xa899=['exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','INTEGER','ENUM','years','quarters','months','weeks','days','hours','csv','xlsx','custom','default','TEXT','sequelize'];(function(_0x5f52c9,_0xa3ef91){var _0x5e7496=function(_0x42a84e){while(--_0x42a84e){_0x5f52c9['push'](_0x5f52c9['shift']());}};_0x5e7496(++_0xa3ef91);}(_0xa899,0x155));var _0x9a89=function(_0x441563,_0x1d4a28){_0x441563=_0x441563-0x0;var _0x2369ec=_0xa899[_0x441563];return _0x2369ec;};'use strict';var Sequelize=require(_0x9a89('0x0'));module[_0x9a89('0x1')]={'name':{'type':Sequelize[_0x9a89('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x9a89('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9a89('0x2')],'allowNull':![],'defaultValue':_0x9a89('0x4')},'startAt':{'type':Sequelize[_0x9a89('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0x9a89('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize[_0x9a89('0x6')],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0x9a89('0x7')](_0x9a89('0x8'),_0x9a89('0x9'),_0x9a89('0xa'),_0x9a89('0xb'),_0x9a89('0xc'),_0x9a89('0xd'),'minutes'),'allowNull':![],'defaultValue':'days'},'output':{'type':Sequelize[_0x9a89('0x7')](_0x9a89('0xe'),'pdf',_0x9a89('0xf')),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0x9a89('0x7')](_0x9a89('0x10'),_0x9a89('0x11')),'allowNull':![],'defaultValue':_0x9a89('0x10')},'sendMail':{'type':Sequelize[_0x9a89('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9a89('0x2')]},'cc':{'type':Sequelize[_0x9a89('0x12')]},'bcc':{'type':Sequelize['TEXT']},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 9307a90..0289cea 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 _0x4df6=['stack','name','send','index','map','Schedule','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','length','find','create','body','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','run','../../config/schedule','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','update','destroy','get','then','error'];(function(_0x3f207b,_0x4c2693){var _0x40582d=function(_0x5e4e62){while(--_0x5e4e62){_0x3f207b['push'](_0x3f207b['shift']());}};_0x40582d(++_0x4c2693);}(_0x4df6,0x1c7));var _0x64df=function(_0x181810,_0x3576b7){_0x181810=_0x181810-0x0;var _0x357e06=_0x4df6[_0x181810];return _0x357e06;};'use strict';var pdf=require(_0x64df('0x0'));var emlformat=require(_0x64df('0x1'));var rimraf=require(_0x64df('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x64df('0x3'));var moment=require(_0x64df('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x64df('0x5'));var util=require(_0x64df('0x6'));var path=require(_0x64df('0x7'));var sox=require(_0x64df('0x8'));var csv=require(_0x64df('0x9'));var ejs=require(_0x64df('0xa'));var fs=require('fs');var _=require(_0x64df('0xb'));var squel=require('squel');var crypto=require(_0x64df('0xc'));var jsforce=require(_0x64df('0xd'));var deskjs=require(_0x64df('0xe'));var toCsv=require(_0x64df('0x9'));var querystring=require('querystring');var Papa=require(_0x64df('0xf'));var Redis=require(_0x64df('0x10'));var authService=require(_0x64df('0x11'));var qs=require(_0x64df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x64df('0x13'));var utils=require(_0x64df('0x14'));var config=require(_0x64df('0x15'));var db=require(_0x64df('0x16'))['db'];function respondWithStatusCode(_0x19d568,_0x1e0481){_0x1e0481=_0x1e0481||0xcc;return function(_0x43ed96){if(_0x43ed96){return _0x19d568[_0x64df('0x17')](_0x1e0481);}return _0x19d568[_0x64df('0x18')](_0x1e0481)['end']();};}function respondWithResult(_0x181b97,_0x116e50){_0x116e50=_0x116e50||0xc8;return function(_0x52f554){if(_0x52f554){return _0x181b97['status'](_0x116e50)[_0x64df('0x19')](_0x52f554);}};}function respondWithFilteredResult(_0x46b4e5,_0x17797c){return function(_0x173dca){if(_0x173dca){var _0x3a100d=_0x173dca[_0x64df('0x1a')],_0x581828=_0x17797c['offset'],_0x3325f6=_0x17797c['offset']+_0x17797c[_0x64df('0x1b')],_0x41bdca;if(_0x3325f6>=_0x3a100d){_0x3325f6=_0x3a100d;_0x41bdca=0xc8;}else{_0x41bdca=0xce;}_0x46b4e5['status'](_0x41bdca);return _0x46b4e5[_0x64df('0x1c')](_0x64df('0x1d'),_0x581828+'-'+_0x3325f6+'/'+_0x3a100d)[_0x64df('0x19')](_0x173dca);}return null;};}function patchUpdates(_0x2d6da6){return function(_0x29dbf2){try{jsonpatch[_0x64df('0x1e')](_0x29dbf2,_0x2d6da6,!![]);}catch(_0x22502f){return BPromise[_0x64df('0x1f')](_0x22502f);}return _0x29dbf2['save']();};}function saveUpdates(_0x1962e9,_0x28fcc9){return function(_0x38bbef){if(_0x38bbef){return _0x38bbef[_0x64df('0x20')](_0x1962e9)['then'](function(_0x497f80){return _0x497f80;});}return null;};}function removeEntity(_0x432fdb,_0xe8a2d5){return function(_0x1eb8ea){if(_0x1eb8ea){return _0x1eb8ea[_0x64df('0x21')]()['then'](function(){var _0x3d09c6=_0x1eb8ea[_0x64df('0x22')]({'plain':!![]});var _0x20a8df='Scheduler';return db['UserProfileResource']['destroy']({'where':{'type':_0x20a8df,'resourceId':_0x3d09c6['id']}})['then'](function(){return _0x1eb8ea;});})[_0x64df('0x23')](function(){_0x432fdb[_0x64df('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x92b1a3,_0x3d1716){return function(_0x2eed49){if(!_0x2eed49){_0x92b1a3[_0x64df('0x17')](0x194);}return _0x2eed49;};}function handleError(_0x40e72a,_0x5e312a){_0x5e312a=_0x5e312a||0x1f4;return function(_0x2601ba){logger[_0x64df('0x24')](_0x2601ba[_0x64df('0x25')]);if(_0x2601ba[_0x64df('0x26')]){delete _0x2601ba[_0x64df('0x26')];}_0x40e72a[_0x64df('0x18')](_0x5e312a)[_0x64df('0x27')](_0x2601ba);};}exports[_0x64df('0x28')]=function(_0x486076,_0x391a50){var _0x708779={},_0x44d2c4={},_0x2e75a8={'count':0x0,'rows':[]};var _0x31df63=_[_0x64df('0x29')](db[_0x64df('0x2a')][_0x64df('0x2b')],function(_0x3649a7){return{'name':_0x3649a7[_0x64df('0x2c')],'type':_0x3649a7[_0x64df('0x2d')][_0x64df('0x2e')]};});_0x44d2c4[_0x64df('0x2f')]=_[_0x64df('0x29')](_0x31df63,_0x64df('0x26'));_0x44d2c4[_0x64df('0x30')]=_[_0x64df('0x31')](_0x486076[_0x64df('0x30')]);_0x44d2c4[_0x64df('0x32')]=_['intersection'](_0x44d2c4[_0x64df('0x2f')],_0x44d2c4['query']);_0x708779[_0x64df('0x33')]=_[_0x64df('0x34')](_0x44d2c4[_0x64df('0x2f')],qs[_0x64df('0x35')](_0x486076[_0x64df('0x30')][_0x64df('0x35')]));_0x708779[_0x64df('0x33')]=_0x708779['attributes']['length']?_0x708779['attributes']:_0x44d2c4['model'];if(!_0x486076[_0x64df('0x30')][_0x64df('0x36')](_0x64df('0x37'))){_0x708779[_0x64df('0x1b')]=qs[_0x64df('0x1b')](_0x486076[_0x64df('0x30')][_0x64df('0x1b')]);_0x708779['offset']=qs[_0x64df('0x38')](_0x486076[_0x64df('0x30')][_0x64df('0x38')]);}_0x708779[_0x64df('0x39')]=qs[_0x64df('0x3a')](_0x486076['query'][_0x64df('0x3a')]);_0x708779[_0x64df('0x3b')]=qs[_0x64df('0x32')](_['pick'](_0x486076[_0x64df('0x30')],_0x44d2c4[_0x64df('0x32')]));if(_0x486076['query']['filter']){_0x708779[_0x64df('0x3b')]=_[_0x64df('0x3c')](_0x708779[_0x64df('0x3b')],{'$or':_[_0x64df('0x29')](_0x31df63,function(_0x1d70de){if(_0x1d70de[_0x64df('0x2d')]!=='VIRTUAL'){var _0x3a7ffc={};_0x3a7ffc[_0x1d70de['name']]={'$like':'%'+_0x486076['query'][_0x64df('0x3d')]+'%'};return _0x3a7ffc;}})});}_0x708779=_[_0x64df('0x3c')]({},_0x708779,_0x486076[_0x64df('0x3e')]);var _0xb44b06={'where':_0x708779[_0x64df('0x3b')]};return db[_0x64df('0x2a')][_0x64df('0x1a')](_0xb44b06)[_0x64df('0x23')](function(_0x38179c){_0x2e75a8[_0x64df('0x1a')]=_0x38179c;if(_0x486076[_0x64df('0x30')][_0x64df('0x3f')]){_0x708779[_0x64df('0x40')]=[{'all':!![]}];}return db[_0x64df('0x2a')][_0x64df('0x41')](_0x708779);})['then'](function(_0x54f6f1){_0x2e75a8[_0x64df('0x42')]=_0x54f6f1;return _0x2e75a8;})[_0x64df('0x23')](respondWithFilteredResult(_0x391a50,_0x708779))[_0x64df('0x43')](handleError(_0x391a50,null));};exports[_0x64df('0x44')]=function(_0x5ba08a,_0xeb4a72){var _0x19ee06={'raw':![],'where':{'id':_0x5ba08a[_0x64df('0x45')]['id']}},_0x4b95a4={};_0x4b95a4[_0x64df('0x2f')]=_['keys'](db[_0x64df('0x2a')]['rawAttributes']);_0x4b95a4[_0x64df('0x30')]=_['keys'](_0x5ba08a[_0x64df('0x30')]);_0x4b95a4[_0x64df('0x32')]=_[_0x64df('0x34')](_0x4b95a4['model'],_0x4b95a4[_0x64df('0x30')]);_0x19ee06[_0x64df('0x33')]=_[_0x64df('0x34')](_0x4b95a4[_0x64df('0x2f')],qs[_0x64df('0x35')](_0x5ba08a[_0x64df('0x30')]['fields']));_0x19ee06['attributes']=_0x19ee06[_0x64df('0x33')][_0x64df('0x46')]?_0x19ee06[_0x64df('0x33')]:_0x4b95a4[_0x64df('0x2f')];if(_0x5ba08a[_0x64df('0x30')]['includeAll']){_0x19ee06[_0x64df('0x40')]=[{'all':!![]}];}_0x19ee06=_[_0x64df('0x3c')]({},_0x19ee06,_0x5ba08a[_0x64df('0x3e')]);return db[_0x64df('0x2a')][_0x64df('0x47')](_0x19ee06)[_0x64df('0x23')](handleEntityNotFound(_0xeb4a72,null))[_0x64df('0x23')](respondWithResult(_0xeb4a72,null))['catch'](handleError(_0xeb4a72,null));};exports['create']=function(_0x34f3ac,_0x3857a3){return db[_0x64df('0x2a')][_0x64df('0x48')](_0x34f3ac[_0x64df('0x49')],{})['then'](function(_0x46e755){var _0x1a64e8=_0x34f3ac[_0x64df('0x4a')][_0x64df('0x22')]({'plain':!![]});if(!_0x1a64e8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x1a64e8['role']==='user'){var _0x49b5a2=_0x46e755[_0x64df('0x22')]({'plain':!![]});var _0x463d34='Scheduler';return db[_0x64df('0x4b')][_0x64df('0x47')]({'where':{'name':_0x463d34,'userProfileId':_0x1a64e8[_0x64df('0x4c')]},'raw':!![]})[_0x64df('0x23')](function(_0x16183e){if(_0x16183e&&_0x16183e[_0x64df('0x4d')]===0x0){return db[_0x64df('0x4e')][_0x64df('0x48')]({'name':_0x49b5a2[_0x64df('0x26')],'resourceId':_0x49b5a2['id'],'type':_0x16183e['name'],'sectionId':_0x16183e['id']},{})['then'](function(){return _0x46e755;});}else{return _0x46e755;}})[_0x64df('0x43')](function(_0x4dfdfa){logger[_0x64df('0x24')](_0x64df('0x4f'),_0x4dfdfa);throw _0x4dfdfa;});}return _0x46e755;})[_0x64df('0x23')](respondWithResult(_0x3857a3,0xc9))['catch'](handleError(_0x3857a3,null));};exports[_0x64df('0x20')]=function(_0x5e326a,_0xee0b5a){if(_0x5e326a['body']['id']){delete _0x5e326a['body']['id'];}return db['Schedule'][_0x64df('0x47')]({'where':{'id':_0x5e326a['params']['id']}})[_0x64df('0x23')](handleEntityNotFound(_0xee0b5a,null))['then'](saveUpdates(_0x5e326a[_0x64df('0x49')],null))['then'](respondWithResult(_0xee0b5a,null))[_0x64df('0x43')](handleError(_0xee0b5a,null));};exports['destroy']=function(_0x2c9a27,_0x5d66f5){return db[_0x64df('0x2a')][_0x64df('0x47')]({'where':{'id':_0x2c9a27['params']['id']}})['then'](handleEntityNotFound(_0x5d66f5,null))['then'](removeEntity(_0x5d66f5,null))[_0x64df('0x43')](handleError(_0x5d66f5,null));};exports[_0x64df('0x50')]=function(_0x3c1fd8,_0x1580d8,_0x3fdadb){var _0x593036=require(_0x64df('0x51'));return db[_0x64df('0x2a')][_0x64df('0x47')]({'where':{'id':_0x3c1fd8['params']['id']},'raw':!![]})[_0x64df('0x23')](handleEntityNotFound(_0x1580d8,null))[_0x64df('0x23')](function(){_0x593036['run'](_0x3c1fd8['params']['id']);})[_0x64df('0x23')](respondWithStatusCode(_0x1580d8,null))[_0x64df('0x43')](handleError(_0x1580d8,null));}; \ No newline at end of file +var _0xceda=['Schedule','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','sort','where','pick','merge','options','includeAll','include','findAll','rows','catch','params','rawAttributes','filters','find','create','user','role','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','../../config/schedule','run','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','reject','then','destroy','get','Scheduler','stack','name','index','map'];(function(_0x2bb5e0,_0x46613c){var _0x13d311=function(_0x38d40c){while(--_0x38d40c){_0x2bb5e0['push'](_0x2bb5e0['shift']());}};_0x13d311(++_0x46613c);}(_0xceda,0x77));var _0xaced=function(_0x46d69f,_0x1e106f){_0x46d69f=_0x46d69f-0x0;var _0x1e6cd6=_0xceda[_0x46d69f];return _0x1e6cd6;};'use strict';var pdf=require(_0xaced('0x0'));var emlformat=require(_0xaced('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xaced('0x2'));var jsonpatch=require(_0xaced('0x3'));var rp=require(_0xaced('0x4'));var moment=require(_0xaced('0x5'));var BPromise=require(_0xaced('0x6'));var Mustache=require(_0xaced('0x7'));var util=require(_0xaced('0x8'));var path=require(_0xaced('0x9'));var sox=require(_0xaced('0xa'));var csv=require(_0xaced('0xb'));var ejs=require(_0xaced('0xc'));var fs=require('fs');var _=require(_0xaced('0xd'));var squel=require(_0xaced('0xe'));var crypto=require('crypto');var jsforce=require(_0xaced('0xf'));var deskjs=require('desk.js');var toCsv=require(_0xaced('0xb'));var querystring=require(_0xaced('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xaced('0x11'));var qs=require(_0xaced('0x12'));var as=require(_0xaced('0x13'));var hardwareService=require(_0xaced('0x14'));var logger=require(_0xaced('0x15'))(_0xaced('0x16'));var utils=require(_0xaced('0x17'));var config=require(_0xaced('0x18'));var db=require(_0xaced('0x19'))['db'];function respondWithStatusCode(_0x8e7543,_0x274a24){_0x274a24=_0x274a24||0xcc;return function(_0x25e840){if(_0x25e840){return _0x8e7543[_0xaced('0x1a')](_0x274a24);}return _0x8e7543['status'](_0x274a24)[_0xaced('0x1b')]();};}function respondWithResult(_0x56b20d,_0x456524){_0x456524=_0x456524||0xc8;return function(_0xd1ba8a){if(_0xd1ba8a){return _0x56b20d[_0xaced('0x1c')](_0x456524)['json'](_0xd1ba8a);}};}function respondWithFilteredResult(_0x6c26d7,_0x10b36e){return function(_0x33818f){if(_0x33818f){var _0x2a621e=_0x33818f[_0xaced('0x1d')],_0x23cd2d=_0x10b36e[_0xaced('0x1e')],_0x31c0fa=_0x10b36e['offset']+_0x10b36e['limit'],_0x425b53;if(_0x31c0fa>=_0x2a621e){_0x31c0fa=_0x2a621e;_0x425b53=0xc8;}else{_0x425b53=0xce;}_0x6c26d7[_0xaced('0x1c')](_0x425b53);return _0x6c26d7[_0xaced('0x1f')](_0xaced('0x20'),_0x23cd2d+'-'+_0x31c0fa+'/'+_0x2a621e)[_0xaced('0x21')](_0x33818f);}return null;};}function patchUpdates(_0x30ef6a){return function(_0x4d4d10){try{jsonpatch['apply'](_0x4d4d10,_0x30ef6a,!![]);}catch(_0x562819){return BPromise[_0xaced('0x22')](_0x562819);}return _0x4d4d10['save']();};}function saveUpdates(_0x121ad5,_0x1f11f5){return function(_0x3931f2){if(_0x3931f2){return _0x3931f2['update'](_0x121ad5)[_0xaced('0x23')](function(_0x52e6d9){return _0x52e6d9;});}return null;};}function removeEntity(_0x2e86c8,_0x19544f){return function(_0x4ec8c5){if(_0x4ec8c5){return _0x4ec8c5[_0xaced('0x24')]()[_0xaced('0x23')](function(){var _0x819e7=_0x4ec8c5[_0xaced('0x25')]({'plain':!![]});var _0x4fdc01=_0xaced('0x26');return db['UserProfileResource'][_0xaced('0x24')]({'where':{'type':_0x4fdc01,'resourceId':_0x819e7['id']}})[_0xaced('0x23')](function(){return _0x4ec8c5;});})['then'](function(){_0x2e86c8[_0xaced('0x1c')](0xcc)[_0xaced('0x1b')]();});}};}function handleEntityNotFound(_0x16c32,_0x35ee29){return function(_0x22dcee){if(!_0x22dcee){_0x16c32[_0xaced('0x1a')](0x194);}return _0x22dcee;};}function handleError(_0x2dc570,_0x165316){_0x165316=_0x165316||0x1f4;return function(_0x1a43d0){logger['error'](_0x1a43d0[_0xaced('0x27')]);if(_0x1a43d0[_0xaced('0x28')]){delete _0x1a43d0[_0xaced('0x28')];}_0x2dc570[_0xaced('0x1c')](_0x165316)['send'](_0x1a43d0);};}exports[_0xaced('0x29')]=function(_0x1bc427,_0x323fdf){var _0x306d1e={},_0x509b36={},_0x17f666={'count':0x0,'rows':[]};var _0x54da20=_[_0xaced('0x2a')](db[_0xaced('0x2b')]['rawAttributes'],function(_0x551ca1){return{'name':_0x551ca1['fieldName'],'type':_0x551ca1[_0xaced('0x2c')][_0xaced('0x2d')]};});_0x509b36[_0xaced('0x2e')]=_[_0xaced('0x2a')](_0x54da20,'name');_0x509b36[_0xaced('0x2f')]=_[_0xaced('0x30')](_0x1bc427[_0xaced('0x2f')]);_0x509b36['filters']=_[_0xaced('0x31')](_0x509b36[_0xaced('0x2e')],_0x509b36[_0xaced('0x2f')]);_0x306d1e['attributes']=_['intersection'](_0x509b36[_0xaced('0x2e')],qs[_0xaced('0x32')](_0x1bc427['query']['fields']));_0x306d1e[_0xaced('0x33')]=_0x306d1e['attributes'][_0xaced('0x34')]?_0x306d1e[_0xaced('0x33')]:_0x509b36[_0xaced('0x2e')];if(!_0x1bc427[_0xaced('0x2f')][_0xaced('0x35')](_0xaced('0x36'))){_0x306d1e[_0xaced('0x37')]=qs['limit'](_0x1bc427[_0xaced('0x2f')]['limit']);_0x306d1e['offset']=qs[_0xaced('0x1e')](_0x1bc427[_0xaced('0x2f')][_0xaced('0x1e')]);}_0x306d1e['order']=qs['sort'](_0x1bc427[_0xaced('0x2f')][_0xaced('0x38')]);_0x306d1e[_0xaced('0x39')]=qs['filters'](_[_0xaced('0x3a')](_0x1bc427[_0xaced('0x2f')],_0x509b36['filters']));if(_0x1bc427['query']['filter']){_0x306d1e['where']=_[_0xaced('0x3b')](_0x306d1e[_0xaced('0x39')],{'$or':_[_0xaced('0x2a')](_0x54da20,function(_0x24e50b){if(_0x24e50b[_0xaced('0x2c')]!=='VIRTUAL'){var _0x19a639={};_0x19a639[_0x24e50b[_0xaced('0x28')]]={'$like':'%'+_0x1bc427[_0xaced('0x2f')]['filter']+'%'};return _0x19a639;}})});}_0x306d1e=_['merge']({},_0x306d1e,_0x1bc427[_0xaced('0x3c')]);var _0x2af25c={'where':_0x306d1e[_0xaced('0x39')]};return db['Schedule'][_0xaced('0x1d')](_0x2af25c)['then'](function(_0x32f71a){_0x17f666[_0xaced('0x1d')]=_0x32f71a;if(_0x1bc427['query'][_0xaced('0x3d')]){_0x306d1e[_0xaced('0x3e')]=[{'all':!![]}];}return db['Schedule'][_0xaced('0x3f')](_0x306d1e);})[_0xaced('0x23')](function(_0x29f1ad){_0x17f666[_0xaced('0x40')]=_0x29f1ad;return _0x17f666;})[_0xaced('0x23')](respondWithFilteredResult(_0x323fdf,_0x306d1e))[_0xaced('0x41')](handleError(_0x323fdf,null));};exports['show']=function(_0x2a6aa2,_0x52b1a6){var _0x4df951={'raw':![],'where':{'id':_0x2a6aa2[_0xaced('0x42')]['id']}},_0x52cf55={};_0x52cf55[_0xaced('0x2e')]=_['keys'](db[_0xaced('0x2b')][_0xaced('0x43')]);_0x52cf55[_0xaced('0x2f')]=_['keys'](_0x2a6aa2[_0xaced('0x2f')]);_0x52cf55[_0xaced('0x44')]=_['intersection'](_0x52cf55[_0xaced('0x2e')],_0x52cf55[_0xaced('0x2f')]);_0x4df951[_0xaced('0x33')]=_[_0xaced('0x31')](_0x52cf55[_0xaced('0x2e')],qs[_0xaced('0x32')](_0x2a6aa2['query'][_0xaced('0x32')]));_0x4df951['attributes']=_0x4df951[_0xaced('0x33')][_0xaced('0x34')]?_0x4df951['attributes']:_0x52cf55[_0xaced('0x2e')];if(_0x2a6aa2[_0xaced('0x2f')][_0xaced('0x3d')]){_0x4df951[_0xaced('0x3e')]=[{'all':!![]}];}_0x4df951=_['merge']({},_0x4df951,_0x2a6aa2['options']);return db['Schedule'][_0xaced('0x45')](_0x4df951)[_0xaced('0x23')](handleEntityNotFound(_0x52b1a6,null))[_0xaced('0x23')](respondWithResult(_0x52b1a6,null))[_0xaced('0x41')](handleError(_0x52b1a6,null));};exports[_0xaced('0x46')]=function(_0xf0a2a2,_0x112ee4){return db[_0xaced('0x2b')]['create'](_0xf0a2a2['body'],{})[_0xaced('0x23')](function(_0x5a22db){var _0x23ff9b=_0xf0a2a2[_0xaced('0x47')]['get']({'plain':!![]});if(!_0x23ff9b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23ff9b[_0xaced('0x48')]==='user'){var _0x4a260f=_0x5a22db['get']({'plain':!![]});var _0x94bcf3=_0xaced('0x26');return db['UserProfileSection'][_0xaced('0x45')]({'where':{'name':_0x94bcf3,'userProfileId':_0x23ff9b[_0xaced('0x49')]},'raw':!![]})['then'](function(_0x2b4c23){if(_0x2b4c23&&_0x2b4c23[_0xaced('0x4a')]===0x0){return db[_0xaced('0x4b')][_0xaced('0x46')]({'name':_0x4a260f[_0xaced('0x28')],'resourceId':_0x4a260f['id'],'type':_0x2b4c23[_0xaced('0x28')],'sectionId':_0x2b4c23['id']},{})[_0xaced('0x23')](function(){return _0x5a22db;});}else{return _0x5a22db;}})[_0xaced('0x41')](function(_0x12567f){logger['error'](_0xaced('0x4c'),_0x12567f);throw _0x12567f;});}return _0x5a22db;})['then'](respondWithResult(_0x112ee4,0xc9))[_0xaced('0x41')](handleError(_0x112ee4,null));};exports[_0xaced('0x4d')]=function(_0x40b1ef,_0x533196){if(_0x40b1ef[_0xaced('0x4e')]['id']){delete _0x40b1ef[_0xaced('0x4e')]['id'];}return db[_0xaced('0x2b')][_0xaced('0x45')]({'where':{'id':_0x40b1ef['params']['id']}})['then'](handleEntityNotFound(_0x533196,null))[_0xaced('0x23')](saveUpdates(_0x40b1ef[_0xaced('0x4e')],null))[_0xaced('0x23')](respondWithResult(_0x533196,null))['catch'](handleError(_0x533196,null));};exports[_0xaced('0x24')]=function(_0x295e12,_0x511983){return db['Schedule'][_0xaced('0x45')]({'where':{'id':_0x295e12[_0xaced('0x42')]['id']}})['then'](handleEntityNotFound(_0x511983,null))[_0xaced('0x23')](removeEntity(_0x511983,null))['catch'](handleError(_0x511983,null));};exports['run']=function(_0x3fc754,_0x511f20,_0x27e7b8){var _0x2319a4=require(_0xaced('0x4f'));return db[_0xaced('0x2b')][_0xaced('0x45')]({'where':{'id':_0x3fc754[_0xaced('0x42')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x511f20,null))['then'](function(){_0x2319a4[_0xaced('0x50')](_0x3fc754['params']['id']);})[_0xaced('0x23')](respondWithStatusCode(_0x511f20,null))['catch'](handleError(_0x511f20,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index 451d829..a6a4493 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 _0xc1ef=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','exports','define','tools_schedules','lodash'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xc1ef,0xb3));var _0xfc1e=function(_0xd6404,_0x3e2aeb){_0xd6404=_0xd6404-0x0;var _0x4eb143=_0xc1ef[_0xd6404];return _0x4eb143;};'use strict';var _=require(_0xfc1e('0x0'));var util=require(_0xfc1e('0x1'));var logger=require(_0xfc1e('0x2'))(_0xfc1e('0x3'));var moment=require(_0xfc1e('0x4'));var BPromise=require(_0xfc1e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfc1e('0x6'));var rimraf=require(_0xfc1e('0x7'));var config=require(_0xfc1e('0x8'));var attributes=require('./schedule.attributes');module[_0xfc1e('0x9')]=function(_0x2cd6c4,_0x3ccd60){return _0x2cd6c4[_0xfc1e('0xa')]('Schedule',attributes,{'tableName':_0xfc1e('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x565a=['define','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes'];(function(_0x33b735,_0x4e7569){var _0xf2accc=function(_0x4b4280){while(--_0x4b4280){_0x33b735['push'](_0x33b735['shift']());}};_0xf2accc(++_0x4e7569);}(_0x565a,0x121));var _0xa565=function(_0x280a6f,_0x28b15c){_0x280a6f=_0x280a6f-0x0;var _0x1b8e86=_0x565a[_0x280a6f];return _0x1b8e86;};'use strict';var _=require(_0xa565('0x0'));var util=require(_0xa565('0x1'));var logger=require(_0xa565('0x2'))(_0xa565('0x3'));var moment=require(_0xa565('0x4'));var BPromise=require(_0xa565('0x5'));var rp=require(_0xa565('0x6'));var fs=require('fs');var path=require(_0xa565('0x7'));var rimraf=require(_0xa565('0x8'));var config=require(_0xa565('0x9'));var attributes=require(_0xa565('0xa'));module['exports']=function(_0x181461,_0x5a1447){return _0x181461[_0xa565('0xb')]('Schedule',attributes,{'tableName':'tools_schedules','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/schedule/schedule.rpc.js b/server/api/schedule/schedule.rpc.js index 1b4ad9f..dd58445 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 _0xb9ad=['Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','client','http','request','then','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xb9ad,0x112));var _0xdb9a=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xb9ad[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0xdb9a('0x0'));var util=require(_0xdb9a('0x1'));var moment=require(_0xdb9a('0x2'));var BPromise=require(_0xdb9a('0x3'));var rs=require(_0xdb9a('0x4'));var fs=require('fs');var Redis=require(_0xdb9a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xdb9a('0x6'));var logger=require('../../config/logger')(_0xdb9a('0x7'));var config=require(_0xdb9a('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xdb9a('0x9')][_0xdb9a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x21163c,_0x3b0049,_0x446d1d){return new BPromise(function(_0x20c73d,_0x27c599){return client[_0xdb9a('0xb')](_0x21163c,_0x446d1d)[_0xdb9a('0xc')](function(_0x14bfd8){logger[_0xdb9a('0xd')](_0xdb9a('0xe'),_0x3b0049,_0xdb9a('0xf'));logger[_0xdb9a('0x10')](_0xdb9a('0x11'),_0x3b0049,'request\x20sent',JSON[_0xdb9a('0x12')](_0x14bfd8));if(_0x14bfd8[_0xdb9a('0x13')]){if(_0x14bfd8['error'][_0xdb9a('0x14')]===0x1f4){logger[_0xdb9a('0x13')](_0xdb9a('0xe'),_0x3b0049,_0x14bfd8[_0xdb9a('0x13')]['message']);return _0x27c599(_0x14bfd8[_0xdb9a('0x13')][_0xdb9a('0x15')]);}logger[_0xdb9a('0x13')](_0xdb9a('0xe'),_0x3b0049,_0x14bfd8['error']['message']);return _0x20c73d(_0x14bfd8[_0xdb9a('0x13')][_0xdb9a('0x15')]);}else{logger[_0xdb9a('0xd')]('Schedule,\x20%s,\x20%s',_0x3b0049,_0xdb9a('0xf'));_0x20c73d(_0x14bfd8[_0xdb9a('0x16')]['message']);}})[_0xdb9a('0x17')](function(_0x12b605){logger[_0xdb9a('0x13')]('Schedule,\x20%s,\x20%s',_0x3b0049,_0x12b605);_0x27c599(_0x12b605);});});} \ No newline at end of file +var _0xbd8e=['result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','Schedule,\x20%s,\x20%s','message'];(function(_0x4fe1b2,_0x49ed2c){var _0x2a5772=function(_0x15f186){while(--_0x15f186){_0x4fe1b2['push'](_0x4fe1b2['shift']());}};_0x2a5772(++_0x49ed2c);}(_0xbd8e,0xff));var _0xebd8=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0xbd8e[_0x21a9d9];return _0x46adce;};'use strict';var _=require(_0xebd8('0x0'));var util=require('util');var moment=require(_0xebd8('0x1'));var BPromise=require('bluebird');var rs=require(_0xebd8('0x2'));var fs=require('fs');var Redis=require(_0xebd8('0x3'));var db=require(_0xebd8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xebd8('0x5'))(_0xebd8('0x6'));var config=require(_0xebd8('0x7'));var jayson=require(_0xebd8('0x8'));var client=jayson[_0xebd8('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x55952d,_0x2fbabd,_0x323bf0){return new BPromise(function(_0x28e6d7,_0x283e9f){return client[_0xebd8('0xa')](_0x55952d,_0x323bf0)[_0xebd8('0xb')](function(_0xfb7943){logger[_0xebd8('0xc')]('Schedule,\x20%s,\x20%s',_0x2fbabd,_0xebd8('0xd'));logger[_0xebd8('0xe')](_0xebd8('0xf'),_0x2fbabd,_0xebd8('0xd'),JSON[_0xebd8('0x10')](_0xfb7943));if(_0xfb7943['error']){if(_0xfb7943[_0xebd8('0x11')][_0xebd8('0x12')]===0x1f4){logger['error'](_0xebd8('0x13'),_0x2fbabd,_0xfb7943[_0xebd8('0x11')][_0xebd8('0x14')]);return _0x283e9f(_0xfb7943[_0xebd8('0x11')]['message']);}logger[_0xebd8('0x11')](_0xebd8('0x13'),_0x2fbabd,_0xfb7943['error'][_0xebd8('0x14')]);return _0x28e6d7(_0xfb7943[_0xebd8('0x11')][_0xebd8('0x14')]);}else{logger['info']('Schedule,\x20%s,\x20%s',_0x2fbabd,_0xebd8('0xd'));_0x28e6d7(_0xfb7943[_0xebd8('0x15')][_0xebd8('0x14')]);}})[_0xebd8('0x16')](function(_0x5bc08b){logger[_0xebd8('0x11')](_0xebd8('0x13'),_0x2fbabd,_0x5bc08b);_0x283e9f(_0x5bc08b);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 065d54e..e9d26c5 100644 --- a/server/api/screenRecording/index.js +++ b/server/api/screenRecording/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8105=['/:id','show','/:id/download','download','post','create','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get'];(function(_0x32b6c4,_0x282cd3){var _0x2754ca=function(_0x25c319){while(--_0x25c319){_0x32b6c4['push'](_0x32b6c4['shift']());}};_0x2754ca(++_0x282cd3);}(_0x8105,0xdd));var _0x5810=function(_0x5a7eaf,_0x4711e7){_0x5a7eaf=_0x5a7eaf-0x0;var _0x52519d=_0x8105[_0x5a7eaf];return _0x52519d;};'use strict';var multer=require(_0x5810('0x0'));var util=require(_0x5810('0x1'));var path=require(_0x5810('0x2'));var timeout=require('connect-timeout');var express=require(_0x5810('0x3'));var router=express[_0x5810('0x4')]();var auth=require(_0x5810('0x5'));var interaction=require(_0x5810('0x6'));var config=require(_0x5810('0x7'));var controller=require('./screenRecording.controller');router['get']('/',auth[_0x5810('0x8')](),controller['index']);router[_0x5810('0x9')]('/describe',auth[_0x5810('0x8')](),controller['describe']);router['get'](_0x5810('0xa'),auth[_0x5810('0x8')](),controller[_0x5810('0xb')]);router[_0x5810('0x9')](_0x5810('0xc'),auth[_0x5810('0x8')](),controller[_0x5810('0xd')]);router[_0x5810('0xe')]('/',auth[_0x5810('0x8')](),controller[_0x5810('0xf')]);router[_0x5810('0x10')](_0x5810('0xa'),auth[_0x5810('0x8')](),controller[_0x5810('0x11')]);router[_0x5810('0x12')](_0x5810('0xa'),auth[_0x5810('0x8')](),controller[_0x5810('0x13')]);module[_0x5810('0x14')]=router; \ No newline at end of file +var _0x78c6=['delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','index','get','/describe','isAuthenticated','/:id','/:id/download','post','update'];(function(_0x3636bf,_0x50f600){var _0x3c8a02=function(_0x3ff0d6){while(--_0x3ff0d6){_0x3636bf['push'](_0x3636bf['shift']());}};_0x3c8a02(++_0x50f600);}(_0x78c6,0x17f));var _0x678c=function(_0x1ea7c9,_0x149960){_0x1ea7c9=_0x1ea7c9-0x0;var _0x2da03f=_0x78c6[_0x1ea7c9];return _0x2da03f;};'use strict';var multer=require('multer');var util=require(_0x678c('0x0'));var path=require(_0x678c('0x1'));var timeout=require(_0x678c('0x2'));var express=require(_0x678c('0x3'));var router=express[_0x678c('0x4')]();var auth=require(_0x678c('0x5'));var interaction=require(_0x678c('0x6'));var config=require(_0x678c('0x7'));var controller=require(_0x678c('0x8'));router['get']('/',auth['isAuthenticated'](),controller[_0x678c('0x9')]);router[_0x678c('0xa')](_0x678c('0xb'),auth[_0x678c('0xc')](),controller['describe']);router['get'](_0x678c('0xd'),auth[_0x678c('0xc')](),controller['show']);router[_0x678c('0xa')](_0x678c('0xe'),auth[_0x678c('0xc')](),controller['download']);router[_0x678c('0xf')]('/',auth[_0x678c('0xc')](),controller['create']);router['put'](_0x678c('0xd'),auth[_0x678c('0xc')](),controller[_0x678c('0x10')]);router[_0x678c('0x11')](_0x678c('0xd'),auth[_0x678c('0xc')](),controller[_0x678c('0x12')]);module[_0x678c('0x13')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 2a59013..54e358f 100644 --- a/server/api/screenRecording/screenRecording.attributes.js +++ b/server/api/screenRecording/screenRecording.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa41a=['toString','updatedAt','sequelize','moment','../../config/environment','exports','VIRTUAL','getDataValue','value','extname','STRING','replace','setDataValue','INTEGER','startedAt','subtract','closedAt','DATE','MM-DD-YYYY\x20HH:mm','format','createdAt'];(function(_0x2e64ba,_0x4a0258){var _0x5d2ef4=function(_0x3b49b6){while(--_0x3b49b6){_0x2e64ba['push'](_0x2e64ba['shift']());}};_0x5d2ef4(++_0x4a0258);}(_0xa41a,0x6b));var _0xaa41=function(_0x31225d,_0x46e67e){_0x31225d=_0x31225d-0x0;var _0x77ed75=_0xa41a[_0x31225d];return _0x77ed75;};'use strict';var Sequelize=require(_0xaa41('0x0'));var moment=require(_0xaa41('0x1'));var path=require('path');var config=require(_0xaa41('0x2'));module[_0xaa41('0x3')]={'format':{'type':Sequelize[_0xaa41('0x4')],'get':function(){return this[_0xaa41('0x5')](_0xaa41('0x6'))?path[_0xaa41('0x7')](this[_0xaa41('0x5')](_0xaa41('0x6'))):undefined;}},'interactionid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xaa41('0x8')]},'value':{'type':Sequelize[_0xaa41('0x8')],'set':function(_0x54bc5a){var _0x5b1fff=_0x54bc5a[_0xaa41('0x9')](/\\/g,'/');this[_0xaa41('0xa')]('value',_0x5b1fff);}},'rating':{'type':Sequelize[_0xaa41('0xb')],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xaa41('0xb')],'set':function(_0x409dab){this[_0xaa41('0xa')](_0xaa41('0xc'),moment()[_0xaa41('0xd')](_0x409dab,'ms'));this[_0xaa41('0xa')](_0xaa41('0xe'),moment());this[_0xaa41('0xa')]('duration',_0x409dab);}},'startedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')]('startedAt'))['format'](_0xaa41('0x10'))['toString']();}},'closedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0xe')))[_0xaa41('0x11')](_0xaa41('0x10'))['toString']();}},'createdAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this[_0xaa41('0x5')](_0xaa41('0x12')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}},'updatedAt':{'type':Sequelize[_0xaa41('0xf')],'get':function(){return moment(this['getDataValue'](_0xaa41('0x14')))[_0xaa41('0x11')](_0xaa41('0x10'))[_0xaa41('0x13')]();}}}; \ No newline at end of file +var _0x9f62=['exports','VIRTUAL','extname','getDataValue','value','STRING','replace','setDataValue','startedAt','closedAt','DATE','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','moment','../../config/environment'];(function(_0x2cfbe6,_0x299048){var _0x107ddc=function(_0x40f7ee){while(--_0x40f7ee){_0x2cfbe6['push'](_0x2cfbe6['shift']());}};_0x107ddc(++_0x299048);}(_0x9f62,0x154));var _0x29f6=function(_0x5e31b2,_0x34d375){_0x5e31b2=_0x5e31b2-0x0;var _0x4715e3=_0x9f62[_0x5e31b2];return _0x4715e3;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x29f6('0x0'));var path=require('path');var config=require(_0x29f6('0x1'));module[_0x29f6('0x2')]={'format':{'type':Sequelize[_0x29f6('0x3')],'get':function(){return this['getDataValue']('value')?path[_0x29f6('0x4')](this[_0x29f6('0x5')](_0x29f6('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0x29f6('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize[_0x29f6('0x7')],'set':function(_0x272876){var _0x9a43fe=_0x272876[_0x29f6('0x8')](/\\/g,'/');this[_0x29f6('0x9')]('value',_0x9a43fe);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x549f64){this[_0x29f6('0x9')](_0x29f6('0xa'),moment()['subtract'](_0x549f64,'ms'));this['setDataValue'](_0x29f6('0xb'),moment());this[_0x29f6('0x9')]('duration',_0x549f64);}},'startedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')]('startedAt'))['format']('MM-DD-YYYY\x20HH:mm')['toString']();}},'closedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0xb')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'createdAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x10')))[_0x29f6('0xd')](_0x29f6('0xe'))[_0x29f6('0xf')]();}},'updatedAt':{'type':Sequelize[_0x29f6('0xc')],'get':function(){return moment(this[_0x29f6('0x5')](_0x29f6('0x11')))[_0x29f6('0xd')](_0x29f6('0xe'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index e4a5536..f64c80f 100644 --- a/server/api/screenRecording/screenRecording.controller.js +++ b/server/api/screenRecording/screenRecording.controller.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7ae4=['fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','ioredis','../../components/parsers/qs','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','save','update','destroy','then','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','model','differenceBy','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','where','filters','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','duration','createdAt','closedAt','value','describe','download','../../components/encryptor','type','uniqueid','join','root','server/files/screen_recordings','%s.cypher','decryptFile','secrets','existsSync','Sequelize','ValidationError','extname','unlink','message','ScreenRecording\x20not\x20found','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','html-pdf','eml-format','zip-dir'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0x7ae4,0x11d));var _0x47ae=function(_0x182f47,_0x267ceb){_0x182f47=_0x182f47-0x0;var _0x2b681a=_0x7ae4[_0x182f47];return _0x2b681a;};'use strict';var pdf=require(_0x47ae('0x0'));var emlformat=require(_0x47ae('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x47ae('0x2'));var jsonpatch=require(_0x47ae('0x3'));var rp=require(_0x47ae('0x4'));var moment=require(_0x47ae('0x5'));var BPromise=require(_0x47ae('0x6'));var Mustache=require(_0x47ae('0x7'));var util=require('util');var path=require(_0x47ae('0x8'));var sox=require(_0x47ae('0x9'));var csv=require(_0x47ae('0xa'));var ejs=require(_0x47ae('0xb'));var fs=require('fs');var _=require(_0x47ae('0xc'));var squel=require(_0x47ae('0xd'));var crypto=require('crypto');var jsforce=require(_0x47ae('0xe'));var deskjs=require(_0x47ae('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x47ae('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x47ae('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x47ae('0x12'));var config=require('../../config/environment');var db=require(_0x47ae('0x13'))['db'];function respondWithStatusCode(_0xa38c97,_0x206ab1){_0x206ab1=_0x206ab1||0xcc;return function(_0x41e159){if(_0x41e159){return _0xa38c97[_0x47ae('0x14')](_0x206ab1);}return _0xa38c97[_0x47ae('0x15')](_0x206ab1)[_0x47ae('0x16')]();};}function respondWithResult(_0x54690a,_0x218d04){_0x218d04=_0x218d04||0xc8;return function(_0x1eca8c){if(_0x1eca8c){return _0x54690a['status'](_0x218d04)[_0x47ae('0x17')](_0x1eca8c);}};}function respondWithFilteredResult(_0x16bca4,_0x4b34c6){return function(_0x470271){if(_0x470271){var _0x5a0c6f=_0x470271[_0x47ae('0x18')],_0x3c8315=_0x4b34c6[_0x47ae('0x19')],_0x528db9=_0x4b34c6[_0x47ae('0x19')]+_0x4b34c6[_0x47ae('0x1a')],_0xf295c;if(_0x528db9>=_0x5a0c6f){_0x528db9=_0x5a0c6f;_0xf295c=0xc8;}else{_0xf295c=0xce;}_0x16bca4[_0x47ae('0x15')](_0xf295c);return _0x16bca4[_0x47ae('0x1b')]('Content-Range',_0x3c8315+'-'+_0x528db9+'/'+_0x5a0c6f)['json'](_0x470271);}return null;};}function patchUpdates(_0x5d109c){return function(_0x38533f){try{jsonpatch['apply'](_0x38533f,_0x5d109c,!![]);}catch(_0x29e69b){return BPromise['reject'](_0x29e69b);}return _0x38533f[_0x47ae('0x1c')]();};}function saveUpdates(_0x3714d8,_0x32e618){return function(_0x3e21e6){if(_0x3e21e6){return _0x3e21e6[_0x47ae('0x1d')](_0x3714d8)['then'](function(_0x5bcd06){return _0x5bcd06;});}return null;};}function removeEntity(_0x2acf19,_0x22d401){return function(_0x5dd630){if(_0x5dd630){return _0x5dd630[_0x47ae('0x1e')]()[_0x47ae('0x1f')](function(){_0x2acf19['status'](0xcc)[_0x47ae('0x16')]();});}};}function handleEntityNotFound(_0x2936b9,_0x4852fe){return function(_0x32fb71){if(!_0x32fb71){_0x2936b9[_0x47ae('0x14')](0x194);}return _0x32fb71;};}function handleError(_0x37799,_0x432f33){_0x432f33=_0x432f33||0x1f4;return function(_0x148cab){logger['error'](_0x148cab[_0x47ae('0x20')]);if(_0x148cab[_0x47ae('0x21')]){delete _0x148cab[_0x47ae('0x21')];}_0x37799[_0x47ae('0x15')](_0x432f33)['send'](_0x148cab);};}exports[_0x47ae('0x22')]=function(_0x51e227,_0x4c5874){var _0x1cd5e5={},_0x4cc1a5={},_0xca2a24={'count':0x0,'rows':[]};var _0xb1429e=_[_0x47ae('0x23')](db[_0x47ae('0x24')][_0x47ae('0x25')],function(_0x48645e){return{'name':_0x48645e[_0x47ae('0x26')],'type':_0x48645e['type']['key']};});_0x4cc1a5[_0x47ae('0x27')]=_[_0x47ae('0x28')](_[_0x47ae('0x23')](_0xb1429e,_0x47ae('0x21')),['format']);_0x4cc1a5[_0x47ae('0x29')]=_['keys'](_0x51e227[_0x47ae('0x29')]);_0x4cc1a5['filters']=_['intersection'](_0x4cc1a5[_0x47ae('0x27')],_0x4cc1a5[_0x47ae('0x29')]);_0x1cd5e5[_0x47ae('0x2a')]=_[_0x47ae('0x2b')](_0x4cc1a5['model'],qs[_0x47ae('0x2c')](_0x51e227[_0x47ae('0x29')][_0x47ae('0x2c')]));_0x1cd5e5[_0x47ae('0x2a')]=_0x1cd5e5[_0x47ae('0x2a')][_0x47ae('0x2d')]?_0x1cd5e5[_0x47ae('0x2a')]:_0x4cc1a5[_0x47ae('0x27')];if(!_0x51e227[_0x47ae('0x29')][_0x47ae('0x2e')](_0x47ae('0x2f'))){_0x1cd5e5[_0x47ae('0x1a')]=qs[_0x47ae('0x1a')](_0x51e227[_0x47ae('0x29')][_0x47ae('0x1a')]);_0x1cd5e5[_0x47ae('0x19')]=qs[_0x47ae('0x19')](_0x51e227[_0x47ae('0x29')][_0x47ae('0x19')]);}_0x1cd5e5[_0x47ae('0x30')]=qs['sort'](_0x51e227[_0x47ae('0x29')]['sort']);_0x1cd5e5[_0x47ae('0x31')]=qs[_0x47ae('0x32')](_['pick'](_0x51e227[_0x47ae('0x29')],_0x4cc1a5[_0x47ae('0x32')]));if(_0x51e227[_0x47ae('0x29')]['filter']){_0x1cd5e5['where']=_['merge'](_0x1cd5e5[_0x47ae('0x31')],{'$or':_[_0x47ae('0x23')](_0xb1429e,function(_0x139b25){if(_0x139b25['type']!==_0x47ae('0x33')){var _0xcc45d1={};_0xcc45d1[_0x139b25[_0x47ae('0x21')]]={'$like':'%'+_0x51e227[_0x47ae('0x29')][_0x47ae('0x34')]+'%'};return _0xcc45d1;}})});}_0x1cd5e5=_['merge']({},_0x1cd5e5,_0x51e227[_0x47ae('0x35')]);var _0x197d43={'where':_0x1cd5e5[_0x47ae('0x31')]};return db[_0x47ae('0x24')][_0x47ae('0x18')](_0x197d43)[_0x47ae('0x1f')](function(_0xab70f8){_0xca2a24[_0x47ae('0x18')]=_0xab70f8;if(_0x51e227[_0x47ae('0x29')][_0x47ae('0x36')]){_0x1cd5e5[_0x47ae('0x37')]=[{'all':!![]}];}return db[_0x47ae('0x24')][_0x47ae('0x38')](_0x1cd5e5);})['then'](function(_0x174110){_0xca2a24[_0x47ae('0x39')]=_0x174110;return _0xca2a24;})[_0x47ae('0x1f')](respondWithFilteredResult(_0x4c5874,_0x1cd5e5))[_0x47ae('0x3a')](handleError(_0x4c5874,null));};exports[_0x47ae('0x3b')]=function(_0x4e445d,_0x4b317b){var _0x3dd90d={'raw':![],'where':{'id':_0x4e445d[_0x47ae('0x3c')]['id']}},_0x1374f9={};_0x1374f9['model']=_[_0x47ae('0x3d')](db['ScreenRecording'][_0x47ae('0x25')]);_0x1374f9[_0x47ae('0x29')]=_[_0x47ae('0x3d')](_0x4e445d[_0x47ae('0x29')]);_0x1374f9[_0x47ae('0x32')]=_[_0x47ae('0x2b')](_0x1374f9[_0x47ae('0x27')],_0x1374f9['query']);_0x3dd90d[_0x47ae('0x2a')]=_[_0x47ae('0x2b')](_0x1374f9[_0x47ae('0x27')],qs[_0x47ae('0x2c')](_0x4e445d['query'][_0x47ae('0x2c')]));_0x3dd90d[_0x47ae('0x2a')]=_0x3dd90d[_0x47ae('0x2a')][_0x47ae('0x2d')]?_0x3dd90d[_0x47ae('0x2a')]:_0x1374f9['model'];if(_0x4e445d[_0x47ae('0x29')]['includeAll']){_0x3dd90d[_0x47ae('0x37')]=[{'all':!![]}];}_0x3dd90d=_[_0x47ae('0x3e')]({},_0x3dd90d,_0x4e445d[_0x47ae('0x35')]);return db[_0x47ae('0x24')][_0x47ae('0x3f')](_0x3dd90d)['then'](handleEntityNotFound(_0x4b317b,null))[_0x47ae('0x1f')](respondWithResult(_0x4b317b,null))[_0x47ae('0x3a')](handleError(_0x4b317b,null));};exports['create']=function(_0x209c5e,_0x6a4fd2){return db[_0x47ae('0x24')][_0x47ae('0x40')](_0x209c5e['body'],{})[_0x47ae('0x1f')](respondWithResult(_0x6a4fd2,0xc9))[_0x47ae('0x3a')](handleError(_0x6a4fd2,null));};exports[_0x47ae('0x1d')]=function(_0x5e3c5f,_0x48168f){if(_0x5e3c5f[_0x47ae('0x41')]['id']){delete _0x5e3c5f['body']['id'];}delete _0x5e3c5f[_0x47ae('0x41')][_0x47ae('0x42')];delete _0x5e3c5f[_0x47ae('0x41')][_0x47ae('0x43')];delete _0x5e3c5f[_0x47ae('0x41')][_0x47ae('0x44')];delete _0x5e3c5f['body'][_0x47ae('0x45')];return db[_0x47ae('0x24')][_0x47ae('0x3f')]({'where':{'id':_0x5e3c5f[_0x47ae('0x3c')]['id']}})[_0x47ae('0x1f')](handleEntityNotFound(_0x48168f,null))[_0x47ae('0x1f')](saveUpdates(_0x5e3c5f['body'],null))[_0x47ae('0x1f')](respondWithResult(_0x48168f,null))['catch'](handleError(_0x48168f,null));};exports[_0x47ae('0x46')]=function(_0x177298,_0x573de8){return db[_0x47ae('0x24')][_0x47ae('0x46')]()[_0x47ae('0x1f')](respondWithResult(_0x573de8,null))[_0x47ae('0x3a')](handleError(_0x573de8,null));};exports[_0x47ae('0x47')]=function(_0x1481f3,_0x1a7083,_0x15c680){var _0x5cb85f=require(_0x47ae('0x48'));var _0x538ed9=![];var _0x4eeeb6={};if(_0x1481f3[_0x47ae('0x29')][_0x47ae('0x49')]&&_0x1481f3['query'][_0x47ae('0x49')]===_0x47ae('0x4a')){_0x4eeeb6[_0x47ae('0x4a')]=_0x1481f3[_0x47ae('0x3c')]['id'];}else{_0x4eeeb6['id']=_0x1481f3[_0x47ae('0x3c')]['id'];}return db[_0x47ae('0x24')]['find']({'where':_0x4eeeb6,'attributes':['id',_0x47ae('0x45')],'raw':!![]})[_0x47ae('0x1f')](handleEntityNotFound(_0x1a7083,null))[_0x47ae('0x1f')](function(_0x5706a7){if(_0x5706a7){var _0x3a0fbc=path[_0x47ae('0x4b')](config[_0x47ae('0x4c')],_0x47ae('0x4d'),_0x5706a7[_0x47ae('0x45')]);var _0xe59298=util['format'](_0x47ae('0x4e'),_0x3a0fbc);if(fs['existsSync'](_0xe59298)){_0x538ed9=!![];return _0x5cb85f[_0x47ae('0x4f')](_0xe59298,_0x3a0fbc,config[_0x47ae('0x50')]['recording'])[_0x47ae('0x1f')](function(){return _0x5706a7;});}return _0x5706a7;}})[_0x47ae('0x1f')](function(_0x1e7fce){if(_0x1e7fce){var _0x104425=path[_0x47ae('0x4b')](config[_0x47ae('0x4c')],_0x47ae('0x4d'),_0x1e7fce[_0x47ae('0x45')]);if(!fs[_0x47ae('0x51')](_0x104425)){throw new db[(_0x47ae('0x52'))][(_0x47ae('0x53'))]('ScreenRecording\x20not\x20found');}if(_0x1e7fce['filename']){return _0x1a7083[_0x47ae('0x47')](_0x104425,_0x1e7fce['filename']+path[_0x47ae('0x54')](_0x104425),function(){if(_0x538ed9){fs[_0x47ae('0x55')](_0x104425);}});}else{return _0x1a7083['download'](_0x104425,function(_0x45243b){if(_0x538ed9){fs['unlink'](_0x104425);}});}}})[_0x47ae('0x3a')](function(_0x7dc2d3){if(_0x7dc2d3[_0x47ae('0x56')]===_0x47ae('0x57')){_0x1a7083['status'](0x194)['send'](_0x47ae('0x58'));}else{return handleError(_0x1a7083,null);}});};exports[_0x47ae('0x1e')]=function(_0x3cfd36,_0x52133d){return db[_0x47ae('0x24')][_0x47ae('0x3f')]({'where':{'id':_0x3cfd36[_0x47ae('0x3c')]['id']}})[_0x47ae('0x1f')](function(_0x432890){if(!_0x432890)throw new ReferenceError(_0x47ae('0x59'));return _0x432890;})[_0x47ae('0x1f')](function(_0x98bfdd){var _0x27a00f=path[_0x47ae('0x4b')](config[_0x47ae('0x4c')],_0x47ae('0x4d'),_0x98bfdd[_0x47ae('0x45')]);logger['info'](_0x47ae('0x5a'),_0x27a00f);if(!_[_0x47ae('0x5b')](_0x98bfdd[_0x47ae('0x45')])&&fs[_0x47ae('0x51')](_0x27a00f)){logger[_0x47ae('0x5c')](_0x47ae('0x5d')+_0x27a00f+_0x47ae('0x5e'));fs[_0x47ae('0x5f')](_0x27a00f);}_0x27a00f=_0x27a00f+'.cypher';if(!_[_0x47ae('0x5b')](_0x98bfdd[_0x47ae('0x45')])&&fs[_0x47ae('0x51')](_0x27a00f)){logger[_0x47ae('0x5c')](_0x47ae('0x5d')+_0x27a00f+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x47ae('0x5f')](_0x27a00f);}return _0x98bfdd;})['then'](function(_0x4ade31){if(!_0x4ade31)throw new InternalError();return _0x4ade31[_0x47ae('0x1e')]();})[_0x47ae('0x1f')](function(){_0x52133d[_0x47ae('0x15')](0xcc)[_0x47ae('0x16')]();})[_0x47ae('0x3a')](handleError(_0x52133d,null));}; \ No newline at end of file +var _0xf6a3=['attributes','fields','query','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','filter','options','include','show','params','find','create','body','catch','createdAt','closedAt','value','describe','download','../../components/encryptor','uniqueid','join','root','server/files/screen_recordings','existsSync','decryptFile','secrets','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','count','offset','limit','set','Content-Range','json','apply','save','update','then','destroy','sendStatus','stack','name','send','index','map','ScreenRecording','rawAttributes','fieldName','type','key','model','differenceBy','format','keys','filters','intersection'];(function(_0x934425,_0x5af72f){var _0x31d596=function(_0x219869){while(--_0x219869){_0x934425['push'](_0x934425['shift']());}};_0x31d596(++_0x5af72f);}(_0xf6a3,0x160));var _0x3f6a=function(_0x5b29d8,_0x2831e8){_0x5b29d8=_0x5b29d8-0x0;var _0x5f4980=_0xf6a3[_0x5b29d8];return _0x5f4980;};'use strict';var pdf=require(_0x3f6a('0x0'));var emlformat=require(_0x3f6a('0x1'));var rimraf=require(_0x3f6a('0x2'));var zipdir=require(_0x3f6a('0x3'));var jsonpatch=require(_0x3f6a('0x4'));var rp=require(_0x3f6a('0x5'));var moment=require(_0x3f6a('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f6a('0x7'));var path=require(_0x3f6a('0x8'));var sox=require('sox');var csv=require(_0x3f6a('0x9'));var ejs=require(_0x3f6a('0xa'));var fs=require('fs');var _=require(_0x3f6a('0xb'));var squel=require(_0x3f6a('0xc'));var crypto=require(_0x3f6a('0xd'));var jsforce=require(_0x3f6a('0xe'));var deskjs=require(_0x3f6a('0xf'));var toCsv=require(_0x3f6a('0x9'));var querystring=require(_0x3f6a('0x10'));var Papa=require('papaparse');var Redis=require(_0x3f6a('0x11'));var authService=require(_0x3f6a('0x12'));var qs=require(_0x3f6a('0x13'));var as=require(_0x3f6a('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f6a('0x15'))(_0x3f6a('0x16'));var utils=require(_0x3f6a('0x17'));var config=require(_0x3f6a('0x18'));var db=require(_0x3f6a('0x19'))['db'];function respondWithStatusCode(_0x36c73c,_0x150bb8){_0x150bb8=_0x150bb8||0xcc;return function(_0x40913e){if(_0x40913e){return _0x36c73c['sendStatus'](_0x150bb8);}return _0x36c73c['status'](_0x150bb8)[_0x3f6a('0x1a')]();};}function respondWithResult(_0xa02cbd,_0x1f12d4){_0x1f12d4=_0x1f12d4||0xc8;return function(_0x4f0dd8){if(_0x4f0dd8){return _0xa02cbd[_0x3f6a('0x1b')](_0x1f12d4)['json'](_0x4f0dd8);}};}function respondWithFilteredResult(_0x4be972,_0x5ad943){return function(_0x2b03d5){if(_0x2b03d5){var _0x4c71f2=_0x2b03d5[_0x3f6a('0x1c')],_0x3bc672=_0x5ad943[_0x3f6a('0x1d')],_0x3ae7f4=_0x5ad943['offset']+_0x5ad943[_0x3f6a('0x1e')],_0x2af1d6;if(_0x3ae7f4>=_0x4c71f2){_0x3ae7f4=_0x4c71f2;_0x2af1d6=0xc8;}else{_0x2af1d6=0xce;}_0x4be972[_0x3f6a('0x1b')](_0x2af1d6);return _0x4be972[_0x3f6a('0x1f')](_0x3f6a('0x20'),_0x3bc672+'-'+_0x3ae7f4+'/'+_0x4c71f2)[_0x3f6a('0x21')](_0x2b03d5);}return null;};}function patchUpdates(_0x312e0e){return function(_0x2c8950){try{jsonpatch[_0x3f6a('0x22')](_0x2c8950,_0x312e0e,!![]);}catch(_0x5d8f80){return BPromise['reject'](_0x5d8f80);}return _0x2c8950[_0x3f6a('0x23')]();};}function saveUpdates(_0x3fe60d,_0x1872cc){return function(_0x1b2343){if(_0x1b2343){return _0x1b2343[_0x3f6a('0x24')](_0x3fe60d)[_0x3f6a('0x25')](function(_0x1d1b18){return _0x1d1b18;});}return null;};}function removeEntity(_0xd4f08e,_0x422487){return function(_0x4f272c){if(_0x4f272c){return _0x4f272c[_0x3f6a('0x26')]()[_0x3f6a('0x25')](function(){_0xd4f08e['status'](0xcc)[_0x3f6a('0x1a')]();});}};}function handleEntityNotFound(_0x414c18,_0x17c928){return function(_0xf96c3){if(!_0xf96c3){_0x414c18[_0x3f6a('0x27')](0x194);}return _0xf96c3;};}function handleError(_0x3c4eca,_0x1c4f66){_0x1c4f66=_0x1c4f66||0x1f4;return function(_0x22ff3f){logger['error'](_0x22ff3f[_0x3f6a('0x28')]);if(_0x22ff3f[_0x3f6a('0x29')]){delete _0x22ff3f[_0x3f6a('0x29')];}_0x3c4eca[_0x3f6a('0x1b')](_0x1c4f66)[_0x3f6a('0x2a')](_0x22ff3f);};}exports[_0x3f6a('0x2b')]=function(_0x402ffa,_0x4f29fc){var _0x152b6a={},_0x304666={},_0x3f0ff8={'count':0x0,'rows':[]};var _0x313e7a=_[_0x3f6a('0x2c')](db[_0x3f6a('0x2d')][_0x3f6a('0x2e')],function(_0x14daba){return{'name':_0x14daba[_0x3f6a('0x2f')],'type':_0x14daba[_0x3f6a('0x30')][_0x3f6a('0x31')]};});_0x304666[_0x3f6a('0x32')]=_[_0x3f6a('0x33')](_[_0x3f6a('0x2c')](_0x313e7a,_0x3f6a('0x29')),[_0x3f6a('0x34')]);_0x304666['query']=_[_0x3f6a('0x35')](_0x402ffa['query']);_0x304666[_0x3f6a('0x36')]=_[_0x3f6a('0x37')](_0x304666[_0x3f6a('0x32')],_0x304666['query']);_0x152b6a[_0x3f6a('0x38')]=_['intersection'](_0x304666[_0x3f6a('0x32')],qs[_0x3f6a('0x39')](_0x402ffa[_0x3f6a('0x3a')][_0x3f6a('0x39')]));_0x152b6a[_0x3f6a('0x38')]=_0x152b6a[_0x3f6a('0x38')][_0x3f6a('0x3b')]?_0x152b6a[_0x3f6a('0x38')]:_0x304666[_0x3f6a('0x32')];if(!_0x402ffa[_0x3f6a('0x3a')][_0x3f6a('0x3c')]('nolimit')){_0x152b6a[_0x3f6a('0x1e')]=qs[_0x3f6a('0x1e')](_0x402ffa[_0x3f6a('0x3a')][_0x3f6a('0x1e')]);_0x152b6a[_0x3f6a('0x1d')]=qs[_0x3f6a('0x1d')](_0x402ffa[_0x3f6a('0x3a')][_0x3f6a('0x1d')]);}_0x152b6a[_0x3f6a('0x3d')]=qs[_0x3f6a('0x3e')](_0x402ffa['query'][_0x3f6a('0x3e')]);_0x152b6a[_0x3f6a('0x3f')]=qs[_0x3f6a('0x36')](_[_0x3f6a('0x40')](_0x402ffa['query'],_0x304666[_0x3f6a('0x36')]));if(_0x402ffa['query']['filter']){_0x152b6a[_0x3f6a('0x3f')]=_[_0x3f6a('0x41')](_0x152b6a[_0x3f6a('0x3f')],{'$or':_[_0x3f6a('0x2c')](_0x313e7a,function(_0x3bdbc0){if(_0x3bdbc0[_0x3f6a('0x30')]!==_0x3f6a('0x42')){var _0x18d72d={};_0x18d72d[_0x3bdbc0['name']]={'$like':'%'+_0x402ffa[_0x3f6a('0x3a')][_0x3f6a('0x43')]+'%'};return _0x18d72d;}})});}_0x152b6a=_[_0x3f6a('0x41')]({},_0x152b6a,_0x402ffa[_0x3f6a('0x44')]);var _0x595e0f={'where':_0x152b6a[_0x3f6a('0x3f')]};return db[_0x3f6a('0x2d')][_0x3f6a('0x1c')](_0x595e0f)['then'](function(_0x1f36c8){_0x3f0ff8[_0x3f6a('0x1c')]=_0x1f36c8;if(_0x402ffa['query']['includeAll']){_0x152b6a[_0x3f6a('0x45')]=[{'all':!![]}];}return db[_0x3f6a('0x2d')]['findAll'](_0x152b6a);})['then'](function(_0x2e5b10){_0x3f0ff8['rows']=_0x2e5b10;return _0x3f0ff8;})[_0x3f6a('0x25')](respondWithFilteredResult(_0x4f29fc,_0x152b6a))['catch'](handleError(_0x4f29fc,null));};exports[_0x3f6a('0x46')]=function(_0x304fe9,_0x3515c1){var _0x1a6ba7={'raw':![],'where':{'id':_0x304fe9[_0x3f6a('0x47')]['id']}},_0x412f61={};_0x412f61[_0x3f6a('0x32')]=_['keys'](db[_0x3f6a('0x2d')][_0x3f6a('0x2e')]);_0x412f61[_0x3f6a('0x3a')]=_['keys'](_0x304fe9[_0x3f6a('0x3a')]);_0x412f61['filters']=_[_0x3f6a('0x37')](_0x412f61['model'],_0x412f61[_0x3f6a('0x3a')]);_0x1a6ba7['attributes']=_[_0x3f6a('0x37')](_0x412f61['model'],qs[_0x3f6a('0x39')](_0x304fe9[_0x3f6a('0x3a')][_0x3f6a('0x39')]));_0x1a6ba7['attributes']=_0x1a6ba7[_0x3f6a('0x38')][_0x3f6a('0x3b')]?_0x1a6ba7[_0x3f6a('0x38')]:_0x412f61[_0x3f6a('0x32')];if(_0x304fe9[_0x3f6a('0x3a')]['includeAll']){_0x1a6ba7['include']=[{'all':!![]}];}_0x1a6ba7=_['merge']({},_0x1a6ba7,_0x304fe9[_0x3f6a('0x44')]);return db[_0x3f6a('0x2d')][_0x3f6a('0x48')](_0x1a6ba7)[_0x3f6a('0x25')](handleEntityNotFound(_0x3515c1,null))[_0x3f6a('0x25')](respondWithResult(_0x3515c1,null))['catch'](handleError(_0x3515c1,null));};exports[_0x3f6a('0x49')]=function(_0xe2b5b0,_0x11d1a3){return db[_0x3f6a('0x2d')]['create'](_0xe2b5b0[_0x3f6a('0x4a')],{})['then'](respondWithResult(_0x11d1a3,0xc9))[_0x3f6a('0x4b')](handleError(_0x11d1a3,null));};exports[_0x3f6a('0x24')]=function(_0xe63e34,_0x125414){if(_0xe63e34['body']['id']){delete _0xe63e34[_0x3f6a('0x4a')]['id'];}delete _0xe63e34[_0x3f6a('0x4a')]['duration'];delete _0xe63e34[_0x3f6a('0x4a')][_0x3f6a('0x4c')];delete _0xe63e34['body'][_0x3f6a('0x4d')];delete _0xe63e34[_0x3f6a('0x4a')][_0x3f6a('0x4e')];return db[_0x3f6a('0x2d')][_0x3f6a('0x48')]({'where':{'id':_0xe63e34['params']['id']}})[_0x3f6a('0x25')](handleEntityNotFound(_0x125414,null))['then'](saveUpdates(_0xe63e34[_0x3f6a('0x4a')],null))[_0x3f6a('0x25')](respondWithResult(_0x125414,null))[_0x3f6a('0x4b')](handleError(_0x125414,null));};exports[_0x3f6a('0x4f')]=function(_0x5e3fe4,_0xbe4d9){return db[_0x3f6a('0x2d')]['describe']()[_0x3f6a('0x25')](respondWithResult(_0xbe4d9,null))[_0x3f6a('0x4b')](handleError(_0xbe4d9,null));};exports[_0x3f6a('0x50')]=function(_0x14566b,_0x41c5f7,_0x493cbb){var _0x511357=require(_0x3f6a('0x51'));var _0x34dfd3=![];var _0x3d45b0={};if(_0x14566b[_0x3f6a('0x3a')][_0x3f6a('0x30')]&&_0x14566b[_0x3f6a('0x3a')][_0x3f6a('0x30')]===_0x3f6a('0x52')){_0x3d45b0[_0x3f6a('0x52')]=_0x14566b[_0x3f6a('0x47')]['id'];}else{_0x3d45b0['id']=_0x14566b[_0x3f6a('0x47')]['id'];}return db['ScreenRecording'][_0x3f6a('0x48')]({'where':_0x3d45b0,'attributes':['id',_0x3f6a('0x4e')],'raw':!![]})[_0x3f6a('0x25')](handleEntityNotFound(_0x41c5f7,null))[_0x3f6a('0x25')](function(_0x560248){if(_0x560248){var _0x373516=path[_0x3f6a('0x53')](config[_0x3f6a('0x54')],_0x3f6a('0x55'),_0x560248['value']);var _0x3cd174=util['format']('%s.cypher',_0x373516);if(fs[_0x3f6a('0x56')](_0x3cd174)){_0x34dfd3=!![];return _0x511357[_0x3f6a('0x57')](_0x3cd174,_0x373516,config[_0x3f6a('0x58')]['recording'])['then'](function(){return _0x560248;});}return _0x560248;}})['then'](function(_0x47df54){if(_0x47df54){var _0x163188=path[_0x3f6a('0x53')](config[_0x3f6a('0x54')],'server/files/screen_recordings',_0x47df54[_0x3f6a('0x4e')]);if(!fs['existsSync'](_0x163188)){throw new db[(_0x3f6a('0x59'))][(_0x3f6a('0x5a'))](_0x3f6a('0x5b'));}if(_0x47df54[_0x3f6a('0x5c')]){return _0x41c5f7[_0x3f6a('0x50')](_0x163188,_0x47df54[_0x3f6a('0x5c')]+path[_0x3f6a('0x5d')](_0x163188),function(){if(_0x34dfd3){fs['unlink'](_0x163188);}});}else{return _0x41c5f7['download'](_0x163188,function(_0x326151){if(_0x34dfd3){fs['unlink'](_0x163188);}});}}})[_0x3f6a('0x4b')](function(_0xbf189f){if(_0xbf189f[_0x3f6a('0x5e')]===_0x3f6a('0x5b')){_0x41c5f7[_0x3f6a('0x1b')](0x194)[_0x3f6a('0x2a')](_0x3f6a('0x5f'));}else{return handleError(_0x41c5f7,null);}});};exports['destroy']=function(_0x4924d3,_0x5ab8a6){return db[_0x3f6a('0x2d')][_0x3f6a('0x48')]({'where':{'id':_0x4924d3[_0x3f6a('0x47')]['id']}})[_0x3f6a('0x25')](function(_0x3d3a1a){if(!_0x3d3a1a)throw new ReferenceError(_0x3f6a('0x60'));return _0x3d3a1a;})[_0x3f6a('0x25')](function(_0x2059d0){var _0x3e291a=path[_0x3f6a('0x53')](config['root'],_0x3f6a('0x55'),_0x2059d0['value']);logger['info'](_0x3f6a('0x61'),_0x3e291a);if(!_[_0x3f6a('0x62')](_0x2059d0['value'])&&fs[_0x3f6a('0x56')](_0x3e291a)){logger[_0x3f6a('0x63')]('File:\x20\x22'+_0x3e291a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3e291a);}_0x3e291a=_0x3e291a+'.cypher';if(!_['isNil'](_0x2059d0[_0x3f6a('0x4e')])&&fs['existsSync'](_0x3e291a)){logger[_0x3f6a('0x63')](_0x3f6a('0x64')+_0x3e291a+_0x3f6a('0x65'));fs['unlinkSync'](_0x3e291a);}return _0x2059d0;})[_0x3f6a('0x25')](function(_0x19489f){if(!_0x19489f)throw new InternalError();return _0x19489f[_0x3f6a('0x26')]();})['then'](function(){_0x5ab8a6[_0x3f6a('0x1b')](0xcc)[_0x3f6a('0x1a')]();})[_0x3f6a('0x4b')](handleError(_0x5ab8a6,null));}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 016e5ee..b436658 100644 --- a/server/api/screenRecording/screenRecording.model.js +++ b/server/api/screenRecording/screenRecording.model.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd371=['util','moment','path','rimraf','../../config/environment','./screenRecording.attributes','exports','define','ScreenRecording','screen_recordings','interactionid','lodash'];(function(_0x3bd5de,_0x29652a){var _0x319cbc=function(_0x4526ee){while(--_0x4526ee){_0x3bd5de['push'](_0x3bd5de['shift']());}};_0x319cbc(++_0x29652a);}(_0xd371,0x14f));var _0x1d37=function(_0xd93cbe,_0x11202e){_0xd93cbe=_0xd93cbe-0x0;var _0xe0bb40=_0xd371[_0xd93cbe];return _0xe0bb40;};'use strict';var _=require(_0x1d37('0x0'));var util=require(_0x1d37('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x1d37('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1d37('0x3'));var rimraf=require(_0x1d37('0x4'));var config=require(_0x1d37('0x5'));var attributes=require(_0x1d37('0x6'));module[_0x1d37('0x7')]=function(_0x591cf7,_0x5249ad){return _0x591cf7[_0x1d37('0x8')](_0x1d37('0x9'),attributes,{'tableName':_0x1d37('0xa'),'paranoid':![],'indexes':[{'name':_0x1d37('0xb'),'fields':[_0x1d37('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6d24=['ScreenRecording','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./screenRecording.attributes','exports','define'];(function(_0x1ce6a7,_0xeaa892){var _0x3095a7=function(_0x4a80df){while(--_0x4a80df){_0x1ce6a7['push'](_0x1ce6a7['shift']());}};_0x3095a7(++_0xeaa892);}(_0x6d24,0x84));var _0x46d2=function(_0x2bf5a3,_0x32fccf){_0x2bf5a3=_0x2bf5a3-0x0;var _0x19e769=_0x6d24[_0x2bf5a3];return _0x19e769;};'use strict';var _=require(_0x46d2('0x0'));var util=require(_0x46d2('0x1'));var logger=require(_0x46d2('0x2'))(_0x46d2('0x3'));var moment=require(_0x46d2('0x4'));var BPromise=require(_0x46d2('0x5'));var rp=require(_0x46d2('0x6'));var fs=require('fs');var path=require(_0x46d2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x46d2('0x8'));module[_0x46d2('0x9')]=function(_0x1fe79c,_0x5b12c7){return _0x1fe79c[_0x46d2('0xa')](_0x46d2('0xb'),attributes,{'tableName':'screen_recordings','paranoid':![],'indexes':[{'name':_0x46d2('0xc'),'fields':[_0x46d2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 3b4ffcb..3458d6f 100644 --- a/server/api/screenRecording/screenRecording.rpc.js +++ b/server/api/screenRecording/screenRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3c4e01,_0x8e1df1){var _0x1ba09e=function(_0x34d73a){while(--_0x34d73a){_0x3c4e01['push'](_0x3c4e01['shift']());}};_0x1ba09e(++_0x8e1df1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2cfb58,_0x3d9412){_0x2cfb58=_0x2cfb58-0x0;var _0xd99951=_0xa9e0[_0x2cfb58];return _0xd99951;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file +var _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x23c18d,_0x14497f){var _0x16cc74=function(_0x3322cf){while(--_0x3322cf){_0x23c18d['push'](_0x23c18d['shift']());}};_0x16cc74(++_0x14497f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x21aec3,_0x5c97e9){_0x21aec3=_0x21aec3-0x0;var _0x288bbc=_0xa9e0[_0x21aec3];return _0x288bbc;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});} \ No newline at end of file diff --git a/server/api/setting/index.js b/server/api/setting/index.js index e14ec09..ac35734 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 _0xbfeb=['join','root','server/files/images/logos/','logo','extname','originalname','post','/:id/logo','single','file','addLogo','logologin','format','preferred','addPreferred','favicon','addFavicon','put','update','exports','util','connect-timeout','express','Router','../../config/environment','./setting.controller','isAuthenticated','index','get','/:id','show','getLogo','/:id/logo_login','getLogoLogin','/:id/gdpr','gdpr','/:id/preferred','/:id/favicon','getFavicon','diskStorage'];(function(_0x3899d1,_0x4aa04c){var _0xeb4a7d=function(_0x3ea5ee){while(--_0x3ea5ee){_0x3899d1['push'](_0x3899d1['shift']());}};_0xeb4a7d(++_0x4aa04c);}(_0xbfeb,0x64));var _0xbbfe=function(_0x22b313,_0x5d7de5){_0x22b313=_0x22b313-0x0;var _0x5def65=_0xbfeb[_0x22b313];return _0x5def65;};'use strict';var multer=require('multer');var util=require(_0xbbfe('0x0'));var path=require('path');var timeout=require(_0xbbfe('0x1'));var express=require(_0xbbfe('0x2'));var router=express[_0xbbfe('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbbfe('0x4'));var controller=require(_0xbbfe('0x5'));router['get']('/',auth[_0xbbfe('0x6')](),controller[_0xbbfe('0x7')]);router[_0xbbfe('0x8')](_0xbbfe('0x9'),controller[_0xbbfe('0xa')]);router[_0xbbfe('0x8')]('/:id/logo',controller[_0xbbfe('0xb')]);router[_0xbbfe('0x8')](_0xbbfe('0xc'),controller[_0xbbfe('0xd')]);router[_0xbbfe('0x8')](_0xbbfe('0xe'),controller[_0xbbfe('0xf')]);router[_0xbbfe('0x8')](_0xbbfe('0x10'),controller['getPreferred']);router[_0xbbfe('0x8')](_0xbbfe('0x11'),controller[_0xbbfe('0x12')]);var upload=multer({'storage':multer[_0xbbfe('0x13')]({'destination':function(_0xd8786a,_0x565cc9,_0x26cea5){_0x26cea5(null,path[_0xbbfe('0x14')](config[_0xbbfe('0x15')],_0xbbfe('0x16')));},'filename':function(_0x31a60b,_0x1406ea,_0x2a2e47){_0x2a2e47(null,util['format']('%s%s',_0xbbfe('0x17'),path[_0xbbfe('0x18')](_0x1406ea[_0xbbfe('0x19')])));}})});router[_0xbbfe('0x1a')](_0xbbfe('0x1b'),upload[_0xbbfe('0x1c')](_0xbbfe('0x1d')),controller[_0xbbfe('0x1e')]);var upload=multer({'storage':multer[_0xbbfe('0x13')]({'destination':function(_0x1c0c26,_0x1daf75,_0x5e31a5){_0x5e31a5(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x246cb9,_0x28cd0d,_0x427134){_0x427134(null,util['format']('%s%s',_0xbbfe('0x1f'),path[_0xbbfe('0x18')](_0x28cd0d[_0xbbfe('0x19')])));}})});router['post']('/:id/logo_login',upload['single'](_0xbbfe('0x1d')),controller['addLogoLogin']);var upload=multer({'storage':multer[_0xbbfe('0x13')]({'destination':function(_0x3cd8a1,_0x1d1ff8,_0x1df82a){_0x1df82a(null,path[_0xbbfe('0x14')](config[_0xbbfe('0x15')],_0xbbfe('0x16')));},'filename':function(_0x1e97e2,_0x561ef8,_0x5160d9){_0x5160d9(null,util[_0xbbfe('0x20')]('%s%s',_0xbbfe('0x21'),path[_0xbbfe('0x18')](_0x561ef8[_0xbbfe('0x19')])));}})});router[_0xbbfe('0x1a')](_0xbbfe('0x10'),upload['single']('file'),controller[_0xbbfe('0x22')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x1e933d,_0x2c52e6,_0x16682c){_0x16682c(null,path['join'](config['root'],_0xbbfe('0x16')));},'filename':function(_0x24bf7d,_0x772d5f,_0x1919cc){_0x1919cc(null,util[_0xbbfe('0x20')]('%s%s',_0xbbfe('0x23'),path[_0xbbfe('0x18')](_0x772d5f['originalname'])));}})});router[_0xbbfe('0x1a')](_0xbbfe('0x11'),upload[_0xbbfe('0x1c')](_0xbbfe('0x1d')),controller[_0xbbfe('0x24')]);router[_0xbbfe('0x25')](_0xbbfe('0x9'),auth[_0xbbfe('0x6')](),controller[_0xbbfe('0x26')]);module[_0xbbfe('0x27')]=router; \ No newline at end of file +var _0x3995=['single','addPreferred','favicon','addFavicon','put','/:id','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','index','show','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','%s%s','logo','originalname','post','/:id/logo','addLogo','extname','file','addLogoLogin'];(function(_0x1f52ea,_0x1dd436){var _0x2d4b16=function(_0x3cee20){while(--_0x3cee20){_0x1f52ea['push'](_0x1f52ea['shift']());}};_0x2d4b16(++_0x1dd436);}(_0x3995,0x9a));var _0x5399=function(_0x5e080e,_0x395900){_0x5e080e=_0x5e080e-0x0;var _0x402593=_0x3995[_0x5e080e];return _0x402593;};'use strict';var multer=require(_0x5399('0x0'));var util=require(_0x5399('0x1'));var path=require('path');var timeout=require(_0x5399('0x2'));var express=require('express');var router=express[_0x5399('0x3')]();var auth=require(_0x5399('0x4'));var interaction=require(_0x5399('0x5'));var config=require(_0x5399('0x6'));var controller=require(_0x5399('0x7'));router[_0x5399('0x8')]('/',auth['isAuthenticated'](),controller[_0x5399('0x9')]);router[_0x5399('0x8')]('/:id',controller[_0x5399('0xa')]);router['get']('/:id/logo',controller[_0x5399('0xb')]);router[_0x5399('0x8')](_0x5399('0xc'),controller['getLogoLogin']);router[_0x5399('0x8')]('/:id/gdpr',controller[_0x5399('0xd')]);router['get'](_0x5399('0xe'),controller[_0x5399('0xf')]);router[_0x5399('0x8')](_0x5399('0x10'),controller['getFavicon']);var upload=multer({'storage':multer[_0x5399('0x11')]({'destination':function(_0x2c6c0c,_0x32e206,_0x3461c8){_0x3461c8(null,path[_0x5399('0x12')](config[_0x5399('0x13')],_0x5399('0x14')));},'filename':function(_0x13510a,_0x37d003,_0x21b627){_0x21b627(null,util[_0x5399('0x15')](_0x5399('0x16'),_0x5399('0x17'),path['extname'](_0x37d003[_0x5399('0x18')])));}})});router[_0x5399('0x19')](_0x5399('0x1a'),upload['single']('file'),controller[_0x5399('0x1b')]);var upload=multer({'storage':multer[_0x5399('0x11')]({'destination':function(_0x5780c0,_0x4e9c72,_0x2db813){_0x2db813(null,path[_0x5399('0x12')](config[_0x5399('0x13')],_0x5399('0x14')));},'filename':function(_0x1ab6df,_0x148277,_0x5e5525){_0x5e5525(null,util[_0x5399('0x15')]('%s%s','logologin',path[_0x5399('0x1c')](_0x148277[_0x5399('0x18')])));}})});router[_0x5399('0x19')](_0x5399('0xc'),upload['single'](_0x5399('0x1d')),controller[_0x5399('0x1e')]);var upload=multer({'storage':multer[_0x5399('0x11')]({'destination':function(_0x4b0815,_0x2998e6,_0x543072){_0x543072(null,path['join'](config['root'],'server/files/images/logos/'));},'filename':function(_0x510c4b,_0x4730ea,_0x14465f){_0x14465f(null,util[_0x5399('0x15')](_0x5399('0x16'),'preferred',path['extname'](_0x4730ea[_0x5399('0x18')])));}})});router[_0x5399('0x19')](_0x5399('0xe'),upload[_0x5399('0x1f')](_0x5399('0x1d')),controller[_0x5399('0x20')]);var upload=multer({'storage':multer[_0x5399('0x11')]({'destination':function(_0x21e5b8,_0x587473,_0x1e0c92){_0x1e0c92(null,path[_0x5399('0x12')](config[_0x5399('0x13')],_0x5399('0x14')));},'filename':function(_0xeb84ff,_0x15ec60,_0x24f6f0){_0x24f6f0(null,util[_0x5399('0x15')](_0x5399('0x16'),_0x5399('0x21'),path['extname'](_0x15ec60[_0x5399('0x18')])));}})});router[_0x5399('0x19')](_0x5399('0x10'),upload[_0x5399('0x1f')](_0x5399('0x1d')),controller[_0x5399('0x22')]);router[_0x5399('0x23')](_0x5399('0x24'),auth['isAuthenticated'](),controller['update']);module['exports']=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index ac0d585..f40842e 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 _0x0ed8=['BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports','INTEGER','min_internal','min_mailbox','/var/opt/motion2/server/files/sounds/converted','STRING'];(function(_0x353bfd,_0x51dcc7){var _0x54f156=function(_0x18c207){while(--_0x18c207){_0x353bfd['push'](_0x353bfd['shift']());}};_0x54f156(++_0x51dcc7);}(_0x0ed8,0x11a));var _0x80ed=function(_0x43fd13,_0x259430){_0x43fd13=_0x43fd13-0x0;var _0x530e29=_0x0ed8[_0x43fd13];return _0x530e29;};'use strict';var Sequelize=require('sequelize');module[_0x80ed('0x0')]={'min_internal':{'type':Sequelize[_0x80ed('0x1')](0xb),'unique':_0x80ed('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':_0x80ed('0x3'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x80ed('0x1')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':_0x80ed('0x4')},'logo':{'type':Sequelize[_0x80ed('0x5')]},'defaultLogo':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x80ed('0x5')]},'defaultLoginLogo':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x80ed('0x5')]},'defaultHeaderWhiteLabel':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize['STRING']},'turnpassword':{'type':Sequelize['STRING']},'pageTitle':{'type':Sequelize[_0x80ed('0x5')]},'defaultPageTitle':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0x80ed('0x7')},'enableEmailPreview':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':![]},'split':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x80ed('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x80ed('0x5')],'defaultValue':_0x80ed('0x8')},'chatTimeout':{'type':Sequelize[_0x80ed('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x80ed('0x5')]},'defaultPreferred':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x80ed('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize[_0x80ed('0x1')],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x80ed('0x6')],'defaultValue':![]}}; \ No newline at end of file +var _0xee04=['min_mailbox','BOOLEAN','STRING','alternate','sequelize','exports','INTEGER','min_internal'];(function(_0x376ebb,_0xc9a91d){var _0x32204c=function(_0x5a34de){while(--_0x5a34de){_0x376ebb['push'](_0x376ebb['shift']());}};_0x32204c(++_0xc9a91d);}(_0xee04,0x124));var _0x4ee0=function(_0x1318a2,_0x481aa1){_0x1318a2=_0x1318a2-0x0;var _0x365edc=_0xee04[_0x1318a2];return _0x365edc;};'use strict';var Sequelize=require(_0x4ee0('0x0'));module[_0x4ee0('0x1')]={'min_internal':{'type':Sequelize[_0x4ee0('0x2')](0xb),'unique':_0x4ee0('0x3'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x4ee0('0x2')](0xb),'unique':_0x4ee0('0x4'),'defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0x4ee0('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize['STRING'],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize['STRING']},'defaultLogo':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize['STRING']},'defaultLoginLogo':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize['STRING']},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize['STRING']},'turnusername':{'type':Sequelize[_0x4ee0('0x6')]},'turnpassword':{'type':Sequelize[_0x4ee0('0x6')]},'pageTitle':{'type':Sequelize[_0x4ee0('0x6')]},'defaultPageTitle':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':'https://www.xcally.com/bar/phonebar/autoupdater.xml'},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x4ee0('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x4ee0('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x4ee0('0x2')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0x4ee0('0x6')],'defaultValue':_0x4ee0('0x7')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x4ee0('0x6')]},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0x4ee0('0x6')]},'allowedLoginAttempts':{'type':Sequelize[_0x4ee0('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x4ee0('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}},'googleSsoEnabled':{'type':Sequelize[_0x4ee0('0x5')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index 9ec783c..7cb4d55 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 _0xf4f5=['root','toLower','join','default_logo.png','default','custom','upperFirst','\x20not\x20found','getLogoLogin','favicon','default_loginLogo.png','download','gdpr','securePassword','addPreferred','getPreferred','defaultPreferred','default_preferred.png','getFavicon','default_favicon.ico','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','stack','name','send','index','map','Setting','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','catch','show','options','find','body','params','addLogo','file','filename','logo','../../config/license/util','getLogo','server/files/images/logos','getLicense','loginLogo','preferred','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync'];(function(_0x1a068f,_0x426682){var _0x298c9b=function(_0x2f9b0d){while(--_0x2f9b0d){_0x1a068f['push'](_0x1a068f['shift']());}};_0x298c9b(++_0x426682);}(_0xf4f5,0x89));var _0x5f4f=function(_0x172f40,_0x2a83d4){_0x172f40=_0x172f40-0x0;var _0x2c0eb7=_0xf4f5[_0x172f40];return _0x2c0eb7;};'use strict';var pdf=require(_0x5f4f('0x0'));var emlformat=require(_0x5f4f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5f4f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x5f4f('0x3'));var moment=require('moment');var BPromise=require(_0x5f4f('0x4'));var Mustache=require(_0x5f4f('0x5'));var util=require(_0x5f4f('0x6'));var path=require(_0x5f4f('0x7'));var sox=require('sox');var csv=require(_0x5f4f('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5f4f('0x9'));var crypto=require(_0x5f4f('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x5f4f('0xb'));var toCsv=require(_0x5f4f('0x8'));var querystring=require(_0x5f4f('0xc'));var Papa=require(_0x5f4f('0xd'));var Redis=require('ioredis');var authService=require(_0x5f4f('0xe'));var qs=require(_0x5f4f('0xf'));var as=require(_0x5f4f('0x10'));var hardwareService=require(_0x5f4f('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x5f4f('0x12'));var config=require(_0x5f4f('0x13'));var db=require(_0x5f4f('0x14'))['db'];var jayson=require(_0x5f4f('0x15'));var client=jayson[_0x5f4f('0x16')][_0x5f4f('0x17')]({'port':0x232a});function checkPasswordPattern(_0x467c09,_0x965204,_0x42dfdb){if(_0x42dfdb){var _0x26d32f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x26d32f[_0x5f4f('0x18')](_0x965204)){return _0x467c09;}else{throw new db[(_0x5f4f('0x19'))][(_0x5f4f('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x467c09;}}function respondWithRpcPromise(_0x1a4332,_0x212e1d,_0x64de88,_0x2cd43d){return new BPromise(function(_0xcb2a29,_0xbb41f2){var _0xab6493=_0x2cd43d||client;return _0xab6493[_0x5f4f('0x1b')](_0x1a4332,_0x64de88)[_0x5f4f('0x1c')](function(_0x3a56fb){logger[_0x5f4f('0x1d')](_0x5f4f('0x1e'),_0x212e1d,_0x5f4f('0x1f'));logger[_0x5f4f('0x20')](_0x5f4f('0x21'),_0x212e1d,_0x5f4f('0x1f'),JSON[_0x5f4f('0x22')](_0x3a56fb));if(_0x3a56fb[_0x5f4f('0x23')]){if(_0x3a56fb[_0x5f4f('0x23')][_0x5f4f('0x24')]===0x1f4){logger[_0x5f4f('0x23')](_0x5f4f('0x1e'),_0x212e1d,_0x3a56fb[_0x5f4f('0x23')][_0x5f4f('0x25')]);return _0xbb41f2(_0x3a56fb[_0x5f4f('0x23')][_0x5f4f('0x25')]);}logger[_0x5f4f('0x23')](_0x5f4f('0x1e'),_0x212e1d,_0x3a56fb[_0x5f4f('0x23')]['message']);return _0xcb2a29(_0x3a56fb[_0x5f4f('0x23')][_0x5f4f('0x25')]);}else{logger[_0x5f4f('0x1d')]('Setting,\x20%s,\x20%s',_0x212e1d,_0x5f4f('0x1f'));_0xcb2a29(_0x3a56fb['result'][_0x5f4f('0x25')]);}})['catch'](function(_0xdeb173){logger[_0x5f4f('0x23')](_0x5f4f('0x1e'),_0x212e1d,_0xdeb173);_0xbb41f2(_0xdeb173);});});}function respondWithStatusCode(_0x596ca7,_0x2cb256){_0x2cb256=_0x2cb256||0xcc;return function(_0x2a40a7){if(_0x2a40a7){return _0x596ca7[_0x5f4f('0x26')](_0x2cb256);}return _0x596ca7[_0x5f4f('0x27')](_0x2cb256)[_0x5f4f('0x28')]();};}function respondWithResult(_0x6882f0,_0x483e73){_0x483e73=_0x483e73||0xc8;return function(_0x8b18f2){if(_0x8b18f2){return _0x6882f0[_0x5f4f('0x27')](_0x483e73)[_0x5f4f('0x29')](_0x8b18f2);}};}function respondWithFilteredResult(_0x17c2ec,_0x369fb6){return function(_0x2148d1){if(_0x2148d1){var _0x277200=_0x2148d1[_0x5f4f('0x2a')],_0x3eb07e=_0x369fb6[_0x5f4f('0x2b')],_0x528d49=_0x369fb6['offset']+_0x369fb6[_0x5f4f('0x2c')],_0x45ea15;if(_0x528d49>=_0x277200){_0x528d49=_0x277200;_0x45ea15=0xc8;}else{_0x45ea15=0xce;}_0x17c2ec[_0x5f4f('0x27')](_0x45ea15);return _0x17c2ec[_0x5f4f('0x2d')](_0x5f4f('0x2e'),_0x3eb07e+'-'+_0x528d49+'/'+_0x277200)[_0x5f4f('0x29')](_0x2148d1);}return null;};}function patchUpdates(_0x36b2a2){return function(_0x881f12){try{jsonpatch[_0x5f4f('0x2f')](_0x881f12,_0x36b2a2,!![]);}catch(_0x70711e){return BPromise[_0x5f4f('0x30')](_0x70711e);}return _0x881f12[_0x5f4f('0x31')]();};}function saveUpdates(_0x4dbba1,_0x1e7e5e){return function(_0x3402c5){if(_0x3402c5){return _0x3402c5[_0x5f4f('0x32')](_0x4dbba1)[_0x5f4f('0x1c')](function(_0x1955c6){return _0x1955c6;});}return null;};}function removeEntity(_0x5286a5,_0x5717f5){return function(_0x422a27){if(_0x422a27){return _0x422a27['destroy']()[_0x5f4f('0x1c')](function(){_0x5286a5['status'](0xcc)[_0x5f4f('0x28')]();});}};}function handleEntityNotFound(_0x441ec1,_0x1d63e3){return function(_0x1a4280){if(!_0x1a4280){_0x441ec1[_0x5f4f('0x26')](0x194);}return _0x1a4280;};}function handleError(_0x5e1fb2,_0x17dcf5){_0x17dcf5=_0x17dcf5||0x1f4;return function(_0x41182c){logger[_0x5f4f('0x23')](_0x41182c[_0x5f4f('0x33')]);if(_0x41182c[_0x5f4f('0x34')]){delete _0x41182c[_0x5f4f('0x34')];}_0x5e1fb2['status'](_0x17dcf5)[_0x5f4f('0x35')](_0x41182c);};}exports[_0x5f4f('0x36')]=function(_0x5eda45,_0x1e4c3e){var _0x365215={},_0x46313a={},_0x2a5a18={'count':0x0,'rows':[]};var _0x4d79cb=_[_0x5f4f('0x37')](db[_0x5f4f('0x38')][_0x5f4f('0x39')],function(_0x2872e7){return{'name':_0x2872e7['fieldName'],'type':_0x2872e7[_0x5f4f('0x3a')][_0x5f4f('0x3b')]};});_0x46313a['model']=_[_0x5f4f('0x37')](_0x4d79cb,_0x5f4f('0x34'));_0x46313a[_0x5f4f('0x3c')]=_[_0x5f4f('0x3d')](_0x5eda45['query']);_0x46313a[_0x5f4f('0x3e')]=_[_0x5f4f('0x3f')](_0x46313a[_0x5f4f('0x40')],_0x46313a[_0x5f4f('0x3c')]);_0x365215['attributes']=_[_0x5f4f('0x3f')](_0x46313a['model'],qs[_0x5f4f('0x41')](_0x5eda45[_0x5f4f('0x3c')][_0x5f4f('0x41')]));_0x365215[_0x5f4f('0x42')]=_0x365215['attributes'][_0x5f4f('0x43')]?_0x365215[_0x5f4f('0x42')]:_0x46313a['model'];if(!_0x5eda45['query']['hasOwnProperty']('nolimit')){_0x365215[_0x5f4f('0x2c')]=qs[_0x5f4f('0x2c')](_0x5eda45[_0x5f4f('0x3c')][_0x5f4f('0x2c')]);_0x365215[_0x5f4f('0x2b')]=qs[_0x5f4f('0x2b')](_0x5eda45['query']['offset']);}_0x365215['order']=qs[_0x5f4f('0x44')](_0x5eda45[_0x5f4f('0x3c')][_0x5f4f('0x44')]);_0x365215[_0x5f4f('0x45')]=qs['filters'](_[_0x5f4f('0x46')](_0x5eda45[_0x5f4f('0x3c')],_0x46313a[_0x5f4f('0x3e')]));if(_0x5eda45[_0x5f4f('0x3c')][_0x5f4f('0x47')]){_0x365215[_0x5f4f('0x45')]=_[_0x5f4f('0x48')](_0x365215['where'],{'$or':_[_0x5f4f('0x37')](_0x4d79cb,function(_0x1225a4){if(_0x1225a4[_0x5f4f('0x3a')]!==_0x5f4f('0x49')){var _0xe339e9={};_0xe339e9[_0x1225a4[_0x5f4f('0x34')]]={'$like':'%'+_0x5eda45[_0x5f4f('0x3c')]['filter']+'%'};return _0xe339e9;}})});}_0x365215=_[_0x5f4f('0x48')]({},_0x365215,_0x5eda45['options']);var _0x1d5eac={'where':_0x365215[_0x5f4f('0x45')]};return db[_0x5f4f('0x38')][_0x5f4f('0x2a')](_0x1d5eac)[_0x5f4f('0x1c')](function(_0x5826d4){_0x2a5a18[_0x5f4f('0x2a')]=_0x5826d4;if(_0x5eda45[_0x5f4f('0x3c')][_0x5f4f('0x4a')]){_0x365215[_0x5f4f('0x4b')]=[{'all':!![]}];}return db[_0x5f4f('0x38')][_0x5f4f('0x4c')](_0x365215);})[_0x5f4f('0x1c')](function(_0x83caa5){_0x2a5a18['rows']=_0x83caa5;return _0x2a5a18;})['then'](respondWithFilteredResult(_0x1e4c3e,_0x365215))[_0x5f4f('0x4d')](handleError(_0x1e4c3e,null));};exports[_0x5f4f('0x4e')]=function(_0x476020,_0xd9c83){var _0x25e0ab={'raw':![],'where':{'id':_0x476020['params']['id']}},_0x3cda72={};_0x3cda72[_0x5f4f('0x40')]=_[_0x5f4f('0x3d')](db[_0x5f4f('0x38')][_0x5f4f('0x39')]);_0x3cda72[_0x5f4f('0x3c')]=_[_0x5f4f('0x3d')](_0x476020['query']);_0x3cda72[_0x5f4f('0x3e')]=_[_0x5f4f('0x3f')](_0x3cda72[_0x5f4f('0x40')],_0x3cda72['query']);_0x25e0ab['attributes']=_[_0x5f4f('0x3f')](_0x3cda72[_0x5f4f('0x40')],qs[_0x5f4f('0x41')](_0x476020[_0x5f4f('0x3c')]['fields']));_0x25e0ab[_0x5f4f('0x42')]=_0x25e0ab['attributes'][_0x5f4f('0x43')]?_0x25e0ab['attributes']:_0x3cda72[_0x5f4f('0x40')];if(_0x476020[_0x5f4f('0x3c')][_0x5f4f('0x4a')]){_0x25e0ab[_0x5f4f('0x4b')]=[{'all':!![]}];}_0x25e0ab=_[_0x5f4f('0x48')]({},_0x25e0ab,_0x476020[_0x5f4f('0x4f')]);return db[_0x5f4f('0x38')][_0x5f4f('0x50')](_0x25e0ab)[_0x5f4f('0x1c')](handleEntityNotFound(_0xd9c83,null))[_0x5f4f('0x1c')](respondWithResult(_0xd9c83,null))[_0x5f4f('0x4d')](handleError(_0xd9c83,null));};exports[_0x5f4f('0x32')]=function(_0x2ead4c,_0x30ee39){if(_0x2ead4c[_0x5f4f('0x51')]['id']){delete _0x2ead4c[_0x5f4f('0x51')]['id'];}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x2ead4c[_0x5f4f('0x52')]['id']}})[_0x5f4f('0x1c')](handleEntityNotFound(_0x30ee39,null))[_0x5f4f('0x1c')](saveUpdates(_0x2ead4c[_0x5f4f('0x51')],null))[_0x5f4f('0x1c')](respondWithResult(_0x30ee39,null))['catch'](handleError(_0x30ee39,null));};exports[_0x5f4f('0x53')]=function(_0x55934a,_0x4e2a14,_0x4a8b96){if(_0x55934a[_0x5f4f('0x54')]&&_0x55934a[_0x5f4f('0x54')][_0x5f4f('0x55')]){_0x55934a[_0x5f4f('0x51')][_0x5f4f('0x56')]=_0x55934a[_0x5f4f('0x54')][_0x5f4f('0x55')];}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x55934a['params']['id']}})[_0x5f4f('0x1c')](handleEntityNotFound(_0x4e2a14,null))['then'](saveUpdates(_0x55934a[_0x5f4f('0x51')],null))['then'](respondWithResult(_0x4e2a14,null))[_0x5f4f('0x4d')](handleError(_0x4e2a14,null));};exports['addLogoLogin']=function(_0xa256fd,_0x28c5e6,_0x228199){if(_0xa256fd['file']&&_0xa256fd[_0x5f4f('0x54')][_0x5f4f('0x55')]){_0xa256fd['body']['loginLogo']=_0xa256fd['file'][_0x5f4f('0x55')];}return db['Setting'][_0x5f4f('0x50')]({'where':{'id':_0xa256fd[_0x5f4f('0x52')]['id']}})[_0x5f4f('0x1c')](handleEntityNotFound(_0x28c5e6,null))[_0x5f4f('0x1c')](saveUpdates(_0xa256fd[_0x5f4f('0x51')],null))[_0x5f4f('0x1c')](respondWithResult(_0x28c5e6,null))[_0x5f4f('0x4d')](handleError(_0x28c5e6,null));};var utilLicense=require(_0x5f4f('0x57'));exports[_0x5f4f('0x58')]=function(_0x593879,_0x20943e,_0x2f2d1b){var _0x3401fd=_0x5f4f('0x59');var _0x219dbe={'custom':![]};return utilLicense[_0x5f4f('0x5a')]()['then'](function(_0x333a31){if(_0x333a31){_0x219dbe=_0x333a31;}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x593879[_0x5f4f('0x52')]['id']},'attributes':['logo',_0x5f4f('0x5b'),_0x5f4f('0x5c'),'favicon',_0x5f4f('0x5d'),_0x5f4f('0x5e'),'defaultPreferred',_0x5f4f('0x5f')],'raw':!![]});})['then'](handleEntityNotFound(_0x20943e,null))[_0x5f4f('0x1c')](function(_0x3936ee){if(_0x3936ee){var _0x483d2c=_0x3936ee['logo']&&fs[_0x5f4f('0x60')](path['join'](config[_0x5f4f('0x61')],_0x3401fd,_[_0x5f4f('0x62')](_0x3936ee[_0x5f4f('0x56')])))?path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x3401fd,_[_0x5f4f('0x62')](_0x3936ee['logo'])):path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x3401fd,_['toLower'](_0x5f4f('0x64')));var _0x2ff4c7=_0x5f4f('0x65')+_['upperFirst'](_0x5f4f('0x56'));if(_0x3936ee[_0x2ff4c7]||!_0x219dbe[_0x5f4f('0x66')]){_0x483d2c=path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x3401fd,_[_0x5f4f('0x62')](_0x5f4f('0x64')));}if(!fs[_0x5f4f('0x60')](_0x483d2c)){throw new db['Sequelize'][(_0x5f4f('0x1a'))](_[_0x5f4f('0x67')](_0x5f4f('0x56'))+_0x5f4f('0x68'));}return _0x20943e['download'](_0x483d2c);}})[_0x5f4f('0x4d')](handleError(_0x20943e,null));};var utilLicense=require(_0x5f4f('0x57'));exports[_0x5f4f('0x69')]=function(_0x2dea1a,_0x314ad9,_0x398877){var _0x5a1cfb=_0x5f4f('0x59');var _0x265cf6={'custom':![]};return utilLicense[_0x5f4f('0x5a')]()[_0x5f4f('0x1c')](function(_0x449454){if(_0x449454){_0x265cf6=_0x449454;}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x2dea1a['params']['id']},'attributes':['logo',_0x5f4f('0x5b'),_0x5f4f('0x5c'),_0x5f4f('0x6a'),_0x5f4f('0x5d'),'defaultLoginLogo','defaultPreferred','defaultFavicon'],'raw':!![]});})[_0x5f4f('0x1c')](handleEntityNotFound(_0x314ad9,null))[_0x5f4f('0x1c')](function(_0x473368){if(_0x473368){var _0x4d2d20=_0x473368[_0x5f4f('0x5b')]&&fs['existsSync'](path[_0x5f4f('0x63')](config['root'],_0x5a1cfb,_['toLower'](_0x473368[_0x5f4f('0x5b')])))?path['join'](config[_0x5f4f('0x61')],_0x5a1cfb,_['toLower'](_0x473368[_0x5f4f('0x5b')])):path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x5a1cfb,_[_0x5f4f('0x62')](_0x5f4f('0x6b')));var _0x12b937='default'+_['upperFirst'](_0x5f4f('0x5b'));if(_0x473368[_0x12b937]||!_0x265cf6['custom']){_0x4d2d20=path['join'](config[_0x5f4f('0x61')],_0x5a1cfb,_[_0x5f4f('0x62')](_0x5f4f('0x6b')));}if(!fs['existsSync'](_0x4d2d20)){throw new db[(_0x5f4f('0x19'))][(_0x5f4f('0x1a'))](_[_0x5f4f('0x67')]('loginLogo')+_0x5f4f('0x68'));}return _0x314ad9[_0x5f4f('0x6c')](_0x4d2d20);}})[_0x5f4f('0x4d')](handleError(_0x314ad9,null));};exports[_0x5f4f('0x6d')]=function(_0x3ba389,_0x20bd95){return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x3ba389['params']['id']},'attributes':[_0x5f4f('0x6e')]})[_0x5f4f('0x1c')](respondWithResult(_0x20bd95,null))[_0x5f4f('0x4d')](handleError(_0x20bd95,null));};exports[_0x5f4f('0x6f')]=function(_0x1b7ba4,_0x2497f5,_0x4cf488){if(_0x1b7ba4['file']&&_0x1b7ba4[_0x5f4f('0x54')][_0x5f4f('0x55')]){_0x1b7ba4['body'][_0x5f4f('0x5c')]=_0x1b7ba4[_0x5f4f('0x54')]['filename'];}return db['Setting'][_0x5f4f('0x50')]({'where':{'id':_0x1b7ba4[_0x5f4f('0x52')]['id']}})['then'](handleEntityNotFound(_0x2497f5,null))[_0x5f4f('0x1c')](saveUpdates(_0x1b7ba4[_0x5f4f('0x51')],null))[_0x5f4f('0x1c')](respondWithResult(_0x2497f5,null))['catch'](handleError(_0x2497f5,null));};var utilLicense=require(_0x5f4f('0x57'));exports[_0x5f4f('0x70')]=function(_0x39d55e,_0x4b64ef,_0x46d6b3){var _0x535686='server/files/images/logos';var _0x407358={'custom':![]};return utilLicense[_0x5f4f('0x5a')]()[_0x5f4f('0x1c')](function(_0x9d9b3b){if(_0x9d9b3b){_0x407358=_0x9d9b3b;}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x39d55e['params']['id']},'attributes':['logo',_0x5f4f('0x5b'),_0x5f4f('0x5c'),_0x5f4f('0x6a'),_0x5f4f('0x5d'),_0x5f4f('0x5e'),_0x5f4f('0x71'),'defaultFavicon'],'raw':!![]});})['then'](handleEntityNotFound(_0x4b64ef,null))[_0x5f4f('0x1c')](function(_0x4a926d){if(_0x4a926d){var _0xcef91a=_0x4a926d[_0x5f4f('0x5c')]&&fs[_0x5f4f('0x60')](path['join'](config[_0x5f4f('0x61')],_0x535686,_['toLower'](_0x4a926d['preferred'])))?path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x535686,_['toLower'](_0x4a926d[_0x5f4f('0x5c')])):path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x535686,_[_0x5f4f('0x62')](_0x5f4f('0x72')));var _0x1c7d2f=_0x5f4f('0x65')+_[_0x5f4f('0x67')](_0x5f4f('0x5c'));if(_0x4a926d[_0x1c7d2f]||!_0x407358[_0x5f4f('0x66')]||!_0x407358[_0x5f4f('0x5c')]){_0xcef91a=path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x535686,_[_0x5f4f('0x62')](_0x5f4f('0x72')));}if(!fs[_0x5f4f('0x60')](_0xcef91a)){throw new db[(_0x5f4f('0x19'))][(_0x5f4f('0x1a'))](_[_0x5f4f('0x67')](_0x5f4f('0x5c'))+'\x20not\x20found');}return _0x4b64ef[_0x5f4f('0x6c')](_0xcef91a);}})['catch'](handleError(_0x4b64ef,null));};exports['addFavicon']=function(_0x31f214,_0x1b61b7,_0x330ae7){if(_0x31f214[_0x5f4f('0x54')]&&_0x31f214[_0x5f4f('0x54')][_0x5f4f('0x55')]){_0x31f214[_0x5f4f('0x51')]['favicon']=_0x31f214[_0x5f4f('0x54')][_0x5f4f('0x55')];}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x31f214[_0x5f4f('0x52')]['id']}})['then'](handleEntityNotFound(_0x1b61b7,null))[_0x5f4f('0x1c')](saveUpdates(_0x31f214['body'],null))[_0x5f4f('0x1c')](respondWithResult(_0x1b61b7,null))[_0x5f4f('0x4d')](handleError(_0x1b61b7,null));};var utilLicense=require(_0x5f4f('0x57'));exports[_0x5f4f('0x73')]=function(_0x1b2b1d,_0x45f4db,_0x159f30){var _0x316b9f='server/files/images/logos';var _0x19b2be={'custom':![]};return utilLicense[_0x5f4f('0x5a')]()[_0x5f4f('0x1c')](function(_0x56a469){if(_0x56a469){_0x19b2be=_0x56a469;}return db[_0x5f4f('0x38')][_0x5f4f('0x50')]({'where':{'id':_0x1b2b1d[_0x5f4f('0x52')]['id']},'attributes':[_0x5f4f('0x56'),_0x5f4f('0x5b'),_0x5f4f('0x5c'),'favicon',_0x5f4f('0x5d'),_0x5f4f('0x5e'),_0x5f4f('0x71'),_0x5f4f('0x5f')],'raw':!![]});})[_0x5f4f('0x1c')](handleEntityNotFound(_0x45f4db,null))['then'](function(_0x5ae6d3){if(_0x5ae6d3){var _0x2aed80=_0x5ae6d3[_0x5f4f('0x6a')]&&fs[_0x5f4f('0x60')](path['join'](config[_0x5f4f('0x61')],_0x316b9f,_['toLower'](_0x5ae6d3['favicon'])))?path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x316b9f,_[_0x5f4f('0x62')](_0x5ae6d3['favicon'])):path[_0x5f4f('0x63')](config[_0x5f4f('0x61')],_0x316b9f,_[_0x5f4f('0x62')](_0x5f4f('0x74')));var _0xdd364=_0x5f4f('0x65')+_[_0x5f4f('0x67')](_0x5f4f('0x6a'));if(_0x5ae6d3[_0xdd364]||!_0x19b2be[_0x5f4f('0x66')]){_0x2aed80=path['join'](config['root'],_0x316b9f,_['toLower']('default_favicon.ico'));}if(!fs[_0x5f4f('0x60')](_0x2aed80)){throw new db[(_0x5f4f('0x19'))][(_0x5f4f('0x1a'))](_['upperFirst']('favicon')+_0x5f4f('0x68'));}return _0x45f4db[_0x5f4f('0x6c')](_0x2aed80);}})[_0x5f4f('0x4d')](handleError(_0x45f4db,null));}; \ No newline at end of file +var _0x1837=['addLogo','file','filename','logo','addLogoLogin','../../config/license/util','server/files/images/logos','getLicense','loginLogo','preferred','favicon','defaultLoginLogo','defaultFavicon','existsSync','join','root','toLower','default_logo.png','upperFirst','custom','download','getLogoLogin','defaultLogo','default_loginLogo.png','default','\x20not\x20found','gdpr','securePassword','addPreferred','defaultPreferred','default_preferred.png','addFavicon','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','then','includeAll','include','show','params','fields','length','find','body'];(function(_0xd19d7f,_0x5ab1bb){var _0x6e2de4=function(_0x2d2b37){while(--_0x2d2b37){_0xd19d7f['push'](_0xd19d7f['shift']());}};_0x6e2de4(++_0x5ab1bb);}(_0x1837,0x184));var _0x7183=function(_0x4f9f11,_0x460e1d){_0x4f9f11=_0x4f9f11-0x0;var _0x5017a5=_0x1837[_0x4f9f11];return _0x5017a5;};'use strict';var pdf=require(_0x7183('0x0'));var emlformat=require(_0x7183('0x1'));var rimraf=require(_0x7183('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7183('0x3'));var rp=require(_0x7183('0x4'));var moment=require(_0x7183('0x5'));var BPromise=require(_0x7183('0x6'));var Mustache=require(_0x7183('0x7'));var util=require(_0x7183('0x8'));var path=require('path');var sox=require(_0x7183('0x9'));var csv=require(_0x7183('0xa'));var ejs=require(_0x7183('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7183('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7183('0xd'));var toCsv=require(_0x7183('0xa'));var querystring=require(_0x7183('0xe'));var Papa=require(_0x7183('0xf'));var Redis=require(_0x7183('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7183('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x7183('0x12'))('api');var utils=require(_0x7183('0x13'));var config=require(_0x7183('0x14'));var db=require(_0x7183('0x15'))['db'];var jayson=require(_0x7183('0x16'));var client=jayson[_0x7183('0x17')][_0x7183('0x18')]({'port':0x232a});function checkPasswordPattern(_0x46ed8e,_0x305277,_0x379f94){if(_0x379f94){var _0x1c4824=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c4824[_0x7183('0x19')](_0x305277)){return _0x46ed8e;}else{throw new db[(_0x7183('0x1a'))][(_0x7183('0x1b'))](_0x7183('0x1c'));}}else{return _0x46ed8e;}}function respondWithRpcPromise(_0x32b0b8,_0x50f5d7,_0x36829a,_0x2d7af7){return new BPromise(function(_0x2688b1,_0x5b9684){var _0x50ab23=_0x2d7af7||client;return _0x50ab23[_0x7183('0x1d')](_0x32b0b8,_0x36829a)['then'](function(_0x9b930e){logger[_0x7183('0x1e')](_0x7183('0x1f'),_0x50f5d7,_0x7183('0x20'));logger[_0x7183('0x21')](_0x7183('0x22'),_0x50f5d7,_0x7183('0x20'),JSON[_0x7183('0x23')](_0x9b930e));if(_0x9b930e[_0x7183('0x24')]){if(_0x9b930e[_0x7183('0x24')]['code']===0x1f4){logger[_0x7183('0x24')](_0x7183('0x1f'),_0x50f5d7,_0x9b930e['error'][_0x7183('0x25')]);return _0x5b9684(_0x9b930e[_0x7183('0x24')]['message']);}logger[_0x7183('0x24')](_0x7183('0x1f'),_0x50f5d7,_0x9b930e[_0x7183('0x24')][_0x7183('0x25')]);return _0x2688b1(_0x9b930e[_0x7183('0x24')][_0x7183('0x25')]);}else{logger[_0x7183('0x1e')]('Setting,\x20%s,\x20%s',_0x50f5d7,_0x7183('0x20'));_0x2688b1(_0x9b930e[_0x7183('0x26')][_0x7183('0x25')]);}})[_0x7183('0x27')](function(_0x1be93d){logger['error'](_0x7183('0x1f'),_0x50f5d7,_0x1be93d);_0x5b9684(_0x1be93d);});});}function respondWithStatusCode(_0x288371,_0x1caed8){_0x1caed8=_0x1caed8||0xcc;return function(_0x520be4){if(_0x520be4){return _0x288371[_0x7183('0x28')](_0x1caed8);}return _0x288371['status'](_0x1caed8)['end']();};}function respondWithResult(_0x5c5694,_0xb6fc74){_0xb6fc74=_0xb6fc74||0xc8;return function(_0x4fbc7f){if(_0x4fbc7f){return _0x5c5694[_0x7183('0x29')](_0xb6fc74)[_0x7183('0x2a')](_0x4fbc7f);}};}function respondWithFilteredResult(_0x116779,_0x38204c){return function(_0x2c5918){if(_0x2c5918){var _0x32a57e=_0x2c5918[_0x7183('0x2b')],_0x15e3f4=_0x38204c[_0x7183('0x2c')],_0x242c9f=_0x38204c[_0x7183('0x2c')]+_0x38204c[_0x7183('0x2d')],_0xb43de0;if(_0x242c9f>=_0x32a57e){_0x242c9f=_0x32a57e;_0xb43de0=0xc8;}else{_0xb43de0=0xce;}_0x116779[_0x7183('0x29')](_0xb43de0);return _0x116779[_0x7183('0x2e')]('Content-Range',_0x15e3f4+'-'+_0x242c9f+'/'+_0x32a57e)['json'](_0x2c5918);}return null;};}function patchUpdates(_0x44bf1a){return function(_0x4d3a6e){try{jsonpatch[_0x7183('0x2f')](_0x4d3a6e,_0x44bf1a,!![]);}catch(_0x5330e2){return BPromise[_0x7183('0x30')](_0x5330e2);}return _0x4d3a6e[_0x7183('0x31')]();};}function saveUpdates(_0x208813,_0x25c6e1){return function(_0x326a6d){if(_0x326a6d){return _0x326a6d[_0x7183('0x32')](_0x208813)['then'](function(_0xb7c3e4){return _0xb7c3e4;});}return null;};}function removeEntity(_0x5e8c94,_0x218e9d){return function(_0x3e65ed){if(_0x3e65ed){return _0x3e65ed['destroy']()['then'](function(){_0x5e8c94[_0x7183('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3587e0,_0x707a16){return function(_0x149ae4){if(!_0x149ae4){_0x3587e0[_0x7183('0x28')](0x194);}return _0x149ae4;};}function handleError(_0x443b10,_0x32dc41){_0x32dc41=_0x32dc41||0x1f4;return function(_0x181785){logger[_0x7183('0x24')](_0x181785[_0x7183('0x33')]);if(_0x181785[_0x7183('0x34')]){delete _0x181785[_0x7183('0x34')];}_0x443b10['status'](_0x32dc41)[_0x7183('0x35')](_0x181785);};}exports['index']=function(_0x864ca7,_0x56ec71){var _0x804597={},_0x8f5af1={},_0x1a638e={'count':0x0,'rows':[]};var _0x295104=_[_0x7183('0x36')](db[_0x7183('0x37')][_0x7183('0x38')],function(_0x4b0cc8){return{'name':_0x4b0cc8[_0x7183('0x39')],'type':_0x4b0cc8[_0x7183('0x3a')][_0x7183('0x3b')]};});_0x8f5af1[_0x7183('0x3c')]=_[_0x7183('0x36')](_0x295104,_0x7183('0x34'));_0x8f5af1[_0x7183('0x3d')]=_[_0x7183('0x3e')](_0x864ca7[_0x7183('0x3d')]);_0x8f5af1[_0x7183('0x3f')]=_['intersection'](_0x8f5af1['model'],_0x8f5af1[_0x7183('0x3d')]);_0x804597[_0x7183('0x40')]=_[_0x7183('0x41')](_0x8f5af1[_0x7183('0x3c')],qs['fields'](_0x864ca7['query']['fields']));_0x804597[_0x7183('0x40')]=_0x804597[_0x7183('0x40')]['length']?_0x804597['attributes']:_0x8f5af1[_0x7183('0x3c')];if(!_0x864ca7[_0x7183('0x3d')][_0x7183('0x42')]('nolimit')){_0x804597['limit']=qs[_0x7183('0x2d')](_0x864ca7[_0x7183('0x3d')][_0x7183('0x2d')]);_0x804597['offset']=qs[_0x7183('0x2c')](_0x864ca7[_0x7183('0x3d')][_0x7183('0x2c')]);}_0x804597[_0x7183('0x43')]=qs[_0x7183('0x44')](_0x864ca7[_0x7183('0x3d')][_0x7183('0x44')]);_0x804597[_0x7183('0x45')]=qs['filters'](_[_0x7183('0x46')](_0x864ca7[_0x7183('0x3d')],_0x8f5af1[_0x7183('0x3f')]));if(_0x864ca7[_0x7183('0x3d')][_0x7183('0x47')]){_0x804597[_0x7183('0x45')]=_[_0x7183('0x48')](_0x804597[_0x7183('0x45')],{'$or':_[_0x7183('0x36')](_0x295104,function(_0x39d559){if(_0x39d559[_0x7183('0x3a')]!==_0x7183('0x49')){var _0x3fa8c0={};_0x3fa8c0[_0x39d559[_0x7183('0x34')]]={'$like':'%'+_0x864ca7['query'][_0x7183('0x47')]+'%'};return _0x3fa8c0;}})});}_0x804597=_[_0x7183('0x48')]({},_0x804597,_0x864ca7[_0x7183('0x4a')]);var _0x272569={'where':_0x804597[_0x7183('0x45')]};return db['Setting']['count'](_0x272569)[_0x7183('0x4b')](function(_0x3077b8){_0x1a638e[_0x7183('0x2b')]=_0x3077b8;if(_0x864ca7[_0x7183('0x3d')][_0x7183('0x4c')]){_0x804597[_0x7183('0x4d')]=[{'all':!![]}];}return db[_0x7183('0x37')]['findAll'](_0x804597);})['then'](function(_0x39ea3){_0x1a638e['rows']=_0x39ea3;return _0x1a638e;})[_0x7183('0x4b')](respondWithFilteredResult(_0x56ec71,_0x804597))[_0x7183('0x27')](handleError(_0x56ec71,null));};exports[_0x7183('0x4e')]=function(_0x30ac51,_0xb7cfcb){var _0x1aa447={'raw':![],'where':{'id':_0x30ac51[_0x7183('0x4f')]['id']}},_0x8fb05b={};_0x8fb05b[_0x7183('0x3c')]=_[_0x7183('0x3e')](db[_0x7183('0x37')][_0x7183('0x38')]);_0x8fb05b[_0x7183('0x3d')]=_[_0x7183('0x3e')](_0x30ac51[_0x7183('0x3d')]);_0x8fb05b[_0x7183('0x3f')]=_['intersection'](_0x8fb05b[_0x7183('0x3c')],_0x8fb05b[_0x7183('0x3d')]);_0x1aa447[_0x7183('0x40')]=_[_0x7183('0x41')](_0x8fb05b[_0x7183('0x3c')],qs[_0x7183('0x50')](_0x30ac51[_0x7183('0x3d')][_0x7183('0x50')]));_0x1aa447['attributes']=_0x1aa447[_0x7183('0x40')][_0x7183('0x51')]?_0x1aa447[_0x7183('0x40')]:_0x8fb05b[_0x7183('0x3c')];if(_0x30ac51[_0x7183('0x3d')]['includeAll']){_0x1aa447[_0x7183('0x4d')]=[{'all':!![]}];}_0x1aa447=_['merge']({},_0x1aa447,_0x30ac51['options']);return db['Setting'][_0x7183('0x52')](_0x1aa447)['then'](handleEntityNotFound(_0xb7cfcb,null))[_0x7183('0x4b')](respondWithResult(_0xb7cfcb,null))[_0x7183('0x27')](handleError(_0xb7cfcb,null));};exports[_0x7183('0x32')]=function(_0x38c9d2,_0x593cfe){if(_0x38c9d2[_0x7183('0x53')]['id']){delete _0x38c9d2[_0x7183('0x53')]['id'];}return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0x38c9d2[_0x7183('0x4f')]['id']}})[_0x7183('0x4b')](handleEntityNotFound(_0x593cfe,null))[_0x7183('0x4b')](saveUpdates(_0x38c9d2[_0x7183('0x53')],null))['then'](respondWithResult(_0x593cfe,null))[_0x7183('0x27')](handleError(_0x593cfe,null));};exports[_0x7183('0x54')]=function(_0x48ffd6,_0x4ccada,_0x2a9574){if(_0x48ffd6[_0x7183('0x55')]&&_0x48ffd6[_0x7183('0x55')][_0x7183('0x56')]){_0x48ffd6['body'][_0x7183('0x57')]=_0x48ffd6[_0x7183('0x55')]['filename'];}return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0x48ffd6[_0x7183('0x4f')]['id']}})[_0x7183('0x4b')](handleEntityNotFound(_0x4ccada,null))['then'](saveUpdates(_0x48ffd6[_0x7183('0x53')],null))[_0x7183('0x4b')](respondWithResult(_0x4ccada,null))[_0x7183('0x27')](handleError(_0x4ccada,null));};exports[_0x7183('0x58')]=function(_0x2a0229,_0x38a233,_0x42aab4){if(_0x2a0229['file']&&_0x2a0229['file'][_0x7183('0x56')]){_0x2a0229[_0x7183('0x53')]['loginLogo']=_0x2a0229[_0x7183('0x55')][_0x7183('0x56')];}return db['Setting']['find']({'where':{'id':_0x2a0229['params']['id']}})['then'](handleEntityNotFound(_0x38a233,null))[_0x7183('0x4b')](saveUpdates(_0x2a0229[_0x7183('0x53')],null))[_0x7183('0x4b')](respondWithResult(_0x38a233,null))[_0x7183('0x27')](handleError(_0x38a233,null));};var utilLicense=require(_0x7183('0x59'));exports['getLogo']=function(_0xa28c3b,_0x3510a2,_0x22b8e7){var _0x90c6f5=_0x7183('0x5a');var _0xb86d3b={'custom':![]};return utilLicense[_0x7183('0x5b')]()[_0x7183('0x4b')](function(_0x45058a){if(_0x45058a){_0xb86d3b=_0x45058a;}return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0xa28c3b[_0x7183('0x4f')]['id']},'attributes':[_0x7183('0x57'),_0x7183('0x5c'),_0x7183('0x5d'),_0x7183('0x5e'),'defaultLogo',_0x7183('0x5f'),'defaultPreferred',_0x7183('0x60')],'raw':!![]});})[_0x7183('0x4b')](handleEntityNotFound(_0x3510a2,null))[_0x7183('0x4b')](function(_0x40f741){if(_0x40f741){var _0x178eca=_0x40f741['logo']&&fs[_0x7183('0x61')](path[_0x7183('0x62')](config[_0x7183('0x63')],_0x90c6f5,_[_0x7183('0x64')](_0x40f741[_0x7183('0x57')])))?path[_0x7183('0x62')](config[_0x7183('0x63')],_0x90c6f5,_[_0x7183('0x64')](_0x40f741[_0x7183('0x57')])):path['join'](config[_0x7183('0x63')],_0x90c6f5,_[_0x7183('0x64')](_0x7183('0x65')));var _0x56764d='default'+_[_0x7183('0x66')](_0x7183('0x57'));if(_0x40f741[_0x56764d]||!_0xb86d3b[_0x7183('0x67')]){_0x178eca=path['join'](config[_0x7183('0x63')],_0x90c6f5,_['toLower'](_0x7183('0x65')));}if(!fs[_0x7183('0x61')](_0x178eca)){throw new db[(_0x7183('0x1a'))][(_0x7183('0x1b'))](_[_0x7183('0x66')](_0x7183('0x57'))+'\x20not\x20found');}return _0x3510a2[_0x7183('0x68')](_0x178eca);}})[_0x7183('0x27')](handleError(_0x3510a2,null));};var utilLicense=require(_0x7183('0x59'));exports[_0x7183('0x69')]=function(_0x426ed8,_0x39e231,_0x7bd3ec){var _0x160cb7='server/files/images/logos';var _0x15e2f6={'custom':![]};return utilLicense[_0x7183('0x5b')]()['then'](function(_0x1bafc5){if(_0x1bafc5){_0x15e2f6=_0x1bafc5;}return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0x426ed8[_0x7183('0x4f')]['id']},'attributes':[_0x7183('0x57'),_0x7183('0x5c'),_0x7183('0x5d'),'favicon',_0x7183('0x6a'),_0x7183('0x5f'),'defaultPreferred',_0x7183('0x60')],'raw':!![]});})[_0x7183('0x4b')](handleEntityNotFound(_0x39e231,null))[_0x7183('0x4b')](function(_0x179487){if(_0x179487){var _0x547bf4=_0x179487[_0x7183('0x5c')]&&fs['existsSync'](path['join'](config['root'],_0x160cb7,_[_0x7183('0x64')](_0x179487[_0x7183('0x5c')])))?path[_0x7183('0x62')](config[_0x7183('0x63')],_0x160cb7,_[_0x7183('0x64')](_0x179487['loginLogo'])):path[_0x7183('0x62')](config[_0x7183('0x63')],_0x160cb7,_[_0x7183('0x64')](_0x7183('0x6b')));var _0x1d2c6f=_0x7183('0x6c')+_['upperFirst']('loginLogo');if(_0x179487[_0x1d2c6f]||!_0x15e2f6['custom']){_0x547bf4=path[_0x7183('0x62')](config[_0x7183('0x63')],_0x160cb7,_[_0x7183('0x64')](_0x7183('0x6b')));}if(!fs[_0x7183('0x61')](_0x547bf4)){throw new db['Sequelize'][(_0x7183('0x1b'))](_[_0x7183('0x66')](_0x7183('0x5c'))+_0x7183('0x6d'));}return _0x39e231['download'](_0x547bf4);}})[_0x7183('0x27')](handleError(_0x39e231,null));};exports[_0x7183('0x6e')]=function(_0x533de7,_0x1e086f){return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0x533de7[_0x7183('0x4f')]['id']},'attributes':[_0x7183('0x6f')]})[_0x7183('0x4b')](respondWithResult(_0x1e086f,null))['catch'](handleError(_0x1e086f,null));};exports[_0x7183('0x70')]=function(_0x188c0c,_0x56fc9c,_0x56bd8b){if(_0x188c0c[_0x7183('0x55')]&&_0x188c0c[_0x7183('0x55')][_0x7183('0x56')]){_0x188c0c[_0x7183('0x53')][_0x7183('0x5d')]=_0x188c0c[_0x7183('0x55')]['filename'];}return db[_0x7183('0x37')]['find']({'where':{'id':_0x188c0c[_0x7183('0x4f')]['id']}})[_0x7183('0x4b')](handleEntityNotFound(_0x56fc9c,null))[_0x7183('0x4b')](saveUpdates(_0x188c0c[_0x7183('0x53')],null))['then'](respondWithResult(_0x56fc9c,null))['catch'](handleError(_0x56fc9c,null));};var utilLicense=require(_0x7183('0x59'));exports['getPreferred']=function(_0x2094a3,_0x457f2b,_0x9d4019){var _0xd9c6ad=_0x7183('0x5a');var _0x2f7327={'custom':![]};return utilLicense['getLicense']()[_0x7183('0x4b')](function(_0x285592){if(_0x285592){_0x2f7327=_0x285592;}return db[_0x7183('0x37')][_0x7183('0x52')]({'where':{'id':_0x2094a3[_0x7183('0x4f')]['id']},'attributes':[_0x7183('0x57'),_0x7183('0x5c'),_0x7183('0x5d'),_0x7183('0x5e'),_0x7183('0x6a'),'defaultLoginLogo',_0x7183('0x71'),_0x7183('0x60')],'raw':!![]});})[_0x7183('0x4b')](handleEntityNotFound(_0x457f2b,null))[_0x7183('0x4b')](function(_0x4731c6){if(_0x4731c6){var _0xc516d4=_0x4731c6[_0x7183('0x5d')]&&fs['existsSync'](path['join'](config[_0x7183('0x63')],_0xd9c6ad,_['toLower'](_0x4731c6[_0x7183('0x5d')])))?path['join'](config[_0x7183('0x63')],_0xd9c6ad,_[_0x7183('0x64')](_0x4731c6[_0x7183('0x5d')])):path[_0x7183('0x62')](config[_0x7183('0x63')],_0xd9c6ad,_[_0x7183('0x64')](_0x7183('0x72')));var _0x30efcd=_0x7183('0x6c')+_[_0x7183('0x66')]('preferred');if(_0x4731c6[_0x30efcd]||!_0x2f7327['custom']||!_0x2f7327[_0x7183('0x5d')]){_0xc516d4=path[_0x7183('0x62')](config['root'],_0xd9c6ad,_[_0x7183('0x64')](_0x7183('0x72')));}if(!fs['existsSync'](_0xc516d4)){throw new db['Sequelize'][(_0x7183('0x1b'))](_[_0x7183('0x66')]('preferred')+_0x7183('0x6d'));}return _0x457f2b['download'](_0xc516d4);}})[_0x7183('0x27')](handleError(_0x457f2b,null));};exports[_0x7183('0x73')]=function(_0x439265,_0x4f7a4d,_0x265458){if(_0x439265[_0x7183('0x55')]&&_0x439265[_0x7183('0x55')][_0x7183('0x56')]){_0x439265['body'][_0x7183('0x5e')]=_0x439265[_0x7183('0x55')][_0x7183('0x56')];}return db['Setting'][_0x7183('0x52')]({'where':{'id':_0x439265[_0x7183('0x4f')]['id']}})['then'](handleEntityNotFound(_0x4f7a4d,null))[_0x7183('0x4b')](saveUpdates(_0x439265[_0x7183('0x53')],null))[_0x7183('0x4b')](respondWithResult(_0x4f7a4d,null))[_0x7183('0x27')](handleError(_0x4f7a4d,null));};var utilLicense=require(_0x7183('0x59'));exports[_0x7183('0x74')]=function(_0x1d6204,_0x165900,_0x5a1e18){var _0x3695f5=_0x7183('0x5a');var _0x31cd92={'custom':![]};return utilLicense[_0x7183('0x5b')]()[_0x7183('0x4b')](function(_0x985127){if(_0x985127){_0x31cd92=_0x985127;}return db[_0x7183('0x37')]['find']({'where':{'id':_0x1d6204[_0x7183('0x4f')]['id']},'attributes':[_0x7183('0x57'),_0x7183('0x5c'),_0x7183('0x5d'),_0x7183('0x5e'),_0x7183('0x6a'),'defaultLoginLogo',_0x7183('0x71'),_0x7183('0x60')],'raw':!![]});})[_0x7183('0x4b')](handleEntityNotFound(_0x165900,null))[_0x7183('0x4b')](function(_0x2b09be){if(_0x2b09be){var _0x36a2f9=_0x2b09be[_0x7183('0x5e')]&&fs[_0x7183('0x61')](path['join'](config[_0x7183('0x63')],_0x3695f5,_[_0x7183('0x64')](_0x2b09be[_0x7183('0x5e')])))?path[_0x7183('0x62')](config[_0x7183('0x63')],_0x3695f5,_['toLower'](_0x2b09be[_0x7183('0x5e')])):path[_0x7183('0x62')](config[_0x7183('0x63')],_0x3695f5,_['toLower'](_0x7183('0x75')));var _0x4a2ea1=_0x7183('0x6c')+_[_0x7183('0x66')](_0x7183('0x5e'));if(_0x2b09be[_0x4a2ea1]||!_0x31cd92[_0x7183('0x67')]){_0x36a2f9=path['join'](config[_0x7183('0x63')],_0x3695f5,_['toLower'](_0x7183('0x75')));}if(!fs['existsSync'](_0x36a2f9)){throw new db[(_0x7183('0x1a'))][(_0x7183('0x1b'))](_['upperFirst'](_0x7183('0x5e'))+_0x7183('0x6d'));}return _0x165900[_0x7183('0x68')](_0x36a2f9);}})[_0x7183('0x27')](handleError(_0x165900,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 5c01515..1454f68 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 _0x321e=['rimraf','../../config/environment','./setting.attributes','exports','define','Setting','settings','lodash','util','../../config/logger','api','moment','request-promise','path'];(function(_0x4b5b9b,_0x3e214f){var _0x49f352=function(_0x45aea4){while(--_0x45aea4){_0x4b5b9b['push'](_0x4b5b9b['shift']());}};_0x49f352(++_0x3e214f);}(_0x321e,0x1ab));var _0xe321=function(_0x14d9ad,_0x4e4586){_0x14d9ad=_0x14d9ad-0x0;var _0x946ac9=_0x321e[_0x14d9ad];return _0x946ac9;};'use strict';var _=require(_0xe321('0x0'));var util=require(_0xe321('0x1'));var logger=require(_0xe321('0x2'))(_0xe321('0x3'));var moment=require(_0xe321('0x4'));var BPromise=require('bluebird');var rp=require(_0xe321('0x5'));var fs=require('fs');var path=require(_0xe321('0x6'));var rimraf=require(_0xe321('0x7'));var config=require(_0xe321('0x8'));var attributes=require(_0xe321('0x9'));module[_0xe321('0xa')]=function(_0x20ec1f,_0x4f2b88){return _0x20ec1f[_0xe321('0xb')](_0xe321('0xc'),attributes,{'tableName':_0xe321('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac0c=['moment','bluebird','request-promise','rimraf','../../config/environment','./setting.attributes','define','Setting','settings','lodash','util','../../config/logger'];(function(_0x348eb5,_0x3bac32){var _0x420a57=function(_0x2ee44d){while(--_0x2ee44d){_0x348eb5['push'](_0x348eb5['shift']());}};_0x420a57(++_0x3bac32);}(_0xac0c,0x11d));var _0xcac0=function(_0x4f49ad,_0x2961f1){_0x4f49ad=_0x4f49ad-0x0;var _0x6426dc=_0xac0c[_0x4f49ad];return _0x6426dc;};'use strict';var _=require(_0xcac0('0x0'));var util=require(_0xcac0('0x1'));var logger=require(_0xcac0('0x2'))('api');var moment=require(_0xcac0('0x3'));var BPromise=require(_0xcac0('0x4'));var rp=require(_0xcac0('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcac0('0x6'));var config=require(_0xcac0('0x7'));var attributes=require(_0xcac0('0x8'));module['exports']=function(_0x540936,_0x476803){return _0x540936[_0xcac0('0x9')](_0xcac0('0xa'),attributes,{'tableName':_0xcac0('0xb'),'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 4ce1a6c..d3d8df5 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 _0x9e5d=['code','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Setting,\x20%s,\x20%s','debug','Setting,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x466b4b,_0x58f0f8){var _0x2d8af4=function(_0x4124e9){while(--_0x4124e9){_0x466b4b['push'](_0x466b4b['shift']());}};_0x2d8af4(++_0x58f0f8);}(_0x9e5d,0x75));var _0xd9e5=function(_0x2e4aa2,_0x11956a){_0x2e4aa2=_0x2e4aa2-0x0;var _0x5e6092=_0x9e5d[_0x2e4aa2];return _0x5e6092;};'use strict';var _=require(_0xd9e5('0x0'));var util=require(_0xd9e5('0x1'));var moment=require(_0xd9e5('0x2'));var BPromise=require(_0xd9e5('0x3'));var rs=require(_0xd9e5('0x4'));var fs=require('fs');var Redis=require(_0xd9e5('0x5'));var db=require(_0xd9e5('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9e5('0x7'))(_0xd9e5('0x8'));var config=require(_0xd9e5('0x9'));var jayson=require(_0xd9e5('0xa'));var client=jayson[_0xd9e5('0xb')][_0xd9e5('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5ce205,_0x309217,_0x5e8847){return new BPromise(function(_0x4b40bd,_0x5a7863){return client[_0xd9e5('0xd')](_0x5ce205,_0x5e8847)[_0xd9e5('0xe')](function(_0x3160da){logger[_0xd9e5('0xf')](_0xd9e5('0x10'),_0x309217,'request\x20sent');logger[_0xd9e5('0x11')](_0xd9e5('0x12'),_0x309217,_0xd9e5('0x13'),JSON['stringify'](_0x3160da));if(_0x3160da[_0xd9e5('0x14')]){if(_0x3160da[_0xd9e5('0x14')][_0xd9e5('0x15')]===0x1f4){logger[_0xd9e5('0x14')]('Setting,\x20%s,\x20%s',_0x309217,_0x3160da[_0xd9e5('0x14')][_0xd9e5('0x16')]);return _0x5a7863(_0x3160da[_0xd9e5('0x14')][_0xd9e5('0x16')]);}logger[_0xd9e5('0x14')](_0xd9e5('0x10'),_0x309217,_0x3160da['error'][_0xd9e5('0x16')]);return _0x4b40bd(_0x3160da[_0xd9e5('0x14')]['message']);}else{logger[_0xd9e5('0xf')](_0xd9e5('0x10'),_0x309217,'request\x20sent');_0x4b40bd(_0x3160da['result'][_0xd9e5('0x16')]);}})['catch'](function(_0x3e1dfd){logger[_0xd9e5('0x14')](_0xd9e5('0x10'),_0x309217,_0x3e1dfd);_0x5a7863(_0x3e1dfd);});});} \ No newline at end of file +var _0x12ec=['request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','then','info','Setting,\x20%s,\x20%s'];(function(_0x3793a4,_0x18871a){var _0x2ab94f=function(_0x311ee3){while(--_0x311ee3){_0x3793a4['push'](_0x3793a4['shift']());}};_0x2ab94f(++_0x18871a);}(_0x12ec,0x11d));var _0xc12e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x12ec[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0xc12e('0x0'));var util=require(_0xc12e('0x1'));var moment=require(_0xc12e('0x2'));var BPromise=require(_0xc12e('0x3'));var rs=require(_0xc12e('0x4'));var fs=require('fs');var Redis=require(_0xc12e('0x5'));var db=require(_0xc12e('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc12e('0x7'));var config=require(_0xc12e('0x8'));var jayson=require(_0xc12e('0x9'));var client=jayson[_0xc12e('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x975667,_0x5e2904,_0x12d84f){return new BPromise(function(_0x3533a7,_0x31380b){return client['request'](_0x975667,_0x12d84f)[_0xc12e('0xb')](function(_0x1ef734){logger[_0xc12e('0xc')](_0xc12e('0xd'),_0x5e2904,_0xc12e('0xe'));logger[_0xc12e('0xf')](_0xc12e('0x10'),_0x5e2904,'request\x20sent',JSON[_0xc12e('0x11')](_0x1ef734));if(_0x1ef734[_0xc12e('0x12')]){if(_0x1ef734[_0xc12e('0x12')][_0xc12e('0x13')]===0x1f4){logger['error'](_0xc12e('0xd'),_0x5e2904,_0x1ef734['error'][_0xc12e('0x14')]);return _0x31380b(_0x1ef734[_0xc12e('0x12')][_0xc12e('0x14')]);}logger[_0xc12e('0x12')](_0xc12e('0xd'),_0x5e2904,_0x1ef734[_0xc12e('0x12')][_0xc12e('0x14')]);return _0x3533a7(_0x1ef734[_0xc12e('0x12')]['message']);}else{logger[_0xc12e('0xc')]('Setting,\x20%s,\x20%s',_0x5e2904,'request\x20sent');_0x3533a7(_0x1ef734[_0xc12e('0x15')]['message']);}})[_0xc12e('0x16')](function(_0x3e6af6){logger['error']('Setting,\x20%s,\x20%s',_0x5e2904,_0x3e6af6);_0x31380b(_0x3e6af6);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index ad7057e..2efea65 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 _0x33b7=['get','isAuthenticated','/:id','show','/:id/dispositions','getDispositions','/:id/applications','getInteractions','statusGet','create','addDisposition','post','addAnswer','/:id/notify','notify','addApplications','/:id/send','send','/:id/users','put','delete','destroy','removeDispositions','/:id/canned_answers','removeAnswers','removeAgents','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsAccount.controller'];(function(_0x517080,_0x1d405e){var _0x39df23=function(_0x285701){while(--_0x285701){_0x517080['push'](_0x517080['shift']());}};_0x39df23(++_0x1d405e);}(_0x33b7,0xf3));var _0x733b=function(_0x1c546c,_0x5c57cb){_0x1c546c=_0x1c546c-0x0;var _0x2cc384=_0x33b7[_0x1c546c];return _0x2cc384;};'use strict';var multer=require(_0x733b('0x0'));var util=require(_0x733b('0x1'));var path=require('path');var timeout=require(_0x733b('0x2'));var express=require(_0x733b('0x3'));var router=express[_0x733b('0x4')]();var auth=require(_0x733b('0x5'));var interaction=require(_0x733b('0x6'));var config=require(_0x733b('0x7'));var controller=require(_0x733b('0x8'));router[_0x733b('0x9')]('/',auth[_0x733b('0xa')](),controller['index']);router[_0x733b('0x9')]('/describe',auth['isAuthenticated'](),controller['describe']);router[_0x733b('0x9')](_0x733b('0xb'),auth[_0x733b('0xa')](),controller[_0x733b('0xc')]);router[_0x733b('0x9')](_0x733b('0xd'),auth[_0x733b('0xa')](),controller[_0x733b('0xe')]);router[_0x733b('0x9')]('/:id/canned_answers',auth[_0x733b('0xa')](),controller['getAnswers']);router[_0x733b('0x9')](_0x733b('0xf'),auth['isAuthenticated'](),controller['getApplications']);router['get']('/:id/interactions',auth[_0x733b('0xa')](),controller[_0x733b('0x10')]);router[_0x733b('0x9')]('/:id/status',controller[_0x733b('0x11')]);router[_0x733b('0x9')]('/:id/users',auth[_0x733b('0xa')](),controller['getAgents']);router['post']('/',auth[_0x733b('0xa')](),controller[_0x733b('0x12')]);router['post'](_0x733b('0xd'),auth[_0x733b('0xa')](),controller[_0x733b('0x13')]);router[_0x733b('0x14')]('/:id/canned_answers',auth[_0x733b('0xa')](),controller[_0x733b('0x15')]);router['post'](_0x733b('0x16'),controller[_0x733b('0x17')]);router[_0x733b('0x14')](_0x733b('0xf'),auth[_0x733b('0xa')](),controller[_0x733b('0x18')]);router[_0x733b('0x14')](_0x733b('0x19'),auth[_0x733b('0xa')](),controller[_0x733b('0x1a')]);router[_0x733b('0x14')]('/:id/status',controller['status']);router['post'](_0x733b('0x1b'),auth['isAuthenticated'](),controller['addAgents']);router[_0x733b('0x1c')](_0x733b('0xb'),auth[_0x733b('0xa')](),controller['update']);router[_0x733b('0x1d')](_0x733b('0xb'),auth['isAuthenticated'](),controller[_0x733b('0x1e')]);router[_0x733b('0x1d')](_0x733b('0xd'),auth[_0x733b('0xa')](),controller[_0x733b('0x1f')]);router[_0x733b('0x1d')](_0x733b('0x20'),auth['isAuthenticated'](),controller[_0x733b('0x21')]);router[_0x733b('0x1d')](_0x733b('0x1b'),auth[_0x733b('0xa')](),controller[_0x733b('0x22')]);module[_0x733b('0x23')]=router; \ No newline at end of file +var _0x5ad7=['notify','addApplications','send','status','/:id/users','put','/:id','update','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','get','isAuthenticated','/describe','describe','show','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','statusGet','getAgents','post','create','addDisposition','/:id/notify'];(function(_0x54f287,_0x38f40d){var _0x420491=function(_0x78211c){while(--_0x78211c){_0x54f287['push'](_0x54f287['shift']());}};_0x420491(++_0x38f40d);}(_0x5ad7,0xbb));var _0x75ad=function(_0x5c9103,_0x87af24){_0x5c9103=_0x5c9103-0x0;var _0x561e82=_0x5ad7[_0x5c9103];return _0x561e82;};'use strict';var multer=require('multer');var util=require(_0x75ad('0x0'));var path=require(_0x75ad('0x1'));var timeout=require(_0x75ad('0x2'));var express=require(_0x75ad('0x3'));var router=express[_0x75ad('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./smsAccount.controller');router[_0x75ad('0x5')]('/',auth[_0x75ad('0x6')](),controller['index']);router[_0x75ad('0x5')](_0x75ad('0x7'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x8')]);router[_0x75ad('0x5')]('/:id',auth[_0x75ad('0x6')](),controller[_0x75ad('0x9')]);router[_0x75ad('0x5')](_0x75ad('0xa'),auth[_0x75ad('0x6')](),controller['getDispositions']);router[_0x75ad('0x5')](_0x75ad('0xb'),auth[_0x75ad('0x6')](),controller[_0x75ad('0xc')]);router[_0x75ad('0x5')](_0x75ad('0xd'),auth[_0x75ad('0x6')](),controller[_0x75ad('0xe')]);router[_0x75ad('0x5')](_0x75ad('0xf'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x10')]);router['get']('/:id/status',controller[_0x75ad('0x11')]);router[_0x75ad('0x5')]('/:id/users',auth[_0x75ad('0x6')](),controller[_0x75ad('0x12')]);router[_0x75ad('0x13')]('/',auth[_0x75ad('0x6')](),controller[_0x75ad('0x14')]);router['post']('/:id/dispositions',auth[_0x75ad('0x6')](),controller[_0x75ad('0x15')]);router['post']('/:id/canned_answers',auth[_0x75ad('0x6')](),controller['addAnswer']);router[_0x75ad('0x13')](_0x75ad('0x16'),controller[_0x75ad('0x17')]);router[_0x75ad('0x13')](_0x75ad('0xd'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x18')]);router['post']('/:id/send',auth['isAuthenticated'](),controller[_0x75ad('0x19')]);router[_0x75ad('0x13')]('/:id/status',controller[_0x75ad('0x1a')]);router[_0x75ad('0x13')](_0x75ad('0x1b'),auth[_0x75ad('0x6')](),controller['addAgents']);router[_0x75ad('0x1c')](_0x75ad('0x1d'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x1e')]);router[_0x75ad('0x1f')](_0x75ad('0x1d'),auth[_0x75ad('0x6')](),controller['destroy']);router['delete'](_0x75ad('0xa'),auth[_0x75ad('0x6')](),controller['removeDispositions']);router[_0x75ad('0x1f')](_0x75ad('0xb'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x20')]);router[_0x75ad('0x1f')](_0x75ad('0x1b'),auth[_0x75ad('0x6')](),controller[_0x75ad('0x21')]);module[_0x75ad('0x22')]=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index edb099b..d277160 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 _0xce57=['randomstring','exports','STRING','name','generate','skebby','connectel','plivo','clickatell','csc','infobip','intelepeer','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','sequelize'];(function(_0x32bafa,_0x1fc6c6){var _0x567691=function(_0x2e75be){while(--_0x2e75be){_0x32bafa['push'](_0x32bafa['shift']());}};_0x567691(++_0x1fc6c6);}(_0xce57,0xdb));var _0x7ce5=function(_0xd299c3,_0x4ba0f1){_0xd299c3=_0xd299c3-0x0;var _0x376574=_0xce57[_0xd299c3];return _0x376574;};'use strict';var Sequelize=require(_0x7ce5('0x0'));var rs=require(_0x7ce5('0x1'));module[_0x7ce5('0x2')]={'name':{'type':Sequelize[_0x7ce5('0x3')],'unique':_0x7ce5('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0x7ce5('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0x7ce5('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0x7ce5('0x3')],'defaultValue':function(){return rs[_0x7ce5('0x5')]();}},'phone':{'type':Sequelize[_0x7ce5('0x3')]},'type':{'type':Sequelize['ENUM']('twilio',_0x7ce5('0x6'),_0x7ce5('0x7'),'clicksend',_0x7ce5('0x8'),_0x7ce5('0x9'),_0x7ce5('0xa'),_0x7ce5('0xb'),_0x7ce5('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize[_0x7ce5('0x3')]},'authToken':{'type':Sequelize[_0x7ce5('0x3')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0x7ce5('0x3')]},'senderString':{'type':Sequelize[_0x7ce5('0x3')]},'deliveryReport':{'type':Sequelize[_0x7ce5('0xd')],'defaultValue':![]},'description':{'type':Sequelize['STRING']},'notificationTemplate':{'type':Sequelize[_0x7ce5('0xe')],'defaultValue':function(){return _0x7ce5('0xf');}},'notificationSound':{'type':Sequelize[_0x7ce5('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7ce5('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7ce5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x7ce5('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x7ce5('0x11')},'mandatoryDisposition':{'type':Sequelize[_0x7ce5('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xa8bffd){if(!_0xa8bffd)this[_0x7ce5('0x12')](_0x7ce5('0x13'),null);this[_0x7ce5('0x12')]('mandatoryDisposition',_0xa8bffd);}}}; \ No newline at end of file +var _0xb44a=['clicksend','plivo','clickatell','infobip','intelepeer','BOOLEAN','TEXT','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','STRING','name','generate','ENUM','twilio','connectel'];(function(_0x16fb9c,_0x4b2323){var _0x765bfe=function(_0x36057b){while(--_0x36057b){_0x16fb9c['push'](_0x16fb9c['shift']());}};_0x765bfe(++_0x4b2323);}(_0xb44a,0xc0));var _0xab44=function(_0x11e05d,_0x3a4491){_0x11e05d=_0x11e05d-0x0;var _0x335588=_0xb44a[_0x11e05d];return _0x335588;};'use strict';var Sequelize=require(_0xab44('0x0'));var rs=require(_0xab44('0x1'));module['exports']={'name':{'type':Sequelize[_0xab44('0x2')],'unique':_0xab44('0x3'),'allowNull':![]},'key':{'type':Sequelize[_0xab44('0x2')],'allowNull':![]},'remote':{'type':Sequelize[_0xab44('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs[_0xab44('0x4')]();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xab44('0x5')](_0xab44('0x6'),'skebby',_0xab44('0x7'),_0xab44('0x8'),_0xab44('0x9'),_0xab44('0xa'),'csc',_0xab44('0xb'),_0xab44('0xc'))},'accountSid':{'type':Sequelize[_0xab44('0x2')]},'authId':{'type':Sequelize[_0xab44('0x2')]},'authToken':{'type':Sequelize['STRING']},'smsMethod':{'type':Sequelize[_0xab44('0x5')]('SI','TI','GP')},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xab44('0x2')]},'senderString':{'type':Sequelize[_0xab44('0x2')]},'deliveryReport':{'type':Sequelize[_0xab44('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xab44('0x2')]},'notificationTemplate':{'type':Sequelize[_0xab44('0xe')],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xab44('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xab44('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xab44('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0xab44('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0xab44('0xf')],'comment':_0xab44('0x10')},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x408b0d){if(!_0x408b0d)this[_0xab44('0x11')](_0xab44('0x12'),null);this[_0xab44('0x11')](_0xab44('0x13'),_0x408b0d);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index 73cd2c1..6f0503b 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 _0x7096=['bulkCreate','getApplications','order','getInteractions','Contact','fullname','Tag','Tags','color','tag','send','to\x20is\x20mandatory','List','spread','dataValues','Messages','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','clicksend','status_code','groupName','DELIVERED','connectel','error_code','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','statusGet','message-id','state','addAgents','omit','emit','userSmsAccount:save','removeAgents','isArray','userSmsAccount:remove','getAgents','eml-format','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsAccount.socket','register','jayson/promise','http','test','Sequelize','ValidationError','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','status','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','get','SmsAccounts','UserProfileResource','end','stack','name','index','Pause','mandatoryDispositionPause','map','SmsAccount','fieldName','type','key','model','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','keys','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','SmsAccountId','Disposition','rawAttributes','removeDispositions','addAnswer','CannedAnswer','getAnswers','findOne','length','removeAnswers','ids','notify','sms','account','applications','orderBy','Applications','priority','asc','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','ListId','from','Body','messageId','skebby','sender','message_id','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','DESC','list','Contacts','contact','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','AttachmentId','User','UserId','unshift','agent','waitForTheAssignedAgent','startRouting','Start','receiveMessage','debug','entity\x20found','Content-Type','\x0a','sequelize','transaction','SmsApplication'];(function(_0x31cfb8,_0x48a724){var _0x7a14be=function(_0x1c6166){while(--_0x1c6166){_0x31cfb8['push'](_0x31cfb8['shift']());}};_0x7a14be(++_0x48a724);}(_0x7096,0x10c));var _0x6709=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x7096[_0x56482c];return _0x5aae7a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6709('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6709('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6709('0x2'));var moment=require(_0x6709('0x3'));var BPromise=require(_0x6709('0x4'));var Mustache=require(_0x6709('0x5'));var util=require(_0x6709('0x6'));var path=require(_0x6709('0x7'));var sox=require(_0x6709('0x8'));var csv=require(_0x6709('0x9'));var ejs=require(_0x6709('0xa'));var fs=require('fs');var _=require(_0x6709('0xb'));var squel=require(_0x6709('0xc'));var crypto=require(_0x6709('0xd'));var jsforce=require(_0x6709('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x6709('0xf'));var Papa=require(_0x6709('0x10'));var Redis=require(_0x6709('0x11'));var authService=require(_0x6709('0x12'));var qs=require(_0x6709('0x13'));var as=require(_0x6709('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6709('0x15'));var utils=require(_0x6709('0x16'));var config=require(_0x6709('0x17'));var db=require(_0x6709('0x18'))['db'];config[_0x6709('0x19')]=_[_0x6709('0x1a')](config[_0x6709('0x19')],{'host':_0x6709('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6709('0x19')]));require(_0x6709('0x1c'))[_0x6709('0x1d')](socket);var jayson=require(_0x6709('0x1e'));var client=jayson['client'][_0x6709('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x5c667c,_0x41af1f,_0x4bc059){if(_0x4bc059){var _0x149233=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x149233[_0x6709('0x20')](_0x41af1f)){return _0x5c667c;}else{throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x5c667c;}}function respondWithRpcPromise(_0x52e342,_0x5c4f94,_0x3fa5b1,_0x235a54){return new BPromise(function(_0x4a732e,_0x9c1fd8){var _0x166c97=_0x235a54||client;return _0x166c97[_0x6709('0x23')](_0x52e342,_0x3fa5b1)['then'](function(_0x13cf04){logger[_0x6709('0x24')](_0x6709('0x25'),_0x5c4f94,_0x6709('0x26'));logger['debug'](_0x6709('0x27'),_0x5c4f94,_0x6709('0x26'),JSON[_0x6709('0x28')](_0x13cf04));if(_0x13cf04[_0x6709('0x29')]){if(_0x13cf04[_0x6709('0x29')][_0x6709('0x2a')]===0x1f4){logger[_0x6709('0x29')](_0x6709('0x25'),_0x5c4f94,_0x13cf04[_0x6709('0x29')][_0x6709('0x2b')]);return _0x9c1fd8(_0x13cf04[_0x6709('0x29')][_0x6709('0x2b')]);}logger['error'](_0x6709('0x25'),_0x5c4f94,_0x13cf04[_0x6709('0x29')][_0x6709('0x2b')]);return _0x4a732e(_0x13cf04['error'][_0x6709('0x2b')]);}else{logger[_0x6709('0x24')](_0x6709('0x25'),_0x5c4f94,_0x6709('0x26'));_0x4a732e(_0x13cf04['result'][_0x6709('0x2b')]);}})[_0x6709('0x2c')](function(_0x50f7d6){logger[_0x6709('0x29')](_0x6709('0x25'),_0x5c4f94,_0x50f7d6);_0x9c1fd8(_0x50f7d6);});});}function respondWithStatusCode(_0x5dbb87,_0x444b0e){_0x444b0e=_0x444b0e||0xcc;return function(_0x2499a2){if(_0x2499a2){return _0x5dbb87['sendStatus'](_0x444b0e);}return _0x5dbb87[_0x6709('0x2d')](_0x444b0e)['end']();};}function respondWithResult(_0x46a325,_0x3cd555){_0x3cd555=_0x3cd555||0xc8;return function(_0x5b6906){if(_0x5b6906){return _0x46a325[_0x6709('0x2d')](_0x3cd555)['json'](_0x5b6906);}};}function respondWithFilteredResult(_0xe066d8,_0x388aee){return function(_0x4ad1c3){if(_0x4ad1c3){var _0x1a9eea=_0x4ad1c3['count'],_0x5deff5=_0x388aee['offset'],_0x138318=_0x388aee[_0x6709('0x2e')]+_0x388aee[_0x6709('0x2f')],_0x135f46;if(_0x138318>=_0x1a9eea){_0x138318=_0x1a9eea;_0x135f46=0xc8;}else{_0x135f46=0xce;}_0xe066d8[_0x6709('0x2d')](_0x135f46);return _0xe066d8[_0x6709('0x30')](_0x6709('0x31'),_0x5deff5+'-'+_0x138318+'/'+_0x1a9eea)[_0x6709('0x32')](_0x4ad1c3);}return null;};}function patchUpdates(_0x69593c){return function(_0x402e45){try{jsonpatch[_0x6709('0x33')](_0x402e45,_0x69593c,!![]);}catch(_0x5d399b){return BPromise[_0x6709('0x34')](_0x5d399b);}return _0x402e45[_0x6709('0x35')]();};}function saveUpdates(_0x3cfbe6,_0x27e929){return function(_0x5dc856){if(_0x5dc856){return _0x5dc856[_0x6709('0x36')](_0x3cfbe6)[_0x6709('0x37')](function(_0x124e01){return _0x124e01;});}return null;};}function removeEntity(_0x1bd075,_0x4fd344){return function(_0x3bfc6d){if(_0x3bfc6d){return _0x3bfc6d[_0x6709('0x38')]()['then'](function(){var _0x8952f1=_0x3bfc6d[_0x6709('0x39')]({'plain':!![]});var _0x5aa83b=_0x6709('0x3a');return db[_0x6709('0x3b')][_0x6709('0x38')]({'where':{'type':_0x5aa83b,'resourceId':_0x8952f1['id']}})[_0x6709('0x37')](function(){return _0x3bfc6d;});})[_0x6709('0x37')](function(){_0x1bd075[_0x6709('0x2d')](0xcc)[_0x6709('0x3c')]();});}};}function handleEntityNotFound(_0x4bfed4,_0x1cd361){return function(_0x34df09){if(!_0x34df09){_0x4bfed4['sendStatus'](0x194);}return _0x34df09;};}function handleError(_0x429737,_0x12ca63){_0x12ca63=_0x12ca63||0x1f4;return function(_0x6b5f39){logger[_0x6709('0x29')](_0x6b5f39[_0x6709('0x3d')]);if(_0x6b5f39[_0x6709('0x3e')]){delete _0x6b5f39['name'];}_0x429737[_0x6709('0x2d')](_0x12ca63)['send'](_0x6b5f39);};}exports[_0x6709('0x3f')]=function(_0xbb7a64,_0x31e55c){var _0x48492f={'include':[{'model':db[_0x6709('0x40')],'as':_0x6709('0x41')}]},_0x149a7a={},_0x300c5b={'count':0x0,'rows':[]};var _0x2a0948=_[_0x6709('0x42')](db[_0x6709('0x43')]['rawAttributes'],function(_0x3233a0){return{'name':_0x3233a0[_0x6709('0x44')],'type':_0x3233a0[_0x6709('0x45')][_0x6709('0x46')]};});_0x149a7a[_0x6709('0x47')]=_[_0x6709('0x42')](_0x2a0948,_0x6709('0x3e'));_0x149a7a['query']=_['keys'](_0xbb7a64[_0x6709('0x48')]);_0x149a7a[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x149a7a[_0x6709('0x47')],_0x149a7a['query']);_0x48492f['attributes']=_['intersection'](_0x149a7a[_0x6709('0x47')],qs[_0x6709('0x4b')](_0xbb7a64['query'][_0x6709('0x4b')]));_0x48492f[_0x6709('0x4c')]=_0x48492f['attributes']['length']?_0x48492f[_0x6709('0x4c')]:_0x149a7a[_0x6709('0x47')];if(!_0xbb7a64[_0x6709('0x48')][_0x6709('0x4d')](_0x6709('0x4e'))){_0x48492f['limit']=qs[_0x6709('0x2f')](_0xbb7a64['query'][_0x6709('0x2f')]);_0x48492f[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0xbb7a64['query'][_0x6709('0x2e')]);}_0x48492f['order']=qs['sort'](_0xbb7a64[_0x6709('0x48')][_0x6709('0x4f')]);_0x48492f[_0x6709('0x50')]=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0xbb7a64[_0x6709('0x48')],_0x149a7a[_0x6709('0x49')]));if(_0xbb7a64[_0x6709('0x48')][_0x6709('0x52')]){_0x48492f[_0x6709('0x50')]=_[_0x6709('0x53')](_0x48492f[_0x6709('0x50')],{'$or':_[_0x6709('0x42')](_0x2a0948,function(_0x1f3231){if(_0x1f3231[_0x6709('0x45')]!=='VIRTUAL'){var _0xfbb810={};_0xfbb810[_0x1f3231['name']]={'$like':'%'+_0xbb7a64['query'][_0x6709('0x52')]+'%'};return _0xfbb810;}})});}_0x48492f=_[_0x6709('0x53')]({},_0x48492f,_0xbb7a64[_0x6709('0x54')]);var _0xe8dd1={'where':_0x48492f[_0x6709('0x50')]};return db[_0x6709('0x43')][_0x6709('0x55')](_0xe8dd1)[_0x6709('0x37')](function(_0x47e631){_0x300c5b[_0x6709('0x55')]=_0x47e631;if(_0xbb7a64[_0x6709('0x48')][_0x6709('0x56')]){_0x48492f[_0x6709('0x57')]=[{'all':!![]}];}return db['SmsAccount'][_0x6709('0x58')](_0x48492f);})['then'](function(_0x2e7da0){_0x300c5b[_0x6709('0x59')]=_0x2e7da0;return _0x300c5b;})[_0x6709('0x37')](respondWithFilteredResult(_0x31e55c,_0x48492f))[_0x6709('0x2c')](handleError(_0x31e55c,null));};exports[_0x6709('0x5a')]=function(_0x516ba9,_0x26e507){var _0x63bf25={'raw':![],'where':{'id':_0x516ba9[_0x6709('0x5b')]['id']},'include':[{'model':db[_0x6709('0x40')],'as':'mandatoryDispositionPause'}]},_0x19971d={};_0x19971d['model']=_[_0x6709('0x5c')](db['SmsAccount']['rawAttributes']);_0x19971d[_0x6709('0x48')]=_[_0x6709('0x5c')](_0x516ba9[_0x6709('0x48')]);_0x19971d[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x19971d[_0x6709('0x47')],_0x19971d[_0x6709('0x48')]);_0x63bf25[_0x6709('0x4c')]=_[_0x6709('0x4a')](_0x19971d[_0x6709('0x47')],qs[_0x6709('0x4b')](_0x516ba9['query'][_0x6709('0x4b')]));_0x63bf25[_0x6709('0x4c')]=_0x63bf25['attributes']['length']?_0x63bf25[_0x6709('0x4c')]:_0x19971d[_0x6709('0x47')];if(_0x516ba9[_0x6709('0x48')][_0x6709('0x56')]){_0x63bf25['include']=[{'all':!![]}];}_0x63bf25=_[_0x6709('0x53')]({},_0x63bf25,_0x516ba9['options']);return db[_0x6709('0x43')][_0x6709('0x5d')](_0x63bf25)[_0x6709('0x37')](handleEntityNotFound(_0x26e507,null))[_0x6709('0x37')](respondWithResult(_0x26e507,null))[_0x6709('0x2c')](handleError(_0x26e507,null));};exports['create']=function(_0x49d3c6,_0x4bd210){return db[_0x6709('0x43')]['create'](_0x49d3c6[_0x6709('0x5e')],{})[_0x6709('0x37')](function(_0x4f18c6){var _0xbb78ba=_0x49d3c6[_0x6709('0x5f')][_0x6709('0x39')]({'plain':!![]});if(!_0xbb78ba)throw new Error(_0x6709('0x60'));if(_0xbb78ba['role']==='user'){var _0xf18372=_0x4f18c6['get']({'plain':!![]});var _0x1f57f5=_0x6709('0x3a');return db[_0x6709('0x61')]['find']({'where':{'name':_0x1f57f5,'userProfileId':_0xbb78ba[_0x6709('0x62')]},'raw':!![]})['then'](function(_0x50c812){if(_0x50c812&&_0x50c812[_0x6709('0x63')]===0x0){return db['UserProfileResource'][_0x6709('0x64')]({'name':_0xf18372['name'],'resourceId':_0xf18372['id'],'type':_0x50c812[_0x6709('0x3e')],'sectionId':_0x50c812['id']},{})[_0x6709('0x37')](function(){return _0x4f18c6;});}else{return _0x4f18c6;}})[_0x6709('0x2c')](function(_0x2ffdd5){logger['error'](_0x6709('0x65'),_0x2ffdd5);throw _0x2ffdd5;});}return _0x4f18c6;})[_0x6709('0x37')](respondWithResult(_0x4bd210,0xc9))[_0x6709('0x2c')](handleError(_0x4bd210,null));};exports[_0x6709('0x36')]=function(_0x210451,_0x3d4d1c){if(_0x210451[_0x6709('0x5e')]['id']){delete _0x210451['body']['id'];}return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x210451[_0x6709('0x5b')]['id']},'include':[{'model':db[_0x6709('0x40')],'as':_0x6709('0x41')}]})[_0x6709('0x37')](handleEntityNotFound(_0x3d4d1c,null))[_0x6709('0x37')](saveUpdates(_0x210451[_0x6709('0x5e')],null))[_0x6709('0x37')](respondWithResult(_0x3d4d1c,null))['catch'](handleError(_0x3d4d1c,null));};exports[_0x6709('0x38')]=function(_0x122080,_0x50f992){return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x122080[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x50f992,null))[_0x6709('0x37')](removeEntity(_0x50f992,null))[_0x6709('0x2c')](handleError(_0x50f992,null));};exports[_0x6709('0x66')]=function(_0x475449,_0x1a393b){return db['SmsAccount'][_0x6709('0x66')]()[_0x6709('0x37')](respondWithResult(_0x1a393b,null))[_0x6709('0x2c')](handleError(_0x1a393b,null));};exports[_0x6709('0x67')]=function(_0x561c2,_0x694dbe,_0x64d345){if(_0x561c2[_0x6709('0x5e')]['id']){delete _0x561c2[_0x6709('0x5e')]['id'];}return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x561c2['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x694dbe,null))['then'](function(_0x566d6d){if(_0x566d6d){_0x561c2[_0x6709('0x5e')][_0x6709('0x68')]=_0x566d6d['id'];return db[_0x6709('0x69')][_0x6709('0x64')](_0x561c2[_0x6709('0x5e')]);}})[_0x6709('0x37')](respondWithResult(_0x694dbe,null))[_0x6709('0x2c')](handleError(_0x694dbe,null));};exports['getDispositions']=function(_0x5a61b8,_0x3b5a8a,_0x5e7940){var _0x2f0e37={'raw':![],'where':{}};var _0x47b7d9={};var _0x123183={'count':0x0,'rows':[]};return db[_0x6709('0x43')]['findOne']({'where':{'id':_0x5a61b8['params']['id']}})['then'](handleEntityNotFound(_0x3b5a8a,null))[_0x6709('0x37')](function(_0x2faf8f){if(_0x2faf8f){_0x47b7d9[_0x6709('0x47')]=_[_0x6709('0x5c')](db[_0x6709('0x69')][_0x6709('0x6a')]);_0x47b7d9[_0x6709('0x48')]=_[_0x6709('0x5c')](_0x5a61b8[_0x6709('0x48')]);_0x47b7d9[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x47b7d9[_0x6709('0x47')],_0x47b7d9[_0x6709('0x48')]);_0x2f0e37['attributes']=_[_0x6709('0x4a')](_0x47b7d9[_0x6709('0x47')],qs[_0x6709('0x4b')](_0x5a61b8[_0x6709('0x48')]['fields']));_0x2f0e37['attributes']=_0x2f0e37[_0x6709('0x4c')]['length']?_0x2f0e37['attributes']:_0x47b7d9[_0x6709('0x47')];if(!_0x5a61b8[_0x6709('0x48')]['hasOwnProperty'](_0x6709('0x4e'))){_0x2f0e37[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x5a61b8[_0x6709('0x48')][_0x6709('0x2f')]);_0x2f0e37['offset']=qs['offset'](_0x5a61b8[_0x6709('0x48')][_0x6709('0x2e')]);}_0x2f0e37['order']=qs[_0x6709('0x4f')](_0x5a61b8[_0x6709('0x48')][_0x6709('0x4f')]);_0x2f0e37['where']=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0x5a61b8[_0x6709('0x48')],_0x47b7d9[_0x6709('0x49')]));_0x2f0e37['where']['SmsAccountId']=_0x2faf8f['id'];if(_0x5a61b8[_0x6709('0x48')][_0x6709('0x52')]){_0x2f0e37[_0x6709('0x50')]=_[_0x6709('0x53')](_0x2f0e37[_0x6709('0x50')],{'$or':_['map'](_0x2f0e37[_0x6709('0x4c')],function(_0x3e8e5c){var _0x48133a={};_0x48133a[_0x3e8e5c]={'$like':'%'+_0x5a61b8[_0x6709('0x48')][_0x6709('0x52')]+'%'};return _0x48133a;})});}_0x2f0e37=_[_0x6709('0x53')]({},_0x2f0e37,_0x5a61b8[_0x6709('0x54')]);return db[_0x6709('0x69')]['count']({'where':_0x2f0e37[_0x6709('0x50')]})['then'](function(_0x31cc76){_0x123183['count']=_0x31cc76;if(_0x5a61b8[_0x6709('0x48')][_0x6709('0x56')]){_0x2f0e37[_0x6709('0x57')]=[{'all':!![]}];}return db[_0x6709('0x69')]['findAll'](_0x2f0e37);})[_0x6709('0x37')](function(_0x2c0bbe){_0x123183[_0x6709('0x59')]=_0x2c0bbe;return _0x123183;});}})[_0x6709('0x37')](respondWithFilteredResult(_0x3b5a8a,_0x2f0e37))[_0x6709('0x2c')](handleError(_0x3b5a8a,null));};exports[_0x6709('0x6b')]=function(_0x5259dd,_0x13956e,_0x25f1b9){return db[_0x6709('0x43')]['find']({'where':{'id':_0x5259dd[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x13956e,null))['then'](function(_0x4388a1){if(_0x4388a1){return _0x4388a1[_0x6709('0x6b')](_0x5259dd[_0x6709('0x48')]['ids']);}})[_0x6709('0x37')](respondWithStatusCode(_0x13956e,null))[_0x6709('0x2c')](handleError(_0x13956e,null));};exports[_0x6709('0x6c')]=function(_0x5c8564,_0x2804aa,_0x3f9a3f){if(_0x5c8564[_0x6709('0x5e')]['id']){delete _0x5c8564[_0x6709('0x5e')]['id'];}return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x5c8564['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x2804aa,null))[_0x6709('0x37')](function(_0x4a7f02){if(_0x4a7f02){_0x5c8564[_0x6709('0x5e')][_0x6709('0x68')]=_0x4a7f02['id'];return db[_0x6709('0x6d')]['create'](_0x5c8564[_0x6709('0x5e')]);}})[_0x6709('0x37')](respondWithResult(_0x2804aa,null))[_0x6709('0x2c')](handleError(_0x2804aa,null));};exports[_0x6709('0x6e')]=function(_0x3595fb,_0x22a4e6,_0x477a1d){var _0x48dce5={'raw':![],'where':{}};var _0x374666={};var _0x4161d5={'count':0x0,'rows':[]};return db[_0x6709('0x43')][_0x6709('0x6f')]({'where':{'id':_0x3595fb[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x22a4e6,null))[_0x6709('0x37')](function(_0x4f57cf){if(_0x4f57cf){_0x374666[_0x6709('0x47')]=_['keys'](db[_0x6709('0x6d')][_0x6709('0x6a')]);_0x374666[_0x6709('0x48')]=_[_0x6709('0x5c')](_0x3595fb[_0x6709('0x48')]);_0x374666[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x374666[_0x6709('0x47')],_0x374666[_0x6709('0x48')]);_0x48dce5[_0x6709('0x4c')]=_[_0x6709('0x4a')](_0x374666[_0x6709('0x47')],qs[_0x6709('0x4b')](_0x3595fb[_0x6709('0x48')]['fields']));_0x48dce5['attributes']=_0x48dce5[_0x6709('0x4c')][_0x6709('0x70')]?_0x48dce5['attributes']:_0x374666[_0x6709('0x47')];if(!_0x3595fb[_0x6709('0x48')][_0x6709('0x4d')](_0x6709('0x4e'))){_0x48dce5[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x3595fb[_0x6709('0x48')]['limit']);_0x48dce5[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x3595fb[_0x6709('0x48')][_0x6709('0x2e')]);}_0x48dce5['order']=qs['sort'](_0x3595fb[_0x6709('0x48')][_0x6709('0x4f')]);_0x48dce5[_0x6709('0x50')]=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0x3595fb[_0x6709('0x48')],_0x374666[_0x6709('0x49')]));_0x48dce5[_0x6709('0x50')][_0x6709('0x68')]=_0x4f57cf['id'];if(_0x3595fb[_0x6709('0x48')][_0x6709('0x52')]){_0x48dce5[_0x6709('0x50')]=_['merge'](_0x48dce5[_0x6709('0x50')],{'$or':_[_0x6709('0x42')](_0x48dce5[_0x6709('0x4c')],function(_0x4ec43e){var _0x1f1dc2={};_0x1f1dc2[_0x4ec43e]={'$like':'%'+_0x3595fb[_0x6709('0x48')]['filter']+'%'};return _0x1f1dc2;})});}_0x48dce5=_[_0x6709('0x53')]({},_0x48dce5,_0x3595fb['options']);return db[_0x6709('0x6d')][_0x6709('0x55')]({'where':_0x48dce5[_0x6709('0x50')]})[_0x6709('0x37')](function(_0x45cd4e){_0x4161d5[_0x6709('0x55')]=_0x45cd4e;if(_0x3595fb[_0x6709('0x48')][_0x6709('0x56')]){_0x48dce5['include']=[{'all':!![]}];}return db[_0x6709('0x6d')][_0x6709('0x58')](_0x48dce5);})[_0x6709('0x37')](function(_0x500eb4){_0x4161d5['rows']=_0x500eb4;return _0x4161d5;});}})['then'](respondWithFilteredResult(_0x22a4e6,_0x48dce5))[_0x6709('0x2c')](handleError(_0x22a4e6,null));};exports[_0x6709('0x71')]=function(_0x448b76,_0x36adb8,_0x1b8b9a){return db['SmsAccount'][_0x6709('0x5d')]({'where':{'id':_0x448b76['params']['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x36adb8,null))[_0x6709('0x37')](function(_0x80f5ec){if(_0x80f5ec){return _0x80f5ec[_0x6709('0x71')](_0x448b76['query'][_0x6709('0x72')]);}})[_0x6709('0x37')](respondWithStatusCode(_0x36adb8,null))['catch'](handleError(_0x36adb8,null));};exports[_0x6709('0x73')]=function(_0x25396e,_0xc72f0b,_0xa1a47d){var _0x3b4539={'channel':_0x6709('0x74')};var _0x448d4c=[];var _0x20255b=[];var _0x4a8e76={};return db[_0x6709('0x43')]['find']({'where':{'id':_0x25396e['params']['id']},'include':[{'model':db['SmsApplication'],'as':'Applications'}]})['then'](handleEntityNotFound(_0xc72f0b,null))['then'](function(_0x4dc6a1){_0x3b4539[_0x6709('0x75')]=_0x4dc6a1;_0x3b4539[_0x6709('0x76')]=_[_0x6709('0x77')](_0x4dc6a1[_0x6709('0x78')],[_0x6709('0x79')],[_0x6709('0x7a')]);if(_0x3b4539[_0x6709('0x75')][_0x6709('0x78')]){delete _0x3b4539['account'][_0x6709('0x78')];}return db[_0x6709('0x7b')][_0x6709('0x66')]();})[_0x6709('0x37')](function(_0x1ccc63){if(!_0x1ccc63){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x7c'));}_0x448d4c=_[_0x6709('0x7d')](_['keys'](_0x1ccc63),['createdAt',_0x6709('0x7e')]);_0x20255b=_['difference'](_['keys'](_0x1ccc63),[_0x6709('0x7f'),_0x6709('0x7e'),_0x6709('0x80'),_0x6709('0x81')]);_0x3b4539[_0x6709('0x5e')]={'mapKey':'mobile'};if(_0x3b4539[_0x6709('0x75')]['type']){switch(_0x3b4539[_0x6709('0x75')][_0x6709('0x45')]){case'twilio':_0x3b4539['body'][_0x6709('0x82')]=_0x25396e[_0x6709('0x5e')]['From'];_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x83')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x84')]=_0x25396e[_0x6709('0x5e')]['MessageSid'];break;case _0x6709('0x85'):_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')]='+'+_0x25396e[_0x6709('0x5e')][_0x6709('0x86')];_0x3b4539['body'][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')]['text'];break;case'connectel':_0x3b4539['body'][_0x6709('0x82')]=_0x25396e['body'][_0x6709('0x82')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x2b')];break;case'clicksend':_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x82')];_0x3b4539['body'][_0x6709('0x5e')]=_0x25396e['body']['body'];_0x3b4539[_0x6709('0x5e')]['messageId']=_0x25396e[_0x6709('0x5e')][_0x6709('0x87')];break;case'plivo':_0x3b4539['body'][_0x6709('0x82')]=_0x25396e[_0x6709('0x5e')]['From'];_0x3b4539['body'][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')]['Text'];_0x3b4539[_0x6709('0x5e')][_0x6709('0x84')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x88')];break;case _0x6709('0x89'):_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')]='+'+_0x25396e[_0x6709('0x5e')][_0x6709('0x8a')][0x0][_0x6709('0x82')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')]['results'][0x0][_0x6709('0x8b')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x84')]=_0x25396e['body'][_0x6709('0x8a')][0x0]['messageId'];break;case _0x6709('0x8c'):_0x3b4539['body'][_0x6709('0x82')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x8d')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]=_0x25396e['body'][_0x6709('0x8e')]['message'];break;case _0x6709('0x8f'):_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')]=_0x25396e['body']['fromNumber'];_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]=_0x25396e[_0x6709('0x5e')]['text'];_0x3b4539[_0x6709('0x5e')][_0x6709('0x84')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x90')];break;case _0x6709('0x91'):_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')]=_0x25396e['body']['from'];_0x3b4539['body'][_0x6709('0x5e')]=_0x25396e['body'][_0x6709('0x2b')];_0x3b4539[_0x6709('0x5e')][_0x6709('0x84')]=_0x25396e[_0x6709('0x5e')][_0x6709('0x92')];break;}}if(_0x3b4539['body']['id']){delete _0x3b4539['body']['id'];}if(_[_0x6709('0x93')](_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')])){throw new db[(_0x6709('0x21'))]['ValidationError'](_0x6709('0x94'));}if(_[_0x6709('0x93')](_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')])||_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')]===''){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x95'));}if(_[_0x6709('0x93')](_0x3b4539[_0x6709('0x5e')][_0x6709('0x96')])){throw new db[(_0x6709('0x21'))]['ValidationError']('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x20255b);}if(!_[_0x6709('0x97')](_0x20255b,_0x3b4539['body']['mapKey'])){throw new db[(_0x6709('0x21'))]['ValidationError'](_0x6709('0x98')+_0x20255b);}_0x4a8e76[_0x3b4539[_0x6709('0x5e')][_0x6709('0x96')]]=_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')];return db[_0x6709('0x99')][_0x6709('0x5d')]({'where':{'id':_0x3b4539[_0x6709('0x75')][_0x6709('0x81')]},'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x4a8e76,'limit':0x1,'order':[['updatedAt',_0x6709('0x9a')]]}]});})[_0x6709('0x37')](handleEntityNotFound(_0xc72f0b,null))[_0x6709('0x37')](function(_0x3978b0){if(_0x3978b0){_0x3b4539[_0x6709('0x9b')]=_['omit'](_0x3978b0,[_0x6709('0x9c')]);if(_0x3978b0[_0x6709('0x9c')][_0x6709('0x70')]){return _0x3978b0[_0x6709('0x9c')][0x0];}var _0x2a644d=_[_0x6709('0x1a')](_0x3b4539['body'],{'firstName':_0x3b4539['body']['from'],'ListId':_0x3978b0['id']});_0x2a644d[_0x3b4539['body'][_0x6709('0x96')]]=_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')];return db['CmContact']['create'](_0x2a644d,{'fields':_0x448d4c,'raw':!![]});}})[_0x6709('0x37')](handleEntityNotFound(_0xc72f0b,null))[_0x6709('0x37')](function(_0x1b204d){if(_0x1b204d){_0x3b4539[_0x6709('0x9d')]=_0x1b204d;var _0x55683f={'ContactId':_0x1b204d['id'],'phone':_0x3b4539[_0x6709('0x5e')][_0x6709('0x82')],'SmsAccountId':_0x25396e['params']['id']};var _0x576280={'ContactId':_0x1b204d['id'],'SmsAccountId':_0x25396e[_0x6709('0x5b')]['id'],'closed':![]};return db[_0x6709('0x9e')]['find']({'where':_0x576280})['then'](function(_0x597082){if(_0x597082){return[_0x597082,![]];}return db['SmsInteraction']['create'](_0x55683f)[_0x6709('0x37')](function(_0xa4b485){return[_0xa4b485,!![]];});});}})['spread'](function(_0x370e10,_0x330209){_0x3b4539[_0x6709('0x9f')]=_0x370e10[_0x6709('0x39')]({'plain':!![]});_0x3b4539[_0x6709('0x9f')][_0x6709('0xa0')]=![];if(_0x330209){if(_0x3b4539[_0x6709('0x75')][_0x6709('0xa1')]){_0x3b4539[_0x6709('0x76')][_0x6709('0xa2')]({'id':0x0,'priority':_0x3b4539[_0x6709('0x76')]['length']+0x1,'app':_0x6709('0xa3'),'appdata':_0x6709('0xa4'),'interval':_0x6709('0xa5')});}_0x3b4539[_0x6709('0x9f')][_0x6709('0xa0')]=!![];}return db[_0x6709('0xa6')][_0x6709('0x64')]({'phone':_0x3b4539[_0x6709('0x5e')]['from'],'messageId':_0x3b4539['body'][_0x6709('0x84')],'body':_0x3b4539[_0x6709('0x5e')][_0x6709('0x5e')],'SmsAccountId':_0x25396e[_0x6709('0x5b')]['id'],'SmsInteractionId':_0x370e10['id'],'direction':'in','ContactId':_0x370e10[_0x6709('0xa7')],'AttachmentId':_0x3b4539['body'][_0x6709('0xa8')]});})[_0x6709('0x37')](function(_0x52c59c){_0x3b4539[_0x6709('0x2b')]=_0x52c59c;if(_0x3b4539['interaction']['UserId']){return db[_0x6709('0xa9')][_0x6709('0x5d')]({'attributes':['id',_0x6709('0x3e')],'where':{'id':_0x3b4539['interaction'][_0x6709('0xaa')]}})[_0x6709('0x37')](function(_0x208594){if(_0x208594){_0x3b4539['applications'][_0x6709('0xab')]({'id':0x0,'priority':0x0,'app':_0x6709('0xac'),'appdata':_0x208594[_0x6709('0x3e')]+','+(_0x3b4539[_0x6709('0x75')][_0x6709('0xad')]||0xa),'interval':_0x6709('0xa5')});}return respondWithRpcPromise('Start',_0x6709('0xae'),_0x3b4539);});}return respondWithRpcPromise(_0x6709('0xaf'),_0x6709('0xae'),_0x3b4539);})[_0x6709('0x37')](function(_0xaaa5d3){if(_0xaaa5d3){var _0x5c6b11=0xc8;var _0x52fb51=_0x6709('0xb0');logger['info']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x52fb51,_0x5c6b11,'entity\x20found');logger[_0x6709('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x52fb51,_0x5c6b11,_0x6709('0xb2'),JSON[_0x6709('0x28')](_0xaaa5d3));if(_0x3b4539['account'][_0x6709('0x45')]==='twilio'){return _0xc72f0b[_0x6709('0x2d')](_0x5c6b11)[_0x6709('0x30')](_0x6709('0xb3'),'text/xml')['send'](_0x6709('0xb4'));}else{return _0xc72f0b[_0x6709('0x2d')](_0x5c6b11)[_0x6709('0x32')](_0xaaa5d3);}}})[_0x6709('0x2c')](handleError(_0xc72f0b,null));};exports['addApplications']=function(_0x294b8b,_0x1dc08f,_0x512815){return db[_0x6709('0x43')][_0x6709('0x6f')]({'where':{'id':_0x294b8b[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x1dc08f,null))['then'](function(_0x23ad77){if(_0x23ad77){return db[_0x6709('0xb5')][_0x6709('0xb6')](function(_0x17fbf6){return db[_0x6709('0xb7')]['destroy']({'where':{'SmsAccountId':_0x294b8b['params']['id']},'transaction':_0x17fbf6})[_0x6709('0x37')](function(_0x51ef62){var _0x396738=_[_0x6709('0x42')](_0x294b8b[_0x6709('0x5e')],function(_0x296ebb){_0x296ebb[_0x6709('0x68')]=_0x294b8b[_0x6709('0x5b')]['id'];return _0x296ebb;});return db[_0x6709('0xb7')][_0x6709('0xb8')](_0x396738,{'transaction':_0x17fbf6});});})[_0x6709('0x37')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x294b8b[_0x6709('0x5b')]['id']},'order':_0x6709('0x79')});});}})[_0x6709('0x37')](respondWithResult(_0x1dc08f,null))[_0x6709('0x2c')](handleError(_0x1dc08f,null));};exports[_0x6709('0xb9')]=function(_0x49c351,_0x2949d5,_0x354156){var _0x15a092={};var _0x5da52a={};var _0x3d1a5e;var _0x1ffce1;return db[_0x6709('0x43')][_0x6709('0x6f')]({'where':{'id':_0x49c351[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x2949d5,null))[_0x6709('0x37')](function(_0x4af3ff){if(_0x4af3ff){_0x3d1a5e=_0x4af3ff;_0x5da52a[_0x6709('0x47')]=_[_0x6709('0x5c')](db[_0x6709('0xb7')][_0x6709('0x6a')]);_0x5da52a['query']=_[_0x6709('0x5c')](_0x49c351[_0x6709('0x48')]);_0x5da52a['filters']=_[_0x6709('0x4a')](_0x5da52a['model'],_0x5da52a[_0x6709('0x48')]);_0x15a092[_0x6709('0x4c')]=_[_0x6709('0x4a')](_0x5da52a['model'],qs[_0x6709('0x4b')](_0x49c351[_0x6709('0x48')]['fields']));_0x15a092[_0x6709('0x4c')]=_0x15a092[_0x6709('0x4c')][_0x6709('0x70')]?_0x15a092[_0x6709('0x4c')]:_0x5da52a['model'];_0x15a092[_0x6709('0xba')]=qs[_0x6709('0x4f')](_0x49c351['query'][_0x6709('0x4f')]);_0x15a092[_0x6709('0x50')]=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0x49c351[_0x6709('0x48')],_0x5da52a[_0x6709('0x49')]));if(_0x49c351[_0x6709('0x48')][_0x6709('0x52')]){_0x15a092[_0x6709('0x50')]=_[_0x6709('0x53')](_0x15a092[_0x6709('0x50')],{'$or':_['map'](_0x15a092['attributes'],function(_0x505416){var _0x3b84c4={};_0x3b84c4[_0x505416]={'$like':'%'+_0x49c351[_0x6709('0x48')][_0x6709('0x52')]+'%'};return _0x3b84c4;})});}_0x15a092=_[_0x6709('0x53')]({},_0x15a092,_0x49c351[_0x6709('0x54')]);return _0x3d1a5e[_0x6709('0xb9')](_0x15a092);}})[_0x6709('0x37')](function(_0x297986){if(_0x297986){_0x1ffce1=_0x297986[_0x6709('0x70')];if(!_0x49c351[_0x6709('0x48')]['hasOwnProperty'](_0x6709('0x4e'))){_0x15a092[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x49c351[_0x6709('0x48')]['limit']);_0x15a092['offset']=qs['offset'](_0x49c351[_0x6709('0x48')][_0x6709('0x2e')]);}return _0x3d1a5e['getApplications'](_0x15a092);}})[_0x6709('0x37')](function(_0x10e5aa){if(_0x10e5aa){return _0x10e5aa?{'count':_0x1ffce1,'rows':_0x10e5aa}:null;}})[_0x6709('0x37')](respondWithResult(_0x2949d5,null))[_0x6709('0x2c')](handleError(_0x2949d5,null));};exports[_0x6709('0xbb')]=function(_0x5d14e5,_0x893e66,_0x3e0817){var _0x2dabac={'raw':![],'where':{}};var _0x1fe96c={};var _0x28aa16={'count':0x0,'rows':[]};return db['SmsAccount'][_0x6709('0x6f')]({'where':{'id':_0x5d14e5[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x893e66,null))[_0x6709('0x37')](function(_0x5018db){if(_0x5018db){_0x1fe96c[_0x6709('0x47')]=_['keys'](db[_0x6709('0x9e')][_0x6709('0x6a')]);_0x1fe96c['query']=_[_0x6709('0x5c')](_0x5d14e5[_0x6709('0x48')]);_0x1fe96c[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x1fe96c[_0x6709('0x47')],_0x1fe96c[_0x6709('0x48')]);_0x2dabac[_0x6709('0x4c')]=_[_0x6709('0x4a')](_0x1fe96c[_0x6709('0x47')],qs[_0x6709('0x4b')](_0x5d14e5[_0x6709('0x48')][_0x6709('0x4b')]));_0x2dabac['attributes']=_0x2dabac[_0x6709('0x4c')][_0x6709('0x70')]?_0x2dabac[_0x6709('0x4c')]:_0x1fe96c[_0x6709('0x47')];if(!_0x5d14e5['query'][_0x6709('0x4d')]('nolimit')){_0x2dabac[_0x6709('0x2f')]=qs[_0x6709('0x2f')](_0x5d14e5['query'][_0x6709('0x2f')]);_0x2dabac[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x5d14e5[_0x6709('0x48')][_0x6709('0x2e')]);}_0x2dabac[_0x6709('0xba')]=qs[_0x6709('0x4f')](_0x5d14e5[_0x6709('0x48')]['sort']);_0x2dabac[_0x6709('0x50')]=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0x5d14e5[_0x6709('0x48')],_0x1fe96c['filters']));_0x2dabac['where'][_0x6709('0x68')]=_0x5018db['id'];if(_0x5d14e5[_0x6709('0x48')][_0x6709('0x52')]){_0x2dabac[_0x6709('0x50')]=_[_0x6709('0x53')](_0x2dabac[_0x6709('0x50')],{'$or':_[_0x6709('0x42')](_0x2dabac[_0x6709('0x4c')],function(_0x1c4ba0){var _0x1c351b={};_0x1c351b[_0x1c4ba0]={'$like':'%'+_0x5d14e5[_0x6709('0x48')][_0x6709('0x52')]+'%'};return _0x1c351b;})});}_0x2dabac=_[_0x6709('0x53')]({},_0x2dabac,_0x5d14e5[_0x6709('0x54')]);return db['SmsInteraction'][_0x6709('0x55')]({'where':_0x2dabac['where']})[_0x6709('0x37')](function(_0x28691c){_0x28aa16[_0x6709('0x55')]=_0x28691c;if(_0x5d14e5['query'][_0x6709('0x56')]){_0x2dabac[_0x6709('0x57')]=[{'model':db[_0x6709('0x7b')],'as':_0x6709('0xbc'),'required':![]},{'model':db[_0x6709('0xa9')],'as':'Owner','attributes':['name',_0x6709('0xbd'),'internal'],'required':![]},{'model':db[_0x6709('0xbe')],'as':_0x6709('0xbf'),'attributes':['id','name',_0x6709('0xc0')],'where':_0x5d14e5[_0x6709('0x48')][_0x6709('0xc1')]?{'id':_0x5d14e5[_0x6709('0x48')][_0x6709('0xc1')]}:undefined,'required':_0x5d14e5[_0x6709('0x48')][_0x6709('0xc1')]?!![]:![]}];}return db['SmsInteraction'][_0x6709('0x58')](_0x2dabac);})[_0x6709('0x37')](function(_0x19fa53){_0x28aa16[_0x6709('0x59')]=_0x19fa53;return _0x28aa16;});}})[_0x6709('0x37')](respondWithFilteredResult(_0x893e66,_0x2dabac))[_0x6709('0x2c')](handleError(_0x893e66,null));};exports[_0x6709('0xc2')]=function(_0x1698cb,_0x1428f3,_0x4624e0){var _0x25d69e,_0x3f9e38,_0x122731;if(_[_0x6709('0x93')](_0x1698cb['body'][_0x6709('0x5e')])||_0x1698cb[_0x6709('0x5e')]['body']===''){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0x95'));}if(_[_0x6709('0x93')](_0x1698cb[_0x6709('0x5e')]['to'])){throw new db[(_0x6709('0x21'))][(_0x6709('0x22'))](_0x6709('0xc3'));}_0x25d69e=_0x1698cb[_0x6709('0x5e')]['to'];return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x1698cb['params']['id']},'include':[{'model':db['CmList'],'as':_0x6709('0xc4'),'include':[{'model':db[_0x6709('0x7b')],'as':_0x6709('0x9c'),'where':{'mobile':_0x25d69e},'limit':0x1,'order':[['updatedAt',_0x6709('0x9a')]]}]}]})[_0x6709('0x37')](handleEntityNotFound(_0x1428f3,null))['then'](function(_0x15e3cc){if(_0x15e3cc&&_0x15e3cc[_0x6709('0xc4')]){_0x3f9e38=_0x15e3cc[_0x6709('0x39')]({'plain':!![]});if(_0x3f9e38[_0x6709('0xc4')]&&_0x3f9e38['List']['Contacts'][_0x6709('0x70')]){return _0x3f9e38['List'][_0x6709('0x9c')][0x0];}return db['CmContact']['create'](_['defaults'](_0x1698cb[_0x6709('0x5e')],{'firstName':_0x25d69e,'mobile':_0x25d69e,'phone':_0x25d69e,'ListId':_0x3f9e38[_0x6709('0x81')]}));}})[_0x6709('0x37')](handleEntityNotFound(_0x1428f3,null))[_0x6709('0x37')](function(_0xafc9ab){if(_0xafc9ab){_0x122731=_0xafc9ab;return db[_0x6709('0x9e')]['find']({'where':{'ContactId':_0x122731['id'],'closed':![],'SmsAccountId':_0x3f9e38['id']}})[_0x6709('0x37')](function(_0x3233f4){if(_0x3233f4){return[_0x3233f4,![]];}return db[_0x6709('0x9e')]['create']({'UserId':_0x1698cb[_0x6709('0x5f')]['id'],'ContactId':_0x122731['id'],'SmsAccountId':_0x3f9e38['id'],'phone':_0x25d69e,'firstMsgDirection':'out','Messages':[_[_0x6709('0x53')](_0x1698cb[_0x6709('0x5e')],{'read':![],'body':_0x1698cb[_0x6709('0x5e')][_0x6709('0x5e')],'phone':_0x25d69e,'SmsAccountId':_0x3f9e38['id'],'UserId':_0x1698cb[_0x6709('0x5f')]['id'],'ContactId':_0x122731['id']})]},{'include':[{'model':db[_0x6709('0xa6')],'as':'Messages'}]})[_0x6709('0x37')](function(_0x30c52b){return[_0x30c52b,!![]];});});}})[_0x6709('0xc5')](function(_0x58c6ae,_0x8c7918){if(_0x8c7918){return _0x58c6ae;}return db[_0x6709('0xa6')][_0x6709('0x64')](_[_0x6709('0x53')](_0x1698cb[_0x6709('0x5e')],{'read':![],'body':_0x1698cb['body'][_0x6709('0x5e')],'phone':_0x25d69e,'SmsAccountId':_0x3f9e38['id'],'SmsInteractionId':_0x58c6ae['id'],'UserId':_0x1698cb[_0x6709('0x5f')]['id'],'ContactId':_0x122731['id']}))[_0x6709('0x37')](function(_0x1dca60){_0x58c6ae[_0x6709('0xc6')][_0x6709('0xc7')]=[];_0x58c6ae[_0x6709('0xc6')][_0x6709('0xc7')][_0x6709('0xa2')](_0x1dca60[_0x6709('0xc6')]);return _0x58c6ae;});})[_0x6709('0x37')](respondWithResult(_0x1428f3,null))[_0x6709('0x2c')](handleError(_0x1428f3,null));};exports[_0x6709('0x2d')]=function(_0x6ca78e,_0x1c83a8,_0x3d75d1){if(_0x6ca78e[_0x6709('0x5e')]['id']){delete _0x6ca78e[_0x6709('0x5e')]['id'];}console['log'](_0x6709('0xc8'),_0x6ca78e['body']);var _0x592597,_0x5a23f0,_0x1edd42;return db['SmsAccount'][_0x6709('0x5d')]({'where':{'id':_0x6ca78e[_0x6709('0x5b')]['id']}})['then'](handleEntityNotFound(_0x1c83a8,null))[_0x6709('0x37')](function(_0x207fc2){if(_0x207fc2){_0x1edd42=_0x207fc2;logger[_0x6709('0xb1')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x6709('0x2d'),_0x6709('0xc9'),_0x207fc2[_0x6709('0x45')],util[_0x6709('0xca')](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));switch(_0x207fc2['type']){case'skebby':if(_0x6ca78e[_0x6709('0x5e')][_0x6709('0xcb')]&&_0x6ca78e[_0x6709('0x5e')]['status']){_0x5a23f0=_0x6ca78e['body'][_0x6709('0x2d')];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x6ca78e[_0x6709('0x5e')]['skebby_dispatch_id']}});}break;case'connectel':if(_0x6ca78e['body'][_0x6709('0xcc')]&&_0x6ca78e[_0x6709('0x5e')][_0x6709('0xcd')]){_0x5a23f0=_0x6ca78e[_0x6709('0x5e')][_0x6709('0xcd')];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x6ca78e[_0x6709('0x5e')]['requestid']}});}break;case _0x6709('0xce'):if(_0x6ca78e['body']['message_id']&&_0x6ca78e[_0x6709('0x5e')][_0x6709('0xcf')]){_0x5a23f0=_0x6ca78e[_0x6709('0x5e')]['status_code'];return db[_0x6709('0xa6')]['find']({'where':{'messageId':_0x6ca78e[_0x6709('0x5e')][_0x6709('0x87')]}});}break;case _0x6709('0x89'):var _0x5c5be3=_0x6ca78e[_0x6709('0x5e')][_0x6709('0x8a')][0x0];if(_0x5c5be3[_0x6709('0x84')]&&_0x5c5be3[_0x6709('0x2d')][_0x6709('0xd0')]==='DELIVERED'){_0x5a23f0=_0x5c5be3[_0x6709('0x2d')][_0x6709('0xd0')];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x5c5be3['messageId']}});}break;case _0x6709('0x8f'):if(_0x6ca78e[_0x6709('0x5e')][_0x6709('0x84')]&&_0x6ca78e['body']['status']){_0x5a23f0=_0x6ca78e[_0x6709('0x5e')]['status'];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x6ca78e[_0x6709('0x5e')][_0x6709('0x84')]}});}break;case'intelepeer':if(_0x6ca78e[_0x6709('0x5e')]['redif']&&_0x6ca78e[_0x6709('0x5e')]['status']){_0x5a23f0=_0x6ca78e['body'][_0x6709('0x2d')];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x6ca78e['body']['redif']}});}break;}}})[_0x6709('0x37')](handleEntityNotFound(_0x1c83a8,null))['then'](function(_0x639f1){if(_0x639f1){_0x592597=_0x639f1;switch(_0x1edd42['type']){case _0x6709('0x85'):if(_0x5a23f0===_0x6709('0xd1')){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger['error'](_0x6709('0x27'),_0x6709('0x2d'),'skebby',util[_0x6709('0xca')](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x6709('0xd2'):if(_0x5a23f0==='1'){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger[_0x6709('0x29')](_0x6709('0x27'),'status',_0x6709('0x85'),util['inspect'](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x6ca78e['body'][_0x6709('0xd3')]&&_0x5a23f0>=0xc8&&_0x5a23f0<=0xce){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger['error'](_0x6709('0x27'),_0x6709('0x2d'),_0x6709('0xce'),util[_0x6709('0xca')](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x6709('0x89'):var _0x525bb2=_0x6ca78e[_0x6709('0x5e')][_0x6709('0x8a')][0x0];if(_0x525bb2[_0x6709('0x2d')]['groupName']===_0x6709('0xd1')){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger[_0x6709('0x29')](_0x6709('0x27'),_0x6709('0x2d'),_0x6709('0x89'),util[_0x6709('0xca')](_0x6ca78e['body'],{'showHidden':![],'depth':null}));}break;case _0x6709('0x8f'):if(_0x5a23f0==_0x6709('0xd4')||_0x5a23f0==_0x6709('0xd5')){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger[_0x6709('0x29')](_0x6709('0x27'),_0x6709('0x2d'),'clickatell',util['inspect'](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));}break;case _0x6709('0x91'):if(_0x5a23f0===_0x6709('0xd6')||_0x5a23f0==='ACCEPTD'){return _0x592597[_0x6709('0x36')]({'read':!![]});}else{logger['error'](_0x6709('0x27'),_0x6709('0x2d'),'intelepeer',util[_0x6709('0xca')](_0x6ca78e[_0x6709('0x5e')],{'showHidden':![],'depth':null}));}break;}return _0x592597;}})['then'](respondWithResult(_0x1c83a8,null))[_0x6709('0x2c')](handleError(_0x1c83a8,null));};exports[_0x6709('0xd7')]=function(_0x1da803,_0xa7738d,_0x65b272){var _0x5e49c0,_0x2ea135,_0x2390e4;return db['SmsAccount'][_0x6709('0x5d')]({'where':{'id':_0x1da803[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0xa7738d,null))[_0x6709('0x37')](function(_0xc8a24){if(_0xc8a24){_0x2390e4=_0xc8a24;logger[_0x6709('0xb1')](_0x6709('0x27'),_0x6709('0x2d'),_0x6709('0xc9'),_0xc8a24[_0x6709('0x45')],util[_0x6709('0xca')](_0x1da803[_0x6709('0x48')],{'showHidden':![],'depth':null}));switch(_0xc8a24[_0x6709('0x45')]){case _0x6709('0x8c'):if(_0x1da803[_0x6709('0x48')][_0x6709('0xd8')]&&_0x1da803['query']['state']){_0x2ea135=_0x1da803[_0x6709('0x48')][_0x6709('0xd9')];return db[_0x6709('0xa6')][_0x6709('0x5d')]({'where':{'messageId':_0x1da803[_0x6709('0x48')][_0x6709('0xd8')]}});}break;}}})[_0x6709('0x37')](handleEntityNotFound(_0xa7738d,null))['then'](function(_0x55c582){if(_0x55c582){_0x5e49c0=_0x55c582;switch(_0x2390e4[_0x6709('0x45')]){case _0x6709('0x8c'):if(_0x2ea135==='2'||_0x2ea135==='6'){return _0x5e49c0[_0x6709('0x36')]({'read':!![]});}else{logger[_0x6709('0x29')](_0x6709('0x27'),_0x6709('0x2d'),_0x6709('0x8c'),util[_0x6709('0xca')](_0x1da803[_0x6709('0x48')],{'showHidden':![],'depth':null}));};break;}return _0x5e49c0;}})['then'](respondWithResult(_0xa7738d,null))[_0x6709('0x2c')](handleError(_0xa7738d,null));};exports['addAgents']=function(_0x5f59a1,_0x724cdc,_0x206fdd){return db[_0x6709('0x43')][_0x6709('0x5d')]({'where':{'id':_0x5f59a1[_0x6709('0x5b')]['id']}})[_0x6709('0x37')](handleEntityNotFound(_0x724cdc,null))[_0x6709('0x37')](function(_0x59539e){if(_0x59539e){return _0x59539e[_0x6709('0xda')](_0x5f59a1[_0x6709('0x5e')][_0x6709('0x72')],_[_0x6709('0xdb')](_0x5f59a1[_0x6709('0x5e')],[_0x6709('0x72'),'id'])||{})['spread'](function(_0x58a02f){for(var _0x1315b9=0x0;_0x1315b9<_0x5f59a1['body'][_0x6709('0x72')][_0x6709('0x70')];_0x1315b9+=0x1){socket[_0x6709('0xdc')](_0x6709('0xdd'),{'UserId':_0x5f59a1[_0x6709('0x5e')][_0x6709('0x72')][_0x1315b9],'SmsAccountId':_0x5f59a1[_0x6709('0x5b')]['id']});}return _0x58a02f;});}})[_0x6709('0x37')](respondWithResult(_0x724cdc,null))['catch'](handleError(_0x724cdc,null));};exports['removeAgents']=function(_0x11ee91,_0x31b667,_0x140b77){return db[_0x6709('0x43')]['find']({'where':{'id':_0x11ee91[_0x6709('0x5b')]['id']}})['then'](handleEntityNotFound(_0x31b667,null))[_0x6709('0x37')](function(_0x3e8717){if(_0x3e8717){return _0x3e8717[_0x6709('0xde')](_0x11ee91[_0x6709('0x48')][_0x6709('0x72')])[_0x6709('0x37')](function(){if(_[_0x6709('0xdf')](_0x11ee91[_0x6709('0x48')][_0x6709('0x72')])){for(var _0x104e8f=0x0;_0x104e8f<_0x11ee91[_0x6709('0x48')][_0x6709('0x72')]['length'];_0x104e8f+=0x1){socket[_0x6709('0xdc')](_0x6709('0xe0'),{'UserId':Number(_0x11ee91[_0x6709('0x48')]['ids'][_0x104e8f]),'SmsAccountId':Number(_0x11ee91[_0x6709('0x5b')]['id'])});}}else{socket['emit']('userSmsAccount:remove',{'UserId':Number(_0x11ee91[_0x6709('0x48')][_0x6709('0x72')]),'SmsAccountId':Number(_0x11ee91[_0x6709('0x5b')]['id'])});}});}})[_0x6709('0x37')](respondWithStatusCode(_0x31b667,null))[_0x6709('0x2c')](handleError(_0x31b667,null));};exports[_0x6709('0xe1')]=function(_0x5f1fb4,_0xed31e6,_0x2fcc77){var _0x1abe0e={};var _0x5f57f1={};var _0x2f4b44;var _0x20fd9d;return db[_0x6709('0x43')][_0x6709('0x6f')]({'where':{'id':_0x5f1fb4[_0x6709('0x5b')]['id']}})['then'](handleEntityNotFound(_0xed31e6,null))[_0x6709('0x37')](function(_0x5a2329){if(_0x5a2329){_0x2f4b44=_0x5a2329;_0x5f57f1[_0x6709('0x47')]=_[_0x6709('0x5c')](db[_0x6709('0xa9')]['rawAttributes']);_0x5f57f1[_0x6709('0x48')]=_[_0x6709('0x5c')](_0x5f1fb4[_0x6709('0x48')]);_0x5f57f1[_0x6709('0x49')]=_[_0x6709('0x4a')](_0x5f57f1['model'],_0x5f57f1['query']);_0x1abe0e[_0x6709('0x4c')]=_['intersection'](_0x5f57f1[_0x6709('0x47')],qs['fields'](_0x5f1fb4[_0x6709('0x48')]['fields']));_0x1abe0e[_0x6709('0x4c')]=_0x1abe0e['attributes'][_0x6709('0x70')]?_0x1abe0e[_0x6709('0x4c')]:_0x5f57f1[_0x6709('0x47')];_0x1abe0e[_0x6709('0xba')]=qs['sort'](_0x5f1fb4['query'][_0x6709('0x4f')]);_0x1abe0e[_0x6709('0x50')]=qs[_0x6709('0x49')](_[_0x6709('0x51')](_0x5f1fb4[_0x6709('0x48')],_0x5f57f1[_0x6709('0x49')]));if(_0x5f1fb4[_0x6709('0x48')]['filter']){_0x1abe0e['where']=_[_0x6709('0x53')](_0x1abe0e['where'],{'$or':_['map'](_0x1abe0e[_0x6709('0x4c')],function(_0x536907){var _0x290db8={};_0x290db8[_0x536907]={'$like':'%'+_0x5f1fb4[_0x6709('0x48')][_0x6709('0x52')]+'%'};return _0x290db8;})});}_0x1abe0e=_[_0x6709('0x53')]({},_0x1abe0e,_0x5f1fb4['options']);return _0x2f4b44[_0x6709('0xe1')](_0x1abe0e);}})[_0x6709('0x37')](function(_0x1c2de6){if(_0x1c2de6){_0x20fd9d=_0x1c2de6[_0x6709('0x70')];if(!_0x5f1fb4[_0x6709('0x48')][_0x6709('0x4d')](_0x6709('0x4e'))){_0x1abe0e['limit']=qs[_0x6709('0x2f')](_0x5f1fb4['query'][_0x6709('0x2f')]);_0x1abe0e[_0x6709('0x2e')]=qs[_0x6709('0x2e')](_0x5f1fb4[_0x6709('0x48')][_0x6709('0x2e')]);}return _0x2f4b44[_0x6709('0xe1')](_0x1abe0e);}})[_0x6709('0x37')](function(_0x495b61){if(_0x495b61){return _0x495b61?{'count':_0x20fd9d,'rows':_0x495b61}:null;}})[_0x6709('0x37')](respondWithResult(_0xed31e6,null))[_0x6709('0x2c')](handleError(_0xed31e6,null));}; \ No newline at end of file +var _0x2884=['debug','text/xml','\x0a','addApplications','findOne','sequelize','transaction','bulkCreate','getApplications','Contact','internal','Tag','Tags','color','tag','List','out','Messages','spread','dataValues','log','received\x20delivery\x20report\x20from','inspect','skebby','skebby_dispatch_id','connectel','statusInt','requestid','status_code','groupName','DELIVERED','intelepeer','redif','error_code','clicksend','DELIVERED_TO_GATEWAY','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','sox','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./smsAccount.socket','register','client','test','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','info','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','SmsAccount,\x20%s,\x20%s','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','then','get','SmsAccounts','stack','name','send','index','Pause','map','SmsAccount','fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','show','params','rawAttributes','length','find','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','mandatoryDispositionPause','describe','addDisposition','SmsAccountId','Disposition','removeDispositions','addAnswer','CannedAnswer','findAll','removeAnswers','ids','notify','sms','SmsApplication','Applications','account','applications','orderBy','priority','asc','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','mobile','twilio','from','messageId','sender','message_id','plivo','From','Text','MessageUUID','infobip','results','text','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','replyMessageId','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','omit','contact','SmsInteraction','interaction','created','push','close','*,*,*,*','SmsMessage','AttachmentId','User','agent','waitForTheAssignedAgent','Start','receiveMessage','entity\x20found'];(function(_0x8e3eab,_0x47631b){var _0x35888a=function(_0x4ee874){while(--_0x4ee874){_0x8e3eab['push'](_0x8e3eab['shift']());}};_0x35888a(++_0x47631b);}(_0x2884,0x1eb));var _0x4288=function(_0x24d06a,_0x59c850){_0x24d06a=_0x24d06a-0x0;var _0x4a987d=_0x2884[_0x24d06a];return _0x4a987d;};'use strict';var pdf=require(_0x4288('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x4288('0x1'));var zipdir=require(_0x4288('0x2'));var jsonpatch=require(_0x4288('0x3'));var rp=require('request-promise');var moment=require(_0x4288('0x4'));var BPromise=require(_0x4288('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4288('0x6'));var sox=require(_0x4288('0x7'));var csv=require(_0x4288('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x4288('0x9'));var crypto=require('crypto');var jsforce=require(_0x4288('0xa'));var deskjs=require(_0x4288('0xb'));var toCsv=require('to-csv');var querystring=require(_0x4288('0xc'));var Papa=require(_0x4288('0xd'));var Redis=require(_0x4288('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x4288('0xf'));var hardwareService=require(_0x4288('0x10'));var logger=require(_0x4288('0x11'))(_0x4288('0x12'));var utils=require(_0x4288('0x13'));var config=require(_0x4288('0x14'));var db=require(_0x4288('0x15'))['db'];config['redis']=_[_0x4288('0x16')](config[_0x4288('0x17')],{'host':_0x4288('0x18'),'port':0x18eb});var socket=require(_0x4288('0x19'))(new Redis(config['redis']));require(_0x4288('0x1a'))[_0x4288('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0x4288('0x1c')]['http']({'port':0x232c});function checkPasswordPattern(_0x1939b0,_0x5c43e4,_0x35d792){if(_0x35d792){var _0x1c3a7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c3a7f[_0x4288('0x1d')](_0x5c43e4)){return _0x1939b0;}else{throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))](_0x4288('0x20'));}}else{return _0x1939b0;}}function respondWithRpcPromise(_0xb73bf5,_0x4b4b0c,_0x47f4a3,_0x53fb81){return new BPromise(function(_0x199919,_0xde03f4){var _0x5e6de1=_0x53fb81||client;return _0x5e6de1['request'](_0xb73bf5,_0x47f4a3)['then'](function(_0x417d89){logger[_0x4288('0x21')]('SmsAccount,\x20%s,\x20%s',_0x4b4b0c,_0x4288('0x22'));logger['debug'](_0x4288('0x23'),_0x4b4b0c,_0x4288('0x22'),JSON[_0x4288('0x24')](_0x417d89));if(_0x417d89['error']){if(_0x417d89[_0x4288('0x25')][_0x4288('0x26')]===0x1f4){logger[_0x4288('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4b4b0c,_0x417d89['error'][_0x4288('0x27')]);return _0xde03f4(_0x417d89[_0x4288('0x25')][_0x4288('0x27')]);}logger[_0x4288('0x25')](_0x4288('0x28'),_0x4b4b0c,_0x417d89[_0x4288('0x25')]['message']);return _0x199919(_0x417d89['error'][_0x4288('0x27')]);}else{logger[_0x4288('0x21')]('SmsAccount,\x20%s,\x20%s',_0x4b4b0c,_0x4288('0x22'));_0x199919(_0x417d89['result']['message']);}})[_0x4288('0x29')](function(_0x1ac7b3){logger[_0x4288('0x25')]('SmsAccount,\x20%s,\x20%s',_0x4b4b0c,_0x1ac7b3);_0xde03f4(_0x1ac7b3);});});}function respondWithStatusCode(_0xcd16d3,_0x1bba92){_0x1bba92=_0x1bba92||0xcc;return function(_0xec0001){if(_0xec0001){return _0xcd16d3[_0x4288('0x2a')](_0x1bba92);}return _0xcd16d3[_0x4288('0x2b')](_0x1bba92)[_0x4288('0x2c')]();};}function respondWithResult(_0x4cc8bd,_0x3a8e3e){_0x3a8e3e=_0x3a8e3e||0xc8;return function(_0x29a0e5){if(_0x29a0e5){return _0x4cc8bd[_0x4288('0x2b')](_0x3a8e3e)[_0x4288('0x2d')](_0x29a0e5);}};}function respondWithFilteredResult(_0x31deab,_0x338bda){return function(_0x41f53e){if(_0x41f53e){var _0x5bca41=_0x41f53e[_0x4288('0x2e')],_0x393d0=_0x338bda[_0x4288('0x2f')],_0x396cca=_0x338bda['offset']+_0x338bda[_0x4288('0x30')],_0x375efa;if(_0x396cca>=_0x5bca41){_0x396cca=_0x5bca41;_0x375efa=0xc8;}else{_0x375efa=0xce;}_0x31deab[_0x4288('0x2b')](_0x375efa);return _0x31deab[_0x4288('0x31')](_0x4288('0x32'),_0x393d0+'-'+_0x396cca+'/'+_0x5bca41)[_0x4288('0x2d')](_0x41f53e);}return null;};}function patchUpdates(_0x5399d8){return function(_0x40ba75){try{jsonpatch[_0x4288('0x33')](_0x40ba75,_0x5399d8,!![]);}catch(_0x428f79){return BPromise[_0x4288('0x34')](_0x428f79);}return _0x40ba75['save']();};}function saveUpdates(_0x25147b,_0x211a21){return function(_0x1d6875){if(_0x1d6875){return _0x1d6875[_0x4288('0x35')](_0x25147b)['then'](function(_0x911af4){return _0x911af4;});}return null;};}function removeEntity(_0x463b61,_0x223fd5){return function(_0x304b2f){if(_0x304b2f){return _0x304b2f[_0x4288('0x36')]()[_0x4288('0x37')](function(){var _0x566763=_0x304b2f[_0x4288('0x38')]({'plain':!![]});var _0x4be5d8=_0x4288('0x39');return db['UserProfileResource']['destroy']({'where':{'type':_0x4be5d8,'resourceId':_0x566763['id']}})[_0x4288('0x37')](function(){return _0x304b2f;});})[_0x4288('0x37')](function(){_0x463b61[_0x4288('0x2b')](0xcc)[_0x4288('0x2c')]();});}};}function handleEntityNotFound(_0x1749f2,_0x27806a){return function(_0x585de4){if(!_0x585de4){_0x1749f2[_0x4288('0x2a')](0x194);}return _0x585de4;};}function handleError(_0x2fdc25,_0x438922){_0x438922=_0x438922||0x1f4;return function(_0x478c85){logger[_0x4288('0x25')](_0x478c85[_0x4288('0x3a')]);if(_0x478c85[_0x4288('0x3b')]){delete _0x478c85[_0x4288('0x3b')];}_0x2fdc25[_0x4288('0x2b')](_0x438922)[_0x4288('0x3c')](_0x478c85);};}exports[_0x4288('0x3d')]=function(_0x237541,_0x2384c7){var _0x3733a2={'include':[{'model':db[_0x4288('0x3e')],'as':'mandatoryDispositionPause'}]},_0xfa8bc9={},_0x93925e={'count':0x0,'rows':[]};var _0x36bd21=_[_0x4288('0x3f')](db[_0x4288('0x40')]['rawAttributes'],function(_0x29494b){return{'name':_0x29494b[_0x4288('0x41')],'type':_0x29494b[_0x4288('0x42')]['key']};});_0xfa8bc9[_0x4288('0x43')]=_[_0x4288('0x3f')](_0x36bd21,_0x4288('0x3b'));_0xfa8bc9[_0x4288('0x44')]=_[_0x4288('0x45')](_0x237541[_0x4288('0x44')]);_0xfa8bc9[_0x4288('0x46')]=_[_0x4288('0x47')](_0xfa8bc9[_0x4288('0x43')],_0xfa8bc9[_0x4288('0x44')]);_0x3733a2[_0x4288('0x48')]=_[_0x4288('0x47')](_0xfa8bc9[_0x4288('0x43')],qs[_0x4288('0x49')](_0x237541[_0x4288('0x44')][_0x4288('0x49')]));_0x3733a2[_0x4288('0x48')]=_0x3733a2[_0x4288('0x48')]['length']?_0x3733a2[_0x4288('0x48')]:_0xfa8bc9['model'];if(!_0x237541[_0x4288('0x44')][_0x4288('0x4a')](_0x4288('0x4b'))){_0x3733a2[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x237541[_0x4288('0x44')][_0x4288('0x30')]);_0x3733a2[_0x4288('0x2f')]=qs[_0x4288('0x2f')](_0x237541[_0x4288('0x44')][_0x4288('0x2f')]);}_0x3733a2[_0x4288('0x4c')]=qs[_0x4288('0x4d')](_0x237541[_0x4288('0x44')][_0x4288('0x4d')]);_0x3733a2[_0x4288('0x4e')]=qs[_0x4288('0x46')](_[_0x4288('0x4f')](_0x237541[_0x4288('0x44')],_0xfa8bc9[_0x4288('0x46')]));if(_0x237541[_0x4288('0x44')][_0x4288('0x50')]){_0x3733a2['where']=_[_0x4288('0x51')](_0x3733a2[_0x4288('0x4e')],{'$or':_['map'](_0x36bd21,function(_0x1f79f9){if(_0x1f79f9[_0x4288('0x42')]!=='VIRTUAL'){var _0x259616={};_0x259616[_0x1f79f9[_0x4288('0x3b')]]={'$like':'%'+_0x237541[_0x4288('0x44')][_0x4288('0x50')]+'%'};return _0x259616;}})});}_0x3733a2=_[_0x4288('0x51')]({},_0x3733a2,_0x237541[_0x4288('0x52')]);var _0x2fda48={'where':_0x3733a2['where']};return db[_0x4288('0x40')][_0x4288('0x2e')](_0x2fda48)[_0x4288('0x37')](function(_0x462f1f){_0x93925e[_0x4288('0x2e')]=_0x462f1f;if(_0x237541[_0x4288('0x44')][_0x4288('0x53')]){_0x3733a2[_0x4288('0x54')]=[{'all':!![]}];}return db[_0x4288('0x40')]['findAll'](_0x3733a2);})[_0x4288('0x37')](function(_0x51e6c4){_0x93925e[_0x4288('0x55')]=_0x51e6c4;return _0x93925e;})['then'](respondWithFilteredResult(_0x2384c7,_0x3733a2))['catch'](handleError(_0x2384c7,null));};exports[_0x4288('0x56')]=function(_0x1f627c,_0x2ed7bc){var _0x29f3bd={'raw':![],'where':{'id':_0x1f627c[_0x4288('0x57')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x23158b={};_0x23158b['model']=_[_0x4288('0x45')](db['SmsAccount'][_0x4288('0x58')]);_0x23158b[_0x4288('0x44')]=_[_0x4288('0x45')](_0x1f627c[_0x4288('0x44')]);_0x23158b[_0x4288('0x46')]=_[_0x4288('0x47')](_0x23158b[_0x4288('0x43')],_0x23158b[_0x4288('0x44')]);_0x29f3bd['attributes']=_[_0x4288('0x47')](_0x23158b[_0x4288('0x43')],qs[_0x4288('0x49')](_0x1f627c['query'][_0x4288('0x49')]));_0x29f3bd[_0x4288('0x48')]=_0x29f3bd[_0x4288('0x48')][_0x4288('0x59')]?_0x29f3bd[_0x4288('0x48')]:_0x23158b['model'];if(_0x1f627c[_0x4288('0x44')]['includeAll']){_0x29f3bd['include']=[{'all':!![]}];}_0x29f3bd=_['merge']({},_0x29f3bd,_0x1f627c['options']);return db[_0x4288('0x40')][_0x4288('0x5a')](_0x29f3bd)['then'](handleEntityNotFound(_0x2ed7bc,null))[_0x4288('0x37')](respondWithResult(_0x2ed7bc,null))['catch'](handleError(_0x2ed7bc,null));};exports['create']=function(_0x3a9ea2,_0x32dc1f){return db[_0x4288('0x40')]['create'](_0x3a9ea2[_0x4288('0x5b')],{})[_0x4288('0x37')](function(_0x32eb73){var _0x20115e=_0x3a9ea2[_0x4288('0x5c')][_0x4288('0x38')]({'plain':!![]});if(!_0x20115e)throw new Error(_0x4288('0x5d'));if(_0x20115e[_0x4288('0x5e')]===_0x4288('0x5c')){var _0x48ece6=_0x32eb73[_0x4288('0x38')]({'plain':!![]});var _0xd6925a=_0x4288('0x39');return db[_0x4288('0x5f')][_0x4288('0x5a')]({'where':{'name':_0xd6925a,'userProfileId':_0x20115e[_0x4288('0x60')]},'raw':!![]})['then'](function(_0x3637e9){if(_0x3637e9&&_0x3637e9[_0x4288('0x61')]===0x0){return db[_0x4288('0x62')][_0x4288('0x63')]({'name':_0x48ece6[_0x4288('0x3b')],'resourceId':_0x48ece6['id'],'type':_0x3637e9[_0x4288('0x3b')],'sectionId':_0x3637e9['id']},{})[_0x4288('0x37')](function(){return _0x32eb73;});}else{return _0x32eb73;}})[_0x4288('0x29')](function(_0x44a419){logger[_0x4288('0x25')](_0x4288('0x64'),_0x44a419);throw _0x44a419;});}return _0x32eb73;})[_0x4288('0x37')](respondWithResult(_0x32dc1f,0xc9))[_0x4288('0x29')](handleError(_0x32dc1f,null));};exports['update']=function(_0x52e991,_0x583f62){if(_0x52e991[_0x4288('0x5b')]['id']){delete _0x52e991[_0x4288('0x5b')]['id'];}return db['SmsAccount'][_0x4288('0x5a')]({'where':{'id':_0x52e991[_0x4288('0x57')]['id']},'include':[{'model':db['Pause'],'as':_0x4288('0x65')}]})[_0x4288('0x37')](handleEntityNotFound(_0x583f62,null))['then'](saveUpdates(_0x52e991[_0x4288('0x5b')],null))['then'](respondWithResult(_0x583f62,null))[_0x4288('0x29')](handleError(_0x583f62,null));};exports['destroy']=function(_0x3f55b6,_0x12282a){return db[_0x4288('0x40')]['find']({'where':{'id':_0x3f55b6[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x12282a,null))[_0x4288('0x37')](removeEntity(_0x12282a,null))['catch'](handleError(_0x12282a,null));};exports[_0x4288('0x66')]=function(_0x2bb930,_0x5dd204){return db[_0x4288('0x40')]['describe']()[_0x4288('0x37')](respondWithResult(_0x5dd204,null))[_0x4288('0x29')](handleError(_0x5dd204,null));};exports[_0x4288('0x67')]=function(_0x7e1b6a,_0x1e6ed2,_0xb5351f){if(_0x7e1b6a[_0x4288('0x5b')]['id']){delete _0x7e1b6a[_0x4288('0x5b')]['id'];}return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x7e1b6a['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x1e6ed2,null))[_0x4288('0x37')](function(_0x533fcd){if(_0x533fcd){_0x7e1b6a[_0x4288('0x5b')][_0x4288('0x68')]=_0x533fcd['id'];return db[_0x4288('0x69')][_0x4288('0x63')](_0x7e1b6a[_0x4288('0x5b')]);}})[_0x4288('0x37')](respondWithResult(_0x1e6ed2,null))[_0x4288('0x29')](handleError(_0x1e6ed2,null));};exports['getDispositions']=function(_0x3873ca,_0xc2623d,_0x1ca8b5){var _0x337722={'raw':![],'where':{}};var _0x1df79e={};var _0xe69237={'count':0x0,'rows':[]};return db[_0x4288('0x40')]['findOne']({'where':{'id':_0x3873ca[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0xc2623d,null))[_0x4288('0x37')](function(_0x328730){if(_0x328730){_0x1df79e['model']=_[_0x4288('0x45')](db[_0x4288('0x69')][_0x4288('0x58')]);_0x1df79e[_0x4288('0x44')]=_['keys'](_0x3873ca[_0x4288('0x44')]);_0x1df79e[_0x4288('0x46')]=_[_0x4288('0x47')](_0x1df79e[_0x4288('0x43')],_0x1df79e[_0x4288('0x44')]);_0x337722[_0x4288('0x48')]=_[_0x4288('0x47')](_0x1df79e[_0x4288('0x43')],qs['fields'](_0x3873ca[_0x4288('0x44')][_0x4288('0x49')]));_0x337722[_0x4288('0x48')]=_0x337722[_0x4288('0x48')][_0x4288('0x59')]?_0x337722[_0x4288('0x48')]:_0x1df79e[_0x4288('0x43')];if(!_0x3873ca[_0x4288('0x44')][_0x4288('0x4a')](_0x4288('0x4b'))){_0x337722[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x3873ca['query']['limit']);_0x337722[_0x4288('0x2f')]=qs[_0x4288('0x2f')](_0x3873ca['query'][_0x4288('0x2f')]);}_0x337722['order']=qs[_0x4288('0x4d')](_0x3873ca[_0x4288('0x44')][_0x4288('0x4d')]);_0x337722['where']=qs[_0x4288('0x46')](_[_0x4288('0x4f')](_0x3873ca[_0x4288('0x44')],_0x1df79e[_0x4288('0x46')]));_0x337722[_0x4288('0x4e')][_0x4288('0x68')]=_0x328730['id'];if(_0x3873ca[_0x4288('0x44')][_0x4288('0x50')]){_0x337722['where']=_[_0x4288('0x51')](_0x337722['where'],{'$or':_['map'](_0x337722[_0x4288('0x48')],function(_0x433e60){var _0x20667e={};_0x20667e[_0x433e60]={'$like':'%'+_0x3873ca[_0x4288('0x44')][_0x4288('0x50')]+'%'};return _0x20667e;})});}_0x337722=_[_0x4288('0x51')]({},_0x337722,_0x3873ca[_0x4288('0x52')]);return db[_0x4288('0x69')][_0x4288('0x2e')]({'where':_0x337722[_0x4288('0x4e')]})[_0x4288('0x37')](function(_0x29943a){_0xe69237['count']=_0x29943a;if(_0x3873ca[_0x4288('0x44')]['includeAll']){_0x337722[_0x4288('0x54')]=[{'all':!![]}];}return db[_0x4288('0x69')]['findAll'](_0x337722);})[_0x4288('0x37')](function(_0x3a0d77){_0xe69237[_0x4288('0x55')]=_0x3a0d77;return _0xe69237;});}})['then'](respondWithFilteredResult(_0xc2623d,_0x337722))[_0x4288('0x29')](handleError(_0xc2623d,null));};exports[_0x4288('0x6a')]=function(_0x529191,_0x4a4127,_0x58d0f2){return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x529191['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x4a4127,null))[_0x4288('0x37')](function(_0x48a8f4){if(_0x48a8f4){return _0x48a8f4[_0x4288('0x6a')](_0x529191[_0x4288('0x44')]['ids']);}})[_0x4288('0x37')](respondWithStatusCode(_0x4a4127,null))[_0x4288('0x29')](handleError(_0x4a4127,null));};exports[_0x4288('0x6b')]=function(_0xc24703,_0x3f14f1,_0x49b001){if(_0xc24703[_0x4288('0x5b')]['id']){delete _0xc24703[_0x4288('0x5b')]['id'];}return db[_0x4288('0x40')]['find']({'where':{'id':_0xc24703[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x3f14f1,null))[_0x4288('0x37')](function(_0x261437){if(_0x261437){_0xc24703[_0x4288('0x5b')][_0x4288('0x68')]=_0x261437['id'];return db[_0x4288('0x6c')][_0x4288('0x63')](_0xc24703['body']);}})[_0x4288('0x37')](respondWithResult(_0x3f14f1,null))['catch'](handleError(_0x3f14f1,null));};exports['getAnswers']=function(_0x3c80,_0x47b245,_0x5ee58d){var _0x1666c2={'raw':![],'where':{}};var _0xd41031={};var _0x51a5da={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x3c80['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x47b245,null))[_0x4288('0x37')](function(_0x16f2e5){if(_0x16f2e5){_0xd41031['model']=_[_0x4288('0x45')](db[_0x4288('0x6c')][_0x4288('0x58')]);_0xd41031[_0x4288('0x44')]=_[_0x4288('0x45')](_0x3c80[_0x4288('0x44')]);_0xd41031[_0x4288('0x46')]=_[_0x4288('0x47')](_0xd41031[_0x4288('0x43')],_0xd41031[_0x4288('0x44')]);_0x1666c2[_0x4288('0x48')]=_[_0x4288('0x47')](_0xd41031[_0x4288('0x43')],qs['fields'](_0x3c80[_0x4288('0x44')]['fields']));_0x1666c2[_0x4288('0x48')]=_0x1666c2[_0x4288('0x48')][_0x4288('0x59')]?_0x1666c2[_0x4288('0x48')]:_0xd41031[_0x4288('0x43')];if(!_0x3c80[_0x4288('0x44')][_0x4288('0x4a')](_0x4288('0x4b'))){_0x1666c2[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x3c80['query'][_0x4288('0x30')]);_0x1666c2[_0x4288('0x2f')]=qs[_0x4288('0x2f')](_0x3c80[_0x4288('0x44')][_0x4288('0x2f')]);}_0x1666c2['order']=qs[_0x4288('0x4d')](_0x3c80['query'][_0x4288('0x4d')]);_0x1666c2['where']=qs[_0x4288('0x46')](_[_0x4288('0x4f')](_0x3c80[_0x4288('0x44')],_0xd41031[_0x4288('0x46')]));_0x1666c2[_0x4288('0x4e')][_0x4288('0x68')]=_0x16f2e5['id'];if(_0x3c80[_0x4288('0x44')][_0x4288('0x50')]){_0x1666c2[_0x4288('0x4e')]=_[_0x4288('0x51')](_0x1666c2['where'],{'$or':_['map'](_0x1666c2[_0x4288('0x48')],function(_0x5cde44){var _0x185f6c={};_0x185f6c[_0x5cde44]={'$like':'%'+_0x3c80['query']['filter']+'%'};return _0x185f6c;})});}_0x1666c2=_[_0x4288('0x51')]({},_0x1666c2,_0x3c80[_0x4288('0x52')]);return db['CannedAnswer'][_0x4288('0x2e')]({'where':_0x1666c2['where']})[_0x4288('0x37')](function(_0x137e33){_0x51a5da[_0x4288('0x2e')]=_0x137e33;if(_0x3c80['query'][_0x4288('0x53')]){_0x1666c2[_0x4288('0x54')]=[{'all':!![]}];}return db['CannedAnswer'][_0x4288('0x6d')](_0x1666c2);})[_0x4288('0x37')](function(_0x49fa3b){_0x51a5da[_0x4288('0x55')]=_0x49fa3b;return _0x51a5da;});}})['then'](respondWithFilteredResult(_0x47b245,_0x1666c2))[_0x4288('0x29')](handleError(_0x47b245,null));};exports[_0x4288('0x6e')]=function(_0x2afbe4,_0x155393,_0x236110){return db['SmsAccount'][_0x4288('0x5a')]({'where':{'id':_0x2afbe4[_0x4288('0x57')]['id']}})['then'](handleEntityNotFound(_0x155393,null))[_0x4288('0x37')](function(_0x258b93){if(_0x258b93){return _0x258b93[_0x4288('0x6e')](_0x2afbe4['query'][_0x4288('0x6f')]);}})[_0x4288('0x37')](respondWithStatusCode(_0x155393,null))[_0x4288('0x29')](handleError(_0x155393,null));};exports[_0x4288('0x70')]=function(_0x555c5e,_0x153124,_0x40145f){var _0xa3afe6={'channel':_0x4288('0x71')};var _0x1f4141=[];var _0x57f709=[];var _0x44b3e9={};return db[_0x4288('0x40')]['find']({'where':{'id':_0x555c5e[_0x4288('0x57')]['id']},'include':[{'model':db[_0x4288('0x72')],'as':_0x4288('0x73')}]})[_0x4288('0x37')](handleEntityNotFound(_0x153124,null))[_0x4288('0x37')](function(_0x236b1a){_0xa3afe6[_0x4288('0x74')]=_0x236b1a;_0xa3afe6[_0x4288('0x75')]=_[_0x4288('0x76')](_0x236b1a[_0x4288('0x73')],[_0x4288('0x77')],[_0x4288('0x78')]);if(_0xa3afe6['account']['Applications']){delete _0xa3afe6[_0x4288('0x74')][_0x4288('0x73')];}return db[_0x4288('0x79')][_0x4288('0x66')]();})[_0x4288('0x37')](function(_0x474dd4){if(!_0x474dd4){throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))](_0x4288('0x7a'));}_0x1f4141=_[_0x4288('0x7b')](_[_0x4288('0x45')](_0x474dd4),[_0x4288('0x7c'),_0x4288('0x7d')]);_0x57f709=_[_0x4288('0x7b')](_[_0x4288('0x45')](_0x474dd4),[_0x4288('0x7c'),_0x4288('0x7d'),_0x4288('0x7e'),_0x4288('0x7f')]);_0xa3afe6[_0x4288('0x5b')]={'mapKey':_0x4288('0x80')};if(_0xa3afe6[_0x4288('0x74')][_0x4288('0x42')]){switch(_0xa3afe6[_0x4288('0x74')][_0x4288('0x42')]){case _0x4288('0x81'):_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]=_0x555c5e[_0x4288('0x5b')]['From'];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]=_0x555c5e['body']['Body'];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x83')]=_0x555c5e['body']['MessageSid'];break;case'skebby':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]='+'+_0x555c5e[_0x4288('0x5b')][_0x4288('0x84')];_0xa3afe6[_0x4288('0x5b')]['body']=_0x555c5e['body']['text'];break;case'connectel':_0xa3afe6['body']['from']=_0x555c5e[_0x4288('0x5b')]['from'];_0xa3afe6[_0x4288('0x5b')]['body']=_0x555c5e[_0x4288('0x5b')][_0x4288('0x27')];break;case'clicksend':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]=_0x555c5e['body']['from'];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]=_0x555c5e[_0x4288('0x5b')]['body'];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x83')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x85')];break;case _0x4288('0x86'):_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x87')];_0xa3afe6['body']['body']=_0x555c5e[_0x4288('0x5b')][_0x4288('0x88')];_0xa3afe6[_0x4288('0x5b')]['messageId']=_0x555c5e[_0x4288('0x5b')][_0x4288('0x89')];break;case _0x4288('0x8a'):_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]='+'+_0x555c5e[_0x4288('0x5b')][_0x4288('0x8b')][0x0][_0x4288('0x82')];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x8b')][0x0][_0x4288('0x8c')];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x83')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x8b')][0x0][_0x4288('0x83')];break;case _0x4288('0x8d'):_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x8e')];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x8f')]['message'];break;case _0x4288('0x90'):_0xa3afe6[_0x4288('0x5b')]['from']=_0x555c5e[_0x4288('0x5b')][_0x4288('0x91')];_0xa3afe6['body'][_0x4288('0x5b')]=_0x555c5e['body'][_0x4288('0x8c')];_0xa3afe6['body']['messageId']=_0x555c5e[_0x4288('0x5b')][_0x4288('0x92')];break;case'intelepeer':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x82')];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]=_0x555c5e['body']['message'];_0xa3afe6[_0x4288('0x5b')][_0x4288('0x83')]=_0x555c5e[_0x4288('0x5b')][_0x4288('0x93')];break;}}if(_0xa3afe6[_0x4288('0x5b')]['id']){delete _0xa3afe6['body']['id'];}if(_[_0x4288('0x94')](_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')])){throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))](_0x4288('0x95'));}if(_['isNil'](_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')])||_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')]===''){throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))](_0x4288('0x96'));}if(_[_0x4288('0x94')](_0xa3afe6[_0x4288('0x5b')][_0x4288('0x97')])){throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))](_0x4288('0x98')+_0x57f709);}if(!_['includes'](_0x57f709,_0xa3afe6['body']['mapKey'])){throw new db['Sequelize'][(_0x4288('0x1f'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x57f709);}_0x44b3e9[_0xa3afe6[_0x4288('0x5b')]['mapKey']]=_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')];return db[_0x4288('0x99')]['find']({'where':{'id':_0xa3afe6[_0x4288('0x74')]['ListId']},'include':[{'model':db[_0x4288('0x79')],'as':_0x4288('0x9a'),'where':_0x44b3e9,'limit':0x1,'order':[['updatedAt',_0x4288('0x9b')]]}]});})[_0x4288('0x37')](handleEntityNotFound(_0x153124,null))['then'](function(_0x56b855){if(_0x56b855){_0xa3afe6['list']=_[_0x4288('0x9c')](_0x56b855,[_0x4288('0x9a')]);if(_0x56b855['Contacts'][_0x4288('0x59')]){return _0x56b855[_0x4288('0x9a')][0x0];}var _0xad2b37=_[_0x4288('0x16')](_0xa3afe6[_0x4288('0x5b')],{'firstName':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')],'ListId':_0x56b855['id']});_0xad2b37[_0xa3afe6[_0x4288('0x5b')][_0x4288('0x97')]]=_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')];return db[_0x4288('0x79')][_0x4288('0x63')](_0xad2b37,{'fields':_0x1f4141,'raw':!![]});}})[_0x4288('0x37')](handleEntityNotFound(_0x153124,null))[_0x4288('0x37')](function(_0xacac4d){if(_0xacac4d){_0xa3afe6[_0x4288('0x9d')]=_0xacac4d;var _0xdc40e8={'ContactId':_0xacac4d['id'],'phone':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')],'SmsAccountId':_0x555c5e[_0x4288('0x57')]['id']};var _0x29da21={'ContactId':_0xacac4d['id'],'SmsAccountId':_0x555c5e['params']['id'],'closed':![]};return db[_0x4288('0x9e')][_0x4288('0x5a')]({'where':_0x29da21})[_0x4288('0x37')](function(_0x41d90b){if(_0x41d90b){return[_0x41d90b,![]];}return db['SmsInteraction']['create'](_0xdc40e8)[_0x4288('0x37')](function(_0x4f1fb3){return[_0x4f1fb3,!![]];});});}})['spread'](function(_0x83c391,_0x377bb0){_0xa3afe6[_0x4288('0x9f')]=_0x83c391[_0x4288('0x38')]({'plain':!![]});_0xa3afe6[_0x4288('0x9f')][_0x4288('0xa0')]=![];if(_0x377bb0){if(_0xa3afe6[_0x4288('0x74')]['autoclose']){_0xa3afe6[_0x4288('0x75')][_0x4288('0xa1')]({'id':0x0,'priority':_0xa3afe6[_0x4288('0x75')][_0x4288('0x59')]+0x1,'app':_0x4288('0xa2'),'appdata':'unmanaged','interval':_0x4288('0xa3')});}_0xa3afe6[_0x4288('0x9f')][_0x4288('0xa0')]=!![];}return db[_0x4288('0xa4')][_0x4288('0x63')]({'phone':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x82')],'messageId':_0xa3afe6[_0x4288('0x5b')]['messageId'],'body':_0xa3afe6[_0x4288('0x5b')][_0x4288('0x5b')],'SmsAccountId':_0x555c5e[_0x4288('0x57')]['id'],'SmsInteractionId':_0x83c391['id'],'direction':'in','ContactId':_0x83c391['ContactId'],'AttachmentId':_0xa3afe6[_0x4288('0x5b')][_0x4288('0xa5')]});})['then'](function(_0xc31da8){_0xa3afe6['message']=_0xc31da8;if(_0xa3afe6[_0x4288('0x9f')]['UserId']){return db[_0x4288('0xa6')][_0x4288('0x5a')]({'attributes':['id','name'],'where':{'id':_0xa3afe6[_0x4288('0x9f')]['UserId']}})[_0x4288('0x37')](function(_0x526dcf){if(_0x526dcf){_0xa3afe6['applications']['unshift']({'id':0x0,'priority':0x0,'app':_0x4288('0xa7'),'appdata':_0x526dcf[_0x4288('0x3b')]+','+(_0xa3afe6[_0x4288('0x74')][_0x4288('0xa8')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0x4288('0xa9'),'startRouting',_0xa3afe6);});}return respondWithRpcPromise(_0x4288('0xa9'),'startRouting',_0xa3afe6);})[_0x4288('0x37')](function(_0x747f11){if(_0x747f11){var _0x508a08=0xc8;var _0x25cc8d=_0x4288('0xaa');logger[_0x4288('0x21')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x25cc8d,_0x508a08,_0x4288('0xab'));logger[_0x4288('0xac')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x25cc8d,_0x508a08,_0x4288('0xab'),JSON[_0x4288('0x24')](_0x747f11));if(_0xa3afe6[_0x4288('0x74')][_0x4288('0x42')]===_0x4288('0x81')){return _0x153124[_0x4288('0x2b')](_0x508a08)[_0x4288('0x31')]('Content-Type',_0x4288('0xad'))['send'](_0x4288('0xae'));}else{return _0x153124[_0x4288('0x2b')](_0x508a08)[_0x4288('0x2d')](_0x747f11);}}})[_0x4288('0x29')](handleError(_0x153124,null));};exports[_0x4288('0xaf')]=function(_0x4dea24,_0x2f4d94,_0x2b3209){return db['SmsAccount'][_0x4288('0xb0')]({'where':{'id':_0x4dea24[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x2f4d94,null))[_0x4288('0x37')](function(_0x1f1798){if(_0x1f1798){return db[_0x4288('0xb1')][_0x4288('0xb2')](function(_0x34ac5f){return db['SmsApplication'][_0x4288('0x36')]({'where':{'SmsAccountId':_0x4dea24[_0x4288('0x57')]['id']},'transaction':_0x34ac5f})['then'](function(_0x23e2e4){var _0x58eea8=_['map'](_0x4dea24['body'],function(_0x3e59b1){_0x3e59b1[_0x4288('0x68')]=_0x4dea24[_0x4288('0x57')]['id'];return _0x3e59b1;});return db[_0x4288('0x72')][_0x4288('0xb3')](_0x58eea8,{'transaction':_0x34ac5f});});})['then'](function(){return db[_0x4288('0x72')]['findAndCountAll']({'where':{'SmsAccountId':_0x4dea24['params']['id']},'order':_0x4288('0x77')});});}})[_0x4288('0x37')](respondWithResult(_0x2f4d94,null))['catch'](handleError(_0x2f4d94,null));};exports[_0x4288('0xb4')]=function(_0x29bb0d,_0x39da19,_0x2faedc){var _0x5e83e6={};var _0x5a1ea2={};var _0x15437c;var _0x42a8f9;return db[_0x4288('0x40')][_0x4288('0xb0')]({'where':{'id':_0x29bb0d['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x39da19,null))[_0x4288('0x37')](function(_0x30febf){if(_0x30febf){_0x15437c=_0x30febf;_0x5a1ea2[_0x4288('0x43')]=_[_0x4288('0x45')](db[_0x4288('0x72')][_0x4288('0x58')]);_0x5a1ea2['query']=_[_0x4288('0x45')](_0x29bb0d['query']);_0x5a1ea2[_0x4288('0x46')]=_[_0x4288('0x47')](_0x5a1ea2[_0x4288('0x43')],_0x5a1ea2[_0x4288('0x44')]);_0x5e83e6[_0x4288('0x48')]=_[_0x4288('0x47')](_0x5a1ea2[_0x4288('0x43')],qs[_0x4288('0x49')](_0x29bb0d[_0x4288('0x44')][_0x4288('0x49')]));_0x5e83e6['attributes']=_0x5e83e6[_0x4288('0x48')][_0x4288('0x59')]?_0x5e83e6[_0x4288('0x48')]:_0x5a1ea2['model'];_0x5e83e6[_0x4288('0x4c')]=qs[_0x4288('0x4d')](_0x29bb0d[_0x4288('0x44')][_0x4288('0x4d')]);_0x5e83e6[_0x4288('0x4e')]=qs[_0x4288('0x46')](_[_0x4288('0x4f')](_0x29bb0d[_0x4288('0x44')],_0x5a1ea2[_0x4288('0x46')]));if(_0x29bb0d[_0x4288('0x44')]['filter']){_0x5e83e6[_0x4288('0x4e')]=_['merge'](_0x5e83e6[_0x4288('0x4e')],{'$or':_[_0x4288('0x3f')](_0x5e83e6[_0x4288('0x48')],function(_0xe96147){var _0x4db357={};_0x4db357[_0xe96147]={'$like':'%'+_0x29bb0d[_0x4288('0x44')][_0x4288('0x50')]+'%'};return _0x4db357;})});}_0x5e83e6=_['merge']({},_0x5e83e6,_0x29bb0d[_0x4288('0x52')]);return _0x15437c['getApplications'](_0x5e83e6);}})['then'](function(_0x9589b8){if(_0x9589b8){_0x42a8f9=_0x9589b8[_0x4288('0x59')];if(!_0x29bb0d[_0x4288('0x44')][_0x4288('0x4a')](_0x4288('0x4b'))){_0x5e83e6[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x29bb0d[_0x4288('0x44')]['limit']);_0x5e83e6['offset']=qs[_0x4288('0x2f')](_0x29bb0d[_0x4288('0x44')]['offset']);}return _0x15437c[_0x4288('0xb4')](_0x5e83e6);}})[_0x4288('0x37')](function(_0x3cab2a){if(_0x3cab2a){return _0x3cab2a?{'count':_0x42a8f9,'rows':_0x3cab2a}:null;}})['then'](respondWithResult(_0x39da19,null))[_0x4288('0x29')](handleError(_0x39da19,null));};exports['getInteractions']=function(_0x160a1e,_0x49dd84,_0x100faa){var _0x165579={'raw':![],'where':{}};var _0x6f6df9={};var _0x1485cf={'count':0x0,'rows':[]};return db[_0x4288('0x40')][_0x4288('0xb0')]({'where':{'id':_0x160a1e[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x49dd84,null))[_0x4288('0x37')](function(_0xff9a99){if(_0xff9a99){_0x6f6df9[_0x4288('0x43')]=_['keys'](db[_0x4288('0x9e')][_0x4288('0x58')]);_0x6f6df9[_0x4288('0x44')]=_[_0x4288('0x45')](_0x160a1e[_0x4288('0x44')]);_0x6f6df9[_0x4288('0x46')]=_[_0x4288('0x47')](_0x6f6df9[_0x4288('0x43')],_0x6f6df9[_0x4288('0x44')]);_0x165579[_0x4288('0x48')]=_[_0x4288('0x47')](_0x6f6df9[_0x4288('0x43')],qs[_0x4288('0x49')](_0x160a1e['query']['fields']));_0x165579[_0x4288('0x48')]=_0x165579[_0x4288('0x48')][_0x4288('0x59')]?_0x165579[_0x4288('0x48')]:_0x6f6df9[_0x4288('0x43')];if(!_0x160a1e[_0x4288('0x44')][_0x4288('0x4a')]('nolimit')){_0x165579[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x160a1e[_0x4288('0x44')]['limit']);_0x165579[_0x4288('0x2f')]=qs[_0x4288('0x2f')](_0x160a1e[_0x4288('0x44')]['offset']);}_0x165579[_0x4288('0x4c')]=qs[_0x4288('0x4d')](_0x160a1e[_0x4288('0x44')][_0x4288('0x4d')]);_0x165579[_0x4288('0x4e')]=qs['filters'](_['pick'](_0x160a1e[_0x4288('0x44')],_0x6f6df9['filters']));_0x165579['where'][_0x4288('0x68')]=_0xff9a99['id'];if(_0x160a1e['query']['filter']){_0x165579['where']=_[_0x4288('0x51')](_0x165579[_0x4288('0x4e')],{'$or':_[_0x4288('0x3f')](_0x165579['attributes'],function(_0x288701){var _0x45ca07={};_0x45ca07[_0x288701]={'$like':'%'+_0x160a1e[_0x4288('0x44')][_0x4288('0x50')]+'%'};return _0x45ca07;})});}_0x165579=_[_0x4288('0x51')]({},_0x165579,_0x160a1e['options']);return db['SmsInteraction']['count']({'where':_0x165579[_0x4288('0x4e')]})[_0x4288('0x37')](function(_0x20a631){_0x1485cf[_0x4288('0x2e')]=_0x20a631;if(_0x160a1e['query'][_0x4288('0x53')]){_0x165579[_0x4288('0x54')]=[{'model':db[_0x4288('0x79')],'as':_0x4288('0xb5'),'required':![]},{'model':db[_0x4288('0xa6')],'as':'Owner','attributes':[_0x4288('0x3b'),'fullname',_0x4288('0xb6')],'required':![]},{'model':db[_0x4288('0xb7')],'as':_0x4288('0xb8'),'attributes':['id',_0x4288('0x3b'),_0x4288('0xb9')],'where':_0x160a1e[_0x4288('0x44')]['tag']?{'id':_0x160a1e['query'][_0x4288('0xba')]}:undefined,'required':_0x160a1e[_0x4288('0x44')][_0x4288('0xba')]?!![]:![]}];}return db[_0x4288('0x9e')][_0x4288('0x6d')](_0x165579);})['then'](function(_0x4e681d){_0x1485cf[_0x4288('0x55')]=_0x4e681d;return _0x1485cf;});}})[_0x4288('0x37')](respondWithFilteredResult(_0x49dd84,_0x165579))['catch'](handleError(_0x49dd84,null));};exports[_0x4288('0x3c')]=function(_0x3f77c6,_0x220322,_0x21837e){var _0xb347b0,_0x32b95c,_0x16a2a2;if(_[_0x4288('0x94')](_0x3f77c6[_0x4288('0x5b')][_0x4288('0x5b')])||_0x3f77c6[_0x4288('0x5b')][_0x4288('0x5b')]===''){throw new db['Sequelize'][(_0x4288('0x1f'))](_0x4288('0x96'));}if(_['isNil'](_0x3f77c6[_0x4288('0x5b')]['to'])){throw new db[(_0x4288('0x1e'))][(_0x4288('0x1f'))]('to\x20is\x20mandatory');}_0xb347b0=_0x3f77c6['body']['to'];return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x3f77c6['params']['id']},'include':[{'model':db[_0x4288('0x99')],'as':_0x4288('0xbb'),'include':[{'model':db['CmContact'],'as':_0x4288('0x9a'),'where':{'mobile':_0xb347b0},'limit':0x1,'order':[[_0x4288('0x7d'),_0x4288('0x9b')]]}]}]})[_0x4288('0x37')](handleEntityNotFound(_0x220322,null))['then'](function(_0x5481d4){if(_0x5481d4&&_0x5481d4[_0x4288('0xbb')]){_0x32b95c=_0x5481d4[_0x4288('0x38')]({'plain':!![]});if(_0x32b95c[_0x4288('0xbb')]&&_0x32b95c[_0x4288('0xbb')]['Contacts'][_0x4288('0x59')]){return _0x32b95c[_0x4288('0xbb')]['Contacts'][0x0];}return db['CmContact']['create'](_['defaults'](_0x3f77c6[_0x4288('0x5b')],{'firstName':_0xb347b0,'mobile':_0xb347b0,'phone':_0xb347b0,'ListId':_0x32b95c[_0x4288('0x7f')]}));}})[_0x4288('0x37')](handleEntityNotFound(_0x220322,null))[_0x4288('0x37')](function(_0x3de5c8){if(_0x3de5c8){_0x16a2a2=_0x3de5c8;return db[_0x4288('0x9e')][_0x4288('0x5a')]({'where':{'ContactId':_0x16a2a2['id'],'closed':![],'SmsAccountId':_0x32b95c['id']}})[_0x4288('0x37')](function(_0x52e2a5){if(_0x52e2a5){return[_0x52e2a5,![]];}return db['SmsInteraction'][_0x4288('0x63')]({'UserId':_0x3f77c6[_0x4288('0x5c')]['id'],'ContactId':_0x16a2a2['id'],'SmsAccountId':_0x32b95c['id'],'phone':_0xb347b0,'firstMsgDirection':_0x4288('0xbc'),'Messages':[_[_0x4288('0x51')](_0x3f77c6['body'],{'read':![],'body':_0x3f77c6['body'][_0x4288('0x5b')],'phone':_0xb347b0,'SmsAccountId':_0x32b95c['id'],'UserId':_0x3f77c6[_0x4288('0x5c')]['id'],'ContactId':_0x16a2a2['id']})]},{'include':[{'model':db[_0x4288('0xa4')],'as':_0x4288('0xbd')}]})[_0x4288('0x37')](function(_0x29f69a){return[_0x29f69a,!![]];});});}})[_0x4288('0xbe')](function(_0x33ba91,_0x5eecbe){if(_0x5eecbe){return _0x33ba91;}return db[_0x4288('0xa4')][_0x4288('0x63')](_[_0x4288('0x51')](_0x3f77c6['body'],{'read':![],'body':_0x3f77c6[_0x4288('0x5b')][_0x4288('0x5b')],'phone':_0xb347b0,'SmsAccountId':_0x32b95c['id'],'SmsInteractionId':_0x33ba91['id'],'UserId':_0x3f77c6[_0x4288('0x5c')]['id'],'ContactId':_0x16a2a2['id']}))[_0x4288('0x37')](function(_0x3537e4){_0x33ba91[_0x4288('0xbf')][_0x4288('0xbd')]=[];_0x33ba91[_0x4288('0xbf')]['Messages'][_0x4288('0xa1')](_0x3537e4[_0x4288('0xbf')]);return _0x33ba91;});})[_0x4288('0x37')](respondWithResult(_0x220322,null))[_0x4288('0x29')](handleError(_0x220322,null));};exports['status']=function(_0x3c9888,_0x2160b8,_0x3e8e99){if(_0x3c9888[_0x4288('0x5b')]['id']){delete _0x3c9888['body']['id'];}console[_0x4288('0xc0')]('endpoint\x20/status\x20POST\x20/',_0x3c9888[_0x4288('0x5b')]);var _0x455684,_0x1e3530,_0x14d0a5;return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x3c9888['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x2160b8,null))[_0x4288('0x37')](function(_0x3eda56){if(_0x3eda56){_0x14d0a5=_0x3eda56;logger[_0x4288('0xac')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4288('0x2b'),_0x4288('0xc1'),_0x3eda56[_0x4288('0x42')],util[_0x4288('0xc2')](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));switch(_0x3eda56['type']){case _0x4288('0xc3'):if(_0x3c9888['body'][_0x4288('0xc4')]&&_0x3c9888[_0x4288('0x5b')]['status']){_0x1e3530=_0x3c9888[_0x4288('0x5b')]['status'];return db['SmsMessage'][_0x4288('0x5a')]({'where':{'messageId':_0x3c9888[_0x4288('0x5b')][_0x4288('0xc4')]}});}break;case _0x4288('0xc5'):if(_0x3c9888[_0x4288('0x5b')]['requestid']&&_0x3c9888[_0x4288('0x5b')][_0x4288('0xc6')]){_0x1e3530=_0x3c9888[_0x4288('0x5b')][_0x4288('0xc6')];return db[_0x4288('0xa4')][_0x4288('0x5a')]({'where':{'messageId':_0x3c9888[_0x4288('0x5b')][_0x4288('0xc7')]}});}break;case'clicksend':if(_0x3c9888[_0x4288('0x5b')][_0x4288('0x85')]&&_0x3c9888[_0x4288('0x5b')][_0x4288('0xc8')]){_0x1e3530=_0x3c9888[_0x4288('0x5b')]['status_code'];return db[_0x4288('0xa4')]['find']({'where':{'messageId':_0x3c9888[_0x4288('0x5b')]['message_id']}});}break;case _0x4288('0x8a'):var _0x39ab3c=_0x3c9888['body']['results'][0x0];if(_0x39ab3c[_0x4288('0x83')]&&_0x39ab3c[_0x4288('0x2b')][_0x4288('0xc9')]===_0x4288('0xca')){_0x1e3530=_0x39ab3c[_0x4288('0x2b')][_0x4288('0xc9')];return db[_0x4288('0xa4')][_0x4288('0x5a')]({'where':{'messageId':_0x39ab3c['messageId']}});}break;case _0x4288('0x90'):if(_0x3c9888[_0x4288('0x5b')][_0x4288('0x83')]&&_0x3c9888['body'][_0x4288('0x2b')]){_0x1e3530=_0x3c9888[_0x4288('0x5b')][_0x4288('0x2b')];return db[_0x4288('0xa4')][_0x4288('0x5a')]({'where':{'messageId':_0x3c9888[_0x4288('0x5b')][_0x4288('0x83')]}});}break;case _0x4288('0xcb'):if(_0x3c9888[_0x4288('0x5b')]['redif']&&_0x3c9888[_0x4288('0x5b')][_0x4288('0x2b')]){_0x1e3530=_0x3c9888[_0x4288('0x5b')]['status'];return db[_0x4288('0xa4')]['find']({'where':{'messageId':_0x3c9888['body'][_0x4288('0xcc')]}});}break;}}})[_0x4288('0x37')](handleEntityNotFound(_0x2160b8,null))['then'](function(_0x2efe57){if(_0x2efe57){_0x455684=_0x2efe57;switch(_0x14d0a5[_0x4288('0x42')]){case'skebby':if(_0x1e3530==='DELIVERED'){return _0x455684[_0x4288('0x35')]({'read':!![]});}else{logger['error'](_0x4288('0x23'),_0x4288('0x2b'),'skebby',util[_0x4288('0xc2')](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x1e3530==='1'){return _0x455684[_0x4288('0x35')]({'read':!![]});}else{logger[_0x4288('0x25')](_0x4288('0x23'),_0x4288('0x2b'),_0x4288('0xc3'),util['inspect'](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;case'clicksend':if(!_0x3c9888['body'][_0x4288('0xcd')]&&_0x1e3530>=0xc8&&_0x1e3530<=0xce){return _0x455684[_0x4288('0x35')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s','status',_0x4288('0xce'),util[_0x4288('0xc2')](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4288('0x8a'):var _0x546f7a=_0x3c9888[_0x4288('0x5b')][_0x4288('0x8b')][0x0];if(_0x546f7a[_0x4288('0x2b')][_0x4288('0xc9')]===_0x4288('0xca')){return _0x455684[_0x4288('0x35')]({'read':!![]});}else{logger[_0x4288('0x25')](_0x4288('0x23'),_0x4288('0x2b'),_0x4288('0x8a'),util['inspect'](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4288('0x90'):if(_0x1e3530==_0x4288('0xcf')||_0x1e3530==_0x4288('0xd0')){return _0x455684['update']({'read':!![]});}else{logger[_0x4288('0x25')](_0x4288('0x23'),_0x4288('0x2b'),_0x4288('0x90'),util[_0x4288('0xc2')](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;case _0x4288('0xcb'):if(_0x1e3530===_0x4288('0xd1')||_0x1e3530===_0x4288('0xd2')){return _0x455684[_0x4288('0x35')]({'read':!![]});}else{logger[_0x4288('0x25')](_0x4288('0x23'),'status',_0x4288('0xcb'),util[_0x4288('0xc2')](_0x3c9888[_0x4288('0x5b')],{'showHidden':![],'depth':null}));}break;}return _0x455684;}})[_0x4288('0x37')](respondWithResult(_0x2160b8,null))[_0x4288('0x29')](handleError(_0x2160b8,null));};exports[_0x4288('0xd3')]=function(_0x2bc7b0,_0x239c0f,_0x30e129){var _0x2603ea,_0x45c4a3,_0x29e71b;return db[_0x4288('0x40')]['find']({'where':{'id':_0x2bc7b0['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x239c0f,null))[_0x4288('0x37')](function(_0x27a350){if(_0x27a350){_0x29e71b=_0x27a350;logger[_0x4288('0xac')](_0x4288('0x23'),'status',_0x4288('0xc1'),_0x27a350[_0x4288('0x42')],util[_0x4288('0xc2')](_0x2bc7b0[_0x4288('0x44')],{'showHidden':![],'depth':null}));switch(_0x27a350['type']){case _0x4288('0x8d'):if(_0x2bc7b0['query'][_0x4288('0xd4')]&&_0x2bc7b0[_0x4288('0x44')][_0x4288('0xd5')]){_0x45c4a3=_0x2bc7b0[_0x4288('0x44')][_0x4288('0xd5')];return db[_0x4288('0xa4')][_0x4288('0x5a')]({'where':{'messageId':_0x2bc7b0['query'][_0x4288('0xd4')]}});}break;}}})[_0x4288('0x37')](handleEntityNotFound(_0x239c0f,null))[_0x4288('0x37')](function(_0x1dda79){if(_0x1dda79){_0x2603ea=_0x1dda79;switch(_0x29e71b['type']){case'csc':if(_0x45c4a3==='2'||_0x45c4a3==='6'){return _0x2603ea[_0x4288('0x35')]({'read':!![]});}else{logger[_0x4288('0x25')](_0x4288('0x23'),_0x4288('0x2b'),_0x4288('0x8d'),util[_0x4288('0xc2')](_0x2bc7b0[_0x4288('0x44')],{'showHidden':![],'depth':null}));};break;}return _0x2603ea;}})[_0x4288('0x37')](respondWithResult(_0x239c0f,null))[_0x4288('0x29')](handleError(_0x239c0f,null));};exports[_0x4288('0xd6')]=function(_0x4c7e6f,_0x474048,_0x2c0401){return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x4c7e6f[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x474048,null))['then'](function(_0xdeac22){if(_0xdeac22){return _0xdeac22[_0x4288('0xd6')](_0x4c7e6f[_0x4288('0x5b')][_0x4288('0x6f')],_[_0x4288('0x9c')](_0x4c7e6f[_0x4288('0x5b')],[_0x4288('0x6f'),'id'])||{})[_0x4288('0xbe')](function(_0x5c3b59){for(var _0x3faf2d=0x0;_0x3faf2d<_0x4c7e6f[_0x4288('0x5b')][_0x4288('0x6f')][_0x4288('0x59')];_0x3faf2d+=0x1){socket['emit'](_0x4288('0xd7'),{'UserId':_0x4c7e6f[_0x4288('0x5b')][_0x4288('0x6f')][_0x3faf2d],'SmsAccountId':_0x4c7e6f[_0x4288('0x57')]['id']});}return _0x5c3b59;});}})['then'](respondWithResult(_0x474048,null))[_0x4288('0x29')](handleError(_0x474048,null));};exports[_0x4288('0xd8')]=function(_0x1fd0e8,_0x1b0e40,_0x3c5542){return db[_0x4288('0x40')][_0x4288('0x5a')]({'where':{'id':_0x1fd0e8[_0x4288('0x57')]['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x1b0e40,null))[_0x4288('0x37')](function(_0x3727eb){if(_0x3727eb){return _0x3727eb[_0x4288('0xd8')](_0x1fd0e8['query'][_0x4288('0x6f')])[_0x4288('0x37')](function(){if(_[_0x4288('0xd9')](_0x1fd0e8[_0x4288('0x44')][_0x4288('0x6f')])){for(var _0x378cbb=0x0;_0x378cbb<_0x1fd0e8['query'][_0x4288('0x6f')]['length'];_0x378cbb+=0x1){socket[_0x4288('0xda')](_0x4288('0xdb'),{'UserId':Number(_0x1fd0e8[_0x4288('0x44')][_0x4288('0x6f')][_0x378cbb]),'SmsAccountId':Number(_0x1fd0e8[_0x4288('0x57')]['id'])});}}else{socket[_0x4288('0xda')](_0x4288('0xdb'),{'UserId':Number(_0x1fd0e8[_0x4288('0x44')]['ids']),'SmsAccountId':Number(_0x1fd0e8['params']['id'])});}});}})[_0x4288('0x37')](respondWithStatusCode(_0x1b0e40,null))[_0x4288('0x29')](handleError(_0x1b0e40,null));};exports[_0x4288('0xdc')]=function(_0x5c4e86,_0x34679f,_0x14432d){var _0x3cc01c={};var _0x3574b1={};var _0x17bfcb;var _0x4bc1cb;return db[_0x4288('0x40')]['findOne']({'where':{'id':_0x5c4e86['params']['id']}})[_0x4288('0x37')](handleEntityNotFound(_0x34679f,null))[_0x4288('0x37')](function(_0xcca016){if(_0xcca016){_0x17bfcb=_0xcca016;_0x3574b1[_0x4288('0x43')]=_['keys'](db[_0x4288('0xa6')][_0x4288('0x58')]);_0x3574b1[_0x4288('0x44')]=_[_0x4288('0x45')](_0x5c4e86[_0x4288('0x44')]);_0x3574b1['filters']=_[_0x4288('0x47')](_0x3574b1[_0x4288('0x43')],_0x3574b1['query']);_0x3cc01c[_0x4288('0x48')]=_[_0x4288('0x47')](_0x3574b1[_0x4288('0x43')],qs['fields'](_0x5c4e86['query'][_0x4288('0x49')]));_0x3cc01c[_0x4288('0x48')]=_0x3cc01c[_0x4288('0x48')][_0x4288('0x59')]?_0x3cc01c[_0x4288('0x48')]:_0x3574b1[_0x4288('0x43')];_0x3cc01c['order']=qs[_0x4288('0x4d')](_0x5c4e86[_0x4288('0x44')][_0x4288('0x4d')]);_0x3cc01c[_0x4288('0x4e')]=qs['filters'](_[_0x4288('0x4f')](_0x5c4e86[_0x4288('0x44')],_0x3574b1[_0x4288('0x46')]));if(_0x5c4e86[_0x4288('0x44')]['filter']){_0x3cc01c['where']=_['merge'](_0x3cc01c[_0x4288('0x4e')],{'$or':_[_0x4288('0x3f')](_0x3cc01c[_0x4288('0x48')],function(_0x106acc){var _0x103e32={};_0x103e32[_0x106acc]={'$like':'%'+_0x5c4e86[_0x4288('0x44')]['filter']+'%'};return _0x103e32;})});}_0x3cc01c=_[_0x4288('0x51')]({},_0x3cc01c,_0x5c4e86[_0x4288('0x52')]);return _0x17bfcb[_0x4288('0xdc')](_0x3cc01c);}})[_0x4288('0x37')](function(_0x3daec2){if(_0x3daec2){_0x4bc1cb=_0x3daec2['length'];if(!_0x5c4e86[_0x4288('0x44')][_0x4288('0x4a')](_0x4288('0x4b'))){_0x3cc01c[_0x4288('0x30')]=qs[_0x4288('0x30')](_0x5c4e86[_0x4288('0x44')][_0x4288('0x30')]);_0x3cc01c[_0x4288('0x2f')]=qs[_0x4288('0x2f')](_0x5c4e86[_0x4288('0x44')][_0x4288('0x2f')]);}return _0x17bfcb[_0x4288('0xdc')](_0x3cc01c);}})[_0x4288('0x37')](function(_0x5c44b4){if(_0x5c44b4){return _0x5c44b4?{'count':_0x4bc1cb,'rows':_0x5c44b4}:null;}})[_0x4288('0x37')](respondWithResult(_0x34679f,null))[_0x4288('0x29')](handleError(_0x34679f,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 657a1f8..e138d35 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 _0xb8df=['emit','hook','exports','events','../../mysqldb','SmsAccount','setMaxListeners','save','update','remove'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xb8df,0x175));var _0xfb8d=function(_0x3be0c4,_0x5b7eff){_0x3be0c4=_0x3be0c4-0x0;var _0x11af9f=_0xb8df[_0x3be0c4];return _0x11af9f;};'use strict';var EventEmitter=require(_0xfb8d('0x0'));var SmsAccount=require(_0xfb8d('0x1'))['db'][_0xfb8d('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0xfb8d('0x3')](0x0);var events={'afterCreate':_0xfb8d('0x4'),'afterUpdate':_0xfb8d('0x5'),'afterDestroy':_0xfb8d('0x6')};function emitEvent(_0x5300b5){return function(_0x5f2d13,_0x4d4239,_0x11fd3d){SmsAccountEvents[_0xfb8d('0x7')](_0x5300b5+':'+_0x5f2d13['id'],_0x5f2d13);SmsAccountEvents[_0xfb8d('0x7')](_0x5300b5,_0x5f2d13);_0x11fd3d(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsAccount[_0xfb8d('0x8')](e,emitEvent(event));}}module[_0xfb8d('0x9')]=SmsAccountEvents; \ No newline at end of file +var _0x49cb=['update','emit','hasOwnProperty','hook','exports','SmsAccount','save'];(function(_0x30e48a,_0x184e44){var _0x503a98=function(_0x509faf){while(--_0x509faf){_0x30e48a['push'](_0x30e48a['shift']());}};_0x503a98(++_0x184e44);}(_0x49cb,0x11d));var _0xb49c=function(_0x32be90,_0x2b9081){_0x32be90=_0x32be90-0x0;var _0x2480b7=_0x49cb[_0x32be90];return _0x2480b7;};'use strict';var EventEmitter=require('events');var SmsAccount=require('../../mysqldb')['db'][_0xb49c('0x0')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xb49c('0x1'),'afterUpdate':_0xb49c('0x2'),'afterDestroy':'remove'};function emitEvent(_0x4b9550){return function(_0x389596,_0x5ecadf,_0x369880){SmsAccountEvents['emit'](_0x4b9550+':'+_0x389596['id'],_0x389596);SmsAccountEvents[_0xb49c('0x3')](_0x4b9550,_0x389596);_0x369880(null);};}for(var e in events){if(events[_0xb49c('0x4')](e)){var event=events[e];SmsAccount[_0xb49c('0x5')](e,emitEvent(event));}}module[_0xb49c('0x6')]=SmsAccountEvents; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.model.js b/server/api/smsAccount/smsAccount.model.js index ead6e8f..56578cb 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 _0x7bd1=['../../config/logger','api','moment','request-promise','path','rimraf','exports','define','sms_accounts','util'];(function(_0x1dca68,_0x3512b9){var _0x142542=function(_0x122bef){while(--_0x122bef){_0x1dca68['push'](_0x1dca68['shift']());}};_0x142542(++_0x3512b9);}(_0x7bd1,0x1c1));var _0x17bd=function(_0x5b3602,_0x305880){_0x5b3602=_0x5b3602-0x0;var _0x3259e9=_0x7bd1[_0x5b3602];return _0x3259e9;};'use strict';var _=require('lodash');var util=require(_0x17bd('0x0'));var logger=require(_0x17bd('0x1'))(_0x17bd('0x2'));var moment=require(_0x17bd('0x3'));var BPromise=require('bluebird');var rp=require(_0x17bd('0x4'));var fs=require('fs');var path=require(_0x17bd('0x5'));var rimraf=require(_0x17bd('0x6'));var config=require('../../config/environment');var attributes=require('./smsAccount.attributes');module[_0x17bd('0x7')]=function(_0xaffaae,_0x225670){return _0xaffaae[_0x17bd('0x8')]('SmsAccount',attributes,{'tableName':_0x17bd('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd4df=['path','rimraf','../../config/environment','exports','define','SmsAccount','lodash','util','api','moment'];(function(_0x61da8f,_0x5cee59){var _0x3e86cd=function(_0x3180ad){while(--_0x3180ad){_0x61da8f['push'](_0x61da8f['shift']());}};_0x3e86cd(++_0x5cee59);}(_0xd4df,0x88));var _0xfd4d=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xd4df[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xfd4d('0x0'));var util=require(_0xfd4d('0x1'));var logger=require('../../config/logger')(_0xfd4d('0x2'));var moment=require(_0xfd4d('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xfd4d('0x4'));var rimraf=require(_0xfd4d('0x5'));var config=require(_0xfd4d('0x6'));var attributes=require('./smsAccount.attributes');module[_0xfd4d('0x7')]=function(_0x5cf698,_0xcc829){return _0x5cf698[_0xfd4d('0x8')](_0xfd4d('0x9'),attributes,{'tableName':'sms_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.rpc.js b/server/api/smsAccount/smsAccount.rpc.js index c38d8e5..9ad037d 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 _0x39cd=['lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','./smsAccount.socket','register','request','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','ShowSmsAccount','find','options','where','include','map','model','attributes'];(function(_0x13ea00,_0x12f610){var _0x1f7347=function(_0x34ae63){while(--_0x34ae63){_0x13ea00['push'](_0x13ea00['shift']());}};_0x1f7347(++_0x12f610);}(_0x39cd,0x1ef));var _0xd39c=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x39cd[_0x4fbfd9];return _0x31dc94;};'use strict';var _=require(_0xd39c('0x0'));var util=require(_0xd39c('0x1'));var moment=require('moment');var BPromise=require(_0xd39c('0x2'));var rs=require(_0xd39c('0x3'));var fs=require('fs');var Redis=require(_0xd39c('0x4'));var db=require(_0xd39c('0x5'))['db'];var utils=require(_0xd39c('0x6'));var logger=require(_0xd39c('0x7'))('rpc');var config=require(_0xd39c('0x8'));var jayson=require(_0xd39c('0x9'));var client=jayson[_0xd39c('0xa')][_0xd39c('0xb')]({'port':0x232a});config['redis']=_['defaults'](config[_0xd39c('0xc')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd39c('0xc')]));require(_0xd39c('0xd'))[_0xd39c('0xe')](socket);function respondWithRpcPromise(_0x1542cc,_0x4c659c,_0x128456){return new BPromise(function(_0x950b08,_0x39d6a0){return client[_0xd39c('0xf')](_0x1542cc,_0x128456)[_0xd39c('0x10')](function(_0x23880f){logger[_0xd39c('0x11')](_0xd39c('0x12'),_0x4c659c,_0xd39c('0x13'));logger[_0xd39c('0x14')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x4c659c,_0xd39c('0x13'),JSON[_0xd39c('0x15')](_0x23880f));if(_0x23880f['error']){if(_0x23880f[_0xd39c('0x16')]['code']===0x1f4){logger[_0xd39c('0x16')]('SmsAccount,\x20%s,\x20%s',_0x4c659c,_0x23880f[_0xd39c('0x16')]['message']);return _0x39d6a0(_0x23880f[_0xd39c('0x16')][_0xd39c('0x17')]);}logger['error']('SmsAccount,\x20%s,\x20%s',_0x4c659c,_0x23880f[_0xd39c('0x16')][_0xd39c('0x17')]);return _0x950b08(_0x23880f[_0xd39c('0x16')]['message']);}else{logger[_0xd39c('0x11')](_0xd39c('0x12'),_0x4c659c,_0xd39c('0x13'));_0x950b08(_0x23880f['result'][_0xd39c('0x17')]);}})[_0xd39c('0x18')](function(_0x4cb9de){logger[_0xd39c('0x16')]('SmsAccount,\x20%s,\x20%s',_0x4c659c,_0x4cb9de);_0x39d6a0(_0x4cb9de);});});}exports[_0xd39c('0x19')]=function(_0x50a047){var _0x485e14=this;return new Promise(function(_0x4a279c,_0x2705da){return db['SmsAccount'][_0xd39c('0x1a')]({'raw':_0x50a047[_0xd39c('0x1b')]?_0x50a047[_0xd39c('0x1b')]['raw']===undefined?!![]:![]:!![],'where':_0x50a047['options']?_0x50a047[_0xd39c('0x1b')][_0xd39c('0x1c')]||null:null,'attributes':_0x50a047[_0xd39c('0x1b')]?_0x50a047[_0xd39c('0x1b')]['attributes']||null:null,'include':_0x50a047[_0xd39c('0x1b')]?_0x50a047[_0xd39c('0x1b')][_0xd39c('0x1d')]?_[_0xd39c('0x1e')](_0x50a047[_0xd39c('0x1b')]['include'],function(_0x4459ff){return{'model':db[_0x4459ff[_0xd39c('0x1f')]],'as':_0x4459ff['as'],'attributes':_0x4459ff[_0xd39c('0x20')],'include':_0x4459ff[_0xd39c('0x1d')]?_[_0xd39c('0x1e')](_0x4459ff[_0xd39c('0x1d')],function(_0x4ceae4){return{'model':db[_0x4ceae4['model']],'as':_0x4ceae4['as'],'attributes':_0x4ceae4['attributes'],'include':_0x4ceae4[_0xd39c('0x1d')]?_[_0xd39c('0x1e')](_0x4ceae4[_0xd39c('0x1d')],function(_0x1c6f11){return{'model':db[_0x1c6f11['model']],'as':_0x1c6f11['as'],'attributes':_0x1c6f11[_0xd39c('0x20')]};}):[]};}):[]};}):[]:[]})[_0xd39c('0x10')](function(_0x7037d4){logger[_0xd39c('0x11')](_0xd39c('0x19'),_0x50a047);logger[_0xd39c('0x14')](_0xd39c('0x19'),_0x50a047,JSON['stringify'](_0x7037d4));_0x4a279c(_0x7037d4);})['catch'](function(_0x304b19){logger[_0xd39c('0x16')](_0xd39c('0x19'),_0x304b19['message'],_0x50a047);_0x2705da(_0x485e14[_0xd39c('0x16')](0x1f4,_0x304b19[_0xd39c('0x17')]));});});}; \ No newline at end of file +var _0xe2d2=['debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','ShowSmsAccount','SmsAccount','find','options','where','attributes','map','include','model','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','socket.io-emitter','./smsAccount.socket','register','info','SmsAccount,\x20%s,\x20%s'];(function(_0x8570f8,_0x53431b){var _0x464556=function(_0x33ba55){while(--_0x33ba55){_0x8570f8['push'](_0x8570f8['shift']());}};_0x464556(++_0x53431b);}(_0xe2d2,0x88));var _0x2e2d=function(_0x7c43ec,_0x3f2244){_0x7c43ec=_0x7c43ec-0x0;var _0x3c972b=_0xe2d2[_0x7c43ec];return _0x3c972b;};'use strict';var _=require(_0x2e2d('0x0'));var util=require(_0x2e2d('0x1'));var moment=require(_0x2e2d('0x2'));var BPromise=require(_0x2e2d('0x3'));var rs=require(_0x2e2d('0x4'));var fs=require('fs');var Redis=require(_0x2e2d('0x5'));var db=require(_0x2e2d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2e2d('0x7'))(_0x2e2d('0x8'));var config=require(_0x2e2d('0x9'));var jayson=require(_0x2e2d('0xa'));var client=jayson[_0x2e2d('0xb')][_0x2e2d('0xc')]({'port':0x232a});config['redis']=_[_0x2e2d('0xd')](config[_0x2e2d('0xe')],{'host':'localhost','port':0x18eb});var socket=require(_0x2e2d('0xf'))(new Redis(config[_0x2e2d('0xe')]));require(_0x2e2d('0x10'))[_0x2e2d('0x11')](socket);function respondWithRpcPromise(_0x21ac2d,_0x3a93cf,_0x3d0b7c){return new BPromise(function(_0x4a6a65,_0x235128){return client['request'](_0x21ac2d,_0x3d0b7c)['then'](function(_0x1041e3){logger[_0x2e2d('0x12')](_0x2e2d('0x13'),_0x3a93cf,'request\x20sent');logger[_0x2e2d('0x14')](_0x2e2d('0x15'),_0x3a93cf,'request\x20sent',JSON[_0x2e2d('0x16')](_0x1041e3));if(_0x1041e3[_0x2e2d('0x17')]){if(_0x1041e3[_0x2e2d('0x17')][_0x2e2d('0x18')]===0x1f4){logger[_0x2e2d('0x17')](_0x2e2d('0x13'),_0x3a93cf,_0x1041e3['error'][_0x2e2d('0x19')]);return _0x235128(_0x1041e3[_0x2e2d('0x17')][_0x2e2d('0x19')]);}logger[_0x2e2d('0x17')](_0x2e2d('0x13'),_0x3a93cf,_0x1041e3['error']['message']);return _0x4a6a65(_0x1041e3[_0x2e2d('0x17')]['message']);}else{logger[_0x2e2d('0x12')](_0x2e2d('0x13'),_0x3a93cf,_0x2e2d('0x1a'));_0x4a6a65(_0x1041e3[_0x2e2d('0x1b')][_0x2e2d('0x19')]);}})[_0x2e2d('0x1c')](function(_0x79c263){logger[_0x2e2d('0x17')](_0x2e2d('0x13'),_0x3a93cf,_0x79c263);_0x235128(_0x79c263);});});}exports[_0x2e2d('0x1d')]=function(_0x162513){var _0x55ce09=this;return new Promise(function(_0x38a9e7,_0x5d20e1){return db[_0x2e2d('0x1e')][_0x2e2d('0x1f')]({'raw':_0x162513['options']?_0x162513[_0x2e2d('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x162513['options']?_0x162513['options'][_0x2e2d('0x21')]||null:null,'attributes':_0x162513[_0x2e2d('0x20')]?_0x162513[_0x2e2d('0x20')][_0x2e2d('0x22')]||null:null,'include':_0x162513[_0x2e2d('0x20')]?_0x162513[_0x2e2d('0x20')]['include']?_[_0x2e2d('0x23')](_0x162513[_0x2e2d('0x20')]['include'],function(_0x1bbfb5){return{'model':db[_0x1bbfb5['model']],'as':_0x1bbfb5['as'],'attributes':_0x1bbfb5[_0x2e2d('0x22')],'include':_0x1bbfb5['include']?_[_0x2e2d('0x23')](_0x1bbfb5[_0x2e2d('0x24')],function(_0x40a403){return{'model':db[_0x40a403[_0x2e2d('0x25')]],'as':_0x40a403['as'],'attributes':_0x40a403['attributes'],'include':_0x40a403[_0x2e2d('0x24')]?_[_0x2e2d('0x23')](_0x40a403[_0x2e2d('0x24')],function(_0x3bffe4){return{'model':db[_0x3bffe4[_0x2e2d('0x25')]],'as':_0x3bffe4['as'],'attributes':_0x3bffe4[_0x2e2d('0x22')]};}):[]};}):[]};}):[]:[]})[_0x2e2d('0x26')](function(_0x1aa5f9){logger[_0x2e2d('0x12')](_0x2e2d('0x1d'),_0x162513);logger[_0x2e2d('0x14')](_0x2e2d('0x1d'),_0x162513,JSON['stringify'](_0x1aa5f9));_0x38a9e7(_0x1aa5f9);})[_0x2e2d('0x1c')](function(_0x2a8d10){logger[_0x2e2d('0x17')]('ShowSmsAccount',_0x2a8d10[_0x2e2d('0x19')],_0x162513);_0x5d20e1(_0x55ce09[_0x2e2d('0x17')](0x1f4,_0x2a8d10[_0x2e2d('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 929dcbe..1ed3625 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 _0x767b=['./smsAccount.events','save','remove','update','removeListener','register','length','smsAccount:'];(function(_0x5a9df1,_0x5debcb){var _0x3141ac=function(_0x267d1a){while(--_0x267d1a){_0x5a9df1['push'](_0x5a9df1['shift']());}};_0x3141ac(++_0x5debcb);}(_0x767b,0xd0));var _0xb767=function(_0x36ceef,_0x5d166e){_0x36ceef=_0x36ceef-0x0;var _0x1cf645=_0x767b[_0x36ceef];return _0x1cf645;};'use strict';var SmsAccountEvents=require(_0xb767('0x0'));var events=[_0xb767('0x1'),_0xb767('0x2'),_0xb767('0x3')];function createListener(_0xd6317e,_0x31b425){return function(_0x5a91f0){_0x31b425['emit'](_0xd6317e,_0x5a91f0);};}function removeListener(_0x307c32,_0x5e44e9){return function(){SmsAccountEvents[_0xb767('0x4')](_0x307c32,_0x5e44e9);};}exports[_0xb767('0x5')]=function(_0x44b764){for(var _0x13a300=0x0,_0x16de84=events[_0xb767('0x6')];_0x13a300<_0x16de84;_0x13a300++){var _0x205103=events[_0x13a300];var _0x3bc7a5=createListener(_0xb767('0x7')+_0x205103,_0x44b764);SmsAccountEvents['on'](_0x205103,_0x3bc7a5);}}; \ No newline at end of file +var _0x15b6=['removeListener','register','smsAccount:','./smsAccount.events','save','update','emit'];(function(_0x5d2269,_0x860fea){var _0xfb52b=function(_0x20f4b6){while(--_0x20f4b6){_0x5d2269['push'](_0x5d2269['shift']());}};_0xfb52b(++_0x860fea);}(_0x15b6,0x161));var _0x615b=function(_0xc85610,_0x4dab25){_0xc85610=_0xc85610-0x0;var _0x500687=_0x15b6[_0xc85610];return _0x500687;};'use strict';var SmsAccountEvents=require(_0x615b('0x0'));var events=[_0x615b('0x1'),'remove',_0x615b('0x2')];function createListener(_0x39e689,_0x55c9be){return function(_0xc8f23){_0x55c9be[_0x615b('0x3')](_0x39e689,_0xc8f23);};}function removeListener(_0xdcfa9c,_0x4fdc92){return function(){SmsAccountEvents[_0x615b('0x4')](_0xdcfa9c,_0x4fdc92);};}exports[_0x615b('0x5')]=function(_0x1837f1){for(var _0xc3f29f=0x0,_0x34fc91=events['length'];_0xc3f29f<_0x34fc91;_0xc3f29f++){var _0x45a2ef=events[_0xc3f29f];var _0x3b60c6=createListener(_0x615b('0x6')+_0x45a2ef,_0x1837f1);SmsAccountEvents['on'](_0x45a2ef,_0x3b60c6);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 567c280..87c5ab5 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 _0x8066=['./smsApplication.controller','get','isAuthenticated','index','/:id','show','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1a7276,_0x4d3e59){var _0x163cbb=function(_0x1b2765){while(--_0x1b2765){_0x1a7276['push'](_0x1a7276['shift']());}};_0x163cbb(++_0x4d3e59);}(_0x8066,0x88));var _0x6806=function(_0x29d94e,_0xf386d6){_0x29d94e=_0x29d94e-0x0;var _0x106237=_0x8066[_0x29d94e];return _0x106237;};'use strict';var multer=require(_0x6806('0x0'));var util=require(_0x6806('0x1'));var path=require(_0x6806('0x2'));var timeout=require(_0x6806('0x3'));var express=require(_0x6806('0x4'));var router=express[_0x6806('0x5')]();var auth=require(_0x6806('0x6'));var interaction=require(_0x6806('0x7'));var config=require('../../config/environment');var controller=require(_0x6806('0x8'));router[_0x6806('0x9')]('/',auth[_0x6806('0xa')](),controller[_0x6806('0xb')]);router[_0x6806('0x9')](_0x6806('0xc'),auth['isAuthenticated'](),controller[_0x6806('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x6806('0xc'),auth[_0x6806('0xa')](),controller[_0x6806('0xe')]);router[_0x6806('0xf')](_0x6806('0xc'),auth['isAuthenticated'](),controller[_0x6806('0x10')]);module[_0x6806('0x11')]=router; \ No newline at end of file +var _0x2d08=['get','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../config/environment','./smsApplication.controller','index'];(function(_0x54de5d,_0x1f8b26){var _0x1b349e=function(_0xe199cc){while(--_0xe199cc){_0x54de5d['push'](_0x54de5d['shift']());}};_0x1b349e(++_0x1f8b26);}(_0x2d08,0x128));var _0x82d0=function(_0xbc8177,_0x4d1cfd){_0xbc8177=_0xbc8177-0x0;var _0x91d12f=_0x2d08[_0xbc8177];return _0x91d12f;};'use strict';var multer=require(_0x82d0('0x0'));var util=require(_0x82d0('0x1'));var path=require('path');var timeout=require(_0x82d0('0x2'));var express=require(_0x82d0('0x3'));var router=express[_0x82d0('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x82d0('0x5'));var controller=require(_0x82d0('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x82d0('0x7')]);router[_0x82d0('0x8')](_0x82d0('0x9'),auth[_0x82d0('0xa')](),controller[_0x82d0('0xb')]);router[_0x82d0('0xc')]('/',auth[_0x82d0('0xa')](),controller[_0x82d0('0xd')]);router[_0x82d0('0xe')](_0x82d0('0x9'),auth[_0x82d0('0xa')](),controller[_0x82d0('0xf')]);router[_0x82d0('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x82d0('0x11')]);module[_0x82d0('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 79b5aad..0e9deba 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 _0x1150=['STRING','*,*,*,*','sequelize','exports','INTEGER'];(function(_0x1d0e07,_0x2037e9){var _0x8912e0=function(_0x3b1c66){while(--_0x3b1c66){_0x1d0e07['push'](_0x1d0e07['shift']());}};_0x8912e0(++_0x2037e9);}(_0x1150,0xc0));var _0x0115=function(_0x33875d,_0xf2f624){_0x33875d=_0x33875d-0x0;var _0x477086=_0x1150[_0x33875d];return _0x477086;};'use strict';var Sequelize=require(_0x0115('0x0'));module[_0x0115('0x1')]={'priority':{'type':Sequelize[_0x0115('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x0115('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x0115('0x3')]},'interval':{'type':Sequelize[_0x0115('0x3')],'defaultValue':_0x0115('0x4')}}; \ No newline at end of file +var _0x67ec=['STRING','*,*,*,*','sequelize','exports','INTEGER','TEXT'];(function(_0x2defb5,_0x1cda14){var _0x229c53=function(_0x5dd408){while(--_0x5dd408){_0x2defb5['push'](_0x2defb5['shift']());}};_0x229c53(++_0x1cda14);}(_0x67ec,0x1a6));var _0xc67e=function(_0x5ad4d6,_0x2954a2){_0x5ad4d6=_0x5ad4d6-0x0;var _0x22cb45=_0x67ec[_0x5ad4d6];return _0x22cb45;};'use strict';var Sequelize=require(_0xc67e('0x0'));module[_0xc67e('0x1')]={'priority':{'type':Sequelize[_0xc67e('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xc67e('0x3')]()},'description':{'type':Sequelize[_0xc67e('0x4')]},'interval':{'type':Sequelize[_0xc67e('0x4')],'defaultValue':_0xc67e('0x5')}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index b2766c4..eb3c8e5 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 _0xb1d2=['request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','reject','update','then','error','stack','index','map','SmsApplication','rawAttributes','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','include','catch','show','params','length','body','destroy','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x15999e,_0xc637f3){var _0x48f59d=function(_0x4dc90d){while(--_0x4dc90d){_0x15999e['push'](_0x15999e['shift']());}};_0x48f59d(++_0xc637f3);}(_0xb1d2,0x87));var _0x2b1d=function(_0x52d044,_0x2582e0){_0x52d044=_0x52d044-0x0;var _0x49c5fe=_0xb1d2[_0x52d044];return _0x49c5fe;};'use strict';var pdf=require(_0x2b1d('0x0'));var emlformat=require(_0x2b1d('0x1'));var rimraf=require(_0x2b1d('0x2'));var zipdir=require(_0x2b1d('0x3'));var jsonpatch=require(_0x2b1d('0x4'));var rp=require(_0x2b1d('0x5'));var moment=require(_0x2b1d('0x6'));var BPromise=require(_0x2b1d('0x7'));var Mustache=require(_0x2b1d('0x8'));var util=require(_0x2b1d('0x9'));var path=require(_0x2b1d('0xa'));var sox=require(_0x2b1d('0xb'));var csv=require(_0x2b1d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2b1d('0xd'));var squel=require(_0x2b1d('0xe'));var crypto=require(_0x2b1d('0xf'));var jsforce=require(_0x2b1d('0x10'));var deskjs=require('desk.js');var toCsv=require(_0x2b1d('0xc'));var querystring=require('querystring');var Papa=require(_0x2b1d('0x11'));var Redis=require(_0x2b1d('0x12'));var authService=require(_0x2b1d('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x2b1d('0x14'));var hardwareService=require(_0x2b1d('0x15'));var logger=require(_0x2b1d('0x16'))(_0x2b1d('0x17'));var utils=require(_0x2b1d('0x18'));var config=require(_0x2b1d('0x19'));var db=require(_0x2b1d('0x1a'))['db'];function respondWithStatusCode(_0x1576a1,_0x194cf6){_0x194cf6=_0x194cf6||0xcc;return function(_0x261849){if(_0x261849){return _0x1576a1[_0x2b1d('0x1b')](_0x194cf6);}return _0x1576a1[_0x2b1d('0x1c')](_0x194cf6)[_0x2b1d('0x1d')]();};}function respondWithResult(_0xe8d0c7,_0x5a9432){_0x5a9432=_0x5a9432||0xc8;return function(_0x1a7c27){if(_0x1a7c27){return _0xe8d0c7['status'](_0x5a9432)['json'](_0x1a7c27);}};}function respondWithFilteredResult(_0x9249f0,_0x343bd0){return function(_0x375ef9){if(_0x375ef9){var _0x329a16=_0x375ef9[_0x2b1d('0x1e')],_0x11f806=_0x343bd0[_0x2b1d('0x1f')],_0x2809a0=_0x343bd0[_0x2b1d('0x1f')]+_0x343bd0[_0x2b1d('0x20')],_0x127729;if(_0x2809a0>=_0x329a16){_0x2809a0=_0x329a16;_0x127729=0xc8;}else{_0x127729=0xce;}_0x9249f0[_0x2b1d('0x1c')](_0x127729);return _0x9249f0[_0x2b1d('0x21')]('Content-Range',_0x11f806+'-'+_0x2809a0+'/'+_0x329a16)[_0x2b1d('0x22')](_0x375ef9);}return null;};}function patchUpdates(_0x342e96){return function(_0x38c963){try{jsonpatch['apply'](_0x38c963,_0x342e96,!![]);}catch(_0x4243d9){return BPromise[_0x2b1d('0x23')](_0x4243d9);}return _0x38c963['save']();};}function saveUpdates(_0x22e9ba,_0x88ac28){return function(_0x2eaf26){if(_0x2eaf26){return _0x2eaf26[_0x2b1d('0x24')](_0x22e9ba)[_0x2b1d('0x25')](function(_0x11af33){return _0x11af33;});}return null;};}function removeEntity(_0x31f407,_0x3940d4){return function(_0x281f86){if(_0x281f86){return _0x281f86['destroy']()[_0x2b1d('0x25')](function(){_0x31f407['status'](0xcc)[_0x2b1d('0x1d')]();});}};}function handleEntityNotFound(_0x51ea7,_0x1b1db3){return function(_0x221dd1){if(!_0x221dd1){_0x51ea7['sendStatus'](0x194);}return _0x221dd1;};}function handleError(_0x3e0bdb,_0x3c9ba3){_0x3c9ba3=_0x3c9ba3||0x1f4;return function(_0x4bdb20){logger[_0x2b1d('0x26')](_0x4bdb20[_0x2b1d('0x27')]);if(_0x4bdb20['name']){delete _0x4bdb20['name'];}_0x3e0bdb[_0x2b1d('0x1c')](_0x3c9ba3)['send'](_0x4bdb20);};}exports[_0x2b1d('0x28')]=function(_0x1a3c6f,_0x2ad118){var _0x2797b6={},_0x4dc632={},_0x2e3a73={'count':0x0,'rows':[]};var _0xe8282a=_[_0x2b1d('0x29')](db[_0x2b1d('0x2a')][_0x2b1d('0x2b')],function(_0x4ed990){return{'name':_0x4ed990[_0x2b1d('0x2c')],'type':_0x4ed990[_0x2b1d('0x2d')]['key']};});_0x4dc632['model']=_['map'](_0xe8282a,_0x2b1d('0x2e'));_0x4dc632[_0x2b1d('0x2f')]=_[_0x2b1d('0x30')](_0x1a3c6f[_0x2b1d('0x2f')]);_0x4dc632[_0x2b1d('0x31')]=_[_0x2b1d('0x32')](_0x4dc632[_0x2b1d('0x33')],_0x4dc632[_0x2b1d('0x2f')]);_0x2797b6[_0x2b1d('0x34')]=_[_0x2b1d('0x32')](_0x4dc632[_0x2b1d('0x33')],qs['fields'](_0x1a3c6f['query'][_0x2b1d('0x35')]));_0x2797b6[_0x2b1d('0x34')]=_0x2797b6[_0x2b1d('0x34')]['length']?_0x2797b6[_0x2b1d('0x34')]:_0x4dc632[_0x2b1d('0x33')];if(!_0x1a3c6f[_0x2b1d('0x2f')]['hasOwnProperty'](_0x2b1d('0x36'))){_0x2797b6[_0x2b1d('0x20')]=qs[_0x2b1d('0x20')](_0x1a3c6f[_0x2b1d('0x2f')][_0x2b1d('0x20')]);_0x2797b6[_0x2b1d('0x1f')]=qs[_0x2b1d('0x1f')](_0x1a3c6f[_0x2b1d('0x2f')][_0x2b1d('0x1f')]);}_0x2797b6[_0x2b1d('0x37')]=qs[_0x2b1d('0x38')](_0x1a3c6f[_0x2b1d('0x2f')][_0x2b1d('0x38')]);_0x2797b6['where']=qs[_0x2b1d('0x31')](_[_0x2b1d('0x39')](_0x1a3c6f[_0x2b1d('0x2f')],_0x4dc632[_0x2b1d('0x31')]));if(_0x1a3c6f[_0x2b1d('0x2f')][_0x2b1d('0x3a')]){_0x2797b6[_0x2b1d('0x3b')]=_[_0x2b1d('0x3c')](_0x2797b6[_0x2b1d('0x3b')],{'$or':_['map'](_0xe8282a,function(_0x4a3e45){if(_0x4a3e45[_0x2b1d('0x2d')]!=='VIRTUAL'){var _0x15fb55={};_0x15fb55[_0x4a3e45['name']]={'$like':'%'+_0x1a3c6f[_0x2b1d('0x2f')]['filter']+'%'};return _0x15fb55;}})});}_0x2797b6=_[_0x2b1d('0x3c')]({},_0x2797b6,_0x1a3c6f[_0x2b1d('0x3d')]);var _0x22d136={'where':_0x2797b6[_0x2b1d('0x3b')]};return db[_0x2b1d('0x2a')][_0x2b1d('0x1e')](_0x22d136)[_0x2b1d('0x25')](function(_0x4cb51a){_0x2e3a73[_0x2b1d('0x1e')]=_0x4cb51a;if(_0x1a3c6f['query']['includeAll']){_0x2797b6[_0x2b1d('0x3e')]=[{'all':!![]}];}return db['SmsApplication']['findAll'](_0x2797b6);})[_0x2b1d('0x25')](function(_0x2f32e8){_0x2e3a73['rows']=_0x2f32e8;return _0x2e3a73;})[_0x2b1d('0x25')](respondWithFilteredResult(_0x2ad118,_0x2797b6))[_0x2b1d('0x3f')](handleError(_0x2ad118,null));};exports[_0x2b1d('0x40')]=function(_0x54781c,_0x43e4a4){var _0x36ab88={'raw':!![],'where':{'id':_0x54781c[_0x2b1d('0x41')]['id']}},_0x51a475={};_0x51a475[_0x2b1d('0x33')]=_[_0x2b1d('0x30')](db[_0x2b1d('0x2a')][_0x2b1d('0x2b')]);_0x51a475[_0x2b1d('0x2f')]=_[_0x2b1d('0x30')](_0x54781c['query']);_0x51a475[_0x2b1d('0x31')]=_[_0x2b1d('0x32')](_0x51a475[_0x2b1d('0x33')],_0x51a475[_0x2b1d('0x2f')]);_0x36ab88[_0x2b1d('0x34')]=_[_0x2b1d('0x32')](_0x51a475[_0x2b1d('0x33')],qs[_0x2b1d('0x35')](_0x54781c[_0x2b1d('0x2f')][_0x2b1d('0x35')]));_0x36ab88[_0x2b1d('0x34')]=_0x36ab88[_0x2b1d('0x34')][_0x2b1d('0x42')]?_0x36ab88[_0x2b1d('0x34')]:_0x51a475[_0x2b1d('0x33')];if(_0x54781c[_0x2b1d('0x2f')]['includeAll']){_0x36ab88['include']=[{'all':!![]}];}_0x36ab88=_[_0x2b1d('0x3c')]({},_0x36ab88,_0x54781c[_0x2b1d('0x3d')]);return db[_0x2b1d('0x2a')]['find'](_0x36ab88)['then'](handleEntityNotFound(_0x43e4a4,null))[_0x2b1d('0x25')](respondWithResult(_0x43e4a4,null))[_0x2b1d('0x3f')](handleError(_0x43e4a4,null));};exports['create']=function(_0x46206e,_0x3c4cb1){return db[_0x2b1d('0x2a')]['create'](_0x46206e['body'],{})[_0x2b1d('0x25')](respondWithResult(_0x3c4cb1,0xc9))[_0x2b1d('0x3f')](handleError(_0x3c4cb1,null));};exports[_0x2b1d('0x24')]=function(_0x2378e7,_0x40dd89){if(_0x2378e7['body']['id']){delete _0x2378e7[_0x2b1d('0x43')]['id'];}return db[_0x2b1d('0x2a')]['find']({'where':{'id':_0x2378e7[_0x2b1d('0x41')]['id']}})[_0x2b1d('0x25')](handleEntityNotFound(_0x40dd89,null))['then'](saveUpdates(_0x2378e7[_0x2b1d('0x43')],null))['then'](respondWithResult(_0x40dd89,null))['catch'](handleError(_0x40dd89,null));};exports[_0x2b1d('0x44')]=function(_0x36b95f,_0x4bf35c){return db[_0x2b1d('0x2a')][_0x2b1d('0x45')]({'where':{'id':_0x36b95f[_0x2b1d('0x41')]['id']}})['then'](handleEntityNotFound(_0x4bf35c,null))[_0x2b1d('0x25')](removeEntity(_0x4bf35c,null))[_0x2b1d('0x3f')](handleError(_0x4bf35c,null));}; \ No newline at end of file +var _0xeac3=['count','offset','status','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','map','SmsApplication','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','catch','rawAttributes','length','find','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','moment','mustache','path','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','end','json'];(function(_0x3f4891,_0x4e6f62){var _0x54f2d8=function(_0x2b11ee){while(--_0x2b11ee){_0x3f4891['push'](_0x3f4891['shift']());}};_0x54f2d8(++_0x4e6f62);}(_0xeac3,0xaa));var _0x3eac=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0xeac3[_0x53ccf2];return _0x5a2964;};'use strict';var pdf=require(_0x3eac('0x0'));var emlformat=require(_0x3eac('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3eac('0x2'));var jsonpatch=require(_0x3eac('0x3'));var rp=require('request-promise');var moment=require(_0x3eac('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3eac('0x5'));var util=require('util');var path=require(_0x3eac('0x6'));var sox=require('sox');var csv=require(_0x3eac('0x7'));var ejs=require(_0x3eac('0x8'));var fs=require('fs');var _=require(_0x3eac('0x9'));var squel=require(_0x3eac('0xa'));var crypto=require('crypto');var jsforce=require(_0x3eac('0xb'));var deskjs=require(_0x3eac('0xc'));var toCsv=require(_0x3eac('0x7'));var querystring=require(_0x3eac('0xd'));var Papa=require(_0x3eac('0xe'));var Redis=require('ioredis');var authService=require(_0x3eac('0xf'));var qs=require(_0x3eac('0x10'));var as=require(_0x3eac('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x3eac('0x12'));var db=require(_0x3eac('0x13'))['db'];function respondWithStatusCode(_0x2c8141,_0x32a98d){_0x32a98d=_0x32a98d||0xcc;return function(_0xada163){if(_0xada163){return _0x2c8141['sendStatus'](_0x32a98d);}return _0x2c8141['status'](_0x32a98d)[_0x3eac('0x14')]();};}function respondWithResult(_0x4b292c,_0x1a3367){_0x1a3367=_0x1a3367||0xc8;return function(_0x909722){if(_0x909722){return _0x4b292c['status'](_0x1a3367)[_0x3eac('0x15')](_0x909722);}};}function respondWithFilteredResult(_0x43f740,_0xdff4c9){return function(_0x3c98ea){if(_0x3c98ea){var _0x1f1007=_0x3c98ea[_0x3eac('0x16')],_0x2db7c5=_0xdff4c9['offset'],_0x40df31=_0xdff4c9[_0x3eac('0x17')]+_0xdff4c9['limit'],_0x147531;if(_0x40df31>=_0x1f1007){_0x40df31=_0x1f1007;_0x147531=0xc8;}else{_0x147531=0xce;}_0x43f740[_0x3eac('0x18')](_0x147531);return _0x43f740[_0x3eac('0x19')](_0x3eac('0x1a'),_0x2db7c5+'-'+_0x40df31+'/'+_0x1f1007)[_0x3eac('0x15')](_0x3c98ea);}return null;};}function patchUpdates(_0x2fffcf){return function(_0x13f67b){try{jsonpatch[_0x3eac('0x1b')](_0x13f67b,_0x2fffcf,!![]);}catch(_0x3caa6b){return BPromise[_0x3eac('0x1c')](_0x3caa6b);}return _0x13f67b[_0x3eac('0x1d')]();};}function saveUpdates(_0x424808,_0x5cd72a){return function(_0x6430da){if(_0x6430da){return _0x6430da[_0x3eac('0x1e')](_0x424808)[_0x3eac('0x1f')](function(_0x4de03e){return _0x4de03e;});}return null;};}function removeEntity(_0x4e0bca,_0x17268d){return function(_0x79dec6){if(_0x79dec6){return _0x79dec6[_0x3eac('0x20')]()['then'](function(){_0x4e0bca[_0x3eac('0x18')](0xcc)[_0x3eac('0x14')]();});}};}function handleEntityNotFound(_0x27e88d,_0x5a8a6f){return function(_0x1f5ce5){if(!_0x1f5ce5){_0x27e88d['sendStatus'](0x194);}return _0x1f5ce5;};}function handleError(_0x409739,_0x2a5864){_0x2a5864=_0x2a5864||0x1f4;return function(_0x3616ed){logger['error'](_0x3616ed[_0x3eac('0x21')]);if(_0x3616ed['name']){delete _0x3616ed[_0x3eac('0x22')];}_0x409739[_0x3eac('0x18')](_0x2a5864)[_0x3eac('0x23')](_0x3616ed);};}exports['index']=function(_0x2be4cb,_0x4e128f){var _0x5daf96={},_0x5d3b29={},_0x4b208a={'count':0x0,'rows':[]};var _0x3cb5f1=_[_0x3eac('0x24')](db[_0x3eac('0x25')]['rawAttributes'],function(_0x3d27b7){return{'name':_0x3d27b7['fieldName'],'type':_0x3d27b7[_0x3eac('0x26')]['key']};});_0x5d3b29[_0x3eac('0x27')]=_[_0x3eac('0x24')](_0x3cb5f1,'name');_0x5d3b29[_0x3eac('0x28')]=_[_0x3eac('0x29')](_0x2be4cb[_0x3eac('0x28')]);_0x5d3b29[_0x3eac('0x2a')]=_[_0x3eac('0x2b')](_0x5d3b29['model'],_0x5d3b29[_0x3eac('0x28')]);_0x5daf96[_0x3eac('0x2c')]=_[_0x3eac('0x2b')](_0x5d3b29['model'],qs[_0x3eac('0x2d')](_0x2be4cb[_0x3eac('0x28')][_0x3eac('0x2d')]));_0x5daf96['attributes']=_0x5daf96[_0x3eac('0x2c')]['length']?_0x5daf96[_0x3eac('0x2c')]:_0x5d3b29[_0x3eac('0x27')];if(!_0x2be4cb['query'][_0x3eac('0x2e')]('nolimit')){_0x5daf96[_0x3eac('0x2f')]=qs[_0x3eac('0x2f')](_0x2be4cb[_0x3eac('0x28')][_0x3eac('0x2f')]);_0x5daf96[_0x3eac('0x17')]=qs['offset'](_0x2be4cb[_0x3eac('0x28')]['offset']);}_0x5daf96['order']=qs[_0x3eac('0x30')](_0x2be4cb[_0x3eac('0x28')][_0x3eac('0x30')]);_0x5daf96[_0x3eac('0x31')]=qs[_0x3eac('0x2a')](_[_0x3eac('0x32')](_0x2be4cb['query'],_0x5d3b29[_0x3eac('0x2a')]));if(_0x2be4cb[_0x3eac('0x28')]['filter']){_0x5daf96[_0x3eac('0x31')]=_[_0x3eac('0x33')](_0x5daf96[_0x3eac('0x31')],{'$or':_[_0x3eac('0x24')](_0x3cb5f1,function(_0x250f52){if(_0x250f52[_0x3eac('0x26')]!==_0x3eac('0x34')){var _0x50812d={};_0x50812d[_0x250f52[_0x3eac('0x22')]]={'$like':'%'+_0x2be4cb[_0x3eac('0x28')][_0x3eac('0x35')]+'%'};return _0x50812d;}})});}_0x5daf96=_[_0x3eac('0x33')]({},_0x5daf96,_0x2be4cb[_0x3eac('0x36')]);var _0x1684a6={'where':_0x5daf96[_0x3eac('0x31')]};return db[_0x3eac('0x25')]['count'](_0x1684a6)[_0x3eac('0x1f')](function(_0x55f675){_0x4b208a[_0x3eac('0x16')]=_0x55f675;if(_0x2be4cb['query'][_0x3eac('0x37')]){_0x5daf96[_0x3eac('0x38')]=[{'all':!![]}];}return db[_0x3eac('0x25')][_0x3eac('0x39')](_0x5daf96);})[_0x3eac('0x1f')](function(_0x298bfb){_0x4b208a['rows']=_0x298bfb;return _0x4b208a;})[_0x3eac('0x1f')](respondWithFilteredResult(_0x4e128f,_0x5daf96))[_0x3eac('0x3a')](handleError(_0x4e128f,null));};exports['show']=function(_0x162544,_0x1c02a7){var _0x3e9316={'raw':!![],'where':{'id':_0x162544['params']['id']}},_0x23bb5f={};_0x23bb5f[_0x3eac('0x27')]=_[_0x3eac('0x29')](db[_0x3eac('0x25')][_0x3eac('0x3b')]);_0x23bb5f['query']=_[_0x3eac('0x29')](_0x162544[_0x3eac('0x28')]);_0x23bb5f[_0x3eac('0x2a')]=_['intersection'](_0x23bb5f['model'],_0x23bb5f['query']);_0x3e9316[_0x3eac('0x2c')]=_[_0x3eac('0x2b')](_0x23bb5f[_0x3eac('0x27')],qs['fields'](_0x162544[_0x3eac('0x28')][_0x3eac('0x2d')]));_0x3e9316[_0x3eac('0x2c')]=_0x3e9316[_0x3eac('0x2c')][_0x3eac('0x3c')]?_0x3e9316[_0x3eac('0x2c')]:_0x23bb5f['model'];if(_0x162544[_0x3eac('0x28')][_0x3eac('0x37')]){_0x3e9316[_0x3eac('0x38')]=[{'all':!![]}];}_0x3e9316=_['merge']({},_0x3e9316,_0x162544[_0x3eac('0x36')]);return db[_0x3eac('0x25')][_0x3eac('0x3d')](_0x3e9316)['then'](handleEntityNotFound(_0x1c02a7,null))[_0x3eac('0x1f')](respondWithResult(_0x1c02a7,null))[_0x3eac('0x3a')](handleError(_0x1c02a7,null));};exports['create']=function(_0x4320e0,_0x37a7fe){return db[_0x3eac('0x25')]['create'](_0x4320e0[_0x3eac('0x3e')],{})[_0x3eac('0x1f')](respondWithResult(_0x37a7fe,0xc9))[_0x3eac('0x3a')](handleError(_0x37a7fe,null));};exports[_0x3eac('0x1e')]=function(_0x42b005,_0x48c9bb){if(_0x42b005[_0x3eac('0x3e')]['id']){delete _0x42b005[_0x3eac('0x3e')]['id'];}return db[_0x3eac('0x25')][_0x3eac('0x3d')]({'where':{'id':_0x42b005['params']['id']}})[_0x3eac('0x1f')](handleEntityNotFound(_0x48c9bb,null))[_0x3eac('0x1f')](saveUpdates(_0x42b005[_0x3eac('0x3e')],null))[_0x3eac('0x1f')](respondWithResult(_0x48c9bb,null))[_0x3eac('0x3a')](handleError(_0x48c9bb,null));};exports[_0x3eac('0x20')]=function(_0x3a8bf9,_0x5d5ce5){return db[_0x3eac('0x25')][_0x3eac('0x3d')]({'where':{'id':_0x3a8bf9[_0x3eac('0x3f')]['id']}})[_0x3eac('0x1f')](handleEntityNotFound(_0x5d5ce5,null))[_0x3eac('0x1f')](removeEntity(_0x5d5ce5,null))[_0x3eac('0x3a')](handleError(_0x5d5ce5,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index e1e9601..249a9dc 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 _0x4454=['utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x4454,0x194));var _0x4445=function(_0x42d886,_0x352821){_0x42d886=_0x42d886-0x0;var _0x4fba7c=_0x4454[_0x42d886];return _0x4fba7c;};'use strict';var _=require('lodash');var util=require(_0x4445('0x0'));var logger=require(_0x4445('0x1'))(_0x4445('0x2'));var moment=require(_0x4445('0x3'));var BPromise=require(_0x4445('0x4'));var rp=require(_0x4445('0x5'));var fs=require('fs');var path=require(_0x4445('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4445('0x7'));module[_0x4445('0x8')]=function(_0x4e0783,_0x28eac3){return _0x4e0783[_0x4445('0x9')](_0x4445('0xa'),attributes,{'tableName':_0x4445('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4445('0xc')});}; \ No newline at end of file +var _0x2daa=['./smsApplication.attributes','exports','define','sms_applications','utf8mb4_unicode_ci','../../config/logger','api','request-promise','path','../../config/environment'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x2daa,0x9b));var _0xa2da=function(_0x412342,_0x180734){_0x412342=_0x412342-0x0;var _0x3e62cb=_0x2daa[_0x412342];return _0x3e62cb;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xa2da('0x0'))(_0xa2da('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa2da('0x2'));var fs=require('fs');var path=require(_0xa2da('0x3'));var rimraf=require('rimraf');var config=require(_0xa2da('0x4'));var attributes=require(_0xa2da('0x5'));module[_0xa2da('0x6')]=function(_0x161b48,_0x50cded){return _0x161b48[_0xa2da('0x7')]('SmsApplication',attributes,{'tableName':_0xa2da('0x8'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xa2da('0x9')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index f7d9623..03c1a6a 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 _0x615a=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','then','info','SmsApplication,\x20%s,\x20%s','debug','SmsApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x4179e2,_0xf2dbb){var _0x24cb50=function(_0x3b7899){while(--_0x3b7899){_0x4179e2['push'](_0x4179e2['shift']());}};_0x24cb50(++_0xf2dbb);}(_0x615a,0x119));var _0xa615=function(_0xeff2c3,_0x3a5a82){_0xeff2c3=_0xeff2c3-0x0;var _0x2cade6=_0x615a[_0xeff2c3];return _0x2cade6;};'use strict';var _=require(_0xa615('0x0'));var util=require('util');var moment=require(_0xa615('0x1'));var BPromise=require('bluebird');var rs=require(_0xa615('0x2'));var fs=require('fs');var Redis=require(_0xa615('0x3'));var db=require(_0xa615('0x4'))['db'];var utils=require(_0xa615('0x5'));var logger=require('../../config/logger')(_0xa615('0x6'));var config=require(_0xa615('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xa615('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x44afda,_0x389dd4,_0x2db48d){return new BPromise(function(_0x1e714d,_0x2eae10){return client['request'](_0x44afda,_0x2db48d)[_0xa615('0x9')](function(_0x52470e){logger[_0xa615('0xa')](_0xa615('0xb'),_0x389dd4,'request\x20sent');logger[_0xa615('0xc')](_0xa615('0xd'),_0x389dd4,_0xa615('0xe'),JSON[_0xa615('0xf')](_0x52470e));if(_0x52470e[_0xa615('0x10')]){if(_0x52470e['error']['code']===0x1f4){logger[_0xa615('0x10')]('SmsApplication,\x20%s,\x20%s',_0x389dd4,_0x52470e[_0xa615('0x10')][_0xa615('0x11')]);return _0x2eae10(_0x52470e[_0xa615('0x10')][_0xa615('0x11')]);}logger['error']('SmsApplication,\x20%s,\x20%s',_0x389dd4,_0x52470e[_0xa615('0x10')][_0xa615('0x11')]);return _0x1e714d(_0x52470e[_0xa615('0x10')][_0xa615('0x11')]);}else{logger[_0xa615('0xa')](_0xa615('0xb'),_0x389dd4,_0xa615('0xe'));_0x1e714d(_0x52470e[_0xa615('0x12')][_0xa615('0x11')]);}})[_0xa615('0x13')](function(_0xa86873){logger[_0xa615('0x10')](_0xa615('0xb'),_0x389dd4,_0xa86873);_0x2eae10(_0xa86873);});});} \ No newline at end of file +var _0xf494=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x5cc3d4,_0xbcbf9b){var _0x17ca31=function(_0x5dbd6d){while(--_0x5dbd6d){_0x5cc3d4['push'](_0x5cc3d4['shift']());}};_0x17ca31(++_0xbcbf9b);}(_0xf494,0x1c6));var _0x4f49=function(_0x112ddb,_0x259b69){_0x112ddb=_0x112ddb-0x0;var _0x51fff1=_0xf494[_0x112ddb];return _0x51fff1;};'use strict';var _=require(_0x4f49('0x0'));var util=require(_0x4f49('0x1'));var moment=require(_0x4f49('0x2'));var BPromise=require('bluebird');var rs=require(_0x4f49('0x3'));var fs=require('fs');var Redis=require(_0x4f49('0x4'));var db=require(_0x4f49('0x5'))['db'];var utils=require(_0x4f49('0x6'));var logger=require(_0x4f49('0x7'))(_0x4f49('0x8'));var config=require(_0x4f49('0x9'));var jayson=require(_0x4f49('0xa'));var client=jayson[_0x4f49('0xb')][_0x4f49('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x42b0e8,_0x5eb186,_0x58e9a0){return new BPromise(function(_0x169c95,_0x327bd5){return client[_0x4f49('0xd')](_0x42b0e8,_0x58e9a0)[_0x4f49('0xe')](function(_0x185174){logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,_0x4f49('0x11'));logger['debug'](_0x4f49('0x12'),_0x5eb186,_0x4f49('0x11'),JSON['stringify'](_0x185174));if(_0x185174[_0x4f49('0x13')]){if(_0x185174['error']['code']===0x1f4){logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174['error'][_0x4f49('0x14')]);return _0x327bd5(_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);}logger[_0x4f49('0x13')](_0x4f49('0x10'),_0x5eb186,_0x185174[_0x4f49('0x13')][_0x4f49('0x14')]);return _0x169c95(_0x185174['error'][_0x4f49('0x14')]);}else{logger[_0x4f49('0xf')](_0x4f49('0x10'),_0x5eb186,'request\x20sent');_0x169c95(_0x185174['result'][_0x4f49('0x14')]);}})[_0x4f49('0x15')](function(_0x74886e){logger['error'](_0x4f49('0x10'),_0x5eb186,_0x74886e);_0x327bd5(_0x74886e);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index 97a7d45..e77a59f 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 _0x9f0e=['/:id/messages','/:id/download','download','create','addMessage','post','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','/describe','describe','get','/:id','show'];(function(_0x297528,_0x9d3b4b){var _0x27fc0d=function(_0x11fd4a){while(--_0x11fd4a){_0x297528['push'](_0x297528['shift']());}};_0x27fc0d(++_0x9d3b4b);}(_0x9f0e,0x8d));var _0xe9f0=function(_0x1375f1,_0xb428ff){_0x1375f1=_0x1375f1-0x0;var _0x13c9b7=_0x9f0e[_0x1375f1];return _0x13c9b7;};'use strict';var multer=require(_0xe9f0('0x0'));var util=require('util');var path=require(_0xe9f0('0x1'));var timeout=require(_0xe9f0('0x2'));var express=require(_0xe9f0('0x3'));var router=express['Router']();var auth=require(_0xe9f0('0x4'));var interaction=require(_0xe9f0('0x5'));var config=require(_0xe9f0('0x6'));var controller=require('./smsInteraction.controller');router['get']('/',auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x8')]);router['get'](_0xe9f0('0x9'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0xa')]);router[_0xe9f0('0xb')](_0xe9f0('0xc'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0xd')]);router[_0xe9f0('0xb')](_0xe9f0('0xe'),auth[_0xe9f0('0x7')](),controller['getMessages']);router[_0xe9f0('0xb')](_0xe9f0('0xf'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x10')]);router['post']('/',auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x11')]);router['post'](_0xe9f0('0xe'),auth[_0xe9f0('0x7')](),controller[_0xe9f0('0x12')]);router[_0xe9f0('0x13')](_0xe9f0('0x14'),auth[_0xe9f0('0x7')](),interaction[_0xe9f0('0x15')](_0xe9f0('0x16'),_0xe9f0('0x17')),controller[_0xe9f0('0x18')]);router[_0xe9f0('0x19')](_0xe9f0('0xc'),auth[_0xe9f0('0x7')](),interaction[_0xe9f0('0x15')](_0xe9f0('0x16'),_0xe9f0('0x1a')),controller[_0xe9f0('0x1b')]);router[_0xe9f0('0x1c')]('/:id',auth[_0xe9f0('0x7')](),interaction[_0xe9f0('0x15')](_0xe9f0('0x16'),_0xe9f0('0x1d')),controller[_0xe9f0('0x1e')]);router[_0xe9f0('0x1c')](_0xe9f0('0x14'),auth['isAuthenticated'](),controller['removeTags']);module['exports']=router; \ No newline at end of file +var _0x0936=['isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','tracked','sms','smsinteraction:addtags','addTags','put','smsinteraction:update','update','smsinteraction:destroy','destroy','delete','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./smsInteraction.controller','get'];(function(_0x2b8e3c,_0x3c12c9){var _0xdfb0bc=function(_0x523082){while(--_0x523082){_0x2b8e3c['push'](_0x2b8e3c['shift']());}};_0xdfb0bc(++_0x3c12c9);}(_0x0936,0xde));var _0x6093=function(_0x5e2e8b,_0x39ae8e){_0x5e2e8b=_0x5e2e8b-0x0;var _0x4b86cf=_0x0936[_0x5e2e8b];return _0x4b86cf;};'use strict';var multer=require(_0x6093('0x0'));var util=require(_0x6093('0x1'));var path=require(_0x6093('0x2'));var timeout=require(_0x6093('0x3'));var express=require(_0x6093('0x4'));var router=express[_0x6093('0x5')]();var auth=require(_0x6093('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x6093('0x7'));router[_0x6093('0x8')]('/',auth[_0x6093('0x9')](),controller[_0x6093('0xa')]);router[_0x6093('0x8')](_0x6093('0xb'),auth[_0x6093('0x9')](),controller['describe']);router['get'](_0x6093('0xc'),auth[_0x6093('0x9')](),controller[_0x6093('0xd')]);router[_0x6093('0x8')](_0x6093('0xe'),auth[_0x6093('0x9')](),controller[_0x6093('0xf')]);router[_0x6093('0x8')]('/:id/download',auth['isAuthenticated'](),controller[_0x6093('0x10')]);router[_0x6093('0x11')]('/',auth[_0x6093('0x9')](),controller[_0x6093('0x12')]);router[_0x6093('0x11')](_0x6093('0xe'),auth[_0x6093('0x9')](),controller[_0x6093('0x13')]);router[_0x6093('0x11')](_0x6093('0x14'),auth[_0x6093('0x9')](),interaction[_0x6093('0x15')](_0x6093('0x16'),_0x6093('0x17')),controller[_0x6093('0x18')]);router[_0x6093('0x19')](_0x6093('0xc'),auth[_0x6093('0x9')](),interaction[_0x6093('0x15')](_0x6093('0x16'),_0x6093('0x1a')),controller[_0x6093('0x1b')]);router['delete']('/:id',auth[_0x6093('0x9')](),interaction[_0x6093('0x15')](_0x6093('0x16'),_0x6093('0x1c')),controller[_0x6093('0x1d')]);router[_0x6093('0x1e')]('/:id/tags',auth[_0x6093('0x9')](),controller[_0x6093('0x1f')]);module[_0x6093('0x20')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 3c5452c..4c06ac0 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 _0xd8b0=['moment','STRING','DATE','ENUM','out','sequelize'];(function(_0x3cca3e,_0x950fc5){var _0x382338=function(_0x5dc3fe){while(--_0x5dc3fe){_0x3cca3e['push'](_0x3cca3e['shift']());}};_0x382338(++_0x950fc5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize[_0x0d8b('0x2')]},'note':{'type':Sequelize[_0x0d8b('0x2')]},'phone':{'type':Sequelize[_0x0d8b('0x2')]},'read1stAt':{'type':Sequelize[_0x0d8b('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in','out'),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x0d8b('0x4')]('in',_0x0d8b('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0x757a=['moment','exports','STRING','DATE','ENUM','out'];(function(_0x163ab5,_0x6a7dbe){var _0x17e579=function(_0x10733f){while(--_0x10733f){_0x163ab5['push'](_0x163ab5['shift']());}};_0x17e579(++_0x6a7dbe);}(_0x757a,0xde));var _0xa757=function(_0x4ce130,_0x26621){_0x4ce130=_0x4ce130-0x0;var _0x7e8af2=_0x757a[_0x4ce130];return _0x7e8af2;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xa757('0x0'));module[_0xa757('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xa757('0x2')]},'phone':{'type':Sequelize[_0xa757('0x2')]},'read1stAt':{'type':Sequelize[_0xa757('0x3')]},'firstMsgDirection':{'type':Sequelize[_0xa757('0x4')]('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xa757('0x3')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0xa757('0x5')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index bffed52..8224133 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 _0x7bd0=['firstName','Messages','SmsAccount','Account','User','get','mkdirSync','10px','40px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','Sms','Owner','closedAt','disposition','direction','out','System','lastName','secret','renderFile','root','views','downloadInteraction.html','toFile','transcript-','download','log','err','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs','lodash','squel','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./smsInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','name','send','Users','map','TagIds','Tags','push','catch','index','SmsInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','field','color','tools_tags','select','u.fullname','ui.SmsInteractionId','from','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','sms_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','sms_accounts','a.id\x20=\x20i.SmsAccountId','sms_messages','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','parseSearch','search','conditions','find','unreadMessages','value','having','`\x20>\x200','Contact','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','text','start','Tag','forEach','union','operator','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','i.phone\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','isEmpty','t.id\x20IN\x20?','SmsAccountId','journey','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IS\x20NULL','sequelize','toString','merge','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.SmsInteractionId\x20IN\x20?','groupBy','rows','show','params','rawAttributes','includeAll','options','create','update','describe','SmsMessage','addMessage','ids','omit','nolimit','SmsInteractionId','format','YYYY-MM-DD\x20HH:mm:ss','include','findAll','addTags','setTags','smsInteractionTags:save','removeTags','files','tmp','server','attachments','transcript-%d-%s.zip','join','fullname','CmContact'];(function(_0x569ab9,_0x3ed287){var _0x2dab07=function(_0x40d73b){while(--_0x40d73b){_0x569ab9['push'](_0x569ab9['shift']());}};_0x2dab07(++_0x3ed287);}(_0x7bd0,0x111));var _0x07bd=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0x7bd0[_0x55677b];return _0x104b88;};'use strict';var pdf=require(_0x07bd('0x0'));var emlformat=require(_0x07bd('0x1'));var rimraf=require(_0x07bd('0x2'));var zipdir=require(_0x07bd('0x3'));var jsonpatch=require(_0x07bd('0x4'));var rp=require(_0x07bd('0x5'));var moment=require(_0x07bd('0x6'));var BPromise=require(_0x07bd('0x7'));var Mustache=require('mustache');var util=require(_0x07bd('0x8'));var path=require(_0x07bd('0x9'));var sox=require(_0x07bd('0xa'));var csv=require(_0x07bd('0xb'));var ejs=require(_0x07bd('0xc'));var fs=require('fs');var _=require(_0x07bd('0xd'));var squel=require(_0x07bd('0xe'));var crypto=require('crypto');var jsforce=require(_0x07bd('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x07bd('0xb'));var querystring=require(_0x07bd('0x10'));var Papa=require(_0x07bd('0x11'));var Redis=require('ioredis');var authService=require(_0x07bd('0x12'));var qs=require(_0x07bd('0x13'));var as=require(_0x07bd('0x14'));var hardwareService=require(_0x07bd('0x15'));var logger=require('../../config/logger')(_0x07bd('0x16'));var utils=require(_0x07bd('0x17'));var config=require(_0x07bd('0x18'));var db=require(_0x07bd('0x19'))['db'];config[_0x07bd('0x1a')]=_[_0x07bd('0x1b')](config[_0x07bd('0x1a')],{'host':_0x07bd('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x07bd('0x1d'))[_0x07bd('0x1e')](socket);function respondWithStatusCode(_0x1c59c2,_0x247f3f){_0x247f3f=_0x247f3f||0xcc;return function(_0x188f35){if(_0x188f35){return _0x1c59c2[_0x07bd('0x1f')](_0x247f3f);}return _0x1c59c2[_0x07bd('0x20')](_0x247f3f)['end']();};}function respondWithResult(_0x418444,_0x505839){_0x505839=_0x505839||0xc8;return function(_0x229bf1){if(_0x229bf1){return _0x418444[_0x07bd('0x20')](_0x505839)[_0x07bd('0x21')](_0x229bf1);}};}function respondWithFilteredResult(_0x1713ca,_0x8aa645){return function(_0x4929d6){if(_0x4929d6){var _0x3f9f0b=_0x4929d6[_0x07bd('0x22')],_0xc4cf4c=_0x8aa645[_0x07bd('0x23')],_0x4948f4=_0x8aa645[_0x07bd('0x23')]+_0x8aa645[_0x07bd('0x24')],_0x3e8ec4;if(_0x4948f4>=_0x3f9f0b){_0x4948f4=_0x3f9f0b;_0x3e8ec4=0xc8;}else{_0x3e8ec4=0xce;}_0x1713ca[_0x07bd('0x20')](_0x3e8ec4);return _0x1713ca[_0x07bd('0x25')](_0x07bd('0x26'),_0xc4cf4c+'-'+_0x4948f4+'/'+_0x3f9f0b)[_0x07bd('0x21')](_0x4929d6);}return null;};}function patchUpdates(_0x50109f){return function(_0x15c0b8){try{jsonpatch[_0x07bd('0x27')](_0x15c0b8,_0x50109f,!![]);}catch(_0xcb8b23){return BPromise[_0x07bd('0x28')](_0xcb8b23);}return _0x15c0b8[_0x07bd('0x29')]();};}function saveUpdates(_0x47bd50,_0x4c673a){return function(_0xbb7117){if(_0xbb7117){return _0xbb7117['update'](_0x47bd50)[_0x07bd('0x2a')](function(_0x480c9c){return _0x480c9c;});}return null;};}function removeEntity(_0x50bd12,_0x4165bc){return function(_0x360aae){if(_0x360aae){return _0x360aae[_0x07bd('0x2b')]()[_0x07bd('0x2a')](function(){_0x50bd12[_0x07bd('0x20')](0xcc)[_0x07bd('0x2c')]();});}};}function handleEntityNotFound(_0x557042,_0x180b43){return function(_0x271623){if(!_0x271623){_0x557042[_0x07bd('0x1f')](0x194);}return _0x271623;};}function handleError(_0x2a7202,_0x12ce26){_0x12ce26=_0x12ce26||0x1f4;return function(_0x1c1fda){logger['error'](_0x1c1fda['stack']);if(_0x1c1fda['name']){delete _0x1c1fda[_0x07bd('0x2d')];}_0x2a7202[_0x07bd('0x20')](_0x12ce26)[_0x07bd('0x2e')](_0x1c1fda);};}function getInteractionUsers(_0x51efa8,_0x1a3aa9){return new BPromise(function(_0x400cc0,_0x253dc0){try{if(_0x1a3aa9[_0x51efa8['id']]){_0x51efa8[_0x07bd('0x2f')]=_[_0x07bd('0x30')](_0x1a3aa9[_0x51efa8['id']],function(_0x13bf6b){return{'id':_0x13bf6b['id'],'fullname':_0x13bf6b['fullname']};});}}catch(_0xfc836f){_0x253dc0(_0xfc836f);}_0x400cc0(_0x51efa8);});}function getInteractionTags(_0x20cc94,_0x4182b9){return new BPromise(function(_0x321200,_0x1b6cc){try{if(_0x20cc94[_0x07bd('0x31')]){_0x20cc94[_0x07bd('0x32')]=[];_0x20cc94[_0x07bd('0x31')]['split'](',')['forEach'](function(_0x3fe506){_0x20cc94[_0x07bd('0x32')][_0x07bd('0x33')](_0x4182b9[_0x3fe506]);});}delete _0x20cc94['TagIds'];}catch(_0x31316e){_0x1b6cc(_0x31316e);}_0x321200(_0x20cc94);});}function updateSmsInteraction(_0x2c8612,_0x208aca,_0x5eb6ca){return new BPromise(function(_0x55a9d4,_0x2c46f5){return getInteractionUsers(_0x2c8612,_0x5eb6ca)[_0x07bd('0x2a')](function(_0x71c030){return getInteractionTags(_0x71c030,_0x208aca);})[_0x07bd('0x2a')](function(_0x5f29c5){_0x55a9d4(_0x5f29c5);})[_0x07bd('0x34')](function(_0x3b1d78){_0x2c46f5(_0x3b1d78);});});}exports[_0x07bd('0x35')]=function(_0x4d12df,_0x278afb){var _0x31c381={},_0x51a232={},_0x41f039={'count':0x0,'rows':[]};var _0x2a3f40=_[_0x07bd('0x30')](db[_0x07bd('0x36')]['rawAttributes'],function(_0x4b3e00){return{'name':_0x4b3e00[_0x07bd('0x37')],'type':_0x4b3e00['type'][_0x07bd('0x38')]};});_0x51a232[_0x07bd('0x39')]=_[_0x07bd('0x30')](_0x2a3f40,_0x07bd('0x2d'));_0x51a232[_0x07bd('0x3a')]=_[_0x07bd('0x3b')](_0x4d12df[_0x07bd('0x3a')]);_0x51a232[_0x07bd('0x3c')]=_[_0x07bd('0x3d')](_0x51a232[_0x07bd('0x39')],_0x51a232[_0x07bd('0x3a')]);_0x31c381[_0x07bd('0x3e')]=_[_0x07bd('0x3d')](_0x51a232['model'],qs[_0x07bd('0x3f')](_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x3f')]));_0x31c381[_0x07bd('0x3e')]=_0x31c381['attributes'][_0x07bd('0x40')]?_0x31c381[_0x07bd('0x3e')]:_0x51a232[_0x07bd('0x39')];if(!_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x41')]('nolimit')){_0x31c381['limit']=qs[_0x07bd('0x24')](_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x24')]);_0x31c381[_0x07bd('0x23')]=qs['offset'](_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x23')]);}_0x31c381[_0x07bd('0x42')]=qs[_0x07bd('0x43')](_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x43')]);_0x31c381[_0x07bd('0x44')]=qs['filters'](_[_0x07bd('0x45')](_0x4d12df[_0x07bd('0x3a')],_0x51a232[_0x07bd('0x3c')]));var _0x3a5827=[];var _0x418f26=squel['select']()[_0x07bd('0x46')]('id')[_0x07bd('0x46')](_0x07bd('0x2d'))[_0x07bd('0x46')](_0x07bd('0x47'))['from'](_0x07bd('0x48'));var _0x3a0de3=squel[_0x07bd('0x49')]()[_0x07bd('0x46')]('u.id')['field'](_0x07bd('0x4a'))[_0x07bd('0x46')](_0x07bd('0x4b'))[_0x07bd('0x4c')](_0x07bd('0x4d'),'ui')[_0x07bd('0x4e')](_0x07bd('0x4f'),'u',_0x07bd('0x50'));var _0x1f2a7a=squel['select']()['from'](_0x07bd('0x51'),'i')[_0x07bd('0x4e')](_0x07bd('0x52'),'c',_0x07bd('0x53'))[_0x07bd('0x4e')](_0x07bd('0x4f'),'o','o.id\x20=\x20i.UserId')[_0x07bd('0x4e')](_0x07bd('0x54'),'a',_0x07bd('0x55'))[_0x07bd('0x4e')](_0x07bd('0x56'),'me',_0x07bd('0x57'))['left_join'](_0x07bd('0x58'),'it',_0x07bd('0x59'))[_0x07bd('0x4e')](_0x07bd('0x48'),'t',_0x07bd('0x5a'));var _0xc96a7d=squel[_0x07bd('0x5b')]();var _0x1e1ae6=[];var _0x2cde43=squel[_0x07bd('0x5b')]();var _0x1ee56f;if(_0x4d12df[_0x07bd('0x3a')]['search']){_0x1ee56f=as[_0x07bd('0x5c')](_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x5d')]);var _0x582535=_0x1ee56f['sqlOperator'];for(var _0x1e7a6e=0x0;_0x1e7a6e<_0x1ee56f['conditions'][_0x07bd('0x40')];_0x1e7a6e++){var _0x1f7de1=_0x1ee56f[_0x07bd('0x5e')][_0x1e7a6e];var _0x2ec556='i';var _0x2a8167=_[_0x07bd('0x5f')](_0x2a3f40,[_0x07bd('0x2d'),_0x1f7de1[_0x07bd('0x46')]]);if(!_0x2a8167){switch(_0x1f7de1['field']){case _0x07bd('0x60'):if(_0x1f7de1[_0x07bd('0x61')]==0x1){_0x1f2a7a[_0x07bd('0x62')]('`'+_0x1f7de1['field']+'`\x20=\x200');}else{_0x1f2a7a['having']('`'+_0x1f7de1[_0x07bd('0x46')]+_0x07bd('0x63'));}break;case _0x07bd('0x64'):if(_0x1f7de1['operator']===_0x07bd('0x65')){if(_0x1f7de1[_0x07bd('0x61')][_0x07bd('0x66')]('\x20')[_0x07bd('0x40')]>0x1){_0xc96a7d[_0x582535](_0x07bd('0x67'),qs[_0x07bd('0x68')](_0x1f7de1['value']),null);}else{var _0x560ccf='%'+_0x1f7de1[_0x07bd('0x61')]+'%';_0xc96a7d[_0x582535]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x560ccf,_0x560ccf,_0x560ccf);}}else{_0x2a8167=_['find'](_0x2a3f40,[_0x07bd('0x2d'),_0x07bd('0x69')]);_0x1f7de1[_0x07bd('0x46')]='ContactId';_0x278df2=as[_0x07bd('0x6a')](_0x2ec556,_0x2a8167[_0x07bd('0x6b')],_0x1f7de1);_0xc96a7d[_0x582535](_0x278df2[_0x07bd('0x6c')],_0x278df2[_0x07bd('0x61')][_0x07bd('0x6d')],_0x278df2[_0x07bd('0x61')][_0x07bd('0x2c')]);}break;case _0x07bd('0x6e'):var _0x27ff6b=_0x1f7de1['value'][_0x07bd('0x66')](',')['map'](function(_0x304796){return Number(_0x304796);});_0x27ff6b[_0x07bd('0x6f')](function(_0x2b7907){_0x2cde43['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2b7907+',%');});_0x1e1ae6=_[_0x07bd('0x70')](_0x1e1ae6,_0x27ff6b);break;case'User':if(_0x1f7de1[_0x07bd('0x71')]===_0x07bd('0x65')){_0xc96a7d[_0x582535](_0x07bd('0x72'),'%'+_0x1f7de1[_0x07bd('0x61')]+'%',null);}else{_0x2a8167=_['find'](_0x2a3f40,['name',_0x07bd('0x73')]);_0x1f7de1['field']=_0x07bd('0x73');_0x278df2=as[_0x07bd('0x6a')](_0x2ec556,_0x2a8167[_0x07bd('0x6b')],_0x1f7de1);_0xc96a7d[_0x582535](_0x278df2[_0x07bd('0x6c')],_0x278df2[_0x07bd('0x61')][_0x07bd('0x6d')],_0x278df2['value'][_0x07bd('0x2c')]);}break;case _0x07bd('0x74'):_0x278df2=as[_0x07bd('0x6a')]('me',null,_0x1f7de1);_0xc96a7d[_0x582535](_0x278df2[_0x07bd('0x6c')],_0x278df2[_0x07bd('0x61')]['start'],_0x278df2[_0x07bd('0x61')][_0x07bd('0x2c')]);break;}}else{var _0x278df2=as['buildExpression'](_0x2ec556,_0x2a8167[_0x07bd('0x6b')],_0x1f7de1);_0xc96a7d[_0x582535](_0x278df2['text'],_0x278df2[_0x07bd('0x61')][_0x07bd('0x6d')],_0x278df2['value']['end']);}}}else{var _0x34005e=_(_0x4d12df[_0x07bd('0x3a')])[_0x07bd('0x3b')]()[_0x07bd('0x30')](function(_0x11bd57){return _['some'](_0x2a3f40,[_0x07bd('0x2d'),_0x11bd57])?_0x11bd57:undefined;})['compact']()[_0x07bd('0x61')]();if(!_['isEmpty'](_0x34005e)){_0x34005e[_0x07bd('0x6f')](function(_0x4d6a47){if(_0x4d6a47==='SmsAccountId'){_0x1f2a7a[_0x07bd('0x44')](_0x07bd('0x75'),[][_0x07bd('0x76')](_0x4d12df[_0x07bd('0x3a')][_0x4d6a47]));}else if(_0x4d6a47===_0x07bd('0x77')){var _0x378986=JSON[_0x07bd('0x78')](_0x4d12df[_0x07bd('0x3a')][_0x4d6a47])[_0x07bd('0x79')];var _0x20ba85=JSON['parse'](_0x4d12df[_0x07bd('0x3a')][_0x4d6a47])['$lte'];_0x1f2a7a[_0x07bd('0x44')](_0x07bd('0x7a'),_0x378986,_0x20ba85);}else{if(_0x4d12df[_0x07bd('0x3a')][_0x4d6a47]==='null'){_0x1f2a7a[_0x07bd('0x44')]('i.'+_0x4d6a47+_0x07bd('0x7b'));}else{_0x1f2a7a[_0x07bd('0x44')]('i.'+_0x4d6a47+_0x07bd('0x7c'),_0x4d12df[_0x07bd('0x3a')][_0x4d6a47]);}}});}if(_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x7d')]){if(_0x4d12df['query'][_0x07bd('0x7d')]==0x1){_0x1f2a7a[_0x07bd('0x62')](_0x07bd('0x7e'));}else{_0x1f2a7a['having'](_0x07bd('0x7f'));}}if(_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x80')]){_0x1e1ae6=_[_0x07bd('0x81')](_0x4d12df['query'][_0x07bd('0x80')])?_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x80')]:new Array(_0x4d12df[_0x07bd('0x3a')]['tag']);_0x1e1ae6[_0x07bd('0x6f')](function(_0x5a590d){_0x2cde43['or'](_0x07bd('0x82'),'%,'+_0x5a590d+',%');});}if(_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x83')]){var _0x1968cd=_0x4d12df['query'][_0x07bd('0x83')][_0x07bd('0x84')]('\x5c','\x5c\x5c')[_0x07bd('0x84')]('\x27\x27',_0x07bd('0x85'));if(qs[_0x07bd('0x86')](_0x1968cd)){_0xc96a7d['or'](_0x07bd('0x87'),_0x1968cd+'%')['or'](_0x07bd('0x88'),_0x1968cd+'%');}else{_0xc96a7d['or']('MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x07bd('0x68')](_0x1968cd))['or'](_0x07bd('0x89'),_0x1968cd+'%');}}}_0x1f2a7a[_0x07bd('0x44')](_0xc96a7d);_0x1f2a7a[_0x07bd('0x8a')](_0x07bd('0x8b'));var _0x4d1c79={'type':db[_0x07bd('0x8c')][_0x07bd('0x8d')][_0x07bd('0x8e')],'raw':!![]};var _0x50aad3=_0x1f2a7a[_0x07bd('0x8f')]();_0x50aad3[_0x07bd('0x46')](_0x07bd('0x8b'));_0x50aad3[_0x07bd('0x46')](_0x07bd('0x90'),'unreadMessages');if(_0x31c381['order']){_0x31c381[_0x07bd('0x42')][_0x07bd('0x6f')](function(_0x1e722f){_0x1f2a7a[_0x07bd('0x42')]('i.'+_0x1e722f[0x0],_0x1e722f[0x1]===_0x07bd('0x91')?![]:!![]);});}if(!_[_0x07bd('0x92')](_0x1e1ae6)){_0x1f2a7a[_0x07bd('0x62')](_0x2cde43);_0x50aad3[_0x07bd('0x44')](_0x07bd('0x93'),_0x1e1ae6);}BPromise['resolve']()[_0x07bd('0x2a')](function(){if(!_0x1ee56f){if(_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x94')]||_0x4d12df[_0x07bd('0x3a')][_0x07bd('0x95')])return;_0x50aad3['where'](_0x07bd('0x96'));_0x1f2a7a['where'](_0x07bd('0x96'));return;}return _0x4d12df[_0x07bd('0x97')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x07bd('0x2a')](function(_0x51c697){if(_['isEmpty'](_0x51c697)){_0x50aad3[_0x07bd('0x44')](_0x07bd('0x98'));_0x1f2a7a[_0x07bd('0x44')](_0x07bd('0x98'));}else{_0x50aad3[_0x07bd('0x44')]('i.SmsAccountId\x20IN\x20?',_[_0x07bd('0x30')](_0x51c697,'id'));_0x1f2a7a[_0x07bd('0x44')](_0x07bd('0x75'),_['map'](_0x51c697,'id'));}});})[_0x07bd('0x2a')](function(){db[_0x07bd('0x99')]['query'](_0x50aad3[_0x07bd('0x9a')](),_0x4d1c79)[_0x07bd('0x2a')](function(_0x54af8a){_0x41f039[_0x07bd('0x22')]=_0x54af8a[_0x07bd('0x40')];if(_0x41f039[_0x07bd('0x22')]===0x0)return[];return db[_0x07bd('0x99')][_0x07bd('0x3a')](_0x418f26[_0x07bd('0x9a')](),_0x4d1c79)[_0x07bd('0x2a')](function(_0x33cdf8){_0x3a5827=_['keyBy'](_0x33cdf8,'id');_0x4d1c79=_[_0x07bd('0x9b')](_0x4d1c79,{'model':db[_0x07bd('0x36')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x4d12df['query'][_0x07bd('0x3f')]){_0x31c381[_0x07bd('0x3e')][_0x07bd('0x6f')](function(_0x7d85c2){_0x1f2a7a['field']('i.'+_0x7d85c2);});}else{_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0x90'),_0x07bd('0x60'));_0x1f2a7a[_0x07bd('0x46')]('a.key',_0x07bd('0x9c'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0x9d'),_0x07bd('0x9e'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0x9f'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xa0'),_0x07bd('0xa1'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xa2'),_0x07bd('0xa3'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xa4'),_0x07bd('0xa5'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xa6'),_0x07bd('0xa7'));_0x1f2a7a['field'](_0x07bd('0xa8'),_0x07bd('0xa9'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xaa'),_0x07bd('0xab'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xac'),_0x07bd('0xad'));_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xae'),'Owner.internal');_0x1f2a7a[_0x07bd('0x46')](_0x07bd('0xaf'),_0x07bd('0x31'));}_0x1f2a7a[_0x07bd('0x24')](_0x31c381[_0x07bd('0x24')]);_0x1f2a7a[_0x07bd('0x23')](_0x31c381[_0x07bd('0x23')]);return db[_0x07bd('0x99')][_0x07bd('0x3a')](_0x1f2a7a[_0x07bd('0x9a')](),_0x4d1c79);})[_0x07bd('0x2a')](function(_0x32a49c){_0x3a0de3[_0x07bd('0x44')](_0x07bd('0xb0'),_[_0x07bd('0x30')](_0x32a49c,'id'));return db[_0x07bd('0x99')][_0x07bd('0x3a')](_0x3a0de3[_0x07bd('0x9a')](),_0x4d1c79)[_0x07bd('0x2a')](function(_0x429472){var _0x4546da=_[_0x07bd('0xb1')](_0x429472,'SmsInteractionId');var _0x18eecd=[];_0x32a49c[_0x07bd('0x6f')](function(_0x52693f){_0x18eecd[_0x07bd('0x33')](updateSmsInteraction(_0x52693f,_0x3a5827,_0x4546da));});return BPromise['all'](_0x18eecd);});});})[_0x07bd('0x2a')](function(_0x5adf01){_0x41f039[_0x07bd('0xb2')]=_0x5adf01;return _0x41f039;})[_0x07bd('0x2a')](respondWithFilteredResult(_0x278afb,_0x31c381));})['catch'](handleError(_0x278afb,null));};exports[_0x07bd('0xb3')]=function(_0x454d34,_0x5209d9){var _0x3b3c65={'raw':![],'where':{'id':_0x454d34[_0x07bd('0xb4')]['id']}},_0x50865b={};_0x50865b[_0x07bd('0x39')]=_[_0x07bd('0x3b')](db[_0x07bd('0x36')][_0x07bd('0xb5')]);_0x50865b[_0x07bd('0x3a')]=_[_0x07bd('0x3b')](_0x454d34['query']);_0x50865b['filters']=_[_0x07bd('0x3d')](_0x50865b[_0x07bd('0x39')],_0x50865b[_0x07bd('0x3a')]);_0x3b3c65[_0x07bd('0x3e')]=_[_0x07bd('0x3d')](_0x50865b[_0x07bd('0x39')],qs['fields'](_0x454d34[_0x07bd('0x3a')]['fields']));_0x3b3c65[_0x07bd('0x3e')]=_0x3b3c65['attributes'][_0x07bd('0x40')]?_0x3b3c65[_0x07bd('0x3e')]:_0x50865b[_0x07bd('0x39')];if(_0x454d34[_0x07bd('0x3a')][_0x07bd('0xb6')]){_0x3b3c65['include']=[{'all':!![]}];}_0x3b3c65=_[_0x07bd('0x9b')]({},_0x3b3c65,_0x454d34[_0x07bd('0xb7')]);return db[_0x07bd('0x36')][_0x07bd('0x5f')](_0x3b3c65)[_0x07bd('0x2a')](handleEntityNotFound(_0x5209d9,null))[_0x07bd('0x2a')](respondWithResult(_0x5209d9,null))[_0x07bd('0x34')](handleError(_0x5209d9,null));};exports[_0x07bd('0xb8')]=function(_0xae49a7,_0x59b954){return db[_0x07bd('0x36')][_0x07bd('0xb8')](_0xae49a7[_0x07bd('0x74')],{})['then'](respondWithResult(_0x59b954,0xc9))[_0x07bd('0x34')](handleError(_0x59b954,null));};exports[_0x07bd('0xb9')]=function(_0xb0923c,_0x23c684){if(_0xb0923c['body']['id']){delete _0xb0923c[_0x07bd('0x74')]['id'];}return db[_0x07bd('0x36')][_0x07bd('0x5f')]({'where':{'id':_0xb0923c[_0x07bd('0xb4')]['id']}})['then'](handleEntityNotFound(_0x23c684,null))[_0x07bd('0x2a')](saveUpdates(_0xb0923c[_0x07bd('0x74')],null))[_0x07bd('0x2a')](respondWithResult(_0x23c684,null))['catch'](handleError(_0x23c684,null));};exports[_0x07bd('0x2b')]=function(_0x3d924a,_0x11afa0){return db[_0x07bd('0x36')]['find']({'where':{'id':_0x3d924a['params']['id']}})[_0x07bd('0x2a')](handleEntityNotFound(_0x11afa0,null))[_0x07bd('0x2a')](removeEntity(_0x11afa0,null))[_0x07bd('0x34')](handleError(_0x11afa0,null));};exports[_0x07bd('0xba')]=function(_0x1db772,_0x1e2178){return db[_0x07bd('0x36')]['describe']()['then'](respondWithResult(_0x1e2178,null))[_0x07bd('0x34')](handleError(_0x1e2178,null));};exports['addMessage']=function(_0x37cdf9,_0x36629f,_0x5add8b){return db[_0x07bd('0xbb')][_0x07bd('0x5f')]({'where':{'id':_0x37cdf9[_0x07bd('0xb4')]['id']}})[_0x07bd('0x2a')](handleEntityNotFound(_0x36629f,null))['then'](function(_0x5a0ad4){if(_0x5a0ad4){return _0x5a0ad4[_0x07bd('0xbc')](_0x37cdf9[_0x07bd('0x74')][_0x07bd('0xbd')],_[_0x07bd('0xbe')](_0x37cdf9[_0x07bd('0x74')],[_0x07bd('0xbd'),'id'])||{});}})[_0x07bd('0x2a')](respondWithResult(_0x36629f,null))[_0x07bd('0x34')](handleError(_0x36629f,null));};exports['getMessages']=function(_0x3d7f09,_0x582d88,_0x194bad){var _0x5d6d41={'raw':![],'where':{}};var _0x2c5b0e={};var _0xaf6578={'count':0x0,'rows':[]};return db[_0x07bd('0x36')]['findOne']({'where':{'id':_0x3d7f09[_0x07bd('0xb4')]['id']}})[_0x07bd('0x2a')](handleEntityNotFound(_0x582d88,null))['then'](function(_0x1b499e){if(_0x1b499e){_0x2c5b0e[_0x07bd('0x39')]=_[_0x07bd('0x3b')](db[_0x07bd('0xbb')]['rawAttributes']);_0x2c5b0e[_0x07bd('0x3a')]=_[_0x07bd('0x3b')](_0x3d7f09[_0x07bd('0x3a')]);_0x2c5b0e[_0x07bd('0x3c')]=_[_0x07bd('0x3d')](_0x2c5b0e['model'],_0x2c5b0e[_0x07bd('0x3a')]);_0x5d6d41['attributes']=_[_0x07bd('0x3d')](_0x2c5b0e['model'],qs[_0x07bd('0x3f')](_0x3d7f09[_0x07bd('0x3a')][_0x07bd('0x3f')]));_0x5d6d41[_0x07bd('0x3e')]=_0x5d6d41[_0x07bd('0x3e')]['length']?_0x5d6d41[_0x07bd('0x3e')]:_0x2c5b0e['model'];if(!_0x3d7f09[_0x07bd('0x3a')]['hasOwnProperty'](_0x07bd('0xbf'))){_0x5d6d41[_0x07bd('0x24')]=qs[_0x07bd('0x24')](_0x3d7f09[_0x07bd('0x3a')][_0x07bd('0x24')]);_0x5d6d41['offset']=qs[_0x07bd('0x23')](_0x3d7f09[_0x07bd('0x3a')][_0x07bd('0x23')]);}_0x5d6d41[_0x07bd('0x42')]=qs[_0x07bd('0x43')](_0x3d7f09[_0x07bd('0x3a')]['sort']);_0x5d6d41[_0x07bd('0x44')]=qs['filters'](_[_0x07bd('0x45')](_0x3d7f09[_0x07bd('0x3a')],_0x2c5b0e['filters']));_0x5d6d41['where'][_0x07bd('0xc0')]=_0x1b499e['id'];if(_0x3d7f09[_0x07bd('0x3a')]['filter']){_0x5d6d41['where']=_[_0x07bd('0x9b')](_0x5d6d41[_0x07bd('0x44')],{'$or':_['map'](_0x5d6d41[_0x07bd('0x3e')],function(_0x18a167){var _0x3ed59c={};_0x3ed59c[_0x18a167]={'$like':'%'+_0x3d7f09[_0x07bd('0x3a')]['filter']+'%'};return _0x3ed59c;})});}if(_0x3d7f09[_0x07bd('0x3a')][_0x07bd('0x79')]){var _0x7737ae=_0x3d7f09[_0x07bd('0x3a')]['$gte'][_0x07bd('0x66')](',');var _0x3739d7={};_0x3739d7[_0x7737ae[0x0]]={'$gte':moment(_0x7737ae[0x1])[_0x07bd('0xc1')](_0x07bd('0xc2'))};_0x5d6d41[_0x07bd('0x44')]=_[_0x07bd('0x9b')](_0x5d6d41['where'],_0x3739d7);}_0x5d6d41=_[_0x07bd('0x9b')]({},_0x5d6d41,_0x3d7f09[_0x07bd('0xb7')]);return db[_0x07bd('0xbb')][_0x07bd('0x22')]({'where':_0x5d6d41[_0x07bd('0x44')]})[_0x07bd('0x2a')](function(_0x119c16){_0xaf6578['count']=_0x119c16;if(_0x3d7f09[_0x07bd('0x3a')][_0x07bd('0xb6')]){_0x5d6d41[_0x07bd('0xc3')]=[{'all':!![]}];}return db['SmsMessage'][_0x07bd('0xc4')](_0x5d6d41);})[_0x07bd('0x2a')](function(_0xc6046c){_0xaf6578['rows']=_0xc6046c;return _0xaf6578;});}})[_0x07bd('0x2a')](respondWithFilteredResult(_0x582d88,_0x5d6d41))[_0x07bd('0x34')](handleError(_0x582d88,null));};exports[_0x07bd('0xc5')]=function(_0x180403,_0xa21fd,_0x46662c){return db[_0x07bd('0x36')][_0x07bd('0x5f')]({'where':{'id':_0x180403[_0x07bd('0xb4')]['id']}})[_0x07bd('0x2a')](handleEntityNotFound(_0xa21fd,null))[_0x07bd('0x2a')](function(_0x94f6ef){if(_0x94f6ef){return _0x94f6ef[_0x07bd('0xc6')](_0x180403[_0x07bd('0x74')]['ids'],_[_0x07bd('0xbe')](_0x180403['body'],['ids','id'])||{})['spread'](function(){return db[_0x07bd('0x6e')][_0x07bd('0xc4')]({'attributes':['id','name',_0x07bd('0x47')],'where':{'id':_0x180403['body']['ids']}});})[_0x07bd('0x2a')](function(_0x18d3d1){socket['emit'](_0x07bd('0xc7'),{'id':Number(_0x180403['params']['id']),'tags':_0x18d3d1||[]});return{'id':Number(_0x180403['params']['id']),'tags':_0x18d3d1||[]};});}})['then'](respondWithResult(_0xa21fd,null))[_0x07bd('0x34')](handleError(_0xa21fd,null));};exports['removeTags']=function(_0x33f818,_0x58f76d,_0x5e39ff){return db[_0x07bd('0x36')][_0x07bd('0x5f')]({'where':{'id':_0x33f818[_0x07bd('0xb4')]['id']}})[_0x07bd('0x2a')](handleEntityNotFound(_0x58f76d,null))[_0x07bd('0x2a')](function(_0x42e58a){if(_0x42e58a){return _0x42e58a[_0x07bd('0xc8')](_0x33f818[_0x07bd('0x3a')][_0x07bd('0xbd')]);}})[_0x07bd('0x2a')](respondWithStatusCode(_0x58f76d,null))['catch'](handleError(_0x58f76d,null));};exports['download']=function(_0x29050d,_0x3b2324){var _0x43856b=moment()['unix']()[_0x07bd('0x9a')]();var _0x3cbabb=path['join'](config['root'],'server',_0x07bd('0xc9'),_0x07bd('0xca'));var _0x1ada44=path['join'](config['root'],_0x07bd('0xcb'),'files',_0x07bd('0xcc'));var _0x4c843b=path['join'](_0x3cbabb,_0x43856b);var _0x4d4286=util['format'](_0x07bd('0xcd'),_0x29050d['params']['id'],_0x43856b);var _0x2c25e4=path[_0x07bd('0xce')](_0x3cbabb,_0x4d4286);var _0x2cb37c=[];_0x2cb37c[_0x07bd('0x33')]({'model':db['User'],'as':'User','attributes':['id',_0x07bd('0xcf')],'raw':!![]});_0x2cb37c['push']({'model':db[_0x07bd('0xd0')],'as':'Contact','attributes':['id',_0x07bd('0xd1'),'lastName'],'raw':!![]});var _0x48263c=[{'model':db[_0x07bd('0xbb')],'as':_0x07bd('0xd2'),'attributes':['id','body',_0x07bd('0x77'),'direction','secret','read'],'include':_0x2cb37c}];_0x48263c['push']({'model':db[_0x07bd('0xd3')],'as':_0x07bd('0xd4'),'attributes':['id',_0x07bd('0x2d')]});_0x48263c[_0x07bd('0x33')]({'model':db[_0x07bd('0xd5')],'as':'Owner','attributes':['id',_0x07bd('0xcf')]});return db[_0x07bd('0x36')][_0x07bd('0x5f')]({'where':{'id':_0x29050d[_0x07bd('0xb4')]['id']},'include':_0x48263c})[_0x07bd('0x2a')](handleEntityNotFound(_0x3b2324,null))[_0x07bd('0x2a')](function(_0x512931){if(_0x512931){var _0x232c0b=_0x512931[_0x07bd('0xd6')]({'plain':!![]});fs[_0x07bd('0xd7')](_0x4c843b);var _0x2e9d1e={'format':'A4','border':_0x07bd('0xd8'),'header':{'height':_0x07bd('0xd9'),'contents':{'first':_0x07bd('0xda')}},'footer':{'height':_0x07bd('0xdb'),'contents':{'default':util['format'](_0x07bd('0xdc'),util[_0x07bd('0xc1')](_0x07bd('0xdd'),'Sms',_0x232c0b['id']),moment()[_0x07bd('0xc1')](_0x07bd('0xde'))[_0x07bd('0x9a')]())}}};var _0x19f9ab={'channel':_0x07bd('0xdf'),'account':_0x232c0b[_0x07bd('0xd4')][_0x07bd('0x2d')],'agent':_0x232c0b[_0x07bd('0xe0')]?_0x232c0b[_0x07bd('0xe0')]['fullname']:'N.A.','createdAt':moment(_0x232c0b[_0x07bd('0x77')])[_0x07bd('0xc1')](_0x07bd('0xc2'))['toString'](),'closedAt':_0x232c0b['closed']?moment(_0x232c0b[_0x07bd('0xe1')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x07bd('0x9a')]():'','disposition':_0x232c0b[_0x07bd('0xe2')],'messages':_(_0x232c0b[_0x07bd('0xd2')])[_0x07bd('0x83')]({'secret':![]})['map'](function(_0x5a4bbb){return{'date':moment(_0x5a4bbb[_0x07bd('0x77')])[_0x07bd('0xc1')](_0x07bd('0xc2'))[_0x07bd('0x9a')](),'sender':_0x5a4bbb[_0x07bd('0xe3')]===_0x07bd('0xe4')?_0x5a4bbb[_0x07bd('0xd5')]?_0x5a4bbb[_0x07bd('0xd5')][_0x07bd('0xcf')]:_0x07bd('0xe5'):_0x5a4bbb[_0x07bd('0x64')][_0x07bd('0xd1')]+(_0x5a4bbb['Contact'][_0x07bd('0xe6')]?'\x20'+_0x5a4bbb['Contact']['lastName']:''),'body':_0x5a4bbb[_0x07bd('0x74')],'direction':_0x5a4bbb[_0x07bd('0xe3')]==='out'?'A':'C','secret':_0x5a4bbb[_0x07bd('0xe7')],'read':_0x5a4bbb['read']};})[_0x07bd('0x61')]()};return ejs[_0x07bd('0xe8')](path[_0x07bd('0xce')](config[_0x07bd('0xe9')],_0x07bd('0xcb'),_0x07bd('0xea'),_0x07bd('0xeb')),{'interaction':_0x19f9ab})[_0x07bd('0x2a')](function(_0x23d18b){return new BPromise(function(_0x8c6daf,_0x6e7a2d){pdf[_0x07bd('0xb8')](_0x23d18b,_0x2e9d1e)[_0x07bd('0xec')](path['join'](_0x4c843b,_0x07bd('0xed')+_0x232c0b['id']+'-'+_0x43856b+'.pdf'),function(_0x341f70,_0x711896){if(_0x341f70)return _0x6e7a2d(_0x341f70);_0x8c6daf(_0x711896);});});})[_0x07bd('0x2a')](function(){return new BPromise(function(_0x17262a,_0x46b7cc){zipdir(_0x4c843b,{'saveTo':_0x2c25e4},function(_0x23261d,_0x49ea11){if(_0x23261d)return _0x46b7cc(_0x23261d);return _0x17262a(_0x49ea11);});})[_0x07bd('0x2a')](function(){return new BPromise(function(_0x34c0dd,_0x4c5ae8){rimraf(_0x4c843b,function(_0x248cc3){if(_0x248cc3)_0x4c5ae8(_0x248cc3);return _0x34c0dd();});});})[_0x07bd('0x2a')](function(){return _0x3b2324[_0x07bd('0xee')](_0x2c25e4,_0x4d4286,function(_0x5399fb){if(_0x5399fb){console[_0x07bd('0xef')](_0x07bd('0xf0'),_0x5399fb);}else{fs['unlinkSync'](_0x2c25e4);}});});});}else{return _0x3b2324[_0x07bd('0x1f')](0xc8);}})[_0x07bd('0x34')](handleError(_0x3b2324,null));}; \ No newline at end of file +var _0x4bd3=['t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','having','`\x20>\x200','Contact','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','text','start','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','buildExpression','some','compact','isEmpty','concat','createdAt','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.phone\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','order','DESC','resolve','i.SmsAccountId\x20IS\x20NOT\x20NULL','user','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','SmsInteraction','attributes','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','SmsInteractionId','all','rows','catch','params','includeAll','include','merge','options','create','body','describe','addMessage','SmsMessage','ids','omit','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','spread','emit','smsInteractionTags:save','removeTags','download','unix','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','CmContact','firstName','Messages','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD','N.A.','closed','disposition','direction','out','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','log','err','unlinkSync','html-pdf','rimraf','zip-dir','bluebird','mustache','util','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','end','stack','name','send','Users','fullname','TagIds','split','forEach','push','then','index','map','rawAttributes','fieldName','type','key','model','keys','query','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','select','field','color','from','tools_tags','u.id','u.fullname','users','sms_interactions','left_join','o.id\x20=\x20i.UserId','sms_accounts','it.SmsInteractionId\x20=\x20i.id'];(function(_0x38db3a,_0x244702){var _0x2ead95=function(_0x558eab){while(--_0x558eab){_0x38db3a['push'](_0x38db3a['shift']());}};_0x2ead95(++_0x244702);}(_0x4bd3,0x174));var _0x34bd=function(_0x25b278,_0x2748a4){_0x25b278=_0x25b278-0x0;var _0x4feabf=_0x4bd3[_0x25b278];return _0x4feabf;};'use strict';var pdf=require(_0x34bd('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x34bd('0x1'));var zipdir=require(_0x34bd('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x34bd('0x3'));var Mustache=require(_0x34bd('0x4'));var util=require(_0x34bd('0x5'));var path=require('path');var sox=require(_0x34bd('0x6'));var csv=require(_0x34bd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x34bd('0x8'));var squel=require(_0x34bd('0x9'));var crypto=require('crypto');var jsforce=require(_0x34bd('0xa'));var deskjs=require(_0x34bd('0xb'));var toCsv=require(_0x34bd('0x7'));var querystring=require(_0x34bd('0xc'));var Papa=require(_0x34bd('0xd'));var Redis=require(_0x34bd('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x34bd('0xf'));var as=require(_0x34bd('0x10'));var hardwareService=require(_0x34bd('0x11'));var logger=require(_0x34bd('0x12'))('api');var utils=require('../../config/utils');var config=require(_0x34bd('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0x34bd('0x14')](config[_0x34bd('0x15')],{'host':_0x34bd('0x16'),'port':0x18eb});var socket=require(_0x34bd('0x17'))(new Redis(config[_0x34bd('0x15')]));require(_0x34bd('0x18'))[_0x34bd('0x19')](socket);function respondWithStatusCode(_0x236f6b,_0xf6d2f2){_0xf6d2f2=_0xf6d2f2||0xcc;return function(_0x59ed5d){if(_0x59ed5d){return _0x236f6b[_0x34bd('0x1a')](_0xf6d2f2);}return _0x236f6b['status'](_0xf6d2f2)['end']();};}function respondWithResult(_0x6638ed,_0x30b3f2){_0x30b3f2=_0x30b3f2||0xc8;return function(_0x280c1a){if(_0x280c1a){return _0x6638ed[_0x34bd('0x1b')](_0x30b3f2)[_0x34bd('0x1c')](_0x280c1a);}};}function respondWithFilteredResult(_0x1643af,_0xd39d72){return function(_0x1c12e8){if(_0x1c12e8){var _0x3b4bf8=_0x1c12e8[_0x34bd('0x1d')],_0x72b197=_0xd39d72[_0x34bd('0x1e')],_0x4b5ebb=_0xd39d72[_0x34bd('0x1e')]+_0xd39d72[_0x34bd('0x1f')],_0x48d2ba;if(_0x4b5ebb>=_0x3b4bf8){_0x4b5ebb=_0x3b4bf8;_0x48d2ba=0xc8;}else{_0x48d2ba=0xce;}_0x1643af[_0x34bd('0x1b')](_0x48d2ba);return _0x1643af[_0x34bd('0x20')](_0x34bd('0x21'),_0x72b197+'-'+_0x4b5ebb+'/'+_0x3b4bf8)[_0x34bd('0x1c')](_0x1c12e8);}return null;};}function patchUpdates(_0x130bd0){return function(_0x55538e){try{jsonpatch[_0x34bd('0x22')](_0x55538e,_0x130bd0,!![]);}catch(_0xe02cc5){return BPromise[_0x34bd('0x23')](_0xe02cc5);}return _0x55538e[_0x34bd('0x24')]();};}function saveUpdates(_0x463224,_0x5e0c06){return function(_0x582772){if(_0x582772){return _0x582772['update'](_0x463224)['then'](function(_0x3dafe8){return _0x3dafe8;});}return null;};}function removeEntity(_0x503a60,_0x10fc4b){return function(_0x1c2282){if(_0x1c2282){return _0x1c2282[_0x34bd('0x25')]()['then'](function(){_0x503a60[_0x34bd('0x1b')](0xcc)[_0x34bd('0x26')]();});}};}function handleEntityNotFound(_0x4f0dff,_0x457006){return function(_0x5be702){if(!_0x5be702){_0x4f0dff[_0x34bd('0x1a')](0x194);}return _0x5be702;};}function handleError(_0xb256e8,_0x264c94){_0x264c94=_0x264c94||0x1f4;return function(_0x3e4dc3){logger['error'](_0x3e4dc3[_0x34bd('0x27')]);if(_0x3e4dc3[_0x34bd('0x28')]){delete _0x3e4dc3['name'];}_0xb256e8[_0x34bd('0x1b')](_0x264c94)[_0x34bd('0x29')](_0x3e4dc3);};}function getInteractionUsers(_0x16581f,_0x3f675c){return new BPromise(function(_0x26b8e7,_0x4500c8){try{if(_0x3f675c[_0x16581f['id']]){_0x16581f[_0x34bd('0x2a')]=_['map'](_0x3f675c[_0x16581f['id']],function(_0x43b92d){return{'id':_0x43b92d['id'],'fullname':_0x43b92d[_0x34bd('0x2b')]};});}}catch(_0x56d3b9){_0x4500c8(_0x56d3b9);}_0x26b8e7(_0x16581f);});}function getInteractionTags(_0x5d1662,_0x38bdba){return new BPromise(function(_0xca9897,_0xd176f7){try{if(_0x5d1662['TagIds']){_0x5d1662['Tags']=[];_0x5d1662[_0x34bd('0x2c')][_0x34bd('0x2d')](',')[_0x34bd('0x2e')](function(_0x19eb5d){_0x5d1662['Tags'][_0x34bd('0x2f')](_0x38bdba[_0x19eb5d]);});}delete _0x5d1662[_0x34bd('0x2c')];}catch(_0x41ca58){_0xd176f7(_0x41ca58);}_0xca9897(_0x5d1662);});}function updateSmsInteraction(_0x17296b,_0x2ef58f,_0x375cc7){return new BPromise(function(_0x4ae886,_0x72bb10){return getInteractionUsers(_0x17296b,_0x375cc7)['then'](function(_0xadfa97){return getInteractionTags(_0xadfa97,_0x2ef58f);})[_0x34bd('0x30')](function(_0xf12ee6){_0x4ae886(_0xf12ee6);})['catch'](function(_0x2ff72e){_0x72bb10(_0x2ff72e);});});}exports[_0x34bd('0x31')]=function(_0x497774,_0x3c5e1d){var _0x21c7d6={},_0x2b81ca={},_0x4d0a02={'count':0x0,'rows':[]};var _0x1574c8=_[_0x34bd('0x32')](db['SmsInteraction'][_0x34bd('0x33')],function(_0x41c377){return{'name':_0x41c377[_0x34bd('0x34')],'type':_0x41c377[_0x34bd('0x35')][_0x34bd('0x36')]};});_0x2b81ca[_0x34bd('0x37')]=_['map'](_0x1574c8,'name');_0x2b81ca['query']=_[_0x34bd('0x38')](_0x497774[_0x34bd('0x39')]);_0x2b81ca['filters']=_['intersection'](_0x2b81ca[_0x34bd('0x37')],_0x2b81ca['query']);_0x21c7d6['attributes']=_[_0x34bd('0x3a')](_0x2b81ca[_0x34bd('0x37')],qs[_0x34bd('0x3b')](_0x497774[_0x34bd('0x39')][_0x34bd('0x3b')]));_0x21c7d6['attributes']=_0x21c7d6['attributes'][_0x34bd('0x3c')]?_0x21c7d6['attributes']:_0x2b81ca[_0x34bd('0x37')];if(!_0x497774[_0x34bd('0x39')][_0x34bd('0x3d')](_0x34bd('0x3e'))){_0x21c7d6[_0x34bd('0x1f')]=qs['limit'](_0x497774[_0x34bd('0x39')][_0x34bd('0x1f')]);_0x21c7d6[_0x34bd('0x1e')]=qs[_0x34bd('0x1e')](_0x497774['query'][_0x34bd('0x1e')]);}_0x21c7d6['order']=qs[_0x34bd('0x3f')](_0x497774[_0x34bd('0x39')]['sort']);_0x21c7d6[_0x34bd('0x40')]=qs['filters'](_[_0x34bd('0x41')](_0x497774[_0x34bd('0x39')],_0x2b81ca[_0x34bd('0x42')]));var _0x42a424=[];var _0x26d73e=squel[_0x34bd('0x43')]()[_0x34bd('0x44')]('id')['field']('name')['field'](_0x34bd('0x45'))[_0x34bd('0x46')](_0x34bd('0x47'));var _0x787f74=squel['select']()[_0x34bd('0x44')](_0x34bd('0x48'))[_0x34bd('0x44')](_0x34bd('0x49'))[_0x34bd('0x44')]('ui.SmsInteractionId')[_0x34bd('0x46')]('user_has_sms_interactions','ui')['left_join'](_0x34bd('0x4a'),'u','u.id\x20=\x20ui.UserId');var _0x8474fb=squel[_0x34bd('0x43')]()[_0x34bd('0x46')](_0x34bd('0x4b'),'i')[_0x34bd('0x4c')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x34bd('0x4c')]('users','o',_0x34bd('0x4d'))[_0x34bd('0x4c')](_0x34bd('0x4e'),'a','a.id\x20=\x20i.SmsAccountId')['left_join']('sms_messages','me','me.SmsInteractionId\x20=\x20i.id')[_0x34bd('0x4c')]('sms_interaction_has_tags','it',_0x34bd('0x4f'))['left_join'](_0x34bd('0x47'),'t',_0x34bd('0x50'));var _0x1fa341=squel[_0x34bd('0x51')]();var _0x2da5c5=[];var _0x5273b1=squel[_0x34bd('0x51')]();var _0x162229;if(_0x497774[_0x34bd('0x39')][_0x34bd('0x52')]){_0x162229=as[_0x34bd('0x53')](_0x497774['query'][_0x34bd('0x52')]);var _0x3bfd9d=_0x162229['sqlOperator'];for(var _0x1fc735=0x0;_0x1fc735<_0x162229[_0x34bd('0x54')]['length'];_0x1fc735++){var _0x561d77=_0x162229[_0x34bd('0x54')][_0x1fc735];var _0x4e9d52='i';var _0x499642=_[_0x34bd('0x55')](_0x1574c8,[_0x34bd('0x28'),_0x561d77['field']]);if(!_0x499642){switch(_0x561d77['field']){case'unreadMessages':if(_0x561d77['value']==0x1){_0x8474fb[_0x34bd('0x56')]('`'+_0x561d77[_0x34bd('0x44')]+'`\x20=\x200');}else{_0x8474fb['having']('`'+_0x561d77['field']+_0x34bd('0x57'));}break;case _0x34bd('0x58'):if(_0x561d77['operator']===_0x34bd('0x59')){if(_0x561d77[_0x34bd('0x5a')][_0x34bd('0x2d')]('\x20')[_0x34bd('0x3c')]>0x1){_0x1fa341[_0x3bfd9d](_0x34bd('0x5b'),qs[_0x34bd('0x5c')](_0x561d77['value']),null);}else{var _0x3241e1='%'+_0x561d77[_0x34bd('0x5a')]+'%';_0x1fa341[_0x3bfd9d](_0x34bd('0x5d'),_0x3241e1,_0x3241e1,_0x3241e1);}}else{_0x499642=_[_0x34bd('0x55')](_0x1574c8,['name',_0x34bd('0x5e')]);_0x561d77['field']=_0x34bd('0x5e');_0x5d4833=as['buildExpression'](_0x4e9d52,_0x499642[_0x34bd('0x35')],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);}break;case _0x34bd('0x61'):var _0x28394c=_0x561d77[_0x34bd('0x5a')][_0x34bd('0x2d')](',')[_0x34bd('0x32')](function(_0x5ddb03){return Number(_0x5ddb03);});_0x28394c[_0x34bd('0x2e')](function(_0x55f72e){_0x5273b1['or'](_0x34bd('0x62'),'%,'+_0x55f72e+',%');});_0x2da5c5=_['union'](_0x2da5c5,_0x28394c);break;case _0x34bd('0x63'):if(_0x561d77['operator']===_0x34bd('0x59')){_0x1fa341[_0x3bfd9d](_0x34bd('0x64'),'%'+_0x561d77[_0x34bd('0x5a')]+'%',null);}else{_0x499642=_[_0x34bd('0x55')](_0x1574c8,[_0x34bd('0x28'),_0x34bd('0x65')]);_0x561d77[_0x34bd('0x44')]=_0x34bd('0x65');_0x5d4833=as[_0x34bd('0x66')](_0x4e9d52,_0x499642[_0x34bd('0x35')],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);}break;case'body':_0x5d4833=as['buildExpression']('me',null,_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833[_0x34bd('0x5f')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x26')]);break;}}else{var _0x5d4833=as['buildExpression'](_0x4e9d52,_0x499642['type'],_0x561d77);_0x1fa341[_0x3bfd9d](_0x5d4833['text'],_0x5d4833[_0x34bd('0x5a')][_0x34bd('0x60')],_0x5d4833['value'][_0x34bd('0x26')]);}}}else{var _0xfa0814=_(_0x497774[_0x34bd('0x39')])['keys']()[_0x34bd('0x32')](function(_0x341273){return _[_0x34bd('0x67')](_0x1574c8,[_0x34bd('0x28'),_0x341273])?_0x341273:undefined;})[_0x34bd('0x68')]()[_0x34bd('0x5a')]();if(!_[_0x34bd('0x69')](_0xfa0814)){_0xfa0814[_0x34bd('0x2e')](function(_0x57fc2b){if(_0x57fc2b==='SmsAccountId'){_0x8474fb[_0x34bd('0x40')]('i.SmsAccountId\x20IN\x20?',[][_0x34bd('0x6a')](_0x497774[_0x34bd('0x39')][_0x57fc2b]));}else if(_0x57fc2b===_0x34bd('0x6b')){var _0x58a6eb=JSON['parse'](_0x497774[_0x34bd('0x39')][_0x57fc2b])[_0x34bd('0x6c')];var _0x3c2e61=JSON['parse'](_0x497774['query'][_0x57fc2b])[_0x34bd('0x6d')];_0x8474fb[_0x34bd('0x40')](_0x34bd('0x6e'),_0x58a6eb,_0x3c2e61);}else{if(_0x497774[_0x34bd('0x39')][_0x57fc2b]===_0x34bd('0x6f')){_0x8474fb[_0x34bd('0x40')]('i.'+_0x57fc2b+_0x34bd('0x70'));}else{_0x8474fb[_0x34bd('0x40')]('i.'+_0x57fc2b+_0x34bd('0x71'),_0x497774['query'][_0x57fc2b]);}}});}if(_0x497774['query'][_0x34bd('0x72')]){if(_0x497774['query'][_0x34bd('0x72')]==0x1){_0x8474fb[_0x34bd('0x56')](_0x34bd('0x73'));}else{_0x8474fb[_0x34bd('0x56')]('`unreadMessages`\x20>\x200');}}if(_0x497774['query'][_0x34bd('0x74')]){_0x2da5c5=_[_0x34bd('0x75')](_0x497774[_0x34bd('0x39')]['tag'])?_0x497774[_0x34bd('0x39')]['tag']:new Array(_0x497774[_0x34bd('0x39')][_0x34bd('0x74')]);_0x2da5c5[_0x34bd('0x2e')](function(_0x55876d){_0x5273b1['or'](_0x34bd('0x62'),'%,'+_0x55876d+',%');});}if(_0x497774['query']['filter']){var _0x3cf4c3=_0x497774[_0x34bd('0x39')][_0x34bd('0x76')]['replace']('\x5c','\x5c\x5c')[_0x34bd('0x77')]('\x27\x27',_0x34bd('0x78'));if(qs[_0x34bd('0x79')](_0x3cf4c3)){_0x1fa341['or']('i.id\x20LIKE\x20?',_0x3cf4c3+'%')['or'](_0x34bd('0x7a'),_0x3cf4c3+'%');}else{_0x1fa341['or'](_0x34bd('0x7b'),qs[_0x34bd('0x5c')](_0x3cf4c3))['or'](_0x34bd('0x7c'),_0x3cf4c3+'%');}}}_0x8474fb[_0x34bd('0x40')](_0x1fa341);_0x8474fb[_0x34bd('0x7d')](_0x34bd('0x7e'));var _0x2297f6={'type':db[_0x34bd('0x7f')][_0x34bd('0x80')][_0x34bd('0x81')],'raw':!![]};var _0x59e377=_0x8474fb[_0x34bd('0x82')]();_0x59e377['field'](_0x34bd('0x7e'));_0x59e377['field'](_0x34bd('0x83'),_0x34bd('0x84'));if(_0x21c7d6[_0x34bd('0x85')]){_0x21c7d6[_0x34bd('0x85')][_0x34bd('0x2e')](function(_0x4556ce){_0x8474fb[_0x34bd('0x85')]('i.'+_0x4556ce[0x0],_0x4556ce[0x1]===_0x34bd('0x86')?![]:!![]);});}if(!_[_0x34bd('0x69')](_0x2da5c5)){_0x8474fb[_0x34bd('0x56')](_0x5273b1);_0x59e377['where']('t.id\x20IN\x20?',_0x2da5c5);}BPromise[_0x34bd('0x87')]()[_0x34bd('0x30')](function(){if(!_0x162229){if(_0x497774[_0x34bd('0x39')]['SmsAccountId']||_0x497774['query']['journey'])return;_0x59e377[_0x34bd('0x40')](_0x34bd('0x88'));_0x8474fb[_0x34bd('0x40')](_0x34bd('0x88'));return;}return _0x497774[_0x34bd('0x89')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x34bd('0x30')](function(_0x4d94d0){if(_[_0x34bd('0x69')](_0x4d94d0)){_0x59e377[_0x34bd('0x40')]('i.SmsAccountId\x20IS\x20NULL');_0x8474fb[_0x34bd('0x40')]('i.SmsAccountId\x20IS\x20NULL');}else{_0x59e377[_0x34bd('0x40')]('i.SmsAccountId\x20IN\x20?',_[_0x34bd('0x32')](_0x4d94d0,'id'));_0x8474fb['where'](_0x34bd('0x8a'),_[_0x34bd('0x32')](_0x4d94d0,'id'));}});})[_0x34bd('0x30')](function(){db[_0x34bd('0x8b')][_0x34bd('0x39')](_0x59e377[_0x34bd('0x8c')](),_0x2297f6)[_0x34bd('0x30')](function(_0x24a745){_0x4d0a02['count']=_0x24a745[_0x34bd('0x3c')];if(_0x4d0a02[_0x34bd('0x1d')]===0x0)return[];return db[_0x34bd('0x8b')]['query'](_0x26d73e['toString'](),_0x2297f6)['then'](function(_0x2f1299){_0x42a424=_[_0x34bd('0x8d')](_0x2f1299,'id');_0x2297f6=_['merge'](_0x2297f6,{'model':db[_0x34bd('0x8e')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x497774['query'][_0x34bd('0x3b')]){_0x21c7d6[_0x34bd('0x8f')][_0x34bd('0x2e')](function(_0x4c6508){_0x8474fb[_0x34bd('0x44')]('i.'+_0x4c6508);});}else{_0x8474fb['field'](_0x34bd('0x83'),_0x34bd('0x84'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x90'),_0x34bd('0x91'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x92'),_0x34bd('0x93'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x94'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x95'),_0x34bd('0x96'));_0x8474fb[_0x34bd('0x44')]('c.lastName',_0x34bd('0x97'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x98'),_0x34bd('0x99'));_0x8474fb[_0x34bd('0x44')]('c.phone',_0x34bd('0x9a'));_0x8474fb[_0x34bd('0x44')](_0x34bd('0x9b'),_0x34bd('0x9c'));_0x8474fb['field'](_0x34bd('0x9d'),'Contact.fax');_0x8474fb['field']('o.fullname','Owner.fullname');_0x8474fb[_0x34bd('0x44')](_0x34bd('0x9e'),_0x34bd('0x9f'));_0x8474fb['field'](_0x34bd('0xa0'),_0x34bd('0x2c'));}_0x8474fb[_0x34bd('0x1f')](_0x21c7d6[_0x34bd('0x1f')]);_0x8474fb[_0x34bd('0x1e')](_0x21c7d6[_0x34bd('0x1e')]);return db[_0x34bd('0x8b')][_0x34bd('0x39')](_0x8474fb[_0x34bd('0x8c')](),_0x2297f6);})[_0x34bd('0x30')](function(_0x4451ef){_0x787f74['where']('ui.SmsInteractionId\x20IN\x20?',_[_0x34bd('0x32')](_0x4451ef,'id'));return db['sequelize'][_0x34bd('0x39')](_0x787f74[_0x34bd('0x8c')](),_0x2297f6)[_0x34bd('0x30')](function(_0x9f4df7){var _0x22aa49=_[_0x34bd('0xa1')](_0x9f4df7,_0x34bd('0xa2'));var _0xf45fee=[];_0x4451ef['forEach'](function(_0x8d35a9){_0xf45fee[_0x34bd('0x2f')](updateSmsInteraction(_0x8d35a9,_0x42a424,_0x22aa49));});return BPromise[_0x34bd('0xa3')](_0xf45fee);});});})['then'](function(_0x2b56eb){_0x4d0a02[_0x34bd('0xa4')]=_0x2b56eb;return _0x4d0a02;})[_0x34bd('0x30')](respondWithFilteredResult(_0x3c5e1d,_0x21c7d6));})[_0x34bd('0xa5')](handleError(_0x3c5e1d,null));};exports['show']=function(_0x429609,_0x3fe460){var _0x246fb3={'raw':![],'where':{'id':_0x429609[_0x34bd('0xa6')]['id']}},_0x5f2e77={};_0x5f2e77[_0x34bd('0x37')]=_[_0x34bd('0x38')](db[_0x34bd('0x8e')][_0x34bd('0x33')]);_0x5f2e77[_0x34bd('0x39')]=_['keys'](_0x429609[_0x34bd('0x39')]);_0x5f2e77[_0x34bd('0x42')]=_[_0x34bd('0x3a')](_0x5f2e77[_0x34bd('0x37')],_0x5f2e77[_0x34bd('0x39')]);_0x246fb3[_0x34bd('0x8f')]=_[_0x34bd('0x3a')](_0x5f2e77[_0x34bd('0x37')],qs[_0x34bd('0x3b')](_0x429609[_0x34bd('0x39')][_0x34bd('0x3b')]));_0x246fb3[_0x34bd('0x8f')]=_0x246fb3[_0x34bd('0x8f')][_0x34bd('0x3c')]?_0x246fb3['attributes']:_0x5f2e77[_0x34bd('0x37')];if(_0x429609['query'][_0x34bd('0xa7')]){_0x246fb3[_0x34bd('0xa8')]=[{'all':!![]}];}_0x246fb3=_[_0x34bd('0xa9')]({},_0x246fb3,_0x429609[_0x34bd('0xaa')]);return db[_0x34bd('0x8e')][_0x34bd('0x55')](_0x246fb3)[_0x34bd('0x30')](handleEntityNotFound(_0x3fe460,null))[_0x34bd('0x30')](respondWithResult(_0x3fe460,null))['catch'](handleError(_0x3fe460,null));};exports[_0x34bd('0xab')]=function(_0x10463f,_0x3efd93){return db['SmsInteraction'][_0x34bd('0xab')](_0x10463f[_0x34bd('0xac')],{})[_0x34bd('0x30')](respondWithResult(_0x3efd93,0xc9))[_0x34bd('0xa5')](handleError(_0x3efd93,null));};exports['update']=function(_0xa2e88f,_0x48acaa){if(_0xa2e88f[_0x34bd('0xac')]['id']){delete _0xa2e88f[_0x34bd('0xac')]['id'];}return db[_0x34bd('0x8e')]['find']({'where':{'id':_0xa2e88f[_0x34bd('0xa6')]['id']}})['then'](handleEntityNotFound(_0x48acaa,null))['then'](saveUpdates(_0xa2e88f[_0x34bd('0xac')],null))[_0x34bd('0x30')](respondWithResult(_0x48acaa,null))[_0x34bd('0xa5')](handleError(_0x48acaa,null));};exports['destroy']=function(_0x20cc16,_0x5cea3e){return db[_0x34bd('0x8e')][_0x34bd('0x55')]({'where':{'id':_0x20cc16['params']['id']}})['then'](handleEntityNotFound(_0x5cea3e,null))['then'](removeEntity(_0x5cea3e,null))[_0x34bd('0xa5')](handleError(_0x5cea3e,null));};exports[_0x34bd('0xad')]=function(_0x563e11,_0x476c1f){return db['SmsInteraction'][_0x34bd('0xad')]()[_0x34bd('0x30')](respondWithResult(_0x476c1f,null))[_0x34bd('0xa5')](handleError(_0x476c1f,null));};exports[_0x34bd('0xae')]=function(_0x3045c7,_0x459be1,_0x239e74){return db[_0x34bd('0xaf')]['find']({'where':{'id':_0x3045c7[_0x34bd('0xa6')]['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x459be1,null))[_0x34bd('0x30')](function(_0x2e9d66){if(_0x2e9d66){return _0x2e9d66[_0x34bd('0xae')](_0x3045c7[_0x34bd('0xac')][_0x34bd('0xb0')],_[_0x34bd('0xb1')](_0x3045c7[_0x34bd('0xac')],[_0x34bd('0xb0'),'id'])||{});}})['then'](respondWithResult(_0x459be1,null))[_0x34bd('0xa5')](handleError(_0x459be1,null));};exports['getMessages']=function(_0x53deea,_0x36eb45,_0x4490b3){var _0x1b8318={'raw':![],'where':{}};var _0x19671c={};var _0x49c4e6={'count':0x0,'rows':[]};return db[_0x34bd('0x8e')][_0x34bd('0xb2')]({'where':{'id':_0x53deea[_0x34bd('0xa6')]['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x36eb45,null))['then'](function(_0x5d0e56){if(_0x5d0e56){_0x19671c[_0x34bd('0x37')]=_[_0x34bd('0x38')](db['SmsMessage'][_0x34bd('0x33')]);_0x19671c[_0x34bd('0x39')]=_['keys'](_0x53deea[_0x34bd('0x39')]);_0x19671c[_0x34bd('0x42')]=_[_0x34bd('0x3a')](_0x19671c[_0x34bd('0x37')],_0x19671c[_0x34bd('0x39')]);_0x1b8318[_0x34bd('0x8f')]=_[_0x34bd('0x3a')](_0x19671c[_0x34bd('0x37')],qs['fields'](_0x53deea['query'][_0x34bd('0x3b')]));_0x1b8318[_0x34bd('0x8f')]=_0x1b8318[_0x34bd('0x8f')][_0x34bd('0x3c')]?_0x1b8318[_0x34bd('0x8f')]:_0x19671c['model'];if(!_0x53deea[_0x34bd('0x39')]['hasOwnProperty'](_0x34bd('0x3e'))){_0x1b8318[_0x34bd('0x1f')]=qs[_0x34bd('0x1f')](_0x53deea[_0x34bd('0x39')][_0x34bd('0x1f')]);_0x1b8318[_0x34bd('0x1e')]=qs['offset'](_0x53deea['query'][_0x34bd('0x1e')]);}_0x1b8318[_0x34bd('0x85')]=qs[_0x34bd('0x3f')](_0x53deea[_0x34bd('0x39')]['sort']);_0x1b8318[_0x34bd('0x40')]=qs[_0x34bd('0x42')](_[_0x34bd('0x41')](_0x53deea[_0x34bd('0x39')],_0x19671c[_0x34bd('0x42')]));_0x1b8318[_0x34bd('0x40')][_0x34bd('0xa2')]=_0x5d0e56['id'];if(_0x53deea['query']['filter']){_0x1b8318[_0x34bd('0x40')]=_['merge'](_0x1b8318[_0x34bd('0x40')],{'$or':_[_0x34bd('0x32')](_0x1b8318['attributes'],function(_0x25e21d){var _0xf55e5f={};_0xf55e5f[_0x25e21d]={'$like':'%'+_0x53deea['query'][_0x34bd('0x76')]+'%'};return _0xf55e5f;})});}if(_0x53deea[_0x34bd('0x39')]['$gte']){var _0x5b76a8=_0x53deea[_0x34bd('0x39')]['$gte'][_0x34bd('0x2d')](',');var _0x7a7cc7={};_0x7a7cc7[_0x5b76a8[0x0]]={'$gte':moment(_0x5b76a8[0x1])[_0x34bd('0xb3')](_0x34bd('0xb4'))};_0x1b8318[_0x34bd('0x40')]=_[_0x34bd('0xa9')](_0x1b8318[_0x34bd('0x40')],_0x7a7cc7);}_0x1b8318=_[_0x34bd('0xa9')]({},_0x1b8318,_0x53deea[_0x34bd('0xaa')]);return db[_0x34bd('0xaf')]['count']({'where':_0x1b8318[_0x34bd('0x40')]})[_0x34bd('0x30')](function(_0x47d136){_0x49c4e6[_0x34bd('0x1d')]=_0x47d136;if(_0x53deea[_0x34bd('0x39')][_0x34bd('0xa7')]){_0x1b8318['include']=[{'all':!![]}];}return db[_0x34bd('0xaf')][_0x34bd('0xb5')](_0x1b8318);})['then'](function(_0x5dedd4){_0x49c4e6[_0x34bd('0xa4')]=_0x5dedd4;return _0x49c4e6;});}})[_0x34bd('0x30')](respondWithFilteredResult(_0x36eb45,_0x1b8318))[_0x34bd('0xa5')](handleError(_0x36eb45,null));};exports['addTags']=function(_0x3d0ade,_0x43cf22,_0x1d7da8){return db[_0x34bd('0x8e')][_0x34bd('0x55')]({'where':{'id':_0x3d0ade['params']['id']}})['then'](handleEntityNotFound(_0x43cf22,null))[_0x34bd('0x30')](function(_0x2ac369){if(_0x2ac369){return _0x2ac369[_0x34bd('0xb6')](_0x3d0ade[_0x34bd('0xac')][_0x34bd('0xb0')],_['omit'](_0x3d0ade['body'],[_0x34bd('0xb0'),'id'])||{})[_0x34bd('0xb7')](function(){return db[_0x34bd('0x61')][_0x34bd('0xb5')]({'attributes':['id',_0x34bd('0x28'),_0x34bd('0x45')],'where':{'id':_0x3d0ade[_0x34bd('0xac')][_0x34bd('0xb0')]}});})[_0x34bd('0x30')](function(_0x5eec5b){socket[_0x34bd('0xb8')](_0x34bd('0xb9'),{'id':Number(_0x3d0ade['params']['id']),'tags':_0x5eec5b||[]});return{'id':Number(_0x3d0ade[_0x34bd('0xa6')]['id']),'tags':_0x5eec5b||[]};});}})[_0x34bd('0x30')](respondWithResult(_0x43cf22,null))[_0x34bd('0xa5')](handleError(_0x43cf22,null));};exports[_0x34bd('0xba')]=function(_0x4f9b3e,_0x3c40f2,_0x223165){return db['SmsInteraction'][_0x34bd('0x55')]({'where':{'id':_0x4f9b3e['params']['id']}})[_0x34bd('0x30')](handleEntityNotFound(_0x3c40f2,null))[_0x34bd('0x30')](function(_0x571612){if(_0x571612){return _0x571612[_0x34bd('0xba')](_0x4f9b3e[_0x34bd('0x39')]['ids']);}})[_0x34bd('0x30')](respondWithStatusCode(_0x3c40f2,null))[_0x34bd('0xa5')](handleError(_0x3c40f2,null));};exports[_0x34bd('0xbb')]=function(_0x57b59c,_0x415980){var _0x285c64=moment()[_0x34bd('0xbc')]()[_0x34bd('0x8c')]();var _0x24e21c=path[_0x34bd('0xbd')](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xc0'),_0x34bd('0xc1'));var _0x4df088=path['join'](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xc0'),_0x34bd('0xc2'));var _0x321218=path[_0x34bd('0xbd')](_0x24e21c,_0x285c64);var _0x51245a=util[_0x34bd('0xb3')](_0x34bd('0xc3'),_0x57b59c['params']['id'],_0x285c64);var _0x1d71a9=path[_0x34bd('0xbd')](_0x24e21c,_0x51245a);var _0x2caf8d=[];_0x2caf8d[_0x34bd('0x2f')]({'model':db[_0x34bd('0x63')],'as':_0x34bd('0x63'),'attributes':['id',_0x34bd('0x2b')],'raw':!![]});_0x2caf8d[_0x34bd('0x2f')]({'model':db[_0x34bd('0xc4')],'as':_0x34bd('0x58'),'attributes':['id',_0x34bd('0xc5'),'lastName'],'raw':!![]});var _0x1804cc=[{'model':db[_0x34bd('0xaf')],'as':_0x34bd('0xc6'),'attributes':['id',_0x34bd('0xac'),_0x34bd('0x6b'),'direction',_0x34bd('0xc7'),'read'],'include':_0x2caf8d}];_0x1804cc[_0x34bd('0x2f')]({'model':db[_0x34bd('0xc8')],'as':_0x34bd('0xc9'),'attributes':['id',_0x34bd('0x28')]});_0x1804cc[_0x34bd('0x2f')]({'model':db[_0x34bd('0x63')],'as':_0x34bd('0xca'),'attributes':['id',_0x34bd('0x2b')]});return db[_0x34bd('0x8e')]['find']({'where':{'id':_0x57b59c[_0x34bd('0xa6')]['id']},'include':_0x1804cc})[_0x34bd('0x30')](handleEntityNotFound(_0x415980,null))['then'](function(_0xcdc6a8){if(_0xcdc6a8){var _0x421b39=_0xcdc6a8[_0x34bd('0xcb')]({'plain':!![]});fs[_0x34bd('0xcc')](_0x321218);var _0x1cc454={'format':'A4','border':_0x34bd('0xcd'),'header':{'height':'40px','contents':{'first':_0x34bd('0xce')}},'footer':{'height':_0x34bd('0xcf'),'contents':{'default':util[_0x34bd('0xb3')](_0x34bd('0xd0'),util[_0x34bd('0xb3')](_0x34bd('0xd1'),_0x34bd('0xd2'),_0x421b39['id']),moment()[_0x34bd('0xb3')](_0x34bd('0xd3'))[_0x34bd('0x8c')]())}}};var _0x2ee173={'channel':_0x34bd('0xd2'),'account':_0x421b39[_0x34bd('0xc9')]['name'],'agent':_0x421b39[_0x34bd('0xca')]?_0x421b39[_0x34bd('0xca')][_0x34bd('0x2b')]:_0x34bd('0xd4'),'createdAt':moment(_0x421b39['createdAt'])[_0x34bd('0xb3')](_0x34bd('0xb4'))[_0x34bd('0x8c')](),'closedAt':_0x421b39[_0x34bd('0xd5')]?moment(_0x421b39['closedAt'])[_0x34bd('0xb3')](_0x34bd('0xb4'))[_0x34bd('0x8c')]():'','disposition':_0x421b39[_0x34bd('0xd6')],'messages':_(_0x421b39[_0x34bd('0xc6')])[_0x34bd('0x76')]({'secret':![]})[_0x34bd('0x32')](function(_0x12ef1c){return{'date':moment(_0x12ef1c[_0x34bd('0x6b')])[_0x34bd('0xb3')]('YYYY-MM-DD\x20HH:mm:ss')[_0x34bd('0x8c')](),'sender':_0x12ef1c[_0x34bd('0xd7')]===_0x34bd('0xd8')?_0x12ef1c['User']?_0x12ef1c[_0x34bd('0x63')][_0x34bd('0x2b')]:'System':_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xc5')]+(_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xd9')]?'\x20'+_0x12ef1c[_0x34bd('0x58')][_0x34bd('0xd9')]:''),'body':_0x12ef1c[_0x34bd('0xac')],'direction':_0x12ef1c[_0x34bd('0xd7')]===_0x34bd('0xd8')?'A':'C','secret':_0x12ef1c['secret'],'read':_0x12ef1c[_0x34bd('0x72')]};})['value']()};return ejs[_0x34bd('0xda')](path[_0x34bd('0xbd')](config[_0x34bd('0xbe')],_0x34bd('0xbf'),_0x34bd('0xdb'),_0x34bd('0xdc')),{'interaction':_0x2ee173})[_0x34bd('0x30')](function(_0x5c0f31){return new BPromise(function(_0x58415b,_0x5ba1f4){pdf[_0x34bd('0xab')](_0x5c0f31,_0x1cc454)[_0x34bd('0xdd')](path[_0x34bd('0xbd')](_0x321218,_0x34bd('0xde')+_0x421b39['id']+'-'+_0x285c64+'.pdf'),function(_0x26a737,_0x4307ae){if(_0x26a737)return _0x5ba1f4(_0x26a737);_0x58415b(_0x4307ae);});});})[_0x34bd('0x30')](function(){return new BPromise(function(_0x3bea8f,_0x1d2dac){zipdir(_0x321218,{'saveTo':_0x1d71a9},function(_0xebc491,_0x314c92){if(_0xebc491)return _0x1d2dac(_0xebc491);return _0x3bea8f(_0x314c92);});})[_0x34bd('0x30')](function(){return new BPromise(function(_0x4c34a4,_0x57bd6c){rimraf(_0x321218,function(_0x84b401){if(_0x84b401)_0x57bd6c(_0x84b401);return _0x4c34a4();});});})[_0x34bd('0x30')](function(){return _0x415980[_0x34bd('0xbb')](_0x1d71a9,_0x51245a,function(_0x195ed6){if(_0x195ed6){console[_0x34bd('0xdf')](_0x34bd('0xe0'),_0x195ed6);}else{fs[_0x34bd('0xe1')](_0x1d71a9);}});});});}else{return _0x415980[_0x34bd('0x1a')](0xc8);}})[_0x34bd('0xa5')](handleError(_0x415980,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index 0ce7a96..77595d6 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 _0xb205=['events','../../mysqldb','SmsInteraction','SmsMessage','update','getUsers','then','setDataValue','Users','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook'];(function(_0x3b2836,_0x258a70){var _0x54e02a=function(_0x1de167){while(--_0x1de167){_0x3b2836['push'](_0x3b2836['shift']());}};_0x54e02a(++_0x258a70);}(_0xb205,0xf0));var _0x5b20=function(_0x78713c,_0x4a5e92){_0x78713c=_0x78713c-0x0;var _0x2b9d2d=_0xb205[_0x78713c];return _0x2b9d2d;};'use strict';var EventEmitter=require(_0x5b20('0x0'));var SmsInteraction=require(_0x5b20('0x1'))['db'][_0x5b20('0x2')];var SmsMessage=require(_0x5b20('0x1'))['db'][_0x5b20('0x3')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':_0x5b20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x17046a){return function(_0x36473a,_0x5a4526,_0x3206cd){_0x36473a[_0x5b20('0x5')]({'attributes':['id'],'raw':!![]})[_0x5b20('0x6')](function(_0x5c1ff9){_0x36473a[_0x5b20('0x7')](_0x5b20('0x8'),_0x5c1ff9['map'](function(_0x4f19b2){return{'id':_0x4f19b2['id']};}));return SmsMessage[_0x5b20('0x9')]({'where':{'SmsInteractionId':_0x36473a['id'],'direction':'in','read':![]},'raw':!![]});})[_0x5b20('0x6')](function(_0x36ef1b){_0x36473a[_0x5b20('0x7')](_0x5b20('0xa'),_0x36ef1b[_0x5b20('0xb')]);SmsInteractionEvents[_0x5b20('0xc')](_0x17046a+':'+_0x36473a['id'],_0x36473a);SmsInteractionEvents['emit'](_0x17046a,_0x36473a);_0x3206cd(null);})[_0x5b20('0xd')](_0x3206cd(null));};}for(var e in events){if(events[_0x5b20('0xe')](e)){var event=events[e];SmsInteraction[_0x5b20('0xf')](e,emitEvent(event));}}module['exports']=SmsInteractionEvents; \ No newline at end of file +var _0x032e=['catch','hasOwnProperty','hook','exports','events','SmsInteraction','../../mysqldb','save','update','remove','getUsers','then','setDataValue','Users','map','findAll','length','emit'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x032e,0x124));var _0xe032=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x032e[_0x134c2e];return _0x2825db;};'use strict';var EventEmitter=require(_0xe032('0x0'));var SmsInteraction=require('../../mysqldb')['db'][_0xe032('0x1')];var SmsMessage=require(_0xe032('0x2'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe032('0x3'),'afterUpdate':_0xe032('0x4'),'afterDestroy':_0xe032('0x5')};function emitEvent(_0x1983cc){return function(_0x306f3d,_0x420020,_0x2ba8a0){_0x306f3d[_0xe032('0x6')]({'attributes':['id'],'raw':!![]})[_0xe032('0x7')](function(_0x1576c8){_0x306f3d[_0xe032('0x8')](_0xe032('0x9'),_0x1576c8[_0xe032('0xa')](function(_0x3b0ef8){return{'id':_0x3b0ef8['id']};}));return SmsMessage[_0xe032('0xb')]({'where':{'SmsInteractionId':_0x306f3d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xe032('0x7')](function(_0x2dc9e5){_0x306f3d[_0xe032('0x8')]('unreadMessages',_0x2dc9e5[_0xe032('0xc')]);SmsInteractionEvents[_0xe032('0xd')](_0x1983cc+':'+_0x306f3d['id'],_0x306f3d);SmsInteractionEvents[_0xe032('0xd')](_0x1983cc,_0x306f3d);_0x2ba8a0(null);})[_0xe032('0xe')](_0x2ba8a0(null));};}for(var e in events){if(events[_0xe032('0xf')](e)){var event=events[e];SmsInteraction[_0xe032('0x10')](e,emitEvent(event));}}module[_0xe032('0x11')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index db0bd1f..ac09171 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 _0xb13f=['changed','closed','format','YYYY-MM-DD\x20HH:mm:ss','../../config/logger','moment','bluebird','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction'];(function(_0x4a29f1,_0x23e312){var _0xe71461=function(_0x552bff){while(--_0x552bff){_0x4a29f1['push'](_0x4a29f1['shift']());}};_0xe71461(++_0x23e312);}(_0xb13f,0x122));var _0xfb13=function(_0x9f89cc,_0x57b8b7){_0x9f89cc=_0x9f89cc-0x0;var _0x5f00fe=_0xb13f[_0x9f89cc];return _0x5f00fe;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xfb13('0x0'))('api');var moment=require(_0xfb13('0x1'));var BPromise=require(_0xfb13('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xfb13('0x3'));var attributes=require(_0xfb13('0x4'));module[_0xfb13('0x5')]=function(_0x36cb64,_0x252a8a){return _0x36cb64['define'](_0xfb13('0x6'),attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x493521,_0x2d8eb3,_0x16a719){if(_0x493521[_0xfb13('0x7')](_0xfb13('0x8'))){_0x493521['closedAt']=moment()[_0xfb13('0x9')](_0xfb13('0xa'));}_0x16a719(null,_0x493521);}}});}; \ No newline at end of file +var _0x4b8e=['lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./smsInteraction.attributes','exports','SmsInteraction','sms_interactions','changed','closed'];(function(_0x39183f,_0x92ad86){var _0x2c5db7=function(_0x4fd711){while(--_0x4fd711){_0x39183f['push'](_0x39183f['shift']());}};_0x2c5db7(++_0x92ad86);}(_0x4b8e,0x1a4));var _0xe4b8=function(_0x460e20,_0x3ff2d0){_0x460e20=_0x460e20-0x0;var _0x4088a4=_0x4b8e[_0x460e20];return _0x4088a4;};'use strict';var _=require(_0xe4b8('0x0'));var util=require(_0xe4b8('0x1'));var logger=require(_0xe4b8('0x2'))(_0xe4b8('0x3'));var moment=require(_0xe4b8('0x4'));var BPromise=require('bluebird');var rp=require(_0xe4b8('0x5'));var fs=require('fs');var path=require(_0xe4b8('0x6'));var rimraf=require(_0xe4b8('0x7'));var config=require(_0xe4b8('0x8'));var attributes=require(_0xe4b8('0x9'));module[_0xe4b8('0xa')]=function(_0x1bf241,_0x399720){return _0x1bf241['define'](_0xe4b8('0xb'),attributes,{'tableName':_0xe4b8('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5845ed,_0x5a504b,_0x179218){if(_0x5845ed[_0xe4b8('0xd')](_0xe4b8('0xe'))){_0x5845ed['closedAt']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x179218(null,_0x5845ed);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index 6a641aa..c5cd68f 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 _0x9574=['omit','debug','AddTags','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','socket.io-emitter','register','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','UpdateSmsInteraction','SmsInteraction','options','raw','where','attributes','AddTagsToSmsInteraction','find','addTags','body','ids'];(function(_0x489a3c,_0x114b49){var _0x3488cb=function(_0x6fec70){while(--_0x6fec70){_0x489a3c['push'](_0x489a3c['shift']());}};_0x3488cb(++_0x114b49);}(_0x9574,0x1d7));var _0x4957=function(_0xbdc6a,_0x46e812){_0xbdc6a=_0xbdc6a-0x0;var _0x5079ed=_0x9574[_0xbdc6a];return _0x5079ed;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4957('0x0'));var BPromise=require(_0x4957('0x1'));var rs=require(_0x4957('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4957('0x3'))['db'];var utils=require(_0x4957('0x4'));var logger=require(_0x4957('0x5'))('rpc');var config=require(_0x4957('0x6'));var jayson=require(_0x4957('0x7'));var client=jayson['client'][_0x4957('0x8')]({'port':0x232a});config[_0x4957('0x9')]=_[_0x4957('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4957('0xb'))(new Redis(config[_0x4957('0x9')]));require('./smsInteraction.socket')[_0x4957('0xc')](socket);function respondWithRpcPromise(_0x3a9034,_0x53e2ee,_0x3cb155){return new BPromise(function(_0x26db05,_0x306646){return client['request'](_0x3a9034,_0x3cb155)[_0x4957('0xd')](function(_0x104590){logger[_0x4957('0xe')](_0x4957('0xf'),_0x53e2ee,_0x4957('0x10'));logger['debug']('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x53e2ee,'request\x20sent',JSON[_0x4957('0x11')](_0x104590));if(_0x104590[_0x4957('0x12')]){if(_0x104590[_0x4957('0x12')]['code']===0x1f4){logger['error'](_0x4957('0xf'),_0x53e2ee,_0x104590[_0x4957('0x12')]['message']);return _0x306646(_0x104590[_0x4957('0x12')][_0x4957('0x13')]);}logger[_0x4957('0x12')](_0x4957('0xf'),_0x53e2ee,_0x104590[_0x4957('0x12')][_0x4957('0x13')]);return _0x26db05(_0x104590[_0x4957('0x12')][_0x4957('0x13')]);}else{logger[_0x4957('0xe')](_0x4957('0xf'),_0x53e2ee,_0x4957('0x10'));_0x26db05(_0x104590[_0x4957('0x14')]['message']);}})[_0x4957('0x15')](function(_0x3fadb9){logger[_0x4957('0x12')]('SmsInteraction,\x20%s,\x20%s',_0x53e2ee,_0x3fadb9);_0x306646(_0x3fadb9);});});}exports[_0x4957('0x16')]=function(_0x24e40d){var _0x8bfbf9=this;return new Promise(function(_0x4104b5,_0x1e1fef){return db[_0x4957('0x17')]['update'](_0x24e40d['body'],{'raw':_0x24e40d[_0x4957('0x18')]?_0x24e40d[_0x4957('0x18')][_0x4957('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x24e40d[_0x4957('0x18')]?_0x24e40d[_0x4957('0x18')][_0x4957('0x1a')]||null:null,'attributes':_0x24e40d[_0x4957('0x18')]?_0x24e40d[_0x4957('0x18')][_0x4957('0x1b')]||null:null,'limit':_0x24e40d['options']?_0x24e40d['options']['limit']||null:null})[_0x4957('0xd')](function(_0x5b37e1){logger[_0x4957('0xe')](_0x4957('0x16'),_0x24e40d);logger['debug'](_0x4957('0x16'),_0x24e40d,JSON[_0x4957('0x11')](_0x5b37e1));_0x4104b5(_0x5b37e1);})[_0x4957('0x15')](function(_0x227c65){logger['error'](_0x4957('0x16'),_0x227c65[_0x4957('0x13')],_0x24e40d);_0x1e1fef(_0x8bfbf9[_0x4957('0x12')](0x1f4,_0x227c65['message']));});});};exports[_0x4957('0x1c')]=function(_0x2b083b){return new Promise(function(_0x3944d4,_0x45d8ad){return db[_0x4957('0x17')][_0x4957('0x1d')]({'where':_0x2b083b[_0x4957('0x18')]?_0x2b083b[_0x4957('0x18')][_0x4957('0x1a')]||null:null})['then'](function(_0x5522b2){if(_0x5522b2){return _0x5522b2[_0x4957('0x1e')](_0x2b083b[_0x4957('0x1f')][_0x4957('0x20')],_[_0x4957('0x21')](_0x2b083b[_0x4957('0x1f')],[_0x4957('0x20'),'id'])||{});}})['spread'](function(_0x48d9c8){logger[_0x4957('0xe')]('AddTags',_0x2b083b);logger[_0x4957('0x22')](_0x4957('0x23'),_0x2b083b,JSON['stringify'](_0x48d9c8));_0x3944d4(_0x48d9c8);})[_0x4957('0x15')](function(_0x3d6327){logger[_0x4957('0x12')](_0x4957('0x23'),_0x3d6327['message'],_0x2b083b);_0x45d8ad(_this[_0x4957('0x12')](0x1f4,_0x3d6327[_0x4957('0x13')]));});});}; \ No newline at end of file +var _0xb312=['options','attributes','limit','stringify','AddTagsToSmsInteraction','find','where','addTags','body','ids','omit','AddTags','lodash','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','register','request','then','info','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','SmsInteraction,\x20%s,\x20%s,\x20%s','error','message','catch','UpdateSmsInteraction','SmsInteraction','update'];(function(_0x5b2422,_0x3f13fc){var _0x3aba29=function(_0x1d205a){while(--_0x1d205a){_0x5b2422['push'](_0x5b2422['shift']());}};_0x3aba29(++_0x3f13fc);}(_0xb312,0x81));var _0x2b31=function(_0xbb314b,_0x4f883d){_0xbb314b=_0xbb314b-0x0;var _0x2a53a4=_0xb312[_0xbb314b];return _0x2a53a4;};'use strict';var _=require(_0x2b31('0x0'));var util=require('util');var moment=require(_0x2b31('0x1'));var BPromise=require(_0x2b31('0x2'));var rs=require(_0x2b31('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x2b31('0x4'));var logger=require(_0x2b31('0x5'))(_0x2b31('0x6'));var config=require(_0x2b31('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x2b31('0x8')][_0x2b31('0x9')]({'port':0x232a});config[_0x2b31('0xa')]=_[_0x2b31('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x2b31('0xc'))(new Redis(config['redis']));require('./smsInteraction.socket')[_0x2b31('0xd')](socket);function respondWithRpcPromise(_0x2913f0,_0xa3b246,_0x455d3e){return new BPromise(function(_0x5d844e,_0x3973ba){return client[_0x2b31('0xe')](_0x2913f0,_0x455d3e)[_0x2b31('0xf')](function(_0x2bde6d){logger[_0x2b31('0x10')](_0x2b31('0x11'),_0xa3b246,_0x2b31('0x12'));logger[_0x2b31('0x13')](_0x2b31('0x14'),_0xa3b246,_0x2b31('0x12'),JSON['stringify'](_0x2bde6d));if(_0x2bde6d[_0x2b31('0x15')]){if(_0x2bde6d[_0x2b31('0x15')]['code']===0x1f4){logger[_0x2b31('0x15')](_0x2b31('0x11'),_0xa3b246,_0x2bde6d[_0x2b31('0x15')]['message']);return _0x3973ba(_0x2bde6d[_0x2b31('0x15')]['message']);}logger[_0x2b31('0x15')](_0x2b31('0x11'),_0xa3b246,_0x2bde6d[_0x2b31('0x15')][_0x2b31('0x16')]);return _0x5d844e(_0x2bde6d[_0x2b31('0x15')]['message']);}else{logger[_0x2b31('0x10')](_0x2b31('0x11'),_0xa3b246,_0x2b31('0x12'));_0x5d844e(_0x2bde6d['result'][_0x2b31('0x16')]);}})[_0x2b31('0x17')](function(_0x5a4d13){logger[_0x2b31('0x15')](_0x2b31('0x11'),_0xa3b246,_0x5a4d13);_0x3973ba(_0x5a4d13);});});}exports[_0x2b31('0x18')]=function(_0x47b7d8){var _0x5a1497=this;return new Promise(function(_0x53e67e,_0x4d6b48){return db[_0x2b31('0x19')][_0x2b31('0x1a')](_0x47b7d8['body'],{'raw':_0x47b7d8[_0x2b31('0x1b')]?_0x47b7d8[_0x2b31('0x1b')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x47b7d8[_0x2b31('0x1b')]?_0x47b7d8[_0x2b31('0x1b')]['where']||null:null,'attributes':_0x47b7d8[_0x2b31('0x1b')]?_0x47b7d8[_0x2b31('0x1b')][_0x2b31('0x1c')]||null:null,'limit':_0x47b7d8[_0x2b31('0x1b')]?_0x47b7d8[_0x2b31('0x1b')][_0x2b31('0x1d')]||null:null})[_0x2b31('0xf')](function(_0x4acdad){logger['info'](_0x2b31('0x18'),_0x47b7d8);logger[_0x2b31('0x13')](_0x2b31('0x18'),_0x47b7d8,JSON[_0x2b31('0x1e')](_0x4acdad));_0x53e67e(_0x4acdad);})[_0x2b31('0x17')](function(_0x27de4a){logger[_0x2b31('0x15')](_0x2b31('0x18'),_0x27de4a[_0x2b31('0x16')],_0x47b7d8);_0x4d6b48(_0x5a1497[_0x2b31('0x15')](0x1f4,_0x27de4a[_0x2b31('0x16')]));});});};exports[_0x2b31('0x1f')]=function(_0x4ab98f){return new Promise(function(_0x42b193,_0x12047e){return db[_0x2b31('0x19')][_0x2b31('0x20')]({'where':_0x4ab98f[_0x2b31('0x1b')]?_0x4ab98f[_0x2b31('0x1b')][_0x2b31('0x21')]||null:null})[_0x2b31('0xf')](function(_0x3ded4b){if(_0x3ded4b){return _0x3ded4b[_0x2b31('0x22')](_0x4ab98f[_0x2b31('0x23')][_0x2b31('0x24')],_[_0x2b31('0x25')](_0x4ab98f[_0x2b31('0x23')],['ids','id'])||{});}})['spread'](function(_0x20e52f){logger[_0x2b31('0x10')]('AddTags',_0x4ab98f);logger[_0x2b31('0x13')](_0x2b31('0x26'),_0x4ab98f,JSON[_0x2b31('0x1e')](_0x20e52f));_0x42b193(_0x20e52f);})[_0x2b31('0x17')](function(_0x12001e){logger['error'](_0x2b31('0x26'),_0x12001e['message'],_0x4ab98f);_0x12047e(_this[_0x2b31('0x15')](0x1f4,_0x12001e[_0x2b31('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 7f53a62..b49d3d3 100644 --- a/server/api/smsInteraction/smsInteraction.socket.js +++ b/server/api/smsInteraction/smsInteraction.socket.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x52a7d8,_0x229a8a){var _0x3bb1b2=function(_0xc81ef5){while(--_0xc81ef5){_0x52a7d8['push'](_0x52a7d8['shift']());}};_0x3bb1b2(++_0x229a8a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0x5f66[_0x5f0089];return _0x193892;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file +var _0x0b0e=['smsInteraction:','./smsInteraction.events','remove','emit','removeListener','register'];(function(_0x27f8cf,_0x439b6d){var _0x1f6651=function(_0x3108e4){while(--_0x3108e4){_0x27f8cf['push'](_0x27f8cf['shift']());}};_0x1f6651(++_0x439b6d);}(_0x0b0e,0x187));var _0xe0b0=function(_0x2aaa60,_0x22258f){_0x2aaa60=_0x2aaa60-0x0;var _0x2e3fa5=_0x0b0e[_0x2aaa60];return _0x2e3fa5;};'use strict';var SmsInteractionEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){SmsInteractionEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);SmsInteractionEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index b4ad244..bdd7aa4 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 _0xedb2=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsMessage.controller','get','isAuthenticated','index','/describe','describe','/:id','post','tracked','sms','smsmessage:create','create','/:id/status','put','/:id/accept','accept','/:id/reject','delete'];(function(_0x1567fd,_0x2c3f50){var _0x4989cd=function(_0x1aa22e){while(--_0x1aa22e){_0x1567fd['push'](_0x1567fd['shift']());}};_0x4989cd(++_0x2c3f50);}(_0xedb2,0x1b5));var _0x2edb=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xedb2[_0x4bfac3];return _0x15f0f2;};'use strict';var multer=require(_0x2edb('0x0'));var util=require(_0x2edb('0x1'));var path=require(_0x2edb('0x2'));var timeout=require(_0x2edb('0x3'));var express=require(_0x2edb('0x4'));var router=express[_0x2edb('0x5')]();var auth=require(_0x2edb('0x6'));var interaction=require(_0x2edb('0x7'));var config=require(_0x2edb('0x8'));var controller=require(_0x2edb('0x9'));router[_0x2edb('0xa')]('/',auth[_0x2edb('0xb')](),controller[_0x2edb('0xc')]);router['get'](_0x2edb('0xd'),auth[_0x2edb('0xb')](),controller[_0x2edb('0xe')]);router[_0x2edb('0xa')](_0x2edb('0xf'),auth['isAuthenticated'](),controller['show']);router[_0x2edb('0x10')]('/',auth[_0x2edb('0xb')](),interaction[_0x2edb('0x11')](_0x2edb('0x12'),_0x2edb('0x13')),controller[_0x2edb('0x14')]);router[_0x2edb('0x10')](_0x2edb('0x15'),controller['status']);router['put'](_0x2edb('0xf'),auth[_0x2edb('0xb')](),controller['update']);router[_0x2edb('0x16')](_0x2edb('0x17'),auth[_0x2edb('0xb')](),controller[_0x2edb('0x18')]);router[_0x2edb('0x16')](_0x2edb('0x19'),auth[_0x2edb('0xb')](),controller['reject']);router[_0x2edb('0x1a')](_0x2edb('0xf'),auth[_0x2edb('0xb')](),controller[_0x2edb('0x1b')]);module[_0x2edb('0x1c')]=router; \ No newline at end of file +var _0x6cc7=['show','tracked','sms','post','/:id/status','status','put','update','accept','/:id/reject','reject','delete','/:id','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x26defc,_0x4427ff){var _0x118c9c=function(_0x40f13d){while(--_0x40f13d){_0x26defc['push'](_0x26defc['shift']());}};_0x118c9c(++_0x4427ff);}(_0x6cc7,0x12f));var _0x76cc=function(_0x334651,_0x6e99f6){_0x334651=_0x334651-0x0;var _0x29657c=_0x6cc7[_0x334651];return _0x29657c;};'use strict';var multer=require(_0x76cc('0x0'));var util=require(_0x76cc('0x1'));var path=require(_0x76cc('0x2'));var timeout=require('connect-timeout');var express=require(_0x76cc('0x3'));var router=express[_0x76cc('0x4')]();var auth=require(_0x76cc('0x5'));var interaction=require(_0x76cc('0x6'));var config=require('../../config/environment');var controller=require('./smsMessage.controller');router[_0x76cc('0x7')]('/',auth[_0x76cc('0x8')](),controller['index']);router[_0x76cc('0x7')]('/describe',auth[_0x76cc('0x8')](),controller['describe']);router[_0x76cc('0x7')]('/:id',auth[_0x76cc('0x8')](),controller[_0x76cc('0x9')]);router['post']('/',auth[_0x76cc('0x8')](),interaction[_0x76cc('0xa')](_0x76cc('0xb'),'smsmessage:create'),controller['create']);router[_0x76cc('0xc')](_0x76cc('0xd'),controller[_0x76cc('0xe')]);router[_0x76cc('0xf')]('/:id',auth[_0x76cc('0x8')](),controller[_0x76cc('0x10')]);router['put']('/:id/accept',auth['isAuthenticated'](),controller[_0x76cc('0x11')]);router[_0x76cc('0xf')](_0x76cc('0x12'),auth[_0x76cc('0x8')](),controller[_0x76cc('0x13')]);router[_0x76cc('0x14')](_0x76cc('0x15'),auth[_0x76cc('0x8')](),controller[_0x76cc('0x16')]);module[_0x76cc('0x17')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index dc68dae..f4edd82 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 _0xaee7=['DATE','sequelize','exports','medium','BOOLEAN','ENUM'];(function(_0x2051c5,_0x3d235c){var _0x146f60=function(_0x550a46){while(--_0x550a46){_0x2051c5['push'](_0x2051c5['shift']());}};_0x146f60(++_0x3d235c);}(_0xaee7,0xdf));var _0x7aee=function(_0x41ac36,_0x3feb46){_0x41ac36=_0x41ac36-0x0;var _0x3dfb50=_0xaee7[_0x41ac36];return _0x3dfb50;};'use strict';var Sequelize=require(_0x7aee('0x0'));module[_0x7aee('0x1')]={'body':{'type':Sequelize['TEXT'](_0x7aee('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x7aee('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7aee('0x4')]('in','out'),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0x7aee('0x5')]},'secret':{'type':Sequelize[_0x7aee('0x3')],'defaultValue':![]}}; \ No newline at end of file +var _0x2eda=['medium','ENUM','out','STRING','DATE','BOOLEAN','sequelize','exports','TEXT'];(function(_0x465b0c,_0x569d90){var _0x502ff0=function(_0x221757){while(--_0x221757){_0x465b0c['push'](_0x465b0c['shift']());}};_0x502ff0(++_0x569d90);}(_0x2eda,0x9f));var _0xa2ed=function(_0x2c6cfa,_0x25efc3){_0x2c6cfa=_0x2c6cfa-0x0;var _0x33bd3f=_0x2eda[_0x2c6cfa];return _0x33bd3f;};'use strict';var Sequelize=require(_0xa2ed('0x0'));module[_0xa2ed('0x1')]={'body':{'type':Sequelize[_0xa2ed('0x2')](_0xa2ed('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xa2ed('0x4')]('in',_0xa2ed('0x5')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xa2ed('0x6')](0xbe)},'phone':{'type':Sequelize[_0xa2ed('0x6')]},'readAt':{'type':Sequelize[_0xa2ed('0x7')]},'secret':{'type':Sequelize[_0xa2ed('0x8')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 28260f9..7242b7c 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 _0xcdd3=['request-promise','moment','bluebird','path','to-csv','lodash','squel','jsforce','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','stack','name','send','index','map','SmsMessage','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','type','options','include','findAll','rows','show','params','keys','find','create','body','describe','sms-interactions','accept','sms','read','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','SmsInteraction','isNil','format','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','user','role','stringify','null','AcceptMessage','interface','channel','EventManager','agent','SmsInteractionId','interaction','RejectMessage','rejectMessage','SIP/%s','event','rejectmessage','SmsAccount','SmsAccountId','debug','received\x20delivery\x20report\x20from','inspect','MessageSid','messageId','twilio','MessageUUID','indexOf','sent','delivered','Status','SmsAccount,\x20%s,\x20%s,\x20%s','plivio','infobip','DELIVERED','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x282658,_0x103dbc){var _0x4bf82d=function(_0x5bc034){while(--_0x5bc034){_0x282658['push'](_0x282658['shift']());}};_0x4bf82d(++_0x103dbc);}(_0xcdd3,0x109));var _0x3cdd=function(_0x42803e,_0x3f65df){_0x42803e=_0x42803e-0x0;var _0x32c59c=_0xcdd3[_0x42803e];return _0x32c59c;};'use strict';var pdf=require(_0x3cdd('0x0'));var emlformat=require(_0x3cdd('0x1'));var rimraf=require(_0x3cdd('0x2'));var zipdir=require(_0x3cdd('0x3'));var jsonpatch=require(_0x3cdd('0x4'));var rp=require(_0x3cdd('0x5'));var moment=require(_0x3cdd('0x6'));var BPromise=require(_0x3cdd('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3cdd('0x8'));var sox=require('sox');var csv=require(_0x3cdd('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3cdd('0xa'));var squel=require(_0x3cdd('0xb'));var crypto=require('crypto');var jsforce=require(_0x3cdd('0xc'));var deskjs=require(_0x3cdd('0xd'));var toCsv=require(_0x3cdd('0x9'));var querystring=require(_0x3cdd('0xe'));var Papa=require('papaparse');var Redis=require(_0x3cdd('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x3cdd('0x10'));var hardwareService=require(_0x3cdd('0x11'));var logger=require(_0x3cdd('0x12'))(_0x3cdd('0x13'));var utils=require('../../config/utils');var config=require(_0x3cdd('0x14'));var db=require(_0x3cdd('0x15'))['db'];config[_0x3cdd('0x16')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cdd('0x16')]));require('./smsMessage.socket')[_0x3cdd('0x17')](socket);var jayson=require(_0x3cdd('0x18'));var client=jayson[_0x3cdd('0x19')]['http']({'port':0x232c});var client9002=jayson[_0x3cdd('0x19')][_0x3cdd('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2a46ca,_0x4d122b,_0x42ae76){if(_0x42ae76){var _0x407440=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x407440[_0x3cdd('0x1b')](_0x4d122b)){return _0x2a46ca;}else{throw new db[(_0x3cdd('0x1c'))][(_0x3cdd('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x2a46ca;}}function respondWithRpcPromise(_0x2f8268,_0x57242c,_0x216d1b,_0x5b40c3){return new BPromise(function(_0x1a8502,_0x31b6af){var _0x5e0243=_0x5b40c3||client;return _0x5e0243[_0x3cdd('0x1e')](_0x2f8268,_0x216d1b)[_0x3cdd('0x1f')](function(_0xb13adf){logger[_0x3cdd('0x20')](_0x3cdd('0x21'),_0x57242c,_0x3cdd('0x22'));logger['debug'](_0x3cdd('0x23'),_0x57242c,_0x3cdd('0x22'),JSON['stringify'](_0xb13adf));if(_0xb13adf['error']){if(_0xb13adf[_0x3cdd('0x24')][_0x3cdd('0x25')]===0x1f4){logger[_0x3cdd('0x24')](_0x3cdd('0x21'),_0x57242c,_0xb13adf[_0x3cdd('0x24')][_0x3cdd('0x26')]);return _0x31b6af(_0xb13adf['error'][_0x3cdd('0x26')]);}logger[_0x3cdd('0x24')](_0x3cdd('0x21'),_0x57242c,_0xb13adf[_0x3cdd('0x24')][_0x3cdd('0x26')]);return _0x1a8502(_0xb13adf[_0x3cdd('0x24')]['message']);}else{logger[_0x3cdd('0x20')]('SmsMessage,\x20%s,\x20%s',_0x57242c,_0x3cdd('0x22'));_0x1a8502(_0xb13adf[_0x3cdd('0x27')][_0x3cdd('0x26')]);}})[_0x3cdd('0x28')](function(_0x2865b2){logger['error'](_0x3cdd('0x21'),_0x57242c,_0x2865b2);_0x31b6af(_0x2865b2);});});}function respondWithStatusCode(_0x4a2856,_0x2dd1b2){_0x2dd1b2=_0x2dd1b2||0xcc;return function(_0x20d84a){if(_0x20d84a){return _0x4a2856[_0x3cdd('0x29')](_0x2dd1b2);}return _0x4a2856[_0x3cdd('0x2a')](_0x2dd1b2)[_0x3cdd('0x2b')]();};}function respondWithResult(_0x19aa35,_0x48cbf0){_0x48cbf0=_0x48cbf0||0xc8;return function(_0x48fdac){if(_0x48fdac){return _0x19aa35['status'](_0x48cbf0)[_0x3cdd('0x2c')](_0x48fdac);}};}function respondWithFilteredResult(_0x5bd562,_0x315247){return function(_0x1ec282){if(_0x1ec282){var _0x7c9c63=_0x1ec282[_0x3cdd('0x2d')],_0x4c082a=_0x315247[_0x3cdd('0x2e')],_0x5ceb1b=_0x315247[_0x3cdd('0x2e')]+_0x315247['limit'],_0x1f2e15;if(_0x5ceb1b>=_0x7c9c63){_0x5ceb1b=_0x7c9c63;_0x1f2e15=0xc8;}else{_0x1f2e15=0xce;}_0x5bd562['status'](_0x1f2e15);return _0x5bd562[_0x3cdd('0x2f')](_0x3cdd('0x30'),_0x4c082a+'-'+_0x5ceb1b+'/'+_0x7c9c63)[_0x3cdd('0x2c')](_0x1ec282);}return null;};}function patchUpdates(_0x47d391){return function(_0x572eb1){try{jsonpatch[_0x3cdd('0x31')](_0x572eb1,_0x47d391,!![]);}catch(_0x1e0f27){return BPromise[_0x3cdd('0x32')](_0x1e0f27);}return _0x572eb1[_0x3cdd('0x33')]();};}function saveUpdates(_0x34ebf4,_0x2b2bbd){return function(_0x6630da){if(_0x6630da){return _0x6630da[_0x3cdd('0x34')](_0x34ebf4)[_0x3cdd('0x1f')](function(_0x1a3f10){return _0x1a3f10;});}return null;};}function removeEntity(_0x26bc99,_0x339709){return function(_0x3b1df9){if(_0x3b1df9){return _0x3b1df9[_0x3cdd('0x35')]()['then'](function(){_0x26bc99[_0x3cdd('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x287c78,_0x1d308e){return function(_0x24d504){if(!_0x24d504){_0x287c78[_0x3cdd('0x29')](0x194);}return _0x24d504;};}function handleError(_0x23c526,_0x32b89f){_0x32b89f=_0x32b89f||0x1f4;return function(_0x4d8f75){logger['error'](_0x4d8f75[_0x3cdd('0x36')]);if(_0x4d8f75[_0x3cdd('0x37')]){delete _0x4d8f75['name'];}_0x23c526['status'](_0x32b89f)[_0x3cdd('0x38')](_0x4d8f75);};}exports[_0x3cdd('0x39')]=function(_0x135bb9,_0x3253d9){var _0x31d44c={},_0x1174ab={},_0x45e50e={'count':0x0,'rows':[]};var _0x5ed057=_[_0x3cdd('0x3a')](db[_0x3cdd('0x3b')][_0x3cdd('0x3c')],function(_0x101f21){return{'name':_0x101f21['fieldName'],'type':_0x101f21['type'][_0x3cdd('0x3d')]};});_0x1174ab[_0x3cdd('0x3e')]=_[_0x3cdd('0x3a')](_0x5ed057,_0x3cdd('0x37'));_0x1174ab[_0x3cdd('0x3f')]=_['keys'](_0x135bb9[_0x3cdd('0x3f')]);_0x1174ab[_0x3cdd('0x40')]=_[_0x3cdd('0x41')](_0x1174ab[_0x3cdd('0x3e')],_0x1174ab[_0x3cdd('0x3f')]);_0x31d44c[_0x3cdd('0x42')]=_[_0x3cdd('0x41')](_0x1174ab[_0x3cdd('0x3e')],qs['fields'](_0x135bb9[_0x3cdd('0x3f')][_0x3cdd('0x43')]));_0x31d44c[_0x3cdd('0x42')]=_0x31d44c['attributes'][_0x3cdd('0x44')]?_0x31d44c[_0x3cdd('0x42')]:_0x1174ab[_0x3cdd('0x3e')];if(!_0x135bb9[_0x3cdd('0x3f')][_0x3cdd('0x45')](_0x3cdd('0x46'))){_0x31d44c[_0x3cdd('0x47')]=qs[_0x3cdd('0x47')](_0x135bb9[_0x3cdd('0x3f')][_0x3cdd('0x47')]);_0x31d44c[_0x3cdd('0x2e')]=qs['offset'](_0x135bb9[_0x3cdd('0x3f')]['offset']);}_0x31d44c[_0x3cdd('0x48')]=qs[_0x3cdd('0x49')](_0x135bb9['query'][_0x3cdd('0x49')]);_0x31d44c[_0x3cdd('0x4a')]=qs[_0x3cdd('0x40')](_['pick'](_0x135bb9['query'],_0x1174ab[_0x3cdd('0x40')]));if(_0x135bb9['query'][_0x3cdd('0x4b')]){_0x31d44c[_0x3cdd('0x4a')]=_[_0x3cdd('0x4c')](_0x31d44c[_0x3cdd('0x4a')],{'$or':_['map'](_0x5ed057,function(_0x5cda8a){if(_0x5cda8a[_0x3cdd('0x4d')]!=='VIRTUAL'){var _0x12c517={};_0x12c517[_0x5cda8a[_0x3cdd('0x37')]]={'$like':'%'+_0x135bb9[_0x3cdd('0x3f')][_0x3cdd('0x4b')]+'%'};return _0x12c517;}})});}_0x31d44c=_[_0x3cdd('0x4c')]({},_0x31d44c,_0x135bb9[_0x3cdd('0x4e')]);var _0x384aba={'where':_0x31d44c[_0x3cdd('0x4a')]};return db[_0x3cdd('0x3b')]['count'](_0x384aba)[_0x3cdd('0x1f')](function(_0x4f367c){_0x45e50e[_0x3cdd('0x2d')]=_0x4f367c;if(_0x135bb9[_0x3cdd('0x3f')]['includeAll']){_0x31d44c[_0x3cdd('0x4f')]=[{'all':!![]}];}return db[_0x3cdd('0x3b')][_0x3cdd('0x50')](_0x31d44c);})[_0x3cdd('0x1f')](function(_0x17b8b1){_0x45e50e[_0x3cdd('0x51')]=_0x17b8b1;return _0x45e50e;})['then'](respondWithFilteredResult(_0x3253d9,_0x31d44c))[_0x3cdd('0x28')](handleError(_0x3253d9,null));};exports[_0x3cdd('0x52')]=function(_0x43d973,_0x3dc5b4){var _0x4ae406={'raw':!![],'where':{'id':_0x43d973[_0x3cdd('0x53')]['id']}},_0x4e9e64={};_0x4e9e64['model']=_[_0x3cdd('0x54')](db[_0x3cdd('0x3b')]['rawAttributes']);_0x4e9e64['query']=_['keys'](_0x43d973['query']);_0x4e9e64[_0x3cdd('0x40')]=_[_0x3cdd('0x41')](_0x4e9e64[_0x3cdd('0x3e')],_0x4e9e64['query']);_0x4ae406[_0x3cdd('0x42')]=_[_0x3cdd('0x41')](_0x4e9e64[_0x3cdd('0x3e')],qs[_0x3cdd('0x43')](_0x43d973[_0x3cdd('0x3f')]['fields']));_0x4ae406['attributes']=_0x4ae406[_0x3cdd('0x42')][_0x3cdd('0x44')]?_0x4ae406['attributes']:_0x4e9e64[_0x3cdd('0x3e')];if(_0x43d973['query']['includeAll']){_0x4ae406[_0x3cdd('0x4f')]=[{'all':!![]}];}_0x4ae406=_['merge']({},_0x4ae406,_0x43d973[_0x3cdd('0x4e')]);return db['SmsMessage'][_0x3cdd('0x55')](_0x4ae406)[_0x3cdd('0x1f')](handleEntityNotFound(_0x3dc5b4,null))[_0x3cdd('0x1f')](respondWithResult(_0x3dc5b4,null))[_0x3cdd('0x28')](handleError(_0x3dc5b4,null));};exports[_0x3cdd('0x56')]=function(_0x27ae7c,_0x51a80a){return db[_0x3cdd('0x3b')]['create'](_0x27ae7c['body'],{})[_0x3cdd('0x1f')](respondWithResult(_0x51a80a,0xc9))[_0x3cdd('0x28')](handleError(_0x51a80a,null));};exports[_0x3cdd('0x34')]=function(_0x4cf47a,_0x228c19){if(_0x4cf47a[_0x3cdd('0x57')]['id']){delete _0x4cf47a[_0x3cdd('0x57')]['id'];}return db['SmsMessage'][_0x3cdd('0x55')]({'where':{'id':_0x4cf47a[_0x3cdd('0x53')]['id']}})[_0x3cdd('0x1f')](handleEntityNotFound(_0x228c19,null))[_0x3cdd('0x1f')](saveUpdates(_0x4cf47a[_0x3cdd('0x57')],null))[_0x3cdd('0x1f')](respondWithResult(_0x228c19,null))[_0x3cdd('0x28')](handleError(_0x228c19,null));};exports[_0x3cdd('0x35')]=function(_0x276108,_0x3e7a60){return db[_0x3cdd('0x3b')][_0x3cdd('0x55')]({'where':{'id':_0x276108[_0x3cdd('0x53')]['id']}})[_0x3cdd('0x1f')](handleEntityNotFound(_0x3e7a60,null))[_0x3cdd('0x1f')](removeEntity(_0x3e7a60,null))['catch'](handleError(_0x3e7a60,null));};exports[_0x3cdd('0x58')]=function(_0x558f86,_0xe63947){return db['SmsMessage'][_0x3cdd('0x58')]()[_0x3cdd('0x1f')](respondWithResult(_0xe63947,null))[_0x3cdd('0x28')](handleError(_0xe63947,null));};var interaction_log=require(_0x3cdd('0x12'))(_0x3cdd('0x59'));exports[_0x3cdd('0x5a')]=function(_0x186124,_0x3bbfff,_0x4dffe3){var _0x385980={'channel':_0x3cdd('0x5b')};if(_0x186124[_0x3cdd('0x57')]['id']){delete _0x186124[_0x3cdd('0x57')]['id'];}_0x186124[_0x3cdd('0x57')][_0x3cdd('0x5c')]=!![];_0x186124[_0x3cdd('0x57')]['readAt']=moment()['format'](_0x3cdd('0x5d'));_0x186124[_0x3cdd('0x57')][_0x3cdd('0x5e')]=_0x186124[_0x3cdd('0x57')][_0x3cdd('0x5e')]||_0x186124['user']['id'];return db['SmsMessage'][_0x3cdd('0x55')]({'where':{'id':_0x186124['params']['id'],'UserId':null},'include':[{'model':db[_0x3cdd('0x5f')],'as':_0x3cdd('0x60')}]})[_0x3cdd('0x1f')](handleEntityNotFound(_0x3bbfff,null))[_0x3cdd('0x1f')](saveUpdates(_0x186124[_0x3cdd('0x57')],null))['then'](function(_0x345c81){if(_0x345c81){_0x385980[_0x3cdd('0x26')]=_0x345c81['get']({'plain':!![]});return db[_0x3cdd('0x61')][_0x3cdd('0x55')]({'where':{'id':_0x345c81['SmsInteractionId']}});}return null;})[_0x3cdd('0x1f')](handleEntityNotFound(_0x3bbfff,null))[_0x3cdd('0x1f')](function(_0x285aa9){if(_0x285aa9){return _0x285aa9['update']({'UserId':_0x186124[_0x3cdd('0x57')][_0x3cdd('0x5e')],'read1stAt':_[_0x3cdd('0x62')](_0x285aa9['read1stAt'])?moment()[_0x3cdd('0x63')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})['then'](function(_0x1a7991){if(_0x1a7991){_0x385980['interaction']=_0x1a7991[_0x3cdd('0x64')]({'plain':!![]});interaction_log['info'](_0x3cdd('0x65'),_0x186124[_0x3cdd('0x66')]['id'],_0x186124['user']['name'],_0x186124[_0x3cdd('0x66')][_0x3cdd('0x67')],_0x385980['interaction']['id'],_0x186124[_0x3cdd('0x57')]?JSON[_0x3cdd('0x68')](_0x186124[_0x3cdd('0x57')]):_0x3cdd('0x69'));return respondWithRpcPromise(_0x3cdd('0x6a'),'acceptMessage',_0x385980);}return null;})[_0x3cdd('0x1f')](function(_0x5edcb4){if(_0x5edcb4){if(_0x186124['body']['manual']){_0x385980['message'][_0x3cdd('0x6b')]=util['format']('SIP/%s',_0x186124[_0x3cdd('0x66')]['name']);_0x385980[_0x3cdd('0x26')][_0x3cdd('0x6c')]=_0x385980['channel'];_0x385980[_0x3cdd('0x26')]['event']=_0x3cdd('0x5a');return respondWithRpcPromise(_0x3cdd('0x6d'),_0x3cdd('0x6d'),{'event':'acceptmessage','message':_0x385980['message']},client9002)[_0x3cdd('0x1f')](function(){return _0x385980;});}return _0x385980;}return null;})['then'](respondWithResult(_0x3bbfff,null))[_0x3cdd('0x28')](handleError(_0x3bbfff,null));};var interaction_log=require(_0x3cdd('0x12'))(_0x3cdd('0x59'));exports[_0x3cdd('0x32')]=function(_0x3a1c62,_0x31d4f9,_0x58bcb9){var _0xe44783={'agent':{},'channel':'sms'};if(_0x3a1c62[_0x3cdd('0x57')]['id']){delete _0x3a1c62[_0x3cdd('0x57')]['id'];}_0x3a1c62[_0x3cdd('0x57')]['UserId']=_0x3a1c62[_0x3cdd('0x57')][_0x3cdd('0x5e')]||_0x3a1c62[_0x3cdd('0x66')]['id'];_0xe44783[_0x3cdd('0x6e')]['id']=_0x3a1c62[_0x3cdd('0x57')]['UserId'];return db['SmsMessage']['find']({'where':{'id':_0x3a1c62[_0x3cdd('0x53')]['id'],'UserId':null}})[_0x3cdd('0x1f')](handleEntityNotFound(_0x31d4f9,null))['then'](function(_0x4c8524){if(_0x4c8524){_0xe44783[_0x3cdd('0x26')]=_0x4c8524[_0x3cdd('0x64')]({'plain':!![]});return db[_0x3cdd('0x61')][_0x3cdd('0x55')]({'where':{'id':_0x4c8524[_0x3cdd('0x6f')]}});}return null;})[_0x3cdd('0x1f')](handleEntityNotFound(_0x31d4f9,null))[_0x3cdd('0x1f')](function(_0x5d997d){if(_0x5d997d){_0xe44783[_0x3cdd('0x70')]=_0x5d997d[_0x3cdd('0x64')]({'plain':!![]});interaction_log[_0x3cdd('0x20')]('[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x3a1c62['user']['id'],_0x3a1c62[_0x3cdd('0x66')][_0x3cdd('0x37')],_0x3a1c62[_0x3cdd('0x66')][_0x3cdd('0x67')],_0xe44783[_0x3cdd('0x70')]['id'],_0x3a1c62[_0x3cdd('0x57')]?JSON['stringify'](_0x3a1c62[_0x3cdd('0x57')]):_0x3cdd('0x69'));return respondWithRpcPromise(_0x3cdd('0x71'),_0x3cdd('0x72'),_0xe44783);}return null;})[_0x3cdd('0x1f')](function(_0x50f92f){if(_0x50f92f){_0x50f92f[_0x3cdd('0x26')][_0x3cdd('0x6b')]=util['format'](_0x3cdd('0x73'),_0x3a1c62[_0x3cdd('0x66')][_0x3cdd('0x37')]);_0x50f92f[_0x3cdd('0x26')][_0x3cdd('0x6c')]=_0xe44783[_0x3cdd('0x6c')];_0x50f92f[_0x3cdd('0x26')][_0x3cdd('0x74')]=_0x3cdd('0x32');respondWithRpcPromise(_0x3cdd('0x6d'),_0x3cdd('0x6d'),{'event':_0x3cdd('0x75'),'message':_0x50f92f['message']},client9002);return _0xe44783;}return null;})[_0x3cdd('0x1f')](respondWithResult(_0x31d4f9,null))[_0x3cdd('0x28')](handleError(_0x31d4f9,null));};exports['status']=function(_0x1c4c3a,_0x1d8d6c,_0x5e05dd){if(_0x1c4c3a[_0x3cdd('0x57')]['id']){delete _0x1c4c3a[_0x3cdd('0x57')]['id'];}var _0x473dbe;return db[_0x3cdd('0x3b')][_0x3cdd('0x55')]({'where':{'id':_0x1c4c3a['params']['id']}})[_0x3cdd('0x1f')](handleEntityNotFound(_0x1d8d6c,null))[_0x3cdd('0x1f')](function(_0x2a6fbe){if(_0x2a6fbe){_0x473dbe=_0x2a6fbe;return db[_0x3cdd('0x76')][_0x3cdd('0x55')]({'where':{'id':_0x2a6fbe[_0x3cdd('0x77')]}});}})[_0x3cdd('0x1f')](handleEntityNotFound(_0x1d8d6c,null))['then'](function(_0x5d222d){if(_0x5d222d){logger[_0x3cdd('0x78')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x3cdd('0x2a'),_0x3cdd('0x79'),_0x5d222d[_0x3cdd('0x4d')],util[_0x3cdd('0x7a')](_0x1c4c3a[_0x3cdd('0x57')],{'showHidden':![],'depth':null}));switch(_0x5d222d[_0x3cdd('0x4d')]){case'twilio':if(_0x1c4c3a[_0x3cdd('0x57')][_0x3cdd('0x7b')]&&_0x1c4c3a[_0x3cdd('0x57')][_0x3cdd('0x7b')]===_0x473dbe[_0x3cdd('0x7c')]){return _0x473dbe[_0x3cdd('0x34')]({'read':!![]});}else{logger['error']('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cdd('0x2a'),_0x3cdd('0x7d'),util[_0x3cdd('0x7a')](_0x1c4c3a[_0x3cdd('0x57')],{'showHidden':![],'depth':null}));}break;case'plivo':if(_0x1c4c3a[_0x3cdd('0x57')]['MessageUUID']&&_0x1c4c3a['body'][_0x3cdd('0x7e')]===_0x473dbe[_0x3cdd('0x7c')]&&_[_0x3cdd('0x7f')]([_0x3cdd('0x80'),_0x3cdd('0x81')],_0x1c4c3a[_0x3cdd('0x57')][_0x3cdd('0x82')])>=0x0){return _0x473dbe[_0x3cdd('0x34')]({'read':!![]});}else{logger[_0x3cdd('0x24')](_0x3cdd('0x83'),_0x3cdd('0x2a'),_0x3cdd('0x84'),util[_0x3cdd('0x7a')](_0x1c4c3a[_0x3cdd('0x57')],{'showHidden':![],'depth':null}));}break;case _0x3cdd('0x85'):var _0x4a59bb=_0x1c4c3a[_0x3cdd('0x57')]['results'][0x0];if(_0x4a59bb['status']['groupName']===_0x3cdd('0x86')){return _0x473dbe[_0x3cdd('0x34')]({'read':!![]});}else{logger[_0x3cdd('0x24')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x3cdd('0x2a'),'infobip',util[_0x3cdd('0x7a')](_0x1c4c3a[_0x3cdd('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x473dbe;}})[_0x3cdd('0x1f')](respondWithResult(_0x1d8d6c,null))[_0x3cdd('0x28')](handleError(_0x1d8d6c,null));}; \ No newline at end of file +var _0x59f8=['includeAll','findAll','rows','show','params','rawAttributes','include','catch','create','body','find','describe','../../config/logger','sms-interactions','accept','sms','read','readAt','format','UserId','user','CmContact','Contact','get','SmsInteraction','SmsInteractionId','isNil','read1stAt','YYYY-MM-DD\x20HH:mm:ss','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','channel','event','EventManager','interaction','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','plivio','results','groupName','infobip','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','jayson/promise','client','http','Sequelize','ValidationError','info','request\x20sent','debug','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','stack','name','send','index','map','SmsMessage','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','VIRTUAL','options'];(function(_0x103a28,_0x23e621){var _0x12a3d3=function(_0x2b2c43){while(--_0x2b2c43){_0x103a28['push'](_0x103a28['shift']());}};_0x12a3d3(++_0x23e621);}(_0x59f8,0x1d2));var _0x859f=function(_0x3f1511,_0x811452){_0x3f1511=_0x3f1511-0x0;var _0x3a46fd=_0x59f8[_0x3f1511];return _0x3a46fd;};'use strict';var pdf=require(_0x859f('0x0'));var emlformat=require(_0x859f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x859f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x859f('0x3'));var BPromise=require(_0x859f('0x4'));var Mustache=require(_0x859f('0x5'));var util=require(_0x859f('0x6'));var path=require(_0x859f('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x859f('0x8'));var jsforce=require(_0x859f('0x9'));var deskjs=require('desk.js');var toCsv=require(_0x859f('0xa'));var querystring=require(_0x859f('0xb'));var Papa=require(_0x859f('0xc'));var Redis=require('ioredis');var authService=require(_0x859f('0xd'));var qs=require(_0x859f('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x859f('0xf'));var db=require(_0x859f('0x10'))['db'];config[_0x859f('0x11')]=_[_0x859f('0x12')](config['redis'],{'host':_0x859f('0x13'),'port':0x18eb});var socket=require(_0x859f('0x14'))(new Redis(config['redis']));require(_0x859f('0x15'))[_0x859f('0x16')](socket);var jayson=require(_0x859f('0x17'));var client=jayson[_0x859f('0x18')][_0x859f('0x19')]({'port':0x232c});var client9002=jayson[_0x859f('0x18')][_0x859f('0x19')]({'port':0x232a});function checkPasswordPattern(_0x4b48ca,_0x587d42,_0x3d9ad5){if(_0x3d9ad5){var _0x21a3f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x21a3f0['test'](_0x587d42)){return _0x4b48ca;}else{throw new db[(_0x859f('0x1a'))][(_0x859f('0x1b'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x4b48ca;}}function respondWithRpcPromise(_0x121389,_0x4d7bdb,_0x5836ea,_0xad699f){return new BPromise(function(_0x180dfe,_0x263a09){var _0x18c828=_0xad699f||client;return _0x18c828['request'](_0x121389,_0x5836ea)['then'](function(_0x267d7a){logger[_0x859f('0x1c')]('SmsMessage,\x20%s,\x20%s',_0x4d7bdb,_0x859f('0x1d'));logger[_0x859f('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x4d7bdb,_0x859f('0x1d'),JSON[_0x859f('0x1f')](_0x267d7a));if(_0x267d7a[_0x859f('0x20')]){if(_0x267d7a['error'][_0x859f('0x21')]===0x1f4){logger[_0x859f('0x20')]('SmsMessage,\x20%s,\x20%s',_0x4d7bdb,_0x267d7a['error'][_0x859f('0x22')]);return _0x263a09(_0x267d7a[_0x859f('0x20')][_0x859f('0x22')]);}logger[_0x859f('0x20')](_0x859f('0x23'),_0x4d7bdb,_0x267d7a[_0x859f('0x20')][_0x859f('0x22')]);return _0x180dfe(_0x267d7a['error']['message']);}else{logger[_0x859f('0x1c')](_0x859f('0x23'),_0x4d7bdb,'request\x20sent');_0x180dfe(_0x267d7a[_0x859f('0x24')]['message']);}})['catch'](function(_0x156a58){logger[_0x859f('0x20')](_0x859f('0x23'),_0x4d7bdb,_0x156a58);_0x263a09(_0x156a58);});});}function respondWithStatusCode(_0x11069b,_0x5329c5){_0x5329c5=_0x5329c5||0xcc;return function(_0x505069){if(_0x505069){return _0x11069b[_0x859f('0x25')](_0x5329c5);}return _0x11069b[_0x859f('0x26')](_0x5329c5)[_0x859f('0x27')]();};}function respondWithResult(_0x135c74,_0x168626){_0x168626=_0x168626||0xc8;return function(_0xa7dff7){if(_0xa7dff7){return _0x135c74['status'](_0x168626)[_0x859f('0x28')](_0xa7dff7);}};}function respondWithFilteredResult(_0x3a6456,_0x5a6927){return function(_0x4240b5){if(_0x4240b5){var _0x47a1e8=_0x4240b5[_0x859f('0x29')],_0x447e75=_0x5a6927[_0x859f('0x2a')],_0x84fe05=_0x5a6927['offset']+_0x5a6927[_0x859f('0x2b')],_0x246e7a;if(_0x84fe05>=_0x47a1e8){_0x84fe05=_0x47a1e8;_0x246e7a=0xc8;}else{_0x246e7a=0xce;}_0x3a6456[_0x859f('0x26')](_0x246e7a);return _0x3a6456[_0x859f('0x2c')](_0x859f('0x2d'),_0x447e75+'-'+_0x84fe05+'/'+_0x47a1e8)[_0x859f('0x28')](_0x4240b5);}return null;};}function patchUpdates(_0x5185b2){return function(_0x20e216){try{jsonpatch[_0x859f('0x2e')](_0x20e216,_0x5185b2,!![]);}catch(_0x22a891){return BPromise[_0x859f('0x2f')](_0x22a891);}return _0x20e216['save']();};}function saveUpdates(_0x23cffe,_0x11f073){return function(_0x5914bf){if(_0x5914bf){return _0x5914bf[_0x859f('0x30')](_0x23cffe)[_0x859f('0x31')](function(_0x1b0b46){return _0x1b0b46;});}return null;};}function removeEntity(_0x4570c5,_0x3b998c){return function(_0x4b8da8){if(_0x4b8da8){return _0x4b8da8[_0x859f('0x32')]()[_0x859f('0x31')](function(){_0x4570c5['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1bcd68,_0x59fa3d){return function(_0x2790d9){if(!_0x2790d9){_0x1bcd68[_0x859f('0x25')](0x194);}return _0x2790d9;};}function handleError(_0x3bf762,_0x519247){_0x519247=_0x519247||0x1f4;return function(_0x21b7b4){logger[_0x859f('0x20')](_0x21b7b4[_0x859f('0x33')]);if(_0x21b7b4[_0x859f('0x34')]){delete _0x21b7b4[_0x859f('0x34')];}_0x3bf762[_0x859f('0x26')](_0x519247)[_0x859f('0x35')](_0x21b7b4);};}exports[_0x859f('0x36')]=function(_0x284620,_0x2ba143){var _0x38208e={},_0x58500d={},_0x2b5dee={'count':0x0,'rows':[]};var _0x35cc34=_[_0x859f('0x37')](db[_0x859f('0x38')]['rawAttributes'],function(_0x579b65){return{'name':_0x579b65['fieldName'],'type':_0x579b65[_0x859f('0x39')][_0x859f('0x3a')]};});_0x58500d[_0x859f('0x3b')]=_['map'](_0x35cc34,_0x859f('0x34'));_0x58500d[_0x859f('0x3c')]=_[_0x859f('0x3d')](_0x284620[_0x859f('0x3c')]);_0x58500d[_0x859f('0x3e')]=_[_0x859f('0x3f')](_0x58500d[_0x859f('0x3b')],_0x58500d[_0x859f('0x3c')]);_0x38208e[_0x859f('0x40')]=_[_0x859f('0x3f')](_0x58500d['model'],qs[_0x859f('0x41')](_0x284620[_0x859f('0x3c')]['fields']));_0x38208e['attributes']=_0x38208e[_0x859f('0x40')][_0x859f('0x42')]?_0x38208e[_0x859f('0x40')]:_0x58500d[_0x859f('0x3b')];if(!_0x284620[_0x859f('0x3c')]['hasOwnProperty'](_0x859f('0x43'))){_0x38208e[_0x859f('0x2b')]=qs[_0x859f('0x2b')](_0x284620[_0x859f('0x3c')][_0x859f('0x2b')]);_0x38208e[_0x859f('0x2a')]=qs[_0x859f('0x2a')](_0x284620[_0x859f('0x3c')]['offset']);}_0x38208e[_0x859f('0x44')]=qs['sort'](_0x284620[_0x859f('0x3c')][_0x859f('0x45')]);_0x38208e[_0x859f('0x46')]=qs['filters'](_[_0x859f('0x47')](_0x284620[_0x859f('0x3c')],_0x58500d['filters']));if(_0x284620['query']['filter']){_0x38208e['where']=_['merge'](_0x38208e['where'],{'$or':_['map'](_0x35cc34,function(_0x10317e){if(_0x10317e[_0x859f('0x39')]!==_0x859f('0x48')){var _0x513aad={};_0x513aad[_0x10317e[_0x859f('0x34')]]={'$like':'%'+_0x284620[_0x859f('0x3c')]['filter']+'%'};return _0x513aad;}})});}_0x38208e=_['merge']({},_0x38208e,_0x284620[_0x859f('0x49')]);var _0x2e7b8e={'where':_0x38208e[_0x859f('0x46')]};return db['SmsMessage']['count'](_0x2e7b8e)[_0x859f('0x31')](function(_0xb92f42){_0x2b5dee[_0x859f('0x29')]=_0xb92f42;if(_0x284620[_0x859f('0x3c')][_0x859f('0x4a')]){_0x38208e['include']=[{'all':!![]}];}return db['SmsMessage'][_0x859f('0x4b')](_0x38208e);})[_0x859f('0x31')](function(_0x5013fa){_0x2b5dee[_0x859f('0x4c')]=_0x5013fa;return _0x2b5dee;})[_0x859f('0x31')](respondWithFilteredResult(_0x2ba143,_0x38208e))['catch'](handleError(_0x2ba143,null));};exports[_0x859f('0x4d')]=function(_0x1ae66e,_0x36266b){var _0x42789d={'raw':!![],'where':{'id':_0x1ae66e[_0x859f('0x4e')]['id']}},_0x1ddb84={};_0x1ddb84[_0x859f('0x3b')]=_['keys'](db['SmsMessage'][_0x859f('0x4f')]);_0x1ddb84[_0x859f('0x3c')]=_[_0x859f('0x3d')](_0x1ae66e['query']);_0x1ddb84['filters']=_[_0x859f('0x3f')](_0x1ddb84[_0x859f('0x3b')],_0x1ddb84[_0x859f('0x3c')]);_0x42789d[_0x859f('0x40')]=_[_0x859f('0x3f')](_0x1ddb84[_0x859f('0x3b')],qs[_0x859f('0x41')](_0x1ae66e['query'][_0x859f('0x41')]));_0x42789d[_0x859f('0x40')]=_0x42789d[_0x859f('0x40')][_0x859f('0x42')]?_0x42789d['attributes']:_0x1ddb84[_0x859f('0x3b')];if(_0x1ae66e[_0x859f('0x3c')]['includeAll']){_0x42789d[_0x859f('0x50')]=[{'all':!![]}];}_0x42789d=_['merge']({},_0x42789d,_0x1ae66e[_0x859f('0x49')]);return db[_0x859f('0x38')]['find'](_0x42789d)[_0x859f('0x31')](handleEntityNotFound(_0x36266b,null))[_0x859f('0x31')](respondWithResult(_0x36266b,null))[_0x859f('0x51')](handleError(_0x36266b,null));};exports[_0x859f('0x52')]=function(_0x5aa25b,_0x345593){return db[_0x859f('0x38')]['create'](_0x5aa25b[_0x859f('0x53')],{})['then'](respondWithResult(_0x345593,0xc9))['catch'](handleError(_0x345593,null));};exports['update']=function(_0x2c7a28,_0x89886){if(_0x2c7a28['body']['id']){delete _0x2c7a28[_0x859f('0x53')]['id'];}return db[_0x859f('0x38')][_0x859f('0x54')]({'where':{'id':_0x2c7a28[_0x859f('0x4e')]['id']}})[_0x859f('0x31')](handleEntityNotFound(_0x89886,null))[_0x859f('0x31')](saveUpdates(_0x2c7a28[_0x859f('0x53')],null))['then'](respondWithResult(_0x89886,null))['catch'](handleError(_0x89886,null));};exports[_0x859f('0x32')]=function(_0x3b0535,_0x40dca5){return db[_0x859f('0x38')]['find']({'where':{'id':_0x3b0535[_0x859f('0x4e')]['id']}})[_0x859f('0x31')](handleEntityNotFound(_0x40dca5,null))[_0x859f('0x31')](removeEntity(_0x40dca5,null))[_0x859f('0x51')](handleError(_0x40dca5,null));};exports['describe']=function(_0x228508,_0x2ae9f3){return db[_0x859f('0x38')][_0x859f('0x55')]()[_0x859f('0x31')](respondWithResult(_0x2ae9f3,null))[_0x859f('0x51')](handleError(_0x2ae9f3,null));};var interaction_log=require(_0x859f('0x56'))(_0x859f('0x57'));exports[_0x859f('0x58')]=function(_0xe132e7,_0x595d3f,_0x2c48e0){var _0xac8386={'channel':_0x859f('0x59')};if(_0xe132e7[_0x859f('0x53')]['id']){delete _0xe132e7[_0x859f('0x53')]['id'];}_0xe132e7[_0x859f('0x53')][_0x859f('0x5a')]=!![];_0xe132e7['body'][_0x859f('0x5b')]=moment()[_0x859f('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0xe132e7[_0x859f('0x53')]['UserId']=_0xe132e7['body'][_0x859f('0x5d')]||_0xe132e7[_0x859f('0x5e')]['id'];return db[_0x859f('0x38')][_0x859f('0x54')]({'where':{'id':_0xe132e7['params']['id'],'UserId':null},'include':[{'model':db[_0x859f('0x5f')],'as':_0x859f('0x60')}]})[_0x859f('0x31')](handleEntityNotFound(_0x595d3f,null))['then'](saveUpdates(_0xe132e7['body'],null))[_0x859f('0x31')](function(_0x48ac9b){if(_0x48ac9b){_0xac8386[_0x859f('0x22')]=_0x48ac9b[_0x859f('0x61')]({'plain':!![]});return db[_0x859f('0x62')][_0x859f('0x54')]({'where':{'id':_0x48ac9b[_0x859f('0x63')]}});}return null;})[_0x859f('0x31')](handleEntityNotFound(_0x595d3f,null))[_0x859f('0x31')](function(_0x1c7b48){if(_0x1c7b48){return _0x1c7b48[_0x859f('0x30')]({'UserId':_0xe132e7[_0x859f('0x53')][_0x859f('0x5d')],'read1stAt':_[_0x859f('0x64')](_0x1c7b48[_0x859f('0x65')])?moment()[_0x859f('0x5c')](_0x859f('0x66')):undefined});}return null;})['then'](function(_0x56fe0d){if(_0x56fe0d){_0xac8386['interaction']=_0x56fe0d['get']({'plain':!![]});interaction_log[_0x859f('0x1c')](_0x859f('0x67'),_0xe132e7[_0x859f('0x5e')]['id'],_0xe132e7[_0x859f('0x5e')][_0x859f('0x34')],_0xe132e7[_0x859f('0x5e')][_0x859f('0x68')],_0xac8386['interaction']['id'],_0xe132e7[_0x859f('0x53')]?JSON[_0x859f('0x1f')](_0xe132e7[_0x859f('0x53')]):_0x859f('0x69'));return respondWithRpcPromise(_0x859f('0x6a'),_0x859f('0x6b'),_0xac8386);}return null;})[_0x859f('0x31')](function(_0x334eb3){if(_0x334eb3){if(_0xe132e7[_0x859f('0x53')][_0x859f('0x6c')]){_0xac8386[_0x859f('0x22')][_0x859f('0x6d')]=util[_0x859f('0x5c')]('SIP/%s',_0xe132e7[_0x859f('0x5e')]['name']);_0xac8386[_0x859f('0x22')]['channel']=_0xac8386[_0x859f('0x6e')];_0xac8386[_0x859f('0x22')][_0x859f('0x6f')]=_0x859f('0x58');return respondWithRpcPromise(_0x859f('0x70'),'EventManager',{'event':'acceptmessage','message':_0xac8386[_0x859f('0x22')]},client9002)[_0x859f('0x31')](function(){return _0xac8386;});}return _0xac8386;}return null;})[_0x859f('0x31')](respondWithResult(_0x595d3f,null))['catch'](handleError(_0x595d3f,null));};var interaction_log=require('../../config/logger')(_0x859f('0x57'));exports[_0x859f('0x2f')]=function(_0x1a1be7,_0x2ca444,_0x4d8666){var _0x13c874={'agent':{},'channel':_0x859f('0x59')};if(_0x1a1be7['body']['id']){delete _0x1a1be7[_0x859f('0x53')]['id'];}_0x1a1be7['body'][_0x859f('0x5d')]=_0x1a1be7[_0x859f('0x53')]['UserId']||_0x1a1be7['user']['id'];_0x13c874['agent']['id']=_0x1a1be7['body'][_0x859f('0x5d')];return db[_0x859f('0x38')]['find']({'where':{'id':_0x1a1be7['params']['id'],'UserId':null}})['then'](handleEntityNotFound(_0x2ca444,null))['then'](function(_0x1ae75c){if(_0x1ae75c){_0x13c874[_0x859f('0x22')]=_0x1ae75c['get']({'plain':!![]});return db[_0x859f('0x62')]['find']({'where':{'id':_0x1ae75c[_0x859f('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x2ca444,null))[_0x859f('0x31')](function(_0x5b3777){if(_0x5b3777){_0x13c874[_0x859f('0x71')]=_0x5b3777[_0x859f('0x61')]({'plain':!![]});interaction_log[_0x859f('0x1c')](_0x859f('0x72'),_0x1a1be7[_0x859f('0x5e')]['id'],_0x1a1be7[_0x859f('0x5e')][_0x859f('0x34')],_0x1a1be7['user'][_0x859f('0x68')],_0x13c874[_0x859f('0x71')]['id'],_0x1a1be7[_0x859f('0x53')]?JSON[_0x859f('0x1f')](_0x1a1be7['body']):_0x859f('0x69'));return respondWithRpcPromise(_0x859f('0x73'),_0x859f('0x74'),_0x13c874);}return null;})[_0x859f('0x31')](function(_0x28a962){if(_0x28a962){_0x28a962[_0x859f('0x22')][_0x859f('0x6d')]=util[_0x859f('0x5c')](_0x859f('0x75'),_0x1a1be7[_0x859f('0x5e')][_0x859f('0x34')]);_0x28a962[_0x859f('0x22')][_0x859f('0x6e')]=_0x13c874[_0x859f('0x6e')];_0x28a962[_0x859f('0x22')][_0x859f('0x6f')]=_0x859f('0x2f');respondWithRpcPromise(_0x859f('0x70'),_0x859f('0x70'),{'event':_0x859f('0x76'),'message':_0x28a962[_0x859f('0x22')]},client9002);return _0x13c874;}return null;})[_0x859f('0x31')](respondWithResult(_0x2ca444,null))[_0x859f('0x51')](handleError(_0x2ca444,null));};exports[_0x859f('0x26')]=function(_0x9ed741,_0x3c4adf,_0x5a91c8){if(_0x9ed741[_0x859f('0x53')]['id']){delete _0x9ed741[_0x859f('0x53')]['id'];}var _0x5a0c14;return db['SmsMessage'][_0x859f('0x54')]({'where':{'id':_0x9ed741[_0x859f('0x4e')]['id']}})[_0x859f('0x31')](handleEntityNotFound(_0x3c4adf,null))['then'](function(_0x2771c0){if(_0x2771c0){_0x5a0c14=_0x2771c0;return db[_0x859f('0x77')]['find']({'where':{'id':_0x2771c0['SmsAccountId']}});}})['then'](handleEntityNotFound(_0x3c4adf,null))[_0x859f('0x31')](function(_0x15f25b){if(_0x15f25b){logger[_0x859f('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x859f('0x26'),'received\x20delivery\x20report\x20from',_0x15f25b[_0x859f('0x39')],util[_0x859f('0x78')](_0x9ed741[_0x859f('0x53')],{'showHidden':![],'depth':null}));switch(_0x15f25b[_0x859f('0x39')]){case _0x859f('0x79'):if(_0x9ed741[_0x859f('0x53')][_0x859f('0x7a')]&&_0x9ed741[_0x859f('0x53')][_0x859f('0x7a')]===_0x5a0c14[_0x859f('0x7b')]){return _0x5a0c14[_0x859f('0x30')]({'read':!![]});}else{logger[_0x859f('0x20')](_0x859f('0x7c'),_0x859f('0x26'),_0x859f('0x79'),util[_0x859f('0x78')](_0x9ed741['body'],{'showHidden':![],'depth':null}));}break;case _0x859f('0x7d'):if(_0x9ed741[_0x859f('0x53')]['MessageUUID']&&_0x9ed741[_0x859f('0x53')][_0x859f('0x7e')]===_0x5a0c14[_0x859f('0x7b')]&&_[_0x859f('0x7f')]([_0x859f('0x80'),_0x859f('0x81')],_0x9ed741[_0x859f('0x53')][_0x859f('0x82')])>=0x0){return _0x5a0c14['update']({'read':!![]});}else{logger[_0x859f('0x20')](_0x859f('0x7c'),_0x859f('0x26'),_0x859f('0x83'),util[_0x859f('0x78')](_0x9ed741['body'],{'showHidden':![],'depth':null}));}break;case'infobip':var _0x353432=_0x9ed741[_0x859f('0x53')][_0x859f('0x84')][0x0];if(_0x353432[_0x859f('0x26')][_0x859f('0x85')]==='DELIVERED'){return _0x5a0c14['update']({'read':!![]});}else{logger[_0x859f('0x20')](_0x859f('0x7c'),_0x859f('0x26'),_0x859f('0x86'),util['inspect'](_0x9ed741['body'],{'showHidden':![],'depth':null}));}break;}return _0x5a0c14;}})['then'](respondWithResult(_0x3c4adf,null))[_0x859f('0x51')](handleError(_0x3c4adf,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index 4b159ab..b60ea63 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 _0x728c=['remove','emit','hasOwnProperty','hook','events','../../mysqldb','SmsMessage','setMaxListeners','save','update'];(function(_0xbb2e27,_0x3fd9ab){var _0x57625b=function(_0x333c80){while(--_0x333c80){_0xbb2e27['push'](_0xbb2e27['shift']());}};_0x57625b(++_0x3fd9ab);}(_0x728c,0xd6));var _0xc728=function(_0x580800,_0xa0d602){_0x580800=_0x580800-0x0;var _0xf436d4=_0x728c[_0x580800];return _0xf436d4;};'use strict';var EventEmitter=require(_0xc728('0x0'));var SmsMessage=require(_0xc728('0x1'))['db'][_0xc728('0x2')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xc728('0x3')](0x0);var events={'afterCreate':_0xc728('0x4'),'afterUpdate':_0xc728('0x5'),'afterDestroy':_0xc728('0x6')};function emitEvent(_0x38b9c9){return function(_0x2f5e58,_0x21e408,_0x4bc14e){SmsMessageEvents[_0xc728('0x7')](_0x38b9c9+':'+_0x2f5e58['id'],_0x2f5e58);SmsMessageEvents[_0xc728('0x7')](_0x38b9c9,_0x2f5e58);_0x4bc14e(null);};}for(var e in events){if(events[_0xc728('0x8')](e)){var event=events[e];SmsMessage[_0xc728('0x9')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file +var _0x9fda=['update','emit','hasOwnProperty','exports','events','../../mysqldb','setMaxListeners','save'];(function(_0x5b34c0,_0x3ad403){var _0x242bd3=function(_0x51d0ce){while(--_0x51d0ce){_0x5b34c0['push'](_0x5b34c0['shift']());}};_0x242bd3(++_0x3ad403);}(_0x9fda,0x174));var _0xa9fd=function(_0x404b38,_0x4ebc51){_0x404b38=_0x404b38-0x0;var _0x820530=_0x9fda[_0x404b38];return _0x820530;};'use strict';var EventEmitter=require(_0xa9fd('0x0'));var SmsMessage=require(_0xa9fd('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0xa9fd('0x2')](0x0);var events={'afterCreate':_0xa9fd('0x3'),'afterUpdate':_0xa9fd('0x4'),'afterDestroy':'remove'};function emitEvent(_0x362ade){return function(_0x5e0ad2,_0x1204f2,_0x140b01){SmsMessageEvents[_0xa9fd('0x5')](_0x362ade+':'+_0x5e0ad2['id'],_0x5e0ad2);SmsMessageEvents[_0xa9fd('0x5')](_0x362ade,_0x5e0ad2);_0x140b01(null);};}for(var e in events){if(events[_0xa9fd('0x6')](e)){var event=events[e];SmsMessage['hook'](e,emitEvent(event));}}module[_0xa9fd('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 b88133e..158c2dc 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 _0x9c54=['Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','timestamp','keys','sort','length','createHash','md5','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','uuid','apiMessageId','clickatell','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','application/json','refid','status','finally','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','../../config/environment','./smsMessage.attributes','exports','define','SmsMessage','sms_messages','messageId','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','error','SmsAccount','find','SmsAccountId','type','twilio','phone','accountSid','authToken','create','remote','/status?token=','token','update','catch','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','split','sms','POST','user_key','session_key','total_sent','internal_order_id','read','inspect','connectel','senderString','requestid','deliveryReport','Missing\x20parameters:\x20authToken','xCALLY\x20Motion','format','%s:%s','https://rest.clicksend.com/v3/sms/send','Basic\x20%s','toString','base64','http_code','data','head','messages','clickSend','Missing\x20parameters:\x20username,\x20password','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','message_uuid'];(function(_0x53abe5,_0x33a9e5){var _0xc1c37e=function(_0xd53c6e){while(--_0xd53c6e){_0x53abe5['push'](_0x53abe5['shift']());}};_0xc1c37e(++_0x33a9e5);}(_0x9c54,0x186));var _0x49c5=function(_0xff3a51,_0x2bdb84){_0xff3a51=_0xff3a51-0x0;var _0x545ae2=_0x9c54[_0xff3a51];return _0x545ae2;};'use strict';var _=require(_0x49c5('0x0'));var util=require(_0x49c5('0x1'));var logger=require(_0x49c5('0x2'))(_0x49c5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x49c5('0x4'));var fs=require('fs');var path=require(_0x49c5('0x5'));var rimraf=require('rimraf');var config=require(_0x49c5('0x6'));var attributes=require(_0x49c5('0x7'));module[_0x49c5('0x8')]=function(_0x514249,_0x51c313){return _0x514249[_0x49c5('0x9')](_0x49c5('0xa'),attributes,{'tableName':_0x49c5('0xb'),'paranoid':![],'indexes':[{'name':_0x49c5('0xc'),'fields':[_0x49c5('0xc')]},{'name':'fti_sms_messages','fields':[_0x49c5('0xd')],'type':_0x49c5('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e35a4,_0x119975,_0x30109f){var _0x4c70a5=_0x514249[_0x49c5('0xf')];var _0x3151e2=_0x1e35a4[_0x49c5('0x10')]({'plain':!![]});if(_0x3151e2[_0x49c5('0x11')][_0x49c5('0x12')]()==='in'||_0x3151e2[_0x49c5('0x11')][_0x49c5('0x12')]()===_0x49c5('0x13')&&!_0x3151e2[_0x49c5('0x14')]&&!_[_0x49c5('0x15')](_0x3151e2[_0x49c5('0x16')])){_0x4c70a5[_0x49c5('0x17')][_0x49c5('0x18')]({'where':{'id':_0x3151e2[_0x49c5('0x19')]}})[_0x49c5('0x1a')](function(_0x462ea3){if(_0x462ea3){_0x462ea3['update']({'lastMsgAt':_0x3151e2['createdAt'],'lastMsgDirection':_0x3151e2['direction'][_0x49c5('0x12')]()});}})['catch'](function(_0x548a19){console[_0x49c5('0x1b')](_0x548a19);});}if(_0x3151e2[_0x49c5('0x11')]===_0x49c5('0x13')&&!_0x3151e2[_0x49c5('0x14')]){var _0x417776;_0x4c70a5[_0x49c5('0x1c')][_0x49c5('0x1d')]({'where':{'id':_0x3151e2[_0x49c5('0x1e')]},'raw':!![]})[_0x49c5('0x1a')](function(_0x524c17){_0x417776=_0x524c17;if(_0x417776&&_0x417776[_0x49c5('0x1f')]){switch(_0x417776[_0x49c5('0x1f')]){case _0x49c5('0x20'):var _0x29bdfc=require(_0x49c5('0x20'));if(_0x417776['accountSid']&&_0x417776['authToken']&&_0x417776[_0x49c5('0x21')]){var _0xf741a7=new _0x29bdfc(_0x417776[_0x49c5('0x22')],_0x417776[_0x49c5('0x23')]);_0xf741a7['messages'][_0x49c5('0x24')]({'body':_0x3151e2['body'],'to':_0x3151e2['phone'],'from':_0x417776['phone'],'statusCallback':_0x417776[_0x49c5('0x25')]+'/api/sms/messages/'+_0x3151e2['id']+_0x49c5('0x26')+_0x417776[_0x49c5('0x27')]})[_0x49c5('0x1a')](function(_0x422044){if(_0x422044['sid']){return _0x1e35a4[_0x49c5('0x28')]({'messageId':_0x422044['sid']});}})[_0x49c5('0x29')](function(_0x1c72a9){logger['error'](_0x49c5('0x2a'),'afterCreate',_0x49c5('0x20'),util['inspect'](_0x1c72a9,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),_0x49c5('0x20'),_0x49c5('0x2c'));}break;case _0x49c5('0x2d'):var _0x3ee1e7=_0x49c5('0x2e');if(_0x417776[_0x49c5('0x2f')]&&_0x417776[_0x49c5('0x30')]){var _0x5513ab={'recipient':[_0x3151e2['phone']],'message':_0x3151e2[_0x49c5('0xd')],'message_type':_0x417776['smsMethod']};if(_0x417776[_0x49c5('0x31')]&&_0x417776[_0x49c5('0x31')]!=='SI'){_0x5513ab[_0x49c5('0x32')]=_0x417776['phone'];}var _0x2226de={'url':_0x3ee1e7+'login?username='+_0x417776[_0x49c5('0x2f')]+'&password='+_0x417776[_0x49c5('0x30')],'method':'GET'};rp(_0x2226de)[_0x49c5('0x1a')](function(_0x56a3cd){var _0x2abc7a=_0x56a3cd[_0x49c5('0x33')](';');var _0x123d94={'user_key':_0x2abc7a[0x0],'session_key':_0x2abc7a[0x1]};_0x2226de={'url':_0x3ee1e7+_0x49c5('0x34'),'method':_0x49c5('0x35'),'headers':{'user_key':_0x123d94[_0x49c5('0x36')],'Session_key':_0x123d94[_0x49c5('0x37')]},'json':!![],'body':_0x5513ab};return rp(_0x2226de);})['then'](function(_0x2fe163){if(_0x2fe163[_0x49c5('0x38')]>=0x1){var _0xe568ce={'messageId':_0x2fe163[_0x49c5('0x39')]};if(_0x417776[_0x49c5('0x31')]!=='GP'||!_0x417776['deliveryReport']){_0xe568ce[_0x49c5('0x3a')]=!![];}return _0x1e35a4[_0x49c5('0x28')](_0xe568ce);}else{return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),'afterCreate',_0x49c5('0x2d'),util[_0x49c5('0x3b')](_0x2fe163,{'showHidden':![],'depth':null}));}})[_0x49c5('0x29')](function(_0x5cccea){return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x2d'),util[_0x49c5('0x3b')](_0x5cccea,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x2d'),'Missing\x20parameters:\x20username,\x20password');}break;case _0x49c5('0x3c'):if(_0x417776['authToken']){var _0x299691={'recipient':_0x3151e2['phone'],'message':_0x3151e2[_0x49c5('0xd')],'sender':_0x417776[_0x49c5('0x3d')]||_0x417776[_0x49c5('0x21')],'authorization':_0x417776[_0x49c5('0x23')]};var _0x119975={'method':'POST','uri':'https://smsapi.connectel.se/api/send/','body':_0x299691,'json':!![]};rp(_0x119975)[_0x49c5('0x1a')](function(_0x3a4f12){var _0x3954a0={'messageId':_0x3a4f12[_0x49c5('0x3e')]};if(!_0x417776[_0x49c5('0x3f')]){_0x3954a0[_0x49c5('0x3a')]=!![];}return _0x1e35a4['update'](_0x3954a0);})['catch'](function(_0x319a10){logger[_0x49c5('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),_0x49c5('0x3c'),util[_0x49c5('0x3b')](_0x319a10,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),'afterCreate',_0x49c5('0x3c'),_0x49c5('0x40'));}break;case'clicksend':if(_0x417776[_0x49c5('0x2f')]&&_0x417776[_0x49c5('0x30')]){var _0x299691={'messages':[{'source':_0x49c5('0x41'),'to':_0x3151e2[_0x49c5('0x21')],'body':_0x3151e2[_0x49c5('0xd')],'from':_0x417776[_0x49c5('0x3d')]||_0x417776['phone']}]};var _0x1cfc9b=util[_0x49c5('0x42')](_0x49c5('0x43'),_0x417776[_0x49c5('0x2f')],_0x417776[_0x49c5('0x30')]);var _0x119975={'method':_0x49c5('0x35'),'uri':_0x49c5('0x44'),'body':_0x299691,'headers':{'Authorization':util[_0x49c5('0x42')](_0x49c5('0x45'),new Buffer(_0x1cfc9b)[_0x49c5('0x46')](_0x49c5('0x47')))},'json':!![]};rp(_0x119975)[_0x49c5('0x1a')](function(_0x1f8e41){if(_0x1f8e41[_0x49c5('0x48')]>=0xc8&&_0x1f8e41[_0x49c5('0x48')]<=0xce){if(_0x1f8e41[_0x49c5('0x49')]&&_0x1f8e41['data']['queued_count']>0x0){var _0x3de511=_[_0x49c5('0x4a')](_0x1f8e41[_0x49c5('0x49')][_0x49c5('0x4b')]);var _0x1cfcd3={'messageId':_0x3de511['message_id']};if(!_0x417776[_0x49c5('0x3f')]){_0x1cfcd3[_0x49c5('0x3a')]=!![];}return _0x1e35a4['update'](_0x1cfcd3);}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),'clickSend',util[_0x49c5('0x3b')](_0x1f8e41,{'showHidden':![],'depth':null}));}}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x4c'),util['inspect'](_0x1f8e41,{'showHidden':![],'depth':null}));}})[_0x49c5('0x29')](function(_0x38dca9){logger['error'](_0x49c5('0x2a'),_0x49c5('0x2b'),'clickSend',util[_0x49c5('0x3b')](_0x38dca9,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x4c'),_0x49c5('0x4d'));}break;case _0x49c5('0x4e'):if(_0x417776[_0x49c5('0x4f')]&&_0x417776[_0x49c5('0x23')]){var _0x299691={'dst':_0x3151e2[_0x49c5('0x21')],'text':_0x3151e2['body'],'src':_0x417776[_0x49c5('0x3d')]||_0x417776[_0x49c5('0x21')],'url':_0x417776[_0x49c5('0x25')]+'/api/sms/messages/'+_0x3151e2['id']+_0x49c5('0x26')+_0x417776[_0x49c5('0x27')]};var _0x1cfc9b=util['format']('%s:%s',_0x417776[_0x49c5('0x4f')],_0x417776[_0x49c5('0x23')]);var _0x119975={'method':_0x49c5('0x35'),'uri':util['format'](_0x49c5('0x50'),_0x417776[_0x49c5('0x4f')]),'body':_0x299691,'headers':{'Authorization':util['format'](_0x49c5('0x45'),new Buffer(_0x1cfc9b)['toString'](_0x49c5('0x47')))},'json':!![]};rp(_0x119975)[_0x49c5('0x1a')](function(_0x3b1628){var _0x431d04={'messageId':_0x3b1628[_0x49c5('0x51')][0x0]};return _0x1e35a4[_0x49c5('0x28')](_0x431d04);})[_0x49c5('0x29')](function(_0x4bca92){logger[_0x49c5('0x1b')](_0x49c5('0x2a'),'afterCreate',_0x49c5('0x4e'),util[_0x49c5('0x3b')](_0x4bca92,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),'afterCreate',_0x49c5('0x4e'),_0x49c5('0x52'));}break;case _0x49c5('0x53'):if(_0x417776[_0x49c5('0x2f')]&&_0x417776[_0x49c5('0x30')]){if(_0x417776[_0x49c5('0x54')]){var _0x448ff1={'method':_0x49c5('0x35'),'uri':_0x417776['baseUrl']+_0x49c5('0x55'),'body':{'username':_0x417776[_0x49c5('0x2f')],'password':_0x417776['password']},'json':!![]};return rp(_0x448ff1)[_0x49c5('0x1a')](function(_0x5019b0){var _0x576d16={'method':_0x49c5('0x35'),'uri':_0x417776[_0x49c5('0x54')]+_0x49c5('0x56'),'body':{'messages':[{'from':_0x417776['phone'],'destinations':[{'to':_0x3151e2['phone']}],'text':_0x3151e2[_0x49c5('0xd')],'notifyUrl':_0x417776[_0x49c5('0x25')]+'/api/sms/messages/'+_0x3151e2['id']+_0x49c5('0x26')+_0x417776[_0x49c5('0x27')],'notifyContentType':'application/json','callbackData':_0x417776[_0x49c5('0x21')]+';'+_0x3151e2[_0x49c5('0xd')]}]},'headers':{'Authorization':_0x49c5('0x57')+_0x5019b0[_0x49c5('0x27')]},'json':!![]};return rp(_0x576d16)[_0x49c5('0x1a')](function(_0x1bed98){if(_0x1bed98['messages']){var _0x12eaa2={'messageId':_0x1bed98[_0x49c5('0x4b')][0x0][_0x49c5('0xc')]};if(!_0x417776[_0x49c5('0x3f')]){_0x12eaa2[_0x49c5('0x3a')]=!![];}return _0x1e35a4['update'](_0x12eaa2);}else{return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x53'),util[_0x49c5('0x3b')](_0x1bed98,{'showHidden':![],'depth':null}));}});})[_0x49c5('0x29')](function(_0x11d82c){return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),'infobip',util['inspect'](_0x11d82c,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x53'),_0x49c5('0x58'));}}else{logger[_0x49c5('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),_0x49c5('0x53'),_0x49c5('0x4d'));}break;case _0x49c5('0x59'):var _0x44d312=require('crypto');if(_0x417776[_0x49c5('0x5a')]){var _0x39ad56={};_0x39ad56[_0x49c5('0x5b')]=_0x417776[_0x49c5('0x2f')];_0x39ad56['phone']=_0x3151e2[_0x49c5('0x21')];_0x39ad56[_0x49c5('0x32')]=_0x417776[_0x49c5('0x21')];_0x39ad56[_0x49c5('0x5c')]=_0x3151e2[_0x49c5('0xd')];_0x39ad56[_0x49c5('0x5d')]=+new Date();var _0x576891='';var _0x4bf684='';var _0x55926b=Object[_0x49c5('0x5e')](_0x39ad56);_0x55926b[_0x49c5('0x5f')]();for(var _0xe67fb7=0x0;_0xe67fb7<_0x55926b[_0x49c5('0x60')];_0xe67fb7++){if(_0x576891!=''){_0x576891+='&';}_0x576891+=_0x55926b[_0xe67fb7]+'='+encodeURIComponent(_0x39ad56[_0x55926b[_0xe67fb7]]);_0x4bf684+=_0x39ad56[_0x55926b[_0xe67fb7]];}_0x4bf684+=_0x417776[_0x49c5('0x5a')];_0x4bf684=_0x44d312[_0x49c5('0x61')](_0x49c5('0x62'))[_0x49c5('0x28')](_0x4bf684)['digest']('hex');if(_0x576891!==''){_0x576891+='&';}_0x576891+=_0x49c5('0x63')+_0x4bf684;var _0x2226de={'method':'GET','uri':_0x417776[_0x49c5('0x54')]+_0x49c5('0x64')+_0x576891,'json':!![]};return rp(_0x2226de)['then'](function(_0x339896){var _0x4b56f5=Object[_0x49c5('0x5e')](_0x339896);if(_0x339896[_0x4b56f5[0x0]]['error']&&parseInt(_0x339896[_0x4b56f5[0x0]][_0x49c5('0x1b')])===0x0){var _0x398e97={'messageId':_0x339896[_0x4b56f5[0x0]][_0x49c5('0x65')]};if(!_0x417776[_0x49c5('0x3f')]){_0x398e97['read']=!![];}return _0x1e35a4['update'](_0x398e97);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),_0x49c5('0x59'),util[_0x49c5('0x3b')](_0x339896[_0x49c5('0x1b')],{'showHidden':![],'depth':null}));}})[_0x49c5('0x29')](function(_0x1847e2){return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x59'),util['inspect'](_0x1847e2,{'showHidden':![],'depth':null}));});}else{logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),'csc',_0x49c5('0x66'));}break;case'clickatell':if(_0x417776[_0x49c5('0x5a')]){var _0x395a78={'method':_0x49c5('0x35'),'uri':'https://platform.clickatell.com/messages','headers':{'Authorization':_0x417776[_0x49c5('0x5a')]},'body':{'content':_0x3151e2[_0x49c5('0xd')],'to':[_0x3151e2['phone']],'from':_0x417776[_0x49c5('0x21')],'binary':![],'clientMessageId':_0x49c5('0x67'),'charset':'UTF-8'},'json':!![]};rp(_0x395a78)[_0x49c5('0x1a')](function(_0x1bf9bd){if(!_0x1bf9bd[_0x49c5('0x1b')]){var _0x40375e={'messageId':_0x1bf9bd[_0x49c5('0x4b')][0x0][_0x49c5('0x68')]};if(!_0x417776[_0x49c5('0x3f')]){_0x40375e[_0x49c5('0x3a')]=!![];}return _0x1e35a4[_0x49c5('0x28')](_0x40375e);}else{return logger[_0x49c5('0x1b')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),_0x49c5('0x69'),util[_0x49c5('0x3b')](_0x1bf9bd['error'],{'showHidden':![],'depth':null}));}})[_0x49c5('0x29')](function(_0x2aff6d){return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x49c5('0x2b'),'clickatell',util[_0x49c5('0x3b')](_0x2aff6d,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x69'),_0x49c5('0x66'));}break;case _0x49c5('0x6a'):if(_0x417776[_0x49c5('0x5a')]){var _0x13f2d2={};var _0x2226de={'method':'POST','uri':_0x49c5('0x6b'),'headers':{'Authorization':_0x49c5('0x6c')+_0x417776[_0x49c5('0x5a')],'Content-Type':'application/json'},'body':{'from':_0x417776['phone'],'to':_0x3151e2[_0x49c5('0x21')],'text':_0x3151e2[_0x49c5('0xd')]},'json':!![]};return rp(_0x2226de)[_0x49c5('0x1a')](function(_0x2eebba){if(_0x2eebba[_0x49c5('0x6d')]==0xca){_0x13f2d2[_0x49c5('0x6e')]=_0x2eebba;var _0x2596e3={'method':_0x49c5('0x35'),'uri':_0x49c5('0x6f'),'headers':{'Authorization':_0x49c5('0x6c')+_0x417776[_0x49c5('0x5a')],'Content-Type':_0x49c5('0x70')},'body':{'refid':_0x13f2d2[_0x49c5('0x6e')][_0x49c5('0x71')]},'json':!![]};return rp(_0x2596e3)[_0x49c5('0x1a')](function(_0x287170){_0x13f2d2[_0x49c5('0x72')]=_0x287170;var _0x59b1ea={'messageId':_0x13f2d2[_0x49c5('0x6e')][_0x49c5('0x71')],'read':!![]};return _0x1e35a4[_0x49c5('0x28')](_0x59b1ea);});}else{return logger['error'](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x6a'),util[_0x49c5('0x3b')](_0x2eebba,{'showHidden':![],'depth':null}));}})['catch'](function(_0x476e77){return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x6a'),util['inspect'](_0x476e77,{'showHidden':![],'depth':null}));});}else{return logger[_0x49c5('0x1b')](_0x49c5('0x2a'),_0x49c5('0x2b'),_0x49c5('0x6a'),'Token\x20not\x20received');}break;}}})[_0x49c5('0x73')](function(){_0x30109f();});}else{_0x30109f();}}},'charset':_0x49c5('0x74'),'collate':_0x49c5('0x75')});}; \ No newline at end of file +var _0x070f=['bluebird','request-promise','rimraf','../../config/environment','./smsMessage.attributes','SmsMessage','sms_messages','messageId','fti_sms_messages','body','FULLTEXT','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','update','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','authToken','phone','accountSid','messages','create','remote','/api/sms/messages/','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','inspect','afterCreate','skebby','https://api.skebby.it/API/v1.0/REST/','username','password','smsMethod','sender','login?username=','GET','split','sms','POST','user_key','total_sent','internal_order_id','deliveryReport','read','Missing\x20parameters:\x20username,\x20password','connectel','https://smsapi.connectel.se/api/send/','requestid','Missing\x20parameters:\x20authToken','clicksend','senderString','https://rest.clicksend.com/v3/sms/send','format','toString','http_code','data','queued_count','head','message_id','clickSend','authId','/status?token=','%s:%s','https://api.plivo.com/v1/Account/%s/Message/','Basic\x20%s','base64','message_uuid','plivo','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl','/auth/1/session','/sms/2/text/advanced','application/json','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','apiKey','login','text','keys','sort','length','md5','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','lodash','api','moment'];(function(_0x40ff4f,_0x55809e){var _0x5ebf4e=function(_0xa287f1){while(--_0xa287f1){_0x40ff4f['push'](_0x40ff4f['shift']());}};_0x5ebf4e(++_0x55809e);}(_0x070f,0xf3));var _0xf070=function(_0x533339,_0x5e5142){_0x533339=_0x533339-0x0;var _0x55b402=_0x070f[_0x533339];return _0x55b402;};'use strict';var _=require(_0xf070('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xf070('0x1'));var moment=require(_0xf070('0x2'));var BPromise=require(_0xf070('0x3'));var rp=require(_0xf070('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xf070('0x5'));var config=require(_0xf070('0x6'));var attributes=require(_0xf070('0x7'));module['exports']=function(_0x370f5,_0x421ca4){return _0x370f5['define'](_0xf070('0x8'),attributes,{'tableName':_0xf070('0x9'),'paranoid':![],'indexes':[{'name':_0xf070('0xa'),'fields':[_0xf070('0xa')]},{'name':_0xf070('0xb'),'fields':[_0xf070('0xc')],'type':_0xf070('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2cb055,_0x2f4bc6,_0x2da786){var _0x3eaf82=_0x370f5[_0xf070('0xe')];var _0x296fe3=_0x2cb055[_0xf070('0xf')]({'plain':!![]});if(_0x296fe3[_0xf070('0x10')][_0xf070('0x11')]()==='in'||_0x296fe3[_0xf070('0x10')][_0xf070('0x11')]()===_0xf070('0x12')&&!_0x296fe3[_0xf070('0x13')]&&!_[_0xf070('0x14')](_0x296fe3[_0xf070('0x15')])){_0x3eaf82[_0xf070('0x16')][_0xf070('0x17')]({'where':{'id':_0x296fe3[_0xf070('0x18')]}})[_0xf070('0x19')](function(_0x1183e8){if(_0x1183e8){_0x1183e8[_0xf070('0x1a')]({'lastMsgAt':_0x296fe3[_0xf070('0x1b')],'lastMsgDirection':_0x296fe3[_0xf070('0x10')][_0xf070('0x11')]()});}})[_0xf070('0x1c')](function(_0xa62867){console[_0xf070('0x1d')](_0xa62867);});}if(_0x296fe3[_0xf070('0x10')]===_0xf070('0x12')&&!_0x296fe3[_0xf070('0x13')]){var _0x445786;_0x3eaf82[_0xf070('0x1e')][_0xf070('0x1f')]({'where':{'id':_0x296fe3[_0xf070('0x20')]},'raw':!![]})[_0xf070('0x19')](function(_0x49267b){_0x445786=_0x49267b;if(_0x445786&&_0x445786[_0xf070('0x21')]){switch(_0x445786[_0xf070('0x21')]){case _0xf070('0x22'):var _0x386684=require('twilio');if(_0x445786['accountSid']&&_0x445786[_0xf070('0x23')]&&_0x445786[_0xf070('0x24')]){var _0x5a8110=new _0x386684(_0x445786[_0xf070('0x25')],_0x445786[_0xf070('0x23')]);_0x5a8110[_0xf070('0x26')][_0xf070('0x27')]({'body':_0x296fe3[_0xf070('0xc')],'to':_0x296fe3[_0xf070('0x24')],'from':_0x445786['phone'],'statusCallback':_0x445786[_0xf070('0x28')]+_0xf070('0x29')+_0x296fe3['id']+'/status?token='+_0x445786[_0xf070('0x2a')]})['then'](function(_0x7adeed){if(_0x7adeed[_0xf070('0x2b')]){return _0x2cb055[_0xf070('0x1a')]({'messageId':_0x7adeed[_0xf070('0x2b')]});}})[_0xf070('0x1c')](function(_0x156057){logger[_0xf070('0x1d')](_0xf070('0x2c'),'afterCreate',_0xf070('0x22'),util[_0xf070('0x2d')](_0x156057,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x22'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xf070('0x2f'):var _0x4d8654=_0xf070('0x30');if(_0x445786[_0xf070('0x31')]&&_0x445786[_0xf070('0x32')]){var _0x181eb0={'recipient':[_0x296fe3['phone']],'message':_0x296fe3[_0xf070('0xc')],'message_type':_0x445786[_0xf070('0x33')]};if(_0x445786[_0xf070('0x33')]&&_0x445786['smsMethod']!=='SI'){_0x181eb0[_0xf070('0x34')]=_0x445786[_0xf070('0x24')];}var _0x43c191={'url':_0x4d8654+_0xf070('0x35')+_0x445786['username']+'&password='+_0x445786['password'],'method':_0xf070('0x36')};rp(_0x43c191)[_0xf070('0x19')](function(_0x3d6f80){var _0x189fe8=_0x3d6f80[_0xf070('0x37')](';');var _0x4be5b4={'user_key':_0x189fe8[0x0],'session_key':_0x189fe8[0x1]};_0x43c191={'url':_0x4d8654+_0xf070('0x38'),'method':_0xf070('0x39'),'headers':{'user_key':_0x4be5b4[_0xf070('0x3a')],'Session_key':_0x4be5b4['session_key']},'json':!![],'body':_0x181eb0};return rp(_0x43c191);})[_0xf070('0x19')](function(_0x41208d){if(_0x41208d[_0xf070('0x3b')]>=0x1){var _0x30a22b={'messageId':_0x41208d[_0xf070('0x3c')]};if(_0x445786[_0xf070('0x33')]!=='GP'||!_0x445786[_0xf070('0x3d')]){_0x30a22b[_0xf070('0x3e')]=!![];}return _0x2cb055[_0xf070('0x1a')](_0x30a22b);}else{return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x2f'),util[_0xf070('0x2d')](_0x41208d,{'showHidden':![],'depth':null}));}})[_0xf070('0x1c')](function(_0x44a165){return logger[_0xf070('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf070('0x2e'),_0xf070('0x2f'),util[_0xf070('0x2d')](_0x44a165,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x2f'),_0xf070('0x3f'));}break;case _0xf070('0x40'):if(_0x445786[_0xf070('0x23')]){var _0x23d1ba={'recipient':_0x296fe3[_0xf070('0x24')],'message':_0x296fe3[_0xf070('0xc')],'sender':_0x445786['senderString']||_0x445786[_0xf070('0x24')],'authorization':_0x445786[_0xf070('0x23')]};var _0x2f4bc6={'method':_0xf070('0x39'),'uri':_0xf070('0x41'),'body':_0x23d1ba,'json':!![]};rp(_0x2f4bc6)[_0xf070('0x19')](function(_0x3a3654){var _0x9cf1d9={'messageId':_0x3a3654[_0xf070('0x42')]};if(!_0x445786[_0xf070('0x3d')]){_0x9cf1d9['read']=!![];}return _0x2cb055[_0xf070('0x1a')](_0x9cf1d9);})['catch'](function(_0x46a0a6){logger['error'](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x40'),util[_0xf070('0x2d')](_0x46a0a6,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','connectel',_0xf070('0x43'));}break;case _0xf070('0x44'):if(_0x445786[_0xf070('0x31')]&&_0x445786[_0xf070('0x32')]){var _0x23d1ba={'messages':[{'source':'xCALLY\x20Motion','to':_0x296fe3[_0xf070('0x24')],'body':_0x296fe3['body'],'from':_0x445786[_0xf070('0x45')]||_0x445786[_0xf070('0x24')]}]};var _0x54d556=util['format']('%s:%s',_0x445786[_0xf070('0x31')],_0x445786[_0xf070('0x32')]);var _0x2f4bc6={'method':'POST','uri':_0xf070('0x46'),'body':_0x23d1ba,'headers':{'Authorization':util[_0xf070('0x47')]('Basic\x20%s',new Buffer(_0x54d556)[_0xf070('0x48')]('base64'))},'json':!![]};rp(_0x2f4bc6)['then'](function(_0x232a28){if(_0x232a28[_0xf070('0x49')]>=0xc8&&_0x232a28['http_code']<=0xce){if(_0x232a28['data']&&_0x232a28[_0xf070('0x4a')][_0xf070('0x4b')]>0x0){var _0xdbf51b=_[_0xf070('0x4c')](_0x232a28[_0xf070('0x4a')][_0xf070('0x26')]);var _0x1f91f4={'messageId':_0xdbf51b[_0xf070('0x4d')]};if(!_0x445786[_0xf070('0x3d')]){_0x1f91f4[_0xf070('0x3e')]=!![];}return _0x2cb055[_0xf070('0x1a')](_0x1f91f4);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf070('0x2e'),'clickSend',util[_0xf070('0x2d')](_0x232a28,{'showHidden':![],'depth':null}));}}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x4e'),util['inspect'](_0x232a28,{'showHidden':![],'depth':null}));}})[_0xf070('0x1c')](function(_0x349ef3){logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x4e'),util[_0xf070('0x2d')](_0x349ef3,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xf070('0x2e'),_0xf070('0x4e'),'Missing\x20parameters:\x20username,\x20password');}break;case'plivo':if(_0x445786[_0xf070('0x4f')]&&_0x445786[_0xf070('0x23')]){var _0x23d1ba={'dst':_0x296fe3[_0xf070('0x24')],'text':_0x296fe3[_0xf070('0xc')],'src':_0x445786['senderString']||_0x445786['phone'],'url':_0x445786[_0xf070('0x28')]+_0xf070('0x29')+_0x296fe3['id']+_0xf070('0x50')+_0x445786['token']};var _0x54d556=util[_0xf070('0x47')](_0xf070('0x51'),_0x445786[_0xf070('0x4f')],_0x445786['authToken']);var _0x2f4bc6={'method':'POST','uri':util[_0xf070('0x47')](_0xf070('0x52'),_0x445786[_0xf070('0x4f')]),'body':_0x23d1ba,'headers':{'Authorization':util[_0xf070('0x47')](_0xf070('0x53'),new Buffer(_0x54d556)['toString'](_0xf070('0x54')))},'json':!![]};rp(_0x2f4bc6)[_0xf070('0x19')](function(_0xb4559){var _0x38f613={'messageId':_0xb4559[_0xf070('0x55')][0x0]};return _0x2cb055[_0xf070('0x1a')](_0x38f613);})['catch'](function(_0x5542ef){logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x56'),util[_0xf070('0x2d')](_0x5542ef,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf070('0x56'),_0xf070('0x57'));}break;case _0xf070('0x58'):if(_0x445786[_0xf070('0x31')]&&_0x445786[_0xf070('0x32')]){if(_0x445786[_0xf070('0x59')]){var _0x4b70b9={'method':_0xf070('0x39'),'uri':_0x445786[_0xf070('0x59')]+_0xf070('0x5a'),'body':{'username':_0x445786[_0xf070('0x31')],'password':_0x445786[_0xf070('0x32')]},'json':!![]};return rp(_0x4b70b9)['then'](function(_0x2ce6e8){var _0x5a0a06={'method':_0xf070('0x39'),'uri':_0x445786[_0xf070('0x59')]+_0xf070('0x5b'),'body':{'messages':[{'from':_0x445786[_0xf070('0x24')],'destinations':[{'to':_0x296fe3[_0xf070('0x24')]}],'text':_0x296fe3[_0xf070('0xc')],'notifyUrl':_0x445786['remote']+_0xf070('0x29')+_0x296fe3['id']+_0xf070('0x50')+_0x445786['token'],'notifyContentType':_0xf070('0x5c'),'callbackData':_0x445786[_0xf070('0x24')]+';'+_0x296fe3[_0xf070('0xc')]}]},'headers':{'Authorization':_0xf070('0x5d')+_0x2ce6e8[_0xf070('0x2a')]},'json':!![]};return rp(_0x5a0a06)[_0xf070('0x19')](function(_0x4d2411){if(_0x4d2411['messages']){var _0x552dab={'messageId':_0x4d2411[_0xf070('0x26')][0x0][_0xf070('0xa')]};if(!_0x445786[_0xf070('0x3d')]){_0x552dab['read']=!![];}return _0x2cb055['update'](_0x552dab);}else{return logger[_0xf070('0x1d')](_0xf070('0x2c'),'afterCreate',_0xf070('0x58'),util['inspect'](_0x4d2411,{'showHidden':![],'depth':null}));}});})[_0xf070('0x1c')](function(_0x59e8bc){return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x58'),util[_0xf070('0x2d')](_0x59e8bc,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),'infobip',_0xf070('0x5e'));}}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x58'),_0xf070('0x3f'));}break;case _0xf070('0x5f'):var _0x4eef86=require('crypto');if(_0x445786[_0xf070('0x60')]){var _0x2fa89a={};_0x2fa89a[_0xf070('0x61')]=_0x445786[_0xf070('0x31')];_0x2fa89a['phone']=_0x296fe3[_0xf070('0x24')];_0x2fa89a[_0xf070('0x34')]=_0x445786[_0xf070('0x24')];_0x2fa89a[_0xf070('0x62')]=_0x296fe3[_0xf070('0xc')];_0x2fa89a['timestamp']=+new Date();var _0x53c4b9='';var _0x2ab511='';var _0xa02564=Object[_0xf070('0x63')](_0x2fa89a);_0xa02564[_0xf070('0x64')]();for(var _0x559351=0x0;_0x559351<_0xa02564[_0xf070('0x65')];_0x559351++){if(_0x53c4b9!=''){_0x53c4b9+='&';}_0x53c4b9+=_0xa02564[_0x559351]+'='+encodeURIComponent(_0x2fa89a[_0xa02564[_0x559351]]);_0x2ab511+=_0x2fa89a[_0xa02564[_0x559351]];}_0x2ab511+=_0x445786[_0xf070('0x60')];_0x2ab511=_0x4eef86['createHash'](_0xf070('0x66'))['update'](_0x2ab511)['digest'](_0xf070('0x67'));if(_0x53c4b9!==''){_0x53c4b9+='&';}_0x53c4b9+=_0xf070('0x68')+_0x2ab511;var _0x43c191={'method':_0xf070('0x36'),'uri':_0x445786['baseUrl']+_0xf070('0x69')+_0x53c4b9,'json':!![]};return rp(_0x43c191)[_0xf070('0x19')](function(_0x26eaa4){var _0x55f9fb=Object['keys'](_0x26eaa4);if(_0x26eaa4[_0x55f9fb[0x0]][_0xf070('0x1d')]&&parseInt(_0x26eaa4[_0x55f9fb[0x0]][_0xf070('0x1d')])===0x0){var _0x320fd6={'messageId':_0x26eaa4[_0x55f9fb[0x0]][_0xf070('0x6a')]};if(!_0x445786[_0xf070('0x3d')]){_0x320fd6['read']=!![];}return _0x2cb055['update'](_0x320fd6);}else{return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x5f'),util[_0xf070('0x2d')](_0x26eaa4['error'],{'showHidden':![],'depth':null}));}})[_0xf070('0x1c')](function(_0x4bc14a){return logger[_0xf070('0x1d')](_0xf070('0x2c'),'afterCreate',_0xf070('0x5f'),util[_0xf070('0x2d')](_0x4bc14a,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),'afterCreate',_0xf070('0x5f'),_0xf070('0x6b'));}break;case _0xf070('0x6c'):if(_0x445786[_0xf070('0x60')]){var _0x447b12={'method':_0xf070('0x39'),'uri':_0xf070('0x6d'),'headers':{'Authorization':_0x445786['apiKey']},'body':{'content':_0x296fe3[_0xf070('0xc')],'to':[_0x296fe3[_0xf070('0x24')]],'from':_0x445786[_0xf070('0x24')],'binary':![],'clientMessageId':_0xf070('0x6e'),'charset':_0xf070('0x6f')},'json':!![]};rp(_0x447b12)['then'](function(_0x28da52){if(!_0x28da52[_0xf070('0x1d')]){var _0x773232={'messageId':_0x28da52['messages'][0x0]['apiMessageId']};if(!_0x445786[_0xf070('0x3d')]){_0x773232[_0xf070('0x3e')]=!![];}return _0x2cb055[_0xf070('0x1a')](_0x773232);}else{return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),'clickatell',util['inspect'](_0x28da52[_0xf070('0x1d')],{'showHidden':![],'depth':null}));}})[_0xf070('0x1c')](function(_0x13717e){return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x6c'),util[_0xf070('0x2d')](_0x13717e,{'showHidden':![],'depth':null}));});}else{logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),'clickatell',_0xf070('0x6b'));}break;case _0xf070('0x70'):if(_0x445786[_0xf070('0x60')]){var _0x31377e={};var _0x43c191={'method':_0xf070('0x39'),'uri':_0xf070('0x71'),'headers':{'Authorization':_0xf070('0x72')+_0x445786['apiKey'],'Content-Type':'application/json'},'body':{'from':_0x445786[_0xf070('0x24')],'to':_0x296fe3[_0xf070('0x24')],'text':_0x296fe3['body']},'json':!![]};return rp(_0x43c191)[_0xf070('0x19')](function(_0x42950e){if(_0x42950e[_0xf070('0x73')]==0xca){_0x31377e[_0xf070('0x74')]=_0x42950e;var _0x20ef34={'method':_0xf070('0x39'),'uri':_0xf070('0x75'),'headers':{'Authorization':'Bearer\x20'+_0x445786['apiKey'],'Content-Type':_0xf070('0x5c')},'body':{'refid':_0x31377e['message'][_0xf070('0x76')]},'json':!![]};return rp(_0x20ef34)['then'](function(_0x1f2c68){_0x31377e['status']=_0x1f2c68;var _0x254d58={'messageId':_0x31377e[_0xf070('0x74')][_0xf070('0x76')],'read':!![]};return _0x2cb055[_0xf070('0x1a')](_0x254d58);});}else{return logger[_0xf070('0x1d')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xf070('0x70'),util[_0xf070('0x2d')](_0x42950e,{'showHidden':![],'depth':null}));}})[_0xf070('0x1c')](function(_0x5493f5){return logger[_0xf070('0x1d')](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x70'),util[_0xf070('0x2d')](_0x5493f5,{'showHidden':![],'depth':null}));});}else{return logger['error'](_0xf070('0x2c'),_0xf070('0x2e'),_0xf070('0x70'),_0xf070('0x77'));}break;}}})[_0xf070('0x78')](function(){_0x2da786();});}else{_0x2da786();}}},'charset':_0xf070('0x79'),'collate':_0xf070('0x7a')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 7915563..854a9dd 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 _0xda2d=['body','options','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./smsMessage.socket','register','request','then','info','SmsMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','SmsMessage,\x20%s,\x20%s','result','catch','CreateSmsMessage','SmsMessage'];(function(_0x4914e2,_0x48be8f){var _0x2dcd07=function(_0x1a2565){while(--_0x1a2565){_0x4914e2['push'](_0x4914e2['shift']());}};_0x2dcd07(++_0x48be8f);}(_0xda2d,0x102));var _0xdda2=function(_0x5820c1,_0x31b2aa){_0x5820c1=_0x5820c1-0x0;var _0x1d43bf=_0xda2d[_0x5820c1];return _0x1d43bf;};'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});config[_0xdda2('0xa')]=_[_0xdda2('0xb')](config[_0xdda2('0xa')],{'host':_0xdda2('0xc'),'port':0x18eb});var socket=require(_0xdda2('0xd'))(new Redis(config['redis']));require(_0xdda2('0xe'))[_0xdda2('0xf')](socket);function respondWithRpcPromise(_0x4df6b8,_0x1c11b2,_0x2f3454){return new BPromise(function(_0x42d990,_0x346119){return client[_0xdda2('0x10')](_0x4df6b8,_0x2f3454)[_0xdda2('0x11')](function(_0x26fe81){logger[_0xdda2('0x12')]('SmsMessage,\x20%s,\x20%s',_0x1c11b2,'request\x20sent');logger['debug'](_0xdda2('0x13'),_0x1c11b2,_0xdda2('0x14'),JSON[_0xdda2('0x15')](_0x26fe81));if(_0x26fe81[_0xdda2('0x16')]){if(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x17')]===0x1f4){logger[_0xdda2('0x16')]('SmsMessage,\x20%s,\x20%s',_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x346119(_0x26fe81[_0xdda2('0x16')][_0xdda2('0x18')]);}logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x26fe81[_0xdda2('0x16')]['message']);return _0x42d990(_0x26fe81['error'][_0xdda2('0x18')]);}else{logger['info'](_0xdda2('0x19'),_0x1c11b2,_0xdda2('0x14'));_0x42d990(_0x26fe81[_0xdda2('0x1a')][_0xdda2('0x18')]);}})[_0xdda2('0x1b')](function(_0x17015f){logger[_0xdda2('0x16')](_0xdda2('0x19'),_0x1c11b2,_0x17015f);_0x346119(_0x17015f);});});}exports[_0xdda2('0x1c')]=function(_0x337b0b){var _0x312ef1=this;return new Promise(function(_0x6fdede,_0x4eed30){return db[_0xdda2('0x1d')]['create'](_0x337b0b[_0xdda2('0x1e')],{'raw':_0x337b0b[_0xdda2('0x1f')]?_0x337b0b[_0xdda2('0x1f')]['raw']===undefined?!![]:![]:!![]})[_0xdda2('0x11')](function(_0x5a9bb8){logger[_0xdda2('0x12')](_0xdda2('0x1c'),_0x337b0b);logger['debug'](_0xdda2('0x1c'),_0x337b0b,JSON[_0xdda2('0x15')](_0x5a9bb8));_0x6fdede(_0x5a9bb8);})[_0xdda2('0x1b')](function(_0x13b0f3){logger[_0xdda2('0x16')]('CreateSmsMessage',_0x13b0f3[_0xdda2('0x18')],_0x337b0b);_0x4eed30(_0x312ef1[_0xdda2('0x16')](0x1f4,_0x13b0f3[_0xdda2('0x18')]));});});}; \ No newline at end of file +var _0x2032=['register','request','SmsMessage,\x20%s,\x20%s','request\x20sent','error','message','info','result','CreateSmsMessage','create','options','then','stringify','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0x2032,0xd9));var _0x2203=function(_0x30f6d5,_0x560077){_0x30f6d5=_0x30f6d5-0x0;var _0xc2b695=_0x2032[_0x30f6d5];return _0xc2b695;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var moment=require(_0x2203('0x1'));var BPromise=require(_0x2203('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x2203('0x3'));var db=require(_0x2203('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x2203('0x5'))(_0x2203('0x6'));var config=require(_0x2203('0x7'));var jayson=require(_0x2203('0x8'));var client=jayson[_0x2203('0x9')][_0x2203('0xa')]({'port':0x232a});config[_0x2203('0xb')]=_[_0x2203('0xc')](config[_0x2203('0xb')],{'host':_0x2203('0xd'),'port':0x18eb});var socket=require(_0x2203('0xe'))(new Redis(config['redis']));require('./smsMessage.socket')[_0x2203('0xf')](socket);function respondWithRpcPromise(_0x549908,_0x27081c,_0x2972f3){return new BPromise(function(_0x6339c4,_0x5b19df){return client[_0x2203('0x10')](_0x549908,_0x2972f3)['then'](function(_0x3f690a){logger['info'](_0x2203('0x11'),_0x27081c,_0x2203('0x12'));logger['debug']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x27081c,'request\x20sent',JSON['stringify'](_0x3f690a));if(_0x3f690a['error']){if(_0x3f690a[_0x2203('0x13')]['code']===0x1f4){logger['error'](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x5b19df(_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);}logger[_0x2203('0x13')](_0x2203('0x11'),_0x27081c,_0x3f690a[_0x2203('0x13')][_0x2203('0x14')]);return _0x6339c4(_0x3f690a[_0x2203('0x13')]['message']);}else{logger[_0x2203('0x15')](_0x2203('0x11'),_0x27081c,'request\x20sent');_0x6339c4(_0x3f690a[_0x2203('0x16')][_0x2203('0x14')]);}})['catch'](function(_0x30c6f7){logger['error'](_0x2203('0x11'),_0x27081c,_0x30c6f7);_0x5b19df(_0x30c6f7);});});}exports[_0x2203('0x17')]=function(_0x3c8c34){var _0x3b4034=this;return new Promise(function(_0x15cb1a,_0x449039){return db['SmsMessage'][_0x2203('0x18')](_0x3c8c34['body'],{'raw':_0x3c8c34['options']?_0x3c8c34[_0x2203('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x2203('0x1a')](function(_0x5bfe61){logger['info'](_0x2203('0x17'),_0x3c8c34);logger['debug']('CreateSmsMessage',_0x3c8c34,JSON[_0x2203('0x1b')](_0x5bfe61));_0x15cb1a(_0x5bfe61);})[_0x2203('0x1c')](function(_0x21f930){logger[_0x2203('0x13')](_0x2203('0x17'),_0x21f930[_0x2203('0x14')],_0x3c8c34);_0x449039(_0x3b4034[_0x2203('0x13')](0x1f4,_0x21f930[_0x2203('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index cfdf5a6..7d447cc 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 _0x2e1a=['remove','update','emit','register','smsMessage:','./smsMessage.events','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x2e1a,0x9f));var _0xa2e1=function(_0x590a38,_0x2bc65c){_0x590a38=_0x590a38-0x0;var _0xf36626=_0x2e1a[_0x590a38];return _0xf36626;};'use strict';var SmsMessageEvents=require(_0xa2e1('0x0'));var events=[_0xa2e1('0x1'),_0xa2e1('0x2'),_0xa2e1('0x3')];function createListener(_0x3d6405,_0x95a0b2){return function(_0x1cd8e9){_0x95a0b2[_0xa2e1('0x4')](_0x3d6405,_0x1cd8e9);};}function removeListener(_0x41d19b,_0x2b06db){return function(){SmsMessageEvents['removeListener'](_0x41d19b,_0x2b06db);};}exports[_0xa2e1('0x5')]=function(_0xcc648e){for(var _0x1fcd5f=0x0,_0x25770d=events['length'];_0x1fcd5f<_0x25770d;_0x1fcd5f++){var _0x5e802c=events[_0x1fcd5f];var _0x529bcf=createListener(_0xa2e1('0x6')+_0x5e802c,_0xcc648e);SmsMessageEvents['on'](_0x5e802c,_0x529bcf);}}; \ No newline at end of file +var _0x40d0=['./smsMessage.events','save','update','removeListener','register'];(function(_0xa6cc5c,_0x239c99){var _0x44803d=function(_0x515b6e){while(--_0x515b6e){_0xa6cc5c['push'](_0xa6cc5c['shift']());}};_0x44803d(++_0x239c99);}(_0x40d0,0x1e0));var _0x040d=function(_0x3572b3,_0x593ffe){_0x3572b3=_0x3572b3-0x0;var _0x55e4aa=_0x40d0[_0x3572b3];return _0x55e4aa;};'use strict';var SmsMessageEvents=require(_0x040d('0x0'));var events=[_0x040d('0x1'),'remove',_0x040d('0x2')];function createListener(_0x1a6610,_0x3a631d){return function(_0x372027){_0x3a631d['emit'](_0x1a6610,_0x372027);};}function removeListener(_0x526ba2,_0x537146){return function(){SmsMessageEvents[_0x040d('0x3')](_0x526ba2,_0x537146);};}exports[_0x040d('0x4')]=function(_0x459c66){for(var _0x3ed33c=0x0,_0x4e4330=events['length'];_0x3ed33c<_0x4e4330;_0x3ed33c++){var _0x476a70=events[_0x3ed33c];var _0x5035b4=createListener('smsMessage:'+_0x476a70,_0x459c66);SmsMessageEvents['on'](_0x476a70,_0x5035b4);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 659e3b3..3846560 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 _0x5581=['express','Router','../../components/auth/service','../../components/interaction/service','./smsQueue.controller','get','index','isAuthenticated','describe','/:id','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create','addTeams','addAgents','update','destroy','delete','removeAgents','exports','multer','path','connect-timeout'];(function(_0x51267e,_0x4cf4ae){var _0x21d246=function(_0x5b9d95){while(--_0x5b9d95){_0x51267e['push'](_0x51267e['shift']());}};_0x21d246(++_0x4cf4ae);}(_0x5581,0x115));var _0x1558=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x5581[_0x8c43de];return _0xa6591b;};'use strict';var multer=require(_0x1558('0x0'));var util=require('util');var path=require(_0x1558('0x1'));var timeout=require(_0x1558('0x2'));var express=require(_0x1558('0x3'));var router=express[_0x1558('0x4')]();var auth=require(_0x1558('0x5'));var interaction=require(_0x1558('0x6'));var config=require('../../config/environment');var controller=require(_0x1558('0x7'));router[_0x1558('0x8')]('/',auth['isAuthenticated'](),controller[_0x1558('0x9')]);router[_0x1558('0x8')]('/describe',auth[_0x1558('0xa')](),controller[_0x1558('0xb')]);router[_0x1558('0x8')](_0x1558('0xc'),auth[_0x1558('0xa')](),controller['show']);router[_0x1558('0x8')](_0x1558('0xd'),auth[_0x1558('0xa')](),controller[_0x1558('0xe')]);router[_0x1558('0x8')](_0x1558('0xf'),auth[_0x1558('0xa')](),controller[_0x1558('0x10')]);router[_0x1558('0x8')](_0x1558('0x11'),auth[_0x1558('0xa')](),controller[_0x1558('0x12')]);router[_0x1558('0x13')]('/',auth['isAuthenticated'](),controller[_0x1558('0x14')]);router[_0x1558('0x13')](_0x1558('0xf'),auth[_0x1558('0xa')](),controller[_0x1558('0x15')]);router[_0x1558('0x13')](_0x1558('0x11'),auth[_0x1558('0xa')](),controller[_0x1558('0x16')]);router['put'](_0x1558('0xc'),auth[_0x1558('0xa')](),controller[_0x1558('0x17')]);router['delete'](_0x1558('0xc'),auth[_0x1558('0xa')](),controller[_0x1558('0x18')]);router[_0x1558('0x19')](_0x1558('0xf'),auth['isAuthenticated'](),controller['removeTeams']);router[_0x1558('0x19')](_0x1558('0x11'),auth[_0x1558('0xa')](),controller[_0x1558('0x1a')]);module[_0x1558('0x1b')]=router; \ No newline at end of file +var _0xd5da=['removeTeams','delete','removeAgents','multer','util','connect-timeout','express','Router','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','getTeams','/:id/users','post','create','/:id/teams','addTeams','/:id','destroy'];(function(_0x2182a2,_0xc89987){var _0x3e9fa3=function(_0xfddb34){while(--_0xfddb34){_0x2182a2['push'](_0x2182a2['shift']());}};_0x3e9fa3(++_0xc89987);}(_0xd5da,0x9f));var _0xad5d=function(_0x2f26b8,_0x18bbc6){_0x2f26b8=_0x2f26b8-0x0;var _0x9754a=_0xd5da[_0x2f26b8];return _0x9754a;};'use strict';var multer=require(_0xad5d('0x0'));var util=require(_0xad5d('0x1'));var path=require('path');var timeout=require(_0xad5d('0x2'));var express=require(_0xad5d('0x3'));var router=express[_0xad5d('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xad5d('0x5'));var config=require('../../config/environment');var controller=require(_0xad5d('0x6'));router[_0xad5d('0x7')]('/',auth[_0xad5d('0x8')](),controller[_0xad5d('0x9')]);router[_0xad5d('0x7')](_0xad5d('0xa'),auth[_0xad5d('0x8')](),controller[_0xad5d('0xb')]);router[_0xad5d('0x7')]('/:id',auth[_0xad5d('0x8')](),controller[_0xad5d('0xc')]);router['get'](_0xad5d('0xd'),auth['isAuthenticated'](),controller[_0xad5d('0xe')]);router[_0xad5d('0x7')]('/:id/teams',auth[_0xad5d('0x8')](),controller[_0xad5d('0xf')]);router['get'](_0xad5d('0x10'),auth[_0xad5d('0x8')](),controller['getAgents']);router[_0xad5d('0x11')]('/',auth['isAuthenticated'](),controller[_0xad5d('0x12')]);router['post'](_0xad5d('0x13'),auth['isAuthenticated'](),controller[_0xad5d('0x14')]);router['post'](_0xad5d('0x10'),auth[_0xad5d('0x8')](),controller['addAgents']);router['put'](_0xad5d('0x15'),auth['isAuthenticated'](),controller['update']);router['delete'](_0xad5d('0x15'),auth[_0xad5d('0x8')](),controller[_0xad5d('0x16')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0xad5d('0x17')]);router[_0xad5d('0x18')]('/:id/users',auth['isAuthenticated'](),controller[_0xad5d('0x19')]);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 3ba5a16..9799916 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 _0xc157=['beepall','sequelize','exports','STRING','name','INTEGER','ENUM','rrmemory'];(function(_0x1c289a,_0x277fe7){var _0x28d68e=function(_0x2f8e98){while(--_0x2f8e98){_0x1c289a['push'](_0x1c289a['shift']());}};_0x28d68e(++_0x277fe7);}(_0xc157,0xb1));var _0x7c15=function(_0xa253f6,_0x4fac87){_0xa253f6=_0xa253f6-0x0;var _0x4bab67=_0xc157[_0xa253f6];return _0x4bab67;};'use strict';var Sequelize=require(_0x7c15('0x0'));module[_0x7c15('0x1')]={'name':{'type':Sequelize[_0x7c15('0x2')],'unique':_0x7c15('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x7c15('0x2')]},'timeout':{'type':Sequelize[_0x7c15('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x7c15('0x5')](_0x7c15('0x6'),_0x7c15('0x7'),'roundrobin')}}; \ No newline at end of file +var _0xcc42=['STRING','name','INTEGER','ENUM','roundrobin','sequelize'];(function(_0x112a75,_0x534def){var _0x40e759=function(_0x306260){while(--_0x306260){_0x112a75['push'](_0x112a75['shift']());}};_0x40e759(++_0x534def);}(_0xcc42,0x1f1));var _0x2cc4=function(_0x16e57d,_0x2cb7ba){_0x16e57d=_0x16e57d-0x0;var _0x40239c=_0xcc42[_0x16e57d];return _0x40239c;};'use strict';var Sequelize=require(_0x2cc4('0x0'));module['exports']={'name':{'type':Sequelize[_0x2cc4('0x1')],'unique':_0x2cc4('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0x2cc4('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x2cc4('0x4')]('rrmemory','beepall',_0x2cc4('0x5'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index 9d07221..0890801 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 _0xda2d=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','SmsQueues','then','sendStatus','error','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','SmsQueue','include','findAll','rows','show','params','rawAttributes','includeAll','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','getMembers','UserSmsQueue','hasOwnProperty','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','format','findOne','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','emit','userSmsQueue:save','field','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x1f2204,_0x2c6d0f){var _0x35439e=function(_0x4ef2e3){while(--_0x4ef2e3){_0x1f2204['push'](_0x1f2204['shift']());}};_0x35439e(++_0x2c6d0f);}(_0xda2d,0x102));var _0xdda2=function(_0x57a900,_0x588dfe){_0x57a900=_0x57a900-0x0;var _0x484c85=_0xda2d[_0x57a900];return _0x484c85;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdda2('0x19')],{'host':_0xdda2('0x1a'),'port':0x18eb});var socket=require(_0xdda2('0x1b'))(new Redis(config[_0xdda2('0x19')]));require(_0xdda2('0x1c'))[_0xdda2('0x1d')](socket);function respondWithStatusCode(_0x3490f1,_0x4df902){_0x4df902=_0x4df902||0xcc;return function(_0x79c6d4){if(_0x79c6d4){return _0x3490f1['sendStatus'](_0x4df902);}return _0x3490f1[_0xdda2('0x1e')](_0x4df902)[_0xdda2('0x1f')]();};}function respondWithResult(_0x3553d5,_0x457764){_0x457764=_0x457764||0xc8;return function(_0x1922b1){if(_0x1922b1){return _0x3553d5['status'](_0x457764)['json'](_0x1922b1);}};}function respondWithFilteredResult(_0x43f67b,_0x518c6d){return function(_0x1a5192){if(_0x1a5192){var _0x1a3b35=_0x1a5192[_0xdda2('0x20')],_0x335fb5=_0x518c6d[_0xdda2('0x21')],_0x2b6ee8=_0x518c6d[_0xdda2('0x21')]+_0x518c6d[_0xdda2('0x22')],_0x8d44b7;if(_0x2b6ee8>=_0x1a3b35){_0x2b6ee8=_0x1a3b35;_0x8d44b7=0xc8;}else{_0x8d44b7=0xce;}_0x43f67b[_0xdda2('0x1e')](_0x8d44b7);return _0x43f67b[_0xdda2('0x23')](_0xdda2('0x24'),_0x335fb5+'-'+_0x2b6ee8+'/'+_0x1a3b35)['json'](_0x1a5192);}return null;};}function patchUpdates(_0x41fe7d){return function(_0x5dfce7){try{jsonpatch[_0xdda2('0x25')](_0x5dfce7,_0x41fe7d,!![]);}catch(_0x1a4db4){return BPromise[_0xdda2('0x26')](_0x1a4db4);}return _0x5dfce7['save']();};}function saveUpdates(_0x347ee6,_0x5a9bb8){return function(_0x425489){if(_0x425489){return _0x425489[_0xdda2('0x27')](_0x347ee6)['then'](function(_0x144f1e){return _0x144f1e;});}return null;};}function removeEntity(_0xfda248,_0x2528d7){return function(_0x13b0f3){if(_0x13b0f3){return _0x13b0f3[_0xdda2('0x28')]()['then'](function(){var _0x38cdf=_0x13b0f3[_0xdda2('0x29')]({'plain':!![]});var _0x2391a5=_0xdda2('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2391a5,'resourceId':_0x38cdf['id']}})[_0xdda2('0x2b')](function(){return _0x13b0f3;});})[_0xdda2('0x2b')](function(){_0xfda248[_0xdda2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90d919,_0x5d26ae){return function(_0x2e755b){if(!_0x2e755b){_0x90d919[_0xdda2('0x2c')](0x194);}return _0x2e755b;};}function handleError(_0xe16ec7,_0x91b41a){_0x91b41a=_0x91b41a||0x1f4;return function(_0x4bb8a4){logger[_0xdda2('0x2d')](_0x4bb8a4[_0xdda2('0x2e')]);if(_0x4bb8a4['name']){delete _0x4bb8a4[_0xdda2('0x2f')];}_0xe16ec7[_0xdda2('0x1e')](_0x91b41a)[_0xdda2('0x30')](_0x4bb8a4);};}exports[_0xdda2('0x31')]=function(_0x5540e5,_0x129eba){var _0x5e107f={},_0x4b19b7={},_0x1ca9f3={'count':0x0,'rows':[]};var _0x5edf7e=_[_0xdda2('0x32')](db['SmsQueue']['rawAttributes'],function(_0x510b7b){return{'name':_0x510b7b[_0xdda2('0x33')],'type':_0x510b7b['type'][_0xdda2('0x34')]};});_0x4b19b7['model']=_['map'](_0x5edf7e,'name');_0x4b19b7[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x5540e5[_0xdda2('0x35')]);_0x4b19b7[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x4b19b7[_0xdda2('0x39')],_0x4b19b7[_0xdda2('0x35')]);_0x5e107f[_0xdda2('0x3a')]=_[_0xdda2('0x38')](_0x4b19b7[_0xdda2('0x39')],qs['fields'](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x5e107f[_0xdda2('0x3a')]=_0x5e107f[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x5e107f[_0xdda2('0x3a')]:_0x4b19b7[_0xdda2('0x39')];if(!_0x5540e5['query']['hasOwnProperty'](_0xdda2('0x3d'))){_0x5e107f[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x5540e5['query']['limit']);_0x5e107f[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x21')]);}_0x5e107f[_0xdda2('0x3e')]=qs['sort'](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x5e107f['where']=qs['filters'](_[_0xdda2('0x40')](_0x5540e5[_0xdda2('0x35')],_0x4b19b7[_0xdda2('0x37')]));if(_0x5540e5[_0xdda2('0x35')][_0xdda2('0x41')]){_0x5e107f['where']=_[_0xdda2('0x42')](_0x5e107f[_0xdda2('0x43')],{'$or':_[_0xdda2('0x32')](_0x5edf7e,function(_0x1a7262){if(_0x1a7262['type']!=='VIRTUAL'){var _0x203972={};_0x203972[_0x1a7262[_0xdda2('0x2f')]]={'$like':'%'+_0x5540e5[_0xdda2('0x35')]['filter']+'%'};return _0x203972;}})});}_0x5e107f=_[_0xdda2('0x42')]({},_0x5e107f,_0x5540e5['options']);var _0x33a378={'where':_0x5e107f['where']};return db[_0xdda2('0x44')][_0xdda2('0x20')](_0x33a378)[_0xdda2('0x2b')](function(_0x2eec64){_0x1ca9f3['count']=_0x2eec64;if(_0x5540e5[_0xdda2('0x35')]['includeAll']){_0x5e107f[_0xdda2('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xdda2('0x46')](_0x5e107f);})[_0xdda2('0x2b')](function(_0x153acf){_0x1ca9f3[_0xdda2('0x47')]=_0x153acf;return _0x1ca9f3;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x129eba,_0x5e107f))['catch'](handleError(_0x129eba,null));};exports[_0xdda2('0x48')]=function(_0x15a616,_0x54735b){var _0x2caced={'raw':!![],'where':{'id':_0x15a616[_0xdda2('0x49')]['id']}},_0x546847={};_0x546847[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x44')][_0xdda2('0x4a')]);_0x546847[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x15a616[_0xdda2('0x35')]);_0x546847[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x546847[_0xdda2('0x39')],_0x546847[_0xdda2('0x35')]);_0x2caced[_0xdda2('0x3a')]=_['intersection'](_0x546847['model'],qs['fields'](_0x15a616[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x2caced['attributes']=_0x2caced[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x2caced[_0xdda2('0x3a')]:_0x546847['model'];if(_0x15a616[_0xdda2('0x35')][_0xdda2('0x4b')]){_0x2caced['include']=[{'all':!![]}];}_0x2caced=_['merge']({},_0x2caced,_0x15a616[_0xdda2('0x4c')]);return db['SmsQueue'][_0xdda2('0x4d')](_0x2caced)['then'](handleEntityNotFound(_0x54735b,null))[_0xdda2('0x2b')](respondWithResult(_0x54735b,null))[_0xdda2('0x4e')](handleError(_0x54735b,null));};exports['create']=function(_0x585665,_0x3506ff){return db[_0xdda2('0x44')][_0xdda2('0x4f')](_0x585665[_0xdda2('0x50')],{})['then'](function(_0x1edbc6){var _0x3bba94=_0x585665[_0xdda2('0x51')][_0xdda2('0x29')]({'plain':!![]});if(!_0x3bba94)throw new Error(_0xdda2('0x52'));if(_0x3bba94['role']===_0xdda2('0x51')){var _0x40b610=_0x1edbc6['get']({'plain':!![]});var _0x3eb3c1=_0xdda2('0x2a');return db[_0xdda2('0x53')][_0xdda2('0x4d')]({'where':{'name':_0x3eb3c1,'userProfileId':_0x3bba94[_0xdda2('0x54')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x4b6519){if(_0x4b6519&&_0x4b6519[_0xdda2('0x55')]===0x0){return db['UserProfileResource'][_0xdda2('0x4f')]({'name':_0x40b610['name'],'resourceId':_0x40b610['id'],'type':_0x4b6519[_0xdda2('0x2f')],'sectionId':_0x4b6519['id']},{})['then'](function(){return _0x1edbc6;});}else{return _0x1edbc6;}})[_0xdda2('0x4e')](function(_0x11c8b1){logger[_0xdda2('0x2d')](_0xdda2('0x56'),_0x11c8b1);throw _0x11c8b1;});}return _0x1edbc6;})[_0xdda2('0x2b')](respondWithResult(_0x3506ff,0xc9))[_0xdda2('0x4e')](handleError(_0x3506ff,null));};exports[_0xdda2('0x27')]=function(_0x40655d,_0x538ebb){if(_0x40655d[_0xdda2('0x50')]['id']){delete _0x40655d[_0xdda2('0x50')]['id'];}return db[_0xdda2('0x44')]['find']({'where':{'id':_0x40655d[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x538ebb,null))['then'](saveUpdates(_0x40655d[_0xdda2('0x50')],null))['then'](respondWithResult(_0x538ebb,null))[_0xdda2('0x4e')](handleError(_0x538ebb,null));};exports[_0xdda2('0x28')]=function(_0x378704,_0xbfab73){return db[_0xdda2('0x44')]['find']({'where':{'id':_0x378704['params']['id']}})['then'](handleEntityNotFound(_0xbfab73,null))[_0xdda2('0x2b')](removeEntity(_0xbfab73,null))[_0xdda2('0x4e')](handleError(_0xbfab73,null));};exports['describe']=function(_0x44637d,_0x126977){return db[_0xdda2('0x44')]['describe']()[_0xdda2('0x2b')](respondWithResult(_0x126977,null))[_0xdda2('0x4e')](handleError(_0x126977,null));};exports[_0xdda2('0x57')]=function(_0x58ae15,_0x2b2c1d,_0x4495e5){var _0x7eb83f={'raw':!![],'where':{}},_0x25c9a9={},_0x5d8602;return db[_0xdda2('0x44')]['findOne']({'where':{'id':_0x58ae15['params']['id']}})['then'](handleEntityNotFound(_0x2b2c1d,null))[_0xdda2('0x2b')](function(_0x35b38a){if(_0x35b38a){_0x5d8602=_0x35b38a[_0xdda2('0x29')]({'plain':!![]});_0x25c9a9[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x58')][_0xdda2('0x4a')]);_0x25c9a9[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x58ae15[_0xdda2('0x35')]);_0x25c9a9[_0xdda2('0x37')]=_['intersection'](_0x25c9a9[_0xdda2('0x39')],_0x25c9a9[_0xdda2('0x35')]);_0x7eb83f[_0xdda2('0x3a')]=_[_0xdda2('0x38')](_0x25c9a9[_0xdda2('0x39')],qs[_0xdda2('0x3b')](_0x58ae15[_0xdda2('0x35')]['fields']));_0x7eb83f[_0xdda2('0x3a')]=_0x7eb83f[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x7eb83f[_0xdda2('0x3a')]:_0x25c9a9[_0xdda2('0x39')];if(!_0x58ae15['query'][_0xdda2('0x59')](_0xdda2('0x3d'))){_0x7eb83f[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x58ae15[_0xdda2('0x35')]['limit']);_0x7eb83f[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x58ae15[_0xdda2('0x35')][_0xdda2('0x21')]);}_0x7eb83f[_0xdda2('0x3e')]=qs['sort'](_0x58ae15[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x7eb83f[_0xdda2('0x43')]=qs['filters'](_[_0xdda2('0x40')](_0x58ae15['query'],_0x25c9a9[_0xdda2('0x37')]));_0x7eb83f[_0xdda2('0x43')][_0xdda2('0x5a')]=_0x35b38a['id'];if(_0x58ae15['query'][_0xdda2('0x41')]){_0x7eb83f[_0xdda2('0x43')]=_['merge'](_0x7eb83f[_0xdda2('0x43')],{'$or':_['map'](_0x7eb83f[_0xdda2('0x3a')],function(_0xc97cb1){var _0x354fb9={};_0x354fb9[_0xc97cb1]={'$like':'%'+_0x58ae15[_0xdda2('0x35')][_0xdda2('0x41')]+'%'};return _0x354fb9;})});}_0x7eb83f=_['merge']({},_0x7eb83f,_0x58ae15['options']);return db[_0xdda2('0x58')][_0xdda2('0x46')](_0x7eb83f);}})['then'](function(_0x53e9e0){if(_0x53e9e0){return db[_0xdda2('0x5b')]['findAndCountAll']({'where':{'id':_[_0xdda2('0x32')](_0x53e9e0,_0xdda2('0x5c')),'role':'agent'},'attributes':['id',_0xdda2('0x2f'),_0xdda2('0x5d'),_0xdda2('0x5e'),_0xdda2('0x5f')]});}})[_0xdda2('0x2b')](function(_0x37f5cd){if(_0x37f5cd){return{'count':_0x37f5cd['count'],'rows':_[_0xdda2('0x32')](_0x37f5cd[_0xdda2('0x47')],function(_0x2dbaad){return{'membername':_0x2dbaad['name'],'UserId':_0x2dbaad['id'],'queue_name':_0x5d8602[_0xdda2('0x2f')],'SmsQueueId':_0x5d8602['id'],'interface':util[_0xdda2('0x60')]('%s/%s','SIP',_0x2dbaad[_0xdda2('0x2f')]),'penalty':0x0,'paused':_0x2dbaad[_0xdda2('0x5d')],'createdAt':_0x2dbaad[_0xdda2('0x5f')],'updatedAt':_0x2dbaad['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2b2c1d,_0x7eb83f))[_0xdda2('0x4e')](handleError(_0x2b2c1d,null));};exports['getTeams']=function(_0x18edab,_0x150dcd,_0x19d92e){var _0x12fd67={};var _0x597b09={};var _0x29006f;var _0x58d1ad;return db['SmsQueue'][_0xdda2('0x61')]({'where':{'id':_0x18edab['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x150dcd,null))[_0xdda2('0x2b')](function(_0x15f581){if(_0x15f581){_0x29006f=_0x15f581;_0x597b09[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x62')][_0xdda2('0x4a')]);_0x597b09[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x18edab['query']);_0x597b09[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x597b09[_0xdda2('0x39')],_0x597b09[_0xdda2('0x35')]);_0x12fd67['attributes']=_[_0xdda2('0x38')](_0x597b09[_0xdda2('0x39')],qs[_0xdda2('0x3b')](_0x18edab[_0xdda2('0x35')]['fields']));_0x12fd67['attributes']=_0x12fd67[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x12fd67[_0xdda2('0x3a')]:_0x597b09[_0xdda2('0x39')];_0x12fd67['order']=qs[_0xdda2('0x3f')](_0x18edab[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x12fd67[_0xdda2('0x43')]=qs[_0xdda2('0x37')](_[_0xdda2('0x40')](_0x18edab[_0xdda2('0x35')],_0x597b09[_0xdda2('0x37')]));if(_0x18edab[_0xdda2('0x35')][_0xdda2('0x41')]){_0x12fd67[_0xdda2('0x43')]=_[_0xdda2('0x42')](_0x12fd67[_0xdda2('0x43')],{'$or':_[_0xdda2('0x32')](_0x12fd67[_0xdda2('0x3a')],function(_0x4b9481){var _0x221f72={};_0x221f72[_0x4b9481]={'$like':'%'+_0x18edab[_0xdda2('0x35')]['filter']+'%'};return _0x221f72;})});}_0x12fd67=_['merge']({},_0x12fd67,_0x18edab[_0xdda2('0x4c')]);return _0x29006f[_0xdda2('0x63')](_0x12fd67);}})[_0xdda2('0x2b')](function(_0xdc4cdc){if(_0xdc4cdc){_0x58d1ad=_0xdc4cdc[_0xdda2('0x3c')];if(!_0x18edab[_0xdda2('0x35')]['hasOwnProperty'](_0xdda2('0x3d'))){_0x12fd67[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x18edab[_0xdda2('0x35')]['limit']);_0x12fd67[_0xdda2('0x21')]=qs['offset'](_0x18edab[_0xdda2('0x35')][_0xdda2('0x21')]);}return _0x29006f['getTeams'](_0x12fd67);}})[_0xdda2('0x2b')](function(_0x3d50fc){if(_0x3d50fc){return _0x3d50fc?{'count':_0x58d1ad,'rows':_0x3d50fc}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x150dcd,null))[_0xdda2('0x4e')](handleError(_0x150dcd,null));};exports[_0xdda2('0x64')]=function(_0x313138,_0x1c6ef1,_0x460c2e){var _0x3a375d=_0x313138[_0xdda2('0x50')][_0xdda2('0x65')];return db['Team'][_0xdda2('0x46')]({'where':{'id':_0x3a375d},'attributes':['id'],'include':[{'model':db[_0xdda2('0x5b')],'as':_0xdda2('0x66'),'attributes':['id',_0xdda2('0x2f'),_0xdda2('0x67'),'voicePause',_0xdda2('0x68')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x47b4e1){if(_0x47b4e1){var _0x319af4=_[_0xdda2('0x69')](_0x47b4e1,function(_0x4bde71){var _0x5b24bc=_0x4bde71[_0xdda2('0x29')]({'plain':!![]});return _0x5b24bc[_0xdda2('0x66')];});return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x313138[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](function(_0x525e93){return db[_0xdda2('0x6a')][_0xdda2('0x6b')](function(_0x5cca40){return _0x525e93[_0xdda2('0x64')](_0x3a375d,{'transaction':_0x5cca40})[_0xdda2('0x2b')](function(){return BPromise['each'](_0x319af4,function(_0x2da4a7){return db[_0xdda2('0x58')][_0xdda2('0x6c')]({'where':{'UserId':_0x2da4a7['id'],'SmsQueueId':_0x313138['params']['id']},'transaction':_0x5cca40});});})[_0xdda2('0x2b')](function(){_0x319af4['forEach'](function(_0x45e549){socket[_0xdda2('0x6d')](_0xdda2('0x6e'),{'UserId':_0x45e549['id'],'SmsQueueId':_0x525e93['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x1c6ef1,null))['catch'](handleError(_0x1c6ef1,null));};exports['removeTeams']=function(_0x2b8c0c,_0x11c1c8,_0x4ac607){return db[_0xdda2('0x62')][_0xdda2('0x46')]({'where':{'id':_0x2b8c0c[_0xdda2('0x35')][_0xdda2('0x65')]},'attributes':['id'],'include':[{'model':db[_0xdda2('0x5b')],'as':_0xdda2('0x66'),'attributes':['id'],'raw':!![]}]})[_0xdda2('0x2b')](handleEntityNotFound(_0x11c1c8,null))[_0xdda2('0x2b')](function(_0x3046c1){var _0x26e599=_[_0xdda2('0x32')](_0x3046c1,'id');var _0x1527e0=[];var _0x528185=[];var _0x5a28b0=squel['select']();_0x5a28b0[_0xdda2('0x6f')]('tq.TeamId')[_0xdda2('0x70')](_0xdda2('0x71'),'tq')[_0xdda2('0x72')](_0xdda2('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x43')](_0xdda2('0x74'),_0x2b8c0c[_0xdda2('0x49')]['id']);for(var _0x49d5a6=0x0;_0x49d5a6<_0x3046c1[_0xdda2('0x3c')];_0x49d5a6+=0x1){let _0x86235b=_0x3046c1[_0x49d5a6];for(var _0x2588f5=0x0;_0x2588f5<_0x86235b['Agents']['length'];_0x2588f5+=0x1){let _0x37aeda=_0x86235b[_0xdda2('0x66')][_0x2588f5];var _0x42df5b=_0x5a28b0['clone']();_0x42df5b[_0xdda2('0x43')](_0xdda2('0x75'),_0x37aeda['id']);_0x528185[_0xdda2('0x76')](db[_0xdda2('0x6a')][_0xdda2('0x35')](_0x42df5b[_0xdda2('0x77')](),{'type':db[_0xdda2('0x6a')]['QueryTypes'][_0xdda2('0x78')]})[_0xdda2('0x2b')](function(_0x43e405){if(_0x43e405[_0xdda2('0x3c')]===0x1){return _0x37aeda['id'];}else{var _0x4953d2=_[_0xdda2('0x79')](_[_0xdda2('0x32')](_0x43e405,_0xdda2('0x7a')),function(_0x270c46){return _['includes'](_0x26e599,_0x270c46);});if(_0x4953d2){return _0x37aeda['id'];}}}));}}return BPromise['all'](_0x528185)['then'](function(_0x3b2e7c){_0x1527e0=_(_0x1527e0)[_0xdda2('0x7b')](_0x3b2e7c)[_0xdda2('0x7c')]()[_0xdda2('0x7d')]();return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x2b8c0c['params']['id']}})[_0xdda2('0x2b')](function(_0x2d5781){return db[_0xdda2('0x6a')][_0xdda2('0x6b')](function(_0x3de27a){return _0x2d5781[_0xdda2('0x7e')](_0x2b8c0c[_0xdda2('0x35')][_0xdda2('0x65')],{'transaction':_0x3de27a})['then'](function(){if(!_[_0xdda2('0x7f')](_0x1527e0)){return _0x2d5781['removeAgents'](_0x1527e0,{'transaction':_0x3de27a});}})[_0xdda2('0x2b')](function(){_0x1527e0['forEach'](function(_0x15066f){socket['emit'](_0xdda2('0x80'),{'UserId':_0x15066f,'SmsQueueId':_0x2d5781['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x11c1c8,null))[_0xdda2('0x4e')](handleError(_0x11c1c8,null));};exports[_0xdda2('0x81')]=function(_0x3ac762,_0x18a102,_0x156998){return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x3ac762['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x18a102,null))[_0xdda2('0x2b')](function(_0x5db550){if(_0x5db550){return _0x5db550[_0xdda2('0x81')](_0x3ac762[_0xdda2('0x50')][_0xdda2('0x65')],_['omit'](_0x3ac762[_0xdda2('0x50')],[_0xdda2('0x65'),'id'])||{})[_0xdda2('0x82')](function(_0x311e34){for(var _0x3edca8=0x0;_0x3edca8<_0x3ac762[_0xdda2('0x50')][_0xdda2('0x65')][_0xdda2('0x3c')];_0x3edca8+=0x1){socket[_0xdda2('0x6d')](_0xdda2('0x6e'),{'UserId':_0x3ac762['body'][_0xdda2('0x65')][_0x3edca8],'SmsQueueId':_0x3ac762[_0xdda2('0x49')]['id']});}return _0x311e34;});}})[_0xdda2('0x2b')](respondWithResult(_0x18a102,null))[_0xdda2('0x4e')](handleError(_0x18a102,null));};exports[_0xdda2('0x83')]=function(_0x4c540d,_0x320cf1,_0xc7e1e3){return db[_0xdda2('0x44')]['find']({'where':{'id':_0x4c540d[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x320cf1,null))[_0xdda2('0x2b')](function(_0x55d48c){if(_0x55d48c){return _0x55d48c[_0xdda2('0x83')](_0x4c540d['query']['ids'])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x84')](_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')])){for(var _0x307cf7=0x0;_0x307cf7<_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')]['length'];_0x307cf7+=0x1){socket['emit'](_0xdda2('0x80'),{'UserId':Number(_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')][_0x307cf7]),'SmsQueueId':Number(_0x4c540d[_0xdda2('0x49')]['id'])});}}else{socket[_0xdda2('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')]),'SmsQueueId':Number(_0x4c540d[_0xdda2('0x49')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x320cf1,null))[_0xdda2('0x4e')](handleError(_0x320cf1,null));};exports[_0xdda2('0x85')]=function(_0x3289ec,_0x1671df,_0x1d1e9){var _0x44e93d={};var _0x2defb2={};var _0x53c44d;var _0x43b901;return db[_0xdda2('0x44')][_0xdda2('0x61')]({'where':{'id':_0x3289ec[_0xdda2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1671df,null))[_0xdda2('0x2b')](function(_0x4c9cbb){if(_0x4c9cbb){_0x53c44d=_0x4c9cbb;_0x2defb2[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x5b')]['rawAttributes']);_0x2defb2[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x3289ec[_0xdda2('0x35')]);_0x2defb2['filters']=_[_0xdda2('0x38')](_0x2defb2[_0xdda2('0x39')],_0x2defb2[_0xdda2('0x35')]);_0x44e93d['attributes']=_['intersection'](_0x2defb2[_0xdda2('0x39')],qs['fields'](_0x3289ec[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x44e93d[_0xdda2('0x3a')]=_0x44e93d[_0xdda2('0x3a')]['length']?_0x44e93d[_0xdda2('0x3a')]:_0x2defb2['model'];_0x44e93d['order']=qs['sort'](_0x3289ec['query'][_0xdda2('0x3f')]);_0x44e93d['where']=qs[_0xdda2('0x37')](_[_0xdda2('0x40')](_0x3289ec['query'],_0x2defb2['filters']));if(_0x3289ec[_0xdda2('0x35')][_0xdda2('0x41')]){_0x44e93d[_0xdda2('0x43')]=_[_0xdda2('0x42')](_0x44e93d['where'],{'$or':_['map'](_0x44e93d[_0xdda2('0x3a')],function(_0x19c1eb){var _0xaa5d94={};_0xaa5d94[_0x19c1eb]={'$like':'%'+_0x3289ec[_0xdda2('0x35')]['filter']+'%'};return _0xaa5d94;})});}_0x44e93d=_[_0xdda2('0x42')]({},_0x44e93d,_0x3289ec[_0xdda2('0x4c')]);return _0x53c44d[_0xdda2('0x85')](_0x44e93d);}})[_0xdda2('0x2b')](function(_0xf08532){if(_0xf08532){_0x43b901=_0xf08532[_0xdda2('0x3c')];if(!_0x3289ec[_0xdda2('0x35')][_0xdda2('0x59')](_0xdda2('0x3d'))){_0x44e93d[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x3289ec[_0xdda2('0x35')][_0xdda2('0x22')]);_0x44e93d[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x3289ec[_0xdda2('0x35')]['offset']);}return _0x53c44d[_0xdda2('0x85')](_0x44e93d);}})[_0xdda2('0x2b')](function(_0x421269){if(_0x421269){return _0x421269?{'count':_0x43b901,'rows':_0x421269}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x1671df,null))[_0xdda2('0x4e')](handleError(_0x1671df,null));}; \ No newline at end of file +var _0xda2d=['lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./smsQueue.socket','register','status','end','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','SmsQueues','then','sendStatus','error','stack','name','send','index','map','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','merge','where','SmsQueue','include','findAll','rows','show','params','rawAttributes','includeAll','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','getMembers','UserSmsQueue','hasOwnProperty','SmsQueueId','User','UserId','smsPause','updatedAt','createdAt','format','findOne','Team','getTeams','addTeams','ids','Agents','online','interface','flatMap','sequelize','transaction','findOrCreate','emit','userSmsQueue:save','field','from','team_has_sms_queues','join','user_has_teams','SmsQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','SELECT','every','TeamId','union','compact','value','removeTeams','isEmpty','userSmsQueue:remove','addAgents','spread','removeAgents','isArray','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs'];(function(_0x6db6c5,_0x2f0d9c){var _0x37686d=function(_0x4a617c){while(--_0x4a617c){_0x6db6c5['push'](_0x6db6c5['shift']());}};_0x37686d(++_0x2f0d9c);}(_0xda2d,0x102));var _0xdda2=function(_0x440218,_0x3b0129){_0x440218=_0x440218-0x0;var _0x236e85=_0xda2d[_0x440218];return _0x236e85;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdda2('0x0'));var rimraf=require(_0xdda2('0x1'));var zipdir=require(_0xdda2('0x2'));var jsonpatch=require(_0xdda2('0x3'));var rp=require(_0xdda2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdda2('0x5'));var path=require(_0xdda2('0x6'));var sox=require(_0xdda2('0x7'));var csv=require(_0xdda2('0x8'));var ejs=require(_0xdda2('0x9'));var fs=require('fs');var _=require(_0xdda2('0xa'));var squel=require(_0xdda2('0xb'));var crypto=require(_0xdda2('0xc'));var jsforce=require(_0xdda2('0xd'));var deskjs=require(_0xdda2('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdda2('0xf'));var Papa=require(_0xdda2('0x10'));var Redis=require('ioredis');var authService=require(_0xdda2('0x11'));var qs=require(_0xdda2('0x12'));var as=require(_0xdda2('0x13'));var hardwareService=require(_0xdda2('0x14'));var logger=require(_0xdda2('0x15'))(_0xdda2('0x16'));var utils=require(_0xdda2('0x17'));var config=require(_0xdda2('0x18'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0xdda2('0x19')],{'host':_0xdda2('0x1a'),'port':0x18eb});var socket=require(_0xdda2('0x1b'))(new Redis(config[_0xdda2('0x19')]));require(_0xdda2('0x1c'))[_0xdda2('0x1d')](socket);function respondWithStatusCode(_0x3490f1,_0x4df902){_0x4df902=_0x4df902||0xcc;return function(_0x79c6d4){if(_0x79c6d4){return _0x3490f1['sendStatus'](_0x4df902);}return _0x3490f1[_0xdda2('0x1e')](_0x4df902)[_0xdda2('0x1f')]();};}function respondWithResult(_0x3553d5,_0x457764){_0x457764=_0x457764||0xc8;return function(_0x1922b1){if(_0x1922b1){return _0x3553d5['status'](_0x457764)['json'](_0x1922b1);}};}function respondWithFilteredResult(_0x43f67b,_0x518c6d){return function(_0x1a5192){if(_0x1a5192){var _0x1a3b35=_0x1a5192[_0xdda2('0x20')],_0x335fb5=_0x518c6d[_0xdda2('0x21')],_0x2b6ee8=_0x518c6d[_0xdda2('0x21')]+_0x518c6d[_0xdda2('0x22')],_0x8d44b7;if(_0x2b6ee8>=_0x1a3b35){_0x2b6ee8=_0x1a3b35;_0x8d44b7=0xc8;}else{_0x8d44b7=0xce;}_0x43f67b[_0xdda2('0x1e')](_0x8d44b7);return _0x43f67b[_0xdda2('0x23')](_0xdda2('0x24'),_0x335fb5+'-'+_0x2b6ee8+'/'+_0x1a3b35)['json'](_0x1a5192);}return null;};}function patchUpdates(_0x41fe7d){return function(_0x5dfce7){try{jsonpatch[_0xdda2('0x25')](_0x5dfce7,_0x41fe7d,!![]);}catch(_0x1a4db4){return BPromise[_0xdda2('0x26')](_0x1a4db4);}return _0x5dfce7['save']();};}function saveUpdates(_0x347ee6,_0x5a9bb8){return function(_0x425489){if(_0x425489){return _0x425489[_0xdda2('0x27')](_0x347ee6)['then'](function(_0x144f1e){return _0x144f1e;});}return null;};}function removeEntity(_0xfda248,_0x2528d7){return function(_0x13b0f3){if(_0x13b0f3){return _0x13b0f3[_0xdda2('0x28')]()['then'](function(){var _0x38cdf=_0x13b0f3[_0xdda2('0x29')]({'plain':!![]});var _0x2391a5=_0xdda2('0x2a');return db['UserProfileResource']['destroy']({'where':{'type':_0x2391a5,'resourceId':_0x38cdf['id']}})[_0xdda2('0x2b')](function(){return _0x13b0f3;});})[_0xdda2('0x2b')](function(){_0xfda248[_0xdda2('0x1e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x90d919,_0x5d26ae){return function(_0x2e755b){if(!_0x2e755b){_0x90d919[_0xdda2('0x2c')](0x194);}return _0x2e755b;};}function handleError(_0xe16ec7,_0x91b41a){_0x91b41a=_0x91b41a||0x1f4;return function(_0x4bb8a4){logger[_0xdda2('0x2d')](_0x4bb8a4[_0xdda2('0x2e')]);if(_0x4bb8a4['name']){delete _0x4bb8a4[_0xdda2('0x2f')];}_0xe16ec7[_0xdda2('0x1e')](_0x91b41a)[_0xdda2('0x30')](_0x4bb8a4);};}exports[_0xdda2('0x31')]=function(_0x5540e5,_0x129eba){var _0x5e107f={},_0x4b19b7={},_0x1ca9f3={'count':0x0,'rows':[]};var _0x5edf7e=_[_0xdda2('0x32')](db['SmsQueue']['rawAttributes'],function(_0x510b7b){return{'name':_0x510b7b[_0xdda2('0x33')],'type':_0x510b7b['type'][_0xdda2('0x34')]};});_0x4b19b7['model']=_['map'](_0x5edf7e,'name');_0x4b19b7[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x5540e5[_0xdda2('0x35')]);_0x4b19b7[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x4b19b7[_0xdda2('0x39')],_0x4b19b7[_0xdda2('0x35')]);_0x5e107f[_0xdda2('0x3a')]=_[_0xdda2('0x38')](_0x4b19b7[_0xdda2('0x39')],qs['fields'](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x5e107f[_0xdda2('0x3a')]=_0x5e107f[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x5e107f[_0xdda2('0x3a')]:_0x4b19b7[_0xdda2('0x39')];if(!_0x5540e5['query']['hasOwnProperty'](_0xdda2('0x3d'))){_0x5e107f[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x5540e5['query']['limit']);_0x5e107f[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x21')]);}_0x5e107f[_0xdda2('0x3e')]=qs['sort'](_0x5540e5[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x5e107f['where']=qs['filters'](_[_0xdda2('0x40')](_0x5540e5[_0xdda2('0x35')],_0x4b19b7[_0xdda2('0x37')]));if(_0x5540e5[_0xdda2('0x35')][_0xdda2('0x41')]){_0x5e107f['where']=_[_0xdda2('0x42')](_0x5e107f[_0xdda2('0x43')],{'$or':_[_0xdda2('0x32')](_0x5edf7e,function(_0x1a7262){if(_0x1a7262['type']!=='VIRTUAL'){var _0x203972={};_0x203972[_0x1a7262[_0xdda2('0x2f')]]={'$like':'%'+_0x5540e5[_0xdda2('0x35')]['filter']+'%'};return _0x203972;}})});}_0x5e107f=_[_0xdda2('0x42')]({},_0x5e107f,_0x5540e5['options']);var _0x33a378={'where':_0x5e107f['where']};return db[_0xdda2('0x44')][_0xdda2('0x20')](_0x33a378)[_0xdda2('0x2b')](function(_0x2eec64){_0x1ca9f3['count']=_0x2eec64;if(_0x5540e5[_0xdda2('0x35')]['includeAll']){_0x5e107f[_0xdda2('0x45')]=[{'all':!![]}];}return db['SmsQueue'][_0xdda2('0x46')](_0x5e107f);})[_0xdda2('0x2b')](function(_0x153acf){_0x1ca9f3[_0xdda2('0x47')]=_0x153acf;return _0x1ca9f3;})[_0xdda2('0x2b')](respondWithFilteredResult(_0x129eba,_0x5e107f))['catch'](handleError(_0x129eba,null));};exports[_0xdda2('0x48')]=function(_0x15a616,_0x54735b){var _0x2caced={'raw':!![],'where':{'id':_0x15a616[_0xdda2('0x49')]['id']}},_0x546847={};_0x546847[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x44')][_0xdda2('0x4a')]);_0x546847[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x15a616[_0xdda2('0x35')]);_0x546847[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x546847[_0xdda2('0x39')],_0x546847[_0xdda2('0x35')]);_0x2caced[_0xdda2('0x3a')]=_['intersection'](_0x546847['model'],qs['fields'](_0x15a616[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x2caced['attributes']=_0x2caced[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x2caced[_0xdda2('0x3a')]:_0x546847['model'];if(_0x15a616[_0xdda2('0x35')][_0xdda2('0x4b')]){_0x2caced['include']=[{'all':!![]}];}_0x2caced=_['merge']({},_0x2caced,_0x15a616[_0xdda2('0x4c')]);return db['SmsQueue'][_0xdda2('0x4d')](_0x2caced)['then'](handleEntityNotFound(_0x54735b,null))[_0xdda2('0x2b')](respondWithResult(_0x54735b,null))[_0xdda2('0x4e')](handleError(_0x54735b,null));};exports['create']=function(_0x585665,_0x3506ff){return db[_0xdda2('0x44')][_0xdda2('0x4f')](_0x585665[_0xdda2('0x50')],{})['then'](function(_0x1edbc6){var _0x3bba94=_0x585665[_0xdda2('0x51')][_0xdda2('0x29')]({'plain':!![]});if(!_0x3bba94)throw new Error(_0xdda2('0x52'));if(_0x3bba94['role']===_0xdda2('0x51')){var _0x40b610=_0x1edbc6['get']({'plain':!![]});var _0x3eb3c1=_0xdda2('0x2a');return db[_0xdda2('0x53')][_0xdda2('0x4d')]({'where':{'name':_0x3eb3c1,'userProfileId':_0x3bba94[_0xdda2('0x54')]},'raw':!![]})[_0xdda2('0x2b')](function(_0x4b6519){if(_0x4b6519&&_0x4b6519[_0xdda2('0x55')]===0x0){return db['UserProfileResource'][_0xdda2('0x4f')]({'name':_0x40b610['name'],'resourceId':_0x40b610['id'],'type':_0x4b6519[_0xdda2('0x2f')],'sectionId':_0x4b6519['id']},{})['then'](function(){return _0x1edbc6;});}else{return _0x1edbc6;}})[_0xdda2('0x4e')](function(_0x11c8b1){logger[_0xdda2('0x2d')](_0xdda2('0x56'),_0x11c8b1);throw _0x11c8b1;});}return _0x1edbc6;})[_0xdda2('0x2b')](respondWithResult(_0x3506ff,0xc9))[_0xdda2('0x4e')](handleError(_0x3506ff,null));};exports[_0xdda2('0x27')]=function(_0x40655d,_0x538ebb){if(_0x40655d[_0xdda2('0x50')]['id']){delete _0x40655d[_0xdda2('0x50')]['id'];}return db[_0xdda2('0x44')]['find']({'where':{'id':_0x40655d[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x538ebb,null))['then'](saveUpdates(_0x40655d[_0xdda2('0x50')],null))['then'](respondWithResult(_0x538ebb,null))[_0xdda2('0x4e')](handleError(_0x538ebb,null));};exports[_0xdda2('0x28')]=function(_0x378704,_0xbfab73){return db[_0xdda2('0x44')]['find']({'where':{'id':_0x378704['params']['id']}})['then'](handleEntityNotFound(_0xbfab73,null))[_0xdda2('0x2b')](removeEntity(_0xbfab73,null))[_0xdda2('0x4e')](handleError(_0xbfab73,null));};exports['describe']=function(_0x44637d,_0x126977){return db[_0xdda2('0x44')]['describe']()[_0xdda2('0x2b')](respondWithResult(_0x126977,null))[_0xdda2('0x4e')](handleError(_0x126977,null));};exports[_0xdda2('0x57')]=function(_0x58ae15,_0x2b2c1d,_0x4495e5){var _0x7eb83f={'raw':!![],'where':{}},_0x25c9a9={},_0x5d8602;return db[_0xdda2('0x44')]['findOne']({'where':{'id':_0x58ae15['params']['id']}})['then'](handleEntityNotFound(_0x2b2c1d,null))[_0xdda2('0x2b')](function(_0x35b38a){if(_0x35b38a){_0x5d8602=_0x35b38a[_0xdda2('0x29')]({'plain':!![]});_0x25c9a9[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x58')][_0xdda2('0x4a')]);_0x25c9a9[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x58ae15[_0xdda2('0x35')]);_0x25c9a9[_0xdda2('0x37')]=_['intersection'](_0x25c9a9[_0xdda2('0x39')],_0x25c9a9[_0xdda2('0x35')]);_0x7eb83f[_0xdda2('0x3a')]=_[_0xdda2('0x38')](_0x25c9a9[_0xdda2('0x39')],qs[_0xdda2('0x3b')](_0x58ae15[_0xdda2('0x35')]['fields']));_0x7eb83f[_0xdda2('0x3a')]=_0x7eb83f[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x7eb83f[_0xdda2('0x3a')]:_0x25c9a9[_0xdda2('0x39')];if(!_0x58ae15['query'][_0xdda2('0x59')](_0xdda2('0x3d'))){_0x7eb83f[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x58ae15[_0xdda2('0x35')]['limit']);_0x7eb83f[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x58ae15[_0xdda2('0x35')][_0xdda2('0x21')]);}_0x7eb83f[_0xdda2('0x3e')]=qs['sort'](_0x58ae15[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x7eb83f[_0xdda2('0x43')]=qs['filters'](_[_0xdda2('0x40')](_0x58ae15['query'],_0x25c9a9[_0xdda2('0x37')]));_0x7eb83f[_0xdda2('0x43')][_0xdda2('0x5a')]=_0x35b38a['id'];if(_0x58ae15['query'][_0xdda2('0x41')]){_0x7eb83f[_0xdda2('0x43')]=_['merge'](_0x7eb83f[_0xdda2('0x43')],{'$or':_['map'](_0x7eb83f[_0xdda2('0x3a')],function(_0xc97cb1){var _0x354fb9={};_0x354fb9[_0xc97cb1]={'$like':'%'+_0x58ae15[_0xdda2('0x35')][_0xdda2('0x41')]+'%'};return _0x354fb9;})});}_0x7eb83f=_['merge']({},_0x7eb83f,_0x58ae15['options']);return db[_0xdda2('0x58')][_0xdda2('0x46')](_0x7eb83f);}})['then'](function(_0x53e9e0){if(_0x53e9e0){return db[_0xdda2('0x5b')]['findAndCountAll']({'where':{'id':_[_0xdda2('0x32')](_0x53e9e0,_0xdda2('0x5c')),'role':'agent'},'attributes':['id',_0xdda2('0x2f'),_0xdda2('0x5d'),_0xdda2('0x5e'),_0xdda2('0x5f')]});}})[_0xdda2('0x2b')](function(_0x37f5cd){if(_0x37f5cd){return{'count':_0x37f5cd['count'],'rows':_[_0xdda2('0x32')](_0x37f5cd[_0xdda2('0x47')],function(_0x2dbaad){return{'membername':_0x2dbaad['name'],'UserId':_0x2dbaad['id'],'queue_name':_0x5d8602[_0xdda2('0x2f')],'SmsQueueId':_0x5d8602['id'],'interface':util[_0xdda2('0x60')]('%s/%s','SIP',_0x2dbaad[_0xdda2('0x2f')]),'penalty':0x0,'paused':_0x2dbaad[_0xdda2('0x5d')],'createdAt':_0x2dbaad[_0xdda2('0x5f')],'updatedAt':_0x2dbaad['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x2b2c1d,_0x7eb83f))[_0xdda2('0x4e')](handleError(_0x2b2c1d,null));};exports['getTeams']=function(_0x18edab,_0x150dcd,_0x19d92e){var _0x12fd67={};var _0x597b09={};var _0x29006f;var _0x58d1ad;return db['SmsQueue'][_0xdda2('0x61')]({'where':{'id':_0x18edab['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x150dcd,null))[_0xdda2('0x2b')](function(_0x15f581){if(_0x15f581){_0x29006f=_0x15f581;_0x597b09[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x62')][_0xdda2('0x4a')]);_0x597b09[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x18edab['query']);_0x597b09[_0xdda2('0x37')]=_[_0xdda2('0x38')](_0x597b09[_0xdda2('0x39')],_0x597b09[_0xdda2('0x35')]);_0x12fd67['attributes']=_[_0xdda2('0x38')](_0x597b09[_0xdda2('0x39')],qs[_0xdda2('0x3b')](_0x18edab[_0xdda2('0x35')]['fields']));_0x12fd67['attributes']=_0x12fd67[_0xdda2('0x3a')][_0xdda2('0x3c')]?_0x12fd67[_0xdda2('0x3a')]:_0x597b09[_0xdda2('0x39')];_0x12fd67['order']=qs[_0xdda2('0x3f')](_0x18edab[_0xdda2('0x35')][_0xdda2('0x3f')]);_0x12fd67[_0xdda2('0x43')]=qs[_0xdda2('0x37')](_[_0xdda2('0x40')](_0x18edab[_0xdda2('0x35')],_0x597b09[_0xdda2('0x37')]));if(_0x18edab[_0xdda2('0x35')][_0xdda2('0x41')]){_0x12fd67[_0xdda2('0x43')]=_[_0xdda2('0x42')](_0x12fd67[_0xdda2('0x43')],{'$or':_[_0xdda2('0x32')](_0x12fd67[_0xdda2('0x3a')],function(_0x4b9481){var _0x221f72={};_0x221f72[_0x4b9481]={'$like':'%'+_0x18edab[_0xdda2('0x35')]['filter']+'%'};return _0x221f72;})});}_0x12fd67=_['merge']({},_0x12fd67,_0x18edab[_0xdda2('0x4c')]);return _0x29006f[_0xdda2('0x63')](_0x12fd67);}})[_0xdda2('0x2b')](function(_0xdc4cdc){if(_0xdc4cdc){_0x58d1ad=_0xdc4cdc[_0xdda2('0x3c')];if(!_0x18edab[_0xdda2('0x35')]['hasOwnProperty'](_0xdda2('0x3d'))){_0x12fd67[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x18edab[_0xdda2('0x35')]['limit']);_0x12fd67[_0xdda2('0x21')]=qs['offset'](_0x18edab[_0xdda2('0x35')][_0xdda2('0x21')]);}return _0x29006f['getTeams'](_0x12fd67);}})[_0xdda2('0x2b')](function(_0x3d50fc){if(_0x3d50fc){return _0x3d50fc?{'count':_0x58d1ad,'rows':_0x3d50fc}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x150dcd,null))[_0xdda2('0x4e')](handleError(_0x150dcd,null));};exports[_0xdda2('0x64')]=function(_0x313138,_0x1c6ef1,_0x460c2e){var _0x3a375d=_0x313138[_0xdda2('0x50')][_0xdda2('0x65')];return db['Team'][_0xdda2('0x46')]({'where':{'id':_0x3a375d},'attributes':['id'],'include':[{'model':db[_0xdda2('0x5b')],'as':_0xdda2('0x66'),'attributes':['id',_0xdda2('0x2f'),_0xdda2('0x67'),'voicePause',_0xdda2('0x68')],'raw':!![]}]})[_0xdda2('0x2b')](function(_0x47b4e1){if(_0x47b4e1){var _0x319af4=_[_0xdda2('0x69')](_0x47b4e1,function(_0x4bde71){var _0x5b24bc=_0x4bde71[_0xdda2('0x29')]({'plain':!![]});return _0x5b24bc[_0xdda2('0x66')];});return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x313138[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](function(_0x525e93){return db[_0xdda2('0x6a')][_0xdda2('0x6b')](function(_0x5cca40){return _0x525e93[_0xdda2('0x64')](_0x3a375d,{'transaction':_0x5cca40})[_0xdda2('0x2b')](function(){return BPromise['each'](_0x319af4,function(_0x2da4a7){return db[_0xdda2('0x58')][_0xdda2('0x6c')]({'where':{'UserId':_0x2da4a7['id'],'SmsQueueId':_0x313138['params']['id']},'transaction':_0x5cca40});});})[_0xdda2('0x2b')](function(){_0x319af4['forEach'](function(_0x45e549){socket[_0xdda2('0x6d')](_0xdda2('0x6e'),{'UserId':_0x45e549['id'],'SmsQueueId':_0x525e93['id']});});});});});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x1c6ef1,null))['catch'](handleError(_0x1c6ef1,null));};exports['removeTeams']=function(_0x2b8c0c,_0x11c1c8,_0x4ac607){return db[_0xdda2('0x62')][_0xdda2('0x46')]({'where':{'id':_0x2b8c0c[_0xdda2('0x35')][_0xdda2('0x65')]},'attributes':['id'],'include':[{'model':db[_0xdda2('0x5b')],'as':_0xdda2('0x66'),'attributes':['id'],'raw':!![]}]})[_0xdda2('0x2b')](handleEntityNotFound(_0x11c1c8,null))[_0xdda2('0x2b')](function(_0x3046c1){var _0x26e599=_[_0xdda2('0x32')](_0x3046c1,'id');var _0x1527e0=[];var _0x528185=[];var _0x5a28b0=squel['select']();_0x5a28b0[_0xdda2('0x6f')]('tq.TeamId')[_0xdda2('0x70')](_0xdda2('0x71'),'tq')[_0xdda2('0x72')](_0xdda2('0x73'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdda2('0x43')](_0xdda2('0x74'),_0x2b8c0c[_0xdda2('0x49')]['id']);for(var _0x49d5a6=0x0;_0x49d5a6<_0x3046c1[_0xdda2('0x3c')];_0x49d5a6+=0x1){let _0x86235b=_0x3046c1[_0x49d5a6];for(var _0x2588f5=0x0;_0x2588f5<_0x86235b['Agents']['length'];_0x2588f5+=0x1){let _0x37aeda=_0x86235b[_0xdda2('0x66')][_0x2588f5];var _0x42df5b=_0x5a28b0['clone']();_0x42df5b[_0xdda2('0x43')](_0xdda2('0x75'),_0x37aeda['id']);_0x528185[_0xdda2('0x76')](db[_0xdda2('0x6a')][_0xdda2('0x35')](_0x42df5b[_0xdda2('0x77')](),{'type':db[_0xdda2('0x6a')]['QueryTypes'][_0xdda2('0x78')]})[_0xdda2('0x2b')](function(_0x43e405){if(_0x43e405[_0xdda2('0x3c')]===0x1){return _0x37aeda['id'];}else{var _0x4953d2=_[_0xdda2('0x79')](_[_0xdda2('0x32')](_0x43e405,_0xdda2('0x7a')),function(_0x270c46){return _['includes'](_0x26e599,_0x270c46);});if(_0x4953d2){return _0x37aeda['id'];}}}));}}return BPromise['all'](_0x528185)['then'](function(_0x3b2e7c){_0x1527e0=_(_0x1527e0)[_0xdda2('0x7b')](_0x3b2e7c)[_0xdda2('0x7c')]()[_0xdda2('0x7d')]();return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x2b8c0c['params']['id']}})[_0xdda2('0x2b')](function(_0x2d5781){return db[_0xdda2('0x6a')][_0xdda2('0x6b')](function(_0x3de27a){return _0x2d5781[_0xdda2('0x7e')](_0x2b8c0c[_0xdda2('0x35')][_0xdda2('0x65')],{'transaction':_0x3de27a})['then'](function(){if(!_[_0xdda2('0x7f')](_0x1527e0)){return _0x2d5781['removeAgents'](_0x1527e0,{'transaction':_0x3de27a});}})[_0xdda2('0x2b')](function(){_0x1527e0['forEach'](function(_0x15066f){socket['emit'](_0xdda2('0x80'),{'UserId':_0x15066f,'SmsQueueId':_0x2d5781['id']});});});});});});})[_0xdda2('0x2b')](respondWithStatusCode(_0x11c1c8,null))[_0xdda2('0x4e')](handleError(_0x11c1c8,null));};exports[_0xdda2('0x81')]=function(_0x3ac762,_0x18a102,_0x156998){return db[_0xdda2('0x44')][_0xdda2('0x4d')]({'where':{'id':_0x3ac762['params']['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x18a102,null))[_0xdda2('0x2b')](function(_0x5db550){if(_0x5db550){return _0x5db550[_0xdda2('0x81')](_0x3ac762[_0xdda2('0x50')][_0xdda2('0x65')],_['omit'](_0x3ac762[_0xdda2('0x50')],[_0xdda2('0x65'),'id'])||{})[_0xdda2('0x82')](function(_0x311e34){for(var _0x3edca8=0x0;_0x3edca8<_0x3ac762[_0xdda2('0x50')][_0xdda2('0x65')][_0xdda2('0x3c')];_0x3edca8+=0x1){socket[_0xdda2('0x6d')](_0xdda2('0x6e'),{'UserId':_0x3ac762['body'][_0xdda2('0x65')][_0x3edca8],'SmsQueueId':_0x3ac762[_0xdda2('0x49')]['id']});}return _0x311e34;});}})[_0xdda2('0x2b')](respondWithResult(_0x18a102,null))[_0xdda2('0x4e')](handleError(_0x18a102,null));};exports[_0xdda2('0x83')]=function(_0x4c540d,_0x320cf1,_0xc7e1e3){return db[_0xdda2('0x44')]['find']({'where':{'id':_0x4c540d[_0xdda2('0x49')]['id']}})[_0xdda2('0x2b')](handleEntityNotFound(_0x320cf1,null))[_0xdda2('0x2b')](function(_0x55d48c){if(_0x55d48c){return _0x55d48c[_0xdda2('0x83')](_0x4c540d['query']['ids'])[_0xdda2('0x2b')](function(){if(_[_0xdda2('0x84')](_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')])){for(var _0x307cf7=0x0;_0x307cf7<_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')]['length'];_0x307cf7+=0x1){socket['emit'](_0xdda2('0x80'),{'UserId':Number(_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')][_0x307cf7]),'SmsQueueId':Number(_0x4c540d[_0xdda2('0x49')]['id'])});}}else{socket[_0xdda2('0x6d')]('userSmsQueue:remove',{'UserId':Number(_0x4c540d[_0xdda2('0x35')][_0xdda2('0x65')]),'SmsQueueId':Number(_0x4c540d[_0xdda2('0x49')]['id'])});}});}})[_0xdda2('0x2b')](respondWithStatusCode(_0x320cf1,null))[_0xdda2('0x4e')](handleError(_0x320cf1,null));};exports[_0xdda2('0x85')]=function(_0x3289ec,_0x1671df,_0x1d1e9){var _0x44e93d={};var _0x2defb2={};var _0x53c44d;var _0x43b901;return db[_0xdda2('0x44')][_0xdda2('0x61')]({'where':{'id':_0x3289ec[_0xdda2('0x49')]['id']}})['then'](handleEntityNotFound(_0x1671df,null))[_0xdda2('0x2b')](function(_0x4c9cbb){if(_0x4c9cbb){_0x53c44d=_0x4c9cbb;_0x2defb2[_0xdda2('0x39')]=_[_0xdda2('0x36')](db[_0xdda2('0x5b')]['rawAttributes']);_0x2defb2[_0xdda2('0x35')]=_[_0xdda2('0x36')](_0x3289ec[_0xdda2('0x35')]);_0x2defb2['filters']=_[_0xdda2('0x38')](_0x2defb2[_0xdda2('0x39')],_0x2defb2[_0xdda2('0x35')]);_0x44e93d['attributes']=_['intersection'](_0x2defb2[_0xdda2('0x39')],qs['fields'](_0x3289ec[_0xdda2('0x35')][_0xdda2('0x3b')]));_0x44e93d[_0xdda2('0x3a')]=_0x44e93d[_0xdda2('0x3a')]['length']?_0x44e93d[_0xdda2('0x3a')]:_0x2defb2['model'];_0x44e93d['order']=qs['sort'](_0x3289ec['query'][_0xdda2('0x3f')]);_0x44e93d['where']=qs[_0xdda2('0x37')](_[_0xdda2('0x40')](_0x3289ec['query'],_0x2defb2['filters']));if(_0x3289ec[_0xdda2('0x35')][_0xdda2('0x41')]){_0x44e93d[_0xdda2('0x43')]=_[_0xdda2('0x42')](_0x44e93d['where'],{'$or':_['map'](_0x44e93d[_0xdda2('0x3a')],function(_0x19c1eb){var _0xaa5d94={};_0xaa5d94[_0x19c1eb]={'$like':'%'+_0x3289ec[_0xdda2('0x35')]['filter']+'%'};return _0xaa5d94;})});}_0x44e93d=_[_0xdda2('0x42')]({},_0x44e93d,_0x3289ec[_0xdda2('0x4c')]);return _0x53c44d[_0xdda2('0x85')](_0x44e93d);}})[_0xdda2('0x2b')](function(_0xf08532){if(_0xf08532){_0x43b901=_0xf08532[_0xdda2('0x3c')];if(!_0x3289ec[_0xdda2('0x35')][_0xdda2('0x59')](_0xdda2('0x3d'))){_0x44e93d[_0xdda2('0x22')]=qs[_0xdda2('0x22')](_0x3289ec[_0xdda2('0x35')][_0xdda2('0x22')]);_0x44e93d[_0xdda2('0x21')]=qs[_0xdda2('0x21')](_0x3289ec[_0xdda2('0x35')]['offset']);}return _0x53c44d[_0xdda2('0x85')](_0x44e93d);}})[_0xdda2('0x2b')](function(_0x421269){if(_0x421269){return _0x421269?{'count':_0x43b901,'rows':_0x421269}:null;}})[_0xdda2('0x2b')](respondWithResult(_0x1671df,null))[_0xdda2('0x4e')](handleError(_0x1671df,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index f1162ef..8175986 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 _0x85df=['save','emit','hasOwnProperty','hook','../../mysqldb','SmsQueue','setMaxListeners'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85df,0x74));var _0xf85d=function(_0x54f73f,_0x513e1f){_0x54f73f=_0x54f73f-0x0;var _0x3a8035=_0x85df[_0x54f73f];return _0x3a8035;};'use strict';var EventEmitter=require('events');var SmsQueue=require(_0xf85d('0x0'))['db'][_0xf85d('0x1')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0xf85d('0x2')](0x0);var events={'afterCreate':_0xf85d('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x434a72){return function(_0x44b5ba,_0x56a102,_0xe98984){SmsQueueEvents[_0xf85d('0x4')](_0x434a72+':'+_0x44b5ba['id'],_0x44b5ba);SmsQueueEvents[_0xf85d('0x4')](_0x434a72,_0x44b5ba);_0xe98984(null);};}for(var e in events){if(events[_0xf85d('0x5')](e)){var event=events[e];SmsQueue[_0xf85d('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file +var _0xbaf0=['remove','emit','hasOwnProperty','hook','events','save','update'];(function(_0x382c73,_0x199cab){var _0x1dd0bf=function(_0x358747){while(--_0x358747){_0x382c73['push'](_0x382c73['shift']());}};_0x1dd0bf(++_0x199cab);}(_0xbaf0,0x1e7));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var EventEmitter=require(_0x0baf('0x0'));var SmsQueue=require('../../mysqldb')['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x0baf('0x1'),'afterUpdate':_0x0baf('0x2'),'afterDestroy':_0x0baf('0x3')};function emitEvent(_0x44388e){return function(_0x13d202,_0xcc0467,_0x4640a9){SmsQueueEvents[_0x0baf('0x4')](_0x44388e+':'+_0x13d202['id'],_0x13d202);SmsQueueEvents[_0x0baf('0x4')](_0x44388e,_0x13d202);_0x4640a9(null);};}for(var e in events){if(events[_0x0baf('0x5')](e)){var event=events[e];SmsQueue[_0x0baf('0x6')](e,emitEvent(event));}}module['exports']=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index 1afd2d0..5264e88 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 _0x2e7e=['path','rimraf','./smsQueue.attributes','exports','define','SmsQueue','util','../../config/logger','api','bluebird'];(function(_0x254abd,_0x1ab7f0){var _0x31bf1b=function(_0x447fd8){while(--_0x447fd8){_0x254abd['push'](_0x254abd['shift']());}};_0x31bf1b(++_0x1ab7f0);}(_0x2e7e,0xce));var _0xe2e7=function(_0x3f3d23,_0x3a86dd){_0x3f3d23=_0x3f3d23-0x0;var _0x342a67=_0x2e7e[_0x3f3d23];return _0x342a67;};'use strict';var _=require('lodash');var util=require(_0xe2e7('0x0'));var logger=require(_0xe2e7('0x1'))(_0xe2e7('0x2'));var moment=require('moment');var BPromise=require(_0xe2e7('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe2e7('0x4'));var rimraf=require(_0xe2e7('0x5'));var config=require('../../config/environment');var attributes=require(_0xe2e7('0x6'));module[_0xe2e7('0x7')]=function(_0x286698,_0x2aa7bb){return _0x286698[_0xe2e7('0x8')](_0xe2e7('0x9'),attributes,{'tableName':'sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3e6d=['path','rimraf','../../config/environment','exports','define','SmsQueue','sms_queues','util','../../config/logger','api','moment','request-promise'];(function(_0x2f69a8,_0x1659e7){var _0x311d94=function(_0xe1cc27){while(--_0xe1cc27){_0x2f69a8['push'](_0x2f69a8['shift']());}};_0x311d94(++_0x1659e7);}(_0x3e6d,0x187));var _0xd3e6=function(_0x51569d,_0x4bf32d){_0x51569d=_0x51569d-0x0;var _0x2bde24=_0x3e6d[_0x51569d];return _0x2bde24;};'use strict';var _=require('lodash');var util=require(_0xd3e6('0x0'));var logger=require(_0xd3e6('0x1'))(_0xd3e6('0x2'));var moment=require(_0xd3e6('0x3'));var BPromise=require('bluebird');var rp=require(_0xd3e6('0x4'));var fs=require('fs');var path=require(_0xd3e6('0x5'));var rimraf=require(_0xd3e6('0x6'));var config=require(_0xd3e6('0x7'));var attributes=require('./smsQueue.attributes');module[_0xd3e6('0x8')]=function(_0x108e97,_0x171231){return _0x108e97[_0xd3e6('0x9')](_0xd3e6('0xa'),attributes,{'tableName':_0xd3e6('0xb'),'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 9f50021..d8dd3a6 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 _0xcb4a=['map','include','model','ShowSmsQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','client','http','redis','defaults','localhost','./smsQueue.socket','register','request','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','SmsQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','GetSmsQueue','SmsQueue','findAll','options','raw','where','attributes','limit'];(function(_0x26721d,_0x448ba5){var _0x1035c5=function(_0x1c1b86){while(--_0x1c1b86){_0x26721d['push'](_0x26721d['shift']());}};_0x1035c5(++_0x448ba5);}(_0xcb4a,0x11d));var _0xacb4=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xcb4a[_0x433a86];return _0x23000c;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xacb4('0x0'));var BPromise=require(_0xacb4('0x1'));var rs=require(_0xacb4('0x2'));var fs=require('fs');var Redis=require(_0xacb4('0x3'));var db=require(_0xacb4('0x4'))['db'];var utils=require(_0xacb4('0x5'));var logger=require(_0xacb4('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xacb4('0x7')][_0xacb4('0x8')]({'port':0x232a});config[_0xacb4('0x9')]=_[_0xacb4('0xa')](config['redis'],{'host':_0xacb4('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacb4('0x9')]));require(_0xacb4('0xc'))[_0xacb4('0xd')](socket);function respondWithRpcPromise(_0xc412b3,_0x2e1472,_0x40569f){return new BPromise(function(_0x5c45bb,_0x5c1ea8){return client[_0xacb4('0xe')](_0xc412b3,_0x40569f)[_0xacb4('0xf')](function(_0xc56014){logger['info'](_0xacb4('0x10'),_0x2e1472,_0xacb4('0x11'));logger[_0xacb4('0x12')](_0xacb4('0x13'),_0x2e1472,_0xacb4('0x11'),JSON[_0xacb4('0x14')](_0xc56014));if(_0xc56014[_0xacb4('0x15')]){if(_0xc56014['error'][_0xacb4('0x16')]===0x1f4){logger[_0xacb4('0x15')]('SmsQueue,\x20%s,\x20%s',_0x2e1472,_0xc56014['error'][_0xacb4('0x17')]);return _0x5c1ea8(_0xc56014[_0xacb4('0x15')]['message']);}logger[_0xacb4('0x15')](_0xacb4('0x10'),_0x2e1472,_0xc56014[_0xacb4('0x15')][_0xacb4('0x17')]);return _0x5c45bb(_0xc56014[_0xacb4('0x15')][_0xacb4('0x17')]);}else{logger[_0xacb4('0x18')](_0xacb4('0x10'),_0x2e1472,_0xacb4('0x11'));_0x5c45bb(_0xc56014[_0xacb4('0x19')][_0xacb4('0x17')]);}})[_0xacb4('0x1a')](function(_0x21e876){logger[_0xacb4('0x15')](_0xacb4('0x10'),_0x2e1472,_0x21e876);_0x5c1ea8(_0x21e876);});});}exports[_0xacb4('0x1b')]=function(_0x2001ac){var _0x3819fe=this;return new Promise(function(_0x3a6ca6,_0xe1a766){return db[_0xacb4('0x1c')][_0xacb4('0x1d')]({'raw':_0x2001ac['options']?_0x2001ac[_0xacb4('0x1e')][_0xacb4('0x1f')]===undefined?!![]:![]:!![],'where':_0x2001ac['options']?_0x2001ac[_0xacb4('0x1e')][_0xacb4('0x20')]||null:null,'attributes':_0x2001ac[_0xacb4('0x1e')]?_0x2001ac[_0xacb4('0x1e')][_0xacb4('0x21')]||null:null,'limit':_0x2001ac[_0xacb4('0x1e')]?_0x2001ac[_0xacb4('0x1e')][_0xacb4('0x22')]||null:null,'include':_0x2001ac[_0xacb4('0x1e')]?_0x2001ac[_0xacb4('0x1e')]['include']?_[_0xacb4('0x23')](_0x2001ac[_0xacb4('0x1e')][_0xacb4('0x24')],function(_0x2b6a20){return{'model':db[_0x2b6a20[_0xacb4('0x25')]],'as':_0x2b6a20['as'],'attributes':_0x2b6a20[_0xacb4('0x21')],'include':_0x2b6a20[_0xacb4('0x24')]?_[_0xacb4('0x23')](_0x2b6a20['include'],function(_0x2b82a3){return{'model':db[_0x2b82a3[_0xacb4('0x25')]],'as':_0x2b82a3['as'],'attributes':_0x2b82a3[_0xacb4('0x21')],'include':_0x2b82a3[_0xacb4('0x24')]?_[_0xacb4('0x23')](_0x2b82a3[_0xacb4('0x24')],function(_0x53f420){return{'model':db[_0x53f420[_0xacb4('0x25')]],'as':_0x53f420['as'],'attributes':_0x53f420[_0xacb4('0x21')]};}):[]};}):[]};}):[]:[]})[_0xacb4('0xf')](function(_0x2e7ab7){logger[_0xacb4('0x18')](_0xacb4('0x1b'),_0x2001ac);logger[_0xacb4('0x12')](_0xacb4('0x1b'),_0x2001ac,JSON[_0xacb4('0x14')](_0x2e7ab7));_0x3a6ca6(_0x2e7ab7);})['catch'](function(_0x23dd33){logger['error'](_0xacb4('0x1b'),_0x23dd33[_0xacb4('0x17')],_0x2001ac);_0xe1a766(_0x3819fe[_0xacb4('0x15')](0x1f4,_0x23dd33[_0xacb4('0x17')]));});});};exports[_0xacb4('0x26')]=function(_0x3d6609){var _0xe3b52=this;return new Promise(function(_0x3d5b5e,_0x2614b6){return db['SmsQueue'][_0xacb4('0x27')]({'raw':_0x3d6609['options']?_0x3d6609['options']['raw']===undefined?!![]:![]:!![],'where':_0x3d6609['options']?_0x3d6609[_0xacb4('0x1e')][_0xacb4('0x20')]||null:null,'attributes':_0x3d6609[_0xacb4('0x1e')]?_0x3d6609[_0xacb4('0x1e')][_0xacb4('0x21')]||null:null,'include':_0x3d6609[_0xacb4('0x1e')]?_0x3d6609['options'][_0xacb4('0x24')]?_[_0xacb4('0x23')](_0x3d6609[_0xacb4('0x1e')][_0xacb4('0x24')],function(_0x1f0067){return{'model':db[_0x1f0067[_0xacb4('0x25')]],'as':_0x1f0067['as'],'attributes':_0x1f0067['attributes'],'include':_0x1f0067['include']?_[_0xacb4('0x23')](_0x1f0067['include'],function(_0x42c159){return{'model':db[_0x42c159[_0xacb4('0x25')]],'as':_0x42c159['as'],'attributes':_0x42c159[_0xacb4('0x21')],'include':_0x42c159['include']?_['map'](_0x42c159[_0xacb4('0x24')],function(_0x2628c6){return{'model':db[_0x2628c6[_0xacb4('0x25')]],'as':_0x2628c6['as'],'attributes':_0x2628c6[_0xacb4('0x21')]};}):[]};}):[]};}):[]:[]})[_0xacb4('0xf')](function(_0x2afc4f){logger[_0xacb4('0x18')](_0xacb4('0x26'),_0x3d6609);logger[_0xacb4('0x12')](_0xacb4('0x26'),_0x3d6609,JSON[_0xacb4('0x14')](_0x2afc4f));_0x3d5b5e(_0x2afc4f);})[_0xacb4('0x1a')](function(_0x1656df){logger[_0xacb4('0x15')](_0xacb4('0x26'),_0x1656df[_0xacb4('0x17')],_0x3d6609);_0x2614b6(_0xe3b52[_0xacb4('0x15')](0x1f4,_0x1656df[_0xacb4('0x17')]));});});}; \ No newline at end of file +var _0xadbc=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','localhost','socket.io-emitter','redis','./smsQueue.socket','register','then','info','SmsQueue,\x20%s,\x20%s','debug','SmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','GetSmsQueue','SmsQueue','findAll','options','raw','limit','include','map','model','attributes','catch','ShowSmsQueue','find','where','util','moment','bluebird','randomstring'];(function(_0x449c33,_0x25831d){var _0x278cea=function(_0x4a452d){while(--_0x4a452d){_0x449c33['push'](_0x449c33['shift']());}};_0x278cea(++_0x25831d);}(_0xadbc,0x182));var _0xcadb=function(_0x1ac264,_0x99e7b8){_0x1ac264=_0x1ac264-0x0;var _0x220b78=_0xadbc[_0x1ac264];return _0x220b78;};'use strict';var _=require('lodash');var util=require(_0xcadb('0x0'));var moment=require(_0xcadb('0x1'));var BPromise=require(_0xcadb('0x2'));var rs=require(_0xcadb('0x3'));var fs=require('fs');var Redis=require(_0xcadb('0x4'));var db=require(_0xcadb('0x5'))['db'];var utils=require(_0xcadb('0x6'));var logger=require(_0xcadb('0x7'))(_0xcadb('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xcadb('0x9')]({'port':0x232a});config['redis']=_['defaults'](config['redis'],{'host':_0xcadb('0xa'),'port':0x18eb});var socket=require(_0xcadb('0xb'))(new Redis(config[_0xcadb('0xc')]));require(_0xcadb('0xd'))[_0xcadb('0xe')](socket);function respondWithRpcPromise(_0xa8ab2d,_0x4c79c1,_0x423972){return new BPromise(function(_0x8613af,_0x4338b5){return client['request'](_0xa8ab2d,_0x423972)[_0xcadb('0xf')](function(_0x3239c1){logger[_0xcadb('0x10')](_0xcadb('0x11'),_0x4c79c1,'request\x20sent');logger[_0xcadb('0x12')](_0xcadb('0x13'),_0x4c79c1,_0xcadb('0x14'),JSON[_0xcadb('0x15')](_0x3239c1));if(_0x3239c1['error']){if(_0x3239c1[_0xcadb('0x16')][_0xcadb('0x17')]===0x1f4){logger[_0xcadb('0x16')](_0xcadb('0x11'),_0x4c79c1,_0x3239c1[_0xcadb('0x16')][_0xcadb('0x18')]);return _0x4338b5(_0x3239c1[_0xcadb('0x16')][_0xcadb('0x18')]);}logger[_0xcadb('0x16')](_0xcadb('0x11'),_0x4c79c1,_0x3239c1[_0xcadb('0x16')][_0xcadb('0x18')]);return _0x8613af(_0x3239c1['error'][_0xcadb('0x18')]);}else{logger[_0xcadb('0x10')](_0xcadb('0x11'),_0x4c79c1,_0xcadb('0x14'));_0x8613af(_0x3239c1['result'][_0xcadb('0x18')]);}})['catch'](function(_0x5edb01){logger[_0xcadb('0x16')]('SmsQueue,\x20%s,\x20%s',_0x4c79c1,_0x5edb01);_0x4338b5(_0x5edb01);});});}exports[_0xcadb('0x19')]=function(_0x23f3bd){var _0x478cec=this;return new Promise(function(_0x2fdb1b,_0x1f0993){return db[_0xcadb('0x1a')][_0xcadb('0x1b')]({'raw':_0x23f3bd['options']?_0x23f3bd[_0xcadb('0x1c')][_0xcadb('0x1d')]===undefined?!![]:![]:!![],'where':_0x23f3bd['options']?_0x23f3bd[_0xcadb('0x1c')]['where']||null:null,'attributes':_0x23f3bd[_0xcadb('0x1c')]?_0x23f3bd[_0xcadb('0x1c')]['attributes']||null:null,'limit':_0x23f3bd[_0xcadb('0x1c')]?_0x23f3bd['options'][_0xcadb('0x1e')]||null:null,'include':_0x23f3bd[_0xcadb('0x1c')]?_0x23f3bd[_0xcadb('0x1c')][_0xcadb('0x1f')]?_[_0xcadb('0x20')](_0x23f3bd['options'][_0xcadb('0x1f')],function(_0xe792f5){return{'model':db[_0xe792f5[_0xcadb('0x21')]],'as':_0xe792f5['as'],'attributes':_0xe792f5[_0xcadb('0x22')],'include':_0xe792f5['include']?_[_0xcadb('0x20')](_0xe792f5['include'],function(_0x5c37fe){return{'model':db[_0x5c37fe['model']],'as':_0x5c37fe['as'],'attributes':_0x5c37fe[_0xcadb('0x22')],'include':_0x5c37fe['include']?_[_0xcadb('0x20')](_0x5c37fe['include'],function(_0x286b1d){return{'model':db[_0x286b1d['model']],'as':_0x286b1d['as'],'attributes':_0x286b1d['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x51863f){logger[_0xcadb('0x10')](_0xcadb('0x19'),_0x23f3bd);logger['debug'](_0xcadb('0x19'),_0x23f3bd,JSON[_0xcadb('0x15')](_0x51863f));_0x2fdb1b(_0x51863f);})[_0xcadb('0x23')](function(_0x2897ad){logger[_0xcadb('0x16')](_0xcadb('0x19'),_0x2897ad[_0xcadb('0x18')],_0x23f3bd);_0x1f0993(_0x478cec[_0xcadb('0x16')](0x1f4,_0x2897ad['message']));});});};exports[_0xcadb('0x24')]=function(_0x5ec004){var _0x4bfa36=this;return new Promise(function(_0x4d670,_0x448001){return db[_0xcadb('0x1a')][_0xcadb('0x25')]({'raw':_0x5ec004[_0xcadb('0x1c')]?_0x5ec004[_0xcadb('0x1c')][_0xcadb('0x1d')]===undefined?!![]:![]:!![],'where':_0x5ec004[_0xcadb('0x1c')]?_0x5ec004[_0xcadb('0x1c')][_0xcadb('0x26')]||null:null,'attributes':_0x5ec004[_0xcadb('0x1c')]?_0x5ec004[_0xcadb('0x1c')][_0xcadb('0x22')]||null:null,'include':_0x5ec004[_0xcadb('0x1c')]?_0x5ec004[_0xcadb('0x1c')][_0xcadb('0x1f')]?_[_0xcadb('0x20')](_0x5ec004[_0xcadb('0x1c')]['include'],function(_0x2463f0){return{'model':db[_0x2463f0[_0xcadb('0x21')]],'as':_0x2463f0['as'],'attributes':_0x2463f0['attributes'],'include':_0x2463f0[_0xcadb('0x1f')]?_['map'](_0x2463f0[_0xcadb('0x1f')],function(_0x5c4366){return{'model':db[_0x5c4366[_0xcadb('0x21')]],'as':_0x5c4366['as'],'attributes':_0x5c4366[_0xcadb('0x22')],'include':_0x5c4366[_0xcadb('0x1f')]?_[_0xcadb('0x20')](_0x5c4366[_0xcadb('0x1f')],function(_0xf30744){return{'model':db[_0xf30744[_0xcadb('0x21')]],'as':_0xf30744['as'],'attributes':_0xf30744['attributes']};}):[]};}):[]};}):[]:[]})[_0xcadb('0xf')](function(_0x57c977){logger['info'](_0xcadb('0x24'),_0x5ec004);logger[_0xcadb('0x12')]('ShowSmsQueue',_0x5ec004,JSON['stringify'](_0x57c977));_0x4d670(_0x57c977);})[_0xcadb('0x23')](function(_0x1d09ce){logger[_0xcadb('0x16')](_0xcadb('0x24'),_0x1d09ce[_0xcadb('0x18')],_0x5ec004);_0x448001(_0x4bfa36['error'](0x1f4,_0x1d09ce[_0xcadb('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index c8642e5..8527b9f 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 _0x7131=['./smsQueue.events','update','emit'];(function(_0x12ab5f,_0x3e6569){var _0x4d3109=function(_0x41abc7){while(--_0x41abc7){_0x12ab5f['push'](_0x12ab5f['shift']());}};_0x4d3109(++_0x3e6569);}(_0x7131,0x108));var _0x1713=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0x7131[_0x11c573];return _0x6b72de;};'use strict';var SmsQueueEvents=require(_0x1713('0x0'));var events=['save','remove',_0x1713('0x1')];function createListener(_0x1a71e9,_0x4e68ea){return function(_0xe2f1f0){_0x4e68ea[_0x1713('0x2')](_0x1a71e9,_0xe2f1f0);};}function removeListener(_0x53a094,_0x280fad){return function(){SmsQueueEvents['removeListener'](_0x53a094,_0x280fad);};}exports['register']=function(_0x39b30e){for(var _0x3c9b97=0x0,_0x52550f=events['length'];_0x3c9b97<_0x52550f;_0x3c9b97++){var _0x2d7bb9=events[_0x3c9b97];var _0x4234ac=createListener('smsQueue:'+_0x2d7bb9,_0x39b30e);SmsQueueEvents['on'](_0x2d7bb9,_0x4234ac);}}; \ No newline at end of file +var _0xc0dc=['update','emit','register','save','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xc0dc,0x1a7));var _0xcc0d=function(_0x54dd61,_0x5861f4){_0x54dd61=_0x54dd61-0x0;var _0x68af3b=_0xc0dc[_0x54dd61];return _0x68af3b;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=[_0xcc0d('0x0'),_0xcc0d('0x1'),_0xcc0d('0x2')];function createListener(_0x3d6e73,_0x6de302){return function(_0x42b035){_0x6de302[_0xcc0d('0x3')](_0x3d6e73,_0x42b035);};}function removeListener(_0x51572d,_0x51b1a4){return function(){SmsQueueEvents['removeListener'](_0x51572d,_0x51b1a4);};}exports[_0xcc0d('0x4')]=function(_0x1abd49){for(var _0x24accc=0x0,_0x2101fb=events['length'];_0x24accc<_0x2101fb;_0x24accc++){var _0x5dacdf=events[_0x24accc];var _0x171f76=createListener('smsQueue:'+_0x5dacdf,_0x1abd49);SmsQueueEvents['on'](_0x5dacdf,_0x171f76);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 29c6672..7ed01d3 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 _0x9f2a=['../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x5c768b,_0x5e88a6){var _0x335af8=function(_0x39b04f){while(--_0x39b04f){_0x5c768b['push'](_0x5c768b['shift']());}};_0x335af8(++_0x5e88a6);}(_0x9f2a,0x123));var _0xa9f2=function(_0x1fb3ee,_0x5382b6){_0x1fb3ee=_0x1fb3ee-0x0;var _0x489f2a=_0x9f2a[_0x1fb3ee];return _0x489f2a;};'use strict';var multer=require(_0xa9f2('0x0'));var util=require(_0xa9f2('0x1'));var path=require(_0xa9f2('0x2'));var timeout=require(_0xa9f2('0x3'));var express=require(_0xa9f2('0x4'));var router=express[_0xa9f2('0x5')]();var auth=require(_0xa9f2('0x6'));var interaction=require(_0xa9f2('0x7'));var config=require(_0xa9f2('0x8'));var controller=require('./smsQueueReport.controller');router[_0xa9f2('0x9')]('/',auth[_0xa9f2('0xa')](),controller[_0xa9f2('0xb')]);router['get'](_0xa9f2('0xc'),auth[_0xa9f2('0xa')](),controller[_0xa9f2('0xd')]);router[_0xa9f2('0x9')](_0xa9f2('0xe'),auth['isAuthenticated'](),controller[_0xa9f2('0xf')]);router[_0xa9f2('0x10')]('/',auth['isAuthenticated'](),controller[_0xa9f2('0x11')]);router[_0xa9f2('0x12')](_0xa9f2('0xe'),auth[_0xa9f2('0xa')](),controller[_0xa9f2('0x13')]);router[_0xa9f2('0x14')](_0xa9f2('0xe'),auth[_0xa9f2('0xa')](),controller[_0xa9f2('0x15')]);module[_0xa9f2('0x16')]=router; \ No newline at end of file +var _0xb31a=['util','path','express','Router','../../components/auth/service','../../config/environment','./smsQueueReport.controller','isAuthenticated','get','/describe','/:id','show','post','create','update','destroy','multer'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xb31a,0x1ca));var _0xab31=function(_0x3315be,_0x36eb4f){_0x3315be=_0x3315be-0x0;var _0xd21adc=_0xb31a[_0x3315be];return _0xd21adc;};'use strict';var multer=require(_0xab31('0x0'));var util=require(_0xab31('0x1'));var path=require(_0xab31('0x2'));var timeout=require('connect-timeout');var express=require(_0xab31('0x3'));var router=express[_0xab31('0x4')]();var auth=require(_0xab31('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xab31('0x6'));var controller=require(_0xab31('0x7'));router['get']('/',auth[_0xab31('0x8')](),controller['index']);router[_0xab31('0x9')](_0xab31('0xa'),auth['isAuthenticated'](),controller['describe']);router[_0xab31('0x9')](_0xab31('0xb'),auth[_0xab31('0x8')](),controller[_0xab31('0xc')]);router[_0xab31('0xd')]('/',auth[_0xab31('0x8')](),controller[_0xab31('0xe')]);router['put'](_0xab31('0xb'),auth[_0xab31('0x8')](),controller[_0xab31('0xf')]);router['delete']('/:id',auth[_0xab31('0x8')](),controller[_0xab31('0x10')]);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 24e544f..3c49480 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 _0x4769=['sequelize','exports','STRING','DATE'];(function(_0x177e2f,_0x291299){var _0x4f7d1b=function(_0x459f05){while(--_0x459f05){_0x177e2f['push'](_0x177e2f['shift']());}};_0x4f7d1b(++_0x291299);}(_0x4769,0x1c8));var _0x9476=function(_0x55f593,_0x103d77){_0x55f593=_0x55f593-0x0;var _0x2112bc=_0x4769[_0x55f593];return _0x2112bc;};'use strict';var moment=require('moment');var Sequelize=require(_0x9476('0x0'));module[_0x9476('0x1')]={'uniqueid':{'type':Sequelize[_0x9476('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x9476('0x2')]},'joinAt':{'type':Sequelize[_0x9476('0x3')]},'leaveAt':{'type':Sequelize[_0x9476('0x3')]},'acceptAt':{'type':Sequelize[_0x9476('0x3')]},'exitAt':{'type':Sequelize[_0x9476('0x3')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x60ce=['moment','sequelize','exports','STRING','DATE'];(function(_0x559921,_0x48ad89){var _0xf01d47=function(_0x532f60){while(--_0x532f60){_0x559921['push'](_0x559921['shift']());}};_0xf01d47(++_0x48ad89);}(_0x60ce,0x1d1));var _0xe60c=function(_0xf7bea5,_0x30df33){_0xf7bea5=_0xf7bea5-0x0;var _0x3fd4fe=_0x60ce[_0xf7bea5];return _0x3fd4fe;};'use strict';var moment=require(_0xe60c('0x0'));var Sequelize=require(_0xe60c('0x1'));module[_0xe60c('0x2')]={'uniqueid':{'type':Sequelize[_0xe60c('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xe60c('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xe60c('0x4')]},'acceptAt':{'type':Sequelize[_0xe60c('0x4')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xe60c('0x3')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 47b1b93..76098df 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 _0xb625=['../../config/environment','status','json','count','offset','limit','set','Content-Range','apply','update','then','end','error','stack','name','send','index','map','SmsQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','show','params','length','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api'];(function(_0x3d0e12,_0x41e165){var _0x22da51=function(_0x274763){while(--_0x274763){_0x3d0e12['push'](_0x3d0e12['shift']());}};_0x22da51(++_0x41e165);}(_0xb625,0x19e));var _0x5b62=function(_0x3cd975,_0x23f21f){_0x3cd975=_0x3cd975-0x0;var _0x579111=_0xb625[_0x3cd975];return _0x579111;};'use strict';var pdf=require(_0x5b62('0x0'));var emlformat=require(_0x5b62('0x1'));var rimraf=require(_0x5b62('0x2'));var zipdir=require(_0x5b62('0x3'));var jsonpatch=require(_0x5b62('0x4'));var rp=require('request-promise');var moment=require(_0x5b62('0x5'));var BPromise=require(_0x5b62('0x6'));var Mustache=require(_0x5b62('0x7'));var util=require(_0x5b62('0x8'));var path=require(_0x5b62('0x9'));var sox=require(_0x5b62('0xa'));var csv=require(_0x5b62('0xb'));var ejs=require(_0x5b62('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5b62('0xd'));var crypto=require(_0x5b62('0xe'));var jsforce=require(_0x5b62('0xf'));var deskjs=require(_0x5b62('0x10'));var toCsv=require(_0x5b62('0xb'));var querystring=require(_0x5b62('0x11'));var Papa=require('papaparse');var Redis=require(_0x5b62('0x12'));var authService=require(_0x5b62('0x13'));var qs=require(_0x5b62('0x14'));var as=require(_0x5b62('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5b62('0x16'))(_0x5b62('0x17'));var utils=require('../../config/utils');var config=require(_0x5b62('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x44fef1,_0x57ddcf){_0x57ddcf=_0x57ddcf||0xcc;return function(_0x5b04bb){if(_0x5b04bb){return _0x44fef1['sendStatus'](_0x57ddcf);}return _0x44fef1[_0x5b62('0x19')](_0x57ddcf)['end']();};}function respondWithResult(_0x103112,_0x5ca33b){_0x5ca33b=_0x5ca33b||0xc8;return function(_0x2ee7ac){if(_0x2ee7ac){return _0x103112[_0x5b62('0x19')](_0x5ca33b)[_0x5b62('0x1a')](_0x2ee7ac);}};}function respondWithFilteredResult(_0x447e23,_0x5a4009){return function(_0x33663c){if(_0x33663c){var _0x5d418e=_0x33663c[_0x5b62('0x1b')],_0x393c6f=_0x5a4009[_0x5b62('0x1c')],_0x5ddd3a=_0x5a4009[_0x5b62('0x1c')]+_0x5a4009[_0x5b62('0x1d')],_0x1e75b8;if(_0x5ddd3a>=_0x5d418e){_0x5ddd3a=_0x5d418e;_0x1e75b8=0xc8;}else{_0x1e75b8=0xce;}_0x447e23[_0x5b62('0x19')](_0x1e75b8);return _0x447e23[_0x5b62('0x1e')](_0x5b62('0x1f'),_0x393c6f+'-'+_0x5ddd3a+'/'+_0x5d418e)['json'](_0x33663c);}return null;};}function patchUpdates(_0x298b86){return function(_0x1060fc){try{jsonpatch[_0x5b62('0x20')](_0x1060fc,_0x298b86,!![]);}catch(_0x346e0d){return BPromise['reject'](_0x346e0d);}return _0x1060fc['save']();};}function saveUpdates(_0x34202b,_0x4af83b){return function(_0x1ae39d){if(_0x1ae39d){return _0x1ae39d[_0x5b62('0x21')](_0x34202b)[_0x5b62('0x22')](function(_0x64cdb8){return _0x64cdb8;});}return null;};}function removeEntity(_0x5b66cc,_0x43c7e5){return function(_0x1c00ff){if(_0x1c00ff){return _0x1c00ff['destroy']()['then'](function(){_0x5b66cc['status'](0xcc)[_0x5b62('0x23')]();});}};}function handleEntityNotFound(_0x2a5d96,_0x1bdd76){return function(_0x1518e4){if(!_0x1518e4){_0x2a5d96['sendStatus'](0x194);}return _0x1518e4;};}function handleError(_0x59cbc9,_0x39a17a){_0x39a17a=_0x39a17a||0x1f4;return function(_0x444fe7){logger[_0x5b62('0x24')](_0x444fe7[_0x5b62('0x25')]);if(_0x444fe7[_0x5b62('0x26')]){delete _0x444fe7[_0x5b62('0x26')];}_0x59cbc9[_0x5b62('0x19')](_0x39a17a)[_0x5b62('0x27')](_0x444fe7);};}exports[_0x5b62('0x28')]=function(_0x1d31de,_0x3aec34){var _0x50a2f6={},_0x58a148={},_0x4d5370={'count':0x0,'rows':[]};var _0xbf749e=_[_0x5b62('0x29')](db[_0x5b62('0x2a')][_0x5b62('0x2b')],function(_0xbdd721){return{'name':_0xbdd721['fieldName'],'type':_0xbdd721[_0x5b62('0x2c')][_0x5b62('0x2d')]};});_0x58a148[_0x5b62('0x2e')]=_[_0x5b62('0x29')](_0xbf749e,_0x5b62('0x26'));_0x58a148[_0x5b62('0x2f')]=_[_0x5b62('0x30')](_0x1d31de[_0x5b62('0x2f')]);_0x58a148[_0x5b62('0x31')]=_[_0x5b62('0x32')](_0x58a148['model'],_0x58a148[_0x5b62('0x2f')]);_0x50a2f6[_0x5b62('0x33')]=_[_0x5b62('0x32')](_0x58a148[_0x5b62('0x2e')],qs[_0x5b62('0x34')](_0x1d31de[_0x5b62('0x2f')][_0x5b62('0x34')]));_0x50a2f6['attributes']=_0x50a2f6[_0x5b62('0x33')]['length']?_0x50a2f6[_0x5b62('0x33')]:_0x58a148[_0x5b62('0x2e')];if(!_0x1d31de[_0x5b62('0x2f')][_0x5b62('0x35')](_0x5b62('0x36'))){_0x50a2f6['limit']=qs[_0x5b62('0x1d')](_0x1d31de[_0x5b62('0x2f')][_0x5b62('0x1d')]);_0x50a2f6[_0x5b62('0x1c')]=qs[_0x5b62('0x1c')](_0x1d31de[_0x5b62('0x2f')][_0x5b62('0x1c')]);}_0x50a2f6['order']=qs[_0x5b62('0x37')](_0x1d31de[_0x5b62('0x2f')][_0x5b62('0x37')]);_0x50a2f6[_0x5b62('0x38')]=qs[_0x5b62('0x31')](_[_0x5b62('0x39')](_0x1d31de[_0x5b62('0x2f')],_0x58a148[_0x5b62('0x31')]));if(_0x1d31de['query'][_0x5b62('0x3a')]){_0x50a2f6[_0x5b62('0x38')]=_[_0x5b62('0x3b')](_0x50a2f6[_0x5b62('0x38')],{'$or':_[_0x5b62('0x29')](_0xbf749e,function(_0x39fdfa){if(_0x39fdfa['type']!==_0x5b62('0x3c')){var _0x271bd9={};_0x271bd9[_0x39fdfa[_0x5b62('0x26')]]={'$like':'%'+_0x1d31de['query']['filter']+'%'};return _0x271bd9;}})});}_0x50a2f6=_[_0x5b62('0x3b')]({},_0x50a2f6,_0x1d31de[_0x5b62('0x3d')]);var _0x2d3a03={'where':_0x50a2f6[_0x5b62('0x38')]};return db[_0x5b62('0x2a')][_0x5b62('0x1b')](_0x2d3a03)['then'](function(_0x57d8cb){_0x4d5370[_0x5b62('0x1b')]=_0x57d8cb;if(_0x1d31de[_0x5b62('0x2f')]['includeAll']){_0x50a2f6[_0x5b62('0x3e')]=[{'all':!![]}];}return db['SmsQueueReport'][_0x5b62('0x3f')](_0x50a2f6);})[_0x5b62('0x22')](function(_0x1c36d5){_0x4d5370['rows']=_0x1c36d5;return _0x4d5370;})[_0x5b62('0x22')](respondWithFilteredResult(_0x3aec34,_0x50a2f6))['catch'](handleError(_0x3aec34,null));};exports[_0x5b62('0x40')]=function(_0x4b065e,_0x5574ee){var _0x319101={'raw':!![],'where':{'id':_0x4b065e[_0x5b62('0x41')]['id']}},_0x397dcc={};_0x397dcc[_0x5b62('0x2e')]=_['keys'](db[_0x5b62('0x2a')][_0x5b62('0x2b')]);_0x397dcc[_0x5b62('0x2f')]=_[_0x5b62('0x30')](_0x4b065e[_0x5b62('0x2f')]);_0x397dcc[_0x5b62('0x31')]=_['intersection'](_0x397dcc[_0x5b62('0x2e')],_0x397dcc[_0x5b62('0x2f')]);_0x319101[_0x5b62('0x33')]=_[_0x5b62('0x32')](_0x397dcc[_0x5b62('0x2e')],qs[_0x5b62('0x34')](_0x4b065e[_0x5b62('0x2f')]['fields']));_0x319101[_0x5b62('0x33')]=_0x319101[_0x5b62('0x33')][_0x5b62('0x42')]?_0x319101['attributes']:_0x397dcc[_0x5b62('0x2e')];if(_0x4b065e[_0x5b62('0x2f')]['includeAll']){_0x319101[_0x5b62('0x3e')]=[{'all':!![]}];}_0x319101=_['merge']({},_0x319101,_0x4b065e[_0x5b62('0x3d')]);return db[_0x5b62('0x2a')][_0x5b62('0x43')](_0x319101)[_0x5b62('0x22')](handleEntityNotFound(_0x5574ee,null))[_0x5b62('0x22')](respondWithResult(_0x5574ee,null))[_0x5b62('0x44')](handleError(_0x5574ee,null));};exports[_0x5b62('0x45')]=function(_0x121c5c,_0x4f7a2e){return db[_0x5b62('0x2a')][_0x5b62('0x45')](_0x121c5c[_0x5b62('0x46')],{})[_0x5b62('0x22')](respondWithResult(_0x4f7a2e,0xc9))['catch'](handleError(_0x4f7a2e,null));};exports['update']=function(_0x58132f,_0x5b1122){if(_0x58132f[_0x5b62('0x46')]['id']){delete _0x58132f['body']['id'];}return db[_0x5b62('0x2a')][_0x5b62('0x43')]({'where':{'id':_0x58132f[_0x5b62('0x41')]['id']}})[_0x5b62('0x22')](handleEntityNotFound(_0x5b1122,null))[_0x5b62('0x22')](saveUpdates(_0x58132f[_0x5b62('0x46')],null))[_0x5b62('0x22')](respondWithResult(_0x5b1122,null))['catch'](handleError(_0x5b1122,null));};exports[_0x5b62('0x47')]=function(_0x29c040,_0x14a2d3){return db[_0x5b62('0x2a')][_0x5b62('0x43')]({'where':{'id':_0x29c040[_0x5b62('0x41')]['id']}})['then'](handleEntityNotFound(_0x14a2d3,null))[_0x5b62('0x22')](removeEntity(_0x14a2d3,null))[_0x5b62('0x44')](handleError(_0x14a2d3,null));};exports[_0x5b62('0x48')]=function(_0x1be539,_0x2b758c){return db['SmsQueueReport'][_0x5b62('0x48')]()[_0x5b62('0x22')](respondWithResult(_0x2b758c,null))['catch'](handleError(_0x2b758c,null));}; \ No newline at end of file +var _0xb09c=['mustache','util','path','sox','lodash','crypto','jsforce','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','send','map','SmsQueueReport','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','filters','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','params','length','options','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird'];(function(_0x250ed4,_0x9bb8b2){var _0x2c5a32=function(_0x5ec55d){while(--_0x5ec55d){_0x250ed4['push'](_0x250ed4['shift']());}};_0x2c5a32(++_0x9bb8b2);}(_0xb09c,0xda));var _0xcb09=function(_0x2c0f69,_0x1b21a5){_0x2c0f69=_0x2c0f69-0x0;var _0x377920=_0xb09c[_0x2c0f69];return _0x377920;};'use strict';var pdf=require(_0xcb09('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xcb09('0x1'));var zipdir=require(_0xcb09('0x2'));var jsonpatch=require(_0xcb09('0x3'));var rp=require(_0xcb09('0x4'));var moment=require(_0xcb09('0x5'));var BPromise=require(_0xcb09('0x6'));var Mustache=require(_0xcb09('0x7'));var util=require(_0xcb09('0x8'));var path=require(_0xcb09('0x9'));var sox=require(_0xcb09('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcb09('0xb'));var squel=require('squel');var crypto=require(_0xcb09('0xc'));var jsforce=require(_0xcb09('0xd'));var deskjs=require(_0xcb09('0xe'));var toCsv=require(_0xcb09('0xf'));var querystring=require('querystring');var Papa=require(_0xcb09('0x10'));var Redis=require(_0xcb09('0x11'));var authService=require(_0xcb09('0x12'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xcb09('0x13'))('api');var utils=require(_0xcb09('0x14'));var config=require(_0xcb09('0x15'));var db=require(_0xcb09('0x16'))['db'];function respondWithStatusCode(_0x485db4,_0x5c6b4a){_0x5c6b4a=_0x5c6b4a||0xcc;return function(_0x27d1b9){if(_0x27d1b9){return _0x485db4[_0xcb09('0x17')](_0x5c6b4a);}return _0x485db4['status'](_0x5c6b4a)[_0xcb09('0x18')]();};}function respondWithResult(_0x3c3d81,_0x613b15){_0x613b15=_0x613b15||0xc8;return function(_0x180222){if(_0x180222){return _0x3c3d81[_0xcb09('0x19')](_0x613b15)['json'](_0x180222);}};}function respondWithFilteredResult(_0x2b6017,_0x593281){return function(_0x1121ed){if(_0x1121ed){var _0x34359a=_0x1121ed[_0xcb09('0x1a')],_0x319df1=_0x593281[_0xcb09('0x1b')],_0x3cbca0=_0x593281[_0xcb09('0x1b')]+_0x593281[_0xcb09('0x1c')],_0x56a788;if(_0x3cbca0>=_0x34359a){_0x3cbca0=_0x34359a;_0x56a788=0xc8;}else{_0x56a788=0xce;}_0x2b6017[_0xcb09('0x19')](_0x56a788);return _0x2b6017[_0xcb09('0x1d')](_0xcb09('0x1e'),_0x319df1+'-'+_0x3cbca0+'/'+_0x34359a)[_0xcb09('0x1f')](_0x1121ed);}return null;};}function patchUpdates(_0x1086c6){return function(_0x26c22c){try{jsonpatch[_0xcb09('0x20')](_0x26c22c,_0x1086c6,!![]);}catch(_0x1c7f0e){return BPromise[_0xcb09('0x21')](_0x1c7f0e);}return _0x26c22c[_0xcb09('0x22')]();};}function saveUpdates(_0x48d26a,_0x525e86){return function(_0x3c5c97){if(_0x3c5c97){return _0x3c5c97[_0xcb09('0x23')](_0x48d26a)['then'](function(_0x412fe7){return _0x412fe7;});}return null;};}function removeEntity(_0x29d9bc,_0x21960a){return function(_0xdabb17){if(_0xdabb17){return _0xdabb17[_0xcb09('0x24')]()[_0xcb09('0x25')](function(){_0x29d9bc[_0xcb09('0x19')](0xcc)[_0xcb09('0x18')]();});}};}function handleEntityNotFound(_0x5e7d95,_0xc57edd){return function(_0x2beb6a){if(!_0x2beb6a){_0x5e7d95['sendStatus'](0x194);}return _0x2beb6a;};}function handleError(_0x1306fe,_0x30cb5b){_0x30cb5b=_0x30cb5b||0x1f4;return function(_0x19c519){logger[_0xcb09('0x26')](_0x19c519[_0xcb09('0x27')]);if(_0x19c519[_0xcb09('0x28')]){delete _0x19c519['name'];}_0x1306fe[_0xcb09('0x19')](_0x30cb5b)[_0xcb09('0x29')](_0x19c519);};}exports['index']=function(_0x574067,_0x31b79c){var _0x2bea77={},_0x5a4f8f={},_0x3a6e72={'count':0x0,'rows':[]};var _0x554af0=_[_0xcb09('0x2a')](db[_0xcb09('0x2b')][_0xcb09('0x2c')],function(_0x4ea316){return{'name':_0x4ea316[_0xcb09('0x2d')],'type':_0x4ea316[_0xcb09('0x2e')][_0xcb09('0x2f')]};});_0x5a4f8f[_0xcb09('0x30')]=_[_0xcb09('0x2a')](_0x554af0,_0xcb09('0x28'));_0x5a4f8f[_0xcb09('0x31')]=_[_0xcb09('0x32')](_0x574067['query']);_0x5a4f8f['filters']=_[_0xcb09('0x33')](_0x5a4f8f[_0xcb09('0x30')],_0x5a4f8f[_0xcb09('0x31')]);_0x2bea77[_0xcb09('0x34')]=_['intersection'](_0x5a4f8f[_0xcb09('0x30')],qs[_0xcb09('0x35')](_0x574067[_0xcb09('0x31')][_0xcb09('0x35')]));_0x2bea77[_0xcb09('0x34')]=_0x2bea77[_0xcb09('0x34')]['length']?_0x2bea77[_0xcb09('0x34')]:_0x5a4f8f[_0xcb09('0x30')];if(!_0x574067[_0xcb09('0x31')][_0xcb09('0x36')](_0xcb09('0x37'))){_0x2bea77['limit']=qs['limit'](_0x574067['query']['limit']);_0x2bea77[_0xcb09('0x1b')]=qs['offset'](_0x574067['query'][_0xcb09('0x1b')]);}_0x2bea77['order']=qs[_0xcb09('0x38')](_0x574067['query'][_0xcb09('0x38')]);_0x2bea77['where']=qs[_0xcb09('0x39')](_['pick'](_0x574067[_0xcb09('0x31')],_0x5a4f8f[_0xcb09('0x39')]));if(_0x574067[_0xcb09('0x31')][_0xcb09('0x3a')]){_0x2bea77[_0xcb09('0x3b')]=_[_0xcb09('0x3c')](_0x2bea77[_0xcb09('0x3b')],{'$or':_['map'](_0x554af0,function(_0x5cd2ea){if(_0x5cd2ea['type']!==_0xcb09('0x3d')){var _0xca1fdf={};_0xca1fdf[_0x5cd2ea[_0xcb09('0x28')]]={'$like':'%'+_0x574067['query'][_0xcb09('0x3a')]+'%'};return _0xca1fdf;}})});}_0x2bea77=_[_0xcb09('0x3c')]({},_0x2bea77,_0x574067['options']);var _0x3b2264={'where':_0x2bea77[_0xcb09('0x3b')]};return db[_0xcb09('0x2b')][_0xcb09('0x1a')](_0x3b2264)[_0xcb09('0x25')](function(_0x4c24cc){_0x3a6e72['count']=_0x4c24cc;if(_0x574067[_0xcb09('0x31')][_0xcb09('0x3e')]){_0x2bea77[_0xcb09('0x3f')]=[{'all':!![]}];}return db[_0xcb09('0x2b')][_0xcb09('0x40')](_0x2bea77);})[_0xcb09('0x25')](function(_0x3162a8){_0x3a6e72[_0xcb09('0x41')]=_0x3162a8;return _0x3a6e72;})[_0xcb09('0x25')](respondWithFilteredResult(_0x31b79c,_0x2bea77))[_0xcb09('0x42')](handleError(_0x31b79c,null));};exports[_0xcb09('0x43')]=function(_0x5b36fa,_0x2d1e91){var _0x20cc70={'raw':!![],'where':{'id':_0x5b36fa[_0xcb09('0x44')]['id']}},_0x3c74a0={};_0x3c74a0['model']=_[_0xcb09('0x32')](db[_0xcb09('0x2b')][_0xcb09('0x2c')]);_0x3c74a0[_0xcb09('0x31')]=_[_0xcb09('0x32')](_0x5b36fa['query']);_0x3c74a0[_0xcb09('0x39')]=_[_0xcb09('0x33')](_0x3c74a0[_0xcb09('0x30')],_0x3c74a0['query']);_0x20cc70[_0xcb09('0x34')]=_[_0xcb09('0x33')](_0x3c74a0[_0xcb09('0x30')],qs['fields'](_0x5b36fa[_0xcb09('0x31')][_0xcb09('0x35')]));_0x20cc70[_0xcb09('0x34')]=_0x20cc70['attributes'][_0xcb09('0x45')]?_0x20cc70[_0xcb09('0x34')]:_0x3c74a0[_0xcb09('0x30')];if(_0x5b36fa[_0xcb09('0x31')]['includeAll']){_0x20cc70[_0xcb09('0x3f')]=[{'all':!![]}];}_0x20cc70=_[_0xcb09('0x3c')]({},_0x20cc70,_0x5b36fa[_0xcb09('0x46')]);return db[_0xcb09('0x2b')][_0xcb09('0x47')](_0x20cc70)['then'](handleEntityNotFound(_0x2d1e91,null))['then'](respondWithResult(_0x2d1e91,null))[_0xcb09('0x42')](handleError(_0x2d1e91,null));};exports[_0xcb09('0x48')]=function(_0x3993f8,_0x5409de){return db[_0xcb09('0x2b')][_0xcb09('0x48')](_0x3993f8[_0xcb09('0x49')],{})['then'](respondWithResult(_0x5409de,0xc9))[_0xcb09('0x42')](handleError(_0x5409de,null));};exports[_0xcb09('0x23')]=function(_0x3d32fb,_0x3d40d4){if(_0x3d32fb[_0xcb09('0x49')]['id']){delete _0x3d32fb[_0xcb09('0x49')]['id'];}return db[_0xcb09('0x2b')][_0xcb09('0x47')]({'where':{'id':_0x3d32fb['params']['id']}})[_0xcb09('0x25')](handleEntityNotFound(_0x3d40d4,null))[_0xcb09('0x25')](saveUpdates(_0x3d32fb[_0xcb09('0x49')],null))['then'](respondWithResult(_0x3d40d4,null))[_0xcb09('0x42')](handleError(_0x3d40d4,null));};exports[_0xcb09('0x24')]=function(_0x10d966,_0x35e588){return db[_0xcb09('0x2b')][_0xcb09('0x47')]({'where':{'id':_0x10d966[_0xcb09('0x44')]['id']}})[_0xcb09('0x25')](handleEntityNotFound(_0x35e588,null))[_0xcb09('0x25')](removeEntity(_0x35e588,null))[_0xcb09('0x42')](handleError(_0x35e588,null));};exports['describe']=function(_0x2062a6,_0x29d0bb){return db[_0xcb09('0x2b')][_0xcb09('0x4a')]()[_0xcb09('0x25')](respondWithResult(_0x29d0bb,null))[_0xcb09('0x42')](handleError(_0x29d0bb,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 6c75e79..79a733d 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 _0xd957=['uniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport'];(function(_0x9df060,_0x253d33){var _0x338dfe=function(_0x17d9a5){while(--_0x17d9a5){_0x9df060['push'](_0x9df060['shift']());}};_0x338dfe(++_0x253d33);}(_0xd957,0x153));var _0x7d95=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd957[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x7d95('0x0'));var util=require(_0x7d95('0x1'));var logger=require('../../config/logger')(_0x7d95('0x2'));var moment=require(_0x7d95('0x3'));var BPromise=require('bluebird');var rp=require(_0x7d95('0x4'));var fs=require('fs');var path=require(_0x7d95('0x5'));var rimraf=require(_0x7d95('0x6'));var config=require(_0x7d95('0x7'));var attributes=require(_0x7d95('0x8'));module[_0x7d95('0x9')]=function(_0x2de581,_0x514355){return _0x2de581[_0x7d95('0xa')](_0x7d95('0xb'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7d95('0xc'),'fields':[_0x7d95('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x6027=['util','../../config/logger','api','moment','bluebird','rimraf','./smsQueueReport.attributes','define','SmsQueueReport','uniqueid','lodash'];(function(_0x26b86b,_0x3885af){var _0x144594=function(_0x4dee32){while(--_0x4dee32){_0x26b86b['push'](_0x26b86b['shift']());}};_0x144594(++_0x3885af);}(_0x6027,0xc5));var _0x7602=function(_0x3acee8,_0x5f3924){_0x3acee8=_0x3acee8-0x0;var _0x5046cc=_0x6027[_0x3acee8];return _0x5046cc;};'use strict';var _=require(_0x7602('0x0'));var util=require(_0x7602('0x1'));var logger=require(_0x7602('0x2'))(_0x7602('0x3'));var moment=require(_0x7602('0x4'));var BPromise=require(_0x7602('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x7602('0x6'));var config=require('../../config/environment');var attributes=require(_0x7602('0x7'));module['exports']=function(_0x35d29a,_0x56f9d1){return _0x35d29a[_0x7602('0x8')](_0x7602('0x9'),attributes,{'tableName':'report_sms_queue','paranoid':![],'indexes':[{'name':_0x7602('0xa'),'fields':[_0x7602('0xa')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.rpc.js b/server/api/smsQueueReport/smsQueueReport.rpc.js index b38d581..201ce71 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 _0x42fc=['debug','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','options','raw','body','where','UpdateSmsQueueReport','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0xbb14db,_0x3ee8c6){var _0x36bed7=function(_0x16c478){while(--_0x16c478){_0xbb14db['push'](_0xbb14db['shift']());}};_0x36bed7(++_0x3ee8c6);}(_0x42fc,0x11c));var _0xc42f=function(_0xe955ae,_0x797078){_0xe955ae=_0xe955ae-0x0;var _0x389cb6=_0x42fc[_0xe955ae];return _0x389cb6;};'use strict';var _=require(_0xc42f('0x0'));var util=require(_0xc42f('0x1'));var moment=require(_0xc42f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc42f('0x3'))['db'];var utils=require(_0xc42f('0x4'));var logger=require(_0xc42f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc42f('0x6'));var client=jayson[_0xc42f('0x7')][_0xc42f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d1088,_0x53e056,_0x178874){return new BPromise(function(_0x21aab5,_0x1d9076){return client['request'](_0x4d1088,_0x178874)[_0xc42f('0x9')](function(_0x516ed3){logger[_0xc42f('0xa')](_0xc42f('0xb'),_0x53e056,_0xc42f('0xc'));logger[_0xc42f('0xd')]('SmsQueueReport,\x20%s,\x20%s,\x20%s',_0x53e056,_0xc42f('0xc'),JSON[_0xc42f('0xe')](_0x516ed3));if(_0x516ed3[_0xc42f('0xf')]){if(_0x516ed3[_0xc42f('0xf')][_0xc42f('0x10')]===0x1f4){logger[_0xc42f('0xf')]('SmsQueueReport,\x20%s,\x20%s',_0x53e056,_0x516ed3['error'][_0xc42f('0x11')]);return _0x1d9076(_0x516ed3[_0xc42f('0xf')][_0xc42f('0x11')]);}logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x53e056,_0x516ed3[_0xc42f('0xf')][_0xc42f('0x11')]);return _0x21aab5(_0x516ed3['error'][_0xc42f('0x11')]);}else{logger[_0xc42f('0xa')](_0xc42f('0xb'),_0x53e056,'request\x20sent');_0x21aab5(_0x516ed3[_0xc42f('0x12')][_0xc42f('0x11')]);}})[_0xc42f('0x13')](function(_0x2c26bb){logger['error'](_0xc42f('0xb'),_0x53e056,_0x2c26bb);_0x1d9076(_0x2c26bb);});});}exports[_0xc42f('0x14')]=function(_0x485cae){var _0x3290ee=this;return new Promise(function(_0x22bb35,_0x150a46){return db[_0xc42f('0x15')]['create'](_0x485cae['body'],{'raw':_0x485cae[_0xc42f('0x16')]?_0x485cae['options'][_0xc42f('0x17')]===undefined?!![]:![]:!![]})['then'](function(_0x434fbe){logger[_0xc42f('0xa')](_0xc42f('0x14'),_0x485cae);logger[_0xc42f('0xd')]('CreateSmsQueueReport',_0x485cae,JSON[_0xc42f('0xe')](_0x434fbe));_0x22bb35(_0x434fbe);})['catch'](function(_0x168dd7){logger[_0xc42f('0xf')]('CreateSmsQueueReport',_0x168dd7[_0xc42f('0x11')],_0x485cae);_0x150a46(_0x3290ee['error'](0x1f4,_0x168dd7[_0xc42f('0x11')]));});});};exports['UpdateSmsQueueReport']=function(_0x43eeea){var _0xb49f3a=this;return new Promise(function(_0x3dd16f,_0x39410e){return db['SmsQueueReport']['update'](_0x43eeea[_0xc42f('0x18')],{'raw':_0x43eeea[_0xc42f('0x16')]?_0x43eeea[_0xc42f('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x43eeea[_0xc42f('0x16')]?_0x43eeea[_0xc42f('0x16')][_0xc42f('0x19')]||null:null,'attributes':_0x43eeea[_0xc42f('0x16')]?_0x43eeea[_0xc42f('0x16')]['attributes']||null:null,'limit':_0x43eeea[_0xc42f('0x16')]?_0x43eeea[_0xc42f('0x16')]['limit']||null:null})['then'](function(_0x3494c5){logger[_0xc42f('0xa')]('UpdateSmsQueueReport',_0x43eeea);logger['debug'](_0xc42f('0x1a'),_0x43eeea,JSON[_0xc42f('0xe')](_0x3494c5));_0x3dd16f(_0x3494c5);})[_0xc42f('0x13')](function(_0x5162df){logger[_0xc42f('0xf')]('UpdateSmsQueueReport',_0x5162df[_0xc42f('0x11')],_0x43eeea);_0x39410e(_0xb49f3a['error'](0x1f4,_0x5162df[_0xc42f('0x11')]));});});}; \ No newline at end of file +var _0x68f7=['lodash','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','then','UpdateSmsQueueReport','raw','where','attributes','limit'];(function(_0x1ebce2,_0x10e903){var _0x4a330c=function(_0x4fd810){while(--_0x4fd810){_0x1ebce2['push'](_0x1ebce2['shift']());}};_0x4a330c(++_0x10e903);}(_0x68f7,0xf5));var _0x768f=function(_0x672125,_0x38ba36){_0x672125=_0x672125-0x0;var _0x21074e=_0x68f7[_0x672125];return _0x21074e;};'use strict';var _=require(_0x768f('0x0'));var util=require(_0x768f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x768f('0x2'));var fs=require('fs');var Redis=require(_0x768f('0x3'));var db=require(_0x768f('0x4'))['db'];var utils=require(_0x768f('0x5'));var logger=require(_0x768f('0x6'))(_0x768f('0x7'));var config=require(_0x768f('0x8'));var jayson=require(_0x768f('0x9'));var client=jayson[_0x768f('0xa')][_0x768f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dd64b,_0x482d53,_0x2ec1eb){return new BPromise(function(_0x17fdf0,_0x27a628){return client[_0x768f('0xc')](_0x4dd64b,_0x2ec1eb)['then'](function(_0xaf1660){logger[_0x768f('0xd')](_0x768f('0xe'),_0x482d53,_0x768f('0xf'));logger[_0x768f('0x10')](_0x768f('0x11'),_0x482d53,_0x768f('0xf'),JSON[_0x768f('0x12')](_0xaf1660));if(_0xaf1660[_0x768f('0x13')]){if(_0xaf1660[_0x768f('0x13')][_0x768f('0x14')]===0x1f4){logger['error']('SmsQueueReport,\x20%s,\x20%s',_0x482d53,_0xaf1660[_0x768f('0x13')][_0x768f('0x15')]);return _0x27a628(_0xaf1660[_0x768f('0x13')][_0x768f('0x15')]);}logger[_0x768f('0x13')](_0x768f('0xe'),_0x482d53,_0xaf1660[_0x768f('0x13')][_0x768f('0x15')]);return _0x17fdf0(_0xaf1660['error'][_0x768f('0x15')]);}else{logger[_0x768f('0xd')](_0x768f('0xe'),_0x482d53,_0x768f('0xf'));_0x17fdf0(_0xaf1660[_0x768f('0x16')][_0x768f('0x15')]);}})[_0x768f('0x17')](function(_0x54c687){logger[_0x768f('0x13')](_0x768f('0xe'),_0x482d53,_0x54c687);_0x27a628(_0x54c687);});});}exports[_0x768f('0x18')]=function(_0xda9def){var _0x3d5078=this;return new Promise(function(_0x3f5ac5,_0x1fceca){return db[_0x768f('0x19')][_0x768f('0x1a')](_0xda9def[_0x768f('0x1b')],{'raw':_0xda9def[_0x768f('0x1c')]?_0xda9def[_0x768f('0x1c')]['raw']===undefined?!![]:![]:!![]})[_0x768f('0x1d')](function(_0x26303b){logger[_0x768f('0xd')]('CreateSmsQueueReport',_0xda9def);logger[_0x768f('0x10')](_0x768f('0x18'),_0xda9def,JSON['stringify'](_0x26303b));_0x3f5ac5(_0x26303b);})[_0x768f('0x17')](function(_0x183eab){logger[_0x768f('0x13')](_0x768f('0x18'),_0x183eab[_0x768f('0x15')],_0xda9def);_0x1fceca(_0x3d5078[_0x768f('0x13')](0x1f4,_0x183eab['message']));});});};exports[_0x768f('0x1e')]=function(_0x28ff05){var _0xec1ffa=this;return new Promise(function(_0x473b53,_0x47109c){return db[_0x768f('0x19')]['update'](_0x28ff05[_0x768f('0x1b')],{'raw':_0x28ff05[_0x768f('0x1c')]?_0x28ff05[_0x768f('0x1c')][_0x768f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x28ff05['options']?_0x28ff05[_0x768f('0x1c')][_0x768f('0x20')]||null:null,'attributes':_0x28ff05['options']?_0x28ff05[_0x768f('0x1c')][_0x768f('0x21')]||null:null,'limit':_0x28ff05['options']?_0x28ff05['options'][_0x768f('0x22')]||null:null})[_0x768f('0x1d')](function(_0x395862){logger[_0x768f('0xd')](_0x768f('0x1e'),_0x28ff05);logger[_0x768f('0x10')](_0x768f('0x1e'),_0x28ff05,JSON[_0x768f('0x12')](_0x395862));_0x473b53(_0x395862);})['catch'](function(_0x3561d6){logger[_0x768f('0x13')](_0x768f('0x1e'),_0x3561d6[_0x768f('0x15')],_0x28ff05);_0x47109c(_0xec1ffa[_0x768f('0x13')](0x1f4,_0x3561d6[_0x768f('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 3dc0c05..19055b2 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 _0xd7d1=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./smsTransferReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','create','put','delete','destroy','multer','util','path','connect-timeout','express'];(function(_0x28111f,_0x254934){var _0x5203e6=function(_0x2c639a){while(--_0x2c639a){_0x28111f['push'](_0x28111f['shift']());}};_0x5203e6(++_0x254934);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x4701ec,_0x515575){_0x4701ec=_0x4701ec-0x0;var _0x5ab7aa=_0xd7d1[_0x4701ec];return _0x5ab7aa;};'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('0xa')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x10')]);router[_0x1d7d('0x11')]('/',auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x12')]);router[_0x1d7d('0x13')]('/:id',auth[_0x1d7d('0xb')](),controller['update']);router[_0x1d7d('0x14')](_0x1d7d('0xf'),auth[_0x1d7d('0xb')](),controller[_0x1d7d('0x15')]);module['exports']=router; \ No newline at end of file +var _0x9ffd=['util','path','express','Router','../../components/auth/service','../../components/interaction/service','./smsTransferReport.controller','get','index','/describe','isAuthenticated','describe','/:id','show','update','delete','destroy','exports','multer'];(function(_0xc13484,_0x2d9b81){var _0x5b7de1=function(_0xca6198){while(--_0xca6198){_0xc13484['push'](_0xc13484['shift']());}};_0x5b7de1(++_0x2d9b81);}(_0x9ffd,0xaa));var _0xd9ff=function(_0x26d58f,_0x38fb8a){_0x26d58f=_0x26d58f-0x0;var _0x3d32db=_0x9ffd[_0x26d58f];return _0x3d32db;};'use strict';var multer=require(_0xd9ff('0x0'));var util=require(_0xd9ff('0x1'));var path=require(_0xd9ff('0x2'));var timeout=require('connect-timeout');var express=require(_0xd9ff('0x3'));var router=express[_0xd9ff('0x4')]();var auth=require(_0xd9ff('0x5'));var interaction=require(_0xd9ff('0x6'));var config=require('../../config/environment');var controller=require(_0xd9ff('0x7'));router[_0xd9ff('0x8')]('/',auth['isAuthenticated'](),controller[_0xd9ff('0x9')]);router[_0xd9ff('0x8')](_0xd9ff('0xa'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xc')]);router[_0xd9ff('0x8')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put'](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0xf')]);router[_0xd9ff('0x10')](_0xd9ff('0xd'),auth[_0xd9ff('0xb')](),controller[_0xd9ff('0x11')]);module[_0xd9ff('0x12')]=router; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.attributes.js b/server/api/smsTransferReport/smsTransferReport.attributes.js index 56816f4..d6cf8c3 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 _0x019c=['agent','queue','DATE','NOW','sequelize','exports','ENUM','account'];(function(_0x2dbdf6,_0x40f023){var _0x596b65=function(_0x949d14){while(--_0x949d14){_0x2dbdf6['push'](_0x2dbdf6['shift']());}};_0x596b65(++_0x40f023);}(_0x019c,0xfc));var _0xc019=function(_0x54e855,_0x2abb82){_0x54e855=_0x54e855-0x0;var _0x6d4d6c=_0x019c[_0x54e855];return _0x6d4d6c;};'use strict';var moment=require('moment');var Sequelize=require(_0xc019('0x0'));module[_0xc019('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xc019('0x2')](_0xc019('0x3'),_0xc019('0x4'),'queue'),'allowNull':![],'defaultValue':_0xc019('0x5')},'transferredAt':{'type':Sequelize[_0xc019('0x6')],'allowNull':![],'defaultValue':Sequelize[_0xc019('0x7')]}}; \ No newline at end of file +var _0xc553=['queue','DATE','NOW','moment','exports','STRING','ENUM'];(function(_0x76ed26,_0x38384c){var _0x476b39=function(_0x1a315b){while(--_0x1a315b){_0x76ed26['push'](_0x76ed26['shift']());}};_0x476b39(++_0x38384c);}(_0xc553,0x8f));var _0x3c55=function(_0x16aa40,_0x4c8c43){_0x16aa40=_0x16aa40-0x0;var _0x43b14f=_0xc553[_0x16aa40];return _0x43b14f;};'use strict';var moment=require(_0x3c55('0x0'));var Sequelize=require('sequelize');module[_0x3c55('0x1')]={'uniqueid':{'type':Sequelize[_0x3c55('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x3c55('0x3')]('account','agent',_0x3c55('0x4')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0x3c55('0x5')],'allowNull':![],'defaultValue':Sequelize[_0x3c55('0x6')]}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index f41f3b5..a6486ec 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 _0xaaa0=['offset','set','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','index','map','SmsTransferReport','fieldName','type','key','model','query','keys','filters','intersection','attributes','length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','count','includeAll','include','findAll','rows','catch','show','params','rawAttributes','fields','options','find','create','body','describe','html-pdf','zip-dir','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json'];(function(_0x1aebfe,_0xb00c5b){var _0x3f0f9b=function(_0x291391){while(--_0x291391){_0x1aebfe['push'](_0x1aebfe['shift']());}};_0x3f0f9b(++_0xb00c5b);}(_0xaaa0,0x162));var _0x0aaa=function(_0x40ed53,_0x426d3c){_0x40ed53=_0x40ed53-0x0;var _0x52d028=_0xaaa0[_0x40ed53];return _0x52d028;};'use strict';var pdf=require(_0x0aaa('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x0aaa('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0aaa('0x2'));var moment=require('moment');var BPromise=require(_0x0aaa('0x3'));var Mustache=require('mustache');var util=require(_0x0aaa('0x4'));var path=require(_0x0aaa('0x5'));var sox=require(_0x0aaa('0x6'));var csv=require(_0x0aaa('0x7'));var ejs=require(_0x0aaa('0x8'));var fs=require('fs');var _=require(_0x0aaa('0x9'));var squel=require(_0x0aaa('0xa'));var crypto=require(_0x0aaa('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x0aaa('0xc'));var toCsv=require(_0x0aaa('0x7'));var querystring=require(_0x0aaa('0xd'));var Papa=require(_0x0aaa('0xe'));var Redis=require(_0x0aaa('0xf'));var authService=require(_0x0aaa('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x0aaa('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0aaa('0x12'))(_0x0aaa('0x13'));var utils=require(_0x0aaa('0x14'));var config=require(_0x0aaa('0x15'));var db=require(_0x0aaa('0x16'))['db'];function respondWithStatusCode(_0x4d52fc,_0x24713e){_0x24713e=_0x24713e||0xcc;return function(_0x434c7a){if(_0x434c7a){return _0x4d52fc['sendStatus'](_0x24713e);}return _0x4d52fc['status'](_0x24713e)[_0x0aaa('0x17')]();};}function respondWithResult(_0x21e877,_0xc3fe86){_0xc3fe86=_0xc3fe86||0xc8;return function(_0x2cb070){if(_0x2cb070){return _0x21e877[_0x0aaa('0x18')](_0xc3fe86)[_0x0aaa('0x19')](_0x2cb070);}};}function respondWithFilteredResult(_0x12febc,_0x594040){return function(_0x4d498b){if(_0x4d498b){var _0x274598=_0x4d498b['count'],_0x581e28=_0x594040['offset'],_0x2428fb=_0x594040[_0x0aaa('0x1a')]+_0x594040['limit'],_0x3e8302;if(_0x2428fb>=_0x274598){_0x2428fb=_0x274598;_0x3e8302=0xc8;}else{_0x3e8302=0xce;}_0x12febc[_0x0aaa('0x18')](_0x3e8302);return _0x12febc[_0x0aaa('0x1b')](_0x0aaa('0x1c'),_0x581e28+'-'+_0x2428fb+'/'+_0x274598)[_0x0aaa('0x19')](_0x4d498b);}return null;};}function patchUpdates(_0x2b3cc8){return function(_0x577606){try{jsonpatch['apply'](_0x577606,_0x2b3cc8,!![]);}catch(_0x4797ac){return BPromise[_0x0aaa('0x1d')](_0x4797ac);}return _0x577606[_0x0aaa('0x1e')]();};}function saveUpdates(_0x4497c2,_0x9d6ea4){return function(_0x1e2faa){if(_0x1e2faa){return _0x1e2faa[_0x0aaa('0x1f')](_0x4497c2)['then'](function(_0x4ca57e){return _0x4ca57e;});}return null;};}function removeEntity(_0x496328,_0x15439e){return function(_0x180980){if(_0x180980){return _0x180980[_0x0aaa('0x20')]()[_0x0aaa('0x21')](function(){_0x496328[_0x0aaa('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x325337,_0x4f508b){return function(_0x23f36f){if(!_0x23f36f){_0x325337[_0x0aaa('0x22')](0x194);}return _0x23f36f;};}function handleError(_0x4f9178,_0x2bea1d){_0x2bea1d=_0x2bea1d||0x1f4;return function(_0x46a3ae){logger[_0x0aaa('0x23')](_0x46a3ae[_0x0aaa('0x24')]);if(_0x46a3ae[_0x0aaa('0x25')]){delete _0x46a3ae[_0x0aaa('0x25')];}_0x4f9178[_0x0aaa('0x18')](_0x2bea1d)[_0x0aaa('0x26')](_0x46a3ae);};}exports[_0x0aaa('0x27')]=function(_0x487c13,_0x558a42){var _0x34a417={},_0x3d77a0={},_0x1cc48e={'count':0x0,'rows':[]};var _0x377eb5=_[_0x0aaa('0x28')](db[_0x0aaa('0x29')]['rawAttributes'],function(_0x1c1fec){return{'name':_0x1c1fec[_0x0aaa('0x2a')],'type':_0x1c1fec[_0x0aaa('0x2b')][_0x0aaa('0x2c')]};});_0x3d77a0[_0x0aaa('0x2d')]=_[_0x0aaa('0x28')](_0x377eb5,_0x0aaa('0x25'));_0x3d77a0[_0x0aaa('0x2e')]=_[_0x0aaa('0x2f')](_0x487c13[_0x0aaa('0x2e')]);_0x3d77a0[_0x0aaa('0x30')]=_[_0x0aaa('0x31')](_0x3d77a0['model'],_0x3d77a0[_0x0aaa('0x2e')]);_0x34a417[_0x0aaa('0x32')]=_[_0x0aaa('0x31')](_0x3d77a0[_0x0aaa('0x2d')],qs['fields'](_0x487c13[_0x0aaa('0x2e')]['fields']));_0x34a417['attributes']=_0x34a417['attributes'][_0x0aaa('0x33')]?_0x34a417[_0x0aaa('0x32')]:_0x3d77a0[_0x0aaa('0x2d')];if(!_0x487c13[_0x0aaa('0x2e')]['hasOwnProperty'](_0x0aaa('0x34'))){_0x34a417[_0x0aaa('0x35')]=qs[_0x0aaa('0x35')](_0x487c13[_0x0aaa('0x2e')][_0x0aaa('0x35')]);_0x34a417[_0x0aaa('0x1a')]=qs['offset'](_0x487c13[_0x0aaa('0x2e')]['offset']);}_0x34a417[_0x0aaa('0x36')]=qs[_0x0aaa('0x37')](_0x487c13[_0x0aaa('0x2e')][_0x0aaa('0x37')]);_0x34a417[_0x0aaa('0x38')]=qs['filters'](_[_0x0aaa('0x39')](_0x487c13[_0x0aaa('0x2e')],_0x3d77a0[_0x0aaa('0x30')]));if(_0x487c13['query'][_0x0aaa('0x3a')]){_0x34a417[_0x0aaa('0x38')]=_[_0x0aaa('0x3b')](_0x34a417['where'],{'$or':_['map'](_0x377eb5,function(_0x4d9110){if(_0x4d9110['type']!==_0x0aaa('0x3c')){var _0xcd86b3={};_0xcd86b3[_0x4d9110['name']]={'$like':'%'+_0x487c13['query'][_0x0aaa('0x3a')]+'%'};return _0xcd86b3;}})});}_0x34a417=_[_0x0aaa('0x3b')]({},_0x34a417,_0x487c13['options']);var _0x4ba8de={'where':_0x34a417[_0x0aaa('0x38')]};return db[_0x0aaa('0x29')][_0x0aaa('0x3d')](_0x4ba8de)['then'](function(_0x16c810){_0x1cc48e[_0x0aaa('0x3d')]=_0x16c810;if(_0x487c13[_0x0aaa('0x2e')][_0x0aaa('0x3e')]){_0x34a417[_0x0aaa('0x3f')]=[{'all':!![]}];}return db[_0x0aaa('0x29')][_0x0aaa('0x40')](_0x34a417);})[_0x0aaa('0x21')](function(_0x1e0305){_0x1cc48e[_0x0aaa('0x41')]=_0x1e0305;return _0x1cc48e;})['then'](respondWithFilteredResult(_0x558a42,_0x34a417))[_0x0aaa('0x42')](handleError(_0x558a42,null));};exports[_0x0aaa('0x43')]=function(_0x1fd694,_0x51a39b){var _0x183430={'raw':!![],'where':{'id':_0x1fd694[_0x0aaa('0x44')]['id']}},_0xea7dfd={};_0xea7dfd[_0x0aaa('0x2d')]=_[_0x0aaa('0x2f')](db[_0x0aaa('0x29')][_0x0aaa('0x45')]);_0xea7dfd[_0x0aaa('0x2e')]=_[_0x0aaa('0x2f')](_0x1fd694[_0x0aaa('0x2e')]);_0xea7dfd[_0x0aaa('0x30')]=_[_0x0aaa('0x31')](_0xea7dfd['model'],_0xea7dfd[_0x0aaa('0x2e')]);_0x183430[_0x0aaa('0x32')]=_['intersection'](_0xea7dfd[_0x0aaa('0x2d')],qs[_0x0aaa('0x46')](_0x1fd694['query'][_0x0aaa('0x46')]));_0x183430[_0x0aaa('0x32')]=_0x183430[_0x0aaa('0x32')]['length']?_0x183430[_0x0aaa('0x32')]:_0xea7dfd[_0x0aaa('0x2d')];if(_0x1fd694['query']['includeAll']){_0x183430[_0x0aaa('0x3f')]=[{'all':!![]}];}_0x183430=_['merge']({},_0x183430,_0x1fd694[_0x0aaa('0x47')]);return db[_0x0aaa('0x29')][_0x0aaa('0x48')](_0x183430)[_0x0aaa('0x21')](handleEntityNotFound(_0x51a39b,null))[_0x0aaa('0x21')](respondWithResult(_0x51a39b,null))[_0x0aaa('0x42')](handleError(_0x51a39b,null));};exports['create']=function(_0x578a6,_0x1d86de){return db[_0x0aaa('0x29')][_0x0aaa('0x49')](_0x578a6[_0x0aaa('0x4a')],{})[_0x0aaa('0x21')](respondWithResult(_0x1d86de,0xc9))[_0x0aaa('0x42')](handleError(_0x1d86de,null));};exports['update']=function(_0x519baf,_0x49afcb){if(_0x519baf[_0x0aaa('0x4a')]['id']){delete _0x519baf[_0x0aaa('0x4a')]['id'];}return db[_0x0aaa('0x29')]['find']({'where':{'id':_0x519baf['params']['id']}})[_0x0aaa('0x21')](handleEntityNotFound(_0x49afcb,null))['then'](saveUpdates(_0x519baf[_0x0aaa('0x4a')],null))[_0x0aaa('0x21')](respondWithResult(_0x49afcb,null))[_0x0aaa('0x42')](handleError(_0x49afcb,null));};exports['destroy']=function(_0x448ef3,_0x3269f6){return db['SmsTransferReport'][_0x0aaa('0x48')]({'where':{'id':_0x448ef3[_0x0aaa('0x44')]['id']}})[_0x0aaa('0x21')](handleEntityNotFound(_0x3269f6,null))[_0x0aaa('0x21')](removeEntity(_0x3269f6,null))[_0x0aaa('0x42')](handleError(_0x3269f6,null));};exports[_0x0aaa('0x4b')]=function(_0x4b331b,_0x5c0ed1){return db[_0x0aaa('0x29')][_0x0aaa('0x4b')]()[_0x0aaa('0x21')](respondWithResult(_0x5c0ed1,null))[_0x0aaa('0x42')](handleError(_0x5c0ed1,null));}; \ No newline at end of file +var _0x0475=['findAll','catch','show','params','create','body','update','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','reject','then','destroy','end','error','stack','name','send','index','SmsTransferReport','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','map','type','VIRTUAL','options','includeAll','include'];(function(_0x140534,_0x526394){var _0x5eef58=function(_0x266f99){while(--_0x266f99){_0x140534['push'](_0x140534['shift']());}};_0x5eef58(++_0x526394);}(_0x0475,0x139));var _0x5047=function(_0x34c5a3,_0x5e5b13){_0x34c5a3=_0x34c5a3-0x0;var _0x1a3adf=_0x0475[_0x34c5a3];return _0x1a3adf;};'use strict';var pdf=require(_0x5047('0x0'));var emlformat=require(_0x5047('0x1'));var rimraf=require(_0x5047('0x2'));var zipdir=require(_0x5047('0x3'));var jsonpatch=require(_0x5047('0x4'));var rp=require(_0x5047('0x5'));var moment=require(_0x5047('0x6'));var BPromise=require(_0x5047('0x7'));var Mustache=require(_0x5047('0x8'));var util=require(_0x5047('0x9'));var path=require('path');var sox=require(_0x5047('0xa'));var csv=require(_0x5047('0xb'));var ejs=require(_0x5047('0xc'));var fs=require('fs');var _=require(_0x5047('0xd'));var squel=require('squel');var crypto=require(_0x5047('0xe'));var jsforce=require(_0x5047('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5047('0xb'));var querystring=require(_0x5047('0x10'));var Papa=require(_0x5047('0x11'));var Redis=require(_0x5047('0x12'));var authService=require(_0x5047('0x13'));var qs=require(_0x5047('0x14'));var as=require(_0x5047('0x15'));var hardwareService=require(_0x5047('0x16'));var logger=require('../../config/logger')(_0x5047('0x17'));var utils=require('../../config/utils');var config=require(_0x5047('0x18'));var db=require(_0x5047('0x19'))['db'];function respondWithStatusCode(_0x33884e,_0x197c84){_0x197c84=_0x197c84||0xcc;return function(_0x2f0a29){if(_0x2f0a29){return _0x33884e[_0x5047('0x1a')](_0x197c84);}return _0x33884e[_0x5047('0x1b')](_0x197c84)['end']();};}function respondWithResult(_0x2b5508,_0x583144){_0x583144=_0x583144||0xc8;return function(_0x5c036f){if(_0x5c036f){return _0x2b5508[_0x5047('0x1b')](_0x583144)[_0x5047('0x1c')](_0x5c036f);}};}function respondWithFilteredResult(_0x2e3b58,_0x18368b){return function(_0x406a2d){if(_0x406a2d){var _0xab0c63=_0x406a2d[_0x5047('0x1d')],_0xbf8aaf=_0x18368b[_0x5047('0x1e')],_0x5a463d=_0x18368b[_0x5047('0x1e')]+_0x18368b[_0x5047('0x1f')],_0x482871;if(_0x5a463d>=_0xab0c63){_0x5a463d=_0xab0c63;_0x482871=0xc8;}else{_0x482871=0xce;}_0x2e3b58[_0x5047('0x1b')](_0x482871);return _0x2e3b58['set'](_0x5047('0x20'),_0xbf8aaf+'-'+_0x5a463d+'/'+_0xab0c63)[_0x5047('0x1c')](_0x406a2d);}return null;};}function patchUpdates(_0x38e2d0){return function(_0x3e7dfe){try{jsonpatch['apply'](_0x3e7dfe,_0x38e2d0,!![]);}catch(_0x45c3e5){return BPromise[_0x5047('0x21')](_0x45c3e5);}return _0x3e7dfe['save']();};}function saveUpdates(_0x4f9998,_0x303f59){return function(_0x20bd8d){if(_0x20bd8d){return _0x20bd8d['update'](_0x4f9998)[_0x5047('0x22')](function(_0x1193b3){return _0x1193b3;});}return null;};}function removeEntity(_0x47fc67,_0x3f2316){return function(_0x3ada94){if(_0x3ada94){return _0x3ada94[_0x5047('0x23')]()['then'](function(){_0x47fc67[_0x5047('0x1b')](0xcc)[_0x5047('0x24')]();});}};}function handleEntityNotFound(_0x47a107,_0x42ab5c){return function(_0x3ae6c2){if(!_0x3ae6c2){_0x47a107['sendStatus'](0x194);}return _0x3ae6c2;};}function handleError(_0x470352,_0xd2b0fe){_0xd2b0fe=_0xd2b0fe||0x1f4;return function(_0x41ed85){logger[_0x5047('0x25')](_0x41ed85[_0x5047('0x26')]);if(_0x41ed85[_0x5047('0x27')]){delete _0x41ed85['name'];}_0x470352[_0x5047('0x1b')](_0xd2b0fe)[_0x5047('0x28')](_0x41ed85);};}exports[_0x5047('0x29')]=function(_0x3a2ee5,_0x2aad91){var _0x549fc3={},_0x68ce22={},_0x1e044f={'count':0x0,'rows':[]};var _0x17b92d=_['map'](db[_0x5047('0x2a')][_0x5047('0x2b')],function(_0x2272fc){return{'name':_0x2272fc[_0x5047('0x2c')],'type':_0x2272fc['type'][_0x5047('0x2d')]};});_0x68ce22[_0x5047('0x2e')]=_['map'](_0x17b92d,_0x5047('0x27'));_0x68ce22[_0x5047('0x2f')]=_[_0x5047('0x30')](_0x3a2ee5[_0x5047('0x2f')]);_0x68ce22[_0x5047('0x31')]=_[_0x5047('0x32')](_0x68ce22[_0x5047('0x2e')],_0x68ce22['query']);_0x549fc3['attributes']=_[_0x5047('0x32')](_0x68ce22[_0x5047('0x2e')],qs[_0x5047('0x33')](_0x3a2ee5['query']['fields']));_0x549fc3[_0x5047('0x34')]=_0x549fc3[_0x5047('0x34')][_0x5047('0x35')]?_0x549fc3[_0x5047('0x34')]:_0x68ce22[_0x5047('0x2e')];if(!_0x3a2ee5['query'][_0x5047('0x36')](_0x5047('0x37'))){_0x549fc3[_0x5047('0x1f')]=qs[_0x5047('0x1f')](_0x3a2ee5[_0x5047('0x2f')]['limit']);_0x549fc3[_0x5047('0x1e')]=qs[_0x5047('0x1e')](_0x3a2ee5['query'][_0x5047('0x1e')]);}_0x549fc3['order']=qs[_0x5047('0x38')](_0x3a2ee5[_0x5047('0x2f')][_0x5047('0x38')]);_0x549fc3[_0x5047('0x39')]=qs[_0x5047('0x31')](_[_0x5047('0x3a')](_0x3a2ee5[_0x5047('0x2f')],_0x68ce22[_0x5047('0x31')]));if(_0x3a2ee5['query'][_0x5047('0x3b')]){_0x549fc3[_0x5047('0x39')]=_[_0x5047('0x3c')](_0x549fc3[_0x5047('0x39')],{'$or':_[_0x5047('0x3d')](_0x17b92d,function(_0x4bde69){if(_0x4bde69[_0x5047('0x3e')]!==_0x5047('0x3f')){var _0x324270={};_0x324270[_0x4bde69[_0x5047('0x27')]]={'$like':'%'+_0x3a2ee5['query']['filter']+'%'};return _0x324270;}})});}_0x549fc3=_[_0x5047('0x3c')]({},_0x549fc3,_0x3a2ee5[_0x5047('0x40')]);var _0x2f3623={'where':_0x549fc3['where']};return db[_0x5047('0x2a')][_0x5047('0x1d')](_0x2f3623)[_0x5047('0x22')](function(_0x778d31){_0x1e044f[_0x5047('0x1d')]=_0x778d31;if(_0x3a2ee5[_0x5047('0x2f')][_0x5047('0x41')]){_0x549fc3[_0x5047('0x42')]=[{'all':!![]}];}return db[_0x5047('0x2a')][_0x5047('0x43')](_0x549fc3);})[_0x5047('0x22')](function(_0x14ad91){_0x1e044f['rows']=_0x14ad91;return _0x1e044f;})[_0x5047('0x22')](respondWithFilteredResult(_0x2aad91,_0x549fc3))[_0x5047('0x44')](handleError(_0x2aad91,null));};exports[_0x5047('0x45')]=function(_0xaefe9d,_0x29aef2){var _0x52d3df={'raw':!![],'where':{'id':_0xaefe9d[_0x5047('0x46')]['id']}},_0x341eea={};_0x341eea[_0x5047('0x2e')]=_[_0x5047('0x30')](db[_0x5047('0x2a')][_0x5047('0x2b')]);_0x341eea[_0x5047('0x2f')]=_[_0x5047('0x30')](_0xaefe9d['query']);_0x341eea[_0x5047('0x31')]=_[_0x5047('0x32')](_0x341eea['model'],_0x341eea[_0x5047('0x2f')]);_0x52d3df[_0x5047('0x34')]=_['intersection'](_0x341eea[_0x5047('0x2e')],qs[_0x5047('0x33')](_0xaefe9d[_0x5047('0x2f')][_0x5047('0x33')]));_0x52d3df[_0x5047('0x34')]=_0x52d3df[_0x5047('0x34')][_0x5047('0x35')]?_0x52d3df[_0x5047('0x34')]:_0x341eea['model'];if(_0xaefe9d[_0x5047('0x2f')][_0x5047('0x41')]){_0x52d3df['include']=[{'all':!![]}];}_0x52d3df=_['merge']({},_0x52d3df,_0xaefe9d[_0x5047('0x40')]);return db[_0x5047('0x2a')]['find'](_0x52d3df)[_0x5047('0x22')](handleEntityNotFound(_0x29aef2,null))['then'](respondWithResult(_0x29aef2,null))['catch'](handleError(_0x29aef2,null));};exports[_0x5047('0x47')]=function(_0x3d1698,_0x41997d){return db[_0x5047('0x2a')][_0x5047('0x47')](_0x3d1698[_0x5047('0x48')],{})[_0x5047('0x22')](respondWithResult(_0x41997d,0xc9))[_0x5047('0x44')](handleError(_0x41997d,null));};exports[_0x5047('0x49')]=function(_0x22d0c4,_0x227335){if(_0x22d0c4['body']['id']){delete _0x22d0c4[_0x5047('0x48')]['id'];}return db[_0x5047('0x2a')][_0x5047('0x4a')]({'where':{'id':_0x22d0c4[_0x5047('0x46')]['id']}})[_0x5047('0x22')](handleEntityNotFound(_0x227335,null))[_0x5047('0x22')](saveUpdates(_0x22d0c4[_0x5047('0x48')],null))[_0x5047('0x22')](respondWithResult(_0x227335,null))['catch'](handleError(_0x227335,null));};exports['destroy']=function(_0x28a97b,_0x32024d){return db[_0x5047('0x2a')][_0x5047('0x4a')]({'where':{'id':_0x28a97b[_0x5047('0x46')]['id']}})[_0x5047('0x22')](handleEntityNotFound(_0x32024d,null))[_0x5047('0x22')](removeEntity(_0x32024d,null))['catch'](handleError(_0x32024d,null));};exports[_0x5047('0x4b')]=function(_0xb7f8d2,_0xb8b9f8){return db[_0x5047('0x2a')][_0x5047('0x4b')]()['then'](respondWithResult(_0xb8b9f8,null))[_0x5047('0x44')](handleError(_0xb8b9f8,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index 5f152e4..6949be8 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 _0x7bd0=['path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x58d96f,_0x2e17e4){var _0x3fa2e5=function(_0x48dc97){while(--_0x48dc97){_0x58d96f['push'](_0x58d96f['shift']());}};_0x3fa2e5(++_0x2e17e4);}(_0x7bd0,0x111));var _0x07bd=function(_0x220f3f,_0x11c540){_0x220f3f=_0x220f3f-0x0;var _0x1f170e=_0x7bd0[_0x220f3f];return _0x1f170e;};'use strict';var _=require(_0x07bd('0x0'));var util=require(_0x07bd('0x1'));var logger=require(_0x07bd('0x2'))(_0x07bd('0x3'));var moment=require(_0x07bd('0x4'));var BPromise=require(_0x07bd('0x5'));var rp=require(_0x07bd('0x6'));var fs=require('fs');var path=require(_0x07bd('0x7'));var rimraf=require('rimraf');var config=require(_0x07bd('0x8'));var attributes=require(_0x07bd('0x9'));module[_0x07bd('0xa')]=function(_0x313548,_0x3e8349){return _0x313548[_0x07bd('0xb')](_0x07bd('0xc'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':_0x07bd('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x6455=['request-promise','path','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','lodash','../../config/logger','api','moment','bluebird'];(function(_0x44f307,_0x133983){var _0x216153=function(_0x108852){while(--_0x108852){_0x44f307['push'](_0x44f307['shift']());}};_0x216153(++_0x133983);}(_0x6455,0x97));var _0x5645=function(_0x1e7e54,_0x345f2e){_0x1e7e54=_0x1e7e54-0x0;var _0x182a15=_0x6455[_0x1e7e54];return _0x182a15;};'use strict';var _=require(_0x5645('0x0'));var util=require('util');var logger=require(_0x5645('0x1'))(_0x5645('0x2'));var moment=require(_0x5645('0x3'));var BPromise=require(_0x5645('0x4'));var rp=require(_0x5645('0x5'));var fs=require('fs');var path=require(_0x5645('0x6'));var rimraf=require('rimraf');var config=require(_0x5645('0x7'));var attributes=require(_0x5645('0x8'));module[_0x5645('0x9')]=function(_0x9400a8,_0x3a635d){return _0x9400a8[_0x5645('0xa')](_0x5645('0xb'),attributes,{'tableName':_0x5645('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 77799e5..882f462 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 _0xc44a=['randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4bd06e,_0x593701){var _0x85ebb=function(_0x26a7f2){while(--_0x26a7f2){_0x4bd06e['push'](_0x4bd06e['shift']());}};_0x85ebb(++_0x593701);}(_0xc44a,0xec));var _0xac44=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0xc44a[_0x50007c];return _0x5c1ec7;};'use strict';var _=require(_0xac44('0x0'));var util=require(_0xac44('0x1'));var moment=require(_0xac44('0x2'));var BPromise=require(_0xac44('0x3'));var rs=require(_0xac44('0x4'));var fs=require('fs');var Redis=require(_0xac44('0x5'));var db=require(_0xac44('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xac44('0x7'))('rpc');var config=require(_0xac44('0x8'));var jayson=require(_0xac44('0x9'));var client=jayson[_0xac44('0xa')][_0xac44('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x490831,_0x448155,_0x588ab1){return new BPromise(function(_0xde6c1f,_0x2929bd){return client[_0xac44('0xc')](_0x490831,_0x588ab1)['then'](function(_0xbf9a){logger[_0xac44('0xd')](_0xac44('0xe'),_0x448155,_0xac44('0xf'));logger[_0xac44('0x10')](_0xac44('0x11'),_0x448155,_0xac44('0xf'),JSON[_0xac44('0x12')](_0xbf9a));if(_0xbf9a[_0xac44('0x13')]){if(_0xbf9a[_0xac44('0x13')][_0xac44('0x14')]===0x1f4){logger['error']('SmsTransferReport,\x20%s,\x20%s',_0x448155,_0xbf9a[_0xac44('0x13')]['message']);return _0x2929bd(_0xbf9a['error'][_0xac44('0x15')]);}logger['error'](_0xac44('0xe'),_0x448155,_0xbf9a[_0xac44('0x13')]['message']);return _0xde6c1f(_0xbf9a[_0xac44('0x13')][_0xac44('0x15')]);}else{logger['info'](_0xac44('0xe'),_0x448155,_0xac44('0xf'));_0xde6c1f(_0xbf9a[_0xac44('0x16')][_0xac44('0x15')]);}})[_0xac44('0x17')](function(_0x16c586){logger[_0xac44('0x13')](_0xac44('0xe'),_0x448155,_0x16c586);_0x2929bd(_0x16c586);});});} \ No newline at end of file +var _0x31ce=['http','request','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0x31ce,0x15f));var _0xe31c=function(_0x2c7780,_0x100f4a){_0x2c7780=_0x2c7780-0x0;var _0x580bc8=_0x31ce[_0x2c7780];return _0x580bc8;};'use strict';var _=require(_0xe31c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xe31c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe31c('0x2'));var db=require(_0xe31c('0x3'))['db'];var utils=require(_0xe31c('0x4'));var logger=require(_0xe31c('0x5'))(_0xe31c('0x6'));var config=require('../../config/environment');var jayson=require(_0xe31c('0x7'));var client=jayson[_0xe31c('0x8')][_0xe31c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x46ed04,_0x1c5b77,_0x511bb2){return new BPromise(function(_0x2de31d,_0x7d03c2){return client[_0xe31c('0xa')](_0x46ed04,_0x511bb2)['then'](function(_0x94f3c7){logger[_0xe31c('0xb')](_0xe31c('0xc'),_0x1c5b77,_0xe31c('0xd'));logger[_0xe31c('0xe')](_0xe31c('0xf'),_0x1c5b77,'request\x20sent',JSON[_0xe31c('0x10')](_0x94f3c7));if(_0x94f3c7[_0xe31c('0x11')]){if(_0x94f3c7[_0xe31c('0x11')][_0xe31c('0x12')]===0x1f4){logger[_0xe31c('0x11')](_0xe31c('0xc'),_0x1c5b77,_0x94f3c7[_0xe31c('0x11')][_0xe31c('0x13')]);return _0x7d03c2(_0x94f3c7[_0xe31c('0x11')]['message']);}logger[_0xe31c('0x11')](_0xe31c('0xc'),_0x1c5b77,_0x94f3c7[_0xe31c('0x11')][_0xe31c('0x13')]);return _0x2de31d(_0x94f3c7[_0xe31c('0x11')][_0xe31c('0x13')]);}else{logger[_0xe31c('0xb')]('SmsTransferReport,\x20%s,\x20%s',_0x1c5b77,_0xe31c('0xd'));_0x2de31d(_0x94f3c7['result'][_0xe31c('0x13')]);}})['catch'](function(_0x180d58){logger[_0xe31c('0x11')](_0xe31c('0xc'),_0x1c5b77,_0x180d58);_0x7d03c2(_0x180d58);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 77a782f..9d3f4f4 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 _0x8efd=['format','originalname','extname','post','create','put','update','delete','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./sound.controller','get','isAuthenticated','index','/:id','show','download','diskStorage','join','server/files/sounds/original/'];(function(_0x37bac7,_0x523536){var _0x18733d=function(_0x431093){while(--_0x431093){_0x37bac7['push'](_0x37bac7['shift']());}};_0x18733d(++_0x523536);}(_0x8efd,0x117));var _0xd8ef=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0x8efd[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0xd8ef('0x0'));var util=require(_0xd8ef('0x1'));var path=require(_0xd8ef('0x2'));var timeout=require('connect-timeout');var express=require(_0xd8ef('0x3'));var router=express[_0xd8ef('0x4')]();var auth=require(_0xd8ef('0x5'));var interaction=require(_0xd8ef('0x6'));var config=require(_0xd8ef('0x7'));var controller=require(_0xd8ef('0x8'));router[_0xd8ef('0x9')]('/',auth[_0xd8ef('0xa')](),controller[_0xd8ef('0xb')]);router[_0xd8ef('0x9')](_0xd8ef('0xc'),auth[_0xd8ef('0xa')](),controller[_0xd8ef('0xd')]);router[_0xd8ef('0x9')]('/:id/download',auth[_0xd8ef('0xa')](),controller[_0xd8ef('0xe')]);var upload=multer({'storage':multer[_0xd8ef('0xf')]({'destination':function(_0x301f77,_0xf12d32,_0x11e7d0){_0x11e7d0(null,path[_0xd8ef('0x10')](config['root'],_0xd8ef('0x11')));},'filename':function(_0x28f21b,_0x5add2f,_0x514158){_0x5add2f['originalname']=_0x5add2f['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x514158(null,util[_0xd8ef('0x12')]('%s-%s%s',path['basename'](_0x5add2f['originalname'],path['extname'](_0x5add2f[_0xd8ef('0x13')])),Date['now'](),path[_0xd8ef('0x14')](_0x5add2f[_0xd8ef('0x13')])));}})});router[_0xd8ef('0x15')]('/',upload['single']('file'),controller[_0xd8ef('0x16')]);router[_0xd8ef('0x17')](_0xd8ef('0xc'),auth[_0xd8ef('0xa')](),controller[_0xd8ef('0x18')]);router['delete'](_0xd8ef('0xc'),auth[_0xd8ef('0xa')](),controller[_0xd8ef('0x19')]);module[_0xd8ef('0x1a')]=router; \ No newline at end of file +var _0x90b6=['express','Router','../../components/interaction/service','../../config/environment','./sound.controller','isAuthenticated','index','get','/:id','show','/:id/download','download','diskStorage','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','extname','now','single','file','create','put','update','delete','exports','util','connect-timeout'];(function(_0x8aac69,_0x17f4b8){var _0x278f5f=function(_0x2ce640){while(--_0x2ce640){_0x8aac69['push'](_0x8aac69['shift']());}};_0x278f5f(++_0x17f4b8);}(_0x90b6,0x1a2));var _0x690b=function(_0x599411,_0x25fd92){_0x599411=_0x599411-0x0;var _0x559d93=_0x90b6[_0x599411];return _0x559d93;};'use strict';var multer=require('multer');var util=require(_0x690b('0x0'));var path=require('path');var timeout=require(_0x690b('0x1'));var express=require(_0x690b('0x2'));var router=express[_0x690b('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x690b('0x4'));var config=require(_0x690b('0x5'));var controller=require(_0x690b('0x6'));router['get']('/',auth[_0x690b('0x7')](),controller[_0x690b('0x8')]);router[_0x690b('0x9')](_0x690b('0xa'),auth[_0x690b('0x7')](),controller[_0x690b('0xb')]);router[_0x690b('0x9')](_0x690b('0xc'),auth['isAuthenticated'](),controller[_0x690b('0xd')]);var upload=multer({'storage':multer[_0x690b('0xe')]({'destination':function(_0x17876d,_0x495a9f,_0x56c447){_0x56c447(null,path['join'](config[_0x690b('0xf')],_0x690b('0x10')));},'filename':function(_0x330293,_0x2b48d,_0x1f0dfb){_0x2b48d[_0x690b('0x11')]=_0x2b48d[_0x690b('0x11')][_0x690b('0x12')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1f0dfb(null,util[_0x690b('0x13')](_0x690b('0x14'),path['basename'](_0x2b48d[_0x690b('0x11')],path[_0x690b('0x15')](_0x2b48d[_0x690b('0x11')])),Date[_0x690b('0x16')](),path[_0x690b('0x15')](_0x2b48d[_0x690b('0x11')])));}})});router['post']('/',upload[_0x690b('0x17')](_0x690b('0x18')),controller[_0x690b('0x19')]);router[_0x690b('0x1a')](_0x690b('0xa'),auth[_0x690b('0x7')](),controller[_0x690b('0x1b')]);router[_0x690b('0x1c')]('/:id',auth[_0x690b('0x7')](),controller[_0x690b('0x1c')]);module[_0x690b('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 91142d1..53c03bd 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 _0xa45c=['sequelize','exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0x2d23d8,_0x43eafe){var _0x49c914=function(_0x4230d3){while(--_0x4230d3){_0x2d23d8['push'](_0x2d23d8['shift']());}};_0x49c914(++_0x43eafe);}(_0xa45c,0x126));var _0xca45=function(_0x198c0e,_0x285be5){_0x198c0e=_0x198c0e-0x0;var _0x2418ee=_0xa45c[_0x198c0e];return _0x2418ee;};'use strict';var Sequelize=require(_0xca45('0x0'));module[_0xca45('0x1')]={'name':{'type':Sequelize[_0xca45('0x2')],'unique':_0xca45('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xca45('0x2')]},'display_name':{'type':Sequelize[_0xca45('0x2')],'defaultValue':''},'description':{'type':Sequelize[_0xca45('0x2')]},'original_format':{'type':Sequelize[_0xca45('0x2')]},'original_duration':{'type':Sequelize[_0xca45('0x4')]},'original_sampleCount':{'type':Sequelize[_0xca45('0x5')]},'original_channelCount':{'type':Sequelize[_0xca45('0x6')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize['INTEGER']},'converted_format':{'type':Sequelize[_0xca45('0x2')]},'converted_duration':{'type':Sequelize[_0xca45('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xca45('0x5')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xca45('0x5')]},'converted_sampleRate':{'type':Sequelize[_0xca45('0x6')]}}; \ No newline at end of file +var _0xc149=['exports','STRING','name','FLOAT','BIGINT','INTEGER'];(function(_0xd67723,_0x1e576f){var _0x53b62b=function(_0x2460a3){while(--_0x2460a3){_0xd67723['push'](_0xd67723['shift']());}};_0x53b62b(++_0x1e576f);}(_0xc149,0x1d4));var _0x9c14=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xc149[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require('sequelize');module[_0x9c14('0x0')]={'name':{'type':Sequelize[_0x9c14('0x1')],'unique':_0x9c14('0x2'),'allowNull':![]},'save_name':{'type':Sequelize[_0x9c14('0x1')]},'display_name':{'type':Sequelize[_0x9c14('0x1')],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9c14('0x1')]},'original_duration':{'type':Sequelize[_0x9c14('0x3')]},'original_sampleCount':{'type':Sequelize[_0x9c14('0x4')]},'original_channelCount':{'type':Sequelize['INTEGER']},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x9c14('0x5')]},'converted_format':{'type':Sequelize[_0x9c14('0x1')]},'converted_duration':{'type':Sequelize[_0x9c14('0x3')]},'converted_sampleCount':{'type':Sequelize[_0x9c14('0x4')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0x9c14('0x4')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/sound/sound.controller.js b/server/api/sound/sound.controller.js index 60ef497..cbb525e 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 _0xb292=['rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','type','options','Sound','includeAll','include','rows','catch','show','params','keys','find','save_name','converted_format','existsSync','root','Sequelize','ValidationError','download','join','server/files/sounds/converted','format','%s.%s','create','originalname','extname','file','basename','filename','substring','server/files/sounds/original','info','Sound\x20upload\x20destination:\x20%s','chmodSync','0777','transcode','wav','error','unlinkSync','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','converted_sampleRate','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','delete','original_format','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','ejs','squel','crypto','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','get','Sounds','UserProfileResource','destroy','stack','name','send','index','map'];(function(_0x136990,_0x1c7ae4){var _0x4c703a=function(_0x5f4c86){while(--_0x5f4c86){_0x136990['push'](_0x136990['shift']());}};_0x4c703a(++_0x1c7ae4);}(_0xb292,0x1c6));var _0x2b29=function(_0x277a50,_0x1b5383){_0x277a50=_0x277a50-0x0;var _0x47aeae=_0xb292[_0x277a50];return _0x47aeae;};'use strict';var pdf=require(_0x2b29('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x2b29('0x1'));var zipdir=require(_0x2b29('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2b29('0x3'));var moment=require(_0x2b29('0x4'));var BPromise=require(_0x2b29('0x5'));var Mustache=require(_0x2b29('0x6'));var util=require(_0x2b29('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2b29('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x2b29('0x9'));var crypto=require(_0x2b29('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2b29('0xb'));var Redis=require(_0x2b29('0xc'));var authService=require(_0x2b29('0xd'));var qs=require(_0x2b29('0xe'));var as=require(_0x2b29('0xf'));var hardwareService=require(_0x2b29('0x10'));var logger=require('../../config/logger')(_0x2b29('0x11'));var utils=require('../../config/utils');var config=require(_0x2b29('0x12'));var db=require(_0x2b29('0x13'))['db'];function respondWithStatusCode(_0x11e558,_0x5614fd){_0x5614fd=_0x5614fd||0xcc;return function(_0x103775){if(_0x103775){return _0x11e558[_0x2b29('0x14')](_0x5614fd);}return _0x11e558[_0x2b29('0x15')](_0x5614fd)[_0x2b29('0x16')]();};}function respondWithResult(_0x2c20de,_0x13f8d8){_0x13f8d8=_0x13f8d8||0xc8;return function(_0x30a94a){if(_0x30a94a){return _0x2c20de[_0x2b29('0x15')](_0x13f8d8)[_0x2b29('0x17')](_0x30a94a);}};}function respondWithFilteredResult(_0x1fd485,_0x2a58d4){return function(_0x393210){if(_0x393210){var _0x1f8b77=_0x393210[_0x2b29('0x18')],_0x10c612=_0x2a58d4[_0x2b29('0x19')],_0x3680a2=_0x2a58d4[_0x2b29('0x19')]+_0x2a58d4[_0x2b29('0x1a')],_0x21a7a6;if(_0x3680a2>=_0x1f8b77){_0x3680a2=_0x1f8b77;_0x21a7a6=0xc8;}else{_0x21a7a6=0xce;}_0x1fd485[_0x2b29('0x15')](_0x21a7a6);return _0x1fd485['set'](_0x2b29('0x1b'),_0x10c612+'-'+_0x3680a2+'/'+_0x1f8b77)[_0x2b29('0x17')](_0x393210);}return null;};}function patchUpdates(_0x4b4ed4){return function(_0x3007e8){try{jsonpatch[_0x2b29('0x1c')](_0x3007e8,_0x4b4ed4,!![]);}catch(_0x1ec463){return BPromise[_0x2b29('0x1d')](_0x1ec463);}return _0x3007e8[_0x2b29('0x1e')]();};}function saveUpdates(_0x18ccfe,_0x1b098d){return function(_0x5d5e9e){if(_0x5d5e9e){return _0x5d5e9e[_0x2b29('0x1f')](_0x18ccfe)['then'](function(_0x5c7ca3){return _0x5c7ca3;});}return null;};}function removeEntity(_0x90caea,_0xac1c20){return function(_0x4b1d39){if(_0x4b1d39){return _0x4b1d39['destroy']()[_0x2b29('0x20')](function(){var _0x19cdf5=_0x4b1d39[_0x2b29('0x21')]({'plain':!![]});var _0x2bab77=_0x2b29('0x22');return db[_0x2b29('0x23')][_0x2b29('0x24')]({'where':{'type':_0x2bab77,'resourceId':_0x19cdf5['id']}})[_0x2b29('0x20')](function(){return _0x4b1d39;});})[_0x2b29('0x20')](function(){_0x90caea['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5d0412,_0x376729){return function(_0x56d3ad){if(!_0x56d3ad){_0x5d0412[_0x2b29('0x14')](0x194);}return _0x56d3ad;};}function handleError(_0x4ac6de,_0x461367){_0x461367=_0x461367||0x1f4;return function(_0x2a3d5b){logger['error'](_0x2a3d5b[_0x2b29('0x25')]);if(_0x2a3d5b[_0x2b29('0x26')]){delete _0x2a3d5b[_0x2b29('0x26')];}_0x4ac6de['status'](_0x461367)[_0x2b29('0x27')](_0x2a3d5b);};}exports[_0x2b29('0x28')]=function(_0x40f952,_0x2d0cef){var _0x2015c3={},_0x324056={},_0x581ada={'count':0x0,'rows':[]};var _0xc53c03=_[_0x2b29('0x29')](db['Sound'][_0x2b29('0x2a')],function(_0x57f64f){return{'name':_0x57f64f[_0x2b29('0x2b')],'type':_0x57f64f['type'][_0x2b29('0x2c')]};});_0x324056[_0x2b29('0x2d')]=_[_0x2b29('0x29')](_0xc53c03,'name');_0x324056[_0x2b29('0x2e')]=_['keys'](_0x40f952['query']);_0x324056[_0x2b29('0x2f')]=_[_0x2b29('0x30')](_0x324056[_0x2b29('0x2d')],_0x324056['query']);_0x2015c3[_0x2b29('0x31')]=_[_0x2b29('0x30')](_0x324056[_0x2b29('0x2d')],qs[_0x2b29('0x32')](_0x40f952[_0x2b29('0x2e')][_0x2b29('0x32')]));_0x2015c3[_0x2b29('0x31')]=_0x2015c3[_0x2b29('0x31')][_0x2b29('0x33')]?_0x2015c3[_0x2b29('0x31')]:_0x324056[_0x2b29('0x2d')];if(!_0x40f952[_0x2b29('0x2e')][_0x2b29('0x34')](_0x2b29('0x35'))){_0x2015c3[_0x2b29('0x1a')]=qs[_0x2b29('0x1a')](_0x40f952[_0x2b29('0x2e')][_0x2b29('0x1a')]);_0x2015c3['offset']=qs['offset'](_0x40f952['query']['offset']);}_0x2015c3[_0x2b29('0x36')]=qs[_0x2b29('0x37')](_0x40f952[_0x2b29('0x2e')]['sort']);_0x2015c3['where']=qs['filters'](_[_0x2b29('0x38')](_0x40f952['query'],_0x324056[_0x2b29('0x2f')]));if(_0x40f952['query'][_0x2b29('0x39')]){_0x2015c3[_0x2b29('0x3a')]=_[_0x2b29('0x3b')](_0x2015c3[_0x2b29('0x3a')],{'$or':_[_0x2b29('0x29')](_0xc53c03,function(_0x56339f){if(_0x56339f[_0x2b29('0x3c')]!=='VIRTUAL'){var _0x347e39={};_0x347e39[_0x56339f[_0x2b29('0x26')]]={'$like':'%'+_0x40f952[_0x2b29('0x2e')][_0x2b29('0x39')]+'%'};return _0x347e39;}})});}_0x2015c3=_['merge']({},_0x2015c3,_0x40f952[_0x2b29('0x3d')]);var _0x430213={'where':_0x2015c3[_0x2b29('0x3a')]};return db[_0x2b29('0x3e')][_0x2b29('0x18')](_0x430213)[_0x2b29('0x20')](function(_0x14f671){_0x581ada['count']=_0x14f671;if(_0x40f952[_0x2b29('0x2e')][_0x2b29('0x3f')]){_0x2015c3[_0x2b29('0x40')]=[{'all':!![]}];}return db[_0x2b29('0x3e')]['findAll'](_0x2015c3);})[_0x2b29('0x20')](function(_0x1dbc17){_0x581ada[_0x2b29('0x41')]=_0x1dbc17;return _0x581ada;})[_0x2b29('0x20')](respondWithFilteredResult(_0x2d0cef,_0x2015c3))[_0x2b29('0x42')](handleError(_0x2d0cef,null));};exports[_0x2b29('0x43')]=function(_0x93873a,_0x3af3a5){var _0x543259={'raw':!![],'where':{'id':_0x93873a[_0x2b29('0x44')]['id']}},_0x157b4d={};_0x157b4d[_0x2b29('0x2d')]=_['keys'](db[_0x2b29('0x3e')]['rawAttributes']);_0x157b4d[_0x2b29('0x2e')]=_[_0x2b29('0x45')](_0x93873a[_0x2b29('0x2e')]);_0x157b4d[_0x2b29('0x2f')]=_[_0x2b29('0x30')](_0x157b4d[_0x2b29('0x2d')],_0x157b4d[_0x2b29('0x2e')]);_0x543259[_0x2b29('0x31')]=_[_0x2b29('0x30')](_0x157b4d[_0x2b29('0x2d')],qs[_0x2b29('0x32')](_0x93873a['query'][_0x2b29('0x32')]));_0x543259[_0x2b29('0x31')]=_0x543259['attributes'][_0x2b29('0x33')]?_0x543259[_0x2b29('0x31')]:_0x157b4d[_0x2b29('0x2d')];if(_0x93873a[_0x2b29('0x2e')][_0x2b29('0x3f')]){_0x543259[_0x2b29('0x40')]=[{'all':!![]}];}_0x543259=_[_0x2b29('0x3b')]({},_0x543259,_0x93873a[_0x2b29('0x3d')]);return db[_0x2b29('0x3e')][_0x2b29('0x46')](_0x543259)['then'](handleEntityNotFound(_0x3af3a5,null))[_0x2b29('0x20')](respondWithResult(_0x3af3a5,null))[_0x2b29('0x42')](handleError(_0x3af3a5,null));};exports['download']=function(_0x2f7ac9,_0x5e1ba2,_0x14f268){return db['Sound'][_0x2b29('0x46')]({'where':{'id':_0x2f7ac9[_0x2b29('0x44')]['id']},'attributes':['name',_0x2b29('0x47'),_0x2b29('0x48')],'raw':!![]})['then'](handleEntityNotFound(_0x5e1ba2,null))[_0x2b29('0x20')](function(_0x2a1cfa){if(_0x2a1cfa){if(!fs[_0x2b29('0x49')](path['join'](config[_0x2b29('0x4a')],'server/files/sounds/converted',_0x2a1cfa['save_name']+'.'+_0x2a1cfa[_0x2b29('0x48')]))){throw new db[(_0x2b29('0x4b'))][(_0x2b29('0x4c'))]('Sound\x20not\x20found');}return _0x5e1ba2[_0x2b29('0x4d')](path[_0x2b29('0x4e')](config[_0x2b29('0x4a')],_0x2b29('0x4f'),util[_0x2b29('0x50')](_0x2b29('0x51'),_0x2a1cfa['save_name'],_0x2a1cfa[_0x2b29('0x48')])),util[_0x2b29('0x50')](_0x2b29('0x51'),_0x2a1cfa['name'],_0x2a1cfa[_0x2b29('0x48')]));}return null;})[_0x2b29('0x42')](handleError(_0x5e1ba2,null));};exports[_0x2b29('0x52')]=function(_0x1b0e37,_0x17a752,_0x157a2b){var _0xd41b4f={'name':path['basename'](_0x1b0e37['file'][_0x2b29('0x53')],path[_0x2b29('0x54')](_0x1b0e37[_0x2b29('0x55')]['originalname'])),'save_name':path[_0x2b29('0x56')](_0x1b0e37[_0x2b29('0x55')][_0x2b29('0x57')],path[_0x2b29('0x54')](_0x1b0e37[_0x2b29('0x55')]['filename'])),'original_format':path[_0x2b29('0x54')](_0x1b0e37[_0x2b29('0x55')]['originalname'])[_0x2b29('0x58')](0x1),'converted_format':'wav'};var _0x3b4e4=path[_0x2b29('0x4e')](config[_0x2b29('0x4a')],_0x2b29('0x59'),_0x1b0e37[_0x2b29('0x55')][_0x2b29('0x57')]);var _0x2a97de=path[_0x2b29('0x4e')](config[_0x2b29('0x4a')],_0x2b29('0x4f'),util[_0x2b29('0x50')](_0x2b29('0x51'),path[_0x2b29('0x56')](_0x1b0e37['file'][_0x2b29('0x57')],path[_0x2b29('0x54')](_0x1b0e37['file'][_0x2b29('0x57')])),_0xd41b4f[_0x2b29('0x48')]));logger['info']('Sound\x20upload\x20filepath:\x20%s',_0x3b4e4);logger[_0x2b29('0x5a')](_0x2b29('0x5b'),_0x2a97de);try{fs[_0x2b29('0x5c')](_0x3b4e4,parseInt(_0x2b29('0x5d'),0x8));var _0x5488de=sox[_0x2b29('0x5e')](_0x3b4e4,_0x2a97de,{'sampleRate':0x1f40,'format':_0x2b29('0x5f'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5488de['on'](_0x2b29('0x60'),function(_0xf7aa60){fs[_0x2b29('0x61')](_0x3b4e4);_0x17a752[_0x2b29('0x15')](0x1f4)[_0x2b29('0x27')](_0xf7aa60);});_0x5488de['on'](_0x2b29('0x62'),function(_0x580b41){_0xd41b4f[_0x2b29('0x63')]=isNaN(_0x580b41['duration'])?null:_0x580b41['duration']*0x3e8;_0xd41b4f[_0x2b29('0x64')]=isNaN(_0x580b41[_0x2b29('0x65')])?null:_0x580b41['sampleCount'];_0xd41b4f[_0x2b29('0x66')]=isNaN(_0x580b41[_0x2b29('0x67')])?null:_0x580b41[_0x2b29('0x67')];_0xd41b4f['original_bitRate']=isNaN(_0x580b41[_0x2b29('0x68')])?null:_0x580b41[_0x2b29('0x68')];_0xd41b4f[_0x2b29('0x69')]=isNaN(_0x580b41[_0x2b29('0x6a')])?null:_0x580b41['sampleRate'];});_0x5488de['on'](_0x2b29('0x6b'),function(_0x2c7f8c){_0xd41b4f[_0x2b29('0x6c')]=isNaN(_0x2c7f8c[_0x2b29('0x6d')])?null:_0x2c7f8c[_0x2b29('0x6d')]*0x3e8;_0xd41b4f[_0x2b29('0x6e')]=isNaN(_0x2c7f8c['sampleCount'])?null:_0x2c7f8c[_0x2b29('0x65')];_0xd41b4f[_0x2b29('0x6f')]=isNaN(_0x2c7f8c[_0x2b29('0x67')])?null:_0x2c7f8c[_0x2b29('0x67')];_0xd41b4f[_0x2b29('0x70')]=isNaN(_0x2c7f8c['bitRate'])?null:_0x2c7f8c[_0x2b29('0x68')];_0xd41b4f[_0x2b29('0x71')]=isNaN(_0x2c7f8c['sampleRate'])?null:_0x2c7f8c[_0x2b29('0x6a')];});_0x5488de['on'](_0x2b29('0x16'),function(){fs[_0x2b29('0x5c')](_0x2a97de,parseInt(_0x2b29('0x5d'),0x8));return db[_0x2b29('0x3e')]['create'](_0xd41b4f)[_0x2b29('0x20')](function(_0x192b10){var _0xb38051={'role':_0x1b0e37[_0x2b29('0x72')][_0x2b29('0x73')],'userProfileId':_0x1b0e37['body'][_0x2b29('0x74')]};if(!_0xb38051)throw new Error(_0x2b29('0x75'));if(_0xb38051[_0x2b29('0x73')]===_0x2b29('0x76')){var _0x417080=_0x192b10['get']({'plain':!![]});return db[_0x2b29('0x77')][_0x2b29('0x46')]({'where':{'name':_0x2b29('0x22'),'userProfileId':_0xb38051[_0x2b29('0x74')]},'raw':!![]})[_0x2b29('0x20')](function(_0x5b2ba1){if(_0x5b2ba1&&_0x5b2ba1['autoAssociation']===0x0){return db['UserProfileResource'][_0x2b29('0x52')]({'name':_0x417080[_0x2b29('0x26')],'resourceId':_0x417080['id'],'type':_0x5b2ba1[_0x2b29('0x26')],'sectionId':_0x5b2ba1['id']},{})[_0x2b29('0x20')](function(){return _0x192b10;});}else{return _0x192b10;}})['catch'](function(_0x1cd5b7){logger[_0x2b29('0x60')](_0x2b29('0x78'),_0x1cd5b7);throw _0x1cd5b7;});}return _0x192b10;})[_0x2b29('0x20')](respondWithResult(_0x17a752,null))[_0x2b29('0x42')](handleError(_0x17a752,null));});_0x5488de['start']();}catch(_0x3fe916){_0x17a752['status'](0x1f4)[_0x2b29('0x27')](_0x3fe916);}};exports['update']=function(_0x3726da,_0x24e119,_0xb6145a){return db[_0x2b29('0x3e')][_0x2b29('0x46')]({'where':{'id':_0x3726da[_0x2b29('0x44')]['id']}})[_0x2b29('0x20')](handleEntityNotFound(_0x24e119,null))[_0x2b29('0x20')](saveUpdates(_[_0x2b29('0x38')](_0x3726da['body'],['name',_0x2b29('0x79')]),null))[_0x2b29('0x20')](respondWithResult(_0x24e119,null))[_0x2b29('0x42')](handleError(_0x24e119,null));};exports[_0x2b29('0x7a')]=function(_0x24e1ad,_0x212c68,_0xf4e949){return db[_0x2b29('0x3e')][_0x2b29('0x46')]({'where':{'id':_0x24e1ad['params']['id']}})[_0x2b29('0x20')](function(_0x5d2660){if(_0x5d2660){return _0x5d2660[_0x2b29('0x24')]();}})[_0x2b29('0x20')](function(_0x177d5a){var _0x16773d=path[_0x2b29('0x4e')](config[_0x2b29('0x4a')],_0x2b29('0x59'),util[_0x2b29('0x50')](_0x2b29('0x51'),_0x177d5a['save_name'],_0x177d5a[_0x2b29('0x7b')]));var _0x429f1c=path[_0x2b29('0x4e')](config[_0x2b29('0x4a')],_0x2b29('0x4f'),util[_0x2b29('0x50')](_0x2b29('0x51'),_0x177d5a[_0x2b29('0x47')],_0x177d5a[_0x2b29('0x48')]));fs[_0x2b29('0x61')](_0x16773d);fs['unlinkSync'](_0x429f1c);return _0x177d5a;})[_0x2b29('0x20')](function(_0x3f2968){if(_0x3f2968){return _0x212c68['status'](0xcc)[_0x2b29('0x16')]();}})[_0x2b29('0x20')](handleEntityNotFound(_0x212c68,null))['catch'](handleError(_0x212c68,null));}; \ No newline at end of file +var _0xff00=['wav','server/files/sounds/original','info','Sound\x20upload\x20filepath:\x20%s','0777','transcode','src','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','dest','converted_bitRate','body','role','userProfileId','user','UserProfileSection','Sounds','autoAssociation','UserProfileResource','error','params','description','delete','original_format','unlinkSync','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','update','destroy','then','get','stack','name','send','index','map','Sound','rawAttributes','fieldName','type','key','keys','intersection','model','query','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','find','converted_format','existsSync','join','root','server/files/sounds/converted','Sound\x20not\x20found','download','%s.%s','save_name','format','create','file','originalname','extname','basename','filename','substring'];(function(_0x12df1d,_0x2a21d7){var _0x21fae1=function(_0x5729ce){while(--_0x5729ce){_0x12df1d['push'](_0x12df1d['shift']());}};_0x21fae1(++_0x2a21d7);}(_0xff00,0x110));var _0x0ff0=function(_0x5ea1de,_0x2959dd){_0x5ea1de=_0x5ea1de-0x0;var _0x5d84d6=_0xff00[_0x5ea1de];return _0x5d84d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0ff0('0x0'));var rimraf=require(_0x0ff0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ff0('0x2'));var rp=require(_0x0ff0('0x3'));var moment=require(_0x0ff0('0x4'));var BPromise=require(_0x0ff0('0x5'));var Mustache=require(_0x0ff0('0x6'));var util=require(_0x0ff0('0x7'));var path=require(_0x0ff0('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x0ff0('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0ff0('0xa'));var crypto=require(_0x0ff0('0xb'));var jsforce=require(_0x0ff0('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x0ff0('0xd'));var querystring=require(_0x0ff0('0xe'));var Papa=require(_0x0ff0('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x0ff0('0x10'));var as=require(_0x0ff0('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ff0('0x12'))(_0x0ff0('0x13'));var utils=require(_0x0ff0('0x14'));var config=require(_0x0ff0('0x15'));var db=require(_0x0ff0('0x16'))['db'];function respondWithStatusCode(_0x1370f5,_0x47d06d){_0x47d06d=_0x47d06d||0xcc;return function(_0x58711d){if(_0x58711d){return _0x1370f5[_0x0ff0('0x17')](_0x47d06d);}return _0x1370f5[_0x0ff0('0x18')](_0x47d06d)[_0x0ff0('0x19')]();};}function respondWithResult(_0x684882,_0x3111cb){_0x3111cb=_0x3111cb||0xc8;return function(_0x51aaf5){if(_0x51aaf5){return _0x684882['status'](_0x3111cb)[_0x0ff0('0x1a')](_0x51aaf5);}};}function respondWithFilteredResult(_0x3cfde5,_0x42f8d0){return function(_0x37b4e6){if(_0x37b4e6){var _0x230322=_0x37b4e6[_0x0ff0('0x1b')],_0x2bcabe=_0x42f8d0['offset'],_0xe8c419=_0x42f8d0[_0x0ff0('0x1c')]+_0x42f8d0['limit'],_0x513d78;if(_0xe8c419>=_0x230322){_0xe8c419=_0x230322;_0x513d78=0xc8;}else{_0x513d78=0xce;}_0x3cfde5[_0x0ff0('0x18')](_0x513d78);return _0x3cfde5[_0x0ff0('0x1d')](_0x0ff0('0x1e'),_0x2bcabe+'-'+_0xe8c419+'/'+_0x230322)[_0x0ff0('0x1a')](_0x37b4e6);}return null;};}function patchUpdates(_0x40db02){return function(_0x19ed38){try{jsonpatch[_0x0ff0('0x1f')](_0x19ed38,_0x40db02,!![]);}catch(_0xe27427){return BPromise['reject'](_0xe27427);}return _0x19ed38['save']();};}function saveUpdates(_0x1c70e2,_0x455f31){return function(_0x243b6a){if(_0x243b6a){return _0x243b6a[_0x0ff0('0x20')](_0x1c70e2)['then'](function(_0x4167c9){return _0x4167c9;});}return null;};}function removeEntity(_0x1c1573,_0x5cbd3a){return function(_0x4e5e40){if(_0x4e5e40){return _0x4e5e40[_0x0ff0('0x21')]()[_0x0ff0('0x22')](function(){var _0x348983=_0x4e5e40[_0x0ff0('0x23')]({'plain':!![]});var _0x703ec9='Sounds';return db['UserProfileResource'][_0x0ff0('0x21')]({'where':{'type':_0x703ec9,'resourceId':_0x348983['id']}})[_0x0ff0('0x22')](function(){return _0x4e5e40;});})[_0x0ff0('0x22')](function(){_0x1c1573['status'](0xcc)[_0x0ff0('0x19')]();});}};}function handleEntityNotFound(_0x43fb48,_0x3db0a5){return function(_0x5e190d){if(!_0x5e190d){_0x43fb48[_0x0ff0('0x17')](0x194);}return _0x5e190d;};}function handleError(_0x477fd4,_0x12f9e5){_0x12f9e5=_0x12f9e5||0x1f4;return function(_0xf298ba){logger['error'](_0xf298ba[_0x0ff0('0x24')]);if(_0xf298ba[_0x0ff0('0x25')]){delete _0xf298ba[_0x0ff0('0x25')];}_0x477fd4['status'](_0x12f9e5)[_0x0ff0('0x26')](_0xf298ba);};}exports[_0x0ff0('0x27')]=function(_0x291aa1,_0x1f3757){var _0x3ab6a6={},_0x3e5c2d={},_0xec0e20={'count':0x0,'rows':[]};var _0x144f8e=_[_0x0ff0('0x28')](db[_0x0ff0('0x29')][_0x0ff0('0x2a')],function(_0x3e35b5){return{'name':_0x3e35b5[_0x0ff0('0x2b')],'type':_0x3e35b5[_0x0ff0('0x2c')][_0x0ff0('0x2d')]};});_0x3e5c2d['model']=_['map'](_0x144f8e,_0x0ff0('0x25'));_0x3e5c2d['query']=_[_0x0ff0('0x2e')](_0x291aa1['query']);_0x3e5c2d['filters']=_[_0x0ff0('0x2f')](_0x3e5c2d[_0x0ff0('0x30')],_0x3e5c2d[_0x0ff0('0x31')]);_0x3ab6a6['attributes']=_[_0x0ff0('0x2f')](_0x3e5c2d[_0x0ff0('0x30')],qs[_0x0ff0('0x32')](_0x291aa1[_0x0ff0('0x31')]['fields']));_0x3ab6a6[_0x0ff0('0x33')]=_0x3ab6a6['attributes'][_0x0ff0('0x34')]?_0x3ab6a6[_0x0ff0('0x33')]:_0x3e5c2d['model'];if(!_0x291aa1[_0x0ff0('0x31')][_0x0ff0('0x35')](_0x0ff0('0x36'))){_0x3ab6a6['limit']=qs[_0x0ff0('0x37')](_0x291aa1[_0x0ff0('0x31')]['limit']);_0x3ab6a6[_0x0ff0('0x1c')]=qs[_0x0ff0('0x1c')](_0x291aa1[_0x0ff0('0x31')]['offset']);}_0x3ab6a6[_0x0ff0('0x38')]=qs[_0x0ff0('0x39')](_0x291aa1[_0x0ff0('0x31')][_0x0ff0('0x39')]);_0x3ab6a6[_0x0ff0('0x3a')]=qs[_0x0ff0('0x3b')](_[_0x0ff0('0x3c')](_0x291aa1['query'],_0x3e5c2d[_0x0ff0('0x3b')]));if(_0x291aa1[_0x0ff0('0x31')][_0x0ff0('0x3d')]){_0x3ab6a6[_0x0ff0('0x3a')]=_[_0x0ff0('0x3e')](_0x3ab6a6[_0x0ff0('0x3a')],{'$or':_['map'](_0x144f8e,function(_0x34db54){if(_0x34db54['type']!==_0x0ff0('0x3f')){var _0x514861={};_0x514861[_0x34db54[_0x0ff0('0x25')]]={'$like':'%'+_0x291aa1['query'][_0x0ff0('0x3d')]+'%'};return _0x514861;}})});}_0x3ab6a6=_[_0x0ff0('0x3e')]({},_0x3ab6a6,_0x291aa1[_0x0ff0('0x40')]);var _0x370ea1={'where':_0x3ab6a6[_0x0ff0('0x3a')]};return db[_0x0ff0('0x29')][_0x0ff0('0x1b')](_0x370ea1)[_0x0ff0('0x22')](function(_0x430c7d){_0xec0e20['count']=_0x430c7d;if(_0x291aa1['query'][_0x0ff0('0x41')]){_0x3ab6a6[_0x0ff0('0x42')]=[{'all':!![]}];}return db[_0x0ff0('0x29')]['findAll'](_0x3ab6a6);})[_0x0ff0('0x22')](function(_0xac1be1){_0xec0e20[_0x0ff0('0x43')]=_0xac1be1;return _0xec0e20;})[_0x0ff0('0x22')](respondWithFilteredResult(_0x1f3757,_0x3ab6a6))[_0x0ff0('0x44')](handleError(_0x1f3757,null));};exports[_0x0ff0('0x45')]=function(_0x4b4f44,_0x4af32a){var _0x141b08={'raw':!![],'where':{'id':_0x4b4f44['params']['id']}},_0x32c4c5={};_0x32c4c5[_0x0ff0('0x30')]=_[_0x0ff0('0x2e')](db[_0x0ff0('0x29')]['rawAttributes']);_0x32c4c5['query']=_['keys'](_0x4b4f44[_0x0ff0('0x31')]);_0x32c4c5[_0x0ff0('0x3b')]=_[_0x0ff0('0x2f')](_0x32c4c5[_0x0ff0('0x30')],_0x32c4c5['query']);_0x141b08[_0x0ff0('0x33')]=_[_0x0ff0('0x2f')](_0x32c4c5['model'],qs[_0x0ff0('0x32')](_0x4b4f44[_0x0ff0('0x31')][_0x0ff0('0x32')]));_0x141b08[_0x0ff0('0x33')]=_0x141b08[_0x0ff0('0x33')][_0x0ff0('0x34')]?_0x141b08[_0x0ff0('0x33')]:_0x32c4c5[_0x0ff0('0x30')];if(_0x4b4f44[_0x0ff0('0x31')]['includeAll']){_0x141b08['include']=[{'all':!![]}];}_0x141b08=_[_0x0ff0('0x3e')]({},_0x141b08,_0x4b4f44[_0x0ff0('0x40')]);return db[_0x0ff0('0x29')]['find'](_0x141b08)[_0x0ff0('0x22')](handleEntityNotFound(_0x4af32a,null))[_0x0ff0('0x22')](respondWithResult(_0x4af32a,null))[_0x0ff0('0x44')](handleError(_0x4af32a,null));};exports['download']=function(_0x52fd07,_0x17c208,_0x488b80){return db[_0x0ff0('0x29')][_0x0ff0('0x46')]({'where':{'id':_0x52fd07['params']['id']},'attributes':[_0x0ff0('0x25'),'save_name',_0x0ff0('0x47')],'raw':!![]})['then'](handleEntityNotFound(_0x17c208,null))[_0x0ff0('0x22')](function(_0x3e4d9a){if(_0x3e4d9a){if(!fs[_0x0ff0('0x48')](path[_0x0ff0('0x49')](config[_0x0ff0('0x4a')],_0x0ff0('0x4b'),_0x3e4d9a['save_name']+'.'+_0x3e4d9a[_0x0ff0('0x47')]))){throw new db['Sequelize']['ValidationError'](_0x0ff0('0x4c'));}return _0x17c208[_0x0ff0('0x4d')](path[_0x0ff0('0x49')](config[_0x0ff0('0x4a')],_0x0ff0('0x4b'),util['format'](_0x0ff0('0x4e'),_0x3e4d9a[_0x0ff0('0x4f')],_0x3e4d9a[_0x0ff0('0x47')])),util[_0x0ff0('0x50')](_0x0ff0('0x4e'),_0x3e4d9a['name'],_0x3e4d9a[_0x0ff0('0x47')]));}return null;})['catch'](handleError(_0x17c208,null));};exports[_0x0ff0('0x51')]=function(_0x2e6320,_0x40445f,_0x572849){var _0x58ccdf={'name':path['basename'](_0x2e6320[_0x0ff0('0x52')][_0x0ff0('0x53')],path[_0x0ff0('0x54')](_0x2e6320['file'][_0x0ff0('0x53')])),'save_name':path[_0x0ff0('0x55')](_0x2e6320['file'][_0x0ff0('0x56')],path['extname'](_0x2e6320[_0x0ff0('0x52')][_0x0ff0('0x56')])),'original_format':path[_0x0ff0('0x54')](_0x2e6320[_0x0ff0('0x52')][_0x0ff0('0x53')])[_0x0ff0('0x57')](0x1),'converted_format':_0x0ff0('0x58')};var _0x135654=path[_0x0ff0('0x49')](config[_0x0ff0('0x4a')],_0x0ff0('0x59'),_0x2e6320[_0x0ff0('0x52')][_0x0ff0('0x56')]);var _0xadedbb=path[_0x0ff0('0x49')](config[_0x0ff0('0x4a')],_0x0ff0('0x4b'),util[_0x0ff0('0x50')](_0x0ff0('0x4e'),path[_0x0ff0('0x55')](_0x2e6320[_0x0ff0('0x52')][_0x0ff0('0x56')],path[_0x0ff0('0x54')](_0x2e6320[_0x0ff0('0x52')]['filename'])),_0x58ccdf[_0x0ff0('0x47')]));logger[_0x0ff0('0x5a')](_0x0ff0('0x5b'),_0x135654);logger[_0x0ff0('0x5a')]('Sound\x20upload\x20destination:\x20%s',_0xadedbb);try{fs['chmodSync'](_0x135654,parseInt(_0x0ff0('0x5c'),0x8));var _0x44fdb1=sox[_0x0ff0('0x5d')](_0x135654,_0xadedbb,{'sampleRate':0x1f40,'format':_0x0ff0('0x58'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x44fdb1['on']('error',function(_0x533d36){fs['unlinkSync'](_0x135654);_0x40445f[_0x0ff0('0x18')](0x1f4)[_0x0ff0('0x26')](_0x533d36);});_0x44fdb1['on'](_0x0ff0('0x5e'),function(_0x45175e){_0x58ccdf['original_duration']=isNaN(_0x45175e['duration'])?null:_0x45175e[_0x0ff0('0x5f')]*0x3e8;_0x58ccdf[_0x0ff0('0x60')]=isNaN(_0x45175e[_0x0ff0('0x61')])?null:_0x45175e[_0x0ff0('0x61')];_0x58ccdf[_0x0ff0('0x62')]=isNaN(_0x45175e[_0x0ff0('0x63')])?null:_0x45175e['channelCount'];_0x58ccdf[_0x0ff0('0x64')]=isNaN(_0x45175e[_0x0ff0('0x65')])?null:_0x45175e[_0x0ff0('0x65')];_0x58ccdf[_0x0ff0('0x66')]=isNaN(_0x45175e[_0x0ff0('0x67')])?null:_0x45175e[_0x0ff0('0x67')];});_0x44fdb1['on'](_0x0ff0('0x68'),function(_0x201ba4){_0x58ccdf['converted_duration']=isNaN(_0x201ba4['duration'])?null:_0x201ba4[_0x0ff0('0x5f')]*0x3e8;_0x58ccdf['converted_sampleCount']=isNaN(_0x201ba4[_0x0ff0('0x61')])?null:_0x201ba4[_0x0ff0('0x61')];_0x58ccdf['converted_channelCount']=isNaN(_0x201ba4[_0x0ff0('0x63')])?null:_0x201ba4['channelCount'];_0x58ccdf[_0x0ff0('0x69')]=isNaN(_0x201ba4[_0x0ff0('0x65')])?null:_0x201ba4['bitRate'];_0x58ccdf['converted_sampleRate']=isNaN(_0x201ba4['sampleRate'])?null:_0x201ba4[_0x0ff0('0x67')];});_0x44fdb1['on']('end',function(){fs['chmodSync'](_0xadedbb,parseInt(_0x0ff0('0x5c'),0x8));return db[_0x0ff0('0x29')][_0x0ff0('0x51')](_0x58ccdf)[_0x0ff0('0x22')](function(_0x2e29d4){var _0x5d3cd5={'role':_0x2e6320[_0x0ff0('0x6a')][_0x0ff0('0x6b')],'userProfileId':_0x2e6320[_0x0ff0('0x6a')][_0x0ff0('0x6c')]};if(!_0x5d3cd5)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x5d3cd5[_0x0ff0('0x6b')]===_0x0ff0('0x6d')){var _0x1502e8=_0x2e29d4[_0x0ff0('0x23')]({'plain':!![]});return db[_0x0ff0('0x6e')]['find']({'where':{'name':_0x0ff0('0x6f'),'userProfileId':_0x5d3cd5[_0x0ff0('0x6c')]},'raw':!![]})[_0x0ff0('0x22')](function(_0x5365c3){if(_0x5365c3&&_0x5365c3[_0x0ff0('0x70')]===0x0){return db[_0x0ff0('0x71')][_0x0ff0('0x51')]({'name':_0x1502e8['name'],'resourceId':_0x1502e8['id'],'type':_0x5365c3['name'],'sectionId':_0x5365c3['id']},{})['then'](function(){return _0x2e29d4;});}else{return _0x2e29d4;}})[_0x0ff0('0x44')](function(_0x11ce01){logger[_0x0ff0('0x72')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x11ce01);throw _0x11ce01;});}return _0x2e29d4;})[_0x0ff0('0x22')](respondWithResult(_0x40445f,null))[_0x0ff0('0x44')](handleError(_0x40445f,null));});_0x44fdb1['start']();}catch(_0x4d9e8d){_0x40445f[_0x0ff0('0x18')](0x1f4)[_0x0ff0('0x26')](_0x4d9e8d);}};exports[_0x0ff0('0x20')]=function(_0xf05bc1,_0x1decc0,_0x58df84){return db['Sound'][_0x0ff0('0x46')]({'where':{'id':_0xf05bc1[_0x0ff0('0x73')]['id']}})[_0x0ff0('0x22')](handleEntityNotFound(_0x1decc0,null))[_0x0ff0('0x22')](saveUpdates(_[_0x0ff0('0x3c')](_0xf05bc1[_0x0ff0('0x6a')],[_0x0ff0('0x25'),_0x0ff0('0x74')]),null))['then'](respondWithResult(_0x1decc0,null))[_0x0ff0('0x44')](handleError(_0x1decc0,null));};exports[_0x0ff0('0x75')]=function(_0x5ba94b,_0x372527,_0x2aa57b){return db[_0x0ff0('0x29')]['find']({'where':{'id':_0x5ba94b[_0x0ff0('0x73')]['id']}})[_0x0ff0('0x22')](function(_0x29a577){if(_0x29a577){return _0x29a577[_0x0ff0('0x21')]();}})['then'](function(_0x47a951){var _0x399499=path[_0x0ff0('0x49')](config[_0x0ff0('0x4a')],_0x0ff0('0x59'),util[_0x0ff0('0x50')](_0x0ff0('0x4e'),_0x47a951[_0x0ff0('0x4f')],_0x47a951[_0x0ff0('0x76')]));var _0x384044=path['join'](config['root'],_0x0ff0('0x4b'),util[_0x0ff0('0x50')](_0x0ff0('0x4e'),_0x47a951[_0x0ff0('0x4f')],_0x47a951['converted_format']));fs[_0x0ff0('0x77')](_0x399499);fs[_0x0ff0('0x77')](_0x384044);return _0x47a951;})[_0x0ff0('0x22')](function(_0x59c5ad){if(_0x59c5ad){return _0x372527[_0x0ff0('0x18')](0xcc)[_0x0ff0('0x19')]();}})['then'](handleEntityNotFound(_0x372527,null))['catch'](handleError(_0x372527,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index efb1821..aec9125 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 _0x2539=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./sound.attributes','define','Sound','tools_sounds'];(function(_0x33fdc9,_0x167913){var _0x224969=function(_0x32200b){while(--_0x32200b){_0x33fdc9['push'](_0x33fdc9['shift']());}};_0x224969(++_0x167913);}(_0x2539,0x9a));var _0x9253=function(_0x191409,_0x380aa3){_0x191409=_0x191409-0x0;var _0x3d2755=_0x2539[_0x191409];return _0x3d2755;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x9253('0x0'))(_0x9253('0x1'));var moment=require(_0x9253('0x2'));var BPromise=require(_0x9253('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x9253('0x4'));var rimraf=require(_0x9253('0x5'));var config=require(_0x9253('0x6'));var attributes=require(_0x9253('0x7'));module['exports']=function(_0x3520e9,_0x4a575f){return _0x3520e9[_0x9253('0x8')](_0x9253('0x9'),attributes,{'tableName':_0x9253('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x24b4=['rimraf','./sound.attributes','define','Sound','tools_sounds','lodash','util','api','bluebird'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x24b4,0x9e));var _0x424b=function(_0x25c36b,_0x4ad52){_0x25c36b=_0x25c36b-0x0;var _0x3dd4e9=_0x24b4[_0x25c36b];return _0x3dd4e9;};'use strict';var _=require(_0x424b('0x0'));var util=require(_0x424b('0x1'));var logger=require('../../config/logger')(_0x424b('0x2'));var moment=require('moment');var BPromise=require(_0x424b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x424b('0x4'));var config=require('../../config/environment');var attributes=require(_0x424b('0x5'));module['exports']=function(_0x251601,_0x32af41){return _0x251601[_0x424b('0x6')](_0x424b('0x7'),attributes,{'tableName':_0x424b('0x8'),'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 7dcbbb9..8ea178f 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 _0xcfa0=['info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','error','code','message','catch','ShowSound','Sound','find','options','raw','where','attributes','include','map','model','then','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request'];(function(_0x47c4ea,_0x2a9f06){var _0x27ed30=function(_0x33a9a5){while(--_0x33a9a5){_0x47c4ea['push'](_0x47c4ea['shift']());}};_0x27ed30(++_0x2a9f06);}(_0xcfa0,0x7e));var _0x0cfa=function(_0x4a752,_0x3c1398){_0x4a752=_0x4a752-0x0;var _0x3ff76a=_0xcfa0[_0x4a752];return _0x3ff76a;};'use strict';var _=require(_0x0cfa('0x0'));var util=require(_0x0cfa('0x1'));var moment=require(_0x0cfa('0x2'));var BPromise=require(_0x0cfa('0x3'));var rs=require(_0x0cfa('0x4'));var fs=require('fs');var Redis=require(_0x0cfa('0x5'));var db=require(_0x0cfa('0x6'))['db'];var utils=require(_0x0cfa('0x7'));var logger=require(_0x0cfa('0x8'))('rpc');var config=require(_0x0cfa('0x9'));var jayson=require(_0x0cfa('0xa'));var client=jayson[_0x0cfa('0xb')][_0x0cfa('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x592340,_0x4b73a7,_0x323745){return new BPromise(function(_0x329ebc,_0x7c92d){return client[_0x0cfa('0xd')](_0x592340,_0x323745)['then'](function(_0xc1cb00){logger[_0x0cfa('0xe')](_0x0cfa('0xf'),_0x4b73a7,_0x0cfa('0x10'));logger[_0x0cfa('0x11')](_0x0cfa('0x12'),_0x4b73a7,'request\x20sent',JSON['stringify'](_0xc1cb00));if(_0xc1cb00['error']){if(_0xc1cb00[_0x0cfa('0x13')][_0x0cfa('0x14')]===0x1f4){logger['error'](_0x0cfa('0xf'),_0x4b73a7,_0xc1cb00[_0x0cfa('0x13')][_0x0cfa('0x15')]);return _0x7c92d(_0xc1cb00[_0x0cfa('0x13')]['message']);}logger['error']('Sound,\x20%s,\x20%s',_0x4b73a7,_0xc1cb00[_0x0cfa('0x13')][_0x0cfa('0x15')]);return _0x329ebc(_0xc1cb00[_0x0cfa('0x13')][_0x0cfa('0x15')]);}else{logger[_0x0cfa('0xe')](_0x0cfa('0xf'),_0x4b73a7,_0x0cfa('0x10'));_0x329ebc(_0xc1cb00['result'][_0x0cfa('0x15')]);}})[_0x0cfa('0x16')](function(_0x109ec9){logger[_0x0cfa('0x13')](_0x0cfa('0xf'),_0x4b73a7,_0x109ec9);_0x7c92d(_0x109ec9);});});}exports[_0x0cfa('0x17')]=function(_0x4e2e62){var _0x21821b=this;return new Promise(function(_0x3dd063,_0x5d0719){return db[_0x0cfa('0x18')][_0x0cfa('0x19')]({'raw':_0x4e2e62[_0x0cfa('0x1a')]?_0x4e2e62['options'][_0x0cfa('0x1b')]===undefined?!![]:![]:!![],'where':_0x4e2e62[_0x0cfa('0x1a')]?_0x4e2e62[_0x0cfa('0x1a')][_0x0cfa('0x1c')]||null:null,'attributes':_0x4e2e62[_0x0cfa('0x1a')]?_0x4e2e62['options'][_0x0cfa('0x1d')]||null:null,'include':_0x4e2e62['options']?_0x4e2e62[_0x0cfa('0x1a')][_0x0cfa('0x1e')]?_[_0x0cfa('0x1f')](_0x4e2e62[_0x0cfa('0x1a')]['include'],function(_0xc089d6){return{'model':db[_0xc089d6[_0x0cfa('0x20')]],'as':_0xc089d6['as'],'attributes':_0xc089d6[_0x0cfa('0x1d')],'include':_0xc089d6[_0x0cfa('0x1e')]?_[_0x0cfa('0x1f')](_0xc089d6[_0x0cfa('0x1e')],function(_0x3af570){return{'model':db[_0x3af570['model']],'as':_0x3af570['as'],'attributes':_0x3af570[_0x0cfa('0x1d')],'include':_0x3af570[_0x0cfa('0x1e')]?_[_0x0cfa('0x1f')](_0x3af570[_0x0cfa('0x1e')],function(_0x3737bd){return{'model':db[_0x3737bd[_0x0cfa('0x20')]],'as':_0x3737bd['as'],'attributes':_0x3737bd[_0x0cfa('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0cfa('0x21')](function(_0x2cb627){logger[_0x0cfa('0xe')](_0x0cfa('0x17'),_0x4e2e62);logger[_0x0cfa('0x11')](_0x0cfa('0x17'),_0x4e2e62,JSON[_0x0cfa('0x22')](_0x2cb627));_0x3dd063(_0x2cb627);})[_0x0cfa('0x16')](function(_0x308bda){logger[_0x0cfa('0x13')]('ShowSound',_0x308bda['message'],_0x4e2e62);_0x5d0719(_0x21821b['error'](0x1f4,_0x308bda[_0x0cfa('0x15')]));});});}; \ No newline at end of file +var _0x797d=['Sound,\x20%s,\x20%s','request\x20sent','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ShowSound','find','options','raw','where','attributes','include','map','model','then','debug','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','info'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x797d,0xc3));var _0xd797=function(_0x36acb2,_0x12faaa){_0x36acb2=_0x36acb2-0x0;var _0x581204=_0x797d[_0x36acb2];return _0x581204;};'use strict';var _=require(_0xd797('0x0'));var util=require(_0xd797('0x1'));var moment=require(_0xd797('0x2'));var BPromise=require(_0xd797('0x3'));var rs=require(_0xd797('0x4'));var fs=require('fs');var Redis=require(_0xd797('0x5'));var db=require(_0xd797('0x6'))['db'];var utils=require(_0xd797('0x7'));var logger=require(_0xd797('0x8'))(_0xd797('0x9'));var config=require('../../config/environment');var jayson=require(_0xd797('0xa'));var client=jayson[_0xd797('0xb')][_0xd797('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3e5410,_0x4d6f10,_0x2f729e){return new BPromise(function(_0x14cb38,_0xf4c3eb){return client[_0xd797('0xd')](_0x3e5410,_0x2f729e)['then'](function(_0x1ac5e7){logger[_0xd797('0xe')](_0xd797('0xf'),_0x4d6f10,_0xd797('0x10'));logger['debug'](_0xd797('0x11'),_0x4d6f10,'request\x20sent',JSON[_0xd797('0x12')](_0x1ac5e7));if(_0x1ac5e7[_0xd797('0x13')]){if(_0x1ac5e7[_0xd797('0x13')][_0xd797('0x14')]===0x1f4){logger[_0xd797('0x13')](_0xd797('0xf'),_0x4d6f10,_0x1ac5e7['error']['message']);return _0xf4c3eb(_0x1ac5e7[_0xd797('0x13')][_0xd797('0x15')]);}logger[_0xd797('0x13')](_0xd797('0xf'),_0x4d6f10,_0x1ac5e7[_0xd797('0x13')][_0xd797('0x15')]);return _0x14cb38(_0x1ac5e7[_0xd797('0x13')][_0xd797('0x15')]);}else{logger['info'](_0xd797('0xf'),_0x4d6f10,_0xd797('0x10'));_0x14cb38(_0x1ac5e7[_0xd797('0x16')][_0xd797('0x15')]);}})[_0xd797('0x17')](function(_0x4b76e7){logger['error'](_0xd797('0xf'),_0x4d6f10,_0x4b76e7);_0xf4c3eb(_0x4b76e7);});});}exports[_0xd797('0x18')]=function(_0x33535a){var _0xc67731=this;return new Promise(function(_0x5d8222,_0xcbc670){return db['Sound'][_0xd797('0x19')]({'raw':_0x33535a['options']?_0x33535a[_0xd797('0x1a')][_0xd797('0x1b')]===undefined?!![]:![]:!![],'where':_0x33535a[_0xd797('0x1a')]?_0x33535a[_0xd797('0x1a')][_0xd797('0x1c')]||null:null,'attributes':_0x33535a[_0xd797('0x1a')]?_0x33535a[_0xd797('0x1a')][_0xd797('0x1d')]||null:null,'include':_0x33535a['options']?_0x33535a[_0xd797('0x1a')][_0xd797('0x1e')]?_[_0xd797('0x1f')](_0x33535a[_0xd797('0x1a')]['include'],function(_0x108ccd){return{'model':db[_0x108ccd[_0xd797('0x20')]],'as':_0x108ccd['as'],'attributes':_0x108ccd[_0xd797('0x1d')],'include':_0x108ccd[_0xd797('0x1e')]?_[_0xd797('0x1f')](_0x108ccd[_0xd797('0x1e')],function(_0x13bee9){return{'model':db[_0x13bee9[_0xd797('0x20')]],'as':_0x13bee9['as'],'attributes':_0x13bee9[_0xd797('0x1d')],'include':_0x13bee9['include']?_[_0xd797('0x1f')](_0x13bee9[_0xd797('0x1e')],function(_0x1b9404){return{'model':db[_0x1b9404[_0xd797('0x20')]],'as':_0x1b9404['as'],'attributes':_0x1b9404[_0xd797('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xd797('0x21')](function(_0xf64e9){logger[_0xd797('0xe')]('ShowSound',_0x33535a);logger[_0xd797('0x22')](_0xd797('0x18'),_0x33535a,JSON['stringify'](_0xf64e9));_0x5d8222(_0xf64e9);})['catch'](function(_0x14b57f){logger[_0xd797('0x13')](_0xd797('0x18'),_0x14b57f[_0xd797('0x15')],_0x33535a);_0xcbc670(_0xc67731['error'](0x1f4,_0x14b57f[_0xd797('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index eac2f8e..c9aaf4a 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 _0x7ed0=['isAuthenticated','index','/:id','put','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller'];(function(_0x37fbe7,_0x4ad372){var _0x138ffa=function(_0x4000b8){while(--_0x4000b8){_0x37fbe7['push'](_0x37fbe7['shift']());}};_0x138ffa(++_0x4ad372);}(_0x7ed0,0x167));var _0x07ed=function(_0x10bd23,_0x3480fa){_0x10bd23=_0x10bd23-0x0;var _0x345d5f=_0x7ed0[_0x10bd23];return _0x345d5f;};'use strict';var multer=require(_0x07ed('0x0'));var util=require(_0x07ed('0x1'));var path=require(_0x07ed('0x2'));var timeout=require(_0x07ed('0x3'));var express=require(_0x07ed('0x4'));var router=express['Router']();var auth=require(_0x07ed('0x5'));var interaction=require(_0x07ed('0x6'));var config=require(_0x07ed('0x7'));var controller=require(_0x07ed('0x8'));router['get']('/',auth[_0x07ed('0x9')](),controller[_0x07ed('0xa')]);router['get'](_0x07ed('0xb'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0x07ed('0x9')](),controller['create']);router[_0x07ed('0xc')](_0x07ed('0xb'),auth[_0x07ed('0x9')](),controller[_0x07ed('0xd')]);router[_0x07ed('0xe')](_0x07ed('0xb'),auth[_0x07ed('0x9')](),controller['destroy']);module[_0x07ed('0xf')]=router; \ No newline at end of file +var _0x7da4=['multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','index','show','isAuthenticated','create','put','/:id','update','delete','destroy'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x7da4,0xcc));var _0x47da=function(_0x30ccbf,_0x55d48b){_0x30ccbf=_0x30ccbf-0x0;var _0x1b763d=_0x7da4[_0x30ccbf];return _0x1b763d;};'use strict';var multer=require(_0x47da('0x0'));var util=require(_0x47da('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0x47da('0x2')]();var auth=require(_0x47da('0x3'));var interaction=require(_0x47da('0x4'));var config=require(_0x47da('0x5'));var controller=require(_0x47da('0x6'));router[_0x47da('0x7')]('/',auth['isAuthenticated'](),controller[_0x47da('0x8')]);router[_0x47da('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x47da('0x9')]);router['post']('/',auth[_0x47da('0xa')](),controller[_0x47da('0xb')]);router[_0x47da('0xc')](_0x47da('0xd'),auth[_0x47da('0xa')](),controller[_0x47da('0xe')]);router[_0x47da('0xf')](_0x47da('0xd'),auth[_0x47da('0xa')](),controller[_0x47da('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 23cefb7..708678a 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 _0xc641=['out','sequelize','exports','STRING','TEXT','medium'];(function(_0xa7422,_0x40ca8d){var _0x393997=function(_0xf2f958){while(--_0xf2f958){_0xa7422['push'](_0xa7422['shift']());}};_0x393997(++_0x40ca8d);}(_0xc641,0xcd));var _0x1c64=function(_0x4e15aa,_0x467bc5){_0x4e15aa=_0x4e15aa-0x0;var _0x45e14d=_0xc641[_0x4e15aa];return _0x45e14d;};'use strict';var Sequelize=require(_0x1c64('0x0'));module[_0x1c64('0x1')]={'uniqueid':{'type':Sequelize[_0x1c64('0x2')]},'body':{'type':Sequelize[_0x1c64('0x3')](_0x1c64('0x4')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x1c64('0x5')),'defaultValue':_0x1c64('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x6be3=['ENUM','sequelize','exports','STRING'];(function(_0x57950a,_0x2961aa){var _0x12fd16=function(_0xaebe5){while(--_0xaebe5){_0x57950a['push'](_0x57950a['shift']());}};_0x12fd16(++_0x2961aa);}(_0x6be3,0x195));var _0x36be=function(_0x4491d9,_0x5856ec){_0x4491d9=_0x4491d9-0x0;var _0x3e9dba=_0x6be3[_0x4491d9];return _0x3e9dba;};'use strict';var Sequelize=require(_0x36be('0x0'));module[_0x36be('0x1')]={'uniqueid':{'type':Sequelize[_0x36be('0x2')]},'body':{'type':Sequelize['TEXT']('medium'),'allowNull':![]},'direction':{'type':Sequelize[_0x36be('0x3')]('in','out'),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index 4aac86d..fdc2e18 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 _0x737c=['stack','name','send','index','SquareMessage','rawAttributes','fieldName','model','map','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','length','catch','create','body','find','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error'];(function(_0x540c04,_0x4c1e2f){var _0x5bcb58=function(_0x1b461b){while(--_0x1b461b){_0x540c04['push'](_0x540c04['shift']());}};_0x5bcb58(++_0x4c1e2f);}(_0x737c,0x14d));var _0xc737=function(_0x1eb4a1,_0xb32a88){_0x1eb4a1=_0x1eb4a1-0x0;var _0xd45819=_0x737c[_0x1eb4a1];return _0xd45819;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc737('0x0'));var rimraf=require(_0xc737('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc737('0x2'));var rp=require(_0xc737('0x3'));var moment=require(_0xc737('0x4'));var BPromise=require(_0xc737('0x5'));var Mustache=require(_0xc737('0x6'));var util=require(_0xc737('0x7'));var path=require('path');var sox=require(_0xc737('0x8'));var csv=require('to-csv');var ejs=require(_0xc737('0x9'));var fs=require('fs');var _=require(_0xc737('0xa'));var squel=require(_0xc737('0xb'));var crypto=require('crypto');var jsforce=require(_0xc737('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc737('0xd'));var Redis=require(_0xc737('0xe'));var authService=require(_0xc737('0xf'));var qs=require(_0xc737('0x10'));var as=require(_0xc737('0x11'));var hardwareService=require(_0xc737('0x12'));var logger=require(_0xc737('0x13'))(_0xc737('0x14'));var utils=require('../../config/utils');var config=require(_0xc737('0x15'));var db=require(_0xc737('0x16'))['db'];function respondWithStatusCode(_0x42966c,_0x1e554f){_0x1e554f=_0x1e554f||0xcc;return function(_0x5de0c8){if(_0x5de0c8){return _0x42966c['sendStatus'](_0x1e554f);}return _0x42966c[_0xc737('0x17')](_0x1e554f)[_0xc737('0x18')]();};}function respondWithResult(_0x17e508,_0x39819f){_0x39819f=_0x39819f||0xc8;return function(_0x18ef21){if(_0x18ef21){return _0x17e508[_0xc737('0x17')](_0x39819f)['json'](_0x18ef21);}};}function respondWithFilteredResult(_0x40dbc5,_0x5655cf){return function(_0x329e54){if(_0x329e54){var _0xa5cf16=_0x329e54[_0xc737('0x19')],_0x471e63=_0x5655cf[_0xc737('0x1a')],_0x41aa3e=_0x5655cf['offset']+_0x5655cf[_0xc737('0x1b')],_0x5c9b39;if(_0x41aa3e>=_0xa5cf16){_0x41aa3e=_0xa5cf16;_0x5c9b39=0xc8;}else{_0x5c9b39=0xce;}_0x40dbc5[_0xc737('0x17')](_0x5c9b39);return _0x40dbc5[_0xc737('0x1c')]('Content-Range',_0x471e63+'-'+_0x41aa3e+'/'+_0xa5cf16)['json'](_0x329e54);}return null;};}function patchUpdates(_0x236601){return function(_0x5c8590){try{jsonpatch[_0xc737('0x1d')](_0x5c8590,_0x236601,!![]);}catch(_0x13d9dd){return BPromise[_0xc737('0x1e')](_0x13d9dd);}return _0x5c8590[_0xc737('0x1f')]();};}function saveUpdates(_0x442083,_0x544ce8){return function(_0x3a5803){if(_0x3a5803){return _0x3a5803[_0xc737('0x20')](_0x442083)[_0xc737('0x21')](function(_0x5c24eb){return _0x5c24eb;});}return null;};}function removeEntity(_0x2c0da0,_0x149a27){return function(_0x472f57){if(_0x472f57){return _0x472f57[_0xc737('0x22')]()[_0xc737('0x21')](function(){_0x2c0da0['status'](0xcc)[_0xc737('0x18')]();});}};}function handleEntityNotFound(_0x5783e0,_0x12211f){return function(_0x562842){if(!_0x562842){_0x5783e0[_0xc737('0x23')](0x194);}return _0x562842;};}function handleError(_0x1d0ed1,_0x16f915){_0x16f915=_0x16f915||0x1f4;return function(_0x976b7a){logger[_0xc737('0x24')](_0x976b7a[_0xc737('0x25')]);if(_0x976b7a[_0xc737('0x26')]){delete _0x976b7a[_0xc737('0x26')];}_0x1d0ed1['status'](_0x16f915)[_0xc737('0x27')](_0x976b7a);};}exports[_0xc737('0x28')]=function(_0x3ec764,_0x3e6156){var _0x14b3a8={},_0x36119e={},_0x5a75dd={'count':0x0,'rows':[]};var _0x2d766d=_['map'](db[_0xc737('0x29')][_0xc737('0x2a')],function(_0x455064){return{'name':_0x455064[_0xc737('0x2b')],'type':_0x455064['type']['key']};});_0x36119e[_0xc737('0x2c')]=_[_0xc737('0x2d')](_0x2d766d,_0xc737('0x26'));_0x36119e[_0xc737('0x2e')]=_[_0xc737('0x2f')](_0x3ec764[_0xc737('0x2e')]);_0x36119e[_0xc737('0x30')]=_['intersection'](_0x36119e[_0xc737('0x2c')],_0x36119e[_0xc737('0x2e')]);_0x14b3a8[_0xc737('0x31')]=_[_0xc737('0x32')](_0x36119e[_0xc737('0x2c')],qs[_0xc737('0x33')](_0x3ec764['query']['fields']));_0x14b3a8['attributes']=_0x14b3a8['attributes']['length']?_0x14b3a8[_0xc737('0x31')]:_0x36119e['model'];if(!_0x3ec764['query'][_0xc737('0x34')](_0xc737('0x35'))){_0x14b3a8['limit']=qs[_0xc737('0x1b')](_0x3ec764['query']['limit']);_0x14b3a8[_0xc737('0x1a')]=qs[_0xc737('0x1a')](_0x3ec764[_0xc737('0x2e')][_0xc737('0x1a')]);}_0x14b3a8[_0xc737('0x36')]=qs[_0xc737('0x37')](_0x3ec764[_0xc737('0x2e')]['sort']);_0x14b3a8[_0xc737('0x38')]=qs['filters'](_[_0xc737('0x39')](_0x3ec764[_0xc737('0x2e')],_0x36119e[_0xc737('0x30')]));if(_0x3ec764['query']['filter']){_0x14b3a8[_0xc737('0x38')]=_[_0xc737('0x3a')](_0x14b3a8[_0xc737('0x38')],{'$or':_[_0xc737('0x2d')](_0x2d766d,function(_0x184713){if(_0x184713[_0xc737('0x3b')]!==_0xc737('0x3c')){var _0x40f9f6={};_0x40f9f6[_0x184713[_0xc737('0x26')]]={'$like':'%'+_0x3ec764[_0xc737('0x2e')][_0xc737('0x3d')]+'%'};return _0x40f9f6;}})});}_0x14b3a8=_[_0xc737('0x3a')]({},_0x14b3a8,_0x3ec764[_0xc737('0x3e')]);var _0x1a49f8={'where':_0x14b3a8[_0xc737('0x38')]};return db[_0xc737('0x29')][_0xc737('0x19')](_0x1a49f8)[_0xc737('0x21')](function(_0x7190a4){_0x5a75dd[_0xc737('0x19')]=_0x7190a4;if(_0x3ec764[_0xc737('0x2e')][_0xc737('0x3f')]){_0x14b3a8[_0xc737('0x40')]=[{'all':!![]}];}return db[_0xc737('0x29')][_0xc737('0x41')](_0x14b3a8);})['then'](function(_0x35bdf6){_0x5a75dd[_0xc737('0x42')]=_0x35bdf6;return _0x5a75dd;})[_0xc737('0x21')](respondWithFilteredResult(_0x3e6156,_0x14b3a8))['catch'](handleError(_0x3e6156,null));};exports[_0xc737('0x43')]=function(_0x3d7921,_0x134bc8){var _0x490cad={'raw':!![],'where':{'id':_0x3d7921[_0xc737('0x44')]['id']}},_0x211e5f={};_0x211e5f[_0xc737('0x2c')]=_[_0xc737('0x2f')](db[_0xc737('0x29')][_0xc737('0x2a')]);_0x211e5f[_0xc737('0x2e')]=_[_0xc737('0x2f')](_0x3d7921[_0xc737('0x2e')]);_0x211e5f[_0xc737('0x30')]=_['intersection'](_0x211e5f[_0xc737('0x2c')],_0x211e5f[_0xc737('0x2e')]);_0x490cad[_0xc737('0x31')]=_[_0xc737('0x32')](_0x211e5f['model'],qs[_0xc737('0x33')](_0x3d7921[_0xc737('0x2e')][_0xc737('0x33')]));_0x490cad[_0xc737('0x31')]=_0x490cad[_0xc737('0x31')][_0xc737('0x45')]?_0x490cad[_0xc737('0x31')]:_0x211e5f[_0xc737('0x2c')];if(_0x3d7921['query'][_0xc737('0x3f')]){_0x490cad[_0xc737('0x40')]=[{'all':!![]}];}_0x490cad=_['merge']({},_0x490cad,_0x3d7921[_0xc737('0x3e')]);return db[_0xc737('0x29')]['find'](_0x490cad)[_0xc737('0x21')](handleEntityNotFound(_0x134bc8,null))[_0xc737('0x21')](respondWithResult(_0x134bc8,null))[_0xc737('0x46')](handleError(_0x134bc8,null));};exports['create']=function(_0x232bf3,_0x3bc96e){return db[_0xc737('0x29')][_0xc737('0x47')](_0x232bf3['body'],{})['then'](respondWithResult(_0x3bc96e,0xc9))['catch'](handleError(_0x3bc96e,null));};exports['update']=function(_0x38adc9,_0x95f602){if(_0x38adc9[_0xc737('0x48')]['id']){delete _0x38adc9['body']['id'];}return db[_0xc737('0x29')]['find']({'where':{'id':_0x38adc9[_0xc737('0x44')]['id']}})[_0xc737('0x21')](handleEntityNotFound(_0x95f602,null))['then'](saveUpdates(_0x38adc9[_0xc737('0x48')],null))['then'](respondWithResult(_0x95f602,null))[_0xc737('0x46')](handleError(_0x95f602,null));};exports['destroy']=function(_0x5a07b8,_0x3ca249){return db[_0xc737('0x29')][_0xc737('0x49')]({'where':{'id':_0x5a07b8[_0xc737('0x44')]['id']}})[_0xc737('0x21')](handleEntityNotFound(_0x3ca249,null))[_0xc737('0x21')](removeEntity(_0x3ca249,null))[_0xc737('0x46')](handleError(_0x3ca249,null));}; \ No newline at end of file +var _0x09be=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','map','SquareMessage','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','merge','options','includeAll','include','findAll','catch','show','find','create','body','params','html-pdf','eml-format','zip-dir','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs'];(function(_0x58dd3c,_0x3b5e25){var _0x2748ce=function(_0x20a673){while(--_0x20a673){_0x58dd3c['push'](_0x58dd3c['shift']());}};_0x2748ce(++_0x3b5e25);}(_0x09be,0xc0));var _0xe09b=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x09be[_0x14add3];return _0x4a174f;};'use strict';var pdf=require(_0xe09b('0x0'));var emlformat=require(_0xe09b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe09b('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xe09b('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe09b('0x4'));var path=require(_0xe09b('0x5'));var sox=require(_0xe09b('0x6'));var csv=require(_0xe09b('0x7'));var ejs=require(_0xe09b('0x8'));var fs=require('fs');var _=require(_0xe09b('0x9'));var squel=require(_0xe09b('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xe09b('0xb'));var toCsv=require(_0xe09b('0x7'));var querystring=require(_0xe09b('0xc'));var Papa=require('papaparse');var Redis=require(_0xe09b('0xd'));var authService=require('../../components/auth/service');var qs=require(_0xe09b('0xe'));var as=require(_0xe09b('0xf'));var hardwareService=require(_0xe09b('0x10'));var logger=require(_0xe09b('0x11'))(_0xe09b('0x12'));var utils=require(_0xe09b('0x13'));var config=require('../../config/environment');var db=require(_0xe09b('0x14'))['db'];function respondWithStatusCode(_0x1564f8,_0x5da4eb){_0x5da4eb=_0x5da4eb||0xcc;return function(_0x508068){if(_0x508068){return _0x1564f8[_0xe09b('0x15')](_0x5da4eb);}return _0x1564f8['status'](_0x5da4eb)[_0xe09b('0x16')]();};}function respondWithResult(_0x162683,_0x22fd67){_0x22fd67=_0x22fd67||0xc8;return function(_0x5ab9a7){if(_0x5ab9a7){return _0x162683[_0xe09b('0x17')](_0x22fd67)[_0xe09b('0x18')](_0x5ab9a7);}};}function respondWithFilteredResult(_0x229498,_0x359e9d){return function(_0x4df4cf){if(_0x4df4cf){var _0x78c089=_0x4df4cf[_0xe09b('0x19')],_0x3e73c5=_0x359e9d['offset'],_0x32f623=_0x359e9d[_0xe09b('0x1a')]+_0x359e9d[_0xe09b('0x1b')],_0x41f395;if(_0x32f623>=_0x78c089){_0x32f623=_0x78c089;_0x41f395=0xc8;}else{_0x41f395=0xce;}_0x229498['status'](_0x41f395);return _0x229498[_0xe09b('0x1c')]('Content-Range',_0x3e73c5+'-'+_0x32f623+'/'+_0x78c089)[_0xe09b('0x18')](_0x4df4cf);}return null;};}function patchUpdates(_0x242508){return function(_0x1983f3){try{jsonpatch[_0xe09b('0x1d')](_0x1983f3,_0x242508,!![]);}catch(_0x222c22){return BPromise[_0xe09b('0x1e')](_0x222c22);}return _0x1983f3[_0xe09b('0x1f')]();};}function saveUpdates(_0x366315,_0xe9e34f){return function(_0x2b0bfe){if(_0x2b0bfe){return _0x2b0bfe[_0xe09b('0x20')](_0x366315)[_0xe09b('0x21')](function(_0x572454){return _0x572454;});}return null;};}function removeEntity(_0x31761e,_0x5a7afe){return function(_0x4eb96e){if(_0x4eb96e){return _0x4eb96e['destroy']()['then'](function(){_0x31761e[_0xe09b('0x17')](0xcc)[_0xe09b('0x16')]();});}};}function handleEntityNotFound(_0x30bfef,_0x4ed8da){return function(_0x23800a){if(!_0x23800a){_0x30bfef[_0xe09b('0x15')](0x194);}return _0x23800a;};}function handleError(_0x1aed8f,_0x3478dd){_0x3478dd=_0x3478dd||0x1f4;return function(_0x3dee35){logger[_0xe09b('0x22')](_0x3dee35[_0xe09b('0x23')]);if(_0x3dee35['name']){delete _0x3dee35[_0xe09b('0x24')];}_0x1aed8f[_0xe09b('0x17')](_0x3478dd)[_0xe09b('0x25')](_0x3dee35);};}exports['index']=function(_0x519832,_0x4003e4){var _0x1502f5={},_0x4ce6d3={},_0x3c452e={'count':0x0,'rows':[]};var _0x406e81=_[_0xe09b('0x26')](db[_0xe09b('0x27')][_0xe09b('0x28')],function(_0x33098d){return{'name':_0x33098d[_0xe09b('0x29')],'type':_0x33098d[_0xe09b('0x2a')][_0xe09b('0x2b')]};});_0x4ce6d3[_0xe09b('0x2c')]=_[_0xe09b('0x26')](_0x406e81,_0xe09b('0x24'));_0x4ce6d3[_0xe09b('0x2d')]=_[_0xe09b('0x2e')](_0x519832[_0xe09b('0x2d')]);_0x4ce6d3['filters']=_[_0xe09b('0x2f')](_0x4ce6d3['model'],_0x4ce6d3[_0xe09b('0x2d')]);_0x1502f5[_0xe09b('0x30')]=_[_0xe09b('0x2f')](_0x4ce6d3[_0xe09b('0x2c')],qs[_0xe09b('0x31')](_0x519832[_0xe09b('0x2d')][_0xe09b('0x31')]));_0x1502f5[_0xe09b('0x30')]=_0x1502f5[_0xe09b('0x30')][_0xe09b('0x32')]?_0x1502f5['attributes']:_0x4ce6d3[_0xe09b('0x2c')];if(!_0x519832[_0xe09b('0x2d')][_0xe09b('0x33')]('nolimit')){_0x1502f5[_0xe09b('0x1b')]=qs[_0xe09b('0x1b')](_0x519832['query'][_0xe09b('0x1b')]);_0x1502f5[_0xe09b('0x1a')]=qs[_0xe09b('0x1a')](_0x519832[_0xe09b('0x2d')]['offset']);}_0x1502f5[_0xe09b('0x34')]=qs['sort'](_0x519832['query'][_0xe09b('0x35')]);_0x1502f5['where']=qs[_0xe09b('0x36')](_[_0xe09b('0x37')](_0x519832[_0xe09b('0x2d')],_0x4ce6d3['filters']));if(_0x519832[_0xe09b('0x2d')][_0xe09b('0x38')]){_0x1502f5[_0xe09b('0x39')]=_['merge'](_0x1502f5[_0xe09b('0x39')],{'$or':_[_0xe09b('0x26')](_0x406e81,function(_0x159a6c){if(_0x159a6c['type']!=='VIRTUAL'){var _0xc5abbc={};_0xc5abbc[_0x159a6c['name']]={'$like':'%'+_0x519832[_0xe09b('0x2d')]['filter']+'%'};return _0xc5abbc;}})});}_0x1502f5=_[_0xe09b('0x3a')]({},_0x1502f5,_0x519832[_0xe09b('0x3b')]);var _0x3a049c={'where':_0x1502f5['where']};return db[_0xe09b('0x27')]['count'](_0x3a049c)[_0xe09b('0x21')](function(_0x5dd872){_0x3c452e[_0xe09b('0x19')]=_0x5dd872;if(_0x519832[_0xe09b('0x2d')][_0xe09b('0x3c')]){_0x1502f5[_0xe09b('0x3d')]=[{'all':!![]}];}return db[_0xe09b('0x27')][_0xe09b('0x3e')](_0x1502f5);})[_0xe09b('0x21')](function(_0x10302b){_0x3c452e['rows']=_0x10302b;return _0x3c452e;})[_0xe09b('0x21')](respondWithFilteredResult(_0x4003e4,_0x1502f5))[_0xe09b('0x3f')](handleError(_0x4003e4,null));};exports[_0xe09b('0x40')]=function(_0x3fc59d,_0x1a8867){var _0x50b7c6={'raw':!![],'where':{'id':_0x3fc59d['params']['id']}},_0x4bd081={};_0x4bd081[_0xe09b('0x2c')]=_[_0xe09b('0x2e')](db[_0xe09b('0x27')]['rawAttributes']);_0x4bd081[_0xe09b('0x2d')]=_[_0xe09b('0x2e')](_0x3fc59d[_0xe09b('0x2d')]);_0x4bd081[_0xe09b('0x36')]=_[_0xe09b('0x2f')](_0x4bd081['model'],_0x4bd081[_0xe09b('0x2d')]);_0x50b7c6['attributes']=_['intersection'](_0x4bd081['model'],qs[_0xe09b('0x31')](_0x3fc59d['query']['fields']));_0x50b7c6[_0xe09b('0x30')]=_0x50b7c6[_0xe09b('0x30')][_0xe09b('0x32')]?_0x50b7c6['attributes']:_0x4bd081[_0xe09b('0x2c')];if(_0x3fc59d['query'][_0xe09b('0x3c')]){_0x50b7c6[_0xe09b('0x3d')]=[{'all':!![]}];}_0x50b7c6=_[_0xe09b('0x3a')]({},_0x50b7c6,_0x3fc59d[_0xe09b('0x3b')]);return db[_0xe09b('0x27')][_0xe09b('0x41')](_0x50b7c6)[_0xe09b('0x21')](handleEntityNotFound(_0x1a8867,null))[_0xe09b('0x21')](respondWithResult(_0x1a8867,null))[_0xe09b('0x3f')](handleError(_0x1a8867,null));};exports[_0xe09b('0x42')]=function(_0x3b45f0,_0x204cbb){return db[_0xe09b('0x27')]['create'](_0x3b45f0[_0xe09b('0x43')],{})['then'](respondWithResult(_0x204cbb,0xc9))[_0xe09b('0x3f')](handleError(_0x204cbb,null));};exports[_0xe09b('0x20')]=function(_0x569d4b,_0x379b16){if(_0x569d4b['body']['id']){delete _0x569d4b[_0xe09b('0x43')]['id'];}return db[_0xe09b('0x27')][_0xe09b('0x41')]({'where':{'id':_0x569d4b[_0xe09b('0x44')]['id']}})[_0xe09b('0x21')](handleEntityNotFound(_0x379b16,null))[_0xe09b('0x21')](saveUpdates(_0x569d4b[_0xe09b('0x43')],null))['then'](respondWithResult(_0x379b16,null))['catch'](handleError(_0x379b16,null));};exports['destroy']=function(_0x242078,_0x1278f4){return db[_0xe09b('0x27')][_0xe09b('0x41')]({'where':{'id':_0x242078['params']['id']}})['then'](handleEntityNotFound(_0x1278f4,null))[_0xe09b('0x21')](removeEntity(_0x1278f4,null))[_0xe09b('0x3f')](handleError(_0x1278f4,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d979b83..bb2d845 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 _0x44a9=['square_messages','util','../../config/logger','moment','path','../../config/environment','exports','define'];(function(_0x40cafd,_0x3fd4d7){var _0x4f9fcb=function(_0x3c0cc7){while(--_0x3c0cc7){_0x40cafd['push'](_0x40cafd['shift']());}};_0x4f9fcb(++_0x3fd4d7);}(_0x44a9,0x119));var _0x944a=function(_0x5eb7bf,_0x10e56f){_0x5eb7bf=_0x5eb7bf-0x0;var _0x34ee20=_0x44a9[_0x5eb7bf];return _0x34ee20;};'use strict';var _=require('lodash');var util=require(_0x944a('0x0'));var logger=require(_0x944a('0x1'))('api');var moment=require(_0x944a('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x944a('0x3'));var rimraf=require('rimraf');var config=require(_0x944a('0x4'));var attributes=require('./squareMessage.attributes');module[_0x944a('0x5')]=function(_0x850a4f,_0x145d17){return _0x850a4f[_0x944a('0x6')]('SquareMessage',attributes,{'tableName':_0x944a('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x952b=['exports','define','SquareMessage','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareMessage.attributes'];(function(_0xb13cf3,_0x21f4ac){var _0x15c7b6=function(_0x43f039){while(--_0x43f039){_0xb13cf3['push'](_0xb13cf3['shift']());}};_0x15c7b6(++_0x21f4ac);}(_0x952b,0xfa));var _0xb952=function(_0x524bf9,_0x47462b){_0x524bf9=_0x524bf9-0x0;var _0x550148=_0x952b[_0x524bf9];return _0x550148;};'use strict';var _=require(_0xb952('0x0'));var util=require(_0xb952('0x1'));var logger=require(_0xb952('0x2'))('api');var moment=require(_0xb952('0x3'));var BPromise=require(_0xb952('0x4'));var rp=require(_0xb952('0x5'));var fs=require('fs');var path=require(_0xb952('0x6'));var rimraf=require(_0xb952('0x7'));var config=require(_0xb952('0x8'));var attributes=require(_0xb952('0x9'));module[_0xb952('0xa')]=function(_0x531265,_0x1ed3e5){return _0x531265[_0xb952('0xb')](_0xb952('0xc'),attributes,{'tableName':'square_messages','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.rpc.js b/server/api/squareMessage/squareMessage.rpc.js index 03359f2..a707a84 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 _0x46ed=['ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','SquareMessage,\x20%s,\x20%s','debug','SquareMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','create','body','options','raw','CreateSquareMessage','catch','lodash','util','bluebird','randomstring'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0x46ed,0x168));var _0xd46e=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x46ed[_0x2c7618];return _0x5ce3f0;};'use strict';var _=require(_0xd46e('0x0'));var util=require(_0xd46e('0x1'));var moment=require('moment');var BPromise=require(_0xd46e('0x2'));var rs=require(_0xd46e('0x3'));var fs=require('fs');var Redis=require(_0xd46e('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xd46e('0x5'));var logger=require(_0xd46e('0x6'))('rpc');var config=require(_0xd46e('0x7'));var jayson=require(_0xd46e('0x8'));var client=jayson[_0xd46e('0x9')][_0xd46e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x45e680,_0x855f24,_0x437ea0){return new BPromise(function(_0x144687,_0x31259b){return client[_0xd46e('0xb')](_0x45e680,_0x437ea0)[_0xd46e('0xc')](function(_0x59c88d){logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,'request\x20sent');logger[_0xd46e('0xf')](_0xd46e('0x10'),_0x855f24,_0xd46e('0x11'),JSON[_0xd46e('0x12')](_0x59c88d));if(_0x59c88d[_0xd46e('0x13')]){if(_0x59c88d[_0xd46e('0x13')]['code']===0x1f4){logger[_0xd46e('0x13')]('SquareMessage,\x20%s,\x20%s',_0x855f24,_0x59c88d['error'][_0xd46e('0x14')]);return _0x31259b(_0x59c88d[_0xd46e('0x13')]['message']);}logger['error'](_0xd46e('0xe'),_0x855f24,_0x59c88d[_0xd46e('0x13')][_0xd46e('0x14')]);return _0x144687(_0x59c88d[_0xd46e('0x13')]['message']);}else{logger[_0xd46e('0xd')](_0xd46e('0xe'),_0x855f24,_0xd46e('0x11'));_0x144687(_0x59c88d[_0xd46e('0x15')][_0xd46e('0x14')]);}})['catch'](function(_0x1d50a5){logger[_0xd46e('0x13')](_0xd46e('0xe'),_0x855f24,_0x1d50a5);_0x31259b(_0x1d50a5);});});}exports['CreateSquareMessage']=function(_0x5ddd04){var _0x2e8f6d=this;return new Promise(function(_0x1bd574,_0x488690){return db['SquareMessage'][_0xd46e('0x16')](_0x5ddd04[_0xd46e('0x17')],{'raw':_0x5ddd04[_0xd46e('0x18')]?_0x5ddd04[_0xd46e('0x18')][_0xd46e('0x19')]===undefined?!![]:![]:!![]})[_0xd46e('0xc')](function(_0x3b5fa4){logger[_0xd46e('0xd')](_0xd46e('0x1a'),_0x5ddd04);logger[_0xd46e('0xf')](_0xd46e('0x1a'),_0x5ddd04,JSON['stringify'](_0x3b5fa4));_0x1bd574(_0x3b5fa4);})[_0xd46e('0x1b')](function(_0x1c83fa){logger[_0xd46e('0x13')](_0xd46e('0x1a'),_0x1c83fa[_0xd46e('0x14')],_0x5ddd04);_0x488690(_0x2e8f6d[_0xd46e('0x13')](0x1f4,_0x1c83fa[_0xd46e('0x14')]));});});}; \ No newline at end of file +var _0x9e69=['error','code','message','info','catch','create','body','options','raw','CreateSquareMessage','debug','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','SquareMessage,\x20%s,\x20%s','request\x20sent','stringify'];(function(_0x195d20,_0x4f510b){var _0x503d97=function(_0x247603){while(--_0x247603){_0x195d20['push'](_0x195d20['shift']());}};_0x503d97(++_0x4f510b);}(_0x9e69,0x150));var _0x99e6=function(_0x58fdcc,_0x411460){_0x58fdcc=_0x58fdcc-0x0;var _0x25f39d=_0x9e69[_0x58fdcc];return _0x25f39d;};'use strict';var _=require('lodash');var util=require(_0x99e6('0x0'));var moment=require(_0x99e6('0x1'));var BPromise=require(_0x99e6('0x2'));var rs=require(_0x99e6('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x99e6('0x4'))['db'];var utils=require(_0x99e6('0x5'));var logger=require('../../config/logger')(_0x99e6('0x6'));var config=require(_0x99e6('0x7'));var jayson=require(_0x99e6('0x8'));var client=jayson['client'][_0x99e6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3cf241,_0x41635b,_0x58eb2d){return new BPromise(function(_0x3424c5,_0x305140){return client['request'](_0x3cf241,_0x58eb2d)[_0x99e6('0xa')](function(_0x133169){logger['info'](_0x99e6('0xb'),_0x41635b,_0x99e6('0xc'));logger['debug']('SquareMessage,\x20%s,\x20%s,\x20%s',_0x41635b,_0x99e6('0xc'),JSON[_0x99e6('0xd')](_0x133169));if(_0x133169[_0x99e6('0xe')]){if(_0x133169[_0x99e6('0xe')][_0x99e6('0xf')]===0x1f4){logger[_0x99e6('0xe')]('SquareMessage,\x20%s,\x20%s',_0x41635b,_0x133169[_0x99e6('0xe')][_0x99e6('0x10')]);return _0x305140(_0x133169[_0x99e6('0xe')]['message']);}logger[_0x99e6('0xe')](_0x99e6('0xb'),_0x41635b,_0x133169[_0x99e6('0xe')]['message']);return _0x3424c5(_0x133169['error']['message']);}else{logger[_0x99e6('0x11')](_0x99e6('0xb'),_0x41635b,_0x99e6('0xc'));_0x3424c5(_0x133169['result'][_0x99e6('0x10')]);}})[_0x99e6('0x12')](function(_0xebfd62){logger[_0x99e6('0xe')](_0x99e6('0xb'),_0x41635b,_0xebfd62);_0x305140(_0xebfd62);});});}exports['CreateSquareMessage']=function(_0x2e9e24){var _0x4e84f4=this;return new Promise(function(_0x2749bf,_0x359358){return db['SquareMessage'][_0x99e6('0x13')](_0x2e9e24[_0x99e6('0x14')],{'raw':_0x2e9e24[_0x99e6('0x15')]?_0x2e9e24[_0x99e6('0x15')][_0x99e6('0x16')]===undefined?!![]:![]:!![]})[_0x99e6('0xa')](function(_0x41a32b){logger[_0x99e6('0x11')](_0x99e6('0x17'),_0x2e9e24);logger[_0x99e6('0x18')]('CreateSquareMessage',_0x2e9e24,JSON[_0x99e6('0xd')](_0x41a32b));_0x2749bf(_0x41a32b);})[_0x99e6('0x12')](function(_0x16f05d){logger[_0x99e6('0xe')](_0x99e6('0x17'),_0x16f05d[_0x99e6('0x10')],_0x2e9e24);_0x359358(_0x4e84f4[_0x99e6('0xe')](0x1f4,_0x16f05d[_0x99e6('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index fb9749f..03c93cf 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 _0xa5d0=['isAuthenticated','index','/:id','show','/:id/test','15s','test','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./squareOdbc.controller','get'];(function(_0xdb576,_0x13705e){var _0x98a94b=function(_0x4c1533){while(--_0x4c1533){_0xdb576['push'](_0xdb576['shift']());}};_0x98a94b(++_0x13705e);}(_0xa5d0,0xd5));var _0x0a5d=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa5d0[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x0a5d('0x0'));var util=require('util');var path=require(_0x0a5d('0x1'));var timeout=require(_0x0a5d('0x2'));var express=require(_0x0a5d('0x3'));var router=express['Router']();var auth=require(_0x0a5d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x0a5d('0x5'));var controller=require(_0x0a5d('0x6'));router[_0x0a5d('0x7')]('/',auth[_0x0a5d('0x8')](),controller[_0x0a5d('0x9')]);router['get'](_0x0a5d('0xa'),auth[_0x0a5d('0x8')](),controller[_0x0a5d('0xb')]);router[_0x0a5d('0x7')](_0x0a5d('0xc'),auth[_0x0a5d('0x8')](),timeout(_0x0a5d('0xd')),controller[_0x0a5d('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth[_0x0a5d('0x8')](),controller['update']);router['delete'](_0x0a5d('0xa'),auth[_0x0a5d('0x8')](),controller[_0x0a5d('0xf')]);module[_0x0a5d('0x10')]=router; \ No newline at end of file +var _0xd624=['post','create','/:id','update','delete','destroy','exports','multer','util','connect-timeout','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','show','/:id/test','test'];(function(_0x4ed520,_0x21be63){var _0x4415a6=function(_0x14b151){while(--_0x14b151){_0x4ed520['push'](_0x4ed520['shift']());}};_0x4415a6(++_0x21be63);}(_0xd624,0x124));var _0x4d62=function(_0x2092ad,_0x43b4a1){_0x2092ad=_0x2092ad-0x0;var _0x1830f2=_0xd624[_0x2092ad];return _0x1830f2;};'use strict';var multer=require(_0x4d62('0x0'));var util=require(_0x4d62('0x1'));var path=require('path');var timeout=require(_0x4d62('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x4d62('0x3'));var config=require(_0x4d62('0x4'));var controller=require(_0x4d62('0x5'));router[_0x4d62('0x6')]('/',auth[_0x4d62('0x7')](),controller[_0x4d62('0x8')]);router['get']('/:id',auth[_0x4d62('0x7')](),controller[_0x4d62('0x9')]);router[_0x4d62('0x6')](_0x4d62('0xa'),auth[_0x4d62('0x7')](),timeout('15s'),controller[_0x4d62('0xb')]);router[_0x4d62('0xc')]('/',auth[_0x4d62('0x7')](),controller[_0x4d62('0xd')]);router['put'](_0x4d62('0xe'),auth[_0x4d62('0x7')](),controller[_0x4d62('0xf')]);router[_0x4d62('0x10')](_0x4d62('0xe'),auth[_0x4d62('0x7')](),controller[_0x4d62('0x11')]);module[_0x4d62('0x12')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index e91359f..97a4654 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 _0xf8d0=['exports','name','STRING','sequelize'];(function(_0x102f96,_0x2509a6){var _0x441079=function(_0x35c3d6){while(--_0x35c3d6){_0x102f96['push'](_0x102f96['shift']());}};_0x441079(++_0x2509a6);}(_0xf8d0,0x1e3));var _0x0f8d=function(_0x48863e,_0x3c44ae){_0x48863e=_0x48863e-0x0;var _0x57dddd=_0xf8d0[_0x48863e];return _0x57dddd;};'use strict';var Sequelize=require(_0x0f8d('0x0'));module[_0x0f8d('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0f8d('0x2'),'allowNull':![]},'dsn':{'type':Sequelize[_0x0f8d('0x3')]},'description':{'type':Sequelize[_0x0f8d('0x3')]}}; \ No newline at end of file +var _0x869b=['name','sequelize','exports','STRING'];(function(_0x2d4661,_0x2da65c){var _0x42ed1e=function(_0x263c50){while(--_0x263c50){_0x2d4661['push'](_0x2d4661['shift']());}};_0x42ed1e(++_0x2da65c);}(_0x869b,0x159));var _0xb869=function(_0x40bee0,_0xb0ee65){_0x40bee0=_0x40bee0-0x0;var _0x5bb70c=_0x869b[_0x40bee0];return _0x5bb70c;};'use strict';var Sequelize=require(_0xb869('0x0'));module[_0xb869('0x1')]={'name':{'type':Sequelize[_0xb869('0x2')],'unique':_0xb869('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb869('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index 58716c4..145cfae 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 _0xe835=['query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','test','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','fieldName','type','key'];(function(_0x5b70a8,_0xb5daf0){var _0x4b68d2=function(_0x344eaf){while(--_0x344eaf){_0x5b70a8['push'](_0x5b70a8['shift']());}};_0x4b68d2(++_0xb5daf0);}(_0xe835,0x1c4));var _0x5e83=function(_0x101e7b,_0x4ef05b){_0x101e7b=_0x101e7b-0x0;var _0x4995c0=_0xe835[_0x101e7b];return _0x4995c0;};'use strict';var pdf=require(_0x5e83('0x0'));var emlformat=require(_0x5e83('0x1'));var rimraf=require(_0x5e83('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x5e83('0x3'));var rp=require('request-promise');var moment=require(_0x5e83('0x4'));var BPromise=require(_0x5e83('0x5'));var Mustache=require(_0x5e83('0x6'));var util=require(_0x5e83('0x7'));var path=require('path');var sox=require(_0x5e83('0x8'));var csv=require(_0x5e83('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5e83('0xa'));var squel=require(_0x5e83('0xb'));var crypto=require(_0x5e83('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x5e83('0x9'));var querystring=require(_0x5e83('0xd'));var Papa=require(_0x5e83('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5e83('0xf'));var as=require(_0x5e83('0x10'));var hardwareService=require(_0x5e83('0x11'));var logger=require(_0x5e83('0x12'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x5e83('0x13'))['db'];function respondWithStatusCode(_0x4b946c,_0x5c3ef3){_0x5c3ef3=_0x5c3ef3||0xcc;return function(_0x1ce0f6){if(_0x1ce0f6){return _0x4b946c[_0x5e83('0x14')](_0x5c3ef3);}return _0x4b946c[_0x5e83('0x15')](_0x5c3ef3)[_0x5e83('0x16')]();};}function respondWithResult(_0x54c0a4,_0x59af49){_0x59af49=_0x59af49||0xc8;return function(_0x2312bf){if(_0x2312bf){return _0x54c0a4[_0x5e83('0x15')](_0x59af49)[_0x5e83('0x17')](_0x2312bf);}};}function respondWithFilteredResult(_0x5ed22d,_0x47cdc7){return function(_0x277ed7){if(_0x277ed7){var _0x1f3b7d=_0x277ed7[_0x5e83('0x18')],_0x4c48ea=_0x47cdc7[_0x5e83('0x19')],_0x3aa4c4=_0x47cdc7['offset']+_0x47cdc7['limit'],_0x3b764b;if(_0x3aa4c4>=_0x1f3b7d){_0x3aa4c4=_0x1f3b7d;_0x3b764b=0xc8;}else{_0x3b764b=0xce;}_0x5ed22d[_0x5e83('0x15')](_0x3b764b);return _0x5ed22d[_0x5e83('0x1a')]('Content-Range',_0x4c48ea+'-'+_0x3aa4c4+'/'+_0x1f3b7d)[_0x5e83('0x17')](_0x277ed7);}return null;};}function patchUpdates(_0x15fd99){return function(_0x2aa2e3){try{jsonpatch[_0x5e83('0x1b')](_0x2aa2e3,_0x15fd99,!![]);}catch(_0x2d0900){return BPromise[_0x5e83('0x1c')](_0x2d0900);}return _0x2aa2e3[_0x5e83('0x1d')]();};}function saveUpdates(_0x466453,_0x3e7a91){return function(_0x49df5b){if(_0x49df5b){return _0x49df5b[_0x5e83('0x1e')](_0x466453)[_0x5e83('0x1f')](function(_0x402d94){return _0x402d94;});}return null;};}function removeEntity(_0x449869,_0x3bea45){return function(_0x4a2cd9){if(_0x4a2cd9){return _0x4a2cd9[_0x5e83('0x20')]()[_0x5e83('0x1f')](function(){var _0x2bd47a=_0x4a2cd9[_0x5e83('0x21')]({'plain':!![]});var _0x165c00=_0x5e83('0x22');return db[_0x5e83('0x23')][_0x5e83('0x20')]({'where':{'type':_0x165c00,'resourceId':_0x2bd47a['id']}})[_0x5e83('0x1f')](function(){return _0x4a2cd9;});})[_0x5e83('0x1f')](function(){_0x449869[_0x5e83('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbaf6,_0xdecf09){return function(_0x465c03){if(!_0x465c03){_0x2cbaf6[_0x5e83('0x14')](0x194);}return _0x465c03;};}function handleError(_0x3b9ae0,_0x569425){_0x569425=_0x569425||0x1f4;return function(_0x32a1ed){logger[_0x5e83('0x24')](_0x32a1ed[_0x5e83('0x25')]);if(_0x32a1ed['name']){delete _0x32a1ed[_0x5e83('0x26')];}_0x3b9ae0[_0x5e83('0x15')](_0x569425)[_0x5e83('0x27')](_0x32a1ed);};}exports[_0x5e83('0x28')]=function(_0x1b174d,_0x1a0f4d){var _0x2fa737={},_0x1a18c9={},_0x48a09d={'count':0x0,'rows':[]};var _0x502a55=_[_0x5e83('0x29')](db[_0x5e83('0x2a')]['rawAttributes'],function(_0x527750){return{'name':_0x527750[_0x5e83('0x2b')],'type':_0x527750[_0x5e83('0x2c')][_0x5e83('0x2d')]};});_0x1a18c9['model']=_['map'](_0x502a55,'name');_0x1a18c9[_0x5e83('0x2e')]=_[_0x5e83('0x2f')](_0x1b174d[_0x5e83('0x2e')]);_0x1a18c9[_0x5e83('0x30')]=_[_0x5e83('0x31')](_0x1a18c9[_0x5e83('0x32')],_0x1a18c9[_0x5e83('0x2e')]);_0x2fa737[_0x5e83('0x33')]=_['intersection'](_0x1a18c9[_0x5e83('0x32')],qs[_0x5e83('0x34')](_0x1b174d[_0x5e83('0x2e')][_0x5e83('0x34')]));_0x2fa737[_0x5e83('0x33')]=_0x2fa737[_0x5e83('0x33')]['length']?_0x2fa737[_0x5e83('0x33')]:_0x1a18c9[_0x5e83('0x32')];if(!_0x1b174d[_0x5e83('0x2e')][_0x5e83('0x35')](_0x5e83('0x36'))){_0x2fa737['limit']=qs[_0x5e83('0x37')](_0x1b174d[_0x5e83('0x2e')]['limit']);_0x2fa737[_0x5e83('0x19')]=qs[_0x5e83('0x19')](_0x1b174d[_0x5e83('0x2e')][_0x5e83('0x19')]);}_0x2fa737[_0x5e83('0x38')]=qs[_0x5e83('0x39')](_0x1b174d[_0x5e83('0x2e')][_0x5e83('0x39')]);_0x2fa737[_0x5e83('0x3a')]=qs[_0x5e83('0x30')](_['pick'](_0x1b174d[_0x5e83('0x2e')],_0x1a18c9[_0x5e83('0x30')]));if(_0x1b174d[_0x5e83('0x2e')][_0x5e83('0x3b')]){_0x2fa737['where']=_[_0x5e83('0x3c')](_0x2fa737[_0x5e83('0x3a')],{'$or':_[_0x5e83('0x29')](_0x502a55,function(_0xb84bd){if(_0xb84bd[_0x5e83('0x2c')]!==_0x5e83('0x3d')){var _0x2f19c2={};_0x2f19c2[_0xb84bd[_0x5e83('0x26')]]={'$like':'%'+_0x1b174d['query']['filter']+'%'};return _0x2f19c2;}})});}_0x2fa737=_[_0x5e83('0x3c')]({},_0x2fa737,_0x1b174d[_0x5e83('0x3e')]);var _0x203afa={'where':_0x2fa737[_0x5e83('0x3a')]};return db[_0x5e83('0x2a')][_0x5e83('0x18')](_0x203afa)['then'](function(_0x294179){_0x48a09d[_0x5e83('0x18')]=_0x294179;if(_0x1b174d['query'][_0x5e83('0x3f')]){_0x2fa737[_0x5e83('0x40')]=[{'all':!![]}];}return db[_0x5e83('0x2a')]['findAll'](_0x2fa737);})[_0x5e83('0x1f')](function(_0x3a93a4){_0x48a09d[_0x5e83('0x41')]=_0x3a93a4;return _0x48a09d;})['then'](respondWithFilteredResult(_0x1a0f4d,_0x2fa737))[_0x5e83('0x42')](handleError(_0x1a0f4d,null));};exports[_0x5e83('0x43')]=function(_0x27e607,_0x3bbc3){var _0x49c222={'raw':!![],'where':{'id':_0x27e607[_0x5e83('0x44')]['id']}},_0x84c95d={};_0x84c95d[_0x5e83('0x32')]=_['keys'](db[_0x5e83('0x2a')]['rawAttributes']);_0x84c95d[_0x5e83('0x2e')]=_[_0x5e83('0x2f')](_0x27e607[_0x5e83('0x2e')]);_0x84c95d[_0x5e83('0x30')]=_[_0x5e83('0x31')](_0x84c95d[_0x5e83('0x32')],_0x84c95d[_0x5e83('0x2e')]);_0x49c222[_0x5e83('0x33')]=_['intersection'](_0x84c95d[_0x5e83('0x32')],qs['fields'](_0x27e607[_0x5e83('0x2e')][_0x5e83('0x34')]));_0x49c222[_0x5e83('0x33')]=_0x49c222[_0x5e83('0x33')][_0x5e83('0x45')]?_0x49c222[_0x5e83('0x33')]:_0x84c95d['model'];if(_0x27e607[_0x5e83('0x2e')][_0x5e83('0x3f')]){_0x49c222[_0x5e83('0x40')]=[{'all':!![]}];}_0x49c222=_['merge']({},_0x49c222,_0x27e607[_0x5e83('0x3e')]);return db[_0x5e83('0x2a')][_0x5e83('0x46')](_0x49c222)['then'](handleEntityNotFound(_0x3bbc3,null))[_0x5e83('0x1f')](respondWithResult(_0x3bbc3,null))['catch'](handleError(_0x3bbc3,null));};exports['create']=function(_0x1580f2,_0x2b628d){return db[_0x5e83('0x2a')][_0x5e83('0x47')](_0x1580f2[_0x5e83('0x48')],{})['then'](function(_0x47e1cf){var _0x186107=_0x1580f2[_0x5e83('0x49')]['get']({'plain':!![]});if(!_0x186107)throw new Error(_0x5e83('0x4a'));if(_0x186107['role']===_0x5e83('0x49')){var _0x4f254d=_0x47e1cf[_0x5e83('0x21')]({'plain':!![]});var _0x5ac8d3=_0x5e83('0x22');return db[_0x5e83('0x4b')][_0x5e83('0x46')]({'where':{'name':_0x5ac8d3,'userProfileId':_0x186107[_0x5e83('0x4c')]},'raw':!![]})['then'](function(_0x2a2252){if(_0x2a2252&&_0x2a2252[_0x5e83('0x4d')]===0x0){return db[_0x5e83('0x23')][_0x5e83('0x47')]({'name':_0x4f254d['name'],'resourceId':_0x4f254d['id'],'type':_0x2a2252['name'],'sectionId':_0x2a2252['id']},{})[_0x5e83('0x1f')](function(){return _0x47e1cf;});}else{return _0x47e1cf;}})[_0x5e83('0x42')](function(_0x2102d9){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2102d9);throw _0x2102d9;});}return _0x47e1cf;})['then'](respondWithResult(_0x2b628d,0xc9))[_0x5e83('0x42')](handleError(_0x2b628d,null));};exports[_0x5e83('0x1e')]=function(_0x1eb02e,_0x5f5369){if(_0x1eb02e[_0x5e83('0x48')]['id']){delete _0x1eb02e[_0x5e83('0x48')]['id'];}return db[_0x5e83('0x2a')][_0x5e83('0x46')]({'where':{'id':_0x1eb02e['params']['id']}})[_0x5e83('0x1f')](handleEntityNotFound(_0x5f5369,null))[_0x5e83('0x1f')](saveUpdates(_0x1eb02e[_0x5e83('0x48')],null))[_0x5e83('0x1f')](respondWithResult(_0x5f5369,null))[_0x5e83('0x42')](handleError(_0x5f5369,null));};exports[_0x5e83('0x20')]=function(_0x3929e5,_0x383574){return db[_0x5e83('0x2a')][_0x5e83('0x46')]({'where':{'id':_0x3929e5[_0x5e83('0x44')]['id']}})['then'](handleEntityNotFound(_0x383574,null))[_0x5e83('0x1f')](removeEntity(_0x383574,null))['catch'](handleError(_0x383574,null));};exports[_0x5e83('0x4e')]=function(_0x5984be,_0x42357d,_0x15eee7){var _0xcddac;return db[_0x5e83('0x2a')]['find']({'where':{'id':_0x5984be['params']['id']},'attributes':['id',_0x5e83('0x4f')]})[_0x5e83('0x1f')](handleEntityNotFound(_0x42357d,null))[_0x5e83('0x1f')](function(_0x2b041d){if(_0x2b041d){var _0x4c239b=require(_0x5e83('0x50'))();_0x4c239b[_0x5e83('0x51')](_0x2b041d[_0x5e83('0x4f')]);_0x4c239b[_0x5e83('0x52')]();return _0x2b041d;}})[_0x5e83('0x1f')](respondWithResult(_0x42357d,null))[_0x5e83('0x42')](handleError(_0x42357d,null));}; \ No newline at end of file +var _0xc1e0=['openSync','dsn','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','stack','name','send','map','SquareOdbc','rawAttributes','fieldName','model','query','keys','intersection','attributes','fields','hasOwnProperty','order','sort','pick','filters','filter','where','merge','type','VIRTUAL','includeAll','show','params','length','include','options','find','catch','body','user','role','UserProfileSection','userProfileId','create','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','test','odbc'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xc1e0,0xab));var _0x0c1e=function(_0x276522,_0x3e88fd){_0x276522=_0x276522-0x0;var _0x1c48b6=_0xc1e0[_0x276522];return _0x1c48b6;};'use strict';var pdf=require(_0x0c1e('0x0'));var emlformat=require(_0x0c1e('0x1'));var rimraf=require(_0x0c1e('0x2'));var zipdir=require(_0x0c1e('0x3'));var jsonpatch=require(_0x0c1e('0x4'));var rp=require('request-promise');var moment=require(_0x0c1e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x0c1e('0x6'));var util=require(_0x0c1e('0x7'));var path=require('path');var sox=require(_0x0c1e('0x8'));var csv=require(_0x0c1e('0x9'));var ejs=require(_0x0c1e('0xa'));var fs=require('fs');var _=require(_0x0c1e('0xb'));var squel=require('squel');var crypto=require(_0x0c1e('0xc'));var jsforce=require(_0x0c1e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0c1e('0x9'));var querystring=require(_0x0c1e('0xe'));var Papa=require(_0x0c1e('0xf'));var Redis=require(_0x0c1e('0x10'));var authService=require(_0x0c1e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x0c1e('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0c1e('0x13'))(_0x0c1e('0x14'));var utils=require(_0x0c1e('0x15'));var config=require('../../config/environment');var db=require(_0x0c1e('0x16'))['db'];function respondWithStatusCode(_0x50588f,_0x69dd87){_0x69dd87=_0x69dd87||0xcc;return function(_0xe4f9fa){if(_0xe4f9fa){return _0x50588f[_0x0c1e('0x17')](_0x69dd87);}return _0x50588f[_0x0c1e('0x18')](_0x69dd87)[_0x0c1e('0x19')]();};}function respondWithResult(_0x4d674a,_0x573a3a){_0x573a3a=_0x573a3a||0xc8;return function(_0x1796d8){if(_0x1796d8){return _0x4d674a[_0x0c1e('0x18')](_0x573a3a)[_0x0c1e('0x1a')](_0x1796d8);}};}function respondWithFilteredResult(_0x2456f8,_0xe183e){return function(_0xc5f9c){if(_0xc5f9c){var _0x2cb30c=_0xc5f9c[_0x0c1e('0x1b')],_0x4f540d=_0xe183e['offset'],_0x1c3a11=_0xe183e[_0x0c1e('0x1c')]+_0xe183e[_0x0c1e('0x1d')],_0x5d26f3;if(_0x1c3a11>=_0x2cb30c){_0x1c3a11=_0x2cb30c;_0x5d26f3=0xc8;}else{_0x5d26f3=0xce;}_0x2456f8[_0x0c1e('0x18')](_0x5d26f3);return _0x2456f8[_0x0c1e('0x1e')](_0x0c1e('0x1f'),_0x4f540d+'-'+_0x1c3a11+'/'+_0x2cb30c)[_0x0c1e('0x1a')](_0xc5f9c);}return null;};}function patchUpdates(_0xf21554){return function(_0x819d7a){try{jsonpatch[_0x0c1e('0x20')](_0x819d7a,_0xf21554,!![]);}catch(_0x19f7a3){return BPromise['reject'](_0x19f7a3);}return _0x819d7a[_0x0c1e('0x21')]();};}function saveUpdates(_0x38351a,_0x5d3251){return function(_0x3361e1){if(_0x3361e1){return _0x3361e1['update'](_0x38351a)[_0x0c1e('0x22')](function(_0x155e1d){return _0x155e1d;});}return null;};}function removeEntity(_0x311552,_0x32497b){return function(_0x6b88b0){if(_0x6b88b0){return _0x6b88b0[_0x0c1e('0x23')]()[_0x0c1e('0x22')](function(){var _0x442d76=_0x6b88b0[_0x0c1e('0x24')]({'plain':!![]});var _0x58a86a=_0x0c1e('0x25');return db[_0x0c1e('0x26')][_0x0c1e('0x23')]({'where':{'type':_0x58a86a,'resourceId':_0x442d76['id']}})[_0x0c1e('0x22')](function(){return _0x6b88b0;});})[_0x0c1e('0x22')](function(){_0x311552[_0x0c1e('0x18')](0xcc)[_0x0c1e('0x19')]();});}};}function handleEntityNotFound(_0x48ed26,_0x551b06){return function(_0x7193db){if(!_0x7193db){_0x48ed26[_0x0c1e('0x17')](0x194);}return _0x7193db;};}function handleError(_0x2cb9bf,_0x49ae2f){_0x49ae2f=_0x49ae2f||0x1f4;return function(_0x5937fe){logger['error'](_0x5937fe[_0x0c1e('0x27')]);if(_0x5937fe[_0x0c1e('0x28')]){delete _0x5937fe['name'];}_0x2cb9bf[_0x0c1e('0x18')](_0x49ae2f)[_0x0c1e('0x29')](_0x5937fe);};}exports['index']=function(_0x25c2d4,_0x21e9c6){var _0x22fed8={},_0x2f16f2={},_0x523df2={'count':0x0,'rows':[]};var _0x718ca8=_[_0x0c1e('0x2a')](db[_0x0c1e('0x2b')][_0x0c1e('0x2c')],function(_0x1c9e92){return{'name':_0x1c9e92[_0x0c1e('0x2d')],'type':_0x1c9e92['type']['key']};});_0x2f16f2[_0x0c1e('0x2e')]=_['map'](_0x718ca8,'name');_0x2f16f2[_0x0c1e('0x2f')]=_[_0x0c1e('0x30')](_0x25c2d4[_0x0c1e('0x2f')]);_0x2f16f2['filters']=_[_0x0c1e('0x31')](_0x2f16f2[_0x0c1e('0x2e')],_0x2f16f2[_0x0c1e('0x2f')]);_0x22fed8[_0x0c1e('0x32')]=_['intersection'](_0x2f16f2[_0x0c1e('0x2e')],qs[_0x0c1e('0x33')](_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x33')]));_0x22fed8[_0x0c1e('0x32')]=_0x22fed8[_0x0c1e('0x32')]['length']?_0x22fed8['attributes']:_0x2f16f2[_0x0c1e('0x2e')];if(!_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x34')]('nolimit')){_0x22fed8[_0x0c1e('0x1d')]=qs[_0x0c1e('0x1d')](_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x1d')]);_0x22fed8[_0x0c1e('0x1c')]=qs[_0x0c1e('0x1c')](_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x1c')]);}_0x22fed8[_0x0c1e('0x35')]=qs['sort'](_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x36')]);_0x22fed8['where']=qs['filters'](_[_0x0c1e('0x37')](_0x25c2d4['query'],_0x2f16f2[_0x0c1e('0x38')]));if(_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x39')]){_0x22fed8[_0x0c1e('0x3a')]=_[_0x0c1e('0x3b')](_0x22fed8[_0x0c1e('0x3a')],{'$or':_[_0x0c1e('0x2a')](_0x718ca8,function(_0x43301a){if(_0x43301a[_0x0c1e('0x3c')]!==_0x0c1e('0x3d')){var _0x5e8743={};_0x5e8743[_0x43301a[_0x0c1e('0x28')]]={'$like':'%'+_0x25c2d4[_0x0c1e('0x2f')][_0x0c1e('0x39')]+'%'};return _0x5e8743;}})});}_0x22fed8=_['merge']({},_0x22fed8,_0x25c2d4['options']);var _0x500235={'where':_0x22fed8[_0x0c1e('0x3a')]};return db['SquareOdbc'][_0x0c1e('0x1b')](_0x500235)[_0x0c1e('0x22')](function(_0xf81566){_0x523df2[_0x0c1e('0x1b')]=_0xf81566;if(_0x25c2d4['query'][_0x0c1e('0x3e')]){_0x22fed8['include']=[{'all':!![]}];}return db[_0x0c1e('0x2b')]['findAll'](_0x22fed8);})[_0x0c1e('0x22')](function(_0x28a211){_0x523df2['rows']=_0x28a211;return _0x523df2;})['then'](respondWithFilteredResult(_0x21e9c6,_0x22fed8))['catch'](handleError(_0x21e9c6,null));};exports[_0x0c1e('0x3f')]=function(_0xf79d9f,_0x165f8a){var _0x3de87d={'raw':!![],'where':{'id':_0xf79d9f[_0x0c1e('0x40')]['id']}},_0x16b08c={};_0x16b08c[_0x0c1e('0x2e')]=_[_0x0c1e('0x30')](db[_0x0c1e('0x2b')][_0x0c1e('0x2c')]);_0x16b08c['query']=_[_0x0c1e('0x30')](_0xf79d9f[_0x0c1e('0x2f')]);_0x16b08c[_0x0c1e('0x38')]=_[_0x0c1e('0x31')](_0x16b08c[_0x0c1e('0x2e')],_0x16b08c[_0x0c1e('0x2f')]);_0x3de87d['attributes']=_[_0x0c1e('0x31')](_0x16b08c[_0x0c1e('0x2e')],qs[_0x0c1e('0x33')](_0xf79d9f[_0x0c1e('0x2f')][_0x0c1e('0x33')]));_0x3de87d[_0x0c1e('0x32')]=_0x3de87d[_0x0c1e('0x32')][_0x0c1e('0x41')]?_0x3de87d[_0x0c1e('0x32')]:_0x16b08c[_0x0c1e('0x2e')];if(_0xf79d9f[_0x0c1e('0x2f')][_0x0c1e('0x3e')]){_0x3de87d[_0x0c1e('0x42')]=[{'all':!![]}];}_0x3de87d=_[_0x0c1e('0x3b')]({},_0x3de87d,_0xf79d9f[_0x0c1e('0x43')]);return db[_0x0c1e('0x2b')][_0x0c1e('0x44')](_0x3de87d)[_0x0c1e('0x22')](handleEntityNotFound(_0x165f8a,null))[_0x0c1e('0x22')](respondWithResult(_0x165f8a,null))[_0x0c1e('0x45')](handleError(_0x165f8a,null));};exports['create']=function(_0x1a1c10,_0x5dfec1){return db[_0x0c1e('0x2b')]['create'](_0x1a1c10[_0x0c1e('0x46')],{})[_0x0c1e('0x22')](function(_0x2eb5d8){var _0x3c837f=_0x1a1c10[_0x0c1e('0x47')][_0x0c1e('0x24')]({'plain':!![]});if(!_0x3c837f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3c837f[_0x0c1e('0x48')]===_0x0c1e('0x47')){var _0x5ccc3c=_0x2eb5d8['get']({'plain':!![]});var _0x43250b='ODBC';return db[_0x0c1e('0x49')]['find']({'where':{'name':_0x43250b,'userProfileId':_0x3c837f[_0x0c1e('0x4a')]},'raw':!![]})['then'](function(_0x34f978){if(_0x34f978&&_0x34f978['autoAssociation']===0x0){return db[_0x0c1e('0x26')][_0x0c1e('0x4b')]({'name':_0x5ccc3c[_0x0c1e('0x28')],'resourceId':_0x5ccc3c['id'],'type':_0x34f978[_0x0c1e('0x28')],'sectionId':_0x34f978['id']},{})[_0x0c1e('0x22')](function(){return _0x2eb5d8;});}else{return _0x2eb5d8;}})[_0x0c1e('0x45')](function(_0x40ed11){logger[_0x0c1e('0x4c')](_0x0c1e('0x4d'),_0x40ed11);throw _0x40ed11;});}return _0x2eb5d8;})[_0x0c1e('0x22')](respondWithResult(_0x5dfec1,0xc9))[_0x0c1e('0x45')](handleError(_0x5dfec1,null));};exports[_0x0c1e('0x4e')]=function(_0xaf2bb,_0xbb9c8b){if(_0xaf2bb['body']['id']){delete _0xaf2bb['body']['id'];}return db[_0x0c1e('0x2b')][_0x0c1e('0x44')]({'where':{'id':_0xaf2bb['params']['id']}})['then'](handleEntityNotFound(_0xbb9c8b,null))[_0x0c1e('0x22')](saveUpdates(_0xaf2bb[_0x0c1e('0x46')],null))[_0x0c1e('0x22')](respondWithResult(_0xbb9c8b,null))[_0x0c1e('0x45')](handleError(_0xbb9c8b,null));};exports[_0x0c1e('0x23')]=function(_0x11f1c7,_0x4c2aed){return db[_0x0c1e('0x2b')][_0x0c1e('0x44')]({'where':{'id':_0x11f1c7[_0x0c1e('0x40')]['id']}})[_0x0c1e('0x22')](handleEntityNotFound(_0x4c2aed,null))[_0x0c1e('0x22')](removeEntity(_0x4c2aed,null))[_0x0c1e('0x45')](handleError(_0x4c2aed,null));};exports[_0x0c1e('0x4f')]=function(_0x5892a1,_0x59480f,_0x3c44c5){var _0x2e3a25;return db[_0x0c1e('0x2b')][_0x0c1e('0x44')]({'where':{'id':_0x5892a1[_0x0c1e('0x40')]['id']},'attributes':['id','dsn']})[_0x0c1e('0x22')](handleEntityNotFound(_0x59480f,null))[_0x0c1e('0x22')](function(_0x40c3dc){if(_0x40c3dc){var _0x52ae36=require(_0x0c1e('0x50'))();_0x52ae36[_0x0c1e('0x51')](_0x40c3dc[_0x0c1e('0x52')]);_0x52ae36[_0x0c1e('0x53')]();return _0x40c3dc;}})[_0x0c1e('0x22')](respondWithResult(_0x59480f,null))[_0x0c1e('0x45')](handleError(_0x59480f,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index bef1930..32d1755 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 _0x8bef=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','define','SquareOdbc','lodash','util'];(function(_0x2ec461,_0x5f588a){var _0x28603d=function(_0x21114b){while(--_0x21114b){_0x2ec461['push'](_0x2ec461['shift']());}};_0x28603d(++_0x5f588a);}(_0x8bef,0x66));var _0xf8be=function(_0x3b4756,_0x3ee9b7){_0x3b4756=_0x3b4756-0x0;var _0x3ce1a5=_0x8bef[_0x3b4756];return _0x3ce1a5;};'use strict';var _=require(_0xf8be('0x0'));var util=require(_0xf8be('0x1'));var logger=require(_0xf8be('0x2'))(_0xf8be('0x3'));var moment=require(_0xf8be('0x4'));var BPromise=require('bluebird');var rp=require(_0xf8be('0x5'));var fs=require('fs');var path=require(_0xf8be('0x6'));var rimraf=require(_0xf8be('0x7'));var config=require(_0xf8be('0x8'));var attributes=require(_0xf8be('0x9'));module[_0xf8be('0xa')]=function(_0x86bf8e,_0x3238f1){return _0x86bf8e[_0xf8be('0xb')](_0xf8be('0xc'),attributes,{'tableName':'square_odbc','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2106=['request-promise','path','../../config/environment','./squareOdbc.attributes','define','SquareOdbc','square_odbc','util','../../config/logger','api','moment','bluebird'];(function(_0x48ba31,_0x4385ff){var _0x3a1d49=function(_0x5e87bc){while(--_0x5e87bc){_0x48ba31['push'](_0x48ba31['shift']());}};_0x3a1d49(++_0x4385ff);}(_0x2106,0x133));var _0x6210=function(_0x742412,_0x463f9c){_0x742412=_0x742412-0x0;var _0x262fcf=_0x2106[_0x742412];return _0x262fcf;};'use strict';var _=require('lodash');var util=require(_0x6210('0x0'));var logger=require(_0x6210('0x1'))(_0x6210('0x2'));var moment=require(_0x6210('0x3'));var BPromise=require(_0x6210('0x4'));var rp=require(_0x6210('0x5'));var fs=require('fs');var path=require(_0x6210('0x6'));var rimraf=require('rimraf');var config=require(_0x6210('0x7'));var attributes=require(_0x6210('0x8'));module['exports']=function(_0x14ea73,_0x1bc2d2){return _0x14ea73[_0x6210('0x9')](_0x6210('0xa'),attributes,{'tableName':_0x6210('0xb'),'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 b52b083..e9dfde0 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x531a19,_0x43e019){var _0x4845d2=function(_0x4c9b62){while(--_0x4c9b62){_0x531a19['push'](_0x531a19['shift']());}};_0x4845d2(++_0x43e019);}(_0x55ca,0x126));var _0xa55c=function(_0x2c5340,_0x5c86e5){_0x2c5340=_0x2c5340-0x0;var _0x3c505e=_0x55ca[_0x2c5340];return _0x3c505e;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x30c3db,_0x22bc55){var _0x40ec7c=function(_0x2fcdc0){while(--_0x2fcdc0){_0x30c3db['push'](_0x30c3db['shift']());}};_0x40ec7c(++_0x22bc55);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var _=require(_0x7995('0x0'));var util=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));var BPromise=require(_0x7995('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7995('0x4'));var db=require(_0x7995('0x5'))['db'];var utils=require(_0x7995('0x6'));var logger=require(_0x7995('0x7'))('rpc');var config=require(_0x7995('0x8'));var jayson=require(_0x7995('0x9'));var client=jayson[_0x7995('0xa')][_0x7995('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xbda126,_0x326741,_0x4996ca){return new BPromise(function(_0x465276,_0x1cad37){return client['request'](_0xbda126,_0x4996ca)[_0x7995('0xc')](function(_0x3116fb){logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));logger[_0x7995('0x10')](_0x7995('0x11'),_0x326741,'request\x20sent',JSON[_0x7995('0x12')](_0x3116fb));if(_0x3116fb[_0x7995('0x13')]){if(_0x3116fb['error'][_0x7995('0x14')]===0x1f4){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x1cad37(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}logger['error']('SquareOdbc,\x20%s,\x20%s',_0x326741,_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);return _0x465276(_0x3116fb[_0x7995('0x13')][_0x7995('0x15')]);}else{logger[_0x7995('0xd')](_0x7995('0xe'),_0x326741,_0x7995('0xf'));_0x465276(_0x3116fb[_0x7995('0x16')]['message']);}})[_0x7995('0x17')](function(_0x565d97){logger[_0x7995('0x13')](_0x7995('0xe'),_0x326741,_0x565d97);_0x1cad37(_0x565d97);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 0e24af9..4254a68 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 _0xf45e=['isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','update','delete','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get'];(function(_0x2f8ec0,_0x4b51a8){var _0x3f7dba=function(_0x154626){while(--_0x154626){_0x2f8ec0['push'](_0x2f8ec0['shift']());}};_0x3f7dba(++_0x4b51a8);}(_0xf45e,0x115));var _0xef45=function(_0x24ea86,_0x2d3a8b){_0x24ea86=_0x24ea86-0x0;var _0x2dddca=_0xf45e[_0x24ea86];return _0x2dddca;};'use strict';var multer=require(_0xef45('0x0'));var util=require('util');var path=require(_0xef45('0x1'));var timeout=require('connect-timeout');var express=require(_0xef45('0x2'));var router=express[_0xef45('0x3')]();var auth=require(_0xef45('0x4'));var interaction=require(_0xef45('0x5'));var config=require(_0xef45('0x6'));var controller=require(_0xef45('0x7'));router[_0xef45('0x8')]('/',auth[_0xef45('0x9')](),controller[_0xef45('0xa')]);router[_0xef45('0x8')](_0xef45('0xb'),auth[_0xef45('0x9')](),controller[_0xef45('0xc')]);router[_0xef45('0x8')](_0xef45('0xd'),auth[_0xef45('0x9')](),controller[_0xef45('0xe')]);router[_0xef45('0xf')]('/',auth[_0xef45('0x9')](),controller['create']);router[_0xef45('0xf')](_0xef45('0xd'),auth[_0xef45('0x9')](),controller[_0xef45('0x10')]);router[_0xef45('0x11')](_0xef45('0xb'),auth['isAuthenticated'](),controller[_0xef45('0x12')]);router[_0xef45('0x13')](_0xef45('0xb'),auth[_0xef45('0x9')](),controller[_0xef45('0x14')]);router['delete']('/:id/users',auth[_0xef45('0x9')](),controller['removeUsers']);module[_0xef45('0x15')]=router; \ No newline at end of file +var _0x087b=['removeUsers','exports','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','index','/:id','show','/:id/users','getUsers','post','addUsers','put','delete'];(function(_0x16a3f5,_0x304ea8){var _0x53f14a=function(_0x14025c){while(--_0x14025c){_0x16a3f5['push'](_0x16a3f5['shift']());}};_0x53f14a(++_0x304ea8);}(_0x087b,0x11a));var _0xb087=function(_0x3305de,_0x16582f){_0x3305de=_0x3305de-0x0;var _0x3b5a84=_0x087b[_0x3305de];return _0x3b5a84;};'use strict';var multer=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xb087('0x2'));var router=express['Router']();var auth=require(_0xb087('0x3'));var interaction=require(_0xb087('0x4'));var config=require(_0xb087('0x5'));var controller=require(_0xb087('0x6'));router[_0xb087('0x7')]('/',auth[_0xb087('0x8')](),controller[_0xb087('0x9')]);router[_0xb087('0x7')](_0xb087('0xa'),auth[_0xb087('0x8')](),controller[_0xb087('0xb')]);router[_0xb087('0x7')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0xd')]);router[_0xb087('0xe')]('/',auth[_0xb087('0x8')](),controller['create']);router[_0xb087('0xe')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0xf')]);router[_0xb087('0x10')](_0xb087('0xa'),auth[_0xb087('0x8')](),controller['update']);router[_0xb087('0x11')](_0xb087('0xa'),auth[_0xb087('0x8')](),controller['destroy']);router[_0xb087('0x11')](_0xb087('0xc'),auth[_0xb087('0x8')](),controller[_0xb087('0x12')]);module[_0xb087('0x13')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 697b079..a0c3e68 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 _0x28ce=['sequelize','exports','STRING','TEXT','long','getDataValue','preproduction','toString','utf8','BLOB','production'];(function(_0x2e5bdb,_0x27c120){var _0x46dd24=function(_0x306f2f){while(--_0x306f2f){_0x2e5bdb['push'](_0x2e5bdb['shift']());}};_0x46dd24(++_0x27c120);}(_0x28ce,0x176));var _0xe28c=function(_0x481267,_0x4acb21){_0x481267=_0x481267-0x0;var _0x46eb8a=_0x28ce[_0x481267];return _0x46eb8a;};'use strict';var Sequelize=require(_0xe28c('0x0'));module[_0xe28c('0x1')]={'name':{'type':Sequelize[_0xe28c('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0xe28c('0x2')]},'notes':{'type':Sequelize[_0xe28c('0x3')]},'preproduction':{'type':Sequelize['BLOB'](_0xe28c('0x4')),'get':function(){if(this[_0xe28c('0x5')](_0xe28c('0x6'))){return this[_0xe28c('0x5')](_0xe28c('0x6'))[_0xe28c('0x7')](_0xe28c('0x8'));}}},'production':{'type':Sequelize[_0xe28c('0x9')](_0xe28c('0x4')),'get':function(){if(this[_0xe28c('0x5')]('production')){return this[_0xe28c('0x5')](_0xe28c('0xa'))[_0xe28c('0x7')](_0xe28c('0x8'));}}}}; \ No newline at end of file +var _0xc12a=['BLOB','long','getDataValue','preproduction','toString','production','utf8','exports','STRING','name'];(function(_0x27c185,_0x3bb425){var _0x580fd8=function(_0x11e23c){while(--_0x11e23c){_0x27c185['push'](_0x27c185['shift']());}};_0x580fd8(++_0x3bb425);}(_0xc12a,0x1b5));var _0xac12=function(_0x4cd8a2,_0x2dbd4c){_0x4cd8a2=_0x4cd8a2-0x0;var _0x95ed32=_0xc12a[_0x4cd8a2];return _0x95ed32;};'use strict';var Sequelize=require('sequelize');module[_0xac12('0x0')]={'name':{'type':Sequelize[_0xac12('0x1')],'unique':_0xac12('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xac12('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0xac12('0x3')](_0xac12('0x4')),'get':function(){if(this[_0xac12('0x5')](_0xac12('0x6'))){return this[_0xac12('0x5')]('preproduction')[_0xac12('0x7')]('utf8');}}},'production':{'type':Sequelize[_0xac12('0x3')]('long'),'get':function(){if(this['getDataValue'](_0xac12('0x8'))){return this[_0xac12('0x5')](_0xac12('0x8'))[_0xac12('0x7')](_0xac12('0x9'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index 0a82f3b..cc81281 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 _0xc788=['SquareProjects','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','userSquareProject:remove','emit','getUsers','sort','nolimit','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','status','json','offset','set','apply','reject','save','update','then','destroy','get','UserProfileResource','error','stack','name','send','index','map','SquareProject','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','where','pick','filter','merge','VIRTUAL','options','count','include','rows','catch','params','rawAttributes','includeAll','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user'];(function(_0x409d20,_0x115a0f){var _0x15bf79=function(_0x1c66d0){while(--_0x1c66d0){_0x409d20['push'](_0x409d20['shift']());}};_0x15bf79(++_0x115a0f);}(_0xc788,0xc4));var _0x8c78=function(_0x194794,_0x2858f2){_0x194794=_0x194794-0x0;var _0x4720fb=_0xc788[_0x194794];return _0x4720fb;};'use strict';var pdf=require(_0x8c78('0x0'));var emlformat=require(_0x8c78('0x1'));var rimraf=require(_0x8c78('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8c78('0x3'));var moment=require(_0x8c78('0x4'));var BPromise=require(_0x8c78('0x5'));var Mustache=require(_0x8c78('0x6'));var util=require(_0x8c78('0x7'));var path=require('path');var sox=require(_0x8c78('0x8'));var csv=require(_0x8c78('0x9'));var ejs=require(_0x8c78('0xa'));var fs=require('fs');var _=require(_0x8c78('0xb'));var squel=require(_0x8c78('0xc'));var crypto=require('crypto');var jsforce=require(_0x8c78('0xd'));var deskjs=require(_0x8c78('0xe'));var toCsv=require(_0x8c78('0x9'));var querystring=require(_0x8c78('0xf'));var Papa=require(_0x8c78('0x10'));var Redis=require(_0x8c78('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8c78('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8c78('0x13'));var logger=require(_0x8c78('0x14'))('api');var utils=require(_0x8c78('0x15'));var config=require(_0x8c78('0x16'));var db=require('../../mysqldb')['db'];config[_0x8c78('0x17')]=_['defaults'](config['redis'],{'host':_0x8c78('0x18'),'port':0x18eb});var socket=require(_0x8c78('0x19'))(new Redis(config[_0x8c78('0x17')]));require(_0x8c78('0x1a'))[_0x8c78('0x1b')](socket);function respondWithStatusCode(_0x3d1306,_0xe5f8ae){_0xe5f8ae=_0xe5f8ae||0xcc;return function(_0x930233){if(_0x930233){return _0x3d1306[_0x8c78('0x1c')](_0xe5f8ae);}return _0x3d1306[_0x8c78('0x1d')](_0xe5f8ae)['end']();};}function respondWithResult(_0x1fa78e,_0x293cfe){_0x293cfe=_0x293cfe||0xc8;return function(_0x57ad11){if(_0x57ad11){return _0x1fa78e[_0x8c78('0x1d')](_0x293cfe)[_0x8c78('0x1e')](_0x57ad11);}};}function respondWithFilteredResult(_0xe7c355,_0x23824e){return function(_0x2a982c){if(_0x2a982c){var _0x461eff=_0x2a982c['count'],_0x54eafa=_0x23824e['offset'],_0x4f7bf9=_0x23824e[_0x8c78('0x1f')]+_0x23824e['limit'],_0x339d04;if(_0x4f7bf9>=_0x461eff){_0x4f7bf9=_0x461eff;_0x339d04=0xc8;}else{_0x339d04=0xce;}_0xe7c355[_0x8c78('0x1d')](_0x339d04);return _0xe7c355[_0x8c78('0x20')]('Content-Range',_0x54eafa+'-'+_0x4f7bf9+'/'+_0x461eff)[_0x8c78('0x1e')](_0x2a982c);}return null;};}function patchUpdates(_0x5b111b){return function(_0x2dba52){try{jsonpatch[_0x8c78('0x21')](_0x2dba52,_0x5b111b,!![]);}catch(_0x5a254d){return BPromise[_0x8c78('0x22')](_0x5a254d);}return _0x2dba52[_0x8c78('0x23')]();};}function saveUpdates(_0x499603,_0x2bc595){return function(_0x28ed3a){if(_0x28ed3a){return _0x28ed3a[_0x8c78('0x24')](_0x499603)[_0x8c78('0x25')](function(_0x215940){return _0x215940;});}return null;};}function removeEntity(_0x20f483,_0xbfdf6f){return function(_0x1958f1){if(_0x1958f1){return _0x1958f1[_0x8c78('0x26')]()['then'](function(){var _0x93c78d=_0x1958f1[_0x8c78('0x27')]({'plain':!![]});var _0x1d1cef='SquareProjects';return db[_0x8c78('0x28')]['destroy']({'where':{'type':_0x1d1cef,'resourceId':_0x93c78d['id']}})[_0x8c78('0x25')](function(){return _0x1958f1;});})[_0x8c78('0x25')](function(){_0x20f483[_0x8c78('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x583a74,_0x2568d5){return function(_0x4be49d){if(!_0x4be49d){_0x583a74[_0x8c78('0x1c')](0x194);}return _0x4be49d;};}function handleError(_0x4376da,_0x394c1d){_0x394c1d=_0x394c1d||0x1f4;return function(_0x36e8e5){logger[_0x8c78('0x29')](_0x36e8e5[_0x8c78('0x2a')]);if(_0x36e8e5['name']){delete _0x36e8e5[_0x8c78('0x2b')];}_0x4376da['status'](_0x394c1d)[_0x8c78('0x2c')](_0x36e8e5);};}exports[_0x8c78('0x2d')]=function(_0xb69c52,_0x4e764f){var _0x1f1a0c={},_0x3816d2={},_0x4f0005={'count':0x0,'rows':[]};var _0x42d4bb=_[_0x8c78('0x2e')](db[_0x8c78('0x2f')]['rawAttributes'],function(_0x36ece0){return{'name':_0x36ece0[_0x8c78('0x30')],'type':_0x36ece0[_0x8c78('0x31')]['key']};});_0x3816d2[_0x8c78('0x32')]=_[_0x8c78('0x2e')](_0x42d4bb,'name');_0x3816d2[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0xb69c52[_0x8c78('0x33')]);_0x3816d2[_0x8c78('0x35')]=_[_0x8c78('0x36')](_0x3816d2[_0x8c78('0x32')],_0x3816d2[_0x8c78('0x33')]);_0x1f1a0c[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0x3816d2[_0x8c78('0x32')],qs['fields'](_0xb69c52[_0x8c78('0x33')][_0x8c78('0x38')]));_0x1f1a0c[_0x8c78('0x37')]=_0x1f1a0c[_0x8c78('0x37')][_0x8c78('0x39')]?_0x1f1a0c['attributes']:_0x3816d2[_0x8c78('0x32')];if(!_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3a')]('nolimit')){_0x1f1a0c[_0x8c78('0x3b')]=qs[_0x8c78('0x3b')](_0xb69c52['query'][_0x8c78('0x3b')]);_0x1f1a0c['offset']=qs[_0x8c78('0x1f')](_0xb69c52[_0x8c78('0x33')][_0x8c78('0x1f')]);}_0x1f1a0c[_0x8c78('0x3c')]=qs['sort'](_0xb69c52[_0x8c78('0x33')]['sort']);_0x1f1a0c[_0x8c78('0x3d')]=qs[_0x8c78('0x35')](_[_0x8c78('0x3e')](_0xb69c52['query'],_0x3816d2['filters']));if(_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3f')]){_0x1f1a0c[_0x8c78('0x3d')]=_[_0x8c78('0x40')](_0x1f1a0c[_0x8c78('0x3d')],{'$or':_[_0x8c78('0x2e')](_0x42d4bb,function(_0x326b34){if(_0x326b34[_0x8c78('0x31')]!==_0x8c78('0x41')){var _0x23f155={};_0x23f155[_0x326b34[_0x8c78('0x2b')]]={'$like':'%'+_0xb69c52[_0x8c78('0x33')][_0x8c78('0x3f')]+'%'};return _0x23f155;}})});}_0x1f1a0c=_['merge']({},_0x1f1a0c,_0xb69c52[_0x8c78('0x42')]);var _0x2aad8b={'where':_0x1f1a0c['where']};return db['SquareProject'][_0x8c78('0x43')](_0x2aad8b)[_0x8c78('0x25')](function(_0x5c9af3){_0x4f0005[_0x8c78('0x43')]=_0x5c9af3;if(_0xb69c52[_0x8c78('0x33')]['includeAll']){_0x1f1a0c[_0x8c78('0x44')]=[{'all':!![]}];}return db[_0x8c78('0x2f')]['findAll'](_0x1f1a0c);})[_0x8c78('0x25')](function(_0x24a8ea){_0x4f0005[_0x8c78('0x45')]=_0x24a8ea;return _0x4f0005;})[_0x8c78('0x25')](respondWithFilteredResult(_0x4e764f,_0x1f1a0c))[_0x8c78('0x46')](handleError(_0x4e764f,null));};exports['show']=function(_0x545d90,_0x2841c2){var _0x2f6a6b={'raw':![],'where':{'id':_0x545d90[_0x8c78('0x47')]['id']}},_0xac60f9={};_0xac60f9[_0x8c78('0x32')]=_[_0x8c78('0x34')](db[_0x8c78('0x2f')][_0x8c78('0x48')]);_0xac60f9[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x545d90[_0x8c78('0x33')]);_0xac60f9['filters']=_[_0x8c78('0x36')](_0xac60f9[_0x8c78('0x32')],_0xac60f9[_0x8c78('0x33')]);_0x2f6a6b[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0xac60f9['model'],qs[_0x8c78('0x38')](_0x545d90[_0x8c78('0x33')][_0x8c78('0x38')]));_0x2f6a6b[_0x8c78('0x37')]=_0x2f6a6b[_0x8c78('0x37')]['length']?_0x2f6a6b[_0x8c78('0x37')]:_0xac60f9['model'];if(_0x545d90['query'][_0x8c78('0x49')]){_0x2f6a6b[_0x8c78('0x44')]=[{'all':!![]}];}_0x2f6a6b=_[_0x8c78('0x40')]({},_0x2f6a6b,_0x545d90['options']);return db[_0x8c78('0x2f')][_0x8c78('0x4a')](_0x2f6a6b)[_0x8c78('0x25')](handleEntityNotFound(_0x2841c2,null))[_0x8c78('0x25')](respondWithResult(_0x2841c2,null))[_0x8c78('0x46')](handleError(_0x2841c2,null));};exports[_0x8c78('0x4b')]=function(_0x26103c,_0x1f5cdb){return db[_0x8c78('0x2f')]['create'](_0x26103c[_0x8c78('0x4c')],{})[_0x8c78('0x25')](function(_0xba0de6){var _0x2cbee8=_0x26103c['user'][_0x8c78('0x27')]({'plain':!![]});if(!_0x2cbee8)throw new Error(_0x8c78('0x4d'));if(_0x2cbee8[_0x8c78('0x4e')]===_0x8c78('0x4f')){var _0x53e75c=_0xba0de6[_0x8c78('0x27')]({'plain':!![]});var _0x38f7af=_0x8c78('0x50');return db['UserProfileSection'][_0x8c78('0x4a')]({'where':{'name':_0x38f7af,'userProfileId':_0x2cbee8['userProfileId']},'raw':!![]})[_0x8c78('0x25')](function(_0xe6325b){if(_0xe6325b&&_0xe6325b[_0x8c78('0x51')]===0x0){return db[_0x8c78('0x28')][_0x8c78('0x4b')]({'name':_0x53e75c[_0x8c78('0x2b')],'resourceId':_0x53e75c['id'],'type':_0xe6325b[_0x8c78('0x2b')],'sectionId':_0xe6325b['id']},{})[_0x8c78('0x25')](function(){return _0xba0de6;});}else{return _0xba0de6;}})[_0x8c78('0x46')](function(_0x454e97){logger[_0x8c78('0x29')](_0x8c78('0x52'),_0x454e97);throw _0x454e97;});}return _0xba0de6;})[_0x8c78('0x25')](respondWithResult(_0x1f5cdb,0xc9))[_0x8c78('0x46')](handleError(_0x1f5cdb,null));};exports['update']=function(_0x22fe6c,_0x3721f4){if(_0x22fe6c[_0x8c78('0x4c')]['id']){delete _0x22fe6c[_0x8c78('0x4c')]['id'];}return db['SquareProject'][_0x8c78('0x4a')]({'where':{'id':_0x22fe6c[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x3721f4,null))[_0x8c78('0x25')](saveUpdates(_0x22fe6c[_0x8c78('0x4c')],null))[_0x8c78('0x25')](respondWithResult(_0x3721f4,null))['catch'](handleError(_0x3721f4,null));};exports[_0x8c78('0x26')]=function(_0x42a34e,_0x486b61){return db[_0x8c78('0x2f')]['find']({'where':{'id':_0x42a34e[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x486b61,null))[_0x8c78('0x25')](removeEntity(_0x486b61,null))[_0x8c78('0x46')](handleError(_0x486b61,null));};exports[_0x8c78('0x53')]=function(_0x35cf85,_0x416a05,_0x49fa4c){return db[_0x8c78('0x2f')][_0x8c78('0x4a')]({'where':{'id':_0x35cf85['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x416a05,null))[_0x8c78('0x25')](function(_0x577361){if(_0x577361){return _0x577361[_0x8c78('0x53')](_0x35cf85[_0x8c78('0x4c')][_0x8c78('0x54')],_[_0x8c78('0x55')](_0x35cf85[_0x8c78('0x4c')],[_0x8c78('0x54'),'id'])||{});}})[_0x8c78('0x25')](respondWithResult(_0x416a05,null))[_0x8c78('0x46')](handleError(_0x416a05,null));};exports[_0x8c78('0x56')]=function(_0x1b3600,_0x25b8bc,_0x1c57ea){return db[_0x8c78('0x2f')][_0x8c78('0x4a')]({'where':{'id':_0x1b3600['params']['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x25b8bc,null))['then'](function(_0x4424a4){if(_0x4424a4){return _0x4424a4['removeUsers'](_0x1b3600['query']['ids'])[_0x8c78('0x25')](function(){if(_['isArray'](_0x1b3600['query']['ids'])){for(var _0x4373b4=0x0;_0x4373b4<_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')][_0x8c78('0x39')];_0x4373b4+=0x1){socket['emit'](_0x8c78('0x57'),{'UserId':Number(_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')][_0x4373b4]),'SquareProjectId':Number(_0x1b3600[_0x8c78('0x47')]['id'])});}}else{socket[_0x8c78('0x58')](_0x8c78('0x57'),{'UserId':Number(_0x1b3600[_0x8c78('0x33')][_0x8c78('0x54')]),'SquareProjectId':Number(_0x1b3600[_0x8c78('0x47')]['id'])});}});}})[_0x8c78('0x25')](respondWithStatusCode(_0x25b8bc,null))[_0x8c78('0x46')](handleError(_0x25b8bc,null));};exports[_0x8c78('0x59')]=function(_0x3e1ee0,_0x37da1f,_0x4bdb7e){var _0x46f57b={};var _0x4ed66c={};var _0x1b1de6;var _0x28d1a7;return db[_0x8c78('0x2f')]['findOne']({'where':{'id':_0x3e1ee0[_0x8c78('0x47')]['id']}})[_0x8c78('0x25')](handleEntityNotFound(_0x37da1f,null))[_0x8c78('0x25')](function(_0x4fa0b0){if(_0x4fa0b0){_0x1b1de6=_0x4fa0b0;_0x4ed66c[_0x8c78('0x32')]=_[_0x8c78('0x34')](db['User'][_0x8c78('0x48')]);_0x4ed66c[_0x8c78('0x33')]=_[_0x8c78('0x34')](_0x3e1ee0['query']);_0x4ed66c[_0x8c78('0x35')]=_[_0x8c78('0x36')](_0x4ed66c[_0x8c78('0x32')],_0x4ed66c[_0x8c78('0x33')]);_0x46f57b[_0x8c78('0x37')]=_[_0x8c78('0x36')](_0x4ed66c[_0x8c78('0x32')],qs[_0x8c78('0x38')](_0x3e1ee0[_0x8c78('0x33')]['fields']));_0x46f57b[_0x8c78('0x37')]=_0x46f57b[_0x8c78('0x37')][_0x8c78('0x39')]?_0x46f57b[_0x8c78('0x37')]:_0x4ed66c[_0x8c78('0x32')];_0x46f57b[_0x8c78('0x3c')]=qs[_0x8c78('0x5a')](_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x5a')]);_0x46f57b['where']=qs[_0x8c78('0x35')](_[_0x8c78('0x3e')](_0x3e1ee0['query'],_0x4ed66c['filters']));if(_0x3e1ee0[_0x8c78('0x33')]['filter']){_0x46f57b[_0x8c78('0x3d')]=_[_0x8c78('0x40')](_0x46f57b[_0x8c78('0x3d')],{'$or':_[_0x8c78('0x2e')](_0x46f57b[_0x8c78('0x37')],function(_0x154d34){var _0x512283={};_0x512283[_0x154d34]={'$like':'%'+_0x3e1ee0['query'][_0x8c78('0x3f')]+'%'};return _0x512283;})});}_0x46f57b=_[_0x8c78('0x40')]({},_0x46f57b,_0x3e1ee0[_0x8c78('0x42')]);return _0x1b1de6[_0x8c78('0x59')](_0x46f57b);}})[_0x8c78('0x25')](function(_0x4c09fd){if(_0x4c09fd){_0x28d1a7=_0x4c09fd[_0x8c78('0x39')];if(!_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x3a')](_0x8c78('0x5b'))){_0x46f57b[_0x8c78('0x3b')]=qs[_0x8c78('0x3b')](_0x3e1ee0['query'][_0x8c78('0x3b')]);_0x46f57b[_0x8c78('0x1f')]=qs['offset'](_0x3e1ee0[_0x8c78('0x33')][_0x8c78('0x1f')]);}return _0x1b1de6[_0x8c78('0x59')](_0x46f57b);}})[_0x8c78('0x25')](function(_0x3f2496){if(_0x3f2496){return _0x3f2496?{'count':_0x28d1a7,'rows':_0x3f2496}:null;}})[_0x8c78('0x25')](respondWithResult(_0x37da1f,null))[_0x8c78('0x46')](handleError(_0x37da1f,null));}; \ No newline at end of file +var _0x6f0d=['redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','status','json','count','offset','limit','Content-Range','apply','save','then','destroy','get','SquareProjects','end','error','stack','name','send','index','map','SquareProject','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','findOne','User','pick','getUsers','nolimit','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb'];(function(_0x533257,_0x30a1d2){var _0x380c88=function(_0x57b52d){while(--_0x57b52d){_0x533257['push'](_0x533257['shift']());}};_0x380c88(++_0x30a1d2);}(_0x6f0d,0x16c));var _0xd6f0=function(_0x132808,_0x4291c1){_0x132808=_0x132808-0x0;var _0x222112=_0x6f0d[_0x132808];return _0x222112;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd6f0('0x0'));var rimraf=require(_0xd6f0('0x1'));var zipdir=require(_0xd6f0('0x2'));var jsonpatch=require(_0xd6f0('0x3'));var rp=require('request-promise');var moment=require(_0xd6f0('0x4'));var BPromise=require(_0xd6f0('0x5'));var Mustache=require(_0xd6f0('0x6'));var util=require(_0xd6f0('0x7'));var path=require(_0xd6f0('0x8'));var sox=require('sox');var csv=require(_0xd6f0('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd6f0('0xa'));var squel=require(_0xd6f0('0xb'));var crypto=require(_0xd6f0('0xc'));var jsforce=require(_0xd6f0('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd6f0('0xe'));var Papa=require(_0xd6f0('0xf'));var Redis=require(_0xd6f0('0x10'));var authService=require(_0xd6f0('0x11'));var qs=require(_0xd6f0('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd6f0('0x13'));var logger=require(_0xd6f0('0x14'))(_0xd6f0('0x15'));var utils=require(_0xd6f0('0x16'));var config=require('../../config/environment');var db=require(_0xd6f0('0x17'))['db'];config[_0xd6f0('0x18')]=_[_0xd6f0('0x19')](config[_0xd6f0('0x18')],{'host':_0xd6f0('0x1a'),'port':0x18eb});var socket=require(_0xd6f0('0x1b'))(new Redis(config[_0xd6f0('0x18')]));require(_0xd6f0('0x1c'))[_0xd6f0('0x1d')](socket);function respondWithStatusCode(_0x4ab979,_0x2b3f32){_0x2b3f32=_0x2b3f32||0xcc;return function(_0x354846){if(_0x354846){return _0x4ab979['sendStatus'](_0x2b3f32);}return _0x4ab979[_0xd6f0('0x1e')](_0x2b3f32)['end']();};}function respondWithResult(_0x3f4851,_0x154e3e){_0x154e3e=_0x154e3e||0xc8;return function(_0x41bd99){if(_0x41bd99){return _0x3f4851[_0xd6f0('0x1e')](_0x154e3e)[_0xd6f0('0x1f')](_0x41bd99);}};}function respondWithFilteredResult(_0x61defb,_0x25da0c){return function(_0x29fbb9){if(_0x29fbb9){var _0x2e71bd=_0x29fbb9[_0xd6f0('0x20')],_0x1862a9=_0x25da0c[_0xd6f0('0x21')],_0x23ab6c=_0x25da0c[_0xd6f0('0x21')]+_0x25da0c[_0xd6f0('0x22')],_0x17e7c6;if(_0x23ab6c>=_0x2e71bd){_0x23ab6c=_0x2e71bd;_0x17e7c6=0xc8;}else{_0x17e7c6=0xce;}_0x61defb['status'](_0x17e7c6);return _0x61defb['set'](_0xd6f0('0x23'),_0x1862a9+'-'+_0x23ab6c+'/'+_0x2e71bd)[_0xd6f0('0x1f')](_0x29fbb9);}return null;};}function patchUpdates(_0x1158dc){return function(_0x54300d){try{jsonpatch[_0xd6f0('0x24')](_0x54300d,_0x1158dc,!![]);}catch(_0x19a545){return BPromise['reject'](_0x19a545);}return _0x54300d[_0xd6f0('0x25')]();};}function saveUpdates(_0x515687,_0x1ee584){return function(_0x1c9d90){if(_0x1c9d90){return _0x1c9d90['update'](_0x515687)[_0xd6f0('0x26')](function(_0x45e99c){return _0x45e99c;});}return null;};}function removeEntity(_0x5ea2dd,_0x3dbdc3){return function(_0x402070){if(_0x402070){return _0x402070[_0xd6f0('0x27')]()['then'](function(){var _0x2ca8bb=_0x402070[_0xd6f0('0x28')]({'plain':!![]});var _0x5ecb16=_0xd6f0('0x29');return db['UserProfileResource'][_0xd6f0('0x27')]({'where':{'type':_0x5ecb16,'resourceId':_0x2ca8bb['id']}})[_0xd6f0('0x26')](function(){return _0x402070;});})[_0xd6f0('0x26')](function(){_0x5ea2dd[_0xd6f0('0x1e')](0xcc)[_0xd6f0('0x2a')]();});}};}function handleEntityNotFound(_0x715aab,_0x12d6ec){return function(_0x26799c){if(!_0x26799c){_0x715aab['sendStatus'](0x194);}return _0x26799c;};}function handleError(_0x1ea941,_0x1982d3){_0x1982d3=_0x1982d3||0x1f4;return function(_0x55656c){logger[_0xd6f0('0x2b')](_0x55656c[_0xd6f0('0x2c')]);if(_0x55656c[_0xd6f0('0x2d')]){delete _0x55656c[_0xd6f0('0x2d')];}_0x1ea941[_0xd6f0('0x1e')](_0x1982d3)[_0xd6f0('0x2e')](_0x55656c);};}exports[_0xd6f0('0x2f')]=function(_0x3151f8,_0x465cf9){var _0x43f72f={},_0x1dff9b={},_0x3e913a={'count':0x0,'rows':[]};var _0x348529=_[_0xd6f0('0x30')](db[_0xd6f0('0x31')][_0xd6f0('0x32')],function(_0x31c493){return{'name':_0x31c493[_0xd6f0('0x33')],'type':_0x31c493[_0xd6f0('0x34')][_0xd6f0('0x35')]};});_0x1dff9b[_0xd6f0('0x36')]=_[_0xd6f0('0x30')](_0x348529,'name');_0x1dff9b[_0xd6f0('0x37')]=_['keys'](_0x3151f8['query']);_0x1dff9b[_0xd6f0('0x38')]=_[_0xd6f0('0x39')](_0x1dff9b[_0xd6f0('0x36')],_0x1dff9b[_0xd6f0('0x37')]);_0x43f72f[_0xd6f0('0x3a')]=_['intersection'](_0x1dff9b[_0xd6f0('0x36')],qs['fields'](_0x3151f8[_0xd6f0('0x37')][_0xd6f0('0x3b')]));_0x43f72f[_0xd6f0('0x3a')]=_0x43f72f[_0xd6f0('0x3a')][_0xd6f0('0x3c')]?_0x43f72f['attributes']:_0x1dff9b['model'];if(!_0x3151f8[_0xd6f0('0x37')][_0xd6f0('0x3d')]('nolimit')){_0x43f72f[_0xd6f0('0x22')]=qs['limit'](_0x3151f8[_0xd6f0('0x37')][_0xd6f0('0x22')]);_0x43f72f[_0xd6f0('0x21')]=qs[_0xd6f0('0x21')](_0x3151f8[_0xd6f0('0x37')][_0xd6f0('0x21')]);}_0x43f72f[_0xd6f0('0x3e')]=qs['sort'](_0x3151f8['query'][_0xd6f0('0x3f')]);_0x43f72f[_0xd6f0('0x40')]=qs[_0xd6f0('0x38')](_['pick'](_0x3151f8['query'],_0x1dff9b[_0xd6f0('0x38')]));if(_0x3151f8[_0xd6f0('0x37')][_0xd6f0('0x41')]){_0x43f72f[_0xd6f0('0x40')]=_[_0xd6f0('0x42')](_0x43f72f[_0xd6f0('0x40')],{'$or':_[_0xd6f0('0x30')](_0x348529,function(_0x64359c){if(_0x64359c['type']!==_0xd6f0('0x43')){var _0x469753={};_0x469753[_0x64359c[_0xd6f0('0x2d')]]={'$like':'%'+_0x3151f8[_0xd6f0('0x37')]['filter']+'%'};return _0x469753;}})});}_0x43f72f=_[_0xd6f0('0x42')]({},_0x43f72f,_0x3151f8[_0xd6f0('0x44')]);var _0x30d1ba={'where':_0x43f72f[_0xd6f0('0x40')]};return db[_0xd6f0('0x31')]['count'](_0x30d1ba)[_0xd6f0('0x26')](function(_0x2c74dd){_0x3e913a[_0xd6f0('0x20')]=_0x2c74dd;if(_0x3151f8['query'][_0xd6f0('0x45')]){_0x43f72f[_0xd6f0('0x46')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x43f72f);})[_0xd6f0('0x26')](function(_0x46aa7d){_0x3e913a[_0xd6f0('0x47')]=_0x46aa7d;return _0x3e913a;})['then'](respondWithFilteredResult(_0x465cf9,_0x43f72f))[_0xd6f0('0x48')](handleError(_0x465cf9,null));};exports[_0xd6f0('0x49')]=function(_0x57c2b6,_0x362509){var _0x3080eb={'raw':![],'where':{'id':_0x57c2b6[_0xd6f0('0x4a')]['id']}},_0x2930c5={};_0x2930c5['model']=_[_0xd6f0('0x4b')](db[_0xd6f0('0x31')][_0xd6f0('0x32')]);_0x2930c5[_0xd6f0('0x37')]=_[_0xd6f0('0x4b')](_0x57c2b6[_0xd6f0('0x37')]);_0x2930c5[_0xd6f0('0x38')]=_[_0xd6f0('0x39')](_0x2930c5['model'],_0x2930c5[_0xd6f0('0x37')]);_0x3080eb[_0xd6f0('0x3a')]=_['intersection'](_0x2930c5[_0xd6f0('0x36')],qs[_0xd6f0('0x3b')](_0x57c2b6[_0xd6f0('0x37')][_0xd6f0('0x3b')]));_0x3080eb['attributes']=_0x3080eb[_0xd6f0('0x3a')][_0xd6f0('0x3c')]?_0x3080eb['attributes']:_0x2930c5['model'];if(_0x57c2b6[_0xd6f0('0x37')]['includeAll']){_0x3080eb[_0xd6f0('0x46')]=[{'all':!![]}];}_0x3080eb=_[_0xd6f0('0x42')]({},_0x3080eb,_0x57c2b6[_0xd6f0('0x44')]);return db['SquareProject'][_0xd6f0('0x4c')](_0x3080eb)[_0xd6f0('0x26')](handleEntityNotFound(_0x362509,null))[_0xd6f0('0x26')](respondWithResult(_0x362509,null))[_0xd6f0('0x48')](handleError(_0x362509,null));};exports[_0xd6f0('0x4d')]=function(_0x4c42ce,_0x17cbb0){return db['SquareProject'][_0xd6f0('0x4d')](_0x4c42ce[_0xd6f0('0x4e')],{})[_0xd6f0('0x26')](function(_0x1dc320){var _0x554e37=_0x4c42ce['user'][_0xd6f0('0x28')]({'plain':!![]});if(!_0x554e37)throw new Error(_0xd6f0('0x4f'));if(_0x554e37['role']===_0xd6f0('0x50')){var _0x56c448=_0x1dc320[_0xd6f0('0x28')]({'plain':!![]});var _0x3cbbbd=_0xd6f0('0x29');return db[_0xd6f0('0x51')][_0xd6f0('0x4c')]({'where':{'name':_0x3cbbbd,'userProfileId':_0x554e37['userProfileId']},'raw':!![]})[_0xd6f0('0x26')](function(_0x335383){if(_0x335383&&_0x335383[_0xd6f0('0x52')]===0x0){return db[_0xd6f0('0x53')][_0xd6f0('0x4d')]({'name':_0x56c448[_0xd6f0('0x2d')],'resourceId':_0x56c448['id'],'type':_0x335383[_0xd6f0('0x2d')],'sectionId':_0x335383['id']},{})[_0xd6f0('0x26')](function(){return _0x1dc320;});}else{return _0x1dc320;}})['catch'](function(_0x10be69){logger[_0xd6f0('0x2b')](_0xd6f0('0x54'),_0x10be69);throw _0x10be69;});}return _0x1dc320;})[_0xd6f0('0x26')](respondWithResult(_0x17cbb0,0xc9))[_0xd6f0('0x48')](handleError(_0x17cbb0,null));};exports[_0xd6f0('0x55')]=function(_0x43563d,_0x398cb4){if(_0x43563d[_0xd6f0('0x4e')]['id']){delete _0x43563d['body']['id'];}return db[_0xd6f0('0x31')]['find']({'where':{'id':_0x43563d['params']['id']}})[_0xd6f0('0x26')](handleEntityNotFound(_0x398cb4,null))['then'](saveUpdates(_0x43563d['body'],null))[_0xd6f0('0x26')](respondWithResult(_0x398cb4,null))[_0xd6f0('0x48')](handleError(_0x398cb4,null));};exports[_0xd6f0('0x27')]=function(_0x47a159,_0x1d75f1){return db[_0xd6f0('0x31')][_0xd6f0('0x4c')]({'where':{'id':_0x47a159['params']['id']}})[_0xd6f0('0x26')](handleEntityNotFound(_0x1d75f1,null))[_0xd6f0('0x26')](removeEntity(_0x1d75f1,null))['catch'](handleError(_0x1d75f1,null));};exports[_0xd6f0('0x56')]=function(_0x328e0a,_0x5573fc,_0x3558ac){return db[_0xd6f0('0x31')][_0xd6f0('0x4c')]({'where':{'id':_0x328e0a[_0xd6f0('0x4a')]['id']}})[_0xd6f0('0x26')](handleEntityNotFound(_0x5573fc,null))['then'](function(_0x291e7b){if(_0x291e7b){return _0x291e7b[_0xd6f0('0x56')](_0x328e0a['body'][_0xd6f0('0x57')],_[_0xd6f0('0x58')](_0x328e0a[_0xd6f0('0x4e')],['ids','id'])||{});}})[_0xd6f0('0x26')](respondWithResult(_0x5573fc,null))['catch'](handleError(_0x5573fc,null));};exports['removeUsers']=function(_0x4bdedd,_0x5c5aa4,_0x311140){return db[_0xd6f0('0x31')][_0xd6f0('0x4c')]({'where':{'id':_0x4bdedd[_0xd6f0('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5c5aa4,null))[_0xd6f0('0x26')](function(_0x5a6ee0){if(_0x5a6ee0){return _0x5a6ee0[_0xd6f0('0x59')](_0x4bdedd[_0xd6f0('0x37')][_0xd6f0('0x57')])['then'](function(){if(_[_0xd6f0('0x5a')](_0x4bdedd[_0xd6f0('0x37')][_0xd6f0('0x57')])){for(var _0x705eb=0x0;_0x705eb<_0x4bdedd['query'][_0xd6f0('0x57')][_0xd6f0('0x3c')];_0x705eb+=0x1){socket[_0xd6f0('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x4bdedd[_0xd6f0('0x37')][_0xd6f0('0x57')][_0x705eb]),'SquareProjectId':Number(_0x4bdedd[_0xd6f0('0x4a')]['id'])});}}else{socket[_0xd6f0('0x5b')]('userSquareProject:remove',{'UserId':Number(_0x4bdedd[_0xd6f0('0x37')][_0xd6f0('0x57')]),'SquareProjectId':Number(_0x4bdedd[_0xd6f0('0x4a')]['id'])});}});}})[_0xd6f0('0x26')](respondWithStatusCode(_0x5c5aa4,null))['catch'](handleError(_0x5c5aa4,null));};exports['getUsers']=function(_0x490bc4,_0x5ed780,_0x144a77){var _0x46a3b3={};var _0xa1ff68={};var _0x30cd81;var _0x318a64;return db[_0xd6f0('0x31')][_0xd6f0('0x5c')]({'where':{'id':_0x490bc4[_0xd6f0('0x4a')]['id']}})[_0xd6f0('0x26')](handleEntityNotFound(_0x5ed780,null))['then'](function(_0x55f96e){if(_0x55f96e){_0x30cd81=_0x55f96e;_0xa1ff68[_0xd6f0('0x36')]=_['keys'](db[_0xd6f0('0x5d')][_0xd6f0('0x32')]);_0xa1ff68[_0xd6f0('0x37')]=_[_0xd6f0('0x4b')](_0x490bc4[_0xd6f0('0x37')]);_0xa1ff68[_0xd6f0('0x38')]=_[_0xd6f0('0x39')](_0xa1ff68['model'],_0xa1ff68[_0xd6f0('0x37')]);_0x46a3b3[_0xd6f0('0x3a')]=_[_0xd6f0('0x39')](_0xa1ff68['model'],qs[_0xd6f0('0x3b')](_0x490bc4[_0xd6f0('0x37')]['fields']));_0x46a3b3[_0xd6f0('0x3a')]=_0x46a3b3[_0xd6f0('0x3a')][_0xd6f0('0x3c')]?_0x46a3b3[_0xd6f0('0x3a')]:_0xa1ff68[_0xd6f0('0x36')];_0x46a3b3[_0xd6f0('0x3e')]=qs[_0xd6f0('0x3f')](_0x490bc4[_0xd6f0('0x37')][_0xd6f0('0x3f')]);_0x46a3b3['where']=qs[_0xd6f0('0x38')](_[_0xd6f0('0x5e')](_0x490bc4[_0xd6f0('0x37')],_0xa1ff68[_0xd6f0('0x38')]));if(_0x490bc4['query'][_0xd6f0('0x41')]){_0x46a3b3[_0xd6f0('0x40')]=_[_0xd6f0('0x42')](_0x46a3b3[_0xd6f0('0x40')],{'$or':_[_0xd6f0('0x30')](_0x46a3b3[_0xd6f0('0x3a')],function(_0x907a6f){var _0x183142={};_0x183142[_0x907a6f]={'$like':'%'+_0x490bc4[_0xd6f0('0x37')][_0xd6f0('0x41')]+'%'};return _0x183142;})});}_0x46a3b3=_['merge']({},_0x46a3b3,_0x490bc4[_0xd6f0('0x44')]);return _0x30cd81[_0xd6f0('0x5f')](_0x46a3b3);}})[_0xd6f0('0x26')](function(_0x580c93){if(_0x580c93){_0x318a64=_0x580c93[_0xd6f0('0x3c')];if(!_0x490bc4[_0xd6f0('0x37')][_0xd6f0('0x3d')](_0xd6f0('0x60'))){_0x46a3b3[_0xd6f0('0x22')]=qs[_0xd6f0('0x22')](_0x490bc4[_0xd6f0('0x37')][_0xd6f0('0x22')]);_0x46a3b3[_0xd6f0('0x21')]=qs[_0xd6f0('0x21')](_0x490bc4[_0xd6f0('0x37')]['offset']);}return _0x30cd81['getUsers'](_0x46a3b3);}})[_0xd6f0('0x26')](function(_0x3192a5){if(_0x3192a5){return _0x3192a5?{'count':_0x318a64,'rows':_0x3192a5}:null;}})[_0xd6f0('0x26')](respondWithResult(_0x5ed780,null))[_0xd6f0('0x48')](handleError(_0x5ed780,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 26b8d43..9b46d91 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 _0x3c70=['SquareProject','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x177f7f,_0x5c714a){var _0x3fe9c9=function(_0x5809df){while(--_0x5809df){_0x177f7f['push'](_0x177f7f['shift']());}};_0x3fe9c9(++_0x5c714a);}(_0x3c70,0x10c));var _0x03c7=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0x3c70[_0x298ed3];return _0x5aad28;};'use strict';var EventEmitter=require(_0x03c7('0x0'));var SquareProject=require(_0x03c7('0x1'))['db'][_0x03c7('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x03c7('0x3'),'afterUpdate':_0x03c7('0x4'),'afterDestroy':_0x03c7('0x5')};function emitEvent(_0x37a9ea){return function(_0x38a36b,_0x2464f2,_0x55a9d5){SquareProjectEvents[_0x03c7('0x6')](_0x37a9ea+':'+_0x38a36b['id'],_0x38a36b);SquareProjectEvents['emit'](_0x37a9ea,_0x38a36b);_0x55a9d5(null);};}for(var e in events){if(events[_0x03c7('0x7')](e)){var event=events[e];SquareProject[_0x03c7('0x8')](e,emitEvent(event));}}module[_0x03c7('0x9')]=SquareProjectEvents; \ No newline at end of file +var _0xac31=['emit','hasOwnProperty','hook','exports','events','../../mysqldb','SquareProject','setMaxListeners','save','update','remove'];(function(_0x3511d3,_0x4107ae){var _0x5d6321=function(_0x1a23da){while(--_0x1a23da){_0x3511d3['push'](_0x3511d3['shift']());}};_0x5d6321(++_0x4107ae);}(_0xac31,0xca));var _0x1ac3=function(_0x45093d,_0x54ce7d){_0x45093d=_0x45093d-0x0;var _0x4948c0=_0xac31[_0x45093d];return _0x4948c0;};'use strict';var EventEmitter=require(_0x1ac3('0x0'));var SquareProject=require(_0x1ac3('0x1'))['db'][_0x1ac3('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0x1ac3('0x3')](0x0);var events={'afterCreate':_0x1ac3('0x4'),'afterUpdate':_0x1ac3('0x5'),'afterDestroy':_0x1ac3('0x6')};function emitEvent(_0x59b42c){return function(_0x33b5ab,_0x434b5e,_0x4dcc96){SquareProjectEvents['emit'](_0x59b42c+':'+_0x33b5ab['id'],_0x33b5ab);SquareProjectEvents[_0x1ac3('0x7')](_0x59b42c,_0x33b5ab);_0x4dcc96(null);};}for(var e in events){if(events[_0x1ac3('0x8')](e)){var event=events[e];SquareProject[_0x1ac3('0x9')](e,emitEvent(event));}}module[_0x1ac3('0xa')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index 2f548d4..cc73b23 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 _0xe4fd=['util','api','moment','bluebird','request-promise','path','./squareProject.attributes','exports','define','SquareProject','square_projects','lodash'];(function(_0x4ff277,_0x854d45){var _0x1039c3=function(_0xc866d){while(--_0xc866d){_0x4ff277['push'](_0x4ff277['shift']());}};_0x1039c3(++_0x854d45);}(_0xe4fd,0x11f));var _0xde4f=function(_0x144e38,_0x658ee6){_0x144e38=_0x144e38-0x0;var _0xc9255b=_0xe4fd[_0x144e38];return _0xc9255b;};'use strict';var _=require(_0xde4f('0x0'));var util=require(_0xde4f('0x1'));var logger=require('../../config/logger')(_0xde4f('0x2'));var moment=require(_0xde4f('0x3'));var BPromise=require(_0xde4f('0x4'));var rp=require(_0xde4f('0x5'));var fs=require('fs');var path=require(_0xde4f('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xde4f('0x7'));module[_0xde4f('0x8')]=function(_0x512f6a,_0x57b06e){return _0x512f6a[_0xde4f('0x9')](_0xde4f('0xa'),attributes,{'tableName':_0xde4f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9390=['rimraf','define','SquareProject','square_projects','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x595e1f,_0x3c3c87){var _0x396b4d=function(_0x15f157){while(--_0x15f157){_0x595e1f['push'](_0x595e1f['shift']());}};_0x396b4d(++_0x3c3c87);}(_0x9390,0x1a8));var _0x0939=function(_0x31c091,_0x15222e){_0x31c091=_0x31c091-0x0;var _0x28adb1=_0x9390[_0x31c091];return _0x28adb1;};'use strict';var _=require(_0x0939('0x0'));var util=require(_0x0939('0x1'));var logger=require(_0x0939('0x2'))(_0x0939('0x3'));var moment=require(_0x0939('0x4'));var BPromise=require('bluebird');var rp=require(_0x0939('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0939('0x6'));var config=require('../../config/environment');var attributes=require('./squareProject.attributes');module['exports']=function(_0x2f4746,_0x4cd50d){return _0x2f4746[_0x0939('0x7')](_0x0939('0x8'),attributes,{'tableName':_0x0939('0x9'),'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 d8e15ab..c75845b 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 _0x85ff=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./squareProject.socket','register','then','info','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','message','SquareProject,\x20%s,\x20%s','result','catch','ShowSquareProject','options','attributes','include','map','model','lodash','util','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x2c6e9f,_0x1312f2){var _0x36745b=function(_0x196c25){while(--_0x196c25){_0x2c6e9f['push'](_0x2c6e9f['shift']());}};_0x36745b(++_0x1312f2);}(_0x85ff,0x165));var _0xf85f=function(_0x1694f5,_0x49b7c3){_0x1694f5=_0x1694f5-0x0;var _0x5b4321=_0x85ff[_0x1694f5];return _0x5b4321;};'use strict';var _=require(_0xf85f('0x0'));var util=require(_0xf85f('0x1'));var moment=require('moment');var BPromise=require(_0xf85f('0x2'));var rs=require(_0xf85f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf85f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xf85f('0x5'))(_0xf85f('0x6'));var config=require(_0xf85f('0x7'));var jayson=require(_0xf85f('0x8'));var client=jayson[_0xf85f('0x9')][_0xf85f('0xa')]({'port':0x232a});config[_0xf85f('0xb')]=_['defaults'](config[_0xf85f('0xb')],{'host':_0xf85f('0xc'),'port':0x18eb});var socket=require(_0xf85f('0xd'))(new Redis(config[_0xf85f('0xb')]));require(_0xf85f('0xe'))[_0xf85f('0xf')](socket);function respondWithRpcPromise(_0x173e5e,_0x1b3a3d,_0x461266){return new BPromise(function(_0x337d5c,_0xc923db){return client['request'](_0x173e5e,_0x461266)[_0xf85f('0x10')](function(_0x4ecba5){logger[_0xf85f('0x11')]('SquareProject,\x20%s,\x20%s',_0x1b3a3d,_0xf85f('0x12'));logger[_0xf85f('0x13')](_0xf85f('0x14'),_0x1b3a3d,_0xf85f('0x12'),JSON[_0xf85f('0x15')](_0x4ecba5));if(_0x4ecba5[_0xf85f('0x16')]){if(_0x4ecba5[_0xf85f('0x16')]['code']===0x1f4){logger[_0xf85f('0x16')]('SquareProject,\x20%s,\x20%s',_0x1b3a3d,_0x4ecba5[_0xf85f('0x16')][_0xf85f('0x17')]);return _0xc923db(_0x4ecba5[_0xf85f('0x16')]['message']);}logger[_0xf85f('0x16')](_0xf85f('0x18'),_0x1b3a3d,_0x4ecba5[_0xf85f('0x16')][_0xf85f('0x17')]);return _0x337d5c(_0x4ecba5[_0xf85f('0x16')][_0xf85f('0x17')]);}else{logger[_0xf85f('0x11')](_0xf85f('0x18'),_0x1b3a3d,_0xf85f('0x12'));_0x337d5c(_0x4ecba5[_0xf85f('0x19')]['message']);}})[_0xf85f('0x1a')](function(_0x368ef7){logger[_0xf85f('0x16')](_0xf85f('0x18'),_0x1b3a3d,_0x368ef7);_0xc923db(_0x368ef7);});});}exports[_0xf85f('0x1b')]=function(_0x477491){var _0x27c678=this;return new Promise(function(_0x5242f5,_0x1a810b){return db['SquareProject']['find']({'raw':_0x477491['options']?_0x477491[_0xf85f('0x1c')]['raw']===undefined?!![]:![]:!![],'where':_0x477491[_0xf85f('0x1c')]?_0x477491[_0xf85f('0x1c')]['where']||null:null,'attributes':_0x477491[_0xf85f('0x1c')]?_0x477491[_0xf85f('0x1c')][_0xf85f('0x1d')]||null:null,'include':_0x477491['options']?_0x477491['options'][_0xf85f('0x1e')]?_[_0xf85f('0x1f')](_0x477491[_0xf85f('0x1c')][_0xf85f('0x1e')],function(_0x5bd8de){return{'model':db[_0x5bd8de[_0xf85f('0x20')]],'as':_0x5bd8de['as'],'attributes':_0x5bd8de['attributes'],'include':_0x5bd8de[_0xf85f('0x1e')]?_[_0xf85f('0x1f')](_0x5bd8de[_0xf85f('0x1e')],function(_0x29de34){return{'model':db[_0x29de34['model']],'as':_0x29de34['as'],'attributes':_0x29de34[_0xf85f('0x1d')],'include':_0x29de34[_0xf85f('0x1e')]?_[_0xf85f('0x1f')](_0x29de34[_0xf85f('0x1e')],function(_0x44f8e8){return{'model':db[_0x44f8e8[_0xf85f('0x20')]],'as':_0x44f8e8['as'],'attributes':_0x44f8e8[_0xf85f('0x1d')]};}):[]};}):[]};}):[]:[]})[_0xf85f('0x10')](function(_0x22f837){logger[_0xf85f('0x11')](_0xf85f('0x1b'),_0x477491);logger[_0xf85f('0x13')](_0xf85f('0x1b'),_0x477491,JSON['stringify'](_0x22f837));_0x5242f5(_0x22f837);})['catch'](function(_0x4e7616){logger[_0xf85f('0x16')](_0xf85f('0x1b'),_0x4e7616[_0xf85f('0x17')],_0x477491);_0x1a810b(_0x27c678[_0xf85f('0x16')](0x1f4,_0x4e7616['message']));});});}; \ No newline at end of file +var _0xceec=['./squareProject.socket','register','request','then','SquareProject,\x20%s,\x20%s','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','SquareProject','find','options','raw','where','include','map','attributes','model','info','ShowSquareProject','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x12c081,_0x42d50d){var _0x18ef23=function(_0x31ff76){while(--_0x31ff76){_0x12c081['push'](_0x12c081['shift']());}};_0x18ef23(++_0x42d50d);}(_0xceec,0xdb));var _0xccee=function(_0x588a33,_0x40c123){_0x588a33=_0x588a33-0x0;var _0x564028=_0xceec[_0x588a33];return _0x564028;};'use strict';var _=require(_0xccee('0x0'));var util=require(_0xccee('0x1'));var moment=require(_0xccee('0x2'));var BPromise=require(_0xccee('0x3'));var rs=require(_0xccee('0x4'));var fs=require('fs');var Redis=require(_0xccee('0x5'));var db=require(_0xccee('0x6'))['db'];var utils=require(_0xccee('0x7'));var logger=require(_0xccee('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0xccee('0x9'));var client=jayson[_0xccee('0xa')]['http']({'port':0x232a});config[_0xccee('0xb')]=_[_0xccee('0xc')](config[_0xccee('0xb')],{'host':_0xccee('0xd'),'port':0x18eb});var socket=require(_0xccee('0xe'))(new Redis(config[_0xccee('0xb')]));require(_0xccee('0xf'))[_0xccee('0x10')](socket);function respondWithRpcPromise(_0x391f7d,_0x548efb,_0x4d5a8f){return new BPromise(function(_0xade669,_0x1d36c6){return client[_0xccee('0x11')](_0x391f7d,_0x4d5a8f)[_0xccee('0x12')](function(_0x10dd3d){logger['info'](_0xccee('0x13'),_0x548efb,_0xccee('0x14'));logger[_0xccee('0x15')](_0xccee('0x16'),_0x548efb,'request\x20sent',JSON[_0xccee('0x17')](_0x10dd3d));if(_0x10dd3d[_0xccee('0x18')]){if(_0x10dd3d[_0xccee('0x18')][_0xccee('0x19')]===0x1f4){logger[_0xccee('0x18')](_0xccee('0x13'),_0x548efb,_0x10dd3d[_0xccee('0x18')]['message']);return _0x1d36c6(_0x10dd3d[_0xccee('0x18')][_0xccee('0x1a')]);}logger[_0xccee('0x18')](_0xccee('0x13'),_0x548efb,_0x10dd3d['error']['message']);return _0xade669(_0x10dd3d['error']['message']);}else{logger['info'](_0xccee('0x13'),_0x548efb,_0xccee('0x14'));_0xade669(_0x10dd3d['result']['message']);}})[_0xccee('0x1b')](function(_0x220a82){logger[_0xccee('0x18')]('SquareProject,\x20%s,\x20%s',_0x548efb,_0x220a82);_0x1d36c6(_0x220a82);});});}exports['ShowSquareProject']=function(_0x404022){var _0x159740=this;return new Promise(function(_0x1c32c6,_0x210884){return db[_0xccee('0x1c')][_0xccee('0x1d')]({'raw':_0x404022[_0xccee('0x1e')]?_0x404022['options'][_0xccee('0x1f')]===undefined?!![]:![]:!![],'where':_0x404022['options']?_0x404022[_0xccee('0x1e')][_0xccee('0x20')]||null:null,'attributes':_0x404022[_0xccee('0x1e')]?_0x404022[_0xccee('0x1e')]['attributes']||null:null,'include':_0x404022[_0xccee('0x1e')]?_0x404022[_0xccee('0x1e')][_0xccee('0x21')]?_[_0xccee('0x22')](_0x404022[_0xccee('0x1e')][_0xccee('0x21')],function(_0x70a02f){return{'model':db[_0x70a02f['model']],'as':_0x70a02f['as'],'attributes':_0x70a02f[_0xccee('0x23')],'include':_0x70a02f['include']?_['map'](_0x70a02f['include'],function(_0x951f4b){return{'model':db[_0x951f4b[_0xccee('0x24')]],'as':_0x951f4b['as'],'attributes':_0x951f4b['attributes'],'include':_0x951f4b[_0xccee('0x21')]?_[_0xccee('0x22')](_0x951f4b[_0xccee('0x21')],function(_0x3c987d){return{'model':db[_0x3c987d['model']],'as':_0x3c987d['as'],'attributes':_0x3c987d['attributes']};}):[]};}):[]};}):[]:[]})[_0xccee('0x12')](function(_0x269ec3){logger[_0xccee('0x25')]('ShowSquareProject',_0x404022);logger['debug'](_0xccee('0x26'),_0x404022,JSON['stringify'](_0x269ec3));_0x1c32c6(_0x269ec3);})['catch'](function(_0x5a02ff){logger[_0xccee('0x18')]('ShowSquareProject',_0x5a02ff[_0xccee('0x1a')],_0x404022);_0x210884(_0x159740[_0xccee('0x18')](0x1f4,_0x5a02ff[_0xccee('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 66a49ab..a5be151 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 _0xadb5=['update','emit','register','length','squareProject:','save'];(function(_0x5d1171,_0x3b8818){var _0xd08628=function(_0x453e34){while(--_0x453e34){_0x5d1171['push'](_0x5d1171['shift']());}};_0xd08628(++_0x3b8818);}(_0xadb5,0xad));var _0x5adb=function(_0x57f865,_0x4da8ac){_0x57f865=_0x57f865-0x0;var _0x3c04d6=_0xadb5[_0x57f865];return _0x3c04d6;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){SquareProjectEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);SquareProjectEvents['on'](_0x353885,_0x47228a);}}; \ No newline at end of file +var _0x7a54=['remove','emit','removeListener','register','length','squareProject:','./squareProject.events','save'];(function(_0x44b058,_0x35070f){var _0x83f575=function(_0x2f656d){while(--_0x2f656d){_0x44b058['push'](_0x44b058['shift']());}};_0x83f575(++_0x35070f);}(_0x7a54,0x106));var _0x47a5=function(_0x1175b1,_0x48dbe9){_0x1175b1=_0x1175b1-0x0;var _0x493262=_0x7a54[_0x1175b1];return _0x493262;};'use strict';var SquareProjectEvents=require(_0x47a5('0x0'));var events=[_0x47a5('0x1'),_0x47a5('0x2'),'update'];function createListener(_0x1d33e,_0x4086cd){return function(_0x4880bf){_0x4086cd[_0x47a5('0x3')](_0x1d33e,_0x4880bf);};}function removeListener(_0x11bf85,_0x2a1a7e){return function(){SquareProjectEvents[_0x47a5('0x4')](_0x11bf85,_0x2a1a7e);};}exports[_0x47a5('0x5')]=function(_0x545a97){for(var _0x3d5629=0x0,_0x59199c=events[_0x47a5('0x6')];_0x3d5629<_0x59199c;_0x3d5629++){var _0x30e405=events[_0x3d5629];var _0x506eda=createListener(_0x47a5('0x7')+_0x30e405,_0x545a97);SquareProjectEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index c7b4d0d..2452c53 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 _0xc8bc=['../../components/interaction/service','./squareRecording.controller','get','isAuthenticated','show','/:id/download','download','put','/:id','update','delete','/:id/delete','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x53ed5e,_0x57d4fd){var _0x54d15a=function(_0x34ff61){while(--_0x34ff61){_0x53ed5e['push'](_0x53ed5e['shift']());}};_0x54d15a(++_0x57d4fd);}(_0xc8bc,0x19c));var _0xcc8b=function(_0x277af0,_0x1f0361){_0x277af0=_0x277af0-0x0;var _0x43bd7c=_0xc8bc[_0x277af0];return _0x43bd7c;};'use strict';var multer=require(_0xcc8b('0x0'));var util=require('util');var path=require(_0xcc8b('0x1'));var timeout=require(_0xcc8b('0x2'));var express=require(_0xcc8b('0x3'));var router=express[_0xcc8b('0x4')]();var auth=require(_0xcc8b('0x5'));var interaction=require(_0xcc8b('0x6'));var config=require('../../config/environment');var controller=require(_0xcc8b('0x7'));router[_0xcc8b('0x8')]('/',auth[_0xcc8b('0x9')](),controller['index']);router['get']('/:id',auth[_0xcc8b('0x9')](),controller[_0xcc8b('0xa')]);router[_0xcc8b('0x8')](_0xcc8b('0xb'),auth['isAuthenticated'](),controller[_0xcc8b('0xc')]);router['post']('/',auth[_0xcc8b('0x9')](),controller['create']);router[_0xcc8b('0xd')](_0xcc8b('0xe'),auth[_0xcc8b('0x9')](),controller[_0xcc8b('0xf')]);router[_0xcc8b('0x10')](_0xcc8b('0x11'),auth[_0xcc8b('0x9')](),controller[_0xcc8b('0x12')]);module['exports']=router; \ No newline at end of file +var _0x1360=['destroy','multer','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./squareRecording.controller','isAuthenticated','index','get','download','post','create','/:id','update','delete','/:id/delete'];(function(_0x5608a3,_0x5b33c5){var _0x1ed50a=function(_0x959171){while(--_0x959171){_0x5608a3['push'](_0x5608a3['shift']());}};_0x1ed50a(++_0x5b33c5);}(_0x1360,0xa3));var _0x0136=function(_0x310c0a,_0x4ec103){_0x310c0a=_0x310c0a-0x0;var _0x599109=_0x1360[_0x310c0a];return _0x599109;};'use strict';var multer=require(_0x0136('0x0'));var util=require('util');var path=require(_0x0136('0x1'));var timeout=require(_0x0136('0x2'));var express=require('express');var router=express[_0x0136('0x3')]();var auth=require(_0x0136('0x4'));var interaction=require(_0x0136('0x5'));var config=require('../../config/environment');var controller=require(_0x0136('0x6'));router['get']('/',auth[_0x0136('0x7')](),controller[_0x0136('0x8')]);router['get']('/:id',auth[_0x0136('0x7')](),controller['show']);router[_0x0136('0x9')]('/:id/download',auth[_0x0136('0x7')](),controller[_0x0136('0xa')]);router[_0x0136('0xb')]('/',auth[_0x0136('0x7')](),controller[_0x0136('0xc')]);router['put'](_0x0136('0xd'),auth[_0x0136('0x7')](),controller[_0x0136('0xe')]);router[_0x0136('0xf')](_0x0136('0x10'),auth['isAuthenticated'](),controller[_0x0136('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 93c8e43..e7a76b7 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 _0xf1c3=['VIRTUAL','getDataValue','savePath','lastIndexOf','sequelize','STRING'];(function(_0x123a53,_0x17f5fe){var _0x4dbed3=function(_0x10ec60){while(--_0x10ec60){_0x123a53['push'](_0x123a53['shift']());}};_0x4dbed3(++_0x17f5fe);}(_0xf1c3,0x1d8));var _0x3f1c=function(_0x1af5b2,_0x1b82fe){_0x1af5b2=_0x1af5b2-0x0;var _0xf1aa2d=_0xf1c3[_0x1af5b2];return _0xf1aa2d;};'use strict';var Sequelize=require(_0x3f1c('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x3f1c('0x1')]},'callerid':{'type':Sequelize[_0x3f1c('0x1')]},'calleridname':{'type':Sequelize[_0x3f1c('0x1')]},'context':{'type':Sequelize[_0x3f1c('0x1')]},'extension':{'type':Sequelize[_0x3f1c('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x3f1c('0x1')]},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize['STRING']},'saveName':{'type':Sequelize[_0x3f1c('0x1')]},'filename':{'type':Sequelize[_0x3f1c('0x1')]},'savePath':{'type':Sequelize['STRING']},'format':{'type':Sequelize[_0x3f1c('0x2')],'get':function(){var _0x5d0d4b='';var _0x2509aa=this[_0x3f1c('0x3')](_0x3f1c('0x4'));if(_0x2509aa){_0x5d0d4b=_0x2509aa['substring'](_0x2509aa[_0x3f1c('0x5')]('.'));}return _0x5d0d4b;}}}; \ No newline at end of file +var _0x2bd4=['exports','STRING','savePath','lastIndexOf','sequelize'];(function(_0x97debf,_0x4d2400){var _0x504695=function(_0x1cc777){while(--_0x1cc777){_0x97debf['push'](_0x97debf['shift']());}};_0x504695(++_0x4d2400);}(_0x2bd4,0x103));var _0x42bd=function(_0x1b5bc3,_0x29b1fb){_0x1b5bc3=_0x1b5bc3-0x0;var _0x20e5e3=_0x2bd4[_0x1b5bc3];return _0x20e5e3;};'use strict';var Sequelize=require(_0x42bd('0x0'));module[_0x42bd('0x1')]={'uniqueid':{'type':Sequelize[_0x42bd('0x2')]},'callerid':{'type':Sequelize[_0x42bd('0x2')]},'calleridname':{'type':Sequelize[_0x42bd('0x2')]},'context':{'type':Sequelize[_0x42bd('0x2')]},'extension':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x42bd('0x2')]},'accountcode':{'type':Sequelize[_0x42bd('0x2')]},'dnid':{'type':Sequelize[_0x42bd('0x2')]},'projectName':{'type':Sequelize[_0x42bd('0x2')]},'saveName':{'type':Sequelize[_0x42bd('0x2')]},'filename':{'type':Sequelize[_0x42bd('0x2')]},'savePath':{'type':Sequelize[_0x42bd('0x2')]},'format':{'type':Sequelize['VIRTUAL'],'get':function(){var _0x2581b2='';var _0x8ed034=this['getDataValue'](_0x42bd('0x3'));if(_0x8ed034){_0x2581b2=_0x8ed034['substring'](_0x8ed034[_0x42bd('0x4')]('.'));}return _0x2581b2;}}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 9b1723d..1a973cd 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 _0x6deb=['findAll','rows','keys','includeAll','find','create','body','catch','params','uniqueid','savePath','filename','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','SquareRecording\x20not\x20found','download','extname','unlink','send','Entity\x20not\x20found','info','File:\x20\x22','unlinkSync','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','status','end','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','name','index','map','SquareRecording','rawAttributes','type','key','query','model','intersection','fields','length','attributes','hasOwnProperty','nolimit','sort','where','filters','filter','merge','VIRTUAL','count','include'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x6deb,0x1d7));var _0xb6de=function(_0x1e1c79,_0xd757c6){_0x1e1c79=_0x1e1c79-0x0;var _0x15bde8=_0x6deb[_0x1e1c79];return _0x15bde8;};'use strict';var pdf=require(_0xb6de('0x0'));var emlformat=require(_0xb6de('0x1'));var rimraf=require(_0xb6de('0x2'));var zipdir=require(_0xb6de('0x3'));var jsonpatch=require(_0xb6de('0x4'));var rp=require(_0xb6de('0x5'));var moment=require(_0xb6de('0x6'));var BPromise=require(_0xb6de('0x7'));var Mustache=require(_0xb6de('0x8'));var util=require('util');var path=require(_0xb6de('0x9'));var sox=require('sox');var csv=require(_0xb6de('0xa'));var ejs=require(_0xb6de('0xb'));var fs=require('fs');var _=require(_0xb6de('0xc'));var squel=require(_0xb6de('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb6de('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xb6de('0xf'));var Redis=require(_0xb6de('0x10'));var authService=require(_0xb6de('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb6de('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb6de('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x224a87,_0x13c012){_0x13c012=_0x13c012||0xcc;return function(_0x41f312){if(_0x41f312){return _0x224a87['sendStatus'](_0x13c012);}return _0x224a87[_0xb6de('0x14')](_0x13c012)[_0xb6de('0x15')]();};}function respondWithResult(_0x325b30,_0x5a3206){_0x5a3206=_0x5a3206||0xc8;return function(_0x46e642){if(_0x46e642){return _0x325b30['status'](_0x5a3206)[_0xb6de('0x16')](_0x46e642);}};}function respondWithFilteredResult(_0x1489fe,_0x6ff108){return function(_0x325d51){if(_0x325d51){var _0x53a046=_0x325d51['count'],_0x382d86=_0x6ff108['offset'],_0x444381=_0x6ff108[_0xb6de('0x17')]+_0x6ff108[_0xb6de('0x18')],_0x18a33;if(_0x444381>=_0x53a046){_0x444381=_0x53a046;_0x18a33=0xc8;}else{_0x18a33=0xce;}_0x1489fe[_0xb6de('0x14')](_0x18a33);return _0x1489fe[_0xb6de('0x19')](_0xb6de('0x1a'),_0x382d86+'-'+_0x444381+'/'+_0x53a046)['json'](_0x325d51);}return null;};}function patchUpdates(_0x49a2a8){return function(_0x8dcd77){try{jsonpatch[_0xb6de('0x1b')](_0x8dcd77,_0x49a2a8,!![]);}catch(_0x59be59){return BPromise[_0xb6de('0x1c')](_0x59be59);}return _0x8dcd77['save']();};}function saveUpdates(_0x356c23,_0x5265fd){return function(_0x49bcb1){if(_0x49bcb1){return _0x49bcb1[_0xb6de('0x1d')](_0x356c23)[_0xb6de('0x1e')](function(_0xd28fcd){return _0xd28fcd;});}return null;};}function removeEntity(_0x1c8558,_0x305051){return function(_0x261840){if(_0x261840){return _0x261840[_0xb6de('0x1f')]()['then'](function(){_0x1c8558['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xb03ae2,_0x14923a){return function(_0x290396){if(!_0x290396){_0xb03ae2[_0xb6de('0x20')](0x194);}return _0x290396;};}function handleError(_0x29c069,_0x59efbe){_0x59efbe=_0x59efbe||0x1f4;return function(_0x223f5b){logger[_0xb6de('0x21')](_0x223f5b['stack']);if(_0x223f5b[_0xb6de('0x22')]){delete _0x223f5b[_0xb6de('0x22')];}_0x29c069[_0xb6de('0x14')](_0x59efbe)['send'](_0x223f5b);};}exports[_0xb6de('0x23')]=function(_0x92a049,_0x255c1c){var _0x1ebcda={},_0x43719e={},_0x346520={'count':0x0,'rows':[]};var _0x5a0345=_[_0xb6de('0x24')](db[_0xb6de('0x25')][_0xb6de('0x26')],function(_0x3b10d5){return{'name':_0x3b10d5['fieldName'],'type':_0x3b10d5[_0xb6de('0x27')][_0xb6de('0x28')]};});_0x43719e['model']=_[_0xb6de('0x24')](_0x5a0345,_0xb6de('0x22'));_0x43719e[_0xb6de('0x29')]=_['keys'](_0x92a049[_0xb6de('0x29')]);_0x43719e['filters']=_['intersection'](_0x43719e[_0xb6de('0x2a')],_0x43719e[_0xb6de('0x29')]);_0x1ebcda['attributes']=_[_0xb6de('0x2b')](_0x43719e[_0xb6de('0x2a')],qs[_0xb6de('0x2c')](_0x92a049[_0xb6de('0x29')][_0xb6de('0x2c')]));_0x1ebcda['attributes']=_0x1ebcda['attributes'][_0xb6de('0x2d')]?_0x1ebcda[_0xb6de('0x2e')]:_0x43719e[_0xb6de('0x2a')];if(!_0x92a049['query'][_0xb6de('0x2f')](_0xb6de('0x30'))){_0x1ebcda[_0xb6de('0x18')]=qs[_0xb6de('0x18')](_0x92a049[_0xb6de('0x29')][_0xb6de('0x18')]);_0x1ebcda[_0xb6de('0x17')]=qs[_0xb6de('0x17')](_0x92a049[_0xb6de('0x29')][_0xb6de('0x17')]);}_0x1ebcda['order']=qs[_0xb6de('0x31')](_0x92a049['query'][_0xb6de('0x31')]);_0x1ebcda[_0xb6de('0x32')]=qs[_0xb6de('0x33')](_['pick'](_0x92a049['query'],_0x43719e[_0xb6de('0x33')]));if(_0x92a049[_0xb6de('0x29')][_0xb6de('0x34')]){_0x1ebcda[_0xb6de('0x32')]=_[_0xb6de('0x35')](_0x1ebcda['where'],{'$or':_[_0xb6de('0x24')](_0x5a0345,function(_0xa16b93){if(_0xa16b93[_0xb6de('0x27')]!==_0xb6de('0x36')){var _0x459095={};_0x459095[_0xa16b93['name']]={'$like':'%'+_0x92a049[_0xb6de('0x29')][_0xb6de('0x34')]+'%'};return _0x459095;}})});}_0x1ebcda=_[_0xb6de('0x35')]({},_0x1ebcda,_0x92a049['options']);var _0x2663ba={'where':_0x1ebcda['where']};return db[_0xb6de('0x25')][_0xb6de('0x37')](_0x2663ba)[_0xb6de('0x1e')](function(_0x351a1c){_0x346520[_0xb6de('0x37')]=_0x351a1c;if(_0x92a049['query']['includeAll']){_0x1ebcda[_0xb6de('0x38')]=[{'all':!![]}];}return db[_0xb6de('0x25')][_0xb6de('0x39')](_0x1ebcda);})['then'](function(_0x379df7){_0x346520[_0xb6de('0x3a')]=_0x379df7;return _0x346520;})[_0xb6de('0x1e')](respondWithFilteredResult(_0x255c1c,_0x1ebcda))['catch'](handleError(_0x255c1c,null));};exports['show']=function(_0x513c02,_0x429afb){var _0x1be14e={'raw':!![],'where':{'id':_0x513c02['params']['id']}},_0x3cd5aa={};_0x3cd5aa[_0xb6de('0x2a')]=_['keys'](db['SquareRecording'][_0xb6de('0x26')]);_0x3cd5aa[_0xb6de('0x29')]=_[_0xb6de('0x3b')](_0x513c02[_0xb6de('0x29')]);_0x3cd5aa[_0xb6de('0x33')]=_['intersection'](_0x3cd5aa[_0xb6de('0x2a')],_0x3cd5aa[_0xb6de('0x29')]);_0x1be14e['attributes']=_[_0xb6de('0x2b')](_0x3cd5aa[_0xb6de('0x2a')],qs['fields'](_0x513c02['query'][_0xb6de('0x2c')]));_0x1be14e[_0xb6de('0x2e')]=_0x1be14e[_0xb6de('0x2e')]['length']?_0x1be14e[_0xb6de('0x2e')]:_0x3cd5aa[_0xb6de('0x2a')];if(_0x513c02[_0xb6de('0x29')][_0xb6de('0x3c')]){_0x1be14e['include']=[{'all':!![]}];}_0x1be14e=_[_0xb6de('0x35')]({},_0x1be14e,_0x513c02['options']);return db[_0xb6de('0x25')][_0xb6de('0x3d')](_0x1be14e)[_0xb6de('0x1e')](handleEntityNotFound(_0x429afb,null))[_0xb6de('0x1e')](respondWithResult(_0x429afb,null))['catch'](handleError(_0x429afb,null));};exports[_0xb6de('0x3e')]=function(_0xeed941,_0x1488ec){return db[_0xb6de('0x25')]['create'](_0xeed941[_0xb6de('0x3f')],{})[_0xb6de('0x1e')](respondWithResult(_0x1488ec,0xc9))[_0xb6de('0x40')](handleError(_0x1488ec,null));};exports[_0xb6de('0x1d')]=function(_0x52ddd7,_0x4bffd3){if(_0x52ddd7[_0xb6de('0x3f')]['id']){delete _0x52ddd7['body']['id'];}return db[_0xb6de('0x25')][_0xb6de('0x3d')]({'where':{'id':_0x52ddd7[_0xb6de('0x41')]['id']}})['then'](handleEntityNotFound(_0x4bffd3,null))[_0xb6de('0x1e')](saveUpdates(_0x52ddd7[_0xb6de('0x3f')],null))['then'](respondWithResult(_0x4bffd3,null))[_0xb6de('0x40')](handleError(_0x4bffd3,null));};exports['download']=function(_0x270c03,_0x5198a9,_0x5e46e3){var _0x32a667=require('../../components/encryptor');var _0x1f9e9e=![];var _0xf4c2d5={};if(_0x270c03[_0xb6de('0x29')]['type']&&_0x270c03[_0xb6de('0x29')]['type']===_0xb6de('0x42')){_0xf4c2d5[_0xb6de('0x42')]=_0x270c03[_0xb6de('0x41')]['id'];}else{_0xf4c2d5['id']=_0x270c03[_0xb6de('0x41')]['id'];}return db[_0xb6de('0x25')][_0xb6de('0x3d')]({'where':_0xf4c2d5,'attributes':['id',_0xb6de('0x43'),_0xb6de('0x44')],'raw':!![]})[_0xb6de('0x1e')](handleEntityNotFound(_0x5198a9,null))[_0xb6de('0x1e')](function(_0x2c5706){if(_0x2c5706){var _0x584b74=_0x2c5706['savePath'];var _0x3b1a30=util[_0xb6de('0x45')](_0xb6de('0x46'),_0x584b74);if(fs[_0xb6de('0x47')](_0x3b1a30)){_0x1f9e9e=!![];return _0x32a667[_0xb6de('0x48')](_0x3b1a30,_0x584b74,config[_0xb6de('0x49')][_0xb6de('0x4a')])[_0xb6de('0x1e')](function(){return _0x2c5706;});}return _0x2c5706;}})['then'](function(_0x480af6){if(_0x480af6){var _0x174bd9=_0x480af6[_0xb6de('0x43')];if(!fs[_0xb6de('0x47')](_0x174bd9)){throw new db[(_0xb6de('0x4b'))][(_0xb6de('0x4c'))](_0xb6de('0x4d'));}if(_0x480af6[_0xb6de('0x44')]){return _0x5198a9[_0xb6de('0x4e')](_0x174bd9,_0x480af6[_0xb6de('0x44')]+path[_0xb6de('0x4f')](_0x174bd9),function(){if(_0x1f9e9e){fs[_0xb6de('0x50')](_0x174bd9);}});}else{return _0x5198a9['download'](_0x174bd9,function(_0x6595f1){if(_0x1f9e9e){fs['unlink'](_0x174bd9);}});}}})[_0xb6de('0x40')](function(_0x575373){if(_0x575373['message']===_0xb6de('0x4d')){_0x5198a9[_0xb6de('0x14')](0x194)[_0xb6de('0x51')]('Not\x20found');}else{return handleError(_0x5198a9,null);}});};exports[_0xb6de('0x1f')]=function(_0x2b1d8c,_0x2b8d07){return db['SquareRecording'][_0xb6de('0x3d')]({'where':{'id':_0x2b1d8c['params']['id']}})[_0xb6de('0x1e')](function(_0x521bd3){if(!_0x521bd3)throw new ReferenceError(_0xb6de('0x52'));return _0x521bd3;})[_0xb6de('0x1e')](function(_0x1e2357){var _0x60980a=_0x1e2357[_0xb6de('0x43')];logger[_0xb6de('0x53')]('cancellazione\x20fisica\x20documento\x20%s',_0x60980a);if(!_['isNil'](_0x1e2357[_0xb6de('0x43')])&&fs[_0xb6de('0x47')](_0x60980a)){logger[_0xb6de('0x53')](_0xb6de('0x54')+_0x60980a+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xb6de('0x55')](_0x60980a);}_0x60980a=_0x60980a+'.cypher';if(!_[_0xb6de('0x56')](_0x1e2357[_0xb6de('0x43')])&&fs[_0xb6de('0x47')](_0x60980a)){logger[_0xb6de('0x53')](_0xb6de('0x54')+_0x60980a+_0xb6de('0x57'));fs[_0xb6de('0x55')](_0x60980a);}return _0x1e2357;})['then'](function(_0x37e3db){if(!_0x37e3db)throw new InternalError();return _0x37e3db[_0xb6de('0x1f')]();})[_0xb6de('0x1e')](function(){_0x2b8d07[_0xb6de('0x14')](0xcc)[_0xb6de('0x15')]();})[_0xb6de('0x40')](handleError(_0x2b8d07,null));}; \ No newline at end of file +var _0x6e9c=['isNil','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','info','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','destroy','error','stack','name','send','map','SquareRecording','rawAttributes','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','includeAll','include','findAll','rows','catch','params','find','create','body','../../components/encryptor','uniqueid','savePath','format','%s.cypher','decryptFile','existsSync','ValidationError','SquareRecording\x20not\x20found','filename','download','extname','unlink','message','Not\x20found','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s'];(function(_0x341837,_0x415535){var _0x6eba94=function(_0x3962ef){while(--_0x3962ef){_0x341837['push'](_0x341837['shift']());}};_0x6eba94(++_0x415535);}(_0x6e9c,0xbd));var _0xc6e9=function(_0x191f79,_0x3a85a5){_0x191f79=_0x191f79-0x0;var _0x112adc=_0x6e9c[_0x191f79];return _0x112adc;};'use strict';var pdf=require(_0xc6e9('0x0'));var emlformat=require(_0xc6e9('0x1'));var rimraf=require(_0xc6e9('0x2'));var zipdir=require(_0xc6e9('0x3'));var jsonpatch=require(_0xc6e9('0x4'));var rp=require(_0xc6e9('0x5'));var moment=require('moment');var BPromise=require(_0xc6e9('0x6'));var Mustache=require(_0xc6e9('0x7'));var util=require(_0xc6e9('0x8'));var path=require('path');var sox=require(_0xc6e9('0x9'));var csv=require(_0xc6e9('0xa'));var ejs=require(_0xc6e9('0xb'));var fs=require('fs');var _=require(_0xc6e9('0xc'));var squel=require(_0xc6e9('0xd'));var crypto=require('crypto');var jsforce=require(_0xc6e9('0xe'));var deskjs=require(_0xc6e9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc6e9('0x10'));var Papa=require(_0xc6e9('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xc6e9('0x12'));var hardwareService=require(_0xc6e9('0x13'));var logger=require(_0xc6e9('0x14'))(_0xc6e9('0x15'));var utils=require(_0xc6e9('0x16'));var config=require('../../config/environment');var db=require(_0xc6e9('0x17'))['db'];function respondWithStatusCode(_0x484548,_0x16bff2){_0x16bff2=_0x16bff2||0xcc;return function(_0x227ac4){if(_0x227ac4){return _0x484548[_0xc6e9('0x18')](_0x16bff2);}return _0x484548[_0xc6e9('0x19')](_0x16bff2)[_0xc6e9('0x1a')]();};}function respondWithResult(_0x38a3e7,_0x4eea65){_0x4eea65=_0x4eea65||0xc8;return function(_0x29dd9e){if(_0x29dd9e){return _0x38a3e7['status'](_0x4eea65)[_0xc6e9('0x1b')](_0x29dd9e);}};}function respondWithFilteredResult(_0x478974,_0x15146f){return function(_0x236d2e){if(_0x236d2e){var _0x176970=_0x236d2e[_0xc6e9('0x1c')],_0x2b2d44=_0x15146f[_0xc6e9('0x1d')],_0x16c7cf=_0x15146f[_0xc6e9('0x1d')]+_0x15146f[_0xc6e9('0x1e')],_0x29ebf9;if(_0x16c7cf>=_0x176970){_0x16c7cf=_0x176970;_0x29ebf9=0xc8;}else{_0x29ebf9=0xce;}_0x478974[_0xc6e9('0x19')](_0x29ebf9);return _0x478974['set']('Content-Range',_0x2b2d44+'-'+_0x16c7cf+'/'+_0x176970)['json'](_0x236d2e);}return null;};}function patchUpdates(_0x331e8b){return function(_0x1ceaab){try{jsonpatch[_0xc6e9('0x1f')](_0x1ceaab,_0x331e8b,!![]);}catch(_0x594006){return BPromise[_0xc6e9('0x20')](_0x594006);}return _0x1ceaab[_0xc6e9('0x21')]();};}function saveUpdates(_0x5975d9,_0x10f54f){return function(_0x8846de){if(_0x8846de){return _0x8846de[_0xc6e9('0x22')](_0x5975d9)[_0xc6e9('0x23')](function(_0x300deb){return _0x300deb;});}return null;};}function removeEntity(_0x1b5d27,_0x89d102){return function(_0x49d94e){if(_0x49d94e){return _0x49d94e[_0xc6e9('0x24')]()['then'](function(){_0x1b5d27[_0xc6e9('0x19')](0xcc)[_0xc6e9('0x1a')]();});}};}function handleEntityNotFound(_0x3c683e,_0xe94e37){return function(_0x36375c){if(!_0x36375c){_0x3c683e[_0xc6e9('0x18')](0x194);}return _0x36375c;};}function handleError(_0x216c13,_0x21320b){_0x21320b=_0x21320b||0x1f4;return function(_0x13634e){logger[_0xc6e9('0x25')](_0x13634e[_0xc6e9('0x26')]);if(_0x13634e[_0xc6e9('0x27')]){delete _0x13634e[_0xc6e9('0x27')];}_0x216c13[_0xc6e9('0x19')](_0x21320b)[_0xc6e9('0x28')](_0x13634e);};}exports['index']=function(_0x23f48f,_0x4791ab){var _0x2b8f0f={},_0x57902c={},_0xc89cf0={'count':0x0,'rows':[]};var _0x5dd9c9=_[_0xc6e9('0x29')](db[_0xc6e9('0x2a')][_0xc6e9('0x2b')],function(_0x45c311){return{'name':_0x45c311['fieldName'],'type':_0x45c311[_0xc6e9('0x2c')]['key']};});_0x57902c[_0xc6e9('0x2d')]=_[_0xc6e9('0x29')](_0x5dd9c9,_0xc6e9('0x27'));_0x57902c[_0xc6e9('0x2e')]=_[_0xc6e9('0x2f')](_0x23f48f['query']);_0x57902c[_0xc6e9('0x30')]=_[_0xc6e9('0x31')](_0x57902c[_0xc6e9('0x2d')],_0x57902c['query']);_0x2b8f0f[_0xc6e9('0x32')]=_[_0xc6e9('0x31')](_0x57902c[_0xc6e9('0x2d')],qs[_0xc6e9('0x33')](_0x23f48f['query'][_0xc6e9('0x33')]));_0x2b8f0f['attributes']=_0x2b8f0f['attributes'][_0xc6e9('0x34')]?_0x2b8f0f[_0xc6e9('0x32')]:_0x57902c[_0xc6e9('0x2d')];if(!_0x23f48f[_0xc6e9('0x2e')][_0xc6e9('0x35')](_0xc6e9('0x36'))){_0x2b8f0f[_0xc6e9('0x1e')]=qs['limit'](_0x23f48f[_0xc6e9('0x2e')][_0xc6e9('0x1e')]);_0x2b8f0f['offset']=qs[_0xc6e9('0x1d')](_0x23f48f['query'][_0xc6e9('0x1d')]);}_0x2b8f0f[_0xc6e9('0x37')]=qs[_0xc6e9('0x38')](_0x23f48f['query']['sort']);_0x2b8f0f[_0xc6e9('0x39')]=qs[_0xc6e9('0x30')](_['pick'](_0x23f48f[_0xc6e9('0x2e')],_0x57902c[_0xc6e9('0x30')]));if(_0x23f48f[_0xc6e9('0x2e')]['filter']){_0x2b8f0f[_0xc6e9('0x39')]=_[_0xc6e9('0x3a')](_0x2b8f0f[_0xc6e9('0x39')],{'$or':_[_0xc6e9('0x29')](_0x5dd9c9,function(_0xa0d574){if(_0xa0d574[_0xc6e9('0x2c')]!=='VIRTUAL'){var _0x4c2395={};_0x4c2395[_0xa0d574['name']]={'$like':'%'+_0x23f48f[_0xc6e9('0x2e')][_0xc6e9('0x3b')]+'%'};return _0x4c2395;}})});}_0x2b8f0f=_[_0xc6e9('0x3a')]({},_0x2b8f0f,_0x23f48f[_0xc6e9('0x3c')]);var _0xe55486={'where':_0x2b8f0f[_0xc6e9('0x39')]};return db[_0xc6e9('0x2a')]['count'](_0xe55486)[_0xc6e9('0x23')](function(_0x156942){_0xc89cf0[_0xc6e9('0x1c')]=_0x156942;if(_0x23f48f['query'][_0xc6e9('0x3d')]){_0x2b8f0f[_0xc6e9('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0xc6e9('0x3f')](_0x2b8f0f);})[_0xc6e9('0x23')](function(_0x29cc25){_0xc89cf0[_0xc6e9('0x40')]=_0x29cc25;return _0xc89cf0;})[_0xc6e9('0x23')](respondWithFilteredResult(_0x4791ab,_0x2b8f0f))[_0xc6e9('0x41')](handleError(_0x4791ab,null));};exports['show']=function(_0x1b039b,_0x2cb5ef){var _0x273b9c={'raw':!![],'where':{'id':_0x1b039b[_0xc6e9('0x42')]['id']}},_0x3ff3fb={};_0x3ff3fb[_0xc6e9('0x2d')]=_[_0xc6e9('0x2f')](db[_0xc6e9('0x2a')][_0xc6e9('0x2b')]);_0x3ff3fb['query']=_['keys'](_0x1b039b[_0xc6e9('0x2e')]);_0x3ff3fb[_0xc6e9('0x30')]=_['intersection'](_0x3ff3fb[_0xc6e9('0x2d')],_0x3ff3fb[_0xc6e9('0x2e')]);_0x273b9c[_0xc6e9('0x32')]=_[_0xc6e9('0x31')](_0x3ff3fb[_0xc6e9('0x2d')],qs[_0xc6e9('0x33')](_0x1b039b[_0xc6e9('0x2e')][_0xc6e9('0x33')]));_0x273b9c[_0xc6e9('0x32')]=_0x273b9c[_0xc6e9('0x32')][_0xc6e9('0x34')]?_0x273b9c['attributes']:_0x3ff3fb['model'];if(_0x1b039b['query']['includeAll']){_0x273b9c[_0xc6e9('0x3e')]=[{'all':!![]}];}_0x273b9c=_[_0xc6e9('0x3a')]({},_0x273b9c,_0x1b039b[_0xc6e9('0x3c')]);return db[_0xc6e9('0x2a')][_0xc6e9('0x43')](_0x273b9c)[_0xc6e9('0x23')](handleEntityNotFound(_0x2cb5ef,null))[_0xc6e9('0x23')](respondWithResult(_0x2cb5ef,null))['catch'](handleError(_0x2cb5ef,null));};exports['create']=function(_0x28d07c,_0x4947c9){return db[_0xc6e9('0x2a')][_0xc6e9('0x44')](_0x28d07c[_0xc6e9('0x45')],{})['then'](respondWithResult(_0x4947c9,0xc9))[_0xc6e9('0x41')](handleError(_0x4947c9,null));};exports['update']=function(_0x35bf7c,_0xcccd74){if(_0x35bf7c[_0xc6e9('0x45')]['id']){delete _0x35bf7c[_0xc6e9('0x45')]['id'];}return db[_0xc6e9('0x2a')]['find']({'where':{'id':_0x35bf7c[_0xc6e9('0x42')]['id']}})[_0xc6e9('0x23')](handleEntityNotFound(_0xcccd74,null))[_0xc6e9('0x23')](saveUpdates(_0x35bf7c[_0xc6e9('0x45')],null))[_0xc6e9('0x23')](respondWithResult(_0xcccd74,null))[_0xc6e9('0x41')](handleError(_0xcccd74,null));};exports['download']=function(_0x18650c,_0xde8747,_0x8b325a){var _0x56aacd=require(_0xc6e9('0x46'));var _0x47adb7=![];var _0x5c786a={};if(_0x18650c[_0xc6e9('0x2e')][_0xc6e9('0x2c')]&&_0x18650c[_0xc6e9('0x2e')][_0xc6e9('0x2c')]===_0xc6e9('0x47')){_0x5c786a[_0xc6e9('0x47')]=_0x18650c[_0xc6e9('0x42')]['id'];}else{_0x5c786a['id']=_0x18650c['params']['id'];}return db[_0xc6e9('0x2a')]['find']({'where':_0x5c786a,'attributes':['id',_0xc6e9('0x48'),'filename'],'raw':!![]})[_0xc6e9('0x23')](handleEntityNotFound(_0xde8747,null))['then'](function(_0x483cde){if(_0x483cde){var _0x1c4b2f=_0x483cde['savePath'];var _0x2e1e47=util[_0xc6e9('0x49')](_0xc6e9('0x4a'),_0x1c4b2f);if(fs['existsSync'](_0x2e1e47)){_0x47adb7=!![];return _0x56aacd[_0xc6e9('0x4b')](_0x2e1e47,_0x1c4b2f,config['secrets']['recording'])['then'](function(){return _0x483cde;});}return _0x483cde;}})[_0xc6e9('0x23')](function(_0x43acd4){if(_0x43acd4){var _0x245f7c=_0x43acd4[_0xc6e9('0x48')];if(!fs[_0xc6e9('0x4c')](_0x245f7c)){throw new db['Sequelize'][(_0xc6e9('0x4d'))](_0xc6e9('0x4e'));}if(_0x43acd4[_0xc6e9('0x4f')]){return _0xde8747[_0xc6e9('0x50')](_0x245f7c,_0x43acd4[_0xc6e9('0x4f')]+path[_0xc6e9('0x51')](_0x245f7c),function(){if(_0x47adb7){fs[_0xc6e9('0x52')](_0x245f7c);}});}else{return _0xde8747[_0xc6e9('0x50')](_0x245f7c,function(_0xb3116){if(_0x47adb7){fs[_0xc6e9('0x52')](_0x245f7c);}});}}})[_0xc6e9('0x41')](function(_0x4f56e6){if(_0x4f56e6[_0xc6e9('0x53')]===_0xc6e9('0x4e')){_0xde8747['status'](0x194)[_0xc6e9('0x28')](_0xc6e9('0x54'));}else{return handleError(_0xde8747,null);}});};exports[_0xc6e9('0x24')]=function(_0x56eedb,_0x4d083e){return db[_0xc6e9('0x2a')][_0xc6e9('0x43')]({'where':{'id':_0x56eedb[_0xc6e9('0x42')]['id']}})[_0xc6e9('0x23')](function(_0x134d68){if(!_0x134d68)throw new ReferenceError(_0xc6e9('0x55'));return _0x134d68;})[_0xc6e9('0x23')](function(_0x19d864){var _0x42ad28=_0x19d864[_0xc6e9('0x48')];logger['info'](_0xc6e9('0x56'),_0x42ad28);if(!_[_0xc6e9('0x57')](_0x19d864[_0xc6e9('0x48')])&&fs[_0xc6e9('0x4c')](_0x42ad28)){logger['info'](_0xc6e9('0x58')+_0x42ad28+_0xc6e9('0x59'));fs[_0xc6e9('0x5a')](_0x42ad28);}_0x42ad28=_0x42ad28+'.cypher';if(!_['isNil'](_0x19d864[_0xc6e9('0x48')])&&fs[_0xc6e9('0x4c')](_0x42ad28)){logger[_0xc6e9('0x5b')](_0xc6e9('0x58')+_0x42ad28+_0xc6e9('0x59'));fs['unlinkSync'](_0x42ad28);}return _0x19d864;})[_0xc6e9('0x23')](function(_0x376eef){if(!_0x376eef)throw new InternalError();return _0x376eef[_0xc6e9('0x24')]();})['then'](function(){_0x4d083e[_0xc6e9('0x19')](0xcc)[_0xc6e9('0x1a')]();})[_0xc6e9('0x41')](handleError(_0x4d083e,null));}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 7d2cfb2..cecdcb6 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 _0x4325=['moment','bluebird','rimraf','../../config/environment','./squareRecording.attributes','SquareRecording','lodash','util','api'];(function(_0x34d700,_0x345bbc){var _0x136e45=function(_0x27f6a5){while(--_0x27f6a5){_0x34d700['push'](_0x34d700['shift']());}};_0x136e45(++_0x345bbc);}(_0x4325,0x1da));var _0x5432=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0x4325[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0x5432('0x0'));var util=require(_0x5432('0x1'));var logger=require('../../config/logger')(_0x5432('0x2'));var moment=require(_0x5432('0x3'));var BPromise=require(_0x5432('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x5432('0x5'));var config=require(_0x5432('0x6'));var attributes=require(_0x5432('0x7'));module['exports']=function(_0x209e2e,_0xbb0075){return _0x209e2e['define'](_0x5432('0x8'),attributes,{'tableName':'square_recordings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x988c=['bluebird','request-promise','./squareRecording.attributes','exports','define','SquareRecording','lodash','moment'];(function(_0x48f7e0,_0x1c0f0e){var _0x532956=function(_0x2ee62c){while(--_0x2ee62c){_0x48f7e0['push'](_0x48f7e0['shift']());}};_0x532956(++_0x1c0f0e);}(_0x988c,0x19e));var _0xc988=function(_0x3e29bb,_0x1124e2){_0x3e29bb=_0x3e29bb-0x0;var _0x3e1fa3=_0x988c[_0x3e29bb];return _0x3e1fa3;};'use strict';var _=require(_0xc988('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xc988('0x1'));var BPromise=require(_0xc988('0x2'));var rp=require(_0xc988('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc988('0x4'));module[_0xc988('0x5')]=function(_0x17fa32,_0x56317c){return _0x17fa32[_0xc988('0x6')](_0xc988('0x7'),attributes,{'tableName':'square_recordings','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 9889bf9..1a8e64e 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 _0xd83e=['message','result','SquareRecording','body','options','raw','CreateSquareRecording','stringify','catch','bluebird','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','error'];(function(_0x2378c5,_0x1298e2){var _0x320e84=function(_0x246900){while(--_0x246900){_0x2378c5['push'](_0x2378c5['shift']());}};_0x320e84(++_0x1298e2);}(_0xd83e,0x189));var _0xed83=function(_0xdc1594,_0x15c7cb){_0xdc1594=_0xdc1594-0x0;var _0x1c1eac=_0xd83e[_0xdc1594];return _0x1c1eac;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xed83('0x0'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xed83('0x1'))['db'];var utils=require(_0xed83('0x2'));var logger=require('../../config/logger')('rpc');var config=require(_0xed83('0x3'));var jayson=require(_0xed83('0x4'));var client=jayson[_0xed83('0x5')][_0xed83('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x11ff12,_0x2dd5db,_0xfb7f98){return new BPromise(function(_0x3eebf9,_0x53ca6e){return client[_0xed83('0x7')](_0x11ff12,_0xfb7f98)[_0xed83('0x8')](function(_0x5495b3){logger[_0xed83('0x9')](_0xed83('0xa'),_0x2dd5db,_0xed83('0xb'));logger[_0xed83('0xc')](_0xed83('0xd'),_0x2dd5db,_0xed83('0xb'),JSON['stringify'](_0x5495b3));if(_0x5495b3[_0xed83('0xe')]){if(_0x5495b3[_0xed83('0xe')]['code']===0x1f4){logger[_0xed83('0xe')](_0xed83('0xa'),_0x2dd5db,_0x5495b3[_0xed83('0xe')]['message']);return _0x53ca6e(_0x5495b3[_0xed83('0xe')][_0xed83('0xf')]);}logger[_0xed83('0xe')](_0xed83('0xa'),_0x2dd5db,_0x5495b3['error'][_0xed83('0xf')]);return _0x3eebf9(_0x5495b3[_0xed83('0xe')]['message']);}else{logger[_0xed83('0x9')](_0xed83('0xa'),_0x2dd5db,_0xed83('0xb'));_0x3eebf9(_0x5495b3[_0xed83('0x10')][_0xed83('0xf')]);}})['catch'](function(_0x5717d9){logger['error'](_0xed83('0xa'),_0x2dd5db,_0x5717d9);_0x53ca6e(_0x5717d9);});});}exports['CreateSquareRecording']=function(_0x20512e){var _0x46659d=this;return new Promise(function(_0x5e7fea,_0x373171){return db[_0xed83('0x11')]['create'](_0x20512e[_0xed83('0x12')],{'raw':_0x20512e[_0xed83('0x13')]?_0x20512e[_0xed83('0x13')][_0xed83('0x14')]===undefined?!![]:![]:!![]})[_0xed83('0x8')](function(_0x475907){logger['info'](_0xed83('0x15'),_0x20512e);logger[_0xed83('0xc')](_0xed83('0x15'),_0x20512e,JSON[_0xed83('0x16')](_0x475907));_0x5e7fea(_0x475907);})[_0xed83('0x17')](function(_0x237559){logger[_0xed83('0xe')](_0xed83('0x15'),_0x237559[_0xed83('0xf')],_0x20512e);_0x373171(_0x46659d['error'](0x1f4,_0x237559[_0xed83('0xf')]));});});}; \ No newline at end of file +var _0xaeec=['CreateSquareRecording','debug','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','SquareRecording,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body','options'];(function(_0x357836,_0x20f9ca){var _0x3af2e5=function(_0x2b25e2){while(--_0x2b25e2){_0x357836['push'](_0x357836['shift']());}};_0x3af2e5(++_0x20f9ca);}(_0xaeec,0xfc));var _0xcaee=function(_0xa30643,_0x3f9eca){_0xa30643=_0xa30643-0x0;var _0x594bb4=_0xaeec[_0xa30643];return _0x594bb4;};'use strict';var _=require(_0xcaee('0x0'));var util=require('util');var moment=require(_0xcaee('0x1'));var BPromise=require('bluebird');var rs=require(_0xcaee('0x2'));var fs=require('fs');var Redis=require(_0xcaee('0x3'));var db=require(_0xcaee('0x4'))['db'];var utils=require(_0xcaee('0x5'));var logger=require(_0xcaee('0x6'))(_0xcaee('0x7'));var config=require(_0xcaee('0x8'));var jayson=require(_0xcaee('0x9'));var client=jayson['client'][_0xcaee('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1a9083,_0x41fc7f,_0x16fdb6){return new BPromise(function(_0x3350b,_0x4f6ca5){return client[_0xcaee('0xb')](_0x1a9083,_0x16fdb6)[_0xcaee('0xc')](function(_0x555e4a){logger['info'](_0xcaee('0xd'),_0x41fc7f,'request\x20sent');logger['debug']('SquareRecording,\x20%s,\x20%s,\x20%s',_0x41fc7f,_0xcaee('0xe'),JSON[_0xcaee('0xf')](_0x555e4a));if(_0x555e4a[_0xcaee('0x10')]){if(_0x555e4a[_0xcaee('0x10')]['code']===0x1f4){logger[_0xcaee('0x10')]('SquareRecording,\x20%s,\x20%s',_0x41fc7f,_0x555e4a[_0xcaee('0x10')]['message']);return _0x4f6ca5(_0x555e4a[_0xcaee('0x10')][_0xcaee('0x11')]);}logger[_0xcaee('0x10')]('SquareRecording,\x20%s,\x20%s',_0x41fc7f,_0x555e4a[_0xcaee('0x10')][_0xcaee('0x11')]);return _0x3350b(_0x555e4a[_0xcaee('0x10')]['message']);}else{logger['info'](_0xcaee('0xd'),_0x41fc7f,_0xcaee('0xe'));_0x3350b(_0x555e4a[_0xcaee('0x12')][_0xcaee('0x11')]);}})[_0xcaee('0x13')](function(_0x34513f){logger[_0xcaee('0x10')](_0xcaee('0xd'),_0x41fc7f,_0x34513f);_0x4f6ca5(_0x34513f);});});}exports['CreateSquareRecording']=function(_0x1503b6){var _0x85194b=this;return new Promise(function(_0x53e8e7,_0x3d1f73){return db['SquareRecording'][_0xcaee('0x14')](_0x1503b6[_0xcaee('0x15')],{'raw':_0x1503b6['options']?_0x1503b6[_0xcaee('0x16')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0xe875fb){logger['info'](_0xcaee('0x17'),_0x1503b6);logger[_0xcaee('0x18')](_0xcaee('0x17'),_0x1503b6,JSON['stringify'](_0xe875fb));_0x53e8e7(_0xe875fb);})[_0xcaee('0x13')](function(_0x4982a0){logger[_0xcaee('0x10')](_0xcaee('0x17'),_0x4982a0[_0xcaee('0x11')],_0x1503b6);_0x3d1f73(_0x85194b['error'](0x1f4,_0x4982a0['message']));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index 418aa57..0c3cd92 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 _0x5e77=['multer','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy','exports'];(function(_0xce94c7,_0x354357){var _0x3c55c8=function(_0x52191a){while(--_0x52191a){_0xce94c7['push'](_0xce94c7['shift']());}};_0x3c55c8(++_0x354357);}(_0x5e77,0x1ef));var _0x75e7=function(_0x513986,_0x31bc65){_0x513986=_0x513986-0x0;var _0x282e99=_0x5e77[_0x513986];return _0x282e99;};'use strict';var multer=require(_0x75e7('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x75e7('0x1'));var interaction=require(_0x75e7('0x2'));var config=require(_0x75e7('0x3'));var controller=require('./squareReport.controller');router[_0x75e7('0x4')]('/',auth[_0x75e7('0x5')](),controller[_0x75e7('0x6')]);router[_0x75e7('0x4')](_0x75e7('0x7'),auth[_0x75e7('0x5')](),controller[_0x75e7('0x8')]);router['get'](_0x75e7('0x9'),auth[_0x75e7('0x5')](),controller[_0x75e7('0xa')]);router[_0x75e7('0xb')]('/',auth[_0x75e7('0x5')](),controller['create']);router[_0x75e7('0xc')](_0x75e7('0x9'),auth['isAuthenticated'](),controller['update']);router['delete'](_0x75e7('0x9'),auth[_0x75e7('0x5')](),controller[_0x75e7('0xd')]);module[_0x75e7('0xe')]=router; \ No newline at end of file +var _0x5931=['isAuthenticated','index','/describe','describe','/:id','post','put','update','delete','destroy','connect-timeout','express','../../components/interaction/service','../../config/environment','get'];(function(_0x19ae79,_0x34966d){var _0x21e741=function(_0x13e210){while(--_0x13e210){_0x19ae79['push'](_0x19ae79['shift']());}};_0x21e741(++_0x34966d);}(_0x5931,0x1db));var _0x1593=function(_0x497b1e,_0x586379){_0x497b1e=_0x497b1e-0x0;var _0x3f72e1=_0x5931[_0x497b1e];return _0x3f72e1;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x1593('0x0'));var express=require(_0x1593('0x1'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x1593('0x2'));var config=require(_0x1593('0x3'));var controller=require('./squareReport.controller');router[_0x1593('0x4')]('/',auth[_0x1593('0x5')](),controller[_0x1593('0x6')]);router['get'](_0x1593('0x7'),auth[_0x1593('0x5')](),controller[_0x1593('0x8')]);router[_0x1593('0x4')](_0x1593('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x1593('0xa')]('/',auth['isAuthenticated'](),controller['create']);router[_0x1593('0xb')](_0x1593('0x9'),auth[_0x1593('0x5')](),controller[_0x1593('0xc')]);router[_0x1593('0xd')](_0x1593('0x9'),auth[_0x1593('0x5')](),controller[_0x1593('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 643e887..58e7d9f 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 _0xfc16=['exports','STRING','DATE','sequelize'];(function(_0x4fc938,_0xd13e77){var _0xa01304=function(_0x2e6e94){while(--_0x2e6e94){_0x4fc938['push'](_0x4fc938['shift']());}};_0xa01304(++_0xd13e77);}(_0xfc16,0x1a3));var _0x6fc1=function(_0x58379a,_0x1840de){_0x58379a=_0x58379a-0x0;var _0xf88d78=_0xfc16[_0x58379a];return _0xf88d78;};'use strict';var Sequelize=require(_0x6fc1('0x0'));module[_0x6fc1('0x1')]={'network':{'type':Sequelize[_0x6fc1('0x2')]},'network_script':{'type':Sequelize['STRING']},'request':{'type':Sequelize[_0x6fc1('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize['STRING']},'version':{'type':Sequelize[_0x6fc1('0x2')]},'callerid':{'type':Sequelize[_0x6fc1('0x2')]},'calleridname':{'type':Sequelize[_0x6fc1('0x2')]},'callingpres':{'type':Sequelize['STRING']},'callingani2':{'type':Sequelize[_0x6fc1('0x2')]},'callington':{'type':Sequelize[_0x6fc1('0x2')]},'callingtns':{'type':Sequelize[_0x6fc1('0x2')]},'dnid':{'type':Sequelize[_0x6fc1('0x2')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x6fc1('0x2')]},'extension':{'type':Sequelize[_0x6fc1('0x2')]},'priority':{'type':Sequelize[_0x6fc1('0x2')]},'enhanced':{'type':Sequelize[_0x6fc1('0x2')]},'accountcode':{'type':Sequelize[_0x6fc1('0x2')]},'threadid':{'type':Sequelize[_0x6fc1('0x2')]},'project_name':{'type':Sequelize[_0x6fc1('0x2')]},'joinAt':{'type':Sequelize[_0x6fc1('0x3')]},'leaveAt':{'type':Sequelize[_0x6fc1('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x0ae8=['STRING','DATE','BOOLEAN','sequelize'];(function(_0xa366d1,_0x27736b){var _0x16eccf=function(_0x1e4d39){while(--_0x1e4d39){_0xa366d1['push'](_0xa366d1['shift']());}};_0x16eccf(++_0x27736b);}(_0x0ae8,0x1a3));var _0x80ae=function(_0x565fc6,_0x4ad48f){_0x565fc6=_0x565fc6-0x0;var _0x2fa55a=_0x0ae8[_0x565fc6];return _0x2fa55a;};'use strict';var Sequelize=require(_0x80ae('0x0'));module['exports']={'network':{'type':Sequelize[_0x80ae('0x1')]},'network_script':{'type':Sequelize[_0x80ae('0x1')]},'request':{'type':Sequelize[_0x80ae('0x1')]},'channel':{'type':Sequelize[_0x80ae('0x1')]},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x80ae('0x1')]},'uniqueid':{'type':Sequelize[_0x80ae('0x1')]},'version':{'type':Sequelize[_0x80ae('0x1')]},'callerid':{'type':Sequelize[_0x80ae('0x1')]},'calleridname':{'type':Sequelize[_0x80ae('0x1')]},'callingpres':{'type':Sequelize[_0x80ae('0x1')]},'callingani2':{'type':Sequelize[_0x80ae('0x1')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0x80ae('0x1')]},'dnid':{'type':Sequelize[_0x80ae('0x1')]},'rdnis':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x80ae('0x1')]},'priority':{'type':Sequelize['STRING']},'enhanced':{'type':Sequelize[_0x80ae('0x1')]},'accountcode':{'type':Sequelize[_0x80ae('0x1')]},'threadid':{'type':Sequelize[_0x80ae('0x1')]},'project_name':{'type':Sequelize[_0x80ae('0x1')]},'joinAt':{'type':Sequelize[_0x80ae('0x2')]},'leaveAt':{'type':Sequelize[_0x80ae('0x2')]},'bot':{'type':Sequelize[_0x80ae('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 bf3cc70..db5a217 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 _0x7fbe=['query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','SquareReport','includeAll','findAll','rows','show','params','include','options','catch','create','body','destroy','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','save','update','then','error','name','send','index','map','rawAttributes','fieldName','type','key','model','keys'];(function(_0x37c037,_0x57040a){var _0x21bf51=function(_0x53bb24){while(--_0x53bb24){_0x37c037['push'](_0x37c037['shift']());}};_0x21bf51(++_0x57040a);}(_0x7fbe,0x1ec));var _0xe7fb=function(_0x5d6600,_0x9a9e9b){_0x5d6600=_0x5d6600-0x0;var _0x3c85cc=_0x7fbe[_0x5d6600];return _0x3c85cc;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xe7fb('0x0'));var zipdir=require(_0xe7fb('0x1'));var jsonpatch=require(_0xe7fb('0x2'));var rp=require(_0xe7fb('0x3'));var moment=require(_0xe7fb('0x4'));var BPromise=require(_0xe7fb('0x5'));var Mustache=require(_0xe7fb('0x6'));var util=require(_0xe7fb('0x7'));var path=require(_0xe7fb('0x8'));var sox=require(_0xe7fb('0x9'));var csv=require(_0xe7fb('0xa'));var ejs=require(_0xe7fb('0xb'));var fs=require('fs');var _=require(_0xe7fb('0xc'));var squel=require(_0xe7fb('0xd'));var crypto=require('crypto');var jsforce=require(_0xe7fb('0xe'));var deskjs=require(_0xe7fb('0xf'));var toCsv=require(_0xe7fb('0xa'));var querystring=require(_0xe7fb('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xe7fb('0x11'));var qs=require(_0xe7fb('0x12'));var as=require(_0xe7fb('0x13'));var hardwareService=require(_0xe7fb('0x14'));var logger=require(_0xe7fb('0x15'))(_0xe7fb('0x16'));var utils=require(_0xe7fb('0x17'));var config=require(_0xe7fb('0x18'));var db=require(_0xe7fb('0x19'))['db'];function respondWithStatusCode(_0x2fe8ab,_0x2437d4){_0x2437d4=_0x2437d4||0xcc;return function(_0x188e1d){if(_0x188e1d){return _0x2fe8ab[_0xe7fb('0x1a')](_0x2437d4);}return _0x2fe8ab[_0xe7fb('0x1b')](_0x2437d4)[_0xe7fb('0x1c')]();};}function respondWithResult(_0x598729,_0x278b75){_0x278b75=_0x278b75||0xc8;return function(_0x2225e5){if(_0x2225e5){return _0x598729['status'](_0x278b75)[_0xe7fb('0x1d')](_0x2225e5);}};}function respondWithFilteredResult(_0x37eb9f,_0x482f7d){return function(_0xa76acf){if(_0xa76acf){var _0x559129=_0xa76acf[_0xe7fb('0x1e')],_0x12fff6=_0x482f7d['offset'],_0x18d23c=_0x482f7d[_0xe7fb('0x1f')]+_0x482f7d['limit'],_0x12603d;if(_0x18d23c>=_0x559129){_0x18d23c=_0x559129;_0x12603d=0xc8;}else{_0x12603d=0xce;}_0x37eb9f[_0xe7fb('0x1b')](_0x12603d);return _0x37eb9f['set'](_0xe7fb('0x20'),_0x12fff6+'-'+_0x18d23c+'/'+_0x559129)[_0xe7fb('0x1d')](_0xa76acf);}return null;};}function patchUpdates(_0x3f96a7){return function(_0x182269){try{jsonpatch['apply'](_0x182269,_0x3f96a7,!![]);}catch(_0x44466e){return BPromise['reject'](_0x44466e);}return _0x182269[_0xe7fb('0x21')]();};}function saveUpdates(_0x51f01f,_0x15f7a4){return function(_0x4ea664){if(_0x4ea664){return _0x4ea664[_0xe7fb('0x22')](_0x51f01f)[_0xe7fb('0x23')](function(_0x4a9994){return _0x4a9994;});}return null;};}function removeEntity(_0x143eb6,_0x4742bd){return function(_0x3ae8f1){if(_0x3ae8f1){return _0x3ae8f1['destroy']()[_0xe7fb('0x23')](function(){_0x143eb6[_0xe7fb('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5bea27,_0x52f08b){return function(_0x35e4db){if(!_0x35e4db){_0x5bea27['sendStatus'](0x194);}return _0x35e4db;};}function handleError(_0x49b219,_0x4026b1){_0x4026b1=_0x4026b1||0x1f4;return function(_0x32e8b2){logger[_0xe7fb('0x24')](_0x32e8b2['stack']);if(_0x32e8b2[_0xe7fb('0x25')]){delete _0x32e8b2[_0xe7fb('0x25')];}_0x49b219[_0xe7fb('0x1b')](_0x4026b1)[_0xe7fb('0x26')](_0x32e8b2);};}exports[_0xe7fb('0x27')]=function(_0x16237a,_0x380130){var _0x59e015={},_0x5df9f2={},_0x1086e6={'count':0x0,'rows':[]};var _0x3bdee9=_[_0xe7fb('0x28')](db['SquareReport'][_0xe7fb('0x29')],function(_0x251807){return{'name':_0x251807[_0xe7fb('0x2a')],'type':_0x251807[_0xe7fb('0x2b')][_0xe7fb('0x2c')]};});_0x5df9f2[_0xe7fb('0x2d')]=_[_0xe7fb('0x28')](_0x3bdee9,_0xe7fb('0x25'));_0x5df9f2['query']=_[_0xe7fb('0x2e')](_0x16237a[_0xe7fb('0x2f')]);_0x5df9f2[_0xe7fb('0x30')]=_['intersection'](_0x5df9f2['model'],_0x5df9f2[_0xe7fb('0x2f')]);_0x59e015['attributes']=_[_0xe7fb('0x31')](_0x5df9f2[_0xe7fb('0x2d')],qs[_0xe7fb('0x32')](_0x16237a[_0xe7fb('0x2f')]['fields']));_0x59e015[_0xe7fb('0x33')]=_0x59e015[_0xe7fb('0x33')][_0xe7fb('0x34')]?_0x59e015[_0xe7fb('0x33')]:_0x5df9f2[_0xe7fb('0x2d')];if(!_0x16237a['query'][_0xe7fb('0x35')](_0xe7fb('0x36'))){_0x59e015[_0xe7fb('0x37')]=qs[_0xe7fb('0x37')](_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x37')]);_0x59e015[_0xe7fb('0x1f')]=qs[_0xe7fb('0x1f')](_0x16237a[_0xe7fb('0x2f')]['offset']);}_0x59e015[_0xe7fb('0x38')]=qs[_0xe7fb('0x39')](_0x16237a[_0xe7fb('0x2f')]['sort']);_0x59e015[_0xe7fb('0x3a')]=qs[_0xe7fb('0x30')](_[_0xe7fb('0x3b')](_0x16237a[_0xe7fb('0x2f')],_0x5df9f2[_0xe7fb('0x30')]));if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]){_0x59e015[_0xe7fb('0x3a')]=_[_0xe7fb('0x3d')](_0x59e015[_0xe7fb('0x3a')],{'$or':_[_0xe7fb('0x28')](_0x3bdee9,function(_0x3c4f4b){if(_0x3c4f4b[_0xe7fb('0x2b')]!==_0xe7fb('0x3e')){var _0xeb7c29={};_0xeb7c29[_0x3c4f4b[_0xe7fb('0x25')]]={'$like':'%'+_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x3c')]+'%'};return _0xeb7c29;}})});}_0x59e015=_[_0xe7fb('0x3d')]({},_0x59e015,_0x16237a['options']);var _0x261ec5={'where':_0x59e015[_0xe7fb('0x3a')]};return db[_0xe7fb('0x3f')][_0xe7fb('0x1e')](_0x261ec5)['then'](function(_0x3426a9){_0x1086e6[_0xe7fb('0x1e')]=_0x3426a9;if(_0x16237a[_0xe7fb('0x2f')][_0xe7fb('0x40')]){_0x59e015['include']=[{'all':!![]}];}return db[_0xe7fb('0x3f')][_0xe7fb('0x41')](_0x59e015);})[_0xe7fb('0x23')](function(_0x62a8a1){_0x1086e6[_0xe7fb('0x42')]=_0x62a8a1;return _0x1086e6;})[_0xe7fb('0x23')](respondWithFilteredResult(_0x380130,_0x59e015))['catch'](handleError(_0x380130,null));};exports[_0xe7fb('0x43')]=function(_0x35139f,_0x3a96cd){var _0x4b263d={'raw':!![],'where':{'id':_0x35139f[_0xe7fb('0x44')]['id']}},_0x36a341={};_0x36a341['model']=_['keys'](db['SquareReport']['rawAttributes']);_0x36a341['query']=_[_0xe7fb('0x2e')](_0x35139f[_0xe7fb('0x2f')]);_0x36a341[_0xe7fb('0x30')]=_['intersection'](_0x36a341[_0xe7fb('0x2d')],_0x36a341['query']);_0x4b263d[_0xe7fb('0x33')]=_[_0xe7fb('0x31')](_0x36a341['model'],qs[_0xe7fb('0x32')](_0x35139f[_0xe7fb('0x2f')][_0xe7fb('0x32')]));_0x4b263d[_0xe7fb('0x33')]=_0x4b263d['attributes'][_0xe7fb('0x34')]?_0x4b263d[_0xe7fb('0x33')]:_0x36a341[_0xe7fb('0x2d')];if(_0x35139f['query'][_0xe7fb('0x40')]){_0x4b263d[_0xe7fb('0x45')]=[{'all':!![]}];}_0x4b263d=_[_0xe7fb('0x3d')]({},_0x4b263d,_0x35139f[_0xe7fb('0x46')]);return db[_0xe7fb('0x3f')]['find'](_0x4b263d)[_0xe7fb('0x23')](handleEntityNotFound(_0x3a96cd,null))['then'](respondWithResult(_0x3a96cd,null))[_0xe7fb('0x47')](handleError(_0x3a96cd,null));};exports[_0xe7fb('0x48')]=function(_0x3520e3,_0x1ecbfd){return db[_0xe7fb('0x3f')]['create'](_0x3520e3[_0xe7fb('0x49')],{})['then'](respondWithResult(_0x1ecbfd,0xc9))['catch'](handleError(_0x1ecbfd,null));};exports[_0xe7fb('0x22')]=function(_0x3d740f,_0x16327f){if(_0x3d740f['body']['id']){delete _0x3d740f[_0xe7fb('0x49')]['id'];}return db[_0xe7fb('0x3f')]['find']({'where':{'id':_0x3d740f['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x16327f,null))[_0xe7fb('0x23')](saveUpdates(_0x3d740f[_0xe7fb('0x49')],null))[_0xe7fb('0x23')](respondWithResult(_0x16327f,null))[_0xe7fb('0x47')](handleError(_0x16327f,null));};exports[_0xe7fb('0x4a')]=function(_0x18a590,_0x347177){return db['SquareReport'][_0xe7fb('0x4b')]({'where':{'id':_0x18a590['params']['id']}})[_0xe7fb('0x23')](handleEntityNotFound(_0x347177,null))[_0xe7fb('0x23')](removeEntity(_0x347177,null))['catch'](handleError(_0x347177,null));};exports[_0xe7fb('0x4c')]=function(_0x5efd24,_0x239c56){return db['SquareReport'][_0xe7fb('0x4c')]()['then'](respondWithResult(_0x239c56,null))[_0xe7fb('0x47')](handleError(_0x239c56,null));}; \ No newline at end of file +var _0x4975=['../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','SquareReport','fieldName','type','key','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filters','filter','map','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs'];(function(_0x107a00,_0x5eb991){var _0x4c741c=function(_0x19b853){while(--_0x19b853){_0x107a00['push'](_0x107a00['shift']());}};_0x4c741c(++_0x5eb991);}(_0x4975,0x86));var _0x5497=function(_0x2a88c8,_0x3e1bd1){_0x2a88c8=_0x2a88c8-0x0;var _0x19e26e=_0x4975[_0x2a88c8];return _0x19e26e;};'use strict';var pdf=require(_0x5497('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5497('0x1'));var zipdir=require(_0x5497('0x2'));var jsonpatch=require(_0x5497('0x3'));var rp=require(_0x5497('0x4'));var moment=require(_0x5497('0x5'));var BPromise=require(_0x5497('0x6'));var Mustache=require(_0x5497('0x7'));var util=require(_0x5497('0x8'));var path=require(_0x5497('0x9'));var sox=require(_0x5497('0xa'));var csv=require('to-csv');var ejs=require(_0x5497('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5497('0xc'));var crypto=require(_0x5497('0xd'));var jsforce=require(_0x5497('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5497('0xf'));var querystring=require('querystring');var Papa=require(_0x5497('0x10'));var Redis=require(_0x5497('0x11'));var authService=require(_0x5497('0x12'));var qs=require(_0x5497('0x13'));var as=require(_0x5497('0x14'));var hardwareService=require(_0x5497('0x15'));var logger=require(_0x5497('0x16'))(_0x5497('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xc250bb,_0x1b23df){_0x1b23df=_0x1b23df||0xcc;return function(_0x1bb794){if(_0x1bb794){return _0xc250bb[_0x5497('0x18')](_0x1b23df);}return _0xc250bb[_0x5497('0x19')](_0x1b23df)[_0x5497('0x1a')]();};}function respondWithResult(_0x1f7169,_0xaca97d){_0xaca97d=_0xaca97d||0xc8;return function(_0x363a5b){if(_0x363a5b){return _0x1f7169[_0x5497('0x19')](_0xaca97d)['json'](_0x363a5b);}};}function respondWithFilteredResult(_0x11b0a9,_0x4fb8e9){return function(_0x4237a9){if(_0x4237a9){var _0x2bfd8a=_0x4237a9[_0x5497('0x1b')],_0x19e5f3=_0x4fb8e9[_0x5497('0x1c')],_0x3ce50b=_0x4fb8e9['offset']+_0x4fb8e9['limit'],_0x37c18e;if(_0x3ce50b>=_0x2bfd8a){_0x3ce50b=_0x2bfd8a;_0x37c18e=0xc8;}else{_0x37c18e=0xce;}_0x11b0a9[_0x5497('0x19')](_0x37c18e);return _0x11b0a9[_0x5497('0x1d')](_0x5497('0x1e'),_0x19e5f3+'-'+_0x3ce50b+'/'+_0x2bfd8a)['json'](_0x4237a9);}return null;};}function patchUpdates(_0xbf1ba7){return function(_0xcbd71d){try{jsonpatch[_0x5497('0x1f')](_0xcbd71d,_0xbf1ba7,!![]);}catch(_0x43da2c){return BPromise[_0x5497('0x20')](_0x43da2c);}return _0xcbd71d[_0x5497('0x21')]();};}function saveUpdates(_0x16d378,_0x10226f){return function(_0x2e3960){if(_0x2e3960){return _0x2e3960[_0x5497('0x22')](_0x16d378)[_0x5497('0x23')](function(_0x52c049){return _0x52c049;});}return null;};}function removeEntity(_0x720767,_0x4d1b27){return function(_0x19200a){if(_0x19200a){return _0x19200a[_0x5497('0x24')]()[_0x5497('0x23')](function(){_0x720767[_0x5497('0x19')](0xcc)[_0x5497('0x1a')]();});}};}function handleEntityNotFound(_0x3b2fbc,_0x5018fa){return function(_0x54043a){if(!_0x54043a){_0x3b2fbc[_0x5497('0x18')](0x194);}return _0x54043a;};}function handleError(_0x34b97f,_0x24482a){_0x24482a=_0x24482a||0x1f4;return function(_0x281155){logger['error'](_0x281155[_0x5497('0x25')]);if(_0x281155['name']){delete _0x281155[_0x5497('0x26')];}_0x34b97f[_0x5497('0x19')](_0x24482a)[_0x5497('0x27')](_0x281155);};}exports[_0x5497('0x28')]=function(_0x163a30,_0x31cd01){var _0x48b835={},_0x4af5f4={},_0x5406e2={'count':0x0,'rows':[]};var _0x583d06=_['map'](db[_0x5497('0x29')]['rawAttributes'],function(_0x5e9356){return{'name':_0x5e9356[_0x5497('0x2a')],'type':_0x5e9356[_0x5497('0x2b')][_0x5497('0x2c')]};});_0x4af5f4['model']=_['map'](_0x583d06,'name');_0x4af5f4[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x163a30[_0x5497('0x2d')]);_0x4af5f4['filters']=_['intersection'](_0x4af5f4['model'],_0x4af5f4[_0x5497('0x2d')]);_0x48b835['attributes']=_[_0x5497('0x2f')](_0x4af5f4[_0x5497('0x30')],qs[_0x5497('0x31')](_0x163a30['query'][_0x5497('0x31')]));_0x48b835[_0x5497('0x32')]=_0x48b835['attributes'][_0x5497('0x33')]?_0x48b835[_0x5497('0x32')]:_0x4af5f4[_0x5497('0x30')];if(!_0x163a30['query'][_0x5497('0x34')](_0x5497('0x35'))){_0x48b835[_0x5497('0x36')]=qs[_0x5497('0x36')](_0x163a30[_0x5497('0x2d')]['limit']);_0x48b835[_0x5497('0x1c')]=qs[_0x5497('0x1c')](_0x163a30['query'][_0x5497('0x1c')]);}_0x48b835[_0x5497('0x37')]=qs[_0x5497('0x38')](_0x163a30[_0x5497('0x2d')][_0x5497('0x38')]);_0x48b835[_0x5497('0x39')]=qs['filters'](_[_0x5497('0x3a')](_0x163a30['query'],_0x4af5f4[_0x5497('0x3b')]));if(_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]){_0x48b835['where']=_['merge'](_0x48b835[_0x5497('0x39')],{'$or':_[_0x5497('0x3d')](_0x583d06,function(_0x326d48){if(_0x326d48[_0x5497('0x2b')]!==_0x5497('0x3e')){var _0xc8a689={};_0xc8a689[_0x326d48['name']]={'$like':'%'+_0x163a30[_0x5497('0x2d')][_0x5497('0x3c')]+'%'};return _0xc8a689;}})});}_0x48b835=_[_0x5497('0x3f')]({},_0x48b835,_0x163a30[_0x5497('0x40')]);var _0x275aa7={'where':_0x48b835[_0x5497('0x39')]};return db[_0x5497('0x29')][_0x5497('0x1b')](_0x275aa7)[_0x5497('0x23')](function(_0x544065){_0x5406e2[_0x5497('0x1b')]=_0x544065;if(_0x163a30[_0x5497('0x2d')][_0x5497('0x41')]){_0x48b835[_0x5497('0x42')]=[{'all':!![]}];}return db[_0x5497('0x29')][_0x5497('0x43')](_0x48b835);})[_0x5497('0x23')](function(_0x59ed13){_0x5406e2[_0x5497('0x44')]=_0x59ed13;return _0x5406e2;})[_0x5497('0x23')](respondWithFilteredResult(_0x31cd01,_0x48b835))[_0x5497('0x45')](handleError(_0x31cd01,null));};exports[_0x5497('0x46')]=function(_0x1b251b,_0x125526){var _0x114471={'raw':!![],'where':{'id':_0x1b251b[_0x5497('0x47')]['id']}},_0x547437={};_0x547437[_0x5497('0x30')]=_[_0x5497('0x2e')](db[_0x5497('0x29')][_0x5497('0x48')]);_0x547437[_0x5497('0x2d')]=_[_0x5497('0x2e')](_0x1b251b[_0x5497('0x2d')]);_0x547437[_0x5497('0x3b')]=_[_0x5497('0x2f')](_0x547437['model'],_0x547437[_0x5497('0x2d')]);_0x114471['attributes']=_[_0x5497('0x2f')](_0x547437[_0x5497('0x30')],qs[_0x5497('0x31')](_0x1b251b[_0x5497('0x2d')][_0x5497('0x31')]));_0x114471['attributes']=_0x114471[_0x5497('0x32')][_0x5497('0x33')]?_0x114471['attributes']:_0x547437[_0x5497('0x30')];if(_0x1b251b['query'][_0x5497('0x41')]){_0x114471['include']=[{'all':!![]}];}_0x114471=_[_0x5497('0x3f')]({},_0x114471,_0x1b251b[_0x5497('0x40')]);return db[_0x5497('0x29')][_0x5497('0x49')](_0x114471)[_0x5497('0x23')](handleEntityNotFound(_0x125526,null))['then'](respondWithResult(_0x125526,null))['catch'](handleError(_0x125526,null));};exports['create']=function(_0x55f654,_0x3cbe4b){return db[_0x5497('0x29')][_0x5497('0x4a')](_0x55f654[_0x5497('0x4b')],{})[_0x5497('0x23')](respondWithResult(_0x3cbe4b,0xc9))[_0x5497('0x45')](handleError(_0x3cbe4b,null));};exports[_0x5497('0x22')]=function(_0x466287,_0x2626bf){if(_0x466287['body']['id']){delete _0x466287[_0x5497('0x4b')]['id'];}return db[_0x5497('0x29')][_0x5497('0x49')]({'where':{'id':_0x466287['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x2626bf,null))['then'](saveUpdates(_0x466287[_0x5497('0x4b')],null))[_0x5497('0x23')](respondWithResult(_0x2626bf,null))[_0x5497('0x45')](handleError(_0x2626bf,null));};exports['destroy']=function(_0x43bebe,_0x356d61){return db['SquareReport'][_0x5497('0x49')]({'where':{'id':_0x43bebe['params']['id']}})[_0x5497('0x23')](handleEntityNotFound(_0x356d61,null))['then'](removeEntity(_0x356d61,null))[_0x5497('0x45')](handleError(_0x356d61,null));};exports[_0x5497('0x4c')]=function(_0x26fd9f,_0xf07541){return db[_0x5497('0x29')][_0x5497('0x4c')]()[_0x5497('0x23')](respondWithResult(_0xf07541,null))[_0x5497('0x45')](handleError(_0xf07541,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 9289887..0323479 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 _0x91f8=['moment','request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','api'];(function(_0x618414,_0x1a7a60){var _0x21c19a=function(_0x507b17){while(--_0x507b17){_0x618414['push'](_0x618414['shift']());}};_0x21c19a(++_0x1a7a60);}(_0x91f8,0x188));var _0x891f=function(_0x18ca32,_0x136bd4){_0x18ca32=_0x18ca32-0x0;var _0x23761a=_0x91f8[_0x18ca32];return _0x23761a;};'use strict';var _=require(_0x891f('0x0'));var util=require(_0x891f('0x1'));var logger=require(_0x891f('0x2'))(_0x891f('0x3'));var moment=require(_0x891f('0x4'));var BPromise=require('bluebird');var rp=require(_0x891f('0x5'));var fs=require('fs');var path=require(_0x891f('0x6'));var rimraf=require(_0x891f('0x7'));var config=require(_0x891f('0x8'));var attributes=require(_0x891f('0x9'));module[_0x891f('0xa')]=function(_0x53733c,_0xdf13f3){return _0x53733c[_0x891f('0xb')](_0x891f('0xc'),attributes,{'tableName':_0x891f('0xd'),'paranoid':![],'indexes':[{'name':_0x891f('0xe'),'fields':[_0x891f('0xf'),_0x891f('0x10')]},{'name':_0x891f('0x11'),'fields':[_0x891f('0x11')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8be4=['bluebird','request-promise','rimraf','./squareReport.attributes','exports','define','SquareReport','report_square','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment'];(function(_0x78f46c,_0x597c49){var _0xd4394f=function(_0x4b17d0){while(--_0x4b17d0){_0x78f46c['push'](_0x78f46c['shift']());}};_0xd4394f(++_0x597c49);}(_0x8be4,0x11c));var _0x48be=function(_0x4cd21c,_0x35fa45){_0x4cd21c=_0x4cd21c-0x0;var _0x5d8e5e=_0x8be4[_0x4cd21c];return _0x5d8e5e;};'use strict';var _=require(_0x48be('0x0'));var util=require(_0x48be('0x1'));var logger=require(_0x48be('0x2'))('api');var moment=require(_0x48be('0x3'));var BPromise=require(_0x48be('0x4'));var rp=require(_0x48be('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x48be('0x6'));var config=require('../../config/environment');var attributes=require(_0x48be('0x7'));module[_0x48be('0x8')]=function(_0x4070f6,_0x142153){return _0x4070f6[_0x48be('0x9')](_0x48be('0xa'),attributes,{'tableName':_0x48be('0xb'),'paranoid':![],'indexes':[{'name':_0x48be('0xc'),'fields':[_0x48be('0xd'),_0x48be('0xe')]},{'name':_0x48be('0xf'),'fields':[_0x48be('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.rpc.js b/server/api/squareReport/squareReport.rpc.js index d01989e..a941f5a 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 _0x065c=['../../config/logger','jayson/promise','client','http','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','error','code','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','create','body','options','then','debug','update','where','attributes','limit','UpdateSquareReport','stringify','lodash','util','moment','bluebird','ioredis','../../config/utils'];(function(_0x3e0066,_0x166346){var _0x2f704b=function(_0xd12005){while(--_0xd12005){_0x3e0066['push'](_0x3e0066['shift']());}};_0x2f704b(++_0x166346);}(_0x065c,0x16e));var _0xc065=function(_0x1a0c59,_0x3b4dcc){_0x1a0c59=_0x1a0c59-0x0;var _0xed67c9=_0x065c[_0x1a0c59];return _0xed67c9;};'use strict';var _=require(_0xc065('0x0'));var util=require(_0xc065('0x1'));var moment=require(_0xc065('0x2'));var BPromise=require(_0xc065('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc065('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xc065('0x5'));var logger=require(_0xc065('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc065('0x7'));var client=jayson[_0xc065('0x8')][_0xc065('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x37f72b,_0x244554,_0xa386ee){return new BPromise(function(_0x500c8e,_0x2d5cd8){return client['request'](_0x37f72b,_0xa386ee)['then'](function(_0x326a96){logger[_0xc065('0xa')]('SquareReport,\x20%s,\x20%s',_0x244554,_0xc065('0xb'));logger['debug'](_0xc065('0xc'),_0x244554,_0xc065('0xb'),JSON['stringify'](_0x326a96));if(_0x326a96[_0xc065('0xd')]){if(_0x326a96[_0xc065('0xd')][_0xc065('0xe')]===0x1f4){logger['error'](_0xc065('0xf'),_0x244554,_0x326a96[_0xc065('0xd')][_0xc065('0x10')]);return _0x2d5cd8(_0x326a96[_0xc065('0xd')][_0xc065('0x10')]);}logger[_0xc065('0xd')](_0xc065('0xf'),_0x244554,_0x326a96[_0xc065('0xd')][_0xc065('0x10')]);return _0x500c8e(_0x326a96['error']['message']);}else{logger['info'](_0xc065('0xf'),_0x244554,_0xc065('0xb'));_0x500c8e(_0x326a96['result'][_0xc065('0x10')]);}})[_0xc065('0x11')](function(_0x34028a){logger['error'](_0xc065('0xf'),_0x244554,_0x34028a);_0x2d5cd8(_0x34028a);});});}exports[_0xc065('0x12')]=function(_0x4599e4){var _0x19557c=this;return new Promise(function(_0x3598d2,_0x4e3b6a){return db[_0xc065('0x13')][_0xc065('0x14')](_0x4599e4[_0xc065('0x15')],{'raw':_0x4599e4['options']?_0x4599e4[_0xc065('0x16')]['raw']===undefined?!![]:![]:!![]})[_0xc065('0x17')](function(_0x44e67d){logger['info'](_0xc065('0x12'),_0x4599e4);logger[_0xc065('0x18')](_0xc065('0x12'),_0x4599e4,JSON['stringify'](_0x44e67d));_0x3598d2(_0x44e67d);})['catch'](function(_0x152c7d){logger[_0xc065('0xd')](_0xc065('0x12'),_0x152c7d['message'],_0x4599e4);_0x4e3b6a(_0x19557c[_0xc065('0xd')](0x1f4,_0x152c7d[_0xc065('0x10')]));});});};exports['UpdateSquareReport']=function(_0x22d85e){var _0x2d336b=this;return new Promise(function(_0xe46e49,_0x1aaaa7){return db[_0xc065('0x13')][_0xc065('0x19')](_0x22d85e[_0xc065('0x15')],{'raw':_0x22d85e[_0xc065('0x16')]?_0x22d85e[_0xc065('0x16')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22d85e[_0xc065('0x16')]?_0x22d85e[_0xc065('0x16')][_0xc065('0x1a')]||null:null,'attributes':_0x22d85e[_0xc065('0x16')]?_0x22d85e[_0xc065('0x16')][_0xc065('0x1b')]||null:null,'limit':_0x22d85e[_0xc065('0x16')]?_0x22d85e[_0xc065('0x16')][_0xc065('0x1c')]||null:null})[_0xc065('0x17')](function(_0x5799c4){logger[_0xc065('0xa')](_0xc065('0x1d'),_0x22d85e);logger['debug'](_0xc065('0x1d'),_0x22d85e,JSON[_0xc065('0x1e')](_0x5799c4));_0xe46e49(_0x5799c4);})[_0xc065('0x11')](function(_0x5a8033){logger[_0xc065('0xd')]('UpdateSquareReport',_0x5a8033[_0xc065('0x10')],_0x22d85e);_0x1aaaa7(_0x2d336b[_0xc065('0xd')](0x1f4,_0x5a8033[_0xc065('0x10')]));});});}; \ No newline at end of file +var _0xd45f=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','SquareReport,\x20%s,\x20%s,\x20%s','code','error','SquareReport,\x20%s,\x20%s','message','result','catch','CreateSquareReport','SquareReport','body','options','raw','debug','stringify','update','attributes','limit','UpdateSquareReport','lodash','util','bluebird','ioredis','../../config/utils'];(function(_0x4baf3f,_0x10ee69){var _0x3eb230=function(_0x439f2a){while(--_0x439f2a){_0x4baf3f['push'](_0x4baf3f['shift']());}};_0x3eb230(++_0x10ee69);}(_0xd45f,0x1ea));var _0xfd45=function(_0x5565c8,_0x2df53f){_0x5565c8=_0x5565c8-0x0;var _0x255efc=_0xd45f[_0x5565c8];return _0x255efc;};'use strict';var _=require(_0xfd45('0x0'));var util=require(_0xfd45('0x1'));var moment=require('moment');var BPromise=require(_0xfd45('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfd45('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xfd45('0x4'));var logger=require(_0xfd45('0x5'))(_0xfd45('0x6'));var config=require(_0xfd45('0x7'));var jayson=require(_0xfd45('0x8'));var client=jayson[_0xfd45('0x9')][_0xfd45('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x40add5,_0x1a8d75,_0x162acc){return new BPromise(function(_0x98747,_0x5db191){return client[_0xfd45('0xb')](_0x40add5,_0x162acc)[_0xfd45('0xc')](function(_0xee7ea5){logger[_0xfd45('0xd')]('SquareReport,\x20%s,\x20%s',_0x1a8d75,_0xfd45('0xe'));logger['debug'](_0xfd45('0xf'),_0x1a8d75,_0xfd45('0xe'),JSON['stringify'](_0xee7ea5));if(_0xee7ea5['error']){if(_0xee7ea5['error'][_0xfd45('0x10')]===0x1f4){logger[_0xfd45('0x11')](_0xfd45('0x12'),_0x1a8d75,_0xee7ea5[_0xfd45('0x11')][_0xfd45('0x13')]);return _0x5db191(_0xee7ea5[_0xfd45('0x11')][_0xfd45('0x13')]);}logger[_0xfd45('0x11')]('SquareReport,\x20%s,\x20%s',_0x1a8d75,_0xee7ea5[_0xfd45('0x11')][_0xfd45('0x13')]);return _0x98747(_0xee7ea5[_0xfd45('0x11')][_0xfd45('0x13')]);}else{logger['info'](_0xfd45('0x12'),_0x1a8d75,_0xfd45('0xe'));_0x98747(_0xee7ea5[_0xfd45('0x14')]['message']);}})[_0xfd45('0x15')](function(_0x25cfc9){logger[_0xfd45('0x11')](_0xfd45('0x12'),_0x1a8d75,_0x25cfc9);_0x5db191(_0x25cfc9);});});}exports[_0xfd45('0x16')]=function(_0x23e93a){var _0x36281e=this;return new Promise(function(_0x46840e,_0x3da1b6){return db[_0xfd45('0x17')]['create'](_0x23e93a[_0xfd45('0x18')],{'raw':_0x23e93a[_0xfd45('0x19')]?_0x23e93a[_0xfd45('0x19')][_0xfd45('0x1a')]===undefined?!![]:![]:!![]})['then'](function(_0x348aa8){logger['info'](_0xfd45('0x16'),_0x23e93a);logger[_0xfd45('0x1b')](_0xfd45('0x16'),_0x23e93a,JSON[_0xfd45('0x1c')](_0x348aa8));_0x46840e(_0x348aa8);})[_0xfd45('0x15')](function(_0x9a21cb){logger[_0xfd45('0x11')](_0xfd45('0x16'),_0x9a21cb[_0xfd45('0x13')],_0x23e93a);_0x3da1b6(_0x36281e[_0xfd45('0x11')](0x1f4,_0x9a21cb[_0xfd45('0x13')]));});});};exports['UpdateSquareReport']=function(_0x9c5531){var _0x5ec6f3=this;return new Promise(function(_0xca4354,_0x2a5a0a){return db[_0xfd45('0x17')][_0xfd45('0x1d')](_0x9c5531[_0xfd45('0x18')],{'raw':_0x9c5531[_0xfd45('0x19')]?_0x9c5531[_0xfd45('0x19')][_0xfd45('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x9c5531['options']?_0x9c5531[_0xfd45('0x19')]['where']||null:null,'attributes':_0x9c5531[_0xfd45('0x19')]?_0x9c5531[_0xfd45('0x19')][_0xfd45('0x1e')]||null:null,'limit':_0x9c5531[_0xfd45('0x19')]?_0x9c5531[_0xfd45('0x19')][_0xfd45('0x1f')]||null:null})['then'](function(_0x258e5f){logger['info'](_0xfd45('0x20'),_0x9c5531);logger[_0xfd45('0x1b')](_0xfd45('0x20'),_0x9c5531,JSON[_0xfd45('0x1c')](_0x258e5f));_0xca4354(_0x258e5f);})['catch'](function(_0x2ccb31){logger['error'](_0xfd45('0x20'),_0x2ccb31[_0xfd45('0x13')],_0x9c5531);_0x2a5a0a(_0x5ec6f3['error'](0x1f4,_0x2ccb31[_0xfd45('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 0dfc9b2..e4da191 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 _0x7a54=['describe','/:id','create','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated'];(function(_0x277e13,_0x788eed){var _0x8c227c=function(_0x31d207){while(--_0x31d207){_0x277e13['push'](_0x277e13['shift']());}};_0x8c227c(++_0x788eed);}(_0x7a54,0x106));var _0x47a5=function(_0x3cabbe,_0x4cb381){_0x3cabbe=_0x3cabbe-0x0;var _0x2fa137=_0x7a54[_0x3cabbe];return _0x2fa137;};'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['show']);router['post']('/',auth[_0x47a5('0x9')](),controller[_0x47a5('0xc')]);router['put'](_0x47a5('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x47a5('0xd')](_0x47a5('0xb'),auth[_0x47a5('0x9')](),controller[_0x47a5('0xe')]);module[_0x47a5('0xf')]=router; \ No newline at end of file +var _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x24c146,_0x52da48){var _0x2873ca=function(_0x1a35b8){while(--_0x1a35b8){_0x24c146['push'](_0x24c146['shift']());}};_0x2873ca(++_0x52da48);}(_0x5f2f,0x73));var _0xf5f2=function(_0x1579ed,_0x541862){_0x1579ed=_0x1579ed-0x0;var _0x166279=_0x5f2f[_0x1579ed];return _0x166279;};'use strict';var multer=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var path=require(_0xf5f2('0x2'));var timeout=require(_0xf5f2('0x3'));var express=require(_0xf5f2('0x4'));var router=express[_0xf5f2('0x5')]();var auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index d4d563d..f25b95d 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 _0xced9=['STRING','exports'];(function(_0x1638da,_0x512875){var _0x392950=function(_0x13a1e6){while(--_0x13a1e6){_0x1638da['push'](_0x1638da['shift']());}};_0x392950(++_0x512875);}(_0xced9,0x101));var _0x9ced=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xced9[_0x481bf7];return _0x461787;};'use strict';var Sequelize=require('sequelize');module[_0x9ced('0x0')]={'uniqueid':{'type':Sequelize[_0x9ced('0x1')]},'node':{'type':Sequelize[_0x9ced('0x1')]},'application':{'type':Sequelize[_0x9ced('0x1')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x9ced('0x1')]},'callerid':{'type':Sequelize[_0x9ced('0x1')]}}; \ No newline at end of file +var _0x4c38=['STRING','sequelize','exports'];(function(_0x33359e,_0x57bf0a){var _0x40b61a=function(_0x3b8bc7){while(--_0x3b8bc7){_0x33359e['push'](_0x33359e['shift']());}};_0x40b61a(++_0x57bf0a);}(_0x4c38,0xd3));var _0x84c3=function(_0x1aaa57,_0x3b0b60){_0x1aaa57=_0x1aaa57-0x0;var _0x1e33ec=_0x4c38[_0x1aaa57];return _0x1e33ec;};'use strict';var Sequelize=require(_0x84c3('0x0'));module[_0x84c3('0x1')]={'uniqueid':{'type':Sequelize[_0x84c3('0x2')]},'node':{'type':Sequelize[_0x84c3('0x2')]},'application':{'type':Sequelize[_0x84c3('0x2')]},'data':{'type':Sequelize['TEXT']},'project_name':{'type':Sequelize[_0x84c3('0x2')]},'callerid':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index ebfaa44..e43fb38 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 _0x025f=['include','findAll','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','send','map','SquareDetailsReport','rawAttributes','fieldName','key','model','name','query','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll'];(function(_0x3200c4,_0x1e196b){var _0x24ae33=function(_0x47e90a){while(--_0x47e90a){_0x3200c4['push'](_0x3200c4['shift']());}};_0x24ae33(++_0x1e196b);}(_0x025f,0xa3));var _0xf025=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x025f[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xf025('0x0'));var emlformat=require(_0xf025('0x1'));var rimraf=require(_0xf025('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf025('0x3'));var rp=require(_0xf025('0x4'));var moment=require(_0xf025('0x5'));var BPromise=require(_0xf025('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf025('0x7'));var sox=require(_0xf025('0x8'));var csv=require('to-csv');var ejs=require(_0xf025('0x9'));var fs=require('fs');var _=require(_0xf025('0xa'));var squel=require(_0xf025('0xb'));var crypto=require(_0xf025('0xc'));var jsforce=require(_0xf025('0xd'));var deskjs=require(_0xf025('0xe'));var toCsv=require(_0xf025('0xf'));var querystring=require(_0xf025('0x10'));var Papa=require(_0xf025('0x11'));var Redis=require(_0xf025('0x12'));var authService=require(_0xf025('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xf025('0x14'));var hardwareService=require(_0xf025('0x15'));var logger=require(_0xf025('0x16'))(_0xf025('0x17'));var utils=require(_0xf025('0x18'));var config=require(_0xf025('0x19'));var db=require(_0xf025('0x1a'))['db'];function respondWithStatusCode(_0x5058d6,_0x1a5f0b){_0x1a5f0b=_0x1a5f0b||0xcc;return function(_0x59a989){if(_0x59a989){return _0x5058d6[_0xf025('0x1b')](_0x1a5f0b);}return _0x5058d6['status'](_0x1a5f0b)[_0xf025('0x1c')]();};}function respondWithResult(_0x28c866,_0x27e028){_0x27e028=_0x27e028||0xc8;return function(_0x4f6916){if(_0x4f6916){return _0x28c866[_0xf025('0x1d')](_0x27e028)[_0xf025('0x1e')](_0x4f6916);}};}function respondWithFilteredResult(_0x5eb663,_0x20d04c){return function(_0x5eb3ce){if(_0x5eb3ce){var _0x23ba99=_0x5eb3ce[_0xf025('0x1f')],_0x12e04a=_0x20d04c[_0xf025('0x20')],_0x326004=_0x20d04c[_0xf025('0x20')]+_0x20d04c[_0xf025('0x21')],_0x46d8f7;if(_0x326004>=_0x23ba99){_0x326004=_0x23ba99;_0x46d8f7=0xc8;}else{_0x46d8f7=0xce;}_0x5eb663['status'](_0x46d8f7);return _0x5eb663['set'](_0xf025('0x22'),_0x12e04a+'-'+_0x326004+'/'+_0x23ba99)[_0xf025('0x1e')](_0x5eb3ce);}return null;};}function patchUpdates(_0x5b29d1){return function(_0x506f77){try{jsonpatch['apply'](_0x506f77,_0x5b29d1,!![]);}catch(_0x3c9841){return BPromise[_0xf025('0x23')](_0x3c9841);}return _0x506f77[_0xf025('0x24')]();};}function saveUpdates(_0x53a8a2,_0x5ae51b){return function(_0x31e67f){if(_0x31e67f){return _0x31e67f[_0xf025('0x25')](_0x53a8a2)[_0xf025('0x26')](function(_0xf4ba29){return _0xf4ba29;});}return null;};}function removeEntity(_0x4ca808,_0x530f6a){return function(_0x51bb24){if(_0x51bb24){return _0x51bb24[_0xf025('0x27')]()[_0xf025('0x26')](function(){_0x4ca808[_0xf025('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x303008,_0x4da692){return function(_0x33593b){if(!_0x33593b){_0x303008[_0xf025('0x1b')](0x194);}return _0x33593b;};}function handleError(_0x4bc4,_0x4787c6){_0x4787c6=_0x4787c6||0x1f4;return function(_0x3f7a38){logger[_0xf025('0x28')](_0x3f7a38[_0xf025('0x29')]);if(_0x3f7a38['name']){delete _0x3f7a38['name'];}_0x4bc4['status'](_0x4787c6)[_0xf025('0x2a')](_0x3f7a38);};}exports['index']=function(_0x1745df,_0x10b53b){var _0x4a3b8d={},_0x2b012d={},_0x4b4e2a={'count':0x0,'rows':[]};var _0x2ca61d=_[_0xf025('0x2b')](db[_0xf025('0x2c')][_0xf025('0x2d')],function(_0x41def6){return{'name':_0x41def6[_0xf025('0x2e')],'type':_0x41def6['type'][_0xf025('0x2f')]};});_0x2b012d[_0xf025('0x30')]=_[_0xf025('0x2b')](_0x2ca61d,_0xf025('0x31'));_0x2b012d['query']=_['keys'](_0x1745df[_0xf025('0x32')]);_0x2b012d[_0xf025('0x33')]=_[_0xf025('0x34')](_0x2b012d[_0xf025('0x30')],_0x2b012d[_0xf025('0x32')]);_0x4a3b8d['attributes']=_[_0xf025('0x34')](_0x2b012d['model'],qs['fields'](_0x1745df[_0xf025('0x32')][_0xf025('0x35')]));_0x4a3b8d[_0xf025('0x36')]=_0x4a3b8d['attributes'][_0xf025('0x37')]?_0x4a3b8d[_0xf025('0x36')]:_0x2b012d[_0xf025('0x30')];if(!_0x1745df['query'][_0xf025('0x38')]('nolimit')){_0x4a3b8d[_0xf025('0x21')]=qs[_0xf025('0x21')](_0x1745df['query'][_0xf025('0x21')]);_0x4a3b8d['offset']=qs[_0xf025('0x20')](_0x1745df[_0xf025('0x32')]['offset']);}_0x4a3b8d[_0xf025('0x39')]=qs[_0xf025('0x3a')](_0x1745df[_0xf025('0x32')][_0xf025('0x3a')]);_0x4a3b8d[_0xf025('0x3b')]=qs[_0xf025('0x33')](_[_0xf025('0x3c')](_0x1745df[_0xf025('0x32')],_0x2b012d[_0xf025('0x33')]));if(_0x1745df[_0xf025('0x32')][_0xf025('0x3d')]){_0x4a3b8d[_0xf025('0x3b')]=_[_0xf025('0x3e')](_0x4a3b8d[_0xf025('0x3b')],{'$or':_[_0xf025('0x2b')](_0x2ca61d,function(_0x395b94){if(_0x395b94['type']!=='VIRTUAL'){var _0x505dcf={};_0x505dcf[_0x395b94[_0xf025('0x31')]]={'$like':'%'+_0x1745df[_0xf025('0x32')][_0xf025('0x3d')]+'%'};return _0x505dcf;}})});}_0x4a3b8d=_['merge']({},_0x4a3b8d,_0x1745df[_0xf025('0x3f')]);var _0x2b4e0f={'where':_0x4a3b8d[_0xf025('0x3b')]};return db['SquareDetailsReport'][_0xf025('0x1f')](_0x2b4e0f)[_0xf025('0x26')](function(_0x737944){_0x4b4e2a['count']=_0x737944;if(_0x1745df[_0xf025('0x32')][_0xf025('0x40')]){_0x4a3b8d[_0xf025('0x41')]=[{'all':!![]}];}return db[_0xf025('0x2c')][_0xf025('0x42')](_0x4a3b8d);})[_0xf025('0x26')](function(_0x29c6e5){_0x4b4e2a[_0xf025('0x43')]=_0x29c6e5;return _0x4b4e2a;})['then'](respondWithFilteredResult(_0x10b53b,_0x4a3b8d))[_0xf025('0x44')](handleError(_0x10b53b,null));};exports[_0xf025('0x45')]=function(_0x219ab2,_0x37b4fb){var _0x35e81e={'raw':!![],'where':{'id':_0x219ab2[_0xf025('0x46')]['id']}},_0x2844c9={};_0x2844c9[_0xf025('0x30')]=_[_0xf025('0x47')](db[_0xf025('0x2c')]['rawAttributes']);_0x2844c9[_0xf025('0x32')]=_['keys'](_0x219ab2[_0xf025('0x32')]);_0x2844c9[_0xf025('0x33')]=_[_0xf025('0x34')](_0x2844c9[_0xf025('0x30')],_0x2844c9[_0xf025('0x32')]);_0x35e81e[_0xf025('0x36')]=_['intersection'](_0x2844c9[_0xf025('0x30')],qs[_0xf025('0x35')](_0x219ab2['query'][_0xf025('0x35')]));_0x35e81e[_0xf025('0x36')]=_0x35e81e['attributes'][_0xf025('0x37')]?_0x35e81e[_0xf025('0x36')]:_0x2844c9[_0xf025('0x30')];if(_0x219ab2[_0xf025('0x32')][_0xf025('0x40')]){_0x35e81e[_0xf025('0x41')]=[{'all':!![]}];}_0x35e81e=_[_0xf025('0x3e')]({},_0x35e81e,_0x219ab2[_0xf025('0x3f')]);return db[_0xf025('0x2c')][_0xf025('0x48')](_0x35e81e)[_0xf025('0x26')](handleEntityNotFound(_0x37b4fb,null))['then'](respondWithResult(_0x37b4fb,null))['catch'](handleError(_0x37b4fb,null));};exports[_0xf025('0x49')]=function(_0x39e4cf,_0x43adf6){return db[_0xf025('0x2c')][_0xf025('0x49')](_0x39e4cf['body'],{})[_0xf025('0x26')](respondWithResult(_0x43adf6,0xc9))[_0xf025('0x44')](handleError(_0x43adf6,null));};exports[_0xf025('0x25')]=function(_0x84aad9,_0x5339ac){if(_0x84aad9[_0xf025('0x4a')]['id']){delete _0x84aad9[_0xf025('0x4a')]['id'];}return db['SquareDetailsReport'][_0xf025('0x48')]({'where':{'id':_0x84aad9[_0xf025('0x46')]['id']}})[_0xf025('0x26')](handleEntityNotFound(_0x5339ac,null))[_0xf025('0x26')](saveUpdates(_0x84aad9[_0xf025('0x4a')],null))[_0xf025('0x26')](respondWithResult(_0x5339ac,null))[_0xf025('0x44')](handleError(_0x5339ac,null));};exports[_0xf025('0x27')]=function(_0x596033,_0x726a1f){return db[_0xf025('0x2c')][_0xf025('0x48')]({'where':{'id':_0x596033[_0xf025('0x46')]['id']}})[_0xf025('0x26')](handleEntityNotFound(_0x726a1f,null))[_0xf025('0x26')](removeEntity(_0x726a1f,null))['catch'](handleError(_0x726a1f,null));};exports[_0xf025('0x4b')]=function(_0x2636e5,_0x149511){return db[_0xf025('0x2c')][_0xf025('0x4b')]()[_0xf025('0x26')](respondWithResult(_0x149511,null))[_0xf025('0x44')](handleError(_0x149511,null));}; \ No newline at end of file +var _0x958d=['bluebird','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','SquareDetailsReport','rawAttributes','fieldName','type','key','keys','model','query','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','filters','filter','VIRTUAL','options','includeAll','include','findAll','show','params','merge','catch','create','body','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment'];(function(_0x5006b1,_0x2adc14){var _0x3c4d20=function(_0x491e8c){while(--_0x491e8c){_0x5006b1['push'](_0x5006b1['shift']());}};_0x3c4d20(++_0x2adc14);}(_0x958d,0x1ab));var _0xd958=function(_0x3697a6,_0x12110c){_0x3697a6=_0x3697a6-0x0;var _0x2a3e8d=_0x958d[_0x3697a6];return _0x2a3e8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd958('0x0'));var rimraf=require(_0xd958('0x1'));var zipdir=require(_0xd958('0x2'));var jsonpatch=require(_0xd958('0x3'));var rp=require('request-promise');var moment=require(_0xd958('0x4'));var BPromise=require(_0xd958('0x5'));var Mustache=require('mustache');var util=require(_0xd958('0x6'));var path=require(_0xd958('0x7'));var sox=require(_0xd958('0x8'));var csv=require('to-csv');var ejs=require(_0xd958('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd958('0xa'));var jsforce=require(_0xd958('0xb'));var deskjs=require(_0xd958('0xc'));var toCsv=require(_0xd958('0xd'));var querystring=require(_0xd958('0xe'));var Papa=require(_0xd958('0xf'));var Redis=require(_0xd958('0x10'));var authService=require(_0xd958('0x11'));var qs=require(_0xd958('0x12'));var as=require(_0xd958('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xd958('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x11c773,_0xd2ea4d){_0xd2ea4d=_0xd2ea4d||0xcc;return function(_0x524e37){if(_0x524e37){return _0x11c773[_0xd958('0x15')](_0xd2ea4d);}return _0x11c773[_0xd958('0x16')](_0xd2ea4d)[_0xd958('0x17')]();};}function respondWithResult(_0x495f78,_0x38791b){_0x38791b=_0x38791b||0xc8;return function(_0x3c9ae2){if(_0x3c9ae2){return _0x495f78['status'](_0x38791b)[_0xd958('0x18')](_0x3c9ae2);}};}function respondWithFilteredResult(_0x5017df,_0x4e1a3f){return function(_0x1a3a72){if(_0x1a3a72){var _0x2c3f12=_0x1a3a72[_0xd958('0x19')],_0x421bc5=_0x4e1a3f[_0xd958('0x1a')],_0x22b06b=_0x4e1a3f[_0xd958('0x1a')]+_0x4e1a3f[_0xd958('0x1b')],_0x1e1079;if(_0x22b06b>=_0x2c3f12){_0x22b06b=_0x2c3f12;_0x1e1079=0xc8;}else{_0x1e1079=0xce;}_0x5017df[_0xd958('0x16')](_0x1e1079);return _0x5017df[_0xd958('0x1c')](_0xd958('0x1d'),_0x421bc5+'-'+_0x22b06b+'/'+_0x2c3f12)[_0xd958('0x18')](_0x1a3a72);}return null;};}function patchUpdates(_0x67cce1){return function(_0x38cab5){try{jsonpatch[_0xd958('0x1e')](_0x38cab5,_0x67cce1,!![]);}catch(_0x25fe05){return BPromise['reject'](_0x25fe05);}return _0x38cab5[_0xd958('0x1f')]();};}function saveUpdates(_0x1c23cd,_0x3ba0af){return function(_0x441787){if(_0x441787){return _0x441787[_0xd958('0x20')](_0x1c23cd)[_0xd958('0x21')](function(_0x40fd47){return _0x40fd47;});}return null;};}function removeEntity(_0x3bc631,_0x3110e7){return function(_0x147a4f){if(_0x147a4f){return _0x147a4f[_0xd958('0x22')]()[_0xd958('0x21')](function(){_0x3bc631[_0xd958('0x16')](0xcc)[_0xd958('0x17')]();});}};}function handleEntityNotFound(_0x5ca65a,_0x5420f1){return function(_0x25274b){if(!_0x25274b){_0x5ca65a[_0xd958('0x15')](0x194);}return _0x25274b;};}function handleError(_0x2ac688,_0x2922dc){_0x2922dc=_0x2922dc||0x1f4;return function(_0x263604){logger[_0xd958('0x23')](_0x263604[_0xd958('0x24')]);if(_0x263604['name']){delete _0x263604[_0xd958('0x25')];}_0x2ac688[_0xd958('0x16')](_0x2922dc)[_0xd958('0x26')](_0x263604);};}exports[_0xd958('0x27')]=function(_0x525dfa,_0x3d7fc){var _0x344199={},_0x2d7b4e={},_0x256321={'count':0x0,'rows':[]};var _0x32b6f2=_[_0xd958('0x28')](db[_0xd958('0x29')][_0xd958('0x2a')],function(_0x215508){return{'name':_0x215508[_0xd958('0x2b')],'type':_0x215508[_0xd958('0x2c')][_0xd958('0x2d')]};});_0x2d7b4e['model']=_[_0xd958('0x28')](_0x32b6f2,'name');_0x2d7b4e['query']=_[_0xd958('0x2e')](_0x525dfa['query']);_0x2d7b4e['filters']=_['intersection'](_0x2d7b4e[_0xd958('0x2f')],_0x2d7b4e[_0xd958('0x30')]);_0x344199['attributes']=_[_0xd958('0x31')](_0x2d7b4e['model'],qs['fields'](_0x525dfa[_0xd958('0x30')][_0xd958('0x32')]));_0x344199['attributes']=_0x344199[_0xd958('0x33')][_0xd958('0x34')]?_0x344199[_0xd958('0x33')]:_0x2d7b4e[_0xd958('0x2f')];if(!_0x525dfa['query'][_0xd958('0x35')]('nolimit')){_0x344199[_0xd958('0x1b')]=qs[_0xd958('0x1b')](_0x525dfa[_0xd958('0x30')][_0xd958('0x1b')]);_0x344199['offset']=qs['offset'](_0x525dfa[_0xd958('0x30')][_0xd958('0x1a')]);}_0x344199[_0xd958('0x36')]=qs[_0xd958('0x37')](_0x525dfa[_0xd958('0x30')][_0xd958('0x37')]);_0x344199[_0xd958('0x38')]=qs[_0xd958('0x39')](_['pick'](_0x525dfa[_0xd958('0x30')],_0x2d7b4e['filters']));if(_0x525dfa[_0xd958('0x30')][_0xd958('0x3a')]){_0x344199['where']=_['merge'](_0x344199[_0xd958('0x38')],{'$or':_[_0xd958('0x28')](_0x32b6f2,function(_0x11fc6c){if(_0x11fc6c[_0xd958('0x2c')]!==_0xd958('0x3b')){var _0x251f51={};_0x251f51[_0x11fc6c[_0xd958('0x25')]]={'$like':'%'+_0x525dfa[_0xd958('0x30')][_0xd958('0x3a')]+'%'};return _0x251f51;}})});}_0x344199=_['merge']({},_0x344199,_0x525dfa[_0xd958('0x3c')]);var _0x2bed79={'where':_0x344199['where']};return db[_0xd958('0x29')]['count'](_0x2bed79)[_0xd958('0x21')](function(_0x1e069f){_0x256321[_0xd958('0x19')]=_0x1e069f;if(_0x525dfa[_0xd958('0x30')][_0xd958('0x3d')]){_0x344199[_0xd958('0x3e')]=[{'all':!![]}];}return db[_0xd958('0x29')][_0xd958('0x3f')](_0x344199);})[_0xd958('0x21')](function(_0xbe23c7){_0x256321['rows']=_0xbe23c7;return _0x256321;})['then'](respondWithFilteredResult(_0x3d7fc,_0x344199))['catch'](handleError(_0x3d7fc,null));};exports[_0xd958('0x40')]=function(_0x52e970,_0x4e51a8){var _0x4b1b28={'raw':!![],'where':{'id':_0x52e970[_0xd958('0x41')]['id']}},_0x385276={};_0x385276['model']=_[_0xd958('0x2e')](db[_0xd958('0x29')][_0xd958('0x2a')]);_0x385276[_0xd958('0x30')]=_[_0xd958('0x2e')](_0x52e970[_0xd958('0x30')]);_0x385276[_0xd958('0x39')]=_['intersection'](_0x385276[_0xd958('0x2f')],_0x385276[_0xd958('0x30')]);_0x4b1b28['attributes']=_['intersection'](_0x385276['model'],qs[_0xd958('0x32')](_0x52e970[_0xd958('0x30')][_0xd958('0x32')]));_0x4b1b28[_0xd958('0x33')]=_0x4b1b28[_0xd958('0x33')][_0xd958('0x34')]?_0x4b1b28[_0xd958('0x33')]:_0x385276[_0xd958('0x2f')];if(_0x52e970[_0xd958('0x30')][_0xd958('0x3d')]){_0x4b1b28['include']=[{'all':!![]}];}_0x4b1b28=_[_0xd958('0x42')]({},_0x4b1b28,_0x52e970[_0xd958('0x3c')]);return db[_0xd958('0x29')]['find'](_0x4b1b28)[_0xd958('0x21')](handleEntityNotFound(_0x4e51a8,null))[_0xd958('0x21')](respondWithResult(_0x4e51a8,null))[_0xd958('0x43')](handleError(_0x4e51a8,null));};exports[_0xd958('0x44')]=function(_0x56427f,_0x17554b){return db[_0xd958('0x29')][_0xd958('0x44')](_0x56427f[_0xd958('0x45')],{})['then'](respondWithResult(_0x17554b,0xc9))[_0xd958('0x43')](handleError(_0x17554b,null));};exports[_0xd958('0x20')]=function(_0x441946,_0x2efd86){if(_0x441946[_0xd958('0x45')]['id']){delete _0x441946[_0xd958('0x45')]['id'];}return db[_0xd958('0x29')][_0xd958('0x46')]({'where':{'id':_0x441946['params']['id']}})['then'](handleEntityNotFound(_0x2efd86,null))[_0xd958('0x21')](saveUpdates(_0x441946['body'],null))[_0xd958('0x21')](respondWithResult(_0x2efd86,null))[_0xd958('0x43')](handleError(_0x2efd86,null));};exports[_0xd958('0x22')]=function(_0x2066be,_0x3ffd83){return db[_0xd958('0x29')]['find']({'where':{'id':_0x2066be['params']['id']}})[_0xd958('0x21')](handleEntityNotFound(_0x3ffd83,null))[_0xd958('0x21')](removeEntity(_0x3ffd83,null))[_0xd958('0x43')](handleError(_0x3ffd83,null));};exports[_0xd958('0x47')]=function(_0x3b1424,_0x1ac3a2){return db[_0xd958('0x29')][_0xd958('0x47')]()[_0xd958('0x21')](respondWithResult(_0x1ac3a2,null))[_0xd958('0x43')](handleError(_0x1ac3a2,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index db2e603..c36173c 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 _0x39c3=['report_square_details','util','path','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x31172d,_0x48f3e6){var _0x1b7fc6=function(_0x2739fc){while(--_0x2739fc){_0x31172d['push'](_0x31172d['shift']());}};_0x1b7fc6(++_0x48f3e6);}(_0x39c3,0x179));var _0x339c=function(_0x2ab3d9,_0x50e716){_0x2ab3d9=_0x2ab3d9-0x0;var _0x210a54=_0x39c3[_0x2ab3d9];return _0x210a54;};'use strict';var _=require('lodash');var util=require(_0x339c('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x339c('0x1'));var rimraf=require('rimraf');var config=require(_0x339c('0x2'));var attributes=require(_0x339c('0x3'));module[_0x339c('0x4')]=function(_0x5e4ea9,_0x3c4079){return _0x5e4ea9[_0x339c('0x5')](_0x339c('0x6'),attributes,{'tableName':_0x339c('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8c93=['report_square_details','util','api','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define'];(function(_0x119705,_0xba9427){var _0x2affc2=function(_0x16f7e2){while(--_0x16f7e2){_0x119705['push'](_0x119705['shift']());}};_0x2affc2(++_0xba9427);}(_0x8c93,0x64));var _0x38c9=function(_0x29bed8,_0x38a913){_0x29bed8=_0x29bed8-0x0;var _0x3b8d0a=_0x8c93[_0x29bed8];return _0x3b8d0a;};'use strict';var _=require('lodash');var util=require(_0x38c9('0x0'));var logger=require('../../config/logger')(_0x38c9('0x1'));var moment=require('moment');var BPromise=require(_0x38c9('0x2'));var rp=require(_0x38c9('0x3'));var fs=require('fs');var path=require(_0x38c9('0x4'));var rimraf=require(_0x38c9('0x5'));var config=require(_0x38c9('0x6'));var attributes=require(_0x38c9('0x7'));module[_0x38c9('0x8')]=function(_0x599633,_0x1612b7){return _0x599633[_0x38c9('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x38c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index c2c4be2..c6893a4 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 _0xec52=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','info','result','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc'];(function(_0x608bc9,_0x3ac1ab){var _0x53aef9=function(_0x4891d1){while(--_0x4891d1){_0x608bc9['push'](_0x608bc9['shift']());}};_0x53aef9(++_0x3ac1ab);}(_0xec52,0x171));var _0x2ec5=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0xec52[_0x502c7d];return _0x30b7ed;};'use strict';var _=require(_0x2ec5('0x0'));var util=require(_0x2ec5('0x1'));var moment=require(_0x2ec5('0x2'));var BPromise=require(_0x2ec5('0x3'));var rs=require(_0x2ec5('0x4'));var fs=require('fs');var Redis=require(_0x2ec5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2ec5('0x6'));var logger=require('../../config/logger')(_0x2ec5('0x7'));var config=require(_0x2ec5('0x8'));var jayson=require(_0x2ec5('0x9'));var client=jayson[_0x2ec5('0xa')][_0x2ec5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3ec407,_0xfa37eb,_0x10ea62){return new BPromise(function(_0x167d63,_0xffdd25){return client[_0x2ec5('0xc')](_0x3ec407,_0x10ea62)[_0x2ec5('0xd')](function(_0x1f1942){logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0xfa37eb,_0x2ec5('0xe'));logger[_0x2ec5('0xf')](_0x2ec5('0x10'),_0xfa37eb,_0x2ec5('0xe'),JSON[_0x2ec5('0x11')](_0x1f1942));if(_0x1f1942[_0x2ec5('0x12')]){if(_0x1f1942[_0x2ec5('0x12')]['code']===0x1f4){logger[_0x2ec5('0x12')](_0x2ec5('0x13'),_0xfa37eb,_0x1f1942['error'][_0x2ec5('0x14')]);return _0xffdd25(_0x1f1942[_0x2ec5('0x12')][_0x2ec5('0x14')]);}logger['error'](_0x2ec5('0x13'),_0xfa37eb,_0x1f1942[_0x2ec5('0x12')]['message']);return _0x167d63(_0x1f1942[_0x2ec5('0x12')][_0x2ec5('0x14')]);}else{logger[_0x2ec5('0x15')]('SquareDetailsReport,\x20%s,\x20%s',_0xfa37eb,_0x2ec5('0xe'));_0x167d63(_0x1f1942[_0x2ec5('0x16')]['message']);}})['catch'](function(_0x411b14){logger[_0x2ec5('0x12')](_0x2ec5('0x13'),_0xfa37eb,_0x411b14);_0xffdd25(_0x411b14);});});}exports[_0x2ec5('0x17')]=function(_0x1e80ee){var _0x32a4b7=this;return new Promise(function(_0xf81dc2,_0xe55a4a){return db[_0x2ec5('0x18')][_0x2ec5('0x19')](_0x1e80ee[_0x2ec5('0x1a')],{'raw':_0x1e80ee['options']?_0x1e80ee[_0x2ec5('0x1b')]['raw']===undefined?!![]:![]:!![]})[_0x2ec5('0xd')](function(_0x432c25){logger['info'](_0x2ec5('0x17'),_0x1e80ee);logger[_0x2ec5('0xf')](_0x2ec5('0x17'),_0x1e80ee,JSON[_0x2ec5('0x11')](_0x432c25));_0xf81dc2(_0x432c25);})[_0x2ec5('0x1c')](function(_0x2c7f29){logger[_0x2ec5('0x12')](_0x2ec5('0x17'),_0x2c7f29[_0x2ec5('0x14')],_0x1e80ee);_0xe55a4a(_0x32a4b7[_0x2ec5('0x12')](0x1f4,_0x2c7f29[_0x2ec5('0x14')]));});});}; \ No newline at end of file +var _0xbcae=['SquareDetailsReport','create','body','options','raw','CreateSquareDetailsReport','catch','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0x1b76e6,_0x598520){var _0x333b53=function(_0x106e6a){while(--_0x106e6a){_0x1b76e6['push'](_0x1b76e6['shift']());}};_0x333b53(++_0x598520);}(_0xbcae,0xaf));var _0xebca=function(_0x50a3c8,_0x525c1b){_0x50a3c8=_0x50a3c8-0x0;var _0x5318d5=_0xbcae[_0x50a3c8];return _0x5318d5;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xebca('0x0'));var rs=require(_0xebca('0x1'));var fs=require('fs');var Redis=require(_0xebca('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xebca('0x3'));var logger=require(_0xebca('0x4'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xebca('0x5')]({'port':0x232a});function respondWithRpcPromise(_0x4f1c04,_0x527cff,_0x19b7b8){return new BPromise(function(_0x301f17,_0x2a2f48){return client[_0xebca('0x6')](_0x4f1c04,_0x19b7b8)['then'](function(_0x52a5f5){logger[_0xebca('0x7')]('SquareDetailsReport,\x20%s,\x20%s',_0x527cff,_0xebca('0x8'));logger[_0xebca('0x9')](_0xebca('0xa'),_0x527cff,_0xebca('0x8'),JSON[_0xebca('0xb')](_0x52a5f5));if(_0x52a5f5[_0xebca('0xc')]){if(_0x52a5f5[_0xebca('0xc')][_0xebca('0xd')]===0x1f4){logger['error'](_0xebca('0xe'),_0x527cff,_0x52a5f5['error'][_0xebca('0xf')]);return _0x2a2f48(_0x52a5f5[_0xebca('0xc')][_0xebca('0xf')]);}logger['error'](_0xebca('0xe'),_0x527cff,_0x52a5f5[_0xebca('0xc')]['message']);return _0x301f17(_0x52a5f5[_0xebca('0xc')][_0xebca('0xf')]);}else{logger[_0xebca('0x7')]('SquareDetailsReport,\x20%s,\x20%s',_0x527cff,'request\x20sent');_0x301f17(_0x52a5f5[_0xebca('0x10')][_0xebca('0xf')]);}})['catch'](function(_0xfe1571){logger['error'](_0xebca('0xe'),_0x527cff,_0xfe1571);_0x2a2f48(_0xfe1571);});});}exports['CreateSquareDetailsReport']=function(_0x3ebce2){var _0x15cb88=this;return new Promise(function(_0x1a5f30,_0x2a4fa5){return db[_0xebca('0x11')][_0xebca('0x12')](_0x3ebce2[_0xebca('0x13')],{'raw':_0x3ebce2[_0xebca('0x14')]?_0x3ebce2['options'][_0xebca('0x15')]===undefined?!![]:![]:!![]})['then'](function(_0x48c8af){logger[_0xebca('0x7')](_0xebca('0x16'),_0x3ebce2);logger[_0xebca('0x9')](_0xebca('0x16'),_0x3ebce2,JSON[_0xebca('0xb')](_0x48c8af));_0x1a5f30(_0x48c8af);})[_0xebca('0x17')](function(_0x45dc1b){logger[_0xebca('0xc')]('CreateSquareDetailsReport',_0x45dc1b[_0xebca('0xf')],_0x3ebce2);_0x2a4fa5(_0x15cb88[_0xebca('0xc')](0x1f4,_0x45dc1b[_0xebca('0xf')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index e6cf715..162dfa1 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 _0x7915=['killProcess','express','Router','../../components/auth/service','./system.controller','get','/process/:pid/kill','isAuthenticated'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x7915,0x1a9));var _0x5791=function(_0x569cf2,_0x4ea0c4){_0x569cf2=_0x569cf2-0x0;var _0x22547d=_0x7915[_0x569cf2];return _0x22547d;};'use strict';var express=require(_0x5791('0x0'));var router=express[_0x5791('0x1')]();var auth=require(_0x5791('0x2'));var controller=require(_0x5791('0x3'));router[_0x5791('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x5791('0x4')](_0x5791('0x5'),auth[_0x5791('0x6')](),controller[_0x5791('0x7')]);module['exports']=router; \ No newline at end of file +var _0x711c=['exports','express','Router','get','isAuthenticated','index','killProcess'];(function(_0x1bbe10,_0x339161){var _0x345669=function(_0xb5202f){while(--_0xb5202f){_0x1bbe10['push'](_0x1bbe10['shift']());}};_0x345669(++_0x339161);}(_0x711c,0x127));var _0xc711=function(_0x4c914a,_0x217d99){_0x4c914a=_0x4c914a-0x0;var _0x531e3d=_0x711c[_0x4c914a];return _0x531e3d;};'use strict';var express=require(_0xc711('0x0'));var router=express[_0xc711('0x1')]();var auth=require('../../components/auth/service');var controller=require('./system.controller');router[_0xc711('0x2')]('/',auth[_0xc711('0x3')](),controller[_0xc711('0x4')]);router[_0xc711('0x2')]('/process/:pid/kill',auth[_0xc711('0x3')](),controller[_0xc711('0x5')]);module[_0xc711('0x6')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index c3f241d..49c2d3e 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 _0x1e4c=['then','split','length','indexOf','format','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','Process\x20with\x20pid\x20%s\x20killed\x20correctly','systeminformation','child_process','exec','api','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','send','index','getAllData','status','catch','json','killProcess','components/import/cm','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid'];(function(_0x1a73ff,_0x2e5850){var _0x5042be=function(_0x274cb2){while(--_0x274cb2){_0x1a73ff['push'](_0x1a73ff['shift']());}};_0x5042be(++_0x2e5850);}(_0x1e4c,0x1bc));var _0xc1e4=function(_0x409828,_0x30be45){_0x409828=_0x409828-0x0;var _0x3c8046=_0x1e4c[_0x409828];return _0x3c8046;};'use strict';var info=require(_0xc1e4('0x0'));var exec=require(_0xc1e4('0x1'))[_0xc1e4('0x2')];var logger=require('../../config/logger')(_0xc1e4('0x3'));var util=require('util');var BPromise=require('bluebird');var _=require(_0xc1e4('0x4'));function handleError(_0xc7626b,_0x40d6fe,_0x510359){_0x40d6fe=_0x40d6fe||0x1f4;return function(_0x4100ca){logger[_0xc1e4('0x5')](_0xc1e4('0x6'),_0x510359,_0x40d6fe,util[_0xc1e4('0x7')](_0x4100ca,{'showHidden':![],'depth':null}));delete _0x4100ca[_0xc1e4('0x8')];_0xc7626b['status'](_0x40d6fe)[_0xc1e4('0x9')](_0x4100ca);};}exports[_0xc1e4('0xa')]=function(_0x3eaf2f,_0x54edb6){return info[_0xc1e4('0xb')]()['then'](function(_0x400d0b){return _0x54edb6[_0xc1e4('0xc')](0xc8)['json'](_0x400d0b);})[_0xc1e4('0xd')](function(_0x43127f){return _0x54edb6[_0xc1e4('0xc')](0x1f4)[_0xc1e4('0xe')](_0x43127f);});};exports[_0xc1e4('0xf')]=function(_0x1b735c,_0x53cb50){var _0x1819f4=[_0xc1e4('0x10')];return new BPromise(function(_0x28465b,_0xd6d777){return exec(util['format'](_0xc1e4('0x11'),_0x1b735c[_0xc1e4('0x12')][_0xc1e4('0x13')]),function(_0x2ba687,_0x4f7351,_0x2258ea){if(_0x2ba687){return _0xd6d777(_0x2ba687);}return _0x28465b(_0x4f7351);});})[_0xc1e4('0x14')](function(_0x264a5f){var _0x938763=![];var _0x34d21c=_0x264a5f[_0xc1e4('0x15')](/\n/);for(var _0x4cdc8a=0x0,_0x40ea41=_0x1819f4[_0xc1e4('0x16')];_0x4cdc8a<_0x40ea41,_0x938763===![];_0x4cdc8a+=0x1){if(_0x264a5f[_0xc1e4('0x17')](_0x1819f4[_0x4cdc8a])>=0x0){_0x938763=!![];}}if(!_0x938763){throw new Error(util[_0xc1e4('0x18')](_0xc1e4('0x19'),_0x1b735c['params'][_0xc1e4('0x13')]));}process[_0xc1e4('0x1a')](_0x1b735c[_0xc1e4('0x12')]['pid'],_0xc1e4('0x1b'));return _0x53cb50['status'](0xc8)[_0xc1e4('0xe')]({'message':util[_0xc1e4('0x18')](_0xc1e4('0x1c'),_0x1b735c['params'][_0xc1e4('0x13')])});})[_0xc1e4('0xd')](handleError(_0x53cb50,null,'killProcess'));}; \ No newline at end of file +var _0xc11a=['kill','SIGINT','json','exec','../../config/logger','api','lodash','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','index','getAllData','then','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xc11a,0x10b));var _0xac11=function(_0xb0de07,_0x3ca2a0){_0xb0de07=_0xb0de07-0x0;var _0x4633d8=_0xc11a[_0xb0de07];return _0x4633d8;};'use strict';var info=require('systeminformation');var exec=require('child_process')[_0xac11('0x0')];var logger=require(_0xac11('0x1'))(_0xac11('0x2'));var util=require('util');var BPromise=require('bluebird');var _=require(_0xac11('0x3'));function handleError(_0x4e7dfc,_0x2779db,_0x19e9f4){_0x2779db=_0x2779db||0x1f4;return function(_0x3d0b78){logger['error'](_0xac11('0x4'),_0x19e9f4,_0x2779db,util[_0xac11('0x5')](_0x3d0b78,{'showHidden':![],'depth':null}));delete _0x3d0b78[_0xac11('0x6')];_0x4e7dfc[_0xac11('0x7')](_0x2779db)['send'](_0x3d0b78);};}exports[_0xac11('0x8')]=function(_0x132ef6,_0x272e7b){return info[_0xac11('0x9')]()[_0xac11('0xa')](function(_0x542c74){return _0x272e7b[_0xac11('0x7')](0xc8)['json'](_0x542c74);})[_0xac11('0xb')](function(_0xba147d){return _0x272e7b[_0xac11('0x7')](0x1f4)['json'](_0xba147d);});};exports[_0xac11('0xc')]=function(_0x27acfb,_0x523992){var _0x1dcf39=[_0xac11('0xd')];return new BPromise(function(_0x1f98c8,_0x4080f3){return exec(util[_0xac11('0xe')](_0xac11('0xf'),_0x27acfb[_0xac11('0x10')][_0xac11('0x11')]),function(_0x5dccd3,_0x902557,_0x54184f){if(_0x5dccd3){return _0x4080f3(_0x5dccd3);}return _0x1f98c8(_0x902557);});})[_0xac11('0xa')](function(_0x5b2393){var _0x135752=![];var _0x271da6=_0x5b2393[_0xac11('0x12')](/\n/);for(var _0x53501c=0x0,_0x3dc6de=_0x1dcf39[_0xac11('0x13')];_0x53501c<_0x3dc6de,_0x135752===![];_0x53501c+=0x1){if(_0x5b2393['indexOf'](_0x1dcf39[_0x53501c])>=0x0){_0x135752=!![];}}if(!_0x135752){throw new Error(util[_0xac11('0xe')](_0xac11('0x14'),_0x27acfb[_0xac11('0x10')][_0xac11('0x11')]));}process[_0xac11('0x15')](_0x27acfb['params'][_0xac11('0x11')],_0xac11('0x16'));return _0x523992[_0xac11('0x7')](0xc8)[_0xac11('0x17')]({'message':util[_0xac11('0xe')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27acfb['params'][_0xac11('0x11')])});})[_0xac11('0xb')](handleError(_0x523992,null,_0xac11('0xc')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 5fc58a0..4ff9c68 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 _0x6f0d=['delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','index','/:id','isAuthenticated','show','post','put','update'];(function(_0x522e66,_0x1da1d5){var _0x53a624=function(_0x40966b){while(--_0x40966b){_0x522e66['push'](_0x522e66['shift']());}};_0x53a624(++_0x1da1d5);}(_0x6f0d,0x16c));var _0xd6f0=function(_0xf297ef,_0x3761d4){_0xf297ef=_0xf297ef-0x0;var _0x3ab206=_0x6f0d[_0xf297ef];return _0x3ab206;};'use strict';var multer=require('multer');var util=require(_0xd6f0('0x0'));var path=require(_0xd6f0('0x1'));var timeout=require(_0xd6f0('0x2'));var express=require(_0xd6f0('0x3'));var router=express['Router']();var auth=require(_0xd6f0('0x4'));var interaction=require(_0xd6f0('0x5'));var config=require(_0xd6f0('0x6'));var controller=require(_0xd6f0('0x7'));router[_0xd6f0('0x8')]('/',auth['isAuthenticated'](),controller[_0xd6f0('0x9')]);router['get'](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xc')]);router[_0xd6f0('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xd6f0('0xe')](_0xd6f0('0xa'),auth[_0xd6f0('0xb')](),controller[_0xd6f0('0xf')]);router[_0xd6f0('0x10')]('/:id',auth[_0xd6f0('0xb')](),controller[_0xd6f0('0x11')]);module[_0xd6f0('0x12')]=router; \ No newline at end of file +var _0x55e0=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55e0,0xdc));var _0x055e=function(_0x41cf16,_0x17ff65){_0x41cf16=_0x41cf16-0x0;var _0x54c205=_0x55e0[_0x41cf16];return _0x54c205;};'use strict';var multer=require(_0x055e('0x0'));var util=require(_0x055e('0x1'));var path=require(_0x055e('0x2'));var timeout=require(_0x055e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x055e('0x4'));var interaction=require(_0x055e('0x5'));var config=require(_0x055e('0x6'));var controller=require(_0x055e('0x7'));router[_0x055e('0x8')]('/',auth[_0x055e('0x9')](),controller['index']);router['get'](_0x055e('0xa'),auth['isAuthenticated'](),controller[_0x055e('0xb')]);router[_0x055e('0xc')]('/',auth[_0x055e('0x9')](),controller[_0x055e('0xd')]);router[_0x055e('0xe')]('/:id',auth[_0x055e('0x9')](),controller[_0x055e('0xf')]);router[_0x055e('0x10')](_0x055e('0xa'),auth[_0x055e('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index bae16d2..830f869 100644 --- a/server/api/tag/tag.attributes.js +++ b/server/api/tag/tag.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5c00=['STRING','sequelize','exports'];(function(_0x4eca83,_0x46750c){var _0x3ec0cd=function(_0x17e9d9){while(--_0x17e9d9){_0x4eca83['push'](_0x4eca83['shift']());}};_0x3ec0cd(++_0x46750c);}(_0x5c00,0x17e));var _0x05c0=function(_0xe455e7,_0x29fb65){_0xe455e7=_0xe455e7-0x0;var _0xfc683e=_0x5c00[_0xe455e7];return _0xfc683e;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'name':{'type':Sequelize[_0x05c0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file +var _0xbdb7=['name','#0091EA','sequelize','exports','STRING'];(function(_0x5b2544,_0x10be79){var _0x289d42=function(_0x2ea52b){while(--_0x2ea52b){_0x5b2544['push'](_0x5b2544['shift']());}};_0x289d42(++_0x10be79);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3e74d4,_0xfeb53){_0x3e74d4=_0x3e74d4-0x0;var _0x38adee=_0xbdb7[_0x3e74d4];return _0x38adee;};'use strict';var Sequelize=require(_0x7bdb('0x0'));module[_0x7bdb('0x1')]={'name':{'type':Sequelize[_0x7bdb('0x2')],'unique':_0x7bdb('0x3'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x7bdb('0x2')],'defaultValue':_0x7bdb('0x4')},'description':{'type':Sequelize[_0x7bdb('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index 325aa81..f1847c4 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 _0xbbe9=['options','Tag','includeAll','findAll','rows','catch','show','include','find','create','body','user','role','Tags','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range','reject','save','update','then','destroy','get','UserProfileResource','end','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x31de5e,_0x42ff0b){var _0x29f317=function(_0x2432cc){while(--_0x2432cc){_0x31de5e['push'](_0x31de5e['shift']());}};_0x29f317(++_0x42ff0b);}(_0xbbe9,0x100));var _0x9bbe=function(_0x4d613c,_0x55f220){_0x4d613c=_0x4d613c-0x0;var _0x301fe3=_0xbbe9[_0x4d613c];return _0x301fe3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bbe('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x9bbe('0x1'));var moment=require(_0x9bbe('0x2'));var BPromise=require(_0x9bbe('0x3'));var Mustache=require(_0x9bbe('0x4'));var util=require(_0x9bbe('0x5'));var path=require(_0x9bbe('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9bbe('0x7'));var fs=require('fs');var _=require(_0x9bbe('0x8'));var squel=require(_0x9bbe('0x9'));var crypto=require(_0x9bbe('0xa'));var jsforce=require(_0x9bbe('0xb'));var deskjs=require(_0x9bbe('0xc'));var toCsv=require(_0x9bbe('0xd'));var querystring=require(_0x9bbe('0xe'));var Papa=require(_0x9bbe('0xf'));var Redis=require(_0x9bbe('0x10'));var authService=require(_0x9bbe('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9bbe('0x12'));var hardwareService=require(_0x9bbe('0x13'));var logger=require(_0x9bbe('0x14'))('api');var utils=require('../../config/utils');var config=require(_0x9bbe('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x31f616,_0x50d20d){_0x50d20d=_0x50d20d||0xcc;return function(_0x1009ec){if(_0x1009ec){return _0x31f616[_0x9bbe('0x16')](_0x50d20d);}return _0x31f616[_0x9bbe('0x17')](_0x50d20d)['end']();};}function respondWithResult(_0x1fdae5,_0x494484){_0x494484=_0x494484||0xc8;return function(_0xb0dc86){if(_0xb0dc86){return _0x1fdae5[_0x9bbe('0x17')](_0x494484)[_0x9bbe('0x18')](_0xb0dc86);}};}function respondWithFilteredResult(_0xc67394,_0x15a4a5){return function(_0x2d1598){if(_0x2d1598){var _0x609523=_0x2d1598[_0x9bbe('0x19')],_0x558d5c=_0x15a4a5[_0x9bbe('0x1a')],_0x234eef=_0x15a4a5['offset']+_0x15a4a5['limit'],_0x1a18c1;if(_0x234eef>=_0x609523){_0x234eef=_0x609523;_0x1a18c1=0xc8;}else{_0x1a18c1=0xce;}_0xc67394[_0x9bbe('0x17')](_0x1a18c1);return _0xc67394[_0x9bbe('0x1b')](_0x9bbe('0x1c'),_0x558d5c+'-'+_0x234eef+'/'+_0x609523)[_0x9bbe('0x18')](_0x2d1598);}return null;};}function patchUpdates(_0x428fcd){return function(_0x572f45){try{jsonpatch['apply'](_0x572f45,_0x428fcd,!![]);}catch(_0x1b29ec){return BPromise[_0x9bbe('0x1d')](_0x1b29ec);}return _0x572f45[_0x9bbe('0x1e')]();};}function saveUpdates(_0x4d9b87,_0x1834da){return function(_0x3f4caf){if(_0x3f4caf){return _0x3f4caf[_0x9bbe('0x1f')](_0x4d9b87)[_0x9bbe('0x20')](function(_0x49425a){return _0x49425a;});}return null;};}function removeEntity(_0x5773bd,_0x1e4ef8){return function(_0x266d26){if(_0x266d26){return _0x266d26[_0x9bbe('0x21')]()[_0x9bbe('0x20')](function(){var _0xa326ec=_0x266d26[_0x9bbe('0x22')]({'plain':!![]});var _0x20c80a='Tags';return db[_0x9bbe('0x23')]['destroy']({'where':{'type':_0x20c80a,'resourceId':_0xa326ec['id']}})[_0x9bbe('0x20')](function(){return _0x266d26;});})['then'](function(){_0x5773bd[_0x9bbe('0x17')](0xcc)[_0x9bbe('0x24')]();});}};}function handleEntityNotFound(_0x394389,_0x15df7e){return function(_0x46266a){if(!_0x46266a){_0x394389[_0x9bbe('0x16')](0x194);}return _0x46266a;};}function handleError(_0x3c1468,_0x58ffd5){_0x58ffd5=_0x58ffd5||0x1f4;return function(_0x210b7a){logger[_0x9bbe('0x25')](_0x210b7a[_0x9bbe('0x26')]);if(_0x210b7a['name']){delete _0x210b7a[_0x9bbe('0x27')];}_0x3c1468[_0x9bbe('0x17')](_0x58ffd5)[_0x9bbe('0x28')](_0x210b7a);};}exports[_0x9bbe('0x29')]=function(_0x429745,_0x4b4dec){var _0x2121b9={},_0x2420ad={},_0x1ebcaf={'count':0x0,'rows':[]};var _0x1c3f68=_['map'](db['Tag'][_0x9bbe('0x2a')],function(_0x3c80ec){return{'name':_0x3c80ec[_0x9bbe('0x2b')],'type':_0x3c80ec[_0x9bbe('0x2c')][_0x9bbe('0x2d')]};});_0x2420ad[_0x9bbe('0x2e')]=_[_0x9bbe('0x2f')](_0x1c3f68,_0x9bbe('0x27'));_0x2420ad['query']=_['keys'](_0x429745[_0x9bbe('0x30')]);_0x2420ad[_0x9bbe('0x31')]=_[_0x9bbe('0x32')](_0x2420ad['model'],_0x2420ad['query']);_0x2121b9[_0x9bbe('0x33')]=_[_0x9bbe('0x32')](_0x2420ad['model'],qs[_0x9bbe('0x34')](_0x429745[_0x9bbe('0x30')][_0x9bbe('0x34')]));_0x2121b9[_0x9bbe('0x33')]=_0x2121b9[_0x9bbe('0x33')][_0x9bbe('0x35')]?_0x2121b9[_0x9bbe('0x33')]:_0x2420ad[_0x9bbe('0x2e')];if(!_0x429745[_0x9bbe('0x30')][_0x9bbe('0x36')](_0x9bbe('0x37'))){_0x2121b9[_0x9bbe('0x38')]=qs[_0x9bbe('0x38')](_0x429745[_0x9bbe('0x30')]['limit']);_0x2121b9[_0x9bbe('0x1a')]=qs[_0x9bbe('0x1a')](_0x429745[_0x9bbe('0x30')]['offset']);}_0x2121b9[_0x9bbe('0x39')]=qs[_0x9bbe('0x3a')](_0x429745['query'][_0x9bbe('0x3a')]);_0x2121b9[_0x9bbe('0x3b')]=qs[_0x9bbe('0x31')](_[_0x9bbe('0x3c')](_0x429745[_0x9bbe('0x30')],_0x2420ad[_0x9bbe('0x31')]));if(_0x429745[_0x9bbe('0x30')][_0x9bbe('0x3d')]){_0x2121b9[_0x9bbe('0x3b')]=_[_0x9bbe('0x3e')](_0x2121b9[_0x9bbe('0x3b')],{'$or':_['map'](_0x1c3f68,function(_0x59df6c){if(_0x59df6c['type']!==_0x9bbe('0x3f')){var _0x3a8a91={};_0x3a8a91[_0x59df6c[_0x9bbe('0x27')]]={'$like':'%'+_0x429745['query'][_0x9bbe('0x3d')]+'%'};return _0x3a8a91;}})});}_0x2121b9=_[_0x9bbe('0x3e')]({},_0x2121b9,_0x429745[_0x9bbe('0x40')]);var _0x4e9bdb={'where':_0x2121b9[_0x9bbe('0x3b')]};return db[_0x9bbe('0x41')][_0x9bbe('0x19')](_0x4e9bdb)[_0x9bbe('0x20')](function(_0x497351){_0x1ebcaf[_0x9bbe('0x19')]=_0x497351;if(_0x429745[_0x9bbe('0x30')][_0x9bbe('0x42')]){_0x2121b9['include']=[{'all':!![]}];}return db[_0x9bbe('0x41')][_0x9bbe('0x43')](_0x2121b9);})[_0x9bbe('0x20')](function(_0x9fe30e){_0x1ebcaf[_0x9bbe('0x44')]=_0x9fe30e;return _0x1ebcaf;})[_0x9bbe('0x20')](respondWithFilteredResult(_0x4b4dec,_0x2121b9))[_0x9bbe('0x45')](handleError(_0x4b4dec,null));};exports[_0x9bbe('0x46')]=function(_0x4eae84,_0x32fefd){var _0x254d25={'raw':!![],'where':{'id':_0x4eae84['params']['id']}},_0x37fc09={};_0x37fc09[_0x9bbe('0x2e')]=_['keys'](db[_0x9bbe('0x41')][_0x9bbe('0x2a')]);_0x37fc09['query']=_['keys'](_0x4eae84[_0x9bbe('0x30')]);_0x37fc09['filters']=_[_0x9bbe('0x32')](_0x37fc09[_0x9bbe('0x2e')],_0x37fc09[_0x9bbe('0x30')]);_0x254d25['attributes']=_['intersection'](_0x37fc09[_0x9bbe('0x2e')],qs['fields'](_0x4eae84[_0x9bbe('0x30')][_0x9bbe('0x34')]));_0x254d25['attributes']=_0x254d25[_0x9bbe('0x33')][_0x9bbe('0x35')]?_0x254d25[_0x9bbe('0x33')]:_0x37fc09[_0x9bbe('0x2e')];if(_0x4eae84[_0x9bbe('0x30')][_0x9bbe('0x42')]){_0x254d25[_0x9bbe('0x47')]=[{'all':!![]}];}_0x254d25=_[_0x9bbe('0x3e')]({},_0x254d25,_0x4eae84[_0x9bbe('0x40')]);return db[_0x9bbe('0x41')][_0x9bbe('0x48')](_0x254d25)[_0x9bbe('0x20')](handleEntityNotFound(_0x32fefd,null))[_0x9bbe('0x20')](respondWithResult(_0x32fefd,null))[_0x9bbe('0x45')](handleError(_0x32fefd,null));};exports[_0x9bbe('0x49')]=function(_0x2fefdc,_0x3060a4){return db['Tag'][_0x9bbe('0x49')](_0x2fefdc[_0x9bbe('0x4a')],{})[_0x9bbe('0x20')](function(_0x591aa3){var _0x4cf16e=_0x2fefdc[_0x9bbe('0x4b')][_0x9bbe('0x22')]({'plain':!![]});if(!_0x4cf16e)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4cf16e[_0x9bbe('0x4c')]===_0x9bbe('0x4b')){var _0x35621c=_0x591aa3[_0x9bbe('0x22')]({'plain':!![]});var _0x55f726=_0x9bbe('0x4d');return db['UserProfileSection'][_0x9bbe('0x48')]({'where':{'name':_0x55f726,'userProfileId':_0x4cf16e[_0x9bbe('0x4e')]},'raw':!![]})['then'](function(_0x1185c8){if(_0x1185c8&&_0x1185c8['autoAssociation']===0x0){return db[_0x9bbe('0x23')][_0x9bbe('0x49')]({'name':_0x35621c[_0x9bbe('0x27')],'resourceId':_0x35621c['id'],'type':_0x1185c8[_0x9bbe('0x27')],'sectionId':_0x1185c8['id']},{})[_0x9bbe('0x20')](function(){return _0x591aa3;});}else{return _0x591aa3;}})[_0x9bbe('0x45')](function(_0x1c18a3){logger['error'](_0x9bbe('0x4f'),_0x1c18a3);throw _0x1c18a3;});}return _0x591aa3;})[_0x9bbe('0x20')](respondWithResult(_0x3060a4,0xc9))[_0x9bbe('0x45')](handleError(_0x3060a4,null));};exports[_0x9bbe('0x1f')]=function(_0x8bcead,_0x2283de){if(_0x8bcead[_0x9bbe('0x4a')]['id']){delete _0x8bcead[_0x9bbe('0x4a')]['id'];}return db[_0x9bbe('0x41')][_0x9bbe('0x48')]({'where':{'id':_0x8bcead['params']['id']}})[_0x9bbe('0x20')](handleEntityNotFound(_0x2283de,null))[_0x9bbe('0x20')](saveUpdates(_0x8bcead[_0x9bbe('0x4a')],null))[_0x9bbe('0x20')](respondWithResult(_0x2283de,null))[_0x9bbe('0x45')](handleError(_0x2283de,null));};exports['destroy']=function(_0x1ea93a,_0x1ce08a){return db['Tag'][_0x9bbe('0x48')]({'where':{'id':_0x1ea93a['params']['id']}})[_0x9bbe('0x20')](handleEntityNotFound(_0x1ce08a,null))[_0x9bbe('0x20')](removeEntity(_0x1ce08a,null))['catch'](handleError(_0x1ce08a,null));}; \ No newline at end of file +var _0xe58f=['name','send','index','map','Tag','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filters','filter','merge','VIRTUAL','options','count','includeAll','include','rows','catch','show','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','limit','set','Content-Range','json','apply','reject','then','destroy','get','Tags','UserProfileResource','end','stack'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xe58f,0x1bb));var _0xfe58=function(_0x20c2b1,_0x2afc6f){_0x20c2b1=_0x20c2b1-0x0;var _0x54b682=_0xe58f[_0x20c2b1];return _0x54b682;};'use strict';var pdf=require(_0xfe58('0x0'));var emlformat=require(_0xfe58('0x1'));var rimraf=require(_0xfe58('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfe58('0x3'));var rp=require(_0xfe58('0x4'));var moment=require(_0xfe58('0x5'));var BPromise=require(_0xfe58('0x6'));var Mustache=require(_0xfe58('0x7'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xfe58('0x8'));var ejs=require(_0xfe58('0x9'));var fs=require('fs');var _=require(_0xfe58('0xa'));var squel=require('squel');var crypto=require(_0xfe58('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xfe58('0xc'));var toCsv=require(_0xfe58('0x8'));var querystring=require(_0xfe58('0xd'));var Papa=require(_0xfe58('0xe'));var Redis=require(_0xfe58('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfe58('0x10'));var as=require(_0xfe58('0x11'));var hardwareService=require(_0xfe58('0x12'));var logger=require(_0xfe58('0x13'))(_0xfe58('0x14'));var utils=require('../../config/utils');var config=require(_0xfe58('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e149,_0x1716a2){_0x1716a2=_0x1716a2||0xcc;return function(_0x5182ad){if(_0x5182ad){return _0x16e149[_0xfe58('0x16')](_0x1716a2);}return _0x16e149[_0xfe58('0x17')](_0x1716a2)['end']();};}function respondWithResult(_0x21ff15,_0x4c3b32){_0x4c3b32=_0x4c3b32||0xc8;return function(_0x397a2a){if(_0x397a2a){return _0x21ff15[_0xfe58('0x17')](_0x4c3b32)['json'](_0x397a2a);}};}function respondWithFilteredResult(_0x3c0263,_0x289407){return function(_0x577bda){if(_0x577bda){var _0x53b901=_0x577bda['count'],_0x192a44=_0x289407['offset'],_0x19c1b7=_0x289407['offset']+_0x289407[_0xfe58('0x18')],_0x36bc7a;if(_0x19c1b7>=_0x53b901){_0x19c1b7=_0x53b901;_0x36bc7a=0xc8;}else{_0x36bc7a=0xce;}_0x3c0263['status'](_0x36bc7a);return _0x3c0263[_0xfe58('0x19')](_0xfe58('0x1a'),_0x192a44+'-'+_0x19c1b7+'/'+_0x53b901)[_0xfe58('0x1b')](_0x577bda);}return null;};}function patchUpdates(_0x4833b7){return function(_0x493760){try{jsonpatch[_0xfe58('0x1c')](_0x493760,_0x4833b7,!![]);}catch(_0x153c77){return BPromise[_0xfe58('0x1d')](_0x153c77);}return _0x493760['save']();};}function saveUpdates(_0x1b0558,_0x201401){return function(_0x5e9f8c){if(_0x5e9f8c){return _0x5e9f8c['update'](_0x1b0558)[_0xfe58('0x1e')](function(_0x572dd9){return _0x572dd9;});}return null;};}function removeEntity(_0x39ff36,_0x46bf56){return function(_0x3bf7ff){if(_0x3bf7ff){return _0x3bf7ff[_0xfe58('0x1f')]()[_0xfe58('0x1e')](function(){var _0x4b68ac=_0x3bf7ff[_0xfe58('0x20')]({'plain':!![]});var _0x39f5dd=_0xfe58('0x21');return db[_0xfe58('0x22')][_0xfe58('0x1f')]({'where':{'type':_0x39f5dd,'resourceId':_0x4b68ac['id']}})[_0xfe58('0x1e')](function(){return _0x3bf7ff;});})[_0xfe58('0x1e')](function(){_0x39ff36['status'](0xcc)[_0xfe58('0x23')]();});}};}function handleEntityNotFound(_0x3b7017,_0x1c1eac){return function(_0x1dc48e){if(!_0x1dc48e){_0x3b7017[_0xfe58('0x16')](0x194);}return _0x1dc48e;};}function handleError(_0x45d39a,_0x507c5e){_0x507c5e=_0x507c5e||0x1f4;return function(_0x5515bb){logger['error'](_0x5515bb[_0xfe58('0x24')]);if(_0x5515bb[_0xfe58('0x25')]){delete _0x5515bb['name'];}_0x45d39a['status'](_0x507c5e)[_0xfe58('0x26')](_0x5515bb);};}exports[_0xfe58('0x27')]=function(_0x2e2ea1,_0x1a1c99){var _0x3a14d7={},_0x226f4e={},_0x539c16={'count':0x0,'rows':[]};var _0x2339c0=_[_0xfe58('0x28')](db[_0xfe58('0x29')][_0xfe58('0x2a')],function(_0x5710e7){return{'name':_0x5710e7[_0xfe58('0x2b')],'type':_0x5710e7[_0xfe58('0x2c')][_0xfe58('0x2d')]};});_0x226f4e[_0xfe58('0x2e')]=_[_0xfe58('0x28')](_0x2339c0,_0xfe58('0x25'));_0x226f4e[_0xfe58('0x2f')]=_[_0xfe58('0x30')](_0x2e2ea1[_0xfe58('0x2f')]);_0x226f4e['filters']=_[_0xfe58('0x31')](_0x226f4e[_0xfe58('0x2e')],_0x226f4e[_0xfe58('0x2f')]);_0x3a14d7[_0xfe58('0x32')]=_[_0xfe58('0x31')](_0x226f4e[_0xfe58('0x2e')],qs[_0xfe58('0x33')](_0x2e2ea1['query'][_0xfe58('0x33')]));_0x3a14d7['attributes']=_0x3a14d7[_0xfe58('0x32')][_0xfe58('0x34')]?_0x3a14d7['attributes']:_0x226f4e[_0xfe58('0x2e')];if(!_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x35')](_0xfe58('0x36'))){_0x3a14d7[_0xfe58('0x18')]=qs['limit'](_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x18')]);_0x3a14d7[_0xfe58('0x37')]=qs[_0xfe58('0x37')](_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x37')]);}_0x3a14d7[_0xfe58('0x38')]=qs[_0xfe58('0x39')](_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x39')]);_0x3a14d7[_0xfe58('0x3a')]=qs[_0xfe58('0x3b')](_['pick'](_0x2e2ea1['query'],_0x226f4e[_0xfe58('0x3b')]));if(_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x3c')]){_0x3a14d7[_0xfe58('0x3a')]=_[_0xfe58('0x3d')](_0x3a14d7[_0xfe58('0x3a')],{'$or':_[_0xfe58('0x28')](_0x2339c0,function(_0x1e434d){if(_0x1e434d[_0xfe58('0x2c')]!==_0xfe58('0x3e')){var _0x299e08={};_0x299e08[_0x1e434d[_0xfe58('0x25')]]={'$like':'%'+_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x3c')]+'%'};return _0x299e08;}})});}_0x3a14d7=_['merge']({},_0x3a14d7,_0x2e2ea1[_0xfe58('0x3f')]);var _0x481562={'where':_0x3a14d7[_0xfe58('0x3a')]};return db[_0xfe58('0x29')][_0xfe58('0x40')](_0x481562)[_0xfe58('0x1e')](function(_0x576119){_0x539c16[_0xfe58('0x40')]=_0x576119;if(_0x2e2ea1[_0xfe58('0x2f')][_0xfe58('0x41')]){_0x3a14d7[_0xfe58('0x42')]=[{'all':!![]}];}return db['Tag']['findAll'](_0x3a14d7);})[_0xfe58('0x1e')](function(_0x4718e1){_0x539c16[_0xfe58('0x43')]=_0x4718e1;return _0x539c16;})['then'](respondWithFilteredResult(_0x1a1c99,_0x3a14d7))[_0xfe58('0x44')](handleError(_0x1a1c99,null));};exports[_0xfe58('0x45')]=function(_0x1ea62b,_0x5d4e78){var _0x57c50d={'raw':!![],'where':{'id':_0x1ea62b['params']['id']}},_0x407a0c={};_0x407a0c[_0xfe58('0x2e')]=_['keys'](db[_0xfe58('0x29')][_0xfe58('0x2a')]);_0x407a0c[_0xfe58('0x2f')]=_[_0xfe58('0x30')](_0x1ea62b[_0xfe58('0x2f')]);_0x407a0c[_0xfe58('0x3b')]=_[_0xfe58('0x31')](_0x407a0c[_0xfe58('0x2e')],_0x407a0c[_0xfe58('0x2f')]);_0x57c50d[_0xfe58('0x32')]=_[_0xfe58('0x31')](_0x407a0c['model'],qs[_0xfe58('0x33')](_0x1ea62b[_0xfe58('0x2f')][_0xfe58('0x33')]));_0x57c50d[_0xfe58('0x32')]=_0x57c50d[_0xfe58('0x32')][_0xfe58('0x34')]?_0x57c50d['attributes']:_0x407a0c[_0xfe58('0x2e')];if(_0x1ea62b[_0xfe58('0x2f')]['includeAll']){_0x57c50d[_0xfe58('0x42')]=[{'all':!![]}];}_0x57c50d=_['merge']({},_0x57c50d,_0x1ea62b[_0xfe58('0x3f')]);return db[_0xfe58('0x29')]['find'](_0x57c50d)[_0xfe58('0x1e')](handleEntityNotFound(_0x5d4e78,null))[_0xfe58('0x1e')](respondWithResult(_0x5d4e78,null))[_0xfe58('0x44')](handleError(_0x5d4e78,null));};exports[_0xfe58('0x46')]=function(_0x69a081,_0x13ebd8){return db['Tag'][_0xfe58('0x46')](_0x69a081['body'],{})[_0xfe58('0x1e')](function(_0x42a2d9){var _0x2c71bf=_0x69a081[_0xfe58('0x47')][_0xfe58('0x20')]({'plain':!![]});if(!_0x2c71bf)throw new Error(_0xfe58('0x48'));if(_0x2c71bf[_0xfe58('0x49')]===_0xfe58('0x47')){var _0x4cac51=_0x42a2d9[_0xfe58('0x20')]({'plain':!![]});var _0x1e8b95=_0xfe58('0x21');return db[_0xfe58('0x4a')][_0xfe58('0x4b')]({'where':{'name':_0x1e8b95,'userProfileId':_0x2c71bf['userProfileId']},'raw':!![]})[_0xfe58('0x1e')](function(_0x3443f6){if(_0x3443f6&&_0x3443f6['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x4cac51[_0xfe58('0x25')],'resourceId':_0x4cac51['id'],'type':_0x3443f6[_0xfe58('0x25')],'sectionId':_0x3443f6['id']},{})[_0xfe58('0x1e')](function(){return _0x42a2d9;});}else{return _0x42a2d9;}})[_0xfe58('0x44')](function(_0x23c416){logger['error'](_0xfe58('0x4c'),_0x23c416);throw _0x23c416;});}return _0x42a2d9;})[_0xfe58('0x1e')](respondWithResult(_0x13ebd8,0xc9))[_0xfe58('0x44')](handleError(_0x13ebd8,null));};exports[_0xfe58('0x4d')]=function(_0x4f19c9,_0x5e612b){if(_0x4f19c9['body']['id']){delete _0x4f19c9[_0xfe58('0x4e')]['id'];}return db[_0xfe58('0x29')]['find']({'where':{'id':_0x4f19c9[_0xfe58('0x4f')]['id']}})[_0xfe58('0x1e')](handleEntityNotFound(_0x5e612b,null))[_0xfe58('0x1e')](saveUpdates(_0x4f19c9['body'],null))[_0xfe58('0x1e')](respondWithResult(_0x5e612b,null))[_0xfe58('0x44')](handleError(_0x5e612b,null));};exports[_0xfe58('0x1f')]=function(_0x362c98,_0x129337){return db[_0xfe58('0x29')]['find']({'where':{'id':_0x362c98[_0xfe58('0x4f')]['id']}})['then'](handleEntityNotFound(_0x129337,null))[_0xfe58('0x1e')](removeEntity(_0x129337,null))[_0xfe58('0x44')](handleError(_0x129337,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 3342413..a70b0ae 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 _0x8b09=['tools_tags','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./tag.attributes','exports','define','Tag'];(function(_0x47ca30,_0x2e3d46){var _0x1451f2=function(_0x1d91f3){while(--_0x1d91f3){_0x47ca30['push'](_0x47ca30['shift']());}};_0x1451f2(++_0x2e3d46);}(_0x8b09,0x153));var _0x98b0=function(_0x483051,_0x452c61){_0x483051=_0x483051-0x0;var _0x3c116c=_0x8b09[_0x483051];return _0x3c116c;};'use strict';var _=require(_0x98b0('0x0'));var util=require(_0x98b0('0x1'));var logger=require(_0x98b0('0x2'))(_0x98b0('0x3'));var moment=require(_0x98b0('0x4'));var BPromise=require(_0x98b0('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x98b0('0x6'));var rimraf=require('rimraf');var config=require(_0x98b0('0x7'));var attributes=require(_0x98b0('0x8'));module[_0x98b0('0x9')]=function(_0x2c83d7,_0x3ca831){return _0x2c83d7[_0x98b0('0xa')](_0x98b0('0xb'),attributes,{'tableName':_0x98b0('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2966=['path','rimraf','../../config/environment','./tag.attributes','exports','Tag','lodash','util','../../config/logger','api','request-promise'];(function(_0x2b92c5,_0x4ca439){var _0x216309=function(_0x5123c2){while(--_0x5123c2){_0x2b92c5['push'](_0x2b92c5['shift']());}};_0x216309(++_0x4ca439);}(_0x2966,0x187));var _0x6296=function(_0x4f633b,_0x52b8e4){_0x4f633b=_0x4f633b-0x0;var _0x8932d4=_0x2966[_0x4f633b];return _0x8932d4;};'use strict';var _=require(_0x6296('0x0'));var util=require(_0x6296('0x1'));var logger=require(_0x6296('0x2'))(_0x6296('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x6296('0x4'));var fs=require('fs');var path=require(_0x6296('0x5'));var rimraf=require(_0x6296('0x6'));var config=require(_0x6296('0x7'));var attributes=require(_0x6296('0x8'));module[_0x6296('0x9')]=function(_0x333c2d,_0x42bacf){return _0x333c2d['define'](_0x6296('0xa'),attributes,{'tableName':'tools_tags','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 8e079a9..3b49d4e 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 _0xbfcc=['Tag,\x20%s,\x20%s','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','jayson/promise','client','request','info'];(function(_0x25a9ae,_0x1f2298){var _0x504297=function(_0x485cd5){while(--_0x485cd5){_0x25a9ae['push'](_0x25a9ae['shift']());}};_0x504297(++_0x1f2298);}(_0xbfcc,0x1dd));var _0xcbfc=function(_0x1b1e76,_0x31695b){_0x1b1e76=_0x1b1e76-0x0;var _0x3d743a=_0xbfcc[_0x1b1e76];return _0x3d743a;};'use strict';var _=require(_0xcbfc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xcbfc('0x1'));var rs=require(_0xcbfc('0x2'));var fs=require('fs');var Redis=require(_0xcbfc('0x3'));var db=require(_0xcbfc('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xcbfc('0x5'));var client=jayson[_0xcbfc('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b3917,_0x5a2be0,_0x2ea130){return new BPromise(function(_0x1f8b71,_0x1b1377){return client[_0xcbfc('0x7')](_0x1b3917,_0x2ea130)['then'](function(_0x2e7097){logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));logger[_0xcbfc('0xb')](_0xcbfc('0xc'),_0x5a2be0,'request\x20sent',JSON[_0xcbfc('0xd')](_0x2e7097));if(_0x2e7097[_0xcbfc('0xe')]){if(_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0xf')]===0x1f4){logger[_0xcbfc('0xe')]('Tag,\x20%s,\x20%s',_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1b1377(_0x2e7097[_0xcbfc('0xe')]['message']);}logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x2e7097[_0xcbfc('0xe')][_0xcbfc('0x10')]);return _0x1f8b71(_0x2e7097[_0xcbfc('0xe')]['message']);}else{logger[_0xcbfc('0x8')](_0xcbfc('0x9'),_0x5a2be0,_0xcbfc('0xa'));_0x1f8b71(_0x2e7097[_0xcbfc('0x11')]['message']);}})['catch'](function(_0x418f18){logger[_0xcbfc('0xe')](_0xcbfc('0x9'),_0x5a2be0,_0x418f18);_0x1b1377(_0x418f18);});});} \ No newline at end of file +var _0x57f8=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Tag,\x20%s,\x20%s','request\x20sent','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x174845,_0x690d1d){var _0x50c12f=function(_0xd94bcc){while(--_0xd94bcc){_0x174845['push'](_0x174845['shift']());}};_0x50c12f(++_0x690d1d);}(_0x57f8,0x198));var _0x857f=function(_0x47761d,_0x3f8494){_0x47761d=_0x47761d-0x0;var _0x3d1c05=_0x57f8[_0x47761d];return _0x3d1c05;};'use strict';var _=require('lodash');var util=require(_0x857f('0x0'));var moment=require(_0x857f('0x1'));var BPromise=require(_0x857f('0x2'));var rs=require(_0x857f('0x3'));var fs=require('fs');var Redis=require(_0x857f('0x4'));var db=require(_0x857f('0x5'))['db'];var utils=require(_0x857f('0x6'));var logger=require(_0x857f('0x7'))(_0x857f('0x8'));var config=require(_0x857f('0x9'));var jayson=require(_0x857f('0xa'));var client=jayson[_0x857f('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8380e8,_0x197098,_0x1aaeea){return new BPromise(function(_0x577fc3,_0x5f6a66){return client[_0x857f('0xc')](_0x8380e8,_0x1aaeea)[_0x857f('0xd')](function(_0x4f2b09){logger[_0x857f('0xe')](_0x857f('0xf'),_0x197098,_0x857f('0x10'));logger['debug'](_0x857f('0x11'),_0x197098,_0x857f('0x10'),JSON[_0x857f('0x12')](_0x4f2b09));if(_0x4f2b09[_0x857f('0x13')]){if(_0x4f2b09[_0x857f('0x13')][_0x857f('0x14')]===0x1f4){logger[_0x857f('0x13')]('Tag,\x20%s,\x20%s',_0x197098,_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);return _0x5f6a66(_0x4f2b09[_0x857f('0x13')][_0x857f('0x15')]);}logger[_0x857f('0x13')]('Tag,\x20%s,\x20%s',_0x197098,_0x4f2b09['error'][_0x857f('0x15')]);return _0x577fc3(_0x4f2b09['error'][_0x857f('0x15')]);}else{logger['info'](_0x857f('0xf'),_0x197098,_0x857f('0x10'));_0x577fc3(_0x4f2b09['result'][_0x857f('0x15')]);}})[_0x857f('0x16')](function(_0xdf14fe){logger[_0x857f('0x13')](_0x857f('0xf'),_0x197098,_0xdf14fe);_0x5f6a66(_0xdf14fe);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 7dd5fe9..f7e5f4b 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 _0x51d9=['addQueues','addAgents','put','update','delete','destroy','/:id/queues','removeQueues','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./team.controller','get','/:id','isAuthenticated','getQueues','/:id/users','getAgents','post','create'];(function(_0x559e79,_0x13c437){var _0x49dd80=function(_0x21a040){while(--_0x21a040){_0x559e79['push'](_0x559e79['shift']());}};_0x49dd80(++_0x13c437);}(_0x51d9,0x103));var _0x951d=function(_0x4bcc75,_0x3262f9){_0x4bcc75=_0x4bcc75-0x0;var _0x2d5d7f=_0x51d9[_0x4bcc75];return _0x2d5d7f;};'use strict';var multer=require(_0x951d('0x0'));var util=require(_0x951d('0x1'));var path=require('path');var timeout=require(_0x951d('0x2'));var express=require(_0x951d('0x3'));var router=express[_0x951d('0x4')]();var auth=require(_0x951d('0x5'));var interaction=require(_0x951d('0x6'));var config=require('../../config/environment');var controller=require(_0x951d('0x7'));router[_0x951d('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x951d('0x8')](_0x951d('0x9'),auth[_0x951d('0xa')](),controller['show']);router[_0x951d('0x8')]('/:id/queues',auth['isAuthenticated'](),controller[_0x951d('0xb')]);router['get'](_0x951d('0xc'),auth['isAuthenticated'](),controller[_0x951d('0xd')]);router[_0x951d('0xe')]('/',auth[_0x951d('0xa')](),controller[_0x951d('0xf')]);router[_0x951d('0xe')]('/:id/queues',auth[_0x951d('0xa')](),controller[_0x951d('0x10')]);router[_0x951d('0xe')](_0x951d('0xc'),auth['isAuthenticated'](),controller[_0x951d('0x11')]);router[_0x951d('0x12')](_0x951d('0x9'),auth['isAuthenticated'](),controller[_0x951d('0x13')]);router[_0x951d('0x14')](_0x951d('0x9'),auth[_0x951d('0xa')](),controller[_0x951d('0x15')]);router['delete'](_0x951d('0x16'),auth[_0x951d('0xa')](),controller[_0x951d('0x17')]);router['delete'](_0x951d('0xc'),auth[_0x951d('0xa')](),controller[_0x951d('0x18')]);module['exports']=router; \ No newline at end of file +var _0xaf35=['../../config/environment','./team.controller','get','isAuthenticated','index','show','/:id/queues','/:id/users','create','post','addAgents','put','/:id','delete','destroy','removeQueues','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x214d8c,_0x242dc3){var _0x5a5060=function(_0x3dc1e0){while(--_0x3dc1e0){_0x214d8c['push'](_0x214d8c['shift']());}};_0x5a5060(++_0x242dc3);}(_0xaf35,0x149));var _0x5af3=function(_0x231a47,_0x46a963){_0x231a47=_0x231a47-0x0;var _0x48d7c9=_0xaf35[_0x231a47];return _0x48d7c9;};'use strict';var multer=require(_0x5af3('0x0'));var util=require(_0x5af3('0x1'));var path=require('path');var timeout=require(_0x5af3('0x2'));var express=require(_0x5af3('0x3'));var router=express[_0x5af3('0x4')]();var auth=require(_0x5af3('0x5'));var interaction=require(_0x5af3('0x6'));var config=require(_0x5af3('0x7'));var controller=require(_0x5af3('0x8'));router[_0x5af3('0x9')]('/',auth[_0x5af3('0xa')](),controller[_0x5af3('0xb')]);router[_0x5af3('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x5af3('0xc')]);router[_0x5af3('0x9')](_0x5af3('0xd'),auth[_0x5af3('0xa')](),controller['getQueues']);router[_0x5af3('0x9')](_0x5af3('0xe'),auth[_0x5af3('0xa')](),controller['getAgents']);router['post']('/',auth[_0x5af3('0xa')](),controller[_0x5af3('0xf')]);router[_0x5af3('0x10')](_0x5af3('0xd'),auth[_0x5af3('0xa')](),controller['addQueues']);router['post']('/:id/users',auth[_0x5af3('0xa')](),controller[_0x5af3('0x11')]);router[_0x5af3('0x12')](_0x5af3('0x13'),auth[_0x5af3('0xa')](),controller['update']);router[_0x5af3('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x5af3('0x15')]);router['delete'](_0x5af3('0xd'),auth['isAuthenticated'](),controller[_0x5af3('0x16')]);router[_0x5af3('0x14')]('/:id/users',auth[_0x5af3('0xa')](),controller['removeAgents']);module[_0x5af3('0x17')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 858f5c6..7d09e30 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 _0x47e8=['sequelize','exports'];(function(_0x41ee16,_0xfa94c3){var _0x1f60de=function(_0x1c8ffc){while(--_0x1c8ffc){_0x41ee16['push'](_0x41ee16['shift']());}};_0x1f60de(++_0xfa94c3);}(_0x47e8,0xca));var _0x847e=function(_0x380c7f,_0x234003){_0x380c7f=_0x380c7f-0x0;var _0x57f3c2=_0x47e8[_0x380c7f];return _0x57f3c2;};'use strict';var Sequelize=require(_0x847e('0x0'));module[_0x847e('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xd3c4=['STRING','sequelize','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd3c4,0x16c));var _0x4d3c=function(_0x5e2fe3,_0x349c06){_0x5e2fe3=_0x5e2fe3-0x0;var _0x2e1633=_0xd3c4[_0x5e2fe3];return _0x2e1633;};'use strict';var Sequelize=require(_0x4d3c('0x0'));module[_0x4d3c('0x1')]={'name':{'type':Sequelize[_0x4d3c('0x2')],'allowNull':![],'unique':'name'},'description':{'type':Sequelize[_0x4d3c('0x2')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 706ff69..50da282 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 _0x8a21=['index','Team','rawAttributes','fieldName','key','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getQueues','findOne','channel','isValidChannel','Sequelize','Unknown\x20channel','capitalize','toLowerCase','order','Queues','add','ids','removeQueues','ValidationError','remove','addAgents','Chat','Mail','Sms','Fax','Openchannel','each','Voice','User','online','voicePause','interface','upsert','isNil','format','SIP/%s','spread','emit','removeAgents','chat','mail','sms','fax','voice','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','pick','nolimit','html-pdf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./team.socket','register','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','UserProfileResource','end','sendStatus','error','name','send'];(function(_0x170772,_0x1f1ee7){var _0x3ef69c=function(_0x4cde12){while(--_0x4cde12){_0x170772['push'](_0x170772['shift']());}};_0x3ef69c(++_0x1f1ee7);}(_0x8a21,0x1d8));var _0x18a2=function(_0x339ded,_0xb38a57){_0x339ded=_0x339ded-0x0;var _0x37f8dc=_0x8a21[_0x339ded];return _0x37f8dc;};'use strict';var pdf=require(_0x18a2('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x18a2('0x1'));var jsonpatch=require(_0x18a2('0x2'));var rp=require(_0x18a2('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x18a2('0x4'));var util=require(_0x18a2('0x5'));var path=require(_0x18a2('0x6'));var sox=require(_0x18a2('0x7'));var csv=require(_0x18a2('0x8'));var ejs=require(_0x18a2('0x9'));var fs=require('fs');var _=require(_0x18a2('0xa'));var squel=require(_0x18a2('0xb'));var crypto=require('crypto');var jsforce=require(_0x18a2('0xc'));var deskjs=require(_0x18a2('0xd'));var toCsv=require(_0x18a2('0x8'));var querystring=require('querystring');var Papa=require(_0x18a2('0xe'));var Redis=require(_0x18a2('0xf'));var authService=require(_0x18a2('0x10'));var qs=require(_0x18a2('0x11'));var as=require(_0x18a2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x18a2('0x13'))(_0x18a2('0x14'));var utils=require('../../config/utils');var config=require(_0x18a2('0x15'));var db=require(_0x18a2('0x16'))['db'];config['redis']=_[_0x18a2('0x17')](config[_0x18a2('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x18a2('0x19'))(new Redis(config[_0x18a2('0x18')]));require(_0x18a2('0x1a'))[_0x18a2('0x1b')](socket);function respondWithStatusCode(_0x589277,_0x494cf1){_0x494cf1=_0x494cf1||0xcc;return function(_0x1c5302){if(_0x1c5302){return _0x589277['sendStatus'](_0x494cf1);}return _0x589277[_0x18a2('0x1c')](_0x494cf1)['end']();};}function respondWithResult(_0x358572,_0x3037c6){_0x3037c6=_0x3037c6||0xc8;return function(_0x2633f0){if(_0x2633f0){return _0x358572['status'](_0x3037c6)[_0x18a2('0x1d')](_0x2633f0);}};}function respondWithFilteredResult(_0x368a1d,_0x13a23c){return function(_0xa5894d){if(_0xa5894d){var _0x22296a=_0xa5894d[_0x18a2('0x1e')],_0x4e5da2=_0x13a23c['offset'],_0x26929f=_0x13a23c[_0x18a2('0x1f')]+_0x13a23c[_0x18a2('0x20')],_0x50a4ad;if(_0x26929f>=_0x22296a){_0x26929f=_0x22296a;_0x50a4ad=0xc8;}else{_0x50a4ad=0xce;}_0x368a1d[_0x18a2('0x1c')](_0x50a4ad);return _0x368a1d[_0x18a2('0x21')](_0x18a2('0x22'),_0x4e5da2+'-'+_0x26929f+'/'+_0x22296a)[_0x18a2('0x1d')](_0xa5894d);}return null;};}function patchUpdates(_0x19a326){return function(_0x1edaae){try{jsonpatch[_0x18a2('0x23')](_0x1edaae,_0x19a326,!![]);}catch(_0x2ac173){return BPromise[_0x18a2('0x24')](_0x2ac173);}return _0x1edaae[_0x18a2('0x25')]();};}function saveUpdates(_0x5c5164,_0x1ed01f){return function(_0x357693){if(_0x357693){return _0x357693[_0x18a2('0x26')](_0x5c5164)[_0x18a2('0x27')](function(_0x3fdf6c){return _0x3fdf6c;});}return null;};}function removeEntity(_0x591a4c,_0x5340cc){return function(_0x53c982){if(_0x53c982){return _0x53c982[_0x18a2('0x28')]()[_0x18a2('0x27')](function(){var _0x55f10c=_0x53c982[_0x18a2('0x29')]({'plain':!![]});var _0x3be4db='Teams';return db[_0x18a2('0x2a')][_0x18a2('0x28')]({'where':{'type':_0x3be4db,'resourceId':_0x55f10c['id']}})[_0x18a2('0x27')](function(){return _0x53c982;});})[_0x18a2('0x27')](function(){_0x591a4c[_0x18a2('0x1c')](0xcc)[_0x18a2('0x2b')]();});}};}function handleEntityNotFound(_0xa36477,_0x3e9543){return function(_0x3c17c1){if(!_0x3c17c1){_0xa36477[_0x18a2('0x2c')](0x194);}return _0x3c17c1;};}function handleError(_0x335b0b,_0x562df1){_0x562df1=_0x562df1||0x1f4;return function(_0x43a4f8){logger[_0x18a2('0x2d')](_0x43a4f8['stack']);if(_0x43a4f8[_0x18a2('0x2e')]){delete _0x43a4f8[_0x18a2('0x2e')];}_0x335b0b[_0x18a2('0x1c')](_0x562df1)[_0x18a2('0x2f')](_0x43a4f8);};}exports[_0x18a2('0x30')]=function(_0x56b765,_0x2bad4c){var _0xf8983d={},_0x368fd4={},_0x291b48={'count':0x0,'rows':[]};var _0xedeb1b=_['map'](db[_0x18a2('0x31')][_0x18a2('0x32')],function(_0x1fa180){return{'name':_0x1fa180[_0x18a2('0x33')],'type':_0x1fa180['type'][_0x18a2('0x34')]};});_0x368fd4[_0x18a2('0x35')]=_[_0x18a2('0x36')](_0xedeb1b,_0x18a2('0x2e'));_0x368fd4['query']=_[_0x18a2('0x37')](_0x56b765[_0x18a2('0x38')]);_0x368fd4[_0x18a2('0x39')]=_[_0x18a2('0x3a')](_0x368fd4[_0x18a2('0x35')],_0x368fd4[_0x18a2('0x38')]);_0xf8983d['attributes']=_[_0x18a2('0x3a')](_0x368fd4[_0x18a2('0x35')],qs[_0x18a2('0x3b')](_0x56b765[_0x18a2('0x38')][_0x18a2('0x3b')]));_0xf8983d['attributes']=_0xf8983d[_0x18a2('0x3c')]['length']?_0xf8983d[_0x18a2('0x3c')]:_0x368fd4[_0x18a2('0x35')];if(!_0x56b765[_0x18a2('0x38')][_0x18a2('0x3d')]('nolimit')){_0xf8983d[_0x18a2('0x20')]=qs[_0x18a2('0x20')](_0x56b765['query'][_0x18a2('0x20')]);_0xf8983d[_0x18a2('0x1f')]=qs[_0x18a2('0x1f')](_0x56b765[_0x18a2('0x38')][_0x18a2('0x1f')]);}_0xf8983d['order']=qs[_0x18a2('0x3e')](_0x56b765[_0x18a2('0x38')][_0x18a2('0x3e')]);_0xf8983d[_0x18a2('0x3f')]=qs['filters'](_['pick'](_0x56b765[_0x18a2('0x38')],_0x368fd4['filters']));if(_0x56b765[_0x18a2('0x38')][_0x18a2('0x40')]){_0xf8983d[_0x18a2('0x3f')]=_[_0x18a2('0x41')](_0xf8983d[_0x18a2('0x3f')],{'$or':_[_0x18a2('0x36')](_0xedeb1b,function(_0x1124db){if(_0x1124db['type']!==_0x18a2('0x42')){var _0x2e94d6={};_0x2e94d6[_0x1124db['name']]={'$like':'%'+_0x56b765[_0x18a2('0x38')][_0x18a2('0x40')]+'%'};return _0x2e94d6;}})});}_0xf8983d=_['merge']({},_0xf8983d,_0x56b765[_0x18a2('0x43')]);var _0x392626={'where':_0xf8983d[_0x18a2('0x3f')]};return db[_0x18a2('0x31')]['count'](_0x392626)[_0x18a2('0x27')](function(_0x5e8fa7){_0x291b48[_0x18a2('0x1e')]=_0x5e8fa7;if(_0x56b765[_0x18a2('0x38')][_0x18a2('0x44')]){_0xf8983d[_0x18a2('0x45')]=[{'all':!![]}];}return db[_0x18a2('0x31')][_0x18a2('0x46')](_0xf8983d);})[_0x18a2('0x27')](function(_0xc586c0){_0x291b48[_0x18a2('0x47')]=_0xc586c0;return _0x291b48;})[_0x18a2('0x27')](respondWithFilteredResult(_0x2bad4c,_0xf8983d))[_0x18a2('0x48')](handleError(_0x2bad4c,null));};exports['show']=function(_0x5a73c7,_0xa498ee){var _0xa6494c={'raw':![],'where':{'id':_0x5a73c7['params']['id']}},_0x61da06={};_0x61da06[_0x18a2('0x35')]=_[_0x18a2('0x37')](db[_0x18a2('0x31')][_0x18a2('0x32')]);_0x61da06[_0x18a2('0x38')]=_[_0x18a2('0x37')](_0x5a73c7[_0x18a2('0x38')]);_0x61da06[_0x18a2('0x39')]=_[_0x18a2('0x3a')](_0x61da06[_0x18a2('0x35')],_0x61da06[_0x18a2('0x38')]);_0xa6494c[_0x18a2('0x3c')]=_[_0x18a2('0x3a')](_0x61da06[_0x18a2('0x35')],qs[_0x18a2('0x3b')](_0x5a73c7[_0x18a2('0x38')][_0x18a2('0x3b')]));_0xa6494c[_0x18a2('0x3c')]=_0xa6494c[_0x18a2('0x3c')][_0x18a2('0x49')]?_0xa6494c[_0x18a2('0x3c')]:_0x61da06['model'];if(_0x5a73c7['query'][_0x18a2('0x44')]){_0xa6494c['include']=[{'all':!![]}];}_0xa6494c=_['merge']({},_0xa6494c,_0x5a73c7[_0x18a2('0x43')]);return db[_0x18a2('0x31')][_0x18a2('0x4a')](_0xa6494c)['then'](handleEntityNotFound(_0xa498ee,null))[_0x18a2('0x27')](respondWithResult(_0xa498ee,null))[_0x18a2('0x48')](handleError(_0xa498ee,null));};exports[_0x18a2('0x4b')]=function(_0x5e9cbe,_0x31c192){return db['Team'][_0x18a2('0x4b')](_0x5e9cbe[_0x18a2('0x4c')],{})[_0x18a2('0x27')](function(_0x42e6a9){var _0x38284c=_0x5e9cbe[_0x18a2('0x4d')][_0x18a2('0x29')]({'plain':!![]});if(!_0x38284c)throw new Error(_0x18a2('0x4e'));if(_0x38284c[_0x18a2('0x4f')]===_0x18a2('0x4d')){var _0x514a74=_0x42e6a9[_0x18a2('0x29')]({'plain':!![]});var _0x19e29a='Teams';return db[_0x18a2('0x50')][_0x18a2('0x4a')]({'where':{'name':_0x19e29a,'userProfileId':_0x38284c[_0x18a2('0x51')]},'raw':!![]})[_0x18a2('0x27')](function(_0x185679){if(_0x185679&&_0x185679[_0x18a2('0x52')]===0x0){return db[_0x18a2('0x2a')][_0x18a2('0x4b')]({'name':_0x514a74[_0x18a2('0x2e')],'resourceId':_0x514a74['id'],'type':_0x185679[_0x18a2('0x2e')],'sectionId':_0x185679['id']},{})[_0x18a2('0x27')](function(){return _0x42e6a9;});}else{return _0x42e6a9;}})[_0x18a2('0x48')](function(_0x1c4c3c){logger[_0x18a2('0x2d')](_0x18a2('0x53'),_0x1c4c3c);throw _0x1c4c3c;});}return _0x42e6a9;})[_0x18a2('0x27')](respondWithResult(_0x31c192,0xc9))[_0x18a2('0x48')](handleError(_0x31c192,null));};exports[_0x18a2('0x26')]=function(_0x275729,_0x1398e4){if(_0x275729[_0x18a2('0x4c')]['id']){delete _0x275729[_0x18a2('0x4c')]['id'];}return db[_0x18a2('0x31')][_0x18a2('0x4a')]({'where':{'id':_0x275729[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x1398e4,null))[_0x18a2('0x27')](saveUpdates(_0x275729['body'],null))['then'](respondWithResult(_0x1398e4,null))[_0x18a2('0x48')](handleError(_0x1398e4,null));};exports['destroy']=function(_0x2f9cc7,_0x329221){return db[_0x18a2('0x31')][_0x18a2('0x4a')]({'where':{'id':_0x2f9cc7[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x329221,null))['then'](removeEntity(_0x329221,null))[_0x18a2('0x48')](handleError(_0x329221,null));};exports[_0x18a2('0x55')]=function(_0xae796c,_0x465408,_0x3ac6ab){return db[_0x18a2('0x31')][_0x18a2('0x56')]({'where':{'id':_0xae796c[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x465408,null))[_0x18a2('0x27')](function(_0x50f68d){if(!_0xae796c[_0x18a2('0x38')][_0x18a2('0x57')]||!utils[_0x18a2('0x58')](_0xae796c[_0x18a2('0x38')][_0x18a2('0x57')])){throw new db[(_0x18a2('0x59'))]['ValidationError'](_0x18a2('0x5a'));}var _0x445803={};var _0x2fe76f={};_0x2fe76f['model']=_[_0x18a2('0x37')](db[_[_0x18a2('0x5b')](_0xae796c[_0x18a2('0x38')]['channel'][_0x18a2('0x5c')]())+'Queue'][_0x18a2('0x32')]);_0x2fe76f['query']=_['keys'](_0xae796c[_0x18a2('0x38')]);_0x2fe76f[_0x18a2('0x39')]=_[_0x18a2('0x3a')](_0x2fe76f['model'],_0x2fe76f[_0x18a2('0x38')]);_0x445803[_0x18a2('0x3c')]=_[_0x18a2('0x3a')](_0x2fe76f[_0x18a2('0x35')],qs['fields'](_0xae796c[_0x18a2('0x38')][_0x18a2('0x3b')]));_0x445803[_0x18a2('0x3c')]=_0x445803['attributes']['length']?_0x445803['attributes']:_0x2fe76f[_0x18a2('0x35')];_0x445803['limit']=qs[_0x18a2('0x20')](_0xae796c[_0x18a2('0x38')]['limit']);_0x445803['offset']=qs[_0x18a2('0x1f')](_0xae796c[_0x18a2('0x38')][_0x18a2('0x1f')]);_0x445803[_0x18a2('0x5d')]=qs[_0x18a2('0x3e')](_0xae796c['query'][_0x18a2('0x3e')]);_0x445803['where']=qs[_0x18a2('0x39')](_['pick'](_0xae796c[_0x18a2('0x38')],_0x2fe76f['filters']));_0x445803=_[_0x18a2('0x41')]({},_0x445803,_0xae796c[_0x18a2('0x43')]);return _0x50f68d[_0x18a2('0x29')+_[_0x18a2('0x5b')](_0xae796c['query'][_0x18a2('0x57')]['toLowerCase']())+_0x18a2('0x5e')](_0x445803);})[_0x18a2('0x27')](respondWithResult(_0x465408,null))[_0x18a2('0x48')](handleError(_0x465408,null));};exports['addQueues']=function(_0x1b8f5c,_0x87a569,_0x337e22){return db[_0x18a2('0x31')]['findOne']({'where':{'id':_0x1b8f5c[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](function(_0x67a245){if(_0x67a245){if(!_0x1b8f5c[_0x18a2('0x4c')][_0x18a2('0x57')]||!utils[_0x18a2('0x58')](_0x1b8f5c[_0x18a2('0x4c')][_0x18a2('0x57')])){throw new db[(_0x18a2('0x59'))]['ValidationError'](_0x18a2('0x5a'));}return _0x67a245[_0x18a2('0x5f')+_[_0x18a2('0x5b')](_0x1b8f5c[_0x18a2('0x4c')][_0x18a2('0x57')]['toLowerCase']())+'Queues'](_0x1b8f5c['body'][_0x18a2('0x60')]);}return null;})[_0x18a2('0x27')](handleEntityNotFound(_0x87a569,null))['then'](respondWithStatusCode(_0x87a569,null))[_0x18a2('0x48')](handleError(_0x87a569,null));};exports[_0x18a2('0x61')]=function(_0x211c40,_0x2d2fb1,_0x51709f){return db['Team'][_0x18a2('0x56')]({'where':{'id':_0x211c40[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](function(_0x3b12a8){if(_0x3b12a8){if(!_0x211c40[_0x18a2('0x38')][_0x18a2('0x57')]||!utils[_0x18a2('0x58')](_0x211c40[_0x18a2('0x38')][_0x18a2('0x57')])){throw new db[(_0x18a2('0x59'))][(_0x18a2('0x62'))](_0x18a2('0x5a'));}return _0x3b12a8[_0x18a2('0x63')+_[_0x18a2('0x5b')](_0x211c40[_0x18a2('0x38')][_0x18a2('0x57')]['toLowerCase']())+_0x18a2('0x5e')](_0x211c40[_0x18a2('0x38')][_0x18a2('0x60')]);}return null;})[_0x18a2('0x27')](handleEntityNotFound(_0x2d2fb1,null))[_0x18a2('0x27')](respondWithStatusCode(_0x2d2fb1,null))[_0x18a2('0x48')](handleError(_0x2d2fb1,null));};exports[_0x18a2('0x64')]=function(_0x3caa57,_0x389d9d,_0x24b4f1){return db['Team'][_0x18a2('0x4a')]({'where':{'id':_0x3caa57['params']['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x389d9d,null))['then'](function(_0x25ae1a){if(_0x25ae1a){var _0xd17c70=['Voice',_0x18a2('0x65'),_0x18a2('0x66'),_0x18a2('0x67'),_0x18a2('0x68'),_0x18a2('0x69')];return BPromise[_0x18a2('0x6a')](_0xd17c70,function(_0x1dca86){return _0x25ae1a[_0x18a2('0x29')+_0x1dca86+_0x18a2('0x5e')]({'attributes':['id',_0x18a2('0x2e')]})[_0x18a2('0x27')](function(_0x42e898){return BPromise[_0x18a2('0x6a')](_0x42e898,function(_0x4a1b71){return _0x4a1b71['addAgents'](_0x3caa57[_0x18a2('0x4c')][_0x18a2('0x60')])[_0x18a2('0x27')](function(){if(_0x1dca86===_0x18a2('0x6b')){return db[_0x18a2('0x6c')][_0x18a2('0x46')]({'where':{'id':_0x3caa57[_0x18a2('0x4c')]['ids']},'attributes':['id',_0x18a2('0x2e'),_0x18a2('0x6d'),_0x18a2('0x6e'),_0x18a2('0x6f')],'raw':!![]})['then'](function(_0x5553ef){return BPromise[_0x18a2('0x6a')](_['filter'](_0x5553ef,{'online':0x1}),function(_0x283cf3){return db['UserVoiceQueueRt'][_0x18a2('0x70')]({'membername':_0x283cf3[_0x18a2('0x2e')],'UserId':_0x283cf3['id'],'queue_name':_0x4a1b71[_0x18a2('0x2e')],'VoiceQueueId':_0x4a1b71['id'],'interface':_[_0x18a2('0x71')](_0x283cf3['interface'])?util[_0x18a2('0x72')](_0x18a2('0x73'),_0x283cf3[_0x18a2('0x2e')]):_0x283cf3[_0x18a2('0x6f')],'paused':_0x283cf3[_0x18a2('0x6e')]||![],'penalty':0x0});});});}});});})[_0x18a2('0x27')](function(){return _0x25ae1a;});})[_0x18a2('0x27')](function(){return _0x25ae1a;});}})[_0x18a2('0x27')](function(_0x41d67f){if(_0x41d67f){return _0x41d67f[_0x18a2('0x64')](_0x3caa57[_0x18a2('0x4c')]['ids'],_['omit'](_0x3caa57[_0x18a2('0x4c')],[_0x18a2('0x60'),'id'])||{})[_0x18a2('0x74')](function(_0x10cf8a){for(var _0x1299c8=0x0;_0x1299c8<_0x3caa57['body']['ids'][_0x18a2('0x49')];_0x1299c8+=0x1){socket[_0x18a2('0x75')]('userTeam:save',{'UserId':_0x3caa57[_0x18a2('0x4c')][_0x18a2('0x60')][_0x1299c8],'TeamId':_0x3caa57[_0x18a2('0x54')]['id']});}return _0x10cf8a;});}})[_0x18a2('0x27')](respondWithResult(_0x389d9d,null))[_0x18a2('0x48')](handleError(_0x389d9d,null));};exports[_0x18a2('0x76')]=function(_0x39255f,_0x1dc944,_0x5ec660){return db[_0x18a2('0x31')][_0x18a2('0x4a')]({'where':{'id':_0x39255f[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x1dc944,null))[_0x18a2('0x27')](function(_0x5d0f6a){if(_0x5d0f6a){return BPromise[_0x18a2('0x6a')](['voice',_0x18a2('0x77'),_0x18a2('0x78'),_0x18a2('0x79'),_0x18a2('0x7a'),'openchannel'],function(_0x2d4527){return _0x5d0f6a[_0x18a2('0x29')+_['capitalize'](_0x2d4527)+_0x18a2('0x5e')]({'attributes':['id',_0x18a2('0x2e')]})['then'](function(_0xbcc2ec){return BPromise[_0x18a2('0x6a')](_0xbcc2ec,function(_0x18c10b){return _0x18c10b[_0x18a2('0x76')](_0x39255f[_0x18a2('0x38')][_0x18a2('0x60')])[_0x18a2('0x27')](function(){if(_0x2d4527===_0x18a2('0x7b')){return db[_0x18a2('0x7c')][_0x18a2('0x28')]({'where':{'VoiceQueueId':_0x18c10b['id'],'UserId':_0x39255f[_0x18a2('0x38')][_0x18a2('0x60')]}});}});});})['then'](function(){return _0x5d0f6a;});})['then'](function(){return _0x5d0f6a;});}})[_0x18a2('0x27')](function(_0x1f374a){if(_0x1f374a){return _0x1f374a[_0x18a2('0x76')](_0x39255f['query'][_0x18a2('0x60')])[_0x18a2('0x27')](function(){if(_[_0x18a2('0x7d')](_0x39255f[_0x18a2('0x38')][_0x18a2('0x60')])){for(var _0x4c7d96=0x0;_0x4c7d96<_0x39255f[_0x18a2('0x38')][_0x18a2('0x60')]['length'];_0x4c7d96+=0x1){socket[_0x18a2('0x75')](_0x18a2('0x7e'),{'UserId':Number(_0x39255f[_0x18a2('0x38')]['ids'][_0x4c7d96]),'TeamId':Number(_0x39255f[_0x18a2('0x54')]['id'])});}}else{socket['emit'](_0x18a2('0x7e'),{'UserId':Number(_0x39255f[_0x18a2('0x38')]['ids']),'TeamId':Number(_0x39255f[_0x18a2('0x54')]['id'])});}});}})[_0x18a2('0x27')](respondWithStatusCode(_0x1dc944,null))[_0x18a2('0x48')](handleError(_0x1dc944,null));};exports[_0x18a2('0x7f')]=function(_0x2cdfd7,_0x5ba9b8,_0x3f58f4){var _0x4ad664={};var _0x29355b={};var _0x3f159e;var _0x580311;return db['Team'][_0x18a2('0x56')]({'where':{'id':_0x2cdfd7[_0x18a2('0x54')]['id']}})[_0x18a2('0x27')](handleEntityNotFound(_0x5ba9b8,null))['then'](function(_0x59d384){if(_0x59d384){_0x3f159e=_0x59d384;_0x29355b['model']=_[_0x18a2('0x37')](db[_0x18a2('0x6c')][_0x18a2('0x32')]);_0x29355b[_0x18a2('0x38')]=_[_0x18a2('0x37')](_0x2cdfd7[_0x18a2('0x38')]);_0x29355b[_0x18a2('0x39')]=_[_0x18a2('0x3a')](_0x29355b[_0x18a2('0x35')],_0x29355b[_0x18a2('0x38')]);_0x4ad664['attributes']=_[_0x18a2('0x3a')](_0x29355b['model'],qs[_0x18a2('0x3b')](_0x2cdfd7[_0x18a2('0x38')][_0x18a2('0x3b')]));_0x4ad664[_0x18a2('0x3c')]=_0x4ad664[_0x18a2('0x3c')][_0x18a2('0x49')]?_0x4ad664[_0x18a2('0x3c')]:_0x29355b[_0x18a2('0x35')];_0x4ad664[_0x18a2('0x5d')]=qs[_0x18a2('0x3e')](_0x2cdfd7[_0x18a2('0x38')][_0x18a2('0x3e')]);_0x4ad664[_0x18a2('0x3f')]=qs['filters'](_[_0x18a2('0x80')](_0x2cdfd7[_0x18a2('0x38')],_0x29355b['filters']));if(_0x2cdfd7[_0x18a2('0x38')][_0x18a2('0x40')]){_0x4ad664[_0x18a2('0x3f')]=_[_0x18a2('0x41')](_0x4ad664['where'],{'$or':_['map'](_0x4ad664[_0x18a2('0x3c')],function(_0x6c48dc){var _0x333b4d={};_0x333b4d[_0x6c48dc]={'$like':'%'+_0x2cdfd7[_0x18a2('0x38')][_0x18a2('0x40')]+'%'};return _0x333b4d;})});}_0x4ad664=_['merge']({},_0x4ad664,_0x2cdfd7['options']);return _0x3f159e['getAgents'](_0x4ad664);}})[_0x18a2('0x27')](function(_0x552c27){if(_0x552c27){_0x580311=_0x552c27[_0x18a2('0x49')];if(!_0x2cdfd7[_0x18a2('0x38')]['hasOwnProperty'](_0x18a2('0x81'))){_0x4ad664[_0x18a2('0x20')]=qs[_0x18a2('0x20')](_0x2cdfd7[_0x18a2('0x38')][_0x18a2('0x20')]);_0x4ad664[_0x18a2('0x1f')]=qs['offset'](_0x2cdfd7['query'][_0x18a2('0x1f')]);}return _0x3f159e[_0x18a2('0x7f')](_0x4ad664);}})[_0x18a2('0x27')](function(_0x16a057){if(_0x16a057){return _0x16a057?{'count':_0x580311,'rows':_0x16a057}:null;}})[_0x18a2('0x27')](respondWithResult(_0x5ba9b8,null))[_0x18a2('0x48')](handleError(_0x5ba9b8,null));}; \ No newline at end of file +var _0x0a6b=['Voice','Chat','Mail','Fax','Openchannel','each','addAgents','User','online','voicePause','upsert','isNil','format','SIP/%s','interface','omit','emit','userTeam:save','removeAgents','voice','chat','mail','sms','fax','openchannel','UserVoiceQueueRt','isArray','userTeam:remove','getAgents','nolimit','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./team.socket','register','status','json','offset','limit','set','apply','reject','update','then','destroy','Teams','UserProfileResource','end','error','stack','send','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','name','options','Team','count','include','findAll','catch','includeAll','merge','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getQueues','findOne','channel','Sequelize','ValidationError','capitalize','toLowerCase','Queue','Queues','addQueues','isValidChannel','Unknown\x20channel','add','removeQueues','ids'];(function(_0x740142,_0x4e566){var _0x2b6247=function(_0x210e3c){while(--_0x210e3c){_0x740142['push'](_0x740142['shift']());}};_0x2b6247(++_0x4e566);}(_0x0a6b,0x120));var _0xb0a6=function(_0x145348,_0x25bb84){_0x145348=_0x145348-0x0;var _0x18d11b=_0x0a6b[_0x145348];return _0x18d11b;};'use strict';var pdf=require(_0xb0a6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb0a6('0x1'));var zipdir=require(_0xb0a6('0x2'));var jsonpatch=require(_0xb0a6('0x3'));var rp=require(_0xb0a6('0x4'));var moment=require(_0xb0a6('0x5'));var BPromise=require(_0xb0a6('0x6'));var Mustache=require(_0xb0a6('0x7'));var util=require(_0xb0a6('0x8'));var path=require(_0xb0a6('0x9'));var sox=require(_0xb0a6('0xa'));var csv=require('to-csv');var ejs=require(_0xb0a6('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb0a6('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xb0a6('0xd'));var toCsv=require('to-csv');var querystring=require(_0xb0a6('0xe'));var Papa=require(_0xb0a6('0xf'));var Redis=require('ioredis');var authService=require(_0xb0a6('0x10'));var qs=require(_0xb0a6('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb0a6('0x12'));var logger=require(_0xb0a6('0x13'))(_0xb0a6('0x14'));var utils=require(_0xb0a6('0x15'));var config=require(_0xb0a6('0x16'));var db=require(_0xb0a6('0x17'))['db'];config[_0xb0a6('0x18')]=_[_0xb0a6('0x19')](config['redis'],{'host':_0xb0a6('0x1a'),'port':0x18eb});var socket=require(_0xb0a6('0x1b'))(new Redis(config[_0xb0a6('0x18')]));require(_0xb0a6('0x1c'))[_0xb0a6('0x1d')](socket);function respondWithStatusCode(_0x5c8cd3,_0x33bc04){_0x33bc04=_0x33bc04||0xcc;return function(_0x3b38a4){if(_0x3b38a4){return _0x5c8cd3['sendStatus'](_0x33bc04);}return _0x5c8cd3[_0xb0a6('0x1e')](_0x33bc04)['end']();};}function respondWithResult(_0x54b0f5,_0x214699){_0x214699=_0x214699||0xc8;return function(_0x3728e8){if(_0x3728e8){return _0x54b0f5[_0xb0a6('0x1e')](_0x214699)[_0xb0a6('0x1f')](_0x3728e8);}};}function respondWithFilteredResult(_0xeb25ec,_0x1aa140){return function(_0x3fd186){if(_0x3fd186){var _0x1bd5ed=_0x3fd186['count'],_0x3a323c=_0x1aa140['offset'],_0x1375e8=_0x1aa140[_0xb0a6('0x20')]+_0x1aa140[_0xb0a6('0x21')],_0x4489b2;if(_0x1375e8>=_0x1bd5ed){_0x1375e8=_0x1bd5ed;_0x4489b2=0xc8;}else{_0x4489b2=0xce;}_0xeb25ec['status'](_0x4489b2);return _0xeb25ec[_0xb0a6('0x22')]('Content-Range',_0x3a323c+'-'+_0x1375e8+'/'+_0x1bd5ed)[_0xb0a6('0x1f')](_0x3fd186);}return null;};}function patchUpdates(_0x2077b5){return function(_0x382968){try{jsonpatch[_0xb0a6('0x23')](_0x382968,_0x2077b5,!![]);}catch(_0x4a6499){return BPromise[_0xb0a6('0x24')](_0x4a6499);}return _0x382968['save']();};}function saveUpdates(_0x49a686,_0x15b689){return function(_0xf6e364){if(_0xf6e364){return _0xf6e364[_0xb0a6('0x25')](_0x49a686)[_0xb0a6('0x26')](function(_0x48f165){return _0x48f165;});}return null;};}function removeEntity(_0x57f2ce,_0x4687d8){return function(_0x59bd69){if(_0x59bd69){return _0x59bd69[_0xb0a6('0x27')]()[_0xb0a6('0x26')](function(){var _0x34032c=_0x59bd69['get']({'plain':!![]});var _0x279efd=_0xb0a6('0x28');return db[_0xb0a6('0x29')]['destroy']({'where':{'type':_0x279efd,'resourceId':_0x34032c['id']}})[_0xb0a6('0x26')](function(){return _0x59bd69;});})[_0xb0a6('0x26')](function(){_0x57f2ce['status'](0xcc)[_0xb0a6('0x2a')]();});}};}function handleEntityNotFound(_0x3e4eb4,_0x47ab40){return function(_0x47b9ca){if(!_0x47b9ca){_0x3e4eb4['sendStatus'](0x194);}return _0x47b9ca;};}function handleError(_0x5e6012,_0x384522){_0x384522=_0x384522||0x1f4;return function(_0x37aca3){logger[_0xb0a6('0x2b')](_0x37aca3[_0xb0a6('0x2c')]);if(_0x37aca3['name']){delete _0x37aca3['name'];}_0x5e6012[_0xb0a6('0x1e')](_0x384522)[_0xb0a6('0x2d')](_0x37aca3);};}exports['index']=function(_0x368539,_0x373ea0){var _0x5d7b78={},_0xac79bd={},_0x92efd3={'count':0x0,'rows':[]};var _0xc71ad6=_[_0xb0a6('0x2e')](db['Team'][_0xb0a6('0x2f')],function(_0x51e2e9){return{'name':_0x51e2e9['fieldName'],'type':_0x51e2e9['type'][_0xb0a6('0x30')]};});_0xac79bd[_0xb0a6('0x31')]=_[_0xb0a6('0x2e')](_0xc71ad6,'name');_0xac79bd[_0xb0a6('0x32')]=_[_0xb0a6('0x33')](_0x368539[_0xb0a6('0x32')]);_0xac79bd[_0xb0a6('0x34')]=_[_0xb0a6('0x35')](_0xac79bd['model'],_0xac79bd[_0xb0a6('0x32')]);_0x5d7b78['attributes']=_[_0xb0a6('0x35')](_0xac79bd['model'],qs[_0xb0a6('0x36')](_0x368539[_0xb0a6('0x32')][_0xb0a6('0x36')]));_0x5d7b78[_0xb0a6('0x37')]=_0x5d7b78[_0xb0a6('0x37')][_0xb0a6('0x38')]?_0x5d7b78[_0xb0a6('0x37')]:_0xac79bd[_0xb0a6('0x31')];if(!_0x368539[_0xb0a6('0x32')][_0xb0a6('0x39')]('nolimit')){_0x5d7b78['limit']=qs[_0xb0a6('0x21')](_0x368539['query'][_0xb0a6('0x21')]);_0x5d7b78[_0xb0a6('0x20')]=qs[_0xb0a6('0x20')](_0x368539[_0xb0a6('0x32')]['offset']);}_0x5d7b78[_0xb0a6('0x3a')]=qs[_0xb0a6('0x3b')](_0x368539['query'][_0xb0a6('0x3b')]);_0x5d7b78[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_[_0xb0a6('0x3d')](_0x368539['query'],_0xac79bd[_0xb0a6('0x34')]));if(_0x368539['query'][_0xb0a6('0x3e')]){_0x5d7b78[_0xb0a6('0x3c')]=_['merge'](_0x5d7b78[_0xb0a6('0x3c')],{'$or':_['map'](_0xc71ad6,function(_0x169a80){if(_0x169a80['type']!==_0xb0a6('0x3f')){var _0xb40168={};_0xb40168[_0x169a80[_0xb0a6('0x40')]]={'$like':'%'+_0x368539['query'][_0xb0a6('0x3e')]+'%'};return _0xb40168;}})});}_0x5d7b78=_['merge']({},_0x5d7b78,_0x368539[_0xb0a6('0x41')]);var _0xbb29c8={'where':_0x5d7b78[_0xb0a6('0x3c')]};return db[_0xb0a6('0x42')][_0xb0a6('0x43')](_0xbb29c8)[_0xb0a6('0x26')](function(_0x200784){_0x92efd3['count']=_0x200784;if(_0x368539[_0xb0a6('0x32')]['includeAll']){_0x5d7b78[_0xb0a6('0x44')]=[{'all':!![]}];}return db[_0xb0a6('0x42')][_0xb0a6('0x45')](_0x5d7b78);})[_0xb0a6('0x26')](function(_0x4bb406){_0x92efd3['rows']=_0x4bb406;return _0x92efd3;})[_0xb0a6('0x26')](respondWithFilteredResult(_0x373ea0,_0x5d7b78))[_0xb0a6('0x46')](handleError(_0x373ea0,null));};exports['show']=function(_0x51a434,_0x40104b){var _0x1d7b04={'raw':![],'where':{'id':_0x51a434['params']['id']}},_0x582e82={};_0x582e82[_0xb0a6('0x31')]=_[_0xb0a6('0x33')](db[_0xb0a6('0x42')][_0xb0a6('0x2f')]);_0x582e82[_0xb0a6('0x32')]=_[_0xb0a6('0x33')](_0x51a434[_0xb0a6('0x32')]);_0x582e82['filters']=_[_0xb0a6('0x35')](_0x582e82[_0xb0a6('0x31')],_0x582e82['query']);_0x1d7b04[_0xb0a6('0x37')]=_['intersection'](_0x582e82[_0xb0a6('0x31')],qs[_0xb0a6('0x36')](_0x51a434[_0xb0a6('0x32')]['fields']));_0x1d7b04['attributes']=_0x1d7b04[_0xb0a6('0x37')][_0xb0a6('0x38')]?_0x1d7b04[_0xb0a6('0x37')]:_0x582e82['model'];if(_0x51a434[_0xb0a6('0x32')][_0xb0a6('0x47')]){_0x1d7b04['include']=[{'all':!![]}];}_0x1d7b04=_[_0xb0a6('0x48')]({},_0x1d7b04,_0x51a434[_0xb0a6('0x41')]);return db[_0xb0a6('0x42')]['find'](_0x1d7b04)[_0xb0a6('0x26')](handleEntityNotFound(_0x40104b,null))[_0xb0a6('0x26')](respondWithResult(_0x40104b,null))['catch'](handleError(_0x40104b,null));};exports[_0xb0a6('0x49')]=function(_0x338a86,_0x52d4a4){return db[_0xb0a6('0x42')]['create'](_0x338a86['body'],{})[_0xb0a6('0x26')](function(_0x1699cd){var _0x256576=_0x338a86[_0xb0a6('0x4a')][_0xb0a6('0x4b')]({'plain':!![]});if(!_0x256576)throw new Error(_0xb0a6('0x4c'));if(_0x256576[_0xb0a6('0x4d')]===_0xb0a6('0x4a')){var _0x337f1c=_0x1699cd[_0xb0a6('0x4b')]({'plain':!![]});var _0x18170b=_0xb0a6('0x28');return db['UserProfileSection'][_0xb0a6('0x4e')]({'where':{'name':_0x18170b,'userProfileId':_0x256576[_0xb0a6('0x4f')]},'raw':!![]})[_0xb0a6('0x26')](function(_0x50d2e5){if(_0x50d2e5&&_0x50d2e5[_0xb0a6('0x50')]===0x0){return db[_0xb0a6('0x29')][_0xb0a6('0x49')]({'name':_0x337f1c[_0xb0a6('0x40')],'resourceId':_0x337f1c['id'],'type':_0x50d2e5['name'],'sectionId':_0x50d2e5['id']},{})[_0xb0a6('0x26')](function(){return _0x1699cd;});}else{return _0x1699cd;}})['catch'](function(_0x2f9cda){logger['error'](_0xb0a6('0x51'),_0x2f9cda);throw _0x2f9cda;});}return _0x1699cd;})[_0xb0a6('0x26')](respondWithResult(_0x52d4a4,0xc9))[_0xb0a6('0x46')](handleError(_0x52d4a4,null));};exports[_0xb0a6('0x25')]=function(_0x980785,_0x16ecdb){if(_0x980785['body']['id']){delete _0x980785[_0xb0a6('0x52')]['id'];}return db[_0xb0a6('0x42')]['find']({'where':{'id':_0x980785[_0xb0a6('0x53')]['id']}})[_0xb0a6('0x26')](handleEntityNotFound(_0x16ecdb,null))[_0xb0a6('0x26')](saveUpdates(_0x980785['body'],null))[_0xb0a6('0x26')](respondWithResult(_0x16ecdb,null))['catch'](handleError(_0x16ecdb,null));};exports[_0xb0a6('0x27')]=function(_0x358a69,_0xf25187){return db[_0xb0a6('0x42')][_0xb0a6('0x4e')]({'where':{'id':_0x358a69[_0xb0a6('0x53')]['id']}})['then'](handleEntityNotFound(_0xf25187,null))['then'](removeEntity(_0xf25187,null))['catch'](handleError(_0xf25187,null));};exports[_0xb0a6('0x54')]=function(_0x937adf,_0x29cf90,_0x191b88){return db[_0xb0a6('0x42')][_0xb0a6('0x55')]({'where':{'id':_0x937adf[_0xb0a6('0x53')]['id']}})[_0xb0a6('0x26')](handleEntityNotFound(_0x29cf90,null))[_0xb0a6('0x26')](function(_0x4be7fd){if(!_0x937adf['query']['channel']||!utils['isValidChannel'](_0x937adf[_0xb0a6('0x32')][_0xb0a6('0x56')])){throw new db[(_0xb0a6('0x57'))][(_0xb0a6('0x58'))]('Unknown\x20channel');}var _0x14bd25={};var _0x4d2734={};_0x4d2734[_0xb0a6('0x31')]=_['keys'](db[_[_0xb0a6('0x59')](_0x937adf['query']['channel'][_0xb0a6('0x5a')]())+_0xb0a6('0x5b')][_0xb0a6('0x2f')]);_0x4d2734['query']=_['keys'](_0x937adf[_0xb0a6('0x32')]);_0x4d2734[_0xb0a6('0x34')]=_[_0xb0a6('0x35')](_0x4d2734[_0xb0a6('0x31')],_0x4d2734[_0xb0a6('0x32')]);_0x14bd25[_0xb0a6('0x37')]=_[_0xb0a6('0x35')](_0x4d2734[_0xb0a6('0x31')],qs[_0xb0a6('0x36')](_0x937adf[_0xb0a6('0x32')]['fields']));_0x14bd25[_0xb0a6('0x37')]=_0x14bd25[_0xb0a6('0x37')][_0xb0a6('0x38')]?_0x14bd25[_0xb0a6('0x37')]:_0x4d2734[_0xb0a6('0x31')];_0x14bd25[_0xb0a6('0x21')]=qs[_0xb0a6('0x21')](_0x937adf['query'][_0xb0a6('0x21')]);_0x14bd25[_0xb0a6('0x20')]=qs[_0xb0a6('0x20')](_0x937adf[_0xb0a6('0x32')][_0xb0a6('0x20')]);_0x14bd25[_0xb0a6('0x3a')]=qs[_0xb0a6('0x3b')](_0x937adf[_0xb0a6('0x32')]['sort']);_0x14bd25[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_[_0xb0a6('0x3d')](_0x937adf[_0xb0a6('0x32')],_0x4d2734[_0xb0a6('0x34')]));_0x14bd25=_[_0xb0a6('0x48')]({},_0x14bd25,_0x937adf[_0xb0a6('0x41')]);return _0x4be7fd[_0xb0a6('0x4b')+_[_0xb0a6('0x59')](_0x937adf['query'][_0xb0a6('0x56')][_0xb0a6('0x5a')]())+_0xb0a6('0x5c')](_0x14bd25);})[_0xb0a6('0x26')](respondWithResult(_0x29cf90,null))['catch'](handleError(_0x29cf90,null));};exports[_0xb0a6('0x5d')]=function(_0x395afd,_0x2e4012,_0x58a102){return db[_0xb0a6('0x42')][_0xb0a6('0x55')]({'where':{'id':_0x395afd[_0xb0a6('0x53')]['id']}})[_0xb0a6('0x26')](function(_0x2e4e15){if(_0x2e4e15){if(!_0x395afd[_0xb0a6('0x52')]['channel']||!utils[_0xb0a6('0x5e')](_0x395afd[_0xb0a6('0x52')][_0xb0a6('0x56')])){throw new db[(_0xb0a6('0x57'))][(_0xb0a6('0x58'))](_0xb0a6('0x5f'));}return _0x2e4e15[_0xb0a6('0x60')+_['capitalize'](_0x395afd[_0xb0a6('0x52')]['channel'][_0xb0a6('0x5a')]())+'Queues'](_0x395afd['body']['ids']);}return null;})[_0xb0a6('0x26')](handleEntityNotFound(_0x2e4012,null))[_0xb0a6('0x26')](respondWithStatusCode(_0x2e4012,null))[_0xb0a6('0x46')](handleError(_0x2e4012,null));};exports[_0xb0a6('0x61')]=function(_0x183794,_0x427986,_0x2906a0){return db[_0xb0a6('0x42')]['findOne']({'where':{'id':_0x183794['params']['id']}})[_0xb0a6('0x26')](function(_0x342734){if(_0x342734){if(!_0x183794[_0xb0a6('0x32')][_0xb0a6('0x56')]||!utils[_0xb0a6('0x5e')](_0x183794[_0xb0a6('0x32')]['channel'])){throw new db[(_0xb0a6('0x57'))][(_0xb0a6('0x58'))](_0xb0a6('0x5f'));}return _0x342734['remove'+_['capitalize'](_0x183794[_0xb0a6('0x32')][_0xb0a6('0x56')][_0xb0a6('0x5a')]())+_0xb0a6('0x5c')](_0x183794['query'][_0xb0a6('0x62')]);}return null;})[_0xb0a6('0x26')](handleEntityNotFound(_0x427986,null))['then'](respondWithStatusCode(_0x427986,null))[_0xb0a6('0x46')](handleError(_0x427986,null));};exports['addAgents']=function(_0x2b0fad,_0x47439d,_0x49528c){return db[_0xb0a6('0x42')][_0xb0a6('0x4e')]({'where':{'id':_0x2b0fad[_0xb0a6('0x53')]['id']}})[_0xb0a6('0x26')](handleEntityNotFound(_0x47439d,null))[_0xb0a6('0x26')](function(_0xf046b5){if(_0xf046b5){var _0x1e9ad4=[_0xb0a6('0x63'),_0xb0a6('0x64'),_0xb0a6('0x65'),'Sms',_0xb0a6('0x66'),_0xb0a6('0x67')];return BPromise['each'](_0x1e9ad4,function(_0x2b3f7d){return _0xf046b5[_0xb0a6('0x4b')+_0x2b3f7d+'Queues']({'attributes':['id',_0xb0a6('0x40')]})[_0xb0a6('0x26')](function(_0x5ecc66){return BPromise[_0xb0a6('0x68')](_0x5ecc66,function(_0xa9c252){return _0xa9c252[_0xb0a6('0x69')](_0x2b0fad[_0xb0a6('0x52')]['ids'])['then'](function(){if(_0x2b3f7d===_0xb0a6('0x63')){return db[_0xb0a6('0x6a')]['findAll']({'where':{'id':_0x2b0fad[_0xb0a6('0x52')]['ids']},'attributes':['id',_0xb0a6('0x40'),_0xb0a6('0x6b'),_0xb0a6('0x6c'),'interface'],'raw':!![]})[_0xb0a6('0x26')](function(_0x3af4aa){return BPromise[_0xb0a6('0x68')](_[_0xb0a6('0x3e')](_0x3af4aa,{'online':0x1}),function(_0x48545b){return db['UserVoiceQueueRt'][_0xb0a6('0x6d')]({'membername':_0x48545b[_0xb0a6('0x40')],'UserId':_0x48545b['id'],'queue_name':_0xa9c252[_0xb0a6('0x40')],'VoiceQueueId':_0xa9c252['id'],'interface':_[_0xb0a6('0x6e')](_0x48545b['interface'])?util[_0xb0a6('0x6f')](_0xb0a6('0x70'),_0x48545b[_0xb0a6('0x40')]):_0x48545b[_0xb0a6('0x71')],'paused':_0x48545b[_0xb0a6('0x6c')]||![],'penalty':0x0});});});}});});})['then'](function(){return _0xf046b5;});})[_0xb0a6('0x26')](function(){return _0xf046b5;});}})[_0xb0a6('0x26')](function(_0x32d481){if(_0x32d481){return _0x32d481[_0xb0a6('0x69')](_0x2b0fad[_0xb0a6('0x52')][_0xb0a6('0x62')],_[_0xb0a6('0x72')](_0x2b0fad[_0xb0a6('0x52')],['ids','id'])||{})['spread'](function(_0x48a5a7){for(var _0x24aacb=0x0;_0x24aacb<_0x2b0fad[_0xb0a6('0x52')][_0xb0a6('0x62')]['length'];_0x24aacb+=0x1){socket[_0xb0a6('0x73')](_0xb0a6('0x74'),{'UserId':_0x2b0fad[_0xb0a6('0x52')]['ids'][_0x24aacb],'TeamId':_0x2b0fad['params']['id']});}return _0x48a5a7;});}})[_0xb0a6('0x26')](respondWithResult(_0x47439d,null))[_0xb0a6('0x46')](handleError(_0x47439d,null));};exports[_0xb0a6('0x75')]=function(_0x550ba1,_0x58da5d,_0x28b503){return db[_0xb0a6('0x42')][_0xb0a6('0x4e')]({'where':{'id':_0x550ba1[_0xb0a6('0x53')]['id']}})[_0xb0a6('0x26')](handleEntityNotFound(_0x58da5d,null))[_0xb0a6('0x26')](function(_0x5ec6d6){if(_0x5ec6d6){return BPromise[_0xb0a6('0x68')]([_0xb0a6('0x76'),_0xb0a6('0x77'),_0xb0a6('0x78'),_0xb0a6('0x79'),_0xb0a6('0x7a'),_0xb0a6('0x7b')],function(_0x503318){return _0x5ec6d6[_0xb0a6('0x4b')+_[_0xb0a6('0x59')](_0x503318)+_0xb0a6('0x5c')]({'attributes':['id',_0xb0a6('0x40')]})['then'](function(_0x27a6e8){return BPromise[_0xb0a6('0x68')](_0x27a6e8,function(_0x4dadaa){return _0x4dadaa[_0xb0a6('0x75')](_0x550ba1[_0xb0a6('0x32')]['ids'])[_0xb0a6('0x26')](function(){if(_0x503318===_0xb0a6('0x76')){return db[_0xb0a6('0x7c')][_0xb0a6('0x27')]({'where':{'VoiceQueueId':_0x4dadaa['id'],'UserId':_0x550ba1[_0xb0a6('0x32')][_0xb0a6('0x62')]}});}});});})['then'](function(){return _0x5ec6d6;});})[_0xb0a6('0x26')](function(){return _0x5ec6d6;});}})[_0xb0a6('0x26')](function(_0x294633){if(_0x294633){return _0x294633['removeAgents'](_0x550ba1[_0xb0a6('0x32')][_0xb0a6('0x62')])['then'](function(){if(_[_0xb0a6('0x7d')](_0x550ba1[_0xb0a6('0x32')][_0xb0a6('0x62')])){for(var _0x4588a7=0x0;_0x4588a7<_0x550ba1[_0xb0a6('0x32')][_0xb0a6('0x62')][_0xb0a6('0x38')];_0x4588a7+=0x1){socket[_0xb0a6('0x73')](_0xb0a6('0x7e'),{'UserId':Number(_0x550ba1[_0xb0a6('0x32')][_0xb0a6('0x62')][_0x4588a7]),'TeamId':Number(_0x550ba1[_0xb0a6('0x53')]['id'])});}}else{socket[_0xb0a6('0x73')](_0xb0a6('0x7e'),{'UserId':Number(_0x550ba1['query'][_0xb0a6('0x62')]),'TeamId':Number(_0x550ba1['params']['id'])});}});}})[_0xb0a6('0x26')](respondWithStatusCode(_0x58da5d,null))[_0xb0a6('0x46')](handleError(_0x58da5d,null));};exports[_0xb0a6('0x7f')]=function(_0x4c6153,_0x21bd2b,_0x409541){var _0x3137f6={};var _0x4e0d50={};var _0x26895d;var _0x5e1926;return db[_0xb0a6('0x42')]['findOne']({'where':{'id':_0x4c6153['params']['id']}})['then'](handleEntityNotFound(_0x21bd2b,null))[_0xb0a6('0x26')](function(_0x11a40b){if(_0x11a40b){_0x26895d=_0x11a40b;_0x4e0d50['model']=_[_0xb0a6('0x33')](db['User']['rawAttributes']);_0x4e0d50[_0xb0a6('0x32')]=_[_0xb0a6('0x33')](_0x4c6153['query']);_0x4e0d50[_0xb0a6('0x34')]=_['intersection'](_0x4e0d50[_0xb0a6('0x31')],_0x4e0d50[_0xb0a6('0x32')]);_0x3137f6[_0xb0a6('0x37')]=_['intersection'](_0x4e0d50[_0xb0a6('0x31')],qs[_0xb0a6('0x36')](_0x4c6153[_0xb0a6('0x32')][_0xb0a6('0x36')]));_0x3137f6[_0xb0a6('0x37')]=_0x3137f6[_0xb0a6('0x37')]['length']?_0x3137f6[_0xb0a6('0x37')]:_0x4e0d50['model'];_0x3137f6[_0xb0a6('0x3a')]=qs[_0xb0a6('0x3b')](_0x4c6153[_0xb0a6('0x32')]['sort']);_0x3137f6[_0xb0a6('0x3c')]=qs[_0xb0a6('0x34')](_[_0xb0a6('0x3d')](_0x4c6153['query'],_0x4e0d50[_0xb0a6('0x34')]));if(_0x4c6153[_0xb0a6('0x32')][_0xb0a6('0x3e')]){_0x3137f6[_0xb0a6('0x3c')]=_[_0xb0a6('0x48')](_0x3137f6[_0xb0a6('0x3c')],{'$or':_[_0xb0a6('0x2e')](_0x3137f6[_0xb0a6('0x37')],function(_0x22e694){var _0x313d2f={};_0x313d2f[_0x22e694]={'$like':'%'+_0x4c6153[_0xb0a6('0x32')][_0xb0a6('0x3e')]+'%'};return _0x313d2f;})});}_0x3137f6=_['merge']({},_0x3137f6,_0x4c6153[_0xb0a6('0x41')]);return _0x26895d['getAgents'](_0x3137f6);}})[_0xb0a6('0x26')](function(_0x35c197){if(_0x35c197){_0x5e1926=_0x35c197[_0xb0a6('0x38')];if(!_0x4c6153[_0xb0a6('0x32')][_0xb0a6('0x39')](_0xb0a6('0x80'))){_0x3137f6['limit']=qs['limit'](_0x4c6153[_0xb0a6('0x32')]['limit']);_0x3137f6[_0xb0a6('0x20')]=qs[_0xb0a6('0x20')](_0x4c6153['query'][_0xb0a6('0x20')]);}return _0x26895d[_0xb0a6('0x7f')](_0x3137f6);}})[_0xb0a6('0x26')](function(_0x250e19){if(_0x250e19){return _0x250e19?{'count':_0x5e1926,'rows':_0x250e19}:null;}})[_0xb0a6('0x26')](respondWithResult(_0x21bd2b,null))[_0xb0a6('0x46')](handleError(_0x21bd2b,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index bf65ef6..cf0ee9c 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 _0x3956=['emit','hook','events','Team','setMaxListeners','save','update','remove'];(function(_0x37de01,_0x3005bb){var _0x5af22f=function(_0x4d1ad1){while(--_0x4d1ad1){_0x37de01['push'](_0x37de01['shift']());}};_0x5af22f(++_0x3005bb);}(_0x3956,0x1da));var _0x6395=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0x3956[_0x3b5250];return _0xc844a1;};'use strict';var EventEmitter=require(_0x6395('0x0'));var Team=require('../../mysqldb')['db'][_0x6395('0x1')];var TeamEvents=new EventEmitter();TeamEvents[_0x6395('0x2')](0x0);var events={'afterCreate':_0x6395('0x3'),'afterUpdate':_0x6395('0x4'),'afterDestroy':_0x6395('0x5')};function emitEvent(_0x4e28aa){return function(_0x5f0e88,_0x7dbac6,_0x397a05){TeamEvents['emit'](_0x4e28aa+':'+_0x5f0e88['id'],_0x5f0e88);TeamEvents[_0x6395('0x6')](_0x4e28aa,_0x5f0e88);_0x397a05(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Team[_0x6395('0x7')](e,emitEvent(event));}}module['exports']=TeamEvents; \ No newline at end of file +var _0x25fd=['emit','hasOwnProperty','exports','../../mysqldb','setMaxListeners','save','update','remove'];(function(_0x1ee04d,_0x4b9f61){var _0x46a06e=function(_0x515e3a){while(--_0x515e3a){_0x1ee04d['push'](_0x1ee04d['shift']());}};_0x46a06e(++_0x4b9f61);}(_0x25fd,0x143));var _0xd25f=function(_0x2b0aef,_0x1fe494){_0x2b0aef=_0x2b0aef-0x0;var _0x3d01fd=_0x25fd[_0x2b0aef];return _0x3d01fd;};'use strict';var EventEmitter=require('events');var Team=require(_0xd25f('0x0'))['db']['Team'];var TeamEvents=new EventEmitter();TeamEvents[_0xd25f('0x1')](0x0);var events={'afterCreate':_0xd25f('0x2'),'afterUpdate':_0xd25f('0x3'),'afterDestroy':_0xd25f('0x4')};function emitEvent(_0x30d89a){return function(_0x372c80,_0x567c97,_0xb889f7){TeamEvents[_0xd25f('0x5')](_0x30d89a+':'+_0x372c80['id'],_0x372c80);TeamEvents['emit'](_0x30d89a,_0x372c80);_0xb889f7(null);};}for(var e in events){if(events[_0xd25f('0x6')](e)){var event=events[e];Team['hook'](e,emitEvent(event));}}module[_0xd25f('0x7')]=TeamEvents; \ No newline at end of file diff --git a/server/api/team/team.model.js b/server/api/team/team.model.js index 8af62c5..a038fe7 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 _0xa0d2=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','exports','define','Team','lodash','util','../../config/logger'];(function(_0x17b0a0,_0x10c796){var _0x3670d1=function(_0x354089){while(--_0x354089){_0x17b0a0['push'](_0x17b0a0['shift']());}};_0x3670d1(++_0x10c796);}(_0xa0d2,0xb3));var _0x2a0d=function(_0x332d83,_0x227857){_0x332d83=_0x332d83-0x0;var _0x497ef8=_0xa0d2[_0x332d83];return _0x497ef8;};'use strict';var _=require(_0x2a0d('0x0'));var util=require(_0x2a0d('0x1'));var logger=require(_0x2a0d('0x2'))(_0x2a0d('0x3'));var moment=require(_0x2a0d('0x4'));var BPromise=require(_0x2a0d('0x5'));var rp=require(_0x2a0d('0x6'));var fs=require('fs');var path=require(_0x2a0d('0x7'));var rimraf=require(_0x2a0d('0x8'));var config=require(_0x2a0d('0x9'));var attributes=require(_0x2a0d('0xa'));module[_0x2a0d('0xb')]=function(_0x2a214c,_0x220943){return _0x2a214c[_0x2a0d('0xc')](_0x2a0d('0xd'),attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x182e=['bluebird','request-promise','path','rimraf','../../config/environment','./team.attributes','define','Team','teams','lodash','util','../../config/logger','api'];(function(_0x549712,_0x2c3d81){var _0x30f988=function(_0x90ce7d){while(--_0x90ce7d){_0x549712['push'](_0x549712['shift']());}};_0x30f988(++_0x2c3d81);}(_0x182e,0x1a9));var _0xe182=function(_0x3fe393,_0x234a3a){_0x3fe393=_0x3fe393-0x0;var _0x534d14=_0x182e[_0x3fe393];return _0x534d14;};'use strict';var _=require(_0xe182('0x0'));var util=require(_0xe182('0x1'));var logger=require(_0xe182('0x2'))(_0xe182('0x3'));var moment=require('moment');var BPromise=require(_0xe182('0x4'));var rp=require(_0xe182('0x5'));var fs=require('fs');var path=require(_0xe182('0x6'));var rimraf=require(_0xe182('0x7'));var config=require(_0xe182('0x8'));var attributes=require(_0xe182('0x9'));module['exports']=function(_0x1ded98,_0x469f1e){return _0x1ded98[_0xe182('0xa')](_0xe182('0xb'),attributes,{'tableName':_0xe182('0xc'),'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 b13b095..5b97ed1 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 _0x208e=['../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','register','then','Team,\x20%s,\x20%s','request\x20sent','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x150949,_0x25d810){var _0x293d2e=function(_0x18be8a){while(--_0x18be8a){_0x150949['push'](_0x150949['shift']());}};_0x293d2e(++_0x25d810);}(_0x208e,0x1bb));var _0xe208=function(_0x41ee16,_0xfa94c3){_0x41ee16=_0x41ee16-0x0;var _0x1f60de=_0x208e[_0x41ee16];return _0x1f60de;};'use strict';var _=require(_0xe208('0x0'));var util=require(_0xe208('0x1'));var moment=require(_0xe208('0x2'));var BPromise=require(_0xe208('0x3'));var rs=require(_0xe208('0x4'));var fs=require('fs');var Redis=require(_0xe208('0x5'));var db=require(_0xe208('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xe208('0x7'))(_0xe208('0x8'));var config=require(_0xe208('0x9'));var jayson=require(_0xe208('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xe208('0xb')]=_[_0xe208('0xc')](config[_0xe208('0xb')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./team.socket')[_0xe208('0xd')](socket);function respondWithRpcPromise(_0x21b1b3,_0x1dae4e,_0x375ec5){return new BPromise(function(_0x10c139,_0x45275d){return client['request'](_0x21b1b3,_0x375ec5)[_0xe208('0xe')](function(_0x51216b){logger['info'](_0xe208('0xf'),_0x1dae4e,_0xe208('0x10'));logger['debug'](_0xe208('0x11'),_0x1dae4e,_0xe208('0x10'),JSON[_0xe208('0x12')](_0x51216b));if(_0x51216b[_0xe208('0x13')]){if(_0x51216b[_0xe208('0x13')][_0xe208('0x14')]===0x1f4){logger[_0xe208('0x13')]('Team,\x20%s,\x20%s',_0x1dae4e,_0x51216b[_0xe208('0x13')][_0xe208('0x15')]);return _0x45275d(_0x51216b['error'][_0xe208('0x15')]);}logger[_0xe208('0x13')]('Team,\x20%s,\x20%s',_0x1dae4e,_0x51216b[_0xe208('0x13')][_0xe208('0x15')]);return _0x10c139(_0x51216b[_0xe208('0x13')]['message']);}else{logger[_0xe208('0x16')](_0xe208('0xf'),_0x1dae4e,_0xe208('0x10'));_0x10c139(_0x51216b[_0xe208('0x17')][_0xe208('0x15')]);}})[_0xe208('0x18')](function(_0xc9efce){logger[_0xe208('0x13')]('Team,\x20%s,\x20%s',_0x1dae4e,_0xc9efce);_0x45275d(_0xc9efce);});});} \ No newline at end of file +var _0xbbf3=['result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./team.socket','register','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x17d4fd,_0x534a36){var _0x2c73f4=function(_0x1112a5){while(--_0x1112a5){_0x17d4fd['push'](_0x17d4fd['shift']());}};_0x2c73f4(++_0x534a36);}(_0xbbf3,0x1bc));var _0x3bbf=function(_0x49d9ae,_0xeae8e9){_0x49d9ae=_0x49d9ae-0x0;var _0x32f855=_0xbbf3[_0x49d9ae];return _0x32f855;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x3bbf('0x0'));var rs=require(_0x3bbf('0x1'));var fs=require('fs');var Redis=require(_0x3bbf('0x2'));var db=require(_0x3bbf('0x3'))['db'];var utils=require(_0x3bbf('0x4'));var logger=require(_0x3bbf('0x5'))(_0x3bbf('0x6'));var config=require(_0x3bbf('0x7'));var jayson=require(_0x3bbf('0x8'));var client=jayson[_0x3bbf('0x9')][_0x3bbf('0xa')]({'port':0x232a});config[_0x3bbf('0xb')]=_[_0x3bbf('0xc')](config[_0x3bbf('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x3bbf('0xd'))(new Redis(config[_0x3bbf('0xb')]));require(_0x3bbf('0xe'))[_0x3bbf('0xf')](socket);function respondWithRpcPromise(_0x7256cb,_0x385105,_0x2b958b){return new BPromise(function(_0xb3ad71,_0x89f173){return client['request'](_0x7256cb,_0x2b958b)['then'](function(_0x152fab){logger['info'](_0x3bbf('0x10'),_0x385105,_0x3bbf('0x11'));logger[_0x3bbf('0x12')](_0x3bbf('0x13'),_0x385105,_0x3bbf('0x11'),JSON[_0x3bbf('0x14')](_0x152fab));if(_0x152fab[_0x3bbf('0x15')]){if(_0x152fab[_0x3bbf('0x15')][_0x3bbf('0x16')]===0x1f4){logger[_0x3bbf('0x15')](_0x3bbf('0x10'),_0x385105,_0x152fab[_0x3bbf('0x15')]['message']);return _0x89f173(_0x152fab[_0x3bbf('0x15')][_0x3bbf('0x17')]);}logger[_0x3bbf('0x15')](_0x3bbf('0x10'),_0x385105,_0x152fab[_0x3bbf('0x15')][_0x3bbf('0x17')]);return _0xb3ad71(_0x152fab['error'][_0x3bbf('0x17')]);}else{logger['info'](_0x3bbf('0x10'),_0x385105,_0x3bbf('0x11'));_0xb3ad71(_0x152fab[_0x3bbf('0x18')][_0x3bbf('0x17')]);}})[_0x3bbf('0x19')](function(_0x21ef39){logger['error'](_0x3bbf('0x10'),_0x385105,_0x21ef39);_0x89f173(_0x21ef39);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index 5511583..94d2ea3 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 _0x3d3d=['register','length','team:','save','remove','emit','removeListener'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x3d3d,0xab));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var TeamEvents=require('./team.events');var events=[_0xd3d3('0x0'),_0xd3d3('0x1'),'update'];function createListener(_0x2001c0,_0x53e0bd){return function(_0x3ada8f){_0x53e0bd[_0xd3d3('0x2')](_0x2001c0,_0x3ada8f);};}function removeListener(_0x1f03e9,_0x46aa0c){return function(){TeamEvents[_0xd3d3('0x3')](_0x1f03e9,_0x46aa0c);};}exports[_0xd3d3('0x4')]=function(_0x2d36ba){for(var _0x1e9338=0x0,_0x4aa421=events[_0xd3d3('0x5')];_0x1e9338<_0x4aa421;_0x1e9338++){var _0x263940=events[_0x1e9338];var _0x3fe58e=createListener(_0xd3d3('0x6')+_0x263940,_0x2d36ba);TeamEvents['on'](_0x263940,_0x3fe58e);}}; \ No newline at end of file +var _0xf40b=['team:','save','remove','update','emit','removeListener','length'];(function(_0x368fc1,_0x59d173){var _0x5b5f51=function(_0x558d6c){while(--_0x558d6c){_0x368fc1['push'](_0x368fc1['shift']());}};_0x5b5f51(++_0x59d173);}(_0xf40b,0xb0));var _0xbf40=function(_0x2fbb45,_0x1b2c7f){_0x2fbb45=_0x2fbb45-0x0;var _0x526325=_0xf40b[_0x2fbb45];return _0x526325;};'use strict';var TeamEvents=require('./team.events');var events=[_0xbf40('0x0'),_0xbf40('0x1'),_0xbf40('0x2')];function createListener(_0x456e09,_0x54143d){return function(_0x81d676){_0x54143d[_0xbf40('0x3')](_0x456e09,_0x81d676);};}function removeListener(_0x118fce,_0x887cae){return function(){TeamEvents[_0xbf40('0x4')](_0x118fce,_0x887cae);};}exports['register']=function(_0x2e74b5){for(var _0xbe1c47=0x0,_0x1c6e1b=events[_0xbf40('0x5')];_0xbe1c47<_0x1c6e1b;_0xbe1c47++){var _0x1d5add=events[_0xbe1c47];var _0x4c0875=createListener(_0xbf40('0x6')+_0x1d5add,_0x2e74b5);TeamEvents['on'](_0x1d5add,_0x4c0875);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index bfda2e9..e18bd61 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 _0xb2b8=['destroy','exports','util','connect-timeout','express','../../components/auth/service','isAuthenticated','index','/:id','show','put','update'];(function(_0x3d34da,_0x3abcc1){var _0xcf6af8=function(_0x300a53){while(--_0x300a53){_0x3d34da['push'](_0x3d34da['shift']());}};_0xcf6af8(++_0x3abcc1);}(_0xb2b8,0x86));var _0x8b2b=function(_0x290294,_0x4187c5){_0x290294=_0x290294-0x0;var _0x1012ab=_0xb2b8[_0x290294];return _0x1012ab;};'use strict';var multer=require('multer');var util=require(_0x8b2b('0x0'));var path=require('path');var timeout=require(_0x8b2b('0x1'));var express=require(_0x8b2b('0x2'));var router=express['Router']();var auth=require(_0x8b2b('0x3'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./template.controller');router['get']('/',auth[_0x8b2b('0x4')](),controller[_0x8b2b('0x5')]);router['get'](_0x8b2b('0x6'),auth['isAuthenticated'](),controller[_0x8b2b('0x7')]);router['post']('/',auth[_0x8b2b('0x4')](),controller['create']);router[_0x8b2b('0x8')]('/:id',auth[_0x8b2b('0x4')](),controller[_0x8b2b('0x9')]);router['delete'](_0x8b2b('0x6'),auth[_0x8b2b('0x4')](),controller[_0x8b2b('0xa')]);module[_0x8b2b('0xb')]=router; \ No newline at end of file +var _0x25b7=['/:id','show','create','put','update','delete','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./template.controller','get','isAuthenticated'];(function(_0x27d590,_0x18041b){var _0x18aaa7=function(_0x2c3f8e){while(--_0x2c3f8e){_0x27d590['push'](_0x27d590['shift']());}};_0x18aaa7(++_0x18041b);}(_0x25b7,0x197));var _0x725b=function(_0x450b00,_0x1cc659){_0x450b00=_0x450b00-0x0;var _0x219b54=_0x25b7[_0x450b00];return _0x219b54;};'use strict';var multer=require(_0x725b('0x0'));var util=require('util');var path=require(_0x725b('0x1'));var timeout=require(_0x725b('0x2'));var express=require(_0x725b('0x3'));var router=express[_0x725b('0x4')]();var auth=require(_0x725b('0x5'));var interaction=require(_0x725b('0x6'));var config=require(_0x725b('0x7'));var controller=require(_0x725b('0x8'));router[_0x725b('0x9')]('/',auth[_0x725b('0xa')](),controller['index']);router['get'](_0x725b('0xb'),auth['isAuthenticated'](),controller[_0x725b('0xc')]);router['post']('/',auth[_0x725b('0xa')](),controller[_0x725b('0xd')]);router[_0x725b('0xe')](_0x725b('0xb'),auth[_0x725b('0xa')](),controller[_0x725b('0xf')]);router[_0x725b('0x10')]('/:id',auth[_0x725b('0xa')](),controller[_0x725b('0x11')]);module[_0x725b('0x12')]=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index 8613b8d..9b3fff2 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 _0x8508=['STRING'];(function(_0x56efc5,_0x544a0b){var _0x1fd666=function(_0x179297){while(--_0x179297){_0x56efc5['push'](_0x56efc5['shift']());}};_0x1fd666(++_0x544a0b);}(_0x8508,0x1b8));var _0x8850=function(_0x40aab7,_0x5f2677){_0x40aab7=_0x40aab7-0x0;var _0x38261e=_0x8508[_0x40aab7];return _0x38261e;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x8850('0x0')]},'description':{'type':Sequelize[_0x8850('0x0')]},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0xc2c8=['exports','TEXT','sequelize'];(function(_0x23e857,_0x3f2ec4){var _0x88ff38=function(_0x4c6d90){while(--_0x4c6d90){_0x23e857['push'](_0x23e857['shift']());}};_0x88ff38(++_0x3f2ec4);}(_0xc2c8,0xda));var _0x8c2c=function(_0x4f097b,_0x6a0350){_0x4f097b=_0x4f097b-0x0;var _0x2bed3c=_0xc2c8[_0x4f097b];return _0x2bed3c;};'use strict';var Sequelize=require(_0x8c2c('0x0'));module[_0x8c2c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize[_0x8c2c('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index c532cd9..6d8c793 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 _0x1bd8=['desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','Templates','UserProfileResource','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','nolimit','sort','where','filter','merge','VIRTUAL','findAll','rows','show','params','length','includeAll','include','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','find','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','jsforce'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x1bd8,0x136));var _0x81bd=function(_0x5ad08b,_0x398ddd){_0x5ad08b=_0x5ad08b-0x0;var _0x102a21=_0x1bd8[_0x5ad08b];return _0x102a21;};'use strict';var pdf=require(_0x81bd('0x0'));var emlformat=require(_0x81bd('0x1'));var rimraf=require(_0x81bd('0x2'));var zipdir=require(_0x81bd('0x3'));var jsonpatch=require(_0x81bd('0x4'));var rp=require(_0x81bd('0x5'));var moment=require(_0x81bd('0x6'));var BPromise=require(_0x81bd('0x7'));var Mustache=require(_0x81bd('0x8'));var util=require(_0x81bd('0x9'));var path=require('path');var sox=require(_0x81bd('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x81bd('0xb'));var squel=require('squel');var crypto=require(_0x81bd('0xc'));var jsforce=require(_0x81bd('0xd'));var deskjs=require(_0x81bd('0xe'));var toCsv=require(_0x81bd('0xf'));var querystring=require(_0x81bd('0x10'));var Papa=require(_0x81bd('0x11'));var Redis=require(_0x81bd('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x81bd('0x13'));var as=require(_0x81bd('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x81bd('0x15'));var utils=require(_0x81bd('0x16'));var config=require(_0x81bd('0x17'));var db=require(_0x81bd('0x18'))['db'];function respondWithStatusCode(_0x4188c8,_0x3524b6){_0x3524b6=_0x3524b6||0xcc;return function(_0x1fa4f6){if(_0x1fa4f6){return _0x4188c8[_0x81bd('0x19')](_0x3524b6);}return _0x4188c8[_0x81bd('0x1a')](_0x3524b6)[_0x81bd('0x1b')]();};}function respondWithResult(_0xb249c1,_0x49fd6d){_0x49fd6d=_0x49fd6d||0xc8;return function(_0x926277){if(_0x926277){return _0xb249c1['status'](_0x49fd6d)[_0x81bd('0x1c')](_0x926277);}};}function respondWithFilteredResult(_0x14e442,_0x38248a){return function(_0x5bd235){if(_0x5bd235){var _0x47f07f=_0x5bd235[_0x81bd('0x1d')],_0x2c9f36=_0x38248a[_0x81bd('0x1e')],_0x4c9532=_0x38248a[_0x81bd('0x1e')]+_0x38248a[_0x81bd('0x1f')],_0x174693;if(_0x4c9532>=_0x47f07f){_0x4c9532=_0x47f07f;_0x174693=0xc8;}else{_0x174693=0xce;}_0x14e442[_0x81bd('0x1a')](_0x174693);return _0x14e442[_0x81bd('0x20')](_0x81bd('0x21'),_0x2c9f36+'-'+_0x4c9532+'/'+_0x47f07f)[_0x81bd('0x1c')](_0x5bd235);}return null;};}function patchUpdates(_0x4c6995){return function(_0x2a549c){try{jsonpatch[_0x81bd('0x22')](_0x2a549c,_0x4c6995,!![]);}catch(_0x14807f){return BPromise[_0x81bd('0x23')](_0x14807f);}return _0x2a549c['save']();};}function saveUpdates(_0x4c4c9b,_0x5a5180){return function(_0x21124a){if(_0x21124a){return _0x21124a['update'](_0x4c4c9b)[_0x81bd('0x24')](function(_0x4a61f8){return _0x4a61f8;});}return null;};}function removeEntity(_0x30b2f6,_0x36157e){return function(_0x2c85d1){if(_0x2c85d1){return _0x2c85d1[_0x81bd('0x25')]()[_0x81bd('0x24')](function(){var _0x140101=_0x2c85d1['get']({'plain':!![]});var _0x164d54=_0x81bd('0x26');return db[_0x81bd('0x27')][_0x81bd('0x25')]({'where':{'type':_0x164d54,'resourceId':_0x140101['id']}})['then'](function(){return _0x2c85d1;});})['then'](function(){_0x30b2f6[_0x81bd('0x1a')](0xcc)[_0x81bd('0x1b')]();});}};}function handleEntityNotFound(_0x5dd60e,_0x5751b8){return function(_0x447079){if(!_0x447079){_0x5dd60e[_0x81bd('0x19')](0x194);}return _0x447079;};}function handleError(_0x1382f8,_0x17583c){_0x17583c=_0x17583c||0x1f4;return function(_0x464a4e){logger['error'](_0x464a4e[_0x81bd('0x28')]);if(_0x464a4e[_0x81bd('0x29')]){delete _0x464a4e[_0x81bd('0x29')];}_0x1382f8['status'](_0x17583c)[_0x81bd('0x2a')](_0x464a4e);};}exports[_0x81bd('0x2b')]=function(_0x14c957,_0x80b0b2){var _0x49f3fb={},_0x35de50={},_0x52981b={'count':0x0,'rows':[]};var _0x2214e1=_[_0x81bd('0x2c')](db[_0x81bd('0x2d')][_0x81bd('0x2e')],function(_0x4710de){return{'name':_0x4710de[_0x81bd('0x2f')],'type':_0x4710de[_0x81bd('0x30')][_0x81bd('0x31')]};});_0x35de50['model']=_[_0x81bd('0x2c')](_0x2214e1,'name');_0x35de50[_0x81bd('0x32')]=_[_0x81bd('0x33')](_0x14c957[_0x81bd('0x32')]);_0x35de50[_0x81bd('0x34')]=_[_0x81bd('0x35')](_0x35de50[_0x81bd('0x36')],_0x35de50['query']);_0x49f3fb[_0x81bd('0x37')]=_['intersection'](_0x35de50[_0x81bd('0x36')],qs[_0x81bd('0x38')](_0x14c957[_0x81bd('0x32')]['fields']));_0x49f3fb['attributes']=_0x49f3fb[_0x81bd('0x37')]['length']?_0x49f3fb[_0x81bd('0x37')]:_0x35de50[_0x81bd('0x36')];if(!_0x14c957['query']['hasOwnProperty'](_0x81bd('0x39'))){_0x49f3fb[_0x81bd('0x1f')]=qs['limit'](_0x14c957[_0x81bd('0x32')][_0x81bd('0x1f')]);_0x49f3fb[_0x81bd('0x1e')]=qs['offset'](_0x14c957[_0x81bd('0x32')][_0x81bd('0x1e')]);}_0x49f3fb['order']=qs[_0x81bd('0x3a')](_0x14c957[_0x81bd('0x32')]['sort']);_0x49f3fb[_0x81bd('0x3b')]=qs[_0x81bd('0x34')](_['pick'](_0x14c957[_0x81bd('0x32')],_0x35de50['filters']));if(_0x14c957[_0x81bd('0x32')][_0x81bd('0x3c')]){_0x49f3fb[_0x81bd('0x3b')]=_[_0x81bd('0x3d')](_0x49f3fb[_0x81bd('0x3b')],{'$or':_[_0x81bd('0x2c')](_0x2214e1,function(_0x3fc386){if(_0x3fc386[_0x81bd('0x30')]!==_0x81bd('0x3e')){var _0x340d03={};_0x340d03[_0x3fc386[_0x81bd('0x29')]]={'$like':'%'+_0x14c957[_0x81bd('0x32')][_0x81bd('0x3c')]+'%'};return _0x340d03;}})});}_0x49f3fb=_['merge']({},_0x49f3fb,_0x14c957['options']);var _0x415b72={'where':_0x49f3fb[_0x81bd('0x3b')]};return db[_0x81bd('0x2d')][_0x81bd('0x1d')](_0x415b72)[_0x81bd('0x24')](function(_0x38683c){_0x52981b[_0x81bd('0x1d')]=_0x38683c;if(_0x14c957[_0x81bd('0x32')]['includeAll']){_0x49f3fb['include']=[{'all':!![]}];}return db[_0x81bd('0x2d')][_0x81bd('0x3f')](_0x49f3fb);})[_0x81bd('0x24')](function(_0x2080e8){_0x52981b[_0x81bd('0x40')]=_0x2080e8;return _0x52981b;})[_0x81bd('0x24')](respondWithFilteredResult(_0x80b0b2,_0x49f3fb))['catch'](handleError(_0x80b0b2,null));};exports[_0x81bd('0x41')]=function(_0x55e089,_0x5ed90f){var _0xefb258={'raw':!![],'where':{'id':_0x55e089[_0x81bd('0x42')]['id']}},_0x4bb45d={};_0x4bb45d['model']=_[_0x81bd('0x33')](db[_0x81bd('0x2d')][_0x81bd('0x2e')]);_0x4bb45d['query']=_[_0x81bd('0x33')](_0x55e089[_0x81bd('0x32')]);_0x4bb45d['filters']=_['intersection'](_0x4bb45d[_0x81bd('0x36')],_0x4bb45d['query']);_0xefb258['attributes']=_[_0x81bd('0x35')](_0x4bb45d[_0x81bd('0x36')],qs[_0x81bd('0x38')](_0x55e089[_0x81bd('0x32')][_0x81bd('0x38')]));_0xefb258['attributes']=_0xefb258['attributes'][_0x81bd('0x43')]?_0xefb258[_0x81bd('0x37')]:_0x4bb45d[_0x81bd('0x36')];if(_0x55e089['query'][_0x81bd('0x44')]){_0xefb258[_0x81bd('0x45')]=[{'all':!![]}];}_0xefb258=_[_0x81bd('0x3d')]({},_0xefb258,_0x55e089['options']);return db[_0x81bd('0x2d')]['find'](_0xefb258)['then'](handleEntityNotFound(_0x5ed90f,null))['then'](respondWithResult(_0x5ed90f,null))['catch'](handleError(_0x5ed90f,null));};exports[_0x81bd('0x46')]=function(_0x538e56,_0x88d639){return db[_0x81bd('0x2d')][_0x81bd('0x46')](_0x538e56[_0x81bd('0x47')],{})[_0x81bd('0x24')](function(_0x5e0eb1){var _0xf15855=_0x538e56['user']['get']({'plain':!![]});if(!_0xf15855)throw new Error(_0x81bd('0x48'));if(_0xf15855[_0x81bd('0x49')]===_0x81bd('0x4a')){var _0xc544fd=_0x5e0eb1['get']({'plain':!![]});var _0x11e213=_0x81bd('0x26');return db[_0x81bd('0x4b')][_0x81bd('0x4c')]({'where':{'name':_0x11e213,'userProfileId':_0xf15855['userProfileId']},'raw':!![]})['then'](function(_0x4f55b6){if(_0x4f55b6&&_0x4f55b6['autoAssociation']===0x0){return db[_0x81bd('0x27')]['create']({'name':_0xc544fd[_0x81bd('0x29')],'resourceId':_0xc544fd['id'],'type':_0x4f55b6['name'],'sectionId':_0x4f55b6['id']},{})[_0x81bd('0x24')](function(){return _0x5e0eb1;});}else{return _0x5e0eb1;}})[_0x81bd('0x4d')](function(_0x3be6a0){logger[_0x81bd('0x4e')](_0x81bd('0x4f'),_0x3be6a0);throw _0x3be6a0;});}return _0x5e0eb1;})['then'](respondWithResult(_0x88d639,0xc9))[_0x81bd('0x4d')](handleError(_0x88d639,null));};exports[_0x81bd('0x50')]=function(_0x529ea0,_0x523141){if(_0x529ea0[_0x81bd('0x47')]['id']){delete _0x529ea0[_0x81bd('0x47')]['id'];}return db[_0x81bd('0x2d')][_0x81bd('0x4c')]({'where':{'id':_0x529ea0[_0x81bd('0x42')]['id']}})[_0x81bd('0x24')](handleEntityNotFound(_0x523141,null))['then'](saveUpdates(_0x529ea0['body'],null))[_0x81bd('0x24')](respondWithResult(_0x523141,null))[_0x81bd('0x4d')](handleError(_0x523141,null));};exports[_0x81bd('0x25')]=function(_0xdb859b,_0x517e42){return db[_0x81bd('0x2d')][_0x81bd('0x4c')]({'where':{'id':_0xdb859b[_0x81bd('0x42')]['id']}})[_0x81bd('0x24')](handleEntityNotFound(_0x517e42,null))['then'](removeEntity(_0x517e42,null))[_0x81bd('0x4d')](handleError(_0x517e42,null));}; \ No newline at end of file +var _0x68ed=['api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','get','UserProfileResource','destroy','end','error','stack','name','send','index','map','Template','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','include','findAll','catch','show','length','includeAll','find','create','body','role','user','Templates','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x4c43fa,_0x5a02ec){var _0x570b68=function(_0x5de556){while(--_0x5de556){_0x4c43fa['push'](_0x4c43fa['shift']());}};_0x570b68(++_0x5a02ec);}(_0x68ed,0x13e));var _0xd68e=function(_0x212d06,_0x312158){_0x212d06=_0x212d06-0x0;var _0x742812=_0x68ed[_0x212d06];return _0x742812;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd68e('0x0'));var rimraf=require(_0xd68e('0x1'));var zipdir=require(_0xd68e('0x2'));var jsonpatch=require(_0xd68e('0x3'));var rp=require(_0xd68e('0x4'));var moment=require(_0xd68e('0x5'));var BPromise=require(_0xd68e('0x6'));var Mustache=require(_0xd68e('0x7'));var util=require(_0xd68e('0x8'));var path=require(_0xd68e('0x9'));var sox=require('sox');var csv=require(_0xd68e('0xa'));var ejs=require(_0xd68e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd68e('0xc'));var jsforce=require(_0xd68e('0xd'));var deskjs=require(_0xd68e('0xe'));var toCsv=require(_0xd68e('0xa'));var querystring=require(_0xd68e('0xf'));var Papa=require(_0xd68e('0x10'));var Redis=require('ioredis');var authService=require(_0xd68e('0x11'));var qs=require(_0xd68e('0x12'));var as=require(_0xd68e('0x13'));var hardwareService=require(_0xd68e('0x14'));var logger=require(_0xd68e('0x15'))(_0xd68e('0x16'));var utils=require(_0xd68e('0x17'));var config=require(_0xd68e('0x18'));var db=require(_0xd68e('0x19'))['db'];function respondWithStatusCode(_0x3c6621,_0x4d4a2b){_0x4d4a2b=_0x4d4a2b||0xcc;return function(_0x15d21c){if(_0x15d21c){return _0x3c6621[_0xd68e('0x1a')](_0x4d4a2b);}return _0x3c6621[_0xd68e('0x1b')](_0x4d4a2b)['end']();};}function respondWithResult(_0x32ed1c,_0x2cf6c5){_0x2cf6c5=_0x2cf6c5||0xc8;return function(_0x2a1890){if(_0x2a1890){return _0x32ed1c[_0xd68e('0x1b')](_0x2cf6c5)[_0xd68e('0x1c')](_0x2a1890);}};}function respondWithFilteredResult(_0x26e8b8,_0xfb138a){return function(_0x1af72a){if(_0x1af72a){var _0x1b9a37=_0x1af72a[_0xd68e('0x1d')],_0x3bb2b8=_0xfb138a[_0xd68e('0x1e')],_0x66f0c=_0xfb138a[_0xd68e('0x1e')]+_0xfb138a[_0xd68e('0x1f')],_0x2dcab0;if(_0x66f0c>=_0x1b9a37){_0x66f0c=_0x1b9a37;_0x2dcab0=0xc8;}else{_0x2dcab0=0xce;}_0x26e8b8[_0xd68e('0x1b')](_0x2dcab0);return _0x26e8b8[_0xd68e('0x20')]('Content-Range',_0x3bb2b8+'-'+_0x66f0c+'/'+_0x1b9a37)['json'](_0x1af72a);}return null;};}function patchUpdates(_0x5ecb7b){return function(_0x1f8f56){try{jsonpatch[_0xd68e('0x21')](_0x1f8f56,_0x5ecb7b,!![]);}catch(_0x16e3e9){return BPromise[_0xd68e('0x22')](_0x16e3e9);}return _0x1f8f56[_0xd68e('0x23')]();};}function saveUpdates(_0x47be65,_0x2ea9c6){return function(_0x242870){if(_0x242870){return _0x242870[_0xd68e('0x24')](_0x47be65)['then'](function(_0x3aa356){return _0x3aa356;});}return null;};}function removeEntity(_0x20511a,_0x5b8169){return function(_0x3ca7a3){if(_0x3ca7a3){return _0x3ca7a3['destroy']()[_0xd68e('0x25')](function(){var _0x3940db=_0x3ca7a3[_0xd68e('0x26')]({'plain':!![]});var _0x236834='Templates';return db[_0xd68e('0x27')][_0xd68e('0x28')]({'where':{'type':_0x236834,'resourceId':_0x3940db['id']}})[_0xd68e('0x25')](function(){return _0x3ca7a3;});})[_0xd68e('0x25')](function(){_0x20511a['status'](0xcc)[_0xd68e('0x29')]();});}};}function handleEntityNotFound(_0x2c7d8d,_0x11feb6){return function(_0x1264a5){if(!_0x1264a5){_0x2c7d8d[_0xd68e('0x1a')](0x194);}return _0x1264a5;};}function handleError(_0x888915,_0xf50d90){_0xf50d90=_0xf50d90||0x1f4;return function(_0x40c376){logger[_0xd68e('0x2a')](_0x40c376[_0xd68e('0x2b')]);if(_0x40c376[_0xd68e('0x2c')]){delete _0x40c376[_0xd68e('0x2c')];}_0x888915[_0xd68e('0x1b')](_0xf50d90)[_0xd68e('0x2d')](_0x40c376);};}exports[_0xd68e('0x2e')]=function(_0x5ccd9d,_0x4c870a){var _0xf71245={},_0x160d8b={},_0x49e79e={'count':0x0,'rows':[]};var _0x4093cb=_[_0xd68e('0x2f')](db[_0xd68e('0x30')][_0xd68e('0x31')],function(_0xb62d11){return{'name':_0xb62d11[_0xd68e('0x32')],'type':_0xb62d11[_0xd68e('0x33')][_0xd68e('0x34')]};});_0x160d8b[_0xd68e('0x35')]=_['map'](_0x4093cb,_0xd68e('0x2c'));_0x160d8b[_0xd68e('0x36')]=_[_0xd68e('0x37')](_0x5ccd9d[_0xd68e('0x36')]);_0x160d8b['filters']=_[_0xd68e('0x38')](_0x160d8b[_0xd68e('0x35')],_0x160d8b['query']);_0xf71245[_0xd68e('0x39')]=_['intersection'](_0x160d8b[_0xd68e('0x35')],qs[_0xd68e('0x3a')](_0x5ccd9d[_0xd68e('0x36')]['fields']));_0xf71245[_0xd68e('0x39')]=_0xf71245[_0xd68e('0x39')]['length']?_0xf71245['attributes']:_0x160d8b[_0xd68e('0x35')];if(!_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x3b')](_0xd68e('0x3c'))){_0xf71245[_0xd68e('0x1f')]=qs[_0xd68e('0x1f')](_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x1f')]);_0xf71245[_0xd68e('0x1e')]=qs[_0xd68e('0x1e')](_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x1e')]);}_0xf71245['order']=qs[_0xd68e('0x3d')](_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x3d')]);_0xf71245[_0xd68e('0x3e')]=qs[_0xd68e('0x3f')](_[_0xd68e('0x40')](_0x5ccd9d[_0xd68e('0x36')],_0x160d8b[_0xd68e('0x3f')]));if(_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x41')]){_0xf71245[_0xd68e('0x3e')]=_[_0xd68e('0x42')](_0xf71245[_0xd68e('0x3e')],{'$or':_['map'](_0x4093cb,function(_0xe64011){if(_0xe64011[_0xd68e('0x33')]!==_0xd68e('0x43')){var _0x624a8f={};_0x624a8f[_0xe64011[_0xd68e('0x2c')]]={'$like':'%'+_0x5ccd9d[_0xd68e('0x36')][_0xd68e('0x41')]+'%'};return _0x624a8f;}})});}_0xf71245=_['merge']({},_0xf71245,_0x5ccd9d['options']);var _0x3c804d={'where':_0xf71245[_0xd68e('0x3e')]};return db[_0xd68e('0x30')]['count'](_0x3c804d)[_0xd68e('0x25')](function(_0x3152df){_0x49e79e[_0xd68e('0x1d')]=_0x3152df;if(_0x5ccd9d['query']['includeAll']){_0xf71245[_0xd68e('0x44')]=[{'all':!![]}];}return db['Template'][_0xd68e('0x45')](_0xf71245);})[_0xd68e('0x25')](function(_0x58ecda){_0x49e79e['rows']=_0x58ecda;return _0x49e79e;})[_0xd68e('0x25')](respondWithFilteredResult(_0x4c870a,_0xf71245))[_0xd68e('0x46')](handleError(_0x4c870a,null));};exports[_0xd68e('0x47')]=function(_0x5cb68a,_0x1bf509){var _0xffa855={'raw':!![],'where':{'id':_0x5cb68a['params']['id']}},_0x3f80b6={};_0x3f80b6[_0xd68e('0x35')]=_[_0xd68e('0x37')](db['Template'][_0xd68e('0x31')]);_0x3f80b6['query']=_[_0xd68e('0x37')](_0x5cb68a[_0xd68e('0x36')]);_0x3f80b6['filters']=_[_0xd68e('0x38')](_0x3f80b6[_0xd68e('0x35')],_0x3f80b6['query']);_0xffa855['attributes']=_[_0xd68e('0x38')](_0x3f80b6[_0xd68e('0x35')],qs[_0xd68e('0x3a')](_0x5cb68a[_0xd68e('0x36')][_0xd68e('0x3a')]));_0xffa855[_0xd68e('0x39')]=_0xffa855[_0xd68e('0x39')][_0xd68e('0x48')]?_0xffa855[_0xd68e('0x39')]:_0x3f80b6[_0xd68e('0x35')];if(_0x5cb68a['query'][_0xd68e('0x49')]){_0xffa855[_0xd68e('0x44')]=[{'all':!![]}];}_0xffa855=_[_0xd68e('0x42')]({},_0xffa855,_0x5cb68a['options']);return db[_0xd68e('0x30')][_0xd68e('0x4a')](_0xffa855)[_0xd68e('0x25')](handleEntityNotFound(_0x1bf509,null))[_0xd68e('0x25')](respondWithResult(_0x1bf509,null))[_0xd68e('0x46')](handleError(_0x1bf509,null));};exports['create']=function(_0x42427f,_0x459aad){return db[_0xd68e('0x30')][_0xd68e('0x4b')](_0x42427f[_0xd68e('0x4c')],{})[_0xd68e('0x25')](function(_0x7acc66){var _0x182b55=_0x42427f['user'][_0xd68e('0x26')]({'plain':!![]});if(!_0x182b55)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x182b55[_0xd68e('0x4d')]===_0xd68e('0x4e')){var _0x2a5240=_0x7acc66[_0xd68e('0x26')]({'plain':!![]});var _0x4ff1da=_0xd68e('0x4f');return db[_0xd68e('0x50')][_0xd68e('0x4a')]({'where':{'name':_0x4ff1da,'userProfileId':_0x182b55[_0xd68e('0x51')]},'raw':!![]})[_0xd68e('0x25')](function(_0xa5ca49){if(_0xa5ca49&&_0xa5ca49[_0xd68e('0x52')]===0x0){return db[_0xd68e('0x27')][_0xd68e('0x4b')]({'name':_0x2a5240[_0xd68e('0x2c')],'resourceId':_0x2a5240['id'],'type':_0xa5ca49[_0xd68e('0x2c')],'sectionId':_0xa5ca49['id']},{})[_0xd68e('0x25')](function(){return _0x7acc66;});}else{return _0x7acc66;}})[_0xd68e('0x46')](function(_0x1c71c4){logger[_0xd68e('0x2a')](_0xd68e('0x53'),_0x1c71c4);throw _0x1c71c4;});}return _0x7acc66;})[_0xd68e('0x25')](respondWithResult(_0x459aad,0xc9))[_0xd68e('0x46')](handleError(_0x459aad,null));};exports[_0xd68e('0x24')]=function(_0x2a92e8,_0x247b57){if(_0x2a92e8[_0xd68e('0x4c')]['id']){delete _0x2a92e8['body']['id'];}return db[_0xd68e('0x30')]['find']({'where':{'id':_0x2a92e8[_0xd68e('0x54')]['id']}})[_0xd68e('0x25')](handleEntityNotFound(_0x247b57,null))[_0xd68e('0x25')](saveUpdates(_0x2a92e8['body'],null))[_0xd68e('0x25')](respondWithResult(_0x247b57,null))[_0xd68e('0x46')](handleError(_0x247b57,null));};exports[_0xd68e('0x28')]=function(_0x50f8bc,_0x4a966a){return db[_0xd68e('0x30')][_0xd68e('0x4a')]({'where':{'id':_0x50f8bc[_0xd68e('0x54')]['id']}})[_0xd68e('0x25')](handleEntityNotFound(_0x4a966a,null))[_0xd68e('0x25')](removeEntity(_0x4a966a,null))[_0xd68e('0x46')](handleError(_0x4a966a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index 0e83e3f..c7ba809 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 _0x696c=['../../config/environment','./template.attributes','define','tools_templates','lodash','util','../../config/logger','moment','bluebird','path'];(function(_0x35f9d4,_0x5dea15){var _0xfbbb29=function(_0x32a7bb){while(--_0x32a7bb){_0x35f9d4['push'](_0x35f9d4['shift']());}};_0xfbbb29(++_0x5dea15);}(_0x696c,0x68));var _0xc696=function(_0x5a3d49,_0x24b21a){_0x5a3d49=_0x5a3d49-0x0;var _0x4d5c23=_0x696c[_0x5a3d49];return _0x4d5c23;};'use strict';var _=require(_0xc696('0x0'));var util=require(_0xc696('0x1'));var logger=require(_0xc696('0x2'))('api');var moment=require(_0xc696('0x3'));var BPromise=require(_0xc696('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc696('0x5'));var rimraf=require('rimraf');var config=require(_0xc696('0x6'));var attributes=require(_0xc696('0x7'));module['exports']=function(_0x13ca91,_0x46cbed){return _0x13ca91[_0xc696('0x8')]('Template',attributes,{'tableName':_0xc696('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa931=['../../config/environment','./template.attributes','exports','define','tools_templates','../../config/logger','moment','bluebird','request-promise','rimraf'];(function(_0x3bfd56,_0x3d0aca){var _0x59b827=function(_0x5491a){while(--_0x5491a){_0x3bfd56['push'](_0x3bfd56['shift']());}};_0x59b827(++_0x3d0aca);}(_0xa931,0x69));var _0x1a93=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0xa931[_0x46e363];return _0x3fb059;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x1a93('0x0'))('api');var moment=require(_0x1a93('0x1'));var BPromise=require(_0x1a93('0x2'));var rp=require(_0x1a93('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1a93('0x4'));var config=require(_0x1a93('0x5'));var attributes=require(_0x1a93('0x6'));module[_0x1a93('0x7')]=function(_0x201553,_0x353184){return _0x201553[_0x1a93('0x8')]('Template',attributes,{'tableName':_0x1a93('0x9'),'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 836ff4e..da55c10 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 _0x5442=['options','raw','where','attributes','limit','include','map','model','GetTemplate','catch','util','randomstring','ioredis','../../config/utils','jayson/promise','client','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','stringify','error','message','result','Template'];(function(_0x337e71,_0x3500b7){var _0x1b32fd=function(_0x5a0655){while(--_0x5a0655){_0x337e71['push'](_0x337e71['shift']());}};_0x1b32fd(++_0x3500b7);}(_0x5442,0xd5));var _0x2544=function(_0x5e8d3e,_0x18ed2e){_0x5e8d3e=_0x5e8d3e-0x0;var _0x1348c0=_0x5442[_0x5e8d3e];return _0x1348c0;};'use strict';var _=require('lodash');var util=require(_0x2544('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x2544('0x1'));var fs=require('fs');var Redis=require(_0x2544('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x2544('0x3'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x2544('0x4'));var client=jayson[_0x2544('0x5')][_0x2544('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x3a40fd,_0x5c3f2b,_0x3afec5){return new BPromise(function(_0x5b4185,_0x37e2c4){return client[_0x2544('0x7')](_0x3a40fd,_0x3afec5)[_0x2544('0x8')](function(_0x29436a){logger[_0x2544('0x9')](_0x2544('0xa'),_0x5c3f2b,_0x2544('0xb'));logger[_0x2544('0xc')](_0x2544('0xd'),_0x5c3f2b,_0x2544('0xb'),JSON[_0x2544('0xe')](_0x29436a));if(_0x29436a[_0x2544('0xf')]){if(_0x29436a[_0x2544('0xf')]['code']===0x1f4){logger['error'](_0x2544('0xa'),_0x5c3f2b,_0x29436a[_0x2544('0xf')][_0x2544('0x10')]);return _0x37e2c4(_0x29436a[_0x2544('0xf')][_0x2544('0x10')]);}logger[_0x2544('0xf')](_0x2544('0xa'),_0x5c3f2b,_0x29436a[_0x2544('0xf')][_0x2544('0x10')]);return _0x5b4185(_0x29436a[_0x2544('0xf')][_0x2544('0x10')]);}else{logger['info'](_0x2544('0xa'),_0x5c3f2b,_0x2544('0xb'));_0x5b4185(_0x29436a[_0x2544('0x11')][_0x2544('0x10')]);}})['catch'](function(_0x2fd657){logger[_0x2544('0xf')](_0x2544('0xa'),_0x5c3f2b,_0x2fd657);_0x37e2c4(_0x2fd657);});});}exports['GetTemplate']=function(_0x39a2a6){var _0x58f62f=this;return new Promise(function(_0x2c9b31,_0x2f2b68){return db[_0x2544('0x12')]['findAll']({'raw':_0x39a2a6[_0x2544('0x13')]?_0x39a2a6['options'][_0x2544('0x14')]===undefined?!![]:![]:!![],'where':_0x39a2a6[_0x2544('0x13')]?_0x39a2a6[_0x2544('0x13')][_0x2544('0x15')]||null:null,'attributes':_0x39a2a6[_0x2544('0x13')]?_0x39a2a6['options'][_0x2544('0x16')]||null:null,'limit':_0x39a2a6['options']?_0x39a2a6[_0x2544('0x13')][_0x2544('0x17')]||null:null,'include':_0x39a2a6[_0x2544('0x13')]?_0x39a2a6[_0x2544('0x13')][_0x2544('0x18')]?_[_0x2544('0x19')](_0x39a2a6[_0x2544('0x13')][_0x2544('0x18')],function(_0x2f6b3d){return{'model':db[_0x2f6b3d[_0x2544('0x1a')]],'as':_0x2f6b3d['as'],'attributes':_0x2f6b3d[_0x2544('0x16')],'include':_0x2f6b3d[_0x2544('0x18')]?_[_0x2544('0x19')](_0x2f6b3d['include'],function(_0xdff47d){return{'model':db[_0xdff47d[_0x2544('0x1a')]],'as':_0xdff47d['as'],'attributes':_0xdff47d[_0x2544('0x16')],'include':_0xdff47d[_0x2544('0x18')]?_[_0x2544('0x19')](_0xdff47d['include'],function(_0x103a37){return{'model':db[_0x103a37[_0x2544('0x1a')]],'as':_0x103a37['as'],'attributes':_0x103a37['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x434882){logger['info'](_0x2544('0x1b'),_0x39a2a6);logger[_0x2544('0xc')]('GetTemplate',_0x39a2a6,JSON[_0x2544('0xe')](_0x434882));_0x2c9b31(_0x434882);})[_0x2544('0x1c')](function(_0x12b5b9){logger[_0x2544('0xf')](_0x2544('0x1b'),_0x12b5b9[_0x2544('0x10')],_0x39a2a6);_0x2f2b68(_0x58f62f[_0x2544('0xf')](0x1f4,_0x12b5b9[_0x2544('0x10')]));});});}; \ No newline at end of file +var _0x068b=['jayson/promise','client','http','then','Template,\x20%s,\x20%s','request\x20sent','debug','Template,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetTemplate','Template','findAll','options','attributes','limit','include','map','model','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x7bf5d0,_0x598fab){var _0x50d470=function(_0x335a51){while(--_0x335a51){_0x7bf5d0['push'](_0x7bf5d0['shift']());}};_0x50d470(++_0x598fab);}(_0x068b,0x74));var _0xb068=function(_0x50f5c3,_0x289d85){_0x50f5c3=_0x50f5c3-0x0;var _0x1e8ec9=_0x068b[_0x50f5c3];return _0x1e8ec9;};'use strict';var _=require('lodash');var util=require(_0xb068('0x0'));var moment=require(_0xb068('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb068('0x2'));var db=require(_0xb068('0x3'))['db'];var utils=require(_0xb068('0x4'));var logger=require(_0xb068('0x5'))(_0xb068('0x6'));var config=require(_0xb068('0x7'));var jayson=require(_0xb068('0x8'));var client=jayson[_0xb068('0x9')][_0xb068('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x51d0c6,_0x23dc03,_0x230c91){return new BPromise(function(_0x337129,_0x53c2be){return client['request'](_0x51d0c6,_0x230c91)[_0xb068('0xb')](function(_0x4652bd){logger['info'](_0xb068('0xc'),_0x23dc03,_0xb068('0xd'));logger[_0xb068('0xe')](_0xb068('0xf'),_0x23dc03,_0xb068('0xd'),JSON['stringify'](_0x4652bd));if(_0x4652bd[_0xb068('0x10')]){if(_0x4652bd[_0xb068('0x10')][_0xb068('0x11')]===0x1f4){logger[_0xb068('0x10')](_0xb068('0xc'),_0x23dc03,_0x4652bd['error'][_0xb068('0x12')]);return _0x53c2be(_0x4652bd['error']['message']);}logger[_0xb068('0x10')](_0xb068('0xc'),_0x23dc03,_0x4652bd[_0xb068('0x10')][_0xb068('0x12')]);return _0x337129(_0x4652bd[_0xb068('0x10')][_0xb068('0x12')]);}else{logger[_0xb068('0x13')](_0xb068('0xc'),_0x23dc03,_0xb068('0xd'));_0x337129(_0x4652bd[_0xb068('0x14')][_0xb068('0x12')]);}})[_0xb068('0x15')](function(_0x509d50){logger['error'](_0xb068('0xc'),_0x23dc03,_0x509d50);_0x53c2be(_0x509d50);});});}exports[_0xb068('0x16')]=function(_0xc6f747){var _0x38f47e=this;return new Promise(function(_0x13a2bd,_0x3788ae){return db[_0xb068('0x17')][_0xb068('0x18')]({'raw':_0xc6f747[_0xb068('0x19')]?_0xc6f747[_0xb068('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0xc6f747['options']?_0xc6f747[_0xb068('0x19')]['where']||null:null,'attributes':_0xc6f747['options']?_0xc6f747[_0xb068('0x19')][_0xb068('0x1a')]||null:null,'limit':_0xc6f747['options']?_0xc6f747['options'][_0xb068('0x1b')]||null:null,'include':_0xc6f747['options']?_0xc6f747[_0xb068('0x19')][_0xb068('0x1c')]?_[_0xb068('0x1d')](_0xc6f747[_0xb068('0x19')][_0xb068('0x1c')],function(_0x22d7e9){return{'model':db[_0x22d7e9[_0xb068('0x1e')]],'as':_0x22d7e9['as'],'attributes':_0x22d7e9['attributes'],'include':_0x22d7e9[_0xb068('0x1c')]?_[_0xb068('0x1d')](_0x22d7e9[_0xb068('0x1c')],function(_0x371857){return{'model':db[_0x371857[_0xb068('0x1e')]],'as':_0x371857['as'],'attributes':_0x371857[_0xb068('0x1a')],'include':_0x371857[_0xb068('0x1c')]?_[_0xb068('0x1d')](_0x371857[_0xb068('0x1c')],function(_0x3f4e79){return{'model':db[_0x3f4e79[_0xb068('0x1e')]],'as':_0x3f4e79['as'],'attributes':_0x3f4e79[_0xb068('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xb068('0xb')](function(_0x263a8b){logger['info']('GetTemplate',_0xc6f747);logger[_0xb068('0xe')](_0xb068('0x16'),_0xc6f747,JSON['stringify'](_0x263a8b));_0x13a2bd(_0x263a8b);})[_0xb068('0x15')](function(_0x34bd01){logger[_0xb068('0x10')](_0xb068('0x16'),_0x34bd01[_0xb068('0x12')],_0xc6f747);_0x3788ae(_0x38f47e['error'](0x1f4,_0x34bd01['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 7733ccb..4d9fa9a 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 _0x454d=['getAllConditions','getAnyConditions','/:id/actions','getActions','post','create','/:id/all_conditions','addAllCondition','/:id/any_conditions','addAnyCondition','addAction','update','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./trigger.controller','get','isAuthenticated','/:id','show'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x454d,0x1eb));var _0xd454=function(_0x3cb09b,_0x31c2a5){_0x3cb09b=_0x3cb09b-0x0;var _0x242048=_0x454d[_0x3cb09b];return _0x242048;};'use strict';var multer=require('multer');var util=require(_0xd454('0x0'));var path=require(_0xd454('0x1'));var timeout=require(_0xd454('0x2'));var express=require(_0xd454('0x3'));var router=express[_0xd454('0x4')]();var auth=require(_0xd454('0x5'));var interaction=require(_0xd454('0x6'));var config=require(_0xd454('0x7'));var controller=require(_0xd454('0x8'));router[_0xd454('0x9')]('/',auth[_0xd454('0xa')](),controller['index']);router[_0xd454('0x9')](_0xd454('0xb'),auth[_0xd454('0xa')](),controller[_0xd454('0xc')]);router[_0xd454('0x9')]('/:id/all_conditions',auth[_0xd454('0xa')](),controller[_0xd454('0xd')]);router[_0xd454('0x9')]('/:id/any_conditions',auth['isAuthenticated'](),controller[_0xd454('0xe')]);router[_0xd454('0x9')](_0xd454('0xf'),auth[_0xd454('0xa')](),controller[_0xd454('0x10')]);router[_0xd454('0x11')]('/',auth[_0xd454('0xa')](),controller[_0xd454('0x12')]);router['post'](_0xd454('0x13'),auth[_0xd454('0xa')](),controller[_0xd454('0x14')]);router[_0xd454('0x11')](_0xd454('0x15'),auth[_0xd454('0xa')](),controller[_0xd454('0x16')]);router[_0xd454('0x11')](_0xd454('0xf'),auth[_0xd454('0xa')](),controller[_0xd454('0x17')]);router['put']('/:id',auth[_0xd454('0xa')](),controller[_0xd454('0x18')]);router[_0xd454('0x19')]('/:id',auth[_0xd454('0xa')](),controller[_0xd454('0x1a')]);module[_0xd454('0x1b')]=router; \ No newline at end of file +var _0x61ea=['/:id/any_conditions','getAnyConditions','getActions','post','addAllCondition','addAction','put','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','/:id/all_conditions','getAllConditions'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x61ea,0x1ac));var _0xa61e=function(_0x61ed7f,_0x31fa63){_0x61ed7f=_0x61ed7f-0x0;var _0x1d3e82=_0x61ea[_0x61ed7f];return _0x1d3e82;};'use strict';var multer=require(_0xa61e('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xa61e('0x1'));var express=require(_0xa61e('0x2'));var router=express[_0xa61e('0x3')]();var auth=require(_0xa61e('0x4'));var interaction=require(_0xa61e('0x5'));var config=require('../../config/environment');var controller=require('./trigger.controller');router[_0xa61e('0x6')]('/',auth[_0xa61e('0x7')](),controller[_0xa61e('0x8')]);router[_0xa61e('0x6')](_0xa61e('0x9'),auth[_0xa61e('0x7')](),controller['show']);router[_0xa61e('0x6')](_0xa61e('0xa'),auth[_0xa61e('0x7')](),controller[_0xa61e('0xb')]);router[_0xa61e('0x6')](_0xa61e('0xc'),auth[_0xa61e('0x7')](),controller[_0xa61e('0xd')]);router[_0xa61e('0x6')]('/:id/actions',auth[_0xa61e('0x7')](),controller[_0xa61e('0xe')]);router[_0xa61e('0xf')]('/',auth[_0xa61e('0x7')](),controller['create']);router['post'](_0xa61e('0xa'),auth[_0xa61e('0x7')](),controller[_0xa61e('0x10')]);router[_0xa61e('0xf')]('/:id/any_conditions',auth['isAuthenticated'](),controller['addAnyCondition']);router['post']('/:id/actions',auth[_0xa61e('0x7')](),controller[_0xa61e('0x11')]);router[_0xa61e('0x12')]('/:id',auth[_0xa61e('0x7')](),controller['update']);router[_0xa61e('0x13')]('/:id',auth[_0xa61e('0x7')](),controller[_0xa61e('0x14')]);module[_0xa61e('0x15')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index 152a007..db27dd8 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 _0x9161=['STRING','BOOLEAN','exports'];(function(_0x1dad2b,_0x878ffa){var _0x27422b=function(_0x1119bc){while(--_0x1119bc){_0x1dad2b['push'](_0x1dad2b['shift']());}};_0x27422b(++_0x878ffa);}(_0x9161,0x10d));var _0x1916=function(_0x2f23ac,_0x34ce7f){_0x2f23ac=_0x2f23ac-0x0;var _0x4fc702=_0x9161[_0x2f23ac];return _0x4fc702;};'use strict';var Sequelize=require('sequelize');module[_0x1916('0x0')]={'name':{'type':Sequelize[_0x1916('0x1')]},'channel':{'type':Sequelize[_0x1916('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x1916('0x2')],'defaultValue':![]}}; \ No newline at end of file +var _0x76c2=['BOOLEAN','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x76c2,0xa5));var _0x276c=function(_0x5be7a3,_0x280a22){_0x5be7a3=_0x5be7a3-0x0;var _0x3bad90=_0x76c2[_0x5be7a3];return _0x3bad90;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x276c('0x0')]},'status':{'type':Sequelize[_0x276c('0x1')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index 60104b4..f491adc 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 _0x5b3e=['sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','update','then','Triggers','destroy','error','name','send','index','map','fieldName','type','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','options','Trigger','includeAll','include','rows','catch','show','params','rawAttributes','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','getAnyConditions','addAction','Action','getActions','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path'];(function(_0x567d9f,_0x44354c){var _0x28ab37=function(_0x1870ad){while(--_0x1870ad){_0x567d9f['push'](_0x567d9f['shift']());}};_0x28ab37(++_0x44354c);}(_0x5b3e,0x160));var _0xe5b3=function(_0x2db697,_0x4943d4){_0x2db697=_0x2db697-0x0;var _0x5a0e64=_0x5b3e[_0x2db697];return _0x5a0e64;};'use strict';var pdf=require(_0xe5b3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe5b3('0x1'));var zipdir=require(_0xe5b3('0x2'));var jsonpatch=require(_0xe5b3('0x3'));var rp=require('request-promise');var moment=require(_0xe5b3('0x4'));var BPromise=require(_0xe5b3('0x5'));var Mustache=require(_0xe5b3('0x6'));var util=require('util');var path=require(_0xe5b3('0x7'));var sox=require(_0xe5b3('0x8'));var csv=require(_0xe5b3('0x9'));var ejs=require(_0xe5b3('0xa'));var fs=require('fs');var _=require(_0xe5b3('0xb'));var squel=require(_0xe5b3('0xc'));var crypto=require(_0xe5b3('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xe5b3('0xe'));var toCsv=require(_0xe5b3('0x9'));var querystring=require(_0xe5b3('0xf'));var Papa=require(_0xe5b3('0x10'));var Redis=require(_0xe5b3('0x11'));var authService=require(_0xe5b3('0x12'));var qs=require(_0xe5b3('0x13'));var as=require(_0xe5b3('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe5b3('0x15'))('api');var utils=require(_0xe5b3('0x16'));var config=require(_0xe5b3('0x17'));var db=require(_0xe5b3('0x18'))['db'];function respondWithStatusCode(_0x4a87f3,_0x17f3c6){_0x17f3c6=_0x17f3c6||0xcc;return function(_0x135637){if(_0x135637){return _0x4a87f3[_0xe5b3('0x19')](_0x17f3c6);}return _0x4a87f3[_0xe5b3('0x1a')](_0x17f3c6)['end']();};}function respondWithResult(_0x21f54b,_0x1ce899){_0x1ce899=_0x1ce899||0xc8;return function(_0x2b2fc9){if(_0x2b2fc9){return _0x21f54b['status'](_0x1ce899)[_0xe5b3('0x1b')](_0x2b2fc9);}};}function respondWithFilteredResult(_0x33423f,_0xe49e31){return function(_0x402ec1){if(_0x402ec1){var _0x260c37=_0x402ec1[_0xe5b3('0x1c')],_0x3991eb=_0xe49e31[_0xe5b3('0x1d')],_0xdb1839=_0xe49e31[_0xe5b3('0x1d')]+_0xe49e31[_0xe5b3('0x1e')],_0x2e2a37;if(_0xdb1839>=_0x260c37){_0xdb1839=_0x260c37;_0x2e2a37=0xc8;}else{_0x2e2a37=0xce;}_0x33423f[_0xe5b3('0x1a')](_0x2e2a37);return _0x33423f[_0xe5b3('0x1f')](_0xe5b3('0x20'),_0x3991eb+'-'+_0xdb1839+'/'+_0x260c37)[_0xe5b3('0x1b')](_0x402ec1);}return null;};}function patchUpdates(_0x355fa7){return function(_0x35ac46){try{jsonpatch['apply'](_0x35ac46,_0x355fa7,!![]);}catch(_0x19b6bb){return BPromise['reject'](_0x19b6bb);}return _0x35ac46['save']();};}function saveUpdates(_0xc1b59c,_0xe5dc73){return function(_0x2a1563){if(_0x2a1563){return _0x2a1563[_0xe5b3('0x21')](_0xc1b59c)[_0xe5b3('0x22')](function(_0x21f11a){return _0x21f11a;});}return null;};}function removeEntity(_0x22162a,_0x1be566){return function(_0x19ebbd){if(_0x19ebbd){return _0x19ebbd['destroy']()['then'](function(){var _0x50dda0=_0x19ebbd['get']({'plain':!![]});var _0x5da779=_0xe5b3('0x23');return db['UserProfileResource'][_0xe5b3('0x24')]({'where':{'type':_0x5da779,'resourceId':_0x50dda0['id']}})[_0xe5b3('0x22')](function(){return _0x19ebbd;});})[_0xe5b3('0x22')](function(){_0x22162a[_0xe5b3('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x30dae6,_0x32081c){return function(_0x4a4863){if(!_0x4a4863){_0x30dae6['sendStatus'](0x194);}return _0x4a4863;};}function handleError(_0x1ce2bb,_0x28265a){_0x28265a=_0x28265a||0x1f4;return function(_0x189f39){logger[_0xe5b3('0x25')](_0x189f39['stack']);if(_0x189f39[_0xe5b3('0x26')]){delete _0x189f39[_0xe5b3('0x26')];}_0x1ce2bb[_0xe5b3('0x1a')](_0x28265a)[_0xe5b3('0x27')](_0x189f39);};}exports[_0xe5b3('0x28')]=function(_0x2e7d3e,_0x575845){var _0x1cab27={},_0x23c682={},_0x54cf5d={'count':0x0,'rows':[]};var _0x91ec9a=_[_0xe5b3('0x29')](db['Trigger']['rawAttributes'],function(_0x5b2982){return{'name':_0x5b2982[_0xe5b3('0x2a')],'type':_0x5b2982[_0xe5b3('0x2b')]['key']};});_0x23c682[_0xe5b3('0x2c')]=_['map'](_0x91ec9a,'name');_0x23c682[_0xe5b3('0x2d')]=_[_0xe5b3('0x2e')](_0x2e7d3e[_0xe5b3('0x2d')]);_0x23c682['filters']=_['intersection'](_0x23c682['model'],_0x23c682[_0xe5b3('0x2d')]);_0x1cab27['attributes']=_[_0xe5b3('0x2f')](_0x23c682[_0xe5b3('0x2c')],qs[_0xe5b3('0x30')](_0x2e7d3e[_0xe5b3('0x2d')][_0xe5b3('0x30')]));_0x1cab27[_0xe5b3('0x31')]=_0x1cab27[_0xe5b3('0x31')][_0xe5b3('0x32')]?_0x1cab27[_0xe5b3('0x31')]:_0x23c682['model'];if(!_0x2e7d3e[_0xe5b3('0x2d')][_0xe5b3('0x33')](_0xe5b3('0x34'))){_0x1cab27[_0xe5b3('0x1e')]=qs[_0xe5b3('0x1e')](_0x2e7d3e['query']['limit']);_0x1cab27['offset']=qs['offset'](_0x2e7d3e[_0xe5b3('0x2d')][_0xe5b3('0x1d')]);}_0x1cab27[_0xe5b3('0x35')]=qs['sort'](_0x2e7d3e[_0xe5b3('0x2d')][_0xe5b3('0x36')]);_0x1cab27[_0xe5b3('0x37')]=qs['filters'](_[_0xe5b3('0x38')](_0x2e7d3e[_0xe5b3('0x2d')],_0x23c682[_0xe5b3('0x39')]));if(_0x2e7d3e[_0xe5b3('0x2d')]['filter']){_0x1cab27['where']=_['merge'](_0x1cab27[_0xe5b3('0x37')],{'$or':_[_0xe5b3('0x29')](_0x91ec9a,function(_0x4cf976){if(_0x4cf976[_0xe5b3('0x2b')]!=='VIRTUAL'){var _0xcf09ac={};_0xcf09ac[_0x4cf976[_0xe5b3('0x26')]]={'$like':'%'+_0x2e7d3e[_0xe5b3('0x2d')][_0xe5b3('0x3a')]+'%'};return _0xcf09ac;}})});}_0x1cab27=_[_0xe5b3('0x3b')]({},_0x1cab27,_0x2e7d3e[_0xe5b3('0x3c')]);var _0x3cc0c9={'where':_0x1cab27[_0xe5b3('0x37')]};return db[_0xe5b3('0x3d')]['count'](_0x3cc0c9)[_0xe5b3('0x22')](function(_0x846376){_0x54cf5d[_0xe5b3('0x1c')]=_0x846376;if(_0x2e7d3e['query'][_0xe5b3('0x3e')]){_0x1cab27[_0xe5b3('0x3f')]=[{'all':!![]}];}return db[_0xe5b3('0x3d')]['findAll'](_0x1cab27);})[_0xe5b3('0x22')](function(_0x31f043){_0x54cf5d[_0xe5b3('0x40')]=_0x31f043;return _0x54cf5d;})[_0xe5b3('0x22')](respondWithFilteredResult(_0x575845,_0x1cab27))[_0xe5b3('0x41')](handleError(_0x575845,null));};exports[_0xe5b3('0x42')]=function(_0x78311a,_0x57106e){var _0x2f1d0b={'raw':![],'where':{'id':_0x78311a[_0xe5b3('0x43')]['id']}},_0x1b0305={};_0x1b0305[_0xe5b3('0x2c')]=_[_0xe5b3('0x2e')](db[_0xe5b3('0x3d')][_0xe5b3('0x44')]);_0x1b0305[_0xe5b3('0x2d')]=_[_0xe5b3('0x2e')](_0x78311a[_0xe5b3('0x2d')]);_0x1b0305[_0xe5b3('0x39')]=_[_0xe5b3('0x2f')](_0x1b0305[_0xe5b3('0x2c')],_0x1b0305['query']);_0x2f1d0b[_0xe5b3('0x31')]=_[_0xe5b3('0x2f')](_0x1b0305[_0xe5b3('0x2c')],qs[_0xe5b3('0x30')](_0x78311a[_0xe5b3('0x2d')][_0xe5b3('0x30')]));_0x2f1d0b[_0xe5b3('0x31')]=_0x2f1d0b[_0xe5b3('0x31')][_0xe5b3('0x32')]?_0x2f1d0b[_0xe5b3('0x31')]:_0x1b0305[_0xe5b3('0x2c')];if(_0x78311a[_0xe5b3('0x2d')][_0xe5b3('0x3e')]){_0x2f1d0b[_0xe5b3('0x3f')]=[{'all':!![]}];}_0x2f1d0b=_[_0xe5b3('0x3b')]({},_0x2f1d0b,_0x78311a[_0xe5b3('0x3c')]);return db[_0xe5b3('0x3d')][_0xe5b3('0x45')](_0x2f1d0b)[_0xe5b3('0x22')](handleEntityNotFound(_0x57106e,null))[_0xe5b3('0x22')](respondWithResult(_0x57106e,null))[_0xe5b3('0x41')](handleError(_0x57106e,null));};exports[_0xe5b3('0x46')]=function(_0x377c9d,_0x37ea99){return db['Trigger'][_0xe5b3('0x46')](_0x377c9d['body'],{})[_0xe5b3('0x22')](function(_0x4249bb){var _0x48ee7a=_0x377c9d[_0xe5b3('0x47')][_0xe5b3('0x48')]({'plain':!![]});if(!_0x48ee7a)throw new Error(_0xe5b3('0x49'));if(_0x48ee7a[_0xe5b3('0x4a')]==='user'){var _0x21896b=_0x4249bb[_0xe5b3('0x48')]({'plain':!![]});var _0x2fd386=_0xe5b3('0x23');return db[_0xe5b3('0x4b')]['find']({'where':{'name':_0x2fd386,'userProfileId':_0x48ee7a['userProfileId']},'raw':!![]})[_0xe5b3('0x22')](function(_0x3c771c){if(_0x3c771c&&_0x3c771c[_0xe5b3('0x4c')]===0x0){return db[_0xe5b3('0x4d')][_0xe5b3('0x46')]({'name':_0x21896b[_0xe5b3('0x26')],'resourceId':_0x21896b['id'],'type':_0x3c771c[_0xe5b3('0x26')],'sectionId':_0x3c771c['id']},{})['then'](function(){return _0x4249bb;});}else{return _0x4249bb;}})['catch'](function(_0x27545a){logger[_0xe5b3('0x25')](_0xe5b3('0x4e'),_0x27545a);throw _0x27545a;});}return _0x4249bb;})['then'](respondWithResult(_0x37ea99,0xc9))[_0xe5b3('0x41')](handleError(_0x37ea99,null));};exports['update']=function(_0x37e646,_0x55ee91){if(_0x37e646[_0xe5b3('0x4f')]['id']){delete _0x37e646[_0xe5b3('0x4f')]['id'];}return db[_0xe5b3('0x3d')][_0xe5b3('0x45')]({'where':{'id':_0x37e646['params']['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0x55ee91,null))[_0xe5b3('0x22')](saveUpdates(_0x37e646['body'],null))[_0xe5b3('0x22')](respondWithResult(_0x55ee91,null))[_0xe5b3('0x41')](handleError(_0x55ee91,null));};exports[_0xe5b3('0x24')]=function(_0x5a5d46,_0x49655d){return db[_0xe5b3('0x3d')][_0xe5b3('0x45')]({'where':{'id':_0x5a5d46[_0xe5b3('0x43')]['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0x49655d,null))[_0xe5b3('0x22')](removeEntity(_0x49655d,null))['catch'](handleError(_0x49655d,null));};exports[_0xe5b3('0x50')]=function(_0x59e87c,_0x3abad4,_0x5d7961){if(_0x59e87c[_0xe5b3('0x4f')]['id']){delete _0x59e87c[_0xe5b3('0x4f')]['id'];}return db[_0xe5b3('0x3d')][_0xe5b3('0x45')]({'where':{'id':_0x59e87c[_0xe5b3('0x43')]['id']}})['then'](handleEntityNotFound(_0x3abad4,null))['then'](function(_0x32b0be){if(_0x32b0be){_0x59e87c[_0xe5b3('0x4f')][_0xe5b3('0x51')]=_0x32b0be['id'];return db[_0xe5b3('0x52')][_0xe5b3('0x46')](_0x59e87c[_0xe5b3('0x4f')]);}})[_0xe5b3('0x22')](respondWithResult(_0x3abad4,null))[_0xe5b3('0x41')](handleError(_0x3abad4,null));};exports['addAnyCondition']=function(_0x46f73e,_0x38d27b,_0xc2dd93){if(_0x46f73e[_0xe5b3('0x4f')]['id']){delete _0x46f73e[_0xe5b3('0x4f')]['id'];}return db[_0xe5b3('0x3d')][_0xe5b3('0x45')]({'where':{'id':_0x46f73e[_0xe5b3('0x43')]['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0x38d27b,null))[_0xe5b3('0x22')](function(_0x516413){if(_0x516413){_0x46f73e[_0xe5b3('0x4f')][_0xe5b3('0x53')]=_0x516413['id'];return db['Condition']['create'](_0x46f73e[_0xe5b3('0x4f')]);}})[_0xe5b3('0x22')](respondWithResult(_0x38d27b,null))[_0xe5b3('0x41')](handleError(_0x38d27b,null));};exports[_0xe5b3('0x54')]=function(_0x34b2ef,_0x56b2a1,_0x1afc0e){var _0x1a988c={};var _0x941523={};var _0x1b255b;var _0x382acb;return db[_0xe5b3('0x3d')][_0xe5b3('0x55')]({'where':{'id':_0x34b2ef['params']['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0x56b2a1,null))[_0xe5b3('0x22')](function(_0x200ae8){if(_0x200ae8){_0x1b255b=_0x200ae8;_0x941523[_0xe5b3('0x2c')]=_[_0xe5b3('0x2e')](db[_0xe5b3('0x52')][_0xe5b3('0x44')]);_0x941523[_0xe5b3('0x2d')]=_[_0xe5b3('0x2e')](_0x34b2ef[_0xe5b3('0x2d')]);_0x941523[_0xe5b3('0x39')]=_['intersection'](_0x941523[_0xe5b3('0x2c')],_0x941523[_0xe5b3('0x2d')]);_0x1a988c[_0xe5b3('0x31')]=_[_0xe5b3('0x2f')](_0x941523[_0xe5b3('0x2c')],qs[_0xe5b3('0x30')](_0x34b2ef[_0xe5b3('0x2d')][_0xe5b3('0x30')]));_0x1a988c[_0xe5b3('0x31')]=_0x1a988c[_0xe5b3('0x31')][_0xe5b3('0x32')]?_0x1a988c[_0xe5b3('0x31')]:_0x941523[_0xe5b3('0x2c')];_0x1a988c[_0xe5b3('0x35')]=qs[_0xe5b3('0x36')](_0x34b2ef[_0xe5b3('0x2d')]['sort']);_0x1a988c[_0xe5b3('0x37')]=qs[_0xe5b3('0x39')](_[_0xe5b3('0x38')](_0x34b2ef[_0xe5b3('0x2d')],_0x941523[_0xe5b3('0x39')]));if(_0x34b2ef['query'][_0xe5b3('0x3a')]){_0x1a988c[_0xe5b3('0x37')]=_['merge'](_0x1a988c['where'],{'$or':_[_0xe5b3('0x29')](_0x1a988c[_0xe5b3('0x31')],function(_0x2b95cb){var _0xe79092={};_0xe79092[_0x2b95cb]={'$like':'%'+_0x34b2ef[_0xe5b3('0x2d')][_0xe5b3('0x3a')]+'%'};return _0xe79092;})});}_0x1a988c=_[_0xe5b3('0x3b')]({},_0x1a988c,_0x34b2ef['options']);return _0x1b255b[_0xe5b3('0x54')](_0x1a988c);}})[_0xe5b3('0x22')](function(_0x85de27){if(_0x85de27){_0x382acb=_0x85de27['length'];if(!_0x34b2ef['query'][_0xe5b3('0x33')](_0xe5b3('0x34'))){_0x1a988c['limit']=qs[_0xe5b3('0x1e')](_0x34b2ef[_0xe5b3('0x2d')][_0xe5b3('0x1e')]);_0x1a988c[_0xe5b3('0x1d')]=qs[_0xe5b3('0x1d')](_0x34b2ef[_0xe5b3('0x2d')][_0xe5b3('0x1d')]);}return _0x1b255b[_0xe5b3('0x54')](_0x1a988c);}})[_0xe5b3('0x22')](function(_0x25754c){if(_0x25754c){return _0x25754c?{'count':_0x382acb,'rows':_0x25754c}:null;}})[_0xe5b3('0x22')](respondWithResult(_0x56b2a1,null))[_0xe5b3('0x41')](handleError(_0x56b2a1,null));};exports['getAnyConditions']=function(_0x4028ac,_0xf34f55,_0x4c1618){var _0x1e74d2={};var _0x445a18={};var _0x21a82f;var _0xfbd502;return db[_0xe5b3('0x3d')][_0xe5b3('0x55')]({'where':{'id':_0x4028ac['params']['id']}})['then'](handleEntityNotFound(_0xf34f55,null))['then'](function(_0x5db417){if(_0x5db417){_0x21a82f=_0x5db417;_0x445a18[_0xe5b3('0x2c')]=_[_0xe5b3('0x2e')](db[_0xe5b3('0x52')][_0xe5b3('0x44')]);_0x445a18[_0xe5b3('0x2d')]=_[_0xe5b3('0x2e')](_0x4028ac[_0xe5b3('0x2d')]);_0x445a18['filters']=_['intersection'](_0x445a18[_0xe5b3('0x2c')],_0x445a18['query']);_0x1e74d2[_0xe5b3('0x31')]=_[_0xe5b3('0x2f')](_0x445a18[_0xe5b3('0x2c')],qs['fields'](_0x4028ac[_0xe5b3('0x2d')][_0xe5b3('0x30')]));_0x1e74d2[_0xe5b3('0x31')]=_0x1e74d2['attributes'][_0xe5b3('0x32')]?_0x1e74d2[_0xe5b3('0x31')]:_0x445a18[_0xe5b3('0x2c')];_0x1e74d2['order']=qs[_0xe5b3('0x36')](_0x4028ac['query'][_0xe5b3('0x36')]);_0x1e74d2[_0xe5b3('0x37')]=qs['filters'](_[_0xe5b3('0x38')](_0x4028ac[_0xe5b3('0x2d')],_0x445a18[_0xe5b3('0x39')]));if(_0x4028ac[_0xe5b3('0x2d')]['filter']){_0x1e74d2[_0xe5b3('0x37')]=_[_0xe5b3('0x3b')](_0x1e74d2[_0xe5b3('0x37')],{'$or':_[_0xe5b3('0x29')](_0x1e74d2['attributes'],function(_0x3de1cc){var _0x3b85a7={};_0x3b85a7[_0x3de1cc]={'$like':'%'+_0x4028ac[_0xe5b3('0x2d')][_0xe5b3('0x3a')]+'%'};return _0x3b85a7;})});}_0x1e74d2=_[_0xe5b3('0x3b')]({},_0x1e74d2,_0x4028ac['options']);return _0x21a82f['getAnyConditions'](_0x1e74d2);}})[_0xe5b3('0x22')](function(_0x408444){if(_0x408444){_0xfbd502=_0x408444[_0xe5b3('0x32')];if(!_0x4028ac['query'][_0xe5b3('0x33')](_0xe5b3('0x34'))){_0x1e74d2[_0xe5b3('0x1e')]=qs[_0xe5b3('0x1e')](_0x4028ac['query'][_0xe5b3('0x1e')]);_0x1e74d2[_0xe5b3('0x1d')]=qs[_0xe5b3('0x1d')](_0x4028ac[_0xe5b3('0x2d')][_0xe5b3('0x1d')]);}return _0x21a82f[_0xe5b3('0x56')](_0x1e74d2);}})[_0xe5b3('0x22')](function(_0x575bb1){if(_0x575bb1){return _0x575bb1?{'count':_0xfbd502,'rows':_0x575bb1}:null;}})[_0xe5b3('0x22')](respondWithResult(_0xf34f55,null))[_0xe5b3('0x41')](handleError(_0xf34f55,null));};exports[_0xe5b3('0x57')]=function(_0x5f2faa,_0x159609,_0x5ca704){if(_0x5f2faa[_0xe5b3('0x4f')]['id']){delete _0x5f2faa[_0xe5b3('0x4f')]['id'];}return db[_0xe5b3('0x3d')]['find']({'where':{'id':_0x5f2faa['params']['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0x159609,null))['then'](function(_0x595c90){if(_0x595c90){_0x5f2faa[_0xe5b3('0x4f')]['TriggerId']=_0x595c90['id'];return db[_0xe5b3('0x58')][_0xe5b3('0x46')](_0x5f2faa[_0xe5b3('0x4f')]);}})['then'](respondWithResult(_0x159609,null))[_0xe5b3('0x41')](handleError(_0x159609,null));};exports[_0xe5b3('0x59')]=function(_0x27bb63,_0xb3de17,_0x5446c5){var _0x20fd01={};var _0x3b1c03={};var _0x1a98e8;var _0x19e956;return db[_0xe5b3('0x3d')]['findOne']({'where':{'id':_0x27bb63[_0xe5b3('0x43')]['id']}})[_0xe5b3('0x22')](handleEntityNotFound(_0xb3de17,null))[_0xe5b3('0x22')](function(_0x638493){if(_0x638493){_0x1a98e8=_0x638493;_0x3b1c03[_0xe5b3('0x2c')]=_[_0xe5b3('0x2e')](db[_0xe5b3('0x58')][_0xe5b3('0x44')]);_0x3b1c03['query']=_[_0xe5b3('0x2e')](_0x27bb63[_0xe5b3('0x2d')]);_0x3b1c03[_0xe5b3('0x39')]=_[_0xe5b3('0x2f')](_0x3b1c03['model'],_0x3b1c03[_0xe5b3('0x2d')]);_0x20fd01[_0xe5b3('0x31')]=_[_0xe5b3('0x2f')](_0x3b1c03['model'],qs['fields'](_0x27bb63[_0xe5b3('0x2d')]['fields']));_0x20fd01['attributes']=_0x20fd01[_0xe5b3('0x31')]['length']?_0x20fd01[_0xe5b3('0x31')]:_0x3b1c03['model'];_0x20fd01[_0xe5b3('0x35')]=qs['sort'](_0x27bb63[_0xe5b3('0x2d')][_0xe5b3('0x36')]);_0x20fd01[_0xe5b3('0x37')]=qs['filters'](_[_0xe5b3('0x38')](_0x27bb63[_0xe5b3('0x2d')],_0x3b1c03['filters']));if(_0x27bb63['query'][_0xe5b3('0x3a')]){_0x20fd01[_0xe5b3('0x37')]=_['merge'](_0x20fd01[_0xe5b3('0x37')],{'$or':_[_0xe5b3('0x29')](_0x20fd01[_0xe5b3('0x31')],function(_0x4eea43){var _0x22eb3a={};_0x22eb3a[_0x4eea43]={'$like':'%'+_0x27bb63[_0xe5b3('0x2d')][_0xe5b3('0x3a')]+'%'};return _0x22eb3a;})});}_0x20fd01=_['merge']({},_0x20fd01,_0x27bb63[_0xe5b3('0x3c')]);return _0x1a98e8[_0xe5b3('0x59')](_0x20fd01);}})[_0xe5b3('0x22')](function(_0x599714){if(_0x599714){_0x19e956=_0x599714[_0xe5b3('0x32')];if(!_0x27bb63[_0xe5b3('0x2d')][_0xe5b3('0x33')](_0xe5b3('0x34'))){_0x20fd01['limit']=qs[_0xe5b3('0x1e')](_0x27bb63[_0xe5b3('0x2d')][_0xe5b3('0x1e')]);_0x20fd01[_0xe5b3('0x1d')]=qs[_0xe5b3('0x1d')](_0x27bb63[_0xe5b3('0x2d')][_0xe5b3('0x1d')]);}return _0x1a98e8['getActions'](_0x20fd01);}})[_0xe5b3('0x22')](function(_0x271629){if(_0x271629){return _0x271629?{'count':_0x19e956,'rows':_0x271629}:null;}})[_0xe5b3('0x22')](respondWithResult(_0xb3de17,null))['catch'](handleError(_0xb3de17,null));}; \ No newline at end of file +var _0x172c=['get','Triggers','UserProfileResource','destroy','sendStatus','stack','name','send','index','Trigger','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filters','filter','merge','count','includeAll','include','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addAllCondition','TriggerAllId','Condition','TriggerAnyId','getAllConditions','findOne','options','hasOwnProperty','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','end','status','json','offset','limit','set','Content-Range','update','then'];(function(_0x15a26e,_0x334582){var _0x25bef6=function(_0x2fab4f){while(--_0x2fab4f){_0x15a26e['push'](_0x15a26e['shift']());}};_0x25bef6(++_0x334582);}(_0x172c,0x95));var _0xc172=function(_0x1af98d,_0x3c608e){_0x1af98d=_0x1af98d-0x0;var _0x3553ea=_0x172c[_0x1af98d];return _0x3553ea;};'use strict';var pdf=require(_0xc172('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xc172('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xc172('0x2'));var rp=require(_0xc172('0x3'));var moment=require(_0xc172('0x4'));var BPromise=require(_0xc172('0x5'));var Mustache=require(_0xc172('0x6'));var util=require(_0xc172('0x7'));var path=require(_0xc172('0x8'));var sox=require(_0xc172('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xc172('0xa'));var squel=require('squel');var crypto=require(_0xc172('0xb'));var jsforce=require(_0xc172('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xc172('0xd'));var authService=require(_0xc172('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0xc172('0xf'));var hardwareService=require(_0xc172('0x10'));var logger=require(_0xc172('0x11'))(_0xc172('0x12'));var utils=require(_0xc172('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x974548,_0x3583a2){_0x3583a2=_0x3583a2||0xcc;return function(_0x59b86a){if(_0x59b86a){return _0x974548['sendStatus'](_0x3583a2);}return _0x974548['status'](_0x3583a2)[_0xc172('0x14')]();};}function respondWithResult(_0x20d53c,_0x5297e0){_0x5297e0=_0x5297e0||0xc8;return function(_0x3eaf25){if(_0x3eaf25){return _0x20d53c[_0xc172('0x15')](_0x5297e0)[_0xc172('0x16')](_0x3eaf25);}};}function respondWithFilteredResult(_0x193afd,_0x4bb51a){return function(_0x4c0d0f){if(_0x4c0d0f){var _0x528246=_0x4c0d0f['count'],_0x270503=_0x4bb51a[_0xc172('0x17')],_0x283e07=_0x4bb51a[_0xc172('0x17')]+_0x4bb51a[_0xc172('0x18')],_0x5b8d7b;if(_0x283e07>=_0x528246){_0x283e07=_0x528246;_0x5b8d7b=0xc8;}else{_0x5b8d7b=0xce;}_0x193afd[_0xc172('0x15')](_0x5b8d7b);return _0x193afd[_0xc172('0x19')](_0xc172('0x1a'),_0x270503+'-'+_0x283e07+'/'+_0x528246)[_0xc172('0x16')](_0x4c0d0f);}return null;};}function patchUpdates(_0x39057e){return function(_0x48f7af){try{jsonpatch['apply'](_0x48f7af,_0x39057e,!![]);}catch(_0x4a0b33){return BPromise['reject'](_0x4a0b33);}return _0x48f7af['save']();};}function saveUpdates(_0xc76c2f,_0x1c01da){return function(_0x47a0cd){if(_0x47a0cd){return _0x47a0cd[_0xc172('0x1b')](_0xc76c2f)[_0xc172('0x1c')](function(_0x562884){return _0x562884;});}return null;};}function removeEntity(_0x2cef61,_0x36ce13){return function(_0x457491){if(_0x457491){return _0x457491['destroy']()[_0xc172('0x1c')](function(){var _0x1468c4=_0x457491[_0xc172('0x1d')]({'plain':!![]});var _0x3a37d1=_0xc172('0x1e');return db[_0xc172('0x1f')][_0xc172('0x20')]({'where':{'type':_0x3a37d1,'resourceId':_0x1468c4['id']}})[_0xc172('0x1c')](function(){return _0x457491;});})['then'](function(){_0x2cef61['status'](0xcc)[_0xc172('0x14')]();});}};}function handleEntityNotFound(_0x3b9387,_0xeff832){return function(_0x38087d){if(!_0x38087d){_0x3b9387[_0xc172('0x21')](0x194);}return _0x38087d;};}function handleError(_0x3b6b5f,_0x1a5ca7){_0x1a5ca7=_0x1a5ca7||0x1f4;return function(_0x5887d2){logger['error'](_0x5887d2[_0xc172('0x22')]);if(_0x5887d2[_0xc172('0x23')]){delete _0x5887d2[_0xc172('0x23')];}_0x3b6b5f[_0xc172('0x15')](_0x1a5ca7)[_0xc172('0x24')](_0x5887d2);};}exports[_0xc172('0x25')]=function(_0x39f012,_0x507c74){var _0xdac399={},_0x8d3113={},_0x3229d3={'count':0x0,'rows':[]};var _0x393dfb=_['map'](db[_0xc172('0x26')][_0xc172('0x27')],function(_0x38fafc){return{'name':_0x38fafc[_0xc172('0x28')],'type':_0x38fafc[_0xc172('0x29')][_0xc172('0x2a')]};});_0x8d3113[_0xc172('0x2b')]=_[_0xc172('0x2c')](_0x393dfb,_0xc172('0x23'));_0x8d3113[_0xc172('0x2d')]=_[_0xc172('0x2e')](_0x39f012[_0xc172('0x2d')]);_0x8d3113['filters']=_[_0xc172('0x2f')](_0x8d3113[_0xc172('0x2b')],_0x8d3113['query']);_0xdac399[_0xc172('0x30')]=_[_0xc172('0x2f')](_0x8d3113['model'],qs[_0xc172('0x31')](_0x39f012['query'][_0xc172('0x31')]));_0xdac399[_0xc172('0x30')]=_0xdac399['attributes'][_0xc172('0x32')]?_0xdac399[_0xc172('0x30')]:_0x8d3113[_0xc172('0x2b')];if(!_0x39f012[_0xc172('0x2d')]['hasOwnProperty'](_0xc172('0x33'))){_0xdac399[_0xc172('0x18')]=qs[_0xc172('0x18')](_0x39f012[_0xc172('0x2d')]['limit']);_0xdac399[_0xc172('0x17')]=qs[_0xc172('0x17')](_0x39f012['query']['offset']);}_0xdac399[_0xc172('0x34')]=qs['sort'](_0x39f012[_0xc172('0x2d')][_0xc172('0x35')]);_0xdac399[_0xc172('0x36')]=qs['filters'](_[_0xc172('0x37')](_0x39f012['query'],_0x8d3113[_0xc172('0x38')]));if(_0x39f012[_0xc172('0x2d')][_0xc172('0x39')]){_0xdac399['where']=_[_0xc172('0x3a')](_0xdac399[_0xc172('0x36')],{'$or':_[_0xc172('0x2c')](_0x393dfb,function(_0x3637b9){if(_0x3637b9[_0xc172('0x29')]!=='VIRTUAL'){var _0x15198b={};_0x15198b[_0x3637b9['name']]={'$like':'%'+_0x39f012[_0xc172('0x2d')][_0xc172('0x39')]+'%'};return _0x15198b;}})});}_0xdac399=_[_0xc172('0x3a')]({},_0xdac399,_0x39f012['options']);var _0x224337={'where':_0xdac399['where']};return db[_0xc172('0x26')][_0xc172('0x3b')](_0x224337)[_0xc172('0x1c')](function(_0x2417c2){_0x3229d3[_0xc172('0x3b')]=_0x2417c2;if(_0x39f012['query'][_0xc172('0x3c')]){_0xdac399[_0xc172('0x3d')]=[{'all':!![]}];}return db[_0xc172('0x26')]['findAll'](_0xdac399);})['then'](function(_0x5f5d0c){_0x3229d3[_0xc172('0x3e')]=_0x5f5d0c;return _0x3229d3;})['then'](respondWithFilteredResult(_0x507c74,_0xdac399))[_0xc172('0x3f')](handleError(_0x507c74,null));};exports[_0xc172('0x40')]=function(_0x7b8567,_0x306ee6){var _0x7acc32={'raw':![],'where':{'id':_0x7b8567[_0xc172('0x41')]['id']}},_0x368556={};_0x368556[_0xc172('0x2b')]=_[_0xc172('0x2e')](db['Trigger'][_0xc172('0x27')]);_0x368556[_0xc172('0x2d')]=_[_0xc172('0x2e')](_0x7b8567['query']);_0x368556[_0xc172('0x38')]=_['intersection'](_0x368556[_0xc172('0x2b')],_0x368556['query']);_0x7acc32['attributes']=_['intersection'](_0x368556['model'],qs[_0xc172('0x31')](_0x7b8567[_0xc172('0x2d')][_0xc172('0x31')]));_0x7acc32[_0xc172('0x30')]=_0x7acc32[_0xc172('0x30')][_0xc172('0x32')]?_0x7acc32[_0xc172('0x30')]:_0x368556[_0xc172('0x2b')];if(_0x7b8567[_0xc172('0x2d')][_0xc172('0x3c')]){_0x7acc32[_0xc172('0x3d')]=[{'all':!![]}];}_0x7acc32=_[_0xc172('0x3a')]({},_0x7acc32,_0x7b8567['options']);return db[_0xc172('0x26')][_0xc172('0x42')](_0x7acc32)[_0xc172('0x1c')](handleEntityNotFound(_0x306ee6,null))[_0xc172('0x1c')](respondWithResult(_0x306ee6,null))[_0xc172('0x3f')](handleError(_0x306ee6,null));};exports[_0xc172('0x43')]=function(_0x4d2bb3,_0x1d280f){return db[_0xc172('0x26')][_0xc172('0x43')](_0x4d2bb3[_0xc172('0x44')],{})[_0xc172('0x1c')](function(_0x2f139a){var _0x5c7920=_0x4d2bb3['user']['get']({'plain':!![]});if(!_0x5c7920)throw new Error(_0xc172('0x45'));if(_0x5c7920[_0xc172('0x46')]===_0xc172('0x47')){var _0x55aa85=_0x2f139a[_0xc172('0x1d')]({'plain':!![]});var _0x305253=_0xc172('0x1e');return db[_0xc172('0x48')][_0xc172('0x42')]({'where':{'name':_0x305253,'userProfileId':_0x5c7920['userProfileId']},'raw':!![]})[_0xc172('0x1c')](function(_0x45ef36){if(_0x45ef36&&_0x45ef36[_0xc172('0x49')]===0x0){return db[_0xc172('0x1f')][_0xc172('0x43')]({'name':_0x55aa85[_0xc172('0x23')],'resourceId':_0x55aa85['id'],'type':_0x45ef36[_0xc172('0x23')],'sectionId':_0x45ef36['id']},{})['then'](function(){return _0x2f139a;});}else{return _0x2f139a;}})[_0xc172('0x3f')](function(_0x1511e7){logger[_0xc172('0x4a')](_0xc172('0x4b'),_0x1511e7);throw _0x1511e7;});}return _0x2f139a;})[_0xc172('0x1c')](respondWithResult(_0x1d280f,0xc9))[_0xc172('0x3f')](handleError(_0x1d280f,null));};exports[_0xc172('0x1b')]=function(_0x2bdc41,_0x382360){if(_0x2bdc41[_0xc172('0x44')]['id']){delete _0x2bdc41['body']['id'];}return db[_0xc172('0x26')][_0xc172('0x42')]({'where':{'id':_0x2bdc41[_0xc172('0x41')]['id']}})[_0xc172('0x1c')](handleEntityNotFound(_0x382360,null))[_0xc172('0x1c')](saveUpdates(_0x2bdc41['body'],null))[_0xc172('0x1c')](respondWithResult(_0x382360,null))[_0xc172('0x3f')](handleError(_0x382360,null));};exports[_0xc172('0x20')]=function(_0x3f177d,_0x279fca){return db[_0xc172('0x26')][_0xc172('0x42')]({'where':{'id':_0x3f177d[_0xc172('0x41')]['id']}})['then'](handleEntityNotFound(_0x279fca,null))[_0xc172('0x1c')](removeEntity(_0x279fca,null))[_0xc172('0x3f')](handleError(_0x279fca,null));};exports[_0xc172('0x4c')]=function(_0x377dfc,_0x309247,_0x15bb5f){if(_0x377dfc['body']['id']){delete _0x377dfc['body']['id'];}return db['Trigger'][_0xc172('0x42')]({'where':{'id':_0x377dfc[_0xc172('0x41')]['id']}})['then'](handleEntityNotFound(_0x309247,null))[_0xc172('0x1c')](function(_0x4d90fb){if(_0x4d90fb){_0x377dfc[_0xc172('0x44')][_0xc172('0x4d')]=_0x4d90fb['id'];return db[_0xc172('0x4e')][_0xc172('0x43')](_0x377dfc[_0xc172('0x44')]);}})[_0xc172('0x1c')](respondWithResult(_0x309247,null))[_0xc172('0x3f')](handleError(_0x309247,null));};exports['addAnyCondition']=function(_0x58e9aa,_0x5f4f2c,_0x5b42e8){if(_0x58e9aa[_0xc172('0x44')]['id']){delete _0x58e9aa[_0xc172('0x44')]['id'];}return db[_0xc172('0x26')][_0xc172('0x42')]({'where':{'id':_0x58e9aa[_0xc172('0x41')]['id']}})[_0xc172('0x1c')](handleEntityNotFound(_0x5f4f2c,null))['then'](function(_0x2650d9){if(_0x2650d9){_0x58e9aa[_0xc172('0x44')][_0xc172('0x4f')]=_0x2650d9['id'];return db['Condition'][_0xc172('0x43')](_0x58e9aa[_0xc172('0x44')]);}})[_0xc172('0x1c')](respondWithResult(_0x5f4f2c,null))[_0xc172('0x3f')](handleError(_0x5f4f2c,null));};exports[_0xc172('0x50')]=function(_0x237d4d,_0x3eedaa,_0x2f4f7e){var _0x4b7d2d={};var _0x915c59={};var _0x39734b;var _0x2548ec;return db[_0xc172('0x26')][_0xc172('0x51')]({'where':{'id':_0x237d4d['params']['id']}})[_0xc172('0x1c')](handleEntityNotFound(_0x3eedaa,null))[_0xc172('0x1c')](function(_0x3212ce){if(_0x3212ce){_0x39734b=_0x3212ce;_0x915c59[_0xc172('0x2b')]=_[_0xc172('0x2e')](db[_0xc172('0x4e')][_0xc172('0x27')]);_0x915c59[_0xc172('0x2d')]=_[_0xc172('0x2e')](_0x237d4d[_0xc172('0x2d')]);_0x915c59[_0xc172('0x38')]=_['intersection'](_0x915c59[_0xc172('0x2b')],_0x915c59[_0xc172('0x2d')]);_0x4b7d2d[_0xc172('0x30')]=_['intersection'](_0x915c59[_0xc172('0x2b')],qs[_0xc172('0x31')](_0x237d4d[_0xc172('0x2d')][_0xc172('0x31')]));_0x4b7d2d['attributes']=_0x4b7d2d[_0xc172('0x30')][_0xc172('0x32')]?_0x4b7d2d['attributes']:_0x915c59[_0xc172('0x2b')];_0x4b7d2d[_0xc172('0x34')]=qs[_0xc172('0x35')](_0x237d4d[_0xc172('0x2d')][_0xc172('0x35')]);_0x4b7d2d[_0xc172('0x36')]=qs[_0xc172('0x38')](_[_0xc172('0x37')](_0x237d4d[_0xc172('0x2d')],_0x915c59['filters']));if(_0x237d4d[_0xc172('0x2d')][_0xc172('0x39')]){_0x4b7d2d[_0xc172('0x36')]=_[_0xc172('0x3a')](_0x4b7d2d[_0xc172('0x36')],{'$or':_[_0xc172('0x2c')](_0x4b7d2d[_0xc172('0x30')],function(_0x2de18d){var _0x470be2={};_0x470be2[_0x2de18d]={'$like':'%'+_0x237d4d['query'][_0xc172('0x39')]+'%'};return _0x470be2;})});}_0x4b7d2d=_['merge']({},_0x4b7d2d,_0x237d4d[_0xc172('0x52')]);return _0x39734b[_0xc172('0x50')](_0x4b7d2d);}})[_0xc172('0x1c')](function(_0x38f234){if(_0x38f234){_0x2548ec=_0x38f234[_0xc172('0x32')];if(!_0x237d4d['query'][_0xc172('0x53')](_0xc172('0x33'))){_0x4b7d2d[_0xc172('0x18')]=qs[_0xc172('0x18')](_0x237d4d[_0xc172('0x2d')][_0xc172('0x18')]);_0x4b7d2d[_0xc172('0x17')]=qs['offset'](_0x237d4d[_0xc172('0x2d')][_0xc172('0x17')]);}return _0x39734b['getAllConditions'](_0x4b7d2d);}})[_0xc172('0x1c')](function(_0x4c5a14){if(_0x4c5a14){return _0x4c5a14?{'count':_0x2548ec,'rows':_0x4c5a14}:null;}})[_0xc172('0x1c')](respondWithResult(_0x3eedaa,null))[_0xc172('0x3f')](handleError(_0x3eedaa,null));};exports[_0xc172('0x54')]=function(_0x5384b2,_0x5028d8,_0x14a3dc){var _0x4d40a1={};var _0x5e8cc3={};var _0x3a279d;var _0x5d2021;return db[_0xc172('0x26')]['findOne']({'where':{'id':_0x5384b2[_0xc172('0x41')]['id']}})['then'](handleEntityNotFound(_0x5028d8,null))['then'](function(_0x46e165){if(_0x46e165){_0x3a279d=_0x46e165;_0x5e8cc3[_0xc172('0x2b')]=_[_0xc172('0x2e')](db[_0xc172('0x4e')]['rawAttributes']);_0x5e8cc3['query']=_[_0xc172('0x2e')](_0x5384b2[_0xc172('0x2d')]);_0x5e8cc3[_0xc172('0x38')]=_[_0xc172('0x2f')](_0x5e8cc3[_0xc172('0x2b')],_0x5e8cc3['query']);_0x4d40a1['attributes']=_[_0xc172('0x2f')](_0x5e8cc3[_0xc172('0x2b')],qs['fields'](_0x5384b2['query']['fields']));_0x4d40a1['attributes']=_0x4d40a1['attributes'][_0xc172('0x32')]?_0x4d40a1[_0xc172('0x30')]:_0x5e8cc3[_0xc172('0x2b')];_0x4d40a1['order']=qs['sort'](_0x5384b2[_0xc172('0x2d')][_0xc172('0x35')]);_0x4d40a1[_0xc172('0x36')]=qs[_0xc172('0x38')](_[_0xc172('0x37')](_0x5384b2[_0xc172('0x2d')],_0x5e8cc3[_0xc172('0x38')]));if(_0x5384b2[_0xc172('0x2d')][_0xc172('0x39')]){_0x4d40a1[_0xc172('0x36')]=_[_0xc172('0x3a')](_0x4d40a1[_0xc172('0x36')],{'$or':_[_0xc172('0x2c')](_0x4d40a1[_0xc172('0x30')],function(_0x45b652){var _0x15f201={};_0x15f201[_0x45b652]={'$like':'%'+_0x5384b2[_0xc172('0x2d')][_0xc172('0x39')]+'%'};return _0x15f201;})});}_0x4d40a1=_[_0xc172('0x3a')]({},_0x4d40a1,_0x5384b2[_0xc172('0x52')]);return _0x3a279d[_0xc172('0x54')](_0x4d40a1);}})['then'](function(_0x25f8c0){if(_0x25f8c0){_0x5d2021=_0x25f8c0['length'];if(!_0x5384b2[_0xc172('0x2d')][_0xc172('0x53')](_0xc172('0x33'))){_0x4d40a1[_0xc172('0x18')]=qs[_0xc172('0x18')](_0x5384b2[_0xc172('0x2d')][_0xc172('0x18')]);_0x4d40a1[_0xc172('0x17')]=qs[_0xc172('0x17')](_0x5384b2[_0xc172('0x2d')][_0xc172('0x17')]);}return _0x3a279d['getAnyConditions'](_0x4d40a1);}})[_0xc172('0x1c')](function(_0x116429){if(_0x116429){return _0x116429?{'count':_0x5d2021,'rows':_0x116429}:null;}})['then'](respondWithResult(_0x5028d8,null))[_0xc172('0x3f')](handleError(_0x5028d8,null));};exports[_0xc172('0x55')]=function(_0x4cfbf4,_0x10615d,_0x100f37){if(_0x4cfbf4['body']['id']){delete _0x4cfbf4['body']['id'];}return db[_0xc172('0x26')][_0xc172('0x42')]({'where':{'id':_0x4cfbf4[_0xc172('0x41')]['id']}})[_0xc172('0x1c')](handleEntityNotFound(_0x10615d,null))[_0xc172('0x1c')](function(_0x5ce099){if(_0x5ce099){_0x4cfbf4['body'][_0xc172('0x56')]=_0x5ce099['id'];return db[_0xc172('0x57')][_0xc172('0x43')](_0x4cfbf4[_0xc172('0x44')]);}})[_0xc172('0x1c')](respondWithResult(_0x10615d,null))[_0xc172('0x3f')](handleError(_0x10615d,null));};exports['getActions']=function(_0x32eba6,_0x495900,_0x79cbb3){var _0x4fbe9d={};var _0x27c262={};var _0xc27d92;var _0x5c23c9;return db[_0xc172('0x26')][_0xc172('0x51')]({'where':{'id':_0x32eba6['params']['id']}})['then'](handleEntityNotFound(_0x495900,null))['then'](function(_0x57109a){if(_0x57109a){_0xc27d92=_0x57109a;_0x27c262['model']=_[_0xc172('0x2e')](db['Action'][_0xc172('0x27')]);_0x27c262[_0xc172('0x2d')]=_['keys'](_0x32eba6[_0xc172('0x2d')]);_0x27c262[_0xc172('0x38')]=_['intersection'](_0x27c262[_0xc172('0x2b')],_0x27c262[_0xc172('0x2d')]);_0x4fbe9d[_0xc172('0x30')]=_[_0xc172('0x2f')](_0x27c262['model'],qs[_0xc172('0x31')](_0x32eba6[_0xc172('0x2d')][_0xc172('0x31')]));_0x4fbe9d['attributes']=_0x4fbe9d['attributes'][_0xc172('0x32')]?_0x4fbe9d[_0xc172('0x30')]:_0x27c262['model'];_0x4fbe9d[_0xc172('0x34')]=qs[_0xc172('0x35')](_0x32eba6[_0xc172('0x2d')][_0xc172('0x35')]);_0x4fbe9d[_0xc172('0x36')]=qs[_0xc172('0x38')](_[_0xc172('0x37')](_0x32eba6[_0xc172('0x2d')],_0x27c262['filters']));if(_0x32eba6['query'][_0xc172('0x39')]){_0x4fbe9d[_0xc172('0x36')]=_[_0xc172('0x3a')](_0x4fbe9d[_0xc172('0x36')],{'$or':_['map'](_0x4fbe9d[_0xc172('0x30')],function(_0x30371c){var _0x18667a={};_0x18667a[_0x30371c]={'$like':'%'+_0x32eba6['query'][_0xc172('0x39')]+'%'};return _0x18667a;})});}_0x4fbe9d=_[_0xc172('0x3a')]({},_0x4fbe9d,_0x32eba6[_0xc172('0x52')]);return _0xc27d92[_0xc172('0x58')](_0x4fbe9d);}})[_0xc172('0x1c')](function(_0x53c731){if(_0x53c731){_0x5c23c9=_0x53c731[_0xc172('0x32')];if(!_0x32eba6[_0xc172('0x2d')][_0xc172('0x53')](_0xc172('0x33'))){_0x4fbe9d[_0xc172('0x18')]=qs['limit'](_0x32eba6[_0xc172('0x2d')]['limit']);_0x4fbe9d[_0xc172('0x17')]=qs[_0xc172('0x17')](_0x32eba6[_0xc172('0x2d')][_0xc172('0x17')]);}return _0xc27d92[_0xc172('0x58')](_0x4fbe9d);}})[_0xc172('0x1c')](function(_0x31b4d1){if(_0x31b4d1){return _0x31b4d1?{'count':_0x5c23c9,'rows':_0x31b4d1}:null;}})[_0xc172('0x1c')](respondWithResult(_0x495900,null))['catch'](handleError(_0x495900,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 8396675..bca5853 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 _0x13ba=['moment','request-promise','path','rimraf','./trigger.attributes','exports','define','Trigger','tools_triggers','lodash','util','api'];(function(_0x13b593,_0x85a736){var _0x1d2958=function(_0x371387){while(--_0x371387){_0x13b593['push'](_0x13b593['shift']());}};_0x1d2958(++_0x85a736);}(_0x13ba,0xc9));var _0xa13b=function(_0x26a706,_0x25cc80){_0x26a706=_0x26a706-0x0;var _0x1bcd7c=_0x13ba[_0x26a706];return _0x1bcd7c;};'use strict';var _=require(_0xa13b('0x0'));var util=require(_0xa13b('0x1'));var logger=require('../../config/logger')(_0xa13b('0x2'));var moment=require(_0xa13b('0x3'));var BPromise=require('bluebird');var rp=require(_0xa13b('0x4'));var fs=require('fs');var path=require(_0xa13b('0x5'));var rimraf=require(_0xa13b('0x6'));var config=require('../../config/environment');var attributes=require(_0xa13b('0x7'));module[_0xa13b('0x8')]=function(_0x3719cd,_0x20c94a){return _0x3719cd[_0xa13b('0x9')](_0xa13b('0xa'),attributes,{'tableName':_0xa13b('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf071=['bluebird','path','rimraf','../../config/environment','./trigger.attributes','define','Trigger','tools_triggers','util','../../config/logger','moment'];(function(_0x4c05bd,_0x2e13f6){var _0x2929e7=function(_0x4c3b29){while(--_0x4c3b29){_0x4c05bd['push'](_0x4c05bd['shift']());}};_0x2929e7(++_0x2e13f6);}(_0xf071,0x1b5));var _0x1f07=function(_0xc4c712,_0x406411){_0xc4c712=_0xc4c712-0x0;var _0xb1e58f=_0xf071[_0xc4c712];return _0xb1e58f;};'use strict';var _=require('lodash');var util=require(_0x1f07('0x0'));var logger=require(_0x1f07('0x1'))('api');var moment=require(_0x1f07('0x2'));var BPromise=require(_0x1f07('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f07('0x4'));var rimraf=require(_0x1f07('0x5'));var config=require(_0x1f07('0x6'));var attributes=require(_0x1f07('0x7'));module['exports']=function(_0xc8a8fd,_0x3fa213){return _0xc8a8fd[_0x1f07('0x8')](_0x1f07('0x9'),attributes,{'tableName':_0x1f07('0xa'),'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 cc35887..66c9ff8 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 _0xe820=['findAll','options','raw','where','attributes','limit','include','map','model','info','catch','ShowTrigger','lodash','moment','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent','debug','Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','GetTrigger','Trigger'];(function(_0x5d19e8,_0x431502){var _0x36472f=function(_0x30d385){while(--_0x30d385){_0x5d19e8['push'](_0x5d19e8['shift']());}};_0x36472f(++_0x431502);}(_0xe820,0xd2));var _0x0e82=function(_0x1c8b0c,_0x591e65){_0x1c8b0c=_0x1c8b0c-0x0;var _0xc1297f=_0xe820[_0x1c8b0c];return _0xc1297f;};'use strict';var _=require(_0x0e82('0x0'));var util=require('util');var moment=require(_0x0e82('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0e82('0x2'));var db=require(_0x0e82('0x3'))['db'];var utils=require(_0x0e82('0x4'));var logger=require('../../config/logger')(_0x0e82('0x5'));var config=require('../../config/environment');var jayson=require(_0x0e82('0x6'));var client=jayson[_0x0e82('0x7')][_0x0e82('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x328b32,_0x2a0f9b,_0x55f277){return new BPromise(function(_0x10013b,_0x33c8a2){return client[_0x0e82('0x9')](_0x328b32,_0x55f277)[_0x0e82('0xa')](function(_0x3b7792){logger['info'](_0x0e82('0xb'),_0x2a0f9b,_0x0e82('0xc'));logger[_0x0e82('0xd')](_0x0e82('0xe'),_0x2a0f9b,_0x0e82('0xc'),JSON[_0x0e82('0xf')](_0x3b7792));if(_0x3b7792[_0x0e82('0x10')]){if(_0x3b7792['error'][_0x0e82('0x11')]===0x1f4){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x3b7792[_0x0e82('0x10')][_0x0e82('0x12')]);return _0x33c8a2(_0x3b7792[_0x0e82('0x10')]['message']);}logger[_0x0e82('0x10')]('Trigger,\x20%s,\x20%s',_0x2a0f9b,_0x3b7792['error'][_0x0e82('0x12')]);return _0x10013b(_0x3b7792['error']['message']);}else{logger['info'](_0x0e82('0xb'),_0x2a0f9b,'request\x20sent');_0x10013b(_0x3b7792['result'][_0x0e82('0x12')]);}})['catch'](function(_0x319303){logger[_0x0e82('0x10')](_0x0e82('0xb'),_0x2a0f9b,_0x319303);_0x33c8a2(_0x319303);});});}exports[_0x0e82('0x13')]=function(_0x53622b){var _0x25ac21=this;return new Promise(function(_0x310aac,_0x3a3ddf){return db[_0x0e82('0x14')][_0x0e82('0x15')]({'raw':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x18')]||null:null,'attributes':_0x53622b['options']?_0x53622b['options'][_0x0e82('0x19')]||null:null,'limit':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1a')]||null:null,'include':_0x53622b[_0x0e82('0x16')]?_0x53622b[_0x0e82('0x16')][_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x53622b['options'][_0x0e82('0x1b')],function(_0x13f023){return{'model':db[_0x13f023[_0x0e82('0x1d')]],'as':_0x13f023['as'],'attributes':_0x13f023[_0x0e82('0x19')],'include':_0x13f023['include']?_[_0x0e82('0x1c')](_0x13f023[_0x0e82('0x1b')],function(_0x7a9399){return{'model':db[_0x7a9399[_0x0e82('0x1d')]],'as':_0x7a9399['as'],'attributes':_0x7a9399['attributes'],'include':_0x7a9399[_0x0e82('0x1b')]?_['map'](_0x7a9399['include'],function(_0x384f88){return{'model':db[_0x384f88[_0x0e82('0x1d')]],'as':_0x384f88['as'],'attributes':_0x384f88['attributes']};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0xe3c530){logger[_0x0e82('0x1e')]('GetTrigger',_0x53622b);logger[_0x0e82('0xd')](_0x0e82('0x13'),_0x53622b,JSON['stringify'](_0xe3c530));_0x310aac(_0xe3c530);})[_0x0e82('0x1f')](function(_0x59a5b6){logger[_0x0e82('0x10')](_0x0e82('0x13'),_0x59a5b6['message'],_0x53622b);_0x3a3ddf(_0x25ac21[_0x0e82('0x10')](0x1f4,_0x59a5b6[_0x0e82('0x12')]));});});};exports[_0x0e82('0x20')]=function(_0x4d74d0){var _0x50adb7=this;return new Promise(function(_0x2dc021,_0x4a8c43){return db[_0x0e82('0x14')]['find']({'raw':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x17')]===undefined?!![]:![]:!![],'where':_0x4d74d0['options']?_0x4d74d0[_0x0e82('0x16')]['where']||null:null,'attributes':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x19')]||null:null,'include':_0x4d74d0[_0x0e82('0x16')]?_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')]?_['map'](_0x4d74d0[_0x0e82('0x16')][_0x0e82('0x1b')],function(_0x34c914){return{'model':db[_0x34c914[_0x0e82('0x1d')]],'as':_0x34c914['as'],'attributes':_0x34c914[_0x0e82('0x19')],'include':_0x34c914[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0x34c914[_0x0e82('0x1b')],function(_0xfd7924){return{'model':db[_0xfd7924[_0x0e82('0x1d')]],'as':_0xfd7924['as'],'attributes':_0xfd7924[_0x0e82('0x19')],'include':_0xfd7924[_0x0e82('0x1b')]?_[_0x0e82('0x1c')](_0xfd7924[_0x0e82('0x1b')],function(_0x21dd97){return{'model':db[_0x21dd97['model']],'as':_0x21dd97['as'],'attributes':_0x21dd97[_0x0e82('0x19')]};}):[]};}):[]};}):[]:[]})[_0x0e82('0xa')](function(_0x3be8e8){logger[_0x0e82('0x1e')]('ShowTrigger',_0x4d74d0);logger[_0x0e82('0xd')](_0x0e82('0x20'),_0x4d74d0,JSON['stringify'](_0x3be8e8));_0x2dc021(_0x3be8e8);})[_0x0e82('0x1f')](function(_0x57e505){logger['error'](_0x0e82('0x20'),_0x57e505[_0x0e82('0x12')],_0x4d74d0);_0x4a8c43(_0x50adb7[_0x0e82('0x10')](0x1f4,_0x57e505[_0x0e82('0x12')]));});});}; \ No newline at end of file +var _0xe2cf=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetTrigger','Trigger','findAll','options','include','map','model','attributes','info','debug','ShowTrigger','find','raw','where','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','request','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x49efb2,_0x4b9081){var _0x2cd91b=function(_0x34a682){while(--_0x34a682){_0x49efb2['push'](_0x49efb2['shift']());}};_0x2cd91b(++_0x4b9081);}(_0xe2cf,0x1a1));var _0xfe2c=function(_0x27c13b,_0x53d77e){_0x27c13b=_0x27c13b-0x0;var _0x1fcd94=_0xe2cf[_0x27c13b];return _0x1fcd94;};'use strict';var _=require('lodash');var util=require(_0xfe2c('0x0'));var moment=require('moment');var BPromise=require(_0xfe2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfe2c('0x2'));var db=require(_0xfe2c('0x3'))['db'];var utils=require(_0xfe2c('0x4'));var logger=require(_0xfe2c('0x5'))('rpc');var config=require(_0xfe2c('0x6'));var jayson=require(_0xfe2c('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4e0b97,_0x417bc4,_0x5e5b46){return new BPromise(function(_0x485a24,_0x30aafe){return client[_0xfe2c('0x8')](_0x4e0b97,_0x5e5b46)[_0xfe2c('0x9')](function(_0x562414){logger['info'](_0xfe2c('0xa'),_0x417bc4,_0xfe2c('0xb'));logger['debug'](_0xfe2c('0xc'),_0x417bc4,_0xfe2c('0xb'),JSON[_0xfe2c('0xd')](_0x562414));if(_0x562414[_0xfe2c('0xe')]){if(_0x562414[_0xfe2c('0xe')][_0xfe2c('0xf')]===0x1f4){logger[_0xfe2c('0xe')]('Trigger,\x20%s,\x20%s',_0x417bc4,_0x562414['error']['message']);return _0x30aafe(_0x562414['error'][_0xfe2c('0x10')]);}logger['error']('Trigger,\x20%s,\x20%s',_0x417bc4,_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);return _0x485a24(_0x562414[_0xfe2c('0xe')][_0xfe2c('0x10')]);}else{logger['info']('Trigger,\x20%s,\x20%s',_0x417bc4,_0xfe2c('0xb'));_0x485a24(_0x562414[_0xfe2c('0x11')][_0xfe2c('0x10')]);}})[_0xfe2c('0x12')](function(_0x565f40){logger[_0xfe2c('0xe')](_0xfe2c('0xa'),_0x417bc4,_0x565f40);_0x30aafe(_0x565f40);});});}exports[_0xfe2c('0x13')]=function(_0x23242b){var _0x36aeec=this;return new Promise(function(_0x13f233,_0x4afea3){return db[_0xfe2c('0x14')][_0xfe2c('0x15')]({'raw':_0x23242b[_0xfe2c('0x16')]?_0x23242b[_0xfe2c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x23242b[_0xfe2c('0x16')]?_0x23242b['options']['where']||null:null,'attributes':_0x23242b[_0xfe2c('0x16')]?_0x23242b[_0xfe2c('0x16')]['attributes']||null:null,'limit':_0x23242b[_0xfe2c('0x16')]?_0x23242b[_0xfe2c('0x16')]['limit']||null:null,'include':_0x23242b[_0xfe2c('0x16')]?_0x23242b['options'][_0xfe2c('0x17')]?_[_0xfe2c('0x18')](_0x23242b[_0xfe2c('0x16')][_0xfe2c('0x17')],function(_0x360928){return{'model':db[_0x360928[_0xfe2c('0x19')]],'as':_0x360928['as'],'attributes':_0x360928['attributes'],'include':_0x360928[_0xfe2c('0x17')]?_[_0xfe2c('0x18')](_0x360928[_0xfe2c('0x17')],function(_0x26448c){return{'model':db[_0x26448c[_0xfe2c('0x19')]],'as':_0x26448c['as'],'attributes':_0x26448c[_0xfe2c('0x1a')],'include':_0x26448c['include']?_[_0xfe2c('0x18')](_0x26448c['include'],function(_0x16daf3){return{'model':db[_0x16daf3[_0xfe2c('0x19')]],'as':_0x16daf3['as'],'attributes':_0x16daf3[_0xfe2c('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x377cc5){logger[_0xfe2c('0x1b')]('GetTrigger',_0x23242b);logger[_0xfe2c('0x1c')](_0xfe2c('0x13'),_0x23242b,JSON[_0xfe2c('0xd')](_0x377cc5));_0x13f233(_0x377cc5);})[_0xfe2c('0x12')](function(_0x170026){logger[_0xfe2c('0xe')]('GetTrigger',_0x170026['message'],_0x23242b);_0x4afea3(_0x36aeec[_0xfe2c('0xe')](0x1f4,_0x170026[_0xfe2c('0x10')]));});});};exports[_0xfe2c('0x1d')]=function(_0xe940fe){var _0xf4495b=this;return new Promise(function(_0x4bd059,_0x1f8ea7){return db[_0xfe2c('0x14')][_0xfe2c('0x1e')]({'raw':_0xe940fe[_0xfe2c('0x16')]?_0xe940fe[_0xfe2c('0x16')][_0xfe2c('0x1f')]===undefined?!![]:![]:!![],'where':_0xe940fe[_0xfe2c('0x16')]?_0xe940fe[_0xfe2c('0x16')][_0xfe2c('0x20')]||null:null,'attributes':_0xe940fe[_0xfe2c('0x16')]?_0xe940fe[_0xfe2c('0x16')][_0xfe2c('0x1a')]||null:null,'include':_0xe940fe['options']?_0xe940fe[_0xfe2c('0x16')][_0xfe2c('0x17')]?_[_0xfe2c('0x18')](_0xe940fe['options'][_0xfe2c('0x17')],function(_0x5db150){return{'model':db[_0x5db150['model']],'as':_0x5db150['as'],'attributes':_0x5db150[_0xfe2c('0x1a')],'include':_0x5db150[_0xfe2c('0x17')]?_[_0xfe2c('0x18')](_0x5db150['include'],function(_0x57f74d){return{'model':db[_0x57f74d[_0xfe2c('0x19')]],'as':_0x57f74d['as'],'attributes':_0x57f74d[_0xfe2c('0x1a')],'include':_0x57f74d[_0xfe2c('0x17')]?_[_0xfe2c('0x18')](_0x57f74d[_0xfe2c('0x17')],function(_0x166838){return{'model':db[_0x166838['model']],'as':_0x166838['as'],'attributes':_0x166838['attributes']};}):[]};}):[]};}):[]:[]})[_0xfe2c('0x9')](function(_0x431e5b){logger[_0xfe2c('0x1b')](_0xfe2c('0x1d'),_0xe940fe);logger['debug'](_0xfe2c('0x1d'),_0xe940fe,JSON['stringify'](_0x431e5b));_0x4bd059(_0x431e5b);})[_0xfe2c('0x12')](function(_0x31ba48){logger['error'](_0xfe2c('0x1d'),_0x31ba48['message'],_0xe940fe);_0x1f8ea7(_0xf4495b['error'](0x1f4,_0x31ba48[_0xfe2c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index 30fd841..60ae3a3 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 _0x5c12=['./trunk.controller','get','index','/:id','post','/:id/clone','isAuthenticated','clone','create','put','update','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x44044c,_0x4968f8){var _0x192685=function(_0x1b5b12){while(--_0x1b5b12){_0x44044c['push'](_0x44044c['shift']());}};_0x192685(++_0x4968f8);}(_0x5c12,0x188));var _0x25c1=function(_0x2a4095,_0x13f4f0){_0x2a4095=_0x2a4095-0x0;var _0x52eeab=_0x5c12[_0x2a4095];return _0x52eeab;};'use strict';var multer=require('multer');var util=require(_0x25c1('0x0'));var path=require(_0x25c1('0x1'));var timeout=require('connect-timeout');var express=require(_0x25c1('0x2'));var router=express[_0x25c1('0x3')]();var auth=require(_0x25c1('0x4'));var interaction=require(_0x25c1('0x5'));var config=require(_0x25c1('0x6'));var controller=require(_0x25c1('0x7'));router[_0x25c1('0x8')]('/',auth['isAuthenticated'](),controller[_0x25c1('0x9')]);router[_0x25c1('0x8')](_0x25c1('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x25c1('0xb')](_0x25c1('0xc'),auth[_0x25c1('0xd')](),controller[_0x25c1('0xe')]);router[_0x25c1('0xb')]('/',auth['isAuthenticated'](),controller[_0x25c1('0xf')]);router[_0x25c1('0x10')](_0x25c1('0xa'),auth[_0x25c1('0xd')](),controller[_0x25c1('0x11')]);router['delete'](_0x25c1('0xa'),auth[_0x25c1('0xd')](),controller['destroy']);module[_0x25c1('0x12')]=router; \ No newline at end of file +var _0x55ca=['show','post','clone','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated','index','/:id'];(function(_0x43d749,_0x7e7f38){var _0x56dbc5=function(_0x4bbd4e){while(--_0x4bbd4e){_0x43d749['push'](_0x43d749['shift']());}};_0x56dbc5(++_0x7e7f38);}(_0x55ca,0x126));var _0xa55c=function(_0x350182,_0x2a9feb){_0x350182=_0x350182-0x0;var _0x4a0892=_0x55ca[_0x350182];return _0x4a0892;};'use strict';var multer=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xa55c('0x2')]();var auth=require(_0xa55c('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xa55c('0x4'));var controller=require(_0xa55c('0x5'));router[_0xa55c('0x6')]('/',auth[_0xa55c('0x7')](),controller[_0xa55c('0x8')]);router[_0xa55c('0x6')](_0xa55c('0x9'),auth['isAuthenticated'](),controller[_0xa55c('0xa')]);router[_0xa55c('0xb')]('/:id/clone',auth[_0xa55c('0x7')](),controller[_0xa55c('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa55c('0xd')]);router[_0xa55c('0xe')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0xf')]);router[_0xa55c('0x10')](_0xa55c('0x9'),auth[_0xa55c('0x7')](),controller[_0xa55c('0x11')]);module[_0xa55c('0x12')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index 55c3fc0..c754649 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 _0x7e16=['always','accept','refuse','uac','uas','pai','certificate','passive','actpass','dynamic','nonat','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','transport','join','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','shortinfo','inband','rfc2833','yes','update','force_rport,comedia','setDataValue','nat','split','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','INTEGER'];(function(_0x3b12df,_0x34fcfb){var _0x38660f=function(_0x1504da){while(--_0x1504da){_0x3b12df['push'](_0x3b12df['shift']());}};_0x38660f(++_0x34fcfb);}(_0x7e16,0xa0));var _0x67e1=function(_0xbfe039,_0xbdd7d4){_0xbfe039=_0xbfe039-0x0;var _0x194fdb=_0x7e16[_0xbfe039];return _0x194fdb;};'use strict';var Sequelize=require(_0x67e1('0x0'));module[_0x67e1('0x1')]={'name':{'type':Sequelize[_0x67e1('0x2')],'allowNull':![],'unique':_0x67e1('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x67e1('0x4')]('friend',_0x67e1('0x5'),_0x67e1('0x6')),'allowNull':![],'defaultValue':'friend'},'context':{'type':Sequelize[_0x67e1('0x2')],'allowNull':![],'defaultValue':_0x67e1('0x7')},'callingpres':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x8'),_0x67e1('0x9'),_0x67e1('0xa'),_0x67e1('0xb'),_0x67e1('0xc'),_0x67e1('0xd'),_0x67e1('0xe'),'PROHIB')},'deny':{'type':Sequelize[_0x67e1('0x2')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize[_0x67e1('0x2')]},'md5secret':{'type':Sequelize[_0x67e1('0x2')]},'remotesecret':{'type':Sequelize[_0x67e1('0x2')]},'transport':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':_0x67e1('0xf'),'set':function(_0x4ed90e){this['setDataValue'](_0x67e1('0x10'),_0x4ed90e?_0x4ed90e[_0x67e1('0x11')](','):null);},'get':function(){return this[_0x67e1('0x12')]('transport')?this[_0x67e1('0x12')](_0x67e1('0x10'))['split'](','):null;},'comment':_0x67e1('0x13')},'dtmfmode':{'type':Sequelize[_0x67e1('0x4')]('rfc2833','info',_0x67e1('0x14'),_0x67e1('0x15'),'auto'),'defaultValue':_0x67e1('0x16')},'directmedia':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no','nonat',_0x67e1('0x18'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x67e1('0x2')]},'directmediadeny':{'type':Sequelize[_0x67e1('0x2')]},'nat':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':_0x67e1('0x19'),'set':function(_0x58202f){this[_0x67e1('0x1a')](_0x67e1('0x1b'),_0x58202f?_0x58202f[_0x67e1('0x11')](','):null);},'get':function(){return this[_0x67e1('0x12')](_0x67e1('0x1b'))?this['getDataValue'](_0x67e1('0x1b'))[_0x67e1('0x1c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0x67e1('0x2')]},'namedcallgroup':{'type':Sequelize[_0x67e1('0x2')]},'pickupgroup':{'type':Sequelize[_0x67e1('0x2')]},'namedpickupgroup':{'type':Sequelize[_0x67e1('0x2')]},'language':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0x67e1('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':_0x67e1('0x1d')},'allow':{'type':Sequelize[_0x67e1('0x2')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x2bbfed){this[_0x67e1('0x1a')](_0x67e1('0x1e'),_0x2bbfed?_0x2bbfed['join'](';'):_0x67e1('0x1f'));},'get':function(){return this[_0x67e1('0x12')](_0x67e1('0x1e'))?this[_0x67e1('0x12')](_0x67e1('0x1e'))[_0x67e1('0x1c')](';'):null;},'comment':_0x67e1('0x20')},'autoframing':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'insecure':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':_0x67e1('0x21'),'set':function(_0x580df2){this['setDataValue'](_0x67e1('0x22'),_0x580df2?_0x580df2[_0x67e1('0x11')](','):null);},'get':function(){return this[_0x67e1('0x12')](_0x67e1('0x22'))?this['getDataValue']('insecure')['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]'},'trustrpid':{'type':Sequelize['ENUM'](_0x67e1('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0x67e1('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'useclientcode':{'type':Sequelize[_0x67e1('0x4')]('yes','no')},'accountcode':{'type':Sequelize[_0x67e1('0x23')](0xb)},'setvar':{'type':Sequelize[_0x67e1('0x2')]},'callerid':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0x67e1('0x2')]},'callcounter':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no'),'defaultValue':_0x67e1('0x17')},'busylevel':{'type':Sequelize[_0x67e1('0x23')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'allowtransfer':{'type':Sequelize['ENUM'](_0x67e1('0x17'),'no')},'ignoresdpversion':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0x67e1('0x2')]},'template':{'type':Sequelize[_0x67e1('0x2')]},'videosupport':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no',_0x67e1('0x24')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0x67e1('0x23')](0xb)},'rfc2833compensate':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'mailbox':{'type':Sequelize[_0x67e1('0x2')]},'session_timers':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x25'),_0x67e1('0x26'),'originate')},'session_expires':{'type':Sequelize[_0x67e1('0x23')](0xb)},'session_minse':{'type':Sequelize[_0x67e1('0x23')](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0x67e1('0x27'),'uas'),'defaultValue':_0x67e1('0x28')},'t38pt_usertpsource':{'type':Sequelize[_0x67e1('0x2')]},'regexten':{'type':Sequelize[_0x67e1('0x2')]},'fromdomain':{'type':Sequelize[_0x67e1('0x2')]},'fromuser':{'type':Sequelize[_0x67e1('0x2')]},'port':{'type':Sequelize[_0x67e1('0x23')](0x5)},'qualify':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no'),'defaultValue':_0x67e1('0x17')},'keepalive':{'type':Sequelize['INTEGER'](0xb)},'defaultip':{'type':Sequelize[_0x67e1('0x2')]},'defaultuser':{'type':Sequelize[_0x67e1('0x2')]},'rtptimeout':{'type':Sequelize[_0x67e1('0x23')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0x67e1('0x23')](0xb)},'sendrpid':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no',_0x67e1('0x29')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x67e1('0x2')]},'callbackextension':{'type':Sequelize[_0x67e1('0x2')]},'timert1':{'type':Sequelize[_0x67e1('0x23')](0xb)},'timerb':{'type':Sequelize[_0x67e1('0x23')](0xb)},'qualifyfreq':{'type':Sequelize[_0x67e1('0x23')](0xb)},'contactpermit':{'type':Sequelize[_0x67e1('0x2')]},'contactdeny':{'type':Sequelize[_0x67e1('0x2')]},'contactacl':{'type':Sequelize[_0x67e1('0x2')]},'unsolicited_mailbox':{'type':Sequelize['STRING']},'use_q850_reason':{'type':Sequelize[_0x67e1('0x2')]},'maxforwards':{'type':Sequelize['INTEGER'](0xb)},'encryption':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'force_avp':{'type':Sequelize[_0x67e1('0x4')]('yes','no')},'icesupport':{'type':Sequelize[_0x67e1('0x4')]('yes','no')},'dtlsenable':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no','fingerprint',_0x67e1('0x2a'))},'dtlsrekey':{'type':Sequelize[_0x67e1('0x23')](0xb)},'dtlscertfile':{'type':Sequelize[_0x67e1('0x2')]},'dtlsprivatekey':{'type':Sequelize['STRING']},'dtlscipher':{'type':Sequelize[_0x67e1('0x2')]},'dtlscafile':{'type':Sequelize[_0x67e1('0x2')]},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0x67e1('0x4')]('active',_0x67e1('0x2b'),_0x67e1('0x2c')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x67e1('0x2')]},'usereqphone':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0x67e1('0x2')]},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize[_0x67e1('0x23')](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0x67e1('0x4')](_0x67e1('0x17'),'no')},'subscribemwi':{'type':Sequelize['ENUM'](_0x67e1('0x17'),'no')},'vmexten':{'type':Sequelize[_0x67e1('0x2')]},'mohinterpret':{'type':Sequelize['STRING']},'mohsuggest':{'type':Sequelize[_0x67e1('0x2')]},'parkinglot':{'type':Sequelize[_0x67e1('0x2')]},'description':{'type':Sequelize[_0x67e1('0x2')]},'host':{'type':Sequelize['STRING'],'defaultValue':_0x67e1('0x2d')},'canreinvite':{'type':Sequelize['ENUM'](_0x67e1('0x17'),'no',_0x67e1('0x2e'),_0x67e1('0x18'),_0x67e1('0x2f')),'defaultValue':'no'},'registry':{'type':Sequelize[_0x67e1('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0x67e1('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0x67e1('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x852a=['pai','fingerprint','certificate','passive','dynamic','BOOLEAN','exports','STRING','name','ENUM','friend','user','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','setDataValue','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','uac','uas'];(function(_0x32ad32,_0x3f3669){var _0x5b4278=function(_0x38ef25){while(--_0x38ef25){_0x32ad32['push'](_0x32ad32['shift']());}};_0x5b4278(++_0x3f3669);}(_0x852a,0x1f0));var _0xa852=function(_0x8de54f,_0x271987){_0x8de54f=_0x8de54f-0x0;var _0x14cba4=_0x852a[_0x8de54f];return _0x14cba4;};'use strict';var Sequelize=require('sequelize');module[_0xa852('0x0')]={'name':{'type':Sequelize[_0xa852('0x1')],'allowNull':![],'unique':_0xa852('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x4'),_0xa852('0x5'),'peer'),'allowNull':![],'defaultValue':_0xa852('0x4')},'context':{'type':Sequelize[_0xa852('0x1')],'allowNull':![],'defaultValue':'from-voip-provider'},'callingpres':{'type':Sequelize['ENUM'](_0xa852('0x6'),_0xa852('0x7'),_0xa852('0x8'),_0xa852('0x9'),'PROHIB_NOT_SCREENED',_0xa852('0xa'),_0xa852('0xb'),_0xa852('0xc'))},'deny':{'type':Sequelize['STRING']},'permit':{'type':Sequelize[_0xa852('0x1')]},'secret':{'type':Sequelize[_0xa852('0x1')]},'md5secret':{'type':Sequelize[_0xa852('0x1')]},'remotesecret':{'type':Sequelize[_0xa852('0x1')]},'transport':{'type':Sequelize[_0xa852('0x1')],'defaultValue':'udp','set':function(_0x22ae27){this[_0xa852('0xd')](_0xa852('0xe'),_0x22ae27?_0x22ae27[_0xa852('0xf')](','):null);},'get':function(){return this[_0xa852('0x10')](_0xa852('0xe'))?this[_0xa852('0x10')](_0xa852('0xe'))[_0xa852('0x11')](','):null;},'comment':_0xa852('0x12')},'dtmfmode':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x13'),_0xa852('0x14'),_0xa852('0x15'),_0xa852('0x16'),_0xa852('0x17')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no',_0xa852('0x19'),_0xa852('0x1a'),_0xa852('0x1b')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize['STRING']},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xa852('0x1')],'defaultValue':'force_rport,comedia','set':function(_0x4b31cc){this['setDataValue'](_0xa852('0x1c'),_0x4b31cc?_0x4b31cc['join'](','):null);},'get':function(){return this[_0xa852('0x10')]('nat')?this[_0xa852('0x10')](_0xa852('0x1c'))[_0xa852('0x11')](','):null;},'comment':_0xa852('0x1d')},'callgroup':{'type':Sequelize[_0xa852('0x1')]},'namedcallgroup':{'type':Sequelize[_0xa852('0x1')]},'pickupgroup':{'type':Sequelize[_0xa852('0x1')]},'namedpickupgroup':{'type':Sequelize[_0xa852('0x1')]},'language':{'type':Sequelize[_0xa852('0x1')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xa852('0x1')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xa852('0x1')],'defaultValue':_0xa852('0x1e')},'allow':{'type':Sequelize[_0xa852('0x1')],'allowNull':![],'defaultValue':_0xa852('0x1f'),'set':function(_0x332e51){this[_0xa852('0xd')]('allow',_0x332e51?_0x332e51[_0xa852('0xf')](';'):_0xa852('0x1f'));},'get':function(){return this[_0xa852('0x10')](_0xa852('0x20'))?this[_0xa852('0x10')](_0xa852('0x20'))[_0xa852('0x11')](';'):null;},'comment':_0xa852('0x21')},'autoframing':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'insecure':{'type':Sequelize[_0xa852('0x1')],'defaultValue':_0xa852('0x22'),'set':function(_0x112e4f){this[_0xa852('0xd')]('insecure',_0x112e4f?_0x112e4f[_0xa852('0xf')](','):null);},'get':function(){return this[_0xa852('0x10')]('insecure')?this[_0xa852('0x10')](_0xa852('0x23'))[_0xa852('0x11')](','):null;},'comment':_0xa852('0x24')},'trustrpid':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no','never')},'promiscredir':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'useclientcode':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'accountcode':{'type':Sequelize[_0xa852('0x25')](0xb)},'setvar':{'type':Sequelize[_0xa852('0x1')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xa852('0x26')},'amaflags':{'type':Sequelize['STRING']},'callcounter':{'type':Sequelize[_0xa852('0x3')]('yes','no'),'defaultValue':_0xa852('0x18')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'allowsubscribe':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'allowtransfer':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'ignoresdpversion':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'subscribecontext':{'type':Sequelize[_0xa852('0x1')]},'template':{'type':Sequelize[_0xa852('0x1')]},'videosupport':{'type':Sequelize['ENUM']('yes','no',_0xa852('0x27')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb)},'rfc2833compensate':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'mailbox':{'type':Sequelize[_0xa852('0x1')]},'session_timers':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x28'),'refuse','originate')},'session_expires':{'type':Sequelize['INTEGER'](0xb)},'session_minse':{'type':Sequelize[_0xa852('0x25')](0xb)},'session_refresher':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x29'),_0xa852('0x2a')),'defaultValue':_0xa852('0x2a')},'t38pt_usertpsource':{'type':Sequelize[_0xa852('0x1')]},'regexten':{'type':Sequelize[_0xa852('0x1')]},'fromdomain':{'type':Sequelize[_0xa852('0x1')]},'fromuser':{'type':Sequelize[_0xa852('0x1')]},'port':{'type':Sequelize[_0xa852('0x25')](0x5)},'qualify':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no'),'defaultValue':_0xa852('0x18')},'keepalive':{'type':Sequelize[_0xa852('0x25')](0xb)},'defaultip':{'type':Sequelize[_0xa852('0x1')]},'defaultuser':{'type':Sequelize[_0xa852('0x1')]},'rtptimeout':{'type':Sequelize[_0xa852('0x25')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xa852('0x25')](0xb)},'sendrpid':{'type':Sequelize['ENUM'](_0xa852('0x18'),'no',_0xa852('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xa852('0x1')]},'callbackextension':{'type':Sequelize[_0xa852('0x1')]},'timert1':{'type':Sequelize['INTEGER'](0xb)},'timerb':{'type':Sequelize[_0xa852('0x25')](0xb)},'qualifyfreq':{'type':Sequelize[_0xa852('0x25')](0xb)},'contactpermit':{'type':Sequelize[_0xa852('0x1')]},'contactdeny':{'type':Sequelize['STRING']},'contactacl':{'type':Sequelize[_0xa852('0x1')]},'unsolicited_mailbox':{'type':Sequelize[_0xa852('0x1')]},'use_q850_reason':{'type':Sequelize[_0xa852('0x1')]},'maxforwards':{'type':Sequelize[_0xa852('0x25')](0xb)},'encryption':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'force_avp':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'icesupport':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'dtlsenable':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'dtlsverify':{'type':Sequelize[_0xa852('0x3')]('yes','no',_0xa852('0x2c'),_0xa852('0x2d'))},'dtlsrekey':{'type':Sequelize[_0xa852('0x25')](0xb)},'dtlscertfile':{'type':Sequelize['STRING']},'dtlsprivatekey':{'type':Sequelize[_0xa852('0x1')]},'dtlscipher':{'type':Sequelize[_0xa852('0x1')]},'dtlscafile':{'type':Sequelize[_0xa852('0x1')]},'dtlscapath':{'type':Sequelize[_0xa852('0x1')]},'dtlssetup':{'type':Sequelize[_0xa852('0x3')]('active',_0xa852('0x2e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xa852('0x1')]},'usereqphone':{'type':Sequelize['ENUM'](_0xa852('0x18'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xa852('0x1')]},'recordofffeature':{'type':Sequelize[_0xa852('0x1')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'subscribemwi':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no')},'vmexten':{'type':Sequelize[_0xa852('0x1')]},'mohinterpret':{'type':Sequelize[_0xa852('0x1')]},'mohsuggest':{'type':Sequelize[_0xa852('0x1')]},'parkinglot':{'type':Sequelize[_0xa852('0x1')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xa852('0x1')],'defaultValue':_0xa852('0x2f')},'canreinvite':{'type':Sequelize[_0xa852('0x3')](_0xa852('0x18'),'no','nonat','update','update,nonat'),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xa852('0x30')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xa852('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 ec0de7a..14f063d 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 _0xca2c=['clone','length','include','find','get','omit','createdAt','updatedAt','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','root','server/files/templates/trunk.ejs','utf8','readFileSync','join','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','registry','/etc/asterisk/sip_xcally_registers.conf','Reload','chan_sip.so','destroy','server/files/templates/registry.ejs','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','lodash','squel','crypto','desk.js','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/environment','../../mysqldb','jayson/promise','client','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','Trunks','stack','name','send','index','map','Trunk','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','options'];(function(_0x3b0876,_0x17a322){var _0x2ea28d=function(_0x5a57e4){while(--_0x5a57e4){_0x3b0876['push'](_0x3b0876['shift']());}};_0x2ea28d(++_0x17a322);}(_0xca2c,0xfd));var _0xcca2=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xca2c[_0x2dafbe];return _0x58a45a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcca2('0x0'));var rimraf=require(_0xcca2('0x1'));var zipdir=require(_0xcca2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xcca2('0x3'));var moment=require(_0xcca2('0x4'));var BPromise=require(_0xcca2('0x5'));var Mustache=require(_0xcca2('0x6'));var util=require(_0xcca2('0x7'));var path=require(_0xcca2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xcca2('0x9'));var squel=require(_0xcca2('0xa'));var crypto=require(_0xcca2('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xcca2('0xc'));var toCsv=require(_0xcca2('0xd'));var querystring=require('querystring');var Papa=require(_0xcca2('0xe'));var Redis=require(_0xcca2('0xf'));var authService=require(_0xcca2('0x10'));var qs=require(_0xcca2('0x11'));var as=require(_0xcca2('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0xcca2('0x13'));var db=require(_0xcca2('0x14'))['db'];var jayson=require(_0xcca2('0x15'));var client=jayson[_0xcca2('0x16')]['http']({'port':0x232a});function checkPasswordPattern(_0x3dc7ef,_0x4a9896,_0x255011){if(_0x255011){var _0x1c2ad8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1c2ad8[_0xcca2('0x17')](_0x4a9896)){return _0x3dc7ef;}else{throw new db['Sequelize']['ValidationError'](_0xcca2('0x18'));}}else{return _0x3dc7ef;}}function respondWithRpcPromise(_0x56f1f6,_0x2a7f9b,_0x1356da,_0x23f6c8){return new BPromise(function(_0x136237,_0x5bdb9f){var _0x1a91fc=_0x23f6c8||client;return _0x1a91fc[_0xcca2('0x19')](_0x56f1f6,_0x1356da)[_0xcca2('0x1a')](function(_0x246f5c){logger['info'](_0xcca2('0x1b'),_0x2a7f9b,_0xcca2('0x1c'));logger[_0xcca2('0x1d')](_0xcca2('0x1e'),_0x2a7f9b,_0xcca2('0x1c'),JSON[_0xcca2('0x1f')](_0x246f5c));if(_0x246f5c[_0xcca2('0x20')]){if(_0x246f5c[_0xcca2('0x20')][_0xcca2('0x21')]===0x1f4){logger[_0xcca2('0x20')](_0xcca2('0x1b'),_0x2a7f9b,_0x246f5c[_0xcca2('0x20')][_0xcca2('0x22')]);return _0x5bdb9f(_0x246f5c['error'][_0xcca2('0x22')]);}logger['error'](_0xcca2('0x1b'),_0x2a7f9b,_0x246f5c[_0xcca2('0x20')]['message']);return _0x136237(_0x246f5c['error']['message']);}else{logger[_0xcca2('0x23')](_0xcca2('0x1b'),_0x2a7f9b,_0xcca2('0x1c'));_0x136237(_0x246f5c['result'][_0xcca2('0x22')]);}})['catch'](function(_0xb08f13){logger['error']('Trunk,\x20%s,\x20%s',_0x2a7f9b,_0xb08f13);_0x5bdb9f(_0xb08f13);});});}function respondWithStatusCode(_0x677211,_0x24ae4a){_0x24ae4a=_0x24ae4a||0xcc;return function(_0x2a2839){if(_0x2a2839){return _0x677211[_0xcca2('0x24')](_0x24ae4a);}return _0x677211[_0xcca2('0x25')](_0x24ae4a)[_0xcca2('0x26')]();};}function respondWithResult(_0x2c918e,_0x600b48){_0x600b48=_0x600b48||0xc8;return function(_0x29d382){if(_0x29d382){return _0x2c918e['status'](_0x600b48)[_0xcca2('0x27')](_0x29d382);}};}function respondWithFilteredResult(_0x1d2ff7,_0x1ac079){return function(_0x5f18b0){if(_0x5f18b0){var _0x4c5972=_0x5f18b0[_0xcca2('0x28')],_0x2801d2=_0x1ac079[_0xcca2('0x29')],_0x510c32=_0x1ac079[_0xcca2('0x29')]+_0x1ac079['limit'],_0x40a0e6;if(_0x510c32>=_0x4c5972){_0x510c32=_0x4c5972;_0x40a0e6=0xc8;}else{_0x40a0e6=0xce;}_0x1d2ff7['status'](_0x40a0e6);return _0x1d2ff7['set'](_0xcca2('0x2a'),_0x2801d2+'-'+_0x510c32+'/'+_0x4c5972)['json'](_0x5f18b0);}return null;};}function patchUpdates(_0x3a2df5){return function(_0x188de8){try{jsonpatch[_0xcca2('0x2b')](_0x188de8,_0x3a2df5,!![]);}catch(_0x3885d6){return BPromise[_0xcca2('0x2c')](_0x3885d6);}return _0x188de8[_0xcca2('0x2d')]();};}function saveUpdates(_0x259b6b,_0x3465c6){return function(_0x37eef6){if(_0x37eef6){return _0x37eef6[_0xcca2('0x2e')](_0x259b6b)['then'](function(_0x4bfe18){return _0x4bfe18;});}return null;};}function removeEntity(_0x554181,_0x5cddb6){return function(_0xaa1b6c){if(_0xaa1b6c){return _0xaa1b6c['destroy']()['then'](function(){var _0x3d801c=_0xaa1b6c['get']({'plain':!![]});var _0x49a864=_0xcca2('0x2f');return db['UserProfileResource']['destroy']({'where':{'type':_0x49a864,'resourceId':_0x3d801c['id']}})['then'](function(){return _0xaa1b6c;});})[_0xcca2('0x1a')](function(){_0x554181[_0xcca2('0x25')](0xcc)[_0xcca2('0x26')]();});}};}function handleEntityNotFound(_0x5105e9,_0x58a6f2){return function(_0xa615a2){if(!_0xa615a2){_0x5105e9[_0xcca2('0x24')](0x194);}return _0xa615a2;};}function handleError(_0x56f42b,_0x5d5312){_0x5d5312=_0x5d5312||0x1f4;return function(_0x526f9f){logger[_0xcca2('0x20')](_0x526f9f[_0xcca2('0x30')]);if(_0x526f9f[_0xcca2('0x31')]){delete _0x526f9f[_0xcca2('0x31')];}_0x56f42b[_0xcca2('0x25')](_0x5d5312)[_0xcca2('0x32')](_0x526f9f);};}exports[_0xcca2('0x33')]=function(_0x2ca7e0,_0x44fce4){var _0x471ca5={},_0x1008ff={},_0x258025={'count':0x0,'rows':[]};var _0x415be8=_[_0xcca2('0x34')](db[_0xcca2('0x35')][_0xcca2('0x36')],function(_0x2b3768){return{'name':_0x2b3768[_0xcca2('0x37')],'type':_0x2b3768[_0xcca2('0x38')][_0xcca2('0x39')]};});_0x1008ff[_0xcca2('0x3a')]=_['map'](_0x415be8,_0xcca2('0x31'));_0x1008ff[_0xcca2('0x3b')]=_[_0xcca2('0x3c')](_0x2ca7e0[_0xcca2('0x3b')]);_0x1008ff[_0xcca2('0x3d')]=_[_0xcca2('0x3e')](_0x1008ff['model'],_0x1008ff[_0xcca2('0x3b')]);_0x471ca5['attributes']=_[_0xcca2('0x3e')](_0x1008ff[_0xcca2('0x3a')],qs[_0xcca2('0x3f')](_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x3f')]));_0x471ca5[_0xcca2('0x40')]=_0x471ca5[_0xcca2('0x40')]['length']?_0x471ca5[_0xcca2('0x40')]:_0x1008ff[_0xcca2('0x3a')];if(!_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x41')]('nolimit')){_0x471ca5[_0xcca2('0x42')]=qs['limit'](_0x2ca7e0[_0xcca2('0x3b')]['limit']);_0x471ca5['offset']=qs[_0xcca2('0x29')](_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x29')]);}_0x471ca5[_0xcca2('0x43')]=qs[_0xcca2('0x44')](_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x44')]);_0x471ca5[_0xcca2('0x45')]=qs[_0xcca2('0x3d')](_[_0xcca2('0x46')](_0x2ca7e0['query'],_0x1008ff[_0xcca2('0x3d')]));if(_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x47')]){_0x471ca5[_0xcca2('0x45')]=_[_0xcca2('0x48')](_0x471ca5[_0xcca2('0x45')],{'$or':_[_0xcca2('0x34')](_0x415be8,function(_0x336531){if(_0x336531['type']!==_0xcca2('0x49')){var _0x29a7bc={};_0x29a7bc[_0x336531[_0xcca2('0x31')]]={'$like':'%'+_0x2ca7e0['query'][_0xcca2('0x47')]+'%'};return _0x29a7bc;}})});}_0x471ca5=_[_0xcca2('0x48')]({},_0x471ca5,_0x2ca7e0['options']);var _0x36fffc={'where':_0x471ca5[_0xcca2('0x45')]};return db['Trunk'][_0xcca2('0x28')](_0x36fffc)[_0xcca2('0x1a')](function(_0x477c40){_0x258025[_0xcca2('0x28')]=_0x477c40;if(_0x2ca7e0[_0xcca2('0x3b')][_0xcca2('0x4a')]){_0x471ca5['include']=[{'all':!![]}];}return db[_0xcca2('0x35')][_0xcca2('0x4b')](_0x471ca5);})['then'](function(_0x46e25e){_0x258025['rows']=_0x46e25e;return _0x258025;})[_0xcca2('0x1a')](respondWithFilteredResult(_0x44fce4,_0x471ca5))[_0xcca2('0x4c')](handleError(_0x44fce4,null));};exports[_0xcca2('0x4d')]=function(_0xa7b5d8,_0x573291){var _0x14a5cb={'raw':![],'where':{'id':_0xa7b5d8[_0xcca2('0x4e')]['id']}},_0xd1c1f3={};_0xd1c1f3['model']=_[_0xcca2('0x3c')](db['Trunk'][_0xcca2('0x36')]);_0xd1c1f3['query']=_[_0xcca2('0x3c')](_0xa7b5d8[_0xcca2('0x3b')]);_0xd1c1f3[_0xcca2('0x3d')]=_['intersection'](_0xd1c1f3['model'],_0xd1c1f3['query']);_0x14a5cb[_0xcca2('0x40')]=_[_0xcca2('0x3e')](_0xd1c1f3[_0xcca2('0x3a')],qs[_0xcca2('0x3f')](_0xa7b5d8['query'][_0xcca2('0x3f')]));_0x14a5cb[_0xcca2('0x40')]=_0x14a5cb[_0xcca2('0x40')]['length']?_0x14a5cb[_0xcca2('0x40')]:_0xd1c1f3[_0xcca2('0x3a')];if(_0xa7b5d8['query'][_0xcca2('0x4a')]){_0x14a5cb['include']=[{'all':!![]}];}_0x14a5cb=_[_0xcca2('0x48')]({},_0x14a5cb,_0xa7b5d8[_0xcca2('0x4f')]);return db[_0xcca2('0x35')]['find'](_0x14a5cb)[_0xcca2('0x1a')](handleEntityNotFound(_0x573291,null))[_0xcca2('0x1a')](respondWithResult(_0x573291,null))[_0xcca2('0x4c')](handleError(_0x573291,null));};exports[_0xcca2('0x50')]=function(_0x33fd1a,_0x464773){var _0x1699bd={'where':{'id':_0x33fd1a['params']['id']}},_0x1b4100={};_0x1b4100['model']=_[_0xcca2('0x3c')](db[_0xcca2('0x35')][_0xcca2('0x36')]);_0x1699bd[_0xcca2('0x40')]=_[_0xcca2('0x3e')](_0x1b4100[_0xcca2('0x3a')],qs['fields'](_0x33fd1a[_0xcca2('0x3b')][_0xcca2('0x3f')]));_0x1699bd['attributes']=_0x1699bd[_0xcca2('0x40')][_0xcca2('0x51')]?_0x1699bd['attributes']:_0x1b4100[_0xcca2('0x3a')];if(_0x33fd1a[_0xcca2('0x3b')][_0xcca2('0x4a')]){_0x1699bd[_0xcca2('0x52')]=[{'all':!![]}];}_0x1699bd=_[_0xcca2('0x48')]({},_0x1699bd,_0x33fd1a[_0xcca2('0x4f')]);return db[_0xcca2('0x35')][_0xcca2('0x53')](_0x1699bd)['then'](handleEntityNotFound(_0x464773,null))['then'](function(_0x26941a){if(_0x26941a){var _0x36df71=_0x26941a[_0xcca2('0x54')]({'plain':!![]});_0x36df71=qs[_0xcca2('0x55')](_0x36df71,['id',_0xcca2('0x56'),_0xcca2('0x57')]);_0x33fd1a[_0xcca2('0x58')]=_['omit'](_0x33fd1a[_0xcca2('0x58')],['id','createdAt',_0xcca2('0x57')]);return db[_0xcca2('0x35')]['create'](_['merge'](_0x36df71,_0x33fd1a[_0xcca2('0x58')]),{'include':_0x33fd1a[_0xcca2('0x3b')][_0xcca2('0x4a')]?[{'all':!![]}]:undefined})[_0xcca2('0x1a')](function(_0x124b67){var _0x251b45=_0x33fd1a[_0xcca2('0x59')][_0xcca2('0x54')]({'plain':!![]});if(!_0x251b45)throw new Error(_0xcca2('0x5a'));if(_0x251b45[_0xcca2('0x5b')]==='user'){var _0x243f02=_0x124b67[_0xcca2('0x54')]({'plain':!![]});var _0x2583f5=_0xcca2('0x2f');return db[_0xcca2('0x5c')]['find']({'where':{'name':_0x2583f5,'userProfileId':_0x251b45['userProfileId']},'raw':!![]})['then'](function(_0x4c5291){if(_0x4c5291&&_0x4c5291[_0xcca2('0x5d')]===0x0){return db[_0xcca2('0x5e')][_0xcca2('0x5f')]({'name':_0x243f02['name'],'resourceId':_0x243f02['id'],'type':_0x4c5291[_0xcca2('0x31')],'sectionId':_0x4c5291['id']},{})[_0xcca2('0x1a')](function(){return _0x124b67;});}else{return _0x124b67;}})[_0xcca2('0x4c')](function(_0x9b4ed8){logger[_0xcca2('0x20')](_0xcca2('0x60'),_0x9b4ed8);throw _0x9b4ed8;});}return _0x124b67;});}})[_0xcca2('0x1a')](respondWithResult(_0x464773,0xc9))[_0xcca2('0x4c')](handleError(_0x464773,null));};exports[_0xcca2('0x5f')]=function(_0x1a0bf8,_0x2c1e35,_0x2ef231){var _0x161ac2;return db['Trunk'][_0xcca2('0x5f')](_0x1a0bf8[_0xcca2('0x58')],{'raw':!![]})[_0xcca2('0x1a')](function(_0x3a2e44){_0x161ac2=_0x3a2e44;return db['Trunk'][_0xcca2('0x4b')]({'raw':!![]});})[_0xcca2('0x1a')](function(_0x185b11){var _0x1a3eaf=fs['readFileSync'](path['join'](config[_0xcca2('0x61')],_0xcca2('0x62')),_0xcca2('0x63'));var _0x3eb7da=fs[_0xcca2('0x64')](path[_0xcca2('0x65')](config[_0xcca2('0x61')],'server/files/templates/registry.ejs'),_0xcca2('0x63'));var _0x4bfa21=ejs[_0xcca2('0x66')](_0x1a3eaf,{'trunks':_0x185b11||[]});fs[_0xcca2('0x67')](_0xcca2('0x68'),_0x4bfa21);if(_0x161ac2[_0xcca2('0x69')]){var _0xb25647=ejs[_0xcca2('0x66')](_0x3eb7da,{'trunks':_0x185b11||[]});fs[_0xcca2('0x67')](_0xcca2('0x6a'),_0xb25647);}})[_0xcca2('0x1a')](function(){return respondWithRpcPromise(_0xcca2('0x6b'),_0xcca2('0x5f'),{'module':_0xcca2('0x6c')});})[_0xcca2('0x1a')](function(){var _0x2180de=_0x1a0bf8[_0xcca2('0x59')][_0xcca2('0x54')]({'plain':!![]});if(!_0x2180de)throw new Error(_0xcca2('0x5a'));if(_0x2180de[_0xcca2('0x5b')]===_0xcca2('0x59')){var _0x3d05f9=_0x161ac2[_0xcca2('0x54')]({'plain':!![]});return db[_0xcca2('0x5c')]['find']({'where':{'name':_0xcca2('0x2f'),'userProfileId':_0x2180de['userProfileId']},'raw':!![]})[_0xcca2('0x1a')](function(_0x3eae2e){if(_0x3eae2e&&_0x3eae2e[_0xcca2('0x5d')]===0x0){return db['UserProfileResource'][_0xcca2('0x5f')]({'name':_0x3d05f9[_0xcca2('0x31')],'resourceId':_0x3d05f9['id'],'type':_0x3eae2e['name'],'sectionId':_0x3eae2e['id']},{})['then'](function(){return _0x161ac2;});}else{return _0x161ac2;}})[_0xcca2('0x4c')](function(_0x3e7e69){logger[_0xcca2('0x20')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3e7e69);throw _0x3e7e69;});}return _0x161ac2;})[_0xcca2('0x1a')](respondWithResult(_0x2c1e35,0xc9))[_0xcca2('0x4c')](handleError(_0x2c1e35,null));};exports[_0xcca2('0x2e')]=function(_0x43e3f5,_0x43c0ad,_0x3bc913){var _0x2260f8;return db[_0xcca2('0x35')][_0xcca2('0x53')]({'where':{'id':_0x43e3f5['params']['id']}})['then'](handleEntityNotFound(_0x43c0ad,null))[_0xcca2('0x1a')](saveUpdates(_0x43e3f5[_0xcca2('0x58')],null))[_0xcca2('0x1a')](function(_0x19367a){if(_0x19367a){_0x2260f8=_0x19367a;return db['Trunk'][_0xcca2('0x4b')]({'raw':!![]});}})[_0xcca2('0x1a')](function(_0x59c7c7){if(_0x59c7c7){var _0xbcfde8=fs[_0xcca2('0x64')](path[_0xcca2('0x65')](config[_0xcca2('0x61')],_0xcca2('0x62')),_0xcca2('0x63'));var _0x582ad=fs[_0xcca2('0x64')](path[_0xcca2('0x65')](config['root'],'server/files/templates/registry.ejs'),'utf8');var _0x4ef0ff=ejs[_0xcca2('0x66')](_0xbcfde8,{'trunks':_0x59c7c7||[]});fs[_0xcca2('0x67')](_0xcca2('0x68'),_0x4ef0ff);var _0x1e1327=ejs[_0xcca2('0x66')](_0x582ad,{'trunks':_0x59c7c7||[]});fs[_0xcca2('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x1e1327);return respondWithRpcPromise(_0xcca2('0x6b'),_0xcca2('0x2e'),{'module':_0xcca2('0x6c')});}return null;})['then'](function(_0x5e51e3){if(_0x5e51e3){return _0x2260f8;}})[_0xcca2('0x1a')](respondWithResult(_0x43c0ad,null))['catch'](handleError(_0x43c0ad,null));};exports[_0xcca2('0x6d')]=function(_0x3cbd88,_0x5bcd04,_0x4093a){var _0x19797c;return db[_0xcca2('0x35')]['find']({'where':{'id':_0x3cbd88[_0xcca2('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5bcd04,null))[_0xcca2('0x1a')](removeEntity(_0x5bcd04,null))[_0xcca2('0x1a')](function(){return db[_0xcca2('0x35')]['findAll']({'raw':!![]});})[_0xcca2('0x1a')](function(_0x1e7fa4){var _0x43a6b4=fs[_0xcca2('0x64')](path[_0xcca2('0x65')](config['root'],_0xcca2('0x62')),_0xcca2('0x63'));var _0x5dd8b3=fs[_0xcca2('0x64')](path[_0xcca2('0x65')](config[_0xcca2('0x61')],_0xcca2('0x6e')),_0xcca2('0x63'));var _0x35c1d4=ejs[_0xcca2('0x66')](_0x43a6b4,{'trunks':_0x1e7fa4});var _0x16b0a2=ejs[_0xcca2('0x66')](_0x5dd8b3,{'trunks':_0x1e7fa4});fs[_0xcca2('0x67')](_0xcca2('0x68'),_0x35c1d4);fs[_0xcca2('0x67')](_0xcca2('0x6a'),_0x16b0a2);return respondWithRpcPromise(_0xcca2('0x6b'),_0xcca2('0x6d'),{'module':'chan_sip.so'});})[_0xcca2('0x4c')](handleError(_0x5bcd04,null));}; \ No newline at end of file +var _0xea66=['map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','merge','VIRTUAL','filter','options','Trunk','findAll','rows','show','params','include','find','clone','includeAll','get','omit','createdAt','updatedAt','body','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','root','utf8','join','server/files/templates/registry.ejs','render','writeFileSync','registry','Reload','chan_sip.so','autoAssociation','server/files/templates/trunk.ejs','/etc/asterisk/sip_xcally_registers.conf','/etc/asterisk/sip_xcally_trunks.conf','html-pdf','rimraf','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','desk.js','../../components/auth/service','api','../../config/environment','../../mysqldb','jayson/promise','client','http','ValidationError','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','set','json','reject','save','update','destroy','Trunks','UserProfileResource','end','stack','name','send','index'];(function(_0x28a936,_0x28d74c){var _0xe9c2ff=function(_0x284d7c){while(--_0x284d7c){_0x28a936['push'](_0x28a936['shift']());}};_0xe9c2ff(++_0x28d74c);}(_0xea66,0x104));var _0x6ea6=function(_0xdaf736,_0xd8c667){_0xdaf736=_0xdaf736-0x0;var _0x1090b3=_0xea66[_0xdaf736];return _0x1090b3;};'use strict';var pdf=require(_0x6ea6('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6ea6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x6ea6('0x2'));var moment=require(_0x6ea6('0x3'));var BPromise=require(_0x6ea6('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ea6('0x5'));var sox=require(_0x6ea6('0x6'));var csv=require(_0x6ea6('0x7'));var ejs=require(_0x6ea6('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6ea6('0x9'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ea6('0xa'));var toCsv=require(_0x6ea6('0x7'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x6ea6('0xb'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6ea6('0xc'));var utils=require('../../config/utils');var config=require(_0x6ea6('0xd'));var db=require(_0x6ea6('0xe'))['db'];var jayson=require(_0x6ea6('0xf'));var client=jayson[_0x6ea6('0x10')][_0x6ea6('0x11')]({'port':0x232a});function checkPasswordPattern(_0x3fe4d2,_0x9e93cb,_0x6de6f6){if(_0x6de6f6){var _0x3c5d72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3c5d72['test'](_0x9e93cb)){return _0x3fe4d2;}else{throw new db['Sequelize'][(_0x6ea6('0x12'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3fe4d2;}}function respondWithRpcPromise(_0x109b8e,_0x15d7e0,_0x2ed670,_0x1ffaab){return new BPromise(function(_0x264f42,_0xcb2f2a){var _0x4d489e=_0x1ffaab||client;return _0x4d489e[_0x6ea6('0x13')](_0x109b8e,_0x2ed670)[_0x6ea6('0x14')](function(_0xcaeab){logger[_0x6ea6('0x15')](_0x6ea6('0x16'),_0x15d7e0,_0x6ea6('0x17'));logger['debug'](_0x6ea6('0x18'),_0x15d7e0,_0x6ea6('0x17'),JSON[_0x6ea6('0x19')](_0xcaeab));if(_0xcaeab['error']){if(_0xcaeab[_0x6ea6('0x1a')][_0x6ea6('0x1b')]===0x1f4){logger[_0x6ea6('0x1a')](_0x6ea6('0x16'),_0x15d7e0,_0xcaeab[_0x6ea6('0x1a')]['message']);return _0xcb2f2a(_0xcaeab[_0x6ea6('0x1a')][_0x6ea6('0x1c')]);}logger[_0x6ea6('0x1a')](_0x6ea6('0x16'),_0x15d7e0,_0xcaeab['error'][_0x6ea6('0x1c')]);return _0x264f42(_0xcaeab[_0x6ea6('0x1a')]['message']);}else{logger[_0x6ea6('0x15')](_0x6ea6('0x16'),_0x15d7e0,'request\x20sent');_0x264f42(_0xcaeab[_0x6ea6('0x1d')][_0x6ea6('0x1c')]);}})[_0x6ea6('0x1e')](function(_0x559262){logger[_0x6ea6('0x1a')]('Trunk,\x20%s,\x20%s',_0x15d7e0,_0x559262);_0xcb2f2a(_0x559262);});});}function respondWithStatusCode(_0x3d2c3b,_0x231675){_0x231675=_0x231675||0xcc;return function(_0x6d44b7){if(_0x6d44b7){return _0x3d2c3b[_0x6ea6('0x1f')](_0x231675);}return _0x3d2c3b['status'](_0x231675)['end']();};}function respondWithResult(_0x396903,_0x1374bb){_0x1374bb=_0x1374bb||0xc8;return function(_0x3e279a){if(_0x3e279a){return _0x396903[_0x6ea6('0x20')](_0x1374bb)['json'](_0x3e279a);}};}function respondWithFilteredResult(_0xd4cfc4,_0x4746c5){return function(_0x52092d){if(_0x52092d){var _0x2c438a=_0x52092d[_0x6ea6('0x21')],_0xffd846=_0x4746c5['offset'],_0x589058=_0x4746c5[_0x6ea6('0x22')]+_0x4746c5[_0x6ea6('0x23')],_0x372881;if(_0x589058>=_0x2c438a){_0x589058=_0x2c438a;_0x372881=0xc8;}else{_0x372881=0xce;}_0xd4cfc4[_0x6ea6('0x20')](_0x372881);return _0xd4cfc4[_0x6ea6('0x24')]('Content-Range',_0xffd846+'-'+_0x589058+'/'+_0x2c438a)[_0x6ea6('0x25')](_0x52092d);}return null;};}function patchUpdates(_0x429744){return function(_0x40f8bb){try{jsonpatch['apply'](_0x40f8bb,_0x429744,!![]);}catch(_0x1f8848){return BPromise[_0x6ea6('0x26')](_0x1f8848);}return _0x40f8bb[_0x6ea6('0x27')]();};}function saveUpdates(_0x30516a,_0x451109){return function(_0x48b4a5){if(_0x48b4a5){return _0x48b4a5[_0x6ea6('0x28')](_0x30516a)[_0x6ea6('0x14')](function(_0x54f38c){return _0x54f38c;});}return null;};}function removeEntity(_0x390990,_0x1907fe){return function(_0xd51f64){if(_0xd51f64){return _0xd51f64[_0x6ea6('0x29')]()[_0x6ea6('0x14')](function(){var _0x43333a=_0xd51f64['get']({'plain':!![]});var _0x231c66=_0x6ea6('0x2a');return db[_0x6ea6('0x2b')][_0x6ea6('0x29')]({'where':{'type':_0x231c66,'resourceId':_0x43333a['id']}})[_0x6ea6('0x14')](function(){return _0xd51f64;});})[_0x6ea6('0x14')](function(){_0x390990['status'](0xcc)[_0x6ea6('0x2c')]();});}};}function handleEntityNotFound(_0x5141a2,_0xecbc17){return function(_0x53ba1b){if(!_0x53ba1b){_0x5141a2['sendStatus'](0x194);}return _0x53ba1b;};}function handleError(_0x5d6ea0,_0x4cc4e9){_0x4cc4e9=_0x4cc4e9||0x1f4;return function(_0x3e587a){logger[_0x6ea6('0x1a')](_0x3e587a[_0x6ea6('0x2d')]);if(_0x3e587a['name']){delete _0x3e587a[_0x6ea6('0x2e')];}_0x5d6ea0[_0x6ea6('0x20')](_0x4cc4e9)[_0x6ea6('0x2f')](_0x3e587a);};}exports[_0x6ea6('0x30')]=function(_0x27ea87,_0x429af9){var _0x4933b7={},_0xce20d3={},_0x42f398={'count':0x0,'rows':[]};var _0x2d81b4=_[_0x6ea6('0x31')](db['Trunk'][_0x6ea6('0x32')],function(_0x3fdf55){return{'name':_0x3fdf55['fieldName'],'type':_0x3fdf55[_0x6ea6('0x33')][_0x6ea6('0x34')]};});_0xce20d3[_0x6ea6('0x35')]=_[_0x6ea6('0x31')](_0x2d81b4,_0x6ea6('0x2e'));_0xce20d3[_0x6ea6('0x36')]=_[_0x6ea6('0x37')](_0x27ea87[_0x6ea6('0x36')]);_0xce20d3[_0x6ea6('0x38')]=_['intersection'](_0xce20d3[_0x6ea6('0x35')],_0xce20d3[_0x6ea6('0x36')]);_0x4933b7[_0x6ea6('0x39')]=_[_0x6ea6('0x3a')](_0xce20d3['model'],qs['fields'](_0x27ea87[_0x6ea6('0x36')][_0x6ea6('0x3b')]));_0x4933b7['attributes']=_0x4933b7['attributes']['length']?_0x4933b7[_0x6ea6('0x39')]:_0xce20d3['model'];if(!_0x27ea87[_0x6ea6('0x36')][_0x6ea6('0x3c')]('nolimit')){_0x4933b7[_0x6ea6('0x23')]=qs[_0x6ea6('0x23')](_0x27ea87[_0x6ea6('0x36')][_0x6ea6('0x23')]);_0x4933b7[_0x6ea6('0x22')]=qs[_0x6ea6('0x22')](_0x27ea87[_0x6ea6('0x36')]['offset']);}_0x4933b7[_0x6ea6('0x3d')]=qs[_0x6ea6('0x3e')](_0x27ea87['query']['sort']);_0x4933b7[_0x6ea6('0x3f')]=qs[_0x6ea6('0x38')](_['pick'](_0x27ea87[_0x6ea6('0x36')],_0xce20d3[_0x6ea6('0x38')]));if(_0x27ea87[_0x6ea6('0x36')]['filter']){_0x4933b7[_0x6ea6('0x3f')]=_[_0x6ea6('0x40')](_0x4933b7['where'],{'$or':_[_0x6ea6('0x31')](_0x2d81b4,function(_0x53e440){if(_0x53e440['type']!==_0x6ea6('0x41')){var _0x239c4f={};_0x239c4f[_0x53e440[_0x6ea6('0x2e')]]={'$like':'%'+_0x27ea87[_0x6ea6('0x36')][_0x6ea6('0x42')]+'%'};return _0x239c4f;}})});}_0x4933b7=_[_0x6ea6('0x40')]({},_0x4933b7,_0x27ea87[_0x6ea6('0x43')]);var _0x1c35e0={'where':_0x4933b7[_0x6ea6('0x3f')]};return db['Trunk']['count'](_0x1c35e0)[_0x6ea6('0x14')](function(_0xb5304b){_0x42f398[_0x6ea6('0x21')]=_0xb5304b;if(_0x27ea87['query']['includeAll']){_0x4933b7['include']=[{'all':!![]}];}return db[_0x6ea6('0x44')][_0x6ea6('0x45')](_0x4933b7);})[_0x6ea6('0x14')](function(_0x57d133){_0x42f398[_0x6ea6('0x46')]=_0x57d133;return _0x42f398;})[_0x6ea6('0x14')](respondWithFilteredResult(_0x429af9,_0x4933b7))[_0x6ea6('0x1e')](handleError(_0x429af9,null));};exports[_0x6ea6('0x47')]=function(_0x36f08f,_0x59ab98){var _0x108e2a={'raw':![],'where':{'id':_0x36f08f[_0x6ea6('0x48')]['id']}},_0x2aa86f={};_0x2aa86f[_0x6ea6('0x35')]=_[_0x6ea6('0x37')](db[_0x6ea6('0x44')][_0x6ea6('0x32')]);_0x2aa86f['query']=_['keys'](_0x36f08f[_0x6ea6('0x36')]);_0x2aa86f[_0x6ea6('0x38')]=_[_0x6ea6('0x3a')](_0x2aa86f['model'],_0x2aa86f[_0x6ea6('0x36')]);_0x108e2a[_0x6ea6('0x39')]=_[_0x6ea6('0x3a')](_0x2aa86f[_0x6ea6('0x35')],qs[_0x6ea6('0x3b')](_0x36f08f[_0x6ea6('0x36')][_0x6ea6('0x3b')]));_0x108e2a['attributes']=_0x108e2a['attributes']['length']?_0x108e2a[_0x6ea6('0x39')]:_0x2aa86f[_0x6ea6('0x35')];if(_0x36f08f[_0x6ea6('0x36')]['includeAll']){_0x108e2a[_0x6ea6('0x49')]=[{'all':!![]}];}_0x108e2a=_[_0x6ea6('0x40')]({},_0x108e2a,_0x36f08f[_0x6ea6('0x43')]);return db[_0x6ea6('0x44')][_0x6ea6('0x4a')](_0x108e2a)[_0x6ea6('0x14')](handleEntityNotFound(_0x59ab98,null))[_0x6ea6('0x14')](respondWithResult(_0x59ab98,null))[_0x6ea6('0x1e')](handleError(_0x59ab98,null));};exports[_0x6ea6('0x4b')]=function(_0x3bac54,_0x56668a){var _0x110fd1={'where':{'id':_0x3bac54[_0x6ea6('0x48')]['id']}},_0x46a07c={};_0x46a07c[_0x6ea6('0x35')]=_[_0x6ea6('0x37')](db[_0x6ea6('0x44')][_0x6ea6('0x32')]);_0x110fd1[_0x6ea6('0x39')]=_['intersection'](_0x46a07c[_0x6ea6('0x35')],qs[_0x6ea6('0x3b')](_0x3bac54[_0x6ea6('0x36')]['fields']));_0x110fd1[_0x6ea6('0x39')]=_0x110fd1['attributes']['length']?_0x110fd1[_0x6ea6('0x39')]:_0x46a07c[_0x6ea6('0x35')];if(_0x3bac54[_0x6ea6('0x36')][_0x6ea6('0x4c')]){_0x110fd1[_0x6ea6('0x49')]=[{'all':!![]}];}_0x110fd1=_[_0x6ea6('0x40')]({},_0x110fd1,_0x3bac54[_0x6ea6('0x43')]);return db[_0x6ea6('0x44')][_0x6ea6('0x4a')](_0x110fd1)[_0x6ea6('0x14')](handleEntityNotFound(_0x56668a,null))[_0x6ea6('0x14')](function(_0x122c53){if(_0x122c53){var _0x2c92cb=_0x122c53[_0x6ea6('0x4d')]({'plain':!![]});_0x2c92cb=qs[_0x6ea6('0x4e')](_0x2c92cb,['id',_0x6ea6('0x4f'),_0x6ea6('0x50')]);_0x3bac54['body']=_[_0x6ea6('0x4e')](_0x3bac54[_0x6ea6('0x51')],['id',_0x6ea6('0x4f'),'updatedAt']);return db[_0x6ea6('0x44')][_0x6ea6('0x52')](_[_0x6ea6('0x40')](_0x2c92cb,_0x3bac54['body']),{'include':_0x3bac54[_0x6ea6('0x36')][_0x6ea6('0x4c')]?[{'all':!![]}]:undefined})[_0x6ea6('0x14')](function(_0xef611d){var _0x4a53ad=_0x3bac54['user'][_0x6ea6('0x4d')]({'plain':!![]});if(!_0x4a53ad)throw new Error(_0x6ea6('0x53'));if(_0x4a53ad[_0x6ea6('0x54')]===_0x6ea6('0x55')){var _0x2b8d0d=_0xef611d[_0x6ea6('0x4d')]({'plain':!![]});var _0x1e213f=_0x6ea6('0x2a');return db[_0x6ea6('0x56')]['find']({'where':{'name':_0x1e213f,'userProfileId':_0x4a53ad[_0x6ea6('0x57')]},'raw':!![]})[_0x6ea6('0x14')](function(_0x1e5c82){if(_0x1e5c82&&_0x1e5c82['autoAssociation']===0x0){return db[_0x6ea6('0x2b')][_0x6ea6('0x52')]({'name':_0x2b8d0d['name'],'resourceId':_0x2b8d0d['id'],'type':_0x1e5c82[_0x6ea6('0x2e')],'sectionId':_0x1e5c82['id']},{})[_0x6ea6('0x14')](function(){return _0xef611d;});}else{return _0xef611d;}})['catch'](function(_0x29f019){logger[_0x6ea6('0x1a')](_0x6ea6('0x58'),_0x29f019);throw _0x29f019;});}return _0xef611d;});}})['then'](respondWithResult(_0x56668a,0xc9))['catch'](handleError(_0x56668a,null));};exports[_0x6ea6('0x52')]=function(_0x4c1dbc,_0xa10669,_0x59f513){var _0x3dd9a2;return db[_0x6ea6('0x44')]['create'](_0x4c1dbc[_0x6ea6('0x51')],{'raw':!![]})[_0x6ea6('0x14')](function(_0x16c30c){_0x3dd9a2=_0x16c30c;return db[_0x6ea6('0x44')][_0x6ea6('0x45')]({'raw':!![]});})[_0x6ea6('0x14')](function(_0x5e554b){var _0x3f54e3=fs[_0x6ea6('0x59')](path['join'](config[_0x6ea6('0x5a')],'server/files/templates/trunk.ejs'),_0x6ea6('0x5b'));var _0x231b5e=fs[_0x6ea6('0x59')](path[_0x6ea6('0x5c')](config[_0x6ea6('0x5a')],_0x6ea6('0x5d')),_0x6ea6('0x5b'));var _0x40e39e=ejs[_0x6ea6('0x5e')](_0x3f54e3,{'trunks':_0x5e554b||[]});fs[_0x6ea6('0x5f')]('/etc/asterisk/sip_xcally_trunks.conf',_0x40e39e);if(_0x3dd9a2[_0x6ea6('0x60')]){var _0x50a140=ejs[_0x6ea6('0x5e')](_0x231b5e,{'trunks':_0x5e554b||[]});fs[_0x6ea6('0x5f')]('/etc/asterisk/sip_xcally_registers.conf',_0x50a140);}})[_0x6ea6('0x14')](function(){return respondWithRpcPromise(_0x6ea6('0x61'),_0x6ea6('0x52'),{'module':_0x6ea6('0x62')});})[_0x6ea6('0x14')](function(){var _0x49f1f9=_0x4c1dbc[_0x6ea6('0x55')][_0x6ea6('0x4d')]({'plain':!![]});if(!_0x49f1f9)throw new Error(_0x6ea6('0x53'));if(_0x49f1f9[_0x6ea6('0x54')]==='user'){var _0x1027c7=_0x3dd9a2[_0x6ea6('0x4d')]({'plain':!![]});return db[_0x6ea6('0x56')][_0x6ea6('0x4a')]({'where':{'name':'Trunks','userProfileId':_0x49f1f9[_0x6ea6('0x57')]},'raw':!![]})[_0x6ea6('0x14')](function(_0x1c45d5){if(_0x1c45d5&&_0x1c45d5[_0x6ea6('0x63')]===0x0){return db['UserProfileResource'][_0x6ea6('0x52')]({'name':_0x1027c7[_0x6ea6('0x2e')],'resourceId':_0x1027c7['id'],'type':_0x1c45d5[_0x6ea6('0x2e')],'sectionId':_0x1c45d5['id']},{})[_0x6ea6('0x14')](function(){return _0x3dd9a2;});}else{return _0x3dd9a2;}})[_0x6ea6('0x1e')](function(_0x3f1c45){logger[_0x6ea6('0x1a')](_0x6ea6('0x58'),_0x3f1c45);throw _0x3f1c45;});}return _0x3dd9a2;})[_0x6ea6('0x14')](respondWithResult(_0xa10669,0xc9))[_0x6ea6('0x1e')](handleError(_0xa10669,null));};exports['update']=function(_0x4ee396,_0x36c6a7,_0x5958d2){var _0x5bea5e;return db[_0x6ea6('0x44')]['find']({'where':{'id':_0x4ee396[_0x6ea6('0x48')]['id']}})[_0x6ea6('0x14')](handleEntityNotFound(_0x36c6a7,null))['then'](saveUpdates(_0x4ee396['body'],null))[_0x6ea6('0x14')](function(_0xe4d5aa){if(_0xe4d5aa){_0x5bea5e=_0xe4d5aa;return db[_0x6ea6('0x44')]['findAll']({'raw':!![]});}})[_0x6ea6('0x14')](function(_0x32a649){if(_0x32a649){var _0x3b1cfe=fs[_0x6ea6('0x59')](path[_0x6ea6('0x5c')](config[_0x6ea6('0x5a')],_0x6ea6('0x64')),_0x6ea6('0x5b'));var _0x1eedff=fs['readFileSync'](path['join'](config[_0x6ea6('0x5a')],_0x6ea6('0x5d')),'utf8');var _0x369f6b=ejs['render'](_0x3b1cfe,{'trunks':_0x32a649||[]});fs[_0x6ea6('0x5f')]('/etc/asterisk/sip_xcally_trunks.conf',_0x369f6b);var _0x1eb32f=ejs['render'](_0x1eedff,{'trunks':_0x32a649||[]});fs['writeFileSync'](_0x6ea6('0x65'),_0x1eb32f);return respondWithRpcPromise(_0x6ea6('0x61'),_0x6ea6('0x28'),{'module':'chan_sip.so'});}return null;})[_0x6ea6('0x14')](function(_0x2ac416){if(_0x2ac416){return _0x5bea5e;}})[_0x6ea6('0x14')](respondWithResult(_0x36c6a7,null))[_0x6ea6('0x1e')](handleError(_0x36c6a7,null));};exports[_0x6ea6('0x29')]=function(_0x23d851,_0x49c11b,_0x6f2c53){var _0x366faf;return db[_0x6ea6('0x44')][_0x6ea6('0x4a')]({'where':{'id':_0x23d851[_0x6ea6('0x48')]['id']}})['then'](handleEntityNotFound(_0x49c11b,null))['then'](removeEntity(_0x49c11b,null))[_0x6ea6('0x14')](function(){return db[_0x6ea6('0x44')]['findAll']({'raw':!![]});})[_0x6ea6('0x14')](function(_0x44fd01){var _0x2c5a4e=fs['readFileSync'](path['join'](config['root'],_0x6ea6('0x64')),_0x6ea6('0x5b'));var _0x10fe6c=fs['readFileSync'](path[_0x6ea6('0x5c')](config['root'],_0x6ea6('0x5d')),_0x6ea6('0x5b'));var _0x17d673=ejs[_0x6ea6('0x5e')](_0x2c5a4e,{'trunks':_0x44fd01});var _0x2b91b5=ejs[_0x6ea6('0x5e')](_0x10fe6c,{'trunks':_0x44fd01});fs[_0x6ea6('0x5f')](_0x6ea6('0x66'),_0x17d673);fs['writeFileSync'](_0x6ea6('0x65'),_0x2b91b5);return respondWithRpcPromise(_0x6ea6('0x61'),_0x6ea6('0x29'),{'module':_0x6ea6('0x62')});})[_0x6ea6('0x1e')](handleError(_0x49c11b,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index f457c53..7490032 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 _0xfb4d=['tools_trunks','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./trunk.attributes','define','Trunk'];(function(_0x15ce21,_0x458092){var _0x23a3ab=function(_0xea9e4f){while(--_0xea9e4f){_0x15ce21['push'](_0x15ce21['shift']());}};_0x23a3ab(++_0x458092);}(_0xfb4d,0xf1));var _0xdfb4=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xfb4d[_0x2ec461];return _0x28603d;};'use strict';var _=require(_0xdfb4('0x0'));var util=require(_0xdfb4('0x1'));var logger=require(_0xdfb4('0x2'))('api');var moment=require(_0xdfb4('0x3'));var BPromise=require(_0xdfb4('0x4'));var rp=require(_0xdfb4('0x5'));var fs=require('fs');var path=require(_0xdfb4('0x6'));var rimraf=require('rimraf');var config=require(_0xdfb4('0x7'));var attributes=require(_0xdfb4('0x8'));module['exports']=function(_0x4ac63e,_0x387646){return _0x4ac63e[_0xdfb4('0x9')](_0xdfb4('0xa'),attributes,{'tableName':_0xdfb4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7eec=['util','bluebird','request-promise','path','../../config/environment','./trunk.attributes','exports','define','Trunk','tools_trunks','lodash'];(function(_0x4ca88f,_0xbd5b23){var _0x4bd853=function(_0xac771f){while(--_0xac771f){_0x4ca88f['push'](_0x4ca88f['shift']());}};_0x4bd853(++_0xbd5b23);}(_0x7eec,0x149));var _0xc7ee=function(_0x5d4cab,_0x458055){_0x5d4cab=_0x5d4cab-0x0;var _0x47cc33=_0x7eec[_0x5d4cab];return _0x47cc33;};'use strict';var _=require(_0xc7ee('0x0'));var util=require(_0xc7ee('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc7ee('0x2'));var rp=require(_0xc7ee('0x3'));var fs=require('fs');var path=require(_0xc7ee('0x4'));var rimraf=require('rimraf');var config=require(_0xc7ee('0x5'));var attributes=require(_0xc7ee('0x6'));module[_0xc7ee('0x7')]=function(_0x370802,_0x169f5a){return _0x370802[_0xc7ee('0x8')](_0xc7ee('0x9'),attributes,{'tableName':_0xc7ee('0xa'),'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 360c950..eff1d37 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 _0x8603=['result','catch','GetTrunk','Trunk','findAll','options','raw','where','attributes','limit','include','map','model','stringify','ShowTrunk','debug','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x41a187,_0x34c447){var _0x311538=function(_0x19aaaf){while(--_0x19aaaf){_0x41a187['push'](_0x41a187['shift']());}};_0x311538(++_0x34c447);}(_0x8603,0x190));var _0x3860=function(_0x286595,_0x29f350){_0x286595=_0x286595-0x0;var _0x3ea6b8=_0x8603[_0x286595];return _0x3ea6b8;};'use strict';var _=require('lodash');var util=require(_0x3860('0x0'));var moment=require(_0x3860('0x1'));var BPromise=require(_0x3860('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3860('0x3'))['db'];var utils=require(_0x3860('0x4'));var logger=require(_0x3860('0x5'))('rpc');var config=require(_0x3860('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3860('0x7')][_0x3860('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1eca44,_0xd3ce26,_0x472bf2){return new BPromise(function(_0x4aba10,_0x5c7350){return client['request'](_0x1eca44,_0x472bf2)[_0x3860('0x9')](function(_0x441dc4){logger['info'](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));logger['debug'](_0x3860('0xc'),_0xd3ce26,_0x3860('0xb'),JSON['stringify'](_0x441dc4));if(_0x441dc4[_0x3860('0xd')]){if(_0x441dc4[_0x3860('0xd')]['code']===0x1f4){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x5c7350(_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);}logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x441dc4[_0x3860('0xd')][_0x3860('0xe')]);return _0x4aba10(_0x441dc4['error'][_0x3860('0xe')]);}else{logger[_0x3860('0xf')](_0x3860('0xa'),_0xd3ce26,_0x3860('0xb'));_0x4aba10(_0x441dc4[_0x3860('0x10')][_0x3860('0xe')]);}})[_0x3860('0x11')](function(_0x378305){logger[_0x3860('0xd')](_0x3860('0xa'),_0xd3ce26,_0x378305);_0x5c7350(_0x378305);});});}exports[_0x3860('0x12')]=function(_0x45b799){var _0x4b6b15=this;return new Promise(function(_0x4863bd,_0x373b06){return db[_0x3860('0x13')][_0x3860('0x14')]({'raw':_0x45b799['options']?_0x45b799[_0x3860('0x15')][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x17')]||null:null,'attributes':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x18')]||null:null,'limit':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x19')]||null:null,'include':_0x45b799[_0x3860('0x15')]?_0x45b799[_0x3860('0x15')][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x45b799['options'][_0x3860('0x1a')],function(_0x133093){return{'model':db[_0x133093[_0x3860('0x1c')]],'as':_0x133093['as'],'attributes':_0x133093[_0x3860('0x18')],'include':_0x133093[_0x3860('0x1a')]?_['map'](_0x133093[_0x3860('0x1a')],function(_0x568515){return{'model':db[_0x568515['model']],'as':_0x568515['as'],'attributes':_0x568515[_0x3860('0x18')],'include':_0x568515[_0x3860('0x1a')]?_['map'](_0x568515['include'],function(_0x5f42d5){return{'model':db[_0x5f42d5[_0x3860('0x1c')]],'as':_0x5f42d5['as'],'attributes':_0x5f42d5[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x371f3a){logger[_0x3860('0xf')](_0x3860('0x12'),_0x45b799);logger['debug']('GetTrunk',_0x45b799,JSON[_0x3860('0x1d')](_0x371f3a));_0x4863bd(_0x371f3a);})[_0x3860('0x11')](function(_0x5a9af2){logger[_0x3860('0xd')](_0x3860('0x12'),_0x5a9af2[_0x3860('0xe')],_0x45b799);_0x373b06(_0x4b6b15[_0x3860('0xd')](0x1f4,_0x5a9af2[_0x3860('0xe')]));});});};exports['ShowTrunk']=function(_0x36ae2b){var _0xf624ba=this;return new Promise(function(_0x367b14,_0x4bd90c){return db[_0x3860('0x13')]['find']({'raw':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x16')]===undefined?!![]:![]:!![],'where':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['where']||null:null,'attributes':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b[_0x3860('0x15')]['attributes']||null:null,'include':_0x36ae2b[_0x3860('0x15')]?_0x36ae2b['options'][_0x3860('0x1a')]?_[_0x3860('0x1b')](_0x36ae2b[_0x3860('0x15')][_0x3860('0x1a')],function(_0x30dc2a){return{'model':db[_0x30dc2a[_0x3860('0x1c')]],'as':_0x30dc2a['as'],'attributes':_0x30dc2a[_0x3860('0x18')],'include':_0x30dc2a['include']?_[_0x3860('0x1b')](_0x30dc2a[_0x3860('0x1a')],function(_0x4d62e9){return{'model':db[_0x4d62e9[_0x3860('0x1c')]],'as':_0x4d62e9['as'],'attributes':_0x4d62e9[_0x3860('0x18')],'include':_0x4d62e9[_0x3860('0x1a')]?_['map'](_0x4d62e9['include'],function(_0x285b1b){return{'model':db[_0x285b1b[_0x3860('0x1c')]],'as':_0x285b1b['as'],'attributes':_0x285b1b[_0x3860('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3860('0x9')](function(_0x59271f){logger['info'](_0x3860('0x1e'),_0x36ae2b);logger[_0x3860('0x1f')](_0x3860('0x1e'),_0x36ae2b,JSON[_0x3860('0x1d')](_0x59271f));_0x367b14(_0x59271f);})[_0x3860('0x11')](function(_0x4df2a9){logger[_0x3860('0xd')](_0x3860('0x1e'),_0x4df2a9['message'],_0x36ae2b);_0x4bd90c(_0xf624ba['error'](0x1f4,_0x4df2a9[_0x3860('0xe')]));});});}; \ No newline at end of file +var _0x757a=['stringify','error','message','result','catch','GetTrunk','Trunk','findAll','options','where','attributes','limit','include','map','model','ShowTrunk','find','raw','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s'];(function(_0x24e762,_0x515162){var _0x23c11e=function(_0x67be58){while(--_0x67be58){_0x24e762['push'](_0x24e762['shift']());}};_0x23c11e(++_0x515162);}(_0x757a,0xde));var _0xa757=function(_0x515466,_0x554c6b){_0x515466=_0x515466-0x0;var _0x45b900=_0x757a[_0x515466];return _0x45b900;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var moment=require(_0xa757('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa757('0x2'))['db'];var utils=require(_0xa757('0x3'));var logger=require(_0xa757('0x4'))(_0xa757('0x5'));var config=require(_0xa757('0x6'));var jayson=require(_0xa757('0x7'));var client=jayson['client'][_0xa757('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4343b6,_0x53be0e,_0x2930fa){return new BPromise(function(_0x2f7793,_0x447344){return client[_0xa757('0x9')](_0x4343b6,_0x2930fa)[_0xa757('0xa')](function(_0x5aef8a){logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));logger[_0xa757('0xe')](_0xa757('0xf'),_0x53be0e,_0xa757('0xd'),JSON[_0xa757('0x10')](_0x5aef8a));if(_0x5aef8a['error']){if(_0x5aef8a['error']['code']===0x1f4){logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')]['message']);return _0x447344(_0x5aef8a['error'][_0xa757('0x12')]);}logger['error']('Trunk,\x20%s,\x20%s',_0x53be0e,_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);return _0x2f7793(_0x5aef8a[_0xa757('0x11')][_0xa757('0x12')]);}else{logger[_0xa757('0xb')](_0xa757('0xc'),_0x53be0e,_0xa757('0xd'));_0x2f7793(_0x5aef8a[_0xa757('0x13')][_0xa757('0x12')]);}})[_0xa757('0x14')](function(_0x50aac1){logger[_0xa757('0x11')](_0xa757('0xc'),_0x53be0e,_0x50aac1);_0x447344(_0x50aac1);});});}exports[_0xa757('0x15')]=function(_0x4d9f58){var _0x54b305=this;return new Promise(function(_0x151c04,_0x468d45){return db[_0xa757('0x16')][_0xa757('0x17')]({'raw':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58['options'][_0xa757('0x19')]||null:null,'attributes':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'limit':_0x4d9f58['options']?_0x4d9f58['options'][_0xa757('0x1b')]||null:null,'include':_0x4d9f58[_0xa757('0x18')]?_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x4d9f58[_0xa757('0x18')][_0xa757('0x1c')],function(_0x21f1af){return{'model':db[_0x21f1af[_0xa757('0x1e')]],'as':_0x21f1af['as'],'attributes':_0x21f1af['attributes'],'include':_0x21f1af[_0xa757('0x1c')]?_['map'](_0x21f1af[_0xa757('0x1c')],function(_0x47903b){return{'model':db[_0x47903b[_0xa757('0x1e')]],'as':_0x47903b['as'],'attributes':_0x47903b[_0xa757('0x1a')],'include':_0x47903b[_0xa757('0x1c')]?_['map'](_0x47903b[_0xa757('0x1c')],function(_0xcd98bd){return{'model':db[_0xcd98bd[_0xa757('0x1e')]],'as':_0xcd98bd['as'],'attributes':_0xcd98bd[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x449a7d){logger['info']('GetTrunk',_0x4d9f58);logger['debug']('GetTrunk',_0x4d9f58,JSON[_0xa757('0x10')](_0x449a7d));_0x151c04(_0x449a7d);})['catch'](function(_0x2208f9){logger[_0xa757('0x11')]('GetTrunk',_0x2208f9[_0xa757('0x12')],_0x4d9f58);_0x468d45(_0x54b305['error'](0x1f4,_0x2208f9[_0xa757('0x12')]));});});};exports[_0xa757('0x1f')]=function(_0x5307c3){var _0x235e54=this;return new Promise(function(_0x5ade7b,_0x3a4a66){return db[_0xa757('0x16')][_0xa757('0x20')]({'raw':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x21')]===undefined?!![]:![]:!![],'where':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x19')]||null:null,'attributes':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1a')]||null:null,'include':_0x5307c3[_0xa757('0x18')]?_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x5307c3[_0xa757('0x18')][_0xa757('0x1c')],function(_0x1eacde){return{'model':db[_0x1eacde[_0xa757('0x1e')]],'as':_0x1eacde['as'],'attributes':_0x1eacde[_0xa757('0x1a')],'include':_0x1eacde[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x1eacde[_0xa757('0x1c')],function(_0x59700d){return{'model':db[_0x59700d[_0xa757('0x1e')]],'as':_0x59700d['as'],'attributes':_0x59700d[_0xa757('0x1a')],'include':_0x59700d[_0xa757('0x1c')]?_[_0xa757('0x1d')](_0x59700d[_0xa757('0x1c')],function(_0x51e2aa){return{'model':db[_0x51e2aa[_0xa757('0x1e')]],'as':_0x51e2aa['as'],'attributes':_0x51e2aa[_0xa757('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa757('0xa')](function(_0x2c34b1){logger[_0xa757('0xb')](_0xa757('0x1f'),_0x5307c3);logger['debug'](_0xa757('0x1f'),_0x5307c3,JSON[_0xa757('0x10')](_0x2c34b1));_0x5ade7b(_0x2c34b1);})[_0xa757('0x14')](function(_0xc34409){logger[_0xa757('0x11')](_0xa757('0x1f'),_0xc34409[_0xa757('0x12')],_0x5307c3);_0x3a4a66(_0x235e54[_0xa757('0x11')](0x1f4,_0xc34409[_0xa757('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 05aac24..3ac8491 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 _0xadb5=['/:id/openchannel/interactions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getFaxInteractions','/:id/teams','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','/:id/fax_accounts','/:id/mail_accounts','getMailAccounts','/:id/openchannel_accounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/scheduled_calls','getScheduledCalls','post','/create_many','bulkCreate','addContacts','addQueues','diskStorage','join','root','server/files/images/','format','now','single','addAvatar','/:id/logout','/:id/pause','pause','addTeams','/:id/chat_interactions','addChatInteractions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','addOpenchannelAccounts','addChatWebsites','addSquareProjects','/:id/api_key','createApiKey','put','update','removeQueues','delete','removeChatInteractions','/:id/mail_interactions','removeMailInteractions','removeFaxInteractions','/:id/openchannel_interactions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeApiKey','exports','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./user.controller','isAuthenticated','index','get','/describe','describe','/whoami','whoami','/:id','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','getRecordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions'];(function(_0x2cbfd3,_0x142870){var _0x3f1087=function(_0x163cb9){while(--_0x163cb9){_0x2cbfd3['push'](_0x2cbfd3['shift']());}};_0x3f1087(++_0x142870);}(_0xadb5,0xad));var _0x5adb=function(_0x40299d,_0x3630e7){_0x40299d=_0x40299d-0x0;var _0x34892e=_0xadb5[_0x40299d];return _0x34892e;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0x9')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router['get']('/:id/avatar',controller[_0x5adb('0x10')]);router[_0x5adb('0x9')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x12')]);router['get'](_0x5adb('0x13'),auth['isAuthenticated'](),controller[_0x5adb('0x14')]);router[_0x5adb('0x9')](_0x5adb('0x15'),auth['isAuthenticated'](),controller[_0x5adb('0x16')]);router[_0x5adb('0x9')](_0x5adb('0x17'),auth['isAuthenticated'](),controller[_0x5adb('0x18')]);router['get'](_0x5adb('0x19'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1a')]);router[_0x5adb('0x9')](_0x5adb('0x1b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x1c')]);router[_0x5adb('0x9')](_0x5adb('0x1d'),auth['isAuthenticated'](),controller[_0x5adb('0x1e')]);router['get'](_0x5adb('0x1f'),auth['isAuthenticated'](),controller[_0x5adb('0x20')]);router['get']('/:id/mail/interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x21')]);router[_0x5adb('0x9')](_0x5adb('0x22'),auth[_0x5adb('0x7')](),controller['getSmsInteractions']);router[_0x5adb('0x9')]('/:id/fax/interactions',auth['isAuthenticated'](),controller[_0x5adb('0x23')]);router[_0x5adb('0x9')](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x25')]);router[_0x5adb('0x9')](_0x5adb('0x26'),auth['isAuthenticated'](),controller[_0x5adb('0x27')]);router[_0x5adb('0x9')](_0x5adb('0x28'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x29')]);router['get'](_0x5adb('0x2a'),auth[_0x5adb('0x7')](),controller['getVoicePrefixes']);router[_0x5adb('0x9')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller['getFaxAccounts']);router[_0x5adb('0x9')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x2d')]);router[_0x5adb('0x9')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller['getOpenchannelAccounts']);router['get'](_0x5adb('0x2f'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x30')]);router[_0x5adb('0x9')](_0x5adb('0x31'),auth['isAuthenticated'](),controller[_0x5adb('0x32')]);router[_0x5adb('0x9')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x34')]);router[_0x5adb('0x9')](_0x5adb('0x35'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x36')]);router[_0x5adb('0x9')]('/:id/api_key',auth[_0x5adb('0x7')](),controller['getApiKey']);router[_0x5adb('0x37')](_0x5adb('0x38'),auth['isAuthenticated'](),controller[_0x5adb('0x39')]);router[_0x5adb('0x37')](_0x5adb('0x11'),auth['isAuthenticated'](),controller[_0x5adb('0x3a')]);router[_0x5adb('0x37')]('/',auth['isAuthenticated'](),controller['create']);router[_0x5adb('0x37')]('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x3b')]);var upload=multer({'storage':multer[_0x5adb('0x3c')]({'destination':function(_0x2da912,_0x9bdece,_0x5ece39){_0x5ece39(null,path[_0x5adb('0x3d')](config[_0x5adb('0x3e')],_0x5adb('0x3f')));},'filename':function(_0x54851b,_0x4c8870,_0x32eb69){_0x32eb69(null,util[_0x5adb('0x40')]('%s-%s',Date[_0x5adb('0x41')](),_0x4c8870['originalname']));}})});router[_0x5adb('0x37')]('/:id/avatar',upload[_0x5adb('0x42')]('file'),controller[_0x5adb('0x43')]);router[_0x5adb('0x37')]('/:id/login',auth[_0x5adb('0x7')](),controller['login']);router[_0x5adb('0x37')](_0x5adb('0x44'),auth[_0x5adb('0x7')](),controller['logout']);router[_0x5adb('0x37')](_0x5adb('0x45'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x46')]);router[_0x5adb('0x37')]('/:id/unpause',auth['isAuthenticated'](),controller['unpause']);router['post'](_0x5adb('0x24'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x47')]);router[_0x5adb('0x37')](_0x5adb('0x48'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x49')]);router[_0x5adb('0x37')]('/:id/mail_interactions',auth['isAuthenticated'](),controller[_0x5adb('0x4a')]);router['post'](_0x5adb('0x4b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x4c')]);router[_0x5adb('0x37')](_0x5adb('0x4d'),auth['isAuthenticated'](),controller[_0x5adb('0x4e')]);router[_0x5adb('0x37')]('/:id/openchannel_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x4f')]);router['post'](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x50')]);router[_0x5adb('0x37')](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x51')]);router['post']('/:id/openchannel_accounts',auth[_0x5adb('0x7')](),controller[_0x5adb('0x52')]);router[_0x5adb('0x37')](_0x5adb('0x2f'),auth['isAuthenticated'](),controller['addSmsAccounts']);router[_0x5adb('0x37')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x53')]);router[_0x5adb('0x37')]('/:id/square_projects',auth[_0x5adb('0x7')](),controller[_0x5adb('0x54')]);router['post'](_0x5adb('0x55'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x56')]);router[_0x5adb('0x57')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x58')]);router[_0x5adb('0x57')]('/:id/password',auth[_0x5adb('0x7')](),controller['changePassword']);router['delete']('/:id/queues',auth[_0x5adb('0x7')](),controller[_0x5adb('0x59')]);router[_0x5adb('0x5a')]('/:id/teams',auth[_0x5adb('0x7')](),controller['removeTeams']);router[_0x5adb('0x5a')](_0x5adb('0xe'),auth[_0x5adb('0x7')](),controller['destroy']);router[_0x5adb('0x5a')]('/:id/chat_interactions',auth[_0x5adb('0x7')](),controller[_0x5adb('0x5b')]);router['delete'](_0x5adb('0x5c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x5d')]);router[_0x5adb('0x5a')](_0x5adb('0x4b'),auth['isAuthenticated'](),controller[_0x5adb('0x5e')]);router[_0x5adb('0x5a')](_0x5adb('0x4d'),auth[_0x5adb('0x7')](),controller['removeSmsInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x5f'),auth[_0x5adb('0x7')](),controller['removeOpenchannelInteractions']);router[_0x5adb('0x5a')](_0x5adb('0x2b'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x60')]);router['delete'](_0x5adb('0x2c'),auth[_0x5adb('0x7')](),controller[_0x5adb('0x61')]);router[_0x5adb('0x5a')](_0x5adb('0x2e'),auth['isAuthenticated'](),controller[_0x5adb('0x62')]);router['delete'](_0x5adb('0x2f'),auth['isAuthenticated'](),controller[_0x5adb('0x63')]);router[_0x5adb('0x5a')](_0x5adb('0x31'),auth[_0x5adb('0x7')](),controller['removeChatWebsites']);router[_0x5adb('0x5a')](_0x5adb('0x33'),auth[_0x5adb('0x7')](),controller['removeSquareProjects']);router['delete']('/:id/api_key',auth[_0x5adb('0x7')](),controller[_0x5adb('0x64')]);module[_0x5adb('0x65')]=router; \ No newline at end of file +var _0x2ef3=['getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','getVoiceQueuesRt','/:id/groups','getGroups','/:id/screen_recordings','/:id/chat/interactions','getChatInteractions','/:id/openchannel/interactions','/:id/mail/interactions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','/:id/teams','/:id/lists','getLists','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','getChatWebsites','/:id/square_projects','getSquareProjects','/:id/api_key','getApiKey','post','/create_many','bulkCreate','create','join','now','originalname','single','file','addAvatar','/:id/login','login','/:id/logout','logout','/:id/pause','pause','/:id/unpause','unpause','/:id/chat_interactions','addChatInteractions','/:id/mail_interactions','/:id/fax_interactions','addFaxInteractions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addMailAccounts','/:id/chat_websites','addChatWebsites','createApiKey','put','update','/:id/password','changePassword','delete','removeQueues','removeTeams','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','/:id/sms_interactions','removeSmsInteractions','removeOpenchannelInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','/whoami','whoami','/:id','/:id/avatar'];(function(_0x543b0c,_0xd49aa3){var _0xce9fe1=function(_0x96b995){while(--_0x96b995){_0x543b0c['push'](_0x543b0c['shift']());}};_0xce9fe1(++_0xd49aa3);}(_0x2ef3,0xba));var _0x32ef=function(_0x45e4dd,_0x4caa0f){_0x45e4dd=_0x45e4dd-0x0;var _0x2e406b=_0x2ef3[_0x45e4dd];return _0x2e406b;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./user.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0x8')](_0x32ef('0xc'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0x8')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller['show']);router['get'](_0x32ef('0xf'),controller[_0x32ef('0x10')]);router[_0x32ef('0x8')](_0x32ef('0x11'),auth['isAuthenticated'](),controller[_0x32ef('0x12')]);router['get'](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x14')]);router[_0x32ef('0x8')]('/:id/queues_rt',auth['isAuthenticated'](),controller[_0x32ef('0x15')]);router['get'](_0x32ef('0x16'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x17')]);router[_0x32ef('0x8')]('/:id/recordings',auth['isAuthenticated'](),controller['getRecordings']);router[_0x32ef('0x8')](_0x32ef('0x18'),auth[_0x32ef('0x9')](),controller['getScreenRecordings']);router['get'](_0x32ef('0x19'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1a')]);router['get'](_0x32ef('0x1b'),auth[_0x32ef('0x9')](),controller['getOpenchannelInteractions']);router[_0x32ef('0x8')](_0x32ef('0x1c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x1d')]);router[_0x32ef('0x8')](_0x32ef('0x1e'),auth['isAuthenticated'](),controller[_0x32ef('0x1f')]);router['get'](_0x32ef('0x20'),auth[_0x32ef('0x9')](),controller['getFaxInteractions']);router[_0x32ef('0x8')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['getTeams']);router['get'](_0x32ef('0x22'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x23')]);router['get']('/:id/agents',auth[_0x32ef('0x9')](),controller['getAgents']);router['get'](_0x32ef('0x24'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x25')]);router[_0x32ef('0x8')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x27')]);router[_0x32ef('0x8')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x29')]);router[_0x32ef('0x8')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2a')]);router['get'](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2c')]);router[_0x32ef('0x8')]('/:id/chat_websites',auth[_0x32ef('0x9')](),controller[_0x32ef('0x2d')]);router[_0x32ef('0x8')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x2f')]);router[_0x32ef('0x8')]('/:id/scheduled_calls',auth[_0x32ef('0x9')](),controller['getScheduledCalls']);router[_0x32ef('0x8')](_0x32ef('0x30'),auth['isAuthenticated'](),controller[_0x32ef('0x31')]);router[_0x32ef('0x32')](_0x32ef('0x33'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x34')]);router['post']('/:id/contacts',auth[_0x32ef('0x9')](),controller['addContacts']);router[_0x32ef('0x32')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0x35')]);router[_0x32ef('0x32')](_0x32ef('0x13'),auth[_0x32ef('0x9')](),controller['addQueues']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x484ad7,_0x2261a6,_0x3c4651){_0x3c4651(null,path[_0x32ef('0x36')](config['root'],'server/files/images/'));},'filename':function(_0x1c3633,_0x2bd8a9,_0x410334){_0x410334(null,util['format']('%s-%s',Date[_0x32ef('0x37')](),_0x2bd8a9[_0x32ef('0x38')]));}})});router[_0x32ef('0x32')](_0x32ef('0xf'),upload[_0x32ef('0x39')](_0x32ef('0x3a')),controller[_0x32ef('0x3b')]);router[_0x32ef('0x32')](_0x32ef('0x3c'),auth['isAuthenticated'](),controller[_0x32ef('0x3d')]);router[_0x32ef('0x32')](_0x32ef('0x3e'),auth['isAuthenticated'](),controller[_0x32ef('0x3f')]);router[_0x32ef('0x32')](_0x32ef('0x40'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x41')]);router[_0x32ef('0x32')](_0x32ef('0x42'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x43')]);router[_0x32ef('0x32')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller['addTeams']);router[_0x32ef('0x32')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x45')]);router[_0x32ef('0x32')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller['addMailInteractions']);router['post'](_0x32ef('0x47'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x48')]);router[_0x32ef('0x32')]('/:id/sms_interactions',auth[_0x32ef('0x9')](),controller[_0x32ef('0x49')]);router['post'](_0x32ef('0x4a'),auth['isAuthenticated'](),controller[_0x32ef('0x4b')]);router[_0x32ef('0x32')](_0x32ef('0x26'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4c')]);router[_0x32ef('0x32')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4d')]);router[_0x32ef('0x32')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller['addOpenchannelAccounts']);router[_0x32ef('0x32')](_0x32ef('0x2b'),auth[_0x32ef('0x9')](),controller['addSmsAccounts']);router[_0x32ef('0x32')](_0x32ef('0x4e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x4f')]);router[_0x32ef('0x32')](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller['addSquareProjects']);router['post'](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x50')]);router[_0x32ef('0x51')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x52')]);router[_0x32ef('0x51')](_0x32ef('0x53'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x54')]);router[_0x32ef('0x55')](_0x32ef('0x13'),auth['isAuthenticated'](),controller[_0x32ef('0x56')]);router[_0x32ef('0x55')](_0x32ef('0x21'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x57')]);router[_0x32ef('0x55')](_0x32ef('0xe'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x58')]);router[_0x32ef('0x55')](_0x32ef('0x44'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x59')]);router[_0x32ef('0x55')](_0x32ef('0x46'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5a')]);router[_0x32ef('0x55')]('/:id/fax_interactions',auth['isAuthenticated'](),controller[_0x32ef('0x5b')]);router[_0x32ef('0x55')](_0x32ef('0x5c'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5d')]);router[_0x32ef('0x55')](_0x32ef('0x4a'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x5e')]);router[_0x32ef('0x55')](_0x32ef('0x26'),auth['isAuthenticated'](),controller[_0x32ef('0x5f')]);router[_0x32ef('0x55')](_0x32ef('0x28'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x60')]);router[_0x32ef('0x55')]('/:id/openchannel_accounts',auth[_0x32ef('0x9')](),controller[_0x32ef('0x61')]);router[_0x32ef('0x55')]('/:id/sms_accounts',auth[_0x32ef('0x9')](),controller['removeSmsAccounts']);router[_0x32ef('0x55')](_0x32ef('0x4e'),auth['isAuthenticated'](),controller[_0x32ef('0x62')]);router['delete'](_0x32ef('0x2e'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x63')]);router[_0x32ef('0x55')](_0x32ef('0x30'),auth[_0x32ef('0x9')](),controller[_0x32ef('0x64')]);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 5291a3f..e2a1fc4 100644 --- a/server/api/user/user.attributes.js +++ b/server/api/user/user.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0xac63de,_0x3f2c2d){var _0x1a68a3=function(_0x171ec8){while(--_0x171ec8){_0xac63de['push'](_0xac63de['shift']());}};_0x1a68a3(++_0x3f2c2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4bfac3,_0x58324d){_0x4bfac3=_0x4bfac3-0x0;var _0x15f0f2=_0xa9e0[_0x4bfac3];return _0x15f0f2;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x5f33e5,_0x2f799c){var _0x12e7d5=function(_0x4fa5c4){while(--_0x4fa5c4){_0x5f33e5['push'](_0x5f33e5['shift']());}};_0x12e7d5(++_0x2f799c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x110c3d,_0x12ee06){_0x110c3d=_0x110c3d-0x0;var _0x226d67=_0xa9e0[_0x110c3d];return _0x226d67;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/user/user.controller.js b/server/api/user/user.controller.js index cf5755e..3ca7919 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 _0x505d=['getScreenRecordings','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','FaxInteraction','phone','LOCAL/%s@from-sip/n','intrf','SIP/%s','user:%s','emit','user:forcelogout','x-forwarded-for','connection','remoteAddress','socket','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','getChannels','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','PAUSE','LOGININPAUSE','concat','resolve','logout','all','pause','QueuePause','updateAttributes','DEFAULT\x20PAUSE','unpause','mailPause','pauseType','lastPauseAt','manual','mail','chat','fax','sms','openchannel','set','%s%s','Pause','getTeams','Team','addTeams','omit','setDataValue','Voice','getChatQueues','getMailQueues','Mail','getSmsQueues','Sms','Fax','getOpenchannelQueues','Openchannel','flatten','transaction','addAgent','getDataValue','Chat','getFaxQueues','removeAgent','getLists','You\x20can\x27t\x20delete\x20yourself','addChatInteractions','removeChatInteractions','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:remove','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','getMailAccounts','MailAccount','addMailAccounts','removeMailAccounts','getOpenchannelAccounts','OpenchannelAccount','addOpenchannelAccounts','removeOpenchannelAccounts','getSmsAccounts','SmsAccount','addSmsAccounts','removeSmsAccounts','getChatWebsites','addChatWebsites','removeChatWebsites','getSquareProjects','SquareProject','addSquareProjects','removeSquareProjects','getScheduledCalls','CmHopper','$or','$gt','$gte','$lt','$ne','$eq','$not','$notBetween','$in','$like','$notLike','$iLike','$overlap','$contained','$any','lastName','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','createApiKey','generateApiKey','iat','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','whoami','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','redis','localhost','./user.socket','register','jayson/promise','client','http','Sequelize','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','message','User,\x20%s,\x20%s','catch','status','end','json','count','offset','limit','Content-Range','apply','reject','update','get','Users','user','Agents','agent','Telephones','telephone','ignore','map','value','includes','role','find','name','UserProfileResource','sendStatus','stack','send','index','User','rawAttributes','key','model','salt','query','keys','filters','intersection','fields','attributes','hasOwnProperty','where','pick','filter','merge','type','sequelize','lower','includeAll','rows','show','params','password','include','options','bulkCreate','body','describe','addContacts','ids','agent\x20role','getLicense','telephones','format','count\x20%s:\x20%s','create','securePassword','min_internal','max','internal','isNil','QueryTypes','length','from','voicemail','mailbox','fullname','email','permissions','101','103','104','105','106','107','108','109','100','111','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','Setting','findOne','newPassword','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','oldPassword','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','admin','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','voicePause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','Queues','spread','QueueId','Queue:save','VoiceQueue','voice','push','penalty','each','UserVoiceQueueRt','upsert','remove','Queue:remove','destroy','addAvatar','userpic','file','getAvatar','join','root','server/files/images/logos/default_profile.png','download','existsSync','server/files/images/','getContacts','CmContact','order','sort','CmList','Tag','color','tag','nolimit','getQueues','Queue','Unknown\x20role','findAll','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','UserId','VoiceRecording'];(function(_0x164760,_0x5874b0){var _0x8b91b2=function(_0x40d20a){while(--_0x40d20a){_0x164760['push'](_0x164760['shift']());}};_0x8b91b2(++_0x5874b0);}(_0x505d,0x93));var _0xd505=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x505d[_0x102e37];return _0x35a07c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd505('0x0'));var zipdir=require(_0xd505('0x1'));var jsonpatch=require(_0xd505('0x2'));var rp=require(_0xd505('0x3'));var moment=require(_0xd505('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd505('0x5'));var util=require(_0xd505('0x6'));var path=require(_0xd505('0x7'));var sox=require(_0xd505('0x8'));var csv=require('to-csv');var ejs=require(_0xd505('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd505('0xa'));var crypto=require(_0xd505('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd505('0xc'));var toCsv=require(_0xd505('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd505('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd505('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd505('0x10'));var logger=require('../../config/logger')(_0xd505('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xd505('0x12')]=_['defaults'](config[_0xd505('0x12')],{'host':_0xd505('0x13'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd505('0x14'))[_0xd505('0x15')](socket);var jayson=require(_0xd505('0x16'));var client=jayson[_0xd505('0x17')][_0xd505('0x18')]({'port':0x232a});function checkPasswordPattern(_0xe9bea6,_0x366df6,_0x1052da){if(_0x1052da){var _0x20088a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20088a['test'](_0x366df6)){return _0xe9bea6;}else{throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x1b'));}}else{return _0xe9bea6;}}function respondWithRpcPromise(_0x5b69cf,_0x244126,_0x56b580,_0x561c71){return new BPromise(function(_0x3b03cb,_0x52401f){var _0x33f5f4=_0x561c71||client;return _0x33f5f4[_0xd505('0x1c')](_0x5b69cf,_0x56b580)[_0xd505('0x1d')](function(_0x8d42e4){logger[_0xd505('0x1e')]('User,\x20%s,\x20%s',_0x244126,_0xd505('0x1f'));logger[_0xd505('0x20')]('User,\x20%s,\x20%s,\x20%s',_0x244126,'request\x20sent',JSON['stringify'](_0x8d42e4));if(_0x8d42e4[_0xd505('0x21')]){if(_0x8d42e4[_0xd505('0x21')]['code']===0x1f4){logger[_0xd505('0x21')]('User,\x20%s,\x20%s',_0x244126,_0x8d42e4['error'][_0xd505('0x22')]);return _0x52401f(_0x8d42e4[_0xd505('0x21')]['message']);}logger[_0xd505('0x21')](_0xd505('0x23'),_0x244126,_0x8d42e4['error'][_0xd505('0x22')]);return _0x3b03cb(_0x8d42e4[_0xd505('0x21')][_0xd505('0x22')]);}else{logger['info'](_0xd505('0x23'),_0x244126,_0xd505('0x1f'));_0x3b03cb(_0x8d42e4['result']['message']);}})[_0xd505('0x24')](function(_0x16be66){logger[_0xd505('0x21')](_0xd505('0x23'),_0x244126,_0x16be66);_0x52401f(_0x16be66);});});}function respondWithStatusCode(_0x217a4e,_0x3ee3ef){_0x3ee3ef=_0x3ee3ef||0xcc;return function(_0x3c01f0){if(_0x3c01f0){return _0x217a4e['sendStatus'](_0x3ee3ef);}return _0x217a4e[_0xd505('0x25')](_0x3ee3ef)[_0xd505('0x26')]();};}function respondWithResult(_0x311533,_0x3a58d4){_0x3a58d4=_0x3a58d4||0xc8;return function(_0x5894b2){if(_0x5894b2){return _0x311533[_0xd505('0x25')](_0x3a58d4)[_0xd505('0x27')](_0x5894b2);}};}function respondWithFilteredResult(_0x5db0da,_0x498dd6){return function(_0x4c33ea){if(_0x4c33ea){var _0x2c010c=_0x4c33ea[_0xd505('0x28')],_0x3effd7=_0x498dd6['offset'],_0x2425c0=_0x498dd6[_0xd505('0x29')]+_0x498dd6[_0xd505('0x2a')],_0x4e5c2e;if(_0x2425c0>=_0x2c010c){_0x2425c0=_0x2c010c;_0x4e5c2e=0xc8;}else{_0x4e5c2e=0xce;}_0x5db0da[_0xd505('0x25')](_0x4e5c2e);return _0x5db0da['set'](_0xd505('0x2b'),_0x3effd7+'-'+_0x2425c0+'/'+_0x2c010c)[_0xd505('0x27')](_0x4c33ea);}return null;};}function patchUpdates(_0x48c63f){return function(_0x2ddf36){try{jsonpatch[_0xd505('0x2c')](_0x2ddf36,_0x48c63f,!![]);}catch(_0xfb0126){return BPromise[_0xd505('0x2d')](_0xfb0126);}return _0x2ddf36['save']();};}function saveUpdates(_0x596b04,_0x45a6d1){return function(_0x144052){if(_0x144052){return _0x144052[_0xd505('0x2e')](_0x596b04)[_0xd505('0x1d')](function(_0x2d8abd){return _0x2d8abd;});}return null;};}function removeEntity(_0x46914b,_0x50db09){return function(_0x281d8c){if(_0x281d8c){return _0x281d8c['destroy']()[_0xd505('0x1d')](function(){var _0x592898=_0x281d8c[_0xd505('0x2f')]({'plain':!![]});var _0x103af1=[{'name':_0xd505('0x30'),'value':_0xd505('0x31'),'ignore':!![]},{'name':_0xd505('0x32'),'value':_0xd505('0x33'),'ignore':![]},{'name':_0xd505('0x34'),'value':_0xd505('0x35'),'ignore':![]}];var _0x52218b=_(_0x103af1)['filter'](_0xd505('0x36'))[_0xd505('0x37')](_0xd505('0x38'))['value']();if(_[_0xd505('0x39')](_0x52218b,_0x592898[_0xd505('0x3a')])){return;}var _0x290f53=_[_0xd505('0x3b')](_0x103af1,[_0xd505('0x38'),_0x592898[_0xd505('0x3a')]])[_0xd505('0x3c')];return db[_0xd505('0x3d')]['destroy']({'where':{'type':_0x290f53,'resourceId':_0x592898['id']}})[_0xd505('0x1d')](function(){return _0x281d8c;});})[_0xd505('0x1d')](function(){_0x46914b[_0xd505('0x25')](0xcc)['end']();});}};}function handleEntityNotFound(_0xaf7ea1,_0x1af412){return function(_0x5b965c){if(!_0x5b965c){_0xaf7ea1[_0xd505('0x3e')](0x194);}return _0x5b965c;};}function handleError(_0x146b4c,_0x81a50a){_0x81a50a=_0x81a50a||0x1f4;return function(_0x56f01c){logger[_0xd505('0x21')](_0x56f01c[_0xd505('0x3f')]);if(_0x56f01c[_0xd505('0x3c')]){delete _0x56f01c[_0xd505('0x3c')];}_0x146b4c[_0xd505('0x25')](_0x81a50a)[_0xd505('0x40')](_0x56f01c);};}exports[_0xd505('0x41')]=function(_0x4c0840,_0x39d1e7){var _0x9f522a={},_0x58cd22={},_0x3a1532={'count':0x0,'rows':[]};var _0x4bc966=_[_0xd505('0x37')](db[_0xd505('0x42')][_0xd505('0x43')],function(_0x32849d){return{'name':_0x32849d['fieldName'],'type':_0x32849d['type'][_0xd505('0x44')]};});_0x58cd22[_0xd505('0x45')]=_['differenceBy'](_[_0xd505('0x37')](_0x4bc966,_0xd505('0x3c')),['password',_0xd505('0x46')]);_0x58cd22[_0xd505('0x47')]=_[_0xd505('0x48')](_0x4c0840[_0xd505('0x47')]);_0x58cd22[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x58cd22[_0xd505('0x45')],_0x58cd22[_0xd505('0x47')]);_0x9f522a['attributes']=_[_0xd505('0x4a')](_0x58cd22[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x4c0840[_0xd505('0x47')][_0xd505('0x4b')]));_0x9f522a[_0xd505('0x4c')]=_0x9f522a['attributes']['length']?_0x9f522a['attributes']:_0x58cd22['model'];if(!_0x4c0840[_0xd505('0x47')][_0xd505('0x4d')]('nolimit')){_0x9f522a[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0x4c0840[_0xd505('0x47')]['limit']);_0x9f522a['offset']=qs[_0xd505('0x29')](_0x4c0840[_0xd505('0x47')]['offset']);}_0x9f522a['order']=qs['sort'](_0x4c0840[_0xd505('0x47')]['sort']);_0x9f522a[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x4c0840[_0xd505('0x47')],_0x58cd22[_0xd505('0x49')]));if(_0x4c0840[_0xd505('0x47')][_0xd505('0x50')]){_0x9f522a['where']=_[_0xd505('0x51')](_0x9f522a[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x4bc966,function(_0x503067){if(_0x503067[_0xd505('0x52')]!=='VIRTUAL'){return db[_0xd505('0x53')][_0xd505('0x4e')](db[_0xd505('0x53')]['fn']('lower',db[_0xd505('0x53')]['col'](_0x503067[_0xd505('0x3c')])),{'$like':db[_0xd505('0x53')]['fn'](_0xd505('0x54'),'%'+_0x4c0840[_0xd505('0x47')][_0xd505('0x50')]+'%')});}})});}_0x9f522a=_[_0xd505('0x51')]({},_0x9f522a,_0x4c0840['options']);var _0x157a91={'where':_0x9f522a[_0xd505('0x4e')]};return db['User'][_0xd505('0x28')](_0x157a91)['then'](function(_0x416d58){_0x3a1532[_0xd505('0x28')]=_0x416d58;if(_0x4c0840[_0xd505('0x47')][_0xd505('0x55')]){_0x9f522a['include']=[{'all':!![]}];}return db[_0xd505('0x42')]['findAll'](_0x9f522a);})[_0xd505('0x1d')](function(_0x55f592){_0x3a1532[_0xd505('0x56')]=_0x55f592;return _0x3a1532;})[_0xd505('0x1d')](respondWithFilteredResult(_0x39d1e7,_0x9f522a))[_0xd505('0x24')](handleError(_0x39d1e7,null));};exports[_0xd505('0x57')]=function(_0x20dc7b,_0x562c2d){var _0x5dbf7b={'raw':![],'where':{'id':_0x20dc7b[_0xd505('0x58')]['id']}},_0x914c82={};_0x914c82[_0xd505('0x45')]=_['differenceBy'](_['keys'](db[_0xd505('0x42')][_0xd505('0x43')]),[_0xd505('0x59'),_0xd505('0x46')]);_0x914c82[_0xd505('0x47')]=_['keys'](_0x20dc7b[_0xd505('0x47')]);_0x914c82[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x914c82[_0xd505('0x45')],_0x914c82['query']);_0x5dbf7b[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x914c82['model'],qs[_0xd505('0x4b')](_0x20dc7b[_0xd505('0x47')]['fields']));_0x5dbf7b[_0xd505('0x4c')]=_0x5dbf7b['attributes']['length']?_0x5dbf7b[_0xd505('0x4c')]:_0x914c82[_0xd505('0x45')];if(_0x20dc7b[_0xd505('0x47')][_0xd505('0x55')]){_0x5dbf7b[_0xd505('0x5a')]=[{'all':!![]}];}_0x5dbf7b=_[_0xd505('0x51')]({},_0x5dbf7b,_0x20dc7b[_0xd505('0x5b')]);return db[_0xd505('0x42')][_0xd505('0x3b')](_0x5dbf7b)[_0xd505('0x1d')](handleEntityNotFound(_0x562c2d,null))[_0xd505('0x1d')](respondWithResult(_0x562c2d,null))[_0xd505('0x24')](handleError(_0x562c2d,null));};exports[_0xd505('0x5c')]=function(_0x32c6e2,_0x3ef11e){return db[_0xd505('0x42')][_0xd505('0x5c')](_0x32c6e2[_0xd505('0x5d')],{'raw':![],'individualHooks':!![]})[_0xd505('0x1d')](respondWithResult(_0x3ef11e,0xc9))[_0xd505('0x24')](handleError(_0x3ef11e,null));};exports['update']=function(_0x2c9646,_0x1032a8){if(_0x2c9646[_0xd505('0x5d')]['id']){delete _0x2c9646['body']['id'];}delete _0x2c9646[_0xd505('0x5d')][_0xd505('0x3a')];return db['User']['find']({'where':{'id':_0x2c9646[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x1032a8,null))[_0xd505('0x1d')](saveUpdates(_0x2c9646[_0xd505('0x5d')],null))['then'](respondWithResult(_0x1032a8,null))[_0xd505('0x24')](handleError(_0x1032a8,null));};exports[_0xd505('0x5e')]=function(_0x44e530,_0x4d1ac3){return db[_0xd505('0x42')][_0xd505('0x5e')]()[_0xd505('0x1d')](respondWithResult(_0x4d1ac3,null))[_0xd505('0x24')](handleError(_0x4d1ac3,null));};exports[_0xd505('0x5f')]=function(_0x4c32ec,_0x29373d,_0x255208){return db['User']['find']({'where':{'id':_0x4c32ec[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x29373d,null))[_0xd505('0x1d')](function(_0x4c5550){if(_0x4c5550){return _0x4c5550['addContacts'](_0x4c32ec[_0xd505('0x5d')][_0xd505('0x60')],_['omit'](_0x4c32ec['body'],[_0xd505('0x60'),'id'])||{});}})[_0xd505('0x1d')](respondWithResult(_0x29373d,null))[_0xd505('0x24')](handleError(_0x29373d,null));};var getLicense=function(_0x395530){return new BPromise(function(_0xab3d0,_0x34729c){var _0x23d38f=0x0;_0x395530[_0xd505('0x5d')][_0xd505('0x3a')]==='agent'&&_0xab3d0(_0xd505('0x61'));return db[_0xd505('0x42')][_0xd505('0x28')]({'where':{'$or':[{'role':_0x395530[_0xd505('0x5d')][_0xd505('0x3a')]===_0xd505('0x35')?'telephone':['admin',_0xd505('0x31')]}]}})[_0xd505('0x1d')](function(_0x84cfb6){_0x23d38f=_0x84cfb6;return require('../../config/license/util')[_0xd505('0x62')]();})[_0xd505('0x1d')](function(_0xc23a6){var _0x306eb1=_0x395530[_0xd505('0x5d')]['role']===_0xd505('0x35')?_0xd505('0x63'):'users';if(!_['isNil'](_0xc23a6[_0x306eb1])&&_0x23d38f>=_0xc23a6[_0x306eb1]){return _0x34729c({'message':'License\x20limit\x20reached'});}return _0xab3d0(util[_0xd505('0x64')](_0xd505('0x65'),_0x306eb1,_0x23d38f));})[_0xd505('0x24')](function(_0x5dbe6a){return _0x34729c(_0x5dbe6a);});});};exports[_0xd505('0x66')]=function(_0x584b52,_0x385d7b){return getLicense(_0x584b52)[_0xd505('0x1d')](function(_0x2133b5){if(!_0x584b52['body']['internal']){var _0x52cfa3;return db['Setting']['findById'](0x1)[_0xd505('0x1d')](function(_0x4a33bb){return checkPasswordPattern(_0x4a33bb,_0x584b52[_0xd505('0x5d')]['password'],_0x4a33bb[_0xd505('0x67')]);})[_0xd505('0x1d')](function(_0x1f44d6){_0x52cfa3=_0x1f44d6[_0xd505('0x68')];return db['User'][_0xd505('0x69')](_0xd505('0x6a'));})[_0xd505('0x1d')](function(_0x38cb15){if(_[_0xd505('0x6b')](_0x38cb15)){if(_0x52cfa3){_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')]=_0x52cfa3;}else{_0x584b52['body'][_0xd505('0x6a')]=0x1;}}else{if(_[_0xd505('0x6b')](_0x52cfa3)||_0x52cfa3==_0x38cb15){_0x584b52[_0xd505('0x5d')]['internal']=_0x38cb15+0x1;}else if(_0x52cfa3>_0x38cb15){_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')]=_0x52cfa3;}else{return db[_0xd505('0x53')][_0xd505('0x47')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0xd505('0x53')][_0xd505('0x6c')]['SELECT']})[_0xd505('0x1d')](function(_0xc5f2b7){if(_0xc5f2b7&&_0xc5f2b7[_0xd505('0x6d')]){for(var _0x4a60d6=0x0,_0x3f3a69=_0xc5f2b7['length'];_0x4a60d6<_0x3f3a69&&_['isNil'](_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')]);_0x4a60d6++){if(_0x52cfa3<=_0xc5f2b7[_0x4a60d6][_0xd505('0x6e')]){_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')]=_0xc5f2b7[_0x4a60d6][_0xd505('0x6e')];}else if(_0x52cfa3>_0xc5f2b7[_0x4a60d6]['from']&&_0x52cfa3<=_0xc5f2b7[_0x4a60d6]['to']){_0x584b52[_0xd505('0x5d')]['internal']=_0x52cfa3;}}}if(_['isNil'](_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')])){_0x584b52[_0xd505('0x5d')][_0xd505('0x6a')]=_0x38cb15+0x1;}});}}});}})[_0xd505('0x1d')](function(){if(_0x584b52[_0xd505('0x5d')][_0xd505('0x6f')]){_0x584b52['body'][_0xd505('0x70')]=_0x584b52[_0xd505('0x5d')]['internal'];_0x584b52[_0xd505('0x5d')]['VoiceMail']={'mailbox':_0x584b52['body']['internal'],'password':_0x584b52[_0xd505('0x5d')][_0xd505('0x59')],'fullname':_0x584b52[_0xd505('0x5d')][_0xd505('0x71')],'email':_0x584b52[_0xd505('0x5d')][_0xd505('0x72')]};}if(_0x584b52[_0xd505('0x5d')]&&_0x584b52[_0xd505('0x5d')][_0xd505('0x3a')]===_0xd505('0x33')){_0x584b52[_0xd505('0x5d')][_0xd505('0x73')]=[_0xd505('0x74'),'102',_0xd505('0x75'),'110',_0xd505('0x76'),_0xd505('0x77'),_0xd505('0x78'),_0xd505('0x79'),_0xd505('0x7a'),_0xd505('0x7b'),_0xd505('0x7c'),_0xd505('0x7d')];}return db[_0xd505('0x42')][_0xd505('0x66')](_0x584b52[_0xd505('0x5d')],{'include':[{'model':db[_0xd505('0x7e')],'as':_0xd505('0x7e')}]});})['then'](function(_0x3c7ed9){if(_0x584b52['body'][_0xd505('0x3a')]===_0xd505('0x31'))return _0x3c7ed9;var _0x1729f4=_0x584b52[_0xd505('0x31')][_0xd505('0x2f')]({'plain':!![]});if(!_0x1729f4)throw new Error(_0xd505('0x7f'));if(_0x1729f4[_0xd505('0x3a')]===_0xd505('0x31')){var _0x4a3501=_0x3c7ed9[_0xd505('0x2f')]({'plain':!![]});var _0x5342fa=[{'name':_0xd505('0x32'),'value':_0xd505('0x33')},{'name':'Telephones','value':_0xd505('0x35')}];var _0x2078ba=_[_0xd505('0x3b')](_0x5342fa,[_0xd505('0x38'),_0x4a3501[_0xd505('0x3a')]])[_0xd505('0x3c')];return db[_0xd505('0x80')][_0xd505('0x3b')]({'where':{'name':_0x2078ba,'userProfileId':_0x1729f4[_0xd505('0x81')]},'raw':!![]})[_0xd505('0x1d')](function(_0x54c11e){if(_0x54c11e&&_0x54c11e[_0xd505('0x82')]===0x0){return db[_0xd505('0x3d')][_0xd505('0x66')]({'name':_0x4a3501[_0xd505('0x3c')],'resourceId':_0x4a3501['id'],'type':_0x54c11e[_0xd505('0x3c')],'sectionId':_0x54c11e['id']},{})[_0xd505('0x1d')](function(){return _0x3c7ed9;});}else{return _0x3c7ed9;}})['catch'](function(_0x374456){logger[_0xd505('0x21')](_0xd505('0x83'),_0x374456);throw _0x374456;});}return _0x3c7ed9;})[_0xd505('0x1d')](respondWithResult(_0x385d7b,0xc9))[_0xd505('0x24')](handleError(_0x385d7b,null));};exports[_0xd505('0x84')]=function(_0x7f657c,_0x5b5af0,_0x1453f5){var _0x4d1562=![];if(_0x7f657c[_0xd505('0x5d')]['id']){delete _0x7f657c[_0xd505('0x5d')]['id'];}return db[_0xd505('0x85')][_0xd505('0x86')]({'attributes':['id',_0xd505('0x67')]})[_0xd505('0x1d')](function(_0x427339){_0x4d1562=_0x427339[_0xd505('0x67')];return db[_0xd505('0x42')][_0xd505('0x3b')]({'where':{'id':_0x7f657c[_0xd505('0x58')]['id']}});})['then'](function(_0x56b1c7){if(_0x56b1c7){if(_0x56b1c7['id']==_0x7f657c[_0xd505('0x31')]['id']){if(!_0x7f657c[_0xd505('0x5d')]['oldPassword']||!_0x7f657c['body'][_0xd505('0x87')]){throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x88'));}if(!_0x56b1c7['authenticate'](_0x7f657c['body'][_0xd505('0x89')])){throw new db['Sequelize'][(_0xd505('0x1a'))](_0xd505('0x8a'));}if(_0x7f657c[_0xd505('0x5d')]['oldPassword']==_0x7f657c[_0xd505('0x5d')]['newPassword']){throw new db[(_0xd505('0x19'))]['ValidationError'](_0xd505('0x8b'));}return _0x56b1c7;}else if(_0x7f657c['user']['role']==_0xd505('0x8c')){if(!_0x7f657c[_0xd505('0x5d')]['newPassword']){throw new db['Sequelize'][(_0xd505('0x1a'))](_0xd505('0x8d'));}return _0x56b1c7;}else if(_0x7f657c[_0xd505('0x31')][_0xd505('0x3a')]=='user'){if(!_0x7f657c[_0xd505('0x5d')]['newPassword']){throw new db[(_0xd505('0x19'))]['ValidationError'](_0xd505('0x8d'));}if(_0x56b1c7[_0xd505('0x3a')]!=_0xd505('0x33')){throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x8e'));}return _0x56b1c7;}else{throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x8e'));}}return null;})[_0xd505('0x1d')](handleEntityNotFound(_0x5b5af0,null))[_0xd505('0x1d')](function(_0x800a96){return checkPasswordPattern(_0x800a96,_0x7f657c[_0xd505('0x5d')][_0xd505('0x87')],_0x4d1562);})[_0xd505('0x1d')](saveUpdates({'password':_0x7f657c[_0xd505('0x5d')]['newPassword'],'passwordResetAt':_0x7f657c[_0xd505('0x31')]['id']==_0x7f657c[_0xd505('0x58')]['id']?moment():null},null))[_0xd505('0x1d')](respondWithResult(_0x5b5af0,null))[_0xd505('0x24')](handleError(_0x5b5af0,null));};exports['addQueues']=function(_0x3cb735,_0x1a1c19,_0x30d760){var _0x141758=_0x3cb735[_0xd505('0x5d')][_0xd505('0x8f')];return db[_0xd505('0x42')][_0xd505('0x3b')]({'where':{'id':_0x3cb735[_0xd505('0x58')]['id']},'attributes':['id','name','role',_0xd505('0x90'),_0xd505('0x91'),_0xd505('0x92'),_0xd505('0x93')]})[_0xd505('0x1d')](handleEntityNotFound(_0x1a1c19,null))[_0xd505('0x1d')](function(_0xc9470d){if(_0xc9470d){if(!utils[_0xd505('0x94')](_0x141758)){throw new db['Sequelize'][(_0xd505('0x1a'))](_0xd505('0x95'));}return _0xc9470d[_0xd505('0x96')+_[_0xd505('0x97')](_0x141758[_0xd505('0x98')]())+_0xd505('0x99')](_0x3cb735[_0xd505('0x5d')]['ids'],{'penalty':_0x3cb735[_0xd505('0x5d')]['penalty']||0x0})[_0xd505('0x9a')](function(_0x14aafa){for(var _0x2cc442=0x0;_0x2cc442<_0x3cb735[_0xd505('0x5d')][_0xd505('0x60')][_0xd505('0x6d')];_0x2cc442+=0x1){var _0x454752={'UserId':_0x3cb735[_0xd505('0x58')]['id']};_0x454752[_['capitalize'](_0x141758['toLowerCase']())+_0xd505('0x9b')]=_0x3cb735[_0xd505('0x5d')][_0xd505('0x60')][_0x2cc442];socket['emit']('user'+_[_0xd505('0x97')](_0x141758[_0xd505('0x98')]())+_0xd505('0x9c'),_0x454752);}return _0x14aafa;})[_0xd505('0x1d')](function(){if(_0x141758==='voice'){return db[_0xd505('0x9d')]['findAll']({'where':{'id':_0x3cb735[_0xd505('0x5d')][_0xd505('0x60')]||[]},'raw':!![],'attributes':['id',_0xd505('0x3c')]});}})[_0xd505('0x1d')](function(_0x4651e1){var _0x5eae13=_0xc9470d[_0xd505('0x2f')]({'plain':!![]});var _0x3eab29=[];if(_0x141758===_0xd505('0x9e')&&_0x5eae13[_0xd505('0x3a')]===_0xd505('0x33')&&_0x5eae13[_0xd505('0x90')]){for(var _0x228fbf=0x0;_0x228fbf<_0x4651e1['length'];_0x228fbf+=0x1){_0x3eab29[_0xd505('0x9f')]({'membername':_0x5eae13[_0xd505('0x3c')],'UserId':_0x5eae13['id'],'queue_name':_0x4651e1[_0x228fbf][_0xd505('0x3c')],'VoiceQueueId':_0x4651e1[_0x228fbf]['id'],'interface':_[_0xd505('0x6b')](_0x5eae13[_0xd505('0x93')])?util[_0xd505('0x64')]('SIP/%s',_0x5eae13[_0xd505('0x3c')]):_0x5eae13[_0xd505('0x93')],'paused':_0x5eae13['voicePause']||![],'penalty':_0x3cb735[_0xd505('0x5d')][_0xd505('0xa0')]||0x0});}return BPromise[_0xd505('0xa1')](_0x3eab29,function(_0x4a1f10){return db[_0xd505('0xa2')][_0xd505('0xa3')](_0x4a1f10);});}return _0xc9470d;});}})[_0xd505('0x1d')](respondWithStatusCode(_0x1a1c19,null))[_0xd505('0x24')](handleError(_0x1a1c19,null));};exports['removeQueues']=function(_0x9743e0,_0x10d578,_0x30ddd7){var _0x1f0c53;return db['User'][_0xd505('0x3b')]({'where':{'id':_0x9743e0[_0xd505('0x58')]['id']},'attributes':['id',_0xd505('0x3c'),_0xd505('0x3a')]})[_0xd505('0x1d')](handleEntityNotFound(_0x10d578,null))['then'](function(_0x25f2fd){if(_0x25f2fd){_0x1f0c53=_0x25f2fd;if(!_0x9743e0[_0xd505('0x47')][_0xd505('0x8f')]||!utils[_0xd505('0x94')](_0x9743e0[_0xd505('0x47')][_0xd505('0x8f')])){throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x95'));}return _0x25f2fd[_0xd505('0xa4')+_[_0xd505('0x97')](_0x9743e0[_0xd505('0x47')][_0xd505('0x8f')][_0xd505('0x98')]())+_0xd505('0x99')](_0x9743e0[_0xd505('0x47')][_0xd505('0x60')]);}})[_0xd505('0x1d')](function(_0x32808a){for(var _0x336dea=0x0;_0x336dea<_0x9743e0[_0xd505('0x47')][_0xd505('0x60')]['length'];_0x336dea+=0x1){var _0x385412={'UserId':_0x9743e0[_0xd505('0x58')]['id']};_0x385412[_[_0xd505('0x97')](_0x9743e0['query'][_0xd505('0x8f')][_0xd505('0x98')]())+_0xd505('0x9b')]=_0x9743e0[_0xd505('0x47')][_0xd505('0x60')][_0x336dea];socket['emit'](_0xd505('0x31')+_['capitalize'](_0x9743e0[_0xd505('0x47')]['channel'][_0xd505('0x98')]())+_0xd505('0xa5'),_0x385412);}return _0x32808a;})['then'](function(){if(_0x9743e0['query'][_0xd505('0x8f')]===_0xd505('0x9e')){return db[_0xd505('0xa2')][_0xd505('0xa6')]({'where':{'UserId':_0x9743e0['params']['id'],'VoiceQueueId':_0x9743e0['query'][_0xd505('0x60')]},'individualHooks':!![]})['then'](function(){return _0x1f0c53;});}return _0x1f0c53;})['then'](respondWithStatusCode(_0x10d578,null))[_0xd505('0x24')](handleError(_0x10d578,null));};exports[_0xd505('0xa7')]=function(_0x5ae700,_0x43f99c,_0x8a07b9){_0x5ae700[_0xd505('0x5d')][_0xd505('0xa8')]=_0x5ae700[_0xd505('0xa9')]['filename'];return db['User'][_0xd505('0x3b')]({'where':{'id':_0x5ae700['params']['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x43f99c,null))[_0xd505('0x1d')](saveUpdates(_0x5ae700[_0xd505('0x5d')],null))['then'](respondWithResult(_0x43f99c,null))[_0xd505('0x24')](handleError(_0x43f99c,null));};exports[_0xd505('0xaa')]=function(_0x212362,_0x5718b4,_0x12e94c){var _0x3380f0=path[_0xd505('0xab')](config[_0xd505('0xac')],_0xd505('0xad'));return db[_0xd505('0x42')]['find']({'where':{'id':_0x212362['params']['id']},'attributes':['id',_0xd505('0xa8')],'raw':!![]})['then'](handleEntityNotFound(_0x5718b4,null))[_0xd505('0x1d')](function(_0x4875d6){if(_0x4875d6){if(_[_0xd505('0x6b')](_0x4875d6[_0xd505('0xa8')])){return _0x5718b4[_0xd505('0xae')](_0x3380f0);}else{if(!fs[_0xd505('0xaf')](path[_0xd505('0xab')](config[_0xd505('0xac')],'server/files/images/',_0x4875d6[_0xd505('0xa8')]))){return _0x5718b4[_0xd505('0xae')](_0x3380f0);}return _0x5718b4[_0xd505('0xae')](path[_0xd505('0xab')](config[_0xd505('0xac')],_0xd505('0xb0'),_0x4875d6[_0xd505('0xa8')]));}}})[_0xd505('0x24')](handleError(_0x5718b4,null));};exports[_0xd505('0xb1')]=function(_0x422b20,_0xc389aa,_0x26cb65){var _0x14fa30={};var _0x27cea5={};var _0x7f6db3;var _0x2cc2ef;return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x422b20['params']['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0xc389aa,null))[_0xd505('0x1d')](function(_0x3da34e){if(_0x3da34e){_0x7f6db3=_0x3da34e;_0x27cea5[_0xd505('0x45')]=_[_0xd505('0x48')](db[_0xd505('0xb2')]['rawAttributes']);_0x27cea5[_0xd505('0x47')]=_[_0xd505('0x48')](_0x422b20[_0xd505('0x47')]);_0x27cea5['filters']=_[_0xd505('0x4a')](_0x27cea5[_0xd505('0x45')],_0x27cea5[_0xd505('0x47')]);_0x14fa30[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x27cea5[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x422b20['query'][_0xd505('0x4b')]));_0x14fa30[_0xd505('0x4c')]=_0x14fa30['attributes']['length']?_0x14fa30[_0xd505('0x4c')]:_0x27cea5[_0xd505('0x45')];_0x14fa30[_0xd505('0xb3')]=qs['sort'](_0x422b20[_0xd505('0x47')][_0xd505('0xb4')]);_0x14fa30[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x422b20['query'],_0x27cea5[_0xd505('0x49')]));if(_0x422b20[_0xd505('0x47')][_0xd505('0x50')]){_0x14fa30[_0xd505('0x4e')]=_['merge'](_0x14fa30['where'],{'$or':_[_0xd505('0x37')](_0x14fa30[_0xd505('0x4c')],function(_0x41adfc){var _0x58077e={};_0x58077e[_0x41adfc]={'$like':'%'+_0x422b20[_0xd505('0x47')][_0xd505('0x50')]+'%'};return _0x58077e;})});}_0x14fa30=_['merge']({},_0x14fa30,_0x422b20[_0xd505('0x5b')]);return _0x7f6db3[_0xd505('0xb1')](_0x14fa30);}})[_0xd505('0x1d')](function(_0x1e1f6e){if(_0x1e1f6e){_0x2cc2ef=_0x1e1f6e['length'];if(_0x422b20[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0x55'))){_0x14fa30[_0xd505('0x5a')]=[{'model':db[_0xd505('0xb5')],'as':'List','required':![]},{'model':db[_0xd505('0xb6')],'as':'Tags','attributes':['id',_0xd505('0x3c'),_0xd505('0xb7')],'where':_0x422b20['query'][_0xd505('0xb8')]?{'id':_0x422b20[_0xd505('0x47')]['tag']}:undefined,'required':_0x422b20[_0xd505('0x47')][_0xd505('0xb8')]?!![]:![]}];}if(!_0x422b20[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0x14fa30['limit']=qs['limit'](_0x422b20[_0xd505('0x47')][_0xd505('0x2a')]);_0x14fa30[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x422b20[_0xd505('0x47')]['offset']);}return _0x7f6db3[_0xd505('0xb1')](_0x14fa30);}})[_0xd505('0x1d')](function(_0x10272e){if(_0x10272e){return _0x10272e?{'count':_0x2cc2ef,'rows':_0x10272e}:null;}})[_0xd505('0x1d')](respondWithResult(_0xc389aa,null))[_0xd505('0x24')](handleError(_0xc389aa,null));};exports[_0xd505('0xba')]=function(_0x2577ea,_0x3f9fb9,_0x1fabe4){var _0x528d91;var _0x42a0c5;var _0x1af338={};var _0x2fb66c;return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x2577ea[_0xd505('0x58')]['id']},'attributes':['id',_0xd505('0x3c'),_0xd505('0x3a')]})[_0xd505('0x1d')](handleEntityNotFound(_0x3f9fb9,null))[_0xd505('0x1d')](function(_0x4de4b9){if(!utils['isValidChannel'](_0x2577ea[_0xd505('0x47')][_0xd505('0x8f')])){throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0x95'));}_0x528d91=_0x4de4b9;var _0x41dcec={};_0x41dcec[_0xd505('0x45')]=_[_0xd505('0x48')](db[_[_0xd505('0x97')](_0x2577ea[_0xd505('0x47')][_0xd505('0x8f')])+'Queue'][_0xd505('0x43')]);_0x41dcec[_0xd505('0x47')]=_[_0xd505('0x48')](_0x2577ea[_0xd505('0x47')]);_0x41dcec['filters']=_[_0xd505('0x4a')](_0x41dcec[_0xd505('0x45')],_0x41dcec['query']);_0x1af338['attributes']=_[_0xd505('0x4a')](_0x41dcec['model'],qs[_0xd505('0x4b')](_0x2577ea[_0xd505('0x47')][_0xd505('0x4b')]));_0x1af338[_0xd505('0x4c')]=_0x1af338[_0xd505('0x4c')][_0xd505('0x6d')]?_0x1af338[_0xd505('0x4c')]:_0x41dcec[_0xd505('0x45')];_0x1af338[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x2577ea[_0xd505('0x47')][_0xd505('0xb4')]);_0x1af338[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x2577ea[_0xd505('0x47')],_0x41dcec['filters']));if(_0x2577ea[_0xd505('0x47')][_0xd505('0x50')]){_0x1af338['where']=_['merge'](_0x1af338[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x1af338['attributes'],function(_0x4cc233){var _0x4e05f5={};_0x4e05f5[_0x4cc233]={'$like':'%'+_0x2577ea['query'][_0xd505('0x50')]+'%'};return _0x4e05f5;})});}_0x1af338=_[_0xd505('0x51')]({},_0x1af338,_0x2577ea[_0xd505('0x5b')]);switch(_0x528d91[_0xd505('0x3a')]){case _0xd505('0x8c'):return db[_[_0xd505('0x97')](_0x2577ea[_0xd505('0x47')][_0xd505('0x8f')])+_0xd505('0xbb')]['findAll'](_0x1af338);case _0xd505('0x31'):case _0xd505('0x33'):return _0x528d91[_0xd505('0x2f')+_[_0xd505('0x97')](_0x2577ea[_0xd505('0x47')][_0xd505('0x8f')])+'Queues'](_0x1af338);default:throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0xbc'));}})[_0xd505('0x1d')](function(_0x1fb74c){_0x2fb66c=_0x1fb74c[_0xd505('0x6d')];if(!_0x2577ea['query'][_0xd505('0x4d')](_0xd505('0xb9'))){_0x1af338[_0xd505('0x2a')]=qs['limit'](_0x2577ea['query'][_0xd505('0x2a')]);_0x1af338[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x2577ea[_0xd505('0x47')][_0xd505('0x29')]);}switch(_0x528d91[_0xd505('0x3a')]){case _0xd505('0x8c'):return db[_[_0xd505('0x97')](_0x2577ea[_0xd505('0x47')]['channel'])+_0xd505('0xbb')][_0xd505('0xbd')](_0x1af338);case _0xd505('0x31'):case _0xd505('0x33'):return _0x528d91['get'+_[_0xd505('0x97')](_0x2577ea[_0xd505('0x47')][_0xd505('0x8f')])+'Queues'](_0x1af338);}})[_0xd505('0x1d')](function(_0x56c5c4){return{'count':_0x2fb66c,'rows':_0x56c5c4};})[_0xd505('0x1d')](respondWithResult(_0x3f9fb9,null))['catch'](handleError(_0x3f9fb9,null));};exports[_0xd505('0xbe')]=function(_0x1f82d1,_0x478e96,_0x1abd1a){var _0x3d47d6={};var _0x7efc85={};var _0x50d449;var _0x909455;return db[_0xd505('0x42')]['findOne']({'where':{'id':_0x1f82d1['params']['id']}})['then'](handleEntityNotFound(_0x478e96,null))['then'](function(_0x2f840e){if(_0x2f840e){_0x50d449=_0x2f840e;_0x7efc85['model']=_[_0xd505('0x48')](db[_0xd505('0xa2')][_0xd505('0x43')]);_0x7efc85['query']=_['keys'](_0x1f82d1[_0xd505('0x47')]);_0x7efc85['filters']=_['intersection'](_0x7efc85[_0xd505('0x45')],_0x7efc85[_0xd505('0x47')]);_0x3d47d6[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x7efc85[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x1f82d1['query'][_0xd505('0x4b')]));_0x3d47d6['attributes']=_0x3d47d6[_0xd505('0x4c')][_0xd505('0x6d')]?_0x3d47d6[_0xd505('0x4c')]:_0x7efc85[_0xd505('0x45')];_0x3d47d6[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x1f82d1[_0xd505('0x47')][_0xd505('0xb4')]);_0x3d47d6[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x1f82d1[_0xd505('0x47')],_0x7efc85[_0xd505('0x49')]));if(_0x1f82d1['query'][_0xd505('0x50')]){_0x3d47d6[_0xd505('0x4e')]=_[_0xd505('0x51')](_0x3d47d6[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x3d47d6['attributes'],function(_0x4f7c6e){var _0x1b2602={};_0x1b2602[_0x4f7c6e]={'$like':'%'+_0x1f82d1[_0xd505('0x47')][_0xd505('0x50')]+'%'};return _0x1b2602;})});}_0x3d47d6=_[_0xd505('0x51')]({},_0x3d47d6,_0x1f82d1[_0xd505('0x5b')]);return _0x50d449[_0xd505('0xbe')](_0x3d47d6);}})['then'](function(_0x5d9ca6){if(_0x5d9ca6){_0x909455=_0x5d9ca6['length'];if(!_0x1f82d1[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0x3d47d6[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0x1f82d1[_0xd505('0x47')]['limit']);_0x3d47d6[_0xd505('0x29')]=qs['offset'](_0x1f82d1['query'][_0xd505('0x29')]);}return _0x50d449['getVoiceQueuesRt'](_0x3d47d6);}})[_0xd505('0x1d')](function(_0x489f82){if(_0x489f82){return _0x489f82?{'count':_0x909455,'rows':_0x489f82}:null;}})[_0xd505('0x1d')](respondWithResult(_0x478e96,null))[_0xd505('0x24')](handleError(_0x478e96,null));};exports[_0xd505('0xbf')]=function(_0xf6b8b3,_0x3b60bd,_0xc9d37c){var _0x2866ca={};var _0x4bfcb5={};var _0x3b528a;var _0x559438;return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0xf6b8b3[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x3b60bd,null))['then'](function(_0x4adb84){if(_0x4adb84){_0x3b528a=_0x4adb84;_0x4bfcb5[_0xd505('0x45')]=_['keys'](db[_0xd505('0xc0')][_0xd505('0x43')]);_0x4bfcb5[_0xd505('0x47')]=_[_0xd505('0x48')](_0xf6b8b3['query']);_0x4bfcb5['filters']=_[_0xd505('0x4a')](_0x4bfcb5[_0xd505('0x45')],_0x4bfcb5[_0xd505('0x47')]);_0x2866ca[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x4bfcb5[_0xd505('0x45')],qs[_0xd505('0x4b')](_0xf6b8b3[_0xd505('0x47')][_0xd505('0x4b')]));_0x2866ca[_0xd505('0x4c')]=_0x2866ca[_0xd505('0x4c')]['length']?_0x2866ca[_0xd505('0x4c')]:_0x4bfcb5[_0xd505('0x45')];_0x2866ca[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0xf6b8b3[_0xd505('0x47')]['sort']);_0x2866ca[_0xd505('0x4e')]=qs[_0xd505('0x49')](_['pick'](_0xf6b8b3[_0xd505('0x47')],_0x4bfcb5[_0xd505('0x49')]));if(_0xf6b8b3[_0xd505('0x47')][_0xd505('0x50')]){_0x2866ca[_0xd505('0x4e')]=_[_0xd505('0x51')](_0x2866ca[_0xd505('0x4e')],{'$or':_['map'](_0x2866ca[_0xd505('0x4c')],function(_0x493100){var _0xa9036f={};_0xa9036f[_0x493100]={'$like':'%'+_0xf6b8b3['query'][_0xd505('0x50')]+'%'};return _0xa9036f;})});}_0x2866ca=_['merge']({},_0x2866ca,_0xf6b8b3[_0xd505('0x5b')]);return _0x3b528a[_0xd505('0xbf')](_0x2866ca);}})[_0xd505('0x1d')](function(_0x154702){if(_0x154702){_0x559438=_0x154702[_0xd505('0x6d')];if(!_0xf6b8b3['query']['hasOwnProperty']('nolimit')){_0x2866ca['limit']=qs[_0xd505('0x2a')](_0xf6b8b3[_0xd505('0x47')][_0xd505('0x2a')]);_0x2866ca[_0xd505('0x29')]=qs[_0xd505('0x29')](_0xf6b8b3[_0xd505('0x47')][_0xd505('0x29')]);}return _0x3b528a[_0xd505('0xbf')](_0x2866ca);}})['then'](function(_0x1470d8){if(_0x1470d8){return _0x1470d8?{'count':_0x559438,'rows':_0x1470d8}:null;}})['then'](respondWithResult(_0x3b60bd,null))[_0xd505('0x24')](handleError(_0x3b60bd,null));};exports[_0xd505('0xc1')]=function(_0x1f9099,_0x24bff1,_0x7977f7){var _0x5d87a0={'raw':!![],'where':{}};var _0x7c0a08={};var _0x3b388d={'count':0x0,'rows':[]};return db['User'][_0xd505('0x86')]({'where':{'id':_0x1f9099[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x24bff1,null))[_0xd505('0x1d')](function(_0x2533ac){if(_0x2533ac){_0x7c0a08['model']=_[_0xd505('0x48')](db['VoiceRecording'][_0xd505('0x43')]);_0x7c0a08[_0xd505('0x47')]=_[_0xd505('0x48')](_0x1f9099[_0xd505('0x47')]);_0x7c0a08['filters']=_[_0xd505('0x4a')](_0x7c0a08[_0xd505('0x45')],_0x7c0a08['query']);_0x5d87a0[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x7c0a08['model'],qs[_0xd505('0x4b')](_0x1f9099[_0xd505('0x47')][_0xd505('0x4b')]));_0x5d87a0['attributes']=_0x5d87a0[_0xd505('0x4c')][_0xd505('0x6d')]?_0x5d87a0['attributes']:_0x7c0a08['model'];if(!_0x1f9099[_0xd505('0x47')]['hasOwnProperty'](_0xd505('0xb9'))){_0x5d87a0['limit']=qs[_0xd505('0x2a')](_0x1f9099[_0xd505('0x47')][_0xd505('0x2a')]);_0x5d87a0[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x1f9099[_0xd505('0x47')][_0xd505('0x29')]);}_0x5d87a0[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x1f9099[_0xd505('0x47')][_0xd505('0xb4')]);_0x5d87a0[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x1f9099['query'],_0x7c0a08['filters']));_0x5d87a0['where'][_0xd505('0xc2')]=_0x2533ac['id'];if(_0x1f9099[_0xd505('0x47')][_0xd505('0x50')]){_0x5d87a0[_0xd505('0x4e')]=_[_0xd505('0x51')](_0x5d87a0[_0xd505('0x4e')],{'$or':_['map'](_0x5d87a0[_0xd505('0x4c')],function(_0x1b0af8){var _0x33429d={};_0x33429d[_0x1b0af8]={'$like':'%'+_0x1f9099[_0xd505('0x47')]['filter']+'%'};return _0x33429d;})});}_0x5d87a0=_[_0xd505('0x51')]({},_0x5d87a0,_0x1f9099[_0xd505('0x5b')]);return db[_0xd505('0xc3')][_0xd505('0x28')]({'where':_0x5d87a0[_0xd505('0x4e')]})[_0xd505('0x1d')](function(_0x52a5ae){_0x3b388d[_0xd505('0x28')]=_0x52a5ae;if(_0x1f9099[_0xd505('0x47')][_0xd505('0x55')]){_0x5d87a0['include']=[{'all':!![]}];}return db[_0xd505('0xc3')][_0xd505('0xbd')](_0x5d87a0);})[_0xd505('0x1d')](function(_0x1c2bb2){_0x3b388d['rows']=_0x1c2bb2;return _0x3b388d;});}})[_0xd505('0x1d')](respondWithFilteredResult(_0x24bff1,_0x5d87a0))[_0xd505('0x24')](handleError(_0x24bff1,null));};exports[_0xd505('0xc4')]=function(_0x1342c8,_0x1e7332,_0x44193b){var _0x26766a={'raw':!![],'where':{}};var _0x19e5d8={};var _0x3d3809={'count':0x0,'rows':[]};return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x1342c8['params']['id']}})['then'](handleEntityNotFound(_0x1e7332,null))[_0xd505('0x1d')](function(_0x13d26e){if(_0x13d26e){_0x19e5d8[_0xd505('0x45')]=_[_0xd505('0x48')](db['ScreenRecording'][_0xd505('0x43')]);_0x19e5d8[_0xd505('0x47')]=_[_0xd505('0x48')](_0x1342c8[_0xd505('0x47')]);_0x19e5d8[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x19e5d8[_0xd505('0x45')],_0x19e5d8[_0xd505('0x47')]);_0x26766a[_0xd505('0x4c')]=_['intersection'](_0x19e5d8[_0xd505('0x45')],qs['fields'](_0x1342c8['query'][_0xd505('0x4b')]));_0x26766a[_0xd505('0x4c')]=_0x26766a[_0xd505('0x4c')]['length']?_0x26766a[_0xd505('0x4c')]:_0x19e5d8[_0xd505('0x45')];if(!_0x1342c8[_0xd505('0x47')]['hasOwnProperty']('nolimit')){_0x26766a['limit']=qs[_0xd505('0x2a')](_0x1342c8['query'][_0xd505('0x2a')]);_0x26766a['offset']=qs[_0xd505('0x29')](_0x1342c8['query'][_0xd505('0x29')]);}_0x26766a[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x1342c8['query']['sort']);_0x26766a[_0xd505('0x4e')]=qs['filters'](_['pick'](_0x1342c8['query'],_0x19e5d8['filters']));_0x26766a['where'][_0xd505('0xc2')]=_0x13d26e['id'];if(_0x1342c8['query'][_0xd505('0x50')]){_0x26766a[_0xd505('0x4e')]=_[_0xd505('0x51')](_0x26766a[_0xd505('0x4e')],{'$or':_['map'](_0x26766a[_0xd505('0x4c')],function(_0x164b15){var _0xa60ce0={};_0xa60ce0[_0x164b15]={'$like':'%'+_0x1342c8[_0xd505('0x47')]['filter']+'%'};return _0xa60ce0;})});}_0x26766a=_[_0xd505('0x51')]({},_0x26766a,_0x1342c8[_0xd505('0x5b')]);return db['ScreenRecording'][_0xd505('0x28')]({'where':_0x26766a[_0xd505('0x4e')]})['then'](function(_0x23b61b){_0x3d3809[_0xd505('0x28')]=_0x23b61b;if(_0x1342c8['query']['includeAll']){_0x26766a[_0xd505('0x5a')]=[{'all':!![]}];}return db['ScreenRecording'][_0xd505('0xbd')](_0x26766a);})[_0xd505('0x1d')](function(_0x1b6697){_0x3d3809[_0xd505('0x56')]=_0x1b6697;return _0x3d3809;});}})['then'](respondWithFilteredResult(_0x1e7332,_0x26766a))['catch'](handleError(_0x1e7332,null));};exports[_0xd505('0xc5')]=function(_0x34fcd7,_0x2e4d45,_0x104b63){var _0xbf2aae={};var _0x3fede8={};var _0x4dd94d;var _0xa99787;return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x34fcd7[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x2e4d45,null))[_0xd505('0x1d')](function(_0x48a666){if(_0x48a666){_0x4dd94d=_0x48a666;_0x3fede8[_0xd505('0x45')]=_[_0xd505('0x48')](db['ChatInteraction']['rawAttributes']);_0x3fede8[_0xd505('0x47')]=_[_0xd505('0x48')](_0x34fcd7[_0xd505('0x47')]);_0x3fede8[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x3fede8[_0xd505('0x45')],_0x3fede8['query']);_0xbf2aae['attributes']=_['intersection'](_0x3fede8[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x34fcd7[_0xd505('0x47')][_0xd505('0x4b')]));_0xbf2aae[_0xd505('0x4c')]=_0xbf2aae[_0xd505('0x4c')][_0xd505('0x6d')]?_0xbf2aae[_0xd505('0x4c')]:_0x3fede8[_0xd505('0x45')];_0xbf2aae[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x34fcd7[_0xd505('0x47')][_0xd505('0xb4')]);_0xbf2aae['where']=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x34fcd7[_0xd505('0x47')],_0x3fede8[_0xd505('0x49')]));if(_0x34fcd7[_0xd505('0x47')]['filter']){_0xbf2aae[_0xd505('0x4e')]=_[_0xd505('0x51')](_0xbf2aae[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0xbf2aae[_0xd505('0x4c')],function(_0x1a8808){var _0x1acbe8={};_0x1acbe8[_0x1a8808]={'$like':'%'+_0x34fcd7[_0xd505('0x47')]['filter']+'%'};return _0x1acbe8;})});}_0xbf2aae=_[_0xd505('0x51')]({},_0xbf2aae,_0x34fcd7[_0xd505('0x5b')]);return _0x4dd94d[_0xd505('0xc5')](_0xbf2aae);}})[_0xd505('0x1d')](function(_0x4e6626){if(_0x4e6626){_0xa99787=_0x4e6626[_0xd505('0x6d')];if(!_0x34fcd7[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0xbf2aae[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0x34fcd7['query'][_0xd505('0x2a')]);_0xbf2aae[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x34fcd7[_0xd505('0x47')]['offset']);}return _0x4dd94d[_0xd505('0xc5')](_0xbf2aae);}})[_0xd505('0x1d')](function(_0x3d0dc6){if(_0x3d0dc6){return _0x3d0dc6?{'count':_0xa99787,'rows':_0x3d0dc6}:null;}})['then'](respondWithResult(_0x2e4d45,null))[_0xd505('0x24')](handleError(_0x2e4d45,null));};exports[_0xd505('0xc6')]=function(_0x505818,_0x50afce,_0x12ba40){var _0x5b8d7c={};var _0x173199={};var _0x5c3ef9;var _0xd57e0c;return db['User']['findOne']({'where':{'id':_0x505818[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x50afce,null))[_0xd505('0x1d')](function(_0x2b2a77){if(_0x2b2a77){_0x5c3ef9=_0x2b2a77;_0x173199[_0xd505('0x45')]=_[_0xd505('0x48')](db[_0xd505('0xc7')][_0xd505('0x43')]);_0x173199[_0xd505('0x47')]=_[_0xd505('0x48')](_0x505818[_0xd505('0x47')]);_0x173199[_0xd505('0x49')]=_['intersection'](_0x173199[_0xd505('0x45')],_0x173199[_0xd505('0x47')]);_0x5b8d7c[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x173199[_0xd505('0x45')],qs['fields'](_0x505818[_0xd505('0x47')][_0xd505('0x4b')]));_0x5b8d7c[_0xd505('0x4c')]=_0x5b8d7c['attributes'][_0xd505('0x6d')]?_0x5b8d7c[_0xd505('0x4c')]:_0x173199[_0xd505('0x45')];_0x5b8d7c[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x505818[_0xd505('0x47')]['sort']);_0x5b8d7c['where']=qs['filters'](_['pick'](_0x505818[_0xd505('0x47')],_0x173199[_0xd505('0x49')]));if(_0x505818['query'][_0xd505('0x50')]){_0x5b8d7c[_0xd505('0x4e')]=_['merge'](_0x5b8d7c[_0xd505('0x4e')],{'$or':_['map'](_0x5b8d7c[_0xd505('0x4c')],function(_0x2b41d1){var _0x29c738={};_0x29c738[_0x2b41d1]={'$like':'%'+_0x505818['query'][_0xd505('0x50')]+'%'};return _0x29c738;})});}_0x5b8d7c=_['merge']({},_0x5b8d7c,_0x505818[_0xd505('0x5b')]);return _0x5c3ef9[_0xd505('0xc6')](_0x5b8d7c);}})[_0xd505('0x1d')](function(_0xc66a86){if(_0xc66a86){_0xd57e0c=_0xc66a86[_0xd505('0x6d')];if(!_0x505818[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0x5b8d7c['limit']=qs[_0xd505('0x2a')](_0x505818[_0xd505('0x47')][_0xd505('0x2a')]);_0x5b8d7c[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x505818[_0xd505('0x47')]['offset']);}return _0x5c3ef9[_0xd505('0xc6')](_0x5b8d7c);}})[_0xd505('0x1d')](function(_0x4be073){if(_0x4be073){return _0x4be073?{'count':_0xd57e0c,'rows':_0x4be073}:null;}})['then'](respondWithResult(_0x50afce,null))[_0xd505('0x24')](handleError(_0x50afce,null));};exports['getMailInteractions']=function(_0x3bab46,_0x5804bc,_0x2ea1a6){var _0x2505be={'raw':!![],'where':{}};var _0x777fbb={};var _0x3534db={'count':0x0,'rows':[]};return db[_0xd505('0x42')]['findOne']({'where':{'id':_0x3bab46[_0xd505('0x58')]['id']}})['then'](handleEntityNotFound(_0x5804bc,null))[_0xd505('0x1d')](function(_0x3eeb59){if(_0x3eeb59){_0x777fbb[_0xd505('0x45')]=_[_0xd505('0x48')](db['MailInteraction'][_0xd505('0x43')]);_0x777fbb[_0xd505('0x47')]=_[_0xd505('0x48')](_0x3bab46[_0xd505('0x47')]);_0x777fbb[_0xd505('0x49')]=_['intersection'](_0x777fbb[_0xd505('0x45')],_0x777fbb[_0xd505('0x47')]);_0x2505be[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x777fbb['model'],qs[_0xd505('0x4b')](_0x3bab46[_0xd505('0x47')][_0xd505('0x4b')]));_0x2505be[_0xd505('0x4c')]=_0x2505be['attributes'][_0xd505('0x6d')]?_0x2505be[_0xd505('0x4c')]:_0x777fbb['model'];if(!_0x3bab46[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0x2505be[_0xd505('0x2a')]=qs['limit'](_0x3bab46[_0xd505('0x47')][_0xd505('0x2a')]);_0x2505be[_0xd505('0x29')]=qs['offset'](_0x3bab46['query'][_0xd505('0x29')]);}_0x2505be[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x3bab46[_0xd505('0x47')][_0xd505('0xb4')]);_0x2505be[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x3bab46[_0xd505('0x47')],_0x777fbb[_0xd505('0x49')]));_0x2505be['where'][_0xd505('0xc2')]=_0x3eeb59['id'];if(_0x3bab46[_0xd505('0x47')]['filter']){_0x2505be[_0xd505('0x4e')]=_['merge'](_0x2505be['where'],{'$or':_[_0xd505('0x37')](_0x2505be[_0xd505('0x4c')],function(_0x3103ce){var _0x2664bd={};_0x2664bd[_0x3103ce]={'$like':'%'+_0x3bab46[_0xd505('0x47')][_0xd505('0x50')]+'%'};return _0x2664bd;})});}_0x2505be=_[_0xd505('0x51')]({},_0x2505be,_0x3bab46[_0xd505('0x5b')]);return db[_0xd505('0xc8')]['count']({'where':_0x2505be[_0xd505('0x4e')]})[_0xd505('0x1d')](function(_0x82b96e){_0x3534db['count']=_0x82b96e;if(_0x3bab46[_0xd505('0x47')][_0xd505('0x55')]){_0x2505be[_0xd505('0x5a')]=[{'all':!![]}];}return db[_0xd505('0xc8')]['findAll'](_0x2505be);})[_0xd505('0x1d')](function(_0x352060){_0x3534db[_0xd505('0x56')]=_0x352060;return _0x3534db;});}})[_0xd505('0x1d')](respondWithFilteredResult(_0x5804bc,_0x2505be))[_0xd505('0x24')](handleError(_0x5804bc,null));};exports[_0xd505('0xc9')]=function(_0x45a050,_0xc9a699,_0xcc59d2){var _0xd088b9={};var _0x4d810d={};var _0xe65d57;var _0x54180d;return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x45a050[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0xc9a699,null))[_0xd505('0x1d')](function(_0x3572ae){if(_0x3572ae){_0xe65d57=_0x3572ae;_0x4d810d['model']=_[_0xd505('0x48')](db[_0xd505('0xca')][_0xd505('0x43')]);_0x4d810d[_0xd505('0x47')]=_[_0xd505('0x48')](_0x45a050['query']);_0x4d810d[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x4d810d[_0xd505('0x45')],_0x4d810d[_0xd505('0x47')]);_0xd088b9[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x4d810d[_0xd505('0x45')],qs['fields'](_0x45a050[_0xd505('0x47')][_0xd505('0x4b')]));_0xd088b9[_0xd505('0x4c')]=_0xd088b9[_0xd505('0x4c')]['length']?_0xd088b9[_0xd505('0x4c')]:_0x4d810d[_0xd505('0x45')];_0xd088b9[_0xd505('0xb3')]=qs[_0xd505('0xb4')](_0x45a050[_0xd505('0x47')]['sort']);_0xd088b9[_0xd505('0x4e')]=qs[_0xd505('0x49')](_['pick'](_0x45a050[_0xd505('0x47')],_0x4d810d[_0xd505('0x49')]));if(_0x45a050[_0xd505('0x47')][_0xd505('0x50')]){_0xd088b9[_0xd505('0x4e')]=_[_0xd505('0x51')](_0xd088b9[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0xd088b9[_0xd505('0x4c')],function(_0x1f1a2a){var _0x163776={};_0x163776[_0x1f1a2a]={'$like':'%'+_0x45a050[_0xd505('0x47')]['filter']+'%'};return _0x163776;})});}_0xd088b9=_[_0xd505('0x51')]({},_0xd088b9,_0x45a050[_0xd505('0x5b')]);return _0xe65d57[_0xd505('0xc9')](_0xd088b9);}})[_0xd505('0x1d')](function(_0x43e2ed){if(_0x43e2ed){_0x54180d=_0x43e2ed[_0xd505('0x6d')];if(!_0x45a050[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0xd088b9[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0x45a050['query'][_0xd505('0x2a')]);_0xd088b9[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x45a050[_0xd505('0x47')][_0xd505('0x29')]);}return _0xe65d57['getSmsInteractions'](_0xd088b9);}})[_0xd505('0x1d')](function(_0x335893){if(_0x335893){return _0x335893?{'count':_0x54180d,'rows':_0x335893}:null;}})[_0xd505('0x1d')](respondWithResult(_0xc9a699,null))[_0xd505('0x24')](handleError(_0xc9a699,null));};exports[_0xd505('0xcb')]=function(_0x13283c,_0x26db1e,_0x132f6d){var _0x5be54e={};var _0x3fe2d0={};var _0x2a6cb2;var _0x24860a;return db['User'][_0xd505('0x86')]({'where':{'id':_0x13283c['params']['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x26db1e,null))[_0xd505('0x1d')](function(_0x5ec17b){if(_0x5ec17b){_0x2a6cb2=_0x5ec17b;_0x3fe2d0[_0xd505('0x45')]=_['keys'](db[_0xd505('0xcc')][_0xd505('0x43')]);_0x3fe2d0[_0xd505('0x47')]=_['keys'](_0x13283c[_0xd505('0x47')]);_0x3fe2d0[_0xd505('0x49')]=_['intersection'](_0x3fe2d0[_0xd505('0x45')],_0x3fe2d0[_0xd505('0x47')]);_0x5be54e[_0xd505('0x4c')]=_['intersection'](_0x3fe2d0[_0xd505('0x45')],qs['fields'](_0x13283c[_0xd505('0x47')][_0xd505('0x4b')]));_0x5be54e[_0xd505('0x4c')]=_0x5be54e[_0xd505('0x4c')]['length']?_0x5be54e[_0xd505('0x4c')]:_0x3fe2d0[_0xd505('0x45')];_0x5be54e[_0xd505('0xb3')]=qs['sort'](_0x13283c[_0xd505('0x47')]['sort']);_0x5be54e['where']=qs['filters'](_[_0xd505('0x4f')](_0x13283c[_0xd505('0x47')],_0x3fe2d0[_0xd505('0x49')]));if(_0x13283c['query'][_0xd505('0x50')]){_0x5be54e[_0xd505('0x4e')]=_[_0xd505('0x51')](_0x5be54e[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x5be54e[_0xd505('0x4c')],function(_0x2a128f){var _0x243b1a={};_0x243b1a[_0x2a128f]={'$like':'%'+_0x13283c['query'][_0xd505('0x50')]+'%'};return _0x243b1a;})});}_0x5be54e=_['merge']({},_0x5be54e,_0x13283c[_0xd505('0x5b')]);return _0x2a6cb2['getFaxInteractions'](_0x5be54e);}})['then'](function(_0x381c64){if(_0x381c64){_0x24860a=_0x381c64[_0xd505('0x6d')];if(!_0x13283c[_0xd505('0x47')][_0xd505('0x4d')](_0xd505('0xb9'))){_0x5be54e[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0x13283c[_0xd505('0x47')]['limit']);_0x5be54e[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x13283c[_0xd505('0x47')]['offset']);}return _0x2a6cb2[_0xd505('0xcb')](_0x5be54e);}})[_0xd505('0x1d')](function(_0x48b634){if(_0x48b634){return _0x48b634?{'count':_0x24860a,'rows':_0x48b634}:null;}})[_0xd505('0x1d')](respondWithResult(_0x26db1e,null))[_0xd505('0x24')](handleError(_0x26db1e,null));};exports['login']=function(_0x55b382,_0x1c1e7d,_0xfd5d92){var _0x493928;var _0xc2997b;var _0x178934;var _0x21aad5=!_[_0xd505('0x6b')](_0x55b382[_0xd505('0x58')]['id'])?_0x55b382[_0xd505('0x58')]['id']:!_[_0xd505('0x6b')](_0x55b382[_0xd505('0x31')]['id'])?_0x55b382[_0xd505('0x31')]['id']:null;return db[_0xd505('0x42')]['find']({'where':{'id':_0x21aad5,'role':{'$or':[_0xd505('0x8c'),'user',_0xd505('0x33')]}},'attributes':['id','name',_0xd505('0xcd'),'mobile',_0xd505('0x3a'),_0xd505('0x6a'),'loginInPause']})[_0xd505('0x1d')](function(_0x287cfc){if(_0x287cfc){if(_0x287cfc[_0xd505('0x3a')]===_0xd505('0x33')){_0x493928=_0x287cfc;if(_0x55b382['body'][_0xd505('0x93')]){_0x178934=util['format'](_0xd505('0xce'),_0x493928[_0x55b382['body']['interface']]);}else if(_0x55b382[_0xd505('0x5d')][_0xd505('0xcf')]){_0x178934=util[_0xd505('0x64')](_0xd505('0xd0'),_0x55b382[_0xd505('0x5d')]['intrf']);}else{_0x178934=util[_0xd505('0x64')](_0xd505('0xd0'),_0x493928['name']);}socket['to'](util[_0xd505('0x64')](_0xd505('0xd1'),_0x493928[_0xd505('0x3c')]))[_0xd505('0xd2')](_0xd505('0xd3'),{'ip':_0x55b382['headers'][_0xd505('0xd4')]||_0x55b382[_0xd505('0xd5')][_0xd505('0xd6')]||_0x55b382[_0xd505('0xd7')][_0xd505('0xd6')]||_0x55b382[_0xd505('0xd5')][_0xd505('0xd7')][_0xd505('0xd6')]});return db[_0xd505('0xa2')][_0xd505('0xa6')]({'where':{'membername':_0x493928['name']},'individualHooks':!![]});}}else{throw new db[(_0xd505('0x19'))][(_0xd505('0x1a'))](_0xd505('0xd8'));}})[_0xd505('0x1d')](function(){if(_0x493928){return _0x493928[_0xd505('0xd9')]({'raw':!![]});}})[_0xd505('0x1d')](function(_0x57c923){if(_0x493928){var _0x4d5eee=[];if(_0x57c923){_0xc2997b=_0x57c923;if(_0xc2997b['length']){for(var _0x419d8f=0x0;_0x419d8f<_0xc2997b[_0xd505('0x6d')];_0x419d8f++){_0x4d5eee[_0xd505('0x9f')]({'membername':_0x493928[_0xd505('0x3c')],'UserId':_0x493928['id'],'queue_name':_0xc2997b[_0x419d8f][_0xd505('0x3c')],'VoiceQueueId':_0xc2997b[_0x419d8f]['id'],'interface':_0x178934,'paused':_0x493928[_0xd505('0x91')]||![],'penalty':_0xc2997b[_0x419d8f][_0xd505('0xda')]||0x0});}return BPromise[_0xd505('0xa1')](_0x4d5eee,function(_0x15798d){return db[_0xd505('0xa2')][_0xd505('0xa3')](_0x15798d);});}}}})['then'](function(){if(_0x493928){return db[_0xd505('0xdb')]['findAll']({'where':{'membername':_0x493928[_0xd505('0x3c')],'exitAt':null}});}})[_0xd505('0x1d')](function(_0x59c5d3){if(_0x493928){var _0x563a47=[];_0x59c5d3[_0xd505('0xdc')](function(_0x3cdc1c){_0x563a47[_0xd505('0x9f')](_0x3cdc1c[_0xd505('0x2e')]({'exitAt':moment()[_0xd505('0x64')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x563a47);}})['then'](function(){if(_0x493928){var _0x50701f=[];var _0x2a2c71=[];var _0x493d9a=utils[_0xd505('0xdd')]();var _0x16328c={'membername':_0x493928['name'],'interface':_0x178934,'enterAt':moment()[_0xd505('0x64')](_0xd505('0xde')),'role':_0x493928[_0xd505('0x3a')],'internal':_0x493928[_0xd505('0x6a')]};_0x493d9a['forEach'](function(_0x7ee34f){_0x50701f[_0xd505('0x9f')](_[_0xd505('0x51')]({'channel':_0x7ee34f,'type':_0xd505('0xdf'),'data1':_0x55b382[_0xd505('0x5d')][_0xd505('0xe0')],'data2':_0x178934},_0x16328c));if(_0x493928[_0xd505('0x91')]){_0x2a2c71[_0xd505('0x9f')](_[_0xd505('0x51')]({'channel':_0x7ee34f,'type':_0xd505('0xe1'),'data1':_0xd505('0xe2')},_0x16328c));}});return db[_0xd505('0xdb')]['bulkCreate'](_0x50701f[_0xd505('0xe3')](_0x2a2c71),{'individualHooks':!![]});}})[_0xd505('0x1d')](function(){if(_0x493928){return _0x493928['update']({'online':!![],'lastLoginAt':moment()['format'](_0xd505('0xde')),'voicePause':_0x493928[_0xd505('0x91')]||![],'mailPause':_0x493928[_0xd505('0x91')]||![],'chatPause':_0x493928[_0xd505('0x91')]||![],'faxPause':_0x493928[_0xd505('0x91')]||![],'smsPause':_0x493928[_0xd505('0x91')]||![],'openchannelPause':_0x493928[_0xd505('0x91')]||![],'pauseType':_0x493928[_0xd505('0x91')]?_0xd505('0xe2'):null,'interface':_0x178934,'lastPauseAt':moment()[_0xd505('0x64')](_0xd505('0xde'))});}})[_0xd505('0x1d')](function(_0x22ae12){if(_0x55b382['isMiddleware']){return _0xfd5d92();}else{return BPromise[_0xd505('0xe4')](_0x22ae12)[_0xd505('0x1d')](respondWithResult(_0x1c1e7d,null));}})['catch'](handleError(_0x1c1e7d,null));};exports[_0xd505('0xe5')]=function(_0x15e64c,_0x560ef0,_0x41b344){var _0x17315c;return db[_0xd505('0x42')][_0xd505('0x3b')]({'where':{'id':_0x15e64c[_0xd505('0x58')]['id'],'role':_0xd505('0x33')},'attributes':['id','name',_0xd505('0x3a')]})[_0xd505('0x1d')](handleEntityNotFound(_0x560ef0,null))[_0xd505('0x1d')](function(_0x22c657){if(_0x22c657){_0x17315c=_0x22c657;return db[_0xd505('0xa2')][_0xd505('0xa6')]({'where':{'membername':_0x17315c['name']},'individualHooks':!![]});}})[_0xd505('0x1d')](function(){return db[_0xd505('0xdb')][_0xd505('0xbd')]({'where':{'membername':_0x17315c[_0xd505('0x3c')],'exitAt':null}});})['then'](function(_0xfe39dc){var _0x27066b=[];_0xfe39dc[_0xd505('0xdc')](function(_0x3eedbc){_0x27066b[_0xd505('0x9f')](_0x3eedbc[_0xd505('0x2e')]({'exitAt':moment()[_0xd505('0x64')](_0xd505('0xde'))}));});return BPromise[_0xd505('0xe6')](_0x27066b);})[_0xd505('0x1d')](function(){return _0x17315c[_0xd505('0x2e')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xd505('0x1d')](respondWithResult(_0x560ef0,null))['catch'](handleError(_0x560ef0,null));};exports[_0xd505('0xe7')]=function(_0xa7e4c0,_0x3bf4cd,_0x3d75f6){var _0x4f8cb5;return db['UserVoiceQueueRt']['update']({'paused':0x1},{'where':{'UserId':_0xa7e4c0[_0xd505('0x58')]['id']},'individualHooks':!![]})[_0xd505('0x1d')](function(){return db[_0xd505('0x42')][_0xd505('0x3b')]({'where':{'id':_0xa7e4c0[_0xd505('0x58')]['id'],'role':_0xd505('0x33')},'attributes':['id',_0xd505('0x3c'),_0xd505('0x3a'),'internal','interface']});})[_0xd505('0x1d')](handleEntityNotFound(_0x3bf4cd,null))[_0xd505('0x1d')](function(_0x53f9c9){if(_0x53f9c9){_0x4f8cb5=_0x53f9c9;return respondWithRpcPromise(_0xd505('0xe8'),'pause',{'id':_0x4f8cb5['id'],'name':_0x4f8cb5['name'],'pause':!![]});}})[_0xd505('0x1d')](function(){if(_0x4f8cb5){return db['MemberReport'][_0xd505('0xbd')]({'where':{'membername':_0x4f8cb5[_0xd505('0x3c')],'type':'PAUSE','exitAt':null}});}})[_0xd505('0x1d')](function(_0x45da17){if(_0x45da17[_0xd505('0x6d')]){var _0x4dba89=moment()['format'](_0xd505('0xde'));for(var _0x28ec45=0x0,_0x53db0b=_0x45da17['length'];_0x28ec45<_0x53db0b;_0x28ec45++){_0x45da17[_0x28ec45][_0xd505('0xe9')]({'exitAt':_0x4dba89});}}})[_0xd505('0x1d')](function(){var _0x432ef0=[];var _0x4b4d2b=utils[_0xd505('0xdd')]();_0x4b4d2b[_0xd505('0xdc')](function(_0x13ebf3){_0x432ef0['push']({'channel':_0x13ebf3,'membername':_0x4f8cb5[_0xd505('0x3c')],'interface':_['isNil'](_0x4f8cb5[_0xd505('0x93')])?util[_0xd505('0x64')](_0xd505('0xd0'),_0x4f8cb5['name']):_0x4f8cb5['interface'],'type':_0xd505('0xe1'),'enterAt':moment()[_0xd505('0x64')](_0xd505('0xde')),'data1':_0xa7e4c0[_0xd505('0x5d')][_0xd505('0x52')]||_0xd505('0xea'),'role':_0x4f8cb5[_0xd505('0x3a')],'internal':_0x4f8cb5[_0xd505('0x6a')]});});return db[_0xd505('0xdb')]['bulkCreate'](_0x432ef0,{'individualHooks':!![]});})['then'](function(){return _0x4f8cb5[_0xd505('0x2e')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xa7e4c0['body']['type']||_0xd505('0xea'),'lastPauseAt':moment()['format'](_0xd505('0xde'))});})[_0xd505('0x1d')](respondWithResult(_0x3bf4cd,null))[_0xd505('0x24')](handleError(_0x3bf4cd,null));};exports[_0xd505('0xeb')]=function(_0x8464d,_0x58d773,_0x2912cf){var _0x5ec772;return db[_0xd505('0x42')]['find']({'where':{'id':_0x8464d[_0xd505('0x58')]['id']},'attributes':['id','name',_0xd505('0x3a'),_0xd505('0x92'),_0xd505('0xec'),'chatPause','faxPause','openchannelPause','smsPause',_0xd505('0xed'),_0xd505('0xee')]})[_0xd505('0x1d')](handleEntityNotFound(_0x58d773,null))[_0xd505('0x1d')](function(_0x5e1d3e){if(_0x5e1d3e){_0x5ec772=_0x5e1d3e;if(_0x8464d['body'][_0xd505('0x8f')]&&!utils[_0xd505('0x94')](_0x8464d['body'][_0xd505('0x8f')])){throw new db[(_0xd505('0x19'))]['ValidationError'](_0xd505('0x95'));}switch(_0x8464d[_0xd505('0x5d')][_0xd505('0x8f')]){case'voice':return respondWithRpcPromise(_0xd505('0xe8'),_0xd505('0xeb'),{'id':_0x5ec772['id'],'name':_0x5ec772[_0xd505('0x3c')],'pause':![]})['then'](function(){return db[_0xd505('0xa2')][_0xd505('0x2e')]({'paused':0x0},{'where':{'UserId':_0x5ec772['id']},'individualHooks':!![]});})[_0xd505('0x1d')](function(){return db['MemberReport']['find']({'where':{'channel':_0x8464d[_0xd505('0x5d')][_0xd505('0x8f')],'membername':_0x5ec772[_0xd505('0x3c')],'type':_0xd505('0xe1'),'exitAt':null}});})['then'](function(_0x8087b9){if(_0x8087b9){return _0x8087b9['update']({'exitAt':moment()[_0xd505('0x64')](_0xd505('0xde')),'data2':_0xd505('0xef')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x5ec772['update']({'voicePause':![]});});case _0xd505('0xf0'):case _0xd505('0xf1'):case _0xd505('0xf2'):case _0xd505('0xf3'):case _0xd505('0xf4'):return db[_0xd505('0xdb')][_0xd505('0x3b')]({'where':{'channel':_0x8464d[_0xd505('0x5d')][_0xd505('0x8f')],'membername':_0x5ec772[_0xd505('0x3c')],'type':_0xd505('0xe1'),'exitAt':null}})[_0xd505('0x1d')](function(_0x571805){if(_0x571805){return _0x571805[_0xd505('0x2e')]({'exitAt':moment()[_0xd505('0x64')](_0xd505('0xde')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xd505('0x1d')](function(){var _0x3b3241={};_[_0xd505('0xf5')](_0x3b3241,util['format'](_0xd505('0xf6'),_0x8464d[_0xd505('0x5d')]['channel'],_0xd505('0xf7')),![]);return _0x5ec772[_0xd505('0x2e')](_0x3b3241);});default:return respondWithRpcPromise(_0xd505('0xe8'),_0xd505('0xeb'),{'id':_0x5ec772['id'],'name':_0x5ec772[_0xd505('0x3c')],'pause':![]})[_0xd505('0x1d')](function(){return db[_0xd505('0xa2')][_0xd505('0x2e')]({'paused':0x0},{'where':{'UserId':_0x5ec772['id']}});})[_0xd505('0x1d')](function(){return db[_0xd505('0xdb')]['findAll']({'where':{'membername':_0x5ec772[_0xd505('0x3c')],'type':_0xd505('0xe1'),'exitAt':null}});})[_0xd505('0x1d')](function(_0xbd7d89){var _0x57810c=[];_0xbd7d89[_0xd505('0xdc')](function(_0x4397a0){_0x57810c[_0xd505('0x9f')](_0x4397a0[_0xd505('0x2e')]({'exitAt':moment()[_0xd505('0x64')](_0xd505('0xde')),'data2':'manual'}));});return BPromise[_0xd505('0xe6')](_0x57810c);})[_0xd505('0x1d')](function(){return _0x5ec772[_0xd505('0x2e')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xd505('0x1d')](respondWithResult(_0x58d773,null))['catch'](handleError(_0x58d773,null));};exports[_0xd505('0xf8')]=function(_0xf4d789,_0x4e6cb9,_0x3e9d61){var _0x2af0b6={};var _0x5c5731={};var _0x43f090;var _0x6f2049;return db[_0xd505('0x42')]['findOne']({'where':{'id':_0xf4d789[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x4e6cb9,null))['then'](function(_0x59bb6f){if(_0x59bb6f){_0x43f090=_0x59bb6f;_0x5c5731['model']=_[_0xd505('0x48')](db[_0xd505('0xf9')][_0xd505('0x43')]);_0x5c5731[_0xd505('0x47')]=_[_0xd505('0x48')](_0xf4d789[_0xd505('0x47')]);_0x5c5731[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x5c5731['model'],_0x5c5731[_0xd505('0x47')]);_0x2af0b6[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x5c5731[_0xd505('0x45')],qs['fields'](_0xf4d789[_0xd505('0x47')][_0xd505('0x4b')]));_0x2af0b6[_0xd505('0x4c')]=_0x2af0b6[_0xd505('0x4c')]['length']?_0x2af0b6['attributes']:_0x5c5731['model'];_0x2af0b6[_0xd505('0xb3')]=qs['sort'](_0xf4d789['query'][_0xd505('0xb4')]);_0x2af0b6[_0xd505('0x4e')]=qs['filters'](_[_0xd505('0x4f')](_0xf4d789[_0xd505('0x47')],_0x5c5731['filters']));if(_0xf4d789['query'][_0xd505('0x50')]){_0x2af0b6[_0xd505('0x4e')]=_['merge'](_0x2af0b6[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x2af0b6[_0xd505('0x4c')],function(_0x18e6f5){var _0x17a283={};_0x17a283[_0x18e6f5]={'$like':'%'+_0xf4d789[_0xd505('0x47')]['filter']+'%'};return _0x17a283;})});}_0x2af0b6=_[_0xd505('0x51')]({},_0x2af0b6,_0xf4d789[_0xd505('0x5b')]);return _0x43f090[_0xd505('0xf8')](_0x2af0b6);}})[_0xd505('0x1d')](function(_0x4472d2){if(_0x4472d2){_0x6f2049=_0x4472d2[_0xd505('0x6d')];if(!_0xf4d789['query']['hasOwnProperty']('nolimit')){_0x2af0b6[_0xd505('0x2a')]=qs[_0xd505('0x2a')](_0xf4d789[_0xd505('0x47')][_0xd505('0x2a')]);_0x2af0b6[_0xd505('0x29')]=qs[_0xd505('0x29')](_0xf4d789[_0xd505('0x47')][_0xd505('0x29')]);}return _0x43f090[_0xd505('0xf8')](_0x2af0b6);}})[_0xd505('0x1d')](function(_0x525c8b){if(_0x525c8b){return _0x525c8b?{'count':_0x6f2049,'rows':_0x525c8b}:null;}})[_0xd505('0x1d')](respondWithResult(_0x4e6cb9,null))[_0xd505('0x24')](handleError(_0x4e6cb9,null));};exports[_0xd505('0xfa')]=function(_0x3192be,_0x41e846){return db[_0xd505('0x42')]['find']({'where':{'id':_0x3192be[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x41e846,null))[_0xd505('0x1d')](function(_0x16d30a){if(_0x16d30a){var _0x3e2089=_0x16d30a[_0xd505('0x2f')]({'plain':!![]});return _0x16d30a[_0xd505('0xfa')](_0x3192be[_0xd505('0x5d')][_0xd505('0x60')],_[_0xd505('0xfb')](_0x3192be[_0xd505('0x5d')],[_0xd505('0x60'),'id'])||{})[_0xd505('0x1d')](function(){for(var _0x1f2ce6=0x0;_0x1f2ce6<_0x3192be[_0xd505('0x5d')][_0xd505('0x60')]['length'];_0x1f2ce6++){var _0x25bbd4=[];db[_0xd505('0xf9')][_0xd505('0x86')]({'where':{'id':_0x3192be[_0xd505('0x5d')]['ids'][_0x1f2ce6]}})[_0xd505('0x1d')](function(_0x56ef0a){_0x25bbd4[_0xd505('0x9f')](_0x56ef0a[_0xd505('0xd9')]()[_0xd505('0x1d')](function(_0x1941ec){for(var _0x5cc84a=0x0;_0x5cc84a<_0x1941ec[_0xd505('0x6d')];_0x5cc84a++){_0x1941ec[_0x5cc84a][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0xfd'));}return _0x1941ec;}));_0x25bbd4[_0xd505('0x9f')](_0x56ef0a[_0xd505('0xfe')]()[_0xd505('0x1d')](function(_0x3195b6){for(var _0x53f3fc=0x0;_0x53f3fc<_0x3195b6['length'];_0x53f3fc++){_0x3195b6[_0x53f3fc]['setDataValue'](_0xd505('0x8f'),'Chat');}return _0x3195b6;}));_0x25bbd4[_0xd505('0x9f')](_0x56ef0a[_0xd505('0xff')]()[_0xd505('0x1d')](function(_0x54f4c2){for(var _0x1f8a4a=0x0;_0x1f8a4a<_0x54f4c2[_0xd505('0x6d')];_0x1f8a4a++){_0x54f4c2[_0x1f8a4a][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0x100'));}return _0x54f4c2;}));_0x25bbd4[_0xd505('0x9f')](_0x56ef0a[_0xd505('0x101')]()[_0xd505('0x1d')](function(_0x253426){for(var _0x7f2848=0x0;_0x7f2848<_0x253426['length'];_0x7f2848++){_0x253426[_0x7f2848][_0xd505('0xfc')]('channel',_0xd505('0x102'));}return _0x253426;}));_0x25bbd4[_0xd505('0x9f')](_0x56ef0a['getFaxQueues']()[_0xd505('0x1d')](function(_0x2534ad){for(var _0x35ac30=0x0;_0x35ac30<_0x2534ad[_0xd505('0x6d')];_0x35ac30++){_0x2534ad[_0x35ac30][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0x103'));}return _0x2534ad;}));_0x25bbd4[_0xd505('0x9f')](_0x56ef0a[_0xd505('0x104')]()[_0xd505('0x1d')](function(_0x3bdd47){for(var _0x71668f=0x0;_0x71668f<_0x3bdd47[_0xd505('0x6d')];_0x71668f++){_0x3bdd47[_0x71668f][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0x105'));}return _0x3bdd47;}));return BPromise[_0xd505('0xe6')](_0x25bbd4);})[_0xd505('0x1d')](function(_0xccde2a){var _0x4a5a61=_[_0xd505('0x106')](_0xccde2a);_0x25bbd4=[];return db['sequelize'][_0xd505('0x107')](function(_0x38be54){for(var _0x182a00=0x0;_0x182a00<_0x4a5a61[_0xd505('0x6d')];_0x182a00++){_0x25bbd4[_0xd505('0x9f')](_0x4a5a61[_0x182a00][_0xd505('0x108')](_0x3e2089['id']),{'transaction':_0x38be54});}return BPromise['all'](_0x25bbd4)[_0xd505('0x1d')](function(){if(_0x3e2089[_0xd505('0x90')]){return BPromise[_0xd505('0xa1')](_[_0xd505('0x50')](_0x4a5a61,function(_0x4fd98a){return _0x4fd98a[_0xd505('0x109')](_0xd505('0x8f'))===_0xd505('0xfd');}),function(_0x4a9f04){return db['UserVoiceQueueRt']['upsert']({'membername':_0x3e2089[_0xd505('0x3c')],'UserId':_0x3e2089['id'],'queue_name':_0x4a9f04[_0xd505('0x3c')],'VoiceQueueId':_0x4a9f04['id'],'interface':_[_0xd505('0x6b')](_0x3e2089[_0xd505('0x93')])?util[_0xd505('0x64')](_0xd505('0xd0'),_0x3e2089['name']):_0x3e2089[_0xd505('0x93')],'paused':_0x3e2089['voicePause']||![],'penalty':_0x3e2089['penalty']},{'transaction':_0x38be54});});}else{return;}})[_0xd505('0x1d')](function(){for(var _0x20f8d4=0x0;_0x20f8d4<_0x4a5a61['length'];_0x20f8d4++){var _0x472e99=_0x4a5a61[_0x20f8d4][_0xd505('0x109')](_0xd505('0x8f'));var _0x1004f1=_0x472e99+_0xd505('0x9b');socket[_0xd505('0xd2')](_0xd505('0x31')+_0x472e99+'Queue:save',{'UserId':_0x3e2089['id'],['queueField']:_0x4a5a61[_0x20f8d4]['id']});}});});});}});}})[_0xd505('0x1d')](respondWithStatusCode(_0x41e846,null))[_0xd505('0x24')](handleError(_0x41e846,null));};exports['removeTeams']=function(_0x106b79,_0x52cf3c){return db[_0xd505('0x42')][_0xd505('0x86')]({'where':{'id':_0x106b79['params']['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x52cf3c,null))['then'](function(_0x40cf6b){if(_0x40cf6b){var _0x462a5e=_0x40cf6b[_0xd505('0x2f')]({'plain':!![]});var _0x5d2a42=_0x106b79[_0xd505('0x47')][_0xd505('0x60')];return _0x40cf6b['removeTeams'](_0x5d2a42)[_0xd505('0x1d')](function(){for(var _0x4758ea=0x0;_0x4758ea<_0x5d2a42[_0xd505('0x6d')];_0x4758ea++){var _0x48e29f=[];db[_0xd505('0xf9')][_0xd505('0x86')]({'where':{'id':_0x5d2a42[_0x4758ea]}})['then'](function(_0x2b6409){_0x48e29f[_0xd505('0x9f')](_0x2b6409[_0xd505('0xd9')]()[_0xd505('0x1d')](function(_0x280bcb){for(var _0x219b9d=0x0;_0x219b9d<_0x280bcb['length'];_0x219b9d++){_0x280bcb[_0x219b9d][_0xd505('0xfc')](_0xd505('0x8f'),'Voice');}return _0x280bcb;}));_0x48e29f[_0xd505('0x9f')](_0x2b6409[_0xd505('0xfe')]()[_0xd505('0x1d')](function(_0x1c9e9a){for(var _0x77fd28=0x0;_0x77fd28<_0x1c9e9a[_0xd505('0x6d')];_0x77fd28++){_0x1c9e9a[_0x77fd28][_0xd505('0xfc')]('channel',_0xd505('0x10a'));}return _0x1c9e9a;}));_0x48e29f[_0xd505('0x9f')](_0x2b6409['getMailQueues']()[_0xd505('0x1d')](function(_0x4b34e3){for(var _0x5e3cae=0x0;_0x5e3cae<_0x4b34e3[_0xd505('0x6d')];_0x5e3cae++){_0x4b34e3[_0x5e3cae]['setDataValue']('channel',_0xd505('0x100'));}return _0x4b34e3;}));_0x48e29f[_0xd505('0x9f')](_0x2b6409['getSmsQueues']()[_0xd505('0x1d')](function(_0x2138df){for(var _0xec3fba=0x0;_0xec3fba<_0x2138df[_0xd505('0x6d')];_0xec3fba++){_0x2138df[_0xec3fba][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0x102'));}return _0x2138df;}));_0x48e29f[_0xd505('0x9f')](_0x2b6409[_0xd505('0x10b')]()[_0xd505('0x1d')](function(_0x1cac45){for(var _0x6c8020=0x0;_0x6c8020<_0x1cac45[_0xd505('0x6d')];_0x6c8020++){_0x1cac45[_0x6c8020][_0xd505('0xfc')](_0xd505('0x8f'),_0xd505('0x103'));}return _0x1cac45;}));_0x48e29f[_0xd505('0x9f')](_0x2b6409['getOpenchannelQueues']()[_0xd505('0x1d')](function(_0x26bb18){for(var _0x2af1a=0x0;_0x2af1a<_0x26bb18[_0xd505('0x6d')];_0x2af1a++){_0x26bb18[_0x2af1a][_0xd505('0xfc')](_0xd505('0x8f'),'Openchannel');}return _0x26bb18;}));return BPromise[_0xd505('0xe6')](_0x48e29f);})[_0xd505('0x1d')](function(_0x2094a7){var _0x5a8321=_['flatten'](_0x2094a7);_0x48e29f=[];return db[_0xd505('0x53')][_0xd505('0x107')](function(_0x3a4a1a){for(var _0x58b4cc=0x0;_0x58b4cc<_0x5a8321[_0xd505('0x6d')];_0x58b4cc++){_0x48e29f[_0xd505('0x9f')](_0x5a8321[_0x58b4cc][_0xd505('0x10c')](_0x462a5e['id']),{'transaction':_0x3a4a1a});}return BPromise[_0xd505('0xe6')](_0x48e29f)[_0xd505('0x1d')](function(){if(_0x462a5e[_0xd505('0x90')]){return BPromise[_0xd505('0xa1')](_['filter'](_0x5a8321,function(_0xfbc654){return _0xfbc654[_0xd505('0x109')](_0xd505('0x8f'))===_0xd505('0xfd');}),function(_0x7bb4e1){return db['UserVoiceQueueRt'][_0xd505('0xa6')]({'where':{'VoiceQueueId':_0x7bb4e1['id'],'UserId':_0x462a5e['id']},'transaction':_0x3a4a1a});});}else{return;}})[_0xd505('0x1d')](function(){for(var _0x29286=0x0;_0x29286<_0x5a8321[_0xd505('0x6d')];_0x29286++){var _0xd34b84=_0x5a8321[_0x29286][_0xd505('0x109')]('channel');var _0xc79c43=_0xd34b84+_0xd505('0x9b');socket[_0xd505('0xd2')](_0xd505('0x31')+_0xd34b84+_0xd505('0xa5'),{'UserId':_0x462a5e['id'],['queueField']:_0x5a8321[_0x29286]['id']});}});});});}});}})[_0xd505('0x1d')](respondWithStatusCode(_0x52cf3c,null))['catch'](handleError(_0x52cf3c,null));};exports[_0xd505('0x10d')]=function(_0x12951d,_0x483a68,_0x5e5041){var _0x362c55={};var _0x5b770b={};var _0x450112;var _0x36f04a;return db['User'][_0xd505('0x86')]({'where':{'id':_0x12951d[_0xd505('0x58')]['id']}})[_0xd505('0x1d')](handleEntityNotFound(_0x483a68,null))[_0xd505('0x1d')](function(_0x264d5c){if(_0x264d5c){_0x450112=_0x264d5c;_0x5b770b[_0xd505('0x45')]=_['keys'](db[_0xd505('0xb5')][_0xd505('0x43')]);_0x5b770b[_0xd505('0x47')]=_['keys'](_0x12951d[_0xd505('0x47')]);_0x5b770b[_0xd505('0x49')]=_[_0xd505('0x4a')](_0x5b770b[_0xd505('0x45')],_0x5b770b[_0xd505('0x47')]);_0x362c55[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x5b770b[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x12951d['query']['fields']));_0x362c55[_0xd505('0x4c')]=_0x362c55[_0xd505('0x4c')][_0xd505('0x6d')]?_0x362c55[_0xd505('0x4c')]:_0x5b770b[_0xd505('0x45')];_0x362c55['order']=qs[_0xd505('0xb4')](_0x12951d[_0xd505('0x47')][_0xd505('0xb4')]);_0x362c55['where']=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x12951d[_0xd505('0x47')],_0x5b770b['filters']));if(_0x12951d[_0xd505('0x47')][_0xd505('0x50')]){_0x362c55['where']=_['merge'](_0x362c55[_0xd505('0x4e')],{'$or':_[_0xd505('0x37')](_0x362c55[_0xd505('0x4c')],function(_0x166a84){var _0x24ff14={};_0x24ff14[_0x166a84]={'$like':'%'+_0x12951d['query'][_0xd505('0x50')]+'%'};return _0x24ff14;})});}_0x362c55=_['merge']({},_0x362c55,_0x12951d[_0xd505('0x5b')]);return _0x450112[_0xd505('0x10d')](_0x362c55);}})['then'](function(_0x4496ca){if(_0x4496ca){_0x36f04a=_0x4496ca[_0xd505('0x6d')];if(!_0x12951d[_0xd505('0x47')]['hasOwnProperty'](_0xd505('0xb9'))){_0x362c55['limit']=qs[_0xd505('0x2a')](_0x12951d['query']['limit']);_0x362c55[_0xd505('0x29')]=qs[_0xd505('0x29')](_0x12951d[_0xd505('0x47')][_0xd505('0x29')]);}return _0x450112[_0xd505('0x10d')](_0x362c55);}})[_0xd505('0x1d')](function(_0x53cf74){if(_0x53cf74){return _0x53cf74?{'count':_0x36f04a,'rows':_0x53cf74}:null;}})[_0xd505('0x1d')](respondWithResult(_0x483a68,null))[_0xd505('0x24')](handleError(_0x483a68,null));};exports['getAgents']=function(_0x5363c3,_0x502bf2,_0x2a9c8d){var _0x3f5526={};var _0x3e2efb={};var _0x5dada4;var _0x5323eb;return db['User'][_0xd505('0x86')]({'where':{'id':_0x5363c3[_0xd505('0x58')]['id']}})['then'](handleEntityNotFound(_0x502bf2,null))['then'](function(_0x260650){if(_0x260650){_0x5dada4=_0x260650;_0x3e2efb['model']=_['keys'](db[_0xd505('0x42')]['rawAttributes']);_0x3e2efb['query']=_[_0xd505('0x48')](_0x5363c3[_0xd505('0x47')]);_0x3e2efb['filters']=_['intersection'](_0x3e2efb[_0xd505('0x45')],_0x3e2efb[_0xd505('0x47')]);_0x3f5526[_0xd505('0x4c')]=_[_0xd505('0x4a')](_0x3e2efb[_0xd505('0x45')],qs[_0xd505('0x4b')](_0x5363c3[_0xd505('0x47')][_0xd505('0x4b')]));_0x3f5526[_0xd505('0x4c')]=_0x3f5526[_0xd505('0x4c')][_0xd505('0x6d')]?_0x3f5526[_0xd505('0x4c')]:_0x3e2efb[_0xd505('0x45')];_0x3f5526[_0xd505('0xb3')]=qs['sort'](_0x5363c3[_0xd505('0x47')][_0xd505('0xb4')]);_0x3f5526[_0xd505('0x4e')]=qs[_0xd505('0x49')](_[_0xd505('0x4f')](_0x5363c3[_0xd505('0x47')],_0x3e2efb[_0xd505('0x49')]));if(_0x5363c3[_0xd505('0x47')][_0xd505('0x50')]){_0x3f5526[_0xd505('0x4e')]=_['merge'](_0x3f5526['where'],{'$or':_[_0xd505('0x37')](_0x3f5526[_0xd505('0x4c')],function(_0x209bee){var _0x3f0a00={};_0x3f0a00[_0x209bee]={'$like':'%'+_0x5363c3[_0xd505('0x47')][_0xd505('0x50')]+'%'};return _0x3f0a00;})});}_0x3f5526['model']=db[_0xd505('0x42')];_0x3f5526['as']='Agents';_0x3f5526=_[_0xd505('0x51')]({},_0x3f5526,_0x5363c3[_0xd505('0x5b')]);return _0x5dada4[_0xd505('0xd9')]({'include':[_0x3f5526]});}})[_0xd505('0x1d')](function(_0x30463a){if(_0x30463a){var _0x2f988f={},_0x1597c3=[],_0x4eb6b3=0x0;for(var _0x4d56c1=0x0;_0x4d56c1<_0x30463a[_0xd505('0x6d')];_0x4d56c1+=0x1){for(var _0x5a0992=0x0,_0x2c9b0e;_0x5a0992<_0x30463a[_0x4d56c1]['Agents'][_0xd505('0x6d')];_0x5a0992+=0x1){_0x2c9b0e=_0x30463a[_0x4d56c1][_0xd505('0x32')][_0x5a0992][_0xd505('0x2f')]({'plain':!![]});_0x2f988f[_0x2c9b0e['id']]=_0x2c9b0e;}}_0x2f988f=_['values'](_0x2f988f);for(var _0x26752a=qs[_0xd505('0x29')](_0x5363c3[_0xd505('0x47')][_0xd505('0x29')]);_0x26752a<_0x2f988f[_0xd505('0x6d')]&&_0x1597c3['length']=_0x530abb){_0x326d23=_0x530abb;_0x264c7c=0xc8;}else{_0x264c7c=0xce;}_0x5cc35d['status'](_0x264c7c);return _0x5cc35d[_0x52ff('0x36')](_0x52ff('0x37'),_0x2d1cba+'-'+_0x326d23+'/'+_0x530abb)[_0x52ff('0x32')](_0x3c3b6d);}return null;};}function patchUpdates(_0x35f605){return function(_0x52206b){try{jsonpatch[_0x52ff('0x38')](_0x52206b,_0x35f605,!![]);}catch(_0x37067a){return BPromise['reject'](_0x37067a);}return _0x52206b[_0x52ff('0x39')]();};}function saveUpdates(_0x4757f6,_0x13fcaf){return function(_0x213d18){if(_0x213d18){return _0x213d18['update'](_0x4757f6)[_0x52ff('0x24')](function(_0x529415){return _0x529415;});}return null;};}function removeEntity(_0x30f096,_0x23decc){return function(_0x56988b){if(_0x56988b){return _0x56988b[_0x52ff('0x3a')]()[_0x52ff('0x24')](function(){var _0x3c2617=_0x56988b['get']({'plain':!![]});var _0x4f3d97=[{'name':_0x52ff('0x3b'),'value':'user','ignore':!![]},{'name':_0x52ff('0x3c'),'value':'agent','ignore':![]},{'name':_0x52ff('0x3d'),'value':_0x52ff('0x3e'),'ignore':![]}];var _0x59643f=_(_0x4f3d97)[_0x52ff('0x3f')](_0x52ff('0x40'))[_0x52ff('0x41')](_0x52ff('0x42'))[_0x52ff('0x42')]();if(_[_0x52ff('0x43')](_0x59643f,_0x3c2617[_0x52ff('0x44')])){return;}var _0x544e96=_[_0x52ff('0x45')](_0x4f3d97,[_0x52ff('0x42'),_0x3c2617[_0x52ff('0x44')]])[_0x52ff('0x46')];return db[_0x52ff('0x47')][_0x52ff('0x3a')]({'where':{'type':_0x544e96,'resourceId':_0x3c2617['id']}})[_0x52ff('0x24')](function(){return _0x56988b;});})['then'](function(){_0x30f096[_0x52ff('0x30')](0xcc)[_0x52ff('0x31')]();});}};}function handleEntityNotFound(_0xf2f766,_0x51a54f){return function(_0x57f2e5){if(!_0x57f2e5){_0xf2f766[_0x52ff('0x2f')](0x194);}return _0x57f2e5;};}function handleError(_0x4a6700,_0x2cff58){_0x2cff58=_0x2cff58||0x1f4;return function(_0xbbfef8){logger[_0x52ff('0x2b')](_0xbbfef8[_0x52ff('0x48')]);if(_0xbbfef8[_0x52ff('0x46')]){delete _0xbbfef8[_0x52ff('0x46')];}_0x4a6700[_0x52ff('0x30')](_0x2cff58)[_0x52ff('0x49')](_0xbbfef8);};}exports[_0x52ff('0x4a')]=function(_0x501a2f,_0x34b0dc){var _0x1cf8ee={},_0x5a5c37={},_0x970a20={'count':0x0,'rows':[]};var _0x1ff341=_[_0x52ff('0x41')](db[_0x52ff('0x4b')][_0x52ff('0x4c')],function(_0x17325e){return{'name':_0x17325e[_0x52ff('0x4d')],'type':_0x17325e['type'][_0x52ff('0x4e')]};});_0x5a5c37[_0x52ff('0x4f')]=_[_0x52ff('0x50')](_[_0x52ff('0x41')](_0x1ff341,'name'),['password',_0x52ff('0x51')]);_0x5a5c37[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x501a2f[_0x52ff('0x52')]);_0x5a5c37[_0x52ff('0x54')]=_['intersection'](_0x5a5c37[_0x52ff('0x4f')],_0x5a5c37[_0x52ff('0x52')]);_0x1cf8ee[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x5a5c37[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x501a2f[_0x52ff('0x52')][_0x52ff('0x57')]));_0x1cf8ee[_0x52ff('0x55')]=_0x1cf8ee[_0x52ff('0x55')]['length']?_0x1cf8ee[_0x52ff('0x55')]:_0x5a5c37[_0x52ff('0x4f')];if(!_0x501a2f[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x1cf8ee['limit']=qs[_0x52ff('0x35')](_0x501a2f[_0x52ff('0x52')]['limit']);_0x1cf8ee[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x501a2f[_0x52ff('0x52')][_0x52ff('0x34')]);}_0x1cf8ee['order']=qs['sort'](_0x501a2f[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x1cf8ee[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x501a2f[_0x52ff('0x52')],_0x5a5c37[_0x52ff('0x54')]));if(_0x501a2f['query']['filter']){_0x1cf8ee[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x1cf8ee[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x1ff341,function(_0x3ab361){if(_0x3ab361[_0x52ff('0x5e')]!==_0x52ff('0x5f')){return db[_0x52ff('0x60')][_0x52ff('0x5b')](db['sequelize']['fn'](_0x52ff('0x61'),db[_0x52ff('0x60')][_0x52ff('0x62')](_0x3ab361[_0x52ff('0x46')])),{'$like':db[_0x52ff('0x60')]['fn']('lower','%'+_0x501a2f[_0x52ff('0x52')][_0x52ff('0x3f')]+'%')});}})});}_0x1cf8ee=_[_0x52ff('0x5d')]({},_0x1cf8ee,_0x501a2f[_0x52ff('0x63')]);var _0x48c884={'where':_0x1cf8ee[_0x52ff('0x5b')]};return db[_0x52ff('0x4b')][_0x52ff('0x33')](_0x48c884)[_0x52ff('0x24')](function(_0x4479c1){_0x970a20[_0x52ff('0x33')]=_0x4479c1;if(_0x501a2f['query'][_0x52ff('0x64')]){_0x1cf8ee['include']=[{'all':!![]}];}return db[_0x52ff('0x4b')][_0x52ff('0x65')](_0x1cf8ee);})[_0x52ff('0x24')](function(_0x1445cf){_0x970a20['rows']=_0x1445cf;return _0x970a20;})[_0x52ff('0x24')](respondWithFilteredResult(_0x34b0dc,_0x1cf8ee))['catch'](handleError(_0x34b0dc,null));};exports[_0x52ff('0x66')]=function(_0x5f4fdc,_0x5003d0){var _0x431cd0={'raw':![],'where':{'id':_0x5f4fdc['params']['id']}},_0x225e3c={};_0x225e3c[_0x52ff('0x4f')]=_['differenceBy'](_[_0x52ff('0x53')](db['User'][_0x52ff('0x4c')]),[_0x52ff('0x67'),_0x52ff('0x51')]);_0x225e3c[_0x52ff('0x52')]=_['keys'](_0x5f4fdc[_0x52ff('0x52')]);_0x225e3c[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x225e3c[_0x52ff('0x4f')],_0x225e3c[_0x52ff('0x52')]);_0x431cd0[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x225e3c['model'],qs['fields'](_0x5f4fdc['query']['fields']));_0x431cd0[_0x52ff('0x55')]=_0x431cd0[_0x52ff('0x55')][_0x52ff('0x68')]?_0x431cd0[_0x52ff('0x55')]:_0x225e3c[_0x52ff('0x4f')];if(_0x5f4fdc[_0x52ff('0x52')]['includeAll']){_0x431cd0[_0x52ff('0x69')]=[{'all':!![]}];}_0x431cd0=_[_0x52ff('0x5d')]({},_0x431cd0,_0x5f4fdc[_0x52ff('0x63')]);return db[_0x52ff('0x4b')][_0x52ff('0x45')](_0x431cd0)[_0x52ff('0x24')](handleEntityNotFound(_0x5003d0,null))['then'](respondWithResult(_0x5003d0,null))[_0x52ff('0x2e')](handleError(_0x5003d0,null));};exports[_0x52ff('0x6a')]=function(_0xf826df,_0x42fadc){return db[_0x52ff('0x4b')][_0x52ff('0x6a')](_0xf826df[_0x52ff('0x6b')],{'raw':![],'individualHooks':!![]})[_0x52ff('0x24')](respondWithResult(_0x42fadc,0xc9))[_0x52ff('0x2e')](handleError(_0x42fadc,null));};exports[_0x52ff('0x6c')]=function(_0x280b32,_0x18471f){if(_0x280b32[_0x52ff('0x6b')]['id']){delete _0x280b32[_0x52ff('0x6b')]['id'];}delete _0x280b32['body'][_0x52ff('0x44')];return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x280b32[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x18471f,null))[_0x52ff('0x24')](saveUpdates(_0x280b32[_0x52ff('0x6b')],null))['then'](respondWithResult(_0x18471f,null))[_0x52ff('0x2e')](handleError(_0x18471f,null));};exports[_0x52ff('0x6e')]=function(_0x259441,_0x377a58){return db['User'][_0x52ff('0x6e')]()[_0x52ff('0x24')](respondWithResult(_0x377a58,null))[_0x52ff('0x2e')](handleError(_0x377a58,null));};exports[_0x52ff('0x6f')]=function(_0x3efb00,_0x3143a8,_0x4c07f4){return db['User'][_0x52ff('0x45')]({'where':{'id':_0x3efb00[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x3143a8,null))[_0x52ff('0x24')](function(_0x1eed57){if(_0x1eed57){return _0x1eed57[_0x52ff('0x6f')](_0x3efb00[_0x52ff('0x6b')][_0x52ff('0x70')],_[_0x52ff('0x71')](_0x3efb00['body'],['ids','id'])||{});}})[_0x52ff('0x24')](respondWithResult(_0x3143a8,null))[_0x52ff('0x2e')](handleError(_0x3143a8,null));};var getLicense=function(_0x14f6d0){return new BPromise(function(_0x33d8fe,_0xef16d6){var _0x3abae0=0x0;_0x14f6d0[_0x52ff('0x6b')][_0x52ff('0x44')]===_0x52ff('0x72')&&_0x33d8fe(_0x52ff('0x73'));return db['User']['count']({'where':{'$or':[{'role':_0x14f6d0[_0x52ff('0x6b')][_0x52ff('0x44')]===_0x52ff('0x3e')?_0x52ff('0x3e'):[_0x52ff('0x74'),_0x52ff('0x75')]}]}})[_0x52ff('0x24')](function(_0x1a5147){_0x3abae0=_0x1a5147;return require(_0x52ff('0x76'))[_0x52ff('0x77')]();})['then'](function(_0x1fabf8){var _0x18c357=_0x14f6d0[_0x52ff('0x6b')][_0x52ff('0x44')]===_0x52ff('0x3e')?_0x52ff('0x78'):'users';if(!_[_0x52ff('0x79')](_0x1fabf8[_0x18c357])&&_0x3abae0>=_0x1fabf8[_0x18c357]){return _0xef16d6({'message':'License\x20limit\x20reached'});}return _0x33d8fe(util[_0x52ff('0x7a')]('count\x20%s:\x20%s',_0x18c357,_0x3abae0));})['catch'](function(_0xc33c26){return _0xef16d6(_0xc33c26);});});};exports[_0x52ff('0x7b')]=function(_0x51da79,_0x46378a){return getLicense(_0x51da79)[_0x52ff('0x24')](function(_0xc55b89){if(!_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]){var _0x5ae700;return db[_0x52ff('0x7d')][_0x52ff('0x7e')](0x1)[_0x52ff('0x24')](function(_0x39d146){return checkPasswordPattern(_0x39d146,_0x51da79['body'][_0x52ff('0x67')],_0x39d146[_0x52ff('0x7f')]);})[_0x52ff('0x24')](function(_0x14fec8){_0x5ae700=_0x14fec8['min_internal'];return db['User'][_0x52ff('0x80')](_0x52ff('0x7c'));})[_0x52ff('0x24')](function(_0x269267){if(_[_0x52ff('0x79')](_0x269267)){if(_0x5ae700){_0x51da79[_0x52ff('0x6b')]['internal']=_0x5ae700;}else{_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=0x1;}}else{if(_[_0x52ff('0x79')](_0x5ae700)||_0x5ae700==_0x269267){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=_0x269267+0x1;}else if(_0x5ae700>_0x269267){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=_0x5ae700;}else{return db['sequelize'][_0x52ff('0x52')]('select\x20(select\x20IFNULL(max(internal)+1,1)\x20from\x20users\x20where\x20internal\x20<\x20md.internal)\x20as\x20\x27from\x27,\x20md.internal\x20-\x201\x20as\x20\x27to\x27\x20from\x20users\x20md\x20where\x20md.internal\x20!=\x201\x20and\x20not\x20exists\x20(select\x201\x20from\x20users\x20md2\x20where\x20md2.internal\x20=\x20md.internal\x20-\x201)',{'type':db[_0x52ff('0x60')][_0x52ff('0x81')][_0x52ff('0x82')]})[_0x52ff('0x24')](function(_0x33ba1f){if(_0x33ba1f&&_0x33ba1f[_0x52ff('0x68')]){for(var _0x253d95=0x0,_0x497149=_0x33ba1f[_0x52ff('0x68')];_0x253d95<_0x497149&&_[_0x52ff('0x79')](_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]);_0x253d95++){if(_0x5ae700<=_0x33ba1f[_0x253d95]['from']){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=_0x33ba1f[_0x253d95]['from'];}else if(_0x5ae700>_0x33ba1f[_0x253d95][_0x52ff('0x83')]&&_0x5ae700<=_0x33ba1f[_0x253d95]['to']){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=_0x5ae700;}}}if(_[_0x52ff('0x79')](_0x51da79[_0x52ff('0x6b')]['internal'])){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')]=_0x269267+0x1;}});}}});}})[_0x52ff('0x24')](function(){if(_0x51da79[_0x52ff('0x6b')][_0x52ff('0x84')]){_0x51da79[_0x52ff('0x6b')][_0x52ff('0x85')]=_0x51da79[_0x52ff('0x6b')]['internal'];_0x51da79[_0x52ff('0x6b')][_0x52ff('0x86')]={'mailbox':_0x51da79[_0x52ff('0x6b')][_0x52ff('0x7c')],'password':_0x51da79[_0x52ff('0x6b')]['password'],'fullname':_0x51da79[_0x52ff('0x6b')][_0x52ff('0x87')],'email':_0x51da79['body'][_0x52ff('0x88')]};}if(_0x51da79['body']&&_0x51da79[_0x52ff('0x6b')][_0x52ff('0x44')]==='agent'){_0x51da79['body'][_0x52ff('0x89')]=[_0x52ff('0x8a'),_0x52ff('0x8b'),_0x52ff('0x8c'),_0x52ff('0x8d'),_0x52ff('0x8e'),_0x52ff('0x8f'),_0x52ff('0x90'),_0x52ff('0x91'),'108',_0x52ff('0x92'),_0x52ff('0x93'),_0x52ff('0x94')];}return db[_0x52ff('0x4b')][_0x52ff('0x7b')](_0x51da79[_0x52ff('0x6b')],{'include':[{'model':db[_0x52ff('0x86')],'as':_0x52ff('0x86')}]});})['then'](function(_0x37526e){if(_0x51da79[_0x52ff('0x6b')][_0x52ff('0x44')]===_0x52ff('0x75'))return _0x37526e;var _0x4db09d=_0x51da79[_0x52ff('0x75')][_0x52ff('0x95')]({'plain':!![]});if(!_0x4db09d)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4db09d['role']===_0x52ff('0x75')){var _0x3d1e19=_0x37526e[_0x52ff('0x95')]({'plain':!![]});var _0x477efb=[{'name':'Agents','value':_0x52ff('0x72')},{'name':_0x52ff('0x3d'),'value':_0x52ff('0x3e')}];var _0x2dc8a4=_[_0x52ff('0x45')](_0x477efb,[_0x52ff('0x42'),_0x3d1e19[_0x52ff('0x44')]])[_0x52ff('0x46')];return db[_0x52ff('0x96')][_0x52ff('0x45')]({'where':{'name':_0x2dc8a4,'userProfileId':_0x4db09d['userProfileId']},'raw':!![]})[_0x52ff('0x24')](function(_0x3e51ce){if(_0x3e51ce&&_0x3e51ce[_0x52ff('0x97')]===0x0){return db[_0x52ff('0x47')][_0x52ff('0x7b')]({'name':_0x3d1e19[_0x52ff('0x46')],'resourceId':_0x3d1e19['id'],'type':_0x3e51ce[_0x52ff('0x46')],'sectionId':_0x3e51ce['id']},{})[_0x52ff('0x24')](function(){return _0x37526e;});}else{return _0x37526e;}})[_0x52ff('0x2e')](function(_0xcc8a3){logger[_0x52ff('0x2b')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0xcc8a3);throw _0xcc8a3;});}return _0x37526e;})[_0x52ff('0x24')](respondWithResult(_0x46378a,0xc9))[_0x52ff('0x2e')](handleError(_0x46378a,null));};exports[_0x52ff('0x98')]=function(_0x4d6bce,_0x4bab0b,_0x3c2b1b){var _0xab1753=![];if(_0x4d6bce[_0x52ff('0x6b')]['id']){delete _0x4d6bce[_0x52ff('0x6b')]['id'];}return db[_0x52ff('0x7d')]['findOne']({'attributes':['id',_0x52ff('0x7f')]})[_0x52ff('0x24')](function(_0xc89df0){_0xab1753=_0xc89df0[_0x52ff('0x7f')];return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x4d6bce[_0x52ff('0x6d')]['id']}});})[_0x52ff('0x24')](function(_0x450f2f){if(_0x450f2f){if(_0x450f2f['id']==_0x4d6bce[_0x52ff('0x75')]['id']){if(!_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x99')]||!_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x9a')]){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0x9b'));}if(!_0x450f2f[_0x52ff('0x9c')](_0x4d6bce['body'][_0x52ff('0x99')])){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0x9d'));}if(_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x99')]==_0x4d6bce['body']['newPassword']){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0x9e'));}return _0x450f2f;}else if(_0x4d6bce[_0x52ff('0x75')]['role']==_0x52ff('0x74')){if(!_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x9a')]){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0x9f'));}return _0x450f2f;}else if(_0x4d6bce[_0x52ff('0x75')][_0x52ff('0x44')]==_0x52ff('0x75')){if(!_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x9a')]){throw new db['Sequelize'][(_0x52ff('0x21'))](_0x52ff('0x9f'));}if(_0x450f2f['role']!=_0x52ff('0x72')){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0xa0'));}return _0x450f2f;}else{throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))]('Unauthorized');}}return null;})[_0x52ff('0x24')](handleEntityNotFound(_0x4bab0b,null))['then'](function(_0x13259e){return checkPasswordPattern(_0x13259e,_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x9a')],_0xab1753);})[_0x52ff('0x24')](saveUpdates({'password':_0x4d6bce[_0x52ff('0x6b')][_0x52ff('0x9a')],'passwordResetAt':_0x4d6bce['user']['id']==_0x4d6bce[_0x52ff('0x6d')]['id']?moment():null},null))[_0x52ff('0x24')](respondWithResult(_0x4bab0b,null))[_0x52ff('0x2e')](handleError(_0x4bab0b,null));};exports[_0x52ff('0xa1')]=function(_0x53a605,_0x317d50,_0xf063d3){var _0x1fe421=_0x53a605[_0x52ff('0x6b')]['channel'];return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x53a605[_0x52ff('0x6d')]['id']},'attributes':['id',_0x52ff('0x46'),_0x52ff('0x44'),_0x52ff('0xa2'),_0x52ff('0xa3'),_0x52ff('0xa4'),_0x52ff('0xa5')]})[_0x52ff('0x24')](handleEntityNotFound(_0x317d50,null))[_0x52ff('0x24')](function(_0x525cbc){if(_0x525cbc){if(!utils[_0x52ff('0xa6')](_0x1fe421)){throw new db[(_0x52ff('0x20'))]['ValidationError'](_0x52ff('0xa7'));}return _0x525cbc[_0x52ff('0xa8')+_[_0x52ff('0xa9')](_0x1fe421[_0x52ff('0xaa')]())+_0x52ff('0xab')](_0x53a605[_0x52ff('0x6b')][_0x52ff('0x70')],{'penalty':_0x53a605[_0x52ff('0x6b')][_0x52ff('0xac')]||0x0})[_0x52ff('0xad')](function(_0x50e9e7){for(var _0x30d7ef=0x0;_0x30d7ef<_0x53a605['body'][_0x52ff('0x70')][_0x52ff('0x68')];_0x30d7ef+=0x1){var _0x1a5054={'UserId':_0x53a605[_0x52ff('0x6d')]['id']};_0x1a5054[_[_0x52ff('0xa9')](_0x1fe421[_0x52ff('0xaa')]())+_0x52ff('0xae')]=_0x53a605[_0x52ff('0x6b')][_0x52ff('0x70')][_0x30d7ef];socket['emit'](_0x52ff('0x75')+_['capitalize'](_0x1fe421[_0x52ff('0xaa')]())+'Queue:save',_0x1a5054);}return _0x50e9e7;})[_0x52ff('0x24')](function(){if(_0x1fe421===_0x52ff('0xaf')){return db['VoiceQueue'][_0x52ff('0x65')]({'where':{'id':_0x53a605['body'][_0x52ff('0x70')]||[]},'raw':!![],'attributes':['id',_0x52ff('0x46')]});}})['then'](function(_0x1eba94){var _0x14cb0c=_0x525cbc[_0x52ff('0x95')]({'plain':!![]});var _0x65223d=[];if(_0x1fe421===_0x52ff('0xaf')&&_0x14cb0c[_0x52ff('0x44')]===_0x52ff('0x72')&&_0x14cb0c['online']){for(var _0x38b4e0=0x0;_0x38b4e0<_0x1eba94[_0x52ff('0x68')];_0x38b4e0+=0x1){_0x65223d[_0x52ff('0xb0')]({'membername':_0x14cb0c['name'],'UserId':_0x14cb0c['id'],'queue_name':_0x1eba94[_0x38b4e0]['name'],'VoiceQueueId':_0x1eba94[_0x38b4e0]['id'],'interface':_[_0x52ff('0x79')](_0x14cb0c[_0x52ff('0xa5')])?util[_0x52ff('0x7a')](_0x52ff('0xb1'),_0x14cb0c[_0x52ff('0x46')]):_0x14cb0c['interface'],'paused':_0x14cb0c[_0x52ff('0xa4')]||![],'penalty':_0x53a605['body'][_0x52ff('0xac')]||0x0});}return BPromise[_0x52ff('0xb2')](_0x65223d,function(_0x2a6a6f){return db[_0x52ff('0xb3')][_0x52ff('0xb4')](_0x2a6a6f);});}return _0x525cbc;});}})[_0x52ff('0x24')](respondWithStatusCode(_0x317d50,null))[_0x52ff('0x2e')](handleError(_0x317d50,null));};exports['removeQueues']=function(_0x34d7f5,_0x3f2b28,_0x4049dc){var _0x32bb6f;return db[_0x52ff('0x4b')]['find']({'where':{'id':_0x34d7f5[_0x52ff('0x6d')]['id']},'attributes':['id',_0x52ff('0x46'),_0x52ff('0x44')]})[_0x52ff('0x24')](handleEntityNotFound(_0x3f2b28,null))[_0x52ff('0x24')](function(_0x4eee3e){if(_0x4eee3e){_0x32bb6f=_0x4eee3e;if(!_0x34d7f5[_0x52ff('0x52')][_0x52ff('0xb5')]||!utils[_0x52ff('0xa6')](_0x34d7f5['query'][_0x52ff('0xb5')])){throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))](_0x52ff('0xa7'));}return _0x4eee3e[_0x52ff('0xb6')+_[_0x52ff('0xa9')](_0x34d7f5[_0x52ff('0x52')][_0x52ff('0xb5')][_0x52ff('0xaa')]())+'Queues'](_0x34d7f5[_0x52ff('0x52')]['ids']);}})[_0x52ff('0x24')](function(_0x50b3fb){for(var _0x259338=0x0;_0x259338<_0x34d7f5[_0x52ff('0x52')][_0x52ff('0x70')][_0x52ff('0x68')];_0x259338+=0x1){var _0x2d9a68={'UserId':_0x34d7f5[_0x52ff('0x6d')]['id']};_0x2d9a68[_[_0x52ff('0xa9')](_0x34d7f5['query'][_0x52ff('0xb5')][_0x52ff('0xaa')]())+'QueueId']=_0x34d7f5[_0x52ff('0x52')][_0x52ff('0x70')][_0x259338];socket[_0x52ff('0xb7')](_0x52ff('0x75')+_[_0x52ff('0xa9')](_0x34d7f5[_0x52ff('0x52')][_0x52ff('0xb5')][_0x52ff('0xaa')]())+_0x52ff('0xb8'),_0x2d9a68);}return _0x50b3fb;})['then'](function(){if(_0x34d7f5[_0x52ff('0x52')]['channel']===_0x52ff('0xaf')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x34d7f5[_0x52ff('0x6d')]['id'],'VoiceQueueId':_0x34d7f5[_0x52ff('0x52')][_0x52ff('0x70')]},'individualHooks':!![]})[_0x52ff('0x24')](function(){return _0x32bb6f;});}return _0x32bb6f;})[_0x52ff('0x24')](respondWithStatusCode(_0x3f2b28,null))['catch'](handleError(_0x3f2b28,null));};exports[_0x52ff('0xb9')]=function(_0x252aea,_0x401588,_0x4d41b4){_0x252aea['body'][_0x52ff('0xba')]=_0x252aea['file'][_0x52ff('0xbb')];return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x252aea[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x401588,null))[_0x52ff('0x24')](saveUpdates(_0x252aea[_0x52ff('0x6b')],null))['then'](respondWithResult(_0x401588,null))[_0x52ff('0x2e')](handleError(_0x401588,null));};exports[_0x52ff('0xbc')]=function(_0x448f0a,_0x5076fb,_0xf73f54){var _0x13fecb=path[_0x52ff('0xbd')](config['root'],'server/files/images/logos/default_profile.png');return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x448f0a[_0x52ff('0x6d')]['id']},'attributes':['id',_0x52ff('0xba')],'raw':!![]})[_0x52ff('0x24')](handleEntityNotFound(_0x5076fb,null))[_0x52ff('0x24')](function(_0x1f16d1){if(_0x1f16d1){if(_[_0x52ff('0x79')](_0x1f16d1[_0x52ff('0xba')])){return _0x5076fb[_0x52ff('0xbe')](_0x13fecb);}else{if(!fs['existsSync'](path['join'](config[_0x52ff('0xbf')],_0x52ff('0xc0'),_0x1f16d1[_0x52ff('0xba')]))){return _0x5076fb[_0x52ff('0xbe')](_0x13fecb);}return _0x5076fb[_0x52ff('0xbe')](path[_0x52ff('0xbd')](config[_0x52ff('0xbf')],_0x52ff('0xc0'),_0x1f16d1[_0x52ff('0xba')]));}}})['catch'](handleError(_0x5076fb,null));};exports[_0x52ff('0xc1')]=function(_0x10da19,_0x452595,_0x240b4f){var _0x197460={};var _0x1d6ac0={};var _0x3c6146;var _0x26ce46;return db['User'][_0x52ff('0xc2')]({'where':{'id':_0x10da19[_0x52ff('0x6d')]['id']}})['then'](handleEntityNotFound(_0x452595,null))['then'](function(_0x4f7c06){if(_0x4f7c06){_0x3c6146=_0x4f7c06;_0x1d6ac0['model']=_[_0x52ff('0x53')](db['CmContact'][_0x52ff('0x4c')]);_0x1d6ac0[_0x52ff('0x52')]=_['keys'](_0x10da19[_0x52ff('0x52')]);_0x1d6ac0[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x1d6ac0[_0x52ff('0x4f')],_0x1d6ac0[_0x52ff('0x52')]);_0x197460[_0x52ff('0x55')]=_['intersection'](_0x1d6ac0[_0x52ff('0x4f')],qs['fields'](_0x10da19[_0x52ff('0x52')][_0x52ff('0x57')]));_0x197460[_0x52ff('0x55')]=_0x197460[_0x52ff('0x55')][_0x52ff('0x68')]?_0x197460['attributes']:_0x1d6ac0[_0x52ff('0x4f')];_0x197460['order']=qs['sort'](_0x10da19[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x197460[_0x52ff('0x5b')]=qs['filters'](_['pick'](_0x10da19[_0x52ff('0x52')],_0x1d6ac0['filters']));if(_0x10da19['query']['filter']){_0x197460[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x197460[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x197460[_0x52ff('0x55')],function(_0x164148){var _0x22f27c={};_0x22f27c[_0x164148]={'$like':'%'+_0x10da19[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x22f27c;})});}_0x197460=_['merge']({},_0x197460,_0x10da19['options']);return _0x3c6146['getContacts'](_0x197460);}})[_0x52ff('0x24')](function(_0x354c4c){if(_0x354c4c){_0x26ce46=_0x354c4c[_0x52ff('0x68')];if(_0x10da19[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x64'))){_0x197460[_0x52ff('0x69')]=[{'model':db['CmList'],'as':_0x52ff('0xc3'),'required':![]},{'model':db[_0x52ff('0xc4')],'as':_0x52ff('0xc5'),'attributes':['id','name',_0x52ff('0xc6')],'where':_0x10da19[_0x52ff('0x52')][_0x52ff('0xc7')]?{'id':_0x10da19[_0x52ff('0x52')][_0x52ff('0xc7')]}:undefined,'required':_0x10da19[_0x52ff('0x52')][_0x52ff('0xc7')]?!![]:![]}];}if(!_0x10da19[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x197460['limit']=qs[_0x52ff('0x35')](_0x10da19[_0x52ff('0x52')][_0x52ff('0x35')]);_0x197460['offset']=qs[_0x52ff('0x34')](_0x10da19[_0x52ff('0x52')][_0x52ff('0x34')]);}return _0x3c6146[_0x52ff('0xc1')](_0x197460);}})['then'](function(_0x3e24b0){if(_0x3e24b0){return _0x3e24b0?{'count':_0x26ce46,'rows':_0x3e24b0}:null;}})['then'](respondWithResult(_0x452595,null))['catch'](handleError(_0x452595,null));};exports[_0x52ff('0xc8')]=function(_0x4bd8d1,_0xfa804c,_0x5c2811){var _0x4a0849;var _0x51a25e;var _0x5eef93={};var _0x385a38;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x4bd8d1[_0x52ff('0x6d')]['id']},'attributes':['id','name',_0x52ff('0x44')]})[_0x52ff('0x24')](handleEntityNotFound(_0xfa804c,null))['then'](function(_0x462f68){if(!utils[_0x52ff('0xa6')](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0xb5')])){throw new db['Sequelize'][(_0x52ff('0x21'))]('Unknown\x20channel');}_0x4a0849=_0x462f68;var _0x44d07e={};_0x44d07e[_0x52ff('0x4f')]=_[_0x52ff('0x53')](db[_['capitalize'](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0xb5')])+_0x52ff('0xc9')][_0x52ff('0x4c')]);_0x44d07e[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x4bd8d1[_0x52ff('0x52')]);_0x44d07e[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x44d07e[_0x52ff('0x4f')],_0x44d07e[_0x52ff('0x52')]);_0x5eef93['attributes']=_[_0x52ff('0x56')](_0x44d07e[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0x57')]));_0x5eef93['attributes']=_0x5eef93['attributes'][_0x52ff('0x68')]?_0x5eef93[_0x52ff('0x55')]:_0x44d07e['model'];_0x5eef93['order']=qs[_0x52ff('0x5a')](_0x4bd8d1['query'][_0x52ff('0x5a')]);_0x5eef93[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x4bd8d1[_0x52ff('0x52')],_0x44d07e['filters']));if(_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x5eef93['where']=_['merge'](_0x5eef93[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x5eef93[_0x52ff('0x55')],function(_0x4c9afa){var _0x2564f5={};_0x2564f5[_0x4c9afa]={'$like':'%'+_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x2564f5;})});}_0x5eef93=_[_0x52ff('0x5d')]({},_0x5eef93,_0x4bd8d1[_0x52ff('0x63')]);switch(_0x4a0849[_0x52ff('0x44')]){case _0x52ff('0x74'):return db[_[_0x52ff('0xa9')](_0x4bd8d1[_0x52ff('0x52')]['channel'])+_0x52ff('0xc9')][_0x52ff('0x65')](_0x5eef93);case _0x52ff('0x75'):case _0x52ff('0x72'):return _0x4a0849[_0x52ff('0x95')+_['capitalize'](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0xb5')])+_0x52ff('0xab')](_0x5eef93);default:throw new db[(_0x52ff('0x20'))][(_0x52ff('0x21'))]('Unknown\x20role');}})[_0x52ff('0x24')](function(_0x5a381a){_0x385a38=_0x5a381a['length'];if(!_0x4bd8d1[_0x52ff('0x52')]['hasOwnProperty'](_0x52ff('0x59'))){_0x5eef93['limit']=qs[_0x52ff('0x35')](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0x35')]);_0x5eef93[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x4bd8d1[_0x52ff('0x52')][_0x52ff('0x34')]);}switch(_0x4a0849[_0x52ff('0x44')]){case _0x52ff('0x74'):return db[_[_0x52ff('0xa9')](_0x4bd8d1[_0x52ff('0x52')]['channel'])+'Queue']['findAll'](_0x5eef93);case _0x52ff('0x75'):case _0x52ff('0x72'):return _0x4a0849[_0x52ff('0x95')+_[_0x52ff('0xa9')](_0x4bd8d1['query'][_0x52ff('0xb5')])+'Queues'](_0x5eef93);}})[_0x52ff('0x24')](function(_0x4c1dbf){return{'count':_0x385a38,'rows':_0x4c1dbf};})[_0x52ff('0x24')](respondWithResult(_0xfa804c,null))[_0x52ff('0x2e')](handleError(_0xfa804c,null));};exports[_0x52ff('0xca')]=function(_0x21622d,_0x51d477,_0x202850){var _0x11c124={};var _0x5c0270={};var _0x524f72;var _0xa6c57e;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x21622d[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x51d477,null))[_0x52ff('0x24')](function(_0x22e376){if(_0x22e376){_0x524f72=_0x22e376;_0x5c0270[_0x52ff('0x4f')]=_['keys'](db[_0x52ff('0xb3')]['rawAttributes']);_0x5c0270[_0x52ff('0x52')]=_['keys'](_0x21622d[_0x52ff('0x52')]);_0x5c0270[_0x52ff('0x54')]=_['intersection'](_0x5c0270[_0x52ff('0x4f')],_0x5c0270[_0x52ff('0x52')]);_0x11c124[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x5c0270[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x21622d['query']['fields']));_0x11c124['attributes']=_0x11c124[_0x52ff('0x55')][_0x52ff('0x68')]?_0x11c124['attributes']:_0x5c0270[_0x52ff('0x4f')];_0x11c124[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x21622d[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x11c124[_0x52ff('0x5b')]=qs['filters'](_[_0x52ff('0x5c')](_0x21622d[_0x52ff('0x52')],_0x5c0270['filters']));if(_0x21622d[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x11c124[_0x52ff('0x5b')]=_['merge'](_0x11c124[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x11c124['attributes'],function(_0x1c67da){var _0x5ae714={};_0x5ae714[_0x1c67da]={'$like':'%'+_0x21622d[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x5ae714;})});}_0x11c124=_[_0x52ff('0x5d')]({},_0x11c124,_0x21622d[_0x52ff('0x63')]);return _0x524f72[_0x52ff('0xca')](_0x11c124);}})['then'](function(_0x3c00b2){if(_0x3c00b2){_0xa6c57e=_0x3c00b2[_0x52ff('0x68')];if(!_0x21622d['query']['hasOwnProperty']('nolimit')){_0x11c124[_0x52ff('0x35')]=qs['limit'](_0x21622d['query'][_0x52ff('0x35')]);_0x11c124[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x21622d['query'][_0x52ff('0x34')]);}return _0x524f72[_0x52ff('0xca')](_0x11c124);}})[_0x52ff('0x24')](function(_0xaf4d9a){if(_0xaf4d9a){return _0xaf4d9a?{'count':_0xa6c57e,'rows':_0xaf4d9a}:null;}})[_0x52ff('0x24')](respondWithResult(_0x51d477,null))[_0x52ff('0x2e')](handleError(_0x51d477,null));};exports[_0x52ff('0xcc')]=function(_0x525575,_0x27708e,_0x37af20){var _0x46ef4b={};var _0x494378={};var _0x8a7090;var _0x165729;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x525575['params']['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x27708e,null))[_0x52ff('0x24')](function(_0x30b325){if(_0x30b325){_0x8a7090=_0x30b325;_0x494378['model']=_[_0x52ff('0x53')](db[_0x52ff('0xcd')][_0x52ff('0x4c')]);_0x494378[_0x52ff('0x52')]=_['keys'](_0x525575[_0x52ff('0x52')]);_0x494378[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x494378[_0x52ff('0x4f')],_0x494378[_0x52ff('0x52')]);_0x46ef4b['attributes']=_[_0x52ff('0x56')](_0x494378[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x525575['query']['fields']));_0x46ef4b[_0x52ff('0x55')]=_0x46ef4b[_0x52ff('0x55')][_0x52ff('0x68')]?_0x46ef4b['attributes']:_0x494378[_0x52ff('0x4f')];_0x46ef4b[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x525575[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x46ef4b[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_['pick'](_0x525575[_0x52ff('0x52')],_0x494378['filters']));if(_0x525575[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x46ef4b[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x46ef4b[_0x52ff('0x5b')],{'$or':_['map'](_0x46ef4b[_0x52ff('0x55')],function(_0x5e6d00){var _0x4010b1={};_0x4010b1[_0x5e6d00]={'$like':'%'+_0x525575['query'][_0x52ff('0x3f')]+'%'};return _0x4010b1;})});}_0x46ef4b=_[_0x52ff('0x5d')]({},_0x46ef4b,_0x525575[_0x52ff('0x63')]);return _0x8a7090[_0x52ff('0xcc')](_0x46ef4b);}})[_0x52ff('0x24')](function(_0x5231a8){if(_0x5231a8){_0x165729=_0x5231a8['length'];if(!_0x525575[_0x52ff('0x52')][_0x52ff('0x58')]('nolimit')){_0x46ef4b['limit']=qs['limit'](_0x525575[_0x52ff('0x52')][_0x52ff('0x35')]);_0x46ef4b[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x525575[_0x52ff('0x52')][_0x52ff('0x34')]);}return _0x8a7090[_0x52ff('0xcc')](_0x46ef4b);}})[_0x52ff('0x24')](function(_0x40d72c){if(_0x40d72c){return _0x40d72c?{'count':_0x165729,'rows':_0x40d72c}:null;}})[_0x52ff('0x24')](respondWithResult(_0x27708e,null))['catch'](handleError(_0x27708e,null));};exports[_0x52ff('0xce')]=function(_0xc26b22,_0x3444f7,_0x4f74f7){var _0x6e9b58={'raw':!![],'where':{}};var _0x3cf149={};var _0x58a7f3={'count':0x0,'rows':[]};return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0xc26b22[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x3444f7,null))['then'](function(_0x47b16c){if(_0x47b16c){_0x3cf149[_0x52ff('0x4f')]=_[_0x52ff('0x53')](db['VoiceRecording'][_0x52ff('0x4c')]);_0x3cf149[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0xc26b22['query']);_0x3cf149['filters']=_[_0x52ff('0x56')](_0x3cf149[_0x52ff('0x4f')],_0x3cf149[_0x52ff('0x52')]);_0x6e9b58['attributes']=_[_0x52ff('0x56')](_0x3cf149[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0xc26b22[_0x52ff('0x52')][_0x52ff('0x57')]));_0x6e9b58['attributes']=_0x6e9b58['attributes']['length']?_0x6e9b58['attributes']:_0x3cf149['model'];if(!_0xc26b22[_0x52ff('0x52')]['hasOwnProperty'](_0x52ff('0x59'))){_0x6e9b58[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0xc26b22['query'][_0x52ff('0x35')]);_0x6e9b58[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0xc26b22[_0x52ff('0x52')][_0x52ff('0x34')]);}_0x6e9b58[_0x52ff('0xcb')]=qs['sort'](_0xc26b22[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x6e9b58['where']=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0xc26b22[_0x52ff('0x52')],_0x3cf149[_0x52ff('0x54')]));_0x6e9b58[_0x52ff('0x5b')]['UserId']=_0x47b16c['id'];if(_0xc26b22[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x6e9b58[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x6e9b58[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x6e9b58['attributes'],function(_0x2cadb2){var _0x2295c2={};_0x2295c2[_0x2cadb2]={'$like':'%'+_0xc26b22[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x2295c2;})});}_0x6e9b58=_[_0x52ff('0x5d')]({},_0x6e9b58,_0xc26b22[_0x52ff('0x63')]);return db[_0x52ff('0xcf')][_0x52ff('0x33')]({'where':_0x6e9b58[_0x52ff('0x5b')]})[_0x52ff('0x24')](function(_0x39c998){_0x58a7f3[_0x52ff('0x33')]=_0x39c998;if(_0xc26b22['query'][_0x52ff('0x64')]){_0x6e9b58['include']=[{'all':!![]}];}return db[_0x52ff('0xcf')][_0x52ff('0x65')](_0x6e9b58);})[_0x52ff('0x24')](function(_0xd312bf){_0x58a7f3[_0x52ff('0xd0')]=_0xd312bf;return _0x58a7f3;});}})[_0x52ff('0x24')](respondWithFilteredResult(_0x3444f7,_0x6e9b58))[_0x52ff('0x2e')](handleError(_0x3444f7,null));};exports['getScreenRecordings']=function(_0x30aca2,_0x7892f9,_0x217e53){var _0x1d7124={'raw':!![],'where':{}};var _0x3711a7={};var _0xb7c75b={'count':0x0,'rows':[]};return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x30aca2['params']['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x7892f9,null))[_0x52ff('0x24')](function(_0x32721){if(_0x32721){_0x3711a7[_0x52ff('0x4f')]=_['keys'](db[_0x52ff('0xd1')][_0x52ff('0x4c')]);_0x3711a7[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x30aca2['query']);_0x3711a7[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x3711a7[_0x52ff('0x4f')],_0x3711a7[_0x52ff('0x52')]);_0x1d7124['attributes']=_[_0x52ff('0x56')](_0x3711a7['model'],qs[_0x52ff('0x57')](_0x30aca2[_0x52ff('0x52')]['fields']));_0x1d7124['attributes']=_0x1d7124['attributes']['length']?_0x1d7124['attributes']:_0x3711a7['model'];if(!_0x30aca2[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x1d7124['limit']=qs['limit'](_0x30aca2[_0x52ff('0x52')][_0x52ff('0x35')]);_0x1d7124[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x30aca2['query'][_0x52ff('0x34')]);}_0x1d7124['order']=qs[_0x52ff('0x5a')](_0x30aca2[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x1d7124['where']=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x30aca2[_0x52ff('0x52')],_0x3711a7[_0x52ff('0x54')]));_0x1d7124[_0x52ff('0x5b')][_0x52ff('0xd2')]=_0x32721['id'];if(_0x30aca2[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x1d7124[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x1d7124[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x1d7124['attributes'],function(_0x1ecd11){var _0x15e499={};_0x15e499[_0x1ecd11]={'$like':'%'+_0x30aca2['query']['filter']+'%'};return _0x15e499;})});}_0x1d7124=_[_0x52ff('0x5d')]({},_0x1d7124,_0x30aca2[_0x52ff('0x63')]);return db[_0x52ff('0xd1')][_0x52ff('0x33')]({'where':_0x1d7124[_0x52ff('0x5b')]})[_0x52ff('0x24')](function(_0x31c48c){_0xb7c75b[_0x52ff('0x33')]=_0x31c48c;if(_0x30aca2[_0x52ff('0x52')][_0x52ff('0x64')]){_0x1d7124['include']=[{'all':!![]}];}return db['ScreenRecording'][_0x52ff('0x65')](_0x1d7124);})['then'](function(_0x51f0ba){_0xb7c75b[_0x52ff('0xd0')]=_0x51f0ba;return _0xb7c75b;});}})[_0x52ff('0x24')](respondWithFilteredResult(_0x7892f9,_0x1d7124))[_0x52ff('0x2e')](handleError(_0x7892f9,null));};exports[_0x52ff('0xd3')]=function(_0x380621,_0x517188,_0x1ba1df){var _0x5ef01d={};var _0x53838b={};var _0xec5551;var _0x200593;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x380621['params']['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x517188,null))[_0x52ff('0x24')](function(_0x29ac72){if(_0x29ac72){_0xec5551=_0x29ac72;_0x53838b[_0x52ff('0x4f')]=_['keys'](db[_0x52ff('0xd4')][_0x52ff('0x4c')]);_0x53838b[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x380621[_0x52ff('0x52')]);_0x53838b[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x53838b['model'],_0x53838b[_0x52ff('0x52')]);_0x5ef01d['attributes']=_[_0x52ff('0x56')](_0x53838b[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x380621[_0x52ff('0x52')][_0x52ff('0x57')]));_0x5ef01d[_0x52ff('0x55')]=_0x5ef01d[_0x52ff('0x55')][_0x52ff('0x68')]?_0x5ef01d[_0x52ff('0x55')]:_0x53838b[_0x52ff('0x4f')];_0x5ef01d[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x380621['query'][_0x52ff('0x5a')]);_0x5ef01d[_0x52ff('0x5b')]=qs['filters'](_[_0x52ff('0x5c')](_0x380621[_0x52ff('0x52')],_0x53838b[_0x52ff('0x54')]));if(_0x380621[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x5ef01d['where']=_[_0x52ff('0x5d')](_0x5ef01d[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x5ef01d['attributes'],function(_0x149155){var _0x241bc2={};_0x241bc2[_0x149155]={'$like':'%'+_0x380621[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x241bc2;})});}_0x5ef01d=_[_0x52ff('0x5d')]({},_0x5ef01d,_0x380621[_0x52ff('0x63')]);return _0xec5551[_0x52ff('0xd3')](_0x5ef01d);}})[_0x52ff('0x24')](function(_0x5cd232){if(_0x5cd232){_0x200593=_0x5cd232[_0x52ff('0x68')];if(!_0x380621['query'][_0x52ff('0x58')](_0x52ff('0x59'))){_0x5ef01d[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x380621[_0x52ff('0x52')][_0x52ff('0x35')]);_0x5ef01d['offset']=qs[_0x52ff('0x34')](_0x380621[_0x52ff('0x52')][_0x52ff('0x34')]);}return _0xec5551[_0x52ff('0xd3')](_0x5ef01d);}})[_0x52ff('0x24')](function(_0x383ea9){if(_0x383ea9){return _0x383ea9?{'count':_0x200593,'rows':_0x383ea9}:null;}})[_0x52ff('0x24')](respondWithResult(_0x517188,null))[_0x52ff('0x2e')](handleError(_0x517188,null));};exports[_0x52ff('0xd5')]=function(_0x49f98c,_0x456060,_0x252837){var _0x6f57a2={};var _0x17b72a={};var _0xbdf39a;var _0x435832;return db[_0x52ff('0x4b')]['findOne']({'where':{'id':_0x49f98c[_0x52ff('0x6d')]['id']}})['then'](handleEntityNotFound(_0x456060,null))[_0x52ff('0x24')](function(_0xce17a3){if(_0xce17a3){_0xbdf39a=_0xce17a3;_0x17b72a[_0x52ff('0x4f')]=_[_0x52ff('0x53')](db['OpenchannelInteraction'][_0x52ff('0x4c')]);_0x17b72a['query']=_[_0x52ff('0x53')](_0x49f98c['query']);_0x17b72a[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x17b72a['model'],_0x17b72a[_0x52ff('0x52')]);_0x6f57a2['attributes']=_[_0x52ff('0x56')](_0x17b72a[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x49f98c[_0x52ff('0x52')][_0x52ff('0x57')]));_0x6f57a2[_0x52ff('0x55')]=_0x6f57a2[_0x52ff('0x55')]['length']?_0x6f57a2[_0x52ff('0x55')]:_0x17b72a['model'];_0x6f57a2['order']=qs[_0x52ff('0x5a')](_0x49f98c[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x6f57a2[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x49f98c[_0x52ff('0x52')],_0x17b72a[_0x52ff('0x54')]));if(_0x49f98c[_0x52ff('0x52')]['filter']){_0x6f57a2[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x6f57a2['where'],{'$or':_[_0x52ff('0x41')](_0x6f57a2[_0x52ff('0x55')],function(_0x3ab374){var _0x342f1d={};_0x342f1d[_0x3ab374]={'$like':'%'+_0x49f98c[_0x52ff('0x52')]['filter']+'%'};return _0x342f1d;})});}_0x6f57a2=_['merge']({},_0x6f57a2,_0x49f98c['options']);return _0xbdf39a[_0x52ff('0xd5')](_0x6f57a2);}})['then'](function(_0x224bd4){if(_0x224bd4){_0x435832=_0x224bd4['length'];if(!_0x49f98c[_0x52ff('0x52')][_0x52ff('0x58')]('nolimit')){_0x6f57a2[_0x52ff('0x35')]=qs['limit'](_0x49f98c[_0x52ff('0x52')][_0x52ff('0x35')]);_0x6f57a2['offset']=qs['offset'](_0x49f98c[_0x52ff('0x52')]['offset']);}return _0xbdf39a[_0x52ff('0xd5')](_0x6f57a2);}})[_0x52ff('0x24')](function(_0x3eabb1){if(_0x3eabb1){return _0x3eabb1?{'count':_0x435832,'rows':_0x3eabb1}:null;}})[_0x52ff('0x24')](respondWithResult(_0x456060,null))['catch'](handleError(_0x456060,null));};exports[_0x52ff('0xd6')]=function(_0x5325f9,_0x37ceed,_0x47d26a){var _0x2ccc6b={'raw':!![],'where':{}};var _0x37a94f={};var _0x2c814f={'count':0x0,'rows':[]};return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x5325f9[_0x52ff('0x6d')]['id']}})['then'](handleEntityNotFound(_0x37ceed,null))['then'](function(_0xcbd35){if(_0xcbd35){_0x37a94f['model']=_[_0x52ff('0x53')](db['MailInteraction'][_0x52ff('0x4c')]);_0x37a94f[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x5325f9[_0x52ff('0x52')]);_0x37a94f[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x37a94f['model'],_0x37a94f[_0x52ff('0x52')]);_0x2ccc6b[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x37a94f['model'],qs[_0x52ff('0x57')](_0x5325f9[_0x52ff('0x52')][_0x52ff('0x57')]));_0x2ccc6b[_0x52ff('0x55')]=_0x2ccc6b[_0x52ff('0x55')][_0x52ff('0x68')]?_0x2ccc6b[_0x52ff('0x55')]:_0x37a94f[_0x52ff('0x4f')];if(!_0x5325f9[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x2ccc6b[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x5325f9[_0x52ff('0x52')][_0x52ff('0x35')]);_0x2ccc6b['offset']=qs[_0x52ff('0x34')](_0x5325f9[_0x52ff('0x52')][_0x52ff('0x34')]);}_0x2ccc6b[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x5325f9['query']['sort']);_0x2ccc6b['where']=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x5325f9[_0x52ff('0x52')],_0x37a94f[_0x52ff('0x54')]));_0x2ccc6b[_0x52ff('0x5b')][_0x52ff('0xd2')]=_0xcbd35['id'];if(_0x5325f9[_0x52ff('0x52')]['filter']){_0x2ccc6b[_0x52ff('0x5b')]=_['merge'](_0x2ccc6b['where'],{'$or':_[_0x52ff('0x41')](_0x2ccc6b[_0x52ff('0x55')],function(_0x23e25b){var _0x3d9b2d={};_0x3d9b2d[_0x23e25b]={'$like':'%'+_0x5325f9['query'][_0x52ff('0x3f')]+'%'};return _0x3d9b2d;})});}_0x2ccc6b=_[_0x52ff('0x5d')]({},_0x2ccc6b,_0x5325f9['options']);return db['MailInteraction'][_0x52ff('0x33')]({'where':_0x2ccc6b[_0x52ff('0x5b')]})[_0x52ff('0x24')](function(_0x25e5cd){_0x2c814f[_0x52ff('0x33')]=_0x25e5cd;if(_0x5325f9[_0x52ff('0x52')][_0x52ff('0x64')]){_0x2ccc6b['include']=[{'all':!![]}];}return db[_0x52ff('0xd7')][_0x52ff('0x65')](_0x2ccc6b);})[_0x52ff('0x24')](function(_0x3615f8){_0x2c814f[_0x52ff('0xd0')]=_0x3615f8;return _0x2c814f;});}})['then'](respondWithFilteredResult(_0x37ceed,_0x2ccc6b))[_0x52ff('0x2e')](handleError(_0x37ceed,null));};exports[_0x52ff('0xd8')]=function(_0x4d12ca,_0x5c8457,_0x4b019f){var _0x30a644={};var _0x2e22ce={};var _0x15c083;var _0x5caac7;return db['User'][_0x52ff('0xc2')]({'where':{'id':_0x4d12ca[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x5c8457,null))[_0x52ff('0x24')](function(_0x3001c0){if(_0x3001c0){_0x15c083=_0x3001c0;_0x2e22ce['model']=_['keys'](db[_0x52ff('0xd9')]['rawAttributes']);_0x2e22ce[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x4d12ca[_0x52ff('0x52')]);_0x2e22ce['filters']=_[_0x52ff('0x56')](_0x2e22ce[_0x52ff('0x4f')],_0x2e22ce[_0x52ff('0x52')]);_0x30a644[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x2e22ce[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x4d12ca[_0x52ff('0x52')][_0x52ff('0x57')]));_0x30a644[_0x52ff('0x55')]=_0x30a644[_0x52ff('0x55')][_0x52ff('0x68')]?_0x30a644['attributes']:_0x2e22ce[_0x52ff('0x4f')];_0x30a644[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x4d12ca[_0x52ff('0x52')]['sort']);_0x30a644[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x4d12ca[_0x52ff('0x52')],_0x2e22ce[_0x52ff('0x54')]));if(_0x4d12ca[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x30a644[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x30a644[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x30a644[_0x52ff('0x55')],function(_0x3ca16e){var _0xe050d9={};_0xe050d9[_0x3ca16e]={'$like':'%'+_0x4d12ca[_0x52ff('0x52')]['filter']+'%'};return _0xe050d9;})});}_0x30a644=_['merge']({},_0x30a644,_0x4d12ca[_0x52ff('0x63')]);return _0x15c083['getSmsInteractions'](_0x30a644);}})[_0x52ff('0x24')](function(_0x279bf0){if(_0x279bf0){_0x5caac7=_0x279bf0[_0x52ff('0x68')];if(!_0x4d12ca[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x30a644[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x4d12ca[_0x52ff('0x52')]['limit']);_0x30a644['offset']=qs['offset'](_0x4d12ca['query'][_0x52ff('0x34')]);}return _0x15c083[_0x52ff('0xd8')](_0x30a644);}})[_0x52ff('0x24')](function(_0x3ebddd){if(_0x3ebddd){return _0x3ebddd?{'count':_0x5caac7,'rows':_0x3ebddd}:null;}})['then'](respondWithResult(_0x5c8457,null))[_0x52ff('0x2e')](handleError(_0x5c8457,null));};exports[_0x52ff('0xda')]=function(_0x182b60,_0x5d5a88,_0x5db515){var _0x14ff7f={};var _0x31ab43={};var _0x306607;var _0xec1e75;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x182b60[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x5d5a88,null))[_0x52ff('0x24')](function(_0x3f65fc){if(_0x3f65fc){_0x306607=_0x3f65fc;_0x31ab43[_0x52ff('0x4f')]=_[_0x52ff('0x53')](db[_0x52ff('0xdb')]['rawAttributes']);_0x31ab43['query']=_['keys'](_0x182b60['query']);_0x31ab43[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0x31ab43['model'],_0x31ab43[_0x52ff('0x52')]);_0x14ff7f[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0x31ab43[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x182b60[_0x52ff('0x52')][_0x52ff('0x57')]));_0x14ff7f[_0x52ff('0x55')]=_0x14ff7f['attributes']['length']?_0x14ff7f['attributes']:_0x31ab43[_0x52ff('0x4f')];_0x14ff7f[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x182b60[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x14ff7f[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_['pick'](_0x182b60[_0x52ff('0x52')],_0x31ab43[_0x52ff('0x54')]));if(_0x182b60[_0x52ff('0x52')]['filter']){_0x14ff7f['where']=_[_0x52ff('0x5d')](_0x14ff7f[_0x52ff('0x5b')],{'$or':_['map'](_0x14ff7f[_0x52ff('0x55')],function(_0xcdb8f7){var _0x94d9f3={};_0x94d9f3[_0xcdb8f7]={'$like':'%'+_0x182b60[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x94d9f3;})});}_0x14ff7f=_[_0x52ff('0x5d')]({},_0x14ff7f,_0x182b60[_0x52ff('0x63')]);return _0x306607[_0x52ff('0xda')](_0x14ff7f);}})[_0x52ff('0x24')](function(_0x5a1e54){if(_0x5a1e54){_0xec1e75=_0x5a1e54[_0x52ff('0x68')];if(!_0x182b60[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x14ff7f[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x182b60[_0x52ff('0x52')][_0x52ff('0x35')]);_0x14ff7f[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x182b60[_0x52ff('0x52')][_0x52ff('0x34')]);}return _0x306607[_0x52ff('0xda')](_0x14ff7f);}})[_0x52ff('0x24')](function(_0x7243f8){if(_0x7243f8){return _0x7243f8?{'count':_0xec1e75,'rows':_0x7243f8}:null;}})['then'](respondWithResult(_0x5d5a88,null))[_0x52ff('0x2e')](handleError(_0x5d5a88,null));};exports[_0x52ff('0xdc')]=function(_0x21933a,_0x349acc,_0x42f4d0){var _0x24bbba;var _0x48dd23;var _0x2fc6f4;var _0x2cc917=!_[_0x52ff('0x79')](_0x21933a['params']['id'])?_0x21933a[_0x52ff('0x6d')]['id']:!_['isNil'](_0x21933a['user']['id'])?_0x21933a[_0x52ff('0x75')]['id']:null;return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x2cc917,'role':{'$or':['admin',_0x52ff('0x75'),_0x52ff('0x72')]}},'attributes':['id',_0x52ff('0x46'),_0x52ff('0xdd'),_0x52ff('0xde'),_0x52ff('0x44'),_0x52ff('0x7c'),_0x52ff('0xa3')]})[_0x52ff('0x24')](function(_0x12eb1b){if(_0x12eb1b){if(_0x12eb1b[_0x52ff('0x44')]===_0x52ff('0x72')){_0x24bbba=_0x12eb1b;if(_0x21933a[_0x52ff('0x6b')][_0x52ff('0xa5')]){_0x2fc6f4=util['format']('LOCAL/%s@from-sip/n',_0x24bbba[_0x21933a[_0x52ff('0x6b')]['interface']]);}else if(_0x21933a['body']['intrf']){_0x2fc6f4=util[_0x52ff('0x7a')]('SIP/%s',_0x21933a[_0x52ff('0x6b')][_0x52ff('0xdf')]);}else{_0x2fc6f4=util['format'](_0x52ff('0xb1'),_0x24bbba['name']);}socket['to'](util[_0x52ff('0x7a')]('user:%s',_0x24bbba[_0x52ff('0x46')]))[_0x52ff('0xb7')]('user:forcelogout',{'ip':_0x21933a[_0x52ff('0xe0')][_0x52ff('0xe1')]||_0x21933a[_0x52ff('0xe2')][_0x52ff('0xe3')]||_0x21933a[_0x52ff('0xe4')][_0x52ff('0xe3')]||_0x21933a[_0x52ff('0xe2')][_0x52ff('0xe4')][_0x52ff('0xe3')]});return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x24bbba[_0x52ff('0x46')]},'individualHooks':!![]});}}else{throw new db['Sequelize'][(_0x52ff('0x21'))](_0x52ff('0xe5'));}})[_0x52ff('0x24')](function(){if(_0x24bbba){return _0x24bbba[_0x52ff('0xe6')]({'raw':!![]});}})[_0x52ff('0x24')](function(_0x5ef31d){if(_0x24bbba){var _0xb7c729=[];if(_0x5ef31d){_0x48dd23=_0x5ef31d;if(_0x48dd23[_0x52ff('0x68')]){for(var _0x4fb084=0x0;_0x4fb084<_0x48dd23[_0x52ff('0x68')];_0x4fb084++){_0xb7c729[_0x52ff('0xb0')]({'membername':_0x24bbba[_0x52ff('0x46')],'UserId':_0x24bbba['id'],'queue_name':_0x48dd23[_0x4fb084][_0x52ff('0x46')],'VoiceQueueId':_0x48dd23[_0x4fb084]['id'],'interface':_0x2fc6f4,'paused':_0x24bbba[_0x52ff('0xa3')]||![],'penalty':_0x48dd23[_0x4fb084][_0x52ff('0xe7')]||0x0});}return BPromise[_0x52ff('0xb2')](_0xb7c729,function(_0x5132a0){return db['UserVoiceQueueRt'][_0x52ff('0xb4')](_0x5132a0);});}}}})[_0x52ff('0x24')](function(){if(_0x24bbba){return db['MemberReport'][_0x52ff('0x65')]({'where':{'membername':_0x24bbba[_0x52ff('0x46')],'exitAt':null}});}})[_0x52ff('0x24')](function(_0x162b9b){if(_0x24bbba){var _0x1eb7da=[];_0x162b9b[_0x52ff('0xe8')](function(_0x29a3f2){_0x1eb7da['push'](_0x29a3f2[_0x52ff('0x6c')]({'exitAt':moment()[_0x52ff('0x7a')](_0x52ff('0xe9'))}));});return BPromise[_0x52ff('0xea')](_0x1eb7da);}})['then'](function(){if(_0x24bbba){var _0xc25b04=[];var _0x3d8005=[];var _0xff1236=utils[_0x52ff('0xeb')]();var _0x597893={'membername':_0x24bbba['name'],'interface':_0x2fc6f4,'enterAt':moment()['format'](_0x52ff('0xe9')),'role':_0x24bbba[_0x52ff('0x44')],'internal':_0x24bbba[_0x52ff('0x7c')]};_0xff1236[_0x52ff('0xe8')](function(_0x36b335){_0xc25b04['push'](_[_0x52ff('0x5d')]({'channel':_0x36b335,'type':_0x52ff('0xec'),'data1':_0x21933a[_0x52ff('0x6b')][_0x52ff('0xed')],'data2':_0x2fc6f4},_0x597893));if(_0x24bbba['loginInPause']){_0x3d8005[_0x52ff('0xb0')](_[_0x52ff('0x5d')]({'channel':_0x36b335,'type':'PAUSE','data1':_0x52ff('0xee')},_0x597893));}});return db[_0x52ff('0xef')]['bulkCreate'](_0xc25b04[_0x52ff('0xf0')](_0x3d8005),{'individualHooks':!![]});}})[_0x52ff('0x24')](function(){if(_0x24bbba){return _0x24bbba[_0x52ff('0x6c')]({'online':!![],'lastLoginAt':moment()[_0x52ff('0x7a')](_0x52ff('0xe9')),'voicePause':_0x24bbba[_0x52ff('0xa3')]||![],'mailPause':_0x24bbba[_0x52ff('0xa3')]||![],'chatPause':_0x24bbba[_0x52ff('0xa3')]||![],'faxPause':_0x24bbba['loginInPause']||![],'smsPause':_0x24bbba[_0x52ff('0xa3')]||![],'openchannelPause':_0x24bbba[_0x52ff('0xa3')]||![],'pauseType':_0x24bbba[_0x52ff('0xa3')]?_0x52ff('0xee'):null,'interface':_0x2fc6f4,'lastPauseAt':moment()[_0x52ff('0x7a')](_0x52ff('0xe9'))});}})['then'](function(_0x4f1ce3){if(_0x21933a[_0x52ff('0xf1')]){return _0x42f4d0();}else{return BPromise['resolve'](_0x4f1ce3)[_0x52ff('0x24')](respondWithResult(_0x349acc,null));}})[_0x52ff('0x2e')](handleError(_0x349acc,null));};exports['logout']=function(_0x33e203,_0x2c1ef0,_0x7ff7f1){var _0x206d4d;return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x33e203[_0x52ff('0x6d')]['id'],'role':_0x52ff('0x72')},'attributes':['id',_0x52ff('0x46'),_0x52ff('0x44')]})[_0x52ff('0x24')](handleEntityNotFound(_0x2c1ef0,null))[_0x52ff('0x24')](function(_0x109372){if(_0x109372){_0x206d4d=_0x109372;return db['UserVoiceQueueRt'][_0x52ff('0x3a')]({'where':{'membername':_0x206d4d[_0x52ff('0x46')]},'individualHooks':!![]});}})[_0x52ff('0x24')](function(){return db[_0x52ff('0xef')][_0x52ff('0x65')]({'where':{'membername':_0x206d4d[_0x52ff('0x46')],'exitAt':null}});})['then'](function(_0x20ae58){var _0x4f333c=[];_0x20ae58[_0x52ff('0xe8')](function(_0x1c68a3){_0x4f333c[_0x52ff('0xb0')](_0x1c68a3[_0x52ff('0x6c')]({'exitAt':moment()[_0x52ff('0x7a')]('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise[_0x52ff('0xea')](_0x4f333c);})[_0x52ff('0x24')](function(){return _0x206d4d[_0x52ff('0x6c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x52ff('0x24')](respondWithResult(_0x2c1ef0,null))[_0x52ff('0x2e')](handleError(_0x2c1ef0,null));};exports[_0x52ff('0xf2')]=function(_0x47e841,_0xfbe5e5,_0x573999){var _0x18971c;return db['UserVoiceQueueRt'][_0x52ff('0x6c')]({'paused':0x1},{'where':{'UserId':_0x47e841[_0x52ff('0x6d')]['id']},'individualHooks':!![]})[_0x52ff('0x24')](function(){return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x47e841['params']['id'],'role':_0x52ff('0x72')},'attributes':['id',_0x52ff('0x46'),_0x52ff('0x44'),'internal',_0x52ff('0xa5')]});})[_0x52ff('0x24')](handleEntityNotFound(_0xfbe5e5,null))['then'](function(_0xbdb5a4){if(_0xbdb5a4){_0x18971c=_0xbdb5a4;return respondWithRpcPromise(_0x52ff('0xf3'),'pause',{'id':_0x18971c['id'],'name':_0x18971c[_0x52ff('0x46')],'pause':!![]});}})[_0x52ff('0x24')](function(){if(_0x18971c){return db[_0x52ff('0xef')][_0x52ff('0x65')]({'where':{'membername':_0x18971c['name'],'type':_0x52ff('0xf4'),'exitAt':null}});}})['then'](function(_0x174f46){if(_0x174f46[_0x52ff('0x68')]){var _0x54028a=moment()[_0x52ff('0x7a')](_0x52ff('0xe9'));for(var _0x1d26af=0x0,_0x1103e3=_0x174f46[_0x52ff('0x68')];_0x1d26af<_0x1103e3;_0x1d26af++){_0x174f46[_0x1d26af][_0x52ff('0xf5')]({'exitAt':_0x54028a});}}})['then'](function(){var _0xe38312=[];var _0xdd62f4=utils['getChannels']();_0xdd62f4[_0x52ff('0xe8')](function(_0x3e3525){_0xe38312[_0x52ff('0xb0')]({'channel':_0x3e3525,'membername':_0x18971c['name'],'interface':_[_0x52ff('0x79')](_0x18971c[_0x52ff('0xa5')])?util[_0x52ff('0x7a')](_0x52ff('0xb1'),_0x18971c[_0x52ff('0x46')]):_0x18971c['interface'],'type':_0x52ff('0xf4'),'enterAt':moment()['format'](_0x52ff('0xe9')),'data1':_0x47e841[_0x52ff('0x6b')][_0x52ff('0x5e')]||_0x52ff('0xf6'),'role':_0x18971c['role'],'internal':_0x18971c[_0x52ff('0x7c')]});});return db['MemberReport'][_0x52ff('0x6a')](_0xe38312,{'individualHooks':!![]});})['then'](function(){return _0x18971c[_0x52ff('0x6c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x47e841[_0x52ff('0x6b')][_0x52ff('0x5e')]||_0x52ff('0xf6'),'lastPauseAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0x52ff('0x24')](respondWithResult(_0xfbe5e5,null))[_0x52ff('0x2e')](handleError(_0xfbe5e5,null));};exports['unpause']=function(_0x1c8589,_0x50468b,_0x49f8f3){var _0x3ddfa6;return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x1c8589[_0x52ff('0x6d')]['id']},'attributes':['id',_0x52ff('0x46'),_0x52ff('0x44'),_0x52ff('0xa4'),'mailPause',_0x52ff('0xf7'),_0x52ff('0xf8'),'openchannelPause','smsPause',_0x52ff('0xf9'),'lastPauseAt']})[_0x52ff('0x24')](handleEntityNotFound(_0x50468b,null))[_0x52ff('0x24')](function(_0x143225){if(_0x143225){_0x3ddfa6=_0x143225;if(_0x1c8589[_0x52ff('0x6b')][_0x52ff('0xb5')]&&!utils[_0x52ff('0xa6')](_0x1c8589[_0x52ff('0x6b')][_0x52ff('0xb5')])){throw new db['Sequelize'][(_0x52ff('0x21'))](_0x52ff('0xa7'));}switch(_0x1c8589[_0x52ff('0x6b')][_0x52ff('0xb5')]){case'voice':return respondWithRpcPromise(_0x52ff('0xf3'),'unpause',{'id':_0x3ddfa6['id'],'name':_0x3ddfa6[_0x52ff('0x46')],'pause':![]})[_0x52ff('0x24')](function(){return db[_0x52ff('0xb3')][_0x52ff('0x6c')]({'paused':0x0},{'where':{'UserId':_0x3ddfa6['id']},'individualHooks':!![]});})[_0x52ff('0x24')](function(){return db[_0x52ff('0xef')][_0x52ff('0x45')]({'where':{'channel':_0x1c8589['body'][_0x52ff('0xb5')],'membername':_0x3ddfa6[_0x52ff('0x46')],'type':_0x52ff('0xf4'),'exitAt':null}});})['then'](function(_0x16fd04){if(_0x16fd04){return _0x16fd04['update']({'exitAt':moment()[_0x52ff('0x7a')](_0x52ff('0xe9')),'data2':_0x52ff('0xfa')},{'individualHooks':!![]});}return null;})[_0x52ff('0x24')](function(){return _0x3ddfa6[_0x52ff('0x6c')]({'voicePause':![]});});case _0x52ff('0xfb'):case _0x52ff('0xfc'):case'fax':case'sms':case _0x52ff('0xfd'):return db[_0x52ff('0xef')][_0x52ff('0x45')]({'where':{'channel':_0x1c8589[_0x52ff('0x6b')][_0x52ff('0xb5')],'membername':_0x3ddfa6['name'],'type':_0x52ff('0xf4'),'exitAt':null}})[_0x52ff('0x24')](function(_0x4cc9e6){if(_0x4cc9e6){return _0x4cc9e6[_0x52ff('0x6c')]({'exitAt':moment()['format'](_0x52ff('0xe9')),'data2':_0x52ff('0xfa')},{'individualHooks':!![]});}return null;})[_0x52ff('0x24')](function(){var _0x4a1bd3={};_[_0x52ff('0x36')](_0x4a1bd3,util['format'](_0x52ff('0xfe'),_0x1c8589['body'][_0x52ff('0xb5')],'Pause'),![]);return _0x3ddfa6[_0x52ff('0x6c')](_0x4a1bd3);});default:return respondWithRpcPromise(_0x52ff('0xf3'),_0x52ff('0xff'),{'id':_0x3ddfa6['id'],'name':_0x3ddfa6[_0x52ff('0x46')],'pause':![]})['then'](function(){return db[_0x52ff('0xb3')]['update']({'paused':0x0},{'where':{'UserId':_0x3ddfa6['id']}});})[_0x52ff('0x24')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x3ddfa6[_0x52ff('0x46')],'type':_0x52ff('0xf4'),'exitAt':null}});})[_0x52ff('0x24')](function(_0x26b896){var _0x13d3db=[];_0x26b896['forEach'](function(_0x5b156f){_0x13d3db[_0x52ff('0xb0')](_0x5b156f[_0x52ff('0x6c')]({'exitAt':moment()[_0x52ff('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'manual'}));});return BPromise[_0x52ff('0xea')](_0x13d3db);})[_0x52ff('0x24')](function(){return _0x3ddfa6[_0x52ff('0x6c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x52ff('0x24')](respondWithResult(_0x50468b,null))[_0x52ff('0x2e')](handleError(_0x50468b,null));};exports[_0x52ff('0x100')]=function(_0x31da3e,_0x24f276,_0x31b158){var _0x2818c4={};var _0xfe34cb={};var _0x3a1270;var _0x4d2747;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x31da3e[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x24f276,null))['then'](function(_0x4bdb07){if(_0x4bdb07){_0x3a1270=_0x4bdb07;_0xfe34cb[_0x52ff('0x4f')]=_[_0x52ff('0x53')](db[_0x52ff('0x101')]['rawAttributes']);_0xfe34cb[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x31da3e[_0x52ff('0x52')]);_0xfe34cb[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0xfe34cb[_0x52ff('0x4f')],_0xfe34cb[_0x52ff('0x52')]);_0x2818c4[_0x52ff('0x55')]=_[_0x52ff('0x56')](_0xfe34cb[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x31da3e[_0x52ff('0x52')][_0x52ff('0x57')]));_0x2818c4['attributes']=_0x2818c4[_0x52ff('0x55')][_0x52ff('0x68')]?_0x2818c4[_0x52ff('0x55')]:_0xfe34cb['model'];_0x2818c4[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x31da3e['query'][_0x52ff('0x5a')]);_0x2818c4[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_['pick'](_0x31da3e['query'],_0xfe34cb['filters']));if(_0x31da3e[_0x52ff('0x52')]['filter']){_0x2818c4[_0x52ff('0x5b')]=_['merge'](_0x2818c4[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x2818c4[_0x52ff('0x55')],function(_0xaa3ba4){var _0x1cdc6e={};_0x1cdc6e[_0xaa3ba4]={'$like':'%'+_0x31da3e[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x1cdc6e;})});}_0x2818c4=_[_0x52ff('0x5d')]({},_0x2818c4,_0x31da3e[_0x52ff('0x63')]);return _0x3a1270[_0x52ff('0x100')](_0x2818c4);}})['then'](function(_0x19b7e2){if(_0x19b7e2){_0x4d2747=_0x19b7e2[_0x52ff('0x68')];if(!_0x31da3e[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x2818c4[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x31da3e['query'][_0x52ff('0x35')]);_0x2818c4[_0x52ff('0x34')]=qs['offset'](_0x31da3e[_0x52ff('0x52')]['offset']);}return _0x3a1270[_0x52ff('0x100')](_0x2818c4);}})[_0x52ff('0x24')](function(_0x118af3){if(_0x118af3){return _0x118af3?{'count':_0x4d2747,'rows':_0x118af3}:null;}})[_0x52ff('0x24')](respondWithResult(_0x24f276,null))[_0x52ff('0x2e')](handleError(_0x24f276,null));};exports['addTeams']=function(_0x177782,_0x2b00be){return db[_0x52ff('0x4b')][_0x52ff('0x45')]({'where':{'id':_0x177782[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x2b00be,null))[_0x52ff('0x24')](function(_0x15eb40){if(_0x15eb40){var _0x335c5f=_0x15eb40[_0x52ff('0x95')]({'plain':!![]});return _0x15eb40[_0x52ff('0x102')](_0x177782[_0x52ff('0x6b')][_0x52ff('0x70')],_[_0x52ff('0x71')](_0x177782[_0x52ff('0x6b')],[_0x52ff('0x70'),'id'])||{})[_0x52ff('0x24')](function(){for(var _0x2a0a78=0x0;_0x2a0a78<_0x177782[_0x52ff('0x6b')][_0x52ff('0x70')][_0x52ff('0x68')];_0x2a0a78++){var _0x133541=[];db[_0x52ff('0x101')]['findOne']({'where':{'id':_0x177782[_0x52ff('0x6b')][_0x52ff('0x70')][_0x2a0a78]}})[_0x52ff('0x24')](function(_0x1d5381){_0x133541[_0x52ff('0xb0')](_0x1d5381[_0x52ff('0xe6')]()[_0x52ff('0x24')](function(_0x44b610){for(var _0x11e194=0x0;_0x11e194<_0x44b610[_0x52ff('0x68')];_0x11e194++){_0x44b610[_0x11e194]['setDataValue']('channel',_0x52ff('0x103'));}return _0x44b610;}));_0x133541[_0x52ff('0xb0')](_0x1d5381[_0x52ff('0x104')]()[_0x52ff('0x24')](function(_0x354436){for(var _0x2354ef=0x0;_0x2354ef<_0x354436[_0x52ff('0x68')];_0x2354ef++){_0x354436[_0x2354ef]['setDataValue']('channel',_0x52ff('0x105'));}return _0x354436;}));_0x133541[_0x52ff('0xb0')](_0x1d5381[_0x52ff('0x106')]()[_0x52ff('0x24')](function(_0x353446){for(var _0xab522d=0x0;_0xab522d<_0x353446['length'];_0xab522d++){_0x353446[_0xab522d]['setDataValue']('channel',_0x52ff('0x107'));}return _0x353446;}));_0x133541[_0x52ff('0xb0')](_0x1d5381['getSmsQueues']()[_0x52ff('0x24')](function(_0x498f10){for(var _0x42dbdc=0x0;_0x42dbdc<_0x498f10[_0x52ff('0x68')];_0x42dbdc++){_0x498f10[_0x42dbdc]['setDataValue'](_0x52ff('0xb5'),_0x52ff('0x108'));}return _0x498f10;}));_0x133541['push'](_0x1d5381[_0x52ff('0x109')]()[_0x52ff('0x24')](function(_0x5da45b){for(var _0xde1df7=0x0;_0xde1df7<_0x5da45b[_0x52ff('0x68')];_0xde1df7++){_0x5da45b[_0xde1df7][_0x52ff('0x10a')](_0x52ff('0xb5'),_0x52ff('0x10b'));}return _0x5da45b;}));_0x133541[_0x52ff('0xb0')](_0x1d5381[_0x52ff('0x10c')]()['then'](function(_0x4bd2ee){for(var _0x52b003=0x0;_0x52b003<_0x4bd2ee[_0x52ff('0x68')];_0x52b003++){_0x4bd2ee[_0x52b003][_0x52ff('0x10a')]('channel','Openchannel');}return _0x4bd2ee;}));return BPromise['all'](_0x133541);})[_0x52ff('0x24')](function(_0x2e78cd){var _0x306a=_[_0x52ff('0x10d')](_0x2e78cd);_0x133541=[];return db[_0x52ff('0x60')][_0x52ff('0x10e')](function(_0x382f86){for(var _0xba9226=0x0;_0xba9226<_0x306a[_0x52ff('0x68')];_0xba9226++){_0x133541[_0x52ff('0xb0')](_0x306a[_0xba9226][_0x52ff('0x10f')](_0x335c5f['id']),{'transaction':_0x382f86});}return BPromise['all'](_0x133541)[_0x52ff('0x24')](function(){if(_0x335c5f[_0x52ff('0xa2')]){return BPromise[_0x52ff('0xb2')](_[_0x52ff('0x3f')](_0x306a,function(_0x1c5ef2){return _0x1c5ef2[_0x52ff('0x110')]('channel')==='Voice';}),function(_0x559a02){return db[_0x52ff('0xb3')][_0x52ff('0xb4')]({'membername':_0x335c5f[_0x52ff('0x46')],'UserId':_0x335c5f['id'],'queue_name':_0x559a02[_0x52ff('0x46')],'VoiceQueueId':_0x559a02['id'],'interface':_[_0x52ff('0x79')](_0x335c5f[_0x52ff('0xa5')])?util[_0x52ff('0x7a')](_0x52ff('0xb1'),_0x335c5f[_0x52ff('0x46')]):_0x335c5f[_0x52ff('0xa5')],'paused':_0x335c5f[_0x52ff('0xa4')]||![],'penalty':_0x335c5f[_0x52ff('0xac')]},{'transaction':_0x382f86});});}else{return;}})[_0x52ff('0x24')](function(){for(var _0x2afd5e=0x0;_0x2afd5e<_0x306a['length'];_0x2afd5e++){var _0x1b1779=_0x306a[_0x2afd5e][_0x52ff('0x110')](_0x52ff('0xb5'));var _0x648f26=_0x1b1779+_0x52ff('0xae');socket[_0x52ff('0xb7')](_0x52ff('0x75')+_0x1b1779+_0x52ff('0x111'),{'UserId':_0x335c5f['id'],['queueField']:_0x306a[_0x2afd5e]['id']});}});});});}});}})[_0x52ff('0x24')](respondWithStatusCode(_0x2b00be,null))[_0x52ff('0x2e')](handleError(_0x2b00be,null));};exports[_0x52ff('0x112')]=function(_0x184374,_0x4a74a3){return db['User'][_0x52ff('0xc2')]({'where':{'id':_0x184374[_0x52ff('0x6d')]['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x4a74a3,null))['then'](function(_0x2300db){if(_0x2300db){var _0x2b99c0=_0x2300db['get']({'plain':!![]});var _0x5a4958=_0x184374[_0x52ff('0x52')]['ids'];return _0x2300db[_0x52ff('0x112')](_0x5a4958)[_0x52ff('0x24')](function(){for(var _0x544fec=0x0;_0x544fec<_0x5a4958[_0x52ff('0x68')];_0x544fec++){var _0x29fa30=[];db[_0x52ff('0x101')]['findOne']({'where':{'id':_0x5a4958[_0x544fec]}})[_0x52ff('0x24')](function(_0x434825){_0x29fa30[_0x52ff('0xb0')](_0x434825[_0x52ff('0xe6')]()['then'](function(_0x2c4029){for(var _0x121c2c=0x0;_0x121c2c<_0x2c4029[_0x52ff('0x68')];_0x121c2c++){_0x2c4029[_0x121c2c][_0x52ff('0x10a')](_0x52ff('0xb5'),'Voice');}return _0x2c4029;}));_0x29fa30[_0x52ff('0xb0')](_0x434825[_0x52ff('0x104')]()[_0x52ff('0x24')](function(_0x4d8064){for(var _0x12944f=0x0;_0x12944f<_0x4d8064[_0x52ff('0x68')];_0x12944f++){_0x4d8064[_0x12944f][_0x52ff('0x10a')]('channel','Chat');}return _0x4d8064;}));_0x29fa30[_0x52ff('0xb0')](_0x434825[_0x52ff('0x106')]()[_0x52ff('0x24')](function(_0x35c6e1){for(var _0x7646d7=0x0;_0x7646d7<_0x35c6e1['length'];_0x7646d7++){_0x35c6e1[_0x7646d7]['setDataValue']('channel',_0x52ff('0x107'));}return _0x35c6e1;}));_0x29fa30[_0x52ff('0xb0')](_0x434825[_0x52ff('0x113')]()[_0x52ff('0x24')](function(_0x1a2c01){for(var _0xd14f2e=0x0;_0xd14f2e<_0x1a2c01[_0x52ff('0x68')];_0xd14f2e++){_0x1a2c01[_0xd14f2e][_0x52ff('0x10a')]('channel',_0x52ff('0x108'));}return _0x1a2c01;}));_0x29fa30[_0x52ff('0xb0')](_0x434825['getFaxQueues']()[_0x52ff('0x24')](function(_0x1379e8){for(var _0x58c19a=0x0;_0x58c19a<_0x1379e8[_0x52ff('0x68')];_0x58c19a++){_0x1379e8[_0x58c19a][_0x52ff('0x10a')](_0x52ff('0xb5'),_0x52ff('0x10b'));}return _0x1379e8;}));_0x29fa30[_0x52ff('0xb0')](_0x434825[_0x52ff('0x10c')]()[_0x52ff('0x24')](function(_0x4597da){for(var _0x14d507=0x0;_0x14d507<_0x4597da[_0x52ff('0x68')];_0x14d507++){_0x4597da[_0x14d507][_0x52ff('0x10a')]('channel',_0x52ff('0x114'));}return _0x4597da;}));return BPromise['all'](_0x29fa30);})['then'](function(_0x8657e9){var _0x5b498c=_['flatten'](_0x8657e9);_0x29fa30=[];return db[_0x52ff('0x60')][_0x52ff('0x10e')](function(_0x66dad7){for(var _0x1acbc6=0x0;_0x1acbc6<_0x5b498c[_0x52ff('0x68')];_0x1acbc6++){_0x29fa30[_0x52ff('0xb0')](_0x5b498c[_0x1acbc6][_0x52ff('0x115')](_0x2b99c0['id']),{'transaction':_0x66dad7});}return BPromise[_0x52ff('0xea')](_0x29fa30)[_0x52ff('0x24')](function(){if(_0x2b99c0[_0x52ff('0xa2')]){return BPromise['each'](_[_0x52ff('0x3f')](_0x5b498c,function(_0x81452a){return _0x81452a[_0x52ff('0x110')]('channel')==='Voice';}),function(_0x2fb266){return db['UserVoiceQueueRt'][_0x52ff('0x3a')]({'where':{'VoiceQueueId':_0x2fb266['id'],'UserId':_0x2b99c0['id']},'transaction':_0x66dad7});});}else{return;}})[_0x52ff('0x24')](function(){for(var _0x39eb2e=0x0;_0x39eb2e<_0x5b498c[_0x52ff('0x68')];_0x39eb2e++){var _0x49f12c=_0x5b498c[_0x39eb2e][_0x52ff('0x110')](_0x52ff('0xb5'));var _0x5d10b8=_0x49f12c+_0x52ff('0xae');socket[_0x52ff('0xb7')](_0x52ff('0x75')+_0x49f12c+_0x52ff('0xb8'),{'UserId':_0x2b99c0['id'],['queueField']:_0x5b498c[_0x39eb2e]['id']});}});});});}});}})[_0x52ff('0x24')](respondWithStatusCode(_0x4a74a3,null))['catch'](handleError(_0x4a74a3,null));};exports[_0x52ff('0x116')]=function(_0x5a2078,_0x33894d,_0x22a499){var _0x22c52d={};var _0x443c77={};var _0x79e845;var _0x21cb32;return db[_0x52ff('0x4b')]['findOne']({'where':{'id':_0x5a2078['params']['id']}})['then'](handleEntityNotFound(_0x33894d,null))[_0x52ff('0x24')](function(_0x16bced){if(_0x16bced){_0x79e845=_0x16bced;_0x443c77[_0x52ff('0x4f')]=_['keys'](db['CmList'][_0x52ff('0x4c')]);_0x443c77[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x5a2078['query']);_0x443c77['filters']=_[_0x52ff('0x56')](_0x443c77[_0x52ff('0x4f')],_0x443c77[_0x52ff('0x52')]);_0x22c52d[_0x52ff('0x55')]=_['intersection'](_0x443c77[_0x52ff('0x4f')],qs[_0x52ff('0x57')](_0x5a2078['query'][_0x52ff('0x57')]));_0x22c52d[_0x52ff('0x55')]=_0x22c52d['attributes'][_0x52ff('0x68')]?_0x22c52d[_0x52ff('0x55')]:_0x443c77[_0x52ff('0x4f')];_0x22c52d[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x5a2078[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x22c52d[_0x52ff('0x5b')]=qs[_0x52ff('0x54')](_[_0x52ff('0x5c')](_0x5a2078[_0x52ff('0x52')],_0x443c77[_0x52ff('0x54')]));if(_0x5a2078['query']['filter']){_0x22c52d['where']=_[_0x52ff('0x5d')](_0x22c52d[_0x52ff('0x5b')],{'$or':_[_0x52ff('0x41')](_0x22c52d[_0x52ff('0x55')],function(_0xc07016){var _0x5e73bf={};_0x5e73bf[_0xc07016]={'$like':'%'+_0x5a2078[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x5e73bf;})});}_0x22c52d=_[_0x52ff('0x5d')]({},_0x22c52d,_0x5a2078[_0x52ff('0x63')]);return _0x79e845['getLists'](_0x22c52d);}})[_0x52ff('0x24')](function(_0x1dc31c){if(_0x1dc31c){_0x21cb32=_0x1dc31c['length'];if(!_0x5a2078[_0x52ff('0x52')][_0x52ff('0x58')](_0x52ff('0x59'))){_0x22c52d[_0x52ff('0x35')]=qs[_0x52ff('0x35')](_0x5a2078[_0x52ff('0x52')][_0x52ff('0x35')]);_0x22c52d[_0x52ff('0x34')]=qs[_0x52ff('0x34')](_0x5a2078['query'][_0x52ff('0x34')]);}return _0x79e845['getLists'](_0x22c52d);}})[_0x52ff('0x24')](function(_0x4db9fb){if(_0x4db9fb){return _0x4db9fb?{'count':_0x21cb32,'rows':_0x4db9fb}:null;}})[_0x52ff('0x24')](respondWithResult(_0x33894d,null))[_0x52ff('0x2e')](handleError(_0x33894d,null));};exports[_0x52ff('0x117')]=function(_0x4083b7,_0x1aab73,_0x254cde){var _0x55f5ba={};var _0xedebbe={};var _0x49fc7c;var _0x13290b;return db[_0x52ff('0x4b')][_0x52ff('0xc2')]({'where':{'id':_0x4083b7['params']['id']}})[_0x52ff('0x24')](handleEntityNotFound(_0x1aab73,null))[_0x52ff('0x24')](function(_0xcee6af){if(_0xcee6af){_0x49fc7c=_0xcee6af;_0xedebbe['model']=_['keys'](db['User']['rawAttributes']);_0xedebbe[_0x52ff('0x52')]=_[_0x52ff('0x53')](_0x4083b7[_0x52ff('0x52')]);_0xedebbe[_0x52ff('0x54')]=_[_0x52ff('0x56')](_0xedebbe[_0x52ff('0x4f')],_0xedebbe[_0x52ff('0x52')]);_0x55f5ba[_0x52ff('0x55')]=_['intersection'](_0xedebbe['model'],qs[_0x52ff('0x57')](_0x4083b7[_0x52ff('0x52')][_0x52ff('0x57')]));_0x55f5ba[_0x52ff('0x55')]=_0x55f5ba['attributes'][_0x52ff('0x68')]?_0x55f5ba['attributes']:_0xedebbe[_0x52ff('0x4f')];_0x55f5ba[_0x52ff('0xcb')]=qs[_0x52ff('0x5a')](_0x4083b7[_0x52ff('0x52')][_0x52ff('0x5a')]);_0x55f5ba[_0x52ff('0x5b')]=qs['filters'](_['pick'](_0x4083b7[_0x52ff('0x52')],_0xedebbe['filters']));if(_0x4083b7[_0x52ff('0x52')][_0x52ff('0x3f')]){_0x55f5ba[_0x52ff('0x5b')]=_[_0x52ff('0x5d')](_0x55f5ba['where'],{'$or':_['map'](_0x55f5ba[_0x52ff('0x55')],function(_0x1c6da8){var _0x3caecd={};_0x3caecd[_0x1c6da8]={'$like':'%'+_0x4083b7[_0x52ff('0x52')][_0x52ff('0x3f')]+'%'};return _0x3caecd;})});}_0x55f5ba['model']=db[_0x52ff('0x4b')];_0x55f5ba['as']=_0x52ff('0x3c');_0x55f5ba=_[_0x52ff('0x5d')]({},_0x55f5ba,_0x4083b7[_0x52ff('0x63')]);return _0x49fc7c[_0x52ff('0xe6')]({'include':[_0x55f5ba]});}})[_0x52ff('0x24')](function(_0x113ff9){if(_0x113ff9){var _0x464b2d={},_0x27061e=[],_0x9054c2=0x0;for(var _0x4f6364=0x0;_0x4f6364<_0x113ff9[_0x52ff('0x68')];_0x4f6364+=0x1){for(var _0x7ac4b1=0x0,_0x48f3bb;_0x7ac4b1<_0x113ff9[_0x4f6364][_0x52ff('0x3c')]['length'];_0x7ac4b1+=0x1){_0x48f3bb=_0x113ff9[_0x4f6364][_0x52ff('0x3c')][_0x7ac4b1]['get']({'plain':!![]});_0x464b2d[_0x48f3bb['id']]=_0x48f3bb;}}_0x464b2d=_[_0x52ff('0x118')](_0x464b2d);for(var _0x3b56eb=qs[_0x52ff('0x34')](_0x4083b7[_0x52ff('0x52')][_0x52ff('0x34')]);_0x3b56eb<_0x464b2d[_0x52ff('0x68')]&&_0x27061e[_0x52ff('0x68')]=_0x38a110[_0x0786('0x55')]){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0x0786('0xf')](function(){if(_0x20dccf){return db[_0x0786('0x2b')][_0x0786('0x4e')]({'where':{'membername':_0x20dccf[_0x0786('0x29')]},'individualHooks':!![]});}})[_0x0786('0xf')](function(){if(_0x20dccf){return _0x20dccf['getVoiceQueues']({'raw':!![]});}})['then'](function(_0x1988c1){if(_0x20dccf){if(_0x1988c1){var _0x354cd5=[];_0x16160b=_0x1988c1;if(_0x16160b[_0x0786('0x2f')]){for(var _0x301dfe=0x0;_0x301dfe<_0x16160b[_0x0786('0x2f')];_0x301dfe++){_0x354cd5[_0x0786('0x32')](db['UserVoiceQueueRt'][_0x0786('0x56')]({'membername':_0x20dccf[_0x0786('0x29')],'UserId':_0x20dccf['id'],'queue_name':_0x16160b[_0x301dfe][_0x0786('0x29')],'VoiceQueueId':_0x16160b[_0x301dfe]['id'],'interface':_0x2cbc13,'paused':_0x20dccf['loginInPause']||![],'penalty':_0x16160b[_0x301dfe][_0x0786('0x57')]||0x0}));}return BPromise[_0x0786('0x4c')](_0x354cd5);}}}})[_0x0786('0xf')](function(){if(_0x20dccf){return db[_0x0786('0x2d')][_0x0786('0x1c')]({'where':{'membername':_0x20dccf[_0x0786('0x29')],'exitAt':null}});}})[_0x0786('0xf')](function(_0x53fa91){if(_0x20dccf){if(_0x53fa91&&_0x53fa91[_0x0786('0x2f')]){var _0x2a704f=[];_0x53fa91[_0x0786('0x31')](function(_0xe196e3){_0x2a704f[_0x0786('0x32')](_0xe196e3[_0x0786('0x2c')]({'exitAt':moment()[_0x0786('0x34')](_0x0786('0x3c'))}));});return BPromise['all'](_0x2a704f);}}})[_0x0786('0xf')](function(_0x782221){if(_0x20dccf){var _0x2610f3=[];var _0x5cc58a=[];var _0x3158ed=utils[_0x0786('0x58')]();var _0x697385={'membername':_0x20dccf[_0x0786('0x29')],'interface':_0x2cbc13,'enterAt':moment()[_0x0786('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'role':_0x20dccf[_0x0786('0x36')],'internal':_0x20dccf[_0x0786('0x37')]};_0x3158ed[_0x0786('0x31')](function(_0x132b44){_0x2610f3[_0x0786('0x32')](_[_0x0786('0x59')]({'channel':_0x132b44,'type':'LOGIN','data1':_0x0786('0x5a'),'data2':_0x2cbc13},_0x697385));if(_0x20dccf[_0x0786('0x5b')]){_0x5cc58a[_0x0786('0x32')](_[_0x0786('0x59')]({'channel':_0x132b44,'type':_0x0786('0x2e'),'data1':_0x0786('0x5c')},_0x697385));}});return db[_0x0786('0x2d')][_0x0786('0x3a')](_0x2610f3[_0x0786('0x5d')](_0x5cc58a),{'individualHooks':!![]});}})['then'](function(){if(_0x20dccf){return _0x20dccf[_0x0786('0x2c')]({'online':!![],'lastLoginAt':moment()['format'](_0x0786('0x3c')),'voicePause':_0x20dccf[_0x0786('0x5b')]||![],'mailPause':_0x20dccf['loginInPause']||![],'chatPause':_0x20dccf['loginInPause']||![],'faxPause':_0x20dccf[_0x0786('0x5b')]||![],'smsPause':_0x20dccf[_0x0786('0x5b')]||![],'openchannelPause':_0x20dccf[_0x0786('0x5b')]||![],'pauseType':_0x20dccf['loginInPause']?'LOGININPAUSE':null,'lastPauseAt':moment()[_0x0786('0x34')](_0x0786('0x3c')),'interface':_0x2cbc13});}})[_0x0786('0xf')](function(_0x8ebf7a){_0x5f151b(_0x8ebf7a);})['catch'](function(_0x9541f8){_0x1324e9(_0x1b4474['error'](0x1f4,_0x9541f8[_0x0786('0x18')]));});});}; \ No newline at end of file +var _0x346e=['PauseUser','role','internal','interface','update','MemberReport','name','PAUSE','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','getChannels','SIP/%s','body','type','DEFAULT\x20PAUSE','UnpauseUser','findOne','channel','isValidChannel','voice','UserVoiceQueueRt','mail','chat','sms','openchannel','set','%s%s','Pause','forEach','push','all','destroy','LoginUser','mobile','phone','loginInPause','count','agent','../../config/license/util','getLicense','merge','LOGIN','callysquare','bulkCreate','concat','LOGININPAUSE','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','defaults','redis','localhost','./user.socket','request','then','info','debug','User,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','User,\x20%s,\x20%s','result','catch','GetUser','User','findAll','options','raw','where','attributes','limit','include','map','model','stringify','find','ShowUser'];(function(_0x154a14,_0x367ac4){var _0x2cbf97=function(_0x129a31){while(--_0x129a31){_0x154a14['push'](_0x154a14['shift']());}};_0x2cbf97(++_0x367ac4);}(_0x346e,0x1e8));var _0xe346=function(_0x4f2d1d,_0x13990a){_0x4f2d1d=_0x4f2d1d-0x0;var _0x263196=_0x346e[_0x4f2d1d];return _0x263196;};'use strict';var _=require(_0xe346('0x0'));var util=require(_0xe346('0x1'));var moment=require(_0xe346('0x2'));var BPromise=require(_0xe346('0x3'));var rs=require(_0xe346('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe346('0x5'))['db'];var utils=require(_0xe346('0x6'));var logger=require(_0xe346('0x7'))(_0xe346('0x8'));var config=require(_0xe346('0x9'));var jayson=require(_0xe346('0xa'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0xe346('0xb')](config[_0xe346('0xc')],{'host':_0xe346('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xe346('0xe'))['register'](socket);function respondWithRpcPromise(_0x3c67ae,_0x130d17,_0x43db7e){return new BPromise(function(_0x7fa4f3,_0x32f073){return client[_0xe346('0xf')](_0x3c67ae,_0x43db7e)[_0xe346('0x10')](function(_0x3dce24){logger[_0xe346('0x11')]('User,\x20%s,\x20%s',_0x130d17,'request\x20sent');logger[_0xe346('0x12')](_0xe346('0x13'),_0x130d17,_0xe346('0x14'),JSON['stringify'](_0x3dce24));if(_0x3dce24['error']){if(_0x3dce24[_0xe346('0x15')]['code']===0x1f4){logger[_0xe346('0x15')]('User,\x20%s,\x20%s',_0x130d17,_0x3dce24[_0xe346('0x15')][_0xe346('0x16')]);return _0x32f073(_0x3dce24['error'][_0xe346('0x16')]);}logger['error'](_0xe346('0x17'),_0x130d17,_0x3dce24[_0xe346('0x15')][_0xe346('0x16')]);return _0x7fa4f3(_0x3dce24[_0xe346('0x15')][_0xe346('0x16')]);}else{logger[_0xe346('0x11')](_0xe346('0x17'),_0x130d17,_0xe346('0x14'));_0x7fa4f3(_0x3dce24[_0xe346('0x18')][_0xe346('0x16')]);}})[_0xe346('0x19')](function(_0xea426f){logger[_0xe346('0x15')](_0xe346('0x17'),_0x130d17,_0xea426f);_0x32f073(_0xea426f);});});}exports[_0xe346('0x1a')]=function(_0x1a9f00){var _0x554cc7=this;return new Promise(function(_0x5397c0,_0x3e3bb7){return db[_0xe346('0x1b')][_0xe346('0x1c')]({'raw':_0x1a9f00[_0xe346('0x1d')]?_0x1a9f00[_0xe346('0x1d')][_0xe346('0x1e')]===undefined?!![]:![]:!![],'where':_0x1a9f00[_0xe346('0x1d')]?_0x1a9f00[_0xe346('0x1d')][_0xe346('0x1f')]||null:null,'attributes':_0x1a9f00['options']?_0x1a9f00[_0xe346('0x1d')][_0xe346('0x20')]||null:null,'limit':_0x1a9f00[_0xe346('0x1d')]?_0x1a9f00[_0xe346('0x1d')][_0xe346('0x21')]||null:null,'include':_0x1a9f00[_0xe346('0x1d')]?_0x1a9f00[_0xe346('0x1d')][_0xe346('0x22')]?_['map'](_0x1a9f00[_0xe346('0x1d')][_0xe346('0x22')],function(_0x5207b8){return{'model':db[_0x5207b8['model']],'as':_0x5207b8['as'],'attributes':_0x5207b8[_0xe346('0x20')],'include':_0x5207b8['include']?_[_0xe346('0x23')](_0x5207b8['include'],function(_0x2f3edb){return{'model':db[_0x2f3edb['model']],'as':_0x2f3edb['as'],'attributes':_0x2f3edb[_0xe346('0x20')],'include':_0x2f3edb[_0xe346('0x22')]?_[_0xe346('0x23')](_0x2f3edb[_0xe346('0x22')],function(_0x186bdb){return{'model':db[_0x186bdb[_0xe346('0x24')]],'as':_0x186bdb['as'],'attributes':_0x186bdb['attributes']};}):[]};}):[]};}):[]:[]})[_0xe346('0x10')](function(_0x548724){logger[_0xe346('0x11')](_0xe346('0x1a'),_0x1a9f00);logger[_0xe346('0x12')]('GetUser',_0x1a9f00,JSON[_0xe346('0x25')](_0x548724));_0x5397c0(_0x548724);})[_0xe346('0x19')](function(_0xfb25da){logger[_0xe346('0x15')]('GetUser',_0xfb25da[_0xe346('0x16')],_0x1a9f00);_0x3e3bb7(_0x554cc7[_0xe346('0x15')](0x1f4,_0xfb25da[_0xe346('0x16')]));});});};exports['ShowUser']=function(_0x1cedfb){var _0x1f023e=this;return new Promise(function(_0xcb3bfe,_0x215c45){return db['User'][_0xe346('0x26')]({'raw':_0x1cedfb['options']?_0x1cedfb[_0xe346('0x1d')][_0xe346('0x1e')]===undefined?!![]:![]:!![],'where':_0x1cedfb[_0xe346('0x1d')]?_0x1cedfb[_0xe346('0x1d')]['where']||null:null,'attributes':_0x1cedfb[_0xe346('0x1d')]?_0x1cedfb[_0xe346('0x1d')][_0xe346('0x20')]||null:null,'include':_0x1cedfb['options']?_0x1cedfb[_0xe346('0x1d')]['include']?_[_0xe346('0x23')](_0x1cedfb['options'][_0xe346('0x22')],function(_0x2d9140){return{'model':db[_0x2d9140[_0xe346('0x24')]],'as':_0x2d9140['as'],'attributes':_0x2d9140[_0xe346('0x20')],'include':_0x2d9140['include']?_[_0xe346('0x23')](_0x2d9140[_0xe346('0x22')],function(_0x5e1f64){return{'model':db[_0x5e1f64['model']],'as':_0x5e1f64['as'],'attributes':_0x5e1f64[_0xe346('0x20')],'include':_0x5e1f64[_0xe346('0x22')]?_[_0xe346('0x23')](_0x5e1f64[_0xe346('0x22')],function(_0x5ff47a){return{'model':db[_0x5ff47a[_0xe346('0x24')]],'as':_0x5ff47a['as'],'attributes':_0x5ff47a[_0xe346('0x20')]};}):[]};}):[]};}):[]:[]})[_0xe346('0x10')](function(_0x54e125){logger[_0xe346('0x11')](_0xe346('0x27'),_0x1cedfb);logger['debug'](_0xe346('0x27'),_0x1cedfb,JSON[_0xe346('0x25')](_0x54e125));_0xcb3bfe(_0x54e125);})[_0xe346('0x19')](function(_0x587070){logger[_0xe346('0x15')](_0xe346('0x27'),_0x587070[_0xe346('0x16')],_0x1cedfb);_0x215c45(_0x1f023e[_0xe346('0x15')](0x1f4,_0x587070[_0xe346('0x16')]));});});};exports[_0xe346('0x28')]=function(_0x133f2c){var _0x320d43=this;return new Promise(function(_0x36776d,_0x10e305){var _0x13f2cd;return db[_0xe346('0x1b')][_0xe346('0x26')]({'where':_0x133f2c[_0xe346('0x1d')][_0xe346('0x1f')]||{},'attributes':['id','name',_0xe346('0x29'),_0xe346('0x2a'),_0xe346('0x2b')]})[_0xe346('0x10')](function(_0x3483a2){if(_0x3483a2){_0x13f2cd=_0x3483a2;return db['UserVoiceQueueRt'][_0xe346('0x2c')]({'paused':0x1},{'where':{'UserId':_0x13f2cd['id']},'individualHooks':!![]});}})[_0xe346('0x10')](function(){if(_0x13f2cd){return db[_0xe346('0x2d')][_0xe346('0x1c')]({'where':{'membername':_0x13f2cd[_0xe346('0x2e')],'type':_0xe346('0x2f'),'exitAt':null}});}})['then'](function(_0x572dfd){if(_0x13f2cd){if(_0x572dfd&&_0x572dfd[_0xe346('0x30')]){var _0x396750=moment()[_0xe346('0x31')](_0xe346('0x32'));for(var _0x2b7aa0=0x0,_0x3b854f=_0x572dfd[_0xe346('0x30')];_0x2b7aa0<_0x3b854f;_0x2b7aa0++){_0x572dfd[_0x2b7aa0][_0xe346('0x33')]({'exitAt':_0x396750});}}}})[_0xe346('0x10')](function(){if(_0x13f2cd){var _0x369dd4=[];var _0x425406=utils[_0xe346('0x34')]();_0x425406['forEach'](function(_0x3fb5fa){_0x369dd4['push']({'channel':_0x3fb5fa,'membername':_0x13f2cd[_0xe346('0x2e')],'interface':_['isNil'](_0x13f2cd[_0xe346('0x2b')])?util[_0xe346('0x31')](_0xe346('0x35'),_0x13f2cd[_0xe346('0x2e')]):_0x13f2cd[_0xe346('0x2b')],'type':_0xe346('0x2f'),'enterAt':moment()[_0xe346('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x133f2c[_0xe346('0x36')][_0xe346('0x37')]||_0xe346('0x38'),'role':_0x13f2cd[_0xe346('0x29')],'internal':_0x13f2cd[_0xe346('0x2a')],'uniqueid':_0x133f2c[_0xe346('0x36')]['uniqueid']||null});});return db[_0xe346('0x2d')]['bulkCreate'](_0x369dd4,{'individualHooks':!![]});}})[_0xe346('0x10')](function(){if(_0x13f2cd){return _0x13f2cd[_0xe346('0x2c')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x133f2c[_0xe346('0x36')][_0xe346('0x37')]||_0xe346('0x38'),'lastPauseAt':moment()['format'](_0xe346('0x32'))});}})[_0xe346('0x10')](function(_0x4fb41b){_0x36776d(_0x4fb41b);})[_0xe346('0x19')](function(_0x7dcfe2){_0x10e305(_0x320d43[_0xe346('0x15')](0x1f4,_0x7dcfe2['message']));});});};exports[_0xe346('0x39')]=function(_0x3f4e17){var _0x20c8c3=this;return new Promise(function(_0x4a3fbf,_0x39b75e){var _0x909fff;return db[_0xe346('0x1b')][_0xe346('0x3a')]({'where':_0x3f4e17[_0xe346('0x1d')][_0xe346('0x1f')]||{},'attributes':['id',_0xe346('0x2e')]})[_0xe346('0x10')](function(_0x552ed3){if(_0x552ed3){_0x909fff=_0x552ed3;if(_0x3f4e17[_0xe346('0x36')][_0xe346('0x3b')]&&!utils[_0xe346('0x3c')](_0x3f4e17[_0xe346('0x36')][_0xe346('0x3b')])){throw new Error('Unknown\x20channel');}switch(_0x3f4e17[_0xe346('0x36')][_0xe346('0x3b')]){case _0xe346('0x3d'):return db[_0xe346('0x3e')][_0xe346('0x2c')]({'paused':0x0},{'where':{'UserId':_0x909fff['id']}})[_0xe346('0x10')](function(){return db[_0xe346('0x2d')]['find']({'where':{'channel':_0x3f4e17[_0xe346('0x36')][_0xe346('0x3b')],'membername':_0x909fff[_0xe346('0x2e')],'type':_0xe346('0x2f'),'exitAt':null}});})[_0xe346('0x10')](function(_0xeab34){if(_0xeab34){return _0xeab34[_0xe346('0x2c')]({'exitAt':moment()['format'](_0xe346('0x32')),'data2':'system'},{'individualHooks':!![]});}return null;})[_0xe346('0x10')](function(){return _0x909fff[_0xe346('0x2c')]({'voicePause':![]});});case _0xe346('0x3f'):case _0xe346('0x40'):case'fax':case _0xe346('0x41'):case _0xe346('0x42'):return db['MemberReport'][_0xe346('0x26')]({'where':{'channel':_0x3f4e17['body'][_0xe346('0x3b')],'membername':_0x909fff[_0xe346('0x2e')],'type':_0xe346('0x2f'),'exitAt':null}})['then'](function(_0xc85c27){return _0xc85c27[_0xe346('0x2c')]({'exitAt':moment()[_0xe346('0x31')](_0xe346('0x32')),'data2':'system'},{'individualHooks':!![]});})[_0xe346('0x10')](function(){var _0x424e30={};_[_0xe346('0x43')](_0x424e30,util[_0xe346('0x31')](_0xe346('0x44'),_0x3f4e17[_0xe346('0x36')]['channel'],_0xe346('0x45')),![]);return _0x909fff[_0xe346('0x2c')](_0x424e30);});default:return db[_0xe346('0x3e')][_0xe346('0x2c')]({'paused':0x0},{'where':{'UserId':_0x909fff['id']}})[_0xe346('0x10')](function(){return db[_0xe346('0x2d')]['findAll']({'where':{'membername':_0x909fff[_0xe346('0x2e')],'type':'PAUSE','exitAt':null}});})['then'](function(_0x20e523){var _0x53e803=[];_0x20e523[_0xe346('0x46')](function(_0x154b68){_0x53e803[_0xe346('0x47')](_0x154b68[_0xe346('0x2c')]({'exitAt':moment()[_0xe346('0x31')](_0xe346('0x32')),'data2':'system'}));});return BPromise[_0xe346('0x48')](_0x53e803);})['then'](function(){return _0x909fff[_0xe346('0x2c')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xe346('0x10')](function(_0x120697){_0x4a3fbf(_0x120697);})[_0xe346('0x19')](function(_0x3d6866){_0x39b75e(_0x20c8c3[_0xe346('0x15')](0x1f4,_0x3d6866[_0xe346('0x16')]));});});};exports['LogoutUser']=function(_0x54e5cd){var _0x34f1eb=this;return new Promise(function(_0x434fcf,_0x3c3eda){var _0xe13f69;return db[_0xe346('0x1b')][_0xe346('0x3a')]({'where':_0x54e5cd[_0xe346('0x1d')][_0xe346('0x1f')]||{},'attributes':['id',_0xe346('0x2e')]})[_0xe346('0x10')](function(_0x8adf09){if(_0x8adf09){_0xe13f69=_0x8adf09;return db[_0xe346('0x3e')][_0xe346('0x49')]({'where':{'membername':_0xe13f69[_0xe346('0x2e')]},'individualHooks':!![]});}})[_0xe346('0x10')](function(){if(_0xe13f69){return db[_0xe346('0x2d')][_0xe346('0x1c')]({'where':{'membername':_0xe13f69[_0xe346('0x2e')],'exitAt':null}});}})['then'](function(_0x2f6d46){if(_0xe13f69){if(_0x2f6d46&&_0x2f6d46[_0xe346('0x30')]){var _0x4482a6=[];_0x2f6d46[_0xe346('0x46')](function(_0xd7992e){_0x4482a6['push'](_0xd7992e[_0xe346('0x2c')]({'exitAt':moment()[_0xe346('0x31')](_0xe346('0x32'))}));});return BPromise['all'](_0x4482a6);}}})[_0xe346('0x10')](function(){if(_0xe13f69){return _0xe13f69[_0xe346('0x2c')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})['then'](function(_0x420d7c){_0x434fcf(_0x420d7c);})[_0xe346('0x19')](function(_0x6bf424){_0x3c3eda(_0x34f1eb[_0xe346('0x15')](0x1f4,_0x6bf424[_0xe346('0x16')]));});});};exports[_0xe346('0x4a')]=function(_0x5d61d7){var _0x13836b=this;return new Promise(function(_0x18a546,_0x131949){var _0x562a98;var _0x2f756b;var _0x5ec81b;var _0x11f1ae;return db[_0xe346('0x1b')][_0xe346('0x3a')]({'where':_0x5d61d7[_0xe346('0x1d')][_0xe346('0x1f')]||{},'attributes':['id',_0xe346('0x2e'),_0xe346('0x29'),_0xe346('0x4b'),_0xe346('0x4c'),_0xe346('0x2a'),_0xe346('0x4d'),_0xe346('0x2b')]})[_0xe346('0x10')](function(_0x3e1fff){if(_0x3e1fff){_0x562a98=_0x3e1fff;_0x11f1ae=_0x5d61d7['body'][_0xe346('0x2b')]?_0x5d61d7[_0xe346('0x36')][_0xe346('0x2b')]:util[_0xe346('0x31')](_0xe346('0x35'),_0x562a98[_0xe346('0x2e')]);return db[_0xe346('0x1b')][_0xe346('0x4e')]({'where':{'role':_0xe346('0x4f'),'online':!![],'id':{'$ne':_0x562a98['id']}}});}})['then'](function(_0x4f27de){if(_0x4f27de){_0x5ec81b=_0x4f27de;return require(_0xe346('0x50'))[_0xe346('0x51')]();}})[_0xe346('0x10')](function(_0x27be84){if(_0x27be84&&_0x27be84['agents']&&_0x5ec81b>=_0x27be84['agents']){throw new Error('Maximum\x20login\x20has\x20been\x20reached');}})[_0xe346('0x10')](function(){if(_0x562a98){return db[_0xe346('0x3e')][_0xe346('0x49')]({'where':{'membername':_0x562a98[_0xe346('0x2e')]},'individualHooks':!![]});}})[_0xe346('0x10')](function(){if(_0x562a98){return _0x562a98['getVoiceQueues']({'raw':!![]});}})[_0xe346('0x10')](function(_0x22e857){if(_0x562a98){if(_0x22e857){var _0x5f5ac4=[];_0x2f756b=_0x22e857;if(_0x2f756b[_0xe346('0x30')]){for(var _0x5a6dda=0x0;_0x5a6dda<_0x2f756b[_0xe346('0x30')];_0x5a6dda++){_0x5f5ac4[_0xe346('0x47')](db[_0xe346('0x3e')]['upsert']({'membername':_0x562a98[_0xe346('0x2e')],'UserId':_0x562a98['id'],'queue_name':_0x2f756b[_0x5a6dda][_0xe346('0x2e')],'VoiceQueueId':_0x2f756b[_0x5a6dda]['id'],'interface':_0x11f1ae,'paused':_0x562a98['loginInPause']||![],'penalty':_0x2f756b[_0x5a6dda]['UserVoiceQueue.penalty']||0x0}));}return BPromise[_0xe346('0x48')](_0x5f5ac4);}}}})[_0xe346('0x10')](function(){if(_0x562a98){return db[_0xe346('0x2d')]['findAll']({'where':{'membername':_0x562a98[_0xe346('0x2e')],'exitAt':null}});}})[_0xe346('0x10')](function(_0x33a2ee){if(_0x562a98){if(_0x33a2ee&&_0x33a2ee['length']){var _0x1c7c84=[];_0x33a2ee['forEach'](function(_0x4aaf52){_0x1c7c84[_0xe346('0x47')](_0x4aaf52[_0xe346('0x2c')]({'exitAt':moment()[_0xe346('0x31')](_0xe346('0x32'))}));});return BPromise[_0xe346('0x48')](_0x1c7c84);}}})[_0xe346('0x10')](function(_0x4dbc5b){if(_0x562a98){var _0x244ee5=[];var _0x5424d5=[];var _0x47ad54=utils[_0xe346('0x34')]();var _0x412f56={'membername':_0x562a98[_0xe346('0x2e')],'interface':_0x11f1ae,'enterAt':moment()[_0xe346('0x31')](_0xe346('0x32')),'role':_0x562a98[_0xe346('0x29')],'internal':_0x562a98[_0xe346('0x2a')]};_0x47ad54['forEach'](function(_0x5ef822){_0x244ee5[_0xe346('0x47')](_[_0xe346('0x52')]({'channel':_0x5ef822,'type':_0xe346('0x53'),'data1':_0xe346('0x54'),'data2':_0x11f1ae},_0x412f56));if(_0x562a98[_0xe346('0x4d')]){_0x5424d5[_0xe346('0x47')](_[_0xe346('0x52')]({'channel':_0x5ef822,'type':'PAUSE','data1':'LOGININPAUSE'},_0x412f56));}});return db[_0xe346('0x2d')][_0xe346('0x55')](_0x244ee5[_0xe346('0x56')](_0x5424d5),{'individualHooks':!![]});}})['then'](function(){if(_0x562a98){return _0x562a98[_0xe346('0x2c')]({'online':!![],'lastLoginAt':moment()[_0xe346('0x31')](_0xe346('0x32')),'voicePause':_0x562a98[_0xe346('0x4d')]||![],'mailPause':_0x562a98[_0xe346('0x4d')]||![],'chatPause':_0x562a98['loginInPause']||![],'faxPause':_0x562a98['loginInPause']||![],'smsPause':_0x562a98[_0xe346('0x4d')]||![],'openchannelPause':_0x562a98[_0xe346('0x4d')]||![],'pauseType':_0x562a98['loginInPause']?_0xe346('0x57'):null,'lastPauseAt':moment()[_0xe346('0x31')]('YYYY-MM-DD\x20HH:mm:ss'),'interface':_0x11f1ae});}})[_0xe346('0x10')](function(_0x2ce9bb){_0x18a546(_0x2ce9bb);})[_0xe346('0x19')](function(_0xac77db){_0x131949(_0x13836b[_0xe346('0x15')](0x1f4,_0xac77db[_0xe346('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index a418626..f87aac3 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 _0xaaba=['update','emit','register','length','user:','save','remove'];(function(_0x3c7e74,_0x431a67){var _0x5e7924=function(_0x39e11f){while(--_0x39e11f){_0x3c7e74['push'](_0x3c7e74['shift']());}};_0x5e7924(++_0x431a67);}(_0xaaba,0xb4));var _0xaaab=function(_0x26521a,_0x24940f){_0x26521a=_0x26521a-0x0;var _0x17cea1=_0xaaba[_0x26521a];return _0x17cea1;};'use strict';var UserEvents=require('./user.events');var events=[_0xaaab('0x0'),_0xaaab('0x1'),_0xaaab('0x2')];function createListener(_0x1eaa2e,_0x1482f1){return function(_0x4e4d87){_0x1482f1[_0xaaab('0x3')](_0x1eaa2e,_0x4e4d87);};}function removeListener(_0x2583c9,_0x3cbe0c){return function(){UserEvents['removeListener'](_0x2583c9,_0x3cbe0c);};}exports[_0xaaab('0x4')]=function(_0x1db88c){for(var _0x48b5f7=0x0,_0x2879f2=events[_0xaaab('0x5')];_0x48b5f7<_0x2879f2;_0x48b5f7++){var _0x2a7427=events[_0x48b5f7];var _0x40be56=createListener(_0xaaab('0x6')+_0x2a7427,_0x1db88c);UserEvents['on'](_0x2a7427,_0x40be56);}}; \ No newline at end of file +var _0x05e1=['user:','./user.events','update','emit','removeListener','register','length'];(function(_0x42594f,_0x4612de){var _0x4ca5fa=function(_0x148b07){while(--_0x148b07){_0x42594f['push'](_0x42594f['shift']());}};_0x4ca5fa(++_0x4612de);}(_0x05e1,0x78));var _0x105e=function(_0x59c140,_0x209cef){_0x59c140=_0x59c140-0x0;var _0x190d1d=_0x05e1[_0x59c140];return _0x190d1d;};'use strict';var UserEvents=require(_0x105e('0x0'));var events=['save','remove',_0x105e('0x1')];function createListener(_0xe37ec5,_0x31a75d){return function(_0x1f875a){_0x31a75d[_0x105e('0x2')](_0xe37ec5,_0x1f875a);};}function removeListener(_0xc1cf4f,_0x1f4409){return function(){UserEvents[_0x105e('0x3')](_0xc1cf4f,_0x1f4409);};}exports[_0x105e('0x4')]=function(_0x4d5b31){for(var _0x88266f=0x0,_0x2f71cf=events[_0x105e('0x5')];_0x88266f<_0x2f71cf;_0x88266f++){var _0x7d4be3=events[_0x88266f];var _0x3f1d00=createListener(_0x105e('0x6')+_0x7d4be3,_0x4d5b31);UserEvents['on'](_0x7d4be3,_0x3f1d00);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 4bb06a4..1c2e25b 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 _0x5bad=['Router','../../components/auth/service','../../components/interaction/service','exports','multer','path','connect-timeout'];(function(_0x2211ed,_0x1bca0b){var _0x4d78cc=function(_0x467b59){while(--_0x467b59){_0x2211ed['push'](_0x2211ed['shift']());}};_0x4d78cc(++_0x1bca0b);}(_0x5bad,0x1d2));var _0xd5ba=function(_0x40d013,_0x265e67){_0x40d013=_0x40d013-0x0;var _0x3673a4=_0x5bad[_0x40d013];return _0x3673a4;};'use strict';var multer=require(_0xd5ba('0x0'));var util=require('util');var path=require(_0xd5ba('0x1'));var timeout=require(_0xd5ba('0x2'));var express=require('express');var router=express[_0xd5ba('0x3')]();var auth=require(_0xd5ba('0x4'));var interaction=require(_0xd5ba('0x5'));var config=require('../../config/environment');module[_0xd5ba('0x6')]=router; \ No newline at end of file +var _0xa292=['multer','util','path','connect-timeout','express','Router','../../config/environment','exports'];(function(_0xcda377,_0x1e2678){var _0x1c024f=function(_0x1aeb61){while(--_0x1aeb61){_0xcda377['push'](_0xcda377['shift']());}};_0x1c024f(++_0x1e2678);}(_0xa292,0x80));var _0x2a29=function(_0x16d345,_0x13c7c8){_0x16d345=_0x16d345-0x0;var _0x293935=_0xa292[_0x16d345];return _0x293935;};'use strict';var multer=require(_0x2a29('0x0'));var util=require(_0x2a29('0x1'));var path=require(_0x2a29('0x2'));var timeout=require(_0x2a29('0x3'));var express=require(_0x2a29('0x4'));var router=express[_0x2a29('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2a29('0x6'));module[_0x2a29('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 88f6852..f3eba15 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 _0xbaf0=['exports','INTEGER'];(function(_0x2a723e,_0x61bb43){var _0x48a0e1=function(_0x470e57){while(--_0x470e57){_0x2a723e['push'](_0x2a723e['shift']());}};_0x48a0e1(++_0x61bb43);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x13adf9,_0x1e260d){var _0x2ddba5=function(_0x5b3317){while(--_0x5b3317){_0x13adf9['push'](_0x13adf9['shift']());}};_0x2ddba5(++_0x1e260d);}(_0xe706,0xa3));var _0x6e70=function(_0x100e28,_0x14a38e){_0x100e28=_0x100e28-0x0;var _0x11213e=_0xe706[_0x100e28];return _0x11213e;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index d0199d7..32fe860 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 _0xb4f8=['../../config/logger','api','moment','bluebird','request-promise','rimraf','./userChatQueue.attributes','exports','define','user_has_chat_queues','util'];(function(_0x2aec52,_0x59d962){var _0x3b8835=function(_0x3e2604){while(--_0x3e2604){_0x2aec52['push'](_0x2aec52['shift']());}};_0x3b8835(++_0x59d962);}(_0xb4f8,0x83));var _0x8b4f=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xb4f8[_0x2aec52];return _0x3b8835;};'use strict';var _=require('lodash');var util=require(_0x8b4f('0x0'));var logger=require(_0x8b4f('0x1'))(_0x8b4f('0x2'));var moment=require(_0x8b4f('0x3'));var BPromise=require(_0x8b4f('0x4'));var rp=require(_0x8b4f('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x8b4f('0x6'));var config=require('../../config/environment');var attributes=require(_0x8b4f('0x7'));module[_0x8b4f('0x8')]=function(_0x533e63,_0x17e04f){return _0x533e63[_0x8b4f('0x9')]('UserChatQueue',attributes,{'tableName':_0x8b4f('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf11e=['define','UserChatQueue','user_has_chat_queues','lodash','../../config/logger','api','moment','path','./userChatQueue.attributes','exports'];(function(_0x427811,_0x20416f){var _0x26b841=function(_0x3bbba9){while(--_0x3bbba9){_0x427811['push'](_0x427811['shift']());}};_0x26b841(++_0x20416f);}(_0xf11e,0x11b));var _0xef11=function(_0x2403f4,_0x51a88f){_0x2403f4=_0x2403f4-0x0;var _0xc9722e=_0xf11e[_0x2403f4];return _0xc9722e;};'use strict';var _=require(_0xef11('0x0'));var util=require('util');var logger=require(_0xef11('0x1'))(_0xef11('0x2'));var moment=require(_0xef11('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xef11('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xef11('0x5'));module[_0xef11('0x6')]=function(_0x245f2b,_0x22078c){return _0x245f2b[_0xef11('0x7')](_0xef11('0x8'),attributes,{'tableName':_0xef11('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.rpc.js b/server/api/userChatQueue/userChatQueue.rpc.js index 100e640..0a304ad 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 _0x6a9c=['../../config/environment','jayson/promise','http','request','then','info','UserChatQueue,\x20%s,\x20%s','debug','request\x20sent','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xcf4260,_0xe48af6){var _0x5ad781=function(_0x4ab8c9){while(--_0x4ab8c9){_0xcf4260['push'](_0xcf4260['shift']());}};_0x5ad781(++_0xe48af6);}(_0x6a9c,0x148));var _0xc6a9=function(_0x2f464a,_0x4f3203){_0x2f464a=_0x2f464a-0x0;var _0x40e72b=_0x6a9c[_0x2f464a];return _0x40e72b;};'use strict';var _=require(_0xc6a9('0x0'));var util=require(_0xc6a9('0x1'));var moment=require('moment');var BPromise=require(_0xc6a9('0x2'));var rs=require(_0xc6a9('0x3'));var fs=require('fs');var Redis=require(_0xc6a9('0x4'));var db=require(_0xc6a9('0x5'))['db'];var utils=require(_0xc6a9('0x6'));var logger=require(_0xc6a9('0x7'))('rpc');var config=require(_0xc6a9('0x8'));var jayson=require(_0xc6a9('0x9'));var client=jayson['client'][_0xc6a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1e4bb3,_0x646abd,_0x3eccbd){return new BPromise(function(_0x3d0aa3,_0x4cf21f){return client[_0xc6a9('0xb')](_0x1e4bb3,_0x3eccbd)[_0xc6a9('0xc')](function(_0x389b89){logger[_0xc6a9('0xd')](_0xc6a9('0xe'),_0x646abd,'request\x20sent');logger[_0xc6a9('0xf')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x646abd,_0xc6a9('0x10'),JSON['stringify'](_0x389b89));if(_0x389b89[_0xc6a9('0x11')]){if(_0x389b89[_0xc6a9('0x11')]['code']===0x1f4){logger['error']('UserChatQueue,\x20%s,\x20%s',_0x646abd,_0x389b89['error'][_0xc6a9('0x12')]);return _0x4cf21f(_0x389b89[_0xc6a9('0x11')][_0xc6a9('0x12')]);}logger['error'](_0xc6a9('0xe'),_0x646abd,_0x389b89[_0xc6a9('0x11')][_0xc6a9('0x12')]);return _0x3d0aa3(_0x389b89[_0xc6a9('0x11')]['message']);}else{logger[_0xc6a9('0xd')]('UserChatQueue,\x20%s,\x20%s',_0x646abd,_0xc6a9('0x10'));_0x3d0aa3(_0x389b89[_0xc6a9('0x13')][_0xc6a9('0x12')]);}})[_0xc6a9('0x14')](function(_0x2c39b3){logger[_0xc6a9('0x11')](_0xc6a9('0xe'),_0x646abd,_0x2c39b3);_0x4cf21f(_0x2c39b3);});});} \ No newline at end of file +var _0xd95b=['request\x20sent','error','message','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','then','info','UserChatQueue,\x20%s,\x20%s'];(function(_0x56df3f,_0x571e4f){var _0x3007a8=function(_0x511165){while(--_0x511165){_0x56df3f['push'](_0x56df3f['shift']());}};_0x3007a8(++_0x571e4f);}(_0xd95b,0x8b));var _0xbd95=function(_0x7edae7,_0x1d7ea7){_0x7edae7=_0x7edae7-0x0;var _0x49adf0=_0xd95b[_0x7edae7];return _0x49adf0;};'use strict';var _=require(_0xbd95('0x0'));var util=require(_0xbd95('0x1'));var moment=require(_0xbd95('0x2'));var BPromise=require(_0xbd95('0x3'));var rs=require(_0xbd95('0x4'));var fs=require('fs');var Redis=require(_0xbd95('0x5'));var db=require(_0xbd95('0x6'))['db'];var utils=require(_0xbd95('0x7'));var logger=require(_0xbd95('0x8'))('rpc');var config=require(_0xbd95('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xbd95('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16027a,_0xa0bf44,_0x4e8044){return new BPromise(function(_0x45c0a3,_0x26811b){return client['request'](_0x16027a,_0x4e8044)[_0xbd95('0xb')](function(_0x5d6db2){logger[_0xbd95('0xc')](_0xbd95('0xd'),_0xa0bf44,_0xbd95('0xe'));logger['debug']('UserChatQueue,\x20%s,\x20%s,\x20%s',_0xa0bf44,_0xbd95('0xe'),JSON['stringify'](_0x5d6db2));if(_0x5d6db2[_0xbd95('0xf')]){if(_0x5d6db2[_0xbd95('0xf')]['code']===0x1f4){logger[_0xbd95('0xf')](_0xbd95('0xd'),_0xa0bf44,_0x5d6db2[_0xbd95('0xf')]['message']);return _0x26811b(_0x5d6db2[_0xbd95('0xf')][_0xbd95('0x10')]);}logger[_0xbd95('0xf')](_0xbd95('0xd'),_0xa0bf44,_0x5d6db2[_0xbd95('0xf')]['message']);return _0x45c0a3(_0x5d6db2[_0xbd95('0xf')][_0xbd95('0x10')]);}else{logger[_0xbd95('0xc')]('UserChatQueue,\x20%s,\x20%s',_0xa0bf44,'request\x20sent');_0x45c0a3(_0x5d6db2['result']['message']);}})['catch'](function(_0xd3776d){logger[_0xbd95('0xf')]('UserChatQueue,\x20%s,\x20%s',_0xa0bf44,_0xd3776d);_0x26811b(_0xd3776d);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 614aeda..c14f1d3 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 _0xf122=['express','Router','../../components/auth/service','../../config/environment','exports','path','connect-timeout'];(function(_0x550e29,_0x4047f){var _0x3515b6=function(_0x303fe2){while(--_0x303fe2){_0x550e29['push'](_0x550e29['shift']());}};_0x3515b6(++_0x4047f);}(_0xf122,0x10f));var _0x2f12=function(_0x2f3c1e,_0x37d42f){_0x2f3c1e=_0x2f3c1e-0x0;var _0x51d4bf=_0xf122[_0x2f3c1e];return _0x51d4bf;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x2f12('0x0'));var timeout=require(_0x2f12('0x1'));var express=require(_0x2f12('0x2'));var router=express[_0x2f12('0x3')]();var auth=require(_0x2f12('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2f12('0x5'));module[_0x2f12('0x6')]=router; \ No newline at end of file +var _0x51c0=['../../components/interaction/service','../../config/environment','exports','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x4e18bb,_0x2b28df){var _0x5ebf1f=function(_0x2f43cc){while(--_0x2f43cc){_0x4e18bb['push'](_0x4e18bb['shift']());}};_0x5ebf1f(++_0x2b28df);}(_0x51c0,0x173));var _0x051c=function(_0x319bbf,_0x2dc921){_0x319bbf=_0x319bbf-0x0;var _0x4c6a32=_0x51c0[_0x319bbf];return _0x4c6a32;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x051c('0x0'));var timeout=require(_0x051c('0x1'));var express=require(_0x051c('0x2'));var router=express[_0x051c('0x3')]();var auth=require(_0x051c('0x4'));var interaction=require(_0x051c('0x5'));var config=require(_0x051c('0x6'));module[_0x051c('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 56d639f..a7769c0 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 _0xe5b5=['exports','INTEGER','STRING','sequelize'];(function(_0x9213a5,_0x5aeddb){var _0x31353c=function(_0x50eaa6){while(--_0x50eaa6){_0x9213a5['push'](_0x9213a5['shift']());}};_0x31353c(++_0x5aeddb);}(_0xe5b5,0x12b));var _0x5e5b=function(_0x4ee9cd,_0xd375b0){_0x4ee9cd=_0x4ee9cd-0x0;var _0x328a5b=_0xe5b5[_0x4ee9cd];return _0x328a5b;};'use strict';var Sequelize=require(_0x5e5b('0x0'));module[_0x5e5b('0x1')]={'penalty':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x5e5b('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0x5e5b('0x3')]}}; \ No newline at end of file +var _0x1eba=['exports','INTEGER','STRING','sequelize'];(function(_0x17c496,_0x54e30e){var _0x58d4d3=function(_0x5f592d){while(--_0x5f592d){_0x17c496['push'](_0x17c496['shift']());}};_0x58d4d3(++_0x54e30e);}(_0x1eba,0x1d7));var _0xa1eb=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x1eba[_0x134c2e];return _0x2825db;};'use strict';var Sequelize=require(_0xa1eb('0x0'));module[_0xa1eb('0x1')]={'penalty':{'type':Sequelize[_0xa1eb('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xa1eb('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xa1eb('0x3')]}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 1c0254d..603ad23 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 _0x5b3c=['exports','define','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment'];(function(_0x5b26cb,_0x527ab0){var _0x563d12=function(_0x472b38){while(--_0x472b38){_0x5b26cb['push'](_0x5b26cb['shift']());}};_0x563d12(++_0x527ab0);}(_0x5b3c,0x1f0));var _0xc5b3=function(_0x3a9d7c,_0x5282e6){_0x3a9d7c=_0x3a9d7c-0x0;var _0x53a2d9=_0x5b3c[_0x3a9d7c];return _0x53a2d9;};'use strict';var _=require(_0xc5b3('0x0'));var util=require(_0xc5b3('0x1'));var logger=require(_0xc5b3('0x2'))(_0xc5b3('0x3'));var moment=require(_0xc5b3('0x4'));var BPromise=require(_0xc5b3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc5b3('0x6'));var rimraf=require('rimraf');var config=require(_0xc5b3('0x7'));var attributes=require('./userFaxQueue.attributes');module[_0xc5b3('0x8')]=function(_0x5ce31c,_0x1191e3){return _0x5ce31c[_0xc5b3('0x9')](_0xc5b3('0xa'),attributes,{'tableName':_0xc5b3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa988=['path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','UserFaxQueue','user_has_fax_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x39bdd2,_0x5c38db){var _0x41e2f5=function(_0x6c271c){while(--_0x6c271c){_0x39bdd2['push'](_0x39bdd2['shift']());}};_0x41e2f5(++_0x5c38db);}(_0xa988,0x1a7));var _0x8a98=function(_0x5002d4,_0x16f544){_0x5002d4=_0x5002d4-0x0;var _0x5de0eb=_0xa988[_0x5002d4];return _0x5de0eb;};'use strict';var _=require(_0x8a98('0x0'));var util=require(_0x8a98('0x1'));var logger=require(_0x8a98('0x2'))(_0x8a98('0x3'));var moment=require(_0x8a98('0x4'));var BPromise=require('bluebird');var rp=require(_0x8a98('0x5'));var fs=require('fs');var path=require(_0x8a98('0x6'));var rimraf=require(_0x8a98('0x7'));var config=require(_0x8a98('0x8'));var attributes=require(_0x8a98('0x9'));module[_0x8a98('0xa')]=function(_0x3eb5cf,_0x3fcd06){return _0x3eb5cf['define'](_0x8a98('0xb'),attributes,{'tableName':_0x8a98('0xc'),'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 ff4672b..c509579 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 _0xec5b=['../../config/environment','client','http','info','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','UserFaxQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc'];(function(_0x2c2b49,_0x4341e4){var _0x35c70a=function(_0x123ea4){while(--_0x123ea4){_0x2c2b49['push'](_0x2c2b49['shift']());}};_0x35c70a(++_0x4341e4);}(_0xec5b,0x175));var _0xbec5=function(_0x48f324,_0x3302fe){_0x48f324=_0x48f324-0x0;var _0x5c91c2=_0xec5b[_0x48f324];return _0x5c91c2;};'use strict';var _=require(_0xbec5('0x0'));var util=require('util');var moment=require(_0xbec5('0x1'));var BPromise=require('bluebird');var rs=require(_0xbec5('0x2'));var fs=require('fs');var Redis=require(_0xbec5('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbec5('0x4'));var logger=require(_0xbec5('0x5'))(_0xbec5('0x6'));var config=require(_0xbec5('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xbec5('0x8')][_0xbec5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1a17fd,_0x113a2e,_0x20499d){return new BPromise(function(_0x1be34c,_0x45d5be){return client['request'](_0x1a17fd,_0x20499d)['then'](function(_0x4b6b3d){logger[_0xbec5('0xa')]('UserFaxQueue,\x20%s,\x20%s',_0x113a2e,'request\x20sent');logger[_0xbec5('0xb')](_0xbec5('0xc'),_0x113a2e,_0xbec5('0xd'),JSON[_0xbec5('0xe')](_0x4b6b3d));if(_0x4b6b3d[_0xbec5('0xf')]){if(_0x4b6b3d[_0xbec5('0xf')]['code']===0x1f4){logger[_0xbec5('0xf')](_0xbec5('0x10'),_0x113a2e,_0x4b6b3d[_0xbec5('0xf')]['message']);return _0x45d5be(_0x4b6b3d[_0xbec5('0xf')]['message']);}logger[_0xbec5('0xf')](_0xbec5('0x10'),_0x113a2e,_0x4b6b3d[_0xbec5('0xf')]['message']);return _0x1be34c(_0x4b6b3d[_0xbec5('0xf')][_0xbec5('0x11')]);}else{logger[_0xbec5('0xa')](_0xbec5('0x10'),_0x113a2e,_0xbec5('0xd'));_0x1be34c(_0x4b6b3d[_0xbec5('0x12')][_0xbec5('0x11')]);}})[_0xbec5('0x13')](function(_0x3e9430){logger['error'](_0xbec5('0x10'),_0x113a2e,_0x3e9430);_0x45d5be(_0x3e9430);});});} \ No newline at end of file +var _0x4838=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserFaxQueue,\x20%s,\x20%s','debug','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','util','bluebird'];(function(_0x40012d,_0x4824e7){var _0x186865=function(_0x3e947e){while(--_0x3e947e){_0x40012d['push'](_0x40012d['shift']());}};_0x186865(++_0x4824e7);}(_0x4838,0x111));var _0x8483=function(_0x487d96,_0x591da9){_0x487d96=_0x487d96-0x0;var _0x2bba0d=_0x4838[_0x487d96];return _0x2bba0d;};'use strict';var _=require('lodash');var util=require(_0x8483('0x0'));var moment=require('moment');var BPromise=require(_0x8483('0x1'));var rs=require(_0x8483('0x2'));var fs=require('fs');var Redis=require(_0x8483('0x3'));var db=require(_0x8483('0x4'))['db'];var utils=require(_0x8483('0x5'));var logger=require(_0x8483('0x6'))(_0x8483('0x7'));var config=require(_0x8483('0x8'));var jayson=require(_0x8483('0x9'));var client=jayson[_0x8483('0xa')][_0x8483('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x169df1,_0x308de4,_0x5efc2b){return new BPromise(function(_0x47ad02,_0x583805){return client[_0x8483('0xc')](_0x169df1,_0x5efc2b)[_0x8483('0xd')](function(_0x3b44ba){logger[_0x8483('0xe')](_0x8483('0xf'),_0x308de4,'request\x20sent');logger[_0x8483('0x10')](_0x8483('0x11'),_0x308de4,'request\x20sent',JSON[_0x8483('0x12')](_0x3b44ba));if(_0x3b44ba[_0x8483('0x13')]){if(_0x3b44ba['error'][_0x8483('0x14')]===0x1f4){logger['error'](_0x8483('0xf'),_0x308de4,_0x3b44ba['error']['message']);return _0x583805(_0x3b44ba['error'][_0x8483('0x15')]);}logger['error'](_0x8483('0xf'),_0x308de4,_0x3b44ba[_0x8483('0x13')]['message']);return _0x47ad02(_0x3b44ba[_0x8483('0x13')][_0x8483('0x15')]);}else{logger[_0x8483('0xe')](_0x8483('0xf'),_0x308de4,_0x8483('0x16'));_0x47ad02(_0x3b44ba[_0x8483('0x17')][_0x8483('0x15')]);}})[_0x8483('0x18')](function(_0xd2d36a){logger[_0x8483('0x13')]('UserFaxQueue,\x20%s,\x20%s',_0x308de4,_0xd2d36a);_0x583805(_0xd2d36a);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index b78d153..6caaf64 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 _0xa0c7=['connect-timeout','express','Router','../../components/auth/service','../../config/environment','exports','multer','util','path'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xa0c7,0x8d));var _0x7a0c=function(_0xdedb47,_0x2e9bfa){_0xdedb47=_0xdedb47-0x0;var _0x3f64ca=_0xa0c7[_0xdedb47];return _0x3f64ca;};'use strict';var multer=require(_0x7a0c('0x0'));var util=require(_0x7a0c('0x1'));var path=require(_0x7a0c('0x2'));var timeout=require(_0x7a0c('0x3'));var express=require(_0x7a0c('0x4'));var router=express[_0x7a0c('0x5')]();var auth=require(_0x7a0c('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7a0c('0x7'));module[_0x7a0c('0x8')]=router; \ No newline at end of file +var _0xad58=['multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x445510,_0x171042){var _0x5043a3=function(_0x3f88b0){while(--_0x3f88b0){_0x445510['push'](_0x445510['shift']());}};_0x5043a3(++_0x171042);}(_0xad58,0x1b8));var _0x8ad5=function(_0x294b68,_0x3f0093){_0x294b68=_0x294b68-0x0;var _0x4b104b=_0xad58[_0x294b68];return _0x4b104b;};'use strict';var multer=require(_0x8ad5('0x0'));var util=require('util');var path=require(_0x8ad5('0x1'));var timeout=require(_0x8ad5('0x2'));var express=require(_0x8ad5('0x3'));var router=express['Router']();var auth=require(_0x8ad5('0x4'));var interaction=require(_0x8ad5('0x5'));var config=require(_0x8ad5('0x6'));module[_0x8ad5('0x7')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index 3ad11bf..e73c413 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 _0xbaf0=['exports','INTEGER'];(function(_0xa223ad,_0x5a574b){var _0x306d47=function(_0x4b19ab){while(--_0x4b19ab){_0xa223ad['push'](_0xa223ad['shift']());}};_0x306d47(++_0x5a574b);}(_0xbaf0,0x12a));var _0x0baf=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0xbaf0[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x54a802,_0x255b4d){var _0x57e6cc=function(_0x7e2d4){while(--_0x7e2d4){_0x54a802['push'](_0x54a802['shift']());}};_0x57e6cc(++_0x255b4d);}(_0xe706,0xa3));var _0x6e70=function(_0x1fcc1e,_0x39efee){_0x1fcc1e=_0x1fcc1e-0x0;var _0x13497a=_0xe706[_0x1fcc1e];return _0x13497a;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.model.js b/server/api/userMailQueue/userMailQueue.model.js index f2cb855..89f77df 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 _0x2032=['user_has_mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./userMailQueue.attributes','exports','define','UserMailQueue'];(function(_0x5c3354,_0x1fd3cf){var _0x267695=function(_0x4c7dbb){while(--_0x4c7dbb){_0x5c3354['push'](_0x5c3354['shift']());}};_0x267695(++_0x1fd3cf);}(_0x2032,0xd9));var _0x2203=function(_0x47cca7,_0x1866c8){_0x47cca7=_0x47cca7-0x0;var _0x323743=_0x2032[_0x47cca7];return _0x323743;};'use strict';var _=require('lodash');var util=require(_0x2203('0x0'));var logger=require(_0x2203('0x1'))(_0x2203('0x2'));var moment=require('moment');var BPromise=require(_0x2203('0x3'));var rp=require(_0x2203('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x2203('0x5'));var config=require(_0x2203('0x6'));var attributes=require(_0x2203('0x7'));module[_0x2203('0x8')]=function(_0x3f7ba1,_0x13367a){return _0x3f7ba1[_0x2203('0x9')](_0x2203('0xa'),attributes,{'tableName':_0x2203('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x35eee7,_0x298d51){var _0x1fe2b3=function(_0xd07d07){while(--_0xd07d07){_0x35eee7['push'](_0x35eee7['shift']());}};_0x1fe2b3(++_0x298d51);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.rpc.js b/server/api/userMailQueue/userMailQueue.rpc.js index 01f558d..6473975 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 _0x15c5=['result','catch','lodash','randomstring','ioredis','../../mysqldb','../../config/environment','request','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x5ac1d4,_0x569604){var _0x5be735=function(_0x45523c){while(--_0x45523c){_0x5ac1d4['push'](_0x5ac1d4['shift']());}};_0x5be735(++_0x569604);}(_0x15c5,0x192));var _0x515c=function(_0x61b3ab,_0x1fc298){_0x61b3ab=_0x61b3ab-0x0;var _0x57097f=_0x15c5[_0x61b3ab];return _0x57097f;};'use strict';var _=require(_0x515c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x515c('0x1'));var fs=require('fs');var Redis=require(_0x515c('0x2'));var db=require(_0x515c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x515c('0x4'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x57954d,_0x2cafa7,_0x3d2e97){return new BPromise(function(_0x48dc2a,_0x5828fc){return client[_0x515c('0x5')](_0x57954d,_0x3d2e97)['then'](function(_0x510b87){logger[_0x515c('0x6')](_0x515c('0x7'),_0x2cafa7,_0x515c('0x8'));logger['debug'](_0x515c('0x9'),_0x2cafa7,_0x515c('0x8'),JSON[_0x515c('0xa')](_0x510b87));if(_0x510b87[_0x515c('0xb')]){if(_0x510b87[_0x515c('0xb')][_0x515c('0xc')]===0x1f4){logger[_0x515c('0xb')](_0x515c('0x7'),_0x2cafa7,_0x510b87['error'][_0x515c('0xd')]);return _0x5828fc(_0x510b87[_0x515c('0xb')][_0x515c('0xd')]);}logger[_0x515c('0xb')](_0x515c('0x7'),_0x2cafa7,_0x510b87[_0x515c('0xb')][_0x515c('0xd')]);return _0x48dc2a(_0x510b87[_0x515c('0xb')][_0x515c('0xd')]);}else{logger[_0x515c('0x6')]('UserMailQueue,\x20%s,\x20%s',_0x2cafa7,'request\x20sent');_0x48dc2a(_0x510b87[_0x515c('0xe')][_0x515c('0xd')]);}})[_0x515c('0xf')](function(_0x1f54ed){logger[_0x515c('0xb')]('UserMailQueue,\x20%s,\x20%s',_0x2cafa7,_0x1f54ed);_0x5828fc(_0x1f54ed);});});} \ No newline at end of file +var _0x8028=['then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','util','bluebird','ioredis','../../mysqldb'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8028,0xcc));var _0x8802=function(_0x1a133b,_0x41e2a2){_0x1a133b=_0x1a133b-0x0;var _0x424c25=_0x8028[_0x1a133b];return _0x424c25;};'use strict';var _=require('lodash');var util=require(_0x8802('0x0'));var moment=require('moment');var BPromise=require(_0x8802('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8802('0x2'));var db=require(_0x8802('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4d1f36,_0x5604c6,_0x559a1e){return new BPromise(function(_0x5ea559,_0x250b29){return client['request'](_0x4d1f36,_0x559a1e)[_0x8802('0x4')](function(_0x17cc41){logger[_0x8802('0x5')](_0x8802('0x6'),_0x5604c6,_0x8802('0x7'));logger['debug'](_0x8802('0x8'),_0x5604c6,'request\x20sent',JSON[_0x8802('0x9')](_0x17cc41));if(_0x17cc41[_0x8802('0xa')]){if(_0x17cc41['error']['code']===0x1f4){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x17cc41[_0x8802('0xa')][_0x8802('0xb')]);return _0x250b29(_0x17cc41['error'][_0x8802('0xb')]);}logger[_0x8802('0xa')]('UserMailQueue,\x20%s,\x20%s',_0x5604c6,_0x17cc41['error']['message']);return _0x5ea559(_0x17cc41['error'][_0x8802('0xb')]);}else{logger[_0x8802('0x5')]('UserMailQueue,\x20%s,\x20%s',_0x5604c6,_0x8802('0x7'));_0x5ea559(_0x17cc41[_0x8802('0xc')]['message']);}})['catch'](function(_0x132f3b){logger[_0x8802('0xa')](_0x8802('0x6'),_0x5604c6,_0x132f3b);_0x250b29(_0x132f3b);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index f66acb1..31aab23 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 _0x2bcd=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x275f4a,_0x2077d4){var _0x4b4a21=function(_0x391bab){while(--_0x391bab){_0x275f4a['push'](_0x275f4a['shift']());}};_0x4b4a21(++_0x2077d4);}(_0x2bcd,0x136));var _0xd2bc=function(_0x4d5dcd,_0x36b678){_0x4d5dcd=_0x4d5dcd-0x0;var _0x157a92=_0x2bcd[_0x4d5dcd];return _0x157a92;};'use strict';var multer=require(_0xd2bc('0x0'));var util=require(_0xd2bc('0x1'));var path=require('path');var timeout=require(_0xd2bc('0x2'));var express=require(_0xd2bc('0x3'));var router=express[_0xd2bc('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xd2bc('0x5'));var config=require(_0xd2bc('0x6'));module[_0xd2bc('0x7')]=router; \ No newline at end of file +var _0x11a9=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x944797,_0x147b4c){var _0x1908ca=function(_0x5bde5f){while(--_0x5bde5f){_0x944797['push'](_0x944797['shift']());}};_0x1908ca(++_0x147b4c);}(_0x11a9,0x157));var _0x911a=function(_0x551fe6,_0x25aa76){_0x551fe6=_0x551fe6-0x0;var _0x38354f=_0x11a9[_0x551fe6];return _0x38354f;};'use strict';var multer=require(_0x911a('0x0'));var util=require(_0x911a('0x1'));var path=require(_0x911a('0x2'));var timeout=require(_0x911a('0x3'));var express=require(_0x911a('0x4'));var router=express['Router']();var auth=require(_0x911a('0x5'));var interaction=require(_0x911a('0x6'));var config=require('../../config/environment');module[_0x911a('0x7')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 63c24f2..6ece33e 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x2eeb09,_0x4a5522){var _0x5c9dc7=function(_0x3d3487){while(--_0x3d3487){_0x2eeb09['push'](_0x2eeb09['shift']());}};_0x5c9dc7(++_0x4a5522);}(_0xe706,0xa3));var _0x6e70=function(_0x4135e7,_0x14f68b){_0x4135e7=_0x4135e7-0x0;var _0x3032f9=_0xe706[_0x4135e7];return _0x3032f9;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0x2c4d0f,_0x3436d5){var _0x3c6d14=function(_0x4f429d){while(--_0x4f429d){_0x2c4d0f['push'](_0x2c4d0f['shift']());}};_0x3c6d14(++_0x3436d5);}(_0xb10b,0x12a));var _0xbb10=function(_0x3c192c,_0x5bd6f9){_0x3c192c=_0x3c192c-0x0;var _0x3d8f5b=_0xb10b[_0x3c192c];return _0x3d8f5b;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('0x1')],'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 b6bc46d..3135483 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 _0xf11a=['rimraf','../../config/environment','./userOpenchannelQueue.attributes','define','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xf11a,0x155));var _0xaf11=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xf11a[_0x30ae5e];return _0x1f2e93;};'use strict';var _=require(_0xaf11('0x0'));var util=require(_0xaf11('0x1'));var logger=require(_0xaf11('0x2'))(_0xaf11('0x3'));var moment=require(_0xaf11('0x4'));var BPromise=require(_0xaf11('0x5'));var rp=require(_0xaf11('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xaf11('0x7'));var config=require(_0xaf11('0x8'));var attributes=require(_0xaf11('0x9'));module['exports']=function(_0xa4bcf0,_0x43f4aa){return _0xa4bcf0[_0xaf11('0xa')]('UserOpenchannelQueue',attributes,{'tableName':_0xaf11('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8e0=['user_has_openchannel_queues','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./userOpenchannelQueue.attributes','exports','UserOpenchannelQueue'];(function(_0x360666,_0x17895e){var _0x2d3fd1=function(_0x145d3f){while(--_0x145d3f){_0x360666['push'](_0x360666['shift']());}};_0x2d3fd1(++_0x17895e);}(_0xe8e0,0x199));var _0x0e8e=function(_0x88d501,_0x1db784){_0x88d501=_0x88d501-0x0;var _0x28bdff=_0xe8e0[_0x88d501];return _0x28bdff;};'use strict';var _=require(_0x0e8e('0x0'));var util=require('util');var logger=require(_0x0e8e('0x1'))(_0x0e8e('0x2'));var moment=require(_0x0e8e('0x3'));var BPromise=require(_0x0e8e('0x4'));var rp=require(_0x0e8e('0x5'));var fs=require('fs');var path=require(_0x0e8e('0x6'));var rimraf=require(_0x0e8e('0x7'));var config=require('../../config/environment');var attributes=require(_0x0e8e('0x8'));module[_0x0e8e('0x9')]=function(_0xe10d22,_0x413ae3){return _0xe10d22['define'](_0x0e8e('0xa'),attributes,{'tableName':_0x0e8e('0xb'),'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 accf204..8c98596 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 _0x624b=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0x624b,0x198));var _0xb624=function(_0x209749,_0x31ef28){_0x209749=_0x209749-0x0;var _0x2d0685=_0x624b[_0x209749];return _0x2d0685;};'use strict';var _=require(_0xb624('0x0'));var util=require(_0xb624('0x1'));var moment=require(_0xb624('0x2'));var BPromise=require(_0xb624('0x3'));var rs=require(_0xb624('0x4'));var fs=require('fs');var Redis=require(_0xb624('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb624('0x6'));var logger=require(_0xb624('0x7'))(_0xb624('0x8'));var config=require(_0xb624('0x9'));var jayson=require(_0xb624('0xa'));var client=jayson[_0xb624('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0xeb54f0,_0x14c3ff,_0x1913ec){return new BPromise(function(_0x2c354f,_0x14d37b){return client[_0xb624('0xc')](_0xeb54f0,_0x1913ec)['then'](function(_0x2c8cb7){logger[_0xb624('0xd')](_0xb624('0xe'),_0x14c3ff,_0xb624('0xf'));logger['debug'](_0xb624('0x10'),_0x14c3ff,_0xb624('0xf'),JSON[_0xb624('0x11')](_0x2c8cb7));if(_0x2c8cb7[_0xb624('0x12')]){if(_0x2c8cb7[_0xb624('0x12')][_0xb624('0x13')]===0x1f4){logger[_0xb624('0x12')](_0xb624('0xe'),_0x14c3ff,_0x2c8cb7[_0xb624('0x12')]['message']);return _0x14d37b(_0x2c8cb7[_0xb624('0x12')][_0xb624('0x14')]);}logger[_0xb624('0x12')](_0xb624('0xe'),_0x14c3ff,_0x2c8cb7[_0xb624('0x12')][_0xb624('0x14')]);return _0x2c354f(_0x2c8cb7[_0xb624('0x12')][_0xb624('0x14')]);}else{logger[_0xb624('0xd')](_0xb624('0xe'),_0x14c3ff,_0xb624('0xf'));_0x2c354f(_0x2c8cb7[_0xb624('0x15')]['message']);}})[_0xb624('0x16')](function(_0x22e876){logger[_0xb624('0x12')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x14c3ff,_0x22e876);_0x14d37b(_0x22e876);});});} \ No newline at end of file +var _0x957a=['rpc','jayson/promise','client','http','request','info','UserOpenchannelQueue,\x20%s,\x20%s','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x328cb3,_0xeb4109){var _0x2f0fbc=function(_0x45944d){while(--_0x45944d){_0x328cb3['push'](_0x328cb3['shift']());}};_0x2f0fbc(++_0xeb4109);}(_0x957a,0x15a));var _0xa957=function(_0x27fa03,_0x3f639c){_0x27fa03=_0x27fa03-0x0;var _0x46b49c=_0x957a[_0x27fa03];return _0x46b49c;};'use strict';var _=require('lodash');var util=require(_0xa957('0x0'));var moment=require('moment');var BPromise=require(_0xa957('0x1'));var rs=require(_0xa957('0x2'));var fs=require('fs');var Redis=require(_0xa957('0x3'));var db=require(_0xa957('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa957('0x5'))(_0xa957('0x6'));var config=require('../../config/environment');var jayson=require(_0xa957('0x7'));var client=jayson[_0xa957('0x8')][_0xa957('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x69b67e,_0x5776d7,_0x387ced){return new BPromise(function(_0xc2092f,_0x317922){return client[_0xa957('0xa')](_0x69b67e,_0x387ced)['then'](function(_0x1c378c){logger[_0xa957('0xb')](_0xa957('0xc'),_0x5776d7,'request\x20sent');logger[_0xa957('0xd')](_0xa957('0xe'),_0x5776d7,_0xa957('0xf'),JSON[_0xa957('0x10')](_0x1c378c));if(_0x1c378c[_0xa957('0x11')]){if(_0x1c378c[_0xa957('0x11')][_0xa957('0x12')]===0x1f4){logger[_0xa957('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5776d7,_0x1c378c[_0xa957('0x11')][_0xa957('0x13')]);return _0x317922(_0x1c378c[_0xa957('0x11')][_0xa957('0x13')]);}logger[_0xa957('0x11')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5776d7,_0x1c378c[_0xa957('0x11')][_0xa957('0x13')]);return _0xc2092f(_0x1c378c[_0xa957('0x11')]['message']);}else{logger[_0xa957('0xb')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x5776d7,_0xa957('0xf'));_0xc2092f(_0x1c378c[_0xa957('0x14')]['message']);}})[_0xa957('0x15')](function(_0x16f9a1){logger[_0xa957('0x11')](_0xa957('0xc'),_0x5776d7,_0x16f9a1);_0x317922(_0x16f9a1);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index 33cbc65..e3fc1d9 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 _0xd38d=['multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./userProfile.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','update','delete','destroy','removeSections','removeResources'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xd38d,0x122));var _0xdd38=function(_0x184759,_0x1cc38a){_0x184759=_0x184759-0x0;var _0xf26d5f=_0xd38d[_0x184759];return _0xf26d5f;};'use strict';var multer=require(_0xdd38('0x0'));var util=require(_0xdd38('0x1'));var path=require(_0xdd38('0x2'));var timeout=require(_0xdd38('0x3'));var express=require('express');var router=express[_0xdd38('0x4')]();var auth=require(_0xdd38('0x5'));var interaction=require(_0xdd38('0x6'));var config=require('../../config/environment');var controller=require(_0xdd38('0x7'));router[_0xdd38('0x8')]('/',auth[_0xdd38('0x9')](),controller[_0xdd38('0xa')]);router[_0xdd38('0x8')](_0xdd38('0xb'),auth[_0xdd38('0x9')](),controller[_0xdd38('0xc')]);router[_0xdd38('0x8')](_0xdd38('0xd'),auth[_0xdd38('0x9')](),controller['show']);router['get'](_0xdd38('0xe'),auth[_0xdd38('0x9')](),controller[_0xdd38('0xf')]);router[_0xdd38('0x8')]('/:id/resources',auth[_0xdd38('0x9')](),controller[_0xdd38('0x10')]);router[_0xdd38('0x11')]('/',auth[_0xdd38('0x9')](),controller[_0xdd38('0x12')]);router[_0xdd38('0x11')](_0xdd38('0x13'),auth[_0xdd38('0x9')](),controller[_0xdd38('0x14')]);router[_0xdd38('0x11')](_0xdd38('0xe'),auth['isAuthenticated'](),controller[_0xdd38('0x15')]);router[_0xdd38('0x11')](_0xdd38('0x16'),auth[_0xdd38('0x9')](),controller[_0xdd38('0x17')]);router['put'](_0xdd38('0xd'),auth['isAuthenticated'](),controller[_0xdd38('0x18')]);router[_0xdd38('0x19')](_0xdd38('0xd'),auth[_0xdd38('0x9')](),controller[_0xdd38('0x1a')]);router['delete'](_0xdd38('0xe'),auth[_0xdd38('0x9')](),controller[_0xdd38('0x1b')]);router['delete'](_0xdd38('0x16'),auth[_0xdd38('0x9')](),controller[_0xdd38('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xdfa9=['exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./userProfile.controller','get','isAuthenticated','index','describe','getSections','/:id/resources','getResources','post','create','/:id/clone','clone','/:id/sections','addSections','put','/:id','update','destroy','delete','removeSections','removeResources'];(function(_0x11cbf0,_0x5b3e9c){var _0x1c7e4f=function(_0x47424d){while(--_0x47424d){_0x11cbf0['push'](_0x11cbf0['shift']());}};_0x1c7e4f(++_0x5b3e9c);}(_0xdfa9,0x97));var _0x9dfa=function(_0x57aac5,_0x28dc50){_0x57aac5=_0x57aac5-0x0;var _0x43eb42=_0xdfa9[_0x57aac5];return _0x43eb42;};'use strict';var multer=require(_0x9dfa('0x0'));var util=require(_0x9dfa('0x1'));var path=require(_0x9dfa('0x2'));var timeout=require(_0x9dfa('0x3'));var express=require(_0x9dfa('0x4'));var router=express[_0x9dfa('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9dfa('0x6'));var config=require(_0x9dfa('0x7'));var controller=require(_0x9dfa('0x8'));router[_0x9dfa('0x9')]('/',auth[_0x9dfa('0xa')](),controller[_0x9dfa('0xb')]);router[_0x9dfa('0x9')]('/describe',auth[_0x9dfa('0xa')](),controller[_0x9dfa('0xc')]);router[_0x9dfa('0x9')]('/:id',auth[_0x9dfa('0xa')](),controller['show']);router[_0x9dfa('0x9')]('/:id/sections',auth['isAuthenticated'](),controller[_0x9dfa('0xd')]);router['get'](_0x9dfa('0xe'),auth[_0x9dfa('0xa')](),controller[_0x9dfa('0xf')]);router[_0x9dfa('0x10')]('/',auth[_0x9dfa('0xa')](),controller[_0x9dfa('0x11')]);router[_0x9dfa('0x10')](_0x9dfa('0x12'),auth[_0x9dfa('0xa')](),controller[_0x9dfa('0x13')]);router['post'](_0x9dfa('0x14'),auth['isAuthenticated'](),controller[_0x9dfa('0x15')]);router[_0x9dfa('0x10')](_0x9dfa('0xe'),auth[_0x9dfa('0xa')](),controller['addResources']);router[_0x9dfa('0x16')](_0x9dfa('0x17'),auth[_0x9dfa('0xa')](),controller[_0x9dfa('0x18')]);router['delete'](_0x9dfa('0x17'),auth[_0x9dfa('0xa')](),controller[_0x9dfa('0x19')]);router[_0x9dfa('0x1a')](_0x9dfa('0x14'),auth['isAuthenticated'](),controller[_0x9dfa('0x1b')]);router[_0x9dfa('0x1a')](_0x9dfa('0xe'),auth[_0x9dfa('0xa')](),controller[_0x9dfa('0x1c')]);module[_0x9dfa('0x1d')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index ca63c66..bcb51d4 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 _0x84e7=['join','getDataValue','split','sequelize','STRING','crudPermissions'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0x84e7,0x171));var _0x784e=function(_0x5435d4,_0x1bf677){_0x5435d4=_0x5435d4-0x0;var _0x17634c=_0x84e7[_0x5435d4];return _0x17634c;};'use strict';var Sequelize=require(_0x784e('0x0'));module['exports']={'name':{'type':Sequelize[_0x784e('0x1')],'allowNull':![],'unique':'name'},'crudPermissions':{'type':Sequelize[_0x784e('0x1')],'set':function(_0x5c95c0){this['setDataValue'](_0x784e('0x2'),_0x5c95c0?_0x5c95c0[_0x784e('0x3')](''):[]);},'get':function(){return this[_0x784e('0x4')](_0x784e('0x2'))?this['getDataValue'](_0x784e('0x2'))[_0x784e('0x5')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x784e('0x1')],'allowNull':!![]}}; \ No newline at end of file +var _0xc970=['getDataValue','crudPermissions','split','STRING','name'];(function(_0x2aed21,_0x55019a){var _0x2a048f=function(_0x5eba84){while(--_0x5eba84){_0x2aed21['push'](_0x2aed21['shift']());}};_0x2a048f(++_0x55019a);}(_0xc970,0x1d9));var _0x0c97=function(_0x442d4b,_0x554552){_0x442d4b=_0x442d4b-0x0;var _0x400e0f=_0xc970[_0x442d4b];return _0x400e0f;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0x0c97('0x0')],'allowNull':![],'unique':_0x0c97('0x1')},'crudPermissions':{'type':Sequelize[_0x0c97('0x0')],'set':function(_0x565db9){this['setDataValue']('crudPermissions',_0x565db9?_0x565db9['join'](''):[]);},'get':function(){return this[_0x0c97('0x2')](_0x0c97('0x3'))?this[_0x0c97('0x2')](_0x0c97('0x3'))[_0x0c97('0x4')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x0c97('0x0')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index bca675b..1911680 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 _0x0f18=['updatedAt','crudPermissions','body','sequelize','transaction','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','push','removeSections','getSections','enabled','includes','isEmpty','subsections','forEach','Plugin','resourceId','addResources','bulkCreate','removeResources','ids','getResources','section','undefined','Sequelize','ValidationError','Unknown\x20section','mergeResources','childModel','parentSections','findOne','all','ignore','key','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','default','reportId','custom','rows','CmContact','Tag','Tags','color','tag','ThroughTags','value','toLowerCase','squareprojects','SquareOdbc','squarerecordings','SquareProjects','projectName','projects','contacts','Lists','ListId','lists','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','FaxQueue','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','agent','Telephones','role','telephone','VoiceQueues','queue','VoiceQueue','inbound','QueueCampaigns','VoiceMusicOnHold','VoiceChanSpy','VoicePrefix','ivrcampaigns','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','openchannelaccounts','OpenchannelAccount','smsqueues','SmsAccount','teams','Team','voicequeues','queuecampaigns','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','SalesforceAccount','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','zohoaccounts','vtigeraccounts','cannedanswers','dispositions','Disposition','customdashboards','Dashboard','intervals','Interval','pauses','Pause','scheduler','Schedule','sounds','Template','Trigger','trunks','Trunk','variables','Variable','plugins','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','redis','localhost','socket.io-emitter','./userProfile.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','stack','map','UserProfile','fieldName','type','model','name','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','keys','rawAttributes','length','find','create','clone','get','omit','createdAt'];(function(_0x2c9e61,_0x2d13f5){var _0x4d55d6=function(_0x56f065){while(--_0x56f065){_0x2c9e61['push'](_0x2c9e61['shift']());}};_0x4d55d6(++_0x2d13f5);}(_0x0f18,0x17f));var _0x80f1=function(_0x532112,_0x37d94b){_0x532112=_0x532112-0x0;var _0x23e5fb=_0x0f18[_0x532112];return _0x23e5fb;};'use strict';var pdf=require(_0x80f1('0x0'));var emlformat=require(_0x80f1('0x1'));var rimraf=require(_0x80f1('0x2'));var zipdir=require(_0x80f1('0x3'));var jsonpatch=require(_0x80f1('0x4'));var rp=require('request-promise');var moment=require(_0x80f1('0x5'));var BPromise=require(_0x80f1('0x6'));var Mustache=require(_0x80f1('0x7'));var util=require(_0x80f1('0x8'));var path=require(_0x80f1('0x9'));var sox=require(_0x80f1('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x80f1('0xb'));var squel=require('squel');var crypto=require(_0x80f1('0xc'));var jsforce=require(_0x80f1('0xd'));var deskjs=require(_0x80f1('0xe'));var toCsv=require('to-csv');var querystring=require(_0x80f1('0xf'));var Papa=require(_0x80f1('0x10'));var Redis=require(_0x80f1('0x11'));var authService=require(_0x80f1('0x12'));var qs=require(_0x80f1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x80f1('0x14'));var logger=require(_0x80f1('0x15'))('api');var utils=require('../../config/utils');var config=require(_0x80f1('0x16'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x80f1('0x17')],{'host':_0x80f1('0x18'),'port':0x18eb});var socket=require(_0x80f1('0x19'))(new Redis(config['redis']));require(_0x80f1('0x1a'))[_0x80f1('0x1b')](socket);function respondWithStatusCode(_0xbd7522,_0xdb39d8){_0xdb39d8=_0xdb39d8||0xcc;return function(_0x2c9a0e){if(_0x2c9a0e){return _0xbd7522[_0x80f1('0x1c')](_0xdb39d8);}return _0xbd7522[_0x80f1('0x1d')](_0xdb39d8)['end']();};}function respondWithResult(_0x41cd43,_0x5817de){_0x5817de=_0x5817de||0xc8;return function(_0x36f634){if(_0x36f634){return _0x41cd43[_0x80f1('0x1d')](_0x5817de)[_0x80f1('0x1e')](_0x36f634);}};}function respondWithFilteredResult(_0x7bffb5,_0x540c3b){return function(_0x2ab852){if(_0x2ab852){var _0x303be2=_0x2ab852[_0x80f1('0x1f')],_0x16ccaf=_0x540c3b[_0x80f1('0x20')],_0x11c342=_0x540c3b[_0x80f1('0x20')]+_0x540c3b[_0x80f1('0x21')],_0x57c840;if(_0x11c342>=_0x303be2){_0x11c342=_0x303be2;_0x57c840=0xc8;}else{_0x57c840=0xce;}_0x7bffb5[_0x80f1('0x1d')](_0x57c840);return _0x7bffb5[_0x80f1('0x22')](_0x80f1('0x23'),_0x16ccaf+'-'+_0x11c342+'/'+_0x303be2)[_0x80f1('0x1e')](_0x2ab852);}return null;};}function patchUpdates(_0x34a18a){return function(_0x5744e5){try{jsonpatch[_0x80f1('0x24')](_0x5744e5,_0x34a18a,!![]);}catch(_0x4cce46){return BPromise[_0x80f1('0x25')](_0x4cce46);}return _0x5744e5[_0x80f1('0x26')]();};}function saveUpdates(_0x4680bf,_0x420d74){return function(_0x27f393){if(_0x27f393){return _0x27f393[_0x80f1('0x27')](_0x4680bf)[_0x80f1('0x28')](function(_0x3df090){return _0x3df090;});}return null;};}function removeEntity(_0x459c12,_0x160eb0){return function(_0x2752b2){if(_0x2752b2){return _0x2752b2['destroy']()[_0x80f1('0x28')](function(){_0x459c12[_0x80f1('0x1d')](0xcc)[_0x80f1('0x29')]();});}};}function handleEntityNotFound(_0x4056ab,_0x439812){return function(_0x15d004){if(!_0x15d004){_0x4056ab[_0x80f1('0x1c')](0x194);}return _0x15d004;};}function handleError(_0x3a7072,_0x4b4f2d){_0x4b4f2d=_0x4b4f2d||0x1f4;return function(_0x8c718a){logger['error'](_0x8c718a[_0x80f1('0x2a')]);if(_0x8c718a['name']){delete _0x8c718a['name'];}_0x3a7072[_0x80f1('0x1d')](_0x4b4f2d)['send'](_0x8c718a);};}exports['index']=function(_0x48ebc2,_0x5a82d3){var _0x129c2d={},_0x47a376={},_0x5aadb5={'count':0x0,'rows':[]};var _0x1d6639=_[_0x80f1('0x2b')](db[_0x80f1('0x2c')]['rawAttributes'],function(_0x167a83){return{'name':_0x167a83[_0x80f1('0x2d')],'type':_0x167a83[_0x80f1('0x2e')]['key']};});_0x47a376[_0x80f1('0x2f')]=_[_0x80f1('0x2b')](_0x1d6639,_0x80f1('0x30'));_0x47a376[_0x80f1('0x31')]=_['keys'](_0x48ebc2[_0x80f1('0x31')]);_0x47a376[_0x80f1('0x32')]=_[_0x80f1('0x33')](_0x47a376[_0x80f1('0x2f')],_0x47a376[_0x80f1('0x31')]);_0x129c2d[_0x80f1('0x34')]=_['intersection'](_0x47a376[_0x80f1('0x2f')],qs[_0x80f1('0x35')](_0x48ebc2['query'][_0x80f1('0x35')]));_0x129c2d[_0x80f1('0x34')]=_0x129c2d[_0x80f1('0x34')]['length']?_0x129c2d[_0x80f1('0x34')]:_0x47a376['model'];if(!_0x48ebc2[_0x80f1('0x31')][_0x80f1('0x36')](_0x80f1('0x37'))){_0x129c2d[_0x80f1('0x21')]=qs[_0x80f1('0x21')](_0x48ebc2[_0x80f1('0x31')][_0x80f1('0x21')]);_0x129c2d['offset']=qs[_0x80f1('0x20')](_0x48ebc2[_0x80f1('0x31')][_0x80f1('0x20')]);}_0x129c2d[_0x80f1('0x38')]=qs[_0x80f1('0x39')](_0x48ebc2[_0x80f1('0x31')][_0x80f1('0x39')]);_0x129c2d[_0x80f1('0x3a')]=qs[_0x80f1('0x32')](_['pick'](_0x48ebc2[_0x80f1('0x31')],_0x47a376[_0x80f1('0x32')]));if(_0x48ebc2[_0x80f1('0x31')][_0x80f1('0x3b')]){_0x129c2d['where']=_[_0x80f1('0x3c')](_0x129c2d[_0x80f1('0x3a')],{'$or':_[_0x80f1('0x2b')](_0x1d6639,function(_0x2711e4){if(_0x2711e4[_0x80f1('0x2e')]!==_0x80f1('0x3d')){var _0x11a16a={};_0x11a16a[_0x2711e4['name']]={'$like':'%'+_0x48ebc2['query'][_0x80f1('0x3b')]+'%'};return _0x11a16a;}})});}_0x129c2d=_[_0x80f1('0x3c')]({},_0x129c2d,_0x48ebc2[_0x80f1('0x3e')]);var _0x506fee={'where':_0x129c2d[_0x80f1('0x3a')]};return db[_0x80f1('0x2c')][_0x80f1('0x1f')](_0x506fee)[_0x80f1('0x28')](function(_0x51125a){_0x5aadb5[_0x80f1('0x1f')]=_0x51125a;if(_0x48ebc2['query'][_0x80f1('0x3f')]){_0x129c2d[_0x80f1('0x40')]=[{'all':!![]}];}return db[_0x80f1('0x2c')][_0x80f1('0x41')](_0x129c2d);})[_0x80f1('0x28')](function(_0x243b61){_0x5aadb5['rows']=_0x243b61;return _0x5aadb5;})['then'](respondWithFilteredResult(_0x5a82d3,_0x129c2d))[_0x80f1('0x42')](handleError(_0x5a82d3,null));};exports['show']=function(_0xaf77d2,_0x38824b){var _0x10b44b={'raw':![],'where':{'id':_0xaf77d2[_0x80f1('0x43')]['id']}},_0x4991f3={};_0x4991f3[_0x80f1('0x2f')]=_[_0x80f1('0x44')](db['UserProfile'][_0x80f1('0x45')]);_0x4991f3['query']=_[_0x80f1('0x44')](_0xaf77d2[_0x80f1('0x31')]);_0x4991f3[_0x80f1('0x32')]=_['intersection'](_0x4991f3[_0x80f1('0x2f')],_0x4991f3[_0x80f1('0x31')]);_0x10b44b[_0x80f1('0x34')]=_[_0x80f1('0x33')](_0x4991f3[_0x80f1('0x2f')],qs[_0x80f1('0x35')](_0xaf77d2['query']['fields']));_0x10b44b['attributes']=_0x10b44b['attributes'][_0x80f1('0x46')]?_0x10b44b['attributes']:_0x4991f3['model'];if(_0xaf77d2['query']['includeAll']){_0x10b44b[_0x80f1('0x40')]=[{'all':!![]}];}_0x10b44b=_[_0x80f1('0x3c')]({},_0x10b44b,_0xaf77d2[_0x80f1('0x3e')]);return db[_0x80f1('0x2c')][_0x80f1('0x47')](_0x10b44b)[_0x80f1('0x28')](handleEntityNotFound(_0x38824b,null))[_0x80f1('0x28')](respondWithResult(_0x38824b,null))['catch'](handleError(_0x38824b,null));};exports[_0x80f1('0x48')]=function(_0xbae711,_0x1c3b80){return db['UserProfile'][_0x80f1('0x48')](_0xbae711['body'],{})[_0x80f1('0x28')](respondWithResult(_0x1c3b80,0xc9))[_0x80f1('0x42')](handleError(_0x1c3b80,null));};exports[_0x80f1('0x49')]=function(_0x2c866d,_0x1e0fda){var _0x55bbb3={'where':{'id':_0x2c866d['params']['id']}},_0x38eac4={};_0x38eac4['model']=_[_0x80f1('0x44')](db['UserProfile'][_0x80f1('0x45')]);_0x55bbb3['attributes']=_['intersection'](_0x38eac4['model'],qs[_0x80f1('0x35')](_0x2c866d['query']['fields']));_0x55bbb3[_0x80f1('0x34')]=_0x55bbb3[_0x80f1('0x34')]['length']?_0x55bbb3[_0x80f1('0x34')]:_0x38eac4[_0x80f1('0x2f')];if(_0x2c866d[_0x80f1('0x31')][_0x80f1('0x3f')]){_0x55bbb3[_0x80f1('0x40')]=[{'all':!![]}];}_0x55bbb3=_[_0x80f1('0x3c')]({},_0x55bbb3,_0x2c866d[_0x80f1('0x3e')]);return db['UserProfile'][_0x80f1('0x47')](_0x55bbb3)[_0x80f1('0x28')](handleEntityNotFound(_0x1e0fda,null))[_0x80f1('0x28')](function(_0x537cb9){if(_0x537cb9){var _0x2c902b=_0x537cb9[_0x80f1('0x4a')]({'plain':!![]});_0x2c902b=qs[_0x80f1('0x4b')](_0x2c902b,['id',_0x80f1('0x4c'),_0x80f1('0x4d'),_0x80f1('0x4e')]);_0x2c866d[_0x80f1('0x4f')]=_[_0x80f1('0x4b')](_0x2c866d[_0x80f1('0x4f')],['id',_0x80f1('0x4c'),_0x80f1('0x4d')]);return db[_0x80f1('0x50')][_0x80f1('0x51')](function(_0xbdb2f8){return db[_0x80f1('0x2c')][_0x80f1('0x48')](_['merge'](_0x2c902b,_0x2c866d['body']),{'include':_0x2c866d[_0x80f1('0x31')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0xbdb2f8})['then'](function(_0x1d9833){var _0x19c580=_0x1d9833[_0x80f1('0x4a')]({'plain':!![]});return db[_0x80f1('0x52')][_0x80f1('0x41')]({'where':{'userProfileId':_0x2c866d[_0x80f1('0x43')]['id']},'raw':!![]})[_0x80f1('0x28')](function(_0x3ea30b){if(_0x3ea30b){return BPromise[_0x80f1('0x53')](_0x3ea30b,function(_0x5f4605){return new BPromise(function(_0x4629eb,_0x4ffebe){if(_0x5f4605[_0x80f1('0x54')]===null||_0x5f4605[_0x80f1('0x54')]===0x1)_0x4629eb(null);return db[_0x80f1('0x55')]['findAll']({'where':{'sectionId':_0x5f4605['id']},'raw':!![]})[_0x80f1('0x28')](function(_0x1694f2){var _0x243426=_[_0x80f1('0x2b')](_0x1694f2,function(_0xf7bd3f){return qs[_0x80f1('0x4b')](_0xf7bd3f,['id',_0x80f1('0x4c'),_0x80f1('0x4d'),_0x80f1('0x56')]);});_0x4629eb(_0x243426);})[_0x80f1('0x42')](function(_0x75be3c){_0x4ffebe(_0x75be3c);});})[_0x80f1('0x28')](function(_0x4ebec8){var _0x2d73c8=qs['omit'](_0x5f4605,['id','createdAt',_0x80f1('0x4d')]);_0x2d73c8[_0x80f1('0x57')]=_0x19c580['id'];if(_0x4ebec8)_0x2d73c8[_0x80f1('0x58')]=_0x4ebec8;return _0x2d73c8;})[_0x80f1('0x28')](function(_0x1d7e57){return db[_0x80f1('0x52')][_0x80f1('0x48')](_0x1d7e57,{'include':[{'model':db['UserProfileResource'],'as':_0x80f1('0x58')}],'raw':!![],'transaction':_0xbdb2f8});});})[_0x80f1('0x28')](function(){return _0x19c580;});}});});});}})[_0x80f1('0x28')](respondWithResult(_0x1e0fda,0xc9))[_0x80f1('0x42')](handleError(_0x1e0fda,null));};exports[_0x80f1('0x27')]=function(_0x33ffa9,_0x50fd5f){if(_0x33ffa9[_0x80f1('0x4f')]['id']){delete _0x33ffa9[_0x80f1('0x4f')]['id'];}return db[_0x80f1('0x2c')][_0x80f1('0x47')]({'where':{'id':_0x33ffa9[_0x80f1('0x43')]['id']}})[_0x80f1('0x28')](handleEntityNotFound(_0x50fd5f,null))[_0x80f1('0x28')](saveUpdates(_0x33ffa9[_0x80f1('0x4f')],null))[_0x80f1('0x28')](respondWithResult(_0x50fd5f,null))[_0x80f1('0x42')](handleError(_0x50fd5f,null));};exports[_0x80f1('0x59')]=function(_0x4cc6d6,_0x3a0bf1){return db['UserProfile'][_0x80f1('0x47')]({'where':{'id':_0x4cc6d6['params']['id']}})[_0x80f1('0x28')](handleEntityNotFound(_0x3a0bf1,null))[_0x80f1('0x28')](removeEntity(_0x3a0bf1,null))[_0x80f1('0x42')](handleError(_0x3a0bf1,null));};exports[_0x80f1('0x5a')]=function(_0x3cd30f,_0x5b9930){return db[_0x80f1('0x2c')][_0x80f1('0x5a')]()[_0x80f1('0x28')](respondWithResult(_0x5b9930,null))[_0x80f1('0x42')](handleError(_0x5b9930,null));};exports['addSections']=function(_0x5cd4e6,_0x46e7cd){var _0x536287=_0x5cd4e6[_0x80f1('0x4f')];return db[_0x80f1('0x2c')][_0x80f1('0x47')]({'where':{'id':_0x5cd4e6['params']['id']}})[_0x80f1('0x28')](handleEntityNotFound(_0x46e7cd,null))[_0x80f1('0x28')](function(_0x312303){if(_0x312303){return db['sequelize']['transaction'](function(_0x298798){return db[_0x80f1('0x52')][_0x80f1('0x59')]({'where':{'userProfileId':_0x5cd4e6[_0x80f1('0x43')]['id'],'sectionId':_[_0x80f1('0x2b')](_0x536287,function(_0x3bdc94){return _0x3bdc94['sectionId'];})},'transaction':_0x298798})[_0x80f1('0x28')](function(){var _0x27fd89=_[_0x80f1('0x2b')](_0x536287,function(_0x5835b0){_0x5835b0['userProfileId']=_0x5cd4e6[_0x80f1('0x43')]['id'];return _0x5835b0;});var _0x2258b7=[];return BPromise['each'](_0x27fd89,function(_0x21fa5d){return db[_0x80f1('0x52')]['create'](_0x21fa5d,{'include':[{'model':db[_0x80f1('0x55')],'as':_0x80f1('0x58')}],'raw':!![],'transaction':_0x298798})[_0x80f1('0x28')](function(_0x2fa3dc){_0x2258b7[_0x80f1('0x5b')](_0x2fa3dc[_0x80f1('0x4a')]({'plain':!![]}));});})[_0x80f1('0x28')](function(){return _0x2258b7;});});});}})['then'](function(_0x312b13){return _0x312b13;})[_0x80f1('0x28')](respondWithResult(_0x46e7cd,null))[_0x80f1('0x42')](handleError(_0x46e7cd,null));};exports[_0x80f1('0x5c')]=function(_0x5c061e,_0x2ea0fe){var _0x1eaa1f;return db[_0x80f1('0x2c')]['find']({'where':{'id':_0x5c061e[_0x80f1('0x43')]['id']},'attributes':['id',_0x80f1('0x30')]})[_0x80f1('0x28')](handleEntityNotFound(_0x2ea0fe,null))[_0x80f1('0x28')](function(_0x2efe20){if(_0x2efe20){_0x1eaa1f=_0x2efe20;return db[_0x80f1('0x52')]['destroy']({'where':{'userProfileId':_0x5c061e[_0x80f1('0x43')]['id'],'sectionId':_0x5c061e[_0x80f1('0x31')]['ids']}});}})['then'](function(){return _0x1eaa1f;})[_0x80f1('0x28')](respondWithStatusCode(_0x2ea0fe,null))['catch'](handleError(_0x2ea0fe,null));};exports[_0x80f1('0x5d')]=function(_0x450738,_0x1477c1){var _0x24af00=[];var _0x344862=[];return db[_0x80f1('0x52')]['findAll']({'where':{'userProfileId':_0x450738[_0x80f1('0x43')]['id']},'raw':!![]})['then'](function(_0x54b0d9){_0x24af00=_[_0x80f1('0x3b')](_0x54b0d9,function(_0x58c39c){return _0x58c39c[_0x80f1('0x5e')]===0x1||_[_0x80f1('0x5f')]([0x3eb,0x709],_0x58c39c[_0x80f1('0x56')]);});if(!_[_0x80f1('0x60')](_0x24af00)){return _[_0x80f1('0x2b')](_0x24af00,function(_0x32dd41){return _0x32dd41[_0x80f1('0x56')];});}else{return;}})[_0x80f1('0x28')](function(_0x346939){if(_0x346939)_0x344862=_0x346939;if(_[_0x80f1('0x5f')](_0x344862,0x64)){var _0x294fd1=_[_0x80f1('0x47')](_0x24af00,{'sectionId':0x64});return hasDefaultDashboard(_0x294fd1)[_0x80f1('0x28')](function(_0x4eeccb){return _[_0x80f1('0x2b')](_0x24af00,function(_0x1e9142){if(_0x1e9142[_0x80f1('0x56')]===0x64){_0x1e9142['subsections']=_0x4eeccb;}return _0x1e9142;});});}else{return;}})[_0x80f1('0x28')](function(_0x50af05){if(_0x50af05)_0x24af00=_0x50af05;if(_[_0x80f1('0x5f')](_0x344862,0x3eb)){var _0x23788e=_[_0x80f1('0x47')](_0x24af00,{'sectionId':0x3eb});return getCustomDashboards(_0x23788e)[_0x80f1('0x28')](function(_0x3f149c){return _[_0x80f1('0x2b')](_0x24af00,function(_0x39c333){if(_0x23788e[_0x80f1('0x5e')]){if(_0x39c333[_0x80f1('0x56')]===0x3eb){_0x39c333[_0x80f1('0x61')]=_0x3f149c;}}else{if(_0x39c333[_0x80f1('0x56')]===0x64){_0x39c333[_0x80f1('0x61')]=_0x3f149c;}}return _0x39c333;});});}else{return;}})[_0x80f1('0x28')](function(_0x179a78){if(_0x179a78)_0x24af00=_0x179a78;if(_[_0x80f1('0x5f')](_0x344862,0x709)){var _0x1aa479=_[_0x80f1('0x47')](_0x24af00,{'sectionId':0x709});return getPlugins(_0x1aa479)[_0x80f1('0x28')](function(_0xea7e8d){if(_0x1aa479[_0x80f1('0x5e')]){return _[_0x80f1('0x2b')](_0x24af00,function(_0x385a01){if(_0x385a01[_0x80f1('0x56')]===0x709){_0x385a01[_0x80f1('0x61')]=_0xea7e8d;}return _0x385a01;});}else{var _0x1d31fd={'sectionId':0x76c,'enabled':0x1,'subsections':_0xea7e8d};var _0x578b14=_[_0x80f1('0x2b')](_0x24af00);_0x578b14[_0x80f1('0x5b')](_0x1d31fd);return _0x578b14;}});}else{return;}})['then'](function(_0x45642a){if(_0x45642a)_0x24af00=_0x45642a;return _[_0x80f1('0x3b')](_0x24af00,[_0x80f1('0x5e'),0x1]);})[_0x80f1('0x28')](respondWithResult(_0x1477c1,null))[_0x80f1('0x42')](handleError(_0x1477c1,null));};function hasDefaultDashboard(_0x1c693f){var _0x99e5bf=[0x65];return new BPromise(function(_0x16de1f,_0x5d4cca){try{if(_0x1c693f[_0x80f1('0x54')]){_0x16de1f(_0x99e5bf);}else{return db['UserProfileResource']['findOne']({'where':{'sectionId':_0x1c693f['id']},'raw':!![]})[_0x80f1('0x28')](function(_0x1f617f){_0x1f617f?_0x16de1f(_0x99e5bf):_0x16de1f();});}}catch(_0x1bba11){_0x5d4cca(_0x1bba11);}});}function getCustomDashboards(_0x1bb13e){var _0x28ac53=[];return new BPromise(function(_0x5e8a19,_0x102da3){try{if(_0x1bb13e[_0x80f1('0x54')]){return db['Dashboard'][_0x80f1('0x41')]({'raw':!![]})[_0x80f1('0x28')](function(_0x1cd456){_0x1cd456['forEach'](function(_0x3dd565){_0x28ac53['push'](_0x3dd565['id']+0x1869f);});_0x5e8a19(_0x28ac53);});}else{return db['UserProfileResource'][_0x80f1('0x41')]({'where':{'sectionId':_0x1bb13e['id']},'raw':!![]})[_0x80f1('0x28')](function(_0x41268d){_0x41268d[_0x80f1('0x62')](function(_0x1811ff){_0x28ac53['push'](_0x1811ff['resourceId']+0x1869f);});_0x5e8a19(_0x28ac53);});}}catch(_0x3eda80){_0x102da3(_0x3eda80);}});}function getPlugins(_0x37d141){var _0x37fbc4=[];return new BPromise(function(_0x4a01b5,_0x3a949c){try{if(_0x37d141[_0x80f1('0x54')]){return db[_0x80f1('0x63')][_0x80f1('0x41')]({'raw':!![]})[_0x80f1('0x28')](function(_0x6904eb){_0x6904eb[_0x80f1('0x62')](function(_0x441517){_0x37fbc4[_0x80f1('0x5b')](_0x441517['id']+0x15b38);});_0x4a01b5(_0x37fbc4);});}else{return db['UserProfileResource'][_0x80f1('0x41')]({'where':{'sectionId':_0x37d141['id']},'raw':!![]})[_0x80f1('0x28')](function(_0xc6a9b4){_0xc6a9b4['forEach'](function(_0x5596fe){_0x37fbc4[_0x80f1('0x5b')](_0x5596fe[_0x80f1('0x64')]+0x15b38);});_0x4a01b5(_0x37fbc4);});}}catch(_0x51b008){_0x3a949c(_0x51b008);}});}exports[_0x80f1('0x65')]=function(_0x50e5df,_0x1f5b2f){return db[_0x80f1('0x2c')]['find']({'where':{'id':_0x50e5df[_0x80f1('0x43')]['id']}})[_0x80f1('0x28')](handleEntityNotFound(_0x1f5b2f,null))[_0x80f1('0x28')](function(_0x54ab26){if(_0x54ab26){return db[_0x80f1('0x50')]['transaction'](function(_0x2ca3f9){return db[_0x80f1('0x52')][_0x80f1('0x41')]({'where':{'userProfileId':_0x50e5df[_0x80f1('0x43')]['id']},'attributes':['id'],'raw':!![]})[_0x80f1('0x28')](function(_0x215950){if(_0x215950){return db['UserProfileSection']['destroy']({'where':{'userProfileId':_0x50e5df[_0x80f1('0x43')]['id'],'id':_[_0x80f1('0x2b')](_0x215950,function(_0xcf5f7b){return _0xcf5f7b['id'];})},'transaction':_0x2ca3f9});}})['then'](function(_0x530c82){var _0x45d2df=_[_0x80f1('0x2b')](_0x50e5df[_0x80f1('0x4f')],function(_0x5e0868){_0x5e0868[_0x80f1('0x57')]=_0x50e5df['params']['id'];return _0x5e0868;});return db['UserProfileSection']['bulkCreate'](_0x45d2df,{'raw':!![],'transaction':_0x2ca3f9});})[_0x80f1('0x28')](function(_0x17e202){var _0x596db7=_['filter'](_['map'](_0x17e202,function(_0x184e2b){return _0x184e2b[_0x80f1('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0x596db7){return db[_0x80f1('0x52')]['findAll']({'where':{'userProfileId':_0x50e5df[_0x80f1('0x43')]['id'],'sectionId':_['map'](_0x596db7,function(_0x594530){return _0x594530[_0x80f1('0x56')];})},'attributes':['id','sectionId'],'raw':!![]})[_0x80f1('0x28')](function(_0x46ae4d){var _0x22d258=_[_0x80f1('0x2b')](_0x50e5df[_0x80f1('0x4f')],function(_0x1de509){_0x1de509[_0x80f1('0x57')]=_0x50e5df['params']['id'];return _0x1de509;});return db[_0x80f1('0x55')][_0x80f1('0x66')](_0x22d258,{'raw':!![],'transaction':_0x2ca3f9});});}})[_0x80f1('0x42')](handleError(_0x1f5b2f,null));});}})[_0x80f1('0x28')](function(_0x1a0c9e){var _0x24daad=_[_0x80f1('0x2b')](_0x1a0c9e,function(_0x637c3e){return _0x637c3e[_0x80f1('0x4a')]({'plain':!![]});});})[_0x80f1('0x28')](respondWithResult(_0x1f5b2f,null))[_0x80f1('0x42')](handleError(_0x1f5b2f,null));};exports[_0x80f1('0x67')]=function(_0x30b327,_0x2d40e8,_0x288ff9){return db['UserProfile']['find']({'where':{'id':_0x30b327[_0x80f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x2d40e8,null))[_0x80f1('0x28')](function(_0x3bab5a){if(_0x3bab5a){return _0x3bab5a[_0x80f1('0x67')](_0x30b327[_0x80f1('0x31')][_0x80f1('0x68')]);}})[_0x80f1('0x28')](respondWithStatusCode(_0x2d40e8,null))[_0x80f1('0x42')](handleError(_0x2d40e8,null));};exports[_0x80f1('0x69')]=function(_0x1a9e25,_0x47fb10){var _0x155769={'raw':![],'where':{}};var _0x4e9ff8={};var _0x5248eb={'count':0x0,'rows':[]};var _0x31bc30=_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x6a')];if(typeof _0x31bc30===_0x80f1('0x6b')){throw new db[(_0x80f1('0x6c'))][(_0x80f1('0x6d'))](_0x80f1('0x6e'));}var _0x5370d1=_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x6f')]||![];var _0x23fe90=getQueryModels(_0x31bc30,_0x5370d1);if(typeof _0x23fe90[_0x80f1('0x70')]===_0x80f1('0x6b')){throw new db[(_0x80f1('0x6c'))][(_0x80f1('0x6d'))]('Invalid\x20section\x20\x27'+_0x31bc30+'\x27');}var _0x281b84=[];if(!_[_0x80f1('0x60')](_0x23fe90[_0x80f1('0x71')])){_0x281b84=_0x23fe90[_0x80f1('0x71')];}else{_0x281b84=[{'name':_0x31bc30}];}return db[_0x80f1('0x2c')][_0x80f1('0x72')]({'where':{'id':_0x1a9e25[_0x80f1('0x43')]['id']}})['then'](handleEntityNotFound(_0x47fb10,null))[_0x80f1('0x28')](function(_0x4e7754){if(_0x4e7754){var _0x3792d8=[];for(var _0x12af77=0x0;_0x12af77<_0x281b84[_0x80f1('0x46')];_0x12af77++){_0x3792d8[_0x80f1('0x5b')](db[_0x80f1('0x52')][_0x80f1('0x72')]({'where':{'userProfileId':_0x4e7754['id'],'name':_0x281b84[_0x12af77][_0x80f1('0x30')]},'raw':!![]}));}return BPromise[_0x80f1('0x73')](_0x3792d8);}})[_0x80f1('0x28')](function(_0x12048e){var _0x202498=_[_0x80f1('0x3b')](_0x12048e,function(_0x48b837){return _0x48b837?_0x48b837:undefined;});var _0x47c72f=_[_0x80f1('0x3b')](_0x281b84,[_0x80f1('0x74'),!![]]);var _0xa67eb0=_['isEmpty'](_0x202498)&&_[_0x80f1('0x60')](_0x47c72f)?null:_['union'](_0x47c72f,_0x202498);if(_0xa67eb0){var _0x3d584e=[];for(var _0x45529f=0x0;_0x45529f<_0xa67eb0[_0x80f1('0x46')];_0x45529f++){var _0x11df39=_[_0x80f1('0x47')](_0x281b84,function(_0x525f4e){return _0xa67eb0[_0x45529f]?_0x525f4e[_0x80f1('0x30')]===_0xa67eb0[_0x45529f][_0x80f1('0x30')]:null;});if(_0x11df39){if(_0xa67eb0[_0x45529f]['ignore']){_0x3d584e['push'](getAllResources(_0x23fe90[_0x80f1('0x70')],_0xa67eb0[_0x45529f]));}else{if(!_0xa67eb0[_0x45529f][_0x80f1('0x54')]){_0x3d584e[_0x80f1('0x5b')](getAllowedResources(_0x11df39,_0xa67eb0[_0x45529f],_0x23fe90['childModel']));}else{if(_0x11df39['model']){_0x3d584e[_0x80f1('0x5b')](getAllFilteredResources(_0x11df39,_0xa67eb0[_0x45529f]));}}}}}return BPromise[_0x80f1('0x73')](_0x3d584e);}else{return null;}})[_0x80f1('0x28')](function(_0x389233){var _0x70acee=_0x389233;var _0xa6e3b4=null;if(_0x70acee){_0xa6e3b4=_0x70acee[_0x80f1('0x46')]===0x1?_0x70acee[0x0]:null;}if(_0xa6e3b4||_0x70acee){var _0x3faecd=db[_0x23fe90[_0x80f1('0x70')]][_0x80f1('0x45')];_0x4e9ff8['model']=_[_0x80f1('0x44')](_0x3faecd);_0x4e9ff8[_0x80f1('0x31')]=_[_0x80f1('0x44')](_0x1a9e25['query']);_0x4e9ff8[_0x80f1('0x32')]=_[_0x80f1('0x33')](_0x4e9ff8[_0x80f1('0x2f')],_0x4e9ff8[_0x80f1('0x31')]);_0x155769[_0x80f1('0x34')]=_['intersection'](_0x4e9ff8['model'],qs[_0x80f1('0x35')](_0x1a9e25['query']['fields']));_0x155769['attributes']=_0x155769[_0x80f1('0x34')][_0x80f1('0x46')]?_0x155769[_0x80f1('0x34')]:_0x4e9ff8['model'];if(!_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x36')](_0x80f1('0x37'))){_0x155769[_0x80f1('0x21')]=qs[_0x80f1('0x21')](_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x21')]);_0x155769[_0x80f1('0x20')]=qs[_0x80f1('0x20')](_0x1a9e25[_0x80f1('0x31')]['offset']);}_0x155769['order']=qs[_0x80f1('0x39')](_0x1a9e25['query'][_0x80f1('0x39')]);_0x155769[_0x80f1('0x3a')]=qs[_0x80f1('0x32')](_['pick'](_0x1a9e25[_0x80f1('0x31')],_0x4e9ff8[_0x80f1('0x32')]));if(_0x1a9e25['query'][_0x80f1('0x3b')]){_0x155769[_0x80f1('0x3a')]=_[_0x80f1('0x3c')](_0x155769[_0x80f1('0x3a')],{'$or':_[_0x80f1('0x2b')](_0x3faecd,function(_0x4a6c80){if(_0x4a6c80[_0x80f1('0x2e')][_0x80f1('0x75')]!==_0x80f1('0x3d')){var _0x487b1e={};_0x487b1e[_0x4a6c80[_0x80f1('0x76')]]={'$like':'%'+_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x3b')]+'%'};return _0x487b1e;}})});}var _0x487f72=[];if(_0xa6e3b4){var _0x11226c=_[_0x80f1('0x47')](_0x281b84,[_0x80f1('0x30'),_0xa6e3b4[_0x80f1('0x30')]]);if(_0x11226c['field']){var _0x8dd053={};if(_0x23fe90[_0x80f1('0x70')]===_0x80f1('0x77')){_0x8dd053[_0x11226c[_0x80f1('0x78')]]=_[_0x80f1('0x2b')](_0xa6e3b4[_0x80f1('0x79')],'id');}else{_0x8dd053[_0x11226c['foreignKey']]=_0xa6e3b4[_0x80f1('0x79')];}_0x487f72[_0x80f1('0x5b')](_0x8dd053);}else{_0x155769[_0x80f1('0x3a')]['id']=_0xa6e3b4[_0x80f1('0x79')];}}else{for(var _0x335e55=0x0;_0x335e55<_0x70acee[_0x80f1('0x46')];_0x335e55++){var _0x11226c=_[_0x80f1('0x47')](_0x281b84,[_0x80f1('0x30'),_0x70acee[_0x335e55][_0x80f1('0x30')]]);if(_0x11226c[_0x80f1('0x76')]){var _0x8dd053={};_0x8dd053[_0x11226c[_0x80f1('0x78')]]=_0x70acee[_0x335e55]['associatedResources'];_0x487f72[_0x80f1('0x5b')](_0x8dd053);}else{if(!_0x155769[_0x80f1('0x3a')]['id'])_0x155769[_0x80f1('0x3a')]['id']=[];_0x70acee[_0x335e55][_0x80f1('0x79')]['forEach'](function(_0x58743f){_0x155769[_0x80f1('0x3a')]['id'][_0x80f1('0x5b')](_0x58743f);});}}}if(!_[_0x80f1('0x60')](_0x487f72)){_0x155769[_0x80f1('0x3a')]=_[_0x80f1('0x3c')](_0x155769[_0x80f1('0x3a')],{'$and':{'$or':_0x487f72}});}_0x155769=_['merge']({},_0x155769,_0x1a9e25[_0x80f1('0x3e')]);if(_0xa6e3b4&&!_0xa6e3b4[_0x80f1('0x54')]&&_0x23fe90[_0x80f1('0x70')]===_0x80f1('0x77')){if(_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x3f')]){_0x155769[_0x80f1('0x40')]=[{'all':!![]}];}return db[_0x23fe90[_0x80f1('0x70')]][_0x80f1('0x41')](_0x155769)[_0x80f1('0x28')](function(_0xa6f706){var _0x68172a=[];_0xa6f706[_0x80f1('0x62')](function(_0x71ea9){var _0x396cd7;switch(_0x71ea9[_0x80f1('0x7a')]){case _0x80f1('0x7b'):_0x396cd7=_[_0x80f1('0x47')](_0xa6e3b4['associatedResources'],function(_0x53c66a){return _0x53c66a['id']===_0x71ea9[_0x80f1('0x7c')]&&_0x53c66a['type']==='DefaultReports';});break;case _0x80f1('0x7d'):_0x396cd7=_[_0x80f1('0x47')](_0xa6e3b4[_0x80f1('0x79')],function(_0x545cfc){return _0x545cfc['id']===_0x71ea9[_0x80f1('0x7c')]&&_0x545cfc[_0x80f1('0x2e')]==='CustomReports';});break;}if(_0x396cd7)_0x68172a['push'](_0x71ea9);});_0x5248eb[_0x80f1('0x1f')]=_0x68172a['length'];_0x5248eb[_0x80f1('0x7e')]=_0x68172a;return _0x5248eb;});}else{return db[_0x23fe90['childModel']][_0x80f1('0x1f')]({'where':_0x155769['where']})[_0x80f1('0x28')](function(_0x2874af){_0x5248eb[_0x80f1('0x1f')]=_0x2874af;if(_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x3f')]){if(_0x23fe90[_0x80f1('0x70')]===_0x80f1('0x7f')){_0x155769[_0x80f1('0x40')]=[{'model':db[_0x80f1('0x80')],'as':_0x80f1('0x81'),'attributes':['id','name',_0x80f1('0x82')],'required':_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x83')]?!![]:![]},{'model':db['Tag'],'as':_0x80f1('0x84'),'attributes':['id',_0x80f1('0x30'),_0x80f1('0x82')],'through':_0x1a9e25['query'][_0x80f1('0x83')]?{'attributes':[],'where':{'TagId':_0x1a9e25[_0x80f1('0x31')]['tag']||undefined}}:{},'required':_0x1a9e25[_0x80f1('0x31')][_0x80f1('0x83')]?!![]:![]}];}else{_0x155769[_0x80f1('0x40')]=[{'all':!![]}];}}return db[_0x23fe90['childModel']][_0x80f1('0x41')](_0x155769);})[_0x80f1('0x28')](function(_0x35e8d6){_0x5248eb[_0x80f1('0x7e')]=_0x35e8d6;return _0x5248eb;});}}else{return _0x5248eb;}})[_0x80f1('0x28')](respondWithFilteredResult(_0x47fb10,_0x155769))[_0x80f1('0x42')](handleError(_0x47fb10,null));};function getAllResources(_0x38be1f,_0x5e66e5){return new BPromise(function(_0x341e1e,_0x327724){if(_0x5e66e5){var _0x2c93e4=_0x5e66e5[_0x80f1('0x3b')]?{[_0x5e66e5[_0x80f1('0x3b')][_0x80f1('0x76')]]:_0x5e66e5[_0x80f1('0x3b')]['value']}:undefined;return db[_0x38be1f][_0x80f1('0x41')]({'where':_0x2c93e4,'raw':!![]})[_0x80f1('0x28')](function(_0x45c899){_0x5e66e5[_0x80f1('0x79')]=_[_0x80f1('0x2b')](_0x45c899,'id');_0x341e1e(_0x5e66e5);})['catch'](function(_0x432f99){_0x327724(_0x432f99);});}else{_0x341e1e(null);}});}function getAllFilteredResources(_0x5540a1,_0x23d478){return new BPromise(function(_0xc9eb6e,_0x2f0410){var _0x2d3d71=_0x5540a1[_0x80f1('0x3b')]?{[_0x5540a1['filter'][_0x80f1('0x76')]]:_0x5540a1[_0x80f1('0x3b')][_0x80f1('0x85')]}:undefined;return db[_0x5540a1[_0x80f1('0x2f')]][_0x80f1('0x41')]({'where':_0x2d3d71,'raw':!![]})['then'](function(_0x26cb89){_0x23d478['associatedResources']=_[_0x80f1('0x2b')](_0x26cb89,function(_0x138cfd){return _0x138cfd[_0x80f1('0x30')];});_0xc9eb6e(_0x23d478);})[_0x80f1('0x42')](function(_0x141b92){_0x2f0410(_0x141b92);});});}function getAllowedResources(_0x4598,_0x453125,_0x70c1d5){return new BPromise(function(_0x3dde46,_0x50282e){if(_0x453125){return db[_0x80f1('0x55')][_0x80f1('0x41')]({'where':{'sectionId':_0x453125['id']},'raw':!![]})['then'](function(_0x44e775){if(_0x4598[_0x80f1('0x76')]&&_0x4598[_0x80f1('0x76')]!=='id'){_0x453125[_0x80f1('0x79')]=_[_0x80f1('0x2b')](_0x44e775,function(_0x17a8b9){return _0x17a8b9[_0x4598[_0x80f1('0x76')]];});}else{if(_0x70c1d5===_0x80f1('0x77')){_0x453125[_0x80f1('0x79')]=_[_0x80f1('0x2b')](_0x44e775,function(_0x3a5f94){return{'id':_0x3a5f94[_0x80f1('0x64')],'type':_0x3a5f94[_0x80f1('0x2e')]};});}else{_0x453125[_0x80f1('0x79')]=_[_0x80f1('0x2b')](_0x44e775,function(_0x3708be){return _0x3708be['resourceId'];});}}_0x3dde46(_0x453125);})['catch'](function(_0x100ee8){_0x50282e(_0x100ee8);});}else{_0x3dde46(null);}});}function getQueryModels(_0x299425,_0x51da43){var _0x58ab5c=_0x299425[_0x80f1('0x86')]();var _0x2a41bc={'childModel':undefined,'parentSections':[]};switch(_0x58ab5c){case _0x80f1('0x87'):_0x2a41bc['childModel']='SquareProject';break;case'odbc':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x88');break;case _0x80f1('0x89'):_0x2a41bc[_0x80f1('0x70')]='SquareRecording';_0x2a41bc[_0x80f1('0x71')]=[{'name':_0x80f1('0x8a'),'field':_0x80f1('0x30'),'foreignKey':_0x80f1('0x8b')}];break;case _0x80f1('0x8c'):_0x2a41bc['childModel']='JscriptyProject';break;case _0x80f1('0x8d'):_0x2a41bc['childModel']=_0x80f1('0x7f');_0x2a41bc[_0x80f1('0x71')]=[{'name':_0x80f1('0x8e'),'field':'id','foreignKey':_0x80f1('0x8f')}];break;case _0x80f1('0x90'):_0x2a41bc['childModel']='CmList';break;case _0x80f1('0x91'):_0x2a41bc['childModel']=_0x80f1('0x92');break;case _0x80f1('0x93'):_0x2a41bc['childModel']=_0x80f1('0x94');break;case _0x80f1('0x95'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x96');break;case _0x80f1('0x97'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x98');break;case _0x80f1('0x99'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x9a');break;case'faxaccounts':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x9b');break;case'inboundroutes':case _0x80f1('0x9c'):case _0x80f1('0x9d'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x9e');break;case _0x80f1('0x9f'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xa0');break;case _0x80f1('0xa1'):_0x2a41bc[_0x80f1('0x70')]='VoiceMail';break;case _0x80f1('0xa2'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xa3');_0x2a41bc[_0x80f1('0x71')]=[{'name':_0x80f1('0xa4'),'field':_0x80f1('0x30'),'foreignKey':_0x80f1('0xa5'),'model':_0x80f1('0xa6'),'filter':{'field':'role','value':[_0x80f1('0xa7')]}},{'name':_0x80f1('0xa8'),'field':_0x80f1('0x30'),'foreignKey':_0x80f1('0xa5'),'model':_0x80f1('0xa6'),'filter':{'field':_0x80f1('0xa9'),'value':[_0x80f1('0xaa')]}},{'name':_0x80f1('0xab'),'field':'name','foreignKey':_0x80f1('0xac'),'model':_0x80f1('0xad'),'filter':{'field':_0x80f1('0x2e'),'value':[_0x80f1('0xae')]}},{'name':_0x80f1('0xaf'),'field':_0x80f1('0x30'),'foreignKey':_0x80f1('0xac'),'model':_0x80f1('0xad'),'filter':{'field':_0x80f1('0x2e'),'value':['outbound']}}];break;case'musiconholds':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xb0');break;case'chanspies':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xb1');break;case'voiceprefixes':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xb2');break;case _0x80f1('0xb3'):_0x2a41bc[_0x80f1('0x70')]='Campaign';break;case'mailqueues':_0x2a41bc['childModel']=_0x80f1('0xb4');break;case _0x80f1('0xb5'):_0x2a41bc['childModel']=_0x80f1('0xb6');break;case _0x80f1('0xb7'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xb8');break;case _0x80f1('0xb9'):_0x2a41bc[_0x80f1('0x70')]='OpenchannelQueue';break;case _0x80f1('0xba'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xbb');break;case _0x80f1('0xbc'):_0x2a41bc['childModel']='SmsQueue';break;case'smsaccounts':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xbd');break;case _0x80f1('0xbe'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xbf');break;case _0x80f1('0xc0'):case _0x80f1('0xc1'):_0x2a41bc[_0x80f1('0x70')]='VoiceQueue';if(_0x51da43){_0x2a41bc['parentSections']=[{'name':_0x80f1('0xab')},{'name':_0x80f1('0xaf')}];}break;case'users':case _0x80f1('0xc2'):case _0x80f1('0xc3'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xa6');if(_0x51da43){_0x2a41bc[_0x80f1('0x71')]=[{'name':_0x80f1('0xc4'),'filter':{'field':'role','value':[_0x80f1('0xc5'),'user']},'ignore':!![]},{'name':_0x80f1('0xa4')},{'name':_0x80f1('0xa8')}];}break;case _0x80f1('0xc6'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xc7');break;case'salesforceaccounts':_0x2a41bc['childModel']=_0x80f1('0xc8');break;case'freshdeskaccounts':_0x2a41bc['childModel']='FreshdeskAccount';break;case _0x80f1('0xc9'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xca');break;case _0x80f1('0xcb'):_0x2a41bc['childModel']=_0x80f1('0xcc');break;case _0x80f1('0xcd'):_0x2a41bc[_0x80f1('0x70')]='ZohoAccount';break;case _0x80f1('0xce'):_0x2a41bc['childModel']=_0x80f1('0xa6');break;case _0x80f1('0xcf'):_0x2a41bc[_0x80f1('0x70')]='CannedAnswer';break;case _0x80f1('0xd0'):_0x2a41bc['childModel']=_0x80f1('0xd1');break;case _0x80f1('0xd2'):_0x2a41bc['childModel']=_0x80f1('0xd3');break;case _0x80f1('0xd4'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xd5');break;case _0x80f1('0xd6'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xd7');break;case _0x80f1('0xd8'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xd9');break;case _0x80f1('0xda'):_0x2a41bc[_0x80f1('0x70')]='Sound';break;case'tags':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x80');break;case'templates':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xdb');break;case'triggers':_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xdc');break;case _0x80f1('0xdd'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xde');break;case _0x80f1('0xdf'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xe0');break;case _0x80f1('0xe1'):_0x2a41bc['childModel']=_0x80f1('0x63');break;case _0x80f1('0xe2'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0x77');_0x2a41bc[_0x80f1('0x71')]=[{'name':_0x80f1('0xe3'),'field':'id','foreignKey':'reportId'}];break;case _0x80f1('0xe4'):_0x2a41bc[_0x80f1('0x70')]=_0x80f1('0xe5');break;default:return _0x2a41bc;}return _0x2a41bc;} \ No newline at end of file +var _0xd307=['User','role','agent','Telephones','inbound','QueueCampaigns','queue','VoiceQueue','outbound','musiconholds','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','VoicePrefix','ivrcampaigns','Campaign','MailQueue','mailaccounts','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','SmsAccount','teams','Team','voicequeues','queuecampaigns','users','Users','admin','user','Agents','zendeskaccounts','ZendeskAccount','salesforceaccounts','SalesforceAccount','freshdeskaccounts','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','CannedAnswer','dispositions','Disposition','customdashboards','Interval','pauses','Pause','scheduler','Schedule','sounds','Sound','templates','Template','triggers','Trigger','trunks','Trunk','variables','Variable','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./userProfile.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','then','destroy','error','stack','name','send','index','map','UserProfile','rawAttributes','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','show','keys','find','create','clone','options','get','omit','createdAt','updatedAt','crudPermissions','body','transaction','UserProfileSection','params','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','update','describe','addSections','sequelize','push','removeSections','ids','enabled','includes','subsections','findOne','Dashboard','forEach','resourceId','Plugin','addResources','bulkCreate','removeResources','getResources','section','undefined','Sequelize','Unknown\x20section','mergeResources','childModel','ValidationError','Invalid\x20section\x20\x27','isEmpty','parentSections','all','ignore','union','nolimit','pick','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','DefaultReports','reportId','CustomReports','CmContact','Tag','Tags','color','tag','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','projectName','projects','JscriptyProject','Lists','ListId','lists','CmList','companies','CmCompany','globalcustomfields','CmCustomField','chatqueues','ChatQueue','chatwebsites','ChatWebsite','faxqueues','faxaccounts','FaxAccount','internalroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicerecordings','VoiceRecording','membername'];(function(_0x2deed4,_0x2793e8){var _0xfb91f4=function(_0x31cb98){while(--_0x31cb98){_0x2deed4['push'](_0x2deed4['shift']());}};_0xfb91f4(++_0x2793e8);}(_0xd307,0x13a));var _0x7d30=function(_0x1b84bb,_0x38506d){_0x1b84bb=_0x1b84bb-0x0;var _0x4c79bf=_0xd307[_0x1b84bb];return _0x4c79bf;};'use strict';var pdf=require(_0x7d30('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7d30('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7d30('0x2'));var rp=require('request-promise');var moment=require(_0x7d30('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7d30('0x4'));var util=require(_0x7d30('0x5'));var path=require(_0x7d30('0x6'));var sox=require(_0x7d30('0x7'));var csv=require(_0x7d30('0x8'));var ejs=require(_0x7d30('0x9'));var fs=require('fs');var _=require(_0x7d30('0xa'));var squel=require('squel');var crypto=require(_0x7d30('0xb'));var jsforce=require(_0x7d30('0xc'));var deskjs=require(_0x7d30('0xd'));var toCsv=require(_0x7d30('0x8'));var querystring=require(_0x7d30('0xe'));var Papa=require(_0x7d30('0xf'));var Redis=require(_0x7d30('0x10'));var authService=require(_0x7d30('0x11'));var qs=require(_0x7d30('0x12'));var as=require(_0x7d30('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7d30('0x14'));var utils=require('../../config/utils');var config=require(_0x7d30('0x15'));var db=require(_0x7d30('0x16'))['db'];config[_0x7d30('0x17')]=_[_0x7d30('0x18')](config['redis'],{'host':_0x7d30('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7d30('0x17')]));require(_0x7d30('0x1a'))[_0x7d30('0x1b')](socket);function respondWithStatusCode(_0x2d3cad,_0x16e908){_0x16e908=_0x16e908||0xcc;return function(_0x18038d){if(_0x18038d){return _0x2d3cad[_0x7d30('0x1c')](_0x16e908);}return _0x2d3cad[_0x7d30('0x1d')](_0x16e908)['end']();};}function respondWithResult(_0x43ba14,_0x503273){_0x503273=_0x503273||0xc8;return function(_0x44ccd3){if(_0x44ccd3){return _0x43ba14['status'](_0x503273)[_0x7d30('0x1e')](_0x44ccd3);}};}function respondWithFilteredResult(_0x5eda78,_0x2b03b5){return function(_0x1e0358){if(_0x1e0358){var _0x3a8d9e=_0x1e0358[_0x7d30('0x1f')],_0x2a835a=_0x2b03b5[_0x7d30('0x20')],_0x4cd403=_0x2b03b5[_0x7d30('0x20')]+_0x2b03b5['limit'],_0x27a339;if(_0x4cd403>=_0x3a8d9e){_0x4cd403=_0x3a8d9e;_0x27a339=0xc8;}else{_0x27a339=0xce;}_0x5eda78[_0x7d30('0x1d')](_0x27a339);return _0x5eda78[_0x7d30('0x21')](_0x7d30('0x22'),_0x2a835a+'-'+_0x4cd403+'/'+_0x3a8d9e)['json'](_0x1e0358);}return null;};}function patchUpdates(_0x526eb1){return function(_0x10bc47){try{jsonpatch[_0x7d30('0x23')](_0x10bc47,_0x526eb1,!![]);}catch(_0xf6443c){return BPromise['reject'](_0xf6443c);}return _0x10bc47['save']();};}function saveUpdates(_0x542c06,_0x257107){return function(_0x4d0e10){if(_0x4d0e10){return _0x4d0e10['update'](_0x542c06)[_0x7d30('0x24')](function(_0x56ed66){return _0x56ed66;});}return null;};}function removeEntity(_0x501d5f,_0x391d63){return function(_0x3033ef){if(_0x3033ef){return _0x3033ef[_0x7d30('0x25')]()[_0x7d30('0x24')](function(){_0x501d5f[_0x7d30('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4118a6,_0xb7ae95){return function(_0x23ff46){if(!_0x23ff46){_0x4118a6[_0x7d30('0x1c')](0x194);}return _0x23ff46;};}function handleError(_0x3c0dab,_0x2139e6){_0x2139e6=_0x2139e6||0x1f4;return function(_0x2e73b9){logger[_0x7d30('0x26')](_0x2e73b9[_0x7d30('0x27')]);if(_0x2e73b9[_0x7d30('0x28')]){delete _0x2e73b9['name'];}_0x3c0dab[_0x7d30('0x1d')](_0x2139e6)[_0x7d30('0x29')](_0x2e73b9);};}exports[_0x7d30('0x2a')]=function(_0x5da1a7,_0x4202ec){var _0x449ae8={},_0x4840ae={},_0x58bb5d={'count':0x0,'rows':[]};var _0x47e0fc=_[_0x7d30('0x2b')](db[_0x7d30('0x2c')][_0x7d30('0x2d')],function(_0x19749e){return{'name':_0x19749e['fieldName'],'type':_0x19749e['type'][_0x7d30('0x2e')]};});_0x4840ae[_0x7d30('0x2f')]=_['map'](_0x47e0fc,_0x7d30('0x28'));_0x4840ae[_0x7d30('0x30')]=_['keys'](_0x5da1a7['query']);_0x4840ae[_0x7d30('0x31')]=_[_0x7d30('0x32')](_0x4840ae['model'],_0x4840ae[_0x7d30('0x30')]);_0x449ae8[_0x7d30('0x33')]=_[_0x7d30('0x32')](_0x4840ae[_0x7d30('0x2f')],qs[_0x7d30('0x34')](_0x5da1a7[_0x7d30('0x30')][_0x7d30('0x34')]));_0x449ae8[_0x7d30('0x33')]=_0x449ae8[_0x7d30('0x33')][_0x7d30('0x35')]?_0x449ae8[_0x7d30('0x33')]:_0x4840ae[_0x7d30('0x2f')];if(!_0x5da1a7['query'][_0x7d30('0x36')]('nolimit')){_0x449ae8['limit']=qs['limit'](_0x5da1a7['query'][_0x7d30('0x37')]);_0x449ae8[_0x7d30('0x20')]=qs[_0x7d30('0x20')](_0x5da1a7[_0x7d30('0x30')][_0x7d30('0x20')]);}_0x449ae8[_0x7d30('0x38')]=qs[_0x7d30('0x39')](_0x5da1a7[_0x7d30('0x30')][_0x7d30('0x39')]);_0x449ae8[_0x7d30('0x3a')]=qs[_0x7d30('0x31')](_['pick'](_0x5da1a7[_0x7d30('0x30')],_0x4840ae[_0x7d30('0x31')]));if(_0x5da1a7[_0x7d30('0x30')][_0x7d30('0x3b')]){_0x449ae8[_0x7d30('0x3a')]=_[_0x7d30('0x3c')](_0x449ae8['where'],{'$or':_[_0x7d30('0x2b')](_0x47e0fc,function(_0x39d957){if(_0x39d957[_0x7d30('0x3d')]!==_0x7d30('0x3e')){var _0x270eb9={};_0x270eb9[_0x39d957[_0x7d30('0x28')]]={'$like':'%'+_0x5da1a7[_0x7d30('0x30')][_0x7d30('0x3b')]+'%'};return _0x270eb9;}})});}_0x449ae8=_[_0x7d30('0x3c')]({},_0x449ae8,_0x5da1a7['options']);var _0x578189={'where':_0x449ae8[_0x7d30('0x3a')]};return db[_0x7d30('0x2c')][_0x7d30('0x1f')](_0x578189)[_0x7d30('0x24')](function(_0x3818da){_0x58bb5d['count']=_0x3818da;if(_0x5da1a7['query'][_0x7d30('0x3f')]){_0x449ae8[_0x7d30('0x40')]=[{'all':!![]}];}return db['UserProfile'][_0x7d30('0x41')](_0x449ae8);})['then'](function(_0x4d458e){_0x58bb5d[_0x7d30('0x42')]=_0x4d458e;return _0x58bb5d;})[_0x7d30('0x24')](respondWithFilteredResult(_0x4202ec,_0x449ae8))[_0x7d30('0x43')](handleError(_0x4202ec,null));};exports[_0x7d30('0x44')]=function(_0x231a2f,_0x5ba5f5){var _0x580c26={'raw':![],'where':{'id':_0x231a2f['params']['id']}},_0x373e02={};_0x373e02[_0x7d30('0x2f')]=_[_0x7d30('0x45')](db['UserProfile'][_0x7d30('0x2d')]);_0x373e02['query']=_[_0x7d30('0x45')](_0x231a2f[_0x7d30('0x30')]);_0x373e02[_0x7d30('0x31')]=_[_0x7d30('0x32')](_0x373e02[_0x7d30('0x2f')],_0x373e02[_0x7d30('0x30')]);_0x580c26['attributes']=_[_0x7d30('0x32')](_0x373e02[_0x7d30('0x2f')],qs[_0x7d30('0x34')](_0x231a2f[_0x7d30('0x30')][_0x7d30('0x34')]));_0x580c26['attributes']=_0x580c26[_0x7d30('0x33')][_0x7d30('0x35')]?_0x580c26['attributes']:_0x373e02[_0x7d30('0x2f')];if(_0x231a2f['query']['includeAll']){_0x580c26['include']=[{'all':!![]}];}_0x580c26=_[_0x7d30('0x3c')]({},_0x580c26,_0x231a2f['options']);return db['UserProfile'][_0x7d30('0x46')](_0x580c26)[_0x7d30('0x24')](handleEntityNotFound(_0x5ba5f5,null))[_0x7d30('0x24')](respondWithResult(_0x5ba5f5,null))[_0x7d30('0x43')](handleError(_0x5ba5f5,null));};exports['create']=function(_0x81f146,_0x735d41){return db[_0x7d30('0x2c')][_0x7d30('0x47')](_0x81f146['body'],{})[_0x7d30('0x24')](respondWithResult(_0x735d41,0xc9))[_0x7d30('0x43')](handleError(_0x735d41,null));};exports[_0x7d30('0x48')]=function(_0x2f3ee7,_0x1d74cd){var _0x117191={'where':{'id':_0x2f3ee7['params']['id']}},_0x55e8f6={};_0x55e8f6[_0x7d30('0x2f')]=_[_0x7d30('0x45')](db[_0x7d30('0x2c')][_0x7d30('0x2d')]);_0x117191[_0x7d30('0x33')]=_[_0x7d30('0x32')](_0x55e8f6['model'],qs['fields'](_0x2f3ee7['query'][_0x7d30('0x34')]));_0x117191[_0x7d30('0x33')]=_0x117191[_0x7d30('0x33')][_0x7d30('0x35')]?_0x117191[_0x7d30('0x33')]:_0x55e8f6[_0x7d30('0x2f')];if(_0x2f3ee7[_0x7d30('0x30')][_0x7d30('0x3f')]){_0x117191['include']=[{'all':!![]}];}_0x117191=_[_0x7d30('0x3c')]({},_0x117191,_0x2f3ee7[_0x7d30('0x49')]);return db['UserProfile'][_0x7d30('0x46')](_0x117191)[_0x7d30('0x24')](handleEntityNotFound(_0x1d74cd,null))[_0x7d30('0x24')](function(_0x1af485){if(_0x1af485){var _0x292eb5=_0x1af485[_0x7d30('0x4a')]({'plain':!![]});_0x292eb5=qs[_0x7d30('0x4b')](_0x292eb5,['id',_0x7d30('0x4c'),_0x7d30('0x4d'),_0x7d30('0x4e')]);_0x2f3ee7[_0x7d30('0x4f')]=_[_0x7d30('0x4b')](_0x2f3ee7[_0x7d30('0x4f')],['id',_0x7d30('0x4c'),_0x7d30('0x4d')]);return db['sequelize'][_0x7d30('0x50')](function(_0x3ce694){return db[_0x7d30('0x2c')][_0x7d30('0x47')](_[_0x7d30('0x3c')](_0x292eb5,_0x2f3ee7['body']),{'include':_0x2f3ee7[_0x7d30('0x30')][_0x7d30('0x3f')]?[{'all':!![]}]:undefined,'transaction':_0x3ce694})[_0x7d30('0x24')](function(_0x45936a){var _0x1254b5=_0x45936a[_0x7d30('0x4a')]({'plain':!![]});return db[_0x7d30('0x51')][_0x7d30('0x41')]({'where':{'userProfileId':_0x2f3ee7[_0x7d30('0x52')]['id']},'raw':!![]})['then'](function(_0x2d76d8){if(_0x2d76d8){return BPromise[_0x7d30('0x53')](_0x2d76d8,function(_0x330c21){return new BPromise(function(_0x209973,_0x941878){if(_0x330c21[_0x7d30('0x54')]===null||_0x330c21['autoAssociation']===0x1)_0x209973(null);return db[_0x7d30('0x55')][_0x7d30('0x41')]({'where':{'sectionId':_0x330c21['id']},'raw':!![]})['then'](function(_0x3e6164){var _0x349e52=_['map'](_0x3e6164,function(_0x4af820){return qs[_0x7d30('0x4b')](_0x4af820,['id',_0x7d30('0x4c'),_0x7d30('0x4d'),_0x7d30('0x56')]);});_0x209973(_0x349e52);})['catch'](function(_0x4f3381){_0x941878(_0x4f3381);});})['then'](function(_0x2a350f){var _0x490928=qs[_0x7d30('0x4b')](_0x330c21,['id','createdAt',_0x7d30('0x4d')]);_0x490928[_0x7d30('0x57')]=_0x1254b5['id'];if(_0x2a350f)_0x490928['Resources']=_0x2a350f;return _0x490928;})[_0x7d30('0x24')](function(_0x4fbfec){return db[_0x7d30('0x51')][_0x7d30('0x47')](_0x4fbfec,{'include':[{'model':db[_0x7d30('0x55')],'as':_0x7d30('0x58')}],'raw':!![],'transaction':_0x3ce694});});})[_0x7d30('0x24')](function(){return _0x1254b5;});}});});});}})[_0x7d30('0x24')](respondWithResult(_0x1d74cd,0xc9))['catch'](handleError(_0x1d74cd,null));};exports[_0x7d30('0x59')]=function(_0x124d10,_0x5c2906){if(_0x124d10['body']['id']){delete _0x124d10[_0x7d30('0x4f')]['id'];}return db[_0x7d30('0x2c')][_0x7d30('0x46')]({'where':{'id':_0x124d10[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x5c2906,null))[_0x7d30('0x24')](saveUpdates(_0x124d10[_0x7d30('0x4f')],null))['then'](respondWithResult(_0x5c2906,null))[_0x7d30('0x43')](handleError(_0x5c2906,null));};exports[_0x7d30('0x25')]=function(_0x26daad,_0x5193a5){return db['UserProfile'][_0x7d30('0x46')]({'where':{'id':_0x26daad[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x5193a5,null))[_0x7d30('0x24')](removeEntity(_0x5193a5,null))['catch'](handleError(_0x5193a5,null));};exports[_0x7d30('0x5a')]=function(_0x1d7fbd,_0x209303){return db['UserProfile'][_0x7d30('0x5a')]()[_0x7d30('0x24')](respondWithResult(_0x209303,null))['catch'](handleError(_0x209303,null));};exports[_0x7d30('0x5b')]=function(_0x3d9734,_0x32fbd2){var _0x39a719=_0x3d9734[_0x7d30('0x4f')];return db['UserProfile'][_0x7d30('0x46')]({'where':{'id':_0x3d9734[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x32fbd2,null))[_0x7d30('0x24')](function(_0x5eb553){if(_0x5eb553){return db[_0x7d30('0x5c')]['transaction'](function(_0x559e78){return db[_0x7d30('0x51')]['destroy']({'where':{'userProfileId':_0x3d9734[_0x7d30('0x52')]['id'],'sectionId':_['map'](_0x39a719,function(_0x3029d6){return _0x3029d6[_0x7d30('0x56')];})},'transaction':_0x559e78})[_0x7d30('0x24')](function(){var _0x318da0=_['map'](_0x39a719,function(_0x17dabd){_0x17dabd[_0x7d30('0x57')]=_0x3d9734['params']['id'];return _0x17dabd;});var _0x59683c=[];return BPromise[_0x7d30('0x53')](_0x318da0,function(_0x5f1f4f){return db[_0x7d30('0x51')][_0x7d30('0x47')](_0x5f1f4f,{'include':[{'model':db['UserProfileResource'],'as':_0x7d30('0x58')}],'raw':!![],'transaction':_0x559e78})[_0x7d30('0x24')](function(_0x926e17){_0x59683c[_0x7d30('0x5d')](_0x926e17[_0x7d30('0x4a')]({'plain':!![]}));});})['then'](function(){return _0x59683c;});});});}})[_0x7d30('0x24')](function(_0x8db318){return _0x8db318;})[_0x7d30('0x24')](respondWithResult(_0x32fbd2,null))[_0x7d30('0x43')](handleError(_0x32fbd2,null));};exports[_0x7d30('0x5e')]=function(_0x1b4374,_0x44bfe6){var _0x24296d;return db['UserProfile'][_0x7d30('0x46')]({'where':{'id':_0x1b4374['params']['id']},'attributes':['id',_0x7d30('0x28')]})[_0x7d30('0x24')](handleEntityNotFound(_0x44bfe6,null))[_0x7d30('0x24')](function(_0x1a1a53){if(_0x1a1a53){_0x24296d=_0x1a1a53;return db[_0x7d30('0x51')][_0x7d30('0x25')]({'where':{'userProfileId':_0x1b4374[_0x7d30('0x52')]['id'],'sectionId':_0x1b4374['query'][_0x7d30('0x5f')]}});}})[_0x7d30('0x24')](function(){return _0x24296d;})[_0x7d30('0x24')](respondWithStatusCode(_0x44bfe6,null))[_0x7d30('0x43')](handleError(_0x44bfe6,null));};exports['getSections']=function(_0x4991d1,_0x2c8b1e){var _0x300d51=[];var _0x39ebc4=[];return db[_0x7d30('0x51')][_0x7d30('0x41')]({'where':{'userProfileId':_0x4991d1[_0x7d30('0x52')]['id']},'raw':!![]})[_0x7d30('0x24')](function(_0x107674){_0x300d51=_[_0x7d30('0x3b')](_0x107674,function(_0x5b47a9){return _0x5b47a9[_0x7d30('0x60')]===0x1||_[_0x7d30('0x61')]([0x3eb,0x709],_0x5b47a9[_0x7d30('0x56')]);});if(!_['isEmpty'](_0x300d51)){return _['map'](_0x300d51,function(_0x53999b){return _0x53999b[_0x7d30('0x56')];});}else{return;}})[_0x7d30('0x24')](function(_0x44fd38){if(_0x44fd38)_0x39ebc4=_0x44fd38;if(_[_0x7d30('0x61')](_0x39ebc4,0x64)){var _0x3156cb=_['find'](_0x300d51,{'sectionId':0x64});return hasDefaultDashboard(_0x3156cb)[_0x7d30('0x24')](function(_0x32409e){return _[_0x7d30('0x2b')](_0x300d51,function(_0x58ac39){if(_0x58ac39[_0x7d30('0x56')]===0x64){_0x58ac39[_0x7d30('0x62')]=_0x32409e;}return _0x58ac39;});});}else{return;}})[_0x7d30('0x24')](function(_0x23cc2a){if(_0x23cc2a)_0x300d51=_0x23cc2a;if(_[_0x7d30('0x61')](_0x39ebc4,0x3eb)){var _0x41cddc=_[_0x7d30('0x46')](_0x300d51,{'sectionId':0x3eb});return getCustomDashboards(_0x41cddc)['then'](function(_0x1f861e){return _['map'](_0x300d51,function(_0x2fa10e){if(_0x41cddc[_0x7d30('0x60')]){if(_0x2fa10e[_0x7d30('0x56')]===0x3eb){_0x2fa10e['subsections']=_0x1f861e;}}else{if(_0x2fa10e[_0x7d30('0x56')]===0x64){_0x2fa10e[_0x7d30('0x62')]=_0x1f861e;}}return _0x2fa10e;});});}else{return;}})['then'](function(_0x324f8b){if(_0x324f8b)_0x300d51=_0x324f8b;if(_['includes'](_0x39ebc4,0x709)){var _0x2e45df=_[_0x7d30('0x46')](_0x300d51,{'sectionId':0x709});return getPlugins(_0x2e45df)['then'](function(_0x516308){if(_0x2e45df[_0x7d30('0x60')]){return _[_0x7d30('0x2b')](_0x300d51,function(_0x361145){if(_0x361145['sectionId']===0x709){_0x361145[_0x7d30('0x62')]=_0x516308;}return _0x361145;});}else{var _0x50209b={'sectionId':0x76c,'enabled':0x1,'subsections':_0x516308};var _0xdb8a39=_['map'](_0x300d51);_0xdb8a39[_0x7d30('0x5d')](_0x50209b);return _0xdb8a39;}});}else{return;}})[_0x7d30('0x24')](function(_0x2db478){if(_0x2db478)_0x300d51=_0x2db478;return _['filter'](_0x300d51,[_0x7d30('0x60'),0x1]);})[_0x7d30('0x24')](respondWithResult(_0x2c8b1e,null))[_0x7d30('0x43')](handleError(_0x2c8b1e,null));};function hasDefaultDashboard(_0x1c2c79){var _0x33f794=[0x65];return new BPromise(function(_0x32c69d,_0x5aed92){try{if(_0x1c2c79['autoAssociation']){_0x32c69d(_0x33f794);}else{return db['UserProfileResource'][_0x7d30('0x63')]({'where':{'sectionId':_0x1c2c79['id']},'raw':!![]})[_0x7d30('0x24')](function(_0x13f4fd){_0x13f4fd?_0x32c69d(_0x33f794):_0x32c69d();});}}catch(_0xf53fbc){_0x5aed92(_0xf53fbc);}});}function getCustomDashboards(_0x8954c4){var _0x3557e6=[];return new BPromise(function(_0x29e252,_0x38e662){try{if(_0x8954c4[_0x7d30('0x54')]){return db[_0x7d30('0x64')][_0x7d30('0x41')]({'raw':!![]})['then'](function(_0x28dc29){_0x28dc29[_0x7d30('0x65')](function(_0x53a528){_0x3557e6[_0x7d30('0x5d')](_0x53a528['id']+0x1869f);});_0x29e252(_0x3557e6);});}else{return db['UserProfileResource']['findAll']({'where':{'sectionId':_0x8954c4['id']},'raw':!![]})[_0x7d30('0x24')](function(_0x4f2121){_0x4f2121[_0x7d30('0x65')](function(_0xd792cc){_0x3557e6[_0x7d30('0x5d')](_0xd792cc[_0x7d30('0x66')]+0x1869f);});_0x29e252(_0x3557e6);});}}catch(_0x2c976e){_0x38e662(_0x2c976e);}});}function getPlugins(_0x17900f){var _0x101e98=[];return new BPromise(function(_0xb038b7,_0x4165f8){try{if(_0x17900f[_0x7d30('0x54')]){return db[_0x7d30('0x67')][_0x7d30('0x41')]({'raw':!![]})['then'](function(_0x211d91){_0x211d91[_0x7d30('0x65')](function(_0x4b98cc){_0x101e98[_0x7d30('0x5d')](_0x4b98cc['id']+0x15b38);});_0xb038b7(_0x101e98);});}else{return db['UserProfileResource'][_0x7d30('0x41')]({'where':{'sectionId':_0x17900f['id']},'raw':!![]})[_0x7d30('0x24')](function(_0x55db03){_0x55db03[_0x7d30('0x65')](function(_0x3b3cc6){_0x101e98[_0x7d30('0x5d')](_0x3b3cc6[_0x7d30('0x66')]+0x15b38);});_0xb038b7(_0x101e98);});}}catch(_0x192954){_0x4165f8(_0x192954);}});}exports[_0x7d30('0x68')]=function(_0x226ff0,_0x117ab9){return db[_0x7d30('0x2c')]['find']({'where':{'id':_0x226ff0[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x117ab9,null))['then'](function(_0x179a8f){if(_0x179a8f){return db['sequelize'][_0x7d30('0x50')](function(_0x17aa2a){return db[_0x7d30('0x51')][_0x7d30('0x41')]({'where':{'userProfileId':_0x226ff0[_0x7d30('0x52')]['id']},'attributes':['id'],'raw':!![]})[_0x7d30('0x24')](function(_0x4c2672){if(_0x4c2672){return db[_0x7d30('0x51')]['destroy']({'where':{'userProfileId':_0x226ff0[_0x7d30('0x52')]['id'],'id':_[_0x7d30('0x2b')](_0x4c2672,function(_0x188ea6){return _0x188ea6['id'];})},'transaction':_0x17aa2a});}})[_0x7d30('0x24')](function(_0x32b58a){var _0x886647=_['map'](_0x226ff0[_0x7d30('0x4f')],function(_0x11d2e4){_0x11d2e4[_0x7d30('0x57')]=_0x226ff0[_0x7d30('0x52')]['id'];return _0x11d2e4;});return db[_0x7d30('0x51')][_0x7d30('0x69')](_0x886647,{'raw':!![],'transaction':_0x17aa2a});})[_0x7d30('0x24')](function(_0x5704e3){var _0xa15a1=_[_0x7d30('0x3b')](_[_0x7d30('0x2b')](_0x5704e3,function(_0x17f5d1){return _0x17f5d1[_0x7d30('0x4a')]({'plain':!![]});}),{'includeAll':![]});if(_0xa15a1){return db[_0x7d30('0x51')]['findAll']({'where':{'userProfileId':_0x226ff0[_0x7d30('0x52')]['id'],'sectionId':_[_0x7d30('0x2b')](_0xa15a1,function(_0x1c73b4){return _0x1c73b4[_0x7d30('0x56')];})},'attributes':['id',_0x7d30('0x56')],'raw':!![]})[_0x7d30('0x24')](function(_0x2d4a2f){var _0x365ae0=_[_0x7d30('0x2b')](_0x226ff0[_0x7d30('0x4f')],function(_0xc1f7da){_0xc1f7da[_0x7d30('0x57')]=_0x226ff0[_0x7d30('0x52')]['id'];return _0xc1f7da;});return db[_0x7d30('0x55')][_0x7d30('0x69')](_0x365ae0,{'raw':!![],'transaction':_0x17aa2a});});}})['catch'](handleError(_0x117ab9,null));});}})[_0x7d30('0x24')](function(_0x20726f){var _0x129b43=_[_0x7d30('0x2b')](_0x20726f,function(_0x2dd6a4){return _0x2dd6a4[_0x7d30('0x4a')]({'plain':!![]});});})[_0x7d30('0x24')](respondWithResult(_0x117ab9,null))[_0x7d30('0x43')](handleError(_0x117ab9,null));};exports['removeResources']=function(_0x1f1d16,_0x24f88a,_0x52e326){return db[_0x7d30('0x2c')][_0x7d30('0x46')]({'where':{'id':_0x1f1d16[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x24f88a,null))[_0x7d30('0x24')](function(_0x1a1b98){if(_0x1a1b98){return _0x1a1b98[_0x7d30('0x6a')](_0x1f1d16[_0x7d30('0x30')][_0x7d30('0x5f')]);}})[_0x7d30('0x24')](respondWithStatusCode(_0x24f88a,null))[_0x7d30('0x43')](handleError(_0x24f88a,null));};exports[_0x7d30('0x6b')]=function(_0x3d141d,_0x3c9d7c){var _0x41517b={'raw':![],'where':{}};var _0x49fbca={};var _0x49dc0d={'count':0x0,'rows':[]};var _0x32b3ac=_0x3d141d[_0x7d30('0x30')][_0x7d30('0x6c')];if(typeof _0x32b3ac===_0x7d30('0x6d')){throw new db[(_0x7d30('0x6e'))]['ValidationError'](_0x7d30('0x6f'));}var _0x550dbe=_0x3d141d[_0x7d30('0x30')][_0x7d30('0x70')]||![];var _0xb1ae64=getQueryModels(_0x32b3ac,_0x550dbe);if(typeof _0xb1ae64[_0x7d30('0x71')]==='undefined'){throw new db[(_0x7d30('0x6e'))][(_0x7d30('0x72'))](_0x7d30('0x73')+_0x32b3ac+'\x27');}var _0x4e1ef4=[];if(!_[_0x7d30('0x74')](_0xb1ae64[_0x7d30('0x75')])){_0x4e1ef4=_0xb1ae64['parentSections'];}else{_0x4e1ef4=[{'name':_0x32b3ac}];}return db['UserProfile'][_0x7d30('0x63')]({'where':{'id':_0x3d141d[_0x7d30('0x52')]['id']}})[_0x7d30('0x24')](handleEntityNotFound(_0x3c9d7c,null))[_0x7d30('0x24')](function(_0x2e0a0b){if(_0x2e0a0b){var _0x2ab6f=[];for(var _0x2eac03=0x0;_0x2eac03<_0x4e1ef4[_0x7d30('0x35')];_0x2eac03++){_0x2ab6f[_0x7d30('0x5d')](db[_0x7d30('0x51')][_0x7d30('0x63')]({'where':{'userProfileId':_0x2e0a0b['id'],'name':_0x4e1ef4[_0x2eac03]['name']},'raw':!![]}));}return BPromise[_0x7d30('0x76')](_0x2ab6f);}})[_0x7d30('0x24')](function(_0x5d6b74){var _0x1c4216=_[_0x7d30('0x3b')](_0x5d6b74,function(_0x2e5172){return _0x2e5172?_0x2e5172:undefined;});var _0x487e1c=_[_0x7d30('0x3b')](_0x4e1ef4,[_0x7d30('0x77'),!![]]);var _0x1f28a6=_['isEmpty'](_0x1c4216)&&_['isEmpty'](_0x487e1c)?null:_[_0x7d30('0x78')](_0x487e1c,_0x1c4216);if(_0x1f28a6){var _0x232b10=[];for(var _0x42d4bc=0x0;_0x42d4bc<_0x1f28a6[_0x7d30('0x35')];_0x42d4bc++){var _0x1a0409=_['find'](_0x4e1ef4,function(_0x408a05){return _0x1f28a6[_0x42d4bc]?_0x408a05['name']===_0x1f28a6[_0x42d4bc]['name']:null;});if(_0x1a0409){if(_0x1f28a6[_0x42d4bc][_0x7d30('0x77')]){_0x232b10['push'](getAllResources(_0xb1ae64[_0x7d30('0x71')],_0x1f28a6[_0x42d4bc]));}else{if(!_0x1f28a6[_0x42d4bc]['autoAssociation']){_0x232b10['push'](getAllowedResources(_0x1a0409,_0x1f28a6[_0x42d4bc],_0xb1ae64[_0x7d30('0x71')]));}else{if(_0x1a0409[_0x7d30('0x2f')]){_0x232b10[_0x7d30('0x5d')](getAllFilteredResources(_0x1a0409,_0x1f28a6[_0x42d4bc]));}}}}}return BPromise[_0x7d30('0x76')](_0x232b10);}else{return null;}})[_0x7d30('0x24')](function(_0xbaf81b){var _0x26506c=_0xbaf81b;var _0x1705b9=null;if(_0x26506c){_0x1705b9=_0x26506c['length']===0x1?_0x26506c[0x0]:null;}if(_0x1705b9||_0x26506c){var _0x3eb759=db[_0xb1ae64['childModel']][_0x7d30('0x2d')];_0x49fbca[_0x7d30('0x2f')]=_[_0x7d30('0x45')](_0x3eb759);_0x49fbca[_0x7d30('0x30')]=_[_0x7d30('0x45')](_0x3d141d[_0x7d30('0x30')]);_0x49fbca[_0x7d30('0x31')]=_[_0x7d30('0x32')](_0x49fbca['model'],_0x49fbca[_0x7d30('0x30')]);_0x41517b[_0x7d30('0x33')]=_[_0x7d30('0x32')](_0x49fbca['model'],qs[_0x7d30('0x34')](_0x3d141d[_0x7d30('0x30')]['fields']));_0x41517b[_0x7d30('0x33')]=_0x41517b[_0x7d30('0x33')][_0x7d30('0x35')]?_0x41517b['attributes']:_0x49fbca[_0x7d30('0x2f')];if(!_0x3d141d[_0x7d30('0x30')][_0x7d30('0x36')](_0x7d30('0x79'))){_0x41517b[_0x7d30('0x37')]=qs[_0x7d30('0x37')](_0x3d141d['query'][_0x7d30('0x37')]);_0x41517b[_0x7d30('0x20')]=qs[_0x7d30('0x20')](_0x3d141d[_0x7d30('0x30')][_0x7d30('0x20')]);}_0x41517b[_0x7d30('0x38')]=qs[_0x7d30('0x39')](_0x3d141d['query'][_0x7d30('0x39')]);_0x41517b[_0x7d30('0x3a')]=qs[_0x7d30('0x31')](_[_0x7d30('0x7a')](_0x3d141d[_0x7d30('0x30')],_0x49fbca[_0x7d30('0x31')]));if(_0x3d141d[_0x7d30('0x30')][_0x7d30('0x3b')]){_0x41517b[_0x7d30('0x3a')]=_[_0x7d30('0x3c')](_0x41517b[_0x7d30('0x3a')],{'$or':_[_0x7d30('0x2b')](_0x3eb759,function(_0x32e812){if(_0x32e812[_0x7d30('0x3d')][_0x7d30('0x2e')]!==_0x7d30('0x3e')){var _0x41093e={};_0x41093e[_0x32e812['field']]={'$like':'%'+_0x3d141d['query'][_0x7d30('0x3b')]+'%'};return _0x41093e;}})});}var _0x4e6bde=[];if(_0x1705b9){var _0x495006=_[_0x7d30('0x46')](_0x4e1ef4,['name',_0x1705b9[_0x7d30('0x28')]]);if(_0x495006[_0x7d30('0x7b')]){var _0x559eeb={};if(_0xb1ae64[_0x7d30('0x71')]===_0x7d30('0x7c')){_0x559eeb[_0x495006[_0x7d30('0x7d')]]=_[_0x7d30('0x2b')](_0x1705b9[_0x7d30('0x7e')],'id');}else{_0x559eeb[_0x495006[_0x7d30('0x7d')]]=_0x1705b9['associatedResources'];}_0x4e6bde[_0x7d30('0x5d')](_0x559eeb);}else{_0x41517b[_0x7d30('0x3a')]['id']=_0x1705b9[_0x7d30('0x7e')];}}else{for(var _0xd662b5=0x0;_0xd662b5<_0x26506c[_0x7d30('0x35')];_0xd662b5++){var _0x495006=_['find'](_0x4e1ef4,[_0x7d30('0x28'),_0x26506c[_0xd662b5]['name']]);if(_0x495006[_0x7d30('0x7b')]){var _0x559eeb={};_0x559eeb[_0x495006[_0x7d30('0x7d')]]=_0x26506c[_0xd662b5][_0x7d30('0x7e')];_0x4e6bde[_0x7d30('0x5d')](_0x559eeb);}else{if(!_0x41517b[_0x7d30('0x3a')]['id'])_0x41517b[_0x7d30('0x3a')]['id']=[];_0x26506c[_0xd662b5][_0x7d30('0x7e')][_0x7d30('0x65')](function(_0x472fef){_0x41517b[_0x7d30('0x3a')]['id']['push'](_0x472fef);});}}}if(!_[_0x7d30('0x74')](_0x4e6bde)){_0x41517b[_0x7d30('0x3a')]=_['merge'](_0x41517b[_0x7d30('0x3a')],{'$and':{'$or':_0x4e6bde}});}_0x41517b=_[_0x7d30('0x3c')]({},_0x41517b,_0x3d141d[_0x7d30('0x49')]);if(_0x1705b9&&!_0x1705b9[_0x7d30('0x54')]&&_0xb1ae64[_0x7d30('0x71')]===_0x7d30('0x7c')){if(_0x3d141d['query'][_0x7d30('0x3f')]){_0x41517b[_0x7d30('0x40')]=[{'all':!![]}];}return db[_0xb1ae64[_0x7d30('0x71')]][_0x7d30('0x41')](_0x41517b)[_0x7d30('0x24')](function(_0x1e6fcb){var _0x262891=[];_0x1e6fcb['forEach'](function(_0x44418c){var _0x2cf7f6;switch(_0x44418c[_0x7d30('0x7f')]){case'default':_0x2cf7f6=_[_0x7d30('0x46')](_0x1705b9['associatedResources'],function(_0x10feb9){return _0x10feb9['id']===_0x44418c['reportId']&&_0x10feb9[_0x7d30('0x3d')]===_0x7d30('0x80');});break;case'custom':_0x2cf7f6=_[_0x7d30('0x46')](_0x1705b9[_0x7d30('0x7e')],function(_0x42f356){return _0x42f356['id']===_0x44418c[_0x7d30('0x81')]&&_0x42f356['type']===_0x7d30('0x82');});break;}if(_0x2cf7f6)_0x262891[_0x7d30('0x5d')](_0x44418c);});_0x49dc0d[_0x7d30('0x1f')]=_0x262891['length'];_0x49dc0d['rows']=_0x262891;return _0x49dc0d;});}else{return db[_0xb1ae64[_0x7d30('0x71')]]['count']({'where':_0x41517b[_0x7d30('0x3a')]})[_0x7d30('0x24')](function(_0x466b4c){_0x49dc0d['count']=_0x466b4c;if(_0x3d141d[_0x7d30('0x30')][_0x7d30('0x3f')]){if(_0xb1ae64[_0x7d30('0x71')]===_0x7d30('0x83')){_0x41517b[_0x7d30('0x40')]=[{'model':db[_0x7d30('0x84')],'as':_0x7d30('0x85'),'attributes':['id',_0x7d30('0x28'),_0x7d30('0x86')],'required':_0x3d141d[_0x7d30('0x30')]['tag']?!![]:![]},{'model':db[_0x7d30('0x84')],'as':'ThroughTags','attributes':['id',_0x7d30('0x28'),_0x7d30('0x86')],'through':_0x3d141d[_0x7d30('0x30')][_0x7d30('0x87')]?{'attributes':[],'where':{'TagId':_0x3d141d['query'][_0x7d30('0x87')]||undefined}}:{},'required':_0x3d141d[_0x7d30('0x30')][_0x7d30('0x87')]?!![]:![]}];}else{_0x41517b[_0x7d30('0x40')]=[{'all':!![]}];}}return db[_0xb1ae64[_0x7d30('0x71')]][_0x7d30('0x41')](_0x41517b);})[_0x7d30('0x24')](function(_0x4ebcdb){_0x49dc0d[_0x7d30('0x42')]=_0x4ebcdb;return _0x49dc0d;});}}else{return _0x49dc0d;}})['then'](respondWithFilteredResult(_0x3c9d7c,_0x41517b))[_0x7d30('0x43')](handleError(_0x3c9d7c,null));};function getAllResources(_0x535026,_0x503e37){return new BPromise(function(_0x5c77d8,_0x122b5d){if(_0x503e37){var _0x3f0872=_0x503e37[_0x7d30('0x3b')]?{[_0x503e37[_0x7d30('0x3b')][_0x7d30('0x7b')]]:_0x503e37[_0x7d30('0x3b')]['value']}:undefined;return db[_0x535026][_0x7d30('0x41')]({'where':_0x3f0872,'raw':!![]})[_0x7d30('0x24')](function(_0x54f9ed){_0x503e37[_0x7d30('0x7e')]=_['map'](_0x54f9ed,'id');_0x5c77d8(_0x503e37);})[_0x7d30('0x43')](function(_0x40e2ce){_0x122b5d(_0x40e2ce);});}else{_0x5c77d8(null);}});}function getAllFilteredResources(_0x13e4bf,_0x4c5448){return new BPromise(function(_0x212f59,_0xd9c29b){var _0x3255a9=_0x13e4bf[_0x7d30('0x3b')]?{[_0x13e4bf[_0x7d30('0x3b')][_0x7d30('0x7b')]]:_0x13e4bf['filter']['value']}:undefined;return db[_0x13e4bf[_0x7d30('0x2f')]][_0x7d30('0x41')]({'where':_0x3255a9,'raw':!![]})['then'](function(_0x1d700c){_0x4c5448[_0x7d30('0x7e')]=_[_0x7d30('0x2b')](_0x1d700c,function(_0x58ad92){return _0x58ad92[_0x7d30('0x28')];});_0x212f59(_0x4c5448);})[_0x7d30('0x43')](function(_0x440e71){_0xd9c29b(_0x440e71);});});}function getAllowedResources(_0x3d6628,_0x39a15a,_0x24ddeb){return new BPromise(function(_0x165b5d,_0x137bbb){if(_0x39a15a){return db[_0x7d30('0x55')][_0x7d30('0x41')]({'where':{'sectionId':_0x39a15a['id']},'raw':!![]})['then'](function(_0x48464b){if(_0x3d6628['field']&&_0x3d6628[_0x7d30('0x7b')]!=='id'){_0x39a15a[_0x7d30('0x7e')]=_[_0x7d30('0x2b')](_0x48464b,function(_0xdcb7e){return _0xdcb7e[_0x3d6628[_0x7d30('0x7b')]];});}else{if(_0x24ddeb===_0x7d30('0x7c')){_0x39a15a['associatedResources']=_[_0x7d30('0x2b')](_0x48464b,function(_0x282997){return{'id':_0x282997[_0x7d30('0x66')],'type':_0x282997['type']};});}else{_0x39a15a[_0x7d30('0x7e')]=_['map'](_0x48464b,function(_0x4d443){return _0x4d443['resourceId'];});}}_0x165b5d(_0x39a15a);})['catch'](function(_0xe3bd53){_0x137bbb(_0xe3bd53);});}else{_0x165b5d(null);}});}function getQueryModels(_0xeef7cf,_0x184a0c){var _0x1e20a7=_0xeef7cf[_0x7d30('0x88')]();var _0x491a98={'childModel':undefined,'parentSections':[]};switch(_0x1e20a7){case'squareprojects':_0x491a98['childModel']=_0x7d30('0x89');break;case _0x7d30('0x8a'):_0x491a98['childModel']=_0x7d30('0x8b');break;case _0x7d30('0x8c'):_0x491a98['childModel']=_0x7d30('0x8d');_0x491a98[_0x7d30('0x75')]=[{'name':'SquareProjects','field':_0x7d30('0x28'),'foreignKey':_0x7d30('0x8e')}];break;case _0x7d30('0x8f'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x90');break;case'contacts':_0x491a98[_0x7d30('0x71')]=_0x7d30('0x83');_0x491a98[_0x7d30('0x75')]=[{'name':_0x7d30('0x91'),'field':'id','foreignKey':_0x7d30('0x92')}];break;case _0x7d30('0x93'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x94');break;case _0x7d30('0x95'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x96');break;case _0x7d30('0x97'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x98');break;case _0x7d30('0x99'):_0x491a98['childModel']=_0x7d30('0x9a');break;case _0x7d30('0x9b'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x9c');break;case _0x7d30('0x9d'):_0x491a98[_0x7d30('0x71')]='FaxQueue';break;case _0x7d30('0x9e'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x9f');break;case'inboundroutes':case _0x7d30('0xa0'):case _0x7d30('0xa1'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xa2');break;case _0x7d30('0xa3'):_0x491a98['childModel']=_0x7d30('0xa4');break;case'voicemails':_0x491a98[_0x7d30('0x71')]='VoiceMail';break;case _0x7d30('0xa5'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xa6');_0x491a98['parentSections']=[{'name':'Agents','field':_0x7d30('0x28'),'foreignKey':_0x7d30('0xa7'),'model':_0x7d30('0xa8'),'filter':{'field':_0x7d30('0xa9'),'value':[_0x7d30('0xaa')]}},{'name':_0x7d30('0xab'),'field':'name','foreignKey':_0x7d30('0xa7'),'model':_0x7d30('0xa8'),'filter':{'field':_0x7d30('0xa9'),'value':['telephone']}},{'name':'VoiceQueues','field':_0x7d30('0x28'),'foreignKey':'queue','model':'VoiceQueue','filter':{'field':_0x7d30('0x3d'),'value':[_0x7d30('0xac')]}},{'name':_0x7d30('0xad'),'field':_0x7d30('0x28'),'foreignKey':_0x7d30('0xae'),'model':_0x7d30('0xaf'),'filter':{'field':_0x7d30('0x3d'),'value':[_0x7d30('0xb0')]}}];break;case _0x7d30('0xb1'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xb2');break;case _0x7d30('0xb3'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xb4');break;case _0x7d30('0xb5'):_0x491a98['childModel']=_0x7d30('0xb6');break;case _0x7d30('0xb7'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xb8');break;case'mailqueues':_0x491a98[_0x7d30('0x71')]=_0x7d30('0xb9');break;case _0x7d30('0xba'):_0x491a98[_0x7d30('0x71')]='MailAccount';break;case _0x7d30('0xbb'):_0x491a98['childModel']=_0x7d30('0xbc');break;case _0x7d30('0xbd'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xbe');break;case _0x7d30('0xbf'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xc0');break;case _0x7d30('0xc1'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xc2');break;case'smsaccounts':_0x491a98[_0x7d30('0x71')]=_0x7d30('0xc3');break;case _0x7d30('0xc4'):_0x491a98['childModel']=_0x7d30('0xc5');break;case _0x7d30('0xc6'):case _0x7d30('0xc7'):_0x491a98['childModel']='VoiceQueue';if(_0x184a0c){_0x491a98['parentSections']=[{'name':'VoiceQueues'},{'name':_0x7d30('0xad')}];}break;case _0x7d30('0xc8'):case'agents':case'telephones':_0x491a98[_0x7d30('0x71')]='User';if(_0x184a0c){_0x491a98['parentSections']=[{'name':_0x7d30('0xc9'),'filter':{'field':_0x7d30('0xa9'),'value':[_0x7d30('0xca'),_0x7d30('0xcb')]},'ignore':!![]},{'name':_0x7d30('0xcc')},{'name':_0x7d30('0xab')}];}break;case _0x7d30('0xcd'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xce');break;case _0x7d30('0xcf'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xd0');break;case _0x7d30('0xd1'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xd2');break;case _0x7d30('0xd3'):_0x491a98[_0x7d30('0x71')]='SugarcrmAccount';break;case _0x7d30('0xd4'):_0x491a98['childModel']=_0x7d30('0xd5');break;case _0x7d30('0xd6'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xd7');break;case _0x7d30('0xd8'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xa8');break;case _0x7d30('0xd9'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xda');break;case _0x7d30('0xdb'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xdc');break;case _0x7d30('0xdd'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x64');break;case'intervals':_0x491a98[_0x7d30('0x71')]=_0x7d30('0xde');break;case _0x7d30('0xdf'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xe0');break;case _0x7d30('0xe1'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xe2');break;case _0x7d30('0xe3'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xe4');break;case'tags':_0x491a98[_0x7d30('0x71')]=_0x7d30('0x84');break;case _0x7d30('0xe5'):_0x491a98['childModel']=_0x7d30('0xe6');break;case _0x7d30('0xe7'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xe8');break;case _0x7d30('0xe9'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xea');break;case _0x7d30('0xeb'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xec');break;case'plugins':_0x491a98[_0x7d30('0x71')]=_0x7d30('0x67');break;case _0x7d30('0xed'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0x7c');_0x491a98['parentSections']=[{'name':_0x7d30('0xee'),'field':'id','foreignKey':_0x7d30('0x81')}];break;case _0x7d30('0xef'):_0x491a98[_0x7d30('0x71')]=_0x7d30('0xf0');break;default:return _0x491a98;}return _0x491a98;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 4e09f7c..a536929 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 _0x45d9=['emit','exports','events','UserProfile','save'];(function(_0x56c6bb,_0x3debab){var _0x3f4ba8=function(_0x47baba){while(--_0x47baba){_0x56c6bb['push'](_0x56c6bb['shift']());}};_0x3f4ba8(++_0x3debab);}(_0x45d9,0x8e));var _0x945d=function(_0x114d42,_0x3aa93c){_0x114d42=_0x114d42-0x0;var _0x4eab15=_0x45d9[_0x114d42];return _0x4eab15;};'use strict';var EventEmitter=require(_0x945d('0x0'));var UserProfile=require('../../mysqldb')['db'][_0x945d('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x945d('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x24f504){return function(_0xeec09c,_0x2147a0,_0x34f0e7){UserProfileEvents[_0x945d('0x3')](_0x24f504+':'+_0xeec09c['id'],_0xeec09c);UserProfileEvents[_0x945d('0x3')](_0x24f504,_0xeec09c);_0x34f0e7(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile['hook'](e,emitEvent(event));}}module[_0x945d('0x4')]=UserProfileEvents; \ No newline at end of file +var _0xca5b=['remove','emit','hook','events','../../mysqldb','UserProfile','setMaxListeners','save'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xca5b,0x1cb));var _0xbca5=function(_0x47f719,_0x2e559d){_0x47f719=_0x47f719-0x0;var _0x407f4e=_0xca5b[_0x47f719];return _0x407f4e;};'use strict';var EventEmitter=require(_0xbca5('0x0'));var UserProfile=require(_0xbca5('0x1'))['db'][_0xbca5('0x2')];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0xbca5('0x3')](0x0);var events={'afterCreate':_0xbca5('0x4'),'afterUpdate':'update','afterDestroy':_0xbca5('0x5')};function emitEvent(_0x5ecc40){return function(_0x319a62,_0x363ed1,_0x53b6b0){UserProfileEvents['emit'](_0x5ecc40+':'+_0x319a62['id'],_0x319a62);UserProfileEvents[_0xbca5('0x6')](_0x5ecc40,_0x319a62);_0x53b6b0(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xbca5('0x7')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index b54954e..75f6906 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 _0x4427=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','define','user_profiles','util','../../config/logger'];(function(_0x34651f,_0x1b07dd){var _0x2d88fe=function(_0x1bc817){while(--_0x1bc817){_0x34651f['push'](_0x34651f['shift']());}};_0x2d88fe(++_0x1b07dd);}(_0x4427,0x19e));var _0x7442=function(_0x4d672c,_0x15a6e0){_0x4d672c=_0x4d672c-0x0;var _0x22dc61=_0x4427[_0x4d672c];return _0x22dc61;};'use strict';var _=require('lodash');var util=require(_0x7442('0x0'));var logger=require(_0x7442('0x1'))(_0x7442('0x2'));var moment=require(_0x7442('0x3'));var BPromise=require(_0x7442('0x4'));var rp=require(_0x7442('0x5'));var fs=require('fs');var path=require(_0x7442('0x6'));var rimraf=require(_0x7442('0x7'));var config=require(_0x7442('0x8'));var attributes=require(_0x7442('0x9'));module[_0x7442('0xa')]=function(_0x2c1f40,_0x38f338){return _0x2c1f40[_0x7442('0xb')]('UserProfile',attributes,{'tableName':_0x7442('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb194=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userProfile.attributes','exports','UserProfile','lodash'];(function(_0x56c7c0,_0x463d97){var _0x666b9a=function(_0x56e4a5){while(--_0x56e4a5){_0x56c7c0['push'](_0x56c7c0['shift']());}};_0x666b9a(++_0x463d97);}(_0xb194,0x81));var _0x4b19=function(_0x2b53aa,_0x37e02a){_0x2b53aa=_0x2b53aa-0x0;var _0x33791e=_0xb194[_0x2b53aa];return _0x33791e;};'use strict';var _=require(_0x4b19('0x0'));var util=require(_0x4b19('0x1'));var logger=require(_0x4b19('0x2'))(_0x4b19('0x3'));var moment=require(_0x4b19('0x4'));var BPromise=require(_0x4b19('0x5'));var rp=require(_0x4b19('0x6'));var fs=require('fs');var path=require(_0x4b19('0x7'));var rimraf=require(_0x4b19('0x8'));var config=require(_0x4b19('0x9'));var attributes=require(_0x4b19('0xa'));module[_0x4b19('0xb')]=function(_0x5573cb,_0x2e8495){return _0x5573cb['define'](_0x4b19('0xc'),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 d4cf34d..6bb4550 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 _0x5d58=['localhost','register','request','then','info','UserProfile,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d58,0x187));var _0x85d5=function(_0x17d869,_0x17252c){_0x17d869=_0x17d869-0x0;var _0xb1b292=_0x5d58[_0x17d869];return _0xb1b292;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x85d5('0x0'));var db=require(_0x85d5('0x1'))['db'];var utils=require('../../config/utils');var logger=require(_0x85d5('0x2'))(_0x85d5('0x3'));var config=require('../../config/environment');var jayson=require(_0x85d5('0x4'));var client=jayson[_0x85d5('0x5')][_0x85d5('0x6')]({'port':0x232a});config[_0x85d5('0x7')]=_['defaults'](config[_0x85d5('0x7')],{'host':_0x85d5('0x8'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x85d5('0x7')]));require('./userProfile.socket')[_0x85d5('0x9')](socket);function respondWithRpcPromise(_0x2ce6b9,_0x258f0c,_0x488dcb){return new BPromise(function(_0x499b36,_0x4e147a){return client[_0x85d5('0xa')](_0x2ce6b9,_0x488dcb)[_0x85d5('0xb')](function(_0xde1063){logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));logger[_0x85d5('0xf')]('UserProfile,\x20%s,\x20%s,\x20%s',_0x258f0c,'request\x20sent',JSON['stringify'](_0xde1063));if(_0xde1063[_0x85d5('0x10')]){if(_0xde1063[_0x85d5('0x10')][_0x85d5('0x11')]===0x1f4){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x4e147a(_0xde1063['error'][_0x85d5('0x12')]);}logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);return _0x499b36(_0xde1063[_0x85d5('0x10')][_0x85d5('0x12')]);}else{logger[_0x85d5('0xc')](_0x85d5('0xd'),_0x258f0c,_0x85d5('0xe'));_0x499b36(_0xde1063[_0x85d5('0x13')][_0x85d5('0x12')]);}})[_0x85d5('0x14')](function(_0x3df634){logger[_0x85d5('0x10')](_0x85d5('0xd'),_0x258f0c,_0x3df634);_0x4e147a(_0x3df634);});});} \ No newline at end of file +var _0xdbf5=['request\x20sent','stringify','error','message','info','result','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./userProfile.socket','register','then','UserProfile,\x20%s,\x20%s','debug','UserProfile,\x20%s,\x20%s,\x20%s'];(function(_0x5d0253,_0x5d744b){var _0x5b6090=function(_0x100b5d){while(--_0x100b5d){_0x5d0253['push'](_0x5d0253['shift']());}};_0x5b6090(++_0x5d744b);}(_0xdbf5,0x18c));var _0x5dbf=function(_0x298f77,_0x5b738f){_0x298f77=_0x298f77-0x0;var _0x32b2c1=_0xdbf5[_0x298f77];return _0x32b2c1;};'use strict';var _=require('lodash');var util=require(_0x5dbf('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x5dbf('0x1'));var fs=require('fs');var Redis=require(_0x5dbf('0x2'));var db=require(_0x5dbf('0x3'))['db'];var utils=require(_0x5dbf('0x4'));var logger=require(_0x5dbf('0x5'))(_0x5dbf('0x6'));var config=require(_0x5dbf('0x7'));var jayson=require(_0x5dbf('0x8'));var client=jayson[_0x5dbf('0x9')][_0x5dbf('0xa')]({'port':0x232a});config[_0x5dbf('0xb')]=_[_0x5dbf('0xc')](config[_0x5dbf('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x5dbf('0xd'))(new Redis(config['redis']));require(_0x5dbf('0xe'))[_0x5dbf('0xf')](socket);function respondWithRpcPromise(_0x264007,_0x1813bb,_0x4efed3){return new BPromise(function(_0xe3ddb7,_0x521a31){return client['request'](_0x264007,_0x4efed3)[_0x5dbf('0x10')](function(_0x5dbc97){logger['info'](_0x5dbf('0x11'),_0x1813bb,'request\x20sent');logger[_0x5dbf('0x12')](_0x5dbf('0x13'),_0x1813bb,_0x5dbf('0x14'),JSON[_0x5dbf('0x15')](_0x5dbc97));if(_0x5dbc97[_0x5dbf('0x16')]){if(_0x5dbc97['error']['code']===0x1f4){logger[_0x5dbf('0x16')](_0x5dbf('0x11'),_0x1813bb,_0x5dbc97['error'][_0x5dbf('0x17')]);return _0x521a31(_0x5dbc97[_0x5dbf('0x16')][_0x5dbf('0x17')]);}logger[_0x5dbf('0x16')](_0x5dbf('0x11'),_0x1813bb,_0x5dbc97[_0x5dbf('0x16')][_0x5dbf('0x17')]);return _0xe3ddb7(_0x5dbc97['error']['message']);}else{logger[_0x5dbf('0x18')](_0x5dbf('0x11'),_0x1813bb,_0x5dbf('0x14'));_0xe3ddb7(_0x5dbc97[_0x5dbf('0x19')][_0x5dbf('0x17')]);}})['catch'](function(_0x11cd00){logger['error']('UserProfile,\x20%s,\x20%s',_0x1813bb,_0x11cd00);_0x521a31(_0x11cd00);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index cfdd421..c7b62e7 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 _0x2060=['removeListener','register','length','userProfile:','./userProfile.events','save','remove','emit'];(function(_0x58581e,_0x3a3aef){var _0x1a0645=function(_0x3d09fc){while(--_0x3d09fc){_0x58581e['push'](_0x58581e['shift']());}};_0x1a0645(++_0x3a3aef);}(_0x2060,0xe4));var _0x0206=function(_0x3d82d5,_0x11c47b){_0x3d82d5=_0x3d82d5-0x0;var _0x4d3501=_0x2060[_0x3d82d5];return _0x4d3501;};'use strict';var UserProfileEvents=require(_0x0206('0x0'));var events=[_0x0206('0x1'),_0x0206('0x2'),'update'];function createListener(_0xd5e192,_0x2f5dad){return function(_0x5cdadc){_0x2f5dad[_0x0206('0x3')](_0xd5e192,_0x5cdadc);};}function removeListener(_0x2eef75,_0x3422a1){return function(){UserProfileEvents[_0x0206('0x4')](_0x2eef75,_0x3422a1);};}exports[_0x0206('0x5')]=function(_0x5400f4){for(var _0x52f0fb=0x0,_0x45bbb5=events[_0x0206('0x6')];_0x52f0fb<_0x45bbb5;_0x52f0fb++){var _0x1d7d2e=events[_0x52f0fb];var _0x3ddef3=createListener(_0x0206('0x7')+_0x1d7d2e,_0x5400f4);UserProfileEvents['on'](_0x1d7d2e,_0x3ddef3);}}; \ No newline at end of file +var _0x5e7b=['length','userProfile:','./userProfile.events','remove','update','emit','removeListener','register'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x5e7b,0x17a));var _0xb5e7=function(_0x4d7a70,_0x2d3bfa){_0x4d7a70=_0x4d7a70-0x0;var _0x3aafbb=_0x5e7b[_0x4d7a70];return _0x3aafbb;};'use strict';var UserProfileEvents=require(_0xb5e7('0x0'));var events=['save',_0xb5e7('0x1'),_0xb5e7('0x2')];function createListener(_0x5753c4,_0xd8eba2){return function(_0x356f0a){_0xd8eba2[_0xb5e7('0x3')](_0x5753c4,_0x356f0a);};}function removeListener(_0x206edc,_0x36b698){return function(){UserProfileEvents[_0xb5e7('0x4')](_0x206edc,_0x36b698);};}exports[_0xb5e7('0x5')]=function(_0xffad02){for(var _0x207764=0x0,_0x183ed0=events[_0xb5e7('0x6')];_0x207764<_0x183ed0;_0x207764++){var _0x112323=events[_0x207764];var _0x2c955d=createListener(_0xb5e7('0x7')+_0x112323,_0xffad02);UserProfileEvents['on'](_0x112323,_0x2c955d);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 22486d8..d29cfcc 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 _0xd3be=['describe','/:id','isAuthenticated','show','post','create','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./userProfileResource.controller','get'];(function(_0x3face5,_0x26687b){var _0xf47e11=function(_0x25847a){while(--_0x25847a){_0x3face5['push'](_0x3face5['shift']());}};_0xf47e11(++_0x26687b);}(_0xd3be,0x195));var _0xed3b=function(_0x595775,_0x1d5665){_0x595775=_0x595775-0x0;var _0x5ad30f=_0xd3be[_0x595775];return _0x5ad30f;};'use strict';var multer=require('multer');var util=require(_0xed3b('0x0'));var path=require(_0xed3b('0x1'));var timeout=require(_0xed3b('0x2'));var express=require(_0xed3b('0x3'));var router=express[_0xed3b('0x4')]();var auth=require(_0xed3b('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xed3b('0x6'));var controller=require(_0xed3b('0x7'));router[_0xed3b('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0xed3b('0x9')]);router[_0xed3b('0x8')](_0xed3b('0xa'),auth[_0xed3b('0xb')](),controller[_0xed3b('0xc')]);router[_0xed3b('0xd')]('/',auth[_0xed3b('0xb')](),controller[_0xed3b('0xe')]);router['put'](_0xed3b('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xed3b('0xf')](_0xed3b('0xa'),auth[_0xed3b('0xb')](),controller[_0xed3b('0x10')]);module[_0xed3b('0x11')]=router; \ No newline at end of file +var _0x6dcb=['util','path','connect-timeout','express','Router','../../components/auth/service','./userProfileResource.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','put','delete','multer'];(function(_0xbb4e02,_0x1cac95){var _0x50ac16=function(_0xa64de2){while(--_0xa64de2){_0xbb4e02['push'](_0xbb4e02['shift']());}};_0x50ac16(++_0x1cac95);}(_0x6dcb,0x6b));var _0xb6dc=function(_0x14355a,_0x287a47){_0x14355a=_0x14355a-0x0;var _0x4abf22=_0x6dcb[_0x14355a];return _0x4abf22;};'use strict';var multer=require(_0xb6dc('0x0'));var util=require(_0xb6dc('0x1'));var path=require(_0xb6dc('0x2'));var timeout=require(_0xb6dc('0x3'));var express=require(_0xb6dc('0x4'));var router=express[_0xb6dc('0x5')]();var auth=require(_0xb6dc('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb6dc('0x7'));router['get']('/',auth[_0xb6dc('0x8')](),controller[_0xb6dc('0x9')]);router[_0xb6dc('0xa')](_0xb6dc('0xb'),auth[_0xb6dc('0x8')](),controller[_0xb6dc('0xc')]);router[_0xb6dc('0xa')](_0xb6dc('0xd'),auth['isAuthenticated'](),controller[_0xb6dc('0xe')]);router[_0xb6dc('0xf')]('/',auth[_0xb6dc('0x8')](),controller['create']);router[_0xb6dc('0x10')](_0xb6dc('0xd'),auth[_0xb6dc('0x8')](),controller['update']);router[_0xb6dc('0x11')]('/:id',auth[_0xb6dc('0x8')](),controller['destroy']);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 68ecb5a..74bc002 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 _0x3e16=['sequelize','INTEGER','STRING'];(function(_0x44e827,_0x145ed8){var _0xa19d97=function(_0x3a1176){while(--_0x3a1176){_0x44e827['push'](_0x44e827['shift']());}};_0xa19d97(++_0x145ed8);}(_0x3e16,0xf3));var _0x63e1=function(_0x186278,_0x592e41){_0x186278=_0x186278-0x0;var _0x256ce0=_0x3e16[_0x186278];return _0x256ce0;};'use strict';var Sequelize=require(_0x63e1('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize[_0x63e1('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x63e1('0x2')],'allowNull':![]}}; \ No newline at end of file +var _0x3024=['exports','STRING','INTEGER'];(function(_0x45b034,_0x3a57dd){var _0x509cb0=function(_0x3a89d5){while(--_0x3a89d5){_0x45b034['push'](_0x45b034['shift']());}};_0x509cb0(++_0x3a57dd);}(_0x3024,0xd8));var _0x4302=function(_0x239279,_0x39fb8d){_0x239279=_0x239279-0x0;var _0x238839=_0x3024[_0x239279];return _0x238839;};'use strict';var Sequelize=require('sequelize');module[_0x4302('0x0')]={'name':{'type':Sequelize[_0x4302('0x1')],'allowNull':![]},'resourceId':{'type':Sequelize[_0x4302('0x2')],'allowNull':![]},'type':{'type':Sequelize['STRING'],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 6795cde..e24bc90 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 _0xa7fc=['UserProfileResource','rawAttributes','type','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','keys','includeAll','find','create','body','update','describe','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','save','then','destroy','error','stack','name','send','index','map'];(function(_0x5b028f,_0x41d4fe){var _0x3d758d=function(_0x1ddcdc){while(--_0x1ddcdc){_0x5b028f['push'](_0x5b028f['shift']());}};_0x3d758d(++_0x41d4fe);}(_0xa7fc,0x192));var _0xca7f=function(_0x10c16d,_0x2b3e14){_0x10c16d=_0x10c16d-0x0;var _0x5896f4=_0xa7fc[_0x10c16d];return _0x5896f4;};'use strict';var pdf=require(_0xca7f('0x0'));var emlformat=require(_0xca7f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xca7f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xca7f('0x3'));var moment=require(_0xca7f('0x4'));var BPromise=require(_0xca7f('0x5'));var Mustache=require('mustache');var util=require(_0xca7f('0x6'));var path=require('path');var sox=require(_0xca7f('0x7'));var csv=require(_0xca7f('0x8'));var ejs=require(_0xca7f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xca7f('0xa'));var crypto=require(_0xca7f('0xb'));var jsforce=require(_0xca7f('0xc'));var deskjs=require(_0xca7f('0xd'));var toCsv=require(_0xca7f('0x8'));var querystring=require(_0xca7f('0xe'));var Papa=require(_0xca7f('0xf'));var Redis=require(_0xca7f('0x10'));var authService=require(_0xca7f('0x11'));var qs=require(_0xca7f('0x12'));var as=require(_0xca7f('0x13'));var hardwareService=require(_0xca7f('0x14'));var logger=require(_0xca7f('0x15'))('api');var utils=require(_0xca7f('0x16'));var config=require(_0xca7f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaafcbe,_0xe54975){_0xe54975=_0xe54975||0xcc;return function(_0xc596e2){if(_0xc596e2){return _0xaafcbe[_0xca7f('0x18')](_0xe54975);}return _0xaafcbe[_0xca7f('0x19')](_0xe54975)[_0xca7f('0x1a')]();};}function respondWithResult(_0x5cebe8,_0x1b2692){_0x1b2692=_0x1b2692||0xc8;return function(_0x3e9021){if(_0x3e9021){return _0x5cebe8[_0xca7f('0x19')](_0x1b2692)[_0xca7f('0x1b')](_0x3e9021);}};}function respondWithFilteredResult(_0x581c0c,_0x2c5f5d){return function(_0x408f18){if(_0x408f18){var _0x468b08=_0x408f18[_0xca7f('0x1c')],_0x1f2534=_0x2c5f5d['offset'],_0x279965=_0x2c5f5d[_0xca7f('0x1d')]+_0x2c5f5d[_0xca7f('0x1e')],_0x4cdfd5;if(_0x279965>=_0x468b08){_0x279965=_0x468b08;_0x4cdfd5=0xc8;}else{_0x4cdfd5=0xce;}_0x581c0c[_0xca7f('0x19')](_0x4cdfd5);return _0x581c0c['set'](_0xca7f('0x1f'),_0x1f2534+'-'+_0x279965+'/'+_0x468b08)['json'](_0x408f18);}return null;};}function patchUpdates(_0x744e31){return function(_0x461788){try{jsonpatch[_0xca7f('0x20')](_0x461788,_0x744e31,!![]);}catch(_0x3a0b5c){return BPromise['reject'](_0x3a0b5c);}return _0x461788[_0xca7f('0x21')]();};}function saveUpdates(_0x57fcfc,_0x745c55){return function(_0x595278){if(_0x595278){return _0x595278['update'](_0x57fcfc)[_0xca7f('0x22')](function(_0x3906ab){return _0x3906ab;});}return null;};}function removeEntity(_0x27ced5,_0x2055d8){return function(_0x4eeadb){if(_0x4eeadb){return _0x4eeadb[_0xca7f('0x23')]()[_0xca7f('0x22')](function(){_0x27ced5[_0xca7f('0x19')](0xcc)[_0xca7f('0x1a')]();});}};}function handleEntityNotFound(_0x21a484,_0x203dbd){return function(_0x400827){if(!_0x400827){_0x21a484[_0xca7f('0x18')](0x194);}return _0x400827;};}function handleError(_0x25adc1,_0x50b8b8){_0x50b8b8=_0x50b8b8||0x1f4;return function(_0x188034){logger[_0xca7f('0x24')](_0x188034[_0xca7f('0x25')]);if(_0x188034[_0xca7f('0x26')]){delete _0x188034[_0xca7f('0x26')];}_0x25adc1[_0xca7f('0x19')](_0x50b8b8)[_0xca7f('0x27')](_0x188034);};}exports[_0xca7f('0x28')]=function(_0x4e0edf,_0x559b2d){var _0x17e973={},_0x19776c={},_0x7b3a6f={'count':0x0,'rows':[]};var _0x40767f=_[_0xca7f('0x29')](db[_0xca7f('0x2a')][_0xca7f('0x2b')],function(_0x51bcc8){return{'name':_0x51bcc8['fieldName'],'type':_0x51bcc8[_0xca7f('0x2c')][_0xca7f('0x2d')]};});_0x19776c['model']=_[_0xca7f('0x29')](_0x40767f,'name');_0x19776c['query']=_['keys'](_0x4e0edf[_0xca7f('0x2e')]);_0x19776c[_0xca7f('0x2f')]=_[_0xca7f('0x30')](_0x19776c['model'],_0x19776c[_0xca7f('0x2e')]);_0x17e973[_0xca7f('0x31')]=_[_0xca7f('0x30')](_0x19776c[_0xca7f('0x32')],qs[_0xca7f('0x33')](_0x4e0edf[_0xca7f('0x2e')][_0xca7f('0x33')]));_0x17e973[_0xca7f('0x31')]=_0x17e973[_0xca7f('0x31')][_0xca7f('0x34')]?_0x17e973[_0xca7f('0x31')]:_0x19776c['model'];if(!_0x4e0edf[_0xca7f('0x2e')]['hasOwnProperty'](_0xca7f('0x35'))){_0x17e973['limit']=qs[_0xca7f('0x1e')](_0x4e0edf[_0xca7f('0x2e')][_0xca7f('0x1e')]);_0x17e973[_0xca7f('0x1d')]=qs['offset'](_0x4e0edf['query']['offset']);}_0x17e973[_0xca7f('0x36')]=qs[_0xca7f('0x37')](_0x4e0edf[_0xca7f('0x2e')][_0xca7f('0x37')]);_0x17e973[_0xca7f('0x38')]=qs['filters'](_[_0xca7f('0x39')](_0x4e0edf[_0xca7f('0x2e')],_0x19776c[_0xca7f('0x2f')]));if(_0x4e0edf['query'][_0xca7f('0x3a')]){_0x17e973[_0xca7f('0x38')]=_['merge'](_0x17e973[_0xca7f('0x38')],{'$or':_[_0xca7f('0x29')](_0x40767f,function(_0x5b1ffc){if(_0x5b1ffc[_0xca7f('0x2c')]!==_0xca7f('0x3b')){var _0x50e175={};_0x50e175[_0x5b1ffc[_0xca7f('0x26')]]={'$like':'%'+_0x4e0edf[_0xca7f('0x2e')][_0xca7f('0x3a')]+'%'};return _0x50e175;}})});}_0x17e973=_[_0xca7f('0x3c')]({},_0x17e973,_0x4e0edf[_0xca7f('0x3d')]);var _0x6a1281={'where':_0x17e973[_0xca7f('0x38')]};return db[_0xca7f('0x2a')]['count'](_0x6a1281)[_0xca7f('0x22')](function(_0x2d3ced){_0x7b3a6f[_0xca7f('0x1c')]=_0x2d3ced;if(_0x4e0edf[_0xca7f('0x2e')]['includeAll']){_0x17e973['include']=[{'all':!![]}];}return db[_0xca7f('0x2a')][_0xca7f('0x3e')](_0x17e973);})['then'](function(_0x27aa0c){_0x7b3a6f[_0xca7f('0x3f')]=_0x27aa0c;return _0x7b3a6f;})[_0xca7f('0x22')](respondWithFilteredResult(_0x559b2d,_0x17e973))[_0xca7f('0x40')](handleError(_0x559b2d,null));};exports[_0xca7f('0x41')]=function(_0x18521d,_0xa1c740){var _0x12da44={'raw':![],'where':{'id':_0x18521d[_0xca7f('0x42')]['id']}},_0x4434c9={};_0x4434c9[_0xca7f('0x32')]=_[_0xca7f('0x43')](db['UserProfileResource'][_0xca7f('0x2b')]);_0x4434c9[_0xca7f('0x2e')]=_[_0xca7f('0x43')](_0x18521d[_0xca7f('0x2e')]);_0x4434c9[_0xca7f('0x2f')]=_[_0xca7f('0x30')](_0x4434c9[_0xca7f('0x32')],_0x4434c9[_0xca7f('0x2e')]);_0x12da44[_0xca7f('0x31')]=_[_0xca7f('0x30')](_0x4434c9[_0xca7f('0x32')],qs[_0xca7f('0x33')](_0x18521d['query']['fields']));_0x12da44['attributes']=_0x12da44[_0xca7f('0x31')][_0xca7f('0x34')]?_0x12da44[_0xca7f('0x31')]:_0x4434c9[_0xca7f('0x32')];if(_0x18521d[_0xca7f('0x2e')][_0xca7f('0x44')]){_0x12da44['include']=[{'all':!![]}];}_0x12da44=_[_0xca7f('0x3c')]({},_0x12da44,_0x18521d[_0xca7f('0x3d')]);return db[_0xca7f('0x2a')][_0xca7f('0x45')](_0x12da44)['then'](handleEntityNotFound(_0xa1c740,null))[_0xca7f('0x22')](respondWithResult(_0xa1c740,null))[_0xca7f('0x40')](handleError(_0xa1c740,null));};exports[_0xca7f('0x46')]=function(_0x2b13f6,_0x1231f0){return db['UserProfileResource']['create'](_0x2b13f6[_0xca7f('0x47')],{})[_0xca7f('0x22')](respondWithResult(_0x1231f0,0xc9))[_0xca7f('0x40')](handleError(_0x1231f0,null));};exports[_0xca7f('0x48')]=function(_0x3071f4,_0x22d1ac){if(_0x3071f4['body']['id']){delete _0x3071f4[_0xca7f('0x47')]['id'];}return db[_0xca7f('0x2a')]['find']({'where':{'id':_0x3071f4[_0xca7f('0x42')]['id']}})['then'](handleEntityNotFound(_0x22d1ac,null))[_0xca7f('0x22')](saveUpdates(_0x3071f4[_0xca7f('0x47')],null))[_0xca7f('0x22')](respondWithResult(_0x22d1ac,null))[_0xca7f('0x40')](handleError(_0x22d1ac,null));};exports[_0xca7f('0x23')]=function(_0x543329,_0x18e3e7){return db[_0xca7f('0x2a')][_0xca7f('0x45')]({'where':{'id':_0x543329['params']['id']}})[_0xca7f('0x22')](handleEntityNotFound(_0x18e3e7,null))[_0xca7f('0x22')](removeEntity(_0x18e3e7,null))[_0xca7f('0x40')](handleError(_0x18e3e7,null));};exports[_0xca7f('0x49')]=function(_0x3cf0ad,_0x634fb){return db[_0xca7f('0x2a')][_0xca7f('0x49')]()[_0xca7f('0x22')](respondWithResult(_0x634fb,null))[_0xca7f('0x40')](handleError(_0x634fb,null));}; \ No newline at end of file +var _0x8f4f=['fieldName','type','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','limit','sort','pick','filter','where','VIRTUAL','merge','options','count','rows','catch','params','length','includeAll','include','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','offset','json','apply','reject','save','update','destroy','then','sendStatus','error','stack','name','map','UserProfileResource','rawAttributes'];(function(_0x529e96,_0x40f9b8){var _0x324662=function(_0x4ba513){while(--_0x4ba513){_0x529e96['push'](_0x529e96['shift']());}};_0x324662(++_0x40f9b8);}(_0x8f4f,0xf2));var _0xf8f4=function(_0x4d0093,_0x2d0237){_0x4d0093=_0x4d0093-0x0;var _0x325710=_0x8f4f[_0x4d0093];return _0x325710;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf8f4('0x0'));var rimraf=require(_0xf8f4('0x1'));var zipdir=require(_0xf8f4('0x2'));var jsonpatch=require(_0xf8f4('0x3'));var rp=require('request-promise');var moment=require(_0xf8f4('0x4'));var BPromise=require(_0xf8f4('0x5'));var Mustache=require(_0xf8f4('0x6'));var util=require(_0xf8f4('0x7'));var path=require(_0xf8f4('0x8'));var sox=require(_0xf8f4('0x9'));var csv=require(_0xf8f4('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf8f4('0xb'));var squel=require('squel');var crypto=require(_0xf8f4('0xc'));var jsforce=require(_0xf8f4('0xd'));var deskjs=require(_0xf8f4('0xe'));var toCsv=require(_0xf8f4('0xa'));var querystring=require('querystring');var Papa=require(_0xf8f4('0xf'));var Redis=require(_0xf8f4('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf8f4('0x11'));var as=require(_0xf8f4('0x12'));var hardwareService=require(_0xf8f4('0x13'));var logger=require(_0xf8f4('0x14'))(_0xf8f4('0x15'));var utils=require(_0xf8f4('0x16'));var config=require(_0xf8f4('0x17'));var db=require(_0xf8f4('0x18'))['db'];function respondWithStatusCode(_0x50c6f4,_0x5e8fc5){_0x5e8fc5=_0x5e8fc5||0xcc;return function(_0x410d44){if(_0x410d44){return _0x50c6f4['sendStatus'](_0x5e8fc5);}return _0x50c6f4[_0xf8f4('0x19')](_0x5e8fc5)[_0xf8f4('0x1a')]();};}function respondWithResult(_0x163c29,_0x457edc){_0x457edc=_0x457edc||0xc8;return function(_0xab73b6){if(_0xab73b6){return _0x163c29[_0xf8f4('0x19')](_0x457edc)['json'](_0xab73b6);}};}function respondWithFilteredResult(_0x18092c,_0x4feb4e){return function(_0x54dc64){if(_0x54dc64){var _0x1f2f3f=_0x54dc64['count'],_0x5df906=_0x4feb4e[_0xf8f4('0x1b')],_0x3a12f0=_0x4feb4e['offset']+_0x4feb4e['limit'],_0x17af3f;if(_0x3a12f0>=_0x1f2f3f){_0x3a12f0=_0x1f2f3f;_0x17af3f=0xc8;}else{_0x17af3f=0xce;}_0x18092c[_0xf8f4('0x19')](_0x17af3f);return _0x18092c['set']('Content-Range',_0x5df906+'-'+_0x3a12f0+'/'+_0x1f2f3f)[_0xf8f4('0x1c')](_0x54dc64);}return null;};}function patchUpdates(_0x386342){return function(_0xcfd80e){try{jsonpatch[_0xf8f4('0x1d')](_0xcfd80e,_0x386342,!![]);}catch(_0x364800){return BPromise[_0xf8f4('0x1e')](_0x364800);}return _0xcfd80e[_0xf8f4('0x1f')]();};}function saveUpdates(_0x4b76f6,_0x472910){return function(_0x11c541){if(_0x11c541){return _0x11c541[_0xf8f4('0x20')](_0x4b76f6)['then'](function(_0x57b4b5){return _0x57b4b5;});}return null;};}function removeEntity(_0x396f75,_0x991b82){return function(_0x118c61){if(_0x118c61){return _0x118c61[_0xf8f4('0x21')]()[_0xf8f4('0x22')](function(){_0x396f75[_0xf8f4('0x19')](0xcc)[_0xf8f4('0x1a')]();});}};}function handleEntityNotFound(_0x1238fa,_0x545322){return function(_0x1ef30e){if(!_0x1ef30e){_0x1238fa[_0xf8f4('0x23')](0x194);}return _0x1ef30e;};}function handleError(_0x4a5a52,_0x29c557){_0x29c557=_0x29c557||0x1f4;return function(_0x5441d3){logger[_0xf8f4('0x24')](_0x5441d3[_0xf8f4('0x25')]);if(_0x5441d3[_0xf8f4('0x26')]){delete _0x5441d3[_0xf8f4('0x26')];}_0x4a5a52[_0xf8f4('0x19')](_0x29c557)['send'](_0x5441d3);};}exports['index']=function(_0x2239f8,_0x1ed068){var _0x3f1ef6={},_0x1d76e0={},_0x272a5f={'count':0x0,'rows':[]};var _0x38a86a=_[_0xf8f4('0x27')](db[_0xf8f4('0x28')][_0xf8f4('0x29')],function(_0x1c2e82){return{'name':_0x1c2e82[_0xf8f4('0x2a')],'type':_0x1c2e82[_0xf8f4('0x2b')]['key']};});_0x1d76e0[_0xf8f4('0x2c')]=_[_0xf8f4('0x27')](_0x38a86a,_0xf8f4('0x26'));_0x1d76e0[_0xf8f4('0x2d')]=_[_0xf8f4('0x2e')](_0x2239f8[_0xf8f4('0x2d')]);_0x1d76e0[_0xf8f4('0x2f')]=_[_0xf8f4('0x30')](_0x1d76e0[_0xf8f4('0x2c')],_0x1d76e0[_0xf8f4('0x2d')]);_0x3f1ef6[_0xf8f4('0x31')]=_[_0xf8f4('0x30')](_0x1d76e0[_0xf8f4('0x2c')],qs['fields'](_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x32')]));_0x3f1ef6[_0xf8f4('0x31')]=_0x3f1ef6[_0xf8f4('0x31')]['length']?_0x3f1ef6[_0xf8f4('0x31')]:_0x1d76e0['model'];if(!_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x33')]('nolimit')){_0x3f1ef6['limit']=qs[_0xf8f4('0x34')](_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x34')]);_0x3f1ef6[_0xf8f4('0x1b')]=qs['offset'](_0x2239f8['query'][_0xf8f4('0x1b')]);}_0x3f1ef6['order']=qs['sort'](_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x35')]);_0x3f1ef6['where']=qs['filters'](_[_0xf8f4('0x36')](_0x2239f8['query'],_0x1d76e0[_0xf8f4('0x2f')]));if(_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x37')]){_0x3f1ef6[_0xf8f4('0x38')]=_['merge'](_0x3f1ef6[_0xf8f4('0x38')],{'$or':_[_0xf8f4('0x27')](_0x38a86a,function(_0x51e94e){if(_0x51e94e[_0xf8f4('0x2b')]!==_0xf8f4('0x39')){var _0x5c9693={};_0x5c9693[_0x51e94e['name']]={'$like':'%'+_0x2239f8[_0xf8f4('0x2d')][_0xf8f4('0x37')]+'%'};return _0x5c9693;}})});}_0x3f1ef6=_[_0xf8f4('0x3a')]({},_0x3f1ef6,_0x2239f8[_0xf8f4('0x3b')]);var _0x28a86c={'where':_0x3f1ef6[_0xf8f4('0x38')]};return db[_0xf8f4('0x28')]['count'](_0x28a86c)[_0xf8f4('0x22')](function(_0x2fe6a7){_0x272a5f[_0xf8f4('0x3c')]=_0x2fe6a7;if(_0x2239f8[_0xf8f4('0x2d')]['includeAll']){_0x3f1ef6['include']=[{'all':!![]}];}return db['UserProfileResource']['findAll'](_0x3f1ef6);})[_0xf8f4('0x22')](function(_0x3448c8){_0x272a5f[_0xf8f4('0x3d')]=_0x3448c8;return _0x272a5f;})[_0xf8f4('0x22')](respondWithFilteredResult(_0x1ed068,_0x3f1ef6))[_0xf8f4('0x3e')](handleError(_0x1ed068,null));};exports['show']=function(_0x3f61bd,_0x26d52d){var _0x5c2903={'raw':![],'where':{'id':_0x3f61bd[_0xf8f4('0x3f')]['id']}},_0x3d9796={};_0x3d9796['model']=_[_0xf8f4('0x2e')](db['UserProfileResource']['rawAttributes']);_0x3d9796['query']=_[_0xf8f4('0x2e')](_0x3f61bd[_0xf8f4('0x2d')]);_0x3d9796['filters']=_[_0xf8f4('0x30')](_0x3d9796['model'],_0x3d9796[_0xf8f4('0x2d')]);_0x5c2903[_0xf8f4('0x31')]=_[_0xf8f4('0x30')](_0x3d9796[_0xf8f4('0x2c')],qs[_0xf8f4('0x32')](_0x3f61bd[_0xf8f4('0x2d')][_0xf8f4('0x32')]));_0x5c2903['attributes']=_0x5c2903[_0xf8f4('0x31')][_0xf8f4('0x40')]?_0x5c2903['attributes']:_0x3d9796['model'];if(_0x3f61bd[_0xf8f4('0x2d')][_0xf8f4('0x41')]){_0x5c2903[_0xf8f4('0x42')]=[{'all':!![]}];}_0x5c2903=_[_0xf8f4('0x3a')]({},_0x5c2903,_0x3f61bd[_0xf8f4('0x3b')]);return db[_0xf8f4('0x28')][_0xf8f4('0x43')](_0x5c2903)[_0xf8f4('0x22')](handleEntityNotFound(_0x26d52d,null))['then'](respondWithResult(_0x26d52d,null))[_0xf8f4('0x3e')](handleError(_0x26d52d,null));};exports[_0xf8f4('0x44')]=function(_0x48c84e,_0x7a8e81){return db[_0xf8f4('0x28')][_0xf8f4('0x44')](_0x48c84e[_0xf8f4('0x45')],{})[_0xf8f4('0x22')](respondWithResult(_0x7a8e81,0xc9))[_0xf8f4('0x3e')](handleError(_0x7a8e81,null));};exports[_0xf8f4('0x20')]=function(_0x4b6904,_0x4bceb2){if(_0x4b6904[_0xf8f4('0x45')]['id']){delete _0x4b6904[_0xf8f4('0x45')]['id'];}return db['UserProfileResource'][_0xf8f4('0x43')]({'where':{'id':_0x4b6904[_0xf8f4('0x3f')]['id']}})[_0xf8f4('0x22')](handleEntityNotFound(_0x4bceb2,null))[_0xf8f4('0x22')](saveUpdates(_0x4b6904['body'],null))['then'](respondWithResult(_0x4bceb2,null))[_0xf8f4('0x3e')](handleError(_0x4bceb2,null));};exports['destroy']=function(_0x591559,_0x1ff164){return db['UserProfileResource'][_0xf8f4('0x43')]({'where':{'id':_0x591559['params']['id']}})[_0xf8f4('0x22')](handleEntityNotFound(_0x1ff164,null))[_0xf8f4('0x22')](removeEntity(_0x1ff164,null))[_0xf8f4('0x3e')](handleError(_0x1ff164,null));};exports[_0xf8f4('0x46')]=function(_0x41950b,_0x4d4b92){return db[_0xf8f4('0x28')]['describe']()[_0xf8f4('0x22')](respondWithResult(_0x4d4b92,null))['catch'](handleError(_0x4d4b92,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 9be0a34..f3d18c3 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 _0xa9c0=['request-promise','path','rimraf','../../config/environment','./userProfileResource.attributes','exports','define','compositeIndex','resourceId','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4e11d5,_0x1ce514){var _0x5e4e4c=function(_0xbee63d){while(--_0xbee63d){_0x4e11d5['push'](_0x4e11d5['shift']());}};_0x5e4e4c(++_0x1ce514);}(_0xa9c0,0xa3));var _0x0a9c=function(_0x566b14,_0x38cc5b){_0x566b14=_0x566b14-0x0;var _0x505697=_0xa9c0[_0x566b14];return _0x505697;};'use strict';var _=require(_0x0a9c('0x0'));var util=require('util');var logger=require(_0x0a9c('0x1'))(_0x0a9c('0x2'));var moment=require(_0x0a9c('0x3'));var BPromise=require(_0x0a9c('0x4'));var rp=require(_0x0a9c('0x5'));var fs=require('fs');var path=require(_0x0a9c('0x6'));var rimraf=require(_0x0a9c('0x7'));var config=require(_0x0a9c('0x8'));var attributes=require(_0x0a9c('0x9'));module[_0x0a9c('0xa')]=function(_0x476cc6,_0x2fc7ad){return _0x476cc6[_0x0a9c('0xb')]('UserProfileResource',attributes,{'tableName':'user_profile_has_resources','paranoid':![],'indexes':[{'name':_0x0a9c('0xc'),'fields':[_0x0a9c('0xd'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0x8f22=['UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','sectionId','../../config/logger','api','moment','rimraf','../../config/environment','./userProfileResource.attributes','exports','define'];(function(_0x5e0571,_0xd78607){var _0x43425b=function(_0x529b2e){while(--_0x529b2e){_0x5e0571['push'](_0x5e0571['shift']());}};_0x43425b(++_0xd78607);}(_0x8f22,0xe2));var _0x28f2=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x8f22[_0x2641f9];return _0x585741;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x28f2('0x0'))(_0x28f2('0x1'));var moment=require(_0x28f2('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x28f2('0x3'));var config=require(_0x28f2('0x4'));var attributes=require(_0x28f2('0x5'));module[_0x28f2('0x6')]=function(_0x4f75e9,_0x48e90f){return _0x4f75e9[_0x28f2('0x7')](_0x28f2('0x8'),attributes,{'tableName':_0x28f2('0x9'),'paranoid':![],'indexes':[{'name':_0x28f2('0xa'),'fields':[_0x28f2('0xb'),_0x28f2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index 7181cfe..6fce73c 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 _0x3378=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','debug','request\x20sent','code','error','UserProfileResource,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../config/logger'];(function(_0x190c49,_0x103457){var _0x475b9a=function(_0x44f13c){while(--_0x44f13c){_0x190c49['push'](_0x190c49['shift']());}};_0x475b9a(++_0x103457);}(_0x3378,0x1b4));var _0x8337=function(_0x2f32c4,_0x2597ba){_0x2f32c4=_0x2f32c4-0x0;var _0x95b5dc=_0x3378[_0x2f32c4];return _0x95b5dc;};'use strict';var _=require('lodash');var util=require(_0x8337('0x0'));var moment=require(_0x8337('0x1'));var BPromise=require('bluebird');var rs=require(_0x8337('0x2'));var fs=require('fs');var Redis=require(_0x8337('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x8337('0x4'))(_0x8337('0x5'));var config=require(_0x8337('0x6'));var jayson=require(_0x8337('0x7'));var client=jayson[_0x8337('0x8')][_0x8337('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16117a,_0x3f2568,_0x4942ae){return new BPromise(function(_0x4a7e62,_0x2c222f){return client[_0x8337('0xa')](_0x16117a,_0x4942ae)[_0x8337('0xb')](function(_0x102873){logger[_0x8337('0xc')]('UserProfileResource,\x20%s,\x20%s',_0x3f2568,'request\x20sent');logger[_0x8337('0xd')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x3f2568,_0x8337('0xe'),JSON['stringify'](_0x102873));if(_0x102873['error']){if(_0x102873['error'][_0x8337('0xf')]===0x1f4){logger[_0x8337('0x10')](_0x8337('0x11'),_0x3f2568,_0x102873[_0x8337('0x10')][_0x8337('0x12')]);return _0x2c222f(_0x102873[_0x8337('0x10')][_0x8337('0x12')]);}logger['error'](_0x8337('0x11'),_0x3f2568,_0x102873['error'][_0x8337('0x12')]);return _0x4a7e62(_0x102873[_0x8337('0x10')]['message']);}else{logger['info'](_0x8337('0x11'),_0x3f2568,_0x8337('0xe'));_0x4a7e62(_0x102873[_0x8337('0x13')][_0x8337('0x12')]);}})[_0x8337('0x14')](function(_0x2c1833){logger[_0x8337('0x10')](_0x8337('0x11'),_0x3f2568,_0x2c1833);_0x2c222f(_0x2c1833);});});} \ No newline at end of file +var _0x926f=['info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','UserProfileResource,\x20%s,\x20%s','debug','request\x20sent','error','message'];(function(_0x923991,_0x481465){var _0x191cfc=function(_0x6412e1){while(--_0x6412e1){_0x923991['push'](_0x923991['shift']());}};_0x191cfc(++_0x481465);}(_0x926f,0x80));var _0xf926=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x926f[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xf926('0x0'));var util=require(_0xf926('0x1'));var moment=require(_0xf926('0x2'));var BPromise=require(_0xf926('0x3'));var rs=require(_0xf926('0x4'));var fs=require('fs');var Redis=require(_0xf926('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xf926('0x6'));var logger=require('../../config/logger')(_0xf926('0x7'));var config=require(_0xf926('0x8'));var jayson=require(_0xf926('0x9'));var client=jayson[_0xf926('0xa')][_0xf926('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x414af5,_0x17e3a9,_0x11c6c4){return new BPromise(function(_0x332bf6,_0x43cc28){return client[_0xf926('0xc')](_0x414af5,_0x11c6c4)[_0xf926('0xd')](function(_0x9c92a1){logger['info'](_0xf926('0xe'),_0x17e3a9,'request\x20sent');logger[_0xf926('0xf')]('UserProfileResource,\x20%s,\x20%s,\x20%s',_0x17e3a9,_0xf926('0x10'),JSON['stringify'](_0x9c92a1));if(_0x9c92a1['error']){if(_0x9c92a1[_0xf926('0x11')]['code']===0x1f4){logger[_0xf926('0x11')](_0xf926('0xe'),_0x17e3a9,_0x9c92a1[_0xf926('0x11')][_0xf926('0x12')]);return _0x43cc28(_0x9c92a1[_0xf926('0x11')]['message']);}logger[_0xf926('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x17e3a9,_0x9c92a1['error'][_0xf926('0x12')]);return _0x332bf6(_0x9c92a1[_0xf926('0x11')][_0xf926('0x12')]);}else{logger[_0xf926('0x13')](_0xf926('0xe'),_0x17e3a9,'request\x20sent');_0x332bf6(_0x9c92a1['result'][_0xf926('0x12')]);}})[_0xf926('0x14')](function(_0x4783cc){logger[_0xf926('0x11')]('UserProfileResource,\x20%s,\x20%s',_0x17e3a9,_0x4783cc);_0x43cc28(_0x4783cc);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index 112d35c..b8634c2 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 _0x51ba=['create','/:id','delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','show','post'];(function(_0x36f292,_0x4e679d){var _0x365c26=function(_0x1b5589){while(--_0x1b5589){_0x36f292['push'](_0x36f292['shift']());}};_0x365c26(++_0x4e679d);}(_0x51ba,0x169));var _0xa51b=function(_0x477010,_0x1ef0d4){_0x477010=_0x477010-0x0;var _0x5d26d9=_0x51ba[_0x477010];return _0x5d26d9;};'use strict';var multer=require('multer');var util=require(_0xa51b('0x0'));var path=require(_0xa51b('0x1'));var timeout=require(_0xa51b('0x2'));var express=require(_0xa51b('0x3'));var router=express[_0xa51b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa51b('0x5'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0xa51b('0x6')](),controller[_0xa51b('0x7')]);router[_0xa51b('0x8')](_0xa51b('0x9'),auth['isAuthenticated'](),controller[_0xa51b('0xa')]);router['get']('/:id',auth[_0xa51b('0x6')](),controller[_0xa51b('0xb')]);router[_0xa51b('0xc')]('/',auth[_0xa51b('0x6')](),controller[_0xa51b('0xd')]);router['put'](_0xa51b('0xe'),auth[_0xa51b('0x6')](),controller['update']);router[_0xa51b('0xf')](_0xa51b('0xe'),auth[_0xa51b('0x6')](),controller[_0xa51b('0x10')]);module['exports']=router; \ No newline at end of file +var _0xb0d9=['express','Router','../../components/interaction/service','isAuthenticated','index','get','/describe','describe','/:id','create','delete','destroy','multer','util','path','connect-timeout'];(function(_0x285680,_0x18ce0e){var _0x4140ae=function(_0x388bd2){while(--_0x388bd2){_0x285680['push'](_0x285680['shift']());}};_0x4140ae(++_0x18ce0e);}(_0xb0d9,0x10c));var _0x9b0d=function(_0x14c831,_0x4e07b5){_0x14c831=_0x14c831-0x0;var _0xe8c6d3=_0xb0d9[_0x14c831];return _0xe8c6d3;};'use strict';var multer=require(_0x9b0d('0x0'));var util=require(_0x9b0d('0x1'));var path=require(_0x9b0d('0x2'));var timeout=require(_0x9b0d('0x3'));var express=require(_0x9b0d('0x4'));var router=express[_0x9b0d('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9b0d('0x6'));var config=require('../../config/environment');var controller=require('./userProfileSection.controller');router['get']('/',auth[_0x9b0d('0x7')](),controller[_0x9b0d('0x8')]);router[_0x9b0d('0x9')](_0x9b0d('0xa'),auth[_0x9b0d('0x7')](),controller[_0x9b0d('0xb')]);router[_0x9b0d('0x9')](_0x9b0d('0xc'),auth[_0x9b0d('0x7')](),controller['show']);router['post']('/',auth[_0x9b0d('0x7')](),controller[_0x9b0d('0xd')]);router['put'](_0x9b0d('0xc'),auth[_0x9b0d('0x7')](),controller['update']);router[_0x9b0d('0xe')](_0x9b0d('0xc'),auth['isAuthenticated'](),controller[_0x9b0d('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index 11bf445..4294fb5 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 _0x4737=['getDataValue','sequelize','exports','STRING','INTEGER','BOOLEAN','crudPermissions','join'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x4737,0x141));var _0x7473=function(_0x14009f,_0x37385d){_0x14009f=_0x14009f-0x0;var _0xe8454=_0x4737[_0x14009f];return _0xe8454;};'use strict';var Sequelize=require(_0x7473('0x0'));module[_0x7473('0x1')]={'name':{'type':Sequelize[_0x7473('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0x7473('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize[_0x7473('0x3')],'allowNull':![]},'enabled':{'type':Sequelize[_0x7473('0x4')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x2d2141){this['setDataValue'](_0x7473('0x5'),_0x2d2141?_0x2d2141[_0x7473('0x6')](''):[]);},'get':function(){return this[_0x7473('0x7')]('crudPermissions')?this[_0x7473('0x7')](_0x7473('0x5'))['split'](''):[];}}}; \ No newline at end of file +var _0x1294=['crudPermissions','join','getDataValue','split','sequelize','STRING','INTEGER','BOOLEAN','setDataValue'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1294,0xb8));var _0x4129=function(_0x25ff14,_0x384501){_0x25ff14=_0x25ff14-0x0;var _0x1eef4d=_0x1294[_0x25ff14];return _0x1eef4d;};'use strict';var Sequelize=require(_0x4129('0x0'));module['exports']={'name':{'type':Sequelize[_0x4129('0x1')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0x4129('0x2')],'allowNull':![]},'enabled':{'type':Sequelize[_0x4129('0x3')],'defaultValue':null},'autoAssociation':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0x4129('0x1')],'set':function(_0xbd37d4){this[_0x4129('0x4')](_0x4129('0x5'),_0xbd37d4?_0xbd37d4[_0x4129('0x6')](''):[]);},'get':function(){return this[_0x4129('0x7')](_0x4129('0x5'))?this[_0x4129('0x7')](_0x4129('0x5'))[_0x4129('0x8')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index f33ba0f..b8e11ae 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 _0x4e48=['catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','apply','reject','save','update','then','destroy','sendStatus','name','index','map','UserProfileSection','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x4e48,0x9c));var _0x84e4=function(_0x1cf19,_0x1c3fff){_0x1cf19=_0x1cf19-0x0;var _0x4462ac=_0x4e48[_0x1cf19];return _0x4462ac;};'use strict';var pdf=require(_0x84e4('0x0'));var emlformat=require(_0x84e4('0x1'));var rimraf=require(_0x84e4('0x2'));var zipdir=require(_0x84e4('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x84e4('0x4'));var moment=require(_0x84e4('0x5'));var BPromise=require(_0x84e4('0x6'));var Mustache=require(_0x84e4('0x7'));var util=require(_0x84e4('0x8'));var path=require(_0x84e4('0x9'));var sox=require(_0x84e4('0xa'));var csv=require(_0x84e4('0xb'));var ejs=require(_0x84e4('0xc'));var fs=require('fs');var _=require(_0x84e4('0xd'));var squel=require(_0x84e4('0xe'));var crypto=require(_0x84e4('0xf'));var jsforce=require(_0x84e4('0x10'));var deskjs=require(_0x84e4('0x11'));var toCsv=require(_0x84e4('0xb'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x84e4('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x84e4('0x13'));var as=require(_0x84e4('0x14'));var hardwareService=require(_0x84e4('0x15'));var logger=require(_0x84e4('0x16'))(_0x84e4('0x17'));var utils=require(_0x84e4('0x18'));var config=require(_0x84e4('0x19'));var db=require(_0x84e4('0x1a'))['db'];function respondWithStatusCode(_0x4b9685,_0x3182ba){_0x3182ba=_0x3182ba||0xcc;return function(_0x358745){if(_0x358745){return _0x4b9685['sendStatus'](_0x3182ba);}return _0x4b9685[_0x84e4('0x1b')](_0x3182ba)[_0x84e4('0x1c')]();};}function respondWithResult(_0x175951,_0x4e67d3){_0x4e67d3=_0x4e67d3||0xc8;return function(_0x23631c){if(_0x23631c){return _0x175951[_0x84e4('0x1b')](_0x4e67d3)[_0x84e4('0x1d')](_0x23631c);}};}function respondWithFilteredResult(_0x46be07,_0x11445e){return function(_0x39cbfe){if(_0x39cbfe){var _0x3e9da2=_0x39cbfe[_0x84e4('0x1e')],_0x5b1d98=_0x11445e['offset'],_0x57715b=_0x11445e[_0x84e4('0x1f')]+_0x11445e['limit'],_0x2c1e1a;if(_0x57715b>=_0x3e9da2){_0x57715b=_0x3e9da2;_0x2c1e1a=0xc8;}else{_0x2c1e1a=0xce;}_0x46be07[_0x84e4('0x1b')](_0x2c1e1a);return _0x46be07[_0x84e4('0x20')]('Content-Range',_0x5b1d98+'-'+_0x57715b+'/'+_0x3e9da2)['json'](_0x39cbfe);}return null;};}function patchUpdates(_0x629b9f){return function(_0x473056){try{jsonpatch[_0x84e4('0x21')](_0x473056,_0x629b9f,!![]);}catch(_0x3ec7a9){return BPromise[_0x84e4('0x22')](_0x3ec7a9);}return _0x473056[_0x84e4('0x23')]();};}function saveUpdates(_0x768343,_0x4fb094){return function(_0x24853f){if(_0x24853f){return _0x24853f[_0x84e4('0x24')](_0x768343)[_0x84e4('0x25')](function(_0x5a03f8){return _0x5a03f8;});}return null;};}function removeEntity(_0x48e560,_0x27ad0c){return function(_0x11b29){if(_0x11b29){return _0x11b29[_0x84e4('0x26')]()[_0x84e4('0x25')](function(){_0x48e560[_0x84e4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1a6978,_0x2c5385){return function(_0x32d6ff){if(!_0x32d6ff){_0x1a6978[_0x84e4('0x27')](0x194);}return _0x32d6ff;};}function handleError(_0xfd5cd2,_0x45611c){_0x45611c=_0x45611c||0x1f4;return function(_0x177770){logger['error'](_0x177770['stack']);if(_0x177770[_0x84e4('0x28')]){delete _0x177770[_0x84e4('0x28')];}_0xfd5cd2[_0x84e4('0x1b')](_0x45611c)['send'](_0x177770);};}exports[_0x84e4('0x29')]=function(_0x32e1f8,_0x4b0264){var _0x579d49={},_0x4d5c5b={},_0x36bba8={'count':0x0,'rows':[]};var _0x18019c=_[_0x84e4('0x2a')](db[_0x84e4('0x2b')][_0x84e4('0x2c')],function(_0x5b9f2d){return{'name':_0x5b9f2d['fieldName'],'type':_0x5b9f2d[_0x84e4('0x2d')][_0x84e4('0x2e')]};});_0x4d5c5b[_0x84e4('0x2f')]=_[_0x84e4('0x2a')](_0x18019c,_0x84e4('0x28'));_0x4d5c5b[_0x84e4('0x30')]=_['keys'](_0x32e1f8['query']);_0x4d5c5b[_0x84e4('0x31')]=_[_0x84e4('0x32')](_0x4d5c5b[_0x84e4('0x2f')],_0x4d5c5b[_0x84e4('0x30')]);_0x579d49[_0x84e4('0x33')]=_[_0x84e4('0x32')](_0x4d5c5b['model'],qs[_0x84e4('0x34')](_0x32e1f8[_0x84e4('0x30')][_0x84e4('0x34')]));_0x579d49[_0x84e4('0x33')]=_0x579d49[_0x84e4('0x33')][_0x84e4('0x35')]?_0x579d49[_0x84e4('0x33')]:_0x4d5c5b[_0x84e4('0x2f')];if(!_0x32e1f8['query'][_0x84e4('0x36')](_0x84e4('0x37'))){_0x579d49['limit']=qs[_0x84e4('0x38')](_0x32e1f8[_0x84e4('0x30')][_0x84e4('0x38')]);_0x579d49[_0x84e4('0x1f')]=qs[_0x84e4('0x1f')](_0x32e1f8[_0x84e4('0x30')][_0x84e4('0x1f')]);}_0x579d49['order']=qs[_0x84e4('0x39')](_0x32e1f8['query'][_0x84e4('0x39')]);_0x579d49[_0x84e4('0x3a')]=qs['filters'](_['pick'](_0x32e1f8[_0x84e4('0x30')],_0x4d5c5b['filters']));if(_0x32e1f8[_0x84e4('0x30')][_0x84e4('0x3b')]){_0x579d49[_0x84e4('0x3a')]=_[_0x84e4('0x3c')](_0x579d49[_0x84e4('0x3a')],{'$or':_[_0x84e4('0x2a')](_0x18019c,function(_0x1b7a48){if(_0x1b7a48[_0x84e4('0x2d')]!==_0x84e4('0x3d')){var _0x236f8b={};_0x236f8b[_0x1b7a48[_0x84e4('0x28')]]={'$like':'%'+_0x32e1f8['query']['filter']+'%'};return _0x236f8b;}})});}_0x579d49=_[_0x84e4('0x3c')]({},_0x579d49,_0x32e1f8[_0x84e4('0x3e')]);var _0x2166d5={'where':_0x579d49['where']};return db[_0x84e4('0x2b')][_0x84e4('0x1e')](_0x2166d5)['then'](function(_0x5e63d2){_0x36bba8[_0x84e4('0x1e')]=_0x5e63d2;if(_0x32e1f8[_0x84e4('0x30')][_0x84e4('0x3f')]){_0x579d49[_0x84e4('0x40')]=[{'all':!![]}];}return db[_0x84e4('0x2b')]['findAll'](_0x579d49);})[_0x84e4('0x25')](function(_0x393351){_0x36bba8[_0x84e4('0x41')]=_0x393351;return _0x36bba8;})[_0x84e4('0x25')](respondWithFilteredResult(_0x4b0264,_0x579d49))[_0x84e4('0x42')](handleError(_0x4b0264,null));};exports[_0x84e4('0x43')]=function(_0x21586c,_0x4f6cec){var _0x2de621={'raw':![],'where':{'id':_0x21586c[_0x84e4('0x44')]['id']}},_0x3b7a25={};_0x3b7a25[_0x84e4('0x2f')]=_[_0x84e4('0x45')](db['UserProfileSection'][_0x84e4('0x2c')]);_0x3b7a25[_0x84e4('0x30')]=_[_0x84e4('0x45')](_0x21586c[_0x84e4('0x30')]);_0x3b7a25['filters']=_[_0x84e4('0x32')](_0x3b7a25['model'],_0x3b7a25[_0x84e4('0x30')]);_0x2de621[_0x84e4('0x33')]=_[_0x84e4('0x32')](_0x3b7a25[_0x84e4('0x2f')],qs[_0x84e4('0x34')](_0x21586c['query'][_0x84e4('0x34')]));_0x2de621['attributes']=_0x2de621[_0x84e4('0x33')][_0x84e4('0x35')]?_0x2de621[_0x84e4('0x33')]:_0x3b7a25[_0x84e4('0x2f')];if(_0x21586c[_0x84e4('0x30')]['includeAll']){_0x2de621[_0x84e4('0x40')]=[{'all':!![]}];}_0x2de621=_[_0x84e4('0x3c')]({},_0x2de621,_0x21586c[_0x84e4('0x3e')]);return db[_0x84e4('0x2b')][_0x84e4('0x46')](_0x2de621)[_0x84e4('0x25')](handleEntityNotFound(_0x4f6cec,null))[_0x84e4('0x25')](respondWithResult(_0x4f6cec,null))['catch'](handleError(_0x4f6cec,null));};exports[_0x84e4('0x47')]=function(_0x3eee74,_0x34f922){return db[_0x84e4('0x2b')][_0x84e4('0x47')](_0x3eee74[_0x84e4('0x48')],{})[_0x84e4('0x25')](respondWithResult(_0x34f922,0xc9))['catch'](handleError(_0x34f922,null));};exports[_0x84e4('0x24')]=function(_0x55ecd3,_0x33b08e){if(_0x55ecd3[_0x84e4('0x48')]['id']){delete _0x55ecd3[_0x84e4('0x48')]['id'];}return db[_0x84e4('0x2b')][_0x84e4('0x46')]({'where':{'id':_0x55ecd3[_0x84e4('0x44')]['id']}})[_0x84e4('0x25')](handleEntityNotFound(_0x33b08e,null))[_0x84e4('0x25')](saveUpdates(_0x55ecd3['body'],null))['then'](respondWithResult(_0x33b08e,null))[_0x84e4('0x42')](handleError(_0x33b08e,null));};exports[_0x84e4('0x26')]=function(_0x411397,_0x2e4102){return db[_0x84e4('0x2b')][_0x84e4('0x46')]({'where':{'id':_0x411397[_0x84e4('0x44')]['id']}})[_0x84e4('0x25')](handleEntityNotFound(_0x2e4102,null))[_0x84e4('0x25')](removeEntity(_0x2e4102,null))[_0x84e4('0x42')](handleError(_0x2e4102,null));};exports[_0x84e4('0x49')]=function(_0x43f1f2,_0x52385e){return db[_0x84e4('0x2b')][_0x84e4('0x49')]()[_0x84e4('0x25')](respondWithResult(_0x52385e,null))[_0x84e4('0x42')](handleError(_0x52385e,null));}; \ No newline at end of file +var _0xbad9=['../../config/environment','status','end','json','count','offset','limit','Content-Range','apply','reject','destroy','sendStatus','error','name','send','index','UserProfileSection','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','then','include','findAll','rows','show','params','intersection','length','includeAll','find','catch','create','body','update','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x59cf41,_0x292757){var _0x3d7568=function(_0x3e5003){while(--_0x3e5003){_0x59cf41['push'](_0x59cf41['shift']());}};_0x3d7568(++_0x292757);}(_0xbad9,0x119));var _0x9bad=function(_0x4519b3,_0x17a4aa){_0x4519b3=_0x4519b3-0x0;var _0x459f75=_0xbad9[_0x4519b3];return _0x459f75;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9bad('0x0'));var rimraf=require(_0x9bad('0x1'));var zipdir=require(_0x9bad('0x2'));var jsonpatch=require(_0x9bad('0x3'));var rp=require(_0x9bad('0x4'));var moment=require(_0x9bad('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9bad('0x6'));var util=require('util');var path=require(_0x9bad('0x7'));var sox=require('sox');var csv=require(_0x9bad('0x8'));var ejs=require(_0x9bad('0x9'));var fs=require('fs');var _=require(_0x9bad('0xa'));var squel=require(_0x9bad('0xb'));var crypto=require(_0x9bad('0xc'));var jsforce=require(_0x9bad('0xd'));var deskjs=require(_0x9bad('0xe'));var toCsv=require(_0x9bad('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x9bad('0xf'));var authService=require(_0x9bad('0x10'));var qs=require(_0x9bad('0x11'));var as=require(_0x9bad('0x12'));var hardwareService=require(_0x9bad('0x13'));var logger=require(_0x9bad('0x14'))(_0x9bad('0x15'));var utils=require(_0x9bad('0x16'));var config=require(_0x9bad('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x273eb3,_0x3cba15){_0x3cba15=_0x3cba15||0xcc;return function(_0x4ca3ff){if(_0x4ca3ff){return _0x273eb3['sendStatus'](_0x3cba15);}return _0x273eb3[_0x9bad('0x18')](_0x3cba15)[_0x9bad('0x19')]();};}function respondWithResult(_0x3e935c,_0x2bc213){_0x2bc213=_0x2bc213||0xc8;return function(_0x10c12f){if(_0x10c12f){return _0x3e935c[_0x9bad('0x18')](_0x2bc213)[_0x9bad('0x1a')](_0x10c12f);}};}function respondWithFilteredResult(_0x457058,_0xd4bc9a){return function(_0x870d85){if(_0x870d85){var _0x16cf57=_0x870d85[_0x9bad('0x1b')],_0x55b30e=_0xd4bc9a['offset'],_0x556b0e=_0xd4bc9a[_0x9bad('0x1c')]+_0xd4bc9a[_0x9bad('0x1d')],_0x464963;if(_0x556b0e>=_0x16cf57){_0x556b0e=_0x16cf57;_0x464963=0xc8;}else{_0x464963=0xce;}_0x457058['status'](_0x464963);return _0x457058['set'](_0x9bad('0x1e'),_0x55b30e+'-'+_0x556b0e+'/'+_0x16cf57)[_0x9bad('0x1a')](_0x870d85);}return null;};}function patchUpdates(_0x54044f){return function(_0x7ca63){try{jsonpatch[_0x9bad('0x1f')](_0x7ca63,_0x54044f,!![]);}catch(_0x2f7062){return BPromise[_0x9bad('0x20')](_0x2f7062);}return _0x7ca63['save']();};}function saveUpdates(_0x1f3ba3,_0x3fb3b9){return function(_0x566088){if(_0x566088){return _0x566088['update'](_0x1f3ba3)['then'](function(_0x38b02b){return _0x38b02b;});}return null;};}function removeEntity(_0x22dd9d,_0x26abc5){return function(_0x4250f4){if(_0x4250f4){return _0x4250f4[_0x9bad('0x21')]()['then'](function(){_0x22dd9d[_0x9bad('0x18')](0xcc)[_0x9bad('0x19')]();});}};}function handleEntityNotFound(_0x7349f4,_0x41062f){return function(_0x58f6f9){if(!_0x58f6f9){_0x7349f4[_0x9bad('0x22')](0x194);}return _0x58f6f9;};}function handleError(_0x597311,_0x10dc1e){_0x10dc1e=_0x10dc1e||0x1f4;return function(_0x2ba9f8){logger[_0x9bad('0x23')](_0x2ba9f8['stack']);if(_0x2ba9f8[_0x9bad('0x24')]){delete _0x2ba9f8[_0x9bad('0x24')];}_0x597311[_0x9bad('0x18')](_0x10dc1e)[_0x9bad('0x25')](_0x2ba9f8);};}exports[_0x9bad('0x26')]=function(_0x3199ba,_0x2fd12b){var _0x16b6ba={},_0x3281de={},_0x17d212={'count':0x0,'rows':[]};var _0x169d0b=_['map'](db[_0x9bad('0x27')][_0x9bad('0x28')],function(_0x7b35d7){return{'name':_0x7b35d7[_0x9bad('0x29')],'type':_0x7b35d7[_0x9bad('0x2a')][_0x9bad('0x2b')]};});_0x3281de[_0x9bad('0x2c')]=_[_0x9bad('0x2d')](_0x169d0b,_0x9bad('0x24'));_0x3281de[_0x9bad('0x2e')]=_[_0x9bad('0x2f')](_0x3199ba[_0x9bad('0x2e')]);_0x3281de[_0x9bad('0x30')]=_['intersection'](_0x3281de[_0x9bad('0x2c')],_0x3281de[_0x9bad('0x2e')]);_0x16b6ba[_0x9bad('0x31')]=_['intersection'](_0x3281de[_0x9bad('0x2c')],qs['fields'](_0x3199ba[_0x9bad('0x2e')][_0x9bad('0x32')]));_0x16b6ba[_0x9bad('0x31')]=_0x16b6ba[_0x9bad('0x31')]['length']?_0x16b6ba[_0x9bad('0x31')]:_0x3281de[_0x9bad('0x2c')];if(!_0x3199ba[_0x9bad('0x2e')][_0x9bad('0x33')](_0x9bad('0x34'))){_0x16b6ba[_0x9bad('0x1d')]=qs['limit'](_0x3199ba[_0x9bad('0x2e')]['limit']);_0x16b6ba[_0x9bad('0x1c')]=qs[_0x9bad('0x1c')](_0x3199ba[_0x9bad('0x2e')][_0x9bad('0x1c')]);}_0x16b6ba[_0x9bad('0x35')]=qs[_0x9bad('0x36')](_0x3199ba['query'][_0x9bad('0x36')]);_0x16b6ba['where']=qs[_0x9bad('0x30')](_[_0x9bad('0x37')](_0x3199ba[_0x9bad('0x2e')],_0x3281de[_0x9bad('0x30')]));if(_0x3199ba[_0x9bad('0x2e')][_0x9bad('0x38')]){_0x16b6ba[_0x9bad('0x39')]=_['merge'](_0x16b6ba['where'],{'$or':_[_0x9bad('0x2d')](_0x169d0b,function(_0x94fbc){if(_0x94fbc[_0x9bad('0x2a')]!==_0x9bad('0x3a')){var _0x189147={};_0x189147[_0x94fbc[_0x9bad('0x24')]]={'$like':'%'+_0x3199ba[_0x9bad('0x2e')][_0x9bad('0x38')]+'%'};return _0x189147;}})});}_0x16b6ba=_[_0x9bad('0x3b')]({},_0x16b6ba,_0x3199ba[_0x9bad('0x3c')]);var _0x3f34e9={'where':_0x16b6ba['where']};return db[_0x9bad('0x27')]['count'](_0x3f34e9)[_0x9bad('0x3d')](function(_0x230596){_0x17d212[_0x9bad('0x1b')]=_0x230596;if(_0x3199ba[_0x9bad('0x2e')]['includeAll']){_0x16b6ba[_0x9bad('0x3e')]=[{'all':!![]}];}return db[_0x9bad('0x27')][_0x9bad('0x3f')](_0x16b6ba);})['then'](function(_0x8c8bc8){_0x17d212[_0x9bad('0x40')]=_0x8c8bc8;return _0x17d212;})['then'](respondWithFilteredResult(_0x2fd12b,_0x16b6ba))['catch'](handleError(_0x2fd12b,null));};exports[_0x9bad('0x41')]=function(_0x56aa1f,_0x400ad6){var _0xee5bc8={'raw':![],'where':{'id':_0x56aa1f[_0x9bad('0x42')]['id']}},_0x223604={};_0x223604[_0x9bad('0x2c')]=_[_0x9bad('0x2f')](db[_0x9bad('0x27')][_0x9bad('0x28')]);_0x223604[_0x9bad('0x2e')]=_[_0x9bad('0x2f')](_0x56aa1f[_0x9bad('0x2e')]);_0x223604['filters']=_[_0x9bad('0x43')](_0x223604[_0x9bad('0x2c')],_0x223604[_0x9bad('0x2e')]);_0xee5bc8[_0x9bad('0x31')]=_[_0x9bad('0x43')](_0x223604['model'],qs['fields'](_0x56aa1f[_0x9bad('0x2e')][_0x9bad('0x32')]));_0xee5bc8[_0x9bad('0x31')]=_0xee5bc8[_0x9bad('0x31')][_0x9bad('0x44')]?_0xee5bc8[_0x9bad('0x31')]:_0x223604[_0x9bad('0x2c')];if(_0x56aa1f[_0x9bad('0x2e')][_0x9bad('0x45')]){_0xee5bc8[_0x9bad('0x3e')]=[{'all':!![]}];}_0xee5bc8=_[_0x9bad('0x3b')]({},_0xee5bc8,_0x56aa1f[_0x9bad('0x3c')]);return db[_0x9bad('0x27')][_0x9bad('0x46')](_0xee5bc8)[_0x9bad('0x3d')](handleEntityNotFound(_0x400ad6,null))[_0x9bad('0x3d')](respondWithResult(_0x400ad6,null))[_0x9bad('0x47')](handleError(_0x400ad6,null));};exports[_0x9bad('0x48')]=function(_0x5db56e,_0x5a380c){return db['UserProfileSection'][_0x9bad('0x48')](_0x5db56e[_0x9bad('0x49')],{})[_0x9bad('0x3d')](respondWithResult(_0x5a380c,0xc9))[_0x9bad('0x47')](handleError(_0x5a380c,null));};exports[_0x9bad('0x4a')]=function(_0x213a61,_0x3bc9c6){if(_0x213a61['body']['id']){delete _0x213a61[_0x9bad('0x49')]['id'];}return db[_0x9bad('0x27')][_0x9bad('0x46')]({'where':{'id':_0x213a61[_0x9bad('0x42')]['id']}})[_0x9bad('0x3d')](handleEntityNotFound(_0x3bc9c6,null))[_0x9bad('0x3d')](saveUpdates(_0x213a61[_0x9bad('0x49')],null))['then'](respondWithResult(_0x3bc9c6,null))[_0x9bad('0x47')](handleError(_0x3bc9c6,null));};exports[_0x9bad('0x21')]=function(_0x3785dd,_0x85f287){return db['UserProfileSection'][_0x9bad('0x46')]({'where':{'id':_0x3785dd['params']['id']}})[_0x9bad('0x3d')](handleEntityNotFound(_0x85f287,null))['then'](removeEntity(_0x85f287,null))['catch'](handleError(_0x85f287,null));};exports[_0x9bad('0x4b')]=function(_0x5e6656,_0x26393d){return db[_0x9bad('0x27')]['describe']()[_0x9bad('0x3d')](respondWithResult(_0x26393d,null))[_0x9bad('0x47')](handleError(_0x26393d,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index 6df1d15..53c4bee 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 _0xaa73=['path','../../config/environment','define','user_profile_has_sections','compositeIndex','sectionId','userProfileId','lodash','util','api','moment','bluebird','request-promise'];(function(_0x241ab5,_0x3eba39){var _0x1dce8d=function(_0x45444f){while(--_0x45444f){_0x241ab5['push'](_0x241ab5['shift']());}};_0x1dce8d(++_0x3eba39);}(_0xaa73,0xfe));var _0x3aa7=function(_0x17435e,_0x37e929){_0x17435e=_0x17435e-0x0;var _0x3001ef=_0xaa73[_0x17435e];return _0x3001ef;};'use strict';var _=require(_0x3aa7('0x0'));var util=require(_0x3aa7('0x1'));var logger=require('../../config/logger')(_0x3aa7('0x2'));var moment=require(_0x3aa7('0x3'));var BPromise=require(_0x3aa7('0x4'));var rp=require(_0x3aa7('0x5'));var fs=require('fs');var path=require(_0x3aa7('0x6'));var rimraf=require('rimraf');var config=require(_0x3aa7('0x7'));var attributes=require('./userProfileSection.attributes');module['exports']=function(_0x3cfbd0,_0x54ab04){return _0x3cfbd0[_0x3aa7('0x8')]('UserProfileSection',attributes,{'tableName':_0x3aa7('0x9'),'paranoid':![],'indexes':[{'name':_0x3aa7('0xa'),'fields':[_0x3aa7('0xb'),_0x3aa7('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x5f19=['api','moment','request-promise','path','rimraf','../../config/environment','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash','../../config/logger'];(function(_0x31844,_0x357ba){var _0x1eeb96=function(_0x2562b2){while(--_0x2562b2){_0x31844['push'](_0x31844['shift']());}};_0x1eeb96(++_0x357ba);}(_0x5f19,0x94));var _0x95f1=function(_0x2ca9d4,_0x51d5c6){_0x2ca9d4=_0x2ca9d4-0x0;var _0x258956=_0x5f19[_0x2ca9d4];return _0x258956;};'use strict';var _=require(_0x95f1('0x0'));var util=require('util');var logger=require(_0x95f1('0x1'))(_0x95f1('0x2'));var moment=require(_0x95f1('0x3'));var BPromise=require('bluebird');var rp=require(_0x95f1('0x4'));var fs=require('fs');var path=require(_0x95f1('0x5'));var rimraf=require(_0x95f1('0x6'));var config=require(_0x95f1('0x7'));var attributes=require(_0x95f1('0x8'));module[_0x95f1('0x9')]=function(_0x1f26fc,_0x3f8f77){return _0x1f26fc[_0x95f1('0xa')](_0x95f1('0xb'),attributes,{'tableName':_0x95f1('0xc'),'paranoid':![],'indexes':[{'name':_0x95f1('0xd'),'fields':['sectionId',_0x95f1('0xe')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.rpc.js b/server/api/userProfileSection/userProfileSection.rpc.js index 9db9f61..1ba85b1 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 _0xaa3c=['UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','UserProfileSection,\x20%s,\x20%s','message','request\x20sent','result','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','http','request','then','info','debug'];(function(_0x505451,_0x2fee46){var _0x3e157e=function(_0x4843de){while(--_0x4843de){_0x505451['push'](_0x505451['shift']());}};_0x3e157e(++_0x2fee46);}(_0xaa3c,0xd8));var _0xcaa3=function(_0x30ec0c,_0x194ef0){_0x30ec0c=_0x30ec0c-0x0;var _0x80775e=_0xaa3c[_0x30ec0c];return _0x80775e;};'use strict';var _=require('lodash');var util=require(_0xcaa3('0x0'));var moment=require('moment');var BPromise=require(_0xcaa3('0x1'));var rs=require(_0xcaa3('0x2'));var fs=require('fs');var Redis=require(_0xcaa3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xcaa3('0x4'));var logger=require(_0xcaa3('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0xcaa3('0x6'));var client=jayson['client'][_0xcaa3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4ea4d4,_0x441fa0,_0x450e75){return new BPromise(function(_0x563758,_0xafeaf1){return client[_0xcaa3('0x8')](_0x4ea4d4,_0x450e75)[_0xcaa3('0x9')](function(_0x10543c){logger[_0xcaa3('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x441fa0,'request\x20sent');logger[_0xcaa3('0xb')](_0xcaa3('0xc'),_0x441fa0,'request\x20sent',JSON[_0xcaa3('0xd')](_0x10543c));if(_0x10543c[_0xcaa3('0xe')]){if(_0x10543c[_0xcaa3('0xe')]['code']===0x1f4){logger[_0xcaa3('0xe')](_0xcaa3('0xf'),_0x441fa0,_0x10543c[_0xcaa3('0xe')]['message']);return _0xafeaf1(_0x10543c[_0xcaa3('0xe')][_0xcaa3('0x10')]);}logger[_0xcaa3('0xe')](_0xcaa3('0xf'),_0x441fa0,_0x10543c[_0xcaa3('0xe')][_0xcaa3('0x10')]);return _0x563758(_0x10543c[_0xcaa3('0xe')][_0xcaa3('0x10')]);}else{logger[_0xcaa3('0xa')]('UserProfileSection,\x20%s,\x20%s',_0x441fa0,_0xcaa3('0x11'));_0x563758(_0x10543c[_0xcaa3('0x12')][_0xcaa3('0x10')]);}})['catch'](function(_0x350631){logger[_0xcaa3('0xe')](_0xcaa3('0xf'),_0x441fa0,_0x350631);_0xafeaf1(_0x350631);});});} \ No newline at end of file +var _0x55d2=['UserProfileSection,\x20%s,\x20%s','request\x20sent','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x55d2,0xaa));var _0x255d=function(_0x5e63b2,_0x591fef){_0x5e63b2=_0x5e63b2-0x0;var _0x223ab3=_0x55d2[_0x5e63b2];return _0x223ab3;};'use strict';var _=require('lodash');var util=require(_0x255d('0x0'));var moment=require(_0x255d('0x1'));var BPromise=require(_0x255d('0x2'));var rs=require(_0x255d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x255d('0x4'));var logger=require(_0x255d('0x5'))(_0x255d('0x6'));var config=require(_0x255d('0x7'));var jayson=require(_0x255d('0x8'));var client=jayson[_0x255d('0x9')][_0x255d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x189877,_0x567e77,_0x1934cd){return new BPromise(function(_0x55d711,_0x15b75c){return client[_0x255d('0xb')](_0x189877,_0x1934cd)[_0x255d('0xc')](function(_0x40b696){logger[_0x255d('0xd')](_0x255d('0xe'),_0x567e77,_0x255d('0xf'));logger['debug'](_0x255d('0x10'),_0x567e77,_0x255d('0xf'),JSON[_0x255d('0x11')](_0x40b696));if(_0x40b696[_0x255d('0x12')]){if(_0x40b696[_0x255d('0x12')][_0x255d('0x13')]===0x1f4){logger[_0x255d('0x12')](_0x255d('0xe'),_0x567e77,_0x40b696[_0x255d('0x12')][_0x255d('0x14')]);return _0x15b75c(_0x40b696[_0x255d('0x12')][_0x255d('0x14')]);}logger['error'](_0x255d('0xe'),_0x567e77,_0x40b696[_0x255d('0x12')]['message']);return _0x55d711(_0x40b696[_0x255d('0x12')][_0x255d('0x14')]);}else{logger['info'](_0x255d('0xe'),_0x567e77,_0x255d('0xf'));_0x55d711(_0x40b696[_0x255d('0x15')]['message']);}})[_0x255d('0x16')](function(_0x495ba1){logger['error'](_0x255d('0xe'),_0x567e77,_0x495ba1);_0x15b75c(_0x495ba1);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0802f0d..3a2edc8 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 _0x4b24=['Router','../../components/interaction/service','exports','multer','util','path','connect-timeout'];(function(_0x3d7276,_0x2be9d6){var _0x361ad3=function(_0xc8dd25){while(--_0xc8dd25){_0x3d7276['push'](_0x3d7276['shift']());}};_0x361ad3(++_0x2be9d6);}(_0x4b24,0x1e6));var _0x44b2=function(_0x5a045d,_0xbfa721){_0x5a045d=_0x5a045d-0x0;var _0x310183=_0x4b24[_0x5a045d];return _0x310183;};'use strict';var multer=require(_0x44b2('0x0'));var util=require(_0x44b2('0x1'));var path=require(_0x44b2('0x2'));var timeout=require(_0x44b2('0x3'));var express=require('express');var router=express[_0x44b2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x44b2('0x5'));var config=require('../../config/environment');module[_0x44b2('0x6')]=router; \ No newline at end of file +var _0xa1de=['../../config/environment','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xd55128,_0x4de93b){var _0x42eb2f=function(_0x505d56){while(--_0x505d56){_0xd55128['push'](_0xd55128['shift']());}};_0x42eb2f(++_0x4de93b);}(_0xa1de,0x115));var _0xea1d=function(_0x175f6f,_0x1a4a05){_0x175f6f=_0x175f6f-0x0;var _0x1aa501=_0xa1de[_0x175f6f];return _0x1aa501;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xea1d('0x0'));var timeout=require(_0xea1d('0x1'));var express=require('express');var router=express[_0xea1d('0x2')]();var auth=require(_0xea1d('0x3'));var interaction=require(_0xea1d('0x4'));var config=require(_0xea1d('0x5'));module['exports']=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index c568c81..dfe86b3 100644 --- a/server/api/userSmsQueue/userSmsQueue.attributes.js +++ b/server/api/userSmsQueue/userSmsQueue.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd8b0=['exports','sequelize'];(function(_0x48d8b5,_0x30639c){var _0x98f767=function(_0x596a32){while(--_0x596a32){_0x48d8b5['push'](_0x48d8b5['shift']());}};_0x98f767(++_0x30639c);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x5c98ea,_0xa782aa){var _0x51e853=function(_0x57d5b0){while(--_0x57d5b0){_0x5c98ea['push'](_0x5c98ea['shift']());}};_0x51e853(++_0xa782aa);}(_0xbaf0,0x12a));var _0x0baf=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xbaf0[_0x19e35c];return _0x3e1fe8;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 5b3fac9..4db2137 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 _0xb428=['define','UserSmsQueue','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb428,0x70));var _0x8b42=function(_0x38782c,_0x5c9fef){_0x38782c=_0x38782c-0x0;var _0x3708bf=_0xb428[_0x38782c];return _0x3708bf;};'use strict';var _=require(_0x8b42('0x0'));var util=require(_0x8b42('0x1'));var logger=require('../../config/logger')(_0x8b42('0x2'));var moment=require(_0x8b42('0x3'));var BPromise=require('bluebird');var rp=require(_0x8b42('0x4'));var fs=require('fs');var path=require(_0x8b42('0x5'));var rimraf=require(_0x8b42('0x6'));var config=require(_0x8b42('0x7'));var attributes=require('./userSmsQueue.attributes');module[_0x8b42('0x8')]=function(_0x5aca8b,_0x2ed3d5){return _0x5aca8b[_0x8b42('0x9')](_0x8b42('0xa'),attributes,{'tableName':'user_has_sms_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe8b1=['define','user_has_sms_queues','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x953403,_0x4eab96){var _0xbc83e7=function(_0x2c9272){while(--_0x2c9272){_0x953403['push'](_0x953403['shift']());}};_0xbc83e7(++_0x4eab96);}(_0xe8b1,0x84));var _0x1e8b=function(_0x220474,_0x2aba1d){_0x220474=_0x220474-0x0;var _0x2af91a=_0xe8b1[_0x220474];return _0x2af91a;};'use strict';var _=require(_0x1e8b('0x0'));var util=require(_0x1e8b('0x1'));var logger=require(_0x1e8b('0x2'))('api');var moment=require(_0x1e8b('0x3'));var BPromise=require(_0x1e8b('0x4'));var rp=require(_0x1e8b('0x5'));var fs=require('fs');var path=require(_0x1e8b('0x6'));var rimraf=require('rimraf');var config=require(_0x1e8b('0x7'));var attributes=require('./userSmsQueue.attributes');module['exports']=function(_0x3be552,_0x3d8cb0){return _0x3be552[_0x1e8b('0x8')]('UserSmsQueue',attributes,{'tableName':_0x1e8b('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.rpc.js b/server/api/userSmsQueue/userSmsQueue.rpc.js index ee249b4..952ed78 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 _0x8ab8=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','UserSmsQueue,\x20%s,\x20%s','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result'];(function(_0x45cec0,_0x30619f){var _0x1d8a3f=function(_0x1e3d91){while(--_0x1e3d91){_0x45cec0['push'](_0x45cec0['shift']());}};_0x1d8a3f(++_0x30619f);}(_0x8ab8,0x16d));var _0x88ab=function(_0x119748,_0x2dd5a1){_0x119748=_0x119748-0x0;var _0x5c3c77=_0x8ab8[_0x119748];return _0x5c3c77;};'use strict';var _=require(_0x88ab('0x0'));var util=require(_0x88ab('0x1'));var moment=require(_0x88ab('0x2'));var BPromise=require(_0x88ab('0x3'));var rs=require(_0x88ab('0x4'));var fs=require('fs');var Redis=require(_0x88ab('0x5'));var db=require(_0x88ab('0x6'))['db'];var utils=require(_0x88ab('0x7'));var logger=require(_0x88ab('0x8'))(_0x88ab('0x9'));var config=require(_0x88ab('0xa'));var jayson=require(_0x88ab('0xb'));var client=jayson['client'][_0x88ab('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xbf420e,_0xf1bafe,_0x3b7d53){return new BPromise(function(_0x5c2c00,_0x44ead2){return client[_0x88ab('0xd')](_0xbf420e,_0x3b7d53)[_0x88ab('0xe')](function(_0x4e57d3){logger['info'](_0x88ab('0xf'),_0xf1bafe,'request\x20sent');logger[_0x88ab('0x10')](_0x88ab('0x11'),_0xf1bafe,_0x88ab('0x12'),JSON[_0x88ab('0x13')](_0x4e57d3));if(_0x4e57d3['error']){if(_0x4e57d3['error'][_0x88ab('0x14')]===0x1f4){logger[_0x88ab('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0xf1bafe,_0x4e57d3[_0x88ab('0x15')][_0x88ab('0x16')]);return _0x44ead2(_0x4e57d3[_0x88ab('0x15')][_0x88ab('0x16')]);}logger[_0x88ab('0x15')](_0x88ab('0xf'),_0xf1bafe,_0x4e57d3['error']['message']);return _0x5c2c00(_0x4e57d3['error'][_0x88ab('0x16')]);}else{logger[_0x88ab('0x17')](_0x88ab('0xf'),_0xf1bafe,_0x88ab('0x12'));_0x5c2c00(_0x4e57d3[_0x88ab('0x18')]['message']);}})[_0x88ab('0x19')](function(_0x3881a0){logger[_0x88ab('0x15')]('UserSmsQueue,\x20%s,\x20%s',_0xf1bafe,_0x3881a0);_0x44ead2(_0x3881a0);});});} \ No newline at end of file +var _0x0e7d=['UserSmsQueue,\x20%s,\x20%s,\x20%s','error','message','catch','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x11435c,_0x436ccf){var _0x556167=function(_0x56cf83){while(--_0x56cf83){_0x11435c['push'](_0x11435c['shift']());}};_0x556167(++_0x436ccf);}(_0x0e7d,0x130));var _0xd0e7=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0x0e7d[_0x2235bf];return _0x4c3a64;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xd0e7('0x0'));var rs=require(_0xd0e7('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd0e7('0x2'))['db'];var utils=require(_0xd0e7('0x3'));var logger=require(_0xd0e7('0x4'))(_0xd0e7('0x5'));var config=require(_0xd0e7('0x6'));var jayson=require(_0xd0e7('0x7'));var client=jayson[_0xd0e7('0x8')][_0xd0e7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ef8d0,_0x324bb7,_0x177857){return new BPromise(function(_0x1d3ce4,_0x138e2b){return client[_0xd0e7('0xa')](_0x4ef8d0,_0x177857)[_0xd0e7('0xb')](function(_0x43044a){logger[_0xd0e7('0xc')](_0xd0e7('0xd'),_0x324bb7,_0xd0e7('0xe'));logger[_0xd0e7('0xf')](_0xd0e7('0x10'),_0x324bb7,_0xd0e7('0xe'),JSON['stringify'](_0x43044a));if(_0x43044a['error']){if(_0x43044a[_0xd0e7('0x11')]['code']===0x1f4){logger[_0xd0e7('0x11')]('UserSmsQueue,\x20%s,\x20%s',_0x324bb7,_0x43044a['error'][_0xd0e7('0x12')]);return _0x138e2b(_0x43044a[_0xd0e7('0x11')][_0xd0e7('0x12')]);}logger[_0xd0e7('0x11')](_0xd0e7('0xd'),_0x324bb7,_0x43044a[_0xd0e7('0x11')][_0xd0e7('0x12')]);return _0x1d3ce4(_0x43044a['error'][_0xd0e7('0x12')]);}else{logger[_0xd0e7('0xc')](_0xd0e7('0xd'),_0x324bb7,_0xd0e7('0xe'));_0x1d3ce4(_0x43044a['result']['message']);}})[_0xd0e7('0x13')](function(_0x7e28ca){logger['error'](_0xd0e7('0xd'),_0x324bb7,_0x7e28ca);_0x138e2b(_0x7e28ca);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 0d410cd..8c02bf5 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 _0xde7c=['../../config/environment','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1d2bbb,_0x202267){var _0x38082b=function(_0x27d153){while(--_0x27d153){_0x1d2bbb['push'](_0x1d2bbb['shift']());}};_0x38082b(++_0x202267);}(_0xde7c,0x14f));var _0xcde7=function(_0x3c0241,_0x22b48b){_0x3c0241=_0x3c0241-0x0;var _0x2eb85a=_0xde7c[_0x3c0241];return _0x2eb85a;};'use strict';var multer=require(_0xcde7('0x0'));var util=require('util');var path=require(_0xcde7('0x1'));var timeout=require(_0xcde7('0x2'));var express=require(_0xcde7('0x3'));var router=express[_0xcde7('0x4')]();var auth=require(_0xcde7('0x5'));var interaction=require(_0xcde7('0x6'));var config=require(_0xcde7('0x7'));module[_0xcde7('0x8')]=router; \ No newline at end of file +var _0x4c4a=['multer','util','path','express','Router','../../components/interaction/service','../../config/environment','exports'];(function(_0x5519a9,_0x1c5147){var _0x32f2cc=function(_0x52ed58){while(--_0x52ed58){_0x5519a9['push'](_0x5519a9['shift']());}};_0x32f2cc(++_0x1c5147);}(_0x4c4a,0x190));var _0xa4c4=function(_0x457207,_0x32ef87){_0x457207=_0x457207-0x0;var _0x1ed9ae=_0x4c4a[_0x457207];return _0x1ed9ae;};'use strict';var multer=require(_0xa4c4('0x0'));var util=require(_0xa4c4('0x1'));var path=require(_0xa4c4('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4c4('0x3'));var router=express[_0xa4c4('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa4c4('0x5'));var config=require(_0xa4c4('0x6'));module[_0xa4c4('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index 193910b..7885152 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 _0xbaf0=['exports','INTEGER'];(function(_0x1305e3,_0x43a724){var _0x1068e9=function(_0x1bc555){while(--_0x1bc555){_0x1305e3['push'](_0x1305e3['shift']());}};_0x1068e9(++_0x43a724);}(_0xbaf0,0x12a));var _0x0baf=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xbaf0[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('0x1')],'defaultValue':0x0}}; \ No newline at end of file +var _0xb10b=['sequelize','INTEGER'];(function(_0x4e885a,_0x4c895c){var _0x56521f=function(_0x2695c7){while(--_0x2695c7){_0x4e885a['push'](_0x4e885a['shift']());}};_0x56521f(++_0x4c895c);}(_0xb10b,0x12a));var _0xbb10=function(_0xb61433,_0x31d758){_0xb61433=_0xb61433-0x0;var _0x123400=_0xb10b[_0xb61433];return _0x123400;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xbb10('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 a92647c..0f86cbf 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 _0xd0bb=['UserVoiceQueue','lodash','util','../../config/logger','moment','request-promise','path','../../config/environment','exports','define'];(function(_0x368316,_0x3c6c9c){var _0x18b7af=function(_0x511339){while(--_0x511339){_0x368316['push'](_0x368316['shift']());}};_0x18b7af(++_0x3c6c9c);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x24dbad,_0x38302c){_0x24dbad=_0x24dbad-0x0;var _0x8624ac=_0xd0bb[_0x24dbad];return _0x8624ac;};'use strict';var _=require(_0xbd0b('0x0'));var util=require(_0xbd0b('0x1'));var logger=require(_0xbd0b('0x2'))('api');var moment=require(_0xbd0b('0x3'));var BPromise=require('bluebird');var rp=require(_0xbd0b('0x4'));var fs=require('fs');var path=require(_0xbd0b('0x5'));var rimraf=require('rimraf');var config=require(_0xbd0b('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0xbd0b('0x7')]=function(_0x1b2499,_0x158b5c){return _0x1b2499[_0xbd0b('0x8')](_0xbd0b('0x9'),attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4bc3=['./userVoiceQueue.attributes','exports','define','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment'];(function(_0x506eed,_0x2496ee){var _0x4f8fe0=function(_0x3ab92e){while(--_0x3ab92e){_0x506eed['push'](_0x506eed['shift']());}};_0x4f8fe0(++_0x2496ee);}(_0x4bc3,0x16e));var _0x34bc=function(_0x4b73a2,_0x40b5fe){_0x4b73a2=_0x4b73a2-0x0;var _0x383c66=_0x4bc3[_0x4b73a2];return _0x383c66;};'use strict';var _=require(_0x34bc('0x0'));var util=require(_0x34bc('0x1'));var logger=require('../../config/logger')(_0x34bc('0x2'));var moment=require(_0x34bc('0x3'));var BPromise=require('bluebird');var rp=require(_0x34bc('0x4'));var fs=require('fs');var path=require(_0x34bc('0x5'));var rimraf=require(_0x34bc('0x6'));var config=require(_0x34bc('0x7'));var attributes=require(_0x34bc('0x8'));module[_0x34bc('0x9')]=function(_0x2cc9c2,_0x4c63a1){return _0x2cc9c2[_0x34bc('0xa')]('UserVoiceQueue',attributes,{'tableName':'user_has_voice_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.rpc.js b/server/api/userVoiceQueue/userVoiceQueue.rpc.js index 7efb456..e3966ed 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 _0x1951=['http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\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'];(function(_0x4def44,_0x2eb508){var _0x5c90e8=function(_0xdbf568){while(--_0xdbf568){_0x4def44['push'](_0x4def44['shift']());}};_0x5c90e8(++_0x2eb508);}(_0x1951,0x1e2));var _0x1195=function(_0x12efa0,_0x579590){_0x12efa0=_0x12efa0-0x0;var _0x158c02=_0x1951[_0x12efa0];return _0x158c02;};'use strict';var _=require(_0x1195('0x0'));var util=require(_0x1195('0x1'));var moment=require(_0x1195('0x2'));var BPromise=require(_0x1195('0x3'));var rs=require(_0x1195('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1195('0x5'))['db'];var utils=require(_0x1195('0x6'));var logger=require(_0x1195('0x7'))(_0x1195('0x8'));var config=require(_0x1195('0x9'));var jayson=require(_0x1195('0xa'));var client=jayson[_0x1195('0xb')][_0x1195('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3ba52e,_0x4161ae,_0x301cb7){return new BPromise(function(_0x2bd321,_0x3c8a3e){return client[_0x1195('0xd')](_0x3ba52e,_0x301cb7)[_0x1195('0xe')](function(_0x170b77){logger[_0x1195('0xf')](_0x1195('0x10'),_0x4161ae,_0x1195('0x11'));logger[_0x1195('0x12')](_0x1195('0x13'),_0x4161ae,'request\x20sent',JSON[_0x1195('0x14')](_0x170b77));if(_0x170b77['error']){if(_0x170b77[_0x1195('0x15')][_0x1195('0x16')]===0x1f4){logger['error'](_0x1195('0x10'),_0x4161ae,_0x170b77[_0x1195('0x15')]['message']);return _0x3c8a3e(_0x170b77[_0x1195('0x15')][_0x1195('0x17')]);}logger[_0x1195('0x15')](_0x1195('0x10'),_0x4161ae,_0x170b77[_0x1195('0x15')][_0x1195('0x17')]);return _0x2bd321(_0x170b77[_0x1195('0x15')][_0x1195('0x17')]);}else{logger[_0x1195('0xf')](_0x1195('0x10'),_0x4161ae,'request\x20sent');_0x2bd321(_0x170b77[_0x1195('0x18')][_0x1195('0x17')]);}})[_0x1195('0x19')](function(_0x1ee88e){logger[_0x1195('0x15')](_0x1195('0x10'),_0x4161ae,_0x1ee88e);_0x3c8a3e(_0x1ee88e);});});} \ No newline at end of file +var _0xd0e5=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd0e5,0x193));var _0x5d0e=function(_0x261e29,_0x10fffd){_0x261e29=_0x261e29-0x0;var _0x25ef43=_0xd0e5[_0x261e29];return _0x25ef43;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d0e('0x0'));var BPromise=require(_0x5d0e('0x1'));var rs=require(_0x5d0e('0x2'));var fs=require('fs');var Redis=require(_0x5d0e('0x3'));var db=require(_0x5d0e('0x4'))['db'];var utils=require(_0x5d0e('0x5'));var logger=require('../../config/logger')(_0x5d0e('0x6'));var config=require(_0x5d0e('0x7'));var jayson=require(_0x5d0e('0x8'));var client=jayson[_0x5d0e('0x9')][_0x5d0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x174ef9,_0x27f542,_0x476f8b){return new BPromise(function(_0x3dc5b5,_0x33f86f){return client[_0x5d0e('0xb')](_0x174ef9,_0x476f8b)[_0x5d0e('0xc')](function(_0x2e70f0){logger[_0x5d0e('0xd')](_0x5d0e('0xe'),_0x27f542,_0x5d0e('0xf'));logger[_0x5d0e('0x10')](_0x5d0e('0x11'),_0x27f542,_0x5d0e('0xf'),JSON[_0x5d0e('0x12')](_0x2e70f0));if(_0x2e70f0['error']){if(_0x2e70f0[_0x5d0e('0x13')][_0x5d0e('0x14')]===0x1f4){logger[_0x5d0e('0x13')]('UserVoiceQueue,\x20%s,\x20%s',_0x27f542,_0x2e70f0['error'][_0x5d0e('0x15')]);return _0x33f86f(_0x2e70f0[_0x5d0e('0x13')][_0x5d0e('0x15')]);}logger['error'](_0x5d0e('0xe'),_0x27f542,_0x2e70f0['error'][_0x5d0e('0x15')]);return _0x3dc5b5(_0x2e70f0['error'][_0x5d0e('0x15')]);}else{logger[_0x5d0e('0xd')](_0x5d0e('0xe'),_0x27f542,'request\x20sent');_0x3dc5b5(_0x2e70f0[_0x5d0e('0x16')][_0x5d0e('0x15')]);}})[_0x5d0e('0x17')](function(_0x515119){logger['error'](_0x5d0e('0xe'),_0x27f542,_0x515119);_0x33f86f(_0x515119);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 7b5570b..ee14e27 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 _0xca17=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x3fe6c6,_0x12ff2c){var _0x13e849=function(_0x3a1d6b){while(--_0x3a1d6b){_0x3fe6c6['push'](_0x3fe6c6['shift']());}};_0x13e849(++_0x12ff2c);}(_0xca17,0xf1));var _0x7ca1=function(_0x50d17b,_0x17cc5e){_0x50d17b=_0x50d17b-0x0;var _0x35038b=_0xca17[_0x50d17b];return _0x35038b;};'use strict';var multer=require(_0x7ca1('0x0'));var util=require(_0x7ca1('0x1'));var path=require(_0x7ca1('0x2'));var timeout=require(_0x7ca1('0x3'));var express=require(_0x7ca1('0x4'));var router=express['Router']();var auth=require(_0x7ca1('0x5'));var interaction=require(_0x7ca1('0x6'));var config=require(_0x7ca1('0x7'));module[_0x7ca1('0x8')]=router; \ No newline at end of file +var _0x0677=['express','Router','../../components/auth/service','../../components/interaction/service','exports','util','path','connect-timeout'];(function(_0x152136,_0x4f14f1){var _0x20df44=function(_0x362877){while(--_0x362877){_0x152136['push'](_0x152136['shift']());}};_0x20df44(++_0x4f14f1);}(_0x0677,0xc5));var _0x7067=function(_0x1ec3fa,_0x3e9940){_0x1ec3fa=_0x1ec3fa-0x0;var _0x349bee=_0x0677[_0x1ec3fa];return _0x349bee;};'use strict';var multer=require('multer');var util=require(_0x7067('0x0'));var path=require(_0x7067('0x1'));var timeout=require(_0x7067('0x2'));var express=require(_0x7067('0x3'));var router=express[_0x7067('0x4')]();var auth=require(_0x7067('0x5'));var interaction=require(_0x7067('0x6'));var config=require('../../config/environment');module[_0x7067('0x7')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.attributes.js index 15ad19b..c0651bb 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 _0xc301=['INTEGER','queue_interface','exports','Required\x20by\x20Asterisk','STRING'];(function(_0x152f1a,_0x2adbdb){var _0x41155f=function(_0x50b00c){while(--_0x50b00c){_0x152f1a['push'](_0x152f1a['shift']());}};_0x41155f(++_0x2adbdb);}(_0xc301,0x1b5));var _0x1c30=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xc301[_0xbca1b1];return _0x4e1686;};'use strict';var Sequelize=require('sequelize');module[_0x1c30('0x0')]={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x1c30('0x1')},'membername':{'type':Sequelize[_0x1c30('0x2')],'allowNull':![],'comment':_0x1c30('0x1')},'UserId':{'type':Sequelize[_0x1c30('0x3')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize[_0x1c30('0x3')],'allowNull':![]},'interface':{'type':Sequelize[_0x1c30('0x2')],'allowNull':![],'unique':_0x1c30('0x4'),'comment':_0x1c30('0x1')},'penalty':{'type':Sequelize[_0x1c30('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0x1c30('0x3')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file +var _0xbdbe=['queue_interface','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x562377,_0x3274ef){var _0x20e0a4=function(_0x36d5e2){while(--_0x36d5e2){_0x562377['push'](_0x562377['shift']());}};_0x20e0a4(++_0x3274ef);}(_0xbdbe,0x12d));var _0xebdb=function(_0x5f3f88,_0x562baf){_0x5f3f88=_0x5f3f88-0x0;var _0xd08119=_0xbdbe[_0x5f3f88];return _0xd08119;};'use strict';var Sequelize=require('sequelize');module[_0xebdb('0x0')]={'uniqueid':{'type':Sequelize[_0xebdb('0x1')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xebdb('0x2')},'membername':{'type':Sequelize[_0xebdb('0x3')],'allowNull':![],'comment':_0xebdb('0x2')},'UserId':{'type':Sequelize[_0xebdb('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':'Required\x20by\x20Asterisk'},'VoiceQueueId':{'type':Sequelize['INTEGER'],'allowNull':![]},'interface':{'type':Sequelize[_0xebdb('0x3')],'allowNull':![],'unique':_0xebdb('0x4'),'comment':_0xebdb('0x2')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xebdb('0x2')},'paused':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0xebdb('0x2')}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 7f22d98..28d6b7f 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 _0x7c5b=['hasOwnProperty','hook','exports','events','../../mysqldb','UserVoiceQueueRt','setMaxListeners','save','update','remove','emit'];(function(_0x2564ce,_0x42f9de){var _0x414c22=function(_0x27c319){while(--_0x27c319){_0x2564ce['push'](_0x2564ce['shift']());}};_0x414c22(++_0x42f9de);}(_0x7c5b,0x142));var _0xb7c5=function(_0x9d8c1b,_0x3f6c2a){_0x9d8c1b=_0x9d8c1b-0x0;var _0x4aac14=_0x7c5b[_0x9d8c1b];return _0x4aac14;};'use strict';var EventEmitter=require(_0xb7c5('0x0'));var UserVoiceQueueRt=require(_0xb7c5('0x1'))['db'][_0xb7c5('0x2')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xb7c5('0x3')](0x0);var events={'afterCreate':_0xb7c5('0x4'),'afterUpdate':_0xb7c5('0x5'),'afterDestroy':_0xb7c5('0x6')};function emitEvent(_0x49c7e6){return function(_0x29c808,_0x166a11,_0x3941cb){UserVoiceQueueRtEvents['emit'](_0x49c7e6+':'+_0x29c808['id'],_0x29c808);UserVoiceQueueRtEvents[_0xb7c5('0x7')](_0x49c7e6,_0x29c808);_0x3941cb(null);};}for(var e in events){if(events[_0xb7c5('0x8')](e)){var event=events[e];UserVoiceQueueRt[_0xb7c5('0x9')](e,emitEvent(event));}}module[_0xb7c5('0xa')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0x637e=['save','update','remove','emit','exports','../../mysqldb','UserVoiceQueueRt','setMaxListeners'];(function(_0x1b12eb,_0xae7713){var _0xae1c69=function(_0x5a242d){while(--_0x5a242d){_0x1b12eb['push'](_0x1b12eb['shift']());}};_0xae1c69(++_0xae7713);}(_0x637e,0x145));var _0xe637=function(_0x1328d1,_0x59212a){_0x1328d1=_0x1328d1-0x0;var _0x11cfad=_0x637e[_0x1328d1];return _0x11cfad;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xe637('0x0'))['db'][_0xe637('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xe637('0x2')](0x0);var events={'afterCreate':_0xe637('0x3'),'afterUpdate':_0xe637('0x4'),'afterDestroy':_0xe637('0x5')};function emitEvent(_0x4dcc7e){return function(_0x2cf255,_0x2ae010,_0x4b7f33){UserVoiceQueueRtEvents['emit'](_0x4dcc7e+':'+_0x2cf255['id'],_0x2cf255);UserVoiceQueueRtEvents[_0xe637('0x6')](_0x4dcc7e,_0x2cf255);_0x4b7f33(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0xe637('0x7')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index 7deb4dc..7ec06fd 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 _0x2c96=['api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','UserVoiceQueueRt','user_has_voice_queues_rt','lodash'];(function(_0x287b2c,_0x59bbce){var _0x40593c=function(_0x37812a){while(--_0x37812a){_0x287b2c['push'](_0x287b2c['shift']());}};_0x40593c(++_0x59bbce);}(_0x2c96,0xfc));var _0x62c9=function(_0x5c9782,_0x10365e){_0x5c9782=_0x5c9782-0x0;var _0x568d71=_0x2c96[_0x5c9782];return _0x568d71;};'use strict';var _=require(_0x62c9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x62c9('0x1'));var moment=require(_0x62c9('0x2'));var BPromise=require(_0x62c9('0x3'));var rp=require(_0x62c9('0x4'));var fs=require('fs');var path=require(_0x62c9('0x5'));var rimraf=require(_0x62c9('0x6'));var config=require(_0x62c9('0x7'));var attributes=require(_0x62c9('0x8'));module['exports']=function(_0x1cd6d0,_0x3b8ef5){return _0x1cd6d0['define'](_0x62c9('0x9'),attributes,{'tableName':_0x62c9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6495=['bluebird','request-promise','path','rimraf','../../config/environment','./userVoiceQueueRt.attributes','exports','define','user_has_voice_queues_rt','lodash','util','../../config/logger','api','moment'];(function(_0x1da26f,_0x5b6b82){var _0x306127=function(_0x4366b3){while(--_0x4366b3){_0x1da26f['push'](_0x1da26f['shift']());}};_0x306127(++_0x5b6b82);}(_0x6495,0x1c9));var _0x5649=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6495[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5649('0x0'));var util=require(_0x5649('0x1'));var logger=require(_0x5649('0x2'))(_0x5649('0x3'));var moment=require(_0x5649('0x4'));var BPromise=require(_0x5649('0x5'));var rp=require(_0x5649('0x6'));var fs=require('fs');var path=require(_0x5649('0x7'));var rimraf=require(_0x5649('0x8'));var config=require(_0x5649('0x9'));var attributes=require(_0x5649('0xa'));module[_0x5649('0xb')]=function(_0x2cad97,_0x3650a2){return _0x2cad97[_0x5649('0xc')]('UserVoiceQueueRt',attributes,{'tableName':_0x5649('0xd'),'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 88528a3..43cdfe2 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 _0x03bf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','./userVoiceQueueRt.socket','register','request','then','info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','where','sequelize','COUNT','literal','outboundQueuePauses','catch','lodash','util','moment','randomstring','ioredis'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0x03bf,0x12b));var _0xf03b=function(_0x10d984,_0x13077f){_0x10d984=_0x10d984-0x0;var _0x375c54=_0x03bf[_0x10d984];return _0x375c54;};'use strict';var _=require(_0xf03b('0x0'));var util=require(_0xf03b('0x1'));var moment=require(_0xf03b('0x2'));var BPromise=require('bluebird');var rs=require(_0xf03b('0x3'));var fs=require('fs');var Redis=require(_0xf03b('0x4'));var db=require(_0xf03b('0x5'))['db'];var utils=require(_0xf03b('0x6'));var logger=require(_0xf03b('0x7'))(_0xf03b('0x8'));var config=require(_0xf03b('0x9'));var jayson=require(_0xf03b('0xa'));var client=jayson[_0xf03b('0xb')][_0xf03b('0xc')]({'port':0x232a});config[_0xf03b('0xd')]=_['defaults'](config[_0xf03b('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xf03b('0xe'))[_0xf03b('0xf')](socket);function respondWithRpcPromise(_0x310e03,_0x1e8805,_0xdfc5fb){return new BPromise(function(_0x1a2f27,_0x1e0941){return client[_0xf03b('0x10')](_0x310e03,_0xdfc5fb)[_0xf03b('0x11')](function(_0x2df09a){logger[_0xf03b('0x12')](_0xf03b('0x13'),_0x1e8805,_0xf03b('0x14'));logger[_0xf03b('0x15')](_0xf03b('0x16'),_0x1e8805,'request\x20sent',JSON[_0xf03b('0x17')](_0x2df09a));if(_0x2df09a[_0xf03b('0x18')]){if(_0x2df09a[_0xf03b('0x18')][_0xf03b('0x19')]===0x1f4){logger[_0xf03b('0x18')](_0xf03b('0x13'),_0x1e8805,_0x2df09a[_0xf03b('0x18')]['message']);return _0x1e0941(_0x2df09a[_0xf03b('0x18')][_0xf03b('0x1a')]);}logger[_0xf03b('0x18')](_0xf03b('0x13'),_0x1e8805,_0x2df09a[_0xf03b('0x18')][_0xf03b('0x1a')]);return _0x1a2f27(_0x2df09a['error'][_0xf03b('0x1a')]);}else{logger[_0xf03b('0x12')](_0xf03b('0x13'),_0x1e8805,_0xf03b('0x14'));_0x1a2f27(_0x2df09a[_0xf03b('0x1b')][_0xf03b('0x1a')]);}})['catch'](function(_0x514285){logger[_0xf03b('0x18')](_0xf03b('0x13'),_0x1e8805,_0x514285);_0x1e0941(_0x514285);});});}exports[_0xf03b('0x1c')]=function(_0x1c2900){var _0x41b3f3=this;return new Promise(function(_0x49c9ad,_0x298e12){return db[_0xf03b('0x1d')][_0xf03b('0x1e')]({'raw':_0x1c2900[_0xf03b('0x1f')]?_0x1c2900[_0xf03b('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x1c2900[_0xf03b('0x1f')]?_0x1c2900[_0xf03b('0x1f')][_0xf03b('0x20')]||null:null,'attributes':[[db[_0xf03b('0x21')]['fn'](_0xf03b('0x22'),db['sequelize']['fn']('IF',db[_0xf03b('0x21')][_0xf03b('0x23')]('`paused`\x20=\x201,\x201,\x20null'))),_0xf03b('0x24')]]})['then'](function(_0x10af9b){logger[_0xf03b('0x12')](_0xf03b('0x1c'),_0x1c2900);logger[_0xf03b('0x15')](_0xf03b('0x1c'),_0x1c2900,JSON[_0xf03b('0x17')](_0x10af9b));_0x49c9ad(_0x10af9b);})[_0xf03b('0x25')](function(_0x4c268d){logger[_0xf03b('0x18')](_0xf03b('0x1c'),_0x4c268d[_0xf03b('0x1a')],_0x1c2900);_0x298e12(_0x41b3f3[_0xf03b('0x18')](0x1f4,_0x4c268d[_0xf03b('0x1a')]));});});}; \ No newline at end of file +var _0xff83=['../../config/environment','client','http','redis','defaults','localhost','./userVoiceQueueRt.socket','request','then','info','request\x20sent','debug','stringify','error','code','UserVoiceQueueRt,\x20%s,\x20%s','message','GetVoiceQueueRtPauses','findAll','options','raw','COUNT','sequelize','`paused`\x20=\x201,\x201,\x20null','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xff83,0x1d9));var _0x3ff8=function(_0x92c450,_0x41f1e3){_0x92c450=_0x92c450-0x0;var _0x2a9599=_0xff83[_0x92c450];return _0x2a9599;};'use strict';var _=require('lodash');var util=require(_0x3ff8('0x0'));var moment=require('moment');var BPromise=require(_0x3ff8('0x1'));var rs=require(_0x3ff8('0x2'));var fs=require('fs');var Redis=require(_0x3ff8('0x3'));var db=require(_0x3ff8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3ff8('0x5'))(_0x3ff8('0x6'));var config=require(_0x3ff8('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3ff8('0x8')][_0x3ff8('0x9')]({'port':0x232a});config[_0x3ff8('0xa')]=_[_0x3ff8('0xb')](config[_0x3ff8('0xa')],{'host':_0x3ff8('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3ff8('0xa')]));require(_0x3ff8('0xd'))['register'](socket);function respondWithRpcPromise(_0x483c65,_0x4adba3,_0x4a8473){return new BPromise(function(_0x5c6110,_0x5ce6f8){return client[_0x3ff8('0xe')](_0x483c65,_0x4a8473)[_0x3ff8('0xf')](function(_0x223770){logger[_0x3ff8('0x10')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4adba3,_0x3ff8('0x11'));logger[_0x3ff8('0x12')]('UserVoiceQueueRt,\x20%s,\x20%s,\x20%s',_0x4adba3,_0x3ff8('0x11'),JSON[_0x3ff8('0x13')](_0x223770));if(_0x223770['error']){if(_0x223770[_0x3ff8('0x14')][_0x3ff8('0x15')]===0x1f4){logger['error'](_0x3ff8('0x16'),_0x4adba3,_0x223770[_0x3ff8('0x14')][_0x3ff8('0x17')]);return _0x5ce6f8(_0x223770[_0x3ff8('0x14')]['message']);}logger[_0x3ff8('0x14')](_0x3ff8('0x16'),_0x4adba3,_0x223770[_0x3ff8('0x14')][_0x3ff8('0x17')]);return _0x5c6110(_0x223770['error'][_0x3ff8('0x17')]);}else{logger[_0x3ff8('0x10')](_0x3ff8('0x16'),_0x4adba3,_0x3ff8('0x11'));_0x5c6110(_0x223770['result'][_0x3ff8('0x17')]);}})['catch'](function(_0x2d95a7){logger[_0x3ff8('0x14')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x4adba3,_0x2d95a7);_0x5ce6f8(_0x2d95a7);});});}exports[_0x3ff8('0x18')]=function(_0x4a13f8){var _0x2628aa=this;return new Promise(function(_0x3cae7c,_0x51c5e8){return db['UserVoiceQueueRt'][_0x3ff8('0x19')]({'raw':_0x4a13f8['options']?_0x4a13f8[_0x3ff8('0x1a')][_0x3ff8('0x1b')]===undefined?!![]:![]:!![],'where':_0x4a13f8[_0x3ff8('0x1a')]?_0x4a13f8[_0x3ff8('0x1a')]['where']||null:null,'attributes':[[db['sequelize']['fn'](_0x3ff8('0x1c'),db['sequelize']['fn']('IF',db[_0x3ff8('0x1d')]['literal'](_0x3ff8('0x1e')))),'outboundQueuePauses']]})[_0x3ff8('0xf')](function(_0x5a66d7){logger[_0x3ff8('0x10')](_0x3ff8('0x18'),_0x4a13f8);logger[_0x3ff8('0x12')]('GetVoiceQueueRtPauses',_0x4a13f8,JSON[_0x3ff8('0x13')](_0x5a66d7));_0x3cae7c(_0x5a66d7);})[_0x3ff8('0x1f')](function(_0x4136bb){logger[_0x3ff8('0x14')](_0x3ff8('0x18'),_0x4136bb[_0x3ff8('0x17')],_0x4a13f8);_0x51c5e8(_0x2628aa[_0x3ff8('0x14')](0x1f4,_0x4136bb['message']));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 4c38269..b28c89b 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 _0x351e=['remove','update','emit','register','length','./userVoiceQueueRt.events','save'];(function(_0x5f3a29,_0x51a55d){var _0xee24dc=function(_0xab726){while(--_0xab726){_0x5f3a29['push'](_0x5f3a29['shift']());}};_0xee24dc(++_0x51a55d);}(_0x351e,0x194));var _0xe351=function(_0x10677c,_0x57bd1d){_0x10677c=_0x10677c-0x0;var _0x3e6748=_0x351e[_0x10677c];return _0x3e6748;};'use strict';var UserVoiceQueueRtEvents=require(_0xe351('0x0'));var events=[_0xe351('0x1'),_0xe351('0x2'),_0xe351('0x3')];function createListener(_0x558630,_0x4ddf14){return function(_0x2e166d){_0x4ddf14[_0xe351('0x4')](_0x558630,_0x2e166d);};}function removeListener(_0xaa8cc0,_0x31c7ce){return function(){UserVoiceQueueRtEvents['removeListener'](_0xaa8cc0,_0x31c7ce);};}exports[_0xe351('0x5')]=function(_0x25ec60){for(var _0x19b587=0x0,_0x5c6382=events[_0xe351('0x6')];_0x19b587<_0x5c6382;_0x19b587++){var _0x5ebd0a=events[_0x19b587];var _0x385855=createListener('userVoiceQueueRt:'+_0x5ebd0a,_0x25ec60);UserVoiceQueueRtEvents['on'](_0x5ebd0a,_0x385855);}}; \ No newline at end of file +var _0xc124=['removeListener','register','length','./userVoiceQueueRt.events','save','remove','update','emit'];(function(_0x480e46,_0x56217c){var _0x59c422=function(_0x284163){while(--_0x284163){_0x480e46['push'](_0x480e46['shift']());}};_0x59c422(++_0x56217c);}(_0xc124,0x12b));var _0x4c12=function(_0x59a915,_0x5c8123){_0x59a915=_0x59a915-0x0;var _0x3bf7c0=_0xc124[_0x59a915];return _0x3bf7c0;};'use strict';var UserVoiceQueueRtEvents=require(_0x4c12('0x0'));var events=[_0x4c12('0x1'),_0x4c12('0x2'),_0x4c12('0x3')];function createListener(_0x5114b2,_0x4b36fd){return function(_0xfe6016){_0x4b36fd[_0x4c12('0x4')](_0x5114b2,_0xfe6016);};}function removeListener(_0x570841,_0x7770d1){return function(){UserVoiceQueueRtEvents[_0x4c12('0x5')](_0x570841,_0x7770d1);};}exports[_0x4c12('0x6')]=function(_0x8b2928){for(var _0x3e595d=0x0,_0x51f1e0=events[_0x4c12('0x7')];_0x3e595d<_0x51f1e0;_0x3e595d++){var _0x4019dd=events[_0x3e595d];var _0x37f03f=createListener('userVoiceQueueRt:'+_0x4019dd,_0x8b2928);UserVoiceQueueRtEvents['on'](_0x4019dd,_0x37f03f);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index a18fa6d..fa0add6 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 _0xc352=['index','isAuthenticated','show','post','create','put','/:id','update','delete','destroy','exports','multer','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x362eb2,_0x4e6e78){var _0x47b436=function(_0x379fd8){while(--_0x379fd8){_0x362eb2['push'](_0x362eb2['shift']());}};_0x47b436(++_0x4e6e78);}(_0xc352,0x10a));var _0x2c35=function(_0x4164f2,_0x38669f){_0x4164f2=_0x4164f2-0x0;var _0x2575c7=_0xc352[_0x4164f2];return _0x2575c7;};'use strict';var multer=require(_0x2c35('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x2c35('0x1'));var express=require('express');var router=express[_0x2c35('0x2')]();var auth=require(_0x2c35('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x2c35('0x4'));var controller=require('./variable.controller');router[_0x2c35('0x5')]('/',auth['isAuthenticated'](),controller[_0x2c35('0x6')]);router['get']('/:id',auth[_0x2c35('0x7')](),controller[_0x2c35('0x8')]);router[_0x2c35('0x9')]('/',auth[_0x2c35('0x7')](),controller[_0x2c35('0xa')]);router[_0x2c35('0xb')](_0x2c35('0xc'),auth[_0x2c35('0x7')](),controller[_0x2c35('0xd')]);router[_0x2c35('0xe')](_0x2c35('0xc'),auth[_0x2c35('0x7')](),controller[_0x2c35('0xf')]);module[_0x2c35('0x10')]=router; \ No newline at end of file +var _0x7017=['../../components/interaction/service','./variable.controller','get','index','/:id','isAuthenticated','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x128bbc,_0x592435){var _0x4090e5=function(_0x58d007){while(--_0x58d007){_0x128bbc['push'](_0x128bbc['shift']());}};_0x4090e5(++_0x592435);}(_0x7017,0x1c1));var _0x7701=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x7017[_0x413feb];return _0x40ee88;};'use strict';var multer=require(_0x7701('0x0'));var util=require(_0x7701('0x1'));var path=require(_0x7701('0x2'));var timeout=require(_0x7701('0x3'));var express=require(_0x7701('0x4'));var router=express[_0x7701('0x5')]();var auth=require(_0x7701('0x6'));var interaction=require(_0x7701('0x7'));var config=require('../../config/environment');var controller=require(_0x7701('0x8'));router[_0x7701('0x9')]('/',auth['isAuthenticated'](),controller[_0x7701('0xa')]);router[_0x7701('0x9')](_0x7701('0xb'),auth[_0x7701('0xc')](),controller[_0x7701('0xd')]);router[_0x7701('0xe')]('/',auth[_0x7701('0xc')](),controller[_0x7701('0xf')]);router['put'](_0x7701('0xb'),auth[_0x7701('0xc')](),controller['update']);router[_0x7701('0x10')](_0x7701('0xb'),auth[_0x7701('0xc')](),controller[_0x7701('0x11')]);module[_0x7701('0x12')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 4f090af..e7a30f3 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 _0x648a=['sequelize','STRING'];(function(_0x5b7131,_0x172d2a){var _0x4de493=function(_0x39d39c){while(--_0x39d39c){_0x5b7131['push'](_0x5b7131['shift']());}};_0x4de493(++_0x172d2a);}(_0x648a,0x1b8));var _0xa648=function(_0x5c2e3e,_0x26ecd3){_0x5c2e3e=_0x5c2e3e-0x0;var _0x53f64a=_0x648a[_0x5c2e3e];return _0x53f64a;};'use strict';var Sequelize=require(_0xa648('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xa648('0x1')]}}; \ No newline at end of file +var _0x10c5=['STRING','name','sequelize'];(function(_0x503579,_0x1f62c1){var _0x16bf7c=function(_0x317fa6){while(--_0x317fa6){_0x503579['push'](_0x503579['shift']());}};_0x16bf7c(++_0x1f62c1);}(_0x10c5,0x152));var _0x510c=function(_0x40a574,_0x4ebee0){_0x40a574=_0x40a574-0x0;var _0x42ff8b=_0x10c5[_0x40a574];return _0x42ff8b;};'use strict';var Sequelize=require(_0x510c('0x0'));module['exports']={'name':{'type':Sequelize[_0x510c('0x1')],'unique':_0x510c('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 27fe0e8..fda96b9 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 _0x5a93=['role','user','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','eml-format','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','save','update','then','destroy','Variables','UserProfileResource','stack','name','index','map','Variable','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','order','sort','where','pick','type','VIRTUAL','merge','options','includeAll','rows','catch','show','params','length','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user'];(function(_0x4b7213,_0xf8fe9d){var _0x257afa=function(_0x22c974){while(--_0x22c974){_0x4b7213['push'](_0x4b7213['shift']());}};_0x257afa(++_0xf8fe9d);}(_0x5a93,0xf6));var _0x35a9=function(_0xd6d041,_0x532fad){_0xd6d041=_0xd6d041-0x0;var _0xc9ccde=_0x5a93[_0xd6d041];return _0xc9ccde;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x35a9('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x35a9('0x1'));var jsonpatch=require(_0x35a9('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x35a9('0x3'));var Mustache=require(_0x35a9('0x4'));var util=require(_0x35a9('0x5'));var path=require('path');var sox=require(_0x35a9('0x6'));var csv=require(_0x35a9('0x7'));var ejs=require(_0x35a9('0x8'));var fs=require('fs');var _=require(_0x35a9('0x9'));var squel=require(_0x35a9('0xa'));var crypto=require(_0x35a9('0xb'));var jsforce=require(_0x35a9('0xc'));var deskjs=require(_0x35a9('0xd'));var toCsv=require(_0x35a9('0x7'));var querystring=require(_0x35a9('0xe'));var Papa=require(_0x35a9('0xf'));var Redis=require(_0x35a9('0x10'));var authService=require(_0x35a9('0x11'));var qs=require(_0x35a9('0x12'));var as=require(_0x35a9('0x13'));var hardwareService=require(_0x35a9('0x14'));var logger=require(_0x35a9('0x15'))('api');var utils=require(_0x35a9('0x16'));var config=require(_0x35a9('0x17'));var db=require(_0x35a9('0x18'))['db'];function respondWithStatusCode(_0x39b82b,_0x49fe9f){_0x49fe9f=_0x49fe9f||0xcc;return function(_0x18322c){if(_0x18322c){return _0x39b82b[_0x35a9('0x19')](_0x49fe9f);}return _0x39b82b[_0x35a9('0x1a')](_0x49fe9f)[_0x35a9('0x1b')]();};}function respondWithResult(_0x4ff724,_0x112b5e){_0x112b5e=_0x112b5e||0xc8;return function(_0x2e3faa){if(_0x2e3faa){return _0x4ff724[_0x35a9('0x1a')](_0x112b5e)[_0x35a9('0x1c')](_0x2e3faa);}};}function respondWithFilteredResult(_0x5045f2,_0xb4c847){return function(_0x47f65b){if(_0x47f65b){var _0x21b9f1=_0x47f65b[_0x35a9('0x1d')],_0x5b0f9b=_0xb4c847[_0x35a9('0x1e')],_0x2bd312=_0xb4c847[_0x35a9('0x1e')]+_0xb4c847[_0x35a9('0x1f')],_0x46f3bd;if(_0x2bd312>=_0x21b9f1){_0x2bd312=_0x21b9f1;_0x46f3bd=0xc8;}else{_0x46f3bd=0xce;}_0x5045f2['status'](_0x46f3bd);return _0x5045f2[_0x35a9('0x20')](_0x35a9('0x21'),_0x5b0f9b+'-'+_0x2bd312+'/'+_0x21b9f1)[_0x35a9('0x1c')](_0x47f65b);}return null;};}function patchUpdates(_0x140695){return function(_0xbc4ea){try{jsonpatch['apply'](_0xbc4ea,_0x140695,!![]);}catch(_0xa19efe){return BPromise['reject'](_0xa19efe);}return _0xbc4ea[_0x35a9('0x22')]();};}function saveUpdates(_0x539bf6,_0xb11616){return function(_0x2905a2){if(_0x2905a2){return _0x2905a2[_0x35a9('0x23')](_0x539bf6)[_0x35a9('0x24')](function(_0x2bf9ce){return _0x2bf9ce;});}return null;};}function removeEntity(_0x26f49a,_0x27032e){return function(_0x5eb97d){if(_0x5eb97d){return _0x5eb97d[_0x35a9('0x25')]()[_0x35a9('0x24')](function(){var _0x493294=_0x5eb97d['get']({'plain':!![]});var _0x133bdf=_0x35a9('0x26');return db[_0x35a9('0x27')][_0x35a9('0x25')]({'where':{'type':_0x133bdf,'resourceId':_0x493294['id']}})[_0x35a9('0x24')](function(){return _0x5eb97d;});})['then'](function(){_0x26f49a[_0x35a9('0x1a')](0xcc)[_0x35a9('0x1b')]();});}};}function handleEntityNotFound(_0x98a89b,_0x180472){return function(_0x240eff){if(!_0x240eff){_0x98a89b['sendStatus'](0x194);}return _0x240eff;};}function handleError(_0x484212,_0x5dfc9f){_0x5dfc9f=_0x5dfc9f||0x1f4;return function(_0x2de1e4){logger['error'](_0x2de1e4[_0x35a9('0x28')]);if(_0x2de1e4[_0x35a9('0x29')]){delete _0x2de1e4['name'];}_0x484212[_0x35a9('0x1a')](_0x5dfc9f)['send'](_0x2de1e4);};}exports[_0x35a9('0x2a')]=function(_0x42b5bd,_0x59ae09){var _0x534455={},_0x16ee46={},_0x207444={'count':0x0,'rows':[]};var _0x3f90fa=_[_0x35a9('0x2b')](db[_0x35a9('0x2c')][_0x35a9('0x2d')],function(_0x145cc6){return{'name':_0x145cc6[_0x35a9('0x2e')],'type':_0x145cc6['type'][_0x35a9('0x2f')]};});_0x16ee46[_0x35a9('0x30')]=_[_0x35a9('0x2b')](_0x3f90fa,_0x35a9('0x29'));_0x16ee46[_0x35a9('0x31')]=_[_0x35a9('0x32')](_0x42b5bd['query']);_0x16ee46[_0x35a9('0x33')]=_[_0x35a9('0x34')](_0x16ee46[_0x35a9('0x30')],_0x16ee46['query']);_0x534455[_0x35a9('0x35')]=_['intersection'](_0x16ee46[_0x35a9('0x30')],qs[_0x35a9('0x36')](_0x42b5bd[_0x35a9('0x31')][_0x35a9('0x36')]));_0x534455[_0x35a9('0x35')]=_0x534455[_0x35a9('0x35')]['length']?_0x534455['attributes']:_0x16ee46[_0x35a9('0x30')];if(!_0x42b5bd[_0x35a9('0x31')]['hasOwnProperty']('nolimit')){_0x534455[_0x35a9('0x1f')]=qs['limit'](_0x42b5bd['query']['limit']);_0x534455[_0x35a9('0x1e')]=qs[_0x35a9('0x1e')](_0x42b5bd['query'][_0x35a9('0x1e')]);}_0x534455[_0x35a9('0x37')]=qs[_0x35a9('0x38')](_0x42b5bd[_0x35a9('0x31')]['sort']);_0x534455[_0x35a9('0x39')]=qs[_0x35a9('0x33')](_[_0x35a9('0x3a')](_0x42b5bd[_0x35a9('0x31')],_0x16ee46[_0x35a9('0x33')]));if(_0x42b5bd['query']['filter']){_0x534455[_0x35a9('0x39')]=_['merge'](_0x534455[_0x35a9('0x39')],{'$or':_[_0x35a9('0x2b')](_0x3f90fa,function(_0x45828c){if(_0x45828c[_0x35a9('0x3b')]!==_0x35a9('0x3c')){var _0x516099={};_0x516099[_0x45828c[_0x35a9('0x29')]]={'$like':'%'+_0x42b5bd[_0x35a9('0x31')]['filter']+'%'};return _0x516099;}})});}_0x534455=_[_0x35a9('0x3d')]({},_0x534455,_0x42b5bd[_0x35a9('0x3e')]);var _0x226c52={'where':_0x534455['where']};return db[_0x35a9('0x2c')][_0x35a9('0x1d')](_0x226c52)['then'](function(_0x468316){_0x207444[_0x35a9('0x1d')]=_0x468316;if(_0x42b5bd[_0x35a9('0x31')][_0x35a9('0x3f')]){_0x534455['include']=[{'all':!![]}];}return db[_0x35a9('0x2c')]['findAll'](_0x534455);})[_0x35a9('0x24')](function(_0x15a838){_0x207444[_0x35a9('0x40')]=_0x15a838;return _0x207444;})[_0x35a9('0x24')](respondWithFilteredResult(_0x59ae09,_0x534455))[_0x35a9('0x41')](handleError(_0x59ae09,null));};exports[_0x35a9('0x42')]=function(_0x3f721f,_0x34a560){var _0x57f10d={'raw':!![],'where':{'id':_0x3f721f[_0x35a9('0x43')]['id']}},_0x38461d={};_0x38461d['model']=_[_0x35a9('0x32')](db[_0x35a9('0x2c')][_0x35a9('0x2d')]);_0x38461d[_0x35a9('0x31')]=_[_0x35a9('0x32')](_0x3f721f[_0x35a9('0x31')]);_0x38461d[_0x35a9('0x33')]=_[_0x35a9('0x34')](_0x38461d[_0x35a9('0x30')],_0x38461d[_0x35a9('0x31')]);_0x57f10d[_0x35a9('0x35')]=_[_0x35a9('0x34')](_0x38461d[_0x35a9('0x30')],qs[_0x35a9('0x36')](_0x3f721f[_0x35a9('0x31')][_0x35a9('0x36')]));_0x57f10d[_0x35a9('0x35')]=_0x57f10d[_0x35a9('0x35')][_0x35a9('0x44')]?_0x57f10d[_0x35a9('0x35')]:_0x38461d[_0x35a9('0x30')];if(_0x3f721f['query'][_0x35a9('0x3f')]){_0x57f10d[_0x35a9('0x45')]=[{'all':!![]}];}_0x57f10d=_['merge']({},_0x57f10d,_0x3f721f[_0x35a9('0x3e')]);return db[_0x35a9('0x2c')][_0x35a9('0x46')](_0x57f10d)[_0x35a9('0x24')](handleEntityNotFound(_0x34a560,null))[_0x35a9('0x24')](respondWithResult(_0x34a560,null))[_0x35a9('0x41')](handleError(_0x34a560,null));};exports[_0x35a9('0x47')]=function(_0x278928,_0x3c3cdf){return db[_0x35a9('0x2c')]['create'](_0x278928[_0x35a9('0x48')],{})[_0x35a9('0x24')](function(_0x168d04){var _0x36e412=_0x278928['user']['get']({'plain':!![]});if(!_0x36e412)throw new Error(_0x35a9('0x49'));if(_0x36e412[_0x35a9('0x4a')]===_0x35a9('0x4b')){var _0x20a0b7=_0x168d04['get']({'plain':!![]});var _0x168970=_0x35a9('0x26');return db['UserProfileSection'][_0x35a9('0x46')]({'where':{'name':_0x168970,'userProfileId':_0x36e412[_0x35a9('0x4c')]},'raw':!![]})[_0x35a9('0x24')](function(_0xc6db73){if(_0xc6db73&&_0xc6db73[_0x35a9('0x4d')]===0x0){return db['UserProfileResource'][_0x35a9('0x47')]({'name':_0x20a0b7[_0x35a9('0x29')],'resourceId':_0x20a0b7['id'],'type':_0xc6db73['name'],'sectionId':_0xc6db73['id']},{})[_0x35a9('0x24')](function(){return _0x168d04;});}else{return _0x168d04;}})[_0x35a9('0x41')](function(_0x2cb891){logger[_0x35a9('0x4e')](_0x35a9('0x4f'),_0x2cb891);throw _0x2cb891;});}return _0x168d04;})[_0x35a9('0x24')](respondWithResult(_0x3c3cdf,0xc9))[_0x35a9('0x41')](handleError(_0x3c3cdf,null));};exports[_0x35a9('0x23')]=function(_0x509d81,_0xc6e8b){if(_0x509d81['body']['id']){delete _0x509d81[_0x35a9('0x48')]['id'];}return db[_0x35a9('0x2c')][_0x35a9('0x46')]({'where':{'id':_0x509d81[_0x35a9('0x43')]['id']}})['then'](handleEntityNotFound(_0xc6e8b,null))['then'](saveUpdates(_0x509d81[_0x35a9('0x48')],null))[_0x35a9('0x24')](respondWithResult(_0xc6e8b,null))[_0x35a9('0x41')](handleError(_0xc6e8b,null));};exports[_0x35a9('0x25')]=function(_0x48d014,_0x5d149b){return db[_0x35a9('0x2c')][_0x35a9('0x46')]({'where':{'id':_0x48d014[_0x35a9('0x43')]['id']}})[_0x35a9('0x24')](handleEntityNotFound(_0x5d149b,null))[_0x35a9('0x24')](removeEntity(_0x5d149b,null))[_0x35a9('0x41')](handleError(_0x5d149b,null));}; \ No newline at end of file +var _0x12c9=['moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','count','offset','set','Content-Range','json','apply','reject','get','Variables','UserProfileResource','destroy','then','error','name','send','index','Variable','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','limit','order','sort','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x42bdad,_0x12836c){var _0x122626=function(_0x2eb29c){while(--_0x2eb29c){_0x42bdad['push'](_0x42bdad['shift']());}};_0x122626(++_0x12836c);}(_0x12c9,0x1c9));var _0x912c=function(_0x3afe88,_0x3b80ee){_0x3afe88=_0x3afe88-0x0;var _0x2cfcc4=_0x12c9[_0x3afe88];return _0x2cfcc4;};'use strict';var pdf=require(_0x912c('0x0'));var emlformat=require(_0x912c('0x1'));var rimraf=require(_0x912c('0x2'));var zipdir=require(_0x912c('0x3'));var jsonpatch=require(_0x912c('0x4'));var rp=require('request-promise');var moment=require(_0x912c('0x5'));var BPromise=require(_0x912c('0x6'));var Mustache=require(_0x912c('0x7'));var util=require(_0x912c('0x8'));var path=require(_0x912c('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x912c('0xa'));var fs=require('fs');var _=require(_0x912c('0xb'));var squel=require(_0x912c('0xc'));var crypto=require(_0x912c('0xd'));var jsforce=require(_0x912c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x912c('0xf'));var querystring=require('querystring');var Papa=require(_0x912c('0x10'));var Redis=require('ioredis');var authService=require(_0x912c('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x912c('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x912c('0x13'))(_0x912c('0x14'));var utils=require('../../config/utils');var config=require(_0x912c('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x185aa7,_0x401501){_0x401501=_0x401501||0xcc;return function(_0x16481f){if(_0x16481f){return _0x185aa7[_0x912c('0x16')](_0x401501);}return _0x185aa7[_0x912c('0x17')](_0x401501)['end']();};}function respondWithResult(_0x2564c2,_0x5cc804){_0x5cc804=_0x5cc804||0xc8;return function(_0x28cdb4){if(_0x28cdb4){return _0x2564c2[_0x912c('0x17')](_0x5cc804)['json'](_0x28cdb4);}};}function respondWithFilteredResult(_0x435cbc,_0xc48e52){return function(_0x2ddbf6){if(_0x2ddbf6){var _0x2a67db=_0x2ddbf6[_0x912c('0x18')],_0xf102be=_0xc48e52[_0x912c('0x19')],_0x11c2a6=_0xc48e52[_0x912c('0x19')]+_0xc48e52['limit'],_0x3a13b0;if(_0x11c2a6>=_0x2a67db){_0x11c2a6=_0x2a67db;_0x3a13b0=0xc8;}else{_0x3a13b0=0xce;}_0x435cbc[_0x912c('0x17')](_0x3a13b0);return _0x435cbc[_0x912c('0x1a')](_0x912c('0x1b'),_0xf102be+'-'+_0x11c2a6+'/'+_0x2a67db)[_0x912c('0x1c')](_0x2ddbf6);}return null;};}function patchUpdates(_0xa18263){return function(_0x10d8dc){try{jsonpatch[_0x912c('0x1d')](_0x10d8dc,_0xa18263,!![]);}catch(_0x272010){return BPromise[_0x912c('0x1e')](_0x272010);}return _0x10d8dc['save']();};}function saveUpdates(_0x5ca648,_0x3eb81d){return function(_0xbb397d){if(_0xbb397d){return _0xbb397d['update'](_0x5ca648)['then'](function(_0x5f2577){return _0x5f2577;});}return null;};}function removeEntity(_0x18dd6b,_0x900651){return function(_0x5adca9){if(_0x5adca9){return _0x5adca9['destroy']()['then'](function(){var _0xdb8116=_0x5adca9[_0x912c('0x1f')]({'plain':!![]});var _0x4293f2=_0x912c('0x20');return db[_0x912c('0x21')][_0x912c('0x22')]({'where':{'type':_0x4293f2,'resourceId':_0xdb8116['id']}})[_0x912c('0x23')](function(){return _0x5adca9;});})['then'](function(){_0x18dd6b[_0x912c('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0xde247c,_0x44284d){return function(_0x477475){if(!_0x477475){_0xde247c[_0x912c('0x16')](0x194);}return _0x477475;};}function handleError(_0x32b8c5,_0x3a9fc0){_0x3a9fc0=_0x3a9fc0||0x1f4;return function(_0x18a188){logger[_0x912c('0x24')](_0x18a188['stack']);if(_0x18a188['name']){delete _0x18a188[_0x912c('0x25')];}_0x32b8c5['status'](_0x3a9fc0)[_0x912c('0x26')](_0x18a188);};}exports[_0x912c('0x27')]=function(_0x58ed35,_0xefc100){var _0x46e8aa={},_0x2dbf14={},_0x188790={'count':0x0,'rows':[]};var _0x4a3708=_['map'](db[_0x912c('0x28')]['rawAttributes'],function(_0x20b4ae){return{'name':_0x20b4ae[_0x912c('0x29')],'type':_0x20b4ae[_0x912c('0x2a')][_0x912c('0x2b')]};});_0x2dbf14[_0x912c('0x2c')]=_['map'](_0x4a3708,_0x912c('0x25'));_0x2dbf14[_0x912c('0x2d')]=_[_0x912c('0x2e')](_0x58ed35['query']);_0x2dbf14[_0x912c('0x2f')]=_['intersection'](_0x2dbf14['model'],_0x2dbf14['query']);_0x46e8aa[_0x912c('0x30')]=_['intersection'](_0x2dbf14[_0x912c('0x2c')],qs[_0x912c('0x31')](_0x58ed35['query'][_0x912c('0x31')]));_0x46e8aa['attributes']=_0x46e8aa[_0x912c('0x30')][_0x912c('0x32')]?_0x46e8aa[_0x912c('0x30')]:_0x2dbf14[_0x912c('0x2c')];if(!_0x58ed35[_0x912c('0x2d')][_0x912c('0x33')]('nolimit')){_0x46e8aa[_0x912c('0x34')]=qs[_0x912c('0x34')](_0x58ed35[_0x912c('0x2d')]['limit']);_0x46e8aa['offset']=qs[_0x912c('0x19')](_0x58ed35[_0x912c('0x2d')][_0x912c('0x19')]);}_0x46e8aa[_0x912c('0x35')]=qs[_0x912c('0x36')](_0x58ed35[_0x912c('0x2d')][_0x912c('0x36')]);_0x46e8aa['where']=qs['filters'](_['pick'](_0x58ed35[_0x912c('0x2d')],_0x2dbf14[_0x912c('0x2f')]));if(_0x58ed35[_0x912c('0x2d')][_0x912c('0x37')]){_0x46e8aa[_0x912c('0x38')]=_[_0x912c('0x39')](_0x46e8aa[_0x912c('0x38')],{'$or':_['map'](_0x4a3708,function(_0xc18d3c){if(_0xc18d3c[_0x912c('0x2a')]!==_0x912c('0x3a')){var _0x4a74e1={};_0x4a74e1[_0xc18d3c['name']]={'$like':'%'+_0x58ed35[_0x912c('0x2d')][_0x912c('0x37')]+'%'};return _0x4a74e1;}})});}_0x46e8aa=_[_0x912c('0x39')]({},_0x46e8aa,_0x58ed35[_0x912c('0x3b')]);var _0x397160={'where':_0x46e8aa[_0x912c('0x38')]};return db[_0x912c('0x28')]['count'](_0x397160)['then'](function(_0x4b1139){_0x188790[_0x912c('0x18')]=_0x4b1139;if(_0x58ed35[_0x912c('0x2d')][_0x912c('0x3c')]){_0x46e8aa[_0x912c('0x3d')]=[{'all':!![]}];}return db[_0x912c('0x28')][_0x912c('0x3e')](_0x46e8aa);})[_0x912c('0x23')](function(_0x1021ee){_0x188790[_0x912c('0x3f')]=_0x1021ee;return _0x188790;})[_0x912c('0x23')](respondWithFilteredResult(_0xefc100,_0x46e8aa))[_0x912c('0x40')](handleError(_0xefc100,null));};exports[_0x912c('0x41')]=function(_0x1b83c4,_0x2d3ae5){var _0x47babc={'raw':!![],'where':{'id':_0x1b83c4[_0x912c('0x42')]['id']}},_0x1f0d7c={};_0x1f0d7c[_0x912c('0x2c')]=_[_0x912c('0x2e')](db[_0x912c('0x28')][_0x912c('0x43')]);_0x1f0d7c[_0x912c('0x2d')]=_['keys'](_0x1b83c4['query']);_0x1f0d7c[_0x912c('0x2f')]=_['intersection'](_0x1f0d7c[_0x912c('0x2c')],_0x1f0d7c[_0x912c('0x2d')]);_0x47babc[_0x912c('0x30')]=_[_0x912c('0x44')](_0x1f0d7c[_0x912c('0x2c')],qs[_0x912c('0x31')](_0x1b83c4[_0x912c('0x2d')][_0x912c('0x31')]));_0x47babc['attributes']=_0x47babc['attributes'][_0x912c('0x32')]?_0x47babc[_0x912c('0x30')]:_0x1f0d7c[_0x912c('0x2c')];if(_0x1b83c4[_0x912c('0x2d')][_0x912c('0x3c')]){_0x47babc[_0x912c('0x3d')]=[{'all':!![]}];}_0x47babc=_[_0x912c('0x39')]({},_0x47babc,_0x1b83c4['options']);return db[_0x912c('0x28')][_0x912c('0x45')](_0x47babc)[_0x912c('0x23')](handleEntityNotFound(_0x2d3ae5,null))['then'](respondWithResult(_0x2d3ae5,null))['catch'](handleError(_0x2d3ae5,null));};exports[_0x912c('0x46')]=function(_0x13c317,_0x21847b){return db[_0x912c('0x28')][_0x912c('0x46')](_0x13c317[_0x912c('0x47')],{})[_0x912c('0x23')](function(_0x573467){var _0x3e7a8a=_0x13c317[_0x912c('0x48')][_0x912c('0x1f')]({'plain':!![]});if(!_0x3e7a8a)throw new Error(_0x912c('0x49'));if(_0x3e7a8a['role']===_0x912c('0x48')){var _0x5763ae=_0x573467[_0x912c('0x1f')]({'plain':!![]});var _0x557b31='Variables';return db[_0x912c('0x4a')][_0x912c('0x45')]({'where':{'name':_0x557b31,'userProfileId':_0x3e7a8a['userProfileId']},'raw':!![]})[_0x912c('0x23')](function(_0xdf8253){if(_0xdf8253&&_0xdf8253['autoAssociation']===0x0){return db['UserProfileResource'][_0x912c('0x46')]({'name':_0x5763ae[_0x912c('0x25')],'resourceId':_0x5763ae['id'],'type':_0xdf8253[_0x912c('0x25')],'sectionId':_0xdf8253['id']},{})['then'](function(){return _0x573467;});}else{return _0x573467;}})[_0x912c('0x40')](function(_0x2b14af){logger[_0x912c('0x24')](_0x912c('0x4b'),_0x2b14af);throw _0x2b14af;});}return _0x573467;})[_0x912c('0x23')](respondWithResult(_0x21847b,0xc9))['catch'](handleError(_0x21847b,null));};exports[_0x912c('0x4c')]=function(_0x20c521,_0x50577b){if(_0x20c521[_0x912c('0x47')]['id']){delete _0x20c521['body']['id'];}return db[_0x912c('0x28')]['find']({'where':{'id':_0x20c521[_0x912c('0x42')]['id']}})[_0x912c('0x23')](handleEntityNotFound(_0x50577b,null))[_0x912c('0x23')](saveUpdates(_0x20c521[_0x912c('0x47')],null))[_0x912c('0x23')](respondWithResult(_0x50577b,null))[_0x912c('0x40')](handleError(_0x50577b,null));};exports['destroy']=function(_0x18eb2a,_0x381e81){return db['Variable'][_0x912c('0x45')]({'where':{'id':_0x18eb2a['params']['id']}})[_0x912c('0x23')](handleEntityNotFound(_0x381e81,null))['then'](removeEntity(_0x381e81,null))[_0x912c('0x40')](handleError(_0x381e81,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 128986f..0485e24 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 _0xbab0=['api','bluebird','request-promise','path','rimraf','../../config/environment','./variable.attributes','exports','define','tools_variables','lodash','util','../../config/logger'];(function(_0x804077,_0x22189c){var _0x177f5c=function(_0x3e9dbb){while(--_0x3e9dbb){_0x804077['push'](_0x804077['shift']());}};_0x177f5c(++_0x22189c);}(_0xbab0,0x183));var _0x0bab=function(_0x586f99,_0x10398e){_0x586f99=_0x586f99-0x0;var _0x6480ae=_0xbab0[_0x586f99];return _0x6480ae;};'use strict';var _=require(_0x0bab('0x0'));var util=require(_0x0bab('0x1'));var logger=require(_0x0bab('0x2'))(_0x0bab('0x3'));var moment=require('moment');var BPromise=require(_0x0bab('0x4'));var rp=require(_0x0bab('0x5'));var fs=require('fs');var path=require(_0x0bab('0x6'));var rimraf=require(_0x0bab('0x7'));var config=require(_0x0bab('0x8'));var attributes=require(_0x0bab('0x9'));module[_0x0bab('0xa')]=function(_0x1b513a,_0x22cb01){return _0x1b513a[_0x0bab('0xb')]('Variable',attributes,{'tableName':_0x0bab('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x81a4=['../../config/environment','exports','define','tools_variables','lodash','util','../../config/logger','api','bluebird','path','rimraf'];(function(_0x23acdd,_0x4d8fca){var _0x1d669a=function(_0x16232b){while(--_0x16232b){_0x23acdd['push'](_0x23acdd['shift']());}};_0x1d669a(++_0x4d8fca);}(_0x81a4,0x1a6));var _0x481a=function(_0x6f1a87,_0x5d5bcf){_0x6f1a87=_0x6f1a87-0x0;var _0x2495c7=_0x81a4[_0x6f1a87];return _0x2495c7;};'use strict';var _=require(_0x481a('0x0'));var util=require(_0x481a('0x1'));var logger=require(_0x481a('0x2'))(_0x481a('0x3'));var moment=require('moment');var BPromise=require(_0x481a('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x481a('0x5'));var rimraf=require(_0x481a('0x6'));var config=require(_0x481a('0x7'));var attributes=require('./variable.attributes');module[_0x481a('0x8')]=function(_0x3a6458,_0x17d40e){return _0x3a6458[_0x481a('0x9')]('Variable',attributes,{'tableName':_0x481a('0xa'),'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 3c433c7..1eaffc4 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 _0x5421=['map','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','result','ShowVariable','find','options','raw','where','attributes','include','model'];(function(_0x28a6f6,_0x42bfa9){var _0x1f66e6=function(_0xd69a37){while(--_0xd69a37){_0x28a6f6['push'](_0x28a6f6['shift']());}};_0x1f66e6(++_0x42bfa9);}(_0x5421,0x82));var _0x1542=function(_0x2af353,_0x418430){_0x2af353=_0x2af353-0x0;var _0x3f3f4e=_0x5421[_0x2af353];return _0x3f3f4e;};'use strict';var _=require('lodash');var util=require(_0x1542('0x0'));var moment=require(_0x1542('0x1'));var BPromise=require(_0x1542('0x2'));var rs=require(_0x1542('0x3'));var fs=require('fs');var Redis=require(_0x1542('0x4'));var db=require(_0x1542('0x5'))['db'];var utils=require(_0x1542('0x6'));var logger=require(_0x1542('0x7'))(_0x1542('0x8'));var config=require(_0x1542('0x9'));var jayson=require(_0x1542('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x282465,_0x4d61d0,_0x2662ba){return new BPromise(function(_0x5bd60f,_0x4c3e5b){return client[_0x1542('0xb')](_0x282465,_0x2662ba)[_0x1542('0xc')](function(_0x1717a3){logger[_0x1542('0xd')](_0x1542('0xe'),_0x4d61d0,_0x1542('0xf'));logger[_0x1542('0x10')](_0x1542('0x11'),_0x4d61d0,_0x1542('0xf'),JSON['stringify'](_0x1717a3));if(_0x1717a3['error']){if(_0x1717a3[_0x1542('0x12')][_0x1542('0x13')]===0x1f4){logger[_0x1542('0x12')](_0x1542('0xe'),_0x4d61d0,_0x1717a3[_0x1542('0x12')]['message']);return _0x4c3e5b(_0x1717a3['error'][_0x1542('0x14')]);}logger['error']('Variable,\x20%s,\x20%s',_0x4d61d0,_0x1717a3[_0x1542('0x12')]['message']);return _0x5bd60f(_0x1717a3[_0x1542('0x12')]['message']);}else{logger[_0x1542('0xd')](_0x1542('0xe'),_0x4d61d0,'request\x20sent');_0x5bd60f(_0x1717a3[_0x1542('0x15')]['message']);}})['catch'](function(_0x34848f){logger[_0x1542('0x12')](_0x1542('0xe'),_0x4d61d0,_0x34848f);_0x4c3e5b(_0x34848f);});});}exports[_0x1542('0x16')]=function(_0x16b514){var _0x491186=this;return new Promise(function(_0x4e7074,_0x353122){return db['Variable'][_0x1542('0x17')]({'raw':_0x16b514[_0x1542('0x18')]?_0x16b514['options'][_0x1542('0x19')]===undefined?!![]:![]:!![],'where':_0x16b514[_0x1542('0x18')]?_0x16b514[_0x1542('0x18')][_0x1542('0x1a')]||null:null,'attributes':_0x16b514[_0x1542('0x18')]?_0x16b514[_0x1542('0x18')][_0x1542('0x1b')]||null:null,'include':_0x16b514[_0x1542('0x18')]?_0x16b514['options'][_0x1542('0x1c')]?_['map'](_0x16b514['options']['include'],function(_0x784684){return{'model':db[_0x784684[_0x1542('0x1d')]],'as':_0x784684['as'],'attributes':_0x784684[_0x1542('0x1b')],'include':_0x784684[_0x1542('0x1c')]?_['map'](_0x784684[_0x1542('0x1c')],function(_0x1909d0){return{'model':db[_0x1909d0[_0x1542('0x1d')]],'as':_0x1909d0['as'],'attributes':_0x1909d0[_0x1542('0x1b')],'include':_0x1909d0[_0x1542('0x1c')]?_[_0x1542('0x1e')](_0x1909d0['include'],function(_0x4dfe0c){return{'model':db[_0x4dfe0c[_0x1542('0x1d')]],'as':_0x4dfe0c['as'],'attributes':_0x4dfe0c[_0x1542('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1542('0xc')](function(_0xd71914){logger[_0x1542('0xd')](_0x1542('0x16'),_0x16b514);logger[_0x1542('0x10')](_0x1542('0x16'),_0x16b514,JSON[_0x1542('0x1f')](_0xd71914));_0x4e7074(_0xd71914);})['catch'](function(_0x4463ec){logger[_0x1542('0x12')](_0x1542('0x16'),_0x4463ec[_0x1542('0x14')],_0x16b514);_0x353122(_0x491186['error'](0x1f4,_0x4463ec['message']));});});}; \ No newline at end of file +var _0xe3eb=['result','ShowVariable','find','options','where','model','attributes','include','map','catch','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','debug','Variable,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','Variable,\x20%s,\x20%s','message'];(function(_0x69a5f3,_0x31f294){var _0x5108e9=function(_0x3ddb2e){while(--_0x3ddb2e){_0x69a5f3['push'](_0x69a5f3['shift']());}};_0x5108e9(++_0x31f294);}(_0xe3eb,0x172));var _0xbe3e=function(_0x4e3f17,_0xeb0e8){_0x4e3f17=_0x4e3f17-0x0;var _0x38667b=_0xe3eb[_0x4e3f17];return _0x38667b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xbe3e('0x0'));var BPromise=require(_0xbe3e('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe3e('0x2'));var db=require(_0xbe3e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe3e('0x4'))(_0xbe3e('0x5'));var config=require(_0xbe3e('0x6'));var jayson=require(_0xbe3e('0x7'));var client=jayson[_0xbe3e('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4cbef4,_0x480c82,_0x1b542a){return new BPromise(function(_0x2f2d3d,_0x27866d){return client[_0xbe3e('0x9')](_0x4cbef4,_0x1b542a)[_0xbe3e('0xa')](function(_0x513859){logger[_0xbe3e('0xb')]('Variable,\x20%s,\x20%s',_0x480c82,'request\x20sent');logger[_0xbe3e('0xc')](_0xbe3e('0xd'),_0x480c82,_0xbe3e('0xe'),JSON[_0xbe3e('0xf')](_0x513859));if(_0x513859[_0xbe3e('0x10')]){if(_0x513859['error'][_0xbe3e('0x11')]===0x1f4){logger[_0xbe3e('0x10')](_0xbe3e('0x12'),_0x480c82,_0x513859[_0xbe3e('0x10')]['message']);return _0x27866d(_0x513859['error'][_0xbe3e('0x13')]);}logger[_0xbe3e('0x10')](_0xbe3e('0x12'),_0x480c82,_0x513859[_0xbe3e('0x10')][_0xbe3e('0x13')]);return _0x2f2d3d(_0x513859[_0xbe3e('0x10')]['message']);}else{logger[_0xbe3e('0xb')](_0xbe3e('0x12'),_0x480c82,_0xbe3e('0xe'));_0x2f2d3d(_0x513859[_0xbe3e('0x14')][_0xbe3e('0x13')]);}})['catch'](function(_0xe4fc0d){logger[_0xbe3e('0x10')](_0xbe3e('0x12'),_0x480c82,_0xe4fc0d);_0x27866d(_0xe4fc0d);});});}exports[_0xbe3e('0x15')]=function(_0x26e66f){var _0x519188=this;return new Promise(function(_0x4ab43b,_0x464878){return db['Variable'][_0xbe3e('0x16')]({'raw':_0x26e66f[_0xbe3e('0x17')]?_0x26e66f[_0xbe3e('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x26e66f[_0xbe3e('0x17')]?_0x26e66f['options'][_0xbe3e('0x18')]||null:null,'attributes':_0x26e66f[_0xbe3e('0x17')]?_0x26e66f['options']['attributes']||null:null,'include':_0x26e66f[_0xbe3e('0x17')]?_0x26e66f[_0xbe3e('0x17')]['include']?_['map'](_0x26e66f[_0xbe3e('0x17')]['include'],function(_0x5b9daf){return{'model':db[_0x5b9daf[_0xbe3e('0x19')]],'as':_0x5b9daf['as'],'attributes':_0x5b9daf[_0xbe3e('0x1a')],'include':_0x5b9daf[_0xbe3e('0x1b')]?_[_0xbe3e('0x1c')](_0x5b9daf[_0xbe3e('0x1b')],function(_0x6d1bd0){return{'model':db[_0x6d1bd0['model']],'as':_0x6d1bd0['as'],'attributes':_0x6d1bd0['attributes'],'include':_0x6d1bd0[_0xbe3e('0x1b')]?_[_0xbe3e('0x1c')](_0x6d1bd0['include'],function(_0x59ee1e){return{'model':db[_0x59ee1e[_0xbe3e('0x19')]],'as':_0x59ee1e['as'],'attributes':_0x59ee1e['attributes']};}):[]};}):[]};}):[]:[]})[_0xbe3e('0xa')](function(_0x44b5ef){logger[_0xbe3e('0xb')](_0xbe3e('0x15'),_0x26e66f);logger[_0xbe3e('0xc')](_0xbe3e('0x15'),_0x26e66f,JSON[_0xbe3e('0xf')](_0x44b5ef));_0x4ab43b(_0x44b5ef);})[_0xbe3e('0x1d')](function(_0x42365b){logger['error'](_0xbe3e('0x15'),_0x42365b[_0xbe3e('0x13')],_0x26e66f);_0x464878(_0x519188[_0xbe3e('0x10')](0x1f4,_0x42365b[_0xbe3e('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 3ee2cec..10cb08c 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 _0x0cad=['express','Router','../../components/auth/service','get','canUpdate','fetch','isAuthenticated','reset','pull','/restart','restart','/migrations','migrations','exports'];(function(_0x382e89,_0x4768c0){var _0x3a1318=function(_0x79e1ce){while(--_0x79e1ce){_0x382e89['push'](_0x382e89['shift']());}};_0x3a1318(++_0x4768c0);}(_0x0cad,0x8c));var _0xd0ca=function(_0x2cdf41,_0x4a277c){_0x2cdf41=_0x2cdf41-0x0;var _0x39a70e=_0x0cad[_0x2cdf41];return _0x39a70e;};'use strict';var express=require(_0xd0ca('0x0'));var router=express[_0xd0ca('0x1')]();var auth=require(_0xd0ca('0x2'));var controller=require('./version.controller');router['get']('/',controller['index']);router[_0xd0ca('0x3')]('/fetch',auth['isAuthenticated'](),auth[_0xd0ca('0x4')](),controller[_0xd0ca('0x5')]);router['get']('/reset',auth[_0xd0ca('0x6')](),auth['canUpdate'](),controller[_0xd0ca('0x7')]);router[_0xd0ca('0x3')]('/pull',auth[_0xd0ca('0x6')](),auth[_0xd0ca('0x4')](),controller[_0xd0ca('0x8')]);router[_0xd0ca('0x3')](_0xd0ca('0x9'),auth[_0xd0ca('0x6')](),controller[_0xd0ca('0xa')]);router[_0xd0ca('0x3')](_0xd0ca('0xb'),controller[_0xd0ca('0xc')]);module[_0xd0ca('0xd')]=router; \ No newline at end of file +var _0xb098=['express','Router','get','index','/fetch','isAuthenticated','canUpdate','fetch','reset','/pull','pull','/restart','restart','/migrations','migrations'];(function(_0x23f040,_0x18383b){var _0x2fc55b=function(_0x476d7b){while(--_0x476d7b){_0x23f040['push'](_0x23f040['shift']());}};_0x2fc55b(++_0x18383b);}(_0xb098,0x195));var _0x8b09=function(_0x3a8c2c,_0x39b93b){_0x3a8c2c=_0x3a8c2c-0x0;var _0x2cbfda=_0xb098[_0x3a8c2c];return _0x2cbfda;};'use strict';var express=require(_0x8b09('0x0'));var router=express[_0x8b09('0x1')]();var auth=require('../../components/auth/service');var controller=require('./version.controller');router[_0x8b09('0x2')]('/',controller[_0x8b09('0x3')]);router[_0x8b09('0x2')](_0x8b09('0x4'),auth[_0x8b09('0x5')](),auth[_0x8b09('0x6')](),controller[_0x8b09('0x7')]);router[_0x8b09('0x2')]('/reset',auth[_0x8b09('0x5')](),auth[_0x8b09('0x6')](),controller[_0x8b09('0x8')]);router[_0x8b09('0x2')](_0x8b09('0x9'),auth[_0x8b09('0x5')](),auth[_0x8b09('0x6')](),controller[_0x8b09('0xa')]);router['get'](_0x8b09('0xb'),auth[_0x8b09('0x5')](),controller[_0x8b09('0xc')]);router[_0x8b09('0x2')](_0x8b09('0xd'),controller[_0x8b09('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/version/version.controller.js b/server/api/version/version.controller.js index f5a7a3f..956313c 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 _0x202a=['migrations','length','replace','.js','sort','sequelize','Migration','constructor','map','Database\x20migrated\x20successfully\x20from\x20version\x20','last','Database\x20already\x20up-to-date','path','lodash','pkginfo','compare-versions','../../config/environment','../../config/pm2','simple-git','exports','version','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard','pull','npm\x20install\x20--production','motion2','then','pm2\x20restart\x20motion\x20%s','readdirSync','join','root','server'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0x202a,0xc0));var _0xa202=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x202a[_0x3dd15e];return _0x231fd0;};'use strict';var Umzug=require('umzug');var path=require(_0xa202('0x0'));var fs=require('fs');var _=require(_0xa202('0x1'));var pkginfo=require(_0xa202('0x2'))(module,'version');var compareVersions=require(_0xa202('0x3'));var exec=require('child_process')['exec'];var db=require('../../mysqldb')['db'];var config=require(_0xa202('0x4'));var pm2=require(_0xa202('0x5'));var logger=require('../../config/logger')('update');var git=require(_0xa202('0x6'))(config['root']);exports['index']=function(_0x4d8dcc,_0x216b4c){var _0xcd59fb={'current':module[_0xa202('0x7')][_0xa202('0x8')],'phonebar':0x2};if(_0x4d8dcc['query']&&_0x4d8dcc['query'][_0xa202('0x9')]){return git[_0xa202('0xa')]()[_0xa202('0xb')](function(_0x2c4250,_0x5d592f){_0xcd59fb[_0xa202('0x9')]=(_0x2c4250?module['exports'][_0xa202('0x8')]:_0x5d592f[_0xa202('0x9')])||_0xa202('0xc');return _0x216b4c['status'](0xc8)[_0xa202('0xd')](_0xcd59fb);});}else{return _0x216b4c[_0xa202('0xe')](0xc8)[_0xa202('0xd')](_0xcd59fb);}};exports[_0xa202('0xa')]=function(_0x144687,_0x29969e){return git['fetch']([_0xa202('0xf'),_0xa202('0x10')],function(_0x3880ad){if(_0x3880ad){logger[_0xa202('0x11')](_0x3880ad);return _0x29969e[_0xa202('0xe')](0x1f4)['json'](_0x3880ad);}logger[_0xa202('0x12')](_0xa202('0x13'));return _0x29969e[_0xa202('0xe')](0xc8)[_0xa202('0xd')]({'output':_0xa202('0x14')});});};exports[_0xa202('0x15')]=function(_0x5d348c,_0x44a1b6){return git['reset']([_0xa202('0x16'),'FETCH_HEAD'],function(_0x1eaca4){if(_0x1eaca4){logger[_0xa202('0x11')](_0x1eaca4);return _0x44a1b6[_0xa202('0xe')](0x1f4)[_0xa202('0xd')](_0x1eaca4);}logger[_0xa202('0x12')]('git\x20reset\x20--hard\x20FETCH_HEAD');return _0x44a1b6[_0xa202('0xe')](0xc8)[_0xa202('0xd')]({'output':_0xa202('0x17')});});};exports[_0xa202('0x18')]=function(_0x188195,_0x587cb7){exec(_0xa202('0x19'),function(_0x7b47e5,_0x46cfa4,_0x44801a){logger['info'](_0x46cfa4);logger[_0xa202('0x12')](_0x44801a);if(_0x7b47e5){logger[_0xa202('0x11')](_0x7b47e5);return _0x587cb7['status'](0x1f4)['json'](_0x7b47e5);}return _0x587cb7[_0xa202('0xe')](0xc8)[_0xa202('0xd')]({'output':_0x46cfa4});});};exports['restart']=function(_0x27101e,_0x5a1ea3){return pm2['restart'](_0xa202('0x1a'))[_0xa202('0x1b')](function(_0x397553){logger[_0xa202('0x12')](_0xa202('0x1c'),_0x397553);return _0x5a1ea3[_0xa202('0xe')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})['catch'](function(_0x4d33fe){logger[_0xa202('0x11')](_0x4d33fe);return _0x5a1ea3[_0xa202('0xe')](0x1f4)[_0xa202('0xd')](_0x4d33fe);});};exports['migrations']=function(_0x35ae40,_0x390633){var _0xf73ab4=fs[_0xa202('0x1d')](path[_0xa202('0x1e')](config[_0xa202('0x1f')],_0xa202('0x20'),_0xa202('0x21')));var _0x22ba67=[];for(var _0x106b89=0x0;_0x106b89<_0xf73ab4[_0xa202('0x22')];_0x106b89++){var _0x144afd=_0xf73ab4[_0x106b89][_0xa202('0x23')](_0xa202('0x24'),'');if(compareVersions(module[_0xa202('0x7')][_0xa202('0x8')],_0x144afd)===-0x1){_0x22ba67['push'](_0x144afd);}}if(_0x22ba67[_0xa202('0x22')]){var _0x15eb0e=_0x22ba67[_0xa202('0x25')](compareVersions);var _0x1b5b96=new Umzug({'storage':_0xa202('0x26'),'storageOptions':{'model':db[_0xa202('0x27')],'modelName':'Migration','columnName':_0xa202('0x8')},'migrations':{'params':[db[_0xa202('0x26')]['getQueryInterface'](),db[_0xa202('0x26')][_0xa202('0x28')],function(){throw new Error('Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.');}],'path':path['join'](config['root'],_0xa202('0x20'),_0xa202('0x21')),'pattern':/\.js$/}});_0x1b5b96['up']({'migrations':_[_0xa202('0x29')](_0x15eb0e,function(_0x18d13d){return _0x18d13d+_0xa202('0x24');})})['then'](function(){return _0x390633[_0xa202('0xe')](0xc8)['json']({'output':_0xa202('0x2a')+module[_0xa202('0x7')][_0xa202('0x8')]+'\x20to\x20'+_[_0xa202('0x2b')](_0x15eb0e),'migrations':_['join'](_0x15eb0e)});})['catch'](function(_0x44cfd8){if(_0x44cfd8 instanceof db[_0xa202('0x26')]['UniqueConstraintError']){return _0x390633[_0xa202('0xe')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x390633[_0xa202('0xe')](0x1f4)[_0xa202('0xd')](_0x44cfd8);}});}else{return _0x390633['status'](0xc8)[_0xa202('0xd')]({'output':_0xa202('0x2c')});}}; \ No newline at end of file +var _0x97e6=['motion2','then','pm2\x20restart\x20motion\x20%s','catch','migrations','join','length','replace','push','sort','Migration','sequelize','getQueryInterface','constructor','Migration\x20tried\x20to\x20use\x20old\x20style\x20\x22done\x22\x20callback.\x20Please\x20upgrade\x20to\x20\x22umzug\x22\x20and\x20return\x20a\x20promise\x20instead.','server','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','UniqueConstraintError','Database\x20already\x20up-to-date','umzug','lodash','pkginfo','version','child_process','exec','../../config/environment','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','status','json','origin','master','error','info','git\x20fetch','git\x20fetch\x20origin\x20master','reset','--hard','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart'];(function(_0x4909a4,_0x1b7b95){var _0x3b704d=function(_0x5a1d28){while(--_0x5a1d28){_0x4909a4['push'](_0x4909a4['shift']());}};_0x3b704d(++_0x1b7b95);}(_0x97e6,0x159));var _0x697e=function(_0x4e71ac,_0x42aced){_0x4e71ac=_0x4e71ac-0x0;var _0x11d76c=_0x97e6[_0x4e71ac];return _0x11d76c;};'use strict';var Umzug=require(_0x697e('0x0'));var path=require('path');var fs=require('fs');var _=require(_0x697e('0x1'));var pkginfo=require(_0x697e('0x2'))(module,_0x697e('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x697e('0x4'))[_0x697e('0x5')];var db=require('../../mysqldb')['db'];var config=require(_0x697e('0x6'));var pm2=require('../../config/pm2');var logger=require(_0x697e('0x7'))(_0x697e('0x8'));var git=require(_0x697e('0x9'))(config[_0x697e('0xa')]);exports[_0x697e('0xb')]=function(_0x21b9d5,_0x4cf39f){var _0x5670e3={'current':module[_0x697e('0xc')][_0x697e('0x3')],'phonebar':0x2};if(_0x21b9d5[_0x697e('0xd')]&&_0x21b9d5['query'][_0x697e('0xe')]){return git[_0x697e('0xf')]()[_0x697e('0x10')](function(_0x1c7aa7,_0x3c528a){_0x5670e3['latest']=(_0x1c7aa7?module[_0x697e('0xc')]['version']:_0x3c528a['latest'])||_0x697e('0x11');return _0x4cf39f[_0x697e('0x12')](0xc8)[_0x697e('0x13')](_0x5670e3);});}else{return _0x4cf39f['status'](0xc8)[_0x697e('0x13')](_0x5670e3);}};exports[_0x697e('0xf')]=function(_0x53f190,_0x504b68){return git[_0x697e('0xf')]([_0x697e('0x14'),_0x697e('0x15')],function(_0x2254c1){if(_0x2254c1){logger[_0x697e('0x16')](_0x2254c1);return _0x504b68[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x2254c1);}logger[_0x697e('0x17')](_0x697e('0x18'));return _0x504b68['status'](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x19')});});};exports['reset']=function(_0x5ea3ec,_0x5edd20){return git[_0x697e('0x1a')]([_0x697e('0x1b'),'FETCH_HEAD'],function(_0xa000e4){if(_0xa000e4){logger[_0x697e('0x16')](_0xa000e4);return _0x5edd20[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0xa000e4);}logger[_0x697e('0x17')](_0x697e('0x1c'));return _0x5edd20[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x1d')});});};exports[_0x697e('0x1e')]=function(_0x40525f,_0x495283){exec(_0x697e('0x1f'),function(_0x5949e5,_0x179fab,_0x2e1609){logger['info'](_0x179fab);logger[_0x697e('0x17')](_0x2e1609);if(_0x5949e5){logger['error'](_0x5949e5);return _0x495283[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x5949e5);}return _0x495283[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x179fab});});};exports[_0x697e('0x20')]=function(_0x4b4514,_0x4b5222){return pm2[_0x697e('0x20')](_0x697e('0x21'))[_0x697e('0x22')](function(_0x3f6432){logger[_0x697e('0x17')](_0x697e('0x23'),_0x3f6432);return _0x4b5222[_0x697e('0x12')](0xc8)['json']({'output':'Your\x20system\x20has\x20been\x20restart\x20successfully'});})[_0x697e('0x24')](function(_0x2cc855){logger[_0x697e('0x16')](_0x2cc855);return _0x4b5222[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x2cc855);});};exports[_0x697e('0x25')]=function(_0x33f4b5,_0x55833e){var _0x492b6a=fs['readdirSync'](path[_0x697e('0x26')](config['root'],'server','migrations'));var _0x500b95=[];for(var _0x367f74=0x0;_0x367f74<_0x492b6a[_0x697e('0x27')];_0x367f74++){var _0x164cef=_0x492b6a[_0x367f74][_0x697e('0x28')]('.js','');if(compareVersions(module[_0x697e('0xc')][_0x697e('0x3')],_0x164cef)===-0x1){_0x500b95[_0x697e('0x29')](_0x164cef);}}if(_0x500b95[_0x697e('0x27')]){var _0x3f9688=_0x500b95[_0x697e('0x2a')](compareVersions);var _0x5c54f9=new Umzug({'storage':'sequelize','storageOptions':{'model':db[_0x697e('0x2b')],'modelName':_0x697e('0x2b'),'columnName':'version'},'migrations':{'params':[db[_0x697e('0x2c')][_0x697e('0x2d')](),db['sequelize'][_0x697e('0x2e')],function(){throw new Error(_0x697e('0x2f'));}],'path':path[_0x697e('0x26')](config[_0x697e('0xa')],_0x697e('0x30'),_0x697e('0x25')),'pattern':/\.js$/}});_0x5c54f9['up']({'migrations':_['map'](_0x3f9688,function(_0x119ce9){return _0x119ce9+'.js';})})['then'](function(){return _0x55833e[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x31')+module['exports'][_0x697e('0x3')]+_0x697e('0x32')+_[_0x697e('0x33')](_0x3f9688),'migrations':_['join'](_0x3f9688)});})[_0x697e('0x24')](function(_0x1de7a9){if(_0x1de7a9 instanceof db[_0x697e('0x2c')][_0x697e('0x34')]){return _0x55833e[_0x697e('0x12')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}else{return _0x55833e[_0x697e('0x12')](0x1f4)[_0x697e('0x13')](_0x1de7a9);}});}else{return _0x55833e[_0x697e('0x12')](0xc8)[_0x697e('0x13')]({'output':_0x697e('0x35')});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index b37d26b..98af53a 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 _0xd5e2=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','show','create','put','update','destroy'];(function(_0x525c7b,_0x488fcc){var _0x27b33e=function(_0x56d43b){while(--_0x56d43b){_0x525c7b['push'](_0x525c7b['shift']());}};_0x27b33e(++_0x488fcc);}(_0xd5e2,0x155));var _0x2d5e=function(_0x535ad6,_0x22b56c){_0x535ad6=_0x535ad6-0x0;var _0x12d4f6=_0xd5e2[_0x535ad6];return _0x12d4f6;};'use strict';var multer=require(_0x2d5e('0x0'));var util=require(_0x2d5e('0x1'));var path=require(_0x2d5e('0x2'));var timeout=require('connect-timeout');var express=require(_0x2d5e('0x3'));var router=express[_0x2d5e('0x4')]();var auth=require(_0x2d5e('0x5'));var interaction=require(_0x2d5e('0x6'));var config=require('../../config/environment');var controller=require('./voiceAgentReport.controller');router[_0x2d5e('0x7')]('/',auth[_0x2d5e('0x8')](),controller['index']);router[_0x2d5e('0x7')]('/describe',auth[_0x2d5e('0x8')](),controller[_0x2d5e('0x9')]);router[_0x2d5e('0x7')](_0x2d5e('0xa'),auth[_0x2d5e('0x8')](),controller[_0x2d5e('0xb')]);router['post']('/',auth[_0x2d5e('0x8')](),controller[_0x2d5e('0xc')]);router[_0x2d5e('0xd')](_0x2d5e('0xa'),auth['isAuthenticated'](),controller[_0x2d5e('0xe')]);router['delete'](_0x2d5e('0xa'),auth['isAuthenticated'](),controller[_0x2d5e('0xf')]);module[_0x2d5e('0x10')]=router; \ No newline at end of file +var _0x628c=['post','put','update','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','/describe','describe','/:id','show'];(function(_0xb6a41e,_0x56641a){var _0x539910=function(_0x5dff7f){while(--_0x5dff7f){_0xb6a41e['push'](_0xb6a41e['shift']());}};_0x539910(++_0x56641a);}(_0x628c,0x95));var _0xc628=function(_0x4147ff,_0x154530){_0x4147ff=_0x4147ff-0x0;var _0x1e71e6=_0x628c[_0x4147ff];return _0x1e71e6;};'use strict';var multer=require('multer');var util=require(_0xc628('0x0'));var path=require(_0xc628('0x1'));var timeout=require(_0xc628('0x2'));var express=require('express');var router=express[_0xc628('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xc628('0x4'));var config=require(_0xc628('0x5'));var controller=require(_0xc628('0x6'));router[_0xc628('0x7')]('/',auth[_0xc628('0x8')](),controller['index']);router[_0xc628('0x7')](_0xc628('0x9'),auth['isAuthenticated'](),controller[_0xc628('0xa')]);router[_0xc628('0x7')](_0xc628('0xb'),auth[_0xc628('0x8')](),controller[_0xc628('0xc')]);router[_0xc628('0xd')]('/',auth[_0xc628('0x8')](),controller['create']);router[_0xc628('0xe')](_0xc628('0xb'),auth['isAuthenticated'](),controller[_0xc628('0xf')]);router['delete'](_0xc628('0xb'),auth[_0xc628('0x8')](),controller[_0xc628('0x10')]);module[_0xc628('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index 34f7346..5deb4bf 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 _0x4819=['FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','BOOLEAN','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4819,0xcd));var _0x9481=function(_0x1e5a0c,_0x3a16fc){_0x1e5a0c=_0x1e5a0c-0x0;var _0x5cc15b=_0x4819[_0x1e5a0c];return _0x5cc15b;};'use strict';var Sequelize=require('sequelize');module[_0x9481('0x0')]={'type':{'type':Sequelize[_0x9481('0x1')]},'uniqueid':{'type':Sequelize[_0x9481('0x1')]},'calleridnum':{'type':Sequelize[_0x9481('0x1')]},'calleridname':{'type':Sequelize[_0x9481('0x1')]},'queue':{'type':Sequelize[_0x9481('0x1')]},'interface':{'type':Sequelize[_0x9481('0x1')]},'membername':{'type':Sequelize[_0x9481('0x1')]},'agentcalledAt':{'type':Sequelize[_0x9481('0x2')]},'agentconnectAt':{'type':Sequelize[_0x9481('0x2')]},'agentcompleteAt':{'type':Sequelize['DATE']},'agentringnoanswerAt':{'type':Sequelize[_0x9481('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x9481('0x4')]},'agentacw':{'type':Sequelize[_0x9481('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0x9481('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9481('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x9481('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'connectedlinename':{'type':Sequelize[_0x9481('0x1')]},'language':{'type':Sequelize[_0x9481('0x1')]},'accountcode':{'type':Sequelize[_0x9481('0x1')]},'context':{'type':Sequelize[_0x9481('0x1')]},'exten':{'type':Sequelize[_0x9481('0x1')]},'priority':{'type':Sequelize[_0x9481('0x1')]},'destchannel':{'type':Sequelize[_0x9481('0x1')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x9481('0x1')]},'destcalleridname':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9481('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9481('0x1')]},'destlanguage':{'type':Sequelize[_0x9481('0x1')]},'destaccountcode':{'type':Sequelize[_0x9481('0x1')]},'destcontext':{'type':Sequelize[_0x9481('0x1')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x9481('0x1')]},'destuniqueid':{'type':Sequelize[_0x9481('0x1')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x9481('0x1')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x9481('0x1')],'comment':_0x9481('0x5')},'transferexten':{'type':Sequelize[_0x9481('0x1')]},'transferuniqueid':{'type':Sequelize[_0x9481('0x1')]},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3eea=['INTEGER','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','STRING','DATE','BOOLEAN'];(function(_0x1aab74,_0x38a57b){var _0x396af2=function(_0x1c2e0d){while(--_0x1c2e0d){_0x1aab74['push'](_0x1aab74['shift']());}};_0x396af2(++_0x38a57b);}(_0x3eea,0x1ca));var _0xa3ee=function(_0x23e243,_0x1ed3ee){_0x23e243=_0x23e243-0x0;var _0x5d6971=_0x3eea[_0x23e243];return _0x5d6971;};'use strict';var Sequelize=require(_0xa3ee('0x0'));module['exports']={'type':{'type':Sequelize[_0xa3ee('0x1')]},'uniqueid':{'type':Sequelize[_0xa3ee('0x1')]},'calleridnum':{'type':Sequelize[_0xa3ee('0x1')]},'calleridname':{'type':Sequelize[_0xa3ee('0x1')]},'queue':{'type':Sequelize[_0xa3ee('0x1')]},'interface':{'type':Sequelize[_0xa3ee('0x1')]},'membername':{'type':Sequelize[_0xa3ee('0x1')]},'agentcalledAt':{'type':Sequelize[_0xa3ee('0x2')]},'agentconnectAt':{'type':Sequelize[_0xa3ee('0x2')]},'agentcompleteAt':{'type':Sequelize[_0xa3ee('0x2')]},'agentringnoanswerAt':{'type':Sequelize[_0xa3ee('0x2')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0xa3ee('0x3')],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentdump':{'type':Sequelize[_0xa3ee('0x3')],'defaultValue':![]},'talktime':{'type':Sequelize['INTEGER']},'agentacw':{'type':Sequelize[_0xa3ee('0x3')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize[_0xa3ee('0x1')]},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xa3ee('0x1')]},'channelstate':{'type':Sequelize[_0xa3ee('0x4')]},'channelstatedesc':{'type':Sequelize[_0xa3ee('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xa3ee('0x1')]},'language':{'type':Sequelize[_0xa3ee('0x1')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xa3ee('0x1')]},'priority':{'type':Sequelize[_0xa3ee('0x1')]},'destchannel':{'type':Sequelize[_0xa3ee('0x1')]},'destchannelstate':{'type':Sequelize[_0xa3ee('0x4')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xa3ee('0x1')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0xa3ee('0x1')]},'destconnectedlinename':{'type':Sequelize[_0xa3ee('0x1')]},'destlanguage':{'type':Sequelize[_0xa3ee('0x1')]},'destaccountcode':{'type':Sequelize[_0xa3ee('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xa3ee('0x1')]},'destpriority':{'type':Sequelize[_0xa3ee('0x1')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xa3ee('0x3')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xa3ee('0x1')],'comment':_0xa3ee('0x5')},'transferexten':{'type':Sequelize[_0xa3ee('0x1')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0xa3ee('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.controller.js b/server/api/voiceAgentReport/voiceAgentReport.controller.js index 7604f0f..596f1ad 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 _0x0b29=['fields','length','nolimit','limit','order','where','pick','filter','merge','includeAll','include','rows','catch','show','params','options','find','create','body','update','describe','html-pdf','eml-format','fast-json-patch','request-promise','moment','path','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','Content-Range','apply','destroy','then','stack','name','send','map','VoiceAgentReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes','model'];(function(_0x3f2476,_0x50c29c){var _0x27c418=function(_0x3d764b){while(--_0x3d764b){_0x3f2476['push'](_0x3f2476['shift']());}};_0x27c418(++_0x50c29c);}(_0x0b29,0xde));var _0x90b2=function(_0x3b477d,_0x4495f9){_0x3b477d=_0x3b477d-0x0;var _0x45d4eb=_0x0b29[_0x3b477d];return _0x45d4eb;};'use strict';var pdf=require(_0x90b2('0x0'));var emlformat=require(_0x90b2('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x90b2('0x2'));var rp=require(_0x90b2('0x3'));var moment=require(_0x90b2('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0x90b2('0x5'));var sox=require(_0x90b2('0x6'));var csv=require('to-csv');var ejs=require(_0x90b2('0x7'));var fs=require('fs');var _=require(_0x90b2('0x8'));var squel=require(_0x90b2('0x9'));var crypto=require('crypto');var jsforce=require(_0x90b2('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x90b2('0xb'));var querystring=require(_0x90b2('0xc'));var Papa=require(_0x90b2('0xd'));var Redis=require('ioredis');var authService=require(_0x90b2('0xe'));var qs=require(_0x90b2('0xf'));var as=require(_0x90b2('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x90b2('0x11'));var utils=require('../../config/utils');var config=require(_0x90b2('0x12'));var db=require(_0x90b2('0x13'))['db'];function respondWithStatusCode(_0x58fe77,_0x42db8d){_0x42db8d=_0x42db8d||0xcc;return function(_0x21b52e){if(_0x21b52e){return _0x58fe77[_0x90b2('0x14')](_0x42db8d);}return _0x58fe77[_0x90b2('0x15')](_0x42db8d)[_0x90b2('0x16')]();};}function respondWithResult(_0x49fc2e,_0x249b0c){_0x249b0c=_0x249b0c||0xc8;return function(_0x4a1908){if(_0x4a1908){return _0x49fc2e[_0x90b2('0x15')](_0x249b0c)[_0x90b2('0x17')](_0x4a1908);}};}function respondWithFilteredResult(_0x14f5e5,_0x2b0c7d){return function(_0xfc811a){if(_0xfc811a){var _0xfe2d5d=_0xfc811a[_0x90b2('0x18')],_0x1dca31=_0x2b0c7d[_0x90b2('0x19')],_0x4c0c14=_0x2b0c7d[_0x90b2('0x19')]+_0x2b0c7d['limit'],_0x36f7b4;if(_0x4c0c14>=_0xfe2d5d){_0x4c0c14=_0xfe2d5d;_0x36f7b4=0xc8;}else{_0x36f7b4=0xce;}_0x14f5e5['status'](_0x36f7b4);return _0x14f5e5[_0x90b2('0x1a')](_0x90b2('0x1b'),_0x1dca31+'-'+_0x4c0c14+'/'+_0xfe2d5d)[_0x90b2('0x17')](_0xfc811a);}return null;};}function patchUpdates(_0x410139){return function(_0x4153a3){try{jsonpatch[_0x90b2('0x1c')](_0x4153a3,_0x410139,!![]);}catch(_0x58ecab){return BPromise['reject'](_0x58ecab);}return _0x4153a3['save']();};}function saveUpdates(_0x3a107d,_0x1c653a){return function(_0x4129e2){if(_0x4129e2){return _0x4129e2['update'](_0x3a107d)['then'](function(_0xcd70d6){return _0xcd70d6;});}return null;};}function removeEntity(_0xf06348,_0x54defe){return function(_0x48e1f6){if(_0x48e1f6){return _0x48e1f6[_0x90b2('0x1d')]()[_0x90b2('0x1e')](function(){_0xf06348['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x36ec8e,_0x4cb816){return function(_0x144086){if(!_0x144086){_0x36ec8e[_0x90b2('0x14')](0x194);}return _0x144086;};}function handleError(_0x36f8d2,_0x14ae63){_0x14ae63=_0x14ae63||0x1f4;return function(_0x53fc54){logger['error'](_0x53fc54[_0x90b2('0x1f')]);if(_0x53fc54[_0x90b2('0x20')]){delete _0x53fc54[_0x90b2('0x20')];}_0x36f8d2[_0x90b2('0x15')](_0x14ae63)[_0x90b2('0x21')](_0x53fc54);};}exports['index']=function(_0x1aa4a8,_0x452e89){var _0xfd8577={},_0x45283e={},_0x479e06={'count':0x0,'rows':[]};var _0x47c55b=_[_0x90b2('0x22')](db[_0x90b2('0x23')][_0x90b2('0x24')],function(_0x4e150d){return{'name':_0x4e150d[_0x90b2('0x25')],'type':_0x4e150d[_0x90b2('0x26')][_0x90b2('0x27')]};});_0x45283e['model']=_[_0x90b2('0x22')](_0x47c55b,_0x90b2('0x20'));_0x45283e[_0x90b2('0x28')]=_[_0x90b2('0x29')](_0x1aa4a8[_0x90b2('0x28')]);_0x45283e[_0x90b2('0x2a')]=_[_0x90b2('0x2b')](_0x45283e['model'],_0x45283e[_0x90b2('0x28')]);_0xfd8577[_0x90b2('0x2c')]=_[_0x90b2('0x2b')](_0x45283e[_0x90b2('0x2d')],qs[_0x90b2('0x2e')](_0x1aa4a8['query']['fields']));_0xfd8577[_0x90b2('0x2c')]=_0xfd8577[_0x90b2('0x2c')][_0x90b2('0x2f')]?_0xfd8577['attributes']:_0x45283e[_0x90b2('0x2d')];if(!_0x1aa4a8[_0x90b2('0x28')]['hasOwnProperty'](_0x90b2('0x30'))){_0xfd8577[_0x90b2('0x31')]=qs[_0x90b2('0x31')](_0x1aa4a8['query'][_0x90b2('0x31')]);_0xfd8577[_0x90b2('0x19')]=qs[_0x90b2('0x19')](_0x1aa4a8[_0x90b2('0x28')][_0x90b2('0x19')]);}_0xfd8577[_0x90b2('0x32')]=qs['sort'](_0x1aa4a8[_0x90b2('0x28')]['sort']);_0xfd8577[_0x90b2('0x33')]=qs[_0x90b2('0x2a')](_[_0x90b2('0x34')](_0x1aa4a8[_0x90b2('0x28')],_0x45283e[_0x90b2('0x2a')]));if(_0x1aa4a8[_0x90b2('0x28')][_0x90b2('0x35')]){_0xfd8577[_0x90b2('0x33')]=_[_0x90b2('0x36')](_0xfd8577[_0x90b2('0x33')],{'$or':_[_0x90b2('0x22')](_0x47c55b,function(_0x2683e6){if(_0x2683e6[_0x90b2('0x26')]!=='VIRTUAL'){var _0x5a9270={};_0x5a9270[_0x2683e6['name']]={'$like':'%'+_0x1aa4a8[_0x90b2('0x28')][_0x90b2('0x35')]+'%'};return _0x5a9270;}})});}_0xfd8577=_[_0x90b2('0x36')]({},_0xfd8577,_0x1aa4a8['options']);var _0x212354={'where':_0xfd8577[_0x90b2('0x33')]};return db[_0x90b2('0x23')][_0x90b2('0x18')](_0x212354)['then'](function(_0x45f701){_0x479e06['count']=_0x45f701;if(_0x1aa4a8[_0x90b2('0x28')][_0x90b2('0x37')]){_0xfd8577[_0x90b2('0x38')]=[{'all':!![]}];}return db[_0x90b2('0x23')]['findAll'](_0xfd8577);})['then'](function(_0x422d2c){_0x479e06[_0x90b2('0x39')]=_0x422d2c;return _0x479e06;})['then'](respondWithFilteredResult(_0x452e89,_0xfd8577))[_0x90b2('0x3a')](handleError(_0x452e89,null));};exports[_0x90b2('0x3b')]=function(_0x1a6d60,_0x4947af){var _0x36016e={'raw':![],'where':{'id':_0x1a6d60[_0x90b2('0x3c')]['id']}},_0x2a6744={};_0x2a6744[_0x90b2('0x2d')]=_[_0x90b2('0x29')](db[_0x90b2('0x23')]['rawAttributes']);_0x2a6744[_0x90b2('0x28')]=_['keys'](_0x1a6d60['query']);_0x2a6744[_0x90b2('0x2a')]=_[_0x90b2('0x2b')](_0x2a6744[_0x90b2('0x2d')],_0x2a6744[_0x90b2('0x28')]);_0x36016e[_0x90b2('0x2c')]=_[_0x90b2('0x2b')](_0x2a6744[_0x90b2('0x2d')],qs[_0x90b2('0x2e')](_0x1a6d60[_0x90b2('0x28')][_0x90b2('0x2e')]));_0x36016e[_0x90b2('0x2c')]=_0x36016e['attributes']['length']?_0x36016e[_0x90b2('0x2c')]:_0x2a6744[_0x90b2('0x2d')];if(_0x1a6d60[_0x90b2('0x28')][_0x90b2('0x37')]){_0x36016e[_0x90b2('0x38')]=[{'all':!![]}];}_0x36016e=_[_0x90b2('0x36')]({},_0x36016e,_0x1a6d60[_0x90b2('0x3d')]);return db[_0x90b2('0x23')][_0x90b2('0x3e')](_0x36016e)[_0x90b2('0x1e')](handleEntityNotFound(_0x4947af,null))['then'](respondWithResult(_0x4947af,null))[_0x90b2('0x3a')](handleError(_0x4947af,null));};exports[_0x90b2('0x3f')]=function(_0x1c2acc,_0x2e5ed6){return db['VoiceAgentReport']['create'](_0x1c2acc[_0x90b2('0x40')],{})[_0x90b2('0x1e')](respondWithResult(_0x2e5ed6,0xc9))[_0x90b2('0x3a')](handleError(_0x2e5ed6,null));};exports[_0x90b2('0x41')]=function(_0x9d40fc,_0x588266){if(_0x9d40fc[_0x90b2('0x40')]['id']){delete _0x9d40fc[_0x90b2('0x40')]['id'];}return db[_0x90b2('0x23')]['find']({'where':{'id':_0x9d40fc[_0x90b2('0x3c')]['id']}})[_0x90b2('0x1e')](handleEntityNotFound(_0x588266,null))[_0x90b2('0x1e')](saveUpdates(_0x9d40fc['body'],null))['then'](respondWithResult(_0x588266,null))[_0x90b2('0x3a')](handleError(_0x588266,null));};exports[_0x90b2('0x1d')]=function(_0x221b30,_0x2d065d){return db[_0x90b2('0x23')][_0x90b2('0x3e')]({'where':{'id':_0x221b30[_0x90b2('0x3c')]['id']}})[_0x90b2('0x1e')](handleEntityNotFound(_0x2d065d,null))[_0x90b2('0x1e')](removeEntity(_0x2d065d,null))['catch'](handleError(_0x2d065d,null));};exports[_0x90b2('0x42')]=function(_0xb99195,_0x49ceba){return db['VoiceAgentReport'][_0x90b2('0x42')]()['then'](respondWithResult(_0x49ceba,null))[_0x90b2('0x3a')](handleError(_0x49ceba,null));}; \ No newline at end of file +var _0x4a46=['filter','where','type','VIRTUAL','includeAll','findAll','merge','options','find','catch','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','reject','update','then','destroy','sendStatus','error','stack','name','send','index','VoiceAgentReport','rawAttributes','fieldName','key','map','query','keys','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','filters'];(function(_0x4d7988,_0x4c62e3){var _0x97e287=function(_0x223966){while(--_0x223966){_0x4d7988['push'](_0x4d7988['shift']());}};_0x97e287(++_0x4c62e3);}(_0x4a46,0xe2));var _0x64a4=function(_0x301261,_0x315717){_0x301261=_0x301261-0x0;var _0x168ffb=_0x4a46[_0x301261];return _0x168ffb;};'use strict';var pdf=require(_0x64a4('0x0'));var emlformat=require(_0x64a4('0x1'));var rimraf=require(_0x64a4('0x2'));var zipdir=require(_0x64a4('0x3'));var jsonpatch=require(_0x64a4('0x4'));var rp=require(_0x64a4('0x5'));var moment=require(_0x64a4('0x6'));var BPromise=require(_0x64a4('0x7'));var Mustache=require(_0x64a4('0x8'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x64a4('0x9'));var ejs=require(_0x64a4('0xa'));var fs=require('fs');var _=require(_0x64a4('0xb'));var squel=require(_0x64a4('0xc'));var crypto=require('crypto');var jsforce=require(_0x64a4('0xd'));var deskjs=require(_0x64a4('0xe'));var toCsv=require('to-csv');var querystring=require(_0x64a4('0xf'));var Papa=require(_0x64a4('0x10'));var Redis=require(_0x64a4('0x11'));var authService=require(_0x64a4('0x12'));var qs=require(_0x64a4('0x13'));var as=require(_0x64a4('0x14'));var hardwareService=require(_0x64a4('0x15'));var logger=require('../../config/logger')('api');var utils=require(_0x64a4('0x16'));var config=require(_0x64a4('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d5a0c,_0x1c3023){_0x1c3023=_0x1c3023||0xcc;return function(_0x10516c){if(_0x10516c){return _0x1d5a0c['sendStatus'](_0x1c3023);}return _0x1d5a0c[_0x64a4('0x18')](_0x1c3023)[_0x64a4('0x19')]();};}function respondWithResult(_0x1f05e6,_0x20072a){_0x20072a=_0x20072a||0xc8;return function(_0x5e21af){if(_0x5e21af){return _0x1f05e6[_0x64a4('0x18')](_0x20072a)['json'](_0x5e21af);}};}function respondWithFilteredResult(_0x8e376d,_0x390a31){return function(_0x3e8971){if(_0x3e8971){var _0x259086=_0x3e8971[_0x64a4('0x1a')],_0x17215a=_0x390a31[_0x64a4('0x1b')],_0x2f25b5=_0x390a31[_0x64a4('0x1b')]+_0x390a31[_0x64a4('0x1c')],_0x282e32;if(_0x2f25b5>=_0x259086){_0x2f25b5=_0x259086;_0x282e32=0xc8;}else{_0x282e32=0xce;}_0x8e376d[_0x64a4('0x18')](_0x282e32);return _0x8e376d[_0x64a4('0x1d')](_0x64a4('0x1e'),_0x17215a+'-'+_0x2f25b5+'/'+_0x259086)['json'](_0x3e8971);}return null;};}function patchUpdates(_0x3568fd){return function(_0x391197){try{jsonpatch['apply'](_0x391197,_0x3568fd,!![]);}catch(_0x3da2ec){return BPromise[_0x64a4('0x1f')](_0x3da2ec);}return _0x391197['save']();};}function saveUpdates(_0x5d8679,_0x5e8d19){return function(_0x119b50){if(_0x119b50){return _0x119b50[_0x64a4('0x20')](_0x5d8679)[_0x64a4('0x21')](function(_0x385730){return _0x385730;});}return null;};}function removeEntity(_0xc68dc8,_0x4e7e2c){return function(_0x15211f){if(_0x15211f){return _0x15211f[_0x64a4('0x22')]()[_0x64a4('0x21')](function(){_0xc68dc8[_0x64a4('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x3980cd,_0x27382e){return function(_0x37d635){if(!_0x37d635){_0x3980cd[_0x64a4('0x23')](0x194);}return _0x37d635;};}function handleError(_0x3f86f4,_0x5618af){_0x5618af=_0x5618af||0x1f4;return function(_0x856afe){logger[_0x64a4('0x24')](_0x856afe[_0x64a4('0x25')]);if(_0x856afe['name']){delete _0x856afe[_0x64a4('0x26')];}_0x3f86f4['status'](_0x5618af)[_0x64a4('0x27')](_0x856afe);};}exports[_0x64a4('0x28')]=function(_0x2357a3,_0x1816c4){var _0x5d1398={},_0x3d4bf4={},_0x44d361={'count':0x0,'rows':[]};var _0x112f8d=_['map'](db[_0x64a4('0x29')][_0x64a4('0x2a')],function(_0x135c25){return{'name':_0x135c25[_0x64a4('0x2b')],'type':_0x135c25['type'][_0x64a4('0x2c')]};});_0x3d4bf4['model']=_[_0x64a4('0x2d')](_0x112f8d,_0x64a4('0x26'));_0x3d4bf4[_0x64a4('0x2e')]=_[_0x64a4('0x2f')](_0x2357a3['query']);_0x3d4bf4['filters']=_[_0x64a4('0x30')](_0x3d4bf4[_0x64a4('0x31')],_0x3d4bf4[_0x64a4('0x2e')]);_0x5d1398['attributes']=_[_0x64a4('0x30')](_0x3d4bf4[_0x64a4('0x31')],qs[_0x64a4('0x32')](_0x2357a3[_0x64a4('0x2e')][_0x64a4('0x32')]));_0x5d1398[_0x64a4('0x33')]=_0x5d1398[_0x64a4('0x33')][_0x64a4('0x34')]?_0x5d1398[_0x64a4('0x33')]:_0x3d4bf4[_0x64a4('0x31')];if(!_0x2357a3['query'][_0x64a4('0x35')](_0x64a4('0x36'))){_0x5d1398[_0x64a4('0x1c')]=qs[_0x64a4('0x1c')](_0x2357a3[_0x64a4('0x2e')][_0x64a4('0x1c')]);_0x5d1398[_0x64a4('0x1b')]=qs[_0x64a4('0x1b')](_0x2357a3[_0x64a4('0x2e')][_0x64a4('0x1b')]);}_0x5d1398[_0x64a4('0x37')]=qs[_0x64a4('0x38')](_0x2357a3[_0x64a4('0x2e')]['sort']);_0x5d1398['where']=qs[_0x64a4('0x39')](_['pick'](_0x2357a3[_0x64a4('0x2e')],_0x3d4bf4[_0x64a4('0x39')]));if(_0x2357a3[_0x64a4('0x2e')][_0x64a4('0x3a')]){_0x5d1398[_0x64a4('0x3b')]=_['merge'](_0x5d1398[_0x64a4('0x3b')],{'$or':_['map'](_0x112f8d,function(_0x1a5957){if(_0x1a5957[_0x64a4('0x3c')]!==_0x64a4('0x3d')){var _0x12fa71={};_0x12fa71[_0x1a5957[_0x64a4('0x26')]]={'$like':'%'+_0x2357a3['query'][_0x64a4('0x3a')]+'%'};return _0x12fa71;}})});}_0x5d1398=_['merge']({},_0x5d1398,_0x2357a3['options']);var _0x418681={'where':_0x5d1398[_0x64a4('0x3b')]};return db['VoiceAgentReport'][_0x64a4('0x1a')](_0x418681)[_0x64a4('0x21')](function(_0x49eb48){_0x44d361[_0x64a4('0x1a')]=_0x49eb48;if(_0x2357a3[_0x64a4('0x2e')][_0x64a4('0x3e')]){_0x5d1398['include']=[{'all':!![]}];}return db[_0x64a4('0x29')][_0x64a4('0x3f')](_0x5d1398);})[_0x64a4('0x21')](function(_0x94ad2e){_0x44d361['rows']=_0x94ad2e;return _0x44d361;})[_0x64a4('0x21')](respondWithFilteredResult(_0x1816c4,_0x5d1398))['catch'](handleError(_0x1816c4,null));};exports['show']=function(_0x10bf08,_0x22c0c5){var _0x5968e7={'raw':![],'where':{'id':_0x10bf08['params']['id']}},_0x2419c7={};_0x2419c7[_0x64a4('0x31')]=_[_0x64a4('0x2f')](db[_0x64a4('0x29')]['rawAttributes']);_0x2419c7[_0x64a4('0x2e')]=_[_0x64a4('0x2f')](_0x10bf08['query']);_0x2419c7['filters']=_[_0x64a4('0x30')](_0x2419c7[_0x64a4('0x31')],_0x2419c7['query']);_0x5968e7[_0x64a4('0x33')]=_[_0x64a4('0x30')](_0x2419c7['model'],qs['fields'](_0x10bf08['query']['fields']));_0x5968e7['attributes']=_0x5968e7[_0x64a4('0x33')][_0x64a4('0x34')]?_0x5968e7['attributes']:_0x2419c7[_0x64a4('0x31')];if(_0x10bf08[_0x64a4('0x2e')]['includeAll']){_0x5968e7['include']=[{'all':!![]}];}_0x5968e7=_[_0x64a4('0x40')]({},_0x5968e7,_0x10bf08[_0x64a4('0x41')]);return db['VoiceAgentReport'][_0x64a4('0x42')](_0x5968e7)[_0x64a4('0x21')](handleEntityNotFound(_0x22c0c5,null))['then'](respondWithResult(_0x22c0c5,null))[_0x64a4('0x43')](handleError(_0x22c0c5,null));};exports['create']=function(_0x46b4f6,_0x146595){return db[_0x64a4('0x29')]['create'](_0x46b4f6[_0x64a4('0x44')],{})['then'](respondWithResult(_0x146595,0xc9))[_0x64a4('0x43')](handleError(_0x146595,null));};exports[_0x64a4('0x20')]=function(_0x4e364b,_0x406746){if(_0x4e364b[_0x64a4('0x44')]['id']){delete _0x4e364b[_0x64a4('0x44')]['id'];}return db[_0x64a4('0x29')][_0x64a4('0x42')]({'where':{'id':_0x4e364b[_0x64a4('0x45')]['id']}})[_0x64a4('0x21')](handleEntityNotFound(_0x406746,null))['then'](saveUpdates(_0x4e364b[_0x64a4('0x44')],null))[_0x64a4('0x21')](respondWithResult(_0x406746,null))['catch'](handleError(_0x406746,null));};exports[_0x64a4('0x22')]=function(_0x44f0e3,_0x206010){return db[_0x64a4('0x29')][_0x64a4('0x42')]({'where':{'id':_0x44f0e3['params']['id']}})[_0x64a4('0x21')](handleEntityNotFound(_0x206010,null))[_0x64a4('0x21')](removeEntity(_0x206010,null))[_0x64a4('0x43')](handleError(_0x206010,null));};exports['describe']=function(_0xca31f6,_0x891c6a){return db[_0x64a4('0x29')][_0x64a4('0x46')]()[_0x64a4('0x21')](respondWithResult(_0x891c6a,null))[_0x64a4('0x43')](handleError(_0x891c6a,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index ad62604..b05f86e 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 _0x3d3d=['../../config/environment','./voiceAgentReport.attributes','exports','VoiceAgentReport','report_agent','destuniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x5ba7bd,_0x133177){var _0x481562=function(_0x4e2f29){while(--_0x4e2f29){_0x5ba7bd['push'](_0x5ba7bd['shift']());}};_0x481562(++_0x133177);}(_0x3d3d,0x12c));var _0xd3d3=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3d3d[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0xd3d3('0x0'));var logger=require(_0xd3d3('0x1'))(_0xd3d3('0x2'));var moment=require(_0xd3d3('0x3'));var BPromise=require(_0xd3d3('0x4'));var rp=require(_0xd3d3('0x5'));var fs=require('fs');var path=require(_0xd3d3('0x6'));var rimraf=require(_0xd3d3('0x7'));var config=require(_0xd3d3('0x8'));var attributes=require(_0xd3d3('0x9'));module[_0xd3d3('0xa')]=function(_0x19e40d,_0x12e3d7){return _0x19e40d['define'](_0xd3d3('0xb'),attributes,{'tableName':_0xd3d3('0xc'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xd3d3('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x97ec=['destuniqueid','lodash','util','../../config/logger','api','moment','bluebird','path','./voiceAgentReport.attributes','define','report_agent','uniqueid'];(function(_0x381f56,_0x588ccf){var _0x464144=function(_0x2b5a5e){while(--_0x2b5a5e){_0x381f56['push'](_0x381f56['shift']());}};_0x464144(++_0x588ccf);}(_0x97ec,0x79));var _0xc97e=function(_0x1a6cb2,_0x1945e0){_0x1a6cb2=_0x1a6cb2-0x0;var _0x1482a1=_0x97ec[_0x1a6cb2];return _0x1482a1;};'use strict';var _=require(_0xc97e('0x0'));var util=require(_0xc97e('0x1'));var logger=require(_0xc97e('0x2'))(_0xc97e('0x3'));var moment=require(_0xc97e('0x4'));var BPromise=require(_0xc97e('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc97e('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xc97e('0x7'));module['exports']=function(_0x7fe0b,_0x580dde){return _0x7fe0b[_0xc97e('0x8')]('VoiceAgentReport',attributes,{'tableName':_0xc97e('0x9'),'paranoid':![],'indexes':[{'fields':[_0xc97e('0xa'),_0xc97e('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 549fb0f..f1721c1 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 _0xda63=['stringify','error','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','body','options','raw','UpdateVoiceAgentReport','where','attributes','limit','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s'];(function(_0xec2ecb,_0x5e7341){var _0x52c1bd=function(_0x10fb14){while(--_0x10fb14){_0xec2ecb['push'](_0xec2ecb['shift']());}};_0x52c1bd(++_0x5e7341);}(_0xda63,0x1b2));var _0x3da6=function(_0x34839f,_0x39ba16){_0x34839f=_0x34839f-0x0;var _0x34b8f5=_0xda63[_0x34839f];return _0x34b8f5;};'use strict';var _=require('lodash');var util=require(_0x3da6('0x0'));var moment=require('moment');var BPromise=require(_0x3da6('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3da6('0x2'));var db=require(_0x3da6('0x3'))['db'];var utils=require(_0x3da6('0x4'));var logger=require('../../config/logger')(_0x3da6('0x5'));var config=require(_0x3da6('0x6'));var jayson=require(_0x3da6('0x7'));var client=jayson[_0x3da6('0x8')][_0x3da6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x20d28a,_0x124a5c,_0x236466){return new BPromise(function(_0x4e5e46,_0x2400c2){return client['request'](_0x20d28a,_0x236466)[_0x3da6('0xa')](function(_0x352022){logger[_0x3da6('0xb')](_0x3da6('0xc'),_0x124a5c,_0x3da6('0xd'));logger[_0x3da6('0xe')](_0x3da6('0xf'),_0x124a5c,_0x3da6('0xd'),JSON[_0x3da6('0x10')](_0x352022));if(_0x352022[_0x3da6('0x11')]){if(_0x352022['error']['code']===0x1f4){logger[_0x3da6('0x11')]('VoiceAgentReport,\x20%s,\x20%s',_0x124a5c,_0x352022[_0x3da6('0x11')][_0x3da6('0x12')]);return _0x2400c2(_0x352022[_0x3da6('0x11')]['message']);}logger[_0x3da6('0x11')](_0x3da6('0xc'),_0x124a5c,_0x352022[_0x3da6('0x11')][_0x3da6('0x12')]);return _0x4e5e46(_0x352022[_0x3da6('0x11')][_0x3da6('0x12')]);}else{logger[_0x3da6('0xb')](_0x3da6('0xc'),_0x124a5c,_0x3da6('0xd'));_0x4e5e46(_0x352022[_0x3da6('0x13')][_0x3da6('0x12')]);}})[_0x3da6('0x14')](function(_0x4a5cb1){logger[_0x3da6('0x11')](_0x3da6('0xc'),_0x124a5c,_0x4a5cb1);_0x2400c2(_0x4a5cb1);});});}exports[_0x3da6('0x15')]=function(_0x58c892){var _0x5eeea2=this;return new Promise(function(_0x2cd586,_0x4b9f7d){return db[_0x3da6('0x16')]['create'](_0x58c892[_0x3da6('0x17')],{'raw':_0x58c892['options']?_0x58c892[_0x3da6('0x18')][_0x3da6('0x19')]===undefined?!![]:![]:!![]})[_0x3da6('0xa')](function(_0x20b297){logger[_0x3da6('0xb')](_0x3da6('0x15'),_0x58c892);logger['debug'](_0x3da6('0x15'),_0x58c892,JSON[_0x3da6('0x10')](_0x20b297));_0x2cd586(_0x20b297);})[_0x3da6('0x14')](function(_0x3556fd){logger[_0x3da6('0x11')](_0x3da6('0x15'),_0x3556fd['message'],_0x58c892);_0x4b9f7d(_0x5eeea2['error'](0x1f4,_0x3556fd[_0x3da6('0x12')]));});});};exports[_0x3da6('0x1a')]=function(_0x22c98e){var _0x19d0b9=this;return new Promise(function(_0x2f9ec5,_0x1c552d){return db['VoiceAgentReport']['update'](_0x22c98e['body'],{'raw':_0x22c98e[_0x3da6('0x18')]?_0x22c98e['options'][_0x3da6('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x22c98e[_0x3da6('0x18')]?_0x22c98e['options'][_0x3da6('0x1b')]||null:null,'attributes':_0x22c98e[_0x3da6('0x18')]?_0x22c98e[_0x3da6('0x18')][_0x3da6('0x1c')]||null:null,'limit':_0x22c98e['options']?_0x22c98e[_0x3da6('0x18')][_0x3da6('0x1d')]||null:null})['then'](function(_0x3a08bf){logger[_0x3da6('0xb')](_0x3da6('0x1a'),_0x22c98e);logger[_0x3da6('0xe')]('UpdateVoiceAgentReport',_0x22c98e,JSON[_0x3da6('0x10')](_0x3a08bf));_0x2f9ec5(_0x3a08bf);})[_0x3da6('0x14')](function(_0xa1b425){logger['error'](_0x3da6('0x1a'),_0xa1b425[_0x3da6('0x12')],_0x22c98e);_0x1c552d(_0x19d0b9[_0x3da6('0x11')](0x1f4,_0xa1b425['message']));});});}; \ No newline at end of file +var _0xd264=['http','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','CreateVoiceAgentReport','VoiceAgentReport','create','body','options','raw','then','UpdateVoiceAgentReport','update','attributes','limit','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5f3770,_0x2740cf){var _0x5f2506=function(_0x3ab185){while(--_0x3ab185){_0x5f3770['push'](_0x5f3770['shift']());}};_0x5f2506(++_0x2740cf);}(_0xd264,0x1e5));var _0x4d26=function(_0x5a9210,_0x267737){_0x5a9210=_0x5a9210-0x0;var _0x3fba45=_0xd264[_0x5a9210];return _0x3fba45;};'use strict';var _=require(_0x4d26('0x0'));var util=require(_0x4d26('0x1'));var moment=require(_0x4d26('0x2'));var BPromise=require(_0x4d26('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d26('0x4'))['db'];var utils=require(_0x4d26('0x5'));var logger=require(_0x4d26('0x6'))(_0x4d26('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4d26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x322354,_0x29210b,_0x50ae88){return new BPromise(function(_0x3245fa,_0x1ace2f){return client['request'](_0x322354,_0x50ae88)['then'](function(_0x465ebc){logger['info'](_0x4d26('0x9'),_0x29210b,_0x4d26('0xa'));logger[_0x4d26('0xb')]('VoiceAgentReport,\x20%s,\x20%s,\x20%s',_0x29210b,_0x4d26('0xa'),JSON[_0x4d26('0xc')](_0x465ebc));if(_0x465ebc[_0x4d26('0xd')]){if(_0x465ebc[_0x4d26('0xd')][_0x4d26('0xe')]===0x1f4){logger[_0x4d26('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x29210b,_0x465ebc[_0x4d26('0xd')][_0x4d26('0xf')]);return _0x1ace2f(_0x465ebc[_0x4d26('0xd')][_0x4d26('0xf')]);}logger[_0x4d26('0xd')](_0x4d26('0x9'),_0x29210b,_0x465ebc[_0x4d26('0xd')]['message']);return _0x3245fa(_0x465ebc[_0x4d26('0xd')][_0x4d26('0xf')]);}else{logger[_0x4d26('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x29210b,_0x4d26('0xa'));_0x3245fa(_0x465ebc[_0x4d26('0x11')]['message']);}})['catch'](function(_0x2b3cd5){logger[_0x4d26('0xd')]('VoiceAgentReport,\x20%s,\x20%s',_0x29210b,_0x2b3cd5);_0x1ace2f(_0x2b3cd5);});});}exports[_0x4d26('0x12')]=function(_0x5f43c0){var _0x34089a=this;return new Promise(function(_0x5ea3bb,_0x15e711){return db[_0x4d26('0x13')][_0x4d26('0x14')](_0x5f43c0[_0x4d26('0x15')],{'raw':_0x5f43c0[_0x4d26('0x16')]?_0x5f43c0[_0x4d26('0x16')][_0x4d26('0x17')]===undefined?!![]:![]:!![]})[_0x4d26('0x18')](function(_0x15e0ad){logger['info'](_0x4d26('0x12'),_0x5f43c0);logger['debug'](_0x4d26('0x12'),_0x5f43c0,JSON['stringify'](_0x15e0ad));_0x5ea3bb(_0x15e0ad);})['catch'](function(_0x1ef540){logger['error']('CreateVoiceAgentReport',_0x1ef540[_0x4d26('0xf')],_0x5f43c0);_0x15e711(_0x34089a[_0x4d26('0xd')](0x1f4,_0x1ef540['message']));});});};exports[_0x4d26('0x19')]=function(_0x398af1){var _0x19bb85=this;return new Promise(function(_0x5c43d8,_0xf36875){return db[_0x4d26('0x13')][_0x4d26('0x1a')](_0x398af1[_0x4d26('0x15')],{'raw':_0x398af1['options']?_0x398af1['options'][_0x4d26('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x398af1[_0x4d26('0x16')]?_0x398af1[_0x4d26('0x16')]['where']||null:null,'attributes':_0x398af1['options']?_0x398af1[_0x4d26('0x16')][_0x4d26('0x1b')]||null:null,'limit':_0x398af1['options']?_0x398af1[_0x4d26('0x16')][_0x4d26('0x1c')]||null:null})[_0x4d26('0x18')](function(_0x221f05){logger[_0x4d26('0x10')](_0x4d26('0x19'),_0x398af1);logger[_0x4d26('0xb')](_0x4d26('0x19'),_0x398af1,JSON[_0x4d26('0xc')](_0x221f05));_0x5c43d8(_0x221f05);})['catch'](function(_0x808cca){logger['error'](_0x4d26('0x19'),_0x808cca[_0x4d26('0xf')],_0x398af1);_0xf36875(_0x19bb85['error'](0x1f4,_0x808cca['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index c2fcf89..db59799 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 _0x11ae=['util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','describe','/:id','show','post','put','delete','destroy','exports','multer'];(function(_0x4bdc8f,_0x4433bf){var _0x4d24f6=function(_0x5e6685){while(--_0x5e6685){_0x4bdc8f['push'](_0x4bdc8f['shift']());}};_0x4d24f6(++_0x4433bf);}(_0x11ae,0xef));var _0xe11a=function(_0x4f3bb6,_0x246da9){_0x4f3bb6=_0x4f3bb6-0x0;var _0x964d9e=_0x11ae[_0x4f3bb6];return _0x964d9e;};'use strict';var multer=require(_0xe11a('0x0'));var util=require(_0xe11a('0x1'));var path=require(_0xe11a('0x2'));var timeout=require(_0xe11a('0x3'));var express=require(_0xe11a('0x4'));var router=express['Router']();var auth=require(_0xe11a('0x5'));var interaction=require(_0xe11a('0x6'));var config=require(_0xe11a('0x7'));var controller=require(_0xe11a('0x8'));router[_0xe11a('0x9')]('/',auth[_0xe11a('0xa')](),controller[_0xe11a('0xb')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0xe11a('0xc')]);router['get'](_0xe11a('0xd'),auth[_0xe11a('0xa')](),controller[_0xe11a('0xe')]);router[_0xe11a('0xf')]('/',auth[_0xe11a('0xa')](),controller['create']);router[_0xe11a('0x10')](_0xe11a('0xd'),auth[_0xe11a('0xa')](),controller['update']);router[_0xe11a('0x11')]('/:id',auth[_0xe11a('0xa')](),controller[_0xe11a('0x12')]);module[_0xe11a('0x13')]=router; \ No newline at end of file +var _0x482e=['create','update','delete','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','isAuthenticated','index','/describe','describe','/:id','post'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x482e,0x1bd));var _0xe482=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x482e[_0x3740fe];return _0x55492b;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xe482('0x0'));var express=require(_0xe482('0x1'));var router=express[_0xe482('0x2')]();var auth=require(_0xe482('0x3'));var interaction=require(_0xe482('0x4'));var config=require(_0xe482('0x5'));var controller=require(_0xe482('0x6'));router[_0xe482('0x7')]('/',auth[_0xe482('0x8')](),controller[_0xe482('0x9')]);router[_0xe482('0x7')](_0xe482('0xa'),auth['isAuthenticated'](),controller[_0xe482('0xb')]);router[_0xe482('0x7')](_0xe482('0xc'),auth[_0xe482('0x8')](),controller['show']);router[_0xe482('0xd')]('/',auth[_0xe482('0x8')](),controller[_0xe482('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xe482('0xf')]);router[_0xe482('0x10')]('/:id',auth[_0xe482('0x8')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 54c7f63..b8f4026 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 _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x3eb8e7,_0x3b7b0d){var _0x4fa564=function(_0x4f0bc3){while(--_0x4f0bc3){_0x3eb8e7['push'](_0x3eb8e7['shift']());}};_0x4fa564(++_0x3b7b0d);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x255ac0,_0x3f6645){var _0x437bf1=function(_0x5baff0){while(--_0x5baff0){_0x255ac0['push'](_0x255ac0['shift']());}};_0x437bf1(++_0x3f6645);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 5a26321..78a914b 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 _0x52da=['lodash','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','apply','reject','save','update','then','destroy','end','sendStatus','error','stack','name','map','VoiceCallReport','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','sort','where','pick','merge','VIRTUAL','filter','count','include','alias','User','rows','show','params','keys','rawAttributes','options','find','catch','create','body','describe','uniqueid','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs'];(function(_0x3ef4f1,_0x5f0f9b){var _0x69953c=function(_0xb4e621){while(--_0xb4e621){_0x3ef4f1['push'](_0x3ef4f1['shift']());}};_0x69953c(++_0x5f0f9b);}(_0x52da,0xd9));var _0xa52d=function(_0x2bda2b,_0xc5bb5d){_0x2bda2b=_0x2bda2b-0x0;var _0x50dbb2=_0x52da[_0x2bda2b];return _0x50dbb2;};'use strict';var pdf=require(_0xa52d('0x0'));var emlformat=require(_0xa52d('0x1'));var rimraf=require(_0xa52d('0x2'));var zipdir=require(_0xa52d('0x3'));var jsonpatch=require(_0xa52d('0x4'));var rp=require(_0xa52d('0x5'));var moment=require('moment');var BPromise=require(_0xa52d('0x6'));var Mustache=require('mustache');var util=require(_0xa52d('0x7'));var path=require(_0xa52d('0x8'));var sox=require('sox');var csv=require(_0xa52d('0x9'));var ejs=require(_0xa52d('0xa'));var fs=require('fs');var _=require(_0xa52d('0xb'));var squel=require('squel');var crypto=require(_0xa52d('0xc'));var jsforce=require(_0xa52d('0xd'));var deskjs=require(_0xa52d('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa52d('0xf'));var Redis=require('ioredis');var authService=require(_0xa52d('0x10'));var qs=require(_0xa52d('0x11'));var as=require(_0xa52d('0x12'));var hardwareService=require(_0xa52d('0x13'));var logger=require(_0xa52d('0x14'))(_0xa52d('0x15'));var utils=require(_0xa52d('0x16'));var config=require(_0xa52d('0x17'));var db=require(_0xa52d('0x18'))['db'];function respondWithStatusCode(_0x4770d9,_0x3bb40f){_0x3bb40f=_0x3bb40f||0xcc;return function(_0x3efaef){if(_0x3efaef){return _0x4770d9['sendStatus'](_0x3bb40f);}return _0x4770d9[_0xa52d('0x19')](_0x3bb40f)['end']();};}function respondWithResult(_0xd93d7d,_0x3c9936){_0x3c9936=_0x3c9936||0xc8;return function(_0x5edc84){if(_0x5edc84){return _0xd93d7d['status'](_0x3c9936)[_0xa52d('0x1a')](_0x5edc84);}};}function respondWithFilteredResult(_0x5a8d13,_0x51d111){return function(_0x5cf5d3){if(_0x5cf5d3){var _0x3580cd=_0x5cf5d3['count'],_0x32b64c=_0x51d111[_0xa52d('0x1b')],_0x470c2d=_0x51d111['offset']+_0x51d111[_0xa52d('0x1c')],_0x262031;if(_0x470c2d>=_0x3580cd){_0x470c2d=_0x3580cd;_0x262031=0xc8;}else{_0x262031=0xce;}_0x5a8d13['status'](_0x262031);return _0x5a8d13[_0xa52d('0x1d')]('Content-Range',_0x32b64c+'-'+_0x470c2d+'/'+_0x3580cd)[_0xa52d('0x1a')](_0x5cf5d3);}return null;};}function patchUpdates(_0x3762f4){return function(_0x151976){try{jsonpatch[_0xa52d('0x1e')](_0x151976,_0x3762f4,!![]);}catch(_0x5a7979){return BPromise[_0xa52d('0x1f')](_0x5a7979);}return _0x151976[_0xa52d('0x20')]();};}function saveUpdates(_0x5f4e7b,_0x4b467a){return function(_0x340788){if(_0x340788){return _0x340788[_0xa52d('0x21')](_0x5f4e7b)[_0xa52d('0x22')](function(_0x4249ff){return _0x4249ff;});}return null;};}function removeEntity(_0x31971b,_0x57c7c1){return function(_0x1b8ca8){if(_0x1b8ca8){return _0x1b8ca8[_0xa52d('0x23')]()[_0xa52d('0x22')](function(){_0x31971b['status'](0xcc)[_0xa52d('0x24')]();});}};}function handleEntityNotFound(_0x1fce63,_0x5632f1){return function(_0x38d293){if(!_0x38d293){_0x1fce63[_0xa52d('0x25')](0x194);}return _0x38d293;};}function handleError(_0x200326,_0x361163){_0x361163=_0x361163||0x1f4;return function(_0x2bb277){logger[_0xa52d('0x26')](_0x2bb277[_0xa52d('0x27')]);if(_0x2bb277[_0xa52d('0x28')]){delete _0x2bb277[_0xa52d('0x28')];}_0x200326['status'](_0x361163)['send'](_0x2bb277);};}exports['index']=function(_0x436cad,_0x3fd5e1){var _0x1ae874={},_0xcde728={},_0x5f3ae4={'count':0x0,'rows':[]};var _0x49023b=_[_0xa52d('0x29')](db[_0xa52d('0x2a')]['rawAttributes'],function(_0x1a68fb){return{'name':_0x1a68fb[_0xa52d('0x2b')],'type':_0x1a68fb[_0xa52d('0x2c')][_0xa52d('0x2d')]};});_0xcde728[_0xa52d('0x2e')]=_[_0xa52d('0x29')](_0x49023b,_0xa52d('0x28'));_0xcde728['query']=_['keys'](_0x436cad[_0xa52d('0x2f')]);_0xcde728[_0xa52d('0x30')]=_[_0xa52d('0x31')](_0xcde728['model'],_0xcde728[_0xa52d('0x2f')]);_0x1ae874[_0xa52d('0x32')]=_[_0xa52d('0x31')](_0xcde728['model'],qs[_0xa52d('0x33')](_0x436cad['query'][_0xa52d('0x33')]));_0x1ae874[_0xa52d('0x32')]=_0x1ae874[_0xa52d('0x32')][_0xa52d('0x34')]?_0x1ae874['attributes']:_0xcde728[_0xa52d('0x2e')];if(!_0x436cad[_0xa52d('0x2f')]['hasOwnProperty']('nolimit')){_0x1ae874['limit']=qs[_0xa52d('0x1c')](_0x436cad['query'][_0xa52d('0x1c')]);_0x1ae874[_0xa52d('0x1b')]=qs[_0xa52d('0x1b')](_0x436cad[_0xa52d('0x2f')]['offset']);}_0x1ae874['order']=qs[_0xa52d('0x35')](_0x436cad[_0xa52d('0x2f')][_0xa52d('0x35')]);_0x1ae874[_0xa52d('0x36')]=qs['filters'](_[_0xa52d('0x37')](_0x436cad[_0xa52d('0x2f')],_0xcde728['filters']));if(_0x436cad[_0xa52d('0x2f')]['filter']){_0x1ae874['where']=_[_0xa52d('0x38')](_0x1ae874[_0xa52d('0x36')],{'$or':_[_0xa52d('0x29')](_0x49023b,function(_0x532c3b){if(_0x532c3b['type']!==_0xa52d('0x39')){var _0x3ad9dc={};_0x3ad9dc[_0x532c3b['name']]={'$like':'%'+_0x436cad[_0xa52d('0x2f')][_0xa52d('0x3a')]+'%'};return _0x3ad9dc;}})});}_0x1ae874=_[_0xa52d('0x38')]({},_0x1ae874,_0x436cad['options']);var _0x40511e={'where':_0x1ae874[_0xa52d('0x36')]};return db[_0xa52d('0x2a')][_0xa52d('0x3b')](_0x40511e)['then'](function(_0x11abe3){_0x5f3ae4[_0xa52d('0x3b')]=_0x11abe3;if(_0x436cad[_0xa52d('0x2f')]['includeAll']){_0x1ae874[_0xa52d('0x3c')]=[{'attributes':['id',_0xa52d('0x28'),'fullname',_0xa52d('0x3d')],'model':db[_0xa52d('0x3e')],'as':_0xa52d('0x3e')}];}return db['VoiceCallReport']['findAll'](_0x1ae874);})[_0xa52d('0x22')](function(_0x516cb5){_0x5f3ae4[_0xa52d('0x3f')]=_0x516cb5;return _0x5f3ae4;})['then'](respondWithFilteredResult(_0x3fd5e1,_0x1ae874))['catch'](handleError(_0x3fd5e1,null));};exports[_0xa52d('0x40')]=function(_0x236d04,_0x533dfa){var _0x44950b={'raw':!![],'where':{'id':_0x236d04[_0xa52d('0x41')]['id']}},_0x5bef80={};_0x5bef80[_0xa52d('0x2e')]=_[_0xa52d('0x42')](db[_0xa52d('0x2a')][_0xa52d('0x43')]);_0x5bef80[_0xa52d('0x2f')]=_[_0xa52d('0x42')](_0x236d04[_0xa52d('0x2f')]);_0x5bef80[_0xa52d('0x30')]=_[_0xa52d('0x31')](_0x5bef80[_0xa52d('0x2e')],_0x5bef80[_0xa52d('0x2f')]);_0x44950b[_0xa52d('0x32')]=_[_0xa52d('0x31')](_0x5bef80['model'],qs[_0xa52d('0x33')](_0x236d04[_0xa52d('0x2f')][_0xa52d('0x33')]));_0x44950b[_0xa52d('0x32')]=_0x44950b[_0xa52d('0x32')]['length']?_0x44950b['attributes']:_0x5bef80[_0xa52d('0x2e')];if(_0x236d04[_0xa52d('0x2f')]['includeAll']){_0x44950b[_0xa52d('0x3c')]=[{'all':!![]}];}_0x44950b=_[_0xa52d('0x38')]({},_0x44950b,_0x236d04[_0xa52d('0x44')]);return db[_0xa52d('0x2a')][_0xa52d('0x45')](_0x44950b)['then'](handleEntityNotFound(_0x533dfa,null))[_0xa52d('0x22')](respondWithResult(_0x533dfa,null))[_0xa52d('0x46')](handleError(_0x533dfa,null));};exports[_0xa52d('0x47')]=function(_0x1b75a2,_0x17869a){return db[_0xa52d('0x2a')]['create'](_0x1b75a2[_0xa52d('0x48')],{})[_0xa52d('0x22')](respondWithResult(_0x17869a,0xc9))['catch'](handleError(_0x17869a,null));};exports[_0xa52d('0x23')]=function(_0x282a7f,_0x188586){return db[_0xa52d('0x2a')][_0xa52d('0x45')]({'where':{'id':_0x282a7f[_0xa52d('0x41')]['id']}})[_0xa52d('0x22')](handleEntityNotFound(_0x188586,null))[_0xa52d('0x22')](removeEntity(_0x188586,null))[_0xa52d('0x46')](handleError(_0x188586,null));};exports[_0xa52d('0x49')]=function(_0x1e505f,_0x47b82a){return db[_0xa52d('0x2a')][_0xa52d('0x49')]()[_0xa52d('0x22')](respondWithResult(_0x47b82a,null))[_0xa52d('0x46')](handleError(_0x47b82a,null));};exports['update']=function(_0x85f873,_0x33b24d){if(_0x85f873[_0xa52d('0x48')][_0xa52d('0x4a')]){delete _0x85f873[_0xa52d('0x48')][_0xa52d('0x4a')];}return db['VoiceCallReport'][_0xa52d('0x45')]({'where':{'uniqueid':_0x85f873['params']['id'],'UserId':{'$or':[null,_0x85f873[_0xa52d('0x4b')]['id']]}}})[_0xa52d('0x22')](handleEntityNotFound(_0x33b24d,null))[_0xa52d('0x22')](saveUpdates(_0x85f873[_0xa52d('0x48')],null))[_0xa52d('0x22')](respondWithResult(_0x33b24d,null))[_0xa52d('0x46')](handleError(_0x33b24d,null));}; \ No newline at end of file +var _0xe139=['query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','VoiceCallReport','include','alias','User','findAll','rows','catch','show','params','create','describe','uniqueid','find','user','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','send','map','rawAttributes','fieldName','key','model'];(function(_0x2023a6,_0x14a84a){var _0x10bdfa=function(_0x57bcac){while(--_0x57bcac){_0x2023a6['push'](_0x2023a6['shift']());}};_0x10bdfa(++_0x14a84a);}(_0xe139,0xbe));var _0x9e13=function(_0x3bd6d9,_0x5ab39e){_0x3bd6d9=_0x3bd6d9-0x0;var _0x4e5f36=_0xe139[_0x3bd6d9];return _0x4e5f36;};'use strict';var pdf=require(_0x9e13('0x0'));var emlformat=require(_0x9e13('0x1'));var rimraf=require(_0x9e13('0x2'));var zipdir=require(_0x9e13('0x3'));var jsonpatch=require(_0x9e13('0x4'));var rp=require('request-promise');var moment=require(_0x9e13('0x5'));var BPromise=require(_0x9e13('0x6'));var Mustache=require(_0x9e13('0x7'));var util=require(_0x9e13('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9e13('0x9'));var fs=require('fs');var _=require(_0x9e13('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x9e13('0xb'));var querystring=require('querystring');var Papa=require(_0x9e13('0xc'));var Redis=require(_0x9e13('0xd'));var authService=require(_0x9e13('0xe'));var qs=require(_0x9e13('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e13('0x10'))(_0x9e13('0x11'));var utils=require(_0x9e13('0x12'));var config=require(_0x9e13('0x13'));var db=require(_0x9e13('0x14'))['db'];function respondWithStatusCode(_0x26a3aa,_0x21c09f){_0x21c09f=_0x21c09f||0xcc;return function(_0x3f6cdc){if(_0x3f6cdc){return _0x26a3aa[_0x9e13('0x15')](_0x21c09f);}return _0x26a3aa[_0x9e13('0x16')](_0x21c09f)[_0x9e13('0x17')]();};}function respondWithResult(_0x3302aa,_0x282a81){_0x282a81=_0x282a81||0xc8;return function(_0x5ccfbd){if(_0x5ccfbd){return _0x3302aa[_0x9e13('0x16')](_0x282a81)['json'](_0x5ccfbd);}};}function respondWithFilteredResult(_0x6c271,_0x246a61){return function(_0x4582c1){if(_0x4582c1){var _0x59a8d2=_0x4582c1[_0x9e13('0x18')],_0x148007=_0x246a61[_0x9e13('0x19')],_0x55d966=_0x246a61[_0x9e13('0x19')]+_0x246a61['limit'],_0x17baaf;if(_0x55d966>=_0x59a8d2){_0x55d966=_0x59a8d2;_0x17baaf=0xc8;}else{_0x17baaf=0xce;}_0x6c271[_0x9e13('0x16')](_0x17baaf);return _0x6c271[_0x9e13('0x1a')](_0x9e13('0x1b'),_0x148007+'-'+_0x55d966+'/'+_0x59a8d2)[_0x9e13('0x1c')](_0x4582c1);}return null;};}function patchUpdates(_0xd32eb4){return function(_0xb54021){try{jsonpatch[_0x9e13('0x1d')](_0xb54021,_0xd32eb4,!![]);}catch(_0x2ca865){return BPromise[_0x9e13('0x1e')](_0x2ca865);}return _0xb54021[_0x9e13('0x1f')]();};}function saveUpdates(_0x4b216d,_0x1a4122){return function(_0x425bb7){if(_0x425bb7){return _0x425bb7[_0x9e13('0x20')](_0x4b216d)[_0x9e13('0x21')](function(_0x8eec27){return _0x8eec27;});}return null;};}function removeEntity(_0x390348,_0x52c2ce){return function(_0x4b423c){if(_0x4b423c){return _0x4b423c[_0x9e13('0x22')]()['then'](function(){_0x390348[_0x9e13('0x16')](0xcc)[_0x9e13('0x17')]();});}};}function handleEntityNotFound(_0x32c390,_0x5eedc5){return function(_0x348af4){if(!_0x348af4){_0x32c390[_0x9e13('0x15')](0x194);}return _0x348af4;};}function handleError(_0x46f4d4,_0x57a531){_0x57a531=_0x57a531||0x1f4;return function(_0x3833e9){logger[_0x9e13('0x23')](_0x3833e9[_0x9e13('0x24')]);if(_0x3833e9[_0x9e13('0x25')]){delete _0x3833e9[_0x9e13('0x25')];}_0x46f4d4[_0x9e13('0x16')](_0x57a531)[_0x9e13('0x26')](_0x3833e9);};}exports['index']=function(_0xa34c4,_0x2aa275){var _0x56a0eb={},_0x509704={},_0x2ad125={'count':0x0,'rows':[]};var _0x34a123=_[_0x9e13('0x27')](db['VoiceCallReport'][_0x9e13('0x28')],function(_0x3ac7c4){return{'name':_0x3ac7c4[_0x9e13('0x29')],'type':_0x3ac7c4['type'][_0x9e13('0x2a')]};});_0x509704[_0x9e13('0x2b')]=_[_0x9e13('0x27')](_0x34a123,_0x9e13('0x25'));_0x509704[_0x9e13('0x2c')]=_[_0x9e13('0x2d')](_0xa34c4[_0x9e13('0x2c')]);_0x509704[_0x9e13('0x2e')]=_['intersection'](_0x509704[_0x9e13('0x2b')],_0x509704[_0x9e13('0x2c')]);_0x56a0eb[_0x9e13('0x2f')]=_[_0x9e13('0x30')](_0x509704[_0x9e13('0x2b')],qs[_0x9e13('0x31')](_0xa34c4[_0x9e13('0x2c')][_0x9e13('0x31')]));_0x56a0eb[_0x9e13('0x2f')]=_0x56a0eb[_0x9e13('0x2f')][_0x9e13('0x32')]?_0x56a0eb[_0x9e13('0x2f')]:_0x509704[_0x9e13('0x2b')];if(!_0xa34c4[_0x9e13('0x2c')][_0x9e13('0x33')](_0x9e13('0x34'))){_0x56a0eb['limit']=qs[_0x9e13('0x35')](_0xa34c4['query'][_0x9e13('0x35')]);_0x56a0eb[_0x9e13('0x19')]=qs['offset'](_0xa34c4[_0x9e13('0x2c')][_0x9e13('0x19')]);}_0x56a0eb[_0x9e13('0x36')]=qs[_0x9e13('0x37')](_0xa34c4['query'][_0x9e13('0x37')]);_0x56a0eb[_0x9e13('0x38')]=qs[_0x9e13('0x2e')](_[_0x9e13('0x39')](_0xa34c4[_0x9e13('0x2c')],_0x509704[_0x9e13('0x2e')]));if(_0xa34c4[_0x9e13('0x2c')][_0x9e13('0x3a')]){_0x56a0eb[_0x9e13('0x38')]=_[_0x9e13('0x3b')](_0x56a0eb[_0x9e13('0x38')],{'$or':_[_0x9e13('0x27')](_0x34a123,function(_0x6a405e){if(_0x6a405e[_0x9e13('0x3c')]!==_0x9e13('0x3d')){var _0x2fee15={};_0x2fee15[_0x6a405e[_0x9e13('0x25')]]={'$like':'%'+_0xa34c4[_0x9e13('0x2c')][_0x9e13('0x3a')]+'%'};return _0x2fee15;}})});}_0x56a0eb=_[_0x9e13('0x3b')]({},_0x56a0eb,_0xa34c4[_0x9e13('0x3e')]);var _0xb04bf1={'where':_0x56a0eb['where']};return db[_0x9e13('0x3f')][_0x9e13('0x18')](_0xb04bf1)[_0x9e13('0x21')](function(_0x314f4a){_0x2ad125['count']=_0x314f4a;if(_0xa34c4[_0x9e13('0x2c')]['includeAll']){_0x56a0eb[_0x9e13('0x40')]=[{'attributes':['id',_0x9e13('0x25'),'fullname',_0x9e13('0x41')],'model':db[_0x9e13('0x42')],'as':_0x9e13('0x42')}];}return db['VoiceCallReport'][_0x9e13('0x43')](_0x56a0eb);})[_0x9e13('0x21')](function(_0x9bcb4f){_0x2ad125[_0x9e13('0x44')]=_0x9bcb4f;return _0x2ad125;})[_0x9e13('0x21')](respondWithFilteredResult(_0x2aa275,_0x56a0eb))[_0x9e13('0x45')](handleError(_0x2aa275,null));};exports[_0x9e13('0x46')]=function(_0x52ff57,_0x5c87e7){var _0x45f6d4={'raw':!![],'where':{'id':_0x52ff57[_0x9e13('0x47')]['id']}},_0x41fbf0={};_0x41fbf0['model']=_[_0x9e13('0x2d')](db[_0x9e13('0x3f')][_0x9e13('0x28')]);_0x41fbf0[_0x9e13('0x2c')]=_['keys'](_0x52ff57[_0x9e13('0x2c')]);_0x41fbf0['filters']=_[_0x9e13('0x30')](_0x41fbf0[_0x9e13('0x2b')],_0x41fbf0['query']);_0x45f6d4['attributes']=_[_0x9e13('0x30')](_0x41fbf0[_0x9e13('0x2b')],qs[_0x9e13('0x31')](_0x52ff57['query'][_0x9e13('0x31')]));_0x45f6d4['attributes']=_0x45f6d4[_0x9e13('0x2f')][_0x9e13('0x32')]?_0x45f6d4[_0x9e13('0x2f')]:_0x41fbf0[_0x9e13('0x2b')];if(_0x52ff57[_0x9e13('0x2c')]['includeAll']){_0x45f6d4[_0x9e13('0x40')]=[{'all':!![]}];}_0x45f6d4=_[_0x9e13('0x3b')]({},_0x45f6d4,_0x52ff57[_0x9e13('0x3e')]);return db[_0x9e13('0x3f')]['find'](_0x45f6d4)[_0x9e13('0x21')](handleEntityNotFound(_0x5c87e7,null))[_0x9e13('0x21')](respondWithResult(_0x5c87e7,null))['catch'](handleError(_0x5c87e7,null));};exports[_0x9e13('0x48')]=function(_0x432e1d,_0x2cf11e){return db[_0x9e13('0x3f')][_0x9e13('0x48')](_0x432e1d['body'],{})[_0x9e13('0x21')](respondWithResult(_0x2cf11e,0xc9))[_0x9e13('0x45')](handleError(_0x2cf11e,null));};exports[_0x9e13('0x22')]=function(_0x1e903a,_0x5d4074){return db[_0x9e13('0x3f')]['find']({'where':{'id':_0x1e903a['params']['id']}})['then'](handleEntityNotFound(_0x5d4074,null))[_0x9e13('0x21')](removeEntity(_0x5d4074,null))[_0x9e13('0x45')](handleError(_0x5d4074,null));};exports[_0x9e13('0x49')]=function(_0x3011c7,_0x38a828){return db[_0x9e13('0x3f')][_0x9e13('0x49')]()[_0x9e13('0x21')](respondWithResult(_0x38a828,null))[_0x9e13('0x45')](handleError(_0x38a828,null));};exports[_0x9e13('0x20')]=function(_0x1315bc,_0x2595b6){if(_0x1315bc['body'][_0x9e13('0x4a')]){delete _0x1315bc['body'][_0x9e13('0x4a')];}return db['VoiceCallReport'][_0x9e13('0x4b')]({'where':{'uniqueid':_0x1315bc[_0x9e13('0x47')]['id'],'UserId':{'$or':[null,_0x1315bc[_0x9e13('0x4c')]['id']]}}})['then'](handleEntityNotFound(_0x2595b6,null))['then'](saveUpdates(_0x1315bc[_0x9e13('0x4d')],null))[_0x9e13('0x21')](respondWithResult(_0x2595b6,null))['catch'](handleError(_0x2595b6,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 11fc8d5..c2c9c63 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 _0x9d73=['moment','bluebird','request-promise','path','rimraf','../../config/environment','uniqueid','../../config/logger'];(function(_0x2e5cc2,_0x5b38e){var _0x278899=function(_0x5807b2){while(--_0x5807b2){_0x2e5cc2['push'](_0x2e5cc2['shift']());}};_0x278899(++_0x5b38e);}(_0x9d73,0x7f));var _0x39d7=function(_0x4333dc,_0x28a28e){_0x4333dc=_0x4333dc-0x0;var _0xc622e7=_0x9d73[_0x4333dc];return _0xc622e7;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x39d7('0x0'))('api');var moment=require(_0x39d7('0x1'));var BPromise=require(_0x39d7('0x2'));var rp=require(_0x39d7('0x3'));var fs=require('fs');var path=require(_0x39d7('0x4'));var rimraf=require(_0x39d7('0x5'));var config=require(_0x39d7('0x6'));var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0x4828a7,_0x34b51f){return _0x4828a7['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0x39d7('0x7')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x389d=['path','rimraf','uniqueid','lodash','moment','bluebird','request-promise'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0x389d,0x168));var _0xd389=function(_0x193a6e,_0x45dd00){_0x193a6e=_0x193a6e-0x0;var _0x599a9b=_0x389d[_0x193a6e];return _0x599a9b;};'use strict';var _=require(_0xd389('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xd389('0x1'));var BPromise=require(_0xd389('0x2'));var rp=require(_0xd389('0x3'));var fs=require('fs');var path=require(_0xd389('0x4'));var rimraf=require(_0xd389('0x5'));var config=require('../../config/environment');var attributes=require('./voiceCallReport.attributes');module['exports']=function(_0xea15d6,_0x245119){return _0xea15d6['define']('VoiceCallReport',attributes,{'tableName':'report_call','paranoid':![],'indexes':[{'fields':[_0xd389('0x6')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index cd9a07f..402dee0 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 _0xb4d7=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','attributes','include','map','model','create','body','CreateVoiceCallReport','update','limit','UpdateVoiceCallReport','lodash'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xb4d7,0x71));var _0x7b4d=function(_0x516c10,_0x1a8b0f){_0x516c10=_0x516c10-0x0;var _0x1c1526=_0xb4d7[_0x516c10];return _0x1c1526;};'use strict';var _=require(_0x7b4d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x7b4d('0x1'));var fs=require('fs');var Redis=require(_0x7b4d('0x2'));var db=require(_0x7b4d('0x3'))['db'];var utils=require(_0x7b4d('0x4'));var logger=require(_0x7b4d('0x5'))(_0x7b4d('0x6'));var config=require(_0x7b4d('0x7'));var jayson=require(_0x7b4d('0x8'));var client=jayson[_0x7b4d('0x9')][_0x7b4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5101d5,_0x4516f1,_0x4d4486){return new BPromise(function(_0x2cf94d,_0x29ad62){return client['request'](_0x5101d5,_0x4d4486)[_0x7b4d('0xb')](function(_0x475d79){logger[_0x7b4d('0xc')](_0x7b4d('0xd'),_0x4516f1,_0x7b4d('0xe'));logger[_0x7b4d('0xf')](_0x7b4d('0x10'),_0x4516f1,_0x7b4d('0xe'),JSON[_0x7b4d('0x11')](_0x475d79));if(_0x475d79[_0x7b4d('0x12')]){if(_0x475d79[_0x7b4d('0x12')][_0x7b4d('0x13')]===0x1f4){logger[_0x7b4d('0x12')](_0x7b4d('0xd'),_0x4516f1,_0x475d79['error'][_0x7b4d('0x14')]);return _0x29ad62(_0x475d79[_0x7b4d('0x12')][_0x7b4d('0x14')]);}logger[_0x7b4d('0x12')](_0x7b4d('0xd'),_0x4516f1,_0x475d79['error'][_0x7b4d('0x14')]);return _0x2cf94d(_0x475d79[_0x7b4d('0x12')][_0x7b4d('0x14')]);}else{logger['info'](_0x7b4d('0xd'),_0x4516f1,_0x7b4d('0xe'));_0x2cf94d(_0x475d79['result'][_0x7b4d('0x14')]);}})[_0x7b4d('0x15')](function(_0x23ffc2){logger[_0x7b4d('0x12')](_0x7b4d('0xd'),_0x4516f1,_0x23ffc2);_0x29ad62(_0x23ffc2);});});}exports[_0x7b4d('0x16')]=function(_0x4c4886){var _0x4b2939=this;return new Promise(function(_0x5f1e71,_0x513971){return db[_0x7b4d('0x17')][_0x7b4d('0x18')]({'raw':_0x4c4886[_0x7b4d('0x19')]?_0x4c4886['options'][_0x7b4d('0x1a')]===undefined?!![]:![]:!![],'where':_0x4c4886[_0x7b4d('0x19')]?_0x4c4886[_0x7b4d('0x19')][_0x7b4d('0x1b')]||null:null,'attributes':_0x4c4886['options']?_0x4c4886[_0x7b4d('0x19')][_0x7b4d('0x1c')]||null:null,'limit':_0x4c4886[_0x7b4d('0x19')]?_0x4c4886[_0x7b4d('0x19')]['limit']||null:null,'include':_0x4c4886[_0x7b4d('0x19')]?_0x4c4886['options'][_0x7b4d('0x1d')]?_[_0x7b4d('0x1e')](_0x4c4886[_0x7b4d('0x19')][_0x7b4d('0x1d')],function(_0x3448f9){return{'model':db[_0x3448f9[_0x7b4d('0x1f')]],'as':_0x3448f9['as'],'attributes':_0x3448f9[_0x7b4d('0x1c')],'include':_0x3448f9[_0x7b4d('0x1d')]?_[_0x7b4d('0x1e')](_0x3448f9['include'],function(_0x377649){return{'model':db[_0x377649[_0x7b4d('0x1f')]],'as':_0x377649['as'],'attributes':_0x377649[_0x7b4d('0x1c')],'include':_0x377649[_0x7b4d('0x1d')]?_[_0x7b4d('0x1e')](_0x377649[_0x7b4d('0x1d')],function(_0x2db07d){return{'model':db[_0x2db07d[_0x7b4d('0x1f')]],'as':_0x2db07d['as'],'attributes':_0x2db07d[_0x7b4d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7b4d('0xb')](function(_0x50e2a3){logger[_0x7b4d('0xc')](_0x7b4d('0x16'),_0x4c4886);logger[_0x7b4d('0xf')](_0x7b4d('0x16'),_0x4c4886,JSON['stringify'](_0x50e2a3));_0x5f1e71(_0x50e2a3);})[_0x7b4d('0x15')](function(_0x3e9fcd){logger['error'](_0x7b4d('0x16'),_0x3e9fcd[_0x7b4d('0x14')],_0x4c4886);_0x513971(_0x4b2939[_0x7b4d('0x12')](0x1f4,_0x3e9fcd['message']));});});};exports['CreateVoiceCallReport']=function(_0x16fbf5){var _0xfe1d06=this;return new Promise(function(_0x37f3a5,_0x32dc65){return db[_0x7b4d('0x17')][_0x7b4d('0x20')](_0x16fbf5[_0x7b4d('0x21')],{'raw':_0x16fbf5['options']?_0x16fbf5['options'][_0x7b4d('0x1a')]===undefined?!![]:![]:!![]})[_0x7b4d('0xb')](function(_0x35166e){logger[_0x7b4d('0xc')](_0x7b4d('0x22'),_0x16fbf5);logger['debug'](_0x7b4d('0x22'),_0x16fbf5,JSON[_0x7b4d('0x11')](_0x35166e));_0x37f3a5(_0x35166e);})[_0x7b4d('0x15')](function(_0x398135){logger[_0x7b4d('0x12')](_0x7b4d('0x22'),_0x398135[_0x7b4d('0x14')],_0x16fbf5);_0x32dc65(_0xfe1d06[_0x7b4d('0x12')](0x1f4,_0x398135['message']));});});};exports['UpdateVoiceCallReport']=function(_0x35cb4d){var _0x5ceae6=this;return new Promise(function(_0x11e204,_0x481095){return db[_0x7b4d('0x17')][_0x7b4d('0x23')](_0x35cb4d[_0x7b4d('0x21')],{'raw':_0x35cb4d[_0x7b4d('0x19')]?_0x35cb4d[_0x7b4d('0x19')][_0x7b4d('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x35cb4d[_0x7b4d('0x19')]?_0x35cb4d[_0x7b4d('0x19')][_0x7b4d('0x1b')]||null:null,'attributes':_0x35cb4d[_0x7b4d('0x19')]?_0x35cb4d[_0x7b4d('0x19')][_0x7b4d('0x1c')]||null:null,'limit':_0x35cb4d[_0x7b4d('0x19')]?_0x35cb4d[_0x7b4d('0x19')][_0x7b4d('0x24')]||null:null})['then'](function(_0x2fae3e){logger[_0x7b4d('0xc')](_0x7b4d('0x25'),_0x35cb4d);logger[_0x7b4d('0xf')](_0x7b4d('0x25'),_0x35cb4d,JSON[_0x7b4d('0x11')](_0x2fae3e));_0x11e204(_0x2fae3e);})[_0x7b4d('0x15')](function(_0x338581){logger['error'](_0x7b4d('0x25'),_0x338581[_0x7b4d('0x14')],_0x35cb4d);_0x481095(_0x5ceae6[_0x7b4d('0x12')](0x1f4,_0x338581[_0x7b4d('0x14')]));});});}; \ No newline at end of file +var _0x9970=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','VoiceCallReport,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','limit','include','map','model','attributes','debug','CreateVoiceCallReport','create','body','UpdateVoiceCallReport','lodash','util','moment','randomstring'];(function(_0x486bd5,_0x1077a1){var _0x246e56=function(_0x4cb43c){while(--_0x4cb43c){_0x486bd5['push'](_0x486bd5['shift']());}};_0x246e56(++_0x1077a1);}(_0x9970,0x10d));var _0x0997=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x9970[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x0997('0x0'));var util=require(_0x0997('0x1'));var moment=require(_0x0997('0x2'));var BPromise=require('bluebird');var rs=require(_0x0997('0x3'));var fs=require('fs');var Redis=require(_0x0997('0x4'));var db=require(_0x0997('0x5'))['db'];var utils=require(_0x0997('0x6'));var logger=require(_0x0997('0x7'))(_0x0997('0x8'));var config=require('../../config/environment');var jayson=require(_0x0997('0x9'));var client=jayson[_0x0997('0xa')][_0x0997('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x245fc3,_0x224f16,_0x12d263){return new BPromise(function(_0x2b3912,_0x49f22b){return client[_0x0997('0xc')](_0x245fc3,_0x12d263)[_0x0997('0xd')](function(_0x4c323f){logger['info'](_0x0997('0xe'),_0x224f16,'request\x20sent');logger['debug']('VoiceCallReport,\x20%s,\x20%s,\x20%s',_0x224f16,'request\x20sent',JSON[_0x0997('0xf')](_0x4c323f));if(_0x4c323f[_0x0997('0x10')]){if(_0x4c323f['error'][_0x0997('0x11')]===0x1f4){logger[_0x0997('0x10')](_0x0997('0xe'),_0x224f16,_0x4c323f['error'][_0x0997('0x12')]);return _0x49f22b(_0x4c323f['error']['message']);}logger[_0x0997('0x10')](_0x0997('0xe'),_0x224f16,_0x4c323f['error'][_0x0997('0x12')]);return _0x2b3912(_0x4c323f[_0x0997('0x10')][_0x0997('0x12')]);}else{logger[_0x0997('0x13')](_0x0997('0xe'),_0x224f16,_0x0997('0x14'));_0x2b3912(_0x4c323f[_0x0997('0x15')][_0x0997('0x12')]);}})[_0x0997('0x16')](function(_0x20336e){logger[_0x0997('0x10')](_0x0997('0xe'),_0x224f16,_0x20336e);_0x49f22b(_0x20336e);});});}exports[_0x0997('0x17')]=function(_0x3c80a7){var _0x5e4d9d=this;return new Promise(function(_0x282e9d,_0xbfd9fe){return db[_0x0997('0x18')][_0x0997('0x19')]({'raw':_0x3c80a7[_0x0997('0x1a')]?_0x3c80a7['options'][_0x0997('0x1b')]===undefined?!![]:![]:!![],'where':_0x3c80a7['options']?_0x3c80a7[_0x0997('0x1a')][_0x0997('0x1c')]||null:null,'attributes':_0x3c80a7[_0x0997('0x1a')]?_0x3c80a7[_0x0997('0x1a')]['attributes']||null:null,'limit':_0x3c80a7['options']?_0x3c80a7['options'][_0x0997('0x1d')]||null:null,'include':_0x3c80a7['options']?_0x3c80a7[_0x0997('0x1a')][_0x0997('0x1e')]?_[_0x0997('0x1f')](_0x3c80a7['options']['include'],function(_0x2ac687){return{'model':db[_0x2ac687[_0x0997('0x20')]],'as':_0x2ac687['as'],'attributes':_0x2ac687[_0x0997('0x21')],'include':_0x2ac687['include']?_[_0x0997('0x1f')](_0x2ac687['include'],function(_0x55670b){return{'model':db[_0x55670b[_0x0997('0x20')]],'as':_0x55670b['as'],'attributes':_0x55670b['attributes'],'include':_0x55670b[_0x0997('0x1e')]?_[_0x0997('0x1f')](_0x55670b[_0x0997('0x1e')],function(_0x2a88b2){return{'model':db[_0x2a88b2[_0x0997('0x20')]],'as':_0x2a88b2['as'],'attributes':_0x2a88b2[_0x0997('0x21')]};}):[]};}):[]};}):[]:[]})[_0x0997('0xd')](function(_0x238774){logger['info'](_0x0997('0x17'),_0x3c80a7);logger[_0x0997('0x22')](_0x0997('0x17'),_0x3c80a7,JSON[_0x0997('0xf')](_0x238774));_0x282e9d(_0x238774);})['catch'](function(_0x4f421d){logger[_0x0997('0x10')](_0x0997('0x17'),_0x4f421d['message'],_0x3c80a7);_0xbfd9fe(_0x5e4d9d[_0x0997('0x10')](0x1f4,_0x4f421d['message']));});});};exports[_0x0997('0x23')]=function(_0x3d2f8f){var _0x15c8ec=this;return new Promise(function(_0x2ea412,_0x482834){return db[_0x0997('0x18')][_0x0997('0x24')](_0x3d2f8f[_0x0997('0x25')],{'raw':_0x3d2f8f[_0x0997('0x1a')]?_0x3d2f8f[_0x0997('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x0997('0xd')](function(_0x2cbd14){logger[_0x0997('0x13')](_0x0997('0x23'),_0x3d2f8f);logger[_0x0997('0x22')](_0x0997('0x23'),_0x3d2f8f,JSON[_0x0997('0xf')](_0x2cbd14));_0x2ea412(_0x2cbd14);})[_0x0997('0x16')](function(_0x1ca5e3){logger[_0x0997('0x10')](_0x0997('0x23'),_0x1ca5e3[_0x0997('0x12')],_0x3d2f8f);_0x482834(_0x15c8ec[_0x0997('0x10')](0x1f4,_0x1ca5e3['message']));});});};exports['UpdateVoiceCallReport']=function(_0x11cc7d){var _0xf5c8b4=this;return new Promise(function(_0x492f35,_0x2348c9){return db['VoiceCallReport']['update'](_0x11cc7d['body'],{'raw':_0x11cc7d[_0x0997('0x1a')]?_0x11cc7d['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x11cc7d[_0x0997('0x1a')]?_0x11cc7d['options'][_0x0997('0x1c')]||null:null,'attributes':_0x11cc7d[_0x0997('0x1a')]?_0x11cc7d[_0x0997('0x1a')][_0x0997('0x21')]||null:null,'limit':_0x11cc7d['options']?_0x11cc7d['options'][_0x0997('0x1d')]||null:null})[_0x0997('0xd')](function(_0xa8d0ac){logger[_0x0997('0x13')](_0x0997('0x26'),_0x11cc7d);logger['debug'](_0x0997('0x26'),_0x11cc7d,JSON[_0x0997('0xf')](_0xa8d0ac));_0x492f35(_0xa8d0ac);})['catch'](function(_0x566cf6){logger[_0x0997('0x10')]('UpdateVoiceCallReport',_0x566cf6['message'],_0x11cc7d);_0x2348c9(_0xf5c8b4[_0x0997('0x10')](0x1f4,_0x566cf6['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 62dd20b..2079550 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 _0xc962=['show','post','create','put','delete','destroy','exports','multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','/:id'];(function(_0x31fb11,_0x4ddc04){var _0x2cda78=function(_0x835a04){while(--_0x835a04){_0x31fb11['push'](_0x31fb11['shift']());}};_0x2cda78(++_0x4ddc04);}(_0xc962,0x6d));var _0x2c96=function(_0x2dd63c,_0x1f6563){_0x2dd63c=_0x2dd63c-0x0;var _0x1ea194=_0xc962[_0x2dd63c];return _0x1ea194;};'use strict';var multer=require(_0x2c96('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2c96('0x1'));var router=express[_0x2c96('0x2')]();var auth=require(_0x2c96('0x3'));var interaction=require(_0x2c96('0x4'));var config=require(_0x2c96('0x5'));var controller=require(_0x2c96('0x6'));router[_0x2c96('0x7')]('/',auth[_0x2c96('0x8')](),controller['index']);router[_0x2c96('0x7')](_0x2c96('0x9'),auth[_0x2c96('0x8')](),controller[_0x2c96('0xa')]);router[_0x2c96('0xb')]('/',auth[_0x2c96('0x8')](),controller[_0x2c96('0xc')]);router[_0x2c96('0xd')](_0x2c96('0x9'),auth['isAuthenticated'](),controller['update']);router[_0x2c96('0xe')](_0x2c96('0x9'),auth[_0x2c96('0x8')](),controller[_0x2c96('0xf')]);module[_0x2c96('0x10')]=router; \ No newline at end of file +var _0x7a0b=['isAuthenticated','create','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','../../config/environment','./voiceChanSpy.controller','get','index','/:id'];(function(_0x641408,_0x43cdde){var _0x3eae74=function(_0x5d82c6){while(--_0x5d82c6){_0x641408['push'](_0x641408['shift']());}};_0x3eae74(++_0x43cdde);}(_0x7a0b,0x85));var _0xb7a0=function(_0x254ac3,_0x2fd9f5){_0x254ac3=_0x254ac3-0x0;var _0x364689=_0x7a0b[_0x254ac3];return _0x364689;};'use strict';var multer=require(_0xb7a0('0x0'));var util=require(_0xb7a0('0x1'));var path=require(_0xb7a0('0x2'));var timeout=require('connect-timeout');var express=require(_0xb7a0('0x3'));var router=express[_0xb7a0('0x4')]();var auth=require(_0xb7a0('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xb7a0('0x6'));var controller=require(_0xb7a0('0x7'));router[_0xb7a0('0x8')]('/',auth['isAuthenticated'](),controller[_0xb7a0('0x9')]);router[_0xb7a0('0x8')](_0xb7a0('0xa'),auth[_0xb7a0('0xb')](),controller['show']);router['post']('/',auth[_0xb7a0('0xb')](),controller[_0xb7a0('0xc')]);router['put'](_0xb7a0('0xa'),auth[_0xb7a0('0xb')](),controller[_0xb7a0('0xd')]);router[_0xb7a0('0xe')](_0xb7a0('0xa'),auth[_0xb7a0('0xb')](),controller[_0xb7a0('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 3a565e1..ae4048e 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 _0x1f0f=['sequelize','exports','STRING','setDataValue','getDataValue','options','BOOLEAN'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x1f0f,0x1c7));var _0xf1f0=function(_0x35667e,_0x5556f8){_0x35667e=_0x35667e-0x0;var _0x3ac75d=_0x1f0f[_0x35667e];return _0x3ac75d;};'use strict';var Sequelize=require(_0xf1f0('0x0'));module[_0xf1f0('0x1')]={'name':{'type':Sequelize[_0xf1f0('0x2')]},'prefix':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'options':{'type':Sequelize[_0xf1f0('0x2')],'set':function(_0x39190e){this[_0xf1f0('0x3')]('options',_0x39190e?_0x39190e['join'](''):[]);},'get':function(){return this[_0xf1f0('0x4')](_0xf1f0('0x5'))?this[_0xf1f0('0x4')](_0xf1f0('0x5'))['split'](''):[];}},'auth':{'type':Sequelize[_0xf1f0('0x6')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xf1f0('0x6')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xf1f0('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x7897=['BOOLEAN','sequelize','STRING','name','setDataValue','options','getDataValue','split'];(function(_0x1f0223,_0x6f4fca){var _0x432826=function(_0xd65523){while(--_0xd65523){_0x1f0223['push'](_0x1f0223['shift']());}};_0x432826(++_0x6f4fca);}(_0x7897,0x179));var _0x7789=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0x7897[_0x5c14f6];return _0x4949b3;};'use strict';var Sequelize=require(_0x7789('0x0'));module['exports']={'name':{'type':Sequelize[_0x7789('0x1')]},'prefix':{'type':Sequelize[_0x7789('0x1')],'unique':_0x7789('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0x7789('0x1')],'set':function(_0x5924be){this[_0x7789('0x3')](_0x7789('0x4'),_0x5924be?_0x5924be['join'](''):[]);},'get':function(){return this[_0x7789('0x5')](_0x7789('0x4'))?this[_0x7789('0x5')]('options')[_0x7789('0x6')](''):[];}},'auth':{'type':Sequelize[_0x7789('0x7')],'defaultValue':![]},'password':{'type':Sequelize[_0x7789('0x1')]},'record':{'type':Sequelize[_0x7789('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0x7789('0x1')]},'description':{'type':Sequelize[_0x7789('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index d038085..53061f4 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 _0xdba7=['index','map','VoiceChanSpy','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','length','options','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','zip-dir','bluebird','mustache','util','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','update','then','destroy','get','ChanSpies','UserProfileResource','error','stack','name','send'];(function(_0x1b5441,_0x100bd6){var _0x1e5717=function(_0x223ec4){while(--_0x223ec4){_0x1b5441['push'](_0x1b5441['shift']());}};_0x1e5717(++_0x100bd6);}(_0xdba7,0x1e7));var _0x7dba=function(_0x56354d,_0x496601){_0x56354d=_0x56354d-0x0;var _0x11fa1e=_0xdba7[_0x56354d];return _0x11fa1e;};'use strict';var pdf=require(_0x7dba('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7dba('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x7dba('0x2'));var Mustache=require(_0x7dba('0x3'));var util=require(_0x7dba('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x7dba('0x5'));var squel=require('squel');var crypto=require(_0x7dba('0x6'));var jsforce=require(_0x7dba('0x7'));var deskjs=require(_0x7dba('0x8'));var toCsv=require(_0x7dba('0x9'));var querystring=require(_0x7dba('0xa'));var Papa=require(_0x7dba('0xb'));var Redis=require(_0x7dba('0xc'));var authService=require(_0x7dba('0xd'));var qs=require(_0x7dba('0xe'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7dba('0xf'));var logger=require('../../config/logger')(_0x7dba('0x10'));var utils=require(_0x7dba('0x11'));var config=require(_0x7dba('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12ba5f,_0x2e1054){_0x2e1054=_0x2e1054||0xcc;return function(_0x37270a){if(_0x37270a){return _0x12ba5f[_0x7dba('0x13')](_0x2e1054);}return _0x12ba5f[_0x7dba('0x14')](_0x2e1054)[_0x7dba('0x15')]();};}function respondWithResult(_0x350543,_0x2638fa){_0x2638fa=_0x2638fa||0xc8;return function(_0x30238c){if(_0x30238c){return _0x350543[_0x7dba('0x14')](_0x2638fa)[_0x7dba('0x16')](_0x30238c);}};}function respondWithFilteredResult(_0x357a48,_0x5a75a3){return function(_0x499fdd){if(_0x499fdd){var _0x1c66d5=_0x499fdd[_0x7dba('0x17')],_0x3381ae=_0x5a75a3['offset'],_0x414541=_0x5a75a3[_0x7dba('0x18')]+_0x5a75a3[_0x7dba('0x19')],_0xea31f8;if(_0x414541>=_0x1c66d5){_0x414541=_0x1c66d5;_0xea31f8=0xc8;}else{_0xea31f8=0xce;}_0x357a48[_0x7dba('0x14')](_0xea31f8);return _0x357a48['set'](_0x7dba('0x1a'),_0x3381ae+'-'+_0x414541+'/'+_0x1c66d5)['json'](_0x499fdd);}return null;};}function patchUpdates(_0x22b139){return function(_0x5bb4ac){try{jsonpatch['apply'](_0x5bb4ac,_0x22b139,!![]);}catch(_0xbc3f3b){return BPromise[_0x7dba('0x1b')](_0xbc3f3b);}return _0x5bb4ac['save']();};}function saveUpdates(_0x2c7991,_0x46325e){return function(_0x1d23d1){if(_0x1d23d1){return _0x1d23d1[_0x7dba('0x1c')](_0x2c7991)[_0x7dba('0x1d')](function(_0x52876a){return _0x52876a;});}return null;};}function removeEntity(_0x21e90e,_0x3eb4e9){return function(_0x2feca5){if(_0x2feca5){return _0x2feca5[_0x7dba('0x1e')]()[_0x7dba('0x1d')](function(){var _0x15c872=_0x2feca5[_0x7dba('0x1f')]({'plain':!![]});var _0x47ec02=_0x7dba('0x20');return db[_0x7dba('0x21')][_0x7dba('0x1e')]({'where':{'type':_0x47ec02,'resourceId':_0x15c872['id']}})['then'](function(){return _0x2feca5;});})[_0x7dba('0x1d')](function(){_0x21e90e[_0x7dba('0x14')](0xcc)[_0x7dba('0x15')]();});}};}function handleEntityNotFound(_0xf8f912,_0xece3de){return function(_0x3a19d6){if(!_0x3a19d6){_0xf8f912[_0x7dba('0x13')](0x194);}return _0x3a19d6;};}function handleError(_0x5d3276,_0x118b99){_0x118b99=_0x118b99||0x1f4;return function(_0x215f5e){logger[_0x7dba('0x22')](_0x215f5e[_0x7dba('0x23')]);if(_0x215f5e[_0x7dba('0x24')]){delete _0x215f5e[_0x7dba('0x24')];}_0x5d3276[_0x7dba('0x14')](_0x118b99)[_0x7dba('0x25')](_0x215f5e);};}exports[_0x7dba('0x26')]=function(_0x119fc1,_0x44a785){var _0x33f176={},_0x111d1c={},_0x15079d={'count':0x0,'rows':[]};var _0x7d9314=_[_0x7dba('0x27')](db[_0x7dba('0x28')]['rawAttributes'],function(_0x2cb79b){return{'name':_0x2cb79b['fieldName'],'type':_0x2cb79b[_0x7dba('0x29')][_0x7dba('0x2a')]};});_0x111d1c[_0x7dba('0x2b')]=_[_0x7dba('0x27')](_0x7d9314,_0x7dba('0x24'));_0x111d1c[_0x7dba('0x2c')]=_[_0x7dba('0x2d')](_0x119fc1['query']);_0x111d1c[_0x7dba('0x2e')]=_[_0x7dba('0x2f')](_0x111d1c[_0x7dba('0x2b')],_0x111d1c[_0x7dba('0x2c')]);_0x33f176[_0x7dba('0x30')]=_[_0x7dba('0x2f')](_0x111d1c[_0x7dba('0x2b')],qs[_0x7dba('0x31')](_0x119fc1['query']['fields']));_0x33f176['attributes']=_0x33f176['attributes']['length']?_0x33f176['attributes']:_0x111d1c[_0x7dba('0x2b')];if(!_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x32')]('nolimit')){_0x33f176['limit']=qs[_0x7dba('0x19')](_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x19')]);_0x33f176['offset']=qs[_0x7dba('0x18')](_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x18')]);}_0x33f176[_0x7dba('0x33')]=qs[_0x7dba('0x34')](_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x34')]);_0x33f176[_0x7dba('0x35')]=qs['filters'](_['pick'](_0x119fc1[_0x7dba('0x2c')],_0x111d1c[_0x7dba('0x2e')]));if(_0x119fc1[_0x7dba('0x2c')]['filter']){_0x33f176['where']=_[_0x7dba('0x36')](_0x33f176['where'],{'$or':_[_0x7dba('0x27')](_0x7d9314,function(_0x49c1c7){if(_0x49c1c7[_0x7dba('0x29')]!=='VIRTUAL'){var _0x44d22c={};_0x44d22c[_0x49c1c7[_0x7dba('0x24')]]={'$like':'%'+_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x37')]+'%'};return _0x44d22c;}})});}_0x33f176=_[_0x7dba('0x36')]({},_0x33f176,_0x119fc1['options']);var _0x4bcb14={'where':_0x33f176[_0x7dba('0x35')]};return db[_0x7dba('0x28')]['count'](_0x4bcb14)[_0x7dba('0x1d')](function(_0x41d3ff){_0x15079d[_0x7dba('0x17')]=_0x41d3ff;if(_0x119fc1[_0x7dba('0x2c')][_0x7dba('0x38')]){_0x33f176[_0x7dba('0x39')]=[{'all':!![]}];}return db[_0x7dba('0x28')][_0x7dba('0x3a')](_0x33f176);})[_0x7dba('0x1d')](function(_0x580819){_0x15079d[_0x7dba('0x3b')]=_0x580819;return _0x15079d;})[_0x7dba('0x1d')](respondWithFilteredResult(_0x44a785,_0x33f176))[_0x7dba('0x3c')](handleError(_0x44a785,null));};exports[_0x7dba('0x3d')]=function(_0x4d45f5,_0x431cb1){var _0x100be2={'raw':![],'where':{'id':_0x4d45f5[_0x7dba('0x3e')]['id']}},_0x40f3c7={};_0x40f3c7[_0x7dba('0x2b')]=_[_0x7dba('0x2d')](db['VoiceChanSpy'][_0x7dba('0x3f')]);_0x40f3c7[_0x7dba('0x2c')]=_[_0x7dba('0x2d')](_0x4d45f5[_0x7dba('0x2c')]);_0x40f3c7[_0x7dba('0x2e')]=_['intersection'](_0x40f3c7[_0x7dba('0x2b')],_0x40f3c7[_0x7dba('0x2c')]);_0x100be2['attributes']=_[_0x7dba('0x2f')](_0x40f3c7[_0x7dba('0x2b')],qs['fields'](_0x4d45f5[_0x7dba('0x2c')][_0x7dba('0x31')]));_0x100be2[_0x7dba('0x30')]=_0x100be2[_0x7dba('0x30')][_0x7dba('0x40')]?_0x100be2['attributes']:_0x40f3c7[_0x7dba('0x2b')];if(_0x4d45f5[_0x7dba('0x2c')][_0x7dba('0x38')]){_0x100be2[_0x7dba('0x39')]=[{'all':!![]}];}_0x100be2=_[_0x7dba('0x36')]({},_0x100be2,_0x4d45f5[_0x7dba('0x41')]);return db[_0x7dba('0x28')]['find'](_0x100be2)[_0x7dba('0x1d')](handleEntityNotFound(_0x431cb1,null))[_0x7dba('0x1d')](respondWithResult(_0x431cb1,null))[_0x7dba('0x3c')](handleError(_0x431cb1,null));};exports[_0x7dba('0x42')]=function(_0x43b466,_0x2818b1){return db[_0x7dba('0x28')][_0x7dba('0x42')](_0x43b466[_0x7dba('0x43')],{})[_0x7dba('0x1d')](function(_0x3cb2bc){var _0x3023fb=_0x43b466[_0x7dba('0x44')][_0x7dba('0x1f')]({'plain':!![]});if(!_0x3023fb)throw new Error(_0x7dba('0x45'));if(_0x3023fb['role']===_0x7dba('0x44')){var _0x2e465d=_0x3cb2bc[_0x7dba('0x1f')]({'plain':!![]});var _0x4306df=_0x7dba('0x20');return db[_0x7dba('0x46')][_0x7dba('0x47')]({'where':{'name':_0x4306df,'userProfileId':_0x3023fb[_0x7dba('0x48')]},'raw':!![]})[_0x7dba('0x1d')](function(_0x390169){if(_0x390169&&_0x390169[_0x7dba('0x49')]===0x0){return db['UserProfileResource']['create']({'name':_0x2e465d[_0x7dba('0x24')],'resourceId':_0x2e465d['id'],'type':_0x390169[_0x7dba('0x24')],'sectionId':_0x390169['id']},{})[_0x7dba('0x1d')](function(){return _0x3cb2bc;});}else{return _0x3cb2bc;}})['catch'](function(_0x461d82){logger[_0x7dba('0x22')](_0x7dba('0x4a'),_0x461d82);throw _0x461d82;});}return _0x3cb2bc;})[_0x7dba('0x1d')](respondWithResult(_0x2818b1,0xc9))['catch'](handleError(_0x2818b1,null));};exports[_0x7dba('0x1c')]=function(_0x1a7fd5,_0x18d232){if(_0x1a7fd5[_0x7dba('0x43')]['id']){delete _0x1a7fd5['body']['id'];}return db[_0x7dba('0x28')]['find']({'where':{'id':_0x1a7fd5[_0x7dba('0x3e')]['id']}})[_0x7dba('0x1d')](handleEntityNotFound(_0x18d232,null))['then'](saveUpdates(_0x1a7fd5[_0x7dba('0x43')],null))[_0x7dba('0x1d')](respondWithResult(_0x18d232,null))[_0x7dba('0x3c')](handleError(_0x18d232,null));};exports[_0x7dba('0x1e')]=function(_0x351d24,_0x30427a){return db['VoiceChanSpy'][_0x7dba('0x47')]({'where':{'id':_0x351d24[_0x7dba('0x3e')]['id']}})[_0x7dba('0x1d')](handleEntityNotFound(_0x30427a,null))[_0x7dba('0x1d')](removeEntity(_0x30427a,null))[_0x7dba('0x3c')](handleError(_0x30427a,null));}; \ No newline at end of file +var _0x420c=['index','map','VoiceChanSpy','rawAttributes','fieldName','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','params','include','options','catch','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','status','json','count','offset','limit','set','apply','reject','update','then','get','ChanSpies','destroy','stack','name','send'];(function(_0x3b27a2,_0x26be85){var _0x4d0878=function(_0x39925b){while(--_0x39925b){_0x3b27a2['push'](_0x3b27a2['shift']());}};_0x4d0878(++_0x26be85);}(_0x420c,0x1a9));var _0xc420=function(_0x138c5e,_0x59d9ac){_0x138c5e=_0x138c5e-0x0;var _0x50eeff=_0x420c[_0x138c5e];return _0x50eeff;};'use strict';var pdf=require(_0xc420('0x0'));var emlformat=require(_0xc420('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc420('0x2'));var jsonpatch=require(_0xc420('0x3'));var rp=require(_0xc420('0x4'));var moment=require('moment');var BPromise=require(_0xc420('0x5'));var Mustache=require(_0xc420('0x6'));var util=require(_0xc420('0x7'));var path=require(_0xc420('0x8'));var sox=require(_0xc420('0x9'));var csv=require(_0xc420('0xa'));var ejs=require(_0xc420('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc420('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xc420('0xd'));var toCsv=require('to-csv');var querystring=require(_0xc420('0xe'));var Papa=require(_0xc420('0xf'));var Redis=require(_0xc420('0x10'));var authService=require(_0xc420('0x11'));var qs=require(_0xc420('0x12'));var as=require(_0xc420('0x13'));var hardwareService=require(_0xc420('0x14'));var logger=require(_0xc420('0x15'))(_0xc420('0x16'));var utils=require(_0xc420('0x17'));var config=require(_0xc420('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xd93df,_0x12d8a9){_0x12d8a9=_0x12d8a9||0xcc;return function(_0x15b556){if(_0x15b556){return _0xd93df[_0xc420('0x19')](_0x12d8a9);}return _0xd93df['status'](_0x12d8a9)[_0xc420('0x1a')]();};}function respondWithResult(_0x5d1210,_0x5909b3){_0x5909b3=_0x5909b3||0xc8;return function(_0x4834ab){if(_0x4834ab){return _0x5d1210[_0xc420('0x1b')](_0x5909b3)[_0xc420('0x1c')](_0x4834ab);}};}function respondWithFilteredResult(_0x29601c,_0x42f554){return function(_0x2343ee){if(_0x2343ee){var _0xf211eb=_0x2343ee[_0xc420('0x1d')],_0x539007=_0x42f554[_0xc420('0x1e')],_0x3c19dc=_0x42f554['offset']+_0x42f554[_0xc420('0x1f')],_0x44dda0;if(_0x3c19dc>=_0xf211eb){_0x3c19dc=_0xf211eb;_0x44dda0=0xc8;}else{_0x44dda0=0xce;}_0x29601c[_0xc420('0x1b')](_0x44dda0);return _0x29601c[_0xc420('0x20')]('Content-Range',_0x539007+'-'+_0x3c19dc+'/'+_0xf211eb)['json'](_0x2343ee);}return null;};}function patchUpdates(_0x37d253){return function(_0x4c0f19){try{jsonpatch[_0xc420('0x21')](_0x4c0f19,_0x37d253,!![]);}catch(_0x8d655f){return BPromise[_0xc420('0x22')](_0x8d655f);}return _0x4c0f19['save']();};}function saveUpdates(_0x3a2b9e,_0x2007ce){return function(_0x34897c){if(_0x34897c){return _0x34897c[_0xc420('0x23')](_0x3a2b9e)[_0xc420('0x24')](function(_0x2ad7a0){return _0x2ad7a0;});}return null;};}function removeEntity(_0xdc96cb,_0x37177b){return function(_0xc65619){if(_0xc65619){return _0xc65619['destroy']()[_0xc420('0x24')](function(){var _0x19d9aa=_0xc65619[_0xc420('0x25')]({'plain':!![]});var _0x45edb6=_0xc420('0x26');return db['UserProfileResource'][_0xc420('0x27')]({'where':{'type':_0x45edb6,'resourceId':_0x19d9aa['id']}})['then'](function(){return _0xc65619;});})[_0xc420('0x24')](function(){_0xdc96cb[_0xc420('0x1b')](0xcc)[_0xc420('0x1a')]();});}};}function handleEntityNotFound(_0x5a4727,_0x52e7d0){return function(_0x422a08){if(!_0x422a08){_0x5a4727[_0xc420('0x19')](0x194);}return _0x422a08;};}function handleError(_0x3cbfcf,_0x3689bb){_0x3689bb=_0x3689bb||0x1f4;return function(_0x1ef38d){logger['error'](_0x1ef38d[_0xc420('0x28')]);if(_0x1ef38d[_0xc420('0x29')]){delete _0x1ef38d[_0xc420('0x29')];}_0x3cbfcf[_0xc420('0x1b')](_0x3689bb)[_0xc420('0x2a')](_0x1ef38d);};}exports[_0xc420('0x2b')]=function(_0x9f44e3,_0x4b6be0){var _0x41206e={},_0xd7a095={},_0x27197f={'count':0x0,'rows':[]};var _0x298dcc=_[_0xc420('0x2c')](db[_0xc420('0x2d')][_0xc420('0x2e')],function(_0x27fecd){return{'name':_0x27fecd[_0xc420('0x2f')],'type':_0x27fecd['type']['key']};});_0xd7a095['model']=_['map'](_0x298dcc,_0xc420('0x29'));_0xd7a095[_0xc420('0x30')]=_[_0xc420('0x31')](_0x9f44e3[_0xc420('0x30')]);_0xd7a095[_0xc420('0x32')]=_[_0xc420('0x33')](_0xd7a095[_0xc420('0x34')],_0xd7a095[_0xc420('0x30')]);_0x41206e['attributes']=_[_0xc420('0x33')](_0xd7a095[_0xc420('0x34')],qs[_0xc420('0x35')](_0x9f44e3['query'][_0xc420('0x35')]));_0x41206e[_0xc420('0x36')]=_0x41206e[_0xc420('0x36')][_0xc420('0x37')]?_0x41206e[_0xc420('0x36')]:_0xd7a095['model'];if(!_0x9f44e3['query'][_0xc420('0x38')]('nolimit')){_0x41206e[_0xc420('0x1f')]=qs[_0xc420('0x1f')](_0x9f44e3[_0xc420('0x30')]['limit']);_0x41206e[_0xc420('0x1e')]=qs[_0xc420('0x1e')](_0x9f44e3['query'][_0xc420('0x1e')]);}_0x41206e['order']=qs['sort'](_0x9f44e3[_0xc420('0x30')][_0xc420('0x39')]);_0x41206e[_0xc420('0x3a')]=qs[_0xc420('0x32')](_[_0xc420('0x3b')](_0x9f44e3[_0xc420('0x30')],_0xd7a095[_0xc420('0x32')]));if(_0x9f44e3[_0xc420('0x30')][_0xc420('0x3c')]){_0x41206e[_0xc420('0x3a')]=_[_0xc420('0x3d')](_0x41206e[_0xc420('0x3a')],{'$or':_[_0xc420('0x2c')](_0x298dcc,function(_0x3bce3d){if(_0x3bce3d[_0xc420('0x3e')]!==_0xc420('0x3f')){var _0x1356d1={};_0x1356d1[_0x3bce3d[_0xc420('0x29')]]={'$like':'%'+_0x9f44e3['query'][_0xc420('0x3c')]+'%'};return _0x1356d1;}})});}_0x41206e=_[_0xc420('0x3d')]({},_0x41206e,_0x9f44e3['options']);var _0x502ec0={'where':_0x41206e[_0xc420('0x3a')]};return db[_0xc420('0x2d')][_0xc420('0x1d')](_0x502ec0)[_0xc420('0x24')](function(_0x2f5b9c){_0x27197f[_0xc420('0x1d')]=_0x2f5b9c;if(_0x9f44e3[_0xc420('0x30')][_0xc420('0x40')]){_0x41206e['include']=[{'all':!![]}];}return db[_0xc420('0x2d')]['findAll'](_0x41206e);})['then'](function(_0x309ea1){_0x27197f['rows']=_0x309ea1;return _0x27197f;})[_0xc420('0x24')](respondWithFilteredResult(_0x4b6be0,_0x41206e))['catch'](handleError(_0x4b6be0,null));};exports['show']=function(_0x3446ba,_0x24518c){var _0x1e1fe2={'raw':![],'where':{'id':_0x3446ba[_0xc420('0x41')]['id']}},_0x113f05={};_0x113f05[_0xc420('0x34')]=_[_0xc420('0x31')](db[_0xc420('0x2d')][_0xc420('0x2e')]);_0x113f05[_0xc420('0x30')]=_[_0xc420('0x31')](_0x3446ba['query']);_0x113f05[_0xc420('0x32')]=_[_0xc420('0x33')](_0x113f05[_0xc420('0x34')],_0x113f05[_0xc420('0x30')]);_0x1e1fe2[_0xc420('0x36')]=_[_0xc420('0x33')](_0x113f05[_0xc420('0x34')],qs[_0xc420('0x35')](_0x3446ba['query']['fields']));_0x1e1fe2[_0xc420('0x36')]=_0x1e1fe2[_0xc420('0x36')]['length']?_0x1e1fe2[_0xc420('0x36')]:_0x113f05[_0xc420('0x34')];if(_0x3446ba[_0xc420('0x30')][_0xc420('0x40')]){_0x1e1fe2[_0xc420('0x42')]=[{'all':!![]}];}_0x1e1fe2=_[_0xc420('0x3d')]({},_0x1e1fe2,_0x3446ba[_0xc420('0x43')]);return db['VoiceChanSpy']['find'](_0x1e1fe2)[_0xc420('0x24')](handleEntityNotFound(_0x24518c,null))['then'](respondWithResult(_0x24518c,null))[_0xc420('0x44')](handleError(_0x24518c,null));};exports[_0xc420('0x45')]=function(_0x134755,_0x3edbfb){return db[_0xc420('0x2d')]['create'](_0x134755[_0xc420('0x46')],{})[_0xc420('0x24')](function(_0x3018b5){var _0x78e60e=_0x134755[_0xc420('0x47')][_0xc420('0x25')]({'plain':!![]});if(!_0x78e60e)throw new Error(_0xc420('0x48'));if(_0x78e60e[_0xc420('0x49')]===_0xc420('0x47')){var _0x4a1b0c=_0x3018b5[_0xc420('0x25')]({'plain':!![]});var _0x38eb7d='ChanSpies';return db['UserProfileSection'][_0xc420('0x4a')]({'where':{'name':_0x38eb7d,'userProfileId':_0x78e60e[_0xc420('0x4b')]},'raw':!![]})['then'](function(_0x3ab244){if(_0x3ab244&&_0x3ab244[_0xc420('0x4c')]===0x0){return db['UserProfileResource'][_0xc420('0x45')]({'name':_0x4a1b0c[_0xc420('0x29')],'resourceId':_0x4a1b0c['id'],'type':_0x3ab244['name'],'sectionId':_0x3ab244['id']},{})[_0xc420('0x24')](function(){return _0x3018b5;});}else{return _0x3018b5;}})[_0xc420('0x44')](function(_0x23b45e){logger['error'](_0xc420('0x4d'),_0x23b45e);throw _0x23b45e;});}return _0x3018b5;})[_0xc420('0x24')](respondWithResult(_0x3edbfb,0xc9))[_0xc420('0x44')](handleError(_0x3edbfb,null));};exports[_0xc420('0x23')]=function(_0x210672,_0x34674b){if(_0x210672['body']['id']){delete _0x210672['body']['id'];}return db[_0xc420('0x2d')]['find']({'where':{'id':_0x210672['params']['id']}})[_0xc420('0x24')](handleEntityNotFound(_0x34674b,null))[_0xc420('0x24')](saveUpdates(_0x210672['body'],null))[_0xc420('0x24')](respondWithResult(_0x34674b,null))[_0xc420('0x44')](handleError(_0x34674b,null));};exports[_0xc420('0x27')]=function(_0x17c549,_0x4ee158){return db[_0xc420('0x2d')][_0xc420('0x4a')]({'where':{'id':_0x17c549[_0xc420('0x41')]['id']}})[_0xc420('0x24')](handleEntityNotFound(_0x4ee158,null))['then'](removeEntity(_0x4ee158,null))[_0xc420('0x44')](handleError(_0x4ee158,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index 5aaccd7..e057082 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 _0xc3f3=['ChanSpy','SIP/%s,%s','name','join','StopMixMonitor','length','internal','concat','User','findAll','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','destroy','bulkCreate','lodash','util','bluebird','./voiceChanSpy.attributes','from-sip','format','prefix','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password'];(function(_0x7ff50b,_0x399dc0){var _0x43e570=function(_0x16b092){while(--_0x16b092){_0x7ff50b['push'](_0x7ff50b['shift']());}};_0x43e570(++_0x399dc0);}(_0xc3f3,0x156));var _0x3c3f=function(_0x4bc186,_0x185dea){_0x4bc186=_0x4bc186-0x0;var _0x5c2696=_0xc3f3[_0x4bc186];return _0x5c2696;};'use strict';var _=require(_0x3c3f('0x0'));var util=require(_0x3c3f('0x1'));var BPromise=require(_0x3c3f('0x2'));var attributes=require(_0x3c3f('0x3'));var getUserApplications=function(_0x31b6c1,_0xcba17f,_0x458c69){var _0xc36a41=0x1;var _0x2885eb=[];var _0x3e2103={'context':_0xcba17f['context']||_0x3c3f('0x4'),'exten':util[_0x3c3f('0x5')]('%s%s',_0x31b6c1[_0x3c3f('0x6')],_0x458c69),'type':'system','isApp':![],'ChanSpyId':_0x31b6c1['id'],'UserId':_0xcba17f['id']};_0x2885eb[_0x3c3f('0x7')](_[_0x3c3f('0x8')]({'app':'Set','appdata':util['format'](_0x3c3f('0x9'),_0x3c3f('0xa')),'priority':_0xc36a41++},_0x3e2103));if(_0x31b6c1[_0x3c3f('0xb')]){_0x2885eb[_0x3c3f('0x7')](_[_0x3c3f('0x8')]({'app':_0x3c3f('0xc'),'appdata':util[_0x3c3f('0x5')](_0x3c3f('0xd'),_0x31b6c1[_0x3c3f('0xe')]),'priority':_0xc36a41++},_0x3e2103));}if(_0x31b6c1[_0x3c3f('0xf')]){_0x2885eb[_0x3c3f('0x7')](_[_0x3c3f('0x8')]({'app':_0x3c3f('0x10'),'appdata':_0x31b6c1[_0x3c3f('0x11')],'priority':_0xc36a41++},_0x3e2103));}_0x2885eb[_0x3c3f('0x7')](_[_0x3c3f('0x8')]({'app':_0x3c3f('0x12'),'appdata':util[_0x3c3f('0x5')](_0x3c3f('0x13'),_0xcba17f[_0x3c3f('0x14')],_0x31b6c1['options']?_0x31b6c1['options'][_0x3c3f('0x15')](''):''),'priority':_0xc36a41++},_0x3e2103));if(_0x31b6c1['record']){_0x2885eb['push'](_[_0x3c3f('0x8')]({'app':_0x3c3f('0x16'),'priority':_0xc36a41++},_0x3e2103));}return _0x2885eb;};var getChanSpyApplications=function(_0x42092e,_0x101e46){var _0x404e73=[];for(var _0x564f89=0x0,_0x58de83=0x1;_0x564f89<_0x101e46[_0x3c3f('0x17')];_0x564f89++,_0x58de83=0x1){_0x404e73=_0x404e73['concat'](getUserApplications(_0x42092e,_0x101e46[_0x564f89],_0x101e46[_0x564f89][_0x3c3f('0x18')]));if(_0x101e46[_0x564f89][_0x3c3f('0x18')]!=_0x101e46[_0x564f89][_0x3c3f('0x14')]){_0x404e73=_0x404e73[_0x3c3f('0x19')](getUserApplications(_0x42092e,_0x101e46[_0x564f89],_0x101e46[_0x564f89]['name']));}}return _0x404e73;};var getChanSpyPromise=function(_0x2415dc,_0x2e1a66){return new BPromise(function(_0x1b8afa,_0x36fe03){return _0x2415dc[_0x3c3f('0x1a')][_0x3c3f('0x1b')]({'attributes':['id',_0x3c3f('0x14'),_0x3c3f('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x3c3f('0x1c')](function(_0x353e8c){if(_0x353e8c){return _0x1b8afa(getChanSpyApplications(_0x2e1a66,_0x353e8c));}return _0x1b8afa([]);})[_0x3c3f('0x1d')](function(_0x3d3672){_0x36fe03(_0x3d3672);});});};module[_0x3c3f('0x1e')]=function(_0x5b4c14,_0x413e02){var _0x4ec453=_0x5b4c14['models'];return _0x5b4c14['define'](_0x3c3f('0x1f'),attributes,{'tableName':_0x3c3f('0x20'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2f1568,_0x73969a,_0x122575){return getChanSpyPromise(_0x4ec453,_0x2f1568)[_0x3c3f('0x1c')](function(_0xb54971){if(_0xb54971&&_0xb54971['length']){return _0x4ec453[_0x3c3f('0x21')]['bulkCreate'](_0xb54971);}})[_0x3c3f('0x1c')](function(){_0x122575();})[_0x3c3f('0x1d')](function(_0x2a124e){_0x122575(_0x2a124e);});},'afterUpdate':function(_0x1e9f6f,_0xab8730,_0x54996c){return _0x4ec453[_0x3c3f('0x21')][_0x3c3f('0x22')]({'where':{'ChanSpyId':_0x1e9f6f['id']}})[_0x3c3f('0x1c')](function(){return getChanSpyPromise(_0x4ec453,_0x1e9f6f);})['then'](function(_0xc4fb0b){if(_0xc4fb0b&&_0xc4fb0b['length']){return _0x4ec453[_0x3c3f('0x21')][_0x3c3f('0x23')](_0xc4fb0b);}})[_0x3c3f('0x1c')](function(){_0x54996c();})[_0x3c3f('0x1d')](function(_0x5850e5){_0x54996c(_0x5850e5);});},'afterDestroy':function(_0x4b398c,_0x252b67,_0x3d1570){return _0x4ec453[_0x3c3f('0x21')][_0x3c3f('0x22')]({'where':{'ChanSpyId':_0x4b398c['id']}})[_0x3c3f('0x1c')](function(){_0x3d1570();})[_0x3c3f('0x1d')](function(_0x2974c8){_0x3d1570(_0x2974c8);});}}});}; \ No newline at end of file +var _0x2f33=['agent','then','exports','models','VoiceChanSpy','voice_chanspy','length','VoiceExtension','bulkCreate','catch','destroy','lodash','bluebird','context','from-sip','%s%s','system','push','merge','Set','format','chanspy','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','password','ChanSpy','SIP/%s,%s','join','record','StopMixMonitor','internal','name','concat','findAll'];(function(_0x3b4e7b,_0x48ce57){var _0x55fb81=function(_0x3f119c){while(--_0x3f119c){_0x3b4e7b['push'](_0x3b4e7b['shift']());}};_0x55fb81(++_0x48ce57);}(_0x2f33,0x197));var _0x32f3=function(_0x3f10be,_0x5ef2a7){_0x3f10be=_0x3f10be-0x0;var _0x487d0e=_0x2f33[_0x3f10be];return _0x487d0e;};'use strict';var _=require(_0x32f3('0x0'));var util=require('util');var BPromise=require(_0x32f3('0x1'));var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x4eea19,_0x3bb26e,_0x5871de){var _0x3b0123=0x1;var _0x512177=[];var _0x592640={'context':_0x3bb26e[_0x32f3('0x2')]||_0x32f3('0x3'),'exten':util['format'](_0x32f3('0x4'),_0x4eea19['prefix'],_0x5871de),'type':_0x32f3('0x5'),'isApp':![],'ChanSpyId':_0x4eea19['id'],'UserId':_0x3bb26e['id']};_0x512177[_0x32f3('0x6')](_[_0x32f3('0x7')]({'app':_0x32f3('0x8'),'appdata':util[_0x32f3('0x9')]('CDR(type)=%s',_0x32f3('0xa')),'priority':_0x3b0123++},_0x592640));if(_0x4eea19['record']){_0x512177[_0x32f3('0x6')](_[_0x32f3('0x7')]({'app':_0x32f3('0xb'),'appdata':util[_0x32f3('0x9')](_0x32f3('0xc'),_0x4eea19[_0x32f3('0xd')]),'priority':_0x3b0123++},_0x592640));}if(_0x4eea19[_0x32f3('0xe')]){_0x512177[_0x32f3('0x6')](_['merge']({'app':'Authenticate','appdata':_0x4eea19[_0x32f3('0xf')],'priority':_0x3b0123++},_0x592640));}_0x512177[_0x32f3('0x6')](_['merge']({'app':_0x32f3('0x10'),'appdata':util['format'](_0x32f3('0x11'),_0x3bb26e['name'],_0x4eea19['options']?_0x4eea19['options'][_0x32f3('0x12')](''):''),'priority':_0x3b0123++},_0x592640));if(_0x4eea19[_0x32f3('0x13')]){_0x512177[_0x32f3('0x6')](_[_0x32f3('0x7')]({'app':_0x32f3('0x14'),'priority':_0x3b0123++},_0x592640));}return _0x512177;};var getChanSpyApplications=function(_0x11de16,_0x366aac){var _0x2c1c98=[];for(var _0xefee1=0x0,_0x517438=0x1;_0xefee1<_0x366aac['length'];_0xefee1++,_0x517438=0x1){_0x2c1c98=_0x2c1c98['concat'](getUserApplications(_0x11de16,_0x366aac[_0xefee1],_0x366aac[_0xefee1][_0x32f3('0x15')]));if(_0x366aac[_0xefee1][_0x32f3('0x15')]!=_0x366aac[_0xefee1][_0x32f3('0x16')]){_0x2c1c98=_0x2c1c98[_0x32f3('0x17')](getUserApplications(_0x11de16,_0x366aac[_0xefee1],_0x366aac[_0xefee1][_0x32f3('0x16')]));}}return _0x2c1c98;};var getChanSpyPromise=function(_0x1bd977,_0x88374c){return new BPromise(function(_0x3f24ca,_0x3b43d5){return _0x1bd977['User'][_0x32f3('0x18')]({'attributes':['id',_0x32f3('0x16'),_0x32f3('0x15')],'where':{'role':_0x32f3('0x19'),'chanspy':!![]},'raw':!![]})[_0x32f3('0x1a')](function(_0x28ef3a){if(_0x28ef3a){return _0x3f24ca(getChanSpyApplications(_0x88374c,_0x28ef3a));}return _0x3f24ca([]);})['catch'](function(_0x38e2c4){_0x3b43d5(_0x38e2c4);});});};module[_0x32f3('0x1b')]=function(_0x5b82e5,_0x510e29){var _0x49919f=_0x5b82e5[_0x32f3('0x1c')];return _0x5b82e5['define'](_0x32f3('0x1d'),attributes,{'tableName':_0x32f3('0x1e'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x45b6e6,_0x292f22,_0x474499){return getChanSpyPromise(_0x49919f,_0x45b6e6)[_0x32f3('0x1a')](function(_0x164396){if(_0x164396&&_0x164396[_0x32f3('0x1f')]){return _0x49919f[_0x32f3('0x20')][_0x32f3('0x21')](_0x164396);}})[_0x32f3('0x1a')](function(){_0x474499();})[_0x32f3('0x22')](function(_0x66810c){_0x474499(_0x66810c);});},'afterUpdate':function(_0x5d472d,_0x3d334c,_0x10b800){return _0x49919f[_0x32f3('0x20')][_0x32f3('0x23')]({'where':{'ChanSpyId':_0x5d472d['id']}})[_0x32f3('0x1a')](function(){return getChanSpyPromise(_0x49919f,_0x5d472d);})[_0x32f3('0x1a')](function(_0xc929b7){if(_0xc929b7&&_0xc929b7[_0x32f3('0x1f')]){return _0x49919f[_0x32f3('0x20')]['bulkCreate'](_0xc929b7);}})['then'](function(){_0x10b800();})[_0x32f3('0x22')](function(_0x521a4b){_0x10b800(_0x521a4b);});},'afterDestroy':function(_0x51f920,_0x6e3da7,_0x281b27){return _0x49919f[_0x32f3('0x20')][_0x32f3('0x23')]({'where':{'ChanSpyId':_0x51f920['id']}})[_0x32f3('0x1a')](function(){_0x281b27();})['catch'](function(_0x42533c){_0x281b27(_0x42533c);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index 4feb195..a2e7783 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 _0x5dcd=['request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','VoiceChanSpy,\x20%s,\x20%s'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x5dcd,0x196));var _0xd5dc=function(_0x281a50,_0x28fcf0){_0x281a50=_0x281a50-0x0;var _0x3fd2d8=_0x5dcd[_0x281a50];return _0x3fd2d8;};'use strict';var _=require(_0xd5dc('0x0'));var util=require(_0xd5dc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd5dc('0x2'))['db'];var utils=require(_0xd5dc('0x3'));var logger=require(_0xd5dc('0x4'))(_0xd5dc('0x5'));var config=require('../../config/environment');var jayson=require(_0xd5dc('0x6'));var client=jayson[_0xd5dc('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3acda2,_0x15dd7f,_0x2d90ea){return new BPromise(function(_0x32323f,_0x43b95b){return client[_0xd5dc('0x8')](_0x3acda2,_0x2d90ea)[_0xd5dc('0x9')](function(_0x1461c6){logger[_0xd5dc('0xa')](_0xd5dc('0xb'),_0x15dd7f,_0xd5dc('0xc'));logger['debug'](_0xd5dc('0xd'),_0x15dd7f,'request\x20sent',JSON[_0xd5dc('0xe')](_0x1461c6));if(_0x1461c6[_0xd5dc('0xf')]){if(_0x1461c6[_0xd5dc('0xf')]['code']===0x1f4){logger[_0xd5dc('0xf')]('VoiceChanSpy,\x20%s,\x20%s',_0x15dd7f,_0x1461c6[_0xd5dc('0xf')][_0xd5dc('0x10')]);return _0x43b95b(_0x1461c6['error']['message']);}logger[_0xd5dc('0xf')](_0xd5dc('0xb'),_0x15dd7f,_0x1461c6[_0xd5dc('0xf')][_0xd5dc('0x10')]);return _0x32323f(_0x1461c6['error'][_0xd5dc('0x10')]);}else{logger[_0xd5dc('0xa')](_0xd5dc('0xb'),_0x15dd7f,_0xd5dc('0xc'));_0x32323f(_0x1461c6[_0xd5dc('0x11')]['message']);}})[_0xd5dc('0x12')](function(_0x53695c){logger[_0xd5dc('0xf')](_0xd5dc('0xb'),_0x15dd7f,_0x53695c);_0x43b95b(_0x53695c);});});} \ No newline at end of file +var _0x5282=['http','request','then','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x23ca4d,_0x5c2a32){var _0x435432=function(_0xe1a5e5){while(--_0xe1a5e5){_0x23ca4d['push'](_0x23ca4d['shift']());}};_0x435432(++_0x5c2a32);}(_0x5282,0x1d8));var _0x2528=function(_0x114b7c,_0xc4b93b){_0x114b7c=_0x114b7c-0x0;var _0x47185f=_0x5282[_0x114b7c];return _0x47185f;};'use strict';var _=require(_0x2528('0x0'));var util=require(_0x2528('0x1'));var moment=require(_0x2528('0x2'));var BPromise=require(_0x2528('0x3'));var rs=require(_0x2528('0x4'));var fs=require('fs');var Redis=require(_0x2528('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x2528('0x6'));var logger=require('../../config/logger')(_0x2528('0x7'));var config=require(_0x2528('0x8'));var jayson=require(_0x2528('0x9'));var client=jayson[_0x2528('0xa')][_0x2528('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x17a8b6,_0x4b4279,_0xcc8da9){return new BPromise(function(_0x49e157,_0x409b93){return client[_0x2528('0xc')](_0x17a8b6,_0xcc8da9)[_0x2528('0xd')](function(_0x21dfc5){logger[_0x2528('0xe')](_0x2528('0xf'),_0x4b4279,_0x2528('0x10'));logger[_0x2528('0x11')](_0x2528('0x12'),_0x4b4279,'request\x20sent',JSON['stringify'](_0x21dfc5));if(_0x21dfc5[_0x2528('0x13')]){if(_0x21dfc5[_0x2528('0x13')][_0x2528('0x14')]===0x1f4){logger[_0x2528('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x4b4279,_0x21dfc5['error'][_0x2528('0x15')]);return _0x409b93(_0x21dfc5[_0x2528('0x13')][_0x2528('0x15')]);}logger[_0x2528('0x13')](_0x2528('0xf'),_0x4b4279,_0x21dfc5['error'][_0x2528('0x15')]);return _0x49e157(_0x21dfc5['error'][_0x2528('0x15')]);}else{logger['info'](_0x2528('0xf'),_0x4b4279,_0x2528('0x10'));_0x49e157(_0x21dfc5[_0x2528('0x16')][_0x2528('0x15')]);}})['catch'](function(_0x5de42f){logger[_0x2528('0x13')](_0x2528('0xf'),_0x4b4279,_0x5de42f);_0x409b93(_0x5de42f);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index e04544e..06ebc91 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 _0x86d4=['put','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceContext.controller','get','index','/:id','show','post','isAuthenticated','create'];(function(_0x381d04,_0x47ca4a){var _0x4d98dc=function(_0x102410){while(--_0x102410){_0x381d04['push'](_0x381d04['shift']());}};_0x4d98dc(++_0x47ca4a);}(_0x86d4,0x82));var _0x486d=function(_0x3468b3,_0x482684){_0x3468b3=_0x3468b3-0x0;var _0x515dca=_0x86d4[_0x3468b3];return _0x515dca;};'use strict';var multer=require(_0x486d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x486d('0x1'));var express=require(_0x486d('0x2'));var router=express[_0x486d('0x3')]();var auth=require(_0x486d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x486d('0x5'));var controller=require(_0x486d('0x6'));router[_0x486d('0x7')]('/',auth['isAuthenticated'](),controller[_0x486d('0x8')]);router[_0x486d('0x7')](_0x486d('0x9'),auth['isAuthenticated'](),controller[_0x486d('0xa')]);router[_0x486d('0xb')]('/',auth[_0x486d('0xc')](),controller[_0x486d('0xd')]);router[_0x486d('0xe')](_0x486d('0x9'),auth[_0x486d('0xc')](),controller['update']);router['delete'](_0x486d('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x486d('0xf')]=router; \ No newline at end of file +var _0x405f=['put','update','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceContext.controller','isAuthenticated','/:id','create'];(function(_0x1da72c,_0x15d2e9){var _0x58d9e7=function(_0x1487e3){while(--_0x1487e3){_0x1da72c['push'](_0x1da72c['shift']());}};_0x58d9e7(++_0x15d2e9);}(_0x405f,0xd4));var _0xf405=function(_0x47a349,_0x4699d9){_0x47a349=_0x47a349-0x0;var _0x18ab75=_0x405f[_0x47a349];return _0x18ab75;};'use strict';var multer=require(_0xf405('0x0'));var util=require(_0xf405('0x1'));var path=require('path');var timeout=require(_0xf405('0x2'));var express=require(_0xf405('0x3'));var router=express[_0xf405('0x4')]();var auth=require(_0xf405('0x5'));var interaction=require(_0xf405('0x6'));var config=require(_0xf405('0x7'));var controller=require(_0xf405('0x8'));router['get']('/',auth[_0xf405('0x9')](),controller['index']);router['get'](_0xf405('0xa'),auth[_0xf405('0x9')](),controller['show']);router['post']('/',auth['isAuthenticated'](),controller[_0xf405('0xb')]);router[_0xf405('0xc')](_0xf405('0xa'),auth['isAuthenticated'](),controller[_0xf405('0xd')]);router['delete'](_0xf405('0xa'),auth[_0xf405('0x9')](),controller[_0xf405('0xe')]);module[_0xf405('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 964e122..0e2769e 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 _0x34e8=['sequelize','exports','STRING','name','BOOLEAN'];(function(_0x4ba131,_0x2e3f4e){var _0x3b2939=function(_0x1bed0e){while(--_0x1bed0e){_0x4ba131['push'](_0x4ba131['shift']());}};_0x3b2939(++_0x2e3f4e);}(_0x34e8,0x12c));var _0x834e=function(_0x289ea7,_0x36c193){_0x289ea7=_0x289ea7-0x0;var _0xff83c6=_0x34e8[_0x289ea7];return _0xff83c6;};'use strict';var Sequelize=require(_0x834e('0x0'));module[_0x834e('0x1')]={'name':{'type':Sequelize[_0x834e('0x2')],'unique':_0x834e('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x834e('0x4')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0x370936,_0x258c76){var _0x1aacfe=function(_0x42d542){while(--_0x42d542){_0x370936['push'](_0x370936['shift']());}};_0x1aacfe(++_0x258c76);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 61c32c3..2b11150 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 _0x66e8=['/etc/asterisk/extensions_xcally_contexts.conf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox','lodash','squel','crypto','to-csv','papaparse','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','client','test','ValidationError','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','name','send','index','map','VoiceContext','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','length','find','create','body','readFileSync','join','root','server/files/templates/context.ejs','utf8','render','writeFileSync','Reload','chan_sip.so','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params'];(function(_0x34633f,_0x4655dd){var _0x3ba609=function(_0x160144){while(--_0x160144){_0x34633f['push'](_0x34633f['shift']());}};_0x3ba609(++_0x4655dd);}(_0x66e8,0x1f0));var _0x866e=function(_0x3265af,_0x60eed7){_0x3265af=_0x3265af-0x0;var _0x4f10b8=_0x66e8[_0x3265af];return _0x4f10b8;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x866e('0x0'));var zipdir=require(_0x866e('0x1'));var jsonpatch=require(_0x866e('0x2'));var rp=require(_0x866e('0x3'));var moment=require('moment');var BPromise=require(_0x866e('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x866e('0x5'));var sox=require(_0x866e('0x6'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x866e('0x7'));var squel=require(_0x866e('0x8'));var crypto=require(_0x866e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x866e('0xa'));var querystring=require('querystring');var Papa=require(_0x866e('0xb'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x866e('0xc'));var hardwareService=require(_0x866e('0xd'));var logger=require(_0x866e('0xe'))(_0x866e('0xf'));var utils=require(_0x866e('0x10'));var config=require('../../config/environment');var db=require(_0x866e('0x11'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x866e('0x12')]['http']({'port':0x232a});function checkPasswordPattern(_0x5d9ac1,_0x153a3f,_0x2de75f){if(_0x2de75f){var _0x350bda=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x350bda[_0x866e('0x13')](_0x153a3f)){return _0x5d9ac1;}else{throw new db['Sequelize'][(_0x866e('0x14'))](_0x866e('0x15'));}}else{return _0x5d9ac1;}}function respondWithRpcPromise(_0x552b9d,_0xf7ad0b,_0x2f5219,_0x24d9c0){return new BPromise(function(_0x284cb2,_0x4f210d){var _0x494810=_0x24d9c0||client;return _0x494810['request'](_0x552b9d,_0x2f5219)[_0x866e('0x16')](function(_0x3bc478){logger[_0x866e('0x17')](_0x866e('0x18'),_0xf7ad0b,_0x866e('0x19'));logger[_0x866e('0x1a')](_0x866e('0x1b'),_0xf7ad0b,'request\x20sent',JSON[_0x866e('0x1c')](_0x3bc478));if(_0x3bc478[_0x866e('0x1d')]){if(_0x3bc478[_0x866e('0x1d')][_0x866e('0x1e')]===0x1f4){logger[_0x866e('0x1d')](_0x866e('0x18'),_0xf7ad0b,_0x3bc478[_0x866e('0x1d')][_0x866e('0x1f')]);return _0x4f210d(_0x3bc478[_0x866e('0x1d')]['message']);}logger[_0x866e('0x1d')](_0x866e('0x18'),_0xf7ad0b,_0x3bc478[_0x866e('0x1d')][_0x866e('0x1f')]);return _0x284cb2(_0x3bc478[_0x866e('0x1d')][_0x866e('0x1f')]);}else{logger['info'](_0x866e('0x18'),_0xf7ad0b,_0x866e('0x19'));_0x284cb2(_0x3bc478[_0x866e('0x20')]['message']);}})[_0x866e('0x21')](function(_0x2d0106){logger[_0x866e('0x1d')](_0x866e('0x18'),_0xf7ad0b,_0x2d0106);_0x4f210d(_0x2d0106);});});}function respondWithStatusCode(_0x3676d9,_0x4d0bae){_0x4d0bae=_0x4d0bae||0xcc;return function(_0x2e7850){if(_0x2e7850){return _0x3676d9[_0x866e('0x22')](_0x4d0bae);}return _0x3676d9[_0x866e('0x23')](_0x4d0bae)[_0x866e('0x24')]();};}function respondWithResult(_0x47a2a8,_0x775060){_0x775060=_0x775060||0xc8;return function(_0x6c7f2){if(_0x6c7f2){return _0x47a2a8['status'](_0x775060)['json'](_0x6c7f2);}};}function respondWithFilteredResult(_0xf3fbea,_0x104a5e){return function(_0x42e78c){if(_0x42e78c){var _0x2c04c1=_0x42e78c[_0x866e('0x25')],_0x42731d=_0x104a5e['offset'],_0x117172=_0x104a5e['offset']+_0x104a5e[_0x866e('0x26')],_0x43e11b;if(_0x117172>=_0x2c04c1){_0x117172=_0x2c04c1;_0x43e11b=0xc8;}else{_0x43e11b=0xce;}_0xf3fbea[_0x866e('0x23')](_0x43e11b);return _0xf3fbea[_0x866e('0x27')](_0x866e('0x28'),_0x42731d+'-'+_0x117172+'/'+_0x2c04c1)['json'](_0x42e78c);}return null;};}function patchUpdates(_0x2ab9eb){return function(_0x51689c){try{jsonpatch[_0x866e('0x29')](_0x51689c,_0x2ab9eb,!![]);}catch(_0x568fe4){return BPromise[_0x866e('0x2a')](_0x568fe4);}return _0x51689c[_0x866e('0x2b')]();};}function saveUpdates(_0x25ca87,_0x43df39){return function(_0x55d081){if(_0x55d081){return _0x55d081[_0x866e('0x2c')](_0x25ca87)['then'](function(_0x17bb8e){return _0x17bb8e;});}return null;};}function removeEntity(_0x2955ae,_0x54450a){return function(_0x2ee218){if(_0x2ee218){return _0x2ee218[_0x866e('0x2d')]()[_0x866e('0x16')](function(){var _0x2e8986=_0x2ee218[_0x866e('0x2e')]({'plain':!![]});var _0x168461=_0x866e('0x2f');return db[_0x866e('0x30')][_0x866e('0x2d')]({'where':{'type':_0x168461,'resourceId':_0x2e8986['id']}})['then'](function(){return _0x2ee218;});})[_0x866e('0x16')](function(){_0x2955ae[_0x866e('0x23')](0xcc)[_0x866e('0x24')]();});}};}function handleEntityNotFound(_0x39ba4d,_0x4dec17){return function(_0x279284){if(!_0x279284){_0x39ba4d[_0x866e('0x22')](0x194);}return _0x279284;};}function handleError(_0x41b011,_0x431b59){_0x431b59=_0x431b59||0x1f4;return function(_0x5b62b6){logger[_0x866e('0x1d')](_0x5b62b6['stack']);if(_0x5b62b6[_0x866e('0x31')]){delete _0x5b62b6[_0x866e('0x31')];}_0x41b011[_0x866e('0x23')](_0x431b59)[_0x866e('0x32')](_0x5b62b6);};}exports[_0x866e('0x33')]=function(_0x394978,_0x136b64){var _0x4964bf={},_0x36aa54={},_0x4ad6cd={'count':0x0,'rows':[]};var _0x5372de=_[_0x866e('0x34')](db[_0x866e('0x35')][_0x866e('0x36')],function(_0x4d7fe5){return{'name':_0x4d7fe5[_0x866e('0x37')],'type':_0x4d7fe5[_0x866e('0x38')]['key']};});_0x36aa54[_0x866e('0x39')]=_[_0x866e('0x34')](_0x5372de,_0x866e('0x31'));_0x36aa54[_0x866e('0x3a')]=_[_0x866e('0x3b')](_0x394978[_0x866e('0x3a')]);_0x36aa54[_0x866e('0x3c')]=_['intersection'](_0x36aa54[_0x866e('0x39')],_0x36aa54[_0x866e('0x3a')]);_0x4964bf[_0x866e('0x3d')]=_[_0x866e('0x3e')](_0x36aa54['model'],qs[_0x866e('0x3f')](_0x394978['query'][_0x866e('0x3f')]));_0x4964bf['attributes']=_0x4964bf[_0x866e('0x3d')]['length']?_0x4964bf[_0x866e('0x3d')]:_0x36aa54['model'];if(!_0x394978['query'][_0x866e('0x40')](_0x866e('0x41'))){_0x4964bf[_0x866e('0x26')]=qs[_0x866e('0x26')](_0x394978[_0x866e('0x3a')][_0x866e('0x26')]);_0x4964bf[_0x866e('0x42')]=qs['offset'](_0x394978['query']['offset']);}_0x4964bf[_0x866e('0x43')]=qs[_0x866e('0x44')](_0x394978[_0x866e('0x3a')][_0x866e('0x44')]);_0x4964bf[_0x866e('0x45')]=qs[_0x866e('0x3c')](_[_0x866e('0x46')](_0x394978[_0x866e('0x3a')],_0x36aa54['filters']));if(_0x394978[_0x866e('0x3a')][_0x866e('0x47')]){_0x4964bf[_0x866e('0x45')]=_[_0x866e('0x48')](_0x4964bf[_0x866e('0x45')],{'$or':_[_0x866e('0x34')](_0x5372de,function(_0x4b17b4){if(_0x4b17b4['type']!==_0x866e('0x49')){var _0x553612={};_0x553612[_0x4b17b4[_0x866e('0x31')]]={'$like':'%'+_0x394978[_0x866e('0x3a')][_0x866e('0x47')]+'%'};return _0x553612;}})});}_0x4964bf=_[_0x866e('0x48')]({},_0x4964bf,_0x394978[_0x866e('0x4a')]);var _0x40eddb={'where':_0x4964bf[_0x866e('0x45')]};return db[_0x866e('0x35')][_0x866e('0x25')](_0x40eddb)[_0x866e('0x16')](function(_0x54f9b9){_0x4ad6cd[_0x866e('0x25')]=_0x54f9b9;if(_0x394978[_0x866e('0x3a')][_0x866e('0x4b')]){_0x4964bf[_0x866e('0x4c')]=[{'all':!![]}];}return db[_0x866e('0x35')][_0x866e('0x4d')](_0x4964bf);})[_0x866e('0x16')](function(_0x565a4b){_0x4ad6cd[_0x866e('0x4e')]=_0x565a4b;return _0x4ad6cd;})[_0x866e('0x16')](respondWithFilteredResult(_0x136b64,_0x4964bf))[_0x866e('0x21')](handleError(_0x136b64,null));};exports[_0x866e('0x4f')]=function(_0x5632a1,_0x1cb9d8){var _0x186ff6={'raw':![],'where':{'id':_0x5632a1['params']['id']}},_0x46a084={};_0x46a084['model']=_[_0x866e('0x3b')](db[_0x866e('0x35')][_0x866e('0x36')]);_0x46a084['query']=_[_0x866e('0x3b')](_0x5632a1[_0x866e('0x3a')]);_0x46a084[_0x866e('0x3c')]=_[_0x866e('0x3e')](_0x46a084[_0x866e('0x39')],_0x46a084[_0x866e('0x3a')]);_0x186ff6[_0x866e('0x3d')]=_[_0x866e('0x3e')](_0x46a084[_0x866e('0x39')],qs['fields'](_0x5632a1['query']['fields']));_0x186ff6[_0x866e('0x3d')]=_0x186ff6[_0x866e('0x3d')][_0x866e('0x50')]?_0x186ff6[_0x866e('0x3d')]:_0x46a084[_0x866e('0x39')];if(_0x5632a1['query']['includeAll']){_0x186ff6[_0x866e('0x4c')]=[{'all':!![]}];}_0x186ff6=_[_0x866e('0x48')]({},_0x186ff6,_0x5632a1[_0x866e('0x4a')]);return db[_0x866e('0x35')][_0x866e('0x51')](_0x186ff6)['then'](handleEntityNotFound(_0x1cb9d8,null))[_0x866e('0x16')](respondWithResult(_0x1cb9d8,null))['catch'](handleError(_0x1cb9d8,null));};exports[_0x866e('0x52')]=function(_0x133117,_0x13d346,_0x280605){var _0x3eac1c;return db['VoiceContext'][_0x866e('0x52')](_0x133117[_0x866e('0x53')],{'raw':!![]})[_0x866e('0x16')](function(_0x444bcc){_0x3eac1c=_0x444bcc;return db['VoiceContext'][_0x866e('0x4d')]({'raw':!![]});})[_0x866e('0x16')](function(_0x56f93d){var _0x3563c9=fs[_0x866e('0x54')](path[_0x866e('0x55')](config[_0x866e('0x56')],_0x866e('0x57')),_0x866e('0x58'));var _0x3ed8c1=ejs[_0x866e('0x59')](_0x3563c9,{'contexts':_0x56f93d||[]});fs[_0x866e('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3ed8c1);})[_0x866e('0x16')](function(){return respondWithRpcPromise(_0x866e('0x5b'),'create',{'module':_0x866e('0x5c')});})[_0x866e('0x16')](function(){var _0x36b573=_0x133117[_0x866e('0x5d')]['get']({'plain':!![]});if(!_0x36b573)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36b573['role']===_0x866e('0x5d')){var _0x1f9560=_0x3eac1c[_0x866e('0x2e')]({'plain':!![]});return db[_0x866e('0x5e')]['find']({'where':{'name':'Contexts','userProfileId':_0x36b573['userProfileId']},'raw':!![]})[_0x866e('0x16')](function(_0x1ce3f7){if(_0x1ce3f7&&_0x1ce3f7[_0x866e('0x5f')]===0x0){return db['UserProfileResource'][_0x866e('0x52')]({'name':_0x1f9560[_0x866e('0x31')],'resourceId':_0x1f9560['id'],'type':_0x1ce3f7[_0x866e('0x31')],'sectionId':_0x1ce3f7['id']},{})[_0x866e('0x16')](function(){return _0x3eac1c;});}else{return _0x3eac1c;}})[_0x866e('0x21')](function(_0x38dae8){logger[_0x866e('0x1d')](_0x866e('0x60'),_0x38dae8);throw _0x38dae8;});}return _0x3eac1c;})[_0x866e('0x16')](respondWithResult(_0x13d346,0xc9))[_0x866e('0x21')](handleError(_0x13d346,null));};exports['update']=function(_0x241abf,_0x1b9718,_0x56919f){var _0x2b1a06;return db[_0x866e('0x35')][_0x866e('0x51')]({'where':{'id':_0x241abf[_0x866e('0x61')]['id']}})['then'](handleEntityNotFound(_0x1b9718,null))[_0x866e('0x16')](saveUpdates(_0x241abf['body'],null))[_0x866e('0x16')](function(_0x27ef66){if(_0x27ef66){_0x2b1a06=_0x27ef66;return db['VoiceContext'][_0x866e('0x4d')]({'raw':!![]});}})[_0x866e('0x16')](function(_0x1b3518){var _0x238020=fs['readFileSync'](path['join'](config[_0x866e('0x56')],_0x866e('0x57')),_0x866e('0x58'));var _0x3bff16=ejs[_0x866e('0x59')](_0x238020,{'contexts':_0x1b3518||[]});fs['writeFileSync'](_0x866e('0x62'),_0x3bff16);})[_0x866e('0x16')](function(){return respondWithRpcPromise(_0x866e('0x5b'),_0x866e('0x2c'),{'module':_0x866e('0x5c')});})[_0x866e('0x16')](function(){return _0x2b1a06;})[_0x866e('0x16')](respondWithResult(_0x1b9718,null))[_0x866e('0x21')](handleError(_0x1b9718,null));};exports[_0x866e('0x2d')]=function(_0x1009b8,_0x2671f4,_0x354a01){var _0x484ba1;return db['VoiceContext'][_0x866e('0x51')]({'where':{'id':_0x1009b8['params']['id']}})['then'](handleEntityNotFound(_0x2671f4,null))[_0x866e('0x16')](removeEntity(_0x2671f4,null))[_0x866e('0x16')](function(){return db['VoiceContext'][_0x866e('0x4d')]({'raw':!![]});})[_0x866e('0x16')](function(_0x39b16a){var _0xa86bcd=fs[_0x866e('0x54')](path['join'](config[_0x866e('0x56')],'server/files/templates/context.ejs'),_0x866e('0x58'));var _0x2c2414=ejs[_0x866e('0x59')](_0xa86bcd,{'contexts':_0x39b16a});fs[_0x866e('0x5a')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x2c2414);return respondWithRpcPromise('Reload','destroy',{'module':'chan_sip.so'});})[_0x866e('0x21')](handleError(_0x2671f4,null));}; \ No newline at end of file +var _0xe9bd=['apply','reject','save','update','destroy','get','Contexts','name','index','map','rawAttributes','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','limit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','VoiceContext','findAll','rows','show','params','length','include','options','find','create','body','readFileSync','join','root','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/context.ejs','Reload','chan_sip.so','utf8','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','client','http','test','Sequelize','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','end','count','offset','set','Content-Range','json'];(function(_0x229abd,_0x5d5096){var _0x170a32=function(_0x2763ad){while(--_0x2763ad){_0x229abd['push'](_0x229abd['shift']());}};_0x170a32(++_0x5d5096);}(_0xe9bd,0x111));var _0xde9b=function(_0x640ca1,_0xe3ab50){_0x640ca1=_0x640ca1-0x0;var _0x1e36a0=_0xe9bd[_0x640ca1];return _0x1e36a0;};'use strict';var pdf=require(_0xde9b('0x0'));var emlformat=require(_0xde9b('0x1'));var rimraf=require(_0xde9b('0x2'));var zipdir=require(_0xde9b('0x3'));var jsonpatch=require(_0xde9b('0x4'));var rp=require(_0xde9b('0x5'));var moment=require(_0xde9b('0x6'));var BPromise=require(_0xde9b('0x7'));var Mustache=require('mustache');var util=require(_0xde9b('0x8'));var path=require('path');var sox=require(_0xde9b('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xde9b('0xa'));var squel=require(_0xde9b('0xb'));var crypto=require(_0xde9b('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xde9b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xde9b('0xe'));var Papa=require(_0xde9b('0xf'));var Redis=require(_0xde9b('0x10'));var authService=require(_0xde9b('0x11'));var qs=require(_0xde9b('0x12'));var as=require(_0xde9b('0x13'));var hardwareService=require(_0xde9b('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xde9b('0x15'));var config=require(_0xde9b('0x16'));var db=require(_0xde9b('0x17'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xde9b('0x18')][_0xde9b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x25410a,_0x17fe87,_0x53c38a){if(_0x53c38a){var _0x30a01a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30a01a[_0xde9b('0x1a')](_0x17fe87)){return _0x25410a;}else{throw new db[(_0xde9b('0x1b'))]['ValidationError'](_0xde9b('0x1c'));}}else{return _0x25410a;}}function respondWithRpcPromise(_0x23f0eb,_0x2eb68d,_0x156c80,_0x577600){return new BPromise(function(_0x947854,_0x437115){var _0x1315af=_0x577600||client;return _0x1315af[_0xde9b('0x1d')](_0x23f0eb,_0x156c80)[_0xde9b('0x1e')](function(_0x240270){logger[_0xde9b('0x1f')](_0xde9b('0x20'),_0x2eb68d,_0xde9b('0x21'));logger[_0xde9b('0x22')](_0xde9b('0x23'),_0x2eb68d,_0xde9b('0x21'),JSON[_0xde9b('0x24')](_0x240270));if(_0x240270['error']){if(_0x240270[_0xde9b('0x25')][_0xde9b('0x26')]===0x1f4){logger[_0xde9b('0x25')](_0xde9b('0x20'),_0x2eb68d,_0x240270[_0xde9b('0x25')]['message']);return _0x437115(_0x240270[_0xde9b('0x25')][_0xde9b('0x27')]);}logger[_0xde9b('0x25')](_0xde9b('0x20'),_0x2eb68d,_0x240270[_0xde9b('0x25')]['message']);return _0x947854(_0x240270[_0xde9b('0x25')][_0xde9b('0x27')]);}else{logger[_0xde9b('0x1f')](_0xde9b('0x20'),_0x2eb68d,_0xde9b('0x21'));_0x947854(_0x240270['result'][_0xde9b('0x27')]);}})['catch'](function(_0x4c0e92){logger[_0xde9b('0x25')]('VoiceContext,\x20%s,\x20%s',_0x2eb68d,_0x4c0e92);_0x437115(_0x4c0e92);});});}function respondWithStatusCode(_0x51ecd2,_0x26984f){_0x26984f=_0x26984f||0xcc;return function(_0x5c9281){if(_0x5c9281){return _0x51ecd2[_0xde9b('0x28')](_0x26984f);}return _0x51ecd2[_0xde9b('0x29')](_0x26984f)[_0xde9b('0x2a')]();};}function respondWithResult(_0x483444,_0x4cb69b){_0x4cb69b=_0x4cb69b||0xc8;return function(_0x361297){if(_0x361297){return _0x483444[_0xde9b('0x29')](_0x4cb69b)['json'](_0x361297);}};}function respondWithFilteredResult(_0x36f8d4,_0x11105b){return function(_0x1eedd3){if(_0x1eedd3){var _0x36620f=_0x1eedd3[_0xde9b('0x2b')],_0x555369=_0x11105b[_0xde9b('0x2c')],_0x2c5e4d=_0x11105b['offset']+_0x11105b['limit'],_0x4d512c;if(_0x2c5e4d>=_0x36620f){_0x2c5e4d=_0x36620f;_0x4d512c=0xc8;}else{_0x4d512c=0xce;}_0x36f8d4[_0xde9b('0x29')](_0x4d512c);return _0x36f8d4[_0xde9b('0x2d')](_0xde9b('0x2e'),_0x555369+'-'+_0x2c5e4d+'/'+_0x36620f)[_0xde9b('0x2f')](_0x1eedd3);}return null;};}function patchUpdates(_0x248a6b){return function(_0x5612d4){try{jsonpatch[_0xde9b('0x30')](_0x5612d4,_0x248a6b,!![]);}catch(_0x3c6443){return BPromise[_0xde9b('0x31')](_0x3c6443);}return _0x5612d4[_0xde9b('0x32')]();};}function saveUpdates(_0x36bc60,_0x458e64){return function(_0x292b5a){if(_0x292b5a){return _0x292b5a[_0xde9b('0x33')](_0x36bc60)['then'](function(_0x41b80e){return _0x41b80e;});}return null;};}function removeEntity(_0x414a51,_0x1e9b40){return function(_0x41dc8e){if(_0x41dc8e){return _0x41dc8e[_0xde9b('0x34')]()['then'](function(){var _0x1d9699=_0x41dc8e[_0xde9b('0x35')]({'plain':!![]});var _0x35d589=_0xde9b('0x36');return db['UserProfileResource'][_0xde9b('0x34')]({'where':{'type':_0x35d589,'resourceId':_0x1d9699['id']}})['then'](function(){return _0x41dc8e;});})[_0xde9b('0x1e')](function(){_0x414a51[_0xde9b('0x29')](0xcc)[_0xde9b('0x2a')]();});}};}function handleEntityNotFound(_0x17a992,_0x3738fe){return function(_0x30d040){if(!_0x30d040){_0x17a992[_0xde9b('0x28')](0x194);}return _0x30d040;};}function handleError(_0x1a1610,_0x207b29){_0x207b29=_0x207b29||0x1f4;return function(_0x46e8c4){logger[_0xde9b('0x25')](_0x46e8c4['stack']);if(_0x46e8c4[_0xde9b('0x37')]){delete _0x46e8c4['name'];}_0x1a1610[_0xde9b('0x29')](_0x207b29)['send'](_0x46e8c4);};}exports[_0xde9b('0x38')]=function(_0x242f29,_0x1aa2c0){var _0x5635d1={},_0x20cb24={},_0x177edf={'count':0x0,'rows':[]};var _0x5064bf=_[_0xde9b('0x39')](db['VoiceContext'][_0xde9b('0x3a')],function(_0x52ec0b){return{'name':_0x52ec0b[_0xde9b('0x3b')],'type':_0x52ec0b[_0xde9b('0x3c')]['key']};});_0x20cb24[_0xde9b('0x3d')]=_[_0xde9b('0x39')](_0x5064bf,_0xde9b('0x37'));_0x20cb24[_0xde9b('0x3e')]=_[_0xde9b('0x3f')](_0x242f29[_0xde9b('0x3e')]);_0x20cb24[_0xde9b('0x40')]=_[_0xde9b('0x41')](_0x20cb24[_0xde9b('0x3d')],_0x20cb24[_0xde9b('0x3e')]);_0x5635d1[_0xde9b('0x42')]=_[_0xde9b('0x41')](_0x20cb24[_0xde9b('0x3d')],qs[_0xde9b('0x43')](_0x242f29[_0xde9b('0x3e')][_0xde9b('0x43')]));_0x5635d1[_0xde9b('0x42')]=_0x5635d1[_0xde9b('0x42')]['length']?_0x5635d1['attributes']:_0x20cb24['model'];if(!_0x242f29['query']['hasOwnProperty'](_0xde9b('0x44'))){_0x5635d1[_0xde9b('0x45')]=qs['limit'](_0x242f29[_0xde9b('0x3e')][_0xde9b('0x45')]);_0x5635d1[_0xde9b('0x2c')]=qs[_0xde9b('0x2c')](_0x242f29[_0xde9b('0x3e')][_0xde9b('0x2c')]);}_0x5635d1[_0xde9b('0x46')]=qs['sort'](_0x242f29[_0xde9b('0x3e')][_0xde9b('0x47')]);_0x5635d1['where']=qs['filters'](_[_0xde9b('0x48')](_0x242f29[_0xde9b('0x3e')],_0x20cb24[_0xde9b('0x40')]));if(_0x242f29['query'][_0xde9b('0x49')]){_0x5635d1[_0xde9b('0x4a')]=_[_0xde9b('0x4b')](_0x5635d1[_0xde9b('0x4a')],{'$or':_[_0xde9b('0x39')](_0x5064bf,function(_0x18475b){if(_0x18475b[_0xde9b('0x3c')]!==_0xde9b('0x4c')){var _0x57c101={};_0x57c101[_0x18475b[_0xde9b('0x37')]]={'$like':'%'+_0x242f29[_0xde9b('0x3e')][_0xde9b('0x49')]+'%'};return _0x57c101;}})});}_0x5635d1=_['merge']({},_0x5635d1,_0x242f29['options']);var _0x486f11={'where':_0x5635d1[_0xde9b('0x4a')]};return db['VoiceContext'][_0xde9b('0x2b')](_0x486f11)[_0xde9b('0x1e')](function(_0x4aee50){_0x177edf[_0xde9b('0x2b')]=_0x4aee50;if(_0x242f29[_0xde9b('0x3e')][_0xde9b('0x4d')]){_0x5635d1['include']=[{'all':!![]}];}return db[_0xde9b('0x4e')][_0xde9b('0x4f')](_0x5635d1);})[_0xde9b('0x1e')](function(_0x9e5570){_0x177edf[_0xde9b('0x50')]=_0x9e5570;return _0x177edf;})[_0xde9b('0x1e')](respondWithFilteredResult(_0x1aa2c0,_0x5635d1))['catch'](handleError(_0x1aa2c0,null));};exports[_0xde9b('0x51')]=function(_0x1d4f42,_0x1cd9d7){var _0x291830={'raw':![],'where':{'id':_0x1d4f42[_0xde9b('0x52')]['id']}},_0x2453b2={};_0x2453b2[_0xde9b('0x3d')]=_[_0xde9b('0x3f')](db[_0xde9b('0x4e')][_0xde9b('0x3a')]);_0x2453b2[_0xde9b('0x3e')]=_[_0xde9b('0x3f')](_0x1d4f42['query']);_0x2453b2[_0xde9b('0x40')]=_[_0xde9b('0x41')](_0x2453b2['model'],_0x2453b2[_0xde9b('0x3e')]);_0x291830[_0xde9b('0x42')]=_[_0xde9b('0x41')](_0x2453b2[_0xde9b('0x3d')],qs[_0xde9b('0x43')](_0x1d4f42['query']['fields']));_0x291830[_0xde9b('0x42')]=_0x291830[_0xde9b('0x42')][_0xde9b('0x53')]?_0x291830[_0xde9b('0x42')]:_0x2453b2[_0xde9b('0x3d')];if(_0x1d4f42['query'][_0xde9b('0x4d')]){_0x291830[_0xde9b('0x54')]=[{'all':!![]}];}_0x291830=_[_0xde9b('0x4b')]({},_0x291830,_0x1d4f42[_0xde9b('0x55')]);return db[_0xde9b('0x4e')][_0xde9b('0x56')](_0x291830)[_0xde9b('0x1e')](handleEntityNotFound(_0x1cd9d7,null))[_0xde9b('0x1e')](respondWithResult(_0x1cd9d7,null))['catch'](handleError(_0x1cd9d7,null));};exports[_0xde9b('0x57')]=function(_0x25f07c,_0xc8eb5f,_0x101b57){var _0x2b80f3;return db[_0xde9b('0x4e')][_0xde9b('0x57')](_0x25f07c[_0xde9b('0x58')],{'raw':!![]})['then'](function(_0x4646c6){_0x2b80f3=_0x4646c6;return db['VoiceContext'][_0xde9b('0x4f')]({'raw':!![]});})[_0xde9b('0x1e')](function(_0x3b060b){var _0xeb1150=fs[_0xde9b('0x59')](path[_0xde9b('0x5a')](config[_0xde9b('0x5b')],'server/files/templates/context.ejs'),'utf8');var _0x364e38=ejs[_0xde9b('0x5c')](_0xeb1150,{'contexts':_0x3b060b||[]});fs[_0xde9b('0x5d')](_0xde9b('0x5e'),_0x364e38);})[_0xde9b('0x1e')](function(){return respondWithRpcPromise('Reload',_0xde9b('0x57'),{'module':'chan_sip.so'});})['then'](function(){var _0x257ae7=_0x25f07c[_0xde9b('0x5f')][_0xde9b('0x35')]({'plain':!![]});if(!_0x257ae7)throw new Error(_0xde9b('0x60'));if(_0x257ae7[_0xde9b('0x61')]==='user'){var _0x3426da=_0x2b80f3[_0xde9b('0x35')]({'plain':!![]});return db[_0xde9b('0x62')][_0xde9b('0x56')]({'where':{'name':_0xde9b('0x36'),'userProfileId':_0x257ae7['userProfileId']},'raw':!![]})[_0xde9b('0x1e')](function(_0x20e63b){if(_0x20e63b&&_0x20e63b[_0xde9b('0x63')]===0x0){return db[_0xde9b('0x64')]['create']({'name':_0x3426da[_0xde9b('0x37')],'resourceId':_0x3426da['id'],'type':_0x20e63b[_0xde9b('0x37')],'sectionId':_0x20e63b['id']},{})[_0xde9b('0x1e')](function(){return _0x2b80f3;});}else{return _0x2b80f3;}})[_0xde9b('0x65')](function(_0x281b38){logger[_0xde9b('0x25')](_0xde9b('0x66'),_0x281b38);throw _0x281b38;});}return _0x2b80f3;})[_0xde9b('0x1e')](respondWithResult(_0xc8eb5f,0xc9))[_0xde9b('0x65')](handleError(_0xc8eb5f,null));};exports[_0xde9b('0x33')]=function(_0x286d29,_0x219ec8,_0x23de85){var _0x947960;return db[_0xde9b('0x4e')][_0xde9b('0x56')]({'where':{'id':_0x286d29['params']['id']}})[_0xde9b('0x1e')](handleEntityNotFound(_0x219ec8,null))[_0xde9b('0x1e')](saveUpdates(_0x286d29[_0xde9b('0x58')],null))[_0xde9b('0x1e')](function(_0x2c9b91){if(_0x2c9b91){_0x947960=_0x2c9b91;return db[_0xde9b('0x4e')]['findAll']({'raw':!![]});}})[_0xde9b('0x1e')](function(_0x1e1e94){var _0x264e8a=fs[_0xde9b('0x59')](path[_0xde9b('0x5a')](config[_0xde9b('0x5b')],_0xde9b('0x67')),'utf8');var _0x3f6d4c=ejs[_0xde9b('0x5c')](_0x264e8a,{'contexts':_0x1e1e94||[]});fs[_0xde9b('0x5d')](_0xde9b('0x5e'),_0x3f6d4c);})[_0xde9b('0x1e')](function(){return respondWithRpcPromise(_0xde9b('0x68'),_0xde9b('0x33'),{'module':_0xde9b('0x69')});})[_0xde9b('0x1e')](function(){return _0x947960;})[_0xde9b('0x1e')](respondWithResult(_0x219ec8,null))[_0xde9b('0x65')](handleError(_0x219ec8,null));};exports[_0xde9b('0x34')]=function(_0x222fa4,_0x2ab9b1,_0xf782da){var _0x2822d7;return db[_0xde9b('0x4e')][_0xde9b('0x56')]({'where':{'id':_0x222fa4[_0xde9b('0x52')]['id']}})[_0xde9b('0x1e')](handleEntityNotFound(_0x2ab9b1,null))[_0xde9b('0x1e')](removeEntity(_0x2ab9b1,null))[_0xde9b('0x1e')](function(){return db[_0xde9b('0x4e')][_0xde9b('0x4f')]({'raw':!![]});})[_0xde9b('0x1e')](function(_0x3f750a){var _0x2d7c86=fs['readFileSync'](path[_0xde9b('0x5a')](config[_0xde9b('0x5b')],_0xde9b('0x67')),_0xde9b('0x6a'));var _0x2eca69=ejs[_0xde9b('0x5c')](_0x2d7c86,{'contexts':_0x3f750a});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x2eca69);return respondWithRpcPromise('Reload',_0xde9b('0x34'),{'module':_0xde9b('0x69')});})[_0xde9b('0x65')](handleError(_0x2ab9b1,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index f444908..40261e0 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 _0x752f=['define','VoiceContext','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','exports'];(function(_0x164073,_0x4c80bc){var _0x1fa376=function(_0x2b54e7){while(--_0x2b54e7){_0x164073['push'](_0x164073['shift']());}};_0x1fa376(++_0x4c80bc);}(_0x752f,0x70));var _0xf752=function(_0x1f615f,_0x57830b){_0x1f615f=_0x1f615f-0x0;var _0x3497e4=_0x752f[_0x1f615f];return _0x3497e4;};'use strict';var _=require('lodash');var util=require(_0xf752('0x0'));var logger=require(_0xf752('0x1'))(_0xf752('0x2'));var moment=require(_0xf752('0x3'));var BPromise=require(_0xf752('0x4'));var rp=require(_0xf752('0x5'));var fs=require('fs');var path=require(_0xf752('0x6'));var rimraf=require('rimraf');var config=require(_0xf752('0x7'));var attributes=require('./voiceContext.attributes');module[_0xf752('0x8')]=function(_0x2296a0,_0x15343d){return _0x2296a0[_0xf752('0x9')](_0xf752('0xa'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf6d4=['../../config/logger','rimraf','../../config/environment','./voiceContext.attributes','VoiceContext','lodash'];(function(_0x224616,_0x1decc6){var _0x4fd85c=function(_0x48de76){while(--_0x48de76){_0x224616['push'](_0x224616['shift']());}};_0x4fd85c(++_0x1decc6);}(_0xf6d4,0x167));var _0x4f6d=function(_0x226f9e,_0x23d041){_0x226f9e=_0x226f9e-0x0;var _0x89a54c=_0xf6d4[_0x226f9e];return _0x89a54c;};'use strict';var _=require(_0x4f6d('0x0'));var util=require('util');var logger=require(_0x4f6d('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4f6d('0x2'));var config=require(_0x4f6d('0x3'));var attributes=require(_0x4f6d('0x4'));module['exports']=function(_0x39f9cb,_0x2fe7dc){return _0x39f9cb['define'](_0x4f6d('0x5'),attributes,{'tableName':'voice_contexts','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 3608b0f..dfb5ba8 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 _0xc28d=['VoiceContext,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xc28d,0x1bb));var _0xdc28=function(_0xa2c2e2,_0x535d90){_0xa2c2e2=_0xa2c2e2-0x0;var _0x3d7867=_0xc28d[_0xa2c2e2];return _0x3d7867;};'use strict';var _=require(_0xdc28('0x0'));var util=require(_0xdc28('0x1'));var moment=require(_0xdc28('0x2'));var BPromise=require(_0xdc28('0x3'));var rs=require(_0xdc28('0x4'));var fs=require('fs');var Redis=require(_0xdc28('0x5'));var db=require(_0xdc28('0x6'))['db'];var utils=require(_0xdc28('0x7'));var logger=require('../../config/logger')(_0xdc28('0x8'));var config=require('../../config/environment');var jayson=require(_0xdc28('0x9'));var client=jayson[_0xdc28('0xa')][_0xdc28('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x37a9e9,_0x5e4c0f,_0x381395){return new BPromise(function(_0x2aa214,_0x40a27f){return client[_0xdc28('0xc')](_0x37a9e9,_0x381395)['then'](function(_0x5e4b0c){logger[_0xdc28('0xd')](_0xdc28('0xe'),_0x5e4c0f,_0xdc28('0xf'));logger[_0xdc28('0x10')](_0xdc28('0x11'),_0x5e4c0f,_0xdc28('0xf'),JSON['stringify'](_0x5e4b0c));if(_0x5e4b0c[_0xdc28('0x12')]){if(_0x5e4b0c[_0xdc28('0x12')][_0xdc28('0x13')]===0x1f4){logger[_0xdc28('0x12')](_0xdc28('0xe'),_0x5e4c0f,_0x5e4b0c['error'][_0xdc28('0x14')]);return _0x40a27f(_0x5e4b0c[_0xdc28('0x12')][_0xdc28('0x14')]);}logger['error'](_0xdc28('0xe'),_0x5e4c0f,_0x5e4b0c['error'][_0xdc28('0x14')]);return _0x2aa214(_0x5e4b0c['error'][_0xdc28('0x14')]);}else{logger['info']('VoiceContext,\x20%s,\x20%s',_0x5e4c0f,_0xdc28('0xf'));_0x2aa214(_0x5e4b0c[_0xdc28('0x15')]['message']);}})[_0xdc28('0x16')](function(_0x2df15c){logger[_0xdc28('0x12')](_0xdc28('0xe'),_0x5e4c0f,_0x2df15c);_0x40a27f(_0x2df15c);});});} \ No newline at end of file +var _0xcdc3=['randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','error','message','catch','lodash','bluebird'];(function(_0x4aeaea,_0x473bd5){var _0x3eba9b=function(_0xc0af70){while(--_0xc0af70){_0x4aeaea['push'](_0x4aeaea['shift']());}};_0x3eba9b(++_0x473bd5);}(_0xcdc3,0x1c9));var _0x3cdc=function(_0x1deb03,_0xd05ad8){_0x1deb03=_0x1deb03-0x0;var _0x189fe7=_0xcdc3[_0x1deb03];return _0x189fe7;};'use strict';var _=require(_0x3cdc('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3cdc('0x1'));var rs=require(_0x3cdc('0x2'));var fs=require('fs');var Redis=require(_0x3cdc('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cdc('0x4'));var logger=require(_0x3cdc('0x5'))('rpc');var config=require(_0x3cdc('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3cdc('0x7')][_0x3cdc('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x26aff6,_0x424fb3,_0x12720b){return new BPromise(function(_0xfc0b54,_0x670718){return client['request'](_0x26aff6,_0x12720b)[_0x3cdc('0x9')](function(_0x11623c){logger[_0x3cdc('0xa')](_0x3cdc('0xb'),_0x424fb3,_0x3cdc('0xc'));logger['debug'](_0x3cdc('0xd'),_0x424fb3,_0x3cdc('0xc'),JSON['stringify'](_0x11623c));if(_0x11623c[_0x3cdc('0xe')]){if(_0x11623c['error']['code']===0x1f4){logger['error'](_0x3cdc('0xb'),_0x424fb3,_0x11623c[_0x3cdc('0xe')][_0x3cdc('0xf')]);return _0x670718(_0x11623c[_0x3cdc('0xe')][_0x3cdc('0xf')]);}logger['error'](_0x3cdc('0xb'),_0x424fb3,_0x11623c[_0x3cdc('0xe')][_0x3cdc('0xf')]);return _0xfc0b54(_0x11623c[_0x3cdc('0xe')][_0x3cdc('0xf')]);}else{logger[_0x3cdc('0xa')](_0x3cdc('0xb'),_0x424fb3,_0x3cdc('0xc'));_0xfc0b54(_0x11623c['result'][_0x3cdc('0xf')]);}})[_0x3cdc('0x10')](function(_0x196ec8){logger[_0x3cdc('0xe')](_0x3cdc('0xb'),_0x424fb3,_0x196ec8);_0x670718(_0x196ec8);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index f1c5de9..303d699 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 _0x9ec1=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','delete','destroy','util','path','connect-timeout'];(function(_0x232cbf,_0x3e2f33){var _0x1cd460=function(_0x29b4f3){while(--_0x29b4f3){_0x232cbf['push'](_0x232cbf['shift']());}};_0x1cd460(++_0x3e2f33);}(_0x9ec1,0xa5));var _0x19ec=function(_0x18ab2a,_0x4debcd){_0x18ab2a=_0x18ab2a-0x0;var _0x16dcee=_0x9ec1[_0x18ab2a];return _0x16dcee;};'use strict';var multer=require('multer');var util=require(_0x19ec('0x0'));var path=require(_0x19ec('0x1'));var timeout=require(_0x19ec('0x2'));var express=require(_0x19ec('0x3'));var router=express[_0x19ec('0x4')]();var auth=require(_0x19ec('0x5'));var interaction=require(_0x19ec('0x6'));var config=require(_0x19ec('0x7'));var controller=require(_0x19ec('0x8'));router[_0x19ec('0x9')]('/',auth[_0x19ec('0xa')](),controller[_0x19ec('0xb')]);router[_0x19ec('0x9')](_0x19ec('0xc'),auth[_0x19ec('0xa')](),controller['describe']);router[_0x19ec('0x9')](_0x19ec('0xd'),auth[_0x19ec('0xa')](),controller[_0x19ec('0xe')]);router[_0x19ec('0xf')]('/',auth[_0x19ec('0xa')](),controller[_0x19ec('0x10')]);router[_0x19ec('0x11')]('/:id',auth[_0x19ec('0xa')](),controller[_0x19ec('0x12')]);router[_0x19ec('0x13')](_0x19ec('0xd'),auth['isAuthenticated'](),controller[_0x19ec('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdfa6=['get','/:id','post','create','put','update','destroy','multer','path','express','Router','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','isAuthenticated','describe'];(function(_0x1d3478,_0x186d94){var _0x4a9757=function(_0x4a17b3){while(--_0x4a17b3){_0x1d3478['push'](_0x1d3478['shift']());}};_0x4a9757(++_0x186d94);}(_0xdfa6,0x1e7));var _0x6dfa=function(_0x3b1810,_0xd8d593){_0x3b1810=_0x3b1810-0x0;var _0x15c9a3=_0xdfa6[_0x3b1810];return _0x15c9a3;};'use strict';var multer=require(_0x6dfa('0x0'));var util=require('util');var path=require(_0x6dfa('0x1'));var timeout=require('connect-timeout');var express=require(_0x6dfa('0x2'));var router=express[_0x6dfa('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6dfa('0x4'));var config=require(_0x6dfa('0x5'));var controller=require(_0x6dfa('0x6'));router['get']('/',auth[_0x6dfa('0x7')](),controller['index']);router['get']('/describe',auth['isAuthenticated'](),controller[_0x6dfa('0x8')]);router[_0x6dfa('0x9')](_0x6dfa('0xa'),auth[_0x6dfa('0x7')](),controller['show']);router[_0x6dfa('0xb')]('/',auth['isAuthenticated'](),controller[_0x6dfa('0xc')]);router[_0x6dfa('0xd')](_0x6dfa('0xa'),auth[_0x6dfa('0x7')](),controller[_0x6dfa('0xe')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x6dfa('0xf')]);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 9646790..c276496 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 _0xcf4a=['exports','STRING','INTEGER','DATE','called,connect,complete'];(function(_0x1a663e,_0x357c47){var _0x4055ab=function(_0x3deb3c){while(--_0x3deb3c){_0x1a663e['push'](_0x1a663e['shift']());}};_0x4055ab(++_0x357c47);}(_0xcf4a,0x195));var _0xacf4=function(_0x2bfb5,_0x487192){_0x2bfb5=_0x2bfb5-0x0;var _0x2c440e=_0xcf4a[_0x2bfb5];return _0x2c440e;};'use strict';var Sequelize=require('sequelize');module[_0xacf4('0x0')]={'privilege':{'type':Sequelize[_0xacf4('0x1')]},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0xacf4('0x2')]},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xacf4('0x1')]},'calleridname':{'type':Sequelize[_0xacf4('0x1')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xacf4('0x1')]},'language':{'type':Sequelize[_0xacf4('0x1')]},'accountcode':{'type':Sequelize[_0xacf4('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xacf4('0x1')]},'priority':{'type':Sequelize[_0xacf4('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xacf4('0x1')]},'destchannel':{'type':Sequelize[_0xacf4('0x1')]},'destchannelstate':{'type':Sequelize[_0xacf4('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0xacf4('0x1')]},'destcalleridnum':{'type':Sequelize[_0xacf4('0x1')]},'destcalleridname':{'type':Sequelize[_0xacf4('0x1')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0xacf4('0x1')]},'destlanguage':{'type':Sequelize[_0xacf4('0x1')]},'destaccountcode':{'type':Sequelize[_0xacf4('0x1')]},'destcontext':{'type':Sequelize[_0xacf4('0x1')]},'destexten':{'type':Sequelize[_0xacf4('0x1')]},'destpriority':{'type':Sequelize[_0xacf4('0x2')]},'destuniqueid':{'type':Sequelize[_0xacf4('0x1')]},'destlinkedid':{'type':Sequelize[_0xacf4('0x1')]},'dialstring':{'type':Sequelize[_0xacf4('0x1')]},'dialstatus':{'type':Sequelize[_0xacf4('0x1')]},'starttime':{'type':Sequelize[_0xacf4('0x3')]},'answertime':{'type':Sequelize[_0xacf4('0x3')]},'endtime':{'type':Sequelize[_0xacf4('0x3')]},'lastevent':{'type':Sequelize[_0xacf4('0x1')],'comment':_0xacf4('0x4')},'routeId':{'type':Sequelize[_0xacf4('0x2')]},'duration':{'type':Sequelize[_0xacf4('0x2')]},'holdtime':{'type':Sequelize[_0xacf4('0x2')]},'billableseconds':{'type':Sequelize[_0xacf4('0x2')]}}; \ No newline at end of file +var _0x712e=['called,connect,complete','sequelize','exports','STRING','INTEGER','DATE'];(function(_0x342b4e,_0x2e9d7d){var _0x211a50=function(_0x12ddeb){while(--_0x12ddeb){_0x342b4e['push'](_0x342b4e['shift']());}};_0x211a50(++_0x2e9d7d);}(_0x712e,0x7f));var _0xe712=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x712e[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0xe712('0x0'));module[_0xe712('0x1')]={'privilege':{'type':Sequelize[_0xe712('0x2')]},'channel':{'type':Sequelize[_0xe712('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0xe712('0x2')]},'calleridnum':{'type':Sequelize[_0xe712('0x2')]},'calleridname':{'type':Sequelize[_0xe712('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe712('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0xe712('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0xe712('0x2')]},'priority':{'type':Sequelize[_0xe712('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize[_0xe712('0x2')]},'destchannel':{'type':Sequelize[_0xe712('0x2')]},'destchannelstate':{'type':Sequelize[_0xe712('0x3')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0xe712('0x2')]},'destcalleridname':{'type':Sequelize[_0xe712('0x2')]},'destconnectedlinenum':{'type':Sequelize[_0xe712('0x2')]},'destconnectedlinename':{'type':Sequelize[_0xe712('0x2')]},'destlanguage':{'type':Sequelize[_0xe712('0x2')]},'destaccountcode':{'type':Sequelize[_0xe712('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0xe712('0x2')]},'destpriority':{'type':Sequelize[_0xe712('0x3')]},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize['STRING']},'dialstring':{'type':Sequelize[_0xe712('0x2')]},'dialstatus':{'type':Sequelize[_0xe712('0x2')]},'starttime':{'type':Sequelize[_0xe712('0x4')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0xe712('0x4')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0xe712('0x5')},'routeId':{'type':Sequelize['INTEGER']},'duration':{'type':Sequelize[_0xe712('0x3')]},'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 0b7c36a..b16979b 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 _0x4206=['offset','limit','set','apply','update','then','destroy','stack','name','send','index','map','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','VoiceDialReport','findAll','catch','show','params','rawAttributes','length','create','body','find','describe','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','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count'];(function(_0x5de7b0,_0x12208a){var _0x367433=function(_0x20efdc){while(--_0x20efdc){_0x5de7b0['push'](_0x5de7b0['shift']());}};_0x367433(++_0x12208a);}(_0x4206,0x15c));var _0x6420=function(_0x4aeba3,_0x116172){_0x4aeba3=_0x4aeba3-0x0;var _0x4d2d76=_0x4206[_0x4aeba3];return _0x4d2d76;};'use strict';var pdf=require(_0x6420('0x0'));var emlformat=require(_0x6420('0x1'));var rimraf=require(_0x6420('0x2'));var zipdir=require(_0x6420('0x3'));var jsonpatch=require(_0x6420('0x4'));var rp=require(_0x6420('0x5'));var moment=require(_0x6420('0x6'));var BPromise=require(_0x6420('0x7'));var Mustache=require(_0x6420('0x8'));var util=require(_0x6420('0x9'));var path=require(_0x6420('0xa'));var sox=require(_0x6420('0xb'));var csv=require(_0x6420('0xc'));var ejs=require(_0x6420('0xd'));var fs=require('fs');var _=require(_0x6420('0xe'));var squel=require(_0x6420('0xf'));var crypto=require(_0x6420('0x10'));var jsforce=require(_0x6420('0x11'));var deskjs=require('desk.js');var toCsv=require(_0x6420('0xc'));var querystring=require(_0x6420('0x12'));var Papa=require('papaparse');var Redis=require(_0x6420('0x13'));var authService=require(_0x6420('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6420('0x15'));var hardwareService=require(_0x6420('0x16'));var logger=require(_0x6420('0x17'))(_0x6420('0x18'));var utils=require(_0x6420('0x19'));var config=require(_0x6420('0x1a'));var db=require(_0x6420('0x1b'))['db'];function respondWithStatusCode(_0xcb65c1,_0x470a2c){_0x470a2c=_0x470a2c||0xcc;return function(_0x430e98){if(_0x430e98){return _0xcb65c1[_0x6420('0x1c')](_0x470a2c);}return _0xcb65c1['status'](_0x470a2c)['end']();};}function respondWithResult(_0x7236e1,_0x3a4261){_0x3a4261=_0x3a4261||0xc8;return function(_0x56377b){if(_0x56377b){return _0x7236e1[_0x6420('0x1d')](_0x3a4261)[_0x6420('0x1e')](_0x56377b);}};}function respondWithFilteredResult(_0x18dc34,_0x4d9ea9){return function(_0x4c90e2){if(_0x4c90e2){var _0xfa5a13=_0x4c90e2[_0x6420('0x1f')],_0x54bb30=_0x4d9ea9[_0x6420('0x20')],_0x23b190=_0x4d9ea9['offset']+_0x4d9ea9[_0x6420('0x21')],_0x4abd86;if(_0x23b190>=_0xfa5a13){_0x23b190=_0xfa5a13;_0x4abd86=0xc8;}else{_0x4abd86=0xce;}_0x18dc34['status'](_0x4abd86);return _0x18dc34[_0x6420('0x22')]('Content-Range',_0x54bb30+'-'+_0x23b190+'/'+_0xfa5a13)[_0x6420('0x1e')](_0x4c90e2);}return null;};}function patchUpdates(_0x74fee2){return function(_0x20f3d9){try{jsonpatch[_0x6420('0x23')](_0x20f3d9,_0x74fee2,!![]);}catch(_0x139680){return BPromise['reject'](_0x139680);}return _0x20f3d9['save']();};}function saveUpdates(_0x4bad37,_0x3af2f1){return function(_0x352c98){if(_0x352c98){return _0x352c98[_0x6420('0x24')](_0x4bad37)[_0x6420('0x25')](function(_0x5036af){return _0x5036af;});}return null;};}function removeEntity(_0x4e8986,_0x5be476){return function(_0xd5efef){if(_0xd5efef){return _0xd5efef[_0x6420('0x26')]()[_0x6420('0x25')](function(){_0x4e8986[_0x6420('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x5e0e62,_0x1e4c32){return function(_0x4f8e51){if(!_0x4f8e51){_0x5e0e62[_0x6420('0x1c')](0x194);}return _0x4f8e51;};}function handleError(_0xc193fa,_0x47edfa){_0x47edfa=_0x47edfa||0x1f4;return function(_0x374571){logger['error'](_0x374571[_0x6420('0x27')]);if(_0x374571['name']){delete _0x374571[_0x6420('0x28')];}_0xc193fa['status'](_0x47edfa)[_0x6420('0x29')](_0x374571);};}exports[_0x6420('0x2a')]=function(_0x1929d8,_0x14c8b3){var _0x5b7c20={},_0x8804a4={},_0x14f09f={'count':0x0,'rows':[]};var _0x200762=_[_0x6420('0x2b')](db['VoiceDialReport']['rawAttributes'],function(_0x55512a){return{'name':_0x55512a[_0x6420('0x2c')],'type':_0x55512a[_0x6420('0x2d')][_0x6420('0x2e')]};});_0x8804a4['model']=_[_0x6420('0x2b')](_0x200762,_0x6420('0x28'));_0x8804a4[_0x6420('0x2f')]=_[_0x6420('0x30')](_0x1929d8[_0x6420('0x2f')]);_0x8804a4[_0x6420('0x31')]=_['intersection'](_0x8804a4[_0x6420('0x32')],_0x8804a4[_0x6420('0x2f')]);_0x5b7c20[_0x6420('0x33')]=_[_0x6420('0x34')](_0x8804a4[_0x6420('0x32')],qs[_0x6420('0x35')](_0x1929d8[_0x6420('0x2f')][_0x6420('0x35')]));_0x5b7c20['attributes']=_0x5b7c20[_0x6420('0x33')]['length']?_0x5b7c20[_0x6420('0x33')]:_0x8804a4[_0x6420('0x32')];if(!_0x1929d8[_0x6420('0x2f')][_0x6420('0x36')](_0x6420('0x37'))){_0x5b7c20[_0x6420('0x21')]=qs[_0x6420('0x21')](_0x1929d8['query'][_0x6420('0x21')]);_0x5b7c20[_0x6420('0x20')]=qs[_0x6420('0x20')](_0x1929d8[_0x6420('0x2f')]['offset']);}_0x5b7c20[_0x6420('0x38')]=qs[_0x6420('0x39')](_0x1929d8[_0x6420('0x2f')][_0x6420('0x39')]);_0x5b7c20[_0x6420('0x3a')]=qs[_0x6420('0x31')](_[_0x6420('0x3b')](_0x1929d8[_0x6420('0x2f')],_0x8804a4[_0x6420('0x31')]));if(_0x1929d8[_0x6420('0x2f')][_0x6420('0x3c')]){_0x5b7c20[_0x6420('0x3a')]=_[_0x6420('0x3d')](_0x5b7c20[_0x6420('0x3a')],{'$or':_[_0x6420('0x2b')](_0x200762,function(_0x4a8b69){if(_0x4a8b69['type']!==_0x6420('0x3e')){var _0x4dc43a={};_0x4dc43a[_0x4a8b69[_0x6420('0x28')]]={'$like':'%'+_0x1929d8[_0x6420('0x2f')][_0x6420('0x3c')]+'%'};return _0x4dc43a;}})});}_0x5b7c20=_[_0x6420('0x3d')]({},_0x5b7c20,_0x1929d8[_0x6420('0x3f')]);var _0x28ec9f={'where':_0x5b7c20[_0x6420('0x3a')]};return db['VoiceDialReport']['count'](_0x28ec9f)[_0x6420('0x25')](function(_0x43ec31){_0x14f09f[_0x6420('0x1f')]=_0x43ec31;if(_0x1929d8[_0x6420('0x2f')]['includeAll']){_0x5b7c20[_0x6420('0x40')]=[{'all':!![]}];}return db[_0x6420('0x41')][_0x6420('0x42')](_0x5b7c20);})[_0x6420('0x25')](function(_0x29954f){_0x14f09f['rows']=_0x29954f;return _0x14f09f;})[_0x6420('0x25')](respondWithFilteredResult(_0x14c8b3,_0x5b7c20))[_0x6420('0x43')](handleError(_0x14c8b3,null));};exports[_0x6420('0x44')]=function(_0xa0274a,_0x5f375f){var _0x334a44={'raw':!![],'where':{'id':_0xa0274a[_0x6420('0x45')]['id']}},_0x418794={};_0x418794[_0x6420('0x32')]=_[_0x6420('0x30')](db[_0x6420('0x41')][_0x6420('0x46')]);_0x418794[_0x6420('0x2f')]=_['keys'](_0xa0274a['query']);_0x418794[_0x6420('0x31')]=_['intersection'](_0x418794[_0x6420('0x32')],_0x418794[_0x6420('0x2f')]);_0x334a44[_0x6420('0x33')]=_['intersection'](_0x418794[_0x6420('0x32')],qs[_0x6420('0x35')](_0xa0274a[_0x6420('0x2f')]['fields']));_0x334a44[_0x6420('0x33')]=_0x334a44['attributes'][_0x6420('0x47')]?_0x334a44[_0x6420('0x33')]:_0x418794[_0x6420('0x32')];if(_0xa0274a[_0x6420('0x2f')]['includeAll']){_0x334a44[_0x6420('0x40')]=[{'all':!![]}];}_0x334a44=_[_0x6420('0x3d')]({},_0x334a44,_0xa0274a[_0x6420('0x3f')]);return db[_0x6420('0x41')]['find'](_0x334a44)[_0x6420('0x25')](handleEntityNotFound(_0x5f375f,null))[_0x6420('0x25')](respondWithResult(_0x5f375f,null))['catch'](handleError(_0x5f375f,null));};exports[_0x6420('0x48')]=function(_0x39383b,_0x457bb1){return db[_0x6420('0x41')][_0x6420('0x48')](_0x39383b[_0x6420('0x49')],{})['then'](respondWithResult(_0x457bb1,0xc9))[_0x6420('0x43')](handleError(_0x457bb1,null));};exports[_0x6420('0x24')]=function(_0x55b556,_0x45a371){if(_0x55b556[_0x6420('0x49')]['id']){delete _0x55b556[_0x6420('0x49')]['id'];}return db[_0x6420('0x41')][_0x6420('0x4a')]({'where':{'id':_0x55b556[_0x6420('0x45')]['id']}})['then'](handleEntityNotFound(_0x45a371,null))[_0x6420('0x25')](saveUpdates(_0x55b556['body'],null))['then'](respondWithResult(_0x45a371,null))['catch'](handleError(_0x45a371,null));};exports[_0x6420('0x26')]=function(_0x45593d,_0xebc087){return db[_0x6420('0x41')][_0x6420('0x4a')]({'where':{'id':_0x45593d[_0x6420('0x45')]['id']}})[_0x6420('0x25')](handleEntityNotFound(_0xebc087,null))[_0x6420('0x25')](removeEntity(_0xebc087,null))[_0x6420('0x43')](handleError(_0xebc087,null));};exports[_0x6420('0x4b')]=function(_0x589b70,_0x5b0220){return db[_0x6420('0x41')]['describe']()['then'](respondWithResult(_0x5b0220,null))[_0x6420('0x43')](handleError(_0x5b0220,null));}; \ No newline at end of file +var _0x1d5f=['order','sort','where','pick','filter','merge','then','rows','show','params','includeAll','include','options','find','create','body','catch','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','limit'];(function(_0x1f5427,_0x3a9854){var _0x37f981=function(_0x322c65){while(--_0x322c65){_0x1f5427['push'](_0x1f5427['shift']());}};_0x37f981(++_0x3a9854);}(_0x1d5f,0xa2));var _0xf1d5=function(_0x310d10,_0x3fe887){_0x310d10=_0x310d10-0x0;var _0x1fb8af=_0x1d5f[_0x310d10];return _0x1fb8af;};'use strict';var pdf=require(_0xf1d5('0x0'));var emlformat=require(_0xf1d5('0x1'));var rimraf=require(_0xf1d5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf1d5('0x3'));var rp=require(_0xf1d5('0x4'));var moment=require(_0xf1d5('0x5'));var BPromise=require(_0xf1d5('0x6'));var Mustache=require(_0xf1d5('0x7'));var util=require(_0xf1d5('0x8'));var path=require(_0xf1d5('0x9'));var sox=require(_0xf1d5('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf1d5('0xb'));var squel=require(_0xf1d5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xf1d5('0xd'));var querystring=require(_0xf1d5('0xe'));var Papa=require(_0xf1d5('0xf'));var Redis=require(_0xf1d5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf1d5('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf1d5('0x12'));var logger=require(_0xf1d5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xf1d5('0x14'));var db=require(_0xf1d5('0x15'))['db'];function respondWithStatusCode(_0x4da604,_0x457ca7){_0x457ca7=_0x457ca7||0xcc;return function(_0x3ac4cd){if(_0x3ac4cd){return _0x4da604[_0xf1d5('0x16')](_0x457ca7);}return _0x4da604[_0xf1d5('0x17')](_0x457ca7)[_0xf1d5('0x18')]();};}function respondWithResult(_0x5dd178,_0x4164cf){_0x4164cf=_0x4164cf||0xc8;return function(_0x196718){if(_0x196718){return _0x5dd178[_0xf1d5('0x17')](_0x4164cf)['json'](_0x196718);}};}function respondWithFilteredResult(_0x215e0f,_0x4ade93){return function(_0x3da596){if(_0x3da596){var _0x44db1=_0x3da596[_0xf1d5('0x19')],_0x1c947a=_0x4ade93[_0xf1d5('0x1a')],_0x1f87e0=_0x4ade93[_0xf1d5('0x1a')]+_0x4ade93['limit'],_0x51e5cb;if(_0x1f87e0>=_0x44db1){_0x1f87e0=_0x44db1;_0x51e5cb=0xc8;}else{_0x51e5cb=0xce;}_0x215e0f[_0xf1d5('0x17')](_0x51e5cb);return _0x215e0f[_0xf1d5('0x1b')](_0xf1d5('0x1c'),_0x1c947a+'-'+_0x1f87e0+'/'+_0x44db1)['json'](_0x3da596);}return null;};}function patchUpdates(_0x3509ff){return function(_0x240ab0){try{jsonpatch[_0xf1d5('0x1d')](_0x240ab0,_0x3509ff,!![]);}catch(_0x8a447b){return BPromise[_0xf1d5('0x1e')](_0x8a447b);}return _0x240ab0[_0xf1d5('0x1f')]();};}function saveUpdates(_0x7d07f6,_0x2c7029){return function(_0x193323){if(_0x193323){return _0x193323[_0xf1d5('0x20')](_0x7d07f6)['then'](function(_0x525816){return _0x525816;});}return null;};}function removeEntity(_0x147fd3,_0x5167d0){return function(_0x11ccef){if(_0x11ccef){return _0x11ccef[_0xf1d5('0x21')]()['then'](function(){_0x147fd3['status'](0xcc)[_0xf1d5('0x18')]();});}};}function handleEntityNotFound(_0x2c5610,_0x82f4ce){return function(_0x22810c){if(!_0x22810c){_0x2c5610['sendStatus'](0x194);}return _0x22810c;};}function handleError(_0x5c97db,_0x235bb1){_0x235bb1=_0x235bb1||0x1f4;return function(_0x4bfd57){logger[_0xf1d5('0x22')](_0x4bfd57[_0xf1d5('0x23')]);if(_0x4bfd57[_0xf1d5('0x24')]){delete _0x4bfd57[_0xf1d5('0x24')];}_0x5c97db['status'](_0x235bb1)['send'](_0x4bfd57);};}exports[_0xf1d5('0x25')]=function(_0x26540a,_0x18c521){var _0x4ab308={},_0x35b644={},_0x3e1799={'count':0x0,'rows':[]};var _0x43ab09=_[_0xf1d5('0x26')](db[_0xf1d5('0x27')][_0xf1d5('0x28')],function(_0x2780f7){return{'name':_0x2780f7[_0xf1d5('0x29')],'type':_0x2780f7[_0xf1d5('0x2a')][_0xf1d5('0x2b')]};});_0x35b644[_0xf1d5('0x2c')]=_[_0xf1d5('0x26')](_0x43ab09,_0xf1d5('0x24'));_0x35b644[_0xf1d5('0x2d')]=_[_0xf1d5('0x2e')](_0x26540a['query']);_0x35b644[_0xf1d5('0x2f')]=_['intersection'](_0x35b644['model'],_0x35b644[_0xf1d5('0x2d')]);_0x4ab308[_0xf1d5('0x30')]=_[_0xf1d5('0x31')](_0x35b644[_0xf1d5('0x2c')],qs[_0xf1d5('0x32')](_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x32')]));_0x4ab308[_0xf1d5('0x30')]=_0x4ab308[_0xf1d5('0x30')][_0xf1d5('0x33')]?_0x4ab308[_0xf1d5('0x30')]:_0x35b644['model'];if(!_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x34')]('nolimit')){_0x4ab308[_0xf1d5('0x35')]=qs[_0xf1d5('0x35')](_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x35')]);_0x4ab308[_0xf1d5('0x1a')]=qs['offset'](_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x1a')]);}_0x4ab308[_0xf1d5('0x36')]=qs['sort'](_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x37')]);_0x4ab308[_0xf1d5('0x38')]=qs[_0xf1d5('0x2f')](_[_0xf1d5('0x39')](_0x26540a[_0xf1d5('0x2d')],_0x35b644['filters']));if(_0x26540a['query'][_0xf1d5('0x3a')]){_0x4ab308[_0xf1d5('0x38')]=_[_0xf1d5('0x3b')](_0x4ab308['where'],{'$or':_['map'](_0x43ab09,function(_0x466e85){if(_0x466e85[_0xf1d5('0x2a')]!=='VIRTUAL'){var _0x5e89e9={};_0x5e89e9[_0x466e85[_0xf1d5('0x24')]]={'$like':'%'+_0x26540a[_0xf1d5('0x2d')][_0xf1d5('0x3a')]+'%'};return _0x5e89e9;}})});}_0x4ab308=_[_0xf1d5('0x3b')]({},_0x4ab308,_0x26540a['options']);var _0x5650ce={'where':_0x4ab308[_0xf1d5('0x38')]};return db['VoiceDialReport'][_0xf1d5('0x19')](_0x5650ce)[_0xf1d5('0x3c')](function(_0x2f99b5){_0x3e1799[_0xf1d5('0x19')]=_0x2f99b5;if(_0x26540a[_0xf1d5('0x2d')]['includeAll']){_0x4ab308['include']=[{'all':!![]}];}return db[_0xf1d5('0x27')]['findAll'](_0x4ab308);})[_0xf1d5('0x3c')](function(_0x33054b){_0x3e1799[_0xf1d5('0x3d')]=_0x33054b;return _0x3e1799;})[_0xf1d5('0x3c')](respondWithFilteredResult(_0x18c521,_0x4ab308))['catch'](handleError(_0x18c521,null));};exports[_0xf1d5('0x3e')]=function(_0x13ca47,_0xd9d4db){var _0x3d11dd={'raw':!![],'where':{'id':_0x13ca47[_0xf1d5('0x3f')]['id']}},_0x5aea11={};_0x5aea11[_0xf1d5('0x2c')]=_[_0xf1d5('0x2e')](db[_0xf1d5('0x27')]['rawAttributes']);_0x5aea11[_0xf1d5('0x2d')]=_[_0xf1d5('0x2e')](_0x13ca47['query']);_0x5aea11[_0xf1d5('0x2f')]=_['intersection'](_0x5aea11[_0xf1d5('0x2c')],_0x5aea11[_0xf1d5('0x2d')]);_0x3d11dd[_0xf1d5('0x30')]=_[_0xf1d5('0x31')](_0x5aea11[_0xf1d5('0x2c')],qs[_0xf1d5('0x32')](_0x13ca47[_0xf1d5('0x2d')][_0xf1d5('0x32')]));_0x3d11dd[_0xf1d5('0x30')]=_0x3d11dd[_0xf1d5('0x30')][_0xf1d5('0x33')]?_0x3d11dd[_0xf1d5('0x30')]:_0x5aea11[_0xf1d5('0x2c')];if(_0x13ca47[_0xf1d5('0x2d')][_0xf1d5('0x40')]){_0x3d11dd[_0xf1d5('0x41')]=[{'all':!![]}];}_0x3d11dd=_[_0xf1d5('0x3b')]({},_0x3d11dd,_0x13ca47[_0xf1d5('0x42')]);return db[_0xf1d5('0x27')][_0xf1d5('0x43')](_0x3d11dd)['then'](handleEntityNotFound(_0xd9d4db,null))[_0xf1d5('0x3c')](respondWithResult(_0xd9d4db,null))['catch'](handleError(_0xd9d4db,null));};exports[_0xf1d5('0x44')]=function(_0x420df2,_0x1f4b1c){return db[_0xf1d5('0x27')][_0xf1d5('0x44')](_0x420df2[_0xf1d5('0x45')],{})[_0xf1d5('0x3c')](respondWithResult(_0x1f4b1c,0xc9))[_0xf1d5('0x46')](handleError(_0x1f4b1c,null));};exports['update']=function(_0x373b2c,_0x490b71){if(_0x373b2c['body']['id']){delete _0x373b2c[_0xf1d5('0x45')]['id'];}return db['VoiceDialReport'][_0xf1d5('0x43')]({'where':{'id':_0x373b2c[_0xf1d5('0x3f')]['id']}})['then'](handleEntityNotFound(_0x490b71,null))[_0xf1d5('0x3c')](saveUpdates(_0x373b2c[_0xf1d5('0x45')],null))[_0xf1d5('0x3c')](respondWithResult(_0x490b71,null))[_0xf1d5('0x46')](handleError(_0x490b71,null));};exports[_0xf1d5('0x21')]=function(_0x386fb8,_0x59895b){return db['VoiceDialReport'][_0xf1d5('0x43')]({'where':{'id':_0x386fb8['params']['id']}})['then'](handleEntityNotFound(_0x59895b,null))[_0xf1d5('0x3c')](removeEntity(_0x59895b,null))[_0xf1d5('0x46')](handleError(_0x59895b,null));};exports[_0xf1d5('0x47')]=function(_0x48ccc9,_0x1b424d){return db[_0xf1d5('0x27')][_0xf1d5('0x47')]()[_0xf1d5('0x3c')](respondWithResult(_0x1b424d,null))[_0xf1d5('0x46')](handleError(_0x1b424d,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index 506ec2c..a09c0ef 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 _0xad78=['bluebird','rimraf','exports','define','report_dial','uniqueid','lodash','util','../../config/logger','moment'];(function(_0xc6879,_0x84a966){var _0x54f7a4=function(_0x4e63eb){while(--_0x4e63eb){_0xc6879['push'](_0xc6879['shift']());}};_0x54f7a4(++_0x84a966);}(_0xad78,0x1be));var _0x8ad7=function(_0x38f324,_0x134fa6){_0x38f324=_0x38f324-0x0;var _0x1efa72=_0xad78[_0x38f324];return _0x1efa72;};'use strict';var _=require(_0x8ad7('0x0'));var util=require(_0x8ad7('0x1'));var logger=require(_0x8ad7('0x2'))('api');var moment=require(_0x8ad7('0x3'));var BPromise=require(_0x8ad7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8ad7('0x5'));var config=require('../../config/environment');var attributes=require('./voiceDialReport.attributes');module[_0x8ad7('0x6')]=function(_0x202d92,_0xa2a87b){return _0x202d92[_0x8ad7('0x7')]('VoiceDialReport',attributes,{'tableName':_0x8ad7('0x8'),'paranoid':![],'indexes':[{'fields':[_0x8ad7('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda5e=['request-promise','path','rimraf','./voiceDialReport.attributes','define','uniqueid','moment','bluebird'];(function(_0x4fbaab,_0x5661c7){var _0x42eff5=function(_0x189078){while(--_0x189078){_0x4fbaab['push'](_0x4fbaab['shift']());}};_0x42eff5(++_0x5661c7);}(_0xda5e,0x66));var _0xeda5=function(_0x4e6005,_0x5ae30e){_0x4e6005=_0x4e6005-0x0;var _0x35fd43=_0xda5e[_0x4e6005];return _0x35fd43;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xeda5('0x0'));var BPromise=require(_0xeda5('0x1'));var rp=require(_0xeda5('0x2'));var fs=require('fs');var path=require(_0xeda5('0x3'));var rimraf=require(_0xeda5('0x4'));var config=require('../../config/environment');var attributes=require(_0xeda5('0x5'));module['exports']=function(_0x12c0d9,_0x69c728){return _0x12c0d9[_0xeda5('0x6')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0xeda5('0x7')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 8503a25..14ffc75 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 _0x9f94=['jayson/promise','client','http','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','catch','CreateVoiceDialReport','VoiceDialReport','create','body','options','raw','UpdateVoiceDialReport','update','where','attributes','limit','then','stringify','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x4dbaad,_0x730318){var _0x226c72=function(_0x501972){while(--_0x501972){_0x4dbaad['push'](_0x4dbaad['shift']());}};_0x226c72(++_0x730318);}(_0x9f94,0x1e7));var _0x49f9=function(_0x59ee6f,_0x450239){_0x59ee6f=_0x59ee6f-0x0;var _0x4c0979=_0x9f94[_0x59ee6f];return _0x4c0979;};'use strict';var _=require(_0x49f9('0x0'));var util=require(_0x49f9('0x1'));var moment=require(_0x49f9('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x49f9('0x3'));var db=require(_0x49f9('0x4'))['db'];var utils=require(_0x49f9('0x5'));var logger=require(_0x49f9('0x6'))(_0x49f9('0x7'));var config=require('../../config/environment');var jayson=require(_0x49f9('0x8'));var client=jayson[_0x49f9('0x9')][_0x49f9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2fdbf1,_0x10ada8,_0x2e0928){return new BPromise(function(_0x355683,_0x2eddd1){return client['request'](_0x2fdbf1,_0x2e0928)['then'](function(_0x1628bb){logger['info'](_0x49f9('0xb'),_0x10ada8,_0x49f9('0xc'));logger[_0x49f9('0xd')]('VoiceDialReport,\x20%s,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'),JSON['stringify'](_0x1628bb));if(_0x1628bb[_0x49f9('0xe')]){if(_0x1628bb[_0x49f9('0xe')][_0x49f9('0xf')]===0x1f4){logger[_0x49f9('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error'][_0x49f9('0x10')]);return _0x2eddd1(_0x1628bb[_0x49f9('0xe')][_0x49f9('0x10')]);}logger[_0x49f9('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x10ada8,_0x1628bb['error']['message']);return _0x355683(_0x1628bb[_0x49f9('0xe')]['message']);}else{logger[_0x49f9('0x11')]('VoiceDialReport,\x20%s,\x20%s',_0x10ada8,_0x49f9('0xc'));_0x355683(_0x1628bb[_0x49f9('0x12')]['message']);}})[_0x49f9('0x13')](function(_0x1a2026){logger[_0x49f9('0xe')](_0x49f9('0xb'),_0x10ada8,_0x1a2026);_0x2eddd1(_0x1a2026);});});}exports[_0x49f9('0x14')]=function(_0x509610){var _0x3cc45e=this;return new Promise(function(_0x359d48,_0x32568b){return db[_0x49f9('0x15')][_0x49f9('0x16')](_0x509610[_0x49f9('0x17')],{'raw':_0x509610[_0x49f9('0x18')]?_0x509610[_0x49f9('0x18')][_0x49f9('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x4f0bc9){logger[_0x49f9('0x11')]('CreateVoiceDialReport',_0x509610);logger[_0x49f9('0xd')]('CreateVoiceDialReport',_0x509610,JSON['stringify'](_0x4f0bc9));_0x359d48(_0x4f0bc9);})[_0x49f9('0x13')](function(_0xde1383){logger['error'](_0x49f9('0x14'),_0xde1383['message'],_0x509610);_0x32568b(_0x3cc45e['error'](0x1f4,_0xde1383[_0x49f9('0x10')]));});});};exports[_0x49f9('0x1a')]=function(_0x5757d3){var _0x113179=this;return new Promise(function(_0x459809,_0x4a6161){return db[_0x49f9('0x15')][_0x49f9('0x1b')](_0x5757d3[_0x49f9('0x17')],{'raw':_0x5757d3[_0x49f9('0x18')]?_0x5757d3['options'][_0x49f9('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5757d3[_0x49f9('0x18')]?_0x5757d3[_0x49f9('0x18')][_0x49f9('0x1c')]||null:null,'attributes':_0x5757d3[_0x49f9('0x18')]?_0x5757d3[_0x49f9('0x18')][_0x49f9('0x1d')]||null:null,'limit':_0x5757d3['options']?_0x5757d3['options'][_0x49f9('0x1e')]||null:null})[_0x49f9('0x1f')](function(_0x3f95f5){logger[_0x49f9('0x11')](_0x49f9('0x1a'),_0x5757d3);logger[_0x49f9('0xd')](_0x49f9('0x1a'),_0x5757d3,JSON[_0x49f9('0x20')](_0x3f95f5));_0x459809(_0x3f95f5);})['catch'](function(_0xc0a9aa){logger['error'](_0x49f9('0x1a'),_0xc0a9aa[_0x49f9('0x10')],_0x5757d3);_0x4a6161(_0x113179[_0x49f9('0xe')](0x1f4,_0xc0a9aa['message']));});});}; \ No newline at end of file +var _0x83d3=['raw','then','catch','UpdateVoiceDialReport','body','where','attributes','limit','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','info','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceDialReport,\x20%s,\x20%s','message','result','CreateVoiceDialReport','VoiceDialReport','create','options'];(function(_0x56b1da,_0x2774b8){var _0x252306=function(_0x3486cc){while(--_0x3486cc){_0x56b1da['push'](_0x56b1da['shift']());}};_0x252306(++_0x2774b8);}(_0x83d3,0x17c));var _0x383d=function(_0x160248,_0x2a57e6){_0x160248=_0x160248-0x0;var _0x4e589d=_0x83d3[_0x160248];return _0x4e589d;};'use strict';var _=require(_0x383d('0x0'));var util=require(_0x383d('0x1'));var moment=require(_0x383d('0x2'));var BPromise=require(_0x383d('0x3'));var rs=require(_0x383d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x383d('0x5'))['db'];var utils=require(_0x383d('0x6'));var logger=require(_0x383d('0x7'))(_0x383d('0x8'));var config=require('../../config/environment');var jayson=require(_0x383d('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xbc074b,_0x2c3cab,_0x360bee){return new BPromise(function(_0x5641df,_0x303c1d){return client['request'](_0xbc074b,_0x360bee)['then'](function(_0x221079){logger[_0x383d('0xa')]('VoiceDialReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));logger[_0x383d('0xc')](_0x383d('0xd'),_0x2c3cab,_0x383d('0xb'),JSON[_0x383d('0xe')](_0x221079));if(_0x221079[_0x383d('0xf')]){if(_0x221079['error']['code']===0x1f4){logger['error'](_0x383d('0x10'),_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x303c1d(_0x221079[_0x383d('0xf')][_0x383d('0x11')]);}logger[_0x383d('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x2c3cab,_0x221079['error'][_0x383d('0x11')]);return _0x5641df(_0x221079['error'][_0x383d('0x11')]);}else{logger['info']('VoiceDialReport,\x20%s,\x20%s',_0x2c3cab,_0x383d('0xb'));_0x5641df(_0x221079[_0x383d('0x12')]['message']);}})['catch'](function(_0x11c1f9){logger[_0x383d('0xf')]('VoiceDialReport,\x20%s,\x20%s',_0x2c3cab,_0x11c1f9);_0x303c1d(_0x11c1f9);});});}exports[_0x383d('0x13')]=function(_0x18dc97){var _0xed4b0b=this;return new Promise(function(_0xc7868,_0x224da3){return db[_0x383d('0x14')][_0x383d('0x15')](_0x18dc97['body'],{'raw':_0x18dc97[_0x383d('0x16')]?_0x18dc97[_0x383d('0x16')][_0x383d('0x17')]===undefined?!![]:![]:!![]})[_0x383d('0x18')](function(_0x2043e5){logger[_0x383d('0xa')](_0x383d('0x13'),_0x18dc97);logger['debug']('CreateVoiceDialReport',_0x18dc97,JSON[_0x383d('0xe')](_0x2043e5));_0xc7868(_0x2043e5);})[_0x383d('0x19')](function(_0x4e3d9e){logger[_0x383d('0xf')](_0x383d('0x13'),_0x4e3d9e[_0x383d('0x11')],_0x18dc97);_0x224da3(_0xed4b0b[_0x383d('0xf')](0x1f4,_0x4e3d9e[_0x383d('0x11')]));});});};exports[_0x383d('0x1a')]=function(_0xcbedc9){var _0x3e447e=this;return new Promise(function(_0x1a3933,_0xd4ce78){return db['VoiceDialReport']['update'](_0xcbedc9[_0x383d('0x1b')],{'raw':_0xcbedc9[_0x383d('0x16')]?_0xcbedc9[_0x383d('0x16')][_0x383d('0x17')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xcbedc9[_0x383d('0x16')]?_0xcbedc9[_0x383d('0x16')][_0x383d('0x1c')]||null:null,'attributes':_0xcbedc9['options']?_0xcbedc9[_0x383d('0x16')][_0x383d('0x1d')]||null:null,'limit':_0xcbedc9['options']?_0xcbedc9['options'][_0x383d('0x1e')]||null:null})[_0x383d('0x18')](function(_0x13f872){logger[_0x383d('0xa')](_0x383d('0x1a'),_0xcbedc9);logger[_0x383d('0xc')]('UpdateVoiceDialReport',_0xcbedc9,JSON[_0x383d('0xe')](_0x13f872));_0x1a3933(_0x13f872);})['catch'](function(_0x543b8d){logger[_0x383d('0xf')](_0x383d('0x1a'),_0x543b8d[_0x383d('0x11')],_0xcbedc9);_0xd4ce78(_0x3e447e['error'](0x1f4,_0x543b8d[_0x383d('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index a03ce9e..7bd0c4c 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 _0x5e01=['../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','post','create','/:id/applications','put','update','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service'];(function(_0x5b08fb,_0x2c22f2){var _0x1c81ae=function(_0x1af97a){while(--_0x1af97a){_0x5b08fb['push'](_0x5b08fb['shift']());}};_0x1c81ae(++_0x2c22f2);}(_0x5e01,0x160));var _0x15e0=function(_0x2bcb75,_0x5789a7){_0x2bcb75=_0x2bcb75-0x0;var _0x175345=_0x5e01[_0x2bcb75];return _0x175345;};'use strict';var multer=require(_0x15e0('0x0'));var util=require('util');var path=require(_0x15e0('0x1'));var timeout=require(_0x15e0('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x15e0('0x3'));var interaction=require(_0x15e0('0x4'));var config=require(_0x15e0('0x5'));var controller=require(_0x15e0('0x6'));router[_0x15e0('0x7')]('/',auth[_0x15e0('0x8')](),controller[_0x15e0('0x9')]);router['get'](_0x15e0('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x15e0('0xb')]('/',auth[_0x15e0('0x8')](),controller[_0x15e0('0xc')]);router[_0x15e0('0xb')](_0x15e0('0xd'),auth[_0x15e0('0x8')](),controller['addApplications']);router[_0x15e0('0xe')]('/:id',auth[_0x15e0('0x8')](),controller[_0x15e0('0xf')]);router['delete'](_0x15e0('0xa'),auth[_0x15e0('0x8')](),controller['destroy']);module[_0x15e0('0x10')]=router; \ No newline at end of file +var _0x863d=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','/:id/applications','put'];(function(_0x3207aa,_0xe86a72){var _0x51758f=function(_0x9ff790){while(--_0x9ff790){_0x3207aa['push'](_0x3207aa['shift']());}};_0x51758f(++_0xe86a72);}(_0x863d,0x12a));var _0xd863=function(_0x48fc43,_0x38c553){_0x48fc43=_0x48fc43-0x0;var _0x37fb79=_0x863d[_0x48fc43];return _0x37fb79;};'use strict';var multer=require(_0xd863('0x0'));var util=require(_0xd863('0x1'));var path=require(_0xd863('0x2'));var timeout=require(_0xd863('0x3'));var express=require(_0xd863('0x4'));var router=express[_0xd863('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xd863('0x6'));var config=require(_0xd863('0x7'));var controller=require('./voiceExtension.controller');router[_0xd863('0x8')]('/',auth[_0xd863('0x9')](),controller[_0xd863('0xa')]);router[_0xd863('0x8')](_0xd863('0xb'),auth['isAuthenticated'](),controller[_0xd863('0xc')]);router[_0xd863('0xd')]('/',auth[_0xd863('0x9')](),controller[_0xd863('0xe')]);router['post'](_0xd863('0xf'),auth['isAuthenticated'](),controller['addApplications']);router[_0xd863('0x10')](_0xd863('0xb'),auth[_0xd863('0x9')](),controller[_0xd863('0x11')]);router[_0xd863('0x12')]('/:id',auth[_0xd863('0x9')](),controller[_0xd863('0x13')]);module[_0xd863('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index 3604727..93e0b1f 100644 --- a/server/api/voiceExtension/voiceExtension.attributes.js +++ b/server/api/voiceExtension/voiceExtension.attributes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x3cdfdb,_0x40545d){var _0x57d4d8=function(_0x3e7f86){while(--_0x3e7f86){_0x3cdfdb['push'](_0x3cdfdb['shift']());}};_0x57d4d8(++_0x40545d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0xa9e0[_0x4b7b62];return _0x2280df;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x4b62b8,_0x4cca13){var _0x597300=function(_0x50bf09){while(--_0x50bf09){_0x4b62b8['push'](_0x4b62b8['shift']());}};_0x597300(++_0x4cca13);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index fe048f1..b9443b2 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 _0x2f8a=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','value','includes','type','find','name','UserProfileResource','then','end','stack','send','index','VoiceExtension','rawAttributes','fieldName','map','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','params','body','exten','concat','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','userProfileId','autoAssociation','catch','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','cutdigits','mandatoryDisposition','context','addApplications','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register'];(function(_0x4c78d3,_0x23d958){var _0x5bf5ad=function(_0x330e6b){while(--_0x330e6b){_0x4c78d3['push'](_0x4c78d3['shift']());}};_0x5bf5ad(++_0x23d958);}(_0x2f8a,0x12f));var _0xa2f8=function(_0x535c53,_0xca2484){_0x535c53=_0x535c53-0x0;var _0xe1e86d=_0x2f8a[_0x535c53];return _0xe1e86d;};'use strict';var pdf=require(_0xa2f8('0x0'));var emlformat=require(_0xa2f8('0x1'));var rimraf=require(_0xa2f8('0x2'));var zipdir=require(_0xa2f8('0x3'));var jsonpatch=require(_0xa2f8('0x4'));var rp=require(_0xa2f8('0x5'));var moment=require(_0xa2f8('0x6'));var BPromise=require(_0xa2f8('0x7'));var Mustache=require(_0xa2f8('0x8'));var util=require(_0xa2f8('0x9'));var path=require(_0xa2f8('0xa'));var sox=require(_0xa2f8('0xb'));var csv=require(_0xa2f8('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa2f8('0xd'));var squel=require(_0xa2f8('0xe'));var crypto=require('crypto');var jsforce=require(_0xa2f8('0xf'));var deskjs=require(_0xa2f8('0x10'));var toCsv=require(_0xa2f8('0xc'));var querystring=require(_0xa2f8('0x11'));var Papa=require(_0xa2f8('0x12'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xa2f8('0x13'));var as=require(_0xa2f8('0x14'));var hardwareService=require(_0xa2f8('0x15'));var logger=require(_0xa2f8('0x16'))(_0xa2f8('0x17'));var utils=require(_0xa2f8('0x18'));var config=require(_0xa2f8('0x19'));var db=require(_0xa2f8('0x1a'))['db'];config[_0xa2f8('0x1b')]=_[_0xa2f8('0x1c')](config['redis'],{'host':_0xa2f8('0x1d'),'port':0x18eb});var socket=require(_0xa2f8('0x1e'))(new Redis(config['redis']));require(_0xa2f8('0x1f'))[_0xa2f8('0x20')](socket);function respondWithStatusCode(_0x14bb24,_0x564999){_0x564999=_0x564999||0xcc;return function(_0x45bb12){if(_0x45bb12){return _0x14bb24[_0xa2f8('0x21')](_0x564999);}return _0x14bb24[_0xa2f8('0x22')](_0x564999)['end']();};}function respondWithResult(_0xc47765,_0x58f640){_0x58f640=_0x58f640||0xc8;return function(_0x196cd6){if(_0x196cd6){return _0xc47765[_0xa2f8('0x22')](_0x58f640)[_0xa2f8('0x23')](_0x196cd6);}};}function respondWithFilteredResult(_0x5f44e5,_0x5d5b76){return function(_0x2af6fb){if(_0x2af6fb){var _0x4928e1=_0x2af6fb[_0xa2f8('0x24')],_0x5ea6db=_0x5d5b76[_0xa2f8('0x25')],_0x553749=_0x5d5b76[_0xa2f8('0x25')]+_0x5d5b76[_0xa2f8('0x26')],_0x4554a4;if(_0x553749>=_0x4928e1){_0x553749=_0x4928e1;_0x4554a4=0xc8;}else{_0x4554a4=0xce;}_0x5f44e5[_0xa2f8('0x22')](_0x4554a4);return _0x5f44e5[_0xa2f8('0x27')](_0xa2f8('0x28'),_0x5ea6db+'-'+_0x553749+'/'+_0x4928e1)[_0xa2f8('0x23')](_0x2af6fb);}return null;};}function patchUpdates(_0x1c1ed9){return function(_0x3e99e1){try{jsonpatch[_0xa2f8('0x29')](_0x3e99e1,_0x1c1ed9,!![]);}catch(_0x236145){return BPromise[_0xa2f8('0x2a')](_0x236145);}return _0x3e99e1[_0xa2f8('0x2b')]();};}function saveUpdates(_0x59233e,_0x40a0d2){return function(_0x40a16a){if(_0x40a16a){return _0x40a16a['update'](_0x59233e)['then'](function(_0x534daa){return _0x534daa;});}return null;};}function removeEntity(_0x21eaac,_0x18a94c){return function(_0x31566f){if(_0x31566f){return _0x31566f[_0xa2f8('0x2c')]()['then'](function(){var _0x33418a=_0x31566f[_0xa2f8('0x2d')]({'plain':!![]});var _0x269dad=[{'name':_0xa2f8('0x2e'),'value':'inbound','ignore':![]},{'name':_0xa2f8('0x2f'),'value':_0xa2f8('0x30'),'ignore':![]},{'name':_0xa2f8('0x31'),'value':_0xa2f8('0x32'),'ignore':![]}];var _0x1427ca=_(_0x269dad)[_0xa2f8('0x33')](_0xa2f8('0x34'))['map'](_0xa2f8('0x35'))[_0xa2f8('0x35')]();if(_[_0xa2f8('0x36')](_0x1427ca,_0x33418a[_0xa2f8('0x37')])){return;}var _0x37d91f=_[_0xa2f8('0x38')](_0x269dad,[_0xa2f8('0x35'),_0x33418a['type']])[_0xa2f8('0x39')];return db[_0xa2f8('0x3a')]['destroy']({'where':{'type':_0x37d91f,'resourceId':_0x33418a['id']}})[_0xa2f8('0x3b')](function(){return _0x31566f;});})[_0xa2f8('0x3b')](function(){_0x21eaac[_0xa2f8('0x22')](0xcc)[_0xa2f8('0x3c')]();});}};}function handleEntityNotFound(_0x5b7d4b,_0x4e95bb){return function(_0x12d4df){if(!_0x12d4df){_0x5b7d4b[_0xa2f8('0x21')](0x194);}return _0x12d4df;};}function handleError(_0x590934,_0x12290e){_0x12290e=_0x12290e||0x1f4;return function(_0xd07efe){logger['error'](_0xd07efe[_0xa2f8('0x3d')]);if(_0xd07efe['name']){delete _0xd07efe[_0xa2f8('0x39')];}_0x590934[_0xa2f8('0x22')](_0x12290e)[_0xa2f8('0x3e')](_0xd07efe);};}exports[_0xa2f8('0x3f')]=function(_0x320918,_0x1eb86f){var _0x4b0ff6={},_0x120f1a={},_0x309234={'count':0x0,'rows':[]};var _0x47d512=_['map'](db[_0xa2f8('0x40')][_0xa2f8('0x41')],function(_0x23a1a1){return{'name':_0x23a1a1[_0xa2f8('0x42')],'type':_0x23a1a1['type']['key']};});_0x120f1a['model']=_[_0xa2f8('0x43')](_0x47d512,'name');_0x120f1a[_0xa2f8('0x44')]=_[_0xa2f8('0x45')](_0x320918[_0xa2f8('0x44')]);_0x120f1a[_0xa2f8('0x46')]=_['intersection'](_0x120f1a[_0xa2f8('0x47')],_0x120f1a['query']);_0x4b0ff6[_0xa2f8('0x48')]=_[_0xa2f8('0x49')](_0x120f1a[_0xa2f8('0x47')],qs[_0xa2f8('0x4a')](_0x320918['query'][_0xa2f8('0x4a')]));_0x4b0ff6['attributes']=_0x4b0ff6[_0xa2f8('0x48')][_0xa2f8('0x4b')]?_0x4b0ff6[_0xa2f8('0x48')]:_0x120f1a[_0xa2f8('0x47')];if(!_0x320918[_0xa2f8('0x44')][_0xa2f8('0x4c')](_0xa2f8('0x4d'))){_0x4b0ff6[_0xa2f8('0x26')]=qs[_0xa2f8('0x26')](_0x320918[_0xa2f8('0x44')]['limit']);_0x4b0ff6[_0xa2f8('0x25')]=qs[_0xa2f8('0x25')](_0x320918['query'][_0xa2f8('0x25')]);}_0x4b0ff6[_0xa2f8('0x4e')]=qs['sort'](_0x320918[_0xa2f8('0x44')][_0xa2f8('0x4f')]);_0x4b0ff6[_0xa2f8('0x50')]=qs[_0xa2f8('0x46')](_[_0xa2f8('0x51')](_0x320918[_0xa2f8('0x44')],_0x120f1a[_0xa2f8('0x46')]));if(_0x320918['query'][_0xa2f8('0x33')]){_0x4b0ff6[_0xa2f8('0x50')]=_[_0xa2f8('0x52')](_0x4b0ff6['where'],{'$or':_[_0xa2f8('0x43')](_0x47d512,function(_0x58fa1f){if(_0x58fa1f[_0xa2f8('0x37')]!==_0xa2f8('0x53')){var _0x5cdbc2={};_0x5cdbc2[_0x58fa1f[_0xa2f8('0x39')]]={'$like':'%'+_0x320918[_0xa2f8('0x44')][_0xa2f8('0x33')]+'%'};return _0x5cdbc2;}})});}_0x4b0ff6=_[_0xa2f8('0x52')]({},_0x4b0ff6,_0x320918[_0xa2f8('0x54')]);var _0x3d51bd={'where':_0x4b0ff6[_0xa2f8('0x50')]};return db[_0xa2f8('0x40')][_0xa2f8('0x24')](_0x3d51bd)[_0xa2f8('0x3b')](function(_0x37e352){_0x309234['count']=_0x37e352;if(_0x320918[_0xa2f8('0x44')][_0xa2f8('0x55')]){_0x4b0ff6[_0xa2f8('0x56')]=[{'all':!![]}];}return db[_0xa2f8('0x40')][_0xa2f8('0x57')](_0x4b0ff6);})[_0xa2f8('0x3b')](function(_0x522be7){_0x309234['rows']=_0x522be7;return _0x309234;})['then'](respondWithFilteredResult(_0x1eb86f,_0x4b0ff6))['catch'](handleError(_0x1eb86f,null));};exports['show']=function(_0x38b0e8,_0x385811){var _0x477b75={'raw':![],'where':{'id':_0x38b0e8[_0xa2f8('0x58')]['id']}},_0x4a6411={};_0x4a6411[_0xa2f8('0x47')]=_['keys'](db[_0xa2f8('0x40')][_0xa2f8('0x41')]);_0x4a6411['query']=_['keys'](_0x38b0e8[_0xa2f8('0x44')]);_0x4a6411[_0xa2f8('0x46')]=_[_0xa2f8('0x49')](_0x4a6411[_0xa2f8('0x47')],_0x4a6411[_0xa2f8('0x44')]);_0x477b75['attributes']=_[_0xa2f8('0x49')](_0x4a6411[_0xa2f8('0x47')],qs[_0xa2f8('0x4a')](_0x38b0e8[_0xa2f8('0x44')][_0xa2f8('0x4a')]));_0x477b75[_0xa2f8('0x48')]=_0x477b75[_0xa2f8('0x48')][_0xa2f8('0x4b')]?_0x477b75[_0xa2f8('0x48')]:_0x4a6411[_0xa2f8('0x47')];if(_0x38b0e8[_0xa2f8('0x44')][_0xa2f8('0x55')]){_0x477b75[_0xa2f8('0x56')]=[{'all':!![]}];}_0x477b75=_['merge']({},_0x477b75,_0x38b0e8[_0xa2f8('0x54')]);return db[_0xa2f8('0x40')]['find'](_0x477b75)['then'](handleEntityNotFound(_0x385811,null))[_0xa2f8('0x3b')](respondWithResult(_0x385811,null))['catch'](handleError(_0x385811,null));};exports[_0xa2f8('0x2c')]=function(_0x4807e8,_0x5d7821){return db[_0xa2f8('0x40')][_0xa2f8('0x38')]({'where':{'id':_0x4807e8[_0xa2f8('0x58')]['id']}})['then'](handleEntityNotFound(_0x5d7821,null))[_0xa2f8('0x3b')](removeEntity(_0x5d7821,null))['catch'](handleError(_0x5d7821,null));};exports['create']=function(_0x1e74c6,_0xe3c1b7){if(_0x1e74c6[_0xa2f8('0x59')][_0xa2f8('0x37')]===_0xa2f8('0x30')&&!_['startsWith'](_0x1e74c6['body'][_0xa2f8('0x5a')],'_')){_0x1e74c6[_0xa2f8('0x59')]['exten']='_'[_0xa2f8('0x5b')](_0x1e74c6[_0xa2f8('0x59')]['exten']);}return db[_0xa2f8('0x40')]['create'](_0x1e74c6['body'],{'raw':![]})[_0xa2f8('0x3b')](function(_0x542d1c){var _0x1c8d8c=_0x1e74c6[_0xa2f8('0x5c')][_0xa2f8('0x2d')]({'plain':!![]});if(!_0x1c8d8c)throw new Error(_0xa2f8('0x5d'));if(_0x1c8d8c[_0xa2f8('0x5e')]===_0xa2f8('0x5c')){var _0x35e6da=_0x542d1c[_0xa2f8('0x2d')]({'plain':!![]});var _0x1aec21=[{'name':_0xa2f8('0x2e'),'value':_0xa2f8('0x5f')},{'name':_0xa2f8('0x2f'),'value':_0xa2f8('0x30')},{'name':_0xa2f8('0x31'),'value':_0xa2f8('0x32')}];var _0x5775ec=_[_0xa2f8('0x38')](_0x1aec21,[_0xa2f8('0x35'),_0x35e6da[_0xa2f8('0x37')]])['name'];return db['UserProfileSection'][_0xa2f8('0x38')]({'where':{'name':_0x5775ec,'userProfileId':_0x1c8d8c[_0xa2f8('0x60')]},'raw':!![]})[_0xa2f8('0x3b')](function(_0x59070a){if(_0x59070a&&_0x59070a[_0xa2f8('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x35e6da[_0xa2f8('0x39')],'resourceId':_0x35e6da['id'],'type':_0x59070a[_0xa2f8('0x39')],'sectionId':_0x59070a['id']},{})['then'](function(){return _0x542d1c;});}else{return _0x542d1c;}})[_0xa2f8('0x62')](function(_0x4d227b){logger[_0xa2f8('0x63')](_0xa2f8('0x64'),_0x4d227b);throw _0x4d227b;});}return _0x542d1c;})['then'](respondWithResult(_0xe3c1b7,0xc9))[_0xa2f8('0x62')](handleError(_0xe3c1b7,null));};exports[_0xa2f8('0x65')]=function(_0x102d2c,_0x1ddda9){if(_0x102d2c[_0xa2f8('0x59')]['id']){delete _0x102d2c[_0xa2f8('0x59')]['id'];}return db[_0xa2f8('0x40')][_0xa2f8('0x38')]({'where':{'id':_0x102d2c[_0xa2f8('0x58')]['id']}})[_0xa2f8('0x3b')](handleEntityNotFound(_0x1ddda9,null))[_0xa2f8('0x3b')](function(_0x4534ef){if(_0x4534ef){return db[_0xa2f8('0x40')][_0xa2f8('0x65')](_[_0xa2f8('0x51')](_0x102d2c[_0xa2f8('0x59')],[_0xa2f8('0x5a'),'context','description',_0xa2f8('0x66'),_0xa2f8('0x67'),_0xa2f8('0x68')]),{'where':{'context':_0x4534ef[_0xa2f8('0x69')],'exten':_0x4534ef[_0xa2f8('0x5a')]},'individualHooks':!![]})[_0xa2f8('0x3b')](function(_0x31468a){return _0x31468a;});}return null;})[_0xa2f8('0x3b')](respondWithStatusCode(_0x1ddda9,null))[_0xa2f8('0x62')](handleError(_0x1ddda9,null));};exports[_0xa2f8('0x6a')]=function(_0xdc4663,_0x14db89,_0x2f9de1){return db[_0xa2f8('0x40')]['findOne']({'where':{'id':_0xdc4663[_0xa2f8('0x58')]['id']}})[_0xa2f8('0x3b')](handleEntityNotFound(_0x14db89,null))[_0xa2f8('0x3b')](function(_0x2bb52e){if(_0x2bb52e){return db['sequelize'][_0xa2f8('0x6b')](function(_0xf771b8){return db[_0xa2f8('0x40')][_0xa2f8('0x2c')]({'where':{'VoiceExtensionId':_0xdc4663[_0xa2f8('0x58')]['id']},'transaction':_0xf771b8})[_0xa2f8('0x3b')](function(_0x421b78){var _0x53c805=_[_0xa2f8('0x43')](_0xdc4663['body'],function(_0x356cc2){_0x356cc2[_0xa2f8('0x6c')]=_0xdc4663[_0xa2f8('0x58')]['id'];return _0x356cc2;});return db[_0xa2f8('0x40')][_0xa2f8('0x6d')](_0x53c805,{'transaction':_0xf771b8});});})[_0xa2f8('0x3b')](function(){return db[_0xa2f8('0x40')][_0xa2f8('0x6e')]({'where':{'isApp':!![],'VoiceExtensionId':_0xdc4663[_0xa2f8('0x58')]['id']},'order':_0xa2f8('0x6f')});});}})[_0xa2f8('0x3b')](respondWithResult(_0x14db89,null))[_0xa2f8('0x62')](handleError(_0x14db89,null));}; \ No newline at end of file +var _0xff29=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','where','pick','VIRTUAL','options','includeAll','include','findAll','rows','show','catch','params','create','body','startsWith','exten','concat','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','recordingFormat','mandatoryDisposition','context','addApplications','sequelize','transaction','VoiceExtensionId','bulkCreate','findAndCountAll','cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','json','count','offset','limit','then','destroy','InboundRoutes','inbound','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','name','UserProfileResource','end','send','index','VoiceExtension','rawAttributes','fieldName','key','model','query'];(function(_0x3397c0,_0xd3a82e){var _0x399945=function(_0x5a2c66){while(--_0x5a2c66){_0x3397c0['push'](_0x3397c0['shift']());}};_0x399945(++_0xd3a82e);}(_0xff29,0x1d5));var _0x9ff2=function(_0x1a539b,_0x41a30e){_0x1a539b=_0x1a539b-0x0;var _0x4951a5=_0xff29[_0x1a539b];return _0x4951a5;};'use strict';var pdf=require(_0x9ff2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9ff2('0x1'));var zipdir=require(_0x9ff2('0x2'));var jsonpatch=require(_0x9ff2('0x3'));var rp=require(_0x9ff2('0x4'));var moment=require(_0x9ff2('0x5'));var BPromise=require(_0x9ff2('0x6'));var Mustache=require(_0x9ff2('0x7'));var util=require(_0x9ff2('0x8'));var path=require(_0x9ff2('0x9'));var sox=require(_0x9ff2('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9ff2('0xb'));var squel=require(_0x9ff2('0xc'));var crypto=require('crypto');var jsforce=require(_0x9ff2('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x9ff2('0xe'));var Redis=require(_0x9ff2('0xf'));var authService=require(_0x9ff2('0x10'));var qs=require(_0x9ff2('0x11'));var as=require(_0x9ff2('0x12'));var hardwareService=require(_0x9ff2('0x13'));var logger=require(_0x9ff2('0x14'))(_0x9ff2('0x15'));var utils=require(_0x9ff2('0x16'));var config=require('../../config/environment');var db=require(_0x9ff2('0x17'))['db'];config[_0x9ff2('0x18')]=_[_0x9ff2('0x19')](config[_0x9ff2('0x18')],{'host':_0x9ff2('0x1a'),'port':0x18eb});var socket=require(_0x9ff2('0x1b'))(new Redis(config[_0x9ff2('0x18')]));require(_0x9ff2('0x1c'))['register'](socket);function respondWithStatusCode(_0xf6debc,_0x9034db){_0x9034db=_0x9034db||0xcc;return function(_0x4f7e13){if(_0x4f7e13){return _0xf6debc[_0x9ff2('0x1d')](_0x9034db);}return _0xf6debc['status'](_0x9034db)['end']();};}function respondWithResult(_0x1a5275,_0xffcfab){_0xffcfab=_0xffcfab||0xc8;return function(_0x186134){if(_0x186134){return _0x1a5275[_0x9ff2('0x1e')](_0xffcfab)[_0x9ff2('0x1f')](_0x186134);}};}function respondWithFilteredResult(_0x20ded3,_0x4f1146){return function(_0x4040c1){if(_0x4040c1){var _0x4c27a6=_0x4040c1[_0x9ff2('0x20')],_0x2ef954=_0x4f1146[_0x9ff2('0x21')],_0x489f85=_0x4f1146[_0x9ff2('0x21')]+_0x4f1146[_0x9ff2('0x22')],_0x1177e1;if(_0x489f85>=_0x4c27a6){_0x489f85=_0x4c27a6;_0x1177e1=0xc8;}else{_0x1177e1=0xce;}_0x20ded3[_0x9ff2('0x1e')](_0x1177e1);return _0x20ded3['set']('Content-Range',_0x2ef954+'-'+_0x489f85+'/'+_0x4c27a6)['json'](_0x4040c1);}return null;};}function patchUpdates(_0x207b71){return function(_0x51965c){try{jsonpatch['apply'](_0x51965c,_0x207b71,!![]);}catch(_0x50f238){return BPromise['reject'](_0x50f238);}return _0x51965c['save']();};}function saveUpdates(_0x42b959,_0x395baa){return function(_0x355340){if(_0x355340){return _0x355340['update'](_0x42b959)[_0x9ff2('0x23')](function(_0x3e154d){return _0x3e154d;});}return null;};}function removeEntity(_0xdb0bb,_0x3b9b34){return function(_0x398b80){if(_0x398b80){return _0x398b80[_0x9ff2('0x24')]()[_0x9ff2('0x23')](function(){var _0x14dcc5=_0x398b80['get']({'plain':!![]});var _0x49e0f2=[{'name':_0x9ff2('0x25'),'value':_0x9ff2('0x26'),'ignore':![]},{'name':_0x9ff2('0x27'),'value':_0x9ff2('0x28'),'ignore':![]},{'name':_0x9ff2('0x29'),'value':_0x9ff2('0x2a'),'ignore':![]}];var _0x1f6f47=_(_0x49e0f2)[_0x9ff2('0x2b')](_0x9ff2('0x2c'))[_0x9ff2('0x2d')](_0x9ff2('0x2e'))[_0x9ff2('0x2e')]();if(_[_0x9ff2('0x2f')](_0x1f6f47,_0x14dcc5[_0x9ff2('0x30')])){return;}var _0x197e6b=_[_0x9ff2('0x31')](_0x49e0f2,['value',_0x14dcc5[_0x9ff2('0x30')]])[_0x9ff2('0x32')];return db[_0x9ff2('0x33')][_0x9ff2('0x24')]({'where':{'type':_0x197e6b,'resourceId':_0x14dcc5['id']}})[_0x9ff2('0x23')](function(){return _0x398b80;});})['then'](function(){_0xdb0bb['status'](0xcc)[_0x9ff2('0x34')]();});}};}function handleEntityNotFound(_0x1c47f0,_0x49ba5b){return function(_0x17e71a){if(!_0x17e71a){_0x1c47f0['sendStatus'](0x194);}return _0x17e71a;};}function handleError(_0x1c698e,_0x175415){_0x175415=_0x175415||0x1f4;return function(_0xbbef50){logger['error'](_0xbbef50['stack']);if(_0xbbef50[_0x9ff2('0x32')]){delete _0xbbef50[_0x9ff2('0x32')];}_0x1c698e[_0x9ff2('0x1e')](_0x175415)[_0x9ff2('0x35')](_0xbbef50);};}exports[_0x9ff2('0x36')]=function(_0x196ac2,_0x5a7024){var _0x184b8d={},_0xfd1dab={},_0xae2ea7={'count':0x0,'rows':[]};var _0x350cff=_[_0x9ff2('0x2d')](db[_0x9ff2('0x37')][_0x9ff2('0x38')],function(_0xfb1ab){return{'name':_0xfb1ab[_0x9ff2('0x39')],'type':_0xfb1ab[_0x9ff2('0x30')][_0x9ff2('0x3a')]};});_0xfd1dab[_0x9ff2('0x3b')]=_[_0x9ff2('0x2d')](_0x350cff,_0x9ff2('0x32'));_0xfd1dab[_0x9ff2('0x3c')]=_[_0x9ff2('0x3d')](_0x196ac2['query']);_0xfd1dab[_0x9ff2('0x3e')]=_[_0x9ff2('0x3f')](_0xfd1dab[_0x9ff2('0x3b')],_0xfd1dab[_0x9ff2('0x3c')]);_0x184b8d[_0x9ff2('0x40')]=_[_0x9ff2('0x3f')](_0xfd1dab[_0x9ff2('0x3b')],qs[_0x9ff2('0x41')](_0x196ac2[_0x9ff2('0x3c')]['fields']));_0x184b8d[_0x9ff2('0x40')]=_0x184b8d[_0x9ff2('0x40')][_0x9ff2('0x42')]?_0x184b8d[_0x9ff2('0x40')]:_0xfd1dab[_0x9ff2('0x3b')];if(!_0x196ac2['query'][_0x9ff2('0x43')](_0x9ff2('0x44'))){_0x184b8d[_0x9ff2('0x22')]=qs[_0x9ff2('0x22')](_0x196ac2[_0x9ff2('0x3c')][_0x9ff2('0x22')]);_0x184b8d[_0x9ff2('0x21')]=qs[_0x9ff2('0x21')](_0x196ac2[_0x9ff2('0x3c')][_0x9ff2('0x21')]);}_0x184b8d[_0x9ff2('0x45')]=qs['sort'](_0x196ac2['query']['sort']);_0x184b8d[_0x9ff2('0x46')]=qs['filters'](_[_0x9ff2('0x47')](_0x196ac2['query'],_0xfd1dab[_0x9ff2('0x3e')]));if(_0x196ac2['query'][_0x9ff2('0x2b')]){_0x184b8d[_0x9ff2('0x46')]=_['merge'](_0x184b8d[_0x9ff2('0x46')],{'$or':_[_0x9ff2('0x2d')](_0x350cff,function(_0x3b9bd0){if(_0x3b9bd0[_0x9ff2('0x30')]!==_0x9ff2('0x48')){var _0x426b0a={};_0x426b0a[_0x3b9bd0[_0x9ff2('0x32')]]={'$like':'%'+_0x196ac2['query'][_0x9ff2('0x2b')]+'%'};return _0x426b0a;}})});}_0x184b8d=_['merge']({},_0x184b8d,_0x196ac2[_0x9ff2('0x49')]);var _0x3d9be6={'where':_0x184b8d[_0x9ff2('0x46')]};return db[_0x9ff2('0x37')][_0x9ff2('0x20')](_0x3d9be6)[_0x9ff2('0x23')](function(_0x308eb6){_0xae2ea7[_0x9ff2('0x20')]=_0x308eb6;if(_0x196ac2['query'][_0x9ff2('0x4a')]){_0x184b8d[_0x9ff2('0x4b')]=[{'all':!![]}];}return db[_0x9ff2('0x37')][_0x9ff2('0x4c')](_0x184b8d);})['then'](function(_0x390d34){_0xae2ea7[_0x9ff2('0x4d')]=_0x390d34;return _0xae2ea7;})['then'](respondWithFilteredResult(_0x5a7024,_0x184b8d))['catch'](handleError(_0x5a7024,null));};exports[_0x9ff2('0x4e')]=function(_0x5aa599,_0x40328d){var _0x2f935d={'raw':![],'where':{'id':_0x5aa599['params']['id']}},_0x5bb354={};_0x5bb354[_0x9ff2('0x3b')]=_[_0x9ff2('0x3d')](db[_0x9ff2('0x37')][_0x9ff2('0x38')]);_0x5bb354[_0x9ff2('0x3c')]=_[_0x9ff2('0x3d')](_0x5aa599[_0x9ff2('0x3c')]);_0x5bb354[_0x9ff2('0x3e')]=_[_0x9ff2('0x3f')](_0x5bb354[_0x9ff2('0x3b')],_0x5bb354[_0x9ff2('0x3c')]);_0x2f935d[_0x9ff2('0x40')]=_['intersection'](_0x5bb354['model'],qs[_0x9ff2('0x41')](_0x5aa599[_0x9ff2('0x3c')]['fields']));_0x2f935d[_0x9ff2('0x40')]=_0x2f935d['attributes'][_0x9ff2('0x42')]?_0x2f935d[_0x9ff2('0x40')]:_0x5bb354[_0x9ff2('0x3b')];if(_0x5aa599['query'][_0x9ff2('0x4a')]){_0x2f935d['include']=[{'all':!![]}];}_0x2f935d=_['merge']({},_0x2f935d,_0x5aa599['options']);return db[_0x9ff2('0x37')][_0x9ff2('0x31')](_0x2f935d)['then'](handleEntityNotFound(_0x40328d,null))[_0x9ff2('0x23')](respondWithResult(_0x40328d,null))[_0x9ff2('0x4f')](handleError(_0x40328d,null));};exports[_0x9ff2('0x24')]=function(_0x4154c3,_0x5a1a82){return db['VoiceExtension'][_0x9ff2('0x31')]({'where':{'id':_0x4154c3[_0x9ff2('0x50')]['id']}})[_0x9ff2('0x23')](handleEntityNotFound(_0x5a1a82,null))['then'](removeEntity(_0x5a1a82,null))['catch'](handleError(_0x5a1a82,null));};exports[_0x9ff2('0x51')]=function(_0x51653c,_0x36e355){if(_0x51653c[_0x9ff2('0x52')][_0x9ff2('0x30')]==='outbound'&&!_[_0x9ff2('0x53')](_0x51653c[_0x9ff2('0x52')][_0x9ff2('0x54')],'_')){_0x51653c[_0x9ff2('0x52')]['exten']='_'[_0x9ff2('0x55')](_0x51653c[_0x9ff2('0x52')][_0x9ff2('0x54')]);}return db[_0x9ff2('0x37')][_0x9ff2('0x51')](_0x51653c[_0x9ff2('0x52')],{'raw':![]})[_0x9ff2('0x23')](function(_0x596cbe){var _0x1e4c6f=_0x51653c['user'][_0x9ff2('0x56')]({'plain':!![]});if(!_0x1e4c6f)throw new Error(_0x9ff2('0x57'));if(_0x1e4c6f[_0x9ff2('0x58')]===_0x9ff2('0x59')){var _0x54b200=_0x596cbe[_0x9ff2('0x56')]({'plain':!![]});var _0x271efc=[{'name':_0x9ff2('0x25'),'value':_0x9ff2('0x26')},{'name':_0x9ff2('0x27'),'value':_0x9ff2('0x28')},{'name':_0x9ff2('0x29'),'value':_0x9ff2('0x2a')}];var _0x1954ef=_[_0x9ff2('0x31')](_0x271efc,[_0x9ff2('0x2e'),_0x54b200[_0x9ff2('0x30')]])['name'];return db[_0x9ff2('0x5a')]['find']({'where':{'name':_0x1954ef,'userProfileId':_0x1e4c6f[_0x9ff2('0x5b')]},'raw':!![]})[_0x9ff2('0x23')](function(_0x525863){if(_0x525863&&_0x525863[_0x9ff2('0x5c')]===0x0){return db[_0x9ff2('0x33')][_0x9ff2('0x51')]({'name':_0x54b200[_0x9ff2('0x32')],'resourceId':_0x54b200['id'],'type':_0x525863['name'],'sectionId':_0x525863['id']},{})[_0x9ff2('0x23')](function(){return _0x596cbe;});}else{return _0x596cbe;}})[_0x9ff2('0x4f')](function(_0x316565){logger[_0x9ff2('0x5d')](_0x9ff2('0x5e'),_0x316565);throw _0x316565;});}return _0x596cbe;})[_0x9ff2('0x23')](respondWithResult(_0x36e355,0xc9))[_0x9ff2('0x4f')](handleError(_0x36e355,null));};exports[_0x9ff2('0x5f')]=function(_0x450603,_0x2b73ef){if(_0x450603[_0x9ff2('0x52')]['id']){delete _0x450603[_0x9ff2('0x52')]['id'];}return db[_0x9ff2('0x37')]['find']({'where':{'id':_0x450603['params']['id']}})['then'](handleEntityNotFound(_0x2b73ef,null))[_0x9ff2('0x23')](function(_0x6a1202){if(_0x6a1202){return db['VoiceExtension'][_0x9ff2('0x5f')](_[_0x9ff2('0x47')](_0x450603[_0x9ff2('0x52')],['exten','context','description',_0x9ff2('0x60'),'cutdigits',_0x9ff2('0x61')]),{'where':{'context':_0x6a1202[_0x9ff2('0x62')],'exten':_0x6a1202[_0x9ff2('0x54')]},'individualHooks':!![]})[_0x9ff2('0x23')](function(_0x176a59){return _0x176a59;});}return null;})[_0x9ff2('0x23')](respondWithStatusCode(_0x2b73ef,null))[_0x9ff2('0x4f')](handleError(_0x2b73ef,null));};exports[_0x9ff2('0x63')]=function(_0x5b091e,_0x373cd7,_0x2b127b){return db[_0x9ff2('0x37')]['findOne']({'where':{'id':_0x5b091e['params']['id']}})[_0x9ff2('0x23')](handleEntityNotFound(_0x373cd7,null))[_0x9ff2('0x23')](function(_0x2426d5){if(_0x2426d5){return db[_0x9ff2('0x64')][_0x9ff2('0x65')](function(_0x54a79c){return db[_0x9ff2('0x37')]['destroy']({'where':{'VoiceExtensionId':_0x5b091e[_0x9ff2('0x50')]['id']},'transaction':_0x54a79c})[_0x9ff2('0x23')](function(_0x460121){var _0x21d51c=_[_0x9ff2('0x2d')](_0x5b091e[_0x9ff2('0x52')],function(_0x3dbd9a){_0x3dbd9a[_0x9ff2('0x66')]=_0x5b091e['params']['id'];return _0x3dbd9a;});return db[_0x9ff2('0x37')][_0x9ff2('0x67')](_0x21d51c,{'transaction':_0x54a79c});});})[_0x9ff2('0x23')](function(){return db[_0x9ff2('0x37')][_0x9ff2('0x68')]({'where':{'isApp':!![],'VoiceExtensionId':_0x5b091e[_0x9ff2('0x50')]['id']},'order':_0x9ff2('0x69')});});}})[_0x9ff2('0x23')](respondWithResult(_0x373cd7,null))[_0x9ff2('0x4f')](handleError(_0x373cd7,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index d55a470..5c5c36a 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 _0xa7b5=['emit','hasOwnProperty','hook','exports','events','VoiceExtension','save','update','remove'];(function(_0x4b727e,_0x323309){var _0x308b6b=function(_0x1627c8){while(--_0x1627c8){_0x4b727e['push'](_0x4b727e['shift']());}};_0x308b6b(++_0x323309);}(_0xa7b5,0x15a));var _0x5a7b=function(_0x3d5c36,_0x38743a){_0x3d5c36=_0x3d5c36-0x0;var _0xedd009=_0xa7b5[_0x3d5c36];return _0xedd009;};'use strict';var EventEmitter=require(_0x5a7b('0x0'));var VoiceExtension=require('../../mysqldb')['db'][_0x5a7b('0x1')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5a7b('0x2'),'afterUpdate':_0x5a7b('0x3'),'afterDestroy':_0x5a7b('0x4')};function emitEvent(_0xe72b80){return function(_0x355dd2,_0x25f55b,_0x1152f4){VoiceExtensionEvents[_0x5a7b('0x5')](_0xe72b80+':'+_0x355dd2['id'],_0x355dd2);VoiceExtensionEvents[_0x5a7b('0x5')](_0xe72b80,_0x355dd2);_0x1152f4(null);};}for(var e in events){if(events[_0x5a7b('0x6')](e)){var event=events[e];VoiceExtension[_0x5a7b('0x7')](e,emitEvent(event));}}module[_0x5a7b('0x8')]=VoiceExtensionEvents; \ No newline at end of file +var _0x367b=['setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceExtension'];(function(_0x44ca7a,_0x5511b4){var _0x596acb=function(_0x3af520){while(--_0x3af520){_0x44ca7a['push'](_0x44ca7a['shift']());}};_0x596acb(++_0x5511b4);}(_0x367b,0xad));var _0xb367=function(_0x46f6f3,_0x3a173d){_0x46f6f3=_0x46f6f3-0x0;var _0x4f52ce=_0x367b[_0x46f6f3];return _0x4f52ce;};'use strict';var EventEmitter=require(_0xb367('0x0'));var VoiceExtension=require(_0xb367('0x1'))['db'][_0xb367('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0xb367('0x3')](0x0);var events={'afterCreate':_0xb367('0x4'),'afterUpdate':_0xb367('0x5'),'afterDestroy':_0xb367('0x6')};function emitEvent(_0x4d7a69){return function(_0x4d055a,_0x52a909,_0x29b757){VoiceExtensionEvents[_0xb367('0x7')](_0x4d7a69+':'+_0x4d055a['id'],_0x4d055a);VoiceExtensionEvents['emit'](_0x4d7a69,_0x4d055a);_0x29b757(null);};}for(var e in events){if(events[_0xb367('0x8')](e)){var event=events[e];VoiceExtension[_0xb367('0x9')](e,emitEvent(event));}}module[_0xb367('0xa')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index 73c597d..b9853c6 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 _0x3860=['../../config/logger','api','moment','request-promise','path','../../config/environment','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','util'];(function(_0x84a85,_0x54e55c){var _0x1c2943=function(_0x99a250){while(--_0x99a250){_0x84a85['push'](_0x84a85['shift']());}};_0x1c2943(++_0x54e55c);}(_0x3860,0xfa));var _0x0386=function(_0x2a581f,_0x5d894d){_0x2a581f=_0x2a581f-0x0;var _0x14c4b4=_0x3860[_0x2a581f];return _0x14c4b4;};'use strict';var _=require(_0x0386('0x0'));var util=require(_0x0386('0x1'));var logger=require(_0x0386('0x2'))(_0x0386('0x3'));var moment=require(_0x0386('0x4'));var BPromise=require('bluebird');var rp=require(_0x0386('0x5'));var fs=require('fs');var path=require(_0x0386('0x6'));var rimraf=require('rimraf');var config=require(_0x0386('0x7'));var attributes=require(_0x0386('0x8'));module[_0x0386('0x9')]=function(_0x5bee83,_0x157b6f){return _0x5bee83[_0x0386('0xa')](_0x0386('0xb'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9716=['bluebird','path','./voiceExtension.attributes','exports','define','VoiceExtension','lodash','../../config/logger','api'];(function(_0x3d4876,_0x366386){var _0x58ca9d=function(_0x5bd045){while(--_0x5bd045){_0x3d4876['push'](_0x3d4876['shift']());}};_0x58ca9d(++_0x366386);}(_0x9716,0x102));var _0x6971=function(_0x532de3,_0x28e887){_0x532de3=_0x532de3-0x0;var _0x8991d3=_0x9716[_0x532de3];return _0x8991d3;};'use strict';var _=require(_0x6971('0x0'));var util=require('util');var logger=require(_0x6971('0x1'))(_0x6971('0x2'));var moment=require('moment');var BPromise=require(_0x6971('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6971('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x6971('0x5'));module[_0x6971('0x6')]=function(_0x3650e7,_0x5077ca){return _0x3650e7[_0x6971('0x7')](_0x6971('0x8'),attributes,{'tableName':'voice_extensions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index b31bb18..a2727bb 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 _0x1de9=['../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./voiceExtension.socket','register','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','code','error','message','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','where','attributes','limit','include','map','model','then','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x1419f6,_0x4180de){var _0x5b07c7=function(_0x5dd304){while(--_0x5dd304){_0x1419f6['push'](_0x1419f6['shift']());}};_0x5b07c7(++_0x4180de);}(_0x1de9,0x1a5));var _0x91de=function(_0x3faf51,_0x4535f3){_0x3faf51=_0x3faf51-0x0;var _0x4685b7=_0x1de9[_0x3faf51];return _0x4685b7;};'use strict';var _=require(_0x91de('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x91de('0x1'));var rs=require(_0x91de('0x2'));var fs=require('fs');var Redis=require(_0x91de('0x3'));var db=require(_0x91de('0x4'))['db'];var utils=require(_0x91de('0x5'));var logger=require(_0x91de('0x6'))(_0x91de('0x7'));var config=require(_0x91de('0x8'));var jayson=require(_0x91de('0x9'));var client=jayson[_0x91de('0xa')][_0x91de('0xb')]({'port':0x232a});config[_0x91de('0xc')]=_[_0x91de('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x91de('0xe'))(new Redis(config[_0x91de('0xc')]));require(_0x91de('0xf'))[_0x91de('0x10')](socket);function respondWithRpcPromise(_0x57433a,_0x21a275,_0x6e16ea){return new BPromise(function(_0x480962,_0xb03d85){return client['request'](_0x57433a,_0x6e16ea)['then'](function(_0xa93288){logger[_0x91de('0x11')](_0x91de('0x12'),_0x21a275,_0x91de('0x13'));logger[_0x91de('0x14')](_0x91de('0x15'),_0x21a275,_0x91de('0x13'),JSON[_0x91de('0x16')](_0xa93288));if(_0xa93288['error']){if(_0xa93288['error'][_0x91de('0x17')]===0x1f4){logger[_0x91de('0x18')](_0x91de('0x12'),_0x21a275,_0xa93288[_0x91de('0x18')]['message']);return _0xb03d85(_0xa93288[_0x91de('0x18')][_0x91de('0x19')]);}logger[_0x91de('0x18')]('VoiceExtension,\x20%s,\x20%s',_0x21a275,_0xa93288['error'][_0x91de('0x19')]);return _0x480962(_0xa93288['error']['message']);}else{logger[_0x91de('0x11')](_0x91de('0x12'),_0x21a275,_0x91de('0x13'));_0x480962(_0xa93288['result']['message']);}})[_0x91de('0x1a')](function(_0x412524){logger[_0x91de('0x18')](_0x91de('0x12'),_0x21a275,_0x412524);_0xb03d85(_0x412524);});});}exports[_0x91de('0x1b')]=function(_0x7f7d0d){var _0x5d02a4=this;return new Promise(function(_0x2e3144,_0x2bad26){return db[_0x91de('0x1c')][_0x91de('0x1d')]({'raw':_0x7f7d0d['options']?_0x7f7d0d[_0x91de('0x1e')][_0x91de('0x1f')]===undefined?!![]:![]:!![],'where':_0x7f7d0d[_0x91de('0x1e')]?_0x7f7d0d[_0x91de('0x1e')][_0x91de('0x20')]||null:null,'attributes':_0x7f7d0d[_0x91de('0x1e')]?_0x7f7d0d[_0x91de('0x1e')][_0x91de('0x21')]||null:null,'limit':_0x7f7d0d[_0x91de('0x1e')]?_0x7f7d0d['options'][_0x91de('0x22')]||null:null,'include':_0x7f7d0d[_0x91de('0x1e')]?_0x7f7d0d[_0x91de('0x1e')][_0x91de('0x23')]?_[_0x91de('0x24')](_0x7f7d0d[_0x91de('0x1e')][_0x91de('0x23')],function(_0x203233){return{'model':db[_0x203233[_0x91de('0x25')]],'as':_0x203233['as'],'attributes':_0x203233['attributes'],'include':_0x203233[_0x91de('0x23')]?_[_0x91de('0x24')](_0x203233[_0x91de('0x23')],function(_0x16a04c){return{'model':db[_0x16a04c[_0x91de('0x25')]],'as':_0x16a04c['as'],'attributes':_0x16a04c[_0x91de('0x21')],'include':_0x16a04c[_0x91de('0x23')]?_[_0x91de('0x24')](_0x16a04c['include'],function(_0x56dc72){return{'model':db[_0x56dc72[_0x91de('0x25')]],'as':_0x56dc72['as'],'attributes':_0x56dc72[_0x91de('0x21')]};}):[]};}):[]};}):[]:[]})[_0x91de('0x26')](function(_0x167fc6){logger['info'](_0x91de('0x1b'),_0x7f7d0d);logger[_0x91de('0x14')]('GetVoiceExtension',_0x7f7d0d,JSON[_0x91de('0x16')](_0x167fc6));_0x2e3144(_0x167fc6);})['catch'](function(_0x2fbb4b){logger['error'](_0x91de('0x1b'),_0x2fbb4b[_0x91de('0x19')],_0x7f7d0d);_0x2bad26(_0x5d02a4[_0x91de('0x18')](0x1f4,_0x2fbb4b[_0x91de('0x19')]));});});}; \ No newline at end of file +var _0xcc8a=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','register','request','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetVoiceExtension','VoiceExtension','findAll','options','raw','attributes','limit','include','map','model','lodash','util','moment'];(function(_0x1573ea,_0x434f02){var _0x51c0e2=function(_0x5c9b28){while(--_0x5c9b28){_0x1573ea['push'](_0x1573ea['shift']());}};_0x51c0e2(++_0x434f02);}(_0xcc8a,0x1aa));var _0xacc8=function(_0x32d8a8,_0x710c01){_0x32d8a8=_0x32d8a8-0x0;var _0x193714=_0xcc8a[_0x32d8a8];return _0x193714;};'use strict';var _=require(_0xacc8('0x0'));var util=require(_0xacc8('0x1'));var moment=require(_0xacc8('0x2'));var BPromise=require(_0xacc8('0x3'));var rs=require(_0xacc8('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xacc8('0x5'))['db'];var utils=require(_0xacc8('0x6'));var logger=require(_0xacc8('0x7'))(_0xacc8('0x8'));var config=require(_0xacc8('0x9'));var jayson=require(_0xacc8('0xa'));var client=jayson[_0xacc8('0xb')][_0xacc8('0xc')]({'port':0x232a});config['redis']=_[_0xacc8('0xd')](config[_0xacc8('0xe')],{'host':_0xacc8('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacc8('0xe')]));require('./voiceExtension.socket')[_0xacc8('0x10')](socket);function respondWithRpcPromise(_0x515240,_0x1233c3,_0x429f59){return new BPromise(function(_0x210b21,_0x4736d1){return client[_0xacc8('0x11')](_0x515240,_0x429f59)[_0xacc8('0x12')](function(_0x47ce04){logger[_0xacc8('0x13')](_0xacc8('0x14'),_0x1233c3,_0xacc8('0x15'));logger[_0xacc8('0x16')](_0xacc8('0x17'),_0x1233c3,_0xacc8('0x15'),JSON[_0xacc8('0x18')](_0x47ce04));if(_0x47ce04[_0xacc8('0x19')]){if(_0x47ce04[_0xacc8('0x19')]['code']===0x1f4){logger[_0xacc8('0x19')](_0xacc8('0x14'),_0x1233c3,_0x47ce04[_0xacc8('0x19')][_0xacc8('0x1a')]);return _0x4736d1(_0x47ce04[_0xacc8('0x19')]['message']);}logger[_0xacc8('0x19')](_0xacc8('0x14'),_0x1233c3,_0x47ce04['error'][_0xacc8('0x1a')]);return _0x210b21(_0x47ce04[_0xacc8('0x19')][_0xacc8('0x1a')]);}else{logger[_0xacc8('0x13')]('VoiceExtension,\x20%s,\x20%s',_0x1233c3,_0xacc8('0x15'));_0x210b21(_0x47ce04[_0xacc8('0x1b')][_0xacc8('0x1a')]);}})[_0xacc8('0x1c')](function(_0x4081a2){logger[_0xacc8('0x19')](_0xacc8('0x14'),_0x1233c3,_0x4081a2);_0x4736d1(_0x4081a2);});});}exports[_0xacc8('0x1d')]=function(_0x50bbc1){var _0x31f38b=this;return new Promise(function(_0x3c52f4,_0x6333ee){return db[_0xacc8('0x1e')][_0xacc8('0x1f')]({'raw':_0x50bbc1[_0xacc8('0x20')]?_0x50bbc1[_0xacc8('0x20')][_0xacc8('0x21')]===undefined?!![]:![]:!![],'where':_0x50bbc1[_0xacc8('0x20')]?_0x50bbc1[_0xacc8('0x20')]['where']||null:null,'attributes':_0x50bbc1[_0xacc8('0x20')]?_0x50bbc1[_0xacc8('0x20')][_0xacc8('0x22')]||null:null,'limit':_0x50bbc1[_0xacc8('0x20')]?_0x50bbc1[_0xacc8('0x20')][_0xacc8('0x23')]||null:null,'include':_0x50bbc1[_0xacc8('0x20')]?_0x50bbc1[_0xacc8('0x20')][_0xacc8('0x24')]?_[_0xacc8('0x25')](_0x50bbc1[_0xacc8('0x20')]['include'],function(_0x1a3926){return{'model':db[_0x1a3926[_0xacc8('0x26')]],'as':_0x1a3926['as'],'attributes':_0x1a3926[_0xacc8('0x22')],'include':_0x1a3926[_0xacc8('0x24')]?_[_0xacc8('0x25')](_0x1a3926[_0xacc8('0x24')],function(_0x2ce62b){return{'model':db[_0x2ce62b['model']],'as':_0x2ce62b['as'],'attributes':_0x2ce62b[_0xacc8('0x22')],'include':_0x2ce62b[_0xacc8('0x24')]?_[_0xacc8('0x25')](_0x2ce62b[_0xacc8('0x24')],function(_0x3714de){return{'model':db[_0x3714de[_0xacc8('0x26')]],'as':_0x3714de['as'],'attributes':_0x3714de['attributes']};}):[]};}):[]};}):[]:[]})[_0xacc8('0x12')](function(_0x52646a){logger[_0xacc8('0x13')](_0xacc8('0x1d'),_0x50bbc1);logger[_0xacc8('0x16')]('GetVoiceExtension',_0x50bbc1,JSON['stringify'](_0x52646a));_0x3c52f4(_0x52646a);})[_0xacc8('0x1c')](function(_0xeda61f){logger[_0xacc8('0x19')](_0xacc8('0x1d'),_0xeda61f[_0xacc8('0x1a')],_0x50bbc1);_0x6333ee(_0x31f38b[_0xacc8('0x19')](0x1f4,_0xeda61f[_0xacc8('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index 3b81316..1e8b959 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 _0x7e67=['length','voiceExtension:','./voiceExtension.events','update','emit','removeListener','register'];(function(_0x2ff5f9,_0x23e3da){var _0x385c57=function(_0x40c041){while(--_0x40c041){_0x2ff5f9['push'](_0x2ff5f9['shift']());}};_0x385c57(++_0x23e3da);}(_0x7e67,0xdb));var _0x77e6=function(_0xf5e4c0,_0x5a254e){_0xf5e4c0=_0xf5e4c0-0x0;var _0x2c580a=_0x7e67[_0xf5e4c0];return _0x2c580a;};'use strict';var VoiceExtensionEvents=require(_0x77e6('0x0'));var events=['save','remove',_0x77e6('0x1')];function createListener(_0x5538b9,_0x208ccc){return function(_0x493c42){_0x208ccc[_0x77e6('0x2')](_0x5538b9,_0x493c42);};}function removeListener(_0x545571,_0x8573c9){return function(){VoiceExtensionEvents[_0x77e6('0x3')](_0x545571,_0x8573c9);};}exports[_0x77e6('0x4')]=function(_0x5a65a1){for(var _0x17bdb6=0x0,_0x5c9262=events[_0x77e6('0x5')];_0x17bdb6<_0x5c9262;_0x17bdb6++){var _0x24cbb8=events[_0x17bdb6];var _0x30eb5f=createListener(_0x77e6('0x6')+_0x24cbb8,_0x5a65a1);VoiceExtensionEvents['on'](_0x24cbb8,_0x30eb5f);}}; \ No newline at end of file +var _0x3854=['register','./voiceExtension.events','save','remove','update','emit','removeListener'];(function(_0x5bae70,_0x1b0618){var _0x1813b5=function(_0x6f7667){while(--_0x6f7667){_0x5bae70['push'](_0x5bae70['shift']());}};_0x1813b5(++_0x1b0618);}(_0x3854,0x151));var _0x4385=function(_0x39e69d,_0x5b151f){_0x39e69d=_0x39e69d-0x0;var _0x38114a=_0x3854[_0x39e69d];return _0x38114a;};'use strict';var VoiceExtensionEvents=require(_0x4385('0x0'));var events=[_0x4385('0x1'),_0x4385('0x2'),_0x4385('0x3')];function createListener(_0x40e557,_0x513171){return function(_0x7a4b3f){_0x513171[_0x4385('0x4')](_0x40e557,_0x7a4b3f);};}function removeListener(_0x63b4a4,_0x1b40f4){return function(){VoiceExtensionEvents[_0x4385('0x5')](_0x63b4a4,_0x1b40f4);};}exports[_0x4385('0x6')]=function(_0x23b210){for(var _0x192710=0x0,_0x465449=events['length'];_0x192710<_0x465449;_0x192710++){var _0x6cd1b7=events[_0x192710];var _0x548492=createListener('voiceExtension:'+_0x6cd1b7,_0x23b210);VoiceExtensionEvents['on'](_0x6cd1b7,_0x548492);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index ed42952..6798e08 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 _0x5399=['util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','getMessages','create','put','update','delete','exports','multer'];(function(_0x1b9bee,_0x2a79b4){var _0x3b9b05=function(_0x5de887){while(--_0x5de887){_0x1b9bee['push'](_0x1b9bee['shift']());}};_0x3b9b05(++_0x2a79b4);}(_0x5399,0x6b));var _0x9539=function(_0x39f9f2,_0x37fc06){_0x39f9f2=_0x39f9f2-0x0;var _0x3febf8=_0x5399[_0x39f9f2];return _0x3febf8;};'use strict';var multer=require(_0x9539('0x0'));var util=require(_0x9539('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x9539('0x2'));var router=express[_0x9539('0x3')]();var auth=require(_0x9539('0x4'));var interaction=require(_0x9539('0x5'));var config=require(_0x9539('0x6'));var controller=require(_0x9539('0x7'));router[_0x9539('0x8')]('/',auth[_0x9539('0x9')](),controller[_0x9539('0xa')]);router[_0x9539('0x8')](_0x9539('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x9539('0x8')]('/:id/messages',auth[_0x9539('0x9')](),controller[_0x9539('0xc')]);router['post']('/',auth[_0x9539('0x9')](),controller[_0x9539('0xd')]);router[_0x9539('0xe')]('/:id',auth[_0x9539('0x9')](),controller[_0x9539('0xf')]);router[_0x9539('0x10')](_0x9539('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x9539('0x11')]=router; \ No newline at end of file +var _0xb06c=['isAuthenticated','index','/:id','show','/:id/messages','post','create','update','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceMail.controller','get'];(function(_0x5806e2,_0x453326){var _0x52bc95=function(_0x3990af){while(--_0x3990af){_0x5806e2['push'](_0x5806e2['shift']());}};_0x52bc95(++_0x453326);}(_0xb06c,0x18f));var _0xcb06=function(_0x3b5200,_0x21534b){_0x3b5200=_0x3b5200-0x0;var _0x3e54b3=_0xb06c[_0x3b5200];return _0x3e54b3;};'use strict';var multer=require(_0xcb06('0x0'));var util=require('util');var path=require(_0xcb06('0x1'));var timeout=require(_0xcb06('0x2'));var express=require(_0xcb06('0x3'));var router=express[_0xcb06('0x4')]();var auth=require(_0xcb06('0x5'));var interaction=require(_0xcb06('0x6'));var config=require('../../config/environment');var controller=require(_0xcb06('0x7'));router[_0xcb06('0x8')]('/',auth[_0xcb06('0x9')](),controller[_0xcb06('0xa')]);router[_0xcb06('0x8')](_0xcb06('0xb'),auth[_0xcb06('0x9')](),controller[_0xcb06('0xc')]);router[_0xcb06('0x8')](_0xcb06('0xd'),auth[_0xcb06('0x9')](),controller['getMessages']);router[_0xcb06('0xe')]('/',auth[_0xcb06('0x9')](),controller[_0xcb06('0xf')]);router['put'](_0xcb06('0xb'),auth[_0xcb06('0x9')](),controller[_0xcb06('0x10')]);router['delete'](_0xcb06('0xb'),auth[_0xcb06('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 467f3d3..b2c7709 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 _0x93e9=['setDataValue','email','string','trim','central','ENUM','yes','TINYINT(4)','TIMESTAMP','INTEGER','VIRTUAL','getDataValue','fullname','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox'];(function(_0x3ca3eb,_0xec21df){var _0x3e64fc=function(_0x3db622){while(--_0x3db622){_0x3ca3eb['push'](_0x3ca3eb['shift']());}};_0x3e64fc(++_0xec21df);}(_0x93e9,0xcc));var _0x993e=function(_0x3d440d,_0x291128){_0x3d440d=_0x3d440d-0x0;var _0x353fa1=_0x93e9[_0x3d440d];return _0x353fa1;};'use strict';var Sequelize=require(_0x993e('0x0'));module[_0x993e('0x1')]={'customer_id':{'type':Sequelize[_0x993e('0x2')]},'context':{'type':Sequelize[_0x993e('0x2')],'defaultValue':_0x993e('0x3'),'unique':_0x993e('0x4')},'mailbox':{'type':Sequelize[_0x993e('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x993e('0x2')]},'email':{'type':Sequelize[_0x993e('0x2')],'validate':{'isEmail':!![]},'set':function(_0x15ce9b){this[_0x993e('0x5')](_0x993e('0x6'),typeof _0x15ce9b===_0x993e('0x7')&&_0x15ce9b[_0x993e('0x8')]()?_0x15ce9b[_0x993e('0x8')]():null);}},'pager':{'type':Sequelize['STRING']},'tz':{'type':Sequelize[_0x993e('0x2')],'defaultValue':_0x993e('0x9')},'attach':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'saycid':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x993e('0x2')]},'callback':{'type':Sequelize[_0x993e('0x2')]},'review':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x993e('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x993e('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize['ENUM'](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x993e('0xc'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'forcename':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize[_0x993e('0xa')](_0x993e('0xb'),'no'),'defaultValue':_0x993e('0xb'),'allowNull':![]},'stamp':{'type':_0x993e('0xd')},'emailsubject':{'type':Sequelize['STRING']},'emailbody':{'type':Sequelize[_0x993e('0x2')]},'maxsecs':{'type':Sequelize[_0x993e('0xe')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x993e('0xe')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x993e('0xf')],'get':function(){return this[_0x993e('0x10')](_0x993e('0x11'))+'\x20-\x20'+this[_0x993e('0x10')](_0x993e('0x12'));}}}; \ No newline at end of file +var _0xb03e=['VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','string','trim','central','yes','ENUM','TINYINT(4)','TIMESTAMP','INTEGER'];(function(_0x42ebe9,_0x376a18){var _0x511d27=function(_0x2ef05d){while(--_0x2ef05d){_0x42ebe9['push'](_0x42ebe9['shift']());}};_0x511d27(++_0x376a18);}(_0xb03e,0x1eb));var _0xeb03=function(_0x9780b2,_0x4d373c){_0x9780b2=_0x9780b2-0x0;var _0xd4a1e7=_0xb03e[_0x9780b2];return _0xd4a1e7;};'use strict';var Sequelize=require('sequelize');module[_0xeb03('0x0')]={'customer_id':{'type':Sequelize[_0xeb03('0x1')]},'context':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':_0xeb03('0x2'),'unique':_0xeb03('0x3')},'mailbox':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':'','allowNull':![],'unique':_0xeb03('0x3')},'password':{'type':Sequelize[_0xeb03('0x1')]},'fullname':{'type':Sequelize[_0xeb03('0x1')]},'email':{'type':Sequelize[_0xeb03('0x1')],'validate':{'isEmail':!![]},'set':function(_0x88925b){this[_0xeb03('0x4')]('email',typeof _0x88925b===_0xeb03('0x5')&&_0x88925b[_0xeb03('0x6')]()?_0x88925b[_0xeb03('0x6')]():null);}},'pager':{'type':Sequelize[_0xeb03('0x1')]},'tz':{'type':Sequelize[_0xeb03('0x1')],'defaultValue':_0xeb03('0x7')},'attach':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'saycid':{'type':Sequelize[_0xeb03('0x9')]('yes','no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'dialout':{'type':Sequelize['STRING']},'callback':{'type':Sequelize[_0xeb03('0x1')]},'review':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0xeb03('0xa'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'forcename':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0xeb03('0x9')](_0xeb03('0x8'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0xeb03('0x8'),'no'),'defaultValue':_0xeb03('0x8'),'allowNull':![]},'stamp':{'type':_0xeb03('0xb')},'emailsubject':{'type':Sequelize[_0xeb03('0x1')]},'emailbody':{'type':Sequelize[_0xeb03('0x1')]},'maxsecs':{'type':Sequelize[_0xeb03('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0xeb03('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0xeb03('0xd')],'get':function(){return this[_0xeb03('0xe')](_0xeb03('0xf'))+_0xeb03('0x10')+this[_0xeb03('0xe')](_0xeb03('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index faba78a..cf127fa 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 _0xdd66=['merge','VIRTUAL','filter','options','VoiceMail','include','findAll','rows','catch','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Voicemails','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','getMessages','findOne','VoiceMailMessage','rawAttributes','mailbox','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','UserProfileResource','name','send','index','map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where'];(function(_0x1ad12c,_0x5bd618){var _0xb60e0f=function(_0x9fb490){while(--_0x9fb490){_0x1ad12c['push'](_0x1ad12c['shift']());}};_0xb60e0f(++_0x5bd618);}(_0xdd66,0x121));var _0x6dd6=function(_0x16c8f8,_0x20bea0){_0x16c8f8=_0x16c8f8-0x0;var _0x41a5e2=_0xdd66[_0x16c8f8];return _0x41a5e2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6dd6('0x0'));var rimraf=require(_0x6dd6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6dd6('0x2'));var rp=require(_0x6dd6('0x3'));var moment=require('moment');var BPromise=require(_0x6dd6('0x4'));var Mustache=require(_0x6dd6('0x5'));var util=require(_0x6dd6('0x6'));var path=require(_0x6dd6('0x7'));var sox=require(_0x6dd6('0x8'));var csv=require('to-csv');var ejs=require(_0x6dd6('0x9'));var fs=require('fs');var _=require(_0x6dd6('0xa'));var squel=require(_0x6dd6('0xb'));var crypto=require(_0x6dd6('0xc'));var jsforce=require(_0x6dd6('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6dd6('0xe'));var querystring=require(_0x6dd6('0xf'));var Papa=require(_0x6dd6('0x10'));var Redis=require(_0x6dd6('0x11'));var authService=require(_0x6dd6('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x6dd6('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6dd6('0x14'))(_0x6dd6('0x15'));var utils=require(_0x6dd6('0x16'));var config=require('../../config/environment');var db=require(_0x6dd6('0x17'))['db'];function respondWithStatusCode(_0x23dc5,_0x10ac67){_0x10ac67=_0x10ac67||0xcc;return function(_0x288ccd){if(_0x288ccd){return _0x23dc5[_0x6dd6('0x18')](_0x10ac67);}return _0x23dc5[_0x6dd6('0x19')](_0x10ac67)[_0x6dd6('0x1a')]();};}function respondWithResult(_0x2d4772,_0x2227f4){_0x2227f4=_0x2227f4||0xc8;return function(_0x7e4752){if(_0x7e4752){return _0x2d4772[_0x6dd6('0x19')](_0x2227f4)['json'](_0x7e4752);}};}function respondWithFilteredResult(_0x1408e1,_0x182742){return function(_0x4046c9){if(_0x4046c9){var _0x39585a=_0x4046c9[_0x6dd6('0x1b')],_0xa6bfee=_0x182742[_0x6dd6('0x1c')],_0x1611f8=_0x182742[_0x6dd6('0x1c')]+_0x182742[_0x6dd6('0x1d')],_0x313ede;if(_0x1611f8>=_0x39585a){_0x1611f8=_0x39585a;_0x313ede=0xc8;}else{_0x313ede=0xce;}_0x1408e1['status'](_0x313ede);return _0x1408e1[_0x6dd6('0x1e')](_0x6dd6('0x1f'),_0xa6bfee+'-'+_0x1611f8+'/'+_0x39585a)['json'](_0x4046c9);}return null;};}function patchUpdates(_0xc276dd){return function(_0x7e0cf){try{jsonpatch[_0x6dd6('0x20')](_0x7e0cf,_0xc276dd,!![]);}catch(_0x595a9b){return BPromise['reject'](_0x595a9b);}return _0x7e0cf['save']();};}function saveUpdates(_0x37fb3b,_0x542780){return function(_0x2bb859){if(_0x2bb859){return _0x2bb859[_0x6dd6('0x21')](_0x37fb3b)[_0x6dd6('0x22')](function(_0x140c19){return _0x140c19;});}return null;};}function removeEntity(_0x305443,_0x2098a4){return function(_0x5697a4){if(_0x5697a4){return _0x5697a4[_0x6dd6('0x23')]()[_0x6dd6('0x22')](function(){var _0x2bb494=_0x5697a4[_0x6dd6('0x24')]({'plain':!![]});var _0x540735='Voicemails';return db[_0x6dd6('0x25')][_0x6dd6('0x23')]({'where':{'type':_0x540735,'resourceId':_0x2bb494['id']}})[_0x6dd6('0x22')](function(){return _0x5697a4;});})[_0x6dd6('0x22')](function(){_0x305443[_0x6dd6('0x19')](0xcc)[_0x6dd6('0x1a')]();});}};}function handleEntityNotFound(_0x495b0c,_0x1454c2){return function(_0x392a9b){if(!_0x392a9b){_0x495b0c[_0x6dd6('0x18')](0x194);}return _0x392a9b;};}function handleError(_0x35f831,_0x552cb5){_0x552cb5=_0x552cb5||0x1f4;return function(_0x2638cc){logger['error'](_0x2638cc['stack']);if(_0x2638cc[_0x6dd6('0x26')]){delete _0x2638cc[_0x6dd6('0x26')];}_0x35f831[_0x6dd6('0x19')](_0x552cb5)[_0x6dd6('0x27')](_0x2638cc);};}exports[_0x6dd6('0x28')]=function(_0x1f613d,_0x3cf226){var _0x525a23={},_0x460020={},_0x5bdc49={'count':0x0,'rows':[]};var _0x273efa=_[_0x6dd6('0x29')](db['VoiceMail']['rawAttributes'],function(_0x1cfc06){return{'name':_0x1cfc06[_0x6dd6('0x2a')],'type':_0x1cfc06[_0x6dd6('0x2b')][_0x6dd6('0x2c')]};});_0x460020['model']=_[_0x6dd6('0x29')](_0x273efa,_0x6dd6('0x26'));_0x460020[_0x6dd6('0x2d')]=_[_0x6dd6('0x2e')](_0x1f613d['query']);_0x460020[_0x6dd6('0x2f')]=_[_0x6dd6('0x30')](_0x460020[_0x6dd6('0x31')],_0x460020['query']);_0x525a23[_0x6dd6('0x32')]=_['intersection'](_0x460020[_0x6dd6('0x31')],qs[_0x6dd6('0x33')](_0x1f613d['query'][_0x6dd6('0x33')]));_0x525a23[_0x6dd6('0x32')]=_0x525a23[_0x6dd6('0x32')][_0x6dd6('0x34')]?_0x525a23['attributes']:_0x460020[_0x6dd6('0x31')];if(!_0x1f613d['query'][_0x6dd6('0x35')](_0x6dd6('0x36'))){_0x525a23[_0x6dd6('0x1d')]=qs[_0x6dd6('0x1d')](_0x1f613d[_0x6dd6('0x2d')][_0x6dd6('0x1d')]);_0x525a23[_0x6dd6('0x1c')]=qs[_0x6dd6('0x1c')](_0x1f613d[_0x6dd6('0x2d')][_0x6dd6('0x1c')]);}_0x525a23[_0x6dd6('0x37')]=qs[_0x6dd6('0x38')](_0x1f613d[_0x6dd6('0x2d')][_0x6dd6('0x38')]);_0x525a23['where']=qs['filters'](_[_0x6dd6('0x39')](_0x1f613d[_0x6dd6('0x2d')],_0x460020[_0x6dd6('0x2f')]));if(_0x1f613d[_0x6dd6('0x2d')]['filter']){_0x525a23[_0x6dd6('0x3a')]=_[_0x6dd6('0x3b')](_0x525a23[_0x6dd6('0x3a')],{'$or':_[_0x6dd6('0x29')](_0x273efa,function(_0x193f0f){if(_0x193f0f[_0x6dd6('0x2b')]!==_0x6dd6('0x3c')){var _0x27d5d3={};_0x27d5d3[_0x193f0f[_0x6dd6('0x26')]]={'$like':'%'+_0x1f613d[_0x6dd6('0x2d')][_0x6dd6('0x3d')]+'%'};return _0x27d5d3;}})});}_0x525a23=_[_0x6dd6('0x3b')]({},_0x525a23,_0x1f613d[_0x6dd6('0x3e')]);var _0x409e24={'where':_0x525a23[_0x6dd6('0x3a')]};return db[_0x6dd6('0x3f')]['count'](_0x409e24)[_0x6dd6('0x22')](function(_0x3b6244){_0x5bdc49[_0x6dd6('0x1b')]=_0x3b6244;if(_0x1f613d['query']['includeAll']){_0x525a23[_0x6dd6('0x40')]=[{'all':!![]}];}return db[_0x6dd6('0x3f')][_0x6dd6('0x41')](_0x525a23);})[_0x6dd6('0x22')](function(_0x1da072){_0x5bdc49[_0x6dd6('0x42')]=_0x1da072;return _0x5bdc49;})[_0x6dd6('0x22')](respondWithFilteredResult(_0x3cf226,_0x525a23))[_0x6dd6('0x43')](handleError(_0x3cf226,null));};exports[_0x6dd6('0x44')]=function(_0x4eb6f4,_0x43b2fa){var _0x8507f={'raw':!![],'where':{'id':_0x4eb6f4[_0x6dd6('0x45')]['id']}},_0x2c20e1={};_0x2c20e1[_0x6dd6('0x31')]=_[_0x6dd6('0x2e')](db[_0x6dd6('0x3f')]['rawAttributes']);_0x2c20e1['query']=_[_0x6dd6('0x2e')](_0x4eb6f4[_0x6dd6('0x2d')]);_0x2c20e1[_0x6dd6('0x2f')]=_[_0x6dd6('0x30')](_0x2c20e1[_0x6dd6('0x31')],_0x2c20e1[_0x6dd6('0x2d')]);_0x8507f[_0x6dd6('0x32')]=_[_0x6dd6('0x30')](_0x2c20e1[_0x6dd6('0x31')],qs['fields'](_0x4eb6f4['query']['fields']));_0x8507f[_0x6dd6('0x32')]=_0x8507f[_0x6dd6('0x32')][_0x6dd6('0x34')]?_0x8507f[_0x6dd6('0x32')]:_0x2c20e1[_0x6dd6('0x31')];if(_0x4eb6f4[_0x6dd6('0x2d')]['includeAll']){_0x8507f[_0x6dd6('0x40')]=[{'all':!![]}];}_0x8507f=_[_0x6dd6('0x3b')]({},_0x8507f,_0x4eb6f4['options']);return db[_0x6dd6('0x3f')]['find'](_0x8507f)[_0x6dd6('0x22')](handleEntityNotFound(_0x43b2fa,null))[_0x6dd6('0x22')](respondWithResult(_0x43b2fa,null))[_0x6dd6('0x43')](handleError(_0x43b2fa,null));};exports['create']=function(_0x1a8e83,_0x245d4d){return db['VoiceMail'][_0x6dd6('0x46')](_0x1a8e83[_0x6dd6('0x47')],{})[_0x6dd6('0x22')](function(_0x3bdf0a){var _0x384905=_0x1a8e83[_0x6dd6('0x48')][_0x6dd6('0x24')]({'plain':!![]});if(!_0x384905)throw new Error(_0x6dd6('0x49'));if(_0x384905[_0x6dd6('0x4a')]===_0x6dd6('0x48')){var _0x4c4c6e=_0x3bdf0a[_0x6dd6('0x24')]({'plain':!![]});var _0x45f463=_0x6dd6('0x4b');return db[_0x6dd6('0x4c')]['find']({'where':{'name':_0x45f463,'userProfileId':_0x384905[_0x6dd6('0x4d')]},'raw':!![]})[_0x6dd6('0x22')](function(_0x27070e){if(_0x27070e&&_0x27070e[_0x6dd6('0x4e')]===0x0){return db[_0x6dd6('0x25')]['create']({'name':_0x4c4c6e[_0x6dd6('0x26')],'resourceId':_0x4c4c6e['id'],'type':_0x27070e[_0x6dd6('0x26')],'sectionId':_0x27070e['id']},{})[_0x6dd6('0x22')](function(){return _0x3bdf0a;});}else{return _0x3bdf0a;}})[_0x6dd6('0x43')](function(_0xb64522){logger[_0x6dd6('0x4f')](_0x6dd6('0x50'),_0xb64522);throw _0xb64522;});}return _0x3bdf0a;})[_0x6dd6('0x22')](respondWithResult(_0x245d4d,0xc9))['catch'](handleError(_0x245d4d,null));};exports[_0x6dd6('0x21')]=function(_0x202d9b,_0x21dbbe){if(_0x202d9b['body']['id']){delete _0x202d9b[_0x6dd6('0x47')]['id'];}return db[_0x6dd6('0x3f')][_0x6dd6('0x51')]({'where':{'id':_0x202d9b['params']['id']}})[_0x6dd6('0x22')](handleEntityNotFound(_0x21dbbe,null))['then'](saveUpdates(_0x202d9b['body'],null))[_0x6dd6('0x22')](respondWithResult(_0x21dbbe,null))[_0x6dd6('0x43')](handleError(_0x21dbbe,null));};exports[_0x6dd6('0x23')]=function(_0x434f20,_0x203cea){return db[_0x6dd6('0x3f')][_0x6dd6('0x51')]({'where':{'id':_0x434f20[_0x6dd6('0x45')]['id']}})[_0x6dd6('0x22')](handleEntityNotFound(_0x203cea,null))[_0x6dd6('0x22')](removeEntity(_0x203cea,null))[_0x6dd6('0x43')](handleError(_0x203cea,null));};exports[_0x6dd6('0x52')]=function(_0x431d9d,_0xb792a,_0x4a53e7){return db[_0x6dd6('0x3f')][_0x6dd6('0x53')]({'where':{'id':_0x431d9d[_0x6dd6('0x45')]['id']}})['then'](handleEntityNotFound(_0xb792a,null))['then'](function(_0x407c1d){var _0x1ff6a5;var _0xedca6f={},_0x350df2={};_0x350df2[_0x6dd6('0x31')]=_[_0x6dd6('0x2e')](db[_0x6dd6('0x54')][_0x6dd6('0x55')]);_0x350df2[_0x6dd6('0x2d')]=_[_0x6dd6('0x2e')](_0x431d9d[_0x6dd6('0x2d')]);_0x350df2[_0x6dd6('0x2f')]=_[_0x6dd6('0x30')](_0x350df2[_0x6dd6('0x31')],_0x350df2[_0x6dd6('0x2d')]);_0xedca6f[_0x6dd6('0x32')]=_[_0x6dd6('0x30')](_0x350df2[_0x6dd6('0x31')],qs[_0x6dd6('0x33')](_0x431d9d[_0x6dd6('0x2d')][_0x6dd6('0x33')]));_0xedca6f['attributes']=_0xedca6f[_0x6dd6('0x32')][_0x6dd6('0x34')]?_0xedca6f[_0x6dd6('0x32')]:_0x350df2['model'];if(!_0x431d9d[_0x6dd6('0x2d')][_0x6dd6('0x35')](_0x6dd6('0x36'))){_0xedca6f[_0x6dd6('0x1d')]=qs['limit'](_0x431d9d['query']['limit']);_0xedca6f['offset']=qs[_0x6dd6('0x1c')](_0x431d9d['query'][_0x6dd6('0x1c')]);}_0xedca6f[_0x6dd6('0x37')]=qs[_0x6dd6('0x38')](_0x431d9d[_0x6dd6('0x2d')][_0x6dd6('0x38')]);_0xedca6f[_0x6dd6('0x3a')]=qs[_0x6dd6('0x2f')](_[_0x6dd6('0x39')](_0x431d9d[_0x6dd6('0x2d')],_0x350df2[_0x6dd6('0x2f')]));if(_0x431d9d[_0x6dd6('0x2d')][_0x6dd6('0x3d')]){_0xedca6f['where']=_['merge'](_0xedca6f['where'],{'$or':_[_0x6dd6('0x29')](_0xedca6f[_0x6dd6('0x32')],function(_0x4819fd){var _0xfb9cd0={};_0xfb9cd0[_0x4819fd]={'$like':'%'+_0x431d9d['query']['filter']+'%'};return _0xfb9cd0;})});}_0xedca6f[_0x6dd6('0x3a')]=_[_0x6dd6('0x3b')](_0xedca6f[_0x6dd6('0x3a')],{'mailboxuser':_0x407c1d[_0x6dd6('0x56')]});_0xedca6f=_[_0x6dd6('0x3b')]({},_0xedca6f,_0x431d9d['options']);return db[_0x6dd6('0x54')]['findAndCountAll'](_0xedca6f)['then'](respondWithFilteredResult(_0xb792a,_0xedca6f));})[_0x6dd6('0x43')](handleError(_0xb792a,null));}; \ No newline at end of file +var _0xac7f=['../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Voicemails','UserProfileResource','error','name','send','index','map','VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','nolimit','sort','where','filters','pick','filter','merge','VIRTUAL','options','include','rows','catch','show','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','getMessages','findOne','VoiceMailMessage','length','hasOwnProperty','findAndCountAll','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xac7f,0x1e2));var _0xfac7=function(_0x4243a3,_0x447337){_0x4243a3=_0x4243a3-0x0;var _0x1b2a33=_0xac7f[_0x4243a3];return _0x1b2a33;};'use strict';var pdf=require(_0xfac7('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfac7('0x1'));var zipdir=require(_0xfac7('0x2'));var jsonpatch=require(_0xfac7('0x3'));var rp=require('request-promise');var moment=require(_0xfac7('0x4'));var BPromise=require(_0xfac7('0x5'));var Mustache=require(_0xfac7('0x6'));var util=require(_0xfac7('0x7'));var path=require(_0xfac7('0x8'));var sox=require(_0xfac7('0x9'));var csv=require('to-csv');var ejs=require(_0xfac7('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xfac7('0xb'));var crypto=require(_0xfac7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xfac7('0xd'));var toCsv=require(_0xfac7('0xe'));var querystring=require(_0xfac7('0xf'));var Papa=require('papaparse');var Redis=require(_0xfac7('0x10'));var authService=require(_0xfac7('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xfac7('0x12'));var logger=require(_0xfac7('0x13'))(_0xfac7('0x14'));var utils=require(_0xfac7('0x15'));var config=require(_0xfac7('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2ffa5a,_0x56f7a1){_0x56f7a1=_0x56f7a1||0xcc;return function(_0x4111dd){if(_0x4111dd){return _0x2ffa5a[_0xfac7('0x17')](_0x56f7a1);}return _0x2ffa5a[_0xfac7('0x18')](_0x56f7a1)[_0xfac7('0x19')]();};}function respondWithResult(_0x4a97d3,_0x582a03){_0x582a03=_0x582a03||0xc8;return function(_0x11a5fd){if(_0x11a5fd){return _0x4a97d3['status'](_0x582a03)[_0xfac7('0x1a')](_0x11a5fd);}};}function respondWithFilteredResult(_0x3858b0,_0x54d738){return function(_0x1ff0f4){if(_0x1ff0f4){var _0xc7a913=_0x1ff0f4[_0xfac7('0x1b')],_0x4b7479=_0x54d738[_0xfac7('0x1c')],_0x4066db=_0x54d738['offset']+_0x54d738[_0xfac7('0x1d')],_0x2a9417;if(_0x4066db>=_0xc7a913){_0x4066db=_0xc7a913;_0x2a9417=0xc8;}else{_0x2a9417=0xce;}_0x3858b0[_0xfac7('0x18')](_0x2a9417);return _0x3858b0[_0xfac7('0x1e')](_0xfac7('0x1f'),_0x4b7479+'-'+_0x4066db+'/'+_0xc7a913)[_0xfac7('0x1a')](_0x1ff0f4);}return null;};}function patchUpdates(_0x1398f7){return function(_0x11245){try{jsonpatch[_0xfac7('0x20')](_0x11245,_0x1398f7,!![]);}catch(_0x3b2a4b){return BPromise['reject'](_0x3b2a4b);}return _0x11245['save']();};}function saveUpdates(_0xca4e0d,_0x2207b7){return function(_0x48d266){if(_0x48d266){return _0x48d266[_0xfac7('0x21')](_0xca4e0d)[_0xfac7('0x22')](function(_0x142116){return _0x142116;});}return null;};}function removeEntity(_0x3fc79b,_0x2c70dd){return function(_0x147c3c){if(_0x147c3c){return _0x147c3c[_0xfac7('0x23')]()[_0xfac7('0x22')](function(){var _0x2229aa=_0x147c3c[_0xfac7('0x24')]({'plain':!![]});var _0x57958f=_0xfac7('0x25');return db[_0xfac7('0x26')][_0xfac7('0x23')]({'where':{'type':_0x57958f,'resourceId':_0x2229aa['id']}})[_0xfac7('0x22')](function(){return _0x147c3c;});})[_0xfac7('0x22')](function(){_0x3fc79b['status'](0xcc)[_0xfac7('0x19')]();});}};}function handleEntityNotFound(_0xdf60cc,_0x2aa0a0){return function(_0x1661e9){if(!_0x1661e9){_0xdf60cc[_0xfac7('0x17')](0x194);}return _0x1661e9;};}function handleError(_0x195c13,_0x4ab1ed){_0x4ab1ed=_0x4ab1ed||0x1f4;return function(_0x3d1a84){logger[_0xfac7('0x27')](_0x3d1a84['stack']);if(_0x3d1a84[_0xfac7('0x28')]){delete _0x3d1a84[_0xfac7('0x28')];}_0x195c13[_0xfac7('0x18')](_0x4ab1ed)[_0xfac7('0x29')](_0x3d1a84);};}exports[_0xfac7('0x2a')]=function(_0x27c494,_0x4af388){var _0x3f9c66={},_0x49b341={},_0x1e190b={'count':0x0,'rows':[]};var _0x478f14=_[_0xfac7('0x2b')](db[_0xfac7('0x2c')][_0xfac7('0x2d')],function(_0x47d5ab){return{'name':_0x47d5ab[_0xfac7('0x2e')],'type':_0x47d5ab[_0xfac7('0x2f')][_0xfac7('0x30')]};});_0x49b341[_0xfac7('0x31')]=_[_0xfac7('0x2b')](_0x478f14,_0xfac7('0x28'));_0x49b341[_0xfac7('0x32')]=_[_0xfac7('0x33')](_0x27c494[_0xfac7('0x32')]);_0x49b341['filters']=_[_0xfac7('0x34')](_0x49b341[_0xfac7('0x31')],_0x49b341['query']);_0x3f9c66[_0xfac7('0x35')]=_[_0xfac7('0x34')](_0x49b341[_0xfac7('0x31')],qs[_0xfac7('0x36')](_0x27c494[_0xfac7('0x32')][_0xfac7('0x36')]));_0x3f9c66[_0xfac7('0x35')]=_0x3f9c66['attributes']['length']?_0x3f9c66[_0xfac7('0x35')]:_0x49b341['model'];if(!_0x27c494['query']['hasOwnProperty'](_0xfac7('0x37'))){_0x3f9c66[_0xfac7('0x1d')]=qs[_0xfac7('0x1d')](_0x27c494[_0xfac7('0x32')][_0xfac7('0x1d')]);_0x3f9c66['offset']=qs[_0xfac7('0x1c')](_0x27c494[_0xfac7('0x32')][_0xfac7('0x1c')]);}_0x3f9c66['order']=qs[_0xfac7('0x38')](_0x27c494['query'][_0xfac7('0x38')]);_0x3f9c66[_0xfac7('0x39')]=qs[_0xfac7('0x3a')](_[_0xfac7('0x3b')](_0x27c494[_0xfac7('0x32')],_0x49b341[_0xfac7('0x3a')]));if(_0x27c494[_0xfac7('0x32')][_0xfac7('0x3c')]){_0x3f9c66[_0xfac7('0x39')]=_[_0xfac7('0x3d')](_0x3f9c66[_0xfac7('0x39')],{'$or':_[_0xfac7('0x2b')](_0x478f14,function(_0x1923cd){if(_0x1923cd[_0xfac7('0x2f')]!==_0xfac7('0x3e')){var _0x410f53={};_0x410f53[_0x1923cd['name']]={'$like':'%'+_0x27c494['query'][_0xfac7('0x3c')]+'%'};return _0x410f53;}})});}_0x3f9c66=_['merge']({},_0x3f9c66,_0x27c494[_0xfac7('0x3f')]);var _0x37f718={'where':_0x3f9c66['where']};return db[_0xfac7('0x2c')][_0xfac7('0x1b')](_0x37f718)[_0xfac7('0x22')](function(_0x3db48b){_0x1e190b[_0xfac7('0x1b')]=_0x3db48b;if(_0x27c494['query']['includeAll']){_0x3f9c66[_0xfac7('0x40')]=[{'all':!![]}];}return db['VoiceMail']['findAll'](_0x3f9c66);})[_0xfac7('0x22')](function(_0x1fc3ce){_0x1e190b[_0xfac7('0x41')]=_0x1fc3ce;return _0x1e190b;})[_0xfac7('0x22')](respondWithFilteredResult(_0x4af388,_0x3f9c66))[_0xfac7('0x42')](handleError(_0x4af388,null));};exports[_0xfac7('0x43')]=function(_0x420279,_0x357e86){var _0xee71b4={'raw':!![],'where':{'id':_0x420279['params']['id']}},_0x5bf66b={};_0x5bf66b['model']=_['keys'](db['VoiceMail']['rawAttributes']);_0x5bf66b[_0xfac7('0x32')]=_['keys'](_0x420279[_0xfac7('0x32')]);_0x5bf66b[_0xfac7('0x3a')]=_['intersection'](_0x5bf66b[_0xfac7('0x31')],_0x5bf66b[_0xfac7('0x32')]);_0xee71b4[_0xfac7('0x35')]=_[_0xfac7('0x34')](_0x5bf66b[_0xfac7('0x31')],qs['fields'](_0x420279[_0xfac7('0x32')][_0xfac7('0x36')]));_0xee71b4[_0xfac7('0x35')]=_0xee71b4[_0xfac7('0x35')]['length']?_0xee71b4[_0xfac7('0x35')]:_0x5bf66b['model'];if(_0x420279[_0xfac7('0x32')][_0xfac7('0x44')]){_0xee71b4[_0xfac7('0x40')]=[{'all':!![]}];}_0xee71b4=_[_0xfac7('0x3d')]({},_0xee71b4,_0x420279[_0xfac7('0x3f')]);return db[_0xfac7('0x2c')][_0xfac7('0x45')](_0xee71b4)[_0xfac7('0x22')](handleEntityNotFound(_0x357e86,null))[_0xfac7('0x22')](respondWithResult(_0x357e86,null))[_0xfac7('0x42')](handleError(_0x357e86,null));};exports[_0xfac7('0x46')]=function(_0x2d0056,_0x7aaa95){return db[_0xfac7('0x2c')][_0xfac7('0x46')](_0x2d0056[_0xfac7('0x47')],{})[_0xfac7('0x22')](function(_0x1cf519){var _0x6852bd=_0x2d0056[_0xfac7('0x48')]['get']({'plain':!![]});if(!_0x6852bd)throw new Error(_0xfac7('0x49'));if(_0x6852bd['role']===_0xfac7('0x48')){var _0x3a0a50=_0x1cf519[_0xfac7('0x24')]({'plain':!![]});var _0x1f7c40='Voicemails';return db[_0xfac7('0x4a')][_0xfac7('0x45')]({'where':{'name':_0x1f7c40,'userProfileId':_0x6852bd[_0xfac7('0x4b')]},'raw':!![]})[_0xfac7('0x22')](function(_0x129cd0){if(_0x129cd0&&_0x129cd0['autoAssociation']===0x0){return db[_0xfac7('0x26')][_0xfac7('0x46')]({'name':_0x3a0a50['name'],'resourceId':_0x3a0a50['id'],'type':_0x129cd0[_0xfac7('0x28')],'sectionId':_0x129cd0['id']},{})[_0xfac7('0x22')](function(){return _0x1cf519;});}else{return _0x1cf519;}})[_0xfac7('0x42')](function(_0xbcdb25){logger[_0xfac7('0x27')](_0xfac7('0x4c'),_0xbcdb25);throw _0xbcdb25;});}return _0x1cf519;})[_0xfac7('0x22')](respondWithResult(_0x7aaa95,0xc9))['catch'](handleError(_0x7aaa95,null));};exports['update']=function(_0x47bf52,_0x2530d5){if(_0x47bf52[_0xfac7('0x47')]['id']){delete _0x47bf52[_0xfac7('0x47')]['id'];}return db[_0xfac7('0x2c')]['find']({'where':{'id':_0x47bf52[_0xfac7('0x4d')]['id']}})[_0xfac7('0x22')](handleEntityNotFound(_0x2530d5,null))['then'](saveUpdates(_0x47bf52[_0xfac7('0x47')],null))[_0xfac7('0x22')](respondWithResult(_0x2530d5,null))[_0xfac7('0x42')](handleError(_0x2530d5,null));};exports['destroy']=function(_0x3a7556,_0x383cca){return db['VoiceMail'][_0xfac7('0x45')]({'where':{'id':_0x3a7556['params']['id']}})[_0xfac7('0x22')](handleEntityNotFound(_0x383cca,null))[_0xfac7('0x22')](removeEntity(_0x383cca,null))[_0xfac7('0x42')](handleError(_0x383cca,null));};exports[_0xfac7('0x4e')]=function(_0x283f8c,_0x23575f,_0xe6ea10){return db[_0xfac7('0x2c')][_0xfac7('0x4f')]({'where':{'id':_0x283f8c['params']['id']}})[_0xfac7('0x22')](handleEntityNotFound(_0x23575f,null))['then'](function(_0x2f7c5b){var _0x3a9ac4;var _0x596178={},_0x41ff44={};_0x41ff44[_0xfac7('0x31')]=_['keys'](db[_0xfac7('0x50')]['rawAttributes']);_0x41ff44[_0xfac7('0x32')]=_[_0xfac7('0x33')](_0x283f8c[_0xfac7('0x32')]);_0x41ff44[_0xfac7('0x3a')]=_['intersection'](_0x41ff44[_0xfac7('0x31')],_0x41ff44[_0xfac7('0x32')]);_0x596178[_0xfac7('0x35')]=_[_0xfac7('0x34')](_0x41ff44['model'],qs[_0xfac7('0x36')](_0x283f8c[_0xfac7('0x32')][_0xfac7('0x36')]));_0x596178['attributes']=_0x596178[_0xfac7('0x35')][_0xfac7('0x51')]?_0x596178[_0xfac7('0x35')]:_0x41ff44[_0xfac7('0x31')];if(!_0x283f8c[_0xfac7('0x32')][_0xfac7('0x52')](_0xfac7('0x37'))){_0x596178[_0xfac7('0x1d')]=qs[_0xfac7('0x1d')](_0x283f8c['query'][_0xfac7('0x1d')]);_0x596178[_0xfac7('0x1c')]=qs[_0xfac7('0x1c')](_0x283f8c['query'][_0xfac7('0x1c')]);}_0x596178['order']=qs[_0xfac7('0x38')](_0x283f8c['query'][_0xfac7('0x38')]);_0x596178[_0xfac7('0x39')]=qs[_0xfac7('0x3a')](_[_0xfac7('0x3b')](_0x283f8c[_0xfac7('0x32')],_0x41ff44[_0xfac7('0x3a')]));if(_0x283f8c[_0xfac7('0x32')][_0xfac7('0x3c')]){_0x596178[_0xfac7('0x39')]=_[_0xfac7('0x3d')](_0x596178[_0xfac7('0x39')],{'$or':_['map'](_0x596178[_0xfac7('0x35')],function(_0x5cc158){var _0x979a52={};_0x979a52[_0x5cc158]={'$like':'%'+_0x283f8c[_0xfac7('0x32')][_0xfac7('0x3c')]+'%'};return _0x979a52;})});}_0x596178[_0xfac7('0x39')]=_['merge'](_0x596178['where'],{'mailboxuser':_0x2f7c5b['mailbox']});_0x596178=_[_0xfac7('0x3d')]({},_0x596178,_0x283f8c[_0xfac7('0x3f')]);return db['VoiceMailMessage'][_0xfac7('0x53')](_0x596178)[_0xfac7('0x22')](respondWithFilteredResult(_0x23575f,_0x596178));})[_0xfac7('0x42')](handleError(_0x23575f,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index ca3f3c7..31d3e1b 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 _0xab77=['mailbox_context','mailbox','context','util','../../config/logger','moment','path','rimraf','../../config/environment','./voiceMail.attributes','define','VoiceMail'];(function(_0x288478,_0x23303e){var _0x234c05=function(_0x4ff5a5){while(--_0x4ff5a5){_0x288478['push'](_0x288478['shift']());}};_0x234c05(++_0x23303e);}(_0xab77,0x1e3));var _0x7ab7=function(_0x3f22e8,_0x37732a){_0x3f22e8=_0x3f22e8-0x0;var _0x368a7e=_0xab77[_0x3f22e8];return _0x368a7e;};'use strict';var _=require('lodash');var util=require(_0x7ab7('0x0'));var logger=require(_0x7ab7('0x1'))('api');var moment=require(_0x7ab7('0x2'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x7ab7('0x3'));var rimraf=require(_0x7ab7('0x4'));var config=require(_0x7ab7('0x5'));var attributes=require(_0x7ab7('0x6'));module['exports']=function(_0x29e3bf,_0x2e9d45){return _0x29e3bf[_0x7ab7('0x7')](_0x7ab7('0x8'),attributes,{'tableName':'voice_voicemail','paranoid':![],'indexes':[{'name':_0x7ab7('0x9'),'fields':[_0x7ab7('0xa'),_0x7ab7('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x4eb6=['VoiceMail','voice_voicemail','context','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x40c76b,_0x2ff0a8){var _0x2156d6=function(_0x5ef89b){while(--_0x5ef89b){_0x40c76b['push'](_0x40c76b['shift']());}};_0x2156d6(++_0x2ff0a8);}(_0x4eb6,0x1bf));var _0x64eb=function(_0x5efb2e,_0x58096b){_0x5efb2e=_0x5efb2e-0x0;var _0x544d0c=_0x4eb6[_0x5efb2e];return _0x544d0c;};'use strict';var _=require(_0x64eb('0x0'));var util=require(_0x64eb('0x1'));var logger=require(_0x64eb('0x2'))(_0x64eb('0x3'));var moment=require(_0x64eb('0x4'));var BPromise=require(_0x64eb('0x5'));var rp=require(_0x64eb('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x64eb('0x7'));var config=require(_0x64eb('0x8'));var attributes=require('./voiceMail.attributes');module['exports']=function(_0x11a856,_0x48a7e5){return _0x11a856['define'](_0x64eb('0x9'),attributes,{'tableName':_0x64eb('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox',_0x64eb('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 8699172..5eee279 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 _0x8bed=['info','VoiceMail,\x20%s,\x20%s','debug','request\x20sent','error','code','message','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x2db22a,_0xb3e94a){var _0x1680f9=function(_0x4727ed){while(--_0x4727ed){_0x2db22a['push'](_0x2db22a['shift']());}};_0x1680f9(++_0xb3e94a);}(_0x8bed,0xc4));var _0xd8be=function(_0x5c84a6,_0x321f95){_0x5c84a6=_0x5c84a6-0x0;var _0xb8c5f0=_0x8bed[_0x5c84a6];return _0xb8c5f0;};'use strict';var _=require(_0xd8be('0x0'));var util=require('util');var moment=require(_0xd8be('0x1'));var BPromise=require(_0xd8be('0x2'));var rs=require(_0xd8be('0x3'));var fs=require('fs');var Redis=require(_0xd8be('0x4'));var db=require(_0xd8be('0x5'))['db'];var utils=require(_0xd8be('0x6'));var logger=require(_0xd8be('0x7'))(_0xd8be('0x8'));var config=require(_0xd8be('0x9'));var jayson=require(_0xd8be('0xa'));var client=jayson[_0xd8be('0xb')][_0xd8be('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x224192,_0x5be847,_0x3f61d9){return new BPromise(function(_0x11f9c6,_0x4c2f65){return client[_0xd8be('0xd')](_0x224192,_0x3f61d9)['then'](function(_0x23ff2c){logger[_0xd8be('0xe')](_0xd8be('0xf'),_0x5be847,'request\x20sent');logger[_0xd8be('0x10')]('VoiceMail,\x20%s,\x20%s,\x20%s',_0x5be847,_0xd8be('0x11'),JSON['stringify'](_0x23ff2c));if(_0x23ff2c[_0xd8be('0x12')]){if(_0x23ff2c[_0xd8be('0x12')][_0xd8be('0x13')]===0x1f4){logger[_0xd8be('0x12')](_0xd8be('0xf'),_0x5be847,_0x23ff2c['error'][_0xd8be('0x14')]);return _0x4c2f65(_0x23ff2c[_0xd8be('0x12')]['message']);}logger['error'](_0xd8be('0xf'),_0x5be847,_0x23ff2c[_0xd8be('0x12')][_0xd8be('0x14')]);return _0x11f9c6(_0x23ff2c[_0xd8be('0x12')][_0xd8be('0x14')]);}else{logger['info'](_0xd8be('0xf'),_0x5be847,_0xd8be('0x11'));_0x11f9c6(_0x23ff2c['result'][_0xd8be('0x14')]);}})['catch'](function(_0x406d07){logger[_0xd8be('0x12')](_0xd8be('0xf'),_0x5be847,_0x406d07);_0x4c2f65(_0x406d07);});});} \ No newline at end of file +var _0x1bbf=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','error','code','message','lodash'];(function(_0x4e55a9,_0x241b22){var _0x4a9b67=function(_0x2a3bd1){while(--_0x2a3bd1){_0x4e55a9['push'](_0x4e55a9['shift']());}};_0x4a9b67(++_0x241b22);}(_0x1bbf,0x117));var _0xf1bb=function(_0xc7348b,_0x145880){_0xc7348b=_0xc7348b-0x0;var _0x307cec=_0x1bbf[_0xc7348b];return _0x307cec;};'use strict';var _=require(_0xf1bb('0x0'));var util=require(_0xf1bb('0x1'));var moment=require(_0xf1bb('0x2'));var BPromise=require(_0xf1bb('0x3'));var rs=require(_0xf1bb('0x4'));var fs=require('fs');var Redis=require(_0xf1bb('0x5'));var db=require(_0xf1bb('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xf1bb('0x7'));var config=require(_0xf1bb('0x8'));var jayson=require(_0xf1bb('0x9'));var client=jayson[_0xf1bb('0xa')][_0xf1bb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x8863a1,_0x56622e,_0x36c8a4){return new BPromise(function(_0x32d336,_0x3d56bb){return client[_0xf1bb('0xc')](_0x8863a1,_0x36c8a4)[_0xf1bb('0xd')](function(_0xdf075a){logger[_0xf1bb('0xe')](_0xf1bb('0xf'),_0x56622e,'request\x20sent');logger['debug']('VoiceMail,\x20%s,\x20%s,\x20%s',_0x56622e,_0xf1bb('0x10'),JSON['stringify'](_0xdf075a));if(_0xdf075a[_0xf1bb('0x11')]){if(_0xdf075a[_0xf1bb('0x11')][_0xf1bb('0x12')]===0x1f4){logger[_0xf1bb('0x11')](_0xf1bb('0xf'),_0x56622e,_0xdf075a['error'][_0xf1bb('0x13')]);return _0x3d56bb(_0xdf075a['error'][_0xf1bb('0x13')]);}logger[_0xf1bb('0x11')]('VoiceMail,\x20%s,\x20%s',_0x56622e,_0xdf075a['error'][_0xf1bb('0x13')]);return _0x32d336(_0xdf075a[_0xf1bb('0x11')]['message']);}else{logger[_0xf1bb('0xe')](_0xf1bb('0xf'),_0x56622e,_0xf1bb('0x10'));_0x32d336(_0xdf075a['result'][_0xf1bb('0x13')]);}})['catch'](function(_0x3429b7){logger['error'](_0xf1bb('0xf'),_0x56622e,_0x3429b7);_0x3d56bb(_0x3429b7);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 049f093..8d05f68 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 _0x4819=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMailMessage.controller','get','index','isAuthenticated','show','/:id/download','post','create','/:id','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x5046db,_0x5cb686){var _0x30cd5e=function(_0x2a9ea7){while(--_0x2a9ea7){_0x5046db['push'](_0x5046db['shift']());}};_0x30cd5e(++_0x5cb686);}(_0x4819,0xcd));var _0x9481=function(_0x2a2e72,_0x1de962){_0x2a2e72=_0x2a2e72-0x0;var _0x3cfb4a=_0x4819[_0x2a2e72];return _0x3cfb4a;};'use strict';var multer=require('multer');var util=require(_0x9481('0x0'));var path=require(_0x9481('0x1'));var timeout=require(_0x9481('0x2'));var express=require(_0x9481('0x3'));var router=express[_0x9481('0x4')]();var auth=require(_0x9481('0x5'));var interaction=require(_0x9481('0x6'));var config=require(_0x9481('0x7'));var controller=require(_0x9481('0x8'));router[_0x9481('0x9')]('/',auth['isAuthenticated'](),controller[_0x9481('0xa')]);router['get']('/:id',auth[_0x9481('0xb')](),controller[_0x9481('0xc')]);router[_0x9481('0x9')](_0x9481('0xd'),auth[_0x9481('0xb')](),controller['download']);router[_0x9481('0xe')]('/',auth['isAuthenticated'](),controller[_0x9481('0xf')]);router['put'](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x11')]);router[_0x9481('0x12')](_0x9481('0x10'),auth[_0x9481('0xb')](),controller[_0x9481('0x13')]);module[_0x9481('0x14')]=router; \ No newline at end of file +var _0x187d=['../../components/auth/service','../../components/interaction/service','./voiceMailMessage.controller','get','index','/:id','isAuthenticated','show','/:id/download','post','create','put','delete','exports','multer','path','connect-timeout','express','Router'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0x187d,0x93));var _0xd187=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x187d[_0x5c351c];return _0x26f3b3;};'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['download']);router[_0xd187('0xe')]('/',auth[_0xd187('0xb')](),controller[_0xd187('0xf')]);router[_0xd187('0x10')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['update']);router[_0xd187('0x11')](_0xd187('0xa'),auth[_0xd187('0xb')](),controller['destroy']);module[_0xd187('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index eb02655..5b7827a 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 _0x7063=['STRING','BLOB','TIMESTAMP','sequelize','getDataValue','INTEGER'];(function(_0x1f9f5f,_0x509fb7){var _0x51d649=function(_0x4a5285){while(--_0x4a5285){_0x1f9f5f['push'](_0x1f9f5f['shift']());}};_0x51d649(++_0x509fb7);}(_0x7063,0xed));var _0x3706=function(_0x33c7ab,_0x34a4aa){_0x33c7ab=_0x33c7ab-0x0;var _0x51d828=_0x7063[_0x33c7ab];return _0x51d828;};'use strict';var Sequelize=require(_0x3706('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x401b5a){return this[_0x3706('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x3706('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3706('0x4')]('long'),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3706('0x3')],'defaultValue':''},'stamp':{'type':_0x3706('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x08bd=['sequelize','exports','VIRTUAL','getDataValue','INTEGER','STRING','BLOB','long','TIMESTAMP'];(function(_0x4a9129,_0x11dc6b){var _0x17b324=function(_0xc146f4){while(--_0xc146f4){_0x4a9129['push'](_0x4a9129['shift']());}};_0x17b324(++_0x11dc6b);}(_0x08bd,0xc6));var _0xd08b=function(_0x21cb18,_0x158d73){_0x21cb18=_0x21cb18-0x0;var _0x49e644=_0x08bd[_0x21cb18];return _0x49e644;};'use strict';var Sequelize=require(_0xd08b('0x0'));module[_0xd08b('0x1')]={'name':{'type':Sequelize[_0xd08b('0x2')],'get':function(_0x44e31c){return this[_0xd08b('0x3')]('id');}},'msgnum':{'type':Sequelize[_0xd08b('0x4')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize['STRING'],'defaultValue':''},'context':{'type':Sequelize[_0xd08b('0x5')],'defaultValue':''},'macrocontext':{'type':Sequelize['STRING'],'defaultValue':''},'callerid':{'type':Sequelize['STRING'],'defaultValue':''},'origtime':{'type':Sequelize[_0xd08b('0x5')],'defaultValue':''},'duration':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0xd08b('0x5')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd08b('0x5')],'defaultValue':''},'recording':{'type':Sequelize[_0xd08b('0x6')](_0xd08b('0x7')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd08b('0x5')],'defaultValue':''},'stamp':{'type':_0xd08b('0x8'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index 14d929f..c667ae5 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 _0x3baf=['sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','then','error','stack','send','VoiceMailMessage','rawAttributes','fieldName','type','map','name','query','filters','intersection','model','attributes','fields','length','nolimit','sort','pick','filter','where','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','merge','find','catch','create','body','destroy','download','msg_id','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','.wav\x22','set','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path'];(function(_0x55c979,_0x36c5f0){var _0x690107=function(_0xa61dad){while(--_0xa61dad){_0x55c979['push'](_0x55c979['shift']());}};_0x690107(++_0x36c5f0);}(_0x3baf,0xf7));var _0xf3ba=function(_0x5628b2,_0x223018){_0x5628b2=_0x5628b2-0x0;var _0x2174a7=_0x3baf[_0x5628b2];return _0x2174a7;};'use strict';var pdf=require(_0xf3ba('0x0'));var emlformat=require(_0xf3ba('0x1'));var rimraf=require(_0xf3ba('0x2'));var zipdir=require(_0xf3ba('0x3'));var jsonpatch=require(_0xf3ba('0x4'));var rp=require(_0xf3ba('0x5'));var moment=require(_0xf3ba('0x6'));var BPromise=require(_0xf3ba('0x7'));var Mustache=require(_0xf3ba('0x8'));var util=require(_0xf3ba('0x9'));var path=require(_0xf3ba('0xa'));var sox=require(_0xf3ba('0xb'));var csv=require(_0xf3ba('0xc'));var ejs=require(_0xf3ba('0xd'));var fs=require('fs');var _=require(_0xf3ba('0xe'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf3ba('0xf'));var toCsv=require('to-csv');var querystring=require(_0xf3ba('0x10'));var Papa=require(_0xf3ba('0x11'));var Redis=require(_0xf3ba('0x12'));var authService=require(_0xf3ba('0x13'));var qs=require(_0xf3ba('0x14'));var as=require(_0xf3ba('0x15'));var hardwareService=require(_0xf3ba('0x16'));var logger=require(_0xf3ba('0x17'))(_0xf3ba('0x18'));var utils=require(_0xf3ba('0x19'));var config=require(_0xf3ba('0x1a'));var db=require(_0xf3ba('0x1b'))['db'];function respondWithStatusCode(_0x46c2cf,_0x85939e){_0x85939e=_0x85939e||0xcc;return function(_0x26cefe){if(_0x26cefe){return _0x46c2cf[_0xf3ba('0x1c')](_0x85939e);}return _0x46c2cf[_0xf3ba('0x1d')](_0x85939e)[_0xf3ba('0x1e')]();};}function respondWithResult(_0x505b8d,_0x327675){_0x327675=_0x327675||0xc8;return function(_0x56816b){if(_0x56816b){return _0x505b8d[_0xf3ba('0x1d')](_0x327675)[_0xf3ba('0x1f')](_0x56816b);}};}function respondWithFilteredResult(_0x4717be,_0x1e2969){return function(_0x235c8a){if(_0x235c8a){var _0x53f848=_0x235c8a['count'],_0x301856=_0x1e2969[_0xf3ba('0x20')],_0x29e45b=_0x1e2969[_0xf3ba('0x20')]+_0x1e2969[_0xf3ba('0x21')],_0x13d899;if(_0x29e45b>=_0x53f848){_0x29e45b=_0x53f848;_0x13d899=0xc8;}else{_0x13d899=0xce;}_0x4717be[_0xf3ba('0x1d')](_0x13d899);return _0x4717be['set'](_0xf3ba('0x22'),_0x301856+'-'+_0x29e45b+'/'+_0x53f848)[_0xf3ba('0x1f')](_0x235c8a);}return null;};}function patchUpdates(_0x4e601c){return function(_0x479d65){try{jsonpatch[_0xf3ba('0x23')](_0x479d65,_0x4e601c,!![]);}catch(_0x2bd5b8){return BPromise[_0xf3ba('0x24')](_0x2bd5b8);}return _0x479d65['save']();};}function saveUpdates(_0x375bcf,_0x327723){return function(_0x35d6d4){if(_0x35d6d4){return _0x35d6d4[_0xf3ba('0x25')](_0x375bcf)[_0xf3ba('0x26')](function(_0x3480cb){return _0x3480cb;});}return null;};}function removeEntity(_0x168961,_0x4caf74){return function(_0x4e94a7){if(_0x4e94a7){return _0x4e94a7['destroy']()[_0xf3ba('0x26')](function(){_0x168961[_0xf3ba('0x1d')](0xcc)[_0xf3ba('0x1e')]();});}};}function handleEntityNotFound(_0x3b6404,_0x2cc01a){return function(_0x545ee1){if(!_0x545ee1){_0x3b6404['sendStatus'](0x194);}return _0x545ee1;};}function handleError(_0x37fdda,_0xd6c2da){_0xd6c2da=_0xd6c2da||0x1f4;return function(_0x5410a2){logger[_0xf3ba('0x27')](_0x5410a2[_0xf3ba('0x28')]);if(_0x5410a2['name']){delete _0x5410a2['name'];}_0x37fdda[_0xf3ba('0x1d')](_0xd6c2da)[_0xf3ba('0x29')](_0x5410a2);};}exports['index']=function(_0x18a4fb,_0x318817){var _0x15ac44={},_0x5a880e={},_0x29ed57={'count':0x0,'rows':[]};var _0x4e1708=_['map'](db[_0xf3ba('0x2a')][_0xf3ba('0x2b')],function(_0x5b4e0d){return{'name':_0x5b4e0d[_0xf3ba('0x2c')],'type':_0x5b4e0d[_0xf3ba('0x2d')]['key']};});_0x5a880e['model']=_['differenceBy'](_[_0xf3ba('0x2e')](_0x4e1708,_0xf3ba('0x2f')),['name']);_0x5a880e[_0xf3ba('0x30')]=_['keys'](_0x18a4fb['query']);_0x5a880e[_0xf3ba('0x31')]=_[_0xf3ba('0x32')](_0x5a880e[_0xf3ba('0x33')],_0x5a880e[_0xf3ba('0x30')]);_0x15ac44[_0xf3ba('0x34')]=_[_0xf3ba('0x32')](_0x5a880e['model'],qs[_0xf3ba('0x35')](_0x18a4fb['query'][_0xf3ba('0x35')]));_0x15ac44[_0xf3ba('0x34')]=_0x15ac44['attributes'][_0xf3ba('0x36')]?_0x15ac44[_0xf3ba('0x34')]:_0x5a880e[_0xf3ba('0x33')];if(!_0x18a4fb[_0xf3ba('0x30')]['hasOwnProperty'](_0xf3ba('0x37'))){_0x15ac44['limit']=qs['limit'](_0x18a4fb['query'][_0xf3ba('0x21')]);_0x15ac44[_0xf3ba('0x20')]=qs[_0xf3ba('0x20')](_0x18a4fb[_0xf3ba('0x30')][_0xf3ba('0x20')]);}_0x15ac44['order']=qs[_0xf3ba('0x38')](_0x18a4fb['query'][_0xf3ba('0x38')]);_0x15ac44['where']=qs[_0xf3ba('0x31')](_[_0xf3ba('0x39')](_0x18a4fb[_0xf3ba('0x30')],_0x5a880e[_0xf3ba('0x31')]));if(_0x18a4fb['query'][_0xf3ba('0x3a')]){_0x15ac44[_0xf3ba('0x3b')]=_['merge'](_0x15ac44[_0xf3ba('0x3b')],{'$or':_[_0xf3ba('0x2e')](_0x4e1708,function(_0x3f60bf){if(_0x3f60bf[_0xf3ba('0x2d')]!==_0xf3ba('0x3c')){var _0x196ab2={};_0x196ab2[_0x3f60bf[_0xf3ba('0x2f')]]={'$like':'%'+_0x18a4fb['query'][_0xf3ba('0x3a')]+'%'};return _0x196ab2;}})});}_0x15ac44=_['merge']({},_0x15ac44,_0x18a4fb[_0xf3ba('0x3d')]);var _0x5a5ed3={'where':_0x15ac44[_0xf3ba('0x3b')]};return db[_0xf3ba('0x2a')][_0xf3ba('0x3e')](_0x5a5ed3)[_0xf3ba('0x26')](function(_0x2cbfca){_0x29ed57['count']=_0x2cbfca;if(_0x18a4fb['query'][_0xf3ba('0x3f')]){_0x15ac44[_0xf3ba('0x40')]=[{'all':!![]}];}return db[_0xf3ba('0x2a')][_0xf3ba('0x41')](_0x15ac44);})[_0xf3ba('0x26')](function(_0x3506cb){_0x29ed57['rows']=_0x3506cb;return _0x29ed57;})[_0xf3ba('0x26')](respondWithFilteredResult(_0x318817,_0x15ac44))['catch'](handleError(_0x318817,null));};exports[_0xf3ba('0x42')]=function(_0x239e2a,_0x2328d5){var _0xa7fd7f={'raw':!![],'where':{'id':_0x239e2a[_0xf3ba('0x43')]['id']}},_0x25f68e={};_0x25f68e[_0xf3ba('0x33')]=_[_0xf3ba('0x44')](db['VoiceMailMessage'][_0xf3ba('0x2b')]);_0x25f68e[_0xf3ba('0x30')]=_[_0xf3ba('0x44')](_0x239e2a[_0xf3ba('0x30')]);_0x25f68e[_0xf3ba('0x31')]=_[_0xf3ba('0x32')](_0x25f68e[_0xf3ba('0x33')],_0x25f68e['query']);_0xa7fd7f[_0xf3ba('0x34')]=_[_0xf3ba('0x32')](_0x25f68e['model'],qs[_0xf3ba('0x35')](_0x239e2a[_0xf3ba('0x30')][_0xf3ba('0x35')]));_0xa7fd7f[_0xf3ba('0x34')]=_0xa7fd7f[_0xf3ba('0x34')][_0xf3ba('0x36')]?_0xa7fd7f[_0xf3ba('0x34')]:_0x25f68e[_0xf3ba('0x33')];if(_0x239e2a[_0xf3ba('0x30')][_0xf3ba('0x3f')]){_0xa7fd7f[_0xf3ba('0x40')]=[{'all':!![]}];}_0xa7fd7f=_[_0xf3ba('0x45')]({},_0xa7fd7f,_0x239e2a[_0xf3ba('0x3d')]);return db[_0xf3ba('0x2a')][_0xf3ba('0x46')](_0xa7fd7f)[_0xf3ba('0x26')](handleEntityNotFound(_0x2328d5,null))[_0xf3ba('0x26')](respondWithResult(_0x2328d5,null))[_0xf3ba('0x47')](handleError(_0x2328d5,null));};exports['create']=function(_0x10d30d,_0x1a0df2){return db['VoiceMailMessage'][_0xf3ba('0x48')](_0x10d30d[_0xf3ba('0x49')],{})[_0xf3ba('0x26')](respondWithResult(_0x1a0df2,0xc9))[_0xf3ba('0x47')](handleError(_0x1a0df2,null));};exports['update']=function(_0x5d0e2a,_0x28ca9b){if(_0x5d0e2a[_0xf3ba('0x49')]['id']){delete _0x5d0e2a[_0xf3ba('0x49')]['id'];}return db[_0xf3ba('0x2a')]['find']({'where':{'id':_0x5d0e2a[_0xf3ba('0x43')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x28ca9b,null))[_0xf3ba('0x26')](saveUpdates(_0x5d0e2a['body'],null))[_0xf3ba('0x26')](respondWithResult(_0x28ca9b,null))[_0xf3ba('0x47')](handleError(_0x28ca9b,null));};exports[_0xf3ba('0x4a')]=function(_0x3639d2,_0x18f913){return db[_0xf3ba('0x2a')][_0xf3ba('0x46')]({'where':{'id':_0x3639d2[_0xf3ba('0x43')]['id']}})[_0xf3ba('0x26')](handleEntityNotFound(_0x18f913,null))[_0xf3ba('0x26')](removeEntity(_0x18f913,null))['catch'](handleError(_0x18f913,null));};exports[_0xf3ba('0x4b')]=function(_0x40c70c,_0x41c4c6,_0x3bbf79){return db['VoiceMailMessage'][_0xf3ba('0x46')]({'where':{'id':_0x40c70c['params']['id']},'attributes':['id','recording',_0xf3ba('0x4c')]})[_0xf3ba('0x26')](handleEntityNotFound(_0x41c4c6,null))[_0xf3ba('0x26')](function(_0x1fc9e6){if(_0x1fc9e6){if(!_0x1fc9e6[_0xf3ba('0x4d')]){throw new db[(_0xf3ba('0x4e'))][(_0xf3ba('0x4f'))](_0xf3ba('0x50'));}var _0x557fbd={'Content-Type':_0xf3ba('0x51'),'Content-Disposition':_0xf3ba('0x52')};if(_0x1fc9e6[_0xf3ba('0x4c')]){_0x557fbd[_0xf3ba('0x53')]='attachment;\x20filename=\x22'+_0x1fc9e6['msg_id']+_0xf3ba('0x54');}_0x41c4c6[_0xf3ba('0x55')](_0x557fbd);return _0x41c4c6[_0xf3ba('0x29')](new Buffer(_0x1fc9e6[_0xf3ba('0x4d')]));}})[_0xf3ba('0x47')](handleError(_0x41c4c6,null));}; \ No newline at end of file +var _0x6334=['name','send','index','map','VoiceMailMessage','rawAttributes','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','keys','find','body','update','download','recording','msg_id','audio/wav','attachment','attachment;\x20filename=\x22','.wav\x22','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','json','count','offset','limit','status','set','Content-Range','apply','save','then','destroy','sendStatus','error','stack'];(function(_0x166ffe,_0x18d679){var _0xce9717=function(_0x5d21de){while(--_0x5d21de){_0x166ffe['push'](_0x166ffe['shift']());}};_0xce9717(++_0x18d679);}(_0x6334,0x119));var _0x4633=function(_0x39ff5c,_0x3de001){_0x39ff5c=_0x39ff5c-0x0;var _0x1eba54=_0x6334[_0x39ff5c];return _0x1eba54;};'use strict';var pdf=require(_0x4633('0x0'));var emlformat=require(_0x4633('0x1'));var rimraf=require(_0x4633('0x2'));var zipdir=require(_0x4633('0x3'));var jsonpatch=require(_0x4633('0x4'));var rp=require(_0x4633('0x5'));var moment=require('moment');var BPromise=require(_0x4633('0x6'));var Mustache=require(_0x4633('0x7'));var util=require(_0x4633('0x8'));var path=require(_0x4633('0x9'));var sox=require(_0x4633('0xa'));var csv=require(_0x4633('0xb'));var ejs=require(_0x4633('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4633('0xd'));var crypto=require('crypto');var jsforce=require(_0x4633('0xe'));var deskjs=require(_0x4633('0xf'));var toCsv=require('to-csv');var querystring=require(_0x4633('0x10'));var Papa=require(_0x4633('0x11'));var Redis=require(_0x4633('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x4633('0x13'));var as=require(_0x4633('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4633('0x15'))(_0x4633('0x16'));var utils=require(_0x4633('0x17'));var config=require(_0x4633('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x73b5e4,_0xad405){_0xad405=_0xad405||0xcc;return function(_0x438e87){if(_0x438e87){return _0x73b5e4['sendStatus'](_0xad405);}return _0x73b5e4['status'](_0xad405)['end']();};}function respondWithResult(_0x28e2bc,_0x1fd00c){_0x1fd00c=_0x1fd00c||0xc8;return function(_0x579229){if(_0x579229){return _0x28e2bc['status'](_0x1fd00c)[_0x4633('0x19')](_0x579229);}};}function respondWithFilteredResult(_0x4813c5,_0xcdffcc){return function(_0x33b6e7){if(_0x33b6e7){var _0x2e2dc3=_0x33b6e7[_0x4633('0x1a')],_0x11fef9=_0xcdffcc[_0x4633('0x1b')],_0x5358a3=_0xcdffcc['offset']+_0xcdffcc[_0x4633('0x1c')],_0x2c38e5;if(_0x5358a3>=_0x2e2dc3){_0x5358a3=_0x2e2dc3;_0x2c38e5=0xc8;}else{_0x2c38e5=0xce;}_0x4813c5[_0x4633('0x1d')](_0x2c38e5);return _0x4813c5[_0x4633('0x1e')](_0x4633('0x1f'),_0x11fef9+'-'+_0x5358a3+'/'+_0x2e2dc3)[_0x4633('0x19')](_0x33b6e7);}return null;};}function patchUpdates(_0x5953b8){return function(_0x4691f2){try{jsonpatch[_0x4633('0x20')](_0x4691f2,_0x5953b8,!![]);}catch(_0x5c295d){return BPromise['reject'](_0x5c295d);}return _0x4691f2[_0x4633('0x21')]();};}function saveUpdates(_0x49e5c7,_0x35e2ad){return function(_0x5b5011){if(_0x5b5011){return _0x5b5011['update'](_0x49e5c7)[_0x4633('0x22')](function(_0x177b39){return _0x177b39;});}return null;};}function removeEntity(_0x23bc5e,_0x604f3d){return function(_0xd1fcc6){if(_0xd1fcc6){return _0xd1fcc6[_0x4633('0x23')]()['then'](function(){_0x23bc5e[_0x4633('0x1d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22d9c1,_0xcfac3f){return function(_0xe77cfc){if(!_0xe77cfc){_0x22d9c1[_0x4633('0x24')](0x194);}return _0xe77cfc;};}function handleError(_0x45db49,_0x49880a){_0x49880a=_0x49880a||0x1f4;return function(_0x3af747){logger[_0x4633('0x25')](_0x3af747[_0x4633('0x26')]);if(_0x3af747[_0x4633('0x27')]){delete _0x3af747[_0x4633('0x27')];}_0x45db49[_0x4633('0x1d')](_0x49880a)[_0x4633('0x28')](_0x3af747);};}exports[_0x4633('0x29')]=function(_0xef2ecf,_0x7d7f2){var _0x1b9ed8={},_0x2539a2={},_0x1fdc67={'count':0x0,'rows':[]};var _0x2970a6=_[_0x4633('0x2a')](db[_0x4633('0x2b')][_0x4633('0x2c')],function(_0x139e5e){return{'name':_0x139e5e['fieldName'],'type':_0x139e5e[_0x4633('0x2d')][_0x4633('0x2e')]};});_0x2539a2[_0x4633('0x2f')]=_[_0x4633('0x30')](_[_0x4633('0x2a')](_0x2970a6,_0x4633('0x27')),['name']);_0x2539a2[_0x4633('0x31')]=_['keys'](_0xef2ecf[_0x4633('0x31')]);_0x2539a2[_0x4633('0x32')]=_[_0x4633('0x33')](_0x2539a2[_0x4633('0x2f')],_0x2539a2[_0x4633('0x31')]);_0x1b9ed8[_0x4633('0x34')]=_[_0x4633('0x33')](_0x2539a2[_0x4633('0x2f')],qs[_0x4633('0x35')](_0xef2ecf[_0x4633('0x31')][_0x4633('0x35')]));_0x1b9ed8[_0x4633('0x34')]=_0x1b9ed8[_0x4633('0x34')][_0x4633('0x36')]?_0x1b9ed8['attributes']:_0x2539a2['model'];if(!_0xef2ecf[_0x4633('0x31')][_0x4633('0x37')]('nolimit')){_0x1b9ed8[_0x4633('0x1c')]=qs[_0x4633('0x1c')](_0xef2ecf[_0x4633('0x31')][_0x4633('0x1c')]);_0x1b9ed8['offset']=qs[_0x4633('0x1b')](_0xef2ecf['query'][_0x4633('0x1b')]);}_0x1b9ed8[_0x4633('0x38')]=qs[_0x4633('0x39')](_0xef2ecf[_0x4633('0x31')][_0x4633('0x39')]);_0x1b9ed8[_0x4633('0x3a')]=qs[_0x4633('0x32')](_[_0x4633('0x3b')](_0xef2ecf['query'],_0x2539a2[_0x4633('0x32')]));if(_0xef2ecf[_0x4633('0x31')]['filter']){_0x1b9ed8[_0x4633('0x3a')]=_[_0x4633('0x3c')](_0x1b9ed8[_0x4633('0x3a')],{'$or':_[_0x4633('0x2a')](_0x2970a6,function(_0x47d574){if(_0x47d574['type']!==_0x4633('0x3d')){var _0x4d54ae={};_0x4d54ae[_0x47d574['name']]={'$like':'%'+_0xef2ecf[_0x4633('0x31')]['filter']+'%'};return _0x4d54ae;}})});}_0x1b9ed8=_['merge']({},_0x1b9ed8,_0xef2ecf[_0x4633('0x3e')]);var _0x433d2d={'where':_0x1b9ed8[_0x4633('0x3a')]};return db[_0x4633('0x2b')][_0x4633('0x1a')](_0x433d2d)['then'](function(_0x6873d0){_0x1fdc67['count']=_0x6873d0;if(_0xef2ecf[_0x4633('0x31')][_0x4633('0x3f')]){_0x1b9ed8[_0x4633('0x40')]=[{'all':!![]}];}return db[_0x4633('0x2b')]['findAll'](_0x1b9ed8);})[_0x4633('0x22')](function(_0x5c9975){_0x1fdc67[_0x4633('0x41')]=_0x5c9975;return _0x1fdc67;})[_0x4633('0x22')](respondWithFilteredResult(_0x7d7f2,_0x1b9ed8))[_0x4633('0x42')](handleError(_0x7d7f2,null));};exports[_0x4633('0x43')]=function(_0x350e46,_0x4d399f){var _0x4de806={'raw':!![],'where':{'id':_0x350e46[_0x4633('0x44')]['id']}},_0x2e071f={};_0x2e071f[_0x4633('0x2f')]=_[_0x4633('0x45')](db[_0x4633('0x2b')]['rawAttributes']);_0x2e071f[_0x4633('0x31')]=_['keys'](_0x350e46[_0x4633('0x31')]);_0x2e071f['filters']=_[_0x4633('0x33')](_0x2e071f['model'],_0x2e071f[_0x4633('0x31')]);_0x4de806[_0x4633('0x34')]=_[_0x4633('0x33')](_0x2e071f[_0x4633('0x2f')],qs[_0x4633('0x35')](_0x350e46[_0x4633('0x31')][_0x4633('0x35')]));_0x4de806[_0x4633('0x34')]=_0x4de806[_0x4633('0x34')][_0x4633('0x36')]?_0x4de806[_0x4633('0x34')]:_0x2e071f[_0x4633('0x2f')];if(_0x350e46[_0x4633('0x31')][_0x4633('0x3f')]){_0x4de806[_0x4633('0x40')]=[{'all':!![]}];}_0x4de806=_[_0x4633('0x3c')]({},_0x4de806,_0x350e46[_0x4633('0x3e')]);return db[_0x4633('0x2b')][_0x4633('0x46')](_0x4de806)[_0x4633('0x22')](handleEntityNotFound(_0x4d399f,null))[_0x4633('0x22')](respondWithResult(_0x4d399f,null))['catch'](handleError(_0x4d399f,null));};exports['create']=function(_0x174b3e,_0x4bedf5){return db['VoiceMailMessage']['create'](_0x174b3e[_0x4633('0x47')],{})[_0x4633('0x22')](respondWithResult(_0x4bedf5,0xc9))['catch'](handleError(_0x4bedf5,null));};exports[_0x4633('0x48')]=function(_0xda14a3,_0x3d6ca6){if(_0xda14a3[_0x4633('0x47')]['id']){delete _0xda14a3[_0x4633('0x47')]['id'];}return db[_0x4633('0x2b')]['find']({'where':{'id':_0xda14a3['params']['id']}})['then'](handleEntityNotFound(_0x3d6ca6,null))[_0x4633('0x22')](saveUpdates(_0xda14a3[_0x4633('0x47')],null))[_0x4633('0x22')](respondWithResult(_0x3d6ca6,null))['catch'](handleError(_0x3d6ca6,null));};exports[_0x4633('0x23')]=function(_0x1aa16c,_0x55f204){return db[_0x4633('0x2b')][_0x4633('0x46')]({'where':{'id':_0x1aa16c[_0x4633('0x44')]['id']}})['then'](handleEntityNotFound(_0x55f204,null))['then'](removeEntity(_0x55f204,null))[_0x4633('0x42')](handleError(_0x55f204,null));};exports[_0x4633('0x49')]=function(_0x457801,_0x4222d,_0x129f87){return db['VoiceMailMessage'][_0x4633('0x46')]({'where':{'id':_0x457801[_0x4633('0x44')]['id']},'attributes':['id',_0x4633('0x4a'),_0x4633('0x4b')]})[_0x4633('0x22')](handleEntityNotFound(_0x4222d,null))[_0x4633('0x22')](function(_0x5659ed){if(_0x5659ed){if(!_0x5659ed[_0x4633('0x4a')]){throw new db['Sequelize']['ValidationError']('VoiceMailMessage\x20not\x20found');}var _0x3cb268={'Content-Type':_0x4633('0x4c'),'Content-Disposition':_0x4633('0x4d')};if(_0x5659ed[_0x4633('0x4b')]){_0x3cb268['Content-Disposition']=_0x4633('0x4e')+_0x5659ed['msg_id']+_0x4633('0x4f');}_0x4222d[_0x4633('0x1e')](_0x3cb268);return _0x4222d[_0x4633('0x28')](new Buffer(_0x5659ed[_0x4633('0x4a')]));}})[_0x4633('0x42')](handleError(_0x4222d,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 4b06962..65635af 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 _0x4db3=['path','rimraf','../../config/environment','./voiceMailMessage.attributes','exports','define','VoiceMailMessage','dir','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4f5555,_0xfb5883){var _0x484067=function(_0x208072){while(--_0x208072){_0x4f5555['push'](_0x4f5555['shift']());}};_0x484067(++_0xfb5883);}(_0x4db3,0x18e));var _0x34db=function(_0x2e2158,_0x2778d7){_0x2e2158=_0x2e2158-0x0;var _0x4f6ece=_0x4db3[_0x2e2158];return _0x4f6ece;};'use strict';var _=require(_0x34db('0x0'));var util=require(_0x34db('0x1'));var logger=require(_0x34db('0x2'))(_0x34db('0x3'));var moment=require(_0x34db('0x4'));var BPromise=require(_0x34db('0x5'));var rp=require(_0x34db('0x6'));var fs=require('fs');var path=require(_0x34db('0x7'));var rimraf=require(_0x34db('0x8'));var config=require(_0x34db('0x9'));var attributes=require(_0x34db('0xa'));module[_0x34db('0xb')]=function(_0x4e0907,_0x25e118){return _0x4e0907[_0x34db('0xc')](_0x34db('0xd'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0x34db('0xe'),'fields':['dir']}],'timestamps':![]});}; \ No newline at end of file +var _0x8d9f=['dir','lodash','../../config/logger','api','moment','path','rimraf','../../config/environment','define','VoiceMailMessage'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8d9f,0xc9));var _0xf8d9=function(_0x21c049,_0x2bd4c4){_0x21c049=_0x21c049-0x0;var _0x2e2dcb=_0x8d9f[_0x21c049];return _0x2e2dcb;};'use strict';var _=require(_0xf8d9('0x0'));var util=require('util');var logger=require(_0xf8d9('0x1'))(_0xf8d9('0x2'));var moment=require(_0xf8d9('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xf8d9('0x4'));var rimraf=require(_0xf8d9('0x5'));var config=require(_0xf8d9('0x6'));var attributes=require('./voiceMailMessage.attributes');module['exports']=function(_0x1fc75b,_0x42beee){return _0x1fc75b[_0xf8d9('0x7')](_0xf8d9('0x8'),attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':_0xf8d9('0x9'),'fields':[_0xf8d9('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 5f396c4..d03521c 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 _0x0295=['client','http','then','info','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xcdf515,_0x1f7355){var _0x66a12=function(_0x4c1448){while(--_0x4c1448){_0xcdf515['push'](_0xcdf515['shift']());}};_0x66a12(++_0x1f7355);}(_0x0295,0x1f0));var _0x5029=function(_0x1aad88,_0x551794){_0x1aad88=_0x1aad88-0x0;var _0x1bbfe9=_0x0295[_0x1aad88];return _0x1bbfe9;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x5029('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5029('0x2'))['db'];var utils=require(_0x5029('0x3'));var logger=require(_0x5029('0x4'))(_0x5029('0x5'));var config=require(_0x5029('0x6'));var jayson=require(_0x5029('0x7'));var client=jayson[_0x5029('0x8')][_0x5029('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3cd,_0x502a62,_0x54978f){return new BPromise(function(_0x4ee867,_0xf4459b){return client['request'](_0x5b3cd,_0x54978f)[_0x5029('0xa')](function(_0x5bccfc){logger[_0x5029('0xb')]('VoiceMailMessage,\x20%s,\x20%s',_0x502a62,_0x5029('0xc'));logger[_0x5029('0xd')](_0x5029('0xe'),_0x502a62,'request\x20sent',JSON[_0x5029('0xf')](_0x5bccfc));if(_0x5bccfc[_0x5029('0x10')]){if(_0x5bccfc[_0x5029('0x10')]['code']===0x1f4){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc['error']['message']);return _0xf4459b(_0x5bccfc['error']['message']);}logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);return _0x4ee867(_0x5bccfc[_0x5029('0x10')][_0x5029('0x12')]);}else{logger[_0x5029('0xb')](_0x5029('0x11'),_0x502a62,_0x5029('0xc'));_0x4ee867(_0x5bccfc[_0x5029('0x13')][_0x5029('0x12')]);}})[_0x5029('0x14')](function(_0x3786b5){logger[_0x5029('0x10')](_0x5029('0x11'),_0x502a62,_0x3786b5);_0xf4459b(_0x3786b5);});});} \ No newline at end of file +var _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x7cbc3c,_0x2bad4d){var _0x4c4433=function(_0x3f6cbd){while(--_0x3f6cbd){_0x7cbc3c['push'](_0x7cbc3c['shift']());}};_0x4c4433(++_0x2bad4d);}(_0xda2d,0x102));var _0xdda2=function(_0x152a4c,_0x51af45){_0x152a4c=_0x152a4c-0x0;var _0x148161=_0xda2d[_0x152a4c];return _0x148161;};'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']('VoiceMailMessage,\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')]('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 1e6e7f7..a1558f6 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 _0x6d0c=['connect-timeout','Router','../../components/auth/service','../../config/environment','./voiceMusicOnHold.controller','get','/:id','isAuthenticated','show','/:id/sounds','getSounds','post','put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path'];(function(_0x25e7cb,_0x3579b7){var _0x375d92=function(_0xe8cf3b){while(--_0xe8cf3b){_0x25e7cb['push'](_0x25e7cb['shift']());}};_0x375d92(++_0x3579b7);}(_0x6d0c,0xd0));var _0xc6d0=function(_0x20bb80,_0x106e78){_0x20bb80=_0x20bb80-0x0;var _0x3acd35=_0x6d0c[_0x20bb80];return _0x3acd35;};'use strict';var multer=require(_0xc6d0('0x0'));var util=require('util');var path=require(_0xc6d0('0x1'));var timeout=require(_0xc6d0('0x2'));var express=require('express');var router=express[_0xc6d0('0x3')]();var auth=require(_0xc6d0('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xc6d0('0x5'));var controller=require(_0xc6d0('0x6'));router[_0xc6d0('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0xc6d0('0x7')](_0xc6d0('0x8'),auth[_0xc6d0('0x9')](),controller[_0xc6d0('0xa')]);router[_0xc6d0('0x7')](_0xc6d0('0xb'),auth['isAuthenticated'](),controller[_0xc6d0('0xc')]);router[_0xc6d0('0xd')]('/',auth[_0xc6d0('0x9')](),controller['create']);router[_0xc6d0('0xd')]('/:id/sounds',auth[_0xc6d0('0x9')](),controller['addSound']);router[_0xc6d0('0xe')](_0xc6d0('0x8'),auth[_0xc6d0('0x9')](),controller[_0xc6d0('0xf')]);router[_0xc6d0('0x10')]('/:id',auth[_0xc6d0('0x9')](),controller[_0xc6d0('0x11')]);router['delete'](_0xc6d0('0x12'),auth[_0xc6d0('0x9')](),controller[_0xc6d0('0x13')]);module[_0xc6d0('0x14')]=router; \ No newline at end of file +var _0x0b20=['put','update','delete','destroy','/:id/sounds/:id2','removeSound','exports','multer','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceMusicOnHold.controller','get','index','/:id','isAuthenticated','getSounds','create','post','/:id/sounds','addSound'];(function(_0x168c02,_0x541f94){var _0x2799f6=function(_0x593640){while(--_0x593640){_0x168c02['push'](_0x168c02['shift']());}};_0x2799f6(++_0x541f94);}(_0x0b20,0x160));var _0x00b2=function(_0x529457,_0x562fa9){_0x529457=_0x529457-0x0;var _0x19e27e=_0x0b20[_0x529457];return _0x19e27e;};'use strict';var multer=require(_0x00b2('0x0'));var util=require('util');var path=require(_0x00b2('0x1'));var timeout=require(_0x00b2('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x00b2('0x3'));var interaction=require(_0x00b2('0x4'));var config=require(_0x00b2('0x5'));var controller=require(_0x00b2('0x6'));router[_0x00b2('0x7')]('/',auth['isAuthenticated'](),controller[_0x00b2('0x8')]);router['get'](_0x00b2('0x9'),auth['isAuthenticated'](),controller['show']);router[_0x00b2('0x7')]('/:id/sounds',auth[_0x00b2('0xa')](),controller[_0x00b2('0xb')]);router['post']('/',auth[_0x00b2('0xa')](),controller[_0x00b2('0xc')]);router[_0x00b2('0xd')](_0x00b2('0xe'),auth[_0x00b2('0xa')](),controller[_0x00b2('0xf')]);router[_0x00b2('0x10')]('/:id',auth[_0x00b2('0xa')](),controller[_0x00b2('0x11')]);router[_0x00b2('0x12')](_0x00b2('0x9'),auth[_0x00b2('0xa')](),controller[_0x00b2('0x13')]);router[_0x00b2('0x12')](_0x00b2('0x14'),auth['isAuthenticated'](),controller[_0x00b2('0x15')]);module[_0x00b2('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 5c02b80..56fce0b 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 _0x2ff9=['alpha','TIMESTAMP','sequelize','exports','name','ENUM','custom','files','quietmp3nb','quietmp3','mp3','STRING'];(function(_0x1e244c,_0x26af9c){var _0x40303d=function(_0x310896){while(--_0x310896){_0x1e244c['push'](_0x1e244c['shift']());}};_0x40303d(++_0x26af9c);}(_0x2ff9,0xaa));var _0x92ff=function(_0x4f621f,_0x14e531){_0x4f621f=_0x4f621f-0x0;var _0x3530d2=_0x2ff9[_0x4f621f];return _0x3530d2;};'use strict';var Sequelize=require(_0x92ff('0x0'));module[_0x92ff('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x92ff('0x2')},'mode':{'type':Sequelize[_0x92ff('0x3')](_0x92ff('0x4'),_0x92ff('0x5'),'mp3nb',_0x92ff('0x6'),_0x92ff('0x7'),_0x92ff('0x8')),'allowNull':!![],'defaultValue':_0x92ff('0x5')},'directory':{'type':Sequelize[_0x92ff('0x9')],'allowNull':!![]},'application':{'type':Sequelize[_0x92ff('0x9')],'allowNull':!![]},'digit':{'type':Sequelize[_0x92ff('0x9')],'allowNull':!![]},'sort':{'type':Sequelize[_0x92ff('0x9')],'allowNull':!![],'defaultValue':_0x92ff('0xa')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x92ff('0xb')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0xc5e4=['mp3','files','STRING','alpha','TIMESTAMP','BOOLEAN','name','ENUM','custom','quietmp3'];(function(_0x13dd1a,_0xe2850c){var _0x3627f1=function(_0x3431fe){while(--_0x3431fe){_0x13dd1a['push'](_0x13dd1a['shift']());}};_0x3627f1(++_0xe2850c);}(_0xc5e4,0x132));var _0x4c5e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xc5e4[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x4c5e('0x0')},'mode':{'type':Sequelize[_0x4c5e('0x1')](_0x4c5e('0x2'),'files','mp3nb','quietmp3nb',_0x4c5e('0x3'),_0x4c5e('0x4')),'allowNull':!![],'defaultValue':_0x4c5e('0x5')},'directory':{'type':Sequelize[_0x4c5e('0x6')],'allowNull':!![]},'application':{'type':Sequelize[_0x4c5e('0x6')],'allowNull':!![]},'digit':{'type':Sequelize[_0x4c5e('0x6')],'allowNull':!![]},'sort':{'type':Sequelize[_0x4c5e('0x6')],'allowNull':!![],'defaultValue':_0x4c5e('0x7')},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x4c5e('0x8')},'defaultEntry':{'type':Sequelize[_0x4c5e('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 ae6d68e..022c65d 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 _0x346a=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','rmdirSync','Sequelize','ValidationError','message','addSound','save_name','converted_format','createdAt','extname','format','%s.%s','symlinkSync','removeSound','findOne','id2','unlinkSync','getSounds','Sound','pick','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','Content-Range','json','apply','reject','save','destroy','then','MusicOnHolds','UserProfileResource','end','error','stack','name','send','index','VoiceMusicOnHold','fieldName','type','key','model','map','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','show','params','keys','rawAttributes','find','catch','update','body','create','sequelize','transaction','mode','directory','join','root','server/files/moh','0777','get'];(function(_0xf15599,_0x2f5fc0){var _0x393460=function(_0x4605db){while(--_0x4605db){_0xf15599['push'](_0xf15599['shift']());}};_0x393460(++_0x2f5fc0);}(_0x346a,0xfd));var _0xa346=function(_0x13d07a,_0x41efc3){_0x13d07a=_0x13d07a-0x0;var _0x5ee0ee=_0x346a[_0x13d07a];return _0x5ee0ee;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa346('0x0'));var rimraf=require(_0xa346('0x1'));var zipdir=require(_0xa346('0x2'));var jsonpatch=require(_0xa346('0x3'));var rp=require(_0xa346('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xa346('0x5'));var util=require(_0xa346('0x6'));var path=require(_0xa346('0x7'));var sox=require(_0xa346('0x8'));var csv=require(_0xa346('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xa346('0xa'));var crypto=require(_0xa346('0xb'));var jsforce=require(_0xa346('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xa346('0x9'));var querystring=require(_0xa346('0xd'));var Papa=require(_0xa346('0xe'));var Redis=require(_0xa346('0xf'));var authService=require(_0xa346('0x10'));var qs=require(_0xa346('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa346('0x12'));var logger=require(_0xa346('0x13'))(_0xa346('0x14'));var utils=require('../../config/utils');var config=require(_0xa346('0x15'));var db=require(_0xa346('0x16'))['db'];function respondWithStatusCode(_0x4d9e49,_0x1b15dc){_0x1b15dc=_0x1b15dc||0xcc;return function(_0x32a74b){if(_0x32a74b){return _0x4d9e49[_0xa346('0x17')](_0x1b15dc);}return _0x4d9e49[_0xa346('0x18')](_0x1b15dc)['end']();};}function respondWithResult(_0x4b1ae0,_0x26af1e){_0x26af1e=_0x26af1e||0xc8;return function(_0x298bb6){if(_0x298bb6){return _0x4b1ae0['status'](_0x26af1e)['json'](_0x298bb6);}};}function respondWithFilteredResult(_0x3db816,_0x1fb972){return function(_0x477ad8){if(_0x477ad8){var _0x419ac3=_0x477ad8['count'],_0x5ce940=_0x1fb972['offset'],_0x337da2=_0x1fb972[_0xa346('0x19')]+_0x1fb972[_0xa346('0x1a')],_0x34a3f3;if(_0x337da2>=_0x419ac3){_0x337da2=_0x419ac3;_0x34a3f3=0xc8;}else{_0x34a3f3=0xce;}_0x3db816[_0xa346('0x18')](_0x34a3f3);return _0x3db816[_0xa346('0x1b')](_0xa346('0x1c'),_0x5ce940+'-'+_0x337da2+'/'+_0x419ac3)[_0xa346('0x1d')](_0x477ad8);}return null;};}function patchUpdates(_0x1fe991){return function(_0x23dbc5){try{jsonpatch[_0xa346('0x1e')](_0x23dbc5,_0x1fe991,!![]);}catch(_0x5a4b03){return BPromise[_0xa346('0x1f')](_0x5a4b03);}return _0x23dbc5[_0xa346('0x20')]();};}function saveUpdates(_0x4234ad,_0x3e26fa){return function(_0x526fa3){if(_0x526fa3){return _0x526fa3['update'](_0x4234ad)['then'](function(_0x12890c){return _0x12890c;});}return null;};}function removeEntity(_0xc7bbe9,_0x420171){return function(_0x8a4553){if(_0x8a4553){return _0x8a4553[_0xa346('0x21')]()[_0xa346('0x22')](function(){var _0x21c902=_0x8a4553['get']({'plain':!![]});var _0x25cc35=_0xa346('0x23');return db[_0xa346('0x24')][_0xa346('0x21')]({'where':{'type':_0x25cc35,'resourceId':_0x21c902['id']}})[_0xa346('0x22')](function(){return _0x8a4553;});})[_0xa346('0x22')](function(){_0xc7bbe9[_0xa346('0x18')](0xcc)[_0xa346('0x25')]();});}};}function handleEntityNotFound(_0x1d39b5,_0x467c27){return function(_0x424a67){if(!_0x424a67){_0x1d39b5['sendStatus'](0x194);}return _0x424a67;};}function handleError(_0x44e10f,_0x5b57f4){_0x5b57f4=_0x5b57f4||0x1f4;return function(_0xadeb6a){logger[_0xa346('0x26')](_0xadeb6a[_0xa346('0x27')]);if(_0xadeb6a[_0xa346('0x28')]){delete _0xadeb6a['name'];}_0x44e10f[_0xa346('0x18')](_0x5b57f4)[_0xa346('0x29')](_0xadeb6a);};}exports[_0xa346('0x2a')]=function(_0x21b4c3,_0x24aab5){var _0x521bee={},_0xe6c7b={},_0x122a7b={'count':0x0,'rows':[]};var _0x2817fd=_['map'](db[_0xa346('0x2b')]['rawAttributes'],function(_0x718b62){return{'name':_0x718b62[_0xa346('0x2c')],'type':_0x718b62[_0xa346('0x2d')][_0xa346('0x2e')]};});_0xe6c7b[_0xa346('0x2f')]=_[_0xa346('0x30')](_0x2817fd,_0xa346('0x28'));_0xe6c7b[_0xa346('0x31')]=_['keys'](_0x21b4c3[_0xa346('0x31')]);_0xe6c7b[_0xa346('0x32')]=_[_0xa346('0x33')](_0xe6c7b[_0xa346('0x2f')],_0xe6c7b[_0xa346('0x31')]);_0x521bee['attributes']=_[_0xa346('0x33')](_0xe6c7b[_0xa346('0x2f')],qs[_0xa346('0x34')](_0x21b4c3[_0xa346('0x31')]['fields']));_0x521bee['attributes']=_0x521bee[_0xa346('0x35')][_0xa346('0x36')]?_0x521bee[_0xa346('0x35')]:_0xe6c7b[_0xa346('0x2f')];if(!_0x21b4c3[_0xa346('0x31')][_0xa346('0x37')](_0xa346('0x38'))){_0x521bee[_0xa346('0x1a')]=qs[_0xa346('0x1a')](_0x21b4c3['query']['limit']);_0x521bee['offset']=qs[_0xa346('0x19')](_0x21b4c3['query']['offset']);}_0x521bee[_0xa346('0x39')]=qs[_0xa346('0x3a')](_0x21b4c3['query'][_0xa346('0x3a')]);_0x521bee[_0xa346('0x3b')]=qs[_0xa346('0x32')](_['pick'](_0x21b4c3[_0xa346('0x31')],_0xe6c7b['filters']));if(_0x21b4c3[_0xa346('0x31')][_0xa346('0x3c')]){_0x521bee[_0xa346('0x3b')]=_[_0xa346('0x3d')](_0x521bee[_0xa346('0x3b')],{'$or':_[_0xa346('0x30')](_0x2817fd,function(_0x59a8a6){if(_0x59a8a6['type']!==_0xa346('0x3e')){var _0x278b01={};_0x278b01[_0x59a8a6['name']]={'$like':'%'+_0x21b4c3[_0xa346('0x31')]['filter']+'%'};return _0x278b01;}})});}_0x521bee=_[_0xa346('0x3d')]({},_0x521bee,_0x21b4c3[_0xa346('0x3f')]);var _0x3ca854={'where':_0x521bee['where']};return db[_0xa346('0x2b')][_0xa346('0x40')](_0x3ca854)['then'](function(_0x3bea8b){_0x122a7b[_0xa346('0x40')]=_0x3bea8b;if(_0x21b4c3[_0xa346('0x31')][_0xa346('0x41')]){_0x521bee[_0xa346('0x42')]=[{'all':!![]}];}return db[_0xa346('0x2b')][_0xa346('0x43')](_0x521bee);})[_0xa346('0x22')](function(_0x45890f){_0x122a7b['rows']=_0x45890f;return _0x122a7b;})['then'](respondWithFilteredResult(_0x24aab5,_0x521bee))['catch'](handleError(_0x24aab5,null));};exports[_0xa346('0x44')]=function(_0x25ee8a,_0x27a87b){var _0x3a35d0={'raw':![],'where':{'id':_0x25ee8a[_0xa346('0x45')]['id']}},_0x36e314={};_0x36e314[_0xa346('0x2f')]=_[_0xa346('0x46')](db[_0xa346('0x2b')][_0xa346('0x47')]);_0x36e314['query']=_[_0xa346('0x46')](_0x25ee8a[_0xa346('0x31')]);_0x36e314['filters']=_[_0xa346('0x33')](_0x36e314[_0xa346('0x2f')],_0x36e314[_0xa346('0x31')]);_0x3a35d0[_0xa346('0x35')]=_[_0xa346('0x33')](_0x36e314[_0xa346('0x2f')],qs[_0xa346('0x34')](_0x25ee8a[_0xa346('0x31')]['fields']));_0x3a35d0[_0xa346('0x35')]=_0x3a35d0[_0xa346('0x35')][_0xa346('0x36')]?_0x3a35d0[_0xa346('0x35')]:_0x36e314[_0xa346('0x2f')];if(_0x25ee8a[_0xa346('0x31')][_0xa346('0x41')]){_0x3a35d0[_0xa346('0x42')]=[{'all':!![]}];}_0x3a35d0=_[_0xa346('0x3d')]({},_0x3a35d0,_0x25ee8a['options']);return db[_0xa346('0x2b')][_0xa346('0x48')](_0x3a35d0)[_0xa346('0x22')](handleEntityNotFound(_0x27a87b,null))[_0xa346('0x22')](respondWithResult(_0x27a87b,null))[_0xa346('0x49')](handleError(_0x27a87b,null));};exports[_0xa346('0x4a')]=function(_0x5350,_0x196c1e){if(_0x5350[_0xa346('0x4b')]['id']){delete _0x5350[_0xa346('0x4b')]['id'];}return db[_0xa346('0x2b')][_0xa346('0x48')]({'where':{'id':_0x5350[_0xa346('0x45')]['id']}})[_0xa346('0x22')](handleEntityNotFound(_0x196c1e,null))[_0xa346('0x22')](saveUpdates(_0x5350[_0xa346('0x4b')],null))[_0xa346('0x22')](respondWithResult(_0x196c1e,null))[_0xa346('0x49')](handleError(_0x196c1e,null));};exports[_0xa346('0x4c')]=function(_0x423eb7,_0x2feb94,_0x288807){return db[_0xa346('0x4d')][_0xa346('0x4e')](function(_0x1fa476){if(_0x423eb7[_0xa346('0x4b')][_0xa346('0x4f')]==='files'){_0x423eb7[_0xa346('0x4b')][_0xa346('0x50')]=path[_0xa346('0x51')](config[_0xa346('0x52')],_0xa346('0x53'),_0x423eb7[_0xa346('0x4b')]['name']);}return db[_0xa346('0x2b')]['create'](_0x423eb7[_0xa346('0x4b')],{'transaction':_0x1fa476})[_0xa346('0x22')](function(_0x26fe84){if(_0x423eb7[_0xa346('0x4b')][_0xa346('0x4f')]==='files'){fs['mkdirSync'](_0x26fe84[_0xa346('0x50')],parseInt(_0xa346('0x54'),0x8));}var _0x41e2d8=_0x423eb7['user'][_0xa346('0x55')]({'plain':!![]});if(!_0x41e2d8)throw new Error(_0xa346('0x56'));if(_0x41e2d8[_0xa346('0x57')]==='user'){var _0xe108b2=_0x26fe84[_0xa346('0x55')]({'plain':!![]});return db[_0xa346('0x58')]['find']({'where':{'name':_0xa346('0x23'),'userProfileId':_0x41e2d8[_0xa346('0x59')]},'raw':!![]})[_0xa346('0x22')](function(_0x43fab8){if(_0x43fab8&&_0x43fab8[_0xa346('0x5a')]===0x0){return db[_0xa346('0x24')][_0xa346('0x4c')]({'name':_0xe108b2[_0xa346('0x28')],'resourceId':_0xe108b2['id'],'type':_0x43fab8[_0xa346('0x28')],'sectionId':_0x43fab8['id']},{})[_0xa346('0x22')](function(){return _0x26fe84;});}else{return _0x26fe84;}})[_0xa346('0x49')](function(_0x53a183){logger['error'](_0xa346('0x5b'),_0x53a183);});}return _0x26fe84;});})[_0xa346('0x22')](respondWithResult(_0x2feb94,0xc9))['catch'](handleError(_0x2feb94,null));};exports[_0xa346('0x21')]=function(_0x4b118f,_0x1c90f6,_0x554283){var _0x1803a4;return db['VoiceMusicOnHold'][_0xa346('0x48')]({'where':{'id':_0x4b118f[_0xa346('0x45')]['id']}})[_0xa346('0x22')](function(_0x5f1c77){if(_0x5f1c77){return db[_0xa346('0x4d')]['transaction'](function(_0x58bf5b){return _0x5f1c77[_0xa346('0x21')]({'transaction':_0x58bf5b,'raw':!![]})[_0xa346('0x22')](function(_0x45fdd7){if(_0x45fdd7[_0xa346('0x50')]){fs[_0xa346('0x5c')](_0x45fdd7[_0xa346('0x50')])[_0xa346('0x5d')](function(_0x23322f){fs['unlinkSync'](path['join'](_0x45fdd7[_0xa346('0x50')],_0x23322f));});fs[_0xa346('0x5e')](_0x45fdd7['directory']);}return _0x45fdd7;});})[_0xa346('0x49')](function(_0xe62d98){throw new db[(_0xa346('0x5f'))][(_0xa346('0x60'))](_0xe62d98[_0xa346('0x61')]);});}})['then'](handleEntityNotFound(_0x1c90f6,null))['then'](removeEntity(_0x1c90f6,null))['catch'](handleError(_0x1c90f6,null));};exports['addSound']=function(_0xeea4ab,_0xfc8a34,_0x5a62ff){return db[_0xa346('0x4d')][_0xa346('0x4e')](function(_0x1a428b){var _0x2dc30c;return db[_0xa346('0x2b')][_0xa346('0x48')]({'where':{'id':_0xeea4ab[_0xa346('0x45')]['id']}})['then'](function(_0x5aca30){if(_0x5aca30){_0x2dc30c=_0x5aca30;return _0x5aca30[_0xa346('0x62')](_0xeea4ab[_0xa346('0x4b')]['id'],{'transaction':_0x1a428b});}})[_0xa346('0x22')](function(_0x34cf2a){if(_0x34cf2a){return db['Sound']['findOne']({'where':{'id':_0xeea4ab[_0xa346('0x4b')]['id']},'attributes':['id',_0xa346('0x28'),_0xa346('0x63'),_0xa346('0x64'),_0xa346('0x65')],'raw':!![]});}})[_0xa346('0x22')](function(_0x1817bd){if(_0x1817bd){var _0x1674f1=path['join'](config['root'],'server/files/sounds/converted',util['format']('%s.%s',path['basename'](_0x1817bd[_0xa346('0x63')],path[_0xa346('0x66')](_0x1817bd[_0xa346('0x63')])),_0x1817bd['converted_format']));var _0x413556=path[_0xa346('0x51')](config['root'],_0xa346('0x53'),_0x2dc30c[_0xa346('0x28')],util[_0xa346('0x67')](_0xa346('0x68'),_0x1817bd[_0xa346('0x28')],_0x1817bd[_0xa346('0x64')]));fs[_0xa346('0x69')](_0x1674f1,_0x413556);return _0x1817bd;}})[_0xa346('0x49')](function(_0x2cf82e){throw new db[(_0xa346('0x5f'))][(_0xa346('0x60'))](_0x2cf82e[_0xa346('0x61')]);});})[_0xa346('0x22')](handleEntityNotFound(_0xfc8a34,null))[_0xa346('0x22')](respondWithResult(_0xfc8a34,0xc9))[_0xa346('0x49')](handleError(_0xfc8a34,null));};exports[_0xa346('0x6a')]=function(_0x31463d,_0x418e67,_0x2fba08){return db[_0xa346('0x4d')]['transaction'](function(_0x331397){var _0x2d8e71;return db['VoiceMusicOnHold'][_0xa346('0x6b')]({'where':{'id':_0x31463d['params']['id']}})[_0xa346('0x22')](handleEntityNotFound(_0x418e67,null))[_0xa346('0x22')](function(_0x4ba1a1){if(_0x4ba1a1){_0x2d8e71=_0x4ba1a1;return _0x4ba1a1['removeSound'](_0x31463d['params'][_0xa346('0x6c')]);}})['then'](function(_0x3166ac){if(_0x3166ac){return db['Sound'][_0xa346('0x6b')]({'where':{'id':_0x31463d['params'][_0xa346('0x6c')]},'attributes':['id',_0xa346('0x28'),_0xa346('0x63'),_0xa346('0x64'),_0xa346('0x65')],'raw':!![]});}})[_0xa346('0x22')](function(_0x847c6e){if(_0x847c6e){fs[_0xa346('0x6d')](path['join'](_0x2d8e71[_0xa346('0x50')],util[_0xa346('0x67')](_0xa346('0x68'),_0x847c6e['name'],_0x847c6e[_0xa346('0x64')])));return _0x847c6e;}})[_0xa346('0x49')](function(_0x4610f8){throw new db[(_0xa346('0x5f'))][(_0xa346('0x60'))](_0x4610f8['message']);});})['then'](handleEntityNotFound(_0x418e67,null))[_0xa346('0x22')](respondWithStatusCode(_0x418e67,0xcc))['catch'](handleError(_0x418e67,null));};exports[_0xa346('0x6e')]=function(_0x2b17a8,_0x13155a,_0x5900f0){var _0x30f549={};var _0x1bec40={};var _0x781395;var _0x59cc6b;return db[_0xa346('0x2b')][_0xa346('0x6b')]({'where':{'id':_0x2b17a8[_0xa346('0x45')]['id']}})[_0xa346('0x22')](handleEntityNotFound(_0x13155a,null))[_0xa346('0x22')](function(_0x1879ae){if(_0x1879ae){_0x781395=_0x1879ae;_0x1bec40[_0xa346('0x2f')]=_[_0xa346('0x46')](db[_0xa346('0x6f')][_0xa346('0x47')]);_0x1bec40['query']=_[_0xa346('0x46')](_0x2b17a8[_0xa346('0x31')]);_0x1bec40[_0xa346('0x32')]=_[_0xa346('0x33')](_0x1bec40[_0xa346('0x2f')],_0x1bec40[_0xa346('0x31')]);_0x30f549['attributes']=_['intersection'](_0x1bec40[_0xa346('0x2f')],qs[_0xa346('0x34')](_0x2b17a8[_0xa346('0x31')][_0xa346('0x34')]));_0x30f549[_0xa346('0x35')]=_0x30f549[_0xa346('0x35')][_0xa346('0x36')]?_0x30f549['attributes']:_0x1bec40[_0xa346('0x2f')];_0x30f549[_0xa346('0x39')]=qs[_0xa346('0x3a')](_0x2b17a8[_0xa346('0x31')][_0xa346('0x3a')]);_0x30f549[_0xa346('0x3b')]=qs[_0xa346('0x32')](_[_0xa346('0x70')](_0x2b17a8[_0xa346('0x31')],_0x1bec40[_0xa346('0x32')]));if(_0x2b17a8[_0xa346('0x31')]['filter']){_0x30f549[_0xa346('0x3b')]=_[_0xa346('0x3d')](_0x30f549[_0xa346('0x3b')],{'$or':_['map'](_0x30f549[_0xa346('0x35')],function(_0x327b7d){var _0x17684f={};_0x17684f[_0x327b7d]={'$like':'%'+_0x2b17a8['query'][_0xa346('0x3c')]+'%'};return _0x17684f;})});}_0x30f549=_[_0xa346('0x3d')]({},_0x30f549,_0x2b17a8['options']);return _0x781395[_0xa346('0x6e')](_0x30f549);}})[_0xa346('0x22')](function(_0x5d6f10){if(_0x5d6f10){_0x59cc6b=_0x5d6f10[_0xa346('0x36')];if(!_0x2b17a8[_0xa346('0x31')][_0xa346('0x37')](_0xa346('0x38'))){_0x30f549['limit']=qs['limit'](_0x2b17a8[_0xa346('0x31')][_0xa346('0x1a')]);_0x30f549['offset']=qs[_0xa346('0x19')](_0x2b17a8[_0xa346('0x31')]['offset']);}return _0x781395[_0xa346('0x6e')](_0x30f549);}})['then'](function(_0x545b1c){if(_0x545b1c){return _0x545b1c?{'count':_0x59cc6b,'rows':_0x545b1c}:null;}})[_0xa346('0x22')](respondWithResult(_0x13155a,null))[_0xa346('0x49')](handleError(_0x13155a,null));}; \ No newline at end of file +var _0xb698=['getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','util','sox','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','MusicOnHolds','UserProfileResource','error','stack','name','index','map','VoiceMusicOnHold','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','length','find','body','create','sequelize','mode','directory','join','root','mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','get','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','transaction','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','server/files/sounds/converted','format','%s.%s','basename','extname','server/files/moh','symlinkSync','removeSound','findOne','id2','createdAt'];(function(_0x30730c,_0x5e00f2){var _0x554424=function(_0x36118e){while(--_0x36118e){_0x30730c['push'](_0x30730c['shift']());}};_0x554424(++_0x5e00f2);}(_0xb698,0x1b5));var _0x8b69=function(_0x10c670,_0x3f32b5){_0x10c670=_0x10c670-0x0;var _0x432f9a=_0xb698[_0x10c670];return _0x432f9a;};'use strict';var pdf=require(_0x8b69('0x0'));var emlformat=require(_0x8b69('0x1'));var rimraf=require(_0x8b69('0x2'));var zipdir=require(_0x8b69('0x3'));var jsonpatch=require(_0x8b69('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8b69('0x5'));var Mustache=require('mustache');var util=require(_0x8b69('0x6'));var path=require('path');var sox=require(_0x8b69('0x7'));var csv=require(_0x8b69('0x8'));var ejs=require(_0x8b69('0x9'));var fs=require('fs');var _=require(_0x8b69('0xa'));var squel=require(_0x8b69('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8b69('0xc'));var toCsv=require(_0x8b69('0x8'));var querystring=require(_0x8b69('0xd'));var Papa=require('papaparse');var Redis=require(_0x8b69('0xe'));var authService=require(_0x8b69('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x8b69('0x10'));var hardwareService=require(_0x8b69('0x11'));var logger=require(_0x8b69('0x12'))(_0x8b69('0x13'));var utils=require(_0x8b69('0x14'));var config=require(_0x8b69('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1938fd,_0x5cb0ca){_0x5cb0ca=_0x5cb0ca||0xcc;return function(_0x1689d5){if(_0x1689d5){return _0x1938fd[_0x8b69('0x16')](_0x5cb0ca);}return _0x1938fd[_0x8b69('0x17')](_0x5cb0ca)['end']();};}function respondWithResult(_0x290273,_0x131833){_0x131833=_0x131833||0xc8;return function(_0x32d381){if(_0x32d381){return _0x290273[_0x8b69('0x17')](_0x131833)['json'](_0x32d381);}};}function respondWithFilteredResult(_0x1f80f6,_0x1e0a4b){return function(_0xc44bcc){if(_0xc44bcc){var _0x4ce779=_0xc44bcc[_0x8b69('0x18')],_0x2665b6=_0x1e0a4b[_0x8b69('0x19')],_0x1ab5fd=_0x1e0a4b[_0x8b69('0x19')]+_0x1e0a4b[_0x8b69('0x1a')],_0x31d65c;if(_0x1ab5fd>=_0x4ce779){_0x1ab5fd=_0x4ce779;_0x31d65c=0xc8;}else{_0x31d65c=0xce;}_0x1f80f6[_0x8b69('0x17')](_0x31d65c);return _0x1f80f6[_0x8b69('0x1b')](_0x8b69('0x1c'),_0x2665b6+'-'+_0x1ab5fd+'/'+_0x4ce779)['json'](_0xc44bcc);}return null;};}function patchUpdates(_0xb28117){return function(_0x129dde){try{jsonpatch['apply'](_0x129dde,_0xb28117,!![]);}catch(_0x4bbc36){return BPromise[_0x8b69('0x1d')](_0x4bbc36);}return _0x129dde[_0x8b69('0x1e')]();};}function saveUpdates(_0x31173b,_0x5e8c3a){return function(_0xe8dc58){if(_0xe8dc58){return _0xe8dc58[_0x8b69('0x1f')](_0x31173b)[_0x8b69('0x20')](function(_0x56d1be){return _0x56d1be;});}return null;};}function removeEntity(_0x39826c,_0xfeaac3){return function(_0x23d369){if(_0x23d369){return _0x23d369[_0x8b69('0x21')]()[_0x8b69('0x20')](function(){var _0x4ff8c3=_0x23d369['get']({'plain':!![]});var _0x953f45=_0x8b69('0x22');return db[_0x8b69('0x23')][_0x8b69('0x21')]({'where':{'type':_0x953f45,'resourceId':_0x4ff8c3['id']}})[_0x8b69('0x20')](function(){return _0x23d369;});})[_0x8b69('0x20')](function(){_0x39826c['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x519831,_0x7aff65){return function(_0x2847f2){if(!_0x2847f2){_0x519831[_0x8b69('0x16')](0x194);}return _0x2847f2;};}function handleError(_0x6d31d7,_0x5e7603){_0x5e7603=_0x5e7603||0x1f4;return function(_0x5c9b04){logger[_0x8b69('0x24')](_0x5c9b04[_0x8b69('0x25')]);if(_0x5c9b04[_0x8b69('0x26')]){delete _0x5c9b04[_0x8b69('0x26')];}_0x6d31d7['status'](_0x5e7603)['send'](_0x5c9b04);};}exports[_0x8b69('0x27')]=function(_0x24d3f5,_0x38fe17){var _0x32e989={},_0x45863b={},_0x109cc1={'count':0x0,'rows':[]};var _0x18836c=_[_0x8b69('0x28')](db[_0x8b69('0x29')][_0x8b69('0x2a')],function(_0x408844){return{'name':_0x408844[_0x8b69('0x2b')],'type':_0x408844[_0x8b69('0x2c')][_0x8b69('0x2d')]};});_0x45863b['model']=_[_0x8b69('0x28')](_0x18836c,'name');_0x45863b['query']=_[_0x8b69('0x2e')](_0x24d3f5[_0x8b69('0x2f')]);_0x45863b[_0x8b69('0x30')]=_[_0x8b69('0x31')](_0x45863b[_0x8b69('0x32')],_0x45863b[_0x8b69('0x2f')]);_0x32e989['attributes']=_[_0x8b69('0x31')](_0x45863b[_0x8b69('0x32')],qs[_0x8b69('0x33')](_0x24d3f5[_0x8b69('0x2f')]['fields']));_0x32e989[_0x8b69('0x34')]=_0x32e989['attributes']['length']?_0x32e989[_0x8b69('0x34')]:_0x45863b['model'];if(!_0x24d3f5[_0x8b69('0x2f')][_0x8b69('0x35')](_0x8b69('0x36'))){_0x32e989[_0x8b69('0x1a')]=qs[_0x8b69('0x1a')](_0x24d3f5[_0x8b69('0x2f')]['limit']);_0x32e989['offset']=qs['offset'](_0x24d3f5[_0x8b69('0x2f')]['offset']);}_0x32e989[_0x8b69('0x37')]=qs[_0x8b69('0x38')](_0x24d3f5['query'][_0x8b69('0x38')]);_0x32e989[_0x8b69('0x39')]=qs[_0x8b69('0x30')](_[_0x8b69('0x3a')](_0x24d3f5[_0x8b69('0x2f')],_0x45863b[_0x8b69('0x30')]));if(_0x24d3f5['query'][_0x8b69('0x3b')]){_0x32e989[_0x8b69('0x39')]=_[_0x8b69('0x3c')](_0x32e989[_0x8b69('0x39')],{'$or':_[_0x8b69('0x28')](_0x18836c,function(_0x15f770){if(_0x15f770[_0x8b69('0x2c')]!==_0x8b69('0x3d')){var _0x2adb84={};_0x2adb84[_0x15f770[_0x8b69('0x26')]]={'$like':'%'+_0x24d3f5[_0x8b69('0x2f')][_0x8b69('0x3b')]+'%'};return _0x2adb84;}})});}_0x32e989=_[_0x8b69('0x3c')]({},_0x32e989,_0x24d3f5[_0x8b69('0x3e')]);var _0x294e36={'where':_0x32e989['where']};return db[_0x8b69('0x29')][_0x8b69('0x18')](_0x294e36)[_0x8b69('0x20')](function(_0x2c135f){_0x109cc1[_0x8b69('0x18')]=_0x2c135f;if(_0x24d3f5[_0x8b69('0x2f')][_0x8b69('0x3f')]){_0x32e989[_0x8b69('0x40')]=[{'all':!![]}];}return db['VoiceMusicOnHold']['findAll'](_0x32e989);})[_0x8b69('0x20')](function(_0x57a71e){_0x109cc1[_0x8b69('0x41')]=_0x57a71e;return _0x109cc1;})[_0x8b69('0x20')](respondWithFilteredResult(_0x38fe17,_0x32e989))[_0x8b69('0x42')](handleError(_0x38fe17,null));};exports[_0x8b69('0x43')]=function(_0x3a9c17,_0x4be702){var _0x50624c={'raw':![],'where':{'id':_0x3a9c17[_0x8b69('0x44')]['id']}},_0x80d490={};_0x80d490[_0x8b69('0x32')]=_[_0x8b69('0x2e')](db[_0x8b69('0x29')][_0x8b69('0x2a')]);_0x80d490[_0x8b69('0x2f')]=_[_0x8b69('0x2e')](_0x3a9c17['query']);_0x80d490[_0x8b69('0x30')]=_[_0x8b69('0x31')](_0x80d490[_0x8b69('0x32')],_0x80d490[_0x8b69('0x2f')]);_0x50624c[_0x8b69('0x34')]=_[_0x8b69('0x31')](_0x80d490[_0x8b69('0x32')],qs[_0x8b69('0x33')](_0x3a9c17['query'][_0x8b69('0x33')]));_0x50624c[_0x8b69('0x34')]=_0x50624c[_0x8b69('0x34')][_0x8b69('0x45')]?_0x50624c[_0x8b69('0x34')]:_0x80d490[_0x8b69('0x32')];if(_0x3a9c17['query'][_0x8b69('0x3f')]){_0x50624c[_0x8b69('0x40')]=[{'all':!![]}];}_0x50624c=_[_0x8b69('0x3c')]({},_0x50624c,_0x3a9c17[_0x8b69('0x3e')]);return db[_0x8b69('0x29')][_0x8b69('0x46')](_0x50624c)['then'](handleEntityNotFound(_0x4be702,null))[_0x8b69('0x20')](respondWithResult(_0x4be702,null))[_0x8b69('0x42')](handleError(_0x4be702,null));};exports[_0x8b69('0x1f')]=function(_0xdb9d98,_0x4d65f8){if(_0xdb9d98[_0x8b69('0x47')]['id']){delete _0xdb9d98['body']['id'];}return db['VoiceMusicOnHold']['find']({'where':{'id':_0xdb9d98[_0x8b69('0x44')]['id']}})[_0x8b69('0x20')](handleEntityNotFound(_0x4d65f8,null))[_0x8b69('0x20')](saveUpdates(_0xdb9d98[_0x8b69('0x47')],null))[_0x8b69('0x20')](respondWithResult(_0x4d65f8,null))[_0x8b69('0x42')](handleError(_0x4d65f8,null));};exports[_0x8b69('0x48')]=function(_0xc61fd1,_0x47c598,_0x3e986a){return db[_0x8b69('0x49')]['transaction'](function(_0x1999bc){if(_0xc61fd1[_0x8b69('0x47')][_0x8b69('0x4a')]==='files'){_0xc61fd1['body'][_0x8b69('0x4b')]=path[_0x8b69('0x4c')](config[_0x8b69('0x4d')],'server/files/moh',_0xc61fd1[_0x8b69('0x47')]['name']);}return db[_0x8b69('0x29')][_0x8b69('0x48')](_0xc61fd1[_0x8b69('0x47')],{'transaction':_0x1999bc})[_0x8b69('0x20')](function(_0x34d815){if(_0xc61fd1[_0x8b69('0x47')][_0x8b69('0x4a')]==='files'){fs[_0x8b69('0x4e')](_0x34d815[_0x8b69('0x4b')],parseInt(_0x8b69('0x4f'),0x8));}var _0x395592=_0xc61fd1['user']['get']({'plain':!![]});if(!_0x395592)throw new Error(_0x8b69('0x50'));if(_0x395592['role']===_0x8b69('0x51')){var _0x2f2240=_0x34d815[_0x8b69('0x52')]({'plain':!![]});return db['UserProfileSection'][_0x8b69('0x46')]({'where':{'name':_0x8b69('0x22'),'userProfileId':_0x395592[_0x8b69('0x53')]},'raw':!![]})['then'](function(_0x30a027){if(_0x30a027&&_0x30a027[_0x8b69('0x54')]===0x0){return db[_0x8b69('0x23')][_0x8b69('0x48')]({'name':_0x2f2240['name'],'resourceId':_0x2f2240['id'],'type':_0x30a027[_0x8b69('0x26')],'sectionId':_0x30a027['id']},{})[_0x8b69('0x20')](function(){return _0x34d815;});}else{return _0x34d815;}})['catch'](function(_0x5726ce){logger['error'](_0x8b69('0x55'),_0x5726ce);});}return _0x34d815;});})[_0x8b69('0x20')](respondWithResult(_0x47c598,0xc9))[_0x8b69('0x42')](handleError(_0x47c598,null));};exports['destroy']=function(_0x32a823,_0x5bee82,_0x261a44){var _0x5a5aa7;return db[_0x8b69('0x29')][_0x8b69('0x46')]({'where':{'id':_0x32a823[_0x8b69('0x44')]['id']}})[_0x8b69('0x20')](function(_0x3b1f54){if(_0x3b1f54){return db['sequelize'][_0x8b69('0x56')](function(_0x1dffe4){return _0x3b1f54[_0x8b69('0x21')]({'transaction':_0x1dffe4,'raw':!![]})[_0x8b69('0x20')](function(_0x106673){if(_0x106673[_0x8b69('0x4b')]){fs['readdirSync'](_0x106673['directory'])[_0x8b69('0x57')](function(_0xc0505f){fs[_0x8b69('0x58')](path['join'](_0x106673[_0x8b69('0x4b')],_0xc0505f));});fs[_0x8b69('0x59')](_0x106673[_0x8b69('0x4b')]);}return _0x106673;});})['catch'](function(_0x457a5c){throw new db[(_0x8b69('0x5a'))][(_0x8b69('0x5b'))](_0x457a5c[_0x8b69('0x5c')]);});}})[_0x8b69('0x20')](handleEntityNotFound(_0x5bee82,null))[_0x8b69('0x20')](removeEntity(_0x5bee82,null))[_0x8b69('0x42')](handleError(_0x5bee82,null));};exports[_0x8b69('0x5d')]=function(_0x3ab3d6,_0x451cc5,_0xcf1e2e){return db[_0x8b69('0x49')][_0x8b69('0x56')](function(_0x3fa6ab){var _0x10b4b8;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x3ab3d6[_0x8b69('0x44')]['id']}})[_0x8b69('0x20')](function(_0x5902d0){if(_0x5902d0){_0x10b4b8=_0x5902d0;return _0x5902d0[_0x8b69('0x5d')](_0x3ab3d6[_0x8b69('0x47')]['id'],{'transaction':_0x3fa6ab});}})[_0x8b69('0x20')](function(_0x3e7ba6){if(_0x3e7ba6){return db[_0x8b69('0x5e')]['findOne']({'where':{'id':_0x3ab3d6[_0x8b69('0x47')]['id']},'attributes':['id','name',_0x8b69('0x5f'),_0x8b69('0x60'),'createdAt'],'raw':!![]});}})['then'](function(_0x4b2fc3){if(_0x4b2fc3){var _0x589e23=path[_0x8b69('0x4c')](config[_0x8b69('0x4d')],_0x8b69('0x61'),util[_0x8b69('0x62')](_0x8b69('0x63'),path[_0x8b69('0x64')](_0x4b2fc3[_0x8b69('0x5f')],path[_0x8b69('0x65')](_0x4b2fc3[_0x8b69('0x5f')])),_0x4b2fc3[_0x8b69('0x60')]));var _0x579007=path[_0x8b69('0x4c')](config[_0x8b69('0x4d')],_0x8b69('0x66'),_0x10b4b8[_0x8b69('0x26')],util['format'](_0x8b69('0x63'),_0x4b2fc3[_0x8b69('0x26')],_0x4b2fc3[_0x8b69('0x60')]));fs[_0x8b69('0x67')](_0x589e23,_0x579007);return _0x4b2fc3;}})[_0x8b69('0x42')](function(_0x568921){throw new db[(_0x8b69('0x5a'))]['ValidationError'](_0x568921[_0x8b69('0x5c')]);});})[_0x8b69('0x20')](handleEntityNotFound(_0x451cc5,null))[_0x8b69('0x20')](respondWithResult(_0x451cc5,0xc9))['catch'](handleError(_0x451cc5,null));};exports[_0x8b69('0x68')]=function(_0x65c2b1,_0x253c31,_0x2e397a){return db['sequelize'][_0x8b69('0x56')](function(_0x5aac5e){var _0x27e2ab;return db[_0x8b69('0x29')][_0x8b69('0x69')]({'where':{'id':_0x65c2b1['params']['id']}})[_0x8b69('0x20')](handleEntityNotFound(_0x253c31,null))['then'](function(_0x284eed){if(_0x284eed){_0x27e2ab=_0x284eed;return _0x284eed['removeSound'](_0x65c2b1[_0x8b69('0x44')][_0x8b69('0x6a')]);}})[_0x8b69('0x20')](function(_0x2470b2){if(_0x2470b2){return db[_0x8b69('0x5e')]['findOne']({'where':{'id':_0x65c2b1['params'][_0x8b69('0x6a')]},'attributes':['id',_0x8b69('0x26'),'save_name','converted_format',_0x8b69('0x6b')],'raw':!![]});}})[_0x8b69('0x20')](function(_0x5efa35){if(_0x5efa35){fs[_0x8b69('0x58')](path['join'](_0x27e2ab[_0x8b69('0x4b')],util[_0x8b69('0x62')]('%s.%s',_0x5efa35['name'],_0x5efa35[_0x8b69('0x60')])));return _0x5efa35;}})[_0x8b69('0x42')](function(_0x15f01f){throw new db[(_0x8b69('0x5a'))][(_0x8b69('0x5b'))](_0x15f01f[_0x8b69('0x5c')]);});})[_0x8b69('0x20')](handleEntityNotFound(_0x253c31,null))[_0x8b69('0x20')](respondWithStatusCode(_0x253c31,0xcc))[_0x8b69('0x42')](handleError(_0x253c31,null));};exports[_0x8b69('0x6c')]=function(_0x1922f8,_0x1398a8,_0x5b8b3d){var _0x194395={};var _0x2043ae={};var _0x181399;var _0x2d7619;return db[_0x8b69('0x29')][_0x8b69('0x69')]({'where':{'id':_0x1922f8[_0x8b69('0x44')]['id']}})[_0x8b69('0x20')](handleEntityNotFound(_0x1398a8,null))[_0x8b69('0x20')](function(_0x41be2d){if(_0x41be2d){_0x181399=_0x41be2d;_0x2043ae[_0x8b69('0x32')]=_['keys'](db[_0x8b69('0x5e')][_0x8b69('0x2a')]);_0x2043ae[_0x8b69('0x2f')]=_[_0x8b69('0x2e')](_0x1922f8[_0x8b69('0x2f')]);_0x2043ae[_0x8b69('0x30')]=_[_0x8b69('0x31')](_0x2043ae[_0x8b69('0x32')],_0x2043ae[_0x8b69('0x2f')]);_0x194395[_0x8b69('0x34')]=_[_0x8b69('0x31')](_0x2043ae[_0x8b69('0x32')],qs[_0x8b69('0x33')](_0x1922f8['query'][_0x8b69('0x33')]));_0x194395[_0x8b69('0x34')]=_0x194395['attributes']['length']?_0x194395['attributes']:_0x2043ae[_0x8b69('0x32')];_0x194395['order']=qs[_0x8b69('0x38')](_0x1922f8['query'][_0x8b69('0x38')]);_0x194395['where']=qs[_0x8b69('0x30')](_[_0x8b69('0x3a')](_0x1922f8[_0x8b69('0x2f')],_0x2043ae[_0x8b69('0x30')]));if(_0x1922f8['query'][_0x8b69('0x3b')]){_0x194395[_0x8b69('0x39')]=_[_0x8b69('0x3c')](_0x194395[_0x8b69('0x39')],{'$or':_[_0x8b69('0x28')](_0x194395[_0x8b69('0x34')],function(_0xa977d9){var _0x40dca1={};_0x40dca1[_0xa977d9]={'$like':'%'+_0x1922f8['query'][_0x8b69('0x3b')]+'%'};return _0x40dca1;})});}_0x194395=_[_0x8b69('0x3c')]({},_0x194395,_0x1922f8[_0x8b69('0x3e')]);return _0x181399[_0x8b69('0x6c')](_0x194395);}})[_0x8b69('0x20')](function(_0x521ae9){if(_0x521ae9){_0x2d7619=_0x521ae9[_0x8b69('0x45')];if(!_0x1922f8[_0x8b69('0x2f')]['hasOwnProperty'](_0x8b69('0x36'))){_0x194395[_0x8b69('0x1a')]=qs[_0x8b69('0x1a')](_0x1922f8[_0x8b69('0x2f')][_0x8b69('0x1a')]);_0x194395[_0x8b69('0x19')]=qs['offset'](_0x1922f8['query'][_0x8b69('0x19')]);}return _0x181399[_0x8b69('0x6c')](_0x194395);}})[_0x8b69('0x20')](function(_0x54eb6d){if(_0x54eb6d){return _0x54eb6d?{'count':_0x2d7619,'rows':_0x54eb6d}:null;}})['then'](respondWithResult(_0x1398a8,null))[_0x8b69('0x42')](handleError(_0x1398a8,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index 1cf1f0c..81efa59 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 _0xc0a3=['request-promise','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','voice_musiconhold','util','../../config/logger','api','moment'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xc0a3,0x75));var _0x3c0a=function(_0x3f2630,_0x3e37bb){_0x3f2630=_0x3f2630-0x0;var _0x1f7e37=_0xc0a3[_0x3f2630];return _0x1f7e37;};'use strict';var _=require('lodash');var util=require(_0x3c0a('0x0'));var logger=require(_0x3c0a('0x1'))(_0x3c0a('0x2'));var moment=require(_0x3c0a('0x3'));var BPromise=require('bluebird');var rp=require(_0x3c0a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3c0a('0x5'));var config=require(_0x3c0a('0x6'));var attributes=require(_0x3c0a('0x7'));module[_0x3c0a('0x8')]=function(_0x57fb4c,_0x19bea5){return _0x57fb4c[_0x3c0a('0x9')]('VoiceMusicOnHold',attributes,{'tableName':_0x3c0a('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xa982=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold','voice_musiconhold'];(function(_0x3f329d,_0x21a44b){var _0x534a60=function(_0x2d6967){while(--_0x2d6967){_0x3f329d['push'](_0x3f329d['shift']());}};_0x534a60(++_0x21a44b);}(_0xa982,0x9a));var _0x2a98=function(_0x411017,_0x4a8117){_0x411017=_0x411017-0x0;var _0x2adeea=_0xa982[_0x411017];return _0x2adeea;};'use strict';var _=require(_0x2a98('0x0'));var util=require(_0x2a98('0x1'));var logger=require(_0x2a98('0x2'))(_0x2a98('0x3'));var moment=require(_0x2a98('0x4'));var BPromise=require(_0x2a98('0x5'));var rp=require(_0x2a98('0x6'));var fs=require('fs');var path=require(_0x2a98('0x7'));var rimraf=require(_0x2a98('0x8'));var config=require('../../config/environment');var attributes=require(_0x2a98('0x9'));module[_0x2a98('0xa')]=function(_0x1d0a61,_0x2969ca){return _0x1d0a61[_0x2a98('0xb')](_0x2a98('0xc'),attributes,{'tableName':_0x2a98('0xd'),'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 07fd39b..dc2e2ad 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 _0x876f=['debug','request\x20sent','stringify','error','message','info','result','catch','lodash','util','moment','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','VoiceMusicOnHold,\x20%s,\x20%s'];(function(_0x468ff0,_0x44588c){var _0x16bbe7=function(_0x137084){while(--_0x137084){_0x468ff0['push'](_0x468ff0['shift']());}};_0x16bbe7(++_0x44588c);}(_0x876f,0x71));var _0xf876=function(_0xdd541a,_0x56a285){_0xdd541a=_0xdd541a-0x0;var _0x3e1fba=_0x876f[_0xdd541a];return _0x3e1fba;};'use strict';var _=require(_0xf876('0x0'));var util=require(_0xf876('0x1'));var moment=require(_0xf876('0x2'));var BPromise=require('bluebird');var rs=require(_0xf876('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xf876('0x4'));var logger=require('../../config/logger')(_0xf876('0x5'));var config=require(_0xf876('0x6'));var jayson=require(_0xf876('0x7'));var client=jayson[_0xf876('0x8')][_0xf876('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5e0632,_0x9bb9d4,_0x388a5e){return new BPromise(function(_0x27b174,_0x22bbb9){return client[_0xf876('0xa')](_0x5e0632,_0x388a5e)[_0xf876('0xb')](function(_0x421c41){logger['info'](_0xf876('0xc'),_0x9bb9d4,'request\x20sent');logger[_0xf876('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s,\x20%s',_0x9bb9d4,_0xf876('0xe'),JSON[_0xf876('0xf')](_0x421c41));if(_0x421c41[_0xf876('0x10')]){if(_0x421c41['error']['code']===0x1f4){logger[_0xf876('0x10')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x9bb9d4,_0x421c41[_0xf876('0x10')]['message']);return _0x22bbb9(_0x421c41[_0xf876('0x10')][_0xf876('0x11')]);}logger['error'](_0xf876('0xc'),_0x9bb9d4,_0x421c41['error'][_0xf876('0x11')]);return _0x27b174(_0x421c41[_0xf876('0x10')][_0xf876('0x11')]);}else{logger[_0xf876('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x9bb9d4,'request\x20sent');_0x27b174(_0x421c41[_0xf876('0x13')][_0xf876('0x11')]);}})[_0xf876('0x14')](function(_0x570071){logger[_0xf876('0x10')](_0xf876('0xc'),_0x9bb9d4,_0x570071);_0x22bbb9(_0x570071);});});} \ No newline at end of file +var _0x5ed9=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','http','then','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result'];(function(_0x46da44,_0x16ca7e){var _0x5efd58=function(_0xee4fbc){while(--_0xee4fbc){_0x46da44['push'](_0x46da44['shift']());}};_0x5efd58(++_0x16ca7e);}(_0x5ed9,0x119));var _0x95ed=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5ed9[_0x4cf98e];return _0x1623ac;};'use strict';var _=require(_0x95ed('0x0'));var util=require(_0x95ed('0x1'));var moment=require(_0x95ed('0x2'));var BPromise=require(_0x95ed('0x3'));var rs=require(_0x95ed('0x4'));var fs=require('fs');var Redis=require(_0x95ed('0x5'));var db=require(_0x95ed('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x95ed('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x95ed('0x8'));var client=jayson['client'][_0x95ed('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x72c2,_0x54f8ca,_0xdfe8b8){return new BPromise(function(_0x261e88,_0x58242b){return client['request'](_0x72c2,_0xdfe8b8)[_0x95ed('0xa')](function(_0x453f9b){logger['info'](_0x95ed('0xb'),_0x54f8ca,_0x95ed('0xc'));logger['debug'](_0x95ed('0xd'),_0x54f8ca,'request\x20sent',JSON[_0x95ed('0xe')](_0x453f9b));if(_0x453f9b['error']){if(_0x453f9b['error'][_0x95ed('0xf')]===0x1f4){logger['error'](_0x95ed('0xb'),_0x54f8ca,_0x453f9b['error'][_0x95ed('0x10')]);return _0x58242b(_0x453f9b[_0x95ed('0x11')][_0x95ed('0x10')]);}logger[_0x95ed('0x11')](_0x95ed('0xb'),_0x54f8ca,_0x453f9b[_0x95ed('0x11')][_0x95ed('0x10')]);return _0x261e88(_0x453f9b[_0x95ed('0x11')]['message']);}else{logger['info'](_0x95ed('0xb'),_0x54f8ca,_0x95ed('0xc'));_0x261e88(_0x453f9b[_0x95ed('0x12')][_0x95ed('0x10')]);}})[_0x95ed('0x13')](function(_0xeb400a){logger[_0x95ed('0x11')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x54f8ca,_0xeb400a);_0x58242b(_0xeb400a);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 2918965..7fa2078 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 _0xf4e5=['delete','destroy','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voicePrefix.controller','get','index','/describe','isAuthenticated','describe','/:id','show','getAgents','post','create','/:id/users','addAgents','put','update'];(function(_0x4bac67,_0x28cb22){var _0x1d2b91=function(_0x27dc3f){while(--_0x27dc3f){_0x4bac67['push'](_0x4bac67['shift']());}};_0x1d2b91(++_0x28cb22);}(_0xf4e5,0xd4));var _0x5f4e=function(_0x20fcf7,_0x35502f){_0x20fcf7=_0x20fcf7-0x0;var _0x1c3475=_0xf4e5[_0x20fcf7];return _0x1c3475;};'use strict';var multer=require(_0x5f4e('0x0'));var util=require(_0x5f4e('0x1'));var path=require(_0x5f4e('0x2'));var timeout=require(_0x5f4e('0x3'));var express=require(_0x5f4e('0x4'));var router=express[_0x5f4e('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5f4e('0x6'));var controller=require(_0x5f4e('0x7'));router[_0x5f4e('0x8')]('/',auth['isAuthenticated'](),controller[_0x5f4e('0x9')]);router[_0x5f4e('0x8')](_0x5f4e('0xa'),auth[_0x5f4e('0xb')](),controller[_0x5f4e('0xc')]);router[_0x5f4e('0x8')](_0x5f4e('0xd'),auth[_0x5f4e('0xb')](),controller[_0x5f4e('0xe')]);router['get']('/:id/users',auth[_0x5f4e('0xb')](),controller[_0x5f4e('0xf')]);router[_0x5f4e('0x10')]('/',auth['isAuthenticated'](),controller[_0x5f4e('0x11')]);router[_0x5f4e('0x10')](_0x5f4e('0x12'),auth[_0x5f4e('0xb')](),controller[_0x5f4e('0x13')]);router[_0x5f4e('0x14')](_0x5f4e('0xd'),auth[_0x5f4e('0xb')](),controller[_0x5f4e('0x15')]);router[_0x5f4e('0x16')](_0x5f4e('0xd'),auth['isAuthenticated'](),controller[_0x5f4e('0x17')]);router[_0x5f4e('0x16')]('/:id/users',auth[_0x5f4e('0xb')](),controller[_0x5f4e('0x18')]);module[_0x5f4e('0x19')]=router; \ No newline at end of file +var _0x8ff8=['util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voicePrefix.controller','index','get','isAuthenticated','describe','show','/:id/users','getAgents','post','create','addAgents','put','/:id','delete','destroy','removeAgents','exports','multer'];(function(_0x2640de,_0x495472){var _0x3ff54f=function(_0x179143){while(--_0x179143){_0x2640de['push'](_0x2640de['shift']());}};_0x3ff54f(++_0x495472);}(_0x8ff8,0x1c7));var _0x88ff=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8ff8[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x88ff('0x0'));var util=require(_0x88ff('0x1'));var path=require('path');var timeout=require(_0x88ff('0x2'));var express=require(_0x88ff('0x3'));var router=express[_0x88ff('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x88ff('0x5'));var config=require(_0x88ff('0x6'));var controller=require(_0x88ff('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x88ff('0x8')]);router[_0x88ff('0x9')]('/describe',auth[_0x88ff('0xa')](),controller[_0x88ff('0xb')]);router[_0x88ff('0x9')]('/:id',auth['isAuthenticated'](),controller[_0x88ff('0xc')]);router['get'](_0x88ff('0xd'),auth[_0x88ff('0xa')](),controller[_0x88ff('0xe')]);router[_0x88ff('0xf')]('/',auth[_0x88ff('0xa')](),controller[_0x88ff('0x10')]);router['post']('/:id/users',auth[_0x88ff('0xa')](),controller[_0x88ff('0x11')]);router[_0x88ff('0x12')](_0x88ff('0x13'),auth[_0x88ff('0xa')](),controller['update']);router[_0x88ff('0x14')](_0x88ff('0x13'),auth[_0x88ff('0xa')](),controller[_0x88ff('0x15')]);router[_0x88ff('0x14')](_0x88ff('0xd'),auth[_0x88ff('0xa')](),controller[_0x88ff('0x16')]);module[_0x88ff('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 b8c6417..1e1602f 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 _0x3c9d=['VIRTUAL','system-','getDataValue','INTEGER','sequelize','exports','STRING'];(function(_0xa6ff0c,_0x4b3bfe){var _0x2ad2a5=function(_0x588fa7){while(--_0x588fa7){_0xa6ff0c['push'](_0xa6ff0c['shift']());}};_0x2ad2a5(++_0x4b3bfe);}(_0x3c9d,0x185));var _0xd3c9=function(_0x4529b3,_0x390ebb){_0x4529b3=_0x4529b3-0x0;var _0x21e907=_0x3c9d[_0x4529b3];return _0x21e907;};'use strict';var Sequelize=require(_0xd3c9('0x0'));module[_0xd3c9('0x1')]={'name':{'type':Sequelize[_0xd3c9('0x2')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0xd3c9('0x3')],'get':function(_0xd2820b){return _0xd3c9('0x4')+this[_0xd3c9('0x5')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd3c9('0x2')]},'VoiceExtensionId':{'type':Sequelize[_0xd3c9('0x6')]}}; \ No newline at end of file +var _0x145d=['VIRTUAL','system-','getDataValue','exports','STRING','name'];(function(_0x1ca406,_0x45eaa8){var _0x2aa565=function(_0x3b3621){while(--_0x3b3621){_0x1ca406['push'](_0x1ca406['shift']());}};_0x2aa565(++_0x45eaa8);}(_0x145d,0xc9));var _0xd145=function(_0x2ede9c,_0x2d6e9c){_0x2ede9c=_0x2ede9c-0x0;var _0x5a083d=_0x145d[_0x2ede9c];return _0x5a083d;};'use strict';var Sequelize=require('sequelize');module[_0xd145('0x0')]={'name':{'type':Sequelize[_0xd145('0x1')],'allowNull':![],'unique':_0xd145('0x2')},'prefix':{'type':Sequelize[_0xd145('0x3')],'get':function(_0x4ad781){return _0xd145('0x4')+this[_0xd145('0x5')](_0xd145('0x2'))+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd145('0x1')]},'VoiceExtensionId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index e34b965..a4610bb 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 _0x18df=['Voice\x20Prefix\x20Extension','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','system-','transaction','findById','addAgents','ids','omit','spread','userVoicePrefix:save','removeAgents','emit','userVoicePrefix:remove','getAgents','findOne','order','pick','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','merge','options','includeAll','VoicePrefix','findAll','catch','show','params','include','find','describe','create','sequelize','body','get','VoiceExtension','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','description'];(function(_0x2b7241,_0x19d7f9){var _0x3a1bc=function(_0x459970){while(--_0x459970){_0x2b7241['push'](_0x2b7241['shift']());}};_0x3a1bc(++_0x19d7f9);}(_0x18df,0x11a));var _0xf18d=function(_0x45e75d,_0x566e98){_0x45e75d=_0x45e75d-0x0;var _0x552bd6=_0x18df[_0x45e75d];return _0x552bd6;};'use strict';var pdf=require(_0xf18d('0x0'));var emlformat=require(_0xf18d('0x1'));var rimraf=require(_0xf18d('0x2'));var zipdir=require(_0xf18d('0x3'));var jsonpatch=require(_0xf18d('0x4'));var rp=require(_0xf18d('0x5'));var moment=require(_0xf18d('0x6'));var BPromise=require(_0xf18d('0x7'));var Mustache=require(_0xf18d('0x8'));var util=require(_0xf18d('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0xf18d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf18d('0xb'));var squel=require(_0xf18d('0xc'));var crypto=require(_0xf18d('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf18d('0xe'));var toCsv=require('to-csv');var querystring=require(_0xf18d('0xf'));var Papa=require('papaparse');var Redis=require(_0xf18d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xf18d('0x11'));var as=require(_0xf18d('0x12'));var hardwareService=require(_0xf18d('0x13'));var logger=require('../../config/logger')(_0xf18d('0x14'));var utils=require('../../config/utils');var config=require(_0xf18d('0x15'));var db=require(_0xf18d('0x16'))['db'];config[_0xf18d('0x17')]=_[_0xf18d('0x18')](config[_0xf18d('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0xf18d('0x19'))(new Redis(config[_0xf18d('0x17')]));require(_0xf18d('0x1a'))[_0xf18d('0x1b')](socket);function respondWithStatusCode(_0x5d6ecb,_0xf9c95e){_0xf9c95e=_0xf9c95e||0xcc;return function(_0x510bd5){if(_0x510bd5){return _0x5d6ecb[_0xf18d('0x1c')](_0xf9c95e);}return _0x5d6ecb[_0xf18d('0x1d')](_0xf9c95e)[_0xf18d('0x1e')]();};}function respondWithResult(_0x2195c7,_0x4bce6f){_0x4bce6f=_0x4bce6f||0xc8;return function(_0x567366){if(_0x567366){return _0x2195c7[_0xf18d('0x1d')](_0x4bce6f)['json'](_0x567366);}};}function respondWithFilteredResult(_0x47ed1d,_0x320eb5){return function(_0x456865){if(_0x456865){var _0x2272a3=_0x456865[_0xf18d('0x1f')],_0x12c03c=_0x320eb5[_0xf18d('0x20')],_0x1788f2=_0x320eb5[_0xf18d('0x20')]+_0x320eb5[_0xf18d('0x21')],_0x874023;if(_0x1788f2>=_0x2272a3){_0x1788f2=_0x2272a3;_0x874023=0xc8;}else{_0x874023=0xce;}_0x47ed1d[_0xf18d('0x1d')](_0x874023);return _0x47ed1d[_0xf18d('0x22')](_0xf18d('0x23'),_0x12c03c+'-'+_0x1788f2+'/'+_0x2272a3)[_0xf18d('0x24')](_0x456865);}return null;};}function patchUpdates(_0x12d305){return function(_0x31e2db){try{jsonpatch[_0xf18d('0x25')](_0x31e2db,_0x12d305,!![]);}catch(_0x48e6f3){return BPromise[_0xf18d('0x26')](_0x48e6f3);}return _0x31e2db['save']();};}function saveUpdates(_0x28442c,_0x539209){return function(_0x504baa){if(_0x504baa){return _0x504baa[_0xf18d('0x27')](_0x28442c)[_0xf18d('0x28')](function(_0x137ffb){return _0x137ffb;});}return null;};}function removeEntity(_0x306664,_0x190fd8){return function(_0x3e796e){if(_0x3e796e){return _0x3e796e[_0xf18d('0x29')]()[_0xf18d('0x28')](function(){var _0x3d29b9=_0x3e796e['get']({'plain':!![]});var _0x1c88f8=_0xf18d('0x2a');return db[_0xf18d('0x2b')]['destroy']({'where':{'type':_0x1c88f8,'resourceId':_0x3d29b9['id']}})[_0xf18d('0x28')](function(){return _0x3e796e;});})[_0xf18d('0x28')](function(){_0x306664[_0xf18d('0x1d')](0xcc)[_0xf18d('0x1e')]();});}};}function handleEntityNotFound(_0x54901a,_0x12bbc0){return function(_0x5854af){if(!_0x5854af){_0x54901a[_0xf18d('0x1c')](0x194);}return _0x5854af;};}function handleError(_0x890ffb,_0x51a717){_0x51a717=_0x51a717||0x1f4;return function(_0x329594){logger[_0xf18d('0x2c')](_0x329594[_0xf18d('0x2d')]);if(_0x329594[_0xf18d('0x2e')]){delete _0x329594[_0xf18d('0x2e')];}_0x890ffb[_0xf18d('0x1d')](_0x51a717)[_0xf18d('0x2f')](_0x329594);};}exports['index']=function(_0x4e8341,_0xef5cd9){var _0x524501={},_0x18d191={},_0x42510c={'count':0x0,'rows':[]};var _0x3fc90e=_[_0xf18d('0x30')](db['VoicePrefix'][_0xf18d('0x31')],function(_0x1b8153){return{'name':_0x1b8153[_0xf18d('0x32')],'type':_0x1b8153[_0xf18d('0x33')][_0xf18d('0x34')]};});_0x18d191['model']=_[_0xf18d('0x30')](_0x3fc90e,_0xf18d('0x2e'));_0x18d191[_0xf18d('0x35')]=_[_0xf18d('0x36')](_0x4e8341['query']);_0x18d191[_0xf18d('0x37')]=_[_0xf18d('0x38')](_0x18d191[_0xf18d('0x39')],_0x18d191['query']);_0x524501[_0xf18d('0x3a')]=_[_0xf18d('0x38')](_0x18d191[_0xf18d('0x39')],qs['fields'](_0x4e8341[_0xf18d('0x35')][_0xf18d('0x3b')]));_0x524501[_0xf18d('0x3a')]=_0x524501['attributes'][_0xf18d('0x3c')]?_0x524501['attributes']:_0x18d191[_0xf18d('0x39')];if(!_0x4e8341[_0xf18d('0x35')][_0xf18d('0x3d')](_0xf18d('0x3e'))){_0x524501[_0xf18d('0x21')]=qs['limit'](_0x4e8341[_0xf18d('0x35')]['limit']);_0x524501['offset']=qs[_0xf18d('0x20')](_0x4e8341[_0xf18d('0x35')][_0xf18d('0x20')]);}_0x524501['order']=qs[_0xf18d('0x3f')](_0x4e8341[_0xf18d('0x35')]['sort']);_0x524501[_0xf18d('0x40')]=qs[_0xf18d('0x37')](_['pick'](_0x4e8341[_0xf18d('0x35')],_0x18d191['filters']));if(_0x4e8341[_0xf18d('0x35')][_0xf18d('0x41')]){_0x524501[_0xf18d('0x40')]=_[_0xf18d('0x42')](_0x524501[_0xf18d('0x40')],{'$or':_[_0xf18d('0x30')](_0x3fc90e,function(_0x46050a){if(_0x46050a[_0xf18d('0x33')]!=='VIRTUAL'){var _0x1c92bc={};_0x1c92bc[_0x46050a['name']]={'$like':'%'+_0x4e8341[_0xf18d('0x35')][_0xf18d('0x41')]+'%'};return _0x1c92bc;}})});}_0x524501=_[_0xf18d('0x42')]({},_0x524501,_0x4e8341[_0xf18d('0x43')]);var _0x5ada8f={'where':_0x524501[_0xf18d('0x40')]};return db['VoicePrefix'][_0xf18d('0x1f')](_0x5ada8f)[_0xf18d('0x28')](function(_0x1e9868){_0x42510c['count']=_0x1e9868;if(_0x4e8341[_0xf18d('0x35')][_0xf18d('0x44')]){_0x524501['include']=[{'all':!![]}];}return db[_0xf18d('0x45')][_0xf18d('0x46')](_0x524501);})[_0xf18d('0x28')](function(_0x44f797){_0x42510c['rows']=_0x44f797;return _0x42510c;})[_0xf18d('0x28')](respondWithFilteredResult(_0xef5cd9,_0x524501))[_0xf18d('0x47')](handleError(_0xef5cd9,null));};exports[_0xf18d('0x48')]=function(_0x125740,_0x2aa98b){var _0x1df6bd={'raw':![],'where':{'id':_0x125740[_0xf18d('0x49')]['id']}},_0x202490={};_0x202490['model']=_['keys'](db[_0xf18d('0x45')][_0xf18d('0x31')]);_0x202490[_0xf18d('0x35')]=_['keys'](_0x125740[_0xf18d('0x35')]);_0x202490['filters']=_[_0xf18d('0x38')](_0x202490[_0xf18d('0x39')],_0x202490[_0xf18d('0x35')]);_0x1df6bd[_0xf18d('0x3a')]=_[_0xf18d('0x38')](_0x202490['model'],qs[_0xf18d('0x3b')](_0x125740['query'][_0xf18d('0x3b')]));_0x1df6bd[_0xf18d('0x3a')]=_0x1df6bd[_0xf18d('0x3a')][_0xf18d('0x3c')]?_0x1df6bd[_0xf18d('0x3a')]:_0x202490[_0xf18d('0x39')];if(_0x125740[_0xf18d('0x35')][_0xf18d('0x44')]){_0x1df6bd[_0xf18d('0x4a')]=[{'all':!![]}];}_0x1df6bd=_[_0xf18d('0x42')]({},_0x1df6bd,_0x125740['options']);return db[_0xf18d('0x45')]['find'](_0x1df6bd)[_0xf18d('0x28')](handleEntityNotFound(_0x2aa98b,null))[_0xf18d('0x28')](respondWithResult(_0x2aa98b,null))[_0xf18d('0x47')](handleError(_0x2aa98b,null));};exports[_0xf18d('0x29')]=function(_0xfe760d,_0x252dc8){return db[_0xf18d('0x45')][_0xf18d('0x4b')]({'where':{'id':_0xfe760d['params']['id']}})['then'](handleEntityNotFound(_0x252dc8,null))['then'](removeEntity(_0x252dc8,null))[_0xf18d('0x47')](handleError(_0x252dc8,null));};exports[_0xf18d('0x4c')]=function(_0x467714,_0x51d304){return db[_0xf18d('0x45')][_0xf18d('0x4c')]()[_0xf18d('0x28')](respondWithResult(_0x51d304,null))[_0xf18d('0x47')](handleError(_0x51d304,null));};exports[_0xf18d('0x4d')]=function(_0x18d7fd,_0x50667a){var _0x460694;return db[_0xf18d('0x4e')]['transaction'](function(_0xae4ec6){return db['VoicePrefix'][_0xf18d('0x4d')](_0x18d7fd[_0xf18d('0x4f')],{'transaction':_0xae4ec6})[_0xf18d('0x28')](function(_0x3dcc04){_0x460694=_0x3dcc04[_0xf18d('0x50')]({'plain':!![]});return db[_0xf18d('0x51')][_0xf18d('0x4b')]({'where':{'id':_0x460694[_0xf18d('0x52')]},'raw':!![]})[_0xf18d('0x28')](function(_0x36052a){return createVoicePrefixExtensions(_0x460694,_0x36052a,_0xae4ec6);});});})[_0xf18d('0x28')](function(){var _0x444763=_0x18d7fd[_0xf18d('0x53')][_0xf18d('0x50')]({'plain':!![]});if(!_0x444763)throw new Error(_0xf18d('0x54'));if(_0x444763[_0xf18d('0x55')]===_0xf18d('0x53')){var _0xe72cd4=_0x460694;return db[_0xf18d('0x56')][_0xf18d('0x4b')]({'where':{'name':'VoicePrefixes','userProfileId':_0x444763[_0xf18d('0x57')]},'raw':!![]})['then'](function(_0x3a7e97){if(_0x3a7e97&&_0x3a7e97[_0xf18d('0x58')]===0x0){return db['UserProfileResource'][_0xf18d('0x4d')]({'name':_0xe72cd4['name'],'resourceId':_0xe72cd4['id'],'type':_0x3a7e97['name'],'sectionId':_0x3a7e97['id']},{})['then'](function(){return _0x460694;});}else{return _0x460694;}})[_0xf18d('0x47')](function(_0x278815){logger[_0xf18d('0x2c')](_0xf18d('0x59'),_0x278815);throw _0x278815;});}return _0x460694;})['then'](respondWithResult(_0x50667a,null))['catch'](handleError(_0x50667a,null));};function Extension(_0x4dbcef,_0xbf03b4,_0x373a99,_0x29c4d5){this[_0xf18d('0x5a')]=_0xf18d('0x5b');this[_0xf18d('0x5c')]=_0x4dbcef;this[_0xf18d('0x5d')]=_0x373a99;this[_0xf18d('0x33')]=_0xf18d('0x5e');this[_0xf18d('0x5f')]=_0xf18d('0x60');this[_0xf18d('0x61')]=_0xbf03b4;this[_0xf18d('0x62')]=_0x29c4d5;}function createVoicePrefixExtensions(_0xff74fe,_0x201406,_0x22f62d){return new BPromise(function(_0x5a60a6,_0x2f62e2){var _0x14a60f=new Extension(formatPrefixName(_0xff74fe[_0xf18d('0x63')]),0x1,_0xf18d('0x64'),_0xf18d('0x65'));_0x14a60f['VoicePrefixId']=_0xff74fe['id'];return db[_0xf18d('0x51')][_0xf18d('0x4d')](_0x14a60f,{'transaction':_0x22f62d})[_0xf18d('0x28')](function(_0x574d84){var _0x2b862f=_0x574d84[_0xf18d('0x50')]({'plain':!![]});var _0x70b4b0=_[_0xf18d('0x30')](addVoicePrefixExtensions(_0xff74fe,_0x201406),function(_0xfa146){_0xfa146[_0xf18d('0x52')]=_0x2b862f['id'];_0xfa146[_0xf18d('0x66')]=_0xff74fe['id'];return _0xfa146;});return db[_0xf18d('0x51')][_0xf18d('0x67')](_0x70b4b0,{'transaction':_0x22f62d})['then'](function(_0x4b32ba){if(!_0x4b32ba){return _0x2f62e2(_0xf18d('0x68'));}else{return _0x5a60a6(_0x4b32ba);}})['catch'](function(_0x493c71){return _0x2f62e2(_0x493c71);});});;});};function addVoicePrefixExtensions(_0x4cb8a9,_0x28d8b4){var _0xfd5905=[];var _0x163e71=formatPrefixName(_0x4cb8a9[_0xf18d('0x63')]);_0xfd5905[_0xf18d('0x69')](new Extension(_0x163e71,0x2,'Set','CDR(prefix)='+_0x4cb8a9[_0xf18d('0x2e')]));if(_0x4cb8a9[_0xf18d('0x6a')]){_0xfd5905['push'](new Extension(_0x163e71,0x3,'Set',_0xf18d('0x6b')+_0x4cb8a9[_0xf18d('0x6a')]));}else{_0xfd5905[_0xf18d('0x69')](new Extension(_0x163e71,0x3,_0xf18d('0x64'),_0xf18d('0x6c')));}_0xfd5905[_0xf18d('0x69')](new Extension(_0x163e71,0x4,_0xf18d('0x6d'),_0x28d8b4[_0xf18d('0x5a')]+','+'${EXTEN:'+(0x8+_0x4cb8a9[_0xf18d('0x2e')]['length'])+'}'+','+0x1));return _0xfd5905;}function formatPrefixName(_0x39c12a){var _0xf2a135='_';for(var _0x25b639=0x0;_0x25b639<_0x39c12a[_0xf18d('0x3c')];_0x25b639++){if(_0x39c12a['charAt'](_0x25b639)=='-'){_0xf2a135+=_0x39c12a['charAt'](_0x25b639);}else{_0xf2a135+='['+_0x39c12a[_0xf18d('0x6e')](_0x25b639)+']';}}_0xf2a135+='.';return _0xf2a135;}exports['update']=function(_0x4b1c98,_0x467305,_0x223e0c){var _0x6c887f=_0x4b1c98['body'];_0x6c887f[_0xf18d('0x63')]=_0xf18d('0x6f')+_0x6c887f[_0xf18d('0x2e')]+'-';return db['sequelize'][_0xf18d('0x70')](function(_0x4f8185){return db[_0xf18d('0x45')][_0xf18d('0x27')](_0x6c887f,{'where':{'id':_0x6c887f['id']},'transaction':_0x4f8185})[_0xf18d('0x28')](function(){return db['VoiceExtension'][_0xf18d('0x29')]({'where':{'VoicePrefixId':_0x6c887f['id']},'transaction':_0x4f8185})[_0xf18d('0x28')](function(){return db[_0xf18d('0x51')][_0xf18d('0x4b')]({'where':{'id':_0x6c887f[_0xf18d('0x52')]},'raw':!![]})[_0xf18d('0x28')](function(_0x48b1f9){return createVoicePrefixExtensions(_0x6c887f,_0x48b1f9,_0x4f8185);});});});})[_0xf18d('0x28')](function(){return db['VoicePrefix'][_0xf18d('0x71')](_0x6c887f['id']);})[_0xf18d('0x28')](respondWithResult(_0x467305,null))['catch'](handleError(_0x467305,null));};exports[_0xf18d('0x72')]=function(_0x2ce0ae,_0x331772,_0x5003bf){return db[_0xf18d('0x45')][_0xf18d('0x4b')]({'where':{'id':_0x2ce0ae['params']['id']}})['then'](handleEntityNotFound(_0x331772,null))[_0xf18d('0x28')](function(_0x436366){if(_0x436366){return _0x436366['addAgents'](_0x2ce0ae['body'][_0xf18d('0x73')],_[_0xf18d('0x74')](_0x2ce0ae['body'],[_0xf18d('0x73'),'id'])||{})[_0xf18d('0x75')](function(_0x31922e){for(var _0x4820a0=0x0;_0x4820a0<_0x2ce0ae['body'][_0xf18d('0x73')][_0xf18d('0x3c')];_0x4820a0+=0x1){socket['emit'](_0xf18d('0x76'),{'UserId':_0x2ce0ae[_0xf18d('0x4f')][_0xf18d('0x73')][_0x4820a0],'VoicePrefixId':_0x2ce0ae[_0xf18d('0x49')]['id']});}return _0x31922e;});}})['then'](respondWithResult(_0x331772,null))[_0xf18d('0x47')](handleError(_0x331772,null));};exports[_0xf18d('0x77')]=function(_0x225fcd,_0x1d7bc7,_0x417ddf){return db[_0xf18d('0x45')]['find']({'where':{'id':_0x225fcd['params']['id']}})[_0xf18d('0x28')](handleEntityNotFound(_0x1d7bc7,null))[_0xf18d('0x28')](function(_0x35e9ae){if(_0x35e9ae){return _0x35e9ae['removeAgents'](_0x225fcd[_0xf18d('0x35')][_0xf18d('0x73')])[_0xf18d('0x28')](function(){if(_['isArray'](_0x225fcd['query'][_0xf18d('0x73')])){for(var _0x35e6d4=0x0;_0x35e6d4<_0x225fcd[_0xf18d('0x35')][_0xf18d('0x73')][_0xf18d('0x3c')];_0x35e6d4+=0x1){socket['emit']('userVoicePrefix:remove',{'UserId':Number(_0x225fcd[_0xf18d('0x35')][_0xf18d('0x73')][_0x35e6d4]),'VoicePrefixId':Number(_0x225fcd[_0xf18d('0x49')]['id'])});}}else{socket[_0xf18d('0x78')](_0xf18d('0x79'),{'UserId':Number(_0x225fcd[_0xf18d('0x35')][_0xf18d('0x73')]),'VoicePrefixId':Number(_0x225fcd[_0xf18d('0x49')]['id'])});}});}})['then'](respondWithStatusCode(_0x1d7bc7,null))[_0xf18d('0x47')](handleError(_0x1d7bc7,null));};exports[_0xf18d('0x7a')]=function(_0x39d678,_0x3bc240,_0x40644d){var _0x17b54f={};var _0x14eb35={};var _0x1a5a2e;var _0x4f7210;return db[_0xf18d('0x45')][_0xf18d('0x7b')]({'where':{'id':_0x39d678['params']['id']}})['then'](handleEntityNotFound(_0x3bc240,null))['then'](function(_0x2c3310){if(_0x2c3310){_0x1a5a2e=_0x2c3310;_0x14eb35[_0xf18d('0x39')]=_[_0xf18d('0x36')](db['User']['rawAttributes']);_0x14eb35['query']=_[_0xf18d('0x36')](_0x39d678['query']);_0x14eb35['filters']=_[_0xf18d('0x38')](_0x14eb35['model'],_0x14eb35['query']);_0x17b54f[_0xf18d('0x3a')]=_[_0xf18d('0x38')](_0x14eb35[_0xf18d('0x39')],qs['fields'](_0x39d678[_0xf18d('0x35')][_0xf18d('0x3b')]));_0x17b54f['attributes']=_0x17b54f[_0xf18d('0x3a')][_0xf18d('0x3c')]?_0x17b54f[_0xf18d('0x3a')]:_0x14eb35[_0xf18d('0x39')];_0x17b54f[_0xf18d('0x7c')]=qs['sort'](_0x39d678[_0xf18d('0x35')][_0xf18d('0x3f')]);_0x17b54f[_0xf18d('0x40')]=qs[_0xf18d('0x37')](_[_0xf18d('0x7d')](_0x39d678[_0xf18d('0x35')],_0x14eb35[_0xf18d('0x37')]));if(_0x39d678[_0xf18d('0x35')][_0xf18d('0x41')]){_0x17b54f[_0xf18d('0x40')]=_[_0xf18d('0x42')](_0x17b54f['where'],{'$or':_[_0xf18d('0x30')](_0x17b54f['attributes'],function(_0x5028cd){var _0x3127a9={};_0x3127a9[_0x5028cd]={'$like':'%'+_0x39d678[_0xf18d('0x35')]['filter']+'%'};return _0x3127a9;})});}_0x17b54f=_[_0xf18d('0x42')]({},_0x17b54f,_0x39d678[_0xf18d('0x43')]);return _0x1a5a2e['getAgents'](_0x17b54f);}})['then'](function(_0x4aa0c1){if(_0x4aa0c1){_0x4f7210=_0x4aa0c1[_0xf18d('0x3c')];if(!_0x39d678[_0xf18d('0x35')]['hasOwnProperty'](_0xf18d('0x3e'))){_0x17b54f[_0xf18d('0x21')]=qs[_0xf18d('0x21')](_0x39d678['query']['limit']);_0x17b54f[_0xf18d('0x20')]=qs[_0xf18d('0x20')](_0x39d678[_0xf18d('0x35')][_0xf18d('0x20')]);}return _0x1a5a2e['getAgents'](_0x17b54f);}})[_0xf18d('0x28')](function(_0x3ec219){if(_0x3ec219){return _0x3ec219?{'count':_0x4f7210,'rows':_0x3ec219}:null;}})[_0xf18d('0x28')](respondWithResult(_0x3bc240,null))[_0xf18d('0x47')](handleError(_0x3bc240,null));}; \ No newline at end of file +var _0x2383=['merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','describe','create','sequelize','transaction','body','VoiceExtension','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','from-sip','exten','app','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','Extensions\x20creation\x20failed','Set','CDR(prefix)=','callerIdAll','push','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','context','${EXTEN:','charAt','system-','VoiceExtensionId','findById','addAgents','ids','spread','emit','userVoicePrefix:save','removeAgents','userVoicePrefix:remove','getAgents','User','nolimit','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','redis','./voicePrefix.socket','register','sendStatus','status','json','count','offset','set','Content-Range','apply','update','then','destroy','get','VoicePrefixes','UserProfileResource','end','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter'];(function(_0x3cefae,_0x2f50c3){var _0x216ba7=function(_0x3882c3){while(--_0x3882c3){_0x3cefae['push'](_0x3cefae['shift']());}};_0x216ba7(++_0x2f50c3);}(_0x2383,0xb2));var _0x3238=function(_0x3e5fb7,_0x1691ce){_0x3e5fb7=_0x3e5fb7-0x0;var _0x84f4a0=_0x2383[_0x3e5fb7];return _0x84f4a0;};'use strict';var pdf=require(_0x3238('0x0'));var emlformat=require(_0x3238('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3238('0x2'));var jsonpatch=require(_0x3238('0x3'));var rp=require(_0x3238('0x4'));var moment=require(_0x3238('0x5'));var BPromise=require(_0x3238('0x6'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0x3238('0x7'));var csv=require(_0x3238('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3238('0x9'));var squel=require(_0x3238('0xa'));var crypto=require(_0x3238('0xb'));var jsforce=require(_0x3238('0xc'));var deskjs=require(_0x3238('0xd'));var toCsv=require('to-csv');var querystring=require(_0x3238('0xe'));var Papa=require(_0x3238('0xf'));var Redis=require(_0x3238('0x10'));var authService=require(_0x3238('0x11'));var qs=require(_0x3238('0x12'));var as=require(_0x3238('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3238('0x14'))(_0x3238('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3238('0x16'))['db'];config['redis']=_['defaults'](config[_0x3238('0x17')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3238('0x17')]));require(_0x3238('0x18'))[_0x3238('0x19')](socket);function respondWithStatusCode(_0x5d9975,_0x4facd1){_0x4facd1=_0x4facd1||0xcc;return function(_0x54be93){if(_0x54be93){return _0x5d9975[_0x3238('0x1a')](_0x4facd1);}return _0x5d9975[_0x3238('0x1b')](_0x4facd1)['end']();};}function respondWithResult(_0x2d7739,_0x9579d2){_0x9579d2=_0x9579d2||0xc8;return function(_0x5ed252){if(_0x5ed252){return _0x2d7739['status'](_0x9579d2)[_0x3238('0x1c')](_0x5ed252);}};}function respondWithFilteredResult(_0x55d077,_0x403b85){return function(_0x4308ce){if(_0x4308ce){var _0x19cc01=_0x4308ce[_0x3238('0x1d')],_0x33099d=_0x403b85[_0x3238('0x1e')],_0x4b9e75=_0x403b85[_0x3238('0x1e')]+_0x403b85['limit'],_0x43ac11;if(_0x4b9e75>=_0x19cc01){_0x4b9e75=_0x19cc01;_0x43ac11=0xc8;}else{_0x43ac11=0xce;}_0x55d077[_0x3238('0x1b')](_0x43ac11);return _0x55d077[_0x3238('0x1f')](_0x3238('0x20'),_0x33099d+'-'+_0x4b9e75+'/'+_0x19cc01)['json'](_0x4308ce);}return null;};}function patchUpdates(_0x38503b){return function(_0x16775e){try{jsonpatch[_0x3238('0x21')](_0x16775e,_0x38503b,!![]);}catch(_0x373750){return BPromise['reject'](_0x373750);}return _0x16775e['save']();};}function saveUpdates(_0x233632,_0xc70127){return function(_0x43ec43){if(_0x43ec43){return _0x43ec43[_0x3238('0x22')](_0x233632)[_0x3238('0x23')](function(_0x45e9c2){return _0x45e9c2;});}return null;};}function removeEntity(_0x1785f9,_0x16aa44){return function(_0x5386be){if(_0x5386be){return _0x5386be[_0x3238('0x24')]()[_0x3238('0x23')](function(){var _0x5ddc26=_0x5386be[_0x3238('0x25')]({'plain':!![]});var _0x499f6e=_0x3238('0x26');return db[_0x3238('0x27')][_0x3238('0x24')]({'where':{'type':_0x499f6e,'resourceId':_0x5ddc26['id']}})[_0x3238('0x23')](function(){return _0x5386be;});})[_0x3238('0x23')](function(){_0x1785f9[_0x3238('0x1b')](0xcc)[_0x3238('0x28')]();});}};}function handleEntityNotFound(_0x4f8b4c,_0x328a5b){return function(_0x3a20c1){if(!_0x3a20c1){_0x4f8b4c[_0x3238('0x1a')](0x194);}return _0x3a20c1;};}function handleError(_0x5291ec,_0x45419e){_0x45419e=_0x45419e||0x1f4;return function(_0x1d9f58){logger[_0x3238('0x29')](_0x1d9f58[_0x3238('0x2a')]);if(_0x1d9f58[_0x3238('0x2b')]){delete _0x1d9f58[_0x3238('0x2b')];}_0x5291ec[_0x3238('0x1b')](_0x45419e)[_0x3238('0x2c')](_0x1d9f58);};}exports[_0x3238('0x2d')]=function(_0xb41fe1,_0x228c47){var _0x5bbef0={},_0x1f3f05={},_0x4c0072={'count':0x0,'rows':[]};var _0x37a7a7=_[_0x3238('0x2e')](db[_0x3238('0x2f')][_0x3238('0x30')],function(_0x500e87){return{'name':_0x500e87['fieldName'],'type':_0x500e87[_0x3238('0x31')][_0x3238('0x32')]};});_0x1f3f05[_0x3238('0x33')]=_['map'](_0x37a7a7,_0x3238('0x2b'));_0x1f3f05[_0x3238('0x34')]=_[_0x3238('0x35')](_0xb41fe1[_0x3238('0x34')]);_0x1f3f05[_0x3238('0x36')]=_[_0x3238('0x37')](_0x1f3f05[_0x3238('0x33')],_0x1f3f05[_0x3238('0x34')]);_0x5bbef0[_0x3238('0x38')]=_[_0x3238('0x37')](_0x1f3f05[_0x3238('0x33')],qs[_0x3238('0x39')](_0xb41fe1['query'][_0x3238('0x39')]));_0x5bbef0['attributes']=_0x5bbef0[_0x3238('0x38')][_0x3238('0x3a')]?_0x5bbef0[_0x3238('0x38')]:_0x1f3f05['model'];if(!_0xb41fe1[_0x3238('0x34')][_0x3238('0x3b')]('nolimit')){_0x5bbef0[_0x3238('0x3c')]=qs[_0x3238('0x3c')](_0xb41fe1[_0x3238('0x34')]['limit']);_0x5bbef0[_0x3238('0x1e')]=qs[_0x3238('0x1e')](_0xb41fe1['query'][_0x3238('0x1e')]);}_0x5bbef0[_0x3238('0x3d')]=qs['sort'](_0xb41fe1[_0x3238('0x34')][_0x3238('0x3e')]);_0x5bbef0[_0x3238('0x3f')]=qs[_0x3238('0x36')](_[_0x3238('0x40')](_0xb41fe1['query'],_0x1f3f05['filters']));if(_0xb41fe1[_0x3238('0x34')][_0x3238('0x41')]){_0x5bbef0[_0x3238('0x3f')]=_[_0x3238('0x42')](_0x5bbef0['where'],{'$or':_['map'](_0x37a7a7,function(_0x29952c){if(_0x29952c[_0x3238('0x31')]!==_0x3238('0x43')){var _0x8fd349={};_0x8fd349[_0x29952c[_0x3238('0x2b')]]={'$like':'%'+_0xb41fe1['query']['filter']+'%'};return _0x8fd349;}})});}_0x5bbef0=_[_0x3238('0x42')]({},_0x5bbef0,_0xb41fe1[_0x3238('0x44')]);var _0x44c5fa={'where':_0x5bbef0['where']};return db[_0x3238('0x2f')]['count'](_0x44c5fa)[_0x3238('0x23')](function(_0x3d145f){_0x4c0072['count']=_0x3d145f;if(_0xb41fe1['query'][_0x3238('0x45')]){_0x5bbef0[_0x3238('0x46')]=[{'all':!![]}];}return db[_0x3238('0x2f')][_0x3238('0x47')](_0x5bbef0);})[_0x3238('0x23')](function(_0xd4bd31){_0x4c0072[_0x3238('0x48')]=_0xd4bd31;return _0x4c0072;})[_0x3238('0x23')](respondWithFilteredResult(_0x228c47,_0x5bbef0))[_0x3238('0x49')](handleError(_0x228c47,null));};exports['show']=function(_0x14aab9,_0x3e70da){var _0x11333c={'raw':![],'where':{'id':_0x14aab9[_0x3238('0x4a')]['id']}},_0xa7ccb5={};_0xa7ccb5['model']=_['keys'](db[_0x3238('0x2f')]['rawAttributes']);_0xa7ccb5[_0x3238('0x34')]=_[_0x3238('0x35')](_0x14aab9[_0x3238('0x34')]);_0xa7ccb5['filters']=_[_0x3238('0x37')](_0xa7ccb5[_0x3238('0x33')],_0xa7ccb5[_0x3238('0x34')]);_0x11333c[_0x3238('0x38')]=_[_0x3238('0x37')](_0xa7ccb5[_0x3238('0x33')],qs[_0x3238('0x39')](_0x14aab9[_0x3238('0x34')][_0x3238('0x39')]));_0x11333c['attributes']=_0x11333c[_0x3238('0x38')][_0x3238('0x3a')]?_0x11333c[_0x3238('0x38')]:_0xa7ccb5[_0x3238('0x33')];if(_0x14aab9[_0x3238('0x34')][_0x3238('0x45')]){_0x11333c['include']=[{'all':!![]}];}_0x11333c=_['merge']({},_0x11333c,_0x14aab9['options']);return db[_0x3238('0x2f')][_0x3238('0x4b')](_0x11333c)['then'](handleEntityNotFound(_0x3e70da,null))[_0x3238('0x23')](respondWithResult(_0x3e70da,null))['catch'](handleError(_0x3e70da,null));};exports[_0x3238('0x24')]=function(_0x35ca48,_0x540a59){return db[_0x3238('0x2f')][_0x3238('0x4b')]({'where':{'id':_0x35ca48['params']['id']}})['then'](handleEntityNotFound(_0x540a59,null))[_0x3238('0x23')](removeEntity(_0x540a59,null))[_0x3238('0x49')](handleError(_0x540a59,null));};exports[_0x3238('0x4c')]=function(_0x2b723d,_0x4e6388){return db[_0x3238('0x2f')][_0x3238('0x4c')]()['then'](respondWithResult(_0x4e6388,null))[_0x3238('0x49')](handleError(_0x4e6388,null));};exports[_0x3238('0x4d')]=function(_0x5773b9,_0x5cb976){var _0x5875a9;return db[_0x3238('0x4e')][_0x3238('0x4f')](function(_0x30c187){return db[_0x3238('0x2f')][_0x3238('0x4d')](_0x5773b9[_0x3238('0x50')],{'transaction':_0x30c187})[_0x3238('0x23')](function(_0x277e6a){_0x5875a9=_0x277e6a[_0x3238('0x25')]({'plain':!![]});return db[_0x3238('0x51')][_0x3238('0x4b')]({'where':{'id':_0x5875a9['VoiceExtensionId']},'raw':!![]})[_0x3238('0x23')](function(_0x1269cc){return createVoicePrefixExtensions(_0x5875a9,_0x1269cc,_0x30c187);});});})['then'](function(){var _0x5d9052=_0x5773b9['user'][_0x3238('0x25')]({'plain':!![]});if(!_0x5d9052)throw new Error(_0x3238('0x52'));if(_0x5d9052[_0x3238('0x53')]===_0x3238('0x54')){var _0x183634=_0x5875a9;return db[_0x3238('0x55')][_0x3238('0x4b')]({'where':{'name':_0x3238('0x26'),'userProfileId':_0x5d9052['userProfileId']},'raw':!![]})['then'](function(_0x36c98c){if(_0x36c98c&&_0x36c98c['autoAssociation']===0x0){return db['UserProfileResource'][_0x3238('0x4d')]({'name':_0x183634[_0x3238('0x2b')],'resourceId':_0x183634['id'],'type':_0x36c98c['name'],'sectionId':_0x36c98c['id']},{})[_0x3238('0x23')](function(){return _0x5875a9;});}else{return _0x5875a9;}})[_0x3238('0x49')](function(_0x1f894e){logger[_0x3238('0x29')](_0x3238('0x56'),_0x1f894e);throw _0x1f894e;});}return _0x5875a9;})[_0x3238('0x23')](respondWithResult(_0x5cb976,null))['catch'](handleError(_0x5cb976,null));};function Extension(_0x2b0369,_0x15bf78,_0x2cb261,_0x4a8ccb){this['context']=_0x3238('0x57');this[_0x3238('0x58')]=_0x2b0369;this[_0x3238('0x59')]=_0x2cb261;this[_0x3238('0x31')]=_0x3238('0x5a');this[_0x3238('0x5b')]='Voice\x20Prefix\x20Extension';this[_0x3238('0x5c')]=_0x15bf78;this[_0x3238('0x5d')]=_0x4a8ccb;}function createVoicePrefixExtensions(_0x18bd88,_0x2f9e59,_0x39bea1){return new BPromise(function(_0x504704,_0x247ec4){var _0x4c5ee6=new Extension(formatPrefixName(_0x18bd88[_0x3238('0x5e')]),0x1,_0x3238('0x5f'),_0x3238('0x60'));_0x4c5ee6['VoicePrefixId']=_0x18bd88['id'];return db[_0x3238('0x51')]['create'](_0x4c5ee6,{'transaction':_0x39bea1})[_0x3238('0x23')](function(_0x334932){var _0x54b4cf=_0x334932[_0x3238('0x25')]({'plain':!![]});var _0x11aed1=_['map'](addVoicePrefixExtensions(_0x18bd88,_0x2f9e59),function(_0x2306f2){_0x2306f2['VoiceExtensionId']=_0x54b4cf['id'];_0x2306f2[_0x3238('0x61')]=_0x18bd88['id'];return _0x2306f2;});return db['VoiceExtension']['bulkCreate'](_0x11aed1,{'transaction':_0x39bea1})[_0x3238('0x23')](function(_0x366c83){if(!_0x366c83){return _0x247ec4(_0x3238('0x62'));}else{return _0x504704(_0x366c83);}})[_0x3238('0x49')](function(_0xe04ecc){return _0x247ec4(_0xe04ecc);});});;});};function addVoicePrefixExtensions(_0x2cdf29,_0xbf64c5){var _0x4ba45d=[];var _0x499e54=formatPrefixName(_0x2cdf29[_0x3238('0x5e')]);_0x4ba45d['push'](new Extension(_0x499e54,0x2,_0x3238('0x63'),_0x3238('0x64')+_0x2cdf29['name']));if(_0x2cdf29[_0x3238('0x65')]){_0x4ba45d[_0x3238('0x66')](new Extension(_0x499e54,0x3,_0x3238('0x63'),_0x3238('0x67')+_0x2cdf29['callerIdAll']));}else{_0x4ba45d['push'](new Extension(_0x499e54,0x3,_0x3238('0x5f'),_0x3238('0x68')));}_0x4ba45d[_0x3238('0x66')](new Extension(_0x499e54,0x4,_0x3238('0x69'),_0xbf64c5[_0x3238('0x6a')]+','+_0x3238('0x6b')+(0x8+_0x2cdf29[_0x3238('0x2b')]['length'])+'}'+','+0x1));return _0x4ba45d;}function formatPrefixName(_0x4652f1){var _0x80a6f6='_';for(var _0x40e422=0x0;_0x40e422<_0x4652f1[_0x3238('0x3a')];_0x40e422++){if(_0x4652f1[_0x3238('0x6c')](_0x40e422)=='-'){_0x80a6f6+=_0x4652f1[_0x3238('0x6c')](_0x40e422);}else{_0x80a6f6+='['+_0x4652f1[_0x3238('0x6c')](_0x40e422)+']';}}_0x80a6f6+='.';return _0x80a6f6;}exports[_0x3238('0x22')]=function(_0x50e053,_0x5d831e,_0x211660){var _0x30bda7=_0x50e053[_0x3238('0x50')];_0x30bda7['prefix']=_0x3238('0x6d')+_0x30bda7[_0x3238('0x2b')]+'-';return db['sequelize'][_0x3238('0x4f')](function(_0x547b55){return db['VoicePrefix'][_0x3238('0x22')](_0x30bda7,{'where':{'id':_0x30bda7['id']},'transaction':_0x547b55})[_0x3238('0x23')](function(){return db[_0x3238('0x51')][_0x3238('0x24')]({'where':{'VoicePrefixId':_0x30bda7['id']},'transaction':_0x547b55})['then'](function(){return db['VoiceExtension'][_0x3238('0x4b')]({'where':{'id':_0x30bda7[_0x3238('0x6e')]},'raw':!![]})[_0x3238('0x23')](function(_0x2544ec){return createVoicePrefixExtensions(_0x30bda7,_0x2544ec,_0x547b55);});});});})[_0x3238('0x23')](function(){return db[_0x3238('0x2f')][_0x3238('0x6f')](_0x30bda7['id']);})['then'](respondWithResult(_0x5d831e,null))[_0x3238('0x49')](handleError(_0x5d831e,null));};exports[_0x3238('0x70')]=function(_0x4018c9,_0x6b974a,_0x4fb803){return db[_0x3238('0x2f')]['find']({'where':{'id':_0x4018c9[_0x3238('0x4a')]['id']}})['then'](handleEntityNotFound(_0x6b974a,null))[_0x3238('0x23')](function(_0x33f274){if(_0x33f274){return _0x33f274[_0x3238('0x70')](_0x4018c9[_0x3238('0x50')][_0x3238('0x71')],_['omit'](_0x4018c9['body'],[_0x3238('0x71'),'id'])||{})[_0x3238('0x72')](function(_0x4fd4ee){for(var _0x56eb35=0x0;_0x56eb35<_0x4018c9[_0x3238('0x50')][_0x3238('0x71')][_0x3238('0x3a')];_0x56eb35+=0x1){socket[_0x3238('0x73')](_0x3238('0x74'),{'UserId':_0x4018c9['body'][_0x3238('0x71')][_0x56eb35],'VoicePrefixId':_0x4018c9[_0x3238('0x4a')]['id']});}return _0x4fd4ee;});}})[_0x3238('0x23')](respondWithResult(_0x6b974a,null))[_0x3238('0x49')](handleError(_0x6b974a,null));};exports[_0x3238('0x75')]=function(_0x3a0fb0,_0x193edd,_0x4cf0e0){return db[_0x3238('0x2f')]['find']({'where':{'id':_0x3a0fb0[_0x3238('0x4a')]['id']}})[_0x3238('0x23')](handleEntityNotFound(_0x193edd,null))['then'](function(_0x2bffc4){if(_0x2bffc4){return _0x2bffc4[_0x3238('0x75')](_0x3a0fb0[_0x3238('0x34')][_0x3238('0x71')])[_0x3238('0x23')](function(){if(_['isArray'](_0x3a0fb0[_0x3238('0x34')][_0x3238('0x71')])){for(var _0x1259b0=0x0;_0x1259b0<_0x3a0fb0[_0x3238('0x34')][_0x3238('0x71')][_0x3238('0x3a')];_0x1259b0+=0x1){socket['emit'](_0x3238('0x76'),{'UserId':Number(_0x3a0fb0[_0x3238('0x34')]['ids'][_0x1259b0]),'VoicePrefixId':Number(_0x3a0fb0[_0x3238('0x4a')]['id'])});}}else{socket[_0x3238('0x73')]('userVoicePrefix:remove',{'UserId':Number(_0x3a0fb0['query'][_0x3238('0x71')]),'VoicePrefixId':Number(_0x3a0fb0[_0x3238('0x4a')]['id'])});}});}})[_0x3238('0x23')](respondWithStatusCode(_0x193edd,null))[_0x3238('0x49')](handleError(_0x193edd,null));};exports[_0x3238('0x77')]=function(_0x20fb0d,_0x57727e,_0x20158b){var _0x3dca98={};var _0x5231a1={};var _0x126490;var _0x34ea12;return db[_0x3238('0x2f')]['findOne']({'where':{'id':_0x20fb0d['params']['id']}})[_0x3238('0x23')](handleEntityNotFound(_0x57727e,null))[_0x3238('0x23')](function(_0x2b6697){if(_0x2b6697){_0x126490=_0x2b6697;_0x5231a1[_0x3238('0x33')]=_[_0x3238('0x35')](db[_0x3238('0x78')][_0x3238('0x30')]);_0x5231a1['query']=_['keys'](_0x20fb0d[_0x3238('0x34')]);_0x5231a1['filters']=_[_0x3238('0x37')](_0x5231a1['model'],_0x5231a1[_0x3238('0x34')]);_0x3dca98[_0x3238('0x38')]=_[_0x3238('0x37')](_0x5231a1[_0x3238('0x33')],qs[_0x3238('0x39')](_0x20fb0d[_0x3238('0x34')]['fields']));_0x3dca98[_0x3238('0x38')]=_0x3dca98[_0x3238('0x38')]['length']?_0x3dca98[_0x3238('0x38')]:_0x5231a1['model'];_0x3dca98['order']=qs['sort'](_0x20fb0d[_0x3238('0x34')][_0x3238('0x3e')]);_0x3dca98['where']=qs[_0x3238('0x36')](_[_0x3238('0x40')](_0x20fb0d[_0x3238('0x34')],_0x5231a1[_0x3238('0x36')]));if(_0x20fb0d[_0x3238('0x34')][_0x3238('0x41')]){_0x3dca98[_0x3238('0x3f')]=_[_0x3238('0x42')](_0x3dca98['where'],{'$or':_['map'](_0x3dca98[_0x3238('0x38')],function(_0x108e54){var _0x5a8a7d={};_0x5a8a7d[_0x108e54]={'$like':'%'+_0x20fb0d[_0x3238('0x34')][_0x3238('0x41')]+'%'};return _0x5a8a7d;})});}_0x3dca98=_[_0x3238('0x42')]({},_0x3dca98,_0x20fb0d[_0x3238('0x44')]);return _0x126490[_0x3238('0x77')](_0x3dca98);}})[_0x3238('0x23')](function(_0x2ab84a){if(_0x2ab84a){_0x34ea12=_0x2ab84a[_0x3238('0x3a')];if(!_0x20fb0d[_0x3238('0x34')]['hasOwnProperty'](_0x3238('0x79'))){_0x3dca98[_0x3238('0x3c')]=qs['limit'](_0x20fb0d[_0x3238('0x34')][_0x3238('0x3c')]);_0x3dca98['offset']=qs[_0x3238('0x1e')](_0x20fb0d[_0x3238('0x34')][_0x3238('0x1e')]);}return _0x126490[_0x3238('0x77')](_0x3dca98);}})[_0x3238('0x23')](function(_0x34805a){if(_0x34805a){return _0x34805a?{'count':_0x34ea12,'rows':_0x34805a}:null;}})[_0x3238('0x23')](respondWithResult(_0x57727e,null))[_0x3238('0x49')](handleError(_0x57727e,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index fbd8b93..5bb5688 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 _0x3e74=['hasOwnProperty','exports','events','VoicePrefix','setMaxListeners','save','emit'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x3e74,0x175));var _0x43e7=function(_0x48682f,_0x124f24){_0x48682f=_0x48682f-0x0;var _0x1d1530=_0x3e74[_0x48682f];return _0x1d1530;};'use strict';var EventEmitter=require(_0x43e7('0x0'));var VoicePrefix=require('../../mysqldb')['db'][_0x43e7('0x1')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x43e7('0x2')](0x0);var events={'afterCreate':_0x43e7('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0xc58479){return function(_0x4f9bbe,_0x128b0f,_0xe838b4){VoicePrefixEvents[_0x43e7('0x4')](_0xc58479+':'+_0x4f9bbe['id'],_0x4f9bbe);VoicePrefixEvents[_0x43e7('0x4')](_0xc58479,_0x4f9bbe);_0xe838b4(null);};}for(var e in events){if(events[_0x43e7('0x5')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x43e7('0x6')]=VoicePrefixEvents; \ No newline at end of file +var _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','VoicePrefix','setMaxListeners','update','remove'];(function(_0x5e3b04,_0xbb6795){var _0x1fc44d=function(_0x3472a1){while(--_0x3472a1){_0x5e3b04['push'](_0x5e3b04['shift']());}};_0x1fc44d(++_0xbb6795);}(_0x34e8,0x12c));var _0x834e=function(_0x5f0a5f,_0x9873bf){_0x5f0a5f=_0x5f0a5f-0x0;var _0x42b11b=_0x34e8[_0x5f0a5f];return _0x42b11b;};'use strict';var EventEmitter=require(_0x834e('0x0'));var VoicePrefix=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){VoicePrefixEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);VoicePrefixEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];VoicePrefix['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index 394c102..3e1effe 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 _0xf681=['api','moment','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','voice_prefixes','lodash','util','../../config/logger'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xf681,0x1c5));var _0x1f68=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0xf681[_0x432682];return _0x463d05;};'use strict';var _=require(_0x1f68('0x0'));var util=require(_0x1f68('0x1'));var logger=require(_0x1f68('0x2'))(_0x1f68('0x3'));var moment=require(_0x1f68('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x1f68('0x5'));var rimraf=require(_0x1f68('0x6'));var config=require(_0x1f68('0x7'));var attributes=require(_0x1f68('0x8'));module[_0x1f68('0x9')]=function(_0x4ccce3,_0x49d79a){return _0x4ccce3[_0x1f68('0xa')]('VoicePrefix',attributes,{'tableName':_0x1f68('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8b95=['./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0xa25342,_0x24522b){var _0x52be43=function(_0x1ea0e9){while(--_0x1ea0e9){_0xa25342['push'](_0xa25342['shift']());}};_0x52be43(++_0x24522b);}(_0x8b95,0x17f));var _0x58b9=function(_0x3fe694,_0x16b014){_0x3fe694=_0x3fe694-0x0;var _0x18cc6b=_0x8b95[_0x3fe694];return _0x18cc6b;};'use strict';var _=require('lodash');var util=require(_0x58b9('0x0'));var logger=require(_0x58b9('0x1'))(_0x58b9('0x2'));var moment=require(_0x58b9('0x3'));var BPromise=require(_0x58b9('0x4'));var rp=require(_0x58b9('0x5'));var fs=require('fs');var path=require(_0x58b9('0x6'));var rimraf=require(_0x58b9('0x7'));var config=require(_0x58b9('0x8'));var attributes=require(_0x58b9('0x9'));module[_0x58b9('0xa')]=function(_0x45f861,_0x2081dd){return _0x45f861[_0x58b9('0xb')](_0x58b9('0xc'),attributes,{'tableName':_0x58b9('0xd'),'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 0a38099..adb2eb0 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 _0xa244=['request\x20sent','VoicePrefix,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','request','then','VoicePrefix,\x20%s,\x20%s'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xa244,0xa4));var _0x4a24=function(_0x46d9c7,_0x1292a4){_0x46d9c7=_0x46d9c7-0x0;var _0x2d77cf=_0xa244[_0x46d9c7];return _0x2d77cf;};'use strict';var _=require(_0x4a24('0x0'));var util=require(_0x4a24('0x1'));var moment=require(_0x4a24('0x2'));var BPromise=require('bluebird');var rs=require(_0x4a24('0x3'));var fs=require('fs');var Redis=require(_0x4a24('0x4'));var db=require(_0x4a24('0x5'))['db'];var utils=require(_0x4a24('0x6'));var logger=require(_0x4a24('0x7'))('rpc');var config=require(_0x4a24('0x8'));var jayson=require(_0x4a24('0x9'));var client=jayson[_0x4a24('0xa')][_0x4a24('0xb')]({'port':0x232a});config[_0x4a24('0xc')]=_[_0x4a24('0xd')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x4a24('0xe'))(new Redis(config['redis']));require('./voicePrefix.socket')['register'](socket);function respondWithRpcPromise(_0x2d7c89,_0x40bb6e,_0x195685){return new BPromise(function(_0x5dc7af,_0x5590e2){return client[_0x4a24('0xf')](_0x2d7c89,_0x195685)[_0x4a24('0x10')](function(_0x2342ad){logger['info'](_0x4a24('0x11'),_0x40bb6e,_0x4a24('0x12'));logger['debug'](_0x4a24('0x13'),_0x40bb6e,'request\x20sent',JSON['stringify'](_0x2342ad));if(_0x2342ad[_0x4a24('0x14')]){if(_0x2342ad[_0x4a24('0x14')][_0x4a24('0x15')]===0x1f4){logger[_0x4a24('0x14')](_0x4a24('0x11'),_0x40bb6e,_0x2342ad[_0x4a24('0x14')][_0x4a24('0x16')]);return _0x5590e2(_0x2342ad[_0x4a24('0x14')][_0x4a24('0x16')]);}logger[_0x4a24('0x14')](_0x4a24('0x11'),_0x40bb6e,_0x2342ad[_0x4a24('0x14')][_0x4a24('0x16')]);return _0x5dc7af(_0x2342ad[_0x4a24('0x14')][_0x4a24('0x16')]);}else{logger[_0x4a24('0x17')](_0x4a24('0x11'),_0x40bb6e,_0x4a24('0x12'));_0x5dc7af(_0x2342ad[_0x4a24('0x18')][_0x4a24('0x16')]);}})[_0x4a24('0x19')](function(_0x4af20d){logger['error'](_0x4a24('0x11'),_0x40bb6e,_0x4af20d);_0x5590e2(_0x4af20d);});});} \ No newline at end of file +var _0x9df9=['client','http','defaults','redis','socket.io-emitter','./voicePrefix.socket','register','request','then','info','VoicePrefix,\x20%s,\x20%s','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x329173,_0x42d289){var _0x50afe4=function(_0x5b6d02){while(--_0x5b6d02){_0x329173['push'](_0x329173['shift']());}};_0x50afe4(++_0x42d289);}(_0x9df9,0x152));var _0x99df=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x9df9[_0x4b369d];return _0x571a98;};'use strict';var _=require(_0x99df('0x0'));var util=require(_0x99df('0x1'));var moment=require(_0x99df('0x2'));var BPromise=require(_0x99df('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x99df('0x4'));var db=require(_0x99df('0x5'))['db'];var utils=require(_0x99df('0x6'));var logger=require(_0x99df('0x7'))(_0x99df('0x8'));var config=require(_0x99df('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x99df('0xa')][_0x99df('0xb')]({'port':0x232a});config['redis']=_[_0x99df('0xc')](config[_0x99df('0xd')],{'host':'localhost','port':0x18eb});var socket=require(_0x99df('0xe'))(new Redis(config[_0x99df('0xd')]));require(_0x99df('0xf'))[_0x99df('0x10')](socket);function respondWithRpcPromise(_0x210a00,_0x268ea6,_0x32978c){return new BPromise(function(_0x1c64f9,_0x463bd){return client[_0x99df('0x11')](_0x210a00,_0x32978c)[_0x99df('0x12')](function(_0x9f898e){logger[_0x99df('0x13')](_0x99df('0x14'),_0x268ea6,_0x99df('0x15'));logger[_0x99df('0x16')](_0x99df('0x17'),_0x268ea6,_0x99df('0x15'),JSON[_0x99df('0x18')](_0x9f898e));if(_0x9f898e[_0x99df('0x19')]){if(_0x9f898e[_0x99df('0x19')][_0x99df('0x1a')]===0x1f4){logger[_0x99df('0x19')](_0x99df('0x14'),_0x268ea6,_0x9f898e[_0x99df('0x19')][_0x99df('0x1b')]);return _0x463bd(_0x9f898e[_0x99df('0x19')]['message']);}logger[_0x99df('0x19')](_0x99df('0x14'),_0x268ea6,_0x9f898e[_0x99df('0x19')]['message']);return _0x1c64f9(_0x9f898e[_0x99df('0x19')][_0x99df('0x1b')]);}else{logger[_0x99df('0x13')](_0x99df('0x14'),_0x268ea6,_0x99df('0x15'));_0x1c64f9(_0x9f898e[_0x99df('0x1c')][_0x99df('0x1b')]);}})['catch'](function(_0x3deffb){logger[_0x99df('0x19')](_0x99df('0x14'),_0x268ea6,_0x3deffb);_0x463bd(_0x3deffb);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index ed32b2f..dd936d8 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 _0xd4ff=['length','voicePrefix:','./voicePrefix.events','save','update','emit','register'];(function(_0x3668bf,_0x5b7a0c){var _0x314ded=function(_0x5c785b){while(--_0x5c785b){_0x3668bf['push'](_0x3668bf['shift']());}};_0x314ded(++_0x5b7a0c);}(_0xd4ff,0x183));var _0xfd4f=function(_0x45755f,_0x5eab04){_0x45755f=_0x45755f-0x0;var _0x47a117=_0xd4ff[_0x45755f];return _0x47a117;};'use strict';var VoicePrefixEvents=require(_0xfd4f('0x0'));var events=[_0xfd4f('0x1'),'remove',_0xfd4f('0x2')];function createListener(_0xdb7b00,_0x2a550b){return function(_0x495173){_0x2a550b[_0xfd4f('0x3')](_0xdb7b00,_0x495173);};}function removeListener(_0x5ec43e,_0x26f2e2){return function(){VoicePrefixEvents['removeListener'](_0x5ec43e,_0x26f2e2);};}exports[_0xfd4f('0x4')]=function(_0x30a2bc){for(var _0x2650c8=0x0,_0x9c1c0=events[_0xfd4f('0x5')];_0x2650c8<_0x9c1c0;_0x2650c8++){var _0x221219=events[_0x2650c8];var _0x33e082=createListener(_0xfd4f('0x6')+_0x221219,_0x30a2bc);VoicePrefixEvents['on'](_0x221219,_0x33e082);}}; \ No newline at end of file +var _0x2ff8=['update','emit','removeListener','register','length','voicePrefix:','./voicePrefix.events'];(function(_0x31d58c,_0x1ecf33){var _0x5077b3=function(_0x486f83){while(--_0x486f83){_0x31d58c['push'](_0x31d58c['shift']());}};_0x5077b3(++_0x1ecf33);}(_0x2ff8,0xd8));var _0x82ff=function(_0x5d80de,_0x2cf15d){_0x5d80de=_0x5d80de-0x0;var _0x1c7556=_0x2ff8[_0x5d80de];return _0x1c7556;};'use strict';var VoicePrefixEvents=require(_0x82ff('0x0'));var events=['save','remove',_0x82ff('0x1')];function createListener(_0x3c7982,_0x82f8a1){return function(_0x1ab9ef){_0x82f8a1[_0x82ff('0x2')](_0x3c7982,_0x1ab9ef);};}function removeListener(_0x13e7f9,_0x5bf637){return function(){VoicePrefixEvents[_0x82ff('0x3')](_0x13e7f9,_0x5bf637);};}exports[_0x82ff('0x4')]=function(_0x5e28a9){for(var _0x2621d1=0x0,_0x7c256d=events[_0x82ff('0x5')];_0x2621d1<_0x7c256d;_0x2621d1++){var _0x4c67c5=events[_0x2621d1];var _0x5e4480=createListener(_0x82ff('0x6')+_0x4c67c5,_0x5e28a9);VoicePrefixEvents['on'](_0x4c67c5,_0x5e4480);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index ba9131c..5e17ca0 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 _0xae7a=['./voiceQueue.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','/:id/teams','/:id/users','/:id/lists','getLists','post','create','/:id/clone','clone','addAgents','addLists','put','update','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x8d8291,_0x4778cb){var _0x4b95c2=function(_0x174dc6){while(--_0x174dc6){_0x8d8291['push'](_0x8d8291['shift']());}};_0x4b95c2(++_0x4778cb);}(_0xae7a,0xd8));var _0xaae7=function(_0x1f86ee,_0x407388){_0x1f86ee=_0x1f86ee-0x0;var _0x733f0=_0xae7a[_0x1f86ee];return _0x733f0;};'use strict';var multer=require('multer');var util=require(_0xaae7('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaae7('0x1'));var router=express[_0xaae7('0x2')]();var auth=require(_0xaae7('0x3'));var interaction=require(_0xaae7('0x4'));var config=require(_0xaae7('0x5'));var controller=require(_0xaae7('0x6'));router[_0xaae7('0x7')]('/',auth[_0xaae7('0x8')](),controller[_0xaae7('0x9')]);router[_0xaae7('0x7')](_0xaae7('0xa'),auth['isAuthenticated'](),controller[_0xaae7('0xb')]);router[_0xaae7('0x7')](_0xaae7('0xc'),auth['isAuthenticated'](),controller[_0xaae7('0xd')]);router[_0xaae7('0x7')](_0xaae7('0xe'),auth['isAuthenticated'](),controller[_0xaae7('0xf')]);router[_0xaae7('0x7')](_0xaae7('0x10'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x11')]);router[_0xaae7('0x7')](_0xaae7('0x12'),auth[_0xaae7('0x8')](),controller['getHopperBlacks']);router[_0xaae7('0x7')](_0xaae7('0x13'),auth[_0xaae7('0x8')](),controller['getTeams']);router[_0xaae7('0x7')](_0xaae7('0x14'),auth[_0xaae7('0x8')](),controller['getAgents']);router[_0xaae7('0x7')]('/:id/members',auth[_0xaae7('0x8')](),controller['getMembers']);router[_0xaae7('0x7')](_0xaae7('0x15'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x16')]);router[_0xaae7('0x7')]('/:id/blacklists',auth[_0xaae7('0x8')](),controller['getBlackLists']);router[_0xaae7('0x17')]('/',auth[_0xaae7('0x8')](),controller[_0xaae7('0x18')]);router[_0xaae7('0x17')](_0xaae7('0x19'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x1a')]);router[_0xaae7('0x17')](_0xaae7('0x13'),auth[_0xaae7('0x8')](),controller['addTeams']);router[_0xaae7('0x17')](_0xaae7('0x14'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x1b')]);router[_0xaae7('0x17')]('/:id/lists',auth[_0xaae7('0x8')](),controller[_0xaae7('0x1c')]);router[_0xaae7('0x17')]('/:id/blacklists',auth['isAuthenticated'](),controller['addBlackLists']);router[_0xaae7('0x1d')](_0xaae7('0xa'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x1e')]);router[_0xaae7('0x1f')](_0xaae7('0xa'),auth[_0xaae7('0x8')](),controller['destroy']);router[_0xaae7('0x1f')]('/:id/teams',auth['isAuthenticated'](),controller[_0xaae7('0x20')]);router['delete'](_0xaae7('0x14'),auth['isAuthenticated'](),controller[_0xaae7('0x21')]);router['delete'](_0xaae7('0x15'),auth[_0xaae7('0x8')](),controller[_0xaae7('0x22')]);router[_0xaae7('0x1f')]('/:id/blacklists',auth[_0xaae7('0x8')](),controller[_0xaae7('0x23')]);module[_0xaae7('0x24')]=router; \ No newline at end of file +var _0x3e87=['/:id/users','getAgents','/:id/members','/:id/lists','getLists','/:id/blacklists','getBlackLists','post','create','/:id/clone','addTeams','addAgents','addLists','addBlackLists','put','update','delete','destroy','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','/:id','show','/:id/hoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_black','getHopperBlacks','/:id/teams','getTeams'];(function(_0x4fec50,_0x38ba85){var _0x4fa481=function(_0x48d608){while(--_0x48d608){_0x4fec50['push'](_0x4fec50['shift']());}};_0x4fa481(++_0x38ba85);}(_0x3e87,0x119));var _0x73e8=function(_0x1d2dfd,_0x25c584){_0x1d2dfd=_0x1d2dfd-0x0;var _0x48f9ef=_0x3e87[_0x1d2dfd];return _0x48f9ef;};'use strict';var multer=require(_0x73e8('0x0'));var util=require('util');var path=require(_0x73e8('0x1'));var timeout=require(_0x73e8('0x2'));var express=require(_0x73e8('0x3'));var router=express[_0x73e8('0x4')]();var auth=require(_0x73e8('0x5'));var interaction=require(_0x73e8('0x6'));var config=require(_0x73e8('0x7'));var controller=require(_0x73e8('0x8'));router[_0x73e8('0x9')]('/',auth[_0x73e8('0xa')](),controller['index']);router[_0x73e8('0x9')](_0x73e8('0xb'),auth[_0x73e8('0xa')](),controller[_0x73e8('0xc')]);router[_0x73e8('0x9')](_0x73e8('0xd'),auth[_0x73e8('0xa')](),controller['getHoppers']);router['get'](_0x73e8('0xe'),auth[_0x73e8('0xa')](),controller[_0x73e8('0xf')]);router[_0x73e8('0x9')]('/:id/hopper_finals',auth[_0x73e8('0xa')](),controller['getHopperFinals']);router['get'](_0x73e8('0x10'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x11')]);router[_0x73e8('0x9')](_0x73e8('0x12'),auth['isAuthenticated'](),controller[_0x73e8('0x13')]);router[_0x73e8('0x9')](_0x73e8('0x14'),auth['isAuthenticated'](),controller[_0x73e8('0x15')]);router[_0x73e8('0x9')](_0x73e8('0x16'),auth[_0x73e8('0xa')](),controller['getMembers']);router['get'](_0x73e8('0x17'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x18')]);router[_0x73e8('0x9')](_0x73e8('0x19'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x1a')]);router[_0x73e8('0x1b')]('/',auth[_0x73e8('0xa')](),controller[_0x73e8('0x1c')]);router[_0x73e8('0x1b')](_0x73e8('0x1d'),auth['isAuthenticated'](),controller['clone']);router[_0x73e8('0x1b')](_0x73e8('0x12'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x1e')]);router[_0x73e8('0x1b')](_0x73e8('0x14'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x1f')]);router[_0x73e8('0x1b')](_0x73e8('0x17'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x20')]);router[_0x73e8('0x1b')](_0x73e8('0x19'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x21')]);router[_0x73e8('0x22')](_0x73e8('0xb'),auth['isAuthenticated'](),controller[_0x73e8('0x23')]);router[_0x73e8('0x24')](_0x73e8('0xb'),auth['isAuthenticated'](),controller[_0x73e8('0x25')]);router[_0x73e8('0x24')]('/:id/teams',auth[_0x73e8('0xa')](),controller[_0x73e8('0x26')]);router[_0x73e8('0x24')](_0x73e8('0x14'),auth['isAuthenticated'](),controller[_0x73e8('0x27')]);router[_0x73e8('0x24')]('/:id/lists',auth['isAuthenticated'](),controller[_0x73e8('0x28')]);router['delete'](_0x73e8('0x19'),auth[_0x73e8('0xa')](),controller[_0x73e8('0x29')]);module[_0x73e8('0x2a')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index 49e0ebe..8fee166 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 _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\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','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x358436,_0x5c3c5f){var _0x343cb=function(_0x3b2391){while(--_0x3b2391){_0x358436['push'](_0x358436['shift']());}};_0x343cb(++_0x5c3c5f);}(_0xa9e0,0x123));var _0x0a9e=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0xa9e0[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0xa9e0=['getDataValue','booked','roundrobin','progressive','predictive','power','INTEGER','yes','all','once','TEXT','periodic_announce','join','split','joinempty','leavewhenempty','acw','wrapuptime','BOOLEAN','Active/Disactive\x20Campaign','preview','Dial\x20Method.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','Only\x20for\x20predictive\x20method.','FLOAT','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\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','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','#RecallMe\x20Timeout\x20(min:1)','ASC','DESC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','#NoSuchNumber\x20Retry\x20(min:1,\x20max:999)','NoSuchNumber\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Drop\x20Retry\x20(min:1,\x20max:999)','Drop\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','Machine\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#AgentReject\x20Retry\x20(min:1,\x20max:999)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDisposition','sequelize','exports','STRING','inbound','default','ENUM','leastrecent','fewestcalls','random','wrandom','setDataValue','strategy','rrmemory'];(function(_0x5a9397,_0x2e444c){var _0x5b89be=function(_0x17d763){while(--_0x17d763){_0x5a9397['push'](_0x5a9397['shift']());}};_0x5b89be(++_0x2e444c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xa9e0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x3'),'outbound'),'allowNull':![],'defaultValue':_0x0a9e('0x3')},'musiconhold':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x4')},'announce':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'strategy':{'type':Sequelize[_0x0a9e('0x5')]('rr','ringall',_0x0a9e('0x6'),_0x0a9e('0x7'),_0x0a9e('0x8'),'rrmemory','linear',_0x0a9e('0x9'),'rrordered'),'allowNull':![],'defaultValue':'ringall','set':function(_0x39753a){this[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x39753a?_0x39753a:_0x0a9e('0xc'));},'get':function(){var _0xfeb75b=this[_0x0a9e('0xd')]('type');var _0x50dfb2=this['getDataValue']('dialMethod');var _0x273d4d=this[_0x0a9e('0xd')](_0x0a9e('0xb'));if(_0xfeb75b===_0x0a9e('0x3')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0xe')&&_0x273d4d===_0x0a9e('0xc')||_0x50dfb2==='booked'&&_0x273d4d===_0x0a9e('0xf')){return _0x273d4d;}if(_0x50dfb2===_0x0a9e('0x10')||_0x50dfb2===_0x0a9e('0x11')||_0x50dfb2===_0x0a9e('0x12')){return _0x273d4d;}return null;}},'servicelevel':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize[_0x0a9e('0x2')]},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':_0x0a9e('0x14')},'autopause':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no',_0x0a9e('0x15')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x0a9e('0x13')](0xb)},'autopausebusy':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x0a9e('0x5')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0x0a9e('0x13')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':_0x0a9e('0x14')},'announce_holdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no',_0x0a9e('0x16')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0x0a9e('0x5')]('yes','no')},'announce_position_limit':{'type':Sequelize['INTEGER'](0xb)},'announce_round_seconds':{'type':Sequelize[_0x0a9e('0x5')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x0a9e('0x2')]},'queue_youarenext':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize['STRING'],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize['STRING'],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize['STRING'],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity1':{'type':Sequelize[_0x0a9e('0x2')]},'queue_quantity2':{'type':Sequelize[_0x0a9e('0x2')]},'queue_periodic_announce':{'type':Sequelize[_0x0a9e('0x2')]},'queue_less_than':{'type':Sequelize[_0x0a9e('0x2')]},'periodic_announce':{'type':Sequelize[_0x0a9e('0x17')],'set':function(_0x5a101a){this[_0x0a9e('0xa')](_0x0a9e('0x18'),_0x5a101a?_0x5a101a[_0x0a9e('0x19')](','):[]);},'get':function(){return this[_0x0a9e('0xd')]('periodic_announce')?this[_0x0a9e('0xd')](_0x0a9e('0x18'))[_0x0a9e('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x14'),'set':function(_0x563b45){this[_0x0a9e('0xa')](_0x0a9e('0x1b'),_0x563b45?_0x563b45[_0x0a9e('0x19')](','):undefined);},'get':function(){return this['getDataValue'](_0x0a9e('0x1b'))?this['getDataValue'](_0x0a9e('0x1b'))[_0x0a9e('0x1a')](','):undefined;}},'leavewhenempty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':'no','set':function(_0x33bdb7){this[_0x0a9e('0xa')]('leavewhenempty',_0x33bdb7?_0x33bdb7[_0x0a9e('0x19')](','):undefined);},'get':function(){return this[_0x0a9e('0xd')](_0x0a9e('0x1c'))?this[_0x0a9e('0xd')](_0x0a9e('0x1c'))[_0x0a9e('0x1a')](','):undefined;}},'reportholdtime':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x14'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0x0a9e('0x2')]},'description':{'type':Sequelize[_0x0a9e('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x191e91){this[_0x0a9e('0xa')](_0x0a9e('0x1d'),_0x191e91);if(_0x191e91){if(this[_0x0a9e('0xd')]('wrapuptime')<0x2){this['setDataValue'](_0x0a9e('0x1e'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':_0x0a9e('0x20')},'dialMethod':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x21'),'progressive',_0x0a9e('0x12'),_0x0a9e('0x11'),_0x0a9e('0xe')),'defaultValue':'progressive','comment':_0x0a9e('0x22')},'dialLimitChannel':{'type':Sequelize[_0x0a9e('0x13')](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':'Max\x209999\x20channels,\x200\x20means\x20unlimited.'},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x0a9e('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x0a9e('0x24')},'dialPowerLevel':{'type':Sequelize['FLOAT'](0x2)[_0x0a9e('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x0a9e('0x25')},'dialPredictiveOptimization':{'type':Sequelize[_0x0a9e('0x5')](_0x0a9e('0x26'),'dropRate'),'defaultValue':'dropRate','comment':_0x0a9e('0x27')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x0a9e('0x28')](0x2)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x0a9e('0x29')},'dialPredictiveInterval':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':'Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)'},'dialOriginateCallerIdName':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x0a9e('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2a')},'dialQueueOptions':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x2b'),'comment':_0x0a9e('0x2c')},'dialQueueTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x2d')},'dialQueueProject':{'type':Sequelize[_0x0a9e('0x2')],'comment':_0x0a9e('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x2f')},'dialBusyMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'comment':_0x0a9e('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x33')},'dialGlobalMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x0a9e('0x34')},'dialTimezone':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':_0x0a9e('0x35')},'dialPrefix':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize['ENUM'](_0x0a9e('0x36'),'never',_0x0a9e('0x37')),'defaultValue':_0x0a9e('0x36')},'dialAMDActive':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0x0a9e('0x38')},'dialAMDGreeting':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x0a9e('0x39')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x0a9e('0x3a')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3b')},'dialAMDMinWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x0a9e('0x3c')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x0a9e('0x3d')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x0a9e('0x13')](0x9)[_0x0a9e('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x0a9e('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0x0a9e('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':0x0,'comment':'Active/Disactive\x20Recall\x20In\x20Queue'},'dialOrderByScheduledAt':{'type':Sequelize['ENUM']('DESC',_0x0a9e('0x40')),'defaultValue':_0x0a9e('0x41')},'dialQueueProject2':{'type':Sequelize[_0x0a9e('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x0a9e('0x42')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'},'dialNoSuchNumberMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x43')},'dialNoSuchNumberRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x44')},'dialDropMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x45')},'dialDropRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x46')},'dialAbandonedMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Abandoned\x20Retry\x20(min:1,\x20max:999)'},'dialAbandonedRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Abandoned\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialMachineMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Machine\x20Retry\x20(min:1,\x20max:999)'},'dialMachineRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x0a9e('0x47')},'dialAgentRejectMaxRetry':{'type':Sequelize[_0x0a9e('0x13')](0x3)[_0x0a9e('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x0a9e('0x48')},'dialAgentRejectRetryFrequency':{'type':Sequelize[_0x0a9e('0x13')](0x5)[_0x0a9e('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'AgentReject\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'mandatoryDispositionPauseId':{'type':Sequelize[_0x0a9e('0x13')],'allowNull':!![],'comment':_0x0a9e('0x49')},'mandatoryDisposition':{'type':Sequelize[_0x0a9e('0x1f')],'defaultValue':![],'comment':_0x0a9e('0x4a'),'set':function(_0xb83dfd){if(!_0xb83dfd)this[_0x0a9e('0xa')]('mandatoryDispositionPauseId',null);this[_0x0a9e('0xa')](_0x0a9e('0x4b'),_0xb83dfd);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x0a9e('0x23')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.controller.js b/server/api/voiceQueue/voiceQueue.controller.js index e01bdbc..49b26d3 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 _0xc06d=['to-csv','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','register','sendStatus','end','status','json','count','offset','limit','set','apply','save','update','then','destroy','get','VoiceQueues','inbound','outbound','filter','ignore','map','value','includes','type','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','fieldName','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','nolimit','sort','where','merge','VIRTUAL','options','includeAll','findAll','show','params','rawAttributes','include','catch','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','QueueCampaigns','UserProfileSection','autoAssociation','clone','createdAt','body','omit','updatedAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','CmHopper','VoiceQueueId','rows','getHopperHistories','CmHopperHistory','pick','getHopperFinals','order','CmHopperFinal','CmHopperBlack','getTeams','Team','addTeams','teams','User','Agents','online','voicePause','flatMap','penalty','sequelize','transaction','each','UserVoiceQueueRt','upsert','isNil','format','SIP/%s','interface','forEach','userVoiceQueue:save','removeTeams','ids','select','tq.TeamId','from','join','user_has_teams','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','all','union','isEmpty','emit','addAgents','spread','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','insert','into','cm_hopper','fromQuery','scheduledAt','ContactId','ListId','field','phone','NOW()','CmListId','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','cm_contacts','COALESCE(phone,\x27\x27)','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','sox'];(function(_0x16f7a7,_0x2baa01){var _0x29db24=function(_0x4166a5){while(--_0x4166a5){_0x16f7a7['push'](_0x16f7a7['shift']());}};_0x29db24(++_0x2baa01);}(_0xc06d,0x15a));var _0xdc06=function(_0x342cfd,_0xde4e4d){_0x342cfd=_0x342cfd-0x0;var _0x117be0=_0xc06d[_0x342cfd];return _0x117be0;};'use strict';var pdf=require(_0xdc06('0x0'));var emlformat=require(_0xdc06('0x1'));var rimraf=require(_0xdc06('0x2'));var zipdir=require(_0xdc06('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdc06('0x4'));var moment=require(_0xdc06('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xdc06('0x6'));var path=require('path');var sox=require(_0xdc06('0x7'));var csv=require(_0xdc06('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xdc06('0x9'));var crypto=require(_0xdc06('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xdc06('0xb'));var toCsv=require(_0xdc06('0x8'));var querystring=require(_0xdc06('0xc'));var Papa=require(_0xdc06('0xd'));var Redis=require(_0xdc06('0xe'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xdc06('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xdc06('0x10'))(_0xdc06('0x11'));var utils=require(_0xdc06('0x12'));var config=require(_0xdc06('0x13'));var db=require(_0xdc06('0x14'))['db'];config[_0xdc06('0x15')]=_['defaults'](config['redis'],{'host':_0xdc06('0x16'),'port':0x18eb});var socket=require(_0xdc06('0x17'))(new Redis(config[_0xdc06('0x15')]));require('./voiceQueue.socket')[_0xdc06('0x18')](socket);function respondWithStatusCode(_0x18c5de,_0x40ea3b){_0x40ea3b=_0x40ea3b||0xcc;return function(_0x2b0c69){if(_0x2b0c69){return _0x18c5de[_0xdc06('0x19')](_0x40ea3b);}return _0x18c5de['status'](_0x40ea3b)[_0xdc06('0x1a')]();};}function respondWithResult(_0x5a0ed2,_0x3aeca3){_0x3aeca3=_0x3aeca3||0xc8;return function(_0x2afe2e){if(_0x2afe2e){return _0x5a0ed2[_0xdc06('0x1b')](_0x3aeca3)[_0xdc06('0x1c')](_0x2afe2e);}};}function respondWithFilteredResult(_0x251ba5,_0x4d3a1f){return function(_0x307172){if(_0x307172){var _0x3b3d8b=_0x307172[_0xdc06('0x1d')],_0x79b1e0=_0x4d3a1f[_0xdc06('0x1e')],_0x5ca232=_0x4d3a1f[_0xdc06('0x1e')]+_0x4d3a1f[_0xdc06('0x1f')],_0x3f180e;if(_0x5ca232>=_0x3b3d8b){_0x5ca232=_0x3b3d8b;_0x3f180e=0xc8;}else{_0x3f180e=0xce;}_0x251ba5['status'](_0x3f180e);return _0x251ba5[_0xdc06('0x20')]('Content-Range',_0x79b1e0+'-'+_0x5ca232+'/'+_0x3b3d8b)[_0xdc06('0x1c')](_0x307172);}return null;};}function patchUpdates(_0x40c112){return function(_0x377362){try{jsonpatch[_0xdc06('0x21')](_0x377362,_0x40c112,!![]);}catch(_0x1d245b){return BPromise['reject'](_0x1d245b);}return _0x377362[_0xdc06('0x22')]();};}function saveUpdates(_0x3199c6,_0x93911){return function(_0x1394ee){if(_0x1394ee){return _0x1394ee[_0xdc06('0x23')](_0x3199c6)[_0xdc06('0x24')](function(_0x41f64e){return _0x41f64e;});}return null;};}function removeEntity(_0x505f22,_0x4c5cf1){return function(_0x57e3d1){if(_0x57e3d1){return _0x57e3d1[_0xdc06('0x25')]()[_0xdc06('0x24')](function(){var _0xa685a8=_0x57e3d1[_0xdc06('0x26')]({'plain':!![]});var _0x40d645=[{'name':_0xdc06('0x27'),'value':_0xdc06('0x28'),'ignore':![]},{'name':'QueueCampaigns','value':_0xdc06('0x29'),'ignore':![]}];var _0x52cdac=_(_0x40d645)[_0xdc06('0x2a')](_0xdc06('0x2b'))[_0xdc06('0x2c')](_0xdc06('0x2d'))[_0xdc06('0x2d')]();if(_[_0xdc06('0x2e')](_0x52cdac,_0xa685a8[_0xdc06('0x2f')])){return;}var _0x3b7c80=_[_0xdc06('0x30')](_0x40d645,[_0xdc06('0x2d'),_0xa685a8[_0xdc06('0x2f')]])[_0xdc06('0x31')];return db[_0xdc06('0x32')][_0xdc06('0x25')]({'where':{'type':_0x3b7c80,'resourceId':_0xa685a8['id']}})['then'](function(){return _0x57e3d1;});})[_0xdc06('0x24')](function(){_0x505f22[_0xdc06('0x1b')](0xcc)[_0xdc06('0x1a')]();});}};}function handleEntityNotFound(_0x159550,_0x210270){return function(_0x5d465b){if(!_0x5d465b){_0x159550[_0xdc06('0x19')](0x194);}return _0x5d465b;};}function handleError(_0x17bfe3,_0x2ca502){_0x2ca502=_0x2ca502||0x1f4;return function(_0x374978){logger[_0xdc06('0x33')](_0x374978[_0xdc06('0x34')]);if(_0x374978['name']){delete _0x374978[_0xdc06('0x31')];}_0x17bfe3['status'](_0x2ca502)[_0xdc06('0x35')](_0x374978);};}exports[_0xdc06('0x36')]=function(_0xef4473,_0x3ddaec){var _0x126c12={},_0xfe1df={},_0x364cba={'count':0x0,'rows':[]};var _0x33759d=_[_0xdc06('0x2c')](db[_0xdc06('0x37')]['rawAttributes'],function(_0x5c57e0){return{'name':_0x5c57e0[_0xdc06('0x38')],'type':_0x5c57e0[_0xdc06('0x2f')][_0xdc06('0x39')]};});_0xfe1df['model']=_['map'](_0x33759d,_0xdc06('0x31'));_0xfe1df[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0xef4473[_0xdc06('0x3a')]);_0xfe1df[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0xfe1df[_0xdc06('0x3e')],_0xfe1df[_0xdc06('0x3a')]);_0x126c12['attributes']=_[_0xdc06('0x3d')](_0xfe1df[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0xef4473[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x126c12['attributes']=_0x126c12['attributes'][_0xdc06('0x40')]?_0x126c12[_0xdc06('0x41')]:_0xfe1df[_0xdc06('0x3e')];if(!_0xef4473[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x126c12[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0xef4473[_0xdc06('0x3a')]['limit']);_0x126c12[_0xdc06('0x1e')]=qs[_0xdc06('0x1e')](_0xef4473[_0xdc06('0x3a')][_0xdc06('0x1e')]);}_0x126c12['order']=qs[_0xdc06('0x44')](_0xef4473[_0xdc06('0x3a')][_0xdc06('0x44')]);_0x126c12[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_['pick'](_0xef4473[_0xdc06('0x3a')],_0xfe1df[_0xdc06('0x3c')]));if(_0xef4473['query'][_0xdc06('0x2a')]){_0x126c12[_0xdc06('0x45')]=_[_0xdc06('0x46')](_0x126c12['where'],{'$or':_[_0xdc06('0x2c')](_0x33759d,function(_0xafb982){if(_0xafb982[_0xdc06('0x2f')]!==_0xdc06('0x47')){var _0x1cde77={};_0x1cde77[_0xafb982[_0xdc06('0x31')]]={'$like':'%'+_0xef4473[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x1cde77;}})});}_0x126c12=_[_0xdc06('0x46')]({},_0x126c12,_0xef4473[_0xdc06('0x48')]);var _0x4d1bc6={'where':_0x126c12[_0xdc06('0x45')]};return db[_0xdc06('0x37')][_0xdc06('0x1d')](_0x4d1bc6)[_0xdc06('0x24')](function(_0x1e3b94){_0x364cba['count']=_0x1e3b94;if(_0xef4473[_0xdc06('0x3a')][_0xdc06('0x49')]){_0x126c12['include']=[{'all':!![]}];}return db['VoiceQueue'][_0xdc06('0x4a')](_0x126c12);})['then'](function(_0x34a0c7){_0x364cba['rows']=_0x34a0c7;return _0x364cba;})[_0xdc06('0x24')](respondWithFilteredResult(_0x3ddaec,_0x126c12))['catch'](handleError(_0x3ddaec,null));};exports[_0xdc06('0x4b')]=function(_0x46244f,_0x232d79){var _0x18fd6d={'raw':![],'where':{'id':_0x46244f[_0xdc06('0x4c')]['id']}},_0x24a749={};_0x24a749[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db[_0xdc06('0x37')][_0xdc06('0x4d')]);_0x24a749[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x46244f['query']);_0x24a749[_0xdc06('0x3c')]=_['intersection'](_0x24a749['model'],_0x24a749[_0xdc06('0x3a')]);_0x18fd6d[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x24a749[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0x46244f[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x18fd6d[_0xdc06('0x41')]=_0x18fd6d[_0xdc06('0x41')]['length']?_0x18fd6d[_0xdc06('0x41')]:_0x24a749[_0xdc06('0x3e')];if(_0x46244f[_0xdc06('0x3a')]['includeAll']){_0x18fd6d[_0xdc06('0x4e')]=[{'all':!![]}];}_0x18fd6d=_[_0xdc06('0x46')]({},_0x18fd6d,_0x46244f[_0xdc06('0x48')]);return db[_0xdc06('0x37')][_0xdc06('0x30')](_0x18fd6d)[_0xdc06('0x24')](handleEntityNotFound(_0x232d79,null))[_0xdc06('0x24')](respondWithResult(_0x232d79,null))[_0xdc06('0x4f')](handleError(_0x232d79,null));};exports[_0xdc06('0x50')]=function(_0x5bf68f,_0x35adc1){return db[_0xdc06('0x37')][_0xdc06('0x50')](_0x5bf68f['body'],{})[_0xdc06('0x24')](function(_0xb890c4){var _0x3a7549=_0x5bf68f['user'][_0xdc06('0x26')]({'plain':!![]});if(!_0x3a7549)throw new Error(_0xdc06('0x51'));if(_0x3a7549[_0xdc06('0x52')]===_0xdc06('0x53')){var _0x146578=_0xb890c4['get']({'plain':!![]});var _0xa9d89c=[{'name':'VoiceQueues','value':_0xdc06('0x28')},{'name':_0xdc06('0x54'),'value':_0xdc06('0x29')}];var _0x54dad8=_[_0xdc06('0x30')](_0xa9d89c,['value',_0x146578[_0xdc06('0x2f')]])[_0xdc06('0x31')];return db[_0xdc06('0x55')]['find']({'where':{'name':_0x54dad8,'userProfileId':_0x3a7549['userProfileId']},'raw':!![]})['then'](function(_0x5892cf){if(_0x5892cf&&_0x5892cf[_0xdc06('0x56')]===0x0){return db[_0xdc06('0x32')]['create']({'name':_0x146578['name'],'resourceId':_0x146578['id'],'type':_0x5892cf['name'],'sectionId':_0x5892cf['id']},{})[_0xdc06('0x24')](function(){return _0xb890c4;});}else{return _0xb890c4;}})['catch'](function(_0x388fa4){logger[_0xdc06('0x33')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x388fa4);throw _0x388fa4;});}return _0xb890c4;})[_0xdc06('0x24')](respondWithResult(_0x35adc1,0xc9))[_0xdc06('0x4f')](handleError(_0x35adc1,null));};exports[_0xdc06('0x57')]=function(_0x2f07b3,_0x3484f3){var _0x132ad9={'where':{'id':_0x2f07b3[_0xdc06('0x4c')]['id']}},_0x50ec53={};_0x50ec53['model']=_['keys'](db[_0xdc06('0x37')][_0xdc06('0x4d')]);_0x132ad9[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x50ec53[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0x2f07b3[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x132ad9[_0xdc06('0x41')]=_0x132ad9[_0xdc06('0x41')]['length']?_0x132ad9[_0xdc06('0x41')]:_0x50ec53[_0xdc06('0x3e')];if(_0x2f07b3[_0xdc06('0x3a')][_0xdc06('0x49')]){_0x132ad9[_0xdc06('0x4e')]=[{'all':!![]}];}_0x132ad9=_['merge']({},_0x132ad9,_0x2f07b3[_0xdc06('0x48')]);return db[_0xdc06('0x37')][_0xdc06('0x30')](_0x132ad9)[_0xdc06('0x24')](handleEntityNotFound(_0x3484f3,null))[_0xdc06('0x24')](function(_0xc28038){if(_0xc28038){var _0x297397=_0xc28038[_0xdc06('0x26')]({'plain':!![]});_0x297397=qs['omit'](_0x297397,['id',_0xdc06('0x58'),'updatedAt']);_0x2f07b3[_0xdc06('0x59')]=_[_0xdc06('0x5a')](_0x2f07b3[_0xdc06('0x59')],['id',_0xdc06('0x58'),_0xdc06('0x5b')]);return db['VoiceQueue'][_0xdc06('0x50')](_[_0xdc06('0x46')](_0x297397,_0x2f07b3['body']),{'include':_0x2f07b3[_0xdc06('0x3a')][_0xdc06('0x49')]?[{'all':!![]}]:undefined})['then'](function(_0x463623){var _0x29e619=_0x2f07b3['user'][_0xdc06('0x26')]({'plain':!![]});if(!_0x29e619)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x29e619[_0xdc06('0x52')]===_0xdc06('0x53')){var _0x24c426=_0x463623[_0xdc06('0x26')]({'plain':!![]});var _0xbb08f4=[{'name':_0xdc06('0x27'),'value':'inbound'},{'name':_0xdc06('0x54'),'value':_0xdc06('0x29')}];var _0x326adb=_[_0xdc06('0x30')](_0xbb08f4,[_0xdc06('0x2d'),_0x24c426['type']])['name'];return db[_0xdc06('0x55')][_0xdc06('0x30')]({'where':{'name':_0x326adb,'userProfileId':_0x29e619['userProfileId']},'raw':!![]})[_0xdc06('0x24')](function(_0x5ea966){if(_0x5ea966&&_0x5ea966['autoAssociation']===0x0){return db[_0xdc06('0x32')][_0xdc06('0x50')]({'name':_0x24c426[_0xdc06('0x31')],'resourceId':_0x24c426['id'],'type':_0x5ea966[_0xdc06('0x31')],'sectionId':_0x5ea966['id']},{})[_0xdc06('0x24')](function(){return _0x463623;});}else{return _0x463623;}})[_0xdc06('0x4f')](function(_0x2b4283){logger['error'](_0xdc06('0x5c'),_0x2b4283);throw _0x2b4283;});}return _0x463623;});}})[_0xdc06('0x24')](respondWithResult(_0x3484f3,0xc9))[_0xdc06('0x4f')](handleError(_0x3484f3,null));};exports[_0xdc06('0x23')]=function(_0x5b45fd,_0x240293){if(_0x5b45fd['body']['id']){delete _0x5b45fd[_0xdc06('0x59')]['id'];}return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x5b45fd[_0xdc06('0x4c')]['id']}})['then'](handleEntityNotFound(_0x240293,null))[_0xdc06('0x24')](saveUpdates(_0x5b45fd[_0xdc06('0x59')],null))['then'](respondWithResult(_0x240293,null))['catch'](handleError(_0x240293,null));};exports[_0xdc06('0x25')]=function(_0x1733da,_0x51061a){return db[_0xdc06('0x37')]['find']({'where':{'id':_0x1733da[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x51061a,null))['then'](removeEntity(_0x51061a,null))[_0xdc06('0x4f')](handleError(_0x51061a,null));};exports[_0xdc06('0x5d')]=function(_0xc8a673,_0x23a1cc,_0x7f99c5){var _0x4c4595={'raw':![],'where':{}};var _0x48ba1d={};var _0x33edc5={'count':0x0,'rows':[]};return db[_0xdc06('0x37')][_0xdc06('0x5e')]({'where':{'id':_0xc8a673[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x23a1cc,null))[_0xdc06('0x24')](function(_0x374dc2){if(_0x374dc2){_0x48ba1d[_0xdc06('0x3e')]=_['keys'](db[_0xdc06('0x5f')][_0xdc06('0x4d')]);_0x48ba1d['query']=_['keys'](_0xc8a673[_0xdc06('0x3a')]);_0x48ba1d[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0x48ba1d[_0xdc06('0x3e')],_0x48ba1d[_0xdc06('0x3a')]);_0x4c4595[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x48ba1d[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0xc8a673[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x4c4595[_0xdc06('0x41')]=_0x4c4595[_0xdc06('0x41')]['length']?_0x4c4595[_0xdc06('0x41')]:_0x48ba1d[_0xdc06('0x3e')];if(!_0xc8a673[_0xdc06('0x3a')]['hasOwnProperty'](_0xdc06('0x43'))){_0x4c4595[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0xc8a673['query'][_0xdc06('0x1f')]);_0x4c4595[_0xdc06('0x1e')]=qs[_0xdc06('0x1e')](_0xc8a673[_0xdc06('0x3a')][_0xdc06('0x1e')]);}_0x4c4595['order']=qs['sort'](_0xc8a673['query']['sort']);_0x4c4595[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_['pick'](_0xc8a673[_0xdc06('0x3a')],_0x48ba1d[_0xdc06('0x3c')]));_0x4c4595['where'][_0xdc06('0x60')]=_0x374dc2['id'];if(_0xc8a673[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x4c4595[_0xdc06('0x45')]=_[_0xdc06('0x46')](_0x4c4595[_0xdc06('0x45')],{'$or':_[_0xdc06('0x2c')](_0x4c4595[_0xdc06('0x41')],function(_0x315922){var _0x433105={};_0x433105[_0x315922]={'$like':'%'+_0xc8a673[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x433105;})});}_0x4c4595=_['merge']({},_0x4c4595,_0xc8a673[_0xdc06('0x48')]);return db['CmHopper']['count']({'where':_0x4c4595[_0xdc06('0x45')]})['then'](function(_0x4d56c9){_0x33edc5[_0xdc06('0x1d')]=_0x4d56c9;if(_0xc8a673[_0xdc06('0x3a')][_0xdc06('0x49')]){_0x4c4595[_0xdc06('0x4e')]=[{'all':!![]}];}return db[_0xdc06('0x5f')]['findAll'](_0x4c4595);})[_0xdc06('0x24')](function(_0x3300e7){_0x33edc5[_0xdc06('0x61')]=_0x3300e7;return _0x33edc5;});}})[_0xdc06('0x24')](respondWithFilteredResult(_0x23a1cc,_0x4c4595))[_0xdc06('0x4f')](handleError(_0x23a1cc,null));};exports[_0xdc06('0x62')]=function(_0x6ce6ed,_0x2c8543,_0xcea0b6){var _0x3b8c93={'raw':!![],'where':{}};var _0x3d36e8={};var _0x8461b3={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdc06('0x5e')]({'where':{'id':_0x6ce6ed[_0xdc06('0x4c')]['id']}})['then'](handleEntityNotFound(_0x2c8543,null))['then'](function(_0x311c63){if(_0x311c63){_0x3d36e8[_0xdc06('0x3e')]=_['keys'](db[_0xdc06('0x63')][_0xdc06('0x4d')]);_0x3d36e8[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x6ce6ed[_0xdc06('0x3a')]);_0x3d36e8[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0x3d36e8[_0xdc06('0x3e')],_0x3d36e8[_0xdc06('0x3a')]);_0x3b8c93['attributes']=_[_0xdc06('0x3d')](_0x3d36e8[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0x6ce6ed[_0xdc06('0x3a')]['fields']));_0x3b8c93[_0xdc06('0x41')]=_0x3b8c93[_0xdc06('0x41')][_0xdc06('0x40')]?_0x3b8c93[_0xdc06('0x41')]:_0x3d36e8[_0xdc06('0x3e')];if(!_0x6ce6ed[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x3b8c93[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0x6ce6ed['query']['limit']);_0x3b8c93[_0xdc06('0x1e')]=qs['offset'](_0x6ce6ed['query']['offset']);}_0x3b8c93['order']=qs[_0xdc06('0x44')](_0x6ce6ed[_0xdc06('0x3a')]['sort']);_0x3b8c93[_0xdc06('0x45')]=qs['filters'](_[_0xdc06('0x64')](_0x6ce6ed['query'],_0x3d36e8[_0xdc06('0x3c')]));_0x3b8c93[_0xdc06('0x45')]['VoiceQueueId']=_0x311c63['id'];if(_0x6ce6ed[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x3b8c93[_0xdc06('0x45')]=_[_0xdc06('0x46')](_0x3b8c93['where'],{'$or':_['map'](_0x3b8c93['attributes'],function(_0x590dff){var _0xe54777={};_0xe54777[_0x590dff]={'$like':'%'+_0x6ce6ed[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0xe54777;})});}_0x3b8c93=_[_0xdc06('0x46')]({},_0x3b8c93,_0x6ce6ed[_0xdc06('0x48')]);return db[_0xdc06('0x63')][_0xdc06('0x1d')]({'where':_0x3b8c93[_0xdc06('0x45')]})[_0xdc06('0x24')](function(_0x20ffbe){_0x8461b3[_0xdc06('0x1d')]=_0x20ffbe;if(_0x6ce6ed['query']['includeAll']){_0x3b8c93[_0xdc06('0x4e')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xdc06('0x4a')](_0x3b8c93);})[_0xdc06('0x24')](function(_0x54093a){_0x8461b3[_0xdc06('0x61')]=_0x54093a;return _0x8461b3;});}})[_0xdc06('0x24')](respondWithFilteredResult(_0x2c8543,_0x3b8c93))[_0xdc06('0x4f')](handleError(_0x2c8543,null));};exports[_0xdc06('0x65')]=function(_0x48629e,_0xa886d8,_0x3b64bd){var _0x45be8d={'raw':!![],'where':{}};var _0x28865f={};var _0xb59527={'count':0x0,'rows':[]};return db[_0xdc06('0x37')]['findOne']({'where':{'id':_0x48629e[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0xa886d8,null))[_0xdc06('0x24')](function(_0x50a47a){if(_0x50a47a){_0x28865f[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db['CmHopperFinal']['rawAttributes']);_0x28865f[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x48629e[_0xdc06('0x3a')]);_0x28865f[_0xdc06('0x3c')]=_['intersection'](_0x28865f[_0xdc06('0x3e')],_0x28865f['query']);_0x45be8d[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x28865f['model'],qs[_0xdc06('0x3f')](_0x48629e[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x45be8d[_0xdc06('0x41')]=_0x45be8d['attributes'][_0xdc06('0x40')]?_0x45be8d['attributes']:_0x28865f[_0xdc06('0x3e')];if(!_0x48629e[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x45be8d[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0x48629e[_0xdc06('0x3a')]['limit']);_0x45be8d['offset']=qs[_0xdc06('0x1e')](_0x48629e[_0xdc06('0x3a')][_0xdc06('0x1e')]);}_0x45be8d[_0xdc06('0x66')]=qs['sort'](_0x48629e[_0xdc06('0x3a')][_0xdc06('0x44')]);_0x45be8d[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_[_0xdc06('0x64')](_0x48629e[_0xdc06('0x3a')],_0x28865f[_0xdc06('0x3c')]));_0x45be8d[_0xdc06('0x45')][_0xdc06('0x60')]=_0x50a47a['id'];if(_0x48629e[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x45be8d[_0xdc06('0x45')]=_[_0xdc06('0x46')](_0x45be8d[_0xdc06('0x45')],{'$or':_[_0xdc06('0x2c')](_0x45be8d['attributes'],function(_0x597031){var _0x4f86aa={};_0x4f86aa[_0x597031]={'$like':'%'+_0x48629e[_0xdc06('0x3a')]['filter']+'%'};return _0x4f86aa;})});}_0x45be8d=_['merge']({},_0x45be8d,_0x48629e[_0xdc06('0x48')]);return db['CmHopperFinal'][_0xdc06('0x1d')]({'where':_0x45be8d[_0xdc06('0x45')]})[_0xdc06('0x24')](function(_0x3ea7c6){_0xb59527['count']=_0x3ea7c6;if(_0x48629e[_0xdc06('0x3a')][_0xdc06('0x49')]){_0x45be8d[_0xdc06('0x4e')]=[{'all':!![]}];}return db[_0xdc06('0x67')][_0xdc06('0x4a')](_0x45be8d);})[_0xdc06('0x24')](function(_0x4809da){_0xb59527[_0xdc06('0x61')]=_0x4809da;return _0xb59527;});}})[_0xdc06('0x24')](respondWithFilteredResult(_0xa886d8,_0x45be8d))[_0xdc06('0x4f')](handleError(_0xa886d8,null));};exports['getHopperBlacks']=function(_0x3a3edf,_0x25a13b,_0x2735cd){var _0x3e3bab={'raw':!![],'where':{}};var _0x2066a1={};var _0x45e28={'count':0x0,'rows':[]};return db[_0xdc06('0x37')][_0xdc06('0x5e')]({'where':{'id':_0x3a3edf['params']['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x25a13b,null))[_0xdc06('0x24')](function(_0x382e7e){if(_0x382e7e){_0x2066a1[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db[_0xdc06('0x68')]['rawAttributes']);_0x2066a1['query']=_[_0xdc06('0x3b')](_0x3a3edf[_0xdc06('0x3a')]);_0x2066a1[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0x2066a1[_0xdc06('0x3e')],_0x2066a1[_0xdc06('0x3a')]);_0x3e3bab['attributes']=_[_0xdc06('0x3d')](_0x2066a1['model'],qs[_0xdc06('0x3f')](_0x3a3edf['query']['fields']));_0x3e3bab[_0xdc06('0x41')]=_0x3e3bab[_0xdc06('0x41')][_0xdc06('0x40')]?_0x3e3bab[_0xdc06('0x41')]:_0x2066a1[_0xdc06('0x3e')];if(!_0x3a3edf[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x3e3bab['limit']=qs[_0xdc06('0x1f')](_0x3a3edf[_0xdc06('0x3a')]['limit']);_0x3e3bab[_0xdc06('0x1e')]=qs['offset'](_0x3a3edf[_0xdc06('0x3a')][_0xdc06('0x1e')]);}_0x3e3bab[_0xdc06('0x66')]=qs['sort'](_0x3a3edf[_0xdc06('0x3a')]['sort']);_0x3e3bab[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_[_0xdc06('0x64')](_0x3a3edf[_0xdc06('0x3a')],_0x2066a1[_0xdc06('0x3c')]));_0x3e3bab[_0xdc06('0x45')][_0xdc06('0x60')]=_0x382e7e['id'];if(_0x3a3edf['query']['filter']){_0x3e3bab['where']=_['merge'](_0x3e3bab[_0xdc06('0x45')],{'$or':_[_0xdc06('0x2c')](_0x3e3bab[_0xdc06('0x41')],function(_0x4c08b3){var _0x204f33={};_0x204f33[_0x4c08b3]={'$like':'%'+_0x3a3edf[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x204f33;})});}_0x3e3bab=_[_0xdc06('0x46')]({},_0x3e3bab,_0x3a3edf[_0xdc06('0x48')]);return db[_0xdc06('0x68')][_0xdc06('0x1d')]({'where':_0x3e3bab[_0xdc06('0x45')]})['then'](function(_0x2d771e){_0x45e28[_0xdc06('0x1d')]=_0x2d771e;if(_0x3a3edf[_0xdc06('0x3a')][_0xdc06('0x49')]){_0x3e3bab[_0xdc06('0x4e')]=[{'all':!![]}];}return db[_0xdc06('0x68')]['findAll'](_0x3e3bab);})['then'](function(_0x506bb4){_0x45e28['rows']=_0x506bb4;return _0x45e28;});}})[_0xdc06('0x24')](respondWithFilteredResult(_0x25a13b,_0x3e3bab))[_0xdc06('0x4f')](handleError(_0x25a13b,null));};exports[_0xdc06('0x69')]=function(_0x4ca5ae,_0x286aa1,_0x57ab56){var _0x3eac13={};var _0x116583={};var _0x36da11;var _0x26b13c;return db[_0xdc06('0x37')]['findOne']({'where':{'id':_0x4ca5ae[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x286aa1,null))[_0xdc06('0x24')](function(_0x169627){if(_0x169627){_0x36da11=_0x169627;_0x116583['model']=_['keys'](db[_0xdc06('0x6a')][_0xdc06('0x4d')]);_0x116583[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x4ca5ae[_0xdc06('0x3a')]);_0x116583[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0x116583[_0xdc06('0x3e')],_0x116583['query']);_0x3eac13['attributes']=_['intersection'](_0x116583[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0x4ca5ae['query'][_0xdc06('0x3f')]));_0x3eac13[_0xdc06('0x41')]=_0x3eac13[_0xdc06('0x41')][_0xdc06('0x40')]?_0x3eac13[_0xdc06('0x41')]:_0x116583['model'];_0x3eac13[_0xdc06('0x66')]=qs[_0xdc06('0x44')](_0x4ca5ae[_0xdc06('0x3a')][_0xdc06('0x44')]);_0x3eac13[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_[_0xdc06('0x64')](_0x4ca5ae[_0xdc06('0x3a')],_0x116583[_0xdc06('0x3c')]));if(_0x4ca5ae['query'][_0xdc06('0x2a')]){_0x3eac13[_0xdc06('0x45')]=_[_0xdc06('0x46')](_0x3eac13[_0xdc06('0x45')],{'$or':_[_0xdc06('0x2c')](_0x3eac13[_0xdc06('0x41')],function(_0x3d97e6){var _0x3d3cc4={};_0x3d3cc4[_0x3d97e6]={'$like':'%'+_0x4ca5ae[_0xdc06('0x3a')]['filter']+'%'};return _0x3d3cc4;})});}_0x3eac13=_['merge']({},_0x3eac13,_0x4ca5ae[_0xdc06('0x48')]);return _0x36da11['getTeams'](_0x3eac13);}})[_0xdc06('0x24')](function(_0x5ca1e5){if(_0x5ca1e5){_0x26b13c=_0x5ca1e5[_0xdc06('0x40')];if(!_0x4ca5ae[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x3eac13[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0x4ca5ae[_0xdc06('0x3a')][_0xdc06('0x1f')]);_0x3eac13[_0xdc06('0x1e')]=qs[_0xdc06('0x1e')](_0x4ca5ae[_0xdc06('0x3a')]['offset']);}return _0x36da11['getTeams'](_0x3eac13);}})[_0xdc06('0x24')](function(_0xfb4e70){if(_0xfb4e70){return _0xfb4e70?{'count':_0x26b13c,'rows':_0xfb4e70}:null;}})[_0xdc06('0x24')](respondWithResult(_0x286aa1,null))[_0xdc06('0x4f')](handleError(_0x286aa1,null));};exports[_0xdc06('0x6b')]=function(_0x4f2d2c,_0x5334c5,_0x59a491){var _0x5012a2=_0x4f2d2c[_0xdc06('0x59')][_0xdc06('0x6c')];var _0xfdb404=_[_0xdc06('0x2c')](_0x5012a2,'id');return db[_0xdc06('0x6a')][_0xdc06('0x4a')]({'where':{'id':_0xfdb404},'attributes':['id'],'include':[{'model':db[_0xdc06('0x6d')],'as':_0xdc06('0x6e'),'attributes':['id',_0xdc06('0x31'),_0xdc06('0x6f'),_0xdc06('0x70'),'interface'],'raw':!![]}]})[_0xdc06('0x24')](function(_0x51fdb1){if(_0x51fdb1){var _0x6769ac=_[_0xdc06('0x71')](_0x51fdb1,function(_0x39bf0d){var _0xe100b3=_0x39bf0d[_0xdc06('0x26')]({'plain':!![]});_0xe100b3[_0xdc06('0x6e')]['forEach'](function(_0x5ec44e){_0x5ec44e['penalty']=_[_0xdc06('0x30')](_0x5012a2,{'id':_0xe100b3['id']})[_0xdc06('0x72')];});return _0xe100b3[_0xdc06('0x6e')];});return db[_0xdc06('0x37')]['find']({'where':{'id':_0x4f2d2c['params']['id']}})[_0xdc06('0x24')](function(_0x51d613){return db[_0xdc06('0x73')][_0xdc06('0x74')](function(_0x3f77f2){return _0x51d613[_0xdc06('0x6b')](_0xfdb404,{'transaction':_0x3f77f2})[_0xdc06('0x24')](function(){return BPromise[_0xdc06('0x75')](_0x6769ac,function(_0x24ba07){return db['UserVoiceQueue']['findOrCreate']({'where':{'UserId':_0x24ba07['id'],'VoiceQueueId':_0x4f2d2c['params']['id']},'defaults':{'penalty':_0x24ba07['penalty']},'transaction':_0x3f77f2});});})['then'](function(){return BPromise[_0xdc06('0x75')](_['filter'](_0x6769ac,{'online':!![]}),function(_0x4ecffa){return db[_0xdc06('0x76')][_0xdc06('0x77')]({'membername':_0x4ecffa[_0xdc06('0x31')],'UserId':_0x4ecffa['id'],'queue_name':_0x51d613['name'],'VoiceQueueId':_0x51d613['id'],'interface':_[_0xdc06('0x78')](_0x4ecffa['interface'])?util[_0xdc06('0x79')](_0xdc06('0x7a'),_0x4ecffa[_0xdc06('0x31')]):_0x4ecffa[_0xdc06('0x7b')],'paused':_0x4ecffa[_0xdc06('0x70')]||![],'penalty':_0x4ecffa[_0xdc06('0x72')]},{'transaction':_0x3f77f2});});})[_0xdc06('0x24')](function(){_0x6769ac[_0xdc06('0x7c')](function(_0x15f466){socket['emit'](_0xdc06('0x7d'),{'UserId':_0x15f466['id'],'VoiceQueueId':_0x51d613['id']});});});});});}})[_0xdc06('0x24')](respondWithStatusCode(_0x5334c5,null))['catch'](handleError(_0x5334c5,null));};exports[_0xdc06('0x7e')]=function(_0xb51ac0,_0x3c9fd8,_0x1e63a5){return db['Team'][_0xdc06('0x4a')]({'where':{'id':_0xb51ac0['query'][_0xdc06('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdc06('0x6e'),'attributes':['id'],'raw':!![]}]})[_0xdc06('0x24')](handleEntityNotFound(_0x3c9fd8,null))['then'](function(_0x117ba6){var _0x129a91=_[_0xdc06('0x2c')](_0x117ba6,'id');var _0x58f5a0=[];var _0x24b65b=[];var _0x27de1f=squel[_0xdc06('0x80')]();_0x27de1f['field'](_0xdc06('0x81'))[_0xdc06('0x82')]('team_has_voice_queues','tq')[_0xdc06('0x83')](_0xdc06('0x84'),'ut','ut.TeamId\x20=\x20tq.TeamId')[_0xdc06('0x45')](_0xdc06('0x85'),_0xb51ac0['params']['id']);for(var _0x4065bb=0x0;_0x4065bb<_0x117ba6[_0xdc06('0x40')];_0x4065bb+=0x1){let _0x2fe1d4=_0x117ba6[_0x4065bb];for(var _0x49ae35=0x0;_0x49ae35<_0x2fe1d4[_0xdc06('0x6e')][_0xdc06('0x40')];_0x49ae35+=0x1){let _0x577ee3=_0x2fe1d4['Agents'][_0x49ae35];var _0x289820=_0x27de1f[_0xdc06('0x57')]();_0x289820['where'](_0xdc06('0x86'),_0x577ee3['id']);_0x24b65b[_0xdc06('0x87')](db[_0xdc06('0x73')]['query'](_0x289820[_0xdc06('0x88')](),{'type':db[_0xdc06('0x73')][_0xdc06('0x89')][_0xdc06('0x8a')]})[_0xdc06('0x24')](function(_0x303a19){if(_0x303a19['length']===0x1){return _0x577ee3['id'];}else{var _0x2cf443=_[_0xdc06('0x8b')](_[_0xdc06('0x2c')](_0x303a19,'TeamId'),function(_0x617df){return _['includes'](_0x129a91,_0x617df);});if(_0x2cf443){return _0x577ee3['id'];}}}));}}return BPromise[_0xdc06('0x8c')](_0x24b65b)[_0xdc06('0x24')](function(_0x40388f){_0x58f5a0=_(_0x58f5a0)[_0xdc06('0x8d')](_0x40388f)['compact']()[_0xdc06('0x2d')]();return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0xb51ac0[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](function(_0x57d2fd){return db[_0xdc06('0x73')][_0xdc06('0x74')](function(_0x35d0c3){return _0x57d2fd[_0xdc06('0x7e')](_0xb51ac0[_0xdc06('0x3a')][_0xdc06('0x7f')],{'transaction':_0x35d0c3})[_0xdc06('0x24')](function(){if(!_[_0xdc06('0x8e')](_0x58f5a0)){return _0x57d2fd['removeAgents'](_0x58f5a0,{'transaction':_0x35d0c3})['then'](function(){return db[_0xdc06('0x76')][_0xdc06('0x25')]({'where':{'VoiceQueueId':_0xb51ac0[_0xdc06('0x4c')]['id'],'UserId':_0x58f5a0},'transaction':_0x35d0c3});});}})[_0xdc06('0x24')](function(){_0x58f5a0[_0xdc06('0x7c')](function(_0x2e4e0b){socket[_0xdc06('0x8f')]('userVoiceQueue:remove',{'UserId':_0x2e4e0b,'VoiceQueueId':_0x57d2fd['id']});});});});});});})['then'](respondWithStatusCode(_0x3c9fd8,null))[_0xdc06('0x4f')](handleError(_0x3c9fd8,null));};exports['addAgents']=function(_0x53a174,_0x5c3d42,_0x2d8e12){var _0x1657ae,_0x3e25ba;return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x53a174['params']['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x5c3d42,null))[_0xdc06('0x24')](function(_0x56eedc){if(_0x56eedc){_0x3e25ba=_0x56eedc;return _0x56eedc[_0xdc06('0x90')](_0x53a174[_0xdc06('0x59')][_0xdc06('0x7f')],_[_0xdc06('0x5a')](_0x53a174[_0xdc06('0x59')],[_0xdc06('0x7f'),'id'])||{})[_0xdc06('0x91')](function(_0x560c8c){for(var _0x52f274=0x0;_0x52f274<_0x53a174['body'][_0xdc06('0x7f')][_0xdc06('0x40')];_0x52f274+=0x1){socket[_0xdc06('0x8f')]('userVoiceQueue:save',{'UserId':_0x53a174[_0xdc06('0x59')][_0xdc06('0x7f')][_0x52f274],'VoiceQueueId':_0x53a174[_0xdc06('0x4c')]['id']});}return _0x560c8c;});}})['then'](function(_0x1c10fb){_0x1657ae=_0x1c10fb||[];if(_0x3e25ba){return db[_0xdc06('0x6d')]['findAll']({'where':{'id':_0x53a174['body'][_0xdc06('0x7f')]},'attributes':['id',_0xdc06('0x31'),'online',_0xdc06('0x70'),'interface'],'raw':!![]});}})['then'](function(_0x28a0b3){if(!_[_0xdc06('0x8e')](_0x28a0b3)){var _0x2e3e6f=[];for(var _0x4b19e6=0x0;_0x4b19e6<_0x28a0b3[_0xdc06('0x40')];_0x4b19e6++){if(_0x28a0b3[_0x4b19e6][_0xdc06('0x6f')]){_0x2e3e6f[_0xdc06('0x87')](db[_0xdc06('0x76')]['upsert']({'membername':_0x28a0b3[_0x4b19e6][_0xdc06('0x31')],'UserId':_0x28a0b3[_0x4b19e6]['id'],'queue_name':_0x3e25ba[_0xdc06('0x31')],'VoiceQueueId':_0x3e25ba['id'],'interface':_[_0xdc06('0x78')](_0x28a0b3[_0x4b19e6][_0xdc06('0x7b')])?util[_0xdc06('0x79')](_0xdc06('0x7a'),_0x28a0b3[_0x4b19e6][_0xdc06('0x31')]):_0x28a0b3[_0x4b19e6][_0xdc06('0x7b')],'paused':_0x28a0b3[_0x4b19e6][_0xdc06('0x70')]||![],'penalty':_0x53a174[_0xdc06('0x59')][_0xdc06('0x72')]||0x0}));}}return BPromise[_0xdc06('0x8c')](_0x2e3e6f);}})[_0xdc06('0x24')](function(){return _0x1657ae;})['then'](respondWithResult(_0x5c3d42,null))[_0xdc06('0x4f')](handleError(_0x5c3d42,null));};exports['removeAgents']=function(_0x7276b,_0x49ca97,_0x579363){return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x7276b['params']['id']}})['then'](handleEntityNotFound(_0x49ca97,null))[_0xdc06('0x24')](function(_0x313862){if(_0x313862){return _0x313862['removeAgents'](_0x7276b[_0xdc06('0x3a')][_0xdc06('0x7f')])[_0xdc06('0x24')](function(){if(_[_0xdc06('0x92')](_0x7276b[_0xdc06('0x3a')]['ids'])){for(var _0x3d1053=0x0;_0x3d1053<_0x7276b['query'][_0xdc06('0x7f')]['length'];_0x3d1053+=0x1){socket[_0xdc06('0x8f')](_0xdc06('0x93'),{'UserId':Number(_0x7276b[_0xdc06('0x3a')][_0xdc06('0x7f')][_0x3d1053]),'VoiceQueueId':Number(_0x7276b[_0xdc06('0x4c')]['id'])});}}else{socket['emit']('userVoiceQueue:remove',{'UserId':Number(_0x7276b['query'][_0xdc06('0x7f')]),'VoiceQueueId':Number(_0x7276b['params']['id'])});}});}})[_0xdc06('0x24')](function(_0xbe4df8){return db[_0xdc06('0x76')]['destroy']({'where':{'VoiceQueueId':_0x7276b[_0xdc06('0x4c')]['id'],'UserId':_0x7276b[_0xdc06('0x3a')]['ids']}})[_0xdc06('0x24')](function(){return _0xbe4df8;});})['then'](respondWithStatusCode(_0x49ca97,null))[_0xdc06('0x4f')](handleError(_0x49ca97,null));};exports[_0xdc06('0x94')]=function(_0xcace6b,_0x20d409,_0x32d63b){var _0x568499={};var _0x5f3cf6={};var _0x36ad12;var _0x3c3b34;return db['VoiceQueue']['findOne']({'where':{'id':_0xcace6b['params']['id']}})['then'](handleEntityNotFound(_0x20d409,null))[_0xdc06('0x24')](function(_0x288cdc){if(_0x288cdc){_0x36ad12=_0x288cdc;_0x5f3cf6[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db[_0xdc06('0x6d')]['rawAttributes']);_0x5f3cf6[_0xdc06('0x3a')]=_['keys'](_0xcace6b[_0xdc06('0x3a')]);_0x5f3cf6[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0x5f3cf6['model'],_0x5f3cf6['query']);_0x568499['attributes']=_[_0xdc06('0x3d')](_0x5f3cf6[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0xcace6b[_0xdc06('0x3a')]['fields']));_0x568499[_0xdc06('0x41')]=_0x568499[_0xdc06('0x41')]['length']?_0x568499[_0xdc06('0x41')]:_0x5f3cf6['model'];_0x568499['order']=qs[_0xdc06('0x44')](_0xcace6b[_0xdc06('0x3a')][_0xdc06('0x44')]);_0x568499['where']=qs[_0xdc06('0x3c')](_['pick'](_0xcace6b[_0xdc06('0x3a')],_0x5f3cf6['filters']));if(_0xcace6b[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x568499[_0xdc06('0x45')]=_['merge'](_0x568499['where'],{'$or':_[_0xdc06('0x2c')](_0x568499[_0xdc06('0x41')],function(_0x384f7f){var _0x4dc14d={};_0x4dc14d[_0x384f7f]={'$like':'%'+_0xcace6b[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x4dc14d;})});}_0x568499=_['merge']({},_0x568499,_0xcace6b[_0xdc06('0x48')]);return _0x36ad12[_0xdc06('0x94')](_0x568499);}})[_0xdc06('0x24')](function(_0x567c45){if(_0x567c45){_0x3c3b34=_0x567c45[_0xdc06('0x40')];if(!_0xcace6b[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x568499[_0xdc06('0x1f')]=qs['limit'](_0xcace6b['query'][_0xdc06('0x1f')]);_0x568499[_0xdc06('0x1e')]=qs['offset'](_0xcace6b['query']['offset']);}return _0x36ad12[_0xdc06('0x94')](_0x568499);}})[_0xdc06('0x24')](function(_0x5d90a2){if(_0x5d90a2){return _0x5d90a2?{'count':_0x3c3b34,'rows':_0x5d90a2}:null;}})['then'](respondWithResult(_0x20d409,null))[_0xdc06('0x4f')](handleError(_0x20d409,null));};exports[_0xdc06('0x95')]=function(_0x208b0f,_0x222c71,_0x1f49b1){var _0x47ccca={};var _0xfb62d6={};var _0x41ff23;var _0x6ec553;return db[_0xdc06('0x37')][_0xdc06('0x5e')]({'where':{'id':_0x208b0f[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x222c71,null))['then'](function(_0x445a5b){if(_0x445a5b){_0x41ff23=_0x445a5b;_0xfb62d6[_0xdc06('0x3e')]=_['keys'](db[_0xdc06('0x76')]['rawAttributes']);_0xfb62d6[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x208b0f['query']);_0xfb62d6[_0xdc06('0x3c')]=_[_0xdc06('0x3d')](_0xfb62d6[_0xdc06('0x3e')],_0xfb62d6[_0xdc06('0x3a')]);_0x47ccca[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0xfb62d6[_0xdc06('0x3e')],qs['fields'](_0x208b0f['query'][_0xdc06('0x3f')]));_0x47ccca[_0xdc06('0x41')]=_0x47ccca[_0xdc06('0x41')][_0xdc06('0x40')]?_0x47ccca['attributes']:_0xfb62d6[_0xdc06('0x3e')];_0x47ccca[_0xdc06('0x66')]=qs[_0xdc06('0x44')](_0x208b0f[_0xdc06('0x3a')]['sort']);_0x47ccca['where']=qs['filters'](_[_0xdc06('0x64')](_0x208b0f['query'],_0xfb62d6['filters']));if(_0x208b0f[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x47ccca['where']=_[_0xdc06('0x46')](_0x47ccca[_0xdc06('0x45')],{'$or':_[_0xdc06('0x2c')](_0x47ccca['attributes'],function(_0x5da6c3){var _0x5aafef={};_0x5aafef[_0x5da6c3]={'$like':'%'+_0x208b0f[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x5aafef;})});}_0x47ccca=_['merge']({},_0x47ccca,_0x208b0f[_0xdc06('0x48')]);return _0x41ff23[_0xdc06('0x95')](_0x47ccca);}})[_0xdc06('0x24')](function(_0x543345){if(_0x543345){_0x6ec553=_0x543345[_0xdc06('0x40')];if(!_0x208b0f[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x47ccca[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0x208b0f[_0xdc06('0x3a')][_0xdc06('0x1f')]);_0x47ccca[_0xdc06('0x1e')]=qs['offset'](_0x208b0f['query'][_0xdc06('0x1e')]);}return _0x41ff23[_0xdc06('0x95')](_0x47ccca);}})[_0xdc06('0x24')](function(_0xfc3af8){return _0xfc3af8?{'count':_0x6ec553,'rows':_0xfc3af8}:null;})[_0xdc06('0x24')](respondWithResult(_0x222c71,null))[_0xdc06('0x4f')](handleError(_0x222c71,null));};exports['getLists']=function(_0x5a25f7,_0xa00c98,_0x120599){var _0x799003={};var _0x2f5fbb={};var _0x15d129;var _0x337852;return db[_0xdc06('0x37')][_0xdc06('0x5e')]({'where':{'id':_0x5a25f7[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0xa00c98,null))[_0xdc06('0x24')](function(_0x4dfe73){if(_0x4dfe73){_0x15d129=_0x4dfe73;_0x2f5fbb[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db[_0xdc06('0x96')][_0xdc06('0x4d')]);_0x2f5fbb[_0xdc06('0x3a')]=_[_0xdc06('0x3b')](_0x5a25f7['query']);_0x2f5fbb['filters']=_[_0xdc06('0x3d')](_0x2f5fbb[_0xdc06('0x3e')],_0x2f5fbb[_0xdc06('0x3a')]);_0x799003[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x2f5fbb[_0xdc06('0x3e')],qs[_0xdc06('0x3f')](_0x5a25f7[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x799003['attributes']=_0x799003['attributes'][_0xdc06('0x40')]?_0x799003[_0xdc06('0x41')]:_0x2f5fbb[_0xdc06('0x3e')];_0x799003[_0xdc06('0x66')]=qs[_0xdc06('0x44')](_0x5a25f7[_0xdc06('0x3a')][_0xdc06('0x44')]);_0x799003[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_[_0xdc06('0x64')](_0x5a25f7[_0xdc06('0x3a')],_0x2f5fbb[_0xdc06('0x3c')]));if(_0x5a25f7[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x799003['where']=_[_0xdc06('0x46')](_0x799003['where'],{'$or':_['map'](_0x799003[_0xdc06('0x41')],function(_0x27e8f5){var _0x2e31be={};_0x2e31be[_0x27e8f5]={'$like':'%'+_0x5a25f7[_0xdc06('0x3a')]['filter']+'%'};return _0x2e31be;})});}_0x799003=_[_0xdc06('0x46')]({},_0x799003,_0x5a25f7[_0xdc06('0x48')]);return _0x15d129['getLists'](_0x799003);}})[_0xdc06('0x24')](function(_0x159b18){if(_0x159b18){_0x337852=_0x159b18[_0xdc06('0x40')];if(!_0x5a25f7[_0xdc06('0x3a')]['hasOwnProperty'](_0xdc06('0x43'))){_0x799003[_0xdc06('0x1f')]=qs['limit'](_0x5a25f7[_0xdc06('0x3a')][_0xdc06('0x1f')]);_0x799003[_0xdc06('0x1e')]=qs[_0xdc06('0x1e')](_0x5a25f7[_0xdc06('0x3a')]['offset']);}return _0x15d129[_0xdc06('0x97')](_0x799003);}})['then'](function(_0xffce74){if(_0xffce74){return _0xffce74?{'count':_0x337852,'rows':_0xffce74}:null;}})[_0xdc06('0x24')](respondWithResult(_0xa00c98,null))[_0xdc06('0x4f')](handleError(_0xa00c98,null));};exports[_0xdc06('0x98')]=function(_0x5ce16f,_0x3fb8e3,_0x1a9c4b){var _0x31a82b,_0x4bbc0d;return db[_0xdc06('0x37')]['find']({'where':{'id':_0x5ce16f[_0xdc06('0x4c')]['id']}})['then'](handleEntityNotFound(_0x3fb8e3,null))[_0xdc06('0x24')](function(_0x54f090){if(_0x54f090){_0x4bbc0d=_0x54f090;return _0x54f090['addLists'](_0x5ce16f[_0xdc06('0x59')]['ids'],_[_0xdc06('0x5a')](_0x5ce16f[_0xdc06('0x59')],[_0xdc06('0x7f'),'id'])||{});}return null;})['spread'](function(_0x3659d0){var _0x365d11;_0x31a82b=_0x3659d0||[];var _0x34c7a3=[];if(_0x3659d0){for(var _0x480e8f=0x0;_0x480e8f<_0x3659d0[_0xdc06('0x40')];_0x480e8f+=0x1){var _0x5606e9=_0x3659d0[_0x480e8f][_0xdc06('0x26')]({'plain':!![]});_0x4bbc0d[_0xdc06('0x99')]=_0x5ce16f[_0xdc06('0x59')][_0xdc06('0x99')]?_0x5ce16f[_0xdc06('0x59')]['dialCheckDuplicateType']:_0x4bbc0d[_0xdc06('0x99')];switch(_0x4bbc0d[_0xdc06('0x99')]){case'always':_0x365d11=squel[_0xdc06('0x9a')]()[_0xdc06('0x9b')](_0xdc06('0x9c'))[_0xdc06('0x9d')](['phone',_0xdc06('0x9e'),_0xdc06('0x9f'),_0xdc06('0xa0'),_0xdc06('0x60'),_0xdc06('0x58'),'updatedAt'],squel[_0xdc06('0x80')]()[_0xdc06('0xa1')]('phone',_0xdc06('0xa2'))['field'](_0xdc06('0xa3'),_0xdc06('0x9e'))[_0xdc06('0xa1')]('id',_0xdc06('0x9f'))[_0xdc06('0xa1')](_0x5606e9[_0xdc06('0xa4')]['toString'](),_0xdc06('0xa0'))[_0xdc06('0xa1')](_0x5ce16f[_0xdc06('0x4c')]['id'][_0xdc06('0x88')](),'VoiceQueueId')[_0xdc06('0xa1')](_0xdc06('0xa3'),'createdAt')[_0xdc06('0xa1')](_0xdc06('0xa3'),_0xdc06('0x5b'))[_0xdc06('0x82')]('cm_contacts')[_0xdc06('0x45')](_0xdc06('0xa5'))[_0xdc06('0x45')](_0xdc06('0xa6'),_0x5606e9[_0xdc06('0xa4')][_0xdc06('0x88')]())[_0xdc06('0x45')](_0xdc06('0xa7'))[_0xdc06('0x45')](_0xdc06('0xa8'),squel[_0xdc06('0x80')]()[_0xdc06('0xa1')](_0xdc06('0xa9'))[_0xdc06('0x82')](_0xdc06('0xaa'))['where'](_0xdc06('0x85'),_0x5ce16f[_0xdc06('0x4c')]['id'][_0xdc06('0x88')]()))[_0xdc06('0x45')](_0xdc06('0xa8'),squel[_0xdc06('0x80')]()[_0xdc06('0xa1')]('COALESCE(phone,\x27\x27)')['from'](_0xdc06('0x9c'))[_0xdc06('0x45')](_0xdc06('0x85'),_0x5ce16f['params']['id'][_0xdc06('0x88')]())))[_0xdc06('0x88')]();break;case'onlyIfOpen':_0x365d11=squel[_0xdc06('0x9a')]()[_0xdc06('0x9b')]('cm_hopper')[_0xdc06('0x9d')](['phone',_0xdc06('0x9e'),'ContactId',_0xdc06('0xa0'),'VoiceQueueId',_0xdc06('0x58'),'updatedAt'],squel['select']()[_0xdc06('0xa1')](_0xdc06('0xa2'),_0xdc06('0xa2'))[_0xdc06('0xa1')](_0xdc06('0xa3'),_0xdc06('0x9e'))['field']('id',_0xdc06('0x9f'))[_0xdc06('0xa1')](_0x5606e9[_0xdc06('0xa4')]['toString'](),_0xdc06('0xa0'))[_0xdc06('0xa1')](_0x5ce16f['params']['id'][_0xdc06('0x88')](),_0xdc06('0x60'))['field']('NOW()',_0xdc06('0x58'))['field'](_0xdc06('0xa3'),_0xdc06('0x5b'))[_0xdc06('0x82')](_0xdc06('0xab'))[_0xdc06('0x45')](_0xdc06('0xa5'))[_0xdc06('0x45')](_0xdc06('0xa6'),_0x5606e9[_0xdc06('0xa4')][_0xdc06('0x88')]())[_0xdc06('0x45')](_0xdc06('0xa7'))[_0xdc06('0x45')](_0xdc06('0xa8'),squel[_0xdc06('0x80')]()[_0xdc06('0xa1')](_0xdc06('0xac'))[_0xdc06('0x82')](_0xdc06('0x9c'))['where'](_0xdc06('0x85'),_0x5ce16f[_0xdc06('0x4c')]['id']['toString']())))[_0xdc06('0x88')]();break;default:_0x365d11=squel[_0xdc06('0x9a')]()[_0xdc06('0x9b')](_0xdc06('0x9c'))[_0xdc06('0x9d')]([_0xdc06('0xa2'),_0xdc06('0x9e'),'ContactId','ListId',_0xdc06('0x60'),_0xdc06('0x58'),_0xdc06('0x5b')],squel['select']()[_0xdc06('0xa1')](_0xdc06('0xa2'),'phone')['field'](_0xdc06('0xa3'),_0xdc06('0x9e'))[_0xdc06('0xa1')]('id',_0xdc06('0x9f'))['field'](_0x5606e9[_0xdc06('0xa4')]['toString'](),_0xdc06('0xa0'))[_0xdc06('0xa1')](_0x5ce16f['params']['id'][_0xdc06('0x88')](),_0xdc06('0x60'))[_0xdc06('0xa1')]('NOW()',_0xdc06('0x58'))['field'](_0xdc06('0xa3'),_0xdc06('0x5b'))[_0xdc06('0x82')](_0xdc06('0xab'))[_0xdc06('0x45')](_0xdc06('0xa5'))[_0xdc06('0x45')](_0xdc06('0xa6'),_0x5606e9[_0xdc06('0xa4')]['toString']())[_0xdc06('0x45')](_0xdc06('0xa7')))[_0xdc06('0x88')]();}_0x34c7a3[_0xdc06('0x87')](db[_0xdc06('0x73')][_0xdc06('0x3a')](_0x365d11));}return BPromise['all'](_0x34c7a3);}})[_0xdc06('0x24')](function(){return _0x31a82b;})[_0xdc06('0x24')](respondWithResult(_0x3fb8e3,null))[_0xdc06('0x4f')](handleError(_0x3fb8e3,null));};exports['removeLists']=function(_0x156230,_0x16420d,_0x147ecf){return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x156230['params']['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x16420d,null))[_0xdc06('0x24')](function(_0x18e943){if(_0x18e943){return _0x18e943['removeLists'](_0x156230[_0xdc06('0x3a')]['ids']);}})['then'](function(_0x55b4db){if(_0x55b4db){return db['CmHopper'][_0xdc06('0x25')]({'where':{'ListId':_0x156230[_0xdc06('0x3a')][_0xdc06('0x7f')],'VoiceQueueId':_0x156230[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](function(){return _0x55b4db;});}})[_0xdc06('0x24')](respondWithStatusCode(_0x16420d,null))[_0xdc06('0x4f')](handleError(_0x16420d,null));};exports[_0xdc06('0xad')]=function(_0x1ad23c,_0x51f898,_0xab54bd){var _0x48c43a={};var _0x1af5dd={};var _0x3e797c;var _0x1ce4b5;return db[_0xdc06('0x37')]['findOne']({'where':{'id':_0x1ad23c[_0xdc06('0x4c')]['id']}})['then'](handleEntityNotFound(_0x51f898,null))[_0xdc06('0x24')](function(_0x3be96d){if(_0x3be96d){_0x3e797c=_0x3be96d;_0x1af5dd[_0xdc06('0x3e')]=_[_0xdc06('0x3b')](db[_0xdc06('0x96')][_0xdc06('0x4d')]);_0x1af5dd[_0xdc06('0x3a')]=_['keys'](_0x1ad23c[_0xdc06('0x3a')]);_0x1af5dd[_0xdc06('0x3c')]=_['intersection'](_0x1af5dd[_0xdc06('0x3e')],_0x1af5dd[_0xdc06('0x3a')]);_0x48c43a[_0xdc06('0x41')]=_[_0xdc06('0x3d')](_0x1af5dd['model'],qs['fields'](_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x3f')]));_0x48c43a[_0xdc06('0x41')]=_0x48c43a[_0xdc06('0x41')]['length']?_0x48c43a[_0xdc06('0x41')]:_0x1af5dd[_0xdc06('0x3e')];_0x48c43a[_0xdc06('0x66')]=qs['sort'](_0x1ad23c['query'][_0xdc06('0x44')]);_0x48c43a[_0xdc06('0x45')]=qs[_0xdc06('0x3c')](_[_0xdc06('0x64')](_0x1ad23c['query'],_0x1af5dd[_0xdc06('0x3c')]));if(_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x2a')]){_0x48c43a[_0xdc06('0x45')]=_['merge'](_0x48c43a['where'],{'$or':_[_0xdc06('0x2c')](_0x48c43a[_0xdc06('0x41')],function(_0x4d90fe){var _0x396bc5={};_0x396bc5[_0x4d90fe]={'$like':'%'+_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x2a')]+'%'};return _0x396bc5;})});}_0x48c43a=_[_0xdc06('0x46')]({},_0x48c43a,_0x1ad23c['options']);return _0x3e797c['getBlackLists'](_0x48c43a);}})['then'](function(_0x43e2a3){if(_0x43e2a3){_0x1ce4b5=_0x43e2a3[_0xdc06('0x40')];if(!_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x42')](_0xdc06('0x43'))){_0x48c43a[_0xdc06('0x1f')]=qs[_0xdc06('0x1f')](_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x1f')]);_0x48c43a[_0xdc06('0x1e')]=qs[_0xdc06('0x1e')](_0x1ad23c[_0xdc06('0x3a')][_0xdc06('0x1e')]);}return _0x3e797c[_0xdc06('0xad')](_0x48c43a);}})[_0xdc06('0x24')](function(_0x51b78f){if(_0x51b78f){return _0x51b78f?{'count':_0x1ce4b5,'rows':_0x51b78f}:null;}})['then'](respondWithResult(_0x51f898,null))[_0xdc06('0x4f')](handleError(_0x51f898,null));};exports['addBlackLists']=function(_0x1dc653,_0x4b8a4d,_0x1a3194){var _0x469306,_0xda4778;return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x1dc653[_0xdc06('0x4c')]['id']}})['then'](handleEntityNotFound(_0x4b8a4d,null))[_0xdc06('0x24')](function(_0x1747fb){if(_0x1747fb){_0xda4778=_0x1747fb;return _0x1747fb[_0xdc06('0xae')](_0x1dc653[_0xdc06('0x59')][_0xdc06('0x7f')],_[_0xdc06('0x5a')](_0x1dc653[_0xdc06('0x59')],[_0xdc06('0x7f'),'id'])||{});}return null;})[_0xdc06('0x91')](function(_0x3deef2){var _0x1183d4;_0x469306=_0x3deef2||[];var _0x283f4d=[];if(_0x3deef2){for(var _0x5c8e5b=0x0;_0x5c8e5b<_0x3deef2[_0xdc06('0x40')];_0x5c8e5b+=0x1){var _0x145c90=_0x3deef2[_0x5c8e5b]['get']({'plain':!![]});_0x1183d4=squel[_0xdc06('0x9a')]()[_0xdc06('0x9b')](_0xdc06('0xaf'))[_0xdc06('0x9d')](['phone','ContactId',_0xdc06('0xa0'),_0xdc06('0x60'),_0xdc06('0x58'),_0xdc06('0x5b')],squel[_0xdc06('0x80')]()[_0xdc06('0xa1')](_0xdc06('0xa2'),_0xdc06('0xa2'))[_0xdc06('0xa1')]('id','ContactId')[_0xdc06('0xa1')](_0x145c90[_0xdc06('0xa4')][_0xdc06('0x88')](),'ListId')[_0xdc06('0xa1')](_0x1dc653[_0xdc06('0x4c')]['id'][_0xdc06('0x88')](),_0xdc06('0x60'))[_0xdc06('0xa1')](_0xdc06('0xa3'),_0xdc06('0x58'))[_0xdc06('0xa1')](_0xdc06('0xa3'),_0xdc06('0x5b'))[_0xdc06('0x82')]('cm_contacts')['where'](_0xdc06('0xa5'))[_0xdc06('0x45')](_0xdc06('0xa6'),_0x145c90[_0xdc06('0xa4')][_0xdc06('0x88')]())[_0xdc06('0x45')](_0xdc06('0xa7')))[_0xdc06('0x88')]();_0x283f4d[_0xdc06('0x87')](db['sequelize'][_0xdc06('0x3a')](_0x1183d4));}return BPromise[_0xdc06('0x8c')](_0x283f4d);}})[_0xdc06('0x24')](function(){return _0x469306;})['then'](respondWithResult(_0x4b8a4d,null))[_0xdc06('0x4f')](handleError(_0x4b8a4d,null));};exports[_0xdc06('0xb0')]=function(_0x8e688f,_0x535791,_0x1f0077){return db[_0xdc06('0x37')][_0xdc06('0x30')]({'where':{'id':_0x8e688f[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](handleEntityNotFound(_0x535791,null))[_0xdc06('0x24')](function(_0x449255){if(_0x449255){return _0x449255[_0xdc06('0xb0')](_0x8e688f[_0xdc06('0x3a')][_0xdc06('0x7f')]);}})[_0xdc06('0x24')](function(_0x4517bb){if(_0x4517bb){return db[_0xdc06('0x68')]['destroy']({'where':{'ListId':_0x8e688f['query']['ids'],'VoiceQueueId':_0x8e688f[_0xdc06('0x4c')]['id']}})[_0xdc06('0x24')](function(){return _0x4517bb;});}})['then'](respondWithStatusCode(_0x535791,null))[_0xdc06('0x4f')](handleError(_0x535791,null));}; \ No newline at end of file +var _0xd71d=['select','field','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','includes','all','union','compact','transaction','removeTeams','isEmpty','removeAgents','addAgents','spread','isNil','isArray','userVoiceQueue:remove','getAgents','getMembers','CmList','getLists','addLists','dialCheckDuplicateType','always','into','cm_hopper','phone','scheduledAt','ContactId','ListId','NOW()','CmListId','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','toString','onlyIfOpen','insert','fromQuery','ListId\x20=\x20?','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','./voiceQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','inbound','QueueCampaigns','outbound','map','value','type','find','destroy','error','stack','name','index','rawAttributes','fieldName','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','pick','filter','where','merge','VIRTUAL','options','VoiceQueue','includeAll','include','findAll','rows','catch','params','keys','create','body','get','role','VoiceQueues','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','updatedAt','createdAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','getHoppers','findOne','CmHopper','CmHopperHistory','nolimit','VoiceQueueId','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','getTeams','teams','User','Agents','online','interface','forEach','penalty','sequelize','addTeams','each','UserVoiceQueue','findOrCreate','UserVoiceQueueRt','format','SIP/%s','voicePause','emit','userVoiceQueue:save','ids'];(function(_0x23096b,_0x391445){var _0x562828=function(_0x4a5c08){while(--_0x4a5c08){_0x23096b['push'](_0x23096b['shift']());}};_0x562828(++_0x391445);}(_0xd71d,0x1a5));var _0xdd71=function(_0xe501ff,_0x955b7e){_0xe501ff=_0xe501ff-0x0;var _0x17135d=_0xd71d[_0xe501ff];return _0x17135d;};'use strict';var pdf=require(_0xdd71('0x0'));var emlformat=require(_0xdd71('0x1'));var rimraf=require(_0xdd71('0x2'));var zipdir=require(_0xdd71('0x3'));var jsonpatch=require(_0xdd71('0x4'));var rp=require('request-promise');var moment=require(_0xdd71('0x5'));var BPromise=require(_0xdd71('0x6'));var Mustache=require(_0xdd71('0x7'));var util=require('util');var path=require(_0xdd71('0x8'));var sox=require(_0xdd71('0x9'));var csv=require(_0xdd71('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdd71('0xb'));var squel=require(_0xdd71('0xc'));var crypto=require(_0xdd71('0xd'));var jsforce=require(_0xdd71('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xdd71('0xa'));var querystring=require(_0xdd71('0xf'));var Papa=require(_0xdd71('0x10'));var Redis=require(_0xdd71('0x11'));var authService=require(_0xdd71('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0xdd71('0x13'));var hardwareService=require(_0xdd71('0x14'));var logger=require(_0xdd71('0x15'))(_0xdd71('0x16'));var utils=require('../../config/utils');var config=require(_0xdd71('0x17'));var db=require(_0xdd71('0x18'))['db'];config[_0xdd71('0x19')]=_[_0xdd71('0x1a')](config[_0xdd71('0x19')],{'host':_0xdd71('0x1b'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdd71('0x19')]));require(_0xdd71('0x1c'))[_0xdd71('0x1d')](socket);function respondWithStatusCode(_0x3ede09,_0x4b1f2d){_0x4b1f2d=_0x4b1f2d||0xcc;return function(_0x41f8b1){if(_0x41f8b1){return _0x3ede09[_0xdd71('0x1e')](_0x4b1f2d);}return _0x3ede09[_0xdd71('0x1f')](_0x4b1f2d)[_0xdd71('0x20')]();};}function respondWithResult(_0x27c527,_0x42b476){_0x42b476=_0x42b476||0xc8;return function(_0x407a7b){if(_0x407a7b){return _0x27c527[_0xdd71('0x1f')](_0x42b476)[_0xdd71('0x21')](_0x407a7b);}};}function respondWithFilteredResult(_0x219b23,_0x11accc){return function(_0x58eae4){if(_0x58eae4){var _0x4c3601=_0x58eae4[_0xdd71('0x22')],_0x471df6=_0x11accc[_0xdd71('0x23')],_0x689edf=_0x11accc[_0xdd71('0x23')]+_0x11accc['limit'],_0x17a2da;if(_0x689edf>=_0x4c3601){_0x689edf=_0x4c3601;_0x17a2da=0xc8;}else{_0x17a2da=0xce;}_0x219b23[_0xdd71('0x1f')](_0x17a2da);return _0x219b23[_0xdd71('0x24')](_0xdd71('0x25'),_0x471df6+'-'+_0x689edf+'/'+_0x4c3601)[_0xdd71('0x21')](_0x58eae4);}return null;};}function patchUpdates(_0x3905d8){return function(_0x461d6a){try{jsonpatch[_0xdd71('0x26')](_0x461d6a,_0x3905d8,!![]);}catch(_0x329455){return BPromise[_0xdd71('0x27')](_0x329455);}return _0x461d6a[_0xdd71('0x28')]();};}function saveUpdates(_0x13f10e,_0x5a9960){return function(_0x548f96){if(_0x548f96){return _0x548f96[_0xdd71('0x29')](_0x13f10e)[_0xdd71('0x2a')](function(_0x50ba0a){return _0x50ba0a;});}return null;};}function removeEntity(_0x10ebb0,_0x52d386){return function(_0x2da860){if(_0x2da860){return _0x2da860['destroy']()['then'](function(){var _0x5aca61=_0x2da860['get']({'plain':!![]});var _0x168a14=[{'name':'VoiceQueues','value':_0xdd71('0x2b'),'ignore':![]},{'name':_0xdd71('0x2c'),'value':_0xdd71('0x2d'),'ignore':![]}];var _0x11850a=_(_0x168a14)['filter']('ignore')[_0xdd71('0x2e')](_0xdd71('0x2f'))[_0xdd71('0x2f')]();if(_['includes'](_0x11850a,_0x5aca61[_0xdd71('0x30')])){return;}var _0x3a57fc=_[_0xdd71('0x31')](_0x168a14,['value',_0x5aca61[_0xdd71('0x30')]])['name'];return db['UserProfileResource'][_0xdd71('0x32')]({'where':{'type':_0x3a57fc,'resourceId':_0x5aca61['id']}})[_0xdd71('0x2a')](function(){return _0x2da860;});})[_0xdd71('0x2a')](function(){_0x10ebb0[_0xdd71('0x1f')](0xcc)[_0xdd71('0x20')]();});}};}function handleEntityNotFound(_0x10da75,_0x39ef2e){return function(_0x2b6b07){if(!_0x2b6b07){_0x10da75[_0xdd71('0x1e')](0x194);}return _0x2b6b07;};}function handleError(_0x58fc27,_0x3895a9){_0x3895a9=_0x3895a9||0x1f4;return function(_0x2f3b51){logger[_0xdd71('0x33')](_0x2f3b51[_0xdd71('0x34')]);if(_0x2f3b51['name']){delete _0x2f3b51[_0xdd71('0x35')];}_0x58fc27['status'](_0x3895a9)['send'](_0x2f3b51);};}exports[_0xdd71('0x36')]=function(_0x35ebd9,_0x46e20b){var _0x4a5a7a={},_0x3be7c9={},_0x4ffe6f={'count':0x0,'rows':[]};var _0x80286d=_['map'](db['VoiceQueue'][_0xdd71('0x37')],function(_0x1852c4){return{'name':_0x1852c4[_0xdd71('0x38')],'type':_0x1852c4['type']['key']};});_0x3be7c9[_0xdd71('0x39')]=_['map'](_0x80286d,'name');_0x3be7c9[_0xdd71('0x3a')]=_['keys'](_0x35ebd9['query']);_0x3be7c9[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x3be7c9[_0xdd71('0x39')],_0x3be7c9[_0xdd71('0x3a')]);_0x4a5a7a[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x3be7c9[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4a5a7a[_0xdd71('0x3d')]=_0x4a5a7a[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x4a5a7a[_0xdd71('0x3d')]:_0x3be7c9[_0xdd71('0x39')];if(!_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x40')]('nolimit')){_0x4a5a7a['limit']=qs[_0xdd71('0x41')](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x4a5a7a['offset']=qs['offset'](_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x4a5a7a[_0xdd71('0x42')]=qs['sort'](_0x35ebd9['query'][_0xdd71('0x43')]);_0x4a5a7a['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x35ebd9[_0xdd71('0x3a')],_0x3be7c9['filters']));if(_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x4a5a7a[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x4a5a7a[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x80286d,function(_0x2d404d){if(_0x2d404d[_0xdd71('0x30')]!==_0xdd71('0x48')){var _0xd9c628={};_0xd9c628[_0x2d404d['name']]={'$like':'%'+_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0xd9c628;}})});}_0x4a5a7a=_[_0xdd71('0x47')]({},_0x4a5a7a,_0x35ebd9[_0xdd71('0x49')]);var _0x33a930={'where':_0x4a5a7a[_0xdd71('0x46')]};return db[_0xdd71('0x4a')][_0xdd71('0x22')](_0x33a930)[_0xdd71('0x2a')](function(_0x24ad0f){_0x4ffe6f[_0xdd71('0x22')]=_0x24ad0f;if(_0x35ebd9[_0xdd71('0x3a')][_0xdd71('0x4b')]){_0x4a5a7a[_0xdd71('0x4c')]=[{'all':!![]}];}return db[_0xdd71('0x4a')][_0xdd71('0x4d')](_0x4a5a7a);})[_0xdd71('0x2a')](function(_0x105374){_0x4ffe6f[_0xdd71('0x4e')]=_0x105374;return _0x4ffe6f;})[_0xdd71('0x2a')](respondWithFilteredResult(_0x46e20b,_0x4a5a7a))[_0xdd71('0x4f')](handleError(_0x46e20b,null));};exports['show']=function(_0x50ac64,_0x781fb){var _0xe04928={'raw':![],'where':{'id':_0x50ac64[_0xdd71('0x50')]['id']}},_0x1c5461={};_0x1c5461[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x4a')][_0xdd71('0x37')]);_0x1c5461['query']=_['keys'](_0x50ac64[_0xdd71('0x3a')]);_0x1c5461[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x1c5461[_0xdd71('0x39')],_0x1c5461[_0xdd71('0x3a')]);_0xe04928[_0xdd71('0x3d')]=_['intersection'](_0x1c5461[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x50ac64[_0xdd71('0x3a')]['fields']));_0xe04928[_0xdd71('0x3d')]=_0xe04928[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0xe04928[_0xdd71('0x3d')]:_0x1c5461[_0xdd71('0x39')];if(_0x50ac64[_0xdd71('0x3a')]['includeAll']){_0xe04928[_0xdd71('0x4c')]=[{'all':!![]}];}_0xe04928=_[_0xdd71('0x47')]({},_0xe04928,_0x50ac64['options']);return db[_0xdd71('0x4a')][_0xdd71('0x31')](_0xe04928)[_0xdd71('0x2a')](handleEntityNotFound(_0x781fb,null))[_0xdd71('0x2a')](respondWithResult(_0x781fb,null))[_0xdd71('0x4f')](handleError(_0x781fb,null));};exports[_0xdd71('0x52')]=function(_0x23c73a,_0x33dd72){return db[_0xdd71('0x4a')][_0xdd71('0x52')](_0x23c73a[_0xdd71('0x53')],{})[_0xdd71('0x2a')](function(_0x57b981){var _0x753184=_0x23c73a['user'][_0xdd71('0x54')]({'plain':!![]});if(!_0x753184)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x753184[_0xdd71('0x55')]==='user'){var _0x54b680=_0x57b981[_0xdd71('0x54')]({'plain':!![]});var _0x210563=[{'name':_0xdd71('0x56'),'value':_0xdd71('0x2b')},{'name':'QueueCampaigns','value':_0xdd71('0x2d')}];var _0x46b3e9=_[_0xdd71('0x31')](_0x210563,[_0xdd71('0x2f'),_0x54b680[_0xdd71('0x30')]])[_0xdd71('0x35')];return db['UserProfileSection'][_0xdd71('0x31')]({'where':{'name':_0x46b3e9,'userProfileId':_0x753184[_0xdd71('0x57')]},'raw':!![]})[_0xdd71('0x2a')](function(_0x25b8cd){if(_0x25b8cd&&_0x25b8cd[_0xdd71('0x58')]===0x0){return db[_0xdd71('0x59')][_0xdd71('0x52')]({'name':_0x54b680['name'],'resourceId':_0x54b680['id'],'type':_0x25b8cd[_0xdd71('0x35')],'sectionId':_0x25b8cd['id']},{})[_0xdd71('0x2a')](function(){return _0x57b981;});}else{return _0x57b981;}})['catch'](function(_0x9c99b1){logger[_0xdd71('0x33')](_0xdd71('0x5a'),_0x9c99b1);throw _0x9c99b1;});}return _0x57b981;})[_0xdd71('0x2a')](respondWithResult(_0x33dd72,0xc9))['catch'](handleError(_0x33dd72,null));};exports['clone']=function(_0x132c9e,_0x42d4e1){var _0x4573f8={'where':{'id':_0x132c9e[_0xdd71('0x50')]['id']}},_0x47f973={};_0x47f973[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x4a')][_0xdd71('0x37')]);_0x4573f8[_0xdd71('0x3d')]=_['intersection'](_0x47f973[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x132c9e[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4573f8[_0xdd71('0x3d')]=_0x4573f8['attributes']['length']?_0x4573f8[_0xdd71('0x3d')]:_0x47f973[_0xdd71('0x39')];if(_0x132c9e[_0xdd71('0x3a')]['includeAll']){_0x4573f8[_0xdd71('0x4c')]=[{'all':!![]}];}_0x4573f8=_[_0xdd71('0x47')]({},_0x4573f8,_0x132c9e[_0xdd71('0x49')]);return db['VoiceQueue'][_0xdd71('0x31')](_0x4573f8)[_0xdd71('0x2a')](handleEntityNotFound(_0x42d4e1,null))[_0xdd71('0x2a')](function(_0x5363f1){if(_0x5363f1){var _0x2ec797=_0x5363f1['get']({'plain':!![]});_0x2ec797=qs[_0xdd71('0x5b')](_0x2ec797,['id','createdAt',_0xdd71('0x5c')]);_0x132c9e[_0xdd71('0x53')]=_[_0xdd71('0x5b')](_0x132c9e[_0xdd71('0x53')],['id',_0xdd71('0x5d'),_0xdd71('0x5c')]);return db['VoiceQueue'][_0xdd71('0x52')](_['merge'](_0x2ec797,_0x132c9e[_0xdd71('0x53')]),{'include':_0x132c9e[_0xdd71('0x3a')][_0xdd71('0x4b')]?[{'all':!![]}]:undefined})[_0xdd71('0x2a')](function(_0x1ceaf5){var _0x2a79da=_0x132c9e['user']['get']({'plain':!![]});if(!_0x2a79da)throw new Error(_0xdd71('0x5e'));if(_0x2a79da['role']===_0xdd71('0x5f')){var _0x269714=_0x1ceaf5[_0xdd71('0x54')]({'plain':!![]});var _0x5f3092=[{'name':_0xdd71('0x56'),'value':_0xdd71('0x2b')},{'name':'QueueCampaigns','value':_0xdd71('0x2d')}];var _0x521300=_[_0xdd71('0x31')](_0x5f3092,[_0xdd71('0x2f'),_0x269714[_0xdd71('0x30')]])[_0xdd71('0x35')];return db[_0xdd71('0x60')]['find']({'where':{'name':_0x521300,'userProfileId':_0x2a79da[_0xdd71('0x57')]},'raw':!![]})[_0xdd71('0x2a')](function(_0x5dcab7){if(_0x5dcab7&&_0x5dcab7[_0xdd71('0x58')]===0x0){return db['UserProfileResource'][_0xdd71('0x52')]({'name':_0x269714[_0xdd71('0x35')],'resourceId':_0x269714['id'],'type':_0x5dcab7[_0xdd71('0x35')],'sectionId':_0x5dcab7['id']},{})[_0xdd71('0x2a')](function(){return _0x1ceaf5;});}else{return _0x1ceaf5;}})[_0xdd71('0x4f')](function(_0xaa24d1){logger[_0xdd71('0x33')](_0xdd71('0x5a'),_0xaa24d1);throw _0xaa24d1;});}return _0x1ceaf5;});}})[_0xdd71('0x2a')](respondWithResult(_0x42d4e1,0xc9))[_0xdd71('0x4f')](handleError(_0x42d4e1,null));};exports['update']=function(_0x5dbf06,_0x8a9bea){if(_0x5dbf06['body']['id']){delete _0x5dbf06[_0xdd71('0x53')]['id'];}return db['VoiceQueue'][_0xdd71('0x31')]({'where':{'id':_0x5dbf06[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x8a9bea,null))[_0xdd71('0x2a')](saveUpdates(_0x5dbf06[_0xdd71('0x53')],null))[_0xdd71('0x2a')](respondWithResult(_0x8a9bea,null))['catch'](handleError(_0x8a9bea,null));};exports[_0xdd71('0x32')]=function(_0x2af733,_0x87488c){return db[_0xdd71('0x4a')]['find']({'where':{'id':_0x2af733[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x87488c,null))[_0xdd71('0x2a')](removeEntity(_0x87488c,null))[_0xdd71('0x4f')](handleError(_0x87488c,null));};exports[_0xdd71('0x61')]=function(_0x533733,_0xc2f7c6,_0x5964bd){var _0x19dd59={'raw':![],'where':{}};var _0x379764={};var _0x5c154a={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x533733[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0xc2f7c6,null))[_0xdd71('0x2a')](function(_0x438a6c){if(_0x438a6c){_0x379764[_0xdd71('0x39')]=_[_0xdd71('0x51')](db[_0xdd71('0x63')]['rawAttributes']);_0x379764[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x533733[_0xdd71('0x3a')]);_0x379764[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x379764['model'],_0x379764[_0xdd71('0x3a')]);_0x19dd59[_0xdd71('0x3d')]=_['intersection'](_0x379764[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x533733[_0xdd71('0x3a')]['fields']));_0x19dd59['attributes']=_0x19dd59[_0xdd71('0x3d')]['length']?_0x19dd59[_0xdd71('0x3d')]:_0x379764[_0xdd71('0x39')];if(!_0x533733[_0xdd71('0x3a')]['hasOwnProperty']('nolimit')){_0x19dd59[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x533733[_0xdd71('0x3a')]['limit']);_0x19dd59[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x533733[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x19dd59[_0xdd71('0x42')]=qs['sort'](_0x533733[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x19dd59[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x533733['query'],_0x379764[_0xdd71('0x3b')]));_0x19dd59[_0xdd71('0x46')]['VoiceQueueId']=_0x438a6c['id'];if(_0x533733[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x19dd59[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x19dd59[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x19dd59[_0xdd71('0x3d')],function(_0x3d8d4a){var _0x5bd19a={};_0x5bd19a[_0x3d8d4a]={'$like':'%'+_0x533733[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x5bd19a;})});}_0x19dd59=_[_0xdd71('0x47')]({},_0x19dd59,_0x533733['options']);return db[_0xdd71('0x63')]['count']({'where':_0x19dd59[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x85a647){_0x5c154a[_0xdd71('0x22')]=_0x85a647;if(_0x533733[_0xdd71('0x3a')][_0xdd71('0x4b')]){_0x19dd59['include']=[{'all':!![]}];}return db[_0xdd71('0x63')]['findAll'](_0x19dd59);})[_0xdd71('0x2a')](function(_0x384121){_0x5c154a[_0xdd71('0x4e')]=_0x384121;return _0x5c154a;});}})['then'](respondWithFilteredResult(_0xc2f7c6,_0x19dd59))[_0xdd71('0x4f')](handleError(_0xc2f7c6,null));};exports['getHopperHistories']=function(_0x1815e7,_0x1ab2a9,_0x343570){var _0x369366={'raw':!![],'where':{}};var _0x1e884f={};var _0x25e3b7={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x1815e7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x1ab2a9,null))[_0xdd71('0x2a')](function(_0x4e17c9){if(_0x4e17c9){_0x1e884f[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x64')][_0xdd71('0x37')]);_0x1e884f[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x1815e7['query']);_0x1e884f[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x1e884f[_0xdd71('0x39')],_0x1e884f[_0xdd71('0x3a')]);_0x369366['attributes']=_[_0xdd71('0x3c')](_0x1e884f[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x1815e7['query']['fields']));_0x369366[_0xdd71('0x3d')]=_0x369366[_0xdd71('0x3d')]['length']?_0x369366[_0xdd71('0x3d')]:_0x1e884f[_0xdd71('0x39')];if(!_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x369366[_0xdd71('0x41')]=qs['limit'](_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x369366['offset']=qs[_0xdd71('0x23')](_0x1815e7[_0xdd71('0x3a')][_0xdd71('0x23')]);}_0x369366[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x1815e7[_0xdd71('0x3a')]['sort']);_0x369366[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_['pick'](_0x1815e7[_0xdd71('0x3a')],_0x1e884f[_0xdd71('0x3b')]));_0x369366[_0xdd71('0x46')][_0xdd71('0x66')]=_0x4e17c9['id'];if(_0x1815e7['query']['filter']){_0x369366[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x369366[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x369366[_0xdd71('0x3d')],function(_0x530376){var _0x4f6ada={};_0x4f6ada[_0x530376]={'$like':'%'+_0x1815e7['query'][_0xdd71('0x45')]+'%'};return _0x4f6ada;})});}_0x369366=_[_0xdd71('0x47')]({},_0x369366,_0x1815e7[_0xdd71('0x49')]);return db[_0xdd71('0x64')]['count']({'where':_0x369366[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x1475ed){_0x25e3b7[_0xdd71('0x22')]=_0x1475ed;if(_0x1815e7[_0xdd71('0x3a')]['includeAll']){_0x369366[_0xdd71('0x4c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0xdd71('0x4d')](_0x369366);})[_0xdd71('0x2a')](function(_0x12fde7){_0x25e3b7['rows']=_0x12fde7;return _0x25e3b7;});}})[_0xdd71('0x2a')](respondWithFilteredResult(_0x1ab2a9,_0x369366))[_0xdd71('0x4f')](handleError(_0x1ab2a9,null));};exports[_0xdd71('0x67')]=function(_0x4d95c7,_0xe00f53,_0x46265f){var _0x23f0a8={'raw':!![],'where':{}};var _0x2a5ef4={};var _0x3b6a2c={'count':0x0,'rows':[]};return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x4d95c7[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0xe00f53,null))[_0xdd71('0x2a')](function(_0x38519f){if(_0x38519f){_0x2a5ef4['model']=_['keys'](db['CmHopperFinal'][_0xdd71('0x37')]);_0x2a5ef4[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x4d95c7[_0xdd71('0x3a')]);_0x2a5ef4[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x2a5ef4[_0xdd71('0x39')],_0x2a5ef4[_0xdd71('0x3a')]);_0x23f0a8[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x2a5ef4[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x4d95c7[_0xdd71('0x3a')]['fields']));_0x23f0a8[_0xdd71('0x3d')]=_0x23f0a8[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x23f0a8[_0xdd71('0x3d')]:_0x2a5ef4[_0xdd71('0x39')];if(!_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x23f0a8[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x4d95c7[_0xdd71('0x3a')]['limit']);_0x23f0a8[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x4d95c7['query'][_0xdd71('0x23')]);}_0x23f0a8[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x23f0a8['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x4d95c7['query'],_0x2a5ef4['filters']));_0x23f0a8['where']['VoiceQueueId']=_0x38519f['id'];if(_0x4d95c7['query'][_0xdd71('0x45')]){_0x23f0a8[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x23f0a8[_0xdd71('0x46')],{'$or':_['map'](_0x23f0a8[_0xdd71('0x3d')],function(_0x1a4c98){var _0x3ecd00={};_0x3ecd00[_0x1a4c98]={'$like':'%'+_0x4d95c7[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x3ecd00;})});}_0x23f0a8=_['merge']({},_0x23f0a8,_0x4d95c7['options']);return db[_0xdd71('0x68')][_0xdd71('0x22')]({'where':_0x23f0a8[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x41a259){_0x3b6a2c[_0xdd71('0x22')]=_0x41a259;if(_0x4d95c7['query'][_0xdd71('0x4b')]){_0x23f0a8['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xdd71('0x4d')](_0x23f0a8);})[_0xdd71('0x2a')](function(_0x20d162){_0x3b6a2c['rows']=_0x20d162;return _0x3b6a2c;});}})['then'](respondWithFilteredResult(_0xe00f53,_0x23f0a8))['catch'](handleError(_0xe00f53,null));};exports[_0xdd71('0x69')]=function(_0xee6f16,_0x65e56,_0x21830d){var _0x118a17={'raw':!![],'where':{}};var _0x8b063d={};var _0x4d0c5c={'count':0x0,'rows':[]};return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0xee6f16[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x65e56,null))[_0xdd71('0x2a')](function(_0x108a62){if(_0x108a62){_0x8b063d[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x6a')][_0xdd71('0x37')]);_0x8b063d['query']=_['keys'](_0xee6f16[_0xdd71('0x3a')]);_0x8b063d['filters']=_['intersection'](_0x8b063d[_0xdd71('0x39')],_0x8b063d[_0xdd71('0x3a')]);_0x118a17[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x8b063d['model'],qs[_0xdd71('0x3e')](_0xee6f16[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x118a17['attributes']=_0x118a17[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x118a17[_0xdd71('0x3d')]:_0x8b063d[_0xdd71('0x39')];if(!_0xee6f16['query']['hasOwnProperty'](_0xdd71('0x65'))){_0x118a17[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0xee6f16[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x118a17['offset']=qs[_0xdd71('0x23')](_0xee6f16[_0xdd71('0x3a')]['offset']);}_0x118a17[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0xee6f16['query'][_0xdd71('0x43')]);_0x118a17[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0xee6f16[_0xdd71('0x3a')],_0x8b063d['filters']));_0x118a17[_0xdd71('0x46')][_0xdd71('0x66')]=_0x108a62['id'];if(_0xee6f16['query']['filter']){_0x118a17['where']=_[_0xdd71('0x47')](_0x118a17['where'],{'$or':_[_0xdd71('0x2e')](_0x118a17['attributes'],function(_0x13941c){var _0x57021f={};_0x57021f[_0x13941c]={'$like':'%'+_0xee6f16['query']['filter']+'%'};return _0x57021f;})});}_0x118a17=_[_0xdd71('0x47')]({},_0x118a17,_0xee6f16[_0xdd71('0x49')]);return db[_0xdd71('0x6a')][_0xdd71('0x22')]({'where':_0x118a17[_0xdd71('0x46')]})[_0xdd71('0x2a')](function(_0x2e79eb){_0x4d0c5c[_0xdd71('0x22')]=_0x2e79eb;if(_0xee6f16['query'][_0xdd71('0x4b')]){_0x118a17[_0xdd71('0x4c')]=[{'all':!![]}];}return db[_0xdd71('0x6a')][_0xdd71('0x4d')](_0x118a17);})[_0xdd71('0x2a')](function(_0xbbf59f){_0x4d0c5c[_0xdd71('0x4e')]=_0xbbf59f;return _0x4d0c5c;});}})[_0xdd71('0x2a')](respondWithFilteredResult(_0x65e56,_0x118a17))[_0xdd71('0x4f')](handleError(_0x65e56,null));};exports['getTeams']=function(_0x320dd4,_0x4245f4,_0x403362){var _0x14f91d={};var _0x100992={};var _0x236194;var _0xc5e5b4;return db['VoiceQueue'][_0xdd71('0x62')]({'where':{'id':_0x320dd4[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x4245f4,null))[_0xdd71('0x2a')](function(_0x509966){if(_0x509966){_0x236194=_0x509966;_0x100992['model']=_[_0xdd71('0x51')](db[_0xdd71('0x6b')][_0xdd71('0x37')]);_0x100992[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x320dd4[_0xdd71('0x3a')]);_0x100992[_0xdd71('0x3b')]=_['intersection'](_0x100992[_0xdd71('0x39')],_0x100992[_0xdd71('0x3a')]);_0x14f91d[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x100992[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x14f91d[_0xdd71('0x3d')]=_0x14f91d[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x14f91d[_0xdd71('0x3d')]:_0x100992[_0xdd71('0x39')];_0x14f91d[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x14f91d['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x320dd4['query'],_0x100992[_0xdd71('0x3b')]));if(_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x14f91d[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x14f91d[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x14f91d[_0xdd71('0x3d')],function(_0xd1d5e){var _0x6bae3c={};_0x6bae3c[_0xd1d5e]={'$like':'%'+_0x320dd4[_0xdd71('0x3a')]['filter']+'%'};return _0x6bae3c;})});}_0x14f91d=_[_0xdd71('0x47')]({},_0x14f91d,_0x320dd4[_0xdd71('0x49')]);return _0x236194[_0xdd71('0x6c')](_0x14f91d);}})[_0xdd71('0x2a')](function(_0xcc6929){if(_0xcc6929){_0xc5e5b4=_0xcc6929[_0xdd71('0x3f')];if(!_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x40')]('nolimit')){_0x14f91d[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x320dd4[_0xdd71('0x3a')]['limit']);_0x14f91d[_0xdd71('0x23')]=qs['offset'](_0x320dd4[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x236194['getTeams'](_0x14f91d);}})['then'](function(_0x2047ed){if(_0x2047ed){return _0x2047ed?{'count':_0xc5e5b4,'rows':_0x2047ed}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x4245f4,null))[_0xdd71('0x4f')](handleError(_0x4245f4,null));};exports['addTeams']=function(_0x239ae7,_0x70e9df,_0x40d65d){var _0x288ea9=_0x239ae7[_0xdd71('0x53')][_0xdd71('0x6d')];var _0x28b3e6=_['map'](_0x288ea9,'id');return db[_0xdd71('0x6b')][_0xdd71('0x4d')]({'where':{'id':_0x28b3e6},'attributes':['id'],'include':[{'model':db[_0xdd71('0x6e')],'as':_0xdd71('0x6f'),'attributes':['id',_0xdd71('0x35'),_0xdd71('0x70'),'voicePause',_0xdd71('0x71')],'raw':!![]}]})[_0xdd71('0x2a')](function(_0x404f06){if(_0x404f06){var _0xc30b0d=_['flatMap'](_0x404f06,function(_0x12451a){var _0x36b604=_0x12451a[_0xdd71('0x54')]({'plain':!![]});_0x36b604[_0xdd71('0x6f')][_0xdd71('0x72')](function(_0x5c45d9){_0x5c45d9['penalty']=_[_0xdd71('0x31')](_0x288ea9,{'id':_0x36b604['id']})[_0xdd71('0x73')];});return _0x36b604[_0xdd71('0x6f')];});return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x239ae7['params']['id']}})[_0xdd71('0x2a')](function(_0x47c8e6){return db[_0xdd71('0x74')]['transaction'](function(_0x15e2c4){return _0x47c8e6[_0xdd71('0x75')](_0x28b3e6,{'transaction':_0x15e2c4})[_0xdd71('0x2a')](function(){return BPromise[_0xdd71('0x76')](_0xc30b0d,function(_0xf88dce){return db[_0xdd71('0x77')][_0xdd71('0x78')]({'where':{'UserId':_0xf88dce['id'],'VoiceQueueId':_0x239ae7['params']['id']},'defaults':{'penalty':_0xf88dce['penalty']},'transaction':_0x15e2c4});});})[_0xdd71('0x2a')](function(){return BPromise[_0xdd71('0x76')](_['filter'](_0xc30b0d,{'online':!![]}),function(_0x494935){return db[_0xdd71('0x79')]['upsert']({'membername':_0x494935[_0xdd71('0x35')],'UserId':_0x494935['id'],'queue_name':_0x47c8e6[_0xdd71('0x35')],'VoiceQueueId':_0x47c8e6['id'],'interface':_['isNil'](_0x494935[_0xdd71('0x71')])?util[_0xdd71('0x7a')](_0xdd71('0x7b'),_0x494935[_0xdd71('0x35')]):_0x494935[_0xdd71('0x71')],'paused':_0x494935[_0xdd71('0x7c')]||![],'penalty':_0x494935[_0xdd71('0x73')]},{'transaction':_0x15e2c4});});})[_0xdd71('0x2a')](function(){_0xc30b0d[_0xdd71('0x72')](function(_0x246642){socket[_0xdd71('0x7d')](_0xdd71('0x7e'),{'UserId':_0x246642['id'],'VoiceQueueId':_0x47c8e6['id']});});});});});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x70e9df,null))[_0xdd71('0x4f')](handleError(_0x70e9df,null));};exports['removeTeams']=function(_0x568284,_0x3ce721,_0x94c2fe){return db[_0xdd71('0x6b')][_0xdd71('0x4d')]({'where':{'id':_0x568284[_0xdd71('0x3a')][_0xdd71('0x7f')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x3ce721,null))[_0xdd71('0x2a')](function(_0x4f184c){var _0xd6f9bf=_[_0xdd71('0x2e')](_0x4f184c,'id');var _0x45fcd4=[];var _0x42f1a1=[];var _0x591267=squel[_0xdd71('0x80')]();_0x591267[_0xdd71('0x81')]('tq.TeamId')[_0xdd71('0x82')](_0xdd71('0x83'),'tq')[_0xdd71('0x84')](_0xdd71('0x85'),'ut',_0xdd71('0x86'))[_0xdd71('0x46')](_0xdd71('0x87'),_0x568284[_0xdd71('0x50')]['id']);for(var _0x20b201=0x0;_0x20b201<_0x4f184c[_0xdd71('0x3f')];_0x20b201+=0x1){let _0x1fd676=_0x4f184c[_0x20b201];for(var _0x109749=0x0;_0x109749<_0x1fd676[_0xdd71('0x6f')][_0xdd71('0x3f')];_0x109749+=0x1){let _0x25fd27=_0x1fd676['Agents'][_0x109749];var _0x2f84b8=_0x591267[_0xdd71('0x88')]();_0x2f84b8[_0xdd71('0x46')](_0xdd71('0x89'),_0x25fd27['id']);_0x42f1a1[_0xdd71('0x8a')](db['sequelize'][_0xdd71('0x3a')](_0x2f84b8['toString'](),{'type':db[_0xdd71('0x74')]['QueryTypes']['SELECT']})[_0xdd71('0x2a')](function(_0x1a2c76){if(_0x1a2c76[_0xdd71('0x3f')]===0x1){return _0x25fd27['id'];}else{var _0x5efd2e=_[_0xdd71('0x8b')](_[_0xdd71('0x2e')](_0x1a2c76,'TeamId'),function(_0xb07694){return _[_0xdd71('0x8c')](_0xd6f9bf,_0xb07694);});if(_0x5efd2e){return _0x25fd27['id'];}}}));}}return BPromise[_0xdd71('0x8d')](_0x42f1a1)[_0xdd71('0x2a')](function(_0x17e62d){_0x45fcd4=_(_0x45fcd4)[_0xdd71('0x8e')](_0x17e62d)[_0xdd71('0x8f')]()[_0xdd71('0x2f')]();return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x568284['params']['id']}})['then'](function(_0x533a4f){return db[_0xdd71('0x74')][_0xdd71('0x90')](function(_0x2d7ba1){return _0x533a4f[_0xdd71('0x91')](_0x568284[_0xdd71('0x3a')][_0xdd71('0x7f')],{'transaction':_0x2d7ba1})[_0xdd71('0x2a')](function(){if(!_[_0xdd71('0x92')](_0x45fcd4)){return _0x533a4f[_0xdd71('0x93')](_0x45fcd4,{'transaction':_0x2d7ba1})[_0xdd71('0x2a')](function(){return db[_0xdd71('0x79')][_0xdd71('0x32')]({'where':{'VoiceQueueId':_0x568284[_0xdd71('0x50')]['id'],'UserId':_0x45fcd4},'transaction':_0x2d7ba1});});}})['then'](function(){_0x45fcd4[_0xdd71('0x72')](function(_0x2c9dd1){socket[_0xdd71('0x7d')]('userVoiceQueue:remove',{'UserId':_0x2c9dd1,'VoiceQueueId':_0x533a4f['id']});});});});});});})['then'](respondWithStatusCode(_0x3ce721,null))[_0xdd71('0x4f')](handleError(_0x3ce721,null));};exports['addAgents']=function(_0x40c8e3,_0x5df2da,_0x34f95e){var _0x459111,_0x581e6d;return db[_0xdd71('0x4a')]['find']({'where':{'id':_0x40c8e3[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x5df2da,null))[_0xdd71('0x2a')](function(_0x2ee6e7){if(_0x2ee6e7){_0x581e6d=_0x2ee6e7;return _0x2ee6e7[_0xdd71('0x94')](_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')],_['omit'](_0x40c8e3['body'],[_0xdd71('0x7f'),'id'])||{})[_0xdd71('0x95')](function(_0x78cb7f){for(var _0x294812=0x0;_0x294812<_0x40c8e3[_0xdd71('0x53')]['ids'][_0xdd71('0x3f')];_0x294812+=0x1){socket[_0xdd71('0x7d')](_0xdd71('0x7e'),{'UserId':_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')][_0x294812],'VoiceQueueId':_0x40c8e3[_0xdd71('0x50')]['id']});}return _0x78cb7f;});}})[_0xdd71('0x2a')](function(_0x2ef193){_0x459111=_0x2ef193||[];if(_0x581e6d){return db[_0xdd71('0x6e')]['findAll']({'where':{'id':_0x40c8e3[_0xdd71('0x53')][_0xdd71('0x7f')]},'attributes':['id','name',_0xdd71('0x70'),_0xdd71('0x7c'),'interface'],'raw':!![]});}})[_0xdd71('0x2a')](function(_0xbc747c){if(!_['isEmpty'](_0xbc747c)){var _0x252558=[];for(var _0x3bf2eb=0x0;_0x3bf2eb<_0xbc747c[_0xdd71('0x3f')];_0x3bf2eb++){if(_0xbc747c[_0x3bf2eb][_0xdd71('0x70')]){_0x252558[_0xdd71('0x8a')](db[_0xdd71('0x79')]['upsert']({'membername':_0xbc747c[_0x3bf2eb][_0xdd71('0x35')],'UserId':_0xbc747c[_0x3bf2eb]['id'],'queue_name':_0x581e6d['name'],'VoiceQueueId':_0x581e6d['id'],'interface':_[_0xdd71('0x96')](_0xbc747c[_0x3bf2eb]['interface'])?util[_0xdd71('0x7a')](_0xdd71('0x7b'),_0xbc747c[_0x3bf2eb]['name']):_0xbc747c[_0x3bf2eb]['interface'],'paused':_0xbc747c[_0x3bf2eb][_0xdd71('0x7c')]||![],'penalty':_0x40c8e3['body'][_0xdd71('0x73')]||0x0}));}}return BPromise['all'](_0x252558);}})['then'](function(){return _0x459111;})[_0xdd71('0x2a')](respondWithResult(_0x5df2da,null))[_0xdd71('0x4f')](handleError(_0x5df2da,null));};exports['removeAgents']=function(_0xe0526,_0x12c5c8,_0x3d12e3){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0xe0526[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x12c5c8,null))[_0xdd71('0x2a')](function(_0x12c8b7){if(_0x12c8b7){return _0x12c8b7[_0xdd71('0x93')](_0xe0526[_0xdd71('0x3a')]['ids'])[_0xdd71('0x2a')](function(){if(_[_0xdd71('0x97')](_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')])){for(var _0x22b82f=0x0;_0x22b82f<_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')][_0xdd71('0x3f')];_0x22b82f+=0x1){socket[_0xdd71('0x7d')](_0xdd71('0x98'),{'UserId':Number(_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')][_0x22b82f]),'VoiceQueueId':Number(_0xe0526[_0xdd71('0x50')]['id'])});}}else{socket[_0xdd71('0x7d')](_0xdd71('0x98'),{'UserId':Number(_0xe0526[_0xdd71('0x3a')][_0xdd71('0x7f')]),'VoiceQueueId':Number(_0xe0526[_0xdd71('0x50')]['id'])});}});}})['then'](function(_0x3e9978){return db['UserVoiceQueueRt'][_0xdd71('0x32')]({'where':{'VoiceQueueId':_0xe0526[_0xdd71('0x50')]['id'],'UserId':_0xe0526[_0xdd71('0x3a')]['ids']}})[_0xdd71('0x2a')](function(){return _0x3e9978;});})['then'](respondWithStatusCode(_0x12c5c8,null))['catch'](handleError(_0x12c5c8,null));};exports[_0xdd71('0x99')]=function(_0x358bd1,_0x413542,_0x3fed4c){var _0x3ec890={};var _0x415ac7={};var _0x41d55f;var _0x42a354;return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0x358bd1['params']['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x413542,null))[_0xdd71('0x2a')](function(_0x4027f8){if(_0x4027f8){_0x41d55f=_0x4027f8;_0x415ac7[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x6e')][_0xdd71('0x37')]);_0x415ac7['query']=_[_0xdd71('0x51')](_0x358bd1[_0xdd71('0x3a')]);_0x415ac7[_0xdd71('0x3b')]=_['intersection'](_0x415ac7['model'],_0x415ac7[_0xdd71('0x3a')]);_0x3ec890['attributes']=_[_0xdd71('0x3c')](_0x415ac7[_0xdd71('0x39')],qs[_0xdd71('0x3e')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x3ec890[_0xdd71('0x3d')]=_0x3ec890['attributes'][_0xdd71('0x3f')]?_0x3ec890[_0xdd71('0x3d')]:_0x415ac7[_0xdd71('0x39')];_0x3ec890['order']=qs[_0xdd71('0x43')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x3ec890[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x358bd1['query'],_0x415ac7['filters']));if(_0x358bd1[_0xdd71('0x3a')]['filter']){_0x3ec890['where']=_['merge'](_0x3ec890[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x3ec890[_0xdd71('0x3d')],function(_0x17b178){var _0x4f53be={};_0x4f53be[_0x17b178]={'$like':'%'+_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x4f53be;})});}_0x3ec890=_[_0xdd71('0x47')]({},_0x3ec890,_0x358bd1[_0xdd71('0x49')]);return _0x41d55f[_0xdd71('0x99')](_0x3ec890);}})['then'](function(_0x57d5c6){if(_0x57d5c6){_0x42a354=_0x57d5c6[_0xdd71('0x3f')];if(!_0x358bd1['query'][_0xdd71('0x40')](_0xdd71('0x65'))){_0x3ec890[_0xdd71('0x41')]=qs['limit'](_0x358bd1[_0xdd71('0x3a')]['limit']);_0x3ec890[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x358bd1[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x41d55f[_0xdd71('0x99')](_0x3ec890);}})[_0xdd71('0x2a')](function(_0x2f28ec){if(_0x2f28ec){return _0x2f28ec?{'count':_0x42a354,'rows':_0x2f28ec}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x413542,null))[_0xdd71('0x4f')](handleError(_0x413542,null));};exports[_0xdd71('0x9a')]=function(_0x46dc99,_0x2a734f,_0x4c5c9c){var _0x2302b9={};var _0xd53810={};var _0x28ca21;var _0x3ed672;return db[_0xdd71('0x4a')][_0xdd71('0x62')]({'where':{'id':_0x46dc99[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x2a734f,null))[_0xdd71('0x2a')](function(_0x4d14ac){if(_0x4d14ac){_0x28ca21=_0x4d14ac;_0xd53810[_0xdd71('0x39')]=_[_0xdd71('0x51')](db['UserVoiceQueueRt'][_0xdd71('0x37')]);_0xd53810[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x46dc99[_0xdd71('0x3a')]);_0xd53810['filters']=_['intersection'](_0xd53810[_0xdd71('0x39')],_0xd53810[_0xdd71('0x3a')]);_0x2302b9[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0xd53810[_0xdd71('0x39')],qs['fields'](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x2302b9[_0xdd71('0x3d')]=_0x2302b9['attributes'][_0xdd71('0x3f')]?_0x2302b9[_0xdd71('0x3d')]:_0xd53810[_0xdd71('0x39')];_0x2302b9['order']=qs[_0xdd71('0x43')](_0x46dc99[_0xdd71('0x3a')]['sort']);_0x2302b9[_0xdd71('0x46')]=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x46dc99[_0xdd71('0x3a')],_0xd53810['filters']));if(_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x2302b9['where']=_[_0xdd71('0x47')](_0x2302b9['where'],{'$or':_[_0xdd71('0x2e')](_0x2302b9[_0xdd71('0x3d')],function(_0x5d0291){var _0x1a928a={};_0x1a928a[_0x5d0291]={'$like':'%'+_0x46dc99[_0xdd71('0x3a')]['filter']+'%'};return _0x1a928a;})});}_0x2302b9=_[_0xdd71('0x47')]({},_0x2302b9,_0x46dc99[_0xdd71('0x49')]);return _0x28ca21[_0xdd71('0x9a')](_0x2302b9);}})[_0xdd71('0x2a')](function(_0x23f2f5){if(_0x23f2f5){_0x3ed672=_0x23f2f5[_0xdd71('0x3f')];if(!_0x46dc99[_0xdd71('0x3a')]['hasOwnProperty']('nolimit')){_0x2302b9[_0xdd71('0x41')]=qs['limit'](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x41')]);_0x2302b9[_0xdd71('0x23')]=qs[_0xdd71('0x23')](_0x46dc99[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x28ca21[_0xdd71('0x9a')](_0x2302b9);}})[_0xdd71('0x2a')](function(_0x29ed2d){return _0x29ed2d?{'count':_0x3ed672,'rows':_0x29ed2d}:null;})[_0xdd71('0x2a')](respondWithResult(_0x2a734f,null))['catch'](handleError(_0x2a734f,null));};exports['getLists']=function(_0x26b0ae,_0x59f43a,_0x35b3dd){var _0x29df68={};var _0x2c0c8a={};var _0x51ab13;var _0x2a2e55;return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x26b0ae[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x59f43a,null))[_0xdd71('0x2a')](function(_0x4ae7ea){if(_0x4ae7ea){_0x51ab13=_0x4ae7ea;_0x2c0c8a[_0xdd71('0x39')]=_['keys'](db[_0xdd71('0x9b')][_0xdd71('0x37')]);_0x2c0c8a[_0xdd71('0x3a')]=_['keys'](_0x26b0ae[_0xdd71('0x3a')]);_0x2c0c8a[_0xdd71('0x3b')]=_[_0xdd71('0x3c')](_0x2c0c8a[_0xdd71('0x39')],_0x2c0c8a[_0xdd71('0x3a')]);_0x29df68[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x2c0c8a['model'],qs[_0xdd71('0x3e')](_0x26b0ae[_0xdd71('0x3a')]['fields']));_0x29df68[_0xdd71('0x3d')]=_0x29df68[_0xdd71('0x3d')][_0xdd71('0x3f')]?_0x29df68[_0xdd71('0x3d')]:_0x2c0c8a[_0xdd71('0x39')];_0x29df68[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x26b0ae[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x29df68['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x26b0ae[_0xdd71('0x3a')],_0x2c0c8a[_0xdd71('0x3b')]));if(_0x26b0ae[_0xdd71('0x3a')]['filter']){_0x29df68['where']=_[_0xdd71('0x47')](_0x29df68[_0xdd71('0x46')],{'$or':_[_0xdd71('0x2e')](_0x29df68[_0xdd71('0x3d')],function(_0x2fb351){var _0x27e8a8={};_0x27e8a8[_0x2fb351]={'$like':'%'+_0x26b0ae[_0xdd71('0x3a')][_0xdd71('0x45')]+'%'};return _0x27e8a8;})});}_0x29df68=_[_0xdd71('0x47')]({},_0x29df68,_0x26b0ae['options']);return _0x51ab13[_0xdd71('0x9c')](_0x29df68);}})[_0xdd71('0x2a')](function(_0x90ed51){if(_0x90ed51){_0x2a2e55=_0x90ed51[_0xdd71('0x3f')];if(!_0x26b0ae[_0xdd71('0x3a')]['hasOwnProperty'](_0xdd71('0x65'))){_0x29df68[_0xdd71('0x41')]=qs[_0xdd71('0x41')](_0x26b0ae['query'][_0xdd71('0x41')]);_0x29df68[_0xdd71('0x23')]=qs['offset'](_0x26b0ae[_0xdd71('0x3a')]['offset']);}return _0x51ab13[_0xdd71('0x9c')](_0x29df68);}})[_0xdd71('0x2a')](function(_0x271c54){if(_0x271c54){return _0x271c54?{'count':_0x2a2e55,'rows':_0x271c54}:null;}})['then'](respondWithResult(_0x59f43a,null))[_0xdd71('0x4f')](handleError(_0x59f43a,null));};exports['addLists']=function(_0x180e66,_0x5d422e,_0x57777c){var _0x424b7b,_0x1153da;return db['VoiceQueue'][_0xdd71('0x31')]({'where':{'id':_0x180e66[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x5d422e,null))[_0xdd71('0x2a')](function(_0x3701b8){if(_0x3701b8){_0x1153da=_0x3701b8;return _0x3701b8[_0xdd71('0x9d')](_0x180e66[_0xdd71('0x53')][_0xdd71('0x7f')],_[_0xdd71('0x5b')](_0x180e66[_0xdd71('0x53')],['ids','id'])||{});}return null;})[_0xdd71('0x95')](function(_0x5de809){var _0x5b1a86;_0x424b7b=_0x5de809||[];var _0x3a018d=[];if(_0x5de809){for(var _0x42c14b=0x0;_0x42c14b<_0x5de809[_0xdd71('0x3f')];_0x42c14b+=0x1){var _0x22761e=_0x5de809[_0x42c14b][_0xdd71('0x54')]({'plain':!![]});_0x1153da[_0xdd71('0x9e')]=_0x180e66['body'][_0xdd71('0x9e')]?_0x180e66[_0xdd71('0x53')]['dialCheckDuplicateType']:_0x1153da[_0xdd71('0x9e')];switch(_0x1153da[_0xdd71('0x9e')]){case _0xdd71('0x9f'):_0x5b1a86=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xa1'))['fromQuery']([_0xdd71('0xa2'),_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel['select']()['field'](_0xdd71('0xa2'),_0xdd71('0xa2'))['field'](_0xdd71('0xa6'),_0xdd71('0xa3'))[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x22761e[_0xdd71('0xa7')]['toString'](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id']['toString'](),'VoiceQueueId')[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5d'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')](_0xdd71('0xa8'))[_0xdd71('0x46')](_0xdd71('0xa9'))['where']('ListId\x20=\x20?',_0x22761e['CmListId']['toString']())[_0xdd71('0x46')](_0xdd71('0xaa'))[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(calleridnum,\x27\x27)')[_0xdd71('0x82')](_0xdd71('0xac'))[_0xdd71('0x46')](_0xdd71('0x87'),_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')]()))[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(phone,\x27\x27)')[_0xdd71('0x82')]('cm_hopper')['where'](_0xdd71('0x87'),_0x180e66[_0xdd71('0x50')]['id']['toString']())))[_0xdd71('0xad')]();break;case _0xdd71('0xae'):_0x5b1a86=squel[_0xdd71('0xaf')]()['into'](_0xdd71('0xa1'))[_0xdd71('0xb0')]([_0xdd71('0xa2'),_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()[_0xdd71('0x81')](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')](_0xdd71('0xa6'),'scheduledAt')[_0xdd71('0x81')]('id','ContactId')['field'](_0x22761e['CmListId'][_0xdd71('0xad')](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')](),_0xdd71('0x66'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5d'))[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')]('cm_contacts')[_0xdd71('0x46')](_0xdd71('0xa9'))[_0xdd71('0x46')](_0xdd71('0xb1'),_0x22761e[_0xdd71('0xa7')][_0xdd71('0xad')]())[_0xdd71('0x46')]('phone\x20IS\x20NOT\x20NULL')[_0xdd71('0x46')](_0xdd71('0xab'),squel[_0xdd71('0x80')]()[_0xdd71('0x81')]('COALESCE(phone,\x27\x27)')[_0xdd71('0x82')]('cm_hopper')['where'](_0xdd71('0x87'),_0x180e66['params']['id'][_0xdd71('0xad')]())))['toString']();break;default:_0x5b1a86=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xa1'))[_0xdd71('0xb0')](['phone',_0xdd71('0xa3'),_0xdd71('0xa4'),_0xdd71('0xa5'),'VoiceQueueId',_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()[_0xdd71('0x81')](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')](_0xdd71('0xa6'),'scheduledAt')[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x22761e[_0xdd71('0xa7')][_0xdd71('0xad')](),_0xdd71('0xa5'))['field'](_0x180e66[_0xdd71('0x50')]['id'][_0xdd71('0xad')](),_0xdd71('0x66'))[_0xdd71('0x81')](_0xdd71('0xa6'),'createdAt')[_0xdd71('0x81')](_0xdd71('0xa6'),_0xdd71('0x5c'))[_0xdd71('0x82')](_0xdd71('0xa8'))[_0xdd71('0x46')](_0xdd71('0xa9'))[_0xdd71('0x46')]('ListId\x20=\x20?',_0x22761e[_0xdd71('0xa7')]['toString']())[_0xdd71('0x46')](_0xdd71('0xaa')))['toString']();}_0x3a018d[_0xdd71('0x8a')](db['sequelize']['query'](_0x5b1a86));}return BPromise['all'](_0x3a018d);}})[_0xdd71('0x2a')](function(){return _0x424b7b;})[_0xdd71('0x2a')](respondWithResult(_0x5d422e,null))['catch'](handleError(_0x5d422e,null));};exports[_0xdd71('0xb2')]=function(_0x464f71,_0x3fc7a6,_0x36319f){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x464f71[_0xdd71('0x50')]['id']}})['then'](handleEntityNotFound(_0x3fc7a6,null))['then'](function(_0x1c63e0){if(_0x1c63e0){return _0x1c63e0[_0xdd71('0xb2')](_0x464f71[_0xdd71('0x3a')][_0xdd71('0x7f')]);}})[_0xdd71('0x2a')](function(_0x22d2c4){if(_0x22d2c4){return db[_0xdd71('0x63')]['destroy']({'where':{'ListId':_0x464f71[_0xdd71('0x3a')]['ids'],'VoiceQueueId':_0x464f71[_0xdd71('0x50')]['id']}})['then'](function(){return _0x22d2c4;});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x3fc7a6,null))[_0xdd71('0x4f')](handleError(_0x3fc7a6,null));};exports[_0xdd71('0xb3')]=function(_0x13cf25,_0x35674a,_0x199174){var _0x4b5b23={};var _0x396fa7={};var _0x3c8b06;var _0x2972fd;return db[_0xdd71('0x4a')]['findOne']({'where':{'id':_0x13cf25['params']['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x35674a,null))[_0xdd71('0x2a')](function(_0x33191f){if(_0x33191f){_0x3c8b06=_0x33191f;_0x396fa7[_0xdd71('0x39')]=_[_0xdd71('0x51')](db['CmList'][_0xdd71('0x37')]);_0x396fa7[_0xdd71('0x3a')]=_[_0xdd71('0x51')](_0x13cf25[_0xdd71('0x3a')]);_0x396fa7['filters']=_['intersection'](_0x396fa7['model'],_0x396fa7['query']);_0x4b5b23[_0xdd71('0x3d')]=_[_0xdd71('0x3c')](_0x396fa7[_0xdd71('0x39')],qs['fields'](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x3e')]));_0x4b5b23[_0xdd71('0x3d')]=_0x4b5b23['attributes'][_0xdd71('0x3f')]?_0x4b5b23['attributes']:_0x396fa7[_0xdd71('0x39')];_0x4b5b23[_0xdd71('0x42')]=qs[_0xdd71('0x43')](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x43')]);_0x4b5b23['where']=qs[_0xdd71('0x3b')](_[_0xdd71('0x44')](_0x13cf25[_0xdd71('0x3a')],_0x396fa7[_0xdd71('0x3b')]));if(_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x45')]){_0x4b5b23[_0xdd71('0x46')]=_[_0xdd71('0x47')](_0x4b5b23[_0xdd71('0x46')],{'$or':_['map'](_0x4b5b23[_0xdd71('0x3d')],function(_0x5d68aa){var _0x54f6f4={};_0x54f6f4[_0x5d68aa]={'$like':'%'+_0x13cf25['query'][_0xdd71('0x45')]+'%'};return _0x54f6f4;})});}_0x4b5b23=_[_0xdd71('0x47')]({},_0x4b5b23,_0x13cf25['options']);return _0x3c8b06[_0xdd71('0xb3')](_0x4b5b23);}})[_0xdd71('0x2a')](function(_0x214385){if(_0x214385){_0x2972fd=_0x214385[_0xdd71('0x3f')];if(!_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x40')](_0xdd71('0x65'))){_0x4b5b23['limit']=qs[_0xdd71('0x41')](_0x13cf25[_0xdd71('0x3a')]['limit']);_0x4b5b23[_0xdd71('0x23')]=qs['offset'](_0x13cf25[_0xdd71('0x3a')][_0xdd71('0x23')]);}return _0x3c8b06['getBlackLists'](_0x4b5b23);}})[_0xdd71('0x2a')](function(_0x1072f9){if(_0x1072f9){return _0x1072f9?{'count':_0x2972fd,'rows':_0x1072f9}:null;}})[_0xdd71('0x2a')](respondWithResult(_0x35674a,null))['catch'](handleError(_0x35674a,null));};exports[_0xdd71('0xb4')]=function(_0x4fc19e,_0x21f115,_0x1ff91c){var _0x1fa765,_0x5c95ac;return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x4fc19e[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x21f115,null))[_0xdd71('0x2a')](function(_0x49968e){if(_0x49968e){_0x5c95ac=_0x49968e;return _0x49968e[_0xdd71('0xb4')](_0x4fc19e['body']['ids'],_[_0xdd71('0x5b')](_0x4fc19e['body'],[_0xdd71('0x7f'),'id'])||{});}return null;})[_0xdd71('0x95')](function(_0x368ebe){var _0x38c0a3;_0x1fa765=_0x368ebe||[];var _0x14737e=[];if(_0x368ebe){for(var _0x1b6592=0x0;_0x1b6592<_0x368ebe['length'];_0x1b6592+=0x1){var _0x347fae=_0x368ebe[_0x1b6592][_0xdd71('0x54')]({'plain':!![]});_0x38c0a3=squel['insert']()[_0xdd71('0xa0')](_0xdd71('0xb5'))[_0xdd71('0xb0')]([_0xdd71('0xa2'),_0xdd71('0xa4'),_0xdd71('0xa5'),_0xdd71('0x66'),_0xdd71('0x5d'),_0xdd71('0x5c')],squel[_0xdd71('0x80')]()['field'](_0xdd71('0xa2'),_0xdd71('0xa2'))[_0xdd71('0x81')]('id','ContactId')[_0xdd71('0x81')](_0x347fae[_0xdd71('0xa7')]['toString'](),'ListId')[_0xdd71('0x81')](_0x4fc19e['params']['id']['toString'](),'VoiceQueueId')['field']('NOW()','createdAt')[_0xdd71('0x81')]('NOW()','updatedAt')['from']('cm_contacts')[_0xdd71('0x46')](_0xdd71('0xa9'))['where']('ListId\x20=\x20?',_0x347fae[_0xdd71('0xa7')]['toString']())['where'](_0xdd71('0xaa')))[_0xdd71('0xad')]();_0x14737e[_0xdd71('0x8a')](db[_0xdd71('0x74')][_0xdd71('0x3a')](_0x38c0a3));}return BPromise[_0xdd71('0x8d')](_0x14737e);}})['then'](function(){return _0x1fa765;})[_0xdd71('0x2a')](respondWithResult(_0x21f115,null))['catch'](handleError(_0x21f115,null));};exports[_0xdd71('0xb6')]=function(_0x2bc7c7,_0x11ae89,_0x7b8856){return db[_0xdd71('0x4a')][_0xdd71('0x31')]({'where':{'id':_0x2bc7c7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](handleEntityNotFound(_0x11ae89,null))[_0xdd71('0x2a')](function(_0x37d25d){if(_0x37d25d){return _0x37d25d['removeBlackLists'](_0x2bc7c7[_0xdd71('0x3a')][_0xdd71('0x7f')]);}})['then'](function(_0x5d2303){if(_0x5d2303){return db[_0xdd71('0x6a')]['destroy']({'where':{'ListId':_0x2bc7c7[_0xdd71('0x3a')]['ids'],'VoiceQueueId':_0x2bc7c7[_0xdd71('0x50')]['id']}})[_0xdd71('0x2a')](function(){return _0x5d2303;});}})[_0xdd71('0x2a')](respondWithStatusCode(_0x11ae89,null))[_0xdd71('0x4f')](handleError(_0x11ae89,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index d1233e0..36f73a0 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 _0x9374=['hasOwnProperty','../../mysqldb','VoiceQueue','setMaxListeners','save','emit'];(function(_0x9fe8bc,_0x4f67eb){var _0x23f8ad=function(_0x2a418c){while(--_0x2a418c){_0x9fe8bc['push'](_0x9fe8bc['shift']());}};_0x23f8ad(++_0x4f67eb);}(_0x9374,0x1bd));var _0x4937=function(_0x52ab0a,_0xf641d5){_0x52ab0a=_0x52ab0a-0x0;var _0x1d2cab=_0x9374[_0x52ab0a];return _0x1d2cab;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0x4937('0x0'))['db'][_0x4937('0x1')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x4937('0x2')](0x0);var events={'afterCreate':_0x4937('0x3'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1c9fd6){return function(_0xfb6450,_0x1f8048,_0x6ab5cd){VoiceQueueEvents[_0x4937('0x4')](_0x1c9fd6+':'+_0xfb6450['id'],_0xfb6450);VoiceQueueEvents[_0x4937('0x4')](_0x1c9fd6,_0xfb6450);_0x6ab5cd(null);};}for(var e in events){if(events[_0x4937('0x5')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module['exports']=VoiceQueueEvents; \ No newline at end of file +var _0xc42f=['update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','VoiceQueue','save'];(function(_0x4d3c3b,_0xd4e4ee){var _0x3983aa=function(_0x12adc3){while(--_0x12adc3){_0x4d3c3b['push'](_0x4d3c3b['shift']());}};_0x3983aa(++_0xd4e4ee);}(_0xc42f,0x7a));var _0xfc42=function(_0x4d31c3,_0x5c3299){_0x4d31c3=_0x4d31c3-0x0;var _0x41ca1b=_0xc42f[_0x4d31c3];return _0x41ca1b;};'use strict';var EventEmitter=require(_0xfc42('0x0'));var VoiceQueue=require(_0xfc42('0x1'))['db'][_0xfc42('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xfc42('0x3'),'afterUpdate':_0xfc42('0x4'),'afterDestroy':_0xfc42('0x5')};function emitEvent(_0x20417a){return function(_0x4cfcfd,_0x2eb21c,_0x46e7c1){VoiceQueueEvents[_0xfc42('0x6')](_0x20417a+':'+_0x4cfcfd['id'],_0x4cfcfd);VoiceQueueEvents[_0xfc42('0x6')](_0x20417a,_0x4cfcfd);_0x46e7c1(null);};}for(var e in events){if(events[_0xfc42('0x7')](e)){var event=events[e];VoiceQueue['hook'](e,emitEvent(event));}}module[_0xfc42('0x8')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index c8b44d6..f69a264 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 _0x4cb4=['voice_queues','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','define','VoiceQueue'];(function(_0x275299,_0x46e733){var _0x94dab9=function(_0x38e5e7){while(--_0x38e5e7){_0x275299['push'](_0x275299['shift']());}};_0x94dab9(++_0x46e733);}(_0x4cb4,0x100));var _0x44cb=function(_0x328b40,_0x370642){_0x328b40=_0x328b40-0x0;var _0x556a56=_0x4cb4[_0x328b40];return _0x556a56;};'use strict';var _=require(_0x44cb('0x0'));var util=require(_0x44cb('0x1'));var logger=require(_0x44cb('0x2'))(_0x44cb('0x3'));var moment=require(_0x44cb('0x4'));var BPromise=require(_0x44cb('0x5'));var rp=require(_0x44cb('0x6'));var fs=require('fs');var path=require(_0x44cb('0x7'));var rimraf=require(_0x44cb('0x8'));var config=require(_0x44cb('0x9'));var attributes=require(_0x44cb('0xa'));module[_0x44cb('0xb')]=function(_0x28ccdf,_0x2657ff){return _0x28ccdf[_0x44cb('0xc')](_0x44cb('0xd'),attributes,{'tableName':_0x44cb('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3f92=['api','bluebird','request-promise','path','../../config/environment','./voiceQueue.attributes','exports','define','voice_queues','lodash','util','../../config/logger'];(function(_0x1f3280,_0x35684f){var _0xdb07ba=function(_0x27f180){while(--_0x27f180){_0x1f3280['push'](_0x1f3280['shift']());}};_0xdb07ba(++_0x35684f);}(_0x3f92,0x171));var _0x23f9=function(_0x591a30,_0x5a1af4){_0x591a30=_0x591a30-0x0;var _0x502bd9=_0x3f92[_0x591a30];return _0x502bd9;};'use strict';var _=require(_0x23f9('0x0'));var util=require(_0x23f9('0x1'));var logger=require(_0x23f9('0x2'))(_0x23f9('0x3'));var moment=require('moment');var BPromise=require(_0x23f9('0x4'));var rp=require(_0x23f9('0x5'));var fs=require('fs');var path=require(_0x23f9('0x6'));var rimraf=require('rimraf');var config=require(_0x23f9('0x7'));var attributes=require(_0x23f9('0x8'));module[_0x23f9('0x9')]=function(_0x6025ea,_0x2b2fda){return _0x6025ea[_0x23f9('0xa')]('VoiceQueue',attributes,{'tableName':_0x23f9('0xb'),'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 c48f57b..dbfafb0 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 _0x553a=['redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info','catch','VoiceQueue','findAll','options','raw','where','attributes','limit','map','include','model','GetVoiceQueue','find','ShowVoiceQueue','util','bluebird','randomstring','ioredis','../../config/logger','jayson/promise'];(function(_0x22fba1,_0x3d1507){var _0x5a4a4c=function(_0x432bb1){while(--_0x432bb1){_0x22fba1['push'](_0x22fba1['shift']());}};_0x5a4a4c(++_0x3d1507);}(_0x553a,0x192));var _0xa553=function(_0x9d1d1f,_0x3d6e3f){_0x9d1d1f=_0x9d1d1f-0x0;var _0x19e276=_0x553a[_0x9d1d1f];return _0x19e276;};'use strict';var _=require('lodash');var util=require(_0xa553('0x0'));var moment=require('moment');var BPromise=require(_0xa553('0x1'));var rs=require(_0xa553('0x2'));var fs=require('fs');var Redis=require(_0xa553('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa553('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa553('0x5'));var client=jayson['client']['http']({'port':0x232a});config[_0xa553('0x6')]=_[_0xa553('0x7')](config[_0xa553('0x6')],{'host':'localhost','port':0x18eb});var socket=require(_0xa553('0x8'))(new Redis(config['redis']));require(_0xa553('0x9'))[_0xa553('0xa')](socket);function respondWithRpcPromise(_0x368216,_0x4b3546,_0x5ad48b){return new BPromise(function(_0xc275e6,_0x58c170){return client[_0xa553('0xb')](_0x368216,_0x5ad48b)[_0xa553('0xc')](function(_0x137813){logger['info'](_0xa553('0xd'),_0x4b3546,_0xa553('0xe'));logger[_0xa553('0xf')]('VoiceQueue,\x20%s,\x20%s,\x20%s',_0x4b3546,_0xa553('0xe'),JSON[_0xa553('0x10')](_0x137813));if(_0x137813[_0xa553('0x11')]){if(_0x137813['error']['code']===0x1f4){logger[_0xa553('0x11')](_0xa553('0xd'),_0x4b3546,_0x137813[_0xa553('0x11')][_0xa553('0x12')]);return _0x58c170(_0x137813['error'][_0xa553('0x12')]);}logger['error'](_0xa553('0xd'),_0x4b3546,_0x137813['error']['message']);return _0xc275e6(_0x137813[_0xa553('0x11')]['message']);}else{logger[_0xa553('0x13')](_0xa553('0xd'),_0x4b3546,_0xa553('0xe'));_0xc275e6(_0x137813['result'][_0xa553('0x12')]);}})[_0xa553('0x14')](function(_0x4fd13a){logger[_0xa553('0x11')](_0xa553('0xd'),_0x4b3546,_0x4fd13a);_0x58c170(_0x4fd13a);});});}exports['GetVoiceQueue']=function(_0x1b83cb){var _0x52624d=this;return new Promise(function(_0x309eb7,_0x18af22){return db[_0xa553('0x15')][_0xa553('0x16')]({'raw':_0x1b83cb['options']?_0x1b83cb[_0xa553('0x17')][_0xa553('0x18')]===undefined?!![]:![]:!![],'where':_0x1b83cb[_0xa553('0x17')]?_0x1b83cb['options'][_0xa553('0x19')]||null:null,'attributes':_0x1b83cb['options']?_0x1b83cb['options'][_0xa553('0x1a')]||null:null,'limit':_0x1b83cb[_0xa553('0x17')]?_0x1b83cb['options'][_0xa553('0x1b')]||null:null,'include':_0x1b83cb[_0xa553('0x17')]?_0x1b83cb[_0xa553('0x17')]['include']?_[_0xa553('0x1c')](_0x1b83cb[_0xa553('0x17')][_0xa553('0x1d')],function(_0x7b0d73){return{'model':db[_0x7b0d73[_0xa553('0x1e')]],'as':_0x7b0d73['as'],'attributes':_0x7b0d73[_0xa553('0x1a')],'include':_0x7b0d73[_0xa553('0x1d')]?_[_0xa553('0x1c')](_0x7b0d73['include'],function(_0x5632f1){return{'model':db[_0x5632f1[_0xa553('0x1e')]],'as':_0x5632f1['as'],'attributes':_0x5632f1[_0xa553('0x1a')],'include':_0x5632f1[_0xa553('0x1d')]?_[_0xa553('0x1c')](_0x5632f1[_0xa553('0x1d')],function(_0x407382){return{'model':db[_0x407382[_0xa553('0x1e')]],'as':_0x407382['as'],'attributes':_0x407382['attributes']};}):[]};}):[]};}):[]:[]})[_0xa553('0xc')](function(_0x1a11b0){logger[_0xa553('0x13')](_0xa553('0x1f'),_0x1b83cb);logger[_0xa553('0xf')](_0xa553('0x1f'),_0x1b83cb,JSON[_0xa553('0x10')](_0x1a11b0));_0x309eb7(_0x1a11b0);})[_0xa553('0x14')](function(_0x3f9351){logger[_0xa553('0x11')]('GetVoiceQueue',_0x3f9351[_0xa553('0x12')],_0x1b83cb);_0x18af22(_0x52624d['error'](0x1f4,_0x3f9351[_0xa553('0x12')]));});});};exports['ShowVoiceQueue']=function(_0x4f7b9a){var _0x489afc=this;return new Promise(function(_0x4a48f9,_0x20830f){return db[_0xa553('0x15')][_0xa553('0x20')]({'raw':_0x4f7b9a[_0xa553('0x17')]?_0x4f7b9a[_0xa553('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x4f7b9a[_0xa553('0x17')]?_0x4f7b9a['options'][_0xa553('0x19')]||null:null,'attributes':_0x4f7b9a[_0xa553('0x17')]?_0x4f7b9a['options']['attributes']||null:null,'include':_0x4f7b9a[_0xa553('0x17')]?_0x4f7b9a[_0xa553('0x17')][_0xa553('0x1d')]?_[_0xa553('0x1c')](_0x4f7b9a[_0xa553('0x17')][_0xa553('0x1d')],function(_0x5a976a){return{'model':db[_0x5a976a['model']],'as':_0x5a976a['as'],'attributes':_0x5a976a[_0xa553('0x1a')],'include':_0x5a976a['include']?_['map'](_0x5a976a[_0xa553('0x1d')],function(_0x3c58e3){return{'model':db[_0x3c58e3[_0xa553('0x1e')]],'as':_0x3c58e3['as'],'attributes':_0x3c58e3[_0xa553('0x1a')],'include':_0x3c58e3[_0xa553('0x1d')]?_[_0xa553('0x1c')](_0x3c58e3[_0xa553('0x1d')],function(_0x18b6f3){return{'model':db[_0x18b6f3[_0xa553('0x1e')]],'as':_0x18b6f3['as'],'attributes':_0x18b6f3[_0xa553('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xa553('0xc')](function(_0x29ff17){logger[_0xa553('0x13')](_0xa553('0x21'),_0x4f7b9a);logger[_0xa553('0xf')](_0xa553('0x21'),_0x4f7b9a,JSON[_0xa553('0x10')](_0x29ff17));_0x4a48f9(_0x29ff17);})[_0xa553('0x14')](function(_0x3484b3){logger[_0xa553('0x11')](_0xa553('0x21'),_0x3484b3[_0xa553('0x12')],_0x4f7b9a);_0x20830f(_0x489afc['error'](0x1f4,_0x3484b3[_0xa553('0x12')]));});});}; \ No newline at end of file +var _0xcdb3=['message','catch','GetVoiceQueue','options','raw','where','attributes','include','map','model','ShowVoiceQueue','VoiceQueue','find','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcdb3,0x1e1));var _0x3cdb=function(_0xc7fe5a,_0xfedcc4){_0xc7fe5a=_0xc7fe5a-0x0;var _0x5ea8b7=_0xcdb3[_0xc7fe5a];return _0x5ea8b7;};'use strict';var _=require('lodash');var util=require(_0x3cdb('0x0'));var moment=require(_0x3cdb('0x1'));var BPromise=require(_0x3cdb('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3cdb('0x3'));var db=require(_0x3cdb('0x4'))['db'];var utils=require(_0x3cdb('0x5'));var logger=require('../../config/logger')(_0x3cdb('0x6'));var config=require(_0x3cdb('0x7'));var jayson=require(_0x3cdb('0x8'));var client=jayson[_0x3cdb('0x9')][_0x3cdb('0xa')]({'port':0x232a});config[_0x3cdb('0xb')]=_[_0x3cdb('0xc')](config[_0x3cdb('0xb')],{'host':_0x3cdb('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cdb('0xb')]));require(_0x3cdb('0xe'))[_0x3cdb('0xf')](socket);function respondWithRpcPromise(_0x472905,_0x41d63f,_0x15e327){return new BPromise(function(_0x384f8b,_0xf1f249){return client[_0x3cdb('0x10')](_0x472905,_0x15e327)[_0x3cdb('0x11')](function(_0x29c1a5){logger[_0x3cdb('0x12')](_0x3cdb('0x13'),_0x41d63f,_0x3cdb('0x14'));logger[_0x3cdb('0x15')](_0x3cdb('0x16'),_0x41d63f,_0x3cdb('0x14'),JSON[_0x3cdb('0x17')](_0x29c1a5));if(_0x29c1a5[_0x3cdb('0x18')]){if(_0x29c1a5[_0x3cdb('0x18')][_0x3cdb('0x19')]===0x1f4){logger[_0x3cdb('0x18')](_0x3cdb('0x13'),_0x41d63f,_0x29c1a5[_0x3cdb('0x18')][_0x3cdb('0x1a')]);return _0xf1f249(_0x29c1a5[_0x3cdb('0x18')][_0x3cdb('0x1a')]);}logger['error']('VoiceQueue,\x20%s,\x20%s',_0x41d63f,_0x29c1a5[_0x3cdb('0x18')][_0x3cdb('0x1a')]);return _0x384f8b(_0x29c1a5[_0x3cdb('0x18')][_0x3cdb('0x1a')]);}else{logger[_0x3cdb('0x12')](_0x3cdb('0x13'),_0x41d63f,_0x3cdb('0x14'));_0x384f8b(_0x29c1a5['result'][_0x3cdb('0x1a')]);}})[_0x3cdb('0x1b')](function(_0x39fe87){logger[_0x3cdb('0x18')](_0x3cdb('0x13'),_0x41d63f,_0x39fe87);_0xf1f249(_0x39fe87);});});}exports[_0x3cdb('0x1c')]=function(_0xe6b22c){var _0x292929=this;return new Promise(function(_0x4c3e81,_0x116ddc){return db['VoiceQueue']['findAll']({'raw':_0xe6b22c['options']?_0xe6b22c[_0x3cdb('0x1d')][_0x3cdb('0x1e')]===undefined?!![]:![]:!![],'where':_0xe6b22c[_0x3cdb('0x1d')]?_0xe6b22c[_0x3cdb('0x1d')][_0x3cdb('0x1f')]||null:null,'attributes':_0xe6b22c[_0x3cdb('0x1d')]?_0xe6b22c['options'][_0x3cdb('0x20')]||null:null,'limit':_0xe6b22c['options']?_0xe6b22c[_0x3cdb('0x1d')]['limit']||null:null,'include':_0xe6b22c[_0x3cdb('0x1d')]?_0xe6b22c[_0x3cdb('0x1d')][_0x3cdb('0x21')]?_[_0x3cdb('0x22')](_0xe6b22c[_0x3cdb('0x1d')]['include'],function(_0x1fca00){return{'model':db[_0x1fca00['model']],'as':_0x1fca00['as'],'attributes':_0x1fca00[_0x3cdb('0x20')],'include':_0x1fca00[_0x3cdb('0x21')]?_[_0x3cdb('0x22')](_0x1fca00['include'],function(_0x534a44){return{'model':db[_0x534a44[_0x3cdb('0x23')]],'as':_0x534a44['as'],'attributes':_0x534a44[_0x3cdb('0x20')],'include':_0x534a44['include']?_['map'](_0x534a44[_0x3cdb('0x21')],function(_0x4d2e93){return{'model':db[_0x4d2e93[_0x3cdb('0x23')]],'as':_0x4d2e93['as'],'attributes':_0x4d2e93[_0x3cdb('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x359a08){logger[_0x3cdb('0x12')](_0x3cdb('0x1c'),_0xe6b22c);logger[_0x3cdb('0x15')](_0x3cdb('0x1c'),_0xe6b22c,JSON[_0x3cdb('0x17')](_0x359a08));_0x4c3e81(_0x359a08);})[_0x3cdb('0x1b')](function(_0xf0448d){logger[_0x3cdb('0x18')](_0x3cdb('0x1c'),_0xf0448d[_0x3cdb('0x1a')],_0xe6b22c);_0x116ddc(_0x292929[_0x3cdb('0x18')](0x1f4,_0xf0448d[_0x3cdb('0x1a')]));});});};exports[_0x3cdb('0x24')]=function(_0x28540a){var _0x439869=this;return new Promise(function(_0x22e8fe,_0x5dbfeb){return db[_0x3cdb('0x25')][_0x3cdb('0x26')]({'raw':_0x28540a[_0x3cdb('0x1d')]?_0x28540a[_0x3cdb('0x1d')]['raw']===undefined?!![]:![]:!![],'where':_0x28540a['options']?_0x28540a[_0x3cdb('0x1d')][_0x3cdb('0x1f')]||null:null,'attributes':_0x28540a[_0x3cdb('0x1d')]?_0x28540a['options'][_0x3cdb('0x20')]||null:null,'include':_0x28540a['options']?_0x28540a[_0x3cdb('0x1d')][_0x3cdb('0x21')]?_[_0x3cdb('0x22')](_0x28540a[_0x3cdb('0x1d')][_0x3cdb('0x21')],function(_0x57e3c5){return{'model':db[_0x57e3c5[_0x3cdb('0x23')]],'as':_0x57e3c5['as'],'attributes':_0x57e3c5[_0x3cdb('0x20')],'include':_0x57e3c5[_0x3cdb('0x21')]?_[_0x3cdb('0x22')](_0x57e3c5[_0x3cdb('0x21')],function(_0x3a24a1){return{'model':db[_0x3a24a1['model']],'as':_0x3a24a1['as'],'attributes':_0x3a24a1['attributes'],'include':_0x3a24a1[_0x3cdb('0x21')]?_[_0x3cdb('0x22')](_0x3a24a1[_0x3cdb('0x21')],function(_0x2088ab){return{'model':db[_0x2088ab['model']],'as':_0x2088ab['as'],'attributes':_0x2088ab[_0x3cdb('0x20')]};}):[]};}):[]};}):[]:[]})[_0x3cdb('0x11')](function(_0x51d3fe){logger[_0x3cdb('0x12')](_0x3cdb('0x24'),_0x28540a);logger[_0x3cdb('0x15')](_0x3cdb('0x24'),_0x28540a,JSON[_0x3cdb('0x17')](_0x51d3fe));_0x22e8fe(_0x51d3fe);})['catch'](function(_0x5c6ee0){logger[_0x3cdb('0x18')](_0x3cdb('0x24'),_0x5c6ee0[_0x3cdb('0x1a')],_0x28540a);_0x5dbfeb(_0x439869[_0x3cdb('0x18')](0x1f4,_0x5c6ee0[_0x3cdb('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index df7019d..60e9376 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 _0x1546=['save','remove','emit','length','voiceQueue:'];(function(_0x18cd5b,_0x10240b){var _0x5eaa52=function(_0x2bccad){while(--_0x2bccad){_0x18cd5b['push'](_0x18cd5b['shift']());}};_0x5eaa52(++_0x10240b);}(_0x1546,0x18b));var _0x6154=function(_0x4b3662,_0x269658){_0x4b3662=_0x4b3662-0x0;var _0x5c7f6e=_0x1546[_0x4b3662];return _0x5c7f6e;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x6154('0x0'),_0x6154('0x1'),'update'];function createListener(_0x582045,_0x518035){return function(_0xc3ccbb){_0x518035[_0x6154('0x2')](_0x582045,_0xc3ccbb);};}function removeListener(_0x62b764,_0x4608a0){return function(){VoiceQueueEvents['removeListener'](_0x62b764,_0x4608a0);};}exports['register']=function(_0x37082f){for(var _0xcf55bb=0x0,_0x314d28=events[_0x6154('0x3')];_0xcf55bb<_0x314d28;_0xcf55bb++){var _0x102541=events[_0xcf55bb];var _0x44c302=createListener(_0x6154('0x4')+_0x102541,_0x37082f);VoiceQueueEvents['on'](_0x102541,_0x44c302);}}; \ No newline at end of file +var _0xc659=['save','remove','update','emit','removeListener','register','voiceQueue:','./voiceQueue.events'];(function(_0x2781ae,_0x19a275){var _0x10e1b9=function(_0x15844d){while(--_0x15844d){_0x2781ae['push'](_0x2781ae['shift']());}};_0x10e1b9(++_0x19a275);}(_0xc659,0x12f));var _0x9c65=function(_0x2277ee,_0x21527f){_0x2277ee=_0x2277ee-0x0;var _0xdab647=_0xc659[_0x2277ee];return _0xdab647;};'use strict';var VoiceQueueEvents=require(_0x9c65('0x0'));var events=[_0x9c65('0x1'),_0x9c65('0x2'),_0x9c65('0x3')];function createListener(_0x4127d1,_0x40ac4d){return function(_0x343292){_0x40ac4d[_0x9c65('0x4')](_0x4127d1,_0x343292);};}function removeListener(_0x3aec5a,_0x30484a){return function(){VoiceQueueEvents[_0x9c65('0x5')](_0x3aec5a,_0x30484a);};}exports[_0x9c65('0x6')]=function(_0x34a28d){for(var _0x3b3077=0x0,_0x1e7ff8=events['length'];_0x3b3077<_0x1e7ff8;_0x3b3077++){var _0x3e1d04=events[_0x3b3077];var _0x41c2e5=createListener(_0x9c65('0x7')+_0x3e1d04,_0x34a28d);VoiceQueueEvents['on'](_0x3e1d04,_0x41c2e5);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 29e8a6c..6d2777e 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 _0x9206=['create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./voiceQueueReport.controller','index','/describe','isAuthenticated','describe','get','getVoiceQueuesReport','/:id','show','post'];(function(_0x220004,_0x305c5a){var _0x56566c=function(_0x28bc28){while(--_0x28bc28){_0x220004['push'](_0x220004['shift']());}};_0x56566c(++_0x305c5a);}(_0x9206,0x176));var _0x6920=function(_0x3aaaf6,_0xb4f9f1){_0x3aaaf6=_0x3aaaf6-0x0;var _0x33bc72=_0x9206[_0x3aaaf6];return _0x33bc72;};'use strict';var multer=require(_0x6920('0x0'));var util=require(_0x6920('0x1'));var path=require(_0x6920('0x2'));var timeout=require(_0x6920('0x3'));var express=require(_0x6920('0x4'));var router=express[_0x6920('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6920('0x6'));var controller=require(_0x6920('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x6920('0x8')]);router['get'](_0x6920('0x9'),auth[_0x6920('0xa')](),controller[_0x6920('0xb')]);router[_0x6920('0xc')]('/index',auth['isAuthenticated'](),controller[_0x6920('0xd')]);router[_0x6920('0xc')](_0x6920('0xe'),auth[_0x6920('0xa')](),controller[_0x6920('0xf')]);router[_0x6920('0x10')]('/',auth[_0x6920('0xa')](),controller[_0x6920('0x11')]);router[_0x6920('0x12')](_0x6920('0xe'),auth[_0x6920('0xa')](),controller[_0x6920('0x13')]);router[_0x6920('0x14')]('/:id',auth['isAuthenticated'](),controller[_0x6920('0x15')]);module[_0x6920('0x16')]=router; \ No newline at end of file +var _0x6363=['path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','isAuthenticated','index','/describe','getVoiceQueuesReport','/:id','show','post','create','delete','destroy','exports','multer'];(function(_0x4cd866,_0x398779){var _0x319b63=function(_0x4af986){while(--_0x4af986){_0x4cd866['push'](_0x4cd866['shift']());}};_0x319b63(++_0x398779);}(_0x6363,0x13a));var _0x3636=function(_0x40d7de,_0x144980){_0x40d7de=_0x40d7de-0x0;var _0xf30958=_0x6363[_0x40d7de];return _0xf30958;};'use strict';var multer=require(_0x3636('0x0'));var util=require('util');var path=require(_0x3636('0x1'));var timeout=require(_0x3636('0x2'));var express=require(_0x3636('0x3'));var router=express[_0x3636('0x4')]();var auth=require(_0x3636('0x5'));var interaction=require(_0x3636('0x6'));var config=require(_0x3636('0x7'));var controller=require(_0x3636('0x8'));router[_0x3636('0x9')]('/',auth[_0x3636('0xa')](),controller[_0x3636('0xb')]);router[_0x3636('0x9')](_0x3636('0xc'),auth[_0x3636('0xa')](),controller['describe']);router[_0x3636('0x9')]('/index',auth[_0x3636('0xa')](),controller[_0x3636('0xd')]);router[_0x3636('0x9')](_0x3636('0xe'),auth[_0x3636('0xa')](),controller[_0x3636('0xf')]);router[_0x3636('0x10')]('/',auth[_0x3636('0xa')](),controller[_0x3636('0x11')]);router['put']('/:id',auth[_0x3636('0xa')](),controller['update']);router[_0x3636('0x12')](_0x3636('0xe'),auth[_0x3636('0xa')](),controller[_0x3636('0x13')]);module[_0x3636('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index c61ae73..843dcf9 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 _0x9901=['BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','moment','STRING','DATE','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','setDataValue','queuecallerleaveAt','INTEGER'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9901,0x1bf));var _0x1990=function(_0xe3839f,_0x555463){_0xe3839f=_0xe3839f-0x0;var _0x43c987=_0x9901[_0xe3839f];return _0x43c987;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x1990('0x0'));module['exports']={'type':{'type':Sequelize[_0x1990('0x1')]},'uniqueid':{'type':Sequelize[_0x1990('0x1')]},'calleridnum':{'type':Sequelize[_0x1990('0x1')]},'calleridname':{'type':Sequelize[_0x1990('0x1')]},'queue':{'type':Sequelize['STRING']},'queuecallerjoinAt':{'type':Sequelize[_0x1990('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x5dfe3f){var _0x29a081=moment(_0x5dfe3f);var _0x55b044=moment(this['getDataValue'](_0x1990('0x3')))[_0x1990('0x4')](_0x1990('0x5'));var _0x53bc9f=_0x29a081['diff'](_0x55b044,'seconds');this[_0x1990('0x6')](_0x1990('0x7'),_0x5dfe3f);this[_0x1990('0x6')]('holdtime',_0x53bc9f||null);}},'position':{'type':Sequelize[_0x1990('0x8')]},'count':{'type':Sequelize[_0x1990('0x8')]},'queuecallerabandon':{'type':Sequelize[_0x1990('0x9')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0x1990('0x2')]},'queuecallercomplete':{'type':Sequelize[_0x1990('0x9')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x1990('0x2')]},'queuecallerexit':{'type':Sequelize[_0x1990('0x9')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0x1990('0x2')]},'queuecallerexitreason':{'type':Sequelize['STRING'],'comment':_0x1990('0xa')},'originalposition':{'type':Sequelize[_0x1990('0x8')]},'channel':{'type':Sequelize[_0x1990('0x1')]},'connectedlinenum':{'type':Sequelize[_0x1990('0x1')]},'connectedlinename':{'type':Sequelize[_0x1990('0x1')]},'accountcode':{'type':Sequelize[_0x1990('0x1')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x1990('0x1')]},'priority':{'type':Sequelize[_0x1990('0x1')]},'holdtime':{'type':Sequelize[_0x1990('0x8')]},'mohtime':{'type':Sequelize[_0x1990('0x8')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x1990('0x9')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x1990('0x1')]},'transfer':{'type':Sequelize[_0x1990('0x9')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x1990('0x1')],'comment':_0x1990('0xb')},'transferexten':{'type':Sequelize[_0x1990('0x1')]},'transferuniqueid':{'type':Sequelize[_0x1990('0x1')]},'disposition':{'type':Sequelize[_0x1990('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0x1990('0x8')],'defaultValue':0x0}}; \ No newline at end of file +var _0x7b9b=['YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format'];(function(_0x3116c0,_0x2a19d8){var _0x51c1db=function(_0x3dc935){while(--_0x3dc935){_0x3116c0['push'](_0x3116c0['shift']());}};_0x51c1db(++_0x2a19d8);}(_0x7b9b,0x72));var _0xb7b9=function(_0x439614,_0x4a3f3d){_0x439614=_0x439614-0x0;var _0x4a7560=_0x7b9b[_0x439614];return _0x4a7560;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0xb7b9('0x0')]={'type':{'type':Sequelize[_0xb7b9('0x1')]},'uniqueid':{'type':Sequelize[_0xb7b9('0x1')]},'calleridnum':{'type':Sequelize[_0xb7b9('0x1')]},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xb7b9('0x1')]},'queuecallerjoinAt':{'type':Sequelize[_0xb7b9('0x2')]},'queuecallerleaveAt':{'type':Sequelize['DATE'],'set':function(_0x46e726){var _0x394a57=moment(_0x46e726);var _0x4741cb=moment(this[_0xb7b9('0x3')](_0xb7b9('0x4')))[_0xb7b9('0x5')](_0xb7b9('0x6'));var _0x5f2ece=_0x394a57[_0xb7b9('0x7')](_0x4741cb,_0xb7b9('0x8'));this[_0xb7b9('0x9')](_0xb7b9('0xa'),_0x46e726);this[_0xb7b9('0x9')]('holdtime',_0x5f2ece||null);}},'position':{'type':Sequelize[_0xb7b9('0xb')]},'count':{'type':Sequelize[_0xb7b9('0xb')]},'queuecallerabandon':{'type':Sequelize[_0xb7b9('0xc')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb7b9('0x2')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0xb7b9('0x2')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize[_0xb7b9('0x2')]},'queuecallerexitreason':{'type':Sequelize[_0xb7b9('0x1')],'comment':_0xb7b9('0xd')},'originalposition':{'type':Sequelize[_0xb7b9('0xb')]},'channel':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb7b9('0x1')]},'accountcode':{'type':Sequelize[_0xb7b9('0x1')]},'context':{'type':Sequelize[_0xb7b9('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0xb7b9('0x1')]},'holdtime':{'type':Sequelize[_0xb7b9('0xb')]},'mohtime':{'type':Sequelize[_0xb7b9('0xb')],'defaultValue':0x0},'assigned':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0xb7b9('0x1')]},'transfer':{'type':Sequelize[_0xb7b9('0xc')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb7b9('0x1')],'comment':_0xb7b9('0xe')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0xb7b9('0x1')]},'disposition':{'type':Sequelize[_0xb7b9('0x1')]},'queuecallerenterreason':{'type':Sequelize[_0xb7b9('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 ab16408..1c9a903 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 _0x1967=['../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','end','status','json','count','offset','reject','save','update','then','destroy','name','index','VoiceQueueReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','create','body','params','describe','getVoiceQueuesReport','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x2be8c2,_0x14a4b5){var _0x97f531=function(_0xcee58d){while(--_0xcee58d){_0x2be8c2['push'](_0x2be8c2['shift']());}};_0x97f531(++_0x14a4b5);}(_0x1967,0x173));var _0x7196=function(_0x27f580,_0xf85ff6){_0x27f580=_0x27f580-0x0;var _0x15271b=_0x1967[_0x27f580];return _0x15271b;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7196('0x0'));var rimraf=require(_0x7196('0x1'));var zipdir=require(_0x7196('0x2'));var jsonpatch=require(_0x7196('0x3'));var rp=require(_0x7196('0x4'));var moment=require(_0x7196('0x5'));var BPromise=require(_0x7196('0x6'));var Mustache=require(_0x7196('0x7'));var util=require(_0x7196('0x8'));var path=require(_0x7196('0x9'));var sox=require('sox');var csv=require(_0x7196('0xa'));var ejs=require(_0x7196('0xb'));var fs=require('fs');var _=require(_0x7196('0xc'));var squel=require(_0x7196('0xd'));var crypto=require(_0x7196('0xe'));var jsforce=require(_0x7196('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x7196('0xa'));var querystring=require(_0x7196('0x10'));var Papa=require(_0x7196('0x11'));var Redis=require(_0x7196('0x12'));var authService=require(_0x7196('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7196('0x14'));var logger=require(_0x7196('0x15'))(_0x7196('0x16'));var utils=require(_0x7196('0x17'));var config=require(_0x7196('0x18'));var db=require(_0x7196('0x19'))['db'];config[_0x7196('0x1a')]=_[_0x7196('0x1b')](config[_0x7196('0x1a')],{'host':_0x7196('0x1c'),'port':0x18eb});var socket=require(_0x7196('0x1d'))(new Redis(config['redis']));require(_0x7196('0x1e'))[_0x7196('0x1f')](socket);function respondWithStatusCode(_0x3545aa,_0xf098c1){_0xf098c1=_0xf098c1||0xcc;return function(_0x511aa1){if(_0x511aa1){return _0x3545aa[_0x7196('0x20')](_0xf098c1);}return _0x3545aa['status'](_0xf098c1)[_0x7196('0x21')]();};}function respondWithResult(_0x2590a6,_0xf7e97){_0xf7e97=_0xf7e97||0xc8;return function(_0x3ed1ad){if(_0x3ed1ad){return _0x2590a6[_0x7196('0x22')](_0xf7e97)[_0x7196('0x23')](_0x3ed1ad);}};}function respondWithFilteredResult(_0x22bd62,_0x1ed296){return function(_0x3e4e69){if(_0x3e4e69){var _0x32fe2b=_0x3e4e69[_0x7196('0x24')],_0x385f2d=_0x1ed296[_0x7196('0x25')],_0x5b716a=_0x1ed296[_0x7196('0x25')]+_0x1ed296['limit'],_0x4c4f91;if(_0x5b716a>=_0x32fe2b){_0x5b716a=_0x32fe2b;_0x4c4f91=0xc8;}else{_0x4c4f91=0xce;}_0x22bd62[_0x7196('0x22')](_0x4c4f91);return _0x22bd62['set']('Content-Range',_0x385f2d+'-'+_0x5b716a+'/'+_0x32fe2b)[_0x7196('0x23')](_0x3e4e69);}return null;};}function patchUpdates(_0x627223){return function(_0x8dee9d){try{jsonpatch['apply'](_0x8dee9d,_0x627223,!![]);}catch(_0x57c390){return BPromise[_0x7196('0x26')](_0x57c390);}return _0x8dee9d[_0x7196('0x27')]();};}function saveUpdates(_0x598a26,_0x18649b){return function(_0x27ff84){if(_0x27ff84){return _0x27ff84[_0x7196('0x28')](_0x598a26)[_0x7196('0x29')](function(_0x38b3d6){return _0x38b3d6;});}return null;};}function removeEntity(_0x549f34,_0x3f8178){return function(_0x520d01){if(_0x520d01){return _0x520d01[_0x7196('0x2a')]()[_0x7196('0x29')](function(){_0x549f34[_0x7196('0x22')](0xcc)[_0x7196('0x21')]();});}};}function handleEntityNotFound(_0x70aa65,_0x43f6a2){return function(_0x530ab5){if(!_0x530ab5){_0x70aa65['sendStatus'](0x194);}return _0x530ab5;};}function handleError(_0x1482e5,_0x2d284f){_0x2d284f=_0x2d284f||0x1f4;return function(_0x184c09){logger['error'](_0x184c09['stack']);if(_0x184c09[_0x7196('0x2b')]){delete _0x184c09[_0x7196('0x2b')];}_0x1482e5[_0x7196('0x22')](_0x2d284f)['send'](_0x184c09);};}exports[_0x7196('0x2c')]=function(_0x4ecea1,_0x4fd339){var _0x59d79d={},_0x30151f={},_0x985727={'count':0x0,'rows':[]};var _0x1257ad=_['map'](db[_0x7196('0x2d')][_0x7196('0x2e')],function(_0x2f9583){return{'name':_0x2f9583[_0x7196('0x2f')],'type':_0x2f9583['type'][_0x7196('0x30')]};});_0x30151f[_0x7196('0x31')]=_[_0x7196('0x32')](_0x1257ad,_0x7196('0x2b'));_0x30151f[_0x7196('0x33')]=_[_0x7196('0x34')](_0x4ecea1[_0x7196('0x33')]);_0x30151f[_0x7196('0x35')]=_[_0x7196('0x36')](_0x30151f[_0x7196('0x31')],_0x30151f[_0x7196('0x33')]);_0x59d79d['attributes']=_[_0x7196('0x36')](_0x30151f['model'],qs[_0x7196('0x37')](_0x4ecea1['query'][_0x7196('0x37')]));_0x59d79d[_0x7196('0x38')]=_0x59d79d['attributes'][_0x7196('0x39')]?_0x59d79d[_0x7196('0x38')]:_0x30151f[_0x7196('0x31')];if(!_0x4ecea1[_0x7196('0x33')][_0x7196('0x3a')]('nolimit')){_0x59d79d[_0x7196('0x3b')]=qs[_0x7196('0x3b')](_0x4ecea1[_0x7196('0x33')][_0x7196('0x3b')]);_0x59d79d[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x4ecea1['query'][_0x7196('0x25')]);}_0x59d79d[_0x7196('0x3c')]=qs[_0x7196('0x3d')](_0x4ecea1['query'][_0x7196('0x3d')]);_0x59d79d[_0x7196('0x3e')]=qs[_0x7196('0x35')](_[_0x7196('0x3f')](_0x4ecea1[_0x7196('0x33')],_0x30151f[_0x7196('0x35')]));if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]){_0x59d79d[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x59d79d['where'],{'$or':_[_0x7196('0x32')](_0x1257ad,function(_0x17cefd){if(_0x17cefd['type']!==_0x7196('0x42')){var _0x54767f={};_0x54767f[_0x17cefd['name']]={'$like':'%'+_0x4ecea1[_0x7196('0x33')][_0x7196('0x40')]+'%'};return _0x54767f;}})});}_0x59d79d=_['merge']({},_0x59d79d,_0x4ecea1['options']);var _0x1bad95={'where':_0x59d79d[_0x7196('0x3e')]};return db[_0x7196('0x2d')]['count'](_0x1bad95)[_0x7196('0x29')](function(_0x2d13a5){_0x985727[_0x7196('0x24')]=_0x2d13a5;if(_0x4ecea1[_0x7196('0x33')][_0x7196('0x43')]){_0x59d79d[_0x7196('0x44')]=[{'all':!![]}];}return db[_0x7196('0x2d')][_0x7196('0x45')](_0x59d79d);})['then'](function(_0x89c8ea){_0x985727[_0x7196('0x46')]=_0x89c8ea;return _0x985727;})['then'](respondWithFilteredResult(_0x4fd339,_0x59d79d))[_0x7196('0x47')](handleError(_0x4fd339,null));};exports[_0x7196('0x48')]=function(_0x48178f,_0x471915){var _0x471bb2={'raw':![],'where':{'id':_0x48178f['params']['id']}},_0x3b78c8={};_0x3b78c8[_0x7196('0x31')]=_[_0x7196('0x34')](db['VoiceQueueReport'][_0x7196('0x2e')]);_0x3b78c8[_0x7196('0x33')]=_['keys'](_0x48178f[_0x7196('0x33')]);_0x3b78c8['filters']=_['intersection'](_0x3b78c8['model'],_0x3b78c8['query']);_0x471bb2['attributes']=_[_0x7196('0x36')](_0x3b78c8['model'],qs[_0x7196('0x37')](_0x48178f[_0x7196('0x33')][_0x7196('0x37')]));_0x471bb2[_0x7196('0x38')]=_0x471bb2['attributes'][_0x7196('0x39')]?_0x471bb2['attributes']:_0x3b78c8[_0x7196('0x31')];if(_0x48178f[_0x7196('0x33')][_0x7196('0x43')]){_0x471bb2['include']=[{'all':!![]}];}_0x471bb2=_[_0x7196('0x41')]({},_0x471bb2,_0x48178f[_0x7196('0x49')]);return db[_0x7196('0x2d')]['find'](_0x471bb2)['then'](handleEntityNotFound(_0x471915,null))[_0x7196('0x29')](respondWithResult(_0x471915,null))['catch'](handleError(_0x471915,null));};exports[_0x7196('0x4a')]=function(_0x582884,_0x53b4c7){return db[_0x7196('0x2d')]['create'](_0x582884['body'],{})['then'](respondWithResult(_0x53b4c7,0xc9))[_0x7196('0x47')](handleError(_0x53b4c7,null));};exports['update']=function(_0x48e3b5,_0x28591e){if(_0x48e3b5[_0x7196('0x4b')]['id']){delete _0x48e3b5[_0x7196('0x4b')]['id'];}return db[_0x7196('0x2d')]['find']({'where':{'id':_0x48e3b5[_0x7196('0x4c')]['id']}})['then'](handleEntityNotFound(_0x28591e,null))[_0x7196('0x29')](saveUpdates(_0x48e3b5[_0x7196('0x4b')],null))['then'](respondWithResult(_0x28591e,null))[_0x7196('0x47')](handleError(_0x28591e,null));};exports[_0x7196('0x2a')]=function(_0x3fe092,_0x4fa18f){return db[_0x7196('0x2d')]['find']({'where':{'id':_0x3fe092[_0x7196('0x4c')]['id']}})[_0x7196('0x29')](handleEntityNotFound(_0x4fa18f,null))[_0x7196('0x29')](removeEntity(_0x4fa18f,null))[_0x7196('0x47')](handleError(_0x4fa18f,null));};exports[_0x7196('0x4d')]=function(_0x19733a,_0x7e0d3){return db[_0x7196('0x2d')]['describe']()['then'](respondWithResult(_0x7e0d3,null))[_0x7196('0x47')](handleError(_0x7e0d3,null));};exports[_0x7196('0x4e')]=function(_0x40f820,_0xe4b032){var _0x4ebcd7={},_0x76b189={},_0x6948a={'count':0x0,'rows':[]};_0x76b189[_0x7196('0x31')]=_[_0x7196('0x34')](db[_0x7196('0x2d')][_0x7196('0x2e')]);_0x76b189[_0x7196('0x33')]=_[_0x7196('0x34')](_0x40f820[_0x7196('0x33')]);_0x76b189[_0x7196('0x35')]=_[_0x7196('0x36')](_0x76b189['model'],_0x76b189[_0x7196('0x33')]);_0x4ebcd7[_0x7196('0x38')]=_[_0x7196('0x36')](_0x76b189['model'],qs[_0x7196('0x37')](_0x40f820['query'][_0x7196('0x37')]));_0x4ebcd7[_0x7196('0x38')]=_0x4ebcd7[_0x7196('0x38')][_0x7196('0x39')]?_0x4ebcd7[_0x7196('0x38')]:_0x76b189['model'];if(!_0x40f820[_0x7196('0x33')]['hasOwnProperty']('nolimit')){_0x4ebcd7['limit']=qs[_0x7196('0x3b')](_0x40f820[_0x7196('0x33')][_0x7196('0x3b')]);_0x4ebcd7[_0x7196('0x25')]=qs[_0x7196('0x25')](_0x40f820[_0x7196('0x33')][_0x7196('0x25')]);}_0x4ebcd7['order']=qs[_0x7196('0x3d')](_0x40f820[_0x7196('0x33')][_0x7196('0x3d')]);_0x4ebcd7[_0x7196('0x3e')]=qs[_0x7196('0x35')](_['pick'](_0x40f820['query'],_0x76b189[_0x7196('0x35')]));if(_0x40f820[_0x7196('0x33')][_0x7196('0x40')]){_0x4ebcd7[_0x7196('0x3e')]=_[_0x7196('0x41')](_0x4ebcd7[_0x7196('0x3e')],{'$or':_[_0x7196('0x32')](_0x4ebcd7[_0x7196('0x38')],function(_0x13e9d0){var _0x2caadd={};_0x2caadd[_0x13e9d0]={'$like':'%'+_0x40f820[_0x7196('0x33')]['filter']+'%'};return _0x2caadd;})});}_0x4ebcd7=_[_0x7196('0x41')]({},_0x4ebcd7,_0x40f820[_0x7196('0x49')]);var _0x27d5d7={'where':_0x4ebcd7[_0x7196('0x3e')]};return db['VoiceQueueReport'][_0x7196('0x24')](_0x27d5d7)[_0x7196('0x29')](function(_0x1f3acc){_0x6948a[_0x7196('0x24')]=_0x1f3acc;if(_0x40f820[_0x7196('0x33')][_0x7196('0x43')]){_0x4ebcd7[_0x7196('0x44')]=[{'all':!![]}];}return db['VoiceQueueReport'][_0x7196('0x45')](_0x4ebcd7);})[_0x7196('0x29')](function(_0x40df9b){_0x6948a[_0x7196('0x46')]=_0x40df9b;return _0x6948a;})['then'](respondWithFilteredResult(_0xe4b032,_0x4ebcd7,_0x7196('0x4e')))[_0x7196('0x47')](handleError(_0xe4b032,null,_0x7196('0x4e')));}; \ No newline at end of file +var _0x1261=['includeAll','find','catch','create','body','describe','getVoiceQueuesReport','hasOwnProperty','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','json','offset','set','Content-Range','reject','save','update','destroy','then','end','error','name','index','map','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','length','nolimit','limit','order','sort','pick','filter','merge','where','type','options','VoiceQueueReport','count','include','findAll','rows','params'];(function(_0x215e84,_0x5df0b7){var _0x7f5b9=function(_0x2557c1){while(--_0x2557c1){_0x215e84['push'](_0x215e84['shift']());}};_0x7f5b9(++_0x5df0b7);}(_0x1261,0x144));var _0x1126=function(_0x132659,_0x486e0c){_0x132659=_0x132659-0x0;var _0x215fc3=_0x1261[_0x132659];return _0x215fc3;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1126('0x0'));var rimraf=require(_0x1126('0x1'));var zipdir=require(_0x1126('0x2'));var jsonpatch=require(_0x1126('0x3'));var rp=require(_0x1126('0x4'));var moment=require(_0x1126('0x5'));var BPromise=require(_0x1126('0x6'));var Mustache=require(_0x1126('0x7'));var util=require(_0x1126('0x8'));var path=require(_0x1126('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x1126('0xa'));var fs=require('fs');var _=require(_0x1126('0xb'));var squel=require('squel');var crypto=require(_0x1126('0xc'));var jsforce=require(_0x1126('0xd'));var deskjs=require(_0x1126('0xe'));var toCsv=require(_0x1126('0xf'));var querystring=require(_0x1126('0x10'));var Papa=require('papaparse');var Redis=require(_0x1126('0x11'));var authService=require(_0x1126('0x12'));var qs=require(_0x1126('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1126('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x1126('0x15'));var config=require('../../config/environment');var db=require(_0x1126('0x16'))['db'];config[_0x1126('0x17')]=_[_0x1126('0x18')](config[_0x1126('0x17')],{'host':_0x1126('0x19'),'port':0x18eb});var socket=require(_0x1126('0x1a'))(new Redis(config[_0x1126('0x17')]));require(_0x1126('0x1b'))[_0x1126('0x1c')](socket);function respondWithStatusCode(_0x53a8f0,_0x5de9a7){_0x5de9a7=_0x5de9a7||0xcc;return function(_0x1af673){if(_0x1af673){return _0x53a8f0[_0x1126('0x1d')](_0x5de9a7);}return _0x53a8f0[_0x1126('0x1e')](_0x5de9a7)['end']();};}function respondWithResult(_0x45149c,_0x4794a7){_0x4794a7=_0x4794a7||0xc8;return function(_0x35fe9f){if(_0x35fe9f){return _0x45149c[_0x1126('0x1e')](_0x4794a7)[_0x1126('0x1f')](_0x35fe9f);}};}function respondWithFilteredResult(_0x4e1c97,_0x245cd7){return function(_0x1695f6){if(_0x1695f6){var _0x4a7b49=_0x1695f6['count'],_0x4d2b38=_0x245cd7['offset'],_0x22ae0b=_0x245cd7[_0x1126('0x20')]+_0x245cd7['limit'],_0x2b2487;if(_0x22ae0b>=_0x4a7b49){_0x22ae0b=_0x4a7b49;_0x2b2487=0xc8;}else{_0x2b2487=0xce;}_0x4e1c97[_0x1126('0x1e')](_0x2b2487);return _0x4e1c97[_0x1126('0x21')](_0x1126('0x22'),_0x4d2b38+'-'+_0x22ae0b+'/'+_0x4a7b49)['json'](_0x1695f6);}return null;};}function patchUpdates(_0x2a08ba){return function(_0x49d209){try{jsonpatch['apply'](_0x49d209,_0x2a08ba,!![]);}catch(_0x30f6b3){return BPromise[_0x1126('0x23')](_0x30f6b3);}return _0x49d209[_0x1126('0x24')]();};}function saveUpdates(_0x36d254,_0x526ca1){return function(_0x29ab60){if(_0x29ab60){return _0x29ab60[_0x1126('0x25')](_0x36d254)['then'](function(_0x2175fa){return _0x2175fa;});}return null;};}function removeEntity(_0x59cd8e,_0x529dd9){return function(_0x4b57ab){if(_0x4b57ab){return _0x4b57ab[_0x1126('0x26')]()[_0x1126('0x27')](function(){_0x59cd8e[_0x1126('0x1e')](0xcc)[_0x1126('0x28')]();});}};}function handleEntityNotFound(_0x566c09,_0x1b07a7){return function(_0xea0971){if(!_0xea0971){_0x566c09[_0x1126('0x1d')](0x194);}return _0xea0971;};}function handleError(_0x589725,_0x35eec3){_0x35eec3=_0x35eec3||0x1f4;return function(_0x375e59){logger[_0x1126('0x29')](_0x375e59['stack']);if(_0x375e59['name']){delete _0x375e59[_0x1126('0x2a')];}_0x589725[_0x1126('0x1e')](_0x35eec3)['send'](_0x375e59);};}exports[_0x1126('0x2b')]=function(_0x23d2bc,_0x4a334a){var _0x3fa694={},_0x4bf807={},_0xc62460={'count':0x0,'rows':[]};var _0x4bd50b=_[_0x1126('0x2c')](db['VoiceQueueReport'][_0x1126('0x2d')],function(_0x5f2611){return{'name':_0x5f2611['fieldName'],'type':_0x5f2611['type'][_0x1126('0x2e')]};});_0x4bf807[_0x1126('0x2f')]=_[_0x1126('0x2c')](_0x4bd50b,'name');_0x4bf807[_0x1126('0x30')]=_[_0x1126('0x31')](_0x23d2bc['query']);_0x4bf807[_0x1126('0x32')]=_[_0x1126('0x33')](_0x4bf807[_0x1126('0x2f')],_0x4bf807[_0x1126('0x30')]);_0x3fa694['attributes']=_['intersection'](_0x4bf807[_0x1126('0x2f')],qs[_0x1126('0x34')](_0x23d2bc[_0x1126('0x30')][_0x1126('0x34')]));_0x3fa694['attributes']=_0x3fa694[_0x1126('0x35')][_0x1126('0x36')]?_0x3fa694[_0x1126('0x35')]:_0x4bf807[_0x1126('0x2f')];if(!_0x23d2bc[_0x1126('0x30')]['hasOwnProperty'](_0x1126('0x37'))){_0x3fa694[_0x1126('0x38')]=qs[_0x1126('0x38')](_0x23d2bc[_0x1126('0x30')]['limit']);_0x3fa694['offset']=qs[_0x1126('0x20')](_0x23d2bc[_0x1126('0x30')]['offset']);}_0x3fa694[_0x1126('0x39')]=qs[_0x1126('0x3a')](_0x23d2bc[_0x1126('0x30')]['sort']);_0x3fa694['where']=qs[_0x1126('0x32')](_[_0x1126('0x3b')](_0x23d2bc[_0x1126('0x30')],_0x4bf807[_0x1126('0x32')]));if(_0x23d2bc['query'][_0x1126('0x3c')]){_0x3fa694['where']=_[_0x1126('0x3d')](_0x3fa694[_0x1126('0x3e')],{'$or':_[_0x1126('0x2c')](_0x4bd50b,function(_0x1ea702){if(_0x1ea702[_0x1126('0x3f')]!=='VIRTUAL'){var _0x1da59f={};_0x1da59f[_0x1ea702[_0x1126('0x2a')]]={'$like':'%'+_0x23d2bc[_0x1126('0x30')][_0x1126('0x3c')]+'%'};return _0x1da59f;}})});}_0x3fa694=_[_0x1126('0x3d')]({},_0x3fa694,_0x23d2bc[_0x1126('0x40')]);var _0x3052f9={'where':_0x3fa694['where']};return db[_0x1126('0x41')][_0x1126('0x42')](_0x3052f9)[_0x1126('0x27')](function(_0xf3a0bd){_0xc62460[_0x1126('0x42')]=_0xf3a0bd;if(_0x23d2bc['query']['includeAll']){_0x3fa694[_0x1126('0x43')]=[{'all':!![]}];}return db[_0x1126('0x41')][_0x1126('0x44')](_0x3fa694);})[_0x1126('0x27')](function(_0x18b496){_0xc62460[_0x1126('0x45')]=_0x18b496;return _0xc62460;})['then'](respondWithFilteredResult(_0x4a334a,_0x3fa694))['catch'](handleError(_0x4a334a,null));};exports['show']=function(_0xb8054e,_0x5d4194){var _0xf84005={'raw':![],'where':{'id':_0xb8054e[_0x1126('0x46')]['id']}},_0x462da8={};_0x462da8[_0x1126('0x2f')]=_['keys'](db['VoiceQueueReport'][_0x1126('0x2d')]);_0x462da8[_0x1126('0x30')]=_[_0x1126('0x31')](_0xb8054e['query']);_0x462da8[_0x1126('0x32')]=_['intersection'](_0x462da8[_0x1126('0x2f')],_0x462da8['query']);_0xf84005[_0x1126('0x35')]=_[_0x1126('0x33')](_0x462da8[_0x1126('0x2f')],qs['fields'](_0xb8054e[_0x1126('0x30')][_0x1126('0x34')]));_0xf84005[_0x1126('0x35')]=_0xf84005['attributes']['length']?_0xf84005['attributes']:_0x462da8[_0x1126('0x2f')];if(_0xb8054e['query'][_0x1126('0x47')]){_0xf84005['include']=[{'all':!![]}];}_0xf84005=_[_0x1126('0x3d')]({},_0xf84005,_0xb8054e[_0x1126('0x40')]);return db[_0x1126('0x41')][_0x1126('0x48')](_0xf84005)[_0x1126('0x27')](handleEntityNotFound(_0x5d4194,null))['then'](respondWithResult(_0x5d4194,null))[_0x1126('0x49')](handleError(_0x5d4194,null));};exports[_0x1126('0x4a')]=function(_0x5111d3,_0x1a15f8){return db[_0x1126('0x41')]['create'](_0x5111d3[_0x1126('0x4b')],{})[_0x1126('0x27')](respondWithResult(_0x1a15f8,0xc9))['catch'](handleError(_0x1a15f8,null));};exports[_0x1126('0x25')]=function(_0xbdde58,_0x213a76){if(_0xbdde58['body']['id']){delete _0xbdde58[_0x1126('0x4b')]['id'];}return db[_0x1126('0x41')][_0x1126('0x48')]({'where':{'id':_0xbdde58[_0x1126('0x46')]['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x213a76,null))[_0x1126('0x27')](saveUpdates(_0xbdde58[_0x1126('0x4b')],null))[_0x1126('0x27')](respondWithResult(_0x213a76,null))['catch'](handleError(_0x213a76,null));};exports[_0x1126('0x26')]=function(_0x5a2287,_0x40168e){return db[_0x1126('0x41')]['find']({'where':{'id':_0x5a2287['params']['id']}})[_0x1126('0x27')](handleEntityNotFound(_0x40168e,null))[_0x1126('0x27')](removeEntity(_0x40168e,null))[_0x1126('0x49')](handleError(_0x40168e,null));};exports['describe']=function(_0x3cb44c,_0x3506d7){return db[_0x1126('0x41')][_0x1126('0x4c')]()['then'](respondWithResult(_0x3506d7,null))[_0x1126('0x49')](handleError(_0x3506d7,null));};exports[_0x1126('0x4d')]=function(_0x5c36b9,_0x4bcc08){var _0x4abb4d={},_0x526b07={},_0x386c10={'count':0x0,'rows':[]};_0x526b07[_0x1126('0x2f')]=_['keys'](db[_0x1126('0x41')][_0x1126('0x2d')]);_0x526b07[_0x1126('0x30')]=_[_0x1126('0x31')](_0x5c36b9[_0x1126('0x30')]);_0x526b07['filters']=_[_0x1126('0x33')](_0x526b07[_0x1126('0x2f')],_0x526b07['query']);_0x4abb4d[_0x1126('0x35')]=_[_0x1126('0x33')](_0x526b07[_0x1126('0x2f')],qs[_0x1126('0x34')](_0x5c36b9[_0x1126('0x30')]['fields']));_0x4abb4d[_0x1126('0x35')]=_0x4abb4d['attributes'][_0x1126('0x36')]?_0x4abb4d[_0x1126('0x35')]:_0x526b07[_0x1126('0x2f')];if(!_0x5c36b9['query'][_0x1126('0x4e')](_0x1126('0x37'))){_0x4abb4d['limit']=qs[_0x1126('0x38')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x38')]);_0x4abb4d['offset']=qs[_0x1126('0x20')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x20')]);}_0x4abb4d[_0x1126('0x39')]=qs[_0x1126('0x3a')](_0x5c36b9[_0x1126('0x30')][_0x1126('0x3a')]);_0x4abb4d[_0x1126('0x3e')]=qs['filters'](_[_0x1126('0x3b')](_0x5c36b9[_0x1126('0x30')],_0x526b07[_0x1126('0x32')]));if(_0x5c36b9[_0x1126('0x30')][_0x1126('0x3c')]){_0x4abb4d['where']=_[_0x1126('0x3d')](_0x4abb4d[_0x1126('0x3e')],{'$or':_['map'](_0x4abb4d[_0x1126('0x35')],function(_0x5246aa){var _0x272274={};_0x272274[_0x5246aa]={'$like':'%'+_0x5c36b9[_0x1126('0x30')]['filter']+'%'};return _0x272274;})});}_0x4abb4d=_[_0x1126('0x3d')]({},_0x4abb4d,_0x5c36b9[_0x1126('0x40')]);var _0x375b76={'where':_0x4abb4d['where']};return db[_0x1126('0x41')]['count'](_0x375b76)['then'](function(_0xbdc58){_0x386c10[_0x1126('0x42')]=_0xbdc58;if(_0x5c36b9[_0x1126('0x30')][_0x1126('0x47')]){_0x4abb4d[_0x1126('0x43')]=[{'all':!![]}];}return db[_0x1126('0x41')][_0x1126('0x44')](_0x4abb4d);})['then'](function(_0x191307){_0x386c10[_0x1126('0x45')]=_0x191307;return _0x386c10;})[_0x1126('0x27')](respondWithFilteredResult(_0x4bcc08,_0x4abb4d,_0x1126('0x4d')))[_0x1126('0x49')](handleError(_0x4bcc08,null,_0x1126('0x4d')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index 6d72e6c..d6d4d68 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 _0x1c9e=['hook','exports','../../mysqldb','VoiceQueueReport','save','update','remove','emit'];(function(_0x30f4ee,_0x142f19){var _0x1e6a16=function(_0x192907){while(--_0x192907){_0x30f4ee['push'](_0x30f4ee['shift']());}};_0x1e6a16(++_0x142f19);}(_0x1c9e,0xf2));var _0xe1c9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1c9e[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require('events');var VoiceQueueReport=require(_0xe1c9('0x0'))['db'][_0xe1c9('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe1c9('0x2'),'afterUpdate':_0xe1c9('0x3'),'afterDestroy':_0xe1c9('0x4')};function emitEvent(_0x5a7539){return function(_0x483bf9,_0x221027,_0x1e12f3){VoiceQueueReportEvents[_0xe1c9('0x5')](_0x5a7539+':'+_0x483bf9['id'],_0x483bf9);VoiceQueueReportEvents[_0xe1c9('0x5')](_0x5a7539,_0x483bf9);_0x1e12f3(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueueReport[_0xe1c9('0x6')](e,emitEvent(event));}}module[_0xe1c9('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x7610=['save','update','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoiceQueueReport','setMaxListeners'];(function(_0x31571e,_0x4ea2aa){var _0x1714a9=function(_0x1d44f8){while(--_0x1d44f8){_0x31571e['push'](_0x31571e['shift']());}};_0x1714a9(++_0x4ea2aa);}(_0x7610,0x1c8));var _0x0761=function(_0x5df877,_0x163ec8){_0x5df877=_0x5df877-0x0;var _0x4729a1=_0x7610[_0x5df877];return _0x4729a1;};'use strict';var EventEmitter=require(_0x0761('0x0'));var VoiceQueueReport=require(_0x0761('0x1'))['db'][_0x0761('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x0761('0x3')](0x0);var events={'afterCreate':_0x0761('0x4'),'afterUpdate':_0x0761('0x5'),'afterDestroy':_0x0761('0x6')};function emitEvent(_0x451f39){return function(_0x1a9a48,_0x114afd,_0x202ee1){VoiceQueueReportEvents['emit'](_0x451f39+':'+_0x1a9a48['id'],_0x1a9a48);VoiceQueueReportEvents[_0x0761('0x7')](_0x451f39,_0x1a9a48);_0x202ee1(null);};}for(var e in events){if(events[_0x0761('0x8')](e)){var event=events[e];VoiceQueueReport[_0x0761('0x9')](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 d451390..5b23232 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 _0x5f2f=['VoiceQueueReport','uniqueid','calleridnum','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','./voiceQueueReport.attributes','exports','define'];(function(_0x205eca,_0x138c20){var _0x193e81=function(_0x3e8c88){while(--_0x3e8c88){_0x205eca['push'](_0x205eca['shift']());}};_0x193e81(++_0x138c20);}(_0x5f2f,0x73));var _0xf5f2=function(_0xbe8994,_0x543cd7){_0xbe8994=_0xbe8994-0x0;var _0x1f2d34=_0x5f2f[_0xbe8994];return _0x1f2d34;};'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 fs=require('fs');var path=require(_0xf5f2('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xf5f2('0x8'));module[_0xf5f2('0x9')]=function(_0xad7f65,_0x3eebf6){return _0xad7f65[_0xf5f2('0xa')](_0xf5f2('0xb'),attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xf5f2('0xc')]},{'fields':[_0xf5f2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb28=['bluebird','request-promise','path','rimraf','../../config/environment','exports','VoiceQueueReport','report_queue','uniqueid','calleridnum','lodash','util','../../config/logger','api'];(function(_0x2b37aa,_0x1d40dc){var _0x52b73d=function(_0x5eb623){while(--_0x5eb623){_0x2b37aa['push'](_0x2b37aa['shift']());}};_0x52b73d(++_0x1d40dc);}(_0xdb28,0x106));var _0x8db2=function(_0x3c0fdc,_0x2bf256){_0x3c0fdc=_0x3c0fdc-0x0;var _0x5e25f7=_0xdb28[_0x3c0fdc];return _0x5e25f7;};'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 fs=require('fs');var path=require(_0x8db2('0x6'));var rimraf=require(_0x8db2('0x7'));var config=require(_0x8db2('0x8'));var attributes=require('./voiceQueueReport.attributes');module[_0x8db2('0x9')]=function(_0x1d2dd3,_0x5f42ee){return _0x1d2dd3['define'](_0x8db2('0xa'),attributes,{'tableName':_0x8db2('0xb'),'paranoid':![],'indexes':[{'fields':[_0x8db2('0xc')]},{'fields':[_0x8db2('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 697f3da..a3342de 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 _0xe1e8=['rpc','../../config/environment','jayson/promise','client','http','redis','defaults','./voiceQueueReport.socket','register','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','debug','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','include','model','map','CreateVoiceQueueReport','create','body','limit','UpdateVoiceQueueReport','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x370430,_0x1c0717){var _0x5984e9=function(_0x2aded8){while(--_0x2aded8){_0x370430['push'](_0x370430['shift']());}};_0x5984e9(++_0x1c0717);}(_0xe1e8,0x1d1));var _0x8e1e=function(_0x5a25ad,_0xdea601){_0x5a25ad=_0x5a25ad-0x0;var _0x524460=_0xe1e8[_0x5a25ad];return _0x524460;};'use strict';var _=require(_0x8e1e('0x0'));var util=require(_0x8e1e('0x1'));var moment=require('moment');var BPromise=require(_0x8e1e('0x2'));var rs=require(_0x8e1e('0x3'));var fs=require('fs');var Redis=require(_0x8e1e('0x4'));var db=require(_0x8e1e('0x5'))['db'];var utils=require(_0x8e1e('0x6'));var logger=require(_0x8e1e('0x7'))(_0x8e1e('0x8'));var config=require(_0x8e1e('0x9'));var jayson=require(_0x8e1e('0xa'));var client=jayson[_0x8e1e('0xb')][_0x8e1e('0xc')]({'port':0x232a});config[_0x8e1e('0xd')]=_[_0x8e1e('0xe')](config[_0x8e1e('0xd')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x8e1e('0xd')]));require(_0x8e1e('0xf'))[_0x8e1e('0x10')](socket);function respondWithRpcPromise(_0x29d612,_0x12f40d,_0x12fd6f){return new BPromise(function(_0x55c4fb,_0x14cd63){return client['request'](_0x29d612,_0x12fd6f)[_0x8e1e('0x11')](function(_0x9aa5e1){logger[_0x8e1e('0x12')](_0x8e1e('0x13'),_0x12f40d,_0x8e1e('0x14'));logger[_0x8e1e('0x15')](_0x8e1e('0x16'),_0x12f40d,_0x8e1e('0x14'),JSON[_0x8e1e('0x17')](_0x9aa5e1));if(_0x9aa5e1[_0x8e1e('0x18')]){if(_0x9aa5e1[_0x8e1e('0x18')][_0x8e1e('0x19')]===0x1f4){logger['error'](_0x8e1e('0x13'),_0x12f40d,_0x9aa5e1[_0x8e1e('0x18')]['message']);return _0x14cd63(_0x9aa5e1['error']['message']);}logger[_0x8e1e('0x18')]('VoiceQueueReport,\x20%s,\x20%s',_0x12f40d,_0x9aa5e1['error'][_0x8e1e('0x1a')]);return _0x55c4fb(_0x9aa5e1[_0x8e1e('0x18')]['message']);}else{logger[_0x8e1e('0x12')](_0x8e1e('0x13'),_0x12f40d,_0x8e1e('0x14'));_0x55c4fb(_0x9aa5e1[_0x8e1e('0x1b')][_0x8e1e('0x1a')]);}})[_0x8e1e('0x1c')](function(_0x47e2eb){logger[_0x8e1e('0x18')](_0x8e1e('0x13'),_0x12f40d,_0x47e2eb);_0x14cd63(_0x47e2eb);});});}exports[_0x8e1e('0x1d')]=function(_0x1fcce5){var _0x57d312=this;return new Promise(function(_0x4f8703,_0x5bdd6a){return db[_0x8e1e('0x1e')]['findAll']({'raw':_0x1fcce5['options']?_0x1fcce5[_0x8e1e('0x1f')][_0x8e1e('0x20')]===undefined?!![]:![]:!![],'where':_0x1fcce5[_0x8e1e('0x1f')]?_0x1fcce5[_0x8e1e('0x1f')][_0x8e1e('0x21')]||null:null,'attributes':_0x1fcce5[_0x8e1e('0x1f')]?_0x1fcce5[_0x8e1e('0x1f')][_0x8e1e('0x22')]||null:null,'limit':_0x1fcce5['options']?_0x1fcce5[_0x8e1e('0x1f')]['limit']||null:null,'include':_0x1fcce5['options']?_0x1fcce5[_0x8e1e('0x1f')][_0x8e1e('0x23')]?_['map'](_0x1fcce5[_0x8e1e('0x1f')][_0x8e1e('0x23')],function(_0x380bc1){return{'model':db[_0x380bc1[_0x8e1e('0x24')]],'as':_0x380bc1['as'],'attributes':_0x380bc1['attributes'],'include':_0x380bc1['include']?_['map'](_0x380bc1[_0x8e1e('0x23')],function(_0x6cbd95){return{'model':db[_0x6cbd95[_0x8e1e('0x24')]],'as':_0x6cbd95['as'],'attributes':_0x6cbd95[_0x8e1e('0x22')],'include':_0x6cbd95[_0x8e1e('0x23')]?_[_0x8e1e('0x25')](_0x6cbd95[_0x8e1e('0x23')],function(_0x1418ce){return{'model':db[_0x1418ce[_0x8e1e('0x24')]],'as':_0x1418ce['as'],'attributes':_0x1418ce['attributes']};}):[]};}):[]};}):[]:[]})[_0x8e1e('0x11')](function(_0x4a92f2){logger['info'](_0x8e1e('0x1d'),_0x1fcce5);logger[_0x8e1e('0x15')]('GetVoiceQueueReport',_0x1fcce5,JSON[_0x8e1e('0x17')](_0x4a92f2));_0x4f8703(_0x4a92f2);})[_0x8e1e('0x1c')](function(_0x361b1e){logger['error'](_0x8e1e('0x1d'),_0x361b1e[_0x8e1e('0x1a')],_0x1fcce5);_0x5bdd6a(_0x57d312['error'](0x1f4,_0x361b1e['message']));});});};exports[_0x8e1e('0x26')]=function(_0x191018){var _0x247076=this;return new Promise(function(_0x4f97d2,_0xf5e91){return db[_0x8e1e('0x1e')][_0x8e1e('0x27')](_0x191018[_0x8e1e('0x28')],{'raw':_0x191018[_0x8e1e('0x1f')]?_0x191018[_0x8e1e('0x1f')][_0x8e1e('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x13e60d){logger[_0x8e1e('0x12')](_0x8e1e('0x26'),_0x191018);logger[_0x8e1e('0x15')]('CreateVoiceQueueReport',_0x191018,JSON[_0x8e1e('0x17')](_0x13e60d));_0x4f97d2(_0x13e60d);})[_0x8e1e('0x1c')](function(_0x120b0b){logger[_0x8e1e('0x18')]('CreateVoiceQueueReport',_0x120b0b['message'],_0x191018);_0xf5e91(_0x247076[_0x8e1e('0x18')](0x1f4,_0x120b0b[_0x8e1e('0x1a')]));});});};exports['UpdateVoiceQueueReport']=function(_0x417f20){var _0x8c19d4=this;return new Promise(function(_0x6c35b9,_0x598e0b){return db[_0x8e1e('0x1e')]['update'](_0x417f20[_0x8e1e('0x28')],{'raw':_0x417f20[_0x8e1e('0x1f')]?_0x417f20[_0x8e1e('0x1f')][_0x8e1e('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x417f20['options']?_0x417f20['options']['where']||null:null,'attributes':_0x417f20['options']?_0x417f20[_0x8e1e('0x1f')][_0x8e1e('0x22')]||null:null,'limit':_0x417f20[_0x8e1e('0x1f')]?_0x417f20[_0x8e1e('0x1f')][_0x8e1e('0x29')]||null:null})[_0x8e1e('0x11')](function(_0xe1f470){logger[_0x8e1e('0x12')](_0x8e1e('0x2a'),_0x417f20);logger['debug']('UpdateVoiceQueueReport',_0x417f20,JSON[_0x8e1e('0x17')](_0xe1f470));_0x6c35b9(_0xe1f470);})[_0x8e1e('0x1c')](function(_0x5ec5c7){logger['error']('UpdateVoiceQueueReport',_0x5ec5c7['message'],_0x417f20);_0x598e0b(_0x8c19d4[_0x8e1e('0x18')](0x1f4,_0x5ec5c7['message']));});});}; \ No newline at end of file +var _0x14e8=['UpdateVoiceQueueReport','lodash','util','moment','bluebird','randomstring','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','findAll','options','raw','where','attributes','limit','include','map','model','debug','VoiceQueueReport','CreateVoiceQueueReport'];(function(_0x200815,_0x2e25eb){var _0x38c98b=function(_0x541c3e){while(--_0x541c3e){_0x200815['push'](_0x200815['shift']());}};_0x38c98b(++_0x2e25eb);}(_0x14e8,0x139));var _0x814e=function(_0x1646d3,_0x47fc3c){_0x1646d3=_0x1646d3-0x0;var _0x4d5d44=_0x14e8[_0x1646d3];return _0x4d5d44;};'use strict';var _=require(_0x814e('0x0'));var util=require(_0x814e('0x1'));var moment=require(_0x814e('0x2'));var BPromise=require(_0x814e('0x3'));var rs=require(_0x814e('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x814e('0x5'));var logger=require('../../config/logger')(_0x814e('0x6'));var config=require('../../config/environment');var jayson=require(_0x814e('0x7'));var client=jayson[_0x814e('0x8')][_0x814e('0x9')]({'port':0x232a});config[_0x814e('0xa')]=_['defaults'](config['redis'],{'host':_0x814e('0xb'),'port':0x18eb});var socket=require(_0x814e('0xc'))(new Redis(config[_0x814e('0xa')]));require(_0x814e('0xd'))['register'](socket);function respondWithRpcPromise(_0x20bf90,_0x2d1bf9,_0x185b98){return new BPromise(function(_0x3d3e77,_0x2919e3){return client['request'](_0x20bf90,_0x185b98)[_0x814e('0xe')](function(_0x2f10d9){logger[_0x814e('0xf')](_0x814e('0x10'),_0x2d1bf9,_0x814e('0x11'));logger['debug'](_0x814e('0x12'),_0x2d1bf9,_0x814e('0x11'),JSON[_0x814e('0x13')](_0x2f10d9));if(_0x2f10d9[_0x814e('0x14')]){if(_0x2f10d9['error'][_0x814e('0x15')]===0x1f4){logger['error']('VoiceQueueReport,\x20%s,\x20%s',_0x2d1bf9,_0x2f10d9[_0x814e('0x14')][_0x814e('0x16')]);return _0x2919e3(_0x2f10d9['error'][_0x814e('0x16')]);}logger[_0x814e('0x14')](_0x814e('0x10'),_0x2d1bf9,_0x2f10d9[_0x814e('0x14')][_0x814e('0x16')]);return _0x3d3e77(_0x2f10d9['error'][_0x814e('0x16')]);}else{logger[_0x814e('0xf')](_0x814e('0x10'),_0x2d1bf9,'request\x20sent');_0x3d3e77(_0x2f10d9[_0x814e('0x17')]['message']);}})[_0x814e('0x18')](function(_0xcbd599){logger[_0x814e('0x14')]('VoiceQueueReport,\x20%s,\x20%s',_0x2d1bf9,_0xcbd599);_0x2919e3(_0xcbd599);});});}exports[_0x814e('0x19')]=function(_0x2c6228){var _0xcd2b40=this;return new Promise(function(_0x37f428,_0x1ef5bc){return db['VoiceQueueReport'][_0x814e('0x1a')]({'raw':_0x2c6228['options']?_0x2c6228[_0x814e('0x1b')][_0x814e('0x1c')]===undefined?!![]:![]:!![],'where':_0x2c6228[_0x814e('0x1b')]?_0x2c6228['options'][_0x814e('0x1d')]||null:null,'attributes':_0x2c6228[_0x814e('0x1b')]?_0x2c6228[_0x814e('0x1b')][_0x814e('0x1e')]||null:null,'limit':_0x2c6228['options']?_0x2c6228[_0x814e('0x1b')][_0x814e('0x1f')]||null:null,'include':_0x2c6228[_0x814e('0x1b')]?_0x2c6228['options'][_0x814e('0x20')]?_[_0x814e('0x21')](_0x2c6228[_0x814e('0x1b')][_0x814e('0x20')],function(_0x882def){return{'model':db[_0x882def[_0x814e('0x22')]],'as':_0x882def['as'],'attributes':_0x882def[_0x814e('0x1e')],'include':_0x882def['include']?_['map'](_0x882def[_0x814e('0x20')],function(_0x51ea5c){return{'model':db[_0x51ea5c[_0x814e('0x22')]],'as':_0x51ea5c['as'],'attributes':_0x51ea5c['attributes'],'include':_0x51ea5c['include']?_[_0x814e('0x21')](_0x51ea5c['include'],function(_0x366052){return{'model':db[_0x366052[_0x814e('0x22')]],'as':_0x366052['as'],'attributes':_0x366052['attributes']};}):[]};}):[]};}):[]:[]})[_0x814e('0xe')](function(_0x165ccd){logger[_0x814e('0xf')]('GetVoiceQueueReport',_0x2c6228);logger[_0x814e('0x23')](_0x814e('0x19'),_0x2c6228,JSON[_0x814e('0x13')](_0x165ccd));_0x37f428(_0x165ccd);})['catch'](function(_0x275215){logger[_0x814e('0x14')](_0x814e('0x19'),_0x275215[_0x814e('0x16')],_0x2c6228);_0x1ef5bc(_0xcd2b40[_0x814e('0x14')](0x1f4,_0x275215[_0x814e('0x16')]));});});};exports['CreateVoiceQueueReport']=function(_0x390ab3){var _0x4f2eec=this;return new Promise(function(_0x33330f,_0x3eed96){return db[_0x814e('0x24')]['create'](_0x390ab3['body'],{'raw':_0x390ab3['options']?_0x390ab3[_0x814e('0x1b')][_0x814e('0x1c')]===undefined?!![]:![]:!![]})[_0x814e('0xe')](function(_0x581181){logger[_0x814e('0xf')]('CreateVoiceQueueReport',_0x390ab3);logger[_0x814e('0x23')]('CreateVoiceQueueReport',_0x390ab3,JSON[_0x814e('0x13')](_0x581181));_0x33330f(_0x581181);})['catch'](function(_0x3b88ed){logger[_0x814e('0x14')](_0x814e('0x25'),_0x3b88ed[_0x814e('0x16')],_0x390ab3);_0x3eed96(_0x4f2eec[_0x814e('0x14')](0x1f4,_0x3b88ed[_0x814e('0x16')]));});});};exports[_0x814e('0x26')]=function(_0x26133){var _0x49367d=this;return new Promise(function(_0x56498a,_0x1981f5){return db['VoiceQueueReport']['update'](_0x26133['body'],{'raw':_0x26133['options']?_0x26133[_0x814e('0x1b')][_0x814e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x26133[_0x814e('0x1b')]?_0x26133[_0x814e('0x1b')][_0x814e('0x1d')]||null:null,'attributes':_0x26133['options']?_0x26133['options'][_0x814e('0x1e')]||null:null,'limit':_0x26133[_0x814e('0x1b')]?_0x26133[_0x814e('0x1b')][_0x814e('0x1f')]||null:null})['then'](function(_0x373beb){logger[_0x814e('0xf')](_0x814e('0x26'),_0x26133);logger[_0x814e('0x23')](_0x814e('0x26'),_0x26133,JSON[_0x814e('0x13')](_0x373beb));_0x56498a(_0x373beb);})[_0x814e('0x18')](function(_0x27aec7){logger[_0x814e('0x14')]('UpdateVoiceQueueReport',_0x27aec7['message'],_0x26133);_0x1981f5(_0x49367d[_0x814e('0x14')](0x1f4,_0x27aec7[_0x814e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 103f96c..4ed5932 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 _0x9b5f=['register','length','voiceQueueReport:','./voiceQueueReport.events','remove','update','removeListener'];(function(_0x2e914,_0x1c7566){var _0x936e45=function(_0x1b22e4){while(--_0x1b22e4){_0x2e914['push'](_0x2e914['shift']());}};_0x936e45(++_0x1c7566);}(_0x9b5f,0x17d));var _0xf9b5=function(_0x1d7bc0,_0x50a455){_0x1d7bc0=_0x1d7bc0-0x0;var _0x15a179=_0x9b5f[_0x1d7bc0];return _0x15a179;};'use strict';var VoiceQueueReportEvents=require(_0xf9b5('0x0'));var events=['save',_0xf9b5('0x1'),_0xf9b5('0x2')];function createListener(_0x537700,_0x4d8b03){return function(_0x1ec446){_0x4d8b03['emit'](_0x537700,_0x1ec446);};}function removeListener(_0x106989,_0x1a28a0){return function(){VoiceQueueReportEvents[_0xf9b5('0x3')](_0x106989,_0x1a28a0);};}exports[_0xf9b5('0x4')]=function(_0x3e0086){for(var _0x8de528=0x0,_0x554aed=events[_0xf9b5('0x5')];_0x8de528<_0x554aed;_0x8de528++){var _0x5ac2a2=events[_0x8de528];var _0x17246e=createListener(_0xf9b5('0x6')+_0x5ac2a2,_0x3e0086);VoiceQueueReportEvents['on'](_0x5ac2a2,_0x17246e);}}; \ No newline at end of file +var _0xadb1=['register','length','voiceQueueReport:','./voiceQueueReport.events','save','remove','update','removeListener'];(function(_0x298ed3,_0x4ab5e1){var _0x5aad28=function(_0x168687){while(--_0x168687){_0x298ed3['push'](_0x298ed3['shift']());}};_0x5aad28(++_0x4ab5e1);}(_0xadb1,0x1bb));var _0x1adb=function(_0x42afd0,_0x3a4813){_0x42afd0=_0x42afd0-0x0;var _0x237f5a=_0xadb1[_0x42afd0];return _0x237f5a;};'use strict';var VoiceQueueReportEvents=require(_0x1adb('0x0'));var events=[_0x1adb('0x1'),_0x1adb('0x2'),_0x1adb('0x3')];function createListener(_0x3492ed,_0x555779){return function(_0x484bbc){_0x555779['emit'](_0x3492ed,_0x484bbc);};}function removeListener(_0x3141d7,_0x5ed0cb){return function(){VoiceQueueReportEvents[_0x1adb('0x4')](_0x3141d7,_0x5ed0cb);};}exports[_0x1adb('0x5')]=function(_0x182ef9){for(var _0x5f1209=0x0,_0x39c406=events[_0x1adb('0x6')];_0x5f1209<_0x39c406;_0x5f1209++){var _0x2a72aa=events[_0x5f1209];var _0xa92c40=createListener(_0x1adb('0x7')+_0x2a72aa,_0x182ef9);VoiceQueueReportEvents['on'](_0x2a72aa,_0xa92c40);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index 15dd983..195c50c 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 _0x1d13=['../../config/environment','get','isAuthenticated','show','post','put','/:id','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x1d13,0x1d5));var _0x31d1=function(_0x3c8760,_0xc2ba37){_0x3c8760=_0x3c8760-0x0;var _0xe64298=_0x1d13[_0x3c8760];return _0xe64298;};'use strict';var multer=require('multer');var util=require(_0x31d1('0x0'));var path=require(_0x31d1('0x1'));var timeout=require(_0x31d1('0x2'));var express=require(_0x31d1('0x3'));var router=express[_0x31d1('0x4')]();var auth=require(_0x31d1('0x5'));var interaction=require(_0x31d1('0x6'));var config=require(_0x31d1('0x7'));var controller=require('./voiceQueuesLog.controller');router[_0x31d1('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get']('/:id',auth[_0x31d1('0x9')](),controller[_0x31d1('0xa')]);router[_0x31d1('0xb')]('/',auth[_0x31d1('0x9')](),controller['create']);router[_0x31d1('0xc')](_0x31d1('0xd'),auth[_0x31d1('0x9')](),controller[_0x31d1('0xe')]);router['delete'](_0x31d1('0xd'),auth[_0x31d1('0x9')](),controller[_0x31d1('0xf')]);module[_0x31d1('0x10')]=router; \ No newline at end of file +var _0xefd6=['../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3294dd,_0x5217cb){var _0x4377f5=function(_0x6d3e39){while(--_0x6d3e39){_0x3294dd['push'](_0x3294dd['shift']());}};_0x4377f5(++_0x5217cb);}(_0xefd6,0x19d));var _0x6efd=function(_0x1ed0ac,_0x14d432){_0x1ed0ac=_0x1ed0ac-0x0;var _0x1e8e58=_0xefd6[_0x1ed0ac];return _0x1e8e58;};'use strict';var multer=require(_0x6efd('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x6efd('0x1'));var express=require(_0x6efd('0x2'));var router=express[_0x6efd('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x6efd('0x4'));var config=require(_0x6efd('0x5'));var controller=require(_0x6efd('0x6'));router[_0x6efd('0x7')]('/',auth[_0x6efd('0x8')](),controller[_0x6efd('0x9')]);router[_0x6efd('0x7')](_0x6efd('0xa'),auth[_0x6efd('0x8')](),controller[_0x6efd('0xb')]);router[_0x6efd('0xc')]('/',auth['isAuthenticated'](),controller[_0x6efd('0xd')]);router[_0x6efd('0xe')]('/:id',auth[_0x6efd('0x8')](),controller[_0x6efd('0xf')]);router[_0x6efd('0x10')](_0x6efd('0xa'),auth[_0x6efd('0x8')](),controller[_0x6efd('0x11')]);module[_0x6efd('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index b0663f9..3b07232 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 _0xf3ee=['STRING','format','YYYY-MM-DD\x20HH:mm:ss','sequelize','moment','exports'];(function(_0x53fe97,_0x544271){var _0x5c49a2=function(_0x3fa2b4){while(--_0x3fa2b4){_0x53fe97['push'](_0x53fe97['shift']());}};_0x5c49a2(++_0x544271);}(_0xf3ee,0x93));var _0xef3e=function(_0x49a19d,_0x532dec){_0x49a19d=_0x49a19d-0x0;var _0x35404f=_0xf3ee[_0x49a19d];return _0x35404f;};'use strict';var Sequelize=require(_0xef3e('0x0'));var moment=require(_0xef3e('0x1'));module[_0xef3e('0x2')]={'time':{'type':Sequelize[_0xef3e('0x3')]},'callid':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0xef3e('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':moment()[_0xef3e('0x4')](_0xef3e('0x5'))}}; \ No newline at end of file +var _0xc718=['YYYY-MM-DD\x20HH:mm:ss','moment','exports','STRING','DATE','format'];(function(_0x1352f0,_0x4cd565){var _0x1c2a82=function(_0x2a9b63){while(--_0x2a9b63){_0x1352f0['push'](_0x1352f0['shift']());}};_0x1c2a82(++_0x4cd565);}(_0xc718,0xcd));var _0x8c71=function(_0x4cb9db,_0x3cb338){_0x4cb9db=_0x4cb9db-0x0;var _0x547f94=_0xc718[_0x4cb9db];return _0x547f94;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x8c71('0x0'));module[_0x8c71('0x1')]={'time':{'type':Sequelize['STRING']},'callid':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x8c71('0x2')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x8c71('0x3')],'allowNull':![],'defaultValue':moment()[_0x8c71('0x4')](_0x8c71('0x5'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index 412c6fe..32b02fa 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 _0x1389=['../../config/utils','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','stack','name','send','map','VoiceQueuesLog','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','nolimit','limit','order','sort','where','merge','options','includeAll','include','rows','catch','show','create','body','find','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api'];(function(_0x288863,_0x5cac5a){var _0x31850c=function(_0x1c31b7){while(--_0x1c31b7){_0x288863['push'](_0x288863['shift']());}};_0x31850c(++_0x5cac5a);}(_0x1389,0x12c));var _0x9138=function(_0x58ac1f,_0x2bff55){_0x58ac1f=_0x58ac1f-0x0;var _0x5d4281=_0x1389[_0x58ac1f];return _0x5d4281;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x9138('0x0'));var zipdir=require(_0x9138('0x1'));var jsonpatch=require(_0x9138('0x2'));var rp=require(_0x9138('0x3'));var moment=require(_0x9138('0x4'));var BPromise=require(_0x9138('0x5'));var Mustache=require(_0x9138('0x6'));var util=require('util');var path=require('path');var sox=require(_0x9138('0x7'));var csv=require('to-csv');var ejs=require(_0x9138('0x8'));var fs=require('fs');var _=require(_0x9138('0x9'));var squel=require(_0x9138('0xa'));var crypto=require(_0x9138('0xb'));var jsforce=require(_0x9138('0xc'));var deskjs=require(_0x9138('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9138('0xe'));var Papa=require('papaparse');var Redis=require(_0x9138('0xf'));var authService=require(_0x9138('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9138('0x11'));var logger=require(_0x9138('0x12'))(_0x9138('0x13'));var utils=require(_0x9138('0x14'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2afb0d,_0x3e21e6){_0x3e21e6=_0x3e21e6||0xcc;return function(_0x1cb006){if(_0x1cb006){return _0x2afb0d[_0x9138('0x15')](_0x3e21e6);}return _0x2afb0d[_0x9138('0x16')](_0x3e21e6)[_0x9138('0x17')]();};}function respondWithResult(_0x7aaa83,_0x5c659d){_0x5c659d=_0x5c659d||0xc8;return function(_0x5e249c){if(_0x5e249c){return _0x7aaa83['status'](_0x5c659d)[_0x9138('0x18')](_0x5e249c);}};}function respondWithFilteredResult(_0x1917b3,_0x3c3dd0){return function(_0x13faf9){if(_0x13faf9){var _0x44043c=_0x13faf9[_0x9138('0x19')],_0x555aa9=_0x3c3dd0[_0x9138('0x1a')],_0x4e6868=_0x3c3dd0[_0x9138('0x1a')]+_0x3c3dd0['limit'],_0x4e7df2;if(_0x4e6868>=_0x44043c){_0x4e6868=_0x44043c;_0x4e7df2=0xc8;}else{_0x4e7df2=0xce;}_0x1917b3['status'](_0x4e7df2);return _0x1917b3['set'](_0x9138('0x1b'),_0x555aa9+'-'+_0x4e6868+'/'+_0x44043c)[_0x9138('0x18')](_0x13faf9);}return null;};}function patchUpdates(_0x8c1551){return function(_0x580ca5){try{jsonpatch[_0x9138('0x1c')](_0x580ca5,_0x8c1551,!![]);}catch(_0x4a6bc7){return BPromise[_0x9138('0x1d')](_0x4a6bc7);}return _0x580ca5[_0x9138('0x1e')]();};}function saveUpdates(_0x3d3891,_0x31a37d){return function(_0x2f69fc){if(_0x2f69fc){return _0x2f69fc[_0x9138('0x1f')](_0x3d3891)[_0x9138('0x20')](function(_0x2810a9){return _0x2810a9;});}return null;};}function removeEntity(_0x177f1a,_0x5c49fa){return function(_0x5bde27){if(_0x5bde27){return _0x5bde27['destroy']()['then'](function(){_0x177f1a['status'](0xcc)[_0x9138('0x17')]();});}};}function handleEntityNotFound(_0x56a01c,_0x33d4ff){return function(_0x50289b){if(!_0x50289b){_0x56a01c['sendStatus'](0x194);}return _0x50289b;};}function handleError(_0x4424ec,_0x5159ea){_0x5159ea=_0x5159ea||0x1f4;return function(_0xae8744){logger['error'](_0xae8744[_0x9138('0x21')]);if(_0xae8744[_0x9138('0x22')]){delete _0xae8744[_0x9138('0x22')];}_0x4424ec[_0x9138('0x16')](_0x5159ea)[_0x9138('0x23')](_0xae8744);};}exports['index']=function(_0x200857,_0x494c61){var _0x1ab83c={},_0x3c0802={},_0x71042b={'count':0x0,'rows':[]};var _0x22e74e=_[_0x9138('0x24')](db[_0x9138('0x25')][_0x9138('0x26')],function(_0x267e4b){return{'name':_0x267e4b[_0x9138('0x27')],'type':_0x267e4b[_0x9138('0x28')]['key']};});_0x3c0802[_0x9138('0x29')]=_[_0x9138('0x24')](_0x22e74e,_0x9138('0x22'));_0x3c0802[_0x9138('0x2a')]=_[_0x9138('0x2b')](_0x200857['query']);_0x3c0802[_0x9138('0x2c')]=_['intersection'](_0x3c0802[_0x9138('0x29')],_0x3c0802['query']);_0x1ab83c[_0x9138('0x2d')]=_[_0x9138('0x2e')](_0x3c0802[_0x9138('0x29')],qs[_0x9138('0x2f')](_0x200857[_0x9138('0x2a')][_0x9138('0x2f')]));_0x1ab83c[_0x9138('0x2d')]=_0x1ab83c[_0x9138('0x2d')]['length']?_0x1ab83c['attributes']:_0x3c0802['model'];if(!_0x200857[_0x9138('0x2a')]['hasOwnProperty'](_0x9138('0x30'))){_0x1ab83c[_0x9138('0x31')]=qs[_0x9138('0x31')](_0x200857[_0x9138('0x2a')]['limit']);_0x1ab83c[_0x9138('0x1a')]=qs['offset'](_0x200857[_0x9138('0x2a')][_0x9138('0x1a')]);}_0x1ab83c[_0x9138('0x32')]=qs[_0x9138('0x33')](_0x200857[_0x9138('0x2a')][_0x9138('0x33')]);_0x1ab83c[_0x9138('0x34')]=qs[_0x9138('0x2c')](_['pick'](_0x200857[_0x9138('0x2a')],_0x3c0802[_0x9138('0x2c')]));if(_0x200857['query']['filter']){_0x1ab83c['where']=_[_0x9138('0x35')](_0x1ab83c[_0x9138('0x34')],{'$or':_[_0x9138('0x24')](_0x22e74e,function(_0x3fa90a){if(_0x3fa90a[_0x9138('0x28')]!=='VIRTUAL'){var _0x441ac2={};_0x441ac2[_0x3fa90a[_0x9138('0x22')]]={'$like':'%'+_0x200857[_0x9138('0x2a')]['filter']+'%'};return _0x441ac2;}})});}_0x1ab83c=_['merge']({},_0x1ab83c,_0x200857[_0x9138('0x36')]);var _0x550bbd={'where':_0x1ab83c[_0x9138('0x34')]};return db[_0x9138('0x25')][_0x9138('0x19')](_0x550bbd)[_0x9138('0x20')](function(_0x9e88e4){_0x71042b[_0x9138('0x19')]=_0x9e88e4;if(_0x200857[_0x9138('0x2a')][_0x9138('0x37')]){_0x1ab83c[_0x9138('0x38')]=[{'all':!![]}];}return db[_0x9138('0x25')]['findAll'](_0x1ab83c);})[_0x9138('0x20')](function(_0x33b4e0){_0x71042b[_0x9138('0x39')]=_0x33b4e0;return _0x71042b;})[_0x9138('0x20')](respondWithFilteredResult(_0x494c61,_0x1ab83c))[_0x9138('0x3a')](handleError(_0x494c61,null));};exports[_0x9138('0x3b')]=function(_0x43436e,_0x4f0747){var _0x8777d2={'raw':!![],'where':{'id':_0x43436e['params']['id']}},_0xd60abc={};_0xd60abc['model']=_[_0x9138('0x2b')](db[_0x9138('0x25')][_0x9138('0x26')]);_0xd60abc['query']=_[_0x9138('0x2b')](_0x43436e[_0x9138('0x2a')]);_0xd60abc[_0x9138('0x2c')]=_[_0x9138('0x2e')](_0xd60abc[_0x9138('0x29')],_0xd60abc[_0x9138('0x2a')]);_0x8777d2[_0x9138('0x2d')]=_[_0x9138('0x2e')](_0xd60abc[_0x9138('0x29')],qs[_0x9138('0x2f')](_0x43436e['query']['fields']));_0x8777d2[_0x9138('0x2d')]=_0x8777d2[_0x9138('0x2d')]['length']?_0x8777d2[_0x9138('0x2d')]:_0xd60abc[_0x9138('0x29')];if(_0x43436e['query'][_0x9138('0x37')]){_0x8777d2[_0x9138('0x38')]=[{'all':!![]}];}_0x8777d2=_[_0x9138('0x35')]({},_0x8777d2,_0x43436e[_0x9138('0x36')]);return db[_0x9138('0x25')]['find'](_0x8777d2)['then'](handleEntityNotFound(_0x4f0747,null))[_0x9138('0x20')](respondWithResult(_0x4f0747,null))[_0x9138('0x3a')](handleError(_0x4f0747,null));};exports[_0x9138('0x3c')]=function(_0x5f90ed,_0x527c7c){return db['VoiceQueuesLog'][_0x9138('0x3c')](_0x5f90ed[_0x9138('0x3d')],{})[_0x9138('0x20')](respondWithResult(_0x527c7c,0xc9))[_0x9138('0x3a')](handleError(_0x527c7c,null));};exports['update']=function(_0x26fc7a,_0x4ea702){if(_0x26fc7a[_0x9138('0x3d')]['id']){delete _0x26fc7a[_0x9138('0x3d')]['id'];}return db[_0x9138('0x25')][_0x9138('0x3e')]({'where':{'id':_0x26fc7a['params']['id']}})[_0x9138('0x20')](handleEntityNotFound(_0x4ea702,null))['then'](saveUpdates(_0x26fc7a[_0x9138('0x3d')],null))[_0x9138('0x20')](respondWithResult(_0x4ea702,null))[_0x9138('0x3a')](handleError(_0x4ea702,null));};exports['destroy']=function(_0x3402b9,_0x36a1f1){return db[_0x9138('0x25')][_0x9138('0x3e')]({'where':{'id':_0x3402b9[_0x9138('0x3f')]['id']}})[_0x9138('0x20')](handleEntityNotFound(_0x36a1f1,null))[_0x9138('0x20')](removeEntity(_0x36a1f1,null))['catch'](handleError(_0x36a1f1,null));}; \ No newline at end of file +var _0xd821=['fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','save','update','destroy','end','stack','name','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','options','count','then','includeAll','include','findAll','catch','show','params','keys','intersection','find','create','body','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x367d0b,_0x54079c){var _0x3676d1=function(_0x339a89){while(--_0x339a89){_0x367d0b['push'](_0x367d0b['shift']());}};_0x3676d1(++_0x54079c);}(_0xd821,0x1b2));var _0x1d82=function(_0x5906c5,_0x1f143b){_0x5906c5=_0x5906c5-0x0;var _0x39b87e=_0xd821[_0x5906c5];return _0x39b87e;};'use strict';var pdf=require(_0x1d82('0x0'));var emlformat=require(_0x1d82('0x1'));var rimraf=require(_0x1d82('0x2'));var zipdir=require(_0x1d82('0x3'));var jsonpatch=require(_0x1d82('0x4'));var rp=require('request-promise');var moment=require(_0x1d82('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1d82('0x6'));var util=require(_0x1d82('0x7'));var path=require(_0x1d82('0x8'));var sox=require(_0x1d82('0x9'));var csv=require(_0x1d82('0xa'));var ejs=require(_0x1d82('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1d82('0xc'));var crypto=require(_0x1d82('0xd'));var jsforce=require(_0x1d82('0xe'));var deskjs=require(_0x1d82('0xf'));var toCsv=require(_0x1d82('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x1d82('0x10'));var authService=require(_0x1d82('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x1d82('0x12'));var hardwareService=require(_0x1d82('0x13'));var logger=require(_0x1d82('0x14'))(_0x1d82('0x15'));var utils=require(_0x1d82('0x16'));var config=require(_0x1d82('0x17'));var db=require(_0x1d82('0x18'))['db'];function respondWithStatusCode(_0x24cf0c,_0x19b1cf){_0x19b1cf=_0x19b1cf||0xcc;return function(_0x5ec255){if(_0x5ec255){return _0x24cf0c[_0x1d82('0x19')](_0x19b1cf);}return _0x24cf0c[_0x1d82('0x1a')](_0x19b1cf)['end']();};}function respondWithResult(_0xf996c7,_0x270a99){_0x270a99=_0x270a99||0xc8;return function(_0x44f808){if(_0x44f808){return _0xf996c7[_0x1d82('0x1a')](_0x270a99)[_0x1d82('0x1b')](_0x44f808);}};}function respondWithFilteredResult(_0x39a597,_0x4f9bc1){return function(_0xaa8ad){if(_0xaa8ad){var _0x5ae927=_0xaa8ad['count'],_0x437666=_0x4f9bc1[_0x1d82('0x1c')],_0xdd17f1=_0x4f9bc1[_0x1d82('0x1c')]+_0x4f9bc1[_0x1d82('0x1d')],_0xe6c844;if(_0xdd17f1>=_0x5ae927){_0xdd17f1=_0x5ae927;_0xe6c844=0xc8;}else{_0xe6c844=0xce;}_0x39a597[_0x1d82('0x1a')](_0xe6c844);return _0x39a597['set'](_0x1d82('0x1e'),_0x437666+'-'+_0xdd17f1+'/'+_0x5ae927)['json'](_0xaa8ad);}return null;};}function patchUpdates(_0xdacbfd){return function(_0x3793f4){try{jsonpatch[_0x1d82('0x1f')](_0x3793f4,_0xdacbfd,!![]);}catch(_0x56fe5a){return BPromise[_0x1d82('0x20')](_0x56fe5a);}return _0x3793f4[_0x1d82('0x21')]();};}function saveUpdates(_0x3ab56b,_0x505a83){return function(_0x48cb7d){if(_0x48cb7d){return _0x48cb7d[_0x1d82('0x22')](_0x3ab56b)['then'](function(_0x542be0){return _0x542be0;});}return null;};}function removeEntity(_0x4333ac,_0xed66cc){return function(_0x2613bc){if(_0x2613bc){return _0x2613bc[_0x1d82('0x23')]()['then'](function(){_0x4333ac[_0x1d82('0x1a')](0xcc)[_0x1d82('0x24')]();});}};}function handleEntityNotFound(_0x8dde42,_0x5b7d5f){return function(_0x10a7f0){if(!_0x10a7f0){_0x8dde42[_0x1d82('0x19')](0x194);}return _0x10a7f0;};}function handleError(_0x3aed54,_0x277737){_0x277737=_0x277737||0x1f4;return function(_0x969af3){logger['error'](_0x969af3[_0x1d82('0x25')]);if(_0x969af3[_0x1d82('0x26')]){delete _0x969af3['name'];}_0x3aed54[_0x1d82('0x1a')](_0x277737)['send'](_0x969af3);};}exports['index']=function(_0x293d03,_0xeda4c4){var _0x2cc2c6={},_0x501d2f={},_0x2ec818={'count':0x0,'rows':[]};var _0x52de10=_['map'](db[_0x1d82('0x27')][_0x1d82('0x28')],function(_0x41e6d3){return{'name':_0x41e6d3[_0x1d82('0x29')],'type':_0x41e6d3[_0x1d82('0x2a')][_0x1d82('0x2b')]};});_0x501d2f[_0x1d82('0x2c')]=_[_0x1d82('0x2d')](_0x52de10,_0x1d82('0x26'));_0x501d2f[_0x1d82('0x2e')]=_['keys'](_0x293d03[_0x1d82('0x2e')]);_0x501d2f['filters']=_['intersection'](_0x501d2f['model'],_0x501d2f[_0x1d82('0x2e')]);_0x2cc2c6[_0x1d82('0x2f')]=_['intersection'](_0x501d2f['model'],qs[_0x1d82('0x30')](_0x293d03[_0x1d82('0x2e')][_0x1d82('0x30')]));_0x2cc2c6[_0x1d82('0x2f')]=_0x2cc2c6[_0x1d82('0x2f')][_0x1d82('0x31')]?_0x2cc2c6[_0x1d82('0x2f')]:_0x501d2f[_0x1d82('0x2c')];if(!_0x293d03[_0x1d82('0x2e')][_0x1d82('0x32')](_0x1d82('0x33'))){_0x2cc2c6['limit']=qs[_0x1d82('0x1d')](_0x293d03[_0x1d82('0x2e')][_0x1d82('0x1d')]);_0x2cc2c6[_0x1d82('0x1c')]=qs[_0x1d82('0x1c')](_0x293d03['query'][_0x1d82('0x1c')]);}_0x2cc2c6[_0x1d82('0x34')]=qs[_0x1d82('0x35')](_0x293d03[_0x1d82('0x2e')]['sort']);_0x2cc2c6['where']=qs[_0x1d82('0x36')](_['pick'](_0x293d03[_0x1d82('0x2e')],_0x501d2f['filters']));if(_0x293d03['query'][_0x1d82('0x37')]){_0x2cc2c6[_0x1d82('0x38')]=_[_0x1d82('0x39')](_0x2cc2c6[_0x1d82('0x38')],{'$or':_[_0x1d82('0x2d')](_0x52de10,function(_0x71e0de){if(_0x71e0de['type']!==_0x1d82('0x3a')){var _0x4a7e0e={};_0x4a7e0e[_0x71e0de['name']]={'$like':'%'+_0x293d03[_0x1d82('0x2e')]['filter']+'%'};return _0x4a7e0e;}})});}_0x2cc2c6=_[_0x1d82('0x39')]({},_0x2cc2c6,_0x293d03[_0x1d82('0x3b')]);var _0x155d75={'where':_0x2cc2c6['where']};return db[_0x1d82('0x27')][_0x1d82('0x3c')](_0x155d75)[_0x1d82('0x3d')](function(_0x267e03){_0x2ec818['count']=_0x267e03;if(_0x293d03[_0x1d82('0x2e')][_0x1d82('0x3e')]){_0x2cc2c6[_0x1d82('0x3f')]=[{'all':!![]}];}return db[_0x1d82('0x27')][_0x1d82('0x40')](_0x2cc2c6);})[_0x1d82('0x3d')](function(_0x4d1a8e){_0x2ec818['rows']=_0x4d1a8e;return _0x2ec818;})[_0x1d82('0x3d')](respondWithFilteredResult(_0xeda4c4,_0x2cc2c6))[_0x1d82('0x41')](handleError(_0xeda4c4,null));};exports[_0x1d82('0x42')]=function(_0x58d726,_0x1ff72b){var _0x29cb51={'raw':!![],'where':{'id':_0x58d726[_0x1d82('0x43')]['id']}},_0x53482e={};_0x53482e[_0x1d82('0x2c')]=_[_0x1d82('0x44')](db[_0x1d82('0x27')][_0x1d82('0x28')]);_0x53482e[_0x1d82('0x2e')]=_['keys'](_0x58d726[_0x1d82('0x2e')]);_0x53482e['filters']=_[_0x1d82('0x45')](_0x53482e['model'],_0x53482e['query']);_0x29cb51[_0x1d82('0x2f')]=_[_0x1d82('0x45')](_0x53482e[_0x1d82('0x2c')],qs[_0x1d82('0x30')](_0x58d726[_0x1d82('0x2e')]['fields']));_0x29cb51['attributes']=_0x29cb51[_0x1d82('0x2f')][_0x1d82('0x31')]?_0x29cb51[_0x1d82('0x2f')]:_0x53482e[_0x1d82('0x2c')];if(_0x58d726[_0x1d82('0x2e')]['includeAll']){_0x29cb51[_0x1d82('0x3f')]=[{'all':!![]}];}_0x29cb51=_[_0x1d82('0x39')]({},_0x29cb51,_0x58d726[_0x1d82('0x3b')]);return db[_0x1d82('0x27')][_0x1d82('0x46')](_0x29cb51)['then'](handleEntityNotFound(_0x1ff72b,null))['then'](respondWithResult(_0x1ff72b,null))[_0x1d82('0x41')](handleError(_0x1ff72b,null));};exports[_0x1d82('0x47')]=function(_0x55c410,_0x341978){return db[_0x1d82('0x27')][_0x1d82('0x47')](_0x55c410[_0x1d82('0x48')],{})[_0x1d82('0x3d')](respondWithResult(_0x341978,0xc9))[_0x1d82('0x41')](handleError(_0x341978,null));};exports[_0x1d82('0x22')]=function(_0xe36de8,_0x2d0048){if(_0xe36de8['body']['id']){delete _0xe36de8['body']['id'];}return db[_0x1d82('0x27')][_0x1d82('0x46')]({'where':{'id':_0xe36de8[_0x1d82('0x43')]['id']}})[_0x1d82('0x3d')](handleEntityNotFound(_0x2d0048,null))[_0x1d82('0x3d')](saveUpdates(_0xe36de8[_0x1d82('0x48')],null))[_0x1d82('0x3d')](respondWithResult(_0x2d0048,null))[_0x1d82('0x41')](handleError(_0x2d0048,null));};exports[_0x1d82('0x23')]=function(_0x5b3ae7,_0x562803){return db[_0x1d82('0x27')][_0x1d82('0x46')]({'where':{'id':_0x5b3ae7[_0x1d82('0x43')]['id']}})[_0x1d82('0x3d')](handleEntityNotFound(_0x562803,null))[_0x1d82('0x3d')](removeEntity(_0x562803,null))[_0x1d82('0x41')](handleError(_0x562803,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index f86378c..708053b 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 _0x1383=['path','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x329210,_0xd6e939){var _0x1d9965=function(_0x27dd2d){while(--_0x27dd2d){_0x329210['push'](_0x329210['shift']());}};_0x1d9965(++_0xd6e939);}(_0x1383,0x129));var _0x3138=function(_0x113da3,_0x32c4d5){_0x113da3=_0x113da3-0x0;var _0x865deb=_0x1383[_0x113da3];return _0x865deb;};'use strict';var _=require(_0x3138('0x0'));var util=require(_0x3138('0x1'));var logger=require(_0x3138('0x2'))(_0x3138('0x3'));var moment=require(_0x3138('0x4'));var BPromise=require(_0x3138('0x5'));var rp=require(_0x3138('0x6'));var fs=require('fs');var path=require(_0x3138('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3138('0x8'));module[_0x3138('0x9')]=function(_0x2c1f14,_0xac3b37){return _0x2c1f14[_0x3138('0xa')](_0x3138('0xb'),attributes,{'tableName':_0x3138('0xc'),'paranoid':![],'indexes':[{'name':_0x3138('0xd'),'fields':[_0x3138('0xe'),_0x3138('0xf')]}],'timestamps':![]});}; \ No newline at end of file +var _0x405b=['../../config/environment','./voiceQueuesLog.attributes','exports','define','VoiceQueuesLog','voice_queues_log','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x1de3c6,_0x465b50){var _0xc22f2a=function(_0x1d62d4){while(--_0x1d62d4){_0x1de3c6['push'](_0x1de3c6['shift']());}};_0xc22f2a(++_0x465b50);}(_0x405b,0x108));var _0xb405=function(_0x4562db,_0x4e74b5){_0x4562db=_0x4562db-0x0;var _0x5033a3=_0x405b[_0x4562db];return _0x5033a3;};'use strict';var _=require(_0xb405('0x0'));var util=require(_0xb405('0x1'));var logger=require(_0xb405('0x2'))(_0xb405('0x3'));var moment=require(_0xb405('0x4'));var BPromise=require(_0xb405('0x5'));var rp=require(_0xb405('0x6'));var fs=require('fs');var path=require(_0xb405('0x7'));var rimraf=require('rimraf');var config=require(_0xb405('0x8'));var attributes=require(_0xb405('0x9'));module[_0xb405('0xa')]=function(_0x3adbca,_0x25432a){return _0x3adbca[_0xb405('0xb')](_0xb405('0xc'),attributes,{'tableName':_0xb405('0xd'),'paranoid':![],'indexes':[{'name':'event_dtm','fields':[_0xb405('0xe'),_0xb405('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index d44c124..b3ea233 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 _0xa74f=['result','catch','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','then','info','VoiceQueuesLog,\x20%s,\x20%s','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent'];(function(_0x45f6cb,_0x531af6){var _0x5b7f93=function(_0x1296ba){while(--_0x1296ba){_0x45f6cb['push'](_0x45f6cb['shift']());}};_0x5b7f93(++_0x531af6);}(_0xa74f,0x9a));var _0xfa74=function(_0x258919,_0x1754e6){_0x258919=_0x258919-0x0;var _0xfbd68b=_0xa74f[_0x258919];return _0xfbd68b;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfa74('0x0'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xfa74('0x1'));var db=require(_0xfa74('0x2'))['db'];var utils=require(_0xfa74('0x3'));var logger=require(_0xfa74('0x4'))('rpc');var config=require(_0xfa74('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfa74('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x9ddbd2,_0x3ac32e,_0x2d9fa9){return new BPromise(function(_0x287921,_0x344e04){return client['request'](_0x9ddbd2,_0x2d9fa9)[_0xfa74('0x7')](function(_0x37d4d8){logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,'request\x20sent');logger[_0xfa74('0xa')](_0xfa74('0xb'),_0x3ac32e,'request\x20sent',JSON[_0xfa74('0xc')](_0x37d4d8));if(_0x37d4d8[_0xfa74('0xd')]){if(_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xe')]===0x1f4){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x344e04(_0x37d4d8[_0xfa74('0xd')]['message']);}logger[_0xfa74('0xd')](_0xfa74('0x9'),_0x3ac32e,_0x37d4d8[_0xfa74('0xd')][_0xfa74('0xf')]);return _0x287921(_0x37d4d8[_0xfa74('0xd')]['message']);}else{logger[_0xfa74('0x8')](_0xfa74('0x9'),_0x3ac32e,_0xfa74('0x10'));_0x287921(_0x37d4d8[_0xfa74('0x11')][_0xfa74('0xf')]);}})[_0xfa74('0x12')](function(_0x3b9e32){logger['error'](_0xfa74('0x9'),_0x3ac32e,_0x3b9e32);_0x344e04(_0x3b9e32);});});} \ No newline at end of file +var _0x3495=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x375cf8,_0x4c91f1){var _0x20b0d8=function(_0x25af2f){while(--_0x25af2f){_0x375cf8['push'](_0x375cf8['shift']());}};_0x20b0d8(++_0x4c91f1);}(_0x3495,0x1de));var _0x5349=function(_0x33487b,_0x32cd2c){_0x33487b=_0x33487b-0x0;var _0x488d96=_0x3495[_0x33487b];return _0x488d96;};'use strict';var _=require(_0x5349('0x0'));var util=require(_0x5349('0x1'));var moment=require(_0x5349('0x2'));var BPromise=require(_0x5349('0x3'));var rs=require(_0x5349('0x4'));var fs=require('fs');var Redis=require(_0x5349('0x5'));var db=require(_0x5349('0x6'))['db'];var utils=require(_0x5349('0x7'));var logger=require(_0x5349('0x8'))('rpc');var config=require(_0x5349('0x9'));var jayson=require(_0x5349('0xa'));var client=jayson['client'][_0x5349('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x538385,_0x6fb5dc,_0x529323){return new BPromise(function(_0x393873,_0x583cee){return client[_0x5349('0xc')](_0x538385,_0x529323)[_0x5349('0xd')](function(_0x22a3d3){logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,_0x5349('0x10'));logger[_0x5349('0x11')]('VoiceQueuesLog,\x20%s,\x20%s,\x20%s',_0x6fb5dc,_0x5349('0x10'),JSON['stringify'](_0x22a3d3));if(_0x22a3d3[_0x5349('0x12')]){if(_0x22a3d3[_0x5349('0x12')][_0x5349('0x13')]===0x1f4){logger[_0x5349('0x12')](_0x5349('0xf'),_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x583cee(_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);}logger[_0x5349('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x6fb5dc,_0x22a3d3[_0x5349('0x12')][_0x5349('0x14')]);return _0x393873(_0x22a3d3['error'][_0x5349('0x14')]);}else{logger[_0x5349('0xe')](_0x5349('0xf'),_0x6fb5dc,'request\x20sent');_0x393873(_0x22a3d3['result']['message']);}})[_0x5349('0x15')](function(_0x5c873d){logger[_0x5349('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x6fb5dc,_0x5c873d);_0x583cee(_0x5c873d);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index 5608f85..5c9a26a 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 _0x1c89=['/:id/downloads','downloads','post','create','put','delete','destroy','exports','multer','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download'];(function(_0x2d8fc2,_0x1c461d){var _0x3a9e53=function(_0x18941c){while(--_0x18941c){_0x2d8fc2['push'](_0x2d8fc2['shift']());}};_0x3a9e53(++_0x1c461d);}(_0x1c89,0xce));var _0x91c8=function(_0x4b1b3a,_0x239438){_0x4b1b3a=_0x4b1b3a-0x0;var _0x203002=_0x1c89[_0x4b1b3a];return _0x203002;};'use strict';var multer=require(_0x91c8('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x91c8('0x1'));var express=require(_0x91c8('0x2'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x91c8('0x3'));var config=require(_0x91c8('0x4'));var controller=require('./voiceRecording.controller');router[_0x91c8('0x5')]('/',auth[_0x91c8('0x6')](),controller[_0x91c8('0x7')]);router[_0x91c8('0x5')](_0x91c8('0x8'),auth[_0x91c8('0x6')](),controller[_0x91c8('0x9')]);router[_0x91c8('0x5')](_0x91c8('0xa'),auth[_0x91c8('0x6')](),controller[_0x91c8('0xb')]);router['get'](_0x91c8('0xc'),auth[_0x91c8('0x6')](),controller[_0x91c8('0xd')]);router[_0x91c8('0x5')](_0x91c8('0xe'),controller[_0x91c8('0xf')]);router[_0x91c8('0x10')]('/',auth['isAuthenticated'](),controller[_0x91c8('0x11')]);router[_0x91c8('0x12')](_0x91c8('0xa'),auth[_0x91c8('0x6')](),controller['update']);router[_0x91c8('0x13')](_0x91c8('0xa'),auth['isAuthenticated'](),controller[_0x91c8('0x14')]);module[_0x91c8('0x15')]=router; \ No newline at end of file +var _0x351f=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','isAuthenticated','/describe','describe','/:id','show','/:id/download','download','/:id/downloads','downloads','put','update','destroy','exports','multer','util'];(function(_0x41342e,_0x427f74){var _0x5155e6=function(_0x3c953d){while(--_0x3c953d){_0x41342e['push'](_0x41342e['shift']());}};_0x5155e6(++_0x427f74);}(_0x351f,0x9f));var _0xf351=function(_0x464e74,_0x2081f9){_0x464e74=_0x464e74-0x0;var _0xdf0cac=_0x351f[_0x464e74];return _0xdf0cac;};'use strict';var multer=require(_0xf351('0x0'));var util=require(_0xf351('0x1'));var path=require(_0xf351('0x2'));var timeout=require(_0xf351('0x3'));var express=require(_0xf351('0x4'));var router=express['Router']();var auth=require(_0xf351('0x5'));var interaction=require(_0xf351('0x6'));var config=require(_0xf351('0x7'));var controller=require(_0xf351('0x8'));router[_0xf351('0x9')]('/',auth[_0xf351('0xa')](),controller['index']);router['get'](_0xf351('0xb'),auth[_0xf351('0xa')](),controller[_0xf351('0xc')]);router[_0xf351('0x9')](_0xf351('0xd'),auth[_0xf351('0xa')](),controller[_0xf351('0xe')]);router[_0xf351('0x9')](_0xf351('0xf'),auth[_0xf351('0xa')](),controller[_0xf351('0x10')]);router[_0xf351('0x9')](_0xf351('0x11'),controller[_0xf351('0x12')]);router['post']('/',auth[_0xf351('0xa')](),controller['create']);router[_0xf351('0x13')](_0xf351('0xd'),auth[_0xf351('0xa')](),controller[_0xf351('0x14')]);router['delete'](_0xf351('0xd'),auth[_0xf351('0xa')](),controller[_0xf351('0x15')]);module[_0xf351('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 619889e..7037385 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 _0xf8a0=['DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','updatedAt','sequelize','path','exports','VIRTUAL','getDataValue','value','extname','STRING','INTEGER'];(function(_0x439204,_0x402d9a){var _0x24bc7c=function(_0x3cc582){while(--_0x3cc582){_0x439204['push'](_0x439204['shift']());}};_0x24bc7c(++_0x402d9a);}(_0xf8a0,0x67));var _0x0f8a=function(_0x2aec52,_0x59d962){_0x2aec52=_0x2aec52-0x0;var _0x3b8835=_0xf8a0[_0x2aec52];return _0x3b8835;};'use strict';var Sequelize=require(_0x0f8a('0x0'));var moment=require('moment');var path=require(_0x0f8a('0x1'));module[_0x0f8a('0x2')]={'format':{'type':Sequelize[_0x0f8a('0x3')],'get':function(){return this[_0x0f8a('0x4')](_0x0f8a('0x5'))?path[_0x0f8a('0x6')](this[_0x0f8a('0x4')](_0x0f8a('0x5'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x0f8a('0x7')],'set':function(_0x141169){if(_0x141169){this['setDataValue']('channel',_0x141169);this['setDataValue']('membername',_0x141169['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x0f8a('0x7')]},'calleridnum':{'type':Sequelize[_0x0f8a('0x7')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0f8a('0x7')]},'connectedlinename':{'type':Sequelize[_0x0f8a('0x7')]},'accountcode':{'type':Sequelize[_0x0f8a('0x7')]},'context':{'type':Sequelize[_0x0f8a('0x7')]},'exten':{'type':Sequelize[_0x0f8a('0x7')]},'value':{'type':Sequelize[_0x0f8a('0x7')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x0f8a('0x8')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize[_0x0f8a('0x7')]},'createdAt':{'type':Sequelize[_0x0f8a('0x9')],'get':function(){return moment(this[_0x0f8a('0x4')](_0x0f8a('0xa')))[_0x0f8a('0xb')](_0x0f8a('0xc'))['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x0f8a('0x4')](_0x0f8a('0xd')))[_0x0f8a('0xb')]('MM-DD-YYYY\x20HH:mm')['toString']();}}}; \ No newline at end of file +var _0x6f8e=['MM-DD-YYYY\x20HH:mm','toString','format','moment','path','getDataValue','value','extname','STRING','setDataValue','INTEGER','DATE','createdAt'];(function(_0x2f5638,_0x3fd8e1){var _0x13ee84=function(_0x2c5cf4){while(--_0x2c5cf4){_0x2f5638['push'](_0x2f5638['shift']());}};_0x13ee84(++_0x3fd8e1);}(_0x6f8e,0x1d7));var _0xe6f8=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x6f8e[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xe6f8('0x0'));var path=require(_0xe6f8('0x1'));module['exports']={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xe6f8('0x2')](_0xe6f8('0x3'))?path[_0xe6f8('0x4')](this[_0xe6f8('0x2')](_0xe6f8('0x3'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0xe6f8('0x5')],'set':function(_0x442698){if(_0x442698){this[_0xe6f8('0x6')]('channel',_0x442698);this['setDataValue']('membername',_0x442698['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0xe6f8('0x5')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xe6f8('0x5')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xe6f8('0x5')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0xe6f8('0x5')]},'exten':{'type':Sequelize[_0xe6f8('0x5')]},'value':{'type':Sequelize[_0xe6f8('0x5')]},'type':{'type':Sequelize[_0xe6f8('0x5')]},'rating':{'type':Sequelize[_0xe6f8('0x7')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0xe6f8('0x5')]},'userDisposition':{'type':Sequelize['STRING']},'createdAt':{'type':Sequelize[_0xe6f8('0x8')],'get':function(){return moment(this['getDataValue'](_0xe6f8('0x9')))['format'](_0xe6f8('0xa'))[_0xe6f8('0xb')]();}},'updatedAt':{'type':Sequelize[_0xe6f8('0x8')],'get':function(){return moment(this[_0xe6f8('0x2')]('updatedAt'))[_0xe6f8('0xc')](_0xe6f8('0xa'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index c5b63a0..1f92e35 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 _0xc901=['params','includeAll','find','create','body','describe','download','../../components/encryptor','uniqueid','value','%s.cypher','existsSync','decryptFile','secrets','recording','ValidationError','filename','extname','unlink','message','VoiceRecording\x20not\x20found','Not\x20found','sequelize','col','push','$and','Sequelize','info','cancellazione\x20fisica\x20documento\x20%s','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','name','send','index','rawAttributes','type','key','differenceBy','map','format','keys','filters','intersection','query','model','fields','attributes','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','VoiceRecording','include','findAll','rows','catch'];(function(_0x47fa66,_0x4a1c39){var _0xee9da7=function(_0x159738){while(--_0x159738){_0x47fa66['push'](_0x47fa66['shift']());}};_0xee9da7(++_0x4a1c39);}(_0xc901,0x14d));var _0x1c90=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc901[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0x1c90('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x1c90('0x1'));var zipdir=require(_0x1c90('0x2'));var jsonpatch=require(_0x1c90('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1c90('0x4'));var Mustache=require(_0x1c90('0x5'));var util=require(_0x1c90('0x6'));var path=require('path');var sox=require(_0x1c90('0x7'));var csv=require(_0x1c90('0x8'));var ejs=require(_0x1c90('0x9'));var fs=require('fs');var _=require(_0x1c90('0xa'));var squel=require(_0x1c90('0xb'));var crypto=require(_0x1c90('0xc'));var jsforce=require(_0x1c90('0xd'));var deskjs=require(_0x1c90('0xe'));var toCsv=require(_0x1c90('0x8'));var querystring=require(_0x1c90('0xf'));var Papa=require('papaparse');var Redis=require(_0x1c90('0x10'));var authService=require(_0x1c90('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1c90('0x12'));var logger=require('../../config/logger')(_0x1c90('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x1c90('0x14'))['db'];function respondWithStatusCode(_0x54d0dd,_0x5a9f9e){_0x5a9f9e=_0x5a9f9e||0xcc;return function(_0x18add9){if(_0x18add9){return _0x54d0dd[_0x1c90('0x15')](_0x5a9f9e);}return _0x54d0dd[_0x1c90('0x16')](_0x5a9f9e)['end']();};}function respondWithResult(_0x1fdef4,_0x5ad6bf){_0x5ad6bf=_0x5ad6bf||0xc8;return function(_0x45f235){if(_0x45f235){return _0x1fdef4[_0x1c90('0x16')](_0x5ad6bf)[_0x1c90('0x17')](_0x45f235);}};}function respondWithFilteredResult(_0x40b31c,_0xbe68b){return function(_0x259f10){if(_0x259f10){var _0x400f1f=_0x259f10[_0x1c90('0x18')],_0x1bbb98=_0xbe68b[_0x1c90('0x19')],_0xb7a96c=_0xbe68b[_0x1c90('0x19')]+_0xbe68b[_0x1c90('0x1a')],_0x1a509c;if(_0xb7a96c>=_0x400f1f){_0xb7a96c=_0x400f1f;_0x1a509c=0xc8;}else{_0x1a509c=0xce;}_0x40b31c[_0x1c90('0x16')](_0x1a509c);return _0x40b31c[_0x1c90('0x1b')]('Content-Range',_0x1bbb98+'-'+_0xb7a96c+'/'+_0x400f1f)[_0x1c90('0x17')](_0x259f10);}return null;};}function patchUpdates(_0x4931b7){return function(_0x6be5f9){try{jsonpatch[_0x1c90('0x1c')](_0x6be5f9,_0x4931b7,!![]);}catch(_0x5f36c1){return BPromise[_0x1c90('0x1d')](_0x5f36c1);}return _0x6be5f9[_0x1c90('0x1e')]();};}function saveUpdates(_0x3d4959,_0x4f8490){return function(_0xea2f72){if(_0xea2f72){return _0xea2f72[_0x1c90('0x1f')](_0x3d4959)[_0x1c90('0x20')](function(_0x3954a8){return _0x3954a8;});}return null;};}function removeEntity(_0x1979cb,_0x3e7461){return function(_0x579d38){if(_0x579d38){return _0x579d38[_0x1c90('0x21')]()[_0x1c90('0x20')](function(){_0x1979cb[_0x1c90('0x16')](0xcc)[_0x1c90('0x22')]();});}};}function handleEntityNotFound(_0x9f902c,_0x5a9d91){return function(_0x30f27d){if(!_0x30f27d){_0x9f902c[_0x1c90('0x15')](0x194);}return _0x30f27d;};}function handleError(_0x395207,_0x1455a3){_0x1455a3=_0x1455a3||0x1f4;return function(_0x40423c){logger[_0x1c90('0x23')](_0x40423c['stack']);if(_0x40423c[_0x1c90('0x24')]){delete _0x40423c[_0x1c90('0x24')];}_0x395207[_0x1c90('0x16')](_0x1455a3)[_0x1c90('0x25')](_0x40423c);};}exports[_0x1c90('0x26')]=function(_0x142f66,_0x2c600e){var _0x2722dc={},_0x4c9b50={},_0x265243={'count':0x0,'rows':[]};var _0x2f9998=_['map'](db['VoiceRecording'][_0x1c90('0x27')],function(_0x15e229){return{'name':_0x15e229['fieldName'],'type':_0x15e229[_0x1c90('0x28')][_0x1c90('0x29')]};});_0x4c9b50['model']=_[_0x1c90('0x2a')](_[_0x1c90('0x2b')](_0x2f9998,_0x1c90('0x24')),[_0x1c90('0x2c')]);_0x4c9b50['query']=_[_0x1c90('0x2d')](_0x142f66['query']);_0x4c9b50[_0x1c90('0x2e')]=_[_0x1c90('0x2f')](_0x4c9b50['model'],_0x4c9b50[_0x1c90('0x30')]);_0x2722dc['attributes']=_[_0x1c90('0x2f')](_0x4c9b50[_0x1c90('0x31')],qs[_0x1c90('0x32')](_0x142f66[_0x1c90('0x30')][_0x1c90('0x32')]));_0x2722dc['attributes']=_0x2722dc[_0x1c90('0x33')][_0x1c90('0x34')]?_0x2722dc[_0x1c90('0x33')]:_0x4c9b50[_0x1c90('0x31')];if(!_0x142f66[_0x1c90('0x30')][_0x1c90('0x35')](_0x1c90('0x36'))){_0x2722dc[_0x1c90('0x1a')]=qs[_0x1c90('0x1a')](_0x142f66['query'][_0x1c90('0x1a')]);_0x2722dc['offset']=qs[_0x1c90('0x19')](_0x142f66['query'][_0x1c90('0x19')]);}_0x2722dc['order']=qs[_0x1c90('0x37')](_0x142f66['query'][_0x1c90('0x37')]);_0x2722dc[_0x1c90('0x38')]=qs['filters'](_[_0x1c90('0x39')](_0x142f66[_0x1c90('0x30')],_0x4c9b50[_0x1c90('0x2e')]));if(_0x142f66[_0x1c90('0x30')][_0x1c90('0x3a')]){_0x2722dc[_0x1c90('0x38')]=_[_0x1c90('0x3b')](_0x2722dc[_0x1c90('0x38')],{'$or':_[_0x1c90('0x2b')](_0x2f9998,function(_0x248d15){if(_0x248d15[_0x1c90('0x28')]!==_0x1c90('0x3c')){var _0x1d5ddb={};_0x1d5ddb[_0x248d15[_0x1c90('0x24')]]={'$like':'%'+_0x142f66[_0x1c90('0x30')][_0x1c90('0x3a')]+'%'};return _0x1d5ddb;}})});}_0x2722dc=_[_0x1c90('0x3b')]({},_0x2722dc,_0x142f66[_0x1c90('0x3d')]);var _0x189ba2={'where':_0x2722dc['where']};return db[_0x1c90('0x3e')][_0x1c90('0x18')](_0x189ba2)[_0x1c90('0x20')](function(_0x4f5ca0){_0x265243[_0x1c90('0x18')]=_0x4f5ca0;if(_0x142f66[_0x1c90('0x30')]['includeAll']){_0x2722dc[_0x1c90('0x3f')]=[{'all':!![]}];}return db[_0x1c90('0x3e')][_0x1c90('0x40')](_0x2722dc);})[_0x1c90('0x20')](function(_0x3d28c2){_0x265243[_0x1c90('0x41')]=_0x3d28c2;return _0x265243;})[_0x1c90('0x20')](respondWithFilteredResult(_0x2c600e,_0x2722dc))[_0x1c90('0x42')](handleError(_0x2c600e,null));};exports['show']=function(_0x2e2774,_0x3a3ab2){var _0x3c9bbd={'raw':![],'where':{'id':_0x2e2774[_0x1c90('0x43')]['id']}},_0x5bf8e6={};_0x5bf8e6[_0x1c90('0x31')]=_[_0x1c90('0x2d')](db[_0x1c90('0x3e')]['rawAttributes']);_0x5bf8e6['query']=_['keys'](_0x2e2774[_0x1c90('0x30')]);_0x5bf8e6['filters']=_[_0x1c90('0x2f')](_0x5bf8e6['model'],_0x5bf8e6[_0x1c90('0x30')]);_0x3c9bbd['attributes']=_[_0x1c90('0x2f')](_0x5bf8e6[_0x1c90('0x31')],qs['fields'](_0x2e2774[_0x1c90('0x30')][_0x1c90('0x32')]));_0x3c9bbd[_0x1c90('0x33')]=_0x3c9bbd[_0x1c90('0x33')][_0x1c90('0x34')]?_0x3c9bbd[_0x1c90('0x33')]:_0x5bf8e6[_0x1c90('0x31')];if(_0x2e2774[_0x1c90('0x30')][_0x1c90('0x44')]){_0x3c9bbd[_0x1c90('0x3f')]=[{'all':!![]}];}_0x3c9bbd=_[_0x1c90('0x3b')]({},_0x3c9bbd,_0x2e2774[_0x1c90('0x3d')]);return db['VoiceRecording'][_0x1c90('0x45')](_0x3c9bbd)['then'](handleEntityNotFound(_0x3a3ab2,null))[_0x1c90('0x20')](respondWithResult(_0x3a3ab2,null))[_0x1c90('0x42')](handleError(_0x3a3ab2,null));};exports[_0x1c90('0x46')]=function(_0x3d34c5,_0x377abf){return db[_0x1c90('0x3e')][_0x1c90('0x46')](_0x3d34c5[_0x1c90('0x47')],{})[_0x1c90('0x20')](respondWithResult(_0x377abf,0xc9))[_0x1c90('0x42')](handleError(_0x377abf,null));};exports[_0x1c90('0x1f')]=function(_0x49526a,_0x236c71){if(_0x49526a[_0x1c90('0x47')]['id']){delete _0x49526a[_0x1c90('0x47')]['id'];}return db[_0x1c90('0x3e')][_0x1c90('0x45')]({'where':{'id':_0x49526a['params']['id']}})['then'](handleEntityNotFound(_0x236c71,null))['then'](saveUpdates(_0x49526a['body'],null))[_0x1c90('0x20')](respondWithResult(_0x236c71,null))[_0x1c90('0x42')](handleError(_0x236c71,null));};exports[_0x1c90('0x48')]=function(_0x32e0db,_0x2ed95e){return db['VoiceRecording'][_0x1c90('0x48')]()[_0x1c90('0x20')](respondWithResult(_0x2ed95e,null))[_0x1c90('0x42')](handleError(_0x2ed95e,null));};exports[_0x1c90('0x49')]=function(_0xf001c6,_0x6a8db9,_0x3558e1){var _0x457ba6=require(_0x1c90('0x4a'));var _0x491b3a=![];var _0x3f44b6={};if(_0xf001c6[_0x1c90('0x30')][_0x1c90('0x28')]&&_0xf001c6[_0x1c90('0x30')][_0x1c90('0x28')]===_0x1c90('0x4b')){_0x3f44b6[_0x1c90('0x4b')]=_0xf001c6['params']['id'];}else{_0x3f44b6['id']=_0xf001c6['params']['id'];}return db[_0x1c90('0x3e')]['find']({'where':_0x3f44b6,'attributes':['id',_0x1c90('0x4c')],'raw':!![]})[_0x1c90('0x20')](handleEntityNotFound(_0x6a8db9,null))[_0x1c90('0x20')](function(_0x5016af){if(_0x5016af){var _0x1061f2=_0x5016af[_0x1c90('0x4c')];var _0x5cee04=util[_0x1c90('0x2c')](_0x1c90('0x4d'),_0x1061f2);if(fs[_0x1c90('0x4e')](_0x5cee04)){_0x491b3a=!![];return _0x457ba6[_0x1c90('0x4f')](_0x5cee04,_0x1061f2,config[_0x1c90('0x50')][_0x1c90('0x51')])[_0x1c90('0x20')](function(){return _0x5016af;});}return _0x5016af;}})[_0x1c90('0x20')](function(_0x5b8876){if(_0x5b8876){var _0x30d8a2=_0x5b8876[_0x1c90('0x4c')];if(!fs[_0x1c90('0x4e')](_0x30d8a2)){throw new db['Sequelize'][(_0x1c90('0x52'))]('VoiceRecording\x20not\x20found');}if(_0x5b8876[_0x1c90('0x53')]){return _0x6a8db9[_0x1c90('0x49')](_0x30d8a2,_0x5b8876[_0x1c90('0x53')]+path[_0x1c90('0x54')](_0x30d8a2),function(){if(_0x491b3a){fs[_0x1c90('0x55')](_0x30d8a2);}});}else{return _0x6a8db9['download'](_0x30d8a2,function(_0x4c5bf5){if(_0x491b3a){fs[_0x1c90('0x55')](_0x30d8a2);}});}}})['catch'](function(_0x55dd3a){if(_0x55dd3a[_0x1c90('0x56')]===_0x1c90('0x57')){_0x6a8db9[_0x1c90('0x16')](0x194)['send'](_0x1c90('0x58'));}else{return handleError(_0x6a8db9,null);}});};exports['downloads']=function(_0x1f7bee,_0x2961e9,_0x3aa8e0){var _0x45171b=require('../../components/encryptor');var _0x53f719=![];var _0x1ed0f5={'$and':[db[_0x1c90('0x59')][_0x1c90('0x38')](db[_0x1c90('0x59')]['fn']('MD5',db[_0x1c90('0x59')][_0x1c90('0x5a')](_0x1c90('0x4b'))),_0x1f7bee['query']['token'])]};if(_0x1f7bee[_0x1c90('0x30')]['type']&&_0x1f7bee[_0x1c90('0x30')][_0x1c90('0x28')]===_0x1c90('0x4b')){_0x1ed0f5['$and'][_0x1c90('0x5b')]({'uniqueid':_0x1f7bee[_0x1c90('0x43')]['id']});}else{_0x1ed0f5[_0x1c90('0x5c')][_0x1c90('0x5b')]({'id':_0x1f7bee[_0x1c90('0x43')]['id']});}return db[_0x1c90('0x3e')][_0x1c90('0x45')]({'where':_0x1ed0f5,'attributes':['id',_0x1c90('0x4c')],'raw':!![]})[_0x1c90('0x20')](handleEntityNotFound(_0x2961e9,null))[_0x1c90('0x20')](function(_0xddc41d){if(_0xddc41d){var _0x466ec1=util[_0x1c90('0x2c')](_0x1c90('0x4d'),_0xddc41d[_0x1c90('0x4c')]);if(fs[_0x1c90('0x4e')](_0x466ec1)){_0x53f719=!![];return _0x45171b[_0x1c90('0x4f')](_0x466ec1,_0xddc41d[_0x1c90('0x4c')],config[_0x1c90('0x50')][_0x1c90('0x51')])[_0x1c90('0x20')](function(){return _0xddc41d;});}return _0xddc41d;}})['then'](function(_0x575c97){if(_0x575c97){if(!fs[_0x1c90('0x4e')](_0x575c97[_0x1c90('0x4c')])){throw new db[(_0x1c90('0x5d'))][(_0x1c90('0x52'))](_0x1c90('0x57'));}if(_0x575c97[_0x1c90('0x53')]){return _0x2961e9[_0x1c90('0x49')](_0x575c97[_0x1c90('0x4c')],_0x575c97['filename']+path[_0x1c90('0x54')](_0x575c97['value']),function(){if(_0x53f719){fs[_0x1c90('0x55')](_0x575c97[_0x1c90('0x4c')]);}});}else{return _0x2961e9[_0x1c90('0x49')](_0x575c97[_0x1c90('0x4c')],function(_0x80181d){if(_0x53f719){fs[_0x1c90('0x55')](_0x575c97['value']);}});}}})['catch'](handleError(_0x2961e9,null));};exports['destroy']=function(_0x382996,_0x59fef3){return db[_0x1c90('0x3e')][_0x1c90('0x45')]({'where':{'id':_0x382996['params']['id']}})['then'](function(_0x541bfc){if(!_0x541bfc)throw new ReferenceError('Entity\x20not\x20found');return _0x541bfc;})[_0x1c90('0x20')](function(_0x3c3ba4){var _0x3dae85=_0x3c3ba4[_0x1c90('0x4c')];logger[_0x1c90('0x5e')](_0x1c90('0x5f'),_0x3dae85);if(!_['isNil'](_0x3c3ba4[_0x1c90('0x4c')])&&fs['existsSync'](_0x3dae85)){logger['info'](_0x1c90('0x60')+_0x3dae85+_0x1c90('0x61'));fs[_0x1c90('0x62')](_0x3dae85);}_0x3dae85=_0x3dae85+_0x1c90('0x63');if(!_['isNil'](_0x3c3ba4[_0x1c90('0x4c')])&&fs[_0x1c90('0x4e')](_0x3dae85)){logger[_0x1c90('0x5e')](_0x1c90('0x60')+_0x3dae85+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs['unlinkSync'](_0x3dae85);}return _0x3c3ba4;})['then'](function(_0x3b2cea){if(!_0x3b2cea)throw new InternalError();return _0x3b2cea['destroy']();})['then'](function(){_0x59fef3['status'](0xcc)[_0x1c90('0x22')]();})[_0x1c90('0x42')](handleError(_0x59fef3,null));}; \ No newline at end of file +var _0x04bd=['VoiceRecording','rawAttributes','type','key','model','differenceBy','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','includeAll','rows','catch','show','params','length','include','options','create','update','body','describe','download','../../components/encryptor','uniqueid','find','value','format','%s.cypher','existsSync','decryptFile','secrets','recording','Sequelize','VoiceRecording\x20not\x20found','filename','extname','unlink','message','send','downloads','sequelize','MD5','col','$and','push','ValidationError','Entity\x20not\x20found','info','File:\x20\x22','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','isNil','unlinkSync','destroy','eml-format','bluebird','util','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','then','error','name','index','map'];(function(_0x1a3613,_0x1bb1ee){var _0x5a0756=function(_0xea7948){while(--_0xea7948){_0x1a3613['push'](_0x1a3613['shift']());}};_0x5a0756(++_0x1bb1ee);}(_0x04bd,0x9e));var _0xd04b=function(_0x30c8d5,_0x171315){_0x30c8d5=_0x30c8d5-0x0;var _0x15b988=_0x04bd[_0x30c8d5];return _0x15b988;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd04b('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd04b('0x1'));var Mustache=require('mustache');var util=require(_0xd04b('0x2'));var path=require('path');var sox=require('sox');var csv=require(_0xd04b('0x3'));var ejs=require(_0xd04b('0x4'));var fs=require('fs');var _=require(_0xd04b('0x5'));var squel=require(_0xd04b('0x6'));var crypto=require(_0xd04b('0x7'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xd04b('0x3'));var querystring=require(_0xd04b('0x8'));var Papa=require(_0xd04b('0x9'));var Redis=require(_0xd04b('0xa'));var authService=require('../../components/auth/service');var qs=require(_0xd04b('0xb'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd04b('0xc'));var logger=require(_0xd04b('0xd'))(_0xd04b('0xe'));var utils=require('../../config/utils');var config=require(_0xd04b('0xf'));var db=require(_0xd04b('0x10'))['db'];function respondWithStatusCode(_0x1a9a59,_0x5681bc){_0x5681bc=_0x5681bc||0xcc;return function(_0x581232){if(_0x581232){return _0x1a9a59[_0xd04b('0x11')](_0x5681bc);}return _0x1a9a59[_0xd04b('0x12')](_0x5681bc)[_0xd04b('0x13')]();};}function respondWithResult(_0x3d4bfa,_0x2d590e){_0x2d590e=_0x2d590e||0xc8;return function(_0xbcc581){if(_0xbcc581){return _0x3d4bfa[_0xd04b('0x12')](_0x2d590e)[_0xd04b('0x14')](_0xbcc581);}};}function respondWithFilteredResult(_0x1d2cc7,_0x23fabf){return function(_0x33175a){if(_0x33175a){var _0x28b00a=_0x33175a[_0xd04b('0x15')],_0x425d8a=_0x23fabf[_0xd04b('0x16')],_0x15ccfd=_0x23fabf[_0xd04b('0x16')]+_0x23fabf[_0xd04b('0x17')],_0x39d99e;if(_0x15ccfd>=_0x28b00a){_0x15ccfd=_0x28b00a;_0x39d99e=0xc8;}else{_0x39d99e=0xce;}_0x1d2cc7[_0xd04b('0x12')](_0x39d99e);return _0x1d2cc7['set'](_0xd04b('0x18'),_0x425d8a+'-'+_0x15ccfd+'/'+_0x28b00a)[_0xd04b('0x14')](_0x33175a);}return null;};}function patchUpdates(_0x5f10d7){return function(_0x206afa){try{jsonpatch['apply'](_0x206afa,_0x5f10d7,!![]);}catch(_0xea4c5d){return BPromise[_0xd04b('0x19')](_0xea4c5d);}return _0x206afa[_0xd04b('0x1a')]();};}function saveUpdates(_0x2c65d6,_0x3ddc23){return function(_0xf49751){if(_0xf49751){return _0xf49751['update'](_0x2c65d6)[_0xd04b('0x1b')](function(_0x2ba283){return _0x2ba283;});}return null;};}function removeEntity(_0x4cbe79,_0x3a82cf){return function(_0xeabecd){if(_0xeabecd){return _0xeabecd['destroy']()['then'](function(){_0x4cbe79[_0xd04b('0x12')](0xcc)['end']();});}};}function handleEntityNotFound(_0x21e449,_0x55c9aa){return function(_0x36961b){if(!_0x36961b){_0x21e449[_0xd04b('0x11')](0x194);}return _0x36961b;};}function handleError(_0x39a2eb,_0x437c86){_0x437c86=_0x437c86||0x1f4;return function(_0x45a8fb){logger[_0xd04b('0x1c')](_0x45a8fb['stack']);if(_0x45a8fb[_0xd04b('0x1d')]){delete _0x45a8fb[_0xd04b('0x1d')];}_0x39a2eb[_0xd04b('0x12')](_0x437c86)['send'](_0x45a8fb);};}exports[_0xd04b('0x1e')]=function(_0x42abf8,_0x27be41){var _0x7ad5fb={},_0x5e286b={},_0x36214f={'count':0x0,'rows':[]};var _0x404e89=_[_0xd04b('0x1f')](db[_0xd04b('0x20')][_0xd04b('0x21')],function(_0x36640a){return{'name':_0x36640a['fieldName'],'type':_0x36640a[_0xd04b('0x22')][_0xd04b('0x23')]};});_0x5e286b[_0xd04b('0x24')]=_[_0xd04b('0x25')](_[_0xd04b('0x1f')](_0x404e89,_0xd04b('0x1d')),['format']);_0x5e286b[_0xd04b('0x26')]=_[_0xd04b('0x27')](_0x42abf8['query']);_0x5e286b[_0xd04b('0x28')]=_[_0xd04b('0x29')](_0x5e286b['model'],_0x5e286b[_0xd04b('0x26')]);_0x7ad5fb[_0xd04b('0x2a')]=_['intersection'](_0x5e286b[_0xd04b('0x24')],qs['fields'](_0x42abf8[_0xd04b('0x26')][_0xd04b('0x2b')]));_0x7ad5fb['attributes']=_0x7ad5fb[_0xd04b('0x2a')]['length']?_0x7ad5fb['attributes']:_0x5e286b[_0xd04b('0x24')];if(!_0x42abf8[_0xd04b('0x26')][_0xd04b('0x2c')](_0xd04b('0x2d'))){_0x7ad5fb[_0xd04b('0x17')]=qs[_0xd04b('0x17')](_0x42abf8[_0xd04b('0x26')][_0xd04b('0x17')]);_0x7ad5fb[_0xd04b('0x16')]=qs[_0xd04b('0x16')](_0x42abf8[_0xd04b('0x26')]['offset']);}_0x7ad5fb[_0xd04b('0x2e')]=qs[_0xd04b('0x2f')](_0x42abf8[_0xd04b('0x26')][_0xd04b('0x2f')]);_0x7ad5fb[_0xd04b('0x30')]=qs['filters'](_['pick'](_0x42abf8[_0xd04b('0x26')],_0x5e286b[_0xd04b('0x28')]));if(_0x42abf8[_0xd04b('0x26')][_0xd04b('0x31')]){_0x7ad5fb[_0xd04b('0x30')]=_[_0xd04b('0x32')](_0x7ad5fb[_0xd04b('0x30')],{'$or':_[_0xd04b('0x1f')](_0x404e89,function(_0x15a3fb){if(_0x15a3fb[_0xd04b('0x22')]!=='VIRTUAL'){var _0x2a2b37={};_0x2a2b37[_0x15a3fb[_0xd04b('0x1d')]]={'$like':'%'+_0x42abf8[_0xd04b('0x26')][_0xd04b('0x31')]+'%'};return _0x2a2b37;}})});}_0x7ad5fb=_[_0xd04b('0x32')]({},_0x7ad5fb,_0x42abf8['options']);var _0x9641b2={'where':_0x7ad5fb['where']};return db[_0xd04b('0x20')][_0xd04b('0x15')](_0x9641b2)[_0xd04b('0x1b')](function(_0x10f128){_0x36214f[_0xd04b('0x15')]=_0x10f128;if(_0x42abf8['query'][_0xd04b('0x33')]){_0x7ad5fb['include']=[{'all':!![]}];}return db[_0xd04b('0x20')]['findAll'](_0x7ad5fb);})['then'](function(_0x2cfd88){_0x36214f[_0xd04b('0x34')]=_0x2cfd88;return _0x36214f;})['then'](respondWithFilteredResult(_0x27be41,_0x7ad5fb))[_0xd04b('0x35')](handleError(_0x27be41,null));};exports[_0xd04b('0x36')]=function(_0x405842,_0x3c58eb){var _0x475b43={'raw':![],'where':{'id':_0x405842[_0xd04b('0x37')]['id']}},_0x1aacf8={};_0x1aacf8[_0xd04b('0x24')]=_[_0xd04b('0x27')](db[_0xd04b('0x20')][_0xd04b('0x21')]);_0x1aacf8[_0xd04b('0x26')]=_[_0xd04b('0x27')](_0x405842[_0xd04b('0x26')]);_0x1aacf8['filters']=_['intersection'](_0x1aacf8[_0xd04b('0x24')],_0x1aacf8['query']);_0x475b43[_0xd04b('0x2a')]=_[_0xd04b('0x29')](_0x1aacf8['model'],qs[_0xd04b('0x2b')](_0x405842[_0xd04b('0x26')][_0xd04b('0x2b')]));_0x475b43[_0xd04b('0x2a')]=_0x475b43[_0xd04b('0x2a')][_0xd04b('0x38')]?_0x475b43[_0xd04b('0x2a')]:_0x1aacf8['model'];if(_0x405842[_0xd04b('0x26')][_0xd04b('0x33')]){_0x475b43[_0xd04b('0x39')]=[{'all':!![]}];}_0x475b43=_[_0xd04b('0x32')]({},_0x475b43,_0x405842[_0xd04b('0x3a')]);return db[_0xd04b('0x20')]['find'](_0x475b43)[_0xd04b('0x1b')](handleEntityNotFound(_0x3c58eb,null))[_0xd04b('0x1b')](respondWithResult(_0x3c58eb,null))['catch'](handleError(_0x3c58eb,null));};exports['create']=function(_0xd22522,_0x2bf7f1){return db[_0xd04b('0x20')][_0xd04b('0x3b')](_0xd22522['body'],{})[_0xd04b('0x1b')](respondWithResult(_0x2bf7f1,0xc9))[_0xd04b('0x35')](handleError(_0x2bf7f1,null));};exports[_0xd04b('0x3c')]=function(_0x14032e,_0xbfe902){if(_0x14032e[_0xd04b('0x3d')]['id']){delete _0x14032e[_0xd04b('0x3d')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x14032e[_0xd04b('0x37')]['id']}})['then'](handleEntityNotFound(_0xbfe902,null))[_0xd04b('0x1b')](saveUpdates(_0x14032e[_0xd04b('0x3d')],null))[_0xd04b('0x1b')](respondWithResult(_0xbfe902,null))['catch'](handleError(_0xbfe902,null));};exports['describe']=function(_0x36d626,_0x1a0e9d){return db[_0xd04b('0x20')][_0xd04b('0x3e')]()[_0xd04b('0x1b')](respondWithResult(_0x1a0e9d,null))['catch'](handleError(_0x1a0e9d,null));};exports[_0xd04b('0x3f')]=function(_0x515c3c,_0x4ae8b9,_0x3108e1){var _0x42f49d=require(_0xd04b('0x40'));var _0x5aaf40=![];var _0x3d30b0={};if(_0x515c3c[_0xd04b('0x26')][_0xd04b('0x22')]&&_0x515c3c[_0xd04b('0x26')][_0xd04b('0x22')]===_0xd04b('0x41')){_0x3d30b0[_0xd04b('0x41')]=_0x515c3c[_0xd04b('0x37')]['id'];}else{_0x3d30b0['id']=_0x515c3c['params']['id'];}return db[_0xd04b('0x20')][_0xd04b('0x42')]({'where':_0x3d30b0,'attributes':['id',_0xd04b('0x43')],'raw':!![]})[_0xd04b('0x1b')](handleEntityNotFound(_0x4ae8b9,null))[_0xd04b('0x1b')](function(_0x463241){if(_0x463241){var _0x1bad2e=_0x463241[_0xd04b('0x43')];var _0x18d496=util[_0xd04b('0x44')](_0xd04b('0x45'),_0x1bad2e);if(fs[_0xd04b('0x46')](_0x18d496)){_0x5aaf40=!![];return _0x42f49d[_0xd04b('0x47')](_0x18d496,_0x1bad2e,config[_0xd04b('0x48')][_0xd04b('0x49')])[_0xd04b('0x1b')](function(){return _0x463241;});}return _0x463241;}})[_0xd04b('0x1b')](function(_0x227af2){if(_0x227af2){var _0x182c88=_0x227af2[_0xd04b('0x43')];if(!fs['existsSync'](_0x182c88)){throw new db[(_0xd04b('0x4a'))]['ValidationError'](_0xd04b('0x4b'));}if(_0x227af2['filename']){return _0x4ae8b9['download'](_0x182c88,_0x227af2[_0xd04b('0x4c')]+path[_0xd04b('0x4d')](_0x182c88),function(){if(_0x5aaf40){fs[_0xd04b('0x4e')](_0x182c88);}});}else{return _0x4ae8b9[_0xd04b('0x3f')](_0x182c88,function(_0x5f13f0){if(_0x5aaf40){fs[_0xd04b('0x4e')](_0x182c88);}});}}})[_0xd04b('0x35')](function(_0x3e73d7){if(_0x3e73d7[_0xd04b('0x4f')]===_0xd04b('0x4b')){_0x4ae8b9['status'](0x194)[_0xd04b('0x50')]('Not\x20found');}else{return handleError(_0x4ae8b9,null);}});};exports[_0xd04b('0x51')]=function(_0x1b8b88,_0x47aa59,_0x2b8477){var _0x3e6e89=require('../../components/encryptor');var _0x172a77=![];var _0x243d8d={'$and':[db[_0xd04b('0x52')][_0xd04b('0x30')](db[_0xd04b('0x52')]['fn'](_0xd04b('0x53'),db[_0xd04b('0x52')][_0xd04b('0x54')](_0xd04b('0x41'))),_0x1b8b88[_0xd04b('0x26')]['token'])]};if(_0x1b8b88[_0xd04b('0x26')]['type']&&_0x1b8b88[_0xd04b('0x26')][_0xd04b('0x22')]===_0xd04b('0x41')){_0x243d8d[_0xd04b('0x55')]['push']({'uniqueid':_0x1b8b88[_0xd04b('0x37')]['id']});}else{_0x243d8d['$and'][_0xd04b('0x56')]({'id':_0x1b8b88[_0xd04b('0x37')]['id']});}return db[_0xd04b('0x20')][_0xd04b('0x42')]({'where':_0x243d8d,'attributes':['id',_0xd04b('0x43')],'raw':!![]})[_0xd04b('0x1b')](handleEntityNotFound(_0x47aa59,null))['then'](function(_0x3acfce){if(_0x3acfce){var _0x2b89de=util['format']('%s.cypher',_0x3acfce['value']);if(fs['existsSync'](_0x2b89de)){_0x172a77=!![];return _0x3e6e89['decryptFile'](_0x2b89de,_0x3acfce[_0xd04b('0x43')],config[_0xd04b('0x48')]['recording'])[_0xd04b('0x1b')](function(){return _0x3acfce;});}return _0x3acfce;}})['then'](function(_0x10a456){if(_0x10a456){if(!fs[_0xd04b('0x46')](_0x10a456[_0xd04b('0x43')])){throw new db[(_0xd04b('0x4a'))][(_0xd04b('0x57'))](_0xd04b('0x4b'));}if(_0x10a456[_0xd04b('0x4c')]){return _0x47aa59['download'](_0x10a456[_0xd04b('0x43')],_0x10a456[_0xd04b('0x4c')]+path[_0xd04b('0x4d')](_0x10a456['value']),function(){if(_0x172a77){fs[_0xd04b('0x4e')](_0x10a456[_0xd04b('0x43')]);}});}else{return _0x47aa59['download'](_0x10a456['value'],function(_0x1a3b7a){if(_0x172a77){fs['unlink'](_0x10a456[_0xd04b('0x43')]);}});}}})[_0xd04b('0x35')](handleError(_0x47aa59,null));};exports['destroy']=function(_0x189c21,_0x29e665){return db[_0xd04b('0x20')][_0xd04b('0x42')]({'where':{'id':_0x189c21[_0xd04b('0x37')]['id']}})[_0xd04b('0x1b')](function(_0x2a615d){if(!_0x2a615d)throw new ReferenceError(_0xd04b('0x58'));return _0x2a615d;})[_0xd04b('0x1b')](function(_0x3ed9c1){var _0x51e0fe=_0x3ed9c1['value'];logger['info']('cancellazione\x20fisica\x20documento\x20%s',_0x51e0fe);if(!_['isNil'](_0x3ed9c1[_0xd04b('0x43')])&&fs[_0xd04b('0x46')](_0x51e0fe)){logger[_0xd04b('0x59')](_0xd04b('0x5a')+_0x51e0fe+_0xd04b('0x5b'));fs['unlinkSync'](_0x51e0fe);}_0x51e0fe=_0x51e0fe+'.cypher';if(!_[_0xd04b('0x5c')](_0x3ed9c1['value'])&&fs['existsSync'](_0x51e0fe)){logger[_0xd04b('0x59')](_0xd04b('0x5a')+_0x51e0fe+_0xd04b('0x5b'));fs[_0xd04b('0x5d')](_0x51e0fe);}return _0x3ed9c1;})[_0xd04b('0x1b')](function(_0x1b8451){if(!_0x1b8451)throw new InternalError();return _0x1b8451[_0xd04b('0x5e')]();})[_0xd04b('0x1b')](function(){_0x29e665[_0xd04b('0x12')](0xcc)[_0xd04b('0x13')]();})[_0xd04b('0x35')](handleError(_0x29e665,null));}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index fb64442..1738976 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 _0xc023=['./voiceRecording.attributes','exports','define','VoiceRecording','voice_recordings','uniqueid','../../config/logger','api','moment','bluebird','request-promise','../../config/environment'];(function(_0x4a6102,_0xedf422){var _0x416650=function(_0x4be9ec){while(--_0x4be9ec){_0x4a6102['push'](_0x4a6102['shift']());}};_0x416650(++_0xedf422);}(_0xc023,0x17a));var _0x3c02=function(_0x12fa10,_0x5e9810){_0x12fa10=_0x12fa10-0x0;var _0x14ce72=_0xc023[_0x12fa10];return _0x14ce72;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x3c02('0x0'))(_0x3c02('0x1'));var moment=require(_0x3c02('0x2'));var BPromise=require(_0x3c02('0x3'));var rp=require(_0x3c02('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x3c02('0x5'));var attributes=require(_0x3c02('0x6'));module[_0x3c02('0x7')]=function(_0x1d0ced,_0x21e2d6){return _0x1d0ced[_0x3c02('0x8')](_0x3c02('0x9'),attributes,{'tableName':_0x3c02('0xa'),'paranoid':![],'indexes':[{'name':_0x3c02('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x239a=['define','VoiceRecording','voice_recordings','uniqueid','lodash','util','moment','bluebird','request-promise','path','./voiceRecording.attributes','exports'];(function(_0x36436d,_0x20292c){var _0x34615d=function(_0x5447af){while(--_0x5447af){_0x36436d['push'](_0x36436d['shift']());}};_0x34615d(++_0x20292c);}(_0x239a,0x160));var _0xa239=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x239a[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0xa239('0x0'));var util=require(_0xa239('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xa239('0x2'));var BPromise=require(_0xa239('0x3'));var rp=require(_0xa239('0x4'));var fs=require('fs');var path=require(_0xa239('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa239('0x6'));module[_0xa239('0x7')]=function(_0x1c3057,_0x1f285b){return _0x1c3057[_0xa239('0x8')](_0xa239('0x9'),attributes,{'tableName':_0xa239('0xa'),'paranoid':![],'indexes':[{'name':_0xa239('0xb'),'fields':[_0xa239('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index db7f097..0e365cb 100644 --- a/server/api/voiceRecording/voiceRecording.rpc.js +++ b/server/api/voiceRecording/voiceRecording.rpc.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x1f1170,_0x3b5783){var _0x127b7b=function(_0x30c5ed){while(--_0x30c5ed){_0x1f1170['push'](_0x1f1170['shift']());}};_0x127b7b(++_0x3b5783);}(_0xa9e0,0x123));var _0x0a9e=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xa9e0[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x33b685,_0x43e6f4){var _0x1d11ee=function(_0x1b26d2){while(--_0x1b26d2){_0x33b685['push'](_0x33b685['shift']());}};_0x1d11ee(++_0x43e6f4);}(_0xa9e0,0x123));var _0x0a9e=function(_0x387777,_0x356171){_0x387777=_0x387777-0x0;var _0x3f84c0=_0xa9e0[_0x387777];return _0x3f84c0;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0a9e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));var config=require(_0x0a9e('0x7'));var jayson=require(_0x0a9e('0x8'));var client=jayson['client'][_0x0a9e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x441e3a,_0x2cc193,_0x5f41ea){return new BPromise(function(_0x503809,_0xe42b77){return client['request'](_0x441e3a,_0x5f41ea)['then'](function(_0x39753a){logger[_0x0a9e('0xa')](_0x0a9e('0xb'),_0x2cc193,_0x0a9e('0xc'));logger[_0x0a9e('0xd')](_0x0a9e('0xe'),_0x2cc193,'request\x20sent',JSON['stringify'](_0x39753a));if(_0x39753a['error']){if(_0x39753a['error'][_0x0a9e('0xf')]===0x1f4){logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0xe42b77(_0x39753a[_0x0a9e('0x10')]['message']);}logger[_0x0a9e('0x10')](_0x0a9e('0xb'),_0x2cc193,_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);return _0x503809(_0x39753a[_0x0a9e('0x10')][_0x0a9e('0x11')]);}else{logger['info'](_0x0a9e('0xb'),_0x2cc193,'request\x20sent');_0x503809(_0x39753a[_0x0a9e('0x12')]['message']);}})[_0x0a9e('0x13')](function(_0x12066b){logger['error'](_0x0a9e('0xb'),_0x2cc193,_0x12066b);_0xe42b77(_0x12066b);});});}exports['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index a44c89c..b8a2119 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 _0x5d17=['../../components/auth/service','../../config/environment','./voiceTransferReport.controller','get','isAuthenticated','/:id','show','post','create','exports','multer','util','express','Router'];(function(_0x3e2489,_0x41d9dd){var _0x2254ce=function(_0x227e46){while(--_0x227e46){_0x3e2489['push'](_0x3e2489['shift']());}};_0x2254ce(++_0x41d9dd);}(_0x5d17,0x114));var _0x75d1=function(_0x568ec8,_0x1e0f23){_0x568ec8=_0x568ec8-0x0;var _0x52b2be=_0x5d17[_0x568ec8];return _0x52b2be;};'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('0xb')]('/',auth[_0x75d1('0x8')](),controller[_0x75d1('0xc')]);router['put']('/:id',auth[_0x75d1('0x8')](),controller['update']);router['delete'](_0x75d1('0x9'),auth[_0x75d1('0x8')](),controller['destroy']);module[_0x75d1('0xd')]=router; \ No newline at end of file +var _0x5fc3=['post','create','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./voiceTransferReport.controller','get','isAuthenticated','/:id','show'];(function(_0x4ec21b,_0xdecd22){var _0xd54194=function(_0x40754e){while(--_0x40754e){_0x4ec21b['push'](_0x4ec21b['shift']());}};_0xd54194(++_0xdecd22);}(_0x5fc3,0xa8));var _0x35fc=function(_0x3e2fcf,_0x579110){_0x3e2fcf=_0x3e2fcf-0x0;var _0x497db7=_0x5fc3[_0x3e2fcf];return _0x497db7;};'use strict';var multer=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var path=require('path');var timeout=require(_0x35fc('0x2'));var express=require(_0x35fc('0x3'));var router=express[_0x35fc('0x4')]();var auth=require(_0x35fc('0x5'));var interaction=require(_0x35fc('0x6'));var config=require('../../config/environment');var controller=require(_0x35fc('0x7'));router[_0x35fc('0x8')]('/',auth[_0x35fc('0x9')](),controller['index']);router['get'](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0xb')]);router[_0x35fc('0xc')]('/',auth[_0x35fc('0x9')](),controller[_0x35fc('0xd')]);router[_0x35fc('0xe')](_0x35fc('0xa'),auth[_0x35fc('0x9')](),controller['update']);router[_0x35fc('0xf')](_0x35fc('0xa'),auth['isAuthenticated'](),controller[_0x35fc('0x10')]);module[_0x35fc('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 8cf40ea..54f6e23 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 _0xc0e5=['STRING','Yes','exports','ENUM','blind','attended'];(function(_0x1f3634,_0x325bfe){var _0x248a68=function(_0x292d37){while(--_0x292d37){_0x1f3634['push'](_0x1f3634['shift']());}};_0x248a68(++_0x325bfe);}(_0xc0e5,0xfe));var _0x5c0e=function(_0x43c6d1,_0x20edf8){_0x43c6d1=_0x43c6d1-0x0;var _0x334a91=_0xc0e5[_0x43c6d1];return _0x334a91;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x5c0e('0x0')]={'type':{'type':Sequelize[_0x5c0e('0x1')](_0x5c0e('0x2'),_0x5c0e('0x3'))},'result':{'type':Sequelize[_0x5c0e('0x4')]},'transfererchannel':{'type':Sequelize[_0x5c0e('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x5c0e('0x4')]},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x5c0e('0x4')]},'transfererconnectedlinename':{'type':Sequelize['STRING']},'transfereraccountcode':{'type':Sequelize[_0x5c0e('0x4')]},'transferercontext':{'type':Sequelize[_0x5c0e('0x4')]},'transfererexten':{'type':Sequelize[_0x5c0e('0x4')]},'transfererlinkedid':{'type':Sequelize[_0x5c0e('0x4')]},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x5c0e('0x4')]},'transfereecalleridname':{'type':Sequelize[_0x5c0e('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize['STRING']},'transfereeaccountcode':{'type':Sequelize[_0x5c0e('0x4')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x5c0e('0x4')]},'isexternal':{'type':Sequelize[_0x5c0e('0x1')](_0x5c0e('0x5'),'No')},'context':{'type':Sequelize['STRING']},'extension':{'type':Sequelize[_0x5c0e('0x4')]}}; \ No newline at end of file +var _0x2d80=['Yes','sequelize','moment','exports','ENUM','attended','STRING'];(function(_0x5be1d2,_0x52e957){var _0xd82020=function(_0x21e50e){while(--_0x21e50e){_0x5be1d2['push'](_0x5be1d2['shift']());}};_0xd82020(++_0x52e957);}(_0x2d80,0x158));var _0x02d8=function(_0x557886,_0x525a5e){_0x557886=_0x557886-0x0;var _0x3026ba=_0x2d80[_0x557886];return _0x3026ba;};'use strict';var Sequelize=require(_0x02d8('0x0'));var moment=require(_0x02d8('0x1'));module[_0x02d8('0x2')]={'type':{'type':Sequelize[_0x02d8('0x3')]('blind',_0x02d8('0x4'))},'result':{'type':Sequelize[_0x02d8('0x5')]},'transfererchannel':{'type':Sequelize[_0x02d8('0x5')]},'transferercalleridnum':{'type':Sequelize[_0x02d8('0x5')]},'transferercalleridname':{'type':Sequelize[_0x02d8('0x5')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x02d8('0x5')]},'transfereraccountcode':{'type':Sequelize[_0x02d8('0x5')]},'transferercontext':{'type':Sequelize[_0x02d8('0x5')]},'transfererexten':{'type':Sequelize[_0x02d8('0x5')]},'transfererlinkedid':{'type':Sequelize[_0x02d8('0x5')]},'transfereechannel':{'type':Sequelize[_0x02d8('0x5')]},'transfereecalleridnum':{'type':Sequelize[_0x02d8('0x5')]},'transfereecalleridname':{'type':Sequelize[_0x02d8('0x5')]},'transfereeconnectedlinenum':{'type':Sequelize['STRING']},'transfereeconnectedlinename':{'type':Sequelize[_0x02d8('0x5')]},'transfereeaccountcode':{'type':Sequelize[_0x02d8('0x5')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize[_0x02d8('0x5')]},'transfereelinkedid':{'type':Sequelize[_0x02d8('0x5')]},'isexternal':{'type':Sequelize['ENUM'](_0x02d8('0x6'),'No')},'context':{'type':Sequelize[_0x02d8('0x5')]},'extension':{'type':Sequelize[_0x02d8('0x5')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index cfe5a6b..5eadc41 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 _0x0abf=['fields','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','rows','catch','show','params','length','find','create','body','html-pdf','rimraf','zip-dir','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x4d82ea,_0x4d459f){var _0x257f4a=function(_0x424c4f){while(--_0x424c4f){_0x4d82ea['push'](_0x4d82ea['shift']());}};_0x257f4a(++_0x4d459f);}(_0x0abf,0xe8));var _0xf0ab=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x0abf[_0x1facfa];return _0x9ec701;};'use strict';var pdf=require(_0xf0ab('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf0ab('0x1'));var zipdir=require(_0xf0ab('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xf0ab('0x3'));var BPromise=require('bluebird');var Mustache=require(_0xf0ab('0x4'));var util=require(_0xf0ab('0x5'));var path=require(_0xf0ab('0x6'));var sox=require(_0xf0ab('0x7'));var csv=require(_0xf0ab('0x8'));var ejs=require(_0xf0ab('0x9'));var fs=require('fs');var _=require(_0xf0ab('0xa'));var squel=require('squel');var crypto=require(_0xf0ab('0xb'));var jsforce=require(_0xf0ab('0xc'));var deskjs=require(_0xf0ab('0xd'));var toCsv=require(_0xf0ab('0x8'));var querystring=require('querystring');var Papa=require(_0xf0ab('0xe'));var Redis=require(_0xf0ab('0xf'));var authService=require(_0xf0ab('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xf0ab('0x11'));var logger=require('../../config/logger')(_0xf0ab('0x12'));var utils=require(_0xf0ab('0x13'));var config=require(_0xf0ab('0x14'));var db=require(_0xf0ab('0x15'))['db'];function respondWithStatusCode(_0x2dc4f8,_0x38ca67){_0x38ca67=_0x38ca67||0xcc;return function(_0x34ccdc){if(_0x34ccdc){return _0x2dc4f8['sendStatus'](_0x38ca67);}return _0x2dc4f8[_0xf0ab('0x16')](_0x38ca67)[_0xf0ab('0x17')]();};}function respondWithResult(_0x1913fe,_0x35c75f){_0x35c75f=_0x35c75f||0xc8;return function(_0x1824ef){if(_0x1824ef){return _0x1913fe[_0xf0ab('0x16')](_0x35c75f)[_0xf0ab('0x18')](_0x1824ef);}};}function respondWithFilteredResult(_0x1fb4e5,_0x180d0b){return function(_0x3c5bfd){if(_0x3c5bfd){var _0x20f453=_0x3c5bfd[_0xf0ab('0x19')],_0x221bac=_0x180d0b['offset'],_0x200cf5=_0x180d0b[_0xf0ab('0x1a')]+_0x180d0b[_0xf0ab('0x1b')],_0x2f4618;if(_0x200cf5>=_0x20f453){_0x200cf5=_0x20f453;_0x2f4618=0xc8;}else{_0x2f4618=0xce;}_0x1fb4e5[_0xf0ab('0x16')](_0x2f4618);return _0x1fb4e5[_0xf0ab('0x1c')](_0xf0ab('0x1d'),_0x221bac+'-'+_0x200cf5+'/'+_0x20f453)[_0xf0ab('0x18')](_0x3c5bfd);}return null;};}function patchUpdates(_0x3a0edf){return function(_0x263e2b){try{jsonpatch[_0xf0ab('0x1e')](_0x263e2b,_0x3a0edf,!![]);}catch(_0x1874a5){return BPromise[_0xf0ab('0x1f')](_0x1874a5);}return _0x263e2b[_0xf0ab('0x20')]();};}function saveUpdates(_0xf43bc4,_0x22a205){return function(_0x2cd961){if(_0x2cd961){return _0x2cd961[_0xf0ab('0x21')](_0xf43bc4)['then'](function(_0x153492){return _0x153492;});}return null;};}function removeEntity(_0x6fa888,_0x1e1483){return function(_0x11ab3a){if(_0x11ab3a){return _0x11ab3a[_0xf0ab('0x22')]()[_0xf0ab('0x23')](function(){_0x6fa888[_0xf0ab('0x16')](0xcc)[_0xf0ab('0x17')]();});}};}function handleEntityNotFound(_0x36ad01,_0x18bb37){return function(_0x43119f){if(!_0x43119f){_0x36ad01['sendStatus'](0x194);}return _0x43119f;};}function handleError(_0x585841,_0x4eee21){_0x4eee21=_0x4eee21||0x1f4;return function(_0x33aaa0){logger['error'](_0x33aaa0[_0xf0ab('0x24')]);if(_0x33aaa0[_0xf0ab('0x25')]){delete _0x33aaa0['name'];}_0x585841[_0xf0ab('0x16')](_0x4eee21)[_0xf0ab('0x26')](_0x33aaa0);};}exports[_0xf0ab('0x27')]=function(_0x38fb71,_0x7d4ff9){var _0x502921={},_0x2d0da7={},_0x574ce7={'count':0x0,'rows':[]};var _0x55d799=_[_0xf0ab('0x28')](db[_0xf0ab('0x29')][_0xf0ab('0x2a')],function(_0x445160){return{'name':_0x445160[_0xf0ab('0x2b')],'type':_0x445160[_0xf0ab('0x2c')][_0xf0ab('0x2d')]};});_0x2d0da7[_0xf0ab('0x2e')]=_[_0xf0ab('0x28')](_0x55d799,_0xf0ab('0x25'));_0x2d0da7[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x38fb71['query']);_0x2d0da7[_0xf0ab('0x31')]=_[_0xf0ab('0x32')](_0x2d0da7['model'],_0x2d0da7['query']);_0x502921[_0xf0ab('0x33')]=_[_0xf0ab('0x32')](_0x2d0da7[_0xf0ab('0x2e')],qs['fields'](_0x38fb71['query'][_0xf0ab('0x34')]));_0x502921['attributes']=_0x502921[_0xf0ab('0x33')]['length']?_0x502921[_0xf0ab('0x33')]:_0x2d0da7[_0xf0ab('0x2e')];if(!_0x38fb71['query']['hasOwnProperty'](_0xf0ab('0x35'))){_0x502921[_0xf0ab('0x1b')]=qs[_0xf0ab('0x1b')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x1b')]);_0x502921[_0xf0ab('0x1a')]=qs[_0xf0ab('0x1a')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x1a')]);}_0x502921[_0xf0ab('0x36')]=qs[_0xf0ab('0x37')](_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x37')]);_0x502921[_0xf0ab('0x38')]=qs['filters'](_[_0xf0ab('0x39')](_0x38fb71[_0xf0ab('0x2f')],_0x2d0da7[_0xf0ab('0x31')]));if(_0x38fb71['query'][_0xf0ab('0x3a')]){_0x502921[_0xf0ab('0x38')]=_[_0xf0ab('0x3b')](_0x502921['where'],{'$or':_[_0xf0ab('0x28')](_0x55d799,function(_0x4fe5c0){if(_0x4fe5c0[_0xf0ab('0x2c')]!=='VIRTUAL'){var _0x4763f7={};_0x4763f7[_0x4fe5c0[_0xf0ab('0x25')]]={'$like':'%'+_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x3a')]+'%'};return _0x4763f7;}})});}_0x502921=_[_0xf0ab('0x3b')]({},_0x502921,_0x38fb71[_0xf0ab('0x3c')]);var _0x4e3ade={'where':_0x502921[_0xf0ab('0x38')]};return db[_0xf0ab('0x29')]['count'](_0x4e3ade)[_0xf0ab('0x23')](function(_0xce89bc){_0x574ce7[_0xf0ab('0x19')]=_0xce89bc;if(_0x38fb71[_0xf0ab('0x2f')][_0xf0ab('0x3d')]){_0x502921[_0xf0ab('0x3e')]=[{'all':!![]}];}return db[_0xf0ab('0x29')]['findAll'](_0x502921);})[_0xf0ab('0x23')](function(_0x4f6e93){_0x574ce7[_0xf0ab('0x3f')]=_0x4f6e93;return _0x574ce7;})['then'](respondWithFilteredResult(_0x7d4ff9,_0x502921))[_0xf0ab('0x40')](handleError(_0x7d4ff9,null));};exports[_0xf0ab('0x41')]=function(_0x44077b,_0x32b237){var _0x2b7ed5={'raw':!![],'where':{'id':_0x44077b[_0xf0ab('0x42')]['id']}},_0x553d07={};_0x553d07[_0xf0ab('0x2e')]=_[_0xf0ab('0x30')](db[_0xf0ab('0x29')][_0xf0ab('0x2a')]);_0x553d07[_0xf0ab('0x2f')]=_[_0xf0ab('0x30')](_0x44077b[_0xf0ab('0x2f')]);_0x553d07[_0xf0ab('0x31')]=_[_0xf0ab('0x32')](_0x553d07[_0xf0ab('0x2e')],_0x553d07[_0xf0ab('0x2f')]);_0x2b7ed5[_0xf0ab('0x33')]=_['intersection'](_0x553d07['model'],qs[_0xf0ab('0x34')](_0x44077b['query'][_0xf0ab('0x34')]));_0x2b7ed5[_0xf0ab('0x33')]=_0x2b7ed5['attributes'][_0xf0ab('0x43')]?_0x2b7ed5[_0xf0ab('0x33')]:_0x553d07['model'];if(_0x44077b[_0xf0ab('0x2f')][_0xf0ab('0x3d')]){_0x2b7ed5[_0xf0ab('0x3e')]=[{'all':!![]}];}_0x2b7ed5=_[_0xf0ab('0x3b')]({},_0x2b7ed5,_0x44077b[_0xf0ab('0x3c')]);return db[_0xf0ab('0x29')][_0xf0ab('0x44')](_0x2b7ed5)[_0xf0ab('0x23')](handleEntityNotFound(_0x32b237,null))[_0xf0ab('0x23')](respondWithResult(_0x32b237,null))[_0xf0ab('0x40')](handleError(_0x32b237,null));};exports[_0xf0ab('0x45')]=function(_0x302510,_0x13b477){return db[_0xf0ab('0x29')]['create'](_0x302510['body'],{})[_0xf0ab('0x23')](respondWithResult(_0x13b477,0xc9))['catch'](handleError(_0x13b477,null));};exports['update']=function(_0x4e57d3,_0xc3b68d){if(_0x4e57d3[_0xf0ab('0x46')]['id']){delete _0x4e57d3[_0xf0ab('0x46')]['id'];}return db[_0xf0ab('0x29')][_0xf0ab('0x44')]({'where':{'id':_0x4e57d3[_0xf0ab('0x42')]['id']}})[_0xf0ab('0x23')](handleEntityNotFound(_0xc3b68d,null))[_0xf0ab('0x23')](saveUpdates(_0x4e57d3[_0xf0ab('0x46')],null))[_0xf0ab('0x23')](respondWithResult(_0xc3b68d,null))[_0xf0ab('0x40')](handleError(_0xc3b68d,null));};exports[_0xf0ab('0x22')]=function(_0x4e6c9b,_0x393c9a){return db[_0xf0ab('0x29')][_0xf0ab('0x44')]({'where':{'id':_0x4e6c9b[_0xf0ab('0x42')]['id']}})[_0xf0ab('0x23')](handleEntityNotFound(_0x393c9a,null))[_0xf0ab('0x23')](removeEntity(_0x393c9a,null))[_0xf0ab('0x40')](handleError(_0x393c9a,null));}; \ No newline at end of file +var _0x5eb8=['apply','reject','save','destroy','then','stack','name','send','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','filters','pick','merge','type','VoiceTransferReport','includeAll','catch','include','options','find','create','body','update','params','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','set','Content-Range'];(function(_0x1e8b1e,_0x407bbd){var _0x4a0fde=function(_0x4fd2be){while(--_0x4fd2be){_0x1e8b1e['push'](_0x1e8b1e['shift']());}};_0x4a0fde(++_0x407bbd);}(_0x5eb8,0xb0));var _0x85eb=function(_0x1a9204,_0x1c9e00){_0x1a9204=_0x1a9204-0x0;var _0x17ca68=_0x5eb8[_0x1a9204];return _0x17ca68;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x85eb('0x0'));var zipdir=require(_0x85eb('0x1'));var jsonpatch=require(_0x85eb('0x2'));var rp=require(_0x85eb('0x3'));var moment=require(_0x85eb('0x4'));var BPromise=require(_0x85eb('0x5'));var Mustache=require(_0x85eb('0x6'));var util=require(_0x85eb('0x7'));var path=require(_0x85eb('0x8'));var sox=require(_0x85eb('0x9'));var csv=require(_0x85eb('0xa'));var ejs=require(_0x85eb('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x85eb('0xc'));var crypto=require(_0x85eb('0xd'));var jsforce=require(_0x85eb('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x85eb('0xa'));var querystring=require('querystring');var Papa=require(_0x85eb('0xf'));var Redis=require(_0x85eb('0x10'));var authService=require(_0x85eb('0x11'));var qs=require(_0x85eb('0x12'));var as=require(_0x85eb('0x13'));var hardwareService=require(_0x85eb('0x14'));var logger=require(_0x85eb('0x15'))('api');var utils=require(_0x85eb('0x16'));var config=require(_0x85eb('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2af376,_0x784583){_0x784583=_0x784583||0xcc;return function(_0x2f42ba){if(_0x2f42ba){return _0x2af376[_0x85eb('0x18')](_0x784583);}return _0x2af376['status'](_0x784583)['end']();};}function respondWithResult(_0x394c74,_0x5c760a){_0x5c760a=_0x5c760a||0xc8;return function(_0x18ca53){if(_0x18ca53){return _0x394c74[_0x85eb('0x19')](_0x5c760a)[_0x85eb('0x1a')](_0x18ca53);}};}function respondWithFilteredResult(_0x1604ba,_0x183b0c){return function(_0x49efdf){if(_0x49efdf){var _0x2e5c0a=_0x49efdf[_0x85eb('0x1b')],_0x59237b=_0x183b0c[_0x85eb('0x1c')],_0x17140b=_0x183b0c['offset']+_0x183b0c['limit'],_0x10c2c9;if(_0x17140b>=_0x2e5c0a){_0x17140b=_0x2e5c0a;_0x10c2c9=0xc8;}else{_0x10c2c9=0xce;}_0x1604ba['status'](_0x10c2c9);return _0x1604ba[_0x85eb('0x1d')](_0x85eb('0x1e'),_0x59237b+'-'+_0x17140b+'/'+_0x2e5c0a)[_0x85eb('0x1a')](_0x49efdf);}return null;};}function patchUpdates(_0x2e986c){return function(_0x42dada){try{jsonpatch[_0x85eb('0x1f')](_0x42dada,_0x2e986c,!![]);}catch(_0x5acd3d){return BPromise[_0x85eb('0x20')](_0x5acd3d);}return _0x42dada[_0x85eb('0x21')]();};}function saveUpdates(_0xd9f06d,_0x4e8041){return function(_0x4b4b38){if(_0x4b4b38){return _0x4b4b38['update'](_0xd9f06d)['then'](function(_0x244667){return _0x244667;});}return null;};}function removeEntity(_0x3fa785,_0x329fc5){return function(_0x255ca7){if(_0x255ca7){return _0x255ca7[_0x85eb('0x22')]()[_0x85eb('0x23')](function(){_0x3fa785['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5b48d9,_0x298e84){return function(_0x1426c8){if(!_0x1426c8){_0x5b48d9[_0x85eb('0x18')](0x194);}return _0x1426c8;};}function handleError(_0x28b87d,_0x312b3e){_0x312b3e=_0x312b3e||0x1f4;return function(_0x210aef){logger['error'](_0x210aef[_0x85eb('0x24')]);if(_0x210aef[_0x85eb('0x25')]){delete _0x210aef[_0x85eb('0x25')];}_0x28b87d[_0x85eb('0x19')](_0x312b3e)[_0x85eb('0x26')](_0x210aef);};}exports['index']=function(_0x2e5aa3,_0x792d3a){var _0x291557={},_0x3e7eb9={},_0x40f13e={'count':0x0,'rows':[]};var _0x29d262=_['map'](db['VoiceTransferReport'][_0x85eb('0x27')],function(_0x585f2a){return{'name':_0x585f2a[_0x85eb('0x28')],'type':_0x585f2a['type'][_0x85eb('0x29')]};});_0x3e7eb9[_0x85eb('0x2a')]=_[_0x85eb('0x2b')](_0x29d262,_0x85eb('0x25'));_0x3e7eb9[_0x85eb('0x2c')]=_[_0x85eb('0x2d')](_0x2e5aa3[_0x85eb('0x2c')]);_0x3e7eb9['filters']=_[_0x85eb('0x2e')](_0x3e7eb9[_0x85eb('0x2a')],_0x3e7eb9['query']);_0x291557[_0x85eb('0x2f')]=_['intersection'](_0x3e7eb9['model'],qs[_0x85eb('0x30')](_0x2e5aa3[_0x85eb('0x2c')][_0x85eb('0x30')]));_0x291557[_0x85eb('0x2f')]=_0x291557[_0x85eb('0x2f')][_0x85eb('0x31')]?_0x291557[_0x85eb('0x2f')]:_0x3e7eb9[_0x85eb('0x2a')];if(!_0x2e5aa3[_0x85eb('0x2c')][_0x85eb('0x32')]('nolimit')){_0x291557[_0x85eb('0x33')]=qs[_0x85eb('0x33')](_0x2e5aa3['query']['limit']);_0x291557[_0x85eb('0x1c')]=qs[_0x85eb('0x1c')](_0x2e5aa3[_0x85eb('0x2c')][_0x85eb('0x1c')]);}_0x291557[_0x85eb('0x34')]=qs[_0x85eb('0x35')](_0x2e5aa3[_0x85eb('0x2c')][_0x85eb('0x35')]);_0x291557[_0x85eb('0x36')]=qs[_0x85eb('0x37')](_[_0x85eb('0x38')](_0x2e5aa3[_0x85eb('0x2c')],_0x3e7eb9[_0x85eb('0x37')]));if(_0x2e5aa3[_0x85eb('0x2c')]['filter']){_0x291557[_0x85eb('0x36')]=_[_0x85eb('0x39')](_0x291557['where'],{'$or':_['map'](_0x29d262,function(_0x2b3747){if(_0x2b3747[_0x85eb('0x3a')]!=='VIRTUAL'){var _0x4317bc={};_0x4317bc[_0x2b3747['name']]={'$like':'%'+_0x2e5aa3[_0x85eb('0x2c')]['filter']+'%'};return _0x4317bc;}})});}_0x291557=_[_0x85eb('0x39')]({},_0x291557,_0x2e5aa3['options']);var _0x1fea52={'where':_0x291557['where']};return db[_0x85eb('0x3b')][_0x85eb('0x1b')](_0x1fea52)['then'](function(_0x313989){_0x40f13e['count']=_0x313989;if(_0x2e5aa3[_0x85eb('0x2c')][_0x85eb('0x3c')]){_0x291557['include']=[{'all':!![]}];}return db[_0x85eb('0x3b')]['findAll'](_0x291557);})['then'](function(_0x1b8a71){_0x40f13e['rows']=_0x1b8a71;return _0x40f13e;})[_0x85eb('0x23')](respondWithFilteredResult(_0x792d3a,_0x291557))[_0x85eb('0x3d')](handleError(_0x792d3a,null));};exports['show']=function(_0x49a0cd,_0x1e336c){var _0x422ec3={'raw':!![],'where':{'id':_0x49a0cd['params']['id']}},_0x48160e={};_0x48160e[_0x85eb('0x2a')]=_[_0x85eb('0x2d')](db[_0x85eb('0x3b')][_0x85eb('0x27')]);_0x48160e[_0x85eb('0x2c')]=_['keys'](_0x49a0cd[_0x85eb('0x2c')]);_0x48160e[_0x85eb('0x37')]=_[_0x85eb('0x2e')](_0x48160e[_0x85eb('0x2a')],_0x48160e[_0x85eb('0x2c')]);_0x422ec3[_0x85eb('0x2f')]=_[_0x85eb('0x2e')](_0x48160e[_0x85eb('0x2a')],qs[_0x85eb('0x30')](_0x49a0cd['query'][_0x85eb('0x30')]));_0x422ec3[_0x85eb('0x2f')]=_0x422ec3['attributes'][_0x85eb('0x31')]?_0x422ec3[_0x85eb('0x2f')]:_0x48160e[_0x85eb('0x2a')];if(_0x49a0cd[_0x85eb('0x2c')][_0x85eb('0x3c')]){_0x422ec3[_0x85eb('0x3e')]=[{'all':!![]}];}_0x422ec3=_['merge']({},_0x422ec3,_0x49a0cd[_0x85eb('0x3f')]);return db[_0x85eb('0x3b')][_0x85eb('0x40')](_0x422ec3)[_0x85eb('0x23')](handleEntityNotFound(_0x1e336c,null))[_0x85eb('0x23')](respondWithResult(_0x1e336c,null))[_0x85eb('0x3d')](handleError(_0x1e336c,null));};exports[_0x85eb('0x41')]=function(_0x202590,_0x5ed246){return db[_0x85eb('0x3b')][_0x85eb('0x41')](_0x202590[_0x85eb('0x42')],{})[_0x85eb('0x23')](respondWithResult(_0x5ed246,0xc9))[_0x85eb('0x3d')](handleError(_0x5ed246,null));};exports[_0x85eb('0x43')]=function(_0x3c387a,_0x77fdc4){if(_0x3c387a[_0x85eb('0x42')]['id']){delete _0x3c387a[_0x85eb('0x42')]['id'];}return db[_0x85eb('0x3b')][_0x85eb('0x40')]({'where':{'id':_0x3c387a['params']['id']}})[_0x85eb('0x23')](handleEntityNotFound(_0x77fdc4,null))[_0x85eb('0x23')](saveUpdates(_0x3c387a[_0x85eb('0x42')],null))['then'](respondWithResult(_0x77fdc4,null))[_0x85eb('0x3d')](handleError(_0x77fdc4,null));};exports[_0x85eb('0x22')]=function(_0x2cf928,_0xd2f302){return db[_0x85eb('0x3b')]['find']({'where':{'id':_0x2cf928[_0x85eb('0x44')]['id']}})[_0x85eb('0x23')](handleEntityNotFound(_0xd2f302,null))[_0x85eb('0x23')](removeEntity(_0xd2f302,null))['catch'](handleError(_0xd2f302,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index ca46ada..b42372a 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 _0xd615=['moment','bluebird','../../config/environment','./voiceTransferReport.attributes','define','report_call_transfer','lodash','util','../../config/logger','api'];(function(_0x3a98a4,_0x454633){var _0x122b6d=function(_0x551317){while(--_0x551317){_0x3a98a4['push'](_0x3a98a4['shift']());}};_0x122b6d(++_0x454633);}(_0xd615,0x132));var _0x5d61=function(_0x61479e,_0x22fea3){_0x61479e=_0x61479e-0x0;var _0xb13a75=_0xd615[_0x61479e];return _0xb13a75;};'use strict';var _=require(_0x5d61('0x0'));var util=require(_0x5d61('0x1'));var logger=require(_0x5d61('0x2'))(_0x5d61('0x3'));var moment=require(_0x5d61('0x4'));var BPromise=require(_0x5d61('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5d61('0x6'));var attributes=require(_0x5d61('0x7'));module['exports']=function(_0x1e19be,_0x2777f5){return _0x1e19be[_0x5d61('0x8')]('VoiceTransferReport',attributes,{'tableName':_0x5d61('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6acc=['request-promise','path','rimraf','../../config/environment','./voiceTransferReport.attributes','define','VoiceTransferReport','report_call_transfer','lodash','util','../../config/logger','api','moment'];(function(_0x1cdcab,_0x38e294){var _0x1e6773=function(_0x3b82e8){while(--_0x3b82e8){_0x1cdcab['push'](_0x1cdcab['shift']());}};_0x1e6773(++_0x38e294);}(_0x6acc,0x167));var _0xc6ac=function(_0x1203f,_0x554bbc){_0x1203f=_0x1203f-0x0;var _0x365f0a=_0x6acc[_0x1203f];return _0x365f0a;};'use strict';var _=require(_0xc6ac('0x0'));var util=require(_0xc6ac('0x1'));var logger=require(_0xc6ac('0x2'))(_0xc6ac('0x3'));var moment=require(_0xc6ac('0x4'));var BPromise=require('bluebird');var rp=require(_0xc6ac('0x5'));var fs=require('fs');var path=require(_0xc6ac('0x6'));var rimraf=require(_0xc6ac('0x7'));var config=require(_0xc6ac('0x8'));var attributes=require(_0xc6ac('0x9'));module['exports']=function(_0x13416f,_0x4dbb37){return _0x13416f[_0xc6ac('0xa')](_0xc6ac('0xb'),attributes,{'tableName':_0xc6ac('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 2c53e96..4616e93 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 _0x0991=['info','request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','VoiceTransferReport,\x20%s,\x20%s','catch','CreateVoiceTransferReport','VoiceTransferReport','create','body','options','raw','then','debug','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x102586,_0x6e981){var _0x4337ea=function(_0x47ad0e){while(--_0x47ad0e){_0x102586['push'](_0x102586['shift']());}};_0x4337ea(++_0x6e981);}(_0x0991,0x1a6));var _0x1099=function(_0x2194eb,_0x66fdb0){_0x2194eb=_0x2194eb-0x0;var _0x4b7c3f=_0x0991[_0x2194eb];return _0x4b7c3f;};'use strict';var _=require(_0x1099('0x0'));var util=require(_0x1099('0x1'));var moment=require(_0x1099('0x2'));var BPromise=require(_0x1099('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1099('0x4'))['db'];var utils=require(_0x1099('0x5'));var logger=require(_0x1099('0x6'))(_0x1099('0x7'));var config=require('../../config/environment');var jayson=require(_0x1099('0x8'));var client=jayson[_0x1099('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x33d490,_0x5a5260,_0x114677){return new BPromise(function(_0x257484,_0x2d0153){return client['request'](_0x33d490,_0x114677)['then'](function(_0x3f4e74){logger[_0x1099('0xa')]('VoiceTransferReport,\x20%s,\x20%s',_0x5a5260,_0x1099('0xb'));logger['debug'](_0x1099('0xc'),_0x5a5260,_0x1099('0xb'),JSON[_0x1099('0xd')](_0x3f4e74));if(_0x3f4e74[_0x1099('0xe')]){if(_0x3f4e74['error'][_0x1099('0xf')]===0x1f4){logger['error']('VoiceTransferReport,\x20%s,\x20%s',_0x5a5260,_0x3f4e74['error'][_0x1099('0x10')]);return _0x2d0153(_0x3f4e74[_0x1099('0xe')][_0x1099('0x10')]);}logger[_0x1099('0xe')](_0x1099('0x11'),_0x5a5260,_0x3f4e74[_0x1099('0xe')][_0x1099('0x10')]);return _0x257484(_0x3f4e74[_0x1099('0xe')]['message']);}else{logger['info'](_0x1099('0x11'),_0x5a5260,_0x1099('0xb'));_0x257484(_0x3f4e74['result'][_0x1099('0x10')]);}})[_0x1099('0x12')](function(_0x11e7ec){logger['error'](_0x1099('0x11'),_0x5a5260,_0x11e7ec);_0x2d0153(_0x11e7ec);});});}exports[_0x1099('0x13')]=function(_0x34c9af){var _0x323ac4=this;return new Promise(function(_0x2345a7,_0x11adf0){return db[_0x1099('0x14')][_0x1099('0x15')](_0x34c9af[_0x1099('0x16')],{'raw':_0x34c9af[_0x1099('0x17')]?_0x34c9af[_0x1099('0x17')][_0x1099('0x18')]===undefined?!![]:![]:!![]})[_0x1099('0x19')](function(_0x1c14e8){logger['info'](_0x1099('0x13'),_0x34c9af);logger[_0x1099('0x1a')]('CreateVoiceTransferReport',_0x34c9af,JSON[_0x1099('0xd')](_0x1c14e8));_0x2345a7(_0x1c14e8);})[_0x1099('0x12')](function(_0x16405d){logger['error'](_0x1099('0x13'),_0x16405d[_0x1099('0x10')],_0x34c9af);_0x11adf0(_0x323ac4[_0x1099('0xe')](0x1f4,_0x16405d['message']));});});}; \ No newline at end of file +var _0xe0e1=['request\x20sent','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateVoiceTransferReport','VoiceTransferReport','body','options','debug','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x9307ea,_0x38968a){var _0x295554=function(_0x342dcf){while(--_0x342dcf){_0x9307ea['push'](_0x9307ea['shift']());}};_0x295554(++_0x38968a);}(_0xe0e1,0x15d));var _0x1e0e=function(_0x356ff1,_0x2c0878){_0x356ff1=_0x356ff1-0x0;var _0x2465f0=_0xe0e1[_0x356ff1];return _0x2465f0;};'use strict';var _=require(_0x1e0e('0x0'));var util=require(_0x1e0e('0x1'));var moment=require('moment');var BPromise=require(_0x1e0e('0x2'));var rs=require(_0x1e0e('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1e0e('0x4'))['db'];var utils=require(_0x1e0e('0x5'));var logger=require(_0x1e0e('0x6'))('rpc');var config=require(_0x1e0e('0x7'));var jayson=require(_0x1e0e('0x8'));var client=jayson[_0x1e0e('0x9')][_0x1e0e('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3eb496,_0x2ea256,_0xfa6947){return new BPromise(function(_0x1aab4c,_0x5a30d2){return client[_0x1e0e('0xb')](_0x3eb496,_0xfa6947)[_0x1e0e('0xc')](function(_0x3da42b){logger[_0x1e0e('0xd')](_0x1e0e('0xe'),_0x2ea256,_0x1e0e('0xf'));logger['debug'](_0x1e0e('0x10'),_0x2ea256,'request\x20sent',JSON[_0x1e0e('0x11')](_0x3da42b));if(_0x3da42b[_0x1e0e('0x12')]){if(_0x3da42b['error'][_0x1e0e('0x13')]===0x1f4){logger[_0x1e0e('0x12')](_0x1e0e('0xe'),_0x2ea256,_0x3da42b[_0x1e0e('0x12')][_0x1e0e('0x14')]);return _0x5a30d2(_0x3da42b[_0x1e0e('0x12')][_0x1e0e('0x14')]);}logger[_0x1e0e('0x12')](_0x1e0e('0xe'),_0x2ea256,_0x3da42b[_0x1e0e('0x12')][_0x1e0e('0x14')]);return _0x1aab4c(_0x3da42b[_0x1e0e('0x12')][_0x1e0e('0x14')]);}else{logger[_0x1e0e('0xd')](_0x1e0e('0xe'),_0x2ea256,_0x1e0e('0xf'));_0x1aab4c(_0x3da42b[_0x1e0e('0x15')][_0x1e0e('0x14')]);}})[_0x1e0e('0x16')](function(_0x1abd63){logger[_0x1e0e('0x12')]('VoiceTransferReport,\x20%s,\x20%s',_0x2ea256,_0x1abd63);_0x5a30d2(_0x1abd63);});});}exports[_0x1e0e('0x17')]=function(_0x332b3f){var _0x2a332c=this;return new Promise(function(_0x50546e,_0x411195){return db[_0x1e0e('0x18')]['create'](_0x332b3f[_0x1e0e('0x19')],{'raw':_0x332b3f[_0x1e0e('0x1a')]?_0x332b3f[_0x1e0e('0x1a')]['raw']===undefined?!![]:![]:!![]})[_0x1e0e('0xc')](function(_0x1b17ed){logger[_0x1e0e('0xd')](_0x1e0e('0x17'),_0x332b3f);logger[_0x1e0e('0x1b')](_0x1e0e('0x17'),_0x332b3f,JSON[_0x1e0e('0x11')](_0x1b17ed));_0x50546e(_0x1b17ed);})['catch'](function(_0x304b00){logger[_0x1e0e('0x12')](_0x1e0e('0x17'),_0x304b00['message'],_0x332b3f);_0x411195(_0x2a332c[_0x1e0e('0x12')](0x1f4,_0x304b00['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 213d9aa..8052038 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa659=['catch','error','exit','./rpc','./config/logger','app','./config/pm2/config','./config/schedule','./config/schedule/chat','sync','then','listen','info','start','Online\x20apps:','map','join','Offline\x20apps:','filter','status','online','name','None','seedDB','./config/seedDB','default'];(function(_0x38b918,_0x23e6a6){var _0x5b4f44=function(_0x4b2a2c){while(--_0x4b2a2c){_0x38b918['push'](_0x38b918['shift']());}};_0x5b4f44(++_0x23e6a6);}(_0xa659,0x1a3));var _0x9a65=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa659[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x9a65('0x0'));var config=require('./config/environment');var logger=require(_0x9a65('0x1'))(_0x9a65('0x2'));var pm2=require('./config/pm2');var pm2Config=require(_0x9a65('0x3'));var schedule=require(_0x9a65('0x4'));var chat=require(_0x9a65('0x5'));function main(){return mysqldb['db']['sequelize'][_0x9a65('0x6')]()[_0x9a65('0x7')](function(){return rpc[_0x9a65('0x8')]();})[_0x9a65('0x7')](function(_0x4ccc1e){logger[_0x9a65('0x9')](_0x4ccc1e);return chat['start']();})[_0x9a65('0x7')](function(){return schedule[_0x9a65('0xa')]();})[_0x9a65('0x7')](function(_0x3cfd6b){logger[_0x9a65('0x9')](_0x3cfd6b);return pm2['start'](pm2Config);})[_0x9a65('0x7')](function(_0x2e9b42){logger[_0x9a65('0x9')](_0x9a65('0xb'),_[_0x9a65('0xc')](_['filter'](_0x2e9b42,{'status':'online'}),'name')[_0x9a65('0xd')]());logger['info'](_0x9a65('0xe'),_[_0x9a65('0xc')](_[_0x9a65('0xf')](_0x2e9b42,function(_0xa69692){return _0xa69692[_0x9a65('0x10')]!==_0x9a65('0x11');}),_0x9a65('0x12'))[_0x9a65('0xd')]()||_0x9a65('0x13'));config[_0x9a65('0x14')]&&require(_0x9a65('0x15'))[_0x9a65('0x16')]();require('./config/license')['default']();})[_0x9a65('0x17')](function(_0x235481){logger[_0x9a65('0x18')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x235481);process[_0x9a65('0x19')](0x1);});}main(); \ No newline at end of file +var _0xf02e=['lodash','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','sync','then','listen','info','start','Online\x20apps:','filter','online','name','join','Offline\x20apps:','map','status','seedDB','./config/seedDB','./config/license','default','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x4442cc,_0x4b8f77){var _0x5efbbe=function(_0x12de1a){while(--_0x12de1a){_0x4442cc['push'](_0x4442cc['shift']());}};_0x5efbbe(++_0x4b8f77);}(_0xf02e,0x134));var _0xef02=function(_0x49c3b8,_0x569ff5){_0x49c3b8=_0x49c3b8-0x0;var _0x5d78b3=_0xf02e[_0x49c3b8];return _0x5d78b3;};'use strict';var _=require(_0xef02('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0xef02('0x1'));var logger=require('./config/logger')(_0xef02('0x2'));var pm2=require(_0xef02('0x3'));var pm2Config=require(_0xef02('0x4'));var schedule=require(_0xef02('0x5'));var chat=require(_0xef02('0x6'));function main(){return mysqldb['db'][_0xef02('0x7')][_0xef02('0x8')]()[_0xef02('0x9')](function(){return rpc[_0xef02('0xa')]();})[_0xef02('0x9')](function(_0x2a36e3){logger[_0xef02('0xb')](_0x2a36e3);return chat[_0xef02('0xc')]();})[_0xef02('0x9')](function(){return schedule[_0xef02('0xc')]();})[_0xef02('0x9')](function(_0x4d3e3f){logger['info'](_0x4d3e3f);return pm2[_0xef02('0xc')](pm2Config);})[_0xef02('0x9')](function(_0x2279ea){logger[_0xef02('0xb')](_0xef02('0xd'),_['map'](_[_0xef02('0xe')](_0x2279ea,{'status':_0xef02('0xf')}),_0xef02('0x10'))[_0xef02('0x11')]());logger['info'](_0xef02('0x12'),_[_0xef02('0x13')](_[_0xef02('0xe')](_0x2279ea,function(_0x5b9060){return _0x5b9060[_0xef02('0x14')]!=='online';}),_0xef02('0x10'))[_0xef02('0x11')]()||'None');config[_0xef02('0x15')]&&require(_0xef02('0x16'))['default']();require(_0xef02('0x17'))[_0xef02('0x18')]();})['catch'](function(_0x5503fe){logger[_0xef02('0x19')](_0xef02('0x1a'),_0x5503fe);process[_0xef02('0x1b')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 189cc55..5e24559 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 _0x57ca=['smsPause','pauseType','showWebBar','lastPauseAt','allowmessenger','passwordResetAt','alias','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableDtmfTone','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','isAuthenticated','use','ChatInteraction','findOne','params','closed','disposition','then','unmanaged','Unmanaged.','Forbidden.','headers','authorization','startsWith','Basic','User','authenticate','pass','status','json','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','sub','isEqual','apiKeyNonce','nonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','update','Forbidden','signToken','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','motion.token','redirect','/dashboards/general','send','retrieveApiKey','isNil','generateApiKey','apiKeyIat','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','secret','promisify','verify','hex','floor','now','HS512','../../config/environment','../../config/license/hardware','jsonwebtoken','express-jwt','composable-middleware','basic-auth','crypto','secrets','session','role','fullname','name','internal','email','userpic','md5secret','chatPause','mailPause'];(function(_0x5edca4,_0x49d7a9){var _0x319e19=function(_0x5eabdc){while(--_0x5eabdc){_0x5edca4['push'](_0x5edca4['shift']());}};_0x319e19(++_0x49d7a9);}(_0x57ca,0x108));var _0xa57c=function(_0x436526,_0x15faed){_0x436526=_0x436526-0x0;var _0x436610=_0x57ca[_0x436526];return _0x436610;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xa57c('0x0'));var hardwareConf=require(_0xa57c('0x1'));var _=require('lodash');var jwt=require(_0xa57c('0x2'));var expressJwt=require(_0xa57c('0x3'));var compose=require(_0xa57c('0x4'));var basicAuth=require(_0xa57c('0x5'));var crypto=require(_0xa57c('0x6'));var BPromise=require('bluebird');var validateJwt=expressJwt({'secret':config[_0xa57c('0x7')][_0xa57c('0x8')]});var userAttributes=['id',_0xa57c('0x9'),_0xa57c('0xa'),_0xa57c('0xb'),_0xa57c('0xc'),_0xa57c('0xd'),_0xa57c('0xe'),'permissions',_0xa57c('0xf'),'voicePause',_0xa57c('0x10'),_0xa57c('0x11'),'faxPause',_0xa57c('0x12'),'openchannelPause',_0xa57c('0x13'),_0xa57c('0x14'),'lastLoginAt',_0xa57c('0x15'),'crudPermissions',_0xa57c('0x16'),_0xa57c('0x17'),_0xa57c('0x18'),_0xa57c('0x19'),_0xa57c('0x1a'),'phoneBarEnableRecording',_0xa57c('0x1b'),'phoneBarEnableSettings',_0xa57c('0x1c'),_0xa57c('0x1d'),_0xa57c('0x1e'),_0xa57c('0x1f'),_0xa57c('0x20'),_0xa57c('0x21'),_0xa57c('0x22')];exports['isChatInteractionAuthorized']=function(){return this[_0xa57c('0x23')](!![])[_0xa57c('0x24')](function(_0x261725,_0x5a6024,_0x2746a0){if(_0x261725['user']){_0x2746a0();}else{return db[_0xa57c('0x25')][_0xa57c('0x26')]({'where':{'id':_0x261725[_0xa57c('0x27')]['id']},'attributes':['id',_0xa57c('0x28'),_0xa57c('0x29')],'raw':!![]})[_0xa57c('0x2a')](function(_0x6f3f89){if(_0x6f3f89&&_0x6f3f89[_0xa57c('0x28')]){return _0x5a6024['status'](_0x6f3f89[_0xa57c('0x29')]==='unmanaged'?0x195:0x193)['json']({'message':_0x6f3f89[_0xa57c('0x29')]===_0xa57c('0x2b')?_0xa57c('0x2c'):_0xa57c('0x2d')});}else{_0x2746a0();}})['catch'](function(_0x348211){_0x2746a0(_0x348211);});}});};exports[_0xa57c('0x23')]=function isAuthenticated(_0x34d1bc){return compose()[_0xa57c('0x24')](function(_0x3bb969,_0x1404fd,_0x1e0192){if(_0x3bb969[_0xa57c('0x2e')][_0xa57c('0x2f')]){if(_[_0xa57c('0x30')](_0x3bb969[_0xa57c('0x2e')][_0xa57c('0x2f')],_0xa57c('0x31'))){var _0x10a33d=basicAuth(_0x3bb969);db[_0xa57c('0x32')]['find']({'where':{'name':_0x10a33d[_0xa57c('0xb')]}})[_0xa57c('0x2a')](function(_0x27884d){if(!_0x27884d||!_0x27884d[_0xa57c('0x33')](_0x10a33d[_0xa57c('0x34')])){return _0x1404fd[_0xa57c('0x35')](0x191)[_0xa57c('0x36')]({'message':_0xa57c('0x37')});}_0x3bb969[_0xa57c('0x38')]={'id':_0x27884d['id']};_0x1e0192();})[_0xa57c('0x39')](function(_0x57ebe0){_0x1e0192(_0x57ebe0);});}else if(_[_0xa57c('0x30')](_0x3bb969['headers']['authorization'],_0xa57c('0x3a'))){validateJwt(_0x3bb969,_0x1404fd,_0x1e0192);}else{if(_0x34d1bc){_0x1e0192();}else{return _0x1404fd[_0xa57c('0x35')](0x193)['json']({'message':_0xa57c('0x3b')});}}}else if(_0x3bb969[_0xa57c('0x3c')][_0xa57c('0x3d')]){try{var _0x57565b={'audience':hardwareConf[_0xa57c('0x3e')](),'issuer':hardwareConf['getUuid']()};verifyJwt(_0x3bb969[_0xa57c('0x3c')]['apikey'],_0x57565b)[_0xa57c('0x2a')](function(_0x51ad09){return db[_0xa57c('0x32')]['find']({'where':{'id':_0x51ad09[_0xa57c('0x3f')]}})[_0xa57c('0x2a')](function(_0x43c8f3){if(!_0x43c8f3||!_[_0xa57c('0x40')](_0x43c8f3[_0xa57c('0x41')],_0x51ad09[_0xa57c('0x42')])){return _0x1404fd[_0xa57c('0x35')](0x191)['json']({'message':_0xa57c('0x43')});}_0x3bb969['user']={'id':_0x43c8f3['id']};_0x1e0192();});})[_0xa57c('0x39')](function(){return _0x1404fd[_0xa57c('0x35')](0x191)[_0xa57c('0x36')]({'message':'Invalid\x20API\x20access\x20key'});});}catch(_0x289174){_0x1e0192(_0x289174);}}else if(_0x34d1bc){_0x1e0192();}else{return _0x1404fd['status'](0x193)[_0xa57c('0x36')]({'message':'Unknown\x20authorization\x20format'});}})[_0xa57c('0x24')](function(_0x494b8a,_0x433116,_0x46f03d){if(_0x494b8a['user']){db[_0xa57c('0x32')]['find']({'where':{'id':_0x494b8a[_0xa57c('0x38')]['id']},'attributes':userAttributes})['then'](function(_0x189d9b){if(!_0x189d9b){return _0x433116[_0xa57c('0x35')](0x194)[_0xa57c('0x36')]({'message':_0xa57c('0x44')});}_0x494b8a[_0xa57c('0x38')]=_0x189d9b;_0x46f03d();})[_0xa57c('0x39')](function(_0x59b8af){_0x46f03d(_0x59b8af);});}else if(_0x34d1bc){_0x46f03d();}else{return _0x433116['status'](0x194)[_0xa57c('0x36')]({'message':_0xa57c('0x45')});}});};exports[_0xa57c('0x46')]=function canUpdate(){return compose()['use'](function(_0x12b644,_0x5308d5,_0x203228){return require(_0xa57c('0x47'))['getLicense']()['then'](function(_0x5104c4){if(_0x5104c4[_0xa57c('0x48')]){_0x203228();}else{return _0x5308d5[_0xa57c('0x35')](0x193)[_0xa57c('0x36')]({'message':_0xa57c('0x49')});}})[_0xa57c('0x39')](function(_0x1b98a0){_0x203228(_0x1b98a0);});});};exports['isMiddleware']=function(_0x44b2a8,_0x1d4d2e,_0x5a5490){_0x44b2a8['isMiddleware']=!![];return _0x5a5490();};exports[_0xa57c('0x4a')]=function signToken(_0x203375){return signJwt(_0x203375);};exports['setTokenCookie']=function(_0x24459a,_0x5603cf){if(!_0x24459a[_0xa57c('0x38')]){return _0x5603cf[_0xa57c('0x35')](0x194)[_0xa57c('0x36')]({'message':_0xa57c('0x4b')});}var _0x5d210b={'payload':{'id':_0x24459a[_0xa57c('0x38')]['id'],'role':_0x24459a['user']['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x5d210b)['then'](function(_0x520383){_0x5603cf['cookie'](_0xa57c('0x4c'),_0x520383);_0x5603cf[_0xa57c('0x4d')](_0xa57c('0x4e'));})['catch'](function(_0x4cd045){return _0x5603cf['status'](0x1f4)[_0xa57c('0x4f')](_0x4cd045);});};exports[_0xa57c('0x50')]=function(_0x44e38f){if(_[_0xa57c('0x51')](_0x44e38f[_0xa57c('0x41')])||_[_0xa57c('0x51')](_0x44e38f['apiKeyIat'])){return null;}else{return createJwt(_0x44e38f);}};exports[_0xa57c('0x52')]=function(_0x22ea97){_0x22ea97[_0xa57c('0x41')]=generateNonce();_0x22ea97[_0xa57c('0x53')]=generateIssuedAt();return createJwt(_0x22ea97);};exports[_0xa57c('0x54')]=function(_0x3fe390,_0x4f2997){var _0x246f84=_0x3fe390[_0xa57c('0x3c')][_0xa57c('0x3d')];if(_0x246f84){var _0x14e943={'nonce':_0x4f2997[_0xa57c('0x41')],'iat':_0x4f2997['apiKeyIat'],'audience':hardwareConf[_0xa57c('0x3e')](),'issuer':hardwareConf[_0xa57c('0x3e')]()};return verifyJwt(_0x246f84,_0x14e943)[_0xa57c('0x2a')](function(){return generateApiKey(_0x4f2997);});}else{throw{'message':_0xa57c('0x55')};}};function signJwt(_0x7ba8ab){var _0x11fccc=BPromise['promisify'](jwt[_0xa57c('0x56')],{'context':jwt});var _0x3bafba=_0x7ba8ab[_0xa57c('0x57')]||config[_0xa57c('0x7')][_0xa57c('0x8')];return new BPromise(function(_0x4705e1,_0x57533e){_0x11fccc(_0x7ba8ab['payload'],_0x3bafba,_0x7ba8ab['options'])['then'](function(_0x232675){_0x4705e1(_0x232675);})['catch'](function(_0x273a17){_0x57533e(_0x273a17);});});}function verifyJwt(_0xae87,_0x4c6e43,_0x42daa4){var _0x320a5c=BPromise[_0xa57c('0x58')](jwt[_0xa57c('0x59')],{'context':jwt});var _0x3ef77c=_0x42daa4||config['secrets'][_0xa57c('0x8')];return new BPromise(function(_0x54a573,_0x4584e8){_0x320a5c(_0xae87,_0x3ef77c,_0x4c6e43)[_0xa57c('0x2a')](function(_0x2e4b84){_0x54a573(_0x2e4b84);})['catch'](function(_0x3765b5){_0x4584e8(_0x3765b5);});});}function generateNonce(){return crypto['randomBytes'](0x10)['toString'](_0xa57c('0x5a'));}function generateIssuedAt(){return Math[_0xa57c('0x5b')](Date[_0xa57c('0x5c')]()/0x3e8)['toString']();}function createJwt(_0x56d36c){var _0x10c281={'payload':{'iat':_0x56d36c[_0xa57c('0x53')],'nonce':_0x56d36c[_0xa57c('0x41')]},'options':{'algorithm':_0xa57c('0x5d'),'subject':_0x56d36c['id']['toString'](),'issuer':hardwareConf[_0xa57c('0x3e')](),'audience':hardwareConf[_0xa57c('0x3e')]()}};return signJwt(_0x10c281)[_0xa57c('0x2a')](function(_0x59eadc){return{'iat':_0x56d36c['apiKeyIat'],'nonce':_0x56d36c[_0xa57c('0x41')],'token':_0x59eadc};});} \ No newline at end of file +var _0xda2d=['crudPermissions','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','ChatInteraction','findOne','params','closed','disposition','then','status','unmanaged','json','Forbidden.','catch','headers','authorization','startsWith','User','find','authenticate','pass','Wrong\x20credentials.','user','Bearer','Unknown\x20authorization\x20format','query','apikey','getUuid','apiKeyNonce','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Invalid\x20API\x20access\x20key','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','getLicense','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','send','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','sign','options','promisify','verify','randomBytes','toString','hex','floor','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','bluebird','secrets','session','role','fullname','name','internal','email','userpic','permissions','voicePause','chatPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt'];(function(_0x3d6fb5,_0x239fbb){var _0x302c4d=function(_0x2724c4){while(--_0x2724c4){_0x3d6fb5['push'](_0x3d6fb5['shift']());}};_0x302c4d(++_0x239fbb);}(_0xda2d,0x102));var _0xdda2=function(_0x23652f,_0x3d7965){_0x23652f=_0x23652f-0x0;var _0x24d665=_0xda2d[_0x23652f];return _0x24d665;};'use strict';var db=require('../../mysqldb')['db'];var config=require(_0xdda2('0x0'));var hardwareConf=require(_0xdda2('0x1'));var _=require(_0xdda2('0x2'));var jwt=require(_0xdda2('0x3'));var expressJwt=require(_0xdda2('0x4'));var compose=require('composable-middleware');var basicAuth=require('basic-auth');var crypto=require('crypto');var BPromise=require(_0xdda2('0x5'));var validateJwt=expressJwt({'secret':config[_0xdda2('0x6')][_0xdda2('0x7')]});var userAttributes=['id',_0xdda2('0x8'),_0xdda2('0x9'),_0xdda2('0xa'),_0xdda2('0xb'),_0xdda2('0xc'),_0xdda2('0xd'),_0xdda2('0xe'),'md5secret',_0xdda2('0xf'),_0xdda2('0x10'),'mailPause',_0xdda2('0x11'),_0xdda2('0x12'),_0xdda2('0x13'),_0xdda2('0x14'),_0xdda2('0x15'),_0xdda2('0x16'),_0xdda2('0x17'),_0xdda2('0x18'),'allowmessenger','passwordResetAt','alias',_0xdda2('0x19'),_0xdda2('0x1a'),_0xdda2('0x1b'),_0xdda2('0x1c'),_0xdda2('0x1d'),_0xdda2('0x1e'),_0xdda2('0x1f'),'phoneBarRemoteControl',_0xdda2('0x20'),'hotdesk',_0xdda2('0x21'),_0xdda2('0x22')];exports[_0xdda2('0x23')]=function(){return this[_0xdda2('0x24')](!![])[_0xdda2('0x25')](function(_0x5d8a83,_0x55d674,_0x43f67b){if(_0x5d8a83['user']){_0x43f67b();}else{return db[_0xdda2('0x26')][_0xdda2('0x27')]({'where':{'id':_0x5d8a83[_0xdda2('0x28')]['id']},'attributes':['id',_0xdda2('0x29'),_0xdda2('0x2a')],'raw':!![]})[_0xdda2('0x2b')](function(_0x3ca127){if(_0x3ca127&&_0x3ca127[_0xdda2('0x29')]){return _0x55d674[_0xdda2('0x2c')](_0x3ca127[_0xdda2('0x2a')]===_0xdda2('0x2d')?0x195:0x193)[_0xdda2('0x2e')]({'message':_0x3ca127['disposition']===_0xdda2('0x2d')?'Unmanaged.':_0xdda2('0x2f')});}else{_0x43f67b();}})[_0xdda2('0x30')](function(_0xf994dc){_0x43f67b(_0xf994dc);});}});};exports['isAuthenticated']=function isAuthenticated(_0x347ee6){return compose()['use'](function(_0x425489,_0x107ee4,_0x4ac3eb){if(_0x425489[_0xdda2('0x31')][_0xdda2('0x32')]){if(_[_0xdda2('0x33')](_0x425489[_0xdda2('0x31')][_0xdda2('0x32')],'Basic')){var _0x38cdf=basicAuth(_0x425489);db[_0xdda2('0x34')][_0xdda2('0x35')]({'where':{'name':_0x38cdf[_0xdda2('0xa')]}})['then'](function(_0x4e97dc){if(!_0x4e97dc||!_0x4e97dc[_0xdda2('0x36')](_0x38cdf[_0xdda2('0x37')])){return _0x107ee4[_0xdda2('0x2c')](0x191)['json']({'message':_0xdda2('0x38')});}_0x425489[_0xdda2('0x39')]={'id':_0x4e97dc['id']};_0x4ac3eb();})[_0xdda2('0x30')](function(_0xe53dee){_0x4ac3eb(_0xe53dee);});}else if(_[_0xdda2('0x33')](_0x425489[_0xdda2('0x31')]['authorization'],_0xdda2('0x3a'))){validateJwt(_0x425489,_0x107ee4,_0x4ac3eb);}else{if(_0x347ee6){_0x4ac3eb();}else{return _0x107ee4[_0xdda2('0x2c')](0x193)['json']({'message':_0xdda2('0x3b')});}}}else if(_0x425489[_0xdda2('0x3c')][_0xdda2('0x3d')]){try{var _0x15e511={'audience':hardwareConf['getUuid'](),'issuer':hardwareConf[_0xdda2('0x3e')]()};verifyJwt(_0x425489[_0xdda2('0x3c')]['apikey'],_0x15e511)[_0xdda2('0x2b')](function(_0x5edf7e){return db[_0xdda2('0x34')]['find']({'where':{'id':_0x5edf7e['sub']}})['then'](function(_0x239c25){if(!_0x239c25||!_['isEqual'](_0x239c25[_0xdda2('0x3f')],_0x5edf7e['nonce'])){return _0x107ee4['status'](0x191)['json']({'message':_0xdda2('0x40')});}_0x425489[_0xdda2('0x39')]={'id':_0x239c25['id']};_0x4ac3eb();});})[_0xdda2('0x30')](function(){return _0x107ee4[_0xdda2('0x2c')](0x191)[_0xdda2('0x2e')]({'message':_0xdda2('0x41')});});}catch(_0x2bcfba){_0x4ac3eb(_0x2bcfba);}}else if(_0x347ee6){_0x4ac3eb();}else{return _0x107ee4[_0xdda2('0x2c')](0x193)[_0xdda2('0x2e')]({'message':_0xdda2('0x3b')});}})['use'](function(_0x461621,_0x4212da,_0x2f8674){if(_0x461621[_0xdda2('0x39')]){db[_0xdda2('0x34')][_0xdda2('0x35')]({'where':{'id':_0x461621[_0xdda2('0x39')]['id']},'attributes':userAttributes})['then'](function(_0x57269f){if(!_0x57269f){return _0x4212da[_0xdda2('0x2c')](0x194)[_0xdda2('0x2e')]({'message':_0xdda2('0x42')});}_0x461621['user']=_0x57269f;_0x2f8674();})['catch'](function(_0x871054){_0x2f8674(_0x871054);});}else if(_0x347ee6){_0x2f8674();}else{return _0x4212da[_0xdda2('0x2c')](0x194)[_0xdda2('0x2e')]({'message':_0xdda2('0x43')});}});};exports[_0xdda2('0x44')]=function canUpdate(){return compose()['use'](function(_0x1e7b94,_0x21fc6d,_0x497302){return require('../../config/license/util')[_0xdda2('0x45')]()[_0xdda2('0x2b')](function(_0x33fe97){if(_0x33fe97[_0xdda2('0x46')]){_0x497302();}else{return _0x21fc6d[_0xdda2('0x2c')](0x193)['json']({'message':_0xdda2('0x47')});}})[_0xdda2('0x30')](function(_0x7dac2c){_0x497302(_0x7dac2c);});});};exports[_0xdda2('0x48')]=function(_0x50c4ae,_0x4dc38f,_0x203972){_0x50c4ae[_0xdda2('0x48')]=!![];return _0x203972();};exports[_0xdda2('0x49')]=function signToken(_0x5a92e9){return signJwt(_0x5a92e9);};exports[_0xdda2('0x4a')]=function(_0x542ceb,_0x33a378){if(!_0x542ceb['user']){return _0x33a378[_0xdda2('0x2c')](0x194)[_0xdda2('0x2e')]({'message':_0xdda2('0x4b')});}var _0x2eec64={'payload':{'id':_0x542ceb['user']['id'],'role':_0x542ceb[_0xdda2('0x39')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x2eec64)[_0xdda2('0x2b')](function(_0x4d3b78){_0x33a378[_0xdda2('0x4c')](_0xdda2('0x4d'),_0x4d3b78);_0x33a378[_0xdda2('0x4e')](_0xdda2('0x4f'));})[_0xdda2('0x30')](function(_0x5acbb8){return _0x33a378[_0xdda2('0x2c')](0x1f4)[_0xdda2('0x50')](_0x5acbb8);});};exports['retrieveApiKey']=function(_0x2caced){if(_['isNil'](_0x2caced[_0xdda2('0x3f')])||_[_0xdda2('0x51')](_0x2caced[_0xdda2('0x52')])){return null;}else{return createJwt(_0x2caced);}};exports[_0xdda2('0x53')]=function(_0x3f1f9b){_0x3f1f9b[_0xdda2('0x3f')]=generateNonce();_0x3f1f9b[_0xdda2('0x52')]=generateIssuedAt();return createJwt(_0x3f1f9b);};exports[_0xdda2('0x54')]=function(_0xff55,_0x104a60){var _0x15a86c=_0xff55[_0xdda2('0x3c')][_0xdda2('0x3d')];if(_0x15a86c){var _0x4d22b3={'nonce':_0x104a60['apiKeyNonce'],'iat':_0x104a60['apiKeyIat'],'audience':hardwareConf[_0xdda2('0x3e')](),'issuer':hardwareConf[_0xdda2('0x3e')]()};return verifyJwt(_0x15a86c,_0x4d22b3)['then'](function(){return generateApiKey(_0x104a60);});}else{throw{'message':_0xdda2('0x55')};}};function signJwt(_0x18f229){var _0x22a99e=BPromise['promisify'](jwt[_0xdda2('0x56')],{'context':jwt});var _0x1fa4d0=_0x18f229['secret']||config['secrets'][_0xdda2('0x7')];return new BPromise(function(_0x5efd20,_0x17a9db){_0x22a99e(_0x18f229['payload'],_0x1fa4d0,_0x18f229[_0xdda2('0x57')])[_0xdda2('0x2b')](function(_0x50bd88){_0x5efd20(_0x50bd88);})['catch'](function(_0x3506ff){_0x17a9db(_0x3506ff);});});}function verifyJwt(_0x413f8a,_0x375741,_0x33f0b4){var _0x578a6c=BPromise[_0xdda2('0x58')](jwt[_0xdda2('0x59')],{'context':jwt});var _0x3d2cb0=_0x33f0b4||config[_0xdda2('0x6')][_0xdda2('0x7')];return new BPromise(function(_0x55528b,_0x1a56cc){_0x578a6c(_0x413f8a,_0x3d2cb0,_0x375741)[_0xdda2('0x2b')](function(_0x51f2b6){_0x55528b(_0x51f2b6);})[_0xdda2('0x30')](function(_0x123c2d){_0x1a56cc(_0x123c2d);});});}function generateNonce(){return crypto[_0xdda2('0x5a')](0x10)[_0xdda2('0x5b')](_0xdda2('0x5c'));}function generateIssuedAt(){return Math[_0xdda2('0x5d')](Date['now']()/0x3e8)[_0xdda2('0x5b')]();}function createJwt(_0x4a9814){var _0x361038={'payload':{'iat':_0x4a9814['apiKeyIat'],'nonce':_0x4a9814[_0xdda2('0x3f')]},'options':{'algorithm':'HS512','subject':_0x4a9814['id'][_0xdda2('0x5b')](),'issuer':hardwareConf[_0xdda2('0x3e')](),'audience':hardwareConf[_0xdda2('0x3e')]()}};return signJwt(_0x361038)[_0xdda2('0x2b')](function(_0xfc7dd7){return{'iat':_0x4a9814[_0xdda2('0x52')],'nonce':_0x4a9814[_0xdda2('0x3f')],'token':_0xfc7dd7};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 950d9d1..e63ef29 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 _0xb7e7=['crypto','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm','update','binary','write','end','final','createDecipher','data','close','unlink'];(function(_0x1b15de,_0x29bb53){var _0x31ddac=function(_0x38c77a){while(--_0x38c77a){_0x1b15de['push'](_0x1b15de['shift']());}};_0x31ddac(++_0x29bb53);}(_0xb7e7,0x121));var _0x7b7e=function(_0x1cb18a,_0x33167a){_0x1cb18a=_0x1cb18a-0x0;var _0x22442e=_0xb7e7[_0x1cb18a];return _0x22442e;};'use strict';var crypto=require(_0x7b7e('0x0'));var fs=require('fs');var BPromise=require('bluebird');var defaultOptions={'algorithm':_0x7b7e('0x1')};function combineOptions(_0x518dc6){var _0x1b7cc7={};for(var _0x54a37f in defaultOptions){if(defaultOptions[_0x7b7e('0x2')](_0x54a37f)){_0x1b7cc7[_0x54a37f]=defaultOptions[_0x54a37f];}}if(_0x518dc6){for(var _0x556d68 in _0x518dc6){if(_0x518dc6[_0x7b7e('0x2')](_0x556d68)){_0x1b7cc7[_0x556d68]=_0x518dc6[_0x556d68];}}}return _0x1b7cc7;}exports[_0x7b7e('0x3')]=function(_0x1d9384,_0x52047f,_0x53ed64,_0x333fa4){return new BPromise(function(_0x372bde,_0x7f87e0){_0x333fa4=combineOptions(_0x333fa4);var _0x55ce81=new Buffer(_0x53ed64);var _0x42b871=fs[_0x7b7e('0x4')](_0x1d9384);var _0x2917f9=fs[_0x7b7e('0x5')](_0x52047f);var _0x148964=crypto[_0x7b7e('0x6')](_0x333fa4[_0x7b7e('0x7')],_0x55ce81);_0x42b871['on']('data',function(_0x299519){var _0x1eef0a=new Buffer(_0x148964[_0x7b7e('0x8')](_0x299519),_0x7b7e('0x9'));_0x2917f9[_0x7b7e('0xa')](_0x1eef0a);});_0x42b871['on'](_0x7b7e('0xb'),function(){try{var _0x36d2a3=new Buffer(_0x148964[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x2917f9[_0x7b7e('0xa')](_0x36d2a3);_0x2917f9[_0x7b7e('0xb')]();_0x2917f9['on']('close',function(){return _0x372bde(_0x52047f);});}catch(_0x422d3a){fs['unlink'](_0x52047f);return _0x7f87e0(_0x422d3a);}});});};exports['decryptFile']=function(_0x2889ed,_0xd304f5,_0xf067da,_0x457ec5){return new BPromise(function(_0x3d2fb2,_0x5703fd){_0x457ec5=combineOptions(_0x457ec5);var _0x51baf6=new Buffer(_0xf067da);var _0xc7f087=fs[_0x7b7e('0x4')](_0x2889ed);var _0x27f999=fs[_0x7b7e('0x5')](_0xd304f5);var _0x2cc400=crypto[_0x7b7e('0xd')](_0x457ec5[_0x7b7e('0x7')],_0x51baf6);_0xc7f087['on'](_0x7b7e('0xe'),function(_0x2acb8c){var _0x429a0e=new Buffer(_0x2cc400[_0x7b7e('0x8')](_0x2acb8c),_0x7b7e('0x9'));_0x27f999[_0x7b7e('0xa')](_0x429a0e);});_0xc7f087['on'](_0x7b7e('0xb'),function(){try{var _0x9776c3=new Buffer(_0x2cc400[_0x7b7e('0xc')](_0x7b7e('0x9')),'binary');_0x27f999[_0x7b7e('0xa')](_0x9776c3);_0x27f999[_0x7b7e('0xb')]();_0x27f999['on'](_0x7b7e('0xf'),function(){return _0x3d2fb2(_0xd304f5);});}catch(_0x4c0647){fs[_0x7b7e('0x10')](_0xd304f5);return _0x5703fd(_0x4c0647);}});});}; \ No newline at end of file +var _0xa9e0=['update','close','crypto','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createCipher','algorithm','data','final','binary','write','end','unlink','decryptFile'];(function(_0x467a5b,_0x4e4b3c){var _0xa3e60a=function(_0x4c8159){while(--_0x4c8159){_0x467a5b['push'](_0x467a5b['shift']());}};_0xa3e60a(++_0x4e4b3c);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var crypto=require(_0x0a9e('0x0'));var fs=require('fs');var BPromise=require(_0x0a9e('0x1'));var defaultOptions={'algorithm':_0x0a9e('0x2')};function combineOptions(_0x5dd881){var _0x550fbc={};for(var _0x18d5c9 in defaultOptions){if(defaultOptions['hasOwnProperty'](_0x18d5c9)){_0x550fbc[_0x18d5c9]=defaultOptions[_0x18d5c9];}}if(_0x5dd881){for(var _0x333808 in _0x5dd881){if(_0x5dd881[_0x0a9e('0x3')](_0x333808)){_0x550fbc[_0x333808]=_0x5dd881[_0x333808];}}}return _0x550fbc;}exports[_0x0a9e('0x4')]=function(_0x991246,_0x981158,_0x57b080,_0x219af0){return new BPromise(function(_0x441e3a,_0x2cc193){_0x219af0=combineOptions(_0x219af0);var _0x5f41ea=new Buffer(_0x57b080);var _0x503809=fs[_0x0a9e('0x5')](_0x991246);var _0x56465b=fs['createWriteStream'](_0x981158);var _0x39753a=crypto[_0x0a9e('0x6')](_0x219af0[_0x0a9e('0x7')],_0x5f41ea);_0x503809['on'](_0x0a9e('0x8'),function(_0xfeb75b){var _0xbd1168=new Buffer(_0x39753a['update'](_0xfeb75b),'binary');_0x56465b['write'](_0xbd1168);});_0x503809['on']('end',function(){try{var _0x273d4d=new Buffer(_0x39753a[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x56465b[_0x0a9e('0xb')](_0x273d4d);_0x56465b[_0x0a9e('0xc')]();_0x56465b['on']('close',function(){return _0x441e3a(_0x981158);});}catch(_0x4283ce){fs[_0x0a9e('0xd')](_0x981158);return _0x2cc193(_0x4283ce);}});});};exports[_0x0a9e('0xe')]=function(_0x281129,_0x44dcfd,_0x4d5611,_0x52a03d){return new BPromise(function(_0x22dccb,_0x5d0880){_0x52a03d=combineOptions(_0x52a03d);var _0x1985b6=new Buffer(_0x4d5611);var _0x519dfd=fs[_0x0a9e('0x5')](_0x281129);var _0x12066b=fs['createWriteStream'](_0x44dcfd);var _0x225616=crypto['createDecipher'](_0x52a03d[_0x0a9e('0x7')],_0x1985b6);_0x519dfd['on'](_0x0a9e('0x8'),function(_0x106033){var _0x205fd6=new Buffer(_0x225616[_0x0a9e('0xf')](_0x106033),_0x0a9e('0xa'));_0x12066b[_0x0a9e('0xb')](_0x205fd6);});_0x519dfd['on'](_0x0a9e('0xc'),function(){try{var _0x1314ae=new Buffer(_0x225616[_0x0a9e('0x9')](_0x0a9e('0xa')),_0x0a9e('0xa'));_0x12066b['write'](_0x1314ae);_0x12066b[_0x0a9e('0xc')]();_0x12066b['on'](_0x0a9e('0x10'),function(){return _0x22dccb(_0x44dcfd);});}catch(_0x53682f){fs[_0x0a9e('0xd')](_0x44dcfd);return _0x5d0880(_0x53682f);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 97a9eec..af2850b 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 _0x0a9a=['num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','.csv','existsSync','mkdirSync','join','each','%s%d.%s','%s.%s','csv','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','Failed','path','to-csv','bluebird','zip-dir','rimraf','../../mysqldb','dbH','analytics','argv','savename','AnalyticExtractedReport','update','info','CSV','Setting','split','then','splitSizeCsv','sequelize','query','format','QueryTypes','SELECT'];(function(_0x30099e,_0x1ee4b2){var _0x474f63=function(_0x26f35a){while(--_0x26f35a){_0x30099e['push'](_0x30099e['shift']());}};_0x474f63(++_0x1ee4b2);}(_0x0a9a,0x183));var _0xa0a9=function(_0x4d2bf4,_0x2e1f3e){_0x4d2bf4=_0x4d2bf4-0x0;var _0x1ad42e=_0x0a9a[_0x4d2bf4];return _0x1ad42e;};'use strict';var util=require('util');var path=require(_0xa0a9('0x0'));var _=require('lodash');var csv=require(_0xa0a9('0x1'));var fs=require('fs');var BPromise=require(_0xa0a9('0x2'));var zipdir=require(_0xa0a9('0x3'));var rimraf=require(_0xa0a9('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xa0a9('0x5'))[_0xa0a9('0x6')];var logger=require('../../config/logger')(_0xa0a9('0x7'));var EXTRACTED_REPORT_ID=Number(process[_0xa0a9('0x8')][0x2]);var QUERY=process[_0xa0a9('0x8')][0x3];var PATH=process[_0xa0a9('0x8')][0x4];function analyticExtractedReport(_0x499a29,_0x2b2eb4){var _0x520f42={'status':_0x499a29};var _0x10aa8a={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2b2eb4){_0x520f42[_0xa0a9('0x9')]=_0x2b2eb4;}return db[_0xa0a9('0xa')][_0xa0a9('0xb')](_0x520f42,_0x10aa8a);}function main(){var _0x4b9b93=0x1388;var _0x2ba0ac;logger[_0xa0a9('0xc')](util['format']('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xa0a9('0xd')));return db[_0xa0a9('0xe')]['find']({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xa0a9('0xf'),'splitSizeCsv']})[_0xa0a9('0x10')](function(_0x4b7913){if(_0x4b7913){_0x2ba0ac=_0x4b7913;_0x4b9b93=_0x2ba0ac[_0xa0a9('0x11')]||0x1388;}})[_0xa0a9('0x10')](function(){return dbH[_0xa0a9('0x12')][_0xa0a9('0x13')](util[_0xa0a9('0x14')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0xa0a9('0x12')][_0xa0a9('0x15')][_0xa0a9('0x16')]});})[_0xa0a9('0x10')](function(_0x2f8b3c){if(!_0x2f8b3c[0x0][_0xa0a9('0x17')]){return analyticExtractedReport('Empty');}var _0x176faa=[];var _0x48c315=0x0;var _0x4a57dd=!![];if(_0x2f8b3c&&_0x2f8b3c[_0xa0a9('0x18')]){var _0x9f5abd=_0x2f8b3c[0x0][_0xa0a9('0x17')]%(_0x48c315+_0x4b9b93);if(_0x2ba0ac[_0xa0a9('0xf')]){for(;_0x4a57dd;_0x48c315+=_0x4b9b93,_0x9f5abd=_0x2f8b3c[0x0]['num']%(_0x48c315+_0x4b9b93)){if(_0x9f5abd==0x0||_0x9f5abd==_0x2f8b3c[0x0][_0xa0a9('0x17')]){_0x4a57dd=![];}_0x176faa[_0xa0a9('0x19')](dbH[_0xa0a9('0x12')][_0xa0a9('0x13')](util[_0xa0a9('0x14')](_0xa0a9('0x1a'),QUERY,_0x4b9b93,_0x48c315),{'type':dbH['sequelize'][_0xa0a9('0x15')][_0xa0a9('0x16')]}));}}else{_0x176faa['push'](dbH['sequelize'][_0xa0a9('0x13')](QUERY,{'type':dbH[_0xa0a9('0x12')][_0xa0a9('0x15')]['SELECT']}));}}var _0x307d7e=path['dirname'](PATH);var _0x1fb36b=path['basename'](PATH,_0xa0a9('0x1b'));var _0x504786=_0x2ba0ac[_0xa0a9('0xf')]&&_0x176faa[_0xa0a9('0x18')]>0x1;var _0x4938da=[];if(!fs[_0xa0a9('0x1c')](path['join'](_0x307d7e,_0x1fb36b))&&_0x504786){fs[_0xa0a9('0x1d')](path[_0xa0a9('0x1e')](_0x307d7e,_0x1fb36b));}return BPromise[_0xa0a9('0x1f')](_0x176faa,function(_0x252a14){_0x4938da['push'](_0x252a14);})[_0xa0a9('0x10')](function(){for(var _0xe49d3b=0x0;_0xe49d3b<_0x4938da[_0xa0a9('0x18')];_0xe49d3b+=0x1){var _0x3f4bea;var _0x526dd1=_0x4938da[_0xe49d3b];if(_0x504786){_0x3f4bea=path[_0xa0a9('0x1e')](_0x307d7e,_0x1fb36b,util[_0xa0a9('0x14')](_0xa0a9('0x20'),_0x1fb36b,_0xe49d3b,'csv'));}else{_0x3f4bea=path['join'](_0x307d7e,util[_0xa0a9('0x14')](_0xa0a9('0x21'),_0x1fb36b,_0xa0a9('0x22')));}fs[_0xa0a9('0x23')](_0x3f4bea,csv(_0x526dd1));}})[_0xa0a9('0x10')](function(){if(_0x504786){zipdir(path[_0xa0a9('0x1e')](_0x307d7e,_0x1fb36b),{'saveTo':path[_0xa0a9('0x1e')](_0x307d7e,util[_0xa0a9('0x14')](_0xa0a9('0x21'),_0x1fb36b,_0xa0a9('0x24')))},function(_0x41e994,_0x554191){});rimraf(path[_0xa0a9('0x1e')](_0x307d7e,_0x1fb36b),function(){});}})[_0xa0a9('0x10')](function(){logger['info'](util[_0xa0a9('0x14')](_0xa0a9('0x25'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport('Completed',_0x504786?util[_0xa0a9('0x14')]('%s.%s',_0x1fb36b,_0x504786?'zip':_0xa0a9('0x22')):null);});})[_0xa0a9('0x26')](function(_0x347cbf){logger[_0xa0a9('0xc')](util[_0xa0a9('0x14')](_0xa0a9('0x27'),EXTRACTED_REPORT_ID,_0xa0a9('0xd')),util['inspect'](_0x347cbf,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xa0a9('0x28'));});}main(); \ No newline at end of file +var _0xee5b=['rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','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','SELECT','Empty','length','num','push','sequelize','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','basename','.csv','existsSync','join','csv','%s.%s','zip','info','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','lodash','to-csv','zip-dir'];(function(_0x270a54,_0x307ff6){var _0x4d07d0=function(_0x59ac5a){while(--_0x59ac5a){_0x270a54['push'](_0x270a54['shift']());}};_0x4d07d0(++_0x307ff6);}(_0xee5b,0x1f4));var _0xbee5=function(_0xe813c9,_0x5db6c8){_0xe813c9=_0xe813c9-0x0;var _0x95eaf3=_0xee5b[_0xe813c9];return _0x95eaf3;};'use strict';var util=require(_0xbee5('0x0'));var path=require('path');var _=require(_0xbee5('0x1'));var csv=require(_0xbee5('0x2'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0xbee5('0x3'));var rimraf=require(_0xbee5('0x4'));var db=require(_0xbee5('0x5'))['db'];var dbH=require(_0xbee5('0x5'))['dbH'];var logger=require('../../config/logger')(_0xbee5('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xbee5('0x7')][0x2]);var QUERY=process[_0xbee5('0x7')][0x3];var PATH=process[_0xbee5('0x7')][0x4];function analyticExtractedReport(_0x4f5065,_0x5505e3){var _0x53d5b9={'status':_0x4f5065};var _0x5baf5c={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x5505e3){_0x53d5b9['savename']=_0x5505e3;}return db[_0xbee5('0x8')][_0xbee5('0x9')](_0x53d5b9,_0x5baf5c);}function main(){var _0x45c2c7=0x1388;var _0x20f717;logger['info'](util[_0xbee5('0xa')](_0xbee5('0xb'),EXTRACTED_REPORT_ID,_0xbee5('0xc')));return db[_0xbee5('0xd')][_0xbee5('0xe')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbee5('0xf'),_0xbee5('0x10')]})[_0xbee5('0x11')](function(_0xcef158){if(_0xcef158){_0x20f717=_0xcef158;_0x45c2c7=_0x20f717['splitSizeCsv']||0x1388;}})[_0xbee5('0x11')](function(){return dbH['sequelize'][_0xbee5('0x12')](util[_0xbee5('0xa')](_0xbee5('0x13'),QUERY),{'type':dbH['sequelize']['QueryTypes'][_0xbee5('0x14')]});})['then'](function(_0x40afcb){if(!_0x40afcb[0x0]['num']){return analyticExtractedReport(_0xbee5('0x15'));}var _0x141878=[];var _0xf676b1=0x0;var _0x53b269=!![];if(_0x40afcb&&_0x40afcb[_0xbee5('0x16')]){var _0x662d2c=_0x40afcb[0x0]['num']%(_0xf676b1+_0x45c2c7);if(_0x20f717[_0xbee5('0xf')]){for(;_0x53b269;_0xf676b1+=_0x45c2c7,_0x662d2c=_0x40afcb[0x0][_0xbee5('0x17')]%(_0xf676b1+_0x45c2c7)){if(_0x662d2c==0x0||_0x662d2c==_0x40afcb[0x0][_0xbee5('0x17')]){_0x53b269=![];}_0x141878[_0xbee5('0x18')](dbH[_0xbee5('0x19')][_0xbee5('0x12')](util[_0xbee5('0xa')](_0xbee5('0x1a'),QUERY,_0x45c2c7,_0xf676b1),{'type':dbH[_0xbee5('0x19')][_0xbee5('0x1b')][_0xbee5('0x14')]}));}}else{_0x141878[_0xbee5('0x18')](dbH[_0xbee5('0x19')][_0xbee5('0x12')](QUERY,{'type':dbH[_0xbee5('0x19')]['QueryTypes']['SELECT']}));}}var _0x469a7a=path['dirname'](PATH);var _0x205491=path[_0xbee5('0x1c')](PATH,_0xbee5('0x1d'));var _0x2bfb0f=_0x20f717[_0xbee5('0xf')]&&_0x141878[_0xbee5('0x16')]>0x1;var _0x359ccf=[];if(!fs[_0xbee5('0x1e')](path[_0xbee5('0x1f')](_0x469a7a,_0x205491))&&_0x2bfb0f){fs['mkdirSync'](path['join'](_0x469a7a,_0x205491));}return BPromise['each'](_0x141878,function(_0x519473){_0x359ccf['push'](_0x519473);})[_0xbee5('0x11')](function(){for(var _0x18d7f4=0x0;_0x18d7f4<_0x359ccf[_0xbee5('0x16')];_0x18d7f4+=0x1){var _0x28c74d;var _0x169042=_0x359ccf[_0x18d7f4];if(_0x2bfb0f){_0x28c74d=path[_0xbee5('0x1f')](_0x469a7a,_0x205491,util[_0xbee5('0xa')]('%s%d.%s',_0x205491,_0x18d7f4,_0xbee5('0x20')));}else{_0x28c74d=path[_0xbee5('0x1f')](_0x469a7a,util[_0xbee5('0xa')](_0xbee5('0x21'),_0x205491,_0xbee5('0x20')));}fs['writeFileSync'](_0x28c74d,csv(_0x169042));}})[_0xbee5('0x11')](function(){if(_0x2bfb0f){zipdir(path[_0xbee5('0x1f')](_0x469a7a,_0x205491),{'saveTo':path[_0xbee5('0x1f')](_0x469a7a,util[_0xbee5('0xa')](_0xbee5('0x21'),_0x205491,_0xbee5('0x22')))},function(_0x34b7df,_0x36e8bb){});rimraf(path[_0xbee5('0x1f')](_0x469a7a,_0x205491),function(){});}})['then'](function(){logger[_0xbee5('0x23')](util['format'](_0xbee5('0x24'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbee5('0x25'),_0x2bfb0f?util['format'](_0xbee5('0x21'),_0x205491,_0x2bfb0f?'zip':_0xbee5('0x20')):null);});})[_0xbee5('0x26')](function(_0x36eb70){logger[_0xbee5('0x23')](util['format'](_0xbee5('0x27'),EXTRACTED_REPORT_ID,_0xbee5('0xc')),util[_0xbee5('0x28')](_0x36eb70,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbee5('0x29'));});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index e0e59fb..d3c05a8 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 _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x499626,_0x2c3d35){var _0x2ba334=function(_0x36d133){while(--_0x36d133){_0x499626['push'](_0x499626['shift']());}};_0x2ba334(++_0x2c3d35);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file +var _0xd8b0=['format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','name','endDate','landscape','black','body','toString','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','pipe','finish','error','log','err','%s.%s','zip','Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed','CSV','Completed','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','lodash','bluebird','pdfmake/src/printer','zip-dir','rimraf','../../mysqldb','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','update','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','splitSizePdf','then','length','push','sequelize','query'];(function(_0x34700c,_0x47ced8){var _0xd79ac7=function(_0x17d123){while(--_0x17d123){_0x34700c['push'](_0x34700c['shift']());}};_0xd79ac7(++_0x47ced8);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var util=require('util');var path=require('path');var moment=require('moment');var PdfPrinter=require(_0x0d8b('0x2'));var zipdir=require(_0x0d8b('0x3'));var rimraf=require(_0x0d8b('0x4'));var db=require(_0x0d8b('0x5'))['db'];var dbH=require(_0x0d8b('0x5'))['dbH'];var logger=require('../../config/logger')(_0x0d8b('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0x0d8b('0x7')][0x2]);var QUERY=process[_0x0d8b('0x7')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0x0d8b('0x7')][0x5];var FORMAT=_0x0d8b('0x8');var _extractedReport;function analyticExtractedReport(_0x58e4e2,_0x129310){var _0x348e65={'status':_0x58e4e2};var _0x3b027f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x129310){_0x348e65[_0x0d8b('0x9')]=_0x129310;}return db[_0x0d8b('0xa')][_0x0d8b('0xb')](_0x348e65,_0x3b027f);}function getHeader(_0x2c5e9e){var _0x28f87c=[];for(var _0x48fa16 in _0x2c5e9e){if(_0x2c5e9e[_0x0d8b('0xc')](_0x48fa16)){_0x28f87c['push']({'text':_0x48fa16,'style':_0x0d8b('0xd')});}}return _0x28f87c;}function extractReport(_0xc574a3){var _0x340cc4=0x1388;var _0x92cdd8;if(!_0xc574a3[0x0][_0x0d8b('0xe')]){return analyticExtractedReport(_0x0d8b('0xf'));}var _0x15dd0f=[];var _0x31a8cc=0x0;var _0x1d4bbc=!![];var _0x2ce75e=path[_0x0d8b('0x10')](PATH);var _0xe65334=path[_0x0d8b('0x11')](PATH,_0x0d8b('0x12'));var _0x4f6f21=![];var _0x23eb7b=[];return db[_0x0d8b('0x13')][_0x0d8b('0x14')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x0d8b('0x15'),_0x0d8b('0x16')]})['then'](function(_0x106a01){if(_0x106a01){_0x92cdd8=_0x106a01;_0x340cc4=_0x92cdd8[_0x0d8b('0x16')]||0x3e8;}})[_0x0d8b('0x17')](function(){if(_0xc574a3&&_0xc574a3[_0x0d8b('0x18')]){var _0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4);if(_0x92cdd8[_0x0d8b('0x15')]){for(;_0x1d4bbc;_0x31a8cc+=_0x340cc4,_0x333674=_0xc574a3[0x0][_0x0d8b('0xe')]%(_0x31a8cc+_0x340cc4)){if(_0x333674==0x0||_0x333674==_0xc574a3[0x0]['num']){_0x1d4bbc=![];}_0x15dd0f[_0x0d8b('0x19')](dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')](_0x0d8b('0x1d'),QUERY,_0x340cc4,_0x31a8cc),{'type':dbH[_0x0d8b('0x1a')][_0x0d8b('0x1e')][_0x0d8b('0x1f')]}));}}else{_0x15dd0f['push'](dbH['sequelize'][_0x0d8b('0x1b')](QUERY,{'type':dbH['sequelize']['QueryTypes']['SELECT']}));}}_0x4f6f21=_0x92cdd8[_0x0d8b('0x15')]&&_0x15dd0f[_0x0d8b('0x18')]>0x1;if(!fs[_0x0d8b('0x20')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334))&&_0x4f6f21){fs[_0x0d8b('0x22')](path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334));}return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4562cb){_0x23eb7b[_0x0d8b('0x19')](_0x4562cb);});})['then'](function(){return BPromise[_0x0d8b('0x23')](_0x15dd0f,function(_0x4463ee,_0x5363e3){var _0xe1ef20;var _0x4a0ae4=util[_0x0d8b('0x1c')](_0x0d8b('0x24'),NAME,_extractedReport[_0x0d8b('0x25')],moment(_extractedReport['startDate'])['format'](FORMAT),moment(_extractedReport[_0x0d8b('0x26')])[_0x0d8b('0x1c')](FORMAT));var _0x4c05ee={'pageSize':'A4','pageOrientation':_0x0d8b('0x27'),'content':[{'text':_0x4a0ae4,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0x0d8b('0x28')}}};var _0x4b59e5={'headerRows':0x1,'body':[]};_0x4b59e5[_0x0d8b('0x29')]['push'](getHeader(_0x4463ee[0x0]));var _0x2ab00d;for(var _0x546bf6=0x0;_0x546bf6<_0x4463ee[_0x0d8b('0x18')];_0x546bf6+=0x1){_0x2ab00d=[];for(var _0x544735 in _0x4463ee[_0x546bf6]){if(_0x4463ee[_0x546bf6][_0x0d8b('0xc')](_0x544735)){_0x2ab00d[_0x0d8b('0x19')](_0x4463ee[_0x546bf6][_0x544735]?_[_0x0d8b('0x2a')](_0x4463ee[_0x546bf6][_0x544735]):'');}}_0x4b59e5['body']['push'](_0x2ab00d);}_0x4c05ee['content'][_0x0d8b('0x19')]({'table':_0x4b59e5});return new BPromise(function(_0x5515d2,_0x3cdf3c){var _0x54f6f3=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0x0d8b('0x2b'),'italics':__dirname+_0x0d8b('0x2c'),'bolditalics':__dirname+_0x0d8b('0x2d')}});var _0xdeee5d=_0x54f6f3[_0x0d8b('0x2e')](_0x4c05ee);if(_0x4f6f21){_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334,util[_0x0d8b('0x1c')](_0x0d8b('0x2f'),_0xe65334,_0x5363e3,'pdf'));}else{_0xe1ef20=path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')]('%s.%s',_0xe65334,_0x0d8b('0x30')));}var _0x23f7f6=_0xdeee5d[_0x0d8b('0x31')](fs['createWriteStream'](_0xe1ef20));_0x23f7f6['on'](_0x0d8b('0x32'),function(){_0x5515d2();});_0x23f7f6['on'](_0x0d8b('0x33'),function(_0x206157){console[_0x0d8b('0x34')](_0x0d8b('0x35'),_0x206157);_0x3cdf3c(_0x206157);});_0xdeee5d['end']();});});})[_0x0d8b('0x17')](function(){if(_0x4f6f21){return new BPromise(function(_0x1649fc,_0x5ad0fe){zipdir(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),{'saveTo':path[_0x0d8b('0x21')](_0x2ce75e,util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x0d8b('0x37')))},function(_0x519088){if(_0x519088){_0x5ad0fe(_0x519088);}else{_0x1649fc();}});});}})['then'](function(){if(_0x4f6f21){rimraf(path[_0x0d8b('0x21')](_0x2ce75e,_0xe65334),function(){});}})['then'](function(){logger['info'](util[_0x0d8b('0x1c')](_0x0d8b('0x38'),EXTRACTED_REPORT_ID,_0x0d8b('0x39')));return analyticExtractedReport(_0x0d8b('0x3a'),_0x4f6f21?util[_0x0d8b('0x1c')](_0x0d8b('0x36'),_0xe65334,_0x4f6f21?'zip':_0x0d8b('0x30')):null);});}function main(){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x3c'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')));return db[_0x0d8b('0xa')][_0x0d8b('0x3e')]({'where':{'id':EXTRACTED_REPORT_ID}})['then'](function(_0x1d06b6){_extractedReport=_0x1d06b6;return dbH[_0x0d8b('0x1a')][_0x0d8b('0x1b')](util[_0x0d8b('0x1c')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x0d8b('0x1a')]['QueryTypes'][_0x0d8b('0x1f')]});})[_0x0d8b('0x17')](extractReport)[_0x0d8b('0x3f')](function(_0x26ac10){logger[_0x0d8b('0x3b')](util[_0x0d8b('0x1c')](_0x0d8b('0x40'),EXTRACTED_REPORT_ID,_0x0d8b('0x3d')),util[_0x0d8b('0x41')](_0x26ac10,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x0d8b('0x42'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index d83c298..873437c 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 _0xd69e=['SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','QueryTypes','SELECT','num','Empty','split','length','query','push','basename','.xlsx','existsSync','join','mkdirSync','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','zip','XLSX','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','Failed','util','path','lodash','bluebird','zip-dir','../../config/logger','argv','AnalyticExtractedReport','update','info','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','splitSizeXlsx','then','format'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xd69e,0xa0));var _0xed69=function(_0x5f0089,_0x227e2c){_0x5f0089=_0x5f0089-0x0;var _0x193892=_0xd69e[_0x5f0089];return _0x193892;};'use strict';var util=require(_0xed69('0x0'));var path=require(_0xed69('0x1'));var _=require(_0xed69('0x2'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xed69('0x3'));var zipdir=require(_0xed69('0x4'));var rimraf=require('rimraf');var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')['dbH'];var logger=require(_0xed69('0x5'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0xed69('0x6')][0x3];var PATH=process[_0xed69('0x6')][0x4];function analyticExtractedReport(_0xd7eed4,_0x20a74f){var _0x4bcb61={'status':_0xd7eed4};var _0x3dec07={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x20a74f){_0x4bcb61['savename']=_0x20a74f;}return db[_0xed69('0x7')][_0xed69('0x8')](_0x4bcb61,_0x3dec07);}function main(){var _0x47da53=0x1388;var _0x2dc08a;logger[_0xed69('0x9')](util['format'](_0xed69('0xa'),EXTRACTED_REPORT_ID,'XLSX'));return db[_0xed69('0xb')][_0xed69('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0xed69('0xd')]})['then'](function(_0x456e35){if(_0x456e35){_0x2dc08a=_0x456e35;_0x47da53=_0x2dc08a[_0xed69('0xd')]||0x1388;}})[_0xed69('0xe')](function(){return dbH['sequelize']['query'](util[_0xed69('0xf')](_0xed69('0x10'),QUERY),{'type':dbH[_0xed69('0x11')][_0xed69('0x12')][_0xed69('0x13')]});})['then'](function(_0xc03c8d){if(!_0xc03c8d[0x0][_0xed69('0x14')]){return analyticExtractedReport(_0xed69('0x15'));}var _0x118ab3=[];var _0x35d924=0x0;var _0x2990fa=!![];if(_0x2dc08a[_0xed69('0x16')]){if(_0xc03c8d&&_0xc03c8d[_0xed69('0x17')]){var _0x1e7446=_0xc03c8d[0x0][_0xed69('0x14')]%(_0x35d924+_0x47da53);for(;_0x2990fa;_0x35d924+=_0x47da53,_0x1e7446=_0xc03c8d[0x0]['num']%(_0x35d924+_0x47da53)){if(_0x1e7446==0x0||_0x1e7446==_0xc03c8d[0x0]['num']){_0x2990fa=![];}_0x118ab3['push'](dbH[_0xed69('0x11')][_0xed69('0x18')](util[_0xed69('0xf')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x47da53,_0x35d924),{'type':dbH[_0xed69('0x11')][_0xed69('0x12')]['SELECT']}));}}}else{_0x118ab3[_0xed69('0x19')](dbH[_0xed69('0x11')][_0xed69('0x18')](QUERY,{'type':dbH[_0xed69('0x11')]['QueryTypes'][_0xed69('0x13')]}));}var _0x465e97=path['dirname'](PATH);var _0x12a1b7=path[_0xed69('0x1a')](PATH,_0xed69('0x1b'));var _0x176fd1=_0x2dc08a[_0xed69('0x16')]&&_0x118ab3[_0xed69('0x17')]>0x1;var _0x513337=[];if(!fs[_0xed69('0x1c')](path[_0xed69('0x1d')](_0x465e97,_0x12a1b7))&&_0x176fd1){fs[_0xed69('0x1e')](path[_0xed69('0x1d')](_0x465e97,_0x12a1b7));}return BPromise[_0xed69('0x1f')](_0x118ab3,function(_0xd182bd){_0x513337[_0xed69('0x19')](_0xd182bd);})[_0xed69('0xe')](function(){for(var _0x2156ad=0x0;_0x2156ad<_0x513337[_0xed69('0x17')];_0x2156ad+=0x1){var _0x360fa5;var _0x4c2986=_0x513337[_0x2156ad];if(_0x176fd1){_0x360fa5=path['join'](_0x465e97,_0x12a1b7,util[_0xed69('0xf')](_0xed69('0x20'),_0x12a1b7,_0x2156ad,_0xed69('0x21')));}else{_0x360fa5=path[_0xed69('0x1d')](_0x465e97,util[_0xed69('0xf')](_0xed69('0x22'),_0x12a1b7,_0xed69('0x21')));}fs[_0xed69('0x23')](_0x360fa5,json2xls(_0x4c2986),_0xed69('0x24'));}})[_0xed69('0xe')](function(){if(_0x176fd1){zipdir(path['join'](_0x465e97,_0x12a1b7),{'saveTo':path['join'](_0x465e97,util[_0xed69('0xf')]('%s.%s',_0x12a1b7,_0xed69('0x25')))},function(_0x234c8a,_0x164316){});rimraf(path[_0xed69('0x1d')](_0x465e97,_0x12a1b7),function(){});}})[_0xed69('0xe')](function(){logger[_0xed69('0x9')](util[_0xed69('0xf')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xed69('0x26')));return analyticExtractedReport(_0xed69('0x27'),_0x176fd1?util[_0xed69('0xf')](_0xed69('0x22'),_0x12a1b7,_0x176fd1?_0xed69('0x25'):_0xed69('0x21')):null);});})[_0xed69('0x28')](function(_0x4b23b6){logger['info'](util[_0xed69('0xf')](_0xed69('0x29'),EXTRACTED_REPORT_ID,_0xed69('0x26')),util[_0xed69('0x2a')](_0x4b23b6,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xed69('0x2b'));});}main(); \ No newline at end of file +var _0x5241=['basename','.xlsx','mkdirSync','join','each','%s%d.%s','xlsx','%s.%s','writeFileSync','binary','Completed','zip','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','util','lodash','json2xls','bluebird','zip-dir','rimraf','../../mysqldb','../../config/logger','analytics','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','Setting','find','splitSizeXlsx','then','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','sequelize','SELECT','num','Empty','split','length','query','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','dirname'];(function(_0xe6e7d8,_0x18deef){var _0x34ee99=function(_0x488540){while(--_0x488540){_0xe6e7d8['push'](_0xe6e7d8['shift']());}};_0x34ee99(++_0x18deef);}(_0x5241,0x9f));var _0x1524=function(_0x49a91e,_0x2d7a82){_0x49a91e=_0x49a91e-0x0;var _0x44ae74=_0x5241[_0x49a91e];return _0x44ae74;};'use strict';var util=require(_0x1524('0x0'));var path=require('path');var _=require(_0x1524('0x1'));var fs=require('fs');var json2xls=require(_0x1524('0x2'));var BPromise=require(_0x1524('0x3'));var zipdir=require(_0x1524('0x4'));var rimraf=require(_0x1524('0x5'));var db=require(_0x1524('0x6'))['db'];var dbH=require(_0x1524('0x6'))['dbH'];var logger=require(_0x1524('0x7'))(_0x1524('0x8'));var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x1524('0x9')][0x3];var PATH=process[_0x1524('0x9')][0x4];function analyticExtractedReport(_0x21e8f5,_0x37c0b5){var _0x2dfd2f={'status':_0x21e8f5};var _0x46fe5e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x37c0b5){_0x2dfd2f[_0x1524('0xa')]=_0x37c0b5;}return db[_0x1524('0xb')][_0x1524('0xc')](_0x2dfd2f,_0x46fe5e);}function main(){var _0x5f6bda=0x1388;var _0x556557;logger[_0x1524('0xd')](util[_0x1524('0xe')](_0x1524('0xf'),EXTRACTED_REPORT_ID,_0x1524('0x10')));return db[_0x1524('0x11')][_0x1524('0x12')]({'where':{'id':0x1},'raw':!![],'attributes':['id','split',_0x1524('0x13')]})[_0x1524('0x14')](function(_0x413f46){if(_0x413f46){_0x556557=_0x413f46;_0x5f6bda=_0x556557[_0x1524('0x13')]||0x1388;}})[_0x1524('0x14')](function(){return dbH['sequelize']['query'](util[_0x1524('0xe')](_0x1524('0x15'),QUERY),{'type':dbH[_0x1524('0x16')]['QueryTypes'][_0x1524('0x17')]});})[_0x1524('0x14')](function(_0x10e7b8){if(!_0x10e7b8[0x0][_0x1524('0x18')]){return analyticExtractedReport(_0x1524('0x19'));}var _0x4510b3=[];var _0x4f4c65=0x0;var _0x3ccda4=!![];if(_0x556557[_0x1524('0x1a')]){if(_0x10e7b8&&_0x10e7b8[_0x1524('0x1b')]){var _0x2d33b3=_0x10e7b8[0x0][_0x1524('0x18')]%(_0x4f4c65+_0x5f6bda);for(;_0x3ccda4;_0x4f4c65+=_0x5f6bda,_0x2d33b3=_0x10e7b8[0x0][_0x1524('0x18')]%(_0x4f4c65+_0x5f6bda)){if(_0x2d33b3==0x0||_0x2d33b3==_0x10e7b8[0x0][_0x1524('0x18')]){_0x3ccda4=![];}_0x4510b3['push'](dbH[_0x1524('0x16')][_0x1524('0x1c')](util[_0x1524('0xe')](_0x1524('0x1d'),QUERY,_0x5f6bda,_0x4f4c65),{'type':dbH['sequelize'][_0x1524('0x1e')][_0x1524('0x17')]}));}}}else{_0x4510b3[_0x1524('0x1f')](dbH[_0x1524('0x16')]['query'](QUERY,{'type':dbH[_0x1524('0x16')][_0x1524('0x1e')][_0x1524('0x17')]}));}var _0xa5ffee=path[_0x1524('0x20')](PATH);var _0x5557c6=path[_0x1524('0x21')](PATH,_0x1524('0x22'));var _0xeeef1e=_0x556557[_0x1524('0x1a')]&&_0x4510b3[_0x1524('0x1b')]>0x1;var _0x3b1974=[];if(!fs['existsSync'](path['join'](_0xa5ffee,_0x5557c6))&&_0xeeef1e){fs[_0x1524('0x23')](path[_0x1524('0x24')](_0xa5ffee,_0x5557c6));}return BPromise[_0x1524('0x25')](_0x4510b3,function(_0x43e8ce){_0x3b1974[_0x1524('0x1f')](_0x43e8ce);})[_0x1524('0x14')](function(){for(var _0x8673b6=0x0;_0x8673b6<_0x3b1974[_0x1524('0x1b')];_0x8673b6+=0x1){var _0x58aee7;var _0x49e4fb=_0x3b1974[_0x8673b6];if(_0xeeef1e){_0x58aee7=path[_0x1524('0x24')](_0xa5ffee,_0x5557c6,util['format'](_0x1524('0x26'),_0x5557c6,_0x8673b6,_0x1524('0x27')));}else{_0x58aee7=path[_0x1524('0x24')](_0xa5ffee,util[_0x1524('0xe')](_0x1524('0x28'),_0x5557c6,_0x1524('0x27')));}fs[_0x1524('0x29')](_0x58aee7,json2xls(_0x49e4fb),_0x1524('0x2a'));}})[_0x1524('0x14')](function(){if(_0xeeef1e){zipdir(path[_0x1524('0x24')](_0xa5ffee,_0x5557c6),{'saveTo':path[_0x1524('0x24')](_0xa5ffee,util[_0x1524('0xe')](_0x1524('0x28'),_0x5557c6,'zip'))},function(_0x551125,_0x596161){});rimraf(path[_0x1524('0x24')](_0xa5ffee,_0x5557c6),function(){});}})[_0x1524('0x14')](function(){logger[_0x1524('0xd')](util[_0x1524('0xe')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'XLSX'));return analyticExtractedReport(_0x1524('0x2b'),_0xeeef1e?util[_0x1524('0xe')](_0x1524('0x28'),_0x5557c6,_0xeeef1e?_0x1524('0x2c'):'xlsx'):null);});})[_0x1524('0x2d')](function(_0xe10d61){logger['info'](util[_0x1524('0xe')](_0x1524('0x2e'),EXTRACTED_REPORT_ID,'XLSX'),util['inspect'](_0xe10d61,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0x1524('0x2f'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index f0778e0..4e5b8c0 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 _0x46a4=['CDR(destination)=','${EXTEN:','cutdigits','priority','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=noprefix','recordingFormat','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','intervals','hasOwnProperty','tag','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','indexOf','app','custom','answer','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','GotoIfTime',',${EXTEN},','last','concat','Hangup','destroy','bulkCreate','catch','error','lodash','util','models','Interval','findAll','then','IntervalId','VoiceExtension','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','extensions','extension','find','push','type','format','CDR(type)=%s','context','VoiceExtensionId','Set'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x46a4,0x190));var _0x446a=function(_0x2cd52f,_0x1783ff){_0x2cd52f=_0x2cd52f-0x0;var _0x5da257=_0x46a4[_0x2cd52f];return _0x5da257;};'use strict';var _=require(_0x446a('0x0'));var util=require(_0x446a('0x1'));function rewrite(_0x59f976,_0x2102ab){var _0x2ffe6e=this;return _0x59f976[_0x446a('0x2')][_0x446a('0x3')][_0x446a('0x4')]({'raw':!![]})[_0x446a('0x5')](function(_0x420d8a){_0x2ffe6e['intervals']=_0x420d8a;return _0x59f976[_0x446a('0x2')]['VoiceExtension'][_0x446a('0x4')]({'where':{'IntervalId':_0x2102ab[_0x446a('0x6')]},'raw':!![]});})[_0x446a('0x5')](function(_0x2f7fe2){return _0x59f976[_0x446a('0x2')][_0x446a('0x7')][_0x446a('0x4')]({'where':{'exten':{'$in':_[_0x446a('0x8')](_[_0x446a('0x9')](_0x2f7fe2,_0x446a('0xa')))}},'order':[{'raw':_0x446a('0xb')}],'raw':!![]});})[_0x446a('0x5')](function(_0x353e89){var _0x29ff05=_[_0x446a('0xc')](_0x353e89,{'priority':'1'});var _0x8d13d=_[_0x446a('0xc')](_0x353e89,{'isApp':0x1});var _0x44b92d=_[_0x446a('0xd')](_0x8d13d,_0x446a('0xa'));var _0xbfb43c=[_0x446a('0xe'),_0x446a('0xf')];var _0x24fe39=[];var _0x42846a=[];for(var _0x6afce0 in _0x44b92d){if(_0x44b92d['hasOwnProperty'](_0x6afce0)){_0x2ffe6e['priority']=0x2;_0x2ffe6e[_0x446a('0x10')]=[];_0x2ffe6e[_0x446a('0x11')]=_[_0x446a('0x12')](_0x29ff05,{'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')]});_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':'Set','appdata':util[_0x446a('0x15')](_0x446a('0x16'),_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')]),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e['priority']++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});if(_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')]==='outbound'){if(_0x2ffe6e[_0x446a('0x11')]){_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x1a')+(_0x2ffe6e['extension']['cutdigits']?_0x446a('0x1b')+_0x2ffe6e[_0x446a('0x11')][_0x446a('0x1c')]+'}':'${EXTEN}'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e[_0x446a('0x1d')]++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});}_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':'Set','appdata':'CDR(routeid)='+_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')],'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e[_0x446a('0x1d')]++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});var _0x2e5be6=_0x2ffe6e[_0x446a('0x1d')]++;_0x2ffe6e['extensions'][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x1e'),'appdata':_0x446a('0x1f')+(_0x2e5be6+0x2)+_0x446a('0x20')+(_0x2e5be6+0x1)+')','context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2e5be6,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});if(_0x2ffe6e[_0x446a('0x11')]){_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x2ffe6e[_0x446a('0x11')][_0x446a('0x1c')]?'CDR(prefix)=${EXTEN:0:'+_0x2ffe6e['extension']['cutdigits']+'}':_0x446a('0x21'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e[_0x446a('0x1d')]++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});}_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0]['type'],'app':_0x446a('0x19'),'appdata':'outboundrouteid='+_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')],'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e['priority']++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});if(_0x2ffe6e[_0x446a('0x11')]&&_0x2ffe6e[_0x446a('0x11')]['hasOwnProperty'](_0x446a('0x22'))&&_0x2ffe6e[_0x446a('0x11')]['recordingFormat']!=='none'){_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x23'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e['priority']++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x24')+_0x2ffe6e[_0x446a('0x11')]['recordingFormat']||_0x446a('0x25'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e['priority']++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});}}_0x2ffe6e[_0x446a('0x10')]['push']({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x26'),'context':_0x44b92d[_0x6afce0][0x0]['context'],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e['priority']++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0]['type'],'app':_0x446a('0x19'),'appdata':_0x446a('0x27'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e[_0x446a('0x1d')]++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});_0x2ffe6e[_0x446a('0x10')][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0]['type'],'app':_0x446a('0x19'),'appdata':_0x446a('0x28'),'context':_0x44b92d[_0x6afce0][0x0][_0x446a('0x17')],'exten':_0x44b92d[_0x6afce0][0x0][_0x446a('0xa')],'priority':_0x2ffe6e[_0x446a('0x1d')]++,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});for(var _0x35ae90=0x0,_0x366119=0x0;_0x35ae90<_0x44b92d[_0x6afce0][_0x446a('0x29')];_0x35ae90+=0x1,_0x366119=0x0){var _0x41b14c=_0x44b92d[_0x6afce0][_0x35ae90];if(_0x41b14c[_0x446a('0x14')]){_0x41b14c['type']=_0x41b14c[_0x446a('0x14')][_0x446a('0x2a')]();}var _0xb826c4=[];var _0x40908b=[];delete _0x41b14c['id'];delete _0x41b14c[_0x446a('0x2b')];delete _0x41b14c[_0x446a('0x2c')];var _0xccd1f7=_0x41b14c[_0x446a('0x2d')]!==_0x446a('0x2e')?[_0x41b14c['interval']]:_0x41b14c['IntervalId']?_[_0x446a('0x9')](_[_0x446a('0xc')](_0x2ffe6e[_0x446a('0x2f')],{'IntervalId':_0x41b14c['IntervalId']}),'interval'):[];if(_0x41b14c[_0x446a('0x30')](_0x446a('0x31'))){if(_0x41b14c[_0x446a('0x31')]&&_0x41b14c[_0x446a('0x31')]!=='--'){_0xb826c4[_0x446a('0x13')]({'type':_0x41b14c['type'],'app':_0x446a('0x19'),'appdata':'CDR(tag)='+_0x41b14c['tag'],'context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c['exten'],'priority':_0xccd1f7['length']+_0x2ffe6e['priority']+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});}}if(_0x41b14c[_0x446a('0x14')]===_0x446a('0x32')&&_0x41b14c[_0x446a('0x30')](_0x446a('0x33'))){if(_0x41b14c[_0x446a('0x33')]){_0xb826c4[_0x446a('0x13')]({'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x1e'),'appdata':_0x446a('0x34')+_0x41b14c[_0x446a('0x33')]+')','context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e[_0x446a('0x1d')]+_0x366119++,'VoiceExtensionId':_0x41b14c['VoiceExtensionId']});}else{_0xb826c4[_0x446a('0x13')]({'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x1e'),'appdata':_0x446a('0x35'),'context':_0x41b14c['context'],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e['priority']+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});}}if(_0x41b14c['hasOwnProperty']('answer')){if(_0xbfb43c[_0x446a('0x36')](_0x41b14c[_0x446a('0x37')][_0x446a('0x2a')]())>=0x0&&_0x41b14c['appType']!==_0x446a('0x38')){if(_0x41b14c[_0x446a('0x39')]){_0xb826c4['push']({'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x1e'),'appdata':_0x446a('0x3a'),'context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e[_0x446a('0x1d')]+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});_0xb826c4['push']({'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x3b'),'context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e[_0x446a('0x1d')]+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});}else{_0xb826c4[_0x446a('0x13')]({'type':_0x41b14c['type'],'app':_0x446a('0x1e'),'appdata':_0x446a('0x3c'),'context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e[_0x446a('0x1d')]+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});_0xb826c4[_0x446a('0x13')]({'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x19'),'appdata':_0x446a('0x3d'),'context':_0x41b14c[_0x446a('0x17')],'exten':_0x41b14c[_0x446a('0xa')],'priority':_0xccd1f7[_0x446a('0x29')]+_0x2ffe6e['priority']+_0x366119++,'VoiceExtensionId':_0x41b14c[_0x446a('0x18')]});}}}for(var _0x381a8e=0x0;_0x381a8e<_0xccd1f7[_0x446a('0x29')];_0x381a8e+=0x1){var _0x17bfaf=_0x2ffe6e[_0x446a('0x1d')]+_0xccd1f7['length'];var _0x444f3b=_0x381a8e===_0xccd1f7['length']-0x1?_0x2ffe6e['priority']+_0xb826c4['length']+_0x40908b[_0x446a('0x29')]+0x2:_0x2ffe6e[_0x446a('0x1d')]+_0x381a8e+0x1;_0xb826c4['splice'](_0x381a8e,0x0,{'type':_0x41b14c[_0x446a('0x14')],'app':_0x446a('0x3e'),'appdata':_0xccd1f7[_0x381a8e]+'?'+_0x41b14c[_0x446a('0x17')]+_0x446a('0x3f')+_0x17bfaf+':'+_0x41b14c[_0x446a('0x17')]+',${EXTEN},'+_0x444f3b,'exten':_0x41b14c[_0x446a('0xa')],'context':_0x41b14c[_0x446a('0x17')],'priority':_0x2ffe6e[_0x446a('0x1d')]+_0x381a8e,'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0]['VoiceExtensionId']});}_0x41b14c['priority']=_0xb826c4[_0x446a('0x29')]?_[_0x446a('0x40')](_0xb826c4)[_0x446a('0x1d')]+0x1:_0x2ffe6e[_0x446a('0x1d')];_0x2ffe6e['priority']=(_0x40908b[_0x446a('0x29')]?_[_0x446a('0x40')](_0x40908b)['priority']:_0x41b14c['priority'])+0x1;_0x2ffe6e[_0x446a('0x10')]=_[_0x446a('0x41')](_0x2ffe6e[_0x446a('0x10')],_0xb826c4,[_0x41b14c],_0x40908b);}_0x2ffe6e['extensions'][_0x446a('0x13')]({'type':_0x44b92d[_0x6afce0][0x0][_0x446a('0x14')],'app':_0x446a('0x42'),'exten':_0x44b92d[_0x6afce0][0x0]['exten'],'context':_0x44b92d[_0x6afce0][0x0]['context'],'priority':_0x2ffe6e['priority'],'VoiceExtensionId':_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]});_0x24fe39[_0x446a('0x13')](_0x44b92d[_0x6afce0][0x0][_0x446a('0x18')]);_0x42846a=_[_0x446a('0x41')](_0x42846a,_0x2ffe6e[_0x446a('0x10')]);}}return _0x59f976['transaction'](function(_0x2fa778){return _0x59f976[_0x446a('0x2')][_0x446a('0x7')][_0x446a('0x43')]({'where':{'VoiceExtensionId':{'$in':_0x24fe39}},'transaction':_0x2fa778})[_0x446a('0x5')](function(_0x34cad4){return _0x59f976[_0x446a('0x2')][_0x446a('0x7')][_0x446a('0x44')](_['sortBy'](_0x42846a,_0x446a('0x1d')),{'transaction':_0x2fa778});});});})[_0x446a('0x45')](function(_0x3e301a){console[_0x446a('0x46')](_0x3e301a);});}exports['rewrite']=rewrite; \ No newline at end of file +var _0x7e6a=['_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','toLowerCase','createdAt','updatedAt','interval','*,*,*,*','IntervalId','tag','CDR(tag)=','length','outbound','callerID','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','answer','indexOf','app','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','XCALLY-MOTION-PROGRESS=1','splice',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','error','lodash','util','models','Interval','then','intervals','VoiceExtension','findAll','uniq','map','CAST(priority\x20AS\x20UNSIGNED)','filter','queue','hasOwnProperty','priority','extensions','exten','push','type','Set','CDR(type)=%s','VoiceExtensionId','extension','CDR(destination)=','cutdigits','${EXTEN:','${EXTEN}','context','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none'];(function(_0x4d112b,_0x5ce092){var _0x1500ed=function(_0x22a4e8){while(--_0x22a4e8){_0x4d112b['push'](_0x4d112b['shift']());}};_0x1500ed(++_0x5ce092);}(_0x7e6a,0xac));var _0xa7e6=function(_0x30f7da,_0x52bbc1){_0x30f7da=_0x30f7da-0x0;var _0x2dd11e=_0x7e6a[_0x30f7da];return _0x2dd11e;};'use strict';var _=require(_0xa7e6('0x0'));var util=require(_0xa7e6('0x1'));function rewrite(_0x3f11ed,_0x5aba09){var _0x32ed33=this;return _0x3f11ed[_0xa7e6('0x2')][_0xa7e6('0x3')]['findAll']({'raw':!![]})[_0xa7e6('0x4')](function(_0x5101ec){_0x32ed33[_0xa7e6('0x5')]=_0x5101ec;return _0x3f11ed[_0xa7e6('0x2')][_0xa7e6('0x6')][_0xa7e6('0x7')]({'where':{'IntervalId':_0x5aba09['IntervalId']},'raw':!![]});})[_0xa7e6('0x4')](function(_0x218d2b){return _0x3f11ed['models']['VoiceExtension']['findAll']({'where':{'exten':{'$in':_[_0xa7e6('0x8')](_[_0xa7e6('0x9')](_0x218d2b,'exten'))}},'order':[{'raw':_0xa7e6('0xa')}],'raw':!![]});})['then'](function(_0x4a7f90){var _0x5277a4=_['filter'](_0x4a7f90,{'priority':'1'});var _0x187da4=_[_0xa7e6('0xb')](_0x4a7f90,{'isApp':0x1});var _0x5bcdf8=_['groupBy'](_0x187da4,'exten');var _0x398047=[_0xa7e6('0xc'),'playback'];var _0x1f9a68=[];var _0x446a60=[];for(var _0x4628c9 in _0x5bcdf8){if(_0x5bcdf8[_0xa7e6('0xd')](_0x4628c9)){_0x32ed33[_0xa7e6('0xe')]=0x2;_0x32ed33[_0xa7e6('0xf')]=[];_0x32ed33['extension']=_['find'](_0x5277a4,{'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')]});_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':util['format'](_0xa7e6('0x14'),_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')]),'context':_0x5bcdf8[_0x4628c9][0x0]['context'],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});if(_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')]==='outbound'){if(_0x32ed33[_0xa7e6('0x16')]){_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x17')+(_0x32ed33['extension'][_0xa7e6('0x18')]?_0xa7e6('0x19')+_0x32ed33[_0xa7e6('0x16')][_0xa7e6('0x18')]+'}':_0xa7e6('0x1a')),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});}_0x32ed33['extensions'][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':'Set','appdata':_0xa7e6('0x1c')+_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')],'context':_0x5bcdf8[_0x4628c9][0x0]['context'],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33['priority']++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});var _0x4a7dc0=_0x32ed33[_0xa7e6('0xe')]++;_0x32ed33[_0xa7e6('0xf')]['push']({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x1d'),'appdata':_0xa7e6('0x1e')+(_0x4a7dc0+0x2)+'):Goto('+(_0x4a7dc0+0x1)+')','context':_0x5bcdf8[_0x4628c9][0x0]['context'],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x4a7dc0,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});if(_0x32ed33[_0xa7e6('0x16')]){_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0]['type'],'app':'Set','appdata':_0x32ed33[_0xa7e6('0x16')][_0xa7e6('0x18')]?'CDR(prefix)=${EXTEN:0:'+_0x32ed33[_0xa7e6('0x16')]['cutdigits']+'}':_0xa7e6('0x1f'),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0]['VoiceExtensionId']});}_0x32ed33['extensions'][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x20')+_0x5bcdf8[_0x4628c9][0x0]['VoiceExtensionId'],'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0]['exten'],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});if(_0x32ed33[_0xa7e6('0x16')]&&_0x32ed33['extension'][_0xa7e6('0xd')](_0xa7e6('0x21'))&&_0x32ed33[_0xa7e6('0x16')]['recordingFormat']!==_0xa7e6('0x22')){_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x23'),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0]['exten'],'priority':_0x32ed33['priority']++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':'Set','appdata':_0xa7e6('0x24')+_0x32ed33[_0xa7e6('0x16')][_0xa7e6('0x21')]||'wav','context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0]['VoiceExtensionId']});}}_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':'Set','appdata':_0xa7e6('0x25'),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});_0x32ed33[_0xa7e6('0xf')][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x26'),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0]['exten'],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});_0x32ed33['extensions']['push']({'type':_0x5bcdf8[_0x4628c9][0x0]['type'],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x27'),'context':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x1b')],'exten':_0x5bcdf8[_0x4628c9][0x0]['exten'],'priority':_0x32ed33[_0xa7e6('0xe')]++,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});for(var _0x5465d1=0x0,_0x57ce01=0x0;_0x5465d1<_0x5bcdf8[_0x4628c9]['length'];_0x5465d1+=0x1,_0x57ce01=0x0){var _0xf0a5ae=_0x5bcdf8[_0x4628c9][_0x5465d1];if(_0xf0a5ae[_0xa7e6('0x12')]){_0xf0a5ae['type']=_0xf0a5ae[_0xa7e6('0x12')][_0xa7e6('0x28')]();}var _0x4771e2=[];var _0xf0f9b1=[];delete _0xf0a5ae['id'];delete _0xf0a5ae[_0xa7e6('0x29')];delete _0xf0a5ae[_0xa7e6('0x2a')];var _0xf6c522=_0xf0a5ae[_0xa7e6('0x2b')]!==_0xa7e6('0x2c')?[_0xf0a5ae[_0xa7e6('0x2b')]]:_0xf0a5ae[_0xa7e6('0x2d')]?_[_0xa7e6('0x9')](_['filter'](_0x32ed33[_0xa7e6('0x5')],{'IntervalId':_0xf0a5ae['IntervalId']}),_0xa7e6('0x2b')):[];if(_0xf0a5ae[_0xa7e6('0xd')]('tag')){if(_0xf0a5ae[_0xa7e6('0x2e')]&&_0xf0a5ae['tag']!=='--'){_0x4771e2['push']({'type':_0xf0a5ae['type'],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x2f')+_0xf0a5ae[_0xa7e6('0x2e')],'context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522[_0xa7e6('0x30')]+_0x32ed33[_0xa7e6('0xe')]+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae[_0xa7e6('0x15')]});}}if(_0xf0a5ae['type']===_0xa7e6('0x31')&&_0xf0a5ae[_0xa7e6('0xd')](_0xa7e6('0x32'))){if(_0xf0a5ae[_0xa7e6('0x32')]){_0x4771e2[_0xa7e6('0x11')]({'type':_0xf0a5ae[_0xa7e6('0x12')],'app':_0xa7e6('0x1d'),'appdata':_0xa7e6('0x33')+_0xf0a5ae['callerID']+')','context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522['length']+_0x32ed33['priority']+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae[_0xa7e6('0x15')]});}else{_0x4771e2[_0xa7e6('0x11')]({'type':_0xf0a5ae[_0xa7e6('0x12')],'app':_0xa7e6('0x1d'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522[_0xa7e6('0x30')]+_0x32ed33['priority']+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae['VoiceExtensionId']});}}if(_0xf0a5ae[_0xa7e6('0xd')](_0xa7e6('0x34'))){if(_0x398047[_0xa7e6('0x35')](_0xf0a5ae[_0xa7e6('0x36')][_0xa7e6('0x28')]())>=0x0&&_0xf0a5ae['appType']!==_0xa7e6('0x37')){if(_0xf0a5ae['answer']){_0x4771e2[_0xa7e6('0x11')]({'type':_0xf0a5ae[_0xa7e6('0x12')],'app':_0xa7e6('0x1d'),'appdata':_0xa7e6('0x38'),'context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae['exten'],'priority':_0xf6c522['length']+_0x32ed33['priority']+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae[_0xa7e6('0x15')]});_0x4771e2[_0xa7e6('0x11')]({'type':_0xf0a5ae['type'],'app':'Set','appdata':_0xa7e6('0x39'),'context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522[_0xa7e6('0x30')]+_0x32ed33[_0xa7e6('0xe')]+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae['VoiceExtensionId']});}else{_0x4771e2['push']({'type':_0xf0a5ae[_0xa7e6('0x12')],'app':'ExecIf','appdata':_0xa7e6('0x3a'),'context':_0xf0a5ae[_0xa7e6('0x1b')],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522[_0xa7e6('0x30')]+_0x32ed33['priority']+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae[_0xa7e6('0x15')]});_0x4771e2[_0xa7e6('0x11')]({'type':_0xf0a5ae[_0xa7e6('0x12')],'app':_0xa7e6('0x13'),'appdata':_0xa7e6('0x3b'),'context':_0xf0a5ae['context'],'exten':_0xf0a5ae[_0xa7e6('0x10')],'priority':_0xf6c522['length']+_0x32ed33[_0xa7e6('0xe')]+_0x57ce01++,'VoiceExtensionId':_0xf0a5ae['VoiceExtensionId']});}}}for(var _0x4e67b0=0x0;_0x4e67b0<_0xf6c522[_0xa7e6('0x30')];_0x4e67b0+=0x1){var _0x40a01a=_0x32ed33[_0xa7e6('0xe')]+_0xf6c522['length'];var _0x3b7bf4=_0x4e67b0===_0xf6c522['length']-0x1?_0x32ed33[_0xa7e6('0xe')]+_0x4771e2['length']+_0xf0f9b1[_0xa7e6('0x30')]+0x2:_0x32ed33[_0xa7e6('0xe')]+_0x4e67b0+0x1;_0x4771e2[_0xa7e6('0x3c')](_0x4e67b0,0x0,{'type':_0xf0a5ae[_0xa7e6('0x12')],'app':'GotoIfTime','appdata':_0xf6c522[_0x4e67b0]+'?'+_0xf0a5ae['context']+_0xa7e6('0x3d')+_0x40a01a+':'+_0xf0a5ae[_0xa7e6('0x1b')]+_0xa7e6('0x3d')+_0x3b7bf4,'exten':_0xf0a5ae[_0xa7e6('0x10')],'context':_0xf0a5ae[_0xa7e6('0x1b')],'priority':_0x32ed33[_0xa7e6('0xe')]+_0x4e67b0,'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]});}_0xf0a5ae[_0xa7e6('0xe')]=_0x4771e2[_0xa7e6('0x30')]?_['last'](_0x4771e2)[_0xa7e6('0xe')]+0x1:_0x32ed33['priority'];_0x32ed33[_0xa7e6('0xe')]=(_0xf0f9b1[_0xa7e6('0x30')]?_[_0xa7e6('0x3e')](_0xf0f9b1)['priority']:_0xf0a5ae[_0xa7e6('0xe')])+0x1;_0x32ed33[_0xa7e6('0xf')]=_[_0xa7e6('0x3f')](_0x32ed33[_0xa7e6('0xf')],_0x4771e2,[_0xf0a5ae],_0xf0f9b1);}_0x32ed33['extensions'][_0xa7e6('0x11')]({'type':_0x5bcdf8[_0x4628c9][0x0]['type'],'app':_0xa7e6('0x40'),'exten':_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x10')],'context':_0x5bcdf8[_0x4628c9][0x0]['context'],'priority':_0x32ed33[_0xa7e6('0xe')],'VoiceExtensionId':_0x5bcdf8[_0x4628c9][0x0]['VoiceExtensionId']});_0x1f9a68[_0xa7e6('0x11')](_0x5bcdf8[_0x4628c9][0x0][_0xa7e6('0x15')]);_0x446a60=_[_0xa7e6('0x3f')](_0x446a60,_0x32ed33[_0xa7e6('0xf')]);}}return _0x3f11ed[_0xa7e6('0x41')](function(_0x306435){return _0x3f11ed['models']['VoiceExtension'][_0xa7e6('0x42')]({'where':{'VoiceExtensionId':{'$in':_0x1f9a68}},'transaction':_0x306435})[_0xa7e6('0x4')](function(_0x380053){return _0x3f11ed['models'][_0xa7e6('0x6')]['bulkCreate'](_[_0xa7e6('0x43')](_0x446a60,'priority'),{'transaction':_0x306435});});});})['catch'](function(_0x10df88){console[_0xa7e6('0x44')](_0x10df88);});}exports['rewrite']=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 04f23aa..6227822 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 _0xcb91=['generalCheckHopper','Error\x20processing\x20rows\x20block:','resolve','emit','contact:csv_','unlinkSync','exit','SIGINT','CSV\x20import\x20process\x20stopped!','createReadStream','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel','papaparse','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','null','Missing\x20filepath\x20parameter!','undefined','zipObject','split','error','contact','index','test','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','birthDate','YYYY-MM-DD','email','ListId','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','push','pick','catch','stringify','cmContact','checkHopper','inspect','insert','cm_hopper','phone','ContactId','createdAt','updatedAt','select','field','NOW()','scheduledAt','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','where','\x20=\x20?','into','fromQuery','id\x20IN\x20?','str','phone\x20IS\x20NOT\x20NULL','calleridnum','cm_hopper_final','phone\x20NOT\x20IN\x20(?)','findAll','outbound','dialCheckDuplicateType','CmList','Lists','always','sequelize','query','VoiceQueueId','all','VoiceQueue','BlackLists','get','CampaignId','onlyIfOpen','cmContact,\x20%s,\x20%s'];(function(_0x915a01,_0x4a96e2){var _0x176d57=function(_0x481be2){while(--_0x481be2){_0x915a01['push'](_0x915a01['shift']());}};_0x176d57(++_0x4a96e2);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a79e2,_0x319b1a){_0x5a79e2=_0x5a79e2-0x0;var _0x266c45=_0xcb91[_0x5a79e2];return _0x266c45;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x1cb9('0x0'));var fs=require('fs');var squel=require(_0x1cb9('0x1'));var Papa=require(_0x1cb9('0x2'));var Redis=require(_0x1cb9('0x3'));var db=require('../../../mysqldb')['db'];var config=require(_0x1cb9('0x4'));var logger=require(_0x1cb9('0x5'))('api');config[_0x1cb9('0x6')]=_[_0x1cb9('0x7')](config['redis'],{'host':_0x1cb9('0x8'),'port':0x18eb});var socket=require(_0x1cb9('0x9'))(new Redis(config['redis']));require(_0x1cb9('0xa'))[_0x1cb9('0xb')](socket);try{if(!process['argv'][0x2]||process[_0x1cb9('0xc')][0x2]==='undefined'||process['argv'][0x2]===_0x1cb9('0xd')){throw new Error(_0x1cb9('0xe'));}var FILEPATH=process[_0x1cb9('0xc')][0x2];if(!process[_0x1cb9('0xc')][0x3]||process[_0x1cb9('0xc')][0x3]==='undefined'||process[_0x1cb9('0xc')][0x3]===_0x1cb9('0xd')||!process[_0x1cb9('0xc')][0x4]||process[_0x1cb9('0xc')][0x4]===_0x1cb9('0xf')||process['argv'][0x4]==='null'){throw new Error('Missing\x20binding\x20parameters!');}var FIELDS=_[_0x1cb9('0x10')](process[_0x1cb9('0xc')][0x3][_0x1cb9('0x11')](','),process[_0x1cb9('0xc')][0x4]['split'](','));if(!process[_0x1cb9('0xc')][0x5]||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x5]===_0x1cb9('0xd')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process['argv'][0x5];var COMPANYID=process[_0x1cb9('0xc')][0x6]&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xf')&&process[_0x1cb9('0xc')][0x6]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x6]:null;var DUPLICATES=process[_0x1cb9('0xc')][0x7]&&process['argv'][0x7]!=='undefined'&&process[_0x1cb9('0xc')][0x7]!==_0x1cb9('0xd')?process[_0x1cb9('0xc')][0x7]:null;if(!process[_0x1cb9('0xc')][0x8]||process[_0x1cb9('0xc')][0x8]===_0x1cb9('0xf')||process[_0x1cb9('0xc')][0x8]==='null'){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x1cb9('0xc')][0x8];}catch(_0x5dbfae){logger[_0x1cb9('0x12')](_0x5dbfae);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(_0x2265ea,_0x523b26,_0x599275,_0x2e3854){var _0x325637={'message':_0x523b26};_0x325637[_0x2265ea]=!![];if(_0x599275){_0x325637[_0x1cb9('0x13')]=_0x599275;}if(_0x2e3854){_0x325637[_0x1cb9('0x14')]=_0x2e3854;}return _0x325637;}function isEmail(_0x45b8d3){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))*$/[_0x1cb9('0x15')](_0x45b8d3);}function checkRow(_0x59ebea,_0x55b232,_0x6c6f61){return new BPromise(function(_0x557199,_0x10a419){if(_[_0x1cb9('0x16')](_0x59ebea)){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x1cb9('0x17'),null,_0x6c6f61));}if(_0x59ebea[_0x1cb9('0x18')]&&_0x59ebea['errors'][_0x1cb9('0x19')]){var _0x9df250=_['map'](_0x59ebea[_0x1cb9('0x18')],_0x1cb9('0x1a'))[_0x1cb9('0x1b')](';');return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),_0x9df250,null,_0x6c6f61));}var _0x406821={};for(var _0x21d6f5 in FIELDS){if(FIELDS[_0x1cb9('0x1c')](_0x21d6f5)&&FIELDS[_0x21d6f5]){_0x406821[_0x21d6f5]=_0x59ebea[_0x1cb9('0x1d')][0x0][FIELDS[_0x21d6f5]]||_0x59ebea[_0x1cb9('0x1d')][0x0]['\ufeff'+FIELDS[_0x21d6f5]];}}if(!_0x406821[_0x1cb9('0x1e')]){return _0x10a419(handleCheckRowError('error',_0x1cb9('0x1f'),null,_0x6c6f61));}if(!_0x406821['phone']){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'phone\x20not\x20specified!',null,_0x6c6f61));}if(_0x406821[_0x1cb9('0x20')]){var _0x41011c=moment(_0x406821[_0x1cb9('0x20')],_0x1cb9('0x21'));if(!_0x41011c['isValid']()){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!',null,_0x6c6f61));}}if(_0x406821[_0x1cb9('0x22')]){if(!isEmail(_0x406821[_0x1cb9('0x22')])){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'email\x20format\x20is\x20not\x20valid!',null,_0x6c6f61));}}_0x406821[_0x1cb9('0x23')]=LISTID;_0x406821['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){var _0x58f4f5={};for(var _0x2164e3=0x0,_0x42a688=DUPLICATES[_0x1cb9('0x19')];_0x2164e3<_0x42a688;_0x2164e3+=0x1){_0x58f4f5[DUPLICATES[_0x2164e3]]=_0x406821[DUPLICATES[_0x2164e3]];}var _0xae910=_['find'](_0x55b232,_0x58f4f5);if(_0xae910){return _0x10a419(handleCheckRowError(_0x1cb9('0x24'),_0x1cb9('0x25'),_0xae910,_0x6c6f61));}}return db[_0x1cb9('0x26')][_0x1cb9('0x27')](_0x406821,{'raw':!![],'hooks':![],'fields':_[_0x1cb9('0x28')](_0x406821)})[_0x1cb9('0x29')](function(_0xc6d5fd){if(DUPLICATES&&DUPLICATES[_0x1cb9('0x19')]&&_0x55b232){_0x55b232[_0x1cb9('0x2a')](_[_0x1cb9('0x2b')](_0x406821,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xc6d5fd['id'];return _0x557199();})[_0x1cb9('0x2c')](function(_0x26b950){return _0x10a419(handleCheckRowError(_0x1cb9('0x12'),'Error\x20while\x20creating\x20contact:\x20'+(_0x26b950['message']||JSON[_0x1cb9('0x2d')](_0x26b950)),null,_0x6c6f61));});});}function checkHopper(){function _0x30f7e4(){return function(_0x91c937){logger[_0x1cb9('0x12')](_0x1cb9('0x2e'),_0x1cb9('0x2f'),util[_0x1cb9('0x30')](_0x91c937,{'showHidden':![],'depth':null}));};}var _0x3f5637=function(_0x4d3e39,_0x2aa59b){var _0x1482c4=squel[_0x1cb9('0x31')]()['into'](_0x1cb9('0x32'))['fromQuery']([_0x1cb9('0x33'),'scheduledAt',_0x1cb9('0x34'),_0x1cb9('0x23'),_0x2aa59b,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),'phone')['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x4d3e39['id'][_0x1cb9('0x3b')](),_0x2aa59b)['field']('NOW()','createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))['where'](_0x1cb9('0x3e'))['where'](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('phone\x20IS\x20NOT\x20NULL')[_0x1cb9('0x40')]('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone')['from'](_0x1cb9('0x32'))[_0x1cb9('0x40')](_0x2aa59b+_0x1cb9('0x41'),_0x4d3e39['id'][_0x1cb9('0x3b')]())))[_0x1cb9('0x3b')]();return _0x1482c4;};var _0x58832e=function(_0x11d877,_0x5594fc){var _0x4c59e7=squel['insert']()[_0x1cb9('0x42')](_0x1cb9('0x32'))[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x5594fc,_0x1cb9('0x35'),_0x1cb9('0x36')],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')]('phone',_0x1cb9('0x33'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'scheduledAt')[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x11d877['id'][_0x1cb9('0x3b')](),_0x5594fc)['field'](_0x1cb9('0x39'),'createdAt')[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')]('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46'))['where']('phone\x20NOT\x20IN\x20(?)',squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x47'))[_0x1cb9('0x3c')](_0x1cb9('0x48'))[_0x1cb9('0x40')](_0x5594fc+_0x1cb9('0x41'),_0x11d877['id'][_0x1cb9('0x3b')]()))[_0x1cb9('0x40')](_0x1cb9('0x49'),squel['select']()[_0x1cb9('0x38')]('phone')[_0x1cb9('0x3c')]('cm_hopper')[_0x1cb9('0x40')](_0x5594fc+'\x20=\x20?',_0x11d877['id']['toString']())))[_0x1cb9('0x3b')]();return _0x4c59e7;};function _0x3b0c2e(_0x303da3,_0x4bce54){var _0x3c157f=squel[_0x1cb9('0x31')]()['into']('cm_hopper')[_0x1cb9('0x43')]([_0x1cb9('0x33'),_0x1cb9('0x3a'),_0x1cb9('0x34'),_0x1cb9('0x23'),_0x4bce54,_0x1cb9('0x35'),_0x1cb9('0x36')],squel['select']()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))['field'](_0x1cb9('0x39'),_0x1cb9('0x3a'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))[_0x1cb9('0x38')](LISTID[_0x1cb9('0x3b')](),'ListId')[_0x1cb9('0x38')](_0x303da3['id'][_0x1cb9('0x3b')](),_0x4bce54)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x36'))[_0x1cb9('0x3c')](_0x1cb9('0x3d'))[_0x1cb9('0x40')]('deletedAt\x20IS\x20NULL')[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())[_0x1cb9('0x40')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x1cb9('0x40')](_0x1cb9('0x46')))[_0x1cb9('0x3b')]();return _0x3c157f;}function _0x173db5(_0x3c2f9c,_0x75c734){var _0xc515a6=squel[_0x1cb9('0x31')]()['into']('cm_hopper_black')[_0x1cb9('0x43')](['phone','ContactId','ListId',_0x75c734,'createdAt','updatedAt'],squel[_0x1cb9('0x37')]()[_0x1cb9('0x38')](_0x1cb9('0x33'),_0x1cb9('0x33'))[_0x1cb9('0x38')]('id',_0x1cb9('0x34'))['field'](LISTID[_0x1cb9('0x3b')](),_0x1cb9('0x23'))['field'](_0x3c2f9c['id']['toString'](),_0x75c734)[_0x1cb9('0x38')](_0x1cb9('0x39'),_0x1cb9('0x35'))[_0x1cb9('0x38')](_0x1cb9('0x39'),'updatedAt')['from']('cm_contacts')[_0x1cb9('0x40')](_0x1cb9('0x3e'))[_0x1cb9('0x40')](_0x1cb9('0x3f'),LISTID[_0x1cb9('0x3b')]())['where'](_0x1cb9('0x44'),squel[_0x1cb9('0x45')](hopperContacts))['where']('phone\x20IS\x20NOT\x20NULL'))[_0x1cb9('0x3b')]();return _0xc515a6;}return db['VoiceQueue'][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x4aeeff){var _0xde0d93=[];if(_0x4aeeff){var _0x15fc04;for(var _0x330fc1=0x0,_0x17c361;_0x330fc1<_0x4aeeff['length'];_0x330fc1+=0x1){_0x17c361=_0x4aeeff[_0x330fc1]['get']({'plain':!![]});switch(_0x17c361[_0x1cb9('0x4c')]){case _0x1cb9('0x4f'):_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x17c361,_0x1cb9('0x52')))['then'](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;case'onlyIfOpen':_0xde0d93[_0x1cb9('0x2a')](db[_0x1cb9('0x50')]['query'](_0x3f5637(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0xde0d93['push'](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x17c361,_0x1cb9('0x52')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}}return _0xde0d93;})[_0x1cb9('0x53')]()['then'](function(){return db[_0x1cb9('0x54')][_0x1cb9('0x4a')]({'where':{'type':_0x1cb9('0x4b')},'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x128a41){var _0x37bcd9=[];if(_0x128a41){var _0x4cd544;for(var _0x28bac2=0x0,_0x78e9c;_0x28bac2<_0x128a41['length'];_0x28bac2+=0x1){_0x78e9c=_0x128a41[_0x28bac2][_0x1cb9('0x56')]({'plain':!![]});_0x37bcd9['push'](db[_0x1cb9('0x50')]['query'](_0x173db5(_0x78e9c,'VoiceQueueId'))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x37bcd9;})['all']();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id',_0x1cb9('0x4c')],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x4e'),'where':{'id':LISTID}}]})['then'](function(_0x45ca54){var _0x3d25a3=[];if(_0x45ca54){for(var _0x2a157d=0x0,_0x27cc3c;_0x2a157d<_0x45ca54[_0x1cb9('0x19')];_0x2a157d+=0x1){_0x27cc3c=_0x45ca54[_0x2a157d][_0x1cb9('0x56')]({'plain':!![]});switch(_0x27cc3c['dialCheckDuplicateType']){case _0x1cb9('0x4f'):_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x58832e(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));break;case _0x1cb9('0x58'):_0x3d25a3[_0x1cb9('0x2a')](db['sequelize'][_0x1cb9('0x51')](_0x3f5637(_0x27cc3c,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));break;default:_0x3d25a3[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x3b0c2e(_0x27cc3c,'CampaignId'))[_0x1cb9('0x29')](function(){})['catch'](_0x30f7e4()));}}}return _0x3d25a3;})[_0x1cb9('0x53')]();})[_0x1cb9('0x29')](function(){return db['Campaign'][_0x1cb9('0x4a')]({'attributes':['id'],'include':[{'model':db[_0x1cb9('0x4d')],'as':_0x1cb9('0x55'),'where':{'id':LISTID}}]})[_0x1cb9('0x29')](function(_0x56f23d){var _0x113367=[];if(_0x56f23d){for(var _0x39b0cb=0x0,_0x429371;_0x39b0cb<_0x56f23d['length'];_0x39b0cb+=0x1){_0x429371=_0x56f23d[_0x39b0cb][_0x1cb9('0x56')]({'plain':!![]});_0x113367[_0x1cb9('0x2a')](db[_0x1cb9('0x50')][_0x1cb9('0x51')](_0x173db5(_0x429371,_0x1cb9('0x57')))[_0x1cb9('0x29')](function(){})[_0x1cb9('0x2c')](_0x30f7e4()));}}return _0x113367;})['all']();})[_0x1cb9('0x2c')](function(_0x4b15a4){logger[_0x1cb9('0x12')](_0x1cb9('0x59'),_0x1cb9('0x5a'),_0x4b15a4[_0x1cb9('0x1a')]);});}var processPromises=function(_0x4bdbd2){return BPromise[_0x1cb9('0x53')](promises)[_0x1cb9('0x29')](function(_0x5e68a1){})[_0x1cb9('0x2c')](function(_0x416508){logger[_0x1cb9('0x12')](_0x1cb9('0x5b'),JSON[_0x1cb9('0x2d')](_0x416508));})['finally'](function(){socket['emit']('contact:csv_'+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x4bdbd2){return _0x4bdbd2['resume']();}});};var endCsv=function(){return BPromise[_0x1cb9('0x5c')]()[_0x1cb9('0x29')](function(){if(hopperContacts){return checkHopper();}})[_0x1cb9('0x29')](function(){socket[_0x1cb9('0x5d')](_0x1cb9('0x5e')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x1cb9('0x5f')](FILEPATH);}catch(_0x1e6402){logger[_0x1cb9('0x12')]('Unable\x20to\x20delete\x20temp\x20file:',JSON[_0x1cb9('0x2d')](_0x1e6402));}finally{process[_0x1cb9('0x60')](0x0);}});};process['on'](_0x1cb9('0x61'),function(){logger['info'](_0x1cb9('0x62'));endCsv();});function main(){return BPromise[_0x1cb9('0x5c')]()['then'](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x1cb9('0x11')](',');return db[_0x1cb9('0x26')][_0x1cb9('0x4a')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x1cb9('0x29')](function(_0x5cb5e5){var _0x2c0416=fs[_0x1cb9('0x63')](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x2c0416,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5bd78d,_0x1f2d69){total+=0x1;var _0x3ba0a5=total;promises['push'](checkRow(_0x5bd78d,_0x5cb5e5,_0x3ba0a5)['then'](function(){success+=0x1;})[_0x1cb9('0x2c')](function(_0x3486e5){if(_0x3486e5['error']){errors+=0x1;delete _0x3486e5['error'];}else if(_0x3486e5[_0x1cb9('0x24')]){duplicates+=0x1;delete _0x3486e5['duplicate'];}rows['push'](_0x3486e5);}));if(total%0xc8===0x0){_0x1f2d69['pause']();return processPromises(_0x1f2d69);}},'complete':function(){return processPromises()[_0x1cb9('0x29')](function(){logger['info'](_0x1cb9('0x64'));endCsv();});},'error':function(_0x3c717b,_0x33ec43){logger['info'](_0x1cb9('0x65'),JSON[_0x1cb9('0x2d')](_0x3c717b));endCsv();}});})[_0x1cb9('0x2c')](function(_0x4c54b5){logger[_0x1cb9('0x12')](_0x1cb9('0x66'),JSON[_0x1cb9('0x2d')](_0x4c54b5));});}main(); \ No newline at end of file +var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);endCsv();}var total=0x0;var pTotal=0x0;var success=0x0;var errors=0x0;var duplicates=0x0;var rows=[];var hopperContacts='';var promises=[];var index=0x0;var alreadyInvalid=![];function handleCheckRowError(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 3c0fb49..f8bc988 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 _0x57e9=['argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','uncaughtException','path','lodash','papaparse','bluebird','moment','squel','ioredis','../../../mysqldb','../../../config/logger','import','redis','defaults','socket.io-emitter','format','select','field','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.ListId','cm_contacts.createdAt','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','phone','scheduledat','ContactId','ListId','createdAt','updatedAt','priority','UserId','fields','cm_contacts.ListId\x20=\x20','.CmListId\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','fromQuery','cm_contacts','.CmListId','cm_hopper_black','ListId\x20=\x20?','\x20=\x20?','toString','concat','CompanyId',')\x20NOT\x20IN\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','group','info','Received\x20SIGINT','error','message','exit','errors','push','code','query','spread','catch','stringify','send','start','binding','root','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','hasOwnProperty','trim','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNumber','email','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','firstName','\x20not\x20specified','SystemRow','emit','Abort\x20parser','abort','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()','DROP\x20TABLE\x20','voice_queues','VoiceQueueId','voice_queues_has_cm_blacklists','campaigns_has_cm_lists','campaigns','campaigns_has_cm_blacklists','CampaignId','then','finish','affectedRows','unlink','complete'];(function(_0x5723f7,_0x5588cd){var _0x3f5760=function(_0x469de9){while(--_0x469de9){_0x5723f7['push'](_0x5723f7['shift']());}};_0x3f5760(++_0x5588cd);}(_0x57e9,0x10d));var _0x957e=function(_0x214334,_0x402927){_0x214334=_0x214334-0x0;var _0x2904b8=_0x57e9[_0x214334];return _0x2904b8;};'use strict';var fs=require('fs');var path=require(_0x957e('0x0'));var _=require(_0x957e('0x1'));var Papa=require(_0x957e('0x2'));var util=require('util');var BPromise=require(_0x957e('0x3'));var moment=require(_0x957e('0x4'));var squel=require(_0x957e('0x5'));var Redis=require(_0x957e('0x6'));var db=require(_0x957e('0x7'))['db'];var config=require('../../../config/environment');var logger=require(_0x957e('0x8'))(_0x957e('0x9'));config[_0x957e('0xa')]=_[_0x957e('0xb')](config[_0x957e('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0x957e('0xc'))(new Redis(config[_0x957e('0xa')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x957e('0xd')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x4b1d12){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'](_0x4b1d12);}function selectNotIn(_0x2cc596,_0x18759a,_0x3e4efb,_0x1524ba,_0xa96633){return squel[_0x957e('0xe')]()[_0x957e('0xf')]('phone')[_0x957e('0x10')](_0x1524ba)[_0x957e('0x11')](_0x18759a,null,_0x18759a+_0x957e('0x12')+_0x1524ba+'.'+_0x3e4efb)[_0x957e('0x13')](_0x1524ba+'.'+_0x3e4efb+_0x957e('0x14')+_0x2cc596+'.'+_0x3e4efb)[_0x957e('0x13')](_0x18759a+_0x957e('0x15')+_0xa96633['join']()+')');}function insertCmHopper(_0xf78a7d,_0x489e0b,_0x5551a0,_0x5d7f6b,_0x162023){var _0x1757ac=[_0x957e('0x16'),_0x957e('0x17'),_0x957e('0x18'),_0x957e('0x19'),_0x489e0b+'.'+_0x5d7f6b,_0x957e('0x1a'),_0x957e('0x1b'),_0x957e('0x1c'),_0x957e('0x1d'),'\x22'+_0x162023+'\x22'];return squel[_0x957e('0x1e')]()[_0x957e('0x1f')](_0x957e('0x20'))['fromQuery']([_0x957e('0x21'),_0x957e('0x22'),_0x957e('0x23'),_0x957e('0x24'),_0x5d7f6b,_0x957e('0x25'),_0x957e('0x26'),_0x957e('0x27'),_0x957e('0x28'),'recallme'],squel[_0x957e('0xe')]()[_0x957e('0x29')](_0x1757ac)[_0x957e('0x10')](_0x489e0b)[_0x957e('0x11')]('cm_contacts',null,_0x957e('0x2a')+_0x489e0b+'.CmListId')[_0x957e('0x11')](_0x5551a0,null,_0x5551a0+_0x957e('0x12')+_0x489e0b+'.'+_0x5d7f6b)[_0x957e('0x13')](_0x489e0b+_0x957e('0x2b'),_0xf78a7d)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x957e('0x13')](_0x957e('0x2c'),selectNotIn(_0x489e0b,_0x5551a0,_0x5d7f6b,_0x957e('0x20'),[_0x957e('0x2d'),_0x957e('0x2e')]))[_0x957e('0x13')](_0x957e('0x2c'),selectNotIn(_0x489e0b,_0x5551a0,_0x5d7f6b,_0x957e('0x20'),[_0x957e('0x2d')])))['toString']();}function insertCmHopperBlack(_0x55aa97,_0x1c7445,_0x38beb3,_0x1929a7){var _0x491014=[_0x957e('0x16'),_0x957e('0x18'),_0x957e('0x19'),_0x1c7445+'.'+_0x1929a7,_0x957e('0x1a'),_0x957e('0x1b')];return squel[_0x957e('0x1e')]()[_0x957e('0x1f')]('cm_hopper_black')[_0x957e('0x2f')]([_0x957e('0x21'),'ContactId',_0x957e('0x24'),_0x1929a7,_0x957e('0x25'),'updatedAt'],squel[_0x957e('0xe')]()['fields'](_0x491014)[_0x957e('0x10')](_0x1c7445)[_0x957e('0x11')](_0x957e('0x30'),null,_0x957e('0x2a')+_0x1c7445+_0x957e('0x31'))[_0x957e('0x11')](_0x38beb3,null,_0x38beb3+'.id\x20=\x20'+_0x1c7445+'.'+_0x1929a7)[_0x957e('0x13')](_0x1c7445+_0x957e('0x2b'),_0x55aa97)[_0x957e('0x13')]('cm_contacts.createdAt\x20=\x20?',NOW)[_0x957e('0x13')](_0x957e('0x2c'),squel[_0x957e('0xe')]()[_0x957e('0xf')]('phone')['from'](_0x957e('0x32'))[_0x957e('0x13')](_0x957e('0x33'),_0x55aa97)[_0x957e('0x13')](_0x1929a7+_0x957e('0x34'),_0x1c7445+'.'+_0x1929a7)))[_0x957e('0x35')]();}function insertCmContact(_0x5667cd,_0x1d5de7,_0x30722d,_0x3bb1d1){var _0x237263=_[_0x957e('0x36')](_['keys'](_0x3bb1d1),[_0x957e('0x24'),_0x957e('0x37'),_0x957e('0x25'),'updatedAt']);return squel[_0x957e('0x1e')]()[_0x957e('0x1f')](_0x957e('0x30'))[_0x957e('0x2f')](_0x237263,squel[_0x957e('0xe')]()[_0x957e('0x29')](_0x237263)[_0x957e('0x10')](_0x1d5de7)['where']('('+_0x30722d[_0x957e('0x11')](',')+_0x957e('0x38'),squel[_0x957e('0xe')]()[_0x957e('0x29')](_0x30722d)[_0x957e('0x10')](_0x957e('0x30'))[_0x957e('0x13')](_0x957e('0x33'),_0x5667cd)[_0x957e('0x13')](_0x957e('0x39')))['where']('id\x20IN\x20?',squel[_0x957e('0xe')]()[_0x957e('0xf')](_0x957e('0x3a'),_0x957e('0x3b'))[_0x957e('0x10')](_0x1d5de7)[_0x957e('0x3c')](_0x30722d[_0x957e('0x11')](','))))['toString']();}function handleStop(){logger[_0x957e('0x3d')](_0x957e('0x3e'));stopped=!![];}function handleUncaughtException(_0x5ba5ec){logger[_0x957e('0x3f')](_0x5ba5ec[_0x957e('0x40')]);process[_0x957e('0x41')](0x1);}function handleError(_0x149e74,_0x322f40){stats[_0x957e('0x42')][_0x957e('0x43')]({'name':_0x322f40[_0x957e('0x44')],'message':_0x322f40[_0x957e('0x40')],'row':_0x149e74});}function handleQuery(_0x3bab03){logger[_0x957e('0x3d')](_0x3bab03);return db['sequelize'][_0x957e('0x45')](_0x3bab03)[_0x957e('0x46')](function(_0x43d57c){results[_0x957e('0x43')](_0x43d57c);})[_0x957e('0x47')](function(_0x3d63e5){logger[_0x957e('0x3f')](_0x3d63e5['message']);});}function main(_0x283e43,_0x145730,_0x3078f9,_0x4e67e0){logger['info']('main',_0x283e43,JSON[_0x957e('0x48')](_0x145730));process[_0x957e('0x49')](_0x957e('0x4a'));var _0x3e085d=_0x145730[_0x957e('0x4b')];var _0x45cc58=_0x145730['socket_timestamp'];var _0x123605=path[_0x957e('0x11')](config[_0x957e('0x4c')],_0x957e('0x4d'),_0x45cc58+'.csv');var _0x592dc0=_['keys'](_0x3e085d)[_0x957e('0x11')]();logger[_0x957e('0x3d')](_0x957e('0x4e'),_0x592dc0);fs[_0x957e('0x4f')](_0x123605,_0x592dc0+'\x0a');Papa[_0x957e('0x50')](fs[_0x957e('0x51')](_0x283e43),{'header':!![],'skipEmptyLines':!![],'step':function(_0x28a9eb,_0x338511){try{for(var _0x347c13=0x0,_0x2b9e45=[];_0x347c13<_0x28a9eb[_0x957e('0x52')][_0x957e('0x53')];_0x347c13++){stats[_0x957e('0x54')]+=0x1;if(_0x28a9eb['errors'][_0x347c13]){handleError(_0x28a9eb[_0x957e('0x52')][_0x347c13],_0x28a9eb['errors'][_0x347c13]);}else{var _0x5bdb98=[];for(var _0x57a3c3 in _0x3e085d){if(_0x3e085d[_0x957e('0x55')](_0x57a3c3)){if(_0x28a9eb[_0x957e('0x52')][_0x347c13][_0x3e085d[_0x57a3c3]]){var _0x4770f2=_[_0x957e('0x56')](_0x28a9eb[_0x957e('0x52')][_0x347c13][_0x3e085d[_0x57a3c3]]['replace'](/"/g,'\x27'));switch(_0x57a3c3){case _0x957e('0x22'):var _0x96dacf=moment(_0x4770f2,_0x957e('0x57'),!![]);if(_0x96dacf[_0x957e('0x58')]()){_0x2b9e45[_0x957e('0x43')]('\x22'+_0x4770f2+'\x22');}else{_0x5bdb98[_0x957e('0x43')](_0x957e('0x59'));}break;case'priority':var _0x47e097=parseInt(_0x4770f2);_0x4770f2=_['isNaN'](_0x47e097)||_0x47e097<0x0||_0x47e097>0x4?_0x4e67e0?0x3:0x2:_0x47e097;_0x2b9e45[_0x957e('0x43')]('\x22'+_0x4770f2+'\x22');break;case _0x957e('0x28'):var _0x119a39=parseInt(_0x4770f2);if(_[_0x957e('0x5a')](_0x119a39)&&_['includes'](_0x3078f9,_0x119a39)){_0x2b9e45[_0x957e('0x43')]('\x22'+_0x119a39+'\x22');}else{_0x5bdb98[_0x957e('0x43')]('agent\x20not\x20exists');}break;case _0x957e('0x5b'):if(isEmail(_0x4770f2)){_0x2b9e45[_0x957e('0x43')]('\x22'+_0x4770f2+'\x22');}else{_0x5bdb98[_0x957e('0x43')]('email\x20wrong\x20format');}break;case _0x957e('0x5c'):var _0x165600=moment(_0x4770f2,_0x957e('0x5d'),!![]);if(_0x165600[_0x957e('0x58')]()){_0x2b9e45['push']('\x22'+_0x4770f2+'\x22');}else{_0x5bdb98['push'](_0x957e('0x5e'));}break;default:_0x2b9e45[_0x957e('0x43')]('\x22'+_0x4770f2+'\x22');}}else{switch(_0x57a3c3){case _0x957e('0x5f'):case _0x957e('0x21'):_0x5bdb98['push'](_0x57a3c3+_0x957e('0x60'));break;default:_0x2b9e45[_0x957e('0x43')]('\x22\x22');}}}}if(_0x5bdb98[_0x957e('0x53')]){handleError(_0x28a9eb[_0x957e('0x52')][_0x347c13],{'code':_0x957e('0x61'),'message':_0x5bdb98[_0x957e('0x11')]()});}else{fs['appendFileSync'](_0x123605,_0x2b9e45[_0x957e('0x11')]()+'\x0a');}_0x2b9e45=[];}if(!(stats['rows']%0xc8)){socket[_0x957e('0x62')]('contact:import:'+_0x45cc58,stats);stats[_0x957e('0x42')]=[];}}if(stopped){logger[_0x957e('0x3d')](_0x957e('0x63'));_0x338511[_0x957e('0x64')]();}}catch(_0x274919){handleError(_0x28a9eb[_0x957e('0x52')][_0x347c13],{'code':'SystemError','message':_0x274919[_0x957e('0x40')]});logger[_0x957e('0x3f')]('step',_0x274919[_0x957e('0x40')]);}},'complete':function(){try{var _0x5d9461=[];var _0x562901=_0x957e('0x30');if(_0x145730[_0x957e('0x65')]&&_0x145730[_0x957e('0x65')][_0x957e('0x53')]){_0x562901=_0x957e('0x66')+_0x45cc58;_0x5d9461[_0x957e('0x43')](_0x957e('0x67')+_0x562901+_0x957e('0x68'));}var _0x124758=util['format'](_0x957e('0x69'),_0x123605,_0x562901,_0x592dc0,_0x145730[_0x957e('0x24')],_0x145730[_0x957e('0x37')]||null,NOW,NOW);if(_[_0x957e('0x6a')](_0x3e085d[_0x957e('0x22')])){_0x124758+=_0x957e('0x6b');}_0x5d9461[_0x957e('0x43')](_0x124758);if(_0x145730[_0x957e('0x65')]&&_0x145730['duplicates'][_0x957e('0x53')]){_0x5d9461[_0x957e('0x43')](insertCmContact(_0x145730[_0x957e('0x24')],_0x562901,_0x145730[_0x957e('0x65')],_0x3e085d));_0x5d9461[_0x957e('0x43')](_0x957e('0x6c')+_0x562901+';');}_0x5d9461[_0x957e('0x43')](insertCmHopper(_0x145730['ListId'],'voice_queues_has_cm_lists',_0x957e('0x6d'),_0x957e('0x6e'),_0x4e67e0));_0x5d9461[_0x957e('0x43')](insertCmHopperBlack(_0x145730['ListId'],_0x957e('0x6f'),_0x957e('0x6d'),_0x957e('0x6e')));_0x5d9461[_0x957e('0x43')](insertCmHopper(_0x145730['ListId'],_0x957e('0x70'),_0x957e('0x71'),'CampaignId',_0x4e67e0));_0x5d9461[_0x957e('0x43')](insertCmHopperBlack(_0x145730[_0x957e('0x24')],_0x957e('0x72'),_0x957e('0x71'),_0x957e('0x73')));BPromise['each'](_0x5d9461,handleQuery)[_0x957e('0x74')](function(_0x5614e8){stats[_0x957e('0x75')]=!![];stats[_0x957e('0x76')]=_0x145730[_0x957e('0x65')]&&_0x145730[_0x957e('0x65')]['length']?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0x957e('0x62')]('contact:import:'+_0x45cc58,stats);fs[_0x957e('0x77')](_0x283e43);fs[_0x957e('0x77')](_0x123605);process[_0x957e('0x41')](0x0);})['catch'](function(_0xc9f512){logger['error'](_0xc9f512['message']);process[_0x957e('0x41')](0x1);});}catch(_0x2e8e3c){logger[_0x957e('0x3f')](_0x957e('0x78'),_0x2e8e3c[_0x957e('0x40')]);process['exit'](0x1);}},'error':function(_0x570749,_0x405b8d,_0xd2ce8d,_0x2fcdf2){throw new Error(_0x2fcdf2);}});}function validate(){if(process['argv']&&process[_0x957e('0x79')][_0x957e('0x53')]<0x4){throw new Error(_0x957e('0x7a'));}var _0x11f418=path[_0x957e('0x11')](config['root'],'server/files/tmp',process[_0x957e('0x79')][0x2]);if(!fs['existsSync'](_0x11f418)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x45d623={};try{_0x45d623=JSON[_0x957e('0x50')](process['argv'][0x3]);if(!_0x45d623[_0x957e('0x4b')]){throw new Error(_0x957e('0x7b'));}if(!_0x45d623[_0x957e('0x4b')][_0x957e('0x21')]){throw new Error(_0x957e('0x7c'));}if(!_0x45d623['binding'][_0x957e('0x5f')]){throw new Error(_0x957e('0x7d'));}var _0x7764d9=0x0;if(_0x45d623[_0x957e('0x4b')]['UserId']){_0x7764d9=0x1;}if(!_0x45d623[_0x957e('0x24')]){throw new Error(_0x957e('0x7e'));}}catch(_0x1df71d){throw new Error(_0x957e('0x7f'));}var _0x491aaa=[];try{_0x491aaa=_['map'](JSON['parse'](process[_0x957e('0x79')][0x4]),'id');}catch(_0x578df3){logger[_0x957e('0x3d')](_0x957e('0x80'));}main(_0x11f418,_0x45d623,_0x491aaa,_0x7764d9);}validate();process['on']('SIGINT',handleStop);process['on'](_0x957e('0x81'),handleUncaughtException); \ No newline at end of file +var _0x6b66=['ListId\x20is\x20mandatory','body\x20id\x20mandatory','No\x20agent\x20available','SIGINT','uncaughtException','lodash','papaparse','util','bluebird','moment','squel','ioredis','../../../config/logger','defaults','redis','localhost','socket.io-emitter','format','YYYY-MM-DD\x20HH:mm:ss','test','select','field','phone','.dialCheckDuplicateType\x20IN\x20(','join','cm_contacts.ListId','cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','insert','into','cm_hopper','fromQuery','scheduledat','ContactId','ListId','createdAt','updatedAt','UserId','recallme','fields','from','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','where','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','cm_hopper_black','toString','concat','keys','CompanyId','cm_contacts','ListId\x20=\x20?','deletedAt\x20IS\x20NULL','MIN(id)','min_id','info','Received\x20SIGINT','error','exit','errors','message','query','catch','start','binding','server/files/tmp','.csv','writeFileSync','parse','data','length','rows','hasOwnProperty','isValid','push','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNumber','includes','agent\x20not\x20exists','email\x20wrong\x20format','dateOfBirth','YYYY-MM-DD','dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','\x20LIKE\x20cm_contacts;','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns','CampaignId','each','finish','affectedRows','unlink','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','firstName\x20is\x20mandatory'];(function(_0x5a1378,_0x7ff4){var _0x405f6f=function(_0x3034cb){while(--_0x3034cb){_0x5a1378['push'](_0x5a1378['shift']());}};_0x405f6f(++_0x7ff4);}(_0x6b66,0xfb));var _0x66b6=function(_0x1cf600,_0x5445d0){_0x1cf600=_0x1cf600-0x0;var _0x2a474c=_0x6b66[_0x1cf600];return _0x2a474c;};'use strict';var fs=require('fs');var path=require('path');var _=require(_0x66b6('0x0'));var Papa=require(_0x66b6('0x1'));var util=require(_0x66b6('0x2'));var BPromise=require(_0x66b6('0x3'));var moment=require(_0x66b6('0x4'));var squel=require(_0x66b6('0x5'));var Redis=require(_0x66b6('0x6'));var db=require('../../../mysqldb')['db'];var config=require('../../../config/environment');var logger=require(_0x66b6('0x7'))('import');config['redis']=_[_0x66b6('0x8')](config[_0x66b6('0x9')],{'host':_0x66b6('0xa'),'port':0x18eb});var socket=require(_0x66b6('0xb'))(new Redis(config[_0x66b6('0x9')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x66b6('0xc')](_0x66b6('0xd'));function isEmail(_0x25586e){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))*$/[_0x66b6('0xe')](_0x25586e);}function selectNotIn(_0x36c307,_0x1b4dc0,_0x1ed0b0,_0x2a0b37,_0xeaa31a){return squel[_0x66b6('0xf')]()[_0x66b6('0x10')](_0x66b6('0x11'))['from'](_0x2a0b37)['join'](_0x1b4dc0,null,_0x1b4dc0+'.id\x20=\x20'+_0x2a0b37+'.'+_0x1ed0b0)['where'](_0x2a0b37+'.'+_0x1ed0b0+'\x20=\x20'+_0x36c307+'.'+_0x1ed0b0)['where'](_0x1b4dc0+_0x66b6('0x12')+_0xeaa31a[_0x66b6('0x13')]()+')');}function insertCmHopper(_0x4ef0b7,_0x37019a,_0xc77d89,_0x59cf40,_0x4e3c6d){var _0x102345=['cm_contacts.phone','cm_contacts.scheduledat','cm_contacts.id',_0x66b6('0x14'),_0x37019a+'.'+_0x59cf40,'cm_contacts.createdAt',_0x66b6('0x15'),_0x66b6('0x16'),_0x66b6('0x17'),'\x22'+_0x4e3c6d+'\x22'];return squel[_0x66b6('0x18')]()[_0x66b6('0x19')](_0x66b6('0x1a'))[_0x66b6('0x1b')]([_0x66b6('0x11'),_0x66b6('0x1c'),_0x66b6('0x1d'),_0x66b6('0x1e'),_0x59cf40,_0x66b6('0x1f'),_0x66b6('0x20'),'priority',_0x66b6('0x21'),_0x66b6('0x22')],squel[_0x66b6('0xf')]()[_0x66b6('0x23')](_0x102345)[_0x66b6('0x24')](_0x37019a)['join']('cm_contacts',null,_0x66b6('0x25')+_0x37019a+_0x66b6('0x26'))[_0x66b6('0x13')](_0xc77d89,null,_0xc77d89+_0x66b6('0x27')+_0x37019a+'.'+_0x59cf40)[_0x66b6('0x28')](_0x37019a+_0x66b6('0x29'),_0x4ef0b7)[_0x66b6('0x28')](_0x66b6('0x2a'),NOW)[_0x66b6('0x28')](_0x66b6('0x2b'),selectNotIn(_0x37019a,_0xc77d89,_0x59cf40,_0x66b6('0x1a'),[_0x66b6('0x2c'),_0x66b6('0x2d')]))['where'](_0x66b6('0x2b'),selectNotIn(_0x37019a,_0xc77d89,_0x59cf40,_0x66b6('0x1a'),[_0x66b6('0x2c')])))['toString']();}function insertCmHopperBlack(_0xffb4d2,_0x386747,_0x34a899,_0x4ed9c0){var _0x470f30=[_0x66b6('0x2e'),_0x66b6('0x2f'),_0x66b6('0x14'),_0x386747+'.'+_0x4ed9c0,_0x66b6('0x30'),'cm_contacts.updatedAt'];return squel['insert']()['into'](_0x66b6('0x31'))[_0x66b6('0x1b')]([_0x66b6('0x11'),'ContactId',_0x66b6('0x1e'),_0x4ed9c0,_0x66b6('0x1f'),_0x66b6('0x20')],squel[_0x66b6('0xf')]()[_0x66b6('0x23')](_0x470f30)['from'](_0x386747)[_0x66b6('0x13')]('cm_contacts',null,_0x66b6('0x25')+_0x386747+_0x66b6('0x26'))[_0x66b6('0x13')](_0x34a899,null,_0x34a899+_0x66b6('0x27')+_0x386747+'.'+_0x4ed9c0)[_0x66b6('0x28')](_0x386747+_0x66b6('0x29'),_0xffb4d2)[_0x66b6('0x28')](_0x66b6('0x2a'),NOW)[_0x66b6('0x28')](_0x66b6('0x2b'),squel[_0x66b6('0xf')]()[_0x66b6('0x10')](_0x66b6('0x11'))['from'](_0x66b6('0x31'))['where']('ListId\x20=\x20?',_0xffb4d2)[_0x66b6('0x28')](_0x4ed9c0+'\x20=\x20?',_0x386747+'.'+_0x4ed9c0)))[_0x66b6('0x32')]();}function insertCmContact(_0x49e02a,_0x292dfc,_0x413eb5,_0x2519a7){var _0x159625=_[_0x66b6('0x33')](_[_0x66b6('0x34')](_0x2519a7),[_0x66b6('0x1e'),_0x66b6('0x35'),'createdAt','updatedAt']);return squel[_0x66b6('0x18')]()[_0x66b6('0x19')](_0x66b6('0x36'))[_0x66b6('0x1b')](_0x159625,squel[_0x66b6('0xf')]()['fields'](_0x159625)[_0x66b6('0x24')](_0x292dfc)[_0x66b6('0x28')]('('+_0x413eb5[_0x66b6('0x13')](',')+')\x20NOT\x20IN\x20?',squel['select']()[_0x66b6('0x23')](_0x413eb5)['from'](_0x66b6('0x36'))[_0x66b6('0x28')](_0x66b6('0x37'),_0x49e02a)[_0x66b6('0x28')](_0x66b6('0x38')))[_0x66b6('0x28')]('id\x20IN\x20?',squel[_0x66b6('0xf')]()[_0x66b6('0x10')](_0x66b6('0x39'),_0x66b6('0x3a'))['from'](_0x292dfc)['group'](_0x413eb5[_0x66b6('0x13')](','))))[_0x66b6('0x32')]();}function handleStop(){logger[_0x66b6('0x3b')](_0x66b6('0x3c'));stopped=!![];}function handleUncaughtException(_0x31e844){logger[_0x66b6('0x3d')](_0x31e844['message']);process[_0x66b6('0x3e')](0x1);}function handleError(_0x4d9457,_0x299ef6){stats[_0x66b6('0x3f')]['push']({'name':_0x299ef6['code'],'message':_0x299ef6[_0x66b6('0x40')],'row':_0x4d9457});}function handleQuery(_0x27a417){logger[_0x66b6('0x3b')](_0x27a417);return db['sequelize'][_0x66b6('0x41')](_0x27a417)['spread'](function(_0x2815ec){results['push'](_0x2815ec);})[_0x66b6('0x42')](function(_0x13edb6){logger[_0x66b6('0x3d')](_0x13edb6[_0x66b6('0x40')]);});}function main(_0x461056,_0x1c1b53,_0x11f70a,_0x298b7e){logger[_0x66b6('0x3b')]('main',_0x461056,JSON['stringify'](_0x1c1b53));process['send'](_0x66b6('0x43'));var _0x91010=_0x1c1b53[_0x66b6('0x44')];var _0x201905=_0x1c1b53['socket_timestamp'];var _0x53a279=path[_0x66b6('0x13')](config['root'],_0x66b6('0x45'),_0x201905+_0x66b6('0x46'));var _0x1db021=_[_0x66b6('0x34')](_0x91010)[_0x66b6('0x13')]();logger['info']('header',_0x1db021);fs[_0x66b6('0x47')](_0x53a279,_0x1db021+'\x0a');Papa[_0x66b6('0x48')](fs['createReadStream'](_0x461056),{'header':!![],'skipEmptyLines':!![],'step':function(_0x1ccf4,_0x10980){try{for(var _0x18f639=0x0,_0x4008a5=[];_0x18f639<_0x1ccf4[_0x66b6('0x49')][_0x66b6('0x4a')];_0x18f639++){stats[_0x66b6('0x4b')]+=0x1;if(_0x1ccf4[_0x66b6('0x3f')][_0x18f639]){handleError(_0x1ccf4[_0x66b6('0x49')][_0x18f639],_0x1ccf4[_0x66b6('0x3f')][_0x18f639]);}else{var _0x9f838f=[];for(var _0x498cae in _0x91010){if(_0x91010[_0x66b6('0x4c')](_0x498cae)){if(_0x1ccf4[_0x66b6('0x49')][_0x18f639][_0x91010[_0x498cae]]){var _0x5dd917=_['trim'](_0x1ccf4[_0x66b6('0x49')][_0x18f639][_0x91010[_0x498cae]]['replace'](/"/g,'\x27'));switch(_0x498cae){case _0x66b6('0x1c'):var _0x1486ff=moment(_0x5dd917,_0x66b6('0xd'),!![]);if(_0x1486ff[_0x66b6('0x4d')]()){_0x4008a5[_0x66b6('0x4e')]('\x22'+_0x5dd917+'\x22');}else{_0x9f838f[_0x66b6('0x4e')](_0x66b6('0x4f'));}break;case _0x66b6('0x50'):var _0x107d6e=parseInt(_0x5dd917);_0x5dd917=_['isNaN'](_0x107d6e)||_0x107d6e<0x0||_0x107d6e>0x4?_0x298b7e?0x3:0x2:_0x107d6e;_0x4008a5[_0x66b6('0x4e')]('\x22'+_0x5dd917+'\x22');break;case'UserId':var _0xb3c108=parseInt(_0x5dd917);if(_[_0x66b6('0x51')](_0xb3c108)&&_[_0x66b6('0x52')](_0x11f70a,_0xb3c108)){_0x4008a5['push']('\x22'+_0xb3c108+'\x22');}else{_0x9f838f[_0x66b6('0x4e')](_0x66b6('0x53'));}break;case'email':if(isEmail(_0x5dd917)){_0x4008a5['push']('\x22'+_0x5dd917+'\x22');}else{_0x9f838f[_0x66b6('0x4e')](_0x66b6('0x54'));}break;case _0x66b6('0x55'):var _0x1c34ee=moment(_0x5dd917,_0x66b6('0x56'),!![]);if(_0x1c34ee[_0x66b6('0x4d')]()){_0x4008a5['push']('\x22'+_0x5dd917+'\x22');}else{_0x9f838f[_0x66b6('0x4e')](_0x66b6('0x57'));}break;default:_0x4008a5[_0x66b6('0x4e')]('\x22'+_0x5dd917+'\x22');}}else{switch(_0x498cae){case'firstName':case _0x66b6('0x11'):_0x9f838f[_0x66b6('0x4e')](_0x498cae+_0x66b6('0x58'));break;default:_0x4008a5[_0x66b6('0x4e')]('\x22\x22');}}}}if(_0x9f838f[_0x66b6('0x4a')]){handleError(_0x1ccf4[_0x66b6('0x49')][_0x18f639],{'code':_0x66b6('0x59'),'message':_0x9f838f[_0x66b6('0x13')]()});}else{fs[_0x66b6('0x5a')](_0x53a279,_0x4008a5[_0x66b6('0x13')]()+'\x0a');}_0x4008a5=[];}if(!(stats[_0x66b6('0x4b')]%0xc8)){socket[_0x66b6('0x5b')](_0x66b6('0x5c')+_0x201905,stats);stats[_0x66b6('0x3f')]=[];}}if(stopped){logger[_0x66b6('0x3b')](_0x66b6('0x5d'));_0x10980[_0x66b6('0x5e')]();}}catch(_0x32829e){handleError(_0x1ccf4['data'][_0x18f639],{'code':_0x66b6('0x5f'),'message':_0x32829e[_0x66b6('0x40')]});logger[_0x66b6('0x3d')]('step',_0x32829e[_0x66b6('0x40')]);}},'complete':function(){try{var _0x28e6fb=[];var _0x2d44f2=_0x66b6('0x36');if(_0x1c1b53[_0x66b6('0x60')]&&_0x1c1b53[_0x66b6('0x60')]['length']){_0x2d44f2=_0x66b6('0x61')+_0x201905;_0x28e6fb[_0x66b6('0x4e')]('CREATE\x20TABLE\x20'+_0x2d44f2+_0x66b6('0x62'));}var _0x47692b=util[_0x66b6('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',_0x53a279,_0x2d44f2,_0x1db021,_0x1c1b53[_0x66b6('0x1e')],_0x1c1b53[_0x66b6('0x35')]||null,NOW,NOW);if(_[_0x66b6('0x63')](_0x91010[_0x66b6('0x1c')])){_0x47692b+=_0x66b6('0x64');}_0x28e6fb[_0x66b6('0x4e')](_0x47692b);if(_0x1c1b53[_0x66b6('0x60')]&&_0x1c1b53[_0x66b6('0x60')][_0x66b6('0x4a')]){_0x28e6fb[_0x66b6('0x4e')](insertCmContact(_0x1c1b53['ListId'],_0x2d44f2,_0x1c1b53[_0x66b6('0x60')],_0x91010));_0x28e6fb['push'](_0x66b6('0x65')+_0x2d44f2+';');}_0x28e6fb['push'](insertCmHopper(_0x1c1b53[_0x66b6('0x1e')],_0x66b6('0x66'),_0x66b6('0x67'),_0x66b6('0x68'),_0x298b7e));_0x28e6fb[_0x66b6('0x4e')](insertCmHopperBlack(_0x1c1b53[_0x66b6('0x1e')],'voice_queues_has_cm_blacklists',_0x66b6('0x67'),_0x66b6('0x68')));_0x28e6fb[_0x66b6('0x4e')](insertCmHopper(_0x1c1b53['ListId'],'campaigns_has_cm_lists',_0x66b6('0x69'),_0x66b6('0x6a'),_0x298b7e));_0x28e6fb['push'](insertCmHopperBlack(_0x1c1b53[_0x66b6('0x1e')],'campaigns_has_cm_blacklists','campaigns',_0x66b6('0x6a')));BPromise[_0x66b6('0x6b')](_0x28e6fb,handleQuery)['then'](function(_0x2e5c47){stats[_0x66b6('0x6c')]=!![];stats[_0x66b6('0x6d')]=_0x1c1b53[_0x66b6('0x60')]&&_0x1c1b53[_0x66b6('0x60')][_0x66b6('0x4a')]?results[0x2][_0x66b6('0x6d')]:results[0x0][_0x66b6('0x6d')];socket['emit'](_0x66b6('0x5c')+_0x201905,stats);fs[_0x66b6('0x6e')](_0x461056);fs[_0x66b6('0x6e')](_0x53a279);process[_0x66b6('0x3e')](0x0);})[_0x66b6('0x42')](function(_0xa53a47){logger['error'](_0xa53a47[_0x66b6('0x40')]);process[_0x66b6('0x3e')](0x1);});}catch(_0x4c76ec){logger[_0x66b6('0x3d')]('complete',_0x4c76ec[_0x66b6('0x40')]);process[_0x66b6('0x3e')](0x1);}},'error':function(_0x1e4bb5,_0x243e37,_0x3cc4a0,_0x16d458){throw new Error(_0x16d458);}});}function validate(){if(process['argv']&&process[_0x66b6('0x6f')][_0x66b6('0x4a')]<0x4){throw new Error(_0x66b6('0x70'));}var _0x4253da=path[_0x66b6('0x13')](config[_0x66b6('0x71')],'server/files/tmp',process[_0x66b6('0x6f')][0x2]);if(!fs[_0x66b6('0x72')](_0x4253da)){throw new Error(_0x66b6('0x73'));}var _0x347473={};try{_0x347473=JSON[_0x66b6('0x48')](process['argv'][0x3]);if(!_0x347473['binding']){throw new Error('binding\x20doesn\x27t\x20exists');}if(!_0x347473[_0x66b6('0x44')]['phone']){throw new Error(_0x66b6('0x74'));}if(!_0x347473[_0x66b6('0x44')]['firstName']){throw new Error(_0x66b6('0x75'));}var _0x3479cf=0x0;if(_0x347473[_0x66b6('0x44')][_0x66b6('0x21')]){_0x3479cf=0x1;}if(!_0x347473[_0x66b6('0x1e')]){throw new Error(_0x66b6('0x76'));}}catch(_0xd24e39){throw new Error(_0x66b6('0x77'));}var _0x17e18b=[];try{_0x17e18b=_['map'](JSON[_0x66b6('0x48')](process[_0x66b6('0x6f')][0x4]),'id');}catch(_0x5cfbef){logger['info'](_0x66b6('0x78'));}main(_0x4253da,_0x347473,_0x17e18b,_0x3479cf);}validate();process['on'](_0x66b6('0x79'),handleStop);process['on'](_0x66b6('0x7a'),handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index 7776991..09375cf 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 _0x657b=['Agent\x20Name','Agent\x20Number','destcalleridnum','***\x20Time\x20Info\x20***','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','talktime','Member\x20Name','membername','starttime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','toLowerCase','voice','inbound','push','variable','queue','calleridnum','Outbound\x20Call','getDescriptions','***\x20Call\x20Info\x20***','Caller\x20Number','keyValue','Caller\x20Name','calleridname','Call\x20To','Queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***'];(function(_0xd1f666,_0x322ef6){var _0x532761=function(_0x637210){while(--_0x637210){_0xd1f666['push'](_0xd1f666['shift']());}};_0x532761(++_0x322ef6);}(_0x657b,0x131));var _0xb657=function(_0x2d89c1,_0x3cd940){_0x2d89c1=_0x2d89c1-0x0;var _0x151ddc=_0x657b[_0x2d89c1];return _0x151ddc;};'use strict';exports[_0xb657('0x0')]=function(_0x36a267,_0x92c328){var _0x329887=[{'type':_0xb657('0x1'),'content':'[xCALLY\x20Ticket]','variableName':null}];switch(_0x36a267[_0xb657('0x2')]()){case _0xb657('0x3'):switch(_0x92c328['toLowerCase']()){case _0xb657('0x4'):_0x329887[_0xb657('0x5')]({'type':_0xb657('0x6'),'content':'','variableName':_0xb657('0x7')});_0x329887[_0xb657('0x5')]({'type':'variable','content':'','variableName':_0xb657('0x8')});break;case'outbound':_0x329887[_0xb657('0x5')]({'type':_0xb657('0x1'),'content':_0xb657('0x9'),'variableName':null});_0x329887['push']({'type':_0xb657('0x6'),'content':'','variableName':'destcalleridnum'});break;}}return _0x329887;};exports[_0xb657('0xa')]=function(_0x569983,_0x2a3189){var _0x19398c=[];switch(_0x569983[_0xb657('0x2')]()){case'voice':switch(_0x2a3189[_0xb657('0x2')]()){case _0xb657('0x4'):_0x19398c=[{'type':_0xb657('0x1'),'content':_0xb657('0xb'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb657('0xc'),'keyType':_0xb657('0x6'),'variableName':'calleridnum'},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0xe'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0xf')},{'type':'keyValue','content':'','key':_0xb657('0x10'),'keyType':_0xb657('0x6'),'variableName':'destexten'},{'type':'keyValue','content':'','key':_0xb657('0x11'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0x7')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x12'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0x13')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x14'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0x15')},{'type':'string','content':_0xb657('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x17'),'keyType':_0xb657('0x6'),'variableName':'destcalleridname'},{'type':'keyValue','content':'','key':_0xb657('0x18'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0x19')},{'type':'string','content':_0xb657('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0xb657('0x1b'),'keyType':_0xb657('0x6'),'variableName':_0xb657('0x15')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x1c'),'keyType':'variable','variableName':_0xb657('0x1d')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x1e'),'keyType':_0xb657('0x6'),'variableName':'agentcompleteAt'},{'type':_0xb657('0xd'),'content':'','key':'Hold\x20Time','keyType':_0xb657('0x6'),'variableName':'holdtime'},{'type':_0xb657('0xd'),'content':'','key':'Talk\x20Time','keyType':_0xb657('0x6'),'variableName':_0xb657('0x1f')}];break;case'outbound':_0x19398c=[{'type':_0xb657('0x1'),'content':_0xb657('0xb'),'variableName':null},{'type':_0xb657('0xd'),'content':'','key':'Called\x20Number','keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x19')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x20'),'keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x21')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x12'),'keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x13')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x14'),'keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x22')},{'type':_0xb657('0x1'),'content':_0xb657('0x1a')},{'type':_0xb657('0xd'),'content':'','key':'Answer\x20Time','keyType':_0xb657('0x6'),'keyContent':'','variableName':'answertime'},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x23'),'keyType':'variable','keyContent':'','variableName':_0xb657('0x24')},{'type':_0xb657('0xd'),'content':'','key':_0xb657('0x25'),'keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x26')},{'type':'keyValue','content':'','key':_0xb657('0x27'),'keyType':_0xb657('0x6'),'keyContent':'','variableName':_0xb657('0x28')}];break;}}return _0x19398c;}; \ No newline at end of file +var _0x5713=['destexten','Queue','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','Agent\x20Ring','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','talktime','Called\x20Number','Member\x20Name','UniqueId','uniqueid','***\x20Time\x20Info\x20***','Answer\x20Time','answertime','Complete\x20Time','endtime','Duration','duration','Billable\x20Time','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','variable','queue','push','calleridnum','outbound','string','Outbound\x20Call','destcalleridnum','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To'];(function(_0x1f5671,_0x1006bc){var _0xd31d50=function(_0x30c3d5){while(--_0x30c3d5){_0x1f5671['push'](_0x1f5671['shift']());}};_0xd31d50(++_0x1006bc);}(_0x5713,0x1c7));var _0x3571=function(_0x3d51e5,_0x35476d){_0x3d51e5=_0x3d51e5-0x0;var _0x237b80=_0x5713[_0x3d51e5];return _0x237b80;};'use strict';exports[_0x3571('0x0')]=function(_0x1c6ff4,_0x47e130){var _0x2d28f5=[{'type':'string','content':_0x3571('0x1'),'variableName':null}];switch(_0x1c6ff4[_0x3571('0x2')]()){case _0x3571('0x3'):switch(_0x47e130[_0x3571('0x2')]()){case'inbound':_0x2d28f5['push']({'type':_0x3571('0x4'),'content':'','variableName':_0x3571('0x5')});_0x2d28f5[_0x3571('0x6')]({'type':_0x3571('0x4'),'content':'','variableName':_0x3571('0x7')});break;case _0x3571('0x8'):_0x2d28f5['push']({'type':_0x3571('0x9'),'content':_0x3571('0xa'),'variableName':null});_0x2d28f5[_0x3571('0x6')]({'type':_0x3571('0x4'),'content':'','variableName':_0x3571('0xb')});break;}}return _0x2d28f5;};exports['getDescriptions']=function(_0x4b2977,_0x4177c5){var _0x33cb1b=[];switch(_0x4b2977[_0x3571('0x2')]()){case'voice':switch(_0x4177c5['toLowerCase']()){case'inbound':_0x33cb1b=[{'type':'string','content':_0x3571('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0xe'),'keyType':_0x3571('0x4'),'variableName':_0x3571('0x7')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0xf'),'keyType':_0x3571('0x4'),'variableName':_0x3571('0x10')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x11'),'keyType':_0x3571('0x4'),'variableName':_0x3571('0x12')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x13'),'keyType':_0x3571('0x4'),'variableName':'queue'},{'type':'keyValue','content':'','key':'UniqueId','keyType':_0x3571('0x4'),'variableName':'uniqueid'},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x14'),'keyType':'variable','variableName':_0x3571('0x15')},{'type':_0x3571('0x9'),'content':_0x3571('0x16'),'key':null,'keyType':null,'variableName':null},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x17'),'keyType':_0x3571('0x4'),'variableName':'destcalleridname'},{'type':_0x3571('0xd'),'content':'','key':'Agent\x20Number','keyType':_0x3571('0x4'),'variableName':_0x3571('0xb')},{'type':'string','content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x3571('0x18'),'keyType':_0x3571('0x4'),'variableName':_0x3571('0x15')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x19'),'keyType':'variable','variableName':_0x3571('0x1a')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x1b'),'keyType':_0x3571('0x4'),'variableName':_0x3571('0x1c')},{'type':'keyValue','content':'','key':_0x3571('0x1d'),'keyType':_0x3571('0x4'),'variableName':'holdtime'},{'type':_0x3571('0xd'),'content':'','key':'Talk\x20Time','keyType':_0x3571('0x4'),'variableName':_0x3571('0x1e')}];break;case _0x3571('0x8'):_0x33cb1b=[{'type':_0x3571('0x9'),'content':_0x3571('0xc'),'variableName':null},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x1f'),'keyType':'variable','keyContent':'','variableName':_0x3571('0xb')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x20'),'keyType':'variable','keyContent':'','variableName':'membername'},{'type':'keyValue','content':'','key':_0x3571('0x21'),'keyType':'variable','keyContent':'','variableName':_0x3571('0x22')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x14'),'keyType':'variable','keyContent':'','variableName':'starttime'},{'type':_0x3571('0x9'),'content':_0x3571('0x23')},{'type':'keyValue','content':'','key':_0x3571('0x24'),'keyType':'variable','keyContent':'','variableName':_0x3571('0x25')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x26'),'keyType':_0x3571('0x4'),'keyContent':'','variableName':_0x3571('0x27')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x28'),'keyType':'variable','keyContent':'','variableName':_0x3571('0x29')},{'type':_0x3571('0xd'),'content':'','key':_0x3571('0x2a'),'keyType':_0x3571('0x4'),'keyContent':'','variableName':'billableseconds'}];break;}}return _0x33cb1b;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index c86f959..7b97b06 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 _0x6789=['error','user','query','clone','body','omit','html','mobile','../../config/logger','openchannel-interactions','upperFirst','InteractionId','toUpperCase','stringify','Interaction','findOne','then','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6789,0x13a));var _0x9678=function(_0x10ef34,_0x16d104){_0x10ef34=_0x10ef34-0x0;var _0x1dc990=_0x6789[_0x10ef34];return _0x1dc990;};'use strict';var _=require('lodash');var db=require('../../mysqldb')['db'];var loggers={'openchannel':require(_0x9678('0x0'))(_0x9678('0x1')),'mail':require('../../config/logger')('mail-interactions'),'fax':require('../../config/logger')('fax-interactions'),'sms':require(_0x9678('0x0'))('sms-interactions'),'chat':require(_0x9678('0x0'))('chat-interactions')};function getInteractionId(_0x43dddc,_0x2e6080,_0x58474c){if(_0x43dddc&&_0x43dddc[_[_0x9678('0x2')](_0x58474c)+_0x9678('0x3')]){return _0x43dddc[_[_0x9678('0x2')](_0x58474c)+_0x9678('0x3')];}else if(_0x43dddc&&_0x43dddc['id']){return _0x43dddc['id'];}else if(_0x2e6080&&_0x2e6080['id']){return _0x2e6080['id'];}else{return'unknown';}}function log(_0x285f7c,_0x25c0c3,_0x9676d2,_0x486efe,_0x11fb21,_0xa2c67){loggers[_0x11fb21['toLowerCase']()][_0x285f7c]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0xa2c67[_0x9678('0x4')](),_0x25c0c3?_0x25c0c3['id']:null,_0x25c0c3?_0x25c0c3['name']:null,_0x25c0c3?_0x25c0c3['role']:null,getInteractionId(_0x9676d2,_0x486efe,_0x11fb21),_0x9676d2?JSON[_0x9678('0x5')](_0x9676d2):'null');}function updateUser(_0x3bbd19,_0x1cfd75,_0xeebbc6,_0x3b91a3,_0x4272af){db[_['upperFirst'](_0x3b91a3)+_0x9678('0x6')][_0x9678('0x7')]({'where':{'id':getInteractionId(_0x1cfd75,_0xeebbc6,_0x3b91a3)}})[_0x9678('0x8')](function(_0x5964ab){if(_0x5964ab){return _0x5964ab[_0x9678('0x9')]({'UserId':_0x3bbd19?_0x3bbd19['id']:null});}})[_0x9678('0x8')](function(_0x39c74b){if(_0x39c74b){log('info',_0x3bbd19,_0x1cfd75,_0xeebbc6,_0x3b91a3,_0x4272af);}})['catch'](function(){log(_0x9678('0xa'),_0x3bbd19,_0x1cfd75,_0xeebbc6,_0x3b91a3,_0x4272af);});}exports['tracked']=function(_0x60de59,_0x3a4d91){return function(_0x50f4ae,_0x24529d,_0x2a614b){var _0x3adf54=_0x50f4ae[_0x9678('0xb')];var _0x4aef2f={};var _0xc17623=_0x50f4ae[_0x9678('0xc')];if(_0x4aef2f){_0x4aef2f=_[_0x9678('0xd')](_0x50f4ae[_0x9678('0xe')]);_0x4aef2f=_[_0x9678('0xf')](_0x4aef2f,['body',_0x9678('0x10'),'phone','fax',_0x9678('0x11')]);}updateUser(_0x3adf54,_0x4aef2f,_0xc17623,_0x60de59,_0x3a4d91);_0x2a614b(null);};}; \ No newline at end of file +var _0x95e9=['../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','chat-interactions','InteractionId','upperFirst','toLowerCase','role','null','Interaction','then','info','error','query','body','html','phone','fax','mobile','lodash','../../mysqldb'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0x95e9,0x82));var _0x995e=function(_0x25c846,_0x1582a4){_0x25c846=_0x25c846-0x0;var _0x358256=_0x95e9[_0x25c846];return _0x358256;};'use strict';var _=require(_0x995e('0x0'));var db=require(_0x995e('0x1'))['db'];var loggers={'openchannel':require(_0x995e('0x2'))(_0x995e('0x3')),'mail':require('../../config/logger')(_0x995e('0x4')),'fax':require(_0x995e('0x2'))(_0x995e('0x5')),'sms':require(_0x995e('0x2'))('sms-interactions'),'chat':require(_0x995e('0x2'))(_0x995e('0x6'))};function getInteractionId(_0x1b98c1,_0x395220,_0x5ad63c){if(_0x1b98c1&&_0x1b98c1[_['upperFirst'](_0x5ad63c)+_0x995e('0x7')]){return _0x1b98c1[_[_0x995e('0x8')](_0x5ad63c)+_0x995e('0x7')];}else if(_0x1b98c1&&_0x1b98c1['id']){return _0x1b98c1['id'];}else if(_0x395220&&_0x395220['id']){return _0x395220['id'];}else{return'unknown';}}function log(_0x28453a,_0x184f5b,_0xca11b0,_0x3addbc,_0xd66c08,_0x1de374){loggers[_0xd66c08[_0x995e('0x9')]()][_0x28453a]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x1de374['toUpperCase'](),_0x184f5b?_0x184f5b['id']:null,_0x184f5b?_0x184f5b['name']:null,_0x184f5b?_0x184f5b[_0x995e('0xa')]:null,getInteractionId(_0xca11b0,_0x3addbc,_0xd66c08),_0xca11b0?JSON['stringify'](_0xca11b0):_0x995e('0xb'));}function updateUser(_0x569299,_0x309088,_0x330d4e,_0x475584,_0x460e99){db[_['upperFirst'](_0x475584)+_0x995e('0xc')]['findOne']({'where':{'id':getInteractionId(_0x309088,_0x330d4e,_0x475584)}})['then'](function(_0x2a84da){if(_0x2a84da){return _0x2a84da['update']({'UserId':_0x569299?_0x569299['id']:null});}})[_0x995e('0xd')](function(_0x23ab95){if(_0x23ab95){log(_0x995e('0xe'),_0x569299,_0x309088,_0x330d4e,_0x475584,_0x460e99);}})['catch'](function(){log(_0x995e('0xf'),_0x569299,_0x309088,_0x330d4e,_0x475584,_0x460e99);});}exports['tracked']=function(_0x190d9a,_0xb6aa18){return function(_0x28b865,_0x2783af,_0x2b4c51){var _0x184838=_0x28b865['user'];var _0xf6c31e={};var _0x25b934=_0x28b865[_0x995e('0x10')];if(_0xf6c31e){_0xf6c31e=_['clone'](_0x28b865[_0x995e('0x11')]);_0xf6c31e=_['omit'](_0xf6c31e,[_0x995e('0x11'),_0x995e('0x12'),_0x995e('0x13'),_0x995e('0x14'),_0x995e('0x15')]);}updateUser(_0x184838,_0xf6c31e,_0x25b934,_0x190d9a,_0xb6aa18);_0x2b4c51(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 095b9e4..4f3cf51 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 _0x4fc8=['%s:%s:%s','base64','utf8','final','parse','hasOwnProperty','use','findOne','then','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','admin','user','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format'];(function(_0x113bef,_0x82b4a5){var _0x3b6d82=function(_0xc0df02){while(--_0xc0df02){_0x113bef['push'](_0x113bef['shift']());}};_0x3b6d82(++_0x82b4a5);}(_0x4fc8,0x11f));var _0x84fc=function(_0x1112f7,_0x5b3889){_0x1112f7=_0x1112f7-0x0;var _0x41dd68=_0x4fc8[_0x1112f7];return _0x41dd68;};'use strict';var crypto=require('crypto');var util=require(_0x84fc('0x0'));var compose=require(_0x84fc('0x1'));var db=require(_0x84fc('0x2'))['db'];var config=require(_0x84fc('0x3'));function getValueFromLicense(_0x83e3fc,_0x132488){if(_0x83e3fc&&_0x132488){if(_0x132488[_0x84fc('0x4')]&&_0x132488['license']){var _0x2af360=_0x132488[_0x84fc('0x4')];var _0x58b507=_0x132488[_0x84fc('0x5')];var _0x6de886=_0x2af360[_0x84fc('0x6')]('-')[0x4];var _0x40f1d0=_0x2af360[_0x84fc('0x6')]('-')[0x0];var _0x1ef066=crypto[_0x84fc('0x7')](_0x84fc('0x8'),util[_0x84fc('0x9')](_0x84fc('0xa'),_0x6de886,_0x2af360,_0x40f1d0));var _0x1a12d1=_0x1ef066['update'](_0x58b507,_0x84fc('0xb'),_0x84fc('0xc'));_0x1a12d1+=_0x1ef066[_0x84fc('0xd')]('utf8');var _0x3833bd=JSON[_0x84fc('0xe')](_0x1a12d1);return _0x3833bd[_0x84fc('0xf')](_0x83e3fc)?_0x3833bd[_0x83e3fc]:null;}}return null;}function isLimit(_0xbb5c9e,_0x339399,_0x1624d0,_0x4fd457){var _0xb9e862=_0x339399;return compose()[_0x84fc('0x10')](function(_0x1c482e,_0x371361,_0x3e57da){return db['License'][_0x84fc('0x11')]({'where':{'id':0x1},'raw':!![]})['then'](function(_0x3d638e){var _0x4176fb=getValueFromLicense(_0xbb5c9e,_0x3d638e);return _0x4176fb?_0x4176fb:_0xb9e862;})[_0x84fc('0x12')](function(_0x2d4125){_0xb9e862=_0x2d4125;return _0x1624d0['count'](_0x4fd457);})['then'](function(_0x29a6cc){if(_0x29a6cc>=_0xb9e862){return _0x371361[_0x84fc('0x13')](0x193)[_0x84fc('0x14')]({'message':util[_0x84fc('0x9')](_0x84fc('0x15'),_0xbb5c9e)});}_0x3e57da();})[_0x84fc('0x16')](function(_0x2d7248){_0x3e57da(_0x2d7248);});});}function isUserLimit(){return isLimit(_0x84fc('0x17'),0x1,db[_0x84fc('0x18')],{'where':{'$or':[{'role':_0x84fc('0x19')},{'role':_0x84fc('0x1a')}]}});}exports['isUserLimit']=isUserLimit; \ No newline at end of file +var _0x1ddc=['User','isUserLimit','util','composable-middleware','../../mysqldb','../../config/environment','data1','license','split','createDecipher','aes-256-ctr','format','update','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','status','json','catch'];(function(_0x3d26a9,_0x8a9b43){var _0x1cb313=function(_0x106b09){while(--_0x106b09){_0x3d26a9['push'](_0x3d26a9['shift']());}};_0x1cb313(++_0x8a9b43);}(_0x1ddc,0x122));var _0xc1dd=function(_0x4c723b,_0x2c5cf2){_0x4c723b=_0x4c723b-0x0;var _0x1928dd=_0x1ddc[_0x4c723b];return _0x1928dd;};'use strict';var crypto=require('crypto');var util=require(_0xc1dd('0x0'));var compose=require(_0xc1dd('0x1'));var db=require(_0xc1dd('0x2'))['db'];var config=require(_0xc1dd('0x3'));function getValueFromLicense(_0x39404d,_0x4dfde5){if(_0x39404d&&_0x4dfde5){if(_0x4dfde5[_0xc1dd('0x4')]&&_0x4dfde5[_0xc1dd('0x5')]){var _0x51db97=_0x4dfde5['data1'];var _0x531ba6=_0x4dfde5[_0xc1dd('0x5')];var _0x26f640=_0x51db97[_0xc1dd('0x6')]('-')[0x4];var _0x2749fb=_0x51db97[_0xc1dd('0x6')]('-')[0x0];var _0x4d697a=crypto[_0xc1dd('0x7')](_0xc1dd('0x8'),util[_0xc1dd('0x9')]('%s:%s:%s',_0x26f640,_0x51db97,_0x2749fb));var _0x3cde62=_0x4d697a[_0xc1dd('0xa')](_0x531ba6,_0xc1dd('0xb'),_0xc1dd('0xc'));_0x3cde62+=_0x4d697a['final'](_0xc1dd('0xc'));var _0x55d343=JSON[_0xc1dd('0xd')](_0x3cde62);return _0x55d343[_0xc1dd('0xe')](_0x39404d)?_0x55d343[_0x39404d]:null;}}return null;}function isLimit(_0x113cb5,_0x59f123,_0x40dba1,_0x4b0afb){var _0x21e02a=_0x59f123;return compose()[_0xc1dd('0xf')](function(_0xf8ce64,_0x28c5f1,_0x3bafd3){return db[_0xc1dd('0x10')][_0xc1dd('0x11')]({'where':{'id':0x1},'raw':!![]})[_0xc1dd('0x12')](function(_0x153c14){var _0x16d546=getValueFromLicense(_0x113cb5,_0x153c14);return _0x16d546?_0x16d546:_0x21e02a;})['then'](function(_0x1c98c6){_0x21e02a=_0x1c98c6;return _0x40dba1['count'](_0x4b0afb);})[_0xc1dd('0x12')](function(_0x1aee91){if(_0x1aee91>=_0x21e02a){return _0x28c5f1[_0xc1dd('0x13')](0x193)[_0xc1dd('0x14')]({'message':util[_0xc1dd('0x9')]('Maximum\x20%s\x20limit\x20have\x20been\x20reached',_0x113cb5)});}_0x3bafd3();})[_0xc1dd('0x15')](function(_0x15ca77){_0x3bafd3(_0x15ca77);});});}function isUserLimit(){return isLimit('users',0x1,db[_0xc1dd('0x16')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0xc1dd('0x17')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fc20f3e..2bd7e8b 100644 --- a/server/components/parsers/advancedSearch.js +++ b/server/components/parsers/advancedSearch.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4a8b=['match','forEach','filter','indexOf','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','$lte','days','castTo','text','\x20AS\x20','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$startsWith','$endsWith','LIKE\x20?','$lt','>\x20?','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','start','$substring','pop','utcOffset','format','add','hours','seconds','lodash','moment','parseSearch','sqlOperator','[$or]','and','replace','split','length','slice','shift'];(function(_0x33e5b2,_0x1aa5f1){var _0xf4e0a6=function(_0x4883ee){while(--_0x4883ee){_0x33e5b2['push'](_0x33e5b2['shift']());}};_0xf4e0a6(++_0x1aa5f1);}(_0x4a8b,0x9a));var _0xb4a8=function(_0x10f936,_0x229008){_0x10f936=_0x10f936-0x0;var _0x3f3d19=_0x4a8b[_0x10f936];return _0x3f3d19;};'use strict';var _=require(_0xb4a8('0x0'));var moment=require(_0xb4a8('0x1'));exports[_0xb4a8('0x2')]=function(_0xa570a7){var _0x148b73={'conditions':[]};_0x148b73[_0xb4a8('0x3')]=_['startsWith'](_0xa570a7,_0xb4a8('0x4'))?'or':_0xb4a8('0x5');var _0x3e70a7=_0xa570a7[_0xb4a8('0x6')]('[$and]','')['replace'](_0xb4a8('0x4'),'')[_0xb4a8('0x7')]('||');for(var _0x4814=0x0;_0x4814<_0x3e70a7[_0xb4a8('0x8')];_0x4814++){var _0x15a632=_0x3e70a7[_0x4814]['split'](':=');var _0x55a610=_0x15a632[0x0];var _0x34943d=_0x15a632[_0xb4a8('0x9')](0x1);_0x34943d['forEach'](function(_0x9b41a){var _0x1ef4fa=_0x9b41a[_0xb4a8('0x7')]('[')[_0xb4a8('0xa')]();var _0x5ac353=_0x9b41a[_0xb4a8('0xb')](/\[(.*?)\]/g);_0x5ac353[_0xb4a8('0xc')](function(_0x5eb309){var _0x26a098=_0x5eb309[_0xb4a8('0x7')]('[')[_0xb4a8('0xd')](function(_0x353342){return _0x353342[_0xb4a8('0xe')](']')>-0x1;})['map'](function(_0x2a8215){return _0x2a8215[_0xb4a8('0x7')](']')[0x0];})[0x0];_0x148b73[_0xb4a8('0xf')][_0xb4a8('0x10')]({'field':_0x55a610,'operator':_0x1ef4fa,'value':_0x26a098});});});}return _0x148b73;};exports[_0xb4a8('0x11')]=function(_0x4adcb0,_0x1a6577,_0x5d6c01){var _0x1e4223={};if(_0x1a6577===_0xb4a8('0x12')){if(_0x5d6c01['operator']===_0xb4a8('0x13')){_0x5d6c01[_0xb4a8('0x14')]=_0xb4a8('0x15');_0x5d6c01['value']+=','+_0x5d6c01[_0xb4a8('0x16')];}else if(_[_0xb4a8('0x17')]([_0xb4a8('0x18'),_0xb4a8('0x19')],_0x5d6c01[_0xb4a8('0x14')])){_0x5d6c01[_0xb4a8('0x16')]=moment(_0x5d6c01[_0xb4a8('0x16')])['add'](0x1,_0xb4a8('0x1a'))['format']('YYYY-MM-DD');}}if(_0x5d6c01[_0xb4a8('0x1b')]){_0x1a6577=_0x5d6c01[_0xb4a8('0x1b')];_0x1e4223[_0xb4a8('0x1c')]='CAST('+_0x4adcb0+'.'+_0x5d6c01['field']+_0xb4a8('0x1d')+_0x5d6c01[_0xb4a8('0x1b')]+')\x20'+parseOperator(_0x5d6c01[_0xb4a8('0x14')]);}else{_0x1e4223[_0xb4a8('0x1c')]=_0x4adcb0+'.'+_0x5d6c01[_0xb4a8('0x1e')]+'\x20'+parseOperator(_0x5d6c01['operator']);}if(_[_0xb4a8('0x17')]([_0xb4a8('0x1f'),_0xb4a8('0x20')],_0x5d6c01[_0xb4a8('0x14')]))_0x1e4223[_0xb4a8('0x1c')]='('+_0x1e4223[_0xb4a8('0x1c')]+_0xb4a8('0x21')+_0x4adcb0+'.'+_0x5d6c01[_0xb4a8('0x1e')]+_0xb4a8('0x22');_0x1e4223[_0xb4a8('0x16')]=parseValue(_0x1a6577,_0x5d6c01[_0xb4a8('0x14')],_0x5d6c01['value']);return _0x1e4223;};function parseOperator(_0x45ea8c){var _0x5c2030;switch(_0x45ea8c){case _0xb4a8('0x23'):_0x5c2030=_0xb4a8('0x24');break;case _0xb4a8('0x20'):_0x5c2030=_0xb4a8('0x25');break;case _0xb4a8('0x13'):_0x5c2030=_0xb4a8('0x26');break;case _0xb4a8('0x1f'):_0x5c2030='<>\x20?';break;case'$substring':case _0xb4a8('0x27'):case _0xb4a8('0x28'):_0x5c2030=_0xb4a8('0x29');break;case _0xb4a8('0x2a'):_0x5c2030='<\x20?';break;case _0xb4a8('0x18'):_0x5c2030=_0xb4a8('0x2b');break;case _0xb4a8('0x19'):_0x5c2030=_0xb4a8('0x2c');break;case _0xb4a8('0x2d'):_0x5c2030='>=\x20?';break;case _0xb4a8('0x15'):_0x5c2030=_0xb4a8('0x2e');break;}return _0x5c2030;}function parseValue(_0x379ed8,_0x1958de,_0x410497){var _0x360d7d={'start':undefined,'end':undefined};switch(_0x1958de){case _0xb4a8('0x23'):case _0xb4a8('0x20'):_0x360d7d[_0xb4a8('0x2f')]=_0x410497['split'](',');break;case _0xb4a8('0x30'):_0x360d7d[_0xb4a8('0x2f')]='%'+_0x410497+'%';break;case _0xb4a8('0x27'):_0x360d7d[_0xb4a8('0x2f')]=_0x410497+'%';break;case _0xb4a8('0x28'):_0x360d7d[_0xb4a8('0x2f')]='%'+_0x410497;break;case _0xb4a8('0x15'):var _0x1690dd=_0x410497['split'](',');var _0x410497=_0x1690dd[_0xb4a8('0xa')]();var _0x28704b=_0x1690dd[_0xb4a8('0x31')]();if(_0x379ed8===_0xb4a8('0x12')){_0x410497=moment(_0x410497)[_0xb4a8('0x32')](0x0,!![])[_0xb4a8('0x33')]();_0x28704b=moment(_0x28704b)[_0xb4a8('0x32')](0x0,!![])[_0xb4a8('0x34')](0x17,_0xb4a8('0x35'))['add'](0x3b,'minutes')[_0xb4a8('0x34')](0x3b,_0xb4a8('0x36'))[_0xb4a8('0x33')]();}_0x360d7d={'start':_0x410497,'end':_0x28704b};break;default:_0x360d7d['start']=_0x410497;break;}return _0x360d7d;} \ No newline at end of file +var _0x741c=['$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','<=\x20?','$gte','>=\x20?','start','pop','utcOffset','hours','minutes','seconds','lodash','moment','sqlOperator','and','replace','[$and]','[$or]','split','length','slice','forEach','shift','match','filter','map','conditions','DATE','$eq','$between','value','$gt','$lte','operator','add','days','format','YYYY-MM-DD','castTo','text','CAST(','field','\x20AS\x20','includes','$ne','$notIn','$in','IN\x20?','=\x20?','$substring'];(function(_0x2c15d7,_0x13eb66){var _0x461208=function(_0x4270c2){while(--_0x4270c2){_0x2c15d7['push'](_0x2c15d7['shift']());}};_0x461208(++_0x13eb66);}(_0x741c,0x78));var _0xc741=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x741c[_0x321bb2];return _0x9c12ed;};'use strict';var _=require(_0xc741('0x0'));var moment=require(_0xc741('0x1'));exports['parseSearch']=function(_0x27cc95){var _0x48dcca={'conditions':[]};_0x48dcca[_0xc741('0x2')]=_['startsWith'](_0x27cc95,'[$or]')?'or':_0xc741('0x3');var _0x199197=_0x27cc95[_0xc741('0x4')](_0xc741('0x5'),'')[_0xc741('0x4')](_0xc741('0x6'),'')[_0xc741('0x7')]('||');for(var _0x51ec02=0x0;_0x51ec02<_0x199197[_0xc741('0x8')];_0x51ec02++){var _0x530bd0=_0x199197[_0x51ec02][_0xc741('0x7')](':=');var _0x2a243d=_0x530bd0[0x0];var _0x5d5b75=_0x530bd0[_0xc741('0x9')](0x1);_0x5d5b75[_0xc741('0xa')](function(_0x350a2c){var _0x3d05aa=_0x350a2c['split']('[')[_0xc741('0xb')]();var _0x13a0cb=_0x350a2c[_0xc741('0xc')](/\[(.*?)\]/g);_0x13a0cb[_0xc741('0xa')](function(_0x3329c0){var _0x2b42a3=_0x3329c0[_0xc741('0x7')]('[')[_0xc741('0xd')](function(_0x37f15c){return _0x37f15c['indexOf'](']')>-0x1;})[_0xc741('0xe')](function(_0xd34aca){return _0xd34aca[_0xc741('0x7')](']')[0x0];})[0x0];_0x48dcca[_0xc741('0xf')]['push']({'field':_0x2a243d,'operator':_0x3d05aa,'value':_0x2b42a3});});});}return _0x48dcca;};exports['buildExpression']=function(_0x34d79f,_0x36f9f5,_0x59fcd1){var _0x42c085={};if(_0x36f9f5===_0xc741('0x10')){if(_0x59fcd1['operator']===_0xc741('0x11')){_0x59fcd1['operator']=_0xc741('0x12');_0x59fcd1[_0xc741('0x13')]+=','+_0x59fcd1[_0xc741('0x13')];}else if(_['includes']([_0xc741('0x14'),_0xc741('0x15')],_0x59fcd1[_0xc741('0x16')])){_0x59fcd1[_0xc741('0x13')]=moment(_0x59fcd1[_0xc741('0x13')])[_0xc741('0x17')](0x1,_0xc741('0x18'))[_0xc741('0x19')](_0xc741('0x1a'));}}if(_0x59fcd1[_0xc741('0x1b')]){_0x36f9f5=_0x59fcd1[_0xc741('0x1b')];_0x42c085[_0xc741('0x1c')]=_0xc741('0x1d')+_0x34d79f+'.'+_0x59fcd1[_0xc741('0x1e')]+_0xc741('0x1f')+_0x59fcd1[_0xc741('0x1b')]+')\x20'+parseOperator(_0x59fcd1[_0xc741('0x16')]);}else{_0x42c085[_0xc741('0x1c')]=_0x34d79f+'.'+_0x59fcd1['field']+'\x20'+parseOperator(_0x59fcd1['operator']);}if(_[_0xc741('0x20')]([_0xc741('0x21'),_0xc741('0x22')],_0x59fcd1[_0xc741('0x16')]))_0x42c085[_0xc741('0x1c')]='('+_0x42c085[_0xc741('0x1c')]+'\x20OR\x20'+_0x34d79f+'.'+_0x59fcd1[_0xc741('0x1e')]+'\x20IS\x20NULL)';_0x42c085[_0xc741('0x13')]=parseValue(_0x36f9f5,_0x59fcd1['operator'],_0x59fcd1[_0xc741('0x13')]);return _0x42c085;};function parseOperator(_0x2cf11a){var _0x44bd99;switch(_0x2cf11a){case _0xc741('0x23'):_0x44bd99=_0xc741('0x24');break;case'$notIn':_0x44bd99='NOT\x20IN\x20?';break;case _0xc741('0x11'):_0x44bd99=_0xc741('0x25');break;case'$ne':_0x44bd99='<>\x20?';break;case _0xc741('0x26'):case _0xc741('0x27'):case _0xc741('0x28'):_0x44bd99=_0xc741('0x29');break;case _0xc741('0x2a'):_0x44bd99=_0xc741('0x2b');break;case _0xc741('0x14'):_0x44bd99='>\x20?';break;case _0xc741('0x15'):_0x44bd99=_0xc741('0x2c');break;case _0xc741('0x2d'):_0x44bd99=_0xc741('0x2e');break;case'$between':_0x44bd99='BETWEEN\x20?\x20AND\x20?';break;}return _0x44bd99;}function parseValue(_0x55c013,_0x5c0d84,_0x875ef6){var _0x16c885={'start':undefined,'end':undefined};switch(_0x5c0d84){case'$in':case'$notIn':_0x16c885[_0xc741('0x2f')]=_0x875ef6[_0xc741('0x7')](',');break;case _0xc741('0x26'):_0x16c885[_0xc741('0x2f')]='%'+_0x875ef6+'%';break;case'$startsWith':_0x16c885[_0xc741('0x2f')]=_0x875ef6+'%';break;case'$endsWith':_0x16c885[_0xc741('0x2f')]='%'+_0x875ef6;break;case _0xc741('0x12'):var _0x4fbc07=_0x875ef6[_0xc741('0x7')](',');var _0x875ef6=_0x4fbc07[_0xc741('0xb')]();var _0x3fdbfd=_0x4fbc07[_0xc741('0x30')]();if(_0x55c013==='DATE'){_0x875ef6=moment(_0x875ef6)[_0xc741('0x31')](0x0,!![])[_0xc741('0x19')]();_0x3fdbfd=moment(_0x3fdbfd)['utcOffset'](0x0,!![])[_0xc741('0x17')](0x17,_0xc741('0x32'))[_0xc741('0x17')](0x3b,_0xc741('0x33'))[_0xc741('0x17')](0x3b,_0xc741('0x34'))[_0xc741('0x19')]();}_0x16c885={'start':_0x875ef6,'end':_0x3fdbfd};break;default:_0x16c885[_0xc741('0x2f')]=_0x875ef6;break;}return _0x16c885;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 1a26200..076c05f 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 _0xf975=['omit','isArray','length','isObject','isString','isNumeric','match','isEmail','getFullTextValue','forEach','push','lodash','fields','split','isEmpty','forOwn','parse','limit','offset','sort','map','indexOf','priority','unsigned','substr','DESC','cast','col','ASC'];(function(_0x1b0dd3,_0x510b79){var _0x31b5da=function(_0x1c5e43){while(--_0x1c5e43){_0x1b0dd3['push'](_0x1b0dd3['shift']());}};_0x31b5da(++_0x510b79);}(_0xf975,0x14a));var _0x5f97=function(_0x366abc,_0x2dd460){_0x366abc=_0x366abc-0x0;var _0x5e1bac=_0xf975[_0x366abc];return _0x5e1bac;};'use strict';var _=require(_0x5f97('0x0'));var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports[_0x5f97('0x1')]=function(_0x4ce43c){var _0x4cddf9=null;if(_0x4ce43c){_0x4cddf9=_0x4ce43c[_0x5f97('0x2')](',');}return _0x4cddf9;};exports['filters']=function(_0x57861c){var _0xcfaa86={};if(!_[_0x5f97('0x3')](_0x57861c)){_0xcfaa86={};_[_0x5f97('0x4')](_0x57861c,function(_0x4b59dd,_0x5a44c6){try{_0xcfaa86[_0x5a44c6]=_['isArray'](_0x4b59dd)?_0x4b59dd:JSON[_0x5f97('0x5')](_0x4b59dd);}catch(_0x1eaff9){_0xcfaa86[_0x5a44c6]=_0x4b59dd[_0x5f97('0x2')](',');}});}return _0xcfaa86;};exports[_0x5f97('0x6')]=function(_0x7bbca8){_0x7bbca8=parseInt(_0x7bbca8,0xa);if(!_0x7bbca8||_0x7bbca8<0x0){_0x7bbca8=LIMIT_VALUE;}return _0x7bbca8;};exports[_0x5f97('0x7')]=function(_0x44e26e){_0x44e26e=parseInt(_0x44e26e,0xa);if(!_0x44e26e||_0x44e26e<0x0){_0x44e26e=0x0;}return _0x44e26e;};exports[_0x5f97('0x8')]=function(_0x293369){var _0x59991b,_0xcfbc8f=null;if(_0x293369){_0x59991b=_0x293369['split'](',');_0xcfbc8f=_[_0x5f97('0x9')](_0x59991b,function(_0xd53f2d){if(_0xd53f2d[_0x5f97('0xa')]('-')===0x0){return[_0xd53f2d===_0x5f97('0xb')?sequelize['cast'](sequelize['col'](_0x5f97('0xb')),_0x5f97('0xc')):_0xd53f2d[_0x5f97('0xd')](0x1),_0x5f97('0xe')];}else{return[_0xd53f2d==='priority'?sequelize[_0x5f97('0xf')](sequelize[_0x5f97('0x10')](_0x5f97('0xb')),_0x5f97('0xc')):_0xd53f2d,_0x5f97('0x11')];}});}return _0xcfbc8f;};exports[_0x5f97('0x12')]=function(_0x4432b3,_0x46004e){if(_[_0x5f97('0x3')](_0x4432b3)){return _0x4432b3;}if(_[_0x5f97('0x13')](_0x4432b3)){for(var _0x2faa01=0x0;_0x2faa01<_0x4432b3[_0x5f97('0x14')];_0x2faa01+=0x1){_0x4432b3[_0x2faa01]=this[_0x5f97('0x12')](_0x4432b3[_0x2faa01],_0x46004e);}return _0x4432b3;}if(!_[_0x5f97('0x15')](_0x4432b3)){return _0x4432b3;}if(_[_0x5f97('0x16')](_0x46004e)){_0x46004e=[_0x46004e];}if(!_['isArray'](_0x46004e)){return _0x4432b3;}for(var _0x4ee514=0x0;_0x4ee514<_0x46004e[_0x5f97('0x14')];_0x4ee514+=0x1){_['unset'](_0x4432b3,_0x46004e[_0x4ee514]);}for(var _0x3d2c53 in _0x4432b3){if(_0x4432b3['hasOwnProperty'](_0x3d2c53)){_0x4432b3[_0x3d2c53]=this[_0x5f97('0x12')](_0x4432b3[_0x3d2c53],_0x46004e);}}return _0x4432b3;};exports[_0x5f97('0x17')]=function(_0x116244){return _0x116244[_0x5f97('0x18')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x5f97('0x19')]=function(_0x49484c){return _0x49484c['match'](/^\S+@\S+$/)?!![]:![];};exports[_0x5f97('0x1a')]=function(_0x2d52f0){var _0x5bde03=[];_0x2d52f0['split']('\x20')[_0x5f97('0x1b')](function(_0x35004a){_0x5bde03[_0x5f97('0x1c')]('+'+_0x35004a['toString']()+'*');});return _0x5bde03['join']('\x20');}; \ No newline at end of file +var _0x97b0=['getFullTextValue','forEach','push','toString','join','split','isEmpty','forOwn','isArray','parse','limit','sort','indexOf','priority','col','unsigned','DESC','cast','omit','length','isObject','isString','unset','hasOwnProperty','match','^[0-9]*$','isEmail'];(function(_0x2237f5,_0x2c2032){var _0x4b05d1=function(_0x4c49d0){while(--_0x4c49d0){_0x2237f5['push'](_0x2237f5['shift']());}};_0x4b05d1(++_0x2c2032);}(_0x97b0,0x19a));var _0x097b=function(_0x3ff3a5,_0x4321a6){_0x3ff3a5=_0x3ff3a5-0x0;var _0x47f309=_0x97b0[_0x3ff3a5];return _0x47f309;};'use strict';var _=require('lodash');var sequelize=require('sequelize');var LIMIT_VALUE=0xfa;exports['fields']=function(_0x5f270e){var _0x3f7176=null;if(_0x5f270e){_0x3f7176=_0x5f270e[_0x097b('0x0')](',');}return _0x3f7176;};exports['filters']=function(_0x1a32c5){var _0x1851a4={};if(!_[_0x097b('0x1')](_0x1a32c5)){_0x1851a4={};_[_0x097b('0x2')](_0x1a32c5,function(_0x4fdbcd,_0x41dd43){try{_0x1851a4[_0x41dd43]=_[_0x097b('0x3')](_0x4fdbcd)?_0x4fdbcd:JSON[_0x097b('0x4')](_0x4fdbcd);}catch(_0xd071ec){_0x1851a4[_0x41dd43]=_0x4fdbcd[_0x097b('0x0')](',');}});}return _0x1851a4;};exports[_0x097b('0x5')]=function(_0x151f21){_0x151f21=parseInt(_0x151f21,0xa);if(!_0x151f21||_0x151f21<0x0){_0x151f21=LIMIT_VALUE;}return _0x151f21;};exports['offset']=function(_0x476ab5){_0x476ab5=parseInt(_0x476ab5,0xa);if(!_0x476ab5||_0x476ab5<0x0){_0x476ab5=0x0;}return _0x476ab5;};exports[_0x097b('0x6')]=function(_0x40bd16){var _0x13b5e2,_0x3f6925=null;if(_0x40bd16){_0x13b5e2=_0x40bd16['split'](',');_0x3f6925=_['map'](_0x13b5e2,function(_0xccbdb){if(_0xccbdb[_0x097b('0x7')]('-')===0x0){return[_0xccbdb===_0x097b('0x8')?sequelize['cast'](sequelize[_0x097b('0x9')](_0x097b('0x8')),_0x097b('0xa')):_0xccbdb['substr'](0x1),_0x097b('0xb')];}else{return[_0xccbdb===_0x097b('0x8')?sequelize[_0x097b('0xc')](sequelize[_0x097b('0x9')](_0x097b('0x8')),_0x097b('0xa')):_0xccbdb,'ASC'];}});}return _0x3f6925;};exports[_0x097b('0xd')]=function(_0x528ad5,_0x53a028){if(_['isEmpty'](_0x528ad5)){return _0x528ad5;}if(_[_0x097b('0x3')](_0x528ad5)){for(var _0x63ecd7=0x0;_0x63ecd7<_0x528ad5[_0x097b('0xe')];_0x63ecd7+=0x1){_0x528ad5[_0x63ecd7]=this[_0x097b('0xd')](_0x528ad5[_0x63ecd7],_0x53a028);}return _0x528ad5;}if(!_[_0x097b('0xf')](_0x528ad5)){return _0x528ad5;}if(_[_0x097b('0x10')](_0x53a028)){_0x53a028=[_0x53a028];}if(!_[_0x097b('0x3')](_0x53a028)){return _0x528ad5;}for(var _0x13162d=0x0;_0x13162d<_0x53a028[_0x097b('0xe')];_0x13162d+=0x1){_[_0x097b('0x11')](_0x528ad5,_0x53a028[_0x13162d]);}for(var _0xa92e47 in _0x528ad5){if(_0x528ad5[_0x097b('0x12')](_0xa92e47)){_0x528ad5[_0xa92e47]=this['omit'](_0x528ad5[_0xa92e47],_0x53a028);}}return _0x528ad5;};exports['isNumeric']=function(_0x3f0c74){return _0x3f0c74[_0x097b('0x13')](RegExp(_0x097b('0x14')))?!![]:![];};exports[_0x097b('0x15')]=function(_0x4358b7){return _0x4358b7[_0x097b('0x13')](/^\S+@\S+$/)?!![]:![];};exports[_0x097b('0x16')]=function(_0x22c88a){var _0x35a1c1=[];_0x22c88a[_0x097b('0x0')]('\x20')[_0x097b('0x17')](function(_0x263260){_0x35a1c1[_0x097b('0x18')]('+'+_0x263260[_0x097b('0x19')]()+'*');});return _0x35a1c1[_0x097b('0x1a')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index c04fd8b..7aab338 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x0b3c=['view\x20engine','urlencoded','50mb','json','initialize','express','body-parser','method-override','cookie-parser','errorhandler','cors','./environment','default','env','production','set','appPath','join','root','public','client','split','use','get','views','/server/views','engine','html','ejs','renderFile'];(function(_0x3a913c,_0x26e8e9){var _0x37d592=function(_0x2dc510){while(--_0x2dc510){_0x3a913c['push'](_0x3a913c['shift']());}};_0x37d592(++_0x26e8e9);}(_0x0b3c,0xd7));var _0xc0b3=function(_0x536755,_0x3bfa50){_0x536755=_0x536755-0x0;var _0x2b9dde=_0x0b3c[_0x536755];return _0x2b9dde;};'use strict';var express=require(_0xc0b3('0x0'));var favicon=require('serve-favicon');var bodyParser=require(_0xc0b3('0x1'));var methodOverride=require(_0xc0b3('0x2'));var cookieParser=require(_0xc0b3('0x3'));var errorHandler=require(_0xc0b3('0x4'));var path=require('path');var passport=require('passport');var cors=require(_0xc0b3('0x5'));var moment=require('moment');var config=require(_0xc0b3('0x6'));var db=require('../mysqldb')['db'];exports[_0xc0b3('0x7')]=function(_0x569b83){var _0x19784b=_0x569b83['get'](_0xc0b3('0x8'));if(_0x19784b===_0xc0b3('0x9')){_0x569b83[_0xc0b3('0xa')](_0xc0b3('0xb'),path[_0xc0b3('0xc')](config[_0xc0b3('0xd')],_0xc0b3('0xe')));}if(_0x19784b==='development'||_0x19784b==='test'){_0x569b83[_0xc0b3('0xa')](_0xc0b3('0xb'),path[_0xc0b3('0xc')](config[_0xc0b3('0xd')],_0xc0b3('0xf')));_0x569b83['use'](errorHandler());}_0x569b83['set']('json\x20replacer',function(_0xdfb3a5,_0x4ad8d7){if(this[_0xdfb3a5]instanceof Date){_0x4ad8d7=this[_0xdfb3a5]['toISOString']()[_0xc0b3('0x10')]('.')[0x0]+'Z';}return _0x4ad8d7;});_0x569b83[_0xc0b3('0x11')](express['static'](_0x569b83[_0xc0b3('0x12')]('appPath')));_0x569b83['set'](_0xc0b3('0x13'),config[_0xc0b3('0xd')]+_0xc0b3('0x14'));_0x569b83[_0xc0b3('0x15')](_0xc0b3('0x16'),require(_0xc0b3('0x17'))[_0xc0b3('0x18')]);_0x569b83[_0xc0b3('0xa')](_0xc0b3('0x19'),_0xc0b3('0x16'));_0x569b83[_0xc0b3('0x11')](bodyParser[_0xc0b3('0x1a')]({'limit':_0xc0b3('0x1b'),'extended':!![]}));_0x569b83['use'](bodyParser[_0xc0b3('0x1c')]({'limit':_0xc0b3('0x1b')}));_0x569b83['use'](cors());_0x569b83[_0xc0b3('0x11')](methodOverride());_0x569b83['use'](cookieParser());_0x569b83[_0xc0b3('0x11')](passport[_0xc0b3('0x1d')]());}; \ No newline at end of file +var _0x9559=['engine','ejs','renderFile','view\x20engine','html','urlencoded','json','initialize','express','serve-favicon','path','moment','./environment','../mysqldb','get','env','production','set','appPath','join','development','root','client','use','json\x20replacer','toISOString','split','static','views'];(function(_0x169d48,_0x208429){var _0x5ebef7=function(_0x41c691){while(--_0x41c691){_0x169d48['push'](_0x169d48['shift']());}};_0x5ebef7(++_0x208429);}(_0x9559,0x7c));var _0x9955=function(_0x2c7618,_0x26be9c){_0x2c7618=_0x2c7618-0x0;var _0x5ce3f0=_0x9559[_0x2c7618];return _0x5ce3f0;};'use strict';var express=require(_0x9955('0x0'));var favicon=require(_0x9955('0x1'));var bodyParser=require('body-parser');var methodOverride=require('method-override');var cookieParser=require('cookie-parser');var errorHandler=require('errorhandler');var path=require(_0x9955('0x2'));var passport=require('passport');var cors=require('cors');var moment=require(_0x9955('0x3'));var config=require(_0x9955('0x4'));var db=require(_0x9955('0x5'))['db'];exports['default']=function(_0x571f91){var _0x19fee8=_0x571f91[_0x9955('0x6')](_0x9955('0x7'));if(_0x19fee8===_0x9955('0x8')){_0x571f91[_0x9955('0x9')](_0x9955('0xa'),path[_0x9955('0xb')](config['root'],'public'));}if(_0x19fee8===_0x9955('0xc')||_0x19fee8==='test'){_0x571f91[_0x9955('0x9')](_0x9955('0xa'),path['join'](config[_0x9955('0xd')],_0x9955('0xe')));_0x571f91[_0x9955('0xf')](errorHandler());}_0x571f91[_0x9955('0x9')](_0x9955('0x10'),function(_0x55c6c0,_0x3e6806){if(this[_0x55c6c0]instanceof Date){_0x3e6806=this[_0x55c6c0][_0x9955('0x11')]()[_0x9955('0x12')]('.')[0x0]+'Z';}return _0x3e6806;});_0x571f91[_0x9955('0xf')](express[_0x9955('0x13')](_0x571f91[_0x9955('0x6')]('appPath')));_0x571f91['set'](_0x9955('0x14'),config[_0x9955('0xd')]+'/server/views');_0x571f91[_0x9955('0x15')]('html',require(_0x9955('0x16'))[_0x9955('0x17')]);_0x571f91[_0x9955('0x9')](_0x9955('0x18'),_0x9955('0x19'));_0x571f91[_0x9955('0xf')](bodyParser[_0x9955('0x1a')]({'limit':'50mb','extended':!![]}));_0x571f91['use'](bodyParser[_0x9955('0x1b')]({'limit':'50mb'}));_0x571f91[_0x9955('0xf')](cors());_0x571f91[_0x9955('0xf')](methodOverride());_0x571f91[_0x9955('0xf')](cookieParser());_0x571f91[_0x9955('0xf')](passport[_0x9955('0x1c')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 0f6343d..dea3766 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 _0x979e=['ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','networkInterfaces','orderBy','filter','family','IPv4','internal','concat','head','mac','address','127.0.0.1','cpus','map','model','join','createHash','update','digest','hex','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x30896a,_0x4ffd49){var _0xad495f=function(_0x1abe82){while(--_0x1abe82){_0x30896a['push'](_0x30896a['shift']());}};_0xad495f(++_0x4ffd49);}(_0x979e,0x195));var _0xe979=function(_0x150e78,_0x1aeaf4){_0x150e78=_0x150e78-0x0;var _0x16581c=_0x979e[_0x150e78];return _0x16581c;};'use strict';var _=require(_0xe979('0x0'));var os=require('os');var crypto=require(_0xe979('0x1'));var machine=require(_0xe979('0x2'));var exec=require(_0xe979('0x3'))['execSync'];function getInterfaces(){var _0x10fb90=[];var _0x47321a=os[_0xe979('0x4')]();var _0x3b4b06=_[_0xe979('0x5')](_['keys'](_0x47321a));for(var _0x19f988=0x0;_0x19f988<_0x3b4b06['length'];_0x19f988++){var _0x1a0d35=_0x47321a[_0x3b4b06[_0x19f988]][_0xe979('0x6')](function(_0x441ffe){return _0x441ffe[_0xe979('0x7')]===_0xe979('0x8')&&_0x441ffe[_0xe979('0x9')]===![];});_0x10fb90=_0x10fb90[_0xe979('0xa')](_0x1a0d35);}return _0x10fb90;}function getFirstInterface(){var _0x29a97c=_[_0xe979('0xb')](getInterfaces());return{'macAddress':_0x29a97c&&_0x29a97c[_0xe979('0xc')]?_0x29a97c[_0xe979('0xc')]:'00:00:00:00:00:00','ipAddress':_0x29a97c&&_0x29a97c[_0xe979('0xd')]?_0x29a97c[_0xe979('0xd')]:_0xe979('0xe')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x18fe2b=_[_0xe979('0x5')](os[_0xe979('0xf')]()[_0xe979('0x10')](function(_0x2f76cb){return _0x2f76cb[_0xe979('0x11')];}))[_0xe979('0x12')](':');return crypto[_0xe979('0x13')]('md5')[_0xe979('0x14')](_0x18fe2b)[_0xe979('0x15')](_0xe979('0x16'));}exports['getUuid']=function(){switch(os['platform']()){case _0xe979('0x17'):return exec(_0xe979('0x18'),{'encoding':_0xe979('0x19')})[_0xe979('0x1a')]('\x0d\x0a','');default:var _0x49de62=getFirstInterface();var _0x10ed22=getCPUhash();var _0x93e48c=_0x10ed22+'|'+os[_0xe979('0x1b')]()+'|'+_0x49de62[_0xe979('0x1c')]+'|'+_0x49de62[_0xe979('0x1d')];var _0x2d6892=crypto[_0xe979('0x13')]('md5')[_0xe979('0x14')](_0x93e48c)['digest']('hex');return _0x2d6892[_0xe979('0x1e')](0x0,0x8)+'-'+_0x2d6892[_0xe979('0x1e')](0x8,0xc)+'-'+_0x2d6892[_0xe979('0x1e')](0xc,0x10)+'-'+_0x2d6892[_0xe979('0x1e')](0x10,0x14)+'-'+_0x2d6892['substring'](0x14);}}; \ No newline at end of file +var _0x37c5=['execSync','networkInterfaces','orderBy','keys','length','filter','family','IPv4','internal','concat','head','mac','address','getFirstInterface','cpus','map','model','join','createHash','md5','update','hex','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','digest','substring','crypto','bimedia-machine-uuid','child_process'];(function(_0x3bb331,_0x5b3ad8){var _0x55f0a6=function(_0x61a7bd){while(--_0x61a7bd){_0x3bb331['push'](_0x3bb331['shift']());}};_0x55f0a6(++_0x5b3ad8);}(_0x37c5,0xa7));var _0x537c=function(_0x234405,_0x194434){_0x234405=_0x234405-0x0;var _0x3d887a=_0x37c5[_0x234405];return _0x3d887a;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0x537c('0x0'));var machine=require(_0x537c('0x1'));var exec=require(_0x537c('0x2'))[_0x537c('0x3')];function getInterfaces(){var _0x1c5b5f=[];var _0x183b59=os[_0x537c('0x4')]();var _0x42bd15=_[_0x537c('0x5')](_[_0x537c('0x6')](_0x183b59));for(var _0x564f9c=0x0;_0x564f9c<_0x42bd15[_0x537c('0x7')];_0x564f9c++){var _0x1156f4=_0x183b59[_0x42bd15[_0x564f9c]][_0x537c('0x8')](function(_0x57666f){return _0x57666f[_0x537c('0x9')]===_0x537c('0xa')&&_0x57666f[_0x537c('0xb')]===![];});_0x1c5b5f=_0x1c5b5f[_0x537c('0xc')](_0x1156f4);}return _0x1c5b5f;}function getFirstInterface(){var _0x478797=_[_0x537c('0xd')](getInterfaces());return{'macAddress':_0x478797&&_0x478797[_0x537c('0xe')]?_0x478797[_0x537c('0xe')]:'00:00:00:00:00:00','ipAddress':_0x478797&&_0x478797[_0x537c('0xf')]?_0x478797['address']:'127.0.0.1'};}exports[_0x537c('0x10')]=getFirstInterface;function getCPUhash(){var _0x53004e=_[_0x537c('0x5')](os[_0x537c('0x11')]()[_0x537c('0x12')](function(_0x473606){return _0x473606[_0x537c('0x13')];}))[_0x537c('0x14')](':');return crypto[_0x537c('0x15')](_0x537c('0x16'))[_0x537c('0x17')](_0x53004e)['digest'](_0x537c('0x18'));}exports[_0x537c('0x19')]=function(){switch(os[_0x537c('0x1a')]()){case _0x537c('0x1b'):return exec(_0x537c('0x1c'),{'encoding':_0x537c('0x1d')})[_0x537c('0x1e')]('\x0d\x0a','');default:var _0x3776c3=getFirstInterface();var _0x445763=getCPUhash();var _0x5bd4c9=_0x445763+'|'+os[_0x537c('0x1f')]()+'|'+_0x3776c3['macAddress']+'|'+_0x3776c3['ipAddress'];var _0x4767d7=crypto[_0x537c('0x15')](_0x537c('0x16'))['update'](_0x5bd4c9)[_0x537c('0x20')](_0x537c('0x18'));return _0x4767d7['substring'](0x0,0x8)+'-'+_0x4767d7['substring'](0x8,0xc)+'-'+_0x4767d7[_0x537c('0x21')](0xc,0x10)+'-'+_0x4767d7['substring'](0x10,0x14)+'-'+_0x4767d7['substring'](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 083686c..b614523 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 _0xf108=['license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','exports','version','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','then','catch','createCipher','session','update','utf8','base64','final','aes-256-ctr','secrets','||FIELD||VALUE||\x0a','User','findOne','admin','fullname','email','|reason|','|uuid|','|machineUuid|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','data2','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','toUpperCase','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','message','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','moment','request-promise','bluebird','../environment','./hardware','../logger'];(function(_0x32e9a3,_0x3939ff){var _0x1a1032=function(_0x842b){while(--_0x842b){_0x32e9a3['push'](_0x32e9a3['shift']());}};_0x1a1032(++_0x3939ff);}(_0xf108,0x1d9));var _0x8f10=function(_0x4384a7,_0x535eb4){_0x4384a7=_0x4384a7-0x0;var _0x23bf96=_0xf108[_0x4384a7];return _0x23bf96;};'use strict';var util=require(_0x8f10('0x0'));var crypto=require('crypto');var moment=require(_0x8f10('0x1'));var rp=require(_0x8f10('0x2'));var BPromise=require(_0x8f10('0x3'));var pkginfo=require('pkginfo')(module,'version');var db=require('../../mysqldb')['db'];var config=require(_0x8f10('0x4'));var hardware=require(_0x8f10('0x5'));var logger=require(_0x8f10('0x6'))(_0x8f10('0x7'));var jira=require(_0x8f10('0x8'));var HOST=_0x8f10('0x9');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x212efc){return new BPromise(function(_0x38b45f,_0x9cf8af){var _0x22e5df=util[_0x8f10('0xa')]('%s/api/servers/%s/check?version=%s',HOST,_0x212efc,module[_0x8f10('0xb')][_0x8f10('0xc')]);if(oldToken){_0x22e5df=util[_0x8f10('0xa')](_0x8f10('0xd'),HOST,_0x212efc,module[_0x8f10('0xb')][_0x8f10('0xc')],oldToken);}var _0x2e00f7={'uri':_0x22e5df,'method':_0x8f10('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x2e00f7)[_0x8f10('0xf')](function(_0x23c485){_0x38b45f(_0x23c485);})[_0x8f10('0x10')](function(_0x25930b){_0x9cf8af(_0x25930b);});});}function encryptDate(_0x236b4b){var _0x170036=crypto[_0x8f10('0x11')]('aes-256-ctr',config['secrets'][_0x8f10('0x12')]);var _0x455d66=_0x170036[_0x8f10('0x13')](_0x236b4b,_0x8f10('0x14'),_0x8f10('0x15'));_0x455d66+=_0x170036[_0x8f10('0x16')](_0x8f10('0x15'));return _0x455d66;}function decryptDate(_0x15bae4){var _0x295dfc=crypto['createDecipher'](_0x8f10('0x17'),config[_0x8f10('0x18')][_0x8f10('0x12')]);var _0x52aafc=_0x295dfc[_0x8f10('0x13')](_0x15bae4,_0x8f10('0x15'),'utf8');_0x52aafc+=_0x295dfc[_0x8f10('0x16')](_0x8f10('0x14'));return _0x52aafc;}function sendJiraAlert(_0x255e75,_0x3003ea,_0x48eb4f){var _0x56aa3f=_0x8f10('0x19');return db[_0x8f10('0x1a')][_0x8f10('0x1b')]({'where':{'role':_0x8f10('0x1c')},'attributes':[_0x8f10('0x1d'),_0x8f10('0x1e')],'raw':!![]})[_0x8f10('0xf')](function(_0x3fc95d){ADMIN=_0x3fc95d;_0x56aa3f+=_0x8f10('0x1f')+_0x48eb4f+'|\x0a';_0x56aa3f+=_0x8f10('0x20')+_0x255e75+'|\x0a';_0x56aa3f+=_0x8f10('0x21')+_0x3003ea+'|\x0a';_0x56aa3f+='|name|'+ADMIN[_0x8f10('0x1d')]+'|\x0a';_0x56aa3f+='|email|'+ADMIN['email']+'|\x0a';return _0x56aa3f;})['then'](function(_0x24dacc){var _0x4cc92f=hardware[_0x8f10('0x22')]()[_0x8f10('0x23')];return jira[_0x8f10('0x24')]({'key':_0x8f10('0x25'),'summary':_0x8f10('0x26'),'description':_0x24dacc,'issuetype':_0x8f10('0x27'),'oldToken':_0x255e75,'newToken':_0x3003ea,'email':ADMIN[_0x8f10('0x1e')],'name':ADMIN[_0x8f10('0x1d')],'reason':GRAY_PERIOD_REASON,'ip':_0x4cc92f});});}function manageLicense(_0x20bdfa,_0x44dd23){var _0x3458a8=_0x44dd23[_0x8f10('0x28')]({'plain':!![]});httpRequest(_0x20bdfa)[_0x8f10('0xf')](function(_0x3b085d){if(oldToken){oldToken=undefined;}if(_0x3b085d['active']){if(!_0x3458a8[_0x8f10('0x7')]&&_0x3458a8[_0x8f10('0x7')]!=_0x3b085d['license']||_0x3458a8['license']&&_0x3458a8['data2']){logger[_0x8f10('0x29')](_0x8f10('0x2a'));}if(_0x3458a8[_0x8f10('0x7')]&&!_0x3458a8[_0x8f10('0x2b')]&&_0x3458a8[_0x8f10('0x7')]!=_0x3b085d['license']){logger[_0x8f10('0x29')]('THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED');}if(_0x3458a8[_0x8f10('0x7')]&&!_0x3458a8[_0x8f10('0x2b')]&&_0x3458a8[_0x8f10('0x7')]==_0x3b085d['license']){return _0x44dd23;}return _0x44dd23[_0x8f10('0x13')]({'data1':_0x20bdfa,'data2':null,'license':_0x3b085d['license']});}else{if(_0x3b085d['license']||_0x3458a8[_0x8f10('0x7')]){if(!_0x3458a8[_0x8f10('0x2b')]){if(_0x3458a8[_0x8f10('0x2c')]==_0x20bdfa){GRAY_PERIOD_REASON=_0x8f10('0x2d');logger[_0x8f10('0x29')](_0x8f10('0x2e'));}else{GRAY_PERIOD_REASON=_0x8f10('0x2f');oldToken=_0x3458a8['data1'];logger['info'](_0x8f10('0x30'),_0x3458a8['data1'],_0x20bdfa);}sendJiraAlert(_0x3458a8[_0x8f10('0x2c')],_0x3b085d[_0x8f10('0x31')],GRAY_PERIOD_REASON);logger['info']('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON[_0x8f10('0x32')](),moment()['format'](_0x8f10('0x33')));return _0x44dd23['update']({'data2':encryptDate(moment()[_0x8f10('0xa')]('YYYY-MM-DD\x20HH:mm'))});}else{if(moment()['diff'](decryptDate(_0x3458a8[_0x8f10('0x2b')]),'days')>DAYS){logger[_0x8f10('0x29')](_0x8f10('0x34'),moment()[_0x8f10('0xa')](_0x8f10('0x33')));return _0x44dd23[_0x8f10('0x13')]({'data1':_0x20bdfa,'data2':null,'license':null});}}}else{if(_0x3458a8['data1']!=_0x20bdfa){logger[_0x8f10('0x29')](_0x8f10('0x30'),_0x3458a8['data1'],_0x20bdfa);return _0x44dd23[_0x8f10('0x13')]({'data1':_0x20bdfa,'data2':null,'license':null});}}}return _0x44dd23;})['then'](function(_0x21d584){_0x44dd23=_0x21d584;})['catch'](function(_0x28ac6a){logger['error'](_0x28ac6a[_0x8f10('0x35')]);})['finally'](function(){setTimeout(function(){manageLicense(hardware['getUuid'](),_0x44dd23);},TIME);});}function defaultLicense(){var _0x18168a=hardware['getUuid']();if(_0x18168a){return db[_0x8f10('0x36')][_0x8f10('0x37')]({'where':{'id':0x1},'defaults':{'data1':_0x18168a}})[_0x8f10('0x38')](function(_0x556fb9,_0x3df580){logger[_0x8f10('0x29')](_0x8f10('0x39'),_0x18168a);manageLicense(_0x18168a,_0x556fb9);})[_0x8f10('0x10')](function(_0x444d3a){logger[_0x8f10('0x3a')](_0x444d3a[_0x8f10('0x35')]);});}}exports[_0x8f10('0x3b')]=defaultLicense; \ No newline at end of file +var _0xb145=['exports','GET','then','catch','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','createDecipher','||FIELD||VALUE||\x0a','User','findOne','|reason|','|uuid|','|name|','fullname','email','Motion\x20License\x20Alert','Alert','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','Changed','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','YYYY-MM-DD\x20HH:mm','DEMO\x20START\x20AT\x20%s','error','message','finally','getUuid','License','findOrCreate','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','crypto','moment','request-promise','bluebird','pkginfo','version','../../mysqldb','../environment','../logger','license','../../api/jira/jira.controller','https://www.xcallymotion.com','format','%s/api/servers/%s/check?version=%s'];(function(_0x250c11,_0x508f74){var _0x434a63=function(_0x4d1739){while(--_0x4d1739){_0x250c11['push'](_0x250c11['shift']());}};_0x434a63(++_0x508f74);}(_0xb145,0xa3));var _0x5b14=function(_0x2f51af,_0x4f4f52){_0x2f51af=_0x2f51af-0x0;var _0x105e5b=_0xb145[_0x2f51af];return _0x105e5b;};'use strict';var util=require('util');var crypto=require(_0x5b14('0x0'));var moment=require(_0x5b14('0x1'));var rp=require(_0x5b14('0x2'));var BPromise=require(_0x5b14('0x3'));var pkginfo=require(_0x5b14('0x4'))(module,_0x5b14('0x5'));var db=require(_0x5b14('0x6'))['db'];var config=require(_0x5b14('0x7'));var hardware=require('./hardware');var logger=require(_0x5b14('0x8'))(_0x5b14('0x9'));var jira=require(_0x5b14('0xa'));var HOST=_0x5b14('0xb');var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x50fd91){return new BPromise(function(_0x1d12ed,_0x2a3921){var _0x34530a=util[_0x5b14('0xc')](_0x5b14('0xd'),HOST,_0x50fd91,module['exports'][_0x5b14('0x5')]);if(oldToken){_0x34530a=util[_0x5b14('0xc')]('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x50fd91,module[_0x5b14('0xe')][_0x5b14('0x5')],oldToken);}var _0x1ecffb={'uri':_0x34530a,'method':_0x5b14('0xf'),'timeout':0xea60,'json':!![]};return rp(_0x1ecffb)[_0x5b14('0x10')](function(_0x4fb6da){_0x1d12ed(_0x4fb6da);})[_0x5b14('0x11')](function(_0x50997e){_0x2a3921(_0x50997e);});});}function encryptDate(_0x30deb8){var _0x1903a5=crypto[_0x5b14('0x12')](_0x5b14('0x13'),config[_0x5b14('0x14')][_0x5b14('0x15')]);var _0x52ffa9=_0x1903a5[_0x5b14('0x16')](_0x30deb8,_0x5b14('0x17'),_0x5b14('0x18'));_0x52ffa9+=_0x1903a5[_0x5b14('0x19')](_0x5b14('0x18'));return _0x52ffa9;}function decryptDate(_0x2a8fe5){var _0x68f695=crypto[_0x5b14('0x1a')](_0x5b14('0x13'),config[_0x5b14('0x14')][_0x5b14('0x15')]);var _0x2c3efb=_0x68f695['update'](_0x2a8fe5,_0x5b14('0x18'),'utf8');_0x2c3efb+=_0x68f695['final']('utf8');return _0x2c3efb;}function sendJiraAlert(_0x3f397d,_0x3035b5,_0x3662a7){var _0x89b7a0=_0x5b14('0x1b');return db[_0x5b14('0x1c')][_0x5b14('0x1d')]({'where':{'role':'admin'},'attributes':['fullname','email'],'raw':!![]})[_0x5b14('0x10')](function(_0x2afa17){ADMIN=_0x2afa17;_0x89b7a0+=_0x5b14('0x1e')+_0x3662a7+'|\x0a';_0x89b7a0+=_0x5b14('0x1f')+_0x3f397d+'|\x0a';_0x89b7a0+='|machineUuid|'+_0x3035b5+'|\x0a';_0x89b7a0+=_0x5b14('0x20')+ADMIN[_0x5b14('0x21')]+'|\x0a';_0x89b7a0+='|email|'+ADMIN[_0x5b14('0x22')]+'|\x0a';return _0x89b7a0;})[_0x5b14('0x10')](function(_0x50951f){var _0x33a293=hardware['getFirstInterface']()['ipAddress'];return jira['openIssue']({'key':'MOTLICENSE','summary':_0x5b14('0x23'),'description':_0x50951f,'issuetype':_0x5b14('0x24'),'oldToken':_0x3f397d,'newToken':_0x3035b5,'email':ADMIN[_0x5b14('0x22')],'name':ADMIN['fullname'],'reason':GRAY_PERIOD_REASON,'ip':_0x33a293});});}function manageLicense(_0x46f86a,_0x3bf8e5){var _0x2ac7b0=_0x3bf8e5[_0x5b14('0x25')]({'plain':!![]});httpRequest(_0x46f86a)[_0x5b14('0x10')](function(_0x1bbbd7){if(oldToken){oldToken=undefined;}if(_0x1bbbd7[_0x5b14('0x26')]){if(!_0x2ac7b0[_0x5b14('0x9')]&&_0x2ac7b0[_0x5b14('0x9')]!=_0x1bbbd7[_0x5b14('0x9')]||_0x2ac7b0[_0x5b14('0x9')]&&_0x2ac7b0[_0x5b14('0x27')]){logger[_0x5b14('0x28')](_0x5b14('0x29'));}if(_0x2ac7b0['license']&&!_0x2ac7b0[_0x5b14('0x27')]&&_0x2ac7b0[_0x5b14('0x9')]!=_0x1bbbd7['license']){logger['info'](_0x5b14('0x2a'));}if(_0x2ac7b0[_0x5b14('0x9')]&&!_0x2ac7b0['data2']&&_0x2ac7b0['license']==_0x1bbbd7[_0x5b14('0x9')]){return _0x3bf8e5;}return _0x3bf8e5['update']({'data1':_0x46f86a,'data2':null,'license':_0x1bbbd7[_0x5b14('0x9')]});}else{if(_0x1bbbd7[_0x5b14('0x9')]||_0x2ac7b0['license']){if(!_0x2ac7b0['data2']){if(_0x2ac7b0[_0x5b14('0x2b')]==_0x46f86a){GRAY_PERIOD_REASON=_0x5b14('0x2c');logger[_0x5b14('0x28')]('THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED');}else{GRAY_PERIOD_REASON=_0x5b14('0x2d');oldToken=_0x2ac7b0['data1'];logger[_0x5b14('0x28')](_0x5b14('0x2e'),_0x2ac7b0[_0x5b14('0x2b')],_0x46f86a);}sendJiraAlert(_0x2ac7b0[_0x5b14('0x2b')],_0x1bbbd7['uuid'],GRAY_PERIOD_REASON);logger[_0x5b14('0x28')](_0x5b14('0x2f'),GRAY_PERIOD_REASON[_0x5b14('0x30')](),moment()[_0x5b14('0xc')]('YYYY-MM-DD\x20HH:mm'));return _0x3bf8e5[_0x5b14('0x16')]({'data2':encryptDate(moment()[_0x5b14('0xc')](_0x5b14('0x31')))});}else{if(moment()['diff'](decryptDate(_0x2ac7b0[_0x5b14('0x27')]),'days')>DAYS){logger[_0x5b14('0x28')](_0x5b14('0x32'),moment()['format'](_0x5b14('0x31')));return _0x3bf8e5[_0x5b14('0x16')]({'data1':_0x46f86a,'data2':null,'license':null});}}}else{if(_0x2ac7b0['data1']!=_0x46f86a){logger[_0x5b14('0x28')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0x2ac7b0[_0x5b14('0x2b')],_0x46f86a);return _0x3bf8e5[_0x5b14('0x16')]({'data1':_0x46f86a,'data2':null,'license':null});}}}return _0x3bf8e5;})[_0x5b14('0x10')](function(_0x284226){_0x3bf8e5=_0x284226;})['catch'](function(_0xfac72){logger[_0x5b14('0x33')](_0xfac72[_0x5b14('0x34')]);})[_0x5b14('0x35')](function(){setTimeout(function(){manageLicense(hardware[_0x5b14('0x36')](),_0x3bf8e5);},TIME);});}function defaultLicense(){var _0x2428b0=hardware[_0x5b14('0x36')]();if(_0x2428b0){return db[_0x5b14('0x37')][_0x5b14('0x38')]({'where':{'id':0x1},'defaults':{'data1':_0x2428b0}})[_0x5b14('0x39')](function(_0x423ed0,_0x3f9d1d){logger[_0x5b14('0x28')](_0x5b14('0x3a'),_0x2428b0);manageLicense(_0x2428b0,_0x423ed0);})[_0x5b14('0x11')](function(_0x1fe8fc){logger['error'](_0x1fe8fc[_0x5b14('0x34')]);});}}exports['default']=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index 2ce39a9..5440618 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 _0xdd94=['util','moment','./hardware','license','isEmpty','License\x20key\x20value\x20not\x20found','data1','split','%s:%s:%s','utf8','machineUuid','createDecipher','aes-256-ctr','secrets','session','update','base64','gray','deadline','add','days','grayReason','uuid','changed','disabled','Breaking\x20license','getUuid','message','Demo\x20license','getLicense','find','defaults','then'];(function(_0x2b5e9d,_0x3c8806){var _0x6e3970=function(_0x5a2c7f){while(--_0x5a2c7f){_0x2b5e9d['push'](_0x2b5e9d['shift']());}};_0x6e3970(++_0x3c8806);}(_0xdd94,0x1ce));var _0x4dd9=function(_0x4129d6,_0x20f817){_0x4129d6=_0x4129d6-0x0;var _0xdb62b9=_0xdd94[_0x4129d6];return _0xdb62b9;};'use strict';var crypto=require('crypto');var util=require(_0x4dd9('0x0'));var _=require('lodash');var moment=require(_0x4dd9('0x1'));var hardware=require(_0x4dd9('0x2'));var config=require('../environment');var db=require('../../mysqldb')['db'];function checkLicense(_0x3c41d5,_0x22f54e){if(_0x3c41d5){try{var _0x29c6a0=_0x22f54e||_0x3c41d5[_0x4dd9('0x3')];if(_[_0x4dd9('0x4')](_0x29c6a0)){throw new Error(_0x4dd9('0x5'));}var _0x36def7=_0x3c41d5[_0x4dd9('0x6')];var _0x550265=_0x3c41d5['data2'];var _0x63dedc=_0x36def7[_0x4dd9('0x7')]('-')[0x4];var _0x361135=_0x36def7[_0x4dd9('0x7')]('-')[0x0];var _0x239e86=crypto['createDecipher']('aes-256-ctr',util['format'](_0x4dd9('0x8'),_0x63dedc,_0x36def7,_0x361135));var _0x2bdb40=_0x239e86['update'](_0x29c6a0,'base64',_0x4dd9('0x9'));_0x2bdb40+=_0x239e86['final']('utf8');var _0x4ebd45=JSON['parse'](_0x2bdb40);_0x4ebd45['demo']=![];_0x4ebd45['uuid']=_0x36def7;_0x4ebd45[_0x4dd9('0xa')]=hardware['getUuid']();if(_0x550265){var _0x4b190e=crypto[_0x4dd9('0xb')](_0x4dd9('0xc'),config[_0x4dd9('0xd')][_0x4dd9('0xe')]);var _0x385d50=_0x4b190e[_0x4dd9('0xf')](_0x550265,_0x4dd9('0x10'),_0x4dd9('0x9'));_0x385d50+=_0x4b190e['final'](_0x4dd9('0x9'));_0x4ebd45[_0x4dd9('0x11')]=_0x385d50;_0x4ebd45[_0x4dd9('0x12')]=moment(_0x385d50)[_0x4dd9('0x13')](0x7,_0x4dd9('0x14'))['format']();_0x4ebd45[_0x4dd9('0x15')]=_0x4ebd45[_0x4dd9('0x16')]!=_0x4ebd45[_0x4dd9('0xa')]?_0x4dd9('0x17'):_0x4dd9('0x18');}return _0x4ebd45;}catch(_0x2a9482){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':_0x4dd9('0x19'),'uuid':_0x3c41d5[_0x4dd9('0x6')],'machineUuid':hardware[_0x4dd9('0x1a')](),'message':_0x2a9482[_0x4dd9('0x1b')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0x4dd9('0x1c'),'uuid':_0x3c41d5[_0x4dd9('0x6')],'machineUuid':hardware[_0x4dd9('0x1a')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x4dd9('0x1d')]=function(_0x33b8f2){return db['License'][_0x4dd9('0x1e')](_[_0x4dd9('0x1f')](_0x33b8f2,{'raw':!![],'where':{'id':0x1}}))[_0x4dd9('0x20')](function(_0x58ad7d){return checkLicense(_0x58ad7d,null);});};exports['checkLicense']=checkLicense; \ No newline at end of file +var _0x910a=['License','find','defaults','then','checkLicense','crypto','util','lodash','moment','./hardware','isEmpty','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','%s:%s:%s','base64','final','utf8','parse','demo','uuid','aes-256-ctr','update','gray','deadline','days','grayReason','machineUuid','changed','disabled','Breaking\x20license','getUuid','2027-01-01T00:00:00.000Z'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x910a,0x1ef));var _0xa910=function(_0x8a2727,_0x4d407f){_0x8a2727=_0x8a2727-0x0;var _0x106a42=_0x910a[_0x8a2727];return _0x106a42;};'use strict';var crypto=require(_0xa910('0x0'));var util=require(_0xa910('0x1'));var _=require(_0xa910('0x2'));var moment=require(_0xa910('0x3'));var hardware=require(_0xa910('0x4'));var config=require('../environment');var db=require('../../mysqldb')['db'];function checkLicense(_0x105ec2,_0x2d7283){if(_0x105ec2){try{var _0x4450e1=_0x2d7283||_0x105ec2['license'];if(_[_0xa910('0x5')](_0x4450e1)){throw new Error(_0xa910('0x6'));}var _0x41109b=_0x105ec2[_0xa910('0x7')];var _0x4360d1=_0x105ec2[_0xa910('0x8')];var _0x5982b7=_0x41109b[_0xa910('0x9')]('-')[0x4];var _0x1de11f=_0x41109b['split']('-')[0x0];var _0x1d8ae6=crypto[_0xa910('0xa')]('aes-256-ctr',util['format'](_0xa910('0xb'),_0x5982b7,_0x41109b,_0x1de11f));var _0x434b4a=_0x1d8ae6['update'](_0x4450e1,_0xa910('0xc'),'utf8');_0x434b4a+=_0x1d8ae6[_0xa910('0xd')](_0xa910('0xe'));var _0x21307b=JSON[_0xa910('0xf')](_0x434b4a);_0x21307b[_0xa910('0x10')]=![];_0x21307b[_0xa910('0x11')]=_0x41109b;_0x21307b['machineUuid']=hardware['getUuid']();if(_0x4360d1){var _0x1cf0da=crypto['createDecipher'](_0xa910('0x12'),config['secrets']['session']);var _0x5a2a9e=_0x1cf0da[_0xa910('0x13')](_0x4360d1,_0xa910('0xc'),_0xa910('0xe'));_0x5a2a9e+=_0x1cf0da[_0xa910('0xd')](_0xa910('0xe'));_0x21307b[_0xa910('0x14')]=_0x5a2a9e;_0x21307b[_0xa910('0x15')]=moment(_0x5a2a9e)['add'](0x7,_0xa910('0x16'))['format']();_0x21307b[_0xa910('0x17')]=_0x21307b[_0xa910('0x11')]!=_0x21307b[_0xa910('0x18')]?_0xa910('0x19'):_0xa910('0x1a');}return _0x21307b;}catch(_0x1cc1ac){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':_0xa910('0x1b'),'uuid':_0x105ec2[_0xa910('0x7')],'machineUuid':hardware[_0xa910('0x1c')](),'message':_0x1cc1ac['message'],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xa910('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x105ec2[_0xa910('0x7')],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports['getLicense']=function(_0x5a776a){return db[_0xa910('0x1e')][_0xa910('0x1f')](_[_0xa910('0x20')](_0x5a776a,{'raw':!![],'where':{'id':0x1}}))[_0xa910('0x21')](function(_0x3ab256){return checkLicense(_0x3ab256,null);});};exports[_0xa910('0x22')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index a1ba1c7..0bf8339 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 _0xfa60=['myappanuglar-secret','app-id','secret'];(function(_0x349a9e,_0x473cb8){var _0x24c207=function(_0x22f148){while(--_0x22f148){_0x349a9e['push'](_0x349a9e['shift']());}};_0x24c207(++_0x473cb8);}(_0xfa60,0x8a));var _0x0fa6=function(_0x1ad490,_0x2e40b1){_0x1ad490=_0x1ad490-0x0;var _0x5631cb=_0xfa60[_0x1ad490];return _0x5631cb;};'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':_0x0fa6('0x0'),'GOOGLE_ID':_0x0fa6('0x1'),'GOOGLE_SECRET':_0x0fa6('0x2'),'DEBUG':''}; \ No newline at end of file +var _0xa792=['app-id','secret','http://localhost:9000','myappanuglar-secret'];(function(_0x1c3e42,_0x593959){var _0x2cb908=function(_0x520468){while(--_0x520468){_0x1c3e42['push'](_0x1c3e42['shift']());}};_0x2cb908(++_0x593959);}(_0xa792,0x142));var _0x2a79=function(_0x1795c6,_0x3de5a6){_0x1795c6=_0x1795c6-0x0;var _0x271c7a=_0xa792[_0x1795c6];return _0x271c7a;};'use strict';module['exports']={'DOMAIN':_0x2a79('0x0'),'SESSION_SECRET':_0x2a79('0x1'),'GOOGLE_ID':_0x2a79('0x2'),'GOOGLE_SECRET':_0x2a79('0x3'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index 8cdcd35..e97d617 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x62db=['/var','log','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','toUpperCase','exports','Logger','transports','File','%s-%s','error','info','Console','env','moment','winston','util','path','INFO','join'];(function(_0xf0f29d,_0x2ae332){var _0x4ce6c9=function(_0x521097){while(--_0x521097){_0xf0f29d['push'](_0xf0f29d['shift']());}};_0x4ce6c9(++_0x2ae332);}(_0x62db,0x135));var _0xb62d=function(_0x8dcbd7,_0x2a6dc2){_0x8dcbd7=_0x8dcbd7-0x0;var _0x2140c6=_0x62db[_0x8dcbd7];return _0x2140c6;};'use strict';var moment=require(_0xb62d('0x0'));var winston=require(_0xb62d('0x1'));var util=require(_0xb62d('0x2'));var path=require(_0xb62d('0x3'));var debugLevel=_0xb62d('0x4');function filename(_0x58868c,_0x12e598){return path[_0xb62d('0x5')](_0xb62d('0x6'),_0xb62d('0x7'),'xcally',util[_0xb62d('0x8')]('%s-%s.log',_0x58868c,_0x12e598));}function formatter(_0x14e20c,_0x30acd1){return util[_0xb62d('0x8')](_0xb62d('0x9'),moment()[_0xb62d('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),_0x30acd1[_0xb62d('0xa')][_0xb62d('0xb')](),_0x14e20c,_0x30acd1['message']);}module[_0xb62d('0xc')]=function(_0x53d332){return new winston[(_0xb62d('0xd'))]({'transports':[new winston[(_0xb62d('0xe'))][(_0xb62d('0xf'))]({'name':util[_0xb62d('0x8')](_0xb62d('0x10'),_0x53d332,_0xb62d('0x11')),'filename':filename(_0x53d332,'error'),'level':_0xb62d('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x1ac578){return formatter(_0x53d332,_0x1ac578);}}),new winston[(_0xb62d('0xe'))][(_0xb62d('0xf'))]({'name':util[_0xb62d('0x8')](_0xb62d('0x10'),_0x53d332,_0xb62d('0x12')),'filename':filename(_0x53d332,_0xb62d('0x12')),'level':_0xb62d('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x51a376){return formatter(_0x53d332,_0x51a376);}}),new winston[(_0xb62d('0xe'))][(_0xb62d('0x13'))]({'level':process[_0xb62d('0x14')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0xfb7a9e){return formatter(_0x53d332,_0xfb7a9e);}})]});}; \ No newline at end of file +var _0xfd68=['path','/var','log','xcally','%s-%s.log','YYYY-MM-DD\x20HH:mm:ss','toUpperCase','exports','File','format','%s-%s','error','info','Console','env','moment','winston'];(function(_0x5d19bb,_0xb4330f){var _0x33159c=function(_0x2e8986){while(--_0x2e8986){_0x5d19bb['push'](_0x5d19bb['shift']());}};_0x33159c(++_0xb4330f);}(_0xfd68,0x64));var _0x8fd6=function(_0x13a01a,_0x10d700){_0x13a01a=_0x13a01a-0x0;var _0x3449b2=_0xfd68[_0x13a01a];return _0x3449b2;};'use strict';var moment=require(_0x8fd6('0x0'));var winston=require(_0x8fd6('0x1'));var util=require('util');var path=require(_0x8fd6('0x2'));var debugLevel='INFO';function filename(_0x1f719d,_0x35a2e8){return path['join'](_0x8fd6('0x3'),_0x8fd6('0x4'),_0x8fd6('0x5'),util['format'](_0x8fd6('0x6'),_0x1f719d,_0x35a2e8));}function formatter(_0x873299,_0x2b02f4){return util['format']('[%s]\x20[%s]\x20%s\x20-\x20%s',moment()['format'](_0x8fd6('0x7')),_0x2b02f4['level'][_0x8fd6('0x8')](),_0x873299,_0x2b02f4['message']);}module[_0x8fd6('0x9')]=function(_0x4ea19e){return new winston['Logger']({'transports':[new winston['transports'][(_0x8fd6('0xa'))]({'name':util[_0x8fd6('0xb')](_0x8fd6('0xc'),_0x4ea19e,'error'),'filename':filename(_0x4ea19e,_0x8fd6('0xd')),'level':'error','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x584872){return formatter(_0x4ea19e,_0x584872);}}),new winston['transports']['File']({'name':util[_0x8fd6('0xb')](_0x8fd6('0xc'),_0x4ea19e,_0x8fd6('0xe')),'filename':filename(_0x4ea19e,_0x8fd6('0xe')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x42a33d){return formatter(_0x4ea19e,_0x42a33d);}}),new winston['transports'][(_0x8fd6('0xf'))]({'level':process[_0x8fd6('0x10')]['debugLevel']||debugLevel,'json':![],'formatter':function(_0x3354b4){return formatter(_0x4ea19e,_0x3354b4);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index 76bfda1..e053af0 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 _0xfab2=['agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js','exports','express','join','../../services/express/index.js','../../services/ami/index.js'];(function(_0x38c699,_0x56fea7){var _0x3b1ded=function(_0x100851){while(--_0x100851){_0x38c699['push'](_0x38c699['shift']());}};_0x3b1ded(++_0x56fea7);}(_0xfab2,0x1d5));var _0x2fab=function(_0x3bc190,_0x2eea47){_0x3bc190=_0x3bc190-0x0;var _0x5773d3=_0xfab2[_0x3bc190];return _0x5773d3;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':_0x2fab('0x0'),'script':path[_0x2fab('0x1')](__dirname,_0x2fab('0x2'))},{'name':'ami','script':path[_0x2fab('0x1')](__dirname,_0x2fab('0x3'))},{'name':_0x2fab('0x4'),'script':path[_0x2fab('0x1')](__dirname,_0x2fab('0x5'))},{'name':'email','script':path[_0x2fab('0x1')](__dirname,'../../services/email/index.js')},{'name':_0x2fab('0x6'),'script':path[_0x2fab('0x1')](__dirname,_0x2fab('0x7'))},{'name':_0x2fab('0x8'),'script':path['join'](__dirname,_0x2fab('0x9'))}]};module[_0x2fab('0xa')]=config; \ No newline at end of file +var _0xf82e=['join','../../services/express/index.js','../../services/ami/index.js','agi','../../services/agi/index.js','email','../../services/email/index.js','../../services/routing/index.js','xdr','../../services/xdr/index.js','path','express'];(function(_0x3b76e9,_0x39efb2){var _0x43489c=function(_0x1040a9){while(--_0x1040a9){_0x3b76e9['push'](_0x3b76e9['shift']());}};_0x43489c(++_0x39efb2);}(_0xf82e,0x172));var _0xef82=function(_0x3e2e76,_0xe5b4fc){_0x3e2e76=_0x3e2e76-0x0;var _0x47666e=_0xf82e[_0x3e2e76];return _0x47666e;};'use strict';var path=require(_0xef82('0x0'));var os=require('os');var config={'apps':[{'name':_0xef82('0x1'),'script':path[_0xef82('0x2')](__dirname,_0xef82('0x3'))},{'name':'ami','script':path['join'](__dirname,_0xef82('0x4'))},{'name':_0xef82('0x5'),'script':path[_0xef82('0x2')](__dirname,_0xef82('0x6'))},{'name':_0xef82('0x7'),'script':path[_0xef82('0x2')](__dirname,_0xef82('0x8'))},{'name':'routing','script':path['join'](__dirname,_0xef82('0x9'))},{'name':_0xef82('0xa'),'script':path[_0xef82('0x2')](__dirname,_0xef82('0xb'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index 1eb1b11..54bcc42 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 _0x9275=['restart','list','describe','delete','dump','bluebird','./config','connect','connected','start','disconnect','then','stop'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9275,0x130));var _0x5927=function(_0x38ced4,_0x24263f){_0x38ced4=_0x38ced4-0x0;var _0x547c07=_0x9275[_0x38ced4];return _0x547c07;};'use strict';var pm2=require('pm2');var BPromise=require(_0x5927('0x0'));var config=require(_0x5927('0x1'));function connect(){return new BPromise(function(_0x16b603,_0x550146){return pm2[_0x5927('0x2')](function(_0x2077b3){if(_0x2077b3){return _0x550146(_0x2077b3);}return _0x16b603(_0x5927('0x3'));});});};exports[_0x5927('0x4')]=function(_0x3140af){return connect()['then'](function(){return new BPromise(function(_0x14e0db,_0x495127){return pm2[_0x5927('0x4')](_0x3140af,function(_0x21793c,_0x36ee78){if(_0x21793c){return _0x495127(_0x21793c);}pm2[_0x5927('0x5')]();return _0x14e0db(_0x36ee78);});});});};exports['stop']=function(_0x276a4a){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0x384b96,_0x166559){return pm2[_0x5927('0x7')](_0x276a4a,function(_0x40c4c4,_0x3db5f4){if(_0x40c4c4){return _0x166559(_0x40c4c4);}pm2[_0x5927('0x5')]();return _0x384b96(_0x3db5f4);});});});};exports['restart']=function(_0x5b961a){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0x1e8f76,_0x4271de){return pm2[_0x5927('0x8')](_0x5b961a,function(_0x50be11,_0x1c98d7){if(_0x50be11){return _0x4271de(_0x50be11);}pm2['disconnect']();return _0x1e8f76(_0x1c98d7);});});});};exports[_0x5927('0x9')]=function(){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0x415f6b,_0x2e39cc){return pm2[_0x5927('0x9')](function(_0x358734,_0x5ab29f){if(_0x358734){return _0x2e39cc(_0x358734);}pm2['disconnect']();return _0x415f6b(_0x5ab29f);});});});};exports[_0x5927('0xa')]=function(_0x41ce6c){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0xd80a6a,_0x4b2aaa){return pm2[_0x5927('0xa')](_0x41ce6c,function(_0x5d22f9,_0x468c50){if(_0x5d22f9){return _0x4b2aaa(_0x5d22f9);}pm2[_0x5927('0x5')]();return _0xd80a6a(_0x468c50);});});});};exports[_0x5927('0xb')]=function(_0x1cb381){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0x1d7311,_0x2b74f8){return pm2[_0x5927('0xb')](_0x1cb381,function(_0x355aca,_0xeb6073){if(_0x355aca){return _0x2b74f8(_0x355aca);}pm2[_0x5927('0x5')]();return _0x1d7311(_0xeb6073);});});});};exports[_0x5927('0xc')]=function(){return connect()[_0x5927('0x6')](function(){return new BPromise(function(_0x452684,_0x51d9c1){return pm2[_0x5927('0xc')](function(_0x15af48){if(_0x15af48){return _0x51d9c1(_0x15af48);}return _0x452684('saved');});});});}; \ No newline at end of file +var _0x6a88=['pm2','bluebird','./config','connect','start','stop','disconnect','restart','then','list','describe','delete','dump'];(function(_0x1cd5b1,_0x58dd23){var _0x25b4c7=function(_0x272195){while(--_0x272195){_0x1cd5b1['push'](_0x1cd5b1['shift']());}};_0x25b4c7(++_0x58dd23);}(_0x6a88,0xa9));var _0x86a8=function(_0x27bbab,_0x1b6cfe){_0x27bbab=_0x27bbab-0x0;var _0x560a4f=_0x6a88[_0x27bbab];return _0x560a4f;};'use strict';var pm2=require(_0x86a8('0x0'));var BPromise=require(_0x86a8('0x1'));var config=require(_0x86a8('0x2'));function connect(){return new BPromise(function(_0x3c2a38,_0x69237e){return pm2[_0x86a8('0x3')](function(_0x1f00e4){if(_0x1f00e4){return _0x69237e(_0x1f00e4);}return _0x3c2a38('connected');});});};exports[_0x86a8('0x4')]=function(_0x5aa681){return connect()['then'](function(){return new BPromise(function(_0xe01315,_0x29a32a){return pm2['start'](_0x5aa681,function(_0x3726f0,_0x479d92){if(_0x3726f0){return _0x29a32a(_0x3726f0);}pm2['disconnect']();return _0xe01315(_0x479d92);});});});};exports[_0x86a8('0x5')]=function(_0x11481e){return connect()['then'](function(){return new BPromise(function(_0x221cdf,_0xaf94b7){return pm2['stop'](_0x11481e,function(_0x55a3cf,_0xa3d829){if(_0x55a3cf){return _0xaf94b7(_0x55a3cf);}pm2[_0x86a8('0x6')]();return _0x221cdf(_0xa3d829);});});});};exports[_0x86a8('0x7')]=function(_0x3e5127){return connect()[_0x86a8('0x8')](function(){return new BPromise(function(_0xe2088b,_0x19fe6f){return pm2[_0x86a8('0x7')](_0x3e5127,function(_0x328b8d,_0x2bb661){if(_0x328b8d){return _0x19fe6f(_0x328b8d);}pm2['disconnect']();return _0xe2088b(_0x2bb661);});});});};exports[_0x86a8('0x9')]=function(){return connect()['then'](function(){return new BPromise(function(_0x54194f,_0x430729){return pm2[_0x86a8('0x9')](function(_0x5d5b9d,_0x520697){if(_0x5d5b9d){return _0x430729(_0x5d5b9d);}pm2['disconnect']();return _0x54194f(_0x520697);});});});};exports[_0x86a8('0xa')]=function(_0x2554be){return connect()['then'](function(){return new BPromise(function(_0xb3e0d,_0x4007cd){return pm2[_0x86a8('0xa')](_0x2554be,function(_0xaf18f,_0x540be7){if(_0xaf18f){return _0x4007cd(_0xaf18f);}pm2[_0x86a8('0x6')]();return _0xb3e0d(_0x540be7);});});});};exports['delete']=function(_0x13d387){return connect()[_0x86a8('0x8')](function(){return new BPromise(function(_0x4a2916,_0x101e7d){return pm2[_0x86a8('0xb')](_0x13d387,function(_0x149cdf,_0x42291e){if(_0x149cdf){return _0x101e7d(_0x149cdf);}pm2[_0x86a8('0x6')]();return _0x4a2916(_0x42291e);});});});};exports[_0x86a8('0xc')]=function(){return connect()['then'](function(){return new BPromise(function(_0x159777,_0x7c6471){return pm2[_0x86a8('0xc')](function(_0x20e4a6){if(_0x20e4a6){return _0x7c6471(_0x20e4a6);}return _0x159777('saved');});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 7fb88fa..9e46b7b 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 _0xf8cd=['system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','length','emit','error','start','moment','../../mysqldb','../../config/environment','redis','defaults','socket.io-emitter','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','update'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0xf8cd,0x8c));var _0xdf8c=function(_0x5e95c4,_0x6140d3){_0x5e95c4=_0x5e95c4-0x0;var _0x1f7bd5=_0xf8cd[_0x5e95c4];return _0x1f7bd5;};'use strict';var _=require('lodash');var moment=require(_0xdf8c('0x0'));var Redis=require('ioredis');var db=require(_0xdf8c('0x1'))['db'];var config=require(_0xdf8c('0x2'));config[_0xdf8c('0x3')]=_[_0xdf8c('0x4')](config[_0xdf8c('0x3')],{'host':'localhost','port':0x18eb});var io=require(_0xdf8c('0x5'))(new Redis(config[_0xdf8c('0x3')]));function closeInteractions(){var _0x115881=0x0;var _0x3db89a=[];return db['Setting']['find']({'raw':!![],'attributes':['id',_0xdf8c('0x6')],'where':{'id':0x1}})[_0xdf8c('0x7')](function(_0x260d28){_0x115881=_0x260d28[_0xdf8c('0x6')];if(_0x115881){return db[_0xdf8c('0x8')][_0xdf8c('0x9')]({'raw':!![],'attributes':['id',_0xdf8c('0xa')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0xdf8c('0xb')](_0x260d28[_0xdf8c('0x6')],_0xdf8c('0xc'))}}});}else{return[];}})['then'](function(_0x278495){_0x3db89a=_0x278495;if(_0x115881){return db['ChatInteraction'][_0xdf8c('0xd')]({'closeReason':_0xdf8c('0xe'),'disposition':_0xdf8c('0xf'),'closed':!![],'closedAt':moment()[_0xdf8c('0x10')](_0xdf8c('0x11'))},{'where':{'id':_['map'](_0x3db89a||[],'id')}});}})[_0xdf8c('0x7')](function(_0x38fd01){for(var _0x30abad=0x0;_0x30abad<_0x3db89a[_0xdf8c('0x12')];_0x30abad++){io[_0xdf8c('0x13')]('chatInteraction:update',{'id':_0x3db89a[_0x30abad]['id'],'closed':!![]});}})['catch'](function(_0xb02104){console[_0xdf8c('0x14')](_0xb02104);});}exports[_0xdf8c('0x15')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf526=['length','emit','catch','error','start','ioredis','../../mysqldb','../../config/environment','redis','defaults','localhost','Setting','find','chatTimeout','then','ChatInteraction','findAll','lastMsgAt','subtract','minutes','update','system','timeout','format','YYYY-MM-DD\x20HH:mm:ss','map'];(function(_0xd2d54,_0x5329f7){var _0x78b113=function(_0x7d2b29){while(--_0x7d2b29){_0xd2d54['push'](_0xd2d54['shift']());}};_0x78b113(++_0x5329f7);}(_0xf526,0xbb));var _0x6f52=function(_0x3c7fb0,_0x9be449){_0x3c7fb0=_0x3c7fb0-0x0;var _0x2814b2=_0xf526[_0x3c7fb0];return _0x2814b2;};'use strict';var _=require('lodash');var moment=require('moment');var Redis=require(_0x6f52('0x0'));var db=require(_0x6f52('0x1'))['db'];var config=require(_0x6f52('0x2'));config[_0x6f52('0x3')]=_[_0x6f52('0x4')](config['redis'],{'host':_0x6f52('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x6f52('0x3')]));function closeInteractions(){var _0x28e38a=0x0;var _0x1f523c=[];return db[_0x6f52('0x6')][_0x6f52('0x7')]({'raw':!![],'attributes':['id',_0x6f52('0x8')],'where':{'id':0x1}})[_0x6f52('0x9')](function(_0x108c3b){_0x28e38a=_0x108c3b[_0x6f52('0x8')];if(_0x28e38a){return db[_0x6f52('0xa')][_0x6f52('0xb')]({'raw':!![],'attributes':['id',_0x6f52('0xc')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x6f52('0xd')](_0x108c3b[_0x6f52('0x8')],_0x6f52('0xe'))}}});}else{return[];}})[_0x6f52('0x9')](function(_0x28c03b){_0x1f523c=_0x28c03b;if(_0x28e38a){return db[_0x6f52('0xa')][_0x6f52('0xf')]({'closeReason':_0x6f52('0x10'),'disposition':_0x6f52('0x11'),'closed':!![],'closedAt':moment()[_0x6f52('0x12')](_0x6f52('0x13'))},{'where':{'id':_[_0x6f52('0x14')](_0x1f523c||[],'id')}});}})[_0x6f52('0x9')](function(_0x571e0b){for(var _0x478e0e=0x0;_0x478e0e<_0x1f523c[_0x6f52('0x15')];_0x478e0e++){io[_0x6f52('0x16')]('chatInteraction:update',{'id':_0x1f523c[_0x478e0e]['id'],'closed':!![]});}})[_0x6f52('0x17')](function(_0x11116f){console[_0x6f52('0x18')](_0x11116f);});}exports[_0x6f52('0x19')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file diff --git a/server/config/schedule/index.js b/server/config/schedule/index.js index 4346442..1f0616b 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 _0xfc00=['host','port','secure','authentication','auth','user','pass','format','\x22%s\x22\x20<%s>','name','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','subtractUnit','join','../../files/reports','basename','savename','zip','existsSync','status','attachments','text','stringify','Sent','message','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','SendMail','then','error','error\x20mail','email\x20sent','catch','isNil','subtractNumber\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','Schedule','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','length','exists','delete\x20cron','my\x20id','resolve','run\x20job','cron','active','startAt','endAt','add','start','add\x20cron','stop','deleteJob','stop\x20cron','isBetween','update\x20cron','path','lodash','cron-job-manager','bluebird','../logger','schedule','../../mysqldb','../../api/analyticCustomReport/analyticCustomReport.controller','../../api/analyticDefaultReport/analyticDefaultReport.controller','http','info','Try\x20to\x20send\x20a\x20mail\x20to','email','service','MailAccount','Smtp'];(function(_0x9d7228,_0x24ce6a){var _0x4ee29d=function(_0x15e2e8){while(--_0x15e2e8){_0x9d7228['push'](_0x9d7228['shift']());}};_0x4ee29d(++_0x24ce6a);}(_0xfc00,0xfb));var _0x0fc0=function(_0x1cd674,_0x8d3638){_0x1cd674=_0x1cd674-0x0;var _0x27928f=_0xfc00[_0x1cd674];return _0x27928f;};'use strict';var fs=require('fs');var util=require('util');var path=require(_0x0fc0('0x0'));var _=require(_0x0fc0('0x1'));var moment=require('moment');var CronJobManager=require(_0x0fc0('0x2'));var jayson=require('jayson/promise');var BPromise=require(_0x0fc0('0x3'));var logger=require(_0x0fc0('0x4'))(_0x0fc0('0x5'));var db=require(_0x0fc0('0x6'))['db'];var analyticCustomReportController=require(_0x0fc0('0x7'));var analyticDefaultReportController=require(_0x0fc0('0x8'));var client=jayson['client'][_0x0fc0('0x9')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x2b18bb,_0x501c18){return function(){logger[_0x0fc0('0xa')](_0x0fc0('0xb'),_0x2b18bb[_0x0fc0('0xc')]);var _0x1fc2ab=!![];var _0x1598e4={'tls':{'rejectUnauthorized':![]}};if(_0x2b18bb['MailAccount']['Smtp'][_0x0fc0('0xd')]){_0x1598e4[_0x0fc0('0xd')]=_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0xf')][_0x0fc0('0xd')];}else{_0x1598e4[_0x0fc0('0x10')]=_0x2b18bb['MailAccount'][_0x0fc0('0xf')]['host'];_0x1598e4[_0x0fc0('0x11')]=_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0xf')][_0x0fc0('0x11')];_0x1598e4[_0x0fc0('0x12')]=_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0xf')][_0x0fc0('0x12')];}if(_0x2b18bb[_0x0fc0('0xe')]['Smtp'][_0x0fc0('0x13')]){_0x1598e4[_0x0fc0('0x14')]={'user':_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0xf')][_0x0fc0('0x15')],'pass':_0x2b18bb['MailAccount'][_0x0fc0('0xf')][_0x0fc0('0x16')]};}var _0x404b56={'account':_0x1598e4,'message':{'from':util[_0x0fc0('0x17')](_0x0fc0('0x18'),_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0x19')],_0x2b18bb[_0x0fc0('0xe')][_0x0fc0('0xc')]||_0x2b18bb['MailAccount'][_0x0fc0('0xf')][_0x0fc0('0x15')]),'to':_0x2b18bb[_0x0fc0('0xc')],'cc':_0x2b18bb['cc'],'bcc':_0x2b18bb[_0x0fc0('0x1a')],'subject':util[_0x0fc0('0x17')](_0x0fc0('0x1b'),_0x501c18[_0x0fc0('0x19')],_0x2b18bb[_0x0fc0('0x1c')],_0x2b18bb[_0x0fc0('0x1d')])}};var _0x2000b4=path[_0x0fc0('0x1e')](__dirname,_0x0fc0('0x1f'));var _0x1f221c=_0x501c18['savename'];var _0x2984c3=util['format']('%s.%s',path[_0x0fc0('0x20')](_0x501c18[_0x0fc0('0x21')],path['extname'](_0x501c18['savename'])),_0x0fc0('0x22'));var _0x1759d7=path['join'](_0x2000b4,_0x1f221c);var _0x4512e0=path[_0x0fc0('0x1e')](_0x2000b4,_0x2984c3);if(fs[_0x0fc0('0x23')](_0x1759d7)){_0x501c18[_0x0fc0('0x24')]='Sent';_0x404b56['message'][_0x0fc0('0x25')]=[{'filename':_0x1f221c,'path':_0x1759d7}];_0x404b56['message'][_0x0fc0('0x26')]=util['format']('Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a',JSON[_0x0fc0('0x27')](_0x501c18,null,0x2));}else if(fs[_0x0fc0('0x23')](_0x4512e0)){_0x501c18[_0x0fc0('0x24')]=_0x0fc0('0x28');_0x404b56[_0x0fc0('0x29')]['attachments']=[{'filename':_0x2984c3,'path':_0x4512e0}];}else{_0x404b56[_0x0fc0('0x29')][_0x0fc0('0x26')]=_0x0fc0('0x2a');if(!_0x2b18bb[_0x0fc0('0x2b')]){_0x1fc2ab=![];logger[_0x0fc0('0xa')](_0x0fc0('0x2c'));}}if(_0x1fc2ab){return client['request'](_0x0fc0('0x2d'),_0x404b56)[_0x0fc0('0x2e')](function(_0x47f978){if(_0x47f978['error']){return logger[_0x0fc0('0x2f')](_0x0fc0('0x30'),JSON['stringify'](_0x47f978));}return logger[_0x0fc0('0xa')](_0x0fc0('0x31'));})[_0x0fc0('0x32')](function(_0x153b52){return logger[_0x0fc0('0x2f')](_0x0fc0('0x30'),JSON[_0x0fc0('0x27')](_0x153b52));});}};}function handleError(){return function(_0x459302){return logger[_0x0fc0('0x2f')](JSON[_0x0fc0('0x27')](_0x459302));};}function handleResult(_0x58fcee){return function(_0x21d6fa){logger[_0x0fc0('0xa')]('data',JSON[_0x0fc0('0x27')](_0x21d6fa));if(_0x58fcee[_0x0fc0('0xe')]&&_0x58fcee[_0x0fc0('0xe')][_0x0fc0('0xf')]&&!_[_0x0fc0('0x33')](_0x58fcee[_0x0fc0('0xc')])){setTimeout(handleSendEmail(_0x58fcee,_0x21d6fa),0x3c*0x3e8);}};}function handleJob(_0x35f3e7){return function(){try{if(_[_0x0fc0('0x33')](_0x35f3e7[_0x0fc0('0x1c')])){return logger['info'](_0x0fc0('0x34'));}if(_['isNil'](_0x35f3e7[_0x0fc0('0x1d')])){return logger['info']('subtractUnit\x20null\x20or\x20undefined');}var _0x5a86b3={'startDate':moment()[_0x0fc0('0x35')](_0x35f3e7[_0x0fc0('0x1c')],_0x35f3e7[_0x0fc0('0x1d')])[_0x0fc0('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'endDate':moment()[_0x0fc0('0x17')](_0x0fc0('0x36')),'type':_0x0fc0('0x37'),'output':_0x35f3e7[_0x0fc0('0x38')],'name':_0x35f3e7['name']};if(!_[_0x0fc0('0x33')](_0x35f3e7[_0x0fc0('0x39')])){logger[_0x0fc0('0xa')](_0x0fc0('0x3a'),_0x35f3e7['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x35f3e7[_0x0fc0('0x39')]},_0x5a86b3)[_0x0fc0('0x2e')](handleResult(_0x35f3e7))[_0x0fc0('0x32')](handleError());}if(!_[_0x0fc0('0x33')](_0x35f3e7[_0x0fc0('0x3b')])){logger[_0x0fc0('0xa')](_0x0fc0('0x3c'),_0x35f3e7['CustomReportId']);return analyticCustomReportController['runReport']({'id':_0x35f3e7[_0x0fc0('0x3b')]},_0x5a86b3)['then'](handleResult(_0x35f3e7))[_0x0fc0('0x32')](handleError());}}catch(_0x20965f){logger[_0x0fc0('0x2f')](JSON[_0x0fc0('0x27')](_0x20965f));}return logger[_0x0fc0('0xa')](_0x0fc0('0x3d'));};}function getJobs(_0xfda6ed){var _0x296b2e={};if(_0xfda6ed){_0x296b2e['id']=_0xfda6ed;}return db[_0x0fc0('0x3e')][_0x0fc0('0x3f')]({'where':_0x296b2e,'include':[{'model':db[_0x0fc0('0xe')],'attributes':['id',_0x0fc0('0x19'),'email'],'include':[{'model':db[_0x0fc0('0x40')],'as':'Smtp'}]}]})[_0x0fc0('0x2e')](function(_0x2f1c81){var _0x1ffb49=_[_0x0fc0('0x41')](manager[_0x0fc0('0x42')]);var _0x1c952b=_[_0x0fc0('0x43')](_0x2f1c81,function(_0x15ad74){return _0x15ad74['id'][_0x0fc0('0x44')]();});var _0x22f82c=_[_0x0fc0('0x45')](_0x2f1c81,function(_0x891975){return _0x891975['id'][_0x0fc0('0x44')]();});var _0x5c7661=_0xfda6ed?_0x1c952b:_[_0x0fc0('0x46')](_0x1c952b,_0x1ffb49);var _0x458cf3=_['intersection'](_0x1c952b,_0x1ffb49);var _0x1377bd=_[_0x0fc0('0x46')](_0x1ffb49,_0x1c952b);var _0x6f4782;var _0x111f16;for(_0x6f4782=0x0;_0x6f4782<_0x1377bd[_0x0fc0('0x47')]&&!_0xfda6ed;_0x6f4782+=0x1){_0x111f16=_0x1377bd[_0x6f4782][_0x0fc0('0x44')]();if(manager[_0x0fc0('0x48')](_0x111f16)){manager['stop'](_0x111f16);manager['deleteJob'](_0x111f16);logger[_0x0fc0('0xa')](_0x0fc0('0x49'),_0x111f16);}}logger[_0x0fc0('0xa')]('toRun',JSON['stringify'](_0x5c7661));for(_0x6f4782=0x0;_0x6f4782<_0x5c7661[_0x0fc0('0x47')];_0x6f4782+=0x1){_0x111f16=_0x5c7661[_0x6f4782]['toString']();logger[_0x0fc0('0xa')]('index',_0x111f16);if(_0xfda6ed){logger[_0x0fc0('0xa')](_0x0fc0('0x4a'),_0xfda6ed);logger[_0x0fc0('0xa')](JSON['stringify'](_0x22f82c[_0x111f16]));BPromise[_0x0fc0('0x4b')]()[_0x0fc0('0x2e')](handleJob(_0x22f82c[_0x111f16]));logger[_0x0fc0('0xa')](_0x0fc0('0x4c'),_0x22f82c[_0x111f16][_0x0fc0('0x19')],_0x22f82c[_0x111f16]['cron']);}else if(_0x22f82c[_0x111f16][_0x0fc0('0x4d')]&&_0x22f82c[_0x111f16][_0x0fc0('0x4e')]&&moment()['isBetween'](_0x22f82c[_0x111f16][_0x0fc0('0x4f')],_0x22f82c[_0x111f16][_0x0fc0('0x50')])){manager[_0x0fc0('0x51')](_0x111f16,_0x22f82c[_0x111f16][_0x0fc0('0x4d')],handleJob(_0x22f82c[_0x111f16]));manager[_0x0fc0('0x52')](_0x111f16);logger[_0x0fc0('0xa')](_0x0fc0('0x53'),_0x22f82c[_0x111f16][_0x0fc0('0x19')],_0x22f82c[_0x111f16][_0x0fc0('0x4d')]);}else if(manager[_0x0fc0('0x48')](_0x111f16)){manager[_0x0fc0('0x54')](_0x111f16);manager[_0x0fc0('0x55')](_0x111f16);logger['info'](_0x0fc0('0x56'),_0x22f82c[_0x111f16][_0x0fc0('0x19')],_0x22f82c[_0x111f16]['cron']);}}for(_0x6f4782=0x0,_0x111f16;_0x6f4782<_0x458cf3[_0x0fc0('0x47')]&&!_0xfda6ed;_0x6f4782+=0x1){_0x111f16=_0x458cf3[_0x6f4782][_0x0fc0('0x44')]();if(manager[_0x0fc0('0x48')](_0x111f16)){if(_0x22f82c[_0x111f16]['cron']&&_0x22f82c[_0x111f16]['active']&&moment()[_0x0fc0('0x57')](_0x22f82c[_0x111f16][_0x0fc0('0x4f')],_0x22f82c[_0x111f16][_0x0fc0('0x50')])){manager['update'](_0x111f16,_0x22f82c[_0x111f16][_0x0fc0('0x4d')],handleJob(_0x22f82c[_0x111f16]));logger[_0x0fc0('0xa')](_0x0fc0('0x58'),_0x22f82c[_0x111f16][_0x0fc0('0x19')],_0x22f82c[_0x111f16][_0x0fc0('0x4d')]);}else{manager['stop'](_0x111f16);manager[_0x0fc0('0x55')](_0x111f16);logger['info'](_0x0fc0('0x56'),_0x22f82c[_0x111f16]['name'],_0x22f82c[_0x111f16][_0x0fc0('0x4d')]);}}}})[_0x0fc0('0x32')](function(_0x35e215){logger[_0x0fc0('0x2f')](JSON[_0x0fc0('0x27')](_0x35e215));});}exports['run']=function(_0x3b8d51){return getJobs(_0x3b8d51);};exports[_0x0fc0('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x03c3=['exec\x20defaul\x20report\x20id:%s','runReport','catch','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','keys','jobs','map','toString','keyBy','difference','intersection','length','exists','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron','active','isBetween','startAt','endAt','add','add\x20cron','stop','update','update\x20cron','run','util','path','lodash','moment','jayson/promise','bluebird','../logger','schedule','../../api/analyticDefaultReport/analyticDefaultReport.controller','client','info','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','user','format','name','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','../../files/reports','savename','basename','zip','join','existsSync','status','Sent','message','attachments','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','sendIfEmpty','empty\x20file,\x20email\x20not\x20sent','request','SendMail','then','error','error\x20mail','email\x20sent','data','isNil','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId'];(function(_0x2a806b,_0x5326c2){var _0x58bc23=function(_0x45c321){while(--_0x45c321){_0x2a806b['push'](_0x2a806b['shift']());}};_0x58bc23(++_0x5326c2);}(_0x03c3,0x1d5));var _0x303c=function(_0x5a3c0d,_0x3c58fa){_0x5a3c0d=_0x5a3c0d-0x0;var _0x5c8fe4=_0x03c3[_0x5a3c0d];return _0x5c8fe4;};'use strict';var fs=require('fs');var util=require(_0x303c('0x0'));var path=require(_0x303c('0x1'));var _=require(_0x303c('0x2'));var moment=require(_0x303c('0x3'));var CronJobManager=require('cron-job-manager');var jayson=require(_0x303c('0x4'));var BPromise=require(_0x303c('0x5'));var logger=require(_0x303c('0x6'))(_0x303c('0x7'));var db=require('../../mysqldb')['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require(_0x303c('0x8'));var client=jayson[_0x303c('0x9')]['http']({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x52af16,_0x33bfec){return function(){logger[_0x303c('0xa')](_0x303c('0xb'),_0x52af16[_0x303c('0xc')]);var _0x1515ee=!![];var _0x502e76={'tls':{'rejectUnauthorized':![]}};if(_0x52af16[_0x303c('0xd')][_0x303c('0xe')][_0x303c('0xf')]){_0x502e76[_0x303c('0xf')]=_0x52af16[_0x303c('0xd')][_0x303c('0xe')][_0x303c('0xf')];}else{_0x502e76[_0x303c('0x10')]=_0x52af16['MailAccount'][_0x303c('0xe')][_0x303c('0x10')];_0x502e76[_0x303c('0x11')]=_0x52af16[_0x303c('0xd')]['Smtp'][_0x303c('0x11')];_0x502e76[_0x303c('0x12')]=_0x52af16[_0x303c('0xd')][_0x303c('0xe')][_0x303c('0x12')];}if(_0x52af16[_0x303c('0xd')][_0x303c('0xe')]['authentication']){_0x502e76['auth']={'user':_0x52af16['MailAccount'][_0x303c('0xe')][_0x303c('0x13')],'pass':_0x52af16[_0x303c('0xd')][_0x303c('0xe')]['pass']};}var _0x228a5f={'account':_0x502e76,'message':{'from':util[_0x303c('0x14')]('\x22%s\x22\x20<%s>',_0x52af16[_0x303c('0xd')][_0x303c('0x15')],_0x52af16['MailAccount'][_0x303c('0xc')]||_0x52af16['MailAccount'][_0x303c('0xe')][_0x303c('0x13')]),'to':_0x52af16['email'],'cc':_0x52af16['cc'],'bcc':_0x52af16['bcc'],'subject':util[_0x303c('0x14')](_0x303c('0x16'),_0x33bfec['name'],_0x52af16[_0x303c('0x17')],_0x52af16['subtractUnit'])}};var _0x5cd86d=path['join'](__dirname,_0x303c('0x18'));var _0x22de32=_0x33bfec[_0x303c('0x19')];var _0x46c341=util[_0x303c('0x14')]('%s.%s',path[_0x303c('0x1a')](_0x33bfec[_0x303c('0x19')],path['extname'](_0x33bfec[_0x303c('0x19')])),_0x303c('0x1b'));var _0x1d733c=path[_0x303c('0x1c')](_0x5cd86d,_0x22de32);var _0x4e90cd=path[_0x303c('0x1c')](_0x5cd86d,_0x46c341);if(fs[_0x303c('0x1d')](_0x1d733c)){_0x33bfec[_0x303c('0x1e')]=_0x303c('0x1f');_0x228a5f[_0x303c('0x20')][_0x303c('0x21')]=[{'filename':_0x22de32,'path':_0x1d733c}];_0x228a5f['message'][_0x303c('0x22')]=util[_0x303c('0x14')](_0x303c('0x23'),JSON[_0x303c('0x24')](_0x33bfec,null,0x2));}else if(fs[_0x303c('0x1d')](_0x4e90cd)){_0x33bfec['status']=_0x303c('0x1f');_0x228a5f['message']['attachments']=[{'filename':_0x46c341,'path':_0x4e90cd}];}else{_0x228a5f[_0x303c('0x20')][_0x303c('0x22')]='Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a';if(!_0x52af16[_0x303c('0x25')]){_0x1515ee=![];logger[_0x303c('0xa')](_0x303c('0x26'));}}if(_0x1515ee){return client[_0x303c('0x27')](_0x303c('0x28'),_0x228a5f)[_0x303c('0x29')](function(_0x4d0865){if(_0x4d0865[_0x303c('0x2a')]){return logger[_0x303c('0x2a')](_0x303c('0x2b'),JSON[_0x303c('0x24')](_0x4d0865));}return logger['info'](_0x303c('0x2c'));})['catch'](function(_0x176ab2){return logger['error'](_0x303c('0x2b'),JSON['stringify'](_0x176ab2));});}};}function handleError(){return function(_0x47d513){return logger[_0x303c('0x2a')](JSON[_0x303c('0x24')](_0x47d513));};}function handleResult(_0x581497){return function(_0x51463f){logger[_0x303c('0xa')](_0x303c('0x2d'),JSON[_0x303c('0x24')](_0x51463f));if(_0x581497['MailAccount']&&_0x581497[_0x303c('0xd')][_0x303c('0xe')]&&!_['isNil'](_0x581497['email'])){setTimeout(handleSendEmail(_0x581497,_0x51463f),0x3c*0x3e8);}};}function handleJob(_0x4df0b3){return function(){try{if(_[_0x303c('0x2e')](_0x4df0b3[_0x303c('0x17')])){return logger['info']('subtractNumber\x20null\x20or\x20undefined');}if(_['isNil'](_0x4df0b3['subtractUnit'])){return logger['info'](_0x303c('0x2f'));}var _0x562e95={'startDate':moment()[_0x303c('0x30')](_0x4df0b3[_0x303c('0x17')],_0x4df0b3['subtractUnit'])[_0x303c('0x14')](_0x303c('0x31')),'endDate':moment()[_0x303c('0x14')](_0x303c('0x31')),'type':_0x303c('0x32'),'output':_0x4df0b3[_0x303c('0x33')],'name':_0x4df0b3[_0x303c('0x15')]};if(!_['isNil'](_0x4df0b3[_0x303c('0x34')])){logger['info'](_0x303c('0x35'),_0x4df0b3[_0x303c('0x34')]);return analyticDefaultReportController[_0x303c('0x36')]({'id':_0x4df0b3[_0x303c('0x34')]},_0x562e95)[_0x303c('0x29')](handleResult(_0x4df0b3))[_0x303c('0x37')](handleError());}if(!_[_0x303c('0x2e')](_0x4df0b3[_0x303c('0x38')])){logger[_0x303c('0xa')](_0x303c('0x39'),_0x4df0b3[_0x303c('0x38')]);return analyticCustomReportController[_0x303c('0x36')]({'id':_0x4df0b3[_0x303c('0x38')]},_0x562e95)['then'](handleResult(_0x4df0b3))[_0x303c('0x37')](handleError());}}catch(_0x200201){logger[_0x303c('0x2a')](JSON['stringify'](_0x200201));}return logger[_0x303c('0xa')](_0x303c('0x3a'));};}function getJobs(_0x57afda){var _0x302c4a={};if(_0x57afda){_0x302c4a['id']=_0x57afda;}return db['Schedule'][_0x303c('0x3b')]({'where':_0x302c4a,'include':[{'model':db[_0x303c('0xd')],'attributes':['id',_0x303c('0x15'),'email'],'include':[{'model':db[_0x303c('0x3c')],'as':'Smtp'}]}]})['then'](function(_0x14afef){var _0x5c7bcc=_[_0x303c('0x3d')](manager[_0x303c('0x3e')]);var _0x3d089f=_[_0x303c('0x3f')](_0x14afef,function(_0x3f649b){return _0x3f649b['id'][_0x303c('0x40')]();});var _0x142e18=_[_0x303c('0x41')](_0x14afef,function(_0x4111d4){return _0x4111d4['id'][_0x303c('0x40')]();});var _0x3cc096=_0x57afda?_0x3d089f:_[_0x303c('0x42')](_0x3d089f,_0x5c7bcc);var _0x94693d=_[_0x303c('0x43')](_0x3d089f,_0x5c7bcc);var _0xb2bf3f=_['difference'](_0x5c7bcc,_0x3d089f);var _0x3d3352;var _0x3fcb74;for(_0x3d3352=0x0;_0x3d3352<_0xb2bf3f[_0x303c('0x44')]&&!_0x57afda;_0x3d3352+=0x1){_0x3fcb74=_0xb2bf3f[_0x3d3352][_0x303c('0x40')]();if(manager[_0x303c('0x45')](_0x3fcb74)){manager['stop'](_0x3fcb74);manager[_0x303c('0x46')](_0x3fcb74);logger['info'](_0x303c('0x47'),_0x3fcb74);}}logger[_0x303c('0xa')](_0x303c('0x48'),JSON[_0x303c('0x24')](_0x3cc096));for(_0x3d3352=0x0;_0x3d3352<_0x3cc096[_0x303c('0x44')];_0x3d3352+=0x1){_0x3fcb74=_0x3cc096[_0x3d3352]['toString']();logger[_0x303c('0xa')](_0x303c('0x49'),_0x3fcb74);if(_0x57afda){logger[_0x303c('0xa')](_0x303c('0x4a'),_0x57afda);logger['info'](JSON[_0x303c('0x24')](_0x142e18[_0x3fcb74]));BPromise[_0x303c('0x4b')]()[_0x303c('0x29')](handleJob(_0x142e18[_0x3fcb74]));logger['info']('run\x20job',_0x142e18[_0x3fcb74][_0x303c('0x15')],_0x142e18[_0x3fcb74][_0x303c('0x4c')]);}else if(_0x142e18[_0x3fcb74][_0x303c('0x4c')]&&_0x142e18[_0x3fcb74][_0x303c('0x4d')]&&moment()[_0x303c('0x4e')](_0x142e18[_0x3fcb74][_0x303c('0x4f')],_0x142e18[_0x3fcb74][_0x303c('0x50')])){manager[_0x303c('0x51')](_0x3fcb74,_0x142e18[_0x3fcb74][_0x303c('0x4c')],handleJob(_0x142e18[_0x3fcb74]));manager['start'](_0x3fcb74);logger['info'](_0x303c('0x52'),_0x142e18[_0x3fcb74][_0x303c('0x15')],_0x142e18[_0x3fcb74][_0x303c('0x4c')]);}else if(manager[_0x303c('0x45')](_0x3fcb74)){manager[_0x303c('0x53')](_0x3fcb74);manager[_0x303c('0x46')](_0x3fcb74);logger[_0x303c('0xa')]('stop\x20cron',_0x142e18[_0x3fcb74]['name'],_0x142e18[_0x3fcb74]['cron']);}}for(_0x3d3352=0x0,_0x3fcb74;_0x3d3352<_0x94693d[_0x303c('0x44')]&&!_0x57afda;_0x3d3352+=0x1){_0x3fcb74=_0x94693d[_0x3d3352][_0x303c('0x40')]();if(manager[_0x303c('0x45')](_0x3fcb74)){if(_0x142e18[_0x3fcb74][_0x303c('0x4c')]&&_0x142e18[_0x3fcb74][_0x303c('0x4d')]&&moment()[_0x303c('0x4e')](_0x142e18[_0x3fcb74][_0x303c('0x4f')],_0x142e18[_0x3fcb74]['endAt'])){manager[_0x303c('0x54')](_0x3fcb74,_0x142e18[_0x3fcb74]['cron'],handleJob(_0x142e18[_0x3fcb74]));logger[_0x303c('0xa')](_0x303c('0x55'),_0x142e18[_0x3fcb74]['name'],_0x142e18[_0x3fcb74][_0x303c('0x4c')]);}else{manager[_0x303c('0x53')](_0x3fcb74);manager['deleteJob'](_0x3fcb74);logger[_0x303c('0xa')]('stop\x20cron',_0x142e18[_0x3fcb74][_0x303c('0x15')],_0x142e18[_0x3fcb74]['cron']);}}}})['catch'](function(_0x4a3ad8){logger[_0x303c('0x2a')](JSON[_0x303c('0x24')](_0x4a3ad8));});}exports[_0x303c('0x56')]=function(_0x3ddce9){return getJobs(_0x3ddce9);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 5970fb0..65377b8 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xbfcd=['hopper1','hopper2','catch','util','push','Biondo','innocenzo.biondo','@xcally.com','now','Innocenzo','CmContact','destroy','then','bulkCreate','log','finished\x20populating','CmHopper'];(function(_0x20f0ed,_0xd4cb61){var _0x41c926=function(_0xc31344){while(--_0xc31344){_0x20f0ed['push'](_0x20f0ed['shift']());}};_0x41c926(++_0xd4cb61);}(_0xbfcd,0xcf));var _0xdbfc=function(_0x3b4d99,_0x23e266){_0x3b4d99=_0x3b4d99-0x0;var _0x4a8c07=_0xbfcd[_0x3b4d99];return _0x4a8c07;};'use strict';var util=require(_0xdbfc('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0xdbfc('0x1')]({'id':i,'firstName':'Innocenzo'+i,'lastName':_0xdbfc('0x2')+i,'phone':0xf879fb460+i,'email':_0xdbfc('0x3')+i+_0xdbfc('0x4')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0xdbfc('0x5')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0xdbfc('0x5')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0xdbfc('0x1')]({'id':i,'firstName':_0xdbfc('0x6')+i,'lastName':_0xdbfc('0x2')+i,'phone':0xf879fb460+i,'email':_0xdbfc('0x3')+i+_0xdbfc('0x4')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0xdbfc('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0xdbfc('0x5')](),'updatedAt':Date[_0xdbfc('0x5')]()});}db[_0xdbfc('0x7')][_0xdbfc('0x8')]({'where':{}})[_0xdbfc('0x9')](function(){return db[_0xdbfc('0x7')][_0xdbfc('0xa')](contacts);})[_0xdbfc('0x9')](function(){console[_0xdbfc('0xb')](_0xdbfc('0xc'),'contacts1');return db[_0xdbfc('0xd')][_0xdbfc('0x8')]({'where':{}});})['then'](function(){return db[_0xdbfc('0xd')]['bulkCreate'](hopper);})[_0xdbfc('0x9')](function(){console[_0xdbfc('0xb')](_0xdbfc('0xc'),_0xdbfc('0xe'));return db[_0xdbfc('0x7')][_0xdbfc('0xa')](contacts2);})[_0xdbfc('0x9')](function(){console['log'](_0xdbfc('0xc'),'contacts2');return db['CmHopper'][_0xdbfc('0xa')](hopper2);})['then'](function(){console[_0xdbfc('0xb')](_0xdbfc('0xc'),_0xdbfc('0xf'));})[_0xdbfc('0x10')](function(_0x9cc4d3){console[_0xdbfc('0xb')](_0x9cc4d3);}); \ No newline at end of file +var _0x1157=['CmHopper','hopper2','util','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','log','contacts1','bulkCreate','hopper1','finished\x20populating','contacts2'];(function(_0x68c979,_0x431cff){var _0x4f0001=function(_0xa7595d){while(--_0xa7595d){_0x68c979['push'](_0x68c979['shift']());}};_0x4f0001(++_0x431cff);}(_0x1157,0xfe));var _0x7115=function(_0x31efeb,_0x5a2bd4){_0x31efeb=_0x31efeb-0x0;var _0x1c2f1c=_0x1157[_0x31efeb];return _0x1c2f1c;};'use strict';var util=require(_0x7115('0x0'));var db=require('../mysqldb')['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7115('0x1')]({'id':i,'firstName':_0x7115('0x2')+i,'lastName':_0x7115('0x3')+i,'phone':0xf879fb460+i,'email':_0x7115('0x4')+i+_0x7115('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7115('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x7115('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7115('0x6')](),'updatedAt':Date[_0x7115('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x7115('0x1')]({'id':i,'firstName':_0x7115('0x2')+i,'lastName':_0x7115('0x3')+i,'phone':0xf879fb460+i,'email':_0x7115('0x4')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7115('0x6')](),'updatedAt':Date[_0x7115('0x6')]()});}db[_0x7115('0x7')][_0x7115('0x8')]({'where':{}})[_0x7115('0x9')](function(){return db[_0x7115('0x7')]['bulkCreate'](contacts);})[_0x7115('0x9')](function(){console[_0x7115('0xa')]('finished\x20populating',_0x7115('0xb'));return db['CmHopper'][_0x7115('0x8')]({'where':{}});})['then'](function(){return db['CmHopper'][_0x7115('0xc')](hopper);})['then'](function(){console[_0x7115('0xa')]('finished\x20populating',_0x7115('0xd'));return db[_0x7115('0x7')][_0x7115('0xc')](contacts2);})[_0x7115('0x9')](function(){console[_0x7115('0xa')](_0x7115('0xe'),_0x7115('0xf'));return db[_0x7115('0x10')]['bulkCreate'](hopper2);})[_0x7115('0x9')](function(){console[_0x7115('0xa')](_0x7115('0xe'),_0x7115('0x11'));})['catch'](function(_0x4a0d42){console['log'](_0x4a0d42);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index 6c33fd5..322e8b8 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ace=['udp','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','actpass','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','push','%s%s','agent','format','%s%s@xcally.com','password'];(function(_0xc34682,_0x4d9ec6){var _0x376264=function(_0xcccbee){while(--_0xcccbee){_0xc34682['push'](_0xc34682['shift']());}};_0x376264(++_0x4d9ec6);}(_0x2ace,0x12a));var _0xe2ac=function(_0x5a9c0c,_0x4ec485){_0x5a9c0c=_0x5a9c0c-0x0;var _0x53c77d=_0x2ace[_0x5a9c0c];return _0x53c77d;};'use strict';var util=require('util');var db=require('../mysqldb')['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xe2ac('0x0')]({'name':util['format'](_0xe2ac('0x1'),_0xe2ac('0x2'),i),'fullname':util[_0xe2ac('0x3')](_0xe2ac('0x1'),_0xe2ac('0x2'),i),'email':util[_0xe2ac('0x3')](_0xe2ac('0x4'),_0xe2ac('0x2'),i),'role':'agent','password':_0xe2ac('0x5'),'internal':0xfa0+i,'type':'friend','transport':[_0xe2ac('0x6'),'ws','wss'],'disallow':[_0xe2ac('0x7')],'allow':[_0xe2ac('0x8')],'defaultuser':util['format'](_0xe2ac('0x1'),'agent',i),'encryption':'yes','avpf':_0xe2ac('0x9'),'force_avp':_0xe2ac('0x9'),'icesupport':_0xe2ac('0x9'),'dtlsenable':_0xe2ac('0x9'),'dtlsverify':'no','dtlscertfile':_0xe2ac('0xa'),'dtlsprivatekey':_0xe2ac('0xb'),'dtlssetup':_0xe2ac('0xc'),'callerid':util[_0xe2ac('0x3')](_0xe2ac('0xd'),util[_0xe2ac('0x3')](_0xe2ac('0x1'),_0xe2ac('0x2'),i),0xfa0+i)});}db[_0xe2ac('0xe')][_0xe2ac('0xf')](users)['then'](function(){console[_0xe2ac('0x10')](_0xe2ac('0x11'));})[_0xe2ac('0x12')](function(_0x2865ac){console[_0xe2ac('0x10')](_0x2865ac);}); \ No newline at end of file +var _0x3f29=['agent','format','%s%s@xcally.com','password','wss','all','ulaw','yes','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','log','add\x20user','catch','util','../mysqldb','%s%s'];(function(_0x1803ac,_0x561b88){var _0x254e0e=function(_0xc7b5cb){while(--_0xc7b5cb){_0x1803ac['push'](_0x1803ac['shift']());}};_0x254e0e(++_0x561b88);}(_0x3f29,0xbb));var _0x93f2=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0x3f29[_0x376b45];return _0x2341b3;};'use strict';var util=require(_0x93f2('0x0'));var db=require(_0x93f2('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users['push']({'name':util['format'](_0x93f2('0x2'),_0x93f2('0x3'),i),'fullname':util[_0x93f2('0x4')](_0x93f2('0x2'),_0x93f2('0x3'),i),'email':util[_0x93f2('0x4')](_0x93f2('0x5'),_0x93f2('0x3'),i),'role':'agent','password':_0x93f2('0x6'),'internal':0xfa0+i,'type':'friend','transport':['udp','ws',_0x93f2('0x7')],'disallow':[_0x93f2('0x8')],'allow':[_0x93f2('0x9')],'defaultuser':util[_0x93f2('0x4')]('%s%s',_0x93f2('0x3'),i),'encryption':'yes','avpf':'yes','force_avp':'yes','icesupport':'yes','dtlsenable':_0x93f2('0xa'),'dtlsverify':'no','dtlscertfile':_0x93f2('0xb'),'dtlsprivatekey':_0x93f2('0xc'),'dtlssetup':'actpass','callerid':util['format'](_0x93f2('0xd'),util[_0x93f2('0x4')](_0x93f2('0x2'),_0x93f2('0x3'),i),0xfa0+i)});}db[_0x93f2('0xe')][_0x93f2('0xf')](users)['then'](function(){console[_0x93f2('0x10')](_0x93f2('0x11'));})[_0x93f2('0x12')](function(_0x4a5016){console[_0x93f2('0x10')](_0x4a5016);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index cd1e9b7..d96f2bb 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x925d=['FaxQueue','MailQueue','user','voice:outbound','VoiceQueues','VoiceQueue','FaxQueues','SmsQueue','OpenchannelQueue','Trunks','Trunk','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','chat','fax','sms','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','catch','log','join','default','connection','setMaxListeners','address','request','remoteAddress','connectedAt','nsp','lodash','util','bluebird','../mysqldb','./environment','name','role','agent','telephone','type','ivr','UserProfileSection','findOne','then','autoAssociation','ChatQueues','MailQueues','OpenchannelQueues','findAll','Telephones','IvrCampaigns','UserProfileResource','resourceId','map','User','Campaign','where','format','%s:queue:%s','Agents','length','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteractions','SmsInteractions','OpenchannelInteraction','voice:inbound','include','push','ChatQueue'];(function(_0x39bfb6,_0x4272c8){var _0x23fef9=function(_0x5f83c1){while(--_0x5f83c1){_0x39bfb6['push'](_0x39bfb6['shift']());}};_0x23fef9(++_0x4272c8);}(_0x925d,0x131));var _0xd925=function(_0x5aac8e,_0x512b58){_0x5aac8e=_0x5aac8e-0x0;var _0x6e1e5c=_0x925d[_0x5aac8e];return _0x6e1e5c;};'use strict';var _=require(_0xd925('0x0'));var util=require(_0xd925('0x1'));var BPromise=require(_0xd925('0x2'));var db=require(_0xd925('0x3'))['db'];var config=require(_0xd925('0x4'));var queryQueues={'attributes':['id',_0xd925('0x5')],'include':[{'as':'Agents','model':db['User'],'attributes':['id',_0xd925('0x5'),_0xd925('0x6')],'raw':!![],'where':{'role':_0xd925('0x7')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0xd925('0x8')}};var queryTrunks={'raw':!![],'attributes':['id',_0xd925('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0xd925('0x5')],'where':{'role':_0xd925('0x7')}};var queryCampaigns={'raw':!![],'attributes':['id',_0xd925('0x5'),_0xd925('0x9')],'where':{'type':_0xd925('0xa')}};function getAssociatedResources(_0x4dd0bd,_0x5ad4a1,_0xae3cba){return db[_0xd925('0xb')][_0xd925('0xc')]({'where':{'name':_0x4dd0bd,'userProfileId':_0x5ad4a1},'raw':!![]})[_0xd925('0xd')](function(_0xb20912){if(_0xb20912){if(_0xb20912[_0xd925('0xe')]){switch(_0x4dd0bd){case'VoiceQueues':case _0xd925('0xf'):case'FaxQueues':case'SmsQueues':case _0xd925('0x10'):case _0xd925('0x11'):return db[_0xae3cba][_0xd925('0x12')](queryQueues);case _0xd925('0x13'):return db[_0xae3cba][_0xd925('0x12')](queryTelephones);case'Trunks':return db[_0xae3cba]['findAll'](queryTrunks);case _0xd925('0x14'):return db[_0xae3cba]['findAll'](queryCampaigns);}}else{return db[_0xd925('0x15')][_0xd925('0x12')]({'attributes':[_0xd925('0x16')],'where':{'sectionId':_0xb20912['id']},'raw':!![]})[_0xd925('0xd')](function(_0x22147a){if(_0x22147a){var _0x34f8f4={'where':{'id':_[_0xd925('0x17')](_0x22147a,_0xd925('0x16'))},'raw':!![]};switch(_0xae3cba){case _0xd925('0x18'):_0x34f8f4['where'][_0xd925('0x6')]=_0xd925('0x8');break;case _0xd925('0x19'):_0x34f8f4[_0xd925('0x1a')][_0xd925('0x9')]='ivr';break;}return db[_0xae3cba][_0xd925('0x12')](_0x34f8f4);}else{return[];}});}}else{return[];}})[_0xd925('0xd')](function(_0xf4601e){return _0xf4601e;});}function joinOrLeaveQueues(_0x2adbae,_0x5f20d4,_0x49cf88,_0x35d987){_0x2adbae[_0x5f20d4](util[_0xd925('0x1b')](_0xd925('0x1c'),_0x49cf88,_0x35d987[_0xd925('0x5')]));if(_0x35d987[_0xd925('0x1d')]){for(var _0x4f03a6=0x0;_0x4f03a6<_0x35d987[_0xd925('0x1d')][_0xd925('0x1e')];_0x4f03a6+=0x1){_0x2adbae[_0x5f20d4](util[_0xd925('0x1b')](_0xd925('0x1f'),_0x35d987['Agents'][_0x4f03a6][_0xd925('0x5')]));}}}function joinOrLeave(_0x2459a5,_0x9b3147,_0xcdc60b){var _0x2f2a89;if(_0x2459a5[_0xd925('0x20')][_0xd925('0x21')]['id']){db['User'][_0xd925('0x22')]({'attributes':['id','name',_0xd925('0x6'),_0xd925('0x23')],'where':{'id':_0x2459a5[_0xd925('0x20')][_0xd925('0x21')]['id']},'include':[{'model':db[_0xd925('0x24')],'as':_0xd925('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0xd925('0x26')],'as':_0xd925('0x27'),'attributes':['id'],'raw':!![]},{'model':db['FaxInteraction'],'as':_0xd925('0x28'),'attributes':['id'],'raw':!![]},{'model':db['SmsInteraction'],'as':_0xd925('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xd925('0x2a')],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x1b086f){if(_0x1b086f){_0x2f2a89=_0x1b086f;_0x2459a5[_0x9b3147](util[_0xd925('0x1b')](_0xd925('0x1f'),_0x1b086f[_0xd925('0x5')]));var _0x53d249=[];switch(_0x1b086f[_0xd925('0x6')]){case'admin':_0x2459a5[_0x9b3147](_0xd925('0x2b'));_0x2459a5[_0x9b3147]('voice:outbound');if(queryQueues['hasOwnProperty'](_0xd925('0x2c'))){delete queryQueues[_0xd925('0x2c')];}_0x53d249[_0xd925('0x2d')](db['VoiceQueue'][_0xd925('0x12')](queryQueues));_0x53d249[_0xd925('0x2d')](db[_0xd925('0x2e')][_0xd925('0x12')](queryQueues));_0x53d249[_0xd925('0x2d')](db[_0xd925('0x2f')][_0xd925('0x12')](queryQueues));_0x53d249[_0xd925('0x2d')](db['SmsQueue']['findAll'](queryQueues));_0x53d249[_0xd925('0x2d')](db[_0xd925('0x30')][_0xd925('0x12')](queryQueues));_0x53d249[_0xd925('0x2d')](db['OpenchannelQueue'][_0xd925('0x12')](queryQueues));_0x53d249[_0xd925('0x2d')](db['User'][_0xd925('0x12')](queryTelephones));_0x53d249['push'](db['Trunk'][_0xd925('0x12')](queryTrunks));_0x53d249['push'](db[_0xd925('0x19')][_0xd925('0x12')](queryCampaigns));_0x53d249[_0xd925('0x2d')](db[_0xd925('0x18')][_0xd925('0x12')](queryAgents));break;case _0xd925('0x31'):_0x2459a5[_0x9b3147](_0xd925('0x2b'));_0x2459a5[_0x9b3147](_0xd925('0x32'));_0x53d249['push'](getAssociatedResources(_0xd925('0x33'),_0x1b086f['userProfileId'],_0xd925('0x34')));_0x53d249['push'](getAssociatedResources(_0xd925('0xf'),_0x1b086f[_0xd925('0x23')],_0xd925('0x2e')));_0x53d249[_0xd925('0x2d')](getAssociatedResources(_0xd925('0x35'),_0x1b086f[_0xd925('0x23')],_0xd925('0x2f')));_0x53d249[_0xd925('0x2d')](getAssociatedResources('SmsQueues',_0x1b086f['userProfileId'],_0xd925('0x36')));_0x53d249['push'](getAssociatedResources(_0xd925('0x10'),_0x1b086f[_0xd925('0x23')],'MailQueue'));_0x53d249[_0xd925('0x2d')](getAssociatedResources('OpenchannelQueues',_0x1b086f['userProfileId'],_0xd925('0x37')));_0x53d249[_0xd925('0x2d')](getAssociatedResources(_0xd925('0x13'),_0x1b086f[_0xd925('0x23')],_0xd925('0x18')));_0x53d249[_0xd925('0x2d')](getAssociatedResources(_0xd925('0x38'),_0x1b086f[_0xd925('0x23')],_0xd925('0x39')));_0x53d249[_0xd925('0x2d')](getAssociatedResources(_0xd925('0x14'),_0x1b086f[_0xd925('0x23')],_0xd925('0x19')));_0x53d249[_0xd925('0x2d')](db['User'][_0xd925('0x12')](queryAgents));break;case'agent':_0x2459a5[_0x9b3147](_0xd925('0x2b'));_0x2459a5[_0x9b3147](_0xd925('0x32'));_0x53d249['push'](_0x1b086f['getVoiceQueues']({'attributes':['id',_0xd925('0x5')]}));_0x53d249[_0xd925('0x2d')](_0x1b086f['getChatQueues']({'attributes':['id',_0xd925('0x5')]}));_0x53d249[_0xd925('0x2d')](_0x1b086f[_0xd925('0x3a')]({'attributes':['id','name']}));_0x53d249[_0xd925('0x2d')](_0x1b086f[_0xd925('0x3b')]({'attributes':['id',_0xd925('0x5')]}));_0x53d249[_0xd925('0x2d')](_0x1b086f[_0xd925('0x3c')]({'attributes':['id',_0xd925('0x5')]}));_0x53d249[_0xd925('0x2d')](_0x1b086f[_0xd925('0x3d')]({'attributes':['id',_0xd925('0x5')]}));break;}return BPromise[_0xd925('0x3e')](_0x53d249);}})[_0xd925('0xd')](function(_0x53c00d){if(_0x53c00d&&_0x53c00d[_0xd925('0x1e')]){for(var _0x311272=0x0;_0x311272<_0x53c00d['length'];_0x311272+=0x1){for(var _0x337e59=0x0;_0x337e59<_0x53c00d[_0x311272][_0xd925('0x1e')];_0x337e59+=0x1){switch(_0x311272){case 0x0:joinOrLeaveQueues(_0x2459a5,_0x9b3147,'voice',_0x53c00d[_0x311272][_0x337e59]);break;case 0x1:joinOrLeaveQueues(_0x2459a5,_0x9b3147,_0xd925('0x3f'),_0x53c00d[_0x311272][_0x337e59]);break;case 0x2:joinOrLeaveQueues(_0x2459a5,_0x9b3147,_0xd925('0x40'),_0x53c00d[_0x311272][_0x337e59]);break;case 0x3:joinOrLeaveQueues(_0x2459a5,_0x9b3147,_0xd925('0x41'),_0x53c00d[_0x311272][_0x337e59]);break;case 0x4:joinOrLeaveQueues(_0x2459a5,_0x9b3147,'mail',_0x53c00d[_0x311272][_0x337e59]);break;case 0x5:joinOrLeaveQueues(_0x2459a5,_0x9b3147,_0xd925('0x42'),_0x53c00d[_0x311272][_0x337e59]);break;case 0x6:_0x2459a5[_0x9b3147](util[_0xd925('0x1b')](_0xd925('0x43'),_0x53c00d[_0x311272][_0x337e59][_0xd925('0x5')]));break;case 0x7:_0x2459a5[_0x9b3147](util[_0xd925('0x1b')](_0xd925('0x44'),_0x53c00d[_0x311272][_0x337e59]['name']));break;case 0x8:_0x2459a5[_0x9b3147](util[_0xd925('0x1b')]('campaign:%s:%s',_0x53c00d[_0x311272][_0x337e59]['type'],_0x53c00d[_0x311272][_0x337e59][_0xd925('0x5')]));break;case 0x9:_0x2459a5[_0x9b3147](util[_0xd925('0x1b')]('user:%s',_0x53c00d[_0x311272][_0x337e59][_0xd925('0x5')]));break;}}}}})[_0xd925('0xd')](function(){if(_0x9b3147===_0xd925('0x45')){var _0x15ac68=_['map'](_0x2f2a89[_0xd925('0x25')],'id');return _0x2f2a89[_0xd925('0x46')](_0x15ac68)[_0xd925('0xd')](function(){for(var _0x3dcc73=0x0;_0x3dcc73<_0x15ac68[_0xd925('0x1e')];_0x3dcc73+=0x1){_0xcdc60b['emit']('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x15ac68[_0x3dcc73]),'UserId':Number(_0x2f2a89['id'])});}});}})[_0xd925('0xd')](function(){if(_0x9b3147===_0xd925('0x45')){var _0x324dcc=_[_0xd925('0x17')](_0x2f2a89['MailInteractions'],'id');return _0x2f2a89['removeMailInteractions'](_0x324dcc)[_0xd925('0xd')](function(){for(var _0x38992f=0x0;_0x38992f<_0x324dcc[_0xd925('0x1e')];_0x38992f+=0x1){_0xcdc60b[_0xd925('0x47')](_0xd925('0x48'),{'MailInteractionId':Number(_0x324dcc[_0x38992f]),'UserId':Number(_0x2f2a89['id'])});}});}})[_0xd925('0xd')](function(){if(_0x9b3147===_0xd925('0x45')){var _0x53cacd=_[_0xd925('0x17')](_0x2f2a89[_0xd925('0x28')],'id');return _0x2f2a89[_0xd925('0x49')](_0x53cacd)[_0xd925('0xd')](function(){for(var _0x201c1b=0x0;_0x201c1b<_0x53cacd['length'];_0x201c1b+=0x1){_0xcdc60b[_0xd925('0x47')](_0xd925('0x4a'),{'FaxInteractionId':Number(_0x53cacd[_0x201c1b]),'UserId':Number(_0x2f2a89['id'])});}});}})[_0xd925('0xd')](function(){if(_0x9b3147==='leave'){var _0x2d41c6=_[_0xd925('0x17')](_0x2f2a89['SmsInteractions'],'id');return _0x2f2a89['removeSmsInteractions'](_0x2d41c6)[_0xd925('0xd')](function(){for(var _0x212eb3=0x0;_0x212eb3<_0x2d41c6['length'];_0x212eb3+=0x1){_0xcdc60b[_0xd925('0x47')](_0xd925('0x4b'),{'SmsInteractionId':Number(_0x2d41c6[_0x212eb3]),'UserId':Number(_0x2f2a89['id'])});}});}})['then'](function(){if(_0x9b3147===_0xd925('0x45')){var _0x269ff9=_[_0xd925('0x17')](_0x2f2a89[_0xd925('0x4c')],'id');return _0x2f2a89['removeOpenchannelInteractions'](_0x269ff9)['then'](function(){for(var _0x3294ee=0x0;_0x3294ee<_0x269ff9['length'];_0x3294ee+=0x1){_0xcdc60b[_0xd925('0x47')]('user_has_openchannel_interactions:remove',{'OpenchannelInteractionId':Number(_0x269ff9[_0x3294ee]),'UserId':Number(_0x2f2a89['id'])});}});}})[_0xd925('0x4d')](function(_0x4707b6){_0x2459a5[_0xd925('0x4e')](_0x4707b6);});}}function onDisconnect(_0x1cf4df,_0x4f29b3){joinOrLeave(_0x1cf4df,'leave',_0x4f29b3);}function onConnect(_0x3357f8){joinOrLeave(_0x3357f8,_0xd925('0x4f'));}exports[_0xd925('0x50')]=function(_0x3d1a74){_0x3d1a74['on'](_0xd925('0x51'),function(_0x4ba5d9){_0x4ba5d9[_0xd925('0x52')](0x0);_0x4ba5d9[_0xd925('0x53')]=_0x4ba5d9[_0xd925('0x54')][_0xd925('0x51')][_0xd925('0x55')]+':'+_0x4ba5d9['request']['connection']['remotePort'];_0x4ba5d9[_0xd925('0x56')]=new Date();_0x4ba5d9['log']=function(_0x1d2639){console[_0xd925('0x4e')]('SocketIO\x20'+_0x4ba5d9[_0xd925('0x57')]['name']+'['+_0x4ba5d9[_0xd925('0x53')]+']',_0x1d2639);};_0x4ba5d9['on']('disconnect',function(){onDisconnect(_0x4ba5d9,_0x3d1a74);_0x4ba5d9['log']('DISCONNECTED');});onConnect(_0x4ba5d9);_0x4ba5d9[_0xd925('0x4e')]('CONNECTED');});}; \ No newline at end of file +var _0xbb41=['ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','FaxInteractions','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','MailQueue','OpenchannelQueue','Trunk','user','VoiceQueues','FaxQueues','SmsQueue','getVoiceQueues','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','all','chat','fax','sms','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_fax_interactions:remove','removeSmsInteractions','user_has_sms_interactions:remove','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','setMaxListeners','address','request','connection','remoteAddress','remotePort','connectedAt','SocketIO\x20','nsp','DISCONNECTED','CONNECTED','lodash','util','bluebird','../mysqldb','./environment','name','Agents','role','agent','telephone','type','ivr','findOne','autoAssociation','ChatQueues','SmsQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','User','where','Campaign','then','format','%s:queue:%s','length','user:%s','query','find','userProfileId','handshake','ChatInteraction'];(function(_0x32be11,_0x15960b){var _0x463961=function(_0x130380){while(--_0x130380){_0x32be11['push'](_0x32be11['shift']());}};_0x463961(++_0x15960b);}(_0xbb41,0xfe));var _0x1bb4=function(_0x2a39ae,_0x51a148){_0x2a39ae=_0x2a39ae-0x0;var _0x43da39=_0xbb41[_0x2a39ae];return _0x43da39;};'use strict';var _=require(_0x1bb4('0x0'));var util=require(_0x1bb4('0x1'));var BPromise=require(_0x1bb4('0x2'));var db=require(_0x1bb4('0x3'))['db'];var config=require(_0x1bb4('0x4'));var queryQueues={'attributes':['id',_0x1bb4('0x5')],'include':[{'as':_0x1bb4('0x6'),'model':db['User'],'attributes':['id',_0x1bb4('0x5'),_0x1bb4('0x7')],'raw':!![],'where':{'role':_0x1bb4('0x8')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id','name'],'where':{'role':_0x1bb4('0x9')}};var queryTrunks={'raw':!![],'attributes':['id',_0x1bb4('0x5')]};var queryAgents={'raw':!![],'attributes':['id',_0x1bb4('0x5')],'where':{'role':_0x1bb4('0x8')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0x1bb4('0xa')],'where':{'type':_0x1bb4('0xb')}};function getAssociatedResources(_0x27a629,_0x340524,_0xe29a3f){return db['UserProfileSection'][_0x1bb4('0xc')]({'where':{'name':_0x27a629,'userProfileId':_0x340524},'raw':!![]})['then'](function(_0xa8a6a8){if(_0xa8a6a8){if(_0xa8a6a8[_0x1bb4('0xd')]){switch(_0x27a629){case'VoiceQueues':case _0x1bb4('0xe'):case'FaxQueues':case _0x1bb4('0xf'):case _0x1bb4('0x10'):case _0x1bb4('0x11'):return db[_0xe29a3f][_0x1bb4('0x12')](queryQueues);case _0x1bb4('0x13'):return db[_0xe29a3f][_0x1bb4('0x12')](queryTelephones);case _0x1bb4('0x14'):return db[_0xe29a3f][_0x1bb4('0x12')](queryTrunks);case'IvrCampaigns':return db[_0xe29a3f][_0x1bb4('0x12')](queryCampaigns);}}else{return db[_0x1bb4('0x15')]['findAll']({'attributes':[_0x1bb4('0x16')],'where':{'sectionId':_0xa8a6a8['id']},'raw':!![]})['then'](function(_0x5eba71){if(_0x5eba71){var _0x2f9f3b={'where':{'id':_[_0x1bb4('0x17')](_0x5eba71,_0x1bb4('0x16'))},'raw':!![]};switch(_0xe29a3f){case _0x1bb4('0x18'):_0x2f9f3b[_0x1bb4('0x19')][_0x1bb4('0x7')]=_0x1bb4('0x9');break;case _0x1bb4('0x1a'):_0x2f9f3b['where']['type']='ivr';break;}return db[_0xe29a3f][_0x1bb4('0x12')](_0x2f9f3b);}else{return[];}});}}else{return[];}})[_0x1bb4('0x1b')](function(_0x2bd1bc){return _0x2bd1bc;});}function joinOrLeaveQueues(_0x3c23e0,_0x1b84a8,_0x46b6c5,_0x355361){_0x3c23e0[_0x1b84a8](util[_0x1bb4('0x1c')](_0x1bb4('0x1d'),_0x46b6c5,_0x355361['name']));if(_0x355361[_0x1bb4('0x6')]){for(var _0x280b34=0x0;_0x280b34<_0x355361[_0x1bb4('0x6')][_0x1bb4('0x1e')];_0x280b34+=0x1){_0x3c23e0[_0x1b84a8](util[_0x1bb4('0x1c')](_0x1bb4('0x1f'),_0x355361[_0x1bb4('0x6')][_0x280b34][_0x1bb4('0x5')]));}}}function joinOrLeave(_0x5225fd,_0x34bfe8,_0x29d022){var _0x25e8b2;if(_0x5225fd['handshake'][_0x1bb4('0x20')]['id']){db['User'][_0x1bb4('0x21')]({'attributes':['id',_0x1bb4('0x5'),_0x1bb4('0x7'),_0x1bb4('0x22')],'where':{'id':_0x5225fd[_0x1bb4('0x23')][_0x1bb4('0x20')]['id']},'include':[{'model':db[_0x1bb4('0x24')],'as':_0x1bb4('0x25'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bb4('0x26')],'as':_0x1bb4('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bb4('0x28')],'as':_0x1bb4('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0x1bb4('0x2a')],'as':_0x1bb4('0x2b'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x1121ca){if(_0x1121ca){_0x25e8b2=_0x1121ca;_0x5225fd[_0x34bfe8](util['format'](_0x1bb4('0x1f'),_0x1121ca[_0x1bb4('0x5')]));var _0xf080e1=[];switch(_0x1121ca[_0x1bb4('0x7')]){case _0x1bb4('0x2c'):_0x5225fd[_0x34bfe8](_0x1bb4('0x2d'));_0x5225fd[_0x34bfe8](_0x1bb4('0x2e'));if(queryQueues[_0x1bb4('0x2f')](_0x1bb4('0x30'))){delete queryQueues[_0x1bb4('0x30')];}_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x32')][_0x1bb4('0x12')](queryQueues));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x33')][_0x1bb4('0x12')](queryQueues));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x34')][_0x1bb4('0x12')](queryQueues));_0xf080e1[_0x1bb4('0x31')](db['SmsQueue'][_0x1bb4('0x12')](queryQueues));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x35')]['findAll'](queryQueues));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x36')][_0x1bb4('0x12')](queryQueues));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x18')][_0x1bb4('0x12')](queryTelephones));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x37')][_0x1bb4('0x12')](queryTrunks));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x1a')][_0x1bb4('0x12')](queryCampaigns));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x18')][_0x1bb4('0x12')](queryAgents));break;case _0x1bb4('0x38'):_0x5225fd[_0x34bfe8](_0x1bb4('0x2d'));_0x5225fd[_0x34bfe8](_0x1bb4('0x2e'));_0xf080e1['push'](getAssociatedResources(_0x1bb4('0x39'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x32')));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources(_0x1bb4('0xe'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x33')));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources(_0x1bb4('0x3a'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x34')));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources(_0x1bb4('0xf'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x3b')));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources(_0x1bb4('0x10'),_0x1121ca[_0x1bb4('0x22')],'MailQueue'));_0xf080e1['push'](getAssociatedResources(_0x1bb4('0x11'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x36')));_0xf080e1['push'](getAssociatedResources(_0x1bb4('0x13'),_0x1121ca[_0x1bb4('0x22')],'User'));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources(_0x1bb4('0x14'),_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x37')));_0xf080e1[_0x1bb4('0x31')](getAssociatedResources('IvrCampaigns',_0x1121ca[_0x1bb4('0x22')],_0x1bb4('0x1a')));_0xf080e1[_0x1bb4('0x31')](db[_0x1bb4('0x18')]['findAll'](queryAgents));break;case'agent':_0x5225fd[_0x34bfe8](_0x1bb4('0x2d'));_0x5225fd[_0x34bfe8](_0x1bb4('0x2e'));_0xf080e1['push'](_0x1121ca[_0x1bb4('0x3c')]({'attributes':['id',_0x1bb4('0x5')]}));_0xf080e1['push'](_0x1121ca[_0x1bb4('0x3d')]({'attributes':['id','name']}));_0xf080e1[_0x1bb4('0x31')](_0x1121ca[_0x1bb4('0x3e')]({'attributes':['id',_0x1bb4('0x5')]}));_0xf080e1['push'](_0x1121ca[_0x1bb4('0x3f')]({'attributes':['id',_0x1bb4('0x5')]}));_0xf080e1[_0x1bb4('0x31')](_0x1121ca[_0x1bb4('0x40')]({'attributes':['id','name']}));_0xf080e1[_0x1bb4('0x31')](_0x1121ca['getOpenchannelQueues']({'attributes':['id','name']}));break;}return BPromise[_0x1bb4('0x41')](_0xf080e1);}})[_0x1bb4('0x1b')](function(_0x31cc08){if(_0x31cc08&&_0x31cc08[_0x1bb4('0x1e')]){for(var _0x4c63c3=0x0;_0x4c63c3<_0x31cc08['length'];_0x4c63c3+=0x1){for(var _0x160036=0x0;_0x160036<_0x31cc08[_0x4c63c3]['length'];_0x160036+=0x1){switch(_0x4c63c3){case 0x0:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,'voice',_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x1:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,_0x1bb4('0x42'),_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x2:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,_0x1bb4('0x43'),_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x3:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,_0x1bb4('0x44'),_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x4:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,'mail',_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x5:joinOrLeaveQueues(_0x5225fd,_0x34bfe8,_0x1bb4('0x45'),_0x31cc08[_0x4c63c3][_0x160036]);break;case 0x6:_0x5225fd[_0x34bfe8](util[_0x1bb4('0x1c')](_0x1bb4('0x46'),_0x31cc08[_0x4c63c3][_0x160036][_0x1bb4('0x5')]));break;case 0x7:_0x5225fd[_0x34bfe8](util[_0x1bb4('0x1c')](_0x1bb4('0x47'),_0x31cc08[_0x4c63c3][_0x160036]['name']));break;case 0x8:_0x5225fd[_0x34bfe8](util[_0x1bb4('0x1c')]('campaign:%s:%s',_0x31cc08[_0x4c63c3][_0x160036][_0x1bb4('0xa')],_0x31cc08[_0x4c63c3][_0x160036]['name']));break;case 0x9:_0x5225fd[_0x34bfe8](util[_0x1bb4('0x1c')](_0x1bb4('0x1f'),_0x31cc08[_0x4c63c3][_0x160036][_0x1bb4('0x5')]));break;}}}}})[_0x1bb4('0x1b')](function(){if(_0x34bfe8===_0x1bb4('0x48')){var _0x1a2b85=_[_0x1bb4('0x17')](_0x25e8b2[_0x1bb4('0x25')],'id');return _0x25e8b2[_0x1bb4('0x49')](_0x1a2b85)[_0x1bb4('0x1b')](function(){for(var _0x23b200=0x0;_0x23b200<_0x1a2b85['length'];_0x23b200+=0x1){_0x29d022[_0x1bb4('0x4a')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x1a2b85[_0x23b200]),'UserId':Number(_0x25e8b2['id'])});}});}})[_0x1bb4('0x1b')](function(){if(_0x34bfe8===_0x1bb4('0x48')){var _0x3b1ab7=_[_0x1bb4('0x17')](_0x25e8b2['MailInteractions'],'id');return _0x25e8b2[_0x1bb4('0x4b')](_0x3b1ab7)['then'](function(){for(var _0x123313=0x0;_0x123313<_0x3b1ab7[_0x1bb4('0x1e')];_0x123313+=0x1){_0x29d022[_0x1bb4('0x4a')](_0x1bb4('0x4c'),{'MailInteractionId':Number(_0x3b1ab7[_0x123313]),'UserId':Number(_0x25e8b2['id'])});}});}})[_0x1bb4('0x1b')](function(){if(_0x34bfe8===_0x1bb4('0x48')){var _0x53ea7c=_['map'](_0x25e8b2['FaxInteractions'],'id');return _0x25e8b2[_0x1bb4('0x4d')](_0x53ea7c)[_0x1bb4('0x1b')](function(){for(var _0x294678=0x0;_0x294678<_0x53ea7c['length'];_0x294678+=0x1){_0x29d022['emit'](_0x1bb4('0x4e'),{'FaxInteractionId':Number(_0x53ea7c[_0x294678]),'UserId':Number(_0x25e8b2['id'])});}});}})[_0x1bb4('0x1b')](function(){if(_0x34bfe8===_0x1bb4('0x48')){var _0x5ec46d=_['map'](_0x25e8b2[_0x1bb4('0x2b')],'id');return _0x25e8b2[_0x1bb4('0x4f')](_0x5ec46d)[_0x1bb4('0x1b')](function(){for(var _0x3f0eab=0x0;_0x3f0eab<_0x5ec46d['length'];_0x3f0eab+=0x1){_0x29d022['emit'](_0x1bb4('0x50'),{'SmsInteractionId':Number(_0x5ec46d[_0x3f0eab]),'UserId':Number(_0x25e8b2['id'])});}});}})[_0x1bb4('0x1b')](function(){if(_0x34bfe8===_0x1bb4('0x48')){var _0x403406=_[_0x1bb4('0x17')](_0x25e8b2['OpenchannelInteractions'],'id');return _0x25e8b2[_0x1bb4('0x51')](_0x403406)[_0x1bb4('0x1b')](function(){for(var _0x30a044=0x0;_0x30a044<_0x403406[_0x1bb4('0x1e')];_0x30a044+=0x1){_0x29d022[_0x1bb4('0x4a')](_0x1bb4('0x52'),{'OpenchannelInteractionId':Number(_0x403406[_0x30a044]),'UserId':Number(_0x25e8b2['id'])});}});}})[_0x1bb4('0x53')](function(_0x276183){_0x5225fd[_0x1bb4('0x54')](_0x276183);});}}function onDisconnect(_0x6bc34d,_0x46361f){joinOrLeave(_0x6bc34d,_0x1bb4('0x48'),_0x46361f);}function onConnect(_0x3fccf0){joinOrLeave(_0x3fccf0,'join');}exports[_0x1bb4('0x55')]=function(_0x3c5ee6){_0x3c5ee6['on']('connection',function(_0x1ebd40){_0x1ebd40[_0x1bb4('0x56')](0x0);_0x1ebd40[_0x1bb4('0x57')]=_0x1ebd40[_0x1bb4('0x58')][_0x1bb4('0x59')][_0x1bb4('0x5a')]+':'+_0x1ebd40[_0x1bb4('0x58')][_0x1bb4('0x59')][_0x1bb4('0x5b')];_0x1ebd40[_0x1bb4('0x5c')]=new Date();_0x1ebd40[_0x1bb4('0x54')]=function(_0x543c24){console[_0x1bb4('0x54')](_0x1bb4('0x5d')+_0x1ebd40[_0x1bb4('0x5e')][_0x1bb4('0x5')]+'['+_0x1ebd40[_0x1bb4('0x57')]+']',_0x543c24);};_0x1ebd40['on']('disconnect',function(){onDisconnect(_0x1ebd40,_0x3c5ee6);_0x1ebd40['log'](_0x1bb4('0x5f'));});onConnect(_0x1ebd40);_0x1ebd40[_0x1bb4('0x54')](_0x1bb4('0x60'));});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index 3f945de..e46f8d5 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 _0x1cc1=['callback','toLowerCase','util','../../mysqldb','jayson/promise','../logger','triggers','client','ChatInteraction','afterCreate','newinteraction','Chat','closedinteraction','newmessage','Sms','SmsInteraction','afterUpdate','SmsMessage','Fax','FaxInteraction','FaxMessage','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','OpenchannelMessage','request','EventManager','then','info','error','code','Trigger,\x20%s','get','channel','event','direction','UserId','name','interface','SIP/%s','opened','changed','closed','User','format','default','length','hasOwnProperty','model','hook'];(function(_0x5a26db,_0x2c5ccd){var _0x4619dd=function(_0x21e28f){while(--_0x21e28f){_0x5a26db['push'](_0x5a26db['shift']());}};_0x4619dd(++_0x2c5ccd);}(_0x1cc1,0x106));var _0x11cc=function(_0x1d3fbf,_0x1572fc){_0x1d3fbf=_0x1d3fbf-0x0;var _0x238d4b=_0x1cc1[_0x1d3fbf];return _0x238d4b;};'use strict';var util=require(_0x11cc('0x0'));var db=require(_0x11cc('0x1'))['db'];var jayson=require(_0x11cc('0x2'));var logger=require(_0x11cc('0x3'))(_0x11cc('0x4'));var client=jayson[_0x11cc('0x5')]['http']({'port':0x232a});var triggers=[{'channel':'Chat','model':_0x11cc('0x6'),'event':_0x11cc('0x7'),'condition':_0x11cc('0x8'),'callback':afterCreate},{'channel':_0x11cc('0x9'),'model':_0x11cc('0x6'),'event':'afterUpdate','condition':_0x11cc('0xa'),'callback':afterUpdate},{'channel':_0x11cc('0x9'),'model':'ChatMessage','event':'afterCreate','condition':_0x11cc('0xb'),'callback':afterCreateMessage},{'channel':_0x11cc('0xc'),'model':_0x11cc('0xd'),'event':'afterCreate','condition':_0x11cc('0x8'),'callback':afterCreate},{'channel':_0x11cc('0xc'),'model':'SmsInteraction','event':_0x11cc('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Sms','model':_0x11cc('0xf'),'event':'afterCreate','condition':_0x11cc('0xb'),'callback':afterCreateMessage},{'channel':_0x11cc('0x10'),'model':'FaxInteraction','event':_0x11cc('0x7'),'condition':_0x11cc('0x8'),'callback':afterCreate},{'channel':'Fax','model':_0x11cc('0x11'),'event':_0x11cc('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':'Fax','model':_0x11cc('0x12'),'event':'afterCreate','condition':_0x11cc('0xb'),'callback':afterCreateMessage},{'channel':'Mail','model':'MailInteraction','event':'afterCreate','condition':_0x11cc('0x8'),'callback':afterCreate},{'channel':_0x11cc('0x13'),'model':_0x11cc('0x14'),'event':_0x11cc('0xe'),'condition':_0x11cc('0xa'),'callback':afterUpdate},{'channel':_0x11cc('0x13'),'model':_0x11cc('0x15'),'event':'afterCreate','condition':_0x11cc('0xb'),'callback':afterCreateMessage},{'channel':_0x11cc('0x16'),'model':_0x11cc('0x17'),'event':_0x11cc('0x7'),'condition':_0x11cc('0x8'),'callback':afterCreate},{'channel':_0x11cc('0x16'),'model':_0x11cc('0x17'),'event':_0x11cc('0xe'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0x11cc('0x16'),'model':_0x11cc('0x18'),'event':_0x11cc('0x7'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x4644c9){return client[_0x11cc('0x19')](_0x11cc('0x1a'),_0x4644c9)[_0x11cc('0x1b')](function(_0x1f9216){logger[_0x11cc('0x1c')]('Trigger,\x20%s',_0x11cc('0x1a'),_0x1f9216);if(_0x1f9216[_0x11cc('0x1d')]){if(_0x1f9216['error'][_0x11cc('0x1e')]===0x1f4){logger[_0x11cc('0x1d')]('Trigger,\x20%s',_0x11cc('0x1a'),_0x1f9216[_0x11cc('0x1d')]);}}})['catch'](function(_0x2fe77f){logger[_0x11cc('0x1d')](_0x11cc('0x1f'),_0x11cc('0x1a'),_0x2fe77f);});}function afterCreateMessage(_0x4c23e2,_0x4b4007){return function(_0x1e74ce,_0x61f169){_0x1e74ce=_0x1e74ce[_0x11cc('0x20')]({'plain':!![]});_0x1e74ce[_0x11cc('0x21')]=_0x4c23e2;_0x1e74ce[_0x11cc('0x22')]=_0x1e74ce[_0x11cc('0x23')];if(_0x1e74ce['UserId']){return db['User']['find']({'where':{'id':_0x1e74ce[_0x11cc('0x24')]},'attributes':['id',_0x11cc('0x25')],'raw':!![]})[_0x11cc('0x1b')](function(_0x4482e9){_0x1e74ce[_0x11cc('0x26')]=util['format'](_0x11cc('0x27'),_0x4482e9[_0x11cc('0x25')]);_0x1e74ce[_0x11cc('0x21')]=_0x4c23e2;return request({'event':'incomingmessage','message':_0x1e74ce});})['catch'](function(_0x29e11f){console['error'](_0x29e11f);});}else{return request({'event':'outgoingmessage','message':_0x1e74ce});}};}function afterCreate(_0x59af39,_0x3fe45d){return function(_0x47ce50,_0x3ade76){_0x47ce50=_0x47ce50[_0x11cc('0x20')]({'plain':!![]});_0x47ce50['channel']=_0x59af39;_0x47ce50[_0x11cc('0x22')]=_0x11cc('0x28');return request({'event':_0x3fe45d,'message':_0x47ce50});};}function afterUpdate(_0x5501c0,_0x331cd7){return function(_0x4027e3,_0xa59c7f){if(_0x4027e3[_0x11cc('0x29')](_0x11cc('0x2a'))&&_0x4027e3[_0x11cc('0x2a')]){_0x4027e3=_0x4027e3[_0x11cc('0x20')]({'plain':!![]});_0x4027e3[_0x11cc('0x21')]=_0x5501c0;_0x4027e3['event']='closed';if(_0x4027e3[_0x11cc('0x24')]){return db[_0x11cc('0x2b')]['find']({'where':{'id':_0x4027e3[_0x11cc('0x24')]},'attributes':['id',_0x11cc('0x25')],'raw':!![]})[_0x11cc('0x1b')](function(_0x46c270){_0x4027e3[_0x11cc('0x26')]=util[_0x11cc('0x2c')](_0x11cc('0x27'),_0x46c270[_0x11cc('0x25')]);return request({'event':_0x331cd7,'message':_0x4027e3});})['catch'](function(_0xc07305){console[_0x11cc('0x1d')](_0xc07305);});}else{return request({'event':_0x331cd7,'message':_0x4027e3});}}};}exports[_0x11cc('0x2d')]=function(){for(var _0x105b20=0x0;_0x105b20=_0x31bff6[_0x0e3b('0x15')]){throw Error('Maximum\x20login\x20has\x20been\x20reached');}_0x399406(_0x3dae70);})['catch'](function(_0x479ce7){_0x27dbcb(_0x479ce7);});});}; \ No newline at end of file +var _0x9b4e=['getChannels','isValidChannel','toLowerCase','includes','clearBlockUser','blockedAt','updateAttributes','getLicense','role','User','agent','then','agents','Maximum\x20login\x20has\x20been\x20reached','lodash','bluebird','../mysqldb','./license/util','voice','mail','chat','fax','sms','openchannel'];(function(_0x3421d2,_0x114ad8){var _0x13380f=function(_0x39bee4){while(--_0x39bee4){_0x3421d2['push'](_0x3421d2['shift']());}};_0x13380f(++_0x114ad8);}(_0x9b4e,0xfe));var _0xe9b4=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x9b4e[_0x501510];return _0x1e6ee5;};'use strict';var _=require(_0xe9b4('0x0'));var BPromise=require(_0xe9b4('0x1'));var db=require(_0xe9b4('0x2'))['db'];var util=require(_0xe9b4('0x3'));var channels=[_0xe9b4('0x4'),_0xe9b4('0x5'),_0xe9b4('0x6'),_0xe9b4('0x7'),_0xe9b4('0x8'),_0xe9b4('0x9')];exports[_0xe9b4('0xa')]=function(){return channels;};exports[_0xe9b4('0xb')]=function(_0x2d012d){_0x2d012d=_0x2d012d[_0xe9b4('0xc')]();return _[_0xe9b4('0xd')](channels,_0x2d012d);};exports[_0xe9b4('0xe')]=function(_0x5a55d6,_0x1efd67,_0x4e5bd9,_0x15edd3){var _0x51fa6c={'loginAttempts':_0x1efd67,'blocked':_0x4e5bd9};if(!_['isUndefined'](_0x15edd3)){_0x51fa6c[_0xe9b4('0xf')]=_0x15edd3;}return _0x5a55d6[_0xe9b4('0x10')](_0x51fa6c);};exports[_0xe9b4('0x11')]=function(_0x56fd4d){return new BPromise(function(_0x2568b7,_0x3601e0){var _0x22bca8=0x0;if(_0x56fd4d[_0xe9b4('0x12')]!=='agent'){_0x2568b7(_0x56fd4d);}db[_0xe9b4('0x13')]['count']({'where':{'role':_0xe9b4('0x14'),'online':!![],'id':{'$ne':_0x56fd4d['id']}}})[_0xe9b4('0x15')](function(_0x25c1cf){_0x22bca8=_0x25c1cf;return util[_0xe9b4('0x11')]();})[_0xe9b4('0x15')](function(_0x5d293f){if(_0x5d293f&&_0x5d293f['agents']&&_0x22bca8>=_0x5d293f[_0xe9b4('0x16')]){throw Error(_0xe9b4('0x17'));}_0x2568b7(_0x56fd4d);})['catch'](function(_0x17f9fc){_0x3601e0(_0x17f9fc);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index 280e3c7..0fbaa14 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2a14=['exports','404','status','render','json','send'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x2a14,0x180));var _0x42a1=function(_0x332513,_0x773959){_0x332513=_0x332513-0x0;var _0x48c3ef=_0x2a14[_0x332513];return _0x48c3ef;};'use strict';module[_0x42a1('0x0')][0x194]=function pageNotFound(_0x2bcee8,_0x56dd53){var _0x3af263=_0x42a1('0x1');var _0x1ef79a=0x194;var _0xd4108c={'status':_0x1ef79a};_0x56dd53[_0x42a1('0x2')](_0xd4108c[_0x42a1('0x2')]);_0x56dd53[_0x42a1('0x3')](_0x3af263,{},function(_0xafef22,_0x192c9b){if(_0xafef22){return _0x56dd53['status'](_0xd4108c[_0x42a1('0x2')])[_0x42a1('0x4')](_0xd4108c);}_0x56dd53[_0x42a1('0x5')](_0x192c9b);});}; \ No newline at end of file +var _0x5e06=['render','json','send','404','status'];(function(_0x5d0589,_0x114ce0){var _0x32f3fe=function(_0x394363){while(--_0x394363){_0x5d0589['push'](_0x5d0589['shift']());}};_0x32f3fe(++_0x114ce0);}(_0x5e06,0xb7));var _0x65e0=function(_0x291460,_0x1f7c93){_0x291460=_0x291460-0x0;var _0x449f0a=_0x5e06[_0x291460];return _0x449f0a;};'use strict';module['exports'][0x194]=function pageNotFound(_0x25aa68,_0x238b8f){var _0x52cf2b=_0x65e0('0x0');var _0x1b73e4=0x194;var _0x333dfe={'status':_0x1b73e4};_0x238b8f[_0x65e0('0x1')](_0x333dfe['status']);_0x238b8f[_0x65e0('0x2')](_0x52cf2b,{},function(_0x59bd1c,_0x394628){if(_0x59bd1c){return _0x238b8f[_0x65e0('0x1')](_0x333dfe[_0x65e0('0x1')])[_0x65e0('0x3')](_0x333dfe);}_0x238b8f[_0x65e0('0x4')](_0x394628);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 7a5d1d1..4eee12f 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x44bf=['../api/intVtigerField/intVtigerField.model','ServicenowAccount','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/integration/integration.model','Network','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReportDetail/squareReportDetail.model','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','ChatTransferReport','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','../api/userProfile/userProfile.model','UserProfileSection','UserProfileResource','../api/userProfileResource/userProfileResource.model','hasOne','cascade','UserId','User','hasMany','Recordings','VoiceQueuesRt','HopperHistory','ReportAgentPreview','OpenchannelInteraction','ChatInteraction','ChatInteractions','SmsInteractions','FaxInteractions','MailInteractions','UserProfile','userProfileId','chat_group_has_users','belongsToMany','Contacts','cm_user_has_contacts','Lists','Team','user_has_teams','user_has_mail_interactions','user_has_chat_interactions','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueues','FaxQueues','UserSmsQueue','OpenchannelQueues','user_has_voice_prefixes','ChatWebsites','FaxAccounts','user_has_fax_accounts','MailAccounts','SmsAccounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','ChanSpyId','Applications','Sounds','moh_has_sounds','Members','VoiceQueueId','HopperFinals','CmHopperBlack','HopperBlacks','JscriptySessionReport','JscriptySessions','Trunk','TrunkId','belongsTo','TrunkBackup','TrunkBackupId','Interval','IntervalId','mandatoryDispositionPause','CmList','voice_queues_has_cm_lists','Teams','team_has_voice_queues','BlackLists','Messages','mailboxuser','mailbox','VoiceQueueReport','uniqueid','AgentReports','Contact','ContactId','MailAccountId','Imap','Smtp','Dispositions','CannedAnswer','Answers','Interactions','List','Template','TemplateId','mandatoryDispositionPauseId','Agents','user_has_mail_accounts','MailQueue','team_has_mail_queues','MailInteractionId','Account','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachments','Interaction','restrict','TagId','ListId','FaxAccountId','FaxMessage','FaxInteractionId','Tags','fax_interaction_has_tags','user_has_fax_interactions','AttachmentId','UserFaxQueue','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','OpenchannelAccount','OpenchannelAccountId','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','ChatWebsiteId','ProactiveActions','ChatApplication','user_has_chat_websites','Agent','ChatQueueId','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','ChatGroupId','CompanyId','HopperHistories','CmCompany','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Automation','All','OneAll','OneAny','AutomationAnyId','Action','Actions','AutomationId','Intervals','Extensions','ChatApplications','FaxApplications','SmsApplications','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','Fields','DefaultReportId','Configurations','AccountId','SalesforceField','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Description','Field','SugarcrmConfiguration','SugarcrmField','Subject','DeskAccount','int_desk_configuration_has_tags','VariableId','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerConfiguration','ServicenowField','Dynamics365Configuration','ToId','JscriptyQuestionReport','SessionId','ProjectId','ChatQueues','team_has_fax_queues','team_has_sms_queues','SmsQueues','team_has_openchannel_queues','campaigns_has_cm_lists','campaigns_has_cm_blacklists','MailTransferReport','FromMailAccountId','FromAccount','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','FromChatWebsiteId','ToChatQueueId','ToChatWebsiteId','ToAccount','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','FromOpenchannelAccountId','ToOpenchannelQueueId','ToSmsQueueId','ToSmsAccountId','CustomFields','UserProfileSections','Resources','sectionId','path','jstz','determine','defaultsDeep','motion2','xcall','xC@LL1234','127.0.0.1','mysql','name','utf8_general_ci','sequelizeHistory','utf8','database','sequelize','password','options','username','import','../api/user/user.model','VoiceChanSpy','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','../api/memberReport/memberReport.model','../api/trunk/trunk.model','VoiceTransferReport','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','../api/userFaxQueue/userFaxQueue.model','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','DashboardItem','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxMessage/faxMessage.model','FaxQueue','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','../api/smsApplication/smsApplication.model','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','ChatQueue','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmContact','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/action/action.model','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','../api/interval/interval.model','Pause','../api/pause/pause.model','Cdr','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','../api/template/template.model','Trigger','Variable','../api/variable/variable.model','Integration','IntegrationReport','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','SalesforceAccount','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','../api/intDeskField/intDeskField.model','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField'];(function(_0x1fc2d3,_0x4c9a72){var _0x30c771=function(_0x23f74b){while(--_0x23f74b){_0x1fc2d3['push'](_0x1fc2d3['shift']());}};_0x30c771(++_0x4c9a72);}(_0x44bf,0x117));var _0xf44b=function(_0x3cb4d1,_0x48c016){_0x3cb4d1=_0x3cb4d1-0x0;var _0x27c668=_0x44bf[_0x3cb4d1];return _0x27c668;};'use strict';var path=require(_0xf44b('0x0'));var config=require('../config/environment');var Sequelize=require('sequelize');var _=require('lodash');var jstz=require(_0xf44b('0x1'));var timezone=jstz[_0xf44b('0x2')]();config['sequelize']=_[_0xf44b('0x3')](config['sequelize'],{'database':_0xf44b('0x4'),'username':_0xf44b('0x5'),'password':_0xf44b('0x6'),'options':{'host':_0xf44b('0x7'),'port':0xcea,'dialect':_0xf44b('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf44b('0x9')](),'define':{'charset':'utf8','collate':_0xf44b('0xa')}}});config[_0xf44b('0xb')]=_[_0xf44b('0x3')](config['sequelizeHistory'],{'database':_0xf44b('0x4'),'username':_0xf44b('0x5'),'password':_0xf44b('0x6'),'options':{'host':_0xf44b('0x7'),'port':0xcea,'dialect':_0xf44b('0x8'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0xf44b('0x9')](),'define':{'charset':_0xf44b('0xc'),'collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0xf44b('0xd')],config[_0xf44b('0xe')]['username'],config[_0xf44b('0xe')][_0xf44b('0xf')],config[_0xf44b('0xe')][_0xf44b('0x10')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xf44b('0xb')][_0xf44b('0xd')],config[_0xf44b('0xb')][_0xf44b('0x11')],config['sequelizeHistory'][_0xf44b('0xf')],config[_0xf44b('0xb')][_0xf44b('0x10')])};db['User']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x13'));db[_0xf44b('0x14')]=db['sequelize'][_0xf44b('0x12')]('../api/voiceChanSpy/voiceChanSpy.model');db[_0xf44b('0x15')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x16'));db[_0xf44b('0x17')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x18'));db[_0xf44b('0x19')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x1a'));db[_0xf44b('0x1b')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x1c'));db[_0xf44b('0x1d')]=db['sequelize']['import'](_0xf44b('0x1e'));db[_0xf44b('0x1f')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x20'));db[_0xf44b('0x21')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/voiceMail/voiceMail.model');db[_0xf44b('0x22')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x23'));db[_0xf44b('0x24')]=db[_0xf44b('0xe')]['import']('../api/voiceCallReport/voiceCallReport.model');db['VoiceDialReport']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x25'));db[_0xf44b('0x26')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x27'));db['VoiceQueueReport']=db[_0xf44b('0xe')]['import'](_0xf44b('0x28'));db[_0xf44b('0x29')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x2a'));db['Trunk']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x2b'));db[_0xf44b('0x2c')]=db[_0xf44b('0xe')]['import']('../api/voiceTransferReport/voiceTransferReport.model');db[_0xf44b('0x2d')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x2e'));db[_0xf44b('0x2f')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x30'));db[_0xf44b('0x31')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x32'));db[_0xf44b('0x33')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x34'));db['UserFaxQueue']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x35'));db['UserSmsQueue']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x36'));db[_0xf44b('0x37')]=db['sequelize'][_0xf44b('0x12')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0xf44b('0x38')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x39'));db[_0xf44b('0x3a')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x3b'));db[_0xf44b('0x3c')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x3d'));db['MailQueue']=db[_0xf44b('0xe')]['import']('../api/mailQueue/mailQueue.model');db[_0xf44b('0x3e')]=db['sequelize']['import'](_0xf44b('0x3f'));db[_0xf44b('0x40')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x41'));db[_0xf44b('0x42')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x43'));db[_0xf44b('0x44')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x45'));db[_0xf44b('0x46')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/mailQueueReport/mailQueueReport.model');db[_0xf44b('0x47')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x48'));db[_0xf44b('0x49')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x4a'));db[_0xf44b('0x4b')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x4c'));db[_0xf44b('0x4d')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x4e'));db[_0xf44b('0x4f')]=db['sequelize']['import']('../api/faxInteraction/faxInteraction.model');db['FaxMessage']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x50'));db[_0xf44b('0x51')]=db['sequelize']['import'](_0xf44b('0x52'));db[_0xf44b('0x53')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x54'));db[_0xf44b('0x55')]=db['sequelize'][_0xf44b('0x12')]('../api/smsAccount/smsAccount.model');db[_0xf44b('0x56')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x57'));db[_0xf44b('0x58')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x59'));db[_0xf44b('0x5a')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x5b'));db[_0xf44b('0x5c')]=db['sequelize'][_0xf44b('0x12')]('../api/smsQueue/smsQueue.model');db['OpenchannelAccount']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x5d'));db['OpenchannelApplication']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x5e'));db['OpenchannelInteraction']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x5f'));db[_0xf44b('0x60')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x61'));db[_0xf44b('0x62')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x63'));db[_0xf44b('0x64')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x65'));db[_0xf44b('0x66')]=db[_0xf44b('0xe')]['import']('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db['sequelize'][_0xf44b('0x12')]('../api/chatApplication/chatApplication.model');db['ChatInteraction']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x67'));db[_0xf44b('0x68')]=db[_0xf44b('0xe')]['import']('../api/chatMessage/chatMessage.model');db[_0xf44b('0x69')]=db['sequelize'][_0xf44b('0x12')]('../api/chatOfflineMessage/chatOfflineMessage.model');db[_0xf44b('0x6a')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x6b'));db[_0xf44b('0x6c')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x6d'));db[_0xf44b('0x6e')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x6f'));db['CmCompany']=db['sequelize']['import']('../api/cmCompany/cmCompany.model');db[_0xf44b('0x70')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x71'));db[_0xf44b('0x72')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x73'));db['CmHopperBlack']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x74'));db[_0xf44b('0x75')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x76'));db[_0xf44b('0x77')]=db['sequelize'][_0xf44b('0x12')]('../api/cmHopperHistory/cmHopperHistory.model');db['ReportAgentPreview']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x78'));db[_0xf44b('0x79')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/cmCustomField/cmCustomField.model');db['Action']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x7a'));db['Automation']=db['sequelize']['import'](_0xf44b('0x7b'));db['CannedAnswer']=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/cannedAnswer/cannedAnswer.model');db[_0xf44b('0x7c')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x7d'));db[_0xf44b('0x7e')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x7f'));db['Interval']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x80'));db[_0xf44b('0x81')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x82'));db[_0xf44b('0x83')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/cdr/cdr.model');db[_0xf44b('0x84')]=db[_0xf44b('0xe')]['import']('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0xf44b('0x85')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x86'));db[_0xf44b('0x87')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x88'));db[_0xf44b('0x89')]=db[_0xf44b('0xe')]['import'](_0xf44b('0x8a'));db['Template']=db[_0xf44b('0xe')]['import'](_0xf44b('0x8b'));db[_0xf44b('0x8c')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/trigger/trigger.model');db[_0xf44b('0x8d')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x8e'));db[_0xf44b('0x8f')]=db['sequelize']['import']('../api/integration/integration.model');db[_0xf44b('0x90')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x91'));db[_0xf44b('0x92')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x93'));db[_0xf44b('0x94')]=db['sequelize'][_0xf44b('0x12')]('../api/analyticDefaultReport/analyticDefaultReport.model');db['AnalyticExtractedReport']=db[_0xf44b('0xe')]['import'](_0xf44b('0x95'));db[_0xf44b('0x96')]=db[_0xf44b('0xe')]['import']('../api/analyticMetric/analyticMetric.model');db[_0xf44b('0x97')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x98'));db[_0xf44b('0x99')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/analyticTreeReport/analyticTreeReport.model');db[_0xf44b('0x9a')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/intSalesforceAccount/intSalesforceAccount.model');db[_0xf44b('0x9b')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0x9c'));db['SalesforceField']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x9d'));db[_0xf44b('0x9e')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0x9f'));db['SugarcrmConfiguration']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xa0'));db['SugarcrmField']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xa1'));db['DeskAccount']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xa2'));db[_0xf44b('0xa3')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xa4'));db[_0xf44b('0xa5')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xa6'));db[_0xf44b('0xa7')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xa8'));db[_0xf44b('0xa9')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xaa'));db[_0xf44b('0xab')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xac'));db[_0xf44b('0xad')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xae'));db[_0xf44b('0xaf')]=db['sequelize'][_0xf44b('0x12')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0xf44b('0xb0')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xb1'));db[_0xf44b('0xb2')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xb3'));db['FreshdeskConfiguration']=db[_0xf44b('0xe')]['import'](_0xf44b('0xb4'));db[_0xf44b('0xb5')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xb6'));db[_0xf44b('0xb7')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xb8'));db['VtigerConfiguration']=db['sequelize']['import'](_0xf44b('0xb9'));db[_0xf44b('0xba')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xbb'));db[_0xf44b('0xbc')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/intServicenowAccount/intServicenowAccount.model');db[_0xf44b('0xbd')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xbe'));db['ServicenowField']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xbf'));db[_0xf44b('0xc0')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xc1'));db['Dynamics365Configuration']=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0xf44b('0xc2')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xc3'));db[_0xf44b('0xc4')]=db['sequelize'][_0xf44b('0x12')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db[_0xf44b('0xc5')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xc6'));db[_0xf44b('0xc7')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xc8'));db['Integration']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xc9'));db[_0xf44b('0xca')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xcb'));db[_0xf44b('0xcc')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xcd'));db[_0xf44b('0xce')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xcf'));db[_0xf44b('0xd0')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xd1'));db['JscriptyQuestionReport']=db[_0xf44b('0xe')]['import'](_0xf44b('0xd2'));db['JscriptySessionReport']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xd3'));db[_0xf44b('0xd4')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xd5'));db[_0xf44b('0xd6')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db['sequelize']['import'](_0xf44b('0xd7'));db[_0xf44b('0xd8')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xd9'));db[_0xf44b('0xda')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xdb'));db['SquareOdbc']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xdc'));db[_0xf44b('0xdd')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xde'));db[_0xf44b('0xdf')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xe0'));db[_0xf44b('0xe1')]=db['sequelize'][_0xf44b('0x12')]('../api/squareMessage/squareMessage.model');db['Team']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xe2'));db[_0xf44b('0xe3')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xe4'));db['Campaign']=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xe5'));db[_0xf44b('0xe6')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xe7'));db[_0xf44b('0xe8')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xe9'));db[_0xf44b('0xea')]=db['sequelize'][_0xf44b('0x12')](_0xf44b('0xeb'));db['MailTransferReport']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xec'));db[_0xf44b('0xed')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/chatTransferReport/chatTransferReport.model');db[_0xf44b('0xee')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xef'));db[_0xf44b('0xf0')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xf1'));db[_0xf44b('0xf2')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xf3'));db['CmList']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xf4'));db[_0xf44b('0xf5')]=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xf6'));db['UserProfile']=db[_0xf44b('0xe')][_0xf44b('0x12')](_0xf44b('0xf7'));db[_0xf44b('0xf8')]=db[_0xf44b('0xe')][_0xf44b('0x12')]('../api/userProfileSection/userProfileSection.model');db[_0xf44b('0xf9')]=db[_0xf44b('0xe')]['import'](_0xf44b('0xfa'));db['User'][_0xf44b('0xfb')](db[_0xf44b('0x21')],{'as':_0xf44b('0x21'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x1d')],{'as':_0xf44b('0x100'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')]['hasMany'](db[_0xf44b('0x2d')],{'as':_0xf44b('0x101'),'foreignKey':'UserId'});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'as':'Extensions','onDelete':'cascade','hooks':!![]});db['User'][_0xf44b('0xff')](db[_0xf44b('0x75')],{'as':'HopperFinals','foreignKey':'UserId'});db['User'][_0xf44b('0xff')](db[_0xf44b('0x77')],{'as':_0xf44b('0x102'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x103')],{'as':'ReportAgentPreview','foreignKey':'UserId'});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x104')],{'as':'OpenchannelInteractions','foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')]['hasMany'](db[_0xf44b('0x105')],{'as':_0xf44b('0x106'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')]['hasMany'](db[_0xf44b('0x58')],{'as':_0xf44b('0x107'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x4f')],{'as':_0xf44b('0x108'),'foreignKey':'UserId'});db[_0xf44b('0xfe')][_0xf44b('0xff')](db[_0xf44b('0x40')],{'as':_0xf44b('0x109'),'foreignKey':_0xf44b('0xfd')});db['User']['belongsTo'](db[_0xf44b('0x10a')],{'as':'UserProfile','foreignKey':_0xf44b('0x10b')});db[_0xf44b('0xfe')]['belongsToMany'](db[_0xf44b('0x6c')],{'as':'Groups','through':_0xf44b('0x10c')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x70')],{'as':_0xf44b('0x10e'),'through':_0xf44b('0x10f')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['CmList'],{'as':_0xf44b('0x110'),'through':'cm_user_has_lists'});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x111')],{'through':_0xf44b('0x112')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['MailInteraction'],{'as':_0xf44b('0x109'),'through':_0xf44b('0x113')});db['User'][_0xf44b('0x10d')](db[_0xf44b('0x105')],{'as':'ChatInteractions','through':_0xf44b('0x114')});db['User'][_0xf44b('0x10d')](db[_0xf44b('0x4f')],{'as':_0xf44b('0x108'),'through':'user_has_fax_interactions'});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['SmsInteraction'],{'as':'SmsInteractions','through':_0xf44b('0x115')});db['User']['belongsToMany'](db[_0xf44b('0x104')],{'as':'OpenchannelInteractions','through':_0xf44b('0x116')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x1b')],{'as':_0xf44b('0x117'),'through':_0xf44b('0x2f'),'required':![]});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['MailQueue'],{'as':_0xf44b('0x118'),'through':_0xf44b('0x33'),'required':![]});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x6a')],{'as':'ChatQueues','through':_0xf44b('0x31'),'required':![],'hooks':!![]});db[_0xf44b('0xfe')]['belongsToMany'](db[_0xf44b('0x51')],{'as':_0xf44b('0x119'),'through':'UserFaxQueue','required':![]});db[_0xf44b('0xfe')]['belongsToMany'](db[_0xf44b('0x5c')],{'as':'SmsQueues','through':_0xf44b('0x11a'),'required':![]});db['User'][_0xf44b('0x10d')](db['OpenchannelQueue'],{'as':_0xf44b('0x11b'),'through':_0xf44b('0x37'),'required':![]});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['CmList'],{'through':'cm_user_has_lists'});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['VoicePrefix'],{'as':'VoicePrefixes','through':_0xf44b('0x11c'),'required':![]});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x64')],{'as':_0xf44b('0x11d'),'through':'user_has_chat_websites'});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db['FaxAccount'],{'as':_0xf44b('0x11e'),'through':_0xf44b('0x11f')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0x3c')],{'as':_0xf44b('0x120'),'through':'user_has_mail_accounts'});db['User'][_0xf44b('0x10d')](db['OpenchannelAccount'],{'as':'OpenchannelAccounts','through':'user_has_openchannel_accounts'});db['User'][_0xf44b('0x10d')](db[_0xf44b('0x55')],{'as':_0xf44b('0x121'),'through':_0xf44b('0x122')});db[_0xf44b('0xfe')][_0xf44b('0x10d')](db[_0xf44b('0xdd')],{'as':_0xf44b('0x123'),'through':_0xf44b('0x124')});db[_0xf44b('0x14')]['hasMany'](db[_0xf44b('0x17')],{'as':'SpiedAgents','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x125')});db[_0xf44b('0x15')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x17')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'as':_0xf44b('0x126'),'onDelete':_0xf44b('0xfc')});db['VoiceMusicOnHold']['belongsToMany'](db[_0xf44b('0x87')],{'as':_0xf44b('0x127'),'through':_0xf44b('0x128')});db[_0xf44b('0x1b')]['hasMany'](db[_0xf44b('0x2d')],{'as':_0xf44b('0x129'),'foreignKey':_0xf44b('0x12a')});db[_0xf44b('0x1b')][_0xf44b('0xff')](db[_0xf44b('0x72')],{'as':'Hoppers','foreignKey':_0xf44b('0x12a')});db[_0xf44b('0x1b')][_0xf44b('0xff')](db['CmHopperFinal'],{'as':_0xf44b('0x12b'),'foreignKey':_0xf44b('0x12a')});db[_0xf44b('0x1b')][_0xf44b('0xff')](db[_0xf44b('0x77')],{'as':'HopperHistories','foreignKey':_0xf44b('0x12a')});db['VoiceQueue'][_0xf44b('0xff')](db['ReportAgentPreview'],{'as':'ReportAgentPreview','foreignKey':_0xf44b('0x12a')});db[_0xf44b('0x1b')][_0xf44b('0xff')](db[_0xf44b('0x12c')],{'as':_0xf44b('0x12d'),'foreignKey':'VoiceQueueId'});db[_0xf44b('0x1b')]['hasMany'](db[_0xf44b('0x12e')],{'as':_0xf44b('0x12f'),'foreignKey':_0xf44b('0x12a')});db[_0xf44b('0x1b')]['belongsTo'](db['Trunk'],{'as':_0xf44b('0x130'),'foreignKey':_0xf44b('0x131')});db[_0xf44b('0x1b')][_0xf44b('0x132')](db[_0xf44b('0x130')],{'as':_0xf44b('0x133'),'foreignKey':_0xf44b('0x134')});db[_0xf44b('0x1b')][_0xf44b('0x132')](db[_0xf44b('0x135')],{'as':_0xf44b('0x135'),'foreignKey':_0xf44b('0x136')});db['VoiceQueue'][_0xf44b('0x132')](db['Pause'],{'as':_0xf44b('0x137'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xf44b('0x1b')]['belongsToMany'](db[_0xf44b('0x138')],{'as':_0xf44b('0x110'),'through':_0xf44b('0x139')});db[_0xf44b('0x1b')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':'Agents','through':_0xf44b('0x2f')});db[_0xf44b('0x1b')][_0xf44b('0x10d')](db[_0xf44b('0x111')],{'as':_0xf44b('0x13a'),'through':_0xf44b('0x13b')});db[_0xf44b('0x1b')]['belongsToMany'](db[_0xf44b('0x138')],{'as':_0xf44b('0x13c'),'through':'voice_queues_has_cm_blacklists'});db['VoiceRecording'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':_0xf44b('0xfe'),'foreignKey':'UserId'});db[_0xf44b('0x1f')][_0xf44b('0x132')](db['User'],{'as':_0xf44b('0xfe'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0x21')][_0xf44b('0xff')](db['VoiceMailMessage'],{'as':_0xf44b('0x13d'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x13e'),'sourceKey':'mailbox'});db['VoiceMailMessage'][_0xf44b('0x132')](db[_0xf44b('0x21')],{'foreignKey':_0xf44b('0x13e'),'targetKey':_0xf44b('0x13f')});db[_0xf44b('0x24')]['hasMany'](db[_0xf44b('0x140')],{'as':'QueueCalls','foreignKey':_0xf44b('0x141'),'constraints':![]});db['VoiceCallReport'][_0xf44b('0xff')](db[_0xf44b('0x26')],{'as':_0xf44b('0x142'),'foreignKey':_0xf44b('0x141'),'constraints':![]});db[_0xf44b('0x24')]['belongsTo'](db[_0xf44b('0xfe')],{'as':_0xf44b('0xfe'),'foreignKey':_0xf44b('0xfd')});db['VoiceCallReport'][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db['MailServerIn']['belongsTo'](db[_0xf44b('0x3c')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0xf44b('0x3a')][_0xf44b('0x132')](db['MailAccount'],{'as':'MailAccount','foreignKey':_0xf44b('0x145')});db['MailAccount'][_0xf44b('0xfb')](db[_0xf44b('0x38')],{'as':_0xf44b('0x146'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x3c')]['hasOne'](db[_0xf44b('0x3a')],{'as':_0xf44b('0x147'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x3c')][_0xf44b('0xff')](db[_0xf44b('0x7c')],{'as':_0xf44b('0x148'),'foreignKey':'MailAccountId'});db[_0xf44b('0x3c')][_0xf44b('0xff')](db[_0xf44b('0x149')],{'as':_0xf44b('0x14a'),'foreignKey':_0xf44b('0x145')});db['MailAccount'][_0xf44b('0xff')](db[_0xf44b('0x42')],{'as':_0xf44b('0x13d'),'foreignKey':_0xf44b('0x145')});db[_0xf44b('0x3c')][_0xf44b('0xff')](db[_0xf44b('0x40')],{'as':_0xf44b('0x14b')});db[_0xf44b('0x3c')][_0xf44b('0xff')](db[_0xf44b('0x44')],{'as':_0xf44b('0x126')});db[_0xf44b('0x3c')][_0xf44b('0x132')](db['CmList'],{'as':_0xf44b('0x14c'),'foreignKey':'ListId'});db[_0xf44b('0x3c')][_0xf44b('0x132')](db[_0xf44b('0x14d')],{'as':_0xf44b('0x14d'),'foreignKey':_0xf44b('0x14e')});db[_0xf44b('0x3c')][_0xf44b('0x132')](db['Pause'],{'as':_0xf44b('0x137'),'foreignKey':_0xf44b('0x14f')});db['MailAccount'][_0xf44b('0x10d')](db['User'],{'as':_0xf44b('0x150'),'through':_0xf44b('0x151')});db[_0xf44b('0x152')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x33')});db[_0xf44b('0x152')][_0xf44b('0x10d')](db['Team'],{'through':_0xf44b('0x153'),'as':_0xf44b('0x13a')});db['MailInteraction'][_0xf44b('0xff')](db['MailMessage'],{'as':_0xf44b('0x13d'),'onDelete':'cascade','foreignKey':_0xf44b('0x154')});db[_0xf44b('0x40')][_0xf44b('0x132')](db[_0xf44b('0x3c')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x145')});db[_0xf44b('0x40')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x40')]['belongsTo'](db['User'],{'as':_0xf44b('0x156'),'foreignKey':'UserId'});db[_0xf44b('0x40')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x157'),'as':'Tags'});db['MailInteraction'][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x157'),'as':_0xf44b('0x158')});db[_0xf44b('0x40')]['belongsToMany'](db[_0xf44b('0xfe')],{'as':_0xf44b('0x159'),'through':_0xf44b('0x113'),'foreignKey':_0xf44b('0x154')});db['MailMessage']['hasMany'](db[_0xf44b('0xe8')],{'as':_0xf44b('0x15a'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x42')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':'User'});db[_0xf44b('0x42')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'onDelete':'cascade','as':_0xf44b('0x143')});db[_0xf44b('0x42')][_0xf44b('0x132')](db['MailInteraction'],{'as':_0xf44b('0x15b'),'foreignKey':'MailInteractionId'});db['MailMessage'][_0xf44b('0x132')](db[_0xf44b('0x3c')],{'as':'Account','foreignKey':_0xf44b('0x145')});db['MailApplication']['belongsTo'](db[_0xf44b('0xfe')],{'onDelete':_0xf44b('0x15c')});db['MailApplication'][_0xf44b('0x132')](db[_0xf44b('0x152')],{'onDelete':'restrict'});db[_0xf44b('0x44')][_0xf44b('0x132')](db[_0xf44b('0x3c')],{'onDelete':'restrict'});db['MailApplication'][_0xf44b('0x132')](db['Interval'],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x136')});db[_0xf44b('0x44')][_0xf44b('0x132')](db[_0xf44b('0x89')],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x15d')});db[_0xf44b('0x46')]['belongsTo'](db['MailAccount'],{});db[_0xf44b('0x46')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x46')]['belongsTo'](db[_0xf44b('0x70')],{'as':'Contact','foreignKey':_0xf44b('0x144')});db[_0xf44b('0x46')]['belongsTo'](db[_0xf44b('0x40')],{});db[_0xf44b('0x46')][_0xf44b('0x132')](db['MailMessage'],{});db['MailQueueReport'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{});db[_0xf44b('0x46')][_0xf44b('0x132')](db['MailQueue'],{});db[_0xf44b('0x47')][_0xf44b('0xff')](db[_0xf44b('0x49')],{'as':'Items','onDelete':_0xf44b('0xfc')});db['FaxAccount'][_0xf44b('0xff')](db[_0xf44b('0x7c')],{'as':'Dispositions','foreignKey':'FaxAccountId'});db[_0xf44b('0x4b')][_0xf44b('0xff')](db[_0xf44b('0x149')],{'as':'Answers','foreignKey':_0xf44b('0x15f')});db[_0xf44b('0x4b')][_0xf44b('0xff')](db[_0xf44b('0x4f')],{'as':_0xf44b('0x14b')});db[_0xf44b('0x4b')][_0xf44b('0xff')](db[_0xf44b('0x4d')],{'as':'Applications'});db[_0xf44b('0x4b')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'as':'Exntensions','onDelete':_0xf44b('0xfc')});db[_0xf44b('0x4b')]['hasMany'](db[_0xf44b('0x160')],{'as':'Messages'});db[_0xf44b('0x4b')][_0xf44b('0x132')](db[_0xf44b('0x130')],{'as':'Trunk'});db[_0xf44b('0x4b')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x4b')][_0xf44b('0x132')](db[_0xf44b('0x81')],{'as':_0xf44b('0x137'),'foreignKey':_0xf44b('0x14f')});db[_0xf44b('0x4b')]['belongsToMany'](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x11f')});db[_0xf44b('0x4d')]['belongsTo'](db['User'],{'onDelete':_0xf44b('0x15c')});db['FaxApplication'][_0xf44b('0x132')](db[_0xf44b('0x51')],{'onDelete':'restrict'});db['FaxApplication']['belongsTo'](db[_0xf44b('0x4b')],{'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x4d')][_0xf44b('0x132')](db['Tag'],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x15d')});db['FaxInteraction']['hasMany'](db[_0xf44b('0x160')],{'as':'Messages','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x161')});db[_0xf44b('0x4f')][_0xf44b('0x132')](db['FaxAccount'],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x15f')});db[_0xf44b('0x4f')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':'Contact','foreignKey':_0xf44b('0x144')});db[_0xf44b('0x4f')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x156'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0x4f')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':'fax_interaction_has_tags','as':_0xf44b('0x162')});db['FaxInteraction'][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x163'),'as':_0xf44b('0x158')});db[_0xf44b('0x4f')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x159'),'through':_0xf44b('0x164'),'foreignKey':_0xf44b('0x161')});db[_0xf44b('0x160')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':_0xf44b('0xfc'),'as':'User'});db[_0xf44b('0x160')][_0xf44b('0x132')](db[_0xf44b('0x4f')],{'as':_0xf44b('0x15b'),'foreignKey':_0xf44b('0x161')});db[_0xf44b('0x160')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'onDelete':'cascade','as':'Contact'});db['FaxMessage']['belongsTo'](db[_0xf44b('0xe8')],{'as':_0xf44b('0xe8'),'foreignKey':_0xf44b('0x165')});db[_0xf44b('0x160')][_0xf44b('0x132')](db['FaxAccount'],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x15f')});db[_0xf44b('0x51')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x166')});db[_0xf44b('0x51')][_0xf44b('0x10d')](db[_0xf44b('0x111')],{'through':'team_has_fax_queues','as':_0xf44b('0x13a')});db[_0xf44b('0x53')]['belongsTo'](db[_0xf44b('0x4b')],{});db[_0xf44b('0x53')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':'List','foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x53')]['belongsTo'](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x53')][_0xf44b('0x132')](db[_0xf44b('0x4f')],{});db[_0xf44b('0x53')][_0xf44b('0x132')](db[_0xf44b('0x160')],{});db[_0xf44b('0x53')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{});db[_0xf44b('0x53')][_0xf44b('0x132')](db['FaxQueue'],{});db[_0xf44b('0x55')][_0xf44b('0xff')](db[_0xf44b('0x7c')],{'as':_0xf44b('0x148'),'foreignKey':_0xf44b('0x167')});db[_0xf44b('0x55')][_0xf44b('0xff')](db[_0xf44b('0x149')],{'as':_0xf44b('0x14a'),'foreignKey':_0xf44b('0x167')});db[_0xf44b('0x55')][_0xf44b('0xff')](db[_0xf44b('0x5a')],{'as':'Messages','foreignKey':_0xf44b('0x167')});db['SmsAccount'][_0xf44b('0xff')](db[_0xf44b('0x58')],{'as':_0xf44b('0x14b')});db[_0xf44b('0x55')]['hasMany'](db['SmsApplication'],{'as':_0xf44b('0x126')});db[_0xf44b('0x55')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x55')]['belongsTo'](db[_0xf44b('0x81')],{'as':_0xf44b('0x137'),'foreignKey':_0xf44b('0x14f')});db['SmsAccount'][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x122')});db[_0xf44b('0x56')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':'restrict'});db[_0xf44b('0x56')]['belongsTo'](db[_0xf44b('0x5c')],{'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x56')][_0xf44b('0x132')](db[_0xf44b('0x55')],{'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x56')]['belongsTo'](db[_0xf44b('0x135')],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x136')});db['SmsApplication'][_0xf44b('0x132')](db[_0xf44b('0x89')],{'onDelete':_0xf44b('0x15c'),'foreignKey':'TagId'});db[_0xf44b('0x58')][_0xf44b('0xff')](db[_0xf44b('0x5a')],{'as':_0xf44b('0x13d'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x168')});db[_0xf44b('0x58')]['belongsTo'](db[_0xf44b('0x55')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x167')});db[_0xf44b('0x58')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x58')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':'Owner','foreignKey':'UserId'});db[_0xf44b('0x58')]['belongsToMany'](db[_0xf44b('0x89')],{'through':_0xf44b('0x169'),'as':'Tags'});db[_0xf44b('0x58')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x169'),'as':'ThroughTags'});db[_0xf44b('0x58')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':'Users','through':_0xf44b('0x115'),'foreignKey':'SmsInteractionId'});db['SmsMessage'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':_0xf44b('0xfe')});db[_0xf44b('0x5a')][_0xf44b('0x132')](db['CmContact'],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x143')});db[_0xf44b('0x5a')][_0xf44b('0x132')](db[_0xf44b('0x58')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x15b'),'foreignKey':_0xf44b('0x168')});db[_0xf44b('0x5a')]['belongsTo'](db[_0xf44b('0x55')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x167')});db[_0xf44b('0x5c')]['belongsToMany'](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':'UserSmsQueue','foreignKey':'SmsQueueId'});db[_0xf44b('0x5c')]['belongsToMany'](db[_0xf44b('0x111')],{'through':'team_has_sms_queues','as':_0xf44b('0x13a')});db[_0xf44b('0x16a')]['hasMany'](db[_0xf44b('0x7c')],{'as':'Dispositions','foreignKey':_0xf44b('0x16b')});db[_0xf44b('0x16a')]['hasMany'](db['CannedAnswer'],{'as':_0xf44b('0x14a'),'foreignKey':_0xf44b('0x16b')});db[_0xf44b('0x16a')]['hasMany'](db['OpenchannelInteraction'],{'as':_0xf44b('0x14b'),'foreignKey':'OpenchannelAccountId'});db[_0xf44b('0x16a')][_0xf44b('0xff')](db[_0xf44b('0x60')],{'as':'Messages','foreignKey':_0xf44b('0x16b')});db[_0xf44b('0x16a')]['hasMany'](db[_0xf44b('0x16c')],{'as':_0xf44b('0x126'),'foreignKey':_0xf44b('0x16b')});db[_0xf44b('0x16a')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':'ListId'});db[_0xf44b('0x16a')][_0xf44b('0x132')](db[_0xf44b('0x81')],{'as':'mandatoryDispositionPause','foreignKey':_0xf44b('0x14f')});db[_0xf44b('0x16a')]['belongsToMany'](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':'user_has_openchannel_accounts'});db['OpenchannelApplication'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x16c')]['belongsTo'](db[_0xf44b('0x62')],{'onDelete':'restrict','foreignKey':'OpenchannelQueueId'});db[_0xf44b('0x16c')]['belongsTo'](db[_0xf44b('0x16a')],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x16b')});db['OpenchannelApplication'][_0xf44b('0x132')](db[_0xf44b('0x135')],{'onDelete':_0xf44b('0x15c'),'foreignKey':'IntervalId'});db[_0xf44b('0x16c')][_0xf44b('0x132')](db[_0xf44b('0x89')],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x15d')});db['OpenchannelInteraction'][_0xf44b('0xff')](db[_0xf44b('0x60')],{'as':_0xf44b('0x13d'),'onDelete':'cascade','foreignKey':_0xf44b('0x16d')});db[_0xf44b('0x104')][_0xf44b('0x132')](db[_0xf44b('0x16a')],{'as':'Account','foreignKey':_0xf44b('0x16b')});db[_0xf44b('0x104')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db['OpenchannelInteraction'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x156'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0x104')][_0xf44b('0x10d')](db['Tag'],{'through':_0xf44b('0x16e'),'as':_0xf44b('0x162')});db[_0xf44b('0x104')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x16e'),'as':_0xf44b('0x158')});db[_0xf44b('0x104')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x159'),'through':_0xf44b('0x116'),'foreignKey':_0xf44b('0x16d')});db['OpenchannelMessage'][_0xf44b('0x132')](db['User'],{'onDelete':_0xf44b('0xfc'),'as':'User'});db[_0xf44b('0x60')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x143')});db['OpenchannelMessage'][_0xf44b('0x132')](db[_0xf44b('0x104')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x15b'),'foreignKey':_0xf44b('0x16d')});db[_0xf44b('0x60')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0xf44b('0x165')});db[_0xf44b('0x60')]['belongsTo'](db[_0xf44b('0x16a')],{'as':'Account','foreignKey':'OpenchannelAccountId'});db[_0xf44b('0x62')][_0xf44b('0x10d')](db['User'],{'as':'Agents','through':_0xf44b('0x37'),'foreignKey':'OpenchannelQueueId'});db[_0xf44b('0x62')]['belongsToMany'](db[_0xf44b('0x111')],{'through':'team_has_openchannel_queues','as':'Teams'});db[_0xf44b('0x64')][_0xf44b('0xff')](db[_0xf44b('0x7c')],{'as':_0xf44b('0x148'),'foreignKey':_0xf44b('0x16f')});db[_0xf44b('0x64')][_0xf44b('0xff')](db[_0xf44b('0x149')],{'as':_0xf44b('0x14a'),'foreignKey':_0xf44b('0x16f')});db[_0xf44b('0x64')][_0xf44b('0xff')](db['ChatProactiveAction'],{'as':_0xf44b('0x170')});db[_0xf44b('0x64')][_0xf44b('0xff')](db['ChatInteraction'],{'as':_0xf44b('0x14b')});db[_0xf44b('0x64')][_0xf44b('0xff')](db[_0xf44b('0x171')],{'as':_0xf44b('0x126')});db[_0xf44b('0x64')]['hasMany'](db['ChatMessage'],{'as':_0xf44b('0x13d')});db[_0xf44b('0x64')][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db['ChatWebsite'][_0xf44b('0x132')](db[_0xf44b('0x135')],{'as':_0xf44b('0x135'),'foreignKey':_0xf44b('0x136')});db[_0xf44b('0x64')][_0xf44b('0x132')](db[_0xf44b('0x81')],{'as':_0xf44b('0x137'),'foreignKey':_0xf44b('0x14f')});db[_0xf44b('0x64')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x172')});db[_0xf44b('0x66')][_0xf44b('0x132')](db[_0xf44b('0x16a')],{});db[_0xf44b('0x66')][_0xf44b('0x132')](db['CmList'],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x66')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db['OpenchannelQueueReport'][_0xf44b('0x132')](db['OpenchannelInteraction'],{});db[_0xf44b('0x66')]['belongsTo'](db[_0xf44b('0x60')],{});db[_0xf44b('0x66')]['belongsTo'](db[_0xf44b('0xfe')],{});db[_0xf44b('0x66')][_0xf44b('0x132')](db['OpenchannelQueue'],{});db['ChatApplication'][_0xf44b('0x132')](db['User'],{'as':_0xf44b('0x173'),'foreignKey':_0xf44b('0xfd'),'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x171')][_0xf44b('0x132')](db[_0xf44b('0x6a')],{'as':'Queue','foreignKey':_0xf44b('0x174'),'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x171')][_0xf44b('0x132')](db[_0xf44b('0x64')],{'as':'Website','foreignKey':_0xf44b('0x16f'),'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x171')][_0xf44b('0x132')](db[_0xf44b('0x89')],{'onDelete':_0xf44b('0x15c'),'foreignKey':_0xf44b('0x15d')});db[_0xf44b('0x105')][_0xf44b('0xff')](db[_0xf44b('0x68')],{'as':_0xf44b('0x13d'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x175')});db['ChatInteraction'][_0xf44b('0x132')](db[_0xf44b('0x64')],{'as':'Account','foreignKey':_0xf44b('0x16f')});db[_0xf44b('0x105')]['belongsTo'](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x105')][_0xf44b('0x132')](db['User'],{'as':_0xf44b('0x156'),'foreignKey':_0xf44b('0xfd')});db[_0xf44b('0x105')]['belongsToMany'](db['Tag'],{'through':_0xf44b('0x176'),'as':_0xf44b('0x162')});db[_0xf44b('0x105')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':'chat_interaction_has_tags','as':_0xf44b('0x158')});db[_0xf44b('0x105')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x159'),'through':'user_has_chat_interactions','foreignKey':_0xf44b('0x175')});db[_0xf44b('0x68')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0xfe')});db[_0xf44b('0x68')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x68')][_0xf44b('0x132')](db[_0xf44b('0x105')],{'onDelete':'cascade','as':'Interaction','foreignKey':'ChatInteractionId'});db[_0xf44b('0x68')][_0xf44b('0x132')](db[_0xf44b('0xe8')],{'as':_0xf44b('0xe8'),'foreignKey':_0xf44b('0x165')});db[_0xf44b('0x68')]['belongsTo'](db['ChatWebsite'],{'as':'Account','foreignKey':'ChatWebsiteId'});db[_0xf44b('0x69')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'onDelete':_0xf44b('0xfc'),'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x69')][_0xf44b('0x132')](db['ChatWebsite'],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x16f')});db['ChatQueue'][_0xf44b('0x10d')](db['User'],{'as':_0xf44b('0x150'),'through':_0xf44b('0x31'),'hooks':!![]});db[_0xf44b('0x6a')][_0xf44b('0x10d')](db[_0xf44b('0x111')],{'through':_0xf44b('0x177'),'as':_0xf44b('0x13a')});db[_0xf44b('0x6c')]['hasMany'](db[_0xf44b('0xce')],{'as':_0xf44b('0x13d'),'foreignKey':_0xf44b('0x178'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x6c')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x129'),'through':_0xf44b('0x10c')});db[_0xf44b('0x6e')][_0xf44b('0x132')](db[_0xf44b('0x64')],{'as':'Website','foreignKey':'ChatWebsiteId'});db['CmCompany'][_0xf44b('0xff')](db[_0xf44b('0x70')],{'as':'Contacts','foreignKey':_0xf44b('0x179')});db[_0xf44b('0x70')]['hasMany'](db[_0xf44b('0x72')],{'as':'Hoppers','foreignKey':_0xf44b('0x144')});db[_0xf44b('0x70')][_0xf44b('0xff')](db['CmHopperFinal'],{'as':_0xf44b('0x12b'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x70')][_0xf44b('0xff')](db[_0xf44b('0x77')],{'as':_0xf44b('0x17a'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x70')][_0xf44b('0xff')](db[_0xf44b('0x103')],{'as':'ReportAgentPreview','foreignKey':_0xf44b('0x144')});db[_0xf44b('0x70')]['hasMany'](db[_0xf44b('0x12e')],{'as':_0xf44b('0x12f'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0x70')][_0xf44b('0xff')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','foreignKey':'ContactId','onDelete':_0xf44b('0x15c')});db[_0xf44b('0x70')]['hasMany'](db[_0xf44b('0x105')],{'as':_0xf44b('0x106'),'foreignKey':'ContactId','onDelete':_0xf44b('0x15c')});db[_0xf44b('0x70')][_0xf44b('0xff')](db[_0xf44b('0x58')],{'as':'SmsInteractions','foreignKey':_0xf44b('0x144'),'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x70')][_0xf44b('0xff')](db[_0xf44b('0x4f')],{'as':_0xf44b('0x108'),'foreignKey':_0xf44b('0x144'),'onDelete':_0xf44b('0x15c')});db[_0xf44b('0x70')]['hasMany'](db[_0xf44b('0x40')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':_0xf44b('0x15c')});db[_0xf44b('0x70')][_0xf44b('0x132')](db[_0xf44b('0x17b')],{'as':_0xf44b('0x17c'),'foreignKey':_0xf44b('0x179')});db['CmContact'][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e'),'onDelete':_0xf44b('0xfc')});db['CmContact'][_0xf44b('0x10d')](db['User'],{'as':_0xf44b('0x159'),'through':_0xf44b('0x10f')});db['CmContact']['belongsToMany'](db['Tag'],{'as':'Tags','through':'cm_contact_has_tags'});db[_0xf44b('0x70')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x17d'),'as':_0xf44b('0x158')});db['CmHopper'][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144'),'onDelete':'cascade'});db[_0xf44b('0x72')]['belongsTo'](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x72')][_0xf44b('0x132')](db['User'],{'as':_0xf44b('0x173'),'foreignKey':_0xf44b('0xfd')});db['CmHopper'][_0xf44b('0x132')](db['VoiceQueue'],{'as':_0xf44b('0x17e'),'foreignKey':_0xf44b('0x12a'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x72')][_0xf44b('0x132')](db[_0xf44b('0x17f')],{'as':_0xf44b('0x17f'),'foreignKey':_0xf44b('0x180'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x72')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x156'),'foreignKey':_0xf44b('0x181')});db['CmHopperBlack'][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':'Contact','foreignKey':_0xf44b('0x144'),'onDelete':'cascade'});db['CmHopperBlack'][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x12c')]['belongsTo'](db['VoiceQueue'],{'as':_0xf44b('0x17e'),'foreignKey':_0xf44b('0x12a'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x12c')]['belongsTo'](db['Campaign'],{'as':_0xf44b('0x17f'),'foreignKey':_0xf44b('0x180'),'onDelete':_0xf44b('0xfc')});db[_0xf44b('0x182')]['hasMany'](db[_0xf44b('0x7e')],{'as':{'plural':_0xf44b('0x183'),'singular':_0xf44b('0x184')},'foreignKey':'AutomationAllId','onDelete':_0xf44b('0xfc'),'hooks':!![]});db[_0xf44b('0x182')][_0xf44b('0xff')](db[_0xf44b('0x7e')],{'as':{'plural':'Any','singular':_0xf44b('0x185')},'foreignKey':_0xf44b('0x186'),'onDelete':_0xf44b('0xfc'),'hooks':!![]});db['Automation'][_0xf44b('0xff')](db[_0xf44b('0x187')],{'as':_0xf44b('0x188'),'foreignKey':_0xf44b('0x189'),'onDelete':_0xf44b('0xfc'),'hooks':!![]});db[_0xf44b('0x135')][_0xf44b('0xff')](db['Interval'],{'as':_0xf44b('0x18a'),'foreignKey':_0xf44b('0x136'),'onDelete':'cascade','hooks':!![],'required':![]});db[_0xf44b('0x135')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'as':_0xf44b('0x18b'),'foreignKey':_0xf44b('0x136'),'onDelete':_0xf44b('0x15c')});db['Interval'][_0xf44b('0xff')](db[_0xf44b('0x44')],{'as':'MailApplications','foreignKey':_0xf44b('0x136')});db[_0xf44b('0x135')]['hasMany'](db[_0xf44b('0x171')],{'as':_0xf44b('0x18c'),'foreignKey':_0xf44b('0x136')});db[_0xf44b('0x135')][_0xf44b('0xff')](db['FaxApplication'],{'as':_0xf44b('0x18d'),'foreignKey':_0xf44b('0x136')});db[_0xf44b('0x135')][_0xf44b('0xff')](db['SmsApplication'],{'as':_0xf44b('0x18e'),'foreignKey':'IntervalId'});db['Schedule'][_0xf44b('0x132')](db['MailAccount'],{});db[_0xf44b('0x85')]['belongsTo'](db[_0xf44b('0x94')],{'foreignKey':'DefaultReportId'});db['Schedule'][_0xf44b('0x132')](db['AnalyticCustomReport'],{'foreignKey':_0xf44b('0x18f')});db[_0xf44b('0x87')][_0xf44b('0x10d')](db[_0xf44b('0x19')],{'as':_0xf44b('0x190'),'through':_0xf44b('0x128'),'onDelete':'restrict'});db[_0xf44b('0x89')][_0xf44b('0x10d')](db['CmContact'],{'through':_0xf44b('0x17d')});db[_0xf44b('0x89')]['belongsToMany'](db[_0xf44b('0x105')],{'through':'chat_interaction_has_tags'});db[_0xf44b('0x89')]['belongsToMany'](db[_0xf44b('0x40')],{'through':_0xf44b('0x157')});db[_0xf44b('0x89')][_0xf44b('0x10d')](db['SmsInteraction'],{'through':_0xf44b('0x169')});db['Tag'][_0xf44b('0x10d')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0xf44b('0x89')][_0xf44b('0x10d')](db[_0xf44b('0x104')],{'through':_0xf44b('0x16e')});db[_0xf44b('0x8c')][_0xf44b('0xff')](db[_0xf44b('0x7e')],{'as':{'plural':_0xf44b('0x191'),'singular':_0xf44b('0x192')},'foreignKey':_0xf44b('0x193'),'onDelete':'cascade','hooks':!![]});db[_0xf44b('0x8c')][_0xf44b('0xff')](db['Condition'],{'as':{'plural':_0xf44b('0x194'),'singular':'AnyCondition'},'foreignKey':_0xf44b('0x195'),'onDelete':_0xf44b('0xfc'),'hooks':!![]});db['Trigger'][_0xf44b('0xff')](db[_0xf44b('0x187')],{'as':_0xf44b('0x188'),'foreignKey':'TriggerId','onDelete':_0xf44b('0xfc'),'hooks':!![]});db[_0xf44b('0x92')][_0xf44b('0xff')](db[_0xf44b('0x97')],{'as':_0xf44b('0x196'),'onDelete':_0xf44b('0xfc'),'foreignKey':'CustomReportId','hooks':!![]});db[_0xf44b('0x94')][_0xf44b('0xff')](db[_0xf44b('0x97')],{'as':'Fields','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x197')});db[_0xf44b('0x96')][_0xf44b('0xff')](db[_0xf44b('0x97')],{'as':_0xf44b('0x196'),'onDelete':_0xf44b('0xfc'),'foreignKey':'MetricId'});db[_0xf44b('0x97')][_0xf44b('0x132')](db[_0xf44b('0x96')],{'foreignKey':'MetricId'});db[_0xf44b('0x9a')][_0xf44b('0xff')](db[_0xf44b('0x9b')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db['SalesforceConfiguration'][_0xf44b('0xff')](db[_0xf44b('0x19a')],{'as':_0xf44b('0x19b'),'onDelete':'cascade','foreignKey':_0xf44b('0x19c')});db['SalesforceConfiguration']['hasMany'](db[_0xf44b('0x19a')],{'as':_0xf44b('0x19d'),'onDelete':'cascade','foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x9b')]['hasMany'](db[_0xf44b('0x19a')],{'as':_0xf44b('0x196'),'onDelete':'cascade','foreignKey':_0xf44b('0x19f')});db[_0xf44b('0x9b')][_0xf44b('0x132')](db[_0xf44b('0x9a')],{'as':_0xf44b('0x155'),'foreignKey':'AccountId'});db['SalesforceField']['hasMany'](db[_0xf44b('0x19a')],{'as':'Subject','foreignKey':_0xf44b('0x19c')});db[_0xf44b('0x19a')]['hasMany'](db['SalesforceField'],{'as':_0xf44b('0x1a0'),'foreignKey':'DescriptionId'});db['SalesforceField']['hasMany'](db[_0xf44b('0x19a')],{'as':_0xf44b('0x1a1'),'foreignKey':'FieldId'});db[_0xf44b('0x19a')][_0xf44b('0x132')](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':'VariableId'});db['SugarcrmAccount'][_0xf44b('0xff')](db[_0xf44b('0x1a2')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0x1a2')][_0xf44b('0xff')](db[_0xf44b('0x1a3')],{'as':'Subjects','onDelete':_0xf44b('0xfc'),'foreignKey':'SubjectId'});db['SugarcrmConfiguration']['hasMany'](db[_0xf44b('0x1a3')],{'as':'Descriptions','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1a2')][_0xf44b('0xff')](db['SugarcrmField'],{'as':_0xf44b('0x196'),'onDelete':_0xf44b('0xfc'),'foreignKey':'FieldId'});db[_0xf44b('0x1a2')][_0xf44b('0x132')](db[_0xf44b('0x9e')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x199')});db['SugarcrmField'][_0xf44b('0xff')](db[_0xf44b('0x1a3')],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db['SugarcrmField'][_0xf44b('0xff')](db[_0xf44b('0x1a3')],{'as':'Description','foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1a3')][_0xf44b('0xff')](db[_0xf44b('0x1a3')],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0x1a3')][_0xf44b('0x132')](db['Variable'],{'as':_0xf44b('0x8d'),'foreignKey':'VariableId'});db[_0xf44b('0x1a5')][_0xf44b('0xff')](db[_0xf44b('0xa3')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':'AccountId'});db[_0xf44b('0xa3')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x19b'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xa3')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x19d'),'onDelete':'cascade','foreignKey':'DescriptionId'});db[_0xf44b('0xa3')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x196'),'onDelete':'cascade','foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xa3')]['belongsTo'](db[_0xf44b('0x1a5')],{'as':_0xf44b('0x155'),'foreignKey':'AccountId'});db[_0xf44b('0xa3')][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x1a6')});db[_0xf44b('0xa5')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xa5')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0xa5')][_0xf44b('0xff')](db[_0xf44b('0xa5')],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xa5')]['belongsTo'](db['Variable'],{'as':_0xf44b('0x8d'),'foreignKey':'VariableId'});db['ZohoAccount'][_0xf44b('0xff')](db[_0xf44b('0xa9')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0xa9')][_0xf44b('0xff')](db[_0xf44b('0xab')],{'as':'Subjects','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xa9')][_0xf44b('0xff')](db[_0xf44b('0xab')],{'as':_0xf44b('0x19d'),'onDelete':_0xf44b('0xfc'),'foreignKey':'DescriptionId'});db['ZohoConfiguration']['hasMany'](db[_0xf44b('0xab')],{'as':_0xf44b('0x196'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xa9')][_0xf44b('0x132')](db[_0xf44b('0xa7')],{'as':'Account','foreignKey':_0xf44b('0x199')});db[_0xf44b('0xab')][_0xf44b('0xff')](db[_0xf44b('0xab')],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xab')][_0xf44b('0xff')](db[_0xf44b('0xab')],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0xab')]['hasMany'](db[_0xf44b('0xab')],{'as':_0xf44b('0x1a1'),'foreignKey':'FieldId'});db[_0xf44b('0xab')][_0xf44b('0x132')](db['Variable'],{'as':'Variable','foreignKey':_0xf44b('0x1a7')});db['ZendeskAccount'][_0xf44b('0xff')](db['ZendeskConfiguration'],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0xaf')]['hasMany'](db[_0xf44b('0xb0')],{'as':_0xf44b('0x19b'),'foreignKey':'SubjectId'});db[_0xf44b('0xaf')][_0xf44b('0xff')](db[_0xf44b('0xb0')],{'as':_0xf44b('0x19d'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0xaf')]['hasMany'](db[_0xf44b('0xb0')],{'as':'Fields','foreignKey':'FieldId'});db[_0xf44b('0xaf')]['belongsTo'](db[_0xf44b('0xad')],{'as':'Account','foreignKey':'AccountId'});db['ZendeskConfiguration'][_0xf44b('0x10d')](db[_0xf44b('0x89')],{'through':_0xf44b('0x1a8')});db[_0xf44b('0xb0')][_0xf44b('0xff')](db[_0xf44b('0xb0')],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xb0')][_0xf44b('0xff')](db[_0xf44b('0xb0')],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0xb0')][_0xf44b('0xff')](db[_0xf44b('0xb0')],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xb0')]['belongsTo'](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':_0xf44b('0x1a7')});db[_0xf44b('0xb2')][_0xf44b('0xff')](db[_0xf44b('0x1a9')],{'as':_0xf44b('0x198'),'onDelete':'cascade','foreignKey':_0xf44b('0x199')});db['FreshdeskConfiguration'][_0xf44b('0xff')](db['FreshdeskField'],{'as':'Subjects','onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0x1a9')][_0xf44b('0xff')](db[_0xf44b('0xb5')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1a9')][_0xf44b('0xff')](db[_0xf44b('0xb5')],{'as':_0xf44b('0x196'),'onDelete':_0xf44b('0xfc'),'foreignKey':'FieldId'});db[_0xf44b('0x1a9')][_0xf44b('0x132')](db[_0xf44b('0xb2')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0x1a9')]['belongsToMany'](db[_0xf44b('0x89')],{'through':_0xf44b('0x1aa')});db[_0xf44b('0xb5')]['hasMany'](db[_0xf44b('0xb5')],{'as':'Subject','foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xb5')]['hasMany'](db[_0xf44b('0xb5')],{'as':'Description','foreignKey':_0xf44b('0x19e')});db['FreshdeskField'][_0xf44b('0xff')](db[_0xf44b('0xb5')],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xb5')][_0xf44b('0x132')](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':'VariableId'});db[_0xf44b('0xb7')]['hasMany'](db['VtigerConfiguration'],{'as':_0xf44b('0x198'),'onDelete':'cascade','foreignKey':_0xf44b('0x199')});db['VtigerConfiguration'][_0xf44b('0xff')](db[_0xf44b('0xba')],{'as':'Subjects','foreignKey':_0xf44b('0x19c')});db[_0xf44b('0x1ab')]['hasMany'](db[_0xf44b('0xba')],{'as':_0xf44b('0x19d'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1ab')][_0xf44b('0xff')](db[_0xf44b('0xba')],{'as':_0xf44b('0x196'),'foreignKey':'FieldId'});db[_0xf44b('0x1ab')][_0xf44b('0x132')](db[_0xf44b('0xb7')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x199')});db['VtigerField'][_0xf44b('0xff')](db['VtigerField'],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db['VtigerField'][_0xf44b('0xff')](db[_0xf44b('0xba')],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db['VtigerField']['hasMany'](db['VtigerField'],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0xba')][_0xf44b('0x132')](db[_0xf44b('0x8d')],{'as':'Variable','foreignKey':_0xf44b('0x1a7')});db[_0xf44b('0xbc')][_0xf44b('0xff')](db[_0xf44b('0xbd')],{'as':_0xf44b('0x198'),'onDelete':'cascade','foreignKey':_0xf44b('0x199')});db[_0xf44b('0xbd')][_0xf44b('0xff')](db['ServicenowField'],{'as':_0xf44b('0x19b'),'foreignKey':'SubjectId'});db['ServicenowConfiguration'][_0xf44b('0xff')](db[_0xf44b('0x1ac')],{'as':'Descriptions','foreignKey':'DescriptionId'});db[_0xf44b('0xbd')][_0xf44b('0xff')](db['ServicenowField'],{'as':_0xf44b('0x196'),'foreignKey':'FieldId'});db[_0xf44b('0xbd')]['belongsTo'](db[_0xf44b('0xbc')],{'as':'Account','foreignKey':_0xf44b('0x199')});db[_0xf44b('0x1ac')][_0xf44b('0xff')](db[_0xf44b('0x1ac')],{'as':'Subject','foreignKey':'SubjectId'});db[_0xf44b('0x1ac')]['hasMany'](db[_0xf44b('0x1ac')],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1ac')][_0xf44b('0xff')](db[_0xf44b('0x1ac')],{'as':_0xf44b('0x1a1'),'foreignKey':_0xf44b('0x19f')});db[_0xf44b('0x1ac')]['belongsTo'](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':_0xf44b('0x1a7')});db[_0xf44b('0xc0')][_0xf44b('0xff')](db[_0xf44b('0x1ad')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0x1ad')][_0xf44b('0xff')](db[_0xf44b('0xc2')],{'as':_0xf44b('0x19b'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0x1ad')]['hasMany'](db[_0xf44b('0xc2')],{'as':_0xf44b('0x19d'),'onDelete':'cascade','foreignKey':_0xf44b('0x19e')});db[_0xf44b('0x1ad')][_0xf44b('0xff')](db[_0xf44b('0xc2')],{'as':'Fields','onDelete':'cascade','foreignKey':_0xf44b('0x19f')});db[_0xf44b('0x1ad')]['belongsTo'](db['Dynamics365Account'],{'as':_0xf44b('0x155'),'foreignKey':'AccountId'});db[_0xf44b('0xc2')][_0xf44b('0xff')](db[_0xf44b('0xc2')],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db['Dynamics365Field'][_0xf44b('0xff')](db['Dynamics365Field'],{'as':_0xf44b('0x1a0'),'foreignKey':_0xf44b('0x19e')});db[_0xf44b('0xc2')][_0xf44b('0xff')](db[_0xf44b('0xc2')],{'as':_0xf44b('0x1a1'),'foreignKey':'FieldId'});db[_0xf44b('0xc2')][_0xf44b('0x132')](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':_0xf44b('0x1a7')});db[_0xf44b('0xc4')][_0xf44b('0xff')](db[_0xf44b('0xc5')],{'as':_0xf44b('0x198'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0xc5')][_0xf44b('0xff')](db[_0xf44b('0xc7')],{'as':_0xf44b('0x19b'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xc5')][_0xf44b('0xff')](db['FreshsalesField'],{'as':_0xf44b('0x19d'),'foreignKey':'DescriptionId'});db['FreshsalesConfiguration'][_0xf44b('0xff')](db['FreshsalesField'],{'as':_0xf44b('0x196'),'foreignKey':'FieldId'});db['FreshsalesConfiguration']['belongsTo'](db[_0xf44b('0xc4')],{'as':_0xf44b('0x155'),'foreignKey':_0xf44b('0x199')});db[_0xf44b('0xc7')][_0xf44b('0xff')](db['FreshsalesField'],{'as':_0xf44b('0x1a4'),'foreignKey':_0xf44b('0x19c')});db[_0xf44b('0xc7')]['hasMany'](db['FreshsalesField'],{'as':_0xf44b('0x1a0'),'foreignKey':'DescriptionId'});db[_0xf44b('0xc7')]['hasMany'](db[_0xf44b('0xc7')],{'as':_0xf44b('0x1a1'),'foreignKey':'FieldId'});db[_0xf44b('0xc7')][_0xf44b('0x132')](db[_0xf44b('0x8d')],{'as':_0xf44b('0x8d'),'foreignKey':_0xf44b('0x1a7')});db[_0xf44b('0xcc')][_0xf44b('0x132')](db[_0xf44b('0x64')],{});db[_0xf44b('0xcc')][_0xf44b('0x132')](db['CmList'],{'as':'List','foreignKey':_0xf44b('0x15e')});db[_0xf44b('0xcc')][_0xf44b('0x132')](db[_0xf44b('0x70')],{'as':_0xf44b('0x143'),'foreignKey':_0xf44b('0x144')});db[_0xf44b('0xcc')][_0xf44b('0x132')](db['ChatInteraction'],{});db['ChatQueueReport'][_0xf44b('0x132')](db[_0xf44b('0x68')],{});db['ChatQueueReport'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{});db['ChatQueueReport'][_0xf44b('0x132')](db[_0xf44b('0x6a')],{});db['ChatInternalMessage'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':_0xf44b('0xfc'),'foreignKey':'FromId'});db[_0xf44b('0xce')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'onDelete':'cascade','foreignKey':_0xf44b('0x1ae')});db[_0xf44b('0x12e')][_0xf44b('0xff')](db[_0xf44b('0x1af')],{'foreignKey':_0xf44b('0x1b0'),'onDelete':'cascade'});db['JscriptySessionReport'][_0xf44b('0xff')](db[_0xf44b('0xd0')],{'foreignKey':'SessionId','onDelete':'cascade'});db['SmsQueueReport'][_0xf44b('0x132')](db['SmsAccount'],{});db['SmsQueueReport'][_0xf44b('0x132')](db[_0xf44b('0x138')],{'as':_0xf44b('0x14c'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0xd4')]['belongsTo'](db['CmContact'],{'as':_0xf44b('0x143'),'foreignKey':'ContactId'});db[_0xf44b('0xd4')][_0xf44b('0x132')](db[_0xf44b('0x58')],{});db[_0xf44b('0xd4')][_0xf44b('0x132')](db[_0xf44b('0x5a')],{});db[_0xf44b('0xd4')][_0xf44b('0x132')](db['User'],{});db[_0xf44b('0xd4')][_0xf44b('0x132')](db[_0xf44b('0x5c')],{});db['JscriptyProject'][_0xf44b('0xff')](db['JscriptySessionReport'],{'foreignKey':_0xf44b('0x1b1')});db[_0xf44b('0xd8')][_0xf44b('0xff')](db[_0xf44b('0x1af')],{'foreignKey':'ProjectId'});db['JscriptyProject'][_0xf44b('0xff')](db[_0xf44b('0xd0')],{'foreignKey':'ProjectId'});db[_0xf44b('0xdd')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':'Users','through':_0xf44b('0x124')});db[_0xf44b('0x111')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':_0xf44b('0x112')});db['Team'][_0xf44b('0x10d')](db['VoiceQueue'],{'through':_0xf44b('0x13b'),'as':'VoiceQueues'});db['Team'][_0xf44b('0x10d')](db[_0xf44b('0x152')],{'through':'team_has_mail_queues','as':_0xf44b('0x118')});db[_0xf44b('0x111')][_0xf44b('0x10d')](db[_0xf44b('0x6a')],{'through':_0xf44b('0x177'),'as':_0xf44b('0x1b2')});db[_0xf44b('0x111')]['belongsToMany'](db[_0xf44b('0x51')],{'through':_0xf44b('0x1b3'),'as':'FaxQueues'});db[_0xf44b('0x111')][_0xf44b('0x10d')](db[_0xf44b('0x5c')],{'through':_0xf44b('0x1b4'),'as':_0xf44b('0x1b5')});db[_0xf44b('0x111')][_0xf44b('0x10d')](db[_0xf44b('0x62')],{'through':_0xf44b('0x1b6'),'as':_0xf44b('0x11b')});db[_0xf44b('0x17f')][_0xf44b('0xff')](db[_0xf44b('0x72')],{'as':'Hoppers','foreignKey':_0xf44b('0x180')});db[_0xf44b('0x17f')]['hasMany'](db[_0xf44b('0x75')],{'as':_0xf44b('0x12b'),'foreignKey':_0xf44b('0x180')});db[_0xf44b('0x17f')][_0xf44b('0xff')](db[_0xf44b('0x77')],{'as':_0xf44b('0x17a'),'foreignKey':_0xf44b('0x180')});db[_0xf44b('0x17f')][_0xf44b('0xff')](db[_0xf44b('0x12c')],{'as':_0xf44b('0x12d'),'foreignKey':_0xf44b('0x180')});db[_0xf44b('0x17f')][_0xf44b('0x132')](db[_0xf44b('0x130')],{'as':'Trunk','foreignKey':_0xf44b('0x131')});db['Campaign']['belongsTo'](db[_0xf44b('0x130')],{'as':'TrunkBackup','foreignKey':_0xf44b('0x134')});db[_0xf44b('0x17f')][_0xf44b('0x132')](db[_0xf44b('0x135')],{'as':'Interval','foreignKey':'IntervalId'});db['Campaign'][_0xf44b('0x132')](db[_0xf44b('0xdd')],{'as':_0xf44b('0xdd'),'foreignKey':'SquareProjectId'});db[_0xf44b('0x17f')][_0xf44b('0x10d')](db[_0xf44b('0x138')],{'as':'Lists','through':_0xf44b('0x1b7')});db[_0xf44b('0x17f')]['belongsToMany'](db[_0xf44b('0x138')],{'as':_0xf44b('0x13c'),'through':_0xf44b('0x1b8')});db['MailTransferReport']['belongsTo'](db[_0xf44b('0x42')],{});db[_0xf44b('0x1b9')][_0xf44b('0x132')](db['MailInteraction'],{});db[_0xf44b('0x1b9')][_0xf44b('0x132')](db['MailAccount'],{'foreignKey':_0xf44b('0x1ba'),'as':_0xf44b('0x1bb')});db['MailTransferReport'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':_0xf44b('0x1bc'),'as':_0xf44b('0x1bd')});db[_0xf44b('0x1b9')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':_0xf44b('0x1be'),'as':_0xf44b('0x1bf')});db[_0xf44b('0x1b9')]['belongsTo'](db[_0xf44b('0x152')],{'foreignKey':_0xf44b('0x1c0'),'as':_0xf44b('0x1c1')});db[_0xf44b('0x1b9')]['belongsTo'](db[_0xf44b('0x3c')],{'foreignKey':_0xf44b('0x1c2'),'as':'ToAccount'});db[_0xf44b('0xed')][_0xf44b('0x132')](db['ChatMessage'],{});db[_0xf44b('0xed')]['belongsTo'](db[_0xf44b('0x105')],{});db[_0xf44b('0xed')][_0xf44b('0x132')](db['ChatWebsite'],{'foreignKey':_0xf44b('0x1c3'),'as':_0xf44b('0x1bb')});db[_0xf44b('0xed')]['belongsTo'](db['User'],{'foreignKey':_0xf44b('0x1bc'),'as':_0xf44b('0x1bd')});db[_0xf44b('0xed')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':'ToUserId','as':_0xf44b('0x1bf')});db[_0xf44b('0xed')][_0xf44b('0x132')](db['ChatQueue'],{'foreignKey':_0xf44b('0x1c4'),'as':'ToQueue'});db[_0xf44b('0xed')]['belongsTo'](db[_0xf44b('0x64')],{'foreignKey':_0xf44b('0x1c5'),'as':_0xf44b('0x1c6')});db['FaxTransferReport'][_0xf44b('0x132')](db[_0xf44b('0x160')],{});db[_0xf44b('0xee')][_0xf44b('0x132')](db[_0xf44b('0x4f')],{});db[_0xf44b('0xee')]['belongsTo'](db['FaxAccount'],{'foreignKey':_0xf44b('0x1c7'),'as':_0xf44b('0x1bb')});db[_0xf44b('0xee')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':_0xf44b('0x1bc'),'as':_0xf44b('0x1bd')});db[_0xf44b('0xee')]['belongsTo'](db[_0xf44b('0xfe')],{'foreignKey':_0xf44b('0x1be'),'as':_0xf44b('0x1bf')});db[_0xf44b('0xee')][_0xf44b('0x132')](db['FaxQueue'],{'foreignKey':_0xf44b('0x1c8'),'as':'ToQueue'});db[_0xf44b('0xee')][_0xf44b('0x132')](db[_0xf44b('0x4b')],{'foreignKey':_0xf44b('0x1c9'),'as':_0xf44b('0x1c6')});db[_0xf44b('0xf0')][_0xf44b('0x132')](db[_0xf44b('0x60')],{});db[_0xf44b('0xf0')][_0xf44b('0x132')](db['OpenchannelInteraction'],{});db[_0xf44b('0xf0')][_0xf44b('0x132')](db[_0xf44b('0x16a')],{'foreignKey':_0xf44b('0x1ca'),'as':_0xf44b('0x1bb')});db[_0xf44b('0xf0')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':_0xf44b('0x1bc'),'as':'FromAgent'});db[_0xf44b('0xf0')][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':'ToUserId','as':_0xf44b('0x1bf')});db['OpenchannelTransferReport'][_0xf44b('0x132')](db[_0xf44b('0x62')],{'foreignKey':_0xf44b('0x1cb'),'as':_0xf44b('0x1c1')});db[_0xf44b('0xf0')][_0xf44b('0x132')](db['OpenchannelAccount'],{'foreignKey':'ToOpenchannelAccountId','as':_0xf44b('0x1c6')});db['SmsTransferReport'][_0xf44b('0x132')](db['SmsMessage'],{});db[_0xf44b('0xf2')][_0xf44b('0x132')](db['SmsInteraction'],{});db[_0xf44b('0xf2')][_0xf44b('0x132')](db[_0xf44b('0x55')],{'foreignKey':'FromSmsAccountId','as':_0xf44b('0x1bb')});db[_0xf44b('0xf2')]['belongsTo'](db['User'],{'foreignKey':'FromUserId','as':'FromAgent'});db['SmsTransferReport'][_0xf44b('0x132')](db[_0xf44b('0xfe')],{'foreignKey':'ToUserId','as':_0xf44b('0x1bf')});db[_0xf44b('0xf2')][_0xf44b('0x132')](db[_0xf44b('0x5c')],{'foreignKey':_0xf44b('0x1cc'),'as':_0xf44b('0x1c1')});db[_0xf44b('0xf2')][_0xf44b('0x132')](db[_0xf44b('0x55')],{'foreignKey':_0xf44b('0x1cd'),'as':_0xf44b('0x1c6')});db[_0xf44b('0x138')][_0xf44b('0xff')](db[_0xf44b('0x7c')],{'as':_0xf44b('0x148'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x138')][_0xf44b('0xff')](db[_0xf44b('0x79')],{'as':_0xf44b('0x1ce'),'foreignKey':'ListId'});db['CmList']['hasMany'](db['CmContact'],{'as':_0xf44b('0x10e'),'onDelete':_0xf44b('0xfc'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x138')][_0xf44b('0xff')](db[_0xf44b('0x75')],{'as':'HopperFinals','foreignKey':_0xf44b('0x15e')});db['CmList'][_0xf44b('0xff')](db['CmHopperHistory'],{'as':_0xf44b('0x102'),'foreignKey':_0xf44b('0x15e')});db[_0xf44b('0x138')][_0xf44b('0xff')](db[_0xf44b('0x103')],{'as':_0xf44b('0x103'),'foreignKey':_0xf44b('0x15e')});db['CmList'][_0xf44b('0x10d')](db[_0xf44b('0x1b')],{'as':'Queues','through':_0xf44b('0x139')});db[_0xf44b('0x138')][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':'Agents','through':'cm_user_has_lists'});db[_0xf44b('0xf5')][_0xf44b('0xff')](db[_0xf44b('0x17')],{'as':_0xf44b('0x18b'),'onDelete':_0xf44b('0x15c')});db['VoicePrefix'][_0xf44b('0x10d')](db[_0xf44b('0xfe')],{'as':_0xf44b('0x150'),'through':'user_has_voice_prefixes'});db[_0xf44b('0x10a')]['hasMany'](db['User'],{'as':_0xf44b('0x159'),'foreignKey':'userProfileId'});db[_0xf44b('0x10a')][_0xf44b('0xff')](db[_0xf44b('0xf8')],{'as':_0xf44b('0x1cf'),'foreignKey':'userProfileId','onDelete':_0xf44b('0xfc')});db[_0xf44b('0xf8')][_0xf44b('0xff')](db[_0xf44b('0xf9')],{'as':_0xf44b('0x1d0'),'foreignKey':_0xf44b('0x1d1'),'onDelete':_0xf44b('0xfc')});module['exports']={'db':db,'dbH':dbH}; \ No newline at end of file +var _0xf6ca=['VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Configuration','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','../api/intFreshsalesField/intFreshsalesField.model','Integration','Network','../api/network/network.model','ChatQueueReport','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','SmsQueueReport','../api/smsQueueReport/smsQueueReport.model','../api/squareReport/squareReport.model','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','../api/squareProject/squareProject.model','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','Campaign','../api/campaign/campaign.model','Migration','../api/migration/migration.model','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','../api/mailTransferReport/mailTransferReport.model','FaxTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','UserProfileSection','../api/userProfileSection/userProfileSection.model','UserProfileResource','../api/userProfileResource/userProfileResource.model','User','hasOne','VoiceMail','cascade','UserId','hasMany','VoiceRecording','Recordings','VoiceQueuesRt','VoiceExtension','Extensions','CmHopperHistory','HopperHistory','OpenchannelInteractions','ChatInteractions','SmsInteraction','FaxInteractions','MailInteractions','belongsTo','userProfileId','Groups','belongsToMany','CmContact','Contacts','cm_user_has_contacts','Lists','cm_user_has_lists','user_has_mail_interactions','user_has_chat_interactions','user_has_fax_interactions','SmsInteractions','user_has_openchannel_interactions','VoiceQueue','VoiceQueues','MailQueues','UserMailQueue','ChatQueue','ChatQueues','FaxQueues','UserFaxQueue','SmsQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccounts','user_has_fax_accounts','MailAccounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProject','SquareProjects','SpiedAgents','Applications','Sound','Sounds','moh_has_sounds','Members','CmHopper','Hoppers','VoiceQueueId','HopperFinals','HopperHistories','HopperBlacks','Trunk','TrunkId','TrunkBackup','TrunkBackupId','IntervalId','mandatoryDispositionPause','mandatoryDispositionPauseId','voice_queues_has_cm_lists','Agents','Team','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailbox','VoiceQueueReport','QueueCalls','AgentReports','Contact','ContactId','MailAccountId','MailServerOut','Smtp','CannedAnswer','Answers','ListId','user_has_mail_accounts','team_has_mail_queues','MailMessage','MailInteractionId','Account','mail_interaction_has_tags','Tags','ThroughTags','Users','Attachment','Attachments','Interaction','restrict','TagId','List','FaxAccountId','Interactions','Exntensions','FaxInteractionId','Owner','fax_interaction_has_tags','AttachmentId','SmsMessage','SmsAccountId','SmsApplication','SmsInteractionId','sms_interaction_has_tags','user_has_sms_interactions','SmsQueueId','Dispositions','OpenchannelAccountId','OpenchannelMessage','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','Queue','ChatQueueId','Website','chat_interaction_has_tags','ChatInteractionId','team_has_chat_queues','chat_group_has_users','CompanyId','JscriptySessions','Company','cm_contact_has_tags','CampaignId','OwnerId','OneAll','AutomationAllId','Any','OneAny','Actions','AutomationId','Intervals','MailApplications','ChatApplications','FaxApplications','SmsApplications','DefaultReportId','CustomReportId','AllConditions','AllCondition','TriggerAllId','AnyConditions','TriggerAnyId','TriggerId','Fields','MetricId','Configurations','AccountId','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','Subject','Description','Variable','VariableId','SugarcrmField','Field','DeskField','int_desk_configuration_has_tags','ZendeskConfiguration','int_zendesk_configuration_has_tags','int_freshdesk_configuration_has_tags','VtigerField','Dynamics365Account','FreshsalesField','FromId','ToId','JscriptyQuestionReport','JscriptyAnswerReport','SessionId','JscriptyProject','ProjectId','user_has_square_projects','user_has_teams','team_has_fax_queues','team_has_sms_queues','SquareProjectId','campaigns_has_cm_lists','MailTransferReport','FromMailAccountId','FromUserId','FromAgent','ToUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','ToChatWebsiteId','ToFaxAccountId','OpenchannelTransferReport','FromOpenchannelAccountId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsAccountId','CmCustomField','CustomFields','Resources','sectionId','exports','path','../config/environment','sequelize','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','utf8_general_ci','sequelizeHistory','database','username','password','options','import','../api/user/user.model','VoiceChanSpy','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','../api/voiceMusicOnHold/voiceMusicOnHold.model','../api/voiceQueue/voiceQueue.model','../api/voiceRecording/voiceRecording.model','ScreenRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','../api/voiceAgentReport/voiceAgentReport.model','../api/voiceQueueReport/voiceQueueReport.model','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','MailServerIn','MailAccount','MailQueue','MailSubstatus','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','../api/dashboard/dashboard.model','DashboardItem','FaxAccount','FaxApplication','../api/faxApplication/faxApplication.model','FaxInteraction','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','FaxQueue','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','../api/smsApplication/smsApplication.model','../api/smsInteraction/smsInteraction.model','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','CmHopperFinal','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','Automation','../api/automation/automation.model','../api/cannedAnswer/cannedAnswer.model','Disposition','Condition','../api/condition/condition.model','Interval','../api/interval/interval.model','Pause','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','Schedule','../api/schedule/schedule.model','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/variable/variable.model','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','../api/analyticDefaultReport/analyticDefaultReport.model','AnalyticExtractedReport','../api/analyticExtractedReport/analyticExtractedReport.model','AnalyticMetric','../api/analyticMetric/analyticMetric.model','AnalyticFieldReport','../api/analyticFieldReport/analyticFieldReport.model','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','SalesforceAccount','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','../api/intDeskField/intDeskField.model','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','FreshdeskConfiguration','FreshdeskField','../api/intFreshdeskField/intFreshdeskField.model'];(function(_0x312caa,_0x1a90e3){var _0x42bc75=function(_0x4023f7){while(--_0x4023f7){_0x312caa['push'](_0x312caa['shift']());}};_0x42bc75(++_0x1a90e3);}(_0xf6ca,0x11e));var _0xaf6c=function(_0x1efddd,_0x204fb6){_0x1efddd=_0x1efddd-0x0;var _0x385447=_0xf6ca[_0x1efddd];return _0x385447;};'use strict';var path=require(_0xaf6c('0x0'));var config=require(_0xaf6c('0x1'));var Sequelize=require(_0xaf6c('0x2'));var _=require('lodash');var jstz=require(_0xaf6c('0x3'));var timezone=jstz[_0xaf6c('0x4')]();config['sequelize']=_[_0xaf6c('0x5')](config[_0xaf6c('0x2')],{'database':_0xaf6c('0x6'),'username':_0xaf6c('0x7'),'password':'xC@LL1234','options':{'host':_0xaf6c('0x8'),'port':0xcea,'dialect':_0xaf6c('0x9'),'dialectOptions':{'charset':_0xaf6c('0xa')},'logging':![],'timezone':timezone[_0xaf6c('0xb')](),'define':{'charset':_0xaf6c('0xc'),'collate':_0xaf6c('0xd')}}});config[_0xaf6c('0xe')]=_[_0xaf6c('0x5')](config['sequelizeHistory'],{'database':_0xaf6c('0x6'),'username':'xcall','password':'xC@LL1234','options':{'host':_0xaf6c('0x8'),'port':0xcea,'dialect':_0xaf6c('0x9'),'dialectOptions':{'charset':_0xaf6c('0xa')},'logging':![],'timezone':timezone['name'](),'define':{'charset':_0xaf6c('0xc'),'collate':_0xaf6c('0xd')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaf6c('0x2')][_0xaf6c('0xf')],config[_0xaf6c('0x2')][_0xaf6c('0x10')],config[_0xaf6c('0x2')][_0xaf6c('0x11')],config[_0xaf6c('0x2')][_0xaf6c('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0xaf6c('0xe')][_0xaf6c('0xf')],config['sequelizeHistory'][_0xaf6c('0x10')],config[_0xaf6c('0xe')][_0xaf6c('0x11')],config[_0xaf6c('0xe')][_0xaf6c('0x12')])};db['User']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x14'));db[_0xaf6c('0x15')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x16'));db[_0xaf6c('0x17')]=db[_0xaf6c('0x2')]['import']('../api/voiceContext/voiceContext.model');db['VoiceExtension']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x18'));db[_0xaf6c('0x19')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x1a'));db['VoiceQueue']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x1b'));db['VoiceRecording']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x1c'));db[_0xaf6c('0x1d')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x1e'));db['VoiceMail']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x1f'));db[_0xaf6c('0x20')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x21'));db[_0xaf6c('0x22')]=db['sequelize'][_0xaf6c('0x13')]('../api/voiceCallReport/voiceCallReport.model');db[_0xaf6c('0x23')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x24'));db['VoiceAgentReport']=db['sequelize']['import'](_0xaf6c('0x25'));db['VoiceQueueReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x26'));db['MemberReport']=db[_0xaf6c('0x2')]['import']('../api/memberReport/memberReport.model');db['Trunk']=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x27'));db[_0xaf6c('0x28')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x29'));db[_0xaf6c('0x2a')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x2b'));db[_0xaf6c('0x2c')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x2d'));db[_0xaf6c('0x2e')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x2f'));db['UserMailQueue']=db['sequelize'][_0xaf6c('0x13')]('../api/userMailQueue/userMailQueue.model');db['UserFaxQueue']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x30'));db[_0xaf6c('0x31')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x32'));db[_0xaf6c('0x33')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x34'));db[_0xaf6c('0x35')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/mailServerIn/mailServerIn.model');db['MailServerOut']=db['sequelize'][_0xaf6c('0x13')]('../api/mailServerOut/mailServerOut.model');db[_0xaf6c('0x36')]=db['sequelize'][_0xaf6c('0x13')]('../api/mailAccount/mailAccount.model');db[_0xaf6c('0x37')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/mailQueue/mailQueue.model');db[_0xaf6c('0x38')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x39'));db[_0xaf6c('0x3a')]=db['sequelize']['import'](_0xaf6c('0x3b'));db['MailMessage']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x3c'));db[_0xaf6c('0x3d')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x3e'));db[_0xaf6c('0x3f')]=db['sequelize'][_0xaf6c('0x13')]('../api/mailQueueReport/mailQueueReport.model');db['Dashboard']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x40'));db[_0xaf6c('0x41')]=db['sequelize'][_0xaf6c('0x13')]('../api/dashboardItem/dashboardItem.model');db[_0xaf6c('0x42')]=db['sequelize'][_0xaf6c('0x13')]('../api/faxAccount/faxAccount.model');db[_0xaf6c('0x43')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x44'));db[_0xaf6c('0x45')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x46'));db[_0xaf6c('0x47')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x48'));db[_0xaf6c('0x49')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/faxQueue/faxQueue.model');db[_0xaf6c('0x4a')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x4b'));db[_0xaf6c('0x4c')]=db['sequelize'][_0xaf6c('0x13')]('../api/smsAccount/smsAccount.model');db['SmsApplication']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x4d'));db['SmsInteraction']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x4e'));db['SmsMessage']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x4f'));db[_0xaf6c('0x50')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x51'));db[_0xaf6c('0x52')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x53'));db[_0xaf6c('0x54')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x55'));db[_0xaf6c('0x56')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x57'));db['OpenchannelMessage']=db[_0xaf6c('0x2')]['import']('../api/openchannelMessage/openchannelMessage.model');db[_0xaf6c('0x58')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x59'));db[_0xaf6c('0x5a')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x5b'));db[_0xaf6c('0x5c')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x5d'));db['ChatApplication']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x5e'));db[_0xaf6c('0x5f')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x60'));db[_0xaf6c('0x61')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x62'));db[_0xaf6c('0x63')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x64'));db['ChatQueue']=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/chatQueue/chatQueue.model');db[_0xaf6c('0x65')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x66'));db[_0xaf6c('0x67')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x68'));db[_0xaf6c('0x69')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x6a'));db['CmContact']=db['sequelize']['import'](_0xaf6c('0x6b'));db['CmHopper']=db['sequelize']['import'](_0xaf6c('0x6c'));db[_0xaf6c('0x6d')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x6e'));db[_0xaf6c('0x6f')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x70'));db['CmHopperHistory']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x71'));db[_0xaf6c('0x72')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/reportAgentPreview/reportAgentPreview.model');db['CmCustomField']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x73'));db[_0xaf6c('0x74')]=db['sequelize']['import'](_0xaf6c('0x75'));db[_0xaf6c('0x76')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x77'));db['CannedAnswer']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x78'));db[_0xaf6c('0x79')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/disposition/disposition.model');db[_0xaf6c('0x7a')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x7b'));db[_0xaf6c('0x7c')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x7d'));db[_0xaf6c('0x7e')]=db[_0xaf6c('0x2')]['import']('../api/pause/pause.model');db[_0xaf6c('0x7f')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x80'));db[_0xaf6c('0x81')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x82'));db[_0xaf6c('0x83')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x84'));db['Sound']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x85'));db[_0xaf6c('0x86')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x87'));db[_0xaf6c('0x88')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x89'));db[_0xaf6c('0x8a')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/trigger/trigger.model');db['Variable']=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x8b'));db['Integration']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x8c'));db['IntegrationReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x8d'));db[_0xaf6c('0x8e')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0x8f'));db[_0xaf6c('0x90')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x91'));db[_0xaf6c('0x92')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x93'));db[_0xaf6c('0x94')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0x95'));db[_0xaf6c('0x96')]=db['sequelize']['import'](_0xaf6c('0x97'));db[_0xaf6c('0x98')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x99'));db[_0xaf6c('0x9a')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x9b'));db[_0xaf6c('0x9c')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x9d'));db[_0xaf6c('0x9e')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x9f'));db[_0xaf6c('0xa0')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xa1'));db[_0xaf6c('0xa2')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db['SugarcrmField']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xa3'));db[_0xaf6c('0xa4')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/intDeskAccount/intDeskAccount.model');db[_0xaf6c('0xa5')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xa6'));db['DeskField']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xa7'));db[_0xaf6c('0xa8')]=db[_0xaf6c('0x2')]['import']('../api/intZohoAccount/intZohoAccount.model');db[_0xaf6c('0xa9')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xaa'));db[_0xaf6c('0xab')]=db['sequelize'][_0xaf6c('0x13')]('../api/intZohoField/intZohoField.model');db[_0xaf6c('0xac')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xad'));db['ZendeskConfiguration']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xae'));db[_0xaf6c('0xaf')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0xb0'));db[_0xaf6c('0xb1')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/intFreshdeskAccount/intFreshdeskAccount.model');db[_0xaf6c('0xb2')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0xaf6c('0xb3')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xb4'));db[_0xaf6c('0xb5')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xb6'));db[_0xaf6c('0xb7')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/intVtigerConfiguration/intVtigerConfiguration.model');db['VtigerField']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xb8'));db[_0xaf6c('0xb9')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xba'));db[_0xaf6c('0xbb')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0xbc'));db[_0xaf6c('0xbd')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xbe'));db['Dynamics365Account']=db[_0xaf6c('0x2')]['import']('../api/intDynamics365Account/intDynamics365Account.model');db[_0xaf6c('0xbf')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xc0'));db[_0xaf6c('0xc1')]=db[_0xaf6c('0x2')]['import']('../api/intDynamics365Field/intDynamics365Field.model');db[_0xaf6c('0xc2')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xc3'));db[_0xaf6c('0xc4')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xc5'));db['FreshsalesField']=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xc6'));db[_0xaf6c('0xc7')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0x8c'));db[_0xaf6c('0xc8')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xc9'));db[_0xaf6c('0xca')]=db['sequelize'][_0xaf6c('0x13')]('../api/chatQueueReport/chatQueueReport.model');db[_0xaf6c('0xcb')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xcc'));db['JscriptyAnswerReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xcd'));db['JscriptyQuestionReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xce'));db[_0xaf6c('0xcf')]=db['sequelize'][_0xaf6c('0x13')]('../api/jscriptySessionReport/jscriptySessionReport.model');db[_0xaf6c('0xd0')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xd1'));db['SquareReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xd2'));db['SquareDetailsReport']=db[_0xaf6c('0x2')]['import']('../api/squareReportDetail/squareReportDetail.model');db['JscriptyProject']=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0xd3'));db[_0xaf6c('0xd4')]=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0xd5'));db['SquareOdbc']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xd6'));db['SquareProject']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xd7'));db['SquareRecording']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xd8'));db[_0xaf6c('0xd9')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xda'));db['Team']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xdb'));db[_0xaf6c('0xdc')]=db[_0xaf6c('0x2')]['import']('../api/license/license.model');db[_0xaf6c('0xdd')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xde'));db[_0xaf6c('0xdf')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xe0'));db['Attachment']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xe1'));db[_0xaf6c('0xe2')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xe3'));db['MailTransferReport']=db['sequelize'][_0xaf6c('0x13')](_0xaf6c('0xe4'));db['ChatTransferReport']=db['sequelize'][_0xaf6c('0x13')]('../api/chatTransferReport/chatTransferReport.model');db[_0xaf6c('0xe5')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')]('../api/faxTransferReport/faxTransferReport.model');db['OpenchannelTransferReport']=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xe6'));db[_0xaf6c('0xe7')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xe8'));db[_0xaf6c('0xe9')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xea'));db[_0xaf6c('0xeb')]=db[_0xaf6c('0x2')]['import'](_0xaf6c('0xec'));db[_0xaf6c('0xed')]=db['sequelize']['import']('../api/userProfile/userProfile.model');db[_0xaf6c('0xee')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xef'));db[_0xaf6c('0xf0')]=db[_0xaf6c('0x2')][_0xaf6c('0x13')](_0xaf6c('0xf1'));db[_0xaf6c('0xf2')][_0xaf6c('0xf3')](db[_0xaf6c('0xf4')],{'as':_0xaf6c('0xf4'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0xf8')],{'as':_0xaf6c('0xf9'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0x2a')],{'as':_0xaf6c('0xfa'),'foreignKey':'UserId'});db['User']['hasMany'](db[_0xaf6c('0xfb')],{'as':_0xaf6c('0xfc'),'onDelete':_0xaf6c('0xf5'),'hooks':!![]});db[_0xaf6c('0xf2')]['hasMany'](db[_0xaf6c('0x6f')],{'as':'HopperFinals','foreignKey':'UserId'});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0xfd')],{'as':_0xaf6c('0xfe'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0x72')],{'as':_0xaf6c('0x72'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0x56')],{'as':_0xaf6c('0xff'),'foreignKey':_0xaf6c('0xf6')});db['User'][_0xaf6c('0xf7')](db[_0xaf6c('0x5f')],{'as':_0xaf6c('0x100'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0x101')],{'as':'SmsInteractions','foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db[_0xaf6c('0x45')],{'as':_0xaf6c('0x102'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf2')][_0xaf6c('0xf7')](db['MailInteraction'],{'as':_0xaf6c('0x103'),'foreignKey':_0xaf6c('0xf6')});db['User'][_0xaf6c('0x104')](db[_0xaf6c('0xed')],{'as':'UserProfile','foreignKey':_0xaf6c('0x105')});db[_0xaf6c('0xf2')]['belongsToMany'](db[_0xaf6c('0x65')],{'as':_0xaf6c('0x106'),'through':'chat_group_has_users'});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x109'),'through':_0xaf6c('0x10a')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x10b'),'through':_0xaf6c('0x10c')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db['Team'],{'through':'user_has_teams'});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x3a')],{'as':'MailInteractions','through':_0xaf6c('0x10d')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db['ChatInteraction'],{'as':_0xaf6c('0x100'),'through':_0xaf6c('0x10e')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x45')],{'as':_0xaf6c('0x102'),'through':_0xaf6c('0x10f')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db['SmsInteraction'],{'as':_0xaf6c('0x110'),'through':'user_has_sms_interactions'});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x56')],{'as':_0xaf6c('0xff'),'through':_0xaf6c('0x111')});db[_0xaf6c('0xf2')]['belongsToMany'](db[_0xaf6c('0x112')],{'as':_0xaf6c('0x113'),'through':_0xaf6c('0x2c'),'required':![]});db['User'][_0xaf6c('0x107')](db[_0xaf6c('0x37')],{'as':_0xaf6c('0x114'),'through':_0xaf6c('0x115'),'required':![]});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x116')],{'as':_0xaf6c('0x117'),'through':_0xaf6c('0x2e'),'required':![],'hooks':!![]});db['User'][_0xaf6c('0x107')](db[_0xaf6c('0x49')],{'as':_0xaf6c('0x118'),'through':_0xaf6c('0x119'),'required':![]});db['User'][_0xaf6c('0x107')](db[_0xaf6c('0x50')],{'as':_0xaf6c('0x11a'),'through':_0xaf6c('0x31'),'required':![]});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x58')],{'as':_0xaf6c('0x11b'),'through':_0xaf6c('0x33'),'required':![]});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db['CmList'],{'through':_0xaf6c('0x10c')});db['User']['belongsToMany'](db['VoicePrefix'],{'as':_0xaf6c('0x11c'),'through':_0xaf6c('0x11d'),'required':![]});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x11e'),'through':_0xaf6c('0x11f')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db[_0xaf6c('0x42')],{'as':_0xaf6c('0x120'),'through':_0xaf6c('0x121')});db[_0xaf6c('0xf2')][_0xaf6c('0x107')](db['MailAccount'],{'as':_0xaf6c('0x122'),'through':'user_has_mail_accounts'});db['User'][_0xaf6c('0x107')](db[_0xaf6c('0x52')],{'as':_0xaf6c('0x123'),'through':_0xaf6c('0x124')});db[_0xaf6c('0xf2')]['belongsToMany'](db[_0xaf6c('0x4c')],{'as':_0xaf6c('0x125'),'through':_0xaf6c('0x126')});db['User'][_0xaf6c('0x107')](db[_0xaf6c('0x127')],{'as':_0xaf6c('0x128'),'through':'user_has_square_projects'});db[_0xaf6c('0x15')]['hasMany'](db[_0xaf6c('0xfb')],{'as':_0xaf6c('0x129'),'onDelete':_0xaf6c('0xf5'),'foreignKey':'ChanSpyId'});db[_0xaf6c('0x17')][_0xaf6c('0xf7')](db[_0xaf6c('0xfb')],{'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0xfb')][_0xaf6c('0xf7')](db['VoiceExtension'],{'as':_0xaf6c('0x12a'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x19')]['belongsToMany'](db[_0xaf6c('0x12b')],{'as':_0xaf6c('0x12c'),'through':_0xaf6c('0x12d')});db['VoiceQueue'][_0xaf6c('0xf7')](db[_0xaf6c('0x2a')],{'as':_0xaf6c('0x12e'),'foreignKey':'VoiceQueueId'});db[_0xaf6c('0x112')][_0xaf6c('0xf7')](db[_0xaf6c('0x12f')],{'as':_0xaf6c('0x130'),'foreignKey':_0xaf6c('0x131')});db['VoiceQueue']['hasMany'](db[_0xaf6c('0x6f')],{'as':_0xaf6c('0x132'),'foreignKey':_0xaf6c('0x131')});db[_0xaf6c('0x112')][_0xaf6c('0xf7')](db[_0xaf6c('0xfd')],{'as':_0xaf6c('0x133'),'foreignKey':_0xaf6c('0x131')});db[_0xaf6c('0x112')][_0xaf6c('0xf7')](db['ReportAgentPreview'],{'as':_0xaf6c('0x72'),'foreignKey':_0xaf6c('0x131')});db[_0xaf6c('0x112')][_0xaf6c('0xf7')](db[_0xaf6c('0x6d')],{'as':_0xaf6c('0x134'),'foreignKey':'VoiceQueueId'});db['VoiceQueue']['hasMany'](db[_0xaf6c('0xcf')],{'as':'JscriptySessions','foreignKey':_0xaf6c('0x131')});db['VoiceQueue']['belongsTo'](db[_0xaf6c('0x135')],{'as':_0xaf6c('0x135'),'foreignKey':_0xaf6c('0x136')});db[_0xaf6c('0x112')][_0xaf6c('0x104')](db[_0xaf6c('0x135')],{'as':_0xaf6c('0x137'),'foreignKey':_0xaf6c('0x138')});db[_0xaf6c('0x112')][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'as':_0xaf6c('0x7c'),'foreignKey':_0xaf6c('0x139')});db['VoiceQueue']['belongsTo'](db[_0xaf6c('0x7e')],{'as':_0xaf6c('0x13a'),'foreignKey':_0xaf6c('0x13b')});db['VoiceQueue'][_0xaf6c('0x107')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x10b'),'through':_0xaf6c('0x13c')});db['VoiceQueue'][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':'UserVoiceQueue'});db['VoiceQueue'][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'as':_0xaf6c('0x13f'),'through':_0xaf6c('0x140')});db[_0xaf6c('0x112')][_0xaf6c('0x107')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x141'),'through':_0xaf6c('0x142')});db[_0xaf6c('0xf8')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0xf2'),'foreignKey':'UserId'});db[_0xaf6c('0x1d')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'as':'User','foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0xf4')][_0xaf6c('0xf7')](db['VoiceMailMessage'],{'as':_0xaf6c('0x143'),'onDelete':_0xaf6c('0xf5'),'foreignKey':'mailboxuser','sourceKey':'mailbox'});db[_0xaf6c('0x20')]['belongsTo'](db[_0xaf6c('0xf4')],{'foreignKey':'mailboxuser','targetKey':_0xaf6c('0x144')});db[_0xaf6c('0x22')][_0xaf6c('0xf7')](db[_0xaf6c('0x145')],{'as':_0xaf6c('0x146'),'foreignKey':'uniqueid','constraints':![]});db[_0xaf6c('0x22')]['hasMany'](db['VoiceAgentReport'],{'as':_0xaf6c('0x147'),'foreignKey':'uniqueid','constraints':![]});db['VoiceCallReport'][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0xf2'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0x22')]['belongsTo'](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db['MailServerIn'][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'as':_0xaf6c('0x36'),'foreignKey':_0xaf6c('0x14a')});db[_0xaf6c('0x14b')][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'as':_0xaf6c('0x36'),'foreignKey':'MailAccountId'});db[_0xaf6c('0x36')]['hasOne'](db['MailServerIn'],{'as':'Imap','onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x36')][_0xaf6c('0xf3')](db[_0xaf6c('0x14b')],{'as':_0xaf6c('0x14c'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x36')][_0xaf6c('0xf7')](db[_0xaf6c('0x79')],{'as':'Dispositions','foreignKey':_0xaf6c('0x14a')});db['MailAccount'][_0xaf6c('0xf7')](db[_0xaf6c('0x14d')],{'as':_0xaf6c('0x14e'),'foreignKey':'MailAccountId'});db['MailAccount'][_0xaf6c('0xf7')](db['MailMessage'],{'as':_0xaf6c('0x143'),'foreignKey':'MailAccountId'});db[_0xaf6c('0x36')][_0xaf6c('0xf7')](db[_0xaf6c('0x3a')],{'as':'Interactions'});db[_0xaf6c('0x36')]['hasMany'](db['MailApplication'],{'as':_0xaf6c('0x12a')});db[_0xaf6c('0x36')]['belongsTo'](db[_0xaf6c('0xe9')],{'as':'List','foreignKey':_0xaf6c('0x14f')});db['MailAccount']['belongsTo'](db['Template'],{'as':_0xaf6c('0x88'),'foreignKey':'TemplateId'});db[_0xaf6c('0x36')][_0xaf6c('0x104')](db[_0xaf6c('0x7e')],{'as':_0xaf6c('0x13a'),'foreignKey':_0xaf6c('0x13b')});db['MailAccount'][_0xaf6c('0x107')](db['User'],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x150')});db[_0xaf6c('0x37')][_0xaf6c('0x107')](db['User'],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x115')});db[_0xaf6c('0x37')][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'through':_0xaf6c('0x151'),'as':_0xaf6c('0x13f')});db[_0xaf6c('0x3a')][_0xaf6c('0xf7')](db[_0xaf6c('0x152')],{'as':_0xaf6c('0x143'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x153')});db['MailInteraction'][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x14a')});db[_0xaf6c('0x3a')][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db['MailInteraction']['belongsTo'](db[_0xaf6c('0xf2')],{'as':'Owner','foreignKey':'UserId'});db[_0xaf6c('0x3a')][_0xaf6c('0x107')](db['Tag'],{'through':_0xaf6c('0x155'),'as':_0xaf6c('0x156')});db['MailInteraction']['belongsToMany'](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x155'),'as':_0xaf6c('0x157')});db[_0xaf6c('0x3a')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x158'),'through':_0xaf6c('0x10d'),'foreignKey':_0xaf6c('0x153')});db[_0xaf6c('0x152')][_0xaf6c('0xf7')](db[_0xaf6c('0x159')],{'as':_0xaf6c('0x15a'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x152')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0xf2')});db[_0xaf6c('0x152')][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'onDelete':'cascade','as':_0xaf6c('0x148')});db['MailMessage'][_0xaf6c('0x104')](db['MailInteraction'],{'as':_0xaf6c('0x15b'),'foreignKey':_0xaf6c('0x153')});db[_0xaf6c('0x152')][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x14a')});db[_0xaf6c('0x3d')]['belongsTo'](db[_0xaf6c('0xf2')],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x3d')][_0xaf6c('0x104')](db[_0xaf6c('0x37')],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x3d')]['belongsTo'](db[_0xaf6c('0x36')],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x3d')][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'onDelete':'restrict','foreignKey':_0xaf6c('0x139')});db['MailApplication'][_0xaf6c('0x104')](db['Tag'],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x15d')});db[_0xaf6c('0x3f')][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{});db['MailQueueReport']['belongsTo'](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':'ListId'});db[_0xaf6c('0x3f')][_0xaf6c('0x104')](db['CmContact'],{'as':'Contact','foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x3f')]['belongsTo'](db[_0xaf6c('0x3a')],{});db[_0xaf6c('0x3f')][_0xaf6c('0x104')](db['MailMessage'],{});db['MailQueueReport'][_0xaf6c('0x104')](db['User'],{});db['MailQueueReport'][_0xaf6c('0x104')](db[_0xaf6c('0x37')],{});db['Dashboard'][_0xaf6c('0xf7')](db[_0xaf6c('0x41')],{'as':'Items','onDelete':'cascade'});db['FaxAccount'][_0xaf6c('0xf7')](db['Disposition'],{'as':'Dispositions','foreignKey':_0xaf6c('0x15f')});db['FaxAccount']['hasMany'](db[_0xaf6c('0x14d')],{'as':'Answers','foreignKey':_0xaf6c('0x15f')});db['FaxAccount']['hasMany'](db[_0xaf6c('0x45')],{'as':_0xaf6c('0x160')});db['FaxAccount'][_0xaf6c('0xf7')](db[_0xaf6c('0x43')],{'as':_0xaf6c('0x12a')});db[_0xaf6c('0x42')]['hasMany'](db['VoiceExtension'],{'as':_0xaf6c('0x161'),'onDelete':_0xaf6c('0xf5')});db['FaxAccount'][_0xaf6c('0xf7')](db['FaxMessage'],{'as':_0xaf6c('0x143')});db['FaxAccount'][_0xaf6c('0x104')](db[_0xaf6c('0x135')],{'as':_0xaf6c('0x135')});db[_0xaf6c('0x42')][_0xaf6c('0x104')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0x42')][_0xaf6c('0x104')](db[_0xaf6c('0x7e')],{'as':_0xaf6c('0x13a'),'foreignKey':_0xaf6c('0x13b')});db[_0xaf6c('0x42')]['belongsToMany'](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':'user_has_fax_accounts'});db[_0xaf6c('0x43')]['belongsTo'](db['User'],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x43')][_0xaf6c('0x104')](db['FaxQueue'],{'onDelete':'restrict'});db['FaxApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x42')],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x43')][_0xaf6c('0x104')](db[_0xaf6c('0x86')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x15d')});db[_0xaf6c('0x45')][_0xaf6c('0xf7')](db[_0xaf6c('0x47')],{'as':_0xaf6c('0x143'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x162')});db['FaxInteraction'][_0xaf6c('0x104')](db[_0xaf6c('0x42')],{'as':_0xaf6c('0x154'),'foreignKey':'FaxAccountId'});db['FaxInteraction'][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x45')][_0xaf6c('0x104')](db['User'],{'as':_0xaf6c('0x163'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0x45')]['belongsToMany'](db['Tag'],{'through':_0xaf6c('0x164'),'as':_0xaf6c('0x156')});db[_0xaf6c('0x45')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x164'),'as':'ThroughTags'});db[_0xaf6c('0x45')][_0xaf6c('0x107')](db['User'],{'as':'Users','through':_0xaf6c('0x10f'),'foreignKey':_0xaf6c('0x162')});db[_0xaf6c('0x47')][_0xaf6c('0x104')](db['User'],{'onDelete':'cascade','as':_0xaf6c('0xf2')});db[_0xaf6c('0x47')][_0xaf6c('0x104')](db['FaxInteraction'],{'as':_0xaf6c('0x15b'),'foreignKey':_0xaf6c('0x162')});db['FaxMessage'][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0x148')});db['FaxMessage'][_0xaf6c('0x104')](db[_0xaf6c('0x159')],{'as':'Attachment','foreignKey':_0xaf6c('0x165')});db[_0xaf6c('0x47')]['belongsTo'](db[_0xaf6c('0x42')],{'as':'Account','foreignKey':_0xaf6c('0x15f')});db['FaxQueue'][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x119')});db[_0xaf6c('0x49')][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'through':'team_has_fax_queues','as':_0xaf6c('0x13f')});db[_0xaf6c('0x4a')][_0xaf6c('0x104')](db[_0xaf6c('0x42')],{});db[_0xaf6c('0x4a')][_0xaf6c('0x104')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0x4a')]['belongsTo'](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db['FaxQueueReport'][_0xaf6c('0x104')](db[_0xaf6c('0x45')],{});db[_0xaf6c('0x4a')][_0xaf6c('0x104')](db['FaxMessage'],{});db[_0xaf6c('0x4a')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{});db[_0xaf6c('0x4a')][_0xaf6c('0x104')](db[_0xaf6c('0x49')],{});db[_0xaf6c('0x4c')]['hasMany'](db[_0xaf6c('0x79')],{'as':'Dispositions','foreignKey':'SmsAccountId'});db[_0xaf6c('0x4c')]['hasMany'](db[_0xaf6c('0x14d')],{'as':'Answers','foreignKey':'SmsAccountId'});db[_0xaf6c('0x4c')][_0xaf6c('0xf7')](db[_0xaf6c('0x166')],{'as':_0xaf6c('0x143'),'foreignKey':_0xaf6c('0x167')});db[_0xaf6c('0x4c')][_0xaf6c('0xf7')](db[_0xaf6c('0x101')],{'as':_0xaf6c('0x160')});db[_0xaf6c('0x4c')][_0xaf6c('0xf7')](db[_0xaf6c('0x168')],{'as':_0xaf6c('0x12a')});db['SmsAccount']['belongsTo'](db['CmList'],{'as':_0xaf6c('0x15e'),'foreignKey':'ListId'});db['SmsAccount'][_0xaf6c('0x104')](db[_0xaf6c('0x7e')],{'as':_0xaf6c('0x13a'),'foreignKey':_0xaf6c('0x13b')});db['SmsAccount'][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':'user_has_sms_accounts'});db[_0xaf6c('0x168')][_0xaf6c('0x104')](db['User'],{'onDelete':'restrict'});db[_0xaf6c('0x168')][_0xaf6c('0x104')](db[_0xaf6c('0x50')],{'onDelete':_0xaf6c('0x15c')});db['SmsApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x4c')],{'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x168')][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x139')});db[_0xaf6c('0x168')][_0xaf6c('0x104')](db[_0xaf6c('0x86')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x15d')});db['SmsInteraction']['hasMany'](db[_0xaf6c('0x166')],{'as':_0xaf6c('0x143'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x169')});db[_0xaf6c('0x101')][_0xaf6c('0x104')](db[_0xaf6c('0x4c')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x167')});db[_0xaf6c('0x101')]['belongsTo'](db[_0xaf6c('0x108')],{'as':'Contact','foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x101')][_0xaf6c('0x104')](db['User'],{'as':_0xaf6c('0x163'),'foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0x101')][_0xaf6c('0x107')](db['Tag'],{'through':_0xaf6c('0x16a'),'as':_0xaf6c('0x156')});db[_0xaf6c('0x101')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':'sms_interaction_has_tags','as':_0xaf6c('0x157')});db['SmsInteraction'][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':'Users','through':_0xaf6c('0x16b'),'foreignKey':_0xaf6c('0x169')});db[_0xaf6c('0x166')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0xf2')});db[_0xaf6c('0x166')]['belongsTo'](db[_0xaf6c('0x108')],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0x148')});db[_0xaf6c('0x166')][_0xaf6c('0x104')](db[_0xaf6c('0x101')],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0x15b'),'foreignKey':'SmsInteractionId'});db[_0xaf6c('0x166')][_0xaf6c('0x104')](db[_0xaf6c('0x4c')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x167')});db[_0xaf6c('0x50')]['belongsToMany'](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x31'),'foreignKey':_0xaf6c('0x16c')});db[_0xaf6c('0x50')][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'through':'team_has_sms_queues','as':_0xaf6c('0x13f')});db[_0xaf6c('0x52')][_0xaf6c('0xf7')](db[_0xaf6c('0x79')],{'as':_0xaf6c('0x16d'),'foreignKey':_0xaf6c('0x16e')});db[_0xaf6c('0x52')][_0xaf6c('0xf7')](db[_0xaf6c('0x14d')],{'as':_0xaf6c('0x14e'),'foreignKey':_0xaf6c('0x16e')});db[_0xaf6c('0x52')][_0xaf6c('0xf7')](db[_0xaf6c('0x56')],{'as':_0xaf6c('0x160'),'foreignKey':_0xaf6c('0x16e')});db[_0xaf6c('0x52')][_0xaf6c('0xf7')](db[_0xaf6c('0x16f')],{'as':_0xaf6c('0x143'),'foreignKey':_0xaf6c('0x16e')});db['OpenchannelAccount'][_0xaf6c('0xf7')](db[_0xaf6c('0x54')],{'as':_0xaf6c('0x12a'),'foreignKey':_0xaf6c('0x16e')});db[_0xaf6c('0x52')]['belongsTo'](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0x52')][_0xaf6c('0x104')](db[_0xaf6c('0x7e')],{'as':_0xaf6c('0x13a'),'foreignKey':'mandatoryDispositionPauseId'});db[_0xaf6c('0x52')]['belongsToMany'](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x124')});db['OpenchannelApplication']['belongsTo'](db[_0xaf6c('0xf2')],{'onDelete':'restrict'});db[_0xaf6c('0x54')]['belongsTo'](db[_0xaf6c('0x58')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x170')});db[_0xaf6c('0x54')][_0xaf6c('0x104')](db[_0xaf6c('0x52')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x139')});db['OpenchannelApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x86')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x15d')});db['OpenchannelInteraction'][_0xaf6c('0xf7')](db[_0xaf6c('0x16f')],{'as':_0xaf6c('0x143'),'onDelete':'cascade','foreignKey':_0xaf6c('0x171')});db[_0xaf6c('0x56')][_0xaf6c('0x104')](db['OpenchannelAccount'],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x16e')});db[_0xaf6c('0x56')][_0xaf6c('0x104')](db['CmContact'],{'as':'Contact','foreignKey':'ContactId'});db[_0xaf6c('0x56')]['belongsTo'](db[_0xaf6c('0xf2')],{'as':'Owner','foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0x56')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':'openchannel_interaction_has_tags','as':_0xaf6c('0x156')});db['OpenchannelInteraction']['belongsToMany'](db['Tag'],{'through':_0xaf6c('0x172'),'as':_0xaf6c('0x157')});db[_0xaf6c('0x56')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':'Users','through':_0xaf6c('0x111'),'foreignKey':_0xaf6c('0x171')});db['OpenchannelMessage'][_0xaf6c('0x104')](db['User'],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0xf2')});db[_0xaf6c('0x16f')][_0xaf6c('0x104')](db['CmContact'],{'onDelete':_0xaf6c('0xf5'),'as':'Contact'});db[_0xaf6c('0x16f')][_0xaf6c('0x104')](db[_0xaf6c('0x56')],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0x15b'),'foreignKey':_0xaf6c('0x171')});db['OpenchannelMessage'][_0xaf6c('0x104')](db['Attachment'],{'as':'Attachment','foreignKey':'AttachmentId'});db[_0xaf6c('0x16f')][_0xaf6c('0x104')](db[_0xaf6c('0x52')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x16e')});db['OpenchannelQueue'][_0xaf6c('0x107')](db['User'],{'as':'Agents','through':_0xaf6c('0x33'),'foreignKey':_0xaf6c('0x170')});db['OpenchannelQueue'][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'through':_0xaf6c('0x173'),'as':_0xaf6c('0x13f')});db['ChatWebsite'][_0xaf6c('0xf7')](db[_0xaf6c('0x79')],{'as':'Dispositions','foreignKey':_0xaf6c('0x174')});db[_0xaf6c('0x5a')][_0xaf6c('0xf7')](db[_0xaf6c('0x14d')],{'as':'Answers','foreignKey':'ChatWebsiteId'});db[_0xaf6c('0x5a')][_0xaf6c('0xf7')](db[_0xaf6c('0x67')],{'as':_0xaf6c('0x175')});db[_0xaf6c('0x5a')]['hasMany'](db[_0xaf6c('0x5f')],{'as':_0xaf6c('0x160')});db['ChatWebsite'][_0xaf6c('0xf7')](db[_0xaf6c('0x176')],{'as':_0xaf6c('0x12a')});db[_0xaf6c('0x5a')]['hasMany'](db['ChatMessage'],{'as':_0xaf6c('0x143')});db[_0xaf6c('0x5a')][_0xaf6c('0x104')](db['CmList'],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0x5a')][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'as':_0xaf6c('0x7c'),'foreignKey':_0xaf6c('0x139')});db[_0xaf6c('0x5a')]['belongsTo'](db['Pause'],{'as':_0xaf6c('0x13a'),'foreignKey':_0xaf6c('0x13b')});db[_0xaf6c('0x5a')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x11f')});db[_0xaf6c('0x5c')]['belongsTo'](db[_0xaf6c('0x52')],{});db[_0xaf6c('0x5c')]['belongsTo'](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0x5c')][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db['OpenchannelQueueReport'][_0xaf6c('0x104')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0xaf6c('0x104')](db[_0xaf6c('0x16f')],{});db['OpenchannelQueueReport'][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{});db['OpenchannelQueueReport'][_0xaf6c('0x104')](db[_0xaf6c('0x58')],{});db[_0xaf6c('0x176')]['belongsTo'](db[_0xaf6c('0xf2')],{'as':'Agent','foreignKey':_0xaf6c('0xf6'),'onDelete':'restrict'});db['ChatApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x116')],{'as':_0xaf6c('0x177'),'foreignKey':_0xaf6c('0x178'),'onDelete':_0xaf6c('0x15c')});db['ChatApplication'][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x179'),'foreignKey':_0xaf6c('0x174'),'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x176')][_0xaf6c('0x104')](db[_0xaf6c('0x86')],{'onDelete':_0xaf6c('0x15c'),'foreignKey':_0xaf6c('0x15d')});db[_0xaf6c('0x5f')][_0xaf6c('0xf7')](db['ChatMessage'],{'as':'Messages','onDelete':_0xaf6c('0xf5'),'foreignKey':'ChatInteractionId'});db[_0xaf6c('0x5f')]['belongsTo'](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x174')});db[_0xaf6c('0x5f')][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x5f')][_0xaf6c('0x104')](db['User'],{'as':'Owner','foreignKey':_0xaf6c('0xf6')});db['ChatInteraction']['belongsToMany'](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x17a'),'as':_0xaf6c('0x156')});db[_0xaf6c('0x5f')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':'chat_interaction_has_tags','as':'ThroughTags'});db[_0xaf6c('0x5f')]['belongsToMany'](db['User'],{'as':'Users','through':'user_has_chat_interactions','foreignKey':_0xaf6c('0x17b')});db['ChatMessage'][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0xf2')});db['ChatMessage'][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'onDelete':'cascade','as':_0xaf6c('0x148'),'foreignKey':'ContactId'});db[_0xaf6c('0x61')][_0xaf6c('0x104')](db['ChatInteraction'],{'onDelete':_0xaf6c('0xf5'),'as':_0xaf6c('0x15b'),'foreignKey':'ChatInteractionId'});db[_0xaf6c('0x61')][_0xaf6c('0x104')](db['Attachment'],{'as':_0xaf6c('0x159'),'foreignKey':_0xaf6c('0x165')});db['ChatMessage'][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x174')});db[_0xaf6c('0x63')][_0xaf6c('0x104')](db['CmContact'],{'onDelete':_0xaf6c('0xf5'),'as':'Contact','foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x63')][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x154'),'foreignKey':'ChatWebsiteId'});db[_0xaf6c('0x116')]['belongsToMany'](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':'UserChatQueue','hooks':!![]});db[_0xaf6c('0x116')][_0xaf6c('0x107')](db[_0xaf6c('0x13e')],{'through':_0xaf6c('0x17c'),'as':_0xaf6c('0x13f')});db['ChatGroup'][_0xaf6c('0xf7')](db[_0xaf6c('0xcb')],{'as':_0xaf6c('0x143'),'foreignKey':'ChatGroupId','onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x65')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x12e'),'through':_0xaf6c('0x17d')});db[_0xaf6c('0x67')][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'as':_0xaf6c('0x179'),'foreignKey':_0xaf6c('0x174')});db['CmCompany']['hasMany'](db[_0xaf6c('0x108')],{'as':'Contacts','foreignKey':_0xaf6c('0x17e')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db['CmHopper'],{'as':_0xaf6c('0x130'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db['CmHopperFinal'],{'as':_0xaf6c('0x132'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db[_0xaf6c('0xfd')],{'as':_0xaf6c('0x133'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x108')]['hasMany'](db[_0xaf6c('0x72')],{'as':_0xaf6c('0x72'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db[_0xaf6c('0xcf')],{'as':_0xaf6c('0x17f'),'foreignKey':'ContactId'});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db[_0xaf6c('0x56')],{'as':_0xaf6c('0xff'),'foreignKey':_0xaf6c('0x149'),'onDelete':_0xaf6c('0x15c')});db['CmContact'][_0xaf6c('0xf7')](db[_0xaf6c('0x5f')],{'as':'ChatInteractions','foreignKey':'ContactId','onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db[_0xaf6c('0x101')],{'as':_0xaf6c('0x110'),'foreignKey':_0xaf6c('0x149'),'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x108')][_0xaf6c('0xf7')](db[_0xaf6c('0x45')],{'as':_0xaf6c('0x102'),'foreignKey':'ContactId','onDelete':'restrict'});db['CmContact'][_0xaf6c('0xf7')](db['MailInteraction'],{'as':_0xaf6c('0x103'),'foreignKey':_0xaf6c('0x149'),'onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x108')][_0xaf6c('0x104')](db[_0xaf6c('0x69')],{'as':_0xaf6c('0x180'),'foreignKey':_0xaf6c('0x17e')});db[_0xaf6c('0x108')][_0xaf6c('0x104')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f'),'onDelete':'cascade'});db['CmContact'][_0xaf6c('0x107')](db['User'],{'as':_0xaf6c('0x158'),'through':_0xaf6c('0x10a')});db['CmContact'][_0xaf6c('0x107')](db['Tag'],{'as':_0xaf6c('0x156'),'through':_0xaf6c('0x181')});db[_0xaf6c('0x108')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':'cm_contact_has_tags','as':_0xaf6c('0x157')});db[_0xaf6c('0x12f')][_0xaf6c('0x104')](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':'ContactId','onDelete':_0xaf6c('0xf5')});db['CmHopper'][_0xaf6c('0x104')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':_0xaf6c('0x14f'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x12f')]['belongsTo'](db[_0xaf6c('0xf2')],{'as':'Agent','foreignKey':_0xaf6c('0xf6')});db[_0xaf6c('0x12f')][_0xaf6c('0x104')](db[_0xaf6c('0x112')],{'as':'Queue','foreignKey':_0xaf6c('0x131'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x12f')]['belongsTo'](db[_0xaf6c('0xdd')],{'as':_0xaf6c('0xdd'),'foreignKey':_0xaf6c('0x182'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x12f')]['belongsTo'](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x163'),'foreignKey':_0xaf6c('0x183')});db['CmHopperBlack']['belongsTo'](db['CmContact'],{'as':_0xaf6c('0x148'),'foreignKey':'ContactId','onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x6d')][_0xaf6c('0x104')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x15e'),'foreignKey':'ListId','onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x6d')][_0xaf6c('0x104')](db[_0xaf6c('0x112')],{'as':_0xaf6c('0x177'),'foreignKey':_0xaf6c('0x131'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x6d')][_0xaf6c('0x104')](db[_0xaf6c('0xdd')],{'as':_0xaf6c('0xdd'),'foreignKey':'CampaignId','onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0x76')][_0xaf6c('0xf7')](db[_0xaf6c('0x7a')],{'as':{'plural':'All','singular':_0xaf6c('0x184')},'foreignKey':_0xaf6c('0x185'),'onDelete':'cascade','hooks':!![]});db['Automation']['hasMany'](db[_0xaf6c('0x7a')],{'as':{'plural':_0xaf6c('0x186'),'singular':_0xaf6c('0x187')},'foreignKey':'AutomationAnyId','onDelete':_0xaf6c('0xf5'),'hooks':!![]});db[_0xaf6c('0x76')]['hasMany'](db[_0xaf6c('0x74')],{'as':_0xaf6c('0x188'),'foreignKey':_0xaf6c('0x189'),'onDelete':_0xaf6c('0xf5'),'hooks':!![]});db[_0xaf6c('0x7c')][_0xaf6c('0xf7')](db[_0xaf6c('0x7c')],{'as':_0xaf6c('0x18a'),'foreignKey':'IntervalId','onDelete':_0xaf6c('0xf5'),'hooks':!![],'required':![]});db[_0xaf6c('0x7c')][_0xaf6c('0xf7')](db['VoiceExtension'],{'as':_0xaf6c('0xfc'),'foreignKey':_0xaf6c('0x139'),'onDelete':_0xaf6c('0x15c')});db['Interval']['hasMany'](db[_0xaf6c('0x3d')],{'as':_0xaf6c('0x18b'),'foreignKey':_0xaf6c('0x139')});db[_0xaf6c('0x7c')][_0xaf6c('0xf7')](db[_0xaf6c('0x176')],{'as':_0xaf6c('0x18c'),'foreignKey':_0xaf6c('0x139')});db[_0xaf6c('0x7c')]['hasMany'](db[_0xaf6c('0x43')],{'as':_0xaf6c('0x18d'),'foreignKey':_0xaf6c('0x139')});db['Interval'][_0xaf6c('0xf7')](db[_0xaf6c('0x168')],{'as':_0xaf6c('0x18e'),'foreignKey':_0xaf6c('0x139')});db['Schedule']['belongsTo'](db[_0xaf6c('0x36')],{});db['Schedule'][_0xaf6c('0x104')](db['AnalyticDefaultReport'],{'foreignKey':_0xaf6c('0x18f')});db[_0xaf6c('0x83')][_0xaf6c('0x104')](db[_0xaf6c('0x8e')],{'foreignKey':_0xaf6c('0x190')});db[_0xaf6c('0x12b')][_0xaf6c('0x107')](db[_0xaf6c('0x19')],{'as':'Mohs','through':'moh_has_sounds','onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0x86')][_0xaf6c('0x107')](db[_0xaf6c('0x108')],{'through':_0xaf6c('0x181')});db[_0xaf6c('0x86')]['belongsToMany'](db[_0xaf6c('0x5f')],{'through':'chat_interaction_has_tags'});db[_0xaf6c('0x86')][_0xaf6c('0x107')](db['MailInteraction'],{'through':_0xaf6c('0x155')});db['Tag']['belongsToMany'](db[_0xaf6c('0x101')],{'through':_0xaf6c('0x16a')});db[_0xaf6c('0x86')][_0xaf6c('0x107')](db['FaxInteraction'],{'through':_0xaf6c('0x164')});db[_0xaf6c('0x86')][_0xaf6c('0x107')](db[_0xaf6c('0x56')],{'through':_0xaf6c('0x172')});db[_0xaf6c('0x8a')][_0xaf6c('0xf7')](db[_0xaf6c('0x7a')],{'as':{'plural':_0xaf6c('0x191'),'singular':_0xaf6c('0x192')},'foreignKey':_0xaf6c('0x193'),'onDelete':_0xaf6c('0xf5'),'hooks':!![]});db[_0xaf6c('0x8a')][_0xaf6c('0xf7')](db[_0xaf6c('0x7a')],{'as':{'plural':_0xaf6c('0x194'),'singular':'AnyCondition'},'foreignKey':_0xaf6c('0x195'),'onDelete':_0xaf6c('0xf5'),'hooks':!![]});db['Trigger'][_0xaf6c('0xf7')](db[_0xaf6c('0x74')],{'as':_0xaf6c('0x188'),'foreignKey':_0xaf6c('0x196'),'onDelete':'cascade','hooks':!![]});db[_0xaf6c('0x8e')]['hasMany'](db[_0xaf6c('0x96')],{'as':'Fields','onDelete':'cascade','foreignKey':'CustomReportId','hooks':!![]});db[_0xaf6c('0x90')][_0xaf6c('0xf7')](db[_0xaf6c('0x96')],{'as':_0xaf6c('0x197'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x18f')});db['AnalyticMetric'][_0xaf6c('0xf7')](db[_0xaf6c('0x96')],{'as':_0xaf6c('0x197'),'onDelete':'cascade','foreignKey':_0xaf6c('0x198')});db[_0xaf6c('0x96')][_0xaf6c('0x104')](db['AnalyticMetric'],{'foreignKey':'MetricId'});db[_0xaf6c('0x9a')]['hasMany'](db[_0xaf6c('0x9c')],{'as':_0xaf6c('0x199'),'onDelete':'cascade','foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0x9c')]['hasMany'](db[_0xaf6c('0x9e')],{'as':_0xaf6c('0x19b'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x9c')][_0xaf6c('0xf7')](db[_0xaf6c('0x9e')],{'as':_0xaf6c('0x19d'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19e')});db['SalesforceConfiguration']['hasMany'](db[_0xaf6c('0x9e')],{'as':_0xaf6c('0x197'),'onDelete':'cascade','foreignKey':_0xaf6c('0x19f')});db['SalesforceConfiguration'][_0xaf6c('0x104')](db['SalesforceAccount'],{'as':_0xaf6c('0x154'),'foreignKey':'AccountId'});db[_0xaf6c('0x9e')][_0xaf6c('0xf7')](db[_0xaf6c('0x9e')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x9e')][_0xaf6c('0xf7')](db[_0xaf6c('0x9e')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0x9e')][_0xaf6c('0xf7')](db[_0xaf6c('0x9e')],{'as':'Field','foreignKey':_0xaf6c('0x19f')});db['SalesforceField'][_0xaf6c('0x104')](db[_0xaf6c('0x1a2')],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xa0')][_0xaf6c('0xf7')](db[_0xaf6c('0xa2')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':'AccountId'});db[_0xaf6c('0xa2')][_0xaf6c('0xf7')](db['SugarcrmField'],{'as':'Subjects','onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xa2')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a4')],{'as':_0xaf6c('0x19d'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19e')});db['SugarcrmConfiguration'][_0xaf6c('0xf7')](db[_0xaf6c('0x1a4')],{'as':_0xaf6c('0x197'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xa2')][_0xaf6c('0x104')](db['SugarcrmAccount'],{'as':'Account','foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0x1a4')]['hasMany'](db[_0xaf6c('0x1a4')],{'as':'Subject','foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x1a4')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a4')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0x1a4')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a4')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db['SugarcrmField'][_0xaf6c('0x104')](db['Variable'],{'as':'Variable','foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xa4')][_0xaf6c('0xf7')](db[_0xaf6c('0xa5')],{'as':_0xaf6c('0x199'),'onDelete':'cascade','foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0xa5')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a6')],{'as':_0xaf6c('0x19b'),'onDelete':_0xaf6c('0xf5'),'foreignKey':'SubjectId'});db['DeskConfiguration'][_0xaf6c('0xf7')](db['DeskField'],{'as':_0xaf6c('0x19d'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xa5')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a6')],{'as':_0xaf6c('0x197'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xa5')][_0xaf6c('0x104')](db[_0xaf6c('0xa4')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0xa5')]['belongsToMany'](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x1a7')});db[_0xaf6c('0x1a6')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a6')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x1a6')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a6')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db['DeskField'][_0xaf6c('0xf7')](db[_0xaf6c('0x1a6')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0x1a6')][_0xaf6c('0x104')](db[_0xaf6c('0x1a2')],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xa8')][_0xaf6c('0xf7')](db[_0xaf6c('0xa9')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db['ZohoConfiguration'][_0xaf6c('0xf7')](db[_0xaf6c('0xab')],{'as':_0xaf6c('0x19b'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xa9')][_0xaf6c('0xf7')](db['ZohoField'],{'as':'Descriptions','onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19e')});db['ZohoConfiguration'][_0xaf6c('0xf7')](db['ZohoField'],{'as':_0xaf6c('0x197'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xa9')]['belongsTo'](db[_0xaf6c('0xa8')],{'as':'Account','foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0xab')][_0xaf6c('0xf7')](db['ZohoField'],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xab')][_0xaf6c('0xf7')](db[_0xaf6c('0xab')],{'as':_0xaf6c('0x1a1'),'foreignKey':'DescriptionId'});db[_0xaf6c('0xab')][_0xaf6c('0xf7')](db[_0xaf6c('0xab')],{'as':'Field','foreignKey':'FieldId'});db[_0xaf6c('0xab')][_0xaf6c('0x104')](db[_0xaf6c('0x1a2')],{'as':'Variable','foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xac')][_0xaf6c('0xf7')](db[_0xaf6c('0x1a8')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db['ZendeskConfiguration'][_0xaf6c('0xf7')](db[_0xaf6c('0xaf')],{'as':_0xaf6c('0x19b'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x1a8')][_0xaf6c('0xf7')](db[_0xaf6c('0xaf')],{'as':_0xaf6c('0x19d'),'foreignKey':'DescriptionId'});db[_0xaf6c('0x1a8')]['hasMany'](db[_0xaf6c('0xaf')],{'as':_0xaf6c('0x197'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0x1a8')][_0xaf6c('0x104')](db[_0xaf6c('0xac')],{'as':_0xaf6c('0x154'),'foreignKey':'AccountId'});db[_0xaf6c('0x1a8')]['belongsToMany'](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x1a9')});db[_0xaf6c('0xaf')]['hasMany'](db[_0xaf6c('0xaf')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xaf')][_0xaf6c('0xf7')](db[_0xaf6c('0xaf')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xaf')][_0xaf6c('0xf7')](db[_0xaf6c('0xaf')],{'as':'Field','foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xaf')][_0xaf6c('0x104')](db['Variable'],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xb1')]['hasMany'](db[_0xaf6c('0xb2')],{'as':_0xaf6c('0x199'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0xaf6c('0xb2')]['hasMany'](db[_0xaf6c('0xb3')],{'as':_0xaf6c('0x19b'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xb2')][_0xaf6c('0xf7')](db[_0xaf6c('0xb3')],{'as':_0xaf6c('0x19d'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xb2')][_0xaf6c('0xf7')](db[_0xaf6c('0xb3')],{'as':'Fields','onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xb2')][_0xaf6c('0x104')](db['FreshdeskAccount'],{'as':_0xaf6c('0x154'),'foreignKey':'AccountId'});db[_0xaf6c('0xb2')][_0xaf6c('0x107')](db[_0xaf6c('0x86')],{'through':_0xaf6c('0x1aa')});db['FreshdeskField'][_0xaf6c('0xf7')](db['FreshdeskField'],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db['FreshdeskField'][_0xaf6c('0xf7')](db['FreshdeskField'],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xb3')]['hasMany'](db[_0xaf6c('0xb3')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xb3')][_0xaf6c('0x104')](db[_0xaf6c('0x1a2')],{'as':'Variable','foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xb5')][_0xaf6c('0xf7')](db[_0xaf6c('0xb7')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0xb7')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':_0xaf6c('0x19b'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xb7')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':_0xaf6c('0x19d'),'foreignKey':'DescriptionId'});db['VtigerConfiguration'][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':'Fields','foreignKey':_0xaf6c('0x19f')});db['VtigerConfiguration'][_0xaf6c('0x104')](db[_0xaf6c('0xb5')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0x1ab')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0x1ab')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0x1ab')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ab')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db['VtigerField']['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xb9')][_0xaf6c('0xf7')](db['ServicenowConfiguration'],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db['ServicenowConfiguration'][_0xaf6c('0xf7')](db['ServicenowField'],{'as':_0xaf6c('0x19b'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xbb')][_0xaf6c('0xf7')](db[_0xaf6c('0xbd')],{'as':_0xaf6c('0x19d'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xbb')][_0xaf6c('0xf7')](db[_0xaf6c('0xbd')],{'as':_0xaf6c('0x197'),'foreignKey':_0xaf6c('0x19f')});db['ServicenowConfiguration'][_0xaf6c('0x104')](db['ServicenowAccount'],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x19a')});db['ServicenowField']['hasMany'](db[_0xaf6c('0xbd')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xbd')][_0xaf6c('0xf7')](db[_0xaf6c('0xbd')],{'as':'Description','foreignKey':_0xaf6c('0x19e')});db['ServicenowField'][_0xaf6c('0xf7')](db[_0xaf6c('0xbd')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db['ServicenowField']['belongsTo'](db[_0xaf6c('0x1a2')],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0x1ac')]['hasMany'](db[_0xaf6c('0xbf')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db['Dynamics365Configuration'][_0xaf6c('0xf7')](db[_0xaf6c('0xc1')],{'as':_0xaf6c('0x19b'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xbf')][_0xaf6c('0xf7')](db[_0xaf6c('0xc1')],{'as':_0xaf6c('0x19d'),'onDelete':'cascade','foreignKey':_0xaf6c('0x19e')});db['Dynamics365Configuration'][_0xaf6c('0xf7')](db['Dynamics365Field'],{'as':_0xaf6c('0x197'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19f')});db[_0xaf6c('0xbf')][_0xaf6c('0x104')](db[_0xaf6c('0x1ac')],{'as':_0xaf6c('0x154'),'foreignKey':_0xaf6c('0x19a')});db[_0xaf6c('0xc1')][_0xaf6c('0xf7')](db[_0xaf6c('0xc1')],{'as':_0xaf6c('0x1a0'),'foreignKey':_0xaf6c('0x19c')});db['Dynamics365Field'][_0xaf6c('0xf7')](db[_0xaf6c('0xc1')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xc1')]['hasMany'](db['Dynamics365Field'],{'as':_0xaf6c('0x1a5'),'foreignKey':'FieldId'});db[_0xaf6c('0xc1')][_0xaf6c('0x104')](db[_0xaf6c('0x1a2')],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xc2')][_0xaf6c('0xf7')](db[_0xaf6c('0xc4')],{'as':_0xaf6c('0x199'),'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x19a')});db['FreshsalesConfiguration'][_0xaf6c('0xf7')](db[_0xaf6c('0x1ad')],{'as':_0xaf6c('0x19b'),'foreignKey':_0xaf6c('0x19c')});db[_0xaf6c('0xc4')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ad')],{'as':'Descriptions','foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0xc4')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ad')],{'as':_0xaf6c('0x197'),'foreignKey':'FieldId'});db[_0xaf6c('0xc4')][_0xaf6c('0x104')](db[_0xaf6c('0xc2')],{'as':_0xaf6c('0x154'),'foreignKey':'AccountId'});db['FreshsalesField']['hasMany'](db[_0xaf6c('0x1ad')],{'as':_0xaf6c('0x1a0'),'foreignKey':'SubjectId'});db[_0xaf6c('0x1ad')]['hasMany'](db[_0xaf6c('0x1ad')],{'as':_0xaf6c('0x1a1'),'foreignKey':_0xaf6c('0x19e')});db[_0xaf6c('0x1ad')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ad')],{'as':_0xaf6c('0x1a5'),'foreignKey':_0xaf6c('0x19f')});db['FreshsalesField']['belongsTo'](db['Variable'],{'as':_0xaf6c('0x1a2'),'foreignKey':_0xaf6c('0x1a3')});db[_0xaf6c('0xca')]['belongsTo'](db['ChatWebsite'],{});db[_0xaf6c('0xca')]['belongsTo'](db['CmList'],{'as':_0xaf6c('0x15e'),'foreignKey':'ListId'});db[_0xaf6c('0xca')]['belongsTo'](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0xca')][_0xaf6c('0x104')](db[_0xaf6c('0x5f')],{});db[_0xaf6c('0xca')]['belongsTo'](db[_0xaf6c('0x61')],{});db[_0xaf6c('0xca')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{});db[_0xaf6c('0xca')][_0xaf6c('0x104')](db['ChatQueue'],{});db[_0xaf6c('0xcb')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x1ae')});db['ChatInternalMessage'][_0xaf6c('0x104')](db['User'],{'onDelete':_0xaf6c('0xf5'),'foreignKey':_0xaf6c('0x1af')});db[_0xaf6c('0xcf')][_0xaf6c('0xf7')](db[_0xaf6c('0x1b0')],{'foreignKey':'SessionId','onDelete':_0xaf6c('0xf5')});db['JscriptySessionReport'][_0xaf6c('0xf7')](db[_0xaf6c('0x1b1')],{'foreignKey':_0xaf6c('0x1b2'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0xd0')][_0xaf6c('0x104')](db[_0xaf6c('0x4c')],{});db['SmsQueueReport'][_0xaf6c('0x104')](db['CmList'],{'as':'List','foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0xd0')]['belongsTo'](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x148'),'foreignKey':_0xaf6c('0x149')});db[_0xaf6c('0xd0')][_0xaf6c('0x104')](db[_0xaf6c('0x101')],{});db[_0xaf6c('0xd0')][_0xaf6c('0x104')](db[_0xaf6c('0x166')],{});db['SmsQueueReport'][_0xaf6c('0x104')](db['User'],{});db[_0xaf6c('0xd0')][_0xaf6c('0x104')](db[_0xaf6c('0x50')],{});db[_0xaf6c('0x1b3')][_0xaf6c('0xf7')](db[_0xaf6c('0xcf')],{'foreignKey':_0xaf6c('0x1b4')});db['JscriptyProject']['hasMany'](db[_0xaf6c('0x1b0')],{'foreignKey':'ProjectId'});db[_0xaf6c('0x1b3')][_0xaf6c('0xf7')](db['JscriptyAnswerReport'],{'foreignKey':_0xaf6c('0x1b4')});db['SquareProject'][_0xaf6c('0x107')](db['User'],{'as':_0xaf6c('0x158'),'through':_0xaf6c('0x1b5')});db[_0xaf6c('0x13e')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x1b6')});db['Team'][_0xaf6c('0x107')](db[_0xaf6c('0x112')],{'through':_0xaf6c('0x140'),'as':_0xaf6c('0x113')});db[_0xaf6c('0x13e')]['belongsToMany'](db[_0xaf6c('0x37')],{'through':'team_has_mail_queues','as':_0xaf6c('0x114')});db[_0xaf6c('0x13e')][_0xaf6c('0x107')](db[_0xaf6c('0x116')],{'through':_0xaf6c('0x17c'),'as':_0xaf6c('0x117')});db['Team'][_0xaf6c('0x107')](db[_0xaf6c('0x49')],{'through':_0xaf6c('0x1b7'),'as':'FaxQueues'});db[_0xaf6c('0x13e')]['belongsToMany'](db['SmsQueue'],{'through':_0xaf6c('0x1b8'),'as':'SmsQueues'});db[_0xaf6c('0x13e')][_0xaf6c('0x107')](db[_0xaf6c('0x58')],{'through':_0xaf6c('0x173'),'as':'OpenchannelQueues'});db[_0xaf6c('0xdd')][_0xaf6c('0xf7')](db[_0xaf6c('0x12f')],{'as':_0xaf6c('0x130'),'foreignKey':_0xaf6c('0x182')});db['Campaign'][_0xaf6c('0xf7')](db[_0xaf6c('0x6f')],{'as':_0xaf6c('0x132'),'foreignKey':_0xaf6c('0x182')});db[_0xaf6c('0xdd')][_0xaf6c('0xf7')](db[_0xaf6c('0xfd')],{'as':_0xaf6c('0x133'),'foreignKey':_0xaf6c('0x182')});db['Campaign'][_0xaf6c('0xf7')](db[_0xaf6c('0x6d')],{'as':_0xaf6c('0x134'),'foreignKey':_0xaf6c('0x182')});db[_0xaf6c('0xdd')][_0xaf6c('0x104')](db['Trunk'],{'as':'Trunk','foreignKey':_0xaf6c('0x136')});db['Campaign'][_0xaf6c('0x104')](db[_0xaf6c('0x135')],{'as':_0xaf6c('0x137'),'foreignKey':_0xaf6c('0x138')});db['Campaign'][_0xaf6c('0x104')](db[_0xaf6c('0x7c')],{'as':_0xaf6c('0x7c'),'foreignKey':_0xaf6c('0x139')});db[_0xaf6c('0xdd')][_0xaf6c('0x104')](db[_0xaf6c('0x127')],{'as':_0xaf6c('0x127'),'foreignKey':_0xaf6c('0x1b9')});db['Campaign'][_0xaf6c('0x107')](db['CmList'],{'as':_0xaf6c('0x10b'),'through':_0xaf6c('0x1ba')});db[_0xaf6c('0xdd')][_0xaf6c('0x107')](db[_0xaf6c('0xe9')],{'as':_0xaf6c('0x141'),'through':'campaigns_has_cm_blacklists'});db['MailTransferReport'][_0xaf6c('0x104')](db['MailMessage'],{});db['MailTransferReport']['belongsTo'](db['MailInteraction'],{});db[_0xaf6c('0x1bb')][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'foreignKey':_0xaf6c('0x1bc'),'as':'FromAccount'});db[_0xaf6c('0x1bb')][_0xaf6c('0x104')](db['User'],{'foreignKey':_0xaf6c('0x1bd'),'as':_0xaf6c('0x1be')});db[_0xaf6c('0x1bb')]['belongsTo'](db[_0xaf6c('0xf2')],{'foreignKey':_0xaf6c('0x1bf'),'as':_0xaf6c('0x1c0')});db[_0xaf6c('0x1bb')][_0xaf6c('0x104')](db['MailQueue'],{'foreignKey':_0xaf6c('0x1c1'),'as':_0xaf6c('0x1c2')});db[_0xaf6c('0x1bb')][_0xaf6c('0x104')](db[_0xaf6c('0x36')],{'foreignKey':_0xaf6c('0x1c3'),'as':_0xaf6c('0x1c4')});db[_0xaf6c('0x1c5')]['belongsTo'](db['ChatMessage'],{});db[_0xaf6c('0x1c5')][_0xaf6c('0x104')](db['ChatInteraction'],{});db[_0xaf6c('0x1c5')][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'foreignKey':_0xaf6c('0x1c6'),'as':'FromAccount'});db['ChatTransferReport'][_0xaf6c('0x104')](db['User'],{'foreignKey':_0xaf6c('0x1bd'),'as':_0xaf6c('0x1be')});db[_0xaf6c('0x1c5')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'foreignKey':_0xaf6c('0x1bf'),'as':_0xaf6c('0x1c0')});db[_0xaf6c('0x1c5')][_0xaf6c('0x104')](db[_0xaf6c('0x116')],{'foreignKey':'ToChatQueueId','as':_0xaf6c('0x1c2')});db[_0xaf6c('0x1c5')][_0xaf6c('0x104')](db[_0xaf6c('0x5a')],{'foreignKey':_0xaf6c('0x1c7'),'as':_0xaf6c('0x1c4')});db[_0xaf6c('0xe5')][_0xaf6c('0x104')](db[_0xaf6c('0x47')],{});db['FaxTransferReport'][_0xaf6c('0x104')](db['FaxInteraction'],{});db[_0xaf6c('0xe5')][_0xaf6c('0x104')](db[_0xaf6c('0x42')],{'foreignKey':'FromFaxAccountId','as':'FromAccount'});db[_0xaf6c('0xe5')][_0xaf6c('0x104')](db['User'],{'foreignKey':_0xaf6c('0x1bd'),'as':_0xaf6c('0x1be')});db[_0xaf6c('0xe5')]['belongsTo'](db[_0xaf6c('0xf2')],{'foreignKey':'ToUserId','as':_0xaf6c('0x1c0')});db['FaxTransferReport'][_0xaf6c('0x104')](db[_0xaf6c('0x49')],{'foreignKey':'ToFaxQueueId','as':'ToQueue'});db['FaxTransferReport'][_0xaf6c('0x104')](db['FaxAccount'],{'foreignKey':_0xaf6c('0x1c8'),'as':_0xaf6c('0x1c4')});db['OpenchannelTransferReport'][_0xaf6c('0x104')](db['OpenchannelMessage'],{});db[_0xaf6c('0x1c9')][_0xaf6c('0x104')](db['OpenchannelInteraction'],{});db[_0xaf6c('0x1c9')][_0xaf6c('0x104')](db[_0xaf6c('0x52')],{'foreignKey':_0xaf6c('0x1ca'),'as':'FromAccount'});db[_0xaf6c('0x1c9')]['belongsTo'](db[_0xaf6c('0xf2')],{'foreignKey':'FromUserId','as':_0xaf6c('0x1be')});db[_0xaf6c('0x1c9')][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'foreignKey':_0xaf6c('0x1bf'),'as':_0xaf6c('0x1c0')});db['OpenchannelTransferReport'][_0xaf6c('0x104')](db[_0xaf6c('0x58')],{'foreignKey':_0xaf6c('0x1cb'),'as':_0xaf6c('0x1c2')});db[_0xaf6c('0x1c9')]['belongsTo'](db[_0xaf6c('0x52')],{'foreignKey':'ToOpenchannelAccountId','as':_0xaf6c('0x1c4')});db[_0xaf6c('0xe7')][_0xaf6c('0x104')](db[_0xaf6c('0x166')],{});db[_0xaf6c('0xe7')][_0xaf6c('0x104')](db['SmsInteraction'],{});db[_0xaf6c('0xe7')][_0xaf6c('0x104')](db[_0xaf6c('0x4c')],{'foreignKey':_0xaf6c('0x1cc'),'as':'FromAccount'});db['SmsTransferReport']['belongsTo'](db['User'],{'foreignKey':_0xaf6c('0x1bd'),'as':'FromAgent'});db['SmsTransferReport'][_0xaf6c('0x104')](db[_0xaf6c('0xf2')],{'foreignKey':_0xaf6c('0x1bf'),'as':_0xaf6c('0x1c0')});db[_0xaf6c('0xe7')][_0xaf6c('0x104')](db[_0xaf6c('0x50')],{'foreignKey':'ToSmsQueueId','as':'ToQueue'});db[_0xaf6c('0xe7')][_0xaf6c('0x104')](db['SmsAccount'],{'foreignKey':_0xaf6c('0x1cd'),'as':_0xaf6c('0x1c4')});db[_0xaf6c('0xe9')]['hasMany'](db[_0xaf6c('0x79')],{'as':_0xaf6c('0x16d'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0xe9')][_0xaf6c('0xf7')](db[_0xaf6c('0x1ce')],{'as':_0xaf6c('0x1cf'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0xe9')]['hasMany'](db[_0xaf6c('0x108')],{'as':_0xaf6c('0x109'),'onDelete':_0xaf6c('0xf5'),'foreignKey':'ListId'});db[_0xaf6c('0xe9')][_0xaf6c('0xf7')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0xe9')][_0xaf6c('0xf7')](db[_0xaf6c('0xfd')],{'as':_0xaf6c('0xfe'),'foreignKey':_0xaf6c('0x14f')});db[_0xaf6c('0xe9')][_0xaf6c('0xf7')](db[_0xaf6c('0x72')],{'as':_0xaf6c('0x72'),'foreignKey':'ListId'});db[_0xaf6c('0xe9')][_0xaf6c('0x107')](db[_0xaf6c('0x112')],{'as':'Queues','through':_0xaf6c('0x13c')});db[_0xaf6c('0xe9')][_0xaf6c('0x107')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x13d'),'through':'cm_user_has_lists'});db[_0xaf6c('0xeb')][_0xaf6c('0xf7')](db['VoiceExtension'],{'as':'Extensions','onDelete':_0xaf6c('0x15c')});db[_0xaf6c('0xeb')]['belongsToMany'](db['User'],{'as':_0xaf6c('0x13d'),'through':_0xaf6c('0x11d')});db[_0xaf6c('0xed')][_0xaf6c('0xf7')](db[_0xaf6c('0xf2')],{'as':_0xaf6c('0x158'),'foreignKey':_0xaf6c('0x105')});db['UserProfile'][_0xaf6c('0xf7')](db[_0xaf6c('0xee')],{'as':'UserProfileSections','foreignKey':_0xaf6c('0x105'),'onDelete':_0xaf6c('0xf5')});db[_0xaf6c('0xee')]['hasMany'](db[_0xaf6c('0xf0')],{'as':_0xaf6c('0x1d0'),'foreignKey':_0xaf6c('0x1d1'),'onDelete':_0xaf6c('0xf5')});module[_0xaf6c('0x1d2')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index fbb2306..76b263c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2133=['/api/members/reports','./api/trunk','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsInteraction','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','./api/openchannelInteraction','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','./api/cmContact','/api/cm/hopper_black','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','/api/dispositions','./api/disposition','/api/conditions','./api/condition','/api/intervals','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/schedules','./api/schedule','/api/sounds','./api/sound','/api/templates','./api/template','/api/triggers','./api/trigger','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','/api/integrations/sugarcrm/configurations','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','/api/integrations/desk/configurations','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','/api/integrations/freshsales/fields','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','./api/smsQueueReport','/api/square/reports','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','./api/team','./api/license','/api/campaigns','./api/campaign','/api/migrations','./api/migration','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','./api/chatTransferReport','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','./api/smsTransferReport','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/resources','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','./api/rpc','/api/system','/api/pm2','./api/pm2','static','join','root','/www','snippet','1.0.16','/server/files/plugins','route','get','sendFile','resolve','appPath','express','express-winston','./errors','./config/environment','./config/logger','api','auth','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','statusCode','responseTime','user','name','role','use','logger','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','agent_name','test','/api/users','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','./api/voiceMusicOnHold','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport'];(function(_0x46846d,_0x450948){var _0x355fd8=function(_0x344948){while(--_0x344948){_0x46846d['push'](_0x46846d['shift']());}};_0x355fd8(++_0x450948);}(_0x2133,0x1e0));var _0x3213=function(_0x9d6f53,_0x3b4dd6){_0x9d6f53=_0x9d6f53-0x0;var _0x284ea9=_0x2133[_0x9d6f53];return _0x284ea9;};'use strict';var path=require('path');var express=require(_0x3213('0x0'));var ewinston=require(_0x3213('0x1'));var util=require('util');var errors=require(_0x3213('0x2'));var config=require(_0x3213('0x3'));var logger=require(_0x3213('0x4'))(_0x3213('0x5'));var authLogger=require(_0x3213('0x4'))(_0x3213('0x6'));exports['default']=function(_0x493e71){_0x493e71['use'](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x359c1f,_0x312ea2){return util[_0x3213('0x7')](_0x3213('0x8'),_0x359c1f[_0x3213('0x9')],_0x359c1f[_0x3213('0xa')][_0x3213('0xb')]?_0x359c1f[_0x3213('0xa')][_0x3213('0xb')]:_0x359c1f[_0x3213('0xc')][_0x3213('0xd')]||_0x359c1f['ip'],_0x359c1f[_0x3213('0xe')],_0x312ea2[_0x3213('0xf')],_0x312ea2[_0x3213('0x10')],_0x359c1f[_0x3213('0x11')]?_0x359c1f['user']['id']:null,_0x359c1f[_0x3213('0x11')]?_0x359c1f['user'][_0x3213('0x12')]:null,_0x359c1f['user']?_0x359c1f[_0x3213('0x11')][_0x3213('0x13')]:null);}}));_0x493e71[_0x3213('0x14')](ewinston[_0x3213('0x15')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x3b5463,_0x9719ce){var _0x462664=_0x3213('0x16');if(_0x3b5463[_0x3213('0x17')]&&_0x3b5463[_0x3213('0x17')][_0x3213('0x18')]&&_0x3b5463[_0x3213('0x17')][_0x3213('0x19')]){_0x462664=_0x3213('0x1a');}return util[_0x3213('0x7')](_0x462664,_0x3b5463[_0x3213('0x9')],_0x3b5463['headers']['x-forwarded-for']?_0x3b5463[_0x3213('0xa')][_0x3213('0xb')]:_0x3b5463['connection'][_0x3213('0xd')]||_0x3b5463['ip'],_0x3b5463[_0x3213('0xe')],_0x9719ce[_0x3213('0xf')],_0x9719ce[_0x3213('0x10')],_0x3b5463[_0x3213('0x11')]?_0x3b5463['user']['id']:null,_0x3b5463['user']?_0x3b5463[_0x3213('0x11')][_0x3213('0x12')]:null,_0x3b5463[_0x3213('0x11')]?_0x3b5463[_0x3213('0x11')][_0x3213('0x13')]:null,_0x3b5463[_0x3213('0x17')]&&_0x3b5463[_0x3213('0x17')][_0x3213('0x18')]?_0x3b5463[_0x3213('0x17')]['device']:'other',_0x3b5463[_0x3213('0x17')]&&_0x3b5463['body'][_0x3213('0x19')]?_0x3b5463['body'][_0x3213('0x19')]:'',_0x3b5463[_0x3213('0x17')]&&_0x3b5463[_0x3213('0x17')][_0x3213('0x1b')]?_0x3b5463[_0x3213('0x17')][_0x3213('0x1b')]:'');},'ignoreRoute':function(_0x570a1d){var _0x17c875=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x17c875[_0x3213('0x1c')](_0x570a1d[_0x3213('0xe')]);}}));_0x493e71[_0x3213('0x14')](_0x3213('0x1d'),require('./api/user'));_0x493e71[_0x3213('0x14')]('/api/voice/chanspy',require(_0x3213('0x1e')));_0x493e71['use'](_0x3213('0x1f'),require(_0x3213('0x20')));_0x493e71[_0x3213('0x14')](_0x3213('0x21'),require(_0x3213('0x22')));_0x493e71[_0x3213('0x14')](_0x3213('0x23'),require(_0x3213('0x24')));_0x493e71[_0x3213('0x14')](_0x3213('0x25'),require(_0x3213('0x26')));_0x493e71['use'](_0x3213('0x27'),require('./api/voiceRecording'));_0x493e71[_0x3213('0x14')](_0x3213('0x28'),require(_0x3213('0x29')));_0x493e71['use']('/api/voice/mails',require(_0x3213('0x2a')));_0x493e71[_0x3213('0x14')]('/api/voice/mails/messages',require(_0x3213('0x2b')));_0x493e71[_0x3213('0x14')](_0x3213('0x2c'),require(_0x3213('0x2d')));_0x493e71[_0x3213('0x14')](_0x3213('0x2e'),require(_0x3213('0x2f')));_0x493e71[_0x3213('0x14')](_0x3213('0x30'),require(_0x3213('0x31')));_0x493e71[_0x3213('0x14')]('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x493e71[_0x3213('0x14')](_0x3213('0x32'),require('./api/memberReport'));_0x493e71['use']('/api/trunks',require(_0x3213('0x33')));_0x493e71[_0x3213('0x14')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x493e71[_0x3213('0x14')](_0x3213('0x34'),require(_0x3213('0x35')));_0x493e71[_0x3213('0x14')](_0x3213('0x36'),require(_0x3213('0x37')));_0x493e71['use']('/api/mail/queues',require(_0x3213('0x38')));_0x493e71['use'](_0x3213('0x39'),require(_0x3213('0x3a')));_0x493e71[_0x3213('0x14')](_0x3213('0x3b'),require(_0x3213('0x3c')));_0x493e71['use'](_0x3213('0x3d'),require(_0x3213('0x3e')));_0x493e71['use'](_0x3213('0x3f'),require(_0x3213('0x40')));_0x493e71[_0x3213('0x14')](_0x3213('0x41'),require(_0x3213('0x42')));_0x493e71[_0x3213('0x14')](_0x3213('0x43'),require(_0x3213('0x44')));_0x493e71[_0x3213('0x14')](_0x3213('0x45'),require('./api/dashboardItem'));_0x493e71[_0x3213('0x14')](_0x3213('0x46'),require(_0x3213('0x47')));_0x493e71[_0x3213('0x14')](_0x3213('0x48'),require(_0x3213('0x49')));_0x493e71[_0x3213('0x14')]('/api/fax/interactions',require(_0x3213('0x4a')));_0x493e71[_0x3213('0x14')](_0x3213('0x4b'),require(_0x3213('0x4c')));_0x493e71[_0x3213('0x14')](_0x3213('0x4d'),require(_0x3213('0x4e')));_0x493e71['use'](_0x3213('0x4f'),require(_0x3213('0x50')));_0x493e71['use']('/api/sms/accounts',require('./api/smsAccount'));_0x493e71[_0x3213('0x14')]('/api/sms/applications',require('./api/smsApplication'));_0x493e71[_0x3213('0x14')]('/api/sms/interactions',require(_0x3213('0x51')));_0x493e71[_0x3213('0x14')]('/api/sms/messages',require(_0x3213('0x52')));_0x493e71[_0x3213('0x14')](_0x3213('0x53'),require('./api/smsQueue'));_0x493e71[_0x3213('0x14')](_0x3213('0x54'),require(_0x3213('0x55')));_0x493e71[_0x3213('0x14')](_0x3213('0x56'),require(_0x3213('0x57')));_0x493e71[_0x3213('0x14')](_0x3213('0x58'),require(_0x3213('0x59')));_0x493e71[_0x3213('0x14')]('/api/openchannel/messages',require(_0x3213('0x5a')));_0x493e71[_0x3213('0x14')](_0x3213('0x5b'),require(_0x3213('0x5c')));_0x493e71[_0x3213('0x14')](_0x3213('0x5d'),require(_0x3213('0x5e')));_0x493e71[_0x3213('0x14')]('/api/openchannel/reports/queue',require(_0x3213('0x5f')));_0x493e71['use']('/api/chat/applications',require('./api/chatApplication'));_0x493e71[_0x3213('0x14')](_0x3213('0x60'),require(_0x3213('0x61')));_0x493e71[_0x3213('0x14')](_0x3213('0x62'),require(_0x3213('0x63')));_0x493e71['use'](_0x3213('0x64'),require(_0x3213('0x65')));_0x493e71[_0x3213('0x14')](_0x3213('0x66'),require(_0x3213('0x67')));_0x493e71[_0x3213('0x14')](_0x3213('0x68'),require(_0x3213('0x69')));_0x493e71[_0x3213('0x14')](_0x3213('0x6a'),require(_0x3213('0x6b')));_0x493e71[_0x3213('0x14')](_0x3213('0x6c'),require(_0x3213('0x6d')));_0x493e71[_0x3213('0x14')]('/api/cm/contacts',require(_0x3213('0x6e')));_0x493e71[_0x3213('0x14')]('/api/cm/hopper',require('./api/cmHopper'));_0x493e71[_0x3213('0x14')](_0x3213('0x6f'),require('./api/cmHopperBlack'));_0x493e71['use'](_0x3213('0x70'),require(_0x3213('0x71')));_0x493e71[_0x3213('0x14')](_0x3213('0x72'),require(_0x3213('0x73')));_0x493e71[_0x3213('0x14')]('/api/cm/custom_fields',require(_0x3213('0x74')));_0x493e71[_0x3213('0x14')](_0x3213('0x75'),require(_0x3213('0x76')));_0x493e71[_0x3213('0x14')](_0x3213('0x77'),require(_0x3213('0x78')));_0x493e71[_0x3213('0x14')](_0x3213('0x79'),require(_0x3213('0x7a')));_0x493e71['use'](_0x3213('0x7b'),require(_0x3213('0x7c')));_0x493e71[_0x3213('0x14')](_0x3213('0x7d'),require(_0x3213('0x7e')));_0x493e71[_0x3213('0x14')](_0x3213('0x7f'),require('./api/interval'));_0x493e71[_0x3213('0x14')](_0x3213('0x80'),require(_0x3213('0x81')));_0x493e71[_0x3213('0x14')](_0x3213('0x82'),require(_0x3213('0x83')));_0x493e71[_0x3213('0x14')]('/api/voiceQueuesLog',require('./api/voiceQueuesLog'));_0x493e71[_0x3213('0x14')](_0x3213('0x84'),require(_0x3213('0x85')));_0x493e71['use'](_0x3213('0x86'),require(_0x3213('0x87')));_0x493e71[_0x3213('0x14')]('/api/tags',require('./api/tag'));_0x493e71[_0x3213('0x14')](_0x3213('0x88'),require(_0x3213('0x89')));_0x493e71[_0x3213('0x14')](_0x3213('0x8a'),require(_0x3213('0x8b')));_0x493e71[_0x3213('0x14')](_0x3213('0x8c'),require(_0x3213('0x8d')));_0x493e71[_0x3213('0x14')](_0x3213('0x8e'),require('./api/integration'));_0x493e71[_0x3213('0x14')](_0x3213('0x8f'),require('./api/integrationReport'));_0x493e71[_0x3213('0x14')](_0x3213('0x90'),require(_0x3213('0x91')));_0x493e71[_0x3213('0x14')](_0x3213('0x92'),require(_0x3213('0x93')));_0x493e71[_0x3213('0x14')](_0x3213('0x94'),require(_0x3213('0x95')));_0x493e71['use']('/api/analytics/metrics',require(_0x3213('0x96')));_0x493e71[_0x3213('0x14')]('/api/analytics/field_reports',require(_0x3213('0x97')));_0x493e71[_0x3213('0x14')](_0x3213('0x98'),require(_0x3213('0x99')));_0x493e71[_0x3213('0x14')](_0x3213('0x9a'),require(_0x3213('0x9b')));_0x493e71[_0x3213('0x14')]('/api/integrations/salesforce/configurations',require('./api/intSalesforceConfiguration'));_0x493e71[_0x3213('0x14')](_0x3213('0x9c'),require(_0x3213('0x9d')));_0x493e71['use'](_0x3213('0x9e'),require('./api/intSugarcrmAccount'));_0x493e71[_0x3213('0x14')](_0x3213('0x9f'),require('./api/intSugarcrmConfiguration'));_0x493e71['use'](_0x3213('0xa0'),require('./api/intSugarcrmField'));_0x493e71[_0x3213('0x14')](_0x3213('0xa1'),require('./api/intDeskAccount'));_0x493e71[_0x3213('0x14')](_0x3213('0xa2'),require('./api/intDeskConfiguration'));_0x493e71[_0x3213('0x14')](_0x3213('0xa3'),require(_0x3213('0xa4')));_0x493e71[_0x3213('0x14')](_0x3213('0xa5'),require(_0x3213('0xa6')));_0x493e71[_0x3213('0x14')](_0x3213('0xa7'),require('./api/intZohoConfiguration'));_0x493e71[_0x3213('0x14')](_0x3213('0xa8'),require(_0x3213('0xa9')));_0x493e71[_0x3213('0x14')](_0x3213('0xaa'),require('./api/intZendeskAccount'));_0x493e71['use'](_0x3213('0xab'),require(_0x3213('0xac')));_0x493e71[_0x3213('0x14')](_0x3213('0xad'),require(_0x3213('0xae')));_0x493e71[_0x3213('0x14')](_0x3213('0xaf'),require(_0x3213('0xb0')));_0x493e71[_0x3213('0x14')](_0x3213('0xb1'),require(_0x3213('0xb2')));_0x493e71[_0x3213('0x14')](_0x3213('0xb3'),require('./api/intFreshdeskField'));_0x493e71[_0x3213('0x14')](_0x3213('0xb4'),require(_0x3213('0xb5')));_0x493e71[_0x3213('0x14')]('/api/integrations/vtiger/configurations',require(_0x3213('0xb6')));_0x493e71['use'](_0x3213('0xb7'),require(_0x3213('0xb8')));_0x493e71[_0x3213('0x14')](_0x3213('0xb9'),require(_0x3213('0xba')));_0x493e71[_0x3213('0x14')]('/api/integrations/servicenow/configurations',require(_0x3213('0xbb')));_0x493e71[_0x3213('0x14')](_0x3213('0xbc'),require(_0x3213('0xbd')));_0x493e71[_0x3213('0x14')](_0x3213('0xbe'),require(_0x3213('0xbf')));_0x493e71['use'](_0x3213('0xc0'),require('./api/intDynamics365Configuration'));_0x493e71['use'](_0x3213('0xc1'),require(_0x3213('0xc2')));_0x493e71[_0x3213('0x14')]('/api/integrations/freshsales/accounts',require(_0x3213('0xc3')));_0x493e71[_0x3213('0x14')](_0x3213('0xc4'),require(_0x3213('0xc5')));_0x493e71['use'](_0x3213('0xc6'),require(_0x3213('0xc7')));_0x493e71[_0x3213('0x14')](_0x3213('0xc8'),require(_0x3213('0xc9')));_0x493e71[_0x3213('0x14')](_0x3213('0xca'),require(_0x3213('0xcb')));_0x493e71[_0x3213('0x14')](_0x3213('0xcc'),require(_0x3213('0xcd')));_0x493e71[_0x3213('0x14')](_0x3213('0xce'),require('./api/jscriptyAnswerReport'));_0x493e71[_0x3213('0x14')](_0x3213('0xcf'),require(_0x3213('0xd0')));_0x493e71[_0x3213('0x14')]('/api/jscripty/sessions/reports',require('./api/jscriptySessionReport'));_0x493e71[_0x3213('0x14')]('/api/sms/reports/queue',require(_0x3213('0xd1')));_0x493e71[_0x3213('0x14')](_0x3213('0xd2'),require('./api/squareReport'));_0x493e71[_0x3213('0x14')]('/api/square/details/reports',require(_0x3213('0xd3')));_0x493e71[_0x3213('0x14')](_0x3213('0xd4'),require(_0x3213('0xd5')));_0x493e71[_0x3213('0x14')](_0x3213('0xd6'),require(_0x3213('0xd7')));_0x493e71[_0x3213('0x14')]('/api/square/odbc',require(_0x3213('0xd8')));_0x493e71['use'](_0x3213('0xd9'),require('./api/squareProject'));_0x493e71['use'](_0x3213('0xda'),require(_0x3213('0xdb')));_0x493e71[_0x3213('0x14')](_0x3213('0xdc'),require(_0x3213('0xdd')));_0x493e71[_0x3213('0x14')]('/api/teams',require(_0x3213('0xde')));_0x493e71[_0x3213('0x14')]('/api/license',require(_0x3213('0xdf')));_0x493e71[_0x3213('0x14')](_0x3213('0xe0'),require(_0x3213('0xe1')));_0x493e71[_0x3213('0x14')](_0x3213('0xe2'),require(_0x3213('0xe3')));_0x493e71['use']('/api/attachments',require('./api/attachment'));_0x493e71[_0x3213('0x14')]('/api/plugins',require(_0x3213('0xe4')));_0x493e71['use'](_0x3213('0xe5'),require(_0x3213('0xe6')));_0x493e71[_0x3213('0x14')](_0x3213('0xe7'),require(_0x3213('0xe8')));_0x493e71[_0x3213('0x14')](_0x3213('0xe9'),require('./api/faxTransferReport'));_0x493e71[_0x3213('0x14')](_0x3213('0xea'),require(_0x3213('0xeb')));_0x493e71[_0x3213('0x14')](_0x3213('0xec'),require(_0x3213('0xed')));_0x493e71[_0x3213('0x14')]('/api/cm/lists',require('./api/cmList'));_0x493e71[_0x3213('0x14')](_0x3213('0xee'),require(_0x3213('0xef')));_0x493e71['use']('/api/userProfiles',require(_0x3213('0xf0')));_0x493e71['use']('/api/userProfile/sections',require('./api/userProfileSection'));_0x493e71[_0x3213('0x14')](_0x3213('0xf1'),require(_0x3213('0xf2')));_0x493e71['use'](_0x3213('0xf3'),require(_0x3213('0xf4')));_0x493e71[_0x3213('0x14')](_0x3213('0xf5'),require(_0x3213('0xf6')));_0x493e71[_0x3213('0x14')](_0x3213('0xf7'),require(_0x3213('0xf8')));_0x493e71['use']('/api/rpc',require(_0x3213('0xf9')));_0x493e71[_0x3213('0x14')]('/api/version',require('./api/version'));_0x493e71[_0x3213('0x14')](_0x3213('0xfa'),require('./api/system'));_0x493e71[_0x3213('0x14')](_0x3213('0xfb'),require(_0x3213('0xfc')));_0x493e71[_0x3213('0x14')]('/apidoc',express[_0x3213('0xfd')](path[_0x3213('0xfe')](config[_0x3213('0xff')],'/apidoc')));_0x493e71[_0x3213('0x14')]('/www',express['static'](path[_0x3213('0xfe')](config[_0x3213('0xff')],_0x3213('0x100'))));_0x493e71[_0x3213('0x14')]('/demo',express['static'](path[_0x3213('0xfe')](config[_0x3213('0xff')],'/demo')));_0x493e71[_0x3213('0x14')]('/snippet',express[_0x3213('0xfd')](path[_0x3213('0xfe')](config['root'],_0x3213('0x101'),_0x3213('0x102'))));_0x493e71[_0x3213('0x14')]('/plugins',express[_0x3213('0xfd')](path['join'](config[_0x3213('0xff')],_0x3213('0x103'))));_0x493e71[_0x3213('0x104')]('/:url(api|auth|components|app|bower_components|assets)/*')[_0x3213('0x105')](errors[0x194]);_0x493e71[_0x3213('0x104')]('/*')[_0x3213('0x105')](function(_0x3301fc,_0x6c3b41){_0x6c3b41[_0x3213('0x106')](path[_0x3213('0x107')](_0x493e71[_0x3213('0x105')](_0x3213('0x108'))+'/index.html'));});}; \ No newline at end of file +var _0xa7bf=['/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','./api/intZendeskAccount','/api/integrations/zendesk/configurations','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','/api/integrations/vtiger/configurations','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','/api/integrations/dynamics365/accounts','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','./api/jscriptyAnswerReport','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','/api/square/reports','./api/squareReport','/api/square/details/reports','./api/squareReportDetail','./api/jscriptyProject','/api/settings','./api/setting','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','/api/square/messages','/api/teams','/api/license','./api/license','/api/campaigns','/api/migrations','/api/attachments','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','./api/chatTransferReport','./api/faxTransferReport','/api/openchannel/reports/transfer','/api/sms/reports/transfer','./api/smsTransferReport','./api/cmList','/api/voice/prefixes','/api/userProfile/sections','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','static','join','/www','/demo','root','/snippet','1.0.16','/plugins','/:url(api|auth|components|app|bower_components|assets)/*','get','route','resolve','appPath','/index.html','express-winston','util','./errors','./config/logger','default','use','format','method','headers','x-forwarded-for','connection','statusCode','responseTime','user','name','role','logger','body','device','agent_id','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)','remoteAddress','url','other','agent_name','/api/users','./api/user','/api/voice/chanspy','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','./api/voiceExtension','/api/voice/mohs','/api/voice/queues','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/agents/reports','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','/api/dashboards','./api/dashboard','/api/dashboards/items','./api/dashboardItem','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','./api/faxMessage','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/openchannel/accounts','/api/openchannel/applications','./api/openchannelApplication','./api/openchannelInteraction','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','/api/actions','./api/action','/api/automations','./api/automation','/api/canned_answers','./api/cannedAnswer','./api/disposition','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','/api/voiceQueuesLog','/api/schedules','./api/schedule','./api/sound','/api/tags','/api/templates','./api/template','/api/triggers','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','./api/intSalesforceAccount','/api/integrations/salesforce/configurations','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intDeskAccount','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount'];(function(_0x18cd65,_0x4c7039){var _0x1d9820=function(_0x153cd7){while(--_0x153cd7){_0x18cd65['push'](_0x18cd65['shift']());}};_0x1d9820(++_0x4c7039);}(_0xa7bf,0x164));var _0xfa7b=function(_0x387d86,_0x3fb6dc){_0x387d86=_0x387d86-0x0;var _0x4a52b7=_0xa7bf[_0x387d86];return _0x4a52b7;};'use strict';var path=require('path');var express=require('express');var ewinston=require(_0xfa7b('0x0'));var util=require(_0xfa7b('0x1'));var errors=require(_0xfa7b('0x2'));var config=require('./config/environment');var logger=require(_0xfa7b('0x3'))('api');var authLogger=require(_0xfa7b('0x3'))('auth');exports[_0xfa7b('0x4')]=function(_0x40715c){_0x40715c[_0xfa7b('0x5')](ewinston['logger']({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0xdd7092,_0x56a30c){return util[_0xfa7b('0x6')]('%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s',_0xdd7092[_0xfa7b('0x7')],_0xdd7092[_0xfa7b('0x8')][_0xfa7b('0x9')]?_0xdd7092[_0xfa7b('0x8')][_0xfa7b('0x9')]:_0xdd7092[_0xfa7b('0xa')]['remoteAddress']||_0xdd7092['ip'],_0xdd7092['url'],_0x56a30c[_0xfa7b('0xb')],_0x56a30c[_0xfa7b('0xc')],_0xdd7092[_0xfa7b('0xd')]?_0xdd7092[_0xfa7b('0xd')]['id']:null,_0xdd7092[_0xfa7b('0xd')]?_0xdd7092[_0xfa7b('0xd')][_0xfa7b('0xe')]:null,_0xdd7092['user']?_0xdd7092['user'][_0xfa7b('0xf')]:null);}}));_0x40715c['use'](ewinston[_0xfa7b('0x10')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x13c4a5,_0x58b4fc){var _0x2582c7='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x13c4a5[_0xfa7b('0x11')]&&_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x12')]&&_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x13')]){_0x2582c7=_0xfa7b('0x14');}return util[_0xfa7b('0x6')](_0x2582c7,_0x13c4a5[_0xfa7b('0x7')],_0x13c4a5[_0xfa7b('0x8')][_0xfa7b('0x9')]?_0x13c4a5[_0xfa7b('0x8')][_0xfa7b('0x9')]:_0x13c4a5['connection'][_0xfa7b('0x15')]||_0x13c4a5['ip'],_0x13c4a5[_0xfa7b('0x16')],_0x58b4fc[_0xfa7b('0xb')],_0x58b4fc[_0xfa7b('0xc')],_0x13c4a5['user']?_0x13c4a5[_0xfa7b('0xd')]['id']:null,_0x13c4a5[_0xfa7b('0xd')]?_0x13c4a5[_0xfa7b('0xd')]['name']:null,_0x13c4a5[_0xfa7b('0xd')]?_0x13c4a5[_0xfa7b('0xd')]['role']:null,_0x13c4a5[_0xfa7b('0x11')]&&_0x13c4a5['body'][_0xfa7b('0x12')]?_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x12')]:_0xfa7b('0x17'),_0x13c4a5[_0xfa7b('0x11')]&&_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x13')]?_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x13')]:'',_0x13c4a5[_0xfa7b('0x11')]&&_0x13c4a5['body'][_0xfa7b('0x18')]?_0x13c4a5[_0xfa7b('0x11')][_0xfa7b('0x18')]:'');},'ignoreRoute':function(_0xc2168b){var _0x493807=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x493807['test'](_0xc2168b[_0xfa7b('0x16')]);}}));_0x40715c['use'](_0xfa7b('0x19'),require(_0xfa7b('0x1a')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x1b'),require(_0xfa7b('0x1c')));_0x40715c['use'](_0xfa7b('0x1d'),require(_0xfa7b('0x1e')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x1f'),require(_0xfa7b('0x20')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x21'),require('./api/voiceMusicOnHold'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x22'),require('./api/voiceQueue'));_0x40715c['use']('/api/voice/recordings',require(_0xfa7b('0x23')));_0x40715c['use'](_0xfa7b('0x24'),require(_0xfa7b('0x25')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x26'),require('./api/voiceMail'));_0x40715c['use'](_0xfa7b('0x27'),require(_0xfa7b('0x28')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x29'),require(_0xfa7b('0x2a')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x2b'),require('./api/voiceDialReport'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x2c'),require('./api/voiceAgentReport'));_0x40715c['use']('/api/voice/queues/reports',require('./api/voiceQueueReport'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x2d'),require(_0xfa7b('0x2e')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x2f'),require(_0xfa7b('0x30')));_0x40715c['use'](_0xfa7b('0x31'),require(_0xfa7b('0x32')));_0x40715c['use'](_0xfa7b('0x33'),require(_0xfa7b('0x34')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x35'),require(_0xfa7b('0x36')));_0x40715c['use']('/api/mail/queues',require(_0xfa7b('0x37')));_0x40715c['use'](_0xfa7b('0x38'),require(_0xfa7b('0x39')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x3a'),require(_0xfa7b('0x3b')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x3c'),require('./api/mailMessage'));_0x40715c['use'](_0xfa7b('0x3d'),require(_0xfa7b('0x3e')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x3f'),require(_0xfa7b('0x40')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x41'),require(_0xfa7b('0x42')));_0x40715c['use'](_0xfa7b('0x43'),require(_0xfa7b('0x44')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x45'),require(_0xfa7b('0x46')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x47'),require(_0xfa7b('0x48')));_0x40715c['use'](_0xfa7b('0x49'),require(_0xfa7b('0x4a')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x4b'),require(_0xfa7b('0x4c')));_0x40715c['use'](_0xfa7b('0x4d'),require(_0xfa7b('0x4e')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x4f'),require(_0xfa7b('0x50')));_0x40715c[_0xfa7b('0x5')]('/api/sms/accounts',require(_0xfa7b('0x51')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x52'),require(_0xfa7b('0x53')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x54'),require(_0xfa7b('0x55')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x56'),require(_0xfa7b('0x57')));_0x40715c[_0xfa7b('0x5')]('/api/sms/queues',require('./api/smsQueue'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x58'),require('./api/openchannelAccount'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x59'),require(_0xfa7b('0x5a')));_0x40715c[_0xfa7b('0x5')]('/api/openchannel/interactions',require(_0xfa7b('0x5b')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x5c'),require(_0xfa7b('0x5d')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x5e'),require(_0xfa7b('0x5f')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x60'),require(_0xfa7b('0x61')));_0x40715c[_0xfa7b('0x5')]('/api/openchannel/reports/queue',require(_0xfa7b('0x62')));_0x40715c['use'](_0xfa7b('0x63'),require(_0xfa7b('0x64')));_0x40715c['use'](_0xfa7b('0x65'),require(_0xfa7b('0x66')));_0x40715c[_0xfa7b('0x5')]('/api/chat/messages',require('./api/chatMessage'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x67'),require(_0xfa7b('0x68')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x69'),require(_0xfa7b('0x6a')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x6b'),require(_0xfa7b('0x6c')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x6d'),require(_0xfa7b('0x6e')));_0x40715c['use']('/api/cm/companies',require(_0xfa7b('0x6f')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x70'),require('./api/cmContact'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x71'),require(_0xfa7b('0x72')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x73'),require(_0xfa7b('0x74')));_0x40715c[_0xfa7b('0x5')]('/api/cm/hopper_final',require(_0xfa7b('0x75')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x76'),require(_0xfa7b('0x77')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x78'),require(_0xfa7b('0x79')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x7a'),require(_0xfa7b('0x7b')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x7c'),require(_0xfa7b('0x7d')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x7e'),require(_0xfa7b('0x7f')));_0x40715c[_0xfa7b('0x5')]('/api/dispositions',require(_0xfa7b('0x80')));_0x40715c['use'](_0xfa7b('0x81'),require(_0xfa7b('0x82')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x83'),require(_0xfa7b('0x84')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x85'),require(_0xfa7b('0x86')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x87'),require('./api/cdr'));_0x40715c['use'](_0xfa7b('0x88'),require('./api/voiceQueuesLog'));_0x40715c['use'](_0xfa7b('0x89'),require(_0xfa7b('0x8a')));_0x40715c[_0xfa7b('0x5')]('/api/sounds',require(_0xfa7b('0x8b')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x8c'),require('./api/tag'));_0x40715c['use'](_0xfa7b('0x8d'),require(_0xfa7b('0x8e')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x8f'),require('./api/trigger'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x90'),require(_0xfa7b('0x91')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x92'),require('./api/integration'));_0x40715c['use'](_0xfa7b('0x93'),require(_0xfa7b('0x94')));_0x40715c[_0xfa7b('0x5')]('/api/analytics/custom_reports',require('./api/analyticCustomReport'));_0x40715c['use'](_0xfa7b('0x95'),require(_0xfa7b('0x96')));_0x40715c['use'](_0xfa7b('0x97'),require('./api/analyticExtractedReport'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x98'),require(_0xfa7b('0x99')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x9a'),require(_0xfa7b('0x9b')));_0x40715c['use'](_0xfa7b('0x9c'),require(_0xfa7b('0x9d')));_0x40715c['use'](_0xfa7b('0x9e'),require(_0xfa7b('0x9f')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xa0'),require('./api/intSalesforceConfiguration'));_0x40715c[_0xfa7b('0x5')]('/api/integrations/salesforce/fields',require('./api/intSalesforceField'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xa1'),require(_0xfa7b('0xa2')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xa3'),require(_0xfa7b('0xa4')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xa5'),require('./api/intSugarcrmField'));_0x40715c[_0xfa7b('0x5')]('/api/integrations/desk/accounts',require(_0xfa7b('0xa6')));_0x40715c[_0xfa7b('0x5')]('/api/integrations/desk/configurations',require(_0xfa7b('0xa7')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xa8'),require(_0xfa7b('0xa9')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xaa'),require(_0xfa7b('0xab')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xac'),require(_0xfa7b('0xad')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xae'),require(_0xfa7b('0xaf')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb0'),require(_0xfa7b('0xb1')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb2'),require('./api/intZendeskConfiguration'));_0x40715c[_0xfa7b('0x5')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb3'),require(_0xfa7b('0xb4')));_0x40715c[_0xfa7b('0x5')]('/api/integrations/freshdesk/configurations',require(_0xfa7b('0xb5')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb6'),require('./api/intFreshdeskField'));_0x40715c[_0xfa7b('0x5')]('/api/integrations/vtiger/accounts',require('./api/intVtigerAccount'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb7'),require(_0xfa7b('0xb8')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xb9'),require('./api/intVtigerField'));_0x40715c[_0xfa7b('0x5')]('/api/integrations/servicenow/accounts',require('./api/intServicenowAccount'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xba'),require(_0xfa7b('0xbb')));_0x40715c['use'](_0xfa7b('0xbc'),require('./api/intServicenowField'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xbd'),require(_0xfa7b('0xbe')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xbf'),require(_0xfa7b('0xc0')));_0x40715c['use'](_0xfa7b('0xc1'),require(_0xfa7b('0xc2')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xc3'),require('./api/intFreshsalesAccount'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xc4'),require(_0xfa7b('0xc5')));_0x40715c['use']('/api/integrations/freshsales/fields',require(_0xfa7b('0xc6')));_0x40715c['use']('/api/networks',require(_0xfa7b('0xc7')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xc8'),require(_0xfa7b('0xc9')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xca'),require(_0xfa7b('0xcb')));_0x40715c['use']('/api/jscripty/answers/reports',require(_0xfa7b('0xcc')));_0x40715c[_0xfa7b('0x5')]('/api/jscripty/questions/reports',require(_0xfa7b('0xcd')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xce'),require('./api/jscriptySessionReport'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xcf'),require(_0xfa7b('0xd0')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xd1'),require(_0xfa7b('0xd2')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xd3'),require(_0xfa7b('0xd4')));_0x40715c[_0xfa7b('0x5')]('/api/jscripty/projects',require(_0xfa7b('0xd5')));_0x40715c['use'](_0xfa7b('0xd6'),require(_0xfa7b('0xd7')));_0x40715c[_0xfa7b('0x5')]('/api/square/odbc',require(_0xfa7b('0xd8')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xd9'),require(_0xfa7b('0xda')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xdb'),require('./api/squareRecording'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xdc'),require('./api/squareMessage'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xdd'),require('./api/team'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xde'),require(_0xfa7b('0xdf')));_0x40715c['use'](_0xfa7b('0xe0'),require('./api/campaign'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xe1'),require('./api/migration'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xe2'),require('./api/attachment'));_0x40715c[_0xfa7b('0x5')]('/api/plugins',require(_0xfa7b('0xe3')));_0x40715c['use'](_0xfa7b('0xe4'),require(_0xfa7b('0xe5')));_0x40715c['use']('/api/chat/reports/transfer',require(_0xfa7b('0xe6')));_0x40715c['use']('/api/fax/reports/transfer',require(_0xfa7b('0xe7')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xe8'),require('./api/openchannelTransferReport'));_0x40715c['use'](_0xfa7b('0xe9'),require(_0xfa7b('0xea')));_0x40715c[_0xfa7b('0x5')]('/api/cm/lists',require(_0xfa7b('0xeb')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xec'),require('./api/voicePrefix'));_0x40715c['use']('/api/userProfiles',require('./api/userProfile'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xed'),require('./api/userProfileSection'));_0x40715c[_0xfa7b('0x5')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x40715c['use'](_0xfa7b('0xee'),require(_0xfa7b('0xef')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xf0'),require(_0xfa7b('0xf1')));_0x40715c[_0xfa7b('0x5')]('/api/jira',require('./api/jira'));_0x40715c['use'](_0xfa7b('0xf2'),require('./api/rpc'));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xf3'),require(_0xfa7b('0xf4')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xf5'),require(_0xfa7b('0xf6')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xf7'),require(_0xfa7b('0xf8')));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xf9'),express[_0xfa7b('0xfa')](path['join'](config['root'],_0xfa7b('0xf9'))));_0x40715c[_0xfa7b('0x5')]('/www',express[_0xfa7b('0xfa')](path[_0xfa7b('0xfb')](config['root'],_0xfa7b('0xfc'))));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xfd'),express[_0xfa7b('0xfa')](path[_0xfa7b('0xfb')](config[_0xfa7b('0xfe')],_0xfa7b('0xfd'))));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0xff'),express[_0xfa7b('0xfa')](path['join'](config[_0xfa7b('0xfe')],'snippet',_0xfa7b('0x100'))));_0x40715c[_0xfa7b('0x5')](_0xfa7b('0x101'),express[_0xfa7b('0xfa')](path[_0xfa7b('0xfb')](config['root'],'/server/files/plugins')));_0x40715c['route'](_0xfa7b('0x102'))[_0xfa7b('0x103')](errors[0x194]);_0x40715c[_0xfa7b('0x104')]('/*')[_0xfa7b('0x103')](function(_0x334286,_0x2180c7){_0x2180c7['sendFile'](path[_0xfa7b('0x105')](_0x40715c[_0xfa7b('0x103')](_0xfa7b('0x106'))+_0xfa7b('0x107')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 1590980..5205009 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2d=['../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','error','log','default','RPC\x20listening\x20on\x20','jayson/promise','lodash','../config/environment','listen','../api/user/user.rpc','merge','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceCallReport/voiceCallReport.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatQueue/chatQueue.rpc','../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc'];(function(_0x115621,_0x341cde){var _0x5ef5ce=function(_0x2ca3f2){while(--_0x2ca3f2){_0x115621['push'](_0x115621['shift']());}};_0x5ef5ce(++_0x341cde);}(_0x5f2d,0x92));var _0xd5f2=function(_0x1fb392,_0x21ee8e){_0x1fb392=_0x1fb392-0x0;var _0x328082=_0x5f2d[_0x1fb392];return _0x328082;};'use strict';var jayson=require(_0xd5f2('0x0'));var BPromise=require('bluebird');var _=require(_0xd5f2('0x1'));var config=require(_0xd5f2('0x2'));exports[_0xd5f2('0x3')]=function(){return new BPromise(function(_0x2d04c4,_0x2e0ab3){var _0x3b1449={};_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x4')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x6')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/voiceQueue/voiceQueue.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x7')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x8')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x9')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0xa')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0xb')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0xc')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/trunk/trunk.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0xd')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0xe')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0xf')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x10')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/mailQueue/mailQueue.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x11')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x12')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x13')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x14')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x15')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/faxApplication/faxApplication.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x16')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/faxMessage/faxMessage.rpc'));_0x3b1449=_['merge'](_0x3b1449,require('../api/faxQueue/faxQueue.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/faxQueueReport/faxQueueReport.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x17')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/smsInteraction/smsInteraction.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x18')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x19')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/openchannelApplication/openchannelApplication.rpc'));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x1a')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x1b')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x1c')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x1d')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x1e')));_0x3b1449=_['merge'](_0x3b1449,require('../api/chatMessage/chatMessage.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x1f')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x20')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x21')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x22')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x23')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x24')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x25')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x26')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x27')));_0x3b1449=_['merge'](_0x3b1449,require('../api/sound/sound.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x28')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x29')));_0x3b1449=_['merge'](_0x3b1449,require('../api/variable/variable.rpc'));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x2a')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x2b')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x2c')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x2d')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x2e')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x2f')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x30')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x31')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x32')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x33')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x34')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require('../api/squareReportDetail/squareReportDetail.rpc'));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x35')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x36')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x37')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x38')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x39')));_0x3b1449=_[_0xd5f2('0x5')](_0x3b1449,require(_0xd5f2('0x3a')));_0x3b1449=_['merge'](_0x3b1449,require(_0xd5f2('0x3b')));var _0x587b03=jayson['server'](_0x3b1449)[_0xd5f2('0x3c')]();var _0x2eaa1c=config[_0xd5f2('0x3d')][_0xd5f2('0x3e')]||config[_0xd5f2('0x3e')]+0x1;var _0xf11463=config['rpc']['ip']||'localhost';_0x587b03['on'](_0xd5f2('0x3f'),function(_0x54966c){return _0x2e0ab3(_0x54966c);});_0x587b03[_0xd5f2('0x3')](_0x2eaa1c,_0xf11463,function(){console[_0xd5f2('0x40')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0xf11463,_0x2eaa1c);require('../config/triggers')[_0xd5f2('0x41')]();return _0x2d04c4(_0xd5f2('0x42')+_0xf11463+':'+_0x2eaa1c);});});}; \ No newline at end of file +var _0xefea=['../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/smsAccount/smsAccount.rpc','../api/smsInteraction/smsInteraction.rpc','../api/smsMessage/smsMessage.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/chatQueue/chatQueue.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/pause/pause.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intZohoAccount/intZohoAccount.rpc','../api/intZendeskAccount/intZendeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareProject/squareProject.rpc','../api/squareRecording/squareRecording.rpc','../api/squareMessage/squareMessage.rpc','../api/plugin/plugin.rpc','server','rpc','port','localhost','error','log','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','bluebird','lodash','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc'];(function(_0x303bec,_0x3e93fd){var _0x125a44=function(_0xe03ea8){while(--_0xe03ea8){_0x303bec['push'](_0x303bec['shift']());}};_0x125a44(++_0x3e93fd);}(_0xefea,0x13e));var _0xaefe=function(_0x149ab0,_0x222b05){_0x149ab0=_0x149ab0-0x0;var _0x521d56=_0xefea[_0x149ab0];return _0x521d56;};'use strict';var jayson=require(_0xaefe('0x0'));var BPromise=require(_0xaefe('0x1'));var _=require(_0xaefe('0x2'));var config=require(_0xaefe('0x3'));exports[_0xaefe('0x4')]=function(){return new BPromise(function(_0x263dec,_0x1d3fa8){var _0xf05fbb={};_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x6')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/voiceExtension/voiceExtension.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x7')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x8')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/voiceCallReport/voiceCallReport.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x9')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0xa')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0xb')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0xc')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0xd')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0xe')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0xf')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x10')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x11')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x12')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/mailInteraction/mailInteraction.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x13')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x14')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x15')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x16')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x17')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x18')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/faxMessage/faxMessage.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x19')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/faxQueueReport/faxQueueReport.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1a')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1b')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1c')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/smsQueue/smsQueue.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1d')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1e')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x1f')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/openchannelQueue/openchannelQueue.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/chatInteraction/chatInteraction.rpc'));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/chatMessage/chatMessage.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x20')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/cmContact/cmContact.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/cmHopper/cmHopper.rpc'));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x21')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x22')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x23')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/interval/interval.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x24')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x25')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x26')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x27')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x28')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x29')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x2a')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x2b')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x2c')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x2d')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x2e')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x2f')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x30')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/intDynamics365Account/intDynamics365Account.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x31')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/chatQueueReport/chatQueueReport.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x32')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x33')));_0xf05fbb=_['merge'](_0xf05fbb,require(_0xaefe('0x34')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/squareOdbc/squareOdbc.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x35')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x36')));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x37')));_0xf05fbb=_['merge'](_0xf05fbb,require('../api/campaign/campaign.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require('../api/attachment/attachment.rpc'));_0xf05fbb=_[_0xaefe('0x5')](_0xf05fbb,require(_0xaefe('0x38')));var _0x1c830b=jayson[_0xaefe('0x39')](_0xf05fbb)['http']();var _0xc4fa88=config[_0xaefe('0x3a')][_0xaefe('0x3b')]||config[_0xaefe('0x3b')]+0x1;var _0x8c5737=config[_0xaefe('0x3a')]['ip']||_0xaefe('0x3c');_0x1c830b['on'](_0xaefe('0x3d'),function(_0x18b413){return _0x1d3fa8(_0x18b413);});_0x1c830b[_0xaefe('0x4')](_0xc4fa88,_0x8c5737,function(){console[_0xaefe('0x3e')](_0xaefe('0x3f'),_0x8c5737,_0xc4fa88);require(_0xaefe('0x40'))['default']();return _0x263dec(_0xaefe('0x41')+_0x8c5737+':'+_0xc4fa88);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index a76edc7..f018f95 100644 --- a/server/services/agi/channel.js +++ b/server/services/agi/channel.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0xba7410,_0x38029d){var _0x5f134a=function(_0x459a11){while(--_0x459a11){_0xba7410['push'](_0xba7410['shift']());}};_0x5f134a(++_0x38029d);}(_0x70e0,0x17b));var _0x070e=function(_0x1c4b37,_0x213b35){_0x1c4b37=_0x1c4b37-0x0;var _0x31dcef=_0x70e0[_0x1c4b37];return _0x31dcef;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file +var _0x70e0=['format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','exec','isArray','join','EXEC\x20%s\x20%s','setExtension','SET\x20EXTENSION\x20%s','SET\x20PRIORITY\x20%s','HANGUP','setVariable','isBoolean','isNumber','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','continueAt','setPriority','GOTO\x20%s\x20%s\x20%s','getVariable','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22','agi','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','./error','setEncoding','utf8','headers','emit','ready','line','hangup','substring','520-Invalid','search','520\x20End\x20of\x20proper','function','substr','indexOf','length','match','error','code','close','E_AGI_SOCKET_CLOSE','E_AGI_SOCKET_TIMEOUT','destroy','pipe','write','inherits','prototype','command','sync','answer','getData','sendRequest'];(function(_0x3a73a8,_0x2baf04){var _0x5447fd=function(_0x2165ad){while(--_0x2165ad){_0x3a73a8['push'](_0x3a73a8['shift']());}};_0x5447fd(++_0x2baf04);}(_0x70e0,0x17b));var _0x070e=function(_0x3ef81e,_0x5798c2){_0x3ef81e=_0x3ef81e-0x0;var _0x1235eb=_0x70e0[_0x3ef81e];return _0x1235eb;};'use strict';var util=require(_0x070e('0x0'));var _=require(_0x070e('0x1'));var EventEmitter=require(_0x070e('0x2'))['EventEmitter'];var AGIReply=require('./reply');var AGIError=require(_0x070e('0x3'));function AGIChannel(_0xee173){var _0x277d32=this,_0x2593e5=new AGIReply(),_0x5c90fc=![],_0x7bce9b={};EventEmitter['call'](_0x277d32);_0xee173[_0x070e('0x4')]('utf8');_0xee173['setTimeout'](0x8*0x3c*0x3c*0x3e8);_0x2593e5['setEncoding'](_0x070e('0x5'));_0x2593e5['on'](_0x070e('0x6'),function(_0x604664){for(var _0x2611e6 in _0x604664){_0x277d32[_0x2611e6]=_0x604664[_0x2611e6];}_0x277d32[_0x070e('0x7')](_0x070e('0x8'));});_0x2593e5['on'](_0x070e('0x9'),function(_0x4e99e6){if(_0x4e99e6['toLowerCase']()==_0x070e('0xa')){_0x277d32[_0x070e('0x7')](_0x070e('0xa'));return;}if(_0x4e99e6[_0x070e('0xb')](0x0,0xb)==_0x070e('0xc')){_0x5c90fc=!![];}if(_0x5c90fc){_0x7bce9b['rx']+=_0x4e99e6+'\x0a';if(_0x4e99e6[_0x070e('0xd')](_0x070e('0xe'))!=-0x1){_0x5c90fc=![];}}else{_0x7bce9b['rx']=_0x4e99e6;}if(_0x5c90fc){return;}if(typeof _0x7bce9b['cb']==_0x070e('0xf')){var _0x39d2b9=_0x7bce9b['rx']['substring'](0x0,0x3),_0x5bf079=null,_0x2930b8=null;_0x39d2b9=parseInt(_0x39d2b9);if(isNaN(_0x39d2b9)){_0x7bce9b['cb'](null,{'code':0x1f4,'result':-0x1,'extra':'no\x20code'});return;}if(_0x39d2b9!=0xc8){_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':-0x1,'extra':'KO'});return;}_0x5bf079=_0x7bce9b['rx'][_0x070e('0xb')](0x4)['replace']('result=','');if(_0x5bf079['indexOf']('\x20')!=-0x1){_0x5bf079=_0x5bf079[_0x070e('0x10')](0x0,_0x5bf079[_0x070e('0x11')]('\x20'));}if(_['startsWith'](_0x5bf079,'-1')){_0x5bf079=parseInt(_0x5bf079);}_0x2930b8=_0x7bce9b['rx']['split']('\x20');if(_0x2930b8[_0x070e('0x12')]==0x3){_0x2930b8=_0x2930b8[0x2][_0x070e('0xb')](0x1,_0x2930b8[0x2][_0x070e('0x12')]-0x1);}else if(_0x2930b8[_0x070e('0x12')]>0x3){var _0x5bc71e=/\((.+)\)/;var _0x49861b=_0x7bce9b['rx'][_0x070e('0x13')](_0x5bc71e);if(_0x49861b){_0x2930b8=_0x49861b[0x1];}else{_0x2930b8=null;}}else{_0x2930b8=null;}_0x7bce9b['cb'](null,{'code':_0x39d2b9,'result':_0x5bf079,'extra':_0x2930b8});}});_0xee173['on'](_0x070e('0x14'),function(_0x38f6e6){_0x277d32[_0x070e('0x7')](_0x070e('0x14'),new AGIError('E_AGI_SOCKET_ERROR',_0x38f6e6[_0x070e('0x15')]));});_0xee173['on'](_0x070e('0x16'),function(){_0x277d32[_0x070e('0x7')](_0x070e('0x16'),new AGIError(_0x070e('0x17')));});_0xee173['on']('timeout',function(){_0x277d32['emit']('timeout',new AGIError(_0x070e('0x18')));_0xee173[_0x070e('0x19')]();});_0xee173[_0x070e('0x1a')](_0x2593e5);this['command']=function(_0x5b184,_0x5dc5d2){var _0x5b184=_0x5b184||'',_0x5dc5d2=typeof _0x5dc5d2==_0x070e('0xf')?_0x5dc5d2:new Function();_0x7bce9b={'tx':_0x5b184,'rx':'','cb':_0x5dc5d2};_0xee173[_0x070e('0x1b')](_0x5b184+'\x0a');},this[_0x070e('0x16')]=function(){_0xee173[_0x070e('0x19')]();};}util[_0x070e('0x1c')](AGIChannel,EventEmitter);AGIChannel[_0x070e('0x1d')]['sendRequest']=function(_0x2f8055){return this[_0x070e('0x1e')][_0x070e('0x1f')](this,_0x2f8055);};AGIChannel['prototype'][_0x070e('0x20')]=function(){return this['sendRequest']('ANSWER');};AGIChannel[_0x070e('0x1d')][_0x070e('0x21')]=function(_0x41deb1,_0x1743cc,_0x4763c6){_0x41deb1=_0x41deb1===undefined?'beep':_0x41deb1;_0x1743cc=_0x1743cc===undefined?'5':_0x1743cc;_0x4763c6=_0x4763c6===undefined?'1':_0x4763c6;return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x24'),_0x41deb1,_0x1743cc*0x3e8,_0x4763c6));};AGIChannel[_0x070e('0x1d')][_0x070e('0x25')]=function(_0x28d7f2){_0x28d7f2=_0x28d7f2||_0x070e('0x26');return this[_0x070e('0x22')](util['format'](_0x070e('0x27'),_0x28d7f2));};AGIChannel[_0x070e('0x1d')][_0x070e('0x28')]=function(_0x56fc12,_0x5c5f0d){if(_[_0x070e('0x29')](_0x5c5f0d)){return this[_0x070e('0x22')](util[_0x070e('0x23')]('EXEC\x20%s\x20%s',_0x56fc12,_0x5c5f0d[_0x070e('0x2a')](',')));}return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2b'),_0x56fc12,_0x5c5f0d));};AGIChannel['prototype']['setContext']=function(_0x523b75){return this['sendRequest'](util[_0x070e('0x23')]('SET\x20CONTEXT\x20%s',_0x523b75));};AGIChannel[_0x070e('0x1d')][_0x070e('0x2c')]=function(_0x4f8130){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x2d'),_0x4f8130));};AGIChannel['prototype']['setPriority']=function(_0x41ade4){return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x2e'),_0x41ade4));};AGIChannel[_0x070e('0x1d')]['hangup']=function(){return this['sendRequest'](_0x070e('0x2f'));};AGIChannel[_0x070e('0x1d')][_0x070e('0x30')]=function(_0xf57ed,_0xf11439){var _0x4deaf8=_[_0x070e('0x31')](_0xf11439)||_[_0x070e('0x32')](_0xf11439)?_0xf11439['toString']():_0xf11439;return this[_0x070e('0x22')](util[_0x070e('0x23')]('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0xf57ed,_0x4deaf8?_0x4deaf8['toString']()['replace'](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x070e('0x1d')][_0x070e('0x33')]=function(_0x39dfaa,_0x334733){return this[_0x070e('0x22')](util['format'](_0x070e('0x34'),_0x39dfaa,_0x334733));};AGIChannel[_0x070e('0x1d')][_0x070e('0x35')]=function(_0x487276,_0x268c5d){return this[_0x070e('0x22')](util[_0x070e('0x23')]('SAY\x20DIGITS\x20%s\x20%s',_0x487276,_0x268c5d));};AGIChannel[_0x070e('0x1d')][_0x070e('0x36')]=function(_0x4800a9,_0x173602){return this['sendRequest'](util[_0x070e('0x23')](_0x070e('0x37'),_0x4800a9,_0x173602));};AGIChannel[_0x070e('0x1d')][_0x070e('0x38')]=function(_0xd03404,_0x47b929,_0xd18220){_0x47b929=_0x47b929||this['extension'];_0xd18220=_0xd18220||0x1;this['setContext'](_0xd03404);this[_0x070e('0x2c')](_0x47b929);this[_0x070e('0x39')](_0xd18220);return this[_0x070e('0x25')](util['format'](_0x070e('0x3a'),_0xd03404,_0x47b929,_0xd18220));};AGIChannel[_0x070e('0x1d')][_0x070e('0x3b')]=function(_0x7dc240){return this['sendRequest'](util[_0x070e('0x23')]('GET\x20VARIABLE\x20\x22%s\x22',_0x7dc240));};AGIChannel['prototype']['recordFile']=function(_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x34f23e,_0x562aa4){_0x926533=_0x926533||_0x070e('0x3c');_0x26b3e2=_0x26b3e2||'';_0x29dccd=_0x29dccd===undefined?-0x1:_0x29dccd==='-1'?-0x1:_0x29dccd*0x3e8;_0x34f23e=_0x34f23e===undefined?'':'s='+_0x34f23e;_0x562aa4=_0x562aa4?'BEEP':'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3d'),_0x3feb83,_0x926533,_0x26b3e2,_0x29dccd,_0x562aa4,_0x34f23e));};AGIChannel['prototype']['streamFile']=function(_0x261a27,_0x5ee4b8){_0x5ee4b8=_0x5ee4b8||'';return this[_0x070e('0x22')](util[_0x070e('0x23')](_0x070e('0x3e'),_0x261a27,_0x5ee4b8));};AGIChannel['prototype'][_0x070e('0x3f')]=function(_0x20a1ee){return this['exec']('AGI',_0x20a1ee);};AGIChannel[_0x070e('0x1d')][_0x070e('0x40')]=function(_0x2d43ce){return this[_0x070e('0x28')](_0x070e('0x41'),_0x2d43ce);};AGIChannel['prototype'][_0x070e('0x14')]=function(_0x3f6c64,_0x427fa7){this[_0x070e('0x25')](util[_0x070e('0x23')](_0x070e('0x42'),_0x3f6c64['id'],_0x3f6c64[_0x070e('0x43')],_0x427fa7));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x070e('0x44')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index 7f70ab0..f28ce7e 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 _0xc737=['format','apply','name','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20timeout.','Empty\x20command.','push'];(function(_0xf16615,_0x2291ef){var _0x5a0a83=function(_0x23791a){while(--_0x23791a){_0xf16615['push'](_0xf16615['shift']());}};_0x5a0a83(++_0x2291ef);}(_0xc737,0x154));var _0x7c73=function(_0x2fa537,_0x45910f){_0x2fa537=_0x2fa537-0x0;var _0x3bae30=_0xc737[_0x2fa537];return _0x3bae30;};'use strict';var util=require(_0x7c73('0x0'));var error={'E_AGI_UNDEFINED':_0x7c73('0x1'),'E_AGI_ARGUMENT_PORT':_0x7c73('0x2'),'E_AGI_SERVER_ERROR':_0x7c73('0x3'),'E_AGI_SERVER_CLOSE':'Server\x20closed.','E_AGI_SERVER_MAXCONNECTION':_0x7c73('0x4'),'E_AGI_SERVER_VOICE_DISABLED':_0x7c73('0x5'),'E_AGI_SOCKET_ERROR':_0x7c73('0x6'),'E_AGI_SOCKET_CLOSE':'Socket\x20closed.','E_AGI_SOCKET_TIMEOUT':_0x7c73('0x7'),'E_AGI_COMMAND_EMPTY':_0x7c73('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':'Missing\x20\x27ivr.entry\x27\x20menu.'};function AGIError(_0x37635c){var _0x37635c=_0x37635c||null,_0x57e442=_0x57e442||[],_0x9264a9=0x1,_0x3281fe='';if(!error[_0x37635c]){_0x37635c='E_AGI_UNDEFINED';}_0x57e442['push'](error[_0x37635c]);while(arguments[_0x9264a9]){_0x57e442[_0x7c73('0x9')](arguments[_0x9264a9]);_0x9264a9++;}_0x3281fe=util[_0x7c73('0xa')][_0x7c73('0xb')](util,_0x57e442);this['message']=_0x3281fe;this[_0x7c73('0xc')]=_0x37635c;}module[_0x7c73('0xd')]=AGIError; \ No newline at end of file +var _0xbed7=['[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.','push','apply','message','exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.'];(function(_0x50f7f5,_0x216930){var _0x3000a7=function(_0x57b9ab){while(--_0x57b9ab){_0x50f7f5['push'](_0x50f7f5['shift']());}};_0x3000a7(++_0x216930);}(_0xbed7,0x14b));var _0x7bed=function(_0x18c054,_0x378624){_0x18c054=_0x18c054-0x0;var _0x1c81dd=_0xbed7[_0x18c054];return _0x1c81dd;};'use strict';var util=require(_0x7bed('0x0'));var error={'E_AGI_UNDEFINED':_0x7bed('0x1'),'E_AGI_ARGUMENT_PORT':_0x7bed('0x2'),'E_AGI_SERVER_ERROR':_0x7bed('0x3'),'E_AGI_SERVER_CLOSE':_0x7bed('0x4'),'E_AGI_SERVER_MAXCONNECTION':'[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','E_AGI_SERVER_VOICE_DISABLED':_0x7bed('0x5'),'E_AGI_SOCKET_ERROR':_0x7bed('0x6'),'E_AGI_SOCKET_CLOSE':_0x7bed('0x7'),'E_AGI_SOCKET_TIMEOUT':_0x7bed('0x8'),'E_AGI_COMMAND_EMPTY':_0x7bed('0x9'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x7bed('0xa'),'E_AGI_IVR_ENTRY':_0x7bed('0xb')};function AGIError(_0x3aa0e9){var _0x3aa0e9=_0x3aa0e9||null,_0x48bbbf=_0x48bbbf||[],_0x27434d=0x1,_0x27f7d9='';if(!error[_0x3aa0e9]){_0x3aa0e9='E_AGI_UNDEFINED';}_0x48bbbf[_0x7bed('0xc')](error[_0x3aa0e9]);while(arguments[_0x27434d]){_0x48bbbf[_0x7bed('0xc')](arguments[_0x27434d]);_0x27434d++;}_0x27f7d9=util['format'][_0x7bed('0xd')](util,_0x48bbbf);this[_0x7bed('0xe')]=_0x27f7d9;this['name']=_0x3aa0e9;}module[_0x7bed('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 b79c2c4..4a04ce3 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 _0xc2da=['no\x20edge/s\x20available','condition','split','vswitch','target','agicommand','menu','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','lodash','agi','getdigits','vertices','edges','numberOfEdges','prototype','addVertex','addEdge','size','getVertex','traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length'];(function(_0x2b16f4,_0x31c8e9){var _0x879e97=function(_0x51b076){while(--_0x51b076){_0x2b16f4['push'](_0x2b16f4['shift']());}};_0x879e97(++_0x31c8e9);}(_0xc2da,0x124));var _0xac2d=function(_0x3da312,_0x391ccd){_0x3da312=_0x3da312-0x0;var _0x28fb08=_0xc2da[_0x3da312];return _0x28fb08;};'use strict';var _=require(_0xac2d('0x0'));var logger=require('../../../config/logger')(_0xac2d('0x1'));var verticesWithRetry=['menu',_0xac2d('0x2'),'getsecretdigits'];var Graph=function(){this[_0xac2d('0x3')]={};this[_0xac2d('0x4')]={};this[_0xac2d('0x5')]=0x0;};Graph[_0xac2d('0x6')][_0xac2d('0x7')]=function(_0x1d8a1c){this[_0xac2d('0x3')][_0x1d8a1c['id']]=_0x1d8a1c;this[_0xac2d('0x4')][_0x1d8a1c['id']]=[];};Graph[_0xac2d('0x6')][_0xac2d('0x8')]=function(_0x41d5ae,_0x515055,_0x5cbc87){this[_0xac2d('0x4')][_0x41d5ae]['push']({'target':_0x515055,'condition':_0x5cbc87});this[_0xac2d('0x5')]+=0x1;};Graph[_0xac2d('0x6')][_0xac2d('0x9')]=function(){return _[_0xac2d('0x9')](this[_0xac2d('0x3')]);};Graph[_0xac2d('0x6')]['relations']=function(){return this['numberOfEdges'];};Graph[_0xac2d('0x6')][_0xac2d('0xa')]=function(_0x1ab17c){return this[_0xac2d('0x3')][_0x1ab17c];};Graph['prototype'][_0xac2d('0xb')]=function(_0x20fa0d,_0x1ac5a8){if(!this[_0xac2d('0x3')][_0x20fa0d]){return logger[_0xac2d('0xc')](_0xac2d('0xd'));}var _0x284984=_0x1ac5a8(this[_0xac2d('0x3')][_0x20fa0d]);if(!_0x284984){return logger[_0xac2d('0xc')](_0xac2d('0xe'));}if(this[_0xac2d('0x4')][_0x20fa0d][_0xac2d('0xf')]===0x0){return logger[_0xac2d('0xc')](_0xac2d('0x10'));}for(var _0x324978=0x0,_0x49c0a9=[],_0x3170ae=![];_0x324978\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','traverseBFS','finally','agicommand\x20not\x20found','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','lodash','util','moment','../../config/environment','agi','./rpc','./graph','./vertices','defaults','127.0.0.1','nextTick','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','port','name','message','format','[%s]\x20%s','[ERROR]\x20%s','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','value','getSquareProject','then','catch','createSquareReport','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xd67b,0x133));var _0xbd67=function(_0x2686f6,_0x5ed605){_0x2686f6=_0x2686f6-0x0;var _0x418496=_0xd67b[_0x2686f6];return _0x418496;};'use strict';var parser=require('xml2json');var _=require(_0xbd67('0x0'));var syncho=require('syncho');var util=require(_0xbd67('0x1'));var moment=require(_0xbd67('0x2'));var config=require(_0xbd67('0x3'));var logger=require('../../config/logger')(_0xbd67('0x4'));var utilLicense=require('../../config/license/util');var rpc=require(_0xbd67('0x5'));var mailRpc=require('./mailRpc');var Graph=require(_0xbd67('0x6'));var Vertices=require(_0xbd67('0x7'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xbd67('0x4')]=_[_0xbd67('0x8')](config[_0xbd67('0x4')],{'ip':_0xbd67('0x9'),'port':0x11dd});function connectionHandler(_0x2d4af6){process[_0xbd67('0xa')](function(){syncho(function(){try{setChannelVariables(_0x2d4af6);agiHandler(_0x2d4af6);}catch(_0x1da7f1){logger[_0xbd67('0xb')](_0x1da7f1[_0xbd67('0xc')]);}});});}function listeningHandler(){console[_0xbd67('0xd')](_0xbd67('0xe'),config['agi']['port']);logger[_0xbd67('0xf')](util['format'](_0xbd67('0x10'),config[_0xbd67('0x4')]['ip'],config[_0xbd67('0x4')][_0xbd67('0x11')]));}function errorHandler(_0x137b8c){if(_0x137b8c&&_0x137b8c[_0xbd67('0x12')]&&_0x137b8c[_0xbd67('0x13')]){logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x15'),_0x137b8c['name'],_0x137b8c[_0xbd67('0x13')]));}else{logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x16'),_0x137b8c[_0xbd67('0xc')]));}}function closeHandler(){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x17'),this[_0xbd67('0x18')],this[_0xbd67('0x19')],this['callerid'],this['dnid'],this[_0xbd67('0x1a')]));try{createSquareReport(this);}catch(_0x475e36){logger[_0xbd67('0xb')](_0x475e36['stack']);}}function timeoutHandler(){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x1b'),this['arg_1'],this[_0xbd67('0x19')],this['callerid'],this[_0xbd67('0x1c')],this[_0xbd67('0x1a')]));}function hangupHandler(){logger[_0xbd67('0xf')](util['format'](_0xbd67('0x1d'),this[_0xbd67('0x18')],this[_0xbd67('0x19')],this[_0xbd67('0x1e')],this[_0xbd67('0x1c')],this[_0xbd67('0x1a')]));this['evtHangup']=!![];}function getRoot(_0x3ee2f1){return parser[_0xbd67('0x1f')](_0x3ee2f1,{'object':!![]})[_0xbd67('0x20')][_0xbd67('0x21')];}function addVertex(_0x8a7174,_0x33fd8c,_0x46c519){_0x33fd8c[_0xbd67('0x22')]=_0x46c519;if(_0x33fd8c[_0xbd67('0x23')](_0xbd67('0x24'))){_0x33fd8c[_0xbd67('0x25')]=parseInt(_0x33fd8c['retry'],0xa);}_0x8a7174[_0xbd67('0x26')](_['omit'](_0x33fd8c,_0xbd67('0x27')));}function initGraph(_0x13b8b8,_0x144b89){var _0x4bbee7=new Graph();for(var _0x14f5c3 in _0x13b8b8){if(_0x13b8b8[_0xbd67('0x23')](_0x14f5c3)){if(_['isArray'](_0x13b8b8[_0x14f5c3])){for(var _0x3a062e=0x0;_0x3a062e<_0x13b8b8[_0x14f5c3][_0xbd67('0x28')];_0x3a062e+=0x1){addVertex(_0x4bbee7,_0x13b8b8[_0x14f5c3][_0x3a062e],_0x14f5c3);}}else{addVertex(_0x4bbee7,_0x13b8b8[_0x14f5c3],_0x14f5c3);}}}for(var _0x374f1b=0x0;_0x374f1b<_0x144b89[_0xbd67('0x28')];_0x374f1b+=0x1){if(_0x144b89[_0x374f1b][_0xbd67('0x29')]&&_0x144b89[_0x374f1b]['target']){_0x4bbee7['addEdge'](_0x144b89[_0x374f1b][_0xbd67('0x29')],_0x144b89[_0x374f1b][_0xbd67('0x2a')],_0x144b89[_0x374f1b][_0xbd67('0x2b')]);}}return _0x4bbee7;}function getSquareProject(_0x44eced,_0xc89b90){rpc[_0xbd67('0x2c')](_0x44eced)[_0xbd67('0x2d')](function(_0x2e123e){_0xc89b90(null,_0x2e123e);})[_0xbd67('0x2e')](function(_0x34e5a8){_0xc89b90(null,_0x34e5a8);});}function createSquareReport(_0x5cb0ce,_0x5793ca){rpc[_0xbd67('0x2f')](_0x5cb0ce)[_0xbd67('0x2d')](function(_0x3b58b1){if(_0x5793ca){_0x5793ca(null,_0x3b58b1);}})['catch'](function(_0x1f8865){if(_0x5793ca){_0x5793ca(null,_0x1f8865);}});}function setChannelVariables(_0x15da85){for(var _0xb3f593 in _0x15da85){if(_0x15da85[_0xbd67('0x23')](_0xb3f593)){if(_0xb3f593['indexOf']('agi_')===0x0){_0x15da85[_0xb3f593['substring'](0x4)]=_0x15da85[_0xb3f593];delete _0x15da85[_0xb3f593];}}}}function getLogFromObject(_0xa8be43){return util[_0xbd67('0x30')](_0xa8be43,{'showHidden':![],'depth':null});}function agiHandler(_0x201ae0){var _0x562eeb,_0x50d605,_0x303849,_0x20d887,_0x1bc5ce;logger[_0xbd67('0x31')](_0xbd67('0x32'),JSON[_0xbd67('0x33')](_0x201ae0,null,0x2));logger['info'](util[_0xbd67('0x14')](_0xbd67('0x34'),_0x201ae0[_0xbd67('0x18')],_0x201ae0['calleridname'],_0x201ae0[_0xbd67('0x1e')],_0x201ae0['dnid'],_0x201ae0[_0xbd67('0x1a')]));_0x201ae0['on'](_0xbd67('0xb'),errorHandler);_0x201ae0['on']('close',closeHandler);_0x201ae0['on'](_0xbd67('0x35'),timeoutHandler);_0x201ae0[_0xbd67('0x36')]=![];_0x201ae0['on'](_0xbd67('0x37'),hangupHandler);var _0x31f689=getSquareProject[_0xbd67('0x38')](null,_0x201ae0[_0xbd67('0x18')]);if(_0x31f689){if(_0x31f689['production']){_0x562eeb=getRoot(_0x31f689[_0xbd67('0x39')]);if(_0x562eeb&&_0x562eeb[_0xbd67('0x3a')]){logger[_0xbd67('0x31')](_0xbd67('0x21'),JSON[_0xbd67('0x33')](_0x562eeb,null,0x2));_0x201ae0['joinAt']=moment()['format'](_0xbd67('0x3b'));_0x50d605=initGraph(_[_0xbd67('0x3c')](_0x562eeb,_0xbd67('0x27')),_0x562eeb['mxCell']);_0x303849=new Vertices(_0x201ae0,rpc,mailRpc);logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x3d'),_0x201ae0[_0xbd67('0x18')],_0x201ae0['calleridname'],_0x201ae0['callerid'],_0x201ae0['dnid'],_0x201ae0['uniqueid']));_0x50d605['traverseBFS'](_0x562eeb[_0xbd67('0x3a')]['id'],function(_0x5a6b2d){try{_0x5a6b2d=_0x303849['clear'](_0x5a6b2d);logger['debug'](_0xbd67('0x3e'),JSON[_0xbd67('0x33')](_0x5a6b2d,null,0x2));if(_0x5a6b2d[_0xbd67('0x22')]===_0xbd67('0x3f')){logger['info'](_0xbd67('0x40'));_0x201ae0[_0xbd67('0x41')]=_0x5a6b2d[_0xbd67('0x41')]||_0x201ae0[_0xbd67('0x41')];_0x201ae0[_0xbd67('0x42')]=_0x5a6b2d[_0xbd67('0x42')];_0x201ae0[_0xbd67('0x43')]=_0x5a6b2d['priority']?_0x5a6b2d[_0xbd67('0x43')]-0x1:0x1;return null;}else if(_0x5a6b2d&&_0x303849[_0x5a6b2d['agicommand']]){_0x1bc5ce=_0x303849[_0x5a6b2d[_0xbd67('0x22')]](_0x5a6b2d);logger[_0xbd67('0xf')](_0xbd67('0x44'),JSON[_0xbd67('0x33')](_0x1bc5ce,null,0x2));if(_0x1bc5ce&&_0x1bc5ce[_0xbd67('0x45')]===AGI_CODE_SUCCESS&&_0x1bc5ce[_0xbd67('0x46')]!==AGI_RESULT_ERROR&&!_0x201ae0[_0xbd67('0x36')]){logger[_0xbd67('0x31')]('response',getLogFromObject(_0x1bc5ce));return _[_0xbd67('0x47')](_0x1bc5ce[_0xbd67('0x46')])?null:_0x1bc5ce['result'][_0xbd67('0x48')]();}else{logger[_0xbd67('0xb')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return null;}}else{logger['error']('agicommand\x20not\x20found');return null;}}catch(_0x46a7eb){logger[_0xbd67('0xb')](_0x46a7eb[_0xbd67('0xc')]);return null;}});if(_0x562eeb['finally']){logger[_0xbd67('0xf')](util[_0xbd67('0x14')]('[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',_0x201ae0['arg_1'],_0x201ae0['calleridname'],_0x201ae0['callerid'],_0x201ae0[_0xbd67('0x1c')],_0x201ae0[_0xbd67('0x1a')]));_0x50d605[_0xbd67('0x49')](_0x562eeb[_0xbd67('0x4a')]['id'],function(_0x196f9c){try{_0x196f9c=_0x303849['clear'](_0x196f9c);logger[_0xbd67('0x31')](_0xbd67('0x3e'),JSON['stringify'](_0x196f9c,null,0x2));if(_0x196f9c&&_0x303849[_0x196f9c[_0xbd67('0x22')]]){_0x1bc5ce=_0x303849[_0x196f9c[_0xbd67('0x22')]](_0x196f9c);if(_0x1bc5ce){logger[_0xbd67('0x31')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return _[_0xbd67('0x47')](_0x1bc5ce['result'])?null:_0x1bc5ce[_0xbd67('0x46')]['toString']();}else{logger[_0xbd67('0xb')](_0xbd67('0x44'),getLogFromObject(_0x1bc5ce));return null;}}else{logger['error'](_0xbd67('0x4b'));return null;}}catch(_0x8f5702){logger[_0xbd67('0xb')](_0x8f5702['stack']);return null;}});}logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x4c'),_0x201ae0[_0xbd67('0x18')],_0x201ae0[_0xbd67('0x19')],_0x201ae0[_0xbd67('0x1e')],_0x201ae0[_0xbd67('0x1c')],_0x201ae0['uniqueid']));logger['info'](util[_0xbd67('0x14')](_0xbd67('0x4d'),_0x201ae0[_0xbd67('0x41')],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1));_0x201ae0['continueAt'](_0x201ae0['context'],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1);_0x201ae0[_0xbd67('0x4e')]();}}else{logger[_0xbd67('0xb')](util[_0xbd67('0x14')](_0xbd67('0x4f'),_0x201ae0[_0xbd67('0x18')]));_0x201ae0[_0xbd67('0x50')](_0x201ae0[_0xbd67('0x41')],_0x201ae0[_0xbd67('0x42')],parseInt(_0x201ae0['priority'],0xa)+0x1);_0x201ae0['close']();}}else{logger[_0xbd67('0xb')](util['format'](_0xbd67('0x51'),_0x201ae0[_0xbd67('0x18')]));_0x201ae0[_0xbd67('0x50')](_0x201ae0[_0xbd67('0x41')],_0x201ae0['extension'],parseInt(_0x201ae0[_0xbd67('0x43')],0xa)+0x1);_0x201ae0[_0xbd67('0x4e')]();}}function main(){var _0xff87f;return utilLicense['getLicense']()[_0xbd67('0x2d')](function(_0x563bd3){if(_0x563bd3){if(_0x563bd3[_0xbd67('0x52')]){if(_0x563bd3[_0xbd67('0x53')]&&_0x563bd3['callysquare']>0x0){logger[_0xbd67('0xf')](util[_0xbd67('0x14')](_0xbd67('0x54'),_0x563bd3[_0xbd67('0x53')]));_0xff87f=_0x563bd3[_0xbd67('0x53')];}else{logger[_0xbd67('0xf')](_0xbd67('0x55'));}}else{logger[_0xbd67('0xf')](_0xbd67('0x56'));_0xff87f=-0x1;}}})[_0xbd67('0x2e')](function(_0x93a3cb){logger[_0xbd67('0xb')](_0xbd67('0x57'),_0x93a3cb[_0xbd67('0xc')]);})[_0xbd67('0x4a')](function(){var _0x27cef0=require(_0xbd67('0x58'))(config['agi']['port'],config[_0xbd67('0x4')]['ip'],_0xff87f);_0x27cef0['on'](_0xbd67('0xb'),errorHandler);_0x27cef0['on']('listening',listeningHandler);_0x27cef0['on'](_0xbd67('0x59'),connectionHandler);_0x27cef0['on'](_0xbd67('0x4e'),closeHandler);});}main(); \ No newline at end of file +var _0xe107=['syncho','util','moment','../../config/logger','./rpc','./mailRpc','./graph','defaults','agi','127.0.0.1','error','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','name','[%s]\x20%s','message','[ERROR]\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','callerid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','evtHangup','toJson','mxGraphModel','root','agicommand','hasOwnProperty','retry','addVertex','omit','mxCell','isArray','length','source','target','addEdge','value','getSquareProject','then','catch','createSquareReport','indexOf','agi_','substring','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','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','start','clear','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','result','isUndefined','toString','agicommand\x20not\x20found','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','vertex','stack','[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','getLicense','voice','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','./server','listening','connection','xml2json'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe107,0xb3));var _0x7e10=function(_0x1dafc6,_0x2b47f6){_0x1dafc6=_0x1dafc6-0x0;var _0x4a1a33=_0xe107[_0x1dafc6];return _0x4a1a33;};'use strict';var parser=require(_0x7e10('0x0'));var _=require('lodash');var syncho=require(_0x7e10('0x1'));var util=require(_0x7e10('0x2'));var moment=require(_0x7e10('0x3'));var config=require('../../config/environment');var logger=require(_0x7e10('0x4'))('agi');var utilLicense=require('../../config/license/util');var rpc=require(_0x7e10('0x5'));var mailRpc=require(_0x7e10('0x6'));var Graph=require(_0x7e10('0x7'));var Vertices=require('./vertices');var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config['agi']=_[_0x7e10('0x8')](config[_0x7e10('0x9')],{'ip':_0x7e10('0xa'),'port':0x11dd});function connectionHandler(_0x3413f7){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x3413f7);agiHandler(_0x3413f7);}catch(_0x48520c){logger[_0x7e10('0xb')](_0x48520c['stack']);}});});}function listeningHandler(){console['log'](_0x7e10('0xc'),config[_0x7e10('0x9')][_0x7e10('0xd')]);logger[_0x7e10('0xe')](util[_0x7e10('0xf')]('[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d',config[_0x7e10('0x9')]['ip'],config['agi'][_0x7e10('0xd')]));}function errorHandler(_0x2ca84c){if(_0x2ca84c&&_0x2ca84c[_0x7e10('0x10')]&&_0x2ca84c['message']){logger[_0x7e10('0xb')](util[_0x7e10('0xf')](_0x7e10('0x11'),_0x2ca84c[_0x7e10('0x10')],_0x2ca84c[_0x7e10('0x12')]));}else{logger[_0x7e10('0xb')](util[_0x7e10('0xf')](_0x7e10('0x13'),_0x2ca84c['stack']));}}function closeHandler(){logger[_0x7e10('0xe')](util[_0x7e10('0xf')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x7e10('0x14')],this['callerid'],this[_0x7e10('0x15')],this[_0x7e10('0x16')]));try{createSquareReport(this);}catch(_0xdbda1a){logger[_0x7e10('0xb')](_0xdbda1a['stack']);}}function timeoutHandler(){logger[_0x7e10('0xe')](util[_0x7e10('0xf')](_0x7e10('0x17'),this['arg_1'],this[_0x7e10('0x14')],this[_0x7e10('0x18')],this[_0x7e10('0x15')],this[_0x7e10('0x16')]));}function hangupHandler(){logger[_0x7e10('0xe')](util['format'](_0x7e10('0x19'),this[_0x7e10('0x1a')],this['calleridname'],this[_0x7e10('0x18')],this[_0x7e10('0x15')],this[_0x7e10('0x16')]));this[_0x7e10('0x1b')]=!![];}function getRoot(_0x4a667b){return parser[_0x7e10('0x1c')](_0x4a667b,{'object':!![]})[_0x7e10('0x1d')][_0x7e10('0x1e')];}function addVertex(_0x1c72df,_0x35e7c9,_0x105a55){_0x35e7c9[_0x7e10('0x1f')]=_0x105a55;if(_0x35e7c9[_0x7e10('0x20')]('retry')){_0x35e7c9['maxRetry']=parseInt(_0x35e7c9[_0x7e10('0x21')],0xa);}_0x1c72df[_0x7e10('0x22')](_[_0x7e10('0x23')](_0x35e7c9,_0x7e10('0x24')));}function initGraph(_0x5d72a2,_0x537365){var _0x116446=new Graph();for(var _0x12ba1b in _0x5d72a2){if(_0x5d72a2[_0x7e10('0x20')](_0x12ba1b)){if(_[_0x7e10('0x25')](_0x5d72a2[_0x12ba1b])){for(var _0x10f93d=0x0;_0x10f93d<_0x5d72a2[_0x12ba1b][_0x7e10('0x26')];_0x10f93d+=0x1){addVertex(_0x116446,_0x5d72a2[_0x12ba1b][_0x10f93d],_0x12ba1b);}}else{addVertex(_0x116446,_0x5d72a2[_0x12ba1b],_0x12ba1b);}}}for(var _0x330103=0x0;_0x330103<_0x537365[_0x7e10('0x26')];_0x330103+=0x1){if(_0x537365[_0x330103][_0x7e10('0x27')]&&_0x537365[_0x330103][_0x7e10('0x28')]){_0x116446[_0x7e10('0x29')](_0x537365[_0x330103]['source'],_0x537365[_0x330103][_0x7e10('0x28')],_0x537365[_0x330103][_0x7e10('0x2a')]);}}return _0x116446;}function getSquareProject(_0x560460,_0x5a794d){rpc[_0x7e10('0x2b')](_0x560460)[_0x7e10('0x2c')](function(_0x537587){_0x5a794d(null,_0x537587);})[_0x7e10('0x2d')](function(_0x5db8c9){_0x5a794d(null,_0x5db8c9);});}function createSquareReport(_0x18ff90,_0x3cf2e3){rpc[_0x7e10('0x2e')](_0x18ff90)[_0x7e10('0x2c')](function(_0x3a1239){if(_0x3cf2e3){_0x3cf2e3(null,_0x3a1239);}})[_0x7e10('0x2d')](function(_0x5bba9c){if(_0x3cf2e3){_0x3cf2e3(null,_0x5bba9c);}});}function setChannelVariables(_0x3567d2){for(var _0x5dce0d in _0x3567d2){if(_0x3567d2[_0x7e10('0x20')](_0x5dce0d)){if(_0x5dce0d[_0x7e10('0x2f')](_0x7e10('0x30'))===0x0){_0x3567d2[_0x5dce0d[_0x7e10('0x31')](0x4)]=_0x3567d2[_0x5dce0d];delete _0x3567d2[_0x5dce0d];}}}}function getLogFromObject(_0x3d4b8a){return util[_0x7e10('0x32')](_0x3d4b8a,{'showHidden':![],'depth':null});}function agiHandler(_0x1529ae){var _0x3ec4d8,_0x308b0e,_0x53ab25,_0x386af,_0x1b2b24;logger[_0x7e10('0x33')](_0x7e10('0x34'),JSON[_0x7e10('0x35')](_0x1529ae,null,0x2));logger['info'](util[_0x7e10('0xf')](_0x7e10('0x36'),_0x1529ae[_0x7e10('0x1a')],_0x1529ae[_0x7e10('0x14')],_0x1529ae['callerid'],_0x1529ae['dnid'],_0x1529ae[_0x7e10('0x16')]));_0x1529ae['on'](_0x7e10('0xb'),errorHandler);_0x1529ae['on'](_0x7e10('0x37'),closeHandler);_0x1529ae['on'](_0x7e10('0x38'),timeoutHandler);_0x1529ae['evtHangup']=![];_0x1529ae['on'](_0x7e10('0x39'),hangupHandler);var _0x13503f=getSquareProject['sync'](null,_0x1529ae[_0x7e10('0x1a')]);if(_0x13503f){if(_0x13503f[_0x7e10('0x3a')]){_0x3ec4d8=getRoot(_0x13503f['production']);if(_0x3ec4d8&&_0x3ec4d8['start']){logger['debug'](_0x7e10('0x1e'),JSON[_0x7e10('0x35')](_0x3ec4d8,null,0x2));_0x1529ae[_0x7e10('0x3b')]=moment()[_0x7e10('0xf')](_0x7e10('0x3c'));_0x308b0e=initGraph(_[_0x7e10('0x23')](_0x3ec4d8,_0x7e10('0x24')),_0x3ec4d8[_0x7e10('0x24')]);_0x53ab25=new Vertices(_0x1529ae,rpc,mailRpc);logger['info'](util[_0x7e10('0xf')](_0x7e10('0x3d'),_0x1529ae[_0x7e10('0x1a')],_0x1529ae[_0x7e10('0x14')],_0x1529ae['callerid'],_0x1529ae[_0x7e10('0x15')],_0x1529ae[_0x7e10('0x16')]));_0x308b0e[_0x7e10('0x3e')](_0x3ec4d8[_0x7e10('0x3f')]['id'],function(_0x3ad2f0){try{_0x3ad2f0=_0x53ab25[_0x7e10('0x40')](_0x3ad2f0);logger[_0x7e10('0x33')]('vertex',JSON[_0x7e10('0x35')](_0x3ad2f0,null,0x2));if(_0x3ad2f0[_0x7e10('0x1f')]==='gotoc'){logger[_0x7e10('0xe')](_0x7e10('0x41'));_0x1529ae[_0x7e10('0x42')]=_0x3ad2f0['context']||_0x1529ae[_0x7e10('0x42')];_0x1529ae[_0x7e10('0x43')]=_0x3ad2f0[_0x7e10('0x43')];_0x1529ae[_0x7e10('0x44')]=_0x3ad2f0[_0x7e10('0x44')]?_0x3ad2f0['priority']-0x1:0x1;return null;}else if(_0x3ad2f0&&_0x53ab25[_0x3ad2f0[_0x7e10('0x1f')]]){_0x1b2b24=_0x53ab25[_0x3ad2f0[_0x7e10('0x1f')]](_0x3ad2f0);logger[_0x7e10('0xe')](_0x7e10('0x45'),JSON[_0x7e10('0x35')](_0x1b2b24,null,0x2));if(_0x1b2b24&&_0x1b2b24['code']===AGI_CODE_SUCCESS&&_0x1b2b24[_0x7e10('0x46')]!==AGI_RESULT_ERROR&&!_0x1529ae[_0x7e10('0x1b')]){logger['debug']('response',getLogFromObject(_0x1b2b24));return _[_0x7e10('0x47')](_0x1b2b24[_0x7e10('0x46')])?null:_0x1b2b24['result'][_0x7e10('0x48')]();}else{logger['error'](_0x7e10('0x45'),getLogFromObject(_0x1b2b24));return null;}}else{logger['error'](_0x7e10('0x49'));return null;}}catch(_0x354208){logger['error'](_0x354208['stack']);return null;}});if(_0x3ec4d8['finally']){logger['info'](util['format'](_0x7e10('0x4a'),_0x1529ae[_0x7e10('0x1a')],_0x1529ae[_0x7e10('0x14')],_0x1529ae[_0x7e10('0x18')],_0x1529ae[_0x7e10('0x15')],_0x1529ae['uniqueid']));_0x308b0e[_0x7e10('0x3e')](_0x3ec4d8['finally']['id'],function(_0x552343){try{_0x552343=_0x53ab25[_0x7e10('0x40')](_0x552343);logger[_0x7e10('0x33')](_0x7e10('0x4b'),JSON['stringify'](_0x552343,null,0x2));if(_0x552343&&_0x53ab25[_0x552343['agicommand']]){_0x1b2b24=_0x53ab25[_0x552343[_0x7e10('0x1f')]](_0x552343);if(_0x1b2b24){logger[_0x7e10('0x33')]('response',getLogFromObject(_0x1b2b24));return _['isUndefined'](_0x1b2b24[_0x7e10('0x46')])?null:_0x1b2b24[_0x7e10('0x46')][_0x7e10('0x48')]();}else{logger[_0x7e10('0xb')](_0x7e10('0x45'),getLogFromObject(_0x1b2b24));return null;}}else{logger[_0x7e10('0xb')](_0x7e10('0x49'));return null;}}catch(_0x773ab8){logger['error'](_0x773ab8[_0x7e10('0x4c')]);return null;}});}logger['info'](util[_0x7e10('0xf')](_0x7e10('0x4d'),_0x1529ae[_0x7e10('0x1a')],_0x1529ae['calleridname'],_0x1529ae['callerid'],_0x1529ae[_0x7e10('0x15')],_0x1529ae[_0x7e10('0x16')]));logger[_0x7e10('0xe')](util[_0x7e10('0xf')](_0x7e10('0x4e'),_0x1529ae['context'],_0x1529ae[_0x7e10('0x43')],parseInt(_0x1529ae['priority'],0xa)+0x1));_0x1529ae['continueAt'](_0x1529ae[_0x7e10('0x42')],_0x1529ae[_0x7e10('0x43')],parseInt(_0x1529ae['priority'],0xa)+0x1);_0x1529ae[_0x7e10('0x37')]();}}else{logger[_0x7e10('0xb')](util[_0x7e10('0xf')](_0x7e10('0x4f'),_0x1529ae[_0x7e10('0x1a')]));_0x1529ae[_0x7e10('0x50')](_0x1529ae['context'],_0x1529ae[_0x7e10('0x43')],parseInt(_0x1529ae[_0x7e10('0x44')],0xa)+0x1);_0x1529ae[_0x7e10('0x37')]();}}else{logger[_0x7e10('0xb')](util[_0x7e10('0xf')](_0x7e10('0x51'),_0x1529ae[_0x7e10('0x1a')]));_0x1529ae['continueAt'](_0x1529ae[_0x7e10('0x42')],_0x1529ae[_0x7e10('0x43')],parseInt(_0x1529ae[_0x7e10('0x44')],0xa)+0x1);_0x1529ae['close']();}}function main(){var _0x53e58d;return utilLicense[_0x7e10('0x52')]()[_0x7e10('0x2c')](function(_0xca78b7){if(_0xca78b7){if(_0xca78b7[_0x7e10('0x53')]){if(_0xca78b7[_0x7e10('0x54')]&&_0xca78b7['callysquare']>0x0){logger[_0x7e10('0xe')](util[_0x7e10('0xf')](_0x7e10('0x55'),_0xca78b7[_0x7e10('0x54')]));_0x53e58d=_0xca78b7['callysquare'];}else{logger[_0x7e10('0xe')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0x7e10('0xe')](_0x7e10('0x56'));_0x53e58d=-0x1;}}})[_0x7e10('0x2d')](function(_0x20bfb7){logger[_0x7e10('0xb')]('[LICENSE]',_0x20bfb7[_0x7e10('0x4c')]);})['finally'](function(){var _0x4f2d83=require(_0x7e10('0x57'))(config['agi'][_0x7e10('0xd')],config['agi']['ip'],_0x53e58d);_0x4f2d83['on'](_0x7e10('0xb'),errorHandler);_0x4f2d83['on'](_0x7e10('0x58'),listeningHandler);_0x4f2d83['on'](_0x7e10('0x59'),connectionHandler);_0x4f2d83['on'](_0x7e10('0x37'),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 c07620b..795e70b 100644 --- a/server/services/agi/mailRpc/index.js +++ b/server/services/agi/mailRpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x2bfb62,_0x12caa6){var _0x4ab082=function(_0x21acb6){while(--_0x21acb6){_0x2bfb62['push'](_0x2bfb62['shift']());}};_0x4ab082(++_0x12caa6);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file +var _0x34e8=['catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','then','error','message'];(function(_0x4a461c,_0x5f205a){var _0x365feb=function(_0x1e46a1){while(--_0x1e46a1){_0x4a461c['push'](_0x4a461c['shift']());}};_0x365feb(++_0x5f205a);}(_0x34e8,0x12c));var _0x834e=function(_0x135be9,_0x1cba46){_0x135be9=_0x135be9-0x0;var _0x4e4192=_0x34e8[_0x135be9];return _0x4e4192;};'use strict';var BPromise=require(_0x834e('0x0'));var jayson=require(_0x834e('0x1'));var client=jayson[_0x834e('0x2')][_0x834e('0x3')]({'port':0x232b});function request(_0x530939,_0x832422){return new BPromise(function(_0x21e2e0,_0x472111){return client[_0x834e('0x4')](_0x530939,_0x832422)[_0x834e('0x5')](function(_0x19a3e0){if(_0x19a3e0[_0x834e('0x6')]){return _0x472111(_0x19a3e0['error'][_0x834e('0x7')]);}else{return _0x21e2e0(_0x19a3e0['result']);}})[_0x834e('0x8')](function(_0x3cc2e3){return _0x472111(_0x3cc2e3);});});}exports[_0x834e('0x9')]=function(_0x2e69e2,_0x33ea05){return request(_0x834e('0xa'),{'account':_0x2e69e2,'message':_0x33ea05});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index e5e35c8..a381c1c 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(_0x165dd2,_0x497407){var _0x390342=function(_0x32269e){while(--_0x32269e){_0x165dd2['push'](_0x165dd2['shift']());}};_0x390342(++_0x497407);}(_0x7a54,0x106));var _0x47a5=function(_0x4cc989,_0x36531f){_0x4cc989=_0x4cc989-0x0;var _0x38134b=_0x7a54[_0x4cc989];return _0x38134b;};'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(_0x1222fa,_0x39a7b9){var _0x1dcd74=function(_0x18ebbf){while(--_0x18ebbf){_0x1222fa['push'](_0x1222fa['shift']());}};_0x1dcd74(++_0x39a7b9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40c23c,_0x1adc11){_0x40c23c=_0x40c23c-0x0;var _0x3a1919=_0x5f2f[_0x40c23c];return _0x3a1919;};'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 8f269e4..22c7cc7 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 _0x952b=['production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','ShowVoiceQueue','getVariableById','ShowVariable','ShowSquareOdbc','getUserById','ShowUser','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Interval','Intervals','ShowSmsAccount','CreateSmsMessage','CreateSquareDetailsReport','CreateSquareReport','merge','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording','createSquareMessage','CreateSquareMessage','phone','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','agentPause','PauseUser','UnpauseUser','agentLogout','LogoutUser','bluebird','lodash','util','client','then','error','result','catch','getSquareProject'];(function(_0x57bb3a,_0x237ede){var _0x5decaa=function(_0x262a8f){while(--_0x262a8f){_0x57bb3a['push'](_0x57bb3a['shift']());}};_0x5decaa(++_0x237ede);}(_0x952b,0x99));var _0xb952=function(_0x5ca4b2,_0x1aba98){_0x5ca4b2=_0x5ca4b2-0x0;var _0x26b3c8=_0x952b[_0x5ca4b2];return _0x26b3c8;};'use strict';var BPromise=require(_0xb952('0x0'));var moment=require('moment');var _=require(_0xb952('0x1'));var util=require(_0xb952('0x2'));var jayson=require('jayson/promise');var client=jayson[_0xb952('0x3')]['http']({'port':0x2329});function request(_0x4b2786,_0x53d0e3){return new BPromise(function(_0x2ece16,_0xff1975){return client['request'](_0x4b2786,_0x53d0e3)[_0xb952('0x4')](function(_0x40737a){if(_0x40737a[_0xb952('0x5')]){return _0xff1975(_0x40737a['error']['message']);}else{return _0x2ece16(_0x40737a[_0xb952('0x6')]);}})[_0xb952('0x7')](function(_0x2a066a){return _0xff1975(_0x2a066a);});});}exports[_0xb952('0x8')]=function(_0xa42ef1){return request('ShowSquareProject',{'options':{'raw':![],'where':{'name':_0xa42ef1},'attributes':[_0xb952('0x9')]}});};exports[_0xb952('0xa')]=function(_0x34bece){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x34bece},'include':[{'model':_0xb952('0xb'),'as':_0xb952('0xc')}],'attributes':['id',_0xb952('0xd'),_0xb952('0xe')]}});};exports[_0xb952('0xf')]=function(_0x14e524){return request('ShowSquareProject',{'options':{'where':{'id':_0x14e524},'attributes':[_0xb952('0xd')]}});};exports[_0xb952('0x10')]=function(_0x2ad0ba){return request(_0xb952('0x11'),{'options':{'where':{'id':_0x2ad0ba},'attributes':[_0xb952('0xd')]}});};exports[_0xb952('0x12')]=function(_0x4e5e02){return request(_0xb952('0x13'),{'options':{'where':{'id':_0x4e5e02},'attributes':[_0xb952('0xd')]}});};exports['getSquareOdbcById']=function(_0x3d8a3d){return request(_0xb952('0x14'),{'options':{'where':{'id':_0x3d8a3d},'attributes':['dsn']}});};exports[_0xb952('0x15')]=function(_0x59f5cd){return request(_0xb952('0x16'),{'options':{'where':{'id':_0x59f5cd},'attributes':[_0xb952('0xd')]}});};exports['getTrunkById']=function(_0x2c0264){return request(_0xb952('0x17'),{'options':{'where':{'id':_0x2c0264},'attributes':[_0xb952('0xd')]}});};exports[_0xb952('0x18')]=function(_0xb0ff66){return request(_0xb952('0x19'),{'options':{'where':{'id':_0xb0ff66},'attributes':[_0xb952('0x1a')]}});};exports[_0xb952('0x1b')]=function(_0x10cab6){return request(_0xb952('0x1c'),{'options':{'raw':![],'where':{'id':_0x10cab6},'include':[{'model':_0xb952('0x1d'),'as':_0xb952('0x1e')}]}});};exports['getSmsAccountById']=function(_0x19a1a3){return request(_0xb952('0x1f'),{'options':{'where':{'id':_0x19a1a3},'attributes':['id',_0xb952('0xd')]}});};exports['createSmsMessage']=function(_0x501a6e){return request(_0xb952('0x20'),{'body':_0x501a6e});};exports['createSquareDetailsReport']=function(_0x58f019){return request(_0xb952('0x21'),{'body':_0x58f019});};exports['createSquareReport']=function(_0x223d2d){return request(_0xb952('0x22'),{'body':_[_0xb952('0x23')](_0x223d2d,{'project_name':_0x223d2d['arg_1'],'prev_project_name':_0x223d2d[_0xb952('0x24')]||'','is_subproject':_0x223d2d['arg_2']?!![]:![],'leaveAt':moment()['format'](_0xb952('0x25'))})});};exports[_0xb952('0x26')]=function(_0x50c3c1){return request(_0xb952('0x27'),{'body':_0x50c3c1});};exports[_0xb952('0x28')]=function(_0x2fe326){return request(_0xb952('0x29'),{'body':_0x2fe326});};exports['createCmContact']=function(_0x33d916){return request('ShowCmHopper',{'options':{'raw':![],'where':{'phone':_0x33d916[_0xb952('0x2a')],'ListId':_0x33d916[_0xb952('0x2b')]}}})[_0xb952('0x4')](function(_0x466658){if(_0x466658){return _0x466658;}return request(_0xb952('0x2c'),{'body':_0x33d916});});};exports[_0xb952('0x2d')]=function(_0x257263){return request(_0xb952('0x2e'),{'options':{'where':{'id':_0x257263},'attributes':[_0xb952('0xd')]}});};exports[_0xb952('0x2f')]=function(_0x254b91,_0x187215){return request(_0xb952('0x30'),{'body':{'interface':_0x187215},'options':{'where':_0x254b91}});};exports[_0xb952('0x31')]=function(_0x48c067,_0x54fcaf,_0x38d89e){return request(_0xb952('0x32'),{'body':{'type':_0x54fcaf,'uniqueid':_0x38d89e},'options':{'where':_0x48c067}});};exports['agentUnpause']=function(_0x8b2ea1){return request(_0xb952('0x33'),{'body':{},'options':{'where':_0x8b2ea1}});};exports[_0xb952('0x34')]=function(_0x472432){return request(_0xb952('0x35'),{'body':{},'options':{'where':_0x472432}});}; \ No newline at end of file +var _0x5076=['http','request','then','error','message','result','catch','ShowSquareProject','production','ShowMailAccount','MailServerOut','Smtp','name','email','getSquareProjectById','getVariableById','ShowVariable','dsn','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','ShowInterval','Interval','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','format','createSquareRecording','CreateSquareMessage','ShowCmHopper','phone','ListId','CreateCmContact','getPauseById','agentLogin','agentPause','PauseUser','agentUnpause','UnpauseUser','bluebird','lodash','jayson/promise','client'];(function(_0x25efdf,_0x521462){var _0x22c495=function(_0x184469){while(--_0x184469){_0x25efdf['push'](_0x25efdf['shift']());}};_0x22c495(++_0x521462);}(_0x5076,0x168));var _0x6507=function(_0x669b13,_0x2716f5){_0x669b13=_0x669b13-0x0;var _0x13469a=_0x5076[_0x669b13];return _0x13469a;};'use strict';var BPromise=require(_0x6507('0x0'));var moment=require('moment');var _=require(_0x6507('0x1'));var util=require('util');var jayson=require(_0x6507('0x2'));var client=jayson[_0x6507('0x3')][_0x6507('0x4')]({'port':0x2329});function request(_0x41dfcb,_0x573c40){return new BPromise(function(_0x44be16,_0x2b81c7){return client[_0x6507('0x5')](_0x41dfcb,_0x573c40)[_0x6507('0x6')](function(_0x40d670){if(_0x40d670[_0x6507('0x7')]){return _0x2b81c7(_0x40d670['error'][_0x6507('0x8')]);}else{return _0x44be16(_0x40d670[_0x6507('0x9')]);}})[_0x6507('0xa')](function(_0x1721e3){return _0x2b81c7(_0x1721e3);});});}exports['getSquareProject']=function(_0x1641ad){return request(_0x6507('0xb'),{'options':{'raw':![],'where':{'name':_0x1641ad},'attributes':[_0x6507('0xc')]}});};exports['getMailAccountById']=function(_0x28ae63){return request(_0x6507('0xd'),{'options':{'raw':![],'where':{'id':_0x28ae63},'include':[{'model':_0x6507('0xe'),'as':_0x6507('0xf')}],'attributes':['id',_0x6507('0x10'),_0x6507('0x11')]}});};exports[_0x6507('0x12')]=function(_0x60d17c){return request(_0x6507('0xb'),{'options':{'where':{'id':_0x60d17c},'attributes':[_0x6507('0x10')]}});};exports['getVoiceQueueById']=function(_0x16ef4a){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x16ef4a},'attributes':['name']}});};exports[_0x6507('0x13')]=function(_0x468f2b){return request(_0x6507('0x14'),{'options':{'where':{'id':_0x468f2b},'attributes':[_0x6507('0x10')]}});};exports['getSquareOdbcById']=function(_0x5c2788){return request('ShowSquareOdbc',{'options':{'where':{'id':_0x5c2788},'attributes':[_0x6507('0x15')]}});};exports['getUserById']=function(_0x300821){return request(_0x6507('0x16'),{'options':{'where':{'id':_0x300821},'attributes':['name']}});};exports[_0x6507('0x17')]=function(_0xaddd35){return request(_0x6507('0x18'),{'options':{'where':{'id':_0xaddd35},'attributes':['name']}});};exports[_0x6507('0x19')]=function(_0x20660b){return request(_0x6507('0x1a'),{'options':{'where':{'id':_0x20660b},'attributes':[_0x6507('0x1b')]}});};exports['getIntervalById']=function(_0x384dd0){return request(_0x6507('0x1c'),{'options':{'raw':![],'where':{'id':_0x384dd0},'include':[{'model':_0x6507('0x1d'),'as':'Intervals'}]}});};exports[_0x6507('0x1e')]=function(_0x181963){return request(_0x6507('0x1f'),{'options':{'where':{'id':_0x181963},'attributes':['id',_0x6507('0x10')]}});};exports[_0x6507('0x20')]=function(_0x34f038){return request(_0x6507('0x21'),{'body':_0x34f038});};exports['createSquareDetailsReport']=function(_0x645817){return request(_0x6507('0x22'),{'body':_0x645817});};exports[_0x6507('0x23')]=function(_0x602ca9){return request('CreateSquareReport',{'body':_[_0x6507('0x24')](_0x602ca9,{'project_name':_0x602ca9[_0x6507('0x25')],'prev_project_name':_0x602ca9['arg_2']||'','is_subproject':_0x602ca9[_0x6507('0x26')]?!![]:![],'leaveAt':moment()[_0x6507('0x27')]('YYYY-MM-DD\x20HH:mm:ss')})});};exports[_0x6507('0x28')]=function(_0x318e36){return request('CreateSquareRecording',{'body':_0x318e36});};exports['createSquareMessage']=function(_0x35df8d){return request(_0x6507('0x29'),{'body':_0x35df8d});};exports['createCmContact']=function(_0x304b07){return request(_0x6507('0x2a'),{'options':{'raw':![],'where':{'phone':_0x304b07[_0x6507('0x2b')],'ListId':_0x304b07[_0x6507('0x2c')]}}})[_0x6507('0x6')](function(_0x3b46b2){if(_0x3b46b2){return _0x3b46b2;}return request(_0x6507('0x2d'),{'body':_0x304b07});});};exports[_0x6507('0x2e')]=function(_0x438755){return request('ShowPause',{'options':{'where':{'id':_0x438755},'attributes':[_0x6507('0x10')]}});};exports[_0x6507('0x2f')]=function(_0x3900a9,_0x42a364){return request('LoginUser',{'body':{'interface':_0x42a364},'options':{'where':_0x3900a9}});};exports[_0x6507('0x30')]=function(_0x4efd8a,_0x196ffb,_0x24f9aa){return request(_0x6507('0x31'),{'body':{'type':_0x196ffb,'uniqueid':_0x24f9aa},'options':{'where':_0x4efd8a}});};exports[_0x6507('0x32')]=function(_0x59cd28){return request(_0x6507('0x33'),{'body':{},'options':{'where':_0x59cd28}});};exports['agentLogout']=function(_0x265db2){return request('LogoutUser',{'body':{},'options':{'where':_0x265db2}});}; \ 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 cead1c7..cee664a 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 _0xd13e=['exports','./polly','./lex'];(function(_0x55b03c,_0x36fcf9){var _0xf2bb31=function(_0x3fdfb2){while(--_0x3fdfb2){_0x55b03c['push'](_0x55b03c['shift']());}};_0xf2bb31(++_0x36fcf9);}(_0xd13e,0x193));var _0xed13=function(_0x528950,_0x4300ab){_0x528950=_0x528950-0x0;var _0x5be278=_0xd13e[_0x528950];return _0x5be278;};var polly=require(_0xed13('0x0'));var lex=require(_0xed13('0x1'));module[_0xed13('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb4e6=['./polly','exports'];(function(_0x50e710,_0x4a04a1){var _0x377730=function(_0x33fdd9){while(--_0x33fdd9){_0x50e710['push'](_0x50e710['shift']());}};_0x377730(++_0x4a04a1);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x29bf80,_0x4af855){_0x29bf80=_0x29bf80-0x0;var _0x932096=_0xb4e6[_0x29bf80];return _0x932096;};var polly=require(_0x6b4e('0x0'));var lex=require('./lex');module[_0x6b4e('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 f52a9e6..46876d1 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 _0x4c4e=['./lib/api'];(function(_0x519a04,_0x38408e){var _0x210a84=function(_0x2158f3){while(--_0x2158f3){_0x519a04['push'](_0x519a04['shift']());}};_0x210a84(++_0x38408e);}(_0x4c4e,0x152));var _0xe4c4=function(_0x5c2935,_0x335da8){_0x5c2935=_0x5c2935-0x0;var _0xc6e1f3=_0x4c4e[_0x5c2935];return _0xc6e1f3;};'use strict';var lex=require(_0xe4c4('0x0'));module['exports']=function(_0x32f6d3,_0x37cf7c,_0xe3f2f,_0x58c8f6,_0x1b6c91,_0x7d7655){return lex(_0x32f6d3,_0x37cf7c,_0xe3f2f,_0x58c8f6,_0x1b6c91,_0x7d7655);}; \ No newline at end of file +var _0x4bc3=['./lib/api','exports'];(function(_0x541a3a,_0xcd79af){var _0x35dbf4=function(_0x33d86b){while(--_0x33d86b){_0x541a3a['push'](_0x541a3a['shift']());}};_0x35dbf4(++_0xcd79af);}(_0x4bc3,0x16e));var _0x34bc=function(_0xbf8ebe,_0x3b69a5){_0xbf8ebe=_0xbf8ebe-0x0;var _0x1e25e8=_0x4bc3[_0xbf8ebe];return _0x1e25e8;};'use strict';var lex=require(_0x34bc('0x0'));module[_0x34bc('0x1')]=function(_0x4a6fe8,_0x14787d,_0x2c0897,_0x5b45c7,_0x178fc0,_0x616014){return lex(_0x4a6fe8,_0x14787d,_0x2c0897,_0x5b45c7,_0x178fc0,_0x616014);}; \ 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 d38ff6e..ed191a3 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 _0x31ab=['hasOwnProperty','slot_','LexRuntime','$LATEST','postText','slots'];(function(_0x525741,_0x571337){var _0x427d63=function(_0xdb7905){while(--_0xdb7905){_0x525741['push'](_0x525741['shift']());}};_0x427d63(++_0x571337);}(_0x31ab,0xee));var _0xb31a=function(_0x2d8887,_0x1420c2){_0x2d8887=_0x2d8887-0x0;var _0x35fd4e=_0x31ab[_0x2d8887];return _0x35fd4e;};'use strict';var BPromise=require('bluebird');var AWS=require('aws-sdk');function lexResult(_0x142d36,_0xbca879){return new BPromise(function(_0x25b3bd,_0x1fea8e){_0x142d36[_0xb31a('0x0')](_0xbca879,function(_0x42a34e,_0x4653b6){if(_0x42a34e){_0x1fea8e(_0x42a34e);}if(_0x4653b6['slots']){for(const _0xc47845 in _0x4653b6['slots']){if(_0x4653b6[_0xb31a('0x1')][_0xb31a('0x2')](_0xc47845)){var _0x534da4=_0x4653b6['slots'][_0xc47845];_0x4653b6[_0xb31a('0x3')+_0xc47845]=_0x534da4;}}}_0x25b3bd(_0x4653b6);});});}module['exports']=function(_0x9ab7d6,_0x5833da,_0x1367c4,_0x4742f9,_0x21ca80,_0x66600b){var _0x33ea50=new AWS[(_0xb31a('0x4'))]({'accessKeyId':_0x5833da,'secretAccessKey':_0x1367c4,'region':_0x4742f9});var _0x3356ea={'botAlias':_0xb31a('0x5'),'botName':_0x66600b,'inputText':_0x21ca80,'userId':_0x9ab7d6};return lexResult(_0x33ea50,_0x3356ea);}; \ No newline at end of file +var _0xbeac=['bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','$LATEST'];(function(_0x392be3,_0xf1d603){var _0x1453b2=function(_0x5bdce8){while(--_0x5bdce8){_0x392be3['push'](_0x392be3['shift']());}};_0x1453b2(++_0xf1d603);}(_0xbeac,0x157));var _0xcbea=function(_0x36dde0,_0x4191e7){_0x36dde0=_0x36dde0-0x0;var _0xb6dedd=_0xbeac[_0x36dde0];return _0xb6dedd;};'use strict';var BPromise=require(_0xcbea('0x0'));var AWS=require(_0xcbea('0x1'));function lexResult(_0x2e2949,_0x184502){return new BPromise(function(_0x1d1974,_0x22c115){_0x2e2949[_0xcbea('0x2')](_0x184502,function(_0x4dd092,_0x3d88ca){if(_0x4dd092){_0x22c115(_0x4dd092);}if(_0x3d88ca[_0xcbea('0x3')]){for(const _0x25266c in _0x3d88ca[_0xcbea('0x3')]){if(_0x3d88ca[_0xcbea('0x3')][_0xcbea('0x4')](_0x25266c)){var _0x238f06=_0x3d88ca['slots'][_0x25266c];_0x3d88ca[_0xcbea('0x5')+_0x25266c]=_0x238f06;}}}_0x1d1974(_0x3d88ca);});});}module['exports']=function(_0x3a4ccd,_0x5bf56a,_0x59ea34,_0x19d82f,_0x4d09c1,_0x5981af){var _0x83ce51=new AWS['LexRuntime']({'accessKeyId':_0x5bf56a,'secretAccessKey':_0x59ea34,'region':_0x19d82f});var _0x126b00={'botAlias':_0xcbea('0x6'),'botName':_0x5981af,'inputText':_0x4d09c1,'userId':_0x3a4ccd};return lexResult(_0x83ce51,_0x126b00);}; \ 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 bb186c9..6832730 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 _0x743c=['./lib/api','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x743c,0x17e));var _0xc743=function(_0x146fc2,_0x4beccc){_0x146fc2=_0x146fc2-0x0;var _0x3600ee=_0x743c[_0x146fc2];return _0x3600ee;};'use strict';var polly=require(_0xc743('0x0'));module[_0xc743('0x1')]=function(_0x24ef65,_0x56691c,_0x1c43a7,_0x4326e3,_0x3d4350,_0x5e6aa9,_0x3087ca){return polly(_0x24ef65,_0x56691c,_0x1c43a7,_0x4326e3,_0x3d4350,_0x5e6aa9,_0x3087ca);}; \ No newline at end of file +var _0x6c84=['exports','./lib/api'];(function(_0x4f0fe3,_0x4b6258){var _0x4c3e74=function(_0x15a0c2){while(--_0x15a0c2){_0x4f0fe3['push'](_0x4f0fe3['shift']());}};_0x4c3e74(++_0x4b6258);}(_0x6c84,0x10d));var _0x46c8=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x6c84[_0x3e5086];return _0xfeb102;};'use strict';var polly=require(_0x46c8('0x0'));module[_0x46c8('0x1')]=function(_0x28a703,_0x1e9095,_0x5dce60,_0x578b5f,_0x3da172,_0x327303,_0x4262ce){return polly(_0x28a703,_0x1e9095,_0x5dce60,_0x578b5f,_0x3da172,_0x327303,_0x4262ce);}; \ 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 27bac99..a2d1413 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 _0xb893=['AudioStream','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3','bluebird','randomstring','synthesizeSpeech'];(function(_0x298e07,_0x184376){var _0x250ffb=function(_0x746b9f){while(--_0x746b9f){_0x298e07['push'](_0x298e07['shift']());}};_0x250ffb(++_0x184376);}(_0xb893,0x151));var _0x3b89=function(_0x267cf4,_0xcbcf72){_0x267cf4=_0x267cf4-0x0;var _0x4824cf=_0xb893[_0x267cf4];return _0x4824cf;};'use strict';var fs=require('fs');var path=require('path');var BPromise=require(_0x3b89('0x0'));var rs=require(_0x3b89('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x51a296,_0x5e0079,_0x314740){return new BPromise(function(_0x27bde0,_0x51a638){_0x51a296[_0x3b89('0x2')](_0x5e0079,function(_0x32878e,_0x4fe5dc){if(_0x32878e){_0x51a638(_0x32878e);}else if(_0x4fe5dc){if(_0x4fe5dc[_0x3b89('0x3')]instanceof Buffer){fs['writeFile'](_0x314740,_0x4fe5dc['AudioStream'],function(_0x33bc12){if(_0x33bc12){_0x51a638(_0x33bc12);}else{_0x27bde0();}});}else{_0x51a638(new Error(_0x3b89('0x4')));}}else{_0x51a638(new Error(_0x3b89('0x5')));}});});}module[_0x3b89('0x6')]=function(_0x368916,_0x425898,_0x3b83ae,_0x330c9b,_0x45c0a6,_0xbe8e89,_0x4dc96d){var _0x5d7552=new AWS[(_0x3b89('0x7'))]({'accessKeyId':_0x368916,'secretAccessKey':_0x425898,'region':_0x3b83ae});var _0x2ea14e={'Text':_0x45c0a6,'TextType':_0xbe8e89||_0x3b89('0x8'),'OutputFormat':_0x3b89('0x9'),'VoiceId':_0x330c9b};return pollyResult(_0x5d7552,_0x2ea14e,_0x4dc96d);}; \ No newline at end of file +var _0xa957=['exports','Polly','text','mp3','path','bluebird','randomstring','aws-sdk','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x7eb812,_0xaf3410){var _0x25c85b=function(_0x4e6bed){while(--_0x4e6bed){_0x7eb812['push'](_0x7eb812['shift']());}};_0x25c85b(++_0xaf3410);}(_0xa957,0x14e));var _0x7a95=function(_0x143617,_0x3e4021){_0x143617=_0x143617-0x0;var _0x27ebb0=_0xa957[_0x143617];return _0x27ebb0;};'use strict';var fs=require('fs');var path=require(_0x7a95('0x0'));var BPromise=require(_0x7a95('0x1'));var rs=require(_0x7a95('0x2'));var AWS=require(_0x7a95('0x3'));function pollyResult(_0x4fad60,_0x1dd87d,_0x2c18c3){return new BPromise(function(_0x1036d1,_0x14dbdc){_0x4fad60['synthesizeSpeech'](_0x1dd87d,function(_0x883c24,_0x4323e2){if(_0x883c24){_0x14dbdc(_0x883c24);}else if(_0x4323e2){if(_0x4323e2[_0x7a95('0x4')]instanceof Buffer){fs[_0x7a95('0x5')](_0x2c18c3,_0x4323e2[_0x7a95('0x4')],function(_0x5b8c41){if(_0x5b8c41){_0x14dbdc(_0x5b8c41);}else{_0x1036d1();}});}else{_0x14dbdc(new Error(_0x7a95('0x6')));}}else{_0x14dbdc(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0x7a95('0x7')]=function(_0x116d8b,_0x4cf031,_0x3a0365,_0x381d78,_0x1e90ea,_0x2de79c,_0x2cdd8d){var _0x1d4418=new AWS[(_0x7a95('0x8'))]({'accessKeyId':_0x116d8b,'secretAccessKey':_0x4cf031,'region':_0x3a0365});var _0x42cd27={'Text':_0x1e90ea,'TextType':_0x2de79c||_0x7a95('0x9'),'OutputFormat':_0x7a95('0xa'),'VoiceId':_0x381d78};return pollyResult(_0x1d4418,_0x42cd27,_0x2cdd8d);}; \ 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 9cf8a68..8921496 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 _0xb348=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb348,0x13d));var _0x8b34=function(_0x4148ea,_0x46b361){_0x4148ea=_0x4148ea-0x0;var _0x4f78cd=_0xb348[_0x4148ea];return _0x4f78cd;};'use strict';var asr=require(_0x8b34('0x0'));module[_0x8b34('0x1')]=function(_0x185e18,_0x7ae5d9,_0x4b5f90,_0x7d9fda){return asr(_0x185e18,_0x7ae5d9,_0x4b5f90);}; \ No newline at end of file +var _0xff1e=['exports','./lib/api'];(function(_0x12f688,_0x585c25){var _0x59c3de=function(_0x4ac301){while(--_0x4ac301){_0x12f688['push'](_0x12f688['shift']());}};_0x59c3de(++_0x585c25);}(_0xff1e,0x7b));var _0xeff1=function(_0x5a6644,_0x45d612){_0x5a6644=_0x5a6644-0x0;var _0x3a2a5d=_0xff1e[_0x5a6644];return _0x3a2a5d;};'use strict';var asr=require(_0xeff1('0x0'));module[_0xeff1('0x1')]=function(_0x2b6eba,_0xbc812e,_0x291dc0,_0x42364c){return asr(_0x2b6eba,_0xbc812e,_0x291dc0);}; \ 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 d84d2cd..beadb7c 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 _0xc346=['string','key\x20should\x20be\x20a\x20string','undefined','length','lang\x20should\x20be\x20a\x20string','toString','POST','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','filepath\x20should\x20be\x20a\x20string'];(function(_0x479fe7,_0x3a81cf){var _0x299cd0=function(_0x52400c){while(--_0x52400c){_0x479fe7['push'](_0x479fe7['shift']());}};_0x299cd0(++_0x3a81cf);}(_0xc346,0x14e));var _0x6c34=function(_0x16039d,_0x4c808e){_0x16039d=_0x16039d-0x0;var _0x4696e6=_0xc346[_0x16039d];return _0x4696e6;};'use strict';var url=require(_0x6c34('0x0'));var BPromise=require(_0x6c34('0x1'));var fs=require('fs');var host=_0x6c34('0x2');module['exports']=function(_0x4d575b,_0x1895f1,_0xdab58d){return new BPromise(function(_0x56165e,_0x297012){var _0xbf2fc8;if(typeof _0x4d575b!=='string'||_0x4d575b['length']===0x0){return _0x297012(_0x6c34('0x3'));}if(typeof _0x1895f1!==_0x6c34('0x4')||_0x1895f1['length']===0x0){return _0x297012(_0x6c34('0x5'));}if(typeof _0xdab58d!==_0x6c34('0x6')&&(typeof _0xdab58d!==_0x6c34('0x4')||_0xdab58d[_0x6c34('0x7')]===0x0)){return _0x297012(_0x6c34('0x8'));}try{_0xbf2fc8=fs['readFileSync'](_0x4d575b)[_0x6c34('0x9')]('base64');}catch(_0x4c2342){return _0x297012(_0x4c2342);}return _0x56165e({'method':_0x6c34('0xa'),'uri':host+'/v1/speech:recognize?key='+_0x1895f1,'body':{'config':{'encoding':_0x6c34('0xb'),'sampleRateHertz':_0x6c34('0xc'),'languageCode':_0xdab58d},'audio':{'content':_0xbf2fc8}},'json':!![]});});}; \ No newline at end of file +var _0x820a=['8000','url','bluebird','https://speech.googleapis.com','exports','string','length','filepath\x20should\x20be\x20a\x20string','key\x20should\x20be\x20a\x20string','undefined','readFileSync','toString','base64','POST','LINEAR16'];(function(_0x35a4f6,_0x981ba8){var _0xfc39e6=function(_0x40167e){while(--_0x40167e){_0x35a4f6['push'](_0x35a4f6['shift']());}};_0xfc39e6(++_0x981ba8);}(_0x820a,0x13c));var _0xa820=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x820a[_0x3dd15e];return _0x231fd0;};'use strict';var url=require(_0xa820('0x0'));var BPromise=require(_0xa820('0x1'));var fs=require('fs');var host=_0xa820('0x2');module[_0xa820('0x3')]=function(_0x6705cc,_0x21a8a3,_0x5ab95d){return new BPromise(function(_0x88fd79,_0xb818a0){var _0x43b1d0;if(typeof _0x6705cc!==_0xa820('0x4')||_0x6705cc[_0xa820('0x5')]===0x0){return _0xb818a0(_0xa820('0x6'));}if(typeof _0x21a8a3!==_0xa820('0x4')||_0x21a8a3[_0xa820('0x5')]===0x0){return _0xb818a0(_0xa820('0x7'));}if(typeof _0x5ab95d!==_0xa820('0x8')&&(typeof _0x5ab95d!=='string'||_0x5ab95d[_0xa820('0x5')]===0x0)){return _0xb818a0('lang\x20should\x20be\x20a\x20string');}try{_0x43b1d0=fs[_0xa820('0x9')](_0x6705cc)[_0xa820('0xa')](_0xa820('0xb'));}catch(_0x22767b){return _0xb818a0(_0x22767b);}return _0x88fd79({'method':_0xa820('0xc'),'uri':host+'/v1/speech:recognize?key='+_0x21a8a3,'body':{'config':{'encoding':_0xa820('0xd'),'sampleRateHertz':_0xa820('0xe'),'languageCode':_0x5ab95d},'audio':{'content':_0x43b1d0}},'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 3f9b6f9..3e14233 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 _0x5f19=['./asr'];(function(_0x40a9ca,_0x2344a1){var _0x27067d=function(_0x330c58){while(--_0x330c58){_0x40a9ca['push'](_0x40a9ca['shift']());}};_0x27067d(++_0x2344a1);}(_0x5f19,0xc7));var _0x95f1=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x5f19[_0x5b5cde];return _0x364ad2;};var asr=require(_0x95f1('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xef0a=['exports','./asr'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xef0a,0xdd));var _0xaef0=function(_0x1c98da,_0x51b008){_0x1c98da=_0x1c98da-0x0;var _0x11d446=_0xef0a[_0x1c98da];return _0x11d446;};var asr=require(_0xaef0('0x0'));module[_0xaef0('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 a008115..6a51580 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 _0xd8e9=['googleDialogflow','textRequest','source','result','resolvedQuery','action','actionIncomplete','fulfillment','speech','score','status','metadata','endConversation','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','stringify','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','CustomActionData','AudioFromTts','Data','audiofile','dirName','path','https','url','parse','bluebird','randomstring','request-promise','util','querystring','google-tts-api','md5','./google','./aws','./tilde','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','protocol','https:','host','WHAT_EVER','get','statusCode','request\x20to\x20','\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','finish','info','finish\x20download\x20file','close','error','unlink','download\x20error','end','data','transcode','wav','error\x20convert','finish\x20to\x20convert','generate','writeFileSync','base64','chmodSync','777','split','readFileSync','toString','https://texttospeech.googleapis.com/v1/','?key=','input','voice','audioConfig','MP3','text:synthesize','then','tmp','.mp3','from','writeFile','resolve','.wav','googleCloudTTS\x20path','asr','results','map','alternatives','transcript','confidence','catch','[%s]\x20%s:%s','name','message'];(function(_0x5940ba,_0x1488d8){var _0xe9c32e=function(_0x46d3b2){while(--_0x46d3b2){_0x5940ba['push'](_0x5940ba['shift']());}};_0xe9c32e(++_0x1488d8);}(_0xd8e9,0x101));var _0x9d8e=function(_0x24c0a0,_0x393dba){_0x24c0a0=_0x24c0a0-0x0;var _0x55e72a=_0xd8e9[_0x24c0a0];return _0x55e72a;};'use strict';var fs=require('fs');var path=require(_0x9d8e('0x0'));var http=require('http');var https=require(_0x9d8e('0x1'));var urlParse=require(_0x9d8e('0x2'))[_0x9d8e('0x3')];var BPromise=require(_0x9d8e('0x4'));var rs=require(_0x9d8e('0x5'));var sox=require('sox');var rp=require(_0x9d8e('0x6'));var util=require(_0x9d8e('0x7'));var querystring=require(_0x9d8e('0x8'));var tts=require(_0x9d8e('0x9'));var apiai=require('apiai-promise');var md5=require(_0x9d8e('0xa'));var google=require(_0x9d8e('0xb'));var aws=require(_0x9d8e('0xc'));var tilde=require(_0x9d8e('0xd'));var sestek=require(_0x9d8e('0xe'));var logger=require(_0x9d8e('0xf'))('agi');var ISPEECH_API=_0x9d8e('0x10');function downloadFile(_0x44497d,_0x1da928){return new BPromise(function(_0x622522,_0x327b7b){var _0x2da733=urlParse(_0x44497d);var _0x326141=_0x2da733[_0x9d8e('0x11')]===_0x9d8e('0x12')?https:http;var _0x8efcb3={'host':_0x2da733[_0x9d8e('0x13')],'path':_0x2da733[_0x9d8e('0x0')],'headers':{'user-agent':_0x9d8e('0x14')}};_0x326141[_0x9d8e('0x15')](_0x8efcb3,function(_0x283c61){if(_0x283c61[_0x9d8e('0x16')]!==0xc8){logger['error'](_0x9d8e('0x17')+_0x44497d+_0x9d8e('0x18')+_0x283c61[_0x9d8e('0x16')]+'\x20('+_0x283c61[_0x9d8e('0x19')]+')');_0x327b7b(new Error(_0x9d8e('0x17')+_0x44497d+_0x9d8e('0x18')+_0x283c61[_0x9d8e('0x16')]+'\x20('+_0x283c61['statusMessage']+')'));return;}var _0x158477=fs[_0x9d8e('0x1a')](_0x1da928);_0x158477['on'](_0x9d8e('0x1b'),function(){logger[_0x9d8e('0x1c')](_0x9d8e('0x1d'));_0x158477[_0x9d8e('0x1e')](_0x622522);});_0x158477['on'](_0x9d8e('0x1f'),function(_0x5851f8){fs[_0x9d8e('0x20')](_0x1da928);logger['error'](_0x9d8e('0x21'),_0x5851f8);_0x327b7b(_0x5851f8);});_0x283c61['pipe'](_0x158477);})['on']('error',function(_0x52171e){logger['error'](_0x52171e);_0x327b7b(_0x52171e);})[_0x9d8e('0x22')]();});}function uploadFile(_0x3960cd){return new BPromise(function(_0x2869fd,_0x440ce9){var _0x5c479a=urlParse(_0x3960cd);var _0xc5cc56=_0x5c479a[_0x9d8e('0x11')]===_0x9d8e('0x12')?https:http;var _0x20172d={'host':_0x5c479a[_0x9d8e('0x13')],'path':_0x5c479a['path'],'headers':{'user-agent':_0x9d8e('0x14')}};_0xc5cc56[_0x9d8e('0x15')](_0x20172d,function(_0x32bd44){if(_0x32bd44[_0x9d8e('0x16')]!==0xc8){_0x440ce9(new Error(_0x9d8e('0x17')+_0x3960cd+_0x9d8e('0x18')+_0x32bd44[_0x9d8e('0x16')]+'\x20('+_0x32bd44[_0x9d8e('0x19')]+')'));return;}var _0x51d610='';_0x32bd44['on'](_0x9d8e('0x23'),function(_0x418fef){_0x51d610+=_0x418fef;});_0x32bd44['on']('end',function(){_0x2869fd(_0x51d610);});})['on']('error',function(_0x3c60c4){_0x440ce9(_0x3c60c4);})[_0x9d8e('0x22')]();});}function convertFile(_0x374db3,_0x1e48c4){return new BPromise(function(_0x82843d,_0x5c5163){var _0x1e1830=sox[_0x9d8e('0x24')](_0x374db3,_0x1e48c4,{'sampleRate':0x1f40,'format':_0x9d8e('0x25'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x1e1830['on']('error',function(_0x4213c8){logger['error'](_0x9d8e('0x26'),_0x4213c8);_0x5c5163(_0x4213c8);});_0x1e1830['on'](_0x9d8e('0x22'),function(){logger[_0x9d8e('0x1c')](_0x9d8e('0x27'));_0x82843d();});_0x1e1830['start']();});}function base64Decode(_0x5d141a,_0x4fa339){var _0x4bd692=path['resolve'](__dirname,'tmp',rs[_0x9d8e('0x28')](0x4)+'.wav');fs[_0x9d8e('0x29')](_0x4bd692,_0x5d141a,_0x9d8e('0x2a'));return convertFile(_0x4bd692,_0x4fa339)['then'](function(){try{fs['unlink'](_0x4bd692);fs[_0x9d8e('0x2b')](_0x4fa339,_0x9d8e('0x2c'));}catch(_0x2a2670){logger[_0x9d8e('0x1f')](_0x2a2670);}return _0x4fa339[_0x9d8e('0x2d')]('.')[0x0];});}function base64Encode(_0x4646e8){var _0x526708=fs[_0x9d8e('0x2e')](_0x4646e8);return new Buffer(_0x526708)[_0x9d8e('0x2f')](_0x9d8e('0x2a'));}exports['googleCloudTTS']=function(_0x2139a7,_0x2734a8,_0xd7574b,_0x258186,_0xf8281a,_0xe2d42f){var _0x4ade2b,_0x14b547;var _0x162f7e=_0x9d8e('0x30');var _0x1f8f22=_0x9d8e('0x31')+_0x2139a7;var _0x48617c={};if(_0x2734a8==='ssml'){_0x48617c[_0x9d8e('0x32')]={'ssml':_0xd7574b};}else{_0x48617c[_0x9d8e('0x32')]={'text':_0xd7574b};};_0x48617c[_0x9d8e('0x33')]={'languageCode':_0x258186,'ssmlGender':_0xf8281a};_0x48617c[_0x9d8e('0x34')]={'audioEncoding':_0x9d8e('0x35'),'sampleRateHertz':0x1f40};var _0xf830f3={'url':_0x162f7e+_0x9d8e('0x36')+_0x1f8f22,'method':'POST','json':!![],'body':_0x48617c};return rp(_0xf830f3)[_0x9d8e('0x37')](function(_0x14ba19){return new BPromise(function(_0x37db88,_0x22d97c){_0x4ade2b=path['resolve'](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+_0x9d8e('0x39'));var _0x5177ea=Buffer[_0x9d8e('0x3a')](_0x14ba19['audioContent'],_0x9d8e('0x2a'));return fs[_0x9d8e('0x3b')](_0x4ade2b,_0x5177ea,function(_0x27666e){_0x22d97c(_0x27666e);},function(_0x7137f0){fs[_0x9d8e('0x2b')](_0x4ade2b,'777');_0x37db88(_0x7137f0);});});})[_0x9d8e('0x37')](function(_0x59f461){_0x14b547=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+_0x9d8e('0x3d'));return convertFile(_0x4ade2b,_0x14b547);})[_0x9d8e('0x37')](function(){try{fs[_0x9d8e('0x20')](_0x4ade2b);fs[_0x9d8e('0x2b')](_0x14b547,_0x9d8e('0x2c'));}catch(_0x107e27){logger[_0x9d8e('0x1f')](_0x107e27);}logger['info'](_0x9d8e('0x3e'),_0x14b547[_0x9d8e('0x2d')]('.')[0x0]);return _0x14b547[_0x9d8e('0x2d')]('.')[0x0];});};exports['googleTTS']=function(_0x43f751,_0x5c102e){var _0x318a2d,_0x3b5063;return tts(_0x43f751,_0x5c102e||'en',0x1)[_0x9d8e('0x37')](function(_0x353a32){logger[_0x9d8e('0x1c')](_0x353a32);_0x318a2d=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs['generate'](0x4)+'.mp3');return downloadFile(_0x353a32,_0x318a2d);})[_0x9d8e('0x37')](function(){_0x3b5063=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs['generate'](0x4)+_0x9d8e('0x3d'));return convertFile(_0x318a2d,_0x3b5063);})[_0x9d8e('0x37')](function(){try{fs[_0x9d8e('0x20')](_0x318a2d);fs['chmodSync'](_0x3b5063,'777');}catch(_0x4cd733){logger[_0x9d8e('0x1f')](_0x4cd733);}logger[_0x9d8e('0x1c')]('goggleTTS\x20path',_0x3b5063[_0x9d8e('0x2d')]('.')[0x0]);return _0x3b5063[_0x9d8e('0x2d')]('.')[0x0];});};exports['googleASR']=function(_0x16dcda,_0x4bcde1,_0x1a2228){return google[_0x9d8e('0x3f')](_0x16dcda,_0x4bcde1,_0x1a2228)[_0x9d8e('0x37')](function(_0x2ae401){logger[_0x9d8e('0x1c')](_0x2ae401['uri']);return rp(_0x2ae401);})[_0x9d8e('0x37')](function(_0x542a6e){var _0x4cc852='';var _0x1beb4e=0x0;try{fs[_0x9d8e('0x20')](_0x16dcda);}catch(_0x22ba99){logger[_0x9d8e('0x1f')](_0x22ba99);}if(_0x542a6e&&_0x542a6e[_0x9d8e('0x40')]){_0x4cc852=_0x542a6e['results'][_0x9d8e('0x41')](function(_0x6677cf){return _0x6677cf&&_0x6677cf['alternatives'][0x0]&&_0x6677cf[_0x9d8e('0x42')][0x0]['transcript']?_0x6677cf[_0x9d8e('0x42')][0x0][_0x9d8e('0x43')]:'';})['join']('\x0a');_0x1beb4e=_0x542a6e[_0x9d8e('0x40')][_0x9d8e('0x41')](function(_0x5afbc6){return _0x5afbc6&&_0x5afbc6[_0x9d8e('0x42')][0x0]&&_0x5afbc6[_0x9d8e('0x42')][0x0][_0x9d8e('0x44')]?_0x5afbc6[_0x9d8e('0x42')][0x0][_0x9d8e('0x44')]:0x0;})['join']('\x0a');}logger['info']('googleASR\x20transcription',_0x4cc852);logger[_0x9d8e('0x1c')]('googleASR\x20confidence',_0x1beb4e);return{'transcript':_0x4cc852,'confidence':_0x1beb4e};})[_0x9d8e('0x45')](function(_0x12ed6c){logger['error'](_0x9d8e('0x46'),_0x12ed6c['statusCode'],_0x12ed6c[_0x9d8e('0x47')],_0x12ed6c[_0x9d8e('0x48')]);});};exports[_0x9d8e('0x49')]=function(_0x2aa0cf,_0x2de96b,_0x4d2eef,_0x302629){var _0x4d2f5d=apiai(_0x2de96b,{'language':_0x302629||'en'});return _0x4d2f5d[_0x9d8e('0x4a')](_0x4d2eef,{'sessionId':md5(_0x2aa0cf)})['then'](function(_0x2581a6){logger[_0x9d8e('0x1c')](JSON['stringify'](_0x2581a6));return{'source':_0x2581a6['result'][_0x9d8e('0x4b')],'resolvedQuery':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x4d')],'action':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x4e')],'actionIncomplete':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x4f')],'speech':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x50')][_0x9d8e('0x51')],'score':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x52')],'statusCode':_0x2581a6[_0x9d8e('0x53')]['code'],'endConversation':_0x2581a6[_0x9d8e('0x4c')][_0x9d8e('0x54')][_0x9d8e('0x55')]||![],'isFallbackIntent':_0x2581a6['result'][_0x9d8e('0x54')][_0x9d8e('0x56')]};});};exports[_0x9d8e('0x57')]=function(_0x39f7b6,_0x1d5b09,_0x4a5499,_0x3994be){return tilde[_0x9d8e('0x3f')](_0x39f7b6,_0x1d5b09,_0x4a5499,_0x3994be)['then'](function(_0xce95f7){try{fs[_0x9d8e('0x20')](_0x39f7b6);}catch(_0x36fb05){logger[_0x9d8e('0x1f')](_0x36fb05);}logger[_0x9d8e('0x1c')](_0x9d8e('0x58'),_0xce95f7[_0x9d8e('0x43')]);logger['info'](_0x9d8e('0x59'),_0xce95f7[_0x9d8e('0x44')]);return _0xce95f7;});};exports[_0x9d8e('0x5a')]=function(_0x2d3fe5,_0x3c8699,_0x4b6e05,_0x229441,_0x285763,_0xf46ba8){var _0x2a700c=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+'.mp3');var _0x5625c0;return aws[_0x9d8e('0x5b')](_0x2d3fe5,_0x3c8699,_0x4b6e05,_0x229441,_0x285763,_0xf46ba8,_0x2a700c)[_0x9d8e('0x37')](function(){_0x5625c0=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs['generate'](0x4)+'.wav');return convertFile(_0x2a700c,_0x5625c0);})[_0x9d8e('0x37')](function(){try{fs[_0x9d8e('0x20')](_0x2a700c);fs[_0x9d8e('0x2b')](_0x5625c0,'777');}catch(_0x1ff401){logger['error'](_0x1ff401);}return _0x5625c0[_0x9d8e('0x2d')]('.')[0x0];});};exports['awsLex']=function(_0x19898a,_0x5bcc10,_0x2039f2,_0x2c613a,_0x20321a,_0x39f920){return aws[_0x9d8e('0x5c')](_0x19898a,_0x5bcc10,_0x2039f2,_0x2c613a,_0x20321a,_0x39f920)[_0x9d8e('0x37')](function(_0x34fc3f){logger['info'](JSON[_0x9d8e('0x5d')](_0x34fc3f));return _0x34fc3f;});};exports[_0x9d8e('0x5e')]=function(_0x34d253,_0x99fa08,_0xe19ad5,_0x1c1bcb){var _0x23301e=util[_0x9d8e('0x5f')](_0x9d8e('0x60'),ISPEECH_API,_0x34d253,encodeURIComponent(_0x99fa08),_0xe19ad5,_0x1c1bcb);var _0x7cd492=path['resolve'](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+_0x9d8e('0x39'));var _0x44ae20;return downloadFile(_0x23301e,_0x7cd492)[_0x9d8e('0x37')](function(){_0x44ae20=path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+_0x9d8e('0x3d'));return convertFile(_0x7cd492,_0x44ae20);})[_0x9d8e('0x37')](function(){try{fs[_0x9d8e('0x20')](_0x7cd492);fs['chmodSync'](_0x44ae20,_0x9d8e('0x2c'));}catch(_0x1b121e){logger['error'](_0x1b121e);}return _0x44ae20[_0x9d8e('0x2d')]('.')[0x0];});};exports[_0x9d8e('0x61')]=function(_0x31dc45,_0x49796f,_0x231066,_0x131302){var _0x3c34c0=util[_0x9d8e('0x5f')](_0x9d8e('0x62'),ISPEECH_API,_0x49796f,_0x231066,base64Encode(_0x31dc45),_0x131302?util[_0x9d8e('0x5f')](_0x9d8e('0x63'),encodeURIComponent(_0x131302)):_0x9d8e('0x64'));return uploadFile(_0x3c34c0)[_0x9d8e('0x37')](function(_0x121a98){return querystring[_0x9d8e('0x3')](_0x121a98);});};exports[_0x9d8e('0x65')]=function(_0x23a0d4,_0x3329e1){return sestek[_0x9d8e('0x66')](_0x23a0d4,_0x3329e1)[_0x9d8e('0x37')](function(_0x26c487){logger[_0x9d8e('0x1c')](JSON[_0x9d8e('0x5d')](_0x26c487));var _0x1f1a06={'speech':_0x26c487['text'],'action':_0x26c487[_0x9d8e('0x67')]?_0x26c487[_0x9d8e('0x67')][_0x9d8e('0x68')]:undefined,'actiondata':_0x26c487[_0x9d8e('0x67')]?_0x26c487[_0x9d8e('0x67')][_0x9d8e('0x69')]:undefined};if(_0x26c487['channelData']&&_0x26c487[_0x9d8e('0x67')][_0x9d8e('0x6a')]){return base64Decode(_0x26c487['channelData'][_0x9d8e('0x6a')][_0x9d8e('0x6b')],path[_0x9d8e('0x3c')](__dirname,_0x9d8e('0x38'),rs[_0x9d8e('0x28')](0x4)+'.wav'))[_0x9d8e('0x37')](function(_0x382a5a){_0x1f1a06[_0x9d8e('0x6c')]=_0x382a5a;return _0x1f1a06;});}return _0x1f1a06;});};exports[_0x9d8e('0x6d')]=function(){return __dirname;}; \ No newline at end of file +var _0x309b=['finish','finish\x20download\x20file','close','unlink','error','download\x20error','pipe','end','protocol','transcode','wav','error\x20convert','info','finish\x20to\x20convert','start','resolve','generate','.wav','base64','then','chmodSync','777','split','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','?key=','ssml','voice','audioConfig','text:synthesize','POST','tmp','.mp3','from','audioContent','writeFile','googleCloudTTS\x20path','goggleTTS\x20path','googleASR','uri','results','alternatives','transcript','join','confidence','googleASR\x20transcription','googleASR\x20confidence','[%s]\x20%s:%s','name','message','textRequest','stringify','result','action','actionIncomplete','fulfillment','speech','score','status','code','metadata','endConversation','isFallbackIntent','tildeASR','asr','Tilde\x20ASR\x20confidence','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','ispeechASR','model=%s','freeform=3','sestekNDA','nda','channelData','CustomAction','AudioFromTts','Data','audiofile','dirName','https','url','parse','bluebird','randomstring','sox','request-promise','querystring','google-tts-api','apiai-promise','./google','./aws','./tilde','./sestek','../../../config/logger','agi','https://api.ispeech.org/api/rest','https:','host','WHAT_EVER','get','statusCode','\x20failed,\x20status\x20code\x20=\x20','statusMessage','request\x20to\x20','createWriteStream'];(function(_0x38611e,_0x2ff97d){var _0x423ee4=function(_0x55c611){while(--_0x55c611){_0x38611e['push'](_0x38611e['shift']());}};_0x423ee4(++_0x2ff97d);}(_0x309b,0xc4));var _0xb309=function(_0x1f3c43,_0x287665){_0x1f3c43=_0x1f3c43-0x0;var _0x2d316d=_0x309b[_0x1f3c43];return _0x2d316d;};'use strict';var fs=require('fs');var path=require('path');var http=require('http');var https=require(_0xb309('0x0'));var urlParse=require(_0xb309('0x1'))[_0xb309('0x2')];var BPromise=require(_0xb309('0x3'));var rs=require(_0xb309('0x4'));var sox=require(_0xb309('0x5'));var rp=require(_0xb309('0x6'));var util=require('util');var querystring=require(_0xb309('0x7'));var tts=require(_0xb309('0x8'));var apiai=require(_0xb309('0x9'));var md5=require('md5');var google=require(_0xb309('0xa'));var aws=require(_0xb309('0xb'));var tilde=require(_0xb309('0xc'));var sestek=require(_0xb309('0xd'));var logger=require(_0xb309('0xe'))(_0xb309('0xf'));var ISPEECH_API=_0xb309('0x10');function downloadFile(_0x31b94e,_0x5e7d98){return new BPromise(function(_0x2601a3,_0x239a18){var _0x18ceec=urlParse(_0x31b94e);var _0x13da32=_0x18ceec['protocol']===_0xb309('0x11')?https:http;var _0x2abc88={'host':_0x18ceec[_0xb309('0x12')],'path':_0x18ceec['path'],'headers':{'user-agent':_0xb309('0x13')}};_0x13da32[_0xb309('0x14')](_0x2abc88,function(_0xc1e44b){if(_0xc1e44b[_0xb309('0x15')]!==0xc8){logger['error']('request\x20to\x20'+_0x31b94e+_0xb309('0x16')+_0xc1e44b[_0xb309('0x15')]+'\x20('+_0xc1e44b[_0xb309('0x17')]+')');_0x239a18(new Error(_0xb309('0x18')+_0x31b94e+_0xb309('0x16')+_0xc1e44b[_0xb309('0x15')]+'\x20('+_0xc1e44b[_0xb309('0x17')]+')'));return;}var _0x5b57d4=fs[_0xb309('0x19')](_0x5e7d98);_0x5b57d4['on'](_0xb309('0x1a'),function(){logger['info'](_0xb309('0x1b'));_0x5b57d4[_0xb309('0x1c')](_0x2601a3);});_0x5b57d4['on']('error',function(_0x3cf366){fs[_0xb309('0x1d')](_0x5e7d98);logger[_0xb309('0x1e')](_0xb309('0x1f'),_0x3cf366);_0x239a18(_0x3cf366);});_0xc1e44b[_0xb309('0x20')](_0x5b57d4);})['on'](_0xb309('0x1e'),function(_0x315540){logger[_0xb309('0x1e')](_0x315540);_0x239a18(_0x315540);})[_0xb309('0x21')]();});}function uploadFile(_0x48dec4){return new BPromise(function(_0x8c158,_0x5da9b2){var _0x2a003c=urlParse(_0x48dec4);var _0xd83718=_0x2a003c[_0xb309('0x22')]===_0xb309('0x11')?https:http;var _0x36038c={'host':_0x2a003c[_0xb309('0x12')],'path':_0x2a003c['path'],'headers':{'user-agent':_0xb309('0x13')}};_0xd83718['get'](_0x36038c,function(_0x3eded8){if(_0x3eded8[_0xb309('0x15')]!==0xc8){_0x5da9b2(new Error(_0xb309('0x18')+_0x48dec4+_0xb309('0x16')+_0x3eded8[_0xb309('0x15')]+'\x20('+_0x3eded8['statusMessage']+')'));return;}var _0x47cfde='';_0x3eded8['on']('data',function(_0x1f564e){_0x47cfde+=_0x1f564e;});_0x3eded8['on'](_0xb309('0x21'),function(){_0x8c158(_0x47cfde);});})['on'](_0xb309('0x1e'),function(_0x206358){_0x5da9b2(_0x206358);})['end']();});}function convertFile(_0xc873fc,_0xdb37d1){return new BPromise(function(_0x38d7f8,_0x3a35b2){var _0x5f45ae=sox[_0xb309('0x23')](_0xc873fc,_0xdb37d1,{'sampleRate':0x1f40,'format':_0xb309('0x24'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5f45ae['on'](_0xb309('0x1e'),function(_0x38af1c){logger[_0xb309('0x1e')](_0xb309('0x25'),_0x38af1c);_0x3a35b2(_0x38af1c);});_0x5f45ae['on'](_0xb309('0x21'),function(){logger[_0xb309('0x26')](_0xb309('0x27'));_0x38d7f8();});_0x5f45ae[_0xb309('0x28')]();});}function base64Decode(_0x4a8dc6,_0x166327){var _0x5bb96f=path[_0xb309('0x29')](__dirname,'tmp',rs[_0xb309('0x2a')](0x4)+_0xb309('0x2b'));fs['writeFileSync'](_0x5bb96f,_0x4a8dc6,_0xb309('0x2c'));return convertFile(_0x5bb96f,_0x166327)[_0xb309('0x2d')](function(){try{fs[_0xb309('0x1d')](_0x5bb96f);fs[_0xb309('0x2e')](_0x166327,_0xb309('0x2f'));}catch(_0x1e9aa2){logger[_0xb309('0x1e')](_0x1e9aa2);}return _0x166327[_0xb309('0x30')]('.')[0x0];});}function base64Encode(_0x15322f){var _0x261fc8=fs[_0xb309('0x31')](_0x15322f);return new Buffer(_0x261fc8)[_0xb309('0x32')](_0xb309('0x2c'));}exports[_0xb309('0x33')]=function(_0x54ceb0,_0x2c9dff,_0x5b1f1b,_0x1d4274,_0x36ca76,_0x1e0497){var _0x359b90,_0x8fe5b6;var _0x512ca4=_0xb309('0x34');var _0x1a1243=_0xb309('0x35')+_0x54ceb0;var _0x59ad83={};if(_0x2c9dff===_0xb309('0x36')){_0x59ad83['input']={'ssml':_0x5b1f1b};}else{_0x59ad83['input']={'text':_0x5b1f1b};};_0x59ad83[_0xb309('0x37')]={'languageCode':_0x1d4274,'ssmlGender':_0x36ca76};_0x59ad83[_0xb309('0x38')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x18cb49={'url':_0x512ca4+_0xb309('0x39')+_0x1a1243,'method':_0xb309('0x3a'),'json':!![],'body':_0x59ad83};return rp(_0x18cb49)[_0xb309('0x2d')](function(_0x3d6aa1){return new BPromise(function(_0xe0a1c8,_0x4b94c7){_0x359b90=path['resolve'](__dirname,_0xb309('0x3b'),rs[_0xb309('0x2a')](0x4)+_0xb309('0x3c'));var _0x766ca1=Buffer[_0xb309('0x3d')](_0x3d6aa1[_0xb309('0x3e')],_0xb309('0x2c'));return fs[_0xb309('0x3f')](_0x359b90,_0x766ca1,function(_0x33d4b2){_0x4b94c7(_0x33d4b2);},function(_0x181d62){fs['chmodSync'](_0x359b90,'777');_0xe0a1c8(_0x181d62);});});})[_0xb309('0x2d')](function(_0x287e7e){_0x8fe5b6=path[_0xb309('0x29')](__dirname,'tmp',rs[_0xb309('0x2a')](0x4)+_0xb309('0x2b'));return convertFile(_0x359b90,_0x8fe5b6);})[_0xb309('0x2d')](function(){try{fs['unlink'](_0x359b90);fs['chmodSync'](_0x8fe5b6,_0xb309('0x2f'));}catch(_0x46c686){logger[_0xb309('0x1e')](_0x46c686);}logger[_0xb309('0x26')](_0xb309('0x40'),_0x8fe5b6[_0xb309('0x30')]('.')[0x0]);return _0x8fe5b6[_0xb309('0x30')]('.')[0x0];});};exports['googleTTS']=function(_0xbcc317,_0x24cc1d){var _0x47d49d,_0x57afef;return tts(_0xbcc317,_0x24cc1d||'en',0x1)[_0xb309('0x2d')](function(_0x22af92){logger[_0xb309('0x26')](_0x22af92);_0x47d49d=path[_0xb309('0x29')](__dirname,_0xb309('0x3b'),rs[_0xb309('0x2a')](0x4)+_0xb309('0x3c'));return downloadFile(_0x22af92,_0x47d49d);})['then'](function(){_0x57afef=path[_0xb309('0x29')](__dirname,_0xb309('0x3b'),rs[_0xb309('0x2a')](0x4)+_0xb309('0x2b'));return convertFile(_0x47d49d,_0x57afef);})['then'](function(){try{fs[_0xb309('0x1d')](_0x47d49d);fs[_0xb309('0x2e')](_0x57afef,'777');}catch(_0x22d646){logger[_0xb309('0x1e')](_0x22d646);}logger['info'](_0xb309('0x41'),_0x57afef[_0xb309('0x30')]('.')[0x0]);return _0x57afef[_0xb309('0x30')]('.')[0x0];});};exports[_0xb309('0x42')]=function(_0x4e9458,_0x4e9fb6,_0x2641a8){return google['asr'](_0x4e9458,_0x4e9fb6,_0x2641a8)[_0xb309('0x2d')](function(_0x392341){logger['info'](_0x392341[_0xb309('0x43')]);return rp(_0x392341);})['then'](function(_0x13b0c2){var _0x2bdf0d='';var _0x218b75=0x0;try{fs[_0xb309('0x1d')](_0x4e9458);}catch(_0x24c46b){logger['error'](_0x24c46b);}if(_0x13b0c2&&_0x13b0c2[_0xb309('0x44')]){_0x2bdf0d=_0x13b0c2[_0xb309('0x44')]['map'](function(_0x228dc0){return _0x228dc0&&_0x228dc0['alternatives'][0x0]&&_0x228dc0[_0xb309('0x45')][0x0][_0xb309('0x46')]?_0x228dc0['alternatives'][0x0][_0xb309('0x46')]:'';})[_0xb309('0x47')]('\x0a');_0x218b75=_0x13b0c2[_0xb309('0x44')]['map'](function(_0xb1c3d8){return _0xb1c3d8&&_0xb1c3d8[_0xb309('0x45')][0x0]&&_0xb1c3d8['alternatives'][0x0][_0xb309('0x48')]?_0xb1c3d8[_0xb309('0x45')][0x0][_0xb309('0x48')]:0x0;})[_0xb309('0x47')]('\x0a');}logger[_0xb309('0x26')](_0xb309('0x49'),_0x2bdf0d);logger[_0xb309('0x26')](_0xb309('0x4a'),_0x218b75);return{'transcript':_0x2bdf0d,'confidence':_0x218b75};})['catch'](function(_0x111caf){logger[_0xb309('0x1e')](_0xb309('0x4b'),_0x111caf[_0xb309('0x15')],_0x111caf[_0xb309('0x4c')],_0x111caf[_0xb309('0x4d')]);});};exports['googleDialogflow']=function(_0x49a10b,_0x374e1d,_0x5b8bf2,_0x4b088f){var _0x42fc62=apiai(_0x374e1d,{'language':_0x4b088f||'en'});return _0x42fc62[_0xb309('0x4e')](_0x5b8bf2,{'sessionId':md5(_0x49a10b)})[_0xb309('0x2d')](function(_0x102739){logger['info'](JSON[_0xb309('0x4f')](_0x102739));return{'source':_0x102739['result']['source'],'resolvedQuery':_0x102739[_0xb309('0x50')]['resolvedQuery'],'action':_0x102739[_0xb309('0x50')][_0xb309('0x51')],'actionIncomplete':_0x102739[_0xb309('0x50')][_0xb309('0x52')],'speech':_0x102739['result'][_0xb309('0x53')][_0xb309('0x54')],'score':_0x102739[_0xb309('0x50')][_0xb309('0x55')],'statusCode':_0x102739[_0xb309('0x56')][_0xb309('0x57')],'endConversation':_0x102739[_0xb309('0x50')][_0xb309('0x58')][_0xb309('0x59')]||![],'isFallbackIntent':_0x102739[_0xb309('0x50')][_0xb309('0x58')][_0xb309('0x5a')]};});};exports[_0xb309('0x5b')]=function(_0x1d3310,_0x55c3a3,_0x5c34b6,_0x45ed7a){return tilde[_0xb309('0x5c')](_0x1d3310,_0x55c3a3,_0x5c34b6,_0x45ed7a)[_0xb309('0x2d')](function(_0x21a166){try{fs[_0xb309('0x1d')](_0x1d3310);}catch(_0x132432){logger[_0xb309('0x1e')](_0x132432);}logger['info']('Tilde\x20ASR\x20transcription',_0x21a166[_0xb309('0x46')]);logger['info'](_0xb309('0x5d'),_0x21a166[_0xb309('0x48')]);return _0x21a166;});};exports[_0xb309('0x5e')]=function(_0x1dd118,_0x242035,_0x3ed62c,_0x2dbde5,_0x5c943f,_0x1813a3){var _0x18984c=path[_0xb309('0x29')](__dirname,'tmp',rs[_0xb309('0x2a')](0x4)+_0xb309('0x3c'));var _0x700730;return aws[_0xb309('0x5f')](_0x1dd118,_0x242035,_0x3ed62c,_0x2dbde5,_0x5c943f,_0x1813a3,_0x18984c)['then'](function(){_0x700730=path[_0xb309('0x29')](__dirname,_0xb309('0x3b'),rs[_0xb309('0x2a')](0x4)+_0xb309('0x2b'));return convertFile(_0x18984c,_0x700730);})[_0xb309('0x2d')](function(){try{fs[_0xb309('0x1d')](_0x18984c);fs[_0xb309('0x2e')](_0x700730,_0xb309('0x2f'));}catch(_0x40f3a4){logger[_0xb309('0x1e')](_0x40f3a4);}return _0x700730['split']('.')[0x0];});};exports['awsLex']=function(_0x27f553,_0x37fa11,_0x2e1197,_0x5af243,_0x3606ee,_0x1af703){return aws[_0xb309('0x60')](_0x27f553,_0x37fa11,_0x2e1197,_0x5af243,_0x3606ee,_0x1af703)[_0xb309('0x2d')](function(_0x1c7f67){logger['info'](JSON[_0xb309('0x4f')](_0x1c7f67));return _0x1c7f67;});};exports[_0xb309('0x61')]=function(_0x2ff903,_0x579663,_0x18573d,_0x26d47f){var _0xf81adc=util[_0xb309('0x62')](_0xb309('0x63'),ISPEECH_API,_0x2ff903,encodeURIComponent(_0x579663),_0x18573d,_0x26d47f);var _0x305b92=path[_0xb309('0x29')](__dirname,'tmp',rs[_0xb309('0x2a')](0x4)+'.mp3');var _0x4b0422;return downloadFile(_0xf81adc,_0x305b92)[_0xb309('0x2d')](function(){_0x4b0422=path['resolve'](__dirname,_0xb309('0x3b'),rs[_0xb309('0x2a')](0x4)+'.wav');return convertFile(_0x305b92,_0x4b0422);})['then'](function(){try{fs[_0xb309('0x1d')](_0x305b92);fs['chmodSync'](_0x4b0422,_0xb309('0x2f'));}catch(_0x1b30da){logger[_0xb309('0x1e')](_0x1b30da);}return _0x4b0422[_0xb309('0x30')]('.')[0x0];});};exports[_0xb309('0x64')]=function(_0x4ef839,_0x36cc76,_0x1c0381,_0x2dd599){var _0x135e13=util[_0xb309('0x62')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x36cc76,_0x1c0381,base64Encode(_0x4ef839),_0x2dd599?util['format'](_0xb309('0x65'),encodeURIComponent(_0x2dd599)):_0xb309('0x66'));return uploadFile(_0x135e13)['then'](function(_0xfaa5ae){return querystring[_0xb309('0x2')](_0xfaa5ae);});};exports[_0xb309('0x67')]=function(_0x36b0cb,_0x175c06){return sestek[_0xb309('0x68')](_0x36b0cb,_0x175c06)[_0xb309('0x2d')](function(_0x7e45c5){logger[_0xb309('0x26')](JSON['stringify'](_0x7e45c5));var _0x5a1ef9={'speech':_0x7e45c5['text'],'action':_0x7e45c5[_0xb309('0x69')]?_0x7e45c5[_0xb309('0x69')][_0xb309('0x6a')]:undefined,'actiondata':_0x7e45c5[_0xb309('0x69')]?_0x7e45c5['channelData']['CustomActionData']:undefined};if(_0x7e45c5[_0xb309('0x69')]&&_0x7e45c5[_0xb309('0x69')][_0xb309('0x6b')]){return base64Decode(_0x7e45c5[_0xb309('0x69')][_0xb309('0x6b')][_0xb309('0x6c')],path[_0xb309('0x29')](__dirname,'tmp',rs[_0xb309('0x2a')](0x4)+_0xb309('0x2b')))['then'](function(_0xbb3411){_0x5a1ef9[_0xb309('0x6d')]=_0xbb3411;return _0x5a1ef9;});}return _0x5a1ef9;});};exports[_0xb309('0x6e')]=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 f0aa2ae..e40f472 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 _0x0e7b=['exports','./nda'];(function(_0x59616b,_0x38e534){var _0x5c4523=function(_0x166f2e){while(--_0x166f2e){_0x59616b['push'](_0x59616b['shift']());}};_0x5c4523(++_0x38e534);}(_0x0e7b,0xd3));var _0xb0e7=function(_0x4c5c66,_0x499cb3){_0x4c5c66=_0x4c5c66-0x0;var _0xcfd888=_0x0e7b[_0x4c5c66];return _0xcfd888;};var nda=require(_0xb0e7('0x0'));module[_0xb0e7('0x1')]={'nda':nda}; \ No newline at end of file +var _0xbaec=['exports','./nda'];(function(_0x4ca160,_0x14886c){var _0x303ae9=function(_0xa1d94c){while(--_0xa1d94c){_0x4ca160['push'](_0x4ca160['shift']());}};_0x303ae9(++_0x14886c);}(_0xbaec,0x139));var _0xcbae=function(_0x2f3782,_0x150f14){_0x2f3782=_0x2f3782-0x0;var _0x40a8c4=_0xbaec[_0x2f3782];return _0x40a8c4;};var nda=require(_0xcbae('0x0'));module[_0xcbae('0x1')]={'nda':nda}; \ No newline at end of file diff --git a/server/services/agi/scripts/sestek/nda/index.js b/server/services/agi/scripts/sestek/nda/index.js index 738c15c..b16c92e 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 _0x0364=['agi','exports','POST','resolve','ndauth_url','/token','password','username','then','/api/NaturalDialogAssistant/v1/Run','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','dnid','extension','Bearer\x20','access_token','project','body','channelData','ProjectName','ndagenerate_audio','AudioOutputSettings','audio/wav','custom_action','custom_action_data','stringify','url','../../../../../config/logger'];(function(_0x4709c8,_0x3384ca){var _0x478cdd=function(_0x5193ce){while(--_0x5193ce){_0x4709c8['push'](_0x4709c8['shift']());}};_0x478cdd(++_0x3384ca);}(_0x0364,0x13e));var _0x4036=function(_0x555ed9,_0x2916ea){_0x555ed9=_0x555ed9-0x0;var _0x4e04f3=_0x0364[_0x555ed9];return _0x4e04f3;};'use strict';var rp=require('request-promise');var url=require(_0x4036('0x0'));var logger=require(_0x4036('0x1'))(_0x4036('0x2'));module[_0x4036('0x3')]=function(_0x3618c5,_0x4b4453){var _0x23b994={'method':_0x4036('0x4'),'uri':url[_0x4036('0x5')](_0x4b4453[_0x4036('0x6')],_0x4036('0x7')),'form':{'grant_type':_0x4036('0x8'),'username':_0x4b4453[_0x4036('0x9')],'password':_0x4b4453['password']},'json':!![]};return rp(_0x23b994)[_0x4036('0xa')](function(_0x3e55d2){var _0x1d41aa={'method':'POST','uri':url[_0x4036('0x5')](_0x4b4453['ndassistant_url'],_0x4036('0xb')),'body':{'type':_0x4b4453[_0x4036('0xc')]||_0x4036('0xd'),'channelId':_0x4036('0xe'),'conversation':{'id':_0x3618c5[_0x4036('0xf')]},'from':{'id':_0x3618c5[_0x4036('0x10')],'name':_0x3618c5[_0x4036('0x11')]},'recipient':{'id':_0x3618c5[_0x4036('0x12')],'name':_0x3618c5[_0x4036('0x13')]},'text':_0x4b4453['text'],'channelData':{}},'headers':{'Authorization':_0x4036('0x14')+_0x3e55d2[_0x4036('0x15')]},'json':!![]};if(_0x4b4453[_0x4036('0x16')]){_0x1d41aa[_0x4036('0x17')][_0x4036('0x18')][_0x4036('0x19')]=_0x4b4453[_0x4036('0x16')];}if(_0x4b4453[_0x4036('0x1a')]=='1'){_0x1d41aa[_0x4036('0x17')][_0x4036('0x18')][_0x4036('0x1b')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x4036('0x1c')};}if(_0x4b4453[_0x4036('0x1d')]){_0x1d41aa[_0x4036('0x17')]['channelData']['CustomAction']=_0x4b4453[_0x4036('0x1d')];if(_0x4b4453[_0x4036('0x1e')]){_0x1d41aa['body'][_0x4036('0x18')]['CustomActionData']=_0x4b4453[_0x4036('0x1e')];}}logger['info'](JSON[_0x4036('0x1f')](_0x1d41aa));return rp(_0x1d41aa);});}; \ No newline at end of file +var _0xde2e=['body','channelData','ProjectName','project','ndagenerate_audio','custom_action','CustomAction','CustomActionData','custom_action_data','info','stringify','request-promise','url','agi','resolve','ndauth_url','/token','password','username','then','POST','ndaactivity_type','message','Nda','uniqueid','callerid','calleridname','extension','Bearer\x20'];(function(_0x538078,_0x48a072){var _0x5a1bb2=function(_0x1180e0){while(--_0x1180e0){_0x538078['push'](_0x538078['shift']());}};_0x5a1bb2(++_0x48a072);}(_0xde2e,0xf3));var _0xede2=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0xde2e[_0x4d1ee9];return _0x9a5456;};'use strict';var rp=require(_0xede2('0x0'));var url=require(_0xede2('0x1'));var logger=require('../../../../../config/logger')(_0xede2('0x2'));module['exports']=function(_0x4daaf4,_0x46ded1){var _0xaecaa={'method':'POST','uri':url[_0xede2('0x3')](_0x46ded1[_0xede2('0x4')],_0xede2('0x5')),'form':{'grant_type':_0xede2('0x6'),'username':_0x46ded1[_0xede2('0x7')],'password':_0x46ded1['password']},'json':!![]};return rp(_0xaecaa)[_0xede2('0x8')](function(_0x254644){var _0x50e77e={'method':_0xede2('0x9'),'uri':url['resolve'](_0x46ded1['ndassistant_url'],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x46ded1[_0xede2('0xa')]||_0xede2('0xb'),'channelId':_0xede2('0xc'),'conversation':{'id':_0x4daaf4[_0xede2('0xd')]},'from':{'id':_0x4daaf4[_0xede2('0xe')],'name':_0x4daaf4[_0xede2('0xf')]},'recipient':{'id':_0x4daaf4['dnid'],'name':_0x4daaf4[_0xede2('0x10')]},'text':_0x46ded1['text'],'channelData':{}},'headers':{'Authorization':_0xede2('0x11')+_0x254644['access_token']},'json':!![]};if(_0x46ded1['project']){_0x50e77e[_0xede2('0x12')][_0xede2('0x13')][_0xede2('0x14')]=_0x46ded1[_0xede2('0x15')];}if(_0x46ded1[_0xede2('0x16')]=='1'){_0x50e77e[_0xede2('0x12')][_0xede2('0x13')]['AudioOutputSettings']={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x46ded1[_0xede2('0x17')]){_0x50e77e[_0xede2('0x12')][_0xede2('0x13')][_0xede2('0x18')]=_0x46ded1[_0xede2('0x17')];if(_0x46ded1['custom_action_data']){_0x50e77e['body'][_0xede2('0x13')][_0xede2('0x19')]=_0x46ded1[_0xede2('0x1a')];}}logger[_0xede2('0x1b')](JSON[_0xede2('0x1c')](_0x50e77e));return rp(_0x50e77e);});}; \ 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 2fa9b48..c536a8e 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 _0xb244=['exports'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xb244,0x9a));var _0x4b24=function(_0x160c73,_0x2ee678){_0x160c73=_0x160c73-0x0;var _0xd9302=_0xb244[_0x160c73];return _0xd9302;};'use strict';var asr=require('./lib/api');module[_0x4b24('0x0')]=function(_0x52c24f,_0x311aa9,_0x3af2d0,_0x4ee884){return asr(_0x52c24f,_0x311aa9,_0x3af2d0,_0x4ee884);}; \ No newline at end of file +var _0xdbef=['exports','./lib/api'];(function(_0xb68f76,_0x45f63a){var _0x4e2934=function(_0x1d1e09){while(--_0x1d1e09){_0xb68f76['push'](_0xb68f76['shift']());}};_0x4e2934(++_0x45f63a);}(_0xdbef,0xad));var _0xfdbe=function(_0x34bc30,_0x177cb0){_0x34bc30=_0x34bc30-0x0;var _0x5706de=_0xdbef[_0x34bc30];return _0x5706de;};'use strict';var asr=require(_0xfdbe('0x0'));module[_0xfdbe('0x1')]=function(_0x5afc78,_0x3485e5,_0x3d79ba,_0x30ec6b){return asr(_0x5afc78,_0x3485e5,_0x3d79ba,_0x30ec6b);}; \ 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 e461001..bd0cfb7 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 _0x302d=['../../../../../../config/logger','agi','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','createHash','update','digest','hex','send','createReadStream','data','EOS','error','stringify','terminate','parse','status','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','message','bluebird','moment'];(function(_0x10ed79,_0x5b8041){var _0x2e502f=function(_0x424752){while(--_0x424752){_0x10ed79['push'](_0x10ed79['shift']());}};_0x2e502f(++_0x5b8041);}(_0x302d,0xbc));var _0xd302=function(_0x14cc3d,_0x160e76){_0x14cc3d=_0x14cc3d-0x0;var _0x4102b7=_0x302d[_0x14cc3d];return _0x4102b7;};'use strict';var BPromise=require(_0xd302('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xd302('0x1'));var crypto=require('crypto');var logger=require(_0xd302('0x2'))(_0xd302('0x3'));module[_0xd302('0x4')]=function(_0x44c0f4,_0x50cd56,_0x3017aa,_0x32701c){return new BPromise(function(_0x285b21,_0x29922f){logger[_0xd302('0x5')](_0xd302('0x6'),_0x32701c||_0xd302('0x7'));var _0x2656c2=new WebSocket(_0x32701c||_0xd302('0x7'),{'perMessageDeflate':![]});var _0x1d74a5='';var _0x4ab0c8='0';var _0x6f675b='1';var _0x388b08=_0xd302('0x8');function _0x5c9472(_0x411603){var _0x441e03=crypto[_0xd302('0x9')]('sha1');_0x441e03[_0xd302('0xa')](_0x411603);return _0x441e03[_0xd302('0xb')](_0xd302('0xc'));}function _0x37f232(){try{logger['info']('Open\x20Tilde\x20ASR\x20socket');var _0x5568a8=moment()['unix']();var _0x3914c0=_0x5c9472(_0x5568a8+_0x50cd56+_0x3017aa);_0x2656c2[_0xd302('0xd')](JSON['stringify']({'appID':_0x50cd56,'timestamp':_0x5568a8,'appKey':_0x3914c0}));var _0x148bce=fs[_0xd302('0xe')](_0x44c0f4);_0x148bce['on'](_0xd302('0xf'),function(_0x410f74){_0x2656c2[_0xd302('0xd')](_0x410f74);});_0x148bce['on']('close',function(){_0x2656c2[_0xd302('0xd')](_0xd302('0x10'));});}catch(_0x1a102a){logger[_0xd302('0x11')]('Tilde\x20ASR\x20send\x20error',JSON[_0xd302('0x12')](_0x1a102a));_0x2656c2[_0xd302('0x13')]();}}function _0x299233(_0x3d8094){try{if(_0x3d8094){var _0x558e65=JSON[_0xd302('0x14')](_0x3d8094);switch(_0x558e65[_0xd302('0x15')]){case 0x0:if(_0x558e65[_0xd302('0x16')]){if(_0x558e65[_0xd302('0x16')][_0xd302('0x17')]){logger['info'](_0xd302('0x18'),JSON['stringify'](_0x558e65[_0xd302('0x16')][_0xd302('0x19')]));_0x1d74a5=_0x558e65[_0xd302('0x16')][_0xd302('0x19')][0x0][_0xd302('0x1a')];_0x4ab0c8=_0x558e65[_0xd302('0x16')]['hypotheses'][0x0][_0xd302('0x1b')];_0x6f675b='0';_0x388b08=_0xd302('0x1c');_0x2656c2[_0xd302('0x13')]();}}break;case 0x1:logger[_0xd302('0x5')](_0xd302('0x8'));_0x6f675b='1';_0x388b08=_0xd302('0x8');break;case 0x2:logger[_0xd302('0x5')](_0xd302('0x1d'));_0x6f675b='2';_0x388b08=_0xd302('0x1d');break;case 0x9:logger['info'](_0xd302('0x1e'));_0x6f675b='9';_0x388b08=_0xd302('0x1e');break;case 0xa:logger[_0xd302('0x5')](_0xd302('0x1f'));_0x6f675b='10';_0x388b08='Authentication\x20failed.';break;case 0xb:logger[_0xd302('0x5')](_0xd302('0x20'));_0x6f675b='11';_0x388b08=_0xd302('0x20');}}}catch(_0x4a9683){logger[_0xd302('0x11')](_0xd302('0x21'),JSON[_0xd302('0x12')](_0x4a9683));_0x2656c2[_0xd302('0x13')]();}}function _0x1c336c(){logger[_0xd302('0x5')](_0xd302('0x22'));_0x285b21({'transcript':_0x1d74a5,'confidence':_0x4ab0c8,'status':_0x6f675b,'status_message':_0x388b08});}function _0x1d0f4e(_0x83469d){logger['error']('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xd302('0x23')](_0x83469d)){logger[_0xd302('0x11')](_[_0xd302('0x24')](_0x83469d)?JSON[_0xd302('0x12')](_0x83469d):_0x83469d);}}_0x2656c2['on']('open',_0x37f232);_0x2656c2['on'](_0xd302('0x25'),_0x299233);_0x2656c2['on']('close',_0x1c336c);_0x2656c2['on'](_0xd302('0x11'),_0x1d0f4e);});}; \ No newline at end of file +var _0x23ca=['Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','bluebird','moment','crypto','../../../../../../config/logger','exports','info','Tilde\x20URI','wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','sha1','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','close','EOS','error','Tilde\x20ASR\x20send\x20error','parse','result','final','Tilde\x20ASR\x20hypoteses','hypotheses','Success.','terminate'];(function(_0x1890a3,_0x4e531e){var _0x10258a=function(_0x5dba53){while(--_0x5dba53){_0x1890a3['push'](_0x1890a3['shift']());}};_0x10258a(++_0x4e531e);}(_0x23ca,0x7c));var _0xa23c=function(_0x3590ed,_0x3a4587){_0x3590ed=_0x3590ed-0x0;var _0x21f72f=_0x23ca[_0x3590ed];return _0x21f72f;};'use strict';var BPromise=require(_0xa23c('0x0'));var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xa23c('0x1'));var crypto=require(_0xa23c('0x2'));var logger=require(_0xa23c('0x3'))('agi');module[_0xa23c('0x4')]=function(_0x15a327,_0x5d6fda,_0x589f70,_0x1346a2){return new BPromise(function(_0x16b6fb,_0x3f6a30){logger[_0xa23c('0x5')](_0xa23c('0x6'),_0x1346a2||_0xa23c('0x7'));var _0x449983=new WebSocket(_0x1346a2||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x350eb0='';var _0x2b7d85='0';var _0x305c88='1';var _0x35db34=_0xa23c('0x8');function _0x5ec5f2(_0x39311b){var _0x446788=crypto['createHash'](_0xa23c('0x9'));_0x446788[_0xa23c('0xa')](_0x39311b);return _0x446788[_0xa23c('0xb')]('hex');}function _0x51b379(){try{logger[_0xa23c('0x5')](_0xa23c('0xc'));var _0x4579ae=moment()[_0xa23c('0xd')]();var _0x297987=_0x5ec5f2(_0x4579ae+_0x5d6fda+_0x589f70);_0x449983[_0xa23c('0xe')](JSON[_0xa23c('0xf')]({'appID':_0x5d6fda,'timestamp':_0x4579ae,'appKey':_0x297987}));var _0x3308ab=fs[_0xa23c('0x10')](_0x15a327);_0x3308ab['on']('data',function(_0x32086b){_0x449983[_0xa23c('0xe')](_0x32086b);});_0x3308ab['on'](_0xa23c('0x11'),function(){_0x449983[_0xa23c('0xe')](_0xa23c('0x12'));});}catch(_0xa34462){logger[_0xa23c('0x13')](_0xa23c('0x14'),JSON[_0xa23c('0xf')](_0xa34462));_0x449983['terminate']();}}function _0x1df625(_0x1abcfb){try{if(_0x1abcfb){var _0x2e912f=JSON[_0xa23c('0x15')](_0x1abcfb);switch(_0x2e912f['status']){case 0x0:if(_0x2e912f['result']){if(_0x2e912f[_0xa23c('0x16')][_0xa23c('0x17')]){logger[_0xa23c('0x5')](_0xa23c('0x18'),JSON[_0xa23c('0xf')](_0x2e912f[_0xa23c('0x16')][_0xa23c('0x19')]));_0x350eb0=_0x2e912f[_0xa23c('0x16')][_0xa23c('0x19')][0x0]['transcript'];_0x2b7d85=_0x2e912f[_0xa23c('0x16')]['hypotheses'][0x0]['likelihood'];_0x305c88='0';_0x35db34=_0xa23c('0x1a');_0x449983[_0xa23c('0x1b')]();}}break;case 0x1:logger[_0xa23c('0x5')](_0xa23c('0x8'));_0x305c88='1';_0x35db34=_0xa23c('0x8');break;case 0x2:logger[_0xa23c('0x5')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x305c88='2';_0x35db34=_0xa23c('0x1c');break;case 0x9:logger[_0xa23c('0x5')](_0xa23c('0x1d'));_0x305c88='9';_0x35db34=_0xa23c('0x1d');break;case 0xa:logger[_0xa23c('0x5')](_0xa23c('0x1e'));_0x305c88='10';_0x35db34=_0xa23c('0x1e');break;case 0xb:logger['info'](_0xa23c('0x1f'));_0x305c88='11';_0x35db34=_0xa23c('0x1f');}}}catch(_0x11609b){logger['error']('Tilde\x20ASR\x20parse\x20error',JSON['stringify'](_0x11609b));_0x449983[_0xa23c('0x1b')]();}}function _0x80d8f3(){logger[_0xa23c('0x5')](_0xa23c('0x20'));_0x16b6fb({'transcript':_0x350eb0,'confidence':_0x2b7d85,'status':_0x305c88,'status_message':_0x35db34});}function _0x2754d8(_0x22a37a){logger['error'](_0xa23c('0x21'));if(!_[_0xa23c('0x22')](_0x22a37a)){logger[_0xa23c('0x13')](_[_0xa23c('0x23')](_0x22a37a)?JSON[_0xa23c('0xf')](_0x22a37a):_0x22a37a);}}_0x449983['on'](_0xa23c('0x24'),_0x51b379);_0x449983['on'](_0xa23c('0x25'),_0x1df625);_0x449983['on']('close',_0x80d8f3);_0x449983['on'](_0xa23c('0x13'),_0x2754d8);});}; \ 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 efe5b86..7fb5444 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 _0x9cd2=['exports','./asr'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x9cd2,0x11f));var _0x29cd=function(_0x2543d6,_0x3a5e78){_0x2543d6=_0x2543d6-0x0;var _0x55213c=_0x9cd2[_0x2543d6];return _0x55213c;};var asr=require(_0x29cd('0x0'));module[_0x29cd('0x1')]={'asr':asr}; \ No newline at end of file +var _0x261c=['./asr','exports'];(function(_0x560224,_0x12c349){var _0x2c8b53=function(_0x176519){while(--_0x176519){_0x560224['push'](_0x560224['shift']());}};_0x2c8b53(++_0x12c349);}(_0x261c,0x1b8));var _0xc261=function(_0x3cee22,_0x54ad32){_0x3cee22=_0x3cee22-0x0;var _0x286fa5=_0x261c[_0x3cee22];return _0x286fa5;};var asr=require(_0xc261('0x0'));module[_0xc261('0x1')]={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 708bcd2..1b7dea2 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 _0xfe60=['nextTick','inherits','exports','net','EventEmitter','./error','./channel','127.0.0.1','call','error','listening','connection','getConnections','emit','E_AGI_SERVER_ERROR','ready','code','close','E_AGI_SERVER_CLOSE'];(function(_0x59bff3,_0xf837d7){var _0x1109fe=function(_0x9331dd){while(--_0x9331dd){_0x59bff3['push'](_0x59bff3['shift']());}};_0x1109fe(++_0xf837d7);}(_0xfe60,0x1cb));var _0x0fe6=function(_0x78b207,_0x3efd8b){_0x78b207=_0x78b207-0x0;var _0x4f9b0e=_0xfe60[_0x78b207];return _0x4f9b0e;};'use strict';var util=require('util');var net=require(_0x0fe6('0x0'));var EventEmitter=require('events')[_0x0fe6('0x1')];var AGIError=require(_0x0fe6('0x2'));var AGIChannel=require(_0x0fe6('0x3'));var AGIServer=function(_0x4aa401,_0x40740,_0x244c56){var _0x402912=this,_0x4aa401=_0x4aa401||0x11dd,_0x40740=_0x40740||_0x0fe6('0x4'),_0x1281fc=null,_0x13b947=0x0;EventEmitter[_0x0fe6('0x5')](_0x402912);function _0x24e88f(){if(!_0x4aa401){_0x402912['emit'](_0x0fe6('0x6'),new AGIError('E_AGI_ARGUMENT_PORT'));return![];}_0x1281fc=net['createServer']();_0x1281fc['listen'](_0x4aa401,_0x40740);_0x1281fc['on'](_0x0fe6('0x7'),function(){_0x402912['emit'](_0x0fe6('0x7'));});_0x1281fc['on'](_0x0fe6('0x8'),function(_0x1a14f3){_0x1281fc[_0x0fe6('0x9')](function(_0x299994,_0x2498a0){if(_0x299994){_0x402912[_0x0fe6('0xa')]('error',new AGIError(_0x0fe6('0xb'),_0x299994));}else if(_0x244c56&&_0x244c56<0x0){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x1a14f3['destroy']();}else if(_0x244c56&&_0x244c56>0x0&&_0x244c56<_0x2498a0){_0x13b947+=0x1;_0x402912[_0x0fe6('0xa')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x13b947));_0x1a14f3['destroy']();}else{var _0x225253=new AGIChannel(_0x1a14f3);_0x225253['on'](_0x0fe6('0xc'),function(){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x8'),_0x225253);});}});});_0x1281fc['on'](_0x0fe6('0x6'),function(_0x16f2f6){_0x402912[_0x0fe6('0xa')](_0x0fe6('0x6'),new AGIError(_0x0fe6('0xb'),_0x16f2f6[_0x0fe6('0xd')]));});_0x1281fc['on'](_0x0fe6('0xe'),function(){_0x402912[_0x0fe6('0xa')]('close',new AGIError(_0x0fe6('0xf')));});}process[_0x0fe6('0x10')](function(){_0x24e88f();});};util[_0x0fe6('0x11')](AGIServer,EventEmitter);module[_0x0fe6('0x12')]=function(_0x38bdeb,_0x3738bd,_0xf351d5){return new AGIServer(_0x38bdeb,_0x3738bd,_0xf351d5);}; \ No newline at end of file +var _0x1c4d=['listening','connection','getConnections','error','E_AGI_SERVER_ERROR','destroy','ready','close','E_AGI_SERVER_CLOSE','nextTick','inherits','net','events','EventEmitter','./channel','127.0.0.1','call','emit','E_AGI_ARGUMENT_PORT','createServer'];(function(_0x150830,_0x1fc37d){var _0x26ffce=function(_0x1903e8){while(--_0x1903e8){_0x150830['push'](_0x150830['shift']());}};_0x26ffce(++_0x1fc37d);}(_0x1c4d,0x1d7));var _0xd1c4=function(_0x3aa0c6,_0x21216d){_0x3aa0c6=_0x3aa0c6-0x0;var _0x2988c8=_0x1c4d[_0x3aa0c6];return _0x2988c8;};'use strict';var util=require('util');var net=require(_0xd1c4('0x0'));var EventEmitter=require(_0xd1c4('0x1'))[_0xd1c4('0x2')];var AGIError=require('./error');var AGIChannel=require(_0xd1c4('0x3'));var AGIServer=function(_0x3e30ce,_0x1853c8,_0x3bbe05){var _0x4ca0df=this,_0x3e30ce=_0x3e30ce||0x11dd,_0x1853c8=_0x1853c8||_0xd1c4('0x4'),_0x406eb6=null,_0x12e793=0x0;EventEmitter[_0xd1c4('0x5')](_0x4ca0df);function _0x429dc6(){if(!_0x3e30ce){_0x4ca0df[_0xd1c4('0x6')]('error',new AGIError(_0xd1c4('0x7')));return![];}_0x406eb6=net[_0xd1c4('0x8')]();_0x406eb6['listen'](_0x3e30ce,_0x1853c8);_0x406eb6['on'](_0xd1c4('0x9'),function(){_0x4ca0df['emit'](_0xd1c4('0x9'));});_0x406eb6['on'](_0xd1c4('0xa'),function(_0x430296){_0x406eb6[_0xd1c4('0xb')](function(_0x3dbd54,_0x1ba9f2){if(_0x3dbd54){_0x4ca0df[_0xd1c4('0x6')](_0xd1c4('0xc'),new AGIError(_0xd1c4('0xd'),_0x3dbd54));}else if(_0x3bbe05&&_0x3bbe05<0x0){_0x4ca0df[_0xd1c4('0x6')](_0xd1c4('0xc'),new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x430296[_0xd1c4('0xe')]();}else if(_0x3bbe05&&_0x3bbe05>0x0&&_0x3bbe05<_0x1ba9f2){_0x12e793+=0x1;_0x4ca0df[_0xd1c4('0x6')]('error',new AGIError('E_AGI_SERVER_MAXCONNECTION',_0x12e793));_0x430296[_0xd1c4('0xe')]();}else{var _0x5bec0f=new AGIChannel(_0x430296);_0x5bec0f['on'](_0xd1c4('0xf'),function(){_0x4ca0df['emit']('connection',_0x5bec0f);});}});});_0x406eb6['on'](_0xd1c4('0xc'),function(_0x5aed19){_0x4ca0df[_0xd1c4('0x6')](_0xd1c4('0xc'),new AGIError(_0xd1c4('0xd'),_0x5aed19['code']));});_0x406eb6['on'](_0xd1c4('0x10'),function(){_0x4ca0df[_0xd1c4('0x6')](_0xd1c4('0x10'),new AGIError(_0xd1c4('0x11')));});}process[_0xd1c4('0x12')](function(){_0x429dc6();});};util[_0xd1c4('0x13')](AGIServer,EventEmitter);module['exports']=function(_0x3377e3,_0x1de7aa,_0x4289f0){return new AGIServer(_0x3377e3,_0x1de7aa,_0x4289f0);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index a8ff2a0..ebaf1a6 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 _0xc40d=['gotoc','continueAt','gotoif','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','EVAL\x20CONDITION\x20%s\x20%s','false','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','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ISPEECH_ASR_%s','ispeechtts','Trying\x20ispeech\x20TTS\x20%s','streamFile','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','math','operation','math\x20%s','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','pause_id','agentPause','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','getVoiceQueue','no\x20queue\x20found','indexOf','XMCS-QUEUE','toLowerCase','gosub','position','QUEUE','Enter\x20in\x20RECORD\x20(%s)\x20block','%s_%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','no\x20url\x20configured','Response:','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','sayDigits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','account_id','Smtp','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20configured','no\x20sms\x20account\x20found','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','Enter\x20in\x20START\x20(%s)\x20block','yes','Skipped\x20Answer','project_id','no\x20subproject\x20selected','getSquareProject','no\x20subproject\x20found\x20with\x20id\x20%d','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','google_cloud_tts','apiKey','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','join','exports','path','util','shelljs','odbc','randomstring','moment','mustache','request-promise','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','channel','rpc','getVariable','getVariableById','name','catch','prototype','getVoiceQueueById','getSquareProjectById','then','dsn','getUser','getTrunkById','getSound','getSoundById','save_name','getMailAccount','getMailAccountById','sendMailMessage','mailRpc','getIntervals','Intervals','interval','format','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','callback_','random','lastName','phone','list_id','callback','scheduledAt','toString','callback_priority','getPauseById','agent','agentUnpause','agentLogout','agentLogin','internal','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','google_cloud_tts_text_type','text','en-US','ssmlGender','MALE','audioEncoding','MP3','google_tts_language','restAPI','method','number','timeout','includes','POST','PUT','toUpperCase','body','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','uri','headers','parse','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','ispeechTTS','ispeech_tts_language','ispeechASR','ispeech_asr_language','isConfigured','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','replaceObjectAllVariables','recursiveNodeIndex','isPlainObject','isArray','length','isString','replaceAllVariables','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','Enter\x20in\x20CALLBACK\x20(%s)\x20block','delay','minutes','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','application','noop','Executed\x20command\x20%s\x20%s','no\x20text\x20configured','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','grammar','no\x20grammar\x20configured','getAndSetVariable','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','MRCPRecog','RECOG_CONFIDENCE()','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_TRANSCRIPT','RECOG_INSTANCE()','database','odbc_id','no\x20odbc\x20database\x20found','no\x20query\x20configured','getQueryOdbc','sync','variable_id','keys','forEach','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','url','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','sesteknda','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','sestekNDA','SESTEK_NDA_%s','out','audiofile','unlink','.wav','SestekNDA\x20Result\x20%s','Enter\x20in\x20END\x20(%s)\x20block','end','ext_dial','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','trunk_name','no\x20trunk\x20selected','Executed\x20command\x20%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','no\x20file\x20audio\x20found','no\x20variable\x20selected\x20for\x20the\x20result','getData','response','test','mindigit','no\x20variable\x20found','hiddendigitsnum','hiddendigitspos','first','substr','generate','getsecretdigits','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','aws_bot_name','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','googleASR','GOOGLE_ASR_%s','tildeasr','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TILDE_ASR_%s','TildeASR\x20Result\x20%s'];(function(_0x20cf77,_0x27bd78){var _0x333e46=function(_0x1834d3){while(--_0x1834d3){_0x20cf77['push'](_0x20cf77['shift']());}};_0x333e46(++_0x27bd78);}(_0xc40d,0x8a));var _0xdc40=function(_0x309035,_0x2252f0){_0x309035=_0x309035-0x0;var _0x385bf9=_0xc40d[_0x309035];return _0x385bf9;};'use strict';var fs=require('fs');var path=require(_0xdc40('0x0'));var util=require(_0xdc40('0x1'));var _=require('lodash');var sh=require(_0xdc40('0x2'));var odbc=require(_0xdc40('0x3'))();var rs=require(_0xdc40('0x4'));var moment=require(_0xdc40('0x5'));var Mustache=require(_0xdc40('0x6'));var rp=require(_0xdc40('0x7'));var logger=require('../../config/logger')(_0xdc40('0x8'));var config=require(_0xdc40('0x9'));var scripts=require(_0xdc40('0xa'));var FILES_PATH=_0xdc40('0xb');var recursiveMapAttributes=[_0xdc40('0xc'),_0xdc40('0xd')];var verticesWithRetry=[_0xdc40('0xe'),_0xdc40('0xf'),'getsecretdigits'];var AGIVertices=function(_0x1aaad7,_0x31c0e4,_0x288813){this[_0xdc40('0x10')]=_0x1aaad7;this[_0xdc40('0x11')]=_0x31c0e4;this['mailRpc']=_0x288813;};AGIVertices['prototype'][_0xdc40('0x12')]=function(_0x5d3ca8,_0x5628b2){this[_0xdc40('0x11')][_0xdc40('0x13')](_0x5d3ca8)['then'](function(_0x2c3f71){_0x5628b2(null,_0x2c3f71?_0x2c3f71[_0xdc40('0x14')]:![]);})[_0xdc40('0x15')](function(_0x54098c){_0x5628b2(_0x54098c);});};AGIVertices[_0xdc40('0x16')]['getVoiceQueue']=function(_0x2dfb33,_0x26da3e){this[_0xdc40('0x11')][_0xdc40('0x17')](_0x2dfb33)['then'](function(_0xb763b7){_0x26da3e(null,_0xb763b7?_0xb763b7[_0xdc40('0x14')]:![]);})['catch'](function(_0xf7ff63){_0x26da3e(_0xf7ff63);});};AGIVertices[_0xdc40('0x16')]['getSquareProject']=function(_0x3b3b9b,_0x4adc7a){this['rpc'][_0xdc40('0x18')](_0x3b3b9b)[_0xdc40('0x19')](function(_0x31d282){_0x4adc7a(null,_0x31d282?_0x31d282[_0xdc40('0x14')]:![]);})[_0xdc40('0x15')](function(_0x2d54e7){_0x4adc7a(_0x2d54e7);});};AGIVertices[_0xdc40('0x16')]['getSquareOdbc']=function(_0x1350ac,_0x3920c4){this[_0xdc40('0x11')]['getSquareOdbcById'](_0x1350ac)[_0xdc40('0x19')](function(_0x482861){_0x3920c4(null,_0x482861?_0x482861[_0xdc40('0x1a')]:![]);})[_0xdc40('0x15')](function(_0x30697d){_0x3920c4(_0x30697d);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x1b')]=function(_0x3b3dee,_0x5a23c7){this[_0xdc40('0x11')]['getUserById'](_0x3b3dee)['then'](function(_0x3c3a9f){_0x5a23c7(null,_0x3c3a9f?_0x3c3a9f[_0xdc40('0x14')]:![]);})['catch'](function(_0x3a34b4){_0x5a23c7(_0x3a34b4);});};AGIVertices[_0xdc40('0x16')]['getTrunk']=function(_0x594c07,_0x1f6f94){this['rpc'][_0xdc40('0x1c')](_0x594c07)[_0xdc40('0x19')](function(_0x526158){_0x1f6f94(null,_0x526158?_0x526158[_0xdc40('0x14')]:![]);})[_0xdc40('0x15')](function(_0x24d447){_0x1f6f94(_0x24d447);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x1d')]=function(_0x5591ae,_0x1140e1){var _0x5451ca=this;this['rpc'][_0xdc40('0x1e')](_0x5591ae)[_0xdc40('0x19')](function(_0x449745){_0x1140e1(null,_0x449745?_0x5451ca['getSoundPath'](_0x449745[_0xdc40('0x1f')]):![]);})[_0xdc40('0x15')](function(_0xc23bb3){_0x1140e1(_0xc23bb3);});};AGIVertices['prototype'][_0xdc40('0x20')]=function(_0x1e88af,_0x2adef2){this[_0xdc40('0x11')][_0xdc40('0x21')](_0x1e88af)[_0xdc40('0x19')](function(_0x2fbf86){_0x2adef2(null,_0x2fbf86?_0x2fbf86:![]);})[_0xdc40('0x15')](function(_0x238038){_0x2adef2(_0x238038);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x22')]=function(_0xd508fa,_0x54e0f5,_0x5a03fc){this[_0xdc40('0x23')][_0xdc40('0x22')](_0xd508fa,_0x54e0f5)['then'](function(){_0x5a03fc(null);})[_0xdc40('0x15')](function(_0x297aac){_0x5a03fc(_0x297aac);});};AGIVertices['prototype'][_0xdc40('0x24')]=function(_0x367902,_0x4b560a){this[_0xdc40('0x11')]['getIntervalById'](_0x367902)['then'](function(_0x4d0b79){if(_0x4d0b79){if(_0x4d0b79['IntervalId']){_0x4b560a(null,[_0x4d0b79['interval']]);}else{_0x4b560a(null,_['map'](_0x4d0b79[_0xdc40('0x25')],_0xdc40('0x26')));}}else{_0x4b560a(null,![]);}})[_0xdc40('0x15')](function(_0x47b9aa){_0x4b560a(_0x47b9aa);});};AGIVertices['prototype']['getSoundPath']=function(_0x184801){return util[_0xdc40('0x27')]('%s/sounds/converted/%s',FILES_PATH,_0x184801);};AGIVertices[_0xdc40('0x16')]['getQueryOdbc']=function(_0x2edf2a,_0x299d6a,_0x5659d2){odbc[_0xdc40('0x28')](_0x2edf2a,function(_0x3f0f9a){if(_0x3f0f9a){logger[_0xdc40('0x29')](_0xdc40('0x2a'),_0x3f0f9a);_0x5659d2(_0x3f0f9a);}else{logger[_0xdc40('0x2b')]('ODBC\x20connection\x20successfully');odbc[_0xdc40('0x2c')](_0x299d6a,function(_0x3e7772,_0x24be71){if(_0x3e7772){logger[_0xdc40('0x2b')](_0xdc40('0x2d'),_0x299d6a);_0x5659d2(_0x3e7772);}else{logger[_0xdc40('0x2b')](_0xdc40('0x2e'),_0x299d6a);odbc[_0xdc40('0x2f')](function(_0x5401d2){if(_0x5401d2){logger[_0xdc40('0x29')](_0xdc40('0x30'),_0x5401d2);}_0x5659d2(null,_0x24be71);});}});}});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x31')]=function(_0x3baf88,_0x5df94e){this['rpc'][_0xdc40('0x32')](_0x3baf88)['then'](function(_0x2cf2b3){_0x5df94e(null,_0x2cf2b3?_0x2cf2b3:![]);})['catch'](function(_0x49a94a){_0x5df94e(_0x49a94a);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x33')]=function(_0x26c388,_0x3eea9e){this[_0xdc40('0x11')][_0xdc40('0x33')](_0x26c388)[_0xdc40('0x19')](function(_0x233010){_0x3eea9e(null,_0x233010);})[_0xdc40('0x15')](function(_0x3e73bb){_0x3eea9e(_0x3e73bb);});};AGIVertices[_0xdc40('0x16')]['createSquareDetailsReport']=function(_0x2faec6,_0x31a0b5,_0x931a4){this[_0xdc40('0x11')][_0xdc40('0x34')]({'uniqueid':this[_0xdc40('0x10')][_0xdc40('0x35')],'node':_0x2faec6[_0xdc40('0x36')],'application':_0x2faec6[_0xdc40('0x37')],'data':_0x31a0b5||null,'project_name':this[_0xdc40('0x10')][_0xdc40('0x38')],'callerid':this[_0xdc40('0x10')][_0xdc40('0x39')]})['then'](function(_0x4fe684){if(_0x931a4){_0x931a4(null,_0x4fe684);}})[_0xdc40('0x15')](function(_0x2492e5){if(_0x931a4){_0x931a4(_0x2492e5);}});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x3a')]=function(_0x13e31b,_0xcb111b,_0x2b0ad7,_0x1ea002){this[_0xdc40('0x11')][_0xdc40('0x3a')]({'uniqueid':this[_0xdc40('0x10')][_0xdc40('0x35')],'callerid':this[_0xdc40('0x10')]['callerid'],'calleridname':this[_0xdc40('0x10')]['calleridname'],'context':this['channel'][_0xdc40('0x3b')],'extension':this[_0xdc40('0x10')][_0xdc40('0x3c')],'priority':this['channel'][_0xdc40('0x3d')],'accountcode':this[_0xdc40('0x10')][_0xdc40('0x3e')],'dnid':this['channel']['dnid'],'projectName':this[_0xdc40('0x10')][_0xdc40('0x38')],'saveName':_0xcb111b,'filename':_0x13e31b[_0xdc40('0x3f')]||_0xcb111b,'savePath':_0x2b0ad7})[_0xdc40('0x19')](function(_0x49197d){_0x1ea002(null,_0x49197d);})[_0xdc40('0x15')](function(_0x32610d){_0x1ea002(_0x32610d);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x40')]=function(_0x3a7c59,_0xea9143,_0x10b370){this[_0xdc40('0x11')][_0xdc40('0x40')]({'uniqueid':this[_0xdc40('0x10')]['uniqueid'],'body':_0x3a7c59,'direction':_0xea9143})['then'](function(_0x37239c){if(_0x10b370){_0x10b370(null,_0x37239c);}})['catch'](function(_0xd3b312){if(_0x10b370){_0x10b370(_0xd3b312);}});};AGIVertices['prototype'][_0xdc40('0x41')]=function(_0x5da235,_0x23995c){this['rpc'][_0xdc40('0x41')]({'firstName':_[_0xdc40('0x42')](_0x5da235[_0xdc40('0x14')])||_[_0xdc40('0x43')](_0x5da235[_0xdc40('0x14')])?_0xdc40('0x44')+Math[_0xdc40('0x45')]():_0x5da235['name'],'lastName':_[_0xdc40('0x42')](_0x5da235[_0xdc40('0x46')])||_['isNil'](_0x5da235[_0xdc40('0x46')])?null:_0x5da235['lastName'],'phone':_0x5da235[_0xdc40('0x47')],'ListId':_0x5da235[_0xdc40('0x48')],'scheduledat':_0x5da235['scheduledAt'],'callbackUniqueid':this[_0xdc40('0x10')][_0xdc40('0x35')],'tags':_0xdc40('0x49'),'description':'Callback\x20scheduled\x20at\x20'+_0x5da235[_0xdc40('0x4a')][_0xdc40('0x4b')](),'priority':_0x5da235[_0xdc40('0x4c')]})['then'](function(_0x5bd4cb){_0x23995c(null,_0x5bd4cb);})[_0xdc40('0x15')](function(_0xc64238){_0x23995c(_0xc64238);});};AGIVertices[_0xdc40('0x16')]['getPause']=function(_0x17fd8d,_0x2d2122){this['rpc'][_0xdc40('0x4d')](_0x17fd8d)[_0xdc40('0x19')](function(_0xf3db59){_0x2d2122(null,_0xf3db59?_0xf3db59['name']:![]);})[_0xdc40('0x15')](function(_0x333954){_0x2d2122(_0x333954);});};AGIVertices[_0xdc40('0x16')]['agentPause']=function(_0x23dbec,_0xbc968d,_0x5ec586){var _0x852ef9={'role':_0xdc40('0x4e')};_0x852ef9[_0x23dbec]=this[_0xdc40('0x10')][_0xdc40('0x39')];this[_0xdc40('0x11')]['agentPause'](_0x852ef9,_0xbc968d,this[_0xdc40('0x10')][_0xdc40('0x35')])['then'](function(_0x453bff){_0x5ec586(null,_[_0xdc40('0x43')](_0x453bff)?![]:!![]);})[_0xdc40('0x15')](function(_0x438fad){logger[_0xdc40('0x29')](_0x438fad);_0x5ec586(null,![]);});};AGIVertices['prototype'][_0xdc40('0x4f')]=function(_0x3734e4,_0x98186e){var _0x369503={'role':_0xdc40('0x4e')};_0x369503[_0x3734e4]=this[_0xdc40('0x10')][_0xdc40('0x39')];this[_0xdc40('0x11')][_0xdc40('0x4f')](_0x369503)['then'](function(_0x2625e1){_0x98186e(null,_[_0xdc40('0x43')](_0x2625e1)?![]:!![]);})[_0xdc40('0x15')](function(_0x184cf3){logger[_0xdc40('0x29')](_0x184cf3);_0x98186e(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x8b632f,_0x52027c){var _0xe313e3={'role':_0xdc40('0x4e')};_0xe313e3[_0x8b632f]=this[_0xdc40('0x10')][_0xdc40('0x39')];this[_0xdc40('0x11')][_0xdc40('0x50')](_0xe313e3)[_0xdc40('0x19')](function(_0x1a60fb){_0x52027c(null,_[_0xdc40('0x43')](_0x1a60fb)?![]:!![]);})[_0xdc40('0x15')](function(_0x2ab4de){logger['error'](_0x2ab4de);_0x52027c(null,![]);});};AGIVertices['prototype'][_0xdc40('0x51')]=function(_0x2ec2ff,_0x2cc774){var _0x503db8={'role':_0xdc40('0x4e')};_0x503db8[_0x2ec2ff]=this[_0xdc40('0x10')]['callerid'];var _0x3ae1fb=_0x2ec2ff!=_0xdc40('0x52')?util[_0xdc40('0x27')]('%s/%s@from-sip/n',_0xdc40('0x53'),this['channel'][_0xdc40('0x39')]):undefined;this[_0xdc40('0x11')][_0xdc40('0x51')](_0x503db8,_0x3ae1fb)[_0xdc40('0x19')](function(_0x75f82b){_0x2cc774(null,_[_0xdc40('0x43')](_0x75f82b)?![]:!![]);})[_0xdc40('0x15')](function(_0x54ac2d){logger[_0xdc40('0x29')](_0x54ac2d);_0x2cc774(null,![]);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x54')]=function(_0x23293b,_0x4bce50){sh[_0xdc40('0x55')](_[_0xdc40('0x56')](_0x23293b),function(_0x29b033,_0x223929){var _0x2db1ad=_0x223929[_0xdc40('0x57')](/(\r\n|\n|\r)/gm,'');_0x4bce50(null,_0x2db1ad);});};AGIVertices['prototype'][_0xdc40('0x58')]=function(_0x1f706a,_0x2288b5){scripts['googleCloudTTS'](_0x1f706a['apiKey'],_0x1f706a[_0xdc40('0x59')]||'text',_0x1f706a[_0xdc40('0x5a')],_0x1f706a['languageCode']||_0xdc40('0x5b'),_0x1f706a[_0xdc40('0x5c')]||_0xdc40('0x5d'),_0x1f706a[_0xdc40('0x5e')]||_0xdc40('0x5f'))[_0xdc40('0x19')](function(_0x11b744){_0x2288b5(null,_0x11b744);})[_0xdc40('0x15')](function(_0x58e0aa){_0x2288b5(_0x58e0aa);});};AGIVertices['prototype']['googleTTS']=function(_0x46b7e1,_0x5bb23c){scripts['googleTTS'](_0x46b7e1[_0xdc40('0x5a')],_0x46b7e1[_0xdc40('0x60')]||'en',0x1)[_0xdc40('0x19')](function(_0x4c289a){_0x5bb23c(null,_0x4c289a);})[_0xdc40('0x15')](function(_0x503e51){_0x5bb23c(_0x503e51);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x61')]=function(_0x6d8c7e,_0x3f151b){var _0xe51926={'uri':_0x6d8c7e['url'],'method':_0x6d8c7e[_0xdc40('0x62')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x6d8c7e['timeout'])===_0xdc40('0x63')&&parseInt(_0x6d8c7e[_0xdc40('0x64')])>=0x1?parseInt(_0x6d8c7e[_0xdc40('0x64')])*0x3e8:0x5*0x3e8};if(_[_0xdc40('0x65')]([_0xdc40('0x66'),_0xdc40('0x67')],_0xe51926[_0xdc40('0x62')][_0xdc40('0x68')]())){try{_0xe51926[_0xdc40('0x69')]=_0x6d8c7e[_0xdc40('0xd')]?JSON['parse'](_0x6d8c7e['rawBody']):{};}catch(_0x450629){logger[_0xdc40('0x29')](_0xdc40('0x6a'),_0x450629);}}try{_0xe51926['headers']=_0x6d8c7e[_0xdc40('0xc')]?JSON['parse'](_0x6d8c7e[_0xdc40('0xc')]):{};}catch(_0x59a965){logger[_0xdc40('0x29')]('An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function',_0x59a965);}if(_0x6d8c7e[_0xdc40('0x6b')]){try{var _0x5446a9=require(_0x6d8c7e[_0xdc40('0x6b')])['sync'](this,_0xe51926);_0xe51926[_0xdc40('0x6c')]=Mustache['render'](_0x6d8c7e['url'],_0x5446a9,{},['$$','$$']);if(_0xe51926[_0xdc40('0x6d')]){_0xe51926['headers']=JSON[_0xdc40('0x6e')](Mustache[_0xdc40('0x6f')](JSON['stringify'](_0xe51926[_0xdc40('0x6d')]),_0x5446a9,{},['$$','$$']));}if(_0xe51926[_0xdc40('0x69')]){_0xe51926['body']=JSON[_0xdc40('0x6e')](Mustache['render'](JSON[_0xdc40('0x70')](_0xe51926[_0xdc40('0x69')]),_0x5446a9,{},['$$','$$']));}}catch(_0xe814d){logger['error']('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0xe814d);}}rp(_0xe51926)[_0xdc40('0x19')](function(_0x23638b){var _0x5aad9f={'statusCode':_0x23638b[_0xdc40('0x71')]||0xc8,'statusMessage':_0x23638b['statusMessage']||'OK','headers':_0x23638b[_0xdc40('0x6d')]||{},'body':_0x23638b[_0xdc40('0x69')]||{}};_0x3f151b(null,_0x5aad9f);})[_0xdc40('0x15')](function(_0x6b776f){var _0x636df1={'statusCode':_0x6b776f[_0xdc40('0x71')]||0x1f4,'statusMessage':_0x6b776f[_0xdc40('0x72')]||_0xdc40('0x73'),'headers':_0x6b776f['options'][_0xdc40('0x6d')]||{},'body':_0x6b776f[_0xdc40('0x74')][_0xdc40('0x69')]||{}};_0x3f151b(null,_0x636df1);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x75')]=function(_0x5a5acf,_0x2de24c){scripts[_0xdc40('0x75')](this[_0xdc40('0x10')][_0xdc40('0x35')],_0x5a5acf[_0xdc40('0x76')],_0x5a5acf['text'],_0x5a5acf[_0xdc40('0x77')]||'en')[_0xdc40('0x19')](function(_0x2b0ce2){_0x2de24c(null,_0x2b0ce2);})[_0xdc40('0x15')](function(_0x52c491){_0x2de24c(_0x52c491);});};AGIVertices['prototype']['sestekNDA']=function(_0x29704f,_0x5697ed){scripts['sestekNDA'](this[_0xdc40('0x10')],_0x29704f)['then'](function(_0xe9ebd8){_0x5697ed(null,_0xe9ebd8);})[_0xdc40('0x15')](function(_0x38ee87){_0x5697ed(_0x38ee87);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x78')]=function(_0x13fa8c,_0x48f528){scripts[_0xdc40('0x78')](_0x13fa8c[_0xdc40('0x76')],_0x13fa8c[_0xdc40('0x5a')],_0x13fa8c[_0xdc40('0x79')]||_0xdc40('0x5b'),_0x13fa8c['speed'])['then'](function(_0xe66f94){_0x48f528(null,_0xe66f94);})[_0xdc40('0x15')](function(_0x19809c){_0x48f528(_0x19809c);});};AGIVertices['prototype'][_0xdc40('0x7a')]=function(_0x4cb988,_0x3be29b,_0x5a1539){scripts[_0xdc40('0x7a')](_0x3be29b,_0x4cb988[_0xdc40('0x76')],_0x4cb988[_0xdc40('0x7b')]||_0xdc40('0x5b'),this[_0xdc40('0x7c')](_0x4cb988['model'])?_0x4cb988['model']:undefined)[_0xdc40('0x19')](function(_0x365b3e){_0x5a1539(null,_0x365b3e);})[_0xdc40('0x15')](function(_0x54b010){_0x5a1539(_0x54b010);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x7d')]=function(_0x30ac03,_0x1218e2){scripts[_0xdc40('0x7d')](_0x30ac03[_0xdc40('0x7e')],_0x30ac03[_0xdc40('0x7f')],_0x30ac03[_0xdc40('0x80')],_0x30ac03['aws_polly_voice']||_0xdc40('0x81'),_0x30ac03[_0xdc40('0x5a')],_0x30ac03[_0xdc40('0x82')]||'text')['then'](function(_0x3882cb){_0x1218e2(null,_0x3882cb);})[_0xdc40('0x15')](function(_0x4d1904){_0x1218e2(_0x4d1904);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x83')]=function(_0x3bd856,_0x165fe0){scripts[_0xdc40('0x83')](this[_0xdc40('0x10')][_0xdc40('0x35')],_0x3bd856[_0xdc40('0x7e')],_0x3bd856[_0xdc40('0x7f')],_0x3bd856[_0xdc40('0x84')],_0x3bd856['text'],_0x3bd856['aws_bot_name'])['then'](function(_0x315aba){_0x165fe0(null,_0x315aba);})[_0xdc40('0x15')](function(_0x4ca337){_0x165fe0(_0x4ca337);});};AGIVertices['prototype']['googleASR']=function(_0x1ffcec,_0x425f21,_0x24f46c){scripts['googleASR'](_0x425f21,_0x1ffcec[_0xdc40('0x76')],_0x1ffcec[_0xdc40('0x85')]||_0xdc40('0x5b'))['then'](function(_0x47bf4f){_0x24f46c(null,_0x47bf4f);})[_0xdc40('0x15')](function(_0x55ebf4){_0x24f46c(_0x55ebf4);});};AGIVertices[_0xdc40('0x16')][_0xdc40('0x86')]=function(_0x498c31,_0x15d53f,_0x3681f3){scripts[_0xdc40('0x86')](_0x15d53f,_0x498c31[_0xdc40('0x87')],_0x498c31[_0xdc40('0x88')],_0x498c31[_0xdc40('0x6c')])[_0xdc40('0x19')](function(_0x1282bb){_0x3681f3(null,_0x1282bb);})['catch'](function(_0x15afa4){_0x3681f3(_0x15afa4);});};AGIVertices[_0xdc40('0x16')]['clear']=function(_0x2ea7a3){var _0x2be35b=_[_0xdc40('0x65')](verticesWithRetry,_0x2ea7a3[_0xdc40('0x37')])?_0x2ea7a3:_[_0xdc40('0x89')](_0x2ea7a3);for(var _0x5b8bfa in _0x2be35b){if(_0x2be35b[_0xdc40('0x8a')](_0x5b8bfa)){if(_0x2be35b[_0x5b8bfa]&&_['isString'](_0x2be35b[_0x5b8bfa])){if(_[_0xdc40('0x65')](recursiveMapAttributes,_0x5b8bfa)){_0x2be35b[_0x5b8bfa]=this[_0xdc40('0x8b')](_0x2be35b[_0x5b8bfa]);}else{_0x2be35b[_0x5b8bfa]=this['replaceAllVariables'](_0x2be35b[_0x5b8bfa]);}}}}return _0x2be35b;};AGIVertices['prototype'][_0xdc40('0x8c')]=function(_0x526059){for(var _0x45e5a4 in _0x526059){if(_0x526059['hasOwnProperty'](_0x45e5a4)){if(_[_0xdc40('0x8d')](_0x526059[_0x45e5a4])){this[_0xdc40('0x8c')](_0x526059[_0x45e5a4]);}else if(_[_0xdc40('0x8e')](_0x526059[_0x45e5a4])){for(var _0x407293=0x0;_0x407293<_0x526059[_0x45e5a4][_0xdc40('0x8f')];_0x407293++){this['recursiveNodeIndex'](_0x526059[_0x45e5a4][_0x407293]);}}else if(_[_0xdc40('0x90')](_0x526059[_0x45e5a4])){_0x526059[_0x45e5a4]=this[_0xdc40('0x91')](_0x526059[_0x45e5a4]);}}}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x92')]=function(_0x3b61fe,_0x150968){for(var _0x9edc1c in _0x3b61fe){if(_0x3b61fe['hasOwnProperty'](_0x9edc1c)){if(_[_0xdc40('0x8d')](_0x3b61fe[_0x9edc1c])){if(!_['isEmpty'](_0x3b61fe[_0x9edc1c])){this[_0xdc40('0x92')](_0x3b61fe[_0x9edc1c],util['format'](_0xdc40('0x93'),_0x150968,_0x9edc1c));}}else if(_[_0xdc40('0x8e')](_0x3b61fe[_0x9edc1c])){for(var _0x2d10e4=0x0;_0x2d10e4<_0x3b61fe[_0x9edc1c][_0xdc40('0x8f')];_0x2d10e4++){this[_0xdc40('0x92')](_0x3b61fe[_0x9edc1c][_0x2d10e4],util[_0xdc40('0x27')](_0xdc40('0x93'),_0x150968,_0x9edc1c+'['+_0x2d10e4+']'));}}else{if(!_[_0xdc40('0x43')](_0x3b61fe[_0x9edc1c])){this[_0xdc40('0x10')][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0x93'),_0x150968,_0x9edc1c),_0x3b61fe[_0x9edc1c]);}}}}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x8b')]=function(_0x2741cf){try{var _0x53350a=JSON['parse'](_0x2741cf);this[_0xdc40('0x8c')](_0x53350a);return JSON['stringify'](_0x53350a);}catch(_0x42c44c){return this['replaceAllVariables'](_0x2741cf);}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x91')]=function(_0xd80b33){var _0x3cc27b=_0xd80b33[_0xdc40('0x95')]('{');for(var _0x1dce1b=0x1;_0x1dce1b<_0x3cc27b[_0xdc40('0x8f')];_0x1dce1b+=0x1){var _0x3426d9=_0x3cc27b[_0x1dce1b][_0xdc40('0x95')]('}');if(_0x3426d9[_0xdc40('0x8f')]>0x1){_0xd80b33=_0xd80b33[_0xdc40('0x96')]('{'+_0x3426d9[0x0]+'}',this['channel'][_0xdc40('0x12')](_0x3426d9[0x0])[_0xdc40('0x97')]||_0x3426d9[0x0]);}}if(_0x3cc27b['length']===0x1){return _0xd80b33[_0xdc40('0x4b')]();}return this[_0xdc40('0x91')](_0xd80b33);};AGIVertices['prototype']['getAndSetVariable']=function(_0x5a5935,_0x3a4962){var _0x311fe2=this[_0xdc40('0x10')]['getVariable'](_0x5a5935);if(_0x311fe2[_0xdc40('0x98')]===-0x1){return _0x311fe2;}logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x99'),_0x3a4962,_0x311fe2['extra']));return this[_0xdc40('0x10')][_0xdc40('0x94')](_0x3a4962,_0x311fe2['extra']);};AGIVertices['prototype']['isConfigured']=function(_0x4dd5fb){return _0x4dd5fb&&_0x4dd5fb!=='0'&&_0x4dd5fb!=='-1'&&_0x4dd5fb!=='';};AGIVertices[_0xdc40('0x16')][_0xdc40('0x9a')]=function(_0x37a0e6){this[_0xdc40('0x34')]['sync'](this,_0x37a0e6,'-');_0x37a0e6[_0xdc40('0x9b')]=_0x37a0e6[_0xdc40('0x9a')];return{'code':0xc8,'result':'-'};};AGIVertices[_0xdc40('0x16')]['agi']=function(_0x4b2023){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x4b2023[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0x8')]([_0x4b2023[_0xdc40('0x9c')],_0x4b2023[_0xdc40('0x9d')]]);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x9e')]=function(_0x568660){logger['info'](util[_0xdc40('0x27')](_0xdc40('0x9f'),_0x568660[_0xdc40('0x36')]));if(this['isConfigured'](_0x568660[_0xdc40('0x64')])){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0xa0'),_0x568660[_0xdc40('0x64')]));var _0x1e6e26=this[_0xdc40('0x10')][_0xdc40('0xa1')](_0x568660['timeout']);if(_0x1e6e26[_0xdc40('0x98')]===-0x1){return _0x1e6e26;}}return this['channel'][_0xdc40('0x9e')]();};AGIVertices[_0xdc40('0x16')]['callback']=function(_0x3bcb4a){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0xa2'),_0x3bcb4a[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x3bcb4a[_0xdc40('0x48')])){return this[_0xdc40('0x10')]['error'](_0x3bcb4a,'no\x20list\x20selected');}_0x3bcb4a[_0xdc40('0x4a')]=moment();if(this['isConfigured'](_0x3bcb4a[_0xdc40('0xa3')])){_0x3bcb4a['scheduledAt']=moment()['add'](_0x3bcb4a[_0xdc40('0xa3')],_0xdc40('0xa4'));}if(!this['isConfigured'](_0x3bcb4a[_0xdc40('0x4c')])){_0x3bcb4a[_0xdc40('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x3bcb4a);return this['channel']['noop'](util['format'](_0xdc40('0xa5'),_0x3bcb4a[_0xdc40('0x47')],_0x3bcb4a['list_id'],_0x3bcb4a[_0xdc40('0x4a')]));};AGIVertices[_0xdc40('0x16')]['custom_app']=function(_0x5bc427){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0xa6'),_0x5bc427['label']));var _0x16508c=this[_0xdc40('0x10')][_0xdc40('0x55')](_0x5bc427[_0xdc40('0xa7')],_0x5bc427[_0xdc40('0x74')]);if(_0x16508c[_0xdc40('0x98')]===-0x1){return _0x16508c;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xa9'),_0x5bc427[_0xdc40('0xa7')],_0x5bc427['options']));};AGIVertices['prototype']['lumenvoxtts']=function(_0x5ea944){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block',_0x5ea944[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x5ea944['text'])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xaa'));}var _0x5071dd='\x22'+_0x5ea944['text']+'\x22';if(this[_0xdc40('0x7c')](_0x5ea944[_0xdc40('0x74')])){_0x5071dd+=','+_0x5ea944[_0xdc40('0x74')];}var _0x38eff7=this[_0xdc40('0x10')][_0xdc40('0x55')]('MRCPSynth',_0x5071dd);if(_0x38eff7[_0xdc40('0x98')]===-0x1){return _0x38eff7;}return this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xab'),_0x5071dd));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xac')]=function(_0x42b09d){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0xad'),_0x42b09d[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x42b09d['text'])){return this[_0xdc40('0x10')][_0xdc40('0xa8')]('no\x20text\x20configured');}var _0x25940f='\x22'+_0x42b09d['text']+'\x22';if(this['isConfigured'](_0x42b09d[_0xdc40('0x74')])){_0x25940f+=','+_0x42b09d['options'];}var _0x58d26f=this['channel'][_0xdc40('0x55')](_0xdc40('0xae'),_0x25940f);if(_0x58d26f['result']===-0x1){return _0x58d26f;}return this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')]('Executed\x20command\x20MRCPSynth\x20%s',_0x25940f));};AGIVertices['prototype'][_0xdc40('0xaf')]=function(_0x599cbc){logger[_0xdc40('0x2b')](util['format']('Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block',_0x599cbc[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x599cbc[_0xdc40('0xb0')])){return this['channel'][_0xdc40('0xa8')](_0xdc40('0xb1'));}var _0x3e8c62=_0x599cbc[_0xdc40('0xb0')];if(this['isConfigured'](_0x599cbc[_0xdc40('0x74')])){_0x3e8c62+=','+_0x599cbc[_0xdc40('0x74')];}var _0xfe441c=this[_0xdc40('0x10')]['exec']('MRCPRecog',_0x3e8c62);if(_0xfe441c[_0xdc40('0x98')]===-0x1){return _0xfe441c;}var _0x495596=this[_0xdc40('0xb2')]('RECOG_CONFIDENCE()',_0xdc40('0xb3'));if(_0x495596[_0xdc40('0x98')]===-0x1){return _0x495596;}var _0x4c305=this[_0xdc40('0xb2')](_0xdc40('0xb4'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x4c305[_0xdc40('0x98')]===-0x1){return _0x4c305;}var _0x5ec163=this['getAndSetVariable']('RECOG_INSTANCE()',_0xdc40('0xb5'));if(_0x5ec163[_0xdc40('0x98')]===-0x1){return _0x5ec163;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xb6'),_0x3e8c62));};AGIVertices[_0xdc40('0x16')]['sestekasr']=function(_0x47fbbe){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0xb7'),_0x47fbbe[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x47fbbe[_0xdc40('0xb0')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xb1'));}var _0x64e1fc=_0x47fbbe[_0xdc40('0xb0')];if(this[_0xdc40('0x7c')](_0x47fbbe[_0xdc40('0x74')])){_0x64e1fc+=','+_0x47fbbe[_0xdc40('0x74')];}var _0x15513e=this[_0xdc40('0x10')][_0xdc40('0x55')](_0xdc40('0xb8'),_0x64e1fc);if(_0x15513e['result']===-0x1){return _0x15513e;}var _0xdf2cd4=this['getAndSetVariable'](_0xdc40('0xb9'),_0xdc40('0xba'));if(_0xdf2cd4[_0xdc40('0x98')]===-0x1){return _0xdf2cd4;}var _0xa6365c=this[_0xdc40('0xb2')](_0xdc40('0xb4'),_0xdc40('0xbb'));if(_0xa6365c['result']===-0x1){return _0xa6365c;}var _0x5e8daa=this['getAndSetVariable'](_0xdc40('0xbc'),'SESTEK_ASR_INSTANCE');if(_0x5e8daa[_0xdc40('0x98')]===-0x1){return _0x5e8daa;}return this['channel']['noop'](util[_0xdc40('0x27')](_0xdc40('0xb6'),_0x64e1fc));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xbd')]=function(_0x2cdbf4){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x2cdbf4[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x2cdbf4[_0xdc40('0xbe')])){return this[_0xdc40('0x10')]['error'](_0x2cdbf4,'no\x20database\x20selected');}var _0x3c54e3=this['getSquareOdbc']['sync'](this,_0x2cdbf4[_0xdc40('0xbe')]);if(!_0x3c54e3){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2cdbf4,_0xdc40('0xbf'));}if(!this[_0xdc40('0x7c')](_0x2cdbf4['query'])){return this[_0xdc40('0x10')]['error'](_0x2cdbf4,_0xdc40('0xc0'));}var _0x138b72=_0x2cdbf4[_0xdc40('0x2c')][_0xdc40('0x57')](/(\r\n|\n|\r)/gm,'\x20');this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('query:\x20%s',_0x138b72));var _0xb77f0=this[_0xdc40('0xc1')][_0xdc40('0xc2')](this,_0x3c54e3,_0x138b72);this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x2cdbf4,_0x138b72);if(!this[_0xdc40('0x7c')](_0x2cdbf4[_0xdc40('0xc3')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x3edc12=this['getVariable'][_0xdc40('0xc2')](this,_0x2cdbf4[_0xdc40('0xc3')]);if(!_0x3edc12){return this['channel']['error'](_0x2cdbf4,'no\x20variable\x20found');}var _0x18b113=this;_0xb77f0['forEach'](function(_0x171b36,_0x2ce1bf){Object[_0xdc40('0xc4')](_0x171b36)[_0xdc40('0xc5')](function(_0x6ce4be){_0x18b113['channel'][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0xc6'),_0x3edc12,_0x2ce1bf,_0x6ce4be),_0x171b36[_0x6ce4be]);});});this[_0xdc40('0x10')][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0xc7'),_0x3edc12),_0xb77f0['length']);return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xc8'),_0x3edc12));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xc9')]=function(_0x2c298a){logger[_0xdc40('0xca')](util[_0xdc40('0x27')](_0xdc40('0xcb'),_0x2c298a[_0xdc40('0x36')]));if(!this['isConfigured'](_0x2c298a[_0xdc40('0xcc')])){return this['channel'][_0xdc40('0x29')](_0x2c298a,_0xdc40('0xcd'));}var _0x13c0fb=this[_0xdc40('0x1b')]['sync'](this,_0x2c298a['sip_id']);if(!_0x13c0fb){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2c298a,_0xdc40('0xce'));}var _0x3494a3=this[_0xdc40('0x10')][_0xdc40('0x55')](_0xdc40('0xcf'),[util[_0xdc40('0x27')](_0xdc40('0xd0'),_0x13c0fb),_0x2c298a[_0xdc40('0x64')],_0x2c298a[_0xdc40('0xd1')],_0x2c298a[_0xdc40('0xd2')]]);if(_0x3494a3[_0xdc40('0x98')]===-0x1){return _0x3494a3;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('Executed\x20command\x20%s',_0xdc40('0xcf')));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xd3')]=function(_0xacf111){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0xd4'),_0xacf111[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0xacf111[_0xdc40('0x76')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xd5'));}if(!this['isConfigured'](_0xacf111[_0xdc40('0x5a')])){return this[_0xdc40('0x10')]['noop']('no\x20text\x20configured');}this['channel'][_0xdc40('0xd6')]=!![];this['createSquareDetailsReport'](_0xacf111);this[_0xdc40('0x40')](_0xacf111['text'],'in');this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xd7'),_0xacf111[_0xdc40('0x5a')]));var _0x4f56a8=this['googleDialogflow'][_0xdc40('0xc2')](this,_0xacf111);if(_0x4f56a8){for(var _0x3705ca in _0x4f56a8){if(_0x4f56a8[_0xdc40('0x8a')](_0x3705ca)){this[_0xdc40('0x10')][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0xd8'),_0x3705ca[_0xdc40('0x68')]()),_0x4f56a8[_0x3705ca]);}}this[_0xdc40('0x40')](_0x4f56a8[_0xdc40('0xd9')],'out');return this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format']('Dialogflow\x20Result\x20%s',_0x4f56a8[_0xdc40('0xd9')]));}return this['channel'][_0xdc40('0x29')](_0xacf111,_0xdc40('0xda'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xdb')]=function(_0x15139c){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0xdc'),_0x15139c[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x15139c[_0xdc40('0xdd')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xde'));}if(!this[_0xdc40('0x7c')](_0x15139c['username'])){return this[_0xdc40('0x10')]['noop'](_0xdc40('0xdf'));}if(!this[_0xdc40('0x7c')](_0x15139c[_0xdc40('0xe0')])){return this['channel'][_0xdc40('0xa8')](_0xdc40('0xe1'));}if(!this[_0xdc40('0x7c')](_0x15139c[_0xdc40('0xe2')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xaa'));}this['channel'][_0xdc40('0xd6')]=!![];this[_0xdc40('0x34')](_0x15139c);this[_0xdc40('0x40')](_0x15139c[_0xdc40('0x5a')],'in');this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0xe3'),_0x15139c[_0xdc40('0x5a')]));var _0x2db666=this[_0xdc40('0xe4')]['sync'](this,_0x15139c);if(_0x2db666){for(var _0xef6b6e in _0x2db666){if(_0x2db666[_0xdc40('0x8a')](_0xef6b6e)){this['channel'][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0xe5'),_0xef6b6e[_0xdc40('0x68')]()),_0x2db666[_0xef6b6e]);}}this[_0xdc40('0x40')](_0x2db666[_0xdc40('0xd9')],_0xdc40('0xe6'));if(_0x2db666[_0xdc40('0xe7')]){this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format']('Sestek\x20NDA\x20%s\x20file\x20created',_0x2db666[_0xdc40('0xe7')]));var _0xc13e5c=this[_0xdc40('0x10')]['streamFile'](_0x2db666[_0xdc40('0xe7')]);try{fs[_0xdc40('0xe8')](_0x2db666[_0xdc40('0xe7')]+_0xdc40('0xe9'));}catch(_0x24c685){logger[_0xdc40('0x29')](_0x24c685);}return _0xc13e5c;}else{return this['channel']['noop'](util['format'](_0xdc40('0xea'),_0x2db666['speech']));}}return this['channel'][_0xdc40('0x29')](_0x15139c,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xdc40('0x16')]['end']=function(_0x1a8180){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0xeb'),_0x1a8180[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xec'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0xed')]=function(_0x4563f0){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0xee'),_0x4563f0[_0xdc40('0x36')]));var _0x4503af='';if(_0x4563f0[_0xdc40('0xef')]){if(!this['isConfigured'](_0x4563f0[_0xdc40('0xef')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x4563f0,'no\x20trunk\x20selected');}else{var _0x271625=parseInt(_0x4563f0['trunk_id'],0xa);if(isNaN(_0x271625)){_0x4503af=_0x4563f0[_0xdc40('0xef')];}else{_0x4503af=this['getTrunk'][_0xdc40('0xc2')](this,_0x4563f0[_0xdc40('0xef')]);if(!_0x4503af){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x4563f0,'no\x20trunk\x20found');}}}}else if(_0x4563f0['trunk_name']){_0x4503af=_0x4563f0[_0xdc40('0xf0')];}else{return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x4563f0,_0xdc40('0xf1'));}var _0x134254=this[_0xdc40('0x10')][_0xdc40('0x55')](_0xdc40('0xcf'),[util['format']('SIP/%s/%s',_0x4503af,_0x4563f0['phone']),_0x4563f0[_0xdc40('0x64')],_0x4563f0['opts'],_0x4563f0[_0xdc40('0xd2')]]);if(_0x134254[_0xdc40('0x98')]===-0x1){return _0x134254;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xf2'),_0xdc40('0xcf')));};AGIVertices['prototype'][_0xdc40('0xf3')]=function(_0x591069){logger['info'](util['format'](_0xdc40('0xf4'),_0x591069[_0xdc40('0x36')]));return this[_0xdc40('0x10')]['noop']('finally');};AGIVertices[_0xdc40('0x16')][_0xdc40('0xf')]=function(_0x591865){logger[_0xdc40('0x2b')](util['format']('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x591865[_0xdc40('0x36')]));if(_0x591865[_0xdc40('0x9b')]===0x0){return this[_0xdc40('0x9a')](_0x591865);}_0x591865[_0xdc40('0x9b')]-=0x1;if(!this['isConfigured'](_0x591865['file_id'])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x591865,'no\x20file\x20audio\x20selected');}var _0x25b3d0=this['getSound'][_0xdc40('0xc2')](this,_0x591865[_0xdc40('0xf5')]);if(!_0x25b3d0){return this[_0xdc40('0x10')]['error'](_0x591865,_0xdc40('0xf6'));}if(!this[_0xdc40('0x7c')](_0x591865[_0xdc40('0xc3')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0xdc40('0xf7'));}var _0x13f45d=this['channel'][_0xdc40('0xf8')](_0x25b3d0,_0x591865[_0xdc40('0xf9')],_0x591865['maxdigit']);var _0x4b3823=_0x13f45d[_0xdc40('0x98')]?_0x13f45d['result'][_0xdc40('0x4b')]():'';logger[_0xdc40('0x2b')](_0xdc40('0xfa'),JSON[_0xdc40('0x70')](_0x13f45d));if(_0x13f45d[_0xdc40('0x98')]===-0x1){this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x591865,_0x4b3823);return _0x13f45d;}else if(_0x13f45d[_0xdc40('0x97')]===_0xdc40('0x64')){_0x13f45d[_0xdc40('0x98')]=_0x4b3823['length']>=parseInt(_0x591865['mindigit'])?'x':'i';}else{_0x13f45d[_0xdc40('0x98')]=_0x4b3823['length']>=parseInt(_0x591865[_0xdc40('0xfb')])&&_0x4b3823[_0xdc40('0x8f')]<=parseInt(_0x591865['maxdigit'])?'x':'i';}var _0x531604=this[_0xdc40('0x12')][_0xdc40('0xc2')](this,_0x591865['variable_id']);if(!_0x531604){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x591865,_0xdc40('0xfc'));}this[_0xdc40('0x10')][_0xdc40('0x94')](_0x531604,_0x4b3823);if(this[_0xdc40('0x7c')](_0x591865[_0xdc40('0xfd')])){var _0x53534a=parseInt(_0x591865[_0xdc40('0xfd')],0xa);var _0xf98918=rs['generate']({'charset':'*','length':_0x53534a});var _0x4105c3=_0x4b3823[_0xdc40('0x8f')];if(_0x4105c3>0x0){if(_0x4105c3>_0x53534a){this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x591865,_0x591865[_0xdc40('0xfe')]===_0xdc40('0xff')?_0xf98918+_0x4b3823[_0xdc40('0x100')](_0x53534a):_0x4b3823[_0xdc40('0x100')](0x0,_0x4105c3-_0x53534a)+_0xf98918);}else{this['createSquareDetailsReport'][_0xdc40('0xc2')](this,_0x591865,rs[_0xdc40('0x101')]({'charset':'*','length':_0x4105c3}));}}else{this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x591865,'');}}else{this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x591865,_0x4b3823);}return _0x13f45d;};AGIVertices['prototype'][_0xdc40('0x102')]=function(_0x497ffe){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x103'),_0x497ffe['label']));return this[_0xdc40('0xf')](_0x497ffe);};AGIVertices[_0xdc40('0x16')]['goal']=function(_0x5d8e05){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x104'),_0x5d8e05[_0xdc40('0x36')]));this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x5d8e05,_0x5d8e05[_0xdc40('0x105')]);return this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x106'),_0x5d8e05['goalname']));};AGIVertices['prototype'][_0xdc40('0x107')]=function(_0x501b89){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x501b89[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x501b89[_0xdc40('0x7e')])||!this['isConfigured'](_0x501b89[_0xdc40('0x7f')])){return this['channel'][_0xdc40('0xa8')](_0xdc40('0x108'));}if(!this[_0xdc40('0x7c')](_0x501b89['text'])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xaa'));}this[_0xdc40('0x10')]['noop'](util[_0xdc40('0x27')]('Trying\x20aws\x20Polly\x20%s',_0x501b89['text']));var _0x57ee37=this[_0xdc40('0x7d')][_0xdc40('0xc2')](this,_0x501b89);if(_0x57ee37){this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x109'),_0x57ee37));var _0x64079b=this[_0xdc40('0x10')]['streamFile'](_0x57ee37);try{fs['unlink'](_0x57ee37+_0xdc40('0xe9'));}catch(_0x3e513f){logger['error'](_0x3e513f);}return _0x64079b;}return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x501b89,_0xdc40('0x10a'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x10b')]=function(_0x5ad4cf){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x10c'),_0x5ad4cf['label']));if(!this[_0xdc40('0x7c')](_0x5ad4cf[_0xdc40('0x7e')])||!this[_0xdc40('0x7c')](_0x5ad4cf['aws_secret_access_key'])){return this['channel'][_0xdc40('0xa8')](_0xdc40('0x108'));}if(!this[_0xdc40('0x7c')](_0x5ad4cf[_0xdc40('0x10d')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x10e'));}if(!this['isConfigured'](_0x5ad4cf[_0xdc40('0x5a')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')]('no\x20text\x20configured');}this[_0xdc40('0x10')][_0xdc40('0xd6')]=!![];this[_0xdc40('0x34')](_0x5ad4cf);this[_0xdc40('0x40')](_0x5ad4cf[_0xdc40('0x5a')],'in');this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x10f'),_0x5ad4cf[_0xdc40('0x5a')]));var _0x42a3de=this[_0xdc40('0x83')][_0xdc40('0xc2')](this,_0x5ad4cf);if(_0x42a3de){for(var _0x3dd359 in _0x42a3de){if(_0x42a3de['hasOwnProperty'](_0x3dd359)&&_['isString'](_0x42a3de[_0x3dd359])){this['channel'][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0x110'),_0x3dd359[_0xdc40('0x68')]()),_0x42a3de[_0x3dd359]);}}if(_['isNil'](_0x42a3de['message'])){return this[_0xdc40('0x10')]['noop'](_0xdc40('0x111'));}else{this['createSquareMessage'](_0x42a3de[_0xdc40('0x72')],_0xdc40('0xe6'));return this[_0xdc40('0x10')]['noop'](util[_0xdc40('0x27')](_0xdc40('0x112'),_0x42a3de[_0xdc40('0x72')]));}}return this['channel']['error'](_0x5ad4cf,_0xdc40('0x113'));};AGIVertices[_0xdc40('0x16')]['googleasr']=function(_0x3adc4e){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x114'),_0x3adc4e['label'],_0x3adc4e[_0xdc40('0x64')]));if(!this['isConfigured'](_0x3adc4e[_0xdc40('0x76')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xd5'));}var _0x4ce9b9=_0xdc40('0x115');var _0x2e5ec1=util['format'](_0xdc40('0x116'),FILES_PATH,rs[_0xdc40('0x101')](0x4));var _0x572200=util['format'](_0xdc40('0x93'),_0x2e5ec1,_0x4ce9b9);var _0x3335ad=!![];if(_0x3adc4e[_0xdc40('0x117')]===_0xdc40('0x118')){_0x3335ad=![];}var _0x47bb67=this[_0xdc40('0x10')][_0xdc40('0x119')](_0x2e5ec1,_0x4ce9b9,_0x3adc4e[_0xdc40('0x11a')],_0x3adc4e[_0xdc40('0x64')],undefined,_0x3335ad);if(_0x47bb67[_0xdc40('0x98')]!==-0x1){this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format']('google\x20%s\x20file\x20created',_0x572200));var _0x93bc3a=this[_0xdc40('0x11b')][_0xdc40('0xc2')](this,_0x3adc4e,_0x572200);if(_0x93bc3a){for(var _0x331ca2 in _0x93bc3a){if(_0x93bc3a[_0xdc40('0x8a')](_0x331ca2)){this[_0xdc40('0x10')]['setVariable'](util[_0xdc40('0x27')](_0xdc40('0x11c'),_0x331ca2[_0xdc40('0x68')]()),_0x93bc3a[_0x331ca2]);}}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('GoogleASR\x20Result\x20%s',JSON[_0xdc40('0x70')](_0x93bc3a)));}}return _0x47bb67;};AGIVertices['prototype'][_0xdc40('0x11d')]=function(_0x364171){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20TILDEASR\x20(%s)\x20block',_0x364171[_0xdc40('0x36')]));if(!this['isConfigured'](_0x364171[_0xdc40('0x87')])){return this[_0xdc40('0x10')]['noop']('no\x20appid\x20configured');}if(!this[_0xdc40('0x7c')](_0x364171[_0xdc40('0x88')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x11e'));}var _0x3f633d='wav';var _0x3adf2e=util[_0xdc40('0x27')](_0xdc40('0x116'),FILES_PATH,rs[_0xdc40('0x101')](0x4));var _0xa9c591=util['format'](_0xdc40('0x93'),_0x3adf2e,_0x3f633d);var _0x595416=!![];if(_0x364171['beep']===_0xdc40('0x118')){_0x595416=![];}var _0x1d7faf=this[_0xdc40('0x10')]['recordFile'](_0x3adf2e,_0x3f633d,_0x364171[_0xdc40('0x11a')],_0x364171[_0xdc40('0x64')],undefined,_0x595416);if(_0x1d7faf[_0xdc40('0x98')]!==-0x1){this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x11f'),_0xa9c591));var _0x43c77c=this['tildeASR'][_0xdc40('0xc2')](this,_0x364171,_0xa9c591);if(_0x43c77c){for(var _0x360e11 in _0x43c77c){if(_0x43c77c[_0xdc40('0x8a')](_0x360e11)){this[_0xdc40('0x10')][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0x120'),_0x360e11['toUpperCase']()),_0x43c77c[_0x360e11]);}}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x121'),JSON[_0xdc40('0x70')](_0x43c77c)));}}return _0x1d7faf;};AGIVertices[_0xdc40('0x16')][_0xdc40('0x122')]=function(_0x394626){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20GOTO\x20(%s)\x20block',_0x394626[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0x123')](_0x394626[_0xdc40('0x3b')],_0x394626['extension'],_0x394626[_0xdc40('0x3d')]);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x124')]=function(_0x2e2424){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x125'),_0x2e2424['label']));if(!this[_0xdc40('0x7c')](_0x2e2424[_0xdc40('0x126')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2e2424,'no\x20condition\x20configured');}try{var _0x33dbe5=eval(_0x2e2424[_0xdc40('0x126')])?'true':'false';this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x127'),_0x2e2424[_0xdc40('0x126')],_0x33dbe5));return{'code':0xc8,'result':_0x33dbe5};}catch(_0x4df879){return{'code':0xc8,'result':_0xdc40('0x128')};}};AGIVertices[_0xdc40('0x16')]['gotoiftime']=function(_0x4ac5f4){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x129'),_0x4ac5f4['label']));if(!this['isConfigured'](_0x4ac5f4[_0xdc40('0x12a')])){return this['channel'][_0xdc40('0x29')](_0x4ac5f4,_0xdc40('0x12b'));}var _0x5b199e=this[_0xdc40('0x24')][_0xdc40('0xc2')](this,_0x4ac5f4[_0xdc40('0x12a')]);if(!_0x5b199e){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x4ac5f4,_0xdc40('0x12c'));}for(var _0x3a4310=0x0;_0x3a4310<_0x5b199e[_0xdc40('0x8f')];_0x3a4310+=0x1){var _0x412fff=this[_0xdc40('0x10')][_0xdc40('0x12')](util[_0xdc40('0x27')]('IFTIME(%s?true:false)',_0x5b199e[_0x3a4310]));if(_0x412fff[_0xdc40('0x98')]===-0x1){return _0x412fff;}logger[_0xdc40('0x2b')](util['format']('IFTIME\x20%s\x20%s',_0x5b199e[_0x3a4310],_0x412fff[_0xdc40('0x97')]));if(_0x412fff[_0xdc40('0x97')]==='true'){logger['info'](util[_0xdc40('0x27')](_0xdc40('0x12d'),_0x5b199e[_0x3a4310],'true'));this[_0xdc40('0x10')]['noop'](util['format'](_0xdc40('0x12d'),_0x5b199e[_0x3a4310],_0xdc40('0x12e')));return{'code':0xc8,'result':'true'};}else{logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x12d'),_0x5b199e[_0x3a4310],_0xdc40('0x128')));this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x12d'),_0x5b199e[_0x3a4310],_0xdc40('0x128')));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xdc40('0x16')]['hangup']=function(_0xa9a4a8){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x12f'),_0xa9a4a8[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0x130')]();};AGIVertices['prototype']['ispeechasr']=function(_0x1d8cfd){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x131'),_0x1d8cfd['label']));if(!this['isConfigured'](_0x1d8cfd[_0xdc40('0x76')])){return this[_0xdc40('0x10')]['noop'](_0xdc40('0xd5'));}var _0x46a04f=_0xdc40('0x115');var _0x8431e5=util[_0xdc40('0x27')](_0xdc40('0x116'),FILES_PATH,rs[_0xdc40('0x101')](0x4));var _0x3598a9=util[_0xdc40('0x27')](_0xdc40('0x93'),_0x8431e5,_0x46a04f);var _0x327efd=!![];if(_0x1d8cfd[_0xdc40('0x117')]==='NOBEEP'){_0x327efd=![];}var _0x53b48a=this[_0xdc40('0x10')][_0xdc40('0x119')](_0x8431e5,_0x46a04f,_0x1d8cfd[_0xdc40('0x11a')],_0x1d8cfd[_0xdc40('0x64')],undefined,_0x327efd);if(_0x53b48a[_0xdc40('0x98')]!==-0x1){this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x132'),_0x3598a9));var _0x1cd634=this[_0xdc40('0x7a')][_0xdc40('0xc2')](this,_0x1d8cfd,_0x3598a9);if(_0x1cd634){for(var _0x5112a1 in _0x1cd634){if(_0x1cd634[_0xdc40('0x8a')](_0x5112a1)){this[_0xdc40('0x10')][_0xdc40('0x94')](util[_0xdc40('0x27')](_0xdc40('0x133'),_0x5112a1[_0xdc40('0x68')]()),_0x1cd634[_0x5112a1]);}}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('IspeechASR\x20Result\x20%s',JSON[_0xdc40('0x70')](_0x1cd634)));}}return _0x53b48a;};AGIVertices['prototype'][_0xdc40('0x134')]=function(_0x7ec9d2){logger[_0xdc40('0x2b')](util['format']('Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block',_0x7ec9d2[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x7ec9d2[_0xdc40('0x76')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xd5'));}if(!this[_0xdc40('0x7c')](_0x7ec9d2[_0xdc40('0x5a')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')]('no\x20text\x20configured');}this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x135'),_0x7ec9d2[_0xdc40('0x5a')]));var _0x19429a=this[_0xdc40('0x78')][_0xdc40('0xc2')](this,_0x7ec9d2);if(_0x19429a){this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('ispeech\x20%s\x20file\x20created',_0x19429a));var _0x56bcd2=this[_0xdc40('0x10')][_0xdc40('0x136')](_0x19429a,_0x7ec9d2[_0xdc40('0x11a')]);try{fs[_0xdc40('0xe8')](_0x19429a+'.wav');}catch(_0x37918f){logger['error'](_0x37918f);}return _0x56bcd2;}return this[_0xdc40('0x10')]['error'](_0x7ec9d2,_0xdc40('0x137'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x138')]=function(_0x40baed){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x139'),_0x40baed['label']));if(!this[_0xdc40('0x7c')](_0x40baed[_0xdc40('0x13a')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x40baed,_0xdc40('0x13b'));}logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x13c'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x40baed[_0xdc40('0x13a')]));var _0x466fe8=this[_0xdc40('0x51')]['sync'](this,_0x40baed['findBy']);if(_0x466fe8){logger['info'](util['format'](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x40baed[_0xdc40('0x13a')]));this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x40baed[_0xdc40('0x13a')]));return{'code':0xc8,'result':_0xdc40('0x13e')};}else{logger['info'](util['format'](_0xdc40('0x13f'),this[_0xdc40('0x10')]['callerid'],_0x40baed[_0xdc40('0x13a')]));this[_0xdc40('0x10')]['noop'](util[_0xdc40('0x27')](_0xdc40('0x13f'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x40baed[_0xdc40('0x13a')]));return{'code':0xc8,'result':_0xdc40('0x140')};}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x141')]=function(_0x9f52fc){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x142'),_0x9f52fc['label']));if(!this[_0xdc40('0x7c')](_0x9f52fc['findBy'])){return this[_0xdc40('0x10')]['error'](_0x9f52fc,'no\x20find\x20by\x20configured');}logger['info'](util[_0xdc40('0x27')](_0xdc40('0x13c'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x9f52fc[_0xdc40('0x13a')]));var _0x229d6a=this[_0xdc40('0x50')][_0xdc40('0xc2')](this,_0x9f52fc[_0xdc40('0x13a')]);if(_0x229d6a){logger['info'](util[_0xdc40('0x27')](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x9f52fc[_0xdc40('0x13a')]));this[_0xdc40('0x10')]['noop'](util[_0xdc40('0x27')](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x9f52fc[_0xdc40('0x13a')]));return{'code':0xc8,'result':_0xdc40('0x13e')};}else{logger[_0xdc40('0x2b')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdc40('0x10')][_0xdc40('0x39')],_0x9f52fc['findBy']));this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x13f'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x9f52fc['findBy']));return{'code':0xc8,'result':_0xdc40('0x140')};}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x143')]=function(_0x259321){logger[_0xdc40('0x2b')](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x259321[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x259321[_0xdc40('0x144')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x259321,'no\x20operation\x20configured');}this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x145'),_0x259321[_0xdc40('0x144')]));var _0x15c184=eval(_0x259321[_0xdc40('0x144')]);if(!this[_0xdc40('0x7c')](_0x259321['variable_id'])){return this[_0xdc40('0x10')][_0xdc40('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x2c94d1=this[_0xdc40('0x12')][_0xdc40('0xc2')](this,_0x259321['variable_id']);if(!_0x2c94d1){return this['channel'][_0xdc40('0x29')](_0x259321,'no\x20variable\x20found');}if(_['isArray'](_0x15c184)){var _0x2da409=this;_0x15c184[_0xdc40('0xc5')](function(_0x590d5c,_0x40addf){_0x2da409[_0xdc40('0x10')][_0xdc40('0x94')](util['format'](_0xdc40('0x146'),_0x2c94d1,_0x40addf),_0x590d5c);});return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x147'),_0x2c94d1));}else{return this['channel'][_0xdc40('0x94')](_0x2c94d1,_0x15c184);}};AGIVertices[_0xdc40('0x16')][_0xdc40('0xe')]=function(_0x44b48b){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x148'),_0x44b48b[_0xdc40('0x36')]));if(_0x44b48b[_0xdc40('0x9b')]===0x0){return this[_0xdc40('0x9a')](_0x44b48b);}_0x44b48b[_0xdc40('0x9b')]-=0x1;if(!this[_0xdc40('0x7c')](_0x44b48b['file_id'])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x44b48b,_0xdc40('0x149'));}var _0x20e96c=this[_0xdc40('0x1d')][_0xdc40('0xc2')](this,_0x44b48b[_0xdc40('0xf5')]);if(!_0x20e96c){return this[_0xdc40('0x10')]['error'](_0x44b48b,_0xdc40('0xf6'));}var _0x8ebe8f=this[_0xdc40('0x10')][_0xdc40('0xf8')](_0x20e96c,_0x44b48b[_0xdc40('0xf9')],_0x44b48b[_0xdc40('0x14a')]);var _0x177f22=_0x8ebe8f[_0xdc40('0x98')];if(_0x8ebe8f['result']===-0x1){this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x44b48b,'-1');return _0x8ebe8f;}else if(_0x8ebe8f[_0xdc40('0x97')]===_0xdc40('0x64')){_0x8ebe8f[_0xdc40('0x98')]=_0x8ebe8f[_0xdc40('0x98')]['length']>0x0?_0x8ebe8f[_0xdc40('0x98')]:'t';}else if(_[_0xdc40('0x42')](_0x8ebe8f['result'])){_0x8ebe8f[_0xdc40('0x98')]='#';_0x177f22='#';}if(!this['isConfigured'](_0x44b48b[_0xdc40('0xc3')])){this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xf7'));}else{var _0x280785=this[_0xdc40('0x12')]['sync'](this,_0x44b48b[_0xdc40('0xc3')]);if(!_0x280785){return this['channel']['error'](_0x44b48b,_0xdc40('0xfc'));}this[_0xdc40('0x10')][_0xdc40('0x94')](_0x280785,_0x177f22);}this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x44b48b,_0x177f22);return _0x8ebe8f;};AGIVertices[_0xdc40('0x16')][_0xdc40('0xa8')]=function(_0x5a23e5){logger['info'](util['format'](_0xdc40('0x14b'),_0x5a23e5[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0x5a23e5[_0xdc40('0x14c')]||_0x5a23e5['label']);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x14d')]=function(_0x19be7e){logger['info'](util['format']('Enter\x20in\x20PAUSE\x20(%s)\x20block',_0x19be7e['label']));if(!this['isConfigured'](_0x19be7e[_0xdc40('0x13a')])){return this['channel'][_0xdc40('0x29')](_0x19be7e,'no\x20find\x20by\x20configured');}logger['info'](util[_0xdc40('0x27')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0xdc40('0x10')]['callerid'],_0x19be7e[_0xdc40('0x13a')]));var _0x37fa51=this['getPause'][_0xdc40('0xc2')](this,_0x19be7e[_0xdc40('0x14e')]);var _0x22e566=this[_0xdc40('0x14f')][_0xdc40('0xc2')](this,_0x19be7e[_0xdc40('0x13a')],_0x37fa51);if(_0x22e566){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x13d'),this[_0xdc40('0x10')]['callerid'],_0x19be7e[_0xdc40('0x13a')]));this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x19be7e[_0xdc40('0x13a')]));return{'code':0xc8,'result':'success'};}else{logger['info'](util[_0xdc40('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdc40('0x10')]['callerid'],_0x19be7e[_0xdc40('0x13a')]));this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x13d'),this[_0xdc40('0x10')][_0xdc40('0x39')],_0x19be7e[_0xdc40('0x13a')]));return{'code':0xc8,'result':_0xdc40('0x140')};}};AGIVertices[_0xdc40('0x16')][_0xdc40('0x150')]=function(_0x4bd517){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x151'),_0x4bd517['label']));if(!this[_0xdc40('0x7c')](_0x4bd517[_0xdc40('0xf5')])){return this['channel']['error'](_0x4bd517,'no\x20file\x20audio\x20selected');}var _0x56e7ef=this['getSound']['sync'](this,_0x4bd517[_0xdc40('0xf5')]);if(!_0x56e7ef){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x4bd517,_0xdc40('0xf6'));}var _0x3b715e=this[_0xdc40('0x10')][_0xdc40('0x55')]('PLAYBACK',[_0x56e7ef,_0x4bd517[_0xdc40('0xd1')]]);if(_0x3b715e[_0xdc40('0x98')]===-0x1){return _0x3b715e;}return this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xa9'),_0xdc40('0x152'),_0x56e7ef));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x153')]=function(_0x2c151c){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x154'),_0x2c151c['label']));if(!this[_0xdc40('0x7c')](_0x2c151c[_0xdc40('0x155')])){return this[_0xdc40('0x10')]['error'](_0x2c151c,_0xdc40('0x156'));}var _0x53eafd='';var _0x2f4aa4=parseInt(_0x2c151c[_0xdc40('0x155')],0xa);if(isNaN(_0x2f4aa4)){_0x53eafd=_0x2c151c['queue_id'];}else{_0x53eafd=this[_0xdc40('0x157')][_0xdc40('0xc2')](this,_0x2c151c['queue_id']);if(!_0x53eafd){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2c151c,_0xdc40('0x158'));}}var _0xde94df='';if(this[_0xdc40('0x7c')](_0x2c151c[_0xdc40('0xf5')])){var _0x43586e=this[_0xdc40('0x1d')][_0xdc40('0xc2')](this,_0x2c151c[_0xdc40('0xf5')]);if(_0x43586e){_0xde94df=_0x43586e;}}this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x2c151c,_0x53eafd);if(_0x2c151c['opts'][_0xdc40('0x159')]('x')<0x0){_0x2c151c[_0xdc40('0xd1')]+='x';}if(_0x2c151c['opts'][_0xdc40('0x159')]('X')<0x0){_0x2c151c[_0xdc40('0xd1')]+='X';}this['channel'][_0xdc40('0x94')](_0xdc40('0x15a'),_0x53eafd?_0x53eafd[_0xdc40('0x15b')]():'');var _0x10c898=this[_0xdc40('0x10')]['exec']('QUEUE',[_0x53eafd,_0x2c151c[_0xdc40('0xd1')],_0x2c151c['url'],_0xde94df,_0x2c151c['timeout'],_0x2c151c[_0xdc40('0x8')],_0x2c151c['macro'],_0x2c151c[_0xdc40('0x15c')],'',_0x2c151c[_0xdc40('0x15d')]]);if(_0x10c898['result']===-0x1){return _0x10c898;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0xa9'),_0xdc40('0x15e'),_0x53eafd));};AGIVertices[_0xdc40('0x16')]['record']=function(_0x405191){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x15f'),_0x405191[_0xdc40('0x36')]));var _0xe23b9=_0x405191['recordingFormat']||_0xdc40('0x115');var _0x48b193=util['format'](_0xdc40('0x160'),this[_0xdc40('0x10')]['uniqueid'],rs[_0xdc40('0x101')](0x5));var _0x2dbcd8=util[_0xdc40('0x27')]('%s/recordings/%s.%s',FILES_PATH,_0x48b193,_0xe23b9);var _0x64829b=util[_0xdc40('0x27')](_0xdc40('0x116'),FILES_PATH,_0x48b193);this[_0xdc40('0x3a')]['sync'](this,_0x405191,_0x48b193,_0x2dbcd8);this['channel'][_0xdc40('0x94')](_0xdc40('0x161'),_0x48b193);logger[_0xdc40('0x2b')](_0xdc40('0x162'),_0x64829b,_0xe23b9,_0x405191[_0xdc40('0x163')],_0x405191[_0xdc40('0x64')]);return this[_0xdc40('0x10')][_0xdc40('0x119')](_0x64829b,_0xe23b9,_0x405191['escape_digits'],_0x405191['timeout'],undefined,!![]);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x164')]=function(_0x32b166){logger['info'](util['format']('Enter\x20in\x20RESTAPI\x20(%s)\x20block',_0x32b166[_0xdc40('0x36')]));if(!this['isConfigured'](_0x32b166[_0xdc40('0xd2')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x165'));}var _0x9097ad=this[_0xdc40('0x61')][_0xdc40('0xc2')](this,_0x32b166);logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x166'),util['inspect'](_0x9097ad,{'showHidden':![],'depth':null})));if(!this[_0xdc40('0x7c')](_0x32b166['variable_id'])){return this['channel'][_0xdc40('0xa8')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0xb09b3=this['getVariable']['sync'](this,_0x32b166[_0xdc40('0xc3')]);if(!_0xb09b3){return this['channel'][_0xdc40('0x29')](_0x32b166,'no\x20variable\x20found');}this[_0xdc40('0x10')][_0xdc40('0x94')](util['format']('%s_STATUS_CODE',_0xb09b3),_0x9097ad[_0xdc40('0x71')]?_0x9097ad[_0xdc40('0x71')]:_0xdc40('0x167'));this['channel'][_0xdc40('0x94')](util[_0xdc40('0x27')]('%s_STATUS_MESSAGE',_0xb09b3),_0x9097ad['statusMessage']?_0x9097ad['statusMessage']:'OK');if(_0x9097ad[_0xdc40('0x69')]){try{this[_0xdc40('0x92')](_0x9097ad[_0xdc40('0x69')],_0xb09b3);}catch(_0x28b72e){logger[_0xdc40('0x29')](util[_0xdc40('0x27')](_0xdc40('0x168'),_0xb09b3));}}return this[_0xdc40('0x10')]['noop'](util[_0xdc40('0x27')](_0xdc40('0xc8'),_0xb09b3));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x169')]=function(_0x44ac36){logger['info'](util['format']('Enter\x20in\x20SAYDIGITS\x20(%s)\x20block',_0x44ac36[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0x16a')](_0x44ac36['digits']['replace'](/\s+/g,''),_0x44ac36['escape_digits']);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x16b')]=function(_0x14fd34){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x16c'),_0x14fd34[_0xdc40('0x36')]));return this['channel']['sayNumber'](_0x14fd34[_0xdc40('0x63')][_0xdc40('0x57')](/\s+/g,''),_0x14fd34[_0xdc40('0x163')]);};AGIVertices[_0xdc40('0x16')][_0xdc40('0x16d')]=function(_0x15d859){logger['info'](util['format'](_0xdc40('0x16e'),_0x15d859[_0xdc40('0x36')]));return this['channel'][_0xdc40('0x16f')](_0x15d859[_0xdc40('0x5a')],_0x15d859[_0xdc40('0x163')]);};AGIVertices['prototype']['sendMail']=function(_0x2ada81){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x2ada81[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x2ada81[_0xdc40('0x170')])){return this['channel'][_0xdc40('0xa8')]('no\x20mail\x20account\x20configured');}var _0x2ce84c=this[_0xdc40('0x20')][_0xdc40('0xc2')](this,_0x2ada81[_0xdc40('0x170')]);if(!_0x2ce84c||!_0x2ce84c[_0xdc40('0x171')]){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2ada81,_0xdc40('0x172'));}var _0x3948b2={'from':util[_0xdc40('0x27')](_0xdc40('0x173'),_0x2ce84c['name'],_0x2ce84c[_0xdc40('0x174')]||_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x175')]),'to':_0x2ada81['to']||'','cc':_0x2ada81['cc']||'','bcc':_0x2ada81['bcc']||'','subject':_0x2ada81[_0xdc40('0x176')],'html':_0x2ada81[_0xdc40('0x5a')],'text':_0x2ada81['text']};var _0x4cf785={'tls':{'rejectUnauthorized':![]}};if(_0x2ce84c['Smtp'][_0xdc40('0x177')]){_0x4cf785[_0xdc40('0x177')]=_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x177')];}else{_0x4cf785[_0xdc40('0x178')]=_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x178')];_0x4cf785['port']=_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x179')];_0x4cf785[_0xdc40('0x17a')]=_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x17a')];}if(_0x2ce84c[_0xdc40('0x171')][_0xdc40('0x17b')]){_0x4cf785[_0xdc40('0x17c')]={'user':_0x2ce84c['Smtp']['user'],'pass':_0x2ce84c['Smtp']['pass']};}if(this[_0xdc40('0x7c')](_0x2ada81[_0xdc40('0x17d')])){}logger[_0xdc40('0xca')](_0xdc40('0x17e'),JSON['stringify'](_0x3948b2));this['createSquareDetailsReport']['sync'](this,_0x2ada81,_0x2ada81[_0xdc40('0x170')]);this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x17f'),_0x2ce84c['name']));this['sendMailMessage'][_0xdc40('0xc2')](this,_0x4cf785,_0x3948b2);return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x180'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x181')]=function(_0x44f1df){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x182'),_0x44f1df[_0xdc40('0x36')]));return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x183'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x184')]=function(_0x26cc14){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x185'),_0x26cc14['label']));if(!this[_0xdc40('0x7c')](_0x26cc14[_0xdc40('0x186')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x187'));}var _0x5865c5=this[_0xdc40('0x31')]['sync'](this,_0x26cc14[_0xdc40('0x186')]);if(!_0x5865c5){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x26cc14,_0xdc40('0x188'));}var _0x511801={'body':_0x26cc14['sms_text'],'phone':_0x26cc14['to']||'','SmsAccountId':_0x5865c5['id']};logger[_0xdc40('0xca')](_0xdc40('0x189'),JSON['stringify'](_0x511801));this[_0xdc40('0x34')][_0xdc40('0xc2')](this,_0x26cc14,_0x26cc14[_0xdc40('0x186')]);this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x18a'),_0x5865c5[_0xdc40('0x14')]));this[_0xdc40('0x33')][_0xdc40('0xc2')](this,_0x511801);return this[_0xdc40('0x10')]['noop'](_0xdc40('0x18b'));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x18c')]=function(_0xa16236){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x18d'),_0xa16236[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0xa16236['variable_id'])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0xa16236,_0xdc40('0x18e'));}var _0x8a8b49=this[_0xdc40('0x12')][_0xdc40('0xc2')](this,_0xa16236[_0xdc40('0xc3')]);if(!_0x8a8b49){return this['channel']['error'](_0xa16236,_0xdc40('0xfc'));}return this[_0xdc40('0x10')]['setVariable'](_0x8a8b49,_0xa16236[_0xdc40('0x18f')]);};AGIVertices[_0xdc40('0x16')]['start']=function(_0x4b658a){logger['info'](util[_0xdc40('0x27')](_0xdc40('0x190'),_0x4b658a[_0xdc40('0x36')]));this[_0xdc40('0x10')][_0xdc40('0xa8')]('START\x20CALLY\x20SQUARE');if(_0x4b658a[_0xdc40('0x9e')]===_0xdc40('0x191')){this['channel'][_0xdc40('0xa8')]('Answer');return this[_0xdc40('0x10')]['answer']();}return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x192'));};AGIVertices[_0xdc40('0x16')]['subproject']=function(_0x421c04){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('Enter\x20in\x20SUBPROJECT\x20(%s)\x20block',_0x421c04['label']));if(!this[_0xdc40('0x7c')](_0x421c04[_0xdc40('0x193')])){return this['channel'][_0xdc40('0x29')](_0x421c04,_0xdc40('0x194'));}var _0x414ccc=this[_0xdc40('0x195')][_0xdc40('0xc2')](this,_0x421c04[_0xdc40('0x193')]);if(!this['isConfigured'](_0x414ccc)){return this[_0xdc40('0x10')]['error'](_0x421c04,util[_0xdc40('0x27')](_0xdc40('0x196'),_0x421c04['project_id']));}if(_0x414ccc===this[_0xdc40('0x10')][_0xdc40('0x38')]){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x421c04,_0xdc40('0x197'));}this['createSquareDetailsReport'][_0xdc40('0xc2')](this,_0x421c04,_0x414ccc);var _0x8a413e=this[_0xdc40('0x10')][_0xdc40('0x55')](_0xdc40('0x198'),util[_0xdc40('0x27')](_0xdc40('0x199'),config['agi'][_0xdc40('0x178')]||'127.0.0.1',_0x414ccc,this[_0xdc40('0x10')][_0xdc40('0x38')]));if(_0x8a413e[_0xdc40('0x98')]===-0x1){return _0x8a413e;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xa9'),_0xdc40('0x198'),_0x414ccc));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x19a')]=function(_0x502396){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x19b'),_0x502396['label']));var _0x5081e1=this[_0xdc40('0x54')][_0xdc40('0xc2')](this,_0x502396['command']);this['createSquareDetailsReport'][_0xdc40('0xc2')](this,_0x502396,_0x502396[_0xdc40('0x9c')]);if(this[_0xdc40('0x7c')](_0x502396[_0xdc40('0xc3')])){var _0x42fe6c=this[_0xdc40('0x12')]['sync'](this,_0x502396[_0xdc40('0xc3')]);if(_0x42fe6c){this[_0xdc40('0x10')][_0xdc40('0x94')](_0x42fe6c,_0x5081e1);return this[_0xdc40('0x10')][_0xdc40('0xa8')](util['format'](_0xdc40('0x19c'),_0x502396[_0xdc40('0x9c')],_0x42fe6c));}}return this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x502396[_0xdc40('0x9c')]));};AGIVertices[_0xdc40('0x16')][_0xdc40('0x19d')]=function(_0x1e7f63){logger[_0xdc40('0x2b')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x1e7f63[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x1e7f63[_0xdc40('0x19e')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0x19f'));}if(!this[_0xdc40('0x7c')](_0x1e7f63[_0xdc40('0x5a')])){return this['channel'][_0xdc40('0xa8')](_0xdc40('0xaa'));}this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x1e7f63[_0xdc40('0x5a')]));var _0x363a52=this['googleCloudTTS']['sync'](this,_0x1e7f63);if(_0x363a52){this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x1a0'),_0x363a52));var _0x317b4a=this[_0xdc40('0x10')][_0xdc40('0x136')](_0x363a52);try{fs[_0xdc40('0xe8')](_0x363a52+_0xdc40('0xe9'));}catch(_0x3a9d0c){logger[_0xdc40('0x29')](_0x3a9d0c);}return _0x317b4a;}return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x1e7f63,'Google\x20Cloud\x20TTS\x20is\x20unreachable');};AGIVertices['prototype'][_0xdc40('0x1a1')]=function(_0x3ae059){logger['info'](util[_0xdc40('0x27')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x3ae059[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x3ae059[_0xdc40('0x5a')])){return this[_0xdc40('0x10')][_0xdc40('0xa8')](_0xdc40('0xaa'));}this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x1a2'),_0x3ae059['text']));var _0x3fe6fe=this['googleTTS'][_0xdc40('0xc2')](this,_0x3ae059);if(_0x3fe6fe){this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x1a3'),_0x3fe6fe));var _0xeae6de=this[_0xdc40('0x10')][_0xdc40('0x136')](_0x3fe6fe);try{fs['unlink'](_0x3fe6fe+_0xdc40('0xe9'));}catch(_0x27983a){logger[_0xdc40('0x29')](_0x27983a);}return _0xeae6de;}return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x3ae059,_0xdc40('0x1a4'));};AGIVertices['prototype'][_0xdc40('0x1a5')]=function(_0x36742f){logger[_0xdc40('0x2b')](util['format'](_0xdc40('0x1a6'),_0x36742f[_0xdc40('0x36')]));if(!this[_0xdc40('0x7c')](_0x36742f[_0xdc40('0x13a')])){return this['channel'][_0xdc40('0x29')](_0x36742f,'no\x20find\x20by\x20configured');}logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x13c'),this['channel'][_0xdc40('0x39')],_0x36742f[_0xdc40('0x13a')]));var _0x3530b1=this[_0xdc40('0x4f')]['sync'](this,_0x36742f['findBy']);if(_0x3530b1){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xdc40('0x10')][_0xdc40('0x39')],_0x36742f[_0xdc40('0x13a')]));this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0x13d'),this[_0xdc40('0x10')]['callerid'],_0x36742f[_0xdc40('0x13a')]));return{'code':0xc8,'result':_0xdc40('0x13e')};}else{logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x13f'),this['channel'][_0xdc40('0x39')],_0x36742f['findBy']));this['channel'][_0xdc40('0xa8')](util[_0xdc40('0x27')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xdc40('0x10')][_0xdc40('0x39')],_0x36742f['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype'][_0xdc40('0x1a7')]=function(_0x2896d9){logger[_0xdc40('0x2b')](util[_0xdc40('0x27')](_0xdc40('0x1a8'),_0x2896d9[_0xdc40('0x36')]));var _0x4ef3fe=this[_0xdc40('0x10')][_0xdc40('0x55')](_0xdc40('0x1a9'),[_0x2896d9['mailbox'],_0x2896d9[_0xdc40('0x74')]]);if(_0x4ef3fe[_0xdc40('0x98')]===-0x1){return _0x4ef3fe;}return this[_0xdc40('0x10')][_0xdc40('0xa8')](util[_0xdc40('0x27')](_0xdc40('0xa9'),'VOICEMAIL',_0x2896d9['mailbox']));};AGIVertices[_0xdc40('0x16')]['vswitch']=function(_0x2fb456){logger['info'](util[_0xdc40('0x27')]('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x2fb456['label']));if(!this[_0xdc40('0x7c')](_0x2fb456[_0xdc40('0xc3')])){return this[_0xdc40('0x10')][_0xdc40('0x29')](_0x2fb456,_0xdc40('0x18e'));}var _0x454177=this[_0xdc40('0x12')]['sync'](this,_0x2fb456[_0xdc40('0xc3')]);if(!_0x454177){return this[_0xdc40('0x10')]['error'](_0x2fb456,'no\x20variable\x20found');}var _0x5b2aab=this[_0xdc40('0x10')][_0xdc40('0x12')](_0x454177);return{'code':0xc8,'result':_0x5b2aab['extra']?_0x5b2aab['extra']:'-'};};String[_0xdc40('0x16')][_0xdc40('0x96')]=function(_0x153cbe,_0x500dc6){return this['split'](_0x153cbe)[_0xdc40('0x1aa')](_0x500dc6);};module[_0xdc40('0x1ab')]=AGIVertices; \ No newline at end of file +var _0xc6a4=['statusMessage','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','Amy','aws_text_type','awsLex','aws_lex_region','googleASR','google_asr_language','tildeASR','appid','appsecret','uri','includes','clone','hasOwnProperty','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','length','saveRestApiResult','%s.%s','setVariable','split','replaceAll','extra','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','args','answer','label','Enter\x20in\x20CALLBACK\x20(%s)\x20block','isConfigured','delay','minutes','phone','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','noop','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','no\x20grammar\x20configured','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','RECOG_INSTANCE()','sestekasr','SESTEK_ASR_CONFIDENCE','SESTEK_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','database','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','variable_id','no\x20variable\x20found','forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','dial','debug','no\x20user\x20selected','sip_id','no\x20user\x20found','SIP/%s','opts','Executed\x20command\x20%s','DIAL','dialogflow','no\x20key\x20configured','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','sesteknda','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','ndassistant_url','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','out','Sestek\x20NDA\x20%s\x20file\x20created','audiofile','unlink','.wav','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','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','Enter\x20in\x20GETDIGITS\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','aws\x20Polly\x20is\x20unreachable','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s','wav','beep','NOBEEP','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','GoogleASR\x20Result\x20%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','%s/recordings/%s','recordFile','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','no\x20condition\x20configured','true','false','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ISPEECH_ASR_%s','IspeechASR\x20Result\x20%s','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeech\x20TTS\x20is\x20unreachable','login','Enter\x20in\x20LOGIN\x20(%s)\x20block','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','findBy','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','AGENT\x20%s\x20FOUND\x20BY','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','file_id','getData','digit','no\x20variable\x20selected\x20for\x20the\x20result','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','getPause','playback','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','no\x20queue\x20selected','queue_id','no\x20queue\x20found','indexOf','XMCS-QUEUE','QUEUE','macro','position','record','Enter\x20in\x20RECORD\x20(%s)\x20block','%s/recordings/%s.%s','RECORDING_SAVENAME','Recording\x20%s\x20%s\x20%s\x20%s','escape_digits','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','statusCode','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','variable\x20%s\x20set','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','saynumber','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','number','sayphonetic','sayPhonetic','sendMail','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','Smtp','user','bcc','subject','service','host','port','secure','auth','pass','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','Sms\x20message\x20added\x20to\x20outgoing\x20process','no\x20variable\x20selected','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','127.0.0.1','AGI','system','command','sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s','sh\x20command:\x20%s\x20result\x20no\x20stored','google_cloud_tts','no\x20apiKey\x20configured','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','streamFile','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','join','exports','path','util','lodash','shelljs','odbc','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','./scripts','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','name','getSquareProject','getSquareProjectById','getSquareOdbc','getSquareOdbcById','dsn','getUser','getUserById','getTrunk','getTrunkById','getSound','getSoundById','getSoundPath','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','format','%s/sounds/converted/%s','getQueryOdbc','open','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','channel','uniqueid','agicommand','arg_1','callerid','createSquareRecording','calleridname','context','extension','accountcode','dnid','file','createSquareMessage','createCmContact','isNil','callback_','random','isEmpty','lastName','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPauseById','agentPause','agent','agentUnpause','agentLogout','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','ssmlGender','audioEncoding','MP3','googleTTS','restAPI','method','timeout','POST','PUT','toUpperCase','body','headers','parse','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','url','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0xc6a4,0x13f));var _0x4c6a=function(_0x446697,_0x5b5b1a){_0x446697=_0x446697-0x0;var _0x42d073=_0xc6a4[_0x446697];return _0x42d073;};'use strict';var fs=require('fs');var path=require(_0x4c6a('0x0'));var util=require(_0x4c6a('0x1'));var _=require(_0x4c6a('0x2'));var sh=require(_0x4c6a('0x3'));var odbc=require(_0x4c6a('0x4'))();var rs=require(_0x4c6a('0x5'));var moment=require(_0x4c6a('0x6'));var Mustache=require(_0x4c6a('0x7'));var rp=require(_0x4c6a('0x8'));var logger=require(_0x4c6a('0x9'))(_0x4c6a('0xa'));var config=require(_0x4c6a('0xb'));var scripts=require(_0x4c6a('0xc'));var FILES_PATH=_0x4c6a('0xd');var recursiveMapAttributes=[_0x4c6a('0xe'),_0x4c6a('0xf')];var verticesWithRetry=[_0x4c6a('0x10'),_0x4c6a('0x11'),_0x4c6a('0x12')];var AGIVertices=function(_0x198148,_0x261673,_0x4cd06b){this['channel']=_0x198148;this[_0x4c6a('0x13')]=_0x261673;this[_0x4c6a('0x14')]=_0x4cd06b;};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x16')]=function(_0xe11321,_0x2af286){this['rpc'][_0x4c6a('0x17')](_0xe11321)[_0x4c6a('0x18')](function(_0x78d1b8){_0x2af286(null,_0x78d1b8?_0x78d1b8['name']:![]);})[_0x4c6a('0x19')](function(_0x4273ea){_0x2af286(_0x4273ea);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1a')]=function(_0x41801f,_0x511471){this[_0x4c6a('0x13')]['getVoiceQueueById'](_0x41801f)[_0x4c6a('0x18')](function(_0x2c3e93){_0x511471(null,_0x2c3e93?_0x2c3e93[_0x4c6a('0x1b')]:![]);})[_0x4c6a('0x19')](function(_0x3608d4){_0x511471(_0x3608d4);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1c')]=function(_0x2b1921,_0x1dfd9a){this[_0x4c6a('0x13')][_0x4c6a('0x1d')](_0x2b1921)[_0x4c6a('0x18')](function(_0x2ce053){_0x1dfd9a(null,_0x2ce053?_0x2ce053[_0x4c6a('0x1b')]:![]);})[_0x4c6a('0x19')](function(_0x438799){_0x1dfd9a(_0x438799);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1e')]=function(_0x4a21b1,_0x39daf4){this['rpc'][_0x4c6a('0x1f')](_0x4a21b1)[_0x4c6a('0x18')](function(_0x555e73){_0x39daf4(null,_0x555e73?_0x555e73[_0x4c6a('0x20')]:![]);})[_0x4c6a('0x19')](function(_0x27373d){_0x39daf4(_0x27373d);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x21')]=function(_0x1ed9f8,_0x5311fc){this[_0x4c6a('0x13')][_0x4c6a('0x22')](_0x1ed9f8)[_0x4c6a('0x18')](function(_0x241496){_0x5311fc(null,_0x241496?_0x241496[_0x4c6a('0x1b')]:![]);})[_0x4c6a('0x19')](function(_0x6927f9){_0x5311fc(_0x6927f9);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x23')]=function(_0x1de7e4,_0x39117b){this[_0x4c6a('0x13')][_0x4c6a('0x24')](_0x1de7e4)['then'](function(_0x1ee3bd){_0x39117b(null,_0x1ee3bd?_0x1ee3bd[_0x4c6a('0x1b')]:![]);})[_0x4c6a('0x19')](function(_0x14693a){_0x39117b(_0x14693a);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x25')]=function(_0x28daa6,_0xb793ca){var _0x184b7d=this;this[_0x4c6a('0x13')][_0x4c6a('0x26')](_0x28daa6)[_0x4c6a('0x18')](function(_0x3477ab){_0xb793ca(null,_0x3477ab?_0x184b7d[_0x4c6a('0x27')](_0x3477ab['save_name']):![]);})[_0x4c6a('0x19')](function(_0x523998){_0xb793ca(_0x523998);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x28')]=function(_0x115289,_0x3209b6){this[_0x4c6a('0x13')]['getMailAccountById'](_0x115289)[_0x4c6a('0x18')](function(_0x32b65c){_0x3209b6(null,_0x32b65c?_0x32b65c:![]);})[_0x4c6a('0x19')](function(_0x4d0931){_0x3209b6(_0x4d0931);});};AGIVertices['prototype'][_0x4c6a('0x29')]=function(_0x313d3f,_0x450464,_0x10ed16){this['mailRpc'][_0x4c6a('0x29')](_0x313d3f,_0x450464)[_0x4c6a('0x18')](function(){_0x10ed16(null);})[_0x4c6a('0x19')](function(_0x7de771){_0x10ed16(_0x7de771);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x2a')]=function(_0x326151,_0x21d13f){this[_0x4c6a('0x13')][_0x4c6a('0x2b')](_0x326151)[_0x4c6a('0x18')](function(_0x5d07ca){if(_0x5d07ca){if(_0x5d07ca[_0x4c6a('0x2c')]){_0x21d13f(null,[_0x5d07ca[_0x4c6a('0x2d')]]);}else{_0x21d13f(null,_[_0x4c6a('0x2e')](_0x5d07ca[_0x4c6a('0x2f')],'interval'));}}else{_0x21d13f(null,![]);}})[_0x4c6a('0x19')](function(_0x15784a){_0x21d13f(_0x15784a);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x27')]=function(_0x1f91e1){return util[_0x4c6a('0x30')](_0x4c6a('0x31'),FILES_PATH,_0x1f91e1);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x32')]=function(_0x166e9f,_0x355287,_0x324e6c){odbc[_0x4c6a('0x33')](_0x166e9f,function(_0x40eaa9){if(_0x40eaa9){logger[_0x4c6a('0x34')](_0x4c6a('0x35'),_0x40eaa9);_0x324e6c(_0x40eaa9);}else{logger[_0x4c6a('0x36')](_0x4c6a('0x37'));odbc[_0x4c6a('0x38')](_0x355287,function(_0x532ad4,_0x31cf28){if(_0x532ad4){logger[_0x4c6a('0x36')](_0x4c6a('0x39'),_0x355287);_0x324e6c(_0x532ad4);}else{logger[_0x4c6a('0x36')](_0x4c6a('0x3a'),_0x355287);odbc['close'](function(_0x1d4494){if(_0x1d4494){logger[_0x4c6a('0x34')](_0x4c6a('0x3b'),_0x1d4494);}_0x324e6c(null,_0x31cf28);});}});}});};AGIVertices[_0x4c6a('0x15')]['getSmsAccount']=function(_0x3cb79f,_0x466f82){this['rpc'][_0x4c6a('0x3c')](_0x3cb79f)['then'](function(_0x98fb83){_0x466f82(null,_0x98fb83?_0x98fb83:![]);})[_0x4c6a('0x19')](function(_0x2acc95){_0x466f82(_0x2acc95);});};AGIVertices['prototype']['createSmsMessage']=function(_0x3b3ff9,_0x4b9c71){this[_0x4c6a('0x13')][_0x4c6a('0x3d')](_0x3b3ff9)[_0x4c6a('0x18')](function(_0x30d8e1){_0x4b9c71(null,_0x30d8e1);})[_0x4c6a('0x19')](function(_0x33854f){_0x4b9c71(_0x33854f);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x3e')]=function(_0x5a87d0,_0x562a1f,_0x5d4b20){this[_0x4c6a('0x13')][_0x4c6a('0x3e')]({'uniqueid':this[_0x4c6a('0x3f')][_0x4c6a('0x40')],'node':_0x5a87d0['label'],'application':_0x5a87d0[_0x4c6a('0x41')],'data':_0x562a1f||null,'project_name':this[_0x4c6a('0x3f')][_0x4c6a('0x42')],'callerid':this[_0x4c6a('0x3f')][_0x4c6a('0x43')]})[_0x4c6a('0x18')](function(_0x312ee1){if(_0x5d4b20){_0x5d4b20(null,_0x312ee1);}})[_0x4c6a('0x19')](function(_0x39d666){if(_0x5d4b20){_0x5d4b20(_0x39d666);}});};AGIVertices['prototype'][_0x4c6a('0x44')]=function(_0x538d27,_0x5c942f,_0x6e2821,_0x4e756d){this[_0x4c6a('0x13')][_0x4c6a('0x44')]({'uniqueid':this[_0x4c6a('0x3f')][_0x4c6a('0x40')],'callerid':this[_0x4c6a('0x3f')][_0x4c6a('0x43')],'calleridname':this[_0x4c6a('0x3f')][_0x4c6a('0x45')],'context':this[_0x4c6a('0x3f')][_0x4c6a('0x46')],'extension':this['channel'][_0x4c6a('0x47')],'priority':this[_0x4c6a('0x3f')]['priority'],'accountcode':this[_0x4c6a('0x3f')][_0x4c6a('0x48')],'dnid':this[_0x4c6a('0x3f')][_0x4c6a('0x49')],'projectName':this['channel']['arg_1'],'saveName':_0x5c942f,'filename':_0x538d27[_0x4c6a('0x4a')]||_0x5c942f,'savePath':_0x6e2821})[_0x4c6a('0x18')](function(_0x1f6d39){_0x4e756d(null,_0x1f6d39);})['catch'](function(_0x4f12d8){_0x4e756d(_0x4f12d8);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x4b')]=function(_0x2d359a,_0x190f19,_0x193ef3){this[_0x4c6a('0x13')][_0x4c6a('0x4b')]({'uniqueid':this[_0x4c6a('0x3f')][_0x4c6a('0x40')],'body':_0x2d359a,'direction':_0x190f19})[_0x4c6a('0x18')](function(_0x3ced1f){if(_0x193ef3){_0x193ef3(null,_0x3ced1f);}})[_0x4c6a('0x19')](function(_0x11e4ea){if(_0x193ef3){_0x193ef3(_0x11e4ea);}});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x4c')]=function(_0x5e8aaa,_0x4f883c){this[_0x4c6a('0x13')]['createCmContact']({'firstName':_['isEmpty'](_0x5e8aaa[_0x4c6a('0x1b')])||_[_0x4c6a('0x4d')](_0x5e8aaa[_0x4c6a('0x1b')])?_0x4c6a('0x4e')+Math[_0x4c6a('0x4f')]():_0x5e8aaa[_0x4c6a('0x1b')],'lastName':_[_0x4c6a('0x50')](_0x5e8aaa[_0x4c6a('0x51')])||_['isNil'](_0x5e8aaa[_0x4c6a('0x51')])?null:_0x5e8aaa[_0x4c6a('0x51')],'phone':_0x5e8aaa['phone'],'ListId':_0x5e8aaa[_0x4c6a('0x52')],'scheduledat':_0x5e8aaa[_0x4c6a('0x53')],'callbackUniqueid':this[_0x4c6a('0x3f')][_0x4c6a('0x40')],'tags':_0x4c6a('0x54'),'description':_0x4c6a('0x55')+_0x5e8aaa[_0x4c6a('0x53')][_0x4c6a('0x56')](),'priority':_0x5e8aaa[_0x4c6a('0x57')]})['then'](function(_0x14dc9d){_0x4f883c(null,_0x14dc9d);})['catch'](function(_0x2ec7e5){_0x4f883c(_0x2ec7e5);});};AGIVertices[_0x4c6a('0x15')]['getPause']=function(_0x5981f8,_0x5bcb9d){this['rpc'][_0x4c6a('0x58')](_0x5981f8)[_0x4c6a('0x18')](function(_0x384720){_0x5bcb9d(null,_0x384720?_0x384720['name']:![]);})['catch'](function(_0xe3d70a){_0x5bcb9d(_0xe3d70a);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x59')]=function(_0x3c1506,_0x4e584a,_0x16d363){var _0x5509b3={'role':_0x4c6a('0x5a')};_0x5509b3[_0x3c1506]=this['channel'][_0x4c6a('0x43')];this[_0x4c6a('0x13')][_0x4c6a('0x59')](_0x5509b3,_0x4e584a,this['channel']['uniqueid'])['then'](function(_0x2ba548){_0x16d363(null,_[_0x4c6a('0x4d')](_0x2ba548)?![]:!![]);})[_0x4c6a('0x19')](function(_0x3af37a){logger[_0x4c6a('0x34')](_0x3af37a);_0x16d363(null,![]);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x5b')]=function(_0x4f19df,_0x396604){var _0x1d0061={'role':_0x4c6a('0x5a')};_0x1d0061[_0x4f19df]=this[_0x4c6a('0x3f')][_0x4c6a('0x43')];this['rpc'][_0x4c6a('0x5b')](_0x1d0061)[_0x4c6a('0x18')](function(_0x2ff631){_0x396604(null,_[_0x4c6a('0x4d')](_0x2ff631)?![]:!![]);})['catch'](function(_0x1b7ef7){logger[_0x4c6a('0x34')](_0x1b7ef7);_0x396604(null,![]);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x5c')]=function(_0x143dfd,_0x47ea37){var _0x9e1109={'role':_0x4c6a('0x5a')};_0x9e1109[_0x143dfd]=this[_0x4c6a('0x3f')]['callerid'];this[_0x4c6a('0x13')][_0x4c6a('0x5c')](_0x9e1109)[_0x4c6a('0x18')](function(_0x1e562d){_0x47ea37(null,_[_0x4c6a('0x4d')](_0x1e562d)?![]:!![]);})['catch'](function(_0x2a158e){logger['error'](_0x2a158e);_0x47ea37(null,![]);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x5d')]=function(_0x37fe28,_0x1edf38){var _0xec2e0b={'role':_0x4c6a('0x5a')};_0xec2e0b[_0x37fe28]=this[_0x4c6a('0x3f')][_0x4c6a('0x43')];var _0x189061=_0x37fe28!=_0x4c6a('0x5e')?util[_0x4c6a('0x30')](_0x4c6a('0x5f'),_0x4c6a('0x60'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')]):undefined;this[_0x4c6a('0x13')][_0x4c6a('0x5d')](_0xec2e0b,_0x189061)[_0x4c6a('0x18')](function(_0x17b9d6){_0x1edf38(null,_['isNil'](_0x17b9d6)?![]:!![]);})['catch'](function(_0x539a82){logger[_0x4c6a('0x34')](_0x539a82);_0x1edf38(null,![]);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x61')]=function(_0x136fa4,_0x47f44a){sh[_0x4c6a('0x62')](_['trim'](_0x136fa4),function(_0x32f8e9,_0x35501a){var _0x5815b2=_0x35501a[_0x4c6a('0x63')](/(\r\n|\n|\r)/gm,'');_0x47f44a(null,_0x5815b2);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x64')]=function(_0x56f2f0,_0x11ba6a){scripts['googleCloudTTS'](_0x56f2f0[_0x4c6a('0x65')],_0x56f2f0[_0x4c6a('0x66')]||_0x4c6a('0x67'),_0x56f2f0[_0x4c6a('0x67')],_0x56f2f0[_0x4c6a('0x68')]||_0x4c6a('0x69'),_0x56f2f0[_0x4c6a('0x6a')]||'MALE',_0x56f2f0[_0x4c6a('0x6b')]||_0x4c6a('0x6c'))[_0x4c6a('0x18')](function(_0x10c2f2){_0x11ba6a(null,_0x10c2f2);})[_0x4c6a('0x19')](function(_0x62436b){_0x11ba6a(_0x62436b);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x6d')]=function(_0x5c7d84,_0x388d53){scripts[_0x4c6a('0x6d')](_0x5c7d84['text'],_0x5c7d84['google_tts_language']||'en',0x1)[_0x4c6a('0x18')](function(_0x29d779){_0x388d53(null,_0x29d779);})[_0x4c6a('0x19')](function(_0x1f6a9d){_0x388d53(_0x1f6a9d);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x6e')]=function(_0x2fd715,_0x2ca630){var _0x3c0f2b={'uri':_0x2fd715['url'],'method':_0x2fd715[_0x4c6a('0x6f')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x2fd715[_0x4c6a('0x70')])==='number'&&parseInt(_0x2fd715['timeout'])>=0x1?parseInt(_0x2fd715[_0x4c6a('0x70')])*0x3e8:0x5*0x3e8};if(_['includes']([_0x4c6a('0x71'),_0x4c6a('0x72')],_0x3c0f2b['method'][_0x4c6a('0x73')]())){try{_0x3c0f2b[_0x4c6a('0x74')]=_0x2fd715[_0x4c6a('0xf')]?JSON['parse'](_0x2fd715[_0x4c6a('0xf')]):{};}catch(_0x28fee){logger[_0x4c6a('0x34')]('An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function',_0x28fee);}}try{_0x3c0f2b[_0x4c6a('0x75')]=_0x2fd715['rawHeaders']?JSON[_0x4c6a('0x76')](_0x2fd715[_0x4c6a('0xe')]):{};}catch(_0x1af461){logger[_0x4c6a('0x34')](_0x4c6a('0x77'),_0x1af461);}if(_0x2fd715[_0x4c6a('0x78')]){try{var _0x2ce683=require(_0x2fd715[_0x4c6a('0x78')])[_0x4c6a('0x79')](this,_0x3c0f2b);_0x3c0f2b['uri']=Mustache['render'](_0x2fd715[_0x4c6a('0x7a')],_0x2ce683,{},['$$','$$']);if(_0x3c0f2b[_0x4c6a('0x75')]){_0x3c0f2b[_0x4c6a('0x75')]=JSON['parse'](Mustache[_0x4c6a('0x7b')](JSON['stringify'](_0x3c0f2b[_0x4c6a('0x75')]),_0x2ce683,{},['$$','$$']));}if(_0x3c0f2b[_0x4c6a('0x74')]){_0x3c0f2b[_0x4c6a('0x74')]=JSON[_0x4c6a('0x76')](Mustache[_0x4c6a('0x7b')](JSON[_0x4c6a('0x7c')](_0x3c0f2b[_0x4c6a('0x74')]),_0x2ce683,{},['$$','$$']));}}catch(_0x36c06c){logger[_0x4c6a('0x34')](_0x4c6a('0x7d'),_0x36c06c);}}rp(_0x3c0f2b)[_0x4c6a('0x18')](function(_0x56f51d){var _0x22f38b={'statusCode':_0x56f51d['statusCode']||0xc8,'statusMessage':_0x56f51d[_0x4c6a('0x7e')]||'OK','headers':_0x56f51d[_0x4c6a('0x75')]||{},'body':_0x56f51d['body']||{}};_0x2ca630(null,_0x22f38b);})['catch'](function(_0x29702d){var _0x51938b={'statusCode':_0x29702d['statusCode']||0x1f4,'statusMessage':_0x29702d[_0x4c6a('0x7f')]||_0x4c6a('0x80'),'headers':_0x29702d['options'][_0x4c6a('0x75')]||{},'body':_0x29702d[_0x4c6a('0x81')][_0x4c6a('0x74')]||{}};_0x2ca630(null,_0x51938b);});};AGIVertices['prototype']['googleDialogflow']=function(_0x149d35,_0x9f4ba0){scripts[_0x4c6a('0x82')](this[_0x4c6a('0x3f')]['uniqueid'],_0x149d35[_0x4c6a('0x83')],_0x149d35[_0x4c6a('0x67')],_0x149d35[_0x4c6a('0x84')]||'en')[_0x4c6a('0x18')](function(_0x541780){_0x9f4ba0(null,_0x541780);})[_0x4c6a('0x19')](function(_0xbea033){_0x9f4ba0(_0xbea033);});};AGIVertices['prototype'][_0x4c6a('0x85')]=function(_0x4afd98,_0x508517){scripts['sestekNDA'](this[_0x4c6a('0x3f')],_0x4afd98)[_0x4c6a('0x18')](function(_0x1d683e){_0x508517(null,_0x1d683e);})[_0x4c6a('0x19')](function(_0x372f24){_0x508517(_0x372f24);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x86')]=function(_0x2f4766,_0x20bfe){scripts[_0x4c6a('0x86')](_0x2f4766[_0x4c6a('0x83')],_0x2f4766[_0x4c6a('0x67')],_0x2f4766[_0x4c6a('0x87')]||_0x4c6a('0x69'),_0x2f4766[_0x4c6a('0x88')])['then'](function(_0x4c0b56){_0x20bfe(null,_0x4c0b56);})[_0x4c6a('0x19')](function(_0x1a0e89){_0x20bfe(_0x1a0e89);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x89')]=function(_0x772d8f,_0x5568fe,_0x58f8c0){scripts[_0x4c6a('0x89')](_0x5568fe,_0x772d8f[_0x4c6a('0x83')],_0x772d8f[_0x4c6a('0x8a')]||_0x4c6a('0x69'),this['isConfigured'](_0x772d8f[_0x4c6a('0x8b')])?_0x772d8f[_0x4c6a('0x8b')]:undefined)[_0x4c6a('0x18')](function(_0x486da4){_0x58f8c0(null,_0x486da4);})['catch'](function(_0x22281a){_0x58f8c0(_0x22281a);});};AGIVertices[_0x4c6a('0x15')]['awsPolly']=function(_0x3d6bc4,_0x16a3c0){scripts[_0x4c6a('0x8c')](_0x3d6bc4[_0x4c6a('0x8d')],_0x3d6bc4[_0x4c6a('0x8e')],_0x3d6bc4[_0x4c6a('0x8f')],_0x3d6bc4['aws_polly_voice']||_0x4c6a('0x90'),_0x3d6bc4[_0x4c6a('0x67')],_0x3d6bc4[_0x4c6a('0x91')]||_0x4c6a('0x67'))[_0x4c6a('0x18')](function(_0x1cfeb9){_0x16a3c0(null,_0x1cfeb9);})[_0x4c6a('0x19')](function(_0x24d8d7){_0x16a3c0(_0x24d8d7);});};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x92')]=function(_0x23bc51,_0x319b21){scripts['awsLex'](this[_0x4c6a('0x3f')]['uniqueid'],_0x23bc51[_0x4c6a('0x8d')],_0x23bc51[_0x4c6a('0x8e')],_0x23bc51[_0x4c6a('0x93')],_0x23bc51[_0x4c6a('0x67')],_0x23bc51['aws_bot_name'])['then'](function(_0x1b70e8){_0x319b21(null,_0x1b70e8);})[_0x4c6a('0x19')](function(_0x157b1d){_0x319b21(_0x157b1d);});};AGIVertices[_0x4c6a('0x15')]['googleASR']=function(_0x1b4b1d,_0x5cedf2,_0x58eec2){scripts[_0x4c6a('0x94')](_0x5cedf2,_0x1b4b1d[_0x4c6a('0x83')],_0x1b4b1d[_0x4c6a('0x95')]||_0x4c6a('0x69'))['then'](function(_0x183c44){_0x58eec2(null,_0x183c44);})[_0x4c6a('0x19')](function(_0xfe168c){_0x58eec2(_0xfe168c);});};AGIVertices['prototype'][_0x4c6a('0x96')]=function(_0x121b3c,_0x3d41c2,_0x1a2d91){scripts[_0x4c6a('0x96')](_0x3d41c2,_0x121b3c[_0x4c6a('0x97')],_0x121b3c[_0x4c6a('0x98')],_0x121b3c[_0x4c6a('0x99')])[_0x4c6a('0x18')](function(_0x55aa22){_0x1a2d91(null,_0x55aa22);})['catch'](function(_0x21357b){_0x1a2d91(_0x21357b);});};AGIVertices[_0x4c6a('0x15')]['clear']=function(_0x595f06){var _0x49b797=_[_0x4c6a('0x9a')](verticesWithRetry,_0x595f06['agicommand'])?_0x595f06:_[_0x4c6a('0x9b')](_0x595f06);for(var _0x29f64c in _0x49b797){if(_0x49b797[_0x4c6a('0x9c')](_0x29f64c)){if(_0x49b797[_0x29f64c]&&_['isString'](_0x49b797[_0x29f64c])){if(_[_0x4c6a('0x9a')](recursiveMapAttributes,_0x29f64c)){_0x49b797[_0x29f64c]=this[_0x4c6a('0x9d')](_0x49b797[_0x29f64c]);}else{_0x49b797[_0x29f64c]=this[_0x4c6a('0x9e')](_0x49b797[_0x29f64c]);}}}}return _0x49b797;};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x9f')]=function(_0x1d8693){for(var _0x4df417 in _0x1d8693){if(_0x1d8693[_0x4c6a('0x9c')](_0x4df417)){if(_[_0x4c6a('0xa0')](_0x1d8693[_0x4df417])){this['recursiveNodeIndex'](_0x1d8693[_0x4df417]);}else if(_['isArray'](_0x1d8693[_0x4df417])){for(var _0xd4eb9=0x0;_0xd4eb9<_0x1d8693[_0x4df417][_0x4c6a('0xa1')];_0xd4eb9++){this[_0x4c6a('0x9f')](_0x1d8693[_0x4df417][_0xd4eb9]);}}else if(_['isString'](_0x1d8693[_0x4df417])){_0x1d8693[_0x4df417]=this[_0x4c6a('0x9e')](_0x1d8693[_0x4df417]);}}}};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xa2')]=function(_0x98f5,_0xef5ccb){for(var _0x25adeb in _0x98f5){if(_0x98f5['hasOwnProperty'](_0x25adeb)){if(_[_0x4c6a('0xa0')](_0x98f5[_0x25adeb])){if(!_['isEmpty'](_0x98f5[_0x25adeb])){this[_0x4c6a('0xa2')](_0x98f5[_0x25adeb],util[_0x4c6a('0x30')](_0x4c6a('0xa3'),_0xef5ccb,_0x25adeb));}}else if(_['isArray'](_0x98f5[_0x25adeb])){for(var _0xef07c4=0x0;_0xef07c4<_0x98f5[_0x25adeb]['length'];_0xef07c4++){this[_0x4c6a('0xa2')](_0x98f5[_0x25adeb][_0xef07c4],util[_0x4c6a('0x30')](_0x4c6a('0xa3'),_0xef5ccb,_0x25adeb+'['+_0xef07c4+']'));}}else{if(!_[_0x4c6a('0x4d')](_0x98f5[_0x25adeb])){this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util[_0x4c6a('0x30')](_0x4c6a('0xa3'),_0xef5ccb,_0x25adeb),_0x98f5[_0x25adeb]);}}}}};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x9d')]=function(_0x13911f){try{var _0x41f1e2=JSON[_0x4c6a('0x76')](_0x13911f);this[_0x4c6a('0x9f')](_0x41f1e2);return JSON['stringify'](_0x41f1e2);}catch(_0x146235){return this[_0x4c6a('0x9e')](_0x13911f);}};AGIVertices['prototype'][_0x4c6a('0x9e')]=function(_0x47719e){var _0x5348e3=_0x47719e['split']('{');for(var _0x45679e=0x1;_0x45679e<_0x5348e3[_0x4c6a('0xa1')];_0x45679e+=0x1){var _0x2ed195=_0x5348e3[_0x45679e][_0x4c6a('0xa5')]('}');if(_0x2ed195[_0x4c6a('0xa1')]>0x1){_0x47719e=_0x47719e[_0x4c6a('0xa6')]('{'+_0x2ed195[0x0]+'}',this[_0x4c6a('0x3f')][_0x4c6a('0x16')](_0x2ed195[0x0])[_0x4c6a('0xa7')]||_0x2ed195[0x0]);}}if(_0x5348e3[_0x4c6a('0xa1')]===0x1){return _0x47719e[_0x4c6a('0x56')]();}return this['replaceAllVariables'](_0x47719e);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xa8')]=function(_0x2e54ea,_0x28e9e3){var _0x35a714=this[_0x4c6a('0x3f')][_0x4c6a('0x16')](_0x2e54ea);if(_0x35a714[_0x4c6a('0xa9')]===-0x1){return _0x35a714;}logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0xaa'),_0x28e9e3,_0x35a714[_0x4c6a('0xa7')]));return this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](_0x28e9e3,_0x35a714[_0x4c6a('0xa7')]);};AGIVertices[_0x4c6a('0x15')]['isConfigured']=function(_0x3e67d8){return _0x3e67d8&&_0x3e67d8!=='0'&&_0x3e67d8!=='-1'&&_0x3e67d8!=='';};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xab')]=function(_0x7e42bf){this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x7e42bf,'-');_0x7e42bf[_0x4c6a('0xac')]=_0x7e42bf[_0x4c6a('0xab')];return{'code':0xc8,'result':'-'};};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xa')]=function(_0x48e701){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x48e701['label']));return this[_0x4c6a('0x3f')][_0x4c6a('0xa')]([_0x48e701['command'],_0x48e701[_0x4c6a('0xad')]]);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xae')]=function(_0x4d091a){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('Enter\x20in\x20ANSWER\x20(%s)\x20block',_0x4d091a[_0x4c6a('0xaf')]));if(this['isConfigured'](_0x4d091a[_0x4c6a('0x70')])){logger['info'](util['format']('Wait\x20%s\x20seconds\x20before\x20answer',_0x4d091a[_0x4c6a('0x70')]));var _0xad3982=this['channel']['wait'](_0x4d091a[_0x4c6a('0x70')]);if(_0xad3982['result']===-0x1){return _0xad3982;}}return this[_0x4c6a('0x3f')][_0x4c6a('0xae')]();};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x54')]=function(_0x14fbb8){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0xb0'),_0x14fbb8['label']));if(!this[_0x4c6a('0xb1')](_0x14fbb8['list_id'])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x14fbb8,'no\x20list\x20selected');}_0x14fbb8[_0x4c6a('0x53')]=moment();if(this[_0x4c6a('0xb1')](_0x14fbb8[_0x4c6a('0xb2')])){_0x14fbb8['scheduledAt']=moment()['add'](_0x14fbb8[_0x4c6a('0xb2')],_0x4c6a('0xb3'));}if(!this[_0x4c6a('0xb1')](_0x14fbb8[_0x4c6a('0x57')])){_0x14fbb8[_0x4c6a('0x57')]=0x2;}this[_0x4c6a('0x4c')][_0x4c6a('0x79')](this,_0x14fbb8);return this[_0x4c6a('0x3f')]['noop'](util['format']('CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s',_0x14fbb8[_0x4c6a('0xb4')],_0x14fbb8['list_id'],_0x14fbb8[_0x4c6a('0x53')]));};AGIVertices[_0x4c6a('0x15')]['custom_app']=function(_0x5ac210){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0xb5'),_0x5ac210[_0x4c6a('0xaf')]));var _0x24e385=this[_0x4c6a('0x3f')][_0x4c6a('0x62')](_0x5ac210['application'],_0x5ac210['options']);if(_0x24e385[_0x4c6a('0xa9')]===-0x1){return _0x24e385;}return this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0xb6'),_0x5ac210['application'],_0x5ac210[_0x4c6a('0x81')]));};AGIVertices['prototype'][_0x4c6a('0xb7')]=function(_0x4f3bff){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0xb8'),_0x4f3bff[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x4f3bff['text'])){return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0xb9'));}var _0x191652='\x22'+_0x4f3bff[_0x4c6a('0x67')]+'\x22';if(this['isConfigured'](_0x4f3bff[_0x4c6a('0x81')])){_0x191652+=','+_0x4f3bff['options'];}var _0x1c99bc=this[_0x4c6a('0x3f')][_0x4c6a('0x62')]('MRCPSynth',_0x191652);if(_0x1c99bc[_0x4c6a('0xa9')]===-0x1){return _0x1c99bc;}return this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')]('Executed\x20command\x20MRCPSynth\x20%s',_0x191652));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xba')]=function(_0x53b0a4){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0xbb'),_0x53b0a4[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x53b0a4['text'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xb9'));}var _0x2f29b8='\x22'+_0x53b0a4['text']+'\x22';if(this[_0x4c6a('0xb1')](_0x53b0a4[_0x4c6a('0x81')])){_0x2f29b8+=','+_0x53b0a4[_0x4c6a('0x81')];}var _0x77b41a=this['channel'][_0x4c6a('0x62')](_0x4c6a('0xbd'),_0x2f29b8);if(_0x77b41a[_0x4c6a('0xa9')]===-0x1){return _0x77b41a;}return this[_0x4c6a('0x3f')]['noop'](util['format'](_0x4c6a('0xbe'),_0x2f29b8));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xbf')]=function(_0x41da95){logger['info'](util['format'](_0x4c6a('0xc0'),_0x41da95[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x41da95[_0x4c6a('0xc1')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xc2'));}var _0x5a5148=_0x41da95[_0x4c6a('0xc1')];if(this['isConfigured'](_0x41da95[_0x4c6a('0x81')])){_0x5a5148+=','+_0x41da95['options'];}var _0x47fa8a=this[_0x4c6a('0x3f')][_0x4c6a('0x62')](_0x4c6a('0xc3'),_0x5a5148);if(_0x47fa8a[_0x4c6a('0xa9')]===-0x1){return _0x47fa8a;}var _0x22439a=this[_0x4c6a('0xa8')](_0x4c6a('0xc4'),_0x4c6a('0xc5'));if(_0x22439a[_0x4c6a('0xa9')]===-0x1){return _0x22439a;}var _0x48f696=this[_0x4c6a('0xa8')](_0x4c6a('0xc6'),'LUMENVOX_ASR_TRANSCRIPT');if(_0x48f696['result']===-0x1){return _0x48f696;}var _0x1967a2=this[_0x4c6a('0xa8')](_0x4c6a('0xc7'),'LUMENVOX_ASR_INSTANCE');if(_0x1967a2['result']===-0x1){return _0x1967a2;}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format']('Executed\x20command\x20MRCPRecog\x20%s',_0x5a5148));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xc8')]=function(_0x2ee11c){logger[_0x4c6a('0x36')](util['format']('Enter\x20in\x20SESTEKASR\x20(%s)\x20block',_0x2ee11c[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x2ee11c[_0x4c6a('0xc1')])){return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0xc2'));}var _0x3db5a4=_0x2ee11c[_0x4c6a('0xc1')];if(this[_0x4c6a('0xb1')](_0x2ee11c['options'])){_0x3db5a4+=','+_0x2ee11c[_0x4c6a('0x81')];}var _0x3cee91=this[_0x4c6a('0x3f')][_0x4c6a('0x62')](_0x4c6a('0xc3'),_0x3db5a4);if(_0x3cee91[_0x4c6a('0xa9')]===-0x1){return _0x3cee91;}var _0x244a9b=this['getAndSetVariable'](_0x4c6a('0xc4'),_0x4c6a('0xc9'));if(_0x244a9b[_0x4c6a('0xa9')]===-0x1){return _0x244a9b;}var _0x5c7d75=this[_0x4c6a('0xa8')](_0x4c6a('0xc6'),'SESTEK_ASR_TRANSCRIPT');if(_0x5c7d75[_0x4c6a('0xa9')]===-0x1){return _0x5c7d75;}var _0xe26267=this[_0x4c6a('0xa8')](_0x4c6a('0xc7'),_0x4c6a('0xca'));if(_0xe26267[_0x4c6a('0xa9')]===-0x1){return _0xe26267;}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0xcb'),_0x3db5a4));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xcc')]=function(_0x167a73){logger['info'](util[_0x4c6a('0x30')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x167a73[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x167a73[_0x4c6a('0xcd')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x167a73,_0x4c6a('0xce'));}var _0x1ca259=this[_0x4c6a('0x1e')][_0x4c6a('0x79')](this,_0x167a73['odbc_id']);if(!_0x1ca259){return this[_0x4c6a('0x3f')]['error'](_0x167a73,_0x4c6a('0xcf'));}if(!this[_0x4c6a('0xb1')](_0x167a73[_0x4c6a('0x38')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x167a73,_0x4c6a('0xd0'));}var _0x37036a=_0x167a73['query'][_0x4c6a('0x63')](/(\r\n|\n|\r)/gm,'\x20');this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0xd1'),_0x37036a));var _0x1184ec=this[_0x4c6a('0x32')][_0x4c6a('0x79')](this,_0x1ca259,_0x37036a);this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x167a73,_0x37036a);if(!this[_0x4c6a('0xb1')](_0x167a73[_0x4c6a('0xd2')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x5dd767=this['getVariable'][_0x4c6a('0x79')](this,_0x167a73[_0x4c6a('0xd2')]);if(!_0x5dd767){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x167a73,_0x4c6a('0xd3'));}var _0x2c8313=this;_0x1184ec[_0x4c6a('0xd4')](function(_0x176110,_0x3d786e){Object[_0x4c6a('0xd5')](_0x176110)[_0x4c6a('0xd4')](function(_0x53a341){_0x2c8313[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util['format'](_0x4c6a('0xd6'),_0x5dd767,_0x3d786e,_0x53a341),_0x176110[_0x53a341]);});});this['channel']['setVariable'](util['format'](_0x4c6a('0xd7'),_0x5dd767),_0x1184ec[_0x4c6a('0xa1')]);return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('variable\x20%s\x20set',_0x5dd767));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xd8')]=function(_0x226e81){logger[_0x4c6a('0xd9')](util[_0x4c6a('0x30')]('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x226e81[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x226e81['sip_id'])){return this[_0x4c6a('0x3f')]['error'](_0x226e81,_0x4c6a('0xda'));}var _0xc0b18f=this[_0x4c6a('0x21')][_0x4c6a('0x79')](this,_0x226e81[_0x4c6a('0xdb')]);if(!_0xc0b18f){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x226e81,_0x4c6a('0xdc'));}var _0x33fb80=this[_0x4c6a('0x3f')][_0x4c6a('0x62')]('DIAL',[util['format'](_0x4c6a('0xdd'),_0xc0b18f),_0x226e81['timeout'],_0x226e81[_0x4c6a('0xde')],_0x226e81[_0x4c6a('0x7a')]]);if(_0x33fb80[_0x4c6a('0xa9')]===-0x1){return _0x33fb80;}return this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0xdf'),_0x4c6a('0xe0')));};AGIVertices['prototype'][_0x4c6a('0xe1')]=function(_0x1d6758){logger[_0x4c6a('0x36')](util['format']('Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block',_0x1d6758[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x1d6758[_0x4c6a('0x83')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xe2'));}if(!this[_0x4c6a('0xb1')](_0x1d6758[_0x4c6a('0x67')])){return this['channel']['noop'](_0x4c6a('0xb9'));}this[_0x4c6a('0x3f')][_0x4c6a('0xe3')]=!![];this[_0x4c6a('0x3e')](_0x1d6758);this[_0x4c6a('0x4b')](_0x1d6758[_0x4c6a('0x67')],'in');this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format'](_0x4c6a('0xe4'),_0x1d6758[_0x4c6a('0x67')]));var _0x2a9d25=this[_0x4c6a('0x82')][_0x4c6a('0x79')](this,_0x1d6758);if(_0x2a9d25){for(var _0x4d0fd5 in _0x2a9d25){if(_0x2a9d25[_0x4c6a('0x9c')](_0x4d0fd5)){this[_0x4c6a('0x3f')]['setVariable'](util[_0x4c6a('0x30')](_0x4c6a('0xe5'),_0x4d0fd5['toUpperCase']()),_0x2a9d25[_0x4d0fd5]);}}this[_0x4c6a('0x4b')](_0x2a9d25[_0x4c6a('0xe6')],'out');return this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0xe7'),_0x2a9d25[_0x4c6a('0xe6')]));}return this['channel'][_0x4c6a('0x34')](_0x1d6758,_0x4c6a('0xe8'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0xe9')]=function(_0x163596){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('Enter\x20in\x20SESTEKNDA\x20(%s)\x20block',_0x163596['label']));if(!this[_0x4c6a('0xb1')](_0x163596['ndauth_url'])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0xea'));}if(!this[_0x4c6a('0xb1')](_0x163596[_0x4c6a('0xeb')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xec'));}if(!this[_0x4c6a('0xb1')](_0x163596[_0x4c6a('0xed')])){return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0xee'));}if(!this['isConfigured'](_0x163596[_0x4c6a('0xef')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20text\x20configured');}this[_0x4c6a('0x3f')][_0x4c6a('0xe3')]=!![];this['createSquareDetailsReport'](_0x163596);this[_0x4c6a('0x4b')](_0x163596['text'],'in');this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0xf0'),_0x163596[_0x4c6a('0x67')]));var _0x48dbd8=this[_0x4c6a('0x85')][_0x4c6a('0x79')](this,_0x163596);if(_0x48dbd8){for(var _0x4ddf6 in _0x48dbd8){if(_0x48dbd8[_0x4c6a('0x9c')](_0x4ddf6)){this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util[_0x4c6a('0x30')](_0x4c6a('0xf1'),_0x4ddf6[_0x4c6a('0x73')]()),_0x48dbd8[_0x4ddf6]);}}this[_0x4c6a('0x4b')](_0x48dbd8[_0x4c6a('0xe6')],_0x4c6a('0xf2'));if(_0x48dbd8['audiofile']){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0xf3'),_0x48dbd8['audiofile']));var _0x4bb04c=this[_0x4c6a('0x3f')]['streamFile'](_0x48dbd8[_0x4c6a('0xf4')]);try{fs[_0x4c6a('0xf5')](_0x48dbd8['audiofile']+_0x4c6a('0xf6'));}catch(_0x50293d){logger[_0x4c6a('0x34')](_0x50293d);}return _0x4bb04c;}else{return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format']('SestekNDA\x20Result\x20%s',_0x48dbd8[_0x4c6a('0xe6')]));}}return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x163596,_0x4c6a('0xf7'));};AGIVertices['prototype'][_0x4c6a('0xf8')]=function(_0x33b251){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0xf9'),_0x33b251[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xf8'));};AGIVertices['prototype'][_0x4c6a('0xfa')]=function(_0x286a1c){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0xfb'),_0x286a1c['label']));var _0x584bd7='';if(_0x286a1c[_0x4c6a('0xfc')]){if(!this[_0x4c6a('0xb1')](_0x286a1c[_0x4c6a('0xfc')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x286a1c,_0x4c6a('0xfd'));}else{var _0x147b09=parseInt(_0x286a1c[_0x4c6a('0xfc')],0xa);if(isNaN(_0x147b09)){_0x584bd7=_0x286a1c[_0x4c6a('0xfc')];}else{_0x584bd7=this[_0x4c6a('0x23')][_0x4c6a('0x79')](this,_0x286a1c[_0x4c6a('0xfc')]);if(!_0x584bd7){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x286a1c,_0x4c6a('0xfe'));}}}}else if(_0x286a1c[_0x4c6a('0xff')]){_0x584bd7=_0x286a1c[_0x4c6a('0xff')];}else{return this[_0x4c6a('0x3f')]['error'](_0x286a1c,_0x4c6a('0xfd'));}var _0x42a6b9=this[_0x4c6a('0x3f')][_0x4c6a('0x62')](_0x4c6a('0xe0'),[util['format']('SIP/%s/%s',_0x584bd7,_0x286a1c[_0x4c6a('0xb4')]),_0x286a1c[_0x4c6a('0x70')],_0x286a1c[_0x4c6a('0xde')],_0x286a1c['url']]);if(_0x42a6b9[_0x4c6a('0xa9')]===-0x1){return _0x42a6b9;}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0xdf'),'DIAL'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x100')]=function(_0x5139c4){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x101'),_0x5139c4[_0x4c6a('0xaf')]));return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x100'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x11')]=function(_0x3e0ec9){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x102'),_0x3e0ec9['label']));if(_0x3e0ec9[_0x4c6a('0xac')]===0x0){return this[_0x4c6a('0xab')](_0x3e0ec9);}_0x3e0ec9[_0x4c6a('0xac')]-=0x1;if(!this['isConfigured'](_0x3e0ec9['file_id'])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3e0ec9,_0x4c6a('0x103'));}var _0x141d40=this[_0x4c6a('0x25')][_0x4c6a('0x79')](this,_0x3e0ec9['file_id']);if(!_0x141d40){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3e0ec9,_0x4c6a('0x104'));}if(!this['isConfigured'](_0x3e0ec9[_0x4c6a('0xd2')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x4698dc=this[_0x4c6a('0x3f')]['getData'](_0x141d40,_0x3e0ec9[_0x4c6a('0x105')],_0x3e0ec9[_0x4c6a('0x106')]);var _0x40d494=_0x4698dc['result']?_0x4698dc[_0x4c6a('0xa9')][_0x4c6a('0x56')]():'';logger[_0x4c6a('0x36')]('test',JSON[_0x4c6a('0x7c')](_0x4698dc));if(_0x4698dc[_0x4c6a('0xa9')]===-0x1){this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x3e0ec9,_0x40d494);return _0x4698dc;}else if(_0x4698dc[_0x4c6a('0xa7')]===_0x4c6a('0x70')){_0x4698dc[_0x4c6a('0xa9')]=_0x40d494['length']>=parseInt(_0x3e0ec9[_0x4c6a('0x107')])?'x':'i';}else{_0x4698dc[_0x4c6a('0xa9')]=_0x40d494[_0x4c6a('0xa1')]>=parseInt(_0x3e0ec9[_0x4c6a('0x107')])&&_0x40d494[_0x4c6a('0xa1')]<=parseInt(_0x3e0ec9[_0x4c6a('0x106')])?'x':'i';}var _0x2c6b8f=this[_0x4c6a('0x16')]['sync'](this,_0x3e0ec9['variable_id']);if(!_0x2c6b8f){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3e0ec9,_0x4c6a('0xd3'));}this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](_0x2c6b8f,_0x40d494);if(this[_0x4c6a('0xb1')](_0x3e0ec9[_0x4c6a('0x108')])){var _0x180c58=parseInt(_0x3e0ec9[_0x4c6a('0x108')],0xa);var _0x39cbbb=rs[_0x4c6a('0x109')]({'charset':'*','length':_0x180c58});var _0x6e90ee=_0x40d494[_0x4c6a('0xa1')];if(_0x6e90ee>0x0){if(_0x6e90ee>_0x180c58){this[_0x4c6a('0x3e')]['sync'](this,_0x3e0ec9,_0x3e0ec9[_0x4c6a('0x10a')]===_0x4c6a('0x10b')?_0x39cbbb+_0x40d494[_0x4c6a('0x10c')](_0x180c58):_0x40d494[_0x4c6a('0x10c')](0x0,_0x6e90ee-_0x180c58)+_0x39cbbb);}else{this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x3e0ec9,rs[_0x4c6a('0x109')]({'charset':'*','length':_0x6e90ee}));}}else{this[_0x4c6a('0x3e')]['sync'](this,_0x3e0ec9,'');}}else{this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x3e0ec9,_0x40d494);}return _0x4698dc;};AGIVertices['prototype']['getsecretdigits']=function(_0x216273){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x10d'),_0x216273[_0x4c6a('0xaf')]));return this[_0x4c6a('0x11')](_0x216273);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x10e')]=function(_0x3944bb){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x10f'),_0x3944bb[_0x4c6a('0xaf')]));this['createSquareDetailsReport'][_0x4c6a('0x79')](this,_0x3944bb,_0x3944bb[_0x4c6a('0x110')]);return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x111'),_0x3944bb['goalname']));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x112')]=function(_0x1d5636){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x113'),_0x1d5636[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x1d5636[_0x4c6a('0x8d')])||!this[_0x4c6a('0xb1')](_0x1d5636['aws_secret_access_key'])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x114'));}if(!this['isConfigured'](_0x1d5636[_0x4c6a('0x67')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xb9'));}this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x115'),_0x1d5636[_0x4c6a('0x67')]));var _0x41564d=this[_0x4c6a('0x8c')]['sync'](this,_0x1d5636);if(_0x41564d){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x116'),_0x41564d));var _0x479604=this[_0x4c6a('0x3f')]['streamFile'](_0x41564d);try{fs[_0x4c6a('0xf5')](_0x41564d+'.wav');}catch(_0x225085){logger['error'](_0x225085);}return _0x479604;}return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x1d5636,_0x4c6a('0x117'));};AGIVertices['prototype'][_0x4c6a('0x118')]=function(_0x520043){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x119'),_0x520043[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x520043[_0x4c6a('0x8d')])||!this[_0x4c6a('0xb1')](_0x520043[_0x4c6a('0x8e')])){return this[_0x4c6a('0x3f')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this[_0x4c6a('0xb1')](_0x520043['aws_bot_name'])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x11a'));}if(!this['isConfigured'](_0x520043[_0x4c6a('0x67')])){return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0xb9'));}this[_0x4c6a('0x3f')][_0x4c6a('0xe3')]=!![];this[_0x4c6a('0x3e')](_0x520043);this['createSquareMessage'](_0x520043[_0x4c6a('0x67')],'in');this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')]('Trying\x20Amazon\x20Lex:\x20%s',_0x520043[_0x4c6a('0x67')]));var _0x7d4049=this[_0x4c6a('0x92')]['sync'](this,_0x520043);if(_0x7d4049){for(var _0xb2d38b in _0x7d4049){if(_0x7d4049[_0x4c6a('0x9c')](_0xb2d38b)&&_['isString'](_0x7d4049[_0xb2d38b])){this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util['format'](_0x4c6a('0x11b'),_0xb2d38b[_0x4c6a('0x73')]()),_0x7d4049[_0xb2d38b]);}}if(_[_0x4c6a('0x4d')](_0x7d4049[_0x4c6a('0x7f')])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x11c'));}else{this[_0x4c6a('0x4b')](_0x7d4049[_0x4c6a('0x7f')],'out');return this['channel'][_0x4c6a('0xbc')](util['format'](_0x4c6a('0x11d'),_0x7d4049[_0x4c6a('0x7f')]));}}return this['channel'][_0x4c6a('0x34')](_0x520043,_0x4c6a('0x11e'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x11f')]=function(_0x3c0be3){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x120'),_0x3c0be3[_0x4c6a('0xaf')],_0x3c0be3[_0x4c6a('0x70')]));if(!this[_0x4c6a('0xb1')](_0x3c0be3['key'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20key\x20configured');}var _0x2f95f2=_0x4c6a('0x121');var _0x5002f9=util['format']('%s/recordings/%s',FILES_PATH,rs['generate'](0x4));var _0x3e0866=util[_0x4c6a('0x30')]('%s.%s',_0x5002f9,_0x2f95f2);var _0x9acfc7=!![];if(_0x3c0be3[_0x4c6a('0x122')]===_0x4c6a('0x123')){_0x9acfc7=![];}var _0x1a9166=this['channel']['recordFile'](_0x5002f9,_0x2f95f2,_0x3c0be3[_0x4c6a('0x124')],_0x3c0be3['timeout'],undefined,_0x9acfc7);if(_0x1a9166[_0x4c6a('0xa9')]!==-0x1){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format'](_0x4c6a('0x125'),_0x3e0866));var _0x3059e1=this[_0x4c6a('0x94')][_0x4c6a('0x79')](this,_0x3c0be3,_0x3e0866);if(_0x3059e1){for(var _0x4992e0 in _0x3059e1){if(_0x3059e1['hasOwnProperty'](_0x4992e0)){this[_0x4c6a('0x3f')]['setVariable'](util[_0x4c6a('0x30')](_0x4c6a('0x126'),_0x4992e0[_0x4c6a('0x73')]()),_0x3059e1[_0x4992e0]);}}return this['channel']['noop'](util['format'](_0x4c6a('0x127'),JSON['stringify'](_0x3059e1)));}}return _0x1a9166;};AGIVertices[_0x4c6a('0x15')]['tildeasr']=function(_0x7e00c6){logger['info'](util['format'](_0x4c6a('0x128'),_0x7e00c6[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x7e00c6[_0x4c6a('0x97')])){return this['channel']['noop'](_0x4c6a('0x129'));}if(!this['isConfigured'](_0x7e00c6[_0x4c6a('0x98')])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x12a'));}var _0x15ce46=_0x4c6a('0x121');var _0x76746c=util[_0x4c6a('0x30')](_0x4c6a('0x12b'),FILES_PATH,rs[_0x4c6a('0x109')](0x4));var _0x45bff9=util['format']('%s.%s',_0x76746c,_0x15ce46);var _0x4b5eee=!![];if(_0x7e00c6['beep']===_0x4c6a('0x123')){_0x4b5eee=![];}var _0x5b2c6a=this[_0x4c6a('0x3f')][_0x4c6a('0x12c')](_0x76746c,_0x15ce46,_0x7e00c6[_0x4c6a('0x124')],_0x7e00c6[_0x4c6a('0x70')],undefined,_0x4b5eee);if(_0x5b2c6a[_0x4c6a('0xa9')]!==-0x1){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('tilde\x20%s\x20file\x20created',_0x45bff9));var _0x3a0e53=this[_0x4c6a('0x96')][_0x4c6a('0x79')](this,_0x7e00c6,_0x45bff9);if(_0x3a0e53){for(var _0x10fd5e in _0x3a0e53){if(_0x3a0e53[_0x4c6a('0x9c')](_0x10fd5e)){this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util['format']('TILDE_ASR_%s',_0x10fd5e[_0x4c6a('0x73')]()),_0x3a0e53[_0x10fd5e]);}}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x12d'),JSON[_0x4c6a('0x7c')](_0x3a0e53)));}}return _0x5b2c6a;};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x12e')]=function(_0x27c83a){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x12f'),_0x27c83a[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')][_0x4c6a('0x130')](_0x27c83a[_0x4c6a('0x46')],_0x27c83a[_0x4c6a('0x47')],_0x27c83a[_0x4c6a('0x131')]);};AGIVertices['prototype']['gotoif']=function(_0x3a4472){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x132'),_0x3a4472[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x3a4472[_0x4c6a('0x133')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3a4472,_0x4c6a('0x134'));}try{var _0x3e435a=eval(_0x3a4472[_0x4c6a('0x133')])?_0x4c6a('0x135'):_0x4c6a('0x136');this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')]('EVAL\x20CONDITION\x20%s\x20%s',_0x3a4472[_0x4c6a('0x133')],_0x3e435a));return{'code':0xc8,'result':_0x3e435a};}catch(_0x352d9c){return{'code':0xc8,'result':'false'};}};AGIVertices[_0x4c6a('0x15')]['gotoiftime']=function(_0x48fb03){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0x137'),_0x48fb03[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x48fb03[_0x4c6a('0x138')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x48fb03,_0x4c6a('0x139'));}var _0x6835dc=this[_0x4c6a('0x2a')][_0x4c6a('0x79')](this,_0x48fb03['interval_id']);if(!_0x6835dc){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x48fb03,_0x4c6a('0x13a'));}for(var _0x448da4=0x0;_0x448da4<_0x6835dc['length'];_0x448da4+=0x1){var _0x194737=this[_0x4c6a('0x3f')]['getVariable'](util[_0x4c6a('0x30')](_0x4c6a('0x13b'),_0x6835dc[_0x448da4]));if(_0x194737[_0x4c6a('0xa9')]===-0x1){return _0x194737;}logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x13c'),_0x6835dc[_0x448da4],_0x194737['extra']));if(_0x194737['extra']===_0x4c6a('0x135')){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x13c'),_0x6835dc[_0x448da4],_0x4c6a('0x135')));this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x13c'),_0x6835dc[_0x448da4],_0x4c6a('0x135')));return{'code':0xc8,'result':_0x4c6a('0x135')};}else{logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('IFTIME\x20%s\x20%s',_0x6835dc[_0x448da4],_0x4c6a('0x136')));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format'](_0x4c6a('0x13c'),_0x6835dc[_0x448da4],_0x4c6a('0x136')));}}return{'code':0xc8,'result':_0x4c6a('0x136')};};AGIVertices['prototype'][_0x4c6a('0x13d')]=function(_0x38081a){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0x13e'),_0x38081a[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')][_0x4c6a('0x13d')]();};AGIVertices[_0x4c6a('0x15')]['ispeechasr']=function(_0x3778ad){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x13f'),_0x3778ad[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x3778ad['key'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xe2'));}var _0x5d90b1='wav';var _0x34536e=util[_0x4c6a('0x30')](_0x4c6a('0x12b'),FILES_PATH,rs[_0x4c6a('0x109')](0x4));var _0xf5ddf3=util[_0x4c6a('0x30')](_0x4c6a('0xa3'),_0x34536e,_0x5d90b1);var _0x1bef54=!![];if(_0x3778ad[_0x4c6a('0x122')]===_0x4c6a('0x123')){_0x1bef54=![];}var _0x23d328=this[_0x4c6a('0x3f')][_0x4c6a('0x12c')](_0x34536e,_0x5d90b1,_0x3778ad[_0x4c6a('0x124')],_0x3778ad[_0x4c6a('0x70')],undefined,_0x1bef54);if(_0x23d328[_0x4c6a('0xa9')]!==-0x1){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('ispeech\x20%s\x20file\x20created',_0xf5ddf3));var _0x227e3c=this['ispeechASR'][_0x4c6a('0x79')](this,_0x3778ad,_0xf5ddf3);if(_0x227e3c){for(var _0x27f18a in _0x227e3c){if(_0x227e3c[_0x4c6a('0x9c')](_0x27f18a)){this[_0x4c6a('0x3f')]['setVariable'](util[_0x4c6a('0x30')](_0x4c6a('0x140'),_0x27f18a[_0x4c6a('0x73')]()),_0x227e3c[_0x27f18a]);}}return this['channel']['noop'](util[_0x4c6a('0x30')](_0x4c6a('0x141'),JSON[_0x4c6a('0x7c')](_0x227e3c)));}}return _0x23d328;};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x142')]=function(_0x515b29){logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x143'),_0x515b29[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x515b29[_0x4c6a('0x83')])){return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0xe2'));}if(!this['isConfigured'](_0x515b29[_0x4c6a('0x67')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20text\x20configured');}this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Trying\x20ispeech\x20TTS\x20%s',_0x515b29[_0x4c6a('0x67')]));var _0x4e4842=this[_0x4c6a('0x86')][_0x4c6a('0x79')](this,_0x515b29);if(_0x4e4842){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x144'),_0x4e4842));var _0x13b62b=this[_0x4c6a('0x3f')]['streamFile'](_0x4e4842,_0x515b29[_0x4c6a('0x124')]);try{fs['unlink'](_0x4e4842+_0x4c6a('0xf6'));}catch(_0x4a2bb8){logger['error'](_0x4a2bb8);}return _0x13b62b;}return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x515b29,_0x4c6a('0x145'));};AGIVertices['prototype'][_0x4c6a('0x146')]=function(_0x33841f){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x147'),_0x33841f[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x33841f['findBy'])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x33841f,_0x4c6a('0x148'));}logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x149'),this[_0x4c6a('0x3f')]['callerid'],_0x33841f['findBy']));var _0x153283=this[_0x4c6a('0x5d')]['sync'](this,_0x33841f[_0x4c6a('0x14a')]);if(_0x153283){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4c6a('0x3f')]['callerid'],_0x33841f['findBy']));this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('AGENT\x20%s\x20FOUND\x20BY',this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x33841f[_0x4c6a('0x14a')]));return{'code':0xc8,'result':_0x4c6a('0x14b')};}else{logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x14c'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x33841f[_0x4c6a('0x14a')]));this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x14c'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x33841f[_0x4c6a('0x14a')]));return{'code':0xc8,'result':_0x4c6a('0x14d')};}};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x14e')]=function(_0x5f1154){logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x14f'),_0x5f1154[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x5f1154[_0x4c6a('0x14a')])){return this[_0x4c6a('0x3f')]['error'](_0x5f1154,_0x4c6a('0x148'));}logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x149'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x5f1154[_0x4c6a('0x14a')]));var _0x4e1318=this[_0x4c6a('0x5c')][_0x4c6a('0x79')](this,_0x5f1154[_0x4c6a('0x14a')]);if(_0x4e1318){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this['channel'][_0x4c6a('0x43')],_0x5f1154[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this[_0x4c6a('0x3f')]['callerid'],_0x5f1154[_0x4c6a('0x14a')]));return{'code':0xc8,'result':_0x4c6a('0x14b')};}else{logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x14c'),this['channel'][_0x4c6a('0x43')],_0x5f1154[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0x4c6a('0x3f')]['callerid'],_0x5f1154[_0x4c6a('0x14a')]));return{'code':0xc8,'result':_0x4c6a('0x14d')};}};AGIVertices[_0x4c6a('0x15')]['math']=function(_0x3c959f){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x3c959f[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x3c959f[_0x4c6a('0x151')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3c959f,'no\x20operation\x20configured');}this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x152'),_0x3c959f['operation']));var _0x53d14a=eval(_0x3c959f[_0x4c6a('0x151')]);if(!this['isConfigured'](_0x3c959f[_0x4c6a('0xd2')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20variable\x20selected\x20for\x20the\x20result');}var _0x1758af=this['getVariable'][_0x4c6a('0x79')](this,_0x3c959f[_0x4c6a('0xd2')]);if(!_0x1758af){return this['channel'][_0x4c6a('0x34')](_0x3c959f,'no\x20variable\x20found');}if(_[_0x4c6a('0x153')](_0x53d14a)){var _0x32ecce=this;_0x53d14a['forEach'](function(_0x10035c,_0xe6a71f){_0x32ecce[_0x4c6a('0x3f')][_0x4c6a('0xa4')](util[_0x4c6a('0x30')](_0x4c6a('0x154'),_0x1758af,_0xe6a71f),_0x10035c);});return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util['format'](_0x4c6a('0x155'),_0x1758af));}else{return this['channel'][_0x4c6a('0xa4')](_0x1758af,_0x53d14a);}};AGIVertices['prototype'][_0x4c6a('0x10')]=function(_0x1285a1){logger['info'](util['format'](_0x4c6a('0x156'),_0x1285a1[_0x4c6a('0xaf')]));if(_0x1285a1['retry']===0x0){return this['maxRetry'](_0x1285a1);}_0x1285a1['retry']-=0x1;if(!this[_0x4c6a('0xb1')](_0x1285a1['file_id'])){return this[_0x4c6a('0x3f')]['error'](_0x1285a1,_0x4c6a('0x103'));}var _0x399a78=this[_0x4c6a('0x25')][_0x4c6a('0x79')](this,_0x1285a1[_0x4c6a('0x157')]);if(!_0x399a78){return this['channel']['error'](_0x1285a1,'no\x20file\x20audio\x20found');}var _0x26c44a=this[_0x4c6a('0x3f')][_0x4c6a('0x158')](_0x399a78,_0x1285a1[_0x4c6a('0x105')],_0x1285a1[_0x4c6a('0x159')]);var _0x491778=_0x26c44a['result'];if(_0x26c44a[_0x4c6a('0xa9')]===-0x1){this[_0x4c6a('0x3e')]['sync'](this,_0x1285a1,'-1');return _0x26c44a;}else if(_0x26c44a['extra']===_0x4c6a('0x70')){_0x26c44a[_0x4c6a('0xa9')]=_0x26c44a['result']['length']>0x0?_0x26c44a['result']:'t';}else if(_[_0x4c6a('0x50')](_0x26c44a[_0x4c6a('0xa9')])){_0x26c44a[_0x4c6a('0xa9')]='#';_0x491778='#';}if(!this[_0x4c6a('0xb1')](_0x1285a1[_0x4c6a('0xd2')])){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0x15a'));}else{var _0xefa3d5=this[_0x4c6a('0x16')][_0x4c6a('0x79')](this,_0x1285a1[_0x4c6a('0xd2')]);if(!_0xefa3d5){return this[_0x4c6a('0x3f')]['error'](_0x1285a1,_0x4c6a('0xd3'));}this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](_0xefa3d5,_0x491778);}this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x1285a1,_0x491778);return _0x26c44a;};AGIVertices[_0x4c6a('0x15')]['noop']=function(_0x5c86cc){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x15b'),_0x5c86cc[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x5c86cc[_0x4c6a('0x15c')]||_0x5c86cc[_0x4c6a('0xaf')]);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x15d')]=function(_0x51b7b8){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x15e'),_0x51b7b8[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x51b7b8['findBy'])){return this['channel'][_0x4c6a('0x34')](_0x51b7b8,'no\x20find\x20by\x20configured');}logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x51b7b8[_0x4c6a('0x14a')]));var _0x61aae5=this[_0x4c6a('0x15f')]['sync'](this,_0x51b7b8['pause_id']);var _0x2ace2e=this[_0x4c6a('0x59')][_0x4c6a('0x79')](this,_0x51b7b8['findBy'],_0x61aae5);if(_0x2ace2e){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this['channel'][_0x4c6a('0x43')],_0x51b7b8[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x51b7b8[_0x4c6a('0x14a')]));return{'code':0xc8,'result':_0x4c6a('0x14b')};}else{logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x14c'),this[_0x4c6a('0x3f')]['callerid'],_0x51b7b8[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x51b7b8['findBy']));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x160')]=function(_0x4aabe7){logger[_0x4c6a('0x36')](util['format']('Enter\x20in\x20PLAYBACK\x20(%s)\x20block',_0x4aabe7[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x4aabe7[_0x4c6a('0x157')])){return this['channel'][_0x4c6a('0x34')](_0x4aabe7,_0x4c6a('0x103'));}var _0x1d772a=this[_0x4c6a('0x25')][_0x4c6a('0x79')](this,_0x4aabe7[_0x4c6a('0x157')]);if(!_0x1d772a){return this[_0x4c6a('0x3f')]['error'](_0x4aabe7,_0x4c6a('0x104'));}var _0x4a3621=this[_0x4c6a('0x3f')]['exec'](_0x4c6a('0x161'),[_0x1d772a,_0x4aabe7[_0x4c6a('0xde')]]);if(_0x4a3621[_0x4c6a('0xa9')]===-0x1){return _0x4a3621;}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Executed\x20command\x20%s\x20%s',_0x4c6a('0x161'),_0x1d772a));};AGIVertices[_0x4c6a('0x15')]['queue']=function(_0x3addeb){logger['info'](util[_0x4c6a('0x30')](_0x4c6a('0x162'),_0x3addeb[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x3addeb['queue_id'])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3addeb,_0x4c6a('0x163'));}var _0x32886d='';var _0x3012e6=parseInt(_0x3addeb[_0x4c6a('0x164')],0xa);if(isNaN(_0x3012e6)){_0x32886d=_0x3addeb[_0x4c6a('0x164')];}else{_0x32886d=this[_0x4c6a('0x1a')][_0x4c6a('0x79')](this,_0x3addeb[_0x4c6a('0x164')]);if(!_0x32886d){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x3addeb,_0x4c6a('0x165'));}}var _0x29d743='';if(this['isConfigured'](_0x3addeb[_0x4c6a('0x157')])){var _0x176406=this[_0x4c6a('0x25')][_0x4c6a('0x79')](this,_0x3addeb[_0x4c6a('0x157')]);if(_0x176406){_0x29d743=_0x176406;}}this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x3addeb,_0x32886d);if(_0x3addeb[_0x4c6a('0xde')][_0x4c6a('0x166')]('x')<0x0){_0x3addeb[_0x4c6a('0xde')]+='x';}if(_0x3addeb['opts']['indexOf']('X')<0x0){_0x3addeb[_0x4c6a('0xde')]+='X';}this['channel'][_0x4c6a('0xa4')](_0x4c6a('0x167'),_0x32886d?_0x32886d['toLowerCase']():'');var _0x479080=this[_0x4c6a('0x3f')]['exec'](_0x4c6a('0x168'),[_0x32886d,_0x3addeb[_0x4c6a('0xde')],_0x3addeb[_0x4c6a('0x7a')],_0x29d743,_0x3addeb[_0x4c6a('0x70')],_0x3addeb['agi'],_0x3addeb[_0x4c6a('0x169')],_0x3addeb['gosub'],'',_0x3addeb[_0x4c6a('0x16a')]]);if(_0x479080['result']===-0x1){return _0x479080;}return this['channel'][_0x4c6a('0xbc')](util['format']('Executed\x20command\x20%s\x20%s','QUEUE',_0x32886d));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x16b')]=function(_0x3e9b96){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x16c'),_0x3e9b96[_0x4c6a('0xaf')]));var _0x4807d5=_0x3e9b96['recordingFormat']||_0x4c6a('0x121');var _0x2b8eb0=util[_0x4c6a('0x30')]('%s_%s',this[_0x4c6a('0x3f')][_0x4c6a('0x40')],rs['generate'](0x5));var _0x1a4c39=util[_0x4c6a('0x30')](_0x4c6a('0x16d'),FILES_PATH,_0x2b8eb0,_0x4807d5);var _0x2493e7=util[_0x4c6a('0x30')](_0x4c6a('0x12b'),FILES_PATH,_0x2b8eb0);this[_0x4c6a('0x44')]['sync'](this,_0x3e9b96,_0x2b8eb0,_0x1a4c39);this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](_0x4c6a('0x16e'),_0x2b8eb0);logger[_0x4c6a('0x36')](_0x4c6a('0x16f'),_0x2493e7,_0x4807d5,_0x3e9b96[_0x4c6a('0x170')],_0x3e9b96[_0x4c6a('0x70')]);return this['channel'][_0x4c6a('0x12c')](_0x2493e7,_0x4807d5,_0x3e9b96[_0x4c6a('0x170')],_0x3e9b96[_0x4c6a('0x70')],undefined,!![]);};AGIVertices['prototype'][_0x4c6a('0x171')]=function(_0xe3b91d){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x172'),_0xe3b91d['label']));if(!this[_0x4c6a('0xb1')](_0xe3b91d['url'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20url\x20configured');}var _0xe7f7ee=this['restAPI']['sync'](this,_0xe3b91d);logger[_0x4c6a('0x36')](util['format'](_0x4c6a('0x173'),util[_0x4c6a('0x174')](_0xe7f7ee,{'showHidden':![],'depth':null})));if(!this[_0x4c6a('0xb1')](_0xe3b91d['variable_id'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x3b7bb2=this[_0x4c6a('0x16')][_0x4c6a('0x79')](this,_0xe3b91d[_0x4c6a('0xd2')]);if(!_0x3b7bb2){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0xe3b91d,_0x4c6a('0xd3'));}this['channel'][_0x4c6a('0xa4')](util[_0x4c6a('0x30')](_0x4c6a('0x175'),_0x3b7bb2),_0xe7f7ee[_0x4c6a('0x176')]?_0xe7f7ee['statusCode']:_0x4c6a('0x177'));this[_0x4c6a('0x3f')]['setVariable'](util['format']('%s_STATUS_MESSAGE',_0x3b7bb2),_0xe7f7ee['statusMessage']?_0xe7f7ee[_0x4c6a('0x7e')]:'OK');if(_0xe7f7ee[_0x4c6a('0x74')]){try{this[_0x4c6a('0xa2')](_0xe7f7ee[_0x4c6a('0x74')],_0x3b7bb2);}catch(_0x52ec8e){logger[_0x4c6a('0x34')](util[_0x4c6a('0x30')](_0x4c6a('0x178'),_0x3b7bb2));}}return this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0x179'),_0x3b7bb2));};AGIVertices[_0x4c6a('0x15')]['saydigits']=function(_0x2c35e6){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x17a'),_0x2c35e6[_0x4c6a('0xaf')]));return this['channel'][_0x4c6a('0x17b')](_0x2c35e6[_0x4c6a('0x17c')][_0x4c6a('0x63')](/\s+/g,''),_0x2c35e6[_0x4c6a('0x170')]);};AGIVertices['prototype'][_0x4c6a('0x17d')]=function(_0x33abad){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x17e'),_0x33abad[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')]['sayNumber'](_0x33abad[_0x4c6a('0x17f')][_0x4c6a('0x63')](/\s+/g,''),_0x33abad[_0x4c6a('0x170')]);};AGIVertices['prototype'][_0x4c6a('0x180')]=function(_0x36f5a1){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x36f5a1[_0x4c6a('0xaf')]));return this[_0x4c6a('0x3f')][_0x4c6a('0x181')](_0x36f5a1[_0x4c6a('0x67')],_0x36f5a1[_0x4c6a('0x170')]);};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x182')]=function(_0x3d0cd3){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x183'),_0x3d0cd3['label']));if(!this[_0x4c6a('0xb1')](_0x3d0cd3['account_id'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20mail\x20account\x20configured');}var _0x2926d4=this[_0x4c6a('0x28')][_0x4c6a('0x79')](this,_0x3d0cd3[_0x4c6a('0x184')]);if(!_0x2926d4||!_0x2926d4['Smtp']){return this[_0x4c6a('0x3f')]['error'](_0x3d0cd3,_0x4c6a('0x185'));}var _0x54d2f9={'from':util[_0x4c6a('0x30')](_0x4c6a('0x186'),_0x2926d4[_0x4c6a('0x1b')],_0x2926d4[_0x4c6a('0x187')]||_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x189')]),'to':_0x3d0cd3['to']||'','cc':_0x3d0cd3['cc']||'','bcc':_0x3d0cd3[_0x4c6a('0x18a')]||'','subject':_0x3d0cd3[_0x4c6a('0x18b')],'html':_0x3d0cd3[_0x4c6a('0x67')],'text':_0x3d0cd3[_0x4c6a('0x67')]};var _0x7982ea={'tls':{'rejectUnauthorized':![]}};if(_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x18c')]){_0x7982ea[_0x4c6a('0x18c')]=_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x18c')];}else{_0x7982ea[_0x4c6a('0x18d')]=_0x2926d4['Smtp'][_0x4c6a('0x18d')];_0x7982ea[_0x4c6a('0x18e')]=_0x2926d4['Smtp'][_0x4c6a('0x18e')];_0x7982ea[_0x4c6a('0x18f')]=_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x18f')];}if(_0x2926d4[_0x4c6a('0x188')]['authentication']){_0x7982ea[_0x4c6a('0x190')]={'user':_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x189')],'pass':_0x2926d4[_0x4c6a('0x188')][_0x4c6a('0x191')]};}if(this[_0x4c6a('0xb1')](_0x3d0cd3['template_id'])){}logger[_0x4c6a('0xd9')](_0x4c6a('0x192'),JSON[_0x4c6a('0x7c')](_0x54d2f9));this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x3d0cd3,_0x3d0cd3['account_id']);this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x2926d4['name']));this['sendMailMessage'][_0x4c6a('0x79')](this,_0x7982ea,_0x54d2f9);return this['channel'][_0x4c6a('0xbc')](_0x4c6a('0x193'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x194')]=function(_0x38e9e3){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x195'),_0x38e9e3['label']));return this[_0x4c6a('0x3f')]['noop']('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0x4c6a('0x15')]['sendSMS']=function(_0x94557b){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x196'),_0x94557b['label']));if(!this['isConfigured'](_0x94557b[_0x4c6a('0x197')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')]('no\x20sms\x20account\x20configured');}var _0x435d2e=this[_0x4c6a('0x198')]['sync'](this,_0x94557b[_0x4c6a('0x197')]);if(!_0x435d2e){return this['channel'][_0x4c6a('0x34')](_0x94557b,_0x4c6a('0x199'));}var _0x7047e7={'body':_0x94557b[_0x4c6a('0x19a')],'phone':_0x94557b['to']||'','SmsAccountId':_0x435d2e['id']};logger['debug']('sendSMS\x20message',JSON[_0x4c6a('0x7c')](_0x7047e7));this[_0x4c6a('0x3e')][_0x4c6a('0x79')](this,_0x94557b,_0x94557b[_0x4c6a('0x197')]);this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Trying\x20SendSMS\x20with\x20account\x20%s',_0x435d2e[_0x4c6a('0x1b')]));this[_0x4c6a('0x3d')][_0x4c6a('0x79')](this,_0x7047e7);return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0x19b'));};AGIVertices[_0x4c6a('0x15')]['set']=function(_0x3b1254){logger['info'](util[_0x4c6a('0x30')]('Enter\x20in\x20SET\x20(%s)\x20block',_0x3b1254[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x3b1254['variable_id'])){return this['channel'][_0x4c6a('0x34')](_0x3b1254,_0x4c6a('0x19c'));}var _0xcf808e=this[_0x4c6a('0x16')][_0x4c6a('0x79')](this,_0x3b1254[_0x4c6a('0xd2')]);if(!_0xcf808e){return this['channel']['error'](_0x3b1254,_0x4c6a('0xd3'));}return this[_0x4c6a('0x3f')][_0x4c6a('0xa4')](_0xcf808e,_0x3b1254['variable_value']);};AGIVertices[_0x4c6a('0x15')]['start']=function(_0x335336){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x19d'),_0x335336[_0x4c6a('0xaf')]));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0x19e'));if(_0x335336['answer']===_0x4c6a('0x19f')){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0x1a0'));return this[_0x4c6a('0x3f')][_0x4c6a('0xae')]();}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0x1a1'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1a2')]=function(_0x262047){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x1a3'),_0x262047[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x262047[_0x4c6a('0x1a4')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x262047,'no\x20subproject\x20selected');}var _0x3ab3a4=this[_0x4c6a('0x1c')][_0x4c6a('0x79')](this,_0x262047['project_id']);if(!this['isConfigured'](_0x3ab3a4)){return this['channel']['error'](_0x262047,util[_0x4c6a('0x30')](_0x4c6a('0x1a5'),_0x262047[_0x4c6a('0x1a4')]));}if(_0x3ab3a4===this[_0x4c6a('0x3f')][_0x4c6a('0x42')]){return this[_0x4c6a('0x3f')]['error'](_0x262047,_0x4c6a('0x1a6'));}this['createSquareDetailsReport'][_0x4c6a('0x79')](this,_0x262047,_0x3ab3a4);var _0x3eb064=this['channel'][_0x4c6a('0x62')]('AGI',util[_0x4c6a('0x30')]('agi://%s/square,\x22%s\x22,\x22%s\x22',config['agi'][_0x4c6a('0x18d')]||_0x4c6a('0x1a7'),_0x3ab3a4,this[_0x4c6a('0x3f')][_0x4c6a('0x42')]));if(_0x3eb064[_0x4c6a('0xa9')]===-0x1){return _0x3eb064;}return this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Executed\x20command\x20%s\x20%s',_0x4c6a('0x1a8'),_0x3ab3a4));};AGIVertices['prototype'][_0x4c6a('0x1a9')]=function(_0x26bf81){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x26bf81[_0x4c6a('0xaf')]));var _0xe49b49=this[_0x4c6a('0x61')][_0x4c6a('0x79')](this,_0x26bf81[_0x4c6a('0x1aa')]);this[_0x4c6a('0x3e')]['sync'](this,_0x26bf81,_0x26bf81[_0x4c6a('0x1aa')]);if(this['isConfigured'](_0x26bf81[_0x4c6a('0xd2')])){var _0x3bd561=this['getVariable'][_0x4c6a('0x79')](this,_0x26bf81[_0x4c6a('0xd2')]);if(_0x3bd561){this[_0x4c6a('0x3f')]['setVariable'](_0x3bd561,_0xe49b49);return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x1ab'),_0x26bf81['command'],_0x3bd561));}}return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x1ac'),_0x26bf81['command']));};AGIVertices['prototype'][_0x4c6a('0x1ad')]=function(_0x2cf409){logger[_0x4c6a('0x36')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0x2cf409[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x2cf409[_0x4c6a('0x65')])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0x1ae'));}if(!this['isConfigured'](_0x2cf409['text'])){return this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](_0x4c6a('0xb9'));}this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x2cf409[_0x4c6a('0x67')]));var _0x594a89=this[_0x4c6a('0x64')][_0x4c6a('0x79')](this,_0x2cf409);if(_0x594a89){this['channel']['noop'](util[_0x4c6a('0x30')](_0x4c6a('0x1af'),_0x594a89));var _0x7b50e0=this[_0x4c6a('0x3f')][_0x4c6a('0x1b0')](_0x594a89);try{fs[_0x4c6a('0xf5')](_0x594a89+'.wav');}catch(_0x379a78){logger['error'](_0x379a78);}return _0x7b50e0;}return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x2cf409,_0x4c6a('0x1b1'));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1b2')]=function(_0x248c9b){logger['info'](util['format']('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x248c9b[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x248c9b['text'])){return this[_0x4c6a('0x3f')]['noop'](_0x4c6a('0xb9'));}this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x1b3'),_0x248c9b[_0x4c6a('0x67')]));var _0x53a408=this[_0x4c6a('0x6d')][_0x4c6a('0x79')](this,_0x248c9b);if(_0x53a408){this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')]('Google\x20TTS\x20%s\x20file\x20created',_0x53a408));var _0x5a14a5=this[_0x4c6a('0x3f')]['streamFile'](_0x53a408);try{fs[_0x4c6a('0xf5')](_0x53a408+'.wav');}catch(_0x8b4161){logger[_0x4c6a('0x34')](_0x8b4161);}return _0x5a14a5;}return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x248c9b,_0x4c6a('0x1b4'));};AGIVertices['prototype'][_0x4c6a('0x1b5')]=function(_0x593755){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x1b6'),_0x593755[_0x4c6a('0xaf')]));if(!this[_0x4c6a('0xb1')](_0x593755[_0x4c6a('0x14a')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x593755,'no\x20find\x20by\x20configured');}logger['info'](util[_0x4c6a('0x30')]('FIND\x20AGENT\x20%s\x20BY\x20%s',this['channel'][_0x4c6a('0x43')],_0x593755[_0x4c6a('0x14a')]));var _0x18b182=this[_0x4c6a('0x5b')][_0x4c6a('0x79')](this,_0x593755[_0x4c6a('0x14a')]);if(_0x18b182){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this['channel']['callerid'],_0x593755[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')]['noop'](util[_0x4c6a('0x30')](_0x4c6a('0x150'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x593755['findBy']));return{'code':0xc8,'result':_0x4c6a('0x14b')};}else{logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x14c'),this[_0x4c6a('0x3f')][_0x4c6a('0x43')],_0x593755[_0x4c6a('0x14a')]));this[_0x4c6a('0x3f')][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0x14c'),this[_0x4c6a('0x3f')]['callerid'],_0x593755[_0x4c6a('0x14a')]));return{'code':0xc8,'result':'failure'};}};AGIVertices['prototype']['voicemail']=function(_0x4b0672){logger[_0x4c6a('0x36')](util[_0x4c6a('0x30')](_0x4c6a('0x1b7'),_0x4b0672[_0x4c6a('0xaf')]));var _0x3eb87a=this[_0x4c6a('0x3f')]['exec'](_0x4c6a('0x1b8'),[_0x4b0672[_0x4c6a('0x1b9')],_0x4b0672['options']]);if(_0x3eb87a[_0x4c6a('0xa9')]===-0x1){return _0x3eb87a;}return this['channel'][_0x4c6a('0xbc')](util[_0x4c6a('0x30')](_0x4c6a('0xb6'),_0x4c6a('0x1b8'),_0x4b0672[_0x4c6a('0x1b9')]));};AGIVertices[_0x4c6a('0x15')][_0x4c6a('0x1ba')]=function(_0x24fb0c){logger['info'](util['format']('Enter\x20in\x20SWITCH\x20(%s)\x20block',_0x24fb0c[_0x4c6a('0xaf')]));if(!this['isConfigured'](_0x24fb0c[_0x4c6a('0xd2')])){return this[_0x4c6a('0x3f')][_0x4c6a('0x34')](_0x24fb0c,'no\x20variable\x20selected');}var _0x7b690d=this['getVariable'][_0x4c6a('0x79')](this,_0x24fb0c['variable_id']);if(!_0x7b690d){return this['channel'][_0x4c6a('0x34')](_0x24fb0c,'no\x20variable\x20found');}var _0x15b9e4=this[_0x4c6a('0x3f')][_0x4c6a('0x16')](_0x7b690d);return{'code':0xc8,'result':_0x15b9e4[_0x4c6a('0xa7')]?_0x15b9e4[_0x4c6a('0xa7')]:'-'};};String[_0x4c6a('0x15')][_0x4c6a('0xa6')]=function(_0x4a2e46,_0x24c146){return this[_0x4c6a('0xa5')](_0x4a2e46)[_0x4c6a('0x1bb')](_0x24c146);};module[_0x4c6a('0x1bc')]=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index fb430d4..495d9a3 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 _0x8ef6=['milliseconds','diff','seconds','prototype','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','then','getAgent','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','acwTimeout','timer','lastPauseAt','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','update','info','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','finally','[ACW][START]\x20%s','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','message','syncAgentConnect','interface','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','startAcw','linkedid','isUndefined','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','autopause','all','Auto-Pause','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','acw','../rpc/user','voiceQueues','agents','timers','channels','agentconnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup','agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview'];(function(_0x50068c,_0x38a87a){var _0x11826a=function(_0x3bb53e){while(--_0x3bb53e){_0x50068c['push'](_0x50068c['shift']());}};_0x11826a(++_0x38a87a);}(_0x8ef6,0xf2));var _0x68ef=function(_0x5ba507,_0x567cff){_0x5ba507=_0x5ba507-0x0;var _0x345371=_0x8ef6[_0x5ba507];return _0x345371;};'use strict';var util=require(_0x68ef('0x0'));var _=require(_0x68ef('0x1'));var moment=require(_0x68ef('0x2'));var ami=require(_0x68ef('0x3'));var logger=require(_0x68ef('0x4'))(_0x68ef('0x5'));var RpcUser=require(_0x68ef('0x6'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x27d0af){this[_0x68ef('0x7')]=_0x27d0af[_0x68ef('0x7')];this[_0x68ef('0x8')]=_0x27d0af['agents'];this['timers']=_0x27d0af[_0x68ef('0x9')];this[_0x68ef('0xa')]={};ami['on'](_0x68ef('0xb'),this['syncAgentConnect'][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xd'),this[_0x68ef('0xe')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0xf'),this[_0x68ef('0x10')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x11'),this[_0x68ef('0x12')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x13'),this[_0x68ef('0x14')]['bind'](this));ami['on'](_0x68ef('0x15'),this[_0x68ef('0x16')][_0x68ef('0xc')](this));ami['on'](_0x68ef('0x17'),this[_0x68ef('0x18')][_0x68ef('0xc')](this));}function getDiff(_0x508671){var _0x3b48dd=moment()[_0x68ef('0x19')](0x0);var _0x2657c5=moment(_0x508671)['milliseconds'](0x0);return _0x3b48dd[_0x68ef('0x1a')](_0x2657c5,_0x68ef('0x1b'));}Acw[_0x68ef('0x1c')]['startAcw']=function(_0x35493d){try{var _0x37c4cc=this;var _0x3d1e90=this[_0x68ef('0xa')][_0x35493d]['interface'];var _0x2ada1c=this['channels'][_0x35493d]['queue'];var _0x2633c1=this[_0x68ef('0x7')][_0x2ada1c];var _0x4ade0d=![];var _0x527870=_0x68ef('0x1d');if(_0x2633c1[_0x68ef('0x1e')]){if(_0x2633c1[_0x68ef('0x1f')]['name']){_0x4ade0d=!![];_0x527870=_0x2633c1[_0x68ef('0x1f')][_0x68ef('0x20')];}}ami[_0x68ef('0x21')]({'action':'QueuePause','interface':_0x3d1e90,'paused':!![],'reason':_0x527870})[_0x68ef('0x22')](function(_0x3be4c0){if(_0x37c4cc['agents'][_0x3d1e90]){return RpcUser[_0x68ef('0x23')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90]['id'])[_0x68ef('0x22')](function(_0x5ddec7){if(_0x5ddec7&&!_0x5ddec7['voicePause']){logger['info'](_0x68ef('0x24'),_0x35493d,_0x3d1e90,_0x2ada1c);var _0x2023f2=_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x25')]&&_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]?_0x37c4cc[_0x68ef('0xa')][_0x35493d][_0x68ef('0x26')]:_0x35493d;return RpcUser[_0x68ef('0x27')](_0x37c4cc[_0x68ef('0x8')][_0x3d1e90],_0x527870,_0x2023f2)['then'](function(_0x178460){if(!_0x4ade0d){_0x37c4cc['timers'][_0x3d1e90]={};logger['info']('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')],_0x3d1e90,_0x2ada1c);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]=setTimeout(_0x37c4cc['stopAcw']['bind'](_0x37c4cc,_0x3d1e90),_0x37c4cc[_0x68ef('0x7')][_0x2ada1c][_0x68ef('0x28')]*0x3e8);_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2a')]=moment()[_0x68ef('0x2b')](_0x68ef('0x2c'));_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2d')]=_0x35493d;_0x37c4cc['timers'][_0x3d1e90][_0x68ef('0x2e')]=_0x2ada1c;_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x2f')]=function(){var _0x4c25aa=getDiff(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['lastPauseAt']);clearTimeout(_0x37c4cc[_0x68ef('0x9')][_0x3d1e90][_0x68ef('0x29')]);_0x37c4cc['timers'][_0x3d1e90]['timer']=![];RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x4c25aa},_0x37c4cc[_0x68ef('0x9')][_0x3d1e90]['uniqueid'],_0x3d1e90)[_0x68ef('0x22')](function(_0x8c0a06){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0x35493d,_0x4c25aa,_0x8c0a06);})['catch'](function(_0x2c8bd0){logger[_0x68ef('0x33')]('[%s][UPDATE][ERRORS:%s]',_0x35493d,_0x2c8bd0);});delete _0x37c4cc[_0x68ef('0x9')][_0x3d1e90];};}});}else{logger['info'](_0x68ef('0x34'),_0x35493d,_0x3d1e90,_0x2ada1c);}});}})[_0x68ef('0x35')](function(_0x4973c2){logger[_0x68ef('0x33')]('[%s][TIMER:%s][AGENT:%s][QUEUE:%s]',_0x35493d,_0x37c4cc[_0x68ef('0x7')][_0x2ada1c]['acwTimeout'],_0x3d1e90,_0x2ada1c);})[_0x68ef('0x36')](function(){delete _0x37c4cc[_0x68ef('0xa')][_0x35493d];});}catch(_0x798276){logger['error'](_0x68ef('0x37'),_0x798276['message']);}};Acw[_0x68ef('0x1c')]['stopAcw']=function(_0x474ffa){try{var _0x362ef1=this;if(_0x362ef1[_0x68ef('0x9')][_0x474ffa]){_0x362ef1[_0x68ef('0x9')][_0x474ffa][_0x68ef('0x29')]=![];var _0xefd1d=_0x362ef1['timers'][_0x474ffa][_0x68ef('0x2d')];var _0x15a6ab=_0x362ef1[_0x68ef('0x9')][_0x474ffa]['queue'];var _0x32eddd=_0x362ef1[_0x68ef('0x7')][_0x15a6ab][_0x68ef('0x28')];logger['info']('[TIMER][STOP][AGENT:%s]',_0x474ffa);RpcUser[_0x68ef('0x38')](this[_0x68ef('0x8')][_0x474ffa]);RpcVoiceAgentReport[_0x68ef('0x30')]({'acwtime':_0x32eddd,'agentacw':!![]},_0xefd1d,_0x474ffa)[_0x68ef('0x22')](function(_0x401459){logger[_0x68ef('0x31')](_0x68ef('0x32'),_0xefd1d,_0x32eddd,_0x401459);})['catch'](function(_0xaf7df1){logger[_0x68ef('0x33')](_0x68ef('0x39'),_0xefd1d,_0xaf7df1);});}else{logger[_0x68ef('0x33')]('[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer',_0x474ffa);if(_0x362ef1[_0x68ef('0x9')]){logger[_0x68ef('0x31')](_0x68ef('0x3a'),JSON[_0x68ef('0x3b')](_0x362ef1[_0x68ef('0x9')]));}}}catch(_0x3b00ea){logger['error'](_0x68ef('0x3c'),_0x3b00ea[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x3e')]=function(_0x449f3c){try{if(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]&&(this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]]['acw']||this[_0x68ef('0x7')][_0x449f3c[_0x68ef('0x2e')]][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x449f3c[_0x68ef('0x3f')]]){this[_0x68ef('0xa')][_0x449f3c[_0x68ef('0x2d')]]={'queue':_0x449f3c['queue'],'interface':_0x449f3c[_0x68ef('0x3f')],'destlinkedid':_0x449f3c['destlinkedid']};}}}catch(_0x13c088){logger[_0x68ef('0x33')](_0x68ef('0x40'),_0x13c088[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x18')]=function(_0x5a8231){try{if(this[_0x68ef('0x7')][_0x5a8231['queue']]&&(this[_0x68ef('0x7')][_0x5a8231[_0x68ef('0x2e')]][_0x68ef('0x5')]||this['voiceQueues'][_0x5a8231['queue']][_0x68ef('0x1e')])){if(this[_0x68ef('0x8')][_0x5a8231['interface']]){this['channels'][_0x5a8231['uniqueid']]={'queue':_0x5a8231[_0x68ef('0x2e')],'interface':_0x5a8231[_0x68ef('0x3f')]};}}}catch(_0x173fb7){logger[_0x68ef('0x33')](_0x68ef('0x41'),_0x173fb7['message']);}};Acw['prototype'][_0x68ef('0xe')]=function(_0x21f064){try{if(this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]]&&_['isUndefined'](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x2d')]][_0x68ef('0x25')])){logger[_0x68ef('0x31')]('[%s][HANGUP:UNIQUEID]',_0x21f064['uniqueid']);this[_0x68ef('0x42')](_0x21f064[_0x68ef('0x2d')]);}else if(this['channels'][_0x21f064[_0x68ef('0x43')]]&&_[_0x68ef('0x44')](this[_0x68ef('0xa')][_0x21f064[_0x68ef('0x43')]][_0x68ef('0x25')])){logger['info'](_0x68ef('0x45'),_0x21f064[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x21f064['linkedid']);}}catch(_0x8ef51b){logger[_0x68ef('0x33')](_0x68ef('0x46'),_0x8ef51b['message']);}};Acw[_0x68ef('0x1c')]['syncHangup']=function(_0x574573){try{if(this[_0x68ef('0xa')][_0x574573['uniqueid']]&&this[_0x68ef('0xa')][_0x574573[_0x68ef('0x2d')]][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x47'),_0x574573[_0x68ef('0x2d')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x2d')]);}else if(this[_0x68ef('0xa')][_0x574573[_0x68ef('0x43')]]&&this['channels'][_0x574573['linkedid']][_0x68ef('0x25')]){logger[_0x68ef('0x31')](_0x68ef('0x48'),_0x574573[_0x68ef('0x43')]);this[_0x68ef('0x42')](_0x574573[_0x68ef('0x43')]);}}catch(_0x15400c){logger[_0x68ef('0x33')](_0x68ef('0x49'),_0x15400c['message']);}};Acw['prototype'][_0x68ef('0x14')]=function(_0x5781c8){try{if(!_[_0x68ef('0x4a')](this['channels'][_0x5781c8[_0x68ef('0x4b')]])){this[_0x68ef('0x42')](_0x5781c8['transfereeuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']]){this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]]=this[_0x68ef('0xa')][_0x5781c8['secondtransfereruniqueid']];delete this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4c')]];}}else if(!_[_0x68ef('0x4a')](this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4d')]])){this[_0x68ef('0x42')](_0x5781c8['transfertargetuniqueid']);if(this[_0x68ef('0xa')][_0x5781c8[_0x68ef('0x4e')]]){this['channels'][_0x5781c8[_0x68ef('0x4e')]][_0x68ef('0x25')]=!![];this[_0x68ef('0xa')][_0x5781c8['transfereeuniqueid']]=this[_0x68ef('0xa')][_0x5781c8['origtransfereruniqueid']];delete this['channels'][_0x5781c8[_0x68ef('0x4e')]];}}}catch(_0x540da5){logger[_0x68ef('0x33')]('[ACW][syncAttendedTransfer]\x20%s',_0x540da5[_0x68ef('0x3d')]);}};Acw[_0x68ef('0x1c')][_0x68ef('0x16')]=function(_0x3fbd39){try{if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x4f')]]){logger['info'](_0x68ef('0x50'),JSON['stringify'](_0x3fbd39[_0x68ef('0x4f')]));this['startAcw'](_0x3fbd39[_0x68ef('0x4f')]);}else if(this[_0x68ef('0xa')][_0x3fbd39[_0x68ef('0x51')]]){logger[_0x68ef('0x31')](_0x68ef('0x52'),JSON[_0x68ef('0x3b')](_0x3fbd39[_0x68ef('0x51')]));this['startAcw'](_0x3fbd39[_0x68ef('0x51')]);}}catch(_0x11bab3){logger[_0x68ef('0x33')](_0x68ef('0x53'),_0x11bab3[_0x68ef('0x3d')]);}};Acw['prototype'][_0x68ef('0x12')]=function(_0x561e8d){try{if(this[_0x68ef('0x7')][_0x561e8d['queue']]&&this['voiceQueues'][_0x561e8d[_0x68ef('0x2e')]][_0x68ef('0x54')]===_0x68ef('0x55')){if(this[_0x68ef('0x8')][_0x561e8d['interface']]){logger[_0x68ef('0x31')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x561e8d[_0x68ef('0x2d')],_0x561e8d[_0x68ef('0x3f')],_0x561e8d[_0x68ef('0x2e')]);return RpcUser['savePause'](this['agents'][_0x561e8d[_0x68ef('0x3f')]],_0x68ef('0x56'),_0x561e8d[_0x68ef('0x2d')]);}}}catch(_0x454c6f){logger['error'](_0x68ef('0x57'),_0x454c6f[_0x68ef('0x3d')]);}};module[_0x68ef('0x58')]=Acw; \ No newline at end of file +var _0x3e74=['acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','updateAcw','lastPauseAt','update','[%s][UPDATE][ACWTIME:%s]','catch','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','stringify','[ACW][STOP]\x20%s','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','message','attended','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','syncAgentRingNoAnswer','autopause','all','exports','util','moment','../ami','../../../config/logger','../rpc/voiceAgentReport','voiceQueues','agents','timers','channels','agentconnect','syncAgentConnect','bind','hanguprequest','agentringnoanswer','syncAttendedTransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','seconds','prototype','startAcw','interface','ACW','mandatoryDisposition','mandatoryDispositionPause','name','Action','QueuePause','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','timer'];(function(_0x335271,_0x5025f2){var _0xa9fff8=function(_0x28d0bd){while(--_0x28d0bd){_0x335271['push'](_0x335271['shift']());}};_0xa9fff8(++_0x5025f2);}(_0x3e74,0x175));var _0x43e7=function(_0x3a86a1,_0x459457){_0x3a86a1=_0x3a86a1-0x0;var _0x3204af=_0x3e74[_0x3a86a1];return _0x3204af;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var moment=require(_0x43e7('0x1'));var ami=require(_0x43e7('0x2'));var logger=require(_0x43e7('0x3'))('acw');var RpcUser=require('../rpc/user');var RpcVoiceAgentReport=require(_0x43e7('0x4'));function Acw(_0x4f9bbe){this[_0x43e7('0x5')]=_0x4f9bbe[_0x43e7('0x5')];this[_0x43e7('0x6')]=_0x4f9bbe[_0x43e7('0x6')];this[_0x43e7('0x7')]=_0x4f9bbe['timers'];this[_0x43e7('0x8')]={};ami['on'](_0x43e7('0x9'),this[_0x43e7('0xa')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xc'),this['syncHangupRequest'][_0x43e7('0xb')](this));ami['on']('hangup',this['syncHangup'][_0x43e7('0xb')](this));ami['on'](_0x43e7('0xd'),this['syncAgentRingNoAnswer'][_0x43e7('0xb')](this));ami['on']('attendedtransfer',this[_0x43e7('0xe')][_0x43e7('0xb')](this));ami['on']('blindtransfer',this[_0x43e7('0xf')][_0x43e7('0xb')](this));ami['on'](_0x43e7('0x10'),this[_0x43e7('0x11')]['bind'](this));}function getDiff(_0x583d85){var _0x2fcb36=moment()[_0x43e7('0x12')](0x0);var _0x44b0bd=moment(_0x583d85)['milliseconds'](0x0);return _0x2fcb36['diff'](_0x44b0bd,_0x43e7('0x13'));}Acw[_0x43e7('0x14')][_0x43e7('0x15')]=function(_0x328445){try{var _0x4de324=this;var _0x5c4eaa=this[_0x43e7('0x8')][_0x328445][_0x43e7('0x16')];var _0x273a32=this['channels'][_0x328445]['queue'];var _0x446986=this[_0x43e7('0x5')][_0x273a32];var _0x9037d3=![];var _0x140657=_0x43e7('0x17');if(_0x446986[_0x43e7('0x18')]){if(_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')]){_0x9037d3=!![];_0x140657=_0x446986[_0x43e7('0x19')][_0x43e7('0x1a')];}}ami[_0x43e7('0x1b')]({'action':_0x43e7('0x1c'),'interface':_0x5c4eaa,'paused':!![],'reason':_0x140657})['then'](function(_0xef1a5a){if(_0x4de324[_0x43e7('0x6')][_0x5c4eaa]){return RpcUser['getAgent'](_0x4de324[_0x43e7('0x6')][_0x5c4eaa]['id'])[_0x43e7('0x1d')](function(_0x3945bb){if(_0x3945bb&&!_0x3945bb[_0x43e7('0x1e')]){logger[_0x43e7('0x1f')](_0x43e7('0x20'),_0x328445,_0x5c4eaa,_0x273a32);var _0x54a9e7=_0x4de324[_0x43e7('0x8')][_0x328445]['attended']&&_0x4de324['channels'][_0x328445][_0x43e7('0x21')]?_0x4de324[_0x43e7('0x8')][_0x328445]['destlinkedid']:_0x328445;return RpcUser[_0x43e7('0x22')](_0x4de324['agents'][_0x5c4eaa],_0x140657,_0x54a9e7)[_0x43e7('0x1d')](function(_0x5c5e67){if(!_0x9037d3){_0x4de324[_0x43e7('0x7')][_0x5c4eaa]={};logger[_0x43e7('0x1f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);_0x4de324['timers'][_0x5c4eaa][_0x43e7('0x24')]=setTimeout(_0x4de324['stopAcw'][_0x43e7('0xb')](_0x4de324,_0x5c4eaa),_0x4de324[_0x43e7('0x5')][_0x273a32][_0x43e7('0x25')]*0x3e8);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['lastPauseAt']=moment()[_0x43e7('0x26')](_0x43e7('0x27'));_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')]=_0x328445;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x29')]=_0x273a32;_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2a')]=function(){var _0x3bf475=getDiff(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x2b')]);clearTimeout(_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x24')]);_0x4de324[_0x43e7('0x7')][_0x5c4eaa]['timer']=![];RpcVoiceAgentReport[_0x43e7('0x2c')]({'acwtime':_0x3bf475},_0x4de324[_0x43e7('0x7')][_0x5c4eaa][_0x43e7('0x28')],_0x5c4eaa)[_0x43e7('0x1d')](function(_0x4251c8){logger['info'](_0x43e7('0x2d'),_0x328445,_0x3bf475,_0x4251c8);})[_0x43e7('0x2e')](function(_0x30d47e){logger[_0x43e7('0x2f')]('[%s][UPDATE][ERRORS:%s]',_0x328445,_0x30d47e);});delete _0x4de324['timers'][_0x5c4eaa];};}});}else{logger['info'](_0x43e7('0x30'),_0x328445,_0x5c4eaa,_0x273a32);}});}})[_0x43e7('0x2e')](function(_0x117c07){logger[_0x43e7('0x2f')](_0x43e7('0x23'),_0x328445,_0x4de324[_0x43e7('0x5')][_0x273a32]['acwTimeout'],_0x5c4eaa,_0x273a32);})['finally'](function(){delete _0x4de324['channels'][_0x328445];});}catch(_0x59e5b2){logger['error']('[ACW][START]\x20%s',_0x59e5b2['message']);}};Acw[_0x43e7('0x14')]['stopAcw']=function(_0x2b4bfd){try{var _0x8e9f40=this;if(_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]){_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd][_0x43e7('0x24')]=![];var _0x449803=_0x8e9f40[_0x43e7('0x7')][_0x2b4bfd]['uniqueid'];var _0x5332d9=_0x8e9f40['timers'][_0x2b4bfd][_0x43e7('0x29')];var _0xfe70e9=_0x8e9f40[_0x43e7('0x5')][_0x5332d9][_0x43e7('0x25')];logger[_0x43e7('0x1f')](_0x43e7('0x31'),_0x2b4bfd);RpcUser[_0x43e7('0x32')](this[_0x43e7('0x6')][_0x2b4bfd]);RpcVoiceAgentReport['update']({'acwtime':_0xfe70e9,'agentacw':!![]},_0x449803,_0x2b4bfd)[_0x43e7('0x1d')](function(_0x2b0ffe){logger['info'](_0x43e7('0x2d'),_0x449803,_0xfe70e9,_0x2b0ffe);})['catch'](function(_0x44d8e4){logger[_0x43e7('0x2f')](_0x43e7('0x33'),_0x449803,_0x44d8e4);});}else{logger[_0x43e7('0x2f')](_0x43e7('0x34'),_0x2b4bfd);if(_0x8e9f40[_0x43e7('0x7')]){logger['info']('[ACW][TIMERS]',JSON[_0x43e7('0x35')](_0x8e9f40[_0x43e7('0x7')]));}}}catch(_0x44b6ae){logger[_0x43e7('0x2f')](_0x43e7('0x36'),_0x44b6ae['message']);}};Acw[_0x43e7('0x14')][_0x43e7('0xa')]=function(_0x575439){try{if(this[_0x43e7('0x5')][_0x575439['queue']]&&(this[_0x43e7('0x5')][_0x575439['queue']][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x575439[_0x43e7('0x29')]][_0x43e7('0x18')])){if(this['agents'][_0x575439['interface']]){this[_0x43e7('0x8')][_0x575439[_0x43e7('0x28')]]={'queue':_0x575439[_0x43e7('0x29')],'interface':_0x575439[_0x43e7('0x16')],'destlinkedid':_0x575439['destlinkedid']};}}}catch(_0x583047){logger['error'](_0x43e7('0x38'),_0x583047['message']);}};Acw[_0x43e7('0x14')]['syncAgentConnectPreview']=function(_0x5b28db){try{if(this[_0x43e7('0x5')][_0x5b28db['queue']]&&(this[_0x43e7('0x5')][_0x5b28db[_0x43e7('0x29')]][_0x43e7('0x37')]||this[_0x43e7('0x5')][_0x5b28db['queue']][_0x43e7('0x18')])){if(this[_0x43e7('0x6')][_0x5b28db[_0x43e7('0x16')]]){this[_0x43e7('0x8')][_0x5b28db[_0x43e7('0x28')]]={'queue':_0x5b28db[_0x43e7('0x29')],'interface':_0x5b28db['interface']};}}}catch(_0x4930a2){logger[_0x43e7('0x2f')](_0x43e7('0x39'),_0x4930a2[_0x43e7('0x3a')]);}};Acw['prototype']['syncHangupRequest']=function(_0x56489b){try{if(this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]]&&_['isUndefined'](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x28')]][_0x43e7('0x3b')])){logger['info']('[%s][HANGUP:UNIQUEID]',_0x56489b['uniqueid']);this['startAcw'](_0x56489b[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x56489b['linkedid']]&&_[_0x43e7('0x3c')](this[_0x43e7('0x8')][_0x56489b[_0x43e7('0x3d')]][_0x43e7('0x3b')])){logger['info'](_0x43e7('0x3e'),_0x56489b['linkedid']);this['startAcw'](_0x56489b[_0x43e7('0x3d')]);}}catch(_0x12f9ba){logger[_0x43e7('0x2f')](_0x43e7('0x3f'),_0x12f9ba[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0x40')]=function(_0x256ddd){try{if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x28')]]&&this['channels'][_0x256ddd[_0x43e7('0x28')]][_0x43e7('0x3b')]){logger['info'](_0x43e7('0x41'),_0x256ddd['uniqueid']);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x28')]);}else if(this[_0x43e7('0x8')][_0x256ddd[_0x43e7('0x3d')]]&&this[_0x43e7('0x8')][_0x256ddd['linkedid']]['attended']){logger[_0x43e7('0x1f')](_0x43e7('0x42'),_0x256ddd[_0x43e7('0x3d')]);this[_0x43e7('0x15')](_0x256ddd[_0x43e7('0x3d')]);}}catch(_0x25bb44){logger[_0x43e7('0x2f')](_0x43e7('0x43'),_0x25bb44[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xe')]=function(_0x4ace49){try{if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49['transfereeuniqueid']])){this[_0x43e7('0x15')](_0x4ace49[_0x43e7('0x45')]);if(this[_0x43e7('0x8')][_0x4ace49['secondtransfereruniqueid']]){this['channels'][_0x4ace49[_0x43e7('0x46')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49[_0x43e7('0x47')]]=this['channels'][_0x4ace49['secondtransfereruniqueid']];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x46')]];}}else if(!_[_0x43e7('0x44')](this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x47')]])){this['startAcw'](_0x4ace49[_0x43e7('0x47')]);if(this[_0x43e7('0x8')][_0x4ace49['origtransfereruniqueid']]){this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]][_0x43e7('0x3b')]=!![];this['channels'][_0x4ace49['transfereeuniqueid']]=this['channels'][_0x4ace49[_0x43e7('0x48')]];delete this[_0x43e7('0x8')][_0x4ace49[_0x43e7('0x48')]];}}}catch(_0x3a6404){logger['error']('[ACW][syncAttendedTransfer]\x20%s',_0x3a6404[_0x43e7('0x3a')]);}};Acw[_0x43e7('0x14')][_0x43e7('0xf')]=function(_0x5dd349){try{if(this['channels'][_0x5dd349[_0x43e7('0x49')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4a'),JSON[_0x43e7('0x35')](_0x5dd349[_0x43e7('0x49')]));this[_0x43e7('0x15')](_0x5dd349[_0x43e7('0x49')]);}else if(this[_0x43e7('0x8')][_0x5dd349[_0x43e7('0x4b')]]){logger[_0x43e7('0x1f')](_0x43e7('0x4c'),JSON['stringify'](_0x5dd349['transfererlinkedid']));this[_0x43e7('0x15')](_0x5dd349['transfererlinkedid']);}}catch(_0x501616){logger['error'](_0x43e7('0x4d'),_0x501616[_0x43e7('0x3a')]);}};Acw['prototype'][_0x43e7('0x4e')]=function(_0x135791){try{if(this[_0x43e7('0x5')][_0x135791['queue']]&&this[_0x43e7('0x5')][_0x135791[_0x43e7('0x29')]][_0x43e7('0x4f')]===_0x43e7('0x50')){if(this[_0x43e7('0x6')][_0x135791[_0x43e7('0x16')]]){logger[_0x43e7('0x1f')]('[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]',_0x135791[_0x43e7('0x28')],_0x135791[_0x43e7('0x16')],_0x135791[_0x43e7('0x29')]);return RpcUser['savePause'](this['agents'][_0x135791[_0x43e7('0x16')]],'Auto-Pause',_0x135791['uniqueid']);}}}catch(_0x1b793d){logger[_0x43e7('0x2f')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x1b793d[_0x43e7('0x3a')]);}};module[_0x43e7('0x51')]=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 99d56f5..a0022c2 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 _0xf41b=['queuesummary','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','close','connect','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','actionCoreShowChannels','catch','log','exports','asterisk-manager','bluebird','moment','util','../../config/logger','../../config/environment','asterisk','port','username','keepConnected','Action','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','format','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary'];(function(_0x4e4739,_0x2bb99e){var _0x142ec5=function(_0x329ce3){while(--_0x329ce3){_0x4e4739['push'](_0x4e4739['shift']());}};_0x142ec5(++_0x2bb99e);}(_0xf41b,0x1b3));var _0xbf41=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0xf41b[_0x46401e];return _0x447cba;};'use strict';var Manager=require(_0xbf41('0x0'));var BPromise=require(_0xbf41('0x1'));var moment=require(_0xbf41('0x2'));var util=require(_0xbf41('0x3'));var _=require('lodash');var logger=require(_0xbf41('0x4'))('ami');var config=require(_0xbf41('0x5'));var ami=new Manager(config[_0xbf41('0x6')][_0xbf41('0x7')],config[_0xbf41('0x6')]['ip'],config[_0xbf41('0x6')][_0xbf41('0x8')],config[_0xbf41('0x6')]['password'],!![]);ami[_0xbf41('0x9')]();ami[_0xbf41('0xa')]=BPromise['promisify'](ami[_0xbf41('0xb')]);function error(_0x123488){logger[_0xbf41('0xc')](util['format'](_0xbf41('0xd'),config[_0xbf41('0x6')]['username'],config[_0xbf41('0x6')]['ip'],config['asterisk'][_0xbf41('0x7')],util[_0xbf41('0xe')](_0x123488,![],null)));}function close(){logger[_0xbf41('0xc')](util[_0xbf41('0xf')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0xbf41('0x6')]['username'],config[_0xbf41('0x6')]['ip'],config[_0xbf41('0x6')][_0xbf41('0x7')]));}ami[_0xbf41('0x10')]=function(){return function(){return ami[_0xbf41('0xa')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami['Action']({'action':_0xbf41('0x11')});};};ami[_0xbf41('0x12')]=function(){return function(){return ami[_0xbf41('0xa')]({'action':_0xbf41('0x13')});};};ami[_0xbf41('0x14')]=function(){return function(){return ami['Action']({'action':_0xbf41('0x15')});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0xbf41('0xa')]({'action':'coreshowchannels'});};};function connect(_0x1afef6){logger['info'](util[_0xbf41('0xf')](_0xbf41('0x16'),config[_0xbf41('0x6')][_0xbf41('0x8')],config[_0xbf41('0x6')]['ip'],config[_0xbf41('0x6')][_0xbf41('0x7')]));ami[_0xbf41('0x17')](_0xbf41('0xc'),error);ami[_0xbf41('0x17')](_0xbf41('0x18'),close);}ami['on'](_0xbf41('0x19'),connect);ami['on'](_0xbf41('0x1a'),function(_0x2a48b0){logger[_0xbf41('0x1b')](util[_0xbf41('0xf')](_0xbf41('0x1c'),config[_0xbf41('0x6')][_0xbf41('0x8')],config[_0xbf41('0x6')]['ip'],config['asterisk'][_0xbf41('0x7')],util[_0xbf41('0xe')](_0x2a48b0,![],null)));});ami['on'](_0xbf41('0x1d'),function(_0x1baa87){logger[_0xbf41('0x1b')](util['format'](_0xbf41('0x1e'),config[_0xbf41('0x6')][_0xbf41('0x8')],config[_0xbf41('0x6')]['ip'],config[_0xbf41('0x6')][_0xbf41('0x7')]));return BPromise[_0xbf41('0x1f')]()['then'](ami[_0xbf41('0x10')]())[_0xbf41('0x20')](ami[_0xbf41('0x21')]())['then'](ami[_0xbf41('0x12')]())[_0xbf41('0x20')](ami[_0xbf41('0x14')]())[_0xbf41('0x20')](ami[_0xbf41('0x22')]())[_0xbf41('0x23')](function(_0x3a7db1){console[_0xbf41('0x24')](_0x3a7db1);});});ami[_0xbf41('0x17')]('error',error);ami['once'](_0xbf41('0x18'),close);module[_0xbf41('0x25')]=ami; \ No newline at end of file +var _0x1ed9=['coreshowchannels','info','once','close','connect','shutdown','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','inspect','fullybooted','then','actionQueueSummary','actionCoreShowChannels','catch','log','exports','asterisk-manager','../../config/logger','ami','asterisk','username','password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','format','port','sipshowregistry','actionDeviceStateList','devicestatelist','actionSipPeerStatus'];(function(_0x518cbd,_0x52f0a5){var _0x4d9d14=function(_0x36b9eb){while(--_0x36b9eb){_0x518cbd['push'](_0x518cbd['shift']());}};_0x4d9d14(++_0x52f0a5);}(_0x1ed9,0x117));var _0x91ed=function(_0x427872,_0x555113){_0x427872=_0x427872-0x0;var _0x11c096=_0x1ed9[_0x427872];return _0x11c096;};'use strict';var Manager=require(_0x91ed('0x0'));var BPromise=require('bluebird');var moment=require('moment');var util=require('util');var _=require('lodash');var logger=require(_0x91ed('0x1'))(_0x91ed('0x2'));var config=require('../../config/environment');var ami=new Manager(config[_0x91ed('0x3')]['port'],config[_0x91ed('0x3')]['ip'],config[_0x91ed('0x3')][_0x91ed('0x4')],config[_0x91ed('0x3')][_0x91ed('0x5')],!![]);ami[_0x91ed('0x6')]();ami[_0x91ed('0x7')]=BPromise[_0x91ed('0x8')](ami[_0x91ed('0x9')]);function error(_0x5cac5c){logger[_0x91ed('0xa')](util['format'](_0x91ed('0xb'),config[_0x91ed('0x3')][_0x91ed('0x4')],config[_0x91ed('0x3')]['ip'],config[_0x91ed('0x3')]['port'],util['inspect'](_0x5cac5c,![],null)));}function close(){logger['error'](util[_0x91ed('0xc')]('Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s',config[_0x91ed('0x3')][_0x91ed('0x4')],config[_0x91ed('0x3')]['ip'],config['asterisk'][_0x91ed('0xd')]));}ami['actionSipShowRegistry']=function(){return function(){return ami[_0x91ed('0x7')]({'action':_0x91ed('0xe')});};};ami[_0x91ed('0xf')]=function(){return function(){return ami[_0x91ed('0x7')]({'action':_0x91ed('0x10')});};};ami[_0x91ed('0x11')]=function(){return function(){return ami[_0x91ed('0x7')]({'action':'sippeerstatus'});};};ami['actionQueueSummary']=function(){return function(){return ami['Action']({'action':'queuesummary'});};};ami['actionCoreShowChannels']=function(){return function(){return ami[_0x91ed('0x7')]({'action':_0x91ed('0x12')});};};function connect(_0x149251){logger[_0x91ed('0x13')](util[_0x91ed('0xc')]('Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s',config[_0x91ed('0x3')]['username'],config[_0x91ed('0x3')]['ip'],config['asterisk'][_0x91ed('0xd')]));ami[_0x91ed('0x14')](_0x91ed('0xa'),error);ami[_0x91ed('0x14')](_0x91ed('0x15'),close);}ami['on'](_0x91ed('0x16'),connect);ami['on'](_0x91ed('0x17'),function(_0x55d81a){logger[_0x91ed('0x13')](util[_0x91ed('0xc')](_0x91ed('0x18'),config[_0x91ed('0x3')][_0x91ed('0x4')],config[_0x91ed('0x3')]['ip'],config[_0x91ed('0x3')][_0x91ed('0xd')],util[_0x91ed('0x19')](_0x55d81a,![],null)));});ami['on'](_0x91ed('0x1a'),function(_0x10670e){logger[_0x91ed('0x13')](util[_0x91ed('0xc')]('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0x91ed('0x3')]['username'],config[_0x91ed('0x3')]['ip'],config[_0x91ed('0x3')][_0x91ed('0xd')]));return BPromise['resolve']()[_0x91ed('0x1b')](ami['actionSipShowRegistry']())[_0x91ed('0x1b')](ami[_0x91ed('0xf')]())[_0x91ed('0x1b')](ami[_0x91ed('0x11')]())[_0x91ed('0x1b')](ami[_0x91ed('0x1c')]())[_0x91ed('0x1b')](ami[_0x91ed('0x1d')]())[_0x91ed('0x1e')](function(_0x20f99e){console[_0x91ed('0x1f')](_0x20f99e);});});ami['once'](_0x91ed('0xa'),error);ami[_0x91ed('0x14')](_0x91ed('0x15'),close);module[_0x91ed('0x20')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 6f67ca4..2301a46 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 _0x1a66=['error','message','result','catch','exports','jayson/promise','../../config/logger','ami','http','Request','request','then','debug','rpc','memberReport'];(function(_0x1d9e5b,_0x100862){var _0x26df9a=function(_0x94ce15){while(--_0x94ce15){_0x1d9e5b['push'](_0x1d9e5b['shift']());}};_0x26df9a(++_0x100862);}(_0x1a66,0x1d6));var _0x61a6=function(_0xc43584,_0x26865c){_0xc43584=_0xc43584-0x0;var _0x3d533f=_0x1a66[_0xc43584];return _0x3d533f;};'use strict';var jayson=require(_0x61a6('0x0'));var BPromise=require('bluebird');var logger=require(_0x61a6('0x1'))(_0x61a6('0x2'));var client=jayson['client'][_0x61a6('0x3')]({'port':0x2329});client[_0x61a6('0x4')]=function(_0x516396,_0x46da03){return new BPromise(function(_0x4614b4,_0x2cb6ad){return client[_0x61a6('0x5')](_0x516396,_0x46da03)[_0x61a6('0x6')](function(_0x2c58ea){logger[_0x61a6('0x7')](_0x61a6('0x8'),_0x61a6('0x9'),_0x516396,_0x46da03,_0x2c58ea);if(_0x2c58ea['error']){logger[_0x61a6('0xa')](_0x61a6('0x8'),'memberReport',_0x516396,_0x2c58ea[_0x61a6('0xa')][_0x61a6('0xb')],_0x46da03);return _0x2cb6ad(_0x2c58ea[_0x61a6('0xa')][_0x61a6('0xb')]);}else{return _0x4614b4(_0x2c58ea[_0x61a6('0xc')]);}})[_0x61a6('0xd')](function(_0x4f8cbd){logger['error'](_0x61a6('0x8'),_0x61a6('0x9'),_0x516396,_0x4f8cbd,_0x46da03);return _0x2cb6ad(_0x4f8cbd);});});};module[_0x61a6('0xe')]=client; \ No newline at end of file +var _0x66bc=['error','message','jayson/promise','client','http','request','rpc','memberReport'];(function(_0x3ba900,_0x292f35){var _0x4e9222=function(_0x593bf4){while(--_0x593bf4){_0x3ba900['push'](_0x3ba900['shift']());}};_0x4e9222(++_0x292f35);}(_0x66bc,0x172));var _0xc66b=function(_0x2219c8,_0x1e3a3b){_0x2219c8=_0x2219c8-0x0;var _0x470f46=_0x66bc[_0x2219c8];return _0x470f46;};'use strict';var jayson=require(_0xc66b('0x0'));var BPromise=require('bluebird');var logger=require('../../config/logger')('ami');var client=jayson[_0xc66b('0x1')][_0xc66b('0x2')]({'port':0x2329});client['Request']=function(_0x1493a3,_0x3402c8){return new BPromise(function(_0xffc3a1,_0x7ba27a){return client[_0xc66b('0x3')](_0x1493a3,_0x3402c8)['then'](function(_0x385a6a){logger['debug'](_0xc66b('0x4'),_0xc66b('0x5'),_0x1493a3,_0x3402c8,_0x385a6a);if(_0x385a6a[_0xc66b('0x6')]){logger[_0xc66b('0x6')](_0xc66b('0x4'),'memberReport',_0x1493a3,_0x385a6a[_0xc66b('0x6')][_0xc66b('0x7')],_0x3402c8);return _0x7ba27a(_0x385a6a[_0xc66b('0x6')]['message']);}else{return _0xffc3a1(_0x385a6a['result']);}})['catch'](function(_0x3552a7){logger['error'](_0xc66b('0x4'),_0xc66b('0x5'),_0x1493a3,_0x3552a7,_0x3402c8);return _0x7ba27a(_0x3552a7);});});};module['exports']=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 8be8374..2c44b50 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 _0xc547=['originatecalleridname','\x22%s\x22\x20<%s>','substring','dialCutDigit','prototype','exports','lodash','string','isNil','uniqueid','name','Contact','phone','firstName','lastName','queue','active','type','dialQueueTimeout','scheduledat','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countabandonedretry','countmachineretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','idHopper','ContactFirstName','format','callbackuniqueid','callbackat','recallme','originatecalleridnum'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xc547,0x153));var _0x7c54=function(_0x319fcc,_0x45a33a){_0x319fcc=_0x319fcc-0x0;var _0x57f2f5=_0xc547[_0x319fcc];return _0x57f2f5;};'use strict';var util=require('util');var _=require(_0x7c54('0x0'));var moment=require('moment');function checkNameSurname(_0x428a06,_0x5d0904,_0x366305){var _0x571cff='';if(!_['isNil'](_0x5d0904)&&_0x7c54('0x1')===typeof _0x5d0904){_0x571cff+=_0x5d0904;}if(!_[_0x7c54('0x2')](_0x366305)&&_0x7c54('0x1')===typeof _0x366305){_0x571cff+='\x20'+_0x366305;}if(_0x571cff!==''){return _0x571cff;}return _0x428a06;}function Action(_0x3fc605,_0x3581bb,_0x59c727){this['voiceQueue']=_0x3fc605;this[_0x7c54('0x3')]=_0x59c727||undefined;this[_0x7c54('0x4')]=checkNameSurname(_0x3581bb[_0x7c54('0x5')][_0x7c54('0x6')],_0x3581bb['Contact'][_0x7c54('0x7')],_0x3581bb['Contact'][_0x7c54('0x8')]);this['number']=_0x3581bb[_0x7c54('0x5')][_0x7c54('0x6')];this[_0x7c54('0x9')]=_0x3fc605[_0x7c54('0x4')];this['active']=_0x3581bb[_0x7c54('0xa')]||![];this[_0x7c54('0xb')]=_0x3fc605['type'];this['dialQueueTimeout']=_0x3fc605[_0x7c54('0xc')]||0x3;this[_0x7c54('0xd')]=_0x3581bb[_0x7c54('0xd')];this['countbusyretry']=_0x3581bb['countbusyretry'];this['countcongestionretry']=_0x3581bb[_0x7c54('0xe')];this['countnoanswerretry']=_0x3581bb[_0x7c54('0xf')];this['countnosuchnumberretry']=_0x3581bb[_0x7c54('0x10')];this['countdropretry']=_0x3581bb['countdropretry'];this[_0x7c54('0x11')]=_0x3581bb['countabandonedretry'];this[_0x7c54('0x12')]=_0x3581bb['countmachineretry'];this['countagentrejectretry']=_0x3581bb[_0x7c54('0x13')];this[_0x7c54('0x14')]=_0x3581bb[_0x7c54('0x14')];this[_0x7c54('0x15')]=_0x3581bb[_0x7c54('0x15')];this[_0x7c54('0x16')]=_0x3581bb[_0x7c54('0x16')];this['VoiceQueueId']=_0x3581bb[_0x7c54('0x17')];this['CampaignId']=_0x3581bb['CampaignId'];this[_0x7c54('0x18')]=_0x3581bb['id'];this[_0x7c54('0x19')]=_0x3581bb[_0x7c54('0x5')][_0x7c54('0x7')]||'';this['starttime']=moment()[_0x7c54('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x3581bb['callback'];this[_0x7c54('0x1b')]=_0x3581bb[_0x7c54('0x1b')];this[_0x7c54('0x1c')]=_0x3581bb['callbackat'];this[_0x7c54('0x1d')]=_0x3581bb[_0x7c54('0x1d')];this[_0x7c54('0x1e')]='';this[_0x7c54('0x1f')]='';}Action['prototype']['getCaller']=function(){return util[_0x7c54('0x1a')](_0x7c54('0x20'),this['name'],this['voiceQueue']['dialCutDigit']>0x0?this['number'][_0x7c54('0x21')](this['voiceQueue'][_0x7c54('0x22')]):this['number']);};Action[_0x7c54('0x23')]['getQueue']=function(){return this[_0x7c54('0x9')];};module[_0x7c54('0x24')]=Action; \ No newline at end of file +var _0xc4e6=['callbackuniqueid','callbackat','recallme','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','voiceQueue','substring','dialCutDigit','getQueue','exports','util','lodash','string','isNil','uniqueid','name','Contact','phone','firstName','lastName','number','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countagentrejectretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','YYYY-MM-DD\x20HH:mm:ss','callback'];(function(_0x2292f7,_0x5d033e){var _0x508cb8=function(_0x367129){while(--_0x367129){_0x2292f7['push'](_0x2292f7['shift']());}};_0x508cb8(++_0x5d033e);}(_0xc4e6,0x1d9));var _0x6c4e=function(_0x2493f7,_0x49c670){_0x2493f7=_0x2493f7-0x0;var _0x594ab2=_0xc4e6[_0x2493f7];return _0x594ab2;};'use strict';var util=require(_0x6c4e('0x0'));var _=require(_0x6c4e('0x1'));var moment=require('moment');function checkNameSurname(_0x79153b,_0x1b3896,_0x86fe20){var _0x399a44='';if(!_['isNil'](_0x1b3896)&&_0x6c4e('0x2')===typeof _0x1b3896){_0x399a44+=_0x1b3896;}if(!_[_0x6c4e('0x3')](_0x86fe20)&&_0x6c4e('0x2')===typeof _0x86fe20){_0x399a44+='\x20'+_0x86fe20;}if(_0x399a44!==''){return _0x399a44;}return _0x79153b;}function Action(_0x5d8d70,_0x266061,_0x587927){this['voiceQueue']=_0x5d8d70;this[_0x6c4e('0x4')]=_0x587927||undefined;this[_0x6c4e('0x5')]=checkNameSurname(_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x8')],_0x266061[_0x6c4e('0x6')][_0x6c4e('0x9')]);this[_0x6c4e('0xa')]=_0x266061[_0x6c4e('0x6')][_0x6c4e('0x7')];this[_0x6c4e('0xb')]=_0x5d8d70['name'];this['active']=_0x266061[_0x6c4e('0xc')]||![];this[_0x6c4e('0xd')]=_0x5d8d70[_0x6c4e('0xd')];this['dialQueueTimeout']=_0x5d8d70[_0x6c4e('0xe')]||0x3;this[_0x6c4e('0xf')]=_0x266061[_0x6c4e('0xf')];this[_0x6c4e('0x10')]=_0x266061['countbusyretry'];this[_0x6c4e('0x11')]=_0x266061[_0x6c4e('0x11')];this[_0x6c4e('0x12')]=_0x266061[_0x6c4e('0x12')];this[_0x6c4e('0x13')]=_0x266061['countnosuchnumberretry'];this[_0x6c4e('0x14')]=_0x266061[_0x6c4e('0x14')];this[_0x6c4e('0x15')]=_0x266061['countabandonedretry'];this['countmachineretry']=_0x266061['countmachineretry'];this['countagentrejectretry']=_0x266061[_0x6c4e('0x16')];this[_0x6c4e('0x17')]=_0x266061[_0x6c4e('0x17')];this['ListId']=_0x266061[_0x6c4e('0x18')];this[_0x6c4e('0x19')]=_0x266061['UserId'];this[_0x6c4e('0x1a')]=_0x266061['VoiceQueueId'];this[_0x6c4e('0x1b')]=_0x266061[_0x6c4e('0x1b')];this[_0x6c4e('0x1c')]=_0x266061['id'];this[_0x6c4e('0x1d')]=_0x266061['Contact'][_0x6c4e('0x8')]||'';this[_0x6c4e('0x1e')]=moment()['format'](_0x6c4e('0x1f'));this[_0x6c4e('0x20')]=_0x266061[_0x6c4e('0x20')];this[_0x6c4e('0x21')]=_0x266061[_0x6c4e('0x21')];this['callbackat']=_0x266061[_0x6c4e('0x22')];this[_0x6c4e('0x23')]=_0x266061['recallme'];this['originatecalleridnum']='';this[_0x6c4e('0x24')]='';}Action[_0x6c4e('0x25')][_0x6c4e('0x26')]=function(){return util[_0x6c4e('0x27')](_0x6c4e('0x28'),this[_0x6c4e('0x5')],this[_0x6c4e('0x29')]['dialCutDigit']>0x0?this[_0x6c4e('0xa')][_0x6c4e('0x2a')](this[_0x6c4e('0x29')][_0x6c4e('0x2b')]):this['number']);};Action[_0x6c4e('0x25')][_0x6c4e('0x2c')]=function(){return this[_0x6c4e('0xb')];};module[_0x6c4e('0x2d')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 5b02638..1496abd 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 _0xb887=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','moment','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','calleridnum','number','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','membername','reason','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x5be2ca,_0xba336a){var _0x582e9a=function(_0x35b3fa){while(--_0x35b3fa){_0x5be2ca['push'](_0x5be2ca['shift']());}};_0x582e9a(++_0xba336a);}(_0xb887,0x115));var _0x7b88=function(_0x4e3447,_0x30b75f){_0x4e3447=_0x4e3447-0x0;var _0x3c5324=_0xb887[_0x4e3447];return _0x3c5324;};'use strict';var util=require(_0x7b88('0x0'));var _=require('lodash');var moment=require(_0x7b88('0x1'));function getSeconds(_0x28c263,_0xc0e900){var _0x7eb01f=moment(_0x28c263)['milliseconds'](0x0);var _0xe4e49b=moment(_0xc0e900)['milliseconds'](0x0);return _0x7eb01f[_0x7b88('0x2')](_0xe4e49b,_0x7b88('0x3'));}function AgentComplete(_0x201842,_0x3ca8b4){this[_0x7b88('0x4')]=0x4;this[_0x7b88('0x5')]=_0x7b88('0x6');this['scheduledat']=_0x201842[_0x7b88('0x7')];this['type']=_0x201842[_0x7b88('0x8')];this[_0x7b88('0x9')]=_0x201842[_0x7b88('0x8')]===_0x7b88('0xa')?_0x7b88('0xb'):_0x201842[_0x7b88('0x8')];this['countbusyretry']=_0x201842[_0x7b88('0xc')];this[_0x7b88('0xd')]=_0x201842['countcongestionretry'];this[_0x7b88('0xe')]=_0x201842[_0x7b88('0xe')];this['countglobal']=_0x201842[_0x7b88('0xc')]+_0x201842['countcongestionretry']+_0x201842[_0x7b88('0xe')]+_0x201842[_0x7b88('0xf')]+_0x201842[_0x7b88('0x10')]+_0x201842[_0x7b88('0x11')]+_0x201842[_0x7b88('0x12')]+_0x201842[_0x7b88('0x13')];this[_0x7b88('0xf')]=_0x201842['countnosuchnumberretry'];this[_0x7b88('0x10')]=_0x201842[_0x7b88('0x10')];this['countabandonedretry']=_0x201842['countabandonedretry'];this[_0x7b88('0x12')]=_0x201842[_0x7b88('0x12')];this[_0x7b88('0x13')]=_0x201842[_0x7b88('0x13')];this['uniqueid']=_0x3ca8b4[_0x7b88('0x14')];this['calleridname']=_0x201842['name'];this[_0x7b88('0x15')]=_0x201842[_0x7b88('0x16')];this[_0x7b88('0x17')]=_0x201842[_0x7b88('0x17')];this[_0x7b88('0x18')]=_0x201842[_0x7b88('0x18')];this[_0x7b88('0x19')]=_0x201842['answertime'];this[_0x7b88('0x1a')]=moment()[_0x7b88('0x1b')](_0x7b88('0x1c'));this[_0x7b88('0x1d')]=getSeconds(_0x201842[_0x7b88('0x18')],_0x201842['starttime']);this[_0x7b88('0x1e')]=getSeconds(_0x201842['answertime'],_0x201842['responsetime']);this['talktime']=getSeconds(this[_0x7b88('0x1a')],_0x201842[_0x7b88('0x19')]);this[_0x7b88('0xb')]=_0x3ca8b4[_0x7b88('0xb')];this[_0x7b88('0x1f')]=_0x3ca8b4[_0x7b88('0x1f')];this[_0x7b88('0x20')]=_0x3ca8b4[_0x7b88('0x20')];this['callback']=_0x201842[_0x7b88('0x21')];this['callbackuniqueid']=_0x201842[_0x7b88('0x22')];this[_0x7b88('0x23')]=_0x201842['callbackat'];this[_0x7b88('0x24')]=_0x201842[_0x7b88('0x24')];this['ContactId']=_0x201842[_0x7b88('0x25')];this[_0x7b88('0x26')]=_0x201842[_0x7b88('0x26')];this[_0x7b88('0x27')]=_0x201842['UserId'];this[_0x7b88('0x28')]=_0x201842[_0x7b88('0x28')];this[_0x7b88('0x29')]=_0x201842['CampaignId'];this[_0x7b88('0x2a')]=_0x201842[_0x7b88('0x2a')]||'';this['originatecalleridname']=_0x201842[_0x7b88('0x2b')]||'';}module[_0x7b88('0x2c')]=AgentComplete; \ No newline at end of file +var _0x7c0e=['talktime','membername','reason','callback','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','Answer','scheduledat','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countnosuchnumberretry','countmachineretry','countdropretry','countabandonedretry','countagentrejectretry','uniqueid','calleridname','name','calleridnum','starttime','responsetime','answertime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime'];(function(_0x17b895,_0x35305a){var _0x25c0ae=function(_0x7b0b0f){while(--_0x7b0b0f){_0x17b895['push'](_0x17b895['shift']());}};_0x25c0ae(++_0x35305a);}(_0x7c0e,0x1a3));var _0xe7c0=function(_0x5c79be,_0x4362d0){_0x5c79be=_0x5c79be-0x0;var _0x52c00e=_0x7c0e[_0x5c79be];return _0x52c00e;};'use strict';var util=require(_0xe7c0('0x0'));var _=require(_0xe7c0('0x1'));var moment=require(_0xe7c0('0x2'));function getSeconds(_0x383d5c,_0x2ca17b){var _0x4a96bb=moment(_0x383d5c)[_0xe7c0('0x3')](0x0);var _0x3cdc09=moment(_0x2ca17b)[_0xe7c0('0x3')](0x0);return _0x4a96bb[_0xe7c0('0x4')](_0x3cdc09,_0xe7c0('0x5'));}function AgentComplete(_0x10e81b,_0x1df4f9){this['state']=0x4;this['statedesc']=_0xe7c0('0x6');this[_0xe7c0('0x7')]=_0x10e81b[_0xe7c0('0x7')];this[_0xe7c0('0x8')]=_0x10e81b[_0xe7c0('0x8')];this['campaigntype']=_0x10e81b[_0xe7c0('0x8')]===_0xe7c0('0x9')?_0xe7c0('0xa'):_0x10e81b[_0xe7c0('0x8')];this['countbusyretry']=_0x10e81b[_0xe7c0('0xb')];this[_0xe7c0('0xc')]=_0x10e81b[_0xe7c0('0xc')];this[_0xe7c0('0xd')]=_0x10e81b[_0xe7c0('0xd')];this['countglobal']=_0x10e81b['countbusyretry']+_0x10e81b[_0xe7c0('0xc')]+_0x10e81b[_0xe7c0('0xd')]+_0x10e81b[_0xe7c0('0xe')]+_0x10e81b['countdropretry']+_0x10e81b['countabandonedretry']+_0x10e81b[_0xe7c0('0xf')]+_0x10e81b['countagentrejectretry'];this[_0xe7c0('0xe')]=_0x10e81b['countnosuchnumberretry'];this[_0xe7c0('0x10')]=_0x10e81b[_0xe7c0('0x10')];this[_0xe7c0('0x11')]=_0x10e81b[_0xe7c0('0x11')];this['countmachineretry']=_0x10e81b[_0xe7c0('0xf')];this[_0xe7c0('0x12')]=_0x10e81b[_0xe7c0('0x12')];this[_0xe7c0('0x13')]=_0x1df4f9['uniqueid'];this[_0xe7c0('0x14')]=_0x10e81b[_0xe7c0('0x15')];this[_0xe7c0('0x16')]=_0x10e81b['number'];this[_0xe7c0('0x17')]=_0x10e81b[_0xe7c0('0x17')];this[_0xe7c0('0x18')]=_0x10e81b[_0xe7c0('0x18')];this[_0xe7c0('0x19')]=_0x10e81b[_0xe7c0('0x19')];this[_0xe7c0('0x1a')]=moment()[_0xe7c0('0x1b')](_0xe7c0('0x1c'));this[_0xe7c0('0x1d')]=getSeconds(_0x10e81b[_0xe7c0('0x18')],_0x10e81b[_0xe7c0('0x17')]);this[_0xe7c0('0x1e')]=getSeconds(_0x10e81b[_0xe7c0('0x19')],_0x10e81b['responsetime']);this[_0xe7c0('0x1f')]=getSeconds(this[_0xe7c0('0x1a')],_0x10e81b['answertime']);this[_0xe7c0('0xa')]=_0x1df4f9[_0xe7c0('0xa')];this[_0xe7c0('0x20')]=_0x1df4f9[_0xe7c0('0x20')];this[_0xe7c0('0x21')]=_0x1df4f9[_0xe7c0('0x21')];this[_0xe7c0('0x22')]=_0x10e81b['callback'];this['callbackuniqueid']=_0x10e81b['callbackuniqueid'];this[_0xe7c0('0x23')]=_0x10e81b[_0xe7c0('0x23')];this[_0xe7c0('0x24')]=_0x10e81b[_0xe7c0('0x24')];this[_0xe7c0('0x25')]=_0x10e81b[_0xe7c0('0x25')];this[_0xe7c0('0x26')]=_0x10e81b[_0xe7c0('0x26')];this[_0xe7c0('0x27')]=_0x10e81b[_0xe7c0('0x27')];this[_0xe7c0('0x28')]=_0x10e81b[_0xe7c0('0x28')];this[_0xe7c0('0x29')]=_0x10e81b[_0xe7c0('0x29')];this[_0xe7c0('0x2a')]=_0x10e81b[_0xe7c0('0x2a')]||'';this[_0xe7c0('0x2b')]=_0x10e81b['originatecalleridname']||'';}module[_0xe7c0('0x2c')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 18ff583..bec3b59 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 _0xb550=['countmachineretry','countagentrejectretry','countdropretry','calleridname','calleridnum','starttime','endtime','responsetime','ringtime','talktime','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countabandonedretry'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xb550,0x145));var _0x0b55=function(_0x59daf6,_0x5814ba){_0x59daf6=_0x59daf6-0x0;var _0x2f417c=_0xb550[_0x59daf6];return _0x2f417c;};'use strict';var util=require(_0x0b55('0x0'));var _=require(_0x0b55('0x1'));var moment=require(_0x0b55('0x2'));function getSeconds(_0x2c1e8f,_0x505423){var _0x8112f=moment(_0x2c1e8f)['milliseconds'](0x0);var _0x261467=moment(_0x505423)['milliseconds'](0x0);return _0x8112f[_0x0b55('0x3')](_0x261467,_0x0b55('0x4'));}function Final(_0x4f2472){this[_0x0b55('0x5')]=_0x4f2472[_0x0b55('0x5')];this['scheduledat']=_0x4f2472[_0x0b55('0x6')];this[_0x0b55('0x7')]=_0x4f2472[_0x0b55('0x7')];this[_0x0b55('0x8')]=_0x4f2472[_0x0b55('0x7')]===_0x0b55('0x9')?_0x0b55('0xa'):_0x4f2472[_0x0b55('0x7')];this[_0x0b55('0xb')]=_0x4f2472['countbusyretry'];this['countcongestionretry']=_0x4f2472[_0x0b55('0xc')];this['countnoanswerretry']=_0x4f2472['countnoanswerretry'];this[_0x0b55('0xd')]=_0x4f2472[_0x0b55('0xb')]+_0x4f2472['countcongestionretry']+_0x4f2472[_0x0b55('0xe')]+_0x4f2472[_0x0b55('0xf')]+_0x4f2472['countdropretry']+_0x4f2472[_0x0b55('0x10')]+_0x4f2472[_0x0b55('0x11')]+_0x4f2472[_0x0b55('0x12')];this[_0x0b55('0xf')]=_0x4f2472[_0x0b55('0xf')];this[_0x0b55('0x13')]=_0x4f2472[_0x0b55('0x13')];this[_0x0b55('0x10')]=_0x4f2472[_0x0b55('0x10')];this[_0x0b55('0x11')]=_0x4f2472[_0x0b55('0x11')];this[_0x0b55('0x12')]=_0x4f2472[_0x0b55('0x12')];this[_0x0b55('0xa')]=_0x4f2472[_0x0b55('0xa')];this['calleridname']=_0x4f2472[_0x0b55('0x14')];this[_0x0b55('0x15')]=_0x4f2472['calleridnum'];this[_0x0b55('0x16')]=_0x4f2472[_0x0b55('0x16')];this['responsetime']=_0x4f2472['responsetime'];this[_0x0b55('0x17')]=_0x4f2472[_0x0b55('0x18')];this['ringtime']=_0x4f2472[_0x0b55('0x19')]||0x0;this['holdtime']=_0x4f2472['holdtime']||0x0;this[_0x0b55('0x1a')]=_0x4f2472[_0x0b55('0x1a')]||0x0;this['callback']=_0x4f2472[_0x0b55('0x1b')];this['callbackuniqueid']=_0x4f2472[_0x0b55('0x1c')];this['callbackat']=_0x4f2472[_0x0b55('0x1d')];this[_0x0b55('0x1e')]=_0x4f2472[_0x0b55('0x1e')];this['ContactId']=_0x4f2472['ContactId'];this[_0x0b55('0x1f')]=_0x4f2472[_0x0b55('0x1f')];this['UserId']=_0x4f2472[_0x0b55('0x20')];this[_0x0b55('0x21')]=_0x4f2472[_0x0b55('0x21')];this['CampaignId']=_0x4f2472[_0x0b55('0x22')];this[_0x0b55('0x23')]=_0x4f2472[_0x0b55('0x23')]||'';this[_0x0b55('0x24')]=_0x4f2472['originatecalleridname']||'';}module[_0x0b55('0x25')]=Final; \ No newline at end of file +var _0x4bfc=['type','outbound','queue','countbusyretry','countcongestionretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','lodash','moment','milliseconds','diff','seconds','scheduledat'];(function(_0x581379,_0x296921){var _0x6c040f=function(_0xd9441e){while(--_0xd9441e){_0x581379['push'](_0x581379['shift']());}};_0x6c040f(++_0x296921);}(_0x4bfc,0xd2));var _0xc4bf=function(_0xe8186d,_0x135299){_0xe8186d=_0xe8186d-0x0;var _0x4426a1=_0x4bfc[_0xe8186d];return _0x4426a1;};'use strict';var util=require('util');var _=require(_0xc4bf('0x0'));var moment=require(_0xc4bf('0x1'));function getSeconds(_0x44c14b,_0x2dfd38){var _0x3f6b9e=moment(_0x44c14b)['milliseconds'](0x0);var _0x3d4419=moment(_0x2dfd38)[_0xc4bf('0x2')](0x0);return _0x3f6b9e[_0xc4bf('0x3')](_0x3d4419,_0xc4bf('0x4'));}function Final(_0xedeada){this['uniqueid']=_0xedeada['uniqueid'];this['scheduledat']=_0xedeada[_0xc4bf('0x5')];this[_0xc4bf('0x6')]=_0xedeada['type'];this['campaigntype']=_0xedeada[_0xc4bf('0x6')]===_0xc4bf('0x7')?_0xc4bf('0x8'):_0xedeada[_0xc4bf('0x6')];this['countbusyretry']=_0xedeada[_0xc4bf('0x9')];this[_0xc4bf('0xa')]=_0xedeada[_0xc4bf('0xa')];this['countnoanswerretry']=_0xedeada['countnoanswerretry'];this[_0xc4bf('0xb')]=_0xedeada[_0xc4bf('0x9')]+_0xedeada[_0xc4bf('0xa')]+_0xedeada['countnoanswerretry']+_0xedeada[_0xc4bf('0xc')]+_0xedeada[_0xc4bf('0xd')]+_0xedeada[_0xc4bf('0xe')]+_0xedeada[_0xc4bf('0xf')]+_0xedeada[_0xc4bf('0x10')];this[_0xc4bf('0xc')]=_0xedeada[_0xc4bf('0xc')];this['countdropretry']=_0xedeada[_0xc4bf('0xd')];this[_0xc4bf('0xe')]=_0xedeada[_0xc4bf('0xe')];this['countmachineretry']=_0xedeada['countmachineretry'];this['countagentrejectretry']=_0xedeada[_0xc4bf('0x10')];this[_0xc4bf('0x8')]=_0xedeada['queue'];this[_0xc4bf('0x11')]=_0xedeada[_0xc4bf('0x11')];this['calleridnum']=_0xedeada['calleridnum'];this[_0xc4bf('0x12')]=_0xedeada['starttime'];this[_0xc4bf('0x13')]=_0xedeada[_0xc4bf('0x13')];this[_0xc4bf('0x14')]=_0xedeada[_0xc4bf('0x13')];this[_0xc4bf('0x15')]=_0xedeada[_0xc4bf('0x15')]||0x0;this[_0xc4bf('0x16')]=_0xedeada[_0xc4bf('0x16')]||0x0;this[_0xc4bf('0x17')]=_0xedeada[_0xc4bf('0x17')]||0x0;this[_0xc4bf('0x18')]=_0xedeada[_0xc4bf('0x18')];this[_0xc4bf('0x19')]=_0xedeada[_0xc4bf('0x19')];this[_0xc4bf('0x1a')]=_0xedeada['callbackat'];this[_0xc4bf('0x1b')]=_0xedeada['recallme'];this[_0xc4bf('0x1c')]=_0xedeada[_0xc4bf('0x1c')];this['ListId']=_0xedeada[_0xc4bf('0x1d')];this[_0xc4bf('0x1e')]=_0xedeada['UserId'];this['VoiceQueueId']=_0xedeada[_0xc4bf('0x1f')];this[_0xc4bf('0x20')]=_0xedeada['CampaignId'];this[_0xc4bf('0x21')]=_0xedeada[_0xc4bf('0x21')]||'';this['originatecalleridname']=_0xedeada[_0xc4bf('0x22')]||'';}module[_0xc4bf('0x23')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index 584910c..9726058 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 _0x328b=['countbusyretry','countnoanswerretry','countglobal','countcongestionretry','countabandonedretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countdropretry','uniqueid','calleridname','calleridnum','responsetime','format','YYYY-MM-DD\x20HH:mm:ss','ringtime','starttime','talktime','endtime','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','moment','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue'];(function(_0x515305,_0xdf3c71){var _0x200eba=function(_0x197725){while(--_0x197725){_0x515305['push'](_0x515305['shift']());}};_0x200eba(++_0xdf3c71);}(_0x328b,0xa4));var _0xb328=function(_0x37ffea,_0x25b006){_0x37ffea=_0x37ffea-0x0;var _0x2e2615=_0x328b[_0x37ffea];return _0x2e2615;};'use strict';var util=require(_0xb328('0x0'));var _=require('lodash');var moment=require(_0xb328('0x1'));function getSeconds(_0x39846b,_0x59ef0e){var _0xe6b843=moment(_0x39846b)[_0xb328('0x2')](0x0);var _0x1e0bdd=moment(_0x59ef0e)[_0xb328('0x2')](0x0);return _0xe6b843[_0xb328('0x3')](_0x1e0bdd,_0xb328('0x4'));}function Hangup(_0x1cf1f9,_0x4107cb){this['state']=0x4;this[_0xb328('0x5')]=_0xb328('0x6');this[_0xb328('0x7')]=_0x1cf1f9[_0xb328('0x7')];this[_0xb328('0x8')]=_0x1cf1f9[_0xb328('0x8')];this[_0xb328('0x9')]=_0x1cf1f9[_0xb328('0x8')]===_0xb328('0xa')?_0xb328('0xb'):_0x1cf1f9[_0xb328('0x8')];this[_0xb328('0xc')]=_0x1cf1f9['countbusyretry'];this['countcongestionretry']=_0x1cf1f9['countcongestionretry'];this[_0xb328('0xd')]=_0x1cf1f9[_0xb328('0xd')];this[_0xb328('0xe')]=_0x1cf1f9[_0xb328('0xc')]+_0x1cf1f9[_0xb328('0xf')]+_0x1cf1f9['countnoanswerretry']+_0x1cf1f9['countnosuchnumberretry']+_0x1cf1f9['countdropretry']+_0x1cf1f9[_0xb328('0x10')]+_0x1cf1f9[_0xb328('0x11')]+_0x1cf1f9[_0xb328('0x12')];this[_0xb328('0x13')]=_0x1cf1f9['countnosuchnumberretry'];this['countdropretry']=_0x1cf1f9[_0xb328('0x14')];this[_0xb328('0x10')]=_0x1cf1f9['countabandonedretry'];this['countmachineretry']=_0x1cf1f9[_0xb328('0x11')];this[_0xb328('0x12')]=_0x1cf1f9[_0xb328('0x12')];this[_0xb328('0x15')]=_0x4107cb[_0xb328('0x15')];this[_0xb328('0x16')]=_0x1cf1f9['name'];this[_0xb328('0x17')]=_0x1cf1f9['number'];this['starttime']=_0x1cf1f9['starttime'];this['responsetime']=_0x1cf1f9[_0xb328('0x18')];this['endtime']=moment()[_0xb328('0x19')](_0xb328('0x1a'));this[_0xb328('0x1b')]=getSeconds(_0x1cf1f9[_0xb328('0x18')],_0x1cf1f9[_0xb328('0x1c')]);this['holdtime']=0x0;this[_0xb328('0x1d')]=getSeconds(this[_0xb328('0x1e')],_0x1cf1f9['responsetime']);this[_0xb328('0xb')]=_0x1cf1f9[_0xb328('0xb')];this['membername']=_0xb328('0x1f');this[_0xb328('0x20')]=_0x4107cb[_0xb328('0x21')];this[_0xb328('0x22')]=_0x1cf1f9['callback'];this['callbackuniqueid']=_0x1cf1f9[_0xb328('0x23')];this['callbackat']=_0x1cf1f9[_0xb328('0x24')];this[_0xb328('0x25')]=_0x1cf1f9[_0xb328('0x25')];this[_0xb328('0x26')]=_0x1cf1f9[_0xb328('0x26')];this[_0xb328('0x27')]=_0x1cf1f9[_0xb328('0x27')];this['UserId']=_0x1cf1f9[_0xb328('0x28')];this[_0xb328('0x29')]=_0x1cf1f9[_0xb328('0x29')];this[_0xb328('0x2a')]=_0x1cf1f9['CampaignId'];}module[_0xb328('0x2b')]=Hangup; \ No newline at end of file +var _0x0c02=['countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countagentrejectretry','countnosuchnumberretry','countmachineretry','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','talktime','IVR','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','milliseconds','diff','statedesc','Answer','scheduledat','type','campaigntype','queue','countbusyretry'];(function(_0x1a6c08,_0x1eab0a){var _0x2f6c86=function(_0x2dc46b){while(--_0x2dc46b){_0x1a6c08['push'](_0x1a6c08['shift']());}};_0x2f6c86(++_0x1eab0a);}(_0x0c02,0x15d));var _0x20c0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0c02[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x20c0('0x0'));var _=require(_0x20c0('0x1'));var moment=require('moment');function getSeconds(_0x244da8,_0x55cb03){var _0x10a5ca=moment(_0x244da8)[_0x20c0('0x2')](0x0);var _0x192018=moment(_0x55cb03)[_0x20c0('0x2')](0x0);return _0x10a5ca[_0x20c0('0x3')](_0x192018,'seconds');}function Hangup(_0x8ec4fc,_0x783679){this['state']=0x4;this[_0x20c0('0x4')]=_0x20c0('0x5');this[_0x20c0('0x6')]=_0x8ec4fc['scheduledat'];this['type']=_0x8ec4fc[_0x20c0('0x7')];this[_0x20c0('0x8')]=_0x8ec4fc[_0x20c0('0x7')]==='outbound'?_0x20c0('0x9'):_0x8ec4fc[_0x20c0('0x7')];this[_0x20c0('0xa')]=_0x8ec4fc[_0x20c0('0xa')];this[_0x20c0('0xb')]=_0x8ec4fc['countcongestionretry'];this[_0x20c0('0xc')]=_0x8ec4fc[_0x20c0('0xc')];this['countglobal']=_0x8ec4fc[_0x20c0('0xa')]+_0x8ec4fc[_0x20c0('0xb')]+_0x8ec4fc[_0x20c0('0xc')]+_0x8ec4fc['countnosuchnumberretry']+_0x8ec4fc[_0x20c0('0xd')]+_0x8ec4fc[_0x20c0('0xe')]+_0x8ec4fc['countmachineretry']+_0x8ec4fc[_0x20c0('0xf')];this['countnosuchnumberretry']=_0x8ec4fc[_0x20c0('0x10')];this[_0x20c0('0xd')]=_0x8ec4fc['countdropretry'];this[_0x20c0('0xe')]=_0x8ec4fc[_0x20c0('0xe')];this[_0x20c0('0x11')]=_0x8ec4fc[_0x20c0('0x11')];this['countagentrejectretry']=_0x8ec4fc['countagentrejectretry'];this[_0x20c0('0x12')]=_0x783679[_0x20c0('0x12')];this[_0x20c0('0x13')]=_0x8ec4fc[_0x20c0('0x14')];this[_0x20c0('0x15')]=_0x8ec4fc[_0x20c0('0x16')];this['starttime']=_0x8ec4fc[_0x20c0('0x17')];this[_0x20c0('0x18')]=_0x8ec4fc[_0x20c0('0x18')];this['endtime']=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this[_0x20c0('0x19')]=getSeconds(_0x8ec4fc['responsetime'],_0x8ec4fc[_0x20c0('0x17')]);this[_0x20c0('0x1a')]=0x0;this[_0x20c0('0x1b')]=getSeconds(this['endtime'],_0x8ec4fc['responsetime']);this[_0x20c0('0x9')]=_0x8ec4fc[_0x20c0('0x9')];this['membername']=_0x20c0('0x1c');this['reason']=_0x783679[_0x20c0('0x1d')];this[_0x20c0('0x1e')]=_0x8ec4fc[_0x20c0('0x1e')];this[_0x20c0('0x1f')]=_0x8ec4fc[_0x20c0('0x1f')];this[_0x20c0('0x20')]=_0x8ec4fc[_0x20c0('0x20')];this[_0x20c0('0x21')]=_0x8ec4fc['recallme'];this['ContactId']=_0x8ec4fc[_0x20c0('0x22')];this[_0x20c0('0x23')]=_0x8ec4fc['ListId'];this[_0x20c0('0x24')]=_0x8ec4fc[_0x20c0('0x24')];this[_0x20c0('0x25')]=_0x8ec4fc[_0x20c0('0x25')];this['CampaignId']=_0x8ec4fc[_0x20c0('0x26')];}module[_0x20c0('0x27')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index a33b48e..6203a97 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 _0x76f4=['ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','moment','milliseconds','diff','uniqueid','scheduledat','type','campaigntype','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countdropretry','countmachineretry','countagentrejectretry','countnosuchnumberretry','countabandonedretry','calleridname','name','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId'];(function(_0x391015,_0xaa6c0a){var _0x3b092e=function(_0x10a13a){while(--_0x10a13a){_0x391015['push'](_0x391015['shift']());}};_0x3b092e(++_0xaa6c0a);}(_0x76f4,0x9a));var _0x476f=function(_0xdea41a,_0x552987){_0xdea41a=_0xdea41a-0x0;var _0x15d0d8=_0x76f4[_0xdea41a];return _0x15d0d8;};'use strict';var util=require(_0x476f('0x0'));var _=require('lodash');var moment=require(_0x476f('0x1'));function getSeconds(_0x293690,_0x5b8c21){var _0x54f90b=moment(_0x293690)[_0x476f('0x2')](0x0);var _0x22ab78=moment(_0x5b8c21)['milliseconds'](0x0);return _0x54f90b[_0x476f('0x3')](_0x22ab78,'seconds');}function History(_0x5e3043){this['uniqueid']=_0x5e3043[_0x476f('0x4')];this[_0x476f('0x5')]=_0x5e3043[_0x476f('0x5')]||undefined;this[_0x476f('0x6')]=_0x5e3043[_0x476f('0x6')];this[_0x476f('0x7')]=_0x5e3043[_0x476f('0x6')]==='outbound'?_0x476f('0x8'):_0x5e3043[_0x476f('0x6')];this[_0x476f('0x9')]=_0x5e3043[_0x476f('0x9')];this[_0x476f('0xa')]=_0x5e3043[_0x476f('0xa')];this[_0x476f('0xb')]=_0x5e3043[_0x476f('0xb')];this[_0x476f('0xc')]=_0x5e3043[_0x476f('0x9')]+_0x5e3043[_0x476f('0xa')]+_0x5e3043[_0x476f('0xb')]+_0x5e3043['countnosuchnumberretry']+_0x5e3043[_0x476f('0xd')]+_0x5e3043['countabandonedretry']+_0x5e3043[_0x476f('0xe')]+_0x5e3043[_0x476f('0xf')];this[_0x476f('0x10')]=_0x5e3043[_0x476f('0x10')];this[_0x476f('0xd')]=_0x5e3043[_0x476f('0xd')];this['countabandonedretry']=_0x5e3043[_0x476f('0x11')];this['countmachineretry']=_0x5e3043[_0x476f('0xe')];this[_0x476f('0xf')]=_0x5e3043[_0x476f('0xf')];this['queue']=_0x5e3043['queue'];this[_0x476f('0x12')]=_0x5e3043[_0x476f('0x13')];this['calleridnum']=_0x5e3043['number'];this[_0x476f('0x14')]=_0x5e3043[_0x476f('0x14')];this[_0x476f('0x15')]=_0x5e3043[_0x476f('0x15')];this[_0x476f('0x16')]=_0x5e3043['responsetime'];this[_0x476f('0x17')]=getSeconds(_0x5e3043[_0x476f('0x15')],_0x5e3043[_0x476f('0x14')]);this[_0x476f('0x18')]=0x0;this[_0x476f('0x19')]=0x0;this[_0x476f('0x1a')]=_0x5e3043['callback'];this[_0x476f('0x1b')]=_0x5e3043['callbackuniqueid'];this[_0x476f('0x1c')]=_0x5e3043['callbackat'];this[_0x476f('0x1d')]=_0x5e3043[_0x476f('0x1d')];this[_0x476f('0x1e')]=_0x5e3043[_0x476f('0x1e')];this[_0x476f('0x1f')]=_0x5e3043[_0x476f('0x1f')];this['UserId']=_0x5e3043[_0x476f('0x20')];this[_0x476f('0x21')]=_0x5e3043[_0x476f('0x21')];this[_0x476f('0x22')]=_0x5e3043[_0x476f('0x22')];this[_0x476f('0x23')]=_0x5e3043[_0x476f('0x23')]||'';this['originatecalleridname']=_0x5e3043[_0x476f('0x24')]||'';}module['exports']=History; \ No newline at end of file +var _0x3f11=['uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','calleridname','name','calleridnum','number','starttime','responsetime','ringtime','holdtime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','util','diff','seconds'];(function(_0x11a207,_0x238d6c){var _0x556b03=function(_0x32acc6){while(--_0x32acc6){_0x11a207['push'](_0x11a207['shift']());}};_0x556b03(++_0x238d6c);}(_0x3f11,0x6c));var _0x13f1=function(_0x48df6e,_0xd49de5){_0x48df6e=_0x48df6e-0x0;var _0x2f9610=_0x3f11[_0x48df6e];return _0x2f9610;};'use strict';var util=require(_0x13f1('0x0'));var _=require('lodash');var moment=require('moment');function getSeconds(_0x4998e3,_0x42e1cf){var _0x92e45b=moment(_0x4998e3)['milliseconds'](0x0);var _0x60cf2d=moment(_0x42e1cf)['milliseconds'](0x0);return _0x92e45b[_0x13f1('0x1')](_0x60cf2d,_0x13f1('0x2'));}function History(_0x1a02df){this[_0x13f1('0x3')]=_0x1a02df[_0x13f1('0x3')];this[_0x13f1('0x4')]=_0x1a02df[_0x13f1('0x4')]||undefined;this[_0x13f1('0x5')]=_0x1a02df[_0x13f1('0x5')];this[_0x13f1('0x6')]=_0x1a02df['type']===_0x13f1('0x7')?_0x13f1('0x8'):_0x1a02df[_0x13f1('0x5')];this[_0x13f1('0x9')]=_0x1a02df[_0x13f1('0x9')];this[_0x13f1('0xa')]=_0x1a02df[_0x13f1('0xa')];this[_0x13f1('0xb')]=_0x1a02df[_0x13f1('0xb')];this[_0x13f1('0xc')]=_0x1a02df['countbusyretry']+_0x1a02df[_0x13f1('0xa')]+_0x1a02df[_0x13f1('0xb')]+_0x1a02df[_0x13f1('0xd')]+_0x1a02df[_0x13f1('0xe')]+_0x1a02df[_0x13f1('0xf')]+_0x1a02df[_0x13f1('0x10')]+_0x1a02df[_0x13f1('0x11')];this['countnosuchnumberretry']=_0x1a02df[_0x13f1('0xd')];this[_0x13f1('0xe')]=_0x1a02df[_0x13f1('0xe')];this[_0x13f1('0xf')]=_0x1a02df[_0x13f1('0xf')];this['countmachineretry']=_0x1a02df[_0x13f1('0x10')];this[_0x13f1('0x11')]=_0x1a02df[_0x13f1('0x11')];this['queue']=_0x1a02df[_0x13f1('0x8')];this[_0x13f1('0x12')]=_0x1a02df[_0x13f1('0x13')];this[_0x13f1('0x14')]=_0x1a02df[_0x13f1('0x15')];this['starttime']=_0x1a02df[_0x13f1('0x16')];this[_0x13f1('0x17')]=_0x1a02df[_0x13f1('0x17')];this['endtime']=_0x1a02df[_0x13f1('0x17')];this[_0x13f1('0x18')]=getSeconds(_0x1a02df[_0x13f1('0x17')],_0x1a02df[_0x13f1('0x16')]);this[_0x13f1('0x19')]=0x0;this['talktime']=0x0;this[_0x13f1('0x1a')]=_0x1a02df[_0x13f1('0x1a')];this[_0x13f1('0x1b')]=_0x1a02df['callbackuniqueid'];this[_0x13f1('0x1c')]=_0x1a02df['callbackat'];this[_0x13f1('0x1d')]=_0x1a02df['recallme'];this[_0x13f1('0x1e')]=_0x1a02df['ContactId'];this[_0x13f1('0x1f')]=_0x1a02df[_0x13f1('0x1f')];this[_0x13f1('0x20')]=_0x1a02df[_0x13f1('0x20')];this['VoiceQueueId']=_0x1a02df[_0x13f1('0x21')];this[_0x13f1('0x22')]=_0x1a02df[_0x13f1('0x22')];this[_0x13f1('0x23')]=_0x1a02df['originatecalleridnum']||'';this[_0x13f1('0x24')]=_0x1a02df[_0x13f1('0x24')]||'';}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 8ca843b..82caa46 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 _0x8ddd=['phone','contact\x20is\x20undefine','NONE','\x22agi://%s/square,%s\x22','outbound','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','dialAMDMinWordLength','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','TrunkBackup','originatecalleridname','SIP/%s/%s%s','dialCutDigit','trim','from-sip','outboundOriginateFailureCallsDay','OriginateError','starttime','endtime','originate\x20action\x20Error','getQueue','response','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countnoanswerretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','minutes','dialBusyMaxRetry','[rescheduleContact]\x20[Busy]','countcongestionretry','countnosuchnumberretry','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineMaxRetry','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','createStateFinal','NoAnswer','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','outboundCongestionCallsDay','Congestion','countglobal','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','reason\x2011\x20abandoned','AgentReject','[syncAgentComplete][createHistory][20]','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','dialPredictiveOptimizationPercentage','round','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','erlangCalls','check\x20predictive\x20is\x20not\x20undefine','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Dropped\x20calls\x20day','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','startMethodPredictive','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','abandonmentRate','[CatchErlangB]','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','Agent','voicePause','log','Contact\x20updated','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','RECALLFAILEDTIMEOUT','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','handleIvr','limitCalls','temp','dialOrderByScheduledAt','[getContactCampaign2][Empty]','RUNNING','Contact.phone','[actionOriginateIvr]\x20','dialLimitQueue','not_inuse','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginate]\x20','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[busyFactor]','m\x20=\x20','Umin\x20=\x20','exports','util','bluebird','uuid','moment','md5','ioredis','dialer','../../../config/logger','booked','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','./action','./history','./queueCallerAbandon','./hangup','XCALLY_IP_AGI','rrmemory','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','actions','contactsId','uniqueId','optionPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','originateresponse','syncOriginateResponse','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','newexten','syncNewExten','varset','queuemember','loopCampaigns','loopClearZombieChannels','isUndefined','AGENTS_NOT_LOGGED','name','message','NOT_ACTIVE','\x20NOT\x20Active','Interval','Intervals','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','stringify','diff','seconds','emit','type','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','voice:queue:%s','campaign:ivr:%s','campaign:save','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgTalktime','---------------------------','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','milliseconds','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','stack','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','RESCHEDULED_CONTACTS','contacts','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','talking','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','statedesc','prototype','[uniqueid]','clearZombieChannels','[actions]','enqueue','Action','status','catch','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','then','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','averageHandleTime','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','UserId','VoiceQueueId','CampaignId','[emptyContact]','isSuccess','Success','isTrunkReachable','SIP/%s','reachable','format','syncVarSet','uniqueid','isNil','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','value','state','HangupInAMD','membername','AMD','[syncHangupInAMD]','MACHINE','Machine','amd','[syncMachine]','HANGUP','[syncMachineIvr][createHistory]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','cause-txt','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','queueCallerAbandonCreateState','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','dialQueueProject2','countdropretry','dialDropMaxRetry','add','ListId','[rescheduleContact][Drop]','Abandoned','CALLEREXIT','countabandonedretry','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','channel','syncQueueMember','actionid','roundrobin','locked','paused','stateinterface','queueBooked','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','syncQueueStatusComplete','run','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','contactAgent-idHopper:\x20','Agent:\x20','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','ifTime','checkIfTimeIntervals','Failure','\x20Intervals\x20is\x20null\x20','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','command','iftime\x20%s,%s','interval','indexOf','true','content','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','dialMethod','progressive','power','dialPowerLevel','handlePower','Queue','checkIfTime','dialGlobalInterval','[syncQueueSummary]','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0x8ddd,0xb0));var _0xd8dd=function(_0x23bf1f,_0x5dab31){_0x23bf1f=_0x23bf1f-0x0;var _0x22ed0c=_0x8ddd[_0x23bf1f];return _0x22ed0c;};'use strict';var util=require(_0xd8dd('0x0'));var _=require('lodash');var BPromise=require(_0xd8dd('0x1'));var uuid=require(_0xd8dd('0x2'));var moment=require(_0xd8dd('0x3'));var rr=require('rr');var md5=require(_0xd8dd('0x4'));var Redis=require(_0xd8dd('0x5'));var config=require('../../../config/environment/');var logger=require('../../../config/logger')(_0xd8dd('0x6'));var loggerBooked=require(_0xd8dd('0x7'))(_0xd8dd('0x8'));var loggerPredictive=require(_0xd8dd('0x7'))(_0xd8dd('0x9'));var loggerPredictiveCalls=require(_0xd8dd('0x7'))(_0xd8dd('0xa'));var loggerSyncQueueSummary=require(_0xd8dd('0x7'))(_0xd8dd('0xb'));var ami=require(_0xd8dd('0xc'));config[_0xd8dd('0xd')]=_[_0xd8dd('0xe')](config[_0xd8dd('0xd')],{'host':_0xd8dd('0xf'),'port':0x18eb});var io=require(_0xd8dd('0x10'))(new Redis(config[_0xd8dd('0xd')]));var cmHopper=require(_0xd8dd('0x11'));var cmHopperFinal=require(_0xd8dd('0x12'));var cmHopperHistory=require(_0xd8dd('0x13'));var cmHopperBlack=require(_0xd8dd('0x14'));var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0xd8dd('0x15'));var History=require(_0xd8dd('0x16'));var Final=require('./final');var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0xd8dd('0x17'));var Hangup=require(_0xd8dd('0x18'));var ipAgi=process['env'][_0xd8dd('0x19')]||'127.0.0.1';var strategy={'rrmemory':_0xd8dd('0x1a'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x535dce){this[_0xd8dd('0x1b')]=this[_0xd8dd('0x1b')]?this[_0xd8dd('0x1b')][_0xd8dd('0x1c')](_0x535dce):_0x535dce();};function Dialer(_0x22deea,_0x5d7923){this[_0xd8dd('0x1d')]=new Sequence();this[_0xd8dd('0x1e')]=_0x5d7923;this[_0xd8dd('0x1f')]=_0x22deea[_0xd8dd('0x1f')];this[_0xd8dd('0x20')]=_0x22deea[_0xd8dd('0x20')];this[_0xd8dd('0x21')]=_0x22deea[_0xd8dd('0x21')];this[_0xd8dd('0x22')]=_0x22deea[_0xd8dd('0x22')];this['maxNumberOriginate']=config[_0xd8dd('0x23')]||0x2;this[_0xd8dd('0x24')]={};this[_0xd8dd('0x25')]={};this[_0xd8dd('0x26')]={};this[_0xd8dd('0x27')]={};this[_0xd8dd('0x28')]={};this['startPredictive']={};this[_0xd8dd('0x29')]={};this[_0xd8dd('0x2a')]={};this['queueBooked']={};this[_0xd8dd('0x2b')]={};ami['on'](_0xd8dd('0x2c'),this[_0xd8dd('0x2d')][_0xd8dd('0x2e')](this));ami['on'](_0xd8dd('0x2f'),this['syncQueueCallerAbandon'][_0xd8dd('0x2e')](this));ami['on'](_0xd8dd('0x30'),this[_0xd8dd('0x31')][_0xd8dd('0x2e')](this));ami['on'](_0xd8dd('0x32'),this[_0xd8dd('0x33')]['bind'](this));ami['on'](_0xd8dd('0x34'),this[_0xd8dd('0xb')][_0xd8dd('0x2e')](this));ami['on'](_0xd8dd('0x35'),this[_0xd8dd('0x36')]['bind'](this));ami['on'](_0xd8dd('0x37'),this[_0xd8dd('0x38')]['bind'](this));ami['on'](_0xd8dd('0x39'),this['syncVarSet']['bind'](this));ami['on'](_0xd8dd('0x3a'),this['syncQueueMember']['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0xd8dd('0x2e')](this));this[_0xd8dd('0x3b')]();this[_0xd8dd('0x3c')]();}function isNotNull(_0x57aa9b){return _0x57aa9b!==null&&!_[_0xd8dd('0x3d')](_0x57aa9b);}function checkIsLoggedIn(_0x82a592,_0xc32fa7){return function(){if(_0xc32fa7<=0x0){_0x82a592['message']=_0xd8dd('0x3e');throw _0x82a592[_0xd8dd('0x3f')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x429218){return _0x429218;}function checkIsActive(_0x4aa8e2,_0x32c989){return function(){if(!isActive(_0x32c989)){_0x4aa8e2[_0xd8dd('0x40')]=_0xd8dd('0x41');throw _0x4aa8e2[_0xd8dd('0x3f')]+_0xd8dd('0x42');}};}function checkInterval(_0x5ba5ab){return function(){if(!isNotNull(_0x5ba5ab[_0xd8dd('0x43')])){_0x5ba5ab[_0xd8dd('0x40')]='INTERVAL_IS_NULL';throw _0x5ba5ab[_0xd8dd('0x3f')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x5ba5ab[_0xd8dd('0x43')][_0xd8dd('0x44')])){_0x5ba5ab[_0xd8dd('0x40')]=_0xd8dd('0x45');throw _0x5ba5ab['name']+_0xd8dd('0x46');}if(!isNotNull(_[_0xd8dd('0x47')](_0x5ba5ab[_0xd8dd('0x43')][_0xd8dd('0x44')]))){_0x5ba5ab[_0xd8dd('0x40')]=_0xd8dd('0x45');throw _0x5ba5ab['name']+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x970523,_0x4b6a89,_0x2ebc80){return{'action':_0x970523,'response':_0x4b6a89,'message':_0x2ebc80,'stack':_0x2ebc80};}function myreject(_0x1ac41e){return function(_0x29d658){return _0x1ac41e(msgResponse(_0xd8dd('0x48'),_0xd8dd('0x49'),JSON[_0xd8dd('0x4a')](_0x29d658)));};}function getSeconds(_0x59c375,_0xdac891){var _0x4b0417=moment(_0x59c375)['milliseconds'](0x0);var _0x179b10=moment(_0xdac891)['milliseconds'](0x0);return _0x4b0417[_0xd8dd('0x4b')](_0x179b10,_0xd8dd('0x4c'));}function emit(_0xffbed,_0x11d6f8,_0x895c68){io['to'](_0xffbed)[_0xd8dd('0x4d')](_0x11d6f8,_0x895c68);}function emitVoiceQueueSummary(_0x58ebae){if(_0x58ebae[_0xd8dd('0x4e')]==='outbound'){var _0x593eb8={'id':_0x58ebae['id'],'name':_0x58ebae['name'],'strategy':_0x58ebae[_0xd8dd('0x4f')],'answered':_0x58ebae[_0xd8dd('0x50')],'available':_0x58ebae[_0xd8dd('0x51')],'loggedIn':_0x58ebae[_0xd8dd('0x52')],'pTalking':_0x58ebae[_0xd8dd('0x53')],'sumBillable':_0x58ebae[_0xd8dd('0x54')],'sumDuration':_0x58ebae['sumDuration'],'sumHoldTime':_0x58ebae[_0xd8dd('0x55')]||0x0,'talking':_0x58ebae['talking'],'total':_0x58ebae[_0xd8dd('0x56')],'type':_0x58ebae[_0xd8dd('0x4e')],'unmanaged':_0x58ebae[_0xd8dd('0x57')],'abandoned':_0x58ebae['abandoned'],'waiting':_0x58ebae[_0xd8dd('0x58')],'loggedInDb':_0x58ebae[_0xd8dd('0x59')],'dialActive':_0x58ebae[_0xd8dd('0x5a')],'dialMethod':_0x58ebae['dialMethod'],'dialOriginateCallerIdName':_0x58ebae[_0xd8dd('0x5b')],'dialOriginateCallerIdNumber':_0x58ebae[_0xd8dd('0x5c')],'dialOriginateTimeout':_0x58ebae[_0xd8dd('0x5d')],'dialPrefix':_0x58ebae[_0xd8dd('0x5e')],'outboundAnswerAgiCallsDay':_0x58ebae[_0xd8dd('0x5f')],'outboundAnswerCallsDay':_0x58ebae[_0xd8dd('0x60')],'outboundBlacklistCallsDay':_0x58ebae[_0xd8dd('0x61')],'outboundBusyCallsDay':_0x58ebae['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x58ebae['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x58ebae[_0xd8dd('0x62')],'outboundDropCallsDayCallersExit':_0x58ebae[_0xd8dd('0x63')],'outboundDropCallsDayTimeout':_0x58ebae[_0xd8dd('0x64')],'outboundNoAnswerCallsDay':_0x58ebae[_0xd8dd('0x65')],'outboundNoSuchCallsDay':_0x58ebae[_0xd8dd('0x66')],'outboundOriginateFailureCallsDay':_0x58ebae['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x58ebae[_0xd8dd('0x67')],'outboundRejectCallsDay':_0x58ebae[_0xd8dd('0x68')],'outboundUnknownCallsDay':_0x58ebae[_0xd8dd('0x69')],'predictiveIntervalAnsweredCalls':_0x58ebae[_0xd8dd('0x6a')],'predictiveIntervalAvgHoldtime':_0x58ebae[_0xd8dd('0x6b')],'predictiveIntervalAvgTalktime':_0x58ebae['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x58ebae[_0xd8dd('0x6c')],'predictiveIntervalDroppedCallsTimeout':_0x58ebae[_0xd8dd('0x6d')],'predictiveIntervalErlangCalls':_0x58ebae[_0xd8dd('0x6e')],'predictiveIntervalErlangCallsDroppedCalls':_0x58ebae[_0xd8dd('0x6f')],'predictiveIntervalHitRate':_0x58ebae[_0xd8dd('0x70')],'predictiveIntervalMultiplicativeFactor':_0x58ebae[_0xd8dd('0x71')],'predictiveIntervalPauses':_0x58ebae[_0xd8dd('0x72')],'predictiveIntervalAvailable':_0x58ebae[_0xd8dd('0x73')],'predictiveIntervalTotalCalls':_0x58ebae[_0xd8dd('0x74')],'message':_0x58ebae['message'],'originated':_0x58ebae[_0xd8dd('0x75')],'erlangCalls':_0x58ebae['erlangCalls'],'erlangCallToSecond':_0x58ebae[_0xd8dd('0x76')],'erlangAbandonmentRate':_0x58ebae['erlangAbandonmentRate'],'erlangBusyFactor':_0x58ebae[_0xd8dd('0x77')],'startPredictive':_0x58ebae[_0xd8dd('0x78')],'startProgressive':_0x58ebae[_0xd8dd('0x29')]};if(_0x58ebae[_0xd8dd('0x79')]){_0x593eb8['Trunk']={'id':_0x58ebae[_0xd8dd('0x79')]['id'],'name':_0x58ebae[_0xd8dd('0x79')][_0xd8dd('0x3f')],'active':_0x58ebae[_0xd8dd('0x79')][_0xd8dd('0x7a')],'callerid':_0x58ebae['Trunk'][_0xd8dd('0x7b')]};}if(_0x58ebae[_0xd8dd('0x43')]){_0x593eb8[_0xd8dd('0x43')]={'id':_0x58ebae[_0xd8dd('0x43')]['id'],'name':_0x58ebae[_0xd8dd('0x43')][_0xd8dd('0x3f')]};}var _0x150364=md5(JSON[_0xd8dd('0x4a')](_0x593eb8));if(_0x58ebae[_0xd8dd('0x4')]!==_0x150364){_0x58ebae[_0xd8dd('0x4')]=_0x150364;emit(util['format'](_0xd8dd('0x7c'),_0x593eb8['name']),'voice_queue:save',_0x593eb8);}}}function emitCampaignSummary(_0x166300){if(_0x166300['type']==='ivr'){emit(util['format'](_0xd8dd('0x7d'),_0x166300['name']),_0xd8dd('0x7e'),_0x166300);}}function checkGetDataPredictive(_0x26f97a){if(isNotNull(_0x26f97a)){if(!_[_0xd8dd('0x47')](_0x26f97a)){loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x80'));loggerPredictive['info'](_0xd8dd('0x81'),_0x26f97a[_0xd8dd('0x74')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x82'),_0x26f97a[_0xd8dd('0x6a')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x83'),_0x26f97a[_0xd8dd('0x6d')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x84'),_0x26f97a[_0xd8dd('0x6c')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x85'),_0x26f97a[_0xd8dd('0x6b')]);loggerPredictive[_0xd8dd('0x7f')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x26f97a[_0xd8dd('0x86')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x87'));if(_0x26f97a[_0xd8dd('0x74')]>0x0){if(!_[_0xd8dd('0x3d')](_0x26f97a[_0xd8dd('0x86')])&&_0x26f97a[_0xd8dd('0x86')]>0x0){return!![];}else{loggerPredictive['info'](_0xd8dd('0x88'));}if(!_[_0xd8dd('0x3d')](_0x26f97a['predictiveIntervalAvgHoldtime'])&&_0x26f97a[_0xd8dd('0x6b')]>0x0){return!![];}else{loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x89'));}}else{loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x8a'));}}else{loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x8b'));}}else{loggerPredictive['info']('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x438ae8){return function(_0x2fb85f){loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x8c'));loggerPredictive['info'](_0xd8dd('0x8d'),_0x2fb85f['erlangCalls']);loggerPredictive[_0xd8dd('0x7f')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2fb85f[_0xd8dd('0x76')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x8e'),_0x2fb85f['erlangAbandonmentRate']);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x8f'),_0x2fb85f[_0xd8dd('0x77')]);loggerPredictive['info'](_0xd8dd('0x8e'),_0x2fb85f[_0xd8dd('0x90')]);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x87'));_[_0xd8dd('0x91')](_0x438ae8,_0x2fb85f);};}function getDiff(_0xd56ccf){var _0x10e67f=moment()[_0xd8dd('0x92')](0x0);var _0x1e6e3e=moment(_0xd56ccf)[_0xd8dd('0x92')](0x0);return _0x10e67f['diff'](_0x1e6e3e,_0xd8dd('0x4c'));}function ifInterval(_0x2b8581,_0x4bba5b){if(_[_0xd8dd('0x3d')](_0x4bba5b)){return![];}if(getDiff(_0x4bba5b)<_0x2b8581*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x4552ce){if(isNotNull(_0x4552ce)){if(!_[_0xd8dd('0x3d')](_0x4552ce['startProgressive'])){_0x4552ce[_0xd8dd('0x29')]=undefined;loggerPredictive[_0xd8dd('0x7f')](_0x4552ce[_0xd8dd('0x3f')],'clearing\x20variable\x20start\x20progressive');}if(!_[_0xd8dd('0x3d')](_0x4552ce['startPredictive'])){_0x4552ce['startPredictive']=undefined;loggerPredictive[_0xd8dd('0x7f')](_0x4552ce['name'],'clearing\x20variable\x20start\x20predictive');}if(!_[_0xd8dd('0x3d')](_0x4552ce[_0xd8dd('0x93')])){clearInterval(_0x4552ce['handlePredictive']);_0x4552ce[_0xd8dd('0x93')]=undefined;loggerPredictive[_0xd8dd('0x7f')](_0x4552ce[_0xd8dd('0x3f')],_0xd8dd('0x94'));}}}function erlangb(_0x2001ef,_0xedb3f6){if(_0xedb3f6===0x0){return 0x0;}var _0x4ec5e6=0x1;for(var _0x11557a=0x1;_0x11557a<=_0xedb3f6;_0x11557a+=0x1){_0x4ec5e6=0x1+_0x4ec5e6*_0x11557a/_0x2001ef;}return 0x1/_0x4ec5e6;}function isVoiceQueueOutbound(_0x2b68ac){return _0x2b68ac==='outbound';}function isNotPreview(_0x28dbd2){return _0x28dbd2!=='preview';}function isCampaignIvr(_0x323297){return _0x323297===_0xd8dd('0x95');}function getCallerId(_0x31c1d9,_0x2036e6,_0x5717ed){if(!_['isUndefined'](_0x5717ed)&&_0xd8dd('0x96')===typeof _0x5717ed&&!_[_0xd8dd('0x47')](_0x5717ed)){if(!_[_0xd8dd('0x3d')](_0x2036e6)&&_0xd8dd('0x96')===typeof _0x2036e6&&!_[_0xd8dd('0x47')](_0x2036e6)){return util['format']('\x22%s\x22\x20<%s>',_0x2036e6,_0x5717ed);}return util['format'](_0xd8dd('0x97'),_0x5717ed,_0x5717ed);}if(!_[_0xd8dd('0x3d')](_0x31c1d9)&&_0xd8dd('0x96')===typeof _0x31c1d9&&!_[_0xd8dd('0x47')](_0x31c1d9)){return _0x31c1d9;}return _0xd8dd('0x98');}function loggerCatchQueueSummary(_0x5c4365,_0x47097e){return function(_0x41f349){freeVariablesPredictive(_0x47097e);emitVoiceQueueSummary(_0x47097e);emitCampaignSummary(_0x47097e);loggerSyncQueueSummary[_0xd8dd('0x99')](_0x5c4365,util[_0xd8dd('0x9a')](_0x41f349,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x1a2cdf,_0x5cbf8b){return function(_0x1e23cc){loggerPredictive['error'](_0x5cbf8b['name'],_0x1a2cdf);loggerPredictive[_0xd8dd('0x99')](_0x1e23cc[_0xd8dd('0x9b')]);freeVariablesPredictive(_0x5cbf8b);};}function loggerCatch(_0x9c0f25){return function(_0x59b68a){logger[_0xd8dd('0x99')](_0x9c0f25,util['inspect'](_0x59b68a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x52f94a){return _0x52f94a&&!_[_0xd8dd('0x3d')](_0x52f94a)&&_0x52f94a['length']>0x0;}function decremetOriginate(_0x555b8a){if(!_[_0xd8dd('0x3d')](_0x555b8a)&&_0x555b8a!==null){if(_0x555b8a[_0xd8dd('0x9c')]('originated')){if(_0x555b8a[_0xd8dd('0x75')]>0x0){_0x555b8a['originated']-=0x1;}else{logger[_0xd8dd('0x99')](_0xd8dd('0x9d'));}}}else{logger[_0xd8dd('0x99')]('[decremetOriginate]\x20is\x20null\x20or\x20undefined');}}function checkContactLowerLimitOriginate(_0x2bbefb,_0x493245,_0x510371){if(_0x493245>_0x510371){for(var _0x3affb8=0x0;_0x3affb8<_0x493245-_0x510371;_0x3affb8+=0x1){decremetOriginate(_0x2bbefb);}}}function loggerGetContactDialer(_0x2e1d3f,_0x3bcf43,_0x453480){return function(_0x2afd91){checkContactLowerLimitOriginate(_0x3bcf43,_0x453480,0x0);logger[_0xd8dd('0x99')](_0x2e1d3f,util[_0xd8dd('0x9a')](_0x2afd91,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x35c11d){return function(_0x597ec8){if(isNotNull(_0x597ec8)&&isNotNull(_0x597ec8[0x0])){if(_0x597ec8[0x0]['contactsRescheduled']>0x0){_0x35c11d[_0xd8dd('0x40')]=_0xd8dd('0x9e');logger[_0xd8dd('0x7f')]('[getContactDialer2][ReScheduled]'+_0x35c11d[_0xd8dd('0x3f')],_0x597ec8[0x0]['contactsRescheduled'],_0xd8dd('0x9f'));}else{_0x35c11d['message']=_0xd8dd('0xa0');logger[_0xd8dd('0x7f')](_0xd8dd('0xa1')+_0x35c11d[_0xd8dd('0x3f')]);}}};}function notSendMessagesQueue(_0x3505f8){if(_0x3505f8[_0xd8dd('0xa2')]){freeVariablesPredictive(_0x3505f8);if(_0x3505f8['originated']===0x0&&_0x3505f8[_0xd8dd('0xa3')]===0x0&&_0x3505f8[_0xd8dd('0x58')]===0x0&&(_0x3505f8[_0xd8dd('0x53')]||0x0)===0x0){_0x3505f8['sendMessageOneNotActive']=![];_0x3505f8[_0xd8dd('0x51')]=0x0;_0x3505f8[_0xd8dd('0x40')]=_0xd8dd('0x41');loggerSyncQueueSummary[_0xd8dd('0x99')](_0xd8dd('0xa4'),_0x3505f8[_0xd8dd('0x3f')],_0xd8dd('0xa5'));}else{_0x3505f8[_0xd8dd('0x40')]='IS_DISACTIVED';loggerSyncQueueSummary[_0xd8dd('0x99')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x3505f8[_0xd8dd('0x3f')],_0xd8dd('0xa6'));}emitVoiceQueueSummary(_0x3505f8);}}function notSendMessagesCampaign(_0x431f9e){if(_0x431f9e[_0xd8dd('0xa2')]){if(_0x431f9e['originated']===0x0){_0x431f9e[_0xd8dd('0xa2')]=![];_0x431f9e[_0xd8dd('0x40')]='NOT_ACTIVE';loggerSyncQueueSummary[_0xd8dd('0x99')](_0xd8dd('0xa7'),_0x431f9e[_0xd8dd('0x3f')],_0xd8dd('0xa5'));}else{_0x431f9e[_0xd8dd('0x40')]=_0xd8dd('0xa8');loggerSyncQueueSummary[_0xd8dd('0x99')](_0xd8dd('0xa7'),_0x431f9e[_0xd8dd('0x3f')],_0xd8dd('0xa6'));}emitCampaignSummary(_0x431f9e);}}function createObjHistory(_0x47bffd,_0x2e241f,_0x4477a2,_0x65d054,_0x210da4){_0x47bffd[_0xd8dd('0x40')]=_0x4477a2;var _0x10b02d=new Action(_0x47bffd,_0x2e241f);var _0x2388dd=new History(_0x10b02d);_0x2388dd['state']=_0x65d054;_0x2388dd[_0xd8dd('0xa9')]=_0x210da4;_0x2388dd['endtime']=_0x10b02d['starttime'];return _0x2388dd;}Dialer[_0xd8dd('0xaa')][_0xd8dd('0x3c')]=function(){var _0x41a0c8=this;setInterval(function(){_0x41a0c8['clearZombieChannels'](_0x41a0c8['uniqueId'],_0xd8dd('0xab'));_0x41a0c8[_0xd8dd('0xac')](_0x41a0c8[_0xd8dd('0x25')],_0xd8dd('0xad'));},0x32c8);};Dialer['prototype']['clearZombieChannels']=function(_0x7e59ea,_0x44daec){var _0x2f083b=this;for(var _0x1898fb in _0x7e59ea){if(_0x7e59ea['hasOwnProperty'](_0x1898fb)){this[_0xd8dd('0x1d')][_0xd8dd('0xae')](function(){if(!_['isNil'](_0x7e59ea[_0x1898fb])){return ami[_0xd8dd('0xaf')]({'action':_0xd8dd('0xb0'),'channel':_0x7e59ea[_0x1898fb]['channel']})[_0xd8dd('0xb1')](function(_0x22ddd2){if(_0x22ddd2['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x7e59ea[_0x1898fb]&&_0x7e59ea[_0x1898fb][_0xd8dd('0x4e')]!==_0xd8dd('0x95')){_0x2f083b['updateOriginated'](_0x2f083b[_0xd8dd('0x1f')][_0x7e59ea[_0x1898fb]['queue']]);logger['error']('[Dialer][checkChannel]',_0x44daec,_0x1898fb,_0x7e59ea[_0x1898fb][_0xd8dd('0xb2')]);delete _0x7e59ea[_0x1898fb];}if(_0x7e59ea[_0x1898fb]&&_0x7e59ea[_0x1898fb][_0xd8dd('0x4e')]===_0xd8dd('0x95')){_0x2f083b['updateOriginated'](_0x2f083b[_0xd8dd('0x20')][_0x7e59ea[_0x1898fb][_0xd8dd('0xb2')]]);logger[_0xd8dd('0x99')](_0xd8dd('0xb3'),_0x44daec,_0x1898fb,_0x7e59ea[_0x1898fb][_0xd8dd('0xb2')]);delete _0x7e59ea[_0x1898fb];}},0x2328);}});}});}}};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xb4')]=function(_0x423845){return BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](cmHopper[_0xd8dd('0xb4')](_0x423845))['catch'](loggerCatch(_0xd8dd('0xb7')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xb8')]=function(_0x34ea38){return BPromise[_0xd8dd('0xb5')]()['then'](cmHopperBlack[_0xd8dd('0xb8')](_0x34ea38))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xb9')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xba')]=function(_0x5ad70f){return BPromise['resolve']()[_0xd8dd('0xb6')](cmHopperBlack[_0xd8dd('0xba')](_0x5ad70f))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xbb')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xbc')]=function(_0x1bb8db){return BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](cmHopperHistory[_0xd8dd('0xbd')](_0x1bb8db))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xbe')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xbf')]=function(_0x3aa30a){return BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](cmHopper['rescheduleContact'](_0x3aa30a))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xc0')));};Dialer['prototype']['unlockContact']=function(_0x3deff5,_0x3cdc38,_0x48d1e2){return BPromise['resolve']()[_0xd8dd('0xb6')](cmHopper[_0xd8dd('0xc1')](_0x3deff5,_0x3cdc38,_0x48d1e2))[_0xd8dd('0xb1')](loggerCatch('[unlockContact]\x20'));};Dialer[_0xd8dd('0xaa')]['getContactDialer']=function(_0x35fcdc,_0x1709bd,_0x13c3d5,_0x41a6e4){return BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](cmHopper[_0xd8dd('0xc2')](_0x35fcdc,_0x1709bd,_0x13c3d5,_0x41a6e4))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xc3')));};Dialer['prototype'][_0xd8dd('0xc4')]=function(_0x19bbd4,_0x5c5829,_0x3b9b07){return BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](cmHopper['getContactDialerIvr'](_0x19bbd4,_0x5c5829,_0x3b9b07))[_0xd8dd('0xb1')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xc5')]=function(_0x4c60a6){return BPromise[_0xd8dd('0xb5')]()['then'](voiceQueueRt['getVoiceQueueRtPauses'](_0x4c60a6))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xc6')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xc7')]=function(_0x90a2c){return BPromise[_0xd8dd('0xb5')]()['then'](cmHopper['moveContactManagedDialer'](_0x90a2c))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xc8')));};Dialer['prototype'][_0xd8dd('0xc9')]=function(_0x3c2c87){return BPromise[_0xd8dd('0xb5')]()['then'](cmHopperHistory[_0xd8dd('0xc9')](_0x3c2c87))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xca')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xcb')]=function(_0x491b53){if(!_['isUndefined'](_0x491b53)&&_0x491b53!==null){if(_0x491b53['hasOwnProperty']('originated')){if(_0x491b53[_0xd8dd('0x75')]>0x0){_0x491b53[_0xd8dd('0x75')]-=0x1;}else{logger['error'](_0xd8dd('0xcc'));}}}else{logger[_0xd8dd('0x99')](_0xd8dd('0xcd'));}};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xce')]=function(_0x2a64ff,_0xde2aaf){var _0x2180fe=this;return function(_0x2ea018){_0x2180fe[_0xd8dd('0xcb')](_0xde2aaf);logger[_0xd8dd('0x99')](_0x2a64ff,util['inspect'](_0x2ea018,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0xd8dd('0xcf')]=function(_0x278d84,_0x684b70,_0x1795b7){var _0x4e2215={'state':0x19,'statedesc':_0xd8dd('0xd0')};this['updateOriginated'](_0x684b70);this[_0xd8dd('0xd1')](_[_0xd8dd('0x91')](_0x4e2215,_[_0xd8dd('0xd2')](_0x1795b7,[_0xd8dd('0xd3'),'ListId',_0xd8dd('0xd4'),_0xd8dd('0xd5'),_0xd8dd('0xd6')])),'[emptyContact][createHistory]',_0xd8dd('0xd7'));logger[_0xd8dd('0x99')](_0x278d84);};Dialer['prototype'][_0xd8dd('0xd8')]=function(_0x3166cb){return _0x3166cb===_0xd8dd('0xd9');};Dialer['prototype'][_0xd8dd('0xda')]=function(_0x296f95){return!_['isUndefined'](_0x296f95)&&_0x296f95&&!_['isUndefined'](_0x296f95['name'])&&!_[_0xd8dd('0x3d')](_0x296f95[_0xd8dd('0x7a')])&&_0x296f95['active']&&(this[_0xd8dd('0x22')][util['format'](_0xd8dd('0xdb'),_0x296f95['name'])][_0xd8dd('0xb0')]===_0xd8dd('0xdc')||this[_0xd8dd('0x22')][util[_0xd8dd('0xdd')](_0xd8dd('0xdb'),_0x296f95[_0xd8dd('0x3f')])][_0xd8dd('0xb0')]==='unmonitored');};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xd1')]=function(_0xd20f01,_0x54bb72,_0x3d63e5){this['createHistory'](_0xd20f01)[_0xd8dd('0xb1')](loggerCatch(_0x54bb72));this['moveContactManagedDialer'](_0xd20f01)[_0xd8dd('0xb1')](loggerCatch(_0x3d63e5));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xde')]=function(_0x4ba6d3){var _0x1610c2=this[_0xd8dd('0x27')][_0x4ba6d3[_0xd8dd('0xdf')]];var _0x7fbe83;if(!_[_0xd8dd('0xe0')](_0x4ba6d3)&&!_[_0xd8dd('0xe0')](_0x4ba6d3['variable'])&&!_[_0xd8dd('0xe0')](_0x4ba6d3[_0xd8dd('0xe1')][_0xd8dd('0xe2')])&&_0x4ba6d3[_0xd8dd('0xe3')]===_0xd8dd('0xe4')&&_0x1610c2){if(_0x1610c2[_0xd8dd('0x4e')]!==_0xd8dd('0x95')&&this['voiceQueues'][_0x1610c2['queue']][_0xd8dd('0xe5')]&&_0x4ba6d3[_0xd8dd('0xe6')]==='HANGUP'){delete this[_0xd8dd('0x27')][_0x4ba6d3[_0xd8dd('0xdf')]];this[_0xd8dd('0xcb')](this[_0xd8dd('0x1f')][_0x1610c2[_0xd8dd('0xb2')]]);this[_0xd8dd('0x1f')][_0x1610c2[_0xd8dd('0xb2')]]['outboundAnswerCallsDay']+=0x1;this['voiceQueues'][_0x1610c2[_0xd8dd('0xb2')]][_0xd8dd('0x5f')]+=0x1;_0x7fbe83=new Hangup(_0x1610c2,_0x4ba6d3);_0x7fbe83[_0xd8dd('0xe7')]=0x12;_0x7fbe83[_0xd8dd('0xa9')]=_0xd8dd('0xe8');_0x7fbe83[_0xd8dd('0xe9')]=_0xd8dd('0xea');this[_0xd8dd('0xd1')](_0x7fbe83,'[syncHangupInAMD][createHistory]',_0xd8dd('0xeb'));}if(_0x1610c2[_0xd8dd('0x4e')]!==_0xd8dd('0x95')&&this['voiceQueues'][_0x1610c2[_0xd8dd('0xb2')]][_0xd8dd('0xe5')]&&_0x4ba6d3['value']===_0xd8dd('0xec')){delete this[_0xd8dd('0x27')][_0x4ba6d3['uniqueid']];this[_0xd8dd('0xcb')](this[_0xd8dd('0x1f')][_0x1610c2[_0xd8dd('0xb2')]]);this[_0xd8dd('0x1f')][_0x1610c2[_0xd8dd('0xb2')]]['outboundAnswerCallsDay']+=0x1;this[_0xd8dd('0x1f')][_0x1610c2[_0xd8dd('0xb2')]]['outboundAnswerAgiCallsDay']+=0x1;_0x7fbe83=new Hangup(_0x1610c2,_0x4ba6d3);_0x7fbe83['state']=0x13;_0x7fbe83[_0xd8dd('0xa9')]=_0xd8dd('0xed');_0x7fbe83[_0xd8dd('0xe9')]=_0xd8dd('0xea');_0x7fbe83[_0xd8dd('0xee')]=!![];this[_0xd8dd('0xd1')](_0x7fbe83,'[syncMachine][createHistory]',_0xd8dd('0xef'));}if(_0x1610c2[_0xd8dd('0x4e')]===_0xd8dd('0x95')&&this[_0xd8dd('0x20')][_0x1610c2['queue']][_0xd8dd('0xe5')]&&_0x4ba6d3['value']===_0xd8dd('0xf0')){delete this[_0xd8dd('0x27')][_0x4ba6d3[_0xd8dd('0xdf')]];this[_0xd8dd('0xcb')](this['campaigns'][_0x1610c2[_0xd8dd('0xb2')]]);_0x7fbe83=new Hangup(_0x1610c2,_0x4ba6d3);_0x7fbe83[_0xd8dd('0xe7')]=0x12;_0x7fbe83[_0xd8dd('0xa9')]=_0xd8dd('0xe8');_0x7fbe83[_0xd8dd('0xe9')]=_0xd8dd('0xea');this[_0xd8dd('0xd1')](_0x7fbe83,'[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]');}if(_0x1610c2['type']===_0xd8dd('0x95')&&this[_0xd8dd('0x20')][_0x1610c2[_0xd8dd('0xb2')]][_0xd8dd('0xe5')]&&_0x4ba6d3['value']===_0xd8dd('0xec')){delete this['uniqueId'][_0x4ba6d3['uniqueid']];this[_0xd8dd('0xcb')](this[_0xd8dd('0x20')][_0x1610c2[_0xd8dd('0xb2')]]);_0x7fbe83=new Hangup(_0x1610c2,_0x4ba6d3);_0x7fbe83[_0xd8dd('0xe7')]=0x13;_0x7fbe83[_0xd8dd('0xa9')]=_0xd8dd('0xed');_0x7fbe83[_0xd8dd('0xe9')]='AMD';_0x7fbe83[_0xd8dd('0xee')]=!![];this[_0xd8dd('0xd1')](_0x7fbe83,_0xd8dd('0xf1'),'[syncMachineIvr]');}}};Dialer[_0xd8dd('0xaa')]['syncHangup']=function(_0x1f4d2b){var _0x454f0e=this[_0xd8dd('0x27')][_0x1f4d2b[_0xd8dd('0xdf')]];var _0x104fd3=this;var _0x4f610a;if(_0x454f0e&&_0x454f0e['type']===_0xd8dd('0x95')){delete this['uniqueId'][_0x1f4d2b['uniqueid']];this[_0xd8dd('0xcb')](this[_0xd8dd('0x20')][_0x454f0e['queue']]);this[_0xd8dd('0x20')][_0x454f0e['queue']][_0xd8dd('0xf2')]+=0x1;_0x4f610a=new Hangup(_0x454f0e,_0x1f4d2b);this[_0xd8dd('0xc9')](_0x4f610a)['catch'](loggerCatch(_0xd8dd('0xf3')));this['moveContactManagedDialer'](_0x4f610a)['catch'](loggerCatch(_0xd8dd('0xf4')));}if(_0x454f0e&&_0x454f0e['type']!==_0xd8dd('0x95')&&isNotNull(this[_0xd8dd('0x1f')][_0x454f0e[_0xd8dd('0xb2')]][_0xd8dd('0xf5')])){delete this['uniqueId'][_0x1f4d2b[_0xd8dd('0xdf')]];this[_0xd8dd('0xcb')](this[_0xd8dd('0x1f')][_0x454f0e[_0xd8dd('0xb2')]]);this['voiceQueues'][_0x454f0e[_0xd8dd('0xb2')]][_0xd8dd('0x60')]+=0x1;this['voiceQueues'][_0x454f0e[_0xd8dd('0xb2')]][_0xd8dd('0x5f')]+=0x1;_0x4f610a=new Hangup(_0x454f0e,_0x1f4d2b);_0x4f610a[_0xd8dd('0xe7')]=0x10;_0x4f610a[_0xd8dd('0xa9')]=_0xd8dd('0xf6');_0x4f610a[_0xd8dd('0xe9')]='AGI';this[_0xd8dd('0xc9')](_0x4f610a)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xf3')));this[_0xd8dd('0xc7')](_0x4f610a)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x454f0e&&_0x454f0e[_0xd8dd('0x4e')]!==_0xd8dd('0x95')&&!isNotNull(this['voiceQueues'][_0x454f0e[_0xd8dd('0xb2')]]['dialQueueProject'])){delete this[_0xd8dd('0x27')][_0x1f4d2b[_0xd8dd('0xdf')]];this[_0xd8dd('0xcb')](this[_0xd8dd('0x1f')][_0x454f0e[_0xd8dd('0xb2')]]);this[_0xd8dd('0x1f')][_0x454f0e[_0xd8dd('0xb2')]][_0xd8dd('0x69')]+=0x1;_0x4f610a=new Hangup(_0x454f0e,_0x1f4d2b);_0x4f610a[_0xd8dd('0xe7')]=0xc;_0x4f610a['statedesc']=_0x1f4d2b[_0xd8dd('0xf7')];_0x4f610a['membername']='Unknow';this[_0xd8dd('0xc9')](_0x4f610a)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xf3')));this[_0xd8dd('0xc7')](_0x4f610a)['catch'](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x33')]=function(_0x18ba52){var _0x3b6813=this[_0xd8dd('0x27')][_0x18ba52[_0xd8dd('0xdf')]];var _0x195697=this;if(this[_0xd8dd('0x1f')][_0x18ba52[_0xd8dd('0xb2')]]){if(_0x3b6813&&_0x3b6813['type']!==_0xd8dd('0x95')){delete this[_0xd8dd('0x27')][_0x18ba52['uniqueid']];this[_0xd8dd('0x1f')][_0x18ba52[_0xd8dd('0xb2')]][_0xd8dd('0x60')]+=0x1;var _0x3ce20c=new AgentComplete(_0x3b6813,_0x18ba52);if(_0x18ba52[_0xd8dd('0xf8')]===_0xd8dd('0xf9')){_0x3ce20c[_0xd8dd('0xfa')]=this[_0xd8dd('0x1f')][_0x18ba52[_0xd8dd('0xb2')]]['dialQueueProject2']&&this[_0xd8dd('0x1f')][_0x18ba52[_0xd8dd('0xb2')]][_0xd8dd('0xfb')]?moment()[_0xd8dd('0xdd')](_0xd8dd('0xfc')):undefined;}this[_0xd8dd('0xc9')](_0x3ce20c)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xfd')));this[_0xd8dd('0xc7')](_0x3ce20c)[_0xd8dd('0xb1')](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0xd8dd('0xaa')]['syncAgentConnect']=function(_0x1a684b){if(this[_0xd8dd('0x1f')][_0x1a684b[_0xd8dd('0xb2')]]){if(this[_0xd8dd('0x27')][_0x1a684b[_0xd8dd('0xdf')]]&&this['uniqueId'][_0x1a684b[_0xd8dd('0xdf')]]['type']!==_0xd8dd('0x95')){this['updateOriginated'](this['voiceQueues'][_0x1a684b[_0xd8dd('0xb2')]]);this[_0xd8dd('0x27')][_0x1a684b[_0xd8dd('0xdf')]]['answertime']=moment()[_0xd8dd('0xdd')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer['prototype'][_0xd8dd('0xfe')]=function(_0xbf4ff8){this[_0xd8dd('0xc9')](_0xbf4ff8)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xfd')));this[_0xd8dd('0xc7')](_0xbf4ff8)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xff')));};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x100')]=function(_0x264445){var _0xedc33a=this['uniqueId'][_0x264445['uniqueid']];var _0x280b89=this;if(this[_0xd8dd('0x1f')][_0x264445[_0xd8dd('0xb2')]]){if(_0xedc33a&&_0xedc33a[_0xd8dd('0x4e')]!=='ivr'){delete this['uniqueId'][_0x264445['uniqueid']];this[_0xd8dd('0xcb')](this[_0xd8dd('0x1f')][_0x264445[_0xd8dd('0xb2')]]);_0xedc33a['droptime']=moment()[_0xd8dd('0xdd')]('YYYY-MM-DD\x20HH:mm:ss');var _0x97ae3e=new QueueCallerAbandon(_0xedc33a,_0x264445);if(getSeconds(_0xedc33a[_0xd8dd('0x101')],_0xedc33a[_0xd8dd('0x102')])>=_0xedc33a[_0xd8dd('0x103')]){this[_0xd8dd('0x1f')][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x6d')]+=0x1;this['voiceQueues'][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x64')]+=0x1;this[_0xd8dd('0x1f')][_0x264445['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x97ae3e[_0xd8dd('0xe7')]=0xa;_0x97ae3e[_0xd8dd('0xa9')]=_0xd8dd('0x104');_0x97ae3e[_0xd8dd('0x105')]=_0xd8dd('0x106');_0x97ae3e[_0xd8dd('0xfa')]=this[_0xd8dd('0x1f')][_0x264445['queue']][_0xd8dd('0x107')]?moment()[_0xd8dd('0xdd')](_0xd8dd('0xfc')):undefined;if(_0x97ae3e[_0xd8dd('0x108')]>=this['voiceQueues'][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x109')]-0x1){this[_0xd8dd('0xfe')](_0x97ae3e);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x97ae3e[_0xd8dd('0x108')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](this['voiceQueues'][_0x264445[_0xd8dd('0xb2')]]['dialDropRetryFrequency'],'minutes')[_0xd8dd('0xdd')](_0xd8dd('0xfc')),'ContactId':_0xedc33a[_0xd8dd('0xd3')],'ListId':_0xedc33a[_0xd8dd('0x10b')],'VoiceQueueId':_0xedc33a[_0xd8dd('0xd5')]||undefined,'CampaignId':_0xedc33a[_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x10c')));}}else{this[_0xd8dd('0x1f')][_0x264445['queue']]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this[_0xd8dd('0x1f')][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x63')]+=0x1;_0x97ae3e[_0xd8dd('0xe7')]=0xb;_0x97ae3e[_0xd8dd('0xa9')]=_0xd8dd('0x10d');_0x97ae3e['dropreason']=_0xd8dd('0x10e');if(_0x97ae3e[_0xd8dd('0x10f')]>=this['voiceQueues'][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x110')]-0x1){this['queueCallerAbandonCreateState'](_0x97ae3e);}else{this['rescheduleContact']({'active':![],'countabandonedretry':_0x97ae3e[_0xd8dd('0x10f')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](this['voiceQueues'][_0x264445[_0xd8dd('0xb2')]][_0xd8dd('0x111')],'minutes')[_0xd8dd('0xdd')](_0xd8dd('0xfc')),'ContactId':_0xedc33a['ContactId'],'ListId':_0xedc33a[_0xd8dd('0x10b')],'VoiceQueueId':_0xedc33a[_0xd8dd('0xd5')]||undefined,'CampaignId':_0xedc33a['CampaignId']||undefined})['catch'](loggerCatch(_0xd8dd('0x112')));}}}}};Dialer['prototype'][_0xd8dd('0x38')]=function(_0x3c81e6){if(this['actions'][_0x3c81e6[_0xd8dd('0xdf')]]){this['actions'][_0x3c81e6[_0xd8dd('0xdf')]][_0xd8dd('0x113')]=_0x3c81e6[_0xd8dd('0x113')];}if(this[_0xd8dd('0x27')][_0x3c81e6['uniqueid']]){this[_0xd8dd('0x27')][_0x3c81e6[_0xd8dd('0xdf')]][_0xd8dd('0x113')]=_0x3c81e6['channel'];}};Dialer['prototype'][_0xd8dd('0x114')]=function(_0x31f5ee){if(strategy[this['voiceQueues'][this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0xb2')]][_0xd8dd('0x4f')]]===_0xd8dd('0x116')){if(this['actions'][_0x31f5ee[_0xd8dd('0x115')]]&&_[_0xd8dd('0xe0')](this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0x117')])&&_0x31f5ee[_0xd8dd('0xb0')]==='1'&&_0x31f5ee[_0xd8dd('0x118')]==='0'){if(this[_0xd8dd('0x21')][_0x31f5ee[_0xd8dd('0x119')]]){if(!this[_0xd8dd('0x21')][_0x31f5ee[_0xd8dd('0x119')]][_0xd8dd('0x117')]){this[_0xd8dd('0x21')][_0x31f5ee[_0xd8dd('0x119')]][_0xd8dd('0x117')]=!![];this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0x117')]=!![];this['actions'][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0x119')]=_0x31f5ee[_0xd8dd('0x119')];}}}}else if((strategy[this['voiceQueues'][this['actions'][_0x31f5ee['actionid']]['queue']]['strategy']]||_0xd8dd('0x1a'))===_0xd8dd('0x1a')){if(this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]]){if(this[_0xd8dd('0x21')][_0x31f5ee[_0xd8dd('0x119')]]){this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0x119')]=_0x31f5ee['stateinterface'];if(_[_0xd8dd('0xe0')](this[_0xd8dd('0x11a')][this['actions'][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0xb2')]])){this['queueBooked'][this[_0xd8dd('0x25')][_0x31f5ee[_0xd8dd('0x115')]][_0xd8dd('0xb2')]]=[];}this[_0xd8dd('0x11a')][this[_0xd8dd('0x25')][_0x31f5ee['actionid']][_0xd8dd('0xb2')]][_0xd8dd('0x11b')](_[_0xd8dd('0x91')](_[_0xd8dd('0xd2')](this[_0xd8dd('0x25')][_0x31f5ee['actionid']],[_0xd8dd('0x11c'),'stateinterface']),{'status':_0x31f5ee[_0xd8dd('0xb0')],'paused':_0x31f5ee[_0xd8dd('0x118')]}));}}}};function unlockQueueStatus(_0x4714c0,_0x25a9fc){setTimeout(function(){if(_[_0xd8dd('0x3d')](_0x4714c0[_0xd8dd('0x11d')])){loggerBooked[_0xd8dd('0x99')](_0xd8dd('0x11e'),_0x25a9fc);}_0x4714c0[_0xd8dd('0x11d')]=!![];loggerBooked[_0xd8dd('0x7f')]('[booked][unlockQueueStatus]',_0x25a9fc,JSON[_0xd8dd('0x4a')](_['pick'](_0x4714c0,[_0xd8dd('0x3f'),_0xd8dd('0x11d')])));},0x1f3);}Dialer[_0xd8dd('0xaa')][_0xd8dd('0x11f')]=function(_0x339354){var _0x51d53e=this;var _0x1da5d5=_0x51d53e['voiceQueues'][_0x51d53e[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xb2')]];if(strategy[this[_0xd8dd('0x1f')][this['actions'][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xb2')]][_0xd8dd('0x4f')]]===_0xd8dd('0x116')){if(this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]]&&this[_0xd8dd('0x25')][_0x339354['actionid']][_0xd8dd('0x119')]){this[_0xd8dd('0x1e')][_0xd8dd('0x120')](this[_0xd8dd('0x25')][_0x339354['actionid']][_0xd8dd('0x11c')],this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]]['stateinterface'])[_0xd8dd('0xb1')](function(_0x278163){logger[_0xd8dd('0x99')](_0xd8dd('0x121'),util[_0xd8dd('0x9a')](_0x278163,{'showHidden':![],'depth':null}));})['finally'](function(){_0x51d53e[_0xd8dd('0xcb')](_0x51d53e['voiceQueues'][_0x51d53e[_0xd8dd('0x25')][_0x339354['actionid']][_0xd8dd('0xb2')]]);_0x51d53e[_0xd8dd('0x21')][_0x51d53e[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0x119')]][_0xd8dd('0x117')]=![];delete _0x51d53e[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]];unlockQueueStatus(_0x1da5d5);});}else{this[_0xd8dd('0xcb')](this['voiceQueues'][this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]]['queue']]);this[_0xd8dd('0xbf')]({'active':![],'ContactId':this['actions'][_0x339354['actionid']][_0xd8dd('0xd3')],'ListId':this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0x10b')],'VoiceQueueId':this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xd5')]||undefined,'CampaignId':this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xd6')]||undefined})['catch'](loggerCatch(_0xd8dd('0x122')));delete this['actions'][_0x339354[_0xd8dd('0x115')]];unlockQueueStatus(_0x1da5d5);}}else if((strategy[this[_0xd8dd('0x1f')][this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]]['queue']]['strategy']]||_0xd8dd('0x1a'))===_0xd8dd('0x1a')){var _0x35f917;if(this['actions'][_0x339354[_0xd8dd('0x115')]]&&!_[_0xd8dd('0x47')](this['queueBooked'][this['actions'][_0x339354[_0xd8dd('0x115')]]['queue']])){if(this[_0xd8dd('0x2b')][_0x51d53e[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xb2')]]){this[_0xd8dd('0x2b')][_0x51d53e['actions'][_0x339354['actionid']][_0xd8dd('0xb2')]]=this[_0xd8dd('0x2b')][this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]]['queue']]?this['queueBookedRR'][this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xb2')]]:this['queueBooked'][this[_0xd8dd('0x25')][_0x339354[_0xd8dd('0x115')]][_0xd8dd('0xb2')]]?this['queueBooked'][this[_0xd8dd('0x25')][_0x339354['actionid']][_0xd8dd('0xb2')]][_0xd8dd('0x123')]||0x0:0x0;}this[_0xd8dd('0x11a')][this[_0xd8dd('0x25')][_0x339354['actionid']][_0xd8dd('0xb2')]]['_rr']=this[_0xd8dd('0x2b')][this['actions'][_0x339354['actionid']][_0xd8dd('0xb2')]];for(var _0x422951=0x0;_0x422951=0x0?!![]:![];})[_0xd8dd('0xb1')](myreject(_0x2df72c)));}}else{_0x4cd8ab['push'](ami[_0xd8dd('0xaf')]({'action':_0xd8dd('0x137'),'command':util[_0xd8dd('0xdd')](_0xd8dd('0x138'),_0x2de3e7,!_[_0xd8dd('0x3d')](config[_0xd8dd('0x134')][_0x14043c])?_0x14043c:'')})['then'](function(_0x519811){return _0x519811[_0xd8dd('0x13c')]['indexOf'](_0xd8dd('0x13b'))>=0x0?!![]:![];})[_0xd8dd('0xb1')](myreject(_0x2df72c)));}BPromise['all'](_0x4cd8ab)[_0xd8dd('0xb6')](function(_0xebd434){var _0x4f27d7=_[_0xd8dd('0x13d')](_0xebd434);if(_0x4f27d7){return _0x389af5(_0x4f27d7);}else{_0xbe29c0[_0xd8dd('0x40')]=_0x484283?_0xd8dd('0x13e'):_0xd8dd('0x13f');return _0x2df72c(msgResponse(_0xd8dd('0x140'),_0xd8dd('0x131'),_0xd8dd('0x141')+_0x484283+'\x20'+_0xc79607+_0xd8dd('0x142')+util[_0xd8dd('0x9a')](_0x2de3e7,{'showHidden':![],'depth':null})+_0xd8dd('0x143')+_0x14043c));}})[_0xd8dd('0xb1')](function(_0x32a027){return _0x2df72c(msgResponse('ifTime','Failure',JSON[_0xd8dd('0x4a')](_0x32a027)));});});};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x144')]=function(_0x596dfc){var _0x3cf63a=this;return function(){switch(_0x596dfc[_0xd8dd('0x145')]){case _0xd8dd('0x146'):freeVariablesPredictive(_0x596dfc);_0x3cf63a['handlePower'](_0x596dfc,0x1);break;case _0xd8dd('0x147'):freeVariablesPredictive(_0x596dfc);_0x3cf63a['handlePower'](_0x596dfc,_0x596dfc[_0xd8dd('0x148')]);break;case _0xd8dd('0x9'):_0x3cf63a[_0xd8dd('0x9')](_0x596dfc);break;case'booked':freeVariablesPredictive(_0x596dfc);_0x3cf63a[_0xd8dd('0x149')](_0x596dfc,0x1);break;default:freeVariablesPredictive(_0x596dfc);logger['error'](_0xd8dd('0x14a'),_0x596dfc['name'],'method\x20not\x20recognized');}};};Dialer[_0xd8dd('0xaa')]['launchHandleIvr']=function(_0x53fb03){var _0x293489=this;return function(){_0x293489['handleIvr'](_0x53fb03);};};Dialer[_0xd8dd('0xaa')][_0xd8dd('0xb')]=function(_0x373d71){var _0xb6683f=this;if(isNotPreview(_0x373d71[_0xd8dd('0x145')])){if(isVoiceQueueOutbound(_0x373d71['type'])&&isActive(_0x373d71['dialActive'])){_0x373d71[_0xd8dd('0xa2')]=!![];BPromise[_0xd8dd('0xb5')]()[_0xd8dd('0xb6')](checkIsLoggedIn(_0x373d71,_0x373d71['loggedIn']))[_0xd8dd('0xb6')](checkIsActive(_0x373d71,_0x373d71[_0xd8dd('0x5a')]))['then'](checkInterval(_0x373d71))[_0xd8dd('0xb6')](_0xb6683f['checkIsTrunkReachable'](_0x373d71))[_0xd8dd('0xb6')](_0xb6683f[_0xd8dd('0x14b')](_0x373d71[_0xd8dd('0x14c')],_0x373d71['dialTimezone'],_0x373d71[_0xd8dd('0x3f')],_0x373d71))[_0xd8dd('0xb6')](_0xb6683f[_0xd8dd('0x130')](_0x373d71[_0xd8dd('0x43')],_0x373d71['dialTimezone'],_0x373d71[_0xd8dd('0x3f')],_0x373d71))[_0xd8dd('0xb6')](_0xb6683f[_0xd8dd('0x144')](_0x373d71))[_0xd8dd('0xb1')](loggerCatchQueueSummary(_0xd8dd('0x14d'),_0x373d71));}else{notSendMessagesQueue(_0x373d71);}}else{freeVariablesPredictive(_0x373d71);}};Dialer['prototype']['syncCampaigns']=function(){var _0x1e3aab=this;var _0x2b5f8a;for(var _0x262576 in this[_0xd8dd('0x20')]){if(this['campaigns'][_0xd8dd('0x9c')](_0x262576)){_0x2b5f8a=this[_0xd8dd('0x20')][_0x262576];if(isCampaignIvr(_0x2b5f8a[_0xd8dd('0x4e')])&&isActive(_0x2b5f8a[_0xd8dd('0x7a')])){_0x2b5f8a[_0xd8dd('0xa2')]=!![];BPromise[_0xd8dd('0xb5')]()['then'](checkIsActive(_0x2b5f8a,_0x2b5f8a['active']))[_0xd8dd('0xb6')](checkInterval(_0x2b5f8a))[_0xd8dd('0xb6')](_0x1e3aab[_0xd8dd('0x12e')](_0x2b5f8a))[_0xd8dd('0xb6')](_0x1e3aab['checkIfTime'](_0x2b5f8a['dialGlobalInterval'],_0x2b5f8a['dialTimezone'],_0x2b5f8a['name'],_0x2b5f8a))['then'](_0x1e3aab[_0xd8dd('0x130')](_0x2b5f8a[_0xd8dd('0x43')],_0x2b5f8a[_0xd8dd('0x14e')],_0x2b5f8a['name'],_0x2b5f8a))[_0xd8dd('0xb6')](_0x1e3aab['launchHandleIvr'](_0x2b5f8a))['catch'](loggerCatchQueueSummary(_0xd8dd('0x14f'),_0x2b5f8a));}else{notSendMessagesCampaign(_0x2b5f8a);}}}};function getCallerIdRandom(_0x711f33,_0x5ebb65){var _0x1f99b8,_0x215e88,_0x29e4d9;if(_0x5ebb65<=0x0){_0x5ebb65=0x1;}_0x1f99b8=new RegExp(_0xd8dd('0x150')+_0x5ebb65+'}$');_0x215e88=Math['pow'](0xa,_0x5ebb65-0x1);_0x29e4d9=Math[_0xd8dd('0x151')](0xa,_0x5ebb65)-0x1;return util['format']('%s',_[_0xd8dd('0x152')](_0x711f33,_0x1f99b8,_[_0xd8dd('0x153')](_0x215e88,_0x29e4d9)));}function extractCalleridName(_0x5bf823){var _0x551875=_0x5bf823['match'](/"(.*?)"/);return _0x551875?_0x551875[0x1]:_0x5bf823;}function extractCalleridNumber(_0xea3f42){var _0x5c4507=_0xea3f42[_0xd8dd('0x154')](/<(.*?)>/);return _0x5c4507?_0x5c4507[0x1]:_0xea3f42;}Dialer[_0xd8dd('0xaa')][_0xd8dd('0x155')]=function(_0x278d9e,_0x4e5b60){var _0x5db400=this;var _0x562172=uuid['v4']();this[_0xd8dd('0x25')][_0x562172]=new Action(_0x278d9e,_0x4e5b60,_0x562172);return new BPromise(function(_0x3fa066,_0x1f1b1f){if(_[_0xd8dd('0x3d')](_0x278d9e)&&_0xd8dd('0x156')!==typeof _0x278d9e){return _0x1f1b1f(msgResponse(_0xd8dd('0x157'),_0xd8dd('0x131'),_0xd8dd('0x158')));}if(_[_0xd8dd('0x3d')](_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')])||_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')]===null){return _0x1f1b1f(msgResponse('originate',_0xd8dd('0x131'),_0xd8dd('0x15b')));}var _0x31a891={'XMD-CALLERID':_0x5db400[_0xd8dd('0x25')][_0x562172]['getCaller'](),'XMD-AGI':_0x278d9e[_0xd8dd('0xf5')]?util['format']('\x22agi://%s/square,%s\x22',ipAgi,_0x278d9e['dialQueueProject']):_0xd8dd('0x15c'),'XMD-AGIAFTER':_0x278d9e[_0xd8dd('0x107')]?util[_0xd8dd('0xdd')](_0xd8dd('0x15d'),ipAgi,_0x278d9e[_0xd8dd('0x107')]):_0xd8dd('0x15c'),'XMD-QUEUE':_0x278d9e[_0xd8dd('0x4e')]===_0xd8dd('0x15e')?util[_0xd8dd('0xdd')](_0xd8dd('0x15f'),_0x278d9e[_0xd8dd('0x3f')],_0x278d9e[_0xd8dd('0x160')]||'',_0x278d9e[_0xd8dd('0xfb')]?'c':'',_0x278d9e[_0xd8dd('0x103')]||0x3):_0xd8dd('0x15c'),'XMD-CONTACTID':_0x4e5b60[_0xd8dd('0xd3')],'XMD-CDRTYPE':_0xd8dd('0x6'),'CALLERID(all)':_0x5db400[_0xd8dd('0x25')][_0x562172]['getCaller'](),'XMD-AMD':_0x278d9e[_0xd8dd('0xe5')]?_0xd8dd('0x161'):_0xd8dd('0x15c'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x278d9e['dialAMDActive']){_0x31a891[_0xd8dd('0x162')]=_0x278d9e['dialAMDInitialSilence']||0x9c4;_0x31a891['XMD-AMDGREETING']=_0x278d9e[_0xd8dd('0x163')]||0x5dc;_0x31a891[_0xd8dd('0x164')]=_0x278d9e['dialAMDAfterGreetingSilence']||0x320;_0x31a891[_0xd8dd('0x165')]=_0x278d9e[_0xd8dd('0x166')]||0x1388;_0x31a891['XMD-AMDMINWORDLENGTH']=_0x278d9e[_0xd8dd('0x167')]||0x64;_0x31a891['XMD-AMDBETWEENWORDSSILENCE']=_0x278d9e['dialAMDBetweenWordsSilence']||0x32;_0x31a891['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x278d9e['dialAMDMaximumNumberOfWords']||0x3;_0x31a891[_0xd8dd('0x168')]=_0x278d9e[_0xd8dd('0x169')]||0x100;_0x31a891[_0xd8dd('0x16a')]=_0x278d9e[_0xd8dd('0x16b')]||0x1388;}if(_0x278d9e[_0xd8dd('0x4e')]===_0xd8dd('0x15e')){_0x31a891[_0xd8dd('0x16c')]=_0x4e5b60[_0xd8dd('0xd5')];}else{_0x31a891[_0xd8dd('0x16d')]=_0x4e5b60[_0xd8dd('0xd6')];}for(var _0xca131d in _0x4e5b60[_0xd8dd('0x159')]){if(_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x9c')](_0xca131d)){if(isNotNull(_0x4e5b60[_0xd8dd('0x159')][_0xca131d])&&_0xca131d!=='id'&&_0xca131d!==_0xd8dd('0x16e')&&_0xca131d!==_0xd8dd('0x16f')&&_0xca131d!=='updatedAt'){_0x31a891[util[_0xd8dd('0xdd')](_0xd8dd('0x170'),_0xd8dd('0x171'),_[_0xd8dd('0x172')](_0xca131d))]=_0x4e5b60[_0xd8dd('0x159')][_0xca131d];}}}var _0x3d0c13=_0x5db400[_0xd8dd('0xda')](_0x278d9e[_0xd8dd('0x79')])?getCallerId(_0x278d9e[_0xd8dd('0x79')]['callerid'],_0x278d9e[_0xd8dd('0x5b')],_0x278d9e['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x278d9e[_0xd8dd('0x5c')],_0x278d9e[_0xd8dd('0x173')]):_0x278d9e[_0xd8dd('0x5c')]):getCallerId(_['isNil'](_0x278d9e[_0xd8dd('0x174')])?_0x278d9e[_0xd8dd('0x79')][_0xd8dd('0x7b')]:_0x278d9e['TrunkBackup'][_0xd8dd('0x7b')],_0x278d9e[_0xd8dd('0x5b')],_0x278d9e[_0xd8dd('0x173')]>0x0?getCallerIdRandom(_0x278d9e['dialOriginateCallerIdNumber'],_0x278d9e[_0xd8dd('0x173')]):_0x278d9e[_0xd8dd('0x5c')]);if(_0x3d0c13){_0x31a891['XMD-ORIGINATECALLERIDNAME']=_0x5db400['actions'][_0x562172][_0xd8dd('0x175')]=extractCalleridName(_0x3d0c13);_0x31a891['XMD-ORIGINATECALLERIDNUM']=_0x5db400['actions'][_0x562172]['originatecalleridnum']=extractCalleridNumber(_0x3d0c13);}return ami['Action']({'actionid':_0x562172,'action':_0xd8dd('0x157'),'channel':_0x5db400['isTrunkReachable'](_0x278d9e[_0xd8dd('0x79')])?util[_0xd8dd('0xdd')](_0xd8dd('0x176'),_0x278d9e[_0xd8dd('0x79')][_0xd8dd('0x3f')],isNotNull(_0x278d9e[_0xd8dd('0x5e')])?_0x278d9e[_0xd8dd('0x5e')]['trim']()||'':'',_0x278d9e['dialCutDigit']>0x0?_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')]['substring'](_0x278d9e[_0xd8dd('0x177')]):_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')]):util[_0xd8dd('0xdd')](_0xd8dd('0x176'),_['isNil'](_0x278d9e[_0xd8dd('0x174')])?_0x278d9e[_0xd8dd('0x79')][_0xd8dd('0x3f')]:_0x278d9e[_0xd8dd('0x174')][_0xd8dd('0x3f')],isNotNull(_0x278d9e['dialPrefix'])?_0x278d9e['dialPrefix'][_0xd8dd('0x178')]()||'':'',_0x278d9e[_0xd8dd('0x177')]>0x0?_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')]['substring'](_0x278d9e['dialCutDigit']):_0x4e5b60[_0xd8dd('0x159')][_0xd8dd('0x15a')]),'callerid':_0x3d0c13,'Exten':'xcally-motion-dialer','Context':_0xd8dd('0x179'),'Priority':'1','variable':_0x31a891,'timeout':(_0x278d9e['dialOriginateTimeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x562172})[_0xd8dd('0xb6')](function(_0x3a7ff3){return _0x3fa066(_0x3a7ff3);})[_0xd8dd('0xb1')](function(_0xcc7d11){_0x278d9e[_0xd8dd('0x17a')]+=0x1;var _0x50989b=new History(_0x5db400[_0xd8dd('0x25')][_0x562172]);logger['error'](util['format']('[originateError]:\x20%s',JSON[_0xd8dd('0x4a')](_0xcc7d11)));_0x50989b[_0xd8dd('0xe7')]=0xe;_0x50989b[_0xd8dd('0xa9')]=_0xd8dd('0x17b');_0x50989b[_0xd8dd('0x17c')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x50989b[_0xd8dd('0x17d')]=_0x50989b[_0xd8dd('0x17c')];_0x5db400[_0xd8dd('0xc9')](_0x50989b)['catch'](loggerCatch('[originate][error]'));_0x5db400[_0xd8dd('0xc7')](_0x50989b)[_0xd8dd('0xb1')](loggerCatch('[originate][error]'))[_0xd8dd('0x1c')](function(){delete _0x5db400[_0xd8dd('0x25')][_0x562172];return _0x1f1b1f(msgResponse(_0xd8dd('0x157'),_0xd8dd('0x49'),_0xd8dd('0x17e')));});});});};Dialer[_0xd8dd('0xaa')]['syncOriginateResponse']=function(_0x1a00ee){var _0x4fd614=this[_0xd8dd('0x25')][_0x1a00ee[_0xd8dd('0x115')]];var _0x1f3918=this;if(_0x4fd614){delete this['actions'][_0x1a00ee[_0xd8dd('0x115')]];_0x4fd614[_0xd8dd('0x102')]=moment()[_0xd8dd('0xdd')](_0xd8dd('0xfc'));var _0x6f8a45=_0x4fd614[_0xd8dd('0x4e')]==='ivr'?this['campaigns'][_0x4fd614[_0xd8dd('0xb2')]]:this[_0xd8dd('0x1f')][_0x4fd614[_0xd8dd('0x17f')]()];if(!this[_0xd8dd('0xd8')](_0x1a00ee[_0xd8dd('0x180')])){this['updateOriginated'](_0x6f8a45);return this['callProgressDetecting'](_0x4fd614,_0x6f8a45,_0x1a00ee)[_0xd8dd('0xb6')](function(_0x4e504b){})[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x181')));}else{this[_0xd8dd('0x27')][_0x1a00ee[_0xd8dd('0xdf')]]=_0x4fd614;}}};Dialer['prototype'][_0xd8dd('0x182')]=function(_0x210cc2,_0x13c2a7,_0x46dab8){var _0x4f9c93=new History(_0x13c2a7);if(_0x4f9c93[_0xd8dd('0x183')]+_0x4f9c93['countcongestionretry']+_0x4f9c93[_0xd8dd('0x184')]+_0x4f9c93['countnosuchnumberretry']+_0x4f9c93[_0xd8dd('0x108')]+_0x4f9c93[_0xd8dd('0x10f')]+_0x4f9c93[_0xd8dd('0x185')]+_0x4f9c93[_0xd8dd('0x186')]>=_0x46dab8[_0xd8dd('0x187')]-0x1){return!![];}switch(_0x210cc2){case 0x3:if(_0x4f9c93[_0xd8dd('0x184')]>=_0x46dab8[_0xd8dd('0x188')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countnoanswerretry':_0x4f9c93[_0xd8dd('0x184')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8[_0xd8dd('0x189')],_0xd8dd('0x18a'))[_0xd8dd('0xdd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93[_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x4f9c93[_0xd8dd('0x183')]>=_0x46dab8[_0xd8dd('0x18b')]-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countbusyretry':_0x4f9c93[_0xd8dd('0x183')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8['dialBusyRetryFrequency'],_0xd8dd('0x18a'))[_0xd8dd('0xdd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93[_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x18c')));}break;case 0x8:if(_0x4f9c93[_0xd8dd('0x18d')]>=_0x46dab8['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countcongestionretry':_0x4f9c93['countcongestionretry']+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8['dialCongestionRetryFrequency'],'minutes')[_0xd8dd('0xdd')](_0xd8dd('0xfc')),'ContactId':_0x4f9c93['ContactId'],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93['CampaignId']||undefined})[_0xd8dd('0xb1')](loggerCatch('[rescheduleContact]\x20[Congestion]'));}break;case 0x0:if(_0x4f9c93[_0xd8dd('0x18e')]>=_0x46dab8['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countnosuchnumberretry':_0x4f9c93[_0xd8dd('0x18e')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8[_0xd8dd('0x18f')],_0xd8dd('0x18a'))['format'](_0xd8dd('0xfc')),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93[_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x190')));}break;case 0xa:if(_0x4f9c93['countdropretry']>=_0x46dab8[_0xd8dd('0x109')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0x4f9c93[_0xd8dd('0x108')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8['dialDropRetryFrequency'],_0xd8dd('0x18a'))[_0xd8dd('0xdd')](_0xd8dd('0xfc')),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93['CampaignId']||undefined})['catch'](loggerCatch(_0xd8dd('0x10c')));}break;case 0xb:if(_0x4f9c93['countabandonedretry']>=_0x46dab8['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countabandonedretry':_0x4f9c93[_0xd8dd('0x10f')]+=0x1,'scheduledat':moment()['add'](_0x46dab8['dialAbandonedRetryFrequency'],'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f9c93['ContactId'],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93[_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch('[rescheduleContact][Abandoned]'));}break;case 0x13:if(_0x4f9c93[_0xd8dd('0x185')]>=_0x46dab8[_0xd8dd('0x191')]-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countmachineretry':_0x4f9c93[_0xd8dd('0x185')]+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8['dialMachineRetryFrequency'],_0xd8dd('0x18a'))[_0xd8dd('0xdd')](_0xd8dd('0xfc')),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93[_0xd8dd('0x10b')],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93['CampaignId']||undefined})[_0xd8dd('0xb1')](loggerCatch('[rescheduleContact][Machine]'));}break;case 0x14:if(_0x4f9c93[_0xd8dd('0x186')]>=_0x46dab8[_0xd8dd('0x192')]-0x1){return!![];}else{this[_0xd8dd('0xbf')]({'active':![],'countagentrejectretry':_0x4f9c93['countagentrejectretry']+=0x1,'scheduledat':moment()[_0xd8dd('0x10a')](_0x46dab8[_0xd8dd('0x193')],_0xd8dd('0x18a'))[_0xd8dd('0xdd')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x4f9c93[_0xd8dd('0xd3')],'ListId':_0x4f9c93['ListId'],'VoiceQueueId':_0x4f9c93[_0xd8dd('0xd5')]||undefined,'CampaignId':_0x4f9c93['CampaignId']||undefined})['catch'](loggerCatch(_0xd8dd('0x194')));}break;default:return!![];}};Dialer['prototype'][_0xd8dd('0x195')]=function(_0x807fd8,_0x178f0d,_0x8e6e47){var _0x187b3b=this;var _0x1e233e=new History(_0x807fd8);return new BPromise(function(_0x5b7759,_0x45af8a){if(_['isUndefined'](_0x178f0d)&&_0xd8dd('0x156')!==typeof _0x178f0d){return _0x45af8a(msgResponse(_0xd8dd('0x196'),_0xd8dd('0x131'),_0xd8dd('0x197')));}if(_['isUndefined'](_0x8e6e47)&&_0xd8dd('0x156')!==typeof _0x8e6e47){return _0x45af8a(msgResponse('[callProgressDetecting]',_0xd8dd('0x131'),_0xd8dd('0x198')));}switch(_0x8e6e47[_0xd8dd('0xf8')]){case'0':_0x178f0d['outboundNoSuchCallsDay']+=0x1;_0x1e233e[_0xd8dd('0xe7')]=0x0;_0x1e233e[_0xd8dd('0xa9')]='NoSuchNumber';_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x199')));if(_0x187b3b[_0xd8dd('0x182')](0x0,_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x183')]+_0x1e233e[_0xd8dd('0x18d')]+_0x1e233e['countnoanswerretry']+_0x1e233e[_0xd8dd('0x18e')]+_0x1e233e['countdropretry']+_0x1e233e[_0xd8dd('0x10f')]+_0x1e233e[_0xd8dd('0x185')]+_0x1e233e[_0xd8dd('0x186')]>=_0x178f0d[_0xd8dd('0x187')]){_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x19b'));}else{_0x187b3b[_0xd8dd('0x19c')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x19b'));}}break;case'3':_0x178f0d['outboundNoAnswerCallsDay']+=0x1;_0x1e233e['state']=0x3;_0x1e233e[_0xd8dd('0xa9')]=_0xd8dd('0x19d');_0x1e233e[_0xd8dd('0x184')]+=0x1;_0x1e233e['countglobal']+=0x1;_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)['catch'](loggerCatch('[syncAgentComplete][createHistory][3]'));if(_0x187b3b[_0xd8dd('0x182')](0x3,_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x184')]>=_0x178f0d['dialNoAnswerMaxRetry']){_0x187b3b[_0xd8dd('0x19c')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x19e'));}else{_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x19e'));}}break;case'5':_0x178f0d['outboundBusyCallsDay']+=0x1;_0x1e233e[_0xd8dd('0xe7')]=0x5;_0x1e233e[_0xd8dd('0xa9')]='Busy';_0x1e233e[_0xd8dd('0x183')]+=0x1;_0x1e233e['countglobal']+=0x1;_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)['catch'](loggerCatch(_0xd8dd('0x19f')));if(_0x187b3b['checkRetriveMax'](0x5,_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x183')]>=_0x178f0d[_0xd8dd('0x18b')]){_0x187b3b['createStateFinal'](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1a0'));}else{_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1a0'));}}break;case'8':_0x178f0d[_0xd8dd('0x1a1')]+=0x1;_0x1e233e[_0xd8dd('0xe7')]=0x8;_0x1e233e[_0xd8dd('0xa9')]=_0xd8dd('0x1a2');_0x1e233e[_0xd8dd('0x18d')]+=0x1;_0x1e233e[_0xd8dd('0x1a3')]+=0x1;_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x1a4')));if(_0x187b3b[_0xd8dd('0x182')](0x8,_0x807fd8,_0x178f0d)){if(_0x1e233e['countcongestionretry']>=_0x178f0d[_0xd8dd('0x1a5')]){_0x187b3b[_0xd8dd('0x19c')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1a6'));}else{_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1a6'));}}break;case'11':_0x178f0d['outboundAbandonedCallsDay']+=0x1;_0x1e233e['state']=0xb;_0x1e233e['statedesc']=_0xd8dd('0x10d');_0x1e233e[_0xd8dd('0x10f')]+=0x1;_0x1e233e[_0xd8dd('0x1a3')]+=0x1;_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)['catch'](loggerCatch('[syncAgentComplete][createHistory][11]'));if(_0x187b3b[_0xd8dd('0x182')](0xb,_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x10f')]>=_0x178f0d[_0xd8dd('0x110')]){_0x187b3b['createStateFinal'](_0x1e233e,_0x5b7759,_0x45af8a,'reason\x2011\x20abandoned');}else{_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1a7'));}}break;case'20':_0x178f0d[_0xd8dd('0x68')]+=0x1;_0x1e233e[_0xd8dd('0xe7')]=0x14;_0x1e233e['statedesc']=_0xd8dd('0x1a8');_0x1e233e[_0xd8dd('0x186')]+=0x1;_0x1e233e['countglobal']+=0x1;_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x1a9')));if(_0x187b3b[_0xd8dd('0x182')](0x14,_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x186')]>=_0x178f0d[_0xd8dd('0x192')]){_0x187b3b[_0xd8dd('0x19c')](_0x1e233e,_0x5b7759,_0x45af8a,_0xd8dd('0x1aa'));}else{_0x187b3b['stateGlobal'](_0x1e233e,_0x5b7759,_0x45af8a,'reason\x2020\x20agentreject');}}break;default:_0x178f0d[_0xd8dd('0x69')]+=0x1;_0x1e233e[_0xd8dd('0xe7')]=0xc;_0x1e233e[_0xd8dd('0xa9')]=_0x8e6e47[_0xd8dd('0xf8')];_0x187b3b[_0xd8dd('0xc9')](_0x1e233e)['catch'](loggerCatch(_0xd8dd('0x1ab')));if(_0x187b3b['checkRetriveMax'](_0x8e6e47[_0xd8dd('0xf8')],_0x807fd8,_0x178f0d)){if(_0x1e233e[_0xd8dd('0x183')]+_0x1e233e[_0xd8dd('0x18d')]+_0x1e233e[_0xd8dd('0x184')]+_0x1e233e[_0xd8dd('0x18e')]+_0x1e233e[_0xd8dd('0x108')]+_0x1e233e['countabandonedretry']+_0x1e233e['countmachineretry']+_0x1e233e[_0xd8dd('0x186')]>=_0x178f0d[_0xd8dd('0x187')]){_0x187b3b[_0xd8dd('0x19a')](_0x1e233e,_0x5b7759,_0x45af8a,_0x8e6e47[_0xd8dd('0xf8')]);}else{_0x187b3b[_0xd8dd('0x19c')](_0x1e233e,_0x5b7759,_0x45af8a,_0x8e6e47[_0xd8dd('0xf8')]);}}}});};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x19a')]=function(_0x110b50,_0x3de7b7,_0x274000,_0x3e9ca7){var _0x280f50=new Final(_0x110b50);_0x280f50[_0xd8dd('0xe7')]=0xf;_0x280f50[_0xd8dd('0xa9')]=_0xd8dd('0x1ac');this[_0xd8dd('0x19c')](_0x280f50,_0x3de7b7,_0x274000,_0x3e9ca7);};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x19c')]=function(_0x5061c9,_0x16e779,_0x21d214,_0x185011){this[_0xd8dd('0xc7')](_0x5061c9)[_0xd8dd('0xb6')](function(_0x140dce){return _0x16e779(msgResponse('[callProgressDetecting]','Success',_0x185011));})[_0xd8dd('0xb1')](function(_0x35e49b){return _0x21d214(msgResponse(_0xd8dd('0x1ad'),'Failure','contact\x20not\x20moved'));});};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x9')]=function(_0x107cf9){var _0x4b7555=this;var _0x246b69=_0x107cf9[_0xd8dd('0x1ae')]/0x64;var _0x47bf50=_0x107cf9['outboundDropCallsDayTimeout']/(_0x107cf9['outboundDropCallsDayTimeout']+_0x107cf9[_0xd8dd('0x60')]);var _0x5436b2=Math[_0xd8dd('0x1af')](_0x107cf9['predictiveIntervalAvailable']*(_0x107cf9[_0xd8dd('0x1b0')]/0x64));var _0x47e428=Math[_0xd8dd('0x1af')](_0x107cf9[_0xd8dd('0x73')]*(_0x107cf9[_0xd8dd('0x1b1')]/0x64));var _0x2d685a=_0x107cf9[_0xd8dd('0x51')]+_0x107cf9[_0xd8dd('0xa3')];var _0x593cc2=Math[_0xd8dd('0x1b2')](_0x107cf9[_0xd8dd('0x1b3')]*_0x107cf9[_0xd8dd('0x90')]*_0x107cf9[_0xd8dd('0x70')]*_0x107cf9[_0xd8dd('0x71')]);if(_[_0xd8dd('0x3d')](_0x107cf9['startProgressive'])){if(!_[_0xd8dd('0x3d')](_0x107cf9[_0xd8dd('0x78')])){_0x107cf9[_0xd8dd('0x78')]=undefined;loggerPredictive[_0xd8dd('0x99')]('[startMethodPredictive][StartProgressive]',_0xd8dd('0x1b4'));}if(!_['isUndefined'](_0x107cf9['handlePredictive'])){loggerPredictive[_0xd8dd('0x99')](_0xd8dd('0x1b5'),_0xd8dd('0x1b6'));clearInterval(_0x107cf9[_0xd8dd('0x93')]);_0x107cf9[_0xd8dd('0x93')]=undefined;}_0x107cf9[_0xd8dd('0x29')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive['info'](_0x107cf9[_0xd8dd('0x3f')],'collection\x20data\x20in\x20progressive\x20at',_0x107cf9[_0xd8dd('0x29')]);this['handlePower'](_0x107cf9,0x1);}else if(ifInterval(_0x107cf9[_0xd8dd('0x1b7')],_0x107cf9['startProgressive'])){this['handlePower'](_0x107cf9,0x1);loggerPredictiveCalls[_0xd8dd('0x7f')](_0xd8dd('0x1b8'),_0x107cf9[_0xd8dd('0x29')],_0x107cf9[_0xd8dd('0x3f')]);_0x107cf9[_0xd8dd('0x1b3')]=0x0;_0x107cf9[_0xd8dd('0x6f')]=0x0;}else if(_0x246b69<_0x47bf50&&_0x107cf9['dialPredictiveOptimization']===_0xd8dd('0x1b9')){freeVariablesPredictive(_0x107cf9);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1ba'),_0xd8dd('0x1bb'),_0x47bf50,_0xd8dd('0x29'),_0x107cf9[_0xd8dd('0x3f')]);}else if(_0x593cc2<_0x107cf9['predictiveIntervalErlangCallsDroppedCalls']&&_0x107cf9[_0xd8dd('0x1bc')]===_0xd8dd('0x1b9')){freeVariablesPredictive(_0x107cf9);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1bd'),_0xd8dd('0x1be'),_0x593cc2,'Drop\x20in\x20this\x20interval',_0x107cf9['predictiveIntervalErlangCallsDroppedCalls'],_0xd8dd('0x29'),_0x107cf9[_0xd8dd('0x3f')]);}else if(!ifInterval(_0x107cf9[_0xd8dd('0x1b7')],_0x107cf9[_0xd8dd('0x29')])&&_[_0xd8dd('0x3d')](_0x107cf9[_0xd8dd('0x78')])&&!_[_0xd8dd('0x3d')](_0x107cf9['startProgressive'])){_0x107cf9[_0xd8dd('0x78')]=moment()[_0xd8dd('0xdd')](_0xd8dd('0xfc'));loggerPredictive[_0xd8dd('0x7f')](_0x107cf9[_0xd8dd('0x3f')],_0xd8dd('0x1bf'),_0x107cf9[_0xd8dd('0x78')]);this[_0xd8dd('0xbc')](_0x107cf9[_0xd8dd('0x1b7')])['then'](this[_0xd8dd('0x1c0')](_0x107cf9))[_0xd8dd('0xb6')](mergeDataErlangB(_0x107cf9))[_0xd8dd('0xb6')](this['startMethodPredictive'](_0x107cf9))['catch'](loggerCatchPredictive(_0xd8dd('0x1c1'),_0x107cf9));}else if(!ifInterval(_0x107cf9[_0xd8dd('0x1b7')],_0x107cf9['startPredictive'])){_0x107cf9[_0xd8dd('0x6f')]=0x0;_0x107cf9['startPredictive']=moment()[_0xd8dd('0xdd')](_0xd8dd('0xfc'));loggerPredictive[_0xd8dd('0x7f')](_0x107cf9['name'],_0xd8dd('0x1c2'),_0x107cf9[_0xd8dd('0x78')]);clearInterval(_0x107cf9[_0xd8dd('0x93')]);_0x107cf9[_0xd8dd('0x93')]=undefined;this[_0xd8dd('0xbc')](_0x107cf9[_0xd8dd('0x1b7')])['then'](this[_0xd8dd('0x1c0')](_0x107cf9))['then'](mergeDataErlangB(_0x107cf9))[_0xd8dd('0xb6')](this[_0xd8dd('0x1c3')](_0x107cf9))[_0xd8dd('0xb1')](loggerCatchPredictive('Predictive\x20for\x20every\x20interval',_0x107cf9));}else if(_0x107cf9[_0xd8dd('0x73')]&&_0x2d685a<_0x107cf9['predictiveIntervalAvailable']-_0x47e428){freeVariablesPredictive(_0x107cf9);loggerPredictive['info'](_0x107cf9[_0xd8dd('0x3f')],_0xd8dd('0x1c4'),_0x2d685a,_0xd8dd('0x1c5'),_0x107cf9['predictiveIntervalAvailable'],'-',_0x47e428,'=',_0x107cf9['predictiveIntervalAvailable']-_0x47e428,')');}else if(_0x107cf9['predictiveIntervalAvailable']&&_0x2d685a>_0x107cf9[_0xd8dd('0x73')]+_0x5436b2){freeVariablesPredictive(_0x107cf9);loggerPredictive[_0xd8dd('0x7f')](_0x107cf9[_0xd8dd('0x3f')],_0xd8dd('0x1c4'),_0x2d685a,_0xd8dd('0x1c6'),_0x107cf9[_0xd8dd('0x73')],'+',_0x5436b2,'=',_0x107cf9[_0xd8dd('0x73')]+_0x5436b2,')');}};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1c0')]=function(_0x197533){var _0x929e75=this;return function(_0x2257a3){return new BPromise(function(_0x516216,_0x8765e5){_[_0xd8dd('0x91')](_0x197533,_0x2257a3[0x0]);if(checkGetDataPredictive(_0x2257a3[0x0])){var _0x1351eb=_0x197533[_0xd8dd('0x73')]=_0x197533['talking']+_0x197533[_0xd8dd('0x51')];var _0x478d21=_0x197533[_0xd8dd('0x1b7')]*0x3c;var _0xfe33db=_0x2257a3[0x0]['predictiveIntervalAvgTalktime']+_0x2257a3[0x0][_0xd8dd('0x6b')];var _0x7223aa=(_0x2257a3[0x0][_0xd8dd('0x6a')]+_0x2257a3[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x2257a3[0x0][_0xd8dd('0x6c')])/_0x2257a3[0x0][_0xd8dd('0x74')];_0x197533[_0xd8dd('0x70')]=_0x7223aa>0x0?_0x7223aa:0x1;switch(_0x197533[_0xd8dd('0x1bc')]){case _0xd8dd('0x1b9'):var _0x2d2460=_0x197533[_0xd8dd('0x1ae')]/0x64;return _0x929e75['abandonmentRate'](_0x1351eb,_0x478d21,_0xfe33db,_0x7223aa,_0x2d2460)[_0xd8dd('0xb6')](function(_0x1bec74){return _0x516216(_0x1bec74);});case'agentBusyFactor':var _0x19ba49=_0x197533['dialPredictiveOptimizationPercentage']/0x64;return _0x929e75[_0xd8dd('0x1c7')](_0x1351eb,_0x478d21,_0xfe33db,_0x7223aa,_0x19ba49)[_0xd8dd('0xb6')](function(_0x292eb7){return _0x516216(_0x292eb7);});default:return _0x8765e5(msgResponse('[getDataPredictive]',_0xd8dd('0x131'),_0xd8dd('0x1c8')));}}else{return _0x8765e5(msgResponse(_0xd8dd('0x1c9'),'Failure',_0xd8dd('0x1ca')));}});};};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1cb')]=function(_0x4f1460){var _0x5a23bc=this;return function(_0x5db2f3){return new BPromise(function(_0x24c6cf,_0x33d2b0){_['merge'](_0x4f1460,_0x5db2f3[0x0]);if(checkGetDataPredictive(_0x5db2f3[0x0])){loggerPredictive[_0xd8dd('0x7f')](JSON[_0xd8dd('0x4a')](_0x5db2f3[0x0]));if(_0x4f1460[_0xd8dd('0x1bc')]===_0xd8dd('0x1b9')){return _0x5a23bc[_0xd8dd('0xc5')](_0x4f1460['id'])[_0xd8dd('0xb6')](function(_0x587745){var _0x1cebf7=_0x4f1460[_0xd8dd('0x52')]-_0x587745[0x0][_0xd8dd('0x1cc')];var _0x471f30=_0x4f1460[_0xd8dd('0x1b7')]*0x3c;var _0x2d91da=_0x5db2f3[0x0][_0xd8dd('0x86')]+_0x5db2f3[0x0]['predictiveIntervalAvgHoldtime'];var _0x45b71f=(_0x5db2f3[0x0][_0xd8dd('0x6a')]+_0x5db2f3[0x0][_0xd8dd('0x6d')]+_0x5db2f3[0x0][_0xd8dd('0x6c')])/_0x5db2f3[0x0][_0xd8dd('0x74')];var _0x1f3cf8=_0x4f1460[_0xd8dd('0x1ae')]/0x64;_0x4f1460[_0xd8dd('0x72')]=_0x587745[0x0][_0xd8dd('0x1cc')]||0x0;_0x4f1460[_0xd8dd('0x70')]=_0x45b71f>0x0?_0x45b71f:0x1;return _0x5a23bc[_0xd8dd('0x1cd')](_0x1cebf7,_0x471f30,_0x2d91da,_0x45b71f,_0x1f3cf8);})[_0xd8dd('0xb6')](function(_0x4d1ddd){return _0x24c6cf(_0x4d1ddd);})[_0xd8dd('0xb1')](function(_0x262dda){return _0x33d2b0(msgResponse(_0xd8dd('0x1ce'),_0xd8dd('0x131'),JSON[_0xd8dd('0x4a')](_0x262dda)));});}if(_0x4f1460[_0xd8dd('0x1bc')]==='agentBusyFactor'){return _0x5a23bc[_0xd8dd('0xc5')](_0x4f1460['id'])[_0xd8dd('0xb6')](function(_0x24dd87){var _0x880d91=_0x4f1460[_0xd8dd('0x52')]-_0x24dd87[0x0][_0xd8dd('0x1cc')];var _0x296478=_0x4f1460[_0xd8dd('0x1b7')]*0x3c;var _0x267bda=_0x5db2f3[0x0][_0xd8dd('0x86')]+_0x5db2f3[0x0][_0xd8dd('0x6b')];var _0x53d6ae=(_0x5db2f3[0x0][_0xd8dd('0x6a')]+_0x5db2f3[0x0][_0xd8dd('0x6d')]+_0x5db2f3[0x0][_0xd8dd('0x6c')])/_0x5db2f3[0x0]['predictiveIntervalTotalCalls'];var _0x20f4da=_0x4f1460[_0xd8dd('0x1ae')]/0x64;_0x4f1460[_0xd8dd('0x72')]=_0x24dd87[0x0][_0xd8dd('0x1cc')]||0x0;_0x4f1460[_0xd8dd('0x70')]=_0x53d6ae>0x0?_0x53d6ae:0x1;return _0x5a23bc[_0xd8dd('0x1c7')](_0x880d91,_0x296478,_0x267bda,_0x53d6ae,_0x20f4da);})[_0xd8dd('0xb6')](function(_0x15c6e2){return _0x24c6cf(_0x15c6e2);})[_0xd8dd('0xb1')](function(_0x4925d0){return _0x33d2b0(msgResponse(_0xd8dd('0x1ce'),_0xd8dd('0x131'),JSON[_0xd8dd('0x4a')](_0x4925d0)));});}}else{return _0x33d2b0(msgResponse(_0xd8dd('0x1c9'),_0xd8dd('0x131'),_0xd8dd('0x1ca')));}});};};Dialer['prototype']['startMethodPredictive']=function(_0xe69e13){var _0x440c3f=this;return function(){var _0x5d8234=0x0;var _0x18e9d2=Math[_0xd8dd('0x1b2')](_0xe69e13['erlangCallToSecond']*0x3e8);if(_0x18e9d2>0x0){_0x18e9d2=_0x18e9d2<0x64?0x64:_0x18e9d2;loggerPredictive[_0xd8dd('0x7f')](_0xe69e13[_0xd8dd('0x3f')],'one\x20call\x20every:',_0x18e9d2,_0xd8dd('0x92'));_0xe69e13[_0xd8dd('0x93')]=setInterval(function(){_0x440c3f[_0xd8dd('0x93')](_0xe69e13);loggerPredictiveCalls[_0xd8dd('0x7f')](_0xd8dd('0x1cf'),_0x5d8234+=0x1);},_0x18e9d2);}else{loggerPredictive[_0xd8dd('0x7f')](_0xe69e13[_0xd8dd('0x3f')],_0xd8dd('0x1d0'));}};};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1d1')]=function(_0xeee8bc,_0x36fc05){var _0x37a50e=this;return function(_0x51a5fd){if(_['isEmpty'](_0x51a5fd)){if(_[_0xd8dd('0xe0')](_0x36fc05[_0xd8dd('0xd4')])||!_0x36fc05[_0xd8dd('0x1d2')]){if(_0xeee8bc[_0xd8dd('0x145')]===_0xd8dd('0x8')){_0xeee8bc[_0xd8dd('0x11d')]=_[_0xd8dd('0x3d')](_0xeee8bc[_0xd8dd('0x11d')])?!![]:_0xeee8bc[_0xd8dd('0x11d')];var _0x1177a8=uuid['v4']();_0x37a50e[_0xd8dd('0x25')][_0x1177a8]=new Action(_0xeee8bc,_0x36fc05,_0x1177a8);loggerBooked[_0xd8dd('0x7f')]('[booked][checkContactBlack]',_0x1177a8,_0xd8dd('0x1d3'),JSON['stringify'](_0xeee8bc[_0xd8dd('0x11d')]),_0xd8dd('0x1d4'),_0xeee8bc[_0xd8dd('0x3f')]);if(_0xeee8bc[_0xd8dd('0x11d')]){_0xeee8bc[_0xd8dd('0x11d')]=![];_0x37a50e[_0xd8dd('0x11a')][_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0xb2')]]=[];ami['Action']({'actionid':_0x1177a8,'action':_0xd8dd('0x1d5'),'queue':_0xeee8bc[_0xd8dd('0x3f')]})[_0xd8dd('0xb1')](function(_0x4ee9d5){_0x37a50e[_0xd8dd('0xcb')](_0xeee8bc);_0x37a50e['rescheduleContact']({'active':![],'ContactId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0xd3')],'ListId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0x10b')],'VoiceQueueId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0xd5')]||undefined,'CampaignId':_0x37a50e['actions'][_0x1177a8][_0xd8dd('0xd6')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x37a50e[_0xd8dd('0x25')][_0x1177a8];});}else{loggerBooked[_0xd8dd('0x7f')](_0xd8dd('0x1d6'),JSON['stringify'](_0xeee8bc['queueStatusComplete']),_0xd8dd('0x1d4'),_0xeee8bc['name']);_0x37a50e['updateOriginated'](_0xeee8bc);_0x37a50e[_0xd8dd('0xbf')]({'active':![],'ContactId':_0x37a50e['actions'][_0x1177a8][_0xd8dd('0xd3')],'ListId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8]['ListId'],'VoiceQueueId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0xd5')]||undefined,'CampaignId':_0x37a50e[_0xd8dd('0x25')][_0x1177a8][_0xd8dd('0xd6')]||undefined})[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0x1d7')));delete _0x37a50e[_0xd8dd('0x25')][_0x1177a8];}}else{return _0x37a50e['actionOriginate'](_0xeee8bc,_0x36fc05);}}else{if(getDiff(_0x36fc05[_0xd8dd('0x1d8')])<_0xeee8bc[_0xd8dd('0x1d9')]*0x3c){if(_0x36fc05[_0xd8dd('0x1da')]&&!_0x36fc05[_0xd8dd('0x1da')][_0xd8dd('0x1db')]){_0x37a50e[_0xd8dd('0x1e')][_0xd8dd('0x120')](_0x36fc05['id'])[_0xd8dd('0x1c')](function(){_0x37a50e[_0xd8dd('0xcb')](_0xeee8bc);});}else{_0x37a50e[_0xd8dd('0xc1')]({'active':![]},_0x36fc05['id'],0x1)[_0xd8dd('0x1c')](function(){console[_0xd8dd('0x1dc')](_0xd8dd('0x1dd'));_0x37a50e[_0xd8dd('0xcb')](_0xeee8bc);});}}else{_0xeee8bc[_0xd8dd('0x67')]+=0x1;_0x37a50e[_0xd8dd('0xcb')](_0xeee8bc);if(_0xeee8bc[_0xd8dd('0x1de')]){_0x37a50e[_0xd8dd('0xbf')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x36fc05[_0xd8dd('0xd3')],'ListId':_0x36fc05[_0xd8dd('0x10b')],'VoiceQueueId':_0x36fc05['VoiceQueueId']||undefined,'CampaignId':_0x36fc05[_0xd8dd('0xd6')]||undefined})['catch'](loggerCatch(_0xd8dd('0x1df')));_0x37a50e[_0xd8dd('0xc9')](createObjHistory(_0xeee8bc,_0x36fc05,_0xd8dd('0x1e0'),0x17,_0xd8dd('0x1e1')))[_0xd8dd('0xb1')](loggerCatch('[Originate][HistoryDialRecallInQueue][historyCatch]'));}else{_0x37a50e['saveInDb'](createObjHistory(_0xeee8bc,_0x36fc05,_0xd8dd('0x1e2'),0x16,_0xd8dd('0x1e3')),_0xd8dd('0x1e4'),'[Originate][HistoryRecallClose]');}}}}else{_0xeee8bc[_0xd8dd('0x61')]+=0x1;_0x37a50e[_0xd8dd('0xd1')](createObjHistory(_0xeee8bc,_0x36fc05,_0xd8dd('0x1e5'),0xd,_0xd8dd('0x1e6')),_0xd8dd('0x1e7'),_0xd8dd('0x1e8'));throw _0xd8dd('0x1e9');}};};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1ea')]=function(_0x7e68ff){var _0x456821=this;var _0x20a37c=[];var _0x1954b1=_0x7e68ff[_0xd8dd('0x1eb')]-_0x7e68ff['originated']-_0x7e68ff['temp'];emitCampaignSummary(_0x7e68ff);if(_0x1954b1>0x0){if(_0x1954b1>this[_0xd8dd('0x23')]){_0x1954b1=this[_0xd8dd('0x23')];}_0x7e68ff[_0xd8dd('0x1ec')]+=_0x1954b1;this[_0xd8dd('0xc4')](_0x7e68ff['id'],_0x1954b1,_0x7e68ff[_0xd8dd('0x1ed')])[_0xd8dd('0xb6')](function(_0x3c5fa4){_0x7e68ff[_0xd8dd('0x1ec')]-=_0x1954b1;_0x7e68ff['temp']=_0x7e68ff[_0xd8dd('0x1ec')]>0x0?_0x7e68ff['temp']:0x0;if(!checkContactEmpty(_0x3c5fa4)){_0x7e68ff[_0xd8dd('0x40')]=_0xd8dd('0xa0');logger[_0xd8dd('0x7f')](_0xd8dd('0x1ee')+_0x7e68ff[_0xd8dd('0x3f')]);}else{_0x7e68ff[_0xd8dd('0x75')]+=_0x3c5fa4[_0xd8dd('0x124')];_0x7e68ff[_0xd8dd('0x40')]=_0xd8dd('0x1ef');for(var _0x963bb8=0x0;_0x963bb8<_0x3c5fa4['length'];_0x963bb8+=0x1){_0x7e68ff['ivrTotalCallsDays']+=0x1;if(_[_0xd8dd('0xe0')](_0x3c5fa4[_0x963bb8])||_[_0xd8dd('0xe0')](_0x3c5fa4[_0x963bb8]['Contact'])||_[_0xd8dd('0xe0')](_0x3c5fa4[_0x963bb8]['Contact']['phone'])){_0x456821[_0xd8dd('0xcf')]('[actionOriginate]\x20',_0x7e68ff,_0x3c5fa4[_0x963bb8]);}else{_0x456821[_0xd8dd('0xba')](_[_0xd8dd('0xd2')](_0x3c5fa4[_0x963bb8],[_0xd8dd('0xd6'),_0xd8dd('0x1f0')]))['then'](_0x456821[_0xd8dd('0x1d1')](_0x7e68ff,_0x3c5fa4[_0x963bb8]))[_0xd8dd('0xb1')](_0x456821[_0xd8dd('0xce')](_0xd8dd('0x1f1'),_0x7e68ff));}}}})[_0xd8dd('0xb1')](loggerGetContactDialer('[getContactCampaign2]',_0x7e68ff,_0x1954b1));}};Dialer[_0xd8dd('0xaa')]['handlePower']=function(_0x59dbcc,_0x1fc702){var _0x1ca5da=this;var _0x29391e=[];var _0x3cc1fe=_0x1fc702>=0x1?_0x1fc702:0x1;var _0x45fa72=[];if(_0x59dbcc[_0xd8dd('0x145')]==='booked'){_0x3cc1fe=0x1;}var _0x1224c1=Math[_0xd8dd('0x1b2')](_0x59dbcc[_0xd8dd('0x51')]*_0x3cc1fe)-_0x59dbcc[_0xd8dd('0x75')]-_0x59dbcc[_0xd8dd('0x1ec')];emitVoiceQueueSummary(_0x59dbcc);if(_0x59dbcc[_0xd8dd('0x1f2')]>0x0){var _0x65568c=_0x59dbcc[_0xd8dd('0x1f2')]-_0x59dbcc['originated']-_0x59dbcc[_0xd8dd('0xa3')]-_0x59dbcc[_0xd8dd('0x1ec')]-_0x59dbcc[_0xd8dd('0x53')];if(_0x1224c1>_0x65568c){_0x1224c1=_0x65568c;}}if(_0x1224c1>0x0){if(_0x59dbcc['dialMethod']===_0xd8dd('0x8')){_0x1224c1=0x1;}if(_0x1224c1>this[_0xd8dd('0x23')]){_0x1224c1=this['maxNumberOriginate'];}_0x59dbcc[_0xd8dd('0x1ec')]+=_0x1224c1;for(var _0x40fa64 in this[_0xd8dd('0x21')]){if(this['agents']['hasOwnProperty'](_0x40fa64)){if(this[_0xd8dd('0x21')][_0x40fa64]['state']===_0xd8dd('0x1f3')&&this['agents'][_0x40fa64][_0xd8dd('0xb0')]===_0xd8dd('0xdc')){_0x29391e[_0xd8dd('0x11b')](this['agents'][_0x40fa64]['id']);}}}this[_0xd8dd('0xc2')](_0x59dbcc['id'],_0x29391e,_0x1224c1,_0x59dbcc['dialOrderByScheduledAt'])[_0xd8dd('0xb6')](function(_0x1088fc){_0x59dbcc[_0xd8dd('0x1ec')]-=_0x1224c1;_0x59dbcc[_0xd8dd('0x1ec')]=_0x59dbcc[_0xd8dd('0x1ec')]>0x0?_0x59dbcc[_0xd8dd('0x1ec')]:0x0;if(!checkContactEmpty(_0x1088fc)){_0x1ca5da[_0xd8dd('0xb4')](_0x59dbcc)[_0xd8dd('0xb6')](sendMessageReschedule(_0x59dbcc))['catch'](loggerCatch(_0xd8dd('0xb7')));}else{_0x59dbcc[_0xd8dd('0x75')]+=_0x1088fc[_0xd8dd('0x124')];_0x59dbcc['message']=_0x59dbcc[_0xd8dd('0x145')]===_0xd8dd('0x8')?_0xd8dd('0x161'):'RUNNING';for(var _0x156188=0x0;_0x156188<_0x1088fc[_0xd8dd('0x124')];_0x156188+=0x1){if(_['isNil'](_0x1088fc[_0x156188])||_['isNil'](_0x1088fc[_0x156188]['Contact'])||_[_0xd8dd('0xe0')](_0x1088fc[_0x156188]['Contact'][_0xd8dd('0x15a')])){_0x1ca5da[_0xd8dd('0xcf')]('[actionOriginate]\x20',_0x59dbcc,_0x1088fc[_0x156188]);}else{_0x1ca5da[_0xd8dd('0xb8')](_['pick'](_0x1088fc[_0x156188],['VoiceQueueId',_0xd8dd('0x1f0')]))['then'](_0x1ca5da[_0xd8dd('0x1d1')](_0x59dbcc,_0x1088fc[_0x156188]))[_0xd8dd('0xb1')](_0x1ca5da[_0xd8dd('0xce')]('[actionOriginate]\x20',_0x59dbcc));}}}})[_0xd8dd('0xb1')](loggerGetContactDialer(_0xd8dd('0x1f4'),_0x59dbcc,_0x1224c1));}};Dialer['prototype']['handlePredictive']=function(_0x7a1d5){var _0x2820b0=this;if(_0x7a1d5[_0xd8dd('0x1f2')]>0x0){var _0x4be915=_0x7a1d5[_0xd8dd('0x1f2')]-_0x7a1d5[_0xd8dd('0x75')]-_0x7a1d5['talking'];if(_0x4be915>0x0){this[_0xd8dd('0x1f5')](_0x7a1d5);}else{loggerPredictiveCalls['info'](_0xd8dd('0x1f6'));}}else{this[_0xd8dd('0x1f5')](_0x7a1d5);}};Dialer['prototype']['tryOriginatePredictive']=function(_0x4e183c){var _0x57a18b=this;var _0x4f0263=[];_0x4e183c['originated']+=0x1;for(var _0xbd9f9 in this['agents']){if(this[_0xd8dd('0x21')]['hasOwnProperty'](_0xbd9f9)){if(this[_0xd8dd('0x21')][_0xbd9f9][_0xd8dd('0xe7')]===_0xd8dd('0x1f3')&&this[_0xd8dd('0x21')][_0xbd9f9][_0xd8dd('0xb0')]===_0xd8dd('0xdc')){_0x4f0263[_0xd8dd('0x11b')](this['agents'][_0xbd9f9]['id']);}}}this[_0xd8dd('0xc2')](_0x4e183c['id'],_0x4f0263,0x1,_0x4e183c[_0xd8dd('0x1ed')])['then'](function(_0x3a2b92){if(!checkContactEmpty(_0x3a2b92)){checkContactLowerLimitOriginate(_0x4e183c,0x1,0x0);_0x57a18b['countReScheduled'](_0x4e183c)[_0xd8dd('0xb6')](sendMessageReschedule(_0x4e183c))[_0xd8dd('0xb1')](loggerCatch(_0xd8dd('0xb7')));}else{_0x4e183c['message']='RUNNING';if(_[_0xd8dd('0xe0')](_0x3a2b92[0x0])||_[_0xd8dd('0xe0')](_0x3a2b92[0x0][_0xd8dd('0x159')])||_[_0xd8dd('0xe0')](_0x3a2b92[0x0][_0xd8dd('0x159')][_0xd8dd('0x15a')])){_0x57a18b[_0xd8dd('0xcf')](_0xd8dd('0x1f7'),_0x4e183c,_0x3a2b92[0x0]);}else{_0x57a18b[_0xd8dd('0xb8')](_['pick'](_0x3a2b92[0x0],[_0xd8dd('0xd5'),'Contact.phone']))['then'](_0x57a18b[_0xd8dd('0x1d1')](_0x4e183c,_0x3a2b92[0x0]))['catch'](_0x57a18b[_0xd8dd('0xce')](_0xd8dd('0x1f8'),_0x4e183c));}}})['catch'](loggerGetContactDialer(_0xd8dd('0x1f9'),_0x4e183c,0x1));emitVoiceQueueSummary(_0x4e183c);};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1cd')]=function(_0x19836d,_0x176f1f,_0x349cdd,_0x5c7bcb,_0x3bfbff,_0x42abde){loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fa'));loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fb'),_0x19836d);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fc'),_0x176f1f);loggerPredictive['info'](_0xd8dd('0x1fd'),_0x349cdd);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fe'),_0x5c7bcb);loggerPredictive['info'](_0xd8dd('0x1ff'),_0x3bfbff);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x87'));return new BPromise(function(_0x1d1903,_0x556abc){if(_0x19836d<=0x0||isNaN(_0x19836d)){return _0x556abc(msgResponse(_0xd8dd('0x200'),_0xd8dd('0x49'),'m\x20=\x20'+_0x19836d));}if(_0x349cdd<=0x0||isNaN(_0x349cdd)){return _0x556abc(msgResponse(_0xd8dd('0x200'),'Error',_0xd8dd('0x201')+_0x349cdd));}if(_0x5c7bcb<=0x0||isNaN(_0x5c7bcb)){return _0x556abc(msgResponse(_0xd8dd('0x200'),_0xd8dd('0x49'),_0xd8dd('0x202')+_0x5c7bcb));}if(_0x176f1f<=0x0||isNaN(_0x176f1f)){return _0x556abc(msgResponse('[abandonmentRate]',_0xd8dd('0x49'),_0xd8dd('0x203')+_0x176f1f));}if(_0x3bfbff<=0x0||isNaN(_0x3bfbff)){return _0x556abc(msgResponse(_0xd8dd('0x200'),_0xd8dd('0x49'),_0xd8dd('0x204')+_0x3bfbff));}_0x42abde=_0x42abde||0x0;var _0x3d3d68=0x1/_0x349cdd;var _0x165c14=0x0;var _0x5168c3=0x0;var _0x1f6aa5=0x0;var _0x707cde=0x0;for(var _0x4bc6a2=0x0;_0x1f6aa5<_0x3bfbff;_0x4bc6a2+=0x1){_0x5168c3=_0x4bc6a2/_0x176f1f;_0x165c14=(_0x5c7bcb*_0x5168c3+_0x42abde)/_0x3d3d68;_0x1f6aa5=erlangb(_0x165c14,_0x19836d);_0x707cde=_0x165c14/_0x19836d*(0x1-erlangb(_0x165c14,_0x19836d));}return _0x1d1903({'erlangCalls':_0x4bc6a2,'erlangCallToSecond':_0x176f1f/_0x4bc6a2,'erlangAbandonmentRate':_0x1f6aa5,'erlangBusyFactor':_0x707cde});});};Dialer[_0xd8dd('0xaa')][_0xd8dd('0x1c7')]=function(_0x425eda,_0x299386,_0x128d0c,_0x2992b2,_0x37f9d8,_0x126ce2){loggerPredictive[_0xd8dd('0x7f')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fb'),_0x425eda);loggerPredictive[_0xd8dd('0x7f')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x299386);loggerPredictive['info'](_0xd8dd('0x1fd'),_0x128d0c);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x1fe'),_0x2992b2);loggerPredictive[_0xd8dd('0x7f')](_0xd8dd('0x205'),_0x37f9d8);loggerPredictive[_0xd8dd('0x7f')]('---------------------------');return new BPromise(function(_0x5c40d2,_0x44b06f){if(_0x425eda<=0x0||isNaN(_0x425eda)){return _0x44b06f(msgResponse(_0xd8dd('0x206'),'Error',_0xd8dd('0x207')+_0x425eda));}if(_0x128d0c<=0x0||isNaN(_0x128d0c)){return _0x44b06f(msgResponse(_0xd8dd('0x206'),_0xd8dd('0x49'),_0xd8dd('0x201')+_0x128d0c));}if(_0x2992b2<=0x0||isNaN(_0x2992b2)){return _0x44b06f(msgResponse(_0xd8dd('0x206'),_0xd8dd('0x49'),_0xd8dd('0x202')+_0x2992b2));}if(_0x299386<=0x0||isNaN(_0x299386)){return _0x44b06f(msgResponse(_0xd8dd('0x206'),_0xd8dd('0x49'),_0xd8dd('0x203')+_0x299386));}if(_0x37f9d8<=0x0||isNaN(_0x37f9d8)){return _0x44b06f(msgResponse(_0xd8dd('0x206'),_0xd8dd('0x49'),_0xd8dd('0x208')+_0x37f9d8));}_0x126ce2=_0x126ce2||0x0;var _0x29616d=0x1/_0x128d0c;var _0x4e57c8=0x0;var _0x23477e=0x0;var _0x493fa9=0x0;var _0x4beb40=0x0;for(var _0x51bdcf=0x0;_0x4beb40<_0x37f9d8;_0x51bdcf+=0x1){_0x23477e=_0x51bdcf/_0x299386;_0x4e57c8=(_0x2992b2*_0x23477e+_0x126ce2)/_0x29616d;_0x493fa9=erlangb(_0x4e57c8,_0x425eda);_0x4beb40=_0x4e57c8/_0x425eda*(0x1-erlangb(_0x4e57c8,_0x425eda));}return _0x5c40d2({'erlangCalls':_0x51bdcf,'erlangCallToSecond':_0x299386/_0x51bdcf,'erlangAbandonmentRate':_0x493fa9,'erlangBusyFactor':_0x4beb40});});};module[_0xd8dd('0x209')]=Dialer; \ No newline at end of file +var _0x1c14=['[callProgressDetecting]','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','reason\x200\x20no\x20such\x20number....','NoAnswer','countglobal','[syncAgentComplete][createHistory][3]','stateGlobal','reason\x203\x20ringing\x20no\x20answer','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','outboundAbandonedCallsDay','[syncAgentComplete][createHistory][11]','createStateFinal','reason\x2011\x20abandoned','AgentReject','dialAgentRejectMaxRetry','reason\x2020\x20agentreject','[syncAgentComplete][createHistory][?]','Global','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','startMethodPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','outboundQueuePauses','[CatchErlangB]','check\x20failure','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[unlockOriginate][syncQueueStatusComplete]','[booked][checkContactBlack][else]','scheduledat','dialRecallMeTimeout','Agent','run','log','[rescheduleContact][dialRecallInQueue]','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','getContactDialerIvr','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','ivrTotalCallsDays','emptyContact','Contact.phone','checkContactBlack','[actionOriginateIvr]\x20','not_inuse','reachable','[actionOriginate]\x20','[getContactDialer2]','dialLimitQueue','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','[getContactDialerPredictive]','--------\x20Drop\x20Rate\x20--------','M:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','p\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','[busyFactor]','Umin\x20=\x20','exports','util','bluebird','uuid','md5','ioredis','../../../config/environment/','../../../config/logger','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./action','./history','./final','./agentComplete','./queueCallerAbandon','XCALLY_IP_AGI','rrmemory','roundrobin','prototype','enqueue','tail','finally','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','syncAgentConnect','bind','queuecallerabandon','syncQueueCallerAbandon','originateresponse','agentcomplete','syncAgentComplete','custom:queuesummary','syncHangup','varset','syncVarSet','queuemember','syncQueueMember','syncQueueStatusComplete','loopCampaigns','message','AGENTS_NOT_LOGGED','name','NOT_ACTIVE','\x20NOT\x20Active','Interval','INTERVAL_IS_NULL','Intervals','Error','stringify','milliseconds','diff','seconds','emit','type','outbound','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','unmanaged','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateTimeout','dialPrefix','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','callerid','voice:queue:%s','voice_queue:save','format','campaign:ivr:%s','info','-----\x20Stats\x20Predictive\x20---','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','isUndefined','History\x20information\x20are\x20empty','---------\x20ErlangB\x20---------','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','ivr','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','IS_DISACTIVED','[syncQueueSummary]\x20Campaign\x20Queue:\x20','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','is\x20not\x20active','endtime','starttime','clearZombieChannels','actions','[actions]','sequence','channel','catch','updateOriginated','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','countReScheduled','resolve','[countReScheduled]\x20','checkIsBlackList','then','[checkIsBlackList]\x20','checkIsBlackListIvr','[checkIsBlackListIvr]\x20','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','unlockContact','[unlockContact]\x20','getContactDialer','[getContactDialer]\x20','getVoiceQueueRtPauses','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','notFound','saveInDb','pick','VoiceQueueId','CampaignId','[emptyContact][createHistory]','isSuccess','Success','active','SIP/%s','status','uniqueid','isNil','variable','amdstatus','exten','HANGUP','outboundAnswerAgiCallsDay','state','HangupInAMD','membername','AMD','[syncHangupInAMD][createHistory]','value','MACHINE','statedesc','Machine','amd','[syncMachine][createHistory]','[syncMachine]','dialAMDActive','[syncHangupInAMDIvr]','[syncMachineIvr][createHistory]','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','AGI','cause-txt','Unknow','reason','agent','agiafterat','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete]','queueCallerAbandonCreateState','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','outboundDropCallsDayTimeout','Drop','dropreason','TIMEOUT','countdropretry','dialDropMaxRetry','add','dialDropRetryFrequency','minutes','ContactId','ListId','[rescheduleContact][Drop]','Abandoned','countabandonedretry','dialAbandonedRetryFrequency','[rescheduleContact][Abandoned]','syncNewExten','actionid','locked','paused','stateinterface','push','idHopper','queueStatusComplete','[unlockQueueStatus][undefined]','[Catch][Preview][syncQueueStatusComplete]','[unlock][syncQueueStatusComplete]','_rr','unlockRR','[booked][RR]','Agent:\x20','[booked][RR][finaly]','contactAgent-idHopper:\x20','[booked][unlock]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','checkIsTrunkReachable','isTrunkReachable','TrunkBackup','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','checkIfTimeIntervals','\x20Intervals\x20is\x20null\x20','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','Action','interval','true','command','iftime\x20%s,%s','content','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','handlePower','dialPowerLevel','booked','Queue','method\x20not\x20recognized','launchHandleIvr','dialGlobalInterval','dialTimezone','[syncCampaigns]','\x5cw{0,','pow','replace','match','actionOriginate','object','originate','phone','Contact','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','dialQueueProject2','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialer','ACTIVE','XMD-AMDINITIALSILENCE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','%s%s','XMD-','toUpper','dialRandomLastDigitCallerIdNumber','dialOriginateCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','trim','substring','dialCutDigit','xcally-motion-dialer','from-sip','[originateError]:\x20%s','OriginateError','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','callProgressDetecting','[callProgressDetecting]\x20','checkRetriveMax','countbusyretry','countcongestionretry','countnosuchnumberretry','countmachineretry','countagentrejectretry','dialGlobalMaxRetry','countnoanswerretry','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','dialNoSuchNumberRetryFrequency','[rescheduleContact][NoSuchNumber]','dialMachineMaxRetry','dialMachineRetryFrequency','[rescheduleContact][Machine]','dialAgentRejectRetryFrequency','[rescheduleContact][AgentReject]'];(function(_0x2142c8,_0x3001eb){var _0x4286e9=function(_0x43d768){while(--_0x43d768){_0x2142c8['push'](_0x2142c8['shift']());}};_0x4286e9(++_0x3001eb);}(_0x1c14,0x71));var _0x41c1=function(_0x125caf,_0x2ace99){_0x125caf=_0x125caf-0x0;var _0x5204e8=_0x1c14[_0x125caf];return _0x5204e8;};'use strict';var util=require(_0x41c1('0x0'));var _=require('lodash');var BPromise=require(_0x41c1('0x1'));var uuid=require(_0x41c1('0x2'));var moment=require('moment');var rr=require('rr');var md5=require(_0x41c1('0x3'));var Redis=require(_0x41c1('0x4'));var config=require(_0x41c1('0x5'));var logger=require(_0x41c1('0x6'))('dialer');var loggerBooked=require(_0x41c1('0x6'))('booked');var loggerPredictive=require(_0x41c1('0x6'))(_0x41c1('0x7'));var loggerPredictiveCalls=require(_0x41c1('0x6'))(_0x41c1('0x8'));var loggerSyncQueueSummary=require(_0x41c1('0x6'))(_0x41c1('0x9'));var ami=require(_0x41c1('0xa'));config[_0x41c1('0xb')]=_[_0x41c1('0xc')](config[_0x41c1('0xb')],{'host':_0x41c1('0xd'),'port':0x18eb});var io=require(_0x41c1('0xe'))(new Redis(config[_0x41c1('0xb')]));var cmHopper=require(_0x41c1('0xf'));var cmHopperFinal=require(_0x41c1('0x10'));var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x41c1('0x11'));var voiceQueueRt=require(_0x41c1('0x12'));var Action=require(_0x41c1('0x13'));var History=require(_0x41c1('0x14'));var Final=require(_0x41c1('0x15'));var AgentComplete=require(_0x41c1('0x16'));var QueueCallerAbandon=require(_0x41c1('0x17'));var Hangup=require('./hangup');var ipAgi=process['env'][_0x41c1('0x18')]||'127.0.0.1';var strategy={'rrmemory':_0x41c1('0x19'),'roundrobin':_0x41c1('0x1a')};var Sequence=function(){};Sequence[_0x41c1('0x1b')][_0x41c1('0x1c')]=function(_0x186be1){this['tail']=this[_0x41c1('0x1d')]?this['tail'][_0x41c1('0x1e')](_0x186be1):_0x186be1();};function Dialer(_0x219aac,_0x4d57a2){this['sequence']=new Sequence();this[_0x41c1('0x1f')]=_0x4d57a2;this[_0x41c1('0x20')]=_0x219aac[_0x41c1('0x20')];this[_0x41c1('0x21')]=_0x219aac[_0x41c1('0x21')];this[_0x41c1('0x22')]=_0x219aac[_0x41c1('0x22')];this['trunks']=_0x219aac[_0x41c1('0x23')];this[_0x41c1('0x24')]=config[_0x41c1('0x24')]||0x2;this[_0x41c1('0x25')]={};this['actions']={};this[_0x41c1('0x26')]={};this[_0x41c1('0x27')]={};this[_0x41c1('0x28')]={};this[_0x41c1('0x29')]={};this[_0x41c1('0x2a')]={};this[_0x41c1('0x2b')]={};this[_0x41c1('0x2c')]={};this[_0x41c1('0x2d')]={};ami['on'](_0x41c1('0x2e'),this[_0x41c1('0x2f')][_0x41c1('0x30')](this));ami['on'](_0x41c1('0x31'),this[_0x41c1('0x32')][_0x41c1('0x30')](this));ami['on'](_0x41c1('0x33'),this['syncOriginateResponse'][_0x41c1('0x30')](this));ami['on'](_0x41c1('0x34'),this[_0x41c1('0x35')][_0x41c1('0x30')](this));ami['on'](_0x41c1('0x36'),this[_0x41c1('0x9')][_0x41c1('0x30')](this));ami['on']('hangup',this[_0x41c1('0x37')][_0x41c1('0x30')](this));ami['on']('newexten',this['syncNewExten']['bind'](this));ami['on'](_0x41c1('0x38'),this[_0x41c1('0x39')][_0x41c1('0x30')](this));ami['on'](_0x41c1('0x3a'),this[_0x41c1('0x3b')][_0x41c1('0x30')](this));ami['on']('queuestatuscomplete',this[_0x41c1('0x3c')][_0x41c1('0x30')](this));this[_0x41c1('0x3d')]();this['loopClearZombieChannels']();}function isNotNull(_0x3c8640){return _0x3c8640!==null&&!_['isUndefined'](_0x3c8640);}function checkIsLoggedIn(_0x4e322b,_0x1cea90){return function(){if(_0x1cea90<=0x0){_0x4e322b[_0x41c1('0x3e')]=_0x41c1('0x3f');throw _0x4e322b[_0x41c1('0x40')]+'\x20AGENTS\x20NOT\x20LOGGED';}};}function isActive(_0x465014){return _0x465014;}function checkIsActive(_0xb816bd,_0xf4e79d){return function(){if(!isActive(_0xf4e79d)){_0xb816bd[_0x41c1('0x3e')]=_0x41c1('0x41');throw _0xb816bd['name']+_0x41c1('0x42');}};}function checkInterval(_0x3f7e86){return function(){if(!isNotNull(_0x3f7e86[_0x41c1('0x43')])){_0x3f7e86[_0x41c1('0x3e')]=_0x41c1('0x44');throw _0x3f7e86[_0x41c1('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_0x3f7e86[_0x41c1('0x43')][_0x41c1('0x45')])){_0x3f7e86['message']='INTERVAL_IS_NULL';throw _0x3f7e86[_0x41c1('0x40')]+'\x20INTERVAL_IS_NULL';}if(!isNotNull(_['isEmpty'](_0x3f7e86[_0x41c1('0x43')]['Intervals']))){_0x3f7e86['message']=_0x41c1('0x44');throw _0x3f7e86[_0x41c1('0x40')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x120840,_0x1ac795,_0x119dd4){return{'action':_0x120840,'response':_0x1ac795,'message':_0x119dd4,'stack':_0x119dd4};}function myreject(_0x8dbce5){return function(_0x3d0a77){return _0x8dbce5(msgResponse('[ifTime][Action]',_0x41c1('0x46'),JSON[_0x41c1('0x47')](_0x3d0a77)));};}function getSeconds(_0xc9b3f3,_0x4d09a0){var _0x405545=moment(_0xc9b3f3)[_0x41c1('0x48')](0x0);var _0x17a2cf=moment(_0x4d09a0)[_0x41c1('0x48')](0x0);return _0x405545[_0x41c1('0x49')](_0x17a2cf,_0x41c1('0x4a'));}function emit(_0x3d1cfe,_0x1ad4cd,_0x109abd){io['to'](_0x3d1cfe)[_0x41c1('0x4b')](_0x1ad4cd,_0x109abd);}function emitVoiceQueueSummary(_0xe5ae56){if(_0xe5ae56[_0x41c1('0x4c')]===_0x41c1('0x4d')){var _0x50792c={'id':_0xe5ae56['id'],'name':_0xe5ae56[_0x41c1('0x40')],'strategy':_0xe5ae56[_0x41c1('0x4e')],'answered':_0xe5ae56['answered'],'available':_0xe5ae56[_0x41c1('0x4f')],'loggedIn':_0xe5ae56[_0x41c1('0x50')],'pTalking':_0xe5ae56[_0x41c1('0x51')],'sumBillable':_0xe5ae56[_0x41c1('0x52')],'sumDuration':_0xe5ae56[_0x41c1('0x53')],'sumHoldTime':_0xe5ae56[_0x41c1('0x54')]||0x0,'talking':_0xe5ae56[_0x41c1('0x55')],'total':_0xe5ae56['total'],'type':_0xe5ae56[_0x41c1('0x4c')],'unmanaged':_0xe5ae56[_0x41c1('0x56')],'abandoned':_0xe5ae56[_0x41c1('0x57')],'waiting':_0xe5ae56['waiting'],'loggedInDb':_0xe5ae56[_0x41c1('0x58')],'dialActive':_0xe5ae56[_0x41c1('0x59')],'dialMethod':_0xe5ae56[_0x41c1('0x5a')],'dialOriginateCallerIdName':_0xe5ae56[_0x41c1('0x5b')],'dialOriginateCallerIdNumber':_0xe5ae56['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0xe5ae56[_0x41c1('0x5c')],'dialPrefix':_0xe5ae56[_0x41c1('0x5d')],'outboundAnswerAgiCallsDay':_0xe5ae56['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0xe5ae56[_0x41c1('0x5e')],'outboundBlacklistCallsDay':_0xe5ae56[_0x41c1('0x5f')],'outboundBusyCallsDay':_0xe5ae56[_0x41c1('0x60')],'outboundCongestionCallsDay':_0xe5ae56['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0xe5ae56['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0xe5ae56[_0x41c1('0x61')],'outboundDropCallsDayTimeout':_0xe5ae56['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0xe5ae56[_0x41c1('0x62')],'outboundNoSuchCallsDay':_0xe5ae56[_0x41c1('0x63')],'outboundOriginateFailureCallsDay':_0xe5ae56[_0x41c1('0x64')],'outboundReCallsDay':_0xe5ae56[_0x41c1('0x65')],'outboundRejectCallsDay':_0xe5ae56[_0x41c1('0x66')],'outboundUnknownCallsDay':_0xe5ae56[_0x41c1('0x67')],'predictiveIntervalAnsweredCalls':_0xe5ae56[_0x41c1('0x68')],'predictiveIntervalAvgHoldtime':_0xe5ae56[_0x41c1('0x69')],'predictiveIntervalAvgTalktime':_0xe5ae56[_0x41c1('0x6a')],'predictiveIntervalDroppedCallsCallersExit':_0xe5ae56[_0x41c1('0x6b')],'predictiveIntervalDroppedCallsTimeout':_0xe5ae56[_0x41c1('0x6c')],'predictiveIntervalErlangCalls':_0xe5ae56[_0x41c1('0x6d')],'predictiveIntervalErlangCallsDroppedCalls':_0xe5ae56[_0x41c1('0x6e')],'predictiveIntervalHitRate':_0xe5ae56[_0x41c1('0x6f')],'predictiveIntervalMultiplicativeFactor':_0xe5ae56[_0x41c1('0x70')],'predictiveIntervalPauses':_0xe5ae56[_0x41c1('0x71')],'predictiveIntervalAvailable':_0xe5ae56['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0xe5ae56['predictiveIntervalTotalCalls'],'message':_0xe5ae56[_0x41c1('0x3e')],'originated':_0xe5ae56[_0x41c1('0x72')],'erlangCalls':_0xe5ae56['erlangCalls'],'erlangCallToSecond':_0xe5ae56[_0x41c1('0x73')],'erlangAbandonmentRate':_0xe5ae56[_0x41c1('0x74')],'erlangBusyFactor':_0xe5ae56[_0x41c1('0x75')],'startPredictive':_0xe5ae56[_0x41c1('0x29')],'startProgressive':_0xe5ae56['startProgressive']};if(_0xe5ae56['Trunk']){_0x50792c[_0x41c1('0x76')]={'id':_0xe5ae56[_0x41c1('0x76')]['id'],'name':_0xe5ae56[_0x41c1('0x76')][_0x41c1('0x40')],'active':_0xe5ae56[_0x41c1('0x76')]['active'],'callerid':_0xe5ae56[_0x41c1('0x76')][_0x41c1('0x77')]};}if(_0xe5ae56[_0x41c1('0x43')]){_0x50792c[_0x41c1('0x43')]={'id':_0xe5ae56[_0x41c1('0x43')]['id'],'name':_0xe5ae56[_0x41c1('0x43')]['name']};}var _0xfd6566=md5(JSON[_0x41c1('0x47')](_0x50792c));if(_0xe5ae56['md5']!==_0xfd6566){_0xe5ae56['md5']=_0xfd6566;emit(util['format'](_0x41c1('0x78'),_0x50792c[_0x41c1('0x40')]),_0x41c1('0x79'),_0x50792c);}}}function emitCampaignSummary(_0x25c810){if(_0x25c810['type']==='ivr'){emit(util[_0x41c1('0x7a')](_0x41c1('0x7b'),_0x25c810['name']),'campaign:save',_0x25c810);}}function checkGetDataPredictive(_0x2786da){if(isNotNull(_0x2786da)){if(!_['isEmpty'](_0x2786da)){loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x7d'));loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x7e'),_0x2786da[_0x41c1('0x7f')]);loggerPredictive[_0x41c1('0x7c')]('Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2786da['predictiveIntervalAnsweredCalls']);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x80'),_0x2786da[_0x41c1('0x6c')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x81'),_0x2786da[_0x41c1('0x6b')]);loggerPredictive[_0x41c1('0x7c')]('AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2786da[_0x41c1('0x69')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x82'),_0x2786da[_0x41c1('0x6a')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x83'));if(_0x2786da[_0x41c1('0x7f')]>0x0){if(!_['isUndefined'](_0x2786da[_0x41c1('0x6a')])&&_0x2786da[_0x41c1('0x6a')]>0x0){return!![];}else{loggerPredictive['info']('Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}if(!_[_0x41c1('0x84')](_0x2786da[_0x41c1('0x69')])&&_0x2786da[_0x41c1('0x69')]>0x0){return!![];}else{loggerPredictive[_0x41c1('0x7c')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x41c1('0x7c')]('History\x20information\x20are\x20empty');}}else{loggerPredictive['info'](_0x41c1('0x85'));}return![];}function mergeDataErlangB(_0x4847b8){return function(_0xe8690d){loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x86'));loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x87'),_0xe8690d[_0x41c1('0x88')]);loggerPredictive[_0x41c1('0x7c')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0xe8690d[_0x41c1('0x73')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x89'),_0xe8690d[_0x41c1('0x74')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x8a'),_0xe8690d[_0x41c1('0x75')]);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x89'),_0xe8690d['erlangAbandonmentRate']);loggerPredictive['info']('---------------------------');_[_0x41c1('0x8b')](_0x4847b8,_0xe8690d);};}function getDiff(_0x41cfc1){var _0x5535ff=moment()['milliseconds'](0x0);var _0x286c3e=moment(_0x41cfc1)[_0x41c1('0x48')](0x0);return _0x5535ff[_0x41c1('0x49')](_0x286c3e,_0x41c1('0x4a'));}function ifInterval(_0x1232ed,_0x3c543c){if(_['isUndefined'](_0x3c543c)){return![];}if(getDiff(_0x3c543c)<_0x1232ed*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x5eaa36){if(isNotNull(_0x5eaa36)){if(!_['isUndefined'](_0x5eaa36['startProgressive'])){_0x5eaa36['startProgressive']=undefined;loggerPredictive['info'](_0x5eaa36['name'],_0x41c1('0x8c'));}if(!_[_0x41c1('0x84')](_0x5eaa36[_0x41c1('0x29')])){_0x5eaa36[_0x41c1('0x29')]=undefined;loggerPredictive[_0x41c1('0x7c')](_0x5eaa36[_0x41c1('0x40')],_0x41c1('0x8d'));}if(!_[_0x41c1('0x84')](_0x5eaa36[_0x41c1('0x8e')])){clearInterval(_0x5eaa36[_0x41c1('0x8e')]);_0x5eaa36[_0x41c1('0x8e')]=undefined;loggerPredictive['info'](_0x5eaa36[_0x41c1('0x40')],_0x41c1('0x8f'));}}}function erlangb(_0x4e6de6,_0x5299be){if(_0x5299be===0x0){return 0x0;}var _0x2ad34e=0x1;for(var _0x2c1762=0x1;_0x2c1762<=_0x5299be;_0x2c1762+=0x1){_0x2ad34e=0x1+_0x2ad34e*_0x2c1762/_0x4e6de6;}return 0x1/_0x2ad34e;}function isVoiceQueueOutbound(_0x1faea8){return _0x1faea8===_0x41c1('0x4d');}function isNotPreview(_0x16f2e6){return _0x16f2e6!==_0x41c1('0x1f');}function isCampaignIvr(_0x45ddb7){return _0x45ddb7===_0x41c1('0x90');}function getCallerId(_0xb4696a,_0x5c02a6,_0x4562e8){if(!_['isUndefined'](_0x4562e8)&&_0x41c1('0x91')===typeof _0x4562e8&&!_[_0x41c1('0x92')](_0x4562e8)){if(!_[_0x41c1('0x84')](_0x5c02a6)&&_0x41c1('0x91')===typeof _0x5c02a6&&!_[_0x41c1('0x92')](_0x5c02a6)){return util[_0x41c1('0x7a')](_0x41c1('0x93'),_0x5c02a6,_0x4562e8);}return util[_0x41c1('0x7a')](_0x41c1('0x93'),_0x4562e8,_0x4562e8);}if(!_['isUndefined'](_0xb4696a)&&'string'===typeof _0xb4696a&&!_[_0x41c1('0x92')](_0xb4696a)){return _0xb4696a;}return _0x41c1('0x94');}function loggerCatchQueueSummary(_0x2e5753,_0x421948){return function(_0x144100){freeVariablesPredictive(_0x421948);emitVoiceQueueSummary(_0x421948);emitCampaignSummary(_0x421948);loggerSyncQueueSummary['error'](_0x2e5753,util[_0x41c1('0x95')](_0x144100,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x4ff16b,_0xd0d6cb){return function(_0x4b45d5){loggerPredictive[_0x41c1('0x96')](_0xd0d6cb[_0x41c1('0x40')],_0x4ff16b);loggerPredictive['error'](_0x4b45d5[_0x41c1('0x97')]);freeVariablesPredictive(_0xd0d6cb);};}function loggerCatch(_0x387648){return function(_0x336612){logger[_0x41c1('0x96')](_0x387648,util[_0x41c1('0x95')](_0x336612,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x36b9a7){return _0x36b9a7&&!_[_0x41c1('0x84')](_0x36b9a7)&&_0x36b9a7[_0x41c1('0x98')]>0x0;}function decremetOriginate(_0x1134f8){if(!_[_0x41c1('0x84')](_0x1134f8)&&_0x1134f8!==null){if(_0x1134f8[_0x41c1('0x99')](_0x41c1('0x72'))){if(_0x1134f8[_0x41c1('0x72')]>0x0){_0x1134f8[_0x41c1('0x72')]-=0x1;}else{logger[_0x41c1('0x96')](_0x41c1('0x9a'));}}}else{logger['error'](_0x41c1('0x9b'));}}function checkContactLowerLimitOriginate(_0x3badcf,_0x4c08b5,_0x133b36){if(_0x4c08b5>_0x133b36){for(var _0x37aa7f=0x0;_0x37aa7f<_0x4c08b5-_0x133b36;_0x37aa7f+=0x1){decremetOriginate(_0x3badcf);}}}function loggerGetContactDialer(_0x5a9aad,_0x437a28,_0x503442){return function(_0x23bc76){checkContactLowerLimitOriginate(_0x437a28,_0x503442,0x0);logger[_0x41c1('0x96')](_0x5a9aad,util[_0x41c1('0x95')](_0x23bc76,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x488175){return function(_0x123b50){if(isNotNull(_0x123b50)&&isNotNull(_0x123b50[0x0])){if(_0x123b50[0x0][_0x41c1('0x9c')]>0x0){_0x488175[_0x41c1('0x3e')]=_0x41c1('0x9d');logger[_0x41c1('0x7c')](_0x41c1('0x9e')+_0x488175[_0x41c1('0x40')],_0x123b50[0x0][_0x41c1('0x9c')],_0x41c1('0x9f'));}else{_0x488175['message']='AVAILABLE_CONTACTS_FINISHED';logger[_0x41c1('0x7c')](_0x41c1('0xa0')+_0x488175[_0x41c1('0x40')]);}}};}function notSendMessagesQueue(_0x2a8dc9){if(_0x2a8dc9['sendMessageOneNotActive']){freeVariablesPredictive(_0x2a8dc9);if(_0x2a8dc9[_0x41c1('0x72')]===0x0&&_0x2a8dc9[_0x41c1('0x55')]===0x0&&_0x2a8dc9['waiting']===0x0&&(_0x2a8dc9[_0x41c1('0x51')]||0x0)===0x0){_0x2a8dc9['sendMessageOneNotActive']=![];_0x2a8dc9[_0x41c1('0x4f')]=0x0;_0x2a8dc9[_0x41c1('0x3e')]='NOT_ACTIVE';loggerSyncQueueSummary['error']('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2a8dc9[_0x41c1('0x40')],'is\x20not\x20active');}else{_0x2a8dc9[_0x41c1('0x3e')]=_0x41c1('0xa1');loggerSyncQueueSummary[_0x41c1('0x96')](_0x41c1('0xa2'),_0x2a8dc9[_0x41c1('0x40')],'is\x20disactive');}emitVoiceQueueSummary(_0x2a8dc9);}}function notSendMessagesCampaign(_0x2e81bf){if(_0x2e81bf[_0x41c1('0xa3')]){if(_0x2e81bf['originated']===0x0){_0x2e81bf[_0x41c1('0xa3')]=![];_0x2e81bf[_0x41c1('0x3e')]=_0x41c1('0x41');loggerSyncQueueSummary[_0x41c1('0x96')](_0x41c1('0xa4'),_0x2e81bf[_0x41c1('0x40')],_0x41c1('0xa5'));}else{_0x2e81bf[_0x41c1('0x3e')]=_0x41c1('0xa1');loggerSyncQueueSummary[_0x41c1('0x96')](_0x41c1('0xa4'),_0x2e81bf['name'],'is\x20disactive');}emitCampaignSummary(_0x2e81bf);}}function createObjHistory(_0x3da6f3,_0x190281,_0x5b2326,_0x3f7c9f,_0x1d97f8){_0x3da6f3[_0x41c1('0x3e')]=_0x5b2326;var _0x8585e4=new Action(_0x3da6f3,_0x190281);var _0x6c3fa3=new History(_0x8585e4);_0x6c3fa3['state']=_0x3f7c9f;_0x6c3fa3['statedesc']=_0x1d97f8;_0x6c3fa3[_0x41c1('0xa6')]=_0x8585e4[_0x41c1('0xa7')];return _0x6c3fa3;}Dialer[_0x41c1('0x1b')]['loopClearZombieChannels']=function(){var _0x45688c=this;setInterval(function(){_0x45688c[_0x41c1('0xa8')](_0x45688c[_0x41c1('0x27')],'[uniqueid]');_0x45688c[_0x41c1('0xa8')](_0x45688c[_0x41c1('0xa9')],_0x41c1('0xaa'));},0x32c8);};Dialer[_0x41c1('0x1b')][_0x41c1('0xa8')]=function(_0x5ee29e,_0x468d50){var _0x6a2f73=this;for(var _0x5c25d7 in _0x5ee29e){if(_0x5ee29e[_0x41c1('0x99')](_0x5c25d7)){this[_0x41c1('0xab')][_0x41c1('0x1c')](function(){if(!_['isNil'](_0x5ee29e[_0x5c25d7])){return ami['Action']({'action':'status','channel':_0x5ee29e[_0x5c25d7][_0x41c1('0xac')]})[_0x41c1('0xad')](function(_0x2c8e98){if(_0x2c8e98['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x5ee29e[_0x5c25d7]&&_0x5ee29e[_0x5c25d7][_0x41c1('0x4c')]!=='ivr'){_0x6a2f73[_0x41c1('0xae')](_0x6a2f73[_0x41c1('0x20')][_0x5ee29e[_0x5c25d7]['queue']]);logger[_0x41c1('0x96')](_0x41c1('0xaf'),_0x468d50,_0x5c25d7,_0x5ee29e[_0x5c25d7]['queue']);delete _0x5ee29e[_0x5c25d7];}if(_0x5ee29e[_0x5c25d7]&&_0x5ee29e[_0x5c25d7][_0x41c1('0x4c')]===_0x41c1('0x90')){_0x6a2f73[_0x41c1('0xae')](_0x6a2f73[_0x41c1('0x21')][_0x5ee29e[_0x5c25d7][_0x41c1('0xb0')]]);logger[_0x41c1('0x96')](_0x41c1('0xb1'),_0x468d50,_0x5c25d7,_0x5ee29e[_0x5c25d7][_0x41c1('0xb0')]);delete _0x5ee29e[_0x5c25d7];}},0x2328);}});}});}}};Dialer[_0x41c1('0x1b')][_0x41c1('0xb2')]=function(_0x26f081){return BPromise[_0x41c1('0xb3')]()['then'](cmHopper[_0x41c1('0xb2')](_0x26f081))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xb4')));};Dialer[_0x41c1('0x1b')][_0x41c1('0xb5')]=function(_0x207925){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](cmHopperBlack[_0x41c1('0xb5')](_0x207925))['catch'](loggerCatch(_0x41c1('0xb7')));};Dialer['prototype'][_0x41c1('0xb8')]=function(_0x4853bf){return BPromise[_0x41c1('0xb3')]()['then'](cmHopperBlack[_0x41c1('0xb8')](_0x4853bf))['catch'](loggerCatch(_0x41c1('0xb9')));};Dialer[_0x41c1('0x1b')]['averageHandleTime']=function(_0x4e613c){return BPromise[_0x41c1('0xb3')]()['then'](cmHopperHistory[_0x41c1('0xba')](_0x4e613c))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xbb')));};Dialer[_0x41c1('0x1b')]['rescheduleContact']=function(_0x5f6943){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](cmHopper[_0x41c1('0xbc')](_0x5f6943))['catch'](loggerCatch(_0x41c1('0xbd')));};Dialer[_0x41c1('0x1b')][_0x41c1('0xbe')]=function(_0x504596,_0x26d730,_0x557a54){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](cmHopper[_0x41c1('0xbe')](_0x504596,_0x26d730,_0x557a54))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xbf')));};Dialer[_0x41c1('0x1b')][_0x41c1('0xc0')]=function(_0x4713a6,_0x5ccac4,_0x27d511,_0x56ff96){return BPromise[_0x41c1('0xb3')]()['then'](cmHopper['getContactDialer'](_0x4713a6,_0x5ccac4,_0x27d511,_0x56ff96))['catch'](loggerCatch(_0x41c1('0xc1')));};Dialer['prototype']['getContactDialerIvr']=function(_0x332cbb,_0x124649,_0x2e776e){return BPromise[_0x41c1('0xb3')]()['then'](cmHopper['getContactDialerIvr'](_0x332cbb,_0x124649,_0x2e776e))[_0x41c1('0xad')](loggerCatch('[getContactDialer]\x20'));};Dialer[_0x41c1('0x1b')][_0x41c1('0xc2')]=function(_0x3aa485){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](voiceQueueRt[_0x41c1('0xc2')](_0x3aa485))[_0x41c1('0xad')](loggerCatch('[getVoiceQueueRtPauses]\x20'));};Dialer[_0x41c1('0x1b')][_0x41c1('0xc3')]=function(_0x51300c){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](cmHopper['moveContactManagedDialer'](_0x51300c))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xc4')));};Dialer[_0x41c1('0x1b')][_0x41c1('0xc5')]=function(_0x494e14){return BPromise[_0x41c1('0xb3')]()[_0x41c1('0xb6')](cmHopperHistory[_0x41c1('0xc5')](_0x494e14))[_0x41c1('0xad')](loggerCatch('[createHistory]\x20'));};Dialer[_0x41c1('0x1b')]['updateOriginated']=function(_0x2f615c){if(!_[_0x41c1('0x84')](_0x2f615c)&&_0x2f615c!==null){if(_0x2f615c[_0x41c1('0x99')](_0x41c1('0x72'))){if(_0x2f615c[_0x41c1('0x72')]>0x0){_0x2f615c['originated']-=0x1;}else{logger[_0x41c1('0x96')](_0x41c1('0xc6'));}}}else{logger[_0x41c1('0x96')](_0x41c1('0xc7'));}};Dialer['prototype'][_0x41c1('0xc8')]=function(_0x3cc758,_0x127191){var _0x41ecf8=this;return function(_0x3398b1){_0x41ecf8[_0x41c1('0xae')](_0x127191);logger[_0x41c1('0x96')](_0x3cc758,util[_0x41c1('0x95')](_0x3398b1,{'showHidden':![],'depth':null}));};};Dialer[_0x41c1('0x1b')]['emptyContact']=function(_0x4d6a9a,_0xfdaca9,_0x4cf8a3){var _0x503201={'state':0x19,'statedesc':_0x41c1('0xc9')};this[_0x41c1('0xae')](_0xfdaca9);this[_0x41c1('0xca')](_[_0x41c1('0x8b')](_0x503201,_[_0x41c1('0xcb')](_0x4cf8a3,['ContactId','ListId','UserId',_0x41c1('0xcc'),_0x41c1('0xcd')])),_0x41c1('0xce'),'[emptyContact]');logger['error'](_0x4d6a9a);};Dialer[_0x41c1('0x1b')][_0x41c1('0xcf')]=function(_0x1c21d4){return _0x1c21d4===_0x41c1('0xd0');};Dialer[_0x41c1('0x1b')]['isTrunkReachable']=function(_0x35228e){return!_[_0x41c1('0x84')](_0x35228e)&&_0x35228e&&!_[_0x41c1('0x84')](_0x35228e[_0x41c1('0x40')])&&!_[_0x41c1('0x84')](_0x35228e[_0x41c1('0xd1')])&&_0x35228e[_0x41c1('0xd1')]&&(this[_0x41c1('0x23')][util[_0x41c1('0x7a')](_0x41c1('0xd2'),_0x35228e['name'])][_0x41c1('0xd3')]==='reachable'||this[_0x41c1('0x23')][util['format'](_0x41c1('0xd2'),_0x35228e[_0x41c1('0x40')])][_0x41c1('0xd3')]==='unmonitored');};Dialer[_0x41c1('0x1b')][_0x41c1('0xca')]=function(_0x495b7e,_0x274222,_0x11d7d0){this[_0x41c1('0xc5')](_0x495b7e)[_0x41c1('0xad')](loggerCatch(_0x274222));this[_0x41c1('0xc3')](_0x495b7e)[_0x41c1('0xad')](loggerCatch(_0x11d7d0));};Dialer[_0x41c1('0x1b')][_0x41c1('0x39')]=function(_0x35c8a0){var _0x52b1eb=this[_0x41c1('0x27')][_0x35c8a0[_0x41c1('0xd4')]];var _0x300764;if(!_[_0x41c1('0xd5')](_0x35c8a0)&&!_[_0x41c1('0xd5')](_0x35c8a0['variable'])&&!_[_0x41c1('0xd5')](_0x35c8a0[_0x41c1('0xd6')][_0x41c1('0xd7')])&&_0x35c8a0[_0x41c1('0xd8')]==='xcally-motion-dialer'&&_0x52b1eb){if(_0x52b1eb['type']!==_0x41c1('0x90')&&this[_0x41c1('0x20')][_0x52b1eb[_0x41c1('0xb0')]]['dialAMDActive']&&_0x35c8a0['value']===_0x41c1('0xd9')){delete this['uniqueId'][_0x35c8a0[_0x41c1('0xd4')]];this[_0x41c1('0xae')](this[_0x41c1('0x20')][_0x52b1eb['queue']]);this[_0x41c1('0x20')][_0x52b1eb[_0x41c1('0xb0')]][_0x41c1('0x5e')]+=0x1;this[_0x41c1('0x20')][_0x52b1eb['queue']][_0x41c1('0xda')]+=0x1;_0x300764=new Hangup(_0x52b1eb,_0x35c8a0);_0x300764[_0x41c1('0xdb')]=0x12;_0x300764['statedesc']=_0x41c1('0xdc');_0x300764[_0x41c1('0xdd')]=_0x41c1('0xde');this['saveInDb'](_0x300764,_0x41c1('0xdf'),'[syncHangupInAMD]');}if(_0x52b1eb['type']!==_0x41c1('0x90')&&this[_0x41c1('0x20')][_0x52b1eb[_0x41c1('0xb0')]]['dialAMDActive']&&_0x35c8a0[_0x41c1('0xe0')]===_0x41c1('0xe1')){delete this['uniqueId'][_0x35c8a0[_0x41c1('0xd4')]];this[_0x41c1('0xae')](this[_0x41c1('0x20')][_0x52b1eb['queue']]);this['voiceQueues'][_0x52b1eb[_0x41c1('0xb0')]][_0x41c1('0x5e')]+=0x1;this[_0x41c1('0x20')][_0x52b1eb[_0x41c1('0xb0')]][_0x41c1('0xda')]+=0x1;_0x300764=new Hangup(_0x52b1eb,_0x35c8a0);_0x300764['state']=0x13;_0x300764[_0x41c1('0xe2')]=_0x41c1('0xe3');_0x300764[_0x41c1('0xdd')]='AMD';_0x300764[_0x41c1('0xe4')]=!![];this[_0x41c1('0xca')](_0x300764,_0x41c1('0xe5'),_0x41c1('0xe6'));}if(_0x52b1eb[_0x41c1('0x4c')]===_0x41c1('0x90')&&this['campaigns'][_0x52b1eb[_0x41c1('0xb0')]][_0x41c1('0xe7')]&&_0x35c8a0['value']===_0x41c1('0xd9')){delete this['uniqueId'][_0x35c8a0[_0x41c1('0xd4')]];this['updateOriginated'](this[_0x41c1('0x21')][_0x52b1eb[_0x41c1('0xb0')]]);_0x300764=new Hangup(_0x52b1eb,_0x35c8a0);_0x300764['state']=0x12;_0x300764[_0x41c1('0xe2')]='HangupInAMD';_0x300764[_0x41c1('0xdd')]=_0x41c1('0xde');this['saveInDb'](_0x300764,'[syncHangupInAMDIvr][createHistory]',_0x41c1('0xe8'));}if(_0x52b1eb[_0x41c1('0x4c')]==='ivr'&&this['campaigns'][_0x52b1eb[_0x41c1('0xb0')]][_0x41c1('0xe7')]&&_0x35c8a0[_0x41c1('0xe0')]===_0x41c1('0xe1')){delete this['uniqueId'][_0x35c8a0[_0x41c1('0xd4')]];this[_0x41c1('0xae')](this[_0x41c1('0x21')][_0x52b1eb[_0x41c1('0xb0')]]);_0x300764=new Hangup(_0x52b1eb,_0x35c8a0);_0x300764[_0x41c1('0xdb')]=0x13;_0x300764[_0x41c1('0xe2')]='Machine';_0x300764['membername']=_0x41c1('0xde');_0x300764[_0x41c1('0xe4')]=!![];this[_0x41c1('0xca')](_0x300764,_0x41c1('0xe9'),_0x41c1('0xea'));}}};Dialer['prototype'][_0x41c1('0x37')]=function(_0x4f5158){var _0x5e5b7a=this[_0x41c1('0x27')][_0x4f5158[_0x41c1('0xd4')]];var _0x28fbd9=this;var _0x2ef179;if(_0x5e5b7a&&_0x5e5b7a[_0x41c1('0x4c')]===_0x41c1('0x90')){delete this[_0x41c1('0x27')][_0x4f5158['uniqueid']];this['updateOriginated'](this['campaigns'][_0x5e5b7a[_0x41c1('0xb0')]]);this[_0x41c1('0x21')][_0x5e5b7a['queue']][_0x41c1('0xeb')]+=0x1;_0x2ef179=new Hangup(_0x5e5b7a,_0x4f5158);this[_0x41c1('0xc5')](_0x2ef179)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xec')));this['moveContactManagedDialer'](_0x2ef179)['catch'](loggerCatch(_0x41c1('0xed')));}if(_0x5e5b7a&&_0x5e5b7a[_0x41c1('0x4c')]!==_0x41c1('0x90')&&isNotNull(this[_0x41c1('0x20')][_0x5e5b7a[_0x41c1('0xb0')]][_0x41c1('0xee')])){delete this['uniqueId'][_0x4f5158['uniqueid']];this[_0x41c1('0xae')](this['voiceQueues'][_0x5e5b7a[_0x41c1('0xb0')]]);this[_0x41c1('0x20')][_0x5e5b7a[_0x41c1('0xb0')]]['outboundAnswerCallsDay']+=0x1;this[_0x41c1('0x20')][_0x5e5b7a[_0x41c1('0xb0')]][_0x41c1('0xda')]+=0x1;_0x2ef179=new Hangup(_0x5e5b7a,_0x4f5158);_0x2ef179[_0x41c1('0xdb')]=0x10;_0x2ef179[_0x41c1('0xe2')]=_0x41c1('0xef');_0x2ef179[_0x41c1('0xdd')]=_0x41c1('0xf0');this[_0x41c1('0xc5')](_0x2ef179)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xec')));this[_0x41c1('0xc3')](_0x2ef179)['catch'](loggerCatch('[syncHangupIvr]'));}if(_0x5e5b7a&&_0x5e5b7a[_0x41c1('0x4c')]!==_0x41c1('0x90')&&!isNotNull(this['voiceQueues'][_0x5e5b7a[_0x41c1('0xb0')]]['dialQueueProject'])){delete this[_0x41c1('0x27')][_0x4f5158[_0x41c1('0xd4')]];this['updateOriginated'](this[_0x41c1('0x20')][_0x5e5b7a['queue']]);this[_0x41c1('0x20')][_0x5e5b7a['queue']][_0x41c1('0x67')]+=0x1;_0x2ef179=new Hangup(_0x5e5b7a,_0x4f5158);_0x2ef179['state']=0xc;_0x2ef179[_0x41c1('0xe2')]=_0x4f5158[_0x41c1('0xf1')];_0x2ef179[_0x41c1('0xdd')]=_0x41c1('0xf2');this[_0x41c1('0xc5')](_0x2ef179)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xec')));this[_0x41c1('0xc3')](_0x2ef179)[_0x41c1('0xad')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0x41c1('0x1b')]['syncAgentComplete']=function(_0x5b8c3b){var _0x395bfd=this['uniqueId'][_0x5b8c3b['uniqueid']];var _0x16602d=this;if(this[_0x41c1('0x20')][_0x5b8c3b['queue']]){if(_0x395bfd&&_0x395bfd[_0x41c1('0x4c')]!==_0x41c1('0x90')){delete this[_0x41c1('0x27')][_0x5b8c3b[_0x41c1('0xd4')]];this['voiceQueues'][_0x5b8c3b[_0x41c1('0xb0')]]['outboundAnswerCallsDay']+=0x1;var _0x513ae4=new AgentComplete(_0x395bfd,_0x5b8c3b);if(_0x5b8c3b[_0x41c1('0xf3')]===_0x41c1('0xf4')){_0x513ae4[_0x41c1('0xf5')]=this[_0x41c1('0x20')][_0x5b8c3b[_0x41c1('0xb0')]]['dialQueueProject2']&&this['voiceQueues'][_0x5b8c3b[_0x41c1('0xb0')]][_0x41c1('0xf6')]?moment()[_0x41c1('0x7a')](_0x41c1('0xf7')):undefined;}this[_0x41c1('0xc5')](_0x513ae4)['catch'](loggerCatch('[syncAgentComplete][createHistory]'));this[_0x41c1('0xc3')](_0x513ae4)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xf8')));}}};Dialer[_0x41c1('0x1b')][_0x41c1('0x2f')]=function(_0x558ebd){if(this[_0x41c1('0x20')][_0x558ebd[_0x41c1('0xb0')]]){if(this[_0x41c1('0x27')][_0x558ebd['uniqueid']]&&this[_0x41c1('0x27')][_0x558ebd[_0x41c1('0xd4')]][_0x41c1('0x4c')]!==_0x41c1('0x90')){this['updateOriginated'](this[_0x41c1('0x20')][_0x558ebd[_0x41c1('0xb0')]]);this[_0x41c1('0x27')][_0x558ebd[_0x41c1('0xd4')]]['answertime']=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));}}};Dialer[_0x41c1('0x1b')][_0x41c1('0xf9')]=function(_0x4735f3){this['createHistory'](_0x4735f3)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xfa')));this[_0x41c1('0xc3')](_0x4735f3)[_0x41c1('0xad')](loggerCatch(_0x41c1('0xfb')));};Dialer[_0x41c1('0x1b')][_0x41c1('0x32')]=function(_0x3d121e){var _0x72a84=this['uniqueId'][_0x3d121e[_0x41c1('0xd4')]];var _0x4c6cd8=this;if(this['voiceQueues'][_0x3d121e[_0x41c1('0xb0')]]){if(_0x72a84&&_0x72a84[_0x41c1('0x4c')]!=='ivr'){delete this['uniqueId'][_0x3d121e['uniqueid']];this[_0x41c1('0xae')](this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]]);_0x72a84[_0x41c1('0xfc')]=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));var _0x319ac8=new QueueCallerAbandon(_0x72a84,_0x3d121e);if(getSeconds(_0x72a84[_0x41c1('0xfc')],_0x72a84[_0x41c1('0xfd')])>=_0x72a84[_0x41c1('0xfe')]){this[_0x41c1('0x20')][_0x3d121e['queue']][_0x41c1('0x6c')]+=0x1;this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]][_0x41c1('0xff')]+=0x1;this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x319ac8[_0x41c1('0xdb')]=0xa;_0x319ac8[_0x41c1('0xe2')]=_0x41c1('0x100');_0x319ac8[_0x41c1('0x101')]=_0x41c1('0x102');_0x319ac8[_0x41c1('0xf5')]=this[_0x41c1('0x20')][_0x3d121e['queue']]['dialQueueProject2']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):undefined;if(_0x319ac8[_0x41c1('0x103')]>=this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]][_0x41c1('0x104')]-0x1){this['queueCallerAbandonCreateState'](_0x319ac8);}else{this['rescheduleContact']({'active':![],'countdropretry':_0x319ac8[_0x41c1('0x103')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](this[_0x41c1('0x20')][_0x3d121e['queue']][_0x41c1('0x106')],_0x41c1('0x107'))[_0x41c1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x72a84[_0x41c1('0x108')],'ListId':_0x72a84[_0x41c1('0x109')],'VoiceQueueId':_0x72a84[_0x41c1('0xcc')]||undefined,'CampaignId':_0x72a84[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x10a')));}}else{this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]]['predictiveIntervalDroppedCallsCallersExit']+=0x1;this['voiceQueues'][_0x3d121e[_0x41c1('0xb0')]][_0x41c1('0x61')]+=0x1;_0x319ac8[_0x41c1('0xdb')]=0xb;_0x319ac8['statedesc']=_0x41c1('0x10b');_0x319ac8[_0x41c1('0x101')]='CALLEREXIT';if(_0x319ac8[_0x41c1('0x10c')]>=this['voiceQueues'][_0x3d121e[_0x41c1('0xb0')]]['dialAbandonedMaxRetry']-0x1){this[_0x41c1('0xf9')](_0x319ac8);}else{this[_0x41c1('0xbc')]({'active':![],'countabandonedretry':_0x319ac8['countabandonedretry']+=0x1,'scheduledat':moment()[_0x41c1('0x105')](this[_0x41c1('0x20')][_0x3d121e[_0x41c1('0xb0')]][_0x41c1('0x10d')],_0x41c1('0x107'))[_0x41c1('0x7a')](_0x41c1('0xf7')),'ContactId':_0x72a84[_0x41c1('0x108')],'ListId':_0x72a84[_0x41c1('0x109')],'VoiceQueueId':_0x72a84['VoiceQueueId']||undefined,'CampaignId':_0x72a84[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x10e')));}}}}};Dialer['prototype'][_0x41c1('0x10f')]=function(_0x5c02ac){if(this['actions'][_0x5c02ac['uniqueid']]){this['actions'][_0x5c02ac['uniqueid']][_0x41c1('0xac')]=_0x5c02ac[_0x41c1('0xac')];}if(this[_0x41c1('0x27')][_0x5c02ac[_0x41c1('0xd4')]]){this[_0x41c1('0x27')][_0x5c02ac[_0x41c1('0xd4')]][_0x41c1('0xac')]=_0x5c02ac[_0x41c1('0xac')];}};Dialer['prototype'][_0x41c1('0x3b')]=function(_0x5838ff){if(strategy[this[_0x41c1('0x20')][this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]]['queue']][_0x41c1('0x4e')]]===_0x41c1('0x1a')){if(this['actions'][_0x5838ff[_0x41c1('0x110')]]&&_[_0x41c1('0xd5')](this['actions'][_0x5838ff[_0x41c1('0x110')]][_0x41c1('0x111')])&&_0x5838ff[_0x41c1('0xd3')]==='1'&&_0x5838ff[_0x41c1('0x112')]==='0'){if(this[_0x41c1('0x22')][_0x5838ff[_0x41c1('0x113')]]){if(!this[_0x41c1('0x22')][_0x5838ff['stateinterface']][_0x41c1('0x111')]){this['agents'][_0x5838ff[_0x41c1('0x113')]][_0x41c1('0x111')]=!![];this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]]['locked']=!![];this[_0x41c1('0xa9')][_0x5838ff['actionid']][_0x41c1('0x113')]=_0x5838ff[_0x41c1('0x113')];}}}}else if((strategy[this[_0x41c1('0x20')][this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]]['queue']]['strategy']]||'rrmemory')==='rrmemory'){if(this[_0x41c1('0xa9')][_0x5838ff['actionid']]){if(this[_0x41c1('0x22')][_0x5838ff[_0x41c1('0x113')]]){this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]][_0x41c1('0x113')]=_0x5838ff[_0x41c1('0x113')];if(_[_0x41c1('0xd5')](this[_0x41c1('0x2c')][this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]][_0x41c1('0xb0')]])){this[_0x41c1('0x2c')][this[_0x41c1('0xa9')][_0x5838ff[_0x41c1('0x110')]][_0x41c1('0xb0')]]=[];}this['queueBooked'][this[_0x41c1('0xa9')][_0x5838ff['actionid']][_0x41c1('0xb0')]][_0x41c1('0x114')](_[_0x41c1('0x8b')](_[_0x41c1('0xcb')](this['actions'][_0x5838ff['actionid']],[_0x41c1('0x115'),_0x41c1('0x113')]),{'status':_0x5838ff[_0x41c1('0xd3')],'paused':_0x5838ff[_0x41c1('0x112')]}));}}}};function unlockQueueStatus(_0x512e01,_0x37e4f6){setTimeout(function(){if(_[_0x41c1('0x84')](_0x512e01[_0x41c1('0x116')])){loggerBooked[_0x41c1('0x96')](_0x41c1('0x117'),_0x37e4f6);}_0x512e01['queueStatusComplete']=!![];loggerBooked['info']('[booked][unlockQueueStatus]',_0x37e4f6,JSON[_0x41c1('0x47')](_[_0x41c1('0xcb')](_0x512e01,[_0x41c1('0x40'),_0x41c1('0x116')])));},0x1f3);}Dialer[_0x41c1('0x1b')][_0x41c1('0x3c')]=function(_0x5acd3e){var _0x91f8ac=this;var _0x1b8e54=_0x91f8ac[_0x41c1('0x20')][_0x91f8ac[_0x41c1('0xa9')][_0x5acd3e['actionid']][_0x41c1('0xb0')]];if(strategy[this[_0x41c1('0x20')][this['actions'][_0x5acd3e['actionid']][_0x41c1('0xb0')]][_0x41c1('0x4e')]]===_0x41c1('0x1a')){if(this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]]&&this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0x113')]){this[_0x41c1('0x1f')]['run'](this[_0x41c1('0xa9')][_0x5acd3e['actionid']]['idHopper'],this['actions'][_0x5acd3e['actionid']]['stateinterface'])[_0x41c1('0xad')](function(_0x2cfa4e){logger[_0x41c1('0x96')](_0x41c1('0x118'),util[_0x41c1('0x95')](_0x2cfa4e,{'showHidden':![],'depth':null}));})['finally'](function(){_0x91f8ac['updateOriginated'](_0x91f8ac[_0x41c1('0x20')][_0x91f8ac[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]]['queue']]);_0x91f8ac[_0x41c1('0x22')][_0x91f8ac[_0x41c1('0xa9')][_0x5acd3e['actionid']][_0x41c1('0x113')]][_0x41c1('0x111')]=![];delete _0x91f8ac[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]];unlockQueueStatus(_0x1b8e54);});}else{this[_0x41c1('0xae')](this[_0x41c1('0x20')][this['actions'][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]]);this[_0x41c1('0xbc')]({'active':![],'ContactId':this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]]['ContactId'],'ListId':this[_0x41c1('0xa9')][_0x5acd3e['actionid']][_0x41c1('0x109')],'VoiceQueueId':this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xcc')]||undefined,'CampaignId':this[_0x41c1('0xa9')][_0x5acd3e['actionid']]['CampaignId']||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x119')));delete this[_0x41c1('0xa9')][_0x5acd3e['actionid']];unlockQueueStatus(_0x1b8e54);}}else if((strategy[this[_0x41c1('0x20')][this['actions'][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]][_0x41c1('0x4e')]]||_0x41c1('0x19'))==='rrmemory'){var _0x2409d7;if(this[_0x41c1('0xa9')][_0x5acd3e['actionid']]&&!_[_0x41c1('0x92')](this['queueBooked'][this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]])){if(this[_0x41c1('0x2d')][_0x91f8ac[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]]){this['queueBookedRR'][_0x91f8ac[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]]['queue']]=this[_0x41c1('0x2d')][this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]]['queue']]?this[_0x41c1('0x2d')][this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]]:this[_0x41c1('0x2c')][this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]]?this[_0x41c1('0x2c')][this[_0x41c1('0xa9')][_0x5acd3e['actionid']][_0x41c1('0xb0')]][_0x41c1('0x11a')]||0x0:0x0;}this[_0x41c1('0x2c')][this[_0x41c1('0xa9')][_0x5acd3e['actionid']][_0x41c1('0xb0')]]['_rr']=this[_0x41c1('0x2d')][this[_0x41c1('0xa9')][_0x5acd3e[_0x41c1('0x110')]][_0x41c1('0xb0')]];for(var _0x1623ac=0x0;_0x1623ac=0x0?!![]:![];})[_0x41c1('0xad')](myreject(_0x2fb3a1)));}}else{_0x39306c[_0x41c1('0x114')](ami[_0x41c1('0x131')]({'action':_0x41c1('0x134'),'command':util[_0x41c1('0x7a')](_0x41c1('0x135'),_0x5bd0b9,!_[_0x41c1('0x84')](config['timezones'][_0x18adb9])?_0x18adb9:'')})[_0x41c1('0xb6')](function(_0x50f478){return _0x50f478[_0x41c1('0x136')]['indexOf'](_0x41c1('0x133'))>=0x0?!![]:![];})[_0x41c1('0xad')](myreject(_0x2fb3a1)));}BPromise[_0x41c1('0x137')](_0x39306c)[_0x41c1('0xb6')](function(_0x527959){var _0x1835a5=_[_0x41c1('0x138')](_0x527959);if(_0x1835a5){return _0x336914(_0x1835a5);}else{_0x185755[_0x41c1('0x3e')]=_0x36227b?_0x41c1('0x139'):_0x41c1('0x13a');return _0x2fb3a1(msgResponse(_0x41c1('0x13b'),_0x41c1('0x12d'),'Global:\x20'+_0x36227b+'\x20'+_0x12d5f5+_0x41c1('0x13c')+util[_0x41c1('0x95')](_0x5bd0b9,{'showHidden':![],'depth':null})+_0x41c1('0x13d')+_0x18adb9));}})[_0x41c1('0xad')](function(_0x26c7dc){return _0x2fb3a1(msgResponse(_0x41c1('0x129'),_0x41c1('0x12d'),JSON[_0x41c1('0x47')](_0x26c7dc)));});});};Dialer['prototype'][_0x41c1('0x13e')]=function(_0xa52cfe){var _0x27ff28=this;return function(){switch(_0xa52cfe[_0x41c1('0x5a')]){case _0x41c1('0x13f'):freeVariablesPredictive(_0xa52cfe);_0x27ff28[_0x41c1('0x140')](_0xa52cfe,0x1);break;case'power':freeVariablesPredictive(_0xa52cfe);_0x27ff28[_0x41c1('0x140')](_0xa52cfe,_0xa52cfe[_0x41c1('0x141')]);break;case _0x41c1('0x7'):_0x27ff28[_0x41c1('0x7')](_0xa52cfe);break;case _0x41c1('0x142'):freeVariablesPredictive(_0xa52cfe);_0x27ff28[_0x41c1('0x140')](_0xa52cfe,0x1);break;default:freeVariablesPredictive(_0xa52cfe);logger[_0x41c1('0x96')](_0x41c1('0x143'),_0xa52cfe[_0x41c1('0x40')],_0x41c1('0x144'));}};};Dialer[_0x41c1('0x1b')][_0x41c1('0x145')]=function(_0x198ac5){var _0x21639e=this;return function(){_0x21639e['handleIvr'](_0x198ac5);};};Dialer[_0x41c1('0x1b')][_0x41c1('0x9')]=function(_0x29c3f8){var _0x3c7fea=this;if(isNotPreview(_0x29c3f8[_0x41c1('0x5a')])){if(isVoiceQueueOutbound(_0x29c3f8['type'])&&isActive(_0x29c3f8[_0x41c1('0x59')])){_0x29c3f8[_0x41c1('0xa3')]=!![];BPromise['resolve']()['then'](checkIsLoggedIn(_0x29c3f8,_0x29c3f8[_0x41c1('0x50')]))[_0x41c1('0xb6')](checkIsActive(_0x29c3f8,_0x29c3f8[_0x41c1('0x59')]))['then'](checkInterval(_0x29c3f8))[_0x41c1('0xb6')](_0x3c7fea[_0x41c1('0x124')](_0x29c3f8))[_0x41c1('0xb6')](_0x3c7fea['checkIfTime'](_0x29c3f8[_0x41c1('0x146')],_0x29c3f8[_0x41c1('0x147')],_0x29c3f8['name'],_0x29c3f8))[_0x41c1('0xb6')](_0x3c7fea[_0x41c1('0x12a')](_0x29c3f8[_0x41c1('0x43')],_0x29c3f8[_0x41c1('0x147')],_0x29c3f8[_0x41c1('0x40')],_0x29c3f8))['then'](_0x3c7fea[_0x41c1('0x13e')](_0x29c3f8))[_0x41c1('0xad')](loggerCatchQueueSummary('[syncQueueSummary]',_0x29c3f8));}else{notSendMessagesQueue(_0x29c3f8);}}else{freeVariablesPredictive(_0x29c3f8);}};Dialer[_0x41c1('0x1b')][_0x41c1('0x123')]=function(){var _0xe024b3=this;var _0x44d8e7;for(var _0x23f696 in this['campaigns']){if(this[_0x41c1('0x21')][_0x41c1('0x99')](_0x23f696)){_0x44d8e7=this[_0x41c1('0x21')][_0x23f696];if(isCampaignIvr(_0x44d8e7[_0x41c1('0x4c')])&&isActive(_0x44d8e7[_0x41c1('0xd1')])){_0x44d8e7['sendMessageOneNotActive']=!![];BPromise['resolve']()[_0x41c1('0xb6')](checkIsActive(_0x44d8e7,_0x44d8e7['active']))[_0x41c1('0xb6')](checkInterval(_0x44d8e7))[_0x41c1('0xb6')](_0xe024b3[_0x41c1('0x124')](_0x44d8e7))[_0x41c1('0xb6')](_0xe024b3[_0x41c1('0x128')](_0x44d8e7[_0x41c1('0x146')],_0x44d8e7[_0x41c1('0x147')],_0x44d8e7[_0x41c1('0x40')],_0x44d8e7))[_0x41c1('0xb6')](_0xe024b3[_0x41c1('0x12a')](_0x44d8e7[_0x41c1('0x43')],_0x44d8e7[_0x41c1('0x147')],_0x44d8e7['name'],_0x44d8e7))['then'](_0xe024b3[_0x41c1('0x145')](_0x44d8e7))['catch'](loggerCatchQueueSummary(_0x41c1('0x148'),_0x44d8e7));}else{notSendMessagesCampaign(_0x44d8e7);}}}};function getCallerIdRandom(_0x28cba8,_0x25fc6f){var _0x4b1496,_0x5892d2,_0x679611;if(_0x25fc6f<=0x0){_0x25fc6f=0x1;}_0x4b1496=new RegExp(_0x41c1('0x149')+_0x25fc6f+'}$');_0x5892d2=Math[_0x41c1('0x14a')](0xa,_0x25fc6f-0x1);_0x679611=Math[_0x41c1('0x14a')](0xa,_0x25fc6f)-0x1;return util[_0x41c1('0x7a')]('%s',_[_0x41c1('0x14b')](_0x28cba8,_0x4b1496,_['random'](_0x5892d2,_0x679611)));}function extractCalleridName(_0x2b1d8d){var _0x357d1c=_0x2b1d8d[_0x41c1('0x14c')](/"(.*?)"/);return _0x357d1c?_0x357d1c[0x1]:_0x2b1d8d;}function extractCalleridNumber(_0x1794b6){var _0x1a9ee1=_0x1794b6[_0x41c1('0x14c')](/<(.*?)>/);return _0x1a9ee1?_0x1a9ee1[0x1]:_0x1794b6;}Dialer[_0x41c1('0x1b')][_0x41c1('0x14d')]=function(_0x290575,_0x531309){var _0x30385b=this;var _0x413b06=uuid['v4']();this[_0x41c1('0xa9')][_0x413b06]=new Action(_0x290575,_0x531309,_0x413b06);return new BPromise(function(_0x79465d,_0x25de7e){if(_['isUndefined'](_0x290575)&&_0x41c1('0x14e')!==typeof _0x290575){return _0x25de7e(msgResponse(_0x41c1('0x14f'),_0x41c1('0x12d'),'voiceQueue\x20is\x20undefine'));}if(_['isUndefined'](_0x531309['Contact'][_0x41c1('0x150')])||_0x531309[_0x41c1('0x151')][_0x41c1('0x150')]===null){return _0x25de7e(msgResponse(_0x41c1('0x14f'),_0x41c1('0x12d'),_0x41c1('0x152')));}var _0x1af04a={'XMD-CALLERID':_0x30385b['actions'][_0x413b06][_0x41c1('0x153')](),'XMD-AGI':_0x290575[_0x41c1('0xee')]?util[_0x41c1('0x7a')](_0x41c1('0x154'),ipAgi,_0x290575[_0x41c1('0xee')]):_0x41c1('0x155'),'XMD-AGIAFTER':_0x290575['dialQueueProject2']?util[_0x41c1('0x7a')](_0x41c1('0x154'),ipAgi,_0x290575[_0x41c1('0x156')]):_0x41c1('0x155'),'XMD-QUEUE':_0x290575[_0x41c1('0x4c')]===_0x41c1('0x4d')?util[_0x41c1('0x7a')](_0x41c1('0x157'),_0x290575[_0x41c1('0x40')],_0x290575[_0x41c1('0x158')]||'',_0x290575[_0x41c1('0xf6')]?'c':'',_0x290575[_0x41c1('0xfe')]||0x3):_0x41c1('0x155'),'XMD-CONTACTID':_0x531309['ContactId'],'XMD-CDRTYPE':_0x41c1('0x159'),'CALLERID(all)':_0x30385b['actions'][_0x413b06][_0x41c1('0x153')](),'XMD-AMD':_0x290575[_0x41c1('0xe7')]?_0x41c1('0x15a'):_0x41c1('0x155'),'XMD-DESTINATION':'xcally-motion-dialer'};if(_0x290575['dialAMDActive']){_0x1af04a[_0x41c1('0x15b')]=_0x290575[_0x41c1('0x15c')]||0x9c4;_0x1af04a[_0x41c1('0x15d')]=_0x290575[_0x41c1('0x15e')]||0x5dc;_0x1af04a[_0x41c1('0x15f')]=_0x290575['dialAMDAfterGreetingSilence']||0x320;_0x1af04a['XMD-AMDTOTALANALYSISTIME']=_0x290575[_0x41c1('0x160')]||0x1388;_0x1af04a[_0x41c1('0x161')]=_0x290575[_0x41c1('0x162')]||0x64;_0x1af04a[_0x41c1('0x163')]=_0x290575['dialAMDBetweenWordsSilence']||0x32;_0x1af04a['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x290575[_0x41c1('0x164')]||0x3;_0x1af04a[_0x41c1('0x165')]=_0x290575[_0x41c1('0x166')]||0x100;_0x1af04a[_0x41c1('0x167')]=_0x290575['dialAMDMaximumWordLength']||0x1388;}if(_0x290575[_0x41c1('0x4c')]===_0x41c1('0x4d')){_0x1af04a[_0x41c1('0x168')]=_0x531309[_0x41c1('0xcc')];}else{_0x1af04a[_0x41c1('0x169')]=_0x531309[_0x41c1('0xcd')];}for(var _0x486546 in _0x531309[_0x41c1('0x151')]){if(_0x531309[_0x41c1('0x151')][_0x41c1('0x99')](_0x486546)){if(isNotNull(_0x531309[_0x41c1('0x151')][_0x486546])&&_0x486546!=='id'&&_0x486546!==_0x41c1('0x16a')&&_0x486546!==_0x41c1('0x16b')&&_0x486546!==_0x41c1('0x16c')){_0x1af04a[util[_0x41c1('0x7a')](_0x41c1('0x16d'),_0x41c1('0x16e'),_[_0x41c1('0x16f')](_0x486546))]=_0x531309[_0x41c1('0x151')][_0x486546];}}}var _0x41e707=_0x30385b[_0x41c1('0x125')](_0x290575[_0x41c1('0x76')])?getCallerId(_0x290575['Trunk'][_0x41c1('0x77')],_0x290575[_0x41c1('0x5b')],_0x290575[_0x41c1('0x170')]>0x0?getCallerIdRandom(_0x290575[_0x41c1('0x171')],_0x290575[_0x41c1('0x170')]):_0x290575['dialOriginateCallerIdNumber']):getCallerId(_[_0x41c1('0xd5')](_0x290575[_0x41c1('0x126')])?_0x290575['Trunk']['callerid']:_0x290575['TrunkBackup'][_0x41c1('0x77')],_0x290575[_0x41c1('0x5b')],_0x290575[_0x41c1('0x170')]>0x0?getCallerIdRandom(_0x290575[_0x41c1('0x171')],_0x290575['dialRandomLastDigitCallerIdNumber']):_0x290575[_0x41c1('0x171')]);if(_0x41e707){_0x1af04a[_0x41c1('0x172')]=_0x30385b[_0x41c1('0xa9')][_0x413b06][_0x41c1('0x173')]=extractCalleridName(_0x41e707);_0x1af04a[_0x41c1('0x174')]=_0x30385b['actions'][_0x413b06]['originatecalleridnum']=extractCalleridNumber(_0x41e707);}return ami[_0x41c1('0x131')]({'actionid':_0x413b06,'action':_0x41c1('0x14f'),'channel':_0x30385b[_0x41c1('0x125')](_0x290575['Trunk'])?util[_0x41c1('0x7a')]('SIP/%s/%s%s',_0x290575[_0x41c1('0x76')][_0x41c1('0x40')],isNotNull(_0x290575[_0x41c1('0x5d')])?_0x290575['dialPrefix'][_0x41c1('0x175')]()||'':'',_0x290575['dialCutDigit']>0x0?_0x531309[_0x41c1('0x151')][_0x41c1('0x150')][_0x41c1('0x176')](_0x290575[_0x41c1('0x177')]):_0x531309['Contact']['phone']):util[_0x41c1('0x7a')]('SIP/%s/%s%s',_[_0x41c1('0xd5')](_0x290575[_0x41c1('0x126')])?_0x290575[_0x41c1('0x76')]['name']:_0x290575[_0x41c1('0x126')][_0x41c1('0x40')],isNotNull(_0x290575[_0x41c1('0x5d')])?_0x290575[_0x41c1('0x5d')][_0x41c1('0x175')]()||'':'',_0x290575['dialCutDigit']>0x0?_0x531309[_0x41c1('0x151')][_0x41c1('0x150')][_0x41c1('0x176')](_0x290575[_0x41c1('0x177')]):_0x531309[_0x41c1('0x151')]['phone']),'callerid':_0x41e707,'Exten':_0x41c1('0x178'),'Context':_0x41c1('0x179'),'Priority':'1','variable':_0x1af04a,'timeout':(_0x290575[_0x41c1('0x5c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x413b06})[_0x41c1('0xb6')](function(_0x3033e3){return _0x79465d(_0x3033e3);})[_0x41c1('0xad')](function(_0x51c033){_0x290575[_0x41c1('0x64')]+=0x1;var _0x113219=new History(_0x30385b['actions'][_0x413b06]);logger[_0x41c1('0x96')](util[_0x41c1('0x7a')](_0x41c1('0x17a'),JSON[_0x41c1('0x47')](_0x51c033)));_0x113219['state']=0xe;_0x113219['statedesc']=_0x41c1('0x17b');_0x113219['starttime']=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));_0x113219[_0x41c1('0xa6')]=_0x113219[_0x41c1('0xa7')];_0x30385b['createHistory'](_0x113219)['catch'](loggerCatch('[originate][error]'));_0x30385b[_0x41c1('0xc3')](_0x113219)['catch'](loggerCatch(_0x41c1('0x17c')))[_0x41c1('0x1e')](function(){delete _0x30385b[_0x41c1('0xa9')][_0x413b06];return _0x25de7e(msgResponse(_0x41c1('0x14f'),_0x41c1('0x46'),_0x41c1('0x17d')));});});});};Dialer[_0x41c1('0x1b')][_0x41c1('0x17e')]=function(_0x58196d){var _0x24a79a=this[_0x41c1('0xa9')][_0x58196d['actionid']];var _0x245dc5=this;if(_0x24a79a){delete this['actions'][_0x58196d[_0x41c1('0x110')]];_0x24a79a[_0x41c1('0xfd')]=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));var _0x24d7ae=_0x24a79a[_0x41c1('0x4c')]===_0x41c1('0x90')?this[_0x41c1('0x21')][_0x24a79a[_0x41c1('0xb0')]]:this['voiceQueues'][_0x24a79a[_0x41c1('0x17f')]()];if(!this[_0x41c1('0xcf')](_0x58196d['response'])){this[_0x41c1('0xae')](_0x24d7ae);return this[_0x41c1('0x180')](_0x24a79a,_0x24d7ae,_0x58196d)[_0x41c1('0xb6')](function(_0x230f61){})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x181')));}else{this[_0x41c1('0x27')][_0x58196d[_0x41c1('0xd4')]]=_0x24a79a;}}};Dialer[_0x41c1('0x1b')][_0x41c1('0x182')]=function(_0x327430,_0x3a9d6c,_0x15dfcf){var _0xf3c866=new History(_0x3a9d6c);if(_0xf3c866[_0x41c1('0x183')]+_0xf3c866[_0x41c1('0x184')]+_0xf3c866['countnoanswerretry']+_0xf3c866[_0x41c1('0x185')]+_0xf3c866[_0x41c1('0x103')]+_0xf3c866[_0x41c1('0x10c')]+_0xf3c866[_0x41c1('0x186')]+_0xf3c866[_0x41c1('0x187')]>=_0x15dfcf[_0x41c1('0x188')]-0x1){return!![];}switch(_0x327430){case 0x3:if(_0xf3c866[_0x41c1('0x189')]>=_0x15dfcf[_0x41c1('0x18a')]-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countnoanswerretry':_0xf3c866[_0x41c1('0x189')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x18b')],'minutes')[_0x41c1('0x7a')](_0x41c1('0xf7')),'ContactId':_0xf3c866[_0x41c1('0x108')],'ListId':_0xf3c866[_0x41c1('0x109')],'VoiceQueueId':_0xf3c866['VoiceQueueId']||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})['catch'](loggerCatch(_0x41c1('0x18c')));}break;case 0x5:if(_0xf3c866[_0x41c1('0x183')]>=_0x15dfcf[_0x41c1('0x18d')]-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countbusyretry':_0xf3c866[_0x41c1('0x183')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x18e')],_0x41c1('0x107'))['format'](_0x41c1('0xf7')),'ContactId':_0xf3c866[_0x41c1('0x108')],'ListId':_0xf3c866['ListId'],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x18f')));}break;case 0x8:if(_0xf3c866[_0x41c1('0x184')]>=_0x15dfcf[_0x41c1('0x190')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countcongestionretry':_0xf3c866[_0x41c1('0x184')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x191')],_0x41c1('0x107'))[_0x41c1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf3c866['ContactId'],'ListId':_0xf3c866[_0x41c1('0x109')],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x192')));}break;case 0x0:if(_0xf3c866[_0x41c1('0x185')]>=_0x15dfcf['dialNoSuchNumberMaxRetry']-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countnosuchnumberretry':_0xf3c866[_0x41c1('0x185')]+=0x1,'scheduledat':moment()['add'](_0x15dfcf[_0x41c1('0x193')],_0x41c1('0x107'))[_0x41c1('0x7a')](_0x41c1('0xf7')),'ContactId':_0xf3c866[_0x41c1('0x108')],'ListId':_0xf3c866['ListId'],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})['catch'](loggerCatch(_0x41c1('0x194')));}break;case 0xa:if(_0xf3c866[_0x41c1('0x103')]>=_0x15dfcf[_0x41c1('0x104')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countdropretry':_0xf3c866['countdropretry']+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x106')],_0x41c1('0x107'))['format'](_0x41c1('0xf7')),'ContactId':_0xf3c866[_0x41c1('0x108')],'ListId':_0xf3c866[_0x41c1('0x109')],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})['catch'](loggerCatch(_0x41c1('0x10a')));}break;case 0xb:if(_0xf3c866['countabandonedretry']>=_0x15dfcf['dialAbandonedMaxRetry']-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countabandonedretry':_0xf3c866[_0x41c1('0x10c')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf['dialAbandonedRetryFrequency'],_0x41c1('0x107'))[_0x41c1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf3c866['ContactId'],'ListId':_0xf3c866['ListId'],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866['CampaignId']||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x10e')));}break;case 0x13:if(_0xf3c866[_0x41c1('0x186')]>=_0x15dfcf[_0x41c1('0x195')]-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countmachineretry':_0xf3c866[_0x41c1('0x186')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x196')],_0x41c1('0x107'))[_0x41c1('0x7a')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0xf3c866[_0x41c1('0x108')],'ListId':_0xf3c866[_0x41c1('0x109')],'VoiceQueueId':_0xf3c866[_0x41c1('0xcc')]||undefined,'CampaignId':_0xf3c866[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x197')));}break;case 0x14:if(_0xf3c866['countagentrejectretry']>=_0x15dfcf['dialAgentRejectMaxRetry']-0x1){return!![];}else{this[_0x41c1('0xbc')]({'active':![],'countagentrejectretry':_0xf3c866[_0x41c1('0x187')]+=0x1,'scheduledat':moment()[_0x41c1('0x105')](_0x15dfcf[_0x41c1('0x198')],_0x41c1('0x107'))['format'](_0x41c1('0xf7')),'ContactId':_0xf3c866['ContactId'],'ListId':_0xf3c866[_0x41c1('0x109')],'VoiceQueueId':_0xf3c866['VoiceQueueId']||undefined,'CampaignId':_0xf3c866['CampaignId']||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x199')));}break;default:return!![];}};Dialer[_0x41c1('0x1b')]['callProgressDetecting']=function(_0x117eed,_0x5d80c8,_0x38cd9d){var _0x26cb5d=this;var _0x4e89ae=new History(_0x117eed);return new BPromise(function(_0x2ac9fd,_0x3c4b5c){if(_['isUndefined'](_0x5d80c8)&&'object'!==typeof _0x5d80c8){return _0x3c4b5c(msgResponse(_0x41c1('0x19a'),_0x41c1('0x12d'),'entity\x20is\x20undefine'));}if(_[_0x41c1('0x84')](_0x38cd9d)&&_0x41c1('0x14e')!==typeof _0x38cd9d){return _0x3c4b5c(msgResponse(_0x41c1('0x19a'),_0x41c1('0x12d'),_0x41c1('0x19b')));}switch(_0x38cd9d['reason']){case'0':_0x5d80c8[_0x41c1('0x63')]+=0x1;_0x4e89ae[_0x41c1('0xdb')]=0x0;_0x4e89ae['statedesc']=_0x41c1('0x19c');_0x26cb5d['createHistory'](_0x4e89ae)[_0x41c1('0xad')](loggerCatch(_0x41c1('0x19d')));if(_0x26cb5d[_0x41c1('0x182')](0x0,_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x183')]+_0x4e89ae[_0x41c1('0x184')]+_0x4e89ae[_0x41c1('0x189')]+_0x4e89ae[_0x41c1('0x185')]+_0x4e89ae[_0x41c1('0x103')]+_0x4e89ae['countabandonedretry']+_0x4e89ae[_0x41c1('0x186')]+_0x4e89ae[_0x41c1('0x187')]>=_0x5d80c8[_0x41c1('0x188')]){_0x26cb5d['stateGlobal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,'reason\x200\x20no\x20such\x20number....');}else{_0x26cb5d['createStateFinal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x19e'));}}break;case'3':_0x5d80c8['outboundNoAnswerCallsDay']+=0x1;_0x4e89ae[_0x41c1('0xdb')]=0x3;_0x4e89ae[_0x41c1('0xe2')]=_0x41c1('0x19f');_0x4e89ae[_0x41c1('0x189')]+=0x1;_0x4e89ae[_0x41c1('0x1a0')]+=0x1;_0x26cb5d['createHistory'](_0x4e89ae)['catch'](loggerCatch(_0x41c1('0x1a1')));if(_0x26cb5d[_0x41c1('0x182')](0x3,_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x189')]>=_0x5d80c8[_0x41c1('0x18a')]){_0x26cb5d['createStateFinal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,'reason\x203\x20ringing\x20no\x20answer');}else{_0x26cb5d[_0x41c1('0x1a2')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1a3'));}}break;case'5':_0x5d80c8[_0x41c1('0x60')]+=0x1;_0x4e89ae[_0x41c1('0xdb')]=0x5;_0x4e89ae[_0x41c1('0xe2')]='Busy';_0x4e89ae[_0x41c1('0x183')]+=0x1;_0x4e89ae[_0x41c1('0x1a0')]+=0x1;_0x26cb5d[_0x41c1('0xc5')](_0x4e89ae)[_0x41c1('0xad')](loggerCatch(_0x41c1('0x1a4')));if(_0x26cb5d[_0x41c1('0x182')](0x5,_0x117eed,_0x5d80c8)){if(_0x4e89ae['countbusyretry']>=_0x5d80c8[_0x41c1('0x18d')]){_0x26cb5d['createStateFinal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1a5'));}else{_0x26cb5d[_0x41c1('0x1a2')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1a5'));}}break;case'8':_0x5d80c8['outboundCongestionCallsDay']+=0x1;_0x4e89ae[_0x41c1('0xdb')]=0x8;_0x4e89ae[_0x41c1('0xe2')]=_0x41c1('0x1a6');_0x4e89ae[_0x41c1('0x184')]+=0x1;_0x4e89ae[_0x41c1('0x1a0')]+=0x1;_0x26cb5d[_0x41c1('0xc5')](_0x4e89ae)[_0x41c1('0xad')](loggerCatch(_0x41c1('0x1a7')));if(_0x26cb5d[_0x41c1('0x182')](0x8,_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x184')]>=_0x5d80c8[_0x41c1('0x190')]){_0x26cb5d['createStateFinal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1a8'));}else{_0x26cb5d['stateGlobal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,'reason\x208\x20congestion');}}break;case'11':_0x5d80c8[_0x41c1('0x1a9')]+=0x1;_0x4e89ae['state']=0xb;_0x4e89ae[_0x41c1('0xe2')]=_0x41c1('0x10b');_0x4e89ae[_0x41c1('0x10c')]+=0x1;_0x4e89ae[_0x41c1('0x1a0')]+=0x1;_0x26cb5d['createHistory'](_0x4e89ae)[_0x41c1('0xad')](loggerCatch(_0x41c1('0x1aa')));if(_0x26cb5d[_0x41c1('0x182')](0xb,_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x10c')]>=_0x5d80c8['dialAbandonedMaxRetry']){_0x26cb5d[_0x41c1('0x1ab')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1ac'));}else{_0x26cb5d['stateGlobal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1ac'));}}break;case'20':_0x5d80c8[_0x41c1('0x66')]+=0x1;_0x4e89ae[_0x41c1('0xdb')]=0x14;_0x4e89ae['statedesc']=_0x41c1('0x1ad');_0x4e89ae[_0x41c1('0x187')]+=0x1;_0x4e89ae[_0x41c1('0x1a0')]+=0x1;_0x26cb5d[_0x41c1('0xc5')](_0x4e89ae)[_0x41c1('0xad')](loggerCatch('[syncAgentComplete][createHistory][20]'));if(_0x26cb5d['checkRetriveMax'](0x14,_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x187')]>=_0x5d80c8[_0x41c1('0x1ae')]){_0x26cb5d['createStateFinal'](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1af'));}else{_0x26cb5d[_0x41c1('0x1a2')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x41c1('0x1af'));}}break;default:_0x5d80c8[_0x41c1('0x67')]+=0x1;_0x4e89ae['state']=0xc;_0x4e89ae[_0x41c1('0xe2')]=_0x38cd9d[_0x41c1('0xf3')];_0x26cb5d[_0x41c1('0xc5')](_0x4e89ae)['catch'](loggerCatch(_0x41c1('0x1b0')));if(_0x26cb5d[_0x41c1('0x182')](_0x38cd9d['reason'],_0x117eed,_0x5d80c8)){if(_0x4e89ae[_0x41c1('0x183')]+_0x4e89ae['countcongestionretry']+_0x4e89ae[_0x41c1('0x189')]+_0x4e89ae[_0x41c1('0x185')]+_0x4e89ae[_0x41c1('0x103')]+_0x4e89ae[_0x41c1('0x10c')]+_0x4e89ae['countmachineretry']+_0x4e89ae[_0x41c1('0x187')]>=_0x5d80c8[_0x41c1('0x188')]){_0x26cb5d[_0x41c1('0x1a2')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x38cd9d[_0x41c1('0xf3')]);}else{_0x26cb5d[_0x41c1('0x1ab')](_0x4e89ae,_0x2ac9fd,_0x3c4b5c,_0x38cd9d[_0x41c1('0xf3')]);}}}});};Dialer['prototype']['stateGlobal']=function(_0x41323e,_0x134c82,_0x4292b5,_0x146374){var _0x539e84=new Final(_0x41323e);_0x539e84[_0x41c1('0xdb')]=0xf;_0x539e84['statedesc']=_0x41c1('0x1b1');this['createStateFinal'](_0x539e84,_0x134c82,_0x4292b5,_0x146374);};Dialer[_0x41c1('0x1b')]['createStateFinal']=function(_0x327248,_0x1ef47d,_0x50f341,_0x242508){this['moveContactManagedDialer'](_0x327248)[_0x41c1('0xb6')](function(_0x5ef9c7){return _0x1ef47d(msgResponse('[callProgressDetecting]','Success',_0x242508));})['catch'](function(_0x21a1b0){return _0x50f341(msgResponse('[moveContactManagedDialer][0]',_0x41c1('0x12d'),_0x41c1('0x1b2')));});};Dialer['prototype'][_0x41c1('0x7')]=function(_0x537711){var _0x41fbd5=this;var _0x5e5fc9=_0x537711[_0x41c1('0x1b3')]/0x64;var _0xe1f7ea=_0x537711['outboundDropCallsDayTimeout']/(_0x537711[_0x41c1('0xff')]+_0x537711['outboundAnswerCallsDay']);var _0x490872=Math[_0x41c1('0x1b4')](_0x537711[_0x41c1('0x1b5')]*(_0x537711[_0x41c1('0x1b6')]/0x64));var _0x221878=Math['round'](_0x537711[_0x41c1('0x1b5')]*(_0x537711[_0x41c1('0x1b7')]/0x64));var _0x555e57=_0x537711[_0x41c1('0x4f')]+_0x537711['talking'];var _0x2f648a=Math[_0x41c1('0x1b8')](_0x537711['erlangCalls']*_0x537711[_0x41c1('0x74')]*_0x537711[_0x41c1('0x6f')]*_0x537711['predictiveIntervalMultiplicativeFactor']);if(_['isUndefined'](_0x537711['startProgressive'])){if(!_[_0x41c1('0x84')](_0x537711[_0x41c1('0x29')])){_0x537711[_0x41c1('0x29')]=undefined;loggerPredictive[_0x41c1('0x96')](_0x41c1('0x1b9'),_0x41c1('0x1ba'));}if(!_[_0x41c1('0x84')](_0x537711[_0x41c1('0x8e')])){loggerPredictive[_0x41c1('0x96')](_0x41c1('0x1b9'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x537711[_0x41c1('0x8e')]);_0x537711['handlePredictive']=undefined;}_0x537711[_0x41c1('0x2a')]=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));loggerPredictive[_0x41c1('0x7c')](_0x537711[_0x41c1('0x40')],_0x41c1('0x1bb'),_0x537711[_0x41c1('0x2a')]);this[_0x41c1('0x140')](_0x537711,0x1);}else if(ifInterval(_0x537711[_0x41c1('0x1bc')],_0x537711[_0x41c1('0x2a')])){this[_0x41c1('0x140')](_0x537711,0x1);loggerPredictiveCalls[_0x41c1('0x7c')]('[startMethodPredictive][StartProgressive][Loop]',_0x537711[_0x41c1('0x2a')],_0x537711[_0x41c1('0x40')]);_0x537711['erlangCalls']=0x0;_0x537711['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x5e5fc9<_0xe1f7ea&&_0x537711[_0x41c1('0x1bd')]===_0x41c1('0x1be')){freeVariablesPredictive(_0x537711);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x1bf'),'Dropped\x20calls\x20day',_0xe1f7ea,_0x41c1('0x2a'),_0x537711[_0x41c1('0x40')]);}else if(_0x2f648a<_0x537711[_0x41c1('0x6e')]&&_0x537711['dialPredictiveOptimization']===_0x41c1('0x1be')){freeVariablesPredictive(_0x537711);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x1c0'),_0x41c1('0x1c1'),_0x2f648a,'Drop\x20in\x20this\x20interval',_0x537711['predictiveIntervalErlangCallsDroppedCalls'],_0x41c1('0x2a'),_0x537711['name']);}else if(!ifInterval(_0x537711['dialPredictiveInterval'],_0x537711[_0x41c1('0x2a')])&&_[_0x41c1('0x84')](_0x537711[_0x41c1('0x29')])&&!_['isUndefined'](_0x537711['startProgressive'])){_0x537711['startPredictive']=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));loggerPredictive[_0x41c1('0x7c')](_0x537711[_0x41c1('0x40')],_0x41c1('0x1c2'),_0x537711[_0x41c1('0x29')]);this[_0x41c1('0x1c3')](_0x537711['dialPredictiveInterval'])[_0x41c1('0xb6')](this[_0x41c1('0x1c4')](_0x537711))[_0x41c1('0xb6')](mergeDataErlangB(_0x537711))['then'](this[_0x41c1('0x1c5')](_0x537711))[_0x41c1('0xad')](loggerCatchPredictive(_0x41c1('0x1c6'),_0x537711));}else if(!ifInterval(_0x537711[_0x41c1('0x1bc')],_0x537711[_0x41c1('0x29')])){_0x537711[_0x41c1('0x6e')]=0x0;_0x537711['startPredictive']=moment()[_0x41c1('0x7a')](_0x41c1('0xf7'));loggerPredictive['info'](_0x537711['name'],_0x41c1('0x1c7'),_0x537711[_0x41c1('0x29')]);clearInterval(_0x537711['handlePredictive']);_0x537711[_0x41c1('0x8e')]=undefined;this[_0x41c1('0x1c3')](_0x537711[_0x41c1('0x1bc')])['then'](this['getDataPredictive'](_0x537711))[_0x41c1('0xb6')](mergeDataErlangB(_0x537711))[_0x41c1('0xb6')](this[_0x41c1('0x1c5')](_0x537711))[_0x41c1('0xad')](loggerCatchPredictive(_0x41c1('0x1c8'),_0x537711));}else if(_0x537711[_0x41c1('0x1b5')]&&_0x555e57<_0x537711[_0x41c1('0x1b5')]-_0x221878){freeVariablesPredictive(_0x537711);loggerPredictive[_0x41c1('0x7c')](_0x537711['name'],_0x41c1('0x1c9'),_0x555e57,_0x41c1('0x1ca'),_0x537711[_0x41c1('0x1b5')],'-',_0x221878,'=',_0x537711['predictiveIntervalAvailable']-_0x221878,')');}else if(_0x537711[_0x41c1('0x1b5')]&&_0x555e57>_0x537711['predictiveIntervalAvailable']+_0x490872){freeVariablesPredictive(_0x537711);loggerPredictive[_0x41c1('0x7c')](_0x537711['name'],'switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',_0x555e57,_0x41c1('0x1cb'),_0x537711[_0x41c1('0x1b5')],'+',_0x490872,'=',_0x537711[_0x41c1('0x1b5')]+_0x490872,')');}};Dialer[_0x41c1('0x1b')][_0x41c1('0x1c4')]=function(_0x48d195){var _0x423ab0=this;return function(_0x17c4a3){return new BPromise(function(_0x42a744,_0x16da78){_[_0x41c1('0x8b')](_0x48d195,_0x17c4a3[0x0]);if(checkGetDataPredictive(_0x17c4a3[0x0])){var _0x3c320d=_0x48d195[_0x41c1('0x1b5')]=_0x48d195[_0x41c1('0x55')]+_0x48d195[_0x41c1('0x4f')];var _0x26992f=_0x48d195[_0x41c1('0x1bc')]*0x3c;var _0x2fdce0=_0x17c4a3[0x0]['predictiveIntervalAvgTalktime']+_0x17c4a3[0x0][_0x41c1('0x69')];var _0x1188ad=(_0x17c4a3[0x0][_0x41c1('0x68')]+_0x17c4a3[0x0][_0x41c1('0x6c')]+_0x17c4a3[0x0][_0x41c1('0x6b')])/_0x17c4a3[0x0]['predictiveIntervalTotalCalls'];_0x48d195[_0x41c1('0x6f')]=_0x1188ad>0x0?_0x1188ad:0x1;switch(_0x48d195[_0x41c1('0x1bd')]){case _0x41c1('0x1be'):var _0x3daed8=_0x48d195[_0x41c1('0x1b3')]/0x64;return _0x423ab0[_0x41c1('0x1cc')](_0x3c320d,_0x26992f,_0x2fdce0,_0x1188ad,_0x3daed8)[_0x41c1('0xb6')](function(_0x325c){return _0x42a744(_0x325c);});case _0x41c1('0x1cd'):var _0x27b8d5=_0x48d195[_0x41c1('0x1b3')]/0x64;return _0x423ab0[_0x41c1('0x1ce')](_0x3c320d,_0x26992f,_0x2fdce0,_0x1188ad,_0x27b8d5)['then'](function(_0xd3a84e){return _0x42a744(_0xd3a84e);});default:return _0x16da78(msgResponse(_0x41c1('0x1cf'),_0x41c1('0x12d'),_0x41c1('0x1d0')));}}else{return _0x16da78(msgResponse('[getDataPredictive]',_0x41c1('0x12d'),'check\x20failure'));}});};};Dialer[_0x41c1('0x1b')]['getDataPredictiveOld']=function(_0x479212){var _0x946023=this;return function(_0x38892a){return new BPromise(function(_0x5a51bd,_0x370b2e){_[_0x41c1('0x8b')](_0x479212,_0x38892a[0x0]);if(checkGetDataPredictive(_0x38892a[0x0])){loggerPredictive[_0x41c1('0x7c')](JSON[_0x41c1('0x47')](_0x38892a[0x0]));if(_0x479212[_0x41c1('0x1bd')]==='dropRate'){return _0x946023[_0x41c1('0xc2')](_0x479212['id'])[_0x41c1('0xb6')](function(_0x2508d4){var _0xb462ed=_0x479212[_0x41c1('0x50')]-_0x2508d4[0x0][_0x41c1('0x1d1')];var _0x3bfb84=_0x479212[_0x41c1('0x1bc')]*0x3c;var _0x39faed=_0x38892a[0x0][_0x41c1('0x6a')]+_0x38892a[0x0]['predictiveIntervalAvgHoldtime'];var _0x50f6ad=(_0x38892a[0x0][_0x41c1('0x68')]+_0x38892a[0x0][_0x41c1('0x6c')]+_0x38892a[0x0][_0x41c1('0x6b')])/_0x38892a[0x0][_0x41c1('0x7f')];var _0x15100e=_0x479212[_0x41c1('0x1b3')]/0x64;_0x479212[_0x41c1('0x71')]=_0x2508d4[0x0][_0x41c1('0x1d1')]||0x0;_0x479212['predictiveIntervalHitRate']=_0x50f6ad>0x0?_0x50f6ad:0x1;return _0x946023[_0x41c1('0x1cc')](_0xb462ed,_0x3bfb84,_0x39faed,_0x50f6ad,_0x15100e);})['then'](function(_0x36ae24){return _0x5a51bd(_0x36ae24);})['catch'](function(_0xfaa66b){return _0x370b2e(msgResponse(_0x41c1('0x1d2'),_0x41c1('0x12d'),JSON[_0x41c1('0x47')](_0xfaa66b)));});}if(_0x479212[_0x41c1('0x1bd')]===_0x41c1('0x1cd')){return _0x946023[_0x41c1('0xc2')](_0x479212['id'])[_0x41c1('0xb6')](function(_0x4c22d8){var _0x2bf1e5=_0x479212[_0x41c1('0x50')]-_0x4c22d8[0x0][_0x41c1('0x1d1')];var _0x274bf3=_0x479212[_0x41c1('0x1bc')]*0x3c;var _0x12c4b7=_0x38892a[0x0]['predictiveIntervalAvgTalktime']+_0x38892a[0x0][_0x41c1('0x69')];var _0x396a60=(_0x38892a[0x0][_0x41c1('0x68')]+_0x38892a[0x0][_0x41c1('0x6c')]+_0x38892a[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x38892a[0x0][_0x41c1('0x7f')];var _0x2f5592=_0x479212[_0x41c1('0x1b3')]/0x64;_0x479212[_0x41c1('0x71')]=_0x4c22d8[0x0]['outboundQueuePauses']||0x0;_0x479212['predictiveIntervalHitRate']=_0x396a60>0x0?_0x396a60:0x1;return _0x946023[_0x41c1('0x1ce')](_0x2bf1e5,_0x274bf3,_0x12c4b7,_0x396a60,_0x2f5592);})[_0x41c1('0xb6')](function(_0x290d0a){return _0x5a51bd(_0x290d0a);})['catch'](function(_0x5bf778){return _0x370b2e(msgResponse(_0x41c1('0x1d2'),_0x41c1('0x12d'),JSON[_0x41c1('0x47')](_0x5bf778)));});}}else{return _0x370b2e(msgResponse(_0x41c1('0x1cf'),_0x41c1('0x12d'),_0x41c1('0x1d3')));}});};};Dialer[_0x41c1('0x1b')]['startMethodPredictive']=function(_0x2afa48){var _0x450340=this;return function(){var _0x4512ee=0x0;var _0x3a3269=Math[_0x41c1('0x1b8')](_0x2afa48['erlangCallToSecond']*0x3e8);if(_0x3a3269>0x0){_0x3a3269=_0x3a3269<0x64?0x64:_0x3a3269;loggerPredictive[_0x41c1('0x7c')](_0x2afa48[_0x41c1('0x40')],_0x41c1('0x1d4'),_0x3a3269,_0x41c1('0x48'));_0x2afa48[_0x41c1('0x8e')]=setInterval(function(){_0x450340[_0x41c1('0x8e')](_0x2afa48);loggerPredictiveCalls[_0x41c1('0x7c')](_0x41c1('0x1d5'),_0x4512ee+=0x1);},_0x3a3269);}else{loggerPredictive[_0x41c1('0x7c')](_0x2afa48['name'],_0x41c1('0x1d6'));}};};Dialer[_0x41c1('0x1b')]['checkContactBlack']=function(_0x598800,_0x571078){var _0x3dd4d9=this;return function(_0x50ec77){if(_['isEmpty'](_0x50ec77)){if(_[_0x41c1('0xd5')](_0x571078['UserId'])||!_0x571078['recallme']){if(_0x598800[_0x41c1('0x5a')]==='booked'){_0x598800[_0x41c1('0x116')]=_[_0x41c1('0x84')](_0x598800[_0x41c1('0x116')])?!![]:_0x598800['queueStatusComplete'];var _0x592092=uuid['v4']();_0x3dd4d9[_0x41c1('0xa9')][_0x592092]=new Action(_0x598800,_0x571078,_0x592092);loggerBooked[_0x41c1('0x7c')](_0x41c1('0x1d7'),_0x592092,_0x41c1('0x1d8'),JSON['stringify'](_0x598800['queueStatusComplete']),_0x41c1('0x1d9'),_0x598800['name']);if(_0x598800[_0x41c1('0x116')]){_0x598800[_0x41c1('0x116')]=![];_0x3dd4d9[_0x41c1('0x2c')][_0x3dd4d9[_0x41c1('0xa9')][_0x592092]['queue']]=[];ami[_0x41c1('0x131')]({'actionid':_0x592092,'action':_0x41c1('0x1da'),'queue':_0x598800[_0x41c1('0x40')]})[_0x41c1('0xad')](function(_0x22baee){_0x3dd4d9['updateOriginated'](_0x598800);_0x3dd4d9[_0x41c1('0xbc')]({'active':![],'ContactId':_0x3dd4d9[_0x41c1('0xa9')][_0x592092]['ContactId'],'ListId':_0x3dd4d9['actions'][_0x592092][_0x41c1('0x109')],'VoiceQueueId':_0x3dd4d9[_0x41c1('0xa9')][_0x592092][_0x41c1('0xcc')]||undefined,'CampaignId':_0x3dd4d9['actions'][_0x592092][_0x41c1('0xcd')]||undefined})['catch'](loggerCatch(_0x41c1('0x1db')));delete _0x3dd4d9[_0x41c1('0xa9')][_0x592092];});}else{loggerBooked[_0x41c1('0x7c')](_0x41c1('0x1dc'),JSON[_0x41c1('0x47')](_0x598800[_0x41c1('0x116')]),_0x41c1('0x1d9'),_0x598800[_0x41c1('0x40')]);_0x3dd4d9[_0x41c1('0xae')](_0x598800);_0x3dd4d9[_0x41c1('0xbc')]({'active':![],'ContactId':_0x3dd4d9['actions'][_0x592092][_0x41c1('0x108')],'ListId':_0x3dd4d9['actions'][_0x592092][_0x41c1('0x109')],'VoiceQueueId':_0x3dd4d9[_0x41c1('0xa9')][_0x592092][_0x41c1('0xcc')]||undefined,'CampaignId':_0x3dd4d9[_0x41c1('0xa9')][_0x592092][_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x3dd4d9[_0x41c1('0xa9')][_0x592092];}}else{return _0x3dd4d9[_0x41c1('0x14d')](_0x598800,_0x571078);}}else{if(getDiff(_0x571078[_0x41c1('0x1dd')])<_0x598800[_0x41c1('0x1de')]*0x3c){if(_0x571078[_0x41c1('0x1df')]&&!_0x571078[_0x41c1('0x1df')]['voicePause']){_0x3dd4d9['preview'][_0x41c1('0x1e0')](_0x571078['id'])[_0x41c1('0x1e')](function(){_0x3dd4d9[_0x41c1('0xae')](_0x598800);});}else{_0x3dd4d9[_0x41c1('0xbe')]({'active':![]},_0x571078['id'],0x1)[_0x41c1('0x1e')](function(){console[_0x41c1('0x1e1')]('Contact\x20updated');_0x3dd4d9['updateOriginated'](_0x598800);});}}else{_0x598800['outboundReCallsDay']+=0x1;_0x3dd4d9[_0x41c1('0xae')](_0x598800);if(_0x598800['dialRecallInQueue']){_0x3dd4d9[_0x41c1('0xbc')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x571078[_0x41c1('0x108')],'ListId':_0x571078['ListId'],'VoiceQueueId':_0x571078[_0x41c1('0xcc')]||undefined,'CampaignId':_0x571078[_0x41c1('0xcd')]||undefined})[_0x41c1('0xad')](loggerCatch(_0x41c1('0x1e2')));_0x3dd4d9['createHistory'](createObjHistory(_0x598800,_0x571078,_0x41c1('0x1e3'),0x17,_0x41c1('0x1e4')))[_0x41c1('0xad')](loggerCatch(_0x41c1('0x1e5')));}else{_0x3dd4d9[_0x41c1('0xca')](createObjHistory(_0x598800,_0x571078,_0x41c1('0x1e6'),0x16,'RecallFailedTimeout'),_0x41c1('0x1e7'),_0x41c1('0x1e8'));}}}}else{_0x598800[_0x41c1('0x5f')]+=0x1;_0x3dd4d9[_0x41c1('0xca')](createObjHistory(_0x598800,_0x571078,'BLACKLIST',0xd,'Blacklist'),_0x41c1('0x1e9'),_0x41c1('0x1ea'));throw _0x41c1('0x1eb');}};};Dialer[_0x41c1('0x1b')]['handleIvr']=function(_0x14b072){var _0x33b3c3=this;var _0x2286b6=[];var _0x442f9d=_0x14b072[_0x41c1('0x1ec')]-_0x14b072[_0x41c1('0x72')]-_0x14b072[_0x41c1('0x1ed')];emitCampaignSummary(_0x14b072);if(_0x442f9d>0x0){if(_0x442f9d>this['maxNumberOriginate']){_0x442f9d=this['maxNumberOriginate'];}_0x14b072['temp']+=_0x442f9d;this[_0x41c1('0x1ee')](_0x14b072['id'],_0x442f9d,_0x14b072[_0x41c1('0x1ef')])['then'](function(_0x1b4bca){_0x14b072['temp']-=_0x442f9d;_0x14b072['temp']=_0x14b072['temp']>0x0?_0x14b072[_0x41c1('0x1ed')]:0x0;if(!checkContactEmpty(_0x1b4bca)){_0x14b072[_0x41c1('0x3e')]=_0x41c1('0x1f0');logger[_0x41c1('0x7c')]('[getContactCampaign2][Empty]'+_0x14b072[_0x41c1('0x40')]);}else{_0x14b072[_0x41c1('0x72')]+=_0x1b4bca['length'];_0x14b072[_0x41c1('0x3e')]='RUNNING';for(var _0x27328c=0x0;_0x27328c<_0x1b4bca[_0x41c1('0x98')];_0x27328c+=0x1){_0x14b072[_0x41c1('0x1f1')]+=0x1;if(_[_0x41c1('0xd5')](_0x1b4bca[_0x27328c])||_[_0x41c1('0xd5')](_0x1b4bca[_0x27328c][_0x41c1('0x151')])||_[_0x41c1('0xd5')](_0x1b4bca[_0x27328c][_0x41c1('0x151')]['phone'])){_0x33b3c3[_0x41c1('0x1f2')]('[actionOriginate]\x20',_0x14b072,_0x1b4bca[_0x27328c]);}else{_0x33b3c3[_0x41c1('0xb8')](_[_0x41c1('0xcb')](_0x1b4bca[_0x27328c],[_0x41c1('0xcd'),_0x41c1('0x1f3')]))[_0x41c1('0xb6')](_0x33b3c3[_0x41c1('0x1f4')](_0x14b072,_0x1b4bca[_0x27328c]))[_0x41c1('0xad')](_0x33b3c3['loggerHandler'](_0x41c1('0x1f5'),_0x14b072));}}}})[_0x41c1('0xad')](loggerGetContactDialer('[getContactCampaign2]',_0x14b072,_0x442f9d));}};Dialer[_0x41c1('0x1b')][_0x41c1('0x140')]=function(_0xe802e9,_0x4f412f){var _0x132688=this;var _0x447aaa=[];var _0x1c5ba5=_0x4f412f>=0x1?_0x4f412f:0x1;var _0x341bda=[];if(_0xe802e9['dialMethod']===_0x41c1('0x142')){_0x1c5ba5=0x1;}var _0x35c147=Math[_0x41c1('0x1b8')](_0xe802e9[_0x41c1('0x4f')]*_0x1c5ba5)-_0xe802e9[_0x41c1('0x72')]-_0xe802e9[_0x41c1('0x1ed')];emitVoiceQueueSummary(_0xe802e9);if(_0xe802e9['dialLimitQueue']>0x0){var _0x5fa88c=_0xe802e9['dialLimitQueue']-_0xe802e9[_0x41c1('0x72')]-_0xe802e9['talking']-_0xe802e9[_0x41c1('0x1ed')]-_0xe802e9[_0x41c1('0x51')];if(_0x35c147>_0x5fa88c){_0x35c147=_0x5fa88c;}}if(_0x35c147>0x0){if(_0xe802e9[_0x41c1('0x5a')]===_0x41c1('0x142')){_0x35c147=0x1;}if(_0x35c147>this['maxNumberOriginate']){_0x35c147=this[_0x41c1('0x24')];}_0xe802e9[_0x41c1('0x1ed')]+=_0x35c147;for(var _0x79b03c in this['agents']){if(this[_0x41c1('0x22')][_0x41c1('0x99')](_0x79b03c)){if(this['agents'][_0x79b03c][_0x41c1('0xdb')]===_0x41c1('0x1f6')&&this[_0x41c1('0x22')][_0x79b03c][_0x41c1('0xd3')]===_0x41c1('0x1f7')){_0x447aaa[_0x41c1('0x114')](this[_0x41c1('0x22')][_0x79b03c]['id']);}}}this[_0x41c1('0xc0')](_0xe802e9['id'],_0x447aaa,_0x35c147,_0xe802e9[_0x41c1('0x1ef')])[_0x41c1('0xb6')](function(_0x1cc8f3){_0xe802e9['temp']-=_0x35c147;_0xe802e9[_0x41c1('0x1ed')]=_0xe802e9[_0x41c1('0x1ed')]>0x0?_0xe802e9[_0x41c1('0x1ed')]:0x0;if(!checkContactEmpty(_0x1cc8f3)){_0x132688['countReScheduled'](_0xe802e9)['then'](sendMessageReschedule(_0xe802e9))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xb4')));}else{_0xe802e9['originated']+=_0x1cc8f3[_0x41c1('0x98')];_0xe802e9[_0x41c1('0x3e')]=_0xe802e9[_0x41c1('0x5a')]===_0x41c1('0x142')?_0x41c1('0x15a'):'RUNNING';for(var _0x57c201=0x0;_0x57c201<_0x1cc8f3[_0x41c1('0x98')];_0x57c201+=0x1){if(_[_0x41c1('0xd5')](_0x1cc8f3[_0x57c201])||_[_0x41c1('0xd5')](_0x1cc8f3[_0x57c201][_0x41c1('0x151')])||_[_0x41c1('0xd5')](_0x1cc8f3[_0x57c201]['Contact']['phone'])){_0x132688[_0x41c1('0x1f2')](_0x41c1('0x1f8'),_0xe802e9,_0x1cc8f3[_0x57c201]);}else{_0x132688[_0x41c1('0xb5')](_['pick'](_0x1cc8f3[_0x57c201],[_0x41c1('0xcc'),_0x41c1('0x1f3')]))[_0x41c1('0xb6')](_0x132688[_0x41c1('0x1f4')](_0xe802e9,_0x1cc8f3[_0x57c201]))[_0x41c1('0xad')](_0x132688[_0x41c1('0xc8')](_0x41c1('0x1f8'),_0xe802e9));}}}})[_0x41c1('0xad')](loggerGetContactDialer(_0x41c1('0x1f9'),_0xe802e9,_0x35c147));}};Dialer[_0x41c1('0x1b')][_0x41c1('0x8e')]=function(_0x22efff){var _0x1d87cc=this;if(_0x22efff[_0x41c1('0x1fa')]>0x0){var _0x4dfb66=_0x22efff[_0x41c1('0x1fa')]-_0x22efff['originated']-_0x22efff['talking'];if(_0x4dfb66>0x0){this[_0x41c1('0x1fb')](_0x22efff);}else{loggerPredictiveCalls[_0x41c1('0x7c')](_0x41c1('0x1fc'));}}else{this['tryOriginatePredictive'](_0x22efff);}};Dialer[_0x41c1('0x1b')][_0x41c1('0x1fb')]=function(_0x18eea7){var _0x30b7e1=this;var _0x1681e8=[];_0x18eea7[_0x41c1('0x72')]+=0x1;for(var _0x5acc9b in this[_0x41c1('0x22')]){if(this['agents'][_0x41c1('0x99')](_0x5acc9b)){if(this[_0x41c1('0x22')][_0x5acc9b][_0x41c1('0xdb')]===_0x41c1('0x1f6')&&this[_0x41c1('0x22')][_0x5acc9b][_0x41c1('0xd3')]===_0x41c1('0x1f7')){_0x1681e8['push'](this[_0x41c1('0x22')][_0x5acc9b]['id']);}}}this[_0x41c1('0xc0')](_0x18eea7['id'],_0x1681e8,0x1,_0x18eea7[_0x41c1('0x1ef')])[_0x41c1('0xb6')](function(_0x171ab8){if(!checkContactEmpty(_0x171ab8)){checkContactLowerLimitOriginate(_0x18eea7,0x1,0x0);_0x30b7e1[_0x41c1('0xb2')](_0x18eea7)[_0x41c1('0xb6')](sendMessageReschedule(_0x18eea7))[_0x41c1('0xad')](loggerCatch(_0x41c1('0xb4')));}else{_0x18eea7[_0x41c1('0x3e')]='RUNNING';if(_[_0x41c1('0xd5')](_0x171ab8[0x0])||_[_0x41c1('0xd5')](_0x171ab8[0x0][_0x41c1('0x151')])||_[_0x41c1('0xd5')](_0x171ab8[0x0][_0x41c1('0x151')][_0x41c1('0x150')])){_0x30b7e1[_0x41c1('0x1f2')]('[actionOriginate]\x20',_0x18eea7,_0x171ab8[0x0]);}else{_0x30b7e1['checkIsBlackList'](_[_0x41c1('0xcb')](_0x171ab8[0x0],[_0x41c1('0xcc'),'Contact.phone']))[_0x41c1('0xb6')](_0x30b7e1[_0x41c1('0x1f4')](_0x18eea7,_0x171ab8[0x0]))[_0x41c1('0xad')](_0x30b7e1[_0x41c1('0xc8')](_0x41c1('0x1fd'),_0x18eea7));}}})[_0x41c1('0xad')](loggerGetContactDialer(_0x41c1('0x1fe'),_0x18eea7,0x1));emitVoiceQueueSummary(_0x18eea7);};Dialer[_0x41c1('0x1b')][_0x41c1('0x1cc')]=function(_0x1fc8ac,_0x1c2658,_0x946b62,_0x589c2b,_0x5902f3,_0x68f442){loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x1ff'));loggerPredictive['info'](_0x41c1('0x200'),_0x1fc8ac);loggerPredictive['info'](_0x41c1('0x201'),_0x1c2658);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x202'),_0x946b62);loggerPredictive[_0x41c1('0x7c')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x589c2b);loggerPredictive['info']('Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5902f3);loggerPredictive[_0x41c1('0x7c')]('---------------------------');return new BPromise(function(_0x2b4f2e,_0x54fb9f){if(_0x1fc8ac<=0x0||isNaN(_0x1fc8ac)){return _0x54fb9f(msgResponse(_0x41c1('0x203'),_0x41c1('0x46'),_0x41c1('0x204')+_0x1fc8ac));}if(_0x946b62<=0x0||isNaN(_0x946b62)){return _0x54fb9f(msgResponse('[abandonmentRate]',_0x41c1('0x46'),'Ts\x20=\x20'+_0x946b62));}if(_0x589c2b<=0x0||isNaN(_0x589c2b)){return _0x54fb9f(msgResponse('[abandonmentRate]','Error',_0x41c1('0x205')+_0x589c2b));}if(_0x1c2658<=0x0||isNaN(_0x1c2658)){return _0x54fb9f(msgResponse(_0x41c1('0x203'),_0x41c1('0x46'),'interval\x20=\x20'+_0x1c2658));}if(_0x5902f3<=0x0||isNaN(_0x5902f3)){return _0x54fb9f(msgResponse(_0x41c1('0x203'),_0x41c1('0x46'),_0x41c1('0x206')+_0x5902f3));}_0x68f442=_0x68f442||0x0;var _0x31c054=0x1/_0x946b62;var _0x233b4c=0x0;var _0x4b478d=0x0;var _0xb50c2a=0x0;var _0x48f26d=0x0;for(var _0x5cd892=0x0;_0xb50c2a<_0x5902f3;_0x5cd892+=0x1){_0x4b478d=_0x5cd892/_0x1c2658;_0x233b4c=(_0x589c2b*_0x4b478d+_0x68f442)/_0x31c054;_0xb50c2a=erlangb(_0x233b4c,_0x1fc8ac);_0x48f26d=_0x233b4c/_0x1fc8ac*(0x1-erlangb(_0x233b4c,_0x1fc8ac));}return _0x2b4f2e({'erlangCalls':_0x5cd892,'erlangCallToSecond':_0x1c2658/_0x5cd892,'erlangAbandonmentRate':_0xb50c2a,'erlangBusyFactor':_0x48f26d});});};Dialer[_0x41c1('0x1b')][_0x41c1('0x1ce')]=function(_0x4768ad,_0x4f20e4,_0x3fbd20,_0x5e8ac4,_0x5d457e,_0x1358df){loggerPredictive['info'](_0x41c1('0x207'));loggerPredictive['info'](_0x41c1('0x200'),_0x4768ad);loggerPredictive['info'](_0x41c1('0x201'),_0x4f20e4);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x202'),_0x3fbd20);loggerPredictive[_0x41c1('0x7c')]('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5e8ac4);loggerPredictive[_0x41c1('0x7c')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x5d457e);loggerPredictive[_0x41c1('0x7c')](_0x41c1('0x83'));return new BPromise(function(_0x282b6a,_0x5a0386){if(_0x4768ad<=0x0||isNaN(_0x4768ad)){return _0x5a0386(msgResponse(_0x41c1('0x208'),_0x41c1('0x46'),_0x41c1('0x204')+_0x4768ad));}if(_0x3fbd20<=0x0||isNaN(_0x3fbd20)){return _0x5a0386(msgResponse(_0x41c1('0x208'),'Error','Ts\x20=\x20'+_0x3fbd20));}if(_0x5e8ac4<=0x0||isNaN(_0x5e8ac4)){return _0x5a0386(msgResponse(_0x41c1('0x208'),_0x41c1('0x46'),_0x41c1('0x205')+_0x5e8ac4));}if(_0x4f20e4<=0x0||isNaN(_0x4f20e4)){return _0x5a0386(msgResponse(_0x41c1('0x208'),_0x41c1('0x46'),'interval\x20=\x20'+_0x4f20e4));}if(_0x5d457e<=0x0||isNaN(_0x5d457e)){return _0x5a0386(msgResponse(_0x41c1('0x208'),_0x41c1('0x46'),_0x41c1('0x209')+_0x5d457e));}_0x1358df=_0x1358df||0x0;var _0x407e93=0x1/_0x3fbd20;var _0x19eb41=0x0;var _0x3850d1=0x0;var _0x55b97a=0x0;var _0x213f79=0x0;for(var _0x2cc383=0x0;_0x213f79<_0x5d457e;_0x2cc383+=0x1){_0x3850d1=_0x2cc383/_0x4f20e4;_0x19eb41=(_0x5e8ac4*_0x3850d1+_0x1358df)/_0x407e93;_0x55b97a=erlangb(_0x19eb41,_0x4768ad);_0x213f79=_0x19eb41/_0x4768ad*(0x1-erlangb(_0x19eb41,_0x4768ad));}return _0x282b6a({'erlangCalls':_0x2cc383,'erlangCallToSecond':_0x4f20e4/_0x2cc383,'erlangAbandonmentRate':_0x55b97a,'erlangBusyFactor':_0x213f79});});};module[_0x41c1('0x20a')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index ff5ac86..74c7f78 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 _0xf507=['diff','scheduledat','type','queue','countbusyretry','countcongestionretry','countglobal','countnoanswerretry','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','uniqueid','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','lodash','moment','milliseconds'];(function(_0x255d5b,_0x4f6f35){var _0x3e141a=function(_0x249ee2){while(--_0x249ee2){_0x255d5b['push'](_0x255d5b['shift']());}};_0x3e141a(++_0x4f6f35);}(_0xf507,0x8d));var _0x7f50=function(_0x499ca5,_0x4986cf){_0x499ca5=_0x499ca5-0x0;var _0x7bfd9c=_0xf507[_0x499ca5];return _0x7bfd9c;};'use strict';var util=require('util');var _=require(_0x7f50('0x0'));var moment=require(_0x7f50('0x1'));function getSeconds(_0x2a493d,_0x3ced77){var _0x59d90f=moment(_0x2a493d)[_0x7f50('0x2')](0x0);var _0x3a7e54=moment(_0x3ced77)[_0x7f50('0x2')](0x0);return _0x59d90f[_0x7f50('0x3')](_0x3a7e54,'seconds');}function QueueCallerAbandon(_0xb148d8,_0x135dfc){this[_0x7f50('0x4')]=_0xb148d8[_0x7f50('0x4')];this[_0x7f50('0x5')]=_0xb148d8['type'];this['campaigntype']=_0xb148d8[_0x7f50('0x5')]==='outbound'?_0x7f50('0x6'):_0xb148d8[_0x7f50('0x5')];this[_0x7f50('0x7')]=_0xb148d8[_0x7f50('0x7')];this['countcongestionretry']=_0xb148d8[_0x7f50('0x8')];this['countnoanswerretry']=_0xb148d8['countnoanswerretry'];this[_0x7f50('0x9')]=_0xb148d8[_0x7f50('0x7')]+_0xb148d8[_0x7f50('0x8')]+_0xb148d8[_0x7f50('0xa')]+_0xb148d8[_0x7f50('0xb')]+_0xb148d8[_0x7f50('0xc')]+_0xb148d8[_0x7f50('0xd')]+_0xb148d8[_0x7f50('0xe')]+_0xb148d8[_0x7f50('0xf')];this[_0x7f50('0xb')]=_0xb148d8[_0x7f50('0xb')];this[_0x7f50('0xc')]=_0xb148d8[_0x7f50('0xc')];this[_0x7f50('0xd')]=_0xb148d8[_0x7f50('0xd')];this[_0x7f50('0xe')]=_0xb148d8[_0x7f50('0xe')];this[_0x7f50('0xf')]=_0xb148d8[_0x7f50('0xf')];this[_0x7f50('0x10')]=_0x135dfc[_0x7f50('0x10')];this['calleridname']=_0xb148d8['name'];this['calleridnum']=_0xb148d8['number'];this[_0x7f50('0x11')]=_0xb148d8[_0x7f50('0x11')];this[_0x7f50('0x12')]=_0xb148d8[_0x7f50('0x12')];this[_0x7f50('0x13')]=_0xb148d8[_0x7f50('0x13')];this[_0x7f50('0x14')]=this['droptime'];this[_0x7f50('0x15')]=getSeconds(_0xb148d8[_0x7f50('0x12')],_0xb148d8[_0x7f50('0x11')]);this[_0x7f50('0x16')]=getSeconds(this[_0x7f50('0x13')],_0xb148d8[_0x7f50('0x12')]);this[_0x7f50('0x17')]=0x0;this[_0x7f50('0x6')]=_0x135dfc[_0x7f50('0x6')];this[_0x7f50('0x18')]=_0x135dfc[_0x7f50('0x19')];this[_0x7f50('0x1a')]=_0x135dfc[_0x7f50('0x1a')];this[_0x7f50('0x1b')]=_0xb148d8['callback'];this[_0x7f50('0x1c')]=_0xb148d8['callbackuniqueid'];this[_0x7f50('0x1d')]=_0xb148d8[_0x7f50('0x1d')];this[_0x7f50('0x1e')]=_0xb148d8['recallme'];this['ContactId']=_0xb148d8['ContactId'];this['ListId']=_0xb148d8[_0x7f50('0x1f')];this[_0x7f50('0x20')]=_0xb148d8[_0x7f50('0x20')];this[_0x7f50('0x21')]=_0xb148d8[_0x7f50('0x21')];this[_0x7f50('0x22')]=_0xb148d8['CampaignId'];this[_0x7f50('0x23')]=_0xb148d8[_0x7f50('0x23')]||'';this['originatecalleridname']=_0xb148d8['originatecalleridname']||'';}module['exports']=QueueCallerAbandon; \ No newline at end of file +var _0x9612=['milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countmachineretry','countagentrejectretry','countabandonedretry','uniqueid','name','calleridnum','number','starttime','droptime','endtime','ringtime','responsetime','talktime','queue','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash'];(function(_0xe12a4d,_0x54c0ed){var _0x19f30b=function(_0x2226a6){while(--_0x2226a6){_0xe12a4d['push'](_0xe12a4d['shift']());}};_0x19f30b(++_0x54c0ed);}(_0x9612,0xd5));var _0x2961=function(_0x4bf278,_0x3bd229){_0x4bf278=_0x4bf278-0x0;var _0x34f9db=_0x9612[_0x4bf278];return _0x34f9db;};'use strict';var util=require(_0x2961('0x0'));var _=require(_0x2961('0x1'));var moment=require('moment');function getSeconds(_0x44bece,_0x4cabc4){var _0xcca08c=moment(_0x44bece)[_0x2961('0x2')](0x0);var _0x36ebe8=moment(_0x4cabc4)[_0x2961('0x2')](0x0);return _0xcca08c[_0x2961('0x3')](_0x36ebe8,_0x2961('0x4'));}function QueueCallerAbandon(_0x2a0a29,_0x13c4c9){this[_0x2961('0x5')]=_0x2a0a29[_0x2961('0x5')];this[_0x2961('0x6')]=_0x2a0a29[_0x2961('0x6')];this[_0x2961('0x7')]=_0x2a0a29[_0x2961('0x6')]===_0x2961('0x8')?'queue':_0x2a0a29[_0x2961('0x6')];this[_0x2961('0x9')]=_0x2a0a29['countbusyretry'];this[_0x2961('0xa')]=_0x2a0a29[_0x2961('0xa')];this[_0x2961('0xb')]=_0x2a0a29[_0x2961('0xb')];this[_0x2961('0xc')]=_0x2a0a29[_0x2961('0x9')]+_0x2a0a29[_0x2961('0xa')]+_0x2a0a29['countnoanswerretry']+_0x2a0a29[_0x2961('0xd')]+_0x2a0a29[_0x2961('0xe')]+_0x2a0a29['countabandonedretry']+_0x2a0a29[_0x2961('0xf')]+_0x2a0a29[_0x2961('0x10')];this[_0x2961('0xd')]=_0x2a0a29['countnosuchnumberretry'];this['countdropretry']=_0x2a0a29['countdropretry'];this['countabandonedretry']=_0x2a0a29[_0x2961('0x11')];this['countmachineretry']=_0x2a0a29[_0x2961('0xf')];this[_0x2961('0x10')]=_0x2a0a29['countagentrejectretry'];this[_0x2961('0x12')]=_0x13c4c9[_0x2961('0x12')];this['calleridname']=_0x2a0a29[_0x2961('0x13')];this[_0x2961('0x14')]=_0x2a0a29[_0x2961('0x15')];this[_0x2961('0x16')]=_0x2a0a29[_0x2961('0x16')];this['responsetime']=_0x2a0a29['responsetime'];this[_0x2961('0x17')]=_0x2a0a29[_0x2961('0x17')];this[_0x2961('0x18')]=this[_0x2961('0x17')];this[_0x2961('0x19')]=getSeconds(_0x2a0a29['responsetime'],_0x2a0a29[_0x2961('0x16')]);this['holdtime']=getSeconds(this[_0x2961('0x17')],_0x2a0a29[_0x2961('0x1a')]);this[_0x2961('0x1b')]=0x0;this['queue']=_0x13c4c9[_0x2961('0x1c')];this['membername']=_0x13c4c9[_0x2961('0x1d')];this[_0x2961('0x1e')]=_0x13c4c9[_0x2961('0x1e')];this[_0x2961('0x1f')]=_0x2a0a29[_0x2961('0x1f')];this[_0x2961('0x20')]=_0x2a0a29[_0x2961('0x20')];this['callbackat']=_0x2a0a29[_0x2961('0x21')];this[_0x2961('0x22')]=_0x2a0a29[_0x2961('0x22')];this[_0x2961('0x23')]=_0x2a0a29[_0x2961('0x23')];this[_0x2961('0x24')]=_0x2a0a29['ListId'];this[_0x2961('0x25')]=_0x2a0a29[_0x2961('0x25')];this[_0x2961('0x26')]=_0x2a0a29['VoiceQueueId'];this[_0x2961('0x27')]=_0x2a0a29['CampaignId'];this[_0x2961('0x28')]=_0x2a0a29[_0x2961('0x28')]||'';this['originatecalleridname']=_0x2a0a29[_0x2961('0x29')]||'';}module[_0x2961('0x2a')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index cc93b7d..00fefa2 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 _0xc382=['lodash','moment','channel','format','%s/%s/%s','tech','Trunk','name','localstationid','headerinfo','path','AttachmentId','exports','util'];(function(_0x5192de,_0x4e91cd){var _0x4e287e=function(_0x3639bc){while(--_0x3639bc){_0x5192de['push'](_0x5192de['shift']());}};_0x4e287e(++_0x4e91cd);}(_0xc382,0x6f));var _0x2c38=function(_0x5a4a1e,_0x5f014c){_0x5a4a1e=_0x5a4a1e-0x0;var _0x13b91d=_0xc382[_0x5a4a1e];return _0x13b91d;};'use strict';var util=require(_0x2c38('0x0'));var _=require(_0x2c38('0x1'));var moment=require(_0x2c38('0x2'));function Action(_0x4da43e,_0x3e6695,_0x2cfcd1){this['uniqueid']=_0x4da43e||undefined;this[_0x2c38('0x3')]=util[_0x2c38('0x4')](_0x2c38('0x5'),_0x3e6695[_0x2c38('0x6')],_0x3e6695[_0x2c38('0x7')][_0x2c38('0x8')],_0x2cfcd1['fax']);this[_0x2c38('0x9')]=_0x3e6695[_0x2c38('0x9')];this[_0x2c38('0xa')]=_0x3e6695[_0x2c38('0xa')];this['path']=_0x2cfcd1[_0x2c38('0xb')];this['AttachmentId']=_0x2cfcd1[_0x2c38('0xc')];}module[_0x2c38('0xd')]=Action; \ No newline at end of file +var _0x7477=['fax','headerinfo','path','AttachmentId','util','lodash','moment','uniqueid','channel','format','%s/%s/%s','tech','Trunk','name'];(function(_0x29d623,_0x1a5c9c){var _0x242e59=function(_0x2c78ab){while(--_0x2c78ab){_0x29d623['push'](_0x29d623['shift']());}};_0x242e59(++_0x1a5c9c);}(_0x7477,0xd6));var _0x7747=function(_0x129f74,_0x3d64d8){_0x129f74=_0x129f74-0x0;var _0x1cf683=_0x7477[_0x129f74];return _0x1cf683;};'use strict';var util=require(_0x7747('0x0'));var _=require(_0x7747('0x1'));var moment=require(_0x7747('0x2'));function Action(_0x480103,_0x1b5752,_0x217cb1){this[_0x7747('0x3')]=_0x480103||undefined;this[_0x7747('0x4')]=util[_0x7747('0x5')](_0x7747('0x6'),_0x1b5752[_0x7747('0x7')],_0x1b5752[_0x7747('0x8')][_0x7747('0x9')],_0x217cb1[_0x7747('0xa')]);this['localstationid']=_0x1b5752['localstationid'];this[_0x7747('0xb')]=_0x1b5752[_0x7747('0xb')];this[_0x7747('0xc')]=_0x217cb1[_0x7747('0xc')];this[_0x7747('0xd')]=_0x217cb1['AttachmentId'];}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 3ec6e0e..e75c9fe 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 _0x5043=['Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','fax','../ami','./util/util','./action','../rpc/faxAccount','../rpc/attachment','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','hasOwnProperty','exten','localstationid','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','value','channelstate','channelstatedesc','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','message','.pdf','application/pdf','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','reason','AttachmentId','SENDING\x20FAILED\x20','logger','catch','updateStatus','update','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','then','Fax\x20received','[Fax][execOriginate][failure]','checkAfterSend','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','parse','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','checkTrunk','[Fax][checkTrunk][Trunk\x20not\x20work]','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20path'];(function(_0x5d3dc5,_0x1c0c49){var _0x25da2a=function(_0x52d480){while(--_0x52d480){_0x5d3dc5['push'](_0x5d3dc5['shift']());}};_0x25da2a(++_0x1c0c49);}(_0x5043,0x152));var _0x3504=function(_0x2f07a3,_0x61616e){_0x2f07a3=_0x2f07a3-0x0;var _0x3db9b4=_0x5043[_0x2f07a3];return _0x3db9b4;};'use strict';var util=require(_0x3504('0x0'));var _=require(_0x3504('0x1'));var BPromise=require(_0x3504('0x2'));var uuid=require(_0x3504('0x3'));var moment=require('moment');var path=require(_0x3504('0x4'));var tiff2pdf=require(_0x3504('0x5'));var gs=require(_0x3504('0x6'));var logger=require('../../../config/logger')(_0x3504('0x7'));var ami=require(_0x3504('0x8'));var rpcDb=require('./rpcDb');var Channel=require('./channel');var ut=require(_0x3504('0x9'));var Action=require(_0x3504('0xa'));var faxAccount=require(_0x3504('0xb'));var attachment=require(_0x3504('0xc'));var faxMessage=require('../rpc/faxMessage');function Fax(_0x185899){this[_0x3504('0xd')]={};this[_0x3504('0xe')]=_0x185899[_0x3504('0xe')];this[_0x3504('0xf')]=_0x185899['trunks'];this[_0x3504('0x10')]={};ami['on'](_0x3504('0x11'),this[_0x3504('0x12')][_0x3504('0x13')](this));ami['on'](_0x3504('0x14'),this[_0x3504('0x15')][_0x3504('0x13')](this));ami['on'](_0x3504('0x16'),this[_0x3504('0x17')][_0x3504('0x13')](this));ami['on'](_0x3504('0x18'),this[_0x3504('0x19')]['bind'](this));ami['on'](_0x3504('0x1a'),this[_0x3504('0x1b')]['bind'](this));ami['on'](_0x3504('0x1c'),this[_0x3504('0x1d')][_0x3504('0x13')](this));ami['on'](_0x3504('0x1e'),this[_0x3504('0x1f')][_0x3504('0x13')](this));ami['on'](_0x3504('0x20'),this[_0x3504('0x21')]['bind'](this));}Fax[_0x3504('0x22')]['syncNewchannel']=function(_0x35b8ef){if(_0x35b8ef[_0x3504('0x23')]==='from-voip-provider'){for(var _0x35f119 in this[_0x3504('0xe')]){if(this['faxAccounts'][_0x3504('0x24')](_0x35f119)){if(_0x35b8ef[_0x3504('0x25')]===this[_0x3504('0xe')][_0x35f119][_0x3504('0x26')]){this[_0x3504('0xd')][_0x35b8ef[_0x3504('0x27')]]={};this['channels'][_0x35b8ef[_0x3504('0x27')]]['channel']=_0x35b8ef['channel'];this[_0x3504('0xd')][_0x35b8ef[_0x3504('0x27')]]['id']=this[_0x3504('0xe')][_0x35f119]['id'];this[_0x3504('0xd')][_0x35b8ef[_0x3504('0x27')]][_0x3504('0x28')]=this[_0x3504('0xe')][_0x35f119][_0x3504('0x28')];logger[_0x3504('0x29')](_0x35b8ef[_0x3504('0x27')],_0x3504('0x2a'));}}}}if(this[_0x3504('0x10')][_0x35b8ef[_0x3504('0x27')]]){this[_0x3504('0xd')][_0x35b8ef[_0x3504('0x27')]]={};this[_0x3504('0xd')][_0x35b8ef['uniqueid']][_0x3504('0x2b')]=_0x35b8ef[_0x3504('0x2b')];logger[_0x3504('0x29')](_0x35b8ef[_0x3504('0x27')],_0x3504('0x2a'));}};Fax[_0x3504('0x22')][_0x3504('0x15')]=function(_0x4a47eb){if(this[_0x3504('0xd')][_0x4a47eb['uniqueid']]){for(var _0x310cf4 in _0x4a47eb['variable']){if(_0x4a47eb[_0x3504('0x2c')][_0x3504('0x24')](_0x310cf4)){this[_0x3504('0xd')][_0x4a47eb[_0x3504('0x27')]][_0x310cf4]=_0x4a47eb[_0x3504('0x2d')];}}}};Fax['prototype'][_0x3504('0x17')]=function(_0x19fa22){if(this[_0x3504('0xd')][_0x19fa22[_0x3504('0x27')]]){this[_0x3504('0xd')][_0x19fa22[_0x3504('0x27')]][_0x3504('0x2e')]=_0x19fa22[_0x3504('0x2e')];this[_0x3504('0xd')][_0x19fa22['uniqueid']][_0x3504('0x2f')]=_0x19fa22[_0x3504('0x2f')];}};Fax[_0x3504('0x22')]['syncNewExten']=function(_0x23b3a6){if(this[_0x3504('0xd')][_0x23b3a6['uniqueid']]){for(var _0x236ff7 in _0x23b3a6[_0x3504('0x2c')]){if(_0x23b3a6[_0x3504('0x2c')][_0x3504('0x24')](_0x236ff7)){this[_0x3504('0xd')][_0x23b3a6[_0x3504('0x27')]][_0x236ff7]=_0x23b3a6[_0x3504('0x2d')];}}}};Fax[_0x3504('0x22')][_0x3504('0x1b')]=function(_0x3d74f4){if(this[_0x3504('0xd')][_0x3d74f4['uniqueid']]){this[_0x3504('0xd')][_0x3d74f4[_0x3504('0x27')]][_0x3504('0x30')]=_0x3d74f4[_0x3504('0x30')];this[_0x3504('0xd')][_0x3d74f4[_0x3504('0x27')]][_0x3504('0x31')]=_0x3d74f4[_0x3504('0x31')];this[_0x3504('0xd')][_0x3d74f4[_0x3504('0x27')]]['localstationid']=_0x3d74f4[_0x3504('0x26')];this[_0x3504('0xd')][_0x3d74f4['uniqueid']][_0x3504('0x32')]=_0x3d74f4[_0x3504('0x32')];logger[_0x3504('0x29')](_0x3d74f4[_0x3504('0x27')],_0x3504('0x33'));}};Fax[_0x3504('0x22')][_0x3504('0x1d')]=function(_0x588a37){var _0x58f11d=this;if(this['channels'][_0x588a37['uniqueid']]){var _0x5082b2=this['channels'][_0x588a37[_0x3504('0x27')]]['id'];this[_0x3504('0xd')][_0x588a37['uniqueid']]['remotestationid']=_0x588a37[_0x3504('0x34')];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]][_0x3504('0x35')]=_0x588a37[_0x3504('0x35')];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]][_0x3504('0x26')]=_0x588a37[_0x3504('0x26')];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]][_0x3504('0x36')]=_0x588a37[_0x3504('0x36')];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]][_0x3504('0x37')]=_0x588a37['transferrate'];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]]['filename']=_0x588a37[_0x3504('0x32')];this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]]['calleridnum']=_0x588a37[_0x3504('0x38')];if(this[_0x3504('0xd')][_0x588a37[_0x3504('0x27')]][_0x3504('0x35')]>0x0){tiff2pdf(_0x588a37[_0x3504('0x32')],_0x3504('0x39'),function(_0x12479f){logger[_0x3504('0x29')](_0x588a37[_0x3504('0x27')],'\x20result\x20conversion\x20file\x20',_0x12479f[_0x3504('0x3a')]);attachment['create']({'name':path['parse'](_0x588a37[_0x3504('0x32')])[_0x3504('0x28')],'basename':path['parse'](_0x588a37[_0x3504('0x32')])[_0x3504('0x28')]+_0x3504('0x3b'),'type':_0x3504('0x3c')})['then'](function(_0x16b0e0){faxAccount['notify'](_0x5082b2,{'from':_0x588a37['calleridnum'],'mapKey':_0x3504('0x7'),'body':path['parse'](_0x588a37[_0x3504('0x32')])[_0x3504('0x28')]+_0x3504('0x3b'),'AttachmentId':_0x16b0e0['id']})['catch'](function(_0x88c20e){logger[_0x3504('0x3d')](_0x588a37[_0x3504('0x27')],_0x3504('0x3e'),JSON[_0x3504('0x3f')](_0x88c20e));});})['catch'](function(_0xf7e4c7){logger[_0x3504('0x3d')](_0x588a37[_0x3504('0x27')],'\x20receiveFax\x20',JSON[_0x3504('0x3f')](_0xf7e4c7));});});}logger['info'](_0x588a37[_0x3504('0x27')],_0x3504('0x40'));}};Fax['prototype'][_0x3504('0x21')]=function(_0x46cfd9){if(this[_0x3504('0x10')][_0x46cfd9[_0x3504('0x27')]]){_[_0x3504('0x41')](this[_0x3504('0xd')][_0x46cfd9['uniqueid']],_['pick'](_0x46cfd9,['response',_0x3504('0x42')]));}};function updateStatus(_0x278938){if(_0x278938[_0x3504('0x43')]){faxMessage['update'](_0x278938[_0x3504('0x43')],{'failMessage':_0x3504('0x44')})['then'](function(_0x109e20){ut[_0x3504('0x45')]('[Fax][Message][Error][Updated]',_0x109e20);})[_0x3504('0x46')](function(_0x132645){ut[_0x3504('0x45')]('[Fax][Message][Error][NoUpdate1]',_0x132645);});}else{ut[_0x3504('0x45')]('[Fax][Message][Error][NoUpdate2]');}}Fax[_0x3504('0x22')][_0x3504('0x47')]=function(_0x22728d,_0x12c5b9,_0x43695a){var _0x572f16=this;var _0x2aeffc={};if(_0x12c5b9){_0x2aeffc={'read':_0x12c5b9};}else{_0x2aeffc={'failMessage':_0x43695a};}if(this['actions'][_0x22728d]['AttachmentId']){faxMessage[_0x3504('0x48')](this[_0x3504('0x10')][_0x22728d]['AttachmentId'],_0x2aeffc)['then'](function(_0x4cca5e){ut['logger']('[Fax][Message][Updated]',_0x4cca5e);})['catch'](function(_0x39d609){ut[_0x3504('0x45')](_0x3504('0x49'),_0x39d609);})[_0x3504('0x4a')](function(){delete _0x572f16[_0x3504('0xd')][_0x22728d];delete _0x572f16[_0x3504('0x10')][_0x22728d];});}else{ut[_0x3504('0x45')](_0x3504('0x4b'));delete this[_0x3504('0xd')][_0x22728d];delete this[_0x3504('0x10')][_0x22728d];}};Fax[_0x3504('0x22')][_0x3504('0x1f')]=function(_0x1fbf95){var _0x47d87e=this;if(this[_0x3504('0xd')][_0x1fbf95[_0x3504('0x27')]]){if(this['actions'][_0x1fbf95[_0x3504('0x27')]]){this[_0x3504('0xd')][_0x1fbf95[_0x3504('0x27')]]['id']=this['actions'][_0x1fbf95[_0x3504('0x27')]]['id'];this[_0x3504('0xd')][_0x1fbf95['uniqueid']][_0x3504('0x28')]=this['actions'][_0x1fbf95[_0x3504('0x27')]]['name'];}logger[_0x3504('0x29')](_0x1fbf95[_0x3504('0x27')],this[_0x3504('0x10')][_0x1fbf95[_0x3504('0x27')]]?_0x3504('0x4c'):'\x20hangup\x20faxRiceive\x20',JSON[_0x3504('0x3f')](this[_0x3504('0xd')][_0x1fbf95[_0x3504('0x27')]]));if(this[_0x3504('0x10')][_0x1fbf95[_0x3504('0x27')]]){if(this[_0x3504('0xd')][_0x1fbf95['uniqueid']]['faxpages']>0x0&&this[_0x3504('0xd')][_0x1fbf95[_0x3504('0x27')]][_0x3504('0x1a')]==='SUCCESS'){this['updateStatus'](_0x1fbf95[_0x3504('0x27')],!![]);}else{this[_0x3504('0x47')](_0x1fbf95[_0x3504('0x27')],![],this['channels'][_0x1fbf95['uniqueid']][_0x3504('0x4d')]?_0x3504('0x4e')+this[_0x3504('0xd')][_0x1fbf95['uniqueid']][_0x3504('0x4d')]:_0x3504('0x4f'));}}}};Fax[_0x3504('0x22')][_0x3504('0x50')]=function(_0x51556e){var _0x2922bd=this;return new BPromise(function(_0x39240a,_0x3840e0){_0x2922bd[_0x3504('0x51')](_0x51556e,_0x2922bd[_0x3504('0xe')][_0x51556e[_0x3504('0x52')]])[_0x3504('0x53')](function(_0x5b5448){ut[_0x3504('0x45')]('[Fax][execOriginate][success]',_0x5b5448);_0x39240a(ut[_0x3504('0x3a')](_0x3504('0x54')));})[_0x3504('0x46')](function(_0x4b7176){ut[_0x3504('0x45')](_0x3504('0x55'),_0x4b7176);updateStatus(_0x51556e);_0x3840e0(ut[_0x3504('0x3a')]('Fax\x20failed'));});});};Fax[_0x3504('0x22')][_0x3504('0x56')]=function(_0x315cf2){var _0x1b8447=this;return new BPromise(function(_0x3f46b0,_0x26d492){var _0x3d6985=_0x1b8447['checkTrunk'](_0x1b8447[_0x3504('0xe')][_0x315cf2[_0x3504('0x52')]][_0x3504('0x57')],_0x315cf2);if(_0x3d6985['isValid']){_0x3f46b0(ut['message'](_0x3504('0x58')));}else{_0x26d492(ut[_0x3504('0x3a')](_0x3d6985['message']));}});};function originate(_0x40acd7,_0x95da47,_0x482885){return new BPromise(function(_0xf9560a,_0x49ec26){if(_0x482885){var _0x564317=util[_0x3504('0x59')](_0x3504('0x5a'),path[_0x3504('0x5b')](_0x40acd7[_0x3504('0x4')])[_0x3504('0x28')],_0x40acd7[_0x3504('0x4')]);gs[_0x3504('0x5c')](_0x564317)[_0x3504('0x53')](function(){_0x40acd7['path']=util['format'](_0x3504('0x5d'),path[_0x3504('0x5b')](_0x40acd7['path'])[_0x3504('0x5e')],path[_0x3504('0x5b')](_0x40acd7[_0x3504('0x4')])[_0x3504('0x28')]);_0x95da47[_0x3504('0x5f')]=_0x40acd7[_0x3504('0x4')];ut[_0x3504('0x45')](_0x3504('0x60'),'');ami[_0x3504('0x61')](ut[_0x3504('0x62')](_0x40acd7,_0x95da47))[_0x3504('0x53')](function(_0x49f714){_0xf9560a(_0x49f714);})[_0x3504('0x46')](function(_0x5c0a2f){_0x49ec26(_0x5c0a2f);});})[_0x3504('0x46')](function(_0x1e8bdd){_0x49ec26(_0x1e8bdd);});}else{ami[_0x3504('0x61')](ut[_0x3504('0x62')](_0x40acd7,_0x95da47))[_0x3504('0x53')](function(_0x2c736d){_0xf9560a(_0x2c736d);})[_0x3504('0x46')](function(_0x303bb9){_0x49ec26(_0x303bb9);});}});}Fax[_0x3504('0x22')][_0x3504('0x51')]=function(_0x17f308,_0x402f66){var _0x17262c=this;return new BPromise(function(_0x39afbc,_0x22efd9){var _0x3294cd=uuid['v4']();var _0x2e2fb4=ut[_0x3504('0x63')](_0x17f308,_0x402f66);_0x17262c[_0x3504('0x10')][_0x3294cd]=new Action(_0x3294cd,_0x402f66,_0x17f308);var _0x4dbe3d=_0x17262c['actions'][_0x3294cd];if(path[_0x3504('0x5b')](_0x17f308[_0x3504('0x4')])[_0x3504('0x64')]===_0x3504('0x3b')){originate(_0x4dbe3d,_0x2e2fb4,!![])[_0x3504('0x53')](function(_0xa63cb7){_0x39afbc(_0xa63cb7);})['catch'](function(_0x2cee6d){_0x22efd9(_0x2cee6d);});}else{originate(_0x4dbe3d,_0x2e2fb4,![])['then'](function(_0x125b8c){_0x39afbc(_0x125b8c);})[_0x3504('0x46')](function(_0x659904){_0x22efd9(_0x659904);});}});};Fax[_0x3504('0x22')][_0x3504('0x65')]=function(_0x407cd7){return!_[_0x3504('0x66')](_0x407cd7)&&!_['isNil'](_0x407cd7[_0x3504('0x28')])&&!_['isNil'](_0x407cd7['active'])&&_0x407cd7[_0x3504('0x67')]&&!_[_0x3504('0x66')](this[_0x3504('0xf')][util['format'](_0x3504('0x68'),_0x407cd7[_0x3504('0x28')])])&&!_['isNil'](this[_0x3504('0xf')][util[_0x3504('0x59')](_0x3504('0x68'),_0x407cd7[_0x3504('0x28')])][_0x3504('0x31')])&&(this[_0x3504('0xf')][util['format']('SIP/%s',_0x407cd7[_0x3504('0x28')])][_0x3504('0x31')]==='reachable'||this[_0x3504('0xf')][util['format']('SIP/%s',_0x407cd7['name'])][_0x3504('0x31')]==='unmonitored');};Fax['prototype'][_0x3504('0x69')]=function(_0x986f2,_0x30242d){if(!this[_0x3504('0x65')](_0x986f2)){ut['logger'](_0x3504('0x6a'),_['isNil'](_0x986f2)?'':_0x986f2[_0x3504('0x28')]+'\x20Trunk\x20is\x20not\x20active');return{'isValid':![],'message':_0x3504('0x6b')};}if(_[_0x3504('0x66')](_0x30242d['fax'])){ut[_0x3504('0x45')](_0x3504('0x6c'),JSON[_0x3504('0x3f')](_0x30242d));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x3504('0x66')](_0x30242d[_0x3504('0x4')])){ut[_0x3504('0x45')]('[Fax][checkTrunk][Empty\x20path]',JSON['stringify'](_0x30242d));return{'isValid':![],'message':_0x3504('0x6d')};}return{'isValid':!![],'message':_0x3504('0x6e')};};module[_0x3504('0x6f')]=Fax; \ No newline at end of file +var _0x16d5=['../../../config/logger','fax','../ami','./channel','./util/util','./action','../rpc/attachment','../rpc/faxMessage','faxAccounts','trunks','newchannel','bind','syncVarSet','newstate','syncNewState','newexten','syncNewExten','syncFaxStatus','receivefax','hangup','prototype','syncNewchannel','context','hasOwnProperty','exten','localstationid','channels','uniqueid','name','info','\x20syncNewchannel\x20','channel','variable','value','channelstate','channelstatedesc','operation','status','filename','remotestationid','pagestransferred','resolution','transferrate','calleridnum','\x20result\x20conversion\x20file\x20','message','parse','.pdf','application/pdf','then','notify','error','\x20notify\x20','\x20receiveFax\x20','syncOriginateResponse','merge','pick','response','reason','AttachmentId','update','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][Updated]','catch','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','actions','[Fax][Message][Updated]','finally','[Fax][Message][NoUpdate2]','syncHangup','\x20hangup\x20sendFile\x20','\x20hangup\x20faxRiceive\x20','stringify','faxpages','faxstatus','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED','send','execOriginate','[Fax][execOriginate][success]','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','FaxAccountId','Trunk','Trunk\x20Reachable','format','execute','%s/%s.tif','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','[Fax][checkTrunk][Empty\x20Fax]','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','util','lodash','uuid','moment','path','tiff2pdf','./util/gs'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x16d5,0xe9));var _0x516d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x16d5[_0x3dd15e];return _0x231fd0;};'use strict';var util=require(_0x516d('0x0'));var _=require(_0x516d('0x1'));var BPromise=require('bluebird');var uuid=require(_0x516d('0x2'));var moment=require(_0x516d('0x3'));var path=require(_0x516d('0x4'));var tiff2pdf=require(_0x516d('0x5'));var gs=require(_0x516d('0x6'));var logger=require(_0x516d('0x7'))(_0x516d('0x8'));var ami=require(_0x516d('0x9'));var rpcDb=require('./rpcDb');var Channel=require(_0x516d('0xa'));var ut=require(_0x516d('0xb'));var Action=require(_0x516d('0xc'));var faxAccount=require('../rpc/faxAccount');var attachment=require(_0x516d('0xd'));var faxMessage=require(_0x516d('0xe'));function Fax(_0xaca5c1){this['channels']={};this[_0x516d('0xf')]=_0xaca5c1[_0x516d('0xf')];this[_0x516d('0x10')]=_0xaca5c1[_0x516d('0x10')];this['actions']={};ami['on'](_0x516d('0x11'),this['syncNewchannel'][_0x516d('0x12')](this));ami['on']('varset',this[_0x516d('0x13')]['bind'](this));ami['on'](_0x516d('0x14'),this[_0x516d('0x15')][_0x516d('0x12')](this));ami['on'](_0x516d('0x16'),this[_0x516d('0x17')]['bind'](this));ami['on']('faxstatus',this[_0x516d('0x18')][_0x516d('0x12')](this));ami['on'](_0x516d('0x19'),this['syncReceiveFax'][_0x516d('0x12')](this));ami['on'](_0x516d('0x1a'),this['syncHangup'][_0x516d('0x12')](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x516d('0x12')](this));}Fax[_0x516d('0x1b')][_0x516d('0x1c')]=function(_0x50340c){if(_0x50340c[_0x516d('0x1d')]==='from-voip-provider'){for(var _0x551d01 in this[_0x516d('0xf')]){if(this[_0x516d('0xf')][_0x516d('0x1e')](_0x551d01)){if(_0x50340c[_0x516d('0x1f')]===this[_0x516d('0xf')][_0x551d01][_0x516d('0x20')]){this[_0x516d('0x21')][_0x50340c[_0x516d('0x22')]]={};this['channels'][_0x50340c[_0x516d('0x22')]]['channel']=_0x50340c['channel'];this['channels'][_0x50340c['uniqueid']]['id']=this[_0x516d('0xf')][_0x551d01]['id'];this[_0x516d('0x21')][_0x50340c[_0x516d('0x22')]][_0x516d('0x23')]=this[_0x516d('0xf')][_0x551d01][_0x516d('0x23')];logger[_0x516d('0x24')](_0x50340c[_0x516d('0x22')],_0x516d('0x25'));}}}}if(this['actions'][_0x50340c[_0x516d('0x22')]]){this[_0x516d('0x21')][_0x50340c[_0x516d('0x22')]]={};this[_0x516d('0x21')][_0x50340c['uniqueid']][_0x516d('0x26')]=_0x50340c['channel'];logger[_0x516d('0x24')](_0x50340c[_0x516d('0x22')],_0x516d('0x25'));}};Fax[_0x516d('0x1b')][_0x516d('0x13')]=function(_0x1d07a0){if(this[_0x516d('0x21')][_0x1d07a0[_0x516d('0x22')]]){for(var _0x5eaa69 in _0x1d07a0[_0x516d('0x27')]){if(_0x1d07a0[_0x516d('0x27')][_0x516d('0x1e')](_0x5eaa69)){this[_0x516d('0x21')][_0x1d07a0[_0x516d('0x22')]][_0x5eaa69]=_0x1d07a0[_0x516d('0x28')];}}}};Fax['prototype'][_0x516d('0x15')]=function(_0x60e1ba){if(this['channels'][_0x60e1ba[_0x516d('0x22')]]){this[_0x516d('0x21')][_0x60e1ba[_0x516d('0x22')]][_0x516d('0x29')]=_0x60e1ba[_0x516d('0x29')];this[_0x516d('0x21')][_0x60e1ba[_0x516d('0x22')]][_0x516d('0x2a')]=_0x60e1ba['channelstatedesc'];}};Fax[_0x516d('0x1b')][_0x516d('0x17')]=function(_0x516520){if(this[_0x516d('0x21')][_0x516520[_0x516d('0x22')]]){for(var _0x17360a in _0x516520[_0x516d('0x27')]){if(_0x516520[_0x516d('0x27')]['hasOwnProperty'](_0x17360a)){this['channels'][_0x516520[_0x516d('0x22')]][_0x17360a]=_0x516520[_0x516d('0x28')];}}}};Fax[_0x516d('0x1b')]['syncFaxStatus']=function(_0x21e0f6){if(this[_0x516d('0x21')][_0x21e0f6[_0x516d('0x22')]]){this[_0x516d('0x21')][_0x21e0f6[_0x516d('0x22')]][_0x516d('0x2b')]=_0x21e0f6[_0x516d('0x2b')];this[_0x516d('0x21')][_0x21e0f6[_0x516d('0x22')]][_0x516d('0x2c')]=_0x21e0f6['status'];this[_0x516d('0x21')][_0x21e0f6[_0x516d('0x22')]][_0x516d('0x20')]=_0x21e0f6['localstationid'];this['channels'][_0x21e0f6[_0x516d('0x22')]][_0x516d('0x2d')]=_0x21e0f6[_0x516d('0x2d')];logger[_0x516d('0x24')](_0x21e0f6[_0x516d('0x22')],'\x20syncFaxStatus\x20');}};Fax[_0x516d('0x1b')]['syncReceiveFax']=function(_0x432104){var _0x372a7a=this;if(this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]]){var _0x1c8adf=this[_0x516d('0x21')][_0x432104['uniqueid']]['id'];this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]][_0x516d('0x2e')]=_0x432104[_0x516d('0x2e')];this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]][_0x516d('0x2f')]=_0x432104['pagestransferred'];this['channels'][_0x432104['uniqueid']][_0x516d('0x20')]=_0x432104[_0x516d('0x20')];this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]][_0x516d('0x30')]=_0x432104[_0x516d('0x30')];this[_0x516d('0x21')][_0x432104['uniqueid']][_0x516d('0x31')]=_0x432104[_0x516d('0x31')];this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]][_0x516d('0x2d')]=_0x432104[_0x516d('0x2d')];this[_0x516d('0x21')][_0x432104['uniqueid']][_0x516d('0x32')]=_0x432104['calleridnum'];if(this[_0x516d('0x21')][_0x432104[_0x516d('0x22')]][_0x516d('0x2f')]>0x0){tiff2pdf(_0x432104[_0x516d('0x2d')],'/var/opt/motion2/server/files/attachments/',function(_0x1109be){logger['info'](_0x432104[_0x516d('0x22')],_0x516d('0x33'),_0x1109be[_0x516d('0x34')]);attachment['create']({'name':path['parse'](_0x432104[_0x516d('0x2d')])[_0x516d('0x23')],'basename':path[_0x516d('0x35')](_0x432104[_0x516d('0x2d')])['name']+_0x516d('0x36'),'type':_0x516d('0x37')})[_0x516d('0x38')](function(_0x52aa8f){faxAccount[_0x516d('0x39')](_0x1c8adf,{'from':_0x432104['calleridnum'],'mapKey':_0x516d('0x8'),'body':path[_0x516d('0x35')](_0x432104[_0x516d('0x2d')])[_0x516d('0x23')]+'.pdf','AttachmentId':_0x52aa8f['id']})['catch'](function(_0x51feff){logger[_0x516d('0x3a')](_0x432104[_0x516d('0x22')],_0x516d('0x3b'),JSON['stringify'](_0x51feff));});})['catch'](function(_0x44597b){logger[_0x516d('0x3a')](_0x432104[_0x516d('0x22')],_0x516d('0x3c'),JSON['stringify'](_0x44597b));});});}logger[_0x516d('0x24')](_0x432104[_0x516d('0x22')],_0x516d('0x3c'));}};Fax[_0x516d('0x1b')][_0x516d('0x3d')]=function(_0x2414a5){if(this['actions'][_0x2414a5[_0x516d('0x22')]]){_[_0x516d('0x3e')](this[_0x516d('0x21')][_0x2414a5[_0x516d('0x22')]],_[_0x516d('0x3f')](_0x2414a5,[_0x516d('0x40'),_0x516d('0x41')]));}};function updateStatus(_0x10ee2b){if(_0x10ee2b[_0x516d('0x42')]){faxMessage[_0x516d('0x43')](_0x10ee2b[_0x516d('0x42')],{'failMessage':_0x516d('0x44')})[_0x516d('0x38')](function(_0x196f78){ut[_0x516d('0x45')](_0x516d('0x46'),_0x196f78);})[_0x516d('0x47')](function(_0x1b966e){ut[_0x516d('0x45')](_0x516d('0x48'),_0x1b966e);});}else{ut[_0x516d('0x45')](_0x516d('0x49'));}}Fax[_0x516d('0x1b')]['updateStatus']=function(_0x83e2c4,_0x4f3a20,_0x385c27){var _0x540c5e=this;var _0x362235={};if(_0x4f3a20){_0x362235={'read':_0x4f3a20};}else{_0x362235={'failMessage':_0x385c27};}if(this['actions'][_0x83e2c4][_0x516d('0x42')]){faxMessage[_0x516d('0x43')](this[_0x516d('0x4a')][_0x83e2c4][_0x516d('0x42')],_0x362235)['then'](function(_0x5be7b6){ut[_0x516d('0x45')](_0x516d('0x4b'),_0x5be7b6);})[_0x516d('0x47')](function(_0x3b900c){ut[_0x516d('0x45')]('[Fax][Message][NoUpdate1]',_0x3b900c);})[_0x516d('0x4c')](function(){delete _0x540c5e['channels'][_0x83e2c4];delete _0x540c5e[_0x516d('0x4a')][_0x83e2c4];});}else{ut[_0x516d('0x45')](_0x516d('0x4d'));delete this[_0x516d('0x21')][_0x83e2c4];delete this[_0x516d('0x4a')][_0x83e2c4];}};Fax['prototype'][_0x516d('0x4e')]=function(_0x31b1f7){var _0x4a1091=this;if(this[_0x516d('0x21')][_0x31b1f7['uniqueid']]){if(this[_0x516d('0x4a')][_0x31b1f7['uniqueid']]){this[_0x516d('0x21')][_0x31b1f7['uniqueid']]['id']=this[_0x516d('0x4a')][_0x31b1f7['uniqueid']]['id'];this[_0x516d('0x21')][_0x31b1f7[_0x516d('0x22')]][_0x516d('0x23')]=this['actions'][_0x31b1f7[_0x516d('0x22')]][_0x516d('0x23')];}logger[_0x516d('0x24')](_0x31b1f7[_0x516d('0x22')],this[_0x516d('0x4a')][_0x31b1f7[_0x516d('0x22')]]?_0x516d('0x4f'):_0x516d('0x50'),JSON[_0x516d('0x51')](this['channels'][_0x31b1f7['uniqueid']]));if(this[_0x516d('0x4a')][_0x31b1f7[_0x516d('0x22')]]){if(this['channels'][_0x31b1f7['uniqueid']][_0x516d('0x52')]>0x0&&this[_0x516d('0x21')][_0x31b1f7[_0x516d('0x22')]][_0x516d('0x53')]===_0x516d('0x54')){this[_0x516d('0x55')](_0x31b1f7[_0x516d('0x22')],!![]);}else{this['updateStatus'](_0x31b1f7['uniqueid'],![],this[_0x516d('0x21')][_0x31b1f7[_0x516d('0x22')]][_0x516d('0x56')]?'SENDING\x20FAILED:\x20'+this[_0x516d('0x21')][_0x31b1f7['uniqueid']]['faxstatusstring']:_0x516d('0x57'));}}}};Fax['prototype'][_0x516d('0x58')]=function(_0x5057ea){var _0x51a8c8=this;return new BPromise(function(_0x1dd697,_0x521162){_0x51a8c8[_0x516d('0x59')](_0x5057ea,_0x51a8c8['faxAccounts'][_0x5057ea['FaxAccountId']])['then'](function(_0x10223a){ut['logger'](_0x516d('0x5a'),_0x10223a);_0x1dd697(ut[_0x516d('0x34')](_0x516d('0x5b')));})[_0x516d('0x47')](function(_0x178a29){ut[_0x516d('0x45')](_0x516d('0x5c'),_0x178a29);updateStatus(_0x5057ea);_0x521162(ut[_0x516d('0x34')](_0x516d('0x5d')));});});};Fax[_0x516d('0x1b')][_0x516d('0x5e')]=function(_0xcf7ad0){var _0x1b282c=this;return new BPromise(function(_0x4635fb,_0x30b959){var _0x368e62=_0x1b282c['checkTrunk'](_0x1b282c[_0x516d('0xf')][_0xcf7ad0[_0x516d('0x5f')]][_0x516d('0x60')],_0xcf7ad0);if(_0x368e62['isValid']){_0x4635fb(ut[_0x516d('0x34')](_0x516d('0x61')));}else{_0x30b959(ut[_0x516d('0x34')](_0x368e62['message']));}});};function originate(_0x232d92,_0x46b0f7,_0x5ac2f4){return new BPromise(function(_0x4ff788,_0x352878){if(_0x5ac2f4){var _0x328664=util[_0x516d('0x62')]('gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit',path[_0x516d('0x35')](_0x232d92[_0x516d('0x4')])[_0x516d('0x23')],_0x232d92[_0x516d('0x4')]);gs[_0x516d('0x63')](_0x328664)[_0x516d('0x38')](function(){_0x232d92[_0x516d('0x4')]=util[_0x516d('0x62')](_0x516d('0x64'),path[_0x516d('0x35')](_0x232d92['path'])[_0x516d('0x65')],path[_0x516d('0x35')](_0x232d92[_0x516d('0x4')])['name']);_0x46b0f7[_0x516d('0x66')]=_0x232d92[_0x516d('0x4')];ut[_0x516d('0x45')](_0x516d('0x67'),'');ami[_0x516d('0x68')](ut['variablesAction'](_0x232d92,_0x46b0f7))['then'](function(_0x34dea1){_0x4ff788(_0x34dea1);})[_0x516d('0x47')](function(_0x2860c2){_0x352878(_0x2860c2);});})[_0x516d('0x47')](function(_0x384c37){_0x352878(_0x384c37);});}else{ami['Action'](ut['variablesAction'](_0x232d92,_0x46b0f7))[_0x516d('0x38')](function(_0x4e8886){_0x4ff788(_0x4e8886);})['catch'](function(_0x5098a1){_0x352878(_0x5098a1);});}});}Fax['prototype'][_0x516d('0x59')]=function(_0x128242,_0x2be4cd){var _0x40cd81=this;return new BPromise(function(_0x5b7975,_0x32b9bb){var _0x5cd7d2=uuid['v4']();var _0x4fa316=ut[_0x516d('0x69')](_0x128242,_0x2be4cd);_0x40cd81[_0x516d('0x4a')][_0x5cd7d2]=new Action(_0x5cd7d2,_0x2be4cd,_0x128242);var _0x51a38c=_0x40cd81[_0x516d('0x4a')][_0x5cd7d2];if(path[_0x516d('0x35')](_0x128242[_0x516d('0x4')])[_0x516d('0x6a')]==='.pdf'){originate(_0x51a38c,_0x4fa316,!![])[_0x516d('0x38')](function(_0x440ee2){_0x5b7975(_0x440ee2);})[_0x516d('0x47')](function(_0x234c3c){_0x32b9bb(_0x234c3c);});}else{originate(_0x51a38c,_0x4fa316,![])[_0x516d('0x38')](function(_0x36255d){_0x5b7975(_0x36255d);})[_0x516d('0x47')](function(_0x2f4132){_0x32b9bb(_0x2f4132);});}});};Fax[_0x516d('0x1b')][_0x516d('0x6b')]=function(_0x5b6f5a){return!_[_0x516d('0x6c')](_0x5b6f5a)&&!_[_0x516d('0x6c')](_0x5b6f5a['name'])&&!_[_0x516d('0x6c')](_0x5b6f5a[_0x516d('0x6d')])&&_0x5b6f5a[_0x516d('0x6d')]&&!_[_0x516d('0x6c')](this[_0x516d('0x10')][util[_0x516d('0x62')]('SIP/%s',_0x5b6f5a['name'])])&&!_[_0x516d('0x6c')](this[_0x516d('0x10')][util[_0x516d('0x62')](_0x516d('0x6e'),_0x5b6f5a[_0x516d('0x23')])][_0x516d('0x2c')])&&(this[_0x516d('0x10')][util['format'](_0x516d('0x6e'),_0x5b6f5a['name'])]['status']===_0x516d('0x6f')||this[_0x516d('0x10')][util[_0x516d('0x62')](_0x516d('0x6e'),_0x5b6f5a[_0x516d('0x23')])][_0x516d('0x2c')]===_0x516d('0x70'));};Fax['prototype']['checkTrunk']=function(_0x5efeef,_0x29aecc){if(!this['isTrunkReachable'](_0x5efeef)){ut[_0x516d('0x45')](_0x516d('0x71'),_[_0x516d('0x6c')](_0x5efeef)?'':_0x5efeef[_0x516d('0x23')]+_0x516d('0x72'));return{'isValid':![],'message':_0x516d('0x73')};}if(_['isNil'](_0x29aecc[_0x516d('0x8')])){ut[_0x516d('0x45')](_0x516d('0x74'),JSON['stringify'](_0x29aecc));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0x516d('0x6c')](_0x29aecc[_0x516d('0x4')])){ut[_0x516d('0x45')](_0x516d('0x75'),JSON[_0x516d('0x51')](_0x29aecc));return{'isValid':![],'message':_0x516d('0x76')};}return{'isValid':!![],'message':_0x516d('0x77')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 9268cb8..3861f86 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 _0x6b04=['inspect','notify','resolve','then','catch','[Notify]\x20','util','bluebird','preview','lodash','error'];(function(_0x5a1cdd,_0x312605){var _0x14129a=function(_0x312567){while(--_0x312567){_0x5a1cdd['push'](_0x5a1cdd['shift']());}};_0x14129a(++_0x312605);}(_0x6b04,0xe2));var _0x46b0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x6b04[_0x501510];return _0x1e6ee5;};'use strict';var util=require(_0x46b0('0x0'));var BPromise=require(_0x46b0('0x1'));var logger=require('../../../config/logger')(_0x46b0('0x2'));var _=require(_0x46b0('0x3'));var faxAccount=require('../rpc/faxAccount');function loggerCatch(_0x2a2db9){return function(_0x49f901){logger[_0x46b0('0x4')](_0x2a2db9,util[_0x46b0('0x5')](_0x49f901,{'showHidden':![],'depth':null}));};}exports[_0x46b0('0x6')]=function(_0x172465,_0x3fd6a3){return BPromise[_0x46b0('0x7')]()[_0x46b0('0x8')](faxAccount['notify'](_0x172465,_0x3fd6a3))[_0x46b0('0x9')](loggerCatch(_0x46b0('0xa')));}; \ No newline at end of file +var _0xa249=['[Notify]\x20','bluebird','../../../config/logger','preview','../rpc/faxAccount','error','inspect','notify','then','catch'];(function(_0x517344,_0x1f2ea9){var _0xbf4d8a=function(_0x2b9f2b){while(--_0x2b9f2b){_0x517344['push'](_0x517344['shift']());}};_0xbf4d8a(++_0x1f2ea9);}(_0xa249,0x1cd));var _0x9a24=function(_0x2e4fd4,_0x2f432f){_0x2e4fd4=_0x2e4fd4-0x0;var _0x7de929=_0xa249[_0x2e4fd4];return _0x7de929;};'use strict';var util=require('util');var BPromise=require(_0x9a24('0x0'));var logger=require(_0x9a24('0x1'))(_0x9a24('0x2'));var _=require('lodash');var faxAccount=require(_0x9a24('0x3'));function loggerCatch(_0x1983ed){return function(_0x14f30a){logger[_0x9a24('0x4')](_0x1983ed,util[_0x9a24('0x5')](_0x14f30a,{'showHidden':![],'depth':null}));};}exports[_0x9a24('0x6')]=function(_0x5f168d,_0x59255d){return BPromise['resolve']()[_0x9a24('0x7')](faxAccount[_0x9a24('0x6')](_0x5f168d,_0x59255d))[_0x9a24('0x8')](loggerCatch(_0x9a24('0x9')));}; \ No newline at end of file diff --git a/server/services/ami/fax/util/gs.js b/server/services/ami/fax/util/gs.js index ebd86e0..d0b9be1 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 _0xf177=['execute','info','Exec\x20gs','\x20Error\x20:','inspect','../../../../config/logger','bluebird','child_process','exec'];(function(_0x36633f,_0x26e83d){var _0x480eb0=function(_0x2e4919){while(--_0x2e4919){_0x36633f['push'](_0x36633f['shift']());}};_0x480eb0(++_0x26e83d);}(_0xf177,0x152));var _0x7f17=function(_0x4a9fb1,_0x273043){_0x4a9fb1=_0x4a9fb1-0x0;var _0x348672=_0xf177[_0x4a9fb1];return _0x348672;};'use strict';var util=require('util');var logger=require(_0x7f17('0x0'))('fax');var BPromise=require(_0x7f17('0x1'));var exec=require(_0x7f17('0x2'))[_0x7f17('0x3')];exports[_0x7f17('0x4')]=function(_0x2a281c){return new BPromise(function(_0x8202d6,_0x3cf3a1){exec(_0x2a281c,function(_0xc47073,_0x5d6276,_0x1ccf1a){logger[_0x7f17('0x5')](_0x7f17('0x6'),_0x5d6276);if(_0xc47073){logger['info'](_0x7f17('0x6'),_0x7f17('0x7'),util[_0x7f17('0x8')](_0xc47073,{'showHidden':![],'depth':null}),_0x5d6276,_0x1ccf1a);_0x3cf3a1(_0xc47073);}_0x8202d6(_0x5d6276);});});}; \ No newline at end of file +var _0x9ff9=['info','Exec\x20gs','\x20Error\x20:','inspect','util','bluebird','child_process','exec','execute'];(function(_0x30d71b,_0x413e79){var _0x5929ec=function(_0x1956e3){while(--_0x1956e3){_0x30d71b['push'](_0x30d71b['shift']());}};_0x5929ec(++_0x413e79);}(_0x9ff9,0xc1));var _0x99ff=function(_0x3ff085,_0x27c92e){_0x3ff085=_0x3ff085-0x0;var _0x2b68c3=_0x9ff9[_0x3ff085];return _0x2b68c3;};'use strict';var util=require(_0x99ff('0x0'));var logger=require('../../../../config/logger')('fax');var BPromise=require(_0x99ff('0x1'));var exec=require(_0x99ff('0x2'))[_0x99ff('0x3')];exports[_0x99ff('0x4')]=function(_0xc81adb){return new BPromise(function(_0x4e1194,_0x2245c0){exec(_0xc81adb,function(_0x4cc67b,_0x48851b,_0x1ab03b){logger[_0x99ff('0x5')](_0x99ff('0x6'),_0x48851b);if(_0x4cc67b){logger['info'](_0x99ff('0x6'),_0x99ff('0x7'),util[_0x99ff('0x8')](_0x4cc67b,{'showHidden':![],'depth':null}),_0x48851b,_0x1ab03b);_0x2245c0(_0x4cc67b);}_0x4e1194(_0x48851b);});});}; \ 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 e881e7d..3b2a22d 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 _0xca66=['inspect','addVariables','ecm','headerinfo','maxrate','format','\x22%s\x22','modem','gateway','faxdetect','t38timeout','path','variablesAction','uniqueid','originate','xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','localstationid','util','../../../../config/logger','fax','message','logger'];(function(_0x3cfafd,_0x25f927){var _0x454431=function(_0xf13774){while(--_0xf13774){_0x3cfafd['push'](_0x3cfafd['shift']());}};_0x454431(++_0x25f927);}(_0xca66,0x8b));var _0x6ca6=function(_0x2e3441,_0x5b6099){_0x2e3441=_0x2e3441-0x0;var _0x2eb8c2=_0xca66[_0x2e3441];return _0x2eb8c2;};'use strict';var util=require(_0x6ca6('0x0'));var _=require('lodash');var moment=require('moment');var logger=require(_0x6ca6('0x1'))(_0x6ca6('0x2'));exports[_0x6ca6('0x3')]=function(_0x571335){return{'message':_0x571335};};exports[_0x6ca6('0x4')]=function(_0x4b1a10,_0x3ab489){logger['info'](_0x4b1a10,util[_0x6ca6('0x5')](_0x3ab489,{'showHidden':![],'depth':null}));};exports[_0x6ca6('0x6')]=function(_0x34836f,_0x44019c){var _0x407e66={'XMF-ECM':_0x44019c[_0x6ca6('0x7')],'XMF-HEADERINFO':_0x44019c[_0x6ca6('0x8')],'XMF-MINRATE':_0x44019c['minrate'],'XMF-MAXRATE':_0x44019c[_0x6ca6('0x9')],'XMF-MODEM':util[_0x6ca6('0xa')](_0x6ca6('0xb'),_0x44019c[_0x6ca6('0xc')]),'XMF-GATEWAY':_0x44019c[_0x6ca6('0xd')],'XMF-FAXDETECT':_0x44019c[_0x6ca6('0xe')],'XMF-T38TIMEOUT':_0x44019c[_0x6ca6('0xf')],'XMF-LOCALSTATIONID':_0x44019c['localstationid'],'XMF-PATH':_0x34836f[_0x6ca6('0x10')]};return _0x407e66;};exports[_0x6ca6('0x11')]=function(_0x25d276,_0x46b795){return{'actionid':_0x25d276[_0x6ca6('0x12')],'action':_0x6ca6('0x13'),'channel':_0x25d276['channel'],'Exten':_0x6ca6('0x14'),'Context':_0x6ca6('0x15'),'Priority':'1','callerid':util['format'](_0x6ca6('0x16'),_0x25d276[_0x6ca6('0x8')]?_0x25d276[_0x6ca6('0x8')]:'',_0x25d276[_0x6ca6('0x17')]),'variable':_0x46b795,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x25d276[_0x6ca6('0x12')]};}; \ No newline at end of file +var _0x8ce3=['logger','info','addVariables','ecm','headerinfo','maxrate','\x22%s\x22','gateway','faxdetect','t38timeout','localstationid','path','variablesAction','uniqueid','originate','channel','xcally-motion-fax','from-sip','format','\x22%s\x22\x20<%s>','util','lodash','../../../../config/logger','fax','message'];(function(_0x227f71,_0x486c7e){var _0x523e1d=function(_0x165992){while(--_0x165992){_0x227f71['push'](_0x227f71['shift']());}};_0x523e1d(++_0x486c7e);}(_0x8ce3,0xc3));var _0x38ce=function(_0x361ddd,_0x503739){_0x361ddd=_0x361ddd-0x0;var _0x3a92da=_0x8ce3[_0x361ddd];return _0x3a92da;};'use strict';var util=require(_0x38ce('0x0'));var _=require(_0x38ce('0x1'));var moment=require('moment');var logger=require(_0x38ce('0x2'))(_0x38ce('0x3'));exports[_0x38ce('0x4')]=function(_0x26ec48){return{'message':_0x26ec48};};exports[_0x38ce('0x5')]=function(_0x17b96d,_0x1efae3){logger[_0x38ce('0x6')](_0x17b96d,util['inspect'](_0x1efae3,{'showHidden':![],'depth':null}));};exports[_0x38ce('0x7')]=function(_0xb24f4c,_0x58074c){var _0x262b13={'XMF-ECM':_0x58074c[_0x38ce('0x8')],'XMF-HEADERINFO':_0x58074c[_0x38ce('0x9')],'XMF-MINRATE':_0x58074c['minrate'],'XMF-MAXRATE':_0x58074c[_0x38ce('0xa')],'XMF-MODEM':util['format'](_0x38ce('0xb'),_0x58074c['modem']),'XMF-GATEWAY':_0x58074c[_0x38ce('0xc')],'XMF-FAXDETECT':_0x58074c[_0x38ce('0xd')],'XMF-T38TIMEOUT':_0x58074c[_0x38ce('0xe')],'XMF-LOCALSTATIONID':_0x58074c[_0x38ce('0xf')],'XMF-PATH':_0xb24f4c[_0x38ce('0x10')]};return _0x262b13;};exports[_0x38ce('0x11')]=function(_0x2a9045,_0x171a02){return{'actionid':_0x2a9045[_0x38ce('0x12')],'action':_0x38ce('0x13'),'channel':_0x2a9045[_0x38ce('0x14')],'Exten':_0x38ce('0x15'),'Context':_0x38ce('0x16'),'Priority':'1','callerid':util[_0x38ce('0x17')](_0x38ce('0x18'),_0x2a9045[_0x38ce('0x9')]?_0x2a9045['headerinfo']:'',_0x2a9045['localstationid']),'variable':_0x171a02,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x2a9045[_0x38ce('0x12')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 26c2f3c..c30888a 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 _0xb4f1=['bluebird','util','moment','./server','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/template','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','hour','get','then','getAgents','initAgents','getTelephones','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','getZendeskAccounts','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getVtigerAccounts','initVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getCampaigns','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','getVoiceQueueReports','initVoiceQueueReports','getVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','catch','log','listen','sync'];(function(_0x40dcf8,_0x176231){var _0x22d721=function(_0x43dfec){while(--_0x43dfec){_0x40dcf8['push'](_0x40dcf8['shift']());}};_0x22d721(++_0x176231);}(_0xb4f1,0x163));var _0x1b4f=function(_0x227926,_0x5618ac){_0x227926=_0x227926-0x0;var _0x129f07=_0xb4f1[_0x227926];return _0x129f07;};'use strict';var BPromise=require(_0x1b4f('0x0'));var util=require(_0x1b4f('0x1'));var moment=require(_0x1b4f('0x2'));var server=require(_0x1b4f('0x3'));var Realtime=require('./realtime');var Report=require(_0x1b4f('0x4'));var Acw=require(_0x1b4f('0x5'));var Trigger=require(_0x1b4f('0x6'));var Dialer=require(_0x1b4f('0x7'));var Preview=require('./preview');var Fax=require(_0x1b4f('0x8'));var user=require(_0x1b4f('0x9'));var voiceQueue=require(_0x1b4f('0xa'));var voiceQueueReport=require(_0x1b4f('0xb'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x1b4f('0xc'));var template=require(_0x1b4f('0xd'));var cmHopperHistory=require('./rpc/cmHopperHistory');var campaign=require('./rpc/campaign');var voiceExtension=require(_0x1b4f('0xe'));var faxAccount=require(_0x1b4f('0xf'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x1b4f('0x10'));var sugarcrm=require(_0x1b4f('0x11'));var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0x1b4f('0x12'));var zoho=require(_0x1b4f('0x13'));var vtiger=require(_0x1b4f('0x14'));var freshsales=require(_0x1b4f('0x15'));var servicenow=require(_0x1b4f('0x16'));var dynamics365=require('./rpc/integrations/dynamics365');var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()['get'](_0x1b4f('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x1b4f('0x18')](_0x1b4f('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0x1b4f('0x19')](user[_0x1b4f('0x1a')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x1b')]())[_0x1b4f('0x19')](user[_0x1b4f('0x1c')]())[_0x1b4f('0x19')](realtime['initTelephones']())[_0x1b4f('0x19')](trunk['getTrunks']())[_0x1b4f('0x19')](realtime[_0x1b4f('0x1d')]())[_0x1b4f('0x19')](voiceQueue[_0x1b4f('0x1e')]())['then'](realtime[_0x1b4f('0x1f')]())[_0x1b4f('0x19')](trigger[_0x1b4f('0x20')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x21')]())['then'](template[_0x1b4f('0x22')]())[_0x1b4f('0x19')](realtime['initTemplates']())[_0x1b4f('0x19')](zendesk[_0x1b4f('0x23')]())['then'](realtime[_0x1b4f('0x24')]())[_0x1b4f('0x19')](salesforce[_0x1b4f('0x25')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x26')]())[_0x1b4f('0x19')](sugarcrm[_0x1b4f('0x27')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x28')]())['then'](freshdesk[_0x1b4f('0x29')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x2a')]())[_0x1b4f('0x19')](desk[_0x1b4f('0x2b')]())['then'](realtime[_0x1b4f('0x2c')]())[_0x1b4f('0x19')](zoho[_0x1b4f('0x2d')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x2e')]())['then'](vtiger[_0x1b4f('0x2f')]())['then'](realtime[_0x1b4f('0x30')]())[_0x1b4f('0x19')](freshsales[_0x1b4f('0x31')]())[_0x1b4f('0x19')](realtime['initFreshsalesAccounts']())['then'](servicenow[_0x1b4f('0x32')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x33')]())[_0x1b4f('0x19')](dynamics365[_0x1b4f('0x34')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x35')]())['then'](campaign[_0x1b4f('0x36')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x37')]())['then'](voiceExtension[_0x1b4f('0x38')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x39')]())[_0x1b4f('0x19')](faxAccount[_0x1b4f('0x3a')]())['then'](realtime[_0x1b4f('0x3b')]())['then'](function(){return realtime;});}function initParams(){return BPromise[_0x1b4f('0x3c')]()[_0x1b4f('0x19')](voiceQueueReport[_0x1b4f('0x3d')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x3e')]())[_0x1b4f('0x19')](cmHopperHistory[_0x1b4f('0x3f')]())[_0x1b4f('0x19')](realtime['initVoiceQueueHopperHistory']())[_0x1b4f('0x19')](cmHopperHistory[_0x1b4f('0x40')]())[_0x1b4f('0x19')](realtime[_0x1b4f('0x41')]())[_0x1b4f('0x19')](voiceCallReport[_0x1b4f('0x42')]())[_0x1b4f('0x19')](realtime['initVoiceCallReports']())[_0x1b4f('0x19')](function(_0x29f7db){})[_0x1b4f('0x43')](function(_0x45028b){console[_0x1b4f('0x44')](_0x45028b);});}function main(){return server[_0x1b4f('0x45')](realtime,preview,fax)[_0x1b4f('0x19')](function(_0x26f346){return initRealtime();})[_0x1b4f('0x19')](function(){return initParams();})[_0x1b4f('0x19')](function(){report[_0x1b4f('0x46')]();setInterval(initRealtime,0x1388);})[_0x1b4f('0x43')](function(_0xf14b2a){console[_0x1b4f('0x44')](_0xf14b2a);});}main(); \ No newline at end of file +var _0xc49d=['./server','./report','./acw','./trigger','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/cmHopperHistory','./rpc/campaign','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/salesforce','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/dynamics365','get','hour','then','getAgents','initAgents','getTelephones','initTelephones','getTrunks','initTrunks','getVoiceQueues','initVoiceQueues','getTriggers','initTriggers','getTemplates','initTemplates','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','getFreshdeskAccounts','getDeskAccounts','initZohoAccounts','getVtigerAccounts','getFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','initCampaigns','getVoiceExtensions','initVoiceExtensions','getFaxAccounts','initFaxAccounts','resolve','initVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch','listen','sync','log','bluebird','moment'];(function(_0x4a640f,_0x321529){var _0x322ff9=function(_0x336f67){while(--_0x336f67){_0x4a640f['push'](_0x4a640f['shift']());}};_0x322ff9(++_0x321529);}(_0xc49d,0x80));var _0xdc49=function(_0x216faf,_0xf385bf){_0x216faf=_0x216faf-0x0;var _0x4a4e3a=_0xc49d[_0x216faf];return _0x4a4e3a;};'use strict';var BPromise=require(_0xdc49('0x0'));var util=require('util');var moment=require(_0xdc49('0x1'));var server=require(_0xdc49('0x2'));var Realtime=require('./realtime');var Report=require(_0xdc49('0x3'));var Acw=require(_0xdc49('0x4'));var Trigger=require(_0xdc49('0x5'));var Dialer=require('./dialer');var Preview=require('./preview');var Fax=require('./fax');var user=require(_0xdc49('0x6'));var voiceQueue=require(_0xdc49('0x7'));var voiceQueueReport=require(_0xdc49('0x8'));var voiceCallReport=require(_0xdc49('0x9'));var trunk=require(_0xdc49('0xa'));var trigger=require('./rpc/trigger');var template=require('./rpc/template');var cmHopperHistory=require(_0xdc49('0xb'));var campaign=require(_0xdc49('0xc'));var voiceExtension=require(_0xdc49('0xd'));var faxAccount=require(_0xdc49('0xe'));var zendesk=require(_0xdc49('0xf'));var salesforce=require(_0xdc49('0x10'));var sugarcrm=require('./rpc/integrations/sugarcrm');var freshdesk=require('./rpc/integrations/freshdesk');var desk=require(_0xdc49('0x11'));var zoho=require(_0xdc49('0x12'));var vtiger=require(_0xdc49('0x13'));var freshsales=require(_0xdc49('0x14'));var servicenow=require('./rpc/integrations/servicenow');var dynamics365=require(_0xdc49('0x15'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0xdc49('0x16')](_0xdc49('0x17'))===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0xdc49('0x17'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise['resolve']()[_0xdc49('0x18')](user[_0xdc49('0x19')]())[_0xdc49('0x18')](realtime[_0xdc49('0x1a')]())[_0xdc49('0x18')](user[_0xdc49('0x1b')]())[_0xdc49('0x18')](realtime[_0xdc49('0x1c')]())[_0xdc49('0x18')](trunk[_0xdc49('0x1d')]())[_0xdc49('0x18')](realtime[_0xdc49('0x1e')]())[_0xdc49('0x18')](voiceQueue[_0xdc49('0x1f')]())[_0xdc49('0x18')](realtime[_0xdc49('0x20')]())[_0xdc49('0x18')](trigger[_0xdc49('0x21')]())['then'](realtime[_0xdc49('0x22')]())[_0xdc49('0x18')](template[_0xdc49('0x23')]())[_0xdc49('0x18')](realtime[_0xdc49('0x24')]())[_0xdc49('0x18')](zendesk['getZendeskAccounts']())[_0xdc49('0x18')](realtime['initZendeskAccounts']())[_0xdc49('0x18')](salesforce['getSalesforceAccounts']())['then'](realtime[_0xdc49('0x25')]())[_0xdc49('0x18')](sugarcrm[_0xdc49('0x26')]())[_0xdc49('0x18')](realtime[_0xdc49('0x27')]())[_0xdc49('0x18')](freshdesk[_0xdc49('0x28')]())[_0xdc49('0x18')](realtime['initFreshdeskAccounts']())[_0xdc49('0x18')](desk[_0xdc49('0x29')]())[_0xdc49('0x18')](realtime['initDeskAccounts']())['then'](zoho['getZohoAccounts']())[_0xdc49('0x18')](realtime[_0xdc49('0x2a')]())[_0xdc49('0x18')](vtiger[_0xdc49('0x2b')]())[_0xdc49('0x18')](realtime['initVtigerAccounts']())[_0xdc49('0x18')](freshsales[_0xdc49('0x2c')]())[_0xdc49('0x18')](realtime['initFreshsalesAccounts']())[_0xdc49('0x18')](servicenow[_0xdc49('0x2d')]())[_0xdc49('0x18')](realtime[_0xdc49('0x2e')]())[_0xdc49('0x18')](dynamics365[_0xdc49('0x2f')]())[_0xdc49('0x18')](realtime[_0xdc49('0x30')]())[_0xdc49('0x18')](campaign['getCampaigns']())[_0xdc49('0x18')](realtime[_0xdc49('0x31')]())['then'](voiceExtension[_0xdc49('0x32')]())['then'](realtime[_0xdc49('0x33')]())[_0xdc49('0x18')](faxAccount[_0xdc49('0x34')]())[_0xdc49('0x18')](realtime[_0xdc49('0x35')]())[_0xdc49('0x18')](function(){return realtime;});}function initParams(){return BPromise[_0xdc49('0x36')]()[_0xdc49('0x18')](voiceQueueReport['getVoiceQueueReports']())[_0xdc49('0x18')](realtime[_0xdc49('0x37')]())['then'](cmHopperHistory[_0xdc49('0x38')]())['then'](realtime[_0xdc49('0x39')]())[_0xdc49('0x18')](cmHopperHistory['getCampaignHopperHistory']())['then'](realtime[_0xdc49('0x3a')]())[_0xdc49('0x18')](voiceCallReport[_0xdc49('0x3b')]())[_0xdc49('0x18')](realtime[_0xdc49('0x3c')]())[_0xdc49('0x18')](function(_0x5e4313){})[_0xdc49('0x3d')](function(_0x1b3ff1){console['log'](_0x1b3ff1);});}function main(){return server[_0xdc49('0x3e')](realtime,preview,fax)['then'](function(_0x5a5bf9){return initRealtime();})[_0xdc49('0x18')](function(){return initParams();})[_0xdc49('0x18')](function(){report[_0xdc49('0x3f')]();setInterval(initRealtime,0x1388);})[_0xdc49('0x3d')](function(_0x39a831){console[_0xdc49('0x40')](_0x39a831);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index e2bab5f..df6681a 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 _0x6486=['fullname','state','unknown','status','address','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','prototype','updateStatusRealtime','not_inuse','idle','talking','statePause','toNumber','stateTime','stringify','md5','format','user:%s','emit','lodash','util','moment','../../../config/environment','redis','defaults','localhost','name','email','accountcode'];(function(_0x3ffcbd,_0x4d1e68){var _0x19aa3c=function(_0x1a08ec){while(--_0x1a08ec){_0x3ffcbd['push'](_0x3ffcbd['shift']());}};_0x19aa3c(++_0x4d1e68);}(_0x6486,0xaa));var _0x6648=function(_0x325a4f,_0x126e07){_0x325a4f=_0x325a4f-0x0;var _0x1817ee=_0x6486[_0x325a4f];return _0x1817ee;};'use strict';var _=require(_0x6648('0x0'));var util=require(_0x6648('0x1'));var moment=require(_0x6648('0x2'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x6648('0x3'));config[_0x6648('0x4')]=_[_0x6648('0x5')](config[_0x6648('0x4')],{'host':_0x6648('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function Agent(_0x5746f3){this['id']=_0x5746f3['id']||0x0;this[_0x6648('0x7')]=_0x5746f3[_0x6648('0x7')]||'';this['email']=_0x5746f3[_0x6648('0x8')]||'';this[_0x6648('0x9')]=_0x5746f3[_0x6648('0x9')]||'';this[_0x6648('0xa')]=_0x5746f3[_0x6648('0xa')]||'';this[_0x6648('0xb')]=_0x6648('0xc');this['stateTime']=0x0;this[_0x6648('0xd')]=_0x6648('0xc');this[_0x6648('0xe')]='';this['phone']='';this[_0x6648('0xf')]='';this[_0x6648('0x10')]='';this[_0x6648('0x11')]=_0x5746f3[_0x6648('0x11')]||![];this[_0x6648('0x12')]=_0x6648('0xc');this[_0x6648('0x13')]=0x0;this[_0x6648('0x14')]='';this[_0x6648('0x15')]='';this[_0x6648('0x16')]=![];this['local']=![];this['md5']='';}Agent[_0x6648('0x17')][_0x6648('0x18')]=function(_0x5d76b0){var _0x5dfa14;if(_0x5d76b0&&_0x5d76b0[_0x6648('0xb')]){_0x5dfa14=_0x5d76b0[_0x6648('0xb')]['toLowerCase']();switch(_0x5dfa14){case _0x6648('0x19'):_0x5dfa14=_0x6648('0x1a');break;case'inuse':_0x5dfa14=_0x6648('0x1b');break;}}if(_0x5dfa14&&this[_0x6648('0x12')]!==_0x5dfa14||_0x5d76b0[_0x6648('0x1c')]){this[_0x6648('0x13')]=_[_0x6648('0x1d')](moment()['format']('x'));}if(_0x5dfa14){this[_0x6648('0x12')]=_0x5dfa14;}var _0xe55f14={'id':this['id'],'name':this[_0x6648('0x7')],'email':this[_0x6648('0x8')],'accountcode':this['accountcode'],'fullname':this[_0x6648('0xa')],'state':this[_0x6648('0xb')],'stateTime':this[_0x6648('0x1e')],'status':this[_0x6648('0xd')],'address':this[_0x6648('0xe')],'online':this[_0x6648('0x11')],'voiceStatus':this[_0x6648('0x12')],'voiceStatusTime':this[_0x6648('0x13')],'voiceStatusCallerIdNumber':this[_0x6648('0x14')],'voiceStatusQueue':this[_0x6648('0x15')],'interface':this[_0x6648('0x10')],'onhold':this['onhold']};var _0x5370ba=md5(JSON[_0x6648('0x1f')](_0xe55f14));if(this['md5']!==_0x5370ba){this[_0x6648('0x20')]=_0x5370ba;io['to'](util[_0x6648('0x21')](_0x6648('0x22'),_0xe55f14['name']))[_0x6648('0x23')]('user:save',_0xe55f14);}};module['exports']=Agent; \ No newline at end of file +var _0x3507=['socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','md5','prototype','updateStatusRealtime','toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','format','stringify','user:%s','emit','user:save','util','moment','../../../config/environment','redis','localhost'];(function(_0xda464c,_0x26e47d){var _0x19e222=function(_0x1ec605){while(--_0x1ec605){_0xda464c['push'](_0xda464c['shift']());}};_0x19e222(++_0x26e47d);}(_0x3507,0x181));var _0x7350=function(_0x8cb2f9,_0x2b8706){_0x8cb2f9=_0x8cb2f9-0x0;var _0x164887=_0x3507[_0x8cb2f9];return _0x164887;};'use strict';var _=require('lodash');var util=require(_0x7350('0x0'));var moment=require(_0x7350('0x1'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x7350('0x2'));config['redis']=_['defaults'](config[_0x7350('0x3')],{'host':_0x7350('0x4'),'port':0x18eb});var io=require(_0x7350('0x5'))(new Redis(config[_0x7350('0x3')]));function Agent(_0x18f090){this['id']=_0x18f090['id']||0x0;this[_0x7350('0x6')]=_0x18f090[_0x7350('0x6')]||'';this[_0x7350('0x7')]=_0x18f090[_0x7350('0x7')]||'';this['accountcode']=_0x18f090[_0x7350('0x8')]||'';this['fullname']=_0x18f090[_0x7350('0x9')]||'';this[_0x7350('0xa')]=_0x7350('0xb');this[_0x7350('0xc')]=0x0;this[_0x7350('0xd')]=_0x7350('0xb');this[_0x7350('0xe')]='';this[_0x7350('0xf')]='';this['mobile']='';this[_0x7350('0x10')]='';this[_0x7350('0x11')]=_0x18f090[_0x7350('0x11')]||![];this[_0x7350('0x12')]=_0x7350('0xb');this[_0x7350('0x13')]=0x0;this[_0x7350('0x14')]='';this[_0x7350('0x15')]='';this[_0x7350('0x16')]=![];this[_0x7350('0x17')]=![];this[_0x7350('0x18')]='';}Agent[_0x7350('0x19')][_0x7350('0x1a')]=function(_0x540e85){var _0x132642;if(_0x540e85&&_0x540e85[_0x7350('0xa')]){_0x132642=_0x540e85['state'][_0x7350('0x1b')]();switch(_0x132642){case _0x7350('0x1c'):_0x132642=_0x7350('0x1d');break;case _0x7350('0x1e'):_0x132642=_0x7350('0x1f');break;}}if(_0x132642&&this[_0x7350('0x12')]!==_0x132642||_0x540e85[_0x7350('0x20')]){this[_0x7350('0x13')]=_[_0x7350('0x21')](moment()[_0x7350('0x22')]('x'));}if(_0x132642){this[_0x7350('0x12')]=_0x132642;}var _0x210c7e={'id':this['id'],'name':this[_0x7350('0x6')],'email':this['email'],'accountcode':this[_0x7350('0x8')],'fullname':this['fullname'],'state':this[_0x7350('0xa')],'stateTime':this[_0x7350('0xc')],'status':this[_0x7350('0xd')],'address':this[_0x7350('0xe')],'online':this[_0x7350('0x11')],'voiceStatus':this[_0x7350('0x12')],'voiceStatusTime':this[_0x7350('0x13')],'voiceStatusCallerIdNumber':this[_0x7350('0x14')],'voiceStatusQueue':this[_0x7350('0x15')],'interface':this[_0x7350('0x10')],'onhold':this[_0x7350('0x16')]};var _0x19a246=md5(JSON[_0x7350('0x23')](_0x210c7e));if(this[_0x7350('0x18')]!==_0x19a246){this['md5']=_0x19a246;io['to'](util['format'](_0x7350('0x24'),_0x210c7e['name']))[_0x7350('0x25')](_0x7350('0x26'),_0x210c7e);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 0db9b2f..8ee9527 100644 --- a/server/services/ami/model/campaign.js +++ b/server/services/ami/model/campaign.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x2a2f51,_0x2c76cf){var _0x53d7c4=function(_0x3309b3){while(--_0x3309b3){_0x2a2f51['push'](_0x2a2f51['shift']());}};_0x53d7c4(++_0x2c76cf);}(_0x757a,0xde));var _0xa757=function(_0x5ecd89,_0x1a425f){_0x5ecd89=_0x5ecd89-0x0;var _0x43d225=_0x757a[_0x5ecd89];return _0x43d225;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file +var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x4a4fb8,_0x1c8af){var _0x1d27c8=function(_0x56ae4f){while(--_0x56ae4f){_0x4a4fb8['push'](_0x4a4fb8['shift']());}};_0x1d27c8(++_0x1c8af);}(_0x757a,0xde));var _0xa757=function(_0x4ad8af,_0x5c88d9){_0x4ad8af=_0x4ad8af-0x0;var _0x16f5e2=_0x757a[_0x4ad8af];return _0x16f5e2;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index a0dfc2e..253d173 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 _0x8cce=['uniqueid','linkedid','exten','answered','endtime','lastdata','duration','holdtime','tag','disposition','monitor','monitorFilename','queue','monitors','transferconnectedlinenum','mohtime','channel','calleridname','connectedlinenum','connectedlinename','accountcode','context'];(function(_0x2eb289,_0xa4c3a0){var _0x5400af=function(_0x4b2ad7){while(--_0x4b2ad7){_0x2eb289['push'](_0x2eb289['shift']());}};_0x5400af(++_0xa4c3a0);}(_0x8cce,0xd6));var _0xe8cc=function(_0x38b63,_0x3cd675){_0x38b63=_0x38b63-0x0;var _0x1f8ac7=_0x8cce[_0x38b63];return _0x1f8ac7;};'use strict';function Channel(){this['starttime']=null;this[_0xe8cc('0x0')]='';this['destinationchannel']='';this['calleridnum']=0x0;this[_0xe8cc('0x1')]='';this[_0xe8cc('0x2')]=undefined;this[_0xe8cc('0x3')]=undefined;this[_0xe8cc('0x4')]=0x0;this[_0xe8cc('0x5')]='';this[_0xe8cc('0x6')]=0x0;this[_0xe8cc('0x7')]=0x0;this[_0xe8cc('0x8')]=0x0;this[_0xe8cc('0x9')]=![];this['answertime']=null;this[_0xe8cc('0xa')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0xe8cc('0xb')]='';this[_0xe8cc('0xc')]=0x0;this['billableseconds']=0x0;this[_0xe8cc('0xd')]=0x0;this['type']=null;this[_0xe8cc('0xe')]=null;this[_0xe8cc('0xf')]=null;this[_0xe8cc('0x10')]=![];this[_0xe8cc('0x11')]=null;this[_0xe8cc('0x12')]=null;this[_0xe8cc('0x13')]=[];this['transfercalleridnum']=undefined;this[_0xe8cc('0x14')]=undefined;this[_0xe8cc('0x15')]=0x0;}module['exports']=Channel; \ No newline at end of file +var _0x1458=['queue','transfercalleridnum','transferconnectedlinenum','mohtime','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','context','uniqueid','linkedid','exten','answered','endtime','lastdata','billableseconds','holdtime','tag','disposition','monitor','monitorFilename'];(function(_0x21b9bc,_0x181d96){var _0x5cd545=function(_0x505ce3){while(--_0x505ce3){_0x21b9bc['push'](_0x21b9bc['shift']());}};_0x5cd545(++_0x181d96);}(_0x1458,0x16c));var _0x8145=function(_0x564907,_0x43c733){_0x564907=_0x564907-0x0;var _0x27bb1f=_0x1458[_0x564907];return _0x27bb1f;};'use strict';function Channel(){this[_0x8145('0x0')]=null;this[_0x8145('0x1')]='';this[_0x8145('0x2')]='';this[_0x8145('0x3')]=0x0;this[_0x8145('0x4')]='';this[_0x8145('0x5')]=undefined;this[_0x8145('0x6')]=undefined;this['accountcode']=0x0;this[_0x8145('0x7')]='';this[_0x8145('0x8')]=0x0;this[_0x8145('0x9')]=0x0;this[_0x8145('0xa')]=0x0;this[_0x8145('0xb')]=![];this['answertime']=null;this[_0x8145('0xc')]=null;this['unmanaged']=![];this['abandoned']=![];this['lastapplication']='';this[_0x8145('0xd')]='';this['duration']=0x0;this[_0x8145('0xe')]=0x0;this[_0x8145('0xf')]=0x0;this['type']=null;this[_0x8145('0x10')]=null;this[_0x8145('0x11')]=null;this[_0x8145('0x12')]=![];this[_0x8145('0x13')]=null;this[_0x8145('0x14')]=null;this['monitors']=[];this[_0x8145('0x15')]=undefined;this[_0x8145('0x16')]=undefined;this[_0x8145('0x17')]=0x0;}module['exports']=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index fd336f8..2b4a3ae 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 _0xed95=['serverUrl','Configurations','exports','name','username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type'];(function(_0x13d07a,_0x41efc3){var _0x5ee0ee=function(_0x4ca94a){while(--_0x4ca94a){_0x13d07a['push'](_0x13d07a['shift']());}};_0x5ee0ee(++_0x41efc3);}(_0xed95,0xb9));var _0x5ed9=function(_0xedd27b,_0xc6d48d){_0xedd27b=_0xedd27b-0x0;var _0x480e24=_0xed95[_0xedd27b];return _0x480e24;};'use strict';function DeskAccount(_0x46e33a){this['id']=_0x46e33a['id']||0x0;this[_0x5ed9('0x0')]=_0x46e33a[_0x5ed9('0x0')]||'';this[_0x5ed9('0x1')]=_0x46e33a[_0x5ed9('0x1')]||'';this[_0x5ed9('0x2')]=_0x46e33a[_0x5ed9('0x2')]||'';this[_0x5ed9('0x3')]=_0x46e33a[_0x5ed9('0x3')]||'';this[_0x5ed9('0x4')]=_0x46e33a[_0x5ed9('0x4')]||'';this[_0x5ed9('0x5')]=_0x46e33a['consumerKey']||'';this['consumerSecret']=_0x46e33a[_0x5ed9('0x6')]||'';this[_0x5ed9('0x7')]=_0x46e33a[_0x5ed9('0x7')]||'';this[_0x5ed9('0x8')]=_0x46e33a[_0x5ed9('0x8')]||'';this[_0x5ed9('0x9')]=_0x46e33a['type']||'';this['serverUrl']=_0x46e33a[_0x5ed9('0xa')]||'';this[_0x5ed9('0xb')]=_0x46e33a[_0x5ed9('0xb')]||{};}module[_0x5ed9('0xc')]=DeskAccount; \ No newline at end of file +var _0x57cf=['authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name','username','remoteUri'];(function(_0x4b8d23,_0x28d6ee){var _0x1762bf=function(_0x4257ee){while(--_0x4257ee){_0x4b8d23['push'](_0x4b8d23['shift']());}};_0x1762bf(++_0x28d6ee);}(_0x57cf,0x11b));var _0xf57c=function(_0x3f4ba6,_0x133cd6){_0x3f4ba6=_0x3f4ba6-0x0;var _0x4fa5a3=_0x57cf[_0x3f4ba6];return _0x4fa5a3;};'use strict';function DeskAccount(_0x50728d){this['id']=_0x50728d['id']||0x0;this[_0xf57c('0x0')]=_0x50728d[_0xf57c('0x0')]||'';this[_0xf57c('0x1')]=_0x50728d[_0xf57c('0x1')]||'';this[_0xf57c('0x2')]=_0x50728d[_0xf57c('0x2')]||'';this[_0xf57c('0x3')]=_0x50728d[_0xf57c('0x3')]||'';this[_0xf57c('0x4')]=_0x50728d['password']||'';this[_0xf57c('0x5')]=_0x50728d['consumerKey']||'';this[_0xf57c('0x6')]=_0x50728d['consumerSecret']||'';this['token']=_0x50728d[_0xf57c('0x7')]||'';this['tokenSecret']=_0x50728d[_0xf57c('0x8')]||'';this[_0xf57c('0x9')]=_0x50728d['type']||'';this['serverUrl']=_0x50728d[_0xf57c('0xa')]||'';this[_0xf57c('0xb')]=_0x50728d[_0xf57c('0xb')]||{};}module[_0xf57c('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index 7f1290c..287dd2b 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 _0x0752=['tenantId','clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri'];(function(_0x4bf06d,_0x3a4028){var _0x5850b3=function(_0x452202){while(--_0x452202){_0x4bf06d['push'](_0x4bf06d['shift']());}};_0x5850b3(++_0x3a4028);}(_0x0752,0x178));var _0x2075=function(_0x296d87,_0x2a52be){_0x296d87=_0x296d87-0x0;var _0x398fce=_0x0752[_0x296d87];return _0x398fce;};'use strict';function Dynamics365Account(_0x552a5f){this['id']=_0x552a5f['id']||0x0;this[_0x2075('0x0')]=_0x552a5f[_0x2075('0x0')]||'';this['username']=_0x552a5f[_0x2075('0x1')]||'';this[_0x2075('0x2')]=_0x552a5f[_0x2075('0x2')]||'';this[_0x2075('0x3')]=_0x552a5f[_0x2075('0x3')]||'';this[_0x2075('0x4')]=_0x552a5f[_0x2075('0x4')]||'';this[_0x2075('0x5')]=_0x552a5f[_0x2075('0x5')]||'';this[_0x2075('0x6')]=_0x552a5f['clientSecret']||{};this[_0x2075('0x7')]=_0x552a5f[_0x2075('0x7')]||'';this[_0x2075('0x8')]=_0x552a5f['Configurations']||{};}module[_0x2075('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x9b35=['Configurations','exports','name','username','password','remoteUri','tenantId','clientSecret','serverUrl'];(function(_0x1c4cd1,_0x447f9d){var _0x53e576=function(_0x57e80b){while(--_0x57e80b){_0x1c4cd1['push'](_0x1c4cd1['shift']());}};_0x53e576(++_0x447f9d);}(_0x9b35,0xf5));var _0x59b3=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x9b35[_0x502c7d];return _0x30b7ed;};'use strict';function Dynamics365Account(_0x32a3ae){this['id']=_0x32a3ae['id']||0x0;this[_0x59b3('0x0')]=_0x32a3ae[_0x59b3('0x0')]||'';this[_0x59b3('0x1')]=_0x32a3ae['username']||'';this['password']=_0x32a3ae[_0x59b3('0x2')]||'';this[_0x59b3('0x3')]=_0x32a3ae[_0x59b3('0x3')]||'';this[_0x59b3('0x4')]=_0x32a3ae[_0x59b3('0x4')]||'';this['clientId']=_0x32a3ae['clientId']||'';this[_0x59b3('0x5')]=_0x32a3ae[_0x59b3('0x5')]||{};this['serverUrl']=_0x32a3ae[_0x59b3('0x6')]||'';this['Configurations']=_0x32a3ae[_0x59b3('0x7')]||{};}module[_0x59b3('0x8')]=Dynamics365Account; \ No newline at end of file diff --git a/server/services/ami/model/faxAccount.js b/server/services/ami/model/faxAccount.js index 683a624..b1df788 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 _0x99e7=['maxrate','modem','v17,v27,v29','gateway','faxdetect','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','minrate'];(function(_0x47408e,_0x481428){var _0x1636bc=function(_0x2fe7a6){while(--_0x2fe7a6){_0x47408e['push'](_0x47408e['shift']());}};_0x1636bc(++_0x481428);}(_0x99e7,0x1b5));var _0x799e=function(_0x256e32,_0x4013bc){_0x256e32=_0x256e32-0x0;var _0x464070=_0x99e7[_0x256e32];return _0x464070;};'use strict';function FaxAccount(_0x1dd83b){this['id']=_0x1dd83b['id']||0x0;this[_0x799e('0x0')]=_0x1dd83b[_0x799e('0x0')]||'';this[_0x799e('0x1')]=_0x1dd83b[_0x799e('0x1')];this[_0x799e('0x2')]=_0x1dd83b[_0x799e('0x2')];this[_0x799e('0x3')]=_0x1dd83b[_0x799e('0x3')];this['localstationid']=_0x1dd83b['localstationid'];this[_0x799e('0x4')]=_0x1dd83b['minrate']||0x960;this[_0x799e('0x5')]=_0x1dd83b['maxrate']||0x3840;this[_0x799e('0x6')]=_0x1dd83b[_0x799e('0x6')]||_0x799e('0x7');this[_0x799e('0x8')]=_0x1dd83b[_0x799e('0x8')]||'no';this['faxdetect']=_0x1dd83b[_0x799e('0x9')]||'no';this[_0x799e('0xa')]=_0x1dd83b[_0x799e('0xa')]||0x1388;this[_0x799e('0xb')]=_0x1dd83b['tech']||_0x799e('0xc');this[_0x799e('0xd')]=_0x1dd83b[_0x799e('0xd')]?_0x1dd83b[_0x799e('0xd')]:undefined;this[_0x799e('0xe')]=_0x1dd83b[_0x799e('0xe')];this[_0x799e('0xf')]=_0x1dd83b['key'];}module[_0x799e('0x10')]=FaxAccount; \ No newline at end of file +var _0x26b0=['gateway','t38timeout','tech','SIP','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','v17,v27,v29'];(function(_0x4cb9d9,_0x33d790){var _0x4d8331=function(_0x5735b8){while(--_0x5735b8){_0x4cb9d9['push'](_0x4cb9d9['shift']());}};_0x4d8331(++_0x33d790);}(_0x26b0,0x138));var _0x026b=function(_0x3e1122,_0x1c458a){_0x3e1122=_0x3e1122-0x0;var _0x3da9a2=_0x26b0[_0x3e1122];return _0x3da9a2;};'use strict';function FaxAccount(_0xa27d1e){this['id']=_0xa27d1e['id']||0x0;this[_0x026b('0x0')]=_0xa27d1e[_0x026b('0x0')]||'';this[_0x026b('0x1')]=_0xa27d1e[_0x026b('0x1')];this[_0x026b('0x2')]=_0xa27d1e['ecm'];this[_0x026b('0x3')]=_0xa27d1e[_0x026b('0x3')];this[_0x026b('0x4')]=_0xa27d1e[_0x026b('0x4')];this[_0x026b('0x5')]=_0xa27d1e['minrate']||0x960;this[_0x026b('0x6')]=_0xa27d1e['maxrate']||0x3840;this['modem']=_0xa27d1e['modem']||_0x026b('0x7');this[_0x026b('0x8')]=_0xa27d1e[_0x026b('0x8')]||'no';this['faxdetect']=_0xa27d1e['faxdetect']||'no';this[_0x026b('0x9')]=_0xa27d1e[_0x026b('0x9')]||0x1388;this[_0x026b('0xa')]=_0xa27d1e['tech']||_0x026b('0xb');this[_0x026b('0xc')]=_0xa27d1e[_0x026b('0xc')]?_0xa27d1e[_0x026b('0xc')]:undefined;this['ListId']=_0xa27d1e[_0x026b('0xd')];this[_0x026b('0xe')]=_0xa27d1e[_0x026b('0xe')];}module[_0x026b('0xf')]=FaxAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshdeskAccount.js b/server/services/ami/model/freshdeskAccount.js index ccfa146..3de90c5 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 _0x0db3=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x3d657e,_0xbc67c3){var _0x203b4c=function(_0x393014){while(--_0x393014){_0x3d657e['push'](_0x3d657e['shift']());}};_0x203b4c(++_0xbc67c3);}(_0x0db3,0x6f));var _0x30db=function(_0x31f6b5,_0x5e93d0){_0x31f6b5=_0x31f6b5-0x0;var _0x1e5c6a=_0x0db3[_0x31f6b5];return _0x1e5c6a;};'use strict';function FreshdeskAccount(_0x31ce6f){this['id']=_0x31ce6f['id']||0x0;this[_0x30db('0x0')]=_0x31ce6f['name']||'';this[_0x30db('0x1')]=_0x31ce6f[_0x30db('0x1')]||'';this[_0x30db('0x2')]=_0x31ce6f[_0x30db('0x3')]||'';this[_0x30db('0x4')]=_0x31ce6f[_0x30db('0x4')]||'';this['serverUrl']=_0x31ce6f[_0x30db('0x5')]||'';this[_0x30db('0x6')]=_0x31ce6f[_0x30db('0x6')]||{};}module[_0x30db('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0x80c8=['Configurations','exports','name','username','token','remoteUri','serverUrl'];(function(_0x461c41,_0x2e6d1c){var _0x509e12=function(_0x245f5d){while(--_0x245f5d){_0x461c41['push'](_0x461c41['shift']());}};_0x509e12(++_0x2e6d1c);}(_0x80c8,0xd4));var _0x880c=function(_0x4a140c,_0x4a3574){_0x4a140c=_0x4a140c-0x0;var _0x154ab1=_0x80c8[_0x4a140c];return _0x154ab1;};'use strict';function FreshdeskAccount(_0x5240d4){this['id']=_0x5240d4['id']||0x0;this['name']=_0x5240d4[_0x880c('0x0')]||'';this[_0x880c('0x1')]=_0x5240d4[_0x880c('0x1')]||'';this['apiKey']=_0x5240d4[_0x880c('0x2')]||'';this[_0x880c('0x3')]=_0x5240d4['remoteUri']||'';this[_0x880c('0x4')]=_0x5240d4['serverUrl']||'';this[_0x880c('0x5')]=_0x5240d4[_0x880c('0x5')]||{};}module[_0x880c('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 84a9d34..95f6e7a 100644 --- a/server/services/ami/model/freshsalesAccount.js +++ b/server/services/ami/model/freshsalesAccount.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x16ea=['token','remoteUri','serverUrl','Configurations','exports','name','username','apiKey'];(function(_0x48db56,_0x38d7c6){var _0x1e42e5=function(_0x490cb4){while(--_0x490cb4){_0x48db56['push'](_0x48db56['shift']());}};_0x1e42e5(++_0x38d7c6);}(_0x16ea,0x15d));var _0xa16e=function(_0x175b12,_0x39591a){_0x175b12=_0x175b12-0x0;var _0x43a7cb=_0x16ea[_0x175b12];return _0x43a7cb;};'use strict';function FreshsalesAccount(_0x4710b6){this['id']=_0x4710b6['id']||0x0;this[_0xa16e('0x0')]=_0x4710b6[_0xa16e('0x0')]||'';this[_0xa16e('0x1')]=_0x4710b6['username']||'';this[_0xa16e('0x2')]=_0x4710b6[_0xa16e('0x3')]||'';this[_0xa16e('0x4')]=_0x4710b6[_0xa16e('0x4')]||'';this[_0xa16e('0x5')]=_0x4710b6[_0xa16e('0x5')]||'';this[_0xa16e('0x6')]=_0x4710b6[_0xa16e('0x6')]||{};}module[_0xa16e('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xfe67=['remoteUri','serverUrl','Configurations','name','username','apiKey','token'];(function(_0x46f04f,_0x458e2c){var _0x46615b=function(_0x4d7591){while(--_0x4d7591){_0x46f04f['push'](_0x46f04f['shift']());}};_0x46615b(++_0x458e2c);}(_0xfe67,0x88));var _0x7fe6=function(_0x56dd7c,_0x3a82fd){_0x56dd7c=_0x56dd7c-0x0;var _0x475cdb=_0xfe67[_0x56dd7c];return _0x475cdb;};'use strict';function FreshsalesAccount(_0x3dcc2c){this['id']=_0x3dcc2c['id']||0x0;this[_0x7fe6('0x0')]=_0x3dcc2c[_0x7fe6('0x0')]||'';this[_0x7fe6('0x1')]=_0x3dcc2c['username']||'';this[_0x7fe6('0x2')]=_0x3dcc2c[_0x7fe6('0x3')]||'';this[_0x7fe6('0x4')]=_0x3dcc2c[_0x7fe6('0x4')]||'';this[_0x7fe6('0x5')]=_0x3dcc2c[_0x7fe6('0x5')]||'';this['Configurations']=_0x3dcc2c[_0x7fe6('0x6')]||{};}module['exports']=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index b274b8b..0f29f5e 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 _0x8fa5=['queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten','priority','holdtime','assigned','lastAssignedTo','mohtime','variables','type','inbound','uniqueid','calleridnum','queue','position','queuecallerabandon','queuecallercomplete'];(function(_0x56b3f5,_0x16a91c){var _0x33e487=function(_0x10042e){while(--_0x10042e){_0x56b3f5['push'](_0x56b3f5['shift']());}};_0x33e487(++_0x16a91c);}(_0x8fa5,0xb0));var _0x58fa=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8fa5[_0x3dd15e];return _0x231fd0;};'use strict';function QueueReport(){this[_0x58fa('0x0')]=_0x58fa('0x1');this[_0x58fa('0x2')]='';this[_0x58fa('0x3')]='';this['calleridname']='';this[_0x58fa('0x4')]='';this['queuecallerjoinAt']=null;this['queuecallerleaveAt']=null;this[_0x58fa('0x5')]=0x1;this['count']=0x1;this[_0x58fa('0x6')]=![];this['queuecallerabandonAt']=null;this[_0x58fa('0x7')]=![];this[_0x58fa('0x8')]=null;this[_0x58fa('0x9')]=![];this[_0x58fa('0xa')]=null;this[_0x58fa('0xb')]=0x1;this[_0x58fa('0xc')]='';this[_0x58fa('0xd')]='';this['connectedlinename']='';this[_0x58fa('0xe')]='';this[_0x58fa('0xf')]='';this[_0x58fa('0x10')]='';this[_0x58fa('0x11')]='';this[_0x58fa('0x12')]=0x0;this[_0x58fa('0x13')]=![];this[_0x58fa('0x14')]='';this[_0x58fa('0x15')]=0x0;this[_0x58fa('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0xbe5e=['queuecallerabandonAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','connectedlinename','accountcode','context','holdtime','assigned','mohtime','variables','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count'];(function(_0x4c7e9b,_0x291fbd){var _0x1f88c0=function(_0x352c17){while(--_0x352c17){_0x4c7e9b['push'](_0x4c7e9b['shift']());}};_0x1f88c0(++_0x291fbd);}(_0xbe5e,0x81));var _0xebe5=function(_0x57f7fc,_0x472d71){_0x57f7fc=_0x57f7fc-0x0;var _0x19ef99=_0xbe5e[_0x57f7fc];return _0x19ef99;};'use strict';function QueueReport(){this[_0xebe5('0x0')]=_0xebe5('0x1');this['uniqueid']='';this[_0xebe5('0x2')]='';this[_0xebe5('0x3')]='';this[_0xebe5('0x4')]='';this[_0xebe5('0x5')]=null;this[_0xebe5('0x6')]=null;this[_0xebe5('0x7')]=0x1;this[_0xebe5('0x8')]=0x1;this['queuecallerabandon']=![];this[_0xebe5('0x9')]=null;this['queuecallercomplete']=![];this[_0xebe5('0xa')]=null;this[_0xebe5('0xb')]=![];this[_0xebe5('0xc')]=null;this[_0xebe5('0xd')]=0x1;this[_0xebe5('0xe')]='';this[_0xebe5('0xf')]='';this[_0xebe5('0x10')]='';this[_0xebe5('0x11')]='';this[_0xebe5('0x12')]='';this['exten']='';this['priority']='';this[_0xebe5('0x13')]=0x0;this[_0xebe5('0x14')]=![];this['lastAssignedTo']='';this[_0xebe5('0x15')]=0x0;this[_0xebe5('0x16')]={};}module['exports']=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 6968213..1baf2ad 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 _0x1de6=['clientSecret','securityToken','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x338478,_0x1bcfa9){var _0x507bd9=function(_0x580655){while(--_0x580655){_0x338478['push'](_0x338478['shift']());}};_0x507bd9(++_0x1bcfa9);}(_0x1de6,0xbb));var _0x61de=function(_0x4e61bc,_0x1cff51){_0x4e61bc=_0x4e61bc-0x0;var _0x4e0fb1=_0x1de6[_0x4e61bc];return _0x4e0fb1;};'use strict';function SalesforceAccount(_0xf5d860){this['id']=_0xf5d860['id']||0x0;this[_0x61de('0x0')]=_0xf5d860[_0x61de('0x0')]||'';this[_0x61de('0x1')]=_0xf5d860['username']||'';this[_0x61de('0x2')]=_0xf5d860['remoteUri']||'';this[_0x61de('0x3')]=_0xf5d860[_0x61de('0x3')]||'';this[_0x61de('0x4')]=_0xf5d860[_0x61de('0x4')]||'';this['clientSecret']=_0xf5d860[_0x61de('0x5')]||'';this[_0x61de('0x6')]=_0xf5d860[_0x61de('0x6')]||'';this['type']=_0xf5d860[_0x61de('0x7')]||_0x61de('0x8');this[_0x61de('0x9')]=_0xf5d860[_0x61de('0x9')]||'';this[_0x61de('0xa')]=_0xf5d860[_0x61de('0xa')]||{};}module[_0x61de('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x8556=['username','remoteUri','password','clientId','clientSecret','securityToken','type','serverUrl','Configurations','exports','name'];(function(_0x5ad00b,_0x22c334){var _0x2aab79=function(_0x999352){while(--_0x999352){_0x5ad00b['push'](_0x5ad00b['shift']());}};_0x2aab79(++_0x22c334);}(_0x8556,0x11d));var _0x6855=function(_0x5e6aad,_0x3cdddd){_0x5e6aad=_0x5e6aad-0x0;var _0x55deab=_0x8556[_0x5e6aad];return _0x55deab;};'use strict';function SalesforceAccount(_0x447fe7){this['id']=_0x447fe7['id']||0x0;this['name']=_0x447fe7[_0x6855('0x0')]||'';this[_0x6855('0x1')]=_0x447fe7[_0x6855('0x1')]||'';this[_0x6855('0x2')]=_0x447fe7['remoteUri']||'';this[_0x6855('0x3')]=_0x447fe7[_0x6855('0x3')]||'';this[_0x6855('0x4')]=_0x447fe7[_0x6855('0x4')]||'';this[_0x6855('0x5')]=_0x447fe7['clientSecret']||'';this[_0x6855('0x6')]=_0x447fe7[_0x6855('0x6')]||'';this[_0x6855('0x7')]=_0x447fe7['type']||'integrationTab';this[_0x6855('0x8')]=_0x447fe7[_0x6855('0x8')]||'';this[_0x6855('0x9')]=_0x447fe7[_0x6855('0x9')]||{};}module[_0x6855('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 4a48e7a..98cdedb 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 _0x44f3=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5d2049,_0x411057){var _0x127bd4=function(_0x1b4253){while(--_0x1b4253){_0x5d2049['push'](_0x5d2049['shift']());}};_0x127bd4(++_0x411057);}(_0x44f3,0x7d));var _0x344f=function(_0xbbba1b,_0x5400d0){_0xbbba1b=_0xbbba1b-0x0;var _0x3d8a0f=_0x44f3[_0xbbba1b];return _0x3d8a0f;};'use strict';function ServicenowAccount(_0x1c21ff){this['id']=_0x1c21ff['id']||0x0;this['name']=_0x1c21ff[_0x344f('0x0')]||'';this['username']=_0x1c21ff[_0x344f('0x1')]||'';this[_0x344f('0x2')]=_0x1c21ff['password']||'';this[_0x344f('0x3')]=_0x1c21ff[_0x344f('0x3')]||'';this[_0x344f('0x4')]=_0x1c21ff[_0x344f('0x4')]||'';this[_0x344f('0x5')]=_0x1c21ff[_0x344f('0x5')]||{};}module[_0x344f('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xbe01=['exports','name','username','password','remoteUri','serverUrl','Configurations'];(function(_0x467018,_0xa117e){var _0x5d5c5c=function(_0x26aa59){while(--_0x26aa59){_0x467018['push'](_0x467018['shift']());}};_0x5d5c5c(++_0xa117e);}(_0xbe01,0x104));var _0x1be0=function(_0xa148b7,_0x2f3eb2){_0xa148b7=_0xa148b7-0x0;var _0x51efd3=_0xbe01[_0xa148b7];return _0x51efd3;};'use strict';function ServicenowAccount(_0x12af36){this['id']=_0x12af36['id']||0x0;this[_0x1be0('0x0')]=_0x12af36['name']||'';this[_0x1be0('0x1')]=_0x12af36[_0x1be0('0x1')]||'';this[_0x1be0('0x2')]=_0x12af36[_0x1be0('0x2')]||'';this[_0x1be0('0x3')]=_0x12af36[_0x1be0('0x3')]||'';this['serverUrl']=_0x12af36[_0x1be0('0x4')]||'';this[_0x1be0('0x5')]=_0x12af36[_0x1be0('0x5')]||{};}module[_0x1be0('0x6')]=ServicenowAccount; \ No newline at end of file diff --git a/server/services/ami/model/sugarcrmAccount.js b/server/services/ami/model/sugarcrmAccount.js index 0d81a29..7e74cb0 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 _0xb5af=['password','remoteUri','serverUrl','Configurations','exports','name','username'];(function(_0xdbf69c,_0x11f2e6){var _0x3545da=function(_0xd3d701){while(--_0xd3d701){_0xdbf69c['push'](_0xdbf69c['shift']());}};_0x3545da(++_0x11f2e6);}(_0xb5af,0x10f));var _0xfb5a=function(_0x566eec,_0x4c3ce9){_0x566eec=_0x566eec-0x0;var _0x5b0e9e=_0xb5af[_0x566eec];return _0x5b0e9e;};'use strict';function SugarcrmAccount(_0x37ae1c){this['id']=_0x37ae1c['id']||0x0;this[_0xfb5a('0x0')]=_0x37ae1c[_0xfb5a('0x0')]||'';this[_0xfb5a('0x1')]=_0x37ae1c[_0xfb5a('0x1')]||'';this[_0xfb5a('0x2')]=_0x37ae1c['password']||'';this[_0xfb5a('0x3')]=_0x37ae1c['remoteUri']||'';this['serverUrl']=_0x37ae1c[_0xfb5a('0x4')]||'';this['Configurations']=_0x37ae1c[_0xfb5a('0x5')]||{};}module[_0xfb5a('0x6')]=SugarcrmAccount; \ No newline at end of file +var _0x0835=['name','username','password','remoteUri','serverUrl','Configurations','exports'];(function(_0x4fb797,_0x200ee6){var _0x34e096=function(_0x2c0f40){while(--_0x2c0f40){_0x4fb797['push'](_0x4fb797['shift']());}};_0x34e096(++_0x200ee6);}(_0x0835,0x149));var _0x5083=function(_0x441217,_0x4b4842){_0x441217=_0x441217-0x0;var _0x51c6a0=_0x0835[_0x441217];return _0x51c6a0;};'use strict';function SugarcrmAccount(_0x21e924){this['id']=_0x21e924['id']||0x0;this[_0x5083('0x0')]=_0x21e924[_0x5083('0x0')]||'';this['username']=_0x21e924[_0x5083('0x1')]||'';this[_0x5083('0x2')]=_0x21e924['password']||'';this['remoteUri']=_0x21e924[_0x5083('0x3')]||'';this[_0x5083('0x4')]=_0x21e924[_0x5083('0x4')]||'';this['Configurations']=_0x21e924[_0x5083('0x5')]||{};}module[_0x5083('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index d0832f6..1a1c0e8 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 _0x587e=['name','accountcode','state','unknown','stateTime','status','address'];(function(_0x36c9fb,_0x307935){var _0x818f0a=function(_0x1f6882){while(--_0x1f6882){_0x36c9fb['push'](_0x36c9fb['shift']());}};_0x818f0a(++_0x307935);}(_0x587e,0x157));var _0xe587=function(_0x467410,_0x1f3d5f){_0x467410=_0x467410-0x0;var _0x414d75=_0x587e[_0x467410];return _0x414d75;};'use strict';function Telephone(_0x2bda73){this['id']=_0x2bda73['id']||0x0;this[_0xe587('0x0')]=_0x2bda73[_0xe587('0x0')]||'';this[_0xe587('0x1')]=_0x2bda73['accountcode']||'';this[_0xe587('0x2')]=_0xe587('0x3');this[_0xe587('0x4')]=0x0;this[_0xe587('0x5')]=_0xe587('0x3');this[_0xe587('0x6')]='';}module['exports']=Telephone; \ No newline at end of file +var _0xc45c=['exports','name','accountcode','state','unknown','address'];(function(_0x4b6ba8,_0x3a9ff0){var _0x1960e1=function(_0x37e815){while(--_0x37e815){_0x4b6ba8['push'](_0x4b6ba8['shift']());}};_0x1960e1(++_0x3a9ff0);}(_0xc45c,0x9d));var _0xcc45=function(_0xf06e8d,_0x27a148){_0xf06e8d=_0xf06e8d-0x0;var _0xbf98fc=_0xc45c[_0xf06e8d];return _0xbf98fc;};'use strict';function Telephone(_0x4e0f93){this['id']=_0x4e0f93['id']||0x0;this[_0xcc45('0x0')]=_0x4e0f93[_0xcc45('0x0')]||'';this[_0xcc45('0x1')]=_0x4e0f93['accountcode']||'';this[_0xcc45('0x2')]=_0xcc45('0x3');this['stateTime']=0x0;this['status']='unknown';this[_0xcc45('0x4')]='';}module[_0xcc45('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 3dabfd9..fbbc19c 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 _0x89ec=['name','html','exports'];(function(_0x134c2e,_0x3573c4){var _0x2825db=function(_0x2a574d){while(--_0x2a574d){_0x134c2e['push'](_0x134c2e['shift']());}};_0x2825db(++_0x3573c4);}(_0x89ec,0x1e0));var _0xc89e=function(_0x5c62cc,_0x4b379b){_0x5c62cc=_0x5c62cc-0x0;var _0x120118=_0x89ec[_0x5c62cc];return _0x120118;};'use strict';function template(_0x34dda4){this['id']=_0x34dda4['id']||0x0;this[_0xc89e('0x0')]=_0x34dda4[_0xc89e('0x0')]||'';this[_0xc89e('0x1')]=_0x34dda4[_0xc89e('0x1')]||'';}module[_0xc89e('0x2')]=template; \ No newline at end of file +var _0xbecd=['exports','name','html'];(function(_0x2fcd6e,_0xc2f135){var _0x7789a3=function(_0x2ea41b){while(--_0x2ea41b){_0x2fcd6e['push'](_0x2fcd6e['shift']());}};_0x7789a3(++_0xc2f135);}(_0xbecd,0x6a));var _0xdbec=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbecd[_0x20a584];return _0x4b41a8;};'use strict';function template(_0x4944f4){this['id']=_0x4944f4['id']||0x0;this['name']=_0x4944f4[_0xdbec('0x0')]||'';this[_0xdbec('0x1')]=_0x4944f4['html']||'';}module[_0xdbec('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index d22b432..db5f0b1 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 _0x4b84=['name','channel','status','AllConditions','Actions'];(function(_0xb74107,_0x21eb03){var _0x50074b=function(_0x1b8d90){while(--_0x1b8d90){_0xb74107['push'](_0xb74107['shift']());}};_0x50074b(++_0x21eb03);}(_0x4b84,0x1cc));var _0x44b8=function(_0x4e0a03,_0x5eb6b0){_0x4e0a03=_0x4e0a03-0x0;var _0x2478fc=_0x4b84[_0x4e0a03];return _0x2478fc;};'use strict';function Trigger(_0x90ff31){this['id']=_0x90ff31['id']||0x0;this[_0x44b8('0x0')]=_0x90ff31['name']||'';this['channel']=_0x90ff31[_0x44b8('0x1')]||'voice';this['status']=_0x90ff31[_0x44b8('0x2')]||![];this[_0x44b8('0x3')]=_0x90ff31[_0x44b8('0x3')]||[];this['AnyConditions']=_0x90ff31['AnyConditions']||[];this['Actions']=_0x90ff31[_0x44b8('0x4')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0x3a0c27,_0x3a3361){var _0x243b74=function(_0x7d8856){while(--_0x7d8856){_0x3a0c27['push'](_0x3a0c27['shift']());}};_0x243b74(++_0x3a3361);}(_0xa41a,0x6b));var _0xaa41=function(_0x53f09b,_0x27b964){_0x53f09b=_0x53f09b-0x0;var _0x4fd54f=_0xa41a[_0x53f09b];return _0x4fd54f;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index 1a5edcd..ea76dc6 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 _0x6153=['port','domain','refresh','registrationtime','active','name','state','status','unknown','registry','indexOf','split','host'];(function(_0x30d2cf,_0x26f2db){var _0x1b4a6a=function(_0x3e6800){while(--_0x3e6800){_0x30d2cf['push'](_0x30d2cf['shift']());}};_0x1b4a6a(++_0x26f2db);}(_0x6153,0x6c));var _0x3615=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6153[_0x122ef9];return _0x42fba0;};'use strict';function Trunk(_0xa79bf2){this['id']=_0xa79bf2['id']||0x0;this[_0x3615('0x0')]=_0xa79bf2[_0x3615('0x0')]||![];this[_0x3615('0x1')]=_0xa79bf2[_0x3615('0x1')]||'';this[_0x3615('0x2')]='unknown';this['stateTime']=0x0;this[_0x3615('0x3')]=_0x3615('0x4');this['registry']=_0xa79bf2[_0x3615('0x5')]&&_0xa79bf2[_0x3615('0x5')][_0x3615('0x6')](':')?_0xa79bf2[_0x3615('0x5')][_0x3615('0x7')](':')[0x0]:'';this[_0x3615('0x8')]='';this[_0x3615('0x9')]='';this[_0x3615('0xa')]='';this['domainport']='';this[_0x3615('0xb')]='';this['stateRegistry']=_0x3615('0x4');this[_0x3615('0xc')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file +var _0x05b3=['refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime','status','registry','indexOf','split','host','port','domain','domainport'];(function(_0x7740e4,_0x303da0){var _0x59b2f4=function(_0x325f25){while(--_0x325f25){_0x7740e4['push'](_0x7740e4['shift']());}};_0x59b2f4(++_0x303da0);}(_0x05b3,0x95));var _0x305b=function(_0x260f28,_0x4e9b30){_0x260f28=_0x260f28-0x0;var _0x3aefcc=_0x05b3[_0x260f28];return _0x3aefcc;};'use strict';function Trunk(_0x14051c){this['id']=_0x14051c['id']||0x0;this['active']=_0x14051c[_0x305b('0x0')]||![];this['name']=_0x14051c[_0x305b('0x1')]||'';this[_0x305b('0x2')]=_0x305b('0x3');this[_0x305b('0x4')]=0x0;this[_0x305b('0x5')]=_0x305b('0x3');this[_0x305b('0x6')]=_0x14051c[_0x305b('0x6')]&&_0x14051c[_0x305b('0x6')][_0x305b('0x7')](':')?_0x14051c[_0x305b('0x6')][_0x305b('0x8')](':')[0x0]:'';this[_0x305b('0x9')]='';this[_0x305b('0xa')]='';this[_0x305b('0xb')]='';this[_0x305b('0xc')]='';this[_0x305b('0xd')]='';this[_0x305b('0xe')]=_0x305b('0x3');this[_0x305b('0xf')]='';this[_0x305b('0x10')]='';}module[_0x305b('0x11')]=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index d0ece34..e915f2c 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 _0xb384=['exten','mandatoryDisposition','exports'];(function(_0x410f16,_0x15cdb6){var _0x574c9=function(_0x13482f){while(--_0x13482f){_0x410f16['push'](_0x410f16['shift']());}};_0x574c9(++_0x15cdb6);}(_0xb384,0xfc));var _0x4b38=function(_0x2d6a2f,_0xf493fe){_0x2d6a2f=_0x2d6a2f-0x0;var _0x4c627f=_0xb384[_0x2d6a2f];return _0x4c627f;};'use strict';function voiceExtension(_0xf6f4de){this['id']=_0xf6f4de['id']||0x0;this['exten']=_0xf6f4de[_0x4b38('0x0')]||'';this['recordingFormat']=_0xf6f4de['recordingFormat']||'none';this[_0x4b38('0x1')]=_0xf6f4de[_0x4b38('0x1')]||![];}module[_0x4b38('0x2')]=voiceExtension; \ No newline at end of file +var _0x0788=['recordingFormat','none','mandatoryDisposition','exports','exten'];(function(_0x531774,_0x7f1a1a){var _0xb8988a=function(_0x3c609e){while(--_0x3c609e){_0x531774['push'](_0x531774['shift']());}};_0xb8988a(++_0x7f1a1a);}(_0x0788,0x11c));var _0x8078=function(_0x496081,_0xb705ed){_0x496081=_0x496081-0x0;var _0x2ac6e9=_0x0788[_0x496081];return _0x2ac6e9;};'use strict';function voiceExtension(_0x43392d){this['id']=_0x43392d['id']||0x0;this[_0x8078('0x0')]=_0x43392d[_0x8078('0x0')]||'';this[_0x8078('0x1')]=_0x43392d['recordingFormat']||_0x8078('0x2');this['mandatoryDisposition']=_0x43392d[_0x8078('0x3')]||![];}module[_0x8078('0x4')]=voiceExtension; \ No newline at end of file diff --git a/server/services/ami/model/voiceQueue.js b/server/services/ami/model/voiceQueue.js index cfe7979..8d85ee6 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 _0xe542=['monitor_format','type','waiting','talking','total','answered','sumBillable','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayACS','outboundReCallsDay','outboundAbandonedDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalHitRate','erlangAbandonmentRate','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','busy','ringing','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name'];(function(_0x4aa03f,_0x53fa76){var _0xee82eb=function(_0x22c3b3){while(--_0x22c3b3){_0x4aa03f['push'](_0x4aa03f['shift']());}};_0xee82eb(++_0x53fa76);}(_0xe542,0x66));var _0x2e54=function(_0x188cc8,_0xd39746){_0x188cc8=_0x188cc8-0x0;var _0x4cb155=_0xe542[_0x188cc8];return _0x4cb155;};'use strict';var statusDesc=[_0x2e54('0x0'),_0x2e54('0x1'),'inuse',_0x2e54('0x2'),'invalid','unavailable',_0x2e54('0x3'),_0x2e54('0x4'),_0x2e54('0x5')];var monitorFormat={'wav':_0x2e54('0x6'),'wav49':_0x2e54('0x7'),'gsm':_0x2e54('0x8')};var strategy={'rrmemory':_0x2e54('0x9'),'roundrobin':_0x2e54('0xa')};function VoiceQueue(_0x2f4cf2){this['id']=_0x2f4cf2['id']||0x0;this[_0x2e54('0xb')]=_0x2f4cf2[_0x2e54('0xb')]||'';this[_0x2e54('0xc')]=_0x2f4cf2[_0x2e54('0xc')]||'';this[_0x2e54('0xd')]=_0x2f4cf2[_0x2e54('0xd')]||'inbound';this[_0x2e54('0xe')]=0x0;this[_0x2e54('0xf')]=0x0;this[_0x2e54('0x10')]=0x0;this[_0x2e54('0x11')]=0x0;this['sumDuration']=0x0;this['sumHoldTime']=0x0;this[_0x2e54('0x12')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x2e54('0x13')]=0x0;this['available']=0x0;this[_0x2e54('0x14')]=_0x2f4cf2[_0x2e54('0x14')]||![];this[_0x2e54('0x15')]=_0x2f4cf2[_0x2e54('0x15')]||0xa;this['autopause']=_0x2f4cf2[_0x2e54('0x16')]||'no';this[_0x2e54('0x17')]=!![];this[_0x2e54('0x18')]='';this['originated']=0x0;this[_0x2e54('0x19')]=0x0;this[_0x2e54('0x1a')]=_0x2f4cf2['dialTimezone']||null;this[_0x2e54('0x1b')]=_0x2f4cf2[_0x2e54('0x1b')]?_0x2f4cf2[_0x2e54('0x1b')]:null;this[_0x2e54('0x1c')]=_0x2f4cf2[_0x2e54('0x1c')];this[_0x2e54('0x1d')]=_0x2f4cf2[_0x2e54('0x1d')]||_0x2e54('0x1e');this[_0x2e54('0x1f')]=_0x2f4cf2[_0x2e54('0x1f')]||0x0;this[_0x2e54('0x20')]=_0x2f4cf2[_0x2e54('0x20')]||0x0;this['dialPowerLevel']=_0x2f4cf2[_0x2e54('0x21')]||0x1;this[_0x2e54('0x22')]=_0x2f4cf2[_0x2e54('0x22')]||_0x2e54('0x23');this[_0x2e54('0x24')]=_0x2f4cf2[_0x2e54('0x24')]||0.03;this[_0x2e54('0x25')]=_0x2f4cf2[_0x2e54('0x25')]||0x258;this[_0x2e54('0x26')]=_0x2f4cf2['dialOriginateCallerIdName']||_0x2e54('0x27');this[_0x2e54('0x28')]=_0x2f4cf2[_0x2e54('0x28')]||_0x2e54('0x27');this[_0x2e54('0x29')]=_0x2f4cf2[_0x2e54('0x29')]||0x1e;this[_0x2e54('0x2a')]=_0x2f4cf2[_0x2e54('0x2a')]||'tTxX';this['dialQueueTimeout']=_0x2f4cf2[_0x2e54('0x2b')]||0x3;this[_0x2e54('0x2c')]=_0x2f4cf2[_0x2e54('0x2c')]||undefined;this['dialCongestionMaxRetry']=_0x2f4cf2[_0x2e54('0x2d')]||0x3;this[_0x2e54('0x2e')]=_0x2f4cf2[_0x2e54('0x2e')]||0x96;this[_0x2e54('0x2f')]=_0x2f4cf2[_0x2e54('0x2f')]||0x3;this['dialBusyRetryFrequency']=_0x2f4cf2[_0x2e54('0x30')]||0x96;this[_0x2e54('0x31')]=_0x2f4cf2[_0x2e54('0x31')]||0x3;this[_0x2e54('0x32')]=_0x2f4cf2[_0x2e54('0x32')]||0x96;this['dialNoSuchNumberMaxRetry']=_0x2f4cf2[_0x2e54('0x33')]||0x3;this['dialNoSuchNumberRetryFrequency']=_0x2f4cf2['dialNoSuchNumberRetryFrequency']||0x96;this[_0x2e54('0x34')]=_0x2f4cf2[_0x2e54('0x34')]||0x3;this[_0x2e54('0x35')]=_0x2f4cf2['dialDropRetryFrequency']||0x96;this[_0x2e54('0x36')]=_0x2f4cf2[_0x2e54('0x36')]||0x3;this[_0x2e54('0x37')]=_0x2f4cf2['dialAbandonedRetryFrequency']||0x96;this['dialMachineMaxRetry']=_0x2f4cf2['dialMachineMaxRetry']||0x3;this[_0x2e54('0x38')]=_0x2f4cf2[_0x2e54('0x38')]||0x96;this['dialAgentRejectMaxRetry']=_0x2f4cf2[_0x2e54('0x39')]||0x3;this['dialAgentRejectRetryFrequency']=_0x2f4cf2[_0x2e54('0x3a')]||0x96;this['dialGlobalMaxRetry']=_0x2f4cf2[_0x2e54('0x3b')]||0x4;this['Trunk']=_0x2f4cf2[_0x2e54('0x3c')]?_0x2f4cf2[_0x2e54('0x3c')]:undefined;this[_0x2e54('0x3d')]=_0x2f4cf2[_0x2e54('0x3d')]?_0x2f4cf2[_0x2e54('0x3d')]:undefined;this[_0x2e54('0x3e')]=_0x2f4cf2[_0x2e54('0x3e')]||undefined;this[_0x2e54('0x3f')]=_0x2f4cf2[_0x2e54('0x3f')]?_0x2f4cf2[_0x2e54('0x3f')]:undefined;this['dialOrderByScheduledAt']=_0x2f4cf2[_0x2e54('0x40')]||_0x2e54('0x41');this[_0x2e54('0x42')]=_0x2f4cf2['dialRandomLastDigitCallerIdNumber']||undefined;this[_0x2e54('0x43')]=_0x2f4cf2[_0x2e54('0x43')]||undefined;this[_0x2e54('0x44')]=strategy[_0x2f4cf2[_0x2e54('0x44')]]||_0x2e54('0x9');this[_0x2e54('0x45')]=!![];this[_0x2e54('0x46')]=_0x2f4cf2[_0x2e54('0x46')]||![];this[_0x2e54('0x47')]=_0x2f4cf2[_0x2e54('0x47')];this[_0x2e54('0x48')]=_0x2f4cf2['dialAMDGreeting'];this[_0x2e54('0x49')]=_0x2f4cf2[_0x2e54('0x49')];this[_0x2e54('0x4a')]=_0x2f4cf2['dialAMDTotalAnalysisTime'];this[_0x2e54('0x4b')]=_0x2f4cf2[_0x2e54('0x4b')];this[_0x2e54('0x4c')]=_0x2f4cf2[_0x2e54('0x4c')];this[_0x2e54('0x4d')]=_0x2f4cf2['dialAMDMaximumNumberOfWords'];this[_0x2e54('0x4e')]=_0x2f4cf2['dialAMDSilenceThreshold'];this[_0x2e54('0x4f')]=_0x2f4cf2['dialAMDMaximumWordLength'];this['outboundRejectCallsDay']=0x0;this[_0x2e54('0x50')]=0x0;this[_0x2e54('0x51')]=_0x2f4cf2[_0x2e54('0x51')];this[_0x2e54('0x52')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0x2e54('0x53')]=0x0;this[_0x2e54('0x54')]=0x0;this[_0x2e54('0x55')]=0x0;this[_0x2e54('0x56')]=0x0;this[_0x2e54('0x57')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x2e54('0x58')]=0x0;this['outboundDropCallsDayCallersExit']=0x0;this[_0x2e54('0x59')]=0x0;this[_0x2e54('0x5a')]=0x0;this[_0x2e54('0x5b')]=0x0;this[_0x2e54('0x5c')]=0x0;this[_0x2e54('0x5d')]=undefined;this[_0x2e54('0x5e')]=undefined;this[_0x2e54('0x5f')]=undefined;this[_0x2e54('0x60')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0x2e54('0x61')]=0x0;this[_0x2e54('0x62')]=0x0;this[_0x2e54('0x63')]=0x0;this[_0x2e54('0x64')]=0x0;this[_0x2e54('0x65')]=0x0;this[_0x2e54('0x66')]=0x0;this['predictiveIntervalAvailable']=0x0;this['predictiveIntervalMaxThreshold']=_0x2f4cf2[_0x2e54('0x67')]||0x14;this[_0x2e54('0x68')]=_0x2f4cf2[_0x2e54('0x67')]||0xa;this[_0x2e54('0x69')]=0x0;this['predictiveIntervalErlangCallsDroppedCalls']=0x0;this[_0x2e54('0x6a')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x2e54('0x6b')]=0x0;this['erlangBusyFactor']=0x0;this['dialRecallMeTimeout']=_0x2f4cf2['dialRecallMeTimeout']||0x1e;this['dialRecallInQueue']=_0x2f4cf2['dialRecallInQueue']||![];this[_0x2e54('0x6c')]=_0x2f4cf2[_0x2e54('0x6c')]||undefined;this[_0x2e54('0x6d')]=_0x2f4cf2[_0x2e54('0x6d')]||![];this[_0x2e54('0x6e')]=_0x2f4cf2['dialAgiAfterHangupAgent']||![];this[_0x2e54('0xc')]=monitorFormat[_0x2f4cf2[_0x2e54('0xc')]]?monitorFormat[_0x2f4cf2[_0x2e54('0xc')]]:undefined;this['mandatoryDisposition']=_0x2f4cf2[_0x2e54('0x6f')]||![];this[_0x2e54('0x70')]=_0x2f4cf2[_0x2e54('0x70')]?_0x2f4cf2[_0x2e54('0x70')]:undefined;}module[_0x2e54('0x71')]=VoiceQueue; \ No newline at end of file +var _0x8fde=['waiting','total','answered','sumHoldTime','abandoned','loggedIn','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dropRate','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropMaxRetry','dialDropRetryFrequency','dialAbandonedMaxRetry','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundAbandonedDay','startPredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalAvailable','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCalls','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','inuse','busy','invalid','unavailable','ringinuse','onhold','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound'];(function(_0x1f19d9,_0x518651){var _0x355107=function(_0x43f4fb){while(--_0x43f4fb){_0x1f19d9['push'](_0x1f19d9['shift']());}};_0x355107(++_0x518651);}(_0x8fde,0x1d4));var _0xe8fd=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x8fde[_0x1969a7];return _0x3d665f;};'use strict';var statusDesc=[_0xe8fd('0x0'),'not_inuse',_0xe8fd('0x1'),_0xe8fd('0x2'),_0xe8fd('0x3'),_0xe8fd('0x4'),'ringing',_0xe8fd('0x5'),_0xe8fd('0x6')];var monitorFormat={'wav':_0xe8fd('0x7'),'wav49':_0xe8fd('0x8'),'gsm':_0xe8fd('0x9')};var strategy={'rrmemory':_0xe8fd('0xa'),'roundrobin':_0xe8fd('0xb')};function VoiceQueue(_0x250fda){this['id']=_0x250fda['id']||0x0;this[_0xe8fd('0xc')]=_0x250fda[_0xe8fd('0xc')]||'';this[_0xe8fd('0xd')]=_0x250fda['monitor_format']||'';this[_0xe8fd('0xe')]=_0x250fda[_0xe8fd('0xe')]||_0xe8fd('0xf');this[_0xe8fd('0x10')]=0x0;this['talking']=0x0;this[_0xe8fd('0x11')]=0x0;this[_0xe8fd('0x12')]=0x0;this['sumDuration']=0x0;this[_0xe8fd('0x13')]=0x0;this['sumBillable']=0x0;this['unmanaged']=0x0;this[_0xe8fd('0x14')]=0x0;this[_0xe8fd('0x15')]=0x0;this['available']=0x0;this[_0xe8fd('0x16')]=_0x250fda[_0xe8fd('0x16')]||![];this[_0xe8fd('0x17')]=_0x250fda[_0xe8fd('0x17')]||0xa;this['autopause']=_0x250fda[_0xe8fd('0x18')]||'no';this[_0xe8fd('0x19')]=!![];this[_0xe8fd('0x1a')]='';this[_0xe8fd('0x1b')]=0x0;this[_0xe8fd('0x1c')]=0x0;this['dialTimezone']=_0x250fda[_0xe8fd('0x1d')]||null;this[_0xe8fd('0x1e')]=_0x250fda[_0xe8fd('0x1e')]?_0x250fda[_0xe8fd('0x1e')]:null;this[_0xe8fd('0x1f')]=_0x250fda[_0xe8fd('0x1f')];this[_0xe8fd('0x20')]=_0x250fda['dialMethod']||_0xe8fd('0x21');this['dialLimitChannel']=_0x250fda['dialLimitChannel']||0x0;this[_0xe8fd('0x22')]=_0x250fda['dialLimitQueue']||0x0;this[_0xe8fd('0x23')]=_0x250fda['dialPowerLevel']||0x1;this[_0xe8fd('0x24')]=_0x250fda['dialPredictiveOptimization']||_0xe8fd('0x25');this['dialPredictiveOptimizationPercentage']=_0x250fda[_0xe8fd('0x26')]||0.03;this[_0xe8fd('0x27')]=_0x250fda[_0xe8fd('0x27')]||0x258;this[_0xe8fd('0x28')]=_0x250fda[_0xe8fd('0x28')]||_0xe8fd('0x29');this[_0xe8fd('0x2a')]=_0x250fda[_0xe8fd('0x2a')]||_0xe8fd('0x29');this[_0xe8fd('0x2b')]=_0x250fda[_0xe8fd('0x2b')]||0x1e;this[_0xe8fd('0x2c')]=_0x250fda[_0xe8fd('0x2c')]||_0xe8fd('0x2d');this['dialQueueTimeout']=_0x250fda[_0xe8fd('0x2e')]||0x3;this[_0xe8fd('0x2f')]=_0x250fda[_0xe8fd('0x2f')]||undefined;this[_0xe8fd('0x30')]=_0x250fda[_0xe8fd('0x30')]||0x3;this[_0xe8fd('0x31')]=_0x250fda[_0xe8fd('0x31')]||0x96;this[_0xe8fd('0x32')]=_0x250fda[_0xe8fd('0x32')]||0x3;this[_0xe8fd('0x33')]=_0x250fda[_0xe8fd('0x33')]||0x96;this[_0xe8fd('0x34')]=_0x250fda['dialNoAnswerMaxRetry']||0x3;this[_0xe8fd('0x35')]=_0x250fda[_0xe8fd('0x35')]||0x96;this[_0xe8fd('0x36')]=_0x250fda[_0xe8fd('0x36')]||0x3;this[_0xe8fd('0x37')]=_0x250fda[_0xe8fd('0x37')]||0x96;this[_0xe8fd('0x38')]=_0x250fda[_0xe8fd('0x38')]||0x3;this[_0xe8fd('0x39')]=_0x250fda['dialDropRetryFrequency']||0x96;this['dialAbandonedMaxRetry']=_0x250fda[_0xe8fd('0x3a')]||0x3;this[_0xe8fd('0x3b')]=_0x250fda[_0xe8fd('0x3b')]||0x96;this[_0xe8fd('0x3c')]=_0x250fda[_0xe8fd('0x3c')]||0x3;this[_0xe8fd('0x3d')]=_0x250fda[_0xe8fd('0x3d')]||0x96;this['dialAgentRejectMaxRetry']=_0x250fda[_0xe8fd('0x3e')]||0x3;this[_0xe8fd('0x3f')]=_0x250fda['dialAgentRejectRetryFrequency']||0x96;this[_0xe8fd('0x40')]=_0x250fda['dialGlobalMaxRetry']||0x4;this['Trunk']=_0x250fda[_0xe8fd('0x41')]?_0x250fda['Trunk']:undefined;this[_0xe8fd('0x42')]=_0x250fda['TrunkBackup']?_0x250fda[_0xe8fd('0x42')]:undefined;this['dialPrefix']=_0x250fda[_0xe8fd('0x43')]||undefined;this[_0xe8fd('0x44')]=_0x250fda['Interval']?_0x250fda[_0xe8fd('0x44')]:undefined;this[_0xe8fd('0x45')]=_0x250fda[_0xe8fd('0x45')]||_0xe8fd('0x46');this[_0xe8fd('0x47')]=_0x250fda[_0xe8fd('0x47')]||undefined;this[_0xe8fd('0x48')]=_0x250fda['dialCutDigit']||undefined;this['strategy']=strategy[_0x250fda[_0xe8fd('0x49')]]||_0xe8fd('0xa');this['queueStatusComplete']=!![];this[_0xe8fd('0x4a')]=_0x250fda['dialAMDActive']||![];this[_0xe8fd('0x4b')]=_0x250fda['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x250fda[_0xe8fd('0x4c')];this[_0xe8fd('0x4d')]=_0x250fda[_0xe8fd('0x4d')];this[_0xe8fd('0x4e')]=_0x250fda['dialAMDTotalAnalysisTime'];this[_0xe8fd('0x4f')]=_0x250fda[_0xe8fd('0x4f')];this[_0xe8fd('0x50')]=_0x250fda[_0xe8fd('0x50')];this['dialAMDMaximumNumberOfWords']=_0x250fda[_0xe8fd('0x51')];this[_0xe8fd('0x52')]=_0x250fda['dialAMDSilenceThreshold'];this['dialAMDMaximumWordLength']=_0x250fda['dialAMDMaximumWordLength'];this[_0xe8fd('0x53')]=0x0;this[_0xe8fd('0x54')]=0x0;this['timeout']=_0x250fda[_0xe8fd('0x55')];this[_0xe8fd('0x56')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this[_0xe8fd('0x57')]=0x0;this[_0xe8fd('0x58')]=0x0;this[_0xe8fd('0x59')]=0x0;this[_0xe8fd('0x5a')]=0x0;this[_0xe8fd('0x5b')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xe8fd('0x5c')]=0x0;this[_0xe8fd('0x5d')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xe8fd('0x5e')]=0x0;this['outboundReCallsDay']=0x0;this[_0xe8fd('0x5f')]=0x0;this['startProgressive']=undefined;this[_0xe8fd('0x60')]=undefined;this['handlePredictive']=undefined;this[_0xe8fd('0x61')]=1.05;this[_0xe8fd('0x62')]=0x0;this[_0xe8fd('0x63')]=0x0;this[_0xe8fd('0x64')]=0x0;this[_0xe8fd('0x65')]=0x0;this[_0xe8fd('0x66')]=0x0;this[_0xe8fd('0x67')]=0x0;this['predictiveIntervalPauses']=0x0;this[_0xe8fd('0x68')]=0x0;this['predictiveIntervalMaxThreshold']=_0x250fda[_0xe8fd('0x69')]||0x14;this[_0xe8fd('0x6a')]=_0x250fda[_0xe8fd('0x69')]||0xa;this[_0xe8fd('0x6b')]=0x0;this[_0xe8fd('0x6c')]=0x0;this[_0xe8fd('0x6d')]=0x1;this[_0xe8fd('0x6e')]=0x0;this[_0xe8fd('0x6f')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xe8fd('0x70')]=0x0;this['dialRecallMeTimeout']=_0x250fda[_0xe8fd('0x71')]||0x1e;this['dialRecallInQueue']=_0x250fda[_0xe8fd('0x72')]||![];this[_0xe8fd('0x73')]=_0x250fda[_0xe8fd('0x73')]||undefined;this[_0xe8fd('0x74')]=_0x250fda[_0xe8fd('0x74')]||![];this[_0xe8fd('0x75')]=_0x250fda[_0xe8fd('0x75')]||![];this[_0xe8fd('0xd')]=monitorFormat[_0x250fda['monitor_format']]?monitorFormat[_0x250fda['monitor_format']]:undefined;this[_0xe8fd('0x76')]=_0x250fda[_0xe8fd('0x76')]||![];this[_0xe8fd('0x77')]=_0x250fda['mandatoryDispositionPause']?_0x250fda[_0xe8fd('0x77')]:undefined;}module[_0xe8fd('0x78')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 625de72..e58b514 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 _0xe80a=['Configurations','exports','name','username','accessKey','remoteUri','serverUrl'];(function(_0x217d48,_0x1e2d14){var _0x44479c=function(_0x9fbae3){while(--_0x9fbae3){_0x217d48['push'](_0x217d48['shift']());}};_0x44479c(++_0x1e2d14);}(_0xe80a,0x198));var _0xae80=function(_0x174ef5,_0x256e8e){_0x174ef5=_0x174ef5-0x0;var _0x1cc379=_0xe80a[_0x174ef5];return _0x1cc379;};'use strict';function VtigerAccount(_0x3f7102){this['id']=_0x3f7102['id']||0x0;this['name']=_0x3f7102[_0xae80('0x0')]||'';this[_0xae80('0x1')]=_0x3f7102[_0xae80('0x1')]||'';this[_0xae80('0x2')]=_0x3f7102[_0xae80('0x2')]||'';this[_0xae80('0x3')]=_0x3f7102['remoteUri']||'';this[_0xae80('0x4')]=_0x3f7102[_0xae80('0x4')]||'';this[_0xae80('0x5')]=_0x3f7102['Configurations']||{};}module[_0xae80('0x6')]=VtigerAccount; \ No newline at end of file +var _0x0d62=['name','username','accessKey','remoteUri','serverUrl','Configurations'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0d62,0x11a));var _0x20d6=function(_0xbf5e16,_0x146ce3){_0xbf5e16=_0xbf5e16-0x0;var _0x5975a5=_0x0d62[_0xbf5e16];return _0x5975a5;};'use strict';function VtigerAccount(_0x158833){this['id']=_0x158833['id']||0x0;this[_0x20d6('0x0')]=_0x158833['name']||'';this[_0x20d6('0x1')]=_0x158833[_0x20d6('0x1')]||'';this[_0x20d6('0x2')]=_0x158833[_0x20d6('0x2')]||'';this[_0x20d6('0x3')]=_0x158833['remoteUri']||'';this[_0x20d6('0x4')]=_0x158833['serverUrl']||'';this['Configurations']=_0x158833[_0x20d6('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index bf13860..659e5cc 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 _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x175a55,_0x4082fd){var _0x167adf=function(_0x18ef07){while(--_0x18ef07){_0x175a55['push'](_0x175a55['shift']());}};_0x167adf(++_0x4082fd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x3e0dc4,_0x13971b){_0x3e0dc4=_0x3e0dc4-0x0;var _0x586111=_0x0b0e[_0x3e0dc4];return _0x586111;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('0x9')]=ZendeskAccount; \ No newline at end of file +var _0x0b0e=['exports','name','username','password','token','remoteUri','authType','type','serverUrl','Configurations'];(function(_0x5c4585,_0x3d0eab){var _0x21dede=function(_0x5c3d6a){while(--_0x5c3d6a){_0x5c4585['push'](_0x5c4585['shift']());}};_0x21dede(++_0x3d0eab);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34c4e1,_0x310387){_0x34c4e1=_0x34c4e1-0x0;var _0x5a11ef=_0x0b0e[_0x34c4e1];return _0x5a11ef;};'use strict';function ZendeskAccount(_0x29cd1e){this['id']=_0x29cd1e['id']||0x0;this['name']=_0x29cd1e[_0xe0b0('0x0')]||'';this['username']=_0x29cd1e[_0xe0b0('0x1')]||'';this[_0xe0b0('0x2')]=_0x29cd1e[_0xe0b0('0x2')]||'';this[_0xe0b0('0x3')]=_0x29cd1e[_0xe0b0('0x3')]||'';this[_0xe0b0('0x4')]=_0x29cd1e[_0xe0b0('0x4')]||'';this[_0xe0b0('0x5')]=_0x29cd1e[_0xe0b0('0x5')]||'';this[_0xe0b0('0x6')]=_0x29cd1e[_0xe0b0('0x6')]||'integrationTab';this['serverUrl']=_0x29cd1e[_0xe0b0('0x7')]||'';this[_0xe0b0('0x8')]=_0x29cd1e[_0xe0b0('0x8')]||{};}module[_0xe0b0('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 e6f7fbf..854fcf5 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 _0x57c3=['code','refreshToken','Configurations','exports','name','host','zone','clientId','clientSecret','serverUrl'];(function(_0x5e848d,_0x1dbd20){var _0x3785e5=function(_0xc82b39){while(--_0xc82b39){_0x5e848d['push'](_0x5e848d['shift']());}};_0x3785e5(++_0x1dbd20);}(_0x57c3,0xc2));var _0x357c=function(_0x5aafa4,_0x230af4){_0x5aafa4=_0x5aafa4-0x0;var _0x1e4996=_0x57c3[_0x5aafa4];return _0x1e4996;};'use strict';function ZohoAccount(_0x483fac){this['id']=_0x483fac['id']||0x0;this[_0x357c('0x0')]=_0x483fac[_0x357c('0x0')]||'';this['description']=_0x483fac['description']||'';this['host']=_0x483fac[_0x357c('0x1')]||'';this[_0x357c('0x2')]=_0x483fac[_0x357c('0x2')]||'';this[_0x357c('0x3')]=_0x483fac['clientId']||'';this[_0x357c('0x4')]=_0x483fac['clientSecret']||'';this[_0x357c('0x5')]=_0x483fac[_0x357c('0x5')]||'';this[_0x357c('0x6')]=_0x483fac[_0x357c('0x6')]||'';this[_0x357c('0x7')]=_0x483fac[_0x357c('0x7')]||'';this[_0x357c('0x8')]=_0x483fac['Configurations']||{};}module[_0x357c('0x9')]=ZohoAccount; \ No newline at end of file +var _0x457b=['code','refreshToken','Configurations','exports','name','description','host','zone','clientId','clientSecret','serverUrl'];(function(_0x5962cc,_0x29da43){var _0xf20047=function(_0x4e0f31){while(--_0x4e0f31){_0x5962cc['push'](_0x5962cc['shift']());}};_0xf20047(++_0x29da43);}(_0x457b,0xca));var _0xb457=function(_0x22d334,_0x57f1e6){_0x22d334=_0x22d334-0x0;var _0x52d3d4=_0x457b[_0x22d334];return _0x52d3d4;};'use strict';function ZohoAccount(_0x404021){this['id']=_0x404021['id']||0x0;this[_0xb457('0x0')]=_0x404021['name']||'';this[_0xb457('0x1')]=_0x404021[_0xb457('0x1')]||'';this[_0xb457('0x2')]=_0x404021[_0xb457('0x2')]||'';this[_0xb457('0x3')]=_0x404021['zone']||'';this[_0xb457('0x4')]=_0x404021[_0xb457('0x4')]||'';this[_0xb457('0x5')]=_0x404021[_0xb457('0x5')]||'';this[_0xb457('0x6')]=_0x404021['serverUrl']||'';this[_0xb457('0x7')]=_0x404021[_0xb457('0x7')]||'';this[_0xb457('0x8')]=_0x404021['refreshToken']||'';this['Configurations']=_0x404021[_0xb457('0x9')]||{};}module[_0xb457('0xa')]=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 7bbbac1..07355a9 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 _0xfcb4=['Contact','firstName','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','countnosuchnumberretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','format','\x22%s\x22\x20<%s>','exports','util','moment','string','queue','type','campaigntype','membername','isNil','Agent','name','SIP/%s','calleridname'];(function(_0x596172,_0x334e5c){var _0x492815=function(_0x252774){while(--_0x252774){_0x596172['push'](_0x596172['shift']());}};_0x492815(++_0x334e5c);}(_0xfcb4,0x144));var _0x4fcb=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xfcb4[_0x5ddb1c];return _0x354adc;};'use strict';var util=require(_0x4fcb('0x0'));var _=require('lodash');var moment=require(_0x4fcb('0x1'));function checkNameSurname(_0x4fc48a,_0x1375ca,_0xb18f1a){var _0x35269c='';if(!_['isNil'](_0x1375ca)&&'string'===typeof _0x1375ca){_0x35269c+=_0x1375ca;}if(!_['isNil'](_0xb18f1a)&&_0x4fcb('0x2')===typeof _0xb18f1a){_0x35269c+='\x20'+_0xb18f1a;}if(_0x35269c!==''){return _0x35269c;}return _0x4fc48a;}function Action(_0x259fa4,_0x273c84,_0x51a3b7,_0xea68a9,_0x1b881a){this['uniqueid']=_0x51a3b7||undefined;this['idContact']=_0x259fa4['id'];this[_0x4fcb('0x3')]=_0x273c84['name'];this[_0x4fcb('0x4')]=_0x273c84[_0x4fcb('0x4')];this[_0x4fcb('0x5')]='queue';this['dialAnswer']=![];this[_0x4fcb('0x6')]=_[_0x4fcb('0x7')](_0x259fa4[_0x4fcb('0x8')])?undefined:_0x259fa4['Agent'][_0x4fcb('0x9')];this['channelAgent']=this[_0x4fcb('0x6')]?util['format'](_0x4fcb('0xa'),this[_0x4fcb('0x6')]):_0xea68a9||undefined;this[_0x4fcb('0xb')]=checkNameSurname(_0x259fa4[_0x4fcb('0xc')]['phone'],_0x259fa4['Contact'][_0x4fcb('0xd')],_0x259fa4['Contact'][_0x4fcb('0xe')]);this[_0x4fcb('0xf')]=_0x259fa4[_0x4fcb('0xf')]||![];this[_0x4fcb('0x10')]=_0x259fa4[_0x4fcb('0xc')]['phone'];this[_0x4fcb('0x11')]=_0x259fa4[_0x4fcb('0x11')];this[_0x4fcb('0x12')]=_0x259fa4[_0x4fcb('0x12')]||0x0;this[_0x4fcb('0x13')]=_0x259fa4[_0x4fcb('0x13')]||0x0;this[_0x4fcb('0x14')]=_0x259fa4[_0x4fcb('0x14')]||0x0;this[_0x4fcb('0x15')]=(_0x259fa4[_0x4fcb('0x12')]||0x0)+(_0x259fa4[_0x4fcb('0x13')]||0x0)+(_0x259fa4['countnoanswerretry']||0x0);this[_0x4fcb('0x16')]=_0x259fa4[_0x4fcb('0x16')]||0x0;this[_0x4fcb('0x17')]=_0x259fa4[_0x4fcb('0x17')]||0x0;this[_0x4fcb('0x18')]=_0x259fa4[_0x4fcb('0x18')]||0x0;this[_0x4fcb('0x19')]=_0x259fa4[_0x4fcb('0x19')]||0x0;this[_0x4fcb('0x1a')]=_0x259fa4[_0x4fcb('0x1a')]||0x0;this[_0x4fcb('0x1b')]=_0x259fa4[_0x4fcb('0x1b')];this[_0x4fcb('0x1c')]=_0x259fa4['callbackuniqueid'];this[_0x4fcb('0x1d')]=_0x259fa4[_0x4fcb('0x1d')];this[_0x4fcb('0x1e')]=_0x259fa4[_0x4fcb('0x1e')];this['ContactId']=_0x259fa4[_0x4fcb('0x1f')];this[_0x4fcb('0x20')]=_0x259fa4['ListId'];this['UserId']=_[_0x4fcb('0x7')](_0x259fa4[_0x4fcb('0x8')])?_0x259fa4[_0x4fcb('0x21')]:_0x259fa4[_0x4fcb('0x8')]['id'];this[_0x4fcb('0x22')]=_0x259fa4[_0x4fcb('0x22')];this[_0x4fcb('0x23')]='';this[_0x4fcb('0x24')]='';}Action[_0x4fcb('0x25')][_0x4fcb('0x26')]=function(){return util[_0x4fcb('0x27')](_0x4fcb('0x28'),this['calleridname'],this['number']);};module[_0x4fcb('0x29')]=Action; \ No newline at end of file +var _0xb773=['campaigntype','membername','Agent','channelAgent','format','SIP/%s','calleridname','Contact','lastName','calleridnum','phone','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countdropretry','countabandonedretry','countmachineretry','countagentrejectretry','callback','callbackuniqueid','callbackat','recallme','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','number','util','lodash','isNil','string','uniqueid','idContact','queue','name','type'];(function(_0x2c34ff,_0x1e8bee){var _0x476508=function(_0x3e50db){while(--_0x3e50db){_0x2c34ff['push'](_0x2c34ff['shift']());}};_0x476508(++_0x1e8bee);}(_0xb773,0x191));var _0x3b77=function(_0x21d650,_0x34649d){_0x21d650=_0x21d650-0x0;var _0x5e50a3=_0xb773[_0x21d650];return _0x5e50a3;};'use strict';var util=require(_0x3b77('0x0'));var _=require(_0x3b77('0x1'));var moment=require('moment');function checkNameSurname(_0x2bfa11,_0x5af1a1,_0x3ed769){var _0x36417b='';if(!_[_0x3b77('0x2')](_0x5af1a1)&&_0x3b77('0x3')===typeof _0x5af1a1){_0x36417b+=_0x5af1a1;}if(!_['isNil'](_0x3ed769)&&_0x3b77('0x3')===typeof _0x3ed769){_0x36417b+='\x20'+_0x3ed769;}if(_0x36417b!==''){return _0x36417b;}return _0x2bfa11;}function Action(_0x488c57,_0x1f366c,_0x4ef519,_0x4779db,_0x2e9053){this[_0x3b77('0x4')]=_0x4ef519||undefined;this[_0x3b77('0x5')]=_0x488c57['id'];this[_0x3b77('0x6')]=_0x1f366c[_0x3b77('0x7')];this[_0x3b77('0x8')]=_0x1f366c[_0x3b77('0x8')];this[_0x3b77('0x9')]='queue';this['dialAnswer']=![];this[_0x3b77('0xa')]=_['isNil'](_0x488c57['Agent'])?undefined:_0x488c57[_0x3b77('0xb')][_0x3b77('0x7')];this[_0x3b77('0xc')]=this['membername']?util[_0x3b77('0xd')](_0x3b77('0xe'),this[_0x3b77('0xa')]):_0x4779db||undefined;this[_0x3b77('0xf')]=checkNameSurname(_0x488c57[_0x3b77('0x10')]['phone'],_0x488c57[_0x3b77('0x10')]['firstName'],_0x488c57['Contact'][_0x3b77('0x11')]);this['active']=_0x488c57['active']||![];this[_0x3b77('0x12')]=_0x488c57['Contact'][_0x3b77('0x13')];this[_0x3b77('0x14')]=_0x488c57[_0x3b77('0x14')];this[_0x3b77('0x15')]=_0x488c57[_0x3b77('0x15')]||0x0;this[_0x3b77('0x16')]=_0x488c57[_0x3b77('0x16')]||0x0;this[_0x3b77('0x17')]=_0x488c57[_0x3b77('0x17')]||0x0;this['countglobal']=(_0x488c57[_0x3b77('0x15')]||0x0)+(_0x488c57[_0x3b77('0x16')]||0x0)+(_0x488c57[_0x3b77('0x17')]||0x0);this['countnosuchnumberretry']=_0x488c57['countnosuchnumberretry']||0x0;this['countdropretry']=_0x488c57[_0x3b77('0x18')]||0x0;this[_0x3b77('0x19')]=_0x488c57[_0x3b77('0x19')]||0x0;this[_0x3b77('0x1a')]=_0x488c57[_0x3b77('0x1a')]||0x0;this[_0x3b77('0x1b')]=_0x488c57['countagentrejectretry']||0x0;this[_0x3b77('0x1c')]=_0x488c57[_0x3b77('0x1c')];this[_0x3b77('0x1d')]=_0x488c57[_0x3b77('0x1d')];this[_0x3b77('0x1e')]=_0x488c57[_0x3b77('0x1e')];this[_0x3b77('0x1f')]=_0x488c57[_0x3b77('0x1f')];this['ContactId']=_0x488c57['ContactId'];this[_0x3b77('0x20')]=_0x488c57[_0x3b77('0x20')];this[_0x3b77('0x21')]=_['isNil'](_0x488c57[_0x3b77('0xb')])?_0x488c57[_0x3b77('0x21')]:_0x488c57[_0x3b77('0xb')]['id'];this['VoiceQueueId']=_0x488c57[_0x3b77('0x22')];this[_0x3b77('0x23')]='';this[_0x3b77('0x24')]='';}Action[_0x3b77('0x25')][_0x3b77('0x26')]=function(){return util[_0x3b77('0xd')](_0x3b77('0x27'),this[_0x3b77('0xf')],this[_0x3b77('0x28')]);};module['exports']=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index ff15954..f586698 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 _0x3c62=['createCustomerFinal','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','NOT_ACTIVE','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','totalGlobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','cloneAction','Global','countnosuchnumberretry','dialNoSuchNumberMaxRetry','[callProgressDetectingCustomer][logNoSuchGlobal]','scheduledAt','unlockAgent','activeContact','linkedid','rescheduleContact','dialNoSuchNumberRetryFrequency','answertime','[syncHangup][talking][increment]','uniqueid','\x20Queue','connect','acw','custom:agentConnectPreview','custom:agentcomplete','buildObj','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','[syncHangup][talking][decrement]','BUSY','countbusyretry','Busy','[callProgressDetectingCustomer][logBusy]','dialBusyMaxRetry','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerRetryFrequency','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','CANCEL','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','ABANDONED','countabandonedretry','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','dialAbandonedRetryFrequency','[default]','loggerError','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','[callProgressDetectingAgent][logNoAnswer]','logAgent','[callProgressDetectingAgent][logBusy]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','Queue','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','\x20IdHopper:\x20','called','[Preview][execCall][failure]','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','unmonitored','execRun','unlock','getContactPreview','recallme','validateContact','isValid','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20work','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','SIP/%s/%s%s','dialPrefix','trim','dialCutDigit','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','dialOriginateCallerIdNumber','extractCalleridName','addVariables','merge','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','isFailure','response','custom:agentringnoanswer','callProgressDetectingAgent','syncHangup','[syncHangup][talking]','cause','statedesc','dialQueueProject','channelstate','transfer','destlinkedid','addVariable','variables','filterKey','keys','variable','value','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','lodash','uuid','moment','md5','../../../config/environment','preview','../../../config/logger','actionPreview','./action','./util/util','redis','localhost','socket.io-emitter','prototype','enqueue','tail','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','syncDialEnd','syncNewExten','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','emit','type','outbound','name','answered','loggedIn','sumBillable','sumDuration','talking','total','abandoned','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','pTalking','available','logger','\x20is\x20not\x20active','IS_DISACTIVED','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20disactive','loopCampaigns','syncCampaigns','booked','hasOwnProperty','setMessage','recallMe','clearZombieChannel','isNil','info','[clearZombieChannels][talking]','originated:\x20','queue','pTalking:\x20','pick','contactId','UserId','VoiceQueueId','ListId','Action','status','channel','catch','updateOriginated','dialAnswer','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','agentReadyId','length','getDiff','Agent','voicePause','then','logger2','[RecallMe]','disableContact','starttime','YYYY-MM-DD\x20HH:mm:ss','outboundReCallsDay','logCustomer','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0x3c62,0xac));var _0x23c6=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x3c62[_0x6131cd];return _0x47e916;};'use strict';var util=require(_0x23c6('0x0'));var _=require(_0x23c6('0x1'));var BPromise=require('bluebird');var uuid=require(_0x23c6('0x2'));var moment=require(_0x23c6('0x3'));var md5=require(_0x23c6('0x4'));var Redis=require('ioredis');var config=require(_0x23c6('0x5'));var logger=require('../../../config/logger')(_0x23c6('0x6'));var loggerAction=require(_0x23c6('0x7'))(_0x23c6('0x8'));var ami=require('../ami');var rpcDb=require('./rpcDb');var Action=require(_0x23c6('0x9'));var ut=require(_0x23c6('0xa'));config[_0x23c6('0xb')]=_['defaults'](config[_0x23c6('0xb')],{'host':_0x23c6('0xc'),'port':0x18eb});var io=require(_0x23c6('0xd'))(new Redis(config[_0x23c6('0xb')]));var Sequence=function(){};Sequence[_0x23c6('0xe')][_0x23c6('0xf')]=function(_0x48c768){this[_0x23c6('0x10')]=this[_0x23c6('0x10')]?this[_0x23c6('0x10')]['finally'](_0x48c768):_0x48c768();};function Preview(_0xc6d900){this[_0x23c6('0x11')]=new Sequence();this[_0x23c6('0x12')]=_0xc6d900[_0x23c6('0x13')];this[_0x23c6('0x14')]=_0xc6d900['trunks'];this[_0x23c6('0x15')]={};this[_0x23c6('0x16')]=_0xc6d900['agents'];this[_0x23c6('0x17')]=0x0;ami['on'](_0x23c6('0x18'),this[_0x23c6('0x19')][_0x23c6('0x1a')](this));ami['on'](_0x23c6('0x1b'),this['syncHangup'][_0x23c6('0x1a')](this));ami['on'](_0x23c6('0x1c'),this[_0x23c6('0x1d')][_0x23c6('0x1a')](this));ami['on']('dialend',this[_0x23c6('0x1e')][_0x23c6('0x1a')](this));ami['on']('newexten',this[_0x23c6('0x1f')][_0x23c6('0x1a')](this));ami['on']('varset',this[_0x23c6('0x20')]['bind'](this));ami['on'](_0x23c6('0x21'),this[_0x23c6('0x22')][_0x23c6('0x1a')](this));ami['on'](_0x23c6('0x23'),this[_0x23c6('0x24')]['bind'](this));this['loopCampaigns'](this[_0x23c6('0x12')]);}function emit(_0x5bcf3d,_0x1b6e63,_0x28d2e5){io['to'](_0x5bcf3d)[_0x23c6('0x25')](_0x1b6e63,_0x28d2e5);}function emitCampaignPreview(_0x6c54dc){if(_0x6c54dc[_0x23c6('0x26')]===_0x23c6('0x27')){var _0x2016e7={'id':_0x6c54dc['id'],'name':_0x6c54dc[_0x23c6('0x28')],'strategy':_0x6c54dc['strategy'],'answered':_0x6c54dc[_0x23c6('0x29')],'available':_0x6c54dc['available'],'loggedIn':_0x6c54dc[_0x23c6('0x2a')],'pTalking':_0x6c54dc['pTalking'],'sumBillable':_0x6c54dc[_0x23c6('0x2b')],'sumDuration':_0x6c54dc[_0x23c6('0x2c')],'sumHoldTime':_0x6c54dc['sumHoldTime']||0x0,'talking':_0x6c54dc[_0x23c6('0x2d')],'total':_0x6c54dc[_0x23c6('0x2e')],'type':_0x6c54dc['type'],'unmanaged':_0x6c54dc['unmanaged'],'abandoned':_0x6c54dc[_0x23c6('0x2f')],'waiting':_0x6c54dc['waiting'],'loggedInDb':_0x6c54dc[_0x23c6('0x30')],'dialActive':_0x6c54dc[_0x23c6('0x31')],'dialMethod':_0x6c54dc[_0x23c6('0x32')],'dialOriginateCallerIdName':_0x6c54dc[_0x23c6('0x33')],'dialOriginateCallerIdNumber':_0x6c54dc['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x6c54dc['dialOriginateTimeout'],'dialPrefix':_0x6c54dc['dialPrefix'],'outboundAnswerAgiCallsDay':_0x6c54dc[_0x23c6('0x34')],'outboundAnswerCallsDay':_0x6c54dc[_0x23c6('0x35')],'outboundBlacklistCallsDay':_0x6c54dc[_0x23c6('0x36')],'outboundBusyCallsDay':_0x6c54dc[_0x23c6('0x37')],'outboundCongestionCallsDay':_0x6c54dc[_0x23c6('0x38')],'outboundDropCallsDayACS':_0x6c54dc[_0x23c6('0x39')],'outboundDropCallsDayCallersExit':_0x6c54dc[_0x23c6('0x3a')],'outboundDropCallsDayTimeout':_0x6c54dc['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x6c54dc[_0x23c6('0x3b')],'outboundNoSuchCallsDay':_0x6c54dc[_0x23c6('0x3c')],'outboundOriginateFailureCallsDay':_0x6c54dc[_0x23c6('0x3d')],'outboundReCallsDay':_0x6c54dc['outboundReCallsDay'],'outboundRejectCallsDay':_0x6c54dc[_0x23c6('0x3e')],'outboundUnknownCallsDay':_0x6c54dc[_0x23c6('0x3f')],'outboundAbandonedCallsDay':_0x6c54dc[_0x23c6('0x40')],'predictiveIntervalAnsweredCalls':_0x6c54dc[_0x23c6('0x41')],'predictiveIntervalAvgHoldtime':_0x6c54dc[_0x23c6('0x42')],'predictiveIntervalAvgTalktime':_0x6c54dc['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x6c54dc[_0x23c6('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x6c54dc['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x6c54dc['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x6c54dc['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x6c54dc[_0x23c6('0x44')],'predictiveIntervalMultiplicativeFactor':_0x6c54dc[_0x23c6('0x45')],'predictiveIntervalPauses':_0x6c54dc[_0x23c6('0x46')],'predictiveIntervalAvailable':_0x6c54dc[_0x23c6('0x47')],'predictiveIntervalTotalCalls':_0x6c54dc[_0x23c6('0x48')],'message':_0x6c54dc[_0x23c6('0x49')],'originated':_0x6c54dc[_0x23c6('0x4a')],'erlangCalls':_0x6c54dc[_0x23c6('0x4b')],'erlangCallToSecond':_0x6c54dc[_0x23c6('0x4c')],'erlangAbandonmentRate':_0x6c54dc['erlangAbandonmentRate'],'erlangBusyFactor':_0x6c54dc[_0x23c6('0x4d')],'startPredictive':_0x6c54dc[_0x23c6('0x4e')],'startProgressive':_0x6c54dc[_0x23c6('0x4f')]};if(_0x6c54dc[_0x23c6('0x50')]){_0x2016e7[_0x23c6('0x50')]={'id':_0x6c54dc['Trunk']['id'],'name':_0x6c54dc[_0x23c6('0x50')]['name'],'active':_0x6c54dc[_0x23c6('0x50')][_0x23c6('0x51')],'callerid':_0x6c54dc[_0x23c6('0x50')][_0x23c6('0x52')]};}if(_0x6c54dc[_0x23c6('0x53')]){_0x2016e7[_0x23c6('0x53')]={'id':_0x6c54dc[_0x23c6('0x53')]['id'],'name':_0x6c54dc[_0x23c6('0x53')][_0x23c6('0x28')]};}var _0x1341e5=md5(JSON[_0x23c6('0x54')](_0x2016e7));if(_0x6c54dc[_0x23c6('0x4')]!==_0x1341e5){_0x6c54dc[_0x23c6('0x4')]=_0x1341e5;emit(util['format'](_0x23c6('0x55'),_0x2016e7[_0x23c6('0x28')]),'voice_queue:save',_0x2016e7);}}}function emitVoiceQueueChannelRemove(_0x2113b9){logger['info'](_0x23c6('0x56'),JSON[_0x23c6('0x54')](_0x2113b9));emit(util[_0x23c6('0x57')](_0x23c6('0x55'),_0x2113b9[_0x23c6('0x28')]),_0x23c6('0x58'),_0x2113b9);}function notSendMessagesQueue(_0x564959){if(_0x564959[_0x23c6('0x59')]){if(_0x564959[_0x23c6('0x4a')]===0x0&&_0x564959[_0x23c6('0x5a')]===0x0){_0x564959[_0x23c6('0x59')]=![];_0x564959[_0x23c6('0x5b')]=0x0;_0x564959['paused']=0x0;_0x564959[_0x23c6('0x49')]='NOT_ACTIVE';ut[_0x23c6('0x5c')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x564959[_0x23c6('0x28')]+_0x23c6('0x5d'));}else{_0x564959[_0x23c6('0x49')]=_0x23c6('0x5e');ut[_0x23c6('0x5c')](_0x23c6('0x5f'),_0x564959[_0x23c6('0x28')]+_0x23c6('0x60'));}emitCampaignPreview(_0x564959);}}Preview[_0x23c6('0xe')][_0x23c6('0x61')]=function(){var _0x220321=this;setInterval(function(){_0x220321['syncCampaigns']();},0x7cf);};Preview[_0x23c6('0xe')][_0x23c6('0x62')]=function(){var _0x5d906=this[_0x23c6('0x12')];this[_0x23c6('0x17')]+=0x1;for(var _0xf77ee6 in _0x5d906){if(_0x5d906['hasOwnProperty'](_0xf77ee6)&&(_0x5d906[_0xf77ee6][_0x23c6('0x32')]==='preview'||_0x5d906[_0xf77ee6][_0x23c6('0x32')]===_0x23c6('0x63'))&&_0x5d906[_0xf77ee6][_0x23c6('0x26')]==='outbound'){if(this[_0x23c6('0x17')]>0x7){this[_0x23c6('0x17')]=0x0;this['clearZombieChannels']();}}if(_0x5d906[_0x23c6('0x64')](_0xf77ee6)&&_0x5d906[_0xf77ee6][_0x23c6('0x32')]===_0x23c6('0x6')&&_0x5d906[_0xf77ee6][_0x23c6('0x26')]==='outbound'){if(_0x5d906[_0xf77ee6][_0x23c6('0x31')]){this[_0x23c6('0x65')](_0x5d906[_0xf77ee6]);this[_0x23c6('0x66')](_0x5d906[_0xf77ee6]);}else{notSendMessagesQueue(_0x5d906[_0xf77ee6]);}}}};Preview[_0x23c6('0xe')][_0x23c6('0x67')]=function(_0x1248a6){var _0x465b3f=this;this[_0x23c6('0x11')][_0x23c6('0xf')](function(){if(!_[_0x23c6('0x68')](_0x465b3f[_0x23c6('0x15')][_0x1248a6])){loggerAction[_0x23c6('0x69')](_0x23c6('0x6a'),_0x1248a6,'Queue',_0x465b3f[_0x23c6('0x15')][_0x1248a6]['queue'],_0x23c6('0x6b'),JSON['stringify'](_0x465b3f['campaignsPreview'][_0x465b3f['actions'][_0x1248a6][_0x23c6('0x6c')]][_0x23c6('0x4a')]),_0x23c6('0x6d'),JSON[_0x23c6('0x54')](_0x465b3f[_0x23c6('0x12')][_0x465b3f[_0x23c6('0x15')][_0x1248a6][_0x23c6('0x6c')]]['pTalking']),JSON[_0x23c6('0x54')](_0x465b3f[_0x23c6('0x15')][_0x1248a6]['dialAnswer']),JSON[_0x23c6('0x54')](_[_0x23c6('0x6e')](_0x465b3f['actions'][_0x1248a6],[_0x23c6('0x6f'),_0x23c6('0x70'),_0x23c6('0x71'),_0x23c6('0x72')])));return ami[_0x23c6('0x73')]({'action':_0x23c6('0x74'),'channel':_0x465b3f['actions'][_0x1248a6][_0x23c6('0x75')]})[_0x23c6('0x76')](function(_0x4191ce){if(_0x4191ce['message']==='No\x20such\x20channel'){setTimeout(function(){if(_0x465b3f['actions'][_0x1248a6]){ut[_0x23c6('0x77')](_0x465b3f['campaignsPreview'][_0x465b3f[_0x23c6('0x15')][_0x1248a6][_0x23c6('0x6c')]],'[clearZombieChannel]');if(_0x465b3f[_0x23c6('0x15')][_0x1248a6][_0x23c6('0x78')]===!![]){ut[_0x23c6('0x79')](_0x465b3f[_0x23c6('0x12')][_0x465b3f[_0x23c6('0x15')][_0x1248a6][_0x23c6('0x6c')]],_0x23c6('0x7a'));ut['loggerError']('[Dialer][checkChannel][pTalking][Preview]'+_0x1248a6,_0x465b3f[_0x23c6('0x15')][_0x1248a6][_0x23c6('0x6c')]);}ut['loggerError'](_0x23c6('0x7b')+_0x1248a6,_0x465b3f[_0x23c6('0x15')][_0x1248a6]['queue']);delete _0x465b3f[_0x23c6('0x15')][_0x1248a6];}},0x2328);}});}});};Preview[_0x23c6('0xe')][_0x23c6('0x7c')]=function(){var _0x475802=this;loggerAction[_0x23c6('0x69')](_0x23c6('0x7d'),_[_0x23c6('0x7e')](this['actions']));for(var _0x533729 in this[_0x23c6('0x15')]){if(_0x475802['actions']['hasOwnProperty'](_0x533729)){_0x475802['clearZombieChannel'](_0x533729);}}};Preview[_0x23c6('0xe')][_0x23c6('0x66')]=function(_0xe34536){var _0x2cad46=this;rpcDb[_0x23c6('0x7f')](_0xe34536['id'],ut[_0x23c6('0x80')](this[_0x23c6('0x16')]))['then'](function(_0xd3a1a3){if(!_['isNil'](_0xd3a1a3)){for(var _0x352622=0x0;_0x352622<_0xd3a1a3[_0x23c6('0x81')];_0x352622+=0x1){if(ut[_0x23c6('0x82')](_0xd3a1a3[_0x352622]['scheduledat'])<_0xe34536['dialRecallMeTimeout']*0x3c){if(_0xd3a1a3[_0x352622][_0x23c6('0x83')]&&!_0xd3a1a3[_0x352622][_0x23c6('0x83')][_0x23c6('0x84')]){_0x2cad46['run'](_0xd3a1a3[_0x352622]['id'])[_0x23c6('0x85')](ut[_0x23c6('0x86')](_0x23c6('0x87')))['catch'](ut[_0x23c6('0x86')](_0x23c6('0x87')));}else{rpcDb[_0x23c6('0x88')](_0xd3a1a3[_0x352622]['id']);}}else{var _0x422290=new Action(_0xd3a1a3[_0x352622],_0xe34536);_0x422290[_0x23c6('0x89')]=moment()[_0x23c6('0x57')](_0x23c6('0x8a'));_0xe34536[_0x23c6('0x8b')]+=0x1;ut[_0x23c6('0x8c')](_0x422290,0x17,_0x23c6('0x8d'));if(_0xe34536[_0x23c6('0x8e')]){rpcDb[_0x23c6('0x8f')](ut[_0x23c6('0x90')](_0xd3a1a3[_0x352622]));rpcDb[_0x23c6('0x91')](_0x422290,_0x23c6('0x92'));}else{ut[_0x23c6('0x8c')](_0x422290,0x16,_0x23c6('0x93'));rpcDb[_0x23c6('0x91')](_0x422290,_0x23c6('0x94'));rpcDb[_0x23c6('0x95')](_0x422290,_0x23c6('0x94'));}}}}})[_0x23c6('0x76')](ut[_0x23c6('0x86')]('[getContactRecallMe]'));};Preview[_0x23c6('0xe')][_0x23c6('0x65')]=function(_0x459bda){_0x459bda[_0x23c6('0x59')]=!![];if(ut[_0x23c6('0x96')](_0x459bda[_0x23c6('0x2a')])){_0x459bda[_0x23c6('0x49')]=_0x23c6('0x97');}else if(!ut[_0x23c6('0x98')](_0x459bda['dialActive'])){_0x459bda[_0x23c6('0x49')]=_0x23c6('0x99');}else if(!this[_0x23c6('0x9a')](_0x459bda[_0x23c6('0x50')])){if(!this['isTrunkReachable'](_0x459bda[_0x23c6('0x9b')])){_0x459bda['message']=_0x23c6('0x9c');}else{_0x459bda[_0x23c6('0x49')]=_0x23c6('0x9d');}}else{_0x459bda['message']=_0x23c6('0x9d');}emitCampaignPreview(_0x459bda);};Preview[_0x23c6('0xe')][_0x23c6('0x9e')]=function(_0x568f5c,_0x514abd,_0x32f29b){var _0x3fb84b=this;var _0x3837b=this[_0x23c6('0x15')][_0x514abd];var _0x36d98c=this[_0x23c6('0x12')][_0x3837b[_0x23c6('0x6c')]];var _0x3216eb;if(_0x36d98c){switch(_0x32f29b){case'1':_0x36d98c[_0x23c6('0x3c')]+=0x1;_0x3837b[_0x23c6('0x9f')]=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x0,_0x23c6('0xa1'));rpcDb['createCustomerHistory'](_0x3837b,_0x23c6('0xa2'));if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut[_0x23c6('0xa4')](_0x3837b,0xf,_0x23c6('0xa5'));rpcDb[_0x23c6('0x95')](_0x3216eb,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x3837b[_0x23c6('0xa6')]>=_0x36d98c[_0x23c6('0xa7')]){rpcDb[_0x23c6('0x95')](_0x3837b,_0x23c6('0xa8'));}else{rpcDb['rescheduleContact'](ut[_0x23c6('0xa9')](_0x3837b,_0x23c6('0xa6'),_0x36d98c['dialNoSuchNumberRetryFrequency']),_0x3837b[_0x23c6('0xaa')],_0x3837b[_0x23c6('0xab')]);}}delete this['actions'][_0x568f5c[_0x23c6('0xac')]];break;case'NOSUCHNUMBER':_0x36d98c['outboundNoSuchCallsDay']+=0x1;_0x3837b[_0x23c6('0x9f')]=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x0,_0x23c6('0xa1'));rpcDb[_0x23c6('0x91')](_0x3837b,_0x23c6('0xa2'));if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut[_0x23c6('0xa4')](_0x3837b,0xf,'Global');rpcDb[_0x23c6('0x95')](_0x3216eb,_0x23c6('0xa8'));}else{if(_0x3837b[_0x23c6('0xa6')]>=_0x36d98c['dialNoSuchNumberMaxRetry']){rpcDb['createCustomerFinal'](_0x3837b,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x23c6('0xad')](ut['scheduledAt'](_0x3837b,'countnosuchnumberretry',_0x36d98c[_0x23c6('0xae')]),_0x3837b[_0x23c6('0xaa')],_0x3837b[_0x23c6('0xab')]);}}delete this[_0x23c6('0x15')][_0x568f5c['linkedid']];break;case'ANSWER':var _0x27fed7=moment()['format'](_0x23c6('0x8a'));_0x3837b['responsetime']=_0x27fed7;_0x3837b[_0x23c6('0xaf')]=_0x27fed7;_0x3837b[_0x23c6('0x78')]=!![];_0x36d98c[_0x23c6('0x5a')]+=0x1;logger['info'](_0x23c6('0xb0'),_0x3837b[_0x23c6('0xb1')],_0x23c6('0xb2'),_0x36d98c[_0x23c6('0x28')],_0x23c6('0x6d'),_0x36d98c[_0x23c6('0x5a')]);ami[_0x23c6('0x25')]('custom:agentconnect',ut['buildObj'](_0x3837b,_0x23c6('0xb3')));if(_0x36d98c[_0x23c6('0xb4')]){ami[_0x23c6('0x25')](_0x23c6('0xb5'),ut['buildAcw'](_0x3837b));}break;case'16':ami['emit'](_0x23c6('0xb6'),ut[_0x23c6('0xb7')](_0x3837b,'complete'));emitVoiceQueueChannelRemove(ut['buildObj'](_0x3837b,_0x23c6('0xb8')));_0x36d98c['outboundAnswerCallsDay']+=0x1;_0x36d98c[_0x23c6('0x2e')]+=0x1;_0x36d98c['answered']+=0x1;ut[_0x23c6('0x79')](_0x36d98c,_0x23c6('0xb9'));_0x3837b[_0x23c6('0x9f')]=ut['totalGlobal'](_0x3837b);ut['logCustomer'](_0x3837b,0x4,_0x23c6('0xba'));rpcDb['createCustomerHistory'](_0x3837b,_0x23c6('0xbb'));rpcDb[_0x23c6('0x95')](_0x3837b,_0x23c6('0xbc'));rpcDb[_0x23c6('0xbd')](_0x3837b);_0x36d98c['sumDuration']+=_0x3837b[_0x23c6('0xbe')];_0x36d98c[_0x23c6('0x2b')]+=_0x3837b['talktime'];logger[_0x23c6('0x69')](_0x23c6('0xbf'),_0x3837b[_0x23c6('0xb1')],'\x20Queue',_0x36d98c[_0x23c6('0x28')],_0x23c6('0x6d'),_0x36d98c[_0x23c6('0x5a')]);delete this[_0x23c6('0x15')][_0x568f5c[_0x23c6('0xac')]];break;case _0x23c6('0xc0'):_0x36d98c[_0x23c6('0x37')]+=0x1;_0x3837b[_0x23c6('0xc1')]+=0x1;_0x3837b['countglobal']=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x5,_0x23c6('0xc2'));rpcDb[_0x23c6('0x91')](_0x3837b,_0x23c6('0xc3'));if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut[_0x23c6('0xa4')](_0x3837b,0xf,_0x23c6('0xa5'));rpcDb[_0x23c6('0x95')](_0x3216eb,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x3837b[_0x23c6('0xc1')]>=_0x36d98c[_0x23c6('0xc4')]){rpcDb[_0x23c6('0x95')](_0x3837b,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x23c6('0xad')](ut[_0x23c6('0xa9')](_0x3837b,_0x23c6('0xc1'),_0x36d98c[_0x23c6('0xc5')]),_0x3837b[_0x23c6('0xaa')],_0x3837b[_0x23c6('0xab')]);}}break;case _0x23c6('0xc6'):_0x36d98c[_0x23c6('0x3b')]+=0x1;_0x3837b[_0x23c6('0xc7')]+=0x1;_0x3837b[_0x23c6('0x9f')]=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x3,_0x23c6('0xc8'));rpcDb['createCustomerHistory'](_0x3837b,'[callProgressDetectingCustomer][logNoAnswer]');if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut['cloneAction'](_0x3837b,0xf,_0x23c6('0xa5'));rpcDb[_0x23c6('0x95')](_0x3216eb,_0x23c6('0xc9'));}else{if(_0x3837b[_0x23c6('0xc7')]>=_0x36d98c[_0x23c6('0xca')]){rpcDb['createCustomerFinal'](_0x3837b,_0x23c6('0xcb'));}else{rpcDb['rescheduleContact'](ut['scheduledAt'](_0x3837b,_0x23c6('0xc7'),_0x36d98c[_0x23c6('0xcc')]),_0x3837b[_0x23c6('0xaa')],_0x3837b[_0x23c6('0xab')]);}}break;case'CONGESTION':_0x36d98c[_0x23c6('0x38')]+=0x1;_0x3837b[_0x23c6('0xcd')]+=0x1;_0x3837b['countglobal']=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x8,_0x23c6('0xce'));rpcDb[_0x23c6('0x91')](_0x3837b,_0x23c6('0xcf'));if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c['dialGlobalMaxRetry']){_0x3216eb=ut[_0x23c6('0xa4')](_0x3837b,0xf,'Global');rpcDb[_0x23c6('0x95')](_0x3216eb,_0x23c6('0xd0'));}else{if(_0x3837b[_0x23c6('0xcd')]>=_0x36d98c['dialCongestionMaxRetry']){rpcDb[_0x23c6('0x95')](_0x3837b,_0x23c6('0xcf'));}else{rpcDb[_0x23c6('0xad')](ut[_0x23c6('0xa9')](_0x3837b,'countcongestionretry',_0x36d98c['dialBusyRetryFrequency']),_0x3837b[_0x23c6('0xaa')],_0x3837b['activeContact']);}}break;case _0x23c6('0xd1'):_0x36d98c['outboundRejectCallsDay']+=0x1;_0x3837b[_0x23c6('0x9f')]=ut['totalGlobal'](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0x14,_0x23c6('0xd2'));rpcDb['createCustomerHistory'](_0x3837b,_0x23c6('0xd3'));if(_0x3837b['unlockAgent']){rpcDb[_0x23c6('0xd4')](_0x3837b[_0x23c6('0xd5')]);}if(_0x3837b['activeContact']){rpcDb[_0x23c6('0x88')](_0x3837b[_0x23c6('0xd5')]);}break;case _0x23c6('0xd6'):_0x36d98c['outboundAbandonedCallsDay']+=0x1;_0x3837b[_0x23c6('0xd7')]+=0x1;_0x3837b[_0x23c6('0x9f')]=ut[_0x23c6('0xa0')](_0x3837b);ut['logCustomer'](_0x3837b,0xb,_0x23c6('0xd8'));rpcDb['createCustomerHistory'](_0x3837b,_0x23c6('0xd9'));if(ut[_0x23c6('0xa0')](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut['cloneAction'](_0x3837b,0xf,'Global');rpcDb[_0x23c6('0x95')](_0x3216eb,_0x23c6('0xd9'));}else{if(_0x3837b[_0x23c6('0xda')]>=_0x36d98c[_0x23c6('0xdb')]){rpcDb[_0x23c6('0x95')](_0x3837b,_0x23c6('0xd9'));}else{rpcDb[_0x23c6('0xad')](ut[_0x23c6('0xa9')](_0x3837b,'countabandonedretry',_0x36d98c[_0x23c6('0xdc')]),_0x3837b[_0x23c6('0xaa')],_0x3837b[_0x23c6('0xab')]);}}break;default:if(_0x3837b[_0x23c6('0x78')]){ut[_0x23c6('0x79')](_0x36d98c,_0x23c6('0xdd'));ut[_0x23c6('0xde')](_0x23c6('0xdf')+_0x36d98c['name'],_0x568f5c);}_0x36d98c['outboundUnknownCallsDay']+=0x1;_0x3837b[_0x23c6('0x9f')]=ut[_0x23c6('0xa0')](_0x3837b);ut[_0x23c6('0x8c')](_0x3837b,0xc,_0x568f5c[_0x23c6('0xe0')]||_0x568f5c[_0x23c6('0xe1')]);rpcDb['createCustomerHistory'](_0x3837b,_0x23c6('0xe2'));if(ut['totalGlobal'](_0x3837b)>=_0x36d98c[_0x23c6('0xa3')]){_0x3216eb=ut[_0x23c6('0xa4')](_0x3837b,0xf,_0x23c6('0xa5'));rpcDb[_0x23c6('0x95')](_0x3216eb,_0x23c6('0xe3'));}else{rpcDb[_0x23c6('0x95')](_0x3837b,_0x23c6('0xe3'));}delete this['actions'][_0x568f5c[_0x23c6('0xac')]];}if(!(_0x3837b[_0x23c6('0x78')]&&_0x32f29b==='16')){ut[_0x23c6('0x77')](_0x36d98c,_0x23c6('0xe4'));logger['info'](_0x23c6('0xe5'),_0x3837b[_0x23c6('0xb1')],_0x23c6('0xb2'),_0x36d98c['name'],'originated:\x20',_0x36d98c[_0x23c6('0x4a')]);}if(_0x32f29b!=='ANSWER'){delete this[_0x23c6('0x15')][_0x568f5c[_0x23c6('0xac')]];delete this[_0x23c6('0x15')][_0x568f5c['destlinkedid']];}}};Preview[_0x23c6('0xe')]['callProgressDetectingAgent']=function(_0x2d0a8a,_0x8332cd,_0x3c57b6){if(_[_0x23c6('0xe6')](_0x8332cd)&&'object'!==typeof _0x8332cd){return;}if(_['isUndefined'](_0x3c57b6)&&_0x23c6('0xe7')!==typeof _0x3c57b6){return;}switch(_0x3c57b6[_0x23c6('0xe8')]){case'0':ut['logAgent'](_0x2d0a8a,0x0,'NoSuchNumber');rpcDb[_0x23c6('0xe9')](_0x2d0a8a,_0x23c6('0xea'));break;case'3':ut['logAgent'](_0x2d0a8a,0x3,_0x23c6('0xc8'));rpcDb[_0x23c6('0xe9')](_0x2d0a8a,_0x23c6('0xeb'));break;case'5':ut[_0x23c6('0xec')](_0x2d0a8a,0x5,_0x23c6('0xc2'));rpcDb['createAgentHistory'](_0x2d0a8a,_0x23c6('0xed'));break;case'8':ut['logAgent'](_0x2d0a8a,0x8,_0x23c6('0xce'));rpcDb[_0x23c6('0xe9')](_0x2d0a8a,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x23c6('0xec')](_0x2d0a8a,0x16,_0x23c6('0xee'));rpcDb['createAgentHistory'](_0x2d0a8a,_0x23c6('0xef'));break;default:ut[_0x23c6('0xec')](_0x2d0a8a,0xc,_0x3c57b6[_0x23c6('0xe8')]);rpcDb[_0x23c6('0xe9')](_0x2d0a8a,_0x23c6('0xf0'));}ut[_0x23c6('0x77')](_0x8332cd,_0x23c6('0xf1'));logger['info'](_0x23c6('0xf2'),_0x2d0a8a[_0x23c6('0xb1')],_0x23c6('0xb2'),_0x8332cd[_0x23c6('0x28')],'originated:\x20',_0x8332cd[_0x23c6('0x4a')]);delete this[_0x23c6('0x15')][_0x2d0a8a[_0x23c6('0xb1')]];};Preview[_0x23c6('0xe')][_0x23c6('0xf3')]=function(_0x2a3a2c,_0x4802db,_0x38c4c7,_0x5d47fa,_0x46f6a3){var _0x17bc7a=this;return new BPromise(function(_0x3201fa,_0x4947bf){if(_[_0x23c6('0x68')](_0x4802db)||_[_0x23c6('0x68')](_0x4802db['Contact'])||_[_0x23c6('0x68')](_0x4802db[_0x23c6('0xf4')][_0x23c6('0xf5')])||_[_0x23c6('0x68')](_0x4802db['VoiceQueueId'])){_0x4947bf(ut['message'](_0x23c6('0xf6'),_0x5d47fa,_0x46f6a3));return;}var _0x2cc62a=uuid['v4']();var _0x952bcf=_0x17bc7a[_0x23c6('0x12')][_0x4802db[_0x23c6('0xf7')][_0x23c6('0x28')]];var _0x2bcd84=_0x38c4c7?_0x17bc7a['agents'][_0x38c4c7]['id']:undefined;_0x17bc7a[_0x23c6('0x15')][_0x2cc62a]=new Action(_0x4802db,_0x952bcf,_0x2cc62a,_0x38c4c7,_0x2bcd84);var _0x5ac976=_0x17bc7a[_0x23c6('0x15')][_0x2cc62a];_0x5ac976['unlockAgent']=_0x5d47fa;_0x5ac976[_0x23c6('0xab')]=_0x46f6a3;_0x5ac976[_0x23c6('0xf8')]=_0x38c4c7;if(_[_0x23c6('0xf9')](_0x2a3a2c)){_0x17bc7a['execCall'](_0x5ac976,_0x952bcf,_0x4802db,_0x38c4c7)[_0x23c6('0x85')](function(_0x59a6e5){logger[_0x23c6('0x69')](_0x23c6('0xfa'),_0x23c6('0xfb')+_0x5ac976['queue']+_0x23c6('0xfc')+_0x5ac976[_0x23c6('0xd5')],JSON['stringify'](_0x59a6e5));ami[_0x23c6('0x25')]('custom:agentcalled',ut[_0x23c6('0xb7')](_0x5ac976,_0x23c6('0xfd')));_0x3201fa(ut[_0x23c6('0x49')]('Calling'));})['catch'](function(_0x4f6751){ut[_0x23c6('0x5c')](_0x23c6('0xfe'),_0x4f6751);_0x4947bf(ut['message']('Call\x20failed',_0x5d47fa,_0x46f6a3));});}else{_0x952bcf[_0x23c6('0x36')]+=0x1;ut[_0x23c6('0xff')](_0x5ac976);rpcDb[_0x23c6('0x100')](_0x5ac976,_0x23c6('0x101'));delete _0x17bc7a[_0x23c6('0x15')][_0x2cc62a];_0x4947bf(ut[_0x23c6('0x49')](_0x23c6('0x102'),_0x5d47fa,_0x46f6a3));}});};Preview[_0x23c6('0xe')]['isTrunkReachable']=function(_0x5181b6){return!_[_0x23c6('0x68')](_0x5181b6)&&!_['isNil'](_0x5181b6[_0x23c6('0x28')])&&!_[_0x23c6('0x68')](_0x5181b6['active'])&&_0x5181b6['active']&&!_[_0x23c6('0x68')](this[_0x23c6('0x14')][util['format'](_0x23c6('0x103'),_0x5181b6['name'])])&&!_['isNil'](this['trunks'][util[_0x23c6('0x57')](_0x23c6('0x103'),_0x5181b6['name'])][_0x23c6('0x74')])&&(this[_0x23c6('0x14')][util[_0x23c6('0x57')](_0x23c6('0x103'),_0x5181b6[_0x23c6('0x28')])][_0x23c6('0x74')]===_0x23c6('0x104')||this[_0x23c6('0x14')][util[_0x23c6('0x57')](_0x23c6('0x103'),_0x5181b6[_0x23c6('0x28')])][_0x23c6('0x74')]===_0x23c6('0x105'));};Preview[_0x23c6('0xe')]['run']=function(_0x2373d4,_0x219788){var _0x2d6330=this;return new BPromise(function(_0x43415b,_0x2b6187){_0x2d6330[_0x23c6('0x106')](_0x2373d4,_0x219788)[_0x23c6('0x85')](function(_0x51ddf3){_0x43415b(_[_0x23c6('0x6e')](_0x51ddf3,['message']));})['catch'](function(_0x5364a8){if(_0x5364a8[_0x23c6('0x107')]){rpcDb[_0x23c6('0xd4')](_0x2373d4);}if(_0x5364a8[_0x23c6('0x51')]){rpcDb['disableContact'](_0x2373d4);}_0x2b6187(_[_0x23c6('0x6e')](_0x5364a8,[_0x23c6('0x49')]));});});};Preview[_0x23c6('0xe')][_0x23c6('0x106')]=function(_0x30d79c,_0x3a57e3){var _0x638ab2=this;return new BPromise(function(_0x5c9fbb,_0x56da6f){var _0x29fea4,_0x131433;rpcDb[_0x23c6('0x108')](_0x30d79c)[_0x23c6('0x85')](function(_0x114a90){if(!_[_0x23c6('0x68')](_0x114a90[0x0])){_0x131433=_0x114a90[0x0]['recallme']?![]:!![];_0x29fea4=_0x114a90[0x0][_0x23c6('0x109')]?!![]:![];_0x29fea4=_0x3a57e3?!![]:_0x29fea4;}var _0x1264ee=_0x638ab2[_0x23c6('0x10a')](_0x114a90);if(_0x1264ee[_0x23c6('0x10b')]){rpcDb['checkIsBlackList'](_[_0x23c6('0x6e')](_0x114a90[0x0],[_0x23c6('0x71'),_0x23c6('0x10c')]))['then'](function(_0x211a0f){_0x638ab2[_0x23c6('0xf3')](_0x211a0f,_0x114a90[0x0],_0x3a57e3,_0x131433,_0x29fea4)[_0x23c6('0x85')](function(_0xe74889){_0x5c9fbb(_0xe74889);})[_0x23c6('0x76')](function(_0x52b37a){_0x56da6f(_0x52b37a);});})[_0x23c6('0x76')](function(_0x3bade3){ut[_0x23c6('0x5c')](_0x23c6('0x10d'),_0x3bade3);_0x56da6f(ut['message'](_0x23c6('0x10e'),_0x131433,_0x29fea4));});}else{_0x56da6f(ut[_0x23c6('0x49')](_0x1264ee[_0x23c6('0x49')],_0x131433,_0x29fea4));}})[_0x23c6('0x76')](function(_0x2f2023){ut[_0x23c6('0x5c')]('[Preview][getContactPreview]',_0x2f2023);_0x56da6f(ut[_0x23c6('0x49')]('Call\x20unsuccessful',![],!![]));});});};Preview[_0x23c6('0xe')][_0x23c6('0x10a')]=function(_0x3ecbce){if(_['isNil'](_0x3ecbce)||_[_0x23c6('0xf9')](_0x3ecbce)||!_[_0x23c6('0x68')](_0x3ecbce[0x0][_0x23c6('0x83')])&&_[_0x23c6('0x68')](_0x3ecbce[0x0][_0x23c6('0x83')][_0x23c6('0x28')])){ut['logger'](_0x23c6('0x10f'),_0x3ecbce);return{'isValid':![],'message':_0x23c6('0x110')};}var _0x3e3039=this[_0x23c6('0x12')][_0x3ecbce[0x0][_0x23c6('0xf7')][_0x23c6('0x28')]];_0x3e3039['message']=_0x23c6('0x9d');if(_['isNil'](_0x3e3039)){ut[_0x23c6('0x5c')](_0x23c6('0x111'),_0x3e3039);return{'isValid':![],'message':_0x23c6('0x112')};}if(!this[_0x23c6('0x9a')](_0x3e3039[_0x23c6('0x50')])){ut['logger'](_0x23c6('0x113'),_0x23c6('0x114')+_0x3e3039[_0x23c6('0x28')]+_0x23c6('0x115'));if(!this[_0x23c6('0x9a')](_0x3e3039[_0x23c6('0x9b')])){ut['logger'](_0x23c6('0x113'),_0x3e3039['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':_0x23c6('0x116')};}}if(!ut['isActive'](_0x3e3039[_0x23c6('0x31')])){ut[_0x23c6('0x5c')](_0x23c6('0x117'),_0x3e3039[_0x23c6('0x28')]+'\x20Not\x20Active');return{'isValid':![],'message':_0x23c6('0x114')+_0x3e3039[_0x23c6('0x28')]+_0x23c6('0x118')};}return{'isValid':!![],'message':_0x23c6('0x119')};};Preview[_0x23c6('0xe')][_0x23c6('0x11a')]=function(_0x2c0b0e,_0x1cf323,_0x2e5d79,_0x4e1e34){var _0x68abb=this;return new BPromise(function(_0x21b5fc,_0x1d3a7f){var _0x16beca=_0x2c0b0e['uniqueid'];var _0x2d313b=_0x68abb[_0x23c6('0x9a')](_0x1cf323[_0x23c6('0x50')])?util[_0x23c6('0x57')](_0x23c6('0x11b'),_0x1cf323[_0x23c6('0x50')][_0x23c6('0x28')],_['isNil'](_0x1cf323['dialPrefix'])?'':_0x1cf323[_0x23c6('0x11c')][_0x23c6('0x11d')]()||'',_0x1cf323[_0x23c6('0x11e')]>0x0?_0x2e5d79['Contact'][_0x23c6('0xf5')][_0x23c6('0x11f')](_0x1cf323['dialCutDigit']):_0x2e5d79[_0x23c6('0xf4')][_0x23c6('0xf5')]):util[_0x23c6('0x57')]('SIP/%s/%s%s',_['isNil'](_0x1cf323[_0x23c6('0x9b')])?_0x1cf323[_0x23c6('0x50')][_0x23c6('0x28')]:_0x1cf323[_0x23c6('0x9b')][_0x23c6('0x28')],_[_0x23c6('0x68')](_0x1cf323[_0x23c6('0x11c')])?'':_0x1cf323[_0x23c6('0x11c')][_0x23c6('0x11d')]()||'',_0x1cf323[_0x23c6('0x11e')]>0x0?_0x2e5d79['Contact'][_0x23c6('0xf5')][_0x23c6('0x11f')](_0x1cf323[_0x23c6('0x11e')]):_0x2e5d79[_0x23c6('0xf4')][_0x23c6('0xf5')]);var _0x29cb17=_0x68abb[_0x23c6('0x9a')](_0x1cf323['Trunk'])?ut[_0x23c6('0x120')](_0x1cf323[_0x23c6('0x50')]['callerid'],_0x1cf323['dialOriginateCallerIdName'],_0x1cf323[_0x23c6('0x121')]>0x0?ut[_0x23c6('0x122')](_0x1cf323[_0x23c6('0x123')],_0x1cf323[_0x23c6('0x121')]):_0x1cf323[_0x23c6('0x123')]):ut[_0x23c6('0x120')](_[_0x23c6('0x68')](_0x1cf323[_0x23c6('0x9b')])?_0x1cf323[_0x23c6('0x50')][_0x23c6('0x52')]:_0x1cf323[_0x23c6('0x9b')][_0x23c6('0x52')],_0x1cf323['dialOriginateCallerIdName'],_0x1cf323['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x23c6('0x122')](_0x1cf323[_0x23c6('0x123')],_0x1cf323[_0x23c6('0x121')]):_0x1cf323[_0x23c6('0x123')]);if(_0x29cb17){_0x2c0b0e['originatecalleridname']=ut[_0x23c6('0x124')](_0x29cb17);_0x2c0b0e['originatecalleridnum']=ut['extractCalleridNumber'](_0x29cb17);}var _0xdda233=ut[_0x23c6('0x125')](_0x1cf323,_0x2e5d79,_0x2d313b,_0x29cb17,_0x16beca,_0x2c0b0e);_[_0x23c6('0x126')](_0x2c0b0e,ut['toLowerVariables'](_0xdda233));_0x2c0b0e['starttime']=moment()[_0x23c6('0x57')](_0x23c6('0x8a'));ami[_0x23c6('0x73')](ut[_0x23c6('0x127')](_0x2c0b0e,_0x1cf323,_0xdda233,_0x2c0b0e[_0x23c6('0xab')],_0x4e1e34))[_0x23c6('0x85')](function(_0x188382){_0x1cf323[_0x23c6('0x4a')]+=0x1;logger[_0x23c6('0x69')](_0x23c6('0x128'),_0x16beca,'\x20Queue',_0x1cf323[_0x23c6('0x28')],_0x23c6('0x6b'),_0x1cf323['originated']);_0x21b5fc(_0x188382);})[_0x23c6('0x76')](function(_0x4d957e){ut[_0x23c6('0xec')](_0x2c0b0e,0xe,_0x23c6('0x129'));rpcDb[_0x23c6('0xe9')](_0x2c0b0e,_0x23c6('0x12a'));_0x1d3a7f(_0x4d957e);});});};Preview['prototype'][_0x23c6('0x1f')]=function(_0x31d0fc){if(this[_0x23c6('0x15')][_0x31d0fc[_0x23c6('0xac')]]){this[_0x23c6('0x15')][_0x31d0fc[_0x23c6('0xac')]][_0x23c6('0x75')]=_0x31d0fc[_0x23c6('0x75')];}};Preview[_0x23c6('0xe')][_0x23c6('0x19')]=function(_0x3198b3){var _0x2f58bb=this;var _0xc6b58d=this['actions'][_0x3198b3['actionid']];if(_0xc6b58d){if(_0xc6b58d[_0x23c6('0xf8')]&&this['agents'][_0xc6b58d[_0x23c6('0xf8')]]){ut['logLookAgent'](_0xc6b58d,this[_0x23c6('0x16')][_0xc6b58d[_0x23c6('0xf8')]][_0x23c6('0x28')],this[_0x23c6('0x16')][_0xc6b58d[_0x23c6('0xf8')]]['id']);}var _0x260ae8=_['clone'](_0xc6b58d);_0x260ae8['responsetime']=moment()[_0x23c6('0x57')](_0x23c6('0x8a'));var _0x355b39=_0x2f58bb[_0x23c6('0x12')][_0xc6b58d[_0x23c6('0x6c')]];if(ut[_0x23c6('0x12b')](_0x3198b3[_0x23c6('0x12c')])){if(_0xc6b58d['unlockAgent']){rpcDb[_0x23c6('0xd4')](_0xc6b58d[_0x23c6('0xd5')]);}if(_0xc6b58d['activeContact']){rpcDb['disableContact'](_0xc6b58d[_0x23c6('0xd5')]);}ami[_0x23c6('0x25')](_0x23c6('0x12d'),ut[_0x23c6('0xb7')](_0xc6b58d,'rejected'));this[_0x23c6('0x12e')](_0x260ae8,_0x355b39,_0x3198b3);}else{_0xc6b58d[_0x23c6('0x89')]=moment()[_0x23c6('0x57')]('YYYY-MM-DD\x20HH:mm:ss');ut['logAgent'](_0x260ae8,0x4,_0x23c6('0xba'));rpcDb['createAgentHistory'](_0x260ae8,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x23c6('0xe')][_0x23c6('0x12f')]=function(_0x158bb6){var _0x590222=this;var _0x564bf9=this['actions'][_0x158bb6['linkedid']];var _0x2b1167;if(_0x564bf9){_0x2b1167=this[_0x23c6('0x12')][_0x564bf9['queue']];logger[_0x23c6('0x69')](_0x23c6('0x130'),_0x158bb6[_0x23c6('0xac')],_0x23c6('0xb2'),_0x2b1167['name'],'pTalking:\x20',_0x2b1167[_0x23c6('0x5a')]);}if(this[_0x23c6('0x15')][_0x158bb6[_0x23c6('0xac')]]&&_0x158bb6['linkedid']!==_0x158bb6[_0x23c6('0xb1')]){if(_0x158bb6[_0x23c6('0x131')]==='16'&&this['actions'][_0x158bb6[_0x23c6('0xac')]][_0x23c6('0x78')]){this[_0x23c6('0x9e')](_0x158bb6,_0x158bb6[_0x23c6('0xac')],_0x158bb6[_0x23c6('0x131')]);}else if(this['actions'][_0x158bb6[_0x23c6('0xac')]][_0x23c6('0x78')]){logger[_0x23c6('0x69')]('[syncHangup][talking][cause]',_0x158bb6[_0x23c6('0xac')],_0x158bb6[_0x23c6('0x131')],_0x23c6('0xb2'),_0x2b1167[_0x23c6('0x28')],_0x23c6('0x6d'),_0x2b1167[_0x23c6('0x5a')]);this[_0x23c6('0x9e')](_0x158bb6,_0x158bb6[_0x23c6('0xac')],_0x158bb6['cause']);}}else if(_0x564bf9&&_['isNil'](_0x564bf9[_0x23c6('0x132')])&&_0x2b1167[_0x23c6('0x133')]&&_0x158bb6[_0x23c6('0xac')]===_0x158bb6[_0x23c6('0xb1')]&&_[_0x23c6('0x68')](_0x158bb6[_0x23c6('0xe8')])&&_0x158bb6[_0x23c6('0x131')]==='16'&&_0x158bb6[_0x23c6('0x134')]==='6'&&_[_0x23c6('0xe6')](_0x564bf9['transfer'])){if(_0x564bf9[_0x23c6('0xaa')]){rpcDb[_0x23c6('0xd4')](_0x564bf9['idContact']);}if(_0x564bf9[_0x23c6('0xab')]){rpcDb[_0x23c6('0x88')](_0x564bf9[_0x23c6('0xd5')]);}_0x158bb6[_0x23c6('0xe8')]='22';this[_0x23c6('0x12e')](_0x564bf9,_0x2b1167,_0x158bb6);}else if(_0x564bf9&&_0x564bf9[_0x23c6('0x135')]){if(_0x158bb6[_0x23c6('0x131')]==='16'&&this[_0x23c6('0x15')][_0x158bb6['linkedid']][_0x23c6('0x78')]){logger[_0x23c6('0x69')]('[syncHangup][talking][transfer]',_0x158bb6['linkedid'],_0x158bb6[_0x23c6('0x131')],'\x20Queue',_0x2b1167[_0x23c6('0x28')],_0x23c6('0x6d'),_0x2b1167[_0x23c6('0x5a')]);this[_0x23c6('0x9e')](_0x158bb6,_0x158bb6[_0x23c6('0xac')],_0x158bb6[_0x23c6('0x131')]);}else if(this[_0x23c6('0x15')][_0x158bb6[_0x23c6('0xac')]][_0x23c6('0x78')]){logger[_0x23c6('0x69')]('[syncHangup][talking][cause]',_0x158bb6['linkedid'],_0x158bb6[_0x23c6('0x131')],_0x23c6('0xb2'),_0x2b1167[_0x23c6('0x28')],_0x23c6('0x6d'),_0x2b1167[_0x23c6('0x5a')]);this[_0x23c6('0x9e')](_0x158bb6,_0x158bb6['linkedid'],_0x158bb6['cause']);}}};Preview[_0x23c6('0xe')][_0x23c6('0x1e')]=function(_0x4e5359){if(this[_0x23c6('0x15')][_0x4e5359['destlinkedid']]&&_0x4e5359[_0x23c6('0x136')]!==_0x4e5359['destuniqueid']){this[_0x23c6('0x9e')](_0x4e5359,_0x4e5359[_0x23c6('0x136')],_0x4e5359[_0x23c6('0xe1')]);}};Preview[_0x23c6('0xe')][_0x23c6('0x1d')]=function(_0x2c380f){if(this['actions'][_0x2c380f[_0x23c6('0xac')]]&&_0x2c380f[_0x23c6('0xac')]!==_0x2c380f['uniqueid']&&!this[_0x23c6('0x15')][_0x2c380f[_0x23c6('0xac')]]['dialAnswer']){if(_0x2c380f[_0x23c6('0x131')]==='1'){this[_0x23c6('0x9e')](_0x2c380f,_0x2c380f[_0x23c6('0xac')],_0x2c380f[_0x23c6('0x131')]);}}};Preview['prototype'][_0x23c6('0x137')]=function(_0x27c644,_0xdd32aa,_0x24d4cd){if(this['actions'][_0x27c644]){if(_[_0x23c6('0x68')](this[_0x23c6('0x15')][_0x27c644][_0x23c6('0x138')])){this['actions'][_0x27c644][_0x23c6('0x138')]={};}this[_0x23c6('0x15')][_0x27c644][_0x23c6('0x138')][_0xdd32aa]=_0x24d4cd;}};Preview[_0x23c6('0xe')][_0x23c6('0x20')]=function(_0x31cd82){try{if(!_[_0x23c6('0x68')](_0x31cd82)){if(ut[_0x23c6('0x139')](_[_0x23c6('0x13a')](_0x31cd82[_0x23c6('0x13b')])[0x0])){this[_0x23c6('0x137')](_0x31cd82['uniqueid'],_[_0x23c6('0x13a')](_0x31cd82[_0x23c6('0x13b')])[0x0],_0x31cd82[_0x23c6('0x13c')]);}}}catch(_0x57832f){logger['error'](_0x23c6('0x13d'),util[_0x23c6('0x13e')](_0x57832f,{'showHidden':![],'depth':null}));}};Preview[_0x23c6('0xe')]['syncAttendedTransfer']=function(_0x1afba0){if(_0x1afba0){if(this['actions'][_0x1afba0['transfertargetlinkedid']]){this[_0x23c6('0x15')][_0x1afba0[_0x23c6('0x13f')]]['transfer']=!![];}}};Preview['prototype'][_0x23c6('0x24')]=function(_0x413d7f){if(_0x413d7f){if(this[_0x23c6('0x15')][_0x413d7f[_0x23c6('0x140')]]){this[_0x23c6('0x15')][_0x413d7f[_0x23c6('0x140')]][_0x23c6('0x135')]=!![];}}};module['exports']=Preview; \ No newline at end of file +var _0x3e74=['[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','campaign\x20Name:\x20','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','execCall','dialPrefix','trim','Contact','substring','dialCutDigit','SIP/%s/%s%s','TrunkBackup','callerid','dialOriginateCallerIdName','getCallerIdRandom','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerId','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','merge','toLowerVariables','starttime','[originated][increment]','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','clone','response','disableContact','rejected','pTalking:\x20','cause','callProgressDetectingCustomer','[syncHangup][talking][cause]','dialQueueProject','channelstate','transfer','addVariable','variables','keys','variable','value','error','[syncVarSet][Preview]','inspect','transfertargetlinkedid','transfererlinkedid','util','bluebird','uuid','moment','../../../config/environment','preview','../../../config/logger','actionPreview','../ami','./rpcDb','./util/util','redis','defaults','localhost','tail','sequence','voiceQueues','trunks','actions','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','syncDialEnd','newexten','varset','syncVarSet','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','campaignsPreview','emit','type','outbound','name','strategy','answered','loggedIn','sumDuration','sumHoldTime','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','outboundAbandonedCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','message','originated','erlangCalls','startPredictive','startProgressive','Trunk','Interval','stringify','md5','format','voice:queue:%s','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','pTalking','available','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','\x20is\x20disactive','prototype','syncCampaigns','hasOwnProperty','recallMe','clearZombieChannel','isNil','[clearZombieChannels][talking]','Queue','queue','contactId','VoiceQueueId','ListId','Action','status','channel','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','dialAnswer','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','clearZombieChannels','[action]','size','getContactRecallMe','then','scheduledat','dialRecallMeTimeout','Agent','voicePause','logger2','catch','[RecallMe]','YYYY-MM-DD\x20HH:mm:ss','logCustomer','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','[getContactRecallMe]','setMessage','isTrunkReachable','TRUNK_IS_NOT_REACHABLE','ACTIVE','DIALCAUSE=','countglobal','totalGlobal','NoSuchNumber','dialGlobalMaxRetry','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','countnosuchnumberretry','dialNoSuchNumberMaxRetry','rescheduleContact','scheduledAt','unlockAgent','activeContact','linkedid','NOSUCHNUMBER','[callProgressDetectingCustomer][logNoSuch]','ANSWER','responsetime','answertime','\x20Queue','custom:agentconnect','buildObj','custom:agentConnectPreview','buildAcw','complete','decrementTalkink','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','crateCustomerReportQueue','talktime','sumBillable','BUSY','countbusyretry','Busy','cloneAction','dialBusyMaxRetry','NOANSWER','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','dialBusyRetryFrequency','AgentReject','[syncHangupRequest][logAgentReject]','unlockContact','idContact','ABANDONED','Abandoned','[callProgressDetectingCustomer][logAbandoned]','countabandonedetry','dialAbandonedMaxRety','countabandonedretry','dialAbandonedRetryFrequency','[default]','[Dialer][decrementTalkink][no\x20Hangup][Preview]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknown]','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','logAgent','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent]','[originated][decrement][callProgressDetectingAgent]','uniqueid','originated:\x20','checkInBlack','phone','Contact\x20is\x20undefined','agents','lookAgent','isEmpty','[Preview][execCall][success]','Queue:\x20','custom:agentcalled','Calling','[Preview][execCall][failure]','Call\x20failed','createHistory','[Blacklist][error]','active','SIP/%s','reachable','run','execRun','pick','unlock','getContactPreview','recallme','validateContact','isValid','checkIsBlackList','Contact.phone'];(function(_0x269fba,_0xa68777){var _0x1eeb74=function(_0x14e7d1){while(--_0x14e7d1){_0x269fba['push'](_0x269fba['shift']());}};_0x1eeb74(++_0xa68777);}(_0x3e74,0x175));var _0x43e7=function(_0x550296,_0x361a81){_0x550296=_0x550296-0x0;var _0x7d67e7=_0x3e74[_0x550296];return _0x7d67e7;};'use strict';var util=require(_0x43e7('0x0'));var _=require('lodash');var BPromise=require(_0x43e7('0x1'));var uuid=require(_0x43e7('0x2'));var moment=require(_0x43e7('0x3'));var md5=require('md5');var Redis=require('ioredis');var config=require(_0x43e7('0x4'));var logger=require('../../../config/logger')(_0x43e7('0x5'));var loggerAction=require(_0x43e7('0x6'))(_0x43e7('0x7'));var ami=require(_0x43e7('0x8'));var rpcDb=require(_0x43e7('0x9'));var Action=require('./action');var ut=require(_0x43e7('0xa'));config[_0x43e7('0xb')]=_[_0x43e7('0xc')](config[_0x43e7('0xb')],{'host':_0x43e7('0xd'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x43e7('0xb')]));var Sequence=function(){};Sequence['prototype']['enqueue']=function(_0x39c8bd){this[_0x43e7('0xe')]=this['tail']?this[_0x43e7('0xe')]['finally'](_0x39c8bd):_0x39c8bd();};function Preview(_0xf7c520){this[_0x43e7('0xf')]=new Sequence();this['campaignsPreview']=_0xf7c520[_0x43e7('0x10')];this[_0x43e7('0x11')]=_0xf7c520[_0x43e7('0x11')];this[_0x43e7('0x12')]={};this['agents']=_0xf7c520['agents'];this[_0x43e7('0x13')]=0x0;ami['on'](_0x43e7('0x14'),this[_0x43e7('0x15')]['bind'](this));ami['on']('hangup',this[_0x43e7('0x16')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x18'),this[_0x43e7('0x19')]['bind'](this));ami['on']('dialend',this[_0x43e7('0x1a')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1b'),this['syncNewExten']['bind'](this));ami['on'](_0x43e7('0x1c'),this[_0x43e7('0x1d')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x1e'),this[_0x43e7('0x1f')][_0x43e7('0x17')](this));ami['on'](_0x43e7('0x20'),this[_0x43e7('0x21')][_0x43e7('0x17')](this));this[_0x43e7('0x22')](this[_0x43e7('0x23')]);}function emit(_0x177ee1,_0x4b5d64,_0xef1a5a){io['to'](_0x177ee1)[_0x43e7('0x24')](_0x4b5d64,_0xef1a5a);}function emitCampaignPreview(_0x4b386b){if(_0x4b386b[_0x43e7('0x25')]===_0x43e7('0x26')){var _0x3945bb={'id':_0x4b386b['id'],'name':_0x4b386b[_0x43e7('0x27')],'strategy':_0x4b386b[_0x43e7('0x28')],'answered':_0x4b386b[_0x43e7('0x29')],'available':_0x4b386b['available'],'loggedIn':_0x4b386b[_0x43e7('0x2a')],'pTalking':_0x4b386b['pTalking'],'sumBillable':_0x4b386b['sumBillable'],'sumDuration':_0x4b386b[_0x43e7('0x2b')],'sumHoldTime':_0x4b386b[_0x43e7('0x2c')]||0x0,'talking':_0x4b386b['talking'],'total':_0x4b386b[_0x43e7('0x2d')],'type':_0x4b386b['type'],'unmanaged':_0x4b386b[_0x43e7('0x2e')],'abandoned':_0x4b386b['abandoned'],'waiting':_0x4b386b[_0x43e7('0x2f')],'loggedInDb':_0x4b386b[_0x43e7('0x30')],'dialActive':_0x4b386b[_0x43e7('0x31')],'dialMethod':_0x4b386b[_0x43e7('0x32')],'dialOriginateCallerIdName':_0x4b386b['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x4b386b['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x4b386b[_0x43e7('0x33')],'dialPrefix':_0x4b386b['dialPrefix'],'outboundAnswerAgiCallsDay':_0x4b386b[_0x43e7('0x34')],'outboundAnswerCallsDay':_0x4b386b[_0x43e7('0x35')],'outboundBlacklistCallsDay':_0x4b386b[_0x43e7('0x36')],'outboundBusyCallsDay':_0x4b386b[_0x43e7('0x37')],'outboundCongestionCallsDay':_0x4b386b['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x4b386b[_0x43e7('0x38')],'outboundDropCallsDayCallersExit':_0x4b386b[_0x43e7('0x39')],'outboundDropCallsDayTimeout':_0x4b386b[_0x43e7('0x3a')],'outboundNoAnswerCallsDay':_0x4b386b[_0x43e7('0x3b')],'outboundNoSuchCallsDay':_0x4b386b[_0x43e7('0x3c')],'outboundOriginateFailureCallsDay':_0x4b386b[_0x43e7('0x3d')],'outboundReCallsDay':_0x4b386b[_0x43e7('0x3e')],'outboundRejectCallsDay':_0x4b386b[_0x43e7('0x3f')],'outboundUnknownCallsDay':_0x4b386b[_0x43e7('0x40')],'outboundAbandonedCallsDay':_0x4b386b[_0x43e7('0x41')],'predictiveIntervalAnsweredCalls':_0x4b386b[_0x43e7('0x42')],'predictiveIntervalAvgHoldtime':_0x4b386b[_0x43e7('0x43')],'predictiveIntervalAvgTalktime':_0x4b386b[_0x43e7('0x44')],'predictiveIntervalDroppedCallsCallersExit':_0x4b386b[_0x43e7('0x45')],'predictiveIntervalDroppedCallsTimeout':_0x4b386b['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x4b386b[_0x43e7('0x46')],'predictiveIntervalErlangCallsDroppedCalls':_0x4b386b[_0x43e7('0x47')],'predictiveIntervalHitRate':_0x4b386b[_0x43e7('0x48')],'predictiveIntervalMultiplicativeFactor':_0x4b386b[_0x43e7('0x49')],'predictiveIntervalPauses':_0x4b386b[_0x43e7('0x4a')],'predictiveIntervalAvailable':_0x4b386b['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x4b386b[_0x43e7('0x4b')],'message':_0x4b386b[_0x43e7('0x4c')],'originated':_0x4b386b[_0x43e7('0x4d')],'erlangCalls':_0x4b386b[_0x43e7('0x4e')],'erlangCallToSecond':_0x4b386b['erlangCallToSecond'],'erlangAbandonmentRate':_0x4b386b['erlangAbandonmentRate'],'erlangBusyFactor':_0x4b386b['erlangBusyFactor'],'startPredictive':_0x4b386b[_0x43e7('0x4f')],'startProgressive':_0x4b386b[_0x43e7('0x50')]};if(_0x4b386b[_0x43e7('0x51')]){_0x3945bb[_0x43e7('0x51')]={'id':_0x4b386b[_0x43e7('0x51')]['id'],'name':_0x4b386b[_0x43e7('0x51')]['name'],'active':_0x4b386b['Trunk']['active'],'callerid':_0x4b386b['Trunk']['callerid']};}if(_0x4b386b['Interval']){_0x3945bb['Interval']={'id':_0x4b386b[_0x43e7('0x52')]['id'],'name':_0x4b386b['Interval'][_0x43e7('0x27')]};}var _0x8e9f40=md5(JSON[_0x43e7('0x53')](_0x3945bb));if(_0x4b386b[_0x43e7('0x54')]!==_0x8e9f40){_0x4b386b[_0x43e7('0x54')]=_0x8e9f40;emit(util[_0x43e7('0x55')](_0x43e7('0x56'),_0x3945bb['name']),'voice_queue:save',_0x3945bb);}}}function emitVoiceQueueChannelRemove(_0x5d84f4){logger[_0x43e7('0x57')](_0x43e7('0x58'),JSON[_0x43e7('0x53')](_0x5d84f4));emit(util[_0x43e7('0x55')](_0x43e7('0x56'),_0x5d84f4[_0x43e7('0x27')]),_0x43e7('0x59'),_0x5d84f4);}function notSendMessagesQueue(_0x2ffd43){if(_0x2ffd43['sendMessageOneNotActive']){if(_0x2ffd43[_0x43e7('0x4d')]===0x0&&_0x2ffd43[_0x43e7('0x5a')]===0x0){_0x2ffd43['sendMessageOneNotActive']=![];_0x2ffd43[_0x43e7('0x5b')]=0x0;_0x2ffd43['paused']=0x0;_0x2ffd43[_0x43e7('0x4c')]=_0x43e7('0x5c');ut[_0x43e7('0x5d')](_0x43e7('0x5e'),_0x2ffd43[_0x43e7('0x27')]+_0x43e7('0x5f'));}else{_0x2ffd43['message']='IS_DISACTIVED';ut[_0x43e7('0x5d')](_0x43e7('0x5e'),_0x2ffd43[_0x43e7('0x27')]+_0x43e7('0x60'));}emitCampaignPreview(_0x2ffd43);}}Preview[_0x43e7('0x61')]['loopCampaigns']=function(){var _0x32a451=this;setInterval(function(){_0x32a451[_0x43e7('0x62')]();},0x7cf);};Preview['prototype'][_0x43e7('0x62')]=function(){var _0x51a69c=this[_0x43e7('0x23')];this['clockClearZombieChannels']+=0x1;for(var _0x3d81ae in _0x51a69c){if(_0x51a69c[_0x43e7('0x63')](_0x3d81ae)&&(_0x51a69c[_0x3d81ae][_0x43e7('0x32')]===_0x43e7('0x5')||_0x51a69c[_0x3d81ae]['dialMethod']==='booked')&&_0x51a69c[_0x3d81ae][_0x43e7('0x25')]===_0x43e7('0x26')){if(this[_0x43e7('0x13')]>0x7){this[_0x43e7('0x13')]=0x0;this['clearZombieChannels']();}}if(_0x51a69c['hasOwnProperty'](_0x3d81ae)&&_0x51a69c[_0x3d81ae]['dialMethod']===_0x43e7('0x5')&&_0x51a69c[_0x3d81ae]['type']===_0x43e7('0x26')){if(_0x51a69c[_0x3d81ae]['dialActive']){this['setMessage'](_0x51a69c[_0x3d81ae]);this[_0x43e7('0x64')](_0x51a69c[_0x3d81ae]);}else{notSendMessagesQueue(_0x51a69c[_0x3d81ae]);}}}};Preview['prototype'][_0x43e7('0x65')]=function(_0x39db7f){var _0x257bd8=this;this[_0x43e7('0xf')]['enqueue'](function(){if(!_[_0x43e7('0x66')](_0x257bd8[_0x43e7('0x12')][_0x39db7f])){loggerAction[_0x43e7('0x57')](_0x43e7('0x67'),_0x39db7f,_0x43e7('0x68'),_0x257bd8[_0x43e7('0x12')][_0x39db7f]['queue'],'originated:\x20',JSON[_0x43e7('0x53')](_0x257bd8[_0x43e7('0x23')][_0x257bd8[_0x43e7('0x12')][_0x39db7f]['queue']]['originated']),'pTalking:\x20',JSON[_0x43e7('0x53')](_0x257bd8[_0x43e7('0x23')][_0x257bd8['actions'][_0x39db7f][_0x43e7('0x69')]][_0x43e7('0x5a')]),JSON[_0x43e7('0x53')](_0x257bd8['actions'][_0x39db7f]['dialAnswer']),JSON['stringify'](_['pick'](_0x257bd8[_0x43e7('0x12')][_0x39db7f],[_0x43e7('0x6a'),'UserId',_0x43e7('0x6b'),_0x43e7('0x6c')])));return ami[_0x43e7('0x6d')]({'action':_0x43e7('0x6e'),'channel':_0x257bd8['actions'][_0x39db7f][_0x43e7('0x6f')]})['catch'](function(_0x4bebd4){if(_0x4bebd4[_0x43e7('0x4c')]===_0x43e7('0x70')){setTimeout(function(){if(_0x257bd8[_0x43e7('0x12')][_0x39db7f]){ut[_0x43e7('0x71')](_0x257bd8[_0x43e7('0x23')][_0x257bd8[_0x43e7('0x12')][_0x39db7f][_0x43e7('0x69')]],_0x43e7('0x72'));if(_0x257bd8[_0x43e7('0x12')][_0x39db7f][_0x43e7('0x73')]===!![]){ut['decrementTalkink'](_0x257bd8[_0x43e7('0x23')][_0x257bd8[_0x43e7('0x12')][_0x39db7f]['queue']],_0x43e7('0x72'));ut['loggerError'](_0x43e7('0x74')+_0x39db7f,_0x257bd8[_0x43e7('0x12')][_0x39db7f][_0x43e7('0x69')]);}ut[_0x43e7('0x75')](_0x43e7('0x76')+_0x39db7f,_0x257bd8['actions'][_0x39db7f]['queue']);delete _0x257bd8[_0x43e7('0x12')][_0x39db7f];}},0x2328);}});}});};Preview[_0x43e7('0x61')][_0x43e7('0x77')]=function(){var _0x29c53d=this;loggerAction[_0x43e7('0x57')](_0x43e7('0x78'),_[_0x43e7('0x79')](this[_0x43e7('0x12')]));for(var _0x26d86c in this[_0x43e7('0x12')]){if(_0x29c53d[_0x43e7('0x12')]['hasOwnProperty'](_0x26d86c)){_0x29c53d[_0x43e7('0x65')](_0x26d86c);}}};Preview[_0x43e7('0x61')]['recallMe']=function(_0x4314d8){var _0x220bf2=this;rpcDb[_0x43e7('0x7a')](_0x4314d8['id'],ut['agentReadyId'](this['agents']))[_0x43e7('0x7b')](function(_0x3d9a29){if(!_['isNil'](_0x3d9a29)){for(var _0x283dd8=0x0;_0x283dd8<_0x3d9a29['length'];_0x283dd8+=0x1){if(ut['getDiff'](_0x3d9a29[_0x283dd8][_0x43e7('0x7c')])<_0x4314d8[_0x43e7('0x7d')]*0x3c){if(_0x3d9a29[_0x283dd8][_0x43e7('0x7e')]&&!_0x3d9a29[_0x283dd8][_0x43e7('0x7e')][_0x43e7('0x7f')]){_0x220bf2['run'](_0x3d9a29[_0x283dd8]['id'])[_0x43e7('0x7b')](ut[_0x43e7('0x80')]('[RecallMe]'))[_0x43e7('0x81')](ut[_0x43e7('0x80')](_0x43e7('0x82')));}else{rpcDb['disableContact'](_0x3d9a29[_0x283dd8]['id']);}}else{var _0x5a4c95=new Action(_0x3d9a29[_0x283dd8],_0x4314d8);_0x5a4c95['starttime']=moment()[_0x43e7('0x55')](_0x43e7('0x83'));_0x4314d8[_0x43e7('0x3e')]+=0x1;ut[_0x43e7('0x84')](_0x5a4c95,0x17,'RecallInQueue');if(_0x4314d8['dialRecallInQueue']){rpcDb[_0x43e7('0x85')](ut[_0x43e7('0x86')](_0x3d9a29[_0x283dd8]));rpcDb[_0x43e7('0x87')](_0x5a4c95,_0x43e7('0x88'));}else{ut['logCustomer'](_0x5a4c95,0x16,_0x43e7('0x89'));rpcDb[_0x43e7('0x87')](_0x5a4c95,_0x43e7('0x8a'));rpcDb[_0x43e7('0x8b')](_0x5a4c95,_0x43e7('0x8a'));}}}}})[_0x43e7('0x81')](ut[_0x43e7('0x80')](_0x43e7('0x8c')));};Preview[_0x43e7('0x61')][_0x43e7('0x8d')]=function(_0x252f00){_0x252f00['sendMessageOneNotActive']=!![];if(ut['IsNotLoggedIn'](_0x252f00[_0x43e7('0x2a')])){_0x252f00['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x252f00[_0x43e7('0x31')])){_0x252f00[_0x43e7('0x4c')]='NOT_ACTIVE';}else if(!this[_0x43e7('0x8e')](_0x252f00[_0x43e7('0x51')])){if(!this[_0x43e7('0x8e')](_0x252f00['TrunkBackup'])){_0x252f00[_0x43e7('0x4c')]=_0x43e7('0x8f');}else{_0x252f00[_0x43e7('0x4c')]=_0x43e7('0x90');}}else{_0x252f00[_0x43e7('0x4c')]=_0x43e7('0x90');}emitCampaignPreview(_0x252f00);};Preview[_0x43e7('0x61')]['callProgressDetectingCustomer']=function(_0x1f5e5b,_0x40d0c0,_0x415f26){var _0x549f4e=this;var _0x56b06d=this[_0x43e7('0x12')][_0x40d0c0];var _0x5c3ad8=this['campaignsPreview'][_0x56b06d[_0x43e7('0x69')]];var _0x154e47;if(_0x5c3ad8){console['log'](_0x43e7('0x91'),_0x415f26);switch(_0x415f26){case'1':_0x5c3ad8[_0x43e7('0x3c')]+=0x1;_0x56b06d[_0x43e7('0x92')]=ut[_0x43e7('0x93')](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0x0,_0x43e7('0x94'));rpcDb[_0x43e7('0x87')](_0x56b06d,'[callProgressDetectingCustomer][logNoSuch]');if(ut[_0x43e7('0x93')](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut['cloneAction'](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb['createCustomerFinal'](_0x154e47,_0x43e7('0x97'));}else{if(_0x56b06d[_0x43e7('0x98')]>=_0x5c3ad8[_0x43e7('0x99')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x43e7('0x9a')](ut[_0x43e7('0x9b')](_0x56b06d,_0x43e7('0x98'),_0x5c3ad8['dialNoSuchNumberRetryFrequency']),_0x56b06d[_0x43e7('0x9c')],_0x56b06d[_0x43e7('0x9d')]);}}delete this[_0x43e7('0x12')][_0x1f5e5b[_0x43e7('0x9e')]];break;case _0x43e7('0x9f'):_0x5c3ad8['outboundNoSuchCallsDay']+=0x1;_0x56b06d[_0x43e7('0x92')]=ut[_0x43e7('0x93')](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0x0,_0x43e7('0x94'));rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xa0'));if(ut[_0x43e7('0x93')](_0x56b06d)>=_0x5c3ad8['dialGlobalMaxRetry']){_0x154e47=ut['cloneAction'](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb['createCustomerFinal'](_0x154e47,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{if(_0x56b06d['countnosuchnumberretry']>=_0x5c3ad8[_0x43e7('0x99')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,_0x43e7('0x97'));}else{rpcDb[_0x43e7('0x9a')](ut[_0x43e7('0x9b')](_0x56b06d,_0x43e7('0x98'),_0x5c3ad8['dialNoSuchNumberRetryFrequency']),_0x56b06d[_0x43e7('0x9c')],_0x56b06d[_0x43e7('0x9d')]);}}delete this[_0x43e7('0x12')][_0x1f5e5b['linkedid']];break;case _0x43e7('0xa1'):var _0xea84ec=moment()[_0x43e7('0x55')](_0x43e7('0x83'));_0x56b06d[_0x43e7('0xa2')]=_0xea84ec;_0x56b06d[_0x43e7('0xa3')]=_0xea84ec;_0x56b06d[_0x43e7('0x73')]=!![];_0x5c3ad8[_0x43e7('0x5a')]+=0x1;logger['info']('[syncHangup][talking][increment]',_0x56b06d['uniqueid'],_0x43e7('0xa4'),_0x5c3ad8[_0x43e7('0x27')],'pTalking:\x20',_0x5c3ad8[_0x43e7('0x5a')]);ami[_0x43e7('0x24')](_0x43e7('0xa5'),ut[_0x43e7('0xa6')](_0x56b06d,'connect'));if(_0x5c3ad8['acw']){ami['emit'](_0x43e7('0xa7'),ut[_0x43e7('0xa8')](_0x56b06d));}break;case'16':ami['emit']('custom:agentcomplete',ut[_0x43e7('0xa6')](_0x56b06d,_0x43e7('0xa9')));emitVoiceQueueChannelRemove(ut[_0x43e7('0xa6')](_0x56b06d,'complete'));_0x5c3ad8[_0x43e7('0x35')]+=0x1;_0x5c3ad8[_0x43e7('0x2d')]+=0x1;_0x5c3ad8[_0x43e7('0x29')]+=0x1;ut[_0x43e7('0xaa')](_0x5c3ad8,'[16]');_0x56b06d[_0x43e7('0x92')]=ut['totalGlobal'](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0x4,_0x43e7('0xab'));rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xac'));rpcDb[_0x43e7('0x8b')](_0x56b06d,_0x43e7('0xad'));rpcDb[_0x43e7('0xae')](_0x56b06d);_0x5c3ad8['sumDuration']+=_0x56b06d[_0x43e7('0xaf')];_0x5c3ad8[_0x43e7('0xb0')]+=_0x56b06d[_0x43e7('0xaf')];logger[_0x43e7('0x57')]('[syncHangup][talking][decrement]',_0x56b06d['uniqueid'],'\x20Queue',_0x5c3ad8[_0x43e7('0x27')],'pTalking:\x20',_0x5c3ad8[_0x43e7('0x5a')]);delete this[_0x43e7('0x12')][_0x1f5e5b[_0x43e7('0x9e')]];break;case _0x43e7('0xb1'):_0x5c3ad8[_0x43e7('0x37')]+=0x1;_0x56b06d[_0x43e7('0xb2')]+=0x1;_0x56b06d[_0x43e7('0x92')]=ut[_0x43e7('0x93')](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0x5,_0x43e7('0xb3'));rpcDb[_0x43e7('0x87')](_0x56b06d,'[callProgressDetectingCustomer][logBusy]');if(ut[_0x43e7('0x93')](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut[_0x43e7('0xb4')](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb[_0x43e7('0x8b')](_0x154e47,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x56b06d['countbusyretry']>=_0x5c3ad8[_0x43e7('0xb5')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x43e7('0x9a')](ut[_0x43e7('0x9b')](_0x56b06d,'countbusyretry',_0x5c3ad8['dialBusyRetryFrequency']),_0x56b06d[_0x43e7('0x9c')],_0x56b06d[_0x43e7('0x9d')]);}}break;case _0x43e7('0xb6'):_0x5c3ad8[_0x43e7('0x3b')]+=0x1;_0x56b06d[_0x43e7('0xb7')]+=0x1;_0x56b06d['countglobal']=ut['totalGlobal'](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0x3,_0x43e7('0xb8'));rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xb9'));if(ut['totalGlobal'](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut[_0x43e7('0xb4')](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb[_0x43e7('0x8b')](_0x154e47,'[callProgressDetectingCustomer][logNoAnswerGlobal]');}else{if(_0x56b06d[_0x43e7('0xb7')]>=_0x5c3ad8[_0x43e7('0xba')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,_0x43e7('0xb9'));}else{rpcDb[_0x43e7('0x9a')](ut['scheduledAt'](_0x56b06d,_0x43e7('0xb7'),_0x5c3ad8[_0x43e7('0xbb')]),_0x56b06d['unlockAgent'],_0x56b06d[_0x43e7('0x9d')]);}}break;case _0x43e7('0xbc'):_0x5c3ad8[_0x43e7('0xbd')]+=0x1;_0x56b06d[_0x43e7('0xbe')]+=0x1;_0x56b06d['countglobal']=ut[_0x43e7('0x93')](_0x56b06d);ut['logCustomer'](_0x56b06d,0x8,_0x43e7('0xbf'));rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xc0'));if(ut[_0x43e7('0x93')](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut[_0x43e7('0xb4')](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb[_0x43e7('0x8b')](_0x154e47,_0x43e7('0xc1'));}else{if(_0x56b06d['countcongestionretry']>=_0x5c3ad8[_0x43e7('0xc2')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,_0x43e7('0xc0'));}else{rpcDb[_0x43e7('0x9a')](ut['scheduledAt'](_0x56b06d,'countcongestionretry',_0x5c3ad8[_0x43e7('0xc3')]),_0x56b06d[_0x43e7('0x9c')],_0x56b06d[_0x43e7('0x9d')]);}}break;case'CANCEL':_0x5c3ad8[_0x43e7('0x3f')]+=0x1;_0x56b06d['countglobal']=ut['totalGlobal'](_0x56b06d);ut['logCustomer'](_0x56b06d,0x14,_0x43e7('0xc4'));rpcDb['createCustomerHistory'](_0x56b06d,_0x43e7('0xc5'));if(_0x56b06d[_0x43e7('0x9c')]){rpcDb[_0x43e7('0xc6')](_0x56b06d[_0x43e7('0xc7')]);}if(_0x56b06d[_0x43e7('0x9d')]){rpcDb['disableContact'](_0x56b06d['idContact']);}break;case _0x43e7('0xc8'):_0x5c3ad8[_0x43e7('0x41')]+=0x1;_0x56b06d['countabandonedretry']+=0x1;_0x56b06d[_0x43e7('0x92')]=ut[_0x43e7('0x93')](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0xb,_0x43e7('0xc9'));rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xca'));if(ut[_0x43e7('0x93')](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut[_0x43e7('0xb4')](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb[_0x43e7('0x8b')](_0x154e47,_0x43e7('0xca'));}else{if(_0x56b06d[_0x43e7('0xcb')]>=_0x5c3ad8[_0x43e7('0xcc')]){rpcDb[_0x43e7('0x8b')](_0x56b06d,_0x43e7('0xca'));}else{rpcDb[_0x43e7('0x9a')](ut[_0x43e7('0x9b')](_0x56b06d,_0x43e7('0xcd'),_0x5c3ad8[_0x43e7('0xce')]),_0x56b06d[_0x43e7('0x9c')],_0x56b06d[_0x43e7('0x9d')]);}}break;default:if(_0x56b06d['dialAnswer']){ut[_0x43e7('0xaa')](_0x5c3ad8,_0x43e7('0xcf'));ut[_0x43e7('0x75')](_0x43e7('0xd0')+_0x5c3ad8['name'],_0x1f5e5b);}_0x5c3ad8[_0x43e7('0x40')]+=0x1;_0x56b06d['countglobal']=ut[_0x43e7('0x93')](_0x56b06d);ut[_0x43e7('0x84')](_0x56b06d,0xc,_0x1f5e5b[_0x43e7('0xd1')]||_0x1f5e5b[_0x43e7('0xd2')]);rpcDb[_0x43e7('0x87')](_0x56b06d,_0x43e7('0xd3'));if(ut['totalGlobal'](_0x56b06d)>=_0x5c3ad8[_0x43e7('0x95')]){_0x154e47=ut[_0x43e7('0xb4')](_0x56b06d,0xf,_0x43e7('0x96'));rpcDb[_0x43e7('0x8b')](_0x154e47,_0x43e7('0xd4'));}else{rpcDb['createCustomerFinal'](_0x56b06d,'[callProgressDetectingCustomer][logUnknownGlobal]');}delete this[_0x43e7('0x12')][_0x1f5e5b['linkedid']];}if(!(_0x56b06d[_0x43e7('0x73')]&&_0x415f26==='16')){ut[_0x43e7('0x71')](_0x5c3ad8,_0x43e7('0xd5'));logger[_0x43e7('0x57')]('[originated][decrement][callProgressDetectingCustomer]',_0x56b06d['uniqueid'],'\x20Queue',_0x5c3ad8[_0x43e7('0x27')],'originated:\x20',_0x5c3ad8['originated']);}if(_0x415f26!=='ANSWER'){delete this[_0x43e7('0x12')][_0x1f5e5b[_0x43e7('0x9e')]];delete this['actions'][_0x1f5e5b[_0x43e7('0xd6')]];}}};Preview['prototype'][_0x43e7('0xd7')]=function(_0x2e1500,_0x271f55,_0x3b64dd){if(_[_0x43e7('0xd8')](_0x271f55)&&'object'!==typeof _0x271f55){return;}if(_[_0x43e7('0xd8')](_0x3b64dd)&&_0x43e7('0xd9')!==typeof _0x3b64dd){return;}switch(_0x3b64dd[_0x43e7('0xda')]){case'0':ut['logAgent'](_0x2e1500,0x0,'NoSuchNumber');rpcDb[_0x43e7('0xdb')](_0x2e1500,_0x43e7('0xdc'));break;case'3':ut[_0x43e7('0xdd')](_0x2e1500,0x3,_0x43e7('0xb8'));rpcDb['createAgentHistory'](_0x2e1500,_0x43e7('0xde'));break;case'5':ut[_0x43e7('0xdd')](_0x2e1500,0x5,_0x43e7('0xb3'));rpcDb['createAgentHistory'](_0x2e1500,_0x43e7('0xdf'));break;case'8':ut[_0x43e7('0xdd')](_0x2e1500,0x8,_0x43e7('0xbf'));rpcDb[_0x43e7('0xdb')](_0x2e1500,'[callProgressDetectingAgent][logCongestion]');break;case'22':ut[_0x43e7('0xdd')](_0x2e1500,0x16,'AnswerAGI');rpcDb[_0x43e7('0xdb')](_0x2e1500,_0x43e7('0xe0'));break;default:ut['logAgent'](_0x2e1500,0xc,_0x3b64dd['reason']);rpcDb[_0x43e7('0xdb')](_0x2e1500,_0x43e7('0xe1'));}ut[_0x43e7('0x71')](_0x271f55,_0x43e7('0xe2'));logger[_0x43e7('0x57')](_0x43e7('0xe3'),_0x2e1500[_0x43e7('0xe4')],_0x43e7('0xa4'),_0x271f55[_0x43e7('0x27')],_0x43e7('0xe5'),_0x271f55[_0x43e7('0x4d')]);delete this['actions'][_0x2e1500[_0x43e7('0xe4')]];};Preview['prototype'][_0x43e7('0xe6')]=function(_0x2d3b9a,_0x352cab,_0x4cd967,_0x153084,_0x111adf){var _0x119cd2=this;return new BPromise(function(_0x352405,_0x5c34b7){if(_[_0x43e7('0x66')](_0x352cab)||_[_0x43e7('0x66')](_0x352cab['Contact'])||_['isNil'](_0x352cab['Contact'][_0x43e7('0xe7')])||_[_0x43e7('0x66')](_0x352cab[_0x43e7('0x6b')])){_0x5c34b7(ut[_0x43e7('0x4c')](_0x43e7('0xe8'),_0x153084,_0x111adf));return;}var _0x40019e=uuid['v4']();var _0x1f5028=_0x119cd2[_0x43e7('0x23')][_0x352cab['Queue'][_0x43e7('0x27')]];var _0x32503b=_0x4cd967?_0x119cd2[_0x43e7('0xe9')][_0x4cd967]['id']:undefined;_0x119cd2[_0x43e7('0x12')][_0x40019e]=new Action(_0x352cab,_0x1f5028,_0x40019e,_0x4cd967,_0x32503b);var _0x4e4f4e=_0x119cd2['actions'][_0x40019e];_0x4e4f4e[_0x43e7('0x9c')]=_0x153084;_0x4e4f4e[_0x43e7('0x9d')]=_0x111adf;_0x4e4f4e[_0x43e7('0xea')]=_0x4cd967;if(_[_0x43e7('0xeb')](_0x2d3b9a)){_0x119cd2['execCall'](_0x4e4f4e,_0x1f5028,_0x352cab,_0x4cd967)[_0x43e7('0x7b')](function(_0x427cec){logger[_0x43e7('0x57')](_0x43e7('0xec'),_0x43e7('0xed')+_0x4e4f4e[_0x43e7('0x69')]+'\x20IdHopper:\x20'+_0x4e4f4e[_0x43e7('0xc7')],JSON['stringify'](_0x427cec));ami['emit'](_0x43e7('0xee'),ut[_0x43e7('0xa6')](_0x4e4f4e,'called'));_0x352405(ut['message'](_0x43e7('0xef')));})[_0x43e7('0x81')](function(_0x4d914a){ut[_0x43e7('0x5d')](_0x43e7('0xf0'),_0x4d914a);_0x5c34b7(ut[_0x43e7('0x4c')](_0x43e7('0xf1'),_0x153084,_0x111adf));});}else{_0x1f5028['outboundBlacklistCallsDay']+=0x1;ut['logBlacklist'](_0x4e4f4e);rpcDb[_0x43e7('0xf2')](_0x4e4f4e,_0x43e7('0xf3'));delete _0x119cd2[_0x43e7('0x12')][_0x40019e];_0x5c34b7(ut['message']('Contact\x20in\x20black\x20List',_0x153084,_0x111adf));}});};Preview[_0x43e7('0x61')][_0x43e7('0x8e')]=function(_0x227f7c){return!_[_0x43e7('0x66')](_0x227f7c)&&!_[_0x43e7('0x66')](_0x227f7c[_0x43e7('0x27')])&&!_[_0x43e7('0x66')](_0x227f7c[_0x43e7('0xf4')])&&_0x227f7c['active']&&!_['isNil'](this['trunks'][util[_0x43e7('0x55')]('SIP/%s',_0x227f7c[_0x43e7('0x27')])])&&!_[_0x43e7('0x66')](this[_0x43e7('0x11')][util[_0x43e7('0x55')](_0x43e7('0xf5'),_0x227f7c['name'])][_0x43e7('0x6e')])&&(this[_0x43e7('0x11')][util[_0x43e7('0x55')](_0x43e7('0xf5'),_0x227f7c['name'])][_0x43e7('0x6e')]===_0x43e7('0xf6')||this[_0x43e7('0x11')][util[_0x43e7('0x55')](_0x43e7('0xf5'),_0x227f7c[_0x43e7('0x27')])][_0x43e7('0x6e')]==='unmonitored');};Preview[_0x43e7('0x61')][_0x43e7('0xf7')]=function(_0x20fab2,_0x3637d9){var _0x3c52d3=this;return new BPromise(function(_0x4d7e73,_0x1a20d0){_0x3c52d3[_0x43e7('0xf8')](_0x20fab2,_0x3637d9)['then'](function(_0x38cb44){_0x4d7e73(_[_0x43e7('0xf9')](_0x38cb44,['message']));})[_0x43e7('0x81')](function(_0x368c57){if(_0x368c57[_0x43e7('0xfa')]){rpcDb[_0x43e7('0xc6')](_0x20fab2);}if(_0x368c57[_0x43e7('0xf4')]){rpcDb['disableContact'](_0x20fab2);}_0x1a20d0(_[_0x43e7('0xf9')](_0x368c57,[_0x43e7('0x4c')]));});});};Preview[_0x43e7('0x61')]['execRun']=function(_0x32b788,_0x4b826a){var _0x50c161=this;return new BPromise(function(_0x38f832,_0x17421b){var _0x3ea226,_0x2dc13d;rpcDb[_0x43e7('0xfb')](_0x32b788)[_0x43e7('0x7b')](function(_0x4d5736){if(!_[_0x43e7('0x66')](_0x4d5736[0x0])){_0x2dc13d=_0x4d5736[0x0][_0x43e7('0xfc')]?![]:!![];_0x3ea226=_0x4d5736[0x0][_0x43e7('0xfc')]?!![]:![];_0x3ea226=_0x4b826a?!![]:_0x3ea226;}var _0x4a4031=_0x50c161[_0x43e7('0xfd')](_0x4d5736);if(_0x4a4031[_0x43e7('0xfe')]){rpcDb[_0x43e7('0xff')](_[_0x43e7('0xf9')](_0x4d5736[0x0],[_0x43e7('0x6b'),_0x43e7('0x100')]))[_0x43e7('0x7b')](function(_0x1896b3){_0x50c161[_0x43e7('0xe6')](_0x1896b3,_0x4d5736[0x0],_0x4b826a,_0x2dc13d,_0x3ea226)['then'](function(_0x723c7){_0x38f832(_0x723c7);})[_0x43e7('0x81')](function(_0x343317){_0x17421b(_0x343317);});})[_0x43e7('0x81')](function(_0x33175f){ut[_0x43e7('0x5d')](_0x43e7('0x101'),_0x33175f);_0x17421b(ut[_0x43e7('0x4c')]('Call\x20unsuccessful',_0x2dc13d,_0x3ea226));});}else{_0x17421b(ut[_0x43e7('0x4c')](_0x4a4031[_0x43e7('0x4c')],_0x2dc13d,_0x3ea226));}})[_0x43e7('0x81')](function(_0xa721ba){ut[_0x43e7('0x5d')]('[Preview][getContactPreview]',_0xa721ba);_0x17421b(ut[_0x43e7('0x4c')](_0x43e7('0x102'),![],!![]));});});};Preview[_0x43e7('0x61')][_0x43e7('0xfd')]=function(_0x2e807){if(_['isNil'](_0x2e807)||_[_0x43e7('0xeb')](_0x2e807)||!_['isNil'](_0x2e807[0x0][_0x43e7('0x7e')])&&_[_0x43e7('0x66')](_0x2e807[0x0][_0x43e7('0x7e')][_0x43e7('0x27')])){ut['logger'](_0x43e7('0x103'),_0x2e807);return{'isValid':![],'message':_0x43e7('0x104')};}var _0x41d636=this[_0x43e7('0x23')][_0x2e807[0x0][_0x43e7('0x68')][_0x43e7('0x27')]];_0x41d636[_0x43e7('0x4c')]=_0x43e7('0x90');if(_[_0x43e7('0x66')](_0x41d636)){ut[_0x43e7('0x5d')](_0x43e7('0x105'),_0x41d636);return{'isValid':![],'message':'Empty\x20Campaign'};}if(!this['isTrunkReachable'](_0x41d636[_0x43e7('0x51')])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x43e7('0x106')+_0x41d636[_0x43e7('0x27')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x43e7('0x8e')](_0x41d636['TrunkBackup'])){ut['logger']('[Preview][validateContact][Trunk\x20not\x20work]',_0x41d636[_0x43e7('0x27')]+_0x43e7('0x107'));return{'isValid':![],'message':_0x43e7('0x108')};}}if(!ut[_0x43e7('0x109')](_0x41d636[_0x43e7('0x31')])){ut[_0x43e7('0x5d')](_0x43e7('0x10a'),_0x41d636[_0x43e7('0x27')]+_0x43e7('0x10b'));return{'isValid':![],'message':_0x43e7('0x106')+_0x41d636[_0x43e7('0x27')]+_0x43e7('0x10b')};}return{'isValid':!![],'message':_0x43e7('0x10c')};};Preview[_0x43e7('0x61')][_0x43e7('0x10d')]=function(_0x30eb2e,_0x2ecf7b,_0x34333d,_0x4442c7){var _0x3dc065=this;return new BPromise(function(_0x58c75c,_0x282796){var _0x8e6f7f=_0x30eb2e['uniqueid'];var _0x2c7d43=_0x3dc065[_0x43e7('0x8e')](_0x2ecf7b[_0x43e7('0x51')])?util[_0x43e7('0x55')]('SIP/%s/%s%s',_0x2ecf7b[_0x43e7('0x51')][_0x43e7('0x27')],_['isNil'](_0x2ecf7b[_0x43e7('0x10e')])?'':_0x2ecf7b[_0x43e7('0x10e')][_0x43e7('0x10f')]()||'',_0x2ecf7b['dialCutDigit']>0x0?_0x34333d[_0x43e7('0x110')][_0x43e7('0xe7')][_0x43e7('0x111')](_0x2ecf7b[_0x43e7('0x112')]):_0x34333d[_0x43e7('0x110')]['phone']):util[_0x43e7('0x55')](_0x43e7('0x113'),_['isNil'](_0x2ecf7b[_0x43e7('0x114')])?_0x2ecf7b['Trunk']['name']:_0x2ecf7b['TrunkBackup']['name'],_[_0x43e7('0x66')](_0x2ecf7b[_0x43e7('0x10e')])?'':_0x2ecf7b[_0x43e7('0x10e')][_0x43e7('0x10f')]()||'',_0x2ecf7b['dialCutDigit']>0x0?_0x34333d['Contact'][_0x43e7('0xe7')]['substring'](_0x2ecf7b[_0x43e7('0x112')]):_0x34333d['Contact'][_0x43e7('0xe7')]);var _0x4cf7e9=_0x3dc065['isTrunkReachable'](_0x2ecf7b['Trunk'])?ut['getCallerId'](_0x2ecf7b[_0x43e7('0x51')][_0x43e7('0x115')],_0x2ecf7b[_0x43e7('0x116')],_0x2ecf7b['dialRandomLastDigitCallerIdNumber']>0x0?ut[_0x43e7('0x117')](_0x2ecf7b[_0x43e7('0x118')],_0x2ecf7b[_0x43e7('0x119')]):_0x2ecf7b['dialOriginateCallerIdNumber']):ut[_0x43e7('0x11a')](_[_0x43e7('0x66')](_0x2ecf7b[_0x43e7('0x114')])?_0x2ecf7b[_0x43e7('0x51')]['callerid']:_0x2ecf7b[_0x43e7('0x114')]['callerid'],_0x2ecf7b[_0x43e7('0x116')],_0x2ecf7b[_0x43e7('0x119')]>0x0?ut[_0x43e7('0x117')](_0x2ecf7b[_0x43e7('0x118')],_0x2ecf7b[_0x43e7('0x119')]):_0x2ecf7b[_0x43e7('0x118')]);if(_0x4cf7e9){_0x30eb2e[_0x43e7('0x11b')]=ut['extractCalleridName'](_0x4cf7e9);_0x30eb2e[_0x43e7('0x11c')]=ut[_0x43e7('0x11d')](_0x4cf7e9);}var _0x5939ac=ut[_0x43e7('0x11e')](_0x2ecf7b,_0x34333d,_0x2c7d43,_0x4cf7e9,_0x8e6f7f,_0x30eb2e);_[_0x43e7('0x11f')](_0x30eb2e,ut[_0x43e7('0x120')](_0x5939ac));_0x30eb2e[_0x43e7('0x121')]=moment()[_0x43e7('0x55')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x43e7('0x6d')](ut['variablesAction'](_0x30eb2e,_0x2ecf7b,_0x5939ac,_0x30eb2e[_0x43e7('0x9d')],_0x4442c7))['then'](function(_0x2f81ba){_0x2ecf7b[_0x43e7('0x4d')]+=0x1;logger[_0x43e7('0x57')](_0x43e7('0x122'),_0x8e6f7f,_0x43e7('0xa4'),_0x2ecf7b['name'],_0x43e7('0xe5'),_0x2ecf7b['originated']);_0x58c75c(_0x2f81ba);})[_0x43e7('0x81')](function(_0x3ecedd){ut[_0x43e7('0xdd')](_0x30eb2e,0xe,'OriginateError');rpcDb[_0x43e7('0xdb')](_0x30eb2e,_0x43e7('0x123'));_0x282796(_0x3ecedd);});});};Preview[_0x43e7('0x61')][_0x43e7('0x124')]=function(_0x379067){if(this['actions'][_0x379067[_0x43e7('0x9e')]]){this['actions'][_0x379067[_0x43e7('0x9e')]][_0x43e7('0x6f')]=_0x379067[_0x43e7('0x6f')];}};Preview[_0x43e7('0x61')][_0x43e7('0x15')]=function(_0x34ed9e){var _0x233031=this;var _0x594636=this[_0x43e7('0x12')][_0x34ed9e['actionid']];if(_0x594636){if(_0x594636[_0x43e7('0xea')]&&this[_0x43e7('0xe9')][_0x594636[_0x43e7('0xea')]]){ut[_0x43e7('0x125')](_0x594636,this[_0x43e7('0xe9')][_0x594636[_0x43e7('0xea')]][_0x43e7('0x27')],this[_0x43e7('0xe9')][_0x594636[_0x43e7('0xea')]]['id']);}var _0x57f7ea=_[_0x43e7('0x126')](_0x594636);_0x57f7ea['responsetime']=moment()[_0x43e7('0x55')](_0x43e7('0x83'));var _0x58a29b=_0x233031[_0x43e7('0x23')][_0x594636[_0x43e7('0x69')]];if(ut['isFailure'](_0x34ed9e[_0x43e7('0x127')])){if(_0x594636[_0x43e7('0x9c')]){rpcDb[_0x43e7('0xc6')](_0x594636[_0x43e7('0xc7')]);}if(_0x594636[_0x43e7('0x9d')]){rpcDb[_0x43e7('0x128')](_0x594636[_0x43e7('0xc7')]);}ami[_0x43e7('0x24')]('custom:agentringnoanswer',ut[_0x43e7('0xa6')](_0x594636,_0x43e7('0x129')));this[_0x43e7('0xd7')](_0x57f7ea,_0x58a29b,_0x34ed9e);}else{_0x594636['starttime']=moment()[_0x43e7('0x55')](_0x43e7('0x83'));ut['logAgent'](_0x57f7ea,0x4,_0x43e7('0xab'));rpcDb[_0x43e7('0xdb')](_0x57f7ea,'[callProgressDetectingAgent][logAnswer]');}}};Preview[_0x43e7('0x61')][_0x43e7('0x16')]=function(_0x2c59ed){var _0x59452e=this;var _0x182fc6=this[_0x43e7('0x12')][_0x2c59ed['linkedid']];var _0x23e0f1;if(_0x182fc6){_0x23e0f1=this[_0x43e7('0x23')][_0x182fc6[_0x43e7('0x69')]];logger[_0x43e7('0x57')]('[syncHangup][talking]',_0x2c59ed['linkedid'],_0x43e7('0xa4'),_0x23e0f1[_0x43e7('0x27')],_0x43e7('0x12a'),_0x23e0f1[_0x43e7('0x5a')]);}if(this['actions'][_0x2c59ed[_0x43e7('0x9e')]]&&_0x2c59ed[_0x43e7('0x9e')]!==_0x2c59ed[_0x43e7('0xe4')]){if(_0x2c59ed[_0x43e7('0x12b')]==='16'&&this['actions'][_0x2c59ed[_0x43e7('0x9e')]][_0x43e7('0x73')]){this[_0x43e7('0x12c')](_0x2c59ed,_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed[_0x43e7('0x12b')]);}else if(this['actions'][_0x2c59ed['linkedid']]['dialAnswer']){logger[_0x43e7('0x57')](_0x43e7('0x12d'),_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed['cause'],_0x43e7('0xa4'),_0x23e0f1['name'],_0x43e7('0x12a'),_0x23e0f1[_0x43e7('0x5a')]);this[_0x43e7('0x12c')](_0x2c59ed,_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed[_0x43e7('0x12b')]);}}else if(_0x182fc6&&_[_0x43e7('0x66')](_0x182fc6['statedesc'])&&_0x23e0f1[_0x43e7('0x12e')]&&_0x2c59ed[_0x43e7('0x9e')]===_0x2c59ed[_0x43e7('0xe4')]&&_[_0x43e7('0x66')](_0x2c59ed[_0x43e7('0xda')])&&_0x2c59ed[_0x43e7('0x12b')]==='16'&&_0x2c59ed[_0x43e7('0x12f')]==='6'&&_[_0x43e7('0xd8')](_0x182fc6[_0x43e7('0x130')])){if(_0x182fc6[_0x43e7('0x9c')]){rpcDb[_0x43e7('0xc6')](_0x182fc6[_0x43e7('0xc7')]);}if(_0x182fc6[_0x43e7('0x9d')]){rpcDb['disableContact'](_0x182fc6[_0x43e7('0xc7')]);}_0x2c59ed[_0x43e7('0xda')]='22';this['callProgressDetectingAgent'](_0x182fc6,_0x23e0f1,_0x2c59ed);}else if(_0x182fc6&&_0x182fc6[_0x43e7('0x130')]){if(_0x2c59ed[_0x43e7('0x12b')]==='16'&&this['actions'][_0x2c59ed[_0x43e7('0x9e')]][_0x43e7('0x73')]){logger[_0x43e7('0x57')]('[syncHangup][talking][transfer]',_0x2c59ed['linkedid'],_0x2c59ed[_0x43e7('0x12b')],_0x43e7('0xa4'),_0x23e0f1[_0x43e7('0x27')],_0x43e7('0x12a'),_0x23e0f1[_0x43e7('0x5a')]);this[_0x43e7('0x12c')](_0x2c59ed,_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed[_0x43e7('0x12b')]);}else if(this['actions'][_0x2c59ed[_0x43e7('0x9e')]][_0x43e7('0x73')]){logger[_0x43e7('0x57')](_0x43e7('0x12d'),_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed[_0x43e7('0x12b')],_0x43e7('0xa4'),_0x23e0f1[_0x43e7('0x27')],_0x43e7('0x12a'),_0x23e0f1[_0x43e7('0x5a')]);this[_0x43e7('0x12c')](_0x2c59ed,_0x2c59ed[_0x43e7('0x9e')],_0x2c59ed['cause']);}}};Preview[_0x43e7('0x61')][_0x43e7('0x1a')]=function(_0x26359b){if(this[_0x43e7('0x12')][_0x26359b[_0x43e7('0xd6')]]&&_0x26359b[_0x43e7('0xd6')]!==_0x26359b['destuniqueid']){this[_0x43e7('0x12c')](_0x26359b,_0x26359b['destlinkedid'],_0x26359b[_0x43e7('0xd2')]);}};Preview[_0x43e7('0x61')][_0x43e7('0x19')]=function(_0x4a500c){if(this[_0x43e7('0x12')][_0x4a500c[_0x43e7('0x9e')]]&&_0x4a500c['linkedid']!==_0x4a500c[_0x43e7('0xe4')]&&!this['actions'][_0x4a500c[_0x43e7('0x9e')]][_0x43e7('0x73')]){if(_0x4a500c[_0x43e7('0x12b')]==='1'){this[_0x43e7('0x12c')](_0x4a500c,_0x4a500c['linkedid'],_0x4a500c[_0x43e7('0x12b')]);}}};Preview[_0x43e7('0x61')][_0x43e7('0x131')]=function(_0x529417,_0x12c4f9,_0x1e1da9){if(this[_0x43e7('0x12')][_0x529417]){if(_[_0x43e7('0x66')](this[_0x43e7('0x12')][_0x529417][_0x43e7('0x132')])){this['actions'][_0x529417][_0x43e7('0x132')]={};}this['actions'][_0x529417][_0x43e7('0x132')][_0x12c4f9]=_0x1e1da9;}};Preview[_0x43e7('0x61')]['syncVarSet']=function(_0x2590bc){try{if(!_[_0x43e7('0x66')](_0x2590bc)){if(ut['filterKey'](_[_0x43e7('0x133')](_0x2590bc[_0x43e7('0x134')])[0x0])){this[_0x43e7('0x131')](_0x2590bc[_0x43e7('0xe4')],_['keys'](_0x2590bc['variable'])[0x0],_0x2590bc[_0x43e7('0x135')]);}}}catch(_0x2815ad){logger[_0x43e7('0x136')](_0x43e7('0x137'),util[_0x43e7('0x138')](_0x2815ad,{'showHidden':![],'depth':null}));}};Preview[_0x43e7('0x61')][_0x43e7('0x1f')]=function(_0x89831){if(_0x89831){if(this['actions'][_0x89831[_0x43e7('0x139')]]){this[_0x43e7('0x12')][_0x89831['transfertargetlinkedid']][_0x43e7('0x130')]=!![];}}};Preview[_0x43e7('0x61')][_0x43e7('0x21')]=function(_0x1dfb3f){if(_0x1dfb3f){if(this[_0x43e7('0x12')][_0x1dfb3f[_0x43e7('0x13a')]]){this[_0x43e7('0x12')][_0x1dfb3f['transfererlinkedid']][_0x43e7('0x130')]=!![];}}};module['exports']=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 2363cd0..cf0a960 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 _0xf2ca=['rescheduleContact','UserId','countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','disableContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','endtime','membername','context','exten','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','lodash','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/voiceQueueReport','error','resolve','createHistory','[createHistory]\x20','then','catch','moveContactManagedDialer','[moveContactManagedDialer]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerFinal'];(function(_0xb12d2a,_0x23243e){var _0x51e5cf=function(_0x3f0b2c){while(--_0x3f0b2c){_0xb12d2a['push'](_0xb12d2a['shift']());}};_0x51e5cf(++_0x23243e);}(_0xf2ca,0x16a));var _0xaf2c=function(_0x3eff21,_0x5bf36c){_0x3eff21=_0x3eff21-0x0;var _0x1945bb=_0xf2ca[_0x3eff21];return _0x1945bb;};'use strict';var util=require(_0xaf2c('0x0'));var BPromise=require(_0xaf2c('0x1'));var logger=require(_0xaf2c('0x2'))('preview');var _=require(_0xaf2c('0x3'));var cmHopper=require(_0xaf2c('0x4'));var cmHopperFinal=require(_0xaf2c('0x5'));var cmHopperHistory=require(_0xaf2c('0x6'));var cmHopperBlack=require(_0xaf2c('0x7'));var voiceQueueRt=require(_0xaf2c('0x8'));var agentReportPreview=require('../rpc/agentReportPreview');var voiceQueueReport=require(_0xaf2c('0x9'));function loggerCatch(_0x100d17){return function(_0x297740){logger[_0xaf2c('0xa')](_0x100d17,util['inspect'](_0x297740,{'showHidden':![],'depth':null}));};}function create(_0x37fedd){return BPromise[_0xaf2c('0xb')]()['then'](cmHopperHistory[_0xaf2c('0xc')](_0x37fedd))['catch'](loggerCatch(_0xaf2c('0xd')));}function createAgent(_0x4a0064){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](agentReportPreview[_0xaf2c('0xc')](_0x4a0064))[_0xaf2c('0xf')](loggerCatch('[createHistory]\x20'));}function moveContact(_0x4adc8c){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper[_0xaf2c('0x10')](_0x4adc8c,!![]))[_0xaf2c('0xf')](loggerCatch(_0xaf2c('0x11')));}exports['checkIsBlackList']=function(_0x590126){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopperBlack[_0xaf2c('0x12')](_0x590126))[_0xaf2c('0xf')](loggerCatch(_0xaf2c('0x13')));};exports[_0xaf2c('0x14')]=function(_0x214f47){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper[_0xaf2c('0x14')](_0x214f47))[_0xaf2c('0xf')](loggerCatch(_0xaf2c('0x15')));};exports[_0xaf2c('0xc')]=function(_0x3432e4,_0x705d09){create(_0x3432e4)['catch'](loggerCatch(_0x705d09));moveContact(_0x3432e4)[_0xaf2c('0xf')](loggerCatch(_0x705d09));};exports['createAgentHistory']=function(_0x278a28,_0x474c80){createAgent(_0x278a28)[_0xaf2c('0xf')](loggerCatch(_0x474c80));};exports['createCustomerHistory']=function(_0x28ae7b,_0x297bcd){create(_0x28ae7b)[_0xaf2c('0xf')](loggerCatch(_0x297bcd));};exports[_0xaf2c('0x16')]=function(_0x3f977c,_0x1b7f07){moveContact(_0x3f977c)['catch'](loggerCatch(_0x1b7f07));};exports[_0xaf2c('0x17')]=function(_0x164bcb,_0x8ffe13,_0x3bfd3f){if(_0x8ffe13){_0x164bcb[_0xaf2c('0x18')]=null;}if(_0x3bfd3f){_0x164bcb['active']=![];}return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper[_0xaf2c('0x17')](_0x164bcb))['catch'](loggerCatch('[rescheduleContact]\x20'));};exports[_0xaf2c('0x19')]=function(_0x303546){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper['countReScheduled'](_0x303546))[_0xaf2c('0xf')](loggerCatch(_0xaf2c('0x1a')));};exports[_0xaf2c('0x1b')]=function(_0x3c1ae6){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper[_0xaf2c('0x1b')]({'UserId':null},_0x3c1ae6,0x1))['catch'](loggerCatch(_0xaf2c('0x1c')));};exports[_0xaf2c('0x1d')]=function(_0x36f37c){return BPromise[_0xaf2c('0xb')]()['then'](cmHopper[_0xaf2c('0x1b')]({'active':![]},_0x36f37c,0x1))['catch'](loggerCatch(_0xaf2c('0x1e')));};exports[_0xaf2c('0x1f')]=function(_0x15466b){var _0x5d685a={};_0x5d685a[_0xaf2c('0x20')]=_0x15466b[_0xaf2c('0x20')];_0x5d685a[_0xaf2c('0x21')]=_0x15466b['uniqueid'];_0x5d685a[_0xaf2c('0x22')]=_0x15466b[_0xaf2c('0x22')];_0x5d685a[_0xaf2c('0x23')]=_0x15466b[_0xaf2c('0x23')];_0x5d685a['queue']=_0x15466b[_0xaf2c('0x24')];_0x5d685a[_0xaf2c('0x25')]=_0x15466b[_0xaf2c('0x26')];_0x5d685a['queuecallerleaveAt']=_0x15466b['answertime'];_0x5d685a[_0xaf2c('0x27')]=0x1;_0x5d685a['queuecallercompleteAt']=_0x15466b[_0xaf2c('0x28')];_0x5d685a['connectedlinename']=_0x15466b[_0xaf2c('0x29')];_0x5d685a[_0xaf2c('0x2a')]='from-sip';_0x5d685a[_0xaf2c('0x2b')]=_0xaf2c('0x2c');_0x5d685a['holdtime']=0x0;_0x5d685a[_0xaf2c('0x2d')]=0x1;_0x5d685a[_0xaf2c('0x2e')]=_0x15466b[_0xaf2c('0x29')];_0x5d685a[_0xaf2c('0x2f')]=_0xaf2c('0x30');return BPromise[_0xaf2c('0xb')]()['then'](voiceQueueReport[_0xaf2c('0x31')](_0x5d685a))['catch'](loggerCatch(_0xaf2c('0x32')));};exports['getContactRecallMe']=function(_0x3781f3,_0x59f686){return BPromise[_0xaf2c('0xb')]()['then'](cmHopper[_0xaf2c('0x33')](_0x3781f3,_0x59f686))['catch'](loggerCatch(_0xaf2c('0x34')));};exports[_0xaf2c('0x35')]=function(_0x1a6929){return BPromise[_0xaf2c('0xb')]()[_0xaf2c('0xe')](cmHopper['rescheduleContact'](_0x1a6929,!![],!![]))['catch'](loggerCatch(_0xaf2c('0x36')));}; \ No newline at end of file +var _0xf69d=['../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','inspect','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','getContactPreview','createAgentHistory','createCustomerHistory','createCustomerFinal','rescheduleContact','UserId','active','countReScheduled','[countReScheduled]\x20','unlockContact','disableContact','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallerleaveAt','queuecallercomplete','endtime','connectedlinename','membername','context','from-sip','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','../../../config/logger','preview','lodash'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0xf69d,0xd3));var _0xdf69=function(_0x2f5c0f,_0xeaa117){_0x2f5c0f=_0x2f5c0f-0x0;var _0xca2ac6=_0xf69d[_0x2f5c0f];return _0xca2ac6;};'use strict';var util=require(_0xdf69('0x0'));var BPromise=require(_0xdf69('0x1'));var logger=require(_0xdf69('0x2'))(_0xdf69('0x3'));var _=require(_0xdf69('0x4'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0xdf69('0x5'));var cmHopperHistory=require(_0xdf69('0x6'));var cmHopperBlack=require(_0xdf69('0x7'));var voiceQueueRt=require(_0xdf69('0x8'));var agentReportPreview=require(_0xdf69('0x9'));var voiceQueueReport=require(_0xdf69('0xa'));function loggerCatch(_0x2d456f){return function(_0x465b1b){logger[_0xdf69('0xb')](_0x2d456f,util[_0xdf69('0xc')](_0x465b1b,{'showHidden':![],'depth':null}));};}function create(_0x18a08e){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopperHistory[_0xdf69('0xf')](_0x18a08e))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x11')));}function createAgent(_0x1e0e8d){return BPromise['resolve']()[_0xdf69('0xe')](agentReportPreview[_0xdf69('0xf')](_0x1e0e8d))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x11')));}function moveContact(_0x43ce3d){return BPromise[_0xdf69('0xd')]()['then'](cmHopper['moveContactManagedDialer'](_0x43ce3d,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0xdf69('0x12')]=function(_0xbacdc6){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopperBlack[_0xdf69('0x12')](_0xbacdc6))[_0xdf69('0x10')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0xdf69('0x13')]=function(_0x42d448){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopper['getContactPreview'](_0x42d448))[_0xdf69('0x10')](loggerCatch('[getContactPreview]\x20'));};exports[_0xdf69('0xf')]=function(_0x1899a2,_0x5263a4){create(_0x1899a2)[_0xdf69('0x10')](loggerCatch(_0x5263a4));moveContact(_0x1899a2)[_0xdf69('0x10')](loggerCatch(_0x5263a4));};exports[_0xdf69('0x14')]=function(_0x85d1d,_0x59bfd2){createAgent(_0x85d1d)['catch'](loggerCatch(_0x59bfd2));};exports[_0xdf69('0x15')]=function(_0x15e73a,_0x54df73){create(_0x15e73a)[_0xdf69('0x10')](loggerCatch(_0x54df73));};exports[_0xdf69('0x16')]=function(_0x68fa80,_0x526cbc){moveContact(_0x68fa80)[_0xdf69('0x10')](loggerCatch(_0x526cbc));};exports[_0xdf69('0x17')]=function(_0x4d09d5,_0x56647c,_0x32505a){if(_0x56647c){_0x4d09d5[_0xdf69('0x18')]=null;}if(_0x32505a){_0x4d09d5[_0xdf69('0x19')]=![];}return BPromise['resolve']()['then'](cmHopper['rescheduleContact'](_0x4d09d5))[_0xdf69('0x10')](loggerCatch('[rescheduleContact]\x20'));};exports[_0xdf69('0x1a')]=function(_0x311534){return BPromise[_0xdf69('0xd')]()['then'](cmHopper['countReScheduled'](_0x311534))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x1b')));};exports[_0xdf69('0x1c')]=function(_0x3fd933){return BPromise['resolve']()[_0xdf69('0xe')](cmHopper[_0xdf69('0x1c')]({'UserId':null},_0x3fd933,0x1))[_0xdf69('0x10')](loggerCatch('[unlockContact]\x20'));};exports[_0xdf69('0x1d')]=function(_0x5cfba9){return BPromise['resolve']()['then'](cmHopper['unlockContact']({'active':![]},_0x5cfba9,0x1))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x1e')));};exports['crateCustomerReportQueue']=function(_0x301bd2){var _0xd81d0a={};_0xd81d0a[_0xdf69('0x1f')]=_0x301bd2[_0xdf69('0x1f')];_0xd81d0a[_0xdf69('0x20')]=_0x301bd2[_0xdf69('0x20')];_0xd81d0a[_0xdf69('0x21')]=_0x301bd2[_0xdf69('0x21')];_0xd81d0a[_0xdf69('0x22')]=_0x301bd2[_0xdf69('0x22')];_0xd81d0a[_0xdf69('0x23')]=_0x301bd2[_0xdf69('0x23')];_0xd81d0a[_0xdf69('0x24')]=_0x301bd2[_0xdf69('0x25')];_0xd81d0a[_0xdf69('0x26')]=_0x301bd2[_0xdf69('0x25')];_0xd81d0a[_0xdf69('0x27')]=0x1;_0xd81d0a['queuecallercompleteAt']=_0x301bd2[_0xdf69('0x28')];_0xd81d0a[_0xdf69('0x29')]=_0x301bd2[_0xdf69('0x2a')];_0xd81d0a[_0xdf69('0x2b')]=_0xdf69('0x2c');_0xd81d0a['exten']=_0xdf69('0x2d');_0xd81d0a['holdtime']=0x0;_0xd81d0a[_0xdf69('0x2e')]=0x1;_0xd81d0a[_0xdf69('0x2f')]=_0x301bd2['membername'];_0xd81d0a[_0xdf69('0x30')]='COMPLETED';return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](voiceQueueReport[_0xdf69('0x31')](_0xd81d0a))[_0xdf69('0x10')](loggerCatch(_0xdf69('0x32')));};exports['getContactRecallMe']=function(_0x175d5a,_0x50250a){return BPromise[_0xdf69('0xd')]()[_0xdf69('0xe')](cmHopper[_0xdf69('0x33')](_0x175d5a,_0x50250a))[_0xdf69('0x10')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0xdf69('0x34')]=function(_0x51f996){return BPromise[_0xdf69('0xd')]()['then'](cmHopper[_0xdf69('0x17')](_0x51f996,!![],!![]))['catch'](loggerCatch(_0xdf69('0x35')));}; \ 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 1b5bfa3..3214df7 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 _0x64f6=['filterKey','idContact','type','campaigntype','dialAnswer','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','xmd-voicequeueid','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqos','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','random','extractCalleridNumber','match','util','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isEmpty','isUndefined','format','\x22%s\x22\x20<%s>','string','isNil','addVariables','Queue','name','calleridname','calleridnum','ContactId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialQueueProject','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','Contact','hasOwnProperty','createdAt','updatedAt','%s%s','XMD-','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','endtime','ringtime','responsetime','logLookAgent','membername','UserId','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','from-sip','timeout','totalGlobal','countbusyretry','countnoanswerretry','clone','Global','scheduledAt','active','add','minutes','ListId','VoiceQueueId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','buildObj','lastevent','queue','interface','buildAcw','agentReadyId','not_inuse','reachable','push','getDiff','createBody','CampaignId'];(function(_0x4f8945,_0x320806){var _0x35797f=function(_0x4eb09a){while(--_0x4eb09a){_0x4f8945['push'](_0x4f8945['shift']());}};_0x35797f(++_0x320806);}(_0x64f6,0xb3));var _0x664f=function(_0x2acef2,_0x3697dd){_0x2acef2=_0x2acef2-0x0;var _0x1f9fc2=_0x64f6[_0x2acef2];return _0x1f9fc2;};'use strict';var util=require(_0x664f('0x0'));var _=require(_0x664f('0x1'));var moment=require(_0x664f('0x2'));var logger=require(_0x664f('0x3'))('preview');var ipAgi=process['env'][_0x664f('0x4')]||_0x664f('0x5');function getSeconds(_0x28d93b,_0x444e4f){var _0x2424fa=moment(_0x28d93b)[_0x664f('0x6')](0x0);var _0x36f127=moment(_0x444e4f)[_0x664f('0x6')](0x0);return _0x2424fa[_0x664f('0x7')](_0x36f127,_0x664f('0x8'));}exports[_0x664f('0x9')]=function(_0x59b6c0){return function(_0x44a9d4){logger[_0x664f('0xa')](_0x59b6c0,util[_0x664f('0xb')](_0x44a9d4,{'showHidden':![],'depth':null}));};};exports[_0x664f('0xc')]=function(_0x303f9a,_0xa9badc){logger[_0x664f('0xd')](_0x303f9a,util['inspect'](_0xa9badc,{'showHidden':![],'depth':null}));};exports[_0x664f('0xe')]=function(_0x5ab3a9,_0x310367){logger[_0x664f('0xa')](_0x5ab3a9,util[_0x664f('0xb')](_0x310367,{'showHidden':![],'depth':null}));};exports[_0x664f('0xf')]=function(_0x3d0047){return function(_0x56a7c1){logger[_0x664f('0xd')](_0x3d0047,util[_0x664f('0xb')](_0x56a7c1,{'showHidden':![],'depth':null}));};};exports[_0x664f('0x10')]=function(_0x94650,_0xb3d7f8,_0x1a4f88){return{'message':_0x94650,'unlock':_0xb3d7f8,'active':_0x1a4f88};};exports[_0x664f('0x11')]=function(_0x59496d,_0x125dc2,_0x28b34b){if(!_['isUndefined'](_0x28b34b)&&'string'===typeof _0x28b34b&&!_[_0x664f('0x12')](_0x28b34b)){if(!_[_0x664f('0x13')](_0x125dc2)&&'string'===typeof _0x125dc2&&!_[_0x664f('0x12')](_0x125dc2)){return util[_0x664f('0x14')]('\x22%s\x22\x20<%s>',_0x125dc2,_0x28b34b);}return util['format'](_0x664f('0x15'),_0x28b34b,_0x28b34b);}if(!_[_0x664f('0x13')](_0x59496d)&&_0x664f('0x16')===typeof _0x59496d&&!_['isEmpty'](_0x59496d)){return _0x59496d;}return'\x22\x22\x20<>';};exports['isActive']=function(_0x448bfc){if(_[_0x664f('0x17')](_0x448bfc)){return![];}return _0x448bfc;};exports[_0x664f('0x18')]=function(_0x5d5031,_0x283d46,_0x84ff48,_0x59c83f,_0x2824b4,_0x3b080d){var _0x4e441a={'XMD-QUEUE':_0x283d46[_0x664f('0x19')]?_0x283d46['Queue'][_0x664f('0x1a')]:'','XMD-CALLERID':_0x59c83f,'XMD-CALLERID-PREVIEW':_0x3b080d?util[_0x664f('0x14')]('\x22%s\x22\x20<%s>',_0x3b080d[_0x664f('0x1b')],_0x3b080d[_0x664f('0x1c')]):_0x59c83f,'XMD-DIALID':_0x2824b4,'XMD-CONTACTID':_0x283d46[_0x664f('0x1d')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x59c83f,'XMD-VOICEQUEUEID':_0x283d46['VoiceQueueId'],'XMD-DIALCHANNEL':_0x84ff48,'XMD-DIALTIMEOUT':_0x5d5031[_0x664f('0x1e')]||0x1e,'XMD-DIALOPTIONS':util[_0x664f('0x14')](_0x664f('0x1f'),_0x5d5031[_0x664f('0x20')]?'g':'',_[_0x664f('0x12')](_0x5d5031[_0x664f('0x21')])?'':_0x664f('0x22')),'XMD-DIALURL':_0x5d5031['dialPreviewUrl']||'','XMD-AGI':_0x5d5031[_0x664f('0x23')]?util[_0x664f('0x14')](_0x664f('0x24'),ipAgi,_0x5d5031[_0x664f('0x23')]):_0x664f('0x25'),'XMD-AGIAFTER':_0x5d5031['dialQueueProject2']?util['format'](_0x664f('0x24'),ipAgi,_0x5d5031[_0x664f('0x20')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x3b080d?_0x3b080d[_0x664f('0x26')]:'','XMD-ORIGINATECALLERIDNAME':_0x3b080d?_0x3b080d[_0x664f('0x27')]:'','XMD-DESTINATION':_0x664f('0x28')};if(!_[_0x664f('0x12')](_0x5d5031[_0x664f('0x21')])){_0x4e441a[util[_0x664f('0x14')]('%s',_0x664f('0x29'))]=_0x5d5031[_0x664f('0x21')];_0x4e441a[util[_0x664f('0x14')]('%s','_XCALLY_MIXMONITOR_UNIQUEID')]=_0x2824b4;}if(_0x283d46&&_0x283d46[_0x664f('0x2a')]){for(var _0x334919 in _0x283d46['Contact']){if(_0x283d46[_0x664f('0x2a')][_0x664f('0x2b')](_0x334919)){if(!_[_0x664f('0x17')](_0x283d46[_0x664f('0x2a')][_0x334919])&&_0x334919!=='id'&&_0x334919!=='tags'&&_0x334919!==_0x664f('0x2c')&&_0x334919!==_0x664f('0x2d')){_0x4e441a[util[_0x664f('0x14')](_0x664f('0x2e'),_0x664f('0x2f'),_[_0x664f('0x30')](_0x334919))]=_0x283d46[_0x664f('0x2a')][_0x334919];}}}}return _0x4e441a;};exports['toLowerVariables']=function(_0x5c7b92){var _0x482ac9={};for(var _0x20475c in _0x5c7b92){if(_0x5c7b92[_0x664f('0x2b')](_0x20475c)){_0x482ac9[util[_0x664f('0x14')]('%s',_[_0x664f('0x31')](_0x20475c))]=_0x5c7b92[_0x20475c];}}return{'variables':_0x482ac9};};exports[_0x664f('0x32')]=function(_0xdb9d3c,_0x4888b7){if(!_[_0x664f('0x17')](_0xdb9d3c)){if(_0xdb9d3c['hasOwnProperty'](_0x664f('0x33'))){if(_0xdb9d3c[_0x664f('0x33')]>0x0){_0xdb9d3c[_0x664f('0x33')]-=0x1;}else{logger[_0x664f('0xa')](_0x664f('0x34'),_0x4888b7);}}}else{logger[_0x664f('0xa')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x4888b7);}};exports[_0x664f('0x35')]=function(_0x171b41){var _0x2420a4=moment()[_0x664f('0x14')](_0x664f('0x36'));_0x171b41[_0x664f('0x37')]=0xd;_0x171b41[_0x664f('0x38')]=_0x664f('0x39');_0x171b41[_0x664f('0x3a')]=_0x2420a4;_0x171b41['responsetime']=_0x2420a4;_0x171b41[_0x664f('0x3b')]=_0x2420a4;};exports['logAgent']=function(_0x2e6c47,_0x410bc7,_0x1209a2){var _0x3e82a9=moment()[_0x664f('0x14')](_0x664f('0x36'));_0x2e6c47['state']=_0x410bc7;_0x2e6c47['statedesc']=_0x1209a2;_0x2e6c47['responsetime']=_0x3e82a9;_0x2e6c47[_0x664f('0x3c')]=getSeconds(_0x2e6c47[_0x664f('0x3d')],_0x2e6c47[_0x664f('0x3a')]);};exports[_0x664f('0x3e')]=function(_0x3b36e7,_0x7358f9,_0xdd9935){_0x3b36e7[_0x664f('0x3f')]=_0x7358f9;_0x3b36e7[_0x664f('0x40')]=_0xdd9935;};exports['logCustomer']=function(_0x5bf044,_0x2c737b,_0xb5d6b3){var _0x359faa=moment()[_0x664f('0x14')]('YYYY-MM-DD\x20HH:mm:ss');_0x5bf044[_0x664f('0x37')]=_0x2c737b;_0x5bf044[_0x664f('0x38')]=_0xb5d6b3;_0x5bf044[_0x664f('0x3d')]=_0x5bf044['responsetime']?_0x5bf044['responsetime']:_0x359faa;_0x5bf044[_0x664f('0x3b')]=_0x5bf044[_0x664f('0x3b')]?_0x5bf044[_0x664f('0x3b')]:_0x359faa;_0x5bf044[_0x664f('0x3c')]=getSeconds(_0x5bf044[_0x664f('0x3d')]||0x0,_0x5bf044[_0x664f('0x3a')]||0x0);_0x5bf044[_0x664f('0x41')]=_0x5bf044[_0x664f('0x42')]?getSeconds(_0x5bf044['endtime'],_0x5bf044[_0x664f('0x42')]):0x0;};exports[_0x664f('0x43')]=function(_0x24273d){return _0x24273d===_0x664f('0x44');};exports[_0x664f('0x45')]=function(_0x2d7976,_0x21231c,_0x348c9f,_0x2ea372,_0x149daa){var _0x53cd88=_0x2ea372?_0x664f('0x46'):_0x2d7976[_0x664f('0x1b')];_0x53cd88=_0x149daa?_0x664f('0x47'):_0x53cd88;return{'actionid':_0x2d7976[_0x664f('0x48')],'action':_0x664f('0x49'),'channel':_0x2d7976[_0x664f('0x4a')],'callerid':util[_0x664f('0x14')](_0x664f('0x15'),_0x53cd88,_0x2d7976[_0x664f('0x1c')]),'Exten':_0x664f('0x28'),'Context':_0x664f('0x4b'),'Priority':'1','variable':_0x348c9f,'timeout':(_0x21231c[_0x664f('0x4c')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2d7976[_0x664f('0x48')]};};exports[_0x664f('0x4d')]=function(_0x322626){return _0x322626[_0x664f('0x4e')]+_0x322626['countcongestionretry']+_0x322626[_0x664f('0x4f')];};exports['cloneAction']=function(_0x42cf0a){var _0x4bcb8d=_[_0x664f('0x50')](_0x42cf0a);_0x4bcb8d[_0x664f('0x37')]=0xf;_0x4bcb8d[_0x664f('0x38')]=_0x664f('0x51');return _0x4bcb8d;};exports[_0x664f('0x52')]=function(_0x10c237,_0x50621c,_0x50c809){var _0x2ac94a={};_0x2ac94a[_0x50621c]=_0x10c237[_0x50621c];_0x2ac94a[_0x664f('0x53')]=![];_0x2ac94a['scheduledat']=moment()[_0x664f('0x54')](_0x50c809,_0x664f('0x55'))['format'](_0x664f('0x36'));_0x2ac94a[_0x664f('0x1d')]=_0x10c237[_0x664f('0x1d')];_0x2ac94a[_0x664f('0x56')]=_0x10c237[_0x664f('0x56')];_0x2ac94a[_0x664f('0x57')]=_0x10c237[_0x664f('0x57')]||undefined;return _0x2ac94a;};exports[_0x664f('0x58')]=function(_0x5478d0,_0x344ff7){if(!_[_0x664f('0x17')](_0x5478d0)){if(_0x5478d0[_0x664f('0x59')]>0x0){_0x5478d0['pTalking']-=0x1;}else{logger[_0x664f('0xa')](_0x344ff7,_0x664f('0x5a'));}}else{logger[_0x664f('0xa')](_0x344ff7,_0x664f('0x5b'));}};exports[_0x664f('0x5c')]=function(_0x26fb3e){if(_0x26fb3e<=0x0){return!![];}return![];};exports[_0x664f('0x5d')]=function(_0xf6629f,_0x5a9631){_0xf6629f[_0x664f('0x5e')]=_0x5a9631;_0xf6629f[_0x664f('0x1a')]=_0xf6629f[_0x664f('0x5f')];_0xf6629f[_0x664f('0x60')]=_0xf6629f[_0x664f('0x4a')];return _0xf6629f;};exports[_0x664f('0x61')]=function(_0xf08b42){var _0xde6a79={};_0xde6a79['queue']=_0xf08b42[_0x664f('0x5f')];_0xde6a79[_0x664f('0x60')]=_0xf08b42['channelAgent'];_0xde6a79[_0x664f('0x48')]=_0xf08b42[_0x664f('0x48')];return _0xde6a79;};exports[_0x664f('0x62')]=function(_0x28506d){var _0x442d85=[];for(var _0x510990 in _0x28506d){if(_0x28506d[_0x664f('0x2b')](_0x510990)){if(!_[_0x664f('0x17')](_0x28506d[_0x510990])&&_0x28506d[_0x510990][_0x664f('0x37')]===_0x664f('0x63')&&_0x28506d[_0x510990]['status']===_0x664f('0x64')){_0x442d85[_0x664f('0x65')](_0x28506d[_0x510990]['id']);}}}return _0x442d85;};exports[_0x664f('0x66')]=function(_0x8d24ea){var _0xdd8615=moment()[_0x664f('0x6')](0x0);var _0x569b0c=moment(_0x8d24ea)['milliseconds'](0x0);return _0xdd8615[_0x664f('0x7')](_0x569b0c,'seconds');};exports[_0x664f('0x67')]=function(_0x11b9b1){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x11b9b1['ContactId'],'ListId':_0x11b9b1['ListId'],'VoiceQueueId':_0x11b9b1['VoiceQueueId']||undefined,'CampaignId':_0x11b9b1[_0x664f('0x68')]||undefined};};exports[_0x664f('0x69')]=function(_0x2f84bb){if(_0x2f84bb===_0x664f('0x48')||_0x2f84bb===_0x664f('0x6a')||_0x2f84bb==='queue'||_0x2f84bb===_0x664f('0x6b')||_0x2f84bb===_0x664f('0x6c')||_0x2f84bb===_0x664f('0x6d')||_0x2f84bb===_0x664f('0x3f')||_0x2f84bb===_0x664f('0x4a')||_0x2f84bb===_0x664f('0x1b')||_0x2f84bb===_0x664f('0x53')||_0x2f84bb==='calleridnum'||_0x2f84bb===_0x664f('0x6e')||_0x2f84bb===_0x664f('0x4e')||_0x2f84bb==='countcongestionretry'||_0x2f84bb===_0x664f('0x4f')||_0x2f84bb===_0x664f('0x6f')||_0x2f84bb===_0x664f('0x70')||_0x2f84bb===_0x664f('0x71')||_0x2f84bb===_0x664f('0x72')||_0x2f84bb===_0x664f('0x73')||_0x2f84bb===_0x664f('0x1d')||_0x2f84bb===_0x664f('0x56')||_0x2f84bb===_0x664f('0x40')||_0x2f84bb==='VoiceQueueId'||_0x2f84bb==='sipcallid'||_0x2f84bb===_0x664f('0x74')||_0x2f84bb==='xmd-queue'||_0x2f84bb===_0x664f('0x75')||_0x2f84bb===_0x664f('0x76')||_0x2f84bb===_0x664f('0x77')||_0x2f84bb===_0x664f('0x78')||_0x2f84bb===_0x664f('0x79')||_0x2f84bb===_0x664f('0x7a')||_0x2f84bb===_0x664f('0x7b')||_0x2f84bb==='xmd-contactid'||_0x2f84bb===_0x664f('0x7c')||_0x2f84bb===_0x664f('0x7d')||_0x2f84bb===_0x664f('0x7e')||_0x2f84bb==='xmd-agi'||_0x2f84bb==='rtpaudioqos'||_0x2f84bb==='rtpaudioqosbridged'||_0x2f84bb===_0x664f('0x7f')||_0x2f84bb===_0x664f('0x80')||_0x2f84bb===_0x664f('0x81')||_0x2f84bb===_0x664f('0x82')||_0x2f84bb===_0x664f('0x83')||_0x2f84bb==='rtpaudioqosrttbridged'||_0x2f84bb===_0x664f('0x84')||_0x2f84bb==='rtpaudioqosbridged'||_0x2f84bb===_0x664f('0x7f')||_0x2f84bb===_0x664f('0x80')||_0x2f84bb===_0x664f('0x81')||_0x2f84bb===_0x664f('0x82')||_0x2f84bb===_0x664f('0x83')||_0x2f84bb===_0x664f('0x85')||_0x2f84bb===_0x664f('0x86')||_0x2f84bb===_0x664f('0x87')||_0x2f84bb==='state'||_0x2f84bb===_0x664f('0x38')){return![];}return!![];};exports[_0x664f('0x88')]=function(_0x52662e,_0x1bac82){var _0x2602db,_0x1b1582,_0x191d92;if(_0x1bac82<=0x0){_0x1bac82=0x1;}_0x2602db=new RegExp(_0x664f('0x89')+_0x1bac82+'}$');_0x1b1582=Math[_0x664f('0x8a')](0xa,_0x1bac82-0x1);_0x191d92=Math['pow'](0xa,_0x1bac82)-0x1;return util[_0x664f('0x14')]('%s',_['replace'](_0x52662e,_0x2602db,_[_0x664f('0x8b')](_0x1b1582,_0x191d92)));};exports['extractCalleridName']=function(_0x3b488d){var _0x4f8411=_0x3b488d['match'](/"(.*?)"/);return _0x4f8411?_0x4f8411[0x1]:_0x3b488d;};exports[_0x664f('0x8c')]=function(_0x348b71){var _0xbd4069=_0x348b71[_0x664f('0x8d')](/<(.*?)>/);return _0xbd4069?_0xbd4069[0x1]:_0x348b71;}; \ No newline at end of file +var _0x9ec0=['calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','originatecalleridname','xcally-motion-preview','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','isNil','tags','createdAt','%s%s','XMD-','toUpper','toLowerVariables','toLower','updateOriginated','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','YYYY-MM-DD\x20HH:mm:ss','statedesc','Blacklist','starttime','responsetime','logAgent','state','ringtime','membername','UserId','logCustomer','endtime','talktime','answertime','isFailure','variablesAction','RECALL','calleridname','BOOKED','uniqueid','channelAgent','from-sip','totalGlobal','countbusyretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','IsNotLoggedIn','interface','buildAcw','queue','agentReadyId','not_inuse','push','getDiff','diff','seconds','CampaignId','filterKey','idContact','type','countcongestionretry','callback','callbackuniqueid','recallme','sipcallid','xmd-voicequeueid','xmd-queue','xmd-phone','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-callerid','xmd-agiafter','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepeer','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','replace','extractCalleridName','match','extractCalleridNumber','../../../../config/logger','env','127.0.0.1','milliseconds','loggerCatch','error','inspect','logger','info','message','getCallerId','isUndefined','string','isEmpty','format','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','Queue','name'];(function(_0x15e666,_0x448ee8){var _0x349fc3=function(_0x425802){while(--_0x425802){_0x15e666['push'](_0x15e666['shift']());}};_0x349fc3(++_0x448ee8);}(_0x9ec0,0x71));var _0x09ec=function(_0x4cefee,_0xabb91e){_0x4cefee=_0x4cefee-0x0;var _0x473af2=_0x9ec0[_0x4cefee];return _0x473af2;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');var logger=require(_0x09ec('0x0'))('preview');var ipAgi=process[_0x09ec('0x1')]['XCALLY_IP_AGI']||_0x09ec('0x2');function getSeconds(_0x4a940a,_0xe77be3){var _0x17f000=moment(_0x4a940a)[_0x09ec('0x3')](0x0);var _0x4bf4b3=moment(_0xe77be3)['milliseconds'](0x0);return _0x17f000['diff'](_0x4bf4b3,'seconds');}exports[_0x09ec('0x4')]=function(_0x5eb6f7){return function(_0x527b62){logger[_0x09ec('0x5')](_0x5eb6f7,util[_0x09ec('0x6')](_0x527b62,{'showHidden':![],'depth':null}));};};exports[_0x09ec('0x7')]=function(_0x44efc3,_0x368456){logger['info'](_0x44efc3,util[_0x09ec('0x6')](_0x368456,{'showHidden':![],'depth':null}));};exports['loggerError']=function(_0xa29c64,_0x57bba1){logger['error'](_0xa29c64,util[_0x09ec('0x6')](_0x57bba1,{'showHidden':![],'depth':null}));};exports['logger2']=function(_0x26d2b0){return function(_0x146d49){logger[_0x09ec('0x8')](_0x26d2b0,util[_0x09ec('0x6')](_0x146d49,{'showHidden':![],'depth':null}));};};exports[_0x09ec('0x9')]=function(_0x24388b,_0x88d686,_0x448acf){return{'message':_0x24388b,'unlock':_0x88d686,'active':_0x448acf};};exports[_0x09ec('0xa')]=function(_0xda518a,_0x415682,_0x46cadf){if(!_[_0x09ec('0xb')](_0x46cadf)&&_0x09ec('0xc')===typeof _0x46cadf&&!_[_0x09ec('0xd')](_0x46cadf)){if(!_[_0x09ec('0xb')](_0x415682)&&_0x09ec('0xc')===typeof _0x415682&&!_['isEmpty'](_0x415682)){return util[_0x09ec('0xe')](_0x09ec('0xf'),_0x415682,_0x46cadf);}return util[_0x09ec('0xe')](_0x09ec('0xf'),_0x46cadf,_0x46cadf);}if(!_[_0x09ec('0xb')](_0xda518a)&&_0x09ec('0xc')===typeof _0xda518a&&!_[_0x09ec('0xd')](_0xda518a)){return _0xda518a;}return _0x09ec('0x10');};exports[_0x09ec('0x11')]=function(_0x3f362a){if(_['isNil'](_0x3f362a)){return![];}return _0x3f362a;};exports['addVariables']=function(_0x59c695,_0x14c4e4,_0x24d5dd,_0x59e72d,_0x37f2ae,_0x2d69a2){var _0xccc13={'XMD-QUEUE':_0x14c4e4[_0x09ec('0x12')]?_0x14c4e4[_0x09ec('0x12')][_0x09ec('0x13')]:'','XMD-CALLERID':_0x59e72d,'XMD-CALLERID-PREVIEW':_0x2d69a2?util[_0x09ec('0xe')](_0x09ec('0xf'),_0x2d69a2['calleridname'],_0x2d69a2[_0x09ec('0x14')]):_0x59e72d,'XMD-DIALID':_0x37f2ae,'XMD-CONTACTID':_0x14c4e4[_0x09ec('0x15')],'XMD-CDRTYPE':_0x09ec('0x16'),'CALLERID(all)':_0x59e72d,'XMD-VOICEQUEUEID':_0x14c4e4[_0x09ec('0x17')],'XMD-DIALCHANNEL':_0x24d5dd,'XMD-DIALTIMEOUT':_0x59c695[_0x09ec('0x18')]||0x1e,'XMD-DIALOPTIONS':util[_0x09ec('0xe')](_0x09ec('0x19'),_0x59c695[_0x09ec('0x1a')]?'g':'',_[_0x09ec('0xd')](_0x59c695[_0x09ec('0x1b')])?'':_0x09ec('0x1c')),'XMD-DIALURL':_0x59c695[_0x09ec('0x1d')]||'','XMD-AGI':_0x59c695['dialQueueProject']?util['format'](_0x09ec('0x1e'),ipAgi,_0x59c695[_0x09ec('0x1f')]):_0x09ec('0x20'),'XMD-AGIAFTER':_0x59c695['dialQueueProject2']?util[_0x09ec('0xe')](_0x09ec('0x1e'),ipAgi,_0x59c695[_0x09ec('0x1a')]):'NONE','XMD-ORIGINATECALLERIDNUM':_0x2d69a2?_0x2d69a2['originatecalleridnum']:'','XMD-ORIGINATECALLERIDNAME':_0x2d69a2?_0x2d69a2[_0x09ec('0x21')]:'','XMD-DESTINATION':_0x09ec('0x22')};if(!_[_0x09ec('0xd')](_0x59c695[_0x09ec('0x1b')])){_0xccc13[util[_0x09ec('0xe')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x59c695[_0x09ec('0x1b')];_0xccc13[util['format']('%s',_0x09ec('0x23'))]=_0x37f2ae;}if(_0x14c4e4&&_0x14c4e4[_0x09ec('0x24')]){for(var _0x580c3a in _0x14c4e4[_0x09ec('0x24')]){if(_0x14c4e4[_0x09ec('0x24')][_0x09ec('0x25')](_0x580c3a)){if(!_[_0x09ec('0x26')](_0x14c4e4[_0x09ec('0x24')][_0x580c3a])&&_0x580c3a!=='id'&&_0x580c3a!==_0x09ec('0x27')&&_0x580c3a!==_0x09ec('0x28')&&_0x580c3a!=='updatedAt'){_0xccc13[util[_0x09ec('0xe')](_0x09ec('0x29'),_0x09ec('0x2a'),_[_0x09ec('0x2b')](_0x580c3a))]=_0x14c4e4[_0x09ec('0x24')][_0x580c3a];}}}}return _0xccc13;};exports[_0x09ec('0x2c')]=function(_0x2a819e){var _0x15a776={};for(var _0x48e52b in _0x2a819e){if(_0x2a819e['hasOwnProperty'](_0x48e52b)){_0x15a776[util['format']('%s',_[_0x09ec('0x2d')](_0x48e52b))]=_0x2a819e[_0x48e52b];}}return{'variables':_0x15a776};};exports[_0x09ec('0x2e')]=function(_0x50d35e,_0x3a9b51){if(!_['isNil'](_0x50d35e)){if(_0x50d35e['hasOwnProperty'](_0x09ec('0x2f'))){if(_0x50d35e[_0x09ec('0x2f')]>0x0){_0x50d35e[_0x09ec('0x2f')]-=0x1;}else{logger[_0x09ec('0x5')]('[updateOriginated]\x20object\x20originated\x20is\x20negative',_0x3a9b51);}}}else{logger['error'](_0x09ec('0x30'),_0x3a9b51);}};exports['logBlacklist']=function(_0x3ca3b0){var _0x5b6c62=moment()[_0x09ec('0xe')](_0x09ec('0x31'));_0x3ca3b0['state']=0xd;_0x3ca3b0[_0x09ec('0x32')]=_0x09ec('0x33');_0x3ca3b0[_0x09ec('0x34')]=_0x5b6c62;_0x3ca3b0[_0x09ec('0x35')]=_0x5b6c62;_0x3ca3b0['endtime']=_0x5b6c62;};exports[_0x09ec('0x36')]=function(_0xaad378,_0x38c8f6,_0x2cd48b){var _0x2fcb5d=moment()[_0x09ec('0xe')](_0x09ec('0x31'));_0xaad378[_0x09ec('0x37')]=_0x38c8f6;_0xaad378[_0x09ec('0x32')]=_0x2cd48b;_0xaad378[_0x09ec('0x35')]=_0x2fcb5d;_0xaad378[_0x09ec('0x38')]=getSeconds(_0xaad378[_0x09ec('0x35')],_0xaad378[_0x09ec('0x34')]);};exports['logLookAgent']=function(_0x4b58ec,_0x5cbe5d,_0x4deb79){_0x4b58ec[_0x09ec('0x39')]=_0x5cbe5d;_0x4b58ec[_0x09ec('0x3a')]=_0x4deb79;};exports[_0x09ec('0x3b')]=function(_0xab5d01,_0x4fe0e0,_0x654c94){var _0x49d805=moment()[_0x09ec('0xe')]('YYYY-MM-DD\x20HH:mm:ss');_0xab5d01[_0x09ec('0x37')]=_0x4fe0e0;_0xab5d01[_0x09ec('0x32')]=_0x654c94;_0xab5d01[_0x09ec('0x35')]=_0xab5d01[_0x09ec('0x35')]?_0xab5d01[_0x09ec('0x35')]:_0x49d805;_0xab5d01[_0x09ec('0x3c')]=_0xab5d01[_0x09ec('0x3c')]?_0xab5d01[_0x09ec('0x3c')]:_0x49d805;_0xab5d01[_0x09ec('0x38')]=getSeconds(_0xab5d01['responsetime']||0x0,_0xab5d01['starttime']||0x0);_0xab5d01[_0x09ec('0x3d')]=_0xab5d01[_0x09ec('0x3e')]?getSeconds(_0xab5d01[_0x09ec('0x3c')],_0xab5d01[_0x09ec('0x3e')]):0x0;};exports[_0x09ec('0x3f')]=function(_0x2888d0){return _0x2888d0==='Failure';};exports[_0x09ec('0x40')]=function(_0x19b50f,_0x561c80,_0x1d472f,_0x29e6fd,_0x242791){var _0x53ad8d=_0x29e6fd?_0x09ec('0x41'):_0x19b50f[_0x09ec('0x42')];_0x53ad8d=_0x242791?_0x09ec('0x43'):_0x53ad8d;return{'actionid':_0x19b50f[_0x09ec('0x44')],'action':'originate','channel':_0x19b50f[_0x09ec('0x45')],'callerid':util[_0x09ec('0xe')]('\x22%s\x22\x20<%s>',_0x53ad8d,_0x19b50f[_0x09ec('0x14')]),'Exten':'xcally-motion-preview','Context':_0x09ec('0x46'),'Priority':'1','variable':_0x1d472f,'timeout':(_0x561c80['timeout']||0x1e)*0x3e8,'async':!![],'channelid':_0x19b50f[_0x09ec('0x44')]};};exports[_0x09ec('0x47')]=function(_0x30ff78){return _0x30ff78[_0x09ec('0x48')]+_0x30ff78['countcongestionretry']+_0x30ff78[_0x09ec('0x49')];};exports[_0x09ec('0x4a')]=function(_0x7494c0){var _0x37ea20=_[_0x09ec('0x4b')](_0x7494c0);_0x37ea20[_0x09ec('0x37')]=0xf;_0x37ea20['statedesc']=_0x09ec('0x4c');return _0x37ea20;};exports[_0x09ec('0x4d')]=function(_0x23c78b,_0x113da1,_0x1becb2){var _0x217853={};_0x217853[_0x113da1]=_0x23c78b[_0x113da1];_0x217853[_0x09ec('0x4e')]=![];_0x217853[_0x09ec('0x4f')]=moment()[_0x09ec('0x50')](_0x1becb2,'minutes')[_0x09ec('0xe')](_0x09ec('0x31'));_0x217853[_0x09ec('0x15')]=_0x23c78b[_0x09ec('0x15')];_0x217853[_0x09ec('0x51')]=_0x23c78b[_0x09ec('0x51')];_0x217853['VoiceQueueId']=_0x23c78b[_0x09ec('0x17')]||undefined;return _0x217853;};exports[_0x09ec('0x52')]=function(_0x2cc283,_0x197954){if(!_[_0x09ec('0x26')](_0x2cc283)){if(_0x2cc283[_0x09ec('0x53')]>0x0){_0x2cc283[_0x09ec('0x53')]-=0x1;}else{logger['error'](_0x197954,_0x09ec('0x54'));}}else{logger[_0x09ec('0x5')](_0x197954,'[decrementTalkink]\x20is\x20null\x20or\x20undefined');}};exports[_0x09ec('0x55')]=function(_0x59b633){if(_0x59b633<=0x0){return!![];}return![];};exports['buildObj']=function(_0x18c120,_0x3ba45a){_0x18c120['lastevent']=_0x3ba45a;_0x18c120['name']=_0x18c120['queue'];_0x18c120[_0x09ec('0x56')]=_0x18c120[_0x09ec('0x45')];return _0x18c120;};exports[_0x09ec('0x57')]=function(_0x1c8c2d){var _0x53d73b={};_0x53d73b['queue']=_0x1c8c2d[_0x09ec('0x58')];_0x53d73b['interface']=_0x1c8c2d['channelAgent'];_0x53d73b[_0x09ec('0x44')]=_0x1c8c2d[_0x09ec('0x44')];return _0x53d73b;};exports[_0x09ec('0x59')]=function(_0x34de2f){var _0x430b00=[];for(var _0x1a0672 in _0x34de2f){if(_0x34de2f['hasOwnProperty'](_0x1a0672)){if(!_[_0x09ec('0x26')](_0x34de2f[_0x1a0672])&&_0x34de2f[_0x1a0672][_0x09ec('0x37')]===_0x09ec('0x5a')&&_0x34de2f[_0x1a0672]['status']==='reachable'){_0x430b00[_0x09ec('0x5b')](_0x34de2f[_0x1a0672]['id']);}}}return _0x430b00;};exports[_0x09ec('0x5c')]=function(_0x32bb56){var _0xdcf149=moment()[_0x09ec('0x3')](0x0);var _0x332624=moment(_0x32bb56)['milliseconds'](0x0);return _0xdcf149[_0x09ec('0x5d')](_0x332624,_0x09ec('0x5e'));};exports['createBody']=function(_0x15c582){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x15c582['ContactId'],'ListId':_0x15c582[_0x09ec('0x51')],'VoiceQueueId':_0x15c582['VoiceQueueId']||undefined,'CampaignId':_0x15c582[_0x09ec('0x5f')]||undefined};};exports[_0x09ec('0x60')]=function(_0x19d5bf){if(_0x19d5bf===_0x09ec('0x44')||_0x19d5bf===_0x09ec('0x61')||_0x19d5bf===_0x09ec('0x58')||_0x19d5bf===_0x09ec('0x62')||_0x19d5bf==='campaigntype'||_0x19d5bf==='dialAnswer'||_0x19d5bf===_0x09ec('0x39')||_0x19d5bf===_0x09ec('0x45')||_0x19d5bf===_0x09ec('0x42')||_0x19d5bf===_0x09ec('0x4e')||_0x19d5bf===_0x09ec('0x14')||_0x19d5bf==='scheduledat'||_0x19d5bf===_0x09ec('0x48')||_0x19d5bf===_0x09ec('0x63')||_0x19d5bf==='countnoanswerretry'||_0x19d5bf==='countglobal'||_0x19d5bf===_0x09ec('0x64')||_0x19d5bf===_0x09ec('0x65')||_0x19d5bf==='callbackat'||_0x19d5bf===_0x09ec('0x66')||_0x19d5bf===_0x09ec('0x15')||_0x19d5bf===_0x09ec('0x51')||_0x19d5bf===_0x09ec('0x3a')||_0x19d5bf===_0x09ec('0x17')||_0x19d5bf===_0x09ec('0x67')||_0x19d5bf===_0x09ec('0x68')||_0x19d5bf===_0x09ec('0x69')||_0x19d5bf===_0x09ec('0x6a')||_0x19d5bf===_0x09ec('0x6b')||_0x19d5bf===_0x09ec('0x6c')||_0x19d5bf===_0x09ec('0x6d')||_0x19d5bf==='xmd-dialoptions'||_0x19d5bf===_0x09ec('0x6e')||_0x19d5bf===_0x09ec('0x6f')||_0x19d5bf===_0x09ec('0x70')||_0x19d5bf===_0x09ec('0x71')||_0x19d5bf===_0x09ec('0x72')||_0x19d5bf===_0x09ec('0x73')||_0x19d5bf==='xmd-agi'||_0x19d5bf===_0x09ec('0x74')||_0x19d5bf===_0x09ec('0x75')||_0x19d5bf===_0x09ec('0x76')||_0x19d5bf===_0x09ec('0x77')||_0x19d5bf===_0x09ec('0x78')||_0x19d5bf===_0x09ec('0x79')||_0x19d5bf===_0x09ec('0x7a')||_0x19d5bf===_0x09ec('0x7b')||_0x19d5bf===_0x09ec('0x74')||_0x19d5bf===_0x09ec('0x75')||_0x19d5bf===_0x09ec('0x76')||_0x19d5bf===_0x09ec('0x77')||_0x19d5bf===_0x09ec('0x78')||_0x19d5bf===_0x09ec('0x79')||_0x19d5bf===_0x09ec('0x7a')||_0x19d5bf===_0x09ec('0x7b')||_0x19d5bf===_0x09ec('0x7c')||_0x19d5bf===_0x09ec('0x7d')||_0x19d5bf==='state'||_0x19d5bf==='statedesc'){return![];}return!![];};exports[_0x09ec('0x7e')]=function(_0x236f97,_0x3ac4c2){var _0x5c1cd1,_0x4f9a47,_0x51f3cd;if(_0x3ac4c2<=0x0){_0x3ac4c2=0x1;}_0x5c1cd1=new RegExp(_0x09ec('0x7f')+_0x3ac4c2+'}$');_0x4f9a47=Math[_0x09ec('0x80')](0xa,_0x3ac4c2-0x1);_0x51f3cd=Math['pow'](0xa,_0x3ac4c2)-0x1;return util['format']('%s',_[_0x09ec('0x81')](_0x236f97,_0x5c1cd1,_['random'](_0x4f9a47,_0x51f3cd)));};exports[_0x09ec('0x82')]=function(_0x59ac38){var _0x37d563=_0x59ac38[_0x09ec('0x83')](/"(.*?)"/);return _0x37d563?_0x37d563[0x1]:_0x59ac38;};exports[_0x09ec('0x84')]=function(_0x48a444){var _0x552e7c=_0x48a444[_0x09ec('0x83')](/<(.*?)>/);return _0x552e7c?_0x552e7c[0x1]:_0x48a444;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index c01e67f..ed3cf0b 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x2ebe3e,_0x485efa){var _0x10f92a=function(_0x3cf182){while(--_0x3cf182){_0x2ebe3e['push'](_0x2ebe3e['shift']());}};_0x10f92a(++_0x485efa);}(_0x5f2f,0x73));var _0xf5f2=function(_0x374f98,_0x1399d2){_0x374f98=_0x374f98-0x0;var _0x7cdb71=_0x5f2f[_0x374f98];return _0x7cdb71;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x3b6637,_0x566058){var _0x4713a9=function(_0x2aa5a7){while(--_0x2aa5a7){_0x3b6637['push'](_0x3b6637['shift']());}};_0x4713a9(++_0x566058);}(_0x5f2f,0x73));var _0xf5f2=function(_0xf531ad,_0x9313a4){_0xf531ad=_0xf531ad-0x0;var _0x146aab=_0x5f2f[_0xf531ad];return _0x146aab;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 9dc9197..152cc49 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 _0x599f=['deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','hasOwnProperty','format','SIP/%s','name','isNil','interface','sumHoldTime','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','answered','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundBlacklistCallsDay','outboundRejectCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initTelephones','isUndefined','trunks','length','initVoiceQueues','initTriggers','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','initSugarcrmAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','uniqueid','queue','queuecallerexit','unmanaged','queuecallerabandon','queuecallerleaveAt','diff','seconds','queuecallercompleteAt','queuecallerabandonAt','queuecallerexitAt','initVoiceCallReports','disposition','ANSWERED','duration','billableseconds','initCampaigns','initVoiceExtensions','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','lodash','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/campaign','../model/voiceExtension','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/vtigerAccount','../model/dynamics365Account','../model/freshsalesAccount','../model/faxAccount','agents','telephones','voiceQueues','triggers','campaigns','templates','outbound','channels','queueChannels','zendeskAccounts','salesforceAccounts','sugarcrmAccounts','freshdeskAccounts'];(function(_0x2e4c65,_0x3820c5){var _0x22b0ed=function(_0xf03694){while(--_0xf03694){_0x2e4c65['push'](_0x2e4c65['shift']());}};_0x22b0ed(++_0x3820c5);}(_0x599f,0x112));var _0xf599=function(_0x2aed0d,_0x117ed3){_0x2aed0d=_0x2aed0d-0x0;var _0x1e8f69=_0x599f[_0x2aed0d];return _0x1e8f69;};'use strict';var BPromise=require(_0xf599('0x0'));var util=require('util');var _=require(_0xf599('0x1'));var moment=require('moment');var Agent=require(_0xf599('0x2'));var Telephone=require(_0xf599('0x3'));var Trunk=require(_0xf599('0x4'));var VoiceQueue=require(_0xf599('0x5'));var Trigger=require('../model/trigger');var Template=require('../model/template');var Campaign=require(_0xf599('0x6'));var VoiceExtension=require(_0xf599('0x7'));var ZendeskAccount=require('../model/zendeskAccount');var SalesforceAccount=require('../model/salesforceAccount');var FreshdeskAccount=require(_0xf599('0x8'));var SugarcrmAccount=require(_0xf599('0x9'));var ZohoAccount=require(_0xf599('0xa'));var DeskAccount=require(_0xf599('0xb'));var VtigerAccount=require(_0xf599('0xc'));var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xf599('0xd'));var FreshsalesAccount=require(_0xf599('0xe'));var FaxAccount=require(_0xf599('0xf'));var Realtime=function(){this[_0xf599('0x10')]={};this[_0xf599('0x11')]={};this['trunks']={};this[_0xf599('0x12')]={};this[_0xf599('0x13')]={};this[_0xf599('0x14')]={};this[_0xf599('0x15')]={};this[_0xf599('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xf599('0x17')]={};this[_0xf599('0x18')]={};this['outboundChannels']={};this['timers']={};this[_0xf599('0x19')]={};this[_0xf599('0x1a')]={};this[_0xf599('0x1b')]={};this[_0xf599('0x1c')]={};this['zohoAccounts']={};this[_0xf599('0x1d')]={};this[_0xf599('0x1e')]={};this[_0xf599('0x1f')]={};this[_0xf599('0x20')]={};this[_0xf599('0x21')]={};this[_0xf599('0x22')]={};};function freeIsNotKey(_0x32b629,_0x1d756b,_0x515275){var _0x42a1f9=_[_0xf599('0x23')](_0x32b629,function(_0xe009cc,_0x336fa4){return _0xe009cc[_0x515275];});for(var _0x34b86e in _0x1d756b){if(_0x1d756b[_0xf599('0x24')](_0x34b86e)){if(!_0x42a1f9[_0x34b86e]){delete _0x1d756b[_0x34b86e];}}}}function freeIsNotKeySip(_0x32321f,_0x4d3857){var _0x42ef7e=_[_0xf599('0x23')](_0x32321f,function(_0x11f610,_0x5a800c){return util[_0xf599('0x25')](_0xf599('0x26'),_0x11f610[_0xf599('0x27')]);});for(var _0xd93e28 in _0x4d3857){if(_0x4d3857[_0xf599('0x24')](_0xd93e28)){if(!_0x42ef7e[_0xd93e28]){delete _0x4d3857[_0xd93e28];}}}}function freeIsNotKeyAgent(_0x4a5840,_0x20e496){var _0x5b44f4=_[_0xf599('0x23')](_0x4a5840,function(_0x36f066,_0x3a0a4a){var _0x58daa1=_[_0xf599('0x28')](_0x36f066[_0xf599('0x29')])?util[_0xf599('0x25')](_0xf599('0x26'),_0x36f066['name']):_0x36f066[_0xf599('0x29')];return _0x58daa1;});for(var _0x51d3c8 in _0x20e496){if(_0x20e496['hasOwnProperty'](_0x51d3c8)){if(!_0x5b44f4[_0x51d3c8]){delete _0x20e496[_0x51d3c8];}}}}function clearVoiceCallReports(_0xd3547){_0xd3547['total']=0x0;_0xd3547['answered']=0x0;_0xd3547[_0xf599('0x2a')]=0x0;_0xd3547['sumDuration']=0x0;_0xd3547[_0xf599('0x2b')]=0x0;}function clearCampaigns(_0x1bf575){if(!_[_0xf599('0x2c')](_0x1bf575)){for(var _0x72e556 in _0x1bf575){if(_0x1bf575['hasOwnProperty'](_0x72e556)){_0x1bf575[_0x72e556][_0xf599('0x2d')]=0x0;_0x1bf575[_0x72e556][_0xf599('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x2be3f0){if(!_[_0xf599('0x2c')](_0x2be3f0)){for(var _0x1f2822 in _0x2be3f0){if(_0x2be3f0[_0xf599('0x24')](_0x1f2822)){_0x2be3f0[_0x1f2822][_0xf599('0x2f')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x30')]=0x0;_0x2be3f0[_0x1f2822]['unmanaged']=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x31')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x2a')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x32')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x2b')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x33')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x34')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x35')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x36')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x37')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x38')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x39')]=0x0;_0x2be3f0[_0x1f2822]['outboundDropCallsDayCallersExit']=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x3a')]=0x0;_0x2be3f0[_0x1f2822]['outboundOriginateFailureCallsDay']=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x3b')]=0x0;_0x2be3f0[_0x1f2822]['outboundReCallsDay']=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x33')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x3c')]=0x0;_0x2be3f0[_0x1f2822][_0xf599('0x3d')]=!![];}}}}Realtime[_0xf599('0x3e')][_0xf599('0x3f')]=function(_0x4df158,_0x3cba3b){for(var _0x21b4f0 in _0x3cba3b){if(_0x4df158[_0xf599('0x24')](_0x21b4f0)){_0x4df158[_0x21b4f0]=_0x3cba3b[_0x21b4f0];}}};Realtime[_0xf599('0x3e')]['initAgents']=function(){var _0x5de1d8=this;return function(_0x5aa7b6){if(_0x5aa7b6){freeIsNotKeyAgent(_0x5aa7b6,_0x5de1d8[_0xf599('0x10')]);for(var _0x3d3a24=0x0,_0x19c33={},_0xa00004={};_0x3d3a24<_0x5aa7b6['length'];_0x3d3a24+=0x1){_0x19c33=_0x5aa7b6[_0x3d3a24];var _0x4a07ee=_[_0xf599('0x28')](_0x19c33['interface'])?util[_0xf599('0x25')](_0xf599('0x26'),_0x19c33[_0xf599('0x27')]):_0x19c33['interface'];if(_['isUndefined'](_0x5de1d8['agents'][_0x4a07ee])){_0x5de1d8[_0xf599('0x10')][_0x4a07ee]=new Agent(_0x19c33);}else{_0x5de1d8[_0xf599('0x3f')](_0x5de1d8[_0xf599('0x10')][_0x4a07ee],_0x19c33);}}}return _0x5de1d8['agents'];};};Realtime[_0xf599('0x3e')][_0xf599('0x40')]=function(){var _0x25aa43=this;return function(_0x330ae5){if(_0x330ae5){freeIsNotKeySip(_0x330ae5,_0x25aa43[_0xf599('0x11')]);for(var _0xfbf5c7=0x0,_0x56cb54={},_0x2d94d6={};_0xfbf5c7<_0x330ae5['length'];_0xfbf5c7+=0x1){_0x56cb54=_0x330ae5[_0xfbf5c7];if(_[_0xf599('0x41')](_0x25aa43[_0xf599('0x11')][util[_0xf599('0x25')](_0xf599('0x26'),_0x56cb54[_0xf599('0x27')])])){_0x25aa43[_0xf599('0x11')][util[_0xf599('0x25')](_0xf599('0x26'),_0x56cb54[_0xf599('0x27')])]=new Telephone(_0x56cb54);}else{_0x25aa43[_0xf599('0x3f')](_0x25aa43[_0xf599('0x11')][util[_0xf599('0x25')](_0xf599('0x26'),_0x56cb54[_0xf599('0x27')])],_0x56cb54);}}}return _0x25aa43[_0xf599('0x11')];};};Realtime[_0xf599('0x3e')]['initTrunks']=function(){var _0x58314a=this;return function(_0x55ced6){if(_0x55ced6){freeIsNotKeySip(_0x55ced6,_0x58314a[_0xf599('0x42')]);for(var _0x596b28=0x0,_0x1a1b7f={},_0x445110={};_0x596b28<_0x55ced6[_0xf599('0x43')];_0x596b28+=0x1){_0x1a1b7f=_0x55ced6[_0x596b28];if(_['isUndefined'](_0x58314a['trunks'][util[_0xf599('0x25')](_0xf599('0x26'),_0x1a1b7f['name'])])){_0x58314a['trunks'][util[_0xf599('0x25')](_0xf599('0x26'),_0x1a1b7f[_0xf599('0x27')])]=new Trunk(_0x1a1b7f);}else{_0x58314a['mergeFromDatabase'](_0x58314a['trunks'][util[_0xf599('0x25')](_0xf599('0x26'),_0x1a1b7f[_0xf599('0x27')])],_0x1a1b7f);}}}return _0x58314a[_0xf599('0x42')];};};Realtime[_0xf599('0x3e')][_0xf599('0x44')]=function(){var _0x50bcf6=this;return function(_0x54369a){if(_0x54369a){freeIsNotKey(_0x54369a,_0x50bcf6[_0xf599('0x12')],'name');for(var _0x242826=0x0,_0x1f5f55={},_0x1548df={};_0x242826<_0x54369a[_0xf599('0x43')];_0x242826+=0x1){_0x1f5f55=_0x54369a[_0x242826];if(_[_0xf599('0x41')](_0x50bcf6['voiceQueues'][_0x1f5f55[_0xf599('0x27')]])){_0x50bcf6[_0xf599('0x12')][_0x1f5f55[_0xf599('0x27')]]=new VoiceQueue(_0x1f5f55);}else{_0x50bcf6[_0xf599('0x3f')](_0x50bcf6[_0xf599('0x12')][_0x1f5f55[_0xf599('0x27')]],_0x1f5f55);}}}return _0x50bcf6[_0xf599('0x12')];};};Realtime[_0xf599('0x3e')][_0xf599('0x45')]=function(){var _0x1f91c5=this;return function(_0x31e67d){if(_0x31e67d){freeIsNotKey(_0x31e67d,_0x1f91c5['triggers'],'id');for(var _0x268081=0x0,_0x309d03={},_0x47b9fe={};_0x268081<_0x31e67d[_0xf599('0x43')];_0x268081+=0x1){_0x309d03=_0x31e67d[_0x268081];if(_[_0xf599('0x41')](_0x1f91c5[_0xf599('0x13')][_0x309d03['id']])){_0x1f91c5[_0xf599('0x13')][_0x309d03['id']]=new Trigger(_0x309d03);}else{_0x1f91c5[_0xf599('0x3f')](_0x1f91c5[_0xf599('0x13')][_0x309d03['id']],_0x309d03);}}}return _0x1f91c5['triggers'];};};Realtime['prototype']['initTemplates']=function(){var _0x1dbfe2=this;return function(_0x162d59){if(_0x162d59){freeIsNotKey(_0x162d59,_0x1dbfe2[_0xf599('0x15')],'id');for(var _0x4fecdc=0x0,_0x13e88c={},_0x57df1b={};_0x4fecdc<_0x162d59[_0xf599('0x43')];_0x4fecdc+=0x1){_0x13e88c=_0x162d59[_0x4fecdc];if(_[_0xf599('0x41')](_0x1dbfe2[_0xf599('0x15')][_0x13e88c['id']])){_0x1dbfe2[_0xf599('0x15')][_0x13e88c['id']]=new Template(_0x13e88c);}else{_0x1dbfe2[_0xf599('0x3f')](_0x1dbfe2[_0xf599('0x15')][_0x13e88c['id']],_0x13e88c);}}}return _0x1dbfe2[_0xf599('0x15')];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x1b6028=this;return function(_0x3b2040){if(_0x3b2040){freeIsNotKey(_0x3b2040,_0x1b6028['zendeskAccounts'],'id');for(var _0x20ee92=0x0,_0x3bd406={},_0x557e63={};_0x20ee92<_0x3b2040['length'];_0x20ee92+=0x1){_0x3bd406=_0x3b2040[_0x20ee92];if(_[_0xf599('0x41')](_0x1b6028[_0xf599('0x19')][_0x3bd406['id']])){_0x1b6028[_0xf599('0x19')][_0x3bd406['id']]=new ZendeskAccount(_0x3bd406);}else{_0x1b6028[_0xf599('0x3f')](_0x1b6028[_0xf599('0x19')][_0x3bd406['id']],_0x3bd406);}}}return _0x1b6028[_0xf599('0x19')];};};Realtime[_0xf599('0x3e')]['initSalesforceAccounts']=function(){var _0x135b3c=this;return function(_0x6ff4cb){if(_0x6ff4cb){freeIsNotKey(_0x6ff4cb,_0x135b3c[_0xf599('0x1a')],'id');for(var _0x178c75=0x0,_0x2daa7f={},_0x425fe8={};_0x178c75<_0x6ff4cb[_0xf599('0x43')];_0x178c75+=0x1){_0x2daa7f=_0x6ff4cb[_0x178c75];if(_[_0xf599('0x41')](_0x135b3c['salesforceAccounts'][_0x2daa7f['id']])){_0x135b3c[_0xf599('0x1a')][_0x2daa7f['id']]=new SalesforceAccount(_0x2daa7f);}else{_0x135b3c[_0xf599('0x3f')](_0x135b3c['salesforceAccounts'][_0x2daa7f['id']],_0x2daa7f);}}}return _0x135b3c[_0xf599('0x1a')];};};Realtime['prototype'][_0xf599('0x46')]=function(){var _0x1dad56=this;return function(_0x2938c7){if(_0x2938c7){freeIsNotKey(_0x2938c7,_0x1dad56['freshdeskAccounts'],'id');for(var _0x4bdbad=0x0,_0x27be56={},_0x612c27={};_0x4bdbad<_0x2938c7[_0xf599('0x43')];_0x4bdbad+=0x1){_0x27be56=_0x2938c7[_0x4bdbad];if(_[_0xf599('0x41')](_0x1dad56[_0xf599('0x1c')][_0x27be56['id']])){_0x1dad56[_0xf599('0x1c')][_0x27be56['id']]=new FreshdeskAccount(_0x27be56);}else{_0x1dad56['mergeFromDatabase'](_0x1dad56['freshdeskAccounts'][_0x27be56['id']],_0x27be56);}}}return _0x1dad56[_0xf599('0x1c')];};};Realtime[_0xf599('0x3e')][_0xf599('0x47')]=function(){var _0x5c37b8=this;return function(_0x146979){if(_0x146979){freeIsNotKey(_0x146979,_0x5c37b8[_0xf599('0x48')],'id');for(var _0x42bd1e=0x0,_0x2d8437={},_0x50ffdc={};_0x42bd1e<_0x146979['length'];_0x42bd1e+=0x1){_0x2d8437=_0x146979[_0x42bd1e];if(_[_0xf599('0x41')](_0x5c37b8[_0xf599('0x48')][_0x2d8437['id']])){_0x5c37b8[_0xf599('0x48')][_0x2d8437['id']]=new ZohoAccount(_0x2d8437);}else{_0x5c37b8[_0xf599('0x3f')](_0x5c37b8['zohoAccounts'][_0x2d8437['id']],_0x2d8437);}}}return _0x5c37b8[_0xf599('0x48')];};};Realtime[_0xf599('0x3e')][_0xf599('0x49')]=function(){var _0x831388=this;return function(_0x2064b4){if(_0x2064b4){freeIsNotKey(_0x2064b4,_0x831388[_0xf599('0x1d')],'id');for(var _0x1379f5=0x0,_0x4f1987={},_0x97ba56={};_0x1379f5<_0x2064b4[_0xf599('0x43')];_0x1379f5+=0x1){_0x4f1987=_0x2064b4[_0x1379f5];if(_[_0xf599('0x41')](_0x831388[_0xf599('0x1d')][_0x4f1987['id']])){_0x831388[_0xf599('0x1d')][_0x4f1987['id']]=new DeskAccount(_0x4f1987);}else{_0x831388[_0xf599('0x3f')](_0x831388['deskAccounts'][_0x4f1987['id']],_0x4f1987);}}}return _0x831388[_0xf599('0x1d')];};};Realtime[_0xf599('0x3e')][_0xf599('0x4a')]=function(){var _0x1c42c8=this;return function(_0x523dbe){if(_0x523dbe){freeIsNotKey(_0x523dbe,_0x1c42c8['sugarcrmAccounts'],'id');for(var _0x5e8b20=0x0,_0x8cad4b={},_0x2beccc={};_0x5e8b20<_0x523dbe[_0xf599('0x43')];_0x5e8b20+=0x1){_0x8cad4b=_0x523dbe[_0x5e8b20];if(_['isUndefined'](_0x1c42c8[_0xf599('0x1b')][_0x8cad4b['id']])){_0x1c42c8[_0xf599('0x1b')][_0x8cad4b['id']]=new SugarcrmAccount(_0x8cad4b);}else{_0x1c42c8['mergeFromDatabase'](_0x1c42c8[_0xf599('0x1b')][_0x8cad4b['id']],_0x8cad4b);}}}return _0x1c42c8[_0xf599('0x1b')];};};Realtime[_0xf599('0x3e')]['initVtigerAccounts']=function(){var _0x2317d1=this;return function(_0x7a828f){if(_0x7a828f){freeIsNotKey(_0x7a828f,_0x2317d1[_0xf599('0x1e')],'id');for(var _0x1f55a9=0x0,_0x54bbc5={},_0x9bdfba={};_0x1f55a9<_0x7a828f[_0xf599('0x43')];_0x1f55a9+=0x1){_0x54bbc5=_0x7a828f[_0x1f55a9];if(_['isUndefined'](_0x2317d1[_0xf599('0x1e')][_0x54bbc5['id']])){_0x2317d1[_0xf599('0x1e')][_0x54bbc5['id']]=new VtigerAccount(_0x54bbc5);}else{_0x2317d1['mergeFromDatabase'](_0x2317d1['vtigerAccounts'][_0x54bbc5['id']],_0x54bbc5);}}}return _0x2317d1[_0xf599('0x1e')];};};Realtime['prototype'][_0xf599('0x4b')]=function(){var _0x21feac=this;return function(_0x132827){if(_0x132827){freeIsNotKey(_0x132827,_0x21feac[_0xf599('0x1f')],'id');for(var _0x2fdc46=0x0,_0x409b63={},_0x36b5ca={};_0x2fdc46<_0x132827[_0xf599('0x43')];_0x2fdc46+=0x1){_0x409b63=_0x132827[_0x2fdc46];if(_['isUndefined'](_0x21feac[_0xf599('0x1f')][_0x409b63['id']])){_0x21feac[_0xf599('0x1f')][_0x409b63['id']]=new ServicenowAccount(_0x409b63);}else{_0x21feac['mergeFromDatabase'](_0x21feac[_0xf599('0x1f')][_0x409b63['id']],_0x409b63);}}}return _0x21feac[_0xf599('0x1f')];};};Realtime[_0xf599('0x3e')]['initDynamics365Accounts']=function(){var _0x3d5d52=this;return function(_0x4c248b){if(_0x4c248b){freeIsNotKey(_0x4c248b,_0x3d5d52[_0xf599('0x20')],'id');for(var _0x1e889c=0x0,_0x3d993e={},_0x33f013={};_0x1e889c<_0x4c248b['length'];_0x1e889c+=0x1){_0x3d993e=_0x4c248b[_0x1e889c];if(_['isUndefined'](_0x3d5d52['dynamics365Accounts'][_0x3d993e['id']])){_0x3d5d52[_0xf599('0x20')][_0x3d993e['id']]=new Dynamics365Account(_0x3d993e);}else{_0x3d5d52[_0xf599('0x3f')](_0x3d5d52[_0xf599('0x20')][_0x3d993e['id']],_0x3d993e);}}}return _0x3d5d52[_0xf599('0x20')];};};Realtime[_0xf599('0x3e')][_0xf599('0x4c')]=function(){var _0x3da6b2=this;return function(_0x4922be){if(_0x4922be){freeIsNotKey(_0x4922be,_0x3da6b2[_0xf599('0x21')],'id');for(var _0x124c0b=0x0,_0x1e0c60={},_0x2db95e={};_0x124c0b<_0x4922be[_0xf599('0x43')];_0x124c0b+=0x1){_0x1e0c60=_0x4922be[_0x124c0b];if(_[_0xf599('0x41')](_0x3da6b2[_0xf599('0x21')][_0x1e0c60['id']])){_0x3da6b2['freshsalesAccounts'][_0x1e0c60['id']]=new FreshsalesAccount(_0x1e0c60);}else{_0x3da6b2[_0xf599('0x3f')](_0x3da6b2[_0xf599('0x21')][_0x1e0c60['id']],_0x1e0c60);}}}return _0x3da6b2['freshsalesAccounts'];};};Realtime['prototype'][_0xf599('0x4d')]=function(){var _0x3ca25b=this;return function(_0x5d5ac7){for(var _0x1640c7=0x0;_0x1640c7<_0x5d5ac7[_0xf599('0x43')];_0x1640c7+=0x1){_[_0xf599('0x4e')](_0x3ca25b[_0xf599('0x12')][_0x5d5ac7[_0x1640c7][_0xf599('0x27')]],_0x5d5ac7[_0x1640c7]);}return _0x3ca25b[_0xf599('0x12')];};};Realtime[_0xf599('0x3e')][_0xf599('0x4f')]=function(){var _0x5d2c5b=this;return function(_0x9aad2f){clearVoiceQueues(_0x5d2c5b[_0xf599('0x12')]);if(_0x9aad2f){_0x9aad2f=_['groupBy'](_0x9aad2f,_0xf599('0x50'));for(var _0x5aaa8f in _0x9aad2f){if(_0x9aad2f[_0xf599('0x24')](_0x5aaa8f)){var _0x4fe62c={};for(var _0x1972a9=0x0;_0x1972a9<_0x9aad2f[_0x5aaa8f][_0xf599('0x43')];_0x1972a9+=0x1){var _0x417a23=_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x51')];if(_0x5d2c5b[_0xf599('0x12')][_0x417a23]){if(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x52')]){_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x53')]+=0x1;}if(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x54')]){_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x31')]+=0x1;}_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x2a')]+=moment(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x55')])[_0xf599('0x56')](moment(_0x9aad2f[_0x5aaa8f][_0x1972a9]['queuecallerjoinAt']),_0xf599('0x57'))||0x0;if(_0x1972a9===_0x9aad2f[_0x5aaa8f]['length']-0x1){_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x32')]+=moment(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x58')]||_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x59')]||_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x5a')])[_0xf599('0x56')](moment(_0x9aad2f[_0x5aaa8f][_0x1972a9]['queuecallerjoinAt']),'seconds')||0x0;_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x2f')]+=0x1;if(_0x9aad2f[_0x5aaa8f][_0x1972a9]['queuecallercomplete']){_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x30')]+=0x1;_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x2b')]+=moment(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x58')])[_0xf599('0x56')](moment(_0x9aad2f[_0x5aaa8f][_0x1972a9][_0xf599('0x55')]),_0xf599('0x57'))||0x0;}}else{_0x5d2c5b[_0xf599('0x12')][_0x417a23][_0xf599('0x32')]+=_0x5d2c5b['voiceQueues'][_0x417a23][_0xf599('0x2a')]||0x0;}}}}}}return _0x5d2c5b['voiceQueues'];};};Realtime['prototype'][_0xf599('0x5b')]=function(){var _0x1f4100=this;return function(_0x4376c5){clearVoiceCallReports(_0x1f4100['outbound']);if(_0x4376c5){for(var _0x173664=0x0;_0x173664<_0x4376c5[_0xf599('0x43')];_0x173664+=0x1){_0x1f4100[_0xf599('0x16')][_0xf599('0x2f')]+=0x1;_0x1f4100[_0xf599('0x16')][_0xf599('0x32')]+=_0x4376c5[_0x173664]['duration'];if(_0x4376c5[_0x173664][_0xf599('0x5c')]===_0xf599('0x5d')){_0x1f4100['outbound']['answered']+=0x1;_0x1f4100[_0xf599('0x16')]['sumHoldTime']+=_0x4376c5[_0x173664][_0xf599('0x5e')]-_0x4376c5[_0x173664][_0xf599('0x5f')]||0x0;_0x1f4100[_0xf599('0x16')][_0xf599('0x2b')]+=_0x4376c5[_0x173664][_0xf599('0x5f')];}}}return _0x1f4100[_0xf599('0x16')];};};Realtime[_0xf599('0x3e')][_0xf599('0x60')]=function(){var _0x1f51ee=this;return function(_0x273e1b){if(_0x273e1b){freeIsNotKey(_0x273e1b,_0x1f51ee['campaigns'],_0xf599('0x27'));for(var _0x1f56eb=0x0,_0x448e85={};_0x1f56eb<_0x273e1b[_0xf599('0x43')];_0x1f56eb+=0x1){_0x448e85=_0x273e1b[_0x1f56eb];if(_[_0xf599('0x41')](_0x1f51ee[_0xf599('0x14')][_0x448e85[_0xf599('0x27')]])){_0x1f51ee[_0xf599('0x14')][_0x448e85[_0xf599('0x27')]]=new Campaign(_0x448e85);}else{_0x1f51ee[_0xf599('0x3f')](_0x1f51ee[_0xf599('0x14')][_0x448e85['name']],_0x448e85);}}}return _0x1f51ee[_0xf599('0x14')];};};Realtime[_0xf599('0x3e')][_0xf599('0x61')]=function(){var _0x289f4e=this;return function(_0x229a89){if(_0x229a89){freeIsNotKey(_0x229a89,_0x289f4e[_0xf599('0x62')],'id');for(var _0xf65ca8=0x0,_0x5061af={};_0xf65ca8<_0x229a89[_0xf599('0x43')];_0xf65ca8+=0x1){_0x5061af=_0x229a89[_0xf65ca8];if(_[_0xf599('0x41')](_0x289f4e[_0xf599('0x62')][_0x5061af['id']])){_0x289f4e[_0xf599('0x62')][_0x5061af['id']]=new VoiceExtension(_0x5061af);}else{_0x289f4e[_0xf599('0x3f')](_0x289f4e[_0xf599('0x62')][_0x5061af['id']],_0x5061af);}}}return _0x289f4e[_0xf599('0x62')];};};Realtime[_0xf599('0x3e')][_0xf599('0x63')]=function(){var _0x1a429e=this;return function(_0x1edc59){clearCampaigns(_0x1a429e[_0xf599('0x14')]);for(var _0x44f33f=0x0;_0x44f33f<_0x1edc59['length'];_0x44f33f+=0x1){_[_0xf599('0x4e')](_0x1a429e[_0xf599('0x14')][_0x1edc59[_0x44f33f]['name']],_0x1edc59[_0x44f33f]);}return _0x1a429e[_0xf599('0x14')];};};Realtime[_0xf599('0x3e')][_0xf599('0x64')]=function(){var _0x18aa5a=this;return function(_0xdbd11d){if(_0xdbd11d){freeIsNotKey(_0xdbd11d,_0x18aa5a[_0xf599('0x22')],'id');for(var _0x4024b8=0x0,_0xa3d315={},_0x9d8bda={};_0x4024b8<_0xdbd11d['length'];_0x4024b8+=0x1){_0xa3d315=_0xdbd11d[_0x4024b8];if(_[_0xf599('0x41')](_0x18aa5a[_0xf599('0x22')][_0xa3d315['id']])){_0x18aa5a[_0xf599('0x22')][_0xa3d315['id']]=new FaxAccount(_0xa3d315);}else{_0x18aa5a[_0xf599('0x3f')](_0x18aa5a[_0xf599('0x22')][_0xa3d315['id']],_0xa3d315);}}}return _0x18aa5a[_0xf599('0x22')];};};module['exports']=Realtime; \ No newline at end of file +var _0x58cd=['../model/template','../model/campaign','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/sugarcrmAccount','../model/zohoAccount','../model/deskAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','trunks','voiceQueues','triggers','outbound','voiceExtensions','queueChannels','outboundChannels','timers','zendeskAccounts','salesforceAccounts','freshdeskAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','format','SIP/%s','name','hasOwnProperty','mapKeys','interface','total','sumDuration','sumBillable','ivrTotalCallsDays','isEmpty','answered','abandoned','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','isUndefined','initTelephones','telephones','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','initFreshdeskAccounts','initZohoAccounts','zohoAccounts','initDeskAccounts','sugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','initVoiceQueueReports','groupBy','uniqueid','queue','queuecallerexit','queuecallerabandon','sumHoldTime','diff','seconds','queuecallercomplete','queuecallercompleteAt','disposition','ANSWERED','duration','billableseconds','initCampaigns','campaigns','initFaxAccounts','bluebird','util','../model/agent','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger'];(function(_0x5eb009,_0x56d2f4){var _0x38b580=function(_0xca3fe6){while(--_0xca3fe6){_0x5eb009['push'](_0x5eb009['shift']());}};_0x38b580(++_0x56d2f4);}(_0x58cd,0x1f2));var _0xd58c=function(_0x5518b8,_0x5ca576){_0x5518b8=_0x5518b8-0x0;var _0x44014d=_0x58cd[_0x5518b8];return _0x44014d;};'use strict';var BPromise=require(_0xd58c('0x0'));var util=require(_0xd58c('0x1'));var _=require('lodash');var moment=require('moment');var Agent=require(_0xd58c('0x2'));var Telephone=require(_0xd58c('0x3'));var Trunk=require(_0xd58c('0x4'));var VoiceQueue=require(_0xd58c('0x5'));var Trigger=require(_0xd58c('0x6'));var Template=require(_0xd58c('0x7'));var Campaign=require(_0xd58c('0x8'));var VoiceExtension=require(_0xd58c('0x9'));var ZendeskAccount=require(_0xd58c('0xa'));var SalesforceAccount=require(_0xd58c('0xb'));var FreshdeskAccount=require(_0xd58c('0xc'));var SugarcrmAccount=require(_0xd58c('0xd'));var ZohoAccount=require(_0xd58c('0xe'));var DeskAccount=require(_0xd58c('0xf'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require(_0xd58c('0x10'));var FreshsalesAccount=require(_0xd58c('0x11'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xd58c('0x12')]={};this['telephones']={};this[_0xd58c('0x13')]={};this[_0xd58c('0x14')]={};this[_0xd58c('0x15')]={};this['campaigns']={};this['templates']={};this[_0xd58c('0x16')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this[_0xd58c('0x17')]={};this['channels']={};this[_0xd58c('0x18')]={};this[_0xd58c('0x19')]={};this[_0xd58c('0x1a')]={};this[_0xd58c('0x1b')]={};this[_0xd58c('0x1c')]={};this['sugarcrmAccounts']={};this[_0xd58c('0x1d')]={};this['zohoAccounts']={};this[_0xd58c('0x1e')]={};this[_0xd58c('0x1f')]={};this[_0xd58c('0x20')]={};this[_0xd58c('0x21')]={};this[_0xd58c('0x22')]={};this[_0xd58c('0x23')]={};};function freeIsNotKey(_0x37ceca,_0x3d0c3a,_0x23840c){var _0x58d36f=_['mapKeys'](_0x37ceca,function(_0x1c17e8,_0x2ea243){return _0x1c17e8[_0x23840c];});for(var _0x477587 in _0x3d0c3a){if(_0x3d0c3a['hasOwnProperty'](_0x477587)){if(!_0x58d36f[_0x477587]){delete _0x3d0c3a[_0x477587];}}}}function freeIsNotKeySip(_0x2da92c,_0xf26be){var _0x1ed63b=_['mapKeys'](_0x2da92c,function(_0x3555e6,_0x266ea0){return util[_0xd58c('0x24')](_0xd58c('0x25'),_0x3555e6[_0xd58c('0x26')]);});for(var _0x105b5e in _0xf26be){if(_0xf26be[_0xd58c('0x27')](_0x105b5e)){if(!_0x1ed63b[_0x105b5e]){delete _0xf26be[_0x105b5e];}}}}function freeIsNotKeyAgent(_0x21128f,_0x30a5d2){var _0x5e7076=_[_0xd58c('0x28')](_0x21128f,function(_0x16f939,_0x15840c){var _0x4c76b6=_['isNil'](_0x16f939[_0xd58c('0x29')])?util[_0xd58c('0x24')](_0xd58c('0x25'),_0x16f939[_0xd58c('0x26')]):_0x16f939['interface'];return _0x4c76b6;});for(var _0x30e60c in _0x30a5d2){if(_0x30a5d2[_0xd58c('0x27')](_0x30e60c)){if(!_0x5e7076[_0x30e60c]){delete _0x30a5d2[_0x30e60c];}}}}function clearVoiceCallReports(_0x1cb18d){_0x1cb18d[_0xd58c('0x2a')]=0x0;_0x1cb18d['answered']=0x0;_0x1cb18d['sumHoldTime']=0x0;_0x1cb18d[_0xd58c('0x2b')]=0x0;_0x1cb18d[_0xd58c('0x2c')]=0x0;}function clearCampaigns(_0x27b5be){if(!_['isEmpty'](_0x27b5be)){for(var _0x4c49a3 in _0x27b5be){if(_0x27b5be[_0xd58c('0x27')](_0x4c49a3)){_0x27b5be[_0x4c49a3][_0xd58c('0x2d')]=0x0;_0x27b5be[_0x4c49a3]['ivrAnswerCallsDay']=0x0;}}}}function clearVoiceQueues(_0x1be672){if(!_[_0xd58c('0x2e')](_0x1be672)){for(var _0x1d0068 in _0x1be672){if(_0x1be672[_0xd58c('0x27')](_0x1d0068)){_0x1be672[_0x1d0068][_0xd58c('0x2a')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x2f')]=0x0;_0x1be672[_0x1d0068]['unmanaged']=0x0;_0x1be672[_0x1d0068][_0xd58c('0x30')]=0x0;_0x1be672[_0x1d0068]['sumHoldTime']=0x0;_0x1be672[_0x1d0068][_0xd58c('0x2b')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x2c')]=0x0;_0x1be672[_0x1d0068]['outboundAnswerAgiCallsDay']=0x0;_0x1be672[_0x1d0068]['outboundNoAnswerCallsDay']=0x0;_0x1be672[_0x1d0068][_0xd58c('0x31')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x32')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x33')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x34')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x35')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x36')]=0x0;_0x1be672[_0x1d0068]['outboundBlacklistCallsDay']=0x0;_0x1be672[_0x1d0068][_0xd58c('0x37')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x38')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x39')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x3a')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x3b')]=0x0;_0x1be672[_0x1d0068][_0xd58c('0x3c')]=!![];}}}}Realtime[_0xd58c('0x3d')][_0xd58c('0x3e')]=function(_0x50de74,_0x39c689){for(var _0x26581c in _0x39c689){if(_0x50de74['hasOwnProperty'](_0x26581c)){_0x50de74[_0x26581c]=_0x39c689[_0x26581c];}}};Realtime[_0xd58c('0x3d')][_0xd58c('0x3f')]=function(){var _0x16605b=this;return function(_0x3c298c){if(_0x3c298c){freeIsNotKeyAgent(_0x3c298c,_0x16605b[_0xd58c('0x12')]);for(var _0x628dc5=0x0,_0x2587d2={},_0x48e861={};_0x628dc5<_0x3c298c[_0xd58c('0x40')];_0x628dc5+=0x1){_0x2587d2=_0x3c298c[_0x628dc5];var _0xae8d31=_['isNil'](_0x2587d2[_0xd58c('0x29')])?util[_0xd58c('0x24')](_0xd58c('0x25'),_0x2587d2[_0xd58c('0x26')]):_0x2587d2[_0xd58c('0x29')];if(_[_0xd58c('0x41')](_0x16605b[_0xd58c('0x12')][_0xae8d31])){_0x16605b[_0xd58c('0x12')][_0xae8d31]=new Agent(_0x2587d2);}else{_0x16605b[_0xd58c('0x3e')](_0x16605b[_0xd58c('0x12')][_0xae8d31],_0x2587d2);}}}return _0x16605b[_0xd58c('0x12')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x42')]=function(){var _0x55b525=this;return function(_0x34b620){if(_0x34b620){freeIsNotKeySip(_0x34b620,_0x55b525[_0xd58c('0x43')]);for(var _0x4bc687=0x0,_0x27dcb8={},_0x11c1a2={};_0x4bc687<_0x34b620[_0xd58c('0x40')];_0x4bc687+=0x1){_0x27dcb8=_0x34b620[_0x4bc687];if(_[_0xd58c('0x41')](_0x55b525[_0xd58c('0x43')][util[_0xd58c('0x24')](_0xd58c('0x25'),_0x27dcb8[_0xd58c('0x26')])])){_0x55b525['telephones'][util[_0xd58c('0x24')](_0xd58c('0x25'),_0x27dcb8[_0xd58c('0x26')])]=new Telephone(_0x27dcb8);}else{_0x55b525[_0xd58c('0x3e')](_0x55b525['telephones'][util[_0xd58c('0x24')](_0xd58c('0x25'),_0x27dcb8[_0xd58c('0x26')])],_0x27dcb8);}}}return _0x55b525[_0xd58c('0x43')];};};Realtime[_0xd58c('0x3d')]['initTrunks']=function(){var _0x38cb13=this;return function(_0x3c061f){if(_0x3c061f){freeIsNotKeySip(_0x3c061f,_0x38cb13[_0xd58c('0x13')]);for(var _0x3d807f=0x0,_0x3e522b={},_0x414114={};_0x3d807f<_0x3c061f[_0xd58c('0x40')];_0x3d807f+=0x1){_0x3e522b=_0x3c061f[_0x3d807f];if(_['isUndefined'](_0x38cb13[_0xd58c('0x13')][util[_0xd58c('0x24')](_0xd58c('0x25'),_0x3e522b['name'])])){_0x38cb13['trunks'][util[_0xd58c('0x24')]('SIP/%s',_0x3e522b['name'])]=new Trunk(_0x3e522b);}else{_0x38cb13['mergeFromDatabase'](_0x38cb13[_0xd58c('0x13')][util['format'](_0xd58c('0x25'),_0x3e522b['name'])],_0x3e522b);}}}return _0x38cb13[_0xd58c('0x13')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x44')]=function(){var _0x33e103=this;return function(_0x2015c0){if(_0x2015c0){freeIsNotKey(_0x2015c0,_0x33e103[_0xd58c('0x14')],_0xd58c('0x26'));for(var _0x5db1f0=0x0,_0x2b6037={},_0x42e25e={};_0x5db1f0<_0x2015c0[_0xd58c('0x40')];_0x5db1f0+=0x1){_0x2b6037=_0x2015c0[_0x5db1f0];if(_[_0xd58c('0x41')](_0x33e103['voiceQueues'][_0x2b6037[_0xd58c('0x26')]])){_0x33e103[_0xd58c('0x14')][_0x2b6037[_0xd58c('0x26')]]=new VoiceQueue(_0x2b6037);}else{_0x33e103[_0xd58c('0x3e')](_0x33e103[_0xd58c('0x14')][_0x2b6037[_0xd58c('0x26')]],_0x2b6037);}}}return _0x33e103['voiceQueues'];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x45')]=function(){var _0x1a563f=this;return function(_0x1e1266){if(_0x1e1266){freeIsNotKey(_0x1e1266,_0x1a563f[_0xd58c('0x15')],'id');for(var _0x593d1e=0x0,_0x1a0332={},_0x362a4a={};_0x593d1e<_0x1e1266[_0xd58c('0x40')];_0x593d1e+=0x1){_0x1a0332=_0x1e1266[_0x593d1e];if(_[_0xd58c('0x41')](_0x1a563f['triggers'][_0x1a0332['id']])){_0x1a563f[_0xd58c('0x15')][_0x1a0332['id']]=new Trigger(_0x1a0332);}else{_0x1a563f[_0xd58c('0x3e')](_0x1a563f['triggers'][_0x1a0332['id']],_0x1a0332);}}}return _0x1a563f[_0xd58c('0x15')];};};Realtime['prototype'][_0xd58c('0x46')]=function(){var _0x9ff086=this;return function(_0x14a15e){if(_0x14a15e){freeIsNotKey(_0x14a15e,_0x9ff086[_0xd58c('0x47')],'id');for(var _0x3395d2=0x0,_0x44811f={},_0x3381b1={};_0x3395d2<_0x14a15e[_0xd58c('0x40')];_0x3395d2+=0x1){_0x44811f=_0x14a15e[_0x3395d2];if(_[_0xd58c('0x41')](_0x9ff086[_0xd58c('0x47')][_0x44811f['id']])){_0x9ff086[_0xd58c('0x47')][_0x44811f['id']]=new Template(_0x44811f);}else{_0x9ff086[_0xd58c('0x3e')](_0x9ff086['templates'][_0x44811f['id']],_0x44811f);}}}return _0x9ff086[_0xd58c('0x47')];};};Realtime['prototype'][_0xd58c('0x48')]=function(){var _0x2319e3=this;return function(_0x450ddc){if(_0x450ddc){freeIsNotKey(_0x450ddc,_0x2319e3[_0xd58c('0x1b')],'id');for(var _0x1f5dc1=0x0,_0x466173={},_0x5d6f43={};_0x1f5dc1<_0x450ddc[_0xd58c('0x40')];_0x1f5dc1+=0x1){_0x466173=_0x450ddc[_0x1f5dc1];if(_[_0xd58c('0x41')](_0x2319e3['zendeskAccounts'][_0x466173['id']])){_0x2319e3[_0xd58c('0x1b')][_0x466173['id']]=new ZendeskAccount(_0x466173);}else{_0x2319e3[_0xd58c('0x3e')](_0x2319e3[_0xd58c('0x1b')][_0x466173['id']],_0x466173);}}}return _0x2319e3[_0xd58c('0x1b')];};};Realtime[_0xd58c('0x3d')]['initSalesforceAccounts']=function(){var _0x4553ca=this;return function(_0xfc3d5f){if(_0xfc3d5f){freeIsNotKey(_0xfc3d5f,_0x4553ca[_0xd58c('0x1c')],'id');for(var _0x316463=0x0,_0x4c7d54={},_0x28f1b4={};_0x316463<_0xfc3d5f[_0xd58c('0x40')];_0x316463+=0x1){_0x4c7d54=_0xfc3d5f[_0x316463];if(_[_0xd58c('0x41')](_0x4553ca[_0xd58c('0x1c')][_0x4c7d54['id']])){_0x4553ca[_0xd58c('0x1c')][_0x4c7d54['id']]=new SalesforceAccount(_0x4c7d54);}else{_0x4553ca[_0xd58c('0x3e')](_0x4553ca[_0xd58c('0x1c')][_0x4c7d54['id']],_0x4c7d54);}}}return _0x4553ca[_0xd58c('0x1c')];};};Realtime['prototype'][_0xd58c('0x49')]=function(){var _0x11982b=this;return function(_0x25f92a){if(_0x25f92a){freeIsNotKey(_0x25f92a,_0x11982b[_0xd58c('0x1d')],'id');for(var _0x2de507=0x0,_0x1bd791={},_0x47e972={};_0x2de507<_0x25f92a[_0xd58c('0x40')];_0x2de507+=0x1){_0x1bd791=_0x25f92a[_0x2de507];if(_['isUndefined'](_0x11982b[_0xd58c('0x1d')][_0x1bd791['id']])){_0x11982b[_0xd58c('0x1d')][_0x1bd791['id']]=new FreshdeskAccount(_0x1bd791);}else{_0x11982b['mergeFromDatabase'](_0x11982b[_0xd58c('0x1d')][_0x1bd791['id']],_0x1bd791);}}}return _0x11982b[_0xd58c('0x1d')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x4a')]=function(){var _0x5e9727=this;return function(_0xff3461){if(_0xff3461){freeIsNotKey(_0xff3461,_0x5e9727[_0xd58c('0x4b')],'id');for(var _0x38f710=0x0,_0x471994={},_0x398c3c={};_0x38f710<_0xff3461[_0xd58c('0x40')];_0x38f710+=0x1){_0x471994=_0xff3461[_0x38f710];if(_[_0xd58c('0x41')](_0x5e9727[_0xd58c('0x4b')][_0x471994['id']])){_0x5e9727['zohoAccounts'][_0x471994['id']]=new ZohoAccount(_0x471994);}else{_0x5e9727[_0xd58c('0x3e')](_0x5e9727[_0xd58c('0x4b')][_0x471994['id']],_0x471994);}}}return _0x5e9727[_0xd58c('0x4b')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x4c')]=function(){var _0x9ba0c7=this;return function(_0x58e184){if(_0x58e184){freeIsNotKey(_0x58e184,_0x9ba0c7[_0xd58c('0x1e')],'id');for(var _0x5487d7=0x0,_0x282d11={},_0x26d460={};_0x5487d7<_0x58e184['length'];_0x5487d7+=0x1){_0x282d11=_0x58e184[_0x5487d7];if(_[_0xd58c('0x41')](_0x9ba0c7['deskAccounts'][_0x282d11['id']])){_0x9ba0c7[_0xd58c('0x1e')][_0x282d11['id']]=new DeskAccount(_0x282d11);}else{_0x9ba0c7[_0xd58c('0x3e')](_0x9ba0c7['deskAccounts'][_0x282d11['id']],_0x282d11);}}}return _0x9ba0c7[_0xd58c('0x1e')];};};Realtime[_0xd58c('0x3d')]['initSugarcrmAccounts']=function(){var _0x33e517=this;return function(_0x3c233f){if(_0x3c233f){freeIsNotKey(_0x3c233f,_0x33e517[_0xd58c('0x4d')],'id');for(var _0x2fa683=0x0,_0x8aff7b={},_0x4049e5={};_0x2fa683<_0x3c233f['length'];_0x2fa683+=0x1){_0x8aff7b=_0x3c233f[_0x2fa683];if(_[_0xd58c('0x41')](_0x33e517[_0xd58c('0x4d')][_0x8aff7b['id']])){_0x33e517[_0xd58c('0x4d')][_0x8aff7b['id']]=new SugarcrmAccount(_0x8aff7b);}else{_0x33e517[_0xd58c('0x3e')](_0x33e517['sugarcrmAccounts'][_0x8aff7b['id']],_0x8aff7b);}}}return _0x33e517[_0xd58c('0x4d')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x4e')]=function(){var _0x29ee91=this;return function(_0x48f300){if(_0x48f300){freeIsNotKey(_0x48f300,_0x29ee91[_0xd58c('0x1f')],'id');for(var _0x51be83=0x0,_0x4a4151={},_0xa9bfc3={};_0x51be83<_0x48f300[_0xd58c('0x40')];_0x51be83+=0x1){_0x4a4151=_0x48f300[_0x51be83];if(_[_0xd58c('0x41')](_0x29ee91['vtigerAccounts'][_0x4a4151['id']])){_0x29ee91[_0xd58c('0x1f')][_0x4a4151['id']]=new VtigerAccount(_0x4a4151);}else{_0x29ee91[_0xd58c('0x3e')](_0x29ee91[_0xd58c('0x1f')][_0x4a4151['id']],_0x4a4151);}}}return _0x29ee91[_0xd58c('0x1f')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x4f')]=function(){var _0x40564b=this;return function(_0x13d10b){if(_0x13d10b){freeIsNotKey(_0x13d10b,_0x40564b[_0xd58c('0x20')],'id');for(var _0x1dcd51=0x0,_0xbcaa73={},_0x92b0d9={};_0x1dcd51<_0x13d10b[_0xd58c('0x40')];_0x1dcd51+=0x1){_0xbcaa73=_0x13d10b[_0x1dcd51];if(_[_0xd58c('0x41')](_0x40564b[_0xd58c('0x20')][_0xbcaa73['id']])){_0x40564b[_0xd58c('0x20')][_0xbcaa73['id']]=new ServicenowAccount(_0xbcaa73);}else{_0x40564b['mergeFromDatabase'](_0x40564b[_0xd58c('0x20')][_0xbcaa73['id']],_0xbcaa73);}}}return _0x40564b[_0xd58c('0x20')];};};Realtime[_0xd58c('0x3d')]['initDynamics365Accounts']=function(){var _0x51f3bb=this;return function(_0x1a546b){if(_0x1a546b){freeIsNotKey(_0x1a546b,_0x51f3bb[_0xd58c('0x21')],'id');for(var _0x58b3a7=0x0,_0x42328a={},_0x3c785d={};_0x58b3a7<_0x1a546b[_0xd58c('0x40')];_0x58b3a7+=0x1){_0x42328a=_0x1a546b[_0x58b3a7];if(_['isUndefined'](_0x51f3bb[_0xd58c('0x21')][_0x42328a['id']])){_0x51f3bb[_0xd58c('0x21')][_0x42328a['id']]=new Dynamics365Account(_0x42328a);}else{_0x51f3bb[_0xd58c('0x3e')](_0x51f3bb['dynamics365Accounts'][_0x42328a['id']],_0x42328a);}}}return _0x51f3bb['dynamics365Accounts'];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x50')]=function(){var _0x161c30=this;return function(_0xea39e5){if(_0xea39e5){freeIsNotKey(_0xea39e5,_0x161c30[_0xd58c('0x22')],'id');for(var _0x596582=0x0,_0x3bb038={},_0x12b002={};_0x596582<_0xea39e5[_0xd58c('0x40')];_0x596582+=0x1){_0x3bb038=_0xea39e5[_0x596582];if(_[_0xd58c('0x41')](_0x161c30[_0xd58c('0x22')][_0x3bb038['id']])){_0x161c30[_0xd58c('0x22')][_0x3bb038['id']]=new FreshsalesAccount(_0x3bb038);}else{_0x161c30[_0xd58c('0x3e')](_0x161c30[_0xd58c('0x22')][_0x3bb038['id']],_0x3bb038);}}}return _0x161c30[_0xd58c('0x22')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x51')]=function(){var _0x1b1efa=this;return function(_0x1a106e){for(var _0x2f6535=0x0;_0x2f6535<_0x1a106e['length'];_0x2f6535+=0x1){_[_0xd58c('0x52')](_0x1b1efa[_0xd58c('0x14')][_0x1a106e[_0x2f6535][_0xd58c('0x26')]],_0x1a106e[_0x2f6535]);}return _0x1b1efa['voiceQueues'];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x53')]=function(){var _0x1ae5af=this;return function(_0x424d40){clearVoiceQueues(_0x1ae5af[_0xd58c('0x14')]);if(_0x424d40){_0x424d40=_[_0xd58c('0x54')](_0x424d40,_0xd58c('0x55'));for(var _0x76378e in _0x424d40){if(_0x424d40[_0xd58c('0x27')](_0x76378e)){var _0x2d0b48={};for(var _0x2c2517=0x0;_0x2c2517<_0x424d40[_0x76378e][_0xd58c('0x40')];_0x2c2517+=0x1){var _0x25ad94=_0x424d40[_0x76378e][_0x2c2517][_0xd58c('0x56')];if(_0x1ae5af[_0xd58c('0x14')][_0x25ad94]){if(_0x424d40[_0x76378e][_0x2c2517][_0xd58c('0x57')]){_0x1ae5af[_0xd58c('0x14')][_0x25ad94]['unmanaged']+=0x1;}if(_0x424d40[_0x76378e][_0x2c2517][_0xd58c('0x58')]){_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x30')]+=0x1;}_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x59')]+=moment(_0x424d40[_0x76378e][_0x2c2517]['queuecallerleaveAt'])[_0xd58c('0x5a')](moment(_0x424d40[_0x76378e][_0x2c2517]['queuecallerjoinAt']),_0xd58c('0x5b'))||0x0;if(_0x2c2517===_0x424d40[_0x76378e][_0xd58c('0x40')]-0x1){_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x2b')]+=moment(_0x424d40[_0x76378e][_0x2c2517]['queuecallercompleteAt']||_0x424d40[_0x76378e][_0x2c2517]['queuecallerabandonAt']||_0x424d40[_0x76378e][_0x2c2517]['queuecallerexitAt'])[_0xd58c('0x5a')](moment(_0x424d40[_0x76378e][_0x2c2517]['queuecallerjoinAt']),'seconds')||0x0;_0x1ae5af['voiceQueues'][_0x25ad94][_0xd58c('0x2a')]+=0x1;if(_0x424d40[_0x76378e][_0x2c2517][_0xd58c('0x5c')]){_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x2f')]+=0x1;_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x2c')]+=moment(_0x424d40[_0x76378e][_0x2c2517][_0xd58c('0x5d')])[_0xd58c('0x5a')](moment(_0x424d40[_0x76378e][_0x2c2517]['queuecallerleaveAt']),'seconds')||0x0;}}else{_0x1ae5af[_0xd58c('0x14')][_0x25ad94][_0xd58c('0x2b')]+=_0x1ae5af['voiceQueues'][_0x25ad94]['sumHoldTime']||0x0;}}}}}}return _0x1ae5af[_0xd58c('0x14')];};};Realtime['prototype']['initVoiceCallReports']=function(){var _0x288c33=this;return function(_0x20c7f7){clearVoiceCallReports(_0x288c33[_0xd58c('0x16')]);if(_0x20c7f7){for(var _0x39ede3=0x0;_0x39ede3<_0x20c7f7[_0xd58c('0x40')];_0x39ede3+=0x1){_0x288c33['outbound']['total']+=0x1;_0x288c33[_0xd58c('0x16')][_0xd58c('0x2b')]+=_0x20c7f7[_0x39ede3]['duration'];if(_0x20c7f7[_0x39ede3][_0xd58c('0x5e')]===_0xd58c('0x5f')){_0x288c33[_0xd58c('0x16')][_0xd58c('0x2f')]+=0x1;_0x288c33[_0xd58c('0x16')][_0xd58c('0x59')]+=_0x20c7f7[_0x39ede3][_0xd58c('0x60')]-_0x20c7f7[_0x39ede3][_0xd58c('0x61')]||0x0;_0x288c33[_0xd58c('0x16')][_0xd58c('0x2c')]+=_0x20c7f7[_0x39ede3][_0xd58c('0x61')];}}}return _0x288c33[_0xd58c('0x16')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x62')]=function(){var _0x5126b0=this;return function(_0x3165ea){if(_0x3165ea){freeIsNotKey(_0x3165ea,_0x5126b0[_0xd58c('0x63')],_0xd58c('0x26'));for(var _0x403a7d=0x0,_0x36020f={};_0x403a7d<_0x3165ea['length'];_0x403a7d+=0x1){_0x36020f=_0x3165ea[_0x403a7d];if(_[_0xd58c('0x41')](_0x5126b0[_0xd58c('0x63')][_0x36020f[_0xd58c('0x26')]])){_0x5126b0[_0xd58c('0x63')][_0x36020f['name']]=new Campaign(_0x36020f);}else{_0x5126b0['mergeFromDatabase'](_0x5126b0[_0xd58c('0x63')][_0x36020f[_0xd58c('0x26')]],_0x36020f);}}}return _0x5126b0[_0xd58c('0x63')];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x2f8112=this;return function(_0x5e37cf){if(_0x5e37cf){freeIsNotKey(_0x5e37cf,_0x2f8112[_0xd58c('0x17')],'id');for(var _0x1b720a=0x0,_0x5035e7={};_0x1b720a<_0x5e37cf[_0xd58c('0x40')];_0x1b720a+=0x1){_0x5035e7=_0x5e37cf[_0x1b720a];if(_[_0xd58c('0x41')](_0x2f8112[_0xd58c('0x17')][_0x5035e7['id']])){_0x2f8112[_0xd58c('0x17')][_0x5035e7['id']]=new VoiceExtension(_0x5035e7);}else{_0x2f8112[_0xd58c('0x3e')](_0x2f8112['voiceExtensions'][_0x5035e7['id']],_0x5035e7);}}}return _0x2f8112[_0xd58c('0x17')];};};Realtime[_0xd58c('0x3d')]['initCampaignHopperHistory']=function(){var _0x1bca12=this;return function(_0xc1cd0){clearCampaigns(_0x1bca12['campaigns']);for(var _0xca59b5=0x0;_0xca59b5<_0xc1cd0[_0xd58c('0x40')];_0xca59b5+=0x1){_[_0xd58c('0x52')](_0x1bca12[_0xd58c('0x63')][_0xc1cd0[_0xca59b5]['name']],_0xc1cd0[_0xca59b5]);}return _0x1bca12[_0xd58c('0x63')];};};Realtime[_0xd58c('0x3d')][_0xd58c('0x64')]=function(){var _0x574df8=this;return function(_0x19c621){if(_0x19c621){freeIsNotKey(_0x19c621,_0x574df8[_0xd58c('0x23')],'id');for(var _0x1fd456=0x0,_0x43ab39={},_0x1c35b9={};_0x1fd456<_0x19c621['length'];_0x1fd456+=0x1){_0x43ab39=_0x19c621[_0x1fd456];if(_[_0xd58c('0x41')](_0x574df8[_0xd58c('0x23')][_0x43ab39['id']])){_0x574df8[_0xd58c('0x23')][_0x43ab39['id']]=new FaxAccount(_0x43ab39);}else{_0x574df8['mergeFromDatabase'](_0x574df8['faxAccounts'][_0x43ab39['id']],_0x43ab39);}}}return _0x574df8[_0xd58c('0x23')];};};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 6180393..60e585f 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 _0xa945=['../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','xdr','voiceQueueReport','custom:voiceCallReport','bind','custom:voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','attendedTransfer','find','accountcode','isNil','name','interface','format','SIP/%s','length','connectedlinenum','assigned','lastAssignedTo','YYYY-MM-DD\x20HH:mm:ss','queuecallerexitAt','create','voiceCallReport','destination','exten','type','dialer','lastapplication','queue','lastdata','context','callerid','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','monitor','monitors','monitorFilename','filename','createdAt','connectedlinename','membername','xcally-motion-dialer','voiceAgentReport','isArray','channel','startsWith','Local','substring','indexOf','mobile','phone','lastIndexOf','findAgent','exports','bluebird','moment','../../../config/environment','ami'];(function(_0x8c43c1,_0x5c1358){var _0x2a3e16=function(_0x5cecea){while(--_0x5cecea){_0x8c43c1['push'](_0x8c43c1['shift']());}};_0x2a3e16(++_0x5c1358);}(_0xa945,0x1dc));var _0x5a94=function(_0x3a0b0b,_0x4d0848){_0x3a0b0b=_0x3a0b0b-0x0;var _0x2fb59e=_0xa945[_0x3a0b0b];return _0x2fb59e;};'use strict';var BPromise=require(_0x5a94('0x0'));var _=require('lodash');var moment=require(_0x5a94('0x1'));var util=require('util');var config=require(_0x5a94('0x2'));var logger=require('../../../config/logger')(_0x5a94('0x3'));var ami=require(_0x5a94('0x4'));var RpcVoiceAgentReport=require(_0x5a94('0x5'));var RpcVoiceCallReport=require(_0x5a94('0x6'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0x5a94('0x7'));var RpcVoiceQueueReport=require('../rpc/voiceQueueReport');var RpcVoiceRecording=require('../rpc/voiceRecording');var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x5a94('0x8'));var VoiceCallReport=require(_0x5a94('0x9'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x5a94('0xa'));var UserReport=require(_0x5a94('0xb'));function Report(_0x583acf){this[_0x5a94('0xc')]=_0x583acf;this['agents']=_0x583acf[_0x5a94('0xd')];this[_0x5a94('0xe')]=_0x583acf[_0x5a94('0xe')];}Report[_0x5a94('0xf')]['sync']=function(_0x2602b0){var _0x47a050=new VoiceQueueReport(this[_0x5a94('0xc')]);var _0xcf0be5=new VoiceAgentReport(this[_0x5a94('0xc')]);var _0x164a69=new VoiceDialReport(this[_0x5a94('0xc')]);var _0x474430=new VoiceCallReport(this[_0x5a94('0xc')]);var _0x2a882e=new UserReport(this[_0x5a94('0xc')]);if(config[_0x5a94('0x10')]&&config[_0x5a94('0x10')]['disabled']){ami['on']('custom:voiceQueueReport',this[_0x5a94('0x11')]['bind'](this));ami['on'](_0x5a94('0x12'),this['voiceCallReport'][_0x5a94('0x13')](this));ami['on'](_0x5a94('0x14'),this['voiceAgentReport']['bind'](this));ami['on'](_0x5a94('0x15'),this[_0x5a94('0x16')][_0x5a94('0x13')](this));ami['on'](_0x5a94('0x17'),this[_0x5a94('0x18')][_0x5a94('0x13')](this));ami['on'](_0x5a94('0x19'),this[_0x5a94('0x1a')][_0x5a94('0x13')](this));}};Report[_0x5a94('0xf')]['findAgent']=function(_0x581612){var _0x10407a=undefined;_0x10407a=_[_0x5a94('0x1b')](this[_0x5a94('0xd')],function(_0x1b7def){return _0x1b7def[_0x5a94('0x1c')]==_0x581612||_0x1b7def['name']==_0x581612;});if(_[_0x5a94('0x1d')](_0x10407a)){var _0xae680=_['find'](this[_0x5a94('0xe')],function(_0x41dfae){return _0x41dfae['accountcode']==_0x581612||_0x41dfae[_0x5a94('0x1e')]==_0x581612;});if(_0xae680){_0x10407a=_[_0x5a94('0x1b')](this[_0x5a94('0xd')],function(_0x404260){return _0x404260[_0x5a94('0x1f')]==util[_0x5a94('0x20')](_0x5a94('0x21'),_0xae680[_0x5a94('0x1e')]);});}}return _0x10407a;};Report[_0x5a94('0xf')][_0x5a94('0x11')]=function(_0x2d3fba){for(var _0x153ab4=0x0;_0x153ab4<_0x2d3fba[_0x5a94('0x22')];_0x153ab4+=0x1){var _0x576ad6=this['findAgent'](_0x2d3fba[_0x153ab4][_0x5a94('0x23')]);if(_0x576ad6){_0x2d3fba[_0x153ab4][_0x5a94('0x1c')]=_0x576ad6['accountcode'];_0x2d3fba[_0x153ab4][_0x5a94('0x24')]=!![];_0x2d3fba[_0x153ab4][_0x5a94('0x25')]=_0x576ad6['name'];_0x2d3fba[_0x153ab4]['interface']=_['isNil'](_0x576ad6[_0x5a94('0x1f')])?util[_0x5a94('0x20')](_0x5a94('0x21'),_0x576ad6['name']):_0x576ad6[_0x5a94('0x1f')];if(_0x2d3fba[_0x153ab4]['queuecallercomplete']){_0x2d3fba[_0x153ab4]['queuecallercompleteAt']=moment()[_0x5a94('0x20')](_0x5a94('0x26'));}if(_0x2d3fba[_0x153ab4]['queuecallerexit']){_0x2d3fba[_0x153ab4][_0x5a94('0x27')]=moment()[_0x5a94('0x20')](_0x5a94('0x26'));}RpcMemberReport[_0x5a94('0x11')](_0x2d3fba[_0x153ab4]);}RpcVoiceQueueReport[_0x5a94('0x28')](_0x2d3fba[_0x153ab4]);}};function extractCalleridNumber(_0x54ff1d){var _0x56d59d=_0x54ff1d['match'](/<(.*?)>/);return _0x56d59d?_0x56d59d[0x1]:_0x54ff1d;}Report[_0x5a94('0xf')][_0x5a94('0x29')]=function(_0x3c11a4){_0x3c11a4[_0x5a94('0x2a')]=_0x3c11a4[_0x5a94('0x2a')]||_0x3c11a4[_0x5a94('0x2b')];if(_0x3c11a4[_0x5a94('0x2c')]==_0x5a94('0x2d')){_0x3c11a4[_0x5a94('0x2e')]=_0x5a94('0x2f');_0x3c11a4[_0x5a94('0x30')]=_0x3c11a4[_0x5a94('0x2f')];if(_0x3c11a4[_0x5a94('0x31')]=='from-voip-provider'){_0x3c11a4[_0x5a94('0x1c')]='';_0x3c11a4[_0x5a94('0x2a')]=extractCalleridNumber(_0x3c11a4[_0x5a94('0x32')]);}else if(_0x3c11a4[_0x5a94('0x31')]==_0x5a94('0x33')){if(_0x3c11a4[_0x5a94('0x2a')]==_0x5a94('0x34')){_0x3c11a4[_0x5a94('0x2a')]=extractCalleridNumber(_0x3c11a4[_0x5a94('0x35')]);_0x3c11a4[_0x5a94('0x36')]=_0x3c11a4[_0x5a94('0x37')];_0x3c11a4['destinationchannel']=[_0x3c11a4['channel'],_0x3c11a4['channel']=_0x3c11a4['destinationchannel']][0x0];_0x3c11a4[_0x5a94('0x32')]=_0x3c11a4[_0x5a94('0x35')];}else{_0x3c11a4[_0x5a94('0x2a')]=_0x3c11a4[_0x5a94('0x36')];_0x3c11a4['calleridnum']=_0x3c11a4['originatecalleridnum'];if(_0x3c11a4[_0x5a94('0x38')]==_0x5a94('0x39')){_0x3c11a4[_0x5a94('0x1c')]=_0x3c11a4[_0x5a94('0x23')];}else{_0x3c11a4['accountcode']='';}}}}else{_0x3c11a4[_0x5a94('0x32')]=util[_0x5a94('0x20')](_0x5a94('0x3a'),_0x3c11a4[_0x5a94('0x3b')],_0x3c11a4['calleridnum']);}RpcVoiceCallReport[_0x5a94('0x28')](_0x3c11a4);if(_0x3c11a4[_0x5a94('0x3c')]){for(var _0x405120=0x0;_0x405120<_0x3c11a4[_0x5a94('0x3d')][_0x5a94('0x22')];_0x405120+=0x1){_0x3c11a4[_0x5a94('0x3e')]=_0x3c11a4['monitors'][_0x405120][_0x5a94('0x3f')];_0x3c11a4[_0x5a94('0x40')]=_0x3c11a4[_0x5a94('0x3d')][_0x405120][_0x5a94('0x40')];if(_0x3c11a4['exten']==_0x5a94('0x34')){_0x3c11a4[_0x5a94('0x36')]=_0x3c11a4[_0x5a94('0x23')];_0x3c11a4[_0x5a94('0x3b')]=_0x3c11a4[_0x5a94('0x41')];_0x3c11a4['connectedlinenum']=_0x3c11a4[_0x5a94('0x1c')];_0x3c11a4[_0x5a94('0x41')]=_0x3c11a4[_0x5a94('0x42')];_0x3c11a4['exten']=_0x3c11a4['originatecalleridnum'];}else if(_0x3c11a4['exten']==_0x5a94('0x43')){_0x3c11a4['calleridnum']=_0x3c11a4[_0x5a94('0x2a')];_0x3c11a4['exten']=_0x3c11a4[_0x5a94('0x37')];}RpcVoiceRecording['create'](_0x3c11a4);}}};Report['prototype'][_0x5a94('0x44')]=function(_0x2aa87f){if(_[_0x5a94('0x45')](_0x2aa87f)){_0x2aa87f['forEach'](function(_0x5354cc){RpcVoiceAgentReport[_0x5a94('0x28')](_0x5354cc);});}else{RpcVoiceAgentReport[_0x5a94('0x28')](_0x2aa87f);}};Report['prototype']['voiceDialReport']=function(_0x14ddfe){RpcVoiceDialReport[_0x5a94('0x28')](_0x14ddfe);var _0x52aee2=undefined;var _0x228696=_0x14ddfe[_0x5a94('0x46')];if(_[_0x5a94('0x47')](_0x228696,_0x5a94('0x48'))){var _0x375dcb=_0x228696[_0x5a94('0x49')](_0x228696[_0x5a94('0x4a')]('/')+0x1,_0x228696[_0x5a94('0x4a')]('@'));_0x52aee2=_[_0x5a94('0x1b')](this[_0x5a94('0xd')],function(_0x42f4ae){return _0x42f4ae[_0x5a94('0x4b')]==_0x375dcb||_0x42f4ae[_0x5a94('0x4c')]==_0x375dcb||_0x42f4ae[_0x5a94('0x1c')]==_0x375dcb;});}else{var _0x375dcb=_0x228696[_0x5a94('0x49')](_0x228696['indexOf']('/')+0x1,_0x228696[_0x5a94('0x4d')]('-'));_0x52aee2=this[_0x5a94('0x4e')](_0x375dcb);}if(_0x52aee2){_0x14ddfe[_0x5a94('0x1f')]=_[_0x5a94('0x1d')](_0x52aee2[_0x5a94('0x1f')])?util[_0x5a94('0x20')](_0x5a94('0x21'),_0x52aee2[_0x5a94('0x1e')]):_0x52aee2[_0x5a94('0x1f')];_0x14ddfe[_0x5a94('0x42')]=_0x52aee2[_0x5a94('0x1e')];_0x14ddfe['accountcode']=_0x52aee2[_0x5a94('0x1c')];RpcMemberReport[_0x5a94('0x16')](_0x14ddfe);}};Report[_0x5a94('0xf')][_0x5a94('0x18')]=function(_0x1cbcdc){RpcVoiceTransferReport[_0x5a94('0x18')](_0x1cbcdc);};Report[_0x5a94('0xf')][_0x5a94('0x1a')]=function(_0x1224ad){RpcVoiceTransferReport[_0x5a94('0x1a')](_0x1224ad);};module[_0x5a94('0x4f')]=Report; \ No newline at end of file +var _0xef3a=['connectedlinenum','assigned','lastAssignedTo','queuecallercomplete','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','destination','exten','dialer','lastapplication','queue','context','from-voip-provider','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','calleridname','monitor','monitors','filename','createdAt','xcally-motion-preview','connectedlinename','membername','xcally-motion-dialer','isArray','forEach','startsWith','substring','indexOf','mobile','phone','lastIndexOf','exports','bluebird','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceAgentReport','./voiceDialReport','./userReport','realtime','agents','telephones','prototype','sync','xdr','disabled','custom:voiceQueueReport','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindTransfer','attendedtransfer','attendedTransfer','findAgent','find','accountcode','isNil','name','interface','format','SIP/%s','length'];(function(_0xdc8eac,_0x2ce7e4){var _0x47d9e5=function(_0x3abcdf){while(--_0x3abcdf){_0xdc8eac['push'](_0xdc8eac['shift']());}};_0x47d9e5(++_0x2ce7e4);}(_0xef3a,0x12e));var _0xaef3=function(_0x409deb,_0x2b731){_0x409deb=_0x409deb-0x0;var _0x15a4f7=_0xef3a[_0x409deb];return _0x15a4f7;};'use strict';var BPromise=require(_0xaef3('0x0'));var _=require(_0xaef3('0x1'));var moment=require(_0xaef3('0x2'));var util=require(_0xaef3('0x3'));var config=require(_0xaef3('0x4'));var logger=require(_0xaef3('0x5'))(_0xaef3('0x6'));var ami=require(_0xaef3('0x7'));var RpcVoiceAgentReport=require(_0xaef3('0x8'));var RpcVoiceCallReport=require(_0xaef3('0x9'));var RpcVoiceDialReport=require('../rpc/voiceDialReport');var RpcMemberReport=require(_0xaef3('0xa'));var RpcVoiceQueueReport=require(_0xaef3('0xb'));var RpcVoiceRecording=require(_0xaef3('0xc'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xaef3('0xd'));var VoiceCallReport=require(_0xaef3('0xe'));var VoiceAgentReport=require(_0xaef3('0xf'));var VoiceDialReport=require(_0xaef3('0x10'));var UserReport=require(_0xaef3('0x11'));function Report(_0x5dcf83){this[_0xaef3('0x12')]=_0x5dcf83;this['agents']=_0x5dcf83[_0xaef3('0x13')];this[_0xaef3('0x14')]=_0x5dcf83[_0xaef3('0x14')];}Report[_0xaef3('0x15')][_0xaef3('0x16')]=function(_0x3a7fd0){var _0x97bc8c=new VoiceQueueReport(this[_0xaef3('0x12')]);var _0x1f4c33=new VoiceAgentReport(this[_0xaef3('0x12')]);var _0x35169c=new VoiceDialReport(this['realtime']);var _0x3e1052=new VoiceCallReport(this[_0xaef3('0x12')]);var _0x13680a=new UserReport(this['realtime']);if(config[_0xaef3('0x17')]&&config[_0xaef3('0x17')][_0xaef3('0x18')]){ami['on'](_0xaef3('0x19'),this[_0xaef3('0x1a')][_0xaef3('0x1b')](this));ami['on'](_0xaef3('0x1c'),this[_0xaef3('0x1d')][_0xaef3('0x1b')](this));ami['on'](_0xaef3('0x1e'),this[_0xaef3('0x1f')][_0xaef3('0x1b')](this));ami['on'](_0xaef3('0x20'),this[_0xaef3('0x21')][_0xaef3('0x1b')](this));ami['on']('blindtransfer',this[_0xaef3('0x22')][_0xaef3('0x1b')](this));ami['on'](_0xaef3('0x23'),this[_0xaef3('0x24')]['bind'](this));}};Report[_0xaef3('0x15')][_0xaef3('0x25')]=function(_0x1f546c){var _0x571302=undefined;_0x571302=_[_0xaef3('0x26')](this[_0xaef3('0x13')],function(_0x46dbfe){return _0x46dbfe[_0xaef3('0x27')]==_0x1f546c||_0x46dbfe['name']==_0x1f546c;});if(_[_0xaef3('0x28')](_0x571302)){var _0x5775e1=_[_0xaef3('0x26')](this[_0xaef3('0x14')],function(_0x35fa58){return _0x35fa58[_0xaef3('0x27')]==_0x1f546c||_0x35fa58[_0xaef3('0x29')]==_0x1f546c;});if(_0x5775e1){_0x571302=_[_0xaef3('0x26')](this['agents'],function(_0x44b5e8){return _0x44b5e8[_0xaef3('0x2a')]==util[_0xaef3('0x2b')](_0xaef3('0x2c'),_0x5775e1[_0xaef3('0x29')]);});}}return _0x571302;};Report[_0xaef3('0x15')]['voiceQueueReport']=function(_0x8379f0){for(var _0x3aa769=0x0;_0x3aa769<_0x8379f0[_0xaef3('0x2d')];_0x3aa769+=0x1){var _0x682c2c=this[_0xaef3('0x25')](_0x8379f0[_0x3aa769][_0xaef3('0x2e')]);if(_0x682c2c){_0x8379f0[_0x3aa769][_0xaef3('0x27')]=_0x682c2c[_0xaef3('0x27')];_0x8379f0[_0x3aa769][_0xaef3('0x2f')]=!![];_0x8379f0[_0x3aa769][_0xaef3('0x30')]=_0x682c2c[_0xaef3('0x29')];_0x8379f0[_0x3aa769][_0xaef3('0x2a')]=_[_0xaef3('0x28')](_0x682c2c[_0xaef3('0x2a')])?util[_0xaef3('0x2b')](_0xaef3('0x2c'),_0x682c2c[_0xaef3('0x29')]):_0x682c2c['interface'];if(_0x8379f0[_0x3aa769][_0xaef3('0x31')]){_0x8379f0[_0x3aa769]['queuecallercompleteAt']=moment()['format'](_0xaef3('0x32'));}if(_0x8379f0[_0x3aa769][_0xaef3('0x33')]){_0x8379f0[_0x3aa769][_0xaef3('0x34')]=moment()[_0xaef3('0x2b')](_0xaef3('0x32'));}RpcMemberReport['voiceQueueReport'](_0x8379f0[_0x3aa769]);}RpcVoiceQueueReport[_0xaef3('0x35')](_0x8379f0[_0x3aa769]);}};function extractCalleridNumber(_0x449fca){var _0x4651e8=_0x449fca['match'](/<(.*?)>/);return _0x4651e8?_0x4651e8[0x1]:_0x449fca;}Report[_0xaef3('0x15')][_0xaef3('0x1d')]=function(_0x442617){_0x442617['destination']=_0x442617[_0xaef3('0x36')]||_0x442617[_0xaef3('0x37')];if(_0x442617['type']==_0xaef3('0x38')){_0x442617[_0xaef3('0x39')]=_0xaef3('0x3a');_0x442617['lastdata']=_0x442617[_0xaef3('0x3a')];if(_0x442617[_0xaef3('0x3b')]==_0xaef3('0x3c')){_0x442617['accountcode']='';_0x442617[_0xaef3('0x36')]=extractCalleridNumber(_0x442617['callerid']);}else if(_0x442617['context']=='from-sip'){if(_0x442617[_0xaef3('0x36')]=='xcally-motion-preview'){_0x442617[_0xaef3('0x36')]=extractCalleridNumber(_0x442617[_0xaef3('0x3d')]);_0x442617[_0xaef3('0x3e')]=_0x442617[_0xaef3('0x3f')];_0x442617[_0xaef3('0x40')]=[_0x442617['channel'],_0x442617[_0xaef3('0x41')]=_0x442617[_0xaef3('0x40')]][0x0];_0x442617[_0xaef3('0x42')]=_0x442617[_0xaef3('0x3d')];}else{_0x442617[_0xaef3('0x36')]=_0x442617['calleridnum'];_0x442617[_0xaef3('0x3e')]=_0x442617[_0xaef3('0x3f')];if(_0x442617[_0xaef3('0x43')]==_0xaef3('0x44')){_0x442617[_0xaef3('0x27')]=_0x442617['connectedlinenum'];}else{_0x442617[_0xaef3('0x27')]='';}}}}else{_0x442617[_0xaef3('0x42')]=util[_0xaef3('0x2b')]('\x22%s\x22\x20<%s>',_0x442617[_0xaef3('0x45')],_0x442617[_0xaef3('0x3e')]);}RpcVoiceCallReport['create'](_0x442617);if(_0x442617[_0xaef3('0x46')]){for(var _0x3cc43f=0x0;_0x3cc43f<_0x442617['monitors']['length'];_0x3cc43f+=0x1){_0x442617['monitorFilename']=_0x442617[_0xaef3('0x47')][_0x3cc43f][_0xaef3('0x48')];_0x442617['createdAt']=_0x442617['monitors'][_0x3cc43f][_0xaef3('0x49')];if(_0x442617[_0xaef3('0x37')]==_0xaef3('0x4a')){_0x442617['calleridnum']=_0x442617['connectedlinenum'];_0x442617[_0xaef3('0x45')]=_0x442617[_0xaef3('0x4b')];_0x442617[_0xaef3('0x2e')]=_0x442617[_0xaef3('0x27')];_0x442617[_0xaef3('0x4b')]=_0x442617[_0xaef3('0x4c')];_0x442617[_0xaef3('0x37')]=_0x442617['originatecalleridnum'];}else if(_0x442617['exten']==_0xaef3('0x4d')){_0x442617[_0xaef3('0x3e')]=_0x442617[_0xaef3('0x36')];_0x442617[_0xaef3('0x37')]=_0x442617[_0xaef3('0x3f')];}RpcVoiceRecording[_0xaef3('0x35')](_0x442617);}}};Report[_0xaef3('0x15')][_0xaef3('0x1f')]=function(_0x50ccbc){if(_[_0xaef3('0x4e')](_0x50ccbc)){_0x50ccbc[_0xaef3('0x4f')](function(_0xd48c5e){RpcVoiceAgentReport['create'](_0xd48c5e);});}else{RpcVoiceAgentReport['create'](_0x50ccbc);}};Report[_0xaef3('0x15')][_0xaef3('0x21')]=function(_0x352aff){RpcVoiceDialReport[_0xaef3('0x35')](_0x352aff);var _0x56d788=undefined;var _0x2dfbaf=_0x352aff[_0xaef3('0x41')];if(_[_0xaef3('0x50')](_0x2dfbaf,'Local')){var _0x307dab=_0x2dfbaf[_0xaef3('0x51')](_0x2dfbaf['indexOf']('/')+0x1,_0x2dfbaf[_0xaef3('0x52')]('@'));_0x56d788=_[_0xaef3('0x26')](this[_0xaef3('0x13')],function(_0x133490){return _0x133490[_0xaef3('0x53')]==_0x307dab||_0x133490[_0xaef3('0x54')]==_0x307dab||_0x133490[_0xaef3('0x27')]==_0x307dab;});}else{var _0x307dab=_0x2dfbaf['substring'](_0x2dfbaf[_0xaef3('0x52')]('/')+0x1,_0x2dfbaf[_0xaef3('0x55')]('-'));_0x56d788=this[_0xaef3('0x25')](_0x307dab);}if(_0x56d788){_0x352aff['interface']=_[_0xaef3('0x28')](_0x56d788['interface'])?util[_0xaef3('0x2b')]('SIP/%s',_0x56d788[_0xaef3('0x29')]):_0x56d788[_0xaef3('0x2a')];_0x352aff['membername']=_0x56d788['name'];_0x352aff['accountcode']=_0x56d788[_0xaef3('0x27')];RpcMemberReport[_0xaef3('0x21')](_0x352aff);}};Report[_0xaef3('0x15')][_0xaef3('0x22')]=function(_0x25428d){RpcVoiceTransferReport[_0xaef3('0x22')](_0x25428d);};Report[_0xaef3('0x15')]['attendedTransfer']=function(_0x10acfe){RpcVoiceTransferReport[_0xaef3('0x24')](_0x10acfe);};module[_0xaef3('0x56')]=Report; \ No newline at end of file diff --git a/server/services/ami/report/userReport.js b/server/services/ami/report/userReport.js index 0103e99..690f6d3 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 _0x6ac2=['actionSipPeerStatus','isNotNull','isUndefined','emit','find','username','stateRegistry','state','merge','omit','event','actionid','trunk:%s','trunk:save','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','format','telephone:%s','name','toNumber','startsWith','indexOf','accountcode','updateStatusRealtime','[syncDeviceState][UserReport]','syncPeerStatus','peerstatus','peer','registered','address','status','telephone:save','[syncPeerStatus][UserReport]','exports','lodash','moment','bluebird','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','trunks','agents','telephones','syncRegistry','bind','devicestatechange','syncDeviceState','loopSyncRealTimeShow','then','actionDeviceStateList','catch','[loopSyncRealTimeShow]','error','inspect','prototype','resolve','actionSipShowRegistry'];(function(_0x474d6b,_0x26e9aa){var _0x276ebb=function(_0x3bfea4){while(--_0x3bfea4){_0x474d6b['push'](_0x474d6b['shift']());}};_0x276ebb(++_0x26e9aa);}(_0x6ac2,0x68));var _0x26ac=function(_0x4c080e,_0x23b322){_0x4c080e=_0x4c080e-0x0;var _0x37bdb2=_0x6ac2[_0x4c080e];return _0x37bdb2;};'use strict';var _=require(_0x26ac('0x0'));var moment=require(_0x26ac('0x1'));var BPromise=require(_0x26ac('0x2'));var util=require(_0x26ac('0x3'));var Redis=require(_0x26ac('0x4'));var config=require(_0x26ac('0x5'));var logger=require(_0x26ac('0x6'))('ami');var ami=require(_0x26ac('0x7'));config[_0x26ac('0x8')]=_[_0x26ac('0x9')](config[_0x26ac('0x8')],{'host':_0x26ac('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x26ac('0x8')]));function UserReport(_0x4c5d09){this[_0x26ac('0xb')]=_0x4c5d09[_0x26ac('0xb')];this[_0x26ac('0xc')]=_0x4c5d09[_0x26ac('0xc')];this[_0x26ac('0xd')]=_0x4c5d09[_0x26ac('0xd')];ami['on']('registryentry',this[_0x26ac('0xe')][_0x26ac('0xf')](this));ami['on']('registry',this[_0x26ac('0xe')][_0x26ac('0xf')](this));ami['on'](_0x26ac('0x10'),this[_0x26ac('0x11')][_0x26ac('0xf')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));this[_0x26ac('0x12')]();return BPromise['resolve']()[_0x26ac('0x13')](ami['actionSipShowRegistry']())[_0x26ac('0x13')](ami[_0x26ac('0x14')]())[_0x26ac('0x13')](ami['actionSipPeerStatus']())[_0x26ac('0x15')](loggerCatch(_0x26ac('0x16')));}function loggerCatch(_0x3f59a3){return function(_0x1e90d9){logger[_0x26ac('0x17')](_0x3f59a3,util[_0x26ac('0x18')](_0x1e90d9,{'showHidden':![],'depth':null}));};}UserReport[_0x26ac('0x19')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise[_0x26ac('0x1a')]()[_0x26ac('0x13')](ami[_0x26ac('0x1b')]())['then'](ami[_0x26ac('0x14')]())[_0x26ac('0x13')](ami[_0x26ac('0x1c')]())[_0x26ac('0x15')](loggerCatch(_0x26ac('0x16')));},0x32c8);};UserReport['prototype'][_0x26ac('0x1d')]=function(_0x2b7e9d){return _0x2b7e9d!==null&&!_[_0x26ac('0x1e')](_0x2b7e9d);};UserReport[_0x26ac('0x19')][_0x26ac('0x1f')]=function(_0x11a01d,_0x560e23,_0x2f61a3){io['to'](_0x11a01d)[_0x26ac('0x1f')](_0x560e23,_0x2f61a3);};UserReport[_0x26ac('0x19')]['syncRegistry']=function(_0x499f3c){try{if(this['isNotNull'](_0x499f3c)){var _0x3fddb7=_[_0x26ac('0x20')](this['trunks'],{'registry':_0x499f3c[_0x26ac('0x21')]});if(_0x3fddb7){_0x499f3c[_0x26ac('0x22')]=_0x499f3c[_0x26ac('0x23')];_[_0x26ac('0x24')](_0x3fddb7,_[_0x26ac('0x25')](_0x499f3c,[_0x26ac('0x26'),_0x26ac('0x27'),'username',_0x26ac('0x23')]));this['emit'](util['format'](_0x26ac('0x28'),_0x3fddb7['name']),_0x26ac('0x29'),_0x3fddb7);}}}catch(_0x514acc){logger[_0x26ac('0x17')](_0x26ac('0x2a'),util[_0x26ac('0x18')](_0x514acc,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x26ac('0x11')]=function(_0x56126c){try{if(this['isNotNull'](_0x56126c)){if(this['agents'][_0x56126c[_0x26ac('0x2b')]]){if(!this[_0x26ac('0xc')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x2c')]||_0x56126c[_0x26ac('0x23')][_0x26ac('0x2d')]()==_0x26ac('0x2e')){this['agents'][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x2c')]=![];if(this[_0x26ac('0xc')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x23')]!==_0x56126c[_0x26ac('0x23')][_0x26ac('0x2d')]()){this[_0x26ac('0xc')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x2f')]=_['toNumber'](moment()[_0x26ac('0x30')]('x'));}this[_0x26ac('0xc')][_0x56126c['device']][_0x26ac('0x23')]=_0x56126c[_0x26ac('0x23')][_0x26ac('0x2d')]();this[_0x26ac('0xc')][_0x56126c['device']]['updateStatusRealtime'](_0x56126c);}}else if(this[_0x26ac('0xd')][_0x56126c['device']]){if(this[_0x26ac('0xd')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x23')]!==_0x56126c[_0x26ac('0x23')][_0x26ac('0x2d')]()){this['telephones'][_0x56126c['device']][_0x26ac('0x2f')]=_['toNumber'](moment()['format']('x'));}this[_0x26ac('0xd')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x23')]=_0x56126c[_0x26ac('0x23')]['toLowerCase']();this[_0x26ac('0x1f')](util[_0x26ac('0x30')](_0x26ac('0x31'),this[_0x26ac('0xd')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x32')]),'telephone:save',this['telephones'][_0x56126c[_0x26ac('0x2b')]]);}else if(this[_0x26ac('0xb')][_0x56126c[_0x26ac('0x2b')]]){if(this['trunks'][_0x56126c[_0x26ac('0x2b')]]['state']!==_0x56126c['state']['toLowerCase']()){this['trunks'][_0x56126c['device']][_0x26ac('0x2f')]=_[_0x26ac('0x33')](moment()['format']('x'));}this[_0x26ac('0xb')][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x23')]=_0x56126c[_0x26ac('0x23')]['toLowerCase']();this[_0x26ac('0x1f')](util[_0x26ac('0x30')](_0x26ac('0x28'),this['trunks'][_0x56126c[_0x26ac('0x2b')]][_0x26ac('0x32')]),_0x26ac('0x29'),this[_0x26ac('0xb')][_0x56126c[_0x26ac('0x2b')]]);}else if(_['startsWith'](_0x56126c['device'],'Queue')){}else if(_[_0x26ac('0x34')](_0x56126c['device'],'Local')){var _0xa386ab=_0x56126c[_0x26ac('0x2b')];var _0x46234d=_0xa386ab['substring'](_0xa386ab[_0x26ac('0x35')]('/')+0x1,_0xa386ab[_0x26ac('0x35')]('@'));var _0x222032=_[_0x26ac('0x20')](this[_0x26ac('0xc')],function(_0xb6f9d1){return _0xb6f9d1['mobile']==_0x46234d||_0xb6f9d1['phone']==_0x46234d||_0xb6f9d1[_0x26ac('0x36')]==_0x46234d;});if(_0x222032){if(_0x222032[_0x26ac('0x23')]!==_0x56126c[_0x26ac('0x23')][_0x26ac('0x2d')]()){_0x222032[_0x26ac('0x2f')]=_[_0x26ac('0x33')](moment()[_0x26ac('0x30')]('x'));}_0x222032[_0x26ac('0x23')]=_0x56126c[_0x26ac('0x23')]['toLowerCase']();_0x222032['local']=!![];_0x222032[_0x26ac('0x37')](_0x56126c);}}else{}}}catch(_0xec3552){logger[_0x26ac('0x17')](_0x26ac('0x38'),util['inspect'](_0xec3552,{'showHidden':![],'depth':null}));}};UserReport[_0x26ac('0x19')][_0x26ac('0x39')]=function(_0x1f8a71){try{if(this[_0x26ac('0x1d')](_0x1f8a71)&&this[_0x26ac('0x1d')](_0x1f8a71[_0x26ac('0x3a')])){if(this['agents'][_0x1f8a71[_0x26ac('0x3b')]]){if(!this['agents'][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x2c')]||_0x1f8a71[_0x26ac('0x3a')]['toLowerCase']()==_0x26ac('0x3c')){this[_0x26ac('0xc')][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x2c')]=![];this['agents'][_0x1f8a71[_0x26ac('0x3b')]]['status']=_0x1f8a71[_0x26ac('0x3a')][_0x26ac('0x2d')]();this[_0x26ac('0xc')][_0x1f8a71['peer']][_0x26ac('0x3d')]=_0x1f8a71[_0x26ac('0x3d')];this[_0x26ac('0xc')][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x37')](_0x1f8a71);}}else if(this[_0x26ac('0xd')][_0x1f8a71[_0x26ac('0x3b')]]){this[_0x26ac('0xd')][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x3e')]=_0x1f8a71[_0x26ac('0x3a')][_0x26ac('0x2d')]();this[_0x26ac('0xd')][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x3d')]=_0x1f8a71['address'];this[_0x26ac('0x1f')](util[_0x26ac('0x30')](_0x26ac('0x31'),this[_0x26ac('0xd')][_0x1f8a71['peer']]['name']),_0x26ac('0x3f'),this['telephones'][_0x1f8a71[_0x26ac('0x3b')]]);}else if(this['trunks'][_0x1f8a71['peer']]){this['trunks'][_0x1f8a71[_0x26ac('0x3b')]][_0x26ac('0x3e')]=_0x1f8a71[_0x26ac('0x3a')][_0x26ac('0x2d')]();this[_0x26ac('0xb')][_0x1f8a71['peer']][_0x26ac('0x3d')]=_0x1f8a71[_0x26ac('0x3d')];this[_0x26ac('0x1f')](util[_0x26ac('0x30')](_0x26ac('0x28'),this[_0x26ac('0xb')][_0x1f8a71[_0x26ac('0x3b')]]['name']),_0x26ac('0x29'),this[_0x26ac('0xb')][_0x1f8a71[_0x26ac('0x3b')]]);}else{}}}catch(_0x1ac4dc){logger[_0x26ac('0x17')](_0x26ac('0x40'),util[_0x26ac('0x18')](_0x1ac4dc,{'showHidden':![],'depth':null}));}};module[_0x26ac('0x41')]=UserReport; \ No newline at end of file +var _0x29f5=['[loopSyncRealTimeShow]','error','inspect','prototype','catch','isUndefined','emit','isNotNull','stateRegistry','state','merge','omit','event','actionid','username','format','trunk:%s','name','[syncRegistry][UserReport]','device','local','toLowerCase','inuse','stateTime','toNumber','updateStatusRealtime','telephone:%s','telephone:save','trunk:save','startsWith','Queue','Local','substring','indexOf','phone','[syncDeviceState][UserReport]','peerstatus','peer','registered','status','address','lodash','moment','bluebird','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','trunks','agents','telephones','syncRegistry','bind','registry','devicestatechange','syncDeviceState','syncPeerStatus','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus'];(function(_0x320601,_0x155be6){var _0x2a30c8=function(_0x635cae){while(--_0x635cae){_0x320601['push'](_0x320601['shift']());}};_0x2a30c8(++_0x155be6);}(_0x29f5,0x6b));var _0x529f=function(_0x383f8b,_0x401658){_0x383f8b=_0x383f8b-0x0;var _0x503491=_0x29f5[_0x383f8b];return _0x503491;};'use strict';var _=require(_0x529f('0x0'));var moment=require(_0x529f('0x1'));var BPromise=require(_0x529f('0x2'));var util=require('util');var Redis=require('ioredis');var config=require(_0x529f('0x3'));var logger=require(_0x529f('0x4'))('ami');var ami=require(_0x529f('0x5'));config[_0x529f('0x6')]=_[_0x529f('0x7')](config[_0x529f('0x6')],{'host':_0x529f('0x8'),'port':0x18eb});var io=require(_0x529f('0x9'))(new Redis(config[_0x529f('0x6')]));function UserReport(_0x1cc965){this[_0x529f('0xa')]=_0x1cc965[_0x529f('0xa')];this['agents']=_0x1cc965[_0x529f('0xb')];this['telephones']=_0x1cc965[_0x529f('0xc')];ami['on']('registryentry',this[_0x529f('0xd')][_0x529f('0xe')](this));ami['on'](_0x529f('0xf'),this[_0x529f('0xd')]['bind'](this));ami['on'](_0x529f('0x10'),this[_0x529f('0x11')]['bind'](this));ami['on']('peerstatus',this[_0x529f('0x12')][_0x529f('0xe')](this));this[_0x529f('0x13')]();return BPromise[_0x529f('0x14')]()[_0x529f('0x15')](ami[_0x529f('0x16')]())[_0x529f('0x15')](ami[_0x529f('0x17')]())['then'](ami[_0x529f('0x18')]())['catch'](loggerCatch(_0x529f('0x19')));}function loggerCatch(_0x3d8d60){return function(_0x801d73){logger[_0x529f('0x1a')](_0x3d8d60,util[_0x529f('0x1b')](_0x801d73,{'showHidden':![],'depth':null}));};}UserReport[_0x529f('0x1c')][_0x529f('0x13')]=function(){setInterval(function(){BPromise[_0x529f('0x14')]()[_0x529f('0x15')](ami['actionSipShowRegistry']())['then'](ami[_0x529f('0x17')]())[_0x529f('0x15')](ami['actionSipPeerStatus']())[_0x529f('0x1d')](loggerCatch(_0x529f('0x19')));},0x32c8);};UserReport[_0x529f('0x1c')]['isNotNull']=function(_0x175ad8){return _0x175ad8!==null&&!_[_0x529f('0x1e')](_0x175ad8);};UserReport[_0x529f('0x1c')]['emit']=function(_0x1f7460,_0x5f515e,_0x53244c){io['to'](_0x1f7460)[_0x529f('0x1f')](_0x5f515e,_0x53244c);};UserReport[_0x529f('0x1c')][_0x529f('0xd')]=function(_0x4432eb){try{if(this[_0x529f('0x20')](_0x4432eb)){var _0x19788d=_['find'](this[_0x529f('0xa')],{'registry':_0x4432eb['username']});if(_0x19788d){_0x4432eb[_0x529f('0x21')]=_0x4432eb[_0x529f('0x22')];_[_0x529f('0x23')](_0x19788d,_[_0x529f('0x24')](_0x4432eb,[_0x529f('0x25'),_0x529f('0x26'),_0x529f('0x27'),_0x529f('0x22')]));this[_0x529f('0x1f')](util[_0x529f('0x28')](_0x529f('0x29'),_0x19788d[_0x529f('0x2a')]),'trunk:save',_0x19788d);}}}catch(_0x3e3d7c){logger[_0x529f('0x1a')](_0x529f('0x2b'),util['inspect'](_0x3e3d7c,{'showHidden':![],'depth':null}));}};UserReport[_0x529f('0x1c')][_0x529f('0x11')]=function(_0x5659e6){try{if(this[_0x529f('0x20')](_0x5659e6)){if(this['agents'][_0x5659e6['device']]){if(!this[_0x529f('0xb')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x2d')]||_0x5659e6['state'][_0x529f('0x2e')]()==_0x529f('0x2f')){this['agents'][_0x5659e6['device']][_0x529f('0x2d')]=![];if(this[_0x529f('0xb')][_0x5659e6[_0x529f('0x2c')]]['state']!==_0x5659e6[_0x529f('0x22')][_0x529f('0x2e')]()){this[_0x529f('0xb')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x30')]=_[_0x529f('0x31')](moment()[_0x529f('0x28')]('x'));}this[_0x529f('0xb')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x22')]=_0x5659e6['state'][_0x529f('0x2e')]();this[_0x529f('0xb')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x32')](_0x5659e6);}}else if(this['telephones'][_0x5659e6[_0x529f('0x2c')]]){if(this[_0x529f('0xc')][_0x5659e6[_0x529f('0x2c')]]['state']!==_0x5659e6[_0x529f('0x22')][_0x529f('0x2e')]()){this[_0x529f('0xc')][_0x5659e6['device']][_0x529f('0x30')]=_[_0x529f('0x31')](moment()[_0x529f('0x28')]('x'));}this[_0x529f('0xc')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x22')]=_0x5659e6[_0x529f('0x22')][_0x529f('0x2e')]();this['emit'](util[_0x529f('0x28')](_0x529f('0x33'),this[_0x529f('0xc')][_0x5659e6[_0x529f('0x2c')]]['name']),_0x529f('0x34'),this['telephones'][_0x5659e6[_0x529f('0x2c')]]);}else if(this[_0x529f('0xa')][_0x5659e6[_0x529f('0x2c')]]){if(this[_0x529f('0xa')][_0x5659e6[_0x529f('0x2c')]]['state']!==_0x5659e6['state'][_0x529f('0x2e')]()){this[_0x529f('0xa')][_0x5659e6['device']]['stateTime']=_['toNumber'](moment()[_0x529f('0x28')]('x'));}this[_0x529f('0xa')][_0x5659e6[_0x529f('0x2c')]]['state']=_0x5659e6[_0x529f('0x22')][_0x529f('0x2e')]();this[_0x529f('0x1f')](util[_0x529f('0x28')]('trunk:%s',this[_0x529f('0xa')][_0x5659e6[_0x529f('0x2c')]][_0x529f('0x2a')]),_0x529f('0x35'),this[_0x529f('0xa')][_0x5659e6[_0x529f('0x2c')]]);}else if(_[_0x529f('0x36')](_0x5659e6[_0x529f('0x2c')],_0x529f('0x37'))){}else if(_[_0x529f('0x36')](_0x5659e6['device'],_0x529f('0x38'))){var _0x588501=_0x5659e6[_0x529f('0x2c')];var _0x538fea=_0x588501[_0x529f('0x39')](_0x588501[_0x529f('0x3a')]('/')+0x1,_0x588501['indexOf']('@'));var _0x37a7e8=_['find'](this[_0x529f('0xb')],function(_0x287a6e){return _0x287a6e['mobile']==_0x538fea||_0x287a6e[_0x529f('0x3b')]==_0x538fea||_0x287a6e['accountcode']==_0x538fea;});if(_0x37a7e8){if(_0x37a7e8[_0x529f('0x22')]!==_0x5659e6[_0x529f('0x22')]['toLowerCase']()){_0x37a7e8[_0x529f('0x30')]=_[_0x529f('0x31')](moment()[_0x529f('0x28')]('x'));}_0x37a7e8[_0x529f('0x22')]=_0x5659e6[_0x529f('0x22')][_0x529f('0x2e')]();_0x37a7e8[_0x529f('0x2d')]=!![];_0x37a7e8[_0x529f('0x32')](_0x5659e6);}}else{}}}catch(_0x15a472){logger[_0x529f('0x1a')](_0x529f('0x3c'),util[_0x529f('0x1b')](_0x15a472,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x529f('0x12')]=function(_0x436473){try{if(this['isNotNull'](_0x436473)&&this[_0x529f('0x20')](_0x436473[_0x529f('0x3d')])){if(this['agents'][_0x436473['peer']]){if(!this['agents'][_0x436473[_0x529f('0x3e')]][_0x529f('0x2d')]||_0x436473[_0x529f('0x3d')][_0x529f('0x2e')]()==_0x529f('0x3f')){this[_0x529f('0xb')][_0x436473[_0x529f('0x3e')]][_0x529f('0x2d')]=![];this[_0x529f('0xb')][_0x436473[_0x529f('0x3e')]][_0x529f('0x40')]=_0x436473[_0x529f('0x3d')]['toLowerCase']();this[_0x529f('0xb')][_0x436473['peer']]['address']=_0x436473[_0x529f('0x41')];this[_0x529f('0xb')][_0x436473[_0x529f('0x3e')]][_0x529f('0x32')](_0x436473);}}else if(this['telephones'][_0x436473[_0x529f('0x3e')]]){this[_0x529f('0xc')][_0x436473[_0x529f('0x3e')]][_0x529f('0x40')]=_0x436473['peerstatus'][_0x529f('0x2e')]();this['telephones'][_0x436473[_0x529f('0x3e')]][_0x529f('0x41')]=_0x436473[_0x529f('0x41')];this[_0x529f('0x1f')](util['format']('telephone:%s',this[_0x529f('0xc')][_0x436473['peer']][_0x529f('0x2a')]),_0x529f('0x34'),this[_0x529f('0xc')][_0x436473['peer']]);}else if(this['trunks'][_0x436473[_0x529f('0x3e')]]){this[_0x529f('0xa')][_0x436473[_0x529f('0x3e')]][_0x529f('0x40')]=_0x436473['peerstatus'][_0x529f('0x2e')]();this['trunks'][_0x436473['peer']][_0x529f('0x41')]=_0x436473[_0x529f('0x41')];this[_0x529f('0x1f')](util[_0x529f('0x28')](_0x529f('0x29'),this[_0x529f('0xa')][_0x436473[_0x529f('0x3e')]][_0x529f('0x2a')]),_0x529f('0x35'),this[_0x529f('0xa')][_0x436473[_0x529f('0x3e')]]);}else{}}}catch(_0x58588a){logger[_0x529f('0x1a')]('[syncPeerStatus][UserReport]',util[_0x529f('0x1b')](_0x58588a,{'showHidden':![],'depth':null}));}};module['exports']=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index ad03621..c9cc49a 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 _0x10c2=['custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','syncAgentComplete','talktime','transfer','agent','acw','agentacw','acwtime','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','addVariable','keys','variable','[syncVarSet][VoiceAgentReport]','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','sipcallid','bridgepvtcallid','memberdynamic','memberinterface','memberpenalty','memberrealtime','isNil','agentcompleteAt','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','complete','diff','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','seconds','[syncBlindTransfer][VoiceAgentReport]','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','channel','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/environment','../../../config/logger','ami','../ami','redis','defaults','localhost','channels','voiceQueues','agents','variables','syncAgentCalled','bind','agentconnect','syncAgentConnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncVarSet','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','merge','omit','event','user:%s','membername','user:called','error','inspect','hasOwnProperty','agentconnectAt','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswer','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','rejected'];(function(_0x47fd36,_0x41535d){var _0x21a0fc=function(_0x44c07c){while(--_0x44c07c){_0x47fd36['push'](_0x47fd36['shift']());}};_0x21a0fc(++_0x41535d);}(_0x10c2,0x192));var _0x210c=function(_0x3b341f,_0x3e3315){_0x3b341f=_0x3b341f-0x0;var _0x51478c=_0x10c2[_0x3b341f];return _0x51478c;};'use strict';var _=require(_0x210c('0x0'));var moment=require(_0x210c('0x1'));var util=require(_0x210c('0x2'));var Redis=require('ioredis');var config=require(_0x210c('0x3'));var logger=require(_0x210c('0x4'))(_0x210c('0x5'));var ami=require(_0x210c('0x6'));config[_0x210c('0x7')]=_[_0x210c('0x8')](config[_0x210c('0x7')],{'host':_0x210c('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x532b89){this[_0x210c('0xa')]={};this[_0x210c('0xb')]=_0x532b89[_0x210c('0xb')];this[_0x210c('0xc')]=_0x532b89[_0x210c('0xc')];this[_0x210c('0xd')]={};ami['on']('agentcalled',this[_0x210c('0xe')][_0x210c('0xf')](this));ami['on'](_0x210c('0x10'),this[_0x210c('0x11')]['bind'](this));ami['on']('agentringnoanswer',this[_0x210c('0x12')][_0x210c('0xf')](this));ami['on'](_0x210c('0x13'),this[_0x210c('0x14')][_0x210c('0xf')](this));ami['on'](_0x210c('0x15'),this['syncAgentComplete'][_0x210c('0xf')](this));ami['on']('varset',this[_0x210c('0x16')][_0x210c('0xf')](this));ami['on']('hangup',this[_0x210c('0x17')][_0x210c('0xf')](this));ami['on'](_0x210c('0x18'),this[_0x210c('0x19')][_0x210c('0xf')](this));ami['on']('musiconholdstop',this[_0x210c('0x1a')][_0x210c('0xf')](this));ami['on'](_0x210c('0x1b'),this[_0x210c('0x1c')][_0x210c('0xf')](this));ami['on'](_0x210c('0x1d'),this[_0x210c('0x1e')]['bind'](this));}VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x20')]=function(_0x4d8402,_0x4f6447,_0x2e49b1){io['to'](_0x4d8402)[_0x210c('0x20')](_0x4f6447,_0x2e49b1);};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x21')]=function(_0x323aad){return _0x323aad!==null&&!_[_0x210c('0x22')](_0x323aad);};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0xe')]=function(_0x1b6238){try{if(this[_0x210c('0x21')](_0x1b6238)){if(_['isUndefined'](this['channels'][_0x1b6238[_0x210c('0x23')]])){this[_0x210c('0xa')][_0x1b6238[_0x210c('0x23')]]={};}if(_['isUndefined'](this[_0x210c('0xa')][_0x1b6238[_0x210c('0x23')]][_0x1b6238['destuniqueid']])){this[_0x210c('0xa')][_0x1b6238[_0x210c('0x23')]][_0x1b6238[_0x210c('0x24')]]={'agentcalledAt':moment()[_0x210c('0x25')](_0x210c('0x26')),'lastevent':_0x210c('0x27'),'variables':this['variables'][_0x1b6238[_0x210c('0x23')]],'type':this['voiceQueues'][_0x1b6238[_0x210c('0x28')]]?this[_0x210c('0xb')][_0x1b6238[_0x210c('0x28')]][_0x210c('0x29')]||_0x210c('0x2a'):_0x210c('0x2a')};}_[_0x210c('0x2b')](this[_0x210c('0xa')][_0x1b6238[_0x210c('0x23')]][_0x1b6238[_0x210c('0x24')]],_[_0x210c('0x2c')](_0x1b6238,[_0x210c('0x2d'),'privilege']));ami[_0x210c('0x20')]('custom:agentcalled',this[_0x210c('0xa')][_0x1b6238[_0x210c('0x23')]][_0x1b6238['destuniqueid']]);this[_0x210c('0x20')](util[_0x210c('0x25')](_0x210c('0x2e'),_0x1b6238[_0x210c('0x2f')]),_0x210c('0x30'),this['channels'][_0x1b6238[_0x210c('0x23')]][_0x1b6238['destuniqueid']]);}}catch(_0x36d297){logger[_0x210c('0x31')]('[syncAgentCalled][VoiceAgentReport]',util[_0x210c('0x32')](_0x36d297,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x210c('0x11')]=function(_0x3b9331){try{if(this[_0x210c('0x21')](_0x3b9331)){if(this['channels'][_0x3b9331[_0x210c('0x23')]]){for(var _0x16733e in this['channels'][_0x3b9331[_0x210c('0x23')]]){if(this[_0x210c('0xa')][_0x3b9331['uniqueid']][_0x210c('0x33')](_0x16733e)){if(_0x3b9331[_0x210c('0x24')]===_0x16733e){this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x34')]=moment()['format'](_0x210c('0x26'));this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x35')]=_0x210c('0x36');this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x37')]=_0x3b9331[_0x210c('0x37')];this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x38')]=_0x3b9331['connectedlinenum'];this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x39')]=_0x3b9331['connectedlinename'];this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x3a')]=_0x3b9331[_0x210c('0x3a')];this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x3b')]=_0x3b9331[_0x210c('0x3b')];_[_0x210c('0x2b')](this[_0x210c('0xc')][_0x3b9331[_0x210c('0x3c')]],_['pick'](_0x3b9331,['queue',_0x210c('0x3d')]));this[_0x210c('0x20')](util[_0x210c('0x25')](_0x210c('0x2e'),_0x3b9331[_0x210c('0x2f')]),_0x210c('0x3e'),this['channels'][_0x3b9331['uniqueid']][_0x3b9331[_0x210c('0x24')]]);ami[_0x210c('0x20')](_0x210c('0x3f'),this['channels'][_0x3b9331[_0x210c('0x23')]][_0x16733e]);}else if(!this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e]['agentringnoanswer']&&!this[_0x210c('0xa')][_0x3b9331['uniqueid']][_0x16733e][_0x210c('0x15')]){this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x40')]=!![];this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x41')]=moment()[_0x210c('0x25')](_0x210c('0x26'));this['channels'][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x42')]=_0x210c('0x43');this[_0x210c('0xa')][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x35')]=_0x210c('0x43');this[_0x210c('0xa')][_0x3b9331['uniqueid']][_0x16733e]['answeredelsewheredestinationuniqueid']=_0x3b9331[_0x210c('0x24')];this['channels'][_0x3b9331[_0x210c('0x23')]][_0x16733e][_0x210c('0x44')]=_0x3b9331['membername'];ami[_0x210c('0x20')]('custom:agentansweredelsewhere',this[_0x210c('0xa')][_0x3b9331['uniqueid']][_0x16733e]);}}}}}}catch(_0x257256){logger[_0x210c('0x31')]('[syncAgentConnect][VoiceAgentReport]',util[_0x210c('0x32')](_0x257256,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x12')]=function(_0x274863){try{if(this[_0x210c('0x21')](_0x274863)){if(this['channels'][_0x274863[_0x210c('0x23')]]&&this[_0x210c('0xa')][_0x274863[_0x210c('0x23')]][_0x274863['destuniqueid']]){this[_0x210c('0xa')][_0x274863[_0x210c('0x23')]][_0x274863['destuniqueid']][_0x210c('0x40')]=!![];this['channels'][_0x274863[_0x210c('0x23')]][_0x274863[_0x210c('0x24')]]['agentringnoanswerAt']=moment()[_0x210c('0x25')](_0x210c('0x26'));this['channels'][_0x274863[_0x210c('0x23')]][_0x274863[_0x210c('0x24')]]['reason']=_0x210c('0x45');this[_0x210c('0xa')][_0x274863['uniqueid']][_0x274863[_0x210c('0x24')]][_0x210c('0x35')]='rejected';ami[_0x210c('0x20')](_0x210c('0x46'),this[_0x210c('0xa')][_0x274863[_0x210c('0x23')]][_0x274863[_0x210c('0x24')]]);}}}catch(_0x19ca4d){logger[_0x210c('0x31')](_0x210c('0x47'),util[_0x210c('0x32')](_0x19ca4d,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x210c('0x14')]=function(_0x408b9e){try{if(this[_0x210c('0x21')](_0x408b9e)){if(this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]]){for(var _0xaaa921 in this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]]){if(this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0x210c('0x33')](_0xaaa921)&&!this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0xaaa921][_0x210c('0x40')]&&!this['channels'][_0x408b9e[_0x210c('0x23')]][_0xaaa921][_0x210c('0x15')]){this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0xaaa921][_0x210c('0x40')]=!![];this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0xaaa921][_0x210c('0x41')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x408b9e['uniqueid']][_0xaaa921][_0x210c('0x42')]=_0x210c('0x48');this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0xaaa921]['lastevent']=_0x210c('0x48');ami[_0x210c('0x20')](_0x210c('0x49'),this[_0x210c('0xa')][_0x408b9e[_0x210c('0x23')]][_0xaaa921]);}}}}}catch(_0x278aab){logger[_0x210c('0x31')](_0x210c('0x4a'),util[_0x210c('0x32')](_0x278aab,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x4b')]=function(_0x299cd7){try{if(this[_0x210c('0x21')](_0x299cd7)){if(this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]]){for(var _0x1a54e1 in this[_0x210c('0xa')][_0x299cd7['uniqueid']]){if(this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x210c('0x33')](_0x1a54e1)){if(this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x34')]&&!this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x15')]){this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x15')]=!![];this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1]['agentcompleteAt']=moment()[_0x210c('0x25')](_0x210c('0x26'));this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x35')]='complete';this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x4c')]=_0x299cd7['talktime'];this[_0x210c('0xa')][_0x299cd7['uniqueid']][_0x1a54e1][_0x210c('0x42')]=_0x299cd7[_0x210c('0x42')]==_0x210c('0x4d')?_0x210c('0x4e'):_0x299cd7[_0x210c('0x42')];if(this[_0x210c('0xb')][_0x299cd7[_0x210c('0x28')]]&&this['voiceQueues'][_0x299cd7[_0x210c('0x28')]][_0x210c('0x4f')]){this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x50')]=!![];this[_0x210c('0xa')][_0x299cd7[_0x210c('0x23')]][_0x1a54e1][_0x210c('0x51')]=this[_0x210c('0xb')][_0x299cd7[_0x210c('0x28')]]['acwTimeout'];}this[_0x210c('0xc')][_0x299cd7[_0x210c('0x3c')]]=_[_0x210c('0x2c')](this['agents'][_0x299cd7['interface']],[_0x210c('0x28'),_0x210c('0x3d')]);this[_0x210c('0x20')](util[_0x210c('0x25')](_0x210c('0x2e'),_0x299cd7[_0x210c('0x2f')]),_0x210c('0x52'),this['channels'][_0x299cd7[_0x210c('0x23')]][_0x1a54e1]);ami[_0x210c('0x20')](_0x210c('0x53'),this[_0x210c('0xa')][_0x299cd7['uniqueid']][_0x1a54e1]);}}}}}}catch(_0x11220e){logger[_0x210c('0x31')](_0x210c('0x54'),util['inspect'](_0x11220e,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x16')]=function(_0xaf08c2){try{if(this['isNotNull'](_0xaf08c2)){this[_0x210c('0x55')](_0xaf08c2[_0x210c('0x23')],_[_0x210c('0x56')](_0xaf08c2[_0x210c('0x57')])[0x0],_0xaf08c2['value']);if(this[_0x210c('0xa')][_0xaf08c2['uniqueid']]){for(var _0x2070b6 in this['channels'][_0xaf08c2[_0x210c('0x23')]]){if(this[_0x210c('0xa')][_0xaf08c2[_0x210c('0x23')]][_0x210c('0x33')](_0x2070b6)){if(_[_0x210c('0x22')](this[_0x210c('0xa')][_0xaf08c2[_0x210c('0x23')]][_0x2070b6][_0x210c('0xd')])){this[_0x210c('0xa')][_0xaf08c2['uniqueid']][_0x2070b6][_0x210c('0xd')]={};}this['channels'][_0xaf08c2[_0x210c('0x23')]][_0x2070b6]['variables']=this[_0x210c('0xd')][_0xaf08c2[_0x210c('0x23')]];}}}}}catch(_0x3221d8){logger['error'](_0x210c('0x58'),util[_0x210c('0x32')](_0x3221d8,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x55')]=function(_0x164683,_0x52c07d,_0x27a209){var _0x4645c7=['rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter',_0x210c('0x59'),_0x210c('0x5a'),'rtpaudioqoslossbridged',_0x210c('0x5b'),'rtpaudioqosrttbridged',_0x210c('0x5c'),'sipuri','bridgepeer',_0x210c('0x5d'),'membercalls',_0x210c('0x5e'),_0x210c('0x5f'),'memberlastcall','membername',_0x210c('0x60'),_0x210c('0x61')];if(!_[_0x210c('0x62')](_0x52c07d)&&!_['includes'](_0x4645c7,_0x52c07d)){if(_['isUndefined'](this[_0x210c('0xd')][_0x164683])){this[_0x210c('0xd')][_0x164683]={};}this[_0x210c('0xd')][_0x164683][_0x52c07d]=_0x27a209;}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x17')]=function(_0x53be07){try{if(this[_0x210c('0x21')](_0x53be07)){if(this[_0x210c('0xa')][_0x53be07['uniqueid']]){for(var _0x51bdec in this[_0x210c('0xa')][_0x53be07[_0x210c('0x23')]]){if(this[_0x210c('0xa')][_0x53be07['uniqueid']][_0x210c('0x33')](_0x51bdec)){if(this[_0x210c('0xa')][_0x53be07[_0x210c('0x23')]][_0x51bdec]['reason']==_0x210c('0x4d')&&this[_0x210c('0xa')][_0x53be07[_0x210c('0x23')]][_0x51bdec]['agentcomplete']){this[_0x210c('0xa')][_0x53be07[_0x210c('0x23')]][_0x51bdec][_0x210c('0x63')]=moment()[_0x210c('0x25')]('YYYY-MM-DD\x20HH:mm:ss');}}}ami[_0x210c('0x20')](_0x210c('0x64'),_[_0x210c('0x65')](this['channels'][_0x53be07[_0x210c('0x23')]]));delete this[_0x210c('0xa')][_0x53be07['uniqueid']];}if(this['variables'][_0x53be07[_0x210c('0x23')]]){delete this[_0x210c('0xd')][_0x53be07[_0x210c('0x23')]];}}}catch(_0x568cf6){logger[_0x210c('0x31')](_0x210c('0x66'),util[_0x210c('0x32')](_0x568cf6,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x1c')]=function(_0x47b78a){try{if(this['isNotNull'](_0x47b78a)){if(this['channels'][_0x47b78a[_0x210c('0x67')]]){for(var _0x1ffe16 in this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]]){if(this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]]['hasOwnProperty'](_0x1ffe16)){if(_0x47b78a[_0x210c('0x68')]===_0x1ffe16){var _0x1e609e=moment();this[_0x210c('0xa')][_0x47b78a['transfereeuniqueid']][_0x1ffe16]['agentcomplete']=!![];this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]][_0x1ffe16][_0x210c('0x63')]=moment()[_0x210c('0x25')](_0x210c('0x26'));this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]][_0x1ffe16][_0x210c('0x42')]=_0x210c('0x4d');this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]][_0x1ffe16][_0x210c('0x35')]=_0x210c('0x69');this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]][_0x1ffe16][_0x210c('0x4c')]=_0x1e609e[_0x210c('0x6a')](this[_0x210c('0xa')][_0x47b78a[_0x210c('0x67')]][_0x1ffe16][_0x210c('0x34')],'seconds');}}}}if(this[_0x210c('0xa')][_0x47b78a[_0x210c('0x6b')]]){var _0x261257=this[_0x210c('0xa')][_0x47b78a[_0x210c('0x6b')]];this[_0x210c('0xa')][_0x47b78a['secondtransfereruniqueid']]=this[_0x210c('0xa')][_0x47b78a['transfereeuniqueid']];this[_0x210c('0xa')][_0x47b78a['transfereeuniqueid']]=_0x261257;}}}catch(_0x3e1137){logger[_0x210c('0x31')](_0x210c('0x6c'),util[_0x210c('0x32')](_0x3e1137,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x1e')]=function(_0xeaf823){try{if(this[_0x210c('0x21')](_0xeaf823)){if(this[_0x210c('0xa')][_0xeaf823[_0x210c('0x67')]]){for(var _0xb6223b in this[_0x210c('0xa')][_0xeaf823[_0x210c('0x67')]]){if(this[_0x210c('0xa')][_0xeaf823[_0x210c('0x67')]][_0x210c('0x33')](_0xb6223b)){if(_0xeaf823['transfereruniqueid']===_0xb6223b){var _0x48743d=moment();this[_0x210c('0xa')][_0xeaf823[_0x210c('0x67')]][_0xb6223b][_0x210c('0x15')]=!![];this[_0x210c('0xa')][_0xeaf823['transfereeuniqueid']][_0xb6223b][_0x210c('0x63')]=_0x48743d;this[_0x210c('0xa')][_0xeaf823['transfereeuniqueid']][_0xb6223b]['reason']=_0x210c('0x4d');this['channels'][_0xeaf823[_0x210c('0x67')]][_0xb6223b][_0x210c('0x35')]=_0x210c('0x69');this['channels'][_0xeaf823[_0x210c('0x67')]][_0xb6223b][_0x210c('0x4c')]=_0x48743d[_0x210c('0x6a')](this[_0x210c('0xa')][_0xeaf823[_0x210c('0x67')]][_0xb6223b][_0x210c('0x34')],_0x210c('0x6d'));}}}}}}catch(_0x486287){logger[_0x210c('0x31')](_0x210c('0x6e'),util['inspect'](_0x486287,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x19')]=function(_0x2f9146){var _0x18bd02='';try{if(this['isNotNull'](_0x2f9146)){if(_0x2f9146['channel']){_0x18bd02=_0x2f9146['channel'][_0x210c('0x6f')](0x0,_0x2f9146['channel'][_0x210c('0x70')]('-'));if(this['agents'][_0x18bd02]){this['agents'][_0x18bd02][_0x210c('0x71')]=!![];}}}}catch(_0x4dfa9c){logger[_0x210c('0x31')](_0x210c('0x72'),util[_0x210c('0x32')](_0x4dfa9c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x210c('0x1f')][_0x210c('0x1a')]=function(_0x33ef80){var _0x53ec6b='';try{if(this[_0x210c('0x21')](_0x33ef80)){if(_0x33ef80[_0x210c('0x73')]){_0x53ec6b=_0x33ef80[_0x210c('0x73')]['substring'](0x0,_0x33ef80[_0x210c('0x73')][_0x210c('0x70')]('-'));if(this[_0x210c('0xc')][_0x53ec6b]){this[_0x210c('0xc')][_0x53ec6b][_0x210c('0x71')]=![];}}}}catch(_0x3eb783){logger[_0x210c('0x31')](_0x210c('0x74'),util[_0x210c('0x32')](_0x3eb783,{'showHidden':![],'depth':null}));}};module[_0x210c('0x75')]=VoiceAgentReport; \ No newline at end of file +var _0xc076=['agentcompleteAt','complete','diff','seconds','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','transfereruniqueid','[syncBlindTransfer][VoiceAgentReport]','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','syncMusicOnHoldStop','[syncMusicOnHoldStop][VoiceAgentReport]','exports','moment','ioredis','../../../config/environment','../../../config/logger','../ami','redis','localhost','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','varset','hangup','syncHangup','syncMusicOnHoldStart','musiconholdstop','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','channels','uniqueid','destuniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','queue','type','inbound','omit','event','privilege','custom:agentcalled','user:%s','membername','user:called','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','merge','interface','pick','destconnectedlinenum','custom:agentconnect','agentringnoanswerAt','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','error','[syncAgentConnect][VoiceAgentReport]','reason','rejected','custom:agentringnoanswer','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','syncAgentComplete','talktime','transfer','agent','acw','agentacw','acwtime','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','addVariable','keys','variable','value','[syncVarSet][VoiceAgentReport]','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid'];(function(_0x46e363,_0x45d7e2){var _0x3fb059=function(_0x5e6274){while(--_0x5e6274){_0x46e363['push'](_0x46e363['shift']());}};_0x3fb059(++_0x45d7e2);}(_0xc076,0x103));var _0x6c07=function(_0x4e24d1,_0xb74391){_0x4e24d1=_0x4e24d1-0x0;var _0x441332=_0xc076[_0x4e24d1];return _0x441332;};'use strict';var _=require('lodash');var moment=require(_0x6c07('0x0'));var util=require('util');var Redis=require(_0x6c07('0x1'));var config=require(_0x6c07('0x2'));var logger=require(_0x6c07('0x3'))('ami');var ami=require(_0x6c07('0x4'));config[_0x6c07('0x5')]=_['defaults'](config[_0x6c07('0x5')],{'host':_0x6c07('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceAgentReport(_0x5ad94a){this['channels']={};this[_0x6c07('0x7')]=_0x5ad94a['voiceQueues'];this[_0x6c07('0x8')]=_0x5ad94a[_0x6c07('0x8')];this[_0x6c07('0x9')]={};ami['on'](_0x6c07('0xa'),this['syncAgentCalled'][_0x6c07('0xb')](this));ami['on'](_0x6c07('0xc'),this[_0x6c07('0xd')][_0x6c07('0xb')](this));ami['on'](_0x6c07('0xe'),this[_0x6c07('0xf')]['bind'](this));ami['on'](_0x6c07('0x10'),this[_0x6c07('0x11')][_0x6c07('0xb')](this));ami['on'](_0x6c07('0x12'),this['syncAgentComplete'][_0x6c07('0xb')](this));ami['on'](_0x6c07('0x13'),this['syncVarSet'][_0x6c07('0xb')](this));ami['on'](_0x6c07('0x14'),this[_0x6c07('0x15')][_0x6c07('0xb')](this));ami['on']('musiconholdstart',this[_0x6c07('0x16')][_0x6c07('0xb')](this));ami['on'](_0x6c07('0x17'),this['syncMusicOnHoldStop'][_0x6c07('0xb')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x6c07('0xb')](this));ami['on']('blindtransfer',this[_0x6c07('0x18')][_0x6c07('0xb')](this));}VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x1a')]=function(_0x4ec594,_0x5c2755,_0x1dd94a){io['to'](_0x4ec594)[_0x6c07('0x1a')](_0x5c2755,_0x1dd94a);};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x1b')]=function(_0x2da028){return _0x2da028!==null&&!_[_0x6c07('0x1c')](_0x2da028);};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x1d')]=function(_0x33de62){try{if(this[_0x6c07('0x1b')](_0x33de62)){if(_[_0x6c07('0x1c')](this[_0x6c07('0x1e')][_0x33de62[_0x6c07('0x1f')]])){this[_0x6c07('0x1e')][_0x33de62['uniqueid']]={};}if(_[_0x6c07('0x1c')](this[_0x6c07('0x1e')][_0x33de62[_0x6c07('0x1f')]][_0x33de62[_0x6c07('0x20')]])){this[_0x6c07('0x1e')][_0x33de62[_0x6c07('0x1f')]][_0x33de62['destuniqueid']]={'agentcalledAt':moment()[_0x6c07('0x21')](_0x6c07('0x22')),'lastevent':_0x6c07('0x23'),'variables':this[_0x6c07('0x9')][_0x33de62[_0x6c07('0x1f')]],'type':this[_0x6c07('0x7')][_0x33de62[_0x6c07('0x24')]]?this[_0x6c07('0x7')][_0x33de62[_0x6c07('0x24')]][_0x6c07('0x25')]||_0x6c07('0x26'):_0x6c07('0x26')};}_['merge'](this['channels'][_0x33de62[_0x6c07('0x1f')]][_0x33de62[_0x6c07('0x20')]],_[_0x6c07('0x27')](_0x33de62,[_0x6c07('0x28'),_0x6c07('0x29')]));ami[_0x6c07('0x1a')](_0x6c07('0x2a'),this[_0x6c07('0x1e')][_0x33de62[_0x6c07('0x1f')]][_0x33de62[_0x6c07('0x20')]]);this[_0x6c07('0x1a')](util[_0x6c07('0x21')](_0x6c07('0x2b'),_0x33de62[_0x6c07('0x2c')]),_0x6c07('0x2d'),this[_0x6c07('0x1e')][_0x33de62[_0x6c07('0x1f')]][_0x33de62[_0x6c07('0x20')]]);}}catch(_0x5cc1f2){logger['error'](_0x6c07('0x2e'),util[_0x6c07('0x2f')](_0x5cc1f2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')]['syncAgentConnect']=function(_0x1a6984){try{if(this[_0x6c07('0x1b')](_0x1a6984)){if(this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]]){for(var _0x1f0214 in this['channels'][_0x1a6984[_0x6c07('0x1f')]]){if(this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x6c07('0x30')](_0x1f0214)){if(_0x1a6984['destuniqueid']===_0x1f0214){this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]['agentconnectAt']=moment()['format'](_0x6c07('0x22'));this[_0x6c07('0x1e')][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0x31')]=_0x6c07('0x32');this[_0x6c07('0x1e')][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0x33')]=_0x1a6984['holdtime'];this[_0x6c07('0x1e')][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0x34')]=_0x1a6984['connectedlinenum'];this[_0x6c07('0x1e')][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0x35')]=_0x1a6984[_0x6c07('0x35')];this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]['destchannelstate']=_0x1a6984[_0x6c07('0x36')];this['channels'][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]['destchannelstatedesc']=_0x1a6984[_0x6c07('0x37')];_[_0x6c07('0x38')](this[_0x6c07('0x8')][_0x1a6984[_0x6c07('0x39')]],_[_0x6c07('0x3a')](_0x1a6984,[_0x6c07('0x24'),_0x6c07('0x3b')]));this[_0x6c07('0x1a')](util[_0x6c07('0x21')]('user:%s',_0x1a6984['membername']),'user:agentconnect',this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1a6984[_0x6c07('0x20')]]);ami[_0x6c07('0x1a')](_0x6c07('0x3c'),this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]);}else if(!this['channels'][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0xe')]&&!this['channels'][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]['agentcomplete']){this[_0x6c07('0x1e')][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0xe')]=!![];this['channels'][_0x1a6984['uniqueid']][_0x1f0214][_0x6c07('0x3d')]=moment()[_0x6c07('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]['reason']=_0x6c07('0x3e');this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214][_0x6c07('0x31')]=_0x6c07('0x3e');this['channels'][_0x1a6984['uniqueid']][_0x1f0214]['answeredelsewheredestinationuniqueid']=_0x1a6984['destuniqueid'];this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214][_0x6c07('0x3f')]=_0x1a6984[_0x6c07('0x2c')];ami[_0x6c07('0x1a')](_0x6c07('0x40'),this[_0x6c07('0x1e')][_0x1a6984[_0x6c07('0x1f')]][_0x1f0214]);}}}}}}catch(_0x11f7e9){logger[_0x6c07('0x41')](_0x6c07('0x42'),util[_0x6c07('0x2f')](_0x11f7e9,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')]['syncAgentRingNoAnswer']=function(_0x42578b){try{if(this['isNotNull'](_0x42578b)){if(this[_0x6c07('0x1e')][_0x42578b['uniqueid']]&&this[_0x6c07('0x1e')][_0x42578b['uniqueid']][_0x42578b[_0x6c07('0x20')]]){this[_0x6c07('0x1e')][_0x42578b[_0x6c07('0x1f')]][_0x42578b[_0x6c07('0x20')]]['agentringnoanswer']=!![];this[_0x6c07('0x1e')][_0x42578b['uniqueid']][_0x42578b[_0x6c07('0x20')]][_0x6c07('0x3d')]=moment()['format'](_0x6c07('0x22'));this['channels'][_0x42578b['uniqueid']][_0x42578b[_0x6c07('0x20')]][_0x6c07('0x43')]=_0x6c07('0x44');this[_0x6c07('0x1e')][_0x42578b[_0x6c07('0x1f')]][_0x42578b[_0x6c07('0x20')]][_0x6c07('0x31')]=_0x6c07('0x44');ami[_0x6c07('0x1a')](_0x6c07('0x45'),this[_0x6c07('0x1e')][_0x42578b[_0x6c07('0x1f')]][_0x42578b['destuniqueid']]);}}}catch(_0x4f1472){logger[_0x6c07('0x41')](_0x6c07('0x46'),util['inspect'](_0x4f1472,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x11')]=function(_0x4bcdad){try{if(this[_0x6c07('0x1b')](_0x4bcdad)){if(this['channels'][_0x4bcdad[_0x6c07('0x1f')]]){for(var _0x3ce473 in this[_0x6c07('0x1e')][_0x4bcdad['uniqueid']]){if(this[_0x6c07('0x1e')][_0x4bcdad[_0x6c07('0x1f')]][_0x6c07('0x30')](_0x3ce473)&&!this[_0x6c07('0x1e')][_0x4bcdad[_0x6c07('0x1f')]][_0x3ce473][_0x6c07('0xe')]&&!this['channels'][_0x4bcdad['uniqueid']][_0x3ce473][_0x6c07('0x12')]){this[_0x6c07('0x1e')][_0x4bcdad[_0x6c07('0x1f')]][_0x3ce473][_0x6c07('0xe')]=!![];this[_0x6c07('0x1e')][_0x4bcdad[_0x6c07('0x1f')]][_0x3ce473][_0x6c07('0x3d')]=moment()[_0x6c07('0x21')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4bcdad['uniqueid']][_0x3ce473]['reason']=_0x6c07('0x47');this['channels'][_0x4bcdad[_0x6c07('0x1f')]][_0x3ce473][_0x6c07('0x31')]=_0x6c07('0x47');ami[_0x6c07('0x1a')](_0x6c07('0x48'),this['channels'][_0x4bcdad[_0x6c07('0x1f')]][_0x3ce473]);}}}}}catch(_0x40f03d){logger[_0x6c07('0x41')]('[syncQueueCallerAbandon][VoiceAgentReport]',util[_0x6c07('0x2f')](_0x40f03d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x49')]=function(_0x131f8c){try{if(this[_0x6c07('0x1b')](_0x131f8c)){if(this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]]){for(var _0x267e2e in this[_0x6c07('0x1e')][_0x131f8c['uniqueid']]){if(this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x6c07('0x30')](_0x267e2e)){if(this['channels'][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e]['agentconnectAt']&&!this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e][_0x6c07('0x12')]){this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e][_0x6c07('0x12')]=!![];this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e]['agentcompleteAt']=moment()['format'](_0x6c07('0x22'));this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e][_0x6c07('0x31')]='complete';this[_0x6c07('0x1e')][_0x131f8c['uniqueid']][_0x267e2e]['talktime']=_0x131f8c[_0x6c07('0x4a')];this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e][_0x6c07('0x43')]=_0x131f8c['reason']==_0x6c07('0x4b')?_0x6c07('0x4c'):_0x131f8c[_0x6c07('0x43')];if(this[_0x6c07('0x7')][_0x131f8c[_0x6c07('0x24')]]&&this[_0x6c07('0x7')][_0x131f8c[_0x6c07('0x24')]][_0x6c07('0x4d')]){this[_0x6c07('0x1e')][_0x131f8c['uniqueid']][_0x267e2e][_0x6c07('0x4e')]=!![];this[_0x6c07('0x1e')][_0x131f8c['uniqueid']][_0x267e2e][_0x6c07('0x4f')]=this[_0x6c07('0x7')][_0x131f8c['queue']]['acwTimeout'];}this[_0x6c07('0x8')][_0x131f8c['interface']]=_[_0x6c07('0x27')](this[_0x6c07('0x8')][_0x131f8c[_0x6c07('0x39')]],['queue',_0x6c07('0x3b')]);this['emit'](util[_0x6c07('0x21')](_0x6c07('0x2b'),_0x131f8c['membername']),'user:agentcomplete',this[_0x6c07('0x1e')][_0x131f8c['uniqueid']][_0x267e2e]);ami[_0x6c07('0x1a')](_0x6c07('0x50'),this[_0x6c07('0x1e')][_0x131f8c[_0x6c07('0x1f')]][_0x267e2e]);}}}}}}catch(_0x218a79){logger['error'](_0x6c07('0x51'),util['inspect'](_0x218a79,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x6c07('0x52')]=function(_0x34397f){try{if(this[_0x6c07('0x1b')](_0x34397f)){this[_0x6c07('0x53')](_0x34397f['uniqueid'],_[_0x6c07('0x54')](_0x34397f[_0x6c07('0x55')])[0x0],_0x34397f[_0x6c07('0x56')]);if(this[_0x6c07('0x1e')][_0x34397f[_0x6c07('0x1f')]]){for(var _0x39ee14 in this[_0x6c07('0x1e')][_0x34397f['uniqueid']]){if(this[_0x6c07('0x1e')][_0x34397f['uniqueid']]['hasOwnProperty'](_0x39ee14)){if(_[_0x6c07('0x1c')](this[_0x6c07('0x1e')][_0x34397f[_0x6c07('0x1f')]][_0x39ee14]['variables'])){this['channels'][_0x34397f['uniqueid']][_0x39ee14][_0x6c07('0x9')]={};}this['channels'][_0x34397f[_0x6c07('0x1f')]][_0x39ee14][_0x6c07('0x9')]=this[_0x6c07('0x9')][_0x34397f[_0x6c07('0x1f')]];}}}}}catch(_0x2d3ac4){logger['error'](_0x6c07('0x57'),util[_0x6c07('0x2f')](_0x2d3ac4,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x53')]=function(_0x660b7c,_0x23dfe8,_0x30ac7e){var _0x490d83=[_0x6c07('0x58'),_0x6c07('0x59'),_0x6c07('0x5a'),_0x6c07('0x5b'),'rtpaudioqosloss','rtpaudioqoslossbridged',_0x6c07('0x5c'),_0x6c07('0x5d'),_0x6c07('0x5e'),'sipuri',_0x6c07('0x5f'),'bridgepvtcallid',_0x6c07('0x60'),_0x6c07('0x61'),_0x6c07('0x62'),_0x6c07('0x63'),_0x6c07('0x2c'),_0x6c07('0x64'),_0x6c07('0x65')];if(!_['isNil'](_0x23dfe8)&&!_[_0x6c07('0x66')](_0x490d83,_0x23dfe8)){if(_[_0x6c07('0x1c')](this[_0x6c07('0x9')][_0x660b7c])){this[_0x6c07('0x9')][_0x660b7c]={};}this[_0x6c07('0x9')][_0x660b7c][_0x23dfe8]=_0x30ac7e;}};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x15')]=function(_0x29ddf0){try{if(this[_0x6c07('0x1b')](_0x29ddf0)){if(this[_0x6c07('0x1e')][_0x29ddf0[_0x6c07('0x1f')]]){for(var _0x5d5259 in this['channels'][_0x29ddf0[_0x6c07('0x1f')]]){if(this['channels'][_0x29ddf0['uniqueid']]['hasOwnProperty'](_0x5d5259)){if(this[_0x6c07('0x1e')][_0x29ddf0[_0x6c07('0x1f')]][_0x5d5259][_0x6c07('0x43')]==_0x6c07('0x4b')&&this[_0x6c07('0x1e')][_0x29ddf0[_0x6c07('0x1f')]][_0x5d5259][_0x6c07('0x12')]){this['channels'][_0x29ddf0[_0x6c07('0x1f')]][_0x5d5259]['agentcompleteAt']=moment()['format'](_0x6c07('0x22'));}}}ami['emit'](_0x6c07('0x67'),_[_0x6c07('0x68')](this[_0x6c07('0x1e')][_0x29ddf0['uniqueid']]));delete this[_0x6c07('0x1e')][_0x29ddf0['uniqueid']];}if(this[_0x6c07('0x9')][_0x29ddf0['uniqueid']]){delete this[_0x6c07('0x9')][_0x29ddf0['uniqueid']];}}}catch(_0xb6e6dc){logger['error'](_0x6c07('0x69'),util[_0x6c07('0x2f')](_0xb6e6dc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAttendedTransfer']=function(_0x5dbdd0){try{if(this[_0x6c07('0x1b')](_0x5dbdd0)){if(this['channels'][_0x5dbdd0[_0x6c07('0x6a')]]){for(var _0x27d623 in this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]]){if(this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]][_0x6c07('0x30')](_0x27d623)){if(_0x5dbdd0['origtransfereruniqueid']===_0x27d623){var _0x1bf321=moment();this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]][_0x27d623][_0x6c07('0x12')]=!![];this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]][_0x27d623][_0x6c07('0x6b')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x5dbdd0[_0x6c07('0x6a')]][_0x27d623][_0x6c07('0x43')]='transfer';this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]][_0x27d623][_0x6c07('0x31')]=_0x6c07('0x6c');this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]][_0x27d623][_0x6c07('0x4a')]=_0x1bf321[_0x6c07('0x6d')](this['channels'][_0x5dbdd0['transfereeuniqueid']][_0x27d623]['agentconnectAt'],_0x6c07('0x6e'));}}}}if(this['channels'][_0x5dbdd0[_0x6c07('0x6f')]]){var _0x5f5485=this['channels'][_0x5dbdd0[_0x6c07('0x6f')]];this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6f')]]=this[_0x6c07('0x1e')][_0x5dbdd0['transfereeuniqueid']];this[_0x6c07('0x1e')][_0x5dbdd0[_0x6c07('0x6a')]]=_0x5f5485;}}}catch(_0x453366){logger[_0x6c07('0x41')](_0x6c07('0x70'),util['inspect'](_0x453366,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')]['syncBlindTransfer']=function(_0x528e3b){try{if(this[_0x6c07('0x1b')](_0x528e3b)){if(this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]]){for(var _0x295af6 in this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]]){if(this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]][_0x6c07('0x30')](_0x295af6)){if(_0x528e3b[_0x6c07('0x71')]===_0x295af6){var _0x76398c=moment();this['channels'][_0x528e3b[_0x6c07('0x6a')]][_0x295af6][_0x6c07('0x12')]=!![];this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]][_0x295af6][_0x6c07('0x6b')]=_0x76398c;this[_0x6c07('0x1e')][_0x528e3b['transfereeuniqueid']][_0x295af6][_0x6c07('0x43')]=_0x6c07('0x4b');this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]][_0x295af6][_0x6c07('0x31')]=_0x6c07('0x6c');this[_0x6c07('0x1e')][_0x528e3b[_0x6c07('0x6a')]][_0x295af6][_0x6c07('0x4a')]=_0x76398c[_0x6c07('0x6d')](this['channels'][_0x528e3b[_0x6c07('0x6a')]][_0x295af6]['agentconnectAt'],'seconds');}}}}}}catch(_0x2bc129){logger[_0x6c07('0x41')](_0x6c07('0x72'),util['inspect'](_0x2bc129,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')]['syncMusicOnHoldStart']=function(_0x435cd8){var _0xcfbfd0='';try{if(this[_0x6c07('0x1b')](_0x435cd8)){if(_0x435cd8['channel']){_0xcfbfd0=_0x435cd8[_0x6c07('0x73')]['substring'](0x0,_0x435cd8['channel'][_0x6c07('0x74')]('-'));if(this['agents'][_0xcfbfd0]){this['agents'][_0xcfbfd0][_0x6c07('0x75')]=!![];}}}}catch(_0x42c313){logger[_0x6c07('0x41')](_0x6c07('0x76'),util[_0x6c07('0x2f')](_0x42c313,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x6c07('0x19')][_0x6c07('0x77')]=function(_0xe78ef9){var _0xd1ad96='';try{if(this[_0x6c07('0x1b')](_0xe78ef9)){if(_0xe78ef9[_0x6c07('0x73')]){_0xd1ad96=_0xe78ef9[_0x6c07('0x73')]['substring'](0x0,_0xe78ef9['channel'][_0x6c07('0x74')]('-'));if(this['agents'][_0xd1ad96]){this[_0x6c07('0x8')][_0xd1ad96][_0x6c07('0x75')]=![];}}}}catch(_0x4a34bf){logger[_0x6c07('0x41')](_0x6c07('0x78'),util[_0x6c07('0x2f')](_0x4a34bf,{'showHidden':![],'depth':null}));}};module[_0x6c07('0x79')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index 4e4155d..bbc957c 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 _0xbdf4=['syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','isUndefined','prototype','emit','isNotNull','uniqueid','linkedid','merge','keys','[syncNewCallerId][VoiceCallReport]','inspect','channel','OutgoingSpoolFailed','starttime','format','YYYY-MM-DD\x20HH:mm:ss','channelstate','split','destconnectedlinenum','exten','user:%s','accountcode','error','[syncNewChannel][VoiceCallReport]','application','toLowerCase','duration','seconds','disposition','pick','lastapplication','lastdata','cdr(','applicationdata','match','answered','answertime','holdtime','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','destinationchannel','UserId','membername','name','syncMixMonitorFilename','monitor','endsWith','.wav49','replace','.WAV','monitorFilename','monitors','isNil','push','variable','mixmonitor_filename','value','xmd-phone','xmd-callerid','callerid','type','originatecalleridnum','xmd-destination','destination','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','parse','[syncVarSet][VoiceCallReport]','diff','billableseconds','context','from-sip','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransferercalleridnum','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','transfereecalleridnum','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','[syncMusicOnHoldStop][VoiceCallReport]','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','ami','../ami','unknown','not_inuse','inuse','busy','invalid','ringing','ringinuse','onhold','set','queue','agi','dial','playback','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','localhost','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncVarSet','syncHangup','syncNewCallerId','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','musiconholdstart'];(function(_0x37b8c2,_0x5c48da){var _0x47731d=function(_0x1d061d){while(--_0x1d061d){_0x37b8c2['push'](_0x37b8c2['shift']());}};_0x47731d(++_0x5c48da);}(_0xbdf4,0x199));var _0x4bdf=function(_0x4c440b,_0x3ea627){_0x4c440b=_0x4c440b-0x0;var _0x2d48cf=_0xbdf4[_0x4c440b];return _0x2d48cf;};'use strict';var BPromise=require('bluebird');var _=require(_0x4bdf('0x0'));var moment=require(_0x4bdf('0x1'));var util=require(_0x4bdf('0x2'));var path=require(_0x4bdf('0x3'));var Redis=require(_0x4bdf('0x4'));var config=require(_0x4bdf('0x5'));var logger=require(_0x4bdf('0x6'))(_0x4bdf('0x7'));var ami=require(_0x4bdf('0x8'));var Channel=require('../model/channel');var statusDesc=[_0x4bdf('0x9'),_0x4bdf('0xa'),_0x4bdf('0xb'),_0x4bdf('0xc'),_0x4bdf('0xd'),'unavailable',_0x4bdf('0xe'),_0x4bdf('0xf'),_0x4bdf('0x10')];var applications=[_0x4bdf('0x11'),_0x4bdf('0x12'),_0x4bdf('0x13'),_0x4bdf('0x14'),_0x4bdf('0x15'),'voicemail'];var dispositions=[_0x4bdf('0x16'),_0x4bdf('0x17'),_0x4bdf('0x17'),_0x4bdf('0x16'),'NO\x20ANSWER',_0x4bdf('0x16'),_0x4bdf('0x18'),_0x4bdf('0x19'),_0x4bdf('0x17'),_0x4bdf('0x17'),_0x4bdf('0x17')];var actions={};config[_0x4bdf('0x1a')]=_['defaults'](config['redis'],{'host':_0x4bdf('0x1b'),'port':0x18eb});var io=require(_0x4bdf('0x1c'))(new Redis(config[_0x4bdf('0x1a')]));function VoiceCallReport(_0x5467f6){this[_0x4bdf('0x1d')]=_0x5467f6['channels'];this[_0x4bdf('0x1e')]=_0x5467f6[_0x4bdf('0x1e')];ami['on'](_0x4bdf('0x1f'),this[_0x4bdf('0x20')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x22'),this['syncNewExten'][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x23'),this[_0x4bdf('0x24')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x25'),this[_0x4bdf('0x26')][_0x4bdf('0x21')](this));ami['on']('varset',this[_0x4bdf('0x27')][_0x4bdf('0x21')](this));ami['on']('hangup',this[_0x4bdf('0x28')][_0x4bdf('0x21')](this));ami['on']('newcallerid',this[_0x4bdf('0x29')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x2a'),this[_0x4bdf('0x2b')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x2c'),this[_0x4bdf('0x2d')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x2e'),this[_0x4bdf('0x2f')][_0x4bdf('0x21')](this));ami['on'](_0x4bdf('0x30'),this[_0x4bdf('0x31')][_0x4bdf('0x21')](this));return BPromise[_0x4bdf('0x32')]()[_0x4bdf('0x33')](ami[_0x4bdf('0x34')]())[_0x4bdf('0x35')](function(_0x5130d6){console[_0x4bdf('0x36')](_0x5130d6);});}VoiceCallReport['prototype']['isNotNull']=function(_0x31920a){return _0x31920a!==null&&!_[_0x4bdf('0x37')](_0x31920a);};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x39')]=function(_0x3e5988,_0x4ca4c3,_0x104d1f){io['to'](_0x3e5988)[_0x4bdf('0x39')](_0x4ca4c3,_0x104d1f);};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x29')]=function(_0x54975f){try{if(this[_0x4bdf('0x3a')](_0x54975f)){if(_0x54975f[_0x4bdf('0x3b')]===_0x54975f[_0x4bdf('0x3c')]){if(!_['isUndefined'](this['channels'][_0x54975f['uniqueid']])){_[_0x4bdf('0x3d')](this[_0x4bdf('0x1d')][_0x54975f[_0x4bdf('0x3b')]],_['pick'](_0x54975f,_[_0x4bdf('0x3e')](this[_0x4bdf('0x1d')][_0x54975f[_0x4bdf('0x3b')]])));}}}}catch(_0x255e0f){logger['error'](_0x4bdf('0x3f'),util[_0x4bdf('0x40')](_0x255e0f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x24')]=function(_0x471dab){try{if(this[_0x4bdf('0x3a')](_0x471dab)){if(_0x471dab[_0x4bdf('0x3b')]===_0x471dab['linkedid']&&_0x471dab[_0x4bdf('0x41')]!=_0x4bdf('0x42')){if(_[_0x4bdf('0x37')](this[_0x4bdf('0x1d')][_0x471dab[_0x4bdf('0x3b')]])){this[_0x4bdf('0x1d')][_0x471dab[_0x4bdf('0x3b')]]=new Channel();this[_0x4bdf('0x1d')][_0x471dab[_0x4bdf('0x3b')]][_0x4bdf('0x43')]=moment()[_0x4bdf('0x44')](_0x4bdf('0x45'));this[_0x4bdf('0x1d')][_0x471dab[_0x4bdf('0x3b')]]['disposition']=dispositions[_['toNumber'](_0x471dab[_0x4bdf('0x46')])];_[_0x4bdf('0x3d')](this[_0x4bdf('0x1d')][_0x471dab['uniqueid']],_['pick'](_0x471dab,_[_0x4bdf('0x3e')](this[_0x4bdf('0x1d')][_0x471dab[_0x4bdf('0x3b')]])));if(_0x471dab['context']==='from-sip'){if(this['agents'][_0x471dab[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]){this[_0x4bdf('0x1e')][_0x471dab[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]][_0x4bdf('0x48')]=_0x471dab[_0x4bdf('0x49')];this[_0x4bdf('0x39')](util[_0x4bdf('0x44')](_0x4bdf('0x4a'),this[_0x4bdf('0x1e')][_0x471dab[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]['name']),'user:agentconnect',{'destaccountcode':this[_0x4bdf('0x1e')][_0x471dab[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]][_0x4bdf('0x4b')],'destconnectedlinenum':_0x471dab[_0x4bdf('0x49')]});}}}}}}catch(_0x5b1cfb){logger[_0x4bdf('0x4c')](_0x4bdf('0x4d'),util['inspect'](_0x5b1cfb,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4bdf('0x20')]=function(_0x298541){try{if(this[_0x4bdf('0x3a')](_0x298541)){if(_0x298541[_0x4bdf('0x3b')]===_0x298541[_0x4bdf('0x3c')]&&_0x298541[_0x4bdf('0x49')]!='h'&&_0x298541[_0x4bdf('0x41')]!=_0x4bdf('0x42')){_0x298541[_0x4bdf('0x4e')]=_0x298541[_0x4bdf('0x4e')][_0x4bdf('0x4f')]();_0x298541['applicationdata']=(_0x298541['appdata']||_0x298541['applicationdata'])[_0x4bdf('0x4f')]();if(_[_0x4bdf('0x37')](this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]])){this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]]=new Channel();this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]][_0x4bdf('0x43')]=_0x298541[_0x4bdf('0x50')]?moment()['subtract'](moment[_0x4bdf('0x50')](_0x298541[_0x4bdf('0x50')])['seconds'](),_0x4bdf('0x51'))['format'](_0x4bdf('0x45')):moment()[_0x4bdf('0x44')](_0x4bdf('0x45'));this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]][_0x4bdf('0x52')]=_0x4bdf('0x16');}_[_0x4bdf('0x3d')](this['channels'][_0x298541[_0x4bdf('0x3b')]],_[_0x4bdf('0x53')](_0x298541,_[_0x4bdf('0x3e')](this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]])));if(_['includes'](applications,_0x298541[_0x4bdf('0x4e')])){this['channels'][_0x298541['uniqueid']][_0x4bdf('0x54')]=_0x298541[_0x4bdf('0x4e')];this['channels'][_0x298541[_0x4bdf('0x3b')]][_0x4bdf('0x55')]=_0x298541['applicationdata'];if(_0x298541[_0x4bdf('0x4e')]==='set'&&_['startsWith'](_0x298541['applicationdata'],_0x4bdf('0x56'))){var _0x33edf5=_0x298541[_0x4bdf('0x57')][_0x4bdf('0x47')]('=');var _0x8feb15=_0x33edf5[0x0][_0x4bdf('0x58')](/cdr\((.*)\)/);if(_0x8feb15){this[_0x4bdf('0x1d')][_0x298541[_0x4bdf('0x3b')]][_0x8feb15[0x1]]=_0x33edf5[0x1];}}else if(_0x298541[_0x4bdf('0x4e')]===_0x4bdf('0x12')){this['channels'][_0x298541['uniqueid']]['queue']=_0x298541['applicationdata'][_0x4bdf('0x47')](',')[0x0];}}}}}catch(_0x5f1954){logger[_0x4bdf('0x4c')]('[syncNewExten][VoiceCallReport]',util[_0x4bdf('0x40')](_0x5f1954,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x26')]=function(_0x360dbc){try{if(this[_0x4bdf('0x3a')](_0x360dbc)){if(_0x360dbc[_0x4bdf('0x3b')]!==_0x360dbc[_0x4bdf('0x3c')]){if(this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]]){if(_0x360dbc['channelstate']==='6'){if(!this['channels'][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x59')]){var _0x521cf3=moment();this['channels'][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x59')]=!![];this[_0x4bdf('0x1d')][_0x360dbc['linkedid']][_0x4bdf('0x5a')]=_0x521cf3[_0x4bdf('0x44')](_0x4bdf('0x45'));if(this[_0x4bdf('0x1d')][_0x360dbc['linkedid']][_0x4bdf('0x43')]){this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x5b')]=_0x521cf3['diff'](this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x43')],_0x4bdf('0x51'));}}this['channels'][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x3c')]=_0x360dbc['uniqueid'];if(_0x360dbc[_0x4bdf('0x5c')]!==_0x4bdf('0x5d')){this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x5e')]=_0x360dbc[_0x4bdf('0x5c')];}this[_0x4bdf('0x1d')][_0x360dbc['linkedid']][_0x4bdf('0x5f')]=_0x360dbc[_0x4bdf('0x60')];this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x61')]=_0x360dbc[_0x4bdf('0x41')];this['channels'][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x52')]=dispositions[_['toNumber'](_0x360dbc[_0x4bdf('0x46')])];if(this[_0x4bdf('0x1e')][_0x360dbc[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]){this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x62')]=this[_0x4bdf('0x1e')][_0x360dbc[_0x4bdf('0x41')]['split']('-')[0x0]]['id'];this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3c')]][_0x4bdf('0x63')]=this[_0x4bdf('0x1e')][_0x360dbc[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]][_0x4bdf('0x64')];}}}}else{if(this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3b')]]){if(_0x360dbc[_0x4bdf('0x46')]==='6'){if(this[_0x4bdf('0x1e')][_0x360dbc['channel'][_0x4bdf('0x47')]('-')[0x0]]){this[_0x4bdf('0x1d')][_0x360dbc[_0x4bdf('0x3b')]]['UserId']=this['agents'][_0x360dbc[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]['id'];this['channels'][_0x360dbc[_0x4bdf('0x3b')]]['membername']=this[_0x4bdf('0x1e')][_0x360dbc[_0x4bdf('0x41')]['split']('-')[0x0]][_0x4bdf('0x64')];}}}}}}catch(_0x1bbf0b){logger['error']('[syncNewState][VoiceCallReport]',util[_0x4bdf('0x40')](_0x1bbf0b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x65')]=function(_0x36f408,_0x42acee){if(this[_0x4bdf('0x1d')][_0x36f408]){this[_0x4bdf('0x1d')][_0x36f408][_0x4bdf('0x66')]=!![];if(_[_0x4bdf('0x67')](_0x42acee,_0x4bdf('0x68'))){_0x42acee=_0x42acee[_0x4bdf('0x69')](_0x4bdf('0x68'),_0x4bdf('0x6a'));}this['channels'][_0x36f408][_0x4bdf('0x6b')]=_0x42acee;var _0x5cb1e4=_['find'](this[_0x4bdf('0x1d')][_0x36f408][_0x4bdf('0x6c')],{'filename':_0x42acee});if(_[_0x4bdf('0x6d')](_0x5cb1e4)){this[_0x4bdf('0x1d')][_0x36f408]['monitors'][_0x4bdf('0x6e')]({'filename':_0x42acee,'createdAt':moment()[_0x4bdf('0x44')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':'rec'});}}};VoiceCallReport[_0x4bdf('0x38')]['syncVarSet']=function(_0x50da0c){try{if(this[_0x4bdf('0x3a')](_0x50da0c)){if(this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']]&&_0x50da0c[_0x4bdf('0x41')]!='OutgoingSpoolFailed'){if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')])){if(this['isNotNull'](_0x50da0c['variable'][_0x4bdf('0x70')])){this[_0x4bdf('0x65')](_0x50da0c[_0x4bdf('0x3b')],_0x50da0c[_0x4bdf('0x71')]);}else if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')][_0x4bdf('0x72')])){this[_0x4bdf('0x1d')][_0x50da0c[_0x4bdf('0x3b')]][_0x4bdf('0x5c')]=_0x50da0c[_0x4bdf('0x71')];}else if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')][_0x4bdf('0x73')])){this[_0x4bdf('0x1d')][_0x50da0c[_0x4bdf('0x3b')]][_0x4bdf('0x74')]=_0x50da0c[_0x4bdf('0x71')];}else if(this['isNotNull'](_0x50da0c[_0x4bdf('0x6f')]['xmd-cdrtype'])){this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']][_0x4bdf('0x75')]=_0x50da0c[_0x4bdf('0x71')];}else if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')]['xmd-queue'])){this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']][_0x4bdf('0x12')]=_0x50da0c[_0x4bdf('0x71')][_0x4bdf('0x47')](',')[0x0];}else if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')]['xmd-originatecalleridnum'])){this[_0x4bdf('0x1d')][_0x50da0c[_0x4bdf('0x3b')]][_0x4bdf('0x76')]=_0x50da0c[_0x4bdf('0x71')];}else if(this['isNotNull'](_0x50da0c['variable'][_0x4bdf('0x77')])){this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']][_0x4bdf('0x78')]=_0x50da0c[_0x4bdf('0x71')];}else if(this[_0x4bdf('0x3a')](_0x50da0c['variable'][_0x4bdf('0x79')])){this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']][_0x4bdf('0x7a')]=_0x50da0c[_0x4bdf('0x71')];}else if(this['isNotNull'](_0x50da0c[_0x4bdf('0x6f')]['xmcs-queue'])){this[_0x4bdf('0x1d')][_0x50da0c['uniqueid']][_0x4bdf('0x12')]=_0x50da0c[_0x4bdf('0x71')];}else if(this['isNotNull'](_0x50da0c[_0x4bdf('0x6f')][_0x4bdf('0x7b')])){this['channels'][_0x50da0c['uniqueid']][_0x4bdf('0x7c')]=_0x50da0c[_0x4bdf('0x71')];}}}else if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')][_0x4bdf('0x70')])){if(_0x50da0c['value']){var _0x20d45d=path[_0x4bdf('0x7d')](_0x50da0c['value'])[_0x4bdf('0x64')];this[_0x4bdf('0x65')](_0x20d45d,_0x50da0c[_0x4bdf('0x71')]);}}else if(this['channels'][_0x50da0c[_0x4bdf('0x3c')]]){if(this['isNotNull'](_0x50da0c[_0x4bdf('0x6f')])){if(this[_0x4bdf('0x3a')](_0x50da0c[_0x4bdf('0x6f')][_0x4bdf('0x7b')])){this[_0x4bdf('0x1d')][_0x50da0c['linkedid']]['sipcalllinkedid']=_0x50da0c[_0x4bdf('0x71')];}}}}}catch(_0x5ee802){logger['error'](_0x4bdf('0x7e'),util[_0x4bdf('0x40')](_0x5ee802,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x28')]=function(_0x29a695){try{if(this[_0x4bdf('0x3a')](_0x29a695)){if(this['channels'][_0x29a695[_0x4bdf('0x3b')]]){var _0x35f116=moment();this['channels'][_0x29a695[_0x4bdf('0x3b')]]['endtime']=_0x35f116['format'](_0x4bdf('0x45'));this[_0x4bdf('0x1d')][_0x29a695['uniqueid']][_0x4bdf('0x50')]=_0x35f116[_0x4bdf('0x7f')](this[_0x4bdf('0x1d')][_0x29a695['uniqueid']][_0x4bdf('0x43')],'seconds');if(this[_0x4bdf('0x1d')][_0x29a695[_0x4bdf('0x3b')]][_0x4bdf('0x59')]){this['channels'][_0x29a695['uniqueid']][_0x4bdf('0x80')]=_0x35f116[_0x4bdf('0x7f')](this['channels'][_0x29a695[_0x4bdf('0x3b')]][_0x4bdf('0x5a')],_0x4bdf('0x51'));this[_0x4bdf('0x1d')][_0x29a695[_0x4bdf('0x3b')]][_0x4bdf('0x5b')]=this['channels'][_0x29a695[_0x4bdf('0x3b')]]['duration']-this[_0x4bdf('0x1d')][_0x29a695[_0x4bdf('0x3b')]][_0x4bdf('0x80')];}if(_0x29a695[_0x4bdf('0x81')]===_0x4bdf('0x82')){if(this[_0x4bdf('0x1e')][_0x29a695[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]){this[_0x4bdf('0x1e')][_0x29a695[_0x4bdf('0x41')][_0x4bdf('0x47')]('-')[0x0]]=_[_0x4bdf('0x83')](this[_0x4bdf('0x1e')][_0x29a695[_0x4bdf('0x41')]['split']('-')[0x0]],['destconnectedlinenum']);this[_0x4bdf('0x39')](util['format'](_0x4bdf('0x4a'),this[_0x4bdf('0x1e')][_0x29a695[_0x4bdf('0x41')]['split']('-')[0x0]][_0x4bdf('0x64')]),_0x4bdf('0x84'),{'destaccountcode':this[_0x4bdf('0x1e')][_0x29a695['channel'][_0x4bdf('0x47')]('-')[0x0]]['accountcode']});}}ami[_0x4bdf('0x39')](_0x4bdf('0x85'),this[_0x4bdf('0x1d')][_0x29a695[_0x4bdf('0x3b')]]);delete this[_0x4bdf('0x1d')][_0x29a695[_0x4bdf('0x3b')]];}}}catch(_0x5e4088){logger[_0x4bdf('0x4c')](_0x4bdf('0x86'),util[_0x4bdf('0x40')](_0x5e4088,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x2b')]=function(_0x5f0761){try{if(this[_0x4bdf('0x3a')](_0x5f0761)){if(this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x87')]]){this['channels'][_0x5f0761['transfereeuniqueid']][_0x4bdf('0x88')]=_0x5f0761['origtransferercalleridnum'];this['channels'][_0x5f0761[_0x4bdf('0x87')]][_0x4bdf('0x89')]=_0x5f0761[_0x4bdf('0x8a')];if(this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8b')]]){var _0x3b0856=this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8b')]];this['channels'][_0x5f0761[_0x4bdf('0x8b')]]=this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x87')]];this[_0x4bdf('0x1d')][_0x5f0761['transfereeuniqueid']]=_0x3b0856;}}else if(this['channels'][_0x5f0761[_0x4bdf('0x8c')]]){this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8c')]]['transfercalleridnum']=_0x5f0761[_0x4bdf('0x8d')];this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8c')]][_0x4bdf('0x89')]=_0x5f0761[_0x4bdf('0x8a')];if(this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8e')]]){var _0x3b0856=this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8e')]];this[_0x4bdf('0x1d')][_0x5f0761[_0x4bdf('0x8e')]]=this[_0x4bdf('0x1d')][_0x5f0761['transfertargetuniqueid']];this[_0x4bdf('0x1d')][_0x5f0761['transfertargetuniqueid']]=_0x3b0856;}}}}catch(_0x4957bb){logger[_0x4bdf('0x4c')](_0x4bdf('0x8f'),util[_0x4bdf('0x40')](_0x4957bb,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x2d')]=function(_0x5b4edf){try{if(this[_0x4bdf('0x3a')](_0x5b4edf)){if(this['channels'][_0x5b4edf['transfereeuniqueid']]){this[_0x4bdf('0x1d')][_0x5b4edf[_0x4bdf('0x87')]][_0x4bdf('0x88')]=_0x5b4edf[_0x4bdf('0x90')];this['channels'][_0x5b4edf[_0x4bdf('0x87')]]['transferconnectedlinenum']=_0x5b4edf['extension'];this['syncHangup']({'event':_0x4bdf('0x91'),'uniqueid':_0x5b4edf[_0x4bdf('0x87')],'context':_0x5b4edf[_0x4bdf('0x81')],'channel':_0x5b4edf[_0x4bdf('0x92')]});}}}catch(_0x539fe2){logger['error'](_0x4bdf('0x93'),util[_0x4bdf('0x40')](_0x539fe2,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4bdf('0x2f')]=function(_0xa61530){try{if(this[_0x4bdf('0x3a')](_0xa61530)){if(this[_0x4bdf('0x1d')][_0xa61530['uniqueid']]){if(!_[_0x4bdf('0x6d')](this['channels'][_0xa61530[_0x4bdf('0x3b')]]['answertime'])){this['channels'][_0xa61530[_0x4bdf('0x3b')]][_0x4bdf('0x94')]=moment()[_0x4bdf('0x44')](_0x4bdf('0x45'));}}}}catch(_0x1c0163){logger[_0x4bdf('0x4c')](_0x4bdf('0x95'),util[_0x4bdf('0x40')](_0x1c0163,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4bdf('0x38')][_0x4bdf('0x31')]=function(_0x88a576){try{if(this[_0x4bdf('0x3a')](_0x88a576)){if(this[_0x4bdf('0x1d')][_0x88a576[_0x4bdf('0x3b')]]){if(!_[_0x4bdf('0x6d')](this[_0x4bdf('0x1d')][_0x88a576[_0x4bdf('0x3b')]][_0x4bdf('0x94')])){this[_0x4bdf('0x1d')][_0x88a576[_0x4bdf('0x3b')]][_0x4bdf('0x96')]+=moment()['milliseconds'](0x0)[_0x4bdf('0x7f')](this['channels'][_0x88a576[_0x4bdf('0x3b')]][_0x4bdf('0x94')],'seconds');delete this[_0x4bdf('0x1d')][_0x88a576[_0x4bdf('0x3b')]][_0x4bdf('0x94')];}}}}catch(_0x90f6f2){logger['error'](_0x4bdf('0x97'),util[_0x4bdf('0x40')](_0x90f6f2,{'showHidden':![],'depth':null}));}};module['exports']=VoiceCallReport; \ No newline at end of file +var _0x17fa=['agi','dial','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','socket.io-emitter','channels','agents','coreshowchannel','syncNewExten','newexten','bind','newchannel','newstate','syncNewState','syncVarSet','hangup','syncHangup','newcallerid','blindtransfer','syncBlindTransfer','musiconholdstart','syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','resolve','then','actionCoreShowChannels','catch','log','prototype','isNotNull','isUndefined','emit','syncNewCallerId','uniqueid','linkedid','pick','keys','error','inspect','syncNewChannel','channel','OutgoingSpoolFailed','format','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','channelstate','context','from-sip','split','destconnectedlinenum','exten','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','application','toLowerCase','appdata','starttime','duration','subtract','seconds','merge','includes','lastapplication','lastdata','applicationdata','cdr(','match','[syncNewExten][VoiceCallReport]','answered','diff','calleridnum','xcally-motion-preview','connectedlinenum','calleridname','destinationchannel','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','endsWith','.wav49','replace','.WAV','monitorFilename','find','monitors','isNil','push','rec','variable','mixmonitor_filename','xmd-phone','value','xmd-callerid','xmd-cdrtype','xmd-originatecalleridnum','originatecalleridnum','xmd-callerid-preview','calleridpreview','sipcallid','sipcalluniqueid','sipcalllinkedid','endtime','billableseconds','answertime','holdtime','omit','user:agentcomplete','[syncHangup][VoiceCallReport]','syncAttendedTransfer','transfereeuniqueid','transfercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','mohstarttime','mohtime','milliseconds','exports','bluebird','moment','util','path','ioredis','../../../config/environment','ami','../ami','../model/channel','inuse','busy','unavailable','ringinuse','onhold','set','queue'];(function(_0x14b59c,_0x2b7a1b){var _0x39a791=function(_0x23c834){while(--_0x23c834){_0x14b59c['push'](_0x14b59c['shift']());}};_0x39a791(++_0x2b7a1b);}(_0x17fa,0x89));var _0xa17f=function(_0x51486d,_0x3c6ae4){_0x51486d=_0x51486d-0x0;var _0x490680=_0x17fa[_0x51486d];return _0x490680;};'use strict';var BPromise=require(_0xa17f('0x0'));var _=require('lodash');var moment=require(_0xa17f('0x1'));var util=require(_0xa17f('0x2'));var path=require(_0xa17f('0x3'));var Redis=require(_0xa17f('0x4'));var config=require(_0xa17f('0x5'));var logger=require('../../../config/logger')(_0xa17f('0x6'));var ami=require(_0xa17f('0x7'));var Channel=require(_0xa17f('0x8'));var statusDesc=['unknown','not_inuse',_0xa17f('0x9'),_0xa17f('0xa'),'invalid',_0xa17f('0xb'),'ringing',_0xa17f('0xc'),_0xa17f('0xd')];var applications=[_0xa17f('0xe'),_0xa17f('0xf'),_0xa17f('0x10'),_0xa17f('0x11'),_0xa17f('0x12'),_0xa17f('0x13')];var dispositions=[_0xa17f('0x14'),_0xa17f('0x15'),_0xa17f('0x15'),_0xa17f('0x14'),_0xa17f('0x14'),'NO\x20ANSWER',_0xa17f('0x16'),_0xa17f('0x17'),_0xa17f('0x15'),'FAILED',_0xa17f('0x15')];var actions={};config[_0xa17f('0x18')]=_[_0xa17f('0x19')](config[_0xa17f('0x18')],{'host':'localhost','port':0x18eb});var io=require(_0xa17f('0x1a'))(new Redis(config[_0xa17f('0x18')]));function VoiceCallReport(_0x5ba6dc){this[_0xa17f('0x1b')]=_0x5ba6dc[_0xa17f('0x1b')];this[_0xa17f('0x1c')]=_0x5ba6dc[_0xa17f('0x1c')];ami['on'](_0xa17f('0x1d'),this[_0xa17f('0x1e')]['bind'](this));ami['on'](_0xa17f('0x1f'),this[_0xa17f('0x1e')][_0xa17f('0x20')](this));ami['on'](_0xa17f('0x21'),this['syncNewChannel'][_0xa17f('0x20')](this));ami['on'](_0xa17f('0x22'),this[_0xa17f('0x23')][_0xa17f('0x20')](this));ami['on']('varset',this[_0xa17f('0x24')]['bind'](this));ami['on'](_0xa17f('0x25'),this[_0xa17f('0x26')][_0xa17f('0x20')](this));ami['on'](_0xa17f('0x27'),this['syncNewCallerId'][_0xa17f('0x20')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0xa17f('0x20')](this));ami['on'](_0xa17f('0x28'),this[_0xa17f('0x29')]['bind'](this));ami['on'](_0xa17f('0x2a'),this[_0xa17f('0x2b')][_0xa17f('0x20')](this));ami['on'](_0xa17f('0x2c'),this[_0xa17f('0x2d')]['bind'](this));return BPromise[_0xa17f('0x2e')]()[_0xa17f('0x2f')](ami[_0xa17f('0x30')]())[_0xa17f('0x31')](function(_0x4a6192){console[_0xa17f('0x32')](_0x4a6192);});}VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x34')]=function(_0x237bc7){return _0x237bc7!==null&&!_[_0xa17f('0x35')](_0x237bc7);};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x36')]=function(_0x3e7209,_0x43c319,_0x15b0e2){io['to'](_0x3e7209)['emit'](_0x43c319,_0x15b0e2);};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x37')]=function(_0x3b840c){try{if(this[_0xa17f('0x34')](_0x3b840c)){if(_0x3b840c[_0xa17f('0x38')]===_0x3b840c[_0xa17f('0x39')]){if(!_['isUndefined'](this[_0xa17f('0x1b')][_0x3b840c[_0xa17f('0x38')]])){_['merge'](this[_0xa17f('0x1b')][_0x3b840c[_0xa17f('0x38')]],_[_0xa17f('0x3a')](_0x3b840c,_[_0xa17f('0x3b')](this[_0xa17f('0x1b')][_0x3b840c[_0xa17f('0x38')]])));}}}}catch(_0x48a3fa){logger[_0xa17f('0x3c')]('[syncNewCallerId][VoiceCallReport]',util[_0xa17f('0x3d')](_0x48a3fa,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x3e')]=function(_0x22bdd5){try{if(this[_0xa17f('0x34')](_0x22bdd5)){if(_0x22bdd5[_0xa17f('0x38')]===_0x22bdd5['linkedid']&&_0x22bdd5[_0xa17f('0x3f')]!=_0xa17f('0x40')){if(_[_0xa17f('0x35')](this['channels'][_0x22bdd5['uniqueid']])){this[_0xa17f('0x1b')][_0x22bdd5[_0xa17f('0x38')]]=new Channel();this[_0xa17f('0x1b')][_0x22bdd5[_0xa17f('0x38')]]['starttime']=moment()[_0xa17f('0x41')](_0xa17f('0x42'));this['channels'][_0x22bdd5[_0xa17f('0x38')]][_0xa17f('0x43')]=dispositions[_[_0xa17f('0x44')](_0x22bdd5[_0xa17f('0x45')])];_['merge'](this[_0xa17f('0x1b')][_0x22bdd5[_0xa17f('0x38')]],_[_0xa17f('0x3a')](_0x22bdd5,_['keys'](this['channels'][_0x22bdd5[_0xa17f('0x38')]])));if(_0x22bdd5[_0xa17f('0x46')]===_0xa17f('0x47')){if(this[_0xa17f('0x1c')][_0x22bdd5[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]){this[_0xa17f('0x1c')][_0x22bdd5[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]][_0xa17f('0x49')]=_0x22bdd5[_0xa17f('0x4a')];this[_0xa17f('0x36')](util[_0xa17f('0x41')](_0xa17f('0x4b'),this['agents'][_0x22bdd5[_0xa17f('0x3f')]['split']('-')[0x0]][_0xa17f('0x4c')]),_0xa17f('0x4d'),{'destaccountcode':this[_0xa17f('0x1c')][_0x22bdd5[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]][_0xa17f('0x4e')],'destconnectedlinenum':_0x22bdd5['exten']});}}}}}}catch(_0x4b1dcc){logger[_0xa17f('0x3c')](_0xa17f('0x4f'),util[_0xa17f('0x3d')](_0x4b1dcc,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa17f('0x1e')]=function(_0x547fc4){try{if(this[_0xa17f('0x34')](_0x547fc4)){if(_0x547fc4[_0xa17f('0x38')]===_0x547fc4[_0xa17f('0x39')]&&_0x547fc4[_0xa17f('0x4a')]!='h'&&_0x547fc4['channel']!=_0xa17f('0x40')){_0x547fc4[_0xa17f('0x50')]=_0x547fc4[_0xa17f('0x50')][_0xa17f('0x51')]();_0x547fc4['applicationdata']=(_0x547fc4[_0xa17f('0x52')]||_0x547fc4['applicationdata'])['toLowerCase']();if(_['isUndefined'](this['channels'][_0x547fc4[_0xa17f('0x38')]])){this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]]=new Channel();this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]][_0xa17f('0x53')]=_0x547fc4[_0xa17f('0x54')]?moment()[_0xa17f('0x55')](moment[_0xa17f('0x54')](_0x547fc4[_0xa17f('0x54')])['seconds'](),_0xa17f('0x56'))[_0xa17f('0x41')](_0xa17f('0x42')):moment()[_0xa17f('0x41')](_0xa17f('0x42'));this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]][_0xa17f('0x43')]=_0xa17f('0x14');}_[_0xa17f('0x57')](this['channels'][_0x547fc4[_0xa17f('0x38')]],_[_0xa17f('0x3a')](_0x547fc4,_[_0xa17f('0x3b')](this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]])));if(_[_0xa17f('0x58')](applications,_0x547fc4[_0xa17f('0x50')])){this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]][_0xa17f('0x59')]=_0x547fc4[_0xa17f('0x50')];this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]][_0xa17f('0x5a')]=_0x547fc4[_0xa17f('0x5b')];if(_0x547fc4['application']===_0xa17f('0xe')&&_['startsWith'](_0x547fc4[_0xa17f('0x5b')],_0xa17f('0x5c'))){var _0xdc21b4=_0x547fc4['applicationdata']['split']('=');var _0x38c0b8=_0xdc21b4[0x0][_0xa17f('0x5d')](/cdr\((.*)\)/);if(_0x38c0b8){this[_0xa17f('0x1b')][_0x547fc4[_0xa17f('0x38')]][_0x38c0b8[0x1]]=_0xdc21b4[0x1];}}else if(_0x547fc4[_0xa17f('0x50')]==='queue'){this[_0xa17f('0x1b')][_0x547fc4['uniqueid']]['queue']=_0x547fc4['applicationdata'][_0xa17f('0x48')](',')[0x0];}}}}}catch(_0xded964){logger['error'](_0xa17f('0x5e'),util[_0xa17f('0x3d')](_0xded964,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x23')]=function(_0x4e3018){try{if(this[_0xa17f('0x34')](_0x4e3018)){if(_0x4e3018[_0xa17f('0x38')]!==_0x4e3018[_0xa17f('0x39')]){if(this['channels'][_0x4e3018[_0xa17f('0x39')]]){if(_0x4e3018[_0xa17f('0x45')]==='6'){if(!this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x5f')]){var _0x18a9c6=moment();this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x5f')]=!![];this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]]['answertime']=_0x18a9c6[_0xa17f('0x41')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x53')]){this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]]['holdtime']=_0x18a9c6[_0xa17f('0x60')](this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]]['starttime'],_0xa17f('0x56'));}}this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x39')]=_0x4e3018[_0xa17f('0x38')];if(_0x4e3018[_0xa17f('0x61')]!==_0xa17f('0x62')){this['channels'][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x63')]=_0x4e3018['calleridnum'];}this[_0xa17f('0x1b')][_0x4e3018['linkedid']]['connectedlinename']=_0x4e3018[_0xa17f('0x64')];this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x65')]=_0x4e3018[_0xa17f('0x3f')];this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x43')]=dispositions[_[_0xa17f('0x44')](_0x4e3018['channelstate'])];if(this[_0xa17f('0x1c')][_0x4e3018[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]){this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x66')]=this[_0xa17f('0x1c')][_0x4e3018[_0xa17f('0x3f')]['split']('-')[0x0]]['id'];this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x39')]][_0xa17f('0x67')]=this[_0xa17f('0x1c')][_0x4e3018[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]][_0xa17f('0x4c')];}}}}else{if(this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x38')]]){if(_0x4e3018[_0xa17f('0x45')]==='6'){if(this[_0xa17f('0x1c')][_0x4e3018[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]){this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x38')]][_0xa17f('0x66')]=this[_0xa17f('0x1c')][_0x4e3018[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]['id'];this[_0xa17f('0x1b')][_0x4e3018[_0xa17f('0x38')]]['membername']=this['agents'][_0x4e3018[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]['name'];}}}}}}catch(_0x4404d6){logger[_0xa17f('0x3c')](_0xa17f('0x68'),util[_0xa17f('0x3d')](_0x4404d6,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x69')]=function(_0x496bc9,_0xa3cf7c){if(this[_0xa17f('0x1b')][_0x496bc9]){this[_0xa17f('0x1b')][_0x496bc9]['monitor']=!![];if(_[_0xa17f('0x6a')](_0xa3cf7c,_0xa17f('0x6b'))){_0xa3cf7c=_0xa3cf7c[_0xa17f('0x6c')](_0xa17f('0x6b'),_0xa17f('0x6d'));}this[_0xa17f('0x1b')][_0x496bc9][_0xa17f('0x6e')]=_0xa3cf7c;var _0x1f80f9=_[_0xa17f('0x6f')](this['channels'][_0x496bc9][_0xa17f('0x70')],{'filename':_0xa3cf7c});if(_[_0xa17f('0x71')](_0x1f80f9)){this[_0xa17f('0x1b')][_0x496bc9][_0xa17f('0x70')][_0xa17f('0x72')]({'filename':_0xa3cf7c,'createdAt':moment()['format'](_0xa17f('0x42')),'mixmonitorid':'','status':_0xa17f('0x73')});}}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x24')]=function(_0x3f5b81){try{if(this['isNotNull'](_0x3f5b81)){if(this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]]&&_0x3f5b81[_0xa17f('0x3f')]!=_0xa17f('0x40')){if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')])){if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x75')])){this['syncMixMonitorFilename'](_0x3f5b81['uniqueid'],_0x3f5b81['value']);}else if(this['isNotNull'](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x76')])){this['channels'][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0x61')]=_0x3f5b81[_0xa17f('0x77')];}else if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x78')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]]['callerid']=_0x3f5b81[_0xa17f('0x77')];}else if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x79')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]]['type']=_0x3f5b81[_0xa17f('0x77')];}else if(this['isNotNull'](_0x3f5b81[_0xa17f('0x74')]['xmd-queue'])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0xf')]=_0x3f5b81[_0xa17f('0x77')][_0xa17f('0x48')](',')[0x0];}else if(this['isNotNull'](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x7a')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0x7b')]=_0x3f5b81['value'];}else if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')]['xmd-destination'])){this['channels'][_0x3f5b81['uniqueid']]['destination']=_0x3f5b81[_0xa17f('0x77')];}else if(this[_0xa17f('0x34')](_0x3f5b81['variable'][_0xa17f('0x7c')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0x7d')]=_0x3f5b81[_0xa17f('0x77')];}else if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')]['xmcs-queue'])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0xf')]=_0x3f5b81[_0xa17f('0x77')];}else if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x7e')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x38')]][_0xa17f('0x7f')]=_0x3f5b81[_0xa17f('0x77')];}}}else if(this[_0xa17f('0x34')](_0x3f5b81['variable'][_0xa17f('0x75')])){if(_0x3f5b81[_0xa17f('0x77')]){var _0x2c2c9c=path['parse'](_0x3f5b81[_0xa17f('0x77')])['name'];this[_0xa17f('0x69')](_0x2c2c9c,_0x3f5b81[_0xa17f('0x77')]);}}else if(this['channels'][_0x3f5b81[_0xa17f('0x39')]]){if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')])){if(this[_0xa17f('0x34')](_0x3f5b81[_0xa17f('0x74')][_0xa17f('0x7e')])){this[_0xa17f('0x1b')][_0x3f5b81[_0xa17f('0x39')]][_0xa17f('0x80')]=_0x3f5b81[_0xa17f('0x77')];}}}}}catch(_0x3a0841){logger['error']('[syncVarSet][VoiceCallReport]',util['inspect'](_0x3a0841,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x26')]=function(_0x31c0d8){try{if(this[_0xa17f('0x34')](_0x31c0d8)){if(this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]]){var _0x5f1c42=moment();this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x81')]=_0x5f1c42['format'](_0xa17f('0x42'));this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x54')]=_0x5f1c42[_0xa17f('0x60')](this[_0xa17f('0x1b')][_0x31c0d8['uniqueid']][_0xa17f('0x53')],'seconds');if(this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x5f')]){this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x82')]=_0x5f1c42['diff'](this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x83')],_0xa17f('0x56'));this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x84')]=this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]][_0xa17f('0x54')]-this[_0xa17f('0x1b')][_0x31c0d8['uniqueid']][_0xa17f('0x82')];}if(_0x31c0d8[_0xa17f('0x46')]===_0xa17f('0x47')){if(this[_0xa17f('0x1c')][_0x31c0d8[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]){this[_0xa17f('0x1c')][_0x31c0d8[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]]=_[_0xa17f('0x85')](this['agents'][_0x31c0d8[_0xa17f('0x3f')]['split']('-')[0x0]],[_0xa17f('0x49')]);this[_0xa17f('0x36')](util[_0xa17f('0x41')](_0xa17f('0x4b'),this[_0xa17f('0x1c')][_0x31c0d8[_0xa17f('0x3f')]['split']('-')[0x0]]['name']),_0xa17f('0x86'),{'destaccountcode':this[_0xa17f('0x1c')][_0x31c0d8[_0xa17f('0x3f')][_0xa17f('0x48')]('-')[0x0]][_0xa17f('0x4e')]});}}ami[_0xa17f('0x36')]('custom:voiceCallReport',this[_0xa17f('0x1b')][_0x31c0d8['uniqueid']]);delete this[_0xa17f('0x1b')][_0x31c0d8[_0xa17f('0x38')]];}}}catch(_0x427199){logger['error'](_0xa17f('0x87'),util['inspect'](_0x427199,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xa17f('0x88')]=function(_0x3e9b25){try{if(this['isNotNull'](_0x3e9b25)){if(this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x89')]]){this[_0xa17f('0x1b')][_0x3e9b25['transfereeuniqueid']][_0xa17f('0x8a')]=_0x3e9b25['origtransferercalleridnum'];this['channels'][_0x3e9b25[_0xa17f('0x89')]][_0xa17f('0x8b')]=_0x3e9b25[_0xa17f('0x8c')];if(this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8d')]]){var _0x30ec61=this[_0xa17f('0x1b')][_0x3e9b25['secondtransfereruniqueid']];this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8d')]]=this[_0xa17f('0x1b')][_0x3e9b25['transfereeuniqueid']];this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x89')]]=_0x30ec61;}}else if(this[_0xa17f('0x1b')][_0x3e9b25['transfertargetuniqueid']]){this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8e')]][_0xa17f('0x8a')]=_0x3e9b25['origtransferercalleridnum'];this[_0xa17f('0x1b')][_0x3e9b25['transfertargetuniqueid']][_0xa17f('0x8b')]=_0x3e9b25[_0xa17f('0x8c')];if(this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8f')]]){var _0x30ec61=this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8f')]];this['channels'][_0x3e9b25[_0xa17f('0x8f')]]=this[_0xa17f('0x1b')][_0x3e9b25[_0xa17f('0x8e')]];this[_0xa17f('0x1b')][_0x3e9b25['transfertargetuniqueid']]=_0x30ec61;}}}}catch(_0x667fc1){logger[_0xa17f('0x3c')](_0xa17f('0x90'),util[_0xa17f('0x3d')](_0x667fc1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x29')]=function(_0x1b305d){try{if(this[_0xa17f('0x34')](_0x1b305d)){if(this[_0xa17f('0x1b')][_0x1b305d[_0xa17f('0x89')]]){this[_0xa17f('0x1b')][_0x1b305d[_0xa17f('0x89')]][_0xa17f('0x8a')]=_0x1b305d['transfereecalleridnum'];this[_0xa17f('0x1b')][_0x1b305d[_0xa17f('0x89')]]['transferconnectedlinenum']=_0x1b305d[_0xa17f('0x91')];this['syncHangup']({'event':_0xa17f('0x92'),'uniqueid':_0x1b305d[_0xa17f('0x89')],'context':_0x1b305d[_0xa17f('0x46')],'channel':_0x1b305d[_0xa17f('0x93')]});}}}catch(_0x1aa559){logger[_0xa17f('0x3c')](_0xa17f('0x94'),util['inspect'](_0x1aa559,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x2b')]=function(_0x536071){try{if(this[_0xa17f('0x34')](_0x536071)){if(this[_0xa17f('0x1b')][_0x536071[_0xa17f('0x38')]]){if(!_[_0xa17f('0x71')](this[_0xa17f('0x1b')][_0x536071[_0xa17f('0x38')]][_0xa17f('0x83')])){this['channels'][_0x536071[_0xa17f('0x38')]]['mohstarttime']=moment()[_0xa17f('0x41')]('YYYY-MM-DD\x20HH:mm:ss');}}}}catch(_0x5d853a){logger[_0xa17f('0x3c')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0xa17f('0x3d')](_0x5d853a,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xa17f('0x33')][_0xa17f('0x2d')]=function(_0x8bedeb){try{if(this[_0xa17f('0x34')](_0x8bedeb)){if(this[_0xa17f('0x1b')][_0x8bedeb[_0xa17f('0x38')]]){if(!_['isNil'](this[_0xa17f('0x1b')][_0x8bedeb[_0xa17f('0x38')]][_0xa17f('0x95')])){this[_0xa17f('0x1b')][_0x8bedeb['uniqueid']][_0xa17f('0x96')]+=moment()[_0xa17f('0x97')](0x0)['diff'](this[_0xa17f('0x1b')][_0x8bedeb[_0xa17f('0x38')]][_0xa17f('0x95')],_0xa17f('0x56'));delete this[_0xa17f('0x1b')][_0x8bedeb[_0xa17f('0x38')]][_0xa17f('0x95')];}}}}catch(_0x37ed7a){logger[_0xa17f('0x3c')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xa17f('0x3d')](_0x37ed7a,{'showHidden':![],'depth':null}));}};module[_0xa17f('0x98')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 268802a..0d24970 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 _0x0d23=['outbound','variables','bind','varset','hangup','prototype','isNotNull','emit','syncDialBegin','merge','uniqueid','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','lastIndexOf','omit','privilege','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','syncDialEnd','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','custom:dialconnect','[syncDialEnd][VoiceDialReport]','syncVarSet','addVariable','variable','outboundrouteid','isUndefined','value','[syncVarSet][VoiceDialReport]','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','isNil','syncHangup','endtime','duration','complete','total','answered','holdtime','starttime','seconds','billableseconds','diff','sumDuration','custom:voiceDialReport','custom:dialend','voice_outbound:save','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','voice_outbound_channel:remove','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels'];(function(_0x1b30d4,_0x4c68be){var _0x582c1b=function(_0x5f40bd){while(--_0x5f40bd){_0x1b30d4['push'](_0x1b30d4['shift']());}};_0x582c1b(++_0x4c68be);}(_0x0d23,0xe8));var _0x30d2=function(_0x47616a,_0x5b38cd){_0x47616a=_0x47616a-0x0;var _0x4bc5f5=_0x0d23[_0x47616a];return _0x4bc5f5;};'use strict';var _=require(_0x30d2('0x0'));var moment=require(_0x30d2('0x1'));var util=require(_0x30d2('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x30d2('0x3'))(_0x30d2('0x4'));var ami=require(_0x30d2('0x5'));config[_0x30d2('0x6')]=_['defaults'](config[_0x30d2('0x6')],{'host':_0x30d2('0x7'),'port':0x18eb});var io=require(_0x30d2('0x8'))(new Redis(config[_0x30d2('0x6')]));function VoiceDialReport(_0x49067d){this[_0x30d2('0x9')]=_0x49067d[_0x30d2('0xa')];this[_0x30d2('0xb')]=_0x49067d['outbound'];this[_0x30d2('0xc')]={};ami['on']('dialbegin',this['syncDialBegin'][_0x30d2('0xd')](this));ami['on']('dialend',this['syncDialEnd'][_0x30d2('0xd')](this));ami['on'](_0x30d2('0xe'),this['syncVarSet']['bind'](this));ami['on'](_0x30d2('0xf'),this['syncHangup'][_0x30d2('0xd')](this));}VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x11')]=function(_0x1c3368){return _0x1c3368!==null&&!_['isUndefined'](_0x1c3368);};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x12')]=function(_0x41b3b4,_0x3f3f15,_0x1433ba){io['to'](_0x41b3b4)[_0x30d2('0x12')](_0x3f3f15,_0x1433ba);};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x13')]=function(_0x3499d4){try{if(this[_0x30d2('0x11')](_0x3499d4)){if(this[_0x30d2('0x9')][_0x3499d4['uniqueid']]){_[_0x30d2('0x14')](this[_0x30d2('0x9')][_0x3499d4[_0x30d2('0x15')]],{'starttime':moment()[_0x30d2('0x16')](_0x30d2('0x17')),'lastevent':_0x30d2('0x18'),'interface':_0x3499d4[_0x30d2('0x19')]['substring'](0x0,_0x3499d4[_0x30d2('0x19')]['lastIndexOf']('-')),'membername':_0x3499d4['channel']['substring'](_0x3499d4['channel'][_0x30d2('0x1a')]('/')+0x1,_0x3499d4['channel'][_0x30d2('0x1a')]('-'))},_[_0x30d2('0x1b')](_0x3499d4,['event',_0x30d2('0x1c')]));this[_0x30d2('0x12')](_0x30d2('0x1d'),_0x30d2('0x1e'),this[_0x30d2('0x9')][_0x3499d4[_0x30d2('0x15')]]);ami[_0x30d2('0x12')](_0x30d2('0x1f'),this[_0x30d2('0x9')][_0x3499d4['uniqueid']]);}}}catch(_0x137efb){logger[_0x30d2('0x20')](_0x30d2('0x21'),util[_0x30d2('0x22')](_0x137efb,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x23')]=function(_0x579ad0){try{if(this[_0x30d2('0x11')](_0x579ad0)){if(this[_0x30d2('0x9')][_0x579ad0[_0x30d2('0x15')]]){this['channels'][_0x579ad0[_0x30d2('0x15')]]['dialstatus']=_0x579ad0['dialstatus'];if(_0x579ad0[_0x30d2('0x24')]===_0x30d2('0x25')){this[_0x30d2('0x9')][_0x579ad0[_0x30d2('0x15')]][_0x30d2('0x26')]=_0x579ad0[_0x30d2('0x26')];this[_0x30d2('0x9')][_0x579ad0[_0x30d2('0x15')]][_0x30d2('0x27')]=_0x579ad0[_0x30d2('0x27')];this[_0x30d2('0x9')][_0x579ad0[_0x30d2('0x15')]][_0x30d2('0x28')]=moment()[_0x30d2('0x16')](_0x30d2('0x17'));this['channels'][_0x579ad0['uniqueid']][_0x30d2('0x29')]='connect';ami[_0x30d2('0x12')](_0x30d2('0x2a'),this['channels'][_0x579ad0[_0x30d2('0x15')]]);}this['emit'](_0x30d2('0x1d'),_0x30d2('0x1e'),this[_0x30d2('0x9')][_0x579ad0[_0x30d2('0x15')]]);}}}catch(_0x4ba3b7){logger[_0x30d2('0x20')](_0x30d2('0x2b'),util[_0x30d2('0x22')](_0x4ba3b7,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x2c')]=function(_0x4f7e49){try{if(this[_0x30d2('0x11')](_0x4f7e49)){this[_0x30d2('0x2d')](_0x4f7e49['uniqueid'],_['keys'](_0x4f7e49['variable'])[0x0],_0x4f7e49['value']);if(this[_0x30d2('0x11')](_0x4f7e49[_0x30d2('0x2e')])&&this[_0x30d2('0x11')](_0x4f7e49[_0x30d2('0x2e')][_0x30d2('0x2f')])){if(_[_0x30d2('0x30')](this[_0x30d2('0x9')][_0x4f7e49[_0x30d2('0x15')]])){this[_0x30d2('0x9')][_0x4f7e49[_0x30d2('0x15')]]={'routeId':_0x4f7e49[_0x30d2('0x31')],'variables':this['variables'][_0x4f7e49[_0x30d2('0x15')]]};this[_0x30d2('0x12')]('voice:outbound',_0x30d2('0x1e'),this[_0x30d2('0x9')][_0x4f7e49[_0x30d2('0x15')]]);}}}}catch(_0x210803){logger[_0x30d2('0x20')](_0x30d2('0x32'),util[_0x30d2('0x22')](_0x210803,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x2d')]=function(_0x20d72b,_0x3e5e30,_0x5886d4){var _0x57963c=['rtpaudioqos',_0x30d2('0x33'),_0x30d2('0x34'),'rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged',_0x30d2('0x35'),_0x30d2('0x36'),'sipcallid','sipuri','bridgepeer',_0x30d2('0x37'),_0x30d2('0x38'),_0x30d2('0x39'),_0x30d2('0x3a'),_0x30d2('0x3b'),_0x30d2('0x3c'),_0x30d2('0x3d'),'memberrealtime'];if(!_[_0x30d2('0x3e')](_0x3e5e30)&&!_['includes'](_0x57963c,_0x3e5e30)){if(_[_0x30d2('0x30')](this[_0x30d2('0xc')][_0x20d72b])){this[_0x30d2('0xc')][_0x20d72b]={};}this[_0x30d2('0xc')][_0x20d72b][_0x3e5e30]=_0x5886d4;}};VoiceDialReport[_0x30d2('0x10')][_0x30d2('0x3f')]=function(_0x140efd){try{if(this[_0x30d2('0x11')](_0x140efd)){if(this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]]){this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x40')]=moment()[_0x30d2('0x16')](_0x30d2('0x17'));this[_0x30d2('0x9')][_0x140efd['uniqueid']][_0x30d2('0x41')]=moment(this['channels'][_0x140efd[_0x30d2('0x15')]]['endtime'])['diff'](this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]]['starttime'],'seconds');this[_0x30d2('0x9')][_0x140efd['uniqueid']]['lastevent']=_0x30d2('0x42');this[_0x30d2('0xb')][_0x30d2('0x43')]+=0x1;if(this['channels'][_0x140efd['uniqueid']][_0x30d2('0x28')]){this['outbound'][_0x30d2('0x44')]+=0x1;this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x45')]=moment(this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x28')])['diff'](this[_0x30d2('0x9')][_0x140efd['uniqueid']][_0x30d2('0x46')],_0x30d2('0x47'));this[_0x30d2('0x9')][_0x140efd['uniqueid']][_0x30d2('0x48')]=moment(this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x40')])[_0x30d2('0x49')](this[_0x30d2('0x9')][_0x140efd['uniqueid']][_0x30d2('0x28')],_0x30d2('0x47'));this['outbound']['sumHoldTime']+=this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x45')]||0x0;this['outbound']['sumBillable']+=this['channels'][_0x140efd[_0x30d2('0x15')]][_0x30d2('0x48')];}this[_0x30d2('0xb')][_0x30d2('0x4a')]+=this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]]['duration'];ami[_0x30d2('0x12')](_0x30d2('0x4b'),this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]]);ami[_0x30d2('0x12')](_0x30d2('0x4c'),this['channels'][_0x140efd[_0x30d2('0x15')]]);this[_0x30d2('0x12')](_0x30d2('0x1d'),_0x30d2('0x4d'),this[_0x30d2('0xb')]);logger['info'](_0x30d2('0x4e'),JSON['stringify'](this[_0x30d2('0x9')][_0x140efd[_0x30d2('0x15')]]));this[_0x30d2('0x12')](_0x30d2('0x1d'),_0x30d2('0x4f'),this['channels'][_0x140efd[_0x30d2('0x15')]]);delete this[_0x30d2('0x9')][_0x140efd['uniqueid']];}if(this[_0x30d2('0xc')][_0x140efd[_0x30d2('0x15')]]){delete this[_0x30d2('0xc')][_0x140efd[_0x30d2('0x15')]];}}}catch(_0x26715e){logger[_0x30d2('0x20')]('[syncHangup][VoiceDialReport]',util[_0x30d2('0x22')](_0x26715e,{'showHidden':![],'depth':null}));}};module[_0x30d2('0x50')]=VoiceDialReport; \ No newline at end of file +var _0x1fc7=['rtpaudioqosjitterbridged','rtpaudioqoslossbridged','sipcallid','sipuri','bridgepvtcallid','membercalls','memberdynamic','memberlastcall','membername','memberpenalty','memberrealtime','includes','duration','diff','starttime','seconds','lastevent','complete','total','answertime','answered','holdtime','billableseconds','endtime','sumHoldTime','sumBillable','custom:voiceDialReport','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','exports','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','dialend','syncDialEnd','varset','syncVarSet','hangup','syncHangup','prototype','isNotNull','emit','uniqueid','merge','YYYY-MM-DD\x20HH:mm:ss','channel','lastIndexOf','substring','omit','event','voice:outbound','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','connectedlinenum','connectedlinename','format','[syncDialEnd][VoiceDialReport]','addVariable','keys','value','variable','isUndefined','[syncVarSet][VoiceDialReport]','rtpaudioqos'];(function(_0x3c4737,_0x2329ec){var _0x2bb926=function(_0x3b9605){while(--_0x3b9605){_0x3c4737['push'](_0x3c4737['shift']());}};_0x2bb926(++_0x2329ec);}(_0x1fc7,0x1ca));var _0x71fc=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0x1fc7[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0x71fc('0x0'));var moment=require(_0x71fc('0x1'));var util=require(_0x71fc('0x2'));var Redis=require(_0x71fc('0x3'));var config=require(_0x71fc('0x4'));var logger=require(_0x71fc('0x5'))(_0x71fc('0x6'));var ami=require(_0x71fc('0x7'));config[_0x71fc('0x8')]=_['defaults'](config[_0x71fc('0x8')],{'host':_0x71fc('0x9'),'port':0x18eb});var io=require(_0x71fc('0xa'))(new Redis(config['redis']));function VoiceDialReport(_0x2c3aa4){this[_0x71fc('0xb')]=_0x2c3aa4[_0x71fc('0xc')];this[_0x71fc('0xd')]=_0x2c3aa4[_0x71fc('0xd')];this[_0x71fc('0xe')]={};ami['on'](_0x71fc('0xf'),this['syncDialBegin'][_0x71fc('0x10')](this));ami['on'](_0x71fc('0x11'),this[_0x71fc('0x12')]['bind'](this));ami['on'](_0x71fc('0x13'),this[_0x71fc('0x14')][_0x71fc('0x10')](this));ami['on'](_0x71fc('0x15'),this[_0x71fc('0x16')][_0x71fc('0x10')](this));}VoiceDialReport[_0x71fc('0x17')][_0x71fc('0x18')]=function(_0x10c780){return _0x10c780!==null&&!_['isUndefined'](_0x10c780);};VoiceDialReport[_0x71fc('0x17')][_0x71fc('0x19')]=function(_0x58ed1c,_0x3f6971,_0x4997b0){io['to'](_0x58ed1c)[_0x71fc('0x19')](_0x3f6971,_0x4997b0);};VoiceDialReport[_0x71fc('0x17')]['syncDialBegin']=function(_0x109fdc){try{if(this[_0x71fc('0x18')](_0x109fdc)){if(this[_0x71fc('0xb')][_0x109fdc[_0x71fc('0x1a')]]){_[_0x71fc('0x1b')](this[_0x71fc('0xb')][_0x109fdc[_0x71fc('0x1a')]],{'starttime':moment()['format'](_0x71fc('0x1c')),'lastevent':'called','interface':_0x109fdc[_0x71fc('0x1d')]['substring'](0x0,_0x109fdc['channel'][_0x71fc('0x1e')]('-')),'membername':_0x109fdc[_0x71fc('0x1d')][_0x71fc('0x1f')](_0x109fdc['channel'][_0x71fc('0x1e')]('/')+0x1,_0x109fdc[_0x71fc('0x1d')][_0x71fc('0x1e')]('-'))},_[_0x71fc('0x20')](_0x109fdc,[_0x71fc('0x21'),'privilege']));this[_0x71fc('0x19')](_0x71fc('0x22'),_0x71fc('0x23'),this[_0x71fc('0xb')][_0x109fdc[_0x71fc('0x1a')]]);ami[_0x71fc('0x19')](_0x71fc('0x24'),this[_0x71fc('0xb')][_0x109fdc[_0x71fc('0x1a')]]);}}}catch(_0x21921b){logger[_0x71fc('0x25')](_0x71fc('0x26'),util[_0x71fc('0x27')](_0x21921b,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x71fc('0x17')]['syncDialEnd']=function(_0x3869eb){try{if(this[_0x71fc('0x18')](_0x3869eb)){if(this['channels'][_0x3869eb['uniqueid']]){this[_0x71fc('0xb')][_0x3869eb[_0x71fc('0x1a')]][_0x71fc('0x28')]=_0x3869eb[_0x71fc('0x28')];if(_0x3869eb[_0x71fc('0x28')]==='ANSWER'){this['channels'][_0x3869eb[_0x71fc('0x1a')]]['connectedlinenum']=_0x3869eb[_0x71fc('0x29')];this[_0x71fc('0xb')][_0x3869eb[_0x71fc('0x1a')]]['connectedlinename']=_0x3869eb[_0x71fc('0x2a')];this[_0x71fc('0xb')][_0x3869eb[_0x71fc('0x1a')]]['answertime']=moment()[_0x71fc('0x2b')](_0x71fc('0x1c'));this[_0x71fc('0xb')][_0x3869eb[_0x71fc('0x1a')]]['lastevent']='connect';ami['emit']('custom:dialconnect',this[_0x71fc('0xb')][_0x3869eb['uniqueid']]);}this[_0x71fc('0x19')](_0x71fc('0x22'),_0x71fc('0x23'),this['channels'][_0x3869eb[_0x71fc('0x1a')]]);}}}catch(_0x56bb68){logger[_0x71fc('0x25')](_0x71fc('0x2c'),util[_0x71fc('0x27')](_0x56bb68,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x71fc('0x17')][_0x71fc('0x14')]=function(_0xfec296){try{if(this[_0x71fc('0x18')](_0xfec296)){this[_0x71fc('0x2d')](_0xfec296['uniqueid'],_[_0x71fc('0x2e')](_0xfec296['variable'])[0x0],_0xfec296[_0x71fc('0x2f')]);if(this[_0x71fc('0x18')](_0xfec296[_0x71fc('0x30')])&&this['isNotNull'](_0xfec296[_0x71fc('0x30')]['outboundrouteid'])){if(_[_0x71fc('0x31')](this['channels'][_0xfec296[_0x71fc('0x1a')]])){this[_0x71fc('0xb')][_0xfec296[_0x71fc('0x1a')]]={'routeId':_0xfec296[_0x71fc('0x2f')],'variables':this[_0x71fc('0xe')][_0xfec296[_0x71fc('0x1a')]]};this[_0x71fc('0x19')](_0x71fc('0x22'),'voice_outbound_channel:save',this[_0x71fc('0xb')][_0xfec296[_0x71fc('0x1a')]]);}}}}catch(_0x268f05){logger[_0x71fc('0x25')](_0x71fc('0x32'),util[_0x71fc('0x27')](_0x268f05,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x71fc('0x17')][_0x71fc('0x2d')]=function(_0x183a82,_0x3b13bb,_0x5243e6){var _0x203fa7=[_0x71fc('0x33'),'rtpaudioqosbridged','rtpaudioqosjitter',_0x71fc('0x34'),'rtpaudioqosloss',_0x71fc('0x35'),'rtpaudioqosrtt','rtpaudioqosrttbridged',_0x71fc('0x36'),_0x71fc('0x37'),'bridgepeer',_0x71fc('0x38'),_0x71fc('0x39'),_0x71fc('0x3a'),'memberinterface',_0x71fc('0x3b'),_0x71fc('0x3c'),_0x71fc('0x3d'),_0x71fc('0x3e')];if(!_['isNil'](_0x3b13bb)&&!_[_0x71fc('0x3f')](_0x203fa7,_0x3b13bb)){if(_[_0x71fc('0x31')](this[_0x71fc('0xe')][_0x183a82])){this[_0x71fc('0xe')][_0x183a82]={};}this[_0x71fc('0xe')][_0x183a82][_0x3b13bb]=_0x5243e6;}};VoiceDialReport['prototype'][_0x71fc('0x16')]=function(_0x256356){try{if(this[_0x71fc('0x18')](_0x256356)){if(this[_0x71fc('0xb')][_0x256356['uniqueid']]){this['channels'][_0x256356[_0x71fc('0x1a')]]['endtime']=moment()['format'](_0x71fc('0x1c'));this['channels'][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x40')]=moment(this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]]['endtime'])[_0x71fc('0x41')](this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x42')],_0x71fc('0x43'));this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x44')]=_0x71fc('0x45');this['outbound'][_0x71fc('0x46')]+=0x1;if(this[_0x71fc('0xb')][_0x256356['uniqueid']][_0x71fc('0x47')]){this[_0x71fc('0xd')][_0x71fc('0x48')]+=0x1;this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x49')]=moment(this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]]['answertime'])[_0x71fc('0x41')](this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x42')],_0x71fc('0x43'));this[_0x71fc('0xb')][_0x256356['uniqueid']][_0x71fc('0x4a')]=moment(this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x4b')])[_0x71fc('0x41')](this['channels'][_0x256356['uniqueid']][_0x71fc('0x47')],_0x71fc('0x43'));this['outbound'][_0x71fc('0x4c')]+=this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x49')]||0x0;this[_0x71fc('0xd')][_0x71fc('0x4d')]+=this[_0x71fc('0xb')][_0x256356['uniqueid']][_0x71fc('0x4a')];}this[_0x71fc('0xd')]['sumDuration']+=this['channels'][_0x256356[_0x71fc('0x1a')]][_0x71fc('0x40')];ami[_0x71fc('0x19')](_0x71fc('0x4e'),this['channels'][_0x256356[_0x71fc('0x1a')]]);ami[_0x71fc('0x19')]('custom:dialend',this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]]);this['emit']('voice:outbound',_0x71fc('0x4f'),this['outbound']);logger[_0x71fc('0x50')](_0x71fc('0x51'),JSON[_0x71fc('0x52')](this[_0x71fc('0xb')][_0x256356['uniqueid']]));this['emit']('voice:outbound',_0x71fc('0x53'),this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]]);delete this[_0x71fc('0xb')][_0x256356[_0x71fc('0x1a')]];}if(this[_0x71fc('0xe')][_0x256356[_0x71fc('0x1a')]]){delete this[_0x71fc('0xe')][_0x256356[_0x71fc('0x1a')]];}}}catch(_0x493480){logger[_0x71fc('0x25')]('[syncHangup][VoiceDialReport]',util[_0x71fc('0x27')](_0x493480,{'showHidden':![],'depth':null}));}};module[_0x71fc('0x54')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 5a850a6..eb82cf1 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 _0xb89f=['redis','defaults','socket.io-emitter','enqueue','tail','finally','sequence','queueReports','agents','channels','queueChannels','voiceQueues','flagQueueSummary','campaigns','variables','syncQueueSummary','bind','queuesummarycomplete','syncQueueSummaryComplete','queuecallerjoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','syncAgentConnect','varset','syncVarSet','syncHangup','fullybooted','musiconholdstart','syncMusicOnHoldStart','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isEmpty','hasOwnProperty','originated','talking','waiting','queueStatusComplete','unlockRR','prototype','clearZombieChannels','switch','isNil','Action','channel','message','error','[voiceQueueReport][checkChannel]','[voiceQueueReport][checkQueueReport]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','emitVoiceQueueChannelRemove','inspect','emit','format','voice:queue:%s','name','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice_queue_channel:remove','strategy','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','total','type','unmanaged','abandoned','Trunk','Interval','voice_queue:save','isNotNull','isUndefined','queues','catch','[queues]','queuesummary','then','queue','toNumber','callers','loggedin','emitVoiceQueueSummary','custom:queuesummary','[syncQueueSummary][VoiceQueueReport]','syncNewExten','syncQueueCallerJoin','uniqueid','inbound','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','keys','push','[syncQueueCallerJoin][VoiceQueueReport]','last','queuecallercomplete','holdtime','originalposition','queuecallerexitreason','ABANDONED','lastAssignedTo','queuecallerleaveAt','connectedlinenum','connectedlinename','emitVoiceQueueChannelSave','[syncQueueCallerLeave][VoiceQueueReport]','[syncAgentConnect][VoiceQueueReport]','membername','queuecallerexit','queuecallerexitAt','transfer','COMPLETED','local/','linkedid','queuecallerjoinAt','add','seconds','transfertype','FORWARD','transferexten','destexten','transferuniqueid','reason','toUpperCase','variable','value','CONTINUE','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberinterface','memberlastcall','memberpenalty','memberrealtime','includes','diff','length','sumBillable','milliseconds','queuecallercompleteAt','lastevent','custom:queuecallerunmanaged','custom:queuecallerabandon','custom:voiceQueueReport','[syncHangup][VoiceQueueReport]','transfereeuniqueid','secondtransfererexten','ATTENDEDTRANSFER','ATTENDED','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceQueueReport]','BLINDTRANSFER','BLIND','extension','BlindTransfer','context','transfererchannel','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','[syncMusicOnHoldStart][VoiceQueueReport]','syncMusicOnHoldStop','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','lodash','moment','bluebird','util','md5','../../../config/logger','ami','../model/queueReport'];(function(_0x20433e,_0x2d9ae6){var _0xae44a7=function(_0x202765){while(--_0x202765){_0x20433e['push'](_0x20433e['shift']());}};_0xae44a7(++_0x2d9ae6);}(_0xb89f,0x182));var _0xfb89=function(_0x82f707,_0x783e1c){_0x82f707=_0x82f707-0x0;var _0x35eb5d=_0xb89f[_0x82f707];return _0x35eb5d;};'use strict';var _=require(_0xfb89('0x0'));var moment=require(_0xfb89('0x1'));var BPromise=require(_0xfb89('0x2'));var util=require(_0xfb89('0x3'));var md5=require(_0xfb89('0x4'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xfb89('0x5'))(_0xfb89('0x6'));var ami=require('../ami');var QueueReport=require(_0xfb89('0x7'));config[_0xfb89('0x8')]=_[_0xfb89('0x9')](config[_0xfb89('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0xfb89('0xa'))(new Redis(config[_0xfb89('0x8')]));var Sequence=function(){};Sequence['prototype'][_0xfb89('0xb')]=function(_0x42d557){this['tail']=this['tail']?this[_0xfb89('0xc')][_0xfb89('0xd')](_0x42d557):_0x42d557();};function VoiceQueueReport(_0x1cd80b){this[_0xfb89('0xe')]=new Sequence();this[_0xfb89('0xf')]={};this[_0xfb89('0x10')]=_0x1cd80b[_0xfb89('0x10')];this[_0xfb89('0x11')]=_0x1cd80b[_0xfb89('0x12')];this[_0xfb89('0x13')]=_0x1cd80b[_0xfb89('0x13')];this[_0xfb89('0x14')]=!![];this['campaigns']=_0x1cd80b[_0xfb89('0x15')];this[_0xfb89('0x16')]={};ami['on']('queuesummary',this[_0xfb89('0x17')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x19'),this[_0xfb89('0x1a')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x1b'),this['syncQueueCallerJoin'][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x1c'),this['syncQueueCallerAbandon']['bind'](this));ami['on'](_0xfb89('0x1d'),this[_0xfb89('0x1e')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x1f'),this[_0xfb89('0x20')][_0xfb89('0x18')](this));ami['on']('agentconnect',this[_0xfb89('0x21')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x22'),this[_0xfb89('0x23')][_0xfb89('0x18')](this));ami['on']('hangup',this[_0xfb89('0x24')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x25'),this['syncFullyBooted'][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x26'),this[_0xfb89('0x27')][_0xfb89('0x18')](this));ami['on']('musiconholdstop',this['syncMusicOnHoldStop']['bind'](this));ami['on'](_0xfb89('0x28'),this[_0xfb89('0x29')][_0xfb89('0x18')](this));ami['on'](_0xfb89('0x2a'),this[_0xfb89('0x2b')][_0xfb89('0x18')](this));this[_0xfb89('0x2c')]();this[_0xfb89('0x2d')]();}function isNotNull(_0x3024d9){return _0x3024d9!==null&&!_['isUndefined'](_0x3024d9);}function clearChannels(_0x1187da){if(!_[_0xfb89('0x2e')](_0x1187da)){for(var _0x3fbeb9 in _0x1187da){if(_0x1187da[_0xfb89('0x2f')](_0x3fbeb9)){delete _0x1187da[_0x3fbeb9];}}}}function clearCampaigns(_0x21bfd5){if(!_[_0xfb89('0x2e')](_0x21bfd5)){for(var _0x13c187 in _0x21bfd5){if(_0x21bfd5['hasOwnProperty'](_0x13c187)){_0x21bfd5[_0x13c187][_0xfb89('0x30')]=0x0;}}}}function clearVoiceQueues(_0x22c23e){if(!_[_0xfb89('0x2e')](_0x22c23e)){for(var _0x4ece37 in _0x22c23e){if(_0x22c23e['hasOwnProperty'](_0x4ece37)){_0x22c23e[_0x4ece37]['originated']=0x0;_0x22c23e[_0x4ece37][_0xfb89('0x31')]=0x0;_0x22c23e[_0x4ece37]['pTalking']=0x0;_0x22c23e[_0x4ece37][_0xfb89('0x32')]=0x0;_0x22c23e[_0x4ece37][_0xfb89('0x33')]=!![];}}}}function clearAgentBooked(_0x4d1cd0){if(!_[_0xfb89('0x2e')](_0x4d1cd0)){for(var _0x5c9d81 in _0x4d1cd0){if(_0x4d1cd0[_0xfb89('0x2f')](_0x5c9d81)){_0x4d1cd0[_0x5c9d81][_0xfb89('0x34')]=!![];}}}}VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x36')]=function(){var _0x3fdf7e=this;for(var _0x443616 in this['channels']){if(this[_0xfb89('0x11')][_0xfb89('0x2f')](_0x443616)&&!this[_0xfb89('0x11')][_0x443616][_0xfb89('0x37')]){this[_0xfb89('0xe')][_0xfb89('0xb')](function(){if(!_[_0xfb89('0x38')](_0x3fdf7e[_0xfb89('0x11')][_0x443616])){return ami[_0xfb89('0x39')]({'action':'status','channel':_0x3fdf7e['channels'][_0x443616][_0xfb89('0x3a')]})['catch'](function(_0x1b8bec){if(_0x1b8bec[_0xfb89('0x3b')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3fdf7e[_0xfb89('0x11')][_0x443616]){delete _0x3fdf7e[_0xfb89('0x11')][_0x443616];logger[_0xfb89('0x3c')](_0xfb89('0x3d'),_0x443616);}if(_0x3fdf7e[_0xfb89('0xf')][_0x443616]){delete _0x3fdf7e['queueReports'][_0x443616];logger[_0xfb89('0x3c')](_0xfb89('0x3e'),_0x443616);}if(_0x3fdf7e['variables'][_0x443616]){delete _0x3fdf7e[_0xfb89('0x16')][_0x443616];logger[_0xfb89('0x3c')]('[voiceQueueReport][checkVariables]',_0x443616);}},0x1f40);}});}});}}};VoiceQueueReport[_0xfb89('0x35')]['syncFullyBooted']=function(){logger[_0xfb89('0x3c')](_0xfb89('0x3f'));clearChannels(this[_0xfb89('0x11')]);this[_0xfb89('0x40')](this[_0xfb89('0xf')]);clearAgentBooked(this[_0xfb89('0x10')]);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this[_0xfb89('0x15')]);};VoiceQueueReport['prototype']['clearQueueReport']=function(_0xf3af9){var _0xeb93f8=this;if(!_[_0xfb89('0x2e')](_0xf3af9)){for(var _0x54e046 in _0xf3af9){if(_0xf3af9[_0xfb89('0x2f')](_0x54e046)){_0xeb93f8[_0xfb89('0x41')](_0xf3af9[_0x54e046]);delete _0xf3af9[_0x54e046];}}}};function loggerCatch(_0xa85baf){return function(_0x34f5aa){logger[_0xfb89('0x3c')](_0xa85baf,util[_0xfb89('0x42')](_0x34f5aa,{'showHidden':![],'depth':null}));};}VoiceQueueReport[_0xfb89('0x35')]['emit']=function(_0x5612ed,_0x1db988,_0x28792c){io['to'](_0x5612ed)['emit'](_0x1db988,_0x28792c);};VoiceQueueReport[_0xfb89('0x35')]['emitVoiceQueueChannelSave']=function(_0x3b030d){this[_0xfb89('0x43')](util[_0xfb89('0x44')](_0xfb89('0x45'),_0x3b030d[_0xfb89('0x46')]),'voice_queue_channel:save',_0x3b030d);};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x41')]=function(_0x5c267f){logger[_0xfb89('0x47')](_0xfb89('0x48'),JSON['stringify'](_0x5c267f));this[_0xfb89('0x43')](util['format'](_0xfb89('0x45'),_0x5c267f['name']),_0xfb89('0x49'),_0x5c267f);};VoiceQueueReport[_0xfb89('0x35')]['emitVoiceQueueSummary']=function(_0x31f764){if(_0x31f764['type']==='inbound'){var _0x2bc067={'id':_0x31f764['id'],'name':_0x31f764[_0xfb89('0x46')],'strategy':_0x31f764[_0xfb89('0x4a')],'answered':_0x31f764[_0xfb89('0x4b')],'available':_0x31f764[_0xfb89('0x4c')],'loggedIn':_0x31f764[_0xfb89('0x4d')],'pTalking':_0x31f764[_0xfb89('0x4e')],'sumBillable':_0x31f764['sumBillable'],'sumDuration':_0x31f764[_0xfb89('0x4f')],'sumHoldTime':_0x31f764[_0xfb89('0x50')]||0x0,'talking':_0x31f764[_0xfb89('0x31')],'total':_0x31f764[_0xfb89('0x51')],'type':_0x31f764[_0xfb89('0x52')],'unmanaged':_0x31f764[_0xfb89('0x53')],'abandoned':_0x31f764[_0xfb89('0x54')],'waiting':_0x31f764[_0xfb89('0x32')]};if(_0x31f764[_0xfb89('0x55')]){_0x2bc067[_0xfb89('0x55')]={'id':_0x31f764[_0xfb89('0x55')]['id'],'name':_0x31f764[_0xfb89('0x55')][_0xfb89('0x46')],'active':_0x31f764[_0xfb89('0x55')]['active'],'callerid':_0x31f764[_0xfb89('0x55')]['callerid']};}if(_0x31f764['Interval']){_0x2bc067['Interval']={'id':_0x31f764[_0xfb89('0x56')]['id'],'name':_0x31f764[_0xfb89('0x56')][_0xfb89('0x46')]};}var _0x35357c=md5(JSON['stringify'](_0x2bc067));if(_0x31f764[_0xfb89('0x4')]!==_0x35357c){_0x31f764['md5']=_0x35357c;this['emit'](util[_0xfb89('0x44')]('voice:queue:%s',_0x2bc067['name']),_0xfb89('0x57'),_0x2bc067);}}};VoiceQueueReport['prototype'][_0xfb89('0x58')]=function(_0x83a56){return _0x83a56!==null&&!_[_0xfb89('0x59')](_0x83a56);};VoiceQueueReport[_0xfb89('0x35')]['loopQueueShow']=function(){var _0x3bffa3=this;setInterval(function(){_0x3bffa3['clearZombieChannels']();ami['Action']({'action':_0xfb89('0x5a')})[_0xfb89('0x5b')](loggerCatch(_0xfb89('0x5c')));},0x2710);};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x2c')]=function(){var _0x40196b=this;setInterval(function(){if(_0x40196b[_0xfb89('0x14')]){return ami['Action']({'action':_0xfb89('0x5d')})[_0xfb89('0x5e')](function(_0x3f97dc){_0x40196b[_0xfb89('0x14')]=![];})[_0xfb89('0x5b')](loggerCatch('[queuesummary]'));}},0x3e8);};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x17')]=function(_0x1985c0){try{if(this[_0xfb89('0x58')](_0x1985c0)&&this[_0xfb89('0x58')](_0x1985c0[_0xfb89('0x5f')])){if(this[_0xfb89('0x13')][_0x1985c0[_0xfb89('0x5f')]]){var _0x124334=_['countBy'](this[_0xfb89('0x11')],'queue')[_0x1985c0[_0xfb89('0x5f')]]||0x0;var _0x242a1c=_0x124334-_0x1985c0['callers'];if(this['voiceQueues'][_0x1985c0[_0xfb89('0x5f')]][_0xfb89('0x32')]!==_[_0xfb89('0x60')](_0x1985c0['callers'])||this[_0xfb89('0x13')][_0x1985c0['queue']]['loggedIn']!==_['toNumber'](_0x1985c0['loggedin'])||this[_0xfb89('0x13')][_0x1985c0['queue']][_0xfb89('0x4c')]!==_['toNumber'](_0x1985c0[_0xfb89('0x4c')])||this['voiceQueues'][_0x1985c0[_0xfb89('0x5f')]][_0xfb89('0x31')]!==_0x242a1c){this[_0xfb89('0x13')][_0x1985c0[_0xfb89('0x5f')]][_0xfb89('0x32')]=_[_0xfb89('0x60')](_0x1985c0[_0xfb89('0x61')]);this['voiceQueues'][_0x1985c0[_0xfb89('0x5f')]][_0xfb89('0x4d')]=_[_0xfb89('0x60')](_0x1985c0['loggedin']);this['voiceQueues'][_0x1985c0['queue']][_0xfb89('0x4c')]=_['toNumber'](_0x1985c0[_0xfb89('0x4c')]);this[_0xfb89('0x13')][_0x1985c0[_0xfb89('0x5f')]][_0xfb89('0x31')]=_0x242a1c>0x0?_0x242a1c:0x0;this['voiceQueues'][_0x1985c0['queue']][_0xfb89('0x31')]=this[_0xfb89('0x13')][_0x1985c0['queue']][_0xfb89('0x31')]>_['toNumber'](_0x1985c0[_0xfb89('0x62')])?_['toNumber'](_0x1985c0['loggedin']):this[_0xfb89('0x13')][_0x1985c0['queue']][_0xfb89('0x31')];this[_0xfb89('0x63')](this['voiceQueues'][_0x1985c0['queue']]);}ami[_0xfb89('0x43')](_0xfb89('0x64'),this['voiceQueues'][_0x1985c0['queue']]);}}}catch(_0x299281){logger[_0xfb89('0x3c')](_0xfb89('0x65'),util[_0xfb89('0x42')](_0x299281,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x1a')]=function(_0x1e6124){this['flagQueueSummary']=!![];};VoiceQueueReport['prototype'][_0xfb89('0x66')]=function(_0x31df7){};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x67')]=function(_0x55669b){try{if(this[_0xfb89('0x58')](_0x55669b)){if(_[_0xfb89('0x59')](this['queueReports'][_0x55669b[_0xfb89('0x68')]])){this[_0xfb89('0xf')][_0x55669b[_0xfb89('0x68')]]=[];this[_0xfb89('0x11')][_0x55669b[_0xfb89('0x68')]]={};}var _0x2eb18c=new QueueReport();_0x2eb18c[_0xfb89('0x46')]=_0x55669b[_0xfb89('0x5f')];_0x2eb18c[_0xfb89('0x52')]=this[_0xfb89('0x13')][_0x2eb18c[_0xfb89('0x46')]]&&this[_0xfb89('0x13')][_0x2eb18c[_0xfb89('0x46')]]['type']?this[_0xfb89('0x13')][_0x2eb18c[_0xfb89('0x46')]]['type']||_0xfb89('0x69'):_0xfb89('0x69');_0x2eb18c['queue']=_0x55669b[_0xfb89('0x5f')];_0x2eb18c['queuecallerjoinAt']=moment()[_0xfb89('0x44')](_0xfb89('0x6a'));_0x2eb18c[_0xfb89('0x6b')]=_0x55669b[_0xfb89('0x6b')];_0x2eb18c['count']=_0x55669b[_0xfb89('0x6c')];_[_0xfb89('0x6d')](_0x2eb18c,_[_0xfb89('0x6e')](_0x55669b,_[_0xfb89('0x6f')](_0x2eb18c)));this[_0xfb89('0xf')][_0x55669b['uniqueid']][_0xfb89('0x70')](_0x2eb18c);this[_0xfb89('0x11')][_0x55669b[_0xfb89('0x68')]]=_0x2eb18c;this['emitVoiceQueueChannelSave'](_0x2eb18c);}}catch(_0x3c754d){logger[_0xfb89('0x3c')](_0xfb89('0x71'),util[_0xfb89('0x42')](_0x3c754d,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')]['syncQueueCallerAbandon']=function(_0x1dd8c2){try{if(this['isNotNull'](_0x1dd8c2)){if(this[_0xfb89('0xf')][_0x1dd8c2[_0xfb89('0x68')]]){var _0x44ecc=_[_0xfb89('0x72')](this[_0xfb89('0xf')][_0x1dd8c2[_0xfb89('0x68')]]);_0x44ecc[_0xfb89('0x73')]=![];_0x44ecc['queuecallercompleteAt']=null;_0x44ecc[_0xfb89('0x74')]=_0x1dd8c2[_0xfb89('0x74')];_0x44ecc[_0xfb89('0x75')]=_0x1dd8c2[_0xfb89('0x75')];_0x44ecc['queuecallerabandon']=!![];_0x44ecc['queuecallerabandonAt']=moment()[_0xfb89('0x44')](_0xfb89('0x6a'));_0x44ecc[_0xfb89('0x76')]=_0xfb89('0x77');_0x44ecc[_0xfb89('0x78')]=null;this[_0xfb89('0x11')][_0x1dd8c2[_0xfb89('0x68')]]=_0x44ecc;this['emitVoiceQueueChannelRemove'](_0x44ecc);}}}catch(_0x1a4bc5){logger[_0xfb89('0x3c')]('[syncQueueCallerAbandon][VoiceQueueReport]',util['inspect'](_0x1a4bc5,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueCallerLeave']=function(_0x54a585){try{if(this[_0xfb89('0x58')](_0x54a585)){if(this[_0xfb89('0xf')][_0x54a585['uniqueid']]){var _0x316f7d=_['last'](this[_0xfb89('0xf')][_0x54a585[_0xfb89('0x68')]]);_0x316f7d[_0xfb89('0x79')]=moment()[_0xfb89('0x44')](_0xfb89('0x6a'));_0x316f7d[_0xfb89('0x7a')]=_0x54a585[_0xfb89('0x7a')];_0x316f7d[_0xfb89('0x7b')]=_0x54a585[_0xfb89('0x7b')];this[_0xfb89('0x11')][_0x54a585[_0xfb89('0x68')]]=_0x316f7d;this[_0xfb89('0x7c')](_0x316f7d);}}}catch(_0x5f57ea){logger['error'](_0xfb89('0x7d'),util[_0xfb89('0x42')](_0x5f57ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x21')]=function(_0x4d69da){try{if(this[_0xfb89('0x58')](_0x4d69da)){if(this[_0xfb89('0xf')][_0x4d69da[_0xfb89('0x68')]]){var _0x11e559=_[_0xfb89('0x72')](this[_0xfb89('0xf')][_0x4d69da[_0xfb89('0x68')]]);_0x11e559['queuecallercomplete']=!![];_0x11e559['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x2cddd3){logger[_0xfb89('0x3c')](_0xfb89('0x7e'),util['inspect'](_0x2cddd3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')]['syncAgentComplete']=function(_0x1413a8){try{if(this[_0xfb89('0x58')](_0x1413a8)){if(this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x68')]]){var _0x3cf65e=_[_0xfb89('0x72')](this[_0xfb89('0xf')][_0x1413a8['uniqueid']]);_0x3cf65e[_0xfb89('0x1c')]=![];_0x3cf65e['queuecallerabandonAt']=null;_0x3cf65e['assigned']=!![];_0x3cf65e[_0xfb89('0x78')]=_0x1413a8[_0xfb89('0x7f')];_0x3cf65e[_0xfb89('0x74')]=_0x1413a8['holdtime'];_0x3cf65e['queuecallercomplete']=!![];_0x3cf65e[_0xfb89('0x80')]=![];_0x3cf65e[_0xfb89('0x81')]=null;if(!_0x3cf65e['transfer']){if(_0x1413a8['reason']==_0xfb89('0x82')){_0x3cf65e[_0xfb89('0x76')]=_0xfb89('0x83');}else{if(_['startsWith'](_0x1413a8['channel']['toLowerCase'](),_0xfb89('0x84'))){if(this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x85')]]){var _0x1f4a9f=_['last'](this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x85')]]);_0x1f4a9f[_0xfb89('0x73')]=![];_0x1f4a9f['queuecallerexit']=!![];_0x1f4a9f[_0xfb89('0x81')]=moment(_0x3cf65e[_0xfb89('0x86')])[_0xfb89('0x87')](_0x1413a8[_0xfb89('0x74')],_0xfb89('0x88'))[_0xfb89('0x44')]('YYYY-MM-DD\x20HH:mm:ss');_0x1f4a9f[_0xfb89('0x76')]='FORWARDTRANSFER';_0x1f4a9f[_0xfb89('0x82')]=!![];_0x1f4a9f[_0xfb89('0x89')]=_0xfb89('0x8a');_0x1f4a9f[_0xfb89('0x8b')]=_0x1413a8[_0xfb89('0x8c')];_0x1f4a9f[_0xfb89('0x8d')]=_0x1413a8[_0xfb89('0x68')];var _0x1ba890=this[_0xfb89('0xf')][_0x1413a8['linkedid']];this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x85')]]=this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x68')]];this[_0xfb89('0xf')][_0x1413a8[_0xfb89('0x68')]]=_0x1ba890;}}else{_0x3cf65e[_0xfb89('0x76')]='COMPLETEDBY'+_0x1413a8[_0xfb89('0x8e')][_0xfb89('0x8f')]();}}}this[_0xfb89('0x11')][_0x1413a8['uniqueid']]=_0x3cf65e;this[_0xfb89('0x41')](_0x3cf65e);}}}catch(_0x3828a0){logger[_0xfb89('0x3c')]('[syncAgentComplete][VoiceQueueReport]',util['inspect'](_0x3828a0,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x23')]=function(_0x2126b9){try{if(this[_0xfb89('0x58')](_0x2126b9)){this['addVariable'](_0x2126b9['uniqueid'],_[_0xfb89('0x6f')](_0x2126b9[_0xfb89('0x90')])[0x0],_0x2126b9[_0xfb89('0x91')]);if(this['queueReports'][_0x2126b9[_0xfb89('0x68')]]){var _0x45ecb2=_[_0xfb89('0x72')](this[_0xfb89('0xf')][_0x2126b9[_0xfb89('0x68')]]);if(_0x45ecb2){if(this[_0xfb89('0x58')](_0x2126b9[_0xfb89('0x90')])&&this[_0xfb89('0x58')](_0x2126b9[_0xfb89('0x90')]['queuestatus'])){switch(_0x2126b9[_0xfb89('0x91')]){case _0xfb89('0x92'):_0x45ecb2['queuecallerexit']=![];_0x45ecb2[_0xfb89('0x81')]=null;break;default:_0x45ecb2[_0xfb89('0x80')]=!![];_0x45ecb2[_0xfb89('0x81')]=moment()[_0xfb89('0x44')](_0xfb89('0x6a'));_0x45ecb2[_0xfb89('0x79')]=moment()[_0xfb89('0x44')](_0xfb89('0x6a'));}_0x45ecb2[_0xfb89('0x1c')]=![];_0x45ecb2['queuecallerabandonAt']=null;_0x45ecb2[_0xfb89('0x76')]=_0x2126b9[_0xfb89('0x91')];this[_0xfb89('0x11')][_0x2126b9[_0xfb89('0x68')]]=_0x45ecb2;this['emitVoiceQueueChannelRemove'](_0x45ecb2);}else if(this[_0xfb89('0x58')](_0x2126b9[_0xfb89('0x90')])&&this['isNotNull'](_0x2126b9['variable']['queueposition'])){if(!_0x45ecb2['queuecallerabandon']){_0x45ecb2[_0xfb89('0x80')]=!![];_0x45ecb2[_0xfb89('0x81')]=moment()['format'](_0xfb89('0x6a'));_0x45ecb2['queuecallerexitreason']=_0xfb89('0x93');_0x45ecb2[_0xfb89('0x79')]=moment()['format'](_0xfb89('0x6a'));this[_0xfb89('0x11')][_0x2126b9[_0xfb89('0x68')]]=_0x45ecb2;}}_0x45ecb2['variables']=this[_0xfb89('0x16')][_0x2126b9[_0xfb89('0x68')]];}}}}catch(_0x573e7e){logger['error'](_0xfb89('0x94'),util['inspect'](_0x573e7e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xfb89('0x35')][_0xfb89('0x95')]=function(_0x558768,_0x394f32,_0x5c4cb1){var _0x1f7359=['rtpaudioqos',_0xfb89('0x96'),_0xfb89('0x97'),_0xfb89('0x98'),_0xfb89('0x99'),_0xfb89('0x9a'),'rtpaudioqosrtt',_0xfb89('0x9b'),_0xfb89('0x9c'),_0xfb89('0x9d'),_0xfb89('0x9e'),_0xfb89('0x9f'),_0xfb89('0xa0'),'memberdynamic',_0xfb89('0xa1'),_0xfb89('0xa2'),_0xfb89('0x7f'),_0xfb89('0xa3'),_0xfb89('0xa4')];if(!_[_0xfb89('0x38')](_0x394f32)&&!_[_0xfb89('0xa5')](_0x1f7359,_0x394f32)){if(_['isUndefined'](this['variables'][_0x558768])){this[_0xfb89('0x16')][_0x558768]={};}this[_0xfb89('0x16')][_0x558768][_0x394f32]=_0x5c4cb1;}};VoiceQueueReport[_0xfb89('0x35')]['syncHangup']=function(_0x5c113b){try{if(this['isNotNull'](_0x5c113b)){if(this[_0xfb89('0xf')][_0x5c113b[_0xfb89('0x68')]]){for(var _0x6b572c=0x0,_0x516796={};_0x6b572c0x0?_0x4c4143:0x0;this[_0x9503('0x14')][_0x4da8a0[_0x9503('0x63')]][_0x9503('0x31')]=this[_0x9503('0x14')][_0x4da8a0[_0x9503('0x63')]][_0x9503('0x31')]>_['toNumber'](_0x4da8a0[_0x9503('0x67')])?_[_0x9503('0x66')](_0x4da8a0[_0x9503('0x67')]):this[_0x9503('0x14')][_0x4da8a0['queue']]['talking'];this[_0x9503('0x4f')](this[_0x9503('0x14')][_0x4da8a0[_0x9503('0x63')]]);}ami[_0x9503('0x47')]('custom:queuesummary',this[_0x9503('0x14')][_0x4da8a0[_0x9503('0x63')]]);}}}catch(_0xbab3ea){logger[_0x9503('0x3e')]('[syncQueueSummary][VoiceQueueReport]',util[_0x9503('0x46')](_0xbab3ea,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9503('0xc')][_0x9503('0x69')]=function(_0x3e28cd){this[_0x9503('0x15')]=!![];};VoiceQueueReport[_0x9503('0xc')][_0x9503('0x6a')]=function(_0x5bbba5){};VoiceQueueReport[_0x9503('0xc')][_0x9503('0x1a')]=function(_0xf31626){try{if(this['isNotNull'](_0xf31626)){if(_[_0x9503('0x2d')](this[_0x9503('0x10')][_0xf31626[_0x9503('0x6b')]])){this[_0x9503('0x10')][_0xf31626[_0x9503('0x6b')]]=[];this['channels'][_0xf31626['uniqueid']]={};}var _0x34688e=new QueueReport();_0x34688e['name']=_0xf31626['queue'];_0x34688e['type']=this['voiceQueues'][_0x34688e[_0x9503('0x49')]]&&this[_0x9503('0x14')][_0x34688e['name']][_0x9503('0x50')]?this[_0x9503('0x14')][_0x34688e[_0x9503('0x49')]][_0x9503('0x50')]||_0x9503('0x6c'):'inbound';_0x34688e['queue']=_0xf31626[_0x9503('0x63')];_0x34688e['queuecallerjoinAt']=moment()[_0x9503('0x5c')](_0x9503('0x6d'));_0x34688e['position']=_0xf31626[_0x9503('0x6e')];_0x34688e['count']=_0xf31626[_0x9503('0x6f')];_[_0x9503('0x70')](_0x34688e,_[_0x9503('0x71')](_0xf31626,_[_0x9503('0x72')](_0x34688e)));this[_0x9503('0x10')][_0xf31626['uniqueid']][_0x9503('0x73')](_0x34688e);this[_0x9503('0x12')][_0xf31626[_0x9503('0x6b')]]=_0x34688e;this[_0x9503('0x48')](_0x34688e);}}catch(_0x43f287){logger['error']('[syncQueueCallerJoin][VoiceQueueReport]',util[_0x9503('0x46')](_0x43f287,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9503('0x1b')]=function(_0x3e13ee){try{if(this[_0x9503('0x5d')](_0x3e13ee)){if(this[_0x9503('0x10')][_0x3e13ee[_0x9503('0x6b')]]){var _0x398d81=_[_0x9503('0x74')](this[_0x9503('0x10')][_0x3e13ee['uniqueid']]);_0x398d81[_0x9503('0x75')]=![];_0x398d81[_0x9503('0x76')]=null;_0x398d81[_0x9503('0x77')]=_0x3e13ee['holdtime'];_0x398d81['originalposition']=_0x3e13ee[_0x9503('0x78')];_0x398d81[_0x9503('0x79')]=!![];_0x398d81[_0x9503('0x7a')]=moment()[_0x9503('0x5c')](_0x9503('0x6d'));_0x398d81['queuecallerexitreason']=_0x9503('0x7b');_0x398d81[_0x9503('0x7c')]=null;this[_0x9503('0x12')][_0x3e13ee[_0x9503('0x6b')]]=_0x398d81;this[_0x9503('0x45')](_0x398d81);}}}catch(_0x65436a){logger[_0x9503('0x3e')](_0x9503('0x7d'),util[_0x9503('0x46')](_0x65436a,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9503('0xc')][_0x9503('0x1d')]=function(_0x5c6ba2){try{if(this[_0x9503('0x5d')](_0x5c6ba2)){if(this[_0x9503('0x10')][_0x5c6ba2[_0x9503('0x6b')]]){var _0x23c783=_[_0x9503('0x74')](this[_0x9503('0x10')][_0x5c6ba2[_0x9503('0x6b')]]);_0x23c783[_0x9503('0x7e')]=moment()[_0x9503('0x5c')](_0x9503('0x6d'));_0x23c783['connectedlinenum']=_0x5c6ba2['connectedlinenum'];_0x23c783[_0x9503('0x7f')]=_0x5c6ba2[_0x9503('0x7f')];this[_0x9503('0x12')][_0x5c6ba2[_0x9503('0x6b')]]=_0x23c783;this[_0x9503('0x48')](_0x23c783);}}}catch(_0x1986fc){logger[_0x9503('0x3e')]('[syncQueueCallerLeave][VoiceQueueReport]',util['inspect'](_0x1986fc,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9503('0x1f')]=function(_0x10cdd5){try{if(this[_0x9503('0x5d')](_0x10cdd5)){if(this[_0x9503('0x10')][_0x10cdd5[_0x9503('0x6b')]]){var _0x5a4cbc=_[_0x9503('0x74')](this[_0x9503('0x10')][_0x10cdd5[_0x9503('0x6b')]]);_0x5a4cbc['queuecallercomplete']=!![];_0x5a4cbc['queuecallerexitreason']='COMPLETEDBYAGENT';}}}catch(_0x5f18e7){logger[_0x9503('0x3e')](_0x9503('0x80'),util['inspect'](_0x5f18e7,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9503('0xc')]['syncAgentComplete']=function(_0x166ab1){try{if(this[_0x9503('0x5d')](_0x166ab1)){if(this[_0x9503('0x10')][_0x166ab1[_0x9503('0x6b')]]){var _0x3857a1=_[_0x9503('0x74')](this[_0x9503('0x10')][_0x166ab1[_0x9503('0x6b')]]);_0x3857a1[_0x9503('0x79')]=![];_0x3857a1[_0x9503('0x7a')]=null;_0x3857a1[_0x9503('0x81')]=!![];_0x3857a1[_0x9503('0x7c')]=_0x166ab1[_0x9503('0x82')];_0x3857a1['holdtime']=_0x166ab1[_0x9503('0x77')];_0x3857a1[_0x9503('0x75')]=!![];_0x3857a1[_0x9503('0x83')]=![];_0x3857a1[_0x9503('0x84')]=null;if(!_0x3857a1[_0x9503('0x85')]){if(_0x166ab1['reason']==_0x9503('0x85')){_0x3857a1['queuecallerexitreason']=_0x9503('0x86');}else{if(_[_0x9503('0x87')](_0x166ab1[_0x9503('0x3b')][_0x9503('0x88')](),_0x9503('0x89'))){if(this[_0x9503('0x10')][_0x166ab1['linkedid']]){var _0x49755c=_[_0x9503('0x74')](this[_0x9503('0x10')][_0x166ab1[_0x9503('0x8a')]]);_0x49755c['queuecallercomplete']=![];_0x49755c['queuecallerexit']=!![];_0x49755c[_0x9503('0x84')]=moment(_0x3857a1[_0x9503('0x8b')])[_0x9503('0x8c')](_0x166ab1[_0x9503('0x77')],'seconds')[_0x9503('0x5c')](_0x9503('0x6d'));_0x49755c[_0x9503('0x8d')]='FORWARDTRANSFER';_0x49755c[_0x9503('0x85')]=!![];_0x49755c[_0x9503('0x8e')]=_0x9503('0x8f');_0x49755c[_0x9503('0x90')]=_0x166ab1[_0x9503('0x91')];_0x49755c[_0x9503('0x92')]=_0x166ab1[_0x9503('0x6b')];var _0x176da5=this[_0x9503('0x10')][_0x166ab1['linkedid']];this['queueReports'][_0x166ab1['linkedid']]=this['queueReports'][_0x166ab1['uniqueid']];this[_0x9503('0x10')][_0x166ab1[_0x9503('0x6b')]]=_0x176da5;}}else{_0x3857a1['queuecallerexitreason']=_0x9503('0x93')+_0x166ab1[_0x9503('0x94')]['toUpperCase']();}}}this['channels'][_0x166ab1['uniqueid']]=_0x3857a1;this[_0x9503('0x45')](_0x3857a1);}}}catch(_0x4eeaae){logger[_0x9503('0x3e')](_0x9503('0x95'),util[_0x9503('0x46')](_0x4eeaae,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0x9503('0x21')]=function(_0x275580){try{if(this[_0x9503('0x5d')](_0x275580)){this[_0x9503('0x96')](_0x275580[_0x9503('0x6b')],_['keys'](_0x275580['variable'])[0x0],_0x275580[_0x9503('0x97')]);if(this[_0x9503('0x10')][_0x275580['uniqueid']]){var _0xeeecb0=_['last'](this['queueReports'][_0x275580[_0x9503('0x6b')]]);if(_0xeeecb0){if(this[_0x9503('0x5d')](_0x275580[_0x9503('0x98')])&&this[_0x9503('0x5d')](_0x275580[_0x9503('0x98')][_0x9503('0x99')])){switch(_0x275580[_0x9503('0x97')]){case _0x9503('0x9a'):_0xeeecb0[_0x9503('0x83')]=![];_0xeeecb0[_0x9503('0x84')]=null;break;default:_0xeeecb0[_0x9503('0x83')]=!![];_0xeeecb0[_0x9503('0x84')]=moment()[_0x9503('0x5c')]('YYYY-MM-DD\x20HH:mm:ss');_0xeeecb0[_0x9503('0x7e')]=moment()[_0x9503('0x5c')](_0x9503('0x6d'));}_0xeeecb0[_0x9503('0x79')]=![];_0xeeecb0[_0x9503('0x7a')]=null;_0xeeecb0[_0x9503('0x8d')]=_0x275580['value'];this[_0x9503('0x12')][_0x275580[_0x9503('0x6b')]]=_0xeeecb0;this[_0x9503('0x45')](_0xeeecb0);}else if(this[_0x9503('0x5d')](_0x275580[_0x9503('0x98')])&&this[_0x9503('0x5d')](_0x275580['variable'][_0x9503('0x9b')])){if(!_0xeeecb0[_0x9503('0x79')]){_0xeeecb0[_0x9503('0x83')]=!![];_0xeeecb0['queuecallerexitAt']=moment()['format'](_0x9503('0x6d'));_0xeeecb0[_0x9503('0x8d')]=_0x9503('0x9c');_0xeeecb0[_0x9503('0x7e')]=moment()[_0x9503('0x5c')](_0x9503('0x6d'));this[_0x9503('0x12')][_0x275580[_0x9503('0x6b')]]=_0xeeecb0;}}_0xeeecb0['variables']=this[_0x9503('0x41')][_0x275580['uniqueid']];}}}}catch(_0x800c40){logger['error'](_0x9503('0x9d'),util[_0x9503('0x46')](_0x800c40,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x9503('0xc')][_0x9503('0x96')]=function(_0x4bef3f,_0x1147ce,_0x596347){var _0xdbf124=[_0x9503('0x9e'),_0x9503('0x9f'),_0x9503('0xa0'),_0x9503('0xa1'),'rtpaudioqosloss',_0x9503('0xa2'),_0x9503('0xa3'),'rtpaudioqosrttbridged','sipcallid',_0x9503('0xa4'),'bridgepeer',_0x9503('0xa5'),_0x9503('0xa6'),_0x9503('0xa7'),'memberinterface',_0x9503('0xa8'),_0x9503('0x82'),_0x9503('0xa9'),_0x9503('0xaa')];if(!_[_0x9503('0x38')](_0x1147ce)&&!_[_0x9503('0xab')](_0xdbf124,_0x1147ce)){if(_['isUndefined'](this[_0x9503('0x41')][_0x4bef3f])){this['variables'][_0x4bef3f]={};}this[_0x9503('0x41')][_0x4bef3f][_0x1147ce]=_0x596347;}};VoiceQueueReport[_0x9503('0xc')][_0x9503('0xac')]=function(_0x9c2d3f){try{if(this[_0x9503('0x5d')](_0x9c2d3f)){if(this['queueReports'][_0x9c2d3f[_0x9503('0x6b')]]){for(var _0x33dc55=0x0,_0x37c1fa={};_0x33dc55=0x0?moment(_0x9e8061[_0x2469('0x1a')])['diff'](_0x9e8061[_0x2469('0x1b')],_0x2469('0x1c')):null,'data1':_0x2469('0x1d'),'data2':_0x9e8061[_0x2469('0x15')],'data3':_0x9e8061[_0x2469('0x13')],'data4':_0x9e8061[_0x2469('0x1e')]||null,'role':_0x2469('0x14'),'internal':_0x9e8061[_0x2469('0x15')]?_['toNumber'](_0x9e8061[_0x2469('0x15')]):undefined,'uniqueid':_0x9e8061[_0x2469('0x17')]},'log':_0x2469('0x7')});}; \ No newline at end of file +var _0x1ea8=['queuecallerexitAt','Request','CreateMemberReport','voice','lastAssignedTo','isNil','interface','format','TALKING','queuecallerleaveAt','diff','seconds','inbound','calleridnum','exten','agent','accountcode','uniqueid','voiceDialReport','membername','starttime','endtime','outbound','dialstring','toNumber','moment','lodash','util','../client','queuecallercompleteAt'];(function(_0x58a4b5,_0x182439){var _0x51821d=function(_0x47c3c5){while(--_0x47c3c5){_0x58a4b5['push'](_0x58a4b5['shift']());}};_0x51821d(++_0x182439);}(_0x1ea8,0x109));var _0x81ea=function(_0x591232,_0x3fdd4b){_0x591232=_0x591232-0x0;var _0x119e89=_0x1ea8[_0x591232];return _0x119e89;};'use strict';var moment=require(_0x81ea('0x0'));var _=require(_0x81ea('0x1'));var util=require(_0x81ea('0x2'));var client=require(_0x81ea('0x3'));exports['voiceQueueReport']=function(_0x4e4001){var _0x5ce84f=_0x4e4001[_0x81ea('0x4')]||_0x4e4001[_0x81ea('0x5')];return client[_0x81ea('0x6')](_0x81ea('0x7'),{'body':{'channel':_0x81ea('0x8'),'membername':_0x4e4001[_0x81ea('0x9')],'interface':_[_0x81ea('0xa')](_0x4e4001[_0x81ea('0xb')])?util[_0x81ea('0xc')]('SIP/%s',_0x4e4001[_0x81ea('0x9')]):_0x4e4001[_0x81ea('0xb')],'type':_0x81ea('0xd'),'enterAt':_0x4e4001[_0x81ea('0xe')],'exitAt':_0x5ce84f,'duration':moment(_0x5ce84f)[_0x81ea('0xf')](_0x4e4001[_0x81ea('0xe')],_0x81ea('0x10')),'data1':_0x81ea('0x11'),'data2':_0x4e4001[_0x81ea('0x12')],'data3':_0x4e4001[_0x81ea('0x13')],'data4':null,'data5':_0x4e4001['queue'],'role':_0x81ea('0x14'),'internal':_0x4e4001[_0x81ea('0x15')]?_['toNumber'](_0x4e4001[_0x81ea('0x15')]):undefined,'uniqueid':_0x4e4001[_0x81ea('0x16')]},'log':_0x81ea('0x7')});};exports[_0x81ea('0x17')]=function(_0x194b37){return client[_0x81ea('0x6')]('CreateMemberReport',{'body':{'channel':_0x81ea('0x8'),'membername':_0x194b37[_0x81ea('0x18')],'interface':_0x194b37[_0x81ea('0xb')],'type':_0x81ea('0xd'),'enterAt':_0x194b37[_0x81ea('0x19')],'exitAt':_0x194b37[_0x81ea('0x1a')],'duration':moment(_0x194b37[_0x81ea('0x1a')])[_0x81ea('0xf')](_0x194b37['starttime'],_0x81ea('0x10'))>=0x0?moment(_0x194b37[_0x81ea('0x1a')])[_0x81ea('0xf')](_0x194b37[_0x81ea('0x19')],_0x81ea('0x10')):null,'data1':_0x81ea('0x1b'),'data2':_0x194b37[_0x81ea('0x15')],'data3':_0x194b37['exten'],'data4':_0x194b37[_0x81ea('0x1c')]||null,'role':'agent','internal':_0x194b37[_0x81ea('0x15')]?_[_0x81ea('0x1d')](_0x194b37[_0x81ea('0x15')]):undefined,'uniqueid':_0x194b37['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index 4005a82..0b9bd59 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 _0x5423=['getTemplates','Request','name','html','GetTemplate','../client'];(function(_0x227ff3,_0x220022){var _0x577052=function(_0x14bb14){while(--_0x14bb14){_0x227ff3['push'](_0x227ff3['shift']());}};_0x577052(++_0x220022);}(_0x5423,0xe3));var _0x3542=function(_0x1bf297,_0x522860){_0x1bf297=_0x1bf297-0x0;var _0x52fff3=_0x5423[_0x1bf297];return _0x52fff3;};'use strict';var client=require(_0x3542('0x0'));exports[_0x3542('0x1')]=function(_0x511bd3){return function(_0x331a98){return client[_0x3542('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x3542('0x3'),_0x3542('0x4')]},'log':_0x3542('0x5')});};}; \ No newline at end of file +var _0x2750=['../client','Request','GetTemplate','name','html'];(function(_0x347962,_0x311384){var _0x12f9b8=function(_0xf2eef4){while(--_0xf2eef4){_0x347962['push'](_0x347962['shift']());}};_0x12f9b8(++_0x311384);}(_0x2750,0x13b));var _0x0275=function(_0x2f02f2,_0x1108c9){_0x2f02f2=_0x2f02f2-0x0;var _0x19ae50=_0x2750[_0x2f02f2];return _0x19ae50;};'use strict';var client=require(_0x0275('0x0'));exports['getTemplates']=function(_0xf4568){return function(_0xf2ae71){return client[_0x0275('0x1')](_0x0275('0x2'),{'options':{'raw':!![],'attributes':['id',_0x0275('0x3'),_0x0275('0x4')]},'log':_0x0275('0x2')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index 3bbf2e5..66d28f5 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 _0xc93f=['status','Condition','operator','value','AnyConditions','field','Actions','action','data2','data4','data5','data6','data7','../client','getTriggers','Request','GetTrigger','name'];(function(_0x1b6c6d,_0x2983b0){var _0x290d9d=function(_0x5b9779){while(--_0x5b9779){_0x1b6c6d['push'](_0x1b6c6d['shift']());}};_0x290d9d(++_0x2983b0);}(_0xc93f,0xd3));var _0xfc93=function(_0x124818,_0x48246f){_0x124818=_0x124818-0x0;var _0xf41a4a=_0xc93f[_0x124818];return _0xf41a4a;};'use strict';var client=require(_0xfc93('0x0'));exports[_0xfc93('0x1')]=function(_0x7697ba){return function(_0x5c2812){return client[_0xfc93('0x2')](_0xfc93('0x3'),{'options':{'raw':![],'attributes':['id',_0xfc93('0x4'),'channel',_0xfc93('0x5')],'include':[{'model':_0xfc93('0x6'),'as':'AllConditions','attributes':['id','field',_0xfc93('0x7'),_0xfc93('0x8')]},{'model':_0xfc93('0x6'),'as':_0xfc93('0x9'),'attributes':['id',_0xfc93('0xa'),_0xfc93('0x7'),_0xfc93('0x8')]},{'model':'Action','as':_0xfc93('0xb'),'attributes':['id',_0xfc93('0xc'),'data1',_0xfc93('0xd'),'data3',_0xfc93('0xe'),_0xfc93('0xf'),_0xfc93('0x10'),_0xfc93('0x11')]}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0xd204=['data5','data7','GetTrigger','../client','getTriggers','Request','name','channel','status','Condition','field','operator','value','Actions','action','data1','data2','data4'];(function(_0x586f27,_0xd5f8ec){var _0x27bf17=function(_0x1cb738){while(--_0x1cb738){_0x586f27['push'](_0x586f27['shift']());}};_0x27bf17(++_0xd5f8ec);}(_0xd204,0x6f));var _0x4d20=function(_0x505728,_0x507c59){_0x505728=_0x505728-0x0;var _0x3fedb4=_0xd204[_0x505728];return _0x3fedb4;};'use strict';var client=require(_0x4d20('0x0'));exports[_0x4d20('0x1')]=function(_0x2d57fb){return function(_0x5d1dd1){return client[_0x4d20('0x2')]('GetTrigger',{'options':{'raw':![],'attributes':['id',_0x4d20('0x3'),_0x4d20('0x4'),_0x4d20('0x5')],'include':[{'model':_0x4d20('0x6'),'as':'AllConditions','attributes':['id',_0x4d20('0x7'),_0x4d20('0x8'),_0x4d20('0x9')]},{'model':_0x4d20('0x6'),'as':'AnyConditions','attributes':['id','field',_0x4d20('0x8'),_0x4d20('0x9')]},{'model':'Action','as':_0x4d20('0xa'),'attributes':['id',_0x4d20('0xb'),_0x4d20('0xc'),_0x4d20('0xd'),'data3',_0x4d20('0xe'),_0x4d20('0xf'),'data6',_0x4d20('0x10')]}]},'log':_0x4d20('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trunk.js b/server/services/ami/rpc/trunk.js index 31a66f3..b3db99d 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 _0xd507=['Request','GetTrunk','name','registry','getTrunks'];(function(_0x456a4b,_0x51df8){var _0x42957c=function(_0x431de8){while(--_0x431de8){_0x456a4b['push'](_0x456a4b['shift']());}};_0x42957c(++_0x51df8);}(_0xd507,0x1cb));var _0x7d50=function(_0x144555,_0x5991f4){_0x144555=_0x144555-0x0;var _0x3a3096=_0xd507[_0x144555];return _0x3a3096;};'use strict';var client=require('../client');exports[_0x7d50('0x0')]=function(_0x3f31ea){return function(_0x2a77cd){return client[_0x7d50('0x1')](_0x7d50('0x2'),{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x7d50('0x3'),_0x7d50('0x4')]},'log':'GetTrunk'});};}; \ No newline at end of file +var _0x29ca=['registry','GetTrunk','../client','getTrunks','Request','name'];(function(_0x3e3331,_0x239ae0){var _0x6d7d1c=function(_0x66f834){while(--_0x66f834){_0x3e3331['push'](_0x3e3331['shift']());}};_0x6d7d1c(++_0x239ae0);}(_0x29ca,0x13a));var _0xa29c=function(_0x3e6440,_0xa10c2b){_0x3e6440=_0x3e6440-0x0;var _0xc0b1bf=_0x29ca[_0x3e6440];return _0xc0b1bf;};'use strict';var client=require(_0xa29c('0x0'));exports[_0xa29c('0x1')]=function(_0x2a0a68){return function(_0x4ce582){return client[_0xa29c('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0xa29c('0x3'),_0xa29c('0x4')]},'log':_0xa29c('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index 18fac70..f17985a 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 _0xbd78=['pauseType','lastPauseAt','voicePause','phone','mobile','interface','telephone','internal','savePause','PauseUser','getAgent','ShowUser','email','getAgents','Request','GetUser','agent','name','accountcode','fullname','online','lastLoginAt'];(function(_0x56a84c,_0x454c51){var _0x1baebc=function(_0x170597){while(--_0x170597){_0x56a84c['push'](_0x56a84c['shift']());}};_0x1baebc(++_0x454c51);}(_0xbd78,0x115));var _0x8bd7=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbd78[_0x501510];return _0x1e6ee5;};'use strict';var client=require('../client');exports[_0x8bd7('0x0')]=function(){return function(){return client[_0x8bd7('0x1')](_0x8bd7('0x2'),{'options':{'raw':![],'where':{'role':_0x8bd7('0x3')},'attributes':['id',_0x8bd7('0x4'),'email',_0x8bd7('0x5'),_0x8bd7('0x6'),_0x8bd7('0x7'),_0x8bd7('0x8'),_0x8bd7('0x9'),_0x8bd7('0xa'),_0x8bd7('0xb'),_0x8bd7('0xc'),_0x8bd7('0xd'),_0x8bd7('0xe')]},'log':_0x8bd7('0x0')});};};exports['getTelephones']=function(){return function(){return client['Request'](_0x8bd7('0x2'),{'options':{'raw':!![],'where':{'role':_0x8bd7('0xf')},'attributes':['id',_0x8bd7('0x4'),_0x8bd7('0x5'),_0x8bd7('0x10')]},'log':'getTelephones'});};};exports[_0x8bd7('0x11')]=function(_0x478a42,_0x1643f9,_0x4a3575){return client[_0x8bd7('0x1')](_0x8bd7('0x12'),{'body':{'type':_0x1643f9,'uniqueid':_0x4a3575},'options':{'where':{'id':_0x478a42['id']}},'log':_0x8bd7('0x11')});};exports['saveUnpause']=function(_0x410486){return client[_0x8bd7('0x1')]('UnpauseUser',{'body':{},'options':{'where':{'id':_0x410486['id']}},'log':_0x8bd7('0x11')});};exports[_0x8bd7('0x13')]=function(_0x925dd){return client[_0x8bd7('0x1')](_0x8bd7('0x14'),{'options':{'raw':![],'where':{'role':_0x8bd7('0x3'),'id':_0x925dd},'attributes':['id',_0x8bd7('0x4'),_0x8bd7('0x15'),_0x8bd7('0x5'),_0x8bd7('0x6'),_0x8bd7('0x7'),_0x8bd7('0x8'),_0x8bd7('0x9'),_0x8bd7('0xa'),_0x8bd7('0xb'),_0x8bd7('0xe')]},'log':_0x8bd7('0x13')});}; \ No newline at end of file +var _0x917d=['interface','getTelephones','telephone','internal','savePause','PauseUser','UnpauseUser','ShowUser','getAgent','getAgents','Request','GetUser','agent','name','email','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','mobile'];(function(_0x20cb20,_0x256051){var _0x2fcf4b=function(_0x26200b){while(--_0x26200b){_0x20cb20['push'](_0x20cb20['shift']());}};_0x2fcf4b(++_0x256051);}(_0x917d,0xef));var _0xd917=function(_0x3d8e42,_0x52ed30){_0x3d8e42=_0x3d8e42-0x0;var _0x524ac3=_0x917d[_0x3d8e42];return _0x524ac3;};'use strict';var client=require('../client');exports[_0xd917('0x0')]=function(){return function(){return client[_0xd917('0x1')](_0xd917('0x2'),{'options':{'raw':![],'where':{'role':_0xd917('0x3')},'attributes':['id',_0xd917('0x4'),_0xd917('0x5'),_0xd917('0x6'),_0xd917('0x7'),_0xd917('0x8'),_0xd917('0x9'),_0xd917('0xa'),_0xd917('0xb'),_0xd917('0xc'),'phone',_0xd917('0xd'),_0xd917('0xe')]},'log':_0xd917('0x0')});};};exports[_0xd917('0xf')]=function(){return function(){return client[_0xd917('0x1')]('GetUser',{'options':{'raw':!![],'where':{'role':_0xd917('0x10')},'attributes':['id',_0xd917('0x4'),_0xd917('0x6'),_0xd917('0x11')]},'log':_0xd917('0xf')});};};exports[_0xd917('0x12')]=function(_0x277771,_0x5e1470,_0x48f747){return client['Request'](_0xd917('0x13'),{'body':{'type':_0x5e1470,'uniqueid':_0x48f747},'options':{'where':{'id':_0x277771['id']}},'log':_0xd917('0x12')});};exports['saveUnpause']=function(_0x2597cc){return client[_0xd917('0x1')](_0xd917('0x14'),{'body':{},'options':{'where':{'id':_0x2597cc['id']}},'log':_0xd917('0x12')});};exports['getAgent']=function(_0x17e5df){return client[_0xd917('0x1')](_0xd917('0x15'),{'options':{'raw':![],'where':{'role':'agent','id':_0x17e5df},'attributes':['id',_0xd917('0x4'),_0xd917('0x5'),_0xd917('0x6'),'fullname','online','lastLoginAt',_0xd917('0xa'),_0xd917('0xb'),'voicePause','interface']},'log':_0xd917('0x16')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 17b276e..dc1ed15 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 _0x5f41=['update','UpdateVoiceAgentReport','../client','create','CreateVoiceAgentReport'];(function(_0xadfc49,_0x34ad9d){var _0xdac78c=function(_0x4b21ca){while(--_0x4b21ca){_0xadfc49['push'](_0xadfc49['shift']());}};_0xdac78c(++_0x34ad9d);}(_0x5f41,0x1c4));var _0x15f4=function(_0x2236cd,_0x99636d){_0x2236cd=_0x2236cd-0x0;var _0x183883=_0x5f41[_0x2236cd];return _0x183883;};'use strict';var client=require(_0x15f4('0x0'));exports[_0x15f4('0x1')]=function(_0x398ddd){return client['Request'](_0x15f4('0x2'),{'body':_0x398ddd,'log':_0x15f4('0x2')});};exports[_0x15f4('0x3')]=function(_0x444d36,_0x59e780,_0xb1bab2){return client['Request'](_0x15f4('0x4'),{'body':_0x444d36,'options':{'where':{'uniqueid':_0x59e780,'interface':_0xb1bab2,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file +var _0x9850=['CreateVoiceAgentReport','UpdateVoiceAgentReport','../client','create','Request'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9850,0x1c9));var _0x0985=function(_0x5848bb,_0xd3dfde){_0x5848bb=_0x5848bb-0x0;var _0x1a291b=_0x9850[_0x5848bb];return _0x1a291b;};'use strict';var client=require(_0x0985('0x0'));exports[_0x0985('0x1')]=function(_0x5676e4){return client[_0x0985('0x2')](_0x0985('0x3'),{'body':_0x5676e4,'log':'CreateVoiceAgentReport'});};exports['update']=function(_0x5b1a8b,_0x2bf40f,_0x53b45d){return client['Request'](_0x0985('0x4'),{'body':_0x5b1a8b,'options':{'where':{'uniqueid':_0x2bf40f,'interface':_0x53b45d,'agentcomplete':!![]}},'log':'UpdateVoiceAgentReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 94ad3d1..a59bb08 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 _0x28d6=['startOf','day','endOf','format','YYYY-MM-DD\x20HH:mm:ss','type','disposition','duration','billableseconds','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','context','callerid','DOCUMENTATION','GetVoiceCallReport'];(function(_0x1b6e2b,_0x27feed){var _0x18f841=function(_0xb2e08b){while(--_0xb2e08b){_0x1b6e2b['push'](_0x1b6e2b['shift']());}};_0x18f841(++_0x27feed);}(_0x28d6,0x145));var _0x628d=function(_0x3a3f0c,_0x174f79){_0x3a3f0c=_0x3a3f0c-0x0;var _0x184722=_0x28d6[_0x3a3f0c];return _0x184722;};'use strict';var moment=require('moment');var util=require(_0x628d('0x0'));var _=require(_0x628d('0x1'));var client=require(_0x628d('0x2'));exports[_0x628d('0x3')]=function(_0x375f9c){return client[_0x628d('0x4')](_0x628d('0x5'),{'body':_[_0x628d('0x6')](_0x375f9c,{'source':_0x375f9c['calleridnum'],'destinationcontext':_0x375f9c[_0x628d('0x7')],'callerid':_0x375f9c[_0x628d('0x8')],'amaflags':_0x628d('0x9')}),'log':_0x628d('0x5')});};exports['getVoiceCallReports']=function(){return function(){return client['Request'](_0x628d('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x628d('0xb')](_0x628d('0xc'))['format']('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x628d('0xd')]('day')[_0x628d('0xe')](_0x628d('0xf'))]}},'attributes':[_0x628d('0x10'),_0x628d('0x11'),_0x628d('0x12'),_0x628d('0x13')]},'log':_0x628d('0x14')});};}; \ No newline at end of file +var _0xbe02=['../client','create','merge','calleridnum','CreateVoiceCallReport','getVoiceCallReports','Request','GetVoiceCallReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash'];(function(_0x40af64,_0xaa8209){var _0x58f483=function(_0x138f92){while(--_0x138f92){_0x40af64['push'](_0x40af64['shift']());}};_0x58f483(++_0xaa8209);}(_0xbe02,0x18c));var _0x2be0=function(_0x1902fe,_0x11e5d2){_0x1902fe=_0x1902fe-0x0;var _0x1dbe3b=_0xbe02[_0x1902fe];return _0x1dbe3b;};'use strict';var moment=require(_0x2be0('0x0'));var util=require(_0x2be0('0x1'));var _=require(_0x2be0('0x2'));var client=require(_0x2be0('0x3'));exports[_0x2be0('0x4')]=function(_0x1a3cc7){return client['Request']('CreateVoiceCallReport',{'body':_[_0x2be0('0x5')](_0x1a3cc7,{'source':_0x1a3cc7[_0x2be0('0x6')],'destinationcontext':_0x1a3cc7['context'],'callerid':_0x1a3cc7['callerid'],'amaflags':'DOCUMENTATION'}),'log':_0x2be0('0x7')});};exports[_0x2be0('0x8')]=function(){return function(){return client[_0x2be0('0x9')](_0x2be0('0xa'),{'options':{'where':{'type':['outbound'],'createdAt':{'$between':[moment()[_0x2be0('0xb')](_0x2be0('0xc'))[_0x2be0('0xd')](_0x2be0('0xe')),moment()[_0x2be0('0xf')](_0x2be0('0xc'))[_0x2be0('0xd')](_0x2be0('0xe'))]}},'attributes':[_0x2be0('0x10'),'disposition',_0x2be0('0x11'),'billableseconds']},'log':_0x2be0('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 34398f9..136faf9 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 _0x596b=['Request','CreateVoiceDialReport','../client','create'];(function(_0x2b69aa,_0x29ea7c){var _0x247b64=function(_0x1969a9){while(--_0x1969a9){_0x2b69aa['push'](_0x2b69aa['shift']());}};_0x247b64(++_0x29ea7c);}(_0x596b,0x12a));var _0xb596=function(_0x2ebd89,_0x37651d){_0x2ebd89=_0x2ebd89-0x0;var _0x427fb7=_0x596b[_0x2ebd89];return _0x427fb7;};'use strict';var client=require(_0xb596('0x0'));exports[_0xb596('0x1')]=function(_0x5c688e){return client[_0xb596('0x2')]('CreateVoiceDialReport',{'body':_0x5c688e,'log':_0xb596('0x3')});}; \ No newline at end of file +var _0x8f48=['Request','CreateVoiceDialReport','create'];(function(_0x4528bb,_0x19607c){var _0x512ad2=function(_0x457a25){while(--_0x457a25){_0x4528bb['push'](_0x4528bb['shift']());}};_0x512ad2(++_0x19607c);}(_0x8f48,0x15b));var _0x88f4=function(_0x4ed6c7,_0x2e6803){_0x4ed6c7=_0x4ed6c7-0x0;var _0x112d0c=_0x8f48[_0x4ed6c7];return _0x112d0c;};'use strict';var client=require('../client');exports[_0x88f4('0x0')]=function(_0x1096a4){return client[_0x88f4('0x1')](_0x88f4('0x2'),{'body':_0x1096a4,'log':_0x88f4('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 01b307f..4123215 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 _0x609a=['../client','getVoiceExtensions','Request','GetVoiceExtension','exten','recordingFormat'];(function(_0x479259,_0x303991){var _0xc8c06f=function(_0x49b4b5){while(--_0x49b4b5){_0x479259['push'](_0x479259['shift']());}};_0xc8c06f(++_0x303991);}(_0x609a,0x1ec));var _0xa609=function(_0x432682,_0x253044){_0x432682=_0x432682-0x0;var _0x463d05=_0x609a[_0x432682];return _0x463d05;};'use strict';var client=require(_0xa609('0x0'));exports[_0xa609('0x1')]=function(){return function(){return client[_0xa609('0x2')](_0xa609('0x3'),{'options':{'raw':!![],'attributes':['id',_0xa609('0x4'),_0xa609('0x5')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file +var _0xc04a=['recordingFormat','getVoiceExtensions','../client','Request','exten'];(function(_0x4731e3,_0x162ffe){var _0x33a4b2=function(_0x5261dd){while(--_0x5261dd){_0x4731e3['push'](_0x4731e3['shift']());}};_0x33a4b2(++_0x162ffe);}(_0xc04a,0x12e));var _0xac04=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xc04a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xac04('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0xac04('0x1')]('GetVoiceExtension',{'options':{'raw':!![],'attributes':['id',_0xac04('0x2'),_0xac04('0x3')],'where':{'VoiceExtensionId':null}},'log':_0xac04('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index 389e12f..a7f5ed0 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 _0x80bb=['dialPredictiveOptimizationPercentage','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialAgiAfterHangupClient','strategy','dialRandomLastDigitCallerIdNumber','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialAgentRejectMaxRetry','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','Pause','mandatoryDispositionPause','TrunkBackup','active','Interval','Intervals','interval','getVoiceQueues','../client','GetVoiceQueue','name','acw','acwTimeout','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization'];(function(_0x270adf,_0x1daaa3){var _0x29eda9=function(_0x40afec){while(--_0x40afec){_0x270adf['push'](_0x270adf['shift']());}};_0x29eda9(++_0x1daaa3);}(_0x80bb,0x1a5));var _0xb80b=function(_0x33ece9,_0x1be110){_0x33ece9=_0x33ece9-0x0;var _0x446dbc=_0x80bb[_0x33ece9];return _0x446dbc;};'use strict';var client=require(_0xb80b('0x0'));exports['getVoiceQueues']=function(){return function(){return client['Request'](_0xb80b('0x1'),{'options':{'raw':![],'attributes':['id',_0xb80b('0x2'),_0xb80b('0x3'),_0xb80b('0x4'),'autopause',_0xb80b('0x5'),_0xb80b('0x6'),_0xb80b('0x7'),_0xb80b('0x8'),_0xb80b('0x9'),_0xb80b('0xa'),_0xb80b('0xb'),_0xb80b('0xc'),_0xb80b('0xd'),'dialPredictiveInterval','dialOriginateCallerIdName',_0xb80b('0xe'),_0xb80b('0xf'),_0xb80b('0x10'),_0xb80b('0x11'),_0xb80b('0x12'),_0xb80b('0x13'),_0xb80b('0x14'),_0xb80b('0x15'),_0xb80b('0x16'),'dialNoAnswerMaxRetry',_0xb80b('0x17'),_0xb80b('0x18'),'dialTimezone',_0xb80b('0x19'),_0xb80b('0x1a'),_0xb80b('0x1b'),_0xb80b('0x1c'),_0xb80b('0x1d'),_0xb80b('0x1e'),'dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime',_0xb80b('0x1f'),_0xb80b('0x20'),'dialAMDMaximumNumberOfWords',_0xb80b('0x21'),_0xb80b('0x22'),'timeout',_0xb80b('0x23'),_0xb80b('0x24'),_0xb80b('0x25'),_0xb80b('0x26'),_0xb80b('0x27'),'dialQueueProject2',_0xb80b('0x5'),_0xb80b('0x28'),_0xb80b('0x29'),_0xb80b('0x2a'),_0xb80b('0x2b'),_0xb80b('0x2c'),'dialDropMaxRetry',_0xb80b('0x2d'),'dialAbandonedMaxRetry',_0xb80b('0x2e'),_0xb80b('0x2f'),'dialMachineRetryFrequency',_0xb80b('0x30'),'dialAgentRejectRetryFrequency',_0xb80b('0x31'),_0xb80b('0x32'),_0xb80b('0x33')],'include':[{'model':_0xb80b('0x34'),'as':'Trunk','attributes':['id','name',_0xb80b('0x35'),'active']},{'model':_0xb80b('0x36'),'as':_0xb80b('0x37'),'attributes':['id',_0xb80b('0x2')]},{'model':_0xb80b('0x34'),'as':_0xb80b('0x38'),'attributes':['id',_0xb80b('0x2'),_0xb80b('0x35'),_0xb80b('0x39')]},{'model':_0xb80b('0x3a'),'as':_0xb80b('0x3a'),'attributes':['id','name'],'include':[{'model':_0xb80b('0x3a'),'as':_0xb80b('0x3b'),'attributes':['id','name',_0xb80b('0x3c')]}]}]},'log':_0xb80b('0x3d')});};}; \ No newline at end of file +var _0x85c4=['dialNoAnswerRetryFrequency','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDSilenceThreshold','dialRecallMeTimeout','dialOrderByScheduledAt','dialAgiAfterHangupAgent','dialQueueProject2','strategy','dialCutDigit','dialNoSuchNumberMaxRetry','dialNoSuchNumberRetryFrequency','dialDropRetryFrequency','dialAbandonedRetryFrequency','dialMachineMaxRetry','dialMachineRetryFrequency','dialAgentRejectMaxRetry','dialAgentRejectRetryFrequency','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','callerid','active','Pause','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','getVoiceQueues','../client','Request','GetVoiceQueue','name','acw','acwTimeout','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel','dialPowerLevel','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialQueueProject','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x85c4,0x152));var _0x485c=function(_0x47c6b9,_0x210b3c){_0x47c6b9=_0x47c6b9-0x0;var _0x34f34d=_0x85c4[_0x47c6b9];return _0x34f34d;};'use strict';var client=require(_0x485c('0x0'));exports['getVoiceQueues']=function(){return function(){return client[_0x485c('0x1')](_0x485c('0x2'),{'options':{'raw':![],'attributes':['id',_0x485c('0x3'),_0x485c('0x4'),_0x485c('0x5'),_0x485c('0x6'),_0x485c('0x7'),_0x485c('0x8'),_0x485c('0x9'),_0x485c('0xa'),_0x485c('0xb'),'dialLimitQueue',_0x485c('0xc'),'dialPredictiveOptimization',_0x485c('0xd'),'dialPredictiveInterval',_0x485c('0xe'),_0x485c('0xf'),'dialOriginateTimeout','dialQueueOptions',_0x485c('0x10'),_0x485c('0x11'),'dialCongestionMaxRetry',_0x485c('0x12'),_0x485c('0x13'),_0x485c('0x14'),_0x485c('0x15'),_0x485c('0x16'),'dialGlobalMaxRetry',_0x485c('0x17'),_0x485c('0x18'),_0x485c('0x19'),_0x485c('0x1a'),_0x485c('0x1b'),_0x485c('0x1c'),_0x485c('0x1d'),_0x485c('0x1e'),_0x485c('0x1f'),_0x485c('0x20'),'dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords',_0x485c('0x21'),'dialAMDMaximumWordLength','timeout',_0x485c('0x22'),'dialRecallInQueue',_0x485c('0x23'),_0x485c('0x24'),'dialAgiAfterHangupClient',_0x485c('0x25'),'monitor_format',_0x485c('0x26'),'dialRandomLastDigitCallerIdNumber',_0x485c('0x27'),_0x485c('0x28'),_0x485c('0x29'),'dialDropMaxRetry',_0x485c('0x2a'),'dialAbandonedMaxRetry',_0x485c('0x2b'),_0x485c('0x2c'),_0x485c('0x2d'),_0x485c('0x2e'),_0x485c('0x2f'),_0x485c('0x30'),_0x485c('0x31'),_0x485c('0x32')],'include':[{'model':_0x485c('0x33'),'as':_0x485c('0x33'),'attributes':['id',_0x485c('0x3'),_0x485c('0x34'),_0x485c('0x35')]},{'model':_0x485c('0x36'),'as':_0x485c('0x37'),'attributes':['id',_0x485c('0x3')]},{'model':_0x485c('0x33'),'as':_0x485c('0x38'),'attributes':['id',_0x485c('0x3'),_0x485c('0x34'),_0x485c('0x35')]},{'model':_0x485c('0x39'),'as':_0x485c('0x39'),'attributes':['id','name'],'include':[{'model':'Interval','as':_0x485c('0x3a'),'attributes':['id','name','interval']}]}]},'log':_0x485c('0x3b')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 183000f..010daab 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 _0xc00b=['queuecallerleaveAt','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','queuecallerabandonAt','moment','CreateVoiceQueueReport','getVoiceQueueReports','Request','startOf','format','endOf','day','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue'];(function(_0x55163d,_0x5e79ca){var _0xc7720=function(_0x1f1c99){while(--_0x1f1c99){_0x55163d['push'](_0x55163d['shift']());}};_0xc7720(++_0x5e79ca);}(_0xc00b,0x1e5));var _0xbc00=function(_0x2fffff,_0x415518){_0x2fffff=_0x2fffff-0x0;var _0x4f2a2c=_0xc00b[_0x2fffff];return _0x4f2a2c;};'use strict';var moment=require(_0xbc00('0x0'));var _=require('lodash');var client=require('../client');exports['create']=function(_0x17629d){return client['Request'](_0xbc00('0x1'),{'body':_0x17629d,'log':_0xbc00('0x1')});};exports[_0xbc00('0x2')]=function(){return function(){return client[_0xbc00('0x3')]('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0xbc00('0x4')]('day')[_0xbc00('0x5')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0xbc00('0x6')](_0xbc00('0x7'))[_0xbc00('0x5')](_0xbc00('0x8'))]}},'attributes':[_0xbc00('0x9'),_0xbc00('0xa'),'queuecallerjoinAt',_0xbc00('0xb'),'queuecallercomplete',_0xbc00('0xc'),_0xbc00('0xd'),_0xbc00('0xe'),'queuecallerabandon',_0xbc00('0xf')]},'log':'GetVoiceQueueReports'});};}; \ No newline at end of file +var _0xde0a=['startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','queuecallerleaveAt','queuecallercomplete','queuecallercompleteAt','queuecallerexitAt','queuecallerabandon','GetVoiceQueueReports','moment','../client','create','Request','CreateVoiceQueueReport','GetVoiceQueueReport'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xde0a,0xf6));var _0xade0=function(_0x2df5e8,_0x137688){_0x2df5e8=_0x2df5e8-0x0;var _0x3fda88=_0xde0a[_0x2df5e8];return _0x3fda88;};'use strict';var moment=require(_0xade0('0x0'));var _=require('lodash');var client=require(_0xade0('0x1'));exports[_0xade0('0x2')]=function(_0x4795dd){return client[_0xade0('0x3')](_0xade0('0x4'),{'body':_0x4795dd,'log':_0xade0('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client[_0xade0('0x3')](_0xade0('0x5'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xade0('0x6')](_0xade0('0x7'))[_0xade0('0x8')](_0xade0('0x9')),moment()['endOf']('day')[_0xade0('0x8')](_0xade0('0x9'))]}},'attributes':[_0xade0('0xa'),_0xade0('0xb'),'queuecallerjoinAt',_0xade0('0xc'),_0xade0('0xd'),_0xade0('0xe'),'queuecallerexit',_0xade0('0xf'),_0xade0('0x10'),'queuecallerabandonAt']},'log':_0xade0('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 1d7fde5..ab5b10a 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 _0xc7a0=['Request','GetVoiceQueueRtPauses','../client','getVoiceQueueRtPauses'];(function(_0x3db083,_0x3134ca){var _0x300abf=function(_0x53b749){while(--_0x53b749){_0x3db083['push'](_0x3db083['shift']());}};_0x300abf(++_0x3134ca);}(_0xc7a0,0xf6));var _0x0c7a=function(_0x545b47,_0x477590){_0x545b47=_0x545b47-0x0;var _0xa8a776=_0xc7a0[_0x545b47];return _0xa8a776;};'use strict';var client=require(_0x0c7a('0x0'));exports[_0x0c7a('0x1')]=function(_0x34c51b){return function(){return client[_0x0c7a('0x2')](_0x0c7a('0x3'),{'options':{'where':{'VoiceQueueId':_0x34c51b,'paused':!![]},'raw':!![]},'log':_0x0c7a('0x1')});};}; \ No newline at end of file +var _0xc77d=['../client','getVoiceQueueRtPauses','GetVoiceQueueRtPauses'];(function(_0xaab622,_0x4e7fa1){var _0x565f98=function(_0x34995b){while(--_0x34995b){_0xaab622['push'](_0xaab622['shift']());}};_0x565f98(++_0x4e7fa1);}(_0xc77d,0x1e3));var _0xdc77=function(_0x5cb5fc,_0x6cdda3){_0x5cb5fc=_0x5cb5fc-0x0;var _0x4b6fab=_0xc77d[_0x5cb5fc];return _0x4b6fab;};'use strict';var client=require(_0xdc77('0x0'));exports[_0xdc77('0x1')]=function(_0x4db315){return function(){return client['Request'](_0xdc77('0x2'),{'options':{'where':{'VoiceQueueId':_0x4db315,'paused':!![]},'raw':!![]},'log':_0xdc77('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 77837bd..fe2adef 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 _0x3367=['lodash','../client','create','Request','CreateVoiceRecording','merge','monitorFilename'];(function(_0x5e370,_0xa6e7e8){var _0x3065f7=function(_0x4ef292){while(--_0x4ef292){_0x5e370['push'](_0x5e370['shift']());}};_0x3065f7(++_0xa6e7e8);}(_0x3367,0x150));var _0x7336=function(_0x313a94,_0x385dd6){_0x313a94=_0x313a94-0x0;var _0x55dbf4=_0x3367[_0x313a94];return _0x55dbf4;};'use strict';var _=require(_0x7336('0x0'));var client=require(_0x7336('0x1'));exports[_0x7336('0x2')]=function(_0x1ce2dc){return client[_0x7336('0x3')](_0x7336('0x4'),{'body':_[_0x7336('0x5')](_0x1ce2dc,{'value':_0x1ce2dc[_0x7336('0x6')]}),'log':_0x7336('0x4')});}; \ No newline at end of file +var _0x7454=['Request','CreateVoiceRecording','merge','monitorFilename','../client','create'];(function(_0x1a3e23,_0xce45e){var _0x5ee0d8=function(_0x4b932f){while(--_0x4b932f){_0x1a3e23['push'](_0x1a3e23['shift']());}};_0x5ee0d8(++_0xce45e);}(_0x7454,0x82));var _0x4745=function(_0x22123d,_0x45ae06){_0x22123d=_0x22123d-0x0;var _0xeabce1=_0x7454[_0x22123d];return _0xeabce1;};'use strict';var _=require('lodash');var client=require(_0x4745('0x0'));exports[_0x4745('0x1')]=function(_0x30d1e3){return client[_0x4745('0x2')](_0x4745('0x3'),{'body':_[_0x4745('0x4')](_0x30d1e3,{'value':_0x30d1e3[_0x4745('0x5')]}),'log':_0x4745('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index 7639148..29489e8 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 _0x32a0=['secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransfererexten','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','attended','../client','blindTransfer','Request','result','transfererchannel','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','CreateVoiceTransferReport','origtransferercalleridnum','origtransferercalleridname'];(function(_0x233716,_0x346676){var _0x302298=function(_0x53d84c){while(--_0x53d84c){_0x233716['push'](_0x233716['shift']());}};_0x302298(++_0x346676);}(_0x32a0,0xd0));var _0x032a=function(_0x596de3,_0xf801c0){_0x596de3=_0x596de3-0x0;var _0xbf541f=_0x32a0[_0x596de3];return _0xbf541f;};'use strict';var client=require(_0x032a('0x0'));exports[_0x032a('0x1')]=function(_0xff6929){return client[_0x032a('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xff6929[_0x032a('0x3')],'transfererchannel':_0xff6929[_0x032a('0x4')],'transferercalleridnum':_0xff6929['transferercalleridnum'],'transferercalleridname':_0xff6929[_0x032a('0x5')],'transfererconnectedlinenum':_0xff6929[_0x032a('0x6')],'transfererconnectedlinename':_0xff6929['transfererconnectedlinename'],'transfereraccountcode':_0xff6929[_0x032a('0x7')],'transferercontext':_0xff6929[_0x032a('0x8')],'transfererexten':_0xff6929[_0x032a('0x9')],'transfererlinkedid':_0xff6929[_0x032a('0xa')],'transfereechannel':_0xff6929[_0x032a('0xb')],'transfereecalleridnum':_0xff6929[_0x032a('0xc')],'transfereecalleridname':_0xff6929[_0x032a('0xd')],'transfereeconnectedlinenum':_0xff6929[_0x032a('0xe')],'transfereeconnectedlinename':_0xff6929[_0x032a('0xf')],'transfereeaccountcode':_0xff6929['transfereeaccountcode'],'transfereecontext':_0xff6929[_0x032a('0x10')],'transfereeexten':_0xff6929[_0x032a('0x11')],'transfereelinkedid':_0xff6929['transfereelinkedid'],'isexternal':_0xff6929[_0x032a('0x12')],'context':_0xff6929[_0x032a('0x13')],'extension':_0xff6929['extension'],'type':'blind'},'log':'CreateVoiceTransferReport'});};exports['attendedTransfer']=function(_0x1ce9e1){return client[_0x032a('0x2')](_0x032a('0x14'),{'body':{'result':_0x1ce9e1[_0x032a('0x3')],'transfererchannel':_0x1ce9e1['origtransfererchannel'],'transferercalleridnum':_0x1ce9e1[_0x032a('0x15')],'transferercalleridname':_0x1ce9e1[_0x032a('0x16')],'transfererconnectedlinenum':_0x1ce9e1[_0x032a('0x17')],'transfererconnectedlinename':_0x1ce9e1[_0x032a('0x18')],'transfereraccountcode':_0x1ce9e1['origtransfereraccountcode'],'transferercontext':_0x1ce9e1['secondtransferercontext'],'transfererexten':_0x1ce9e1[_0x032a('0x19')],'transfererlinkedid':_0x1ce9e1['origtransfererlinkedid'],'transfereechannel':_0x1ce9e1['transfertargetchannel'],'transfereecalleridnum':_0x1ce9e1[_0x032a('0x1a')],'transfereecalleridname':_0x1ce9e1[_0x032a('0x1b')],'transfereeconnectedlinenum':_0x1ce9e1['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x1ce9e1['transfertargetconnectedlinename'],'transfereeaccountcode':_0x1ce9e1[_0x032a('0x1c')],'transfereecontext':_0x1ce9e1[_0x032a('0x1d')],'transfereeexten':_0x1ce9e1[_0x032a('0x1e')],'transfereelinkedid':_0x1ce9e1['transfertargetlinkedid'],'isexternal':_0x1ce9e1[_0x032a('0x12')],'context':_0x1ce9e1[_0x032a('0x1f')],'extension':_0x1ce9e1['origtransfererexten'],'type':_0x032a('0x20')},'log':'CreateVoiceTransferReport'});}; \ No newline at end of file +var _0xf820=['blindTransfer','Request','CreateVoiceTransferReport','transfererchannel','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereecalleridname','transfereeconnectedlinename','transfereecontext','transfereeexten','isexternal','context','extension','blind','attendedTransfer','result','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','origtransferercontext','attended'];(function(_0x9f009c,_0x52eef7){var _0x442a15=function(_0x3838a2){while(--_0x3838a2){_0x9f009c['push'](_0x9f009c['shift']());}};_0x442a15(++_0x52eef7);}(_0xf820,0x1d4));var _0x0f82=function(_0x10d3b6,_0x3ec495){_0x10d3b6=_0x10d3b6-0x0;var _0x59a419=_0xf820[_0x10d3b6];return _0x59a419;};'use strict';var client=require('../client');exports[_0x0f82('0x0')]=function(_0x522e24){return client[_0x0f82('0x1')](_0x0f82('0x2'),{'body':{'result':_0x522e24['result'],'transfererchannel':_0x522e24[_0x0f82('0x3')],'transferercalleridnum':_0x522e24[_0x0f82('0x4')],'transferercalleridname':_0x522e24[_0x0f82('0x5')],'transfererconnectedlinenum':_0x522e24[_0x0f82('0x6')],'transfererconnectedlinename':_0x522e24['transfererconnectedlinename'],'transfereraccountcode':_0x522e24['transfereraccountcode'],'transferercontext':_0x522e24[_0x0f82('0x7')],'transfererexten':_0x522e24[_0x0f82('0x8')],'transfererlinkedid':_0x522e24[_0x0f82('0x9')],'transfereechannel':_0x522e24[_0x0f82('0xa')],'transfereecalleridnum':_0x522e24[_0x0f82('0xb')],'transfereecalleridname':_0x522e24[_0x0f82('0xc')],'transfereeconnectedlinenum':_0x522e24['transfereeconnectedlinenum'],'transfereeconnectedlinename':_0x522e24[_0x0f82('0xd')],'transfereeaccountcode':_0x522e24['transfereeaccountcode'],'transfereecontext':_0x522e24[_0x0f82('0xe')],'transfereeexten':_0x522e24[_0x0f82('0xf')],'transfereelinkedid':_0x522e24['transfereelinkedid'],'isexternal':_0x522e24[_0x0f82('0x10')],'context':_0x522e24[_0x0f82('0x11')],'extension':_0x522e24[_0x0f82('0x12')],'type':_0x0f82('0x13')},'log':_0x0f82('0x2')});};exports[_0x0f82('0x14')]=function(_0x3c73bc){return client['Request'](_0x0f82('0x2'),{'body':{'result':_0x3c73bc[_0x0f82('0x15')],'transfererchannel':_0x3c73bc[_0x0f82('0x16')],'transferercalleridnum':_0x3c73bc[_0x0f82('0x17')],'transferercalleridname':_0x3c73bc[_0x0f82('0x18')],'transfererconnectedlinenum':_0x3c73bc[_0x0f82('0x19')],'transfererconnectedlinename':_0x3c73bc[_0x0f82('0x1a')],'transfereraccountcode':_0x3c73bc['origtransfereraccountcode'],'transferercontext':_0x3c73bc[_0x0f82('0x1b')],'transfererexten':_0x3c73bc['secondtransfererexten'],'transfererlinkedid':_0x3c73bc[_0x0f82('0x1c')],'transfereechannel':_0x3c73bc[_0x0f82('0x1d')],'transfereecalleridnum':_0x3c73bc[_0x0f82('0x1e')],'transfereecalleridname':_0x3c73bc[_0x0f82('0x1f')],'transfereeconnectedlinenum':_0x3c73bc[_0x0f82('0x20')],'transfereeconnectedlinename':_0x3c73bc['transfertargetconnectedlinename'],'transfereeaccountcode':_0x3c73bc[_0x0f82('0x21')],'transfereecontext':_0x3c73bc[_0x0f82('0x22')],'transfereeexten':_0x3c73bc[_0x0f82('0x23')],'transfereelinkedid':_0x3c73bc[_0x0f82('0x24')],'isexternal':_0x3c73bc['isexternal'],'context':_0x3c73bc[_0x0f82('0x25')],'extension':_0x3c73bc['origtransfererexten'],'type':_0x0f82('0x26')},'log':_0x0f82('0x2')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index aeadfb4..34a4805 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 _0x7ffc=['map','find','uniqueid','channel','filename','wav','Action','MixMonitor','ai(mixmonitorid)','monitors','isNil','/var/spool/asterisk/monitor/','toLowerCase','YYYY-MM-DD\x20HH:mm:ss','mixmonitorid','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','stop','queueChannels','voicequeuechannel','exten','context','values','telephones','trunks','outboundChannels','campaigns','run','event','emit','custom:','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','../properties','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','updateStatusRealtime','QueuePause','isConnected','error','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','then','message','catch','command','content','voiceQueues','strategy','answered','available','loggedIn','pTalking','sumHoldTime','talking','total','type','unmanaged','waiting','loggedInDb','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','channels','length','voicechannel','validate'];(function(_0x36dfbd,_0x5bfe2d){var _0x4ecad9=function(_0x5230da){while(--_0x5230da){_0x36dfbd['push'](_0x36dfbd['shift']());}};_0x4ecad9(++_0x5bfe2d);}(_0x7ffc,0x1ad));var _0xc7ff=function(_0x5f3057,_0x4b72da){_0x5f3057=_0x5f3057-0x0;var _0x3f985d=_0x7ffc[_0x5f3057];return _0x3f985d;};'use strict';var _=require(_0xc7ff('0x0'));var util=require(_0xc7ff('0x1'));var jayson=require(_0xc7ff('0x2'));var schema=require('validate');var BPromise=require('bluebird');var moment=require('moment');var config=require('../../../config/environment');var properties=require(_0xc7ff('0x3'));var ami=require(_0xc7ff('0x4'));exports[_0xc7ff('0x5')]=function(_0x3db011,_0x37ad0a,_0x2b9d31){return new BPromise(function(_0x3dbd2f,_0x5cdc9a){var _0xa488f2={'QueuePause':function(_0x57f2f2){return new Promise(function(_0x3f19da,_0x43dbbb){var _0x2fbf0e=util[_0xc7ff('0x6')](_0xc7ff('0x7'),_0xc7ff('0x8'),_0x57f2f2[_0xc7ff('0x9')]);if(_0x3db011[_0xc7ff('0xa')]&&_0x3db011[_0xc7ff('0xa')][_0x2fbf0e]&&_0x3db011[_0xc7ff('0xa')][_0x2fbf0e][_0xc7ff('0xb')]){_0x3db011[_0xc7ff('0xa')][_0x2fbf0e][_0xc7ff('0xc')]();}if(_0x3db011[_0xc7ff('0xd')][_0x2fbf0e]){_0x3db011[_0xc7ff('0xd')][_0x2fbf0e][_0xc7ff('0xe')]({'statePause':_0x57f2f2['pause']?!![]:![]});}_0x3f19da({'code':0xc8,'message':_0xc7ff('0xf')});});},'Reload':function(_0x26608b){var _0x3e6e02=this;return new Promise(function(_0x1852ab,_0x4bcaf0){if(ami[_0xc7ff('0x10')]()==![]){return _0x4bcaf0(_0x3e6e02[_0xc7ff('0x11')](0x1f4,[config[_0xc7ff('0x12')]['ip'],config[_0xc7ff('0x12')][_0xc7ff('0x13')],_0xc7ff('0x14')][_0xc7ff('0x15')]('\x20')));}_0x26608b=_[_0xc7ff('0x16')](_0x26608b,_[_0xc7ff('0x17')](properties[_0xc7ff('0x18')]));_0x26608b[_0xc7ff('0x19')]='Reload';return ami['Action'](_0x26608b)[_0xc7ff('0x1a')](function(_0x597f73){_0x1852ab({'code':0xc8,'message':_0x597f73[_0xc7ff('0x1b')]});})[_0xc7ff('0x1c')](function(_0x2bf1cb){_0x4bcaf0(_0x3e6e02['error'](0x1f5,_0x2bf1cb[_0xc7ff('0x1b')]));});});},'Command':function(_0x5bd474){var _0xce7fca=this;return new Promise(function(_0x4f1f44,_0x2cf098){if(ami[_0xc7ff('0x10')]()==![]){return _0x2cf098(_0xce7fca['error'](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xc7ff('0x13')],_0xc7ff('0x14')]['join']('\x20')));}_0x5bd474=_['pick'](_0x5bd474,_0xc7ff('0x1d'));_0x5bd474[_0xc7ff('0x19')]='Command';return ami['Action'](_0x5bd474)[_0xc7ff('0x1a')](function(_0x2fdef2){_0x4f1f44({'code':0xc8,'message':_0x2fdef2[_0xc7ff('0x1e')]});})['catch'](function(_0x2f8f21){_0x2cf098(_0xce7fca['error'](0x1f5,_0x2f8f21[_0xc7ff('0x1b')]));});});},'VoiceQueues':function(_0x2d43e4){return new Promise(function(_0x86c0a,_0x1d81d9){var _0x98767c=[];for(var _0x128a26 in _0x3db011[_0xc7ff('0x1f')]){if(_0x3db011[_0xc7ff('0x1f')]['hasOwnProperty'](_0x128a26)){var _0x10d5c6=_0x3db011[_0xc7ff('0x1f')][_0x128a26];var _0x4431d9={'id':_0x10d5c6['id'],'name':_0x10d5c6[_0xc7ff('0x9')],'strategy':_0x10d5c6[_0xc7ff('0x20')],'answered':_0x10d5c6[_0xc7ff('0x21')],'available':_0x10d5c6[_0xc7ff('0x22')],'loggedIn':_0x10d5c6[_0xc7ff('0x23')],'pTalking':_0x10d5c6[_0xc7ff('0x24')],'sumBillable':_0x10d5c6['sumBillable'],'sumDuration':_0x10d5c6['sumDuration'],'sumHoldTime':_0x10d5c6[_0xc7ff('0x25')]||0x0,'talking':_0x10d5c6[_0xc7ff('0x26')],'total':_0x10d5c6[_0xc7ff('0x27')],'type':_0x10d5c6[_0xc7ff('0x28')],'unmanaged':_0x10d5c6[_0xc7ff('0x29')],'abandoned':_0x10d5c6['abandoned'],'waiting':_0x10d5c6[_0xc7ff('0x2a')],'loggedInDb':_0x10d5c6[_0xc7ff('0x2b')]};if(_0x10d5c6['type']===_0xc7ff('0x2c')){_0x4431d9[_0xc7ff('0x2d')]=_0x10d5c6['dialActive'];_0x4431d9[_0xc7ff('0x2e')]=_0x10d5c6['dialMethod'];_0x4431d9['dialOriginateCallerIdName']=_0x10d5c6[_0xc7ff('0x2f')];_0x4431d9[_0xc7ff('0x30')]=_0x10d5c6[_0xc7ff('0x30')];_0x4431d9['dialOriginateTimeout']=_0x10d5c6['dialOriginateTimeout'];_0x4431d9[_0xc7ff('0x31')]=_0x10d5c6['dialPrefix'];_0x4431d9[_0xc7ff('0x32')]=_0x10d5c6[_0xc7ff('0x32')];_0x4431d9[_0xc7ff('0x33')]=_0x10d5c6[_0xc7ff('0x33')];_0x4431d9[_0xc7ff('0x34')]=_0x10d5c6['outboundBlacklistCallsDay'];_0x4431d9['outboundBusyCallsDay']=_0x10d5c6[_0xc7ff('0x35')];_0x4431d9[_0xc7ff('0x36')]=_0x10d5c6[_0xc7ff('0x36')];_0x4431d9['outboundDropCallsDayACS']=_0x10d5c6[_0xc7ff('0x37')];_0x4431d9[_0xc7ff('0x38')]=_0x10d5c6['outboundDropCallsDayCallersExit'];_0x4431d9[_0xc7ff('0x39')]=_0x10d5c6[_0xc7ff('0x39')];_0x4431d9['outboundNoAnswerCallsDay']=_0x10d5c6[_0xc7ff('0x3a')];_0x4431d9[_0xc7ff('0x3b')]=_0x10d5c6[_0xc7ff('0x3b')];_0x4431d9[_0xc7ff('0x3c')]=_0x10d5c6['outboundOriginateFailureCallsDay'];_0x4431d9[_0xc7ff('0x3d')]=_0x10d5c6[_0xc7ff('0x3d')];_0x4431d9[_0xc7ff('0x3e')]=_0x10d5c6[_0xc7ff('0x3e')];_0x4431d9[_0xc7ff('0x3f')]=_0x10d5c6[_0xc7ff('0x3f')];_0x4431d9[_0xc7ff('0x40')]=_0x10d5c6[_0xc7ff('0x40')];_0x4431d9[_0xc7ff('0x41')]=_0x10d5c6[_0xc7ff('0x41')];_0x4431d9[_0xc7ff('0x42')]=_0x10d5c6[_0xc7ff('0x42')];_0x4431d9[_0xc7ff('0x43')]=_0x10d5c6['predictiveIntervalDroppedCallsCallersExit'];_0x4431d9['predictiveIntervalDroppedCallsTimeout']=_0x10d5c6[_0xc7ff('0x44')];_0x4431d9[_0xc7ff('0x45')]=_0x10d5c6[_0xc7ff('0x45')];_0x4431d9[_0xc7ff('0x46')]=_0x10d5c6['predictiveIntervalErlangCallsDroppedCalls'];_0x4431d9['predictiveIntervalHitRate']=_0x10d5c6[_0xc7ff('0x47')];_0x4431d9['predictiveIntervalMultiplicativeFactor']=_0x10d5c6[_0xc7ff('0x48')];_0x4431d9[_0xc7ff('0x49')]=_0x10d5c6[_0xc7ff('0x49')];_0x4431d9[_0xc7ff('0x4a')]=_0x10d5c6[_0xc7ff('0x4a')];_0x4431d9[_0xc7ff('0x4b')]=_0x10d5c6['predictiveIntervalTotalCalls'];_0x4431d9['message']=_0x10d5c6[_0xc7ff('0x1b')];_0x4431d9[_0xc7ff('0x4c')]=_0x10d5c6['originated'];_0x4431d9[_0xc7ff('0x4d')]=_0x10d5c6['erlangCalls'];_0x4431d9[_0xc7ff('0x4e')]=_0x10d5c6[_0xc7ff('0x4e')];_0x4431d9['erlangAbandonmentRate']=_0x10d5c6['erlangAbandonmentRate'];_0x4431d9[_0xc7ff('0x4f')]=_0x10d5c6['erlangBusyFactor'];_0x4431d9[_0xc7ff('0x50')]=_0x10d5c6[_0xc7ff('0x50')];_0x4431d9[_0xc7ff('0x51')]=_0x10d5c6[_0xc7ff('0x51')];}if(_0x10d5c6['Trunk']){_0x4431d9[_0xc7ff('0x52')]={'id':_0x10d5c6[_0xc7ff('0x52')]['id'],'name':_0x10d5c6[_0xc7ff('0x52')]['name'],'active':_0x10d5c6[_0xc7ff('0x52')][_0xc7ff('0x53')],'callerid':_0x10d5c6[_0xc7ff('0x52')][_0xc7ff('0x54')]};}if(_0x10d5c6['Interval']){_0x4431d9[_0xc7ff('0x55')]={'id':_0x10d5c6[_0xc7ff('0x55')]['id'],'name':_0x10d5c6[_0xc7ff('0x55')][_0xc7ff('0x9')]};}_0x98767c[_0xc7ff('0x56')](_0x4431d9);}}_0x86c0a({'count':_0x98767c['length'],'rows':_0x98767c});});},'VoiceChannels':function(_0xb46d16){return new Promise(function(_0x60f431,_0xaeb8ff){var _0xd69fbc=_['values'](_0x3db011[_0xc7ff('0x57')]);_0x60f431({'count':_0xd69fbc[_0xc7ff('0x58')],'rows':_0xd69fbc});});},'VoiceChannelMixMonitor':function(_0x4dfd97){var _0x34264c=this;return new Promise(function(_0x436192,_0x2e405c){if(ami[_0xc7ff('0x10')]()==![]){return _0x2e405c(_0x34264c[_0xc7ff('0x11')](0x1f4,[config[_0xc7ff('0x12')]['ip'],config['asterisk']['username'],_0xc7ff('0x14')][_0xc7ff('0x15')]('\x20')));}var _0x213ad9=schema(properties[_0xc7ff('0x59')])[_0xc7ff('0x5a')](_0x4dfd97);if(_0x213ad9[_0xc7ff('0x58')]>0x0){return _0x2e405c(_0x34264c[_0xc7ff('0x11')](0x1f4,_[_0xc7ff('0x5b')](_0x213ad9,'message')['join'](',\x20')));}var _0x190823=_[_0xc7ff('0x5c')](_0x3db011['channels'],{'uniqueid':_0x4dfd97[_0xc7ff('0x5d')]});if(_0x190823&&_0x190823[_0xc7ff('0x5e')]){var _0x27c669=util[_0xc7ff('0x6')]('%s.%s',_0x4dfd97[_0xc7ff('0x5f')]||_0x4dfd97[_0xc7ff('0x5d')],_0x4dfd97[_0xc7ff('0x6')]||_0xc7ff('0x60'));return ami[_0xc7ff('0x61')]({'action':_0xc7ff('0x62'),'channel':_0x190823[_0xc7ff('0x5e')],'file':_0x27c669,'options':_0xc7ff('0x63')})[_0xc7ff('0x1a')](function(_0x398bef){var _0x5316e9=_[_0xc7ff('0x5c')](_0x190823[_0xc7ff('0x64')],{'filename':'/var/spool/asterisk/monitor/'+_0x27c669['toLowerCase']()});if(_[_0xc7ff('0x65')](_0x5316e9)){_0x190823[_0xc7ff('0x64')][_0xc7ff('0x56')]({'filename':_0xc7ff('0x66')+_0x27c669[_0xc7ff('0x67')](),'createdAt':moment()[_0xc7ff('0x6')](_0xc7ff('0x68')),'mixmonitorid':_0x398bef[_0xc7ff('0x69')],'status':'rec'});}else{_0x5316e9[_0xc7ff('0x69')]=_0x398bef[_0xc7ff('0x69')];_0x5316e9[_0xc7ff('0x6a')]='rec';}_0x436192({'code':0xc8,'message':[_0x4dfd97[_0xc7ff('0x5d')],_0xc7ff('0x6b'),_0x398bef[_0xc7ff('0x69')]][_0xc7ff('0x15')]('\x20'),'mixmonitorid':_0x398bef[_0xc7ff('0x69')]});})[_0xc7ff('0x1c')](function(_0x2fade8){_0x2e405c(_0x34264c[_0xc7ff('0x11')](0x1f5,[_0x4dfd97['uniqueid'],_0x2fade8[_0xc7ff('0x1b')][_0xc7ff('0x67')]()][_0xc7ff('0x15')]('\x20')));});}else{return _0x2e405c(_0x34264c[_0xc7ff('0x11')](0x1f5,_0xc7ff('0x6c')));}});},'VoiceChannelStopMixMonitor':function(_0x244e37){var _0x5e0e09=this;return new Promise(function(_0x3ee4f2,_0x1a99d6){if(ami[_0xc7ff('0x10')]()==![]){return _0x1a99d6(_0x5e0e09[_0xc7ff('0x11')](0x1f4,[config[_0xc7ff('0x12')]['ip'],config[_0xc7ff('0x12')][_0xc7ff('0x13')],'ami\x20disconnected']['join']('\x20')));}var _0x4475af=schema(properties[_0xc7ff('0x59')])[_0xc7ff('0x5a')](_0x244e37);if(_0x4475af[_0xc7ff('0x58')]>0x0){return _0x1a99d6(_0x5e0e09['error'](0x1f4,_['map'](_0x4475af,'message')[_0xc7ff('0x15')](',\x20')));}var _0x4aee8f=_[_0xc7ff('0x5c')](_0x3db011['channels'],{'uniqueid':_0x244e37[_0xc7ff('0x5d')]});if(_0x4aee8f){return BPromise['resolve']()[_0xc7ff('0x1a')](function(){if(_0x4aee8f[_0xc7ff('0x5e')]){return ami[_0xc7ff('0x61')]({'action':_0xc7ff('0x6d'),'channel':_0x4aee8f[_0xc7ff('0x5e')],'mixmonitorid':_0x244e37[_0xc7ff('0x69')]})['catch'](function(_0x186ebb){});}})[_0xc7ff('0x1a')](function(){if(_0x4aee8f['destinationchannel']){return ami[_0xc7ff('0x61')]({'action':'StopMixMonitor','channel':_0x4aee8f['destinationchannel'],'mixmonitorid':_0x244e37[_0xc7ff('0x69')]})[_0xc7ff('0x1c')](function(_0x5ddb6f){});}})[_0xc7ff('0x1a')](function(_0x33c2c0){var _0x435f5e=_['find'](_0x4aee8f[_0xc7ff('0x64')],{'mixmonitorid':_0x244e37['mixmonitorid']});if(_0x435f5e){_0x435f5e[_0xc7ff('0x6a')]=_0xc7ff('0x6e');}})[_0xc7ff('0x1a')](function(){var _0xe4c904=util[_0xc7ff('0x6')]('%s.%s',_0x244e37[_0xc7ff('0x5f')]||_0x244e37[_0xc7ff('0x5d')],_0x244e37['format']||_0xc7ff('0x60'));var _0x59ab3c=_['find'](_0x4aee8f['monitors'],{'filename':_0xc7ff('0x66')+_0xe4c904[_0xc7ff('0x67')]()});if(_0x59ab3c){_0x59ab3c[_0xc7ff('0x6a')]=_0xc7ff('0x6e');}})[_0xc7ff('0x1a')](function(){_0x3ee4f2({'code':0xc8,'message':[_0x244e37[_0xc7ff('0x5d')],'StopMixMonitor\x20Success'][_0xc7ff('0x15')]('\x20')});})[_0xc7ff('0x1c')](function(_0x51d44e){_0x1a99d6(_0x5e0e09[_0xc7ff('0x11')](0x1f5,[_0x244e37[_0xc7ff('0x5d')],_0x51d44e[_0xc7ff('0x1b')][_0xc7ff('0x67')]()][_0xc7ff('0x15')]('\x20')));});}else{return _0x1a99d6(_0x5e0e09['error'](0x1f5,_0xc7ff('0x6c')));}});},'VoiceQueuesChannels':function(_0x34549e){return new Promise(function(_0x58ee4e,_0x2f2513){var _0x10185e=_['values'](_0x3db011[_0xc7ff('0x6f')]);_0x58ee4e({'count':_0x10185e[_0xc7ff('0x58')],'rows':_0x10185e});});},'VoiceQueuesChannel':function(_0x17f776){var _0x2210b7=this;return new Promise(function(_0xbfdc69,_0x448b28){var _0x478732=schema(properties[_0xc7ff('0x70')])['validate'](_0x17f776);if(_0x478732[_0xc7ff('0x58')]>0x0){return _0x448b28(_0x2210b7[_0xc7ff('0x11')](0x1f4,_['map'](_0x478732,_0xc7ff('0x1b'))[_0xc7ff('0x15')](',\x20')));}var _0x137675=_['find'](_0x3db011['queueChannels'],{'uniqueid':_0x17f776[_0xc7ff('0x5d')]});if(_0x137675){_0xbfdc69(_0x137675);}else{return _0x448b28(_0x2210b7[_0xc7ff('0x11')](0x1f5,_0xc7ff('0x6c')));}});},'VoiceQueuesChannelHangup':function(_0xfc8bec){var _0x74ce30=this;return new Promise(function(_0x1c0358,_0x24276b){if(ami['isConnected']()==![]){return _0x24276b(_0x74ce30['error'](0x1f4,[config[_0xc7ff('0x12')]['ip'],config[_0xc7ff('0x12')][_0xc7ff('0x13')],_0xc7ff('0x14')][_0xc7ff('0x15')]('\x20')));}var _0x328b09=schema(properties['voicequeuechannelhangup'])[_0xc7ff('0x5a')](_0xfc8bec);if(_0x328b09['length']>0x0){return _0x24276b(_0x74ce30[_0xc7ff('0x11')](0x1f4,_['map'](_0x328b09,'message')[_0xc7ff('0x15')](',\x20')));}var _0x5c0f14=_[_0xc7ff('0x5c')](_0x3db011['queueChannels'],{'uniqueid':_0xfc8bec['uniqueid']});if(_0x5c0f14&&_0x5c0f14[_0xc7ff('0x5e')]){return ami[_0xc7ff('0x61')]({'action':'Hangup','channel':_0x5c0f14[_0xc7ff('0x5e')]})[_0xc7ff('0x1a')](function(_0x1eb728){_0x1c0358({'code':0xc8,'message':[_0xfc8bec[_0xc7ff('0x5d')],_0x1eb728[_0xc7ff('0x1b')][_0xc7ff('0x67')]()][_0xc7ff('0x15')]('\x20')});})[_0xc7ff('0x1c')](function(_0x1dd99d){_0x24276b(_0x74ce30['error'](0x1f5,[_0xfc8bec[_0xc7ff('0x5d')],_0x1dd99d[_0xc7ff('0x1b')]['toLowerCase']()][_0xc7ff('0x15')]('\x20')));});}else{return _0x24276b(_0x74ce30[_0xc7ff('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelRedirect':function(_0x3ee602){var _0x2a3e70=this;return new Promise(function(_0x2475fc,_0x21d1bf){if(ami['isConnected']()==![]){return _0x21d1bf(_0x2a3e70[_0xc7ff('0x11')](0x1f4,[config['asterisk']['ip'],config['asterisk']['username'],_0xc7ff('0x14')][_0xc7ff('0x15')]('\x20')));}var _0x2ab6f3=schema(properties['voicequeuechannelredirect'])[_0xc7ff('0x5a')](_0x3ee602);if(_0x2ab6f3[_0xc7ff('0x58')]>0x0){return _0x21d1bf(_0x2a3e70[_0xc7ff('0x11')](0x1f4,_['map'](_0x2ab6f3,_0xc7ff('0x1b'))[_0xc7ff('0x15')](',\x20')));}var _0x49b165=_[_0xc7ff('0x5c')](_0x3db011[_0xc7ff('0x6f')],{'uniqueid':_0x3ee602[_0xc7ff('0x5d')]});if(_0x49b165&&_0x49b165[_0xc7ff('0x5e')]){return ami[_0xc7ff('0x61')]({'action':'Redirect','channel':_0x49b165[_0xc7ff('0x5e')],'exten':_0x3ee602[_0xc7ff('0x71')],'context':_0x3ee602[_0xc7ff('0x72')]||_0x49b165[_0xc7ff('0x72')],'priority':0x1})[_0xc7ff('0x1a')](function(_0x3af8f8){_0x2475fc({'code':0xc8,'message':[_0x3ee602[_0xc7ff('0x5d')],_0x3af8f8[_0xc7ff('0x1b')][_0xc7ff('0x67')]()][_0xc7ff('0x15')]('\x20')});})[_0xc7ff('0x1c')](function(_0x578544){_0x21d1bf(_0x2a3e70[_0xc7ff('0x11')](0x1f5,[_0x3ee602[_0xc7ff('0x5d')],_0x578544[_0xc7ff('0x1b')][_0xc7ff('0x67')]()]['join']('\x20')));});}else{return _0x21d1bf(_0x2a3e70[_0xc7ff('0x11')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x13a9a3){return new Promise(function(_0x268e54,_0x417df9){var _0x5873d8=_[_0xc7ff('0x73')](_0x3db011[_0xc7ff('0xd')]);_0x268e54({'count':_0x5873d8[_0xc7ff('0x58')],'rows':_0x5873d8});});},'Telephones':function(_0x5aa6dd){return new Promise(function(_0x1d8c52,_0x5e9229){var _0x44a375=_[_0xc7ff('0x73')](_0x3db011[_0xc7ff('0x74')]);_0x1d8c52({'count':_0x44a375[_0xc7ff('0x58')],'rows':_0x44a375});});},'Trunks':function(_0x3647c9){return new Promise(function(_0xce8764,_0x45a6c0){var _0x493990=_[_0xc7ff('0x73')](_0x3db011[_0xc7ff('0x75')]);_0xce8764({'count':_0x493990[_0xc7ff('0x58')],'rows':_0x493990});});},'OutboundChannels':function(_0x3266a6){return new Promise(function(_0x23eaa9,_0x1cf8e4){var _0x4939f5=_[_0xc7ff('0x73')](_0x3db011[_0xc7ff('0x76')]);_0x23eaa9({'count':_0x4939f5[_0xc7ff('0x58')],'rows':_0x4939f5});});},'Outbound':function(_0x5a47c5){return new Promise(function(_0x4b5927,_0x15cb9b){_0x4b5927(_0x3db011[_0xc7ff('0x2c')]);});},'Campaigns':function(_0x2663bc){return new Promise(function(_0x3b94f7,_0x984c4b){var _0x390d9a=_[_0xc7ff('0x73')](_0x3db011[_0xc7ff('0x77')]);_0x3b94f7({'count':_0x390d9a[_0xc7ff('0x58')],'rows':_0x390d9a});});},'VoiceQueuesPreview':function(_0x5af6f1){var _0x37efae=this;return new Promise(function(_0x2d70b6,_0x4a9d83){_0x37ad0a[_0xc7ff('0x78')](_0x5af6f1['id'])[_0xc7ff('0x1a')](function(_0x5ccf9c){_0x2d70b6({'code':0xc8,'message':_0x5ccf9c[_0xc7ff('0x1b')]});})[_0xc7ff('0x1c')](function(_0x473ff2){_0x4a9d83(_0x37efae[_0xc7ff('0x11')](0x1f4,_0x473ff2['message']));});});},'EventManager':function(_0x57c92a){var _0x1b3f7f=this;return new Promise(function(_0x37ef48,_0x34b415){if(!_0x57c92a[_0xc7ff('0x79')]){return _0x34b415(_0x1b3f7f[_0xc7ff('0x11')](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xc7ff('0x7a')](_0xc7ff('0x7b')+_0x57c92a[_0xc7ff('0x79')],_0x57c92a[_0xc7ff('0x1b')]);_0x37ef48({'code':0xc8,'message':_0x57c92a});});},'FaxAccounts':function(_0x30f024){return new Promise(function(_0xbcf840,_0x42e97e){var _0x1bb9fb=_[_0xc7ff('0x73')](_0x3db011['faxAccounts']);_0xbcf840({'count':_0x1bb9fb[_0xc7ff('0x58')],'rows':_0x1bb9fb});});},'SendFax':function(_0x4a6087){var _0x464852=this;return new Promise(function(_0x20ecd0,_0x23c128){_0x2b9d31[_0xc7ff('0x7c')](_0x4a6087)[_0xc7ff('0x1a')](function(_0x24ef4a){_0x20ecd0({'code':0xc8,'message':_0x24ef4a[_0xc7ff('0x1b')]});})[_0xc7ff('0x1c')](function(_0x27782e){_0x23c128(_0x464852[_0xc7ff('0x11')](0x1f4,_0x27782e[_0xc7ff('0x1b')]));});});},'CheckAfterSend':function(_0xf37363){var _0x15ff35=this;return new Promise(function(_0x49ae9b,_0x5abefa){_0x2b9d31[_0xc7ff('0x7d')](_0xf37363)[_0xc7ff('0x1a')](function(_0x2ab166){_0x49ae9b({'code':0xc8,'message':_0x2ab166[_0xc7ff('0x1b')]});})['catch'](function(_0xe7098e){_0x5abefa(_0x15ff35[_0xc7ff('0x11')](0x1f4,_0xe7098e[_0xc7ff('0x1b')]));});});}};var _0x44a782=jayson['server'](_0xa488f2)[_0xc7ff('0x7e')]();_0x44a782['on'](_0xc7ff('0x11'),function(_0x5e850a){return _0x5cdc9a(_0x5e850a);});_0x44a782[_0xc7ff('0x5')](0x232a,_0xc7ff('0x7f'),function(){console[_0xc7ff('0x80')](_0xc7ff('0x81'),0x232a);return _0x3dbd2f('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file +var _0xf28a=['outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','callerid','Interval','push','values','length','voicechannel','map','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','isNil','mixmonitorid','rec','status','MixMonitor\x20Success','toLowerCase','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','/var/spool/asterisk/monitor/','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','telephones','trunks','campaigns','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','server','http','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','format','timers','timer','updateAcw','agents','pause','QueuePause','isConnected','error','username','join','keys','action','Reload','Action','then','catch','asterisk','ami\x20disconnected','pick','command','content','message','voiceQueues','hasOwnProperty','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumHoldTime','talking','type','unmanaged','waiting','outbound','dialActive','dialOriginateCallerIdNumber','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf28a,0xc7));var _0xaf28=function(_0x36fe99,_0x1f6e44){_0x36fe99=_0x36fe99-0x0;var _0x49dfc8=_0xf28a[_0x36fe99];return _0x49dfc8;};'use strict';var _=require(_0xaf28('0x0'));var util=require(_0xaf28('0x1'));var jayson=require(_0xaf28('0x2'));var schema=require(_0xaf28('0x3'));var BPromise=require(_0xaf28('0x4'));var moment=require(_0xaf28('0x5'));var config=require(_0xaf28('0x6'));var properties=require('../properties');var ami=require(_0xaf28('0x7'));exports['listen']=function(_0x3ba04d,_0x42270c,_0x35c9fb){return new BPromise(function(_0x2756f1,_0xc7254f){var _0x9d53ae={'QueuePause':function(_0x184ec6){return new Promise(function(_0x3aee69,_0x39d50d){var _0x22fe72=util[_0xaf28('0x8')]('%s/%s','SIP',_0x184ec6['name']);if(_0x3ba04d[_0xaf28('0x9')]&&_0x3ba04d[_0xaf28('0x9')][_0x22fe72]&&_0x3ba04d[_0xaf28('0x9')][_0x22fe72][_0xaf28('0xa')]){_0x3ba04d[_0xaf28('0x9')][_0x22fe72][_0xaf28('0xb')]();}if(_0x3ba04d[_0xaf28('0xc')][_0x22fe72]){_0x3ba04d[_0xaf28('0xc')][_0x22fe72]['updateStatusRealtime']({'statePause':_0x184ec6[_0xaf28('0xd')]?!![]:![]});}_0x3aee69({'code':0xc8,'message':_0xaf28('0xe')});});},'Reload':function(_0x2e0191){var _0x1ad6d4=this;return new Promise(function(_0x40aa6a,_0x611e88){if(ami[_0xaf28('0xf')]()==![]){return _0x611e88(_0x1ad6d4[_0xaf28('0x10')](0x1f4,[config['asterisk']['ip'],config['asterisk'][_0xaf28('0x11')],'ami\x20disconnected'][_0xaf28('0x12')]('\x20')));}_0x2e0191=_['pick'](_0x2e0191,_[_0xaf28('0x13')](properties['module']));_0x2e0191[_0xaf28('0x14')]=_0xaf28('0x15');return ami[_0xaf28('0x16')](_0x2e0191)[_0xaf28('0x17')](function(_0x3ec75e){_0x40aa6a({'code':0xc8,'message':_0x3ec75e['message']});})[_0xaf28('0x18')](function(_0x734f64){_0x611e88(_0x1ad6d4[_0xaf28('0x10')](0x1f5,_0x734f64['message']));});});},'Command':function(_0x4a5e17){var _0xd100ad=this;return new Promise(function(_0x442a92,_0xe7395){if(ami[_0xaf28('0xf')]()==![]){return _0xe7395(_0xd100ad[_0xaf28('0x10')](0x1f4,[config[_0xaf28('0x19')]['ip'],config[_0xaf28('0x19')][_0xaf28('0x11')],_0xaf28('0x1a')][_0xaf28('0x12')]('\x20')));}_0x4a5e17=_[_0xaf28('0x1b')](_0x4a5e17,_0xaf28('0x1c'));_0x4a5e17[_0xaf28('0x14')]='Command';return ami[_0xaf28('0x16')](_0x4a5e17)[_0xaf28('0x17')](function(_0x5926fc){_0x442a92({'code':0xc8,'message':_0x5926fc[_0xaf28('0x1d')]});})[_0xaf28('0x18')](function(_0x43374c){_0xe7395(_0xd100ad['error'](0x1f5,_0x43374c[_0xaf28('0x1e')]));});});},'VoiceQueues':function(_0xe37cfa){return new Promise(function(_0x310862,_0x2de5b5){var _0x7e668a=[];for(var _0x4f1bd0 in _0x3ba04d[_0xaf28('0x1f')]){if(_0x3ba04d[_0xaf28('0x1f')][_0xaf28('0x20')](_0x4f1bd0)){var _0x5a2579=_0x3ba04d[_0xaf28('0x1f')][_0x4f1bd0];var _0x247bb8={'id':_0x5a2579['id'],'name':_0x5a2579[_0xaf28('0x21')],'strategy':_0x5a2579[_0xaf28('0x22')],'answered':_0x5a2579[_0xaf28('0x23')],'available':_0x5a2579[_0xaf28('0x24')],'loggedIn':_0x5a2579[_0xaf28('0x25')],'pTalking':_0x5a2579[_0xaf28('0x26')],'sumBillable':_0x5a2579[_0xaf28('0x27')],'sumDuration':_0x5a2579['sumDuration'],'sumHoldTime':_0x5a2579[_0xaf28('0x28')]||0x0,'talking':_0x5a2579[_0xaf28('0x29')],'total':_0x5a2579['total'],'type':_0x5a2579[_0xaf28('0x2a')],'unmanaged':_0x5a2579[_0xaf28('0x2b')],'abandoned':_0x5a2579['abandoned'],'waiting':_0x5a2579[_0xaf28('0x2c')],'loggedInDb':_0x5a2579['loggedInDb']};if(_0x5a2579[_0xaf28('0x2a')]===_0xaf28('0x2d')){_0x247bb8[_0xaf28('0x2e')]=_0x5a2579[_0xaf28('0x2e')];_0x247bb8['dialMethod']=_0x5a2579['dialMethod'];_0x247bb8['dialOriginateCallerIdName']=_0x5a2579['dialOriginateCallerIdName'];_0x247bb8[_0xaf28('0x2f')]=_0x5a2579[_0xaf28('0x2f')];_0x247bb8['dialOriginateTimeout']=_0x5a2579['dialOriginateTimeout'];_0x247bb8[_0xaf28('0x30')]=_0x5a2579[_0xaf28('0x30')];_0x247bb8[_0xaf28('0x31')]=_0x5a2579['outboundAnswerAgiCallsDay'];_0x247bb8[_0xaf28('0x32')]=_0x5a2579[_0xaf28('0x32')];_0x247bb8[_0xaf28('0x33')]=_0x5a2579['outboundBlacklistCallsDay'];_0x247bb8['outboundBusyCallsDay']=_0x5a2579[_0xaf28('0x34')];_0x247bb8[_0xaf28('0x35')]=_0x5a2579[_0xaf28('0x35')];_0x247bb8[_0xaf28('0x36')]=_0x5a2579[_0xaf28('0x36')];_0x247bb8[_0xaf28('0x37')]=_0x5a2579[_0xaf28('0x37')];_0x247bb8[_0xaf28('0x38')]=_0x5a2579[_0xaf28('0x38')];_0x247bb8[_0xaf28('0x39')]=_0x5a2579[_0xaf28('0x39')];_0x247bb8['outboundNoSuchCallsDay']=_0x5a2579[_0xaf28('0x3a')];_0x247bb8[_0xaf28('0x3b')]=_0x5a2579[_0xaf28('0x3b')];_0x247bb8['outboundReCallsDay']=_0x5a2579[_0xaf28('0x3c')];_0x247bb8[_0xaf28('0x3d')]=_0x5a2579[_0xaf28('0x3d')];_0x247bb8[_0xaf28('0x3e')]=_0x5a2579[_0xaf28('0x3e')];_0x247bb8[_0xaf28('0x3f')]=_0x5a2579['predictiveIntervalAnsweredCalls'];_0x247bb8[_0xaf28('0x40')]=_0x5a2579[_0xaf28('0x40')];_0x247bb8[_0xaf28('0x41')]=_0x5a2579[_0xaf28('0x41')];_0x247bb8[_0xaf28('0x42')]=_0x5a2579[_0xaf28('0x42')];_0x247bb8['predictiveIntervalDroppedCallsTimeout']=_0x5a2579['predictiveIntervalDroppedCallsTimeout'];_0x247bb8['predictiveIntervalErlangCalls']=_0x5a2579[_0xaf28('0x43')];_0x247bb8['predictiveIntervalErlangCallsDroppedCalls']=_0x5a2579[_0xaf28('0x44')];_0x247bb8['predictiveIntervalHitRate']=_0x5a2579[_0xaf28('0x45')];_0x247bb8[_0xaf28('0x46')]=_0x5a2579['predictiveIntervalMultiplicativeFactor'];_0x247bb8[_0xaf28('0x47')]=_0x5a2579[_0xaf28('0x47')];_0x247bb8['predictiveIntervalAvailable']=_0x5a2579[_0xaf28('0x48')];_0x247bb8[_0xaf28('0x49')]=_0x5a2579[_0xaf28('0x49')];_0x247bb8['message']=_0x5a2579[_0xaf28('0x1e')];_0x247bb8[_0xaf28('0x4a')]=_0x5a2579[_0xaf28('0x4a')];_0x247bb8['erlangCalls']=_0x5a2579['erlangCalls'];_0x247bb8[_0xaf28('0x4b')]=_0x5a2579[_0xaf28('0x4b')];_0x247bb8[_0xaf28('0x4c')]=_0x5a2579[_0xaf28('0x4c')];_0x247bb8[_0xaf28('0x4d')]=_0x5a2579[_0xaf28('0x4d')];_0x247bb8[_0xaf28('0x4e')]=_0x5a2579['startPredictive'];_0x247bb8[_0xaf28('0x4f')]=_0x5a2579['startProgressive'];}if(_0x5a2579[_0xaf28('0x50')]){_0x247bb8[_0xaf28('0x50')]={'id':_0x5a2579[_0xaf28('0x50')]['id'],'name':_0x5a2579['Trunk'][_0xaf28('0x21')],'active':_0x5a2579[_0xaf28('0x50')]['active'],'callerid':_0x5a2579[_0xaf28('0x50')][_0xaf28('0x51')]};}if(_0x5a2579[_0xaf28('0x52')]){_0x247bb8[_0xaf28('0x52')]={'id':_0x5a2579[_0xaf28('0x52')]['id'],'name':_0x5a2579[_0xaf28('0x52')][_0xaf28('0x21')]};}_0x7e668a[_0xaf28('0x53')](_0x247bb8);}}_0x310862({'count':_0x7e668a['length'],'rows':_0x7e668a});});},'VoiceChannels':function(_0x15718f){return new Promise(function(_0x4516f5,_0x549b68){var _0x15c25a=_[_0xaf28('0x54')](_0x3ba04d['channels']);_0x4516f5({'count':_0x15c25a[_0xaf28('0x55')],'rows':_0x15c25a});});},'VoiceChannelMixMonitor':function(_0x6145fb){var _0x301801=this;return new Promise(function(_0x2d4b32,_0x4fe680){if(ami[_0xaf28('0xf')]()==![]){return _0x4fe680(_0x301801['error'](0x1f4,[config['asterisk']['ip'],config[_0xaf28('0x19')][_0xaf28('0x11')],_0xaf28('0x1a')]['join']('\x20')));}var _0x255bf3=schema(properties[_0xaf28('0x56')])['validate'](_0x6145fb);if(_0x255bf3['length']>0x0){return _0x4fe680(_0x301801[_0xaf28('0x10')](0x1f4,_[_0xaf28('0x57')](_0x255bf3,'message')[_0xaf28('0x12')](',\x20')));}var _0x51be4c=_[_0xaf28('0x58')](_0x3ba04d['channels'],{'uniqueid':_0x6145fb[_0xaf28('0x59')]});if(_0x51be4c&&_0x51be4c['channel']){var _0x434aae=util[_0xaf28('0x8')](_0xaf28('0x5a'),_0x6145fb[_0xaf28('0x5b')]||_0x6145fb[_0xaf28('0x59')],_0x6145fb[_0xaf28('0x8')]||_0xaf28('0x5c'));return ami[_0xaf28('0x16')]({'action':_0xaf28('0x5d'),'channel':_0x51be4c[_0xaf28('0x5e')],'file':_0x434aae,'options':_0xaf28('0x5f')})['then'](function(_0x5443e4){var _0x4b93f1=_[_0xaf28('0x58')](_0x51be4c[_0xaf28('0x60')],{'filename':'/var/spool/asterisk/monitor/'+_0x434aae['toLowerCase']()});if(_[_0xaf28('0x61')](_0x4b93f1)){_0x51be4c['monitors'][_0xaf28('0x53')]({'filename':'/var/spool/asterisk/monitor/'+_0x434aae['toLowerCase'](),'createdAt':moment()[_0xaf28('0x8')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x5443e4[_0xaf28('0x62')],'status':_0xaf28('0x63')});}else{_0x4b93f1[_0xaf28('0x62')]=_0x5443e4['mixmonitorid'];_0x4b93f1[_0xaf28('0x64')]=_0xaf28('0x63');}_0x2d4b32({'code':0xc8,'message':[_0x6145fb['uniqueid'],_0xaf28('0x65'),_0x5443e4[_0xaf28('0x62')]][_0xaf28('0x12')]('\x20'),'mixmonitorid':_0x5443e4['mixmonitorid']});})[_0xaf28('0x18')](function(_0x40e9a4){_0x4fe680(_0x301801[_0xaf28('0x10')](0x1f5,[_0x6145fb['uniqueid'],_0x40e9a4['message'][_0xaf28('0x66')]()][_0xaf28('0x12')]('\x20')));});}else{return _0x4fe680(_0x301801[_0xaf28('0x10')](0x1f5,_0xaf28('0x67')));}});},'VoiceChannelStopMixMonitor':function(_0xc8e197){var _0x64df52=this;return new Promise(function(_0x8e792f,_0x447b37){if(ami[_0xaf28('0xf')]()==![]){return _0x447b37(_0x64df52[_0xaf28('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xaf28('0x19')][_0xaf28('0x11')],'ami\x20disconnected']['join']('\x20')));}var _0x8f1214=schema(properties[_0xaf28('0x56')])[_0xaf28('0x3')](_0xc8e197);if(_0x8f1214[_0xaf28('0x55')]>0x0){return _0x447b37(_0x64df52[_0xaf28('0x10')](0x1f4,_[_0xaf28('0x57')](_0x8f1214,_0xaf28('0x1e'))[_0xaf28('0x12')](',\x20')));}var _0x313e75=_[_0xaf28('0x58')](_0x3ba04d['channels'],{'uniqueid':_0xc8e197['uniqueid']});if(_0x313e75){return BPromise['resolve']()[_0xaf28('0x17')](function(){if(_0x313e75[_0xaf28('0x5e')]){return ami[_0xaf28('0x16')]({'action':_0xaf28('0x68'),'channel':_0x313e75[_0xaf28('0x5e')],'mixmonitorid':_0xc8e197[_0xaf28('0x62')]})[_0xaf28('0x18')](function(_0x79c366){});}})[_0xaf28('0x17')](function(){if(_0x313e75[_0xaf28('0x69')]){return ami[_0xaf28('0x16')]({'action':_0xaf28('0x68'),'channel':_0x313e75[_0xaf28('0x69')],'mixmonitorid':_0xc8e197[_0xaf28('0x62')]})['catch'](function(_0x55e86d){});}})[_0xaf28('0x17')](function(_0x3002bb){var _0x4a02be=_['find'](_0x313e75['monitors'],{'mixmonitorid':_0xc8e197[_0xaf28('0x62')]});if(_0x4a02be){_0x4a02be[_0xaf28('0x64')]=_0xaf28('0x6a');}})['then'](function(){var _0x18c0d0=util[_0xaf28('0x8')](_0xaf28('0x5a'),_0xc8e197['filename']||_0xc8e197['uniqueid'],_0xc8e197[_0xaf28('0x8')]||_0xaf28('0x5c'));var _0x5bbe60=_['find'](_0x313e75['monitors'],{'filename':_0xaf28('0x6b')+_0x18c0d0[_0xaf28('0x66')]()});if(_0x5bbe60){_0x5bbe60[_0xaf28('0x64')]=_0xaf28('0x6a');}})['then'](function(){_0x8e792f({'code':0xc8,'message':[_0xc8e197[_0xaf28('0x59')],_0xaf28('0x6c')][_0xaf28('0x12')]('\x20')});})[_0xaf28('0x18')](function(_0x125970){_0x447b37(_0x64df52[_0xaf28('0x10')](0x1f5,[_0xc8e197[_0xaf28('0x59')],_0x125970[_0xaf28('0x1e')]['toLowerCase']()][_0xaf28('0x12')]('\x20')));});}else{return _0x447b37(_0x64df52[_0xaf28('0x10')](0x1f5,_0xaf28('0x67')));}});},'VoiceQueuesChannels':function(_0x283964){return new Promise(function(_0x117374,_0x5dad0c){var _0x15526d=_[_0xaf28('0x54')](_0x3ba04d[_0xaf28('0x6d')]);_0x117374({'count':_0x15526d['length'],'rows':_0x15526d});});},'VoiceQueuesChannel':function(_0x40de98){var _0x2472a3=this;return new Promise(function(_0x1c4069,_0xb1fb06){var _0x17aa79=schema(properties[_0xaf28('0x6e')])[_0xaf28('0x3')](_0x40de98);if(_0x17aa79[_0xaf28('0x55')]>0x0){return _0xb1fb06(_0x2472a3[_0xaf28('0x10')](0x1f4,_[_0xaf28('0x57')](_0x17aa79,_0xaf28('0x1e'))[_0xaf28('0x12')](',\x20')));}var _0x22721a=_[_0xaf28('0x58')](_0x3ba04d['queueChannels'],{'uniqueid':_0x40de98['uniqueid']});if(_0x22721a){_0x1c4069(_0x22721a);}else{return _0xb1fb06(_0x2472a3[_0xaf28('0x10')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x386b2a){var _0x18671c=this;return new Promise(function(_0x2c6053,_0x4b6f7d){if(ami[_0xaf28('0xf')]()==![]){return _0x4b6f7d(_0x18671c[_0xaf28('0x10')](0x1f4,[config[_0xaf28('0x19')]['ip'],config['asterisk'][_0xaf28('0x11')],_0xaf28('0x1a')][_0xaf28('0x12')]('\x20')));}var _0x1be733=schema(properties[_0xaf28('0x6f')])[_0xaf28('0x3')](_0x386b2a);if(_0x1be733[_0xaf28('0x55')]>0x0){return _0x4b6f7d(_0x18671c[_0xaf28('0x10')](0x1f4,_[_0xaf28('0x57')](_0x1be733,_0xaf28('0x1e'))[_0xaf28('0x12')](',\x20')));}var _0x32c2d0=_[_0xaf28('0x58')](_0x3ba04d[_0xaf28('0x6d')],{'uniqueid':_0x386b2a['uniqueid']});if(_0x32c2d0&&_0x32c2d0[_0xaf28('0x5e')]){return ami['Action']({'action':'Hangup','channel':_0x32c2d0[_0xaf28('0x5e')]})[_0xaf28('0x17')](function(_0x259356){_0x2c6053({'code':0xc8,'message':[_0x386b2a[_0xaf28('0x59')],_0x259356[_0xaf28('0x1e')][_0xaf28('0x66')]()][_0xaf28('0x12')]('\x20')});})[_0xaf28('0x18')](function(_0x2b6b64){_0x4b6f7d(_0x18671c[_0xaf28('0x10')](0x1f5,[_0x386b2a['uniqueid'],_0x2b6b64[_0xaf28('0x1e')][_0xaf28('0x66')]()][_0xaf28('0x12')]('\x20')));});}else{return _0x4b6f7d(_0x18671c[_0xaf28('0x10')](0x1f5,_0xaf28('0x67')));}});},'VoiceQueuesChannelRedirect':function(_0x2dd8c3){var _0x3dc1c6=this;return new Promise(function(_0x1d7fa9,_0x20132e){if(ami[_0xaf28('0xf')]()==![]){return _0x20132e(_0x3dc1c6[_0xaf28('0x10')](0x1f4,[config['asterisk']['ip'],config[_0xaf28('0x19')]['username'],_0xaf28('0x1a')][_0xaf28('0x12')]('\x20')));}var _0x4d4073=schema(properties[_0xaf28('0x70')])[_0xaf28('0x3')](_0x2dd8c3);if(_0x4d4073[_0xaf28('0x55')]>0x0){return _0x20132e(_0x3dc1c6[_0xaf28('0x10')](0x1f4,_[_0xaf28('0x57')](_0x4d4073,_0xaf28('0x1e'))[_0xaf28('0x12')](',\x20')));}var _0x43caae=_[_0xaf28('0x58')](_0x3ba04d[_0xaf28('0x6d')],{'uniqueid':_0x2dd8c3[_0xaf28('0x59')]});if(_0x43caae&&_0x43caae[_0xaf28('0x5e')]){return ami['Action']({'action':_0xaf28('0x71'),'channel':_0x43caae[_0xaf28('0x5e')],'exten':_0x2dd8c3[_0xaf28('0x72')],'context':_0x2dd8c3[_0xaf28('0x73')]||_0x43caae['context'],'priority':0x1})[_0xaf28('0x17')](function(_0x27d664){_0x1d7fa9({'code':0xc8,'message':[_0x2dd8c3[_0xaf28('0x59')],_0x27d664[_0xaf28('0x1e')][_0xaf28('0x66')]()][_0xaf28('0x12')]('\x20')});})[_0xaf28('0x18')](function(_0x287a98){_0x20132e(_0x3dc1c6['error'](0x1f5,[_0x2dd8c3[_0xaf28('0x59')],_0x287a98[_0xaf28('0x1e')][_0xaf28('0x66')]()][_0xaf28('0x12')]('\x20')));});}else{return _0x20132e(_0x3dc1c6[_0xaf28('0x10')](0x1f5,_0xaf28('0x67')));}});},'Agents':function(_0x396129){return new Promise(function(_0x2001da,_0x384c1f){var _0x278ec4=_['values'](_0x3ba04d[_0xaf28('0xc')]);_0x2001da({'count':_0x278ec4[_0xaf28('0x55')],'rows':_0x278ec4});});},'Telephones':function(_0x481147){return new Promise(function(_0x5cac90,_0x5dfe68){var _0x573fef=_[_0xaf28('0x54')](_0x3ba04d[_0xaf28('0x74')]);_0x5cac90({'count':_0x573fef[_0xaf28('0x55')],'rows':_0x573fef});});},'Trunks':function(_0x268a1d){return new Promise(function(_0x30e6d8,_0x27aaf2){var _0x2c2a20=_[_0xaf28('0x54')](_0x3ba04d[_0xaf28('0x75')]);_0x30e6d8({'count':_0x2c2a20[_0xaf28('0x55')],'rows':_0x2c2a20});});},'OutboundChannels':function(_0x27d67f){return new Promise(function(_0x31215a,_0x93bab3){var _0x51face=_[_0xaf28('0x54')](_0x3ba04d['outboundChannels']);_0x31215a({'count':_0x51face[_0xaf28('0x55')],'rows':_0x51face});});},'Outbound':function(_0x24a621){return new Promise(function(_0x21d974,_0x2a7524){_0x21d974(_0x3ba04d[_0xaf28('0x2d')]);});},'Campaigns':function(_0x3c3387){return new Promise(function(_0x366787,_0x4f5583){var _0x3f333a=_[_0xaf28('0x54')](_0x3ba04d[_0xaf28('0x76')]);_0x366787({'count':_0x3f333a['length'],'rows':_0x3f333a});});},'VoiceQueuesPreview':function(_0x5c6ff9){var _0x4c82ab=this;return new Promise(function(_0x1176c9,_0x4e7937){_0x42270c[_0xaf28('0x77')](_0x5c6ff9['id'])['then'](function(_0x3897e3){_0x1176c9({'code':0xc8,'message':_0x3897e3[_0xaf28('0x1e')]});})['catch'](function(_0x418a38){_0x4e7937(_0x4c82ab[_0xaf28('0x10')](0x1f4,_0x418a38[_0xaf28('0x1e')]));});});},'EventManager':function(_0x5a90c5){var _0x1d8ccb=this;return new Promise(function(_0x290612,_0x125e7b){if(!_0x5a90c5[_0xaf28('0x78')]){return _0x125e7b(_0x1d8ccb[_0xaf28('0x10')](0x1f4,_0xaf28('0x79')));}ami[_0xaf28('0x7a')](_0xaf28('0x7b')+_0x5a90c5[_0xaf28('0x78')],_0x5a90c5['message']);_0x290612({'code':0xc8,'message':_0x5a90c5});});},'FaxAccounts':function(_0x2fdfcc){return new Promise(function(_0x3eac40,_0x41882b){var _0x470c79=_[_0xaf28('0x54')](_0x3ba04d[_0xaf28('0x7c')]);_0x3eac40({'count':_0x470c79[_0xaf28('0x55')],'rows':_0x470c79});});},'SendFax':function(_0xeb1340){var _0x111246=this;return new Promise(function(_0x1eaacd,_0x35454a){_0x35c9fb[_0xaf28('0x7d')](_0xeb1340)[_0xaf28('0x17')](function(_0x3ccff5){_0x1eaacd({'code':0xc8,'message':_0x3ccff5[_0xaf28('0x1e')]});})['catch'](function(_0x55d933){_0x35454a(_0x111246[_0xaf28('0x10')](0x1f4,_0x55d933[_0xaf28('0x1e')]));});});},'CheckAfterSend':function(_0x4bda1a){var _0x1e73a5=this;return new Promise(function(_0x3b6466,_0x15ebac){_0x35c9fb[_0xaf28('0x7e')](_0x4bda1a)[_0xaf28('0x17')](function(_0x4e1988){_0x3b6466({'code':0xc8,'message':_0x4e1988[_0xaf28('0x1e')]});})[_0xaf28('0x18')](function(_0x3b231c){_0x15ebac(_0x1e73a5[_0xaf28('0x10')](0x1f4,_0x3b231c[_0xaf28('0x1e')]));});});}};var _0x40cf6b=jayson[_0xaf28('0x7f')](_0x9d53ae)[_0xaf28('0x80')]();_0x40cf6b['on'](_0xaf28('0x10'),function(_0x14a17f){return _0xc7254f(_0x14a17f);});_0x40cf6b['listen'](0x232a,'127.0.0.1',function(){console['log'](_0xaf28('0x81'),0x232a);return _0x2756f1('RPC\x20listening\x20on\x20port:'+0x232a);});});}; \ No newline at end of file diff --git a/server/services/ami/trigger/cmContact/index.js b/server/services/ami/trigger/cmContact/index.js index fa43c4b..c50b52a 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 _0xee8f=['ioredis','../../../../config/environment','../../../../config/logger','trigger','redis','localhost','socket.io-emitter','stringify','emit','exec','autoCreate','data2','data1','calleridnum','isNil','calleridname','','firstName','destcalleridname','destcalleridnum','uniqueid','phone','resolve','then','omit','user:%s','name','format','trigger:%s','toLowerCase','merge','createContact','xmd-contactid2','action','catch','error','Error\x20creating\x20contact','util'];(function(_0x3a62a7,_0x46f305){var _0x2406f3=function(_0x5083bd){while(--_0x5083bd){_0x3a62a7['push'](_0x3a62a7['shift']());}};_0x2406f3(++_0x46f305);}(_0xee8f,0x1ed));var _0xfee8=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xee8f[_0x3e5086];return _0xfeb102;};'use strict';var BPromise=require('bluebird');var util=require(_0xfee8('0x0'));var _=require('lodash');var Redis=require(_0xfee8('0x1'));var config=require(_0xfee8('0x2'));var logger=require(_0xfee8('0x3'))(_0xfee8('0x4'));var cmContactRpc=require('../../rpc/cmContact');config['redis']=_['defaults'](config[_0xfee8('0x5')],{'host':_0xfee8('0x6'),'port':0x18eb});var io=require(_0xfee8('0x7'))(new Redis(config['redis']));function emit(_0x1edd18,_0x38d68c,_0x5d9ae1){logger['info'](_0x1edd18,_0x38d68c,JSON[_0xfee8('0x8')](_0x5d9ae1));io['to'](_0x1edd18)[_0xfee8('0x9')](_0x38d68c,_0x5d9ae1);}exports[_0xfee8('0xa')]=function(_0x5ac463,_0x4fc2e8,_0x301383){_0x301383[_0xfee8('0xb')]=0x0;if(_0x4fc2e8[_0xfee8('0xc')]&&parseInt(_0x4fc2e8[_0xfee8('0xc')],0xa)){var _0x250af7={'ListId':parseInt(_0x4fc2e8[_0xfee8('0xd')],0xa),'phone':_0x301383[_0xfee8('0xe')]};if(_[_0xfee8('0xf')](_0x301383['routeId'])){_0x250af7['firstName']=_0x301383['calleridname']&&_0x301383[_0xfee8('0x10')]!==_0xfee8('0x11')?_0x301383[_0xfee8('0x10')]:_0x301383['calleridnum']||_0x301383['uniqueid'];}else{_0x250af7[_0xfee8('0x12')]=_0x301383[_0xfee8('0x13')]&&_0x301383[_0xfee8('0x13')]!==_0xfee8('0x11')?_0x301383[_0xfee8('0x13')]:_0x301383[_0xfee8('0x14')]||_0x301383[_0xfee8('0x15')];_0x250af7[_0xfee8('0x16')]=_0x301383[_0xfee8('0x13')]&&_0x301383[_0xfee8('0x13')]!==_0xfee8('0x11')?_0x301383[_0xfee8('0x13')]:_0x301383['destcalleridnum']||_0x301383['uniqueid'];}BPromise[_0xfee8('0x17')]()[_0xfee8('0x18')](cmContactRpc['showContact']({'where':_[_0xfee8('0x19')](_0x250af7,[_0xfee8('0x12')])}))['then'](function(_0x45df7b){if(_0x45df7b){_0x301383['xmd-contactid2']=_0x45df7b['id'];emit(util['format'](_0xfee8('0x1a'),_0x5ac463[_0xfee8('0x1b')]),util[_0xfee8('0x1c')](_0xfee8('0x1d'),_0x4fc2e8['action'][_0xfee8('0x1e')]()),_[_0xfee8('0x1f')](_0x301383,{'ListId':parseInt(_0x4fc2e8[_0xfee8('0xd')],0xa)}));return;}else{return BPromise[_0xfee8('0x17')]()[_0xfee8('0x18')](cmContactRpc[_0xfee8('0x20')](_0x250af7));}})[_0xfee8('0x18')](function(_0x4f3e62){if(_0x4f3e62){_0x301383[_0xfee8('0x21')]=_0x4f3e62['id'];emit(util['format'](_0xfee8('0x1a'),_0x5ac463['name']),util[_0xfee8('0x1c')]('trigger:%s',_0x4fc2e8[_0xfee8('0x22')][_0xfee8('0x1e')]()),_['merge'](_0x301383,{'ListId':parseInt(_0x4fc2e8[_0xfee8('0xd')],0xa)}));}})[_0xfee8('0x23')](function(_0x57aca6){logger[_0xfee8('0x24')](_0xfee8('0x25'),JSON[_0xfee8('0x8')](_0x57aca6));});}else{if(_0x5ac463){emit(util[_0xfee8('0x1c')](_0xfee8('0x1a'),_0x5ac463['name']),util[_0xfee8('0x1c')](_0xfee8('0x1d'),_0x4fc2e8[_0xfee8('0x22')][_0xfee8('0x1e')]()),_[_0xfee8('0x1f')]({'ListId':parseInt(_0x4fc2e8[_0xfee8('0xd')],0xa)},_0x301383));}}}; \ No newline at end of file +var _0xdd4f=['localhost','socket.io-emitter','info','emit','exec','data2','data1','calleridnum','isNil','routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','showContact','omit','format','user:%s','name','trigger:%s','action','toLowerCase','merge','createContact','xmd-contactid2','catch','error','stringify','bluebird','../../../../config/environment','../../../../config/logger','../../rpc/cmContact','redis','defaults'];(function(_0x5164eb,_0x1688a7){var _0x1ab88b=function(_0x113c69){while(--_0x113c69){_0x5164eb['push'](_0x5164eb['shift']());}};_0x1ab88b(++_0x1688a7);}(_0xdd4f,0x1ce));var _0xfdd4=function(_0x1e80d2,_0x11d031){_0x1e80d2=_0x1e80d2-0x0;var _0x13a94c=_0xdd4f[_0x1e80d2];return _0x13a94c;};'use strict';var BPromise=require(_0xfdd4('0x0'));var util=require('util');var _=require('lodash');var Redis=require('ioredis');var config=require(_0xfdd4('0x1'));var logger=require(_0xfdd4('0x2'))('trigger');var cmContactRpc=require(_0xfdd4('0x3'));config[_0xfdd4('0x4')]=_[_0xfdd4('0x5')](config['redis'],{'host':_0xfdd4('0x6'),'port':0x18eb});var io=require(_0xfdd4('0x7'))(new Redis(config[_0xfdd4('0x4')]));function emit(_0x307ac6,_0x3c72d4,_0x51acd6){logger[_0xfdd4('0x8')](_0x307ac6,_0x3c72d4,JSON['stringify'](_0x51acd6));io['to'](_0x307ac6)[_0xfdd4('0x9')](_0x3c72d4,_0x51acd6);}exports[_0xfdd4('0xa')]=function(_0x1e823e,_0x4ee02f,_0x3d06c9){_0x3d06c9['autoCreate']=0x0;if(_0x4ee02f[_0xfdd4('0xb')]&&parseInt(_0x4ee02f[_0xfdd4('0xb')],0xa)){var _0x210c7d={'ListId':parseInt(_0x4ee02f[_0xfdd4('0xc')],0xa),'phone':_0x3d06c9[_0xfdd4('0xd')]};if(_[_0xfdd4('0xe')](_0x3d06c9[_0xfdd4('0xf')])){_0x210c7d[_0xfdd4('0x10')]=_0x3d06c9[_0xfdd4('0x11')]&&_0x3d06c9[_0xfdd4('0x11')]!==_0xfdd4('0x12')?_0x3d06c9['calleridname']:_0x3d06c9[_0xfdd4('0xd')]||_0x3d06c9[_0xfdd4('0x13')];}else{_0x210c7d[_0xfdd4('0x10')]=_0x3d06c9['destcalleridname']&&_0x3d06c9[_0xfdd4('0x14')]!==''?_0x3d06c9[_0xfdd4('0x14')]:_0x3d06c9[_0xfdd4('0x15')]||_0x3d06c9[_0xfdd4('0x13')];_0x210c7d[_0xfdd4('0x16')]=_0x3d06c9[_0xfdd4('0x14')]&&_0x3d06c9['destcalleridname']!==''?_0x3d06c9['destcalleridname']:_0x3d06c9[_0xfdd4('0x15')]||_0x3d06c9[_0xfdd4('0x13')];}BPromise[_0xfdd4('0x17')]()[_0xfdd4('0x18')](cmContactRpc[_0xfdd4('0x19')]({'where':_[_0xfdd4('0x1a')](_0x210c7d,[_0xfdd4('0x10')])}))[_0xfdd4('0x18')](function(_0x32e00d){if(_0x32e00d){_0x3d06c9['xmd-contactid2']=_0x32e00d['id'];emit(util[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x1e823e[_0xfdd4('0x1d')]),util[_0xfdd4('0x1b')](_0xfdd4('0x1e'),_0x4ee02f[_0xfdd4('0x1f')][_0xfdd4('0x20')]()),_[_0xfdd4('0x21')](_0x3d06c9,{'ListId':parseInt(_0x4ee02f['data1'],0xa)}));return;}else{return BPromise[_0xfdd4('0x17')]()[_0xfdd4('0x18')](cmContactRpc[_0xfdd4('0x22')](_0x210c7d));}})[_0xfdd4('0x18')](function(_0xb7856d){if(_0xb7856d){_0x3d06c9[_0xfdd4('0x23')]=_0xb7856d['id'];emit(util[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x1e823e['name']),util[_0xfdd4('0x1b')](_0xfdd4('0x1e'),_0x4ee02f[_0xfdd4('0x1f')]['toLowerCase']()),_[_0xfdd4('0x21')](_0x3d06c9,{'ListId':parseInt(_0x4ee02f[_0xfdd4('0xc')],0xa)}));}})[_0xfdd4('0x24')](function(_0x2f8268){logger[_0xfdd4('0x25')]('Error\x20creating\x20contact',JSON[_0xfdd4('0x26')](_0x2f8268));});}else{if(_0x1e823e){emit(util[_0xfdd4('0x1b')](_0xfdd4('0x1c'),_0x1e823e[_0xfdd4('0x1d')]),util[_0xfdd4('0x1b')](_0xfdd4('0x1e'),_0x4ee02f[_0xfdd4('0x1f')][_0xfdd4('0x20')]()),_['merge']({'ListId':parseInt(_0x4ee02f[_0xfdd4('0xc')],0xa)},_0x3d06c9));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index e20b96a..dc912d3 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 _0xdf46=['interaction','message','event','agent','membername','lastevent','routeId','exports','lodash','mustache','ioredis','./urlforward','./cmContact','../ami','redis','defaults','socket.io-emitter','popup','url','winapp','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','vtigerAccounts','servicenowAccounts','freshsalesAccounts','accounts','deskAccounts','dynamics365Accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentconnect','custom:agentringnoanswer','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction','custom:incomingmessage','custom:acceptmessage','custom:rejectmessage','prototype','emit','info','clone','checkTriggers','interface','triggers','hasOwnProperty','checkTrigger','merge','variables','Actions','toLowerCase','data1','TemplateId','data2','html','render','uri','isNil','data3','data4','location','uriLocation','windowWidth','data5','800','600','data6','winApplication','format','user:%s','name','trigger:%s:%s','action','jscripty','trigger:%s','contactmanager','exec','integration','queue','urlforward','script','buildUri','parse','search','replace','length','every','AllConditions','checkConditions','AnyConditions','some','field','account','channel','chat','ChatWebsiteId','operator','value','upperFirst','AccountId'];(function(_0x2403d4,_0x331736){var _0x167464=function(_0x1ab965){while(--_0x1ab965){_0x2403d4['push'](_0x2403d4['shift']());}};_0x167464(++_0x331736);}(_0xdf46,0x76));var _0x6df4=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xdf46[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0x6df4('0x0'));var url=require('url');var Mustache=require(_0x6df4('0x1'));var Redis=require(_0x6df4('0x2'));var urlforward=require(_0x6df4('0x3'));var integration=require('./integration');var cmContact=require(_0x6df4('0x4'));var script=require('./script');var cmContactRpc=require('../rpc/cmContact');var config=require('../../../config/environment');var logger=require('../../../config/logger')('trigger');var ami=require(_0x6df4('0x5'));config[_0x6df4('0x6')]=_[_0x6df4('0x7')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x6df4('0x8'))(new Redis(config[_0x6df4('0x6')]));var operators={'equals':function(_0x471092,_0x13fad4){return _0x471092==_0x13fad4;},'not_equals':function(_0x375871,_0x4b51f1){return _0x375871!=_0x4b51f1;}};var barAndWebActions=[_0x6df4('0x9'),_0x6df4('0xa'),_0x6df4('0xb')];function Trigger(_0x2e0242){this['triggers']=_0x2e0242['triggers'];this['agents']=_0x2e0242[_0x6df4('0xc')];this[_0x6df4('0xd')]=_0x2e0242[_0x6df4('0xd')];this[_0x6df4('0xe')]=_0x2e0242['templates'];this[_0x6df4('0xf')]=_0x2e0242[_0x6df4('0xf')];this[_0x6df4('0x10')]=_0x2e0242[_0x6df4('0x10')];this[_0x6df4('0x11')]=_0x2e0242[_0x6df4('0x11')];this[_0x6df4('0x12')]=_0x2e0242[_0x6df4('0x12')];this[_0x6df4('0x13')]=_0x2e0242[_0x6df4('0x13')];this[_0x6df4('0x14')]=_0x2e0242[_0x6df4('0x14')];this['deskAccounts']=_0x2e0242['deskAccounts'];this[_0x6df4('0x15')]=_0x2e0242[_0x6df4('0x15')];this[_0x6df4('0x16')]=_0x2e0242[_0x6df4('0x16')];this['dynamics365Accounts']=_0x2e0242['dynamics365Accounts'];this[_0x6df4('0x17')]=_0x2e0242[_0x6df4('0x17')];this[_0x6df4('0x18')]={'zendesk':this[_0x6df4('0x10')],'salesforce':this['salesforceAccounts'],'freshdesk':this['freshdeskAccounts'],'sugarcrm':this[_0x6df4('0x13')],'zoho':this[_0x6df4('0x14')],'desk':this[_0x6df4('0x19')],'vtiger':this[_0x6df4('0x15')],'dynamics365':this[_0x6df4('0x1a')],'freshsales':this['freshsalesAccounts'],'servicenow':this[_0x6df4('0x16')]};ami['on'](_0x6df4('0x1b'),this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x1e'),this['syncCustomEvent'][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x1f'),this['syncCustomEvent'][_0x6df4('0x1d')](this));ami['on']('custom:agentcomplete',this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));ami['on']('custom:queuecallerabandon',this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));ami['on']('custom:dialbegin',this[_0x6df4('0x20')]['bind'](this));ami['on'](_0x6df4('0x21'),this[_0x6df4('0x20')]['bind'](this));ami['on'](_0x6df4('0x22'),this[_0x6df4('0x20')][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x23'),this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x24'),this[_0x6df4('0x1c')]['bind'](this));ami['on'](_0x6df4('0x25'),this['syncCustomEvent'][_0x6df4('0x1d')](this));ami['on']('custom:outgoingmessage',this['syncCustomEvent'][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x26'),this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));ami['on'](_0x6df4('0x27'),this[_0x6df4('0x1c')][_0x6df4('0x1d')](this));}Trigger[_0x6df4('0x28')][_0x6df4('0x29')]=function(_0x4c6b0b,_0x1ed506,_0xbfb588){logger[_0x6df4('0x2a')](_0x4c6b0b,_0x1ed506,JSON['stringify'](_0xbfb588));io['to'](_0x4c6b0b)[_0x6df4('0x29')](_0x1ed506,_0xbfb588);};Trigger[_0x6df4('0x28')][_0x6df4('0x1c')]=function(_0x32bf6f){var _0x183454=_[_0x6df4('0x2b')](_0x32bf6f);this[_0x6df4('0x2c')](_0x183454);};Trigger['prototype'][_0x6df4('0x20')]=function(_0x45e823){if(this[_0x6df4('0xc')][_0x45e823[_0x6df4('0x2d')]]){this[_0x6df4('0x1c')](_0x45e823);}};Trigger[_0x6df4('0x28')][_0x6df4('0x2c')]=function(_0x301e1c){var _0xf7a92f;for(var _0x1e5c91 in this[_0x6df4('0x2e')]){if(this['triggers'][_0x6df4('0x2f')](_0x1e5c91)){if(this[_0x6df4('0x2e')][_0x1e5c91]['status']){_0xf7a92f=this[_0x6df4('0x30')](this['triggers'][_0x1e5c91],_0x301e1c);if(_0xf7a92f){_[_0x6df4('0x31')](_0x301e1c,_0x301e1c[_0x6df4('0x32')]);for(var _0x127e55=0x0,_0xb78e58,_0x273c10,_0x5231b5;_0x127e550x0){_0x345be5=_[_0x369d('0x2c')](_0x357e94,_0xf952a3);}return _0x345be5;}function getCustomFields(_0x4d42ea,_0x157291){var _0x56efb1=[];var _0x57b94c={'custom_fields':{}};if(_0x4d42ea[_0x369d('0x2b')]>0x0){_[_0x369d('0x2d')](_0x4d42ea,function(_0x5844c7){if(_0x5844c7[_0x369d('0x2e')]==='string'&&_0x5844c7[_0x369d('0x2f')]&&!_0x5844c7[_0x369d('0x30')]){_0x57b94c[_0x5844c7[_0x369d('0x2f')][_0x369d('0x31')]()]=_0x5844c7[_0x369d('0x32')][_0x369d('0x21')]();}else if(_0x5844c7[_0x369d('0x2e')]==='string'&&_0x5844c7[_0x369d('0x33')]&&_0x5844c7[_0x369d('0x30')]){_0x57b94c[_0x369d('0x34')][_0x5844c7[_0x369d('0x33')]]=_0x5844c7[_0x369d('0x32')][_0x369d('0x21')]();}else if(_0x5844c7[_0x369d('0x2e')]===_0x369d('0x35')&&_0x5844c7['variableName']&&_0x5844c7[_0x369d('0x33')]&&_0x5844c7[_0x369d('0x30')]){_0x157291[_0x5844c7[_0x369d('0x36')]]&&(_0x57b94c[_0x369d('0x34')][_0x5844c7[_0x369d('0x33')]]=_0x157291[_0x5844c7['variableName']][_0x369d('0x21')]());}else if(_0x5844c7[_0x369d('0x2e')]===_0x369d('0x37')&&_0x5844c7[_0x369d('0x38')]&&_0x5844c7[_0x369d('0x38')][_0x369d('0x39')]&&_0x5844c7['idField']&&_0x5844c7[_0x369d('0x30')]){_0x157291[_0x5844c7[_0x369d('0x38')][_0x369d('0x39')][_0x369d('0x31')]()]&&(_0x57b94c[_0x369d('0x34')][_0x5844c7[_0x369d('0x33')]]=_0x157291[_0x5844c7[_0x369d('0x38')][_0x369d('0x39')][_0x369d('0x31')]()][_0x369d('0x21')]());}});}if(_0x57b94c[_0x369d('0x3a')]){_0x57b94c[_0x369d('0x3a')]=Number(_0x57b94c[_0x369d('0x3a')]);}return _0x57b94c;}function getTicket(_0x43d734,_0x56922d,_0x166944,_0x2ef7ae,_0x69c7af){logger[_0x369d('0xc')](_0x369d('0x3b'));var _0x10c5b6=_[_0x369d('0x3c')]({'subject':intUtil[_0x369d('0x3d')](_0x2ef7ae[_0x369d('0x3e')],_0x69c7af,'\x20'),'type':'phone','status':'new','labels':[_0x369d('0x3f'),_0x369d('0x40'),_0x369d('0x41')][_0x369d('0x42')](getTags(_0x2ef7ae[_0x369d('0x43')],_0x369d('0x39'))),'description':intUtil[_0x369d('0x3d')](_0x2ef7ae[_0x369d('0x44')],_0x69c7af,'\x0a'),'_links':{'assigned_user':{'href':util[_0x369d('0x1f')]('/api/v2/users/%d',_0x56922d['id']),'class':_0x369d('0x45')}},'message':{'direction':'in','body':intUtil[_0x369d('0x3d')](_0x2ef7ae[_0x369d('0x44')],_0x69c7af,'\x0a')}},getCustomFields(_0x2ef7ae[_0x369d('0x46')],_0x69c7af));return request({'uri':util[_0x369d('0x1f')](_0x369d('0x47'),_0x43d734[_0x369d('0xe')],_0x166944['id']),'method':_0x369d('0x29'),'body':_0x10c5b6});}exports['queue']=function(_0x5849a3,_0x20b351,_0x3222ce,_0x30909a,_0x4dad71,_0x4d07ac){var _0x4d29bf,_0x274d2d;_0x4d07ac[_0x369d('0xe')]=intUtil['stripTrailingSlash'](_0x4d07ac[_0x369d('0xe')]);_0x4d07ac[_0x369d('0x48')]=intUtil[_0x369d('0x49')](_0x4d07ac[_0x369d('0x48')]);if(_0x4dad71&&_0x4dad71['monitor_format']){logger[_0x369d('0xc')]('[QUEUE]',_0x369d('0x4a'));_0x20b351['recordingURL']=util[_0x369d('0x1f')](_0x369d('0x4b'),_0x4d07ac[_0x369d('0x48')],_0x20b351['uniqueid'],md5(_0x20b351['uniqueid']));}else{_0x20b351[_0x369d('0x4c')]='';}headers[_0x369d('0x4d')]=getAuth(_0x4d07ac);return getUser(_0x4d07ac,_0x30909a[_0x369d('0x4e')])['then'](function(_0x94353f){_0x4d29bf=_0x94353f;logger[_0x369d('0xc')](_0x369d('0x4f'),_0x4d29bf['id']);return getEndUser(_0x4d07ac,_0x20b351[_0x369d('0x50')],_0x20b351[_0x369d('0x51')]);})[_0x369d('0xf')](function(_0x744290){_0x274d2d=_0x744290;logger[_0x369d('0xc')](_0x369d('0x52'),_0x274d2d['id']);return getTicket(_0x4d07ac,_0x4d29bf,_0x274d2d,_0x3222ce,_0x20b351);})['then'](function(_0x11ce32){if(_0x11ce32){logger[_0x369d('0xc')](_0x369d('0x53'));logger[_0x369d('0xc')](_0x369d('0x54'),_0x11ce32['id']);switch(_0x4d07ac[_0x369d('0x2e')]){case'integrationTab':logger[_0x369d('0xc')](_0x369d('0x55'),_0x369d('0x56'));emit(util[_0x369d('0x1f')](_0x369d('0x57'),_0x30909a[_0x369d('0x39')]),_0x369d('0x58'),{'recordId':_0x11ce32['id']});break;case _0x369d('0x59'):logger[_0x369d('0xc')](_0x369d('0x55'),_0x369d('0x5a'));emit(util[_0x369d('0x1f')]('user:%s',_0x30909a[_0x369d('0x39')]),_0x369d('0x5b'),{'uri':util[_0x369d('0x1f')](_0x369d('0x5c'),_0x11ce32['id'])});break;default:logger[_0x369d('0x5d')]('[QUEUE]',_0x369d('0x5e'));}}})['catch'](function(_0x103e9e){console[_0x369d('0x5d')](_0x103e9e);logger[_0x369d('0x5d')](_0x369d('0x55'),JSON[_0x369d('0x17')](_0x103e9e));});};exports[_0x369d('0x5f')]=function(_0x22e2d4,_0x418cab,_0x1cdeca,_0x9f1544,_0x4d582a,_0x5a3dd4,_0x203750){var _0x38ee10,_0x18cd5f;_0x5a3dd4[_0x369d('0xe')]=intUtil[_0x369d('0x49')](_0x5a3dd4['remoteUri']);_0x5a3dd4['serverUrl']=intUtil[_0x369d('0x49')](_0x5a3dd4[_0x369d('0x48')]);if(_0x203750&&_0x203750['recordingFormat']&&_0x203750[_0x369d('0x60')]!=='none'){logger[_0x369d('0xc')](_0x369d('0x61'),_0x369d('0x4a'));_0x418cab['recordingURL']=util[_0x369d('0x1f')](_0x369d('0x4b'),_0x5a3dd4[_0x369d('0x48')],_0x418cab[_0x369d('0x62')],md5(_0x418cab['uniqueid']));}headers['Authorization']=getAuth(_0x5a3dd4);return getUser(_0x5a3dd4,_0x9f1544[_0x369d('0x4e')])[_0x369d('0xf')](function(_0x35667d){_0x38ee10=_0x35667d;logger['info'](_0x369d('0x4f'),_0x38ee10['id']);return getEndUser(_0x5a3dd4,_0x418cab[_0x369d('0x63')],_0x418cab[_0x369d('0x64')]);})['then'](function(_0x4eb14d){_0x18cd5f=_0x4eb14d;logger[_0x369d('0xc')](_0x369d('0x52'),_0x18cd5f['id']);return getTicket(_0x5a3dd4,_0x38ee10,_0x18cd5f,_0x1cdeca,_0x418cab);})[_0x369d('0xf')](function(_0x158ce7){if(_0x158ce7){logger['info'](_0x369d('0x53'));logger[_0x369d('0xc')](_0x369d('0x54'),_0x158ce7['id']);switch(_0x5a3dd4[_0x369d('0x2e')]){case _0x369d('0x65'):logger['info'](_0x369d('0x55'),_0x369d('0x56'));emit(util[_0x369d('0x1f')]('user:%s',_0x9f1544[_0x369d('0x39')]),'trigger:desk:display',{'recordId':_0x158ce7['id']});break;case _0x369d('0x59'):logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x369d('0x57'),_0x9f1544['name']),_0x369d('0x5b'),{'uri':util['format'](_0x369d('0x66'),_0x5a3dd4[_0x369d('0xe')],_0x158ce7['id'])});break;default:logger[_0x369d('0x5d')]('[OUTBOUND]',_0x369d('0x5e'));}}})[_0x369d('0x67')](function(_0x29427f){logger[_0x369d('0x5d')](_0x369d('0x61'),JSON[_0x369d('0x17')](_0x29427f));});};exports['abandoned']=function(_0x2a7d2d,_0x4bd395,_0x5706be,_0x56c98e,_0x36e990,_0xab8c70){var _0xde27de,_0x294aaf;_0xab8c70[_0x369d('0xe')]=intUtil[_0x369d('0x49')](_0xab8c70[_0x369d('0xe')]);_0xab8c70[_0x369d('0x48')]=intUtil[_0x369d('0x49')](_0xab8c70[_0x369d('0x48')]);if(_0x36e990&&_0x36e990[_0x369d('0x68')]){logger[_0x369d('0xc')](_0x369d('0x69'),_0x369d('0x4a'));_0x4bd395[_0x369d('0x4c')]=util[_0x369d('0x1f')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xab8c70[_0x369d('0x48')],_0x4bd395['uniqueid'],md5(_0x4bd395[_0x369d('0x62')]));}else{_0x4bd395[_0x369d('0x4c')]='';}headers[_0x369d('0x4d')]=getAuth(_0xab8c70);return getUser(_0xab8c70)[_0x369d('0xf')](function(_0x23dcd9){_0xde27de=_0x23dcd9;logger['info'](_0x369d('0x4f'),_0xde27de['id']);return getEndUser(_0xab8c70,_0x4bd395['calleridname'],_0x4bd395['calleridnum']);})[_0x369d('0xf')](function(_0x1e65af){_0x294aaf=_0x1e65af;logger[_0x369d('0xc')](_0x369d('0x52'),_0x294aaf['id']);return getTicket(_0xab8c70,_0xde27de,_0x294aaf,_0x5706be,_0x4bd395);})[_0x369d('0xf')](function(_0x31c1b0){if(_0x31c1b0){logger[_0x369d('0xc')](_0x369d('0x53'));logger['info'](_0x369d('0x54'),_0x31c1b0['id']);}})[_0x369d('0x67')](function(_0x4c741d){logger[_0x369d('0x5d')](_0x369d('0x69'),JSON[_0x369d('0x17')](_0x4c741d));});}; \ No newline at end of file +var _0x9c00=['../../../../config/logger','desk','redis','defaults','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','find','_embedded','entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','debug','[HTTP]','stringify','GET','authType','%s:%s','username','token','%s/token:%s','toString','base64','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','forEach','type','customField','nameField','toLowerCase','string','idField','content','variable','variableName','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','phone','new','Motion','concat','/api/v2/users/%d','Descriptions','Fields','%s/customers/%d/cases','queue','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','integrationTab','[QUEUE]','Displaying\x20ticket\x20to\x20agent...','user:%s','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','https://xcally.desk.com/web/agent/case/%d','error','Desk\x20account\x20type\x20not\x20recognized','outbound','recordingFormat','none','[OUTBOUND]','Authorization','destcalleridname','destcalleridnum','trigger:browser:url','%s/agent/tickets/%s','catch','abandoned','lodash','request-promise','ioredis','./util'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x9c00,0x1a0));var _0x09c0=function(_0x14ec54,_0x2d5098){_0x14ec54=_0x14ec54-0x0;var _0x2f8c0e=_0x9c00[_0x14ec54];return _0x2f8c0e;};'use strict';var _=require(_0x09c0('0x0'));var rp=require(_0x09c0('0x1'));var md5=require('md5');var util=require('util');var Redis=require(_0x09c0('0x2'));var intUtil=require(_0x09c0('0x3'));var config=require('../../../../config/environment');var logger=require(_0x09c0('0x4'))(_0x09c0('0x5'));config[_0x09c0('0x6')]=_[_0x09c0('0x7')](config[_0x09c0('0x6')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x09c0('0x6')]));function emit(_0x17d11f,_0x1b633b,_0x3187aa){io['to'](_0x17d11f)[_0x09c0('0x8')](_0x1b633b,_0x3187aa);}var headers={'Content-Type':'application/json','Accept':_0x09c0('0x9')};function getUser(_0x1c1246,_0xa20b5c){if(intUtil[_0x09c0('0xa')](_0xa20b5c)===!![]){logger[_0x09c0('0xb')](_0x09c0('0xc'),_0xa20b5c);return request({'uri':util[_0x09c0('0xd')](_0x09c0('0xe'),_0x1c1246[_0x09c0('0xf')])})[_0x09c0('0x10')](function(_0x179b1b){if(_0x179b1b[_0x09c0('0x11')]){return _[_0x09c0('0x12')](_0x179b1b[_0x09c0('0x13')][_0x09c0('0x14')],{'email':_0xa20b5c});}})[_0x09c0('0x10')](function(_0x6149a8){if(_0x6149a8){logger[_0x09c0('0xb')](_0x09c0('0x15'));return _0x6149a8;}else{logger[_0x09c0('0xb')](_0x09c0('0x16'));return request({'uri':util[_0x09c0('0xd')](_0x09c0('0x17'),_0x1c1246[_0x09c0('0xf')])});}});}else{logger[_0x09c0('0xb')](_0x09c0('0x18'));return request({'uri':util['format']('%s/users/me',_0x1c1246['remoteUri'])});}}function request(_0x42030d){logger[_0x09c0('0x19')](_0x09c0('0x1a'),JSON[_0x09c0('0x1b')](_0x42030d));return rp(_['defaults'](_0x42030d,{'method':_0x09c0('0x1c'),'headers':headers,'json':!![]}));}function getAuth(_0x4aa8a5){var _0x4c29a7;if(_0x4aa8a5[_0x09c0('0x1d')]==='basic'){_0x4c29a7=util[_0x09c0('0xd')](_0x09c0('0x1e'),_0x4aa8a5[_0x09c0('0x1f')],_0x4aa8a5['password']);}else if(_0x4aa8a5[_0x09c0('0x1d')]===_0x09c0('0x20')){_0x4c29a7=util[_0x09c0('0xd')](_0x09c0('0x21'),_0x4aa8a5[_0x09c0('0x1f')],_0x4aa8a5[_0x09c0('0x20')]);}return util[_0x09c0('0xd')]('Basic\x20%s',new Buffer(_0x4c29a7)[_0x09c0('0x22')](_0x09c0('0x23')));}function getEndUser(_0x473fbd,_0x1d18e9,_0x59a76a){logger['info'](_0x09c0('0x24'),_0x59a76a);return request({'uri':util[_0x09c0('0xd')](_0x09c0('0x25'),_0x473fbd[_0x09c0('0xf')]),'qs':{'phone':_0x59a76a}})['then'](function(_0x42ebfc){if(_0x42ebfc[_0x09c0('0x11')]){logger['info'](_0x09c0('0x26'));return _0x42ebfc[_0x09c0('0x13')][_0x09c0('0x14')][0x0];}else{logger[_0x09c0('0xb')](_0x09c0('0x27'));return request({'uri':util[_0x09c0('0xd')](_0x09c0('0x28'),_0x473fbd[_0x09c0('0xf')]),'method':_0x09c0('0x29'),'body':{'first_name':_0x1d18e9,'title':_0x1d18e9,'phone_numbers':[{'type':_0x09c0('0x2a'),'value':_0x59a76a}]}});}});}function getTags(_0x46a36a,_0x5e53ac){var _0x15a667=[];if(_0x46a36a&&_0x46a36a[_0x09c0('0x2b')]>0x0){_0x15a667=_['map'](_0x46a36a,_0x5e53ac);}return _0x15a667;}function getCustomFields(_0x1d09e0,_0x5aa0b9){var _0x3f5b10=[];var _0x4d6bdc={'custom_fields':{}};if(_0x1d09e0[_0x09c0('0x2b')]>0x0){_[_0x09c0('0x2c')](_0x1d09e0,function(_0x108409){if(_0x108409[_0x09c0('0x2d')]==='string'&&_0x108409['nameField']&&!_0x108409[_0x09c0('0x2e')]){_0x4d6bdc[_0x108409[_0x09c0('0x2f')][_0x09c0('0x30')]()]=_0x108409['content'][_0x09c0('0x22')]();}else if(_0x108409['type']===_0x09c0('0x31')&&_0x108409[_0x09c0('0x32')]&&_0x108409[_0x09c0('0x2e')]){_0x4d6bdc['custom_fields'][_0x108409[_0x09c0('0x32')]]=_0x108409[_0x09c0('0x33')][_0x09c0('0x22')]();}else if(_0x108409[_0x09c0('0x2d')]===_0x09c0('0x34')&&_0x108409[_0x09c0('0x35')]&&_0x108409[_0x09c0('0x32')]&&_0x108409['customField']){_0x5aa0b9[_0x108409[_0x09c0('0x35')]]&&(_0x4d6bdc[_0x09c0('0x36')][_0x108409[_0x09c0('0x32')]]=_0x5aa0b9[_0x108409[_0x09c0('0x35')]][_0x09c0('0x22')]());}else if(_0x108409['type']===_0x09c0('0x37')&&_0x108409[_0x09c0('0x38')]&&_0x108409[_0x09c0('0x38')][_0x09c0('0x39')]&&_0x108409[_0x09c0('0x32')]&&_0x108409['customField']){_0x5aa0b9[_0x108409[_0x09c0('0x38')][_0x09c0('0x39')][_0x09c0('0x30')]()]&&(_0x4d6bdc[_0x09c0('0x36')][_0x108409[_0x09c0('0x32')]]=_0x5aa0b9[_0x108409[_0x09c0('0x38')][_0x09c0('0x39')]['toLowerCase']()][_0x09c0('0x22')]());}});}if(_0x4d6bdc[_0x09c0('0x3a')]){_0x4d6bdc[_0x09c0('0x3a')]=Number(_0x4d6bdc[_0x09c0('0x3a')]);}return _0x4d6bdc;}function getTicket(_0x453c23,_0x4e98f1,_0x5420fd,_0x5c3c09,_0x4a14dc){logger[_0x09c0('0xb')](_0x09c0('0x3b'));var _0xfd295b=_[_0x09c0('0x3c')]({'subject':intUtil[_0x09c0('0x3d')](_0x5c3c09['Subjects'],_0x4a14dc,'\x20'),'type':_0x09c0('0x3e'),'status':_0x09c0('0x3f'),'labels':['xCALLY',_0x09c0('0x40'),'CTI'][_0x09c0('0x41')](getTags(_0x5c3c09['Tags'],_0x09c0('0x39'))),'description':intUtil[_0x09c0('0x3d')](_0x5c3c09['Descriptions'],_0x4a14dc,'\x0a'),'_links':{'assigned_user':{'href':util[_0x09c0('0xd')](_0x09c0('0x42'),_0x4e98f1['id']),'class':'user'}},'message':{'direction':'in','body':intUtil[_0x09c0('0x3d')](_0x5c3c09[_0x09c0('0x43')],_0x4a14dc,'\x0a')}},getCustomFields(_0x5c3c09[_0x09c0('0x44')],_0x4a14dc));return request({'uri':util[_0x09c0('0xd')](_0x09c0('0x45'),_0x453c23[_0x09c0('0xf')],_0x5420fd['id']),'method':'POST','body':_0xfd295b});}exports[_0x09c0('0x46')]=function(_0x3e0686,_0x2d6344,_0x57835c,_0x193ed2,_0x30c0c5,_0x447224){var _0x4a8199,_0x184340;_0x447224[_0x09c0('0xf')]=intUtil['stripTrailingSlash'](_0x447224['remoteUri']);_0x447224[_0x09c0('0x47')]=intUtil[_0x09c0('0x48')](_0x447224['serverUrl']);if(_0x30c0c5&&_0x30c0c5[_0x09c0('0x49')]){logger[_0x09c0('0xb')]('[QUEUE]',_0x09c0('0x4a'));_0x2d6344[_0x09c0('0x4b')]=util[_0x09c0('0xd')](_0x09c0('0x4c'),_0x447224[_0x09c0('0x47')],_0x2d6344['uniqueid'],md5(_0x2d6344[_0x09c0('0x4d')]));}else{_0x2d6344['recordingURL']='';}headers['Authorization']=getAuth(_0x447224);return getUser(_0x447224,_0x193ed2[_0x09c0('0x4e')])[_0x09c0('0x10')](function(_0x17876c){_0x4a8199=_0x17876c;logger[_0x09c0('0xb')](_0x09c0('0x4f'),_0x4a8199['id']);return getEndUser(_0x447224,_0x2d6344[_0x09c0('0x50')],_0x2d6344['calleridnum']);})['then'](function(_0x502eff){_0x184340=_0x502eff;logger[_0x09c0('0xb')](_0x09c0('0x51'),_0x184340['id']);return getTicket(_0x447224,_0x4a8199,_0x184340,_0x57835c,_0x2d6344);})[_0x09c0('0x10')](function(_0x56ec01){if(_0x56ec01){logger[_0x09c0('0xb')](_0x09c0('0x52'));logger[_0x09c0('0xb')](_0x09c0('0x53'),_0x56ec01['id']);switch(_0x447224[_0x09c0('0x2d')]){case _0x09c0('0x54'):logger[_0x09c0('0xb')](_0x09c0('0x55'),_0x09c0('0x56'));emit(util[_0x09c0('0xd')](_0x09c0('0x57'),_0x193ed2[_0x09c0('0x39')]),_0x09c0('0x58'),{'recordId':_0x56ec01['id']});break;case _0x09c0('0x59'):logger[_0x09c0('0xb')](_0x09c0('0x55'),_0x09c0('0x5a'));emit(util[_0x09c0('0xd')](_0x09c0('0x57'),_0x193ed2[_0x09c0('0x39')]),'trigger:browser:url',{'uri':util[_0x09c0('0xd')](_0x09c0('0x5b'),_0x56ec01['id'])});break;default:logger[_0x09c0('0x5c')](_0x09c0('0x55'),_0x09c0('0x5d'));}}})['catch'](function(_0x3f72b6){console[_0x09c0('0x5c')](_0x3f72b6);logger[_0x09c0('0x5c')]('[QUEUE]',JSON[_0x09c0('0x1b')](_0x3f72b6));});};exports[_0x09c0('0x5e')]=function(_0x14b701,_0x25a36a,_0x55b0f0,_0xebfd6d,_0x45ecd0,_0x499905,_0x1285f8){var _0x42a16c,_0x12f881;_0x499905[_0x09c0('0xf')]=intUtil[_0x09c0('0x48')](_0x499905[_0x09c0('0xf')]);_0x499905[_0x09c0('0x47')]=intUtil['stripTrailingSlash'](_0x499905['serverUrl']);if(_0x1285f8&&_0x1285f8[_0x09c0('0x5f')]&&_0x1285f8[_0x09c0('0x5f')]!==_0x09c0('0x60')){logger['info'](_0x09c0('0x61'),'Recording\x20is\x20enabled!');_0x25a36a[_0x09c0('0x4b')]=util[_0x09c0('0xd')](_0x09c0('0x4c'),_0x499905[_0x09c0('0x47')],_0x25a36a[_0x09c0('0x4d')],md5(_0x25a36a[_0x09c0('0x4d')]));}headers[_0x09c0('0x62')]=getAuth(_0x499905);return getUser(_0x499905,_0xebfd6d['email'])[_0x09c0('0x10')](function(_0x2d6201){_0x42a16c=_0x2d6201;logger[_0x09c0('0xb')](_0x09c0('0x4f'),_0x42a16c['id']);return getEndUser(_0x499905,_0x25a36a[_0x09c0('0x63')],_0x25a36a[_0x09c0('0x64')]);})[_0x09c0('0x10')](function(_0x1ecf16){_0x12f881=_0x1ecf16;logger[_0x09c0('0xb')](_0x09c0('0x51'),_0x12f881['id']);return getTicket(_0x499905,_0x42a16c,_0x12f881,_0x55b0f0,_0x25a36a);})[_0x09c0('0x10')](function(_0x4c4339){if(_0x4c4339){logger[_0x09c0('0xb')](_0x09c0('0x52'));logger[_0x09c0('0xb')](_0x09c0('0x53'),_0x4c4339['id']);switch(_0x499905['type']){case _0x09c0('0x54'):logger['info'](_0x09c0('0x55'),_0x09c0('0x56'));emit(util[_0x09c0('0xd')]('user:%s',_0xebfd6d['name']),_0x09c0('0x58'),{'recordId':_0x4c4339['id']});break;case _0x09c0('0x59'):logger[_0x09c0('0xb')](_0x09c0('0x55'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x09c0('0xd')](_0x09c0('0x57'),_0xebfd6d['name']),_0x09c0('0x65'),{'uri':util[_0x09c0('0xd')](_0x09c0('0x66'),_0x499905[_0x09c0('0xf')],_0x4c4339['id'])});break;default:logger['error'](_0x09c0('0x61'),_0x09c0('0x5d'));}}})[_0x09c0('0x67')](function(_0x36c2f5){logger[_0x09c0('0x5c')](_0x09c0('0x61'),JSON[_0x09c0('0x1b')](_0x36c2f5));});};exports[_0x09c0('0x68')]=function(_0x17931c,_0x2722fb,_0x85adc7,_0x2906cb,_0x2d67e8,_0x484df5){var _0x13f3af,_0x114221;_0x484df5[_0x09c0('0xf')]=intUtil[_0x09c0('0x48')](_0x484df5[_0x09c0('0xf')]);_0x484df5['serverUrl']=intUtil[_0x09c0('0x48')](_0x484df5[_0x09c0('0x47')]);if(_0x2d67e8&&_0x2d67e8[_0x09c0('0x49')]){logger[_0x09c0('0xb')]('[ABANDONED]',_0x09c0('0x4a'));_0x2722fb[_0x09c0('0x4b')]=util['format'](_0x09c0('0x4c'),_0x484df5[_0x09c0('0x47')],_0x2722fb[_0x09c0('0x4d')],md5(_0x2722fb[_0x09c0('0x4d')]));}else{_0x2722fb[_0x09c0('0x4b')]='';}headers['Authorization']=getAuth(_0x484df5);return getUser(_0x484df5)[_0x09c0('0x10')](function(_0x302c81){_0x13f3af=_0x302c81;logger[_0x09c0('0xb')](_0x09c0('0x4f'),_0x13f3af['id']);return getEndUser(_0x484df5,_0x2722fb[_0x09c0('0x50')],_0x2722fb['calleridnum']);})[_0x09c0('0x10')](function(_0x3caa57){_0x114221=_0x3caa57;logger[_0x09c0('0xb')](_0x09c0('0x51'),_0x114221['id']);return getTicket(_0x484df5,_0x13f3af,_0x114221,_0x85adc7,_0x2722fb);})[_0x09c0('0x10')](function(_0x31d14e){if(_0x31d14e){logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x31d14e['id']);}})[_0x09c0('0x67')](function(_0x1dcd69){logger[_0x09c0('0x5c')]('[ABANDONED]',JSON[_0x09c0('0x1b')](_0x1dcd69));});}; \ 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 c4f11e0..a3245d9 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 _0x2340=['request-promise','util','ioredis','../../../../config/logger','dynamics365','redis','defaults','localhost','socket.io-emitter','POST','clientId','username','password','clientSecret','access_token','error','toUpperCase',']\x20Wrong\x20credentials!','message','then','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','value','isNil','email','length','isdisabled','info',']\x20Agent\x20found\x20','systemuserid','userId',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','catch','toLowerCase','outbound','destcalleridnum','calleridnum','contacts','headers','odata-entityid','substring','lastIndexOf','GET','contacts?$select=telephone1','telephone1','enduserId','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','string','idField','indexOf','content','ticketType','incident','incidents','assign','getString','Subjects','Descriptions','/contacts(','/systemusers(','4.0','queue','callDirection','Fields','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit','trigger:browser:url','stripTrailingSlash','remoteUri','serverUrl','abandoned','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird'];(function(_0x38485b,_0x1f7345){var _0x96214=function(_0xfcd1e0){while(--_0xfcd1e0){_0x38485b['push'](_0x38485b['shift']());}};_0x96214(++_0x1f7345);}(_0x2340,0x182));var _0x0234=function(_0x3ad6fb,_0x4c4095){_0x3ad6fb=_0x3ad6fb-0x0;var _0x58747d=_0x2340[_0x3ad6fb];return _0x58747d;};'use strict';var _=require(_0x0234('0x0'));var BPromise=require(_0x0234('0x1'));var rp=require(_0x0234('0x2'));var util=require(_0x0234('0x3'));var intUtil=require('./util');var md5=require('md5');var Redis=require(_0x0234('0x4'));var logger=require(_0x0234('0x5'))(_0x0234('0x6'));var config=require('../../../../config/environment');config[_0x0234('0x7')]=_[_0x0234('0x8')](config[_0x0234('0x7')],{'host':_0x0234('0x9'),'port':0x18eb});var io=require(_0x0234('0xa'))(new Redis(config[_0x0234('0x7')]));function getAuthToken(_0x12815a,_0x248f98,_0x36587a){var _0x5c60f3={'method':_0x0234('0xb'),'uri':_0x248f98,'form':{'client_id':_0x12815a[_0x0234('0xc')],'resource':_0x12815a['remoteUri'],'username':_0x12815a[_0x0234('0xd')],'password':_0x12815a[_0x0234('0xe')],'grant_type':'password','client_secret':_0x12815a[_0x0234('0xf')]},'json':!![]};return rp(_0x5c60f3)['then'](function(_0x5d0c11){return _0x5d0c11[_0x0234('0x10')];})['catch'](function(_0x157de1){logger[_0x0234('0x11')]('['+[_0x36587a[_0x0234('0x12')]()]+_0x0234('0x13'));return _0x157de1[_0x0234('0x14')];});}function getUser(_0xdeecae,_0x25a235,_0x41ace0,_0x3a326e,_0x39d4aa,_0x433eb1){return new BPromise(function(_0x5dfd6d,_0x45e169){return getAuthToken(_0x25a235,_0x3a326e,_0x433eb1)[_0x0234('0x15')](function(_0x26af62){var _0x82e2fc={'method':'GET','uri':_0x39d4aa+_0x0234('0x16'),'headers':{'Authorization':_0x0234('0x17')+_0x26af62,'OData-Version':'4.0'},'json':!![]};return rp(_0x82e2fc);})[_0x0234('0x15')](function(_0x1dd681){var _0x311ab2=_0x1dd681[_0x0234('0x18')];var _0x853906=![];var _0x24a31d=null;if(!_[_0x0234('0x19')](_0x41ace0)){if(intUtil['validateEmail'](_0x41ace0[_0x0234('0x1a')])){_0xdeecae['userEmail']=_0x41ace0[_0x0234('0x1a')];for(_0x24a31d=0x0;_0x24a31d<_0x311ab2[_0x0234('0x1b')];_0x24a31d++){if(_0x311ab2[_0x24a31d]['internalemailaddress']===_0x41ace0['email']&&!_0x311ab2[_0x24a31d][_0x0234('0x1c')]){_0x853906=!![];logger[_0x0234('0x1d')]('['+[_0x433eb1[_0x0234('0x12')]()]+_0x0234('0x1e')+_0x311ab2[_0x24a31d][_0x0234('0x1f')]+'!');_0xdeecae[_0x0234('0x20')]=_0x311ab2[_0x24a31d][_0x0234('0x1f')];}}}}if(!_0x853906){logger[_0x0234('0x1d')]('['+[_0x433eb1['toUpperCase']()]+_0x0234('0x21'));_0xdeecae[_0x0234('0x22')]=_0x25a235[_0x0234('0xd')];for(_0x24a31d=0x0;_0x24a31d<_0x311ab2['length'];_0x24a31d++){if(_0x311ab2[_0x24a31d]['internalemailaddress']===_0x25a235[_0x0234('0xd')]){_0xdeecae[_0x0234('0x20')]=_0x311ab2[_0x24a31d][_0x0234('0x1f')];}}}_0x5dfd6d(_0xdeecae);})[_0x0234('0x23')](function(_0x1cddcc){_0x45e169(_0x1cddcc[_0x0234('0x14')]);});});}function createEndUser(_0x148807,_0x45499a,_0x210c44,_0x986e5e,_0x57b648,_0x2d5c69){return new BPromise(function(_0x24325e,_0x488709){return getAuthToken(_0x45499a,_0x210c44,_0x2d5c69)[_0x0234('0x15')](function(_0x3aceba){var _0x40e859=_0x2d5c69[_0x0234('0x24')]()===_0x0234('0x25')?_0x57b648[_0x0234('0x26')]:_0x57b648[_0x0234('0x27')];var _0x397739={'method':_0x0234('0xb'),'uri':_0x986e5e+_0x0234('0x28'),'body':{'telephone1':_0x40e859,'fullname':_0x40e859,'firstname':_0x40e859,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x148807[_0x0234('0x20')]+')'},'headers':{'Authorization':_0x0234('0x17')+_0x3aceba,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x397739);})['then'](function(_0x41bba4){var _0x3db89d=_0x41bba4[_0x0234('0x29')][_0x0234('0x2a')];var _0x348e8d=_0x3db89d[_0x0234('0x2b')](_0x3db89d[_0x0234('0x2c')]('(')+0x1,_0x3db89d[_0x0234('0x2c')](')'));_0x148807['enduserId']=_0x348e8d;_0x24325e(_0x148807);})[_0x0234('0x23')](function(_0x1c2417){_0x488709(_0x1c2417[_0x0234('0x14')]);});});}function getEndUser(_0x3cb378,_0x25cd27,_0x18b087,_0x422737,_0x532b08,_0x29ae3c){return new BPromise(function(_0x10fe7a,_0x449fd5){return getAuthToken(_0x25cd27,_0x18b087,_0x29ae3c)[_0x0234('0x15')](function(_0x1940d6){var _0x47bac3={'method':_0x0234('0x2d'),'uri':_0x422737+_0x0234('0x2e'),'headers':{'Authorization':'Bearer\x20'+_0x1940d6,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x47bac3);})[_0x0234('0x15')](function(_0x145f02){var _0xc37e7a=null;if(_0x145f02){var _0x301109=_0x145f02['value'];var _0x51d132=![];for(_0xc37e7a=0x0;_0xc37e7a<_0x301109['length'];_0xc37e7a++){var _0x31e92f=_0x29ae3c[_0x0234('0x24')]()===_0x0234('0x25')?_0x532b08[_0x0234('0x26')]:_0x532b08[_0x0234('0x27')];if(_0x301109[_0xc37e7a][_0x0234('0x2f')]===_0x31e92f){_0x51d132=!![];_0x3cb378[_0x0234('0x30')]=_0x301109[_0xc37e7a][_0x0234('0x31')];}}if(_0x51d132){_0x10fe7a(_0x3cb378);}else{return createEndUser(_0x3cb378,_0x25cd27,_0x18b087,_0x422737,_0x532b08,_0x29ae3c)[_0x0234('0x15')](function(_0x3c52e7){logger[_0x0234('0x1d')]('['+[_0x29ae3c['toUpperCase']()]+_0x0234('0x32'),_0x3c52e7[_0x0234('0x30')]);_0x10fe7a(_0x3c52e7);});}}else{return createEndUser(_0x3cb378,_0x25cd27,_0x18b087,_0x422737,_0x532b08,_0x29ae3c)[_0x0234('0x15')](function(_0x467184){logger['info']('['+[_0x29ae3c['toUpperCase']()]+_0x0234('0x33'),_0x467184[_0x0234('0x30')]);_0x10fe7a(_0x467184);});}});});}function getCustomFields(_0x1a211a,_0x4fbcae,_0x2139e0){var _0xbc96b9={};if(_0x1a211a[_0x0234('0x1b')]>0x0){_['forEach'](_0x1a211a,function(_0xbe41d8){if(_0xbe41d8[_0x0234('0x34')]===_0x0234('0x35')&&_0xbe41d8['nameField']&&!_0xbe41d8['customField']){var _0x453bec=_0xbe41d8[_0x0234('0x36')]['toLowerCase']();var _0x1b8c8a=_0x453bec['substring'](0x0,_0x453bec[_0x0234('0x37')]('_'));var _0x5d7ba2=_0x453bec[_0x0234('0x2b')](_0x453bec[_0x0234('0x37')]('_')+0x1);if(_0x1b8c8a===_0x2139e0){_0xbc96b9[_0x5d7ba2]=_0xbe41d8[_0x0234('0x38')];}}});}return _0xbc96b9;}function getTicket(_0x4582c3,_0x47c2d6,_0x145ec8,_0x2c4f7c,_0x2f1980,_0x486519,_0x2dfca4){return new BPromise(function(_0x137f3f,_0x5299a6){var _0xd18c09;return getAuthToken(_0x47c2d6,_0x145ec8,_0x2dfca4)[_0x0234('0x15')](function(_0x41adf2){if(_0x486519[_0x0234('0x39')]===_0x0234('0x3a')){_0xd18c09={'method':_0x0234('0xb'),'uri':_0x2c4f7c+_0x0234('0x3b'),'body':Object[_0x0234('0x3c')]({},{'title':intUtil[_0x0234('0x3d')](_0x486519[_0x0234('0x3e')],_0x2f1980,'\x20'),'description':intUtil['getString'](_0x486519[_0x0234('0x3f')],_0x2f1980,'\x0a'),'customerid_contact@odata.bind':_0x0234('0x40')+_0x4582c3[_0x0234('0x30')]+')','ownerid@odata.bind':_0x0234('0x41')+_0x4582c3[_0x0234('0x20')]+')','caseorigincode':'1'},getCustomFields(_0x486519['Fields'],_0x2f1980,_0x486519[_0x0234('0x39')])),'headers':{'Authorization':_0x0234('0x17')+_0x41adf2,'OData-Version':_0x0234('0x42')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x486519['ticketType']==='phonecall'){_0xd18c09={'method':_0x0234('0xb'),'uri':_0x2c4f7c+'phonecalls','body':Object[_0x0234('0x3c')]({},{'subject':intUtil[_0x0234('0x3d')](_0x486519['Subjects'],_0x2f1980,'\x20'),'phonenumber':String(_0x2f1980[_0x0234('0x27')]),'description':intUtil[_0x0234('0x3d')](_0x486519[_0x0234('0x3f')],_0x2f1980,'\x0a'),'regardingobjectid_contact@odata.bind':_0x0234('0x40')+_0x4582c3[_0x0234('0x30')]+')','ownerid@odata.bind':_0x0234('0x41')+_0x4582c3[_0x0234('0x20')]+')','directioncode':_0x4582c3['callDirection']===_0x0234('0x43')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x0234('0x41')+_0x4582c3[_0x0234('0x20')]+')','participationtypemask':_0x4582c3['callDirection']===_0x0234('0x43')?0x2:0x1},{'partyid_contact@odata.bind':_0x0234('0x40')+_0x4582c3[_0x0234('0x30')]+')','participationtypemask':_0x4582c3[_0x0234('0x44')]===_0x0234('0x43')?0x1:0x2}]},getCustomFields(_0x486519[_0x0234('0x45')],_0x2f1980,_0x486519['ticketType'])),'headers':{'Authorization':_0x0234('0x17')+_0x41adf2,'OData-Version':_0x0234('0x42')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0xd18c09);})['then'](function(_0x4609fe){var _0x13fb69=_0x4609fe[_0x0234('0x29')][_0x0234('0x2a')];var _0x5740e5=_0x13fb69[_0x0234('0x2b')](_0x13fb69[_0x0234('0x2c')]('(')+0x1,_0x13fb69[_0x0234('0x2c')](')'));_0x4582c3[_0x0234('0x46')]=_0x5740e5;_0x137f3f(_0x4582c3);})[_0x0234('0x23')](function(_0x5449ce){_0x5299a6(_0x5449ce[_0x0234('0x14')]);});});}function emit(_0x547e5b,_0xde4d5e,_0x153e69,_0x4cde51){var _0x3e2987={'uri':util[_0x0234('0x47')](_0x0234('0x48'),_0x547e5b,_0x153e69,_0x4cde51)};io['to'](util[_0x0234('0x47')](_0x0234('0x49'),_0xde4d5e))[_0x0234('0x4a')](_0x0234('0x4b'),_0x3e2987);}exports['cs']=function(_0x8e76bf,_0x37ca87,_0x2e4118,_0x192ebf,_0x9dfccd,_0x1177bd,_0x74083d,_0x2d85ee){var _0xfc91a7={};_0x1177bd['remoteUri']=intUtil[_0x0234('0x4c')](_0x1177bd[_0x0234('0x4d')]);_0x1177bd[_0x0234('0x4e')]=intUtil[_0x0234('0x4c')](_0x1177bd['serverUrl']);_0xfc91a7[_0x0234('0x44')]=_0x2d85ee===_0x0234('0x43')||_0x2d85ee===_0x0234('0x4f')?_0x0234('0x43'):_0x0234('0x25');var _0x4140f2=util[_0x0234('0x47')]('%s/api/data/v9.0/',_0x1177bd[_0x0234('0x4d')]);var _0x1fb0b5=util[_0x0234('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x1177bd[_0x0234('0x50')]);var _0x49ab93=util[_0x0234('0x47')](_0x0234('0x51'),_0x1177bd[_0x0234('0x4e')],_0x37ca87[_0x0234('0x52')],md5(_0x37ca87[_0x0234('0x52')]));if(_0x9dfccd&&_0x9dfccd['monitor_format']){logger['info'](_0x0234('0x53'),_0x0234('0x54'));_0x37ca87[_0x0234('0x55')]=_0x49ab93;}else if(_0x74083d&&_0x74083d[_0x0234('0x56')]&&_0x74083d['recordingFormat']!==_0x0234('0x57')){logger[_0x0234('0x1d')]('[OUTBOUND]',_0x0234('0x54'));_0x37ca87[_0x0234('0x55')]=_0x49ab93;}else{_0x37ca87['recordingURL']='';}return getUser(_0xfc91a7,_0x1177bd,_0x192ebf,_0x1fb0b5,_0x4140f2,_0x2d85ee)[_0x0234('0x15')](function(_0xda7748){logger[_0x0234('0x1d')]('['+_0x2d85ee['toUpperCase']()+_0x0234('0x58'),_0xda7748[_0x0234('0x20')]);logger[_0x0234('0x1d')]('['+_0x2d85ee[_0x0234('0x12')]()+_0x0234('0x59'),_0xda7748[_0x0234('0x22')]);return getEndUser(_0xda7748,_0x1177bd,_0x1fb0b5,_0x4140f2,_0x37ca87,_0x2d85ee);})[_0x0234('0x15')](function(_0x1c03a7){logger[_0x0234('0x1d')]('['+_0x2d85ee[_0x0234('0x12')]()+_0x0234('0x5a'),_0x1c03a7[_0x0234('0x30')]);logger[_0x0234('0x1d')]('['+_0x2d85ee[_0x0234('0x12')]()+_0x0234('0x5b'),_0x37ca87[_0x0234('0x27')]);return getTicket(_0x1c03a7,_0x1177bd,_0x1fb0b5,_0x4140f2,_0x37ca87,_0x2e4118,_0x2d85ee);})['then'](function(_0x138d95){logger['info'](util[_0x0234('0x47')]('['+_0x2d85ee[_0x0234('0x12')]()+_0x0234('0x5c'),_0x2e4118['ticketType'],_0x138d95[_0x0234('0x46')]));logger[_0x0234('0x1d')](util[_0x0234('0x47')]('['+_0x2d85ee['toUpperCase']()+']\x20Call\x20direction:\x20%s',_0x2d85ee));if(_0x2d85ee!=='abandoned'){logger[_0x0234('0x1d')]('['+_0x2d85ee[_0x0234('0x12')]()+']',_0x0234('0x5d'));emit(_0x1177bd[_0x0234('0x4d')],_0x192ebf[_0x0234('0x5e')],_0x2e4118['ticketType'],_0x138d95[_0x0234('0x46')]);}})[_0x0234('0x23')](function(_0x583fc8){logger[_0x0234('0x11')]('['+_0x2d85ee['toUpperCase']()+_0x0234('0x5f'),util[_0x0234('0x60')](_0x583fc8,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xf012=['serverUrl','abandoned','uniqueid','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!',']\x20The\x20User\x20ID\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','inspect','lodash','bluebird','util','./util','ioredis','../../../../config/logger','dynamics365','../../../../config/environment','defaults','redis','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase',']\x20Wrong\x20credentials!','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','Bearer\x20','4.0','isNil','validateEmail','email','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','userId','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','username','length','toLowerCase','destcalleridnum','calleridnum','/systemusers(','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','outbound','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','type','customField','idField','indexOf','content','incident','incidents','Subjects','getString','Descriptions','/contacts(','ticketType','assign','callDirection','queue','Fields','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','format','user:%s','emit','stripTrailingSlash','remoteUri'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xf012,0x130));var _0x2f01=function(_0x43f47b,_0x311636){_0x43f47b=_0x43f47b-0x0;var _0x4af9a6=_0xf012[_0x43f47b];return _0x4af9a6;};'use strict';var _=require(_0x2f01('0x0'));var BPromise=require(_0x2f01('0x1'));var rp=require('request-promise');var util=require(_0x2f01('0x2'));var intUtil=require(_0x2f01('0x3'));var md5=require('md5');var Redis=require(_0x2f01('0x4'));var logger=require(_0x2f01('0x5'))(_0x2f01('0x6'));var config=require(_0x2f01('0x7'));config['redis']=_[_0x2f01('0x8')](config[_0x2f01('0x9')],{'host':'localhost','port':0x18eb});var io=require(_0x2f01('0xa'))(new Redis(config[_0x2f01('0x9')]));function getAuthToken(_0x815082,_0x298d3b,_0x14c7e4){var _0x21f5e7={'method':_0x2f01('0xb'),'uri':_0x298d3b,'form':{'client_id':_0x815082[_0x2f01('0xc')],'resource':_0x815082['remoteUri'],'username':_0x815082['username'],'password':_0x815082[_0x2f01('0xd')],'grant_type':_0x2f01('0xd'),'client_secret':_0x815082[_0x2f01('0xe')]},'json':!![]};return rp(_0x21f5e7)[_0x2f01('0xf')](function(_0x32892d){return _0x32892d[_0x2f01('0x10')];})[_0x2f01('0x11')](function(_0x1d74ff){logger[_0x2f01('0x12')]('['+[_0x14c7e4[_0x2f01('0x13')]()]+_0x2f01('0x14'));return _0x1d74ff[_0x2f01('0x15')];});}function getUser(_0x546a5c,_0x1afd1b,_0x272ce2,_0x3f1518,_0x56f48f,_0x31540c){return new BPromise(function(_0x7ec61f,_0x229877){return getAuthToken(_0x1afd1b,_0x3f1518,_0x31540c)[_0x2f01('0xf')](function(_0x5ed41e){var _0xad8d5d={'method':_0x2f01('0x16'),'uri':_0x56f48f+_0x2f01('0x17'),'headers':{'Authorization':_0x2f01('0x18')+_0x5ed41e,'OData-Version':_0x2f01('0x19')},'json':!![]};return rp(_0xad8d5d);})[_0x2f01('0xf')](function(_0x3505e9){var _0x53d62e=_0x3505e9['value'];var _0x5a0e85=![];var _0x292e17=null;if(!_[_0x2f01('0x1a')](_0x272ce2)){if(intUtil[_0x2f01('0x1b')](_0x272ce2[_0x2f01('0x1c')])){_0x546a5c['userEmail']=_0x272ce2['email'];for(_0x292e17=0x0;_0x292e17<_0x53d62e['length'];_0x292e17++){if(_0x53d62e[_0x292e17][_0x2f01('0x1d')]===_0x272ce2[_0x2f01('0x1c')]&&!_0x53d62e[_0x292e17][_0x2f01('0x1e')]){_0x5a0e85=!![];logger[_0x2f01('0x1f')]('['+[_0x31540c[_0x2f01('0x13')]()]+_0x2f01('0x20')+_0x53d62e[_0x292e17]['systemuserid']+'!');_0x546a5c[_0x2f01('0x21')]=_0x53d62e[_0x292e17][_0x2f01('0x22')];}}}}if(!_0x5a0e85){logger['info']('['+[_0x31540c[_0x2f01('0x13')]()]+_0x2f01('0x23'));_0x546a5c[_0x2f01('0x24')]=_0x1afd1b[_0x2f01('0x25')];for(_0x292e17=0x0;_0x292e17<_0x53d62e[_0x2f01('0x26')];_0x292e17++){if(_0x53d62e[_0x292e17][_0x2f01('0x1d')]===_0x1afd1b[_0x2f01('0x25')]){_0x546a5c[_0x2f01('0x21')]=_0x53d62e[_0x292e17][_0x2f01('0x22')];}}}_0x7ec61f(_0x546a5c);})['catch'](function(_0x3a9992){_0x229877(_0x3a9992[_0x2f01('0x15')]);});});}function createEndUser(_0x119178,_0x565838,_0x312728,_0x4d1bb6,_0x201337,_0x1b2e2c){return new BPromise(function(_0x278402,_0x35512e){return getAuthToken(_0x565838,_0x312728,_0x1b2e2c)[_0x2f01('0xf')](function(_0x52070d){var _0x537ee0=_0x1b2e2c[_0x2f01('0x27')]()==='outbound'?_0x201337[_0x2f01('0x28')]:_0x201337[_0x2f01('0x29')];var _0x45409f={'method':_0x2f01('0xb'),'uri':_0x4d1bb6+'contacts','body':{'telephone1':_0x537ee0,'fullname':_0x537ee0,'firstname':_0x537ee0,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x2f01('0x2a')+_0x119178[_0x2f01('0x21')]+')'},'headers':{'Authorization':_0x2f01('0x18')+_0x52070d,'OData-Version':_0x2f01('0x19')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x45409f);})[_0x2f01('0xf')](function(_0x14c70a){var _0x4071fa=_0x14c70a[_0x2f01('0x2b')][_0x2f01('0x2c')];var _0x3996cb=_0x4071fa[_0x2f01('0x2d')](_0x4071fa[_0x2f01('0x2e')]('(')+0x1,_0x4071fa[_0x2f01('0x2e')](')'));_0x119178[_0x2f01('0x2f')]=_0x3996cb;_0x278402(_0x119178);})[_0x2f01('0x11')](function(_0x5e9330){_0x35512e(_0x5e9330['message']);});});}function getEndUser(_0x394d2f,_0x33ed5d,_0x58a7b3,_0x3be744,_0x2246ac,_0x33a49b){return new BPromise(function(_0x32bb1a,_0x155019){return getAuthToken(_0x33ed5d,_0x58a7b3,_0x33a49b)[_0x2f01('0xf')](function(_0x3bb7a1){var _0x4338b4={'method':_0x2f01('0x16'),'uri':_0x3be744+_0x2f01('0x30'),'headers':{'Authorization':_0x2f01('0x18')+_0x3bb7a1,'If-None-Match':null,'OData-Version':_0x2f01('0x19')},'json':!![]};return rp(_0x4338b4);})['then'](function(_0x118714){var _0x1f7d10=null;if(_0x118714){var _0xbaec0e=_0x118714['value'];var _0x37d915=![];for(_0x1f7d10=0x0;_0x1f7d10<_0xbaec0e['length'];_0x1f7d10++){var _0x526fcf=_0x33a49b[_0x2f01('0x27')]()===_0x2f01('0x31')?_0x2246ac[_0x2f01('0x28')]:_0x2246ac[_0x2f01('0x29')];if(_0xbaec0e[_0x1f7d10][_0x2f01('0x32')]===_0x526fcf){_0x37d915=!![];_0x394d2f['enduserId']=_0xbaec0e[_0x1f7d10][_0x2f01('0x33')];}}if(_0x37d915){_0x32bb1a(_0x394d2f);}else{return createEndUser(_0x394d2f,_0x33ed5d,_0x58a7b3,_0x3be744,_0x2246ac,_0x33a49b)['then'](function(_0x8b9268){logger[_0x2f01('0x1f')]('['+[_0x33a49b[_0x2f01('0x13')]()]+_0x2f01('0x34'),_0x8b9268[_0x2f01('0x2f')]);_0x32bb1a(_0x8b9268);});}}else{return createEndUser(_0x394d2f,_0x33ed5d,_0x58a7b3,_0x3be744,_0x2246ac,_0x33a49b)[_0x2f01('0xf')](function(_0x2636f0){logger['info']('['+[_0x33a49b[_0x2f01('0x13')]()]+_0x2f01('0x35'),_0x2636f0[_0x2f01('0x2f')]);_0x32bb1a(_0x2636f0);});}});});}function getCustomFields(_0xbe215d,_0xe7967e,_0x52042d){var _0x1d90d7={};if(_0xbe215d['length']>0x0){_['forEach'](_0xbe215d,function(_0x4e265e){if(_0x4e265e[_0x2f01('0x36')]==='string'&&_0x4e265e['nameField']&&!_0x4e265e[_0x2f01('0x37')]){var _0xd662b5=_0x4e265e[_0x2f01('0x38')][_0x2f01('0x27')]();var _0x4337e3=_0xd662b5[_0x2f01('0x2d')](0x0,_0xd662b5[_0x2f01('0x39')]('_'));var _0x58e307=_0xd662b5['substring'](_0xd662b5[_0x2f01('0x39')]('_')+0x1);if(_0x4337e3===_0x52042d){_0x1d90d7[_0x58e307]=_0x4e265e[_0x2f01('0x3a')];}}});}return _0x1d90d7;}function getTicket(_0x120e09,_0x1b0efd,_0x1777af,_0x144d3c,_0x44eef2,_0x217aaa,_0x17cd2a){return new BPromise(function(_0x3d8b14,_0x146233){var _0x4fea5c;return getAuthToken(_0x1b0efd,_0x1777af,_0x17cd2a)[_0x2f01('0xf')](function(_0xed82c7){if(_0x217aaa['ticketType']===_0x2f01('0x3b')){_0x4fea5c={'method':_0x2f01('0xb'),'uri':_0x144d3c+_0x2f01('0x3c'),'body':Object['assign']({},{'title':intUtil['getString'](_0x217aaa[_0x2f01('0x3d')],_0x44eef2,'\x20'),'description':intUtil[_0x2f01('0x3e')](_0x217aaa[_0x2f01('0x3f')],_0x44eef2,'\x0a'),'customerid_contact@odata.bind':_0x2f01('0x40')+_0x120e09['enduserId']+')','ownerid@odata.bind':_0x2f01('0x2a')+_0x120e09['userId']+')','caseorigincode':'1'},getCustomFields(_0x217aaa['Fields'],_0x44eef2,_0x217aaa['ticketType'])),'headers':{'Authorization':_0x2f01('0x18')+_0xed82c7,'OData-Version':_0x2f01('0x19')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x217aaa[_0x2f01('0x41')]==='phonecall'){_0x4fea5c={'method':_0x2f01('0xb'),'uri':_0x144d3c+'phonecalls','body':Object[_0x2f01('0x42')]({},{'subject':intUtil[_0x2f01('0x3e')](_0x217aaa[_0x2f01('0x3d')],_0x44eef2,'\x20'),'phonenumber':String(_0x44eef2[_0x2f01('0x29')]),'description':intUtil['getString'](_0x217aaa['Descriptions'],_0x44eef2,'\x0a'),'regardingobjectid_contact@odata.bind':_0x2f01('0x40')+_0x120e09[_0x2f01('0x2f')]+')','ownerid@odata.bind':_0x2f01('0x2a')+_0x120e09[_0x2f01('0x21')]+')','directioncode':_0x120e09[_0x2f01('0x43')]==='queue'?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x2f01('0x2a')+_0x120e09[_0x2f01('0x21')]+')','participationtypemask':_0x120e09['callDirection']===_0x2f01('0x44')?0x2:0x1},{'partyid_contact@odata.bind':_0x2f01('0x40')+_0x120e09[_0x2f01('0x2f')]+')','participationtypemask':_0x120e09[_0x2f01('0x43')]===_0x2f01('0x44')?0x1:0x2}]},getCustomFields(_0x217aaa[_0x2f01('0x45')],_0x44eef2,_0x217aaa[_0x2f01('0x41')])),'headers':{'Authorization':_0x2f01('0x18')+_0xed82c7,'OData-Version':_0x2f01('0x19')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4fea5c);})[_0x2f01('0xf')](function(_0x1d8a4e){var _0x109779=_0x1d8a4e['headers'][_0x2f01('0x2c')];var _0x26af6d=_0x109779[_0x2f01('0x2d')](_0x109779['lastIndexOf']('(')+0x1,_0x109779[_0x2f01('0x2e')](')'));_0x120e09['ticketId']=_0x26af6d;_0x3d8b14(_0x120e09);})[_0x2f01('0x11')](function(_0x10268b){_0x146233(_0x10268b['message']);});});}function emit(_0x15624c,_0x30a2ce,_0x22e7da,_0x30d52a){var _0x51bb9a={'uri':util['format'](_0x2f01('0x46'),_0x15624c,_0x22e7da,_0x30d52a)};io['to'](util[_0x2f01('0x47')](_0x2f01('0x48'),_0x30a2ce))[_0x2f01('0x49')]('trigger:browser:url',_0x51bb9a);}exports['cs']=function(_0x2107bb,_0xde4b52,_0x51422a,_0xe3afc9,_0x32b490,_0x292534,_0x4cb004,_0x41602e){var _0x61db70={};_0x292534['remoteUri']=intUtil[_0x2f01('0x4a')](_0x292534[_0x2f01('0x4b')]);_0x292534[_0x2f01('0x4c')]=intUtil['stripTrailingSlash'](_0x292534[_0x2f01('0x4c')]);_0x61db70['callDirection']=_0x41602e===_0x2f01('0x44')||_0x41602e===_0x2f01('0x4d')?_0x2f01('0x44'):_0x2f01('0x31');var _0x7bef9e=util['format']('%s/api/data/v9.0/',_0x292534[_0x2f01('0x4b')]);var _0xbbe7a6=util[_0x2f01('0x47')]('https://login.microsoftonline.com/%s/oauth2/token',_0x292534['tenantId']);var _0x1bbbce=util[_0x2f01('0x47')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x292534[_0x2f01('0x4c')],_0xde4b52[_0x2f01('0x4e')],md5(_0xde4b52[_0x2f01('0x4e')]));if(_0x32b490&&_0x32b490[_0x2f01('0x4f')]){logger[_0x2f01('0x1f')](_0x2f01('0x50'),'Recording\x20is\x20enabled!');_0xde4b52[_0x2f01('0x51')]=_0x1bbbce;}else if(_0x4cb004&&_0x4cb004[_0x2f01('0x52')]&&_0x4cb004[_0x2f01('0x52')]!==_0x2f01('0x53')){logger['info'](_0x2f01('0x54'),_0x2f01('0x55'));_0xde4b52['recordingURL']=_0x1bbbce;}else{_0xde4b52[_0x2f01('0x51')]='';}return getUser(_0x61db70,_0x292534,_0xe3afc9,_0xbbe7a6,_0x7bef9e,_0x41602e)[_0x2f01('0xf')](function(_0x17f396){logger[_0x2f01('0x1f')]('['+_0x41602e[_0x2f01('0x13')]()+_0x2f01('0x56'),_0x17f396[_0x2f01('0x21')]);logger[_0x2f01('0x1f')]('['+_0x41602e['toUpperCase']()+']\x20The\x20User\x20email\x20is:',_0x17f396['userEmail']);return getEndUser(_0x17f396,_0x292534,_0xbbe7a6,_0x7bef9e,_0xde4b52,_0x41602e);})[_0x2f01('0xf')](function(_0x52922d){logger[_0x2f01('0x1f')]('['+_0x41602e[_0x2f01('0x13')]()+_0x2f01('0x57'),_0x52922d[_0x2f01('0x2f')]);logger['info']('['+_0x41602e[_0x2f01('0x13')]()+']\x20The\x20Enduser\x20phone\x20is:',_0xde4b52[_0x2f01('0x29')]);return getTicket(_0x52922d,_0x292534,_0xbbe7a6,_0x7bef9e,_0xde4b52,_0x51422a,_0x41602e);})['then'](function(_0xf48c02){logger[_0x2f01('0x1f')](util['format']('['+_0x41602e['toUpperCase']()+_0x2f01('0x58'),_0x51422a[_0x2f01('0x41')],_0xf48c02[_0x2f01('0x59')]));logger['info'](util[_0x2f01('0x47')]('['+_0x41602e[_0x2f01('0x13')]()+_0x2f01('0x5a'),_0x41602e));if(_0x41602e!=='abandoned'){logger[_0x2f01('0x1f')]('['+_0x41602e['toUpperCase']()+']',_0x2f01('0x5b'));emit(_0x292534['remoteUri'],_0xe3afc9[_0x2f01('0x5c')],_0x51422a[_0x2f01('0x41')],_0xf48c02[_0x2f01('0x59')]);}})['catch'](function(_0x21cd2c){logger['error']('['+_0x41602e[_0x2f01('0x13')]()+_0x2f01('0x5d'),util[_0x2f01('0x5e')](_0x21cd2c,{'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 81224c1..ce47317 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 _0x00e7=['Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','localhost','socket.io-emitter','application/json','emit','info','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','getString','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','keyBy','%s/api/v2/tickets','POST','then','Ticket\x20created!','validateEmail','remoteUri','Agent\x20found!','find','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','%s/api/v2/contacts','length','Enduser\x20found!','Basic\x20%s','apiKey','base64','debug','[HTTP]','stringify','GET','forEach','type','customField','nameField','toLowerCase','content','string','idField','push','toString','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid'];(function(_0x5a9c0c,_0x4ec485){var _0x53c77d=function(_0x1cf384){while(--_0x1cf384){_0x5a9c0c['push'](_0x5a9c0c['shift']());}};_0x53c77d(++_0x4ec485);}(_0x00e7,0x191));var _0x700e=function(_0x209bbf,_0x2e2375){_0x209bbf=_0x209bbf-0x0;var _0x592d4b=_0x00e7[_0x209bbf];return _0x592d4b;};'use strict';var _=require(_0x700e('0x0'));var rp=require(_0x700e('0x1'));var md5=require(_0x700e('0x2'));var util=require(_0x700e('0x3'));var Redis=require(_0x700e('0x4'));var intUtil=require(_0x700e('0x5'));var config=require(_0x700e('0x6'));var logger=require(_0x700e('0x7'))(_0x700e('0x8'));config[_0x700e('0x9')]=_[_0x700e('0xa')](config[_0x700e('0x9')],{'host':_0x700e('0xb'),'port':0x18eb});var io=require(_0x700e('0xc'))(new Redis(config[_0x700e('0x9')]));var headers={'Content-Type':_0x700e('0xd'),'Accept':'application/json'};function emit(_0x4f76b9,_0x438e8d,_0x597c5f){io['to'](_0x4f76b9)[_0x700e('0xe')](_0x438e8d,_0x597c5f);}function getTicket(_0x279f34,_0x15607b,_0x456ad2,_0x16bbde,_0x1ea638){logger[_0x700e('0xf')](_0x700e('0x10'));var _0x1c221a=_[_0x700e('0x11')]({'responder_id':_0x15607b['id'],'requester_id':_0x456ad2['id'],'name':util[_0x700e('0x12')](_0x700e('0x13'),_0x1ea638[_0x700e('0x14')]),'phone':_0x1ea638[_0x700e('0x15')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x16bbde[_0x700e('0x16')],_0x1ea638,'\x20'),'description':intUtil[_0x700e('0x17')](_0x16bbde[_0x700e('0x18')],_0x1ea638,_0x700e('0x19')),'tags':getTags(_0x16bbde[_0x700e('0x1a')],_0x700e('0x1b'))},getCustomFields(_0x16bbde[_0x700e('0x1c')],_0x1ea638));_0x1c221a[_0x700e('0x1d')]=_[_0x700e('0x1e')](_[_0x700e('0x1f')](_0x1c221a[_0x700e('0x1d')],'id'),'value');return request({'uri':util['format'](_0x700e('0x20'),_0x279f34['remoteUri']),'method':_0x700e('0x21'),'body':_0x1c221a})[_0x700e('0x22')](function(_0x473263){logger[_0x700e('0xf')](_0x700e('0x23'));return _0x473263;});}function getUser(_0x28ed98,_0x3e9dbd){if(intUtil[_0x700e('0x24')](_0x3e9dbd)){return request({'uri':util[_0x700e('0x12')]('%s/api/v2/agents',_0x28ed98[_0x700e('0x25')]),'qs':{'email':_0x3e9dbd}})['then'](function(_0x5c2283){if(_0x5c2283['length']){logger['info'](_0x700e('0x26'));return _[_0x700e('0x27')](_0x5c2283,function(_0x425c42){return _0x425c42['contact'][_0x700e('0x28')]===_0x3e9dbd;});}else{logger[_0x700e('0xf')](_0x700e('0x29'));return request({'uri':util[_0x700e('0x12')]('%s/api/v2/agents/me',_0x28ed98[_0x700e('0x25')])})['then'](function(_0x420e23){logger[_0x700e('0xf')]('Admin\x20account\x20selected.');return _0x420e23;});}});}else{logger['info'](_0x700e('0x2a'));return request({'uri':util[_0x700e('0x12')](_0x700e('0x2b'),_0x28ed98[_0x700e('0x25')])})[_0x700e('0x22')](function(_0x5ecc9a){logger[_0x700e('0xf')](_0x700e('0x2c'));return _0x5ecc9a;});}}function getEndUser(_0xfb8c69,_0x25e8c6,_0x42f259){logger['info'](_0x700e('0x2d'),_0x42f259);return request({'uri':util[_0x700e('0x12')](_0x700e('0x2e'),_0xfb8c69['remoteUri']),'qs':{'phone':_0x42f259}})[_0x700e('0x22')](function(_0x535254){if(_0x535254[_0x700e('0x2f')]){logger[_0x700e('0xf')](_0x700e('0x30'));return _[_0x700e('0x27')](_0x535254,{'phone':_0x42f259});}else{logger[_0x700e('0xf')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util['format'](_0x700e('0x2e'),_0xfb8c69[_0x700e('0x25')]),'method':'POST','body':{'name':_0x25e8c6,'phone':_0x42f259}})[_0x700e('0x22')](function(_0x2095b8){logger[_0x700e('0xf')]('Enduser\x20created.');return _0x2095b8;});}});}function getAuth(_0x62781d){return util[_0x700e('0x12')](_0x700e('0x31'),new Buffer(_0x62781d[_0x700e('0x32')]+':X')['toString'](_0x700e('0x33')));}function request(_0x2e8b36){logger[_0x700e('0x34')](_0x700e('0x35'),JSON[_0x700e('0x36')](_0x2e8b36));return rp(_[_0x700e('0xa')](_0x2e8b36,{'method':_0x700e('0x37'),'headers':headers,'json':!![]}));}function getTags(_0x4b5a66,_0x21460c){var _0x3d0e48=[];if(_0x4b5a66&&_0x4b5a66[_0x700e('0x2f')]>0x0){_0x3d0e48=_['map'](_0x4b5a66,_0x21460c);}return _0x3d0e48;}function getCustomFields(_0x2e9c1b,_0x2502ac){var _0x5f0d2a=[];var _0x454ebc={'custom_fields':[]};if(_0x2e9c1b[_0x700e('0x2f')]>0x0){_[_0x700e('0x38')](_0x2e9c1b,function(_0xbc4ed2){if(_0xbc4ed2[_0x700e('0x39')]==='string'&&_0xbc4ed2['nameField']&&!_0xbc4ed2[_0x700e('0x3a')]){_0x454ebc[_0xbc4ed2[_0x700e('0x3b')][_0x700e('0x3c')]()]=_0xbc4ed2[_0x700e('0x3d')]['toString']();}else if(_0xbc4ed2[_0x700e('0x39')]===_0x700e('0x3e')&&_0xbc4ed2[_0x700e('0x3f')]&&_0xbc4ed2[_0x700e('0x3a')]){_0x454ebc['custom_fields'][_0x700e('0x40')]({'id':_0xbc4ed2[_0x700e('0x3f')],'value':_0xbc4ed2['content'][_0x700e('0x41')]()});}else if(_0xbc4ed2[_0x700e('0x39')]===_0x700e('0x42')&&_0xbc4ed2[_0x700e('0x43')]&&_0xbc4ed2['idField']&&_0xbc4ed2[_0x700e('0x3a')]){_0x2502ac[_0xbc4ed2[_0x700e('0x43')]]&&_0x454ebc[_0x700e('0x1d')][_0x700e('0x40')]({'id':_0xbc4ed2[_0x700e('0x3f')],'value':_0x2502ac[_0xbc4ed2[_0x700e('0x43')]][_0x700e('0x41')]()});}else if(_0xbc4ed2[_0x700e('0x39')]===_0x700e('0x44')&&_0xbc4ed2['Variable']&&_0xbc4ed2[_0x700e('0x45')][_0x700e('0x1b')]&&_0xbc4ed2['idField']&&_0xbc4ed2[_0x700e('0x3a')]){_0x2502ac[_0xbc4ed2[_0x700e('0x45')]['name'][_0x700e('0x3c')]()]&&_0x454ebc['custom_fields']['push']({'id':_0xbc4ed2[_0x700e('0x3f')],'value':_0x2502ac[_0xbc4ed2['Variable'][_0x700e('0x1b')]['toLowerCase']()][_0x700e('0x41')]()});}});}return _0x454ebc;}exports[_0x700e('0x46')]=function(_0x1d858d,_0x156339,_0x4ce81e,_0x159d76,_0x3ddb20,_0x965213){var _0x38e61c,_0x555132;_0x965213[_0x700e('0x25')]=intUtil[_0x700e('0x47')](_0x965213[_0x700e('0x25')]);_0x965213[_0x700e('0x48')]=intUtil['stripTrailingSlash'](_0x965213[_0x700e('0x48')]);if(_0x3ddb20&&_0x3ddb20[_0x700e('0x49')]){logger['info'](_0x700e('0x4a'),_0x700e('0x4b'));_0x156339[_0x700e('0x4c')]=util[_0x700e('0x12')](_0x700e('0x4d'),_0x965213['serverUrl'],_0x156339[_0x700e('0x4e')],md5(_0x156339['uniqueid']));}else{_0x156339['recordingURL']='';}headers[_0x700e('0x4f')]=getAuth(_0x965213);return getUser(_0x965213,_0x159d76['email'])[_0x700e('0x22')](function(_0x5e6790){_0x38e61c=_0x5e6790;logger['info'](_0x700e('0x50'),_0x38e61c['id']);return getEndUser(_0x965213,_0x156339[_0x700e('0x14')],_0x156339['calleridnum']);})[_0x700e('0x22')](function(_0x3140ed){_0x555132=_0x3140ed;logger[_0x700e('0xf')](_0x700e('0x51'),_0x555132['id']);return getTicket(_0x965213,_0x38e61c,_0x555132,_0x4ce81e,_0x156339);})[_0x700e('0x22')](function(_0xef6f04){if(_0xef6f04&&_0xef6f04['id']){logger[_0x700e('0xf')]('Ticket\x20created!');logger['info'](_0x700e('0x52'),_0xef6f04['id']);logger[_0x700e('0xf')]('[QUEUE]',_0x700e('0x53'));emit(util[_0x700e('0x12')](_0x700e('0x54'),_0x159d76['name']),_0x700e('0x55'),{'uri':util['format'](_0x700e('0x56'),_0x965213[_0x700e('0x25')],_0xef6f04['id'])});}})[_0x700e('0x57')](function(_0x331b6a){logger[_0x700e('0x58')](_0x700e('0x4a'),JSON['stringify'](_0x331b6a));});};exports[_0x700e('0x59')]=function(_0x28c3ed,_0x3a4411,_0xf78e9d,_0x3c719d,_0x382ed4,_0x5e0c5a,_0x5dd87b){var _0x1d8be7,_0x488872;_0x5e0c5a[_0x700e('0x25')]=intUtil[_0x700e('0x47')](_0x5e0c5a['remoteUri']);_0x5e0c5a['serverUrl']=intUtil[_0x700e('0x47')](_0x5e0c5a['serverUrl']);if(_0x5dd87b&&_0x5dd87b[_0x700e('0x5a')]&&_0x5dd87b['recordingFormat']!==_0x700e('0x5b')){logger[_0x700e('0xf')](_0x700e('0x5c'),_0x700e('0x4b'));_0x3a4411[_0x700e('0x4c')]=util[_0x700e('0x12')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e0c5a[_0x700e('0x48')],_0x3a4411[_0x700e('0x4e')],md5(_0x3a4411[_0x700e('0x4e')]));}headers[_0x700e('0x4f')]=getAuth(_0x5e0c5a);return getUser(_0x5e0c5a,_0x3c719d['email'])[_0x700e('0x22')](function(_0x33c7c0){_0x1d8be7=_0x33c7c0;logger['info']('The\x20User\x20ID\x20is:',_0x1d8be7['id']);return getEndUser(_0x5e0c5a,_0x3a4411[_0x700e('0x5d')],_0x3a4411[_0x700e('0x5e')]);})[_0x700e('0x22')](function(_0x427e87){_0x488872=_0x427e87;logger[_0x700e('0xf')](_0x700e('0x51'),_0x488872['id']);return getTicket(_0x5e0c5a,_0x1d8be7,_0x488872,_0xf78e9d,_0x3a4411);})['then'](function(_0x455843){if(_0x455843&&_0x455843['id']){logger['info'](_0x700e('0x23'));logger[_0x700e('0xf')](_0x700e('0x52'),_0x455843['id']);logger[_0x700e('0xf')](_0x700e('0x5c'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format']('user:%s',_0x3c719d['name']),_0x700e('0x55'),{'uri':util[_0x700e('0x12')](_0x700e('0x56'),_0x5e0c5a[_0x700e('0x25')],_0x455843['id'])});}})[_0x700e('0x57')](function(_0x2e3e4a){logger[_0x700e('0x58')]('[OUTBOUND]',JSON[_0x700e('0x36')](_0x2e3e4a));});};exports['abandoned']=function(_0x1049c3,_0x498387,_0x57c3ff,_0x148ceb,_0x2b2c3b,_0x44f7dc){var _0x500393,_0x2af0ca;_0x44f7dc[_0x700e('0x25')]=intUtil['stripTrailingSlash'](_0x44f7dc[_0x700e('0x25')]);_0x44f7dc['serverUrl']=intUtil[_0x700e('0x47')](_0x44f7dc[_0x700e('0x48')]);if(_0x2b2c3b&&_0x2b2c3b[_0x700e('0x49')]){logger[_0x700e('0xf')]('[ABANDONED]',_0x700e('0x4b'));_0x498387[_0x700e('0x4c')]=util[_0x700e('0x12')](_0x700e('0x4d'),_0x44f7dc[_0x700e('0x48')],_0x498387['uniqueid'],md5(_0x498387['uniqueid']));}else{_0x498387['recordingURL']='';}headers[_0x700e('0x4f')]=getAuth(_0x44f7dc);return getUser(_0x44f7dc,'')[_0x700e('0x22')](function(_0x22a2b6){_0x500393=_0x22a2b6;logger['info'](_0x700e('0x50'),_0x500393['id']);return getEndUser(_0x44f7dc,_0x498387[_0x700e('0x14')],_0x498387[_0x700e('0x15')]);})[_0x700e('0x22')](function(_0x5141c4){_0x2af0ca=_0x5141c4;logger[_0x700e('0xf')](_0x700e('0x51'),_0x2af0ca['id']);return getTicket(_0x44f7dc,_0x500393,_0x2af0ca,_0x57c3ff,_0x498387);})[_0x700e('0x22')](function(_0x130e4b){if(_0x130e4b){logger['info'](_0x700e('0x23'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x130e4b['id']);}})['catch'](function(_0x41193f){logger[_0x700e('0x58')](_0x700e('0x5f'),JSON['stringify'](_0x41193f));});}; \ No newline at end of file +var _0x6931=['find','contact','info','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','%s/api/v2/contacts','Enduser\x20created.','apiKey','toString','base64','debug','stringify','GET','map','forEach','type','string','nameField','customField','content','idField','variable','variableName','push','customVariable','Variable','toLowerCase','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:','The\x20Ticket\x20ID\x20is:','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','outbound','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','[ABANDONED]','lodash','request-promise','md5','./util','../../../../config/environment','../../../../config/logger','freshdesk','redis','defaults','application/json','emit','Creating\x20new\x20ticket...','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','Subjects','Descriptions','
','Tags','name','Fields','custom_fields','mapValues','remoteUri','POST','Ticket\x20created!','validateEmail','then','length','Agent\x20found!'];(function(_0x3bc298,_0x583d14){var _0x31bf58=function(_0x24563b){while(--_0x24563b){_0x3bc298['push'](_0x3bc298['shift']());}};_0x31bf58(++_0x583d14);}(_0x6931,0x8c));var _0x1693=function(_0x477c50,_0x4b7366){_0x477c50=_0x477c50-0x0;var _0x3bf12c=_0x6931[_0x477c50];return _0x3bf12c;};'use strict';var _=require(_0x1693('0x0'));var rp=require(_0x1693('0x1'));var md5=require(_0x1693('0x2'));var util=require('util');var Redis=require('ioredis');var intUtil=require(_0x1693('0x3'));var config=require(_0x1693('0x4'));var logger=require(_0x1693('0x5'))(_0x1693('0x6'));config[_0x1693('0x7')]=_[_0x1693('0x8')](config[_0x1693('0x7')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var headers={'Content-Type':_0x1693('0x9'),'Accept':_0x1693('0x9')};function emit(_0x261bb1,_0x225260,_0x1077b6){io['to'](_0x261bb1)[_0x1693('0xa')](_0x225260,_0x1077b6);}function getTicket(_0x238eb3,_0x4a0693,_0xcbf541,_0x70fdae,_0x324525){logger['info'](_0x1693('0xb'));var _0x2db826=_[_0x1693('0xc')]({'responder_id':_0x4a0693['id'],'requester_id':_0xcbf541['id'],'name':util[_0x1693('0xd')](_0x1693('0xe'),_0x324525[_0x1693('0xf')]),'phone':_0x324525[_0x1693('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil['getString'](_0x70fdae[_0x1693('0x11')],_0x324525,'\x20'),'description':intUtil['getString'](_0x70fdae[_0x1693('0x12')],_0x324525,_0x1693('0x13')),'tags':getTags(_0x70fdae[_0x1693('0x14')],_0x1693('0x15'))},getCustomFields(_0x70fdae[_0x1693('0x16')],_0x324525));_0x2db826[_0x1693('0x17')]=_[_0x1693('0x18')](_['keyBy'](_0x2db826['custom_fields'],'id'),'value');return request({'uri':util[_0x1693('0xd')]('%s/api/v2/tickets',_0x238eb3[_0x1693('0x19')]),'method':_0x1693('0x1a'),'body':_0x2db826})['then'](function(_0x9fdc48){logger['info'](_0x1693('0x1b'));return _0x9fdc48;});}function getUser(_0x1176d6,_0x3f55b0){if(intUtil[_0x1693('0x1c')](_0x3f55b0)){return request({'uri':util['format']('%s/api/v2/agents',_0x1176d6[_0x1693('0x19')]),'qs':{'email':_0x3f55b0}})[_0x1693('0x1d')](function(_0x47e76f){if(_0x47e76f[_0x1693('0x1e')]){logger['info'](_0x1693('0x1f'));return _[_0x1693('0x20')](_0x47e76f,function(_0x3f1c53){return _0x3f1c53[_0x1693('0x21')]['email']===_0x3f55b0;});}else{logger[_0x1693('0x22')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x1693('0xd')](_0x1693('0x23'),_0x1176d6[_0x1693('0x19')])})[_0x1693('0x1d')](function(_0xdb35e1){logger[_0x1693('0x22')]('Admin\x20account\x20selected.');return _0xdb35e1;});}});}else{logger[_0x1693('0x22')](_0x1693('0x24'));return request({'uri':util['format'](_0x1693('0x23'),_0x1176d6[_0x1693('0x19')])})[_0x1693('0x1d')](function(_0x2aea18){logger[_0x1693('0x22')](_0x1693('0x25'));return _0x2aea18;});}}function getEndUser(_0x4c0dc1,_0x15e099,_0x44c65b){logger[_0x1693('0x22')]('Searching\x20enduser\x20with\x20phone',_0x44c65b);return request({'uri':util['format'](_0x1693('0x26'),_0x4c0dc1['remoteUri']),'qs':{'phone':_0x44c65b}})[_0x1693('0x1d')](function(_0x1cfaf6){if(_0x1cfaf6[_0x1693('0x1e')]){logger[_0x1693('0x22')]('Enduser\x20found!');return _['find'](_0x1cfaf6,{'phone':_0x44c65b});}else{logger[_0x1693('0x22')]('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');return request({'uri':util[_0x1693('0xd')](_0x1693('0x26'),_0x4c0dc1[_0x1693('0x19')]),'method':'POST','body':{'name':_0x15e099,'phone':_0x44c65b}})[_0x1693('0x1d')](function(_0x2aba26){logger['info'](_0x1693('0x27'));return _0x2aba26;});}});}function getAuth(_0x13b889){return util[_0x1693('0xd')]('Basic\x20%s',new Buffer(_0x13b889[_0x1693('0x28')]+':X')[_0x1693('0x29')](_0x1693('0x2a')));}function request(_0xa10af0){logger[_0x1693('0x2b')]('[HTTP]',JSON[_0x1693('0x2c')](_0xa10af0));return rp(_[_0x1693('0x8')](_0xa10af0,{'method':_0x1693('0x2d'),'headers':headers,'json':!![]}));}function getTags(_0x3e3b34,_0x31ea7b){var _0x4fc457=[];if(_0x3e3b34&&_0x3e3b34[_0x1693('0x1e')]>0x0){_0x4fc457=_[_0x1693('0x2e')](_0x3e3b34,_0x31ea7b);}return _0x4fc457;}function getCustomFields(_0x28ad25,_0x52dc99){var _0x33c698=[];var _0x30d68b={'custom_fields':[]};if(_0x28ad25[_0x1693('0x1e')]>0x0){_[_0x1693('0x2f')](_0x28ad25,function(_0x1ef9c5){if(_0x1ef9c5[_0x1693('0x30')]===_0x1693('0x31')&&_0x1ef9c5[_0x1693('0x32')]&&!_0x1ef9c5[_0x1693('0x33')]){_0x30d68b[_0x1ef9c5[_0x1693('0x32')]['toLowerCase']()]=_0x1ef9c5[_0x1693('0x34')]['toString']();}else if(_0x1ef9c5['type']===_0x1693('0x31')&&_0x1ef9c5[_0x1693('0x35')]&&_0x1ef9c5[_0x1693('0x33')]){_0x30d68b[_0x1693('0x17')]['push']({'id':_0x1ef9c5['idField'],'value':_0x1ef9c5[_0x1693('0x34')][_0x1693('0x29')]()});}else if(_0x1ef9c5['type']===_0x1693('0x36')&&_0x1ef9c5[_0x1693('0x37')]&&_0x1ef9c5[_0x1693('0x35')]&&_0x1ef9c5[_0x1693('0x33')]){_0x52dc99[_0x1ef9c5[_0x1693('0x37')]]&&_0x30d68b[_0x1693('0x17')][_0x1693('0x38')]({'id':_0x1ef9c5[_0x1693('0x35')],'value':_0x52dc99[_0x1ef9c5['variableName']][_0x1693('0x29')]()});}else if(_0x1ef9c5[_0x1693('0x30')]===_0x1693('0x39')&&_0x1ef9c5['Variable']&&_0x1ef9c5[_0x1693('0x3a')][_0x1693('0x15')]&&_0x1ef9c5['idField']&&_0x1ef9c5[_0x1693('0x33')]){_0x52dc99[_0x1ef9c5[_0x1693('0x3a')]['name'][_0x1693('0x3b')]()]&&_0x30d68b['custom_fields'][_0x1693('0x38')]({'id':_0x1ef9c5['idField'],'value':_0x52dc99[_0x1ef9c5[_0x1693('0x3a')]['name']['toLowerCase']()][_0x1693('0x29')]()});}});}return _0x30d68b;}exports['queue']=function(_0x5edfe9,_0x3d91bf,_0x1a7a47,_0x123d2c,_0x3cd54f,_0x443591){var _0x556788,_0x23e36c;_0x443591[_0x1693('0x19')]=intUtil[_0x1693('0x3c')](_0x443591['remoteUri']);_0x443591[_0x1693('0x3d')]=intUtil['stripTrailingSlash'](_0x443591[_0x1693('0x3d')]);if(_0x3cd54f&&_0x3cd54f[_0x1693('0x3e')]){logger[_0x1693('0x22')](_0x1693('0x3f'),_0x1693('0x40'));_0x3d91bf[_0x1693('0x41')]=util[_0x1693('0xd')](_0x1693('0x42'),_0x443591[_0x1693('0x3d')],_0x3d91bf[_0x1693('0x43')],md5(_0x3d91bf[_0x1693('0x43')]));}else{_0x3d91bf[_0x1693('0x41')]='';}headers[_0x1693('0x44')]=getAuth(_0x443591);return getUser(_0x443591,_0x123d2c[_0x1693('0x45')])[_0x1693('0x1d')](function(_0x5d55c2){_0x556788=_0x5d55c2;logger[_0x1693('0x22')](_0x1693('0x46'),_0x556788['id']);return getEndUser(_0x443591,_0x3d91bf['calleridname'],_0x3d91bf[_0x1693('0x10')]);})[_0x1693('0x1d')](function(_0x375542){_0x23e36c=_0x375542;logger['info']('The\x20Enduser\x20ID\x20is:',_0x23e36c['id']);return getTicket(_0x443591,_0x556788,_0x23e36c,_0x1a7a47,_0x3d91bf);})[_0x1693('0x1d')](function(_0x18050f){if(_0x18050f&&_0x18050f['id']){logger[_0x1693('0x22')](_0x1693('0x1b'));logger[_0x1693('0x22')](_0x1693('0x47'),_0x18050f['id']);logger[_0x1693('0x22')](_0x1693('0x3f'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0x1693('0x48'),_0x123d2c[_0x1693('0x15')]),_0x1693('0x49'),{'uri':util[_0x1693('0xd')](_0x1693('0x4a'),_0x443591['remoteUri'],_0x18050f['id'])});}})['catch'](function(_0x1ec7ec){logger['error'](_0x1693('0x3f'),JSON[_0x1693('0x2c')](_0x1ec7ec));});};exports[_0x1693('0x4b')]=function(_0x169324,_0x990a21,_0x213879,_0x15c695,_0x3dc785,_0x384598,_0x237a29){var _0x1176c6,_0x1531fe;_0x384598[_0x1693('0x19')]=intUtil[_0x1693('0x3c')](_0x384598[_0x1693('0x19')]);_0x384598[_0x1693('0x3d')]=intUtil[_0x1693('0x3c')](_0x384598[_0x1693('0x3d')]);if(_0x237a29&&_0x237a29['recordingFormat']&&_0x237a29[_0x1693('0x4c')]!==_0x1693('0x4d')){logger[_0x1693('0x22')](_0x1693('0x4e'),'Recording\x20is\x20enabled!');_0x990a21[_0x1693('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x384598[_0x1693('0x3d')],_0x990a21[_0x1693('0x43')],md5(_0x990a21[_0x1693('0x43')]));}headers['Authorization']=getAuth(_0x384598);return getUser(_0x384598,_0x15c695[_0x1693('0x45')])[_0x1693('0x1d')](function(_0x3526e5){_0x1176c6=_0x3526e5;logger[_0x1693('0x22')](_0x1693('0x46'),_0x1176c6['id']);return getEndUser(_0x384598,_0x990a21[_0x1693('0x4f')],_0x990a21[_0x1693('0x50')]);})[_0x1693('0x1d')](function(_0x4d2660){_0x1531fe=_0x4d2660;logger[_0x1693('0x22')](_0x1693('0x51'),_0x1531fe['id']);return getTicket(_0x384598,_0x1176c6,_0x1531fe,_0x213879,_0x990a21);})[_0x1693('0x1d')](function(_0x51ff1f){if(_0x51ff1f&&_0x51ff1f['id']){logger[_0x1693('0x22')](_0x1693('0x1b'));logger['info'](_0x1693('0x47'),_0x51ff1f['id']);logger['info']('[OUTBOUND]',_0x1693('0x52'));emit(util[_0x1693('0xd')](_0x1693('0x48'),_0x15c695[_0x1693('0x15')]),'trigger:browser:url',{'uri':util[_0x1693('0xd')](_0x1693('0x4a'),_0x384598[_0x1693('0x19')],_0x51ff1f['id'])});}})[_0x1693('0x53')](function(_0x235f61){logger[_0x1693('0x54')](_0x1693('0x4e'),JSON['stringify'](_0x235f61));});};exports['abandoned']=function(_0x3f903c,_0x4debc7,_0x177d58,_0x3125d1,_0x1ae688,_0x49de79){var _0x30cc23,_0x12bc29;_0x49de79[_0x1693('0x19')]=intUtil[_0x1693('0x3c')](_0x49de79['remoteUri']);_0x49de79[_0x1693('0x3d')]=intUtil[_0x1693('0x3c')](_0x49de79[_0x1693('0x3d')]);if(_0x1ae688&&_0x1ae688[_0x1693('0x3e')]){logger['info'](_0x1693('0x55'),'Recording\x20is\x20enabled!');_0x4debc7[_0x1693('0x41')]=util['format']('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x49de79[_0x1693('0x3d')],_0x4debc7[_0x1693('0x43')],md5(_0x4debc7['uniqueid']));}else{_0x4debc7[_0x1693('0x41')]='';}headers[_0x1693('0x44')]=getAuth(_0x49de79);return getUser(_0x49de79,'')[_0x1693('0x1d')](function(_0x1fd107){_0x30cc23=_0x1fd107;logger[_0x1693('0x22')]('The\x20User\x20ID\x20is:',_0x30cc23['id']);return getEndUser(_0x49de79,_0x4debc7['calleridname'],_0x4debc7[_0x1693('0x10')]);})['then'](function(_0x7c3c98){_0x12bc29=_0x7c3c98;logger['info'](_0x1693('0x51'),_0x12bc29['id']);return getTicket(_0x49de79,_0x30cc23,_0x12bc29,_0x177d58,_0x4debc7);})[_0x1693('0x1d')](function(_0x30e7e0){if(_0x30e7e0){logger['info'](_0x1693('0x1b'));logger[_0x1693('0x22')]('The\x20Ticket\x20ID\x20is:',_0x30e7e0['id']);}})[_0x1693('0x53')](function(_0x2dd5fc){logger['error'](_0x1693('0x55'),JSON[_0x1693('0x2c')](_0x2dd5fc));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/freshsales.js b/server/services/ami/trigger/integration/freshsales.js index 43e0329..f438ef5 100644 --- a/server/services/ami/trigger/integration/freshsales.js +++ b/server/services/ami/trigger/integration/freshsales.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x75ec=['Admin\x20selected','error','toUpperCase','/api/contacts/filters','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','find','work_number','contactNumber','mobile_number','endUserId','Contact\x20created:','message','POST','contact','Creating\x20new\x20task','/api/tasks','Contact','format','YYYY-MM-DDTHH:mm:ss','add','ticketId','task','Task\x20created:','/contacts/','emit','Token\x20token=','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','queue','abandoned','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','moment','bluebird','ioredis','./util','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','Admin\x20found:','adminId','Requested\x20Resource\x20not\x20Found','catch','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId'];(function(_0x1c6399,_0x23f4ae){var _0x106d4e=function(_0x104e1e){while(--_0x104e1e){_0x1c6399['push'](_0x1c6399['shift']());}};_0x106d4e(++_0x23f4ae);}(_0x75ec,0xe3));var _0xc75e=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0x75ec[_0x199572];return _0x13cfa3;};'use strict';var _=require(_0xc75e('0x0'));var rp=require(_0xc75e('0x1'));var md5=require(_0xc75e('0x2'));var util=require(_0xc75e('0x3'));var moment=require(_0xc75e('0x4'));var Promise=require(_0xc75e('0x5'));var Redis=require(_0xc75e('0x6'));var intUtil=require(_0xc75e('0x7'));var config=require(_0xc75e('0x8'));var logger=require(_0xc75e('0x9'))(_0xc75e('0xa'));config[_0xc75e('0xb')]=_[_0xc75e('0xc')](config['redis'],{'host':_0xc75e('0xd'),'port':0x18eb});var io=require(_0xc75e('0xe'))(new Redis(config[_0xc75e('0xb')]));function getAdminId(_0x504a62,_0xc771ad,_0x3899b8,_0x1ff150){return new Promise(function(_0x5f39f2,_0x513d91){var _0x1956fc=![];var _0x248f3c={'method':_0xc75e('0xf'),'uri':_0x1ff150+_0xc75e('0x10'),'json':!![]};_0x248f3c[_0xc75e('0x11')]=_0x3899b8;logger[_0xc75e('0x12')](_0xc75e('0x13'));return rp(_0x248f3c)[_0xc75e('0x14')](function(_0x3da4d4){if(_0x3da4d4){var _0x2674fe=_0x3da4d4[_0xc75e('0x15')];var _0x307ae1=null;for(_0x307ae1=0x0;_0x307ae1<_0x2674fe[_0xc75e('0x16')];_0x307ae1++){if(_0x2674fe[_0x307ae1][_0xc75e('0x17')]===_0x504a62[_0xc75e('0x18')]){_0x504a62['adminId']=_0x2674fe[_0x307ae1]['id'];_0x1956fc=!![];}}if(_0x1956fc){logger[_0xc75e('0x12')](_0xc75e('0x19'),_0x504a62[_0xc75e('0x1a')]);_0x5f39f2(_0x504a62);}else{_0x513d91({'statusCode':0x194,'message':_0xc75e('0x1b')});}}else{_0x513d91({'statusCode':0x194,'message':_0xc75e('0x1b')});}})[_0xc75e('0x1c')](function(_0x45117b){logger['error']('['+[_0xc771ad['toUpperCase']()]+']',_0x45117b['message']);_0x513d91(_0x45117b);});});}function getUser(_0x5ee3e8,_0x4693f0,_0x3b5f57){return function(_0x21b875){return new Promise(function(_0x6ef77c,_0x49e8f1){var _0x453664={'method':_0xc75e('0xf'),'uri':_0x3b5f57+_0xc75e('0x10'),'json':!![]};_0x453664[_0xc75e('0x11')]=_0x4693f0;logger['info'](_0xc75e('0x1d'));return rp(_0x453664)[_0xc75e('0x14')](function(_0x4f8d10){if(_0x4f8d10){var _0x5ca117=_0x4f8d10[_0xc75e('0x15')];var _0xaa8579=![];var _0xdb72e8=null;if(_0x21b875[_0xc75e('0x1e')]!==null){logger['info'](_0xc75e('0x1f'),_0x21b875['agentEmail']);_0x21b875[_0xc75e('0x20')]=_0x21b875[_0xc75e('0x1e')];for(_0xdb72e8=0x0;_0xdb72e8<_0x5ca117[_0xc75e('0x16')];_0xdb72e8++){if(_0x5ca117[_0xdb72e8][_0xc75e('0x17')]===_0x21b875['agentEmail']){_0xaa8579=!![];_0x21b875[_0xc75e('0x21')]=_0x5ca117[_0xdb72e8]['id'];logger['info']('User\x20found:',_0x21b875[_0xc75e('0x21')]);}}}if(!_0xaa8579){logger[_0xc75e('0x12')](_0xc75e('0x22'));_0x21b875[_0xc75e('0x20')]=_0x21b875['adminEmail'];_0x21b875[_0xc75e('0x21')]=_0x21b875[_0xc75e('0x1a')];_0xaa8579=!![];}if(_0xaa8579){_0x6ef77c(_0x21b875);}else{_0x49e8f1({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x49e8f1({'statusCode':0x194,'message':_0xc75e('0x1b')});}})[_0xc75e('0x1c')](function(_0x2716b2){logger[_0xc75e('0x23')]('['+[_0x5ee3e8[_0xc75e('0x24')]()]+']',_0x2716b2['message']);_0x49e8f1(_0x2716b2);});});};}function getEndUser(_0x2ec6db,_0x5f24f0,_0x2a259e){return function(_0x47e5cc){return new Promise(function(_0xf1311b,_0xf4005a){var _0x265086=0x0;var _0x19d09a={'method':'GET','uri':_0x2a259e+_0xc75e('0x25'),'json':!![]};_0x19d09a[_0xc75e('0x11')]=_0x5f24f0;logger['info']('Getting\x20contacts\x20filter');return rp(_0x19d09a)[_0xc75e('0x14')](function(_0x4cda87){_0x4cda87[_0xc75e('0x26')][_0xc75e('0x27')](function(_0x35ef1f){if(_0x35ef1f[_0xc75e('0x28')]===_0xc75e('0x29')){_0x265086=_0x35ef1f['id'];}});})['then'](function(){logger['info'](_0xc75e('0x2a'));var _0x45c907={'method':_0xc75e('0xf'),'uri':_0x2a259e+_0xc75e('0x2b')+_0x265086,'json':!![]};_0x45c907['headers']=_0x5f24f0;return rp(_0x45c907);})[_0xc75e('0x14')](function(_0x129f1b){logger['info'](_0xc75e('0x2c'),_0x47e5cc['contactNumber']);if(_0x129f1b[_0xc75e('0x2d')][_0xc75e('0x16')]>0x0){var _0x3848ac=_[_0xc75e('0x2e')](_0x129f1b[_0xc75e('0x2d')],function(_0x2753f3){if(_0x2753f3[_0xc75e('0x2f')]===_0x47e5cc[_0xc75e('0x30')]||_0x2753f3[_0xc75e('0x31')]===_0x47e5cc[_0xc75e('0x30')]){return _0x2753f3;}});if(_0x3848ac){_0x47e5cc[_0xc75e('0x32')]=_0x3848ac['id'];logger[_0xc75e('0x12')]('Contact\x20found:',_0x47e5cc['endUserId']);_0xf1311b(_0x47e5cc);}else{return createEndUser(_0x47e5cc,_0x2ec6db,_0x5f24f0,_0x2a259e)[_0xc75e('0x14')](function(_0x4e89a7){logger[_0xc75e('0x12')](_0xc75e('0x33'),_0x47e5cc[_0xc75e('0x32')]);_0xf1311b(_0x4e89a7);});}}else{return createEndUser(_0x47e5cc,_0x2ec6db,_0x5f24f0,_0x2a259e)['then'](function(_0x7d76a9){logger[_0xc75e('0x12')](_0xc75e('0x33'),_0x47e5cc['endUserId']);_0xf1311b(_0x7d76a9);});}})[_0xc75e('0x1c')](function(_0x470f45){throw new Error(_0x470f45[_0xc75e('0x34')]);});});};}function createEndUser(_0x27aa1c,_0x41d7e2,_0xaccc63,_0x110036){return new Promise(function(_0x10847b,_0x47548b){var _0x121040=moment();var _0x3a5007={'method':_0xc75e('0x35'),'uri':_0x110036+'/api/contacts','body':{'contact':{'last_name':_0x27aa1c[_0xc75e('0x30')],'work_number':_0x27aa1c[_0xc75e('0x30')],'mobile_number':_0x27aa1c[_0xc75e('0x30')],'owner_id':_0x27aa1c[_0xc75e('0x21')],'created_at':_0x121040['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x3a5007[_0xc75e('0x11')]=_0xaccc63;logger[_0xc75e('0x12')]('Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact');return rp(_0x3a5007)[_0xc75e('0x14')](function(_0x32d2aa){_0x27aa1c[_0xc75e('0x32')]=_0x32d2aa[_0xc75e('0x36')]['id'];_0x10847b(_0x27aa1c);})[_0xc75e('0x1c')](function(_0x549345){logger[_0xc75e('0x23')]('['+[_0x41d7e2['toUpperCase']()]+']',_0x549345[_0xc75e('0x34')]);_0x47548b(_0x549345[_0xc75e('0x34')]);});});}function getTicket(_0x46e077,_0x438c8c,_0x26e77d,_0x2913f8,_0x50673d){return function(_0x2e9fb1){logger[_0xc75e('0x12')](_0xc75e('0x37'));return new Promise(function(_0x26f710,_0x178235){var _0x1cfe90=moment();var _0x1a6768={'method':_0xc75e('0x35'),'uri':_0x26e77d+_0xc75e('0x38'),'body':{'title':intUtil['getString'](_0x2913f8['Subjects'],_0x50673d,'\x20'),'description':intUtil['getString'](_0x2913f8['Descriptions'],_0x50673d,'\x0a'),'owner_id':_0x2e9fb1['userId'],'creater_id':_0x2e9fb1[_0xc75e('0x1a')],'targetable_id':_0x2e9fb1[_0xc75e('0x32')],'targetable_type':_0xc75e('0x39'),'created_at':_0x1cfe90[_0xc75e('0x3a')](_0xc75e('0x3b')),'due_date':_0x1cfe90[_0xc75e('0x3c')](0x1e,'m')[_0xc75e('0x3a')](_0xc75e('0x3b'))},'json':!![]};_0x1a6768[_0xc75e('0x11')]=_0x438c8c;return rp(_0x1a6768)[_0xc75e('0x14')](function(_0x510105){_0x2e9fb1[_0xc75e('0x3d')]=_0x510105[_0xc75e('0x3e')]['id'];logger['info'](_0xc75e('0x3f'),_0x2e9fb1[_0xc75e('0x3d')]);_0x26f710(_0x2e9fb1);})[_0xc75e('0x1c')](function(_0x355df9){logger['error']('['+[_0x46e077['toUpperCase']()]+']',_0x355df9[_0xc75e('0x34')]);_0x178235(_0x355df9[_0xc75e('0x34')]);});});};}function emit(_0x463a0c,_0x1cddda,_0x5f3674){var _0x450eaf={'uri':_0x463a0c+_0xc75e('0x40')+_0x5f3674};io['to'](util[_0xc75e('0x3a')]('user:%s',_0x1cddda))[_0xc75e('0x41')]('trigger:browser:url',_0x450eaf);}exports['cs']=function(_0x4e36cf,_0x2e9eb8,_0x4f9c25,_0x1f1b73,_0x2f869d,_0x513f70,_0x57a8fc,_0x2a50ec){var _0x423906={};var _0x537292={'Authorization':_0xc75e('0x42')+_0x513f70['apiKey']};_0x513f70[_0xc75e('0x43')]=intUtil[_0xc75e('0x44')](_0x513f70[_0xc75e('0x43')]);_0x513f70['serverUrl']=intUtil[_0xc75e('0x44')](_0x513f70[_0xc75e('0x45')]);var _0x57facf=_0x513f70[_0xc75e('0x43')];_0x423906[_0xc75e('0x18')]=_0x513f70['username'];_0x423906['contactNumber']=_0x2a50ec[_0xc75e('0x46')]()===_0xc75e('0x47')?_0x2e9eb8[_0xc75e('0x48')]:_0x2e9eb8[_0xc75e('0x49')];_0x423906['callDirection']=_0x2a50ec===_0xc75e('0x4a')||_0x2a50ec===_0xc75e('0x4b')?'queue':'outbound';if(_0x1f1b73){_0x423906[_0xc75e('0x1e')]=_0x1f1b73['email'];}var _0x422074=util[_0xc75e('0x3a')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x513f70[_0xc75e('0x45')],_0x2e9eb8['uniqueid'],md5(_0x2e9eb8['uniqueid']));if(_0x2f869d&&_0x2f869d[_0xc75e('0x4c')]){logger[_0xc75e('0x12')](_0xc75e('0x4d'),'Recording\x20is\x20enabled!');_0x2e9eb8[_0xc75e('0x4e')]=_0x422074;}else if(_0x57a8fc&&_0x57a8fc['recordingFormat']&&_0x57a8fc[_0xc75e('0x4f')]!==_0xc75e('0x50')){logger[_0xc75e('0x12')](_0xc75e('0x51'),_0xc75e('0x52'));_0x2e9eb8['recordingURL']=_0x422074;}else{_0x2e9eb8['recordingURL']='';}return getAdminId(_0x423906,_0x2a50ec,_0x537292,_0x57facf)[_0xc75e('0x14')](getUser(_0x2a50ec,_0x537292,_0x57facf))['then'](getEndUser(_0x2a50ec,_0x537292,_0x57facf))[_0xc75e('0x14')](getTicket(_0x2a50ec,_0x537292,_0x57facf,_0x4f9c25,_0x2e9eb8))[_0xc75e('0x14')](function(_0x175f82){logger['info'](util['format'](_0xc75e('0x53'),_0x175f82[_0xc75e('0x3d')]));if(_0x2a50ec!==_0xc75e('0x4b')){logger[_0xc75e('0x12')]('['+[_0x2a50ec[_0xc75e('0x24')]()]+']',_0xc75e('0x54'));emit(_0x57facf,_0x1f1b73[_0xc75e('0x28')],_0x175f82[_0xc75e('0x32')]);}})[_0xc75e('0x1c')](function(_0xd5f839){logger[_0xc75e('0x23')]('['+[_0x2a50ec[_0xc75e('0x24')]()]+_0xc75e('0x55'),util[_0xc75e('0x56')](_0xd5f839,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x04e1=['Task\x20created:','/contacts/','user:%s','emit','Token\x20token=','apiKey','stripTrailingSlash','remoteUri','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','callDirection','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','monitor_format','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','abandoned','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','bluebird','ioredis','./util','freshsales','redis','socket.io-emitter','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail','adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','GET','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','Admin\x20selected','toUpperCase','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Searching\x20contact\x20with\x20phone','contactNumber','find','contacts','work_number','mobile_number','endUserId','Contact\x20found:','Contact\x20created:','POST','/api/contacts','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','format','YYYY-MM-DDTHH:mm:ss','add','ticketId'];(function(_0x7f46f6,_0x1e88f5){var _0x27a2e3=function(_0x4d628a){while(--_0x4d628a){_0x7f46f6['push'](_0x7f46f6['shift']());}};_0x27a2e3(++_0x1e88f5);}(_0x04e1,0x177));var _0x104e=function(_0xb00cc2,_0x2efc2d){_0xb00cc2=_0xb00cc2-0x0;var _0x33af98=_0x04e1[_0xb00cc2];return _0x33af98;};'use strict';var _=require(_0x104e('0x0'));var rp=require(_0x104e('0x1'));var md5=require(_0x104e('0x2'));var util=require('util');var moment=require('moment');var Promise=require(_0x104e('0x3'));var Redis=require(_0x104e('0x4'));var intUtil=require(_0x104e('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x104e('0x6'));config[_0x104e('0x7')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x104e('0x8'))(new Redis(config['redis']));function getAdminId(_0x3426df,_0x3d5569,_0x2c7bc9,_0x27ff1b){return new Promise(function(_0x565172,_0x56c9b8){var _0x7789f2=![];var _0x2508a3={'method':'GET','uri':_0x27ff1b+_0x104e('0x9'),'json':!![]};_0x2508a3[_0x104e('0xa')]=_0x2c7bc9;logger[_0x104e('0xb')](_0x104e('0xc'));return rp(_0x2508a3)[_0x104e('0xd')](function(_0x101e94){if(_0x101e94){var _0x34291a=_0x101e94[_0x104e('0xe')];var _0x531a9c=null;for(_0x531a9c=0x0;_0x531a9c<_0x34291a[_0x104e('0xf')];_0x531a9c++){if(_0x34291a[_0x531a9c][_0x104e('0x10')]===_0x3426df[_0x104e('0x11')]){_0x3426df[_0x104e('0x12')]=_0x34291a[_0x531a9c]['id'];_0x7789f2=!![];}}if(_0x7789f2){logger[_0x104e('0xb')](_0x104e('0x13'),_0x3426df[_0x104e('0x12')]);_0x565172(_0x3426df);}else{_0x56c9b8({'statusCode':0x194,'message':_0x104e('0x14')});}}else{_0x56c9b8({'statusCode':0x194,'message':_0x104e('0x14')});}})[_0x104e('0x15')](function(_0x3d13e3){logger[_0x104e('0x16')]('['+[_0x3d5569['toUpperCase']()]+']',_0x3d13e3[_0x104e('0x17')]);_0x56c9b8(_0x3d13e3);});});}function getUser(_0x295172,_0x3a1b8c,_0x36f64e){return function(_0x5e66a2){return new Promise(function(_0x105d0c,_0x27efc5){var _0x405187={'method':_0x104e('0x18'),'uri':_0x36f64e+_0x104e('0x9'),'json':!![]};_0x405187[_0x104e('0xa')]=_0x3a1b8c;logger[_0x104e('0xb')]('Getting\x20user\x20list');return rp(_0x405187)['then'](function(_0x233309){if(_0x233309){var _0x49f04d=_0x233309[_0x104e('0xe')];var _0x906f40=![];var _0x241af6=null;if(_0x5e66a2[_0x104e('0x19')]!==null){logger[_0x104e('0xb')](_0x104e('0x1a'),_0x5e66a2[_0x104e('0x19')]);_0x5e66a2[_0x104e('0x1b')]=_0x5e66a2[_0x104e('0x19')];for(_0x241af6=0x0;_0x241af6<_0x49f04d[_0x104e('0xf')];_0x241af6++){if(_0x49f04d[_0x241af6][_0x104e('0x10')]===_0x5e66a2['agentEmail']){_0x906f40=!![];_0x5e66a2[_0x104e('0x1c')]=_0x49f04d[_0x241af6]['id'];logger[_0x104e('0xb')]('User\x20found:',_0x5e66a2[_0x104e('0x1c')]);}}}if(!_0x906f40){logger[_0x104e('0xb')](_0x104e('0x1d'));_0x5e66a2[_0x104e('0x1b')]=_0x5e66a2[_0x104e('0x11')];_0x5e66a2[_0x104e('0x1c')]=_0x5e66a2['adminId'];_0x906f40=!![];}if(_0x906f40){_0x105d0c(_0x5e66a2);}else{_0x27efc5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x27efc5({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}})[_0x104e('0x15')](function(_0x5e9500){logger[_0x104e('0x16')]('['+[_0x295172[_0x104e('0x1e')]()]+']',_0x5e9500[_0x104e('0x17')]);_0x27efc5(_0x5e9500);});});};}function getEndUser(_0x56c7c4,_0x26620d,_0x2ac1c5){return function(_0x5d3ef1){return new Promise(function(_0x317498,_0x3df23c){var _0x45ec14=0x0;var _0x4c8a71={'method':_0x104e('0x18'),'uri':_0x2ac1c5+_0x104e('0x1f'),'json':!![]};_0x4c8a71['headers']=_0x26620d;logger[_0x104e('0xb')](_0x104e('0x20'));return rp(_0x4c8a71)[_0x104e('0xd')](function(_0x92b058){_0x92b058[_0x104e('0x21')][_0x104e('0x22')](function(_0x15aa69){if(_0x15aa69[_0x104e('0x23')]===_0x104e('0x24')){_0x45ec14=_0x15aa69['id'];}});})[_0x104e('0xd')](function(){logger['info']('Getting\x20contact\x20list');var _0xbccdf8={'method':'GET','uri':_0x2ac1c5+'/api/contacts/view/'+_0x45ec14,'json':!![]};_0xbccdf8[_0x104e('0xa')]=_0x26620d;return rp(_0xbccdf8);})[_0x104e('0xd')](function(_0x4f0632){logger[_0x104e('0xb')](_0x104e('0x25'),_0x5d3ef1[_0x104e('0x26')]);if(_0x4f0632['contacts']['length']>0x0){var _0x56f043=_[_0x104e('0x27')](_0x4f0632[_0x104e('0x28')],function(_0x406c02){if(_0x406c02[_0x104e('0x29')]===_0x5d3ef1[_0x104e('0x26')]||_0x406c02[_0x104e('0x2a')]===_0x5d3ef1[_0x104e('0x26')]){return _0x406c02;}});if(_0x56f043){_0x5d3ef1[_0x104e('0x2b')]=_0x56f043['id'];logger[_0x104e('0xb')](_0x104e('0x2c'),_0x5d3ef1['endUserId']);_0x317498(_0x5d3ef1);}else{return createEndUser(_0x5d3ef1,_0x56c7c4,_0x26620d,_0x2ac1c5)[_0x104e('0xd')](function(_0x487a85){logger[_0x104e('0xb')](_0x104e('0x2d'),_0x5d3ef1[_0x104e('0x2b')]);_0x317498(_0x487a85);});}}else{return createEndUser(_0x5d3ef1,_0x56c7c4,_0x26620d,_0x2ac1c5)[_0x104e('0xd')](function(_0x45c4ee){logger['info'](_0x104e('0x2d'),_0x5d3ef1[_0x104e('0x2b')]);_0x317498(_0x45c4ee);});}})['catch'](function(_0x1b505a){throw new Error(_0x1b505a[_0x104e('0x17')]);});});};}function createEndUser(_0x4839d0,_0x5618b0,_0x51b15f,_0x388f48){return new Promise(function(_0xa43c3,_0x292a9a){var _0x27654d=moment();var _0x78e004={'method':_0x104e('0x2e'),'uri':_0x388f48+_0x104e('0x2f'),'body':{'contact':{'last_name':_0x4839d0[_0x104e('0x26')],'work_number':_0x4839d0[_0x104e('0x26')],'mobile_number':_0x4839d0[_0x104e('0x26')],'owner_id':_0x4839d0[_0x104e('0x1c')],'created_at':_0x27654d['format']('YYYY-MM-DDTHH:mm:ss')}},'json':!![]};_0x78e004[_0x104e('0xa')]=_0x51b15f;logger[_0x104e('0xb')](_0x104e('0x30'));return rp(_0x78e004)[_0x104e('0xd')](function(_0x276345){_0x4839d0[_0x104e('0x2b')]=_0x276345[_0x104e('0x31')]['id'];_0xa43c3(_0x4839d0);})[_0x104e('0x15')](function(_0x5e1b1d){logger[_0x104e('0x16')]('['+[_0x5618b0['toUpperCase']()]+']',_0x5e1b1d[_0x104e('0x17')]);_0x292a9a(_0x5e1b1d[_0x104e('0x17')]);});});}function getTicket(_0x28f42c,_0x3f0566,_0x18d830,_0x341455,_0x3b6c82){return function(_0x5efc24){logger[_0x104e('0xb')](_0x104e('0x32'));return new Promise(function(_0x412003,_0x11ccd8){var _0x33d540=moment();var _0x18f9b4={'method':_0x104e('0x2e'),'uri':_0x18d830+_0x104e('0x33'),'body':{'title':intUtil[_0x104e('0x34')](_0x341455[_0x104e('0x35')],_0x3b6c82,'\x20'),'description':intUtil[_0x104e('0x34')](_0x341455[_0x104e('0x36')],_0x3b6c82,'\x0a'),'owner_id':_0x5efc24[_0x104e('0x1c')],'creater_id':_0x5efc24['adminId'],'targetable_id':_0x5efc24[_0x104e('0x2b')],'targetable_type':_0x104e('0x37'),'created_at':_0x33d540[_0x104e('0x38')](_0x104e('0x39')),'due_date':_0x33d540[_0x104e('0x3a')](0x1e,'m')[_0x104e('0x38')](_0x104e('0x39'))},'json':!![]};_0x18f9b4[_0x104e('0xa')]=_0x3f0566;return rp(_0x18f9b4)['then'](function(_0x52235b){_0x5efc24[_0x104e('0x3b')]=_0x52235b['task']['id'];logger['info'](_0x104e('0x3c'),_0x5efc24[_0x104e('0x3b')]);_0x412003(_0x5efc24);})['catch'](function(_0x4b9fec){logger['error']('['+[_0x28f42c[_0x104e('0x1e')]()]+']',_0x4b9fec[_0x104e('0x17')]);_0x11ccd8(_0x4b9fec['message']);});});};}function emit(_0x2d7d02,_0x12c8b5,_0x5d1a45){var _0x183bec={'uri':_0x2d7d02+_0x104e('0x3d')+_0x5d1a45};io['to'](util[_0x104e('0x38')](_0x104e('0x3e'),_0x12c8b5))[_0x104e('0x3f')]('trigger:browser:url',_0x183bec);}exports['cs']=function(_0x3a390c,_0x33e06b,_0x39fa6b,_0x515721,_0x2ab51f,_0x1ed471,_0x4be031,_0x644d7a){var _0x3be5d9={};var _0xb7cc54={'Authorization':_0x104e('0x40')+_0x1ed471[_0x104e('0x41')]};_0x1ed471['remoteUri']=intUtil[_0x104e('0x42')](_0x1ed471[_0x104e('0x43')]);_0x1ed471[_0x104e('0x44')]=intUtil[_0x104e('0x42')](_0x1ed471[_0x104e('0x44')]);var _0x308e84=_0x1ed471[_0x104e('0x43')];_0x3be5d9['adminEmail']=_0x1ed471['username'];_0x3be5d9[_0x104e('0x26')]=_0x644d7a[_0x104e('0x45')]()===_0x104e('0x46')?_0x33e06b[_0x104e('0x47')]:_0x33e06b[_0x104e('0x48')];_0x3be5d9[_0x104e('0x49')]=_0x644d7a==='queue'||_0x644d7a==='abandoned'?'queue':_0x104e('0x46');if(_0x515721){_0x3be5d9[_0x104e('0x19')]=_0x515721[_0x104e('0x10')];}var _0x4e5e01=util['format'](_0x104e('0x4a'),_0x1ed471[_0x104e('0x44')],_0x33e06b['uniqueid'],md5(_0x33e06b['uniqueid']));if(_0x2ab51f&&_0x2ab51f[_0x104e('0x4b')]){logger[_0x104e('0xb')](_0x104e('0x4c'),'Recording\x20is\x20enabled!');_0x33e06b[_0x104e('0x4d')]=_0x4e5e01;}else if(_0x4be031&&_0x4be031[_0x104e('0x4e')]&&_0x4be031[_0x104e('0x4e')]!==_0x104e('0x4f')){logger[_0x104e('0xb')](_0x104e('0x50'),_0x104e('0x51'));_0x33e06b[_0x104e('0x4d')]=_0x4e5e01;}else{_0x33e06b[_0x104e('0x4d')]='';}return getAdminId(_0x3be5d9,_0x644d7a,_0xb7cc54,_0x308e84)[_0x104e('0xd')](getUser(_0x644d7a,_0xb7cc54,_0x308e84))[_0x104e('0xd')](getEndUser(_0x644d7a,_0xb7cc54,_0x308e84))[_0x104e('0xd')](getTicket(_0x644d7a,_0xb7cc54,_0x308e84,_0x39fa6b,_0x33e06b))[_0x104e('0xd')](function(_0x3df2dc){logger[_0x104e('0xb')](util['format'](_0x104e('0x52'),_0x3df2dc[_0x104e('0x3b')]));if(_0x644d7a!==_0x104e('0x53')){logger['info']('['+[_0x644d7a[_0x104e('0x1e')]()]+']',_0x104e('0x54'));emit(_0x308e84,_0x515721[_0x104e('0x23')],_0x3df2dc['endUserId']);}})[_0x104e('0x15')](function(_0x4f0839){logger[_0x104e('0x16')]('['+[_0x644d7a[_0x104e('0x1e')]()]+_0x104e('0x55'),util[_0x104e('0x56')](_0x4f0839,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/index.js b/server/services/ami/trigger/integration/index.js index 41f886a..ae2aa58 100644 --- a/server/services/ami/trigger/integration/index.js +++ b/server/services/ami/trigger/integration/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x55460c,_0x166c92){var _0x247f5d=function(_0xb4c43c){while(--_0xb4c43c){_0x55460c['push'](_0x55460c['shift']());}};_0x247f5d(++_0x166c92);}(_0xa9e0,0x123));var _0x0a9e=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0xa9e0[_0x297fd3];return _0x2af381;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x5b55e1,_0x390826){var _0x550a53=function(_0x584c26){while(--_0x584c26){_0x5b55e1['push'](_0x5b55e1['shift']());}};_0x550a53(++_0x390826);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4709c0,_0x3396c7){_0x4709c0=_0x4709c0-0x0;var _0x13348b=_0xa9e0[_0x4709c0];return _0x13348b;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/salesforce.js b/server/services/ami/trigger/integration/salesforce.js index b86e759..fa8f662 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 _0xe0a3=['create','string','idField','toString','type','variable','variableName','customVariable','Variable','name','password','concat','securityToken','Connection','remoteUri','clientId','clientSecret','login','username','queue','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','trigger:salesforce:display','newTab','user:%s','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','recordingFormat','[OUTBOUND]','destcalleridname','destcalleridnum','outbound','[OUTBOUND]\x20Ticket\x20%s\x20created.','trigger:browser:url','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','monitor_format','[ABANDONED]','[ABANDONED]\x20Integration\x20account\x20type\x20%s.','stringify','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','localhost','ticketType','Task','utc','getString','assign','ContactId','isNil','validateEmail','sobject','User','find','execute','then','length','info','Agent\x20%s\x20found.','resolve','Name','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','format','Caller\x20-\x20%s','moduleCreate','lead','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst'];(function(_0x9d680d,_0x295c2f){var _0x2ff74d=function(_0x56284a){while(--_0x56284a){_0x9d680d['push'](_0x9d680d['shift']());}};_0x2ff74d(++_0x295c2f);}(_0xe0a3,0x16c));var _0x3e0a=function(_0x57014b,_0x360c0f){_0x57014b=_0x57014b-0x0;var _0x2b258a=_0xe0a3[_0x57014b];return _0x2b258a;};'use strict';var _=require('lodash');var rp=require(_0x3e0a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var md5=require(_0x3e0a('0x1'));var jsforce=require('jsforce');var util=require(_0x3e0a('0x2'));var Redis=require(_0x3e0a('0x3'));var intUtil=require(_0x3e0a('0x4'));var config=require(_0x3e0a('0x5'));var logger=require(_0x3e0a('0x6'))('salesforce');config[_0x3e0a('0x7')]=_['defaults'](config['redis'],{'host':_0x3e0a('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x3e0a('0x7')]));function emit(_0x197168,_0xe633fc,_0x46ccb1){io['to'](_0x197168)['emit'](_0xe633fc,_0x46ccb1);}function getTicket(_0x270d59,_0x1c8676,_0x355094,_0xe4062e,_0x2aabc1,_0xb3a114,_0x23b7f2,_0x323008){var _0xda21bb={};if(_0xe4062e[_0x3e0a('0x9')]===_0x3e0a('0xa')){_0xda21bb=Object['assign']({},{'OwnerId':_0x1c8676['id'],'ActivityDate':moment[_0x3e0a('0xb')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x3e0a('0xc')](_0xe4062e['Subjects'],_0x2aabc1,'\x20'),'Description':intUtil[_0x3e0a('0xc')](_0xe4062e['Descriptions'],_0x2aabc1,'\x0a')},getCustomFields(_0xb3a114,_0x2aabc1));if(_0x355094){_0xda21bb['WhoId']=_0x355094['id'];}}else if(_0xe4062e[_0x3e0a('0x9')]==='Case'){_0xda21bb=Object[_0x3e0a('0xd')]({},{'OwnerId':_0x1c8676['id'],'Subject':intUtil[_0x3e0a('0xc')](_0xe4062e['Subjects'],_0x2aabc1,'\x20'),'Description':intUtil[_0x3e0a('0xc')](_0xe4062e['Descriptions'],_0x2aabc1,'\x0a')},getCustomFields(_0xb3a114,_0x2aabc1));if(_0x355094){_0xda21bb[_0x3e0a('0xe')]=_0x355094['id'];}}return _0x23b7f2['sobject'](_0xe4062e[_0x3e0a('0x9')])['create'](_0xda21bb);}function getUser(_0x4a6dac,_0x48e016,_0xf9ce54){if(!_[_0x3e0a('0xf')](_0x48e016)&&intUtil[_0x3e0a('0x10')](_0x48e016)){var _0x4672b0={'Email':_0x48e016};var _0x372601={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0xf9ce54[_0x3e0a('0x11')](_0x3e0a('0x12'))[_0x3e0a('0x13')](_0x4672b0,_0x372601)[_0x3e0a('0x14')]()[_0x3e0a('0x15')](function(_0x15df02){if(_0x15df02[_0x3e0a('0x16')]){var _0x2b192e=_['find'](_0x15df02,function(_0x2974ac){return _0x2974ac['Email']===_0x48e016;});if(_0x2b192e){logger[_0x3e0a('0x17')](_0x3e0a('0x18'),_0x48e016);return BPromise[_0x3e0a('0x19')]({'id':_0x2b192e['Id'],'name':_0x2b192e[_0x3e0a('0x1a')]});}}else{logger['info'](_0x3e0a('0x1b'),_0x48e016);return _0xf9ce54[_0x3e0a('0x1c')]()[_0x3e0a('0x15')](function(_0x1c8c56){return BPromise[_0x3e0a('0x19')]({'id':_0x1c8c56[_0x3e0a('0x1d')],'name':_0x1c8c56['display_name']});});}});}else{logger[_0x3e0a('0x17')](_0x3e0a('0x1b'),_0x48e016);return _0xf9ce54[_0x3e0a('0x1c')]()['then'](function(_0x1a85d6){return BPromise['resolve']({'id':_0x1a85d6[_0x3e0a('0x1d')],'name':_0x1a85d6['display_name']});});}}function getEndUser(_0x2e4f8d,_0x330a14,_0x52c695,_0x5e1488,_0x5f3132){var _0x31c06c={'Phone':_0x5e1488};var _0x1fe7e4={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x3e0a('0x19')]()[_0x3e0a('0x15')](function(){if(_0x330a14[_0x3e0a('0x9')]==='Task'){logger[_0x3e0a('0x17')](_0x3e0a('0x1e'),_0x5e1488,_0x330a14[_0x3e0a('0x1f')]);switch(_0x330a14[_0x3e0a('0x1f')]){case _0x3e0a('0x20'):return _0x5f3132[_0x3e0a('0x11')](_0x3e0a('0x21'))[_0x3e0a('0x13')](_0x31c06c,_0x1fe7e4)[_0x3e0a('0x14')]()[_0x3e0a('0x15')](function(_0x4a98c1){if(_0x4a98c1&&_0x4a98c1[_0x3e0a('0x16')]){return _0x4a98c1;}else{return _0x5f3132['sobject'](_0x3e0a('0x22'))['find'](_0x31c06c,_0x1fe7e4);}});case _0x3e0a('0x23'):return _0x5f3132[_0x3e0a('0x11')](_0x3e0a('0x21'))[_0x3e0a('0x13')](_0x31c06c,_0x1fe7e4)[_0x3e0a('0x14')]();case'lead':return _0x5f3132[_0x3e0a('0x11')](_0x3e0a('0x22'))[_0x3e0a('0x13')](_0x31c06c,_0x1fe7e4);default:return null;}}else if(_0x330a14[_0x3e0a('0x9')]==='Case'){logger[_0x3e0a('0x17')](_0x3e0a('0x1e'),_0x5e1488,_0x3e0a('0x23'));return _0x5f3132[_0x3e0a('0x11')](_0x3e0a('0x21'))[_0x3e0a('0x13')](_0x31c06c,_0x1fe7e4)['execute']();}})[_0x3e0a('0x15')](function(_0x3dbd9e){if(_0x3dbd9e&&_0x3dbd9e[_0x3e0a('0x16')]){var _0x2369ed=_[_0x3e0a('0x13')](_0x3dbd9e,function(_0x28cd37){return _0x28cd37[_0x3e0a('0x24')]===_0x5e1488;});if(_0x2369ed){return BPromise['resolve']({'id':_0x2369ed['Id'],'name':_0x2369ed[_0x3e0a('0x1a')],'phone':_0x2369ed['Phone']});}}})['then'](function(_0x55078e){if(_0x55078e){logger['info'](_0x3e0a('0x25'),_0x5e1488);return BPromise[_0x3e0a('0x19')](_0x55078e);}else{logger[_0x3e0a('0x17')](_0x3e0a('0x26'),_0x5e1488);var _0x1a0c6e={'LastName':_0x52c695!==_0x3e0a('0x27')?_0x52c695:util[_0x3e0a('0x28')](_0x3e0a('0x29'),_0x5e1488),'Phone':_0x5e1488};if(_0x330a14['moduleCreate']){if(_0x330a14[_0x3e0a('0x2a')]===_0x3e0a('0x23')){logger[_0x3e0a('0x17')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x5e1488,_0x330a14[_0x3e0a('0x2a')]);}else if(_0x330a14['moduleCreate']===_0x3e0a('0x2b')&&_0x330a14[_0x3e0a('0x9')]==='Task'){logger[_0x3e0a('0x17')](_0x3e0a('0x2c'),_0x5e1488,_0x330a14[_0x3e0a('0x2a')]);_0x1a0c6e[_0x3e0a('0x2d')]=_0x3e0a('0x2e');}else{return null;}}return _0x5f3132[_0x3e0a('0x11')](_[_0x3e0a('0x2f')](_0x330a14[_0x3e0a('0x2a')]))[_0x3e0a('0x30')](_0x1a0c6e);}});}function getCustomFields(_0x5b2138,_0x331159){var _0x3e406a={};if(_0x5b2138[_0x3e0a('0x16')]>0x0){_['forEach'](_0x5b2138,function(_0x57075f){if(_0x57075f['type']===_0x3e0a('0x31')&&_0x57075f[_0x3e0a('0x32')]){_0x3e406a[_0x57075f[_0x3e0a('0x32')]]=_0x57075f['content'][_0x3e0a('0x33')]();}else if(_0x57075f[_0x3e0a('0x34')]===_0x3e0a('0x35')&&_0x57075f['variableName']&&_0x57075f[_0x3e0a('0x32')]){_0x331159[_0x57075f[_0x3e0a('0x36')]]&&(_0x3e406a[_0x57075f['idField']]=_0x331159[_0x57075f[_0x3e0a('0x36')]][_0x3e0a('0x33')]());}else if(_0x57075f[_0x3e0a('0x34')]===_0x3e0a('0x37')&&_0x57075f[_0x3e0a('0x38')]&&_0x57075f[_0x3e0a('0x38')][_0x3e0a('0x39')]&&_0x57075f[_0x3e0a('0x32')]){_0x331159[_0x57075f[_0x3e0a('0x38')][_0x3e0a('0x39')]['toLowerCase']()]&&(_0x3e406a[_0x57075f[_0x3e0a('0x32')]]=_0x331159[_0x57075f[_0x3e0a('0x38')][_0x3e0a('0x39')]['toLowerCase']()][_0x3e0a('0x33')]());}});}return _0x3e406a;}function getConnection(_0x32e522){var _0x111aaa=_0x32e522[_0x3e0a('0x3a')][_0x3e0a('0x3b')](_0x32e522[_0x3e0a('0x3c')]);var _0x5186eb=new jsforce[(_0x3e0a('0x3d'))]({'oauth2':{'loginUrl':_0x32e522[_0x3e0a('0x3e')]||'https://login.salesforce.com','clientId':_0x32e522[_0x3e0a('0x3f')],'clientSecret':_0x32e522[_0x3e0a('0x40')]}});return _0x5186eb[_0x3e0a('0x41')](_0x32e522[_0x3e0a('0x42')],_0x111aaa)['then'](function(){logger[_0x3e0a('0x17')]('Connection\x20established.');return _0x5186eb;});}exports[_0x3e0a('0x43')]=function(_0x5a23e9,_0x17d572,_0x1f3daf,_0x4ef31a,_0x2c231c,_0x4dd6c0){var _0x29fc1e,_0xc3d592,_0x4955a1,_0x308d8b;_0x4dd6c0[_0x3e0a('0x44')]=intUtil[_0x3e0a('0x45')](_0x4dd6c0[_0x3e0a('0x44')]);_0x4dd6c0[_0x3e0a('0x3e')]=intUtil[_0x3e0a('0x45')](_0x4dd6c0[_0x3e0a('0x3e')]);if(_0x2c231c&&_0x2c231c['monitor_format']){logger[_0x3e0a('0x17')](_0x3e0a('0x46'),_0x3e0a('0x47'));_0x17d572['recordingURL']=util[_0x3e0a('0x28')](_0x3e0a('0x48'),_0x4dd6c0['serverUrl'],_0x17d572[_0x3e0a('0x49')],md5(_0x17d572[_0x3e0a('0x49')]));}else{_0x17d572[_0x3e0a('0x4a')]='';}return getConnection(_0x4dd6c0)[_0x3e0a('0x15')](function(_0x21a6f1){_0x308d8b=_0x21a6f1;return getUser(_0x4dd6c0,_0x4ef31a[_0x3e0a('0x4b')],_0x308d8b);})[_0x3e0a('0x15')](function(_0x1ba373){_0x29fc1e=_0x1ba373;return getEndUser(_0x4dd6c0,_0x1f3daf,_0x17d572[_0x3e0a('0x4c')],_0x17d572[_0x3e0a('0x4d')],_0x308d8b);})[_0x3e0a('0x15')](function(_0x1bef47){_0xc3d592=_0x1bef47;return getTicket(_0x4dd6c0,_0x29fc1e,_0xc3d592,_0x1f3daf,_0x17d572,_0x1f3daf[_0x3e0a('0x4e')],_0x308d8b,_0x3e0a('0x43'));})[_0x3e0a('0x15')](function(_0x2e13f9){_0x4955a1=_0x2e13f9;logger[_0x3e0a('0x17')](_0x3e0a('0x4f'),_0x4955a1['id']);logger[_0x3e0a('0x17')](_0x3e0a('0x50'),_0x4955a1['id'],_0x4ef31a[_0x3e0a('0x39')],_0x4dd6c0['type']);switch(_0x4dd6c0['type']){case _0x3e0a('0x51'):emit(util['format']('user:%s',_0x4ef31a['name']),_0x3e0a('0x52'),{'recordId':_0x4955a1['id']});break;case _0x3e0a('0x53'):emit(util[_0x3e0a('0x28')](_0x3e0a('0x54'),_0x4ef31a[_0x3e0a('0x39')]),'trigger:browser:url',{'uri':util[_0x3e0a('0x28')](_0x3e0a('0x55'),_0x308d8b[_0x3e0a('0x56')],_0x4955a1['id'])});break;default:logger[_0x3e0a('0x57')](_0x3e0a('0x58'));}})[_0x3e0a('0x59')](function(_0x10d2a5){logger[_0x3e0a('0x57')](_0x3e0a('0x46'),JSON['stringify'](_0x10d2a5));});};exports['outbound']=function(_0x3c9911,_0x399986,_0x16d2c3,_0x51be4e,_0xf5dab0,_0x5a22e5,_0x469779){var _0x4b0531,_0x2cae0f,_0x577542,_0x4cf2f7;_0x5a22e5[_0x3e0a('0x44')]=intUtil[_0x3e0a('0x45')](_0x5a22e5[_0x3e0a('0x44')]);_0x5a22e5[_0x3e0a('0x3e')]=intUtil[_0x3e0a('0x45')](_0x5a22e5['remoteUri']);if(_0x469779&&_0x469779[_0x3e0a('0x5a')]&&_0x469779[_0x3e0a('0x5a')]!=='none'){logger['info'](_0x3e0a('0x5b'),_0x3e0a('0x47'));_0x399986[_0x3e0a('0x4a')]=util[_0x3e0a('0x28')](_0x3e0a('0x48'),_0x5a22e5[_0x3e0a('0x44')],_0x399986[_0x3e0a('0x49')],md5(_0x399986['uniqueid']));}return getConnection(_0x5a22e5)[_0x3e0a('0x15')](function(_0x14528c){_0x4cf2f7=_0x14528c;return getUser(_0x5a22e5,_0x51be4e[_0x3e0a('0x4b')],_0x4cf2f7);})[_0x3e0a('0x15')](function(_0x131c9f){_0x4b0531=_0x131c9f;return getEndUser(_0x5a22e5,_0x16d2c3,_0x399986[_0x3e0a('0x5c')],_0x399986[_0x3e0a('0x5d')],_0x4cf2f7);})[_0x3e0a('0x15')](function(_0x5ce0e1){_0x2cae0f=_0x5ce0e1;return getTicket(_0x5a22e5,_0x4b0531,_0x2cae0f,_0x16d2c3,_0x399986,_0x16d2c3[_0x3e0a('0x4e')],_0x4cf2f7,_0x3e0a('0x5e'));})[_0x3e0a('0x15')](function(_0x4d4438){_0x577542=_0x4d4438;logger['info'](_0x3e0a('0x5f'),_0x577542['id']);logger['info']('[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x577542['id'],_0x51be4e[_0x3e0a('0x39')],_0x5a22e5[_0x3e0a('0x34')]);switch(_0x5a22e5[_0x3e0a('0x34')]){case _0x3e0a('0x51'):emit(util['format'](_0x3e0a('0x54'),_0x51be4e[_0x3e0a('0x39')]),_0x3e0a('0x52'),{'recordId':_0x577542['id']});break;case _0x3e0a('0x53'):emit(util['format'](_0x3e0a('0x54'),_0x51be4e[_0x3e0a('0x39')]),_0x3e0a('0x60'),{'uri':util[_0x3e0a('0x28')](_0x3e0a('0x55'),_0x4cf2f7[_0x3e0a('0x56')],_0x577542['id'])});break;default:logger[_0x3e0a('0x57')]('[OUTBOUND]',_0x3e0a('0x61'));}})[_0x3e0a('0x59')](function(_0x3bd22b){logger[_0x3e0a('0x57')](_0x3e0a('0x5b'),JSON['stringify'](_0x3bd22b));});};exports[_0x3e0a('0x62')]=function(_0x1d8c5d,_0x25d46a,_0x17c952,_0x45aaf3,_0xd82bcc,_0x26a81f){var _0x1b550b,_0x472e23,_0x28db10,_0x41dada;_0x26a81f[_0x3e0a('0x44')]=intUtil[_0x3e0a('0x45')](_0x26a81f['serverUrl']);_0x26a81f[_0x3e0a('0x3e')]=intUtil[_0x3e0a('0x45')](_0x26a81f['remoteUri']);if(_0xd82bcc&&_0xd82bcc[_0x3e0a('0x63')]){logger[_0x3e0a('0x17')](_0x3e0a('0x64'),_0x3e0a('0x47'));_0x25d46a[_0x3e0a('0x4a')]=util['format'](_0x3e0a('0x48'),_0x26a81f[_0x3e0a('0x44')],_0x25d46a[_0x3e0a('0x49')],md5(_0x25d46a[_0x3e0a('0x49')]));}else{_0x25d46a[_0x3e0a('0x4a')]='';}return getConnection(_0x26a81f)[_0x3e0a('0x15')](function(_0x3cfa73){_0x41dada=_0x3cfa73;if(!_[_0x3e0a('0xf')](_0x45aaf3)){return getUser(_0x26a81f,_0x45aaf3[_0x3e0a('0x39')],_0x41dada);}else{return getUser(_0x26a81f,null,_0x41dada);}})[_0x3e0a('0x15')](function(_0x5537d4){_0x1b550b=_0x5537d4;return getEndUser(_0x26a81f,_0x17c952,_0x25d46a['calleridname'],_0x25d46a['calleridnum'],_0x41dada);})['then'](function(_0xa81fd6){_0x472e23=_0xa81fd6;return getTicket(_0x26a81f,_0x1b550b,_0x472e23,_0x17c952,_0x25d46a,_0x17c952[_0x3e0a('0x4e')],_0x41dada);})[_0x3e0a('0x15')](function(_0x24f4ce){_0x28db10=_0x24f4ce;logger['info']('[ABANDONED]\x20Ticket\x20%s\x20created.',_0x28db10['id']);logger[_0x3e0a('0x17')](_0x3e0a('0x65'),_0x26a81f[_0x3e0a('0x34')]);})[_0x3e0a('0x59')](function(_0xe9fd30){logger[_0x3e0a('0x57')](_0x3e0a('0x64'),JSON[_0x3e0a('0x66')](_0xe9fd30));});}; \ No newline at end of file +var _0xb32b=['customVariable','Variable','name','toLowerCase','password','securityToken','https://login.salesforce.com','clientId','login','Connection\x20established.','queue','serverUrl','remoteUri','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','recordingURL','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','calleridname','calleridnum','Fields','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','[QUEUE]','stringify','outbound','recordingFormat','none','[OUTBOUND]','email','destcalleridname','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]','request-promise','moment','bluebird','md5','jsforce','util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','Task','assign','utc','getString','Subjects','Descriptions','WhoId','ticketType','Case','sobject','create','isNil','User','find','execute','then','length','Email','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','display_name','resolve','user_id','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.','moduleSearch','contact_lead','Contact','Lead','contact','lead','Phone','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','Company','No\x20Company','upperFirst','type','string','idField','content','variableName','toString'];(function(_0xac0f5e,_0x5303ea){var _0x5a1029=function(_0x78f527){while(--_0x78f527){_0xac0f5e['push'](_0xac0f5e['shift']());}};_0x5a1029(++_0x5303ea);}(_0xb32b,0x106));var _0xbb32=function(_0x419974,_0x48e04d){_0x419974=_0x419974-0x0;var _0x1aeb7e=_0xb32b[_0x419974];return _0x1aeb7e;};'use strict';var _=require('lodash');var rp=require(_0xbb32('0x0'));var moment=require(_0xbb32('0x1'));var BPromise=require(_0xbb32('0x2'));var md5=require(_0xbb32('0x3'));var jsforce=require(_0xbb32('0x4'));var util=require(_0xbb32('0x5'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xbb32('0x6'));var logger=require(_0xbb32('0x7'))(_0xbb32('0x8'));config[_0xbb32('0x9')]=_[_0xbb32('0xa')](config[_0xbb32('0x9')],{'host':_0xbb32('0xb'),'port':0x18eb});var io=require(_0xbb32('0xc'))(new Redis(config['redis']));function emit(_0x464f94,_0x2aea2e,_0x413a9d){io['to'](_0x464f94)[_0xbb32('0xd')](_0x2aea2e,_0x413a9d);}function getTicket(_0x312553,_0x168581,_0x5c7c33,_0x528785,_0x2150d6,_0xc0d812,_0x33065b,_0x18d801){var _0x527d75={};if(_0x528785['ticketType']===_0xbb32('0xe')){_0x527d75=Object[_0xbb32('0xf')]({},{'OwnerId':_0x168581['id'],'ActivityDate':moment[_0xbb32('0x10')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0xbb32('0x11')](_0x528785[_0xbb32('0x12')],_0x2150d6,'\x20'),'Description':intUtil[_0xbb32('0x11')](_0x528785[_0xbb32('0x13')],_0x2150d6,'\x0a')},getCustomFields(_0xc0d812,_0x2150d6));if(_0x5c7c33){_0x527d75[_0xbb32('0x14')]=_0x5c7c33['id'];}}else if(_0x528785[_0xbb32('0x15')]===_0xbb32('0x16')){_0x527d75=Object[_0xbb32('0xf')]({},{'OwnerId':_0x168581['id'],'Subject':intUtil[_0xbb32('0x11')](_0x528785[_0xbb32('0x12')],_0x2150d6,'\x20'),'Description':intUtil['getString'](_0x528785['Descriptions'],_0x2150d6,'\x0a')},getCustomFields(_0xc0d812,_0x2150d6));if(_0x5c7c33){_0x527d75['ContactId']=_0x5c7c33['id'];}}return _0x33065b[_0xbb32('0x17')](_0x528785[_0xbb32('0x15')])[_0xbb32('0x18')](_0x527d75);}function getUser(_0x5d5102,_0xc85147,_0x1f143a){if(!_[_0xbb32('0x19')](_0xc85147)&&intUtil['validateEmail'](_0xc85147)){var _0x4332f5={'Email':_0xc85147};var _0x55f662={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x1f143a[_0xbb32('0x17')](_0xbb32('0x1a'))[_0xbb32('0x1b')](_0x4332f5,_0x55f662)[_0xbb32('0x1c')]()[_0xbb32('0x1d')](function(_0xda76f7){if(_0xda76f7[_0xbb32('0x1e')]){var _0x1ea23c=_[_0xbb32('0x1b')](_0xda76f7,function(_0x185a4d){return _0x185a4d[_0xbb32('0x1f')]===_0xc85147;});if(_0x1ea23c){logger[_0xbb32('0x20')]('Agent\x20%s\x20found.',_0xc85147);return BPromise['resolve']({'id':_0x1ea23c['Id'],'name':_0x1ea23c['Name']});}}else{logger[_0xbb32('0x20')](_0xbb32('0x21'),_0xc85147);return _0x1f143a['identity']()['then'](function(_0x22eb07){return BPromise['resolve']({'id':_0x22eb07['user_id'],'name':_0x22eb07[_0xbb32('0x22')]});});}});}else{logger['info'](_0xbb32('0x21'),_0xc85147);return _0x1f143a['identity']()[_0xbb32('0x1d')](function(_0x1d8bab){return BPromise[_0xbb32('0x23')]({'id':_0x1d8bab[_0xbb32('0x24')],'name':_0x1d8bab[_0xbb32('0x22')]});});}}function getEndUser(_0x54c629,_0x5c8846,_0x27fe95,_0x49d528,_0x9cf1b1){var _0x21c1f5={'Phone':_0x49d528};var _0x1f1d77={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0xbb32('0x23')]()[_0xbb32('0x1d')](function(){if(_0x5c8846[_0xbb32('0x15')]==='Task'){logger[_0xbb32('0x20')](_0xbb32('0x25'),_0x49d528,_0x5c8846['moduleSearch']);switch(_0x5c8846[_0xbb32('0x26')]){case _0xbb32('0x27'):return _0x9cf1b1[_0xbb32('0x17')](_0xbb32('0x28'))[_0xbb32('0x1b')](_0x21c1f5,_0x1f1d77)[_0xbb32('0x1c')]()['then'](function(_0x414928){if(_0x414928&&_0x414928[_0xbb32('0x1e')]){return _0x414928;}else{return _0x9cf1b1[_0xbb32('0x17')](_0xbb32('0x29'))[_0xbb32('0x1b')](_0x21c1f5,_0x1f1d77);}});case _0xbb32('0x2a'):return _0x9cf1b1[_0xbb32('0x17')](_0xbb32('0x28'))[_0xbb32('0x1b')](_0x21c1f5,_0x1f1d77)[_0xbb32('0x1c')]();case _0xbb32('0x2b'):return _0x9cf1b1[_0xbb32('0x17')](_0xbb32('0x29'))[_0xbb32('0x1b')](_0x21c1f5,_0x1f1d77);default:return null;}}else if(_0x5c8846[_0xbb32('0x15')]==='Case'){logger[_0xbb32('0x20')](_0xbb32('0x25'),_0x49d528,_0xbb32('0x2a'));return _0x9cf1b1[_0xbb32('0x17')](_0xbb32('0x28'))[_0xbb32('0x1b')](_0x21c1f5,_0x1f1d77)['execute']();}})[_0xbb32('0x1d')](function(_0x5afa9c){if(_0x5afa9c&&_0x5afa9c['length']){var _0x5582f9=_[_0xbb32('0x1b')](_0x5afa9c,function(_0x106d63){return _0x106d63[_0xbb32('0x2c')]===_0x49d528;});if(_0x5582f9){return BPromise[_0xbb32('0x23')]({'id':_0x5582f9['Id'],'name':_0x5582f9['Name'],'phone':_0x5582f9[_0xbb32('0x2c')]});}}})['then'](function(_0x2a66fe){if(_0x2a66fe){logger[_0xbb32('0x20')]('Enduser\x20with\x20phone\x20%s\x20found.',_0x49d528);return BPromise['resolve'](_0x2a66fe);}else{logger[_0xbb32('0x20')](_0xbb32('0x2d'),_0x49d528);var _0x1d39b3={'LastName':_0x27fe95!==_0xbb32('0x2e')?_0x27fe95:util['format'](_0xbb32('0x2f'),_0x49d528),'Phone':_0x49d528};if(_0x5c8846[_0xbb32('0x30')]){if(_0x5c8846[_0xbb32('0x30')]===_0xbb32('0x2a')){logger[_0xbb32('0x20')](_0xbb32('0x31'),_0x49d528,_0x5c8846[_0xbb32('0x30')]);}else if(_0x5c8846[_0xbb32('0x30')]===_0xbb32('0x2b')&&_0x5c8846['ticketType']===_0xbb32('0xe')){logger['info'](_0xbb32('0x31'),_0x49d528,_0x5c8846[_0xbb32('0x30')]);_0x1d39b3[_0xbb32('0x32')]=_0xbb32('0x33');}else{return null;}}return _0x9cf1b1[_0xbb32('0x17')](_[_0xbb32('0x34')](_0x5c8846[_0xbb32('0x30')]))[_0xbb32('0x18')](_0x1d39b3);}});}function getCustomFields(_0x773059,_0x285600){var _0x5b8e31={};if(_0x773059[_0xbb32('0x1e')]>0x0){_['forEach'](_0x773059,function(_0x30d9c4){if(_0x30d9c4[_0xbb32('0x35')]===_0xbb32('0x36')&&_0x30d9c4['idField']){_0x5b8e31[_0x30d9c4[_0xbb32('0x37')]]=_0x30d9c4[_0xbb32('0x38')]['toString']();}else if(_0x30d9c4['type']==='variable'&&_0x30d9c4[_0xbb32('0x39')]&&_0x30d9c4[_0xbb32('0x37')]){_0x285600[_0x30d9c4[_0xbb32('0x39')]]&&(_0x5b8e31[_0x30d9c4[_0xbb32('0x37')]]=_0x285600[_0x30d9c4['variableName']][_0xbb32('0x3a')]());}else if(_0x30d9c4[_0xbb32('0x35')]===_0xbb32('0x3b')&&_0x30d9c4[_0xbb32('0x3c')]&&_0x30d9c4[_0xbb32('0x3c')][_0xbb32('0x3d')]&&_0x30d9c4[_0xbb32('0x37')]){_0x285600[_0x30d9c4[_0xbb32('0x3c')][_0xbb32('0x3d')][_0xbb32('0x3e')]()]&&(_0x5b8e31[_0x30d9c4[_0xbb32('0x37')]]=_0x285600[_0x30d9c4[_0xbb32('0x3c')]['name']['toLowerCase']()][_0xbb32('0x3a')]());}});}return _0x5b8e31;}function getConnection(_0x40e798){var _0x180b10=_0x40e798[_0xbb32('0x3f')]['concat'](_0x40e798[_0xbb32('0x40')]);var _0x24f52b=new jsforce['Connection']({'oauth2':{'loginUrl':_0x40e798['remoteUri']||_0xbb32('0x41'),'clientId':_0x40e798[_0xbb32('0x42')],'clientSecret':_0x40e798['clientSecret']}});return _0x24f52b[_0xbb32('0x43')](_0x40e798['username'],_0x180b10)[_0xbb32('0x1d')](function(){logger[_0xbb32('0x20')](_0xbb32('0x44'));return _0x24f52b;});}exports[_0xbb32('0x45')]=function(_0x30165c,_0x1a10b7,_0x50ee3e,_0x5d21d8,_0xe820cd,_0x51106b){var _0x4811c5,_0x2b7287,_0x3a9ca6,_0x4c9676;_0x51106b[_0xbb32('0x46')]=intUtil['stripTrailingSlash'](_0x51106b[_0xbb32('0x46')]);_0x51106b[_0xbb32('0x47')]=intUtil[_0xbb32('0x48')](_0x51106b[_0xbb32('0x47')]);if(_0xe820cd&&_0xe820cd[_0xbb32('0x49')]){logger[_0xbb32('0x20')]('[QUEUE]',_0xbb32('0x4a'));_0x1a10b7[_0xbb32('0x4b')]=util[_0xbb32('0x4c')](_0xbb32('0x4d'),_0x51106b['serverUrl'],_0x1a10b7[_0xbb32('0x4e')],md5(_0x1a10b7[_0xbb32('0x4e')]));}else{_0x1a10b7[_0xbb32('0x4b')]='';}return getConnection(_0x51106b)[_0xbb32('0x1d')](function(_0x430e76){_0x4c9676=_0x430e76;return getUser(_0x51106b,_0x5d21d8['email'],_0x4c9676);})[_0xbb32('0x1d')](function(_0x21f289){_0x4811c5=_0x21f289;return getEndUser(_0x51106b,_0x50ee3e,_0x1a10b7[_0xbb32('0x4f')],_0x1a10b7[_0xbb32('0x50')],_0x4c9676);})['then'](function(_0x20519a){_0x2b7287=_0x20519a;return getTicket(_0x51106b,_0x4811c5,_0x2b7287,_0x50ee3e,_0x1a10b7,_0x50ee3e[_0xbb32('0x51')],_0x4c9676,'queue');})[_0xbb32('0x1d')](function(_0x25f3ee){_0x3a9ca6=_0x25f3ee;logger['info'](_0xbb32('0x52'),_0x3a9ca6['id']);logger['info']('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x3a9ca6['id'],_0x5d21d8[_0xbb32('0x3d')],_0x51106b[_0xbb32('0x35')]);switch(_0x51106b['type']){case _0xbb32('0x53'):emit(util['format'](_0xbb32('0x54'),_0x5d21d8[_0xbb32('0x3d')]),_0xbb32('0x55'),{'recordId':_0x3a9ca6['id']});break;case _0xbb32('0x56'):emit(util[_0xbb32('0x4c')](_0xbb32('0x54'),_0x5d21d8[_0xbb32('0x3d')]),_0xbb32('0x57'),{'uri':util['format'](_0xbb32('0x58'),_0x4c9676['instanceUrl'],_0x3a9ca6['id'])});break;default:logger[_0xbb32('0x59')](_0xbb32('0x5a'));}})[_0xbb32('0x5b')](function(_0x4031be){logger['error'](_0xbb32('0x5c'),JSON[_0xbb32('0x5d')](_0x4031be));});};exports[_0xbb32('0x5e')]=function(_0x42b749,_0x375f52,_0x1a93af,_0x60cdae,_0x489b79,_0x513bbe,_0x2c0ff4){var _0x12d106,_0x389067,_0x1b479d,_0x5d9c0d;_0x513bbe[_0xbb32('0x46')]=intUtil['stripTrailingSlash'](_0x513bbe[_0xbb32('0x46')]);_0x513bbe[_0xbb32('0x47')]=intUtil[_0xbb32('0x48')](_0x513bbe[_0xbb32('0x47')]);if(_0x2c0ff4&&_0x2c0ff4['recordingFormat']&&_0x2c0ff4[_0xbb32('0x5f')]!==_0xbb32('0x60')){logger[_0xbb32('0x20')](_0xbb32('0x61'),'Recording\x20is\x20enabled!');_0x375f52[_0xbb32('0x4b')]=util[_0xbb32('0x4c')](_0xbb32('0x4d'),_0x513bbe[_0xbb32('0x46')],_0x375f52['uniqueid'],md5(_0x375f52[_0xbb32('0x4e')]));}return getConnection(_0x513bbe)['then'](function(_0x150409){_0x5d9c0d=_0x150409;return getUser(_0x513bbe,_0x60cdae[_0xbb32('0x62')],_0x5d9c0d);})['then'](function(_0x116e22){_0x12d106=_0x116e22;return getEndUser(_0x513bbe,_0x1a93af,_0x375f52[_0xbb32('0x63')],_0x375f52[_0xbb32('0x64')],_0x5d9c0d);})[_0xbb32('0x1d')](function(_0x12f936){_0x389067=_0x12f936;return getTicket(_0x513bbe,_0x12d106,_0x389067,_0x1a93af,_0x375f52,_0x1a93af[_0xbb32('0x51')],_0x5d9c0d,'outbound');})[_0xbb32('0x1d')](function(_0x31a40b){_0x1b479d=_0x31a40b;logger[_0xbb32('0x20')](_0xbb32('0x65'),_0x1b479d['id']);logger[_0xbb32('0x20')](_0xbb32('0x66'),_0x1b479d['id'],_0x60cdae[_0xbb32('0x3d')],_0x513bbe[_0xbb32('0x35')]);switch(_0x513bbe[_0xbb32('0x35')]){case _0xbb32('0x53'):emit(util[_0xbb32('0x4c')]('user:%s',_0x60cdae['name']),_0xbb32('0x55'),{'recordId':_0x1b479d['id']});break;case _0xbb32('0x56'):emit(util[_0xbb32('0x4c')](_0xbb32('0x54'),_0x60cdae['name']),_0xbb32('0x57'),{'uri':util['format'](_0xbb32('0x58'),_0x5d9c0d['instanceUrl'],_0x1b479d['id'])});break;default:logger['error'](_0xbb32('0x61'),_0xbb32('0x67'));}})['catch'](function(_0x254aac){logger[_0xbb32('0x59')](_0xbb32('0x61'),JSON[_0xbb32('0x5d')](_0x254aac));});};exports[_0xbb32('0x68')]=function(_0x1c0d49,_0x25b9fb,_0x1b5ca9,_0x310f50,_0x5c7eec,_0x37267f){var _0xf9046b,_0x3b4d30,_0x22f96d,_0x224c3d;_0x37267f[_0xbb32('0x46')]=intUtil[_0xbb32('0x48')](_0x37267f[_0xbb32('0x46')]);_0x37267f['remoteUri']=intUtil[_0xbb32('0x48')](_0x37267f[_0xbb32('0x47')]);if(_0x5c7eec&&_0x5c7eec['monitor_format']){logger[_0xbb32('0x20')]('[ABANDONED]',_0xbb32('0x4a'));_0x25b9fb[_0xbb32('0x4b')]=util[_0xbb32('0x4c')](_0xbb32('0x4d'),_0x37267f[_0xbb32('0x46')],_0x25b9fb[_0xbb32('0x4e')],md5(_0x25b9fb['uniqueid']));}else{_0x25b9fb[_0xbb32('0x4b')]='';}return getConnection(_0x37267f)[_0xbb32('0x1d')](function(_0x89eebe){_0x224c3d=_0x89eebe;if(!_[_0xbb32('0x19')](_0x310f50)){return getUser(_0x37267f,_0x310f50[_0xbb32('0x3d')],_0x224c3d);}else{return getUser(_0x37267f,null,_0x224c3d);}})[_0xbb32('0x1d')](function(_0x139b96){_0xf9046b=_0x139b96;return getEndUser(_0x37267f,_0x1b5ca9,_0x25b9fb[_0xbb32('0x4f')],_0x25b9fb[_0xbb32('0x50')],_0x224c3d);})[_0xbb32('0x1d')](function(_0x4ba49a){_0x3b4d30=_0x4ba49a;return getTicket(_0x37267f,_0xf9046b,_0x3b4d30,_0x1b5ca9,_0x25b9fb,_0x1b5ca9[_0xbb32('0x51')],_0x224c3d);})['then'](function(_0x347b0e){_0x22f96d=_0x347b0e;logger[_0xbb32('0x20')](_0xbb32('0x69'),_0x22f96d['id']);logger[_0xbb32('0x20')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x37267f[_0xbb32('0x35')]);})[_0xbb32('0x5b')](function(_0x53274f){logger[_0xbb32('0x59')](_0xbb32('0x6a'),JSON['stringify'](_0x53274f));});}; \ 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 fd3efe3..759b028 100644 --- a/server/services/ami/trigger/integration/servicenow.js +++ b/server/services/ami/trigger/integration/servicenow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x5c351c,_0x2046d8){var _0x26f3b3=function(_0x47ac18){while(--_0x47ac18){_0x5c351c['push'](_0x5c351c['shift']());}};_0x26f3b3(++_0x2046d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x4cf98e,_0xba4b79){var _0x1623ac=function(_0x459bc0){while(--_0x459bc0){_0x4cf98e['push'](_0x4cf98e['shift']());}};_0x1623ac(++_0xba4b79);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b561d,_0x422b7c){_0x5b561d=_0x5b561d-0x0;var _0x431060=_0xa9e0[_0x5b561d];return _0x431060;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/integration/sugarcrm.js b/server/services/ami/trigger/integration/sugarcrm.js index b86313a..5d64ea6 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 _0xe609=['parent_id','parent_type','Contacts','parent_name','direction','length','forEach','push','variableName','JSON','stringify','Calls','format','apiKey','toString','base64','get_server_info','isNil','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','contacts.phone_home\x20=\x20\x22%s\x22','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','[HTTP]','map','string','nameField','customField','content','type','idField','custom_fields','customVariable','Variable','toLowerCase','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','queue','stripTrailingSlash','remoteUri','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','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','catch','error','outbound','serverUrl','uri','%s/service/v4_1/rest.php','recordingFormat','none','destcalleridname','destcalleridnum','Outbound','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','abandoned','[ABANDONED]','calleridnum','Ticket\x20created!','lodash','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','defaults','redis','localhost','socket.io-emitter','POST','emit','info','Creating\x20new\x20ticket...','name','getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','replace','duration_hours','duration_minutes'];(function(_0x13a8f6,_0x492b09){var _0x6ea0b9=function(_0x447887){while(--_0x447887){_0x13a8f6['push'](_0x13a8f6['shift']());}};_0x6ea0b9(++_0x492b09);}(_0xe609,0x1dd));var _0x9e60=function(_0x5d942e,_0x15a6f0){_0x5d942e=_0x5d942e-0x0;var _0x1549f9=_0xe609[_0x5d942e];return _0x1549f9;};'use strict';var _=require(_0x9e60('0x0'));var rp=require(_0x9e60('0x1'));var BPromise=require(_0x9e60('0x2'));var md5=require(_0x9e60('0x3'));var util=require(_0x9e60('0x4'));var Redis=require(_0x9e60('0x5'));var intUtil=require(_0x9e60('0x6'));var config=require(_0x9e60('0x7'));var logger=require('../../../../config/logger')('sugarcrm');config['redis']=_[_0x9e60('0x8')](config[_0x9e60('0x9')],{'host':_0x9e60('0xa'),'port':0x18eb});var io=require(_0x9e60('0xb'))(new Redis(config[_0x9e60('0x9')]));var def={'method':_0x9e60('0xc'),'json':!![]};function emit(_0x3860b4,_0x123df7,_0x9f9b56){io['to'](_0x3860b4)[_0x9e60('0xd')](_0x123df7,_0x9f9b56);}function getTicket(_0x313cb3,_0xdb4a0d,_0x1a88a8,_0x308476,_0xa94bd5,_0x53b9c1,_0x15f1d9,_0x11b6d3){logger[_0x9e60('0xe')](_0x9e60('0xf'));var _0x7a1017=new Date();var _0xb64efa=[{'name':_0x9e60('0x10'),'value':intUtil[_0x9e60('0x11')](_0x308476[_0x9e60('0x12')],_0xa94bd5,'\x20')},{'name':_0x9e60('0x13'),'value':_0xdb4a0d['id']},{'name':_0x9e60('0x14'),'value':_0xdb4a0d['id']},{'name':'description','value':intUtil[_0x9e60('0x11')](_0x308476[_0x9e60('0x15')],_0xa94bd5,'\x0a')},{'name':_0x9e60('0x16'),'value':_0x7a1017[_0x9e60('0x17')]()['slice'](0x0,0x13)[_0x9e60('0x18')]('T','\x20')},{'name':_0x9e60('0x19'),'value':'0'},{'name':_0x9e60('0x1a'),'value':'15'},{'name':_0x9e60('0x1b'),'value':_0x1a88a8['id']},{'name':_0x9e60('0x1c'),'value':_0x9e60('0x1d')},{'name':_0x9e60('0x1e'),'value':_0x1a88a8[_0x9e60('0x10')]},{'name':_0x9e60('0x1f'),'value':_0x11b6d3}];if(_0x53b9c1[_0x9e60('0x20')]){_[_0x9e60('0x21')](_0x53b9c1,function(_0x5de38d){if(_0xa94bd5[_0x5de38d['variableName']]){_0xb64efa[_0x9e60('0x22')]({'name':_0x5de38d['idField'],'value':_0xa94bd5[_0x5de38d[_0x9e60('0x23')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'session':_0x15f1d9['id'],'module_name':_0x9e60('0x26'),'name_value_list':_0xb64efa})}});}function getAuth(_0x8cc2aa){return util[_0x9e60('0x27')]('Basic\x20%s',new Buffer(_0x8cc2aa[_0x9e60('0x28')]+':X')[_0x9e60('0x29')](_0x9e60('0x2a')));}function getServerInfo(_0x425656){return request({'form':{'method':_0x9e60('0x2b'),'input_type':'JSON','response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'session':_0x425656['id']})}});}function getUser(_0x41c68d,_0x5c6346,_0x15ca55){if(!_[_0x9e60('0x2c')](_0x5c6346)){logger[_0x9e60('0xe')](_0x9e60('0x2d'),_0x5c6346);return request({'form':{'method':_0x9e60('0x2e'),'input_type':'JSON','response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'session':_0x15ca55['id'],'module_name':'Employees','query':util[_0x9e60('0x27')](_0x9e60('0x2f'),_0x5c6346),'order_by':'','offset':'0','select_fields':['id',_0x9e60('0x10'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x9e60('0x30')](function(_0x1676d4){if(_0x1676d4[_0x9e60('0x31')][_0x9e60('0x20')]){var _0x3645a8=_['find'](_0x1676d4[_0x9e60('0x31')],function(_0x27c7c4){return _0x27c7c4[_0x9e60('0x32')][_0x9e60('0x33')][_0x9e60('0x34')]===_0x5c6346;});if(_0x3645a8){logger['info'](_0x9e60('0x35'));return BPromise[_0x9e60('0x36')]({'id':_0x3645a8[_0x9e60('0x32')]['id']['value'],'name':_0x3645a8[_0x9e60('0x32')][_0x9e60('0x10')]['value']});}}logger[_0x9e60('0xe')](_0x9e60('0x37'));return BPromise[_0x9e60('0x36')]({'id':_0x15ca55[_0x9e60('0x32')][_0x9e60('0x38')][_0x9e60('0x34')],'name':_0x15ca55['name_value_list']['user_name'][_0x9e60('0x34')]});});}else{logger[_0x9e60('0xe')](_0x9e60('0x39'));return BPromise['resolve']({'id':_0x15ca55['name_value_list']['user_id'][_0x9e60('0x34')],'name':_0x15ca55[_0x9e60('0x32')][_0x9e60('0x33')]['value']});}}function getEndUser(_0x3a83bc,_0x399598,_0x4bbb71,_0x35714d){logger['info']('Searching\x20enduser\x20with\x20phone',_0x4bbb71);return request({'form':{'method':_0x9e60('0x2e'),'input_type':_0x9e60('0x24'),'response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'session':_0x35714d['id'],'module_name':_0x9e60('0x1d'),'query':util['format'](_0x9e60('0x3a'),_0x4bbb71),'order_by':'','offset':'0','select_fields':['id',_0x9e60('0x10'),_0x9e60('0x3b')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x4ebba6){if(_0x4ebba6['entry_list']['length']){var _0x496323=_[_0x9e60('0x3c')](_0x4ebba6['entry_list'],function(_0x287e07){return _0x287e07[_0x9e60('0x32')][_0x9e60('0x3b')][_0x9e60('0x34')]===_0x4bbb71;});if(_0x496323){logger[_0x9e60('0xe')](_0x9e60('0x3d'));return BPromise[_0x9e60('0x36')]({'id':_0x496323[_0x9e60('0x32')]['id'][_0x9e60('0x34')],'name':_0x496323[_0x9e60('0x32')][_0x9e60('0x10')][_0x9e60('0x34')],'phone':_0x496323[_0x9e60('0x32')][_0x9e60('0x3b')][_0x9e60('0x34')]});}}else{logger['info'](_0x9e60('0x3e'));return request({'form':{'method':_0x9e60('0x3f'),'input_type':'JSON','response_type':'JSON','rest_data':JSON['stringify']({'session':_0x35714d['id'],'module_name':_0x9e60('0x1d'),'name_value_list':[{'name':_0x9e60('0x40'),'value':_0x399598!==_0x9e60('0x41')?_0x399598:util[_0x9e60('0x27')](_0x9e60('0x42'),_0x4bbb71)},{'name':_0x9e60('0x3b'),'value':_0x4bbb71}]})}})['then'](function(_0x179990){logger[_0x9e60('0xe')](_0x9e60('0x43'));return BPromise[_0x9e60('0x36')]({'id':_0x179990['id'],'name':_0x179990[_0x9e60('0x31')][_0x9e60('0x40')][_0x9e60('0x34')],'phone':_0x179990[_0x9e60('0x31')]['phone_home'][_0x9e60('0x34')]});});}});}function request(_0x27a794){logger[_0x9e60('0x44')](_0x9e60('0x45'),JSON[_0x9e60('0x25')](_0x27a794));return rp(_['merge'](def,_0x27a794));}function getTags(_0x202cb4,_0x150b4a){var _0x501c0a=[];if(_0x202cb4&&_0x202cb4[_0x9e60('0x20')]>0x0){_0x501c0a=_[_0x9e60('0x46')](_0x202cb4,_0x150b4a);}return _0x501c0a;}function getCustomFields(_0x2e93d5,_0x301b51){var _0x1e448c=[];var _0x132c9a={'custom_fields':[]};if(_0x2e93d5[_0x9e60('0x20')]>0x0){_[_0x9e60('0x21')](_0x2e93d5,function(_0x5f31e5){if(_0x5f31e5['type']===_0x9e60('0x47')&&_0x5f31e5[_0x9e60('0x48')]&&!_0x5f31e5[_0x9e60('0x49')]){_0x132c9a[_0x5f31e5[_0x9e60('0x48')]['toLowerCase']()]=_0x5f31e5[_0x9e60('0x4a')]['toString']();}else if(_0x5f31e5[_0x9e60('0x4b')]===_0x9e60('0x47')&&_0x5f31e5[_0x9e60('0x4c')]&&_0x5f31e5[_0x9e60('0x49')]){_0x132c9a[_0x9e60('0x4d')]['push']({'id':_0x5f31e5['idField'],'value':_0x5f31e5[_0x9e60('0x4a')][_0x9e60('0x29')]()});}else if(_0x5f31e5[_0x9e60('0x4b')]==='variable'&&_0x5f31e5[_0x9e60('0x23')]&&_0x5f31e5[_0x9e60('0x4c')]&&_0x5f31e5[_0x9e60('0x49')]){_0x301b51[_0x5f31e5[_0x9e60('0x23')]]&&_0x132c9a[_0x9e60('0x4d')][_0x9e60('0x22')]({'id':_0x5f31e5[_0x9e60('0x4c')],'value':_0x301b51[_0x5f31e5[_0x9e60('0x23')]][_0x9e60('0x29')]()});}else if(_0x5f31e5[_0x9e60('0x4b')]===_0x9e60('0x4e')&&_0x5f31e5[_0x9e60('0x4f')]&&_0x5f31e5[_0x9e60('0x4f')]['name']&&_0x5f31e5[_0x9e60('0x4c')]&&_0x5f31e5[_0x9e60('0x49')]){_0x301b51[_0x5f31e5[_0x9e60('0x4f')][_0x9e60('0x10')][_0x9e60('0x50')]()]&&_0x132c9a[_0x9e60('0x4d')][_0x9e60('0x22')]({'id':_0x5f31e5[_0x9e60('0x4c')],'value':_0x301b51[_0x5f31e5['Variable']['name']['toLowerCase']()]['toString']()});}});}return _0x132c9a;}function getConnection(_0x1880fb){return request({'method':_0x9e60('0xc'),'form':{'method':'login','input_type':_0x9e60('0x24'),'response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'user_auth':{'user_name':_0x1880fb[_0x9e60('0x51')],'password':_0x1880fb[_0x9e60('0x52')],'encryption':_0x9e60('0x53')},'application':_0x9e60('0x54')})}})[_0x9e60('0x30')](function(_0x25c505){var _0x29ec74=_0x25c505;if(_0x29ec74['id']){def[_0x9e60('0x55')]=_0x29ec74['id'];return BPromise[_0x9e60('0x36')](_0x29ec74);}else{throw new Error(util[_0x9e60('0x27')]('Account\x20%d\x20is\x20not\x20valid',_0x1880fb['id']));}});}function setRelationship(_0x15bf09,_0x374e14,_0x128a3a,_0x15f5f7){return request({'form':{'method':_0x9e60('0x56'),'input_type':_0x9e60('0x24'),'response_type':_0x9e60('0x24'),'rest_data':JSON[_0x9e60('0x25')]({'session':_0x15bf09['id'],'module_name':_0x9e60('0x26'),'module_id':_0x128a3a['id'],'link_field_name':_0x15f5f7,'related_ids':[_0x374e14['id']]})}});}exports[_0x9e60('0x57')]=function(_0x767a54,_0x1779c4,_0x3e5812,_0x308284,_0x4531ea,_0xa600c3){var _0x3fee6d,_0x2627f0,_0x9cf1fb,_0x22c808;_0xa600c3['remoteUri']=intUtil[_0x9e60('0x58')](_0xa600c3[_0x9e60('0x59')]);_0xa600c3['serverUrl']=intUtil['stripTrailingSlash'](_0xa600c3['serverUrl']);def['uri']=util[_0x9e60('0x27')]('%s/service/v4_1/rest.php',_0xa600c3[_0x9e60('0x59')]);if(_0x4531ea&&_0x4531ea[_0x9e60('0x5a')]){logger[_0x9e60('0xe')](_0x9e60('0x5b'),_0x9e60('0x5c'));_0x1779c4[_0x9e60('0x5d')]=util[_0x9e60('0x27')](_0x9e60('0x5e'),_0xa600c3['serverUrl'],_0x1779c4[_0x9e60('0x5f')],md5(_0x1779c4[_0x9e60('0x5f')]));}else{_0x1779c4[_0x9e60('0x5d')]='';}return getConnection(_0xa600c3)[_0x9e60('0x30')](function(_0x52aeac){_0x22c808=_0x52aeac;return getUser(_0xa600c3,_0x308284[_0x9e60('0x10')],_0x22c808);})[_0x9e60('0x30')](function(_0x413b4c){_0x3fee6d=_0x413b4c;logger[_0x9e60('0xe')](_0x9e60('0x60'),_0x3fee6d['id']);return getEndUser(_0xa600c3,_0x1779c4[_0x9e60('0x61')],_0x1779c4['calleridnum'],_0x22c808);})[_0x9e60('0x30')](function(_0x1e3a7f){_0x2627f0=_0x1e3a7f;logger['info'](_0x9e60('0x62'),_0x2627f0['id']);return getTicket(_0xa600c3,_0x3fee6d,_0x2627f0,_0x3e5812,_0x1779c4,_0x3e5812[_0x9e60('0x63')],_0x22c808,_0x9e60('0x64'));})['then'](function(_0x43274a){_0x9cf1fb=_0x43274a;logger[_0x9e60('0xe')]('Ticket\x20created!');logger[_0x9e60('0xe')]('The\x20Ticket\x20ID\x20is:',_0x9cf1fb['id']);return setRelationship(_0x22c808,_0x3fee6d,_0x9cf1fb,_0x9e60('0x65'));})[_0x9e60('0x30')](function(){return setRelationship(_0x22c808,_0x2627f0,_0x9cf1fb,_0x9e60('0x66'));})[_0x9e60('0x30')](function(){return getServerInfo(_0x22c808);})['then'](function(_0x495d33){var _0x7670bf=parseInt(_0x495d33[_0x9e60('0x67')][_0x9e60('0x68')](0x0));var _0x72ba54=util[_0x9e60('0x27')](_0x9e60('0x69'),_0xa600c3[_0x9e60('0x59')],_0x9cf1fb['id']);if(_0x7670bf>0x6){_0x72ba54=util[_0x9e60('0x27')](_0x9e60('0x6a'),_0xa600c3[_0x9e60('0x59')],_0x9cf1fb['id']);}logger['info']('[QUEUE]',_0x9e60('0x6b'));emit(util['format'](_0x9e60('0x6c'),_0x308284[_0x9e60('0x10')]),'trigger:browser:url',{'uri':_0x72ba54});})[_0x9e60('0x6d')](function(_0x21d108){logger[_0x9e60('0x6e')](_0x9e60('0x5b'),JSON[_0x9e60('0x25')](_0x21d108));});};exports[_0x9e60('0x6f')]=function(_0x470ea6,_0x2297a1,_0x36bf5e,_0x2524cd,_0x4f037b,_0x5a7b96,_0x43a18b){var _0x169052,_0xe7fffd,_0x319927,_0x44e597;_0x5a7b96['remoteUri']=intUtil[_0x9e60('0x58')](_0x5a7b96[_0x9e60('0x59')]);_0x5a7b96[_0x9e60('0x70')]=intUtil[_0x9e60('0x58')](_0x5a7b96[_0x9e60('0x70')]);def[_0x9e60('0x71')]=util['format'](_0x9e60('0x72'),_0x5a7b96[_0x9e60('0x59')]);if(_0x43a18b&&_0x43a18b[_0x9e60('0x73')]&&_0x43a18b[_0x9e60('0x73')]!==_0x9e60('0x74')){logger['info']('[OUTBOUND]',_0x9e60('0x5c'));_0x2297a1[_0x9e60('0x5d')]=util[_0x9e60('0x27')](_0x9e60('0x5e'),_0x5a7b96[_0x9e60('0x70')],_0x2297a1[_0x9e60('0x5f')],md5(_0x2297a1[_0x9e60('0x5f')]));}return getConnection(_0x5a7b96)[_0x9e60('0x30')](function(_0x98f0c7){_0x44e597=_0x98f0c7;return getUser(_0x5a7b96,_0x2524cd[_0x9e60('0x10')],_0x44e597);})[_0x9e60('0x30')](function(_0x500474){_0x169052=_0x500474;logger['info']('The\x20User\x20ID\x20is:',_0x169052['id']);return getEndUser(_0x5a7b96,_0x2297a1[_0x9e60('0x75')],_0x2297a1[_0x9e60('0x76')],_0x44e597);})[_0x9e60('0x30')](function(_0x262e36){_0xe7fffd=_0x262e36;logger[_0x9e60('0xe')]('The\x20Enduser\x20ID\x20is:',_0xe7fffd['id']);return getTicket(_0x5a7b96,_0x169052,_0xe7fffd,_0x36bf5e,_0x2297a1,_0x36bf5e[_0x9e60('0x63')],_0x44e597,_0x9e60('0x77'));})[_0x9e60('0x30')](function(_0x5aa71f){_0x319927=_0x5aa71f;logger[_0x9e60('0xe')]('Ticket\x20created!');logger[_0x9e60('0xe')](_0x9e60('0x78'),_0x319927['id']);return setRelationship(_0x44e597,_0x169052,_0x319927,_0x9e60('0x65'));})[_0x9e60('0x30')](function(){return setRelationship(_0x44e597,_0xe7fffd,_0x319927,_0x9e60('0x66'));})[_0x9e60('0x30')](function(){return getServerInfo(_0x44e597);})[_0x9e60('0x30')](function(_0x56a5b3){var _0x26ff54=parseInt(_0x56a5b3[_0x9e60('0x67')][_0x9e60('0x68')](0x0));var _0x4bea3e=util[_0x9e60('0x27')](_0x9e60('0x69'),_0x5a7b96[_0x9e60('0x59')],_0x319927['id']);if(_0x26ff54>0x6){_0x4bea3e=util[_0x9e60('0x27')](_0x9e60('0x6a'),_0x5a7b96[_0x9e60('0x59')],_0x319927['id']);}logger[_0x9e60('0xe')](_0x9e60('0x79'),_0x9e60('0x6b'));emit(util[_0x9e60('0x27')](_0x9e60('0x6c'),_0x2524cd[_0x9e60('0x10')]),'trigger:browser:url',{'uri':_0x4bea3e});})[_0x9e60('0x6d')](function(_0x3f4312){logger['error'](_0x9e60('0x79'),JSON[_0x9e60('0x25')](_0x3f4312));});};exports[_0x9e60('0x7a')]=function(_0xa8a6e9,_0x1335c3,_0x10df14,_0x40a63a,_0x24e04f,_0x5fa2ee){var _0x4c3c9c,_0x303f55,_0x40f8aa,_0x3a8604;_0x5fa2ee[_0x9e60('0x59')]=intUtil[_0x9e60('0x58')](_0x5fa2ee[_0x9e60('0x59')]);_0x5fa2ee[_0x9e60('0x70')]=intUtil[_0x9e60('0x58')](_0x5fa2ee[_0x9e60('0x70')]);def['uri']=util['format'](_0x9e60('0x72'),_0x5fa2ee[_0x9e60('0x59')]);if(_0x24e04f&&_0x24e04f[_0x9e60('0x5a')]){logger[_0x9e60('0xe')](_0x9e60('0x7b'),_0x9e60('0x5c'));_0x1335c3['recordingURL']=util[_0x9e60('0x27')](_0x9e60('0x5e'),_0x5fa2ee[_0x9e60('0x70')],_0x1335c3[_0x9e60('0x5f')],md5(_0x1335c3['uniqueid']));}else{_0x1335c3['recordingURL']='';}return getConnection(_0x5fa2ee)[_0x9e60('0x30')](function(_0x8b82b7){_0x3a8604=_0x8b82b7;if(!_[_0x9e60('0x2c')](_0x40a63a)){return getUser(_0x5fa2ee,_0x40a63a[_0x9e60('0x10')],_0x3a8604);}else{return getUser(_0x5fa2ee,null,_0x3a8604);}})['then'](function(_0x38d8c1){_0x4c3c9c=_0x38d8c1;logger[_0x9e60('0xe')](_0x9e60('0x60'),_0x4c3c9c['id']);return getEndUser(_0x5fa2ee,_0x1335c3[_0x9e60('0x61')],_0x1335c3[_0x9e60('0x7c')],_0x3a8604);})[_0x9e60('0x30')](function(_0x2ac142){_0x303f55=_0x2ac142;logger['info'](_0x9e60('0x62'),_0x303f55['id']);return getTicket(_0x5fa2ee,_0x4c3c9c,_0x303f55,_0x10df14,_0x1335c3,_0x10df14[_0x9e60('0x63')],_0x3a8604,_0x9e60('0x64'));})[_0x9e60('0x30')](function(_0x407024){_0x40f8aa=_0x407024;logger[_0x9e60('0xe')](_0x9e60('0x7d'));logger['info'](_0x9e60('0x78'),_0x40f8aa['id']);return setRelationship(_0x3a8604,_0x4c3c9c,_0x40f8aa,_0x9e60('0x65'));})[_0x9e60('0x30')](function(){return setRelationship(_0x3a8604,_0x303f55,_0x40f8aa,_0x9e60('0x66'));})['then'](function(){return getServerInfo(_0x3a8604);})[_0x9e60('0x6d')](function(_0x29968e){logger[_0x9e60('0x6e')](_0x9e60('0x7b'),JSON[_0x9e60('0x25')](_0x29968e));});}; \ No newline at end of file +var _0x9018=['getString','Subjects','assigned_user_id','created_by','Descriptions','date_start','toISOString','slice','replace','duration_hours','parent_id','parent_type','forEach','push','idField','JSON','Basic\x20%s','toString','stringify','Getting\x20agent\x20with\x20name','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','entry_list','length','find','name_value_list','Agent\x20found!','value','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','resolve','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','user_name','Contacts','contacts.phone_home\x20=\x20\x22%s\x22','then','Enduser\x20found!','phone_home','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','format','Caller\x20-\x20%s','Enduser\x20created.','[HTTP]','type','customField','nameField','toLowerCase','content','string','custom_fields','variable','variableName','customVariable','Variable','POST','login','username','PLAIN','xCALLY\x20Motion\x20integration','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','serverUrl','stripTrailingSlash','uri','%s/service/v4_1/rest.php','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','users','contacts','version','%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','[QUEUE]','outbound','none','[OUTBOUND]','destcalleridname','charAt','error','abandoned','[ABANDONED]','lodash','request-promise','bluebird','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','localhost','socket.io-emitter','emit','info','Creating\x20new\x20ticket...','name'];(function(_0x3e4dee,_0x13c007){var _0xc76b69=function(_0x5afd02){while(--_0x5afd02){_0x3e4dee['push'](_0x3e4dee['shift']());}};_0xc76b69(++_0x13c007);}(_0x9018,0x65));var _0x8901=function(_0x2d7039,_0x270c15){_0x2d7039=_0x2d7039-0x0;var _0x415738=_0x9018[_0x2d7039];return _0x415738;};'use strict';var _=require(_0x8901('0x0'));var rp=require(_0x8901('0x1'));var BPromise=require(_0x8901('0x2'));var md5=require('md5');var util=require(_0x8901('0x3'));var Redis=require('ioredis');var intUtil=require(_0x8901('0x4'));var config=require(_0x8901('0x5'));var logger=require(_0x8901('0x6'))(_0x8901('0x7'));config[_0x8901('0x8')]=_[_0x8901('0x9')](config[_0x8901('0x8')],{'host':_0x8901('0xa'),'port':0x18eb});var io=require(_0x8901('0xb'))(new Redis(config[_0x8901('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x45073d,_0x10c8f8,_0x2da1ec){io['to'](_0x45073d)[_0x8901('0xc')](_0x10c8f8,_0x2da1ec);}function getTicket(_0x51054d,_0x5eb38b,_0x45d9da,_0x20f2b8,_0x43bc13,_0x4ac732,_0x16e750,_0x5e3d4e){logger[_0x8901('0xd')](_0x8901('0xe'));var _0x49ac77=new Date();var _0x1b6f56=[{'name':_0x8901('0xf'),'value':intUtil[_0x8901('0x10')](_0x20f2b8[_0x8901('0x11')],_0x43bc13,'\x20')},{'name':_0x8901('0x12'),'value':_0x5eb38b['id']},{'name':_0x8901('0x13'),'value':_0x5eb38b['id']},{'name':'description','value':intUtil[_0x8901('0x10')](_0x20f2b8[_0x8901('0x14')],_0x43bc13,'\x0a')},{'name':_0x8901('0x15'),'value':_0x49ac77[_0x8901('0x16')]()[_0x8901('0x17')](0x0,0x13)[_0x8901('0x18')]('T','\x20')},{'name':_0x8901('0x19'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':_0x8901('0x1a'),'value':_0x45d9da['id']},{'name':_0x8901('0x1b'),'value':'Contacts'},{'name':'parent_name','value':_0x45d9da['name']},{'name':'direction','value':_0x5e3d4e}];if(_0x4ac732['length']){_[_0x8901('0x1c')](_0x4ac732,function(_0x322e3c){if(_0x43bc13[_0x322e3c['variableName']]){_0x1b6f56[_0x8901('0x1d')]({'name':_0x322e3c[_0x8901('0x1e')],'value':_0x43bc13[_0x322e3c['variableName']]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0x8901('0x1f'),'rest_data':JSON['stringify']({'session':_0x16e750['id'],'module_name':'Calls','name_value_list':_0x1b6f56})}});}function getAuth(_0x52dfc2){return util['format'](_0x8901('0x20'),new Buffer(_0x52dfc2['apiKey']+':X')[_0x8901('0x21')]('base64'));}function getServerInfo(_0x2dc4ae){return request({'form':{'method':'get_server_info','input_type':_0x8901('0x1f'),'response_type':_0x8901('0x1f'),'rest_data':JSON[_0x8901('0x22')]({'session':_0x2dc4ae['id']})}});}function getUser(_0x45d82f,_0x3daba8,_0x565dc1){if(!_['isNil'](_0x3daba8)){logger[_0x8901('0xd')](_0x8901('0x23'),_0x3daba8);return request({'form':{'method':_0x8901('0x24'),'input_type':_0x8901('0x1f'),'response_type':_0x8901('0x1f'),'rest_data':JSON[_0x8901('0x22')]({'session':_0x565dc1['id'],'module_name':_0x8901('0x25'),'query':util['format'](_0x8901('0x26'),_0x3daba8),'order_by':'','offset':'0','select_fields':['id',_0x8901('0xf'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x43517e){if(_0x43517e[_0x8901('0x27')][_0x8901('0x28')]){var _0x34b564=_[_0x8901('0x29')](_0x43517e['entry_list'],function(_0x517819){return _0x517819[_0x8901('0x2a')]['user_name']['value']===_0x3daba8;});if(_0x34b564){logger[_0x8901('0xd')](_0x8901('0x2b'));return BPromise['resolve']({'id':_0x34b564[_0x8901('0x2a')]['id'][_0x8901('0x2c')],'name':_0x34b564[_0x8901('0x2a')][_0x8901('0xf')][_0x8901('0x2c')]});}}logger[_0x8901('0xd')](_0x8901('0x2d'));return BPromise[_0x8901('0x2e')]({'id':_0x565dc1[_0x8901('0x2a')][_0x8901('0x2f')][_0x8901('0x2c')],'name':_0x565dc1[_0x8901('0x2a')]['user_name'][_0x8901('0x2c')]});});}else{logger[_0x8901('0xd')](_0x8901('0x30'));return BPromise[_0x8901('0x2e')]({'id':_0x565dc1['name_value_list'][_0x8901('0x2f')][_0x8901('0x2c')],'name':_0x565dc1[_0x8901('0x2a')][_0x8901('0x31')]['value']});}}function getEndUser(_0x745207,_0x1eabf2,_0xbfff64,_0x1b8d29){logger[_0x8901('0xd')]('Searching\x20enduser\x20with\x20phone',_0xbfff64);return request({'form':{'method':'get_entry_list','input_type':_0x8901('0x1f'),'response_type':_0x8901('0x1f'),'rest_data':JSON[_0x8901('0x22')]({'session':_0x1b8d29['id'],'module_name':_0x8901('0x32'),'query':util['format'](_0x8901('0x33'),_0xbfff64),'order_by':'','offset':'0','select_fields':['id',_0x8901('0xf'),'phone_home'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0x8901('0x34')](function(_0x412f9a){if(_0x412f9a[_0x8901('0x27')][_0x8901('0x28')]){var _0x4bb086=_['find'](_0x412f9a['entry_list'],function(_0x3cb703){return _0x3cb703[_0x8901('0x2a')]['phone_home']['value']===_0xbfff64;});if(_0x4bb086){logger[_0x8901('0xd')](_0x8901('0x35'));return BPromise['resolve']({'id':_0x4bb086[_0x8901('0x2a')]['id'][_0x8901('0x2c')],'name':_0x4bb086['name_value_list'][_0x8901('0xf')][_0x8901('0x2c')],'phone':_0x4bb086[_0x8901('0x2a')][_0x8901('0x36')]['value']});}}else{logger[_0x8901('0xd')](_0x8901('0x37'));return request({'form':{'method':'set_entry','input_type':'JSON','response_type':'JSON','rest_data':JSON[_0x8901('0x22')]({'session':_0x1b8d29['id'],'module_name':'Contacts','name_value_list':[{'name':_0x8901('0x38'),'value':_0x1eabf2!==''?_0x1eabf2:util[_0x8901('0x39')](_0x8901('0x3a'),_0xbfff64)},{'name':_0x8901('0x36'),'value':_0xbfff64}]})}})['then'](function(_0xc426dc){logger['info'](_0x8901('0x3b'));return BPromise[_0x8901('0x2e')]({'id':_0xc426dc['id'],'name':_0xc426dc['entry_list'][_0x8901('0x38')][_0x8901('0x2c')],'phone':_0xc426dc['entry_list']['phone_home'][_0x8901('0x2c')]});});}});}function request(_0x4bc570){logger['debug'](_0x8901('0x3c'),JSON[_0x8901('0x22')](_0x4bc570));return rp(_['merge'](def,_0x4bc570));}function getTags(_0x27374b,_0x257831){var _0x31a311=[];if(_0x27374b&&_0x27374b[_0x8901('0x28')]>0x0){_0x31a311=_['map'](_0x27374b,_0x257831);}return _0x31a311;}function getCustomFields(_0x4eea11,_0x27a598){var _0x1a2fca=[];var _0x459716={'custom_fields':[]};if(_0x4eea11[_0x8901('0x28')]>0x0){_[_0x8901('0x1c')](_0x4eea11,function(_0x4a0b0c){if(_0x4a0b0c[_0x8901('0x3d')]==='string'&&_0x4a0b0c['nameField']&&!_0x4a0b0c[_0x8901('0x3e')]){_0x459716[_0x4a0b0c[_0x8901('0x3f')][_0x8901('0x40')]()]=_0x4a0b0c[_0x8901('0x41')][_0x8901('0x21')]();}else if(_0x4a0b0c[_0x8901('0x3d')]===_0x8901('0x42')&&_0x4a0b0c['idField']&&_0x4a0b0c[_0x8901('0x3e')]){_0x459716[_0x8901('0x43')][_0x8901('0x1d')]({'id':_0x4a0b0c['idField'],'value':_0x4a0b0c['content'][_0x8901('0x21')]()});}else if(_0x4a0b0c[_0x8901('0x3d')]===_0x8901('0x44')&&_0x4a0b0c['variableName']&&_0x4a0b0c[_0x8901('0x1e')]&&_0x4a0b0c[_0x8901('0x3e')]){_0x27a598[_0x4a0b0c['variableName']]&&_0x459716[_0x8901('0x43')][_0x8901('0x1d')]({'id':_0x4a0b0c[_0x8901('0x1e')],'value':_0x27a598[_0x4a0b0c[_0x8901('0x45')]][_0x8901('0x21')]()});}else if(_0x4a0b0c[_0x8901('0x3d')]===_0x8901('0x46')&&_0x4a0b0c[_0x8901('0x47')]&&_0x4a0b0c[_0x8901('0x47')][_0x8901('0xf')]&&_0x4a0b0c[_0x8901('0x1e')]&&_0x4a0b0c['customField']){_0x27a598[_0x4a0b0c[_0x8901('0x47')]['name']['toLowerCase']()]&&_0x459716[_0x8901('0x43')][_0x8901('0x1d')]({'id':_0x4a0b0c[_0x8901('0x1e')],'value':_0x27a598[_0x4a0b0c[_0x8901('0x47')][_0x8901('0xf')][_0x8901('0x40')]()][_0x8901('0x21')]()});}});}return _0x459716;}function getConnection(_0x32d274){return request({'method':_0x8901('0x48'),'form':{'method':_0x8901('0x49'),'input_type':_0x8901('0x1f'),'response_type':_0x8901('0x1f'),'rest_data':JSON[_0x8901('0x22')]({'user_auth':{'user_name':_0x32d274[_0x8901('0x4a')],'password':_0x32d274['password'],'encryption':_0x8901('0x4b')},'application':_0x8901('0x4c')})}})[_0x8901('0x34')](function(_0x51af71){var _0x497b63=_0x51af71;if(_0x497b63['id']){def[_0x8901('0x4d')]=_0x497b63['id'];return BPromise['resolve'](_0x497b63);}else{throw new Error(util[_0x8901('0x39')](_0x8901('0x4e'),_0x32d274['id']));}});}function setRelationship(_0x35375c,_0x2d2db,_0x837df0,_0x3d7578){return request({'form':{'method':_0x8901('0x4f'),'input_type':_0x8901('0x1f'),'response_type':_0x8901('0x1f'),'rest_data':JSON['stringify']({'session':_0x35375c['id'],'module_name':'Calls','module_id':_0x837df0['id'],'link_field_name':_0x3d7578,'related_ids':[_0x2d2db['id']]})}});}exports[_0x8901('0x50')]=function(_0x196de2,_0x28ed3a,_0x238470,_0x407f7c,_0x1e77e5,_0x268cd7){var _0x1089bd,_0x27b02a,_0x2e2402,_0x10bfd5;_0x268cd7[_0x8901('0x51')]=intUtil['stripTrailingSlash'](_0x268cd7['remoteUri']);_0x268cd7[_0x8901('0x52')]=intUtil[_0x8901('0x53')](_0x268cd7[_0x8901('0x52')]);def[_0x8901('0x54')]=util['format'](_0x8901('0x55'),_0x268cd7['remoteUri']);if(_0x1e77e5&&_0x1e77e5[_0x8901('0x56')]){logger[_0x8901('0xd')]('[QUEUE]',_0x8901('0x57'));_0x28ed3a['recordingURL']=util[_0x8901('0x39')](_0x8901('0x58'),_0x268cd7[_0x8901('0x52')],_0x28ed3a[_0x8901('0x59')],md5(_0x28ed3a[_0x8901('0x59')]));}else{_0x28ed3a[_0x8901('0x5a')]='';}return getConnection(_0x268cd7)[_0x8901('0x34')](function(_0x56bd37){_0x10bfd5=_0x56bd37;return getUser(_0x268cd7,_0x407f7c[_0x8901('0xf')],_0x10bfd5);})[_0x8901('0x34')](function(_0x25dfd0){_0x1089bd=_0x25dfd0;logger[_0x8901('0xd')](_0x8901('0x5b'),_0x1089bd['id']);return getEndUser(_0x268cd7,_0x28ed3a[_0x8901('0x5c')],_0x28ed3a[_0x8901('0x5d')],_0x10bfd5);})[_0x8901('0x34')](function(_0x1eb148){_0x27b02a=_0x1eb148;logger[_0x8901('0xd')](_0x8901('0x5e'),_0x27b02a['id']);return getTicket(_0x268cd7,_0x1089bd,_0x27b02a,_0x238470,_0x28ed3a,_0x238470[_0x8901('0x5f')],_0x10bfd5,_0x8901('0x60'));})[_0x8901('0x34')](function(_0x45f61c){_0x2e2402=_0x45f61c;logger[_0x8901('0xd')](_0x8901('0x61'));logger['info'](_0x8901('0x62'),_0x2e2402['id']);return setRelationship(_0x10bfd5,_0x1089bd,_0x2e2402,_0x8901('0x63'));})[_0x8901('0x34')](function(){return setRelationship(_0x10bfd5,_0x27b02a,_0x2e2402,_0x8901('0x64'));})[_0x8901('0x34')](function(){return getServerInfo(_0x10bfd5);})[_0x8901('0x34')](function(_0x163800){var _0x516731=parseInt(_0x163800[_0x8901('0x65')]['charAt'](0x0));var _0x15ea5f=util[_0x8901('0x39')](_0x8901('0x66'),_0x268cd7[_0x8901('0x51')],_0x2e2402['id']);if(_0x516731>0x6){_0x15ea5f=util[_0x8901('0x39')](_0x8901('0x67'),_0x268cd7[_0x8901('0x51')],_0x2e2402['id']);}logger[_0x8901('0xd')]('[QUEUE]',_0x8901('0x68'));emit(util['format'](_0x8901('0x69'),_0x407f7c['name']),_0x8901('0x6a'),{'uri':_0x15ea5f});})[_0x8901('0x6b')](function(_0x2ed0ed){logger['error'](_0x8901('0x6c'),JSON[_0x8901('0x22')](_0x2ed0ed));});};exports[_0x8901('0x6d')]=function(_0x210e18,_0x1a9bf4,_0x3360b7,_0x37bf50,_0x2a6f95,_0xadfc42,_0x486352){var _0x253a68,_0x18bd85,_0x50a76c,_0x1a1f20;_0xadfc42[_0x8901('0x51')]=intUtil[_0x8901('0x53')](_0xadfc42[_0x8901('0x51')]);_0xadfc42[_0x8901('0x52')]=intUtil[_0x8901('0x53')](_0xadfc42['serverUrl']);def[_0x8901('0x54')]=util[_0x8901('0x39')](_0x8901('0x55'),_0xadfc42['remoteUri']);if(_0x486352&&_0x486352['recordingFormat']&&_0x486352['recordingFormat']!==_0x8901('0x6e')){logger['info'](_0x8901('0x6f'),'Recording\x20is\x20enabled!');_0x1a9bf4[_0x8901('0x5a')]=util[_0x8901('0x39')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0xadfc42[_0x8901('0x52')],_0x1a9bf4[_0x8901('0x59')],md5(_0x1a9bf4[_0x8901('0x59')]));}return getConnection(_0xadfc42)['then'](function(_0x3e2a6c){_0x1a1f20=_0x3e2a6c;return getUser(_0xadfc42,_0x37bf50[_0x8901('0xf')],_0x1a1f20);})[_0x8901('0x34')](function(_0x3874fb){_0x253a68=_0x3874fb;logger['info']('The\x20User\x20ID\x20is:',_0x253a68['id']);return getEndUser(_0xadfc42,_0x1a9bf4[_0x8901('0x70')],_0x1a9bf4['destcalleridnum'],_0x1a1f20);})[_0x8901('0x34')](function(_0x394e82){_0x18bd85=_0x394e82;logger[_0x8901('0xd')]('The\x20Enduser\x20ID\x20is:',_0x18bd85['id']);return getTicket(_0xadfc42,_0x253a68,_0x18bd85,_0x3360b7,_0x1a9bf4,_0x3360b7['Fields'],_0x1a1f20,'Outbound');})[_0x8901('0x34')](function(_0x46ded4){_0x50a76c=_0x46ded4;logger[_0x8901('0xd')](_0x8901('0x61'));logger[_0x8901('0xd')](_0x8901('0x62'),_0x50a76c['id']);return setRelationship(_0x1a1f20,_0x253a68,_0x50a76c,_0x8901('0x63'));})['then'](function(){return setRelationship(_0x1a1f20,_0x18bd85,_0x50a76c,_0x8901('0x64'));})['then'](function(){return getServerInfo(_0x1a1f20);})['then'](function(_0x5b7c82){var _0xf89ca8=parseInt(_0x5b7c82[_0x8901('0x65')][_0x8901('0x71')](0x0));var _0x1204b0=util['format'](_0x8901('0x66'),_0xadfc42[_0x8901('0x51')],_0x50a76c['id']);if(_0xf89ca8>0x6){_0x1204b0=util['format'](_0x8901('0x67'),_0xadfc42[_0x8901('0x51')],_0x50a76c['id']);}logger[_0x8901('0xd')]('[OUTBOUND]',_0x8901('0x68'));emit(util[_0x8901('0x39')](_0x8901('0x69'),_0x37bf50[_0x8901('0xf')]),_0x8901('0x6a'),{'uri':_0x1204b0});})[_0x8901('0x6b')](function(_0x1e7187){logger[_0x8901('0x72')]('[OUTBOUND]',JSON[_0x8901('0x22')](_0x1e7187));});};exports[_0x8901('0x73')]=function(_0x464bdd,_0x4bd9dd,_0x1c06be,_0x2a6f14,_0x3a40a3,_0x4cfd9d){var _0x30dec1,_0xa425c3,_0x27d21b,_0x18b21e;_0x4cfd9d[_0x8901('0x51')]=intUtil['stripTrailingSlash'](_0x4cfd9d[_0x8901('0x51')]);_0x4cfd9d[_0x8901('0x52')]=intUtil['stripTrailingSlash'](_0x4cfd9d[_0x8901('0x52')]);def[_0x8901('0x54')]=util[_0x8901('0x39')](_0x8901('0x55'),_0x4cfd9d['remoteUri']);if(_0x3a40a3&&_0x3a40a3[_0x8901('0x56')]){logger[_0x8901('0xd')](_0x8901('0x74'),_0x8901('0x57'));_0x4bd9dd[_0x8901('0x5a')]=util[_0x8901('0x39')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x4cfd9d[_0x8901('0x52')],_0x4bd9dd['uniqueid'],md5(_0x4bd9dd[_0x8901('0x59')]));}else{_0x4bd9dd[_0x8901('0x5a')]='';}return getConnection(_0x4cfd9d)[_0x8901('0x34')](function(_0x52f9d6){_0x18b21e=_0x52f9d6;if(!_['isNil'](_0x2a6f14)){return getUser(_0x4cfd9d,_0x2a6f14[_0x8901('0xf')],_0x18b21e);}else{return getUser(_0x4cfd9d,null,_0x18b21e);}})['then'](function(_0x9546dd){_0x30dec1=_0x9546dd;logger['info']('The\x20User\x20ID\x20is:',_0x30dec1['id']);return getEndUser(_0x4cfd9d,_0x4bd9dd['calleridname'],_0x4bd9dd[_0x8901('0x5d')],_0x18b21e);})[_0x8901('0x34')](function(_0x3bc5f3){_0xa425c3=_0x3bc5f3;logger['info'](_0x8901('0x5e'),_0xa425c3['id']);return getTicket(_0x4cfd9d,_0x30dec1,_0xa425c3,_0x1c06be,_0x4bd9dd,_0x1c06be[_0x8901('0x5f')],_0x18b21e,_0x8901('0x60'));})[_0x8901('0x34')](function(_0x4706b8){_0x27d21b=_0x4706b8;logger[_0x8901('0xd')](_0x8901('0x61'));logger[_0x8901('0xd')]('The\x20Ticket\x20ID\x20is:',_0x27d21b['id']);return setRelationship(_0x18b21e,_0x30dec1,_0x27d21b,_0x8901('0x63'));})[_0x8901('0x34')](function(){return setRelationship(_0x18b21e,_0xa425c3,_0x27d21b,_0x8901('0x64'));})[_0x8901('0x34')](function(){return getServerInfo(_0x18b21e);})['catch'](function(_0x4c8559){logger[_0x8901('0x72')](_0x8901('0x74'),JSON[_0x8901('0x22')](_0x4c8559));});}; \ 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 652f8b5..b2d006b 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 _0x7474=['getString','length','string','push','content','variable','variableName','toString','type','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','customVariable','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','util'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x7474,0x151));var _0x4747=function(_0xb43602,_0x366340){_0xb43602=_0xb43602-0x0;var _0x505740=_0x7474[_0xb43602];return _0x505740;};'use strict';var _=require('lodash');var util=require(_0x4747('0x0'));exports[_0x4747('0x1')]=function(_0x531778,_0x3a909a,_0x5df7d7){var _0xd93d68=[];if(_0x531778['length']>0x0){var _0x824ffb=_['sortBy'](_0x531778,['id']);for(var _0x1357bb=0x0;_0x1357bb<_0x824ffb[_0x4747('0x2')];_0x1357bb++){var _0xcd3d48=_0x824ffb[_0x1357bb];if(_0xcd3d48['type']===_0x4747('0x3')){_0xd93d68[_0x4747('0x4')](_0xcd3d48[_0x4747('0x5')]);}else if(_0xcd3d48['type']===_0x4747('0x6')&&_0xcd3d48['variableName']){_0x3a909a[_0xcd3d48[_0x4747('0x7')]]&&_0xd93d68[_0x4747('0x4')](_0x3a909a[_0xcd3d48[_0x4747('0x7')]][_0x4747('0x8')]());}else if(_0xcd3d48[_0x4747('0x9')]==='customVariable'&&_0xcd3d48[_0x4747('0xa')]&&_0xcd3d48[_0x4747('0xa')]['name']){_0x3a909a[_0xcd3d48[_0x4747('0xa')][_0x4747('0xb')][_0x4747('0xc')]()]&&_0xd93d68[_0x4747('0x4')](_0x3a909a[_0xcd3d48[_0x4747('0xa')][_0x4747('0xb')]['toLowerCase']()][_0x4747('0x8')]());}else if(_0xcd3d48[_0x4747('0x9')]===_0x4747('0xd')){if(_0xcd3d48[_0x4747('0xe')]==='string'&&_0xcd3d48[_0x4747('0xf')]){_0xd93d68[_0x4747('0x4')](util[_0x4747('0x10')](_0x4747('0x11'),_0xcd3d48[_0x4747('0xf')],_0xcd3d48[_0x4747('0x12')]));}else if(_0xcd3d48[_0x4747('0xe')]===_0x4747('0x6')&&_0xcd3d48[_0x4747('0x7')]&&_0xcd3d48[_0x4747('0xf')]){_0x3a909a[_0xcd3d48[_0x4747('0x7')]]&&_0xd93d68['push'](util[_0x4747('0x10')](_0x4747('0x11'),_0xcd3d48[_0x4747('0xf')],_0x3a909a[_0xcd3d48[_0x4747('0x7')]]));}else if(_0xcd3d48[_0x4747('0xe')]===_0x4747('0x13')&&_0xcd3d48[_0x4747('0xa')]&&_0xcd3d48['Variable'][_0x4747('0xb')]&&_0xcd3d48[_0x4747('0xf')]){_0x3a909a[_0xcd3d48[_0x4747('0xa')][_0x4747('0xb')]['toLowerCase']()]&&_0xd93d68[_0x4747('0x4')](util[_0x4747('0x10')]('%s:\x20%s',_0xcd3d48[_0x4747('0xf')],_0x3a909a[_0xcd3d48[_0x4747('0xa')][_0x4747('0xb')][_0x4747('0xc')]()]));}}}}return _0xd93d68[_0x4747('0x14')](_0x5df7d7);};exports[_0x4747('0x15')]=function(_0x1cc8f7){var _0x1de483=_0x1cc8f7[_0x4747('0x16')](-0x1);if(_0x1de483==='/'){_0x1cc8f7=_0x1cc8f7[_0x4747('0x17')](0x0,_0x1cc8f7[_0x4747('0x18')](_0x1de483));}return _0x1cc8f7;};exports[_0x4747('0x19')]=function(_0x5bf9cf){if(!_['isNil'](_0x5bf9cf)&&_0x5bf9cf!==''){var _0x289cef=/^(([^<>()\[\]\\.,;:\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 _0x289cef['test'](String(_0x5bf9cf)[_0x4747('0xc')]());}else{return![];}}; \ No newline at end of file +var _0xb35a=['keyValue','key','%s:\x20%s','keyContent','keyType','format','name','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','getString','sortBy','length','string','push','content','type','variableName','toString','customVariable','Variable','toLowerCase'];(function(_0x53ce01,_0x331a47){var _0x301bda=function(_0x187748){while(--_0x187748){_0x53ce01['push'](_0x53ce01['shift']());}};_0x301bda(++_0x331a47);}(_0xb35a,0x131));var _0xab35=function(_0x22cea4,_0x54f16a){_0x22cea4=_0x22cea4-0x0;var _0x59d75b=_0xb35a[_0x22cea4];return _0x59d75b;};'use strict';var _=require(_0xab35('0x0'));var util=require(_0xab35('0x1'));exports[_0xab35('0x2')]=function(_0xfecbce,_0x19a63b,_0x473458){var _0x203b96=[];if(_0xfecbce['length']>0x0){var _0x3f3d2a=_[_0xab35('0x3')](_0xfecbce,['id']);for(var _0x26663d=0x0;_0x26663d<_0x3f3d2a[_0xab35('0x4')];_0x26663d++){var _0x2ac0a3=_0x3f3d2a[_0x26663d];if(_0x2ac0a3['type']===_0xab35('0x5')){_0x203b96[_0xab35('0x6')](_0x2ac0a3[_0xab35('0x7')]);}else if(_0x2ac0a3[_0xab35('0x8')]==='variable'&&_0x2ac0a3[_0xab35('0x9')]){_0x19a63b[_0x2ac0a3['variableName']]&&_0x203b96[_0xab35('0x6')](_0x19a63b[_0x2ac0a3[_0xab35('0x9')]][_0xab35('0xa')]());}else if(_0x2ac0a3['type']===_0xab35('0xb')&&_0x2ac0a3['Variable']&&_0x2ac0a3['Variable']['name']){_0x19a63b[_0x2ac0a3[_0xab35('0xc')]['name'][_0xab35('0xd')]()]&&_0x203b96[_0xab35('0x6')](_0x19a63b[_0x2ac0a3[_0xab35('0xc')]['name'][_0xab35('0xd')]()][_0xab35('0xa')]());}else if(_0x2ac0a3['type']===_0xab35('0xe')){if(_0x2ac0a3['keyType']===_0xab35('0x5')&&_0x2ac0a3[_0xab35('0xf')]){_0x203b96[_0xab35('0x6')](util['format'](_0xab35('0x10'),_0x2ac0a3[_0xab35('0xf')],_0x2ac0a3[_0xab35('0x11')]));}else if(_0x2ac0a3[_0xab35('0x12')]==='variable'&&_0x2ac0a3[_0xab35('0x9')]&&_0x2ac0a3['key']){_0x19a63b[_0x2ac0a3[_0xab35('0x9')]]&&_0x203b96[_0xab35('0x6')](util[_0xab35('0x13')](_0xab35('0x10'),_0x2ac0a3[_0xab35('0xf')],_0x19a63b[_0x2ac0a3[_0xab35('0x9')]]));}else if(_0x2ac0a3[_0xab35('0x12')]===_0xab35('0xb')&&_0x2ac0a3[_0xab35('0xc')]&&_0x2ac0a3[_0xab35('0xc')][_0xab35('0x14')]&&_0x2ac0a3[_0xab35('0xf')]){_0x19a63b[_0x2ac0a3[_0xab35('0xc')][_0xab35('0x14')][_0xab35('0xd')]()]&&_0x203b96[_0xab35('0x6')](util[_0xab35('0x13')]('%s:\x20%s',_0x2ac0a3['key'],_0x19a63b[_0x2ac0a3[_0xab35('0xc')][_0xab35('0x14')][_0xab35('0xd')]()]));}}}}return _0x203b96[_0xab35('0x15')](_0x473458);};exports[_0xab35('0x16')]=function(_0xc2f197){var _0x433aaf=_0xc2f197[_0xab35('0x17')](-0x1);if(_0x433aaf==='/'){_0xc2f197=_0xc2f197[_0xab35('0x18')](0x0,_0xc2f197[_0xab35('0x19')](_0x433aaf));}return _0xc2f197;};exports[_0xab35('0x1a')]=function(_0x117f21){if(!_[_0xab35('0x1b')](_0x117f21)&&_0x117f21!==''){var _0x45272e=/^(([^<>()\[\]\\.,;:\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 _0x45272e[_0xab35('0x1c')](String(_0x117f21)[_0xab35('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 5c258f4..0ade366 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x372d54,_0x1efc50){var _0x447606=function(_0x32e333){while(--_0x32e333){_0x372d54['push'](_0x372d54['shift']());}};_0x447606(++_0x1efc50);}(_0xedd9,0xfc));var _0x9edd=function(_0xb2d4a0,_0x9843e9){_0xb2d4a0=_0xb2d4a0-0x0;var _0x289b41=_0xedd9[_0xb2d4a0];return _0x289b41;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ No newline at end of file +var _0x7217=['The\x20User\x20ID\x20is:','calleridname','calleridnum','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','outbound','serverUrl','recordingFormat','none','destcalleridname','destcalleridnum','Fields','The\x20Ticket\x20ID\x20is:','[OUTBOUND]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','abandoned','[ABANDONED]','Ticket\x20created!','lodash','bluebird','md5','util','ioredis','./util','vTiger','redis','defaults','localhost','socket.io-emitter','emit','length','type','string','idField','content','toString','variableName','Variable','name','toLowerCase','info','Creating\x20new\x20ticket...','merge','Normal','getString','Subjects','Descriptions','POST','%s/webservice.php','remoteUri','create','username','sessionName','HelpDesk','stringify','success','resolve','result','format','Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','GET','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','then','Agent\x20found!','email1','first_name','userId','admin','statusCode','getUser','Searching\x20end\x20user\x20with\x20phone','SELECT\x20id,\x20firstname,\x20lastname,\x20email,\x20phone,\x20mobile,\x20homephone,\x20otherphone,\x20assistantphone\x20FROM\x20Contacts\x20WHERE\x20phone\x20=\x20\x27%s\x27\x20OR\x20mobile\x20=\x27%s\x27\x20OR\x20homephone\x20=\x27%s\x27\x20OR\x20otherphone\x20=\x27%s\x27\x20OR\x20assistantphone\x20=\x27%s\x27;','Enduser\x20found!','firstname','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','phone','login','token','Account\x20%d\x20is\x20not\x20valid','getConnection','[HTTP]','queue','stripTrailingSlash','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email'];(function(_0x23d646,_0x41543e){var _0x422428=function(_0x3de3dd){while(--_0x3de3dd){_0x23d646['push'](_0x23d646['shift']());}};_0x422428(++_0x41543e);}(_0x7217,0x19e));var _0x7721=function(_0x102e37,_0x14a181){_0x102e37=_0x102e37-0x0;var _0x35a07c=_0x7217[_0x102e37];return _0x35a07c;};'use strict';var _=require(_0x7721('0x0'));var rp=require('request-promise');var BPromise=require(_0x7721('0x1'));var md5=require(_0x7721('0x2'));var util=require(_0x7721('0x3'));var Redis=require(_0x7721('0x4'));var intUtil=require(_0x7721('0x5'));var config=require('../../../../config/environment');var logger=require('../../../../config/logger')(_0x7721('0x6'));config[_0x7721('0x7')]=_[_0x7721('0x8')](config[_0x7721('0x7')],{'host':_0x7721('0x9'),'port':0x18eb});var io=require(_0x7721('0xa'))(new Redis(config[_0x7721('0x7')]));function emit(_0x21f680,_0x225610,_0x2f99ed){io['to'](_0x21f680)[_0x7721('0xb')](_0x225610,_0x2f99ed);}function getCustomFields(_0x2a66cb,_0xfa8835){var _0x138740={};if(_0x2a66cb[_0x7721('0xc')]>0x0){_['forEach'](_0x2a66cb,function(_0x461d1a){if(_0x461d1a[_0x7721('0xd')]===_0x7721('0xe')&&_0x461d1a[_0x7721('0xf')]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0x461d1a[_0x7721('0x10')][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='variable'&&_0x461d1a[_0x7721('0x12')]&&_0x461d1a[_0x7721('0xf')]&&_0xfa8835[_0x461d1a['variableName']]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x12')]][_0x7721('0x11')]();}else if(_0x461d1a[_0x7721('0xd')]==='customVariable'&&_0x461d1a[_0x7721('0x13')]&&_0x461d1a[_0x7721('0x13')]['name']&&_0x461d1a['idField']&&_0xfa8835[_0x461d1a['Variable'][_0x7721('0x14')][_0x7721('0x15')]()]){_0x138740[_0x461d1a[_0x7721('0xf')]]=_0xfa8835[_0x461d1a[_0x7721('0x13')]['name'][_0x7721('0x15')]()]['toString']();}});}return _0x138740;}function createTicket(_0x3fc09e,_0x5cb0e6,_0xfec626,_0x4e96fb,_0x3ab5a5,_0x3e140d,_0x2286e5){logger[_0x7721('0x16')](_0x7721('0x17'));var _0x413263=_[_0x7721('0x18')]({'parent_id':'','assigned_user_id':_0x5cb0e6['id'],'ticketpriorities':_0x7721('0x19'),'ticketstatus':'Open','ticket_title':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1b')],_0x3ab5a5,'\x20'),'description':intUtil[_0x7721('0x1a')](_0x4e96fb[_0x7721('0x1c')],_0x3ab5a5,'\x0a'),'contact_id':_0xfec626['id']},getCustomFields(_0x3e140d,_0x3ab5a5));var _0x57140c={'method':_0x7721('0x1d'),'uri':util['format'](_0x7721('0x1e'),_0x3fc09e[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x20'),'username':_0x3fc09e[_0x7721('0x21')],'sessionName':_0x2286e5[_0x7721('0x22')],'elementType':_0x7721('0x23'),'element':JSON[_0x7721('0x24')](_0x413263)},'json':!![]};return request(_0x57140c)['then'](function(_0x216f20){if(_0x216f20[_0x7721('0x25')]){return BPromise[_0x7721('0x26')]({'id':_0x216f20[_0x7721('0x27')]['id']});}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x29'),JSON[_0x7721('0x24')](_0x216f20[_0x7721('0x2a')])));}})[_0x7721('0x2b')](function(_0x52316e){var _0x258ddf=_0x52316e['statusCode']||0x1f4;logger['error'](_0x7721('0x2c'),_0x7721('0x2d'),_0x258ddf,JSON[_0x7721('0x24')](_0x52316e));});}function getUser(_0x158d98,_0x1ea4d,_0x37b9f0){if(intUtil[_0x7721('0x2e')](_0x1ea4d)){logger[_0x7721('0x16')]('Getting\x20agent\x20with\x20email',_0x1ea4d);return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x158d98['remoteUri']),'qs':{'operation':_0x7721('0x30'),'username':_0x158d98[_0x7721('0x21')],'sessionName':_0x37b9f0['sessionName'],'query':util[_0x7721('0x28')](_0x7721('0x31'),_0x1ea4d)},'json':!![]})[_0x7721('0x32')](function(_0x58d54b){if(_0x58d54b[_0x7721('0x25')]&&_0x58d54b[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x33'));return BPromise['resolve']({'id':_0x58d54b[_0x7721('0x27')][0x0]['id'],'email':_0x58d54b[_0x7721('0x27')][0x0][_0x7721('0x34')],'name':_0x58d54b['result'][0x0][_0x7721('0x35')]+'\x20'+_0x58d54b[_0x7721('0x27')]['last_name']});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')});}})[_0x7721('0x2b')](function(_0x13c635){var _0x2f1fe0=_0x13c635[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x39'),_0x2f1fe0,JSON['stringify'](_0x13c635));});}else{logger[_0x7721('0x16')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x7721('0x26')]({'id':_0x37b9f0[_0x7721('0x36')],'email':_0x158d98[_0x7721('0x21')],'name':_0x7721('0x37')})[_0x7721('0x2b')](function(_0x378ba5){var _0x482b70=_0x378ba5['statusCode']||0x1f4;logger['error']('[vTiger],\x20%s,\x20%s,\x20%s',_0x7721('0x39'),_0x482b70,JSON[_0x7721('0x24')](_0x378ba5));});}}function getEndUser(_0x1acc72,_0x22ef35,_0x4a90ce,_0xa389fa){logger['info'](_0x7721('0x3a'),_0x4a90ce);return request({'method':_0x7721('0x2f'),'uri':util['format'](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'qs':{'operation':'query','username':_0x1acc72['username'],'sessionName':_0xa389fa[_0x7721('0x22')],'query':util[_0x7721('0x28')](_0x7721('0x3b'),_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce,_0x4a90ce)},'json':!![]})[_0x7721('0x32')](function(_0x577af9){if(_0x577af9[_0x7721('0x25')]&&_0x577af9[_0x7721('0x27')][_0x7721('0xc')]){logger[_0x7721('0x16')](_0x7721('0x3c'));return BPromise['resolve']({'id':_0x577af9[_0x7721('0x27')][0x0]['id'],'name':_0x577af9['result'][0x0][_0x7721('0x3d')]+'\x20'+_0x577af9['result'][0x0][_0x7721('0x3e')],'phone':_0x4a90ce});}else{logger[_0x7721('0x16')](_0x7721('0x3f'));return request({'method':'POST','uri':util[_0x7721('0x28')](_0x7721('0x1e'),_0x1acc72[_0x7721('0x1f')]),'form':{'operation':'create','sessionName':_0xa389fa[_0x7721('0x22')],'elementType':_0x7721('0x40'),'element':JSON[_0x7721('0x24')]({'lastname':_0x22ef35,'phone':_0x4a90ce,'assigned_user_id':'\x20'})},'json':!![]})[_0x7721('0x32')](function(_0x135dbc){logger[_0x7721('0x16')](_0x7721('0x41'));return BPromise['resolve']({'id':_0x135dbc['result']['id'],'name':_0x135dbc[_0x7721('0x27')][_0x7721('0x3e')],'phone':_0x135dbc[_0x7721('0x27')][_0x7721('0x42')]});})[_0x7721('0x2b')](function(_0x15181b){var _0x1d2ea5=_0x15181b[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),'getEndUser',_0x1d2ea5,JSON['stringify'](_0x15181b));});}});}function getConnection(_0x5ed70d){var _0x6a4664=_0x5ed70d[_0x7721('0x21')];var _0x219c9f=_0x5ed70d['accessKey'];return request({'method':_0x7721('0x2f'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'qs':{'operation':'getchallenge','username':_0x6a4664},'json':!![]})[_0x7721('0x32')](function(_0x5c6922){if(_0x5c6922[_0x7721('0x25')]){return request({'method':_0x7721('0x1d'),'uri':util[_0x7721('0x28')]('%s/webservice.php',_0x5ed70d[_0x7721('0x1f')]),'form':{'operation':_0x7721('0x43'),'username':_0x6a4664,'accessKey':md5(_0x5c6922['result'][_0x7721('0x44')]+_0x219c9f)},'json':!![]});}})[_0x7721('0x32')](function(_0xf88e8c){if(_0xf88e8c['success']){return BPromise[_0x7721('0x26')](_0xf88e8c['result']);}else{throw new Error(util[_0x7721('0x28')](_0x7721('0x45'),_0x5ed70d['id']));}})[_0x7721('0x2b')](function(_0x443503){var _0x1c95d8=_0x443503[_0x7721('0x38')]||0x1f4;logger[_0x7721('0x2a')](_0x7721('0x2c'),_0x7721('0x46'),_0x1c95d8,JSON[_0x7721('0x24')](_0x443503));});}function request(_0x31770e){logger[_0x7721('0x16')](_0x7721('0x47'),JSON[_0x7721('0x24')](_0x31770e));return rp(_0x31770e);}exports[_0x7721('0x48')]=function(_0x5b741d,_0x474f32,_0x2f6f30,_0x8e1214,_0x2c1119,_0x1f1ac7){var _0x315127,_0x267f5e,_0x57484c,_0x234bee;_0x1f1ac7[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x1f1ac7[_0x7721('0x1f')]);if(_0x2c1119&&_0x2c1119[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x4b'),_0x7721('0x4c'));_0x474f32[_0x7721('0x4d')]=util[_0x7721('0x28')](_0x7721('0x4e'),_0x1f1ac7['serverUrl'],_0x474f32[_0x7721('0x4f')],md5(_0x474f32[_0x7721('0x4f')]));}else{_0x474f32[_0x7721('0x4d')]='';}return getConnection(_0x1f1ac7)[_0x7721('0x32')](function(_0x15ed3b){_0x234bee=_0x15ed3b;return getUser(_0x1f1ac7,_0x8e1214[_0x7721('0x50')],_0x234bee);})[_0x7721('0x32')](function(_0x36fe6f){_0x315127=_0x36fe6f;logger[_0x7721('0x16')](_0x7721('0x51'),_0x315127['id']);return getEndUser(_0x1f1ac7,_0x474f32[_0x7721('0x52')],_0x474f32[_0x7721('0x53')],_0x234bee);})[_0x7721('0x32')](function(_0x18f7f6){_0x267f5e=_0x18f7f6;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x267f5e['id']);return createTicket(_0x1f1ac7,_0x315127,_0x267f5e,_0x2f6f30,_0x474f32,_0x2f6f30['Fields'],_0x234bee);})['then'](function(_0x885a3a){_0x57484c=_0x885a3a;logger['info']('Ticket\x20created!');logger['info']('The\x20Ticket\x20ID\x20is:',_0x57484c['id']);var _0x47925a=util[_0x7721('0x28')](_0x7721('0x54'),_0x1f1ac7['remoteUri'],_[_0x7721('0x55')](_0x57484c['id'],'x')[0x1]);logger['info']('[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x7721('0x28')]('user:%s',_0x8e1214['name']),'trigger:browser:url',{'uri':_0x47925a});})[_0x7721('0x2b')](function(_0x2e9155){logger[_0x7721('0x2a')]('[QUEUE]',JSON[_0x7721('0x24')](_0x2e9155));});};exports[_0x7721('0x56')]=function(_0x2c95d0,_0x168343,_0x6b7c1e,_0x16e80b,_0xad43ce,_0x3e3301,_0x127f46){var _0x197b73,_0x3b03cf,_0x10666e,_0x148562;_0x3e3301[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0x3e3301['remoteUri']);_0x3e3301[_0x7721('0x57')]=intUtil[_0x7721('0x49')](_0x3e3301[_0x7721('0x57')]);if(_0x127f46&&_0x127f46[_0x7721('0x58')]&&_0x127f46['recordingFormat']!==_0x7721('0x59')){logger[_0x7721('0x16')]('[OUTBOUND]',_0x7721('0x4c'));_0x168343['recordingURL']=util[_0x7721('0x28')](_0x7721('0x4e'),_0x3e3301[_0x7721('0x57')],_0x168343[_0x7721('0x4f')],md5(_0x168343[_0x7721('0x4f')]));}return getConnection(_0x3e3301)[_0x7721('0x32')](function(_0x3121e0){_0x148562=_0x3121e0;return getUser(_0x3e3301,_0x16e80b[_0x7721('0x50')],_0x148562);})[_0x7721('0x32')](function(_0x57759a){_0x197b73=_0x57759a;logger[_0x7721('0x16')](_0x7721('0x51'),_0x197b73['id']);return getEndUser(_0x3e3301,_0x168343[_0x7721('0x5a')],_0x168343[_0x7721('0x5b')],_0x148562);})[_0x7721('0x32')](function(_0x3ed425){_0x3b03cf=_0x3ed425;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x3b03cf['id']);return createTicket(_0x3e3301,_0x197b73,_0x3b03cf,_0x6b7c1e,_0x168343,_0x6b7c1e[_0x7721('0x5c')],_0x148562);})[_0x7721('0x32')](function(_0x53c918){_0x10666e=_0x53c918;logger[_0x7721('0x16')]('Ticket\x20created!');logger[_0x7721('0x16')](_0x7721('0x5d'),_0x10666e['id']);var _0x4282ba=util[_0x7721('0x28')](_0x7721('0x54'),_0x3e3301[_0x7721('0x1f')],_[_0x7721('0x55')](_0x10666e['id'],'x')[0x1]);logger['info'](_0x7721('0x5e'),_0x7721('0x5f'));emit(util[_0x7721('0x28')]('user:%s',_0x16e80b['name']),'trigger:browser:url',{'uri':_0x4282ba});})['catch'](function(_0x5e966f){logger[_0x7721('0x2a')](_0x7721('0x5e'),JSON['stringify'](_0x5e966f));});};exports[_0x7721('0x60')]=function(_0x42f6e9,_0xbbc86f,_0x4593e1,_0x53ebb1,_0x275b25,_0xfe9fb8){var _0x322afc,_0x1bea13,_0x3cf3fd,_0x53adb1;_0xfe9fb8[_0x7721('0x1f')]=intUtil[_0x7721('0x49')](_0xfe9fb8[_0x7721('0x1f')]);_0xfe9fb8['serverUrl']=intUtil['stripTrailingSlash'](_0xfe9fb8[_0x7721('0x57')]);if(_0x275b25&&_0x275b25[_0x7721('0x4a')]){logger[_0x7721('0x16')](_0x7721('0x61'),_0x7721('0x4c'));_0xbbc86f['recordingURL']=util['format'](_0x7721('0x4e'),_0xfe9fb8[_0x7721('0x57')],_0xbbc86f[_0x7721('0x4f')],md5(_0xbbc86f[_0x7721('0x4f')]));}else{_0xbbc86f[_0x7721('0x4d')]='';}return getConnection(_0xfe9fb8)[_0x7721('0x32')](function(_0x34187f){_0x53adb1=_0x34187f;return getUser(_0xfe9fb8,'',_0x53adb1);})['then'](function(_0xdfae41){_0x322afc=_0xdfae41;logger[_0x7721('0x16')](_0x7721('0x51'),_0x322afc['id']);return getEndUser(_0xfe9fb8,_0xbbc86f['calleridname'],_0xbbc86f[_0x7721('0x53')],_0x53adb1);})[_0x7721('0x32')](function(_0xdcd3e0){_0x1bea13=_0xdcd3e0;logger[_0x7721('0x16')]('The\x20Enduser\x20ID\x20is:',_0x1bea13['id']);return createTicket(_0xfe9fb8,_0x322afc,_0x1bea13,_0x4593e1,_0xbbc86f,_0x4593e1['Fields'],_0x53adb1);})[_0x7721('0x32')](function(_0x2cac50){_0x3cf3fd=_0x2cac50;logger[_0x7721('0x16')](_0x7721('0x62'));logger[_0x7721('0x16')](_0x7721('0x5d'),_0x3cf3fd['id']);})['catch'](function(_0x3855d5){logger[_0x7721('0x2a')](_0x7721('0x61'),JSON['stringify'](_0x3855d5));});}; \ 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 33b62b6..50d6975 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 _0xd0bb=['length','filter','end-user','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','defaults','GET','string','nameField','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','%s/agent/tickets/%s','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','[OUTBOUND]','The\x20User\x20ID\x20is:','destcalleridname','destcalleridnum','integrationTab','%s/channels/voice/agents/%d/tickets/%d/display.json','trigger:browser:url','error','abandoned','[ABANDONED]','lodash','request-promise','md5','ioredis','../../../../config/environment','../../../../config/logger','redis','localhost','socket.io-emitter','emit','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','then','Ticket\x20created!','ticket','validateEmail','%s/search.json','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','info','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','type:user\x20role:end-user\x20phone:%s'];(function(_0x3bf142,_0x185501){var _0x2c1e0b=function(_0x11616b){while(--_0x11616b){_0x3bf142['push'](_0x3bf142['shift']());}};_0x2c1e0b(++_0x185501);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x290c31,_0x534b8a){_0x290c31=_0x290c31-0x0;var _0x2eb0ac=_0xd0bb[_0x290c31];return _0x2eb0ac;};'use strict';var _=require(_0xbd0b('0x0'));var rp=require(_0xbd0b('0x1'));var md5=require(_0xbd0b('0x2'));var util=require('util');var Redis=require(_0xbd0b('0x3'));var intUtil=require('./util');var config=require(_0xbd0b('0x4'));var logger=require(_0xbd0b('0x5'))('zendesk');config[_0xbd0b('0x6')]=_['defaults'](config[_0xbd0b('0x6')],{'host':_0xbd0b('0x7'),'port':0x18eb});var io=require(_0xbd0b('0x8'))(new Redis(config[_0xbd0b('0x6')]));function emit(_0x809599,_0x5eb975,_0x2a4075){io['to'](_0x809599)[_0xbd0b('0x9')](_0x5eb975,_0x2a4075);}var headers={'Content-Type':_0xbd0b('0xa'),'Accept':_0xbd0b('0xa')};function getTicket(_0x16e185,_0x53d5e8,_0x51cf98,_0x14bc5b,_0x110cf1){logger['info'](_0xbd0b('0xb'));return request({'uri':util[_0xbd0b('0xc')]('%s/tickets.json',_0x16e185[_0xbd0b('0xd')]),'method':_0xbd0b('0xe'),'body':{'ticket':_[_0xbd0b('0xf')]({'requester_id':_0x51cf98['id'],'submitter_id':_0x53d5e8?_0x53d5e8['id']:undefined,'assignee_id':_0x53d5e8?_0x53d5e8['id']:undefined,'tags':getTags(_0x14bc5b[_0xbd0b('0x10')],_0xbd0b('0x11')),'subject':intUtil[_0xbd0b('0x12')](_0x14bc5b[_0xbd0b('0x13')],_0x110cf1,'\x20'),'description':intUtil[_0xbd0b('0x12')](_0x14bc5b[_0xbd0b('0x14')],_0x110cf1,'\x0a'),'comment':{'public':![],'body':intUtil[_0xbd0b('0x12')](_0x14bc5b[_0xbd0b('0x14')],_0x110cf1,'\x0a')}},getCustomFields(_0x14bc5b['Fields'],_0x110cf1))}})[_0xbd0b('0x15')](function(_0x4b113b){logger['info'](_0xbd0b('0x16'));return _0x4b113b[_0xbd0b('0x17')];});}function getUser(_0x3183cf,_0x40b075){if(intUtil[_0xbd0b('0x18')](_0x40b075)){logger['info']('Getting\x20agent\x20with\x20email',_0x40b075);return request({'uri':util[_0xbd0b('0xc')](_0xbd0b('0x19'),_0x3183cf[_0xbd0b('0xd')]),'qs':{'query':util[_0xbd0b('0xc')](_0xbd0b('0x1a'),_0x40b075)}})[_0xbd0b('0x15')](function(_0x5aeb79){if(_0x5aeb79[_0xbd0b('0x1b')]){logger['info'](_0xbd0b('0x1c'));return _[_0xbd0b('0x1d')](_0x5aeb79[_0xbd0b('0x1e')],{'email':_0x40b075,'role':_0xbd0b('0x1f')});}else{logger['info'](_0xbd0b('0x20'));return request({'uri':util[_0xbd0b('0xc')](_0xbd0b('0x21'),_0x3183cf['remoteUri'])})[_0xbd0b('0x15')](function(_0x560db4){logger[_0xbd0b('0x22')](_0xbd0b('0x23'));return _0x560db4[_0xbd0b('0x24')];});}});}else{logger[_0xbd0b('0x22')](_0xbd0b('0x20'));return request({'uri':util['format'](_0xbd0b('0x21'),_0x3183cf['remoteUri'])})[_0xbd0b('0x15')](function(_0x18b9dc){logger[_0xbd0b('0x22')](_0xbd0b('0x23'));return _0x18b9dc[_0xbd0b('0x24')];});}}function getEndUser(_0xb06342,_0x4fe9ed,_0x382f76){logger[_0xbd0b('0x22')](_0xbd0b('0x25'),_0x382f76);return request({'uri':util[_0xbd0b('0xc')](_0xbd0b('0x19'),_0xb06342[_0xbd0b('0xd')]),'qs':{'query':util['format'](_0xbd0b('0x26'),_0x382f76)}})[_0xbd0b('0x15')](function(_0x82d326){var _0x4f877a;if(_0x82d326['results'][_0xbd0b('0x27')]){_0x82d326[_0xbd0b('0x1e')]=_[_0xbd0b('0x28')](_0x82d326[_0xbd0b('0x1e')],{'suspended':![],'role':_0xbd0b('0x29')});if(_0x82d326[_0xbd0b('0x1e')][_0xbd0b('0x27')]){_0x4f877a=_['first'](_0x82d326[_0xbd0b('0x1e')]);}}if(_0x4f877a){logger[_0xbd0b('0x22')]('Enduser\x20found!');return _0x4f877a;}else{logger['info'](_0xbd0b('0x2a'));return request({'uri':util[_0xbd0b('0xc')]('%s/users.json',_0xb06342[_0xbd0b('0xd')]),'method':_0xbd0b('0xe'),'body':{'user':{'role':_0xbd0b('0x29'),'name':util[_0xbd0b('0xc')](_0xbd0b('0x2b'),_0x4fe9ed||_0x382f76),'phone':_0x382f76}}})[_0xbd0b('0x15')](function(_0x5f224e){logger[_0xbd0b('0x22')](_0xbd0b('0x2c'));return _0x5f224e[_0xbd0b('0x24')];});}});}function getAuth(_0x3e38e4){var _0x2aec53;if(_0x3e38e4[_0xbd0b('0x2d')]===_0xbd0b('0x2e')){_0x2aec53=util[_0xbd0b('0xc')](_0xbd0b('0x2f'),_0x3e38e4[_0xbd0b('0x30')],_0x3e38e4[_0xbd0b('0x2e')]);}else if(_0x3e38e4[_0xbd0b('0x2d')]===_0xbd0b('0x31')){_0x2aec53=util[_0xbd0b('0xc')]('%s/token:%s',_0x3e38e4[_0xbd0b('0x30')],_0x3e38e4[_0xbd0b('0x31')]);}return util['format'](_0xbd0b('0x32'),new Buffer(_0x2aec53)[_0xbd0b('0x33')](_0xbd0b('0x34')));}function request(_0xa2c4a0){logger[_0xbd0b('0x35')](_0xbd0b('0x36'),JSON['stringify'](_0xa2c4a0));return rp(_[_0xbd0b('0x37')](_0xa2c4a0,{'method':_0xbd0b('0x38'),'headers':headers,'json':!![]}));}function getTags(_0x3b5098,_0x2597ab){var _0x6ef6ed=[];if(_0x3b5098&&_0x3b5098['length']>0x0){_0x6ef6ed=_['map'](_0x3b5098,_0x2597ab);}return _0x6ef6ed;}function getCustomFields(_0x3b6a38,_0x8db305){var _0x439b9f=[];var _0x2ac653={'custom_fields':[]};if(_0x3b6a38['length']>0x0){_['forEach'](_0x3b6a38,function(_0xf6800){if(_0xf6800['type']===_0xbd0b('0x39')&&_0xf6800[_0xbd0b('0x3a')]&&!_0xf6800[_0xbd0b('0x3b')]){_0x2ac653[_0xf6800[_0xbd0b('0x3a')][_0xbd0b('0x3c')]()]=_0xf6800[_0xbd0b('0x3d')][_0xbd0b('0x33')]();}else if(_0xf6800[_0xbd0b('0x3e')]===_0xbd0b('0x39')&&_0xf6800[_0xbd0b('0x3f')]&&_0xf6800[_0xbd0b('0x3b')]){_0x2ac653[_0xbd0b('0x40')][_0xbd0b('0x41')]({'id':_0xf6800[_0xbd0b('0x3f')],'value':_0xf6800[_0xbd0b('0x3d')][_0xbd0b('0x33')]()});}else if(_0xf6800[_0xbd0b('0x3e')]===_0xbd0b('0x42')&&_0xf6800['variableName']&&_0xf6800[_0xbd0b('0x3f')]&&_0xf6800[_0xbd0b('0x3b')]){_0x8db305[_0xf6800[_0xbd0b('0x43')]]&&_0x2ac653[_0xbd0b('0x40')][_0xbd0b('0x41')]({'id':_0xf6800[_0xbd0b('0x3f')],'value':_0x8db305[_0xf6800[_0xbd0b('0x43')]][_0xbd0b('0x33')]()});}else if(_0xf6800[_0xbd0b('0x3e')]===_0xbd0b('0x44')&&_0xf6800[_0xbd0b('0x45')]&&_0xf6800[_0xbd0b('0x45')]['name']&&_0xf6800[_0xbd0b('0x3f')]&&_0xf6800['customField']){_0x8db305[_0xf6800['Variable'][_0xbd0b('0x11')][_0xbd0b('0x3c')]()]&&_0x2ac653[_0xbd0b('0x40')]['push']({'id':_0xf6800[_0xbd0b('0x3f')],'value':_0x8db305[_0xf6800[_0xbd0b('0x45')][_0xbd0b('0x11')][_0xbd0b('0x3c')]()][_0xbd0b('0x33')]()});}});}return _0x2ac653;}exports['queue']=function(_0x1830e9,_0x3619b9,_0x1de201,_0x43e626,_0x102147,_0xaaefaa){var _0x480c00,_0x335728;_0xaaefaa[_0xbd0b('0xd')]=intUtil[_0xbd0b('0x46')](_0xaaefaa[_0xbd0b('0xd')]);_0xaaefaa[_0xbd0b('0x47')]=intUtil[_0xbd0b('0x46')](_0xaaefaa[_0xbd0b('0x47')]);if(_0x102147&&_0x102147[_0xbd0b('0x48')]){logger[_0xbd0b('0x22')](_0xbd0b('0x49'),_0xbd0b('0x4a'));_0x3619b9[_0xbd0b('0x4b')]=util[_0xbd0b('0xc')](_0xbd0b('0x4c'),_0xaaefaa[_0xbd0b('0x47')],_0x3619b9[_0xbd0b('0x4d')],md5(_0x3619b9[_0xbd0b('0x4d')]));}else{_0x3619b9[_0xbd0b('0x4b')]='';}headers[_0xbd0b('0x4e')]=getAuth(_0xaaefaa);return getUser(_0xaaefaa,_0x43e626[_0xbd0b('0x4f')])[_0xbd0b('0x15')](function(_0xbd64e2){_0x480c00=_0xbd64e2;logger[_0xbd0b('0x22')]('The\x20User\x20ID\x20is:',_0x480c00['id']);return getEndUser(_0xaaefaa,_0x3619b9[_0xbd0b('0x50')],_0x3619b9[_0xbd0b('0x51')]);})['then'](function(_0x4aff33){_0x335728=_0x4aff33;logger['info'](_0xbd0b('0x52'),_0x335728['id']);return getTicket(_0xaaefaa,_0x480c00,_0x335728,_0x1de201,_0x3619b9);})['then'](function(_0x1b9c00){if(_0x1b9c00){logger[_0xbd0b('0x22')](_0xbd0b('0x53'),_0x1b9c00['id']);switch(_0xaaefaa[_0xbd0b('0x3e')]){case'integrationTab':logger[_0xbd0b('0x22')]('[QUEUE]',_0xbd0b('0x54'));return request({'uri':util['format']('%s/channels/voice/agents/%d/tickets/%d/display.json',_0xaaefaa[_0xbd0b('0xd')],_0x480c00['id'],_0x1b9c00['id']),'method':_0xbd0b('0xe')});case _0xbd0b('0x55'):logger[_0xbd0b('0x22')](_0xbd0b('0x49'),_0xbd0b('0x56'));emit(util[_0xbd0b('0xc')](_0xbd0b('0x57'),_0x43e626['name']),'trigger:browser:url',{'uri':util[_0xbd0b('0xc')](_0xbd0b('0x58'),_0xaaefaa['remoteUri'],_0x1b9c00['id'])});break;default:logger['error'](_0xbd0b('0x49'),_0xbd0b('0x59'));}}})[_0xbd0b('0x5a')](function(_0x3b91c1){logger['error'](_0xbd0b('0x5b'),util[_0xbd0b('0x5c')](_0x3b91c1,{'showHidden':!![],'depth':null}));});};exports[_0xbd0b('0x5d')]=function(_0x183029,_0x50fc5b,_0xa6ac89,_0x3c62c4,_0x4bd549,_0x122a19,_0x1ea443){var _0x44bc2a,_0x34bc7f;_0x122a19[_0xbd0b('0xd')]=intUtil[_0xbd0b('0x46')](_0x122a19[_0xbd0b('0xd')]);_0x122a19[_0xbd0b('0x47')]=intUtil['stripTrailingSlash'](_0x122a19[_0xbd0b('0x47')]);if(_0x1ea443&&_0x1ea443[_0xbd0b('0x5e')]&&_0x1ea443[_0xbd0b('0x5e')]!==_0xbd0b('0x5f')){logger[_0xbd0b('0x22')](_0xbd0b('0x60'),'Recording\x20is\x20enabled!');_0x50fc5b['recordingURL']=util[_0xbd0b('0xc')](_0xbd0b('0x4c'),_0x122a19['serverUrl'],_0x50fc5b[_0xbd0b('0x4d')],md5(_0x50fc5b[_0xbd0b('0x4d')]));}headers[_0xbd0b('0x4e')]=getAuth(_0x122a19);return getUser(_0x122a19,_0x3c62c4[_0xbd0b('0x4f')])[_0xbd0b('0x15')](function(_0x5be34a){_0x44bc2a=_0x5be34a;logger[_0xbd0b('0x22')](_0xbd0b('0x61'),_0x44bc2a['id']);return getEndUser(_0x122a19,_0x50fc5b[_0xbd0b('0x62')],_0x50fc5b[_0xbd0b('0x63')]);})[_0xbd0b('0x15')](function(_0xa08f72){_0x34bc7f=_0xa08f72;logger[_0xbd0b('0x22')](_0xbd0b('0x52'),_0x34bc7f['id']);return getTicket(_0x122a19,_0x44bc2a,_0x34bc7f,_0xa6ac89,_0x50fc5b);})[_0xbd0b('0x15')](function(_0x21a22a){if(_0x21a22a){logger[_0xbd0b('0x22')](_0xbd0b('0x53'),_0x21a22a['id']);switch(_0x122a19[_0xbd0b('0x3e')]){case _0xbd0b('0x64'):logger[_0xbd0b('0x22')](_0xbd0b('0x60'),_0xbd0b('0x54'));return request({'uri':util['format'](_0xbd0b('0x65'),_0x122a19[_0xbd0b('0xd')],_0x44bc2a['id'],_0x21a22a['id']),'method':_0xbd0b('0xe')});case _0xbd0b('0x55'):logger['info']('[OUTBOUND]',_0xbd0b('0x56'));emit(util[_0xbd0b('0xc')](_0xbd0b('0x57'),_0x3c62c4[_0xbd0b('0x11')]),_0xbd0b('0x66'),{'uri':util['format'](_0xbd0b('0x58'),_0x122a19['remoteUri'],_0x21a22a['id'])});break;default:logger[_0xbd0b('0x67')](_0xbd0b('0x60'),_0xbd0b('0x59'));}}})[_0xbd0b('0x5a')](function(_0x2df588){logger[_0xbd0b('0x67')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0xbd0b('0x5c')](_0x2df588,{'showHidden':!![],'depth':null}));});};exports[_0xbd0b('0x68')]=function(_0x21a475,_0x33313a,_0x56f833,_0x1fd31f,_0x297b9b,_0x2ec7ed){var _0x31cc3c,_0x274e79;_0x2ec7ed['remoteUri']=intUtil['stripTrailingSlash'](_0x2ec7ed[_0xbd0b('0xd')]);_0x2ec7ed['serverUrl']=intUtil[_0xbd0b('0x46')](_0x2ec7ed[_0xbd0b('0x47')]);if(_0x297b9b&&_0x297b9b[_0xbd0b('0x48')]){logger[_0xbd0b('0x22')](_0xbd0b('0x69'),_0xbd0b('0x4a'));_0x33313a['recordingURL']=util[_0xbd0b('0xc')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ec7ed[_0xbd0b('0x47')],_0x33313a['uniqueid'],md5(_0x33313a['uniqueid']));}else{_0x33313a['recordingURL']='';}headers[_0xbd0b('0x4e')]=getAuth(_0x2ec7ed);return getUser(_0x2ec7ed)['then'](function(_0x57d14b){_0x31cc3c=_0x57d14b;logger[_0xbd0b('0x22')](_0xbd0b('0x61'),_0x31cc3c['id']);return getEndUser(_0x2ec7ed,_0x33313a['calleridname'],_0x33313a[_0xbd0b('0x51')]);})['then'](function(_0x58d337){_0x274e79=_0x58d337;logger[_0xbd0b('0x22')](_0xbd0b('0x52'),_0x274e79['id']);return getTicket(_0x2ec7ed,_0x31cc3c,_0x274e79,_0x56f833,_0x33313a);})[_0xbd0b('0x15')](function(_0x111afd){if(_0x111afd){logger[_0xbd0b('0x22')](_0xbd0b('0x53'),_0x111afd['id']);}})[_0xbd0b('0x5a')](function(_0x408ac4){logger['error']('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0xbd0b('0x5c')](_0x408ac4,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x3c7b=['user','Searching\x20enduser\x20with\x20phone','%s/search.json','type:user\x20role:end-user\x20phone:%s','length','filter','end-user','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Caller\x20-\x20%s','Enduser\x20created.','authType','%s:%s','username','password','token','%s/token:%s','toString','base64','debug','[HTTP]','stringify','map','forEach','type','string','nameField','content','idField','custom_fields','push','variable','variableName','Variable','customField','toLowerCase','queue','stripTrailingSlash','serverUrl','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','[QUEUE]','%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','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridnum','integrationTab','Zendesk\x20account\x20type\x20not\x20recognized','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','inspect','monitor_format','[ABANDONED]','calleridnum','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','request-promise','md5','util','ioredis','redis','defaults','localhost','emit','application/json','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','info','Ticket\x20created!','ticket','validateEmail','Getting\x20agent\x20with\x20email','type:user\x20role:agent\x20email:%s','count','Agent\x20found!','find','results','agent','%s/users/me.json','Admin\x20account\x20selected.','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!'];(function(_0x5c12ba,_0x229eee){var _0x4ed0fa=function(_0x410943){while(--_0x410943){_0x5c12ba['push'](_0x5c12ba['shift']());}};_0x4ed0fa(++_0x229eee);}(_0x3c7b,0x11d));var _0xb3c7=function(_0x1cea92,_0x50e404){_0x1cea92=_0x1cea92-0x0;var _0x30cd9b=_0x3c7b[_0x1cea92];return _0x30cd9b;};'use strict';var _=require(_0xb3c7('0x0'));var rp=require(_0xb3c7('0x1'));var md5=require(_0xb3c7('0x2'));var util=require(_0xb3c7('0x3'));var Redis=require(_0xb3c7('0x4'));var intUtil=require('./util');var config=require('../../../../config/environment');var logger=require('../../../../config/logger')('zendesk');config[_0xb3c7('0x5')]=_[_0xb3c7('0x6')](config['redis'],{'host':_0xb3c7('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xb3c7('0x5')]));function emit(_0x3e9d10,_0x341a27,_0x1851a5){io['to'](_0x3e9d10)[_0xb3c7('0x8')](_0x341a27,_0x1851a5);}var headers={'Content-Type':'application/json','Accept':_0xb3c7('0x9')};function getTicket(_0x56a13b,_0x1712af,_0x41dc8a,_0x161cdb,_0x1ac526){logger['info'](_0xb3c7('0xa'));return request({'uri':util[_0xb3c7('0xb')]('%s/tickets.json',_0x56a13b[_0xb3c7('0xc')]),'method':_0xb3c7('0xd'),'body':{'ticket':_[_0xb3c7('0xe')]({'requester_id':_0x41dc8a['id'],'submitter_id':_0x1712af?_0x1712af['id']:undefined,'assignee_id':_0x1712af?_0x1712af['id']:undefined,'tags':getTags(_0x161cdb[_0xb3c7('0xf')],_0xb3c7('0x10')),'subject':intUtil[_0xb3c7('0x11')](_0x161cdb[_0xb3c7('0x12')],_0x1ac526,'\x20'),'description':intUtil['getString'](_0x161cdb[_0xb3c7('0x13')],_0x1ac526,'\x0a'),'comment':{'public':![],'body':intUtil[_0xb3c7('0x11')](_0x161cdb['Descriptions'],_0x1ac526,'\x0a')}},getCustomFields(_0x161cdb[_0xb3c7('0x14')],_0x1ac526))}})[_0xb3c7('0x15')](function(_0x746d75){logger[_0xb3c7('0x16')](_0xb3c7('0x17'));return _0x746d75[_0xb3c7('0x18')];});}function getUser(_0x9a2b03,_0x379c16){if(intUtil[_0xb3c7('0x19')](_0x379c16)){logger[_0xb3c7('0x16')](_0xb3c7('0x1a'),_0x379c16);return request({'uri':util[_0xb3c7('0xb')]('%s/search.json',_0x9a2b03['remoteUri']),'qs':{'query':util[_0xb3c7('0xb')](_0xb3c7('0x1b'),_0x379c16)}})[_0xb3c7('0x15')](function(_0x3f5216){if(_0x3f5216[_0xb3c7('0x1c')]){logger['info'](_0xb3c7('0x1d'));return _[_0xb3c7('0x1e')](_0x3f5216[_0xb3c7('0x1f')],{'email':_0x379c16,'role':_0xb3c7('0x20')});}else{logger['info']('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0xb3c7('0xb')](_0xb3c7('0x21'),_0x9a2b03['remoteUri'])})[_0xb3c7('0x15')](function(_0xe9be68){logger[_0xb3c7('0x16')](_0xb3c7('0x22'));return _0xe9be68['user'];});}});}else{logger['info'](_0xb3c7('0x23'));return request({'uri':util[_0xb3c7('0xb')](_0xb3c7('0x21'),_0x9a2b03[_0xb3c7('0xc')])})[_0xb3c7('0x15')](function(_0x4a0315){logger[_0xb3c7('0x16')](_0xb3c7('0x22'));return _0x4a0315[_0xb3c7('0x24')];});}}function getEndUser(_0x3e8bf4,_0x5f3f8d,_0xf679dd){logger[_0xb3c7('0x16')](_0xb3c7('0x25'),_0xf679dd);return request({'uri':util['format'](_0xb3c7('0x26'),_0x3e8bf4[_0xb3c7('0xc')]),'qs':{'query':util[_0xb3c7('0xb')](_0xb3c7('0x27'),_0xf679dd)}})[_0xb3c7('0x15')](function(_0x51e0a5){var _0x42a817;if(_0x51e0a5[_0xb3c7('0x1f')][_0xb3c7('0x28')]){_0x51e0a5[_0xb3c7('0x1f')]=_[_0xb3c7('0x29')](_0x51e0a5[_0xb3c7('0x1f')],{'suspended':![],'role':_0xb3c7('0x2a')});if(_0x51e0a5[_0xb3c7('0x1f')][_0xb3c7('0x28')]){_0x42a817=_['first'](_0x51e0a5[_0xb3c7('0x1f')]);}}if(_0x42a817){logger[_0xb3c7('0x16')](_0xb3c7('0x2b'));return _0x42a817;}else{logger['info'](_0xb3c7('0x2c'));return request({'uri':util['format']('%s/users.json',_0x3e8bf4['remoteUri']),'method':_0xb3c7('0xd'),'body':{'user':{'role':_0xb3c7('0x2a'),'name':util[_0xb3c7('0xb')](_0xb3c7('0x2d'),_0x5f3f8d||_0xf679dd),'phone':_0xf679dd}}})[_0xb3c7('0x15')](function(_0x511ff9){logger[_0xb3c7('0x16')](_0xb3c7('0x2e'));return _0x511ff9[_0xb3c7('0x24')];});}});}function getAuth(_0x4ce06a){var _0x4ea5b3;if(_0x4ce06a[_0xb3c7('0x2f')]==='password'){_0x4ea5b3=util[_0xb3c7('0xb')](_0xb3c7('0x30'),_0x4ce06a[_0xb3c7('0x31')],_0x4ce06a[_0xb3c7('0x32')]);}else if(_0x4ce06a[_0xb3c7('0x2f')]===_0xb3c7('0x33')){_0x4ea5b3=util[_0xb3c7('0xb')](_0xb3c7('0x34'),_0x4ce06a[_0xb3c7('0x31')],_0x4ce06a[_0xb3c7('0x33')]);}return util[_0xb3c7('0xb')]('Basic\x20%s',new Buffer(_0x4ea5b3)[_0xb3c7('0x35')](_0xb3c7('0x36')));}function request(_0x346dcc){logger[_0xb3c7('0x37')](_0xb3c7('0x38'),JSON[_0xb3c7('0x39')](_0x346dcc));return rp(_[_0xb3c7('0x6')](_0x346dcc,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x5454c4,_0x176851){var _0x1bc43b=[];if(_0x5454c4&&_0x5454c4[_0xb3c7('0x28')]>0x0){_0x1bc43b=_[_0xb3c7('0x3a')](_0x5454c4,_0x176851);}return _0x1bc43b;}function getCustomFields(_0x20c487,_0x3d6964){var _0x49f04a=[];var _0x6ae28={'custom_fields':[]};if(_0x20c487[_0xb3c7('0x28')]>0x0){_[_0xb3c7('0x3b')](_0x20c487,function(_0x890302){if(_0x890302[_0xb3c7('0x3c')]===_0xb3c7('0x3d')&&_0x890302[_0xb3c7('0x3e')]&&!_0x890302['customField']){_0x6ae28[_0x890302[_0xb3c7('0x3e')]['toLowerCase']()]=_0x890302[_0xb3c7('0x3f')][_0xb3c7('0x35')]();}else if(_0x890302[_0xb3c7('0x3c')]===_0xb3c7('0x3d')&&_0x890302[_0xb3c7('0x40')]&&_0x890302['customField']){_0x6ae28[_0xb3c7('0x41')][_0xb3c7('0x42')]({'id':_0x890302[_0xb3c7('0x40')],'value':_0x890302[_0xb3c7('0x3f')][_0xb3c7('0x35')]()});}else if(_0x890302[_0xb3c7('0x3c')]===_0xb3c7('0x43')&&_0x890302[_0xb3c7('0x44')]&&_0x890302['idField']&&_0x890302['customField']){_0x3d6964[_0x890302[_0xb3c7('0x44')]]&&_0x6ae28[_0xb3c7('0x41')]['push']({'id':_0x890302[_0xb3c7('0x40')],'value':_0x3d6964[_0x890302['variableName']][_0xb3c7('0x35')]()});}else if(_0x890302[_0xb3c7('0x3c')]==='customVariable'&&_0x890302[_0xb3c7('0x45')]&&_0x890302[_0xb3c7('0x45')][_0xb3c7('0x10')]&&_0x890302['idField']&&_0x890302[_0xb3c7('0x46')]){_0x3d6964[_0x890302[_0xb3c7('0x45')][_0xb3c7('0x10')][_0xb3c7('0x47')]()]&&_0x6ae28[_0xb3c7('0x41')][_0xb3c7('0x42')]({'id':_0x890302['idField'],'value':_0x3d6964[_0x890302[_0xb3c7('0x45')][_0xb3c7('0x10')]['toLowerCase']()][_0xb3c7('0x35')]()});}});}return _0x6ae28;}exports[_0xb3c7('0x48')]=function(_0x1be29d,_0x599c21,_0x193301,_0x1d2ef0,_0x464bd1,_0x1ef339){var _0x28e926,_0x5b901c;_0x1ef339[_0xb3c7('0xc')]=intUtil[_0xb3c7('0x49')](_0x1ef339['remoteUri']);_0x1ef339['serverUrl']=intUtil['stripTrailingSlash'](_0x1ef339[_0xb3c7('0x4a')]);if(_0x464bd1&&_0x464bd1['monitor_format']){logger[_0xb3c7('0x16')]('[QUEUE]','Recording\x20is\x20enabled!');_0x599c21[_0xb3c7('0x4b')]=util[_0xb3c7('0xb')](_0xb3c7('0x4c'),_0x1ef339[_0xb3c7('0x4a')],_0x599c21[_0xb3c7('0x4d')],md5(_0x599c21['uniqueid']));}else{_0x599c21['recordingURL']='';}headers[_0xb3c7('0x4e')]=getAuth(_0x1ef339);return getUser(_0x1ef339,_0x1d2ef0[_0xb3c7('0x4f')])[_0xb3c7('0x15')](function(_0x371a18){_0x28e926=_0x371a18;logger[_0xb3c7('0x16')](_0xb3c7('0x50'),_0x28e926['id']);return getEndUser(_0x1ef339,_0x599c21[_0xb3c7('0x51')],_0x599c21['calleridnum']);})['then'](function(_0x360e76){_0x5b901c=_0x360e76;logger['info'](_0xb3c7('0x52'),_0x5b901c['id']);return getTicket(_0x1ef339,_0x28e926,_0x5b901c,_0x193301,_0x599c21);})['then'](function(_0x4ee65b){if(_0x4ee65b){logger[_0xb3c7('0x16')](_0xb3c7('0x53'),_0x4ee65b['id']);switch(_0x1ef339[_0xb3c7('0x3c')]){case'integrationTab':logger['info'](_0xb3c7('0x54'),'Displaying\x20ticket\x20to\x20agent...');return request({'uri':util['format'](_0xb3c7('0x55'),_0x1ef339[_0xb3c7('0xc')],_0x28e926['id'],_0x4ee65b['id']),'method':_0xb3c7('0xd')});case _0xb3c7('0x56'):logger[_0xb3c7('0x16')](_0xb3c7('0x54'),_0xb3c7('0x57'));emit(util[_0xb3c7('0xb')](_0xb3c7('0x58'),_0x1d2ef0['name']),_0xb3c7('0x59'),{'uri':util[_0xb3c7('0xb')](_0xb3c7('0x5a'),_0x1ef339[_0xb3c7('0xc')],_0x4ee65b['id'])});break;default:logger[_0xb3c7('0x5b')](_0xb3c7('0x54'),'Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0xb3c7('0x5c')](function(_0x19eaec){logger['error']('[QUEUE]\x20Error\x20running\x20Zendesk\x20integration',util['inspect'](_0x19eaec,{'showHidden':!![],'depth':null}));});};exports[_0xb3c7('0x5d')]=function(_0x45aded,_0xe4f13c,_0x105eac,_0x3f14da,_0x150082,_0x20cbea,_0x390bb9){var _0x251af2,_0x42cb88;_0x20cbea[_0xb3c7('0xc')]=intUtil[_0xb3c7('0x49')](_0x20cbea[_0xb3c7('0xc')]);_0x20cbea[_0xb3c7('0x4a')]=intUtil['stripTrailingSlash'](_0x20cbea[_0xb3c7('0x4a')]);if(_0x390bb9&&_0x390bb9[_0xb3c7('0x5e')]&&_0x390bb9[_0xb3c7('0x5e')]!==_0xb3c7('0x5f')){logger[_0xb3c7('0x16')](_0xb3c7('0x60'),_0xb3c7('0x61'));_0xe4f13c[_0xb3c7('0x4b')]=util[_0xb3c7('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x20cbea[_0xb3c7('0x4a')],_0xe4f13c[_0xb3c7('0x4d')],md5(_0xe4f13c[_0xb3c7('0x4d')]));}headers[_0xb3c7('0x4e')]=getAuth(_0x20cbea);return getUser(_0x20cbea,_0x3f14da[_0xb3c7('0x4f')])['then'](function(_0x33a0ee){_0x251af2=_0x33a0ee;logger[_0xb3c7('0x16')](_0xb3c7('0x50'),_0x251af2['id']);return getEndUser(_0x20cbea,_0xe4f13c['destcalleridname'],_0xe4f13c[_0xb3c7('0x62')]);})[_0xb3c7('0x15')](function(_0x4434e2){_0x42cb88=_0x4434e2;logger[_0xb3c7('0x16')](_0xb3c7('0x52'),_0x42cb88['id']);return getTicket(_0x20cbea,_0x251af2,_0x42cb88,_0x105eac,_0xe4f13c);})['then'](function(_0x1c491c){if(_0x1c491c){logger[_0xb3c7('0x16')](_0xb3c7('0x53'),_0x1c491c['id']);switch(_0x20cbea['type']){case _0xb3c7('0x63'):logger[_0xb3c7('0x16')]('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xb3c7('0xb')](_0xb3c7('0x55'),_0x20cbea[_0xb3c7('0xc')],_0x251af2['id'],_0x1c491c['id']),'method':_0xb3c7('0xd')});case _0xb3c7('0x56'):logger['info'](_0xb3c7('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xb3c7('0x58'),_0x3f14da[_0xb3c7('0x10')]),'trigger:browser:url',{'uri':util[_0xb3c7('0xb')](_0xb3c7('0x5a'),_0x20cbea['remoteUri'],_0x1c491c['id'])});break;default:logger[_0xb3c7('0x5b')](_0xb3c7('0x60'),_0xb3c7('0x64'));}}})[_0xb3c7('0x5c')](function(_0x180564){logger['error'](_0xb3c7('0x65'),util[_0xb3c7('0x66')](_0x180564,{'showHidden':!![],'depth':null}));});};exports['abandoned']=function(_0x3faa31,_0x330e37,_0x42c10e,_0x40285f,_0x2c4b1b,_0x495b76){var _0x416ca6,_0x2ac901;_0x495b76['remoteUri']=intUtil[_0xb3c7('0x49')](_0x495b76[_0xb3c7('0xc')]);_0x495b76[_0xb3c7('0x4a')]=intUtil[_0xb3c7('0x49')](_0x495b76[_0xb3c7('0x4a')]);if(_0x2c4b1b&&_0x2c4b1b[_0xb3c7('0x67')]){logger['info'](_0xb3c7('0x68'),_0xb3c7('0x61'));_0x330e37[_0xb3c7('0x4b')]=util[_0xb3c7('0xb')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x495b76['serverUrl'],_0x330e37[_0xb3c7('0x4d')],md5(_0x330e37[_0xb3c7('0x4d')]));}else{_0x330e37['recordingURL']='';}headers[_0xb3c7('0x4e')]=getAuth(_0x495b76);return getUser(_0x495b76)['then'](function(_0x3a23a6){_0x416ca6=_0x3a23a6;logger[_0xb3c7('0x16')]('The\x20User\x20ID\x20is:',_0x416ca6['id']);return getEndUser(_0x495b76,_0x330e37[_0xb3c7('0x51')],_0x330e37[_0xb3c7('0x69')]);})[_0xb3c7('0x15')](function(_0x2e8b3b){_0x2ac901=_0x2e8b3b;logger[_0xb3c7('0x16')]('The\x20Enduser\x20ID\x20is:',_0x2ac901['id']);return getTicket(_0x495b76,_0x416ca6,_0x2ac901,_0x42c10e,_0x330e37);})[_0xb3c7('0x15')](function(_0x4a4ccd){if(_0x4a4ccd){logger['info']('The\x20Ticket\x20ID\x20is:',_0x4a4ccd['id']);}})[_0xb3c7('0x5c')](function(_0x5e0ebe){logger[_0xb3c7('0x5b')](_0xb3c7('0x6a'),util['inspect'](_0x5e0ebe,{'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 09e6f01..e81a14e 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 _0xcef4=['https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','nothing','contact','lead','Leads','Creating\x20new\x20call...','Owner','Subject','getString','Description','Descriptions','Contacts','Who_Id','First_Name','Last_Name','What_Id','$se_module','talktime','Call_Duration','format','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Called','complete','Answered','rejected','Call_Result','abandoned','Abandoned','outbound','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','err','queue','stripTrailingSlash','host','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','[QUEUE]','recordingFormat','/api/voice/recordings/','destcalleridname','destcalleridnum','Outbound','[OUTBOUND]','[ABANDONED]','calleridnum','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','util','./util','ioredis','bluebird','../../../../config/environment','../../../../config/logger','zoho','redis','defaults','localhost','socket.io-emitter','emit','length','forEach','type','string','idField','toString','variableName','Variable','name','toLowerCase','indexOf','split','isNil','access_token','isBefore','zone','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','then','add','expires_in','seconds','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','email','Agent\x20found!','findIndex','Administrator','user','profile','Using\x20the\x20admin\x20account!','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','stringify','data','enduserType','/crm/v2/','role','first_name','last_name','SUCCESS','details','startCase','moduleCreate','Error:\x20','log','contact_lead','uri'];(function(_0x493b8f,_0x319487){var _0x400837=function(_0x5df6f0){while(--_0x5df6f0){_0x493b8f['push'](_0x493b8f['shift']());}};_0x400837(++_0x319487);}(_0xcef4,0xda));var _0x4cef=function(_0x510c60,_0x50247e){_0x510c60=_0x510c60-0x0;var _0x49c4aa=_0xcef4[_0x510c60];return _0x49c4aa;};'use strict';var _=require(_0x4cef('0x0'));var rp=require(_0x4cef('0x1'));var md5=require(_0x4cef('0x2'));var util=require(_0x4cef('0x3'));var intUtil=require(_0x4cef('0x4'));var moment=require('moment');var Redis=require(_0x4cef('0x5'));var BPromise=require(_0x4cef('0x6'));var config=require(_0x4cef('0x7'));var logger=require(_0x4cef('0x8'))(_0x4cef('0x9'));config[_0x4cef('0xa')]=_[_0x4cef('0xb')](config[_0x4cef('0xa')],{'host':_0x4cef('0xc'),'port':0x18eb});var io=require(_0x4cef('0xd'))(new Redis(config[_0x4cef('0xa')]));function emit(_0x39c427,_0x24390f,_0x50394f){io['to'](_0x39c427)[_0x4cef('0xe')](_0x24390f,_0x50394f);}function request(_0x1cc6e7){logger['debug']('[HTTP]',JSON['stringify'](_0x1cc6e7));return rp(_0x1cc6e7);}function getCustomFields(_0x1759a9,_0x102a70){var _0x177aa4={};if(_0x1759a9[_0x4cef('0xf')]>0x0){_[_0x4cef('0x10')](_0x1759a9,function(_0xa16313){if(_0xa16313[_0x4cef('0x11')]===_0x4cef('0x12')&&_0xa16313[_0x4cef('0x13')]){_0x177aa4[_0xa16313[_0x4cef('0x13')]]=_0xa16313['content'][_0x4cef('0x14')]();}else if(_0xa16313['type']==='variable'&&_0xa16313[_0x4cef('0x15')]&&_0xa16313[_0x4cef('0x13')]&&_0x102a70[_0xa16313['variableName']]){_0x177aa4[_0xa16313[_0x4cef('0x13')]]=_0x102a70[_0xa16313['variableName']][_0x4cef('0x14')]();}else if(_0xa16313[_0x4cef('0x11')]==='customVariable'&&_0xa16313[_0x4cef('0x16')]&&_0xa16313['Variable'][_0x4cef('0x17')]&&_0xa16313['idField']&&_0x102a70[_0xa16313[_0x4cef('0x16')]['name'][_0x4cef('0x18')]()]){_0x177aa4[_0xa16313['idField']]=_0x102a70[_0xa16313[_0x4cef('0x16')][_0x4cef('0x17')][_0x4cef('0x18')]()][_0x4cef('0x14')]();}});}return _0x177aa4;}function getName(_0x1d8740){if(_0x1d8740[_0x4cef('0x19')]('\x20')>0x0){var _0x1e5895=_0x1d8740[_0x4cef('0x1a')](/ (.+)/);if(_0x1e5895[0x1]){return _0x1e5895;}}return[_0x1d8740,_0x1d8740];}var accountsTokens={};function getAccessToken(_0x324eeb){return new Promise(function(_0x13821b,_0x269605){if(!_[_0x4cef('0x1b')](accountsTokens[_0x324eeb['id']])&&!_[_0x4cef('0x1b')](accountsTokens[_0x324eeb['id']][_0x4cef('0x1c')])){if(moment()[_0x4cef('0x1d')](accountsTokens[_0x324eeb['id']]['expires_in'])){_0x13821b(accountsTokens[_0x324eeb['id']]['access_token']);}}var _0x4e0034;switch(_0x324eeb[_0x4cef('0x1e')]){case'US':_0x4e0034='https://accounts.zoho.com';break;case'AU':_0x4e0034='https://accounts.zoho.com.au';break;case'EU':_0x4e0034=_0x4cef('0x1f');break;case'IN':_0x4e0034=_0x4cef('0x20');break;case'CN':_0x4e0034=_0x4cef('0x21');break;default:_0x4e0034='https://accounts.zoho.eu';break;}var _0x2c6f9={'method':_0x4cef('0x22'),'uri':_0x4e0034+_0x4cef('0x23'),'qs':{'refresh_token':_0x324eeb['refreshToken'],'client_id':_0x324eeb[_0x4cef('0x24')],'client_secret':_0x324eeb[_0x4cef('0x25')],'grant_type':_0x4cef('0x26')},'json':!![]};return rp(_0x2c6f9)[_0x4cef('0x27')](function(_0x3a071b){accountsTokens[_0x324eeb['id']]={'access_token':_0x3a071b[_0x4cef('0x1c')],'expires_in':moment()[_0x4cef('0x28')](_0x3a071b[_0x4cef('0x29')],_0x4cef('0x2a'))};_0x13821b(_0x3a071b['access_token']);})[_0x4cef('0x2b')](function(_0x1ce2bb){logger[_0x4cef('0x2c')](_0x4cef('0x2d'),_0x1ce2bb[_0x4cef('0x2e')]);_0x269605(_0x1ce2bb);});});}function getUser(_0xbbcc0d,_0x253dd6,_0x5238c5,_0x43c1ce){logger[_0x4cef('0x2f')](_0x4cef('0x30'));return request({'method':_0x4cef('0x31'),'uri':util['format'](_0x4cef('0x32'),_0x253dd6),'qs':{'type':_0x4cef('0x33')},'headers':{'Authorization':_0x4cef('0x34')+_0xbbcc0d},'json':!![]})[_0x4cef('0x27')](function(_0x3af6e9){if(_0x3af6e9[_0x4cef('0x35')]){var _0x293649=-0x1;if(_['isArrayLikeObject'](_0x3af6e9[_0x4cef('0x35')])){if(!_[_0x4cef('0x1b')](_0x43c1ce)){_0x293649=_['findIndex'](_0x3af6e9['users'],function(_0x514473){return _0x514473[_0x4cef('0x36')]===_0x43c1ce;});}if(_0x293649>=0x0){logger[_0x4cef('0x2f')](_0x4cef('0x37'));}else{logger[_0x4cef('0x2f')]('Using\x20the\x20admin\x20account!');_0x293649=_[_0x4cef('0x38')](_0x3af6e9[_0x4cef('0x35')],function(_0x1b7995){return _0x1b7995['profile']['name']===_0x4cef('0x39');});}return _0x3af6e9[_0x4cef('0x35')][_0x293649];}else{if(_0x3af6e9[_0x4cef('0x3a')][_0x4cef('0x3b')][_0x4cef('0x17')]==='Administrator'){logger[_0x4cef('0x2f')](_0x4cef('0x3c'));user=_0x3af6e9['user'];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON['stringify'](_0x3af6e9));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON['stringify'](_0x3af6e9));}}}else{logger[_0x4cef('0x2c')](_0x4cef('0x3d'),JSON['stringify'](_0x3af6e9));throw new Error(_0x4cef('0x3e')+JSON[_0x4cef('0x3f')](_0x3af6e9));}})['catch'](function(_0x41a65b){console[_0x4cef('0x2c')](_0x41a65b);});}function getZohoUser(_0xc62bf5,_0x5f4673){return new BPromise(function(_0x5e9680,_0x3debf7){request(_0xc62bf5)['then'](function(_0x841970){var _0x669f52=null;if(_0x841970){_0x669f52=_0x841970[_0x4cef('0x40')][0x0];_0x669f52[_0x4cef('0x41')]=_0x5f4673;}_0x5e9680(_0x669f52);})[_0x4cef('0x2b')](function(_0xccaa22){_0x3debf7(_0xccaa22);});});}function createEndUser(_0xb687e3,_0x33f15d,_0x48851b,_0x30fb10,_0xef2934,_0x497571){var _0x48851b=getName(_0x48851b);return request({'method':_0x4cef('0x22'),'uri':'https://www.zohoapis.'+_0x33f15d+_0x4cef('0x42')+_['startCase'](_0x497571['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x48851b[0x1],'First_Name':_0x48851b[0x0],'Phone':_0x30fb10,'Owner':{'name':!_[_0x4cef('0x1b')](_0xef2934[_0x4cef('0x43')][_0x4cef('0x17')])?_0xef2934['role'][_0x4cef('0x17')]:!_['isNil'](_0xef2934[_0x4cef('0x44')])?_0xef2934[_0x4cef('0x44')]+'\x20'+_0xef2934[_0x4cef('0x45')]:_0xef2934['last_name'],'id':_0xef2934['id']}}]},'headers':{'Authorization':_0x4cef('0x34')+_0xb687e3},'json':!![]})[_0x4cef('0x27')](function(_0x28fd5d){if(_0x28fd5d&&_0x28fd5d[_0x4cef('0x40')][0x0]['code']===_0x4cef('0x46')){var _0x3231d8=_0x28fd5d[_0x4cef('0x40')][0x0][_0x4cef('0x47')];_0x3231d8[_0x4cef('0x41')]=_[_0x4cef('0x48')](_0x497571[_0x4cef('0x49')])+'s';return _0x3231d8;}logger['error'](_0x4cef('0x3d'),JSON['stringify'](data));throw new Error(_0x4cef('0x4a')+JSON['stringify'](data));})[_0x4cef('0x2b')](function(_0x4eddd3){console[_0x4cef('0x4b')]('CREATE\x20ERROR',_0x4eddd3);});}function getEndUser(_0x1f714c,_0x6703a6,_0x4c646e,_0x167912,_0x277bbf,_0x3b94e2,_0x205f51){var _0x11b3cb={'method':_0x4cef('0x31'),'uri':'','headers':{'Authorization':_0x4cef('0x34')+_0x1f714c},'json':!![]};switch(_0x205f51['moduleSearch']){case _0x4cef('0x4c'):_0x11b3cb[_0x4cef('0x4d')]=_0x4cef('0x4e')+_0x6703a6+_0x4cef('0x4f')+_0x277bbf+'))';return getZohoUser(_0x11b3cb,'Contacts')[_0x4cef('0x27')](function(_0x47eb4b){if(_0x47eb4b)return _0x47eb4b;_0x11b3cb[_0x4cef('0x4d')]=_0x4cef('0x4e')+_0x6703a6+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x277bbf+'))';return getZohoUser(_0x11b3cb,'Leads')[_0x4cef('0x27')](function(_0x54547a){if(_0x54547a)return _0x54547a;if(_0x205f51['moduleCreate']!=_0x4cef('0x50')){return createEndUser(_0x1f714c,_0x6703a6,_0x167912,_0x277bbf,_0x3b94e2,_0x205f51);}else{return{};}});});break;case _0x4cef('0x51'):_0x11b3cb[_0x4cef('0x4d')]=_0x4cef('0x4e')+_0x6703a6+_0x4cef('0x4f')+_0x277bbf+'))';return getZohoUser(_0x11b3cb,'Contacts')[_0x4cef('0x27')](function(_0x597230){if(_0x597230)return _0x597230;if(_0x205f51[_0x4cef('0x49')]!=_0x4cef('0x50')){return createEndUser(_0x1f714c,_0x6703a6,_0x167912,_0x277bbf,_0x3b94e2,_0x205f51);}else{return{};}});break;case _0x4cef('0x52'):_0x11b3cb[_0x4cef('0x4d')]=_0x4cef('0x4e')+_0x6703a6+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x277bbf+'))';return getZohoUser(_0x11b3cb,_0x4cef('0x53'))['then'](function(_0x2d92a4){if(_0x2d92a4)return _0x2d92a4;if(_0x205f51['moduleCreate']!='nothing'){return createEndUser(_0x1f714c,_0x6703a6,_0x167912,_0x277bbf,_0x3b94e2,_0x205f51);}else{return{};}});break;}}function getCall(_0x2d741e,_0x55aa42,_0x25ba8f,_0x16074f,_0x52b062,_0x1bd373,_0x4489de,_0x112212){logger[_0x4cef('0x2f')](_0x4cef('0x54'));var _0x769a38={};_0x769a38[_0x4cef('0x55')]={'name':!_['isNil'](_0x16074f[_0x4cef('0x43')][_0x4cef('0x17')])&&!_[_0x4cef('0x1b')](_0x16074f[_0x4cef('0x3b')]['name'])&&_0x16074f[_0x4cef('0x3b')][_0x4cef('0x17')]==='administrator'?_0x16074f[_0x4cef('0x43')][_0x4cef('0x17')]:!_[_0x4cef('0x1b')](_0x16074f[_0x4cef('0x44')])?_0x16074f['first_name']+'\x20'+_0x16074f[_0x4cef('0x45')]:_0x16074f[_0x4cef('0x45')],'id':_0x16074f['id']};_0x769a38[_0x4cef('0x56')]=intUtil[_0x4cef('0x57')](_0x1bd373['Subjects'],_0x4489de,'\x20');_0x769a38[_0x4cef('0x58')]=intUtil[_0x4cef('0x57')](_0x1bd373[_0x4cef('0x59')],_0x4489de,'\x0a');if(_0x52b062[_0x4cef('0x41')]===_0x4cef('0x5a')){_0x769a38[_0x4cef('0x5b')]={'name':!_[_0x4cef('0x1b')](_0x52b062['Full_Name'])?_0x52b062['Full_Name']:!_[_0x4cef('0x1b')](_0x52b062[_0x4cef('0x5c')])?_0x52b062[_0x4cef('0x5c')]+'\x20'+_0x52b062[_0x4cef('0x5d')]:_0x52b062[_0x4cef('0x5d')],'id':_0x52b062['id']};}if(_0x52b062[_0x4cef('0x41')]===_0x4cef('0x53')){_0x769a38[_0x4cef('0x5e')]={'name':!_[_0x4cef('0x1b')](_0x52b062['Full_Name'])?_0x52b062['Full_Name']:!_['isNil'](_0x52b062[_0x4cef('0x5c')])?_0x52b062[_0x4cef('0x5c')]+'\x20'+_0x52b062[_0x4cef('0x5d')]:_0x52b062[_0x4cef('0x5d')],'id':_0x52b062['id']};_0x769a38[_0x4cef('0x5f')]=_[_0x4cef('0x48')](_0x52b062['enduserType']);}if(_0x4489de[_0x4cef('0x60')]){_0x769a38[_0x4cef('0x61')]=moment['utc'](parseInt(_0x4489de[_0x4cef('0x60')])*0x3e8)[_0x4cef('0x62')](_0x4cef('0x63'));}else if(_0x4489de[_0x4cef('0x64')]&&_0x4489de[_0x4cef('0x65')]){_0x769a38['Call_Duration']=moment['utc'](moment(_0x4489de['endtime'],_0x4cef('0x66'))[_0x4cef('0x67')](moment(_0x4489de[_0x4cef('0x68')],_0x4cef('0x66'))))['format'](_0x4cef('0x63'));}switch(_0x4489de[_0x4cef('0x69')]){case'called':_0x769a38['Call_Result']=_0x4cef('0x6a');break;case _0x4cef('0x6b'):case'connect':_0x769a38['Call_Result']=_0x4cef('0x6c');break;case _0x4cef('0x6d'):_0x769a38[_0x4cef('0x6e')]='Rejected';break;case _0x4cef('0x6f'):_0x769a38[_0x4cef('0x6e')]=_0x4cef('0x70');break;default:}_0x769a38['Call_Start_Time']=(_0x112212===_0x4cef('0x71')?moment(_0x4489de[_0x4cef('0x68')])[_0x4cef('0x62')](_0x4cef('0x66')):moment(_0x4489de['agentcalledAt'])['format'](_0x4cef('0x66')))||moment()[_0x4cef('0x62')](_0x4cef('0x66'));_0x769a38[_0x4cef('0x72')]=_0x112212||_0x4cef('0x73');_0x769a38=_[_0x4cef('0x74')](_0x769a38,getCustomFields(_0x1bd373[_0x4cef('0x75')],_0x4489de));return request({'method':'POST','uri':_0x4cef('0x4e')+_0x55aa42+_0x4cef('0x76'),'headers':{'Authorization':_0x4cef('0x34')+_0x2d741e},'body':{'data':[_0x769a38]},'json':!![]})[_0x4cef('0x27')](function(_0x4472c2){if(_0x4472c2&&_0x4472c2[_0x4cef('0x40')][0x0]['code']===_0x4cef('0x46')){logger[_0x4cef('0x2f')]('Call\x20created!');return{'id':_0x4472c2['data'][0x0][_0x4cef('0x47')]['id']};}})[_0x4cef('0x2b')](function(_0x3d3918){logger[_0x4cef('0x2f')](_0x4cef('0x77'),_0x3d3918[_0x4cef('0x2e')]);console[_0x4cef('0x4b')]('err',_0x3d3918);});}exports[_0x4cef('0x78')]=function(_0x59afab,_0x5250fc,_0x22ebe9,_0x264a5c,_0x1d211f,_0x2cd579){var _0xda90d5,_0x1be335,_0x4212a2;_0x2cd579['host']=intUtil[_0x4cef('0x79')](_0x2cd579[_0x4cef('0x7a')]);_0x2cd579[_0x4cef('0x7b')]=intUtil['stripTrailingSlash'](_0x2cd579[_0x4cef('0x7b')]);if(_0x1d211f&&_0x1d211f[_0x4cef('0x7c')]){logger['info']('[QUEUE]',_0x4cef('0x7d'));_0x5250fc[_0x4cef('0x7e')]=_0x2cd579[_0x4cef('0x7b')]+'/api/voice/recordings/'+_0x5250fc[_0x4cef('0x7f')]+_0x4cef('0x80')+md5(_0x5250fc[_0x4cef('0x7f')]);}else{_0x5250fc[_0x4cef('0x7e')]='';}var _0x19a1ba=_0x2cd579[_0x4cef('0x7a')]===_0x4cef('0x81')?'eu':_0x4cef('0x82');return getAccessToken(_0x2cd579)[_0x4cef('0x27')](function(_0x3134f8){_0x4212a2=_0x3134f8;return getUser(_0x4212a2,_0x19a1ba,_0x2cd579,_0x264a5c[_0x4cef('0x36')]);})['then'](function(_0x10a140){_0xda90d5=_0x10a140;logger[_0x4cef('0x2f')](_0x4cef('0x83'),_0xda90d5['id']);return getEndUser(_0x4212a2,_0x19a1ba,_0x2cd579,_0x5250fc[_0x4cef('0x84')],_0x5250fc['calleridnum'],_0xda90d5,_0x22ebe9);})[_0x4cef('0x27')](function(_0x38aba1){_0x1be335=_0x38aba1;return getCall(_0x4212a2,_0x19a1ba,_0x2cd579,_0xda90d5,_0x1be335,_0x22ebe9,_0x5250fc,'Inbound');})[_0x4cef('0x27')](function(_0x339b76){if(_0x339b76){logger[_0x4cef('0x2f')]('The\x20Call\x20ID\x20is:',_0x339b76['id']);logger[_0x4cef('0x2f')]('[QUEUE]',_0x4cef('0x85'));emit(util[_0x4cef('0x62')](_0x4cef('0x86'),_0x264a5c[_0x4cef('0x17')]),_0x4cef('0x87'),{'uri':_0x4cef('0x88')+_0x2cd579[_0x4cef('0x7a')]+_0x4cef('0x89')+_0x339b76['id']});}})[_0x4cef('0x2b')](function(_0x3f473a){logger[_0x4cef('0x2c')](_0x4cef('0x8a'),JSON[_0x4cef('0x3f')](_0x3f473a));});};exports[_0x4cef('0x71')]=function(_0x226475,_0x4cf15a,_0x427a95,_0x200e05,_0xb9e7c9,_0x8264f8,_0xa29dd0){var _0x562f8b,_0x2ff588,_0x3961ed;_0x8264f8['host']=intUtil[_0x4cef('0x79')](_0x8264f8[_0x4cef('0x7a')]);_0x8264f8[_0x4cef('0x7b')]=intUtil[_0x4cef('0x79')](_0x8264f8[_0x4cef('0x7b')]);if(_0xa29dd0&&_0xa29dd0[_0x4cef('0x8b')]&&_0xa29dd0[_0x4cef('0x8b')]!=='none'){logger[_0x4cef('0x2f')]('[OUTBOUND]',_0x4cef('0x7d'));_0x4cf15a[_0x4cef('0x7e')]=_0x8264f8['serverUrl']+_0x4cef('0x8c')+_0x4cf15a['uniqueid']+_0x4cef('0x80')+md5(_0x4cf15a[_0x4cef('0x7f')]);}var _0x3b5577=_0x8264f8['host']===_0x4cef('0x81')?'eu':'com';return getAccessToken(_0x8264f8)[_0x4cef('0x27')](function(_0x1123d){_0x3961ed=_0x1123d;return getUser(_0x3961ed,_0x3b5577,_0x8264f8,_0x200e05[_0x4cef('0x36')]);})[_0x4cef('0x27')](function(_0x3e8ae3){_0x562f8b=_0x3e8ae3;logger[_0x4cef('0x2f')](_0x4cef('0x83'),_0x562f8b['id']);return getEndUser(_0x3961ed,_0x3b5577,_0x8264f8,_0x4cf15a[_0x4cef('0x8d')],_0x4cf15a[_0x4cef('0x8e')],_0x562f8b,_0x427a95);})['then'](function(_0x3a8d93){_0x2ff588=_0x3a8d93;return getCall(_0x3961ed,_0x3b5577,_0x8264f8,_0x562f8b,_0x2ff588,_0x427a95,_0x4cf15a,_0x4cef('0x8f'));})[_0x4cef('0x27')](function(_0x599e1d){if(_0x599e1d){logger[_0x4cef('0x2f')]('The\x20Call\x20ID\x20is:',_0x599e1d['id']);logger['info'](_0x4cef('0x90'),_0x4cef('0x85'));emit(util[_0x4cef('0x62')](_0x4cef('0x86'),_0x200e05['name']),_0x4cef('0x87'),{'uri':'https://crm.'+_0x8264f8[_0x4cef('0x7a')]+'/crm/EntityInfo.do?module=Calls&id='+_0x599e1d['id']});}})['catch'](function(_0x450c4f){logger[_0x4cef('0x2c')](_0x4cef('0x90'),JSON['stringify'](_0x450c4f));});};exports[_0x4cef('0x6f')]=function(_0x12cdf9,_0x348aa6,_0x2edff8,_0x586270,_0xb1a134,_0x63eb43){var _0x55405e,_0x4eb4f9,_0x4ecf0f;_0x63eb43[_0x4cef('0x7a')]=intUtil[_0x4cef('0x79')](_0x63eb43['host']);_0x63eb43['serverUrl']=intUtil[_0x4cef('0x79')](_0x63eb43[_0x4cef('0x7b')]);if(_0xb1a134&&_0xb1a134['monitor_format']){logger[_0x4cef('0x2f')](_0x4cef('0x91'),'Recording\x20is\x20enabled!');_0x348aa6[_0x4cef('0x7e')]=_0x63eb43[_0x4cef('0x7b')]+_0x4cef('0x8c')+_0x348aa6[_0x4cef('0x7f')]+'/downloads?type=uniqueid&token='+md5(_0x348aa6[_0x4cef('0x7f')]);}else{_0x348aa6[_0x4cef('0x7e')]='';}var _0x2b0a89=_0x63eb43['host']===_0x4cef('0x81')?'eu':_0x4cef('0x82');return getAccessToken(_0x63eb43)[_0x4cef('0x27')](function(_0x311438){_0x4ecf0f=_0x311438;return getUser(_0x4ecf0f,_0x2b0a89,_0x63eb43);})['then'](function(_0x5eb1e5){_0x55405e=_0x5eb1e5;logger[_0x4cef('0x2f')]('The\x20User\x20ID\x20is:',_0x55405e['id']);return getEndUser(_0x4ecf0f,_0x2b0a89,_0x63eb43,_0x348aa6[_0x4cef('0x84')],_0x348aa6[_0x4cef('0x92')],_0x55405e,_0x2edff8);})[_0x4cef('0x27')](function(_0x262481){_0x4eb4f9=_0x262481;return getCall(_0x4ecf0f,_0x2b0a89,_0x63eb43,_0x55405e,_0x4eb4f9,_0x2edff8,_0x348aa6,_0x4cef('0x73'));})[_0x4cef('0x27')](function(_0x567653){if(_0x567653){logger['info'](_0x4cef('0x93'),_0x567653['id']);}})['catch'](function(_0x1df0b5){logger[_0x4cef('0x2c')](_0x4cef('0x91'),JSON[_0x4cef('0x3f')](_0x1df0b5));});}; \ No newline at end of file +var _0x56ba=['Agent\x20found!','info','Using\x20the\x20admin\x20account!','profile','user','Administrator','error','The\x20failing\x20result\x20is','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','data','/crm/v2/','startCase','role','first_name','last_name','code','details','enduserType','moduleCreate','Error:\x20','log','contact_lead','uri','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','Contacts','/crm/v2/Leads/search?criteria=((Phone:equals:','Leads','nothing','contact','lead','Owner','administrator','getString','Description','Full_Name','Last_Name','What_Id','First_Name','$se_module','talktime','utc','format','mm:ss','Call_Duration','endtime','diff','starttime','YYYY-MM-DDTHH:mm:ss','called','Call_Result','complete','Answered','rejected','Rejected','abandoned','agentcalledAt','Call_Type','Inbound','merge','Fields','/crm/v2/Calls','SUCCESS','Call\x20created!','err','queue','host','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','The\x20User\x20ID\x20is:','calleridname','calleridnum','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://crm.','/crm/EntityInfo.do?module=Calls&id=','outbound','stripTrailingSlash','recordingFormat','none','[OUTBOUND]','destcalleridname','destcalleridnum','[ABANDONED]','The\x20Call\x20ID\x20is:','lodash','request-promise','md5','./util','moment','ioredis','../../../../config/environment','../../../../config/logger','zoho','defaults','localhost','socket.io-emitter','emit','debug','stringify','length','forEach','type','idField','content','variable','variableName','toString','customVariable','Variable','name','toLowerCase','split','isNil','access_token','isBefore','expires_in','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','refreshToken','then','catch','stack','GET','ActiveUsers','Zoho-oauthtoken\x20','isArrayLikeObject','users','findIndex','email'];(function(_0x8db75c,_0x557254){var _0x42bae1=function(_0x5ed686){while(--_0x5ed686){_0x8db75c['push'](_0x8db75c['shift']());}};_0x42bae1(++_0x557254);}(_0x56ba,0xeb));var _0xa56b=function(_0x367861,_0x4622ea){_0x367861=_0x367861-0x0;var _0x5e7614=_0x56ba[_0x367861];return _0x5e7614;};'use strict';var _=require(_0xa56b('0x0'));var rp=require(_0xa56b('0x1'));var md5=require(_0xa56b('0x2'));var util=require('util');var intUtil=require(_0xa56b('0x3'));var moment=require(_0xa56b('0x4'));var Redis=require(_0xa56b('0x5'));var BPromise=require('bluebird');var config=require(_0xa56b('0x6'));var logger=require(_0xa56b('0x7'))(_0xa56b('0x8'));config['redis']=_[_0xa56b('0x9')](config['redis'],{'host':_0xa56b('0xa'),'port':0x18eb});var io=require(_0xa56b('0xb'))(new Redis(config['redis']));function emit(_0x1b629b,_0x568c99,_0xde970c){io['to'](_0x1b629b)[_0xa56b('0xc')](_0x568c99,_0xde970c);}function request(_0x58694b){logger[_0xa56b('0xd')]('[HTTP]',JSON[_0xa56b('0xe')](_0x58694b));return rp(_0x58694b);}function getCustomFields(_0x196361,_0xd29ac){var _0x13518d={};if(_0x196361[_0xa56b('0xf')]>0x0){_[_0xa56b('0x10')](_0x196361,function(_0x38341){if(_0x38341[_0xa56b('0x11')]==='string'&&_0x38341['idField']){_0x13518d[_0x38341[_0xa56b('0x12')]]=_0x38341[_0xa56b('0x13')]['toString']();}else if(_0x38341['type']===_0xa56b('0x14')&&_0x38341['variableName']&&_0x38341[_0xa56b('0x12')]&&_0xd29ac[_0x38341[_0xa56b('0x15')]]){_0x13518d[_0x38341[_0xa56b('0x12')]]=_0xd29ac[_0x38341[_0xa56b('0x15')]][_0xa56b('0x16')]();}else if(_0x38341['type']===_0xa56b('0x17')&&_0x38341['Variable']&&_0x38341[_0xa56b('0x18')][_0xa56b('0x19')]&&_0x38341['idField']&&_0xd29ac[_0x38341['Variable'][_0xa56b('0x19')][_0xa56b('0x1a')]()]){_0x13518d[_0x38341[_0xa56b('0x12')]]=_0xd29ac[_0x38341[_0xa56b('0x18')][_0xa56b('0x19')][_0xa56b('0x1a')]()][_0xa56b('0x16')]();}});}return _0x13518d;}function getName(_0x1c768a){if(_0x1c768a['indexOf']('\x20')>0x0){var _0x140ec3=_0x1c768a[_0xa56b('0x1b')](/ (.+)/);if(_0x140ec3[0x1]){return _0x140ec3;}}return[_0x1c768a,_0x1c768a];}var accountsTokens={};function getAccessToken(_0x1d3d60){return new Promise(function(_0xa4c0c3,_0x4d7059){if(!_['isNil'](accountsTokens[_0x1d3d60['id']])&&!_[_0xa56b('0x1c')](accountsTokens[_0x1d3d60['id']][_0xa56b('0x1d')])){if(moment()[_0xa56b('0x1e')](accountsTokens[_0x1d3d60['id']][_0xa56b('0x1f')])){_0xa4c0c3(accountsTokens[_0x1d3d60['id']]['access_token']);}}var _0x3a6372;switch(_0x1d3d60[_0xa56b('0x20')]){case'US':_0x3a6372='https://accounts.zoho.com';break;case'AU':_0x3a6372=_0xa56b('0x21');break;case'EU':_0x3a6372=_0xa56b('0x22');break;case'IN':_0x3a6372='https://accounts.zoho.in';break;case'CN':_0x3a6372='https://accounts.zoho.com.cn';break;default:_0x3a6372=_0xa56b('0x22');break;}var _0xee2aa7={'method':_0xa56b('0x23'),'uri':_0x3a6372+'/oauth/v2/token','qs':{'refresh_token':_0x1d3d60[_0xa56b('0x24')],'client_id':_0x1d3d60['clientId'],'client_secret':_0x1d3d60['clientSecret'],'grant_type':'refresh_token'},'json':!![]};return rp(_0xee2aa7)[_0xa56b('0x25')](function(_0x41f1d4){accountsTokens[_0x1d3d60['id']]={'access_token':_0x41f1d4['access_token'],'expires_in':moment()['add'](_0x41f1d4[_0xa56b('0x1f')],'seconds')};_0xa4c0c3(_0x41f1d4[_0xa56b('0x1d')]);})[_0xa56b('0x26')](function(_0xad4125){logger['error']('Failing\x20creating\x20the\x20access_token',_0xad4125[_0xa56b('0x27')]);_0x4d7059(_0xad4125);});});}function getUser(_0x3ddb9f,_0x405d38,_0x5b87d0,_0x3394de){logger['info']('Search\x20user');return request({'method':_0xa56b('0x28'),'uri':util['format']('https://www.zohoapis.%s/crm/v2/users',_0x405d38),'qs':{'type':_0xa56b('0x29')},'headers':{'Authorization':_0xa56b('0x2a')+_0x3ddb9f},'json':!![]})[_0xa56b('0x25')](function(_0x3b54f9){if(_0x3b54f9['users']){var _0x5298e9=-0x1;if(_[_0xa56b('0x2b')](_0x3b54f9[_0xa56b('0x2c')])){if(!_[_0xa56b('0x1c')](_0x3394de)){_0x5298e9=_[_0xa56b('0x2d')](_0x3b54f9[_0xa56b('0x2c')],function(_0x4e1b2a){return _0x4e1b2a[_0xa56b('0x2e')]===_0x3394de;});}if(_0x5298e9>=0x0){logger['info'](_0xa56b('0x2f'));}else{logger[_0xa56b('0x30')](_0xa56b('0x31'));_0x5298e9=_[_0xa56b('0x2d')](_0x3b54f9[_0xa56b('0x2c')],function(_0x33db19){return _0x33db19[_0xa56b('0x32')]['name']==='Administrator';});}return _0x3b54f9[_0xa56b('0x2c')][_0x5298e9];}else{if(_0x3b54f9[_0xa56b('0x33')][_0xa56b('0x32')]['name']===_0xa56b('0x34')){logger[_0xa56b('0x30')](_0xa56b('0x31'));user=_0x3b54f9[_0xa56b('0x33')];return user;}else{logger[_0xa56b('0x35')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x3b54f9));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xa56b('0xe')](_0x3b54f9));}}}else{logger[_0xa56b('0x35')](_0xa56b('0x36'),JSON[_0xa56b('0xe')](_0x3b54f9));throw new Error(_0xa56b('0x37')+JSON['stringify'](_0x3b54f9));}})['catch'](function(_0x2a615f){console['error'](_0x2a615f);});}function getZohoUser(_0x4eb855,_0x1200fd){return new BPromise(function(_0x412430,_0x3e6d27){request(_0x4eb855)['then'](function(_0x4e44d4){var _0x42392e=null;if(_0x4e44d4){_0x42392e=_0x4e44d4[_0xa56b('0x38')][0x0];_0x42392e['enduserType']=_0x1200fd;}_0x412430(_0x42392e);})[_0xa56b('0x26')](function(_0x544569){_0x3e6d27(_0x544569);});});}function createEndUser(_0x4d0c5f,_0x2b0973,_0x1d2c03,_0x26acf5,_0x1fb4a7,_0x1c4581){var _0x1d2c03=getName(_0x1d2c03);return request({'method':_0xa56b('0x23'),'uri':'https://www.zohoapis.'+_0x2b0973+_0xa56b('0x39')+_[_0xa56b('0x3a')](_0x1c4581['moduleCreate'])+'s','body':{'data':[{'Last_Name':_0x1d2c03[0x1],'First_Name':_0x1d2c03[0x0],'Phone':_0x26acf5,'Owner':{'name':!_[_0xa56b('0x1c')](_0x1fb4a7[_0xa56b('0x3b')]['name'])?_0x1fb4a7[_0xa56b('0x3b')][_0xa56b('0x19')]:!_['isNil'](_0x1fb4a7[_0xa56b('0x3c')])?_0x1fb4a7[_0xa56b('0x3c')]+'\x20'+_0x1fb4a7[_0xa56b('0x3d')]:_0x1fb4a7[_0xa56b('0x3d')],'id':_0x1fb4a7['id']}}]},'headers':{'Authorization':_0xa56b('0x2a')+_0x4d0c5f},'json':!![]})['then'](function(_0xb3a9b7){if(_0xb3a9b7&&_0xb3a9b7['data'][0x0][_0xa56b('0x3e')]==='SUCCESS'){var _0x57448e=_0xb3a9b7[_0xa56b('0x38')][0x0][_0xa56b('0x3f')];_0x57448e[_0xa56b('0x40')]=_['startCase'](_0x1c4581[_0xa56b('0x41')])+'s';return _0x57448e;}logger[_0xa56b('0x35')](_0xa56b('0x36'),JSON[_0xa56b('0xe')](data));throw new Error(_0xa56b('0x42')+JSON['stringify'](data));})[_0xa56b('0x26')](function(_0x57fdbf){console[_0xa56b('0x43')]('CREATE\x20ERROR',_0x57fdbf);});}function getEndUser(_0xd383b3,_0x47ae25,_0x27d62b,_0x5a22d4,_0x2ee2af,_0x3c58da,_0x4aa50b){var _0x1e737d={'method':_0xa56b('0x28'),'uri':'','headers':{'Authorization':_0xa56b('0x2a')+_0xd383b3},'json':!![]};switch(_0x4aa50b['moduleSearch']){case _0xa56b('0x44'):_0x1e737d[_0xa56b('0x45')]=_0xa56b('0x46')+_0x47ae25+_0xa56b('0x47')+_0x2ee2af+'))';return getZohoUser(_0x1e737d,_0xa56b('0x48'))[_0xa56b('0x25')](function(_0x28575f){if(_0x28575f)return _0x28575f;_0x1e737d[_0xa56b('0x45')]=_0xa56b('0x46')+_0x47ae25+_0xa56b('0x49')+_0x2ee2af+'))';return getZohoUser(_0x1e737d,_0xa56b('0x4a'))[_0xa56b('0x25')](function(_0x532145){if(_0x532145)return _0x532145;if(_0x4aa50b[_0xa56b('0x41')]!=_0xa56b('0x4b')){return createEndUser(_0xd383b3,_0x47ae25,_0x5a22d4,_0x2ee2af,_0x3c58da,_0x4aa50b);}else{return{};}});});break;case _0xa56b('0x4c'):_0x1e737d[_0xa56b('0x45')]=_0xa56b('0x46')+_0x47ae25+_0xa56b('0x47')+_0x2ee2af+'))';return getZohoUser(_0x1e737d,_0xa56b('0x48'))['then'](function(_0xbbd0da){if(_0xbbd0da)return _0xbbd0da;if(_0x4aa50b['moduleCreate']!='nothing'){return createEndUser(_0xd383b3,_0x47ae25,_0x5a22d4,_0x2ee2af,_0x3c58da,_0x4aa50b);}else{return{};}});break;case _0xa56b('0x4d'):_0x1e737d['uri']=_0xa56b('0x46')+_0x47ae25+_0xa56b('0x49')+_0x2ee2af+'))';return getZohoUser(_0x1e737d,_0xa56b('0x4a'))['then'](function(_0x1b7ff7){if(_0x1b7ff7)return _0x1b7ff7;if(_0x4aa50b[_0xa56b('0x41')]!='nothing'){return createEndUser(_0xd383b3,_0x47ae25,_0x5a22d4,_0x2ee2af,_0x3c58da,_0x4aa50b);}else{return{};}});break;}}function getCall(_0x280db2,_0xd5ee58,_0x4619dc,_0x3ca320,_0x40eefc,_0x2f2d3,_0x4b6f87,_0x4ccc87){logger[_0xa56b('0x30')]('Creating\x20new\x20call...');var _0xe382db={};_0xe382db[_0xa56b('0x4e')]={'name':!_[_0xa56b('0x1c')](_0x3ca320[_0xa56b('0x3b')][_0xa56b('0x19')])&&!_[_0xa56b('0x1c')](_0x3ca320['profile']['name'])&&_0x3ca320[_0xa56b('0x32')][_0xa56b('0x19')]===_0xa56b('0x4f')?_0x3ca320['role']['name']:!_['isNil'](_0x3ca320[_0xa56b('0x3c')])?_0x3ca320[_0xa56b('0x3c')]+'\x20'+_0x3ca320['last_name']:_0x3ca320[_0xa56b('0x3d')],'id':_0x3ca320['id']};_0xe382db['Subject']=intUtil[_0xa56b('0x50')](_0x2f2d3['Subjects'],_0x4b6f87,'\x20');_0xe382db[_0xa56b('0x51')]=intUtil[_0xa56b('0x50')](_0x2f2d3['Descriptions'],_0x4b6f87,'\x0a');if(_0x40eefc[_0xa56b('0x40')]===_0xa56b('0x48')){_0xe382db['Who_Id']={'name':!_[_0xa56b('0x1c')](_0x40eefc[_0xa56b('0x52')])?_0x40eefc[_0xa56b('0x52')]:!_[_0xa56b('0x1c')](_0x40eefc['First_Name'])?_0x40eefc['First_Name']+'\x20'+_0x40eefc['Last_Name']:_0x40eefc[_0xa56b('0x53')],'id':_0x40eefc['id']};}if(_0x40eefc[_0xa56b('0x40')]==='Leads'){_0xe382db[_0xa56b('0x54')]={'name':!_[_0xa56b('0x1c')](_0x40eefc['Full_Name'])?_0x40eefc['Full_Name']:!_[_0xa56b('0x1c')](_0x40eefc[_0xa56b('0x55')])?_0x40eefc['First_Name']+'\x20'+_0x40eefc[_0xa56b('0x53')]:_0x40eefc[_0xa56b('0x53')],'id':_0x40eefc['id']};_0xe382db[_0xa56b('0x56')]=_[_0xa56b('0x3a')](_0x40eefc[_0xa56b('0x40')]);}if(_0x4b6f87[_0xa56b('0x57')]){_0xe382db['Call_Duration']=moment[_0xa56b('0x58')](parseInt(_0x4b6f87[_0xa56b('0x57')])*0x3e8)[_0xa56b('0x59')](_0xa56b('0x5a'));}else if(_0x4b6f87['answertime']&&_0x4b6f87['endtime']){_0xe382db[_0xa56b('0x5b')]=moment[_0xa56b('0x58')](moment(_0x4b6f87[_0xa56b('0x5c')],'YYYY-MM-DDTHH:mm:ss')[_0xa56b('0x5d')](moment(_0x4b6f87[_0xa56b('0x5e')],_0xa56b('0x5f'))))[_0xa56b('0x59')](_0xa56b('0x5a'));}switch(_0x4b6f87['lastevent']){case _0xa56b('0x60'):_0xe382db[_0xa56b('0x61')]='Called';break;case _0xa56b('0x62'):case'connect':_0xe382db[_0xa56b('0x61')]=_0xa56b('0x63');break;case _0xa56b('0x64'):_0xe382db['Call_Result']=_0xa56b('0x65');break;case _0xa56b('0x66'):_0xe382db[_0xa56b('0x61')]='Abandoned';break;default:}_0xe382db['Call_Start_Time']=(_0x4ccc87==='outbound'?moment(_0x4b6f87[_0xa56b('0x5e')])[_0xa56b('0x59')](_0xa56b('0x5f')):moment(_0x4b6f87[_0xa56b('0x67')])['format'](_0xa56b('0x5f')))||moment()[_0xa56b('0x59')](_0xa56b('0x5f'));_0xe382db[_0xa56b('0x68')]=_0x4ccc87||_0xa56b('0x69');_0xe382db=_[_0xa56b('0x6a')](_0xe382db,getCustomFields(_0x2f2d3[_0xa56b('0x6b')],_0x4b6f87));return request({'method':_0xa56b('0x23'),'uri':_0xa56b('0x46')+_0xd5ee58+_0xa56b('0x6c'),'headers':{'Authorization':_0xa56b('0x2a')+_0x280db2},'body':{'data':[_0xe382db]},'json':!![]})[_0xa56b('0x25')](function(_0x1a938f){if(_0x1a938f&&_0x1a938f[_0xa56b('0x38')][0x0][_0xa56b('0x3e')]===_0xa56b('0x6d')){logger['info'](_0xa56b('0x6e'));return{'id':_0x1a938f[_0xa56b('0x38')][0x0][_0xa56b('0x3f')]['id']};}})['catch'](function(_0x3c0182){logger['info'](_0xa56b('0x6f'),_0x3c0182[_0xa56b('0x27')]);console[_0xa56b('0x43')](_0xa56b('0x6f'),_0x3c0182);});}exports[_0xa56b('0x70')]=function(_0x1abd57,_0x33992e,_0x55622a,_0x370c09,_0x31b83d,_0x372acb){var _0x46407b,_0x4fe92a,_0x4aa66b;_0x372acb[_0xa56b('0x71')]=intUtil['stripTrailingSlash'](_0x372acb[_0xa56b('0x71')]);_0x372acb['serverUrl']=intUtil['stripTrailingSlash'](_0x372acb[_0xa56b('0x72')]);if(_0x31b83d&&_0x31b83d[_0xa56b('0x73')]){logger[_0xa56b('0x30')](_0xa56b('0x74'),_0xa56b('0x75'));_0x33992e[_0xa56b('0x76')]=_0x372acb[_0xa56b('0x72')]+_0xa56b('0x77')+_0x33992e[_0xa56b('0x78')]+_0xa56b('0x79')+md5(_0x33992e[_0xa56b('0x78')]);}else{_0x33992e[_0xa56b('0x76')]='';}var _0x4b6cdc=_0x372acb[_0xa56b('0x71')]===_0xa56b('0x7a')?'eu':_0xa56b('0x7b');return getAccessToken(_0x372acb)[_0xa56b('0x25')](function(_0x59cf7d){_0x4aa66b=_0x59cf7d;return getUser(_0x4aa66b,_0x4b6cdc,_0x372acb,_0x370c09[_0xa56b('0x2e')]);})['then'](function(_0x151752){_0x46407b=_0x151752;logger[_0xa56b('0x30')](_0xa56b('0x7c'),_0x46407b['id']);return getEndUser(_0x4aa66b,_0x4b6cdc,_0x372acb,_0x33992e[_0xa56b('0x7d')],_0x33992e[_0xa56b('0x7e')],_0x46407b,_0x55622a);})['then'](function(_0x3d1182){_0x4fe92a=_0x3d1182;return getCall(_0x4aa66b,_0x4b6cdc,_0x372acb,_0x46407b,_0x4fe92a,_0x55622a,_0x33992e,_0xa56b('0x69'));})['then'](function(_0x53d8d5){if(_0x53d8d5){logger[_0xa56b('0x30')]('The\x20Call\x20ID\x20is:',_0x53d8d5['id']);logger[_0xa56b('0x30')](_0xa56b('0x74'),_0xa56b('0x7f'));emit(util['format'](_0xa56b('0x80'),_0x370c09[_0xa56b('0x19')]),_0xa56b('0x81'),{'uri':_0xa56b('0x82')+_0x372acb[_0xa56b('0x71')]+_0xa56b('0x83')+_0x53d8d5['id']});}})[_0xa56b('0x26')](function(_0x4815ba){logger[_0xa56b('0x35')](_0xa56b('0x74'),JSON[_0xa56b('0xe')](_0x4815ba));});};exports[_0xa56b('0x84')]=function(_0xe0bfb8,_0x409f,_0x4c13db,_0xb34400,_0x5c855d,_0x3e3d31,_0x110877){var _0x342732,_0x477efa,_0x12c167;_0x3e3d31[_0xa56b('0x71')]=intUtil[_0xa56b('0x85')](_0x3e3d31[_0xa56b('0x71')]);_0x3e3d31[_0xa56b('0x72')]=intUtil[_0xa56b('0x85')](_0x3e3d31[_0xa56b('0x72')]);if(_0x110877&&_0x110877[_0xa56b('0x86')]&&_0x110877[_0xa56b('0x86')]!==_0xa56b('0x87')){logger[_0xa56b('0x30')](_0xa56b('0x88'),_0xa56b('0x75'));_0x409f[_0xa56b('0x76')]=_0x3e3d31[_0xa56b('0x72')]+_0xa56b('0x77')+_0x409f[_0xa56b('0x78')]+_0xa56b('0x79')+md5(_0x409f[_0xa56b('0x78')]);}var _0x1a3426=_0x3e3d31[_0xa56b('0x71')]===_0xa56b('0x7a')?'eu':_0xa56b('0x7b');return getAccessToken(_0x3e3d31)[_0xa56b('0x25')](function(_0x3986fa){_0x12c167=_0x3986fa;return getUser(_0x12c167,_0x1a3426,_0x3e3d31,_0xb34400[_0xa56b('0x2e')]);})[_0xa56b('0x25')](function(_0xfa56d6){_0x342732=_0xfa56d6;logger[_0xa56b('0x30')](_0xa56b('0x7c'),_0x342732['id']);return getEndUser(_0x12c167,_0x1a3426,_0x3e3d31,_0x409f[_0xa56b('0x89')],_0x409f[_0xa56b('0x8a')],_0x342732,_0x4c13db);})['then'](function(_0x6e2ce7){_0x477efa=_0x6e2ce7;return getCall(_0x12c167,_0x1a3426,_0x3e3d31,_0x342732,_0x477efa,_0x4c13db,_0x409f,'Outbound');})[_0xa56b('0x25')](function(_0x305129){if(_0x305129){logger[_0xa56b('0x30')]('The\x20Call\x20ID\x20is:',_0x305129['id']);logger[_0xa56b('0x30')](_0xa56b('0x88'),_0xa56b('0x7f'));emit(util[_0xa56b('0x59')](_0xa56b('0x80'),_0xb34400['name']),_0xa56b('0x81'),{'uri':_0xa56b('0x82')+_0x3e3d31['host']+_0xa56b('0x83')+_0x305129['id']});}})[_0xa56b('0x26')](function(_0x99123a){logger[_0xa56b('0x35')](_0xa56b('0x88'),JSON[_0xa56b('0xe')](_0x99123a));});};exports['abandoned']=function(_0x51b525,_0x1df6a2,_0x39a60d,_0xec5a2f,_0x457b3b,_0x4cd221){var _0x30d341,_0x4af87a,_0x23523e;_0x4cd221[_0xa56b('0x71')]=intUtil['stripTrailingSlash'](_0x4cd221['host']);_0x4cd221[_0xa56b('0x72')]=intUtil[_0xa56b('0x85')](_0x4cd221[_0xa56b('0x72')]);if(_0x457b3b&&_0x457b3b[_0xa56b('0x73')]){logger[_0xa56b('0x30')](_0xa56b('0x8b'),_0xa56b('0x75'));_0x1df6a2['recordingURL']=_0x4cd221[_0xa56b('0x72')]+_0xa56b('0x77')+_0x1df6a2[_0xa56b('0x78')]+_0xa56b('0x79')+md5(_0x1df6a2['uniqueid']);}else{_0x1df6a2['recordingURL']='';}var _0x455cd2=_0x4cd221[_0xa56b('0x71')]==='zoho.eu'?'eu':_0xa56b('0x7b');return getAccessToken(_0x4cd221)['then'](function(_0x4a88b9){_0x23523e=_0x4a88b9;return getUser(_0x23523e,_0x455cd2,_0x4cd221);})[_0xa56b('0x25')](function(_0x1b9953){_0x30d341=_0x1b9953;logger['info'](_0xa56b('0x7c'),_0x30d341['id']);return getEndUser(_0x23523e,_0x455cd2,_0x4cd221,_0x1df6a2[_0xa56b('0x7d')],_0x1df6a2[_0xa56b('0x7e')],_0x30d341,_0x39a60d);})[_0xa56b('0x25')](function(_0x1e5b7a){_0x4af87a=_0x1e5b7a;return getCall(_0x23523e,_0x455cd2,_0x4cd221,_0x30d341,_0x4af87a,_0x39a60d,_0x1df6a2,'Inbound');})['then'](function(_0x473c28){if(_0x473c28){logger[_0xa56b('0x30')](_0xa56b('0x8c'),_0x473c28['id']);}})[_0xa56b('0x26')](function(_0x15edbe){logger[_0xa56b('0x35')]('[ABANDONED]',JSON[_0xa56b('0xe')](_0x15edbe));});}; \ No newline at end of file diff --git a/server/services/ami/trigger/script/index.js b/server/services/ami/trigger/script/index.js index 01c31e0..3220ae9 100644 --- a/server/services/ami/trigger/script/index.js +++ b/server/services/ami/trigger/script/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0xe711c6,_0x5b77e0){var _0x30d539=function(_0x2630cf){while(--_0x2630cf){_0xe711c6['push'](_0xe711c6['shift']());}};_0x30d539(++_0x5b77e0);}(_0x7a54,0x106));var _0x47a5=function(_0x524cbb,_0x1ec0f3){_0x524cbb=_0x524cbb-0x0;var _0x4674ab=_0x7a54[_0x524cbb];return _0x4674ab;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x2aa87a,_0x18ee0c){var _0x574709=function(_0x334376){while(--_0x334376){_0x2aa87a['push'](_0x2aa87a['shift']());}};_0x574709(++_0x18ee0c);}(_0x7a54,0x106));var _0x47a5=function(_0x21f945,_0x4be1fd){_0x21f945=_0x21f945-0x0;var _0x4e9f0d=_0x7a54[_0x21f945];return _0x4e9f0d;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file diff --git a/server/services/ami/trigger/urlforward/index.js b/server/services/ami/trigger/urlforward/index.js index ce6eb0e..ccd0158 100644 --- a/server/services/ami/trigger/urlforward/index.js +++ b/server/services/ami/trigger/urlforward/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','statusCode','catch','%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s','name','message','request-promise','util'];(function(_0x8c3a5f,_0xa21c72){var _0x2474d4=function(_0x1561a5){while(--_0x1561a5){_0x8c3a5f['push'](_0x8c3a5f['shift']());}};_0x2474d4(++_0xa21c72);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3ff162,_0x5b6fcc){_0x3ff162=_0x3ff162-0x0;var _0x594f81=_0x5f2f[_0x3ff162];return _0x594f81;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0xb10b=['number','headers','data6','parse','error','stack','DELETE','POST','PUT','data7','body','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','data2','stringify','then','isNil',',\x20request\x20body:\x20','object','%s\x20%s\x20succeeded\x20with\x20status:\x20%d\x20and\x20response:\x20%s','data1','statusCode','name','message','request-promise','lodash','mustache','../../../../config/logger','exec','toUpperCase','render','data5'];(function(_0x4cdcca,_0x57ee16){var _0x1309c1=function(_0x3dcde6){while(--_0x3dcde6){_0x4cdcca['push'](_0x4cdcca['shift']());}};_0x1309c1(++_0x57ee16);}(_0xb10b,0x12a));var _0xbb10=function(_0xd333a1,_0x1f61a0){_0xd333a1=_0xd333a1-0x0;var _0x553a60=_0xb10b[_0xd333a1];return _0x553a60;};'use strict';var rp=require(_0xbb10('0x0'));var util=require('util');var _=require(_0xbb10('0x1'));var Mustache=require(_0xbb10('0x2'));var logger=require(_0xbb10('0x3'))('trigger');exports[_0xbb10('0x4')]=function(_0x9bbed,_0x460981){var _0x22320e,_0x49baf4;var _0x312b72={'method':_0x9bbed['data1'][_0xbb10('0x5')](),'uri':Mustache[_0xbb10('0x6')](_0x9bbed['data2'],_0x460981),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x9bbed[_0xbb10('0x7')])===_0xbb10('0x8')&&parseInt(_0x9bbed[_0xbb10('0x7')])>=0x1&&parseInt(_0x9bbed[_0xbb10('0x7')])<=0xa?parseInt(_0x9bbed[_0xbb10('0x7')])*0x3e8:0x5*0x3e8};try{_0x312b72[_0xbb10('0x9')]=_0x9bbed[_0xbb10('0xa')]?JSON[_0xbb10('0xb')](Mustache['render'](_0x9bbed['data6'],_0x460981)):{};}catch(_0x20bd61){logger[_0xbb10('0xc')](_0x20bd61[_0xbb10('0xd')]);}switch(_0x9bbed['data1'][_0xbb10('0x5')]()){case'GET':case _0xbb10('0xe'):_0x22320e=null;_0x312b72['qs']=_0x460981;break;case _0xbb10('0xf'):case _0xbb10('0x10'):if(_0x9bbed[_0xbb10('0x11')]){try{_0x22320e=JSON[_0xbb10('0xb')](Mustache[_0xbb10('0x6')](_0x9bbed['data7'],_0x460981));_0x312b72[_0xbb10('0x12')]=_0x22320e;}catch(_0x42d7e4){logger[_0xbb10('0xc')](_0x42d7e4[_0xbb10('0xd')]);logger[_0xbb10('0xc')](_0xbb10('0x13'));}}else{_0x22320e=_0x460981;_0x312b72[_0xbb10('0x12')]=_0x22320e;}break;}logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x16'),_0x9bbed['data1'],_0x9bbed[_0xbb10('0x17')],JSON[_0xbb10('0x18')](_0x312b72)));rp(_0x312b72)[_0xbb10('0x19')](function(_0x42db98){_0x22320e=!_[_0xbb10('0x1a')](_0x22320e)?_0xbb10('0x1b')+_0x22320e:'';_0x49baf4=typeof _0x42db98[_0xbb10('0x12')]===_0xbb10('0x1c')?JSON[_0xbb10('0x18')](_0x42db98[_0xbb10('0x12')]):_0x42db98['body'];logger[_0xbb10('0x14')](util[_0xbb10('0x15')](_0xbb10('0x1d'),_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x42db98[_0xbb10('0x1f')],_0x49baf4));})['catch'](function(_0x12f888){logger[_0xbb10('0xc')](util['format']('%s\x20%s\x20failed\x20with\x20status:\x20%d\x20and\x20error:\x20%s\x20%s',_0x9bbed[_0xbb10('0x1e')],_0x9bbed[_0xbb10('0x17')],_0x12f888[_0xbb10('0x1f')],_0x12f888[_0xbb10('0x20')],_0x12f888[_0xbb10('0x21')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index cd09f77..e0003e8 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 _0x50b9=['then','debug','rpc','routing','error','message','result','catch','exports','jayson/promise','../../config/logger','client','http','Request','request'];(function(_0x1298aa,_0x50e068){var _0x48cd41=function(_0x2bc6e4){while(--_0x2bc6e4){_0x1298aa['push'](_0x1298aa['shift']());}};_0x48cd41(++_0x50e068);}(_0x50b9,0x171));var _0x950b=function(_0x240c9a,_0x100d6d){_0x240c9a=_0x240c9a-0x0;var _0xb239e9=_0x50b9[_0x240c9a];return _0xb239e9;};'use strict';var jayson=require(_0x950b('0x0'));var BPromise=require('bluebird');var logger=require(_0x950b('0x1'))('routing');var client=jayson[_0x950b('0x2')][_0x950b('0x3')]({'port':0x2329});client[_0x950b('0x4')]=function(_0x3f68be,_0x237b83){return new BPromise(function(_0x986b16,_0x23b70f){return client[_0x950b('0x5')](_0x3f68be,_0x237b83)[_0x950b('0x6')](function(_0x56ce3f){logger[_0x950b('0x7')](_0x950b('0x8'),_0x950b('0x9'),_0x3f68be,_0x237b83,_0x56ce3f);if(_0x56ce3f['error']){logger['error']('rpc',_0x950b('0x9'),_0x3f68be,_0x56ce3f[_0x950b('0xa')][_0x950b('0xb')],_0x237b83);return _0x23b70f(_0x56ce3f[_0x950b('0xa')][_0x950b('0xb')]);}else{return _0x986b16(_0x56ce3f[_0x950b('0xc')]);}})[_0x950b('0xd')](function(_0x585c89){logger[_0x950b('0xa')](_0x950b('0x8'),'routing',_0x3f68be,_0x585c89,_0x237b83);return _0x23b70f(_0x585c89);});});};module[_0x950b('0xe')]=client; \ No newline at end of file +var _0x12cc=['http','debug','rpc','error','message','catch','exports','bluebird','../../config/logger','routing','client'];(function(_0x494368,_0x56d9a3){var _0x1491a3=function(_0x81e189){while(--_0x81e189){_0x494368['push'](_0x494368['shift']());}};_0x1491a3(++_0x56d9a3);}(_0x12cc,0xc2));var _0xc12c=function(_0x480b4f,_0x4169d){_0x480b4f=_0x480b4f-0x0;var _0x4d232c=_0x12cc[_0x480b4f];return _0x4d232c;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xc12c('0x0'));var logger=require(_0xc12c('0x1'))(_0xc12c('0x2'));var client=jayson[_0xc12c('0x3')][_0xc12c('0x4')]({'port':0x2329});client['Request']=function(_0x48809a,_0x3e773c){return new BPromise(function(_0x914c7e,_0x54bfa3){return client['request'](_0x48809a,_0x3e773c)['then'](function(_0x152fcd){logger[_0xc12c('0x5')](_0xc12c('0x6'),'routing',_0x48809a,_0x3e773c,_0x152fcd);if(_0x152fcd['error']){logger[_0xc12c('0x7')](_0xc12c('0x6'),_0xc12c('0x2'),_0x48809a,_0x152fcd['error'][_0xc12c('0x8')],_0x3e773c);return _0x54bfa3(_0x152fcd[_0xc12c('0x7')][_0xc12c('0x8')]);}else{return _0x914c7e(_0x152fcd['result']);}})[_0xc12c('0x9')](function(_0x30cfc9){logger[_0xc12c('0x7')](_0xc12c('0x6'),_0xc12c('0x2'),_0x48809a,_0x30cfc9,_0x3e773c);return _0x54bfa3(_0x30cfc9);});});};module[_0xc12c('0xa')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index aceb739..cdb4788 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 _0x1115=['then','getMailAccounts','refresh','mailAccounts','findOne','loginMailFrequency','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve'];(function(_0x30b396,_0x34fb61){var _0x23fcee=function(_0x2e3684){while(--_0x2e3684){_0x30b396['push'](_0x30b396['shift']());}};_0x23fcee(++_0x34fb61);}(_0x1115,0x1b6));var _0x5111=function(_0x5a7516,_0xc133ef){_0x5a7516=_0x5a7516-0x0;var _0x103005=_0x1115[_0x5a7516];return _0x103005;};'use strict';var BPromise=require('bluebird');var server=require(_0x5111('0x0'));var Realtime=require(_0x5111('0x1'));var EmailChannel=require(_0x5111('0x2'));var mailAccount=require(_0x5111('0x3'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x5111('0x4'))['db'];function initRealtime(){return BPromise[_0x5111('0x5')]()[_0x5111('0x6')](mailAccount[_0x5111('0x7')]())[_0x5111('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0x5111('0x8')](realtime[_0x5111('0x9')]);return realtime;});}function main(){return server['listen'](realtime,email)[_0x5111('0x6')](function(_0x2d2777){return initRealtime();})['then'](function(_0x42a3c5){return db['Setting'][_0x5111('0xa')]({'attributes':['id',_0x5111('0xb')],'raw':!![]});})['then'](function(_0x5e12a7){return setInterval(initRealtime,_0x5e12a7[_0x5111('0xb')]*0x3e8);})['catch'](function(_0x162624){console['log'](_0x162624);});}main(); \ No newline at end of file +var _0x2123=['getMailAccounts','initMailAccounts','mailAccounts','listen','Setting','findOne','loginMailFrequency','catch','log','bluebird','./server','./realtime','./lib/email','./rpc/mailAccount','../../mysqldb','resolve','then'];(function(_0x57e021,_0x1f262f){var _0x2ba204=function(_0x2e0f12){while(--_0x2e0f12){_0x57e021['push'](_0x57e021['shift']());}};_0x2ba204(++_0x1f262f);}(_0x2123,0x190));var _0x3212=function(_0x51d1e5,_0x4097bd){_0x51d1e5=_0x51d1e5-0x0;var _0x2c5dc5=_0x2123[_0x51d1e5];return _0x2c5dc5;};'use strict';var BPromise=require(_0x3212('0x0'));var server=require(_0x3212('0x1'));var Realtime=require(_0x3212('0x2'));var EmailChannel=require(_0x3212('0x3'));var mailAccount=require(_0x3212('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0x3212('0x5'))['db'];function initRealtime(){return BPromise[_0x3212('0x6')]()[_0x3212('0x7')](mailAccount[_0x3212('0x8')]())[_0x3212('0x7')](realtime[_0x3212('0x9')]())[_0x3212('0x7')](function(){email['refresh'](realtime[_0x3212('0xa')]);return realtime;});}function main(){return server[_0x3212('0xb')](realtime,email)[_0x3212('0x7')](function(_0x4b35e9){return initRealtime();})[_0x3212('0x7')](function(_0x56c38f){return db[_0x3212('0xc')][_0x3212('0xd')]({'attributes':['id',_0x3212('0xe')],'raw':!![]});})[_0x3212('0x7')](function(_0x54f331){return setInterval(initRealtime,_0x54f331['loginMailFrequency']*0x3e8);})[_0x3212('0xf')](function(_0xf166c2){console[_0x3212('0x10')](_0xf166c2);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index c323df0..4ea7b2a 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 _0x432d=['start\x20email\x20channel','mailAccounts','smtp','prototype','emit','name','key','active','Imap','messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','imapAccounts','box','handleImapBox','bind','end','handleImapEnd','error','handleImapError','status','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','from','notify','then','Mail\x20accepted\x20from\x20routing','catch','lastSync','sendMail','verifySmtp','Smtp','verify','exports','lodash','moment','md5','ioredis','../../../config/logger','email','redis','defaults','socket.io-emitter','./imap','./smtp','../rpc/mailAccount','info'];(function(_0x22994,_0x4744f8){var _0x1ef09f=function(_0x5b8492){while(--_0x5b8492){_0x22994['push'](_0x22994['shift']());}};_0x1ef09f(++_0x4744f8);}(_0x432d,0x1a3));var _0xd432=function(_0x207d2f,_0x44400f){_0x207d2f=_0x207d2f-0x0;var _0x3c3498=_0x432d[_0x207d2f];return _0x3c3498;};'use strict';var _=require(_0xd432('0x0'));var moment=require(_0xd432('0x1'));var BPromise=require('bluebird');var md5=require(_0xd432('0x2'));var Redis=require(_0xd432('0x3'));var config=require('../../../config/environment');var logger=require(_0xd432('0x4'))(_0xd432('0x5'));config[_0xd432('0x6')]=_[_0xd432('0x7')](config[_0xd432('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xd432('0x8'))(new Redis(config[_0xd432('0x6')]));var EmailImap=require(_0xd432('0x9'));var EmailSmtp=require(_0xd432('0xa'));var mailAccount=require(_0xd432('0xb'));var md5Accounts={};function EmailChannel(_0x2dc232){logger[_0xd432('0xc')](_0xd432('0xd'));this[_0xd432('0xe')]=_0x2dc232[_0xd432('0xe')];this['imapAccounts']={};this[_0xd432('0xf')]=new EmailSmtp();}EmailChannel[_0xd432('0x10')][_0xd432('0x11')]=function(_0x21c2fe){var _0x476f11=this[_0xd432('0xe')][_0x21c2fe];var _0xe977a7={'id':_0x476f11['id'],'name':_0x476f11[_0xd432('0x12')],'key':_0x476f11[_0xd432('0x13')],'active':_0x476f11[_0xd432('0x14')],'Imap':{'status':_0x476f11['Imap']['status'],'messageStatus':_0x476f11[_0xd432('0x15')][_0xd432('0x16')],'total':_0x476f11[_0xd432('0x15')][_0xd432('0x17')]}};if(_[_0xd432('0x18')](md5Accounts[_0x21c2fe])){md5Accounts[_0x21c2fe]={};}var _0x586e78=md5(JSON[_0xd432('0x19')](_0xe977a7));if(md5Accounts[_0x21c2fe][_0xd432('0x2')]!==_0x586e78){md5Accounts[_0x21c2fe][_0xd432('0x2')]=_0x586e78;io[_0xd432('0x11')](_0xd432('0x1a'),_0xe977a7);}};EmailChannel['prototype'][_0xd432('0x1b')]=function(_0x2623db){for(var _0x15c7bc in _0x2623db){if(_0x2623db[_0xd432('0x1c')](_0x15c7bc)){if(_0x2623db[_0x15c7bc][_0xd432('0x15')]&&_0x2623db[_0x15c7bc]['active']){var _0x1464c5=_0x2623db[_0x15c7bc][_0xd432('0x15')];if(!this[_0xd432('0x1d')][_0xd432('0x1c')](_0x1464c5['id'])){this[_0xd432('0x1d')][_0x1464c5['id']]=new EmailImap(_0x1464c5,_0x2623db[_0x15c7bc][_0xd432('0x5')]);this['imapAccounts'][_0x1464c5['id']]['on'](_0xd432('0x1e'),this[_0xd432('0x1f')][_0xd432('0x20')](this,_0x15c7bc));this[_0xd432('0x1d')][_0x1464c5['id']]['on'](_0xd432('0x5'),this['handleImapEmail'][_0xd432('0x20')](this,_0x15c7bc));this[_0xd432('0x1d')][_0x1464c5['id']]['on'](_0xd432('0x21'),this[_0xd432('0x22')][_0xd432('0x20')](this,_0x15c7bc));this['imapAccounts'][_0x1464c5['id']]['on'](_0xd432('0x23'),this[_0xd432('0x24')][_0xd432('0x20')](this,_0x15c7bc));}}else{if(_[_0xd432('0x18')](this[_0xd432('0xe')][_0x15c7bc][_0xd432('0x15')])){this['mailAccounts'][_0x15c7bc][_0xd432('0x15')]={};}this['mailAccounts'][_0x15c7bc][_0xd432('0x15')]['status']='disabled';this[_0xd432('0xe')][_0x15c7bc][_0xd432('0x15')][_0xd432('0x16')]='';this[_0xd432('0x11')](_0x15c7bc);}}}};EmailChannel[_0xd432('0x10')][_0xd432('0x1f')]=function(_0x2a8e41,_0xb4dfe4){if(this[_0xd432('0xe')][_0x2a8e41]){this[_0xd432('0xe')][_0x2a8e41][_0xd432('0x15')][_0xd432('0x25')]=_0xd432('0x26');this[_0xd432('0xe')][_0x2a8e41][_0xd432('0x15')][_0xd432('0x16')]=_0xb4dfe4['name'];if(_0xb4dfe4[_0xd432('0x27')]){this['mailAccounts'][_0x2a8e41]['Imap'][_0xd432('0x17')]=_0xb4dfe4[_0xd432('0x27')]['total'];}return this[_0xd432('0x11')](_0x2a8e41);}};EmailChannel[_0xd432('0x10')]['handleImapEmail']=function(_0x1c969d,_0x49cfc4){logger[_0xd432('0xc')](_0xd432('0x28'),_0x49cfc4[_0xd432('0x29')],_0x49cfc4[_0xd432('0x2a')],_0x49cfc4[_0xd432('0x2b')],_0x1c969d);if(this['mailAccounts'][_0x1c969d]){return mailAccount[_0xd432('0x2c')](_0x1c969d,_0x49cfc4)[_0xd432('0x2d')](function(_0x129925){if(_0x129925){logger[_0xd432('0xc')](_0xd432('0x2e'));}})[_0xd432('0x2f')](function(_0x484114){logger[_0xd432('0x23')]('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0xd432('0x19')](_0x484114));});}};EmailChannel['prototype']['handleImapEnd']=function(_0x3ce9cb){if(this['mailAccounts'][_0x3ce9cb]&&this[_0xd432('0xe')][_0x3ce9cb][_0xd432('0x15')]){if(this[_0xd432('0x1d')][this['mailAccounts'][_0x3ce9cb][_0xd432('0x15')]['id']]){delete this[_0xd432('0x1d')][this[_0xd432('0xe')][_0x3ce9cb][_0xd432('0x15')]['id']];}this[_0xd432('0xe')][_0x3ce9cb]['Imap'][_0xd432('0x30')]=moment();this[_0xd432('0x11')](_0x3ce9cb);}};EmailChannel[_0xd432('0x10')][_0xd432('0x24')]=function(_0x3e55e9,_0x3f3a41){if(this[_0xd432('0xe')][_0x3e55e9]){this[_0xd432('0xe')][_0x3e55e9][_0xd432('0x15')][_0xd432('0x25')]=_0xd432('0x23');this['mailAccounts'][_0x3e55e9][_0xd432('0x15')][_0xd432('0x16')]=_0x3f3a41;return this['emit'](_0x3e55e9);}};EmailChannel[_0xd432('0x10')][_0xd432('0x31')]=function(_0x524d66,_0x24008c){return this['smtp']['send'](_0x524d66,_0x24008c);};EmailChannel['prototype'][_0xd432('0x32')]=function(_0x19cea7){var _0x3ecccf=this;if(this['mailAccounts'][_0x19cea7['id']]){if(_[_0xd432('0x18')](this[_0xd432('0xe')][_0x19cea7['id']][_0xd432('0x33')])){this[_0xd432('0xe')][_0x19cea7['id']][_0xd432('0x33')]={};}this[_0xd432('0xe')][_0x19cea7['id']]['Smtp'][_0xd432('0x30')]=moment();return new BPromise(function(_0x1b23a2,_0x527976){return _0x3ecccf[_0xd432('0xf')][_0xd432('0x34')](_0x19cea7)[_0xd432('0x2d')](function(_0x550f01){_0x3ecccf[_0xd432('0xe')][_0x19cea7['id']][_0xd432('0x33')]['status']='verified';_0x3ecccf[_0xd432('0xe')][_0x19cea7['id']]['Smtp'][_0xd432('0x16')]='';_0x3ecccf[_0xd432('0x11')](_0x19cea7['id']);_0x1b23a2(_0x550f01);})['catch'](function(_0x273162){_0x3ecccf[_0xd432('0xe')][_0x19cea7['id']][_0xd432('0x33')][_0xd432('0x25')]='error';_0x3ecccf[_0xd432('0xe')][_0x19cea7['id']][_0xd432('0x33')][_0xd432('0x16')]=_0x273162;_0x3ecccf['emit'](_0x19cea7['id']);_0x527976(_0x273162);});});}return this[_0xd432('0xf')][_0xd432('0x34')](_0x19cea7);};module[_0xd432('0x35')]=EmailChannel; \ No newline at end of file +var _0x95f7=['messageStatus','total','isNil','stringify','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','error','emit','prototype','connected','name','messages','lastName','from','notify','then','catch','Mail\x20not\x20accepted\x20from\x20routing\x20%s','lastSync','sendMail','smtp','send','verifySmtp','Smtp','verify','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','./imap','./smtp','../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','key','active','Imap','status'];(function(_0x17dd14,_0x299506){var _0x51d4f6=function(_0xc2d90c){while(--_0xc2d90c){_0x17dd14['push'](_0x17dd14['shift']());}};_0x51d4f6(++_0x299506);}(_0x95f7,0x8c));var _0x795f=function(_0x7529c0,_0x2373ca){_0x7529c0=_0x7529c0-0x0;var _0x59f38b=_0x95f7[_0x7529c0];return _0x59f38b;};'use strict';var _=require(_0x795f('0x0'));var moment=require(_0x795f('0x1'));var BPromise=require(_0x795f('0x2'));var md5=require(_0x795f('0x3'));var Redis=require(_0x795f('0x4'));var config=require(_0x795f('0x5'));var logger=require(_0x795f('0x6'))(_0x795f('0x7'));config[_0x795f('0x8')]=_[_0x795f('0x9')](config[_0x795f('0x8')],{'host':_0x795f('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));var EmailImap=require(_0x795f('0xb'));var EmailSmtp=require(_0x795f('0xc'));var mailAccount=require(_0x795f('0xd'));var md5Accounts={};function EmailChannel(_0x45b03d){logger[_0x795f('0xe')](_0x795f('0xf'));this['mailAccounts']=_0x45b03d[_0x795f('0x10')];this[_0x795f('0x11')]={};this['smtp']=new EmailSmtp();}EmailChannel['prototype']['emit']=function(_0xaf1b28){var _0x2b9c35=this[_0x795f('0x10')][_0xaf1b28];var _0x31860b={'id':_0x2b9c35['id'],'name':_0x2b9c35['name'],'key':_0x2b9c35[_0x795f('0x12')],'active':_0x2b9c35[_0x795f('0x13')],'Imap':{'status':_0x2b9c35[_0x795f('0x14')][_0x795f('0x15')],'messageStatus':_0x2b9c35['Imap'][_0x795f('0x16')],'total':_0x2b9c35[_0x795f('0x14')][_0x795f('0x17')]}};if(_[_0x795f('0x18')](md5Accounts[_0xaf1b28])){md5Accounts[_0xaf1b28]={};}var _0x30fe85=md5(JSON[_0x795f('0x19')](_0x31860b));if(md5Accounts[_0xaf1b28]['md5']!==_0x30fe85){md5Accounts[_0xaf1b28][_0x795f('0x3')]=_0x30fe85;io['emit'](_0x795f('0x1a'),_0x31860b);}};EmailChannel['prototype'][_0x795f('0x1b')]=function(_0x4584a5){for(var _0x4c100d in _0x4584a5){if(_0x4584a5[_0x795f('0x1c')](_0x4c100d)){if(_0x4584a5[_0x4c100d][_0x795f('0x14')]&&_0x4584a5[_0x4c100d][_0x795f('0x13')]){var _0x358c40=_0x4584a5[_0x4c100d][_0x795f('0x14')];if(!this[_0x795f('0x11')][_0x795f('0x1c')](_0x358c40['id'])){this[_0x795f('0x11')][_0x358c40['id']]=new EmailImap(_0x358c40,_0x4584a5[_0x4c100d]['email']);this[_0x795f('0x11')][_0x358c40['id']]['on'](_0x795f('0x1d'),this[_0x795f('0x1e')][_0x795f('0x1f')](this,_0x4c100d));this[_0x795f('0x11')][_0x358c40['id']]['on'](_0x795f('0x7'),this[_0x795f('0x20')][_0x795f('0x1f')](this,_0x4c100d));this[_0x795f('0x11')][_0x358c40['id']]['on']('end',this[_0x795f('0x21')]['bind'](this,_0x4c100d));this[_0x795f('0x11')][_0x358c40['id']]['on'](_0x795f('0x22'),this['handleImapError']['bind'](this,_0x4c100d));}}else{if(_[_0x795f('0x18')](this[_0x795f('0x10')][_0x4c100d][_0x795f('0x14')])){this[_0x795f('0x10')][_0x4c100d][_0x795f('0x14')]={};}this[_0x795f('0x10')][_0x4c100d][_0x795f('0x14')][_0x795f('0x15')]='disabled';this[_0x795f('0x10')][_0x4c100d][_0x795f('0x14')][_0x795f('0x16')]='';this[_0x795f('0x23')](_0x4c100d);}}}};EmailChannel[_0x795f('0x24')][_0x795f('0x1e')]=function(_0x293885,_0x33fb7a){if(this[_0x795f('0x10')][_0x293885]){this[_0x795f('0x10')][_0x293885]['Imap'][_0x795f('0x15')]=_0x795f('0x25');this['mailAccounts'][_0x293885][_0x795f('0x14')][_0x795f('0x16')]=_0x33fb7a[_0x795f('0x26')];if(_0x33fb7a[_0x795f('0x27')]){this[_0x795f('0x10')][_0x293885][_0x795f('0x14')]['total']=_0x33fb7a['messages'][_0x795f('0x17')];}return this[_0x795f('0x23')](_0x293885);}};EmailChannel['prototype'][_0x795f('0x20')]=function(_0x1ffe91,_0x15f8be){logger['info']('New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s',_0x15f8be['firstName'],_0x15f8be[_0x795f('0x28')],_0x15f8be[_0x795f('0x29')],_0x1ffe91);if(this[_0x795f('0x10')][_0x1ffe91]){return mailAccount[_0x795f('0x2a')](_0x1ffe91,_0x15f8be)[_0x795f('0x2b')](function(_0x2869c4){if(_0x2869c4){logger[_0x795f('0xe')]('Mail\x20accepted\x20from\x20routing');}})[_0x795f('0x2c')](function(_0x1dc45e){logger['error'](_0x795f('0x2d'),JSON[_0x795f('0x19')](_0x1dc45e));});}};EmailChannel['prototype'][_0x795f('0x21')]=function(_0x2751c0){if(this[_0x795f('0x10')][_0x2751c0]&&this[_0x795f('0x10')][_0x2751c0][_0x795f('0x14')]){if(this[_0x795f('0x11')][this[_0x795f('0x10')][_0x2751c0][_0x795f('0x14')]['id']]){delete this[_0x795f('0x11')][this[_0x795f('0x10')][_0x2751c0]['Imap']['id']];}this['mailAccounts'][_0x2751c0]['Imap'][_0x795f('0x2e')]=moment();this[_0x795f('0x23')](_0x2751c0);}};EmailChannel[_0x795f('0x24')]['handleImapError']=function(_0x412acb,_0x245b9e){if(this[_0x795f('0x10')][_0x412acb]){this[_0x795f('0x10')][_0x412acb]['Imap'][_0x795f('0x15')]='error';this[_0x795f('0x10')][_0x412acb]['Imap']['messageStatus']=_0x245b9e;return this[_0x795f('0x23')](_0x412acb);}};EmailChannel[_0x795f('0x24')][_0x795f('0x2f')]=function(_0x5f15e7,_0xf299b7){return this[_0x795f('0x30')][_0x795f('0x31')](_0x5f15e7,_0xf299b7);};EmailChannel['prototype'][_0x795f('0x32')]=function(_0x2650a9){var _0x3f4827=this;if(this[_0x795f('0x10')][_0x2650a9['id']]){if(_[_0x795f('0x18')](this[_0x795f('0x10')][_0x2650a9['id']][_0x795f('0x33')])){this['mailAccounts'][_0x2650a9['id']][_0x795f('0x33')]={};}this[_0x795f('0x10')][_0x2650a9['id']]['Smtp']['lastSync']=moment();return new BPromise(function(_0x4387a3,_0x395fc5){return _0x3f4827['smtp'][_0x795f('0x34')](_0x2650a9)[_0x795f('0x2b')](function(_0x20bc12){_0x3f4827[_0x795f('0x10')][_0x2650a9['id']][_0x795f('0x33')]['status']='verified';_0x3f4827[_0x795f('0x10')][_0x2650a9['id']][_0x795f('0x33')][_0x795f('0x16')]='';_0x3f4827[_0x795f('0x23')](_0x2650a9['id']);_0x4387a3(_0x20bc12);})[_0x795f('0x2c')](function(_0x22f323){_0x3f4827[_0x795f('0x10')][_0x2650a9['id']][_0x795f('0x33')][_0x795f('0x15')]=_0x795f('0x22');_0x3f4827[_0x795f('0x10')][_0x2650a9['id']][_0x795f('0x33')][_0x795f('0x16')]=_0x22f323;_0x3f4827['emit'](_0x2650a9['id']);_0x395fc5(_0x22f323);});});}return this[_0x795f('0x30')][_0x795f('0x34')](_0x2650a9);};module[_0x795f('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 84b42f7..5f1181c 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 _0x8b84=['user','password','host','port','tls','getHost','anonymous@xcally.com','handleReady','openBox','handleOpenBox','handleError','emit','box','readUnseen','search','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','handleFetchEnd','closeBox','handleCloseBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','stringify','textCode','exports','util','imap','lodash','randomstring','mailparser','iconv','events','EventEmitter','email','mailbox','INBOX','account','getAccount','once','ready','bind','end','handleEnd','error','inherits','prototype','authTimeout','isNil','service','authentication'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x8b84,0x1bf));var _0x48b8=function(_0xa1e3e3,_0x29fe0e){_0xa1e3e3=_0xa1e3e3-0x0;var _0xc980e9=_0x8b84[_0xa1e3e3];return _0xc980e9;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0x48b8('0x0'));var Imap=require(_0x48b8('0x1'));var _=require(_0x48b8('0x2'));var rs=require(_0x48b8('0x3'));var simpleParser=require(_0x48b8('0x4'))['simpleParser'];var Iconv=require(_0x48b8('0x5'))['Iconv'];var EventEmitter=require(_0x48b8('0x6'))[_0x48b8('0x7')];var utils=require('./utils');var logger=require('../../../config/logger')(_0x48b8('0x8'));function EmailImap(_0x23bd29,_0x50d47a){this[_0x48b8('0x9')]=_0x48b8('0xa');this[_0x48b8('0xb')]=this[_0x48b8('0xc')](_0x23bd29,_0x50d47a);this[_0x48b8('0x1')]=new Imap(this['account']);this[_0x48b8('0x1')][_0x48b8('0xd')](_0x48b8('0xe'),this['handleReady'][_0x48b8('0xf')](this));this[_0x48b8('0x1')]['once'](_0x48b8('0x10'),this[_0x48b8('0x11')][_0x48b8('0xf')](this));this['imap']['on'](_0x48b8('0x12'),this['handleError']['bind'](this));this[_0x48b8('0x1')]['connect']();}util[_0x48b8('0x13')](EmailImap,EventEmitter);EmailImap[_0x48b8('0x14')]['getAccount']=function(_0x559524,_0x216075){var _0x1f7813={'connTimeout':_0x559524['connTimeout']?_0x559524['connTimeout']*0x3e8:0x2710,'authTimeout':_0x559524[_0x48b8('0x15')]?_0x559524['authTimeout']*0x3e8:0x1388};if(_[_0x48b8('0x16')](_0x559524[_0x48b8('0x17')])){if(_0x559524[_0x48b8('0x18')]){_0x1f7813[_0x48b8('0x19')]=_0x559524[_0x48b8('0x19')];_0x1f7813[_0x48b8('0x1a')]=_0x559524[_0x48b8('0x1a')];}_0x1f7813[_0x48b8('0x1b')]=_0x559524[_0x48b8('0x1b')];_0x1f7813[_0x48b8('0x1c')]=_0x559524[_0x48b8('0x1c')]||0x3e1;if(_0x559524[_0x48b8('0x1d')]){_0x1f7813[_0x48b8('0x1d')]=!![];}else{_0x1f7813[_0x48b8('0x1d')]=![];_0x1f7813['autotls']='required';}}else{_0x1f7813[_0x48b8('0x19')]=_0x559524[_0x48b8('0x19')];_0x1f7813[_0x48b8('0x1a')]=_0x559524[_0x48b8('0x1a')];_0x1f7813[_0x48b8('0x1b')]=utils[_0x48b8('0x1e')](_0x559524[_0x48b8('0x17')]);_0x1f7813['port']=0x3e1;_0x1f7813[_0x48b8('0x1d')]=!![];}_0x1f7813[_0x48b8('0x8')]=_0x216075||_0x559524[_0x48b8('0x19')]||_0x48b8('0x1f');return _0x1f7813;};EmailImap[_0x48b8('0x14')][_0x48b8('0x20')]=function(){this['imap'][_0x48b8('0x21')](this['mailbox'],![],this[_0x48b8('0x22')][_0x48b8('0xf')](this));};EmailImap[_0x48b8('0x14')][_0x48b8('0x22')]=function(_0x3f6c49,_0xcaa1f9){if(_0x3f6c49){this[_0x48b8('0x23')](_0x3f6c49,!![]);}else{this[_0x48b8('0x24')](_0x48b8('0x25'),_0xcaa1f9);this[_0x48b8('0x26')]();}};EmailImap['prototype']['handleCloseBox']=function(_0x1b2eef){if(_0x1b2eef){this[_0x48b8('0x23')](_0x1b2eef,!![]);}else{this[_0x48b8('0x1')][_0x48b8('0x10')]();}};EmailImap['prototype'][_0x48b8('0x26')]=function(){this[_0x48b8('0x1')][_0x48b8('0x27')](['UNSEEN'],this[_0x48b8('0x28')]['bind'](this));};EmailImap[_0x48b8('0x14')][_0x48b8('0x28')]=function(_0x5aad54,_0x3c3e92){if(_0x5aad54){this[_0x48b8('0x23')](_0x5aad54,!![]);}else{if(_0x3c3e92[_0x48b8('0x29')]){try{var _0x24e3e5=this[_0x48b8('0x1')][_0x48b8('0x2a')](_0x3c3e92,{'bodies':'','markSeen':!![]});_0x24e3e5['on'](_0x48b8('0x2b'),this[_0x48b8('0x2c')]['bind'](this));_0x24e3e5[_0x48b8('0xd')](_0x48b8('0x12'),this[_0x48b8('0x2d')][_0x48b8('0xf')](this));_0x24e3e5[_0x48b8('0xd')](_0x48b8('0x10'),this[_0x48b8('0x2e')][_0x48b8('0xf')](this));}catch(_0x4a8b13){logger[_0x48b8('0x12')](_0x4a8b13);}}else{this[_0x48b8('0x1')][_0x48b8('0x2f')](!![],this[_0x48b8('0x30')][_0x48b8('0xf')](this));}}};EmailImap[_0x48b8('0x14')]['handleFetchMessage']=function(_0x36a6fc,_0x2a272e){_0x36a6fc['on'](_0x48b8('0x31'),this[_0x48b8('0x32')][_0x48b8('0xf')](this));_0x36a6fc['once'](_0x48b8('0x33'),this[_0x48b8('0x34')][_0x48b8('0xf')](this));_0x36a6fc['once']('end',this[_0x48b8('0x35')][_0x48b8('0xf')](this));};EmailImap['prototype'][_0x48b8('0x32')]=function(_0x5c7944,_0x2e3c3a){simpleParser(_0x5c7944,{'Iconv':Iconv},this[_0x48b8('0x36')][_0x48b8('0xf')](this));};EmailImap[_0x48b8('0x14')]['handleMessageAttributes']=function(_0x246d23){};EmailImap['prototype'][_0x48b8('0x35')]=function(){};EmailImap['prototype'][_0x48b8('0x36')]=function(_0x5007d6,_0x272889){if(_0x5007d6){logger[_0x48b8('0x12')](_0x5007d6);}else{var _0x390dd5=this;utils[_0x48b8('0x37')](this[_0x48b8('0xb')],_0x272889,function(_0x225484){_0x390dd5[_0x48b8('0x24')](_0x48b8('0x8'),_0x225484);});}};EmailImap[_0x48b8('0x14')][_0x48b8('0x2e')]=function(){this['imap'][_0x48b8('0x2f')](!![],this[_0x48b8('0x30')][_0x48b8('0xf')](this));};EmailImap['prototype']['handleFetchError']=function(_0x3050f7){this[_0x48b8('0x23')](_0x3050f7);this[_0x48b8('0x1')]['closeBox'](!![],this['handleCloseBox']['bind'](this));};EmailImap[_0x48b8('0x14')][_0x48b8('0x11')]=function(){this[_0x48b8('0x24')](_0x48b8('0x10'));};EmailImap['prototype'][_0x48b8('0x23')]=function(_0x49c6c1,_0x40e475){logger['error'](_0x48b8('0x23'),this[_0x48b8('0xb')][_0x48b8('0x8')],JSON[_0x48b8('0x38')](_0x49c6c1));var _0xbf623c='';if(_0x49c6c1){if(_0x49c6c1['textCode']){_0xbf623c=_0x49c6c1[_0x48b8('0x39')];}else{for(var _0x2a6eb6 in _0x49c6c1){if(_0x49c6c1['hasOwnProperty'](_0x2a6eb6)){_0xbf623c+=_['upperFirst'](_0x2a6eb6)+':\x20'+_0x49c6c1[_0x2a6eb6]+'\x0a';}}}}if(_0x40e475){this[_0x48b8('0x1')][_0x48b8('0x10')]();}else{this[_0x48b8('0x24')](_0x48b8('0x12'),_0xbf623c);this[_0x48b8('0x24')](_0x48b8('0x10'));}};module[_0x48b8('0x3a')]=EmailImap; \ No newline at end of file +var _0x2678=['once','end','error','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','authentication','user','host','port','tls','autotls','password','getHost','service','anonymous@xcally.com','openBox','handleOpenBox','box','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','handleFetchError','body','handleMessageBody','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','emit','handleFetchEnd','closeBox','handleEnd','textCode','hasOwnProperty','upperFirst','exports','path','util','imap','lodash','randomstring','mailparser','iconv','Iconv','events','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','getAccount','ready','handleReady','bind'];(function(_0x14aecf,_0x5813ac){var _0x5dbb23=function(_0x4fceec){while(--_0x4fceec){_0x14aecf['push'](_0x14aecf['shift']());}};_0x5dbb23(++_0x5813ac);}(_0x2678,0x13b));var _0x8267=function(_0x2edb97,_0x20ec23){_0x2edb97=_0x2edb97-0x0;var _0x2c45a2=_0x2678[_0x2edb97];return _0x2c45a2;};'use strict';var fs=require('fs');var path=require(_0x8267('0x0'));var util=require(_0x8267('0x1'));var Imap=require(_0x8267('0x2'));var _=require(_0x8267('0x3'));var rs=require(_0x8267('0x4'));var simpleParser=require(_0x8267('0x5'))['simpleParser'];var Iconv=require(_0x8267('0x6'))[_0x8267('0x7')];var EventEmitter=require(_0x8267('0x8'))[_0x8267('0x9')];var utils=require(_0x8267('0xa'));var logger=require(_0x8267('0xb'))(_0x8267('0xc'));function EmailImap(_0x17e9ab,_0x44bb76){this[_0x8267('0xd')]=_0x8267('0xe');this[_0x8267('0xf')]=this[_0x8267('0x10')](_0x17e9ab,_0x44bb76);this[_0x8267('0x2')]=new Imap(this['account']);this[_0x8267('0x2')]['once'](_0x8267('0x11'),this[_0x8267('0x12')][_0x8267('0x13')](this));this[_0x8267('0x2')][_0x8267('0x14')](_0x8267('0x15'),this['handleEnd'][_0x8267('0x13')](this));this[_0x8267('0x2')]['on'](_0x8267('0x16'),this[_0x8267('0x17')]['bind'](this));this[_0x8267('0x2')][_0x8267('0x18')]();}util[_0x8267('0x19')](EmailImap,EventEmitter);EmailImap[_0x8267('0x1a')][_0x8267('0x10')]=function(_0x472426,_0x286d0){var _0x11ebb6={'connTimeout':_0x472426[_0x8267('0x1b')]?_0x472426[_0x8267('0x1b')]*0x3e8:0x2710,'authTimeout':_0x472426[_0x8267('0x1c')]?_0x472426['authTimeout']*0x3e8:0x1388};if(_[_0x8267('0x1d')](_0x472426['service'])){if(_0x472426[_0x8267('0x1e')]){_0x11ebb6[_0x8267('0x1f')]=_0x472426['user'];_0x11ebb6['password']=_0x472426['password'];}_0x11ebb6[_0x8267('0x20')]=_0x472426[_0x8267('0x20')];_0x11ebb6[_0x8267('0x21')]=_0x472426[_0x8267('0x21')]||0x3e1;if(_0x472426['tls']){_0x11ebb6[_0x8267('0x22')]=!![];}else{_0x11ebb6[_0x8267('0x22')]=![];_0x11ebb6[_0x8267('0x23')]='required';}}else{_0x11ebb6[_0x8267('0x1f')]=_0x472426['user'];_0x11ebb6['password']=_0x472426[_0x8267('0x24')];_0x11ebb6[_0x8267('0x20')]=utils[_0x8267('0x25')](_0x472426[_0x8267('0x26')]);_0x11ebb6[_0x8267('0x21')]=0x3e1;_0x11ebb6[_0x8267('0x22')]=!![];}_0x11ebb6[_0x8267('0xc')]=_0x286d0||_0x472426['user']||_0x8267('0x27');return _0x11ebb6;};EmailImap['prototype'][_0x8267('0x12')]=function(){this[_0x8267('0x2')][_0x8267('0x28')](this[_0x8267('0xd')],![],this['handleOpenBox'][_0x8267('0x13')](this));};EmailImap['prototype'][_0x8267('0x29')]=function(_0x3dd295,_0x2aebdf){if(_0x3dd295){this[_0x8267('0x17')](_0x3dd295,!![]);}else{this['emit'](_0x8267('0x2a'),_0x2aebdf);this[_0x8267('0x2b')]();}};EmailImap['prototype'][_0x8267('0x2c')]=function(_0x3b07a6){if(_0x3b07a6){this['handleError'](_0x3b07a6,!![]);}else{this[_0x8267('0x2')]['end']();}};EmailImap['prototype'][_0x8267('0x2b')]=function(){this['imap'][_0x8267('0x2d')]([_0x8267('0x2e')],this[_0x8267('0x2f')][_0x8267('0x13')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x1712a3,_0x40a3ca){if(_0x1712a3){this[_0x8267('0x17')](_0x1712a3,!![]);}else{if(_0x40a3ca[_0x8267('0x30')]){try{var _0x7474cc=this[_0x8267('0x2')][_0x8267('0x31')](_0x40a3ca,{'bodies':'','markSeen':!![]});_0x7474cc['on'](_0x8267('0x32'),this[_0x8267('0x33')][_0x8267('0x13')](this));_0x7474cc['once'](_0x8267('0x16'),this[_0x8267('0x34')][_0x8267('0x13')](this));_0x7474cc['once']('end',this['handleFetchEnd'][_0x8267('0x13')](this));}catch(_0x2bf5ce){logger['error'](_0x2bf5ce);}}else{this['imap']['closeBox'](!![],this[_0x8267('0x2c')]['bind'](this));}}};EmailImap[_0x8267('0x1a')][_0x8267('0x33')]=function(_0x252b65,_0x29bdef){_0x252b65['on'](_0x8267('0x35'),this[_0x8267('0x36')]['bind'](this));_0x252b65[_0x8267('0x14')]('attributes',this[_0x8267('0x37')][_0x8267('0x13')](this));_0x252b65[_0x8267('0x14')](_0x8267('0x15'),this[_0x8267('0x38')][_0x8267('0x13')](this));};EmailImap[_0x8267('0x1a')]['handleMessageBody']=function(_0x1cc8b0,_0x1e7c81){simpleParser(_0x1cc8b0,{'Iconv':Iconv},this[_0x8267('0x39')][_0x8267('0x13')](this));};EmailImap[_0x8267('0x1a')][_0x8267('0x37')]=function(_0x421f33){};EmailImap[_0x8267('0x1a')][_0x8267('0x38')]=function(){};EmailImap[_0x8267('0x1a')][_0x8267('0x39')]=function(_0x5a9353,_0x4fc06f){if(_0x5a9353){logger[_0x8267('0x16')](_0x5a9353);}else{var _0x48f115=this;utils[_0x8267('0x3a')](this[_0x8267('0xf')],_0x4fc06f,function(_0x36f70f){_0x48f115[_0x8267('0x3b')](_0x8267('0xc'),_0x36f70f);});}};EmailImap[_0x8267('0x1a')][_0x8267('0x3c')]=function(){this[_0x8267('0x2')][_0x8267('0x3d')](!![],this[_0x8267('0x2c')][_0x8267('0x13')](this));};EmailImap[_0x8267('0x1a')][_0x8267('0x34')]=function(_0x68c3e8){this[_0x8267('0x17')](_0x68c3e8);this[_0x8267('0x2')]['closeBox'](!![],this['handleCloseBox'][_0x8267('0x13')](this));};EmailImap[_0x8267('0x1a')][_0x8267('0x3e')]=function(){this[_0x8267('0x3b')]('end');};EmailImap[_0x8267('0x1a')][_0x8267('0x17')]=function(_0x38bff0,_0x125213){logger['error']('handleError',this[_0x8267('0xf')][_0x8267('0xc')],JSON['stringify'](_0x38bff0));var _0xe96940='';if(_0x38bff0){if(_0x38bff0[_0x8267('0x3f')]){_0xe96940=_0x38bff0[_0x8267('0x3f')];}else{for(var _0x1a9b80 in _0x38bff0){if(_0x38bff0[_0x8267('0x40')](_0x1a9b80)){_0xe96940+=_[_0x8267('0x41')](_0x1a9b80)+':\x20'+_0x38bff0[_0x1a9b80]+'\x0a';}}}}if(_0x125213){this['imap'][_0x8267('0x15')]();}else{this['emit'](_0x8267('0x16'),_0xe96940);this[_0x8267('0x3b')](_0x8267('0x15'));}};module[_0x8267('0x42')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index f738c74..16de234 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 _0x06e8=['exports','bluebird','send','createTransport','use','compile','toString','prototype','verify','Not\x20verifired'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x06e8,0x1b9));var _0x806e=function(_0x33895e,_0x39d220){_0x33895e=_0x33895e-0x0;var _0x9055e0=_0x06e8[_0x33895e];return _0x9055e0;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x806e('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x806e('0x1')]=function(_0x3dd0f2,_0x48be9a){return new BPromise(function(_0x3aee79,_0x420494){var _0x3e4c5c=nodemailer[_0x806e('0x2')](_0x3dd0f2);_0x3e4c5c[_0x806e('0x3')](_0x806e('0x4'),inlineBase64());_0x3e4c5c['sendMail'](_0x48be9a,function(_0x1de1c6,_0x120c5d){if(_0x1de1c6){_0x420494(_0x1de1c6[_0x806e('0x5')]());}else{_0x3aee79(_0x120c5d);}});});};EmailSmtp[_0x806e('0x6')][_0x806e('0x7')]=function(_0x86bade){return new BPromise(function(_0x208aee,_0x36640c){var _0xcd8933=nodemailer[_0x806e('0x2')](_0x86bade);_0xcd8933[_0x806e('0x7')](function(_0x4d28ab,_0x43356e){if(_0x4d28ab){_0x36640c(_0x4d28ab[_0x806e('0x5')]());}else{if(_0x43356e){_0x208aee(_0x43356e);}else{_0x36640c(_0x806e('0x8'));}}});});};module[_0x806e('0x9')]=EmailSmtp; \ No newline at end of file +var _0xfa45=['prototype','verify','toString','exports','bluebird','send','createTransport','use'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xfa45,0x19c));var _0x5fa4=function(_0x49bd3e,_0xa6c3e8){_0x49bd3e=_0x49bd3e-0x0;var _0x590694=_0xfa45[_0x49bd3e];return _0x590694;};'use strict';var nodemailer=require('nodemailer');var BPromise=require(_0x5fa4('0x0'));var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp['prototype'][_0x5fa4('0x1')]=function(_0x20c29b,_0x42ddf9){return new BPromise(function(_0x467c82,_0x287aa5){var _0xee7296=nodemailer[_0x5fa4('0x2')](_0x20c29b);_0xee7296[_0x5fa4('0x3')]('compile',inlineBase64());_0xee7296['sendMail'](_0x42ddf9,function(_0x584c9c,_0x5855d4){if(_0x584c9c){_0x287aa5(_0x584c9c['toString']());}else{_0x467c82(_0x5855d4);}});});};EmailSmtp[_0x5fa4('0x4')][_0x5fa4('0x5')]=function(_0x11903f){return new BPromise(function(_0x47651a,_0x14fcb3){var _0x17bf95=nodemailer[_0x5fa4('0x2')](_0x11903f);_0x17bf95[_0x5fa4('0x5')](function(_0x56d079,_0x143eda){if(_0x56d079){_0x14fcb3(_0x56d079[_0x5fa4('0x6')]());}else{if(_0x143eda){_0x47651a(_0x143eda);}else{_0x14fcb3('Not\x20verifired');}}});});};module[_0x5fa4('0x7')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 554a477..7bab66c 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 _0x37b0=['Empty\x20message

','Attachments','Data','getHost','imap.gmail.com','yahoo','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','lodash','moment','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','generate','name','split','slice','join','Anonymous','length','pop','isEmpty','@xcally.com','html','test','body','textAsHtml','replace'];(function(_0x39236f,_0x33f3e1){var _0x563852=function(_0x171127){while(--_0x171127){_0x39236f['push'](_0x39236f['shift']());}};_0x563852(++_0x33f3e1);}(_0x37b0,0xe9));var _0x037b=function(_0x1de5b3,_0x152479){_0x1de5b3=_0x1de5b3-0x0;var _0x1c7896=_0x37b0[_0x1de5b3];return _0x1c7896;};'use strict';var _=require(_0x037b('0x0'));var moment=require(_0x037b('0x1'));var random=require('randomstring');var fs=require('fs');var path=require(_0x037b('0x2'));var util=require(_0x037b('0x3'));var tnef=require(_0x037b('0x4'));var logger=require(_0x037b('0x5'))(_0x037b('0x6'));var config=require(_0x037b('0x7'));function getAddress(_0x443e66){var _0x379856=_[_0x037b('0x8')](_0x443e66[_0x037b('0x9')]);return _0x379856&&_0x379856[_0x037b('0xa')]?_0x379856[_0x037b('0xa')]:_0x037b('0xb')+random[_0x037b('0xc')](0x6)+'@xcally.com';}function getFirstName(_0xcdc5fe){var _0x52cfb9=_[_0x037b('0x8')](_0xcdc5fe['value']);if(_0x52cfb9&&_0x52cfb9[_0x037b('0xd')]){var _0x495632=_0x52cfb9[_0x037b('0xd')][_0x037b('0xe')](/\s+/);return _0x495632['length']?_0x495632[_0x037b('0xf')](0x0,-0x1)[_0x037b('0x10')]('\x20'):_0x52cfb9[_0x037b('0xd')];}return _0x037b('0x11');}function getLastName(_0x3e35eb){var _0x4c6f82=_[_0x037b('0x8')](_0x3e35eb[_0x037b('0x9')]);if(_0x4c6f82&&_0x4c6f82[_0x037b('0xd')]){var _0x4417bc=_0x4c6f82[_0x037b('0xd')][_0x037b('0xe')](/\s+/);return _0x4417bc[_0x037b('0x12')]>0x1?_0x4417bc[_0x037b('0x13')]():'';}return'';}function getMails(_0x245b7d,_0x4dddef){var _0x5167c9='';for(var _0x101250=0x0;_0x101250<_0x4dddef[_0x037b('0x9')][_0x037b('0x12')];_0x101250+=0x1){if(_0x4dddef[_0x037b('0x9')][_0x101250][_0x037b('0xa')]!==_0x245b7d){if(!_[_0x037b('0x14')](_0x5167c9)){_0x5167c9+=',';}_0x5167c9+=_0x4dddef[_0x037b('0x9')][_0x101250][_0x037b('0xd')]||_0x4dddef['value'][_0x101250][_0x037b('0xa')]||'';_0x5167c9+='\x20<';_0x5167c9+=_0x4dddef['value'][_0x101250][_0x037b('0xa')]?_0x4dddef[_0x037b('0x9')][_0x101250][_0x037b('0xa')]:_0x037b('0xb')+random[_0x037b('0xc')](0x6)+_0x037b('0x15');_0x5167c9+='>';}}return _0x5167c9;}function parseEmail(_0x9f059c,_0x4fe71e,_0x255f3c){if(_0x4fe71e[_0x037b('0x16')]){var _0x337653=/)<[^<]*)*<\/script>/gi;while(_0x337653[_0x037b('0x17')](_0x4fe71e[_0x037b('0x16')])){_0x4fe71e['html']=_0x4fe71e[_0x037b('0x16')]['replace'](_0x337653,'');}_0x255f3c['body']=_0x4fe71e[_0x037b('0x16')];}else{_0x255f3c[_0x037b('0x18')]=_0x4fe71e[_0x037b('0x19')];}if(_0x255f3c[_0x037b('0x18')]){_0x255f3c[_0x037b('0x18')]=_0x255f3c[_0x037b('0x18')][_0x037b('0x1a')](/Empty\x20message

','Attachments','Title','getHost','gmail','imap.gmail.com'];(function(_0x8a7e58,_0x15c02e){var _0x3b2f96=function(_0xdc169d){while(--_0xdc169d){_0x8a7e58['push'](_0x8a7e58['shift']());}};_0x3b2f96(++_0x15c02e);}(_0x252a,0xc7));var _0xa252=function(_0x5b3406,_0x322c75){_0x5b3406=_0x5b3406-0x0;var _0x1a6826=_0x252a[_0x5b3406];return _0x1a6826;};'use strict';var _=require(_0xa252('0x0'));var moment=require(_0xa252('0x1'));var random=require(_0xa252('0x2'));var fs=require('fs');var path=require(_0xa252('0x3'));var util=require(_0xa252('0x4'));var tnef=require(_0xa252('0x5'));var logger=require(_0xa252('0x6'))(_0xa252('0x7'));var config=require(_0xa252('0x8'));function getAddress(_0x15a26f){var _0x8fec77=_[_0xa252('0x9')](_0x15a26f[_0xa252('0xa')]);return _0x8fec77&&_0x8fec77[_0xa252('0xb')]?_0x8fec77[_0xa252('0xb')]:_0xa252('0xc')+random[_0xa252('0xd')](0x6)+_0xa252('0xe');}function getFirstName(_0x336c04){var _0x16f589=_[_0xa252('0x9')](_0x336c04[_0xa252('0xa')]);if(_0x16f589&&_0x16f589[_0xa252('0xf')]){var _0x13b195=_0x16f589[_0xa252('0xf')]['split'](/\s+/);return _0x13b195[_0xa252('0x10')]?_0x13b195[_0xa252('0x11')](0x0,-0x1)['join']('\x20'):_0x16f589[_0xa252('0xf')];}return _0xa252('0x12');}function getLastName(_0x1e2a55){var _0x1b8768=_['head'](_0x1e2a55[_0xa252('0xa')]);if(_0x1b8768&&_0x1b8768[_0xa252('0xf')]){var _0x1fb10a=_0x1b8768['name'][_0xa252('0x13')](/\s+/);return _0x1fb10a[_0xa252('0x10')]>0x1?_0x1fb10a[_0xa252('0x14')]():'';}return'';}function getMails(_0x27810b,_0x37dcf0){var _0x474228='';for(var _0x30a6d5=0x0;_0x30a6d5<_0x37dcf0[_0xa252('0xa')][_0xa252('0x10')];_0x30a6d5+=0x1){if(_0x37dcf0['value'][_0x30a6d5][_0xa252('0xb')]!==_0x27810b){if(!_['isEmpty'](_0x474228)){_0x474228+=',';}_0x474228+=_0x37dcf0[_0xa252('0xa')][_0x30a6d5]['name']||_0x37dcf0[_0xa252('0xa')][_0x30a6d5][_0xa252('0xb')]||'';_0x474228+='\x20<';_0x474228+=_0x37dcf0[_0xa252('0xa')][_0x30a6d5]['address']?_0x37dcf0['value'][_0x30a6d5][_0xa252('0xb')]:_0xa252('0xc')+random[_0xa252('0xd')](0x6)+_0xa252('0xe');_0x474228+='>';}}return _0x474228;}function parseEmail(_0x1dc7e2,_0x20da54,_0x30b0bc){if(_0x20da54['html']){var _0x133bd0=/)<[^<]*)*<\/script>/gi;while(_0x133bd0['test'](_0x20da54[_0xa252('0x15')])){_0x20da54[_0xa252('0x15')]=_0x20da54['html'][_0xa252('0x16')](_0x133bd0,'');}_0x30b0bc[_0xa252('0x17')]=_0x20da54[_0xa252('0x15')];}else{_0x30b0bc[_0xa252('0x17')]=_0x20da54[_0xa252('0x18')];}if(_0x30b0bc[_0xa252('0x17')]){_0x30b0bc[_0xa252('0x17')]=_0x30b0bc[_0xa252('0x17')][_0xa252('0x16')](/0x0){if(this[_0xde347f+'Capacity']>0x0&&this[_0xde347f+_0xef45('0x20')]>=this[_0xde347f+_0xef45('0x21')]){return _0xef45('0x22');}else{return _0xef45('0x23');}}else{return _0xef45('0x24');}};Agent['prototype'][_0xef45('0x1d')]=function(){var _0x54a75d=['mail',_0xef45('0x25'),_0xef45('0x26'),_0xef45('0x27'),_0xef45('0x28')];for(var _0x839eff=0x0;_0x839eff<_0x54a75d[_0xef45('0x29')];_0x839eff+=0x1){var _0x315777=this['getChannelStatus'](_0x54a75d[_0x839eff]);if(this[_0x54a75d[_0x839eff]+_0xef45('0x2a')]!==_0x315777){this[_0x54a75d[_0x839eff]+'StatusTime']=_[_0xef45('0x2b')](moment()[_0xef45('0x2c')]('x'));}this[_0x54a75d[_0x839eff]+'Status']=_0x315777;}var _0x46e423={'id':this['id'],'name':this[_0xef45('0x7')],'online':this['online'],'voicePause':this[_0xef45('0x9')],'chatPause':this['chatPause'],'mailPause':this['mailPause'],'smsPause':this['smsPause'],'faxPause':this['faxPause'],'openchannelPause':this[_0xef45('0xe')],'chatStatus':this[_0xef45('0xf')],'chatStatusTime':this[_0xef45('0x2d')],'chatCapacity':this[_0xef45('0x11')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0xef45('0x13')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this[_0xef45('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0xef45('0x15')],'faxStatusTime':this['faxStatusTime'],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0xef45('0x17')],'smsStatus':this[_0xef45('0x2e')],'smsStatusTime':this[_0xef45('0x18')],'smsCapacity':this[_0xef45('0x19')],'smsCurrentCapacity':this[_0xef45('0x2f')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this['openchannelStatusTime'],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0xef45('0x30')],'busy':this[_0xef45('0x31')],'busyQueue':this[_0xef45('0x1c')]};var _0x3039b0=md5(JSON[_0xef45('0x32')](_0x46e423));if(this[_0xef45('0x1')]!==_0x3039b0){this[_0xef45('0x1')]=_0x3039b0;io['emit']('user:save',_0x46e423);}};module[_0xef45('0x33')]=Agent; \ No newline at end of file +var _0x44a3=['stringify','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity','faxCurrentCapacity','smsStatusTime','smsCapacity','smsCurrentCapacity','openchannelStatusTime','openchannelCapacity','openchannelCurrentCapacity','busy','busyQueue','updateRealtime','prototype','getChannelStatus','CurrentCapacity','Capacity','maxcapacity','working','idle','mail','chat','openchannel','fax','sms','Status','toNumber','format','online','voicePause','chatStatus','chatStatusTime','mailStatus'];(function(_0x58d5ae,_0x5607fb){var _0x26d438=function(_0x14943f){while(--_0x14943f){_0x58d5ae['push'](_0x58d5ae['shift']());}};_0x26d438(++_0x5607fb);}(_0x44a3,0x1a9));var _0x344a=function(_0x5e9665,_0x439465){_0x5e9665=_0x5e9665-0x0;var _0x5bf400=_0x44a3[_0x5e9665];return _0x5bf400;};'use strict';var _=require(_0x344a('0x0'));var moment=require(_0x344a('0x1'));var md5=require(_0x344a('0x2'));var Redis=require(_0x344a('0x3'));var config=require(_0x344a('0x4'));config[_0x344a('0x5')]=_[_0x344a('0x6')](config[_0x344a('0x5')],{'host':'localhost','port':0x18eb});var io=require(_0x344a('0x7'))(new Redis(config[_0x344a('0x5')]));function Agent(_0x4351e4){this['id']=_0x4351e4['id']||0x0;this[_0x344a('0x8')]=_0x4351e4[_0x344a('0x8')]||'';this['online']=_0x4351e4['online']||!![];this['voicePause']=_0x4351e4['voicePause']||![];this[_0x344a('0x9')]=_0x4351e4[_0x344a('0x9')]||![];this[_0x344a('0xa')]=_0x4351e4[_0x344a('0xa')]||![];this[_0x344a('0xb')]=_0x4351e4['faxPause']||![];this[_0x344a('0xc')]=_0x4351e4[_0x344a('0xc')]||![];this['openchannelPause']=_0x4351e4[_0x344a('0xd')]||![];this['chatStatus']=_0x344a('0xe');this['chatStatusTime']=0x0;this[_0x344a('0xf')]=_0x4351e4[_0x344a('0xf')]||0x0;this['chatCurrentCapacity']=0x0;this['mailStatus']=_0x344a('0xe');this[_0x344a('0x10')]=0x0;this[_0x344a('0x11')]=_0x4351e4[_0x344a('0x11')]||0x0;this[_0x344a('0x12')]=0x0;this[_0x344a('0x13')]='unknown';this[_0x344a('0x14')]=0x0;this[_0x344a('0x15')]=_0x4351e4[_0x344a('0x15')]||0x0;this[_0x344a('0x16')]=0x0;this['smsStatus']='unknown';this[_0x344a('0x17')]=0x0;this[_0x344a('0x18')]=_0x4351e4[_0x344a('0x18')]||0x0;this[_0x344a('0x19')]=0x0;this['openchannelStatus']=_0x344a('0xe');this[_0x344a('0x1a')]=0x0;this['openchannelCapacity']=_0x4351e4[_0x344a('0x1b')]||0x0;this[_0x344a('0x1c')]=0x0;this[_0x344a('0x1d')]=![];this[_0x344a('0x1e')]=undefined;this[_0x344a('0x2')]='';this[_0x344a('0x1f')]();}Agent[_0x344a('0x20')][_0x344a('0x21')]=function(_0x1079ae){if(this[_0x1079ae+_0x344a('0x22')]>0x0){if(this[_0x1079ae+'Capacity']>0x0&&this[_0x1079ae+_0x344a('0x22')]>=this[_0x1079ae+_0x344a('0x23')]){return _0x344a('0x24');}else{return _0x344a('0x25');}}else{return _0x344a('0x26');}};Agent[_0x344a('0x20')][_0x344a('0x1f')]=function(){var _0x976bcf=[_0x344a('0x27'),_0x344a('0x28'),_0x344a('0x29'),_0x344a('0x2a'),_0x344a('0x2b')];for(var _0x266fce=0x0;_0x266fce<_0x976bcf['length'];_0x266fce+=0x1){var _0x6ccfba=this['getChannelStatus'](_0x976bcf[_0x266fce]);if(this[_0x976bcf[_0x266fce]+_0x344a('0x2c')]!==_0x6ccfba){this[_0x976bcf[_0x266fce]+'StatusTime']=_[_0x344a('0x2d')](moment()[_0x344a('0x2e')]('x'));}this[_0x976bcf[_0x266fce]+_0x344a('0x2c')]=_0x6ccfba;}var _0x16d404={'id':this['id'],'name':this[_0x344a('0x8')],'online':this[_0x344a('0x2f')],'voicePause':this[_0x344a('0x30')],'chatPause':this[_0x344a('0x9')],'mailPause':this['mailPause'],'smsPause':this[_0x344a('0xc')],'faxPause':this[_0x344a('0xb')],'openchannelPause':this[_0x344a('0xd')],'chatStatus':this[_0x344a('0x31')],'chatStatusTime':this[_0x344a('0x32')],'chatCapacity':this[_0x344a('0xf')],'chatCurrentCapacity':this['chatCurrentCapacity'],'mailStatus':this[_0x344a('0x33')],'mailStatusTime':this['mailStatusTime'],'mailCapacity':this['mailCapacity'],'mailCurrentCapacity':this[_0x344a('0x12')],'faxStatus':this[_0x344a('0x13')],'faxStatusTime':this[_0x344a('0x14')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this['faxCurrentCapacity'],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x344a('0x17')],'smsCapacity':this[_0x344a('0x18')],'smsCurrentCapacity':this[_0x344a('0x19')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x344a('0x1a')],'openchannelCapacity':this[_0x344a('0x1b')],'openchannelCurrentCapacity':this[_0x344a('0x1c')],'busy':this[_0x344a('0x1d')],'busyQueue':this[_0x344a('0x1e')]};var _0x1dec68=md5(JSON[_0x344a('0x34')](_0x16d404));if(this['md5']!==_0x1dec68){this[_0x344a('0x2')]=_0x1dec68;io['emit']('user:save',_0x16d404);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index cdc5283..4f9a6da 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 _0x19c5=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','prototype','updateRouting','_rr','updateRealtime','loggedIn','length','online','chatPause','paused','available','stringify','md5','format','emit','exports','util','ioredis','../../../config/environment','redis','defaults'];(function(_0x224ad9,_0x5d97a7){var _0x532997=function(_0x323951){while(--_0x323951){_0x224ad9['push'](_0x224ad9['shift']());}};_0x532997(++_0x5d97a7);}(_0x19c5,0x191));var _0x519c=function(_0x38eb23,_0x196e8b){_0x38eb23=_0x38eb23-0x0;var _0x48506a=_0x19c5[_0x38eb23];return _0x48506a;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x519c('0x0'));var Redis=require(_0x519c('0x1'));var config=require(_0x519c('0x2'));config[_0x519c('0x3')]=_[_0x519c('0x4')](config['redis'],{'host':_0x519c('0x5'),'port':0x18eb});var io=require(_0x519c('0x6'))(new Redis(config['redis']));function ChatQueue(_0x28b3d2){this['id']=_0x28b3d2['id']||0x0;this[_0x519c('0x7')]=_0x28b3d2[_0x519c('0x7')]||'';this[_0x519c('0x8')]=_0x28b3d2[_0x519c('0x8')]||0xa;this[_0x519c('0x9')]=_0x28b3d2[_0x519c('0x9')]||_0x519c('0xa');this[_0x519c('0xb')]=_0x28b3d2[_0x519c('0xb')];this[_0x519c('0xc')]={};this[_0x519c('0xd')]=0x0;this['md5']='';this['updateRouting']();this['updateRealtime']();}ChatQueue[_0x519c('0xe')][_0x519c('0xf')]=function(){var _0x5be5c0=this['mapAgentsId'][_0x519c('0x10')];this[_0x519c('0xc')]=_['map'](this[_0x519c('0xb')],'id');this[_0x519c('0xc')][_0x519c('0x10')]=_0x5be5c0;};ChatQueue['prototype'][_0x519c('0x11')]=function(){this[_0x519c('0x12')]=0x0;this['paused']=0x0;for(var _0x4945ec=0x0;_0x4945ec=0x0?this['available']:0x0;var _0x1903cc={'id':this['id'],'available':this[_0x519c('0x17')],'loggedIn':this[_0x519c('0x12')],'name':this[_0x519c('0x7')],'paused':this[_0x519c('0x16')],'waiting':this[_0x519c('0xd')]};var _0x334edf=md5(JSON[_0x519c('0x18')](_0x1903cc));if(this[_0x519c('0x19')]!==_0x334edf){this['md5']=_0x334edf;io['to'](util[_0x519c('0x1a')]('chat:queue:%s',_0x1903cc[_0x519c('0x7')]))[_0x519c('0x1b')]('chat_queue:save',_0x1903cc);}};module[_0x519c('0x1c')]=ChatQueue; \ No newline at end of file +var _0x9064=['redis','defaults','localhost','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length','paused','available','stringify','emit','exports','lodash','md5','ioredis','../../../config/environment'];(function(_0x11f480,_0x326799){var _0x45e936=function(_0x2d77bb){while(--_0x2d77bb){_0x11f480['push'](_0x11f480['shift']());}};_0x45e936(++_0x326799);}(_0x9064,0x79));var _0x4906=function(_0x51248e,_0xf18af7){_0x51248e=_0x51248e-0x0;var _0x2ebed6=_0x9064[_0x51248e];return _0x2ebed6;};'use strict';var _=require(_0x4906('0x0'));var md5=require(_0x4906('0x1'));var util=require('util');var Redis=require(_0x4906('0x2'));var config=require(_0x4906('0x3'));config[_0x4906('0x4')]=_[_0x4906('0x5')](config[_0x4906('0x4')],{'host':_0x4906('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4906('0x4')]));function ChatQueue(_0x320c04){this['id']=_0x320c04['id']||0x0;this[_0x4906('0x7')]=_0x320c04['name']||'';this['timeout']=_0x320c04[_0x4906('0x8')]||0xa;this[_0x4906('0x9')]=_0x320c04['strategy']||_0x4906('0xa');this[_0x4906('0xb')]=_0x320c04['Agents'];this[_0x4906('0xc')]={};this[_0x4906('0xd')]=0x0;this[_0x4906('0x1')]='';this[_0x4906('0xe')]();this[_0x4906('0xf')]();}ChatQueue[_0x4906('0x10')][_0x4906('0xe')]=function(){var _0x1a1977=this[_0x4906('0xc')][_0x4906('0x11')];this[_0x4906('0xc')]=_['map'](this[_0x4906('0xb')],'id');this[_0x4906('0xc')][_0x4906('0x11')]=_0x1a1977;};ChatQueue[_0x4906('0x10')][_0x4906('0xf')]=function(){this[_0x4906('0x12')]=0x0;this['paused']=0x0;for(var _0x1bc953=0x0;_0x1bc953=0x0?this[_0x4906('0x15')]:0x0;var _0x158d68={'id':this['id'],'available':this[_0x4906('0x15')],'loggedIn':this[_0x4906('0x12')],'name':this[_0x4906('0x7')],'paused':this[_0x4906('0x14')],'waiting':this[_0x4906('0xd')]};var _0x270b2c=md5(JSON[_0x4906('0x16')](_0x158d68));if(this[_0x4906('0x1')]!==_0x270b2c){this[_0x4906('0x1')]=_0x270b2c;io['to'](util['format']('chat:queue:%s',_0x158d68[_0x4906('0x7')]))[_0x4906('0x17')]('chat_queue:save',_0x158d68);}};module[_0x4906('0x18')]=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index df2e910..b1344dc 100644 --- a/server/services/routing/model/faxQueue.js +++ b/server/services/routing/model/faxQueue.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x4d5e21,_0x186125){var _0x48e8b1=function(_0x528021){while(--_0x528021){_0x4d5e21['push'](_0x4d5e21['shift']());}};_0x48e8b1(++_0x186125);}(_0xa9e0,0x123));var _0x0a9e=function(_0x18a79d,_0x57bd2c){_0x18a79d=_0x18a79d-0x0;var _0x4f8848=_0xa9e0[_0x18a79d];return _0x4f8848;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x38476c,_0x20612b){var _0x55ff5d=function(_0xeeef77){while(--_0xeeef77){_0x38476c['push'](_0x38476c['shift']());}};_0x55ff5d(++_0x20612b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x38a7ac,_0x45514b){_0x38a7ac=_0x38a7ac-0x0;var _0x53061a=_0xa9e0[_0x38a7ac];return _0x53061a;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index cbce9ed..c3ed4b9 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 _0x6123=['Intervals','name'];(function(_0xe93ae4,_0x1e7cc8){var _0x31c485=function(_0x209ee7){while(--_0x209ee7){_0xe93ae4['push'](_0xe93ae4['shift']());}};_0x31c485(++_0x1e7cc8);}(_0x6123,0x155));var _0x3612=function(_0x4dbeaa,_0x3fb85d){_0x4dbeaa=_0x4dbeaa-0x0;var _0x889e79=_0x6123[_0x4dbeaa];return _0x889e79;};'use strict';function Interval(_0x2d7796){this['id']=_0x2d7796['id']||0x0;this[_0x3612('0x0')]=_0x2d7796[_0x3612('0x0')]||'';this[_0x3612('0x1')]=_0x2d7796[_0x3612('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0xabb0=['name','Intervals','exports'];(function(_0x42ff12,_0x4dff9a){var _0x1e6b3c=function(_0x1aca60){while(--_0x1aca60){_0x42ff12['push'](_0x42ff12['shift']());}};_0x1e6b3c(++_0x4dff9a);}(_0xabb0,0xae));var _0x0abb=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xabb0[_0x19e35c];return _0x3e1fe8;};'use strict';function Interval(_0x1be71){this['id']=_0x1be71['id']||0x0;this['name']=_0x1be71[_0x0abb('0x0')]||'';this[_0x0abb('0x1')]=_0x1be71['Intervals']||{};}module[_0x0abb('0x2')]=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 606b446..6649652 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 _0xce2e=['available','loggedIn','name','stringify','format','mail:queue:%s','emit','mail_queue:save','lodash','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','timeout','beepall','Agents','waiting','updateRealtime','prototype','mapAgentsId','_rr','length','online','mailPause','paused'];(function(_0x3ad8da,_0x1a97a5){var _0x1cd244=function(_0x26722c){while(--_0x26722c){_0x3ad8da['push'](_0x3ad8da['shift']());}};_0x1cd244(++_0x1a97a5);}(_0xce2e,0x1d8));var _0xece2=function(_0x175aa1,_0x24b413){_0x175aa1=_0x175aa1-0x0;var _0x827072=_0xce2e[_0x175aa1];return _0x827072;};'use strict';var _=require(_0xece2('0x0'));var md5=require(_0xece2('0x1'));var util=require(_0xece2('0x2'));var Redis=require(_0xece2('0x3'));var config=require(_0xece2('0x4'));config[_0xece2('0x5')]=_[_0xece2('0x6')](config['redis'],{'host':_0xece2('0x7'),'port':0x18eb});var io=require(_0xece2('0x8'))(new Redis(config[_0xece2('0x5')]));function MailQueue(_0x259e94){this['id']=_0x259e94['id']||0x0;this['name']=_0x259e94['name']||'';this[_0xece2('0x9')]=_0x259e94[_0xece2('0x9')]||0xa;this['strategy']=_0x259e94['strategy']||_0xece2('0xa');this[_0xece2('0xb')]=_0x259e94[_0xece2('0xb')];this['mapAgentsId']={};this[_0xece2('0xc')]=0x0;this['md5']='';this['updateRouting']();this[_0xece2('0xd')]();}MailQueue[_0xece2('0xe')]['updateRouting']=function(){var _0x229d2f=this[_0xece2('0xf')][_0xece2('0x10')];this['mapAgentsId']=_['map'](this[_0xece2('0xb')],'id');this[_0xece2('0xf')][_0xece2('0x10')]=_0x229d2f;};MailQueue[_0xece2('0xe')]['updateRealtime']=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x14ffa4=0x0;_0x14ffa4=0x0?this[_0xece2('0x15')]:0x0;var _0x1b17ee={'id':this['id'],'available':this[_0xece2('0x15')],'loggedIn':this[_0xece2('0x16')],'name':this[_0xece2('0x17')],'paused':this[_0xece2('0x14')],'waiting':this[_0xece2('0xc')]};var _0x41c7eb=md5(JSON[_0xece2('0x18')](_0x1b17ee));if(this[_0xece2('0x1')]!==_0x41c7eb){this[_0xece2('0x1')]=_0x41c7eb;io['to'](util[_0xece2('0x19')](_0xece2('0x1a'),_0x1b17ee[_0xece2('0x17')]))[_0xece2('0x1b')](_0xece2('0x1c'),_0x1b17ee);}};module['exports']=MailQueue; \ No newline at end of file +var _0xbe26=['localhost','socket.io-emitter','timeout','strategy','beepall','Agents','prototype','updateRouting','mapAgentsId','_rr','updateRealtime','paused','length','mailPause','available','loggedIn','name','waiting','stringify','mail:queue:%s','mail_queue:save','md5','util','ioredis','redis','defaults'];(function(_0x542208,_0x4d719e){var _0x4c7290=function(_0x131567){while(--_0x131567){_0x542208['push'](_0x542208['shift']());}};_0x4c7290(++_0x4d719e);}(_0xbe26,0x7d));var _0x6be2=function(_0x241489,_0x1ee9da){_0x241489=_0x241489-0x0;var _0x2d2d91=_0xbe26[_0x241489];return _0x2d2d91;};'use strict';var _=require('lodash');var md5=require(_0x6be2('0x0'));var util=require(_0x6be2('0x1'));var Redis=require(_0x6be2('0x2'));var config=require('../../../config/environment');config[_0x6be2('0x3')]=_[_0x6be2('0x4')](config['redis'],{'host':_0x6be2('0x5'),'port':0x18eb});var io=require(_0x6be2('0x6'))(new Redis(config[_0x6be2('0x3')]));function MailQueue(_0x545663){this['id']=_0x545663['id']||0x0;this['name']=_0x545663['name']||'';this['timeout']=_0x545663[_0x6be2('0x7')]||0xa;this['strategy']=_0x545663[_0x6be2('0x8')]||_0x6be2('0x9');this[_0x6be2('0xa')]=_0x545663[_0x6be2('0xa')];this['mapAgentsId']={};this['waiting']=0x0;this[_0x6be2('0x0')]='';this['updateRouting']();this['updateRealtime']();}MailQueue[_0x6be2('0xb')][_0x6be2('0xc')]=function(){var _0x4617c0=this[_0x6be2('0xd')][_0x6be2('0xe')];this[_0x6be2('0xd')]=_['map'](this['Agents'],'id');this[_0x6be2('0xd')][_0x6be2('0xe')]=_0x4617c0;};MailQueue[_0x6be2('0xb')][_0x6be2('0xf')]=function(){this['loggedIn']=0x0;this[_0x6be2('0x10')]=0x0;for(var _0x45a671=0x0;_0x45a671=0x0?this[_0x6be2('0x13')]:0x0;var _0x5407d3={'id':this['id'],'available':this[_0x6be2('0x13')],'loggedIn':this[_0x6be2('0x14')],'name':this[_0x6be2('0x15')],'paused':this[_0x6be2('0x10')],'waiting':this[_0x6be2('0x16')]};var _0x543a17=md5(JSON[_0x6be2('0x17')](_0x5407d3));if(this[_0x6be2('0x0')]!==_0x543a17){this[_0x6be2('0x0')]=_0x543a17;io['to'](util['format'](_0x6be2('0x18'),_0x5407d3[_0x6be2('0x15')]))['emit'](_0x6be2('0x19'),_0x5407d3);}};module['exports']=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index 0bd7aa6..6c09617 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 _0x1373=['updateRouting','updateRealtime','prototype','loggedIn','paused','length','openchannelPause','available','stringify','format','emit','openchannel_queue:save','exports','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5'];(function(_0x432682,_0x253044){var _0x463d05=function(_0xa73403){while(--_0xa73403){_0x432682['push'](_0x432682['shift']());}};_0x463d05(++_0x253044);}(_0x1373,0x81));var _0x3137=function(_0x1e8a6d,_0x20f0b4){_0x1e8a6d=_0x1e8a6d-0x0;var _0x4a3fd3=_0x1373[_0x1e8a6d];return _0x4a3fd3;};'use strict';var _=require(_0x3137('0x0'));var md5=require('md5');var util=require(_0x3137('0x1'));var Redis=require(_0x3137('0x2'));var config=require(_0x3137('0x3'));config[_0x3137('0x4')]=_[_0x3137('0x5')](config['redis'],{'host':_0x3137('0x6'),'port':0x18eb});var io=require(_0x3137('0x7'))(new Redis(config['redis']));function OpenchannelQueue(_0x181eae){this['id']=_0x181eae['id']||0x0;this[_0x3137('0x8')]=_0x181eae[_0x3137('0x8')]||'';this[_0x3137('0x9')]=_0x181eae[_0x3137('0x9')]||0xa;this['strategy']=_0x181eae[_0x3137('0xa')]||_0x3137('0xb');this[_0x3137('0xc')]=_0x181eae[_0x3137('0xc')];this[_0x3137('0xd')]={};this[_0x3137('0xe')]=0x0;this[_0x3137('0xf')]='';this[_0x3137('0x10')]();this[_0x3137('0x11')]();}OpenchannelQueue[_0x3137('0x12')]['updateRouting']=function(){var _0x5fd12c=this[_0x3137('0xd')]['_rr'];this[_0x3137('0xd')]=_['map'](this['Agents'],'id');this['mapAgentsId']['_rr']=_0x5fd12c;};OpenchannelQueue[_0x3137('0x12')]['updateRealtime']=function(){this[_0x3137('0x13')]=0x0;this[_0x3137('0x14')]=0x0;for(var _0x524a84=0x0;_0x524a84=0x0?this[_0x3137('0x17')]:0x0;var _0x4e7c22={'id':this['id'],'available':this['available'],'loggedIn':this[_0x3137('0x13')],'name':this[_0x3137('0x8')],'paused':this[_0x3137('0x14')],'waiting':this[_0x3137('0xe')]};var _0x801560=md5(JSON[_0x3137('0x18')](_0x4e7c22));if(this[_0x3137('0xf')]!==_0x801560){this[_0x3137('0xf')]=_0x801560;io['to'](util[_0x3137('0x19')]('openchannel:queue:%s',_0x4e7c22[_0x3137('0x8')]))[_0x3137('0x1a')](_0x3137('0x1b'),_0x4e7c22);}};module[_0x3137('0x1c')]=OpenchannelQueue; \ No newline at end of file +var _0x2250=['name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','loggedIn','paused','length','online','openchannelPause','available','waiting','format','openchannel:queue:%s','emit','openchannel_queue:save','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter'];(function(_0x44b816,_0x2af972){var _0xdfaa68=function(_0x2a2cde){while(--_0x2a2cde){_0x44b816['push'](_0x44b816['shift']());}};_0xdfaa68(++_0x2af972);}(_0x2250,0x17e));var _0x0225=function(_0xe0b81f,_0x1fb734){_0xe0b81f=_0xe0b81f-0x0;var _0x290e5e=_0x2250[_0xe0b81f];return _0x290e5e;};'use strict';var _=require('lodash');var md5=require(_0x0225('0x0'));var util=require(_0x0225('0x1'));var Redis=require(_0x0225('0x2'));var config=require(_0x0225('0x3'));config[_0x0225('0x4')]=_[_0x0225('0x5')](config[_0x0225('0x4')],{'host':_0x0225('0x6'),'port':0x18eb});var io=require(_0x0225('0x7'))(new Redis(config[_0x0225('0x4')]));function OpenchannelQueue(_0x2d1dc7){this['id']=_0x2d1dc7['id']||0x0;this[_0x0225('0x8')]=_0x2d1dc7[_0x0225('0x8')]||'';this[_0x0225('0x9')]=_0x2d1dc7['timeout']||0xa;this['strategy']=_0x2d1dc7[_0x0225('0xa')]||_0x0225('0xb');this['Agents']=_0x2d1dc7[_0x0225('0xc')];this[_0x0225('0xd')]={};this['waiting']=0x0;this[_0x0225('0x0')]='';this[_0x0225('0xe')]();this[_0x0225('0xf')]();}OpenchannelQueue[_0x0225('0x10')]['updateRouting']=function(){var _0x302202=this[_0x0225('0xd')]['_rr'];this['mapAgentsId']=_[_0x0225('0x11')](this['Agents'],'id');this[_0x0225('0xd')][_0x0225('0x12')]=_0x302202;};OpenchannelQueue[_0x0225('0x10')][_0x0225('0xf')]=function(){this[_0x0225('0x13')]=0x0;this[_0x0225('0x14')]=0x0;for(var _0x359359=0x0;_0x359359=0x0?this[_0x0225('0x18')]:0x0;var _0x256da9={'id':this['id'],'available':this[_0x0225('0x18')],'loggedIn':this['loggedIn'],'name':this[_0x0225('0x8')],'paused':this[_0x0225('0x14')],'waiting':this[_0x0225('0x19')]};var _0x4e2b7e=md5(JSON['stringify'](_0x256da9));if(this['md5']!==_0x4e2b7e){this[_0x0225('0x0')]=_0x4e2b7e;io['to'](util[_0x0225('0x1a')](_0x0225('0x1b'),_0x256da9[_0x0225('0x8')]))[_0x0225('0x1c')](_0x0225('0x1d'),_0x256da9);}};module['exports']=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 83e88c7..05472bb 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 _0x0713=['smsPause','paused','available','stringify','sms:queue:%s','emit','sms_queue:save','exports','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','waiting','md5','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','length','online'];(function(_0x2e2c6a,_0x590094){var _0x93c4a4=function(_0x13fd83){while(--_0x13fd83){_0x2e2c6a['push'](_0x2e2c6a['shift']());}};_0x93c4a4(++_0x590094);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var md5=require('md5');var util=require(_0x3071('0x0'));var Redis=require(_0x3071('0x1'));var config=require(_0x3071('0x2'));config[_0x3071('0x3')]=_[_0x3071('0x4')](config['redis'],{'host':_0x3071('0x5'),'port':0x18eb});var io=require(_0x3071('0x6'))(new Redis(config[_0x3071('0x3')]));function SmsQueue(_0x3137c8){this['id']=_0x3137c8['id']||0x0;this[_0x3071('0x7')]=_0x3137c8[_0x3071('0x7')]||'';this[_0x3071('0x8')]=_0x3137c8[_0x3071('0x8')]||0xa;this[_0x3071('0x9')]=_0x3137c8[_0x3071('0x9')]||_0x3071('0xa');this[_0x3071('0xb')]=_0x3137c8[_0x3071('0xb')];this['mapAgentsId']={};this[_0x3071('0xc')]=0x0;this[_0x3071('0xd')]='';this[_0x3071('0xe')]();this[_0x3071('0xf')]();}SmsQueue[_0x3071('0x10')]['updateRouting']=function(){var _0x2ace21=this[_0x3071('0x11')][_0x3071('0x12')];this[_0x3071('0x11')]=_[_0x3071('0x13')](this['Agents'],'id');this['mapAgentsId'][_0x3071('0x12')]=_0x2ace21;};SmsQueue['prototype'][_0x3071('0xf')]=function(){this[_0x3071('0x14')]=0x0;this['paused']=0x0;for(var _0x104e73=0x0;_0x104e73=0x0?this[_0x3071('0x19')]:0x0;var _0x1068d9={'id':this['id'],'available':this[_0x3071('0x19')],'loggedIn':this[_0x3071('0x14')],'name':this[_0x3071('0x7')],'paused':this[_0x3071('0x18')],'waiting':this[_0x3071('0xc')]};var _0x502a16=md5(JSON[_0x3071('0x1a')](_0x1068d9));if(this[_0x3071('0xd')]!==_0x502a16){this[_0x3071('0xd')]=_0x502a16;io['to'](util['format'](_0x3071('0x1b'),_0x1068d9['name']))[_0x3071('0x1c')](_0x3071('0x1d'),_0x1068d9);}};module[_0x3071('0x1e')]=SmsQueue; \ No newline at end of file +var _0xbaf0=['online','paused','available','format','sms:queue:%s','emit','sms_queue:save','exports','md5','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','loggedIn','length'];(function(_0x450689,_0x3b857c){var _0x46ffb0=function(_0x5d3679){while(--_0x5d3679){_0x450689['push'](_0x450689['shift']());}};_0x46ffb0(++_0x3b857c);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'use strict';var _=require('lodash');var md5=require(_0x0baf('0x0'));var util=require(_0x0baf('0x1'));var Redis=require(_0x0baf('0x2'));var config=require(_0x0baf('0x3'));config[_0x0baf('0x4')]=_[_0x0baf('0x5')](config['redis'],{'host':_0x0baf('0x6'),'port':0x18eb});var io=require(_0x0baf('0x7'))(new Redis(config[_0x0baf('0x4')]));function SmsQueue(_0x39b8f3){this['id']=_0x39b8f3['id']||0x0;this[_0x0baf('0x8')]=_0x39b8f3[_0x0baf('0x8')]||'';this[_0x0baf('0x9')]=_0x39b8f3[_0x0baf('0x9')]||0xa;this[_0x0baf('0xa')]=_0x39b8f3['strategy']||_0x0baf('0xb');this['Agents']=_0x39b8f3[_0x0baf('0xc')];this[_0x0baf('0xd')]={};this[_0x0baf('0xe')]=0x0;this[_0x0baf('0x0')]='';this[_0x0baf('0xf')]();this[_0x0baf('0x10')]();}SmsQueue[_0x0baf('0x11')][_0x0baf('0xf')]=function(){var _0x1fc6b2=this[_0x0baf('0xd')][_0x0baf('0x12')];this['mapAgentsId']=_['map'](this[_0x0baf('0xc')],'id');this[_0x0baf('0xd')][_0x0baf('0x12')]=_0x1fc6b2;};SmsQueue[_0x0baf('0x11')]['updateRealtime']=function(){this[_0x0baf('0x13')]=0x0;this['paused']=0x0;for(var _0x1c76a8=0x0;_0x1c76a8=0x0?this['available']:0x0;var _0x63c820={'id':this['id'],'available':this[_0x0baf('0x17')],'loggedIn':this[_0x0baf('0x13')],'name':this[_0x0baf('0x8')],'paused':this[_0x0baf('0x16')],'waiting':this[_0x0baf('0xe')]};var _0x4ff793=md5(JSON['stringify'](_0x63c820));if(this[_0x0baf('0x0')]!==_0x4ff793){this[_0x0baf('0x0')]=_0x4ff793;io['to'](util[_0x0baf('0x18')](_0x0baf('0x19'),_0x63c820[_0x0baf('0x8')]))[_0x0baf('0x1a')](_0x0baf('0x1b'),_0x63c820);}};module[_0x0baf('0x1c')]=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index b0630a6..05d94f2 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 _0x1845=['../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','intervals','openchannelQueues','chatQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','initAgents','agents','length','initIntervals','isUndefined','mergeFromDatabase','initOpenchannelQueues','updateRealtime','initChatQueues','updateRouting','initSmsQueues','smsQueues','initMailQueues','mailQueues','util','../model/agent'];(function(_0x3f73a7,_0x22dfe3){var _0x2f3cb8=function(_0x352d25){while(--_0x352d25){_0x3f73a7['push'](_0x3f73a7['shift']());}};_0x2f3cb8(++_0x22dfe3);}(_0x1845,0x11e));var _0x5184=function(_0x338b8a,_0x29e743){_0x338b8a=_0x338b8a-0x0;var _0x390762=_0x1845[_0x338b8a];return _0x390762;};'use strict';var BPromise=require('bluebird');var util=require(_0x5184('0x0'));var _=require('lodash');var moment=require('moment');var Agent=require(_0x5184('0x1'));var Interval=require(_0x5184('0x2'));var OpenchannelQueue=require(_0x5184('0x3'));var ChatQueue=require(_0x5184('0x4'));var SmsQueue=require(_0x5184('0x5'));var MailQueue=require(_0x5184('0x6'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this['agents']={};this[_0x5184('0x7')]={};this[_0x5184('0x8')]={};this[_0x5184('0x9')]={};this['smsQueues']={};this['mailQueues']={};this[_0x5184('0xa')]={};this[_0x5184('0xb')]={};this[_0x5184('0xc')]={};this[_0x5184('0xd')]={};this[_0x5184('0xe')]={};this[_0x5184('0xf')]={};};function freeIsNotKey(_0x3c60c1,_0x249294,_0x5302e5){var _0x16b120=_[_0x5184('0x10')](_0x3c60c1,function(_0x10e9b8,_0x73de9c){return _0x10e9b8[_0x5302e5];});for(var _0x13e737 in _0x249294){if(_0x249294['hasOwnProperty'](_0x13e737)){if(!_0x16b120[_0x13e737]){delete _0x249294[_0x13e737];}}}}Realtime[_0x5184('0x11')]['mergeFromDatabase']=function(_0x2f7043,_0x2fabc9){for(var _0x37ac78 in _0x2fabc9){if(_0x2f7043['hasOwnProperty'](_0x37ac78)){_0x2f7043[_0x37ac78]=_0x2fabc9[_0x37ac78];}}};Realtime[_0x5184('0x11')][_0x5184('0x12')]=function(){var _0x2ca759=this;return function(_0xdf4eda){if(_0xdf4eda){freeIsNotKey(_0xdf4eda,_0x2ca759[_0x5184('0x13')],'id');for(var _0x537278=0x0,_0x3de958={},_0x528c40={};_0x537278<_0xdf4eda[_0x5184('0x14')];_0x537278+=0x1){_0x3de958=_0xdf4eda[_0x537278];if(_['isUndefined'](_0x2ca759[_0x5184('0x13')][_0x3de958['id']])){_0x2ca759[_0x5184('0x13')][_0x3de958['id']]=new Agent(_0x3de958);}else{_0x2ca759['mergeFromDatabase'](_0x2ca759[_0x5184('0x13')][_0x3de958['id']],_0x3de958);}}}return _0x2ca759[_0x5184('0x13')];};};Realtime[_0x5184('0x11')][_0x5184('0x15')]=function(){var _0x550acf=this;return function(_0x4440a5){if(_0x4440a5){freeIsNotKey(_0x4440a5,_0x550acf[_0x5184('0x7')],'id');for(var _0xa459e=0x0,_0x147882={},_0x376066={};_0xa459e<_0x4440a5['length'];_0xa459e+=0x1){_0x147882=_0x4440a5[_0xa459e];if(_[_0x5184('0x16')](_0x550acf[_0x5184('0x7')][_0x147882['id']])){_0x550acf['intervals'][_0x147882['id']]=new Interval(_0x147882);}else{_0x550acf[_0x5184('0x17')](_0x550acf['intervals'][_0x147882['id']],_0x147882);}}}return _0x550acf['intervals'];};};Realtime[_0x5184('0x11')][_0x5184('0x18')]=function(){var _0x2e4d85=this;return function(_0x47d8f6){if(_0x47d8f6){freeIsNotKey(_0x47d8f6,_0x2e4d85[_0x5184('0x8')],'id');for(var _0x108416=0x0,_0x394930={},_0x15791f={};_0x108416<_0x47d8f6['length'];_0x108416+=0x1){_0x394930=_0x47d8f6[_0x108416];if(_[_0x5184('0x16')](_0x2e4d85[_0x5184('0x8')][_0x394930['id']])){_0x2e4d85[_0x5184('0x8')][_0x394930['id']]=new OpenchannelQueue(_0x394930);}else{_0x2e4d85[_0x5184('0x17')](_0x2e4d85[_0x5184('0x8')][_0x394930['id']],_0x394930);}_0x2e4d85[_0x5184('0x8')][_0x394930['id']]['updateRouting']();_0x2e4d85[_0x5184('0x8')][_0x394930['id']][_0x5184('0x19')]();}}return _0x2e4d85[_0x5184('0x8')];};};Realtime[_0x5184('0x11')][_0x5184('0x1a')]=function(){var _0x5dab7b=this;return function(_0x4a32a0){if(_0x4a32a0){freeIsNotKey(_0x4a32a0,_0x5dab7b['chatQueues'],'id');for(var _0x22cf74=0x0,_0xe81e73={},_0x451cf4={};_0x22cf74<_0x4a32a0[_0x5184('0x14')];_0x22cf74+=0x1){_0xe81e73=_0x4a32a0[_0x22cf74];if(_['isUndefined'](_0x5dab7b[_0x5184('0x9')][_0xe81e73['id']])){_0x5dab7b[_0x5184('0x9')][_0xe81e73['id']]=new ChatQueue(_0xe81e73);}else{_0x5dab7b[_0x5184('0x17')](_0x5dab7b[_0x5184('0x9')][_0xe81e73['id']],_0xe81e73);}_0x5dab7b[_0x5184('0x9')][_0xe81e73['id']][_0x5184('0x1b')]();_0x5dab7b[_0x5184('0x9')][_0xe81e73['id']][_0x5184('0x19')]();}}return _0x5dab7b[_0x5184('0x9')];};};Realtime[_0x5184('0x11')][_0x5184('0x1c')]=function(){var _0x3c5aa8=this;return function(_0x10e0db){if(_0x10e0db){freeIsNotKey(_0x10e0db,_0x3c5aa8[_0x5184('0x1d')],'id');for(var _0x391519=0x0,_0x5b7dd8={},_0x3a7b27={};_0x391519<_0x10e0db['length'];_0x391519+=0x1){_0x5b7dd8=_0x10e0db[_0x391519];if(_['isUndefined'](_0x3c5aa8['smsQueues'][_0x5b7dd8['id']])){_0x3c5aa8[_0x5184('0x1d')][_0x5b7dd8['id']]=new SmsQueue(_0x5b7dd8);}else{_0x3c5aa8['mergeFromDatabase'](_0x3c5aa8['smsQueues'][_0x5b7dd8['id']],_0x5b7dd8);}_0x3c5aa8[_0x5184('0x1d')][_0x5b7dd8['id']][_0x5184('0x1b')]();_0x3c5aa8[_0x5184('0x1d')][_0x5b7dd8['id']][_0x5184('0x19')]();}}return _0x3c5aa8[_0x5184('0x1d')];};};Realtime[_0x5184('0x11')][_0x5184('0x1e')]=function(){var _0x5a2d09=this;return function(_0x32de69){if(_0x32de69){freeIsNotKey(_0x32de69,_0x5a2d09[_0x5184('0x1f')],'id');for(var _0x1b4105=0x0,_0x225cec={},_0x2c3ba2={};_0x1b4105<_0x32de69['length'];_0x1b4105+=0x1){_0x225cec=_0x32de69[_0x1b4105];if(_['isUndefined'](_0x5a2d09[_0x5184('0x1f')][_0x225cec['id']])){_0x5a2d09['mailQueues'][_0x225cec['id']]=new MailQueue(_0x225cec);}else{_0x5a2d09['mergeFromDatabase'](_0x5a2d09[_0x5184('0x1f')][_0x225cec['id']],_0x225cec);}_0x5a2d09[_0x5184('0x1f')][_0x225cec['id']][_0x5184('0x1b')]();_0x5a2d09['mailQueues'][_0x225cec['id']]['updateRealtime']();}}return _0x5a2d09[_0x5184('0x1f')];};};Realtime[_0x5184('0x11')]['initFaxQueues']=function(){var _0x4cd32c=this;return function(_0x3f351a){if(_0x3f351a){freeIsNotKey(_0x3f351a,_0x4cd32c['faxQueues'],'id');for(var _0x2fdde3=0x0,_0x1ee690={},_0x310c40={};_0x2fdde3<_0x3f351a[_0x5184('0x14')];_0x2fdde3+=0x1){_0x1ee690=_0x3f351a[_0x2fdde3];if(_[_0x5184('0x16')](_0x4cd32c[_0x5184('0xa')][_0x1ee690['id']])){_0x4cd32c[_0x5184('0xa')][_0x1ee690['id']]=new FaxQueue(_0x1ee690);}else{_0x4cd32c[_0x5184('0x17')](_0x4cd32c[_0x5184('0xa')][_0x1ee690['id']],_0x1ee690);}_0x4cd32c[_0x5184('0xa')][_0x1ee690['id']]['updateRouting']();_0x4cd32c[_0x5184('0xa')][_0x1ee690['id']][_0x5184('0x19')]();}}return _0x4cd32c[_0x5184('0xa')];};};module['exports']=Realtime; \ No newline at end of file +var _0x847c=['initAgents','length','isUndefined','initIntervals','openchannelQueues','updateRouting','initChatQueues','chatQueues','updateRealtime','smsQueues','initMailQueues','initFaxQueues','exports','bluebird','util','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','../model/faxQueue','agents','intervals','mailQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','hasOwnProperty','mergeFromDatabase','prototype'];(function(_0x183256,_0x1a596d){var _0x5394a2=function(_0x192025){while(--_0x192025){_0x183256['push'](_0x183256['shift']());}};_0x5394a2(++_0x1a596d);}(_0x847c,0xdf));var _0xc847=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x847c[_0x5d2803];return _0xdcad2c;};'use strict';var BPromise=require(_0xc847('0x0'));var util=require(_0xc847('0x1'));var _=require(_0xc847('0x2'));var moment=require(_0xc847('0x3'));var Agent=require(_0xc847('0x4'));var Interval=require(_0xc847('0x5'));var OpenchannelQueue=require(_0xc847('0x6'));var ChatQueue=require(_0xc847('0x7'));var SmsQueue=require(_0xc847('0x8'));var MailQueue=require(_0xc847('0x9'));var FaxQueue=require(_0xc847('0xa'));var Realtime=function(){this[_0xc847('0xb')]={};this[_0xc847('0xc')]={};this['openchannelQueues']={};this['chatQueues']={};this['smsQueues']={};this[_0xc847('0xd')]={};this[_0xc847('0xe')]={};this[_0xc847('0xf')]={};this[_0xc847('0x10')]={};this[_0xc847('0x11')]={};this['smsQueuesWaitingInteractions']={};this[_0xc847('0x12')]={};};function freeIsNotKey(_0xc2dcfc,_0x1fe5f5,_0x2689de){var _0x19ad1f=_['mapKeys'](_0xc2dcfc,function(_0x40d222,_0x2b933d){return _0x40d222[_0x2689de];});for(var _0x1735a in _0x1fe5f5){if(_0x1fe5f5[_0xc847('0x13')](_0x1735a)){if(!_0x19ad1f[_0x1735a]){delete _0x1fe5f5[_0x1735a];}}}}Realtime['prototype'][_0xc847('0x14')]=function(_0x22db62,_0x406870){for(var _0x2243c5 in _0x406870){if(_0x22db62[_0xc847('0x13')](_0x2243c5)){_0x22db62[_0x2243c5]=_0x406870[_0x2243c5];}}};Realtime[_0xc847('0x15')][_0xc847('0x16')]=function(){var _0x1cfb37=this;return function(_0x1ed2db){if(_0x1ed2db){freeIsNotKey(_0x1ed2db,_0x1cfb37[_0xc847('0xb')],'id');for(var _0x20b9fd=0x0,_0x15d7a9={},_0x8d15d8={};_0x20b9fd<_0x1ed2db[_0xc847('0x17')];_0x20b9fd+=0x1){_0x15d7a9=_0x1ed2db[_0x20b9fd];if(_[_0xc847('0x18')](_0x1cfb37['agents'][_0x15d7a9['id']])){_0x1cfb37[_0xc847('0xb')][_0x15d7a9['id']]=new Agent(_0x15d7a9);}else{_0x1cfb37[_0xc847('0x14')](_0x1cfb37['agents'][_0x15d7a9['id']],_0x15d7a9);}}}return _0x1cfb37[_0xc847('0xb')];};};Realtime['prototype'][_0xc847('0x19')]=function(){var _0x5da90a=this;return function(_0xb6c053){if(_0xb6c053){freeIsNotKey(_0xb6c053,_0x5da90a[_0xc847('0xc')],'id');for(var _0x322fb3=0x0,_0x4d43c1={},_0x4e6194={};_0x322fb3<_0xb6c053[_0xc847('0x17')];_0x322fb3+=0x1){_0x4d43c1=_0xb6c053[_0x322fb3];if(_[_0xc847('0x18')](_0x5da90a[_0xc847('0xc')][_0x4d43c1['id']])){_0x5da90a[_0xc847('0xc')][_0x4d43c1['id']]=new Interval(_0x4d43c1);}else{_0x5da90a[_0xc847('0x14')](_0x5da90a[_0xc847('0xc')][_0x4d43c1['id']],_0x4d43c1);}}}return _0x5da90a[_0xc847('0xc')];};};Realtime['prototype']['initOpenchannelQueues']=function(){var _0x2f0f4e=this;return function(_0x1a0937){if(_0x1a0937){freeIsNotKey(_0x1a0937,_0x2f0f4e['openchannelQueues'],'id');for(var _0x494e98=0x0,_0x4c4d0c={},_0x248408={};_0x494e98<_0x1a0937[_0xc847('0x17')];_0x494e98+=0x1){_0x4c4d0c=_0x1a0937[_0x494e98];if(_[_0xc847('0x18')](_0x2f0f4e[_0xc847('0x1a')][_0x4c4d0c['id']])){_0x2f0f4e[_0xc847('0x1a')][_0x4c4d0c['id']]=new OpenchannelQueue(_0x4c4d0c);}else{_0x2f0f4e['mergeFromDatabase'](_0x2f0f4e['openchannelQueues'][_0x4c4d0c['id']],_0x4c4d0c);}_0x2f0f4e[_0xc847('0x1a')][_0x4c4d0c['id']][_0xc847('0x1b')]();_0x2f0f4e[_0xc847('0x1a')][_0x4c4d0c['id']]['updateRealtime']();}}return _0x2f0f4e['openchannelQueues'];};};Realtime[_0xc847('0x15')][_0xc847('0x1c')]=function(){var _0x5b45cf=this;return function(_0x2dae34){if(_0x2dae34){freeIsNotKey(_0x2dae34,_0x5b45cf[_0xc847('0x1d')],'id');for(var _0x333513=0x0,_0x49747c={},_0xdcf494={};_0x333513<_0x2dae34[_0xc847('0x17')];_0x333513+=0x1){_0x49747c=_0x2dae34[_0x333513];if(_[_0xc847('0x18')](_0x5b45cf['chatQueues'][_0x49747c['id']])){_0x5b45cf[_0xc847('0x1d')][_0x49747c['id']]=new ChatQueue(_0x49747c);}else{_0x5b45cf['mergeFromDatabase'](_0x5b45cf[_0xc847('0x1d')][_0x49747c['id']],_0x49747c);}_0x5b45cf[_0xc847('0x1d')][_0x49747c['id']][_0xc847('0x1b')]();_0x5b45cf[_0xc847('0x1d')][_0x49747c['id']][_0xc847('0x1e')]();}}return _0x5b45cf[_0xc847('0x1d')];};};Realtime[_0xc847('0x15')]['initSmsQueues']=function(){var _0x50319e=this;return function(_0x4d4439){if(_0x4d4439){freeIsNotKey(_0x4d4439,_0x50319e[_0xc847('0x1f')],'id');for(var _0x45da8c=0x0,_0x10b51e={},_0x252c1f={};_0x45da8c<_0x4d4439[_0xc847('0x17')];_0x45da8c+=0x1){_0x10b51e=_0x4d4439[_0x45da8c];if(_[_0xc847('0x18')](_0x50319e[_0xc847('0x1f')][_0x10b51e['id']])){_0x50319e['smsQueues'][_0x10b51e['id']]=new SmsQueue(_0x10b51e);}else{_0x50319e[_0xc847('0x14')](_0x50319e['smsQueues'][_0x10b51e['id']],_0x10b51e);}_0x50319e[_0xc847('0x1f')][_0x10b51e['id']][_0xc847('0x1b')]();_0x50319e['smsQueues'][_0x10b51e['id']]['updateRealtime']();}}return _0x50319e[_0xc847('0x1f')];};};Realtime[_0xc847('0x15')][_0xc847('0x20')]=function(){var _0x5e850d=this;return function(_0x2fffb5){if(_0x2fffb5){freeIsNotKey(_0x2fffb5,_0x5e850d[_0xc847('0xd')],'id');for(var _0x56fb31=0x0,_0x53b289={},_0x52153b={};_0x56fb31<_0x2fffb5[_0xc847('0x17')];_0x56fb31+=0x1){_0x53b289=_0x2fffb5[_0x56fb31];if(_[_0xc847('0x18')](_0x5e850d['mailQueues'][_0x53b289['id']])){_0x5e850d[_0xc847('0xd')][_0x53b289['id']]=new MailQueue(_0x53b289);}else{_0x5e850d[_0xc847('0x14')](_0x5e850d[_0xc847('0xd')][_0x53b289['id']],_0x53b289);}_0x5e850d['mailQueues'][_0x53b289['id']]['updateRouting']();_0x5e850d['mailQueues'][_0x53b289['id']][_0xc847('0x1e')]();}}return _0x5e850d[_0xc847('0xd')];};};Realtime[_0xc847('0x15')][_0xc847('0x21')]=function(){var _0x4cca7e=this;return function(_0x6538){if(_0x6538){freeIsNotKey(_0x6538,_0x4cca7e[_0xc847('0xe')],'id');for(var _0x27f976=0x0,_0xe7273e={},_0xefac2={};_0x27f976<_0x6538['length'];_0x27f976+=0x1){_0xe7273e=_0x6538[_0x27f976];if(_['isUndefined'](_0x4cca7e[_0xc847('0xe')][_0xe7273e['id']])){_0x4cca7e[_0xc847('0xe')][_0xe7273e['id']]=new FaxQueue(_0xe7273e);}else{_0x4cca7e[_0xc847('0x14')](_0x4cca7e[_0xc847('0xe')][_0xe7273e['id']],_0xe7273e);}_0x4cca7e[_0xc847('0xe')][_0xe7273e['id']]['updateRouting']();_0x4cca7e[_0xc847('0xe')][_0xe7273e['id']][_0xc847('0x1e')]();}}return _0x4cca7e[_0xc847('0xe')];};};module[_0xc847('0x22')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index 936cc0a..fb89db4 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 _0xdfa2=['addTags','Request','addTagsToChatInteraction','../client','UpdateChatInteraction'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdfa2,0x152));var _0x2dfa=function(_0x1a9b59,_0x3191a9){_0x1a9b59=_0x1a9b59-0x0;var _0x48e065=_0xdfa2[_0x1a9b59];return _0x48e065;};'use strict';var client=require(_0x2dfa('0x0'));exports['update']=function(_0x4cfdee,_0x4eee93){return client['Request'](_0x2dfa('0x1'),{'body':_0x4eee93,'options':{'where':{'id':_0x4cfdee}},'log':'updateChatInteraction'});};exports[_0x2dfa('0x2')]=function(_0x5c0a53,_0x56c3b4){return client[_0x2dfa('0x3')]('AddTagsToChatInteraction',{'body':_0x56c3b4,'options':{'where':{'id':_0x5c0a53}},'log':_0x2dfa('0x4')});}; \ No newline at end of file +var _0xdc51=['Request','UpdateChatInteraction','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x42540c,_0x27ca3b){var _0x1a27dc=function(_0x14665e){while(--_0x14665e){_0x42540c['push'](_0x42540c['shift']());}};_0x1a27dc(++_0x27ca3b);}(_0xdc51,0x1c6));var _0x1dc5=function(_0x48ae85,_0x4f6363){_0x48ae85=_0x48ae85-0x0;var _0x2257bc=_0xdc51[_0x48ae85];return _0x2257bc;};'use strict';var client=require(_0x1dc5('0x0'));exports['update']=function(_0x325e86,_0x33ea16){return client[_0x1dc5('0x1')](_0x1dc5('0x2'),{'body':_0x33ea16,'options':{'where':{'id':_0x325e86}},'log':_0x1dc5('0x3')});};exports[_0x1dc5('0x4')]=function(_0x4c2b1a,_0x443577){return client[_0x1dc5('0x1')](_0x1dc5('0x5'),{'body':_0x443577,'options':{'where':{'id':_0x4c2b1a}},'log':_0x1dc5('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 4a87c6c..363467e 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 _0xcd94=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x25a464,_0x19f38d){var _0x5a6abf=function(_0x1ca48d){while(--_0x1ca48d){_0x25a464['push'](_0x25a464['shift']());}};_0x5a6abf(++_0x19f38d);}(_0xcd94,0x154));var _0x4cd9=function(_0x32e94b,_0x38c7a7){_0x32e94b=_0x32e94b-0x0;var _0x3b1567=_0xcd94[_0x32e94b];return _0x3b1567;};'use strict';var client=require(_0x4cd9('0x0'));exports[_0x4cd9('0x1')]=function(_0x354a25){return client[_0x4cd9('0x2')](_0x4cd9('0x3'),{'body':_0x354a25,'log':_0x4cd9('0x4')});}; \ No newline at end of file +var _0x8fe1=['create','../client'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x8fe1,0x1d3));var _0x18fe=function(_0x1d8119,_0xc98f17){_0x1d8119=_0x1d8119-0x0;var _0x3e30f6=_0x8fe1[_0x1d8119];return _0x3e30f6;};'use strict';var client=require(_0x18fe('0x0'));exports[_0x18fe('0x1')]=function(_0x4dc79d){return client['Request']('CreateChatMessage',{'body':_0x4dc79d,'log':'createChatMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index 1f5cc21..cbb5d7d 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 _0x5a83=['Request','GetChatQueue','timeout','strategy','User','Agents','name','online','chatPause','../client','getChatQueues'];(function(_0x53e668,_0x5bdaf3){var _0x3d1f62=function(_0x4ab5f2){while(--_0x4ab5f2){_0x53e668['push'](_0x53e668['shift']());}};_0x3d1f62(++_0x5bdaf3);}(_0x5a83,0x1e2));var _0x35a8=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x5a83[_0x2641f9];return _0x585741;};'use strict';var client=require(_0x35a8('0x0'));exports[_0x35a8('0x1')]=function(){return function(){return client[_0x35a8('0x2')](_0x35a8('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x35a8('0x4'),_0x35a8('0x5')],'include':[{'model':_0x35a8('0x6'),'as':_0x35a8('0x7'),'attributes':['id',_0x35a8('0x8'),_0x35a8('0x9'),_0x35a8('0xa')]}]},'log':_0x35a8('0x1')});};}; \ No newline at end of file +var _0xed3d=['online','chatPause','../client','getChatQueues','Request','GetChatQueue','name','timeout','strategy','User','Agents'];(function(_0x424f19,_0xf2c511){var _0x3a570f=function(_0x13308){while(--_0x13308){_0x424f19['push'](_0x424f19['shift']());}};_0x3a570f(++_0xf2c511);}(_0xed3d,0xf4));var _0xded3=function(_0x27b009,_0x26be1f){_0x27b009=_0x27b009-0x0;var _0x19a628=_0xed3d[_0x27b009];return _0x19a628;};'use strict';var client=require(_0xded3('0x0'));exports[_0xded3('0x1')]=function(){return function(){return client[_0xded3('0x2')](_0xded3('0x3'),{'options':{'raw':![],'attributes':['id',_0xded3('0x4'),_0xded3('0x5'),_0xded3('0x6')],'include':[{'model':_0xded3('0x7'),'as':_0xded3('0x8'),'attributes':['id',_0xded3('0x4'),_0xded3('0x9'),_0xded3('0xa')]}]},'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 ecf8c5c..eaf976f 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 _0x1c42=['UpdateChatQueueReport','DESC','create','Request','CreateChatQueueReport','update'];(function(_0x2e8c68,_0x4fd4ee){var _0x5c3320=function(_0x32edd0){while(--_0x32edd0){_0x2e8c68['push'](_0x2e8c68['shift']());}};_0x5c3320(++_0x4fd4ee);}(_0x1c42,0x13a));var _0x21c4=function(_0x2976c9,_0xcce20e){_0x2976c9=_0x2976c9-0x0;var _0x35a939=_0x1c42[_0x2976c9];return _0x35a939;};'use strict';var client=require('../client');exports[_0x21c4('0x0')]=function(_0x3adb49){return client[_0x21c4('0x1')]('CreateChatQueueReport',{'body':_0x3adb49,'log':_0x21c4('0x2')});};exports[_0x21c4('0x3')]=function(_0x1512d2,_0xd7340){return client[_0x21c4('0x1')](_0x21c4('0x4'),{'body':_0xd7340,'options':{'where':{'uniqueid':_0x1512d2},'order':[['id',_0x21c4('0x5')]],'limit':0x1},'log':_0x21c4('0x4')});}; \ No newline at end of file +var _0x5f10=['update','Request','UpdateChatQueueReport','../client','create','CreateChatQueueReport'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x5f10,0xd5));var _0x05f1=function(_0x362c1f,_0x4fccd9){_0x362c1f=_0x362c1f-0x0;var _0x32bd2a=_0x5f10[_0x362c1f];return _0x32bd2a;};'use strict';var client=require(_0x05f1('0x0'));exports[_0x05f1('0x1')]=function(_0x4ce609){return client['Request']('CreateChatQueueReport',{'body':_0x4ce609,'log':_0x05f1('0x2')});};exports[_0x05f1('0x3')]=function(_0x2eaff1,_0xcb88e1){return client[_0x05f1('0x4')](_0x05f1('0x5'),{'body':_0xcb88e1,'options':{'where':{'uniqueid':_0x2eaff1},'order':[['id','DESC']],'limit':0x1},'log':_0x05f1('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index 6872e87..252e4b4 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 _0x2d20=['update','UpdateFaxInteraction','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction'];(function(_0x2634fa,_0x33f193){var _0x587517=function(_0x568862){while(--_0x568862){_0x2634fa['push'](_0x2634fa['shift']());}};_0x587517(++_0x33f193);}(_0x2d20,0x162));var _0x02d2=function(_0x2cdb06,_0x3bb4ed){_0x2cdb06=_0x2cdb06-0x0;var _0x55fec2=_0x2d20[_0x2cdb06];return _0x55fec2;};'use strict';var client=require('../client');exports[_0x02d2('0x0')]=function(_0x22d303,_0x4d3aaa){return client['Request'](_0x02d2('0x1'),{'body':_0x4d3aaa,'options':{'where':{'id':_0x22d303}},'log':_0x02d2('0x2')});};exports[_0x02d2('0x3')]=function(_0x2746d6,_0x2c21c0){return client[_0x02d2('0x4')](_0x02d2('0x5'),{'body':_0x2c21c0,'options':{'where':{'id':_0x2746d6}},'log':'addTagsToFaxInteraction'});}; \ No newline at end of file +var _0xd6b8=['AddTagsToFaxInteraction','addTagsToFaxInteraction','update','Request','UpdateFaxInteraction'];(function(_0xb8cfbe,_0x2e81b6){var _0x227d51=function(_0x5cb1ff){while(--_0x5cb1ff){_0xb8cfbe['push'](_0xb8cfbe['shift']());}};_0x227d51(++_0x2e81b6);}(_0xd6b8,0xd9));var _0x8d6b=function(_0x151cfc,_0x141fd0){_0x151cfc=_0x151cfc-0x0;var _0x280aef=_0xd6b8[_0x151cfc];return _0x280aef;};'use strict';var client=require('../client');exports[_0x8d6b('0x0')]=function(_0x4ab123,_0x3de89c){return client[_0x8d6b('0x1')](_0x8d6b('0x2'),{'body':_0x3de89c,'options':{'where':{'id':_0x4ab123}},'log':'updateFaxInteraction'});};exports['addTags']=function(_0x3001e2,_0xa4fca1){return client[_0x8d6b('0x1')](_0x8d6b('0x3'),{'body':_0xa4fca1,'options':{'where':{'id':_0x3001e2}},'log':_0x8d6b('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 9bb1670..0ab600c 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 _0x1c1e=['create','Request','CreateFaxMessage','createFaxMessage'];(function(_0x144e6f,_0x51d1a9){var _0x28bafd=function(_0x11690e){while(--_0x11690e){_0x144e6f['push'](_0x144e6f['shift']());}};_0x28bafd(++_0x51d1a9);}(_0x1c1e,0x138));var _0xe1c1=function(_0x22df9f,_0x9ec477){_0x22df9f=_0x22df9f-0x0;var _0x4ed906=_0x1c1e[_0x22df9f];return _0x4ed906;};'use strict';var client=require('../client');exports[_0xe1c1('0x0')]=function(_0xb13119){return client[_0xe1c1('0x1')](_0xe1c1('0x2'),{'body':_0xb13119,'log':_0xe1c1('0x3')});}; \ No newline at end of file +var _0x20c4=['Request','CreateFaxMessage','create'];(function(_0x36fee2,_0x16d199){var _0x4631fe=function(_0x1c2a8f){while(--_0x1c2a8f){_0x36fee2['push'](_0x36fee2['shift']());}};_0x4631fe(++_0x16d199);}(_0x20c4,0xcb));var _0x420c=function(_0x32ad4f,_0x12b5cd){_0x32ad4f=_0x32ad4f-0x0;var _0x1c17d5=_0x20c4[_0x32ad4f];return _0x1c17d5;};'use strict';var client=require('../client');exports[_0x420c('0x0')]=function(_0x5819d7){return client[_0x420c('0x1')](_0x420c('0x2'),{'body':_0x5819d7,'log':'createFaxMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index d30efd8..c40b27f 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 _0xd1a5=['User','Agents','online','faxPause','getFaxQueues','../client','Request','GetFaxQueue','name','timeout','strategy'];(function(_0x161a47,_0x208885){var _0x1426b3=function(_0x417cad){while(--_0x417cad){_0x161a47['push'](_0x161a47['shift']());}};_0x1426b3(++_0x208885);}(_0xd1a5,0xb5));var _0x5d1a=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xd1a5[_0x46698a];return _0x356db0;};'use strict';var client=require(_0x5d1a('0x0'));exports['getFaxQueues']=function(){return function(){return client[_0x5d1a('0x1')](_0x5d1a('0x2'),{'options':{'raw':![],'attributes':['id',_0x5d1a('0x3'),_0x5d1a('0x4'),_0x5d1a('0x5')],'include':[{'model':_0x5d1a('0x6'),'as':_0x5d1a('0x7'),'attributes':['id',_0x5d1a('0x3'),_0x5d1a('0x8'),_0x5d1a('0x9')]}]},'log':_0x5d1a('0xa')});};}; \ No newline at end of file +var _0x57f1=['GetFaxQueue','strategy','User','online','../client','getFaxQueues','Request'];(function(_0xfb537b,_0x3a9f19){var _0x182a7f=function(_0x46651a){while(--_0x46651a){_0xfb537b['push'](_0xfb537b['shift']());}};_0x182a7f(++_0x3a9f19);}(_0x57f1,0x82));var _0x157f=function(_0x16d6f2,_0x578fb8){_0x16d6f2=_0x16d6f2-0x0;var _0x3b7fa9=_0x57f1[_0x16d6f2];return _0x3b7fa9;};'use strict';var client=require(_0x157f('0x0'));exports[_0x157f('0x1')]=function(){return function(){return client[_0x157f('0x2')](_0x157f('0x3'),{'options':{'raw':![],'attributes':['id','name','timeout',_0x157f('0x4')],'include':[{'model':_0x157f('0x5'),'as':'Agents','attributes':['id','name',_0x157f('0x6'),'faxPause']}]},'log':_0x157f('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 6f9ed60..cf8a966 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 _0xc155=['CreateFaxQueueReport','update','Request','DESC','UpdateFaxQueueReport','../client','create'];(function(_0x2a3316,_0xe22ce9){var _0xd2f9e4=function(_0x108cc0){while(--_0x108cc0){_0x2a3316['push'](_0x2a3316['shift']());}};_0xd2f9e4(++_0xe22ce9);}(_0xc155,0x16a));var _0x5c15=function(_0x27c426,_0x5b06d6){_0x27c426=_0x27c426-0x0;var _0x33735f=_0xc155[_0x27c426];return _0x33735f;};'use strict';var client=require(_0x5c15('0x0'));exports[_0x5c15('0x1')]=function(_0x235789){return client['Request'](_0x5c15('0x2'),{'body':_0x235789,'log':_0x5c15('0x2')});};exports[_0x5c15('0x3')]=function(_0x24ea33,_0x282475){return client[_0x5c15('0x4')]('UpdateFaxQueueReport',{'body':_0x282475,'options':{'where':{'uniqueid':_0x24ea33},'order':[['id',_0x5c15('0x5')]],'limit':0x1},'log':_0x5c15('0x6')});}; \ No newline at end of file +var _0x8218=['create','Request','UpdateFaxQueueReport','../client'];(function(_0x580c26,_0x39edac){var _0xb392ea=function(_0x235062){while(--_0x235062){_0x580c26['push'](_0x580c26['shift']());}};_0xb392ea(++_0x39edac);}(_0x8218,0xb3));var _0x8821=function(_0x51d9ba,_0x57a1ae){_0x51d9ba=_0x51d9ba-0x0;var _0x5b13d6=_0x8218[_0x51d9ba];return _0x5b13d6;};'use strict';var client=require(_0x8821('0x0'));exports[_0x8821('0x1')]=function(_0x93b836){return client[_0x8821('0x2')]('CreateFaxQueueReport',{'body':_0x93b836,'log':'CreateFaxQueueReport'});};exports['update']=function(_0x526a05,_0xf169bc){return client[_0x8821('0x2')](_0x8821('0x3'),{'body':_0xf169bc,'options':{'where':{'uniqueid':_0x526a05},'order':[['id','DESC']],'limit':0x1},'log':_0x8821('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index a473fa8..8419ce9 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 _0x6cb4=['getIntervals','Request','GetInterval','name','Interval','Intervals','interval','../client'];(function(_0x5e9ad8,_0x3ad665){var _0x3a435b=function(_0x4dbfd3){while(--_0x4dbfd3){_0x5e9ad8['push'](_0x5e9ad8['shift']());}};_0x3a435b(++_0x3ad665);}(_0x6cb4,0xff));var _0x46cb=function(_0x492fae,_0x5bde0b){_0x492fae=_0x492fae-0x0;var _0x343de1=_0x6cb4[_0x492fae];return _0x343de1;};'use strict';var client=require(_0x46cb('0x0'));exports[_0x46cb('0x1')]=function(){return function(){return client[_0x46cb('0x2')](_0x46cb('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x46cb('0x4')],'include':[{'model':_0x46cb('0x5'),'as':_0x46cb('0x6'),'attributes':['id',_0x46cb('0x4'),_0x46cb('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file +var _0x3266=['Intervals','interval','../client','getIntervals','Request','GetInterval','name','Interval'];(function(_0x594ae6,_0x39a7c7){var _0x36d241=function(_0x372d68){while(--_0x372d68){_0x594ae6['push'](_0x594ae6['shift']());}};_0x36d241(++_0x39a7c7);}(_0x3266,0x6a));var _0x6326=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x3266[_0xd22d95];return _0x15d7a3;};'use strict';var client=require(_0x6326('0x0'));exports[_0x6326('0x1')]=function(){return function(){return client[_0x6326('0x2')](_0x6326('0x3'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x6326('0x4')],'include':[{'model':_0x6326('0x5'),'as':_0x6326('0x6'),'attributes':['id',_0x6326('0x4'),_0x6326('0x7')]}]},'log':'getIntervals'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index b9a1398..dfc15dd 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 _0x9bd5=['addTagsToChatInteraction','../client','update','Request','updateMailInteraction','addTags'];(function(_0x220a75,_0x25c315){var _0x5c8830=function(_0x19b035){while(--_0x19b035){_0x220a75['push'](_0x220a75['shift']());}};_0x5c8830(++_0x25c315);}(_0x9bd5,0x79));var _0x59bd=function(_0x3b99e3,_0x10c9cb){_0x3b99e3=_0x3b99e3-0x0;var _0x53e8f5=_0x9bd5[_0x3b99e3];return _0x53e8f5;};'use strict';var client=require(_0x59bd('0x0'));exports[_0x59bd('0x1')]=function(_0x5e0440,_0xe725c9){return client[_0x59bd('0x2')]('UpdateMailInteraction',{'body':_0xe725c9,'options':{'where':{'id':_0x5e0440}},'log':_0x59bd('0x3')});};exports[_0x59bd('0x4')]=function(_0x12441f,_0x6522c2){return client[_0x59bd('0x2')]('AddTagsToMailInteraction',{'body':_0x6522c2,'options':{'where':{'id':_0x12441f}},'log':_0x59bd('0x5')});}; \ No newline at end of file +var _0x3318=['UpdateMailInteraction','updateMailInteraction','addTags','AddTagsToMailInteraction','addTagsToChatInteraction','../client','Request'];(function(_0x2ec4f2,_0x39f207){var _0x179f27=function(_0x125a29){while(--_0x125a29){_0x2ec4f2['push'](_0x2ec4f2['shift']());}};_0x179f27(++_0x39f207);}(_0x3318,0x9f));var _0x8331=function(_0x27a9cc,_0x3bae61){_0x27a9cc=_0x27a9cc-0x0;var _0x37d740=_0x3318[_0x27a9cc];return _0x37d740;};'use strict';var client=require(_0x8331('0x0'));exports['update']=function(_0x3e5181,_0x14e242){return client[_0x8331('0x1')](_0x8331('0x2'),{'body':_0x14e242,'options':{'where':{'id':_0x3e5181}},'log':_0x8331('0x3')});};exports[_0x8331('0x4')]=function(_0x2f787b,_0x420ca4){return client[_0x8331('0x1')](_0x8331('0x5'),{'body':_0x420ca4,'options':{'where':{'id':_0x2f787b}},'log':_0x8331('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index f130a24..244828f 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 _0x7ec5=['create','CreateMailMessage','createMailMessage'];(function(_0x387ea3,_0x21fd7e){var _0x5aa402=function(_0x574cf7){while(--_0x574cf7){_0x387ea3['push'](_0x387ea3['shift']());}};_0x5aa402(++_0x21fd7e);}(_0x7ec5,0x1e0));var _0x57ec=function(_0x1bfe2b,_0x34856e){_0x1bfe2b=_0x1bfe2b-0x0;var _0x1477d4=_0x7ec5[_0x1bfe2b];return _0x1477d4;};'use strict';var client=require('../client');exports[_0x57ec('0x0')]=function(_0x5b1fc1){return client['Request'](_0x57ec('0x1'),{'body':_0x5b1fc1,'log':_0x57ec('0x2')});}; \ No newline at end of file +var _0x3415=['CreateMailMessage','../client','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x3415,0x1cc));var _0x5341=function(_0x47678f,_0xb40c51){_0x47678f=_0x47678f-0x0;var _0xe00ff5=_0x3415[_0x47678f];return _0xe00ff5;};'use strict';var client=require(_0x5341('0x0'));exports[_0x5341('0x1')]=function(_0x17b2c3){return client['Request'](_0x5341('0x2'),{'body':_0x17b2c3,'log':'createMailMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 216b26a..440a45f 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 _0x3217=['name','online','mailPause','../client','getMailQueues','Request','GetMailQueue','timeout','strategy','User'];(function(_0x399ee7,_0x589a98){var _0x3f8838=function(_0x5dffef){while(--_0x5dffef){_0x399ee7['push'](_0x399ee7['shift']());}};_0x3f8838(++_0x589a98);}(_0x3217,0xcb));var _0x7321=function(_0x480e54,_0x571d9d){_0x480e54=_0x480e54-0x0;var _0x2c9efa=_0x3217[_0x480e54];return _0x2c9efa;};'use strict';var client=require(_0x7321('0x0'));exports[_0x7321('0x1')]=function(){return function(){return client[_0x7321('0x2')](_0x7321('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x7321('0x4'),_0x7321('0x5')],'include':[{'model':_0x7321('0x6'),'as':'Agents','attributes':['id',_0x7321('0x7'),_0x7321('0x8'),_0x7321('0x9')]}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x100a=['timeout','strategy','User','Agents','mailPause','getMailQueues','Request','name'];(function(_0x4aa5e1,_0x4355a0){var _0x2dbd0a=function(_0x38bf16){while(--_0x38bf16){_0x4aa5e1['push'](_0x4aa5e1['shift']());}};_0x2dbd0a(++_0x4355a0);}(_0x100a,0x13e));var _0xa100=function(_0x2dd39b,_0x743364){_0x2dd39b=_0x2dd39b-0x0;var _0x3c1197=_0x100a[_0x2dd39b];return _0x3c1197;};'use strict';var client=require('../client');exports['getMailQueues']=function(){return function(){return client[_0xa100('0x0')]('GetMailQueue',{'options':{'raw':![],'attributes':['id',_0xa100('0x1'),_0xa100('0x2'),_0xa100('0x3')],'include':[{'model':_0xa100('0x4'),'as':_0xa100('0x5'),'attributes':['id','name','online',_0xa100('0x6')]}]},'log':_0xa100('0x7')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index 2efe680..0611437 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 _0x2226=['../client','create','Request','CreateMailQueueReport','update','UpdateMailQueueReport','DESC'];(function(_0x31659b,_0x3f07a1){var _0x48b140=function(_0x3b295c){while(--_0x3b295c){_0x31659b['push'](_0x31659b['shift']());}};_0x48b140(++_0x3f07a1);}(_0x2226,0x69));var _0x6222=function(_0x4b60ae,_0x4ea45c){_0x4b60ae=_0x4b60ae-0x0;var _0x11ddbe=_0x2226[_0x4b60ae];return _0x11ddbe;};'use strict';var client=require(_0x6222('0x0'));exports[_0x6222('0x1')]=function(_0x296fa4){return client[_0x6222('0x2')](_0x6222('0x3'),{'body':_0x296fa4,'log':_0x6222('0x3')});};exports[_0x6222('0x4')]=function(_0x24d6aa,_0x4f1eab){return client[_0x6222('0x2')](_0x6222('0x5'),{'body':_0x4f1eab,'options':{'where':{'uniqueid':_0x24d6aa},'order':[['id',_0x6222('0x6')]],'limit':0x1},'log':_0x6222('0x5')});}; \ No newline at end of file +var _0xad00=['CreateMailQueueReport','update','Request','DESC','../client','create'];(function(_0xe7d07d,_0x52e4e3){var _0x229e46=function(_0x376839){while(--_0x376839){_0xe7d07d['push'](_0xe7d07d['shift']());}};_0x229e46(++_0x52e4e3);}(_0xad00,0xf4));var _0x0ad0=function(_0x5c2e5e,_0x2bc00e){_0x5c2e5e=_0x5c2e5e-0x0;var _0x46a5da=_0xad00[_0x5c2e5e];return _0x46a5da;};'use strict';var client=require(_0x0ad0('0x0'));exports[_0x0ad0('0x1')]=function(_0x250db0){return client['Request'](_0x0ad0('0x2'),{'body':_0x250db0,'log':_0x0ad0('0x2')});};exports[_0x0ad0('0x3')]=function(_0x248cc4,_0x5c28a3){return client[_0x0ad0('0x4')]('UpdateMailQueueReport',{'body':_0x5c28a3,'options':{'where':{'uniqueid':_0x248cc4},'order':[['id',_0x0ad0('0x5')]],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index bb79a05..9b32843 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 _0x81af=['updateOpenchannelInteraction','addTags','../client','update','Request','UpdateOpenchannelInteraction'];(function(_0x432479,_0x39cf42){var _0x2901c0=function(_0x1fbf37){while(--_0x1fbf37){_0x432479['push'](_0x432479['shift']());}};_0x2901c0(++_0x39cf42);}(_0x81af,0x80));var _0xf81a=function(_0x291706,_0x12e640){_0x291706=_0x291706-0x0;var _0x261c24=_0x81af[_0x291706];return _0x261c24;};'use strict';var client=require(_0xf81a('0x0'));exports[_0xf81a('0x1')]=function(_0x54aa6d,_0x308216){return client[_0xf81a('0x2')](_0xf81a('0x3'),{'body':_0x308216,'options':{'where':{'id':_0x54aa6d}},'log':_0xf81a('0x4')});};exports[_0xf81a('0x5')]=function(_0x2511f9,_0x550ab8){return client[_0xf81a('0x2')]('AddTagsToOpenchannelInteraction',{'body':_0x550ab8,'options':{'where':{'id':_0x2511f9}},'log':'addTagsToChatInteraction'});}; \ No newline at end of file +var _0xa8cd=['AddTagsToOpenchannelInteraction','addTagsToChatInteraction','../client','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction'];(function(_0x2784d8,_0x4d0101){var _0x19666e=function(_0x4363bd){while(--_0x4363bd){_0x2784d8['push'](_0x2784d8['shift']());}};_0x19666e(++_0x4d0101);}(_0xa8cd,0x7a));var _0xda8c=function(_0xf44d98,_0x12a472){_0xf44d98=_0xf44d98-0x0;var _0x5ebb04=_0xa8cd[_0xf44d98];return _0x5ebb04;};'use strict';var client=require(_0xda8c('0x0'));exports['update']=function(_0x473a97,_0x348021){return client[_0xda8c('0x1')](_0xda8c('0x2'),{'body':_0x348021,'options':{'where':{'id':_0x473a97}},'log':_0xda8c('0x3')});};exports['addTags']=function(_0x53cb5a,_0x53da5e){return client[_0xda8c('0x1')](_0xda8c('0x4'),{'body':_0x53da5e,'options':{'where':{'id':_0x53cb5a}},'log':_0xda8c('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 06c541b..34a68be 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 _0xb821=['createOpenchannelMessage','create'];(function(_0x28d530,_0x613ea8){var _0x172817=function(_0x4e67ec){while(--_0x4e67ec){_0x28d530['push'](_0x28d530['shift']());}};_0x172817(++_0x613ea8);}(_0xb821,0xa7));var _0x1b82=function(_0x2e19ce,_0x47cd70){_0x2e19ce=_0x2e19ce-0x0;var _0x24cb55=_0xb821[_0x2e19ce];return _0x24cb55;};'use strict';var client=require('../client');exports[_0x1b82('0x0')]=function(_0x4f6190){return client['Request']('CreateOpenchannelMessage',{'body':_0x4f6190,'log':_0x1b82('0x1')});}; \ No newline at end of file +var _0xe14d=['Request','createOpenchannelMessage','../client','create'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xe14d,0x1ee));var _0xde14=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0xe14d[_0x433a86];return _0x23000c;};'use strict';var client=require(_0xde14('0x0'));exports[_0xde14('0x1')]=function(_0x1b5d3b){return client[_0xde14('0x2')]('CreateOpenchannelMessage',{'body':_0x1b5d3b,'log':_0xde14('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index ee17b85..9ffa2a1 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 _0x74bc=['timeout','strategy','User','name','online','openchannelPause','../client','getOpenchannelQueues','Request','GetOpenchannelQueue'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x74bc,0xec));var _0xc74b=function(_0x31e8b1,_0x16a88d){_0x31e8b1=_0x31e8b1-0x0;var _0x545fcb=_0x74bc[_0x31e8b1];return _0x545fcb;};'use strict';var client=require(_0xc74b('0x0'));exports[_0xc74b('0x1')]=function(){return function(){return client[_0xc74b('0x2')](_0xc74b('0x3'),{'options':{'raw':![],'attributes':['id','name',_0xc74b('0x4'),_0xc74b('0x5')],'include':[{'model':_0xc74b('0x6'),'as':'Agents','attributes':['id',_0xc74b('0x7'),_0xc74b('0x8'),_0xc74b('0x9')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file +var _0x5831=['openchannelPause','../client','getOpenchannelQueues','Request','name','timeout','strategy','User','online'];(function(_0x1996a5,_0x4d8200){var _0x48d60e=function(_0x2746cd){while(--_0x2746cd){_0x1996a5['push'](_0x1996a5['shift']());}};_0x48d60e(++_0x4d8200);}(_0x5831,0x1ba));var _0x1583=function(_0x54e4ec,_0x183144){_0x54e4ec=_0x54e4ec-0x0;var _0x44ef91=_0x5831[_0x54e4ec];return _0x44ef91;};'use strict';var client=require(_0x1583('0x0'));exports[_0x1583('0x1')]=function(){return function(){return client[_0x1583('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x1583('0x3'),_0x1583('0x4'),_0x1583('0x5')],'include':[{'model':_0x1583('0x6'),'as':'Agents','attributes':['id',_0x1583('0x3'),_0x1583('0x7'),_0x1583('0x8')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index 0a96c91..f555cd8 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 _0x7908=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','Request'];(function(_0x15c4df,_0x164568){var _0x105111=function(_0x49c5c9){while(--_0x49c5c9){_0x15c4df['push'](_0x15c4df['shift']());}};_0x105111(++_0x164568);}(_0x7908,0x18b));var _0x8790=function(_0x44be32,_0x434bdc){_0x44be32=_0x44be32-0x0;var _0x4fe3d9=_0x7908[_0x44be32];return _0x4fe3d9;};'use strict';var client=require('../client');exports['create']=function(_0x39ffd8){return client[_0x8790('0x0')]('CreateOpenchannelQueueReport',{'body':_0x39ffd8,'log':_0x8790('0x1')});};exports[_0x8790('0x2')]=function(_0xdabb83,_0x49a088){return client[_0x8790('0x0')](_0x8790('0x3'),{'body':_0x49a088,'options':{'where':{'uniqueid':_0xdabb83},'order':[['id','DESC']],'limit':0x1},'log':_0x8790('0x3')});}; \ No newline at end of file +var _0x5873=['create','CreateOpenchannelQueueReport','Request','UpdateOpenchannelQueueReport','DESC','../client'];(function(_0x189f9e,_0x23ba5d){var _0x44fcbe=function(_0x54a4d2){while(--_0x54a4d2){_0x189f9e['push'](_0x189f9e['shift']());}};_0x44fcbe(++_0x23ba5d);}(_0x5873,0x1bb));var _0x3587=function(_0x498fd3,_0x117602){_0x498fd3=_0x498fd3-0x0;var _0x34ece6=_0x5873[_0x498fd3];return _0x34ece6;};'use strict';var client=require(_0x3587('0x0'));exports[_0x3587('0x1')]=function(_0x54d132){return client['Request']('CreateOpenchannelQueueReport',{'body':_0x54d132,'log':_0x3587('0x2')});};exports['update']=function(_0x2c41e9,_0x305eec){return client[_0x3587('0x3')](_0x3587('0x4'),{'body':_0x305eec,'options':{'where':{'uniqueid':_0x2c41e9},'order':[['id',_0x3587('0x5')]],'limit':0x1},'log':_0x3587('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 97b1bd0..7301b13 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 _0xef02=['updateSmsInteraction','addTags','Request','AddTagsToSmsInteraction','addTagsToSmsInteraction','update'];(function(_0x153a9f,_0x4ab2bd){var _0x11b1e0=function(_0x46caa4){while(--_0x46caa4){_0x153a9f['push'](_0x153a9f['shift']());}};_0x11b1e0(++_0x4ab2bd);}(_0xef02,0x1c1));var _0x2ef0=function(_0x2aefb6,_0x1bd384){_0x2aefb6=_0x2aefb6-0x0;var _0x202772=_0xef02[_0x2aefb6];return _0x202772;};'use strict';var client=require('../client');exports[_0x2ef0('0x0')]=function(_0x197533,_0x2f94a4){return client['Request']('UpdateSmsInteraction',{'body':_0x2f94a4,'options':{'where':{'id':_0x197533}},'log':_0x2ef0('0x1')});};exports[_0x2ef0('0x2')]=function(_0x486f96,_0x217a02){return client[_0x2ef0('0x3')](_0x2ef0('0x4'),{'body':_0x217a02,'options':{'where':{'id':_0x486f96}},'log':_0x2ef0('0x5')});}; \ No newline at end of file +var _0x0628=['updateSmsInteraction','addTags','AddTagsToSmsInteraction','addTagsToSmsInteraction','../client','update','Request','UpdateSmsInteraction'];(function(_0x2e8418,_0x58c529){var _0x548fe6=function(_0x2b2877){while(--_0x2b2877){_0x2e8418['push'](_0x2e8418['shift']());}};_0x548fe6(++_0x58c529);}(_0x0628,0x15c));var _0x8062=function(_0x21f7cf,_0x3a574b){_0x21f7cf=_0x21f7cf-0x0;var _0xf03e2e=_0x0628[_0x21f7cf];return _0xf03e2e;};'use strict';var client=require(_0x8062('0x0'));exports[_0x8062('0x1')]=function(_0x4be733,_0xdc89f8){return client[_0x8062('0x2')](_0x8062('0x3'),{'body':_0xdc89f8,'options':{'where':{'id':_0x4be733}},'log':_0x8062('0x4')});};exports[_0x8062('0x5')]=function(_0x52d5da,_0x190ecc){return client['Request'](_0x8062('0x6'),{'body':_0x190ecc,'options':{'where':{'id':_0x52d5da}},'log':_0x8062('0x7')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 52c3605..8960af5 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 _0xe886=['Request','CreateSmsMessage','createSmsMessage','create'];(function(_0xe3b507,_0x3e9011){var _0x5029f9=function(_0x59b1be){while(--_0x59b1be){_0xe3b507['push'](_0xe3b507['shift']());}};_0x5029f9(++_0x3e9011);}(_0xe886,0xa7));var _0x6e88=function(_0x2086ab,_0x121f22){_0x2086ab=_0x2086ab-0x0;var _0xc6d7a3=_0xe886[_0x2086ab];return _0xc6d7a3;};'use strict';var client=require('../client');exports[_0x6e88('0x0')]=function(_0x3c1523){return client[_0x6e88('0x1')](_0x6e88('0x2'),{'body':_0x3c1523,'log':_0x6e88('0x3')});}; \ No newline at end of file +var _0x2258=['create','Request','CreateSmsMessage','createSmsMessage','../client'];(function(_0x5bcc76,_0x4a9f2c){var _0x463963=function(_0x46cfb1){while(--_0x46cfb1){_0x5bcc76['push'](_0x5bcc76['shift']());}};_0x463963(++_0x4a9f2c);}(_0x2258,0x108));var _0x8225=function(_0x425865,_0x6fe00d){_0x425865=_0x425865-0x0;var _0x53c6de=_0x2258[_0x425865];return _0x53c6de;};'use strict';var client=require(_0x8225('0x0'));exports[_0x8225('0x1')]=function(_0x562ab6){return client[_0x8225('0x2')](_0x8225('0x3'),{'body':_0x562ab6,'log':_0x8225('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index fde749b..dc2ed30 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 _0x9b0d=['Request','GetSmsQueue','name','strategy','User','Agents','smsPause','getSmsQueues'];(function(_0x1eb1b3,_0x1402e2){var _0x226b1d=function(_0x339e47){while(--_0x339e47){_0x1eb1b3['push'](_0x1eb1b3['shift']());}};_0x226b1d(++_0x1402e2);}(_0x9b0d,0xb7));var _0xd9b0=function(_0x40ac36,_0x4dfc53){_0x40ac36=_0x40ac36-0x0;var _0x5b5d02=_0x9b0d[_0x40ac36];return _0x5b5d02;};'use strict';var client=require('../client');exports[_0xd9b0('0x0')]=function(){return function(){return client[_0xd9b0('0x1')](_0xd9b0('0x2'),{'options':{'raw':![],'attributes':['id',_0xd9b0('0x3'),'timeout',_0xd9b0('0x4')],'include':[{'model':_0xd9b0('0x5'),'as':_0xd9b0('0x6'),'attributes':['id',_0xd9b0('0x3'),'online',_0xd9b0('0x7')]}]},'log':_0xd9b0('0x0')});};}; \ No newline at end of file +var _0x05ad=['name','timeout','strategy','Agents','online','getSmsQueues','Request','GetSmsQueue'];(function(_0x431253,_0x2c6357){var _0x44a6fc=function(_0x38c545){while(--_0x38c545){_0x431253['push'](_0x431253['shift']());}};_0x44a6fc(++_0x2c6357);}(_0x05ad,0x12d));var _0xd05a=function(_0x1c0e00,_0x584066){_0x1c0e00=_0x1c0e00-0x0;var _0x18279a=_0x05ad[_0x1c0e00];return _0x18279a;};'use strict';var client=require('../client');exports[_0xd05a('0x0')]=function(){return function(){return client[_0xd05a('0x1')](_0xd05a('0x2'),{'options':{'raw':![],'attributes':['id',_0xd05a('0x3'),_0xd05a('0x4'),_0xd05a('0x5')],'include':[{'model':'User','as':_0xd05a('0x6'),'attributes':['id',_0xd05a('0x3'),_0xd05a('0x7'),'smsPause']}]},'log':'getSmsQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index e6fdb39..748fb6a 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 _0xf8d1=['update','UpdateSmsQueueReport','../client','create','Request','CreateSmsQueueReport'];(function(_0x485aba,_0x4baa8a){var _0x5e4919=function(_0x20a4e1){while(--_0x20a4e1){_0x485aba['push'](_0x485aba['shift']());}};_0x5e4919(++_0x4baa8a);}(_0xf8d1,0x7a));var _0x1f8d=function(_0x58a368,_0x491646){_0x58a368=_0x58a368-0x0;var _0x3cd3d4=_0xf8d1[_0x58a368];return _0x3cd3d4;};'use strict';var client=require(_0x1f8d('0x0'));exports[_0x1f8d('0x1')]=function(_0x3a2575){return client[_0x1f8d('0x2')](_0x1f8d('0x3'),{'body':_0x3a2575,'log':_0x1f8d('0x3')});};exports[_0x1f8d('0x4')]=function(_0x4b2080,_0xb1db4b){return client[_0x1f8d('0x2')](_0x1f8d('0x5'),{'body':_0xb1db4b,'options':{'where':{'uniqueid':_0x4b2080},'order':[['id','DESC']],'limit':0x1},'log':'UpdateSmsQueueReport'});}; \ No newline at end of file +var _0xb1be=['create','Request','CreateSmsQueueReport','DESC','UpdateSmsQueueReport','../client'];(function(_0x500c0,_0xdb6a03){var _0xdd146f=function(_0x2e8090){while(--_0x2e8090){_0x500c0['push'](_0x500c0['shift']());}};_0xdd146f(++_0xdb6a03);}(_0xb1be,0x1c1));var _0xeb1b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1be[_0x122ef9];return _0x42fba0;};'use strict';var client=require(_0xeb1b('0x0'));exports[_0xeb1b('0x1')]=function(_0x1803b1){return client[_0xeb1b('0x2')](_0xeb1b('0x3'),{'body':_0x1803b1,'log':_0xeb1b('0x3')});};exports['update']=function(_0x3b8f2f,_0x2a3b69){return client[_0xeb1b('0x2')]('UpdateSmsQueueReport',{'body':_0x2a3b69,'options':{'where':{'uniqueid':_0x3b8f2f},'order':[['id',_0xeb1b('0x4')]],'limit':0x1},'log':_0xeb1b('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/user.js b/server/services/routing/rpc/user.js index bc91b17..74d3bcc 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 _0x00c0=['name','online','pauseType','lastPauseAt','voicePause','mailPause','faxPause','smsPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','getAgents','Request','GetUser','agent'];(function(_0x586294,_0x9f7c8b){var _0x4c30cc=function(_0x4a7107){while(--_0x4a7107){_0x586294['push'](_0x586294['shift']());}};_0x4c30cc(++_0x9f7c8b);}(_0x00c0,0xea));var _0x000c=function(_0x5ca207,_0x2738df){_0x5ca207=_0x5ca207-0x0;var _0x5f414d=_0x00c0[_0x5ca207];return _0x5f414d;};'use strict';var client=require('../client');exports[_0x000c('0x0')]=function(){return function(){return client[_0x000c('0x1')](_0x000c('0x2'),{'options':{'raw':!![],'where':{'role':_0x000c('0x3')},'attributes':['id',_0x000c('0x4'),_0x000c('0x5'),_0x000c('0x6'),_0x000c('0x7'),_0x000c('0x8'),'chatPause',_0x000c('0x9'),_0x000c('0xa'),_0x000c('0xb'),'openchannelPause',_0x000c('0xc'),_0x000c('0xd'),_0x000c('0xe'),_0x000c('0xf'),_0x000c('0x10')]},'log':_0x000c('0x0')});};}; \ No newline at end of file +var _0xfe01=['openchannelCapacity','getAgents','GetUser','agent','name','pauseType','lastPauseAt','chatPause','mailPause','faxPause','smsPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity'];(function(_0x515f12,_0x1b54fe){var _0x39a2cf=function(_0xbaf5d4){while(--_0xbaf5d4){_0x515f12['push'](_0x515f12['shift']());}};_0x39a2cf(++_0x1b54fe);}(_0xfe01,0x98));var _0x1fe0=function(_0x442f90,_0xaf4eb8){_0x442f90=_0x442f90-0x0;var _0x501d7a=_0xfe01[_0x442f90];return _0x501d7a;};'use strict';var client=require('../client');exports['getAgents']=function(){return function(){return client['Request'](_0x1fe0('0x0'),{'options':{'raw':!![],'where':{'role':_0x1fe0('0x1')},'attributes':['id',_0x1fe0('0x2'),'online',_0x1fe0('0x3'),_0x1fe0('0x4'),'voicePause',_0x1fe0('0x5'),_0x1fe0('0x6'),_0x1fe0('0x7'),_0x1fe0('0x8'),'openchannelPause',_0x1fe0('0x9'),_0x1fe0('0xa'),_0x1fe0('0xb'),_0x1fe0('0xc'),_0x1fe0('0xd')]},'log':_0x1fe0('0xe')});};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/agent.js b/server/services/routing/server/applications/agent.js index 108b37a..2af694b 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 _0x349b=['timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','validate','length','error','[%s][AGENT]\x20%s','map','join','find','createQueue','atimeout','format','START:%s','rules','[%s][AGENT]\x20ROUTING\x20STOPPED','close','stop','complete','next','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','../../../../config/logger','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'];(function(_0x2765f4,_0x2e82a4){var _0x4c3d54=function(_0x2afd5a){while(--_0x2afd5a){_0x2765f4['push'](_0x2765f4['shift']());}};_0x4c3d54(++_0x2e82a4);}(_0x349b,0x9a));var _0xb349=function(_0xae4c59,_0x4ecb4f){_0xae4c59=_0xae4c59-0x0;var _0x21d41d=_0x349b[_0xae4c59];return _0x21d41d;};'use strict';var schema=require('validate');var _=require(_0xb349('0x0'));var util=require(_0xb349('0x1'));var seqqueue=require(_0xb349('0x2'));var logger=require(_0xb349('0x3'))('routing');var strategy=require('./strategy');var queue=schema({'name':{'type':_0xb349('0x4'),'required':!![],'message':_0xb349('0x5')},'timeout':{'type':'number','message':_0xb349('0x6')}});function writeLog(_0xfc6b15,_0x4a3d3e,_0x14bd4e){return logger[_0xb349('0x7')](util['format'](_0xb349('0x8'),_0xfc6b15,_0x4a3d3e[_0xb349('0x9')],_0x14bd4e));}function handleFindAgent(_0x26c5aa){return function(_0xb4afd8){return _0xb4afd8[_0xb349('0x9')][_0xb349('0xa')]()===_0x26c5aa['toLowerCase']();};}exports[_0xb349('0xb')]=function(_0x55889b,_0x42fcf6,_0x3d8822,_0x16180b){return function(_0x4f82e6){try{var _0x36b27c={'name':_0x42fcf6[0x0],'timeout':_0x42fcf6[0x1]};var _0x2b372f=queue[_0xb349('0xc')](_0x36b27c,{'typecast':!![]});if(_0x2b372f[_0xb349('0xd')]){logger[_0xb349('0xe')](_0xb349('0xf'),_0x55889b,_[_0xb349('0x10')](_0x2b372f,'message')[_0xb349('0x11')](',\x20'));_0x4f82e6['stop']();}else{var _0x354363=_[_0xb349('0x12')](_0x3d8822['agents'],handleFindAgent(_0x36b27c[_0xb349('0x9')]));if(_0x354363){var _0x40f189=(_0x36b27c['timeout']||0xa)*0x3e8;var _0x3a93ad,_0x155300;var _0x4d3343=seqqueue[_0xb349('0x13')](_0x40f189);_0x4d3343['id']=_0x55889b;_0x4d3343[_0xb349('0x14')]=_0x40f189;_0x4d3343['channel']=_0x16180b['channel'];writeLog(_0x55889b,_0x354363,util[_0xb349('0x15')](_0xb349('0x16'),_0x40f189));_0x3d8822[_0xb349('0x17')][_0x55889b]['on']('end',function(){logger[_0xb349('0x7')](_0xb349('0x18'),_0x55889b);clearTimeout(_0x155300);_0x155300=undefined;_0x4d3343[_0xb349('0x19')]();if(_0x3d8822[_0xb349('0x17')][_0x55889b]){delete _0x3d8822['rules'][_0x55889b];}_0x4f82e6[_0xb349('0x1a')]();});_0x3d8822[_0xb349('0x17')][_0x55889b]['on'](_0xb349('0x1b'),function(){if(_0x3d8822['rules'][_0x55889b]){delete _0x3d8822[_0xb349('0x17')][_0x55889b];}});_0x155300=setTimeout(function(){logger['info']('[%s][AGENT]\x20ROUTING\x20END',_0x55889b);clearTimeout(_0x155300);_0x4d3343['close']();_0x4f82e6[_0xb349('0x1c')]();},_0x40f189);strategy['agent'](_0x4d3343,_0x354363,_0x3d8822,_0x16180b);}else{logger['error'](_0xb349('0x1d'),_0x55889b,_0x36b27c[_0xb349('0x9')]);_0x4f82e6[_0xb349('0x1a')]();}}}catch(_0x2e1682){console[_0xb349('0x1e')](_0x2e1682);logger[_0xb349('0xe')]('[%s][QUEUE]\x20%s',_0x55889b,_0x2e1682[_0xb349('0x1f')]);_0x4f82e6[_0xb349('0x1a')]();}};}; \ No newline at end of file +var _0x31c1=['[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','validate','lodash','util','seq-queue','../../../../config/logger','routing','./strategy','string','number','timeout\x20is\x20a\x20number','info','[%s][AGENT][NAME:%s][STATUS:%s]','toLowerCase','consequence','length','error','[%s][AGENT]\x20%s','map','message','stop','find','agents','name','timeout','createQueue','channel','format','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','close','complete','next'];(function(_0x322966,_0x9f6e3d){var _0x67a26a=function(_0x513b9a){while(--_0x513b9a){_0x322966['push'](_0x322966['shift']());}};_0x67a26a(++_0x9f6e3d);}(_0x31c1,0xe1));var _0x131c=function(_0x2d1ed0,_0x5a3daf){_0x2d1ed0=_0x2d1ed0-0x0;var _0x1ba779=_0x31c1[_0x2d1ed0];return _0x1ba779;};'use strict';var schema=require(_0x131c('0x0'));var _=require(_0x131c('0x1'));var util=require(_0x131c('0x2'));var seqqueue=require(_0x131c('0x3'));var logger=require(_0x131c('0x4'))(_0x131c('0x5'));var strategy=require(_0x131c('0x6'));var queue=schema({'name':{'type':_0x131c('0x7'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x131c('0x8'),'message':_0x131c('0x9')}});function writeLog(_0x5cdcc3,_0xfc3e35,_0x40b4e5){return logger[_0x131c('0xa')](util['format'](_0x131c('0xb'),_0x5cdcc3,_0xfc3e35['name'],_0x40b4e5));}function handleFindAgent(_0x543be2){return function(_0x2f5ccc){return _0x2f5ccc['name'][_0x131c('0xc')]()===_0x543be2['toLowerCase']();};}exports[_0x131c('0xd')]=function(_0x5d61da,_0x352524,_0x27681a,_0x2fbaf6){return function(_0x1718c2){try{var _0x1e6e93={'name':_0x352524[0x0],'timeout':_0x352524[0x1]};var _0x809086=queue[_0x131c('0x0')](_0x1e6e93,{'typecast':!![]});if(_0x809086[_0x131c('0xe')]){logger[_0x131c('0xf')](_0x131c('0x10'),_0x5d61da,_[_0x131c('0x11')](_0x809086,_0x131c('0x12'))['join'](',\x20'));_0x1718c2[_0x131c('0x13')]();}else{var _0x24e644=_[_0x131c('0x14')](_0x27681a[_0x131c('0x15')],handleFindAgent(_0x1e6e93[_0x131c('0x16')]));if(_0x24e644){var _0x32d8b7=(_0x1e6e93[_0x131c('0x17')]||0xa)*0x3e8;var _0x159f54,_0x257369;var _0x1933a4=seqqueue[_0x131c('0x18')](_0x32d8b7);_0x1933a4['id']=_0x5d61da;_0x1933a4['atimeout']=_0x32d8b7;_0x1933a4[_0x131c('0x19')]=_0x2fbaf6[_0x131c('0x19')];writeLog(_0x5d61da,_0x24e644,util[_0x131c('0x1a')](_0x131c('0x1b'),_0x32d8b7));_0x27681a[_0x131c('0x1c')][_0x5d61da]['on'](_0x131c('0x1d'),function(){logger[_0x131c('0xa')](_0x131c('0x1e'),_0x5d61da);clearTimeout(_0x257369);_0x257369=undefined;_0x1933a4[_0x131c('0x1f')]();if(_0x27681a['rules'][_0x5d61da]){delete _0x27681a['rules'][_0x5d61da];}_0x1718c2[_0x131c('0x13')]();});_0x27681a[_0x131c('0x1c')][_0x5d61da]['on'](_0x131c('0x20'),function(){if(_0x27681a[_0x131c('0x1c')][_0x5d61da]){delete _0x27681a[_0x131c('0x1c')][_0x5d61da];}});_0x257369=setTimeout(function(){logger[_0x131c('0xa')]('[%s][AGENT]\x20ROUTING\x20END',_0x5d61da);clearTimeout(_0x257369);_0x1933a4[_0x131c('0x1f')]();_0x1718c2[_0x131c('0x21')]();},_0x32d8b7);strategy['agent'](_0x1933a4,_0x24e644,_0x27681a,_0x2fbaf6);}else{logger[_0x131c('0xf')](_0x131c('0x22'),_0x5d61da,_0x1e6e93[_0x131c('0x16')]);_0x1718c2[_0x131c('0x13')]();}}}catch(_0x5a4fb4){console[_0x131c('0x23')](_0x5a4fb4);logger[_0x131c('0xf')](_0x131c('0x24'),_0x5d61da,_0x5a4fb4['stack']);_0x1718c2[_0x131c('0x13')]();}};}; \ 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 c2afcc2..e44bd64 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 _0xc559=['out','channel','chat','AccountId','account','upperFirst','created','body','Message','create','then','catch','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','stop','LexRuntime','toString','postText','error','message','amazonlex','dialogState','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x31ab5d,_0x4495e8){var _0x343750=function(_0x29a836){while(--_0x29a836){_0x31ab5d['push'](_0x31ab5d['shift']());}};_0x343750(++_0x4495e8);}(_0xc559,0x180));var _0x9c55=function(_0x7a2c49,_0x2b4657){_0x7a2c49=_0x7a2c49-0x0;var _0x4592fd=_0xc559[_0x7a2c49];return _0x4592fd;};'use strict';var _=require(_0x9c55('0x0'));var moment=require(_0x9c55('0x1'));var AWS=require('aws-sdk');var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x9c55('0x2')),'openchannelMessage':require(_0x9c55('0x3')),'mailMessage':require(_0x9c55('0x4')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9c55('0x5'))};exports[_0x9c55('0x6')]=function(_0x416612,_0x13aebd){return function(_0x2ea42e){try{if(!_[_0x9c55('0x7')](this[_0x9c55('0x8')]['UserId'])){logger[_0x9c55('0x9')](_0x9c55('0xa'),_0x416612,_0x9c55('0xb'));return _0x2ea42e[_0x9c55('0xc')]();}var _0xab3475={'ContactId':this[_0x9c55('0xd')]['id'],'sentAt':moment()[_0x9c55('0xe')](_0x9c55('0xf')),'direction':_0x9c55('0x10')};var _0x4ba39c=this[_0x9c55('0x11')];if(_0x4ba39c===_0x9c55('0x12')){_0xab3475['ChatWebsiteId']=this['account']['id'];}else{_0xab3475[_['upperFirst'](_0x4ba39c)+_0x9c55('0x13')]=this[_0x9c55('0x14')]['id'];}_0xab3475[_[_0x9c55('0x15')](_0x4ba39c)+'InteractionId']=this['interaction']['id'];if(this[_0x9c55('0x8')][_0x9c55('0x16')]){var _0x15220b=_0x13aebd[0x4];if(!_['isEmpty'](_0x15220b)){_0xab3475[_0x9c55('0x17')]=utils['getMustacheRender'](_0x15220b,this);return rpc[_0x4ba39c+_0x9c55('0x18')][_0x9c55('0x19')](_0xab3475)[_0x9c55('0x1a')](function(_0x1ddb87){logger['info'](_0x9c55('0xa'),_0x416612,_0xab3475[_0x9c55('0x17')]);})[_0x9c55('0x1b')](function(_0x3c3cb2){logger['error'](_0x9c55('0xa'),_0x416612,JSON[_0x9c55('0x1c')](_0x3c3cb2));})[_0x9c55('0x1d')](function(){logger['info'](_0x9c55('0x1e'),_0x416612);_0x2ea42e['stop']();});}else{logger[_0x9c55('0x9')](_0x9c55('0x1f'),_0x416612);_0x2ea42e[_0x9c55('0x20')]();}}else{var _0x1f5a1f=this;var _0x383dbf=new AWS[(_0x9c55('0x21'))]({'accessKeyId':_0x13aebd[0x0],'secretAccessKey':_0x13aebd[0x1],'region':_0x13aebd[0x2]});var _0x24ba3a={'botAlias':'$LATEST','botName':_0x13aebd[0x3],'inputText':this['message'][_0x9c55('0x17')],'userId':this[_0x9c55('0x8')]['id'][_0x9c55('0x22')]()};_0x383dbf[_0x9c55('0x23')](_0x24ba3a,function(_0x517c99,_0x63b873){if(_0x517c99){logger[_0x9c55('0x24')](_0x9c55('0xa'),_0x416612,_0x517c99[_0x9c55('0x25')]);_0x2ea42e[_0x9c55('0xc')]();}else if(_0x63b873&&_0x63b873[_0x9c55('0x25')]){_0x1f5a1f['body'][_0x9c55('0x26')]=_0x63b873;_0xab3475[_0x9c55('0x17')]=_0x63b873[_0x9c55('0x25')];return rpc[_0x4ba39c+_0x9c55('0x18')][_0x9c55('0x19')](_0xab3475)[_0x9c55('0x1a')](function(_0x367b0e){logger[_0x9c55('0x9')]('[%s][AMAZONLEX]\x20%s',_0x416612,_0xab3475[_0x9c55('0x17')]);if(_0x63b873[_0x9c55('0x27')]=='Failed'){_0x2ea42e['next']();}else{_0x2ea42e[_0x9c55('0x20')]();}})[_0x9c55('0x1b')](function(_0x731291){logger['error']('[%s][AMAZONLEX]\x20%s',_0x416612,JSON[_0x9c55('0x1c')](_0x731291));_0x2ea42e['next']();});}else{_0x2ea42e['next']();}});}}catch(_0x525180){logger[_0x9c55('0x24')](_0x9c55('0xa'),_0x416612,JSON['stringify'](_0x525180));_0x2ea42e['stop']();}};}; \ No newline at end of file +var _0xa7db=['created','isEmpty','body','getMustacheRender','Message','then','catch','stringify','stop','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','LexRuntime','$LATEST','message','postText','error','amazonlex','create','dialogState','Failed','lodash','moment','aws-sdk','./utils','routing','../../rpc/chatMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','chat','upperFirst','account','InteractionId'];(function(_0xad8d98,_0xea6693){var _0x60525d=function(_0x52878e){while(--_0x52878e){_0xad8d98['push'](_0xad8d98['shift']());}};_0x60525d(++_0xea6693);}(_0xa7db,0x12b));var _0xba7d=function(_0x5dabfe,_0x537ef4){_0x5dabfe=_0x5dabfe-0x0;var _0x4b795c=_0xa7db[_0x5dabfe];return _0x4b795c;};'use strict';var _=require(_0xba7d('0x0'));var moment=require(_0xba7d('0x1'));var AWS=require(_0xba7d('0x2'));var utils=require(_0xba7d('0x3'));var logger=require('../../../../config/logger')(_0xba7d('0x4'));var rpc={'chatMessage':require(_0xba7d('0x5')),'openchannelMessage':require('../../rpc/openchannelMessage'),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require('../../rpc/faxMessage')};exports[_0xba7d('0x6')]=function(_0x1a92b5,_0xccb458){return function(_0x532f95){try{if(!_[_0xba7d('0x7')](this[_0xba7d('0x8')][_0xba7d('0x9')])){logger[_0xba7d('0xa')](_0xba7d('0xb'),_0x1a92b5,_0xba7d('0xc'));return _0x532f95[_0xba7d('0xd')]();}var _0x1211fd={'ContactId':this[_0xba7d('0xe')]['id'],'sentAt':moment()['format'](_0xba7d('0xf')),'direction':_0xba7d('0x10')};var _0x596e04=this['channel'];if(_0x596e04===_0xba7d('0x11')){_0x1211fd['ChatWebsiteId']=this['account']['id'];}else{_0x1211fd[_[_0xba7d('0x12')](_0x596e04)+'AccountId']=this[_0xba7d('0x13')]['id'];}_0x1211fd[_[_0xba7d('0x12')](_0x596e04)+_0xba7d('0x14')]=this[_0xba7d('0x8')]['id'];if(this[_0xba7d('0x8')][_0xba7d('0x15')]){var _0x259248=_0xccb458[0x4];if(!_[_0xba7d('0x16')](_0x259248)){_0x1211fd[_0xba7d('0x17')]=utils[_0xba7d('0x18')](_0x259248,this);return rpc[_0x596e04+_0xba7d('0x19')]['create'](_0x1211fd)[_0xba7d('0x1a')](function(_0x442ced){logger[_0xba7d('0xa')](_0xba7d('0xb'),_0x1a92b5,_0x1211fd[_0xba7d('0x17')]);})[_0xba7d('0x1b')](function(_0x5b455b){logger['error']('[%s][AMAZONLEX]\x20%s',_0x1a92b5,JSON[_0xba7d('0x1c')](_0x5b455b));})['finally'](function(){logger[_0xba7d('0xa')]('[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x1a92b5);_0x532f95[_0xba7d('0x1d')]();});}else{logger['info'](_0xba7d('0x1e'),_0x1a92b5);_0x532f95[_0xba7d('0x1d')]();}}else{var _0x181b3b=this;var _0x2882f1=new AWS[(_0xba7d('0x1f'))]({'accessKeyId':_0xccb458[0x0],'secretAccessKey':_0xccb458[0x1],'region':_0xccb458[0x2]});var _0x47debb={'botAlias':_0xba7d('0x20'),'botName':_0xccb458[0x3],'inputText':this[_0xba7d('0x21')]['body'],'userId':this[_0xba7d('0x8')]['id']['toString']()};_0x2882f1[_0xba7d('0x22')](_0x47debb,function(_0x1942c7,_0x345803){if(_0x1942c7){logger[_0xba7d('0x23')](_0xba7d('0xb'),_0x1a92b5,_0x1942c7[_0xba7d('0x21')]);_0x532f95[_0xba7d('0xd')]();}else if(_0x345803&&_0x345803[_0xba7d('0x21')]){_0x181b3b['body'][_0xba7d('0x24')]=_0x345803;_0x1211fd[_0xba7d('0x17')]=_0x345803['message'];return rpc[_0x596e04+_0xba7d('0x19')][_0xba7d('0x25')](_0x1211fd)[_0xba7d('0x1a')](function(_0x556e62){logger[_0xba7d('0xa')](_0xba7d('0xb'),_0x1a92b5,_0x1211fd['body']);if(_0x345803[_0xba7d('0x26')]==_0xba7d('0x27')){_0x532f95['next']();}else{_0x532f95['stop']();}})[_0xba7d('0x1b')](function(_0x238cad){logger[_0xba7d('0x23')]('[%s][AMAZONLEX]\x20%s',_0x1a92b5,JSON[_0xba7d('0x1c')](_0x238cad));_0x532f95[_0xba7d('0xd')]();});}else{_0x532f95[_0xba7d('0xd')]();}});}}catch(_0x56f9a3){logger[_0xba7d('0x23')](_0xba7d('0xb'),_0x1a92b5,JSON['stringify'](_0x56f9a3));_0x532f95[_0xba7d('0x1d')]();}};}; \ 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 a4b2ed7..1c8d15f 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 _0xd8b0=['upperFirst','AccountId','InteractionId','Message','service','Smtp','host','port','secure','pass','html','replace','','messageId','create','then','stringify','catch','error','[RPC][%s][AUTOREPLY]\x20%s','finally','lodash','moment','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','next','channel','contact','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','startsWith','Re:','chat','ChatWebsiteId','account'];(function(_0xae1d93,_0x139eac){var _0x363c4e=function(_0x35e3ad){while(--_0x35e3ad){_0xae1d93['push'](_0xae1d93['shift']());}};_0x363c4e(++_0x139eac);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var moment=require(_0x0d8b('0x1'));var utils=require('./utils');var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x0d8b('0x2')),'openchannelMessage':require(_0x0d8b('0x3')),'mailMessage':require(_0x0d8b('0x4')),'smsMessage':require(_0x0d8b('0x5')),'faxMessage':require(_0x0d8b('0x6'))};var mailRpc=require('../../mailRpc');exports['consequence']=function(_0x3f8b6f,_0x227c63){return function(_0x39f43a){try{if(_0x227c63[0x0]==='1'&&(_['isNil'](this[_0x0d8b('0x7')][_0x0d8b('0x8')])||!this['interaction'][_0x0d8b('0x8')])){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x0d8b('0xb'));return _0x39f43a[_0x0d8b('0xc')]();}var _0x1cac62=this[_0x0d8b('0xd')];var _0x28f87c={'body':utils['getMustacheRender'](_0x227c63[0x1],this),'ContactId':this[_0x0d8b('0xe')]['id'],'sentAt':moment()['format'](_0x0d8b('0xf')),'direction':_0x0d8b('0x10')};if(this[_0x0d8b('0x11')]){_0x28f87c['to']=this[_0x0d8b('0x11')][_0x0d8b('0x12')]||'';_0x28f87c['cc']=this[_0x0d8b('0x11')]['cc']||'';_0x28f87c[_0x0d8b('0x12')]=this[_0x0d8b('0x11')]['to']||'';_0x28f87c[_0x0d8b('0x13')]=this[_0x0d8b('0x11')][_0x0d8b('0x13')]||'';_0x28f87c[_0x0d8b('0x14')]=!![];if(this[_0x0d8b('0x11')][_0x0d8b('0x15')]){_0x28f87c['subject']='';_0x28f87c[_0x0d8b('0x15')]+=_[_0x0d8b('0x16')](this[_0x0d8b('0x11')][_0x0d8b('0x15')],_0x0d8b('0x17'))?'':'Re:\x20';_0x28f87c[_0x0d8b('0x15')]+=this[_0x0d8b('0x11')][_0x0d8b('0x15')];}}if(this[_0x0d8b('0xd')]===_0x0d8b('0x18')){_0x28f87c[_0x0d8b('0x19')]=this[_0x0d8b('0x1a')]['id'];}else{_0x28f87c[_[_0x0d8b('0x1b')](this['channel'])+_0x0d8b('0x1c')]=this[_0x0d8b('0x1a')]['id'];}_0x28f87c[_[_0x0d8b('0x1b')](this[_0x0d8b('0xd')])+_0x0d8b('0x1d')]=this[_0x0d8b('0x7')]['id'];if(rpc[this[_0x0d8b('0xd')]+_0x0d8b('0x1e')]){if(this['channel']==='mail'){var _0x33fb87={'tls':{'rejectUnauthorized':![]}};if(this['account']['Smtp']['service']){_0x33fb87[_0x0d8b('0x1f')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x1f')];}else{_0x33fb87[_0x0d8b('0x21')]=this[_0x0d8b('0x1a')][_0x0d8b('0x20')][_0x0d8b('0x21')];_0x33fb87[_0x0d8b('0x22')]=this['account'][_0x0d8b('0x20')][_0x0d8b('0x22')];_0x33fb87['secure']=this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x23')];}if(this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['authentication']){_0x33fb87['auth']={'user':this[_0x0d8b('0x1a')][_0x0d8b('0x20')]['user'],'pass':this[_0x0d8b('0x1a')]['Smtp'][_0x0d8b('0x24')]};}_0x28f87c['inReplyTo']=this[_0x0d8b('0x11')]['messageId'];_0x28f87c[_0x0d8b('0x25')]=''+_[_0x0d8b('0x26')](_0x28f87c['body'],_0x0d8b('0x27'),_0x0d8b('0x28'))+_0x0d8b('0x29');return mailRpc['sendMailMessage'](_0x33fb87,_0x28f87c)['then'](function(_0x51cf32){logger[_0x0d8b('0x9')]('[%s][AUTOREPLY]\x20SMTP\x20SENT',_0x3f8b6f);_0x28f87c[_0x0d8b('0x2a')]=_0x51cf32['message']['messageId'];return rpc[_0x1cac62+_0x0d8b('0x1e')][_0x0d8b('0x2b')](_0x28f87c);})[_0x0d8b('0x2c')](function(_0xdeee5d){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0xdeee5d));})[_0x0d8b('0x2e')](function(_0x553e03){logger[_0x0d8b('0x2f')](_0x0d8b('0x30'),_0x3f8b6f,JSON['stringify'](_0x553e03));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}else{return rpc[this[_0x0d8b('0xd')]+'Message'][_0x0d8b('0x2b')](_0x28f87c)[_0x0d8b('0x2c')](function(_0x206157){logger[_0x0d8b('0x9')](_0x0d8b('0xa'),_0x3f8b6f,_0x28f87c['body']);})[_0x0d8b('0x2e')](function(_0x1649fc){logger['error'](_0x0d8b('0xa'),_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x1649fc));})[_0x0d8b('0x31')](function(){_0x39f43a[_0x0d8b('0xc')]();});}}}catch(_0x373544){logger['error']('[%s][AUTOREPLY]\x20%s',_0x3f8b6f,JSON[_0x0d8b('0x2d')](_0x373544));_0x39f43a['stop']();}};}; \ No newline at end of file +var _0xcb91=['consequence','interaction','created','Autoreply\x20already\x20sent','next','channel','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message','from','phone','read','subject','Re:','Re:\x20','account','upperFirst','AccountId','mail','Smtp','service','port','secure','authentication','auth','user','pass','inReplyTo','messageId','','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(_0x41a457,_0x4a8e30){var _0x84b15f=function(_0x11868b){while(--_0x11868b){_0x41a457['push'](_0x41a457['shift']());}};_0x84b15f(++_0x4a8e30);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x38ce4c,_0xfdbe8c){_0x38ce4c=_0x38ce4c-0x0;var _0x5d4544=_0xcb91[_0x38ce4c];return _0x5d4544;};'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 4de3e53..4f0fd15 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 _0x4d6e=['consequence','info','[%s][CLOSE]\x20reason\x20%s','format','system','channel','Interaction','update','interaction','then','catch','[%s][CLOSE]\x20%s','stringify','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction'];(function(_0x1c03b5,_0x2f82cc){var _0x123651=function(_0x40a106){while(--_0x40a106){_0x1c03b5['push'](_0x1c03b5['shift']());}};_0x123651(++_0x2f82cc);}(_0x4d6e,0x77));var _0xe4d6=function(_0x4ca288,_0x254dd8){_0x4ca288=_0x4ca288-0x0;var _0x2362c1=_0x4d6e[_0x4ca288];return _0x2362c1;};'use strict';var moment=require(_0xe4d6('0x0'));var logger=require(_0xe4d6('0x1'))(_0xe4d6('0x2'));var rpc={'chatInteraction':require(_0xe4d6('0x3')),'openchannelInteraction':require(_0xe4d6('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xe4d6('0x5')),'faxInteraction':require(_0xe4d6('0x6'))};exports[_0xe4d6('0x7')]=function(_0x8d9190,_0x57e2ec,_0x2ef940,_0x3a452a){return function(_0x2d08ae){try{logger[_0xe4d6('0x8')](_0xe4d6('0x9'),_0x8d9190,_0x57e2ec[0x0]);var _0x352417={'closed':0x1,'closedAt':moment()[_0xe4d6('0xa')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xe4d6('0xb'),'disposition':_0x57e2ec[0x0]};if(rpc[_0x3a452a[_0xe4d6('0xc')]+'Interaction']){rpc[_0x3a452a[_0xe4d6('0xc')]+_0xe4d6('0xd')][_0xe4d6('0xe')](_0x3a452a[_0xe4d6('0xf')]['id'],_0x352417)[_0xe4d6('0x10')](function(_0x32c62e){logger['info']('[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!',_0x8d9190,_0x3a452a[_0xe4d6('0xf')]['id']);})[_0xe4d6('0x11')](function(_0x3edadb){logger['error'](_0xe4d6('0x12'),_0x8d9190,JSON[_0xe4d6('0x13')](_0x3edadb));})['finally'](function(){_0x2d08ae[_0xe4d6('0x14')]();});}}catch(_0xf0062e){logger['error'](_0xe4d6('0x12'),_0x8d9190,JSON[_0xe4d6('0x13')](_0xf0062e));_0x2d08ae[_0xe4d6('0x14')]();}};}; \ No newline at end of file +var _0x76d2=['[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stop','stringify','moment','../../../../config/logger','routing','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','Interaction','channel','update','interaction','then'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x76d2,0xf8));var _0x276d=function(_0x71185f,_0x371d74){_0x71185f=_0x71185f-0x0;var _0x160ffe=_0x76d2[_0x71185f];return _0x160ffe;};'use strict';var moment=require(_0x276d('0x0'));var logger=require(_0x276d('0x1'))(_0x276d('0x2'));var rpc={'chatInteraction':require('../../rpc/chatInteraction'),'openchannelInteraction':require(_0x276d('0x3')),'smsInteraction':require(_0x276d('0x4')),'mailInteraction':require(_0x276d('0x5')),'faxInteraction':require(_0x276d('0x6'))};exports['consequence']=function(_0x5f21ff,_0xa888b4,_0x2303bc,_0x27729d){return function(_0x1904bf){try{logger[_0x276d('0x7')](_0x276d('0x8'),_0x5f21ff,_0xa888b4[0x0]);var _0x357d9a={'closed':0x1,'closedAt':moment()[_0x276d('0x9')](_0x276d('0xa')),'closeReason':'system','disposition':_0xa888b4[0x0]};if(rpc[_0x27729d['channel']+_0x276d('0xb')]){rpc[_0x27729d[_0x276d('0xc')]+_0x276d('0xb')][_0x276d('0xd')](_0x27729d[_0x276d('0xe')]['id'],_0x357d9a)[_0x276d('0xf')](function(_0x5a115f){logger['info'](_0x276d('0x10'),_0x5f21ff,_0x27729d[_0x276d('0xe')]['id']);})[_0x276d('0x11')](function(_0x147a1e){logger[_0x276d('0x12')](_0x276d('0x13'),_0x5f21ff,JSON['stringify'](_0x147a1e));})['finally'](function(){_0x1904bf[_0x276d('0x14')]();});}}catch(_0x341446){logger[_0x276d('0x12')](_0x276d('0x13'),_0x5f21ff,JSON[_0x276d('0x15')](_0x341446));_0x1904bf[_0x276d('0x14')]();}};}; \ 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 28e0094..e5dc1d3 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 _0x2afa=['body','getMustacheRender','Message','create','then','info','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','message','dialogflow','result','fulfillment','endConversation','lodash','moment','apiai-promise','md5','./utils','../../../../config/logger','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','[%s][DIALOGFLOW]\x20%s','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','created','isEmpty'];(function(_0x12af21,_0x1c1c30){var _0x5875ae=function(_0x9e0768){while(--_0x9e0768){_0x12af21['push'](_0x12af21['shift']());}};_0x5875ae(++_0x1c1c30);}(_0x2afa,0x12d));var _0xa2af=function(_0x507c0d,_0x1b2648){_0x507c0d=_0x507c0d-0x0;var _0x468de6=_0x2afa[_0x507c0d];return _0x468de6;};'use strict';var _=require(_0xa2af('0x0'));var moment=require(_0xa2af('0x1'));var apiai=require(_0xa2af('0x2'));var md5=require(_0xa2af('0x3'));var utils=require(_0xa2af('0x4'));var logger=require(_0xa2af('0x5'))('routing');var rpc={'chatMessage':require(_0xa2af('0x6')),'openchannelMessage':require(_0xa2af('0x7')),'mailMessage':require(_0xa2af('0x8')),'smsMessage':require(_0xa2af('0x9')),'faxMessage':require('../../rpc/faxMessage')};exports[_0xa2af('0xa')]=function(_0x544f7a,_0x4fe4d7){return function(_0x5dd460){try{if(!_[_0xa2af('0xb')](this[_0xa2af('0xc')][_0xa2af('0xd')])){logger['info'](_0xa2af('0xe'),_0x544f7a,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x5dd460[_0xa2af('0xf')]();}var _0x10585e={'ContactId':this[_0xa2af('0x10')]['id'],'sentAt':moment()['format'](_0xa2af('0x11')),'direction':_0xa2af('0x12')};var _0x5968c7=this[_0xa2af('0x13')];if(_0x5968c7===_0xa2af('0x14')){_0x10585e[_0xa2af('0x15')]=this['account']['id'];}else{_0x10585e[_[_0xa2af('0x16')](_0x5968c7)+_0xa2af('0x17')]=this[_0xa2af('0x18')]['id'];}_0x10585e[_[_0xa2af('0x16')](_0x5968c7)+_0xa2af('0x19')]=this[_0xa2af('0xc')]['id'];if(this[_0xa2af('0xc')][_0xa2af('0x1a')]){var _0x26d70e=_0x4fe4d7[0x2];if(!_[_0xa2af('0x1b')](_0x26d70e)){_0x10585e[_0xa2af('0x1c')]=utils[_0xa2af('0x1d')](_0x26d70e,this);return rpc[_0x5968c7+_0xa2af('0x1e')][_0xa2af('0x1f')](_0x10585e)[_0xa2af('0x20')](function(_0x41bc30){logger[_0xa2af('0x21')]('[%s][DIALOGFLOW]\x20%s',_0x544f7a,_0x10585e['body']);})[_0xa2af('0x22')](function(_0x233518){logger[_0xa2af('0x23')](_0xa2af('0xe'),_0x544f7a,JSON[_0xa2af('0x24')](_0x233518));})[_0xa2af('0x25')](function(){logger[_0xa2af('0x21')](_0xa2af('0x26'),_0x544f7a);_0x5dd460[_0xa2af('0x27')]();});}else{logger['info'](_0xa2af('0x28'),_0x544f7a);_0x5dd460[_0xa2af('0x27')]();}}else{var _0x54f087=this;var _0x2c2d83=apiai(_0x4fe4d7[0x0],{'language':_0x4fe4d7[0x1]||'en'});return _0x2c2d83[_0xa2af('0x29')](this[_0xa2af('0x2a')][_0xa2af('0x1c')],{'sessionId':md5(this[_0xa2af('0xc')]['id'])})[_0xa2af('0x20')](function(_0x3e035e){_0x54f087['body'][_0xa2af('0x2b')]=_0x3e035e;_0x10585e[_0xa2af('0x1c')]=_0x3e035e[_0xa2af('0x2c')][_0xa2af('0x2d')]['speech'];return rpc[_0x5968c7+_0xa2af('0x1e')]['create'](_0x10585e)[_0xa2af('0x20')](function(_0x22c88e){logger['info'](_0xa2af('0xe'),_0x544f7a,_0x10585e['body']);if(_0x3e035e[_0xa2af('0x2c')]['metadata'][_0xa2af('0x2e')]){_0x5dd460[_0xa2af('0xf')]();}else{_0x5dd460[_0xa2af('0x27')]();}})[_0xa2af('0x22')](function(_0x7bc00e){logger[_0xa2af('0x23')](_0xa2af('0xe'),_0x544f7a,JSON[_0xa2af('0x24')](_0x7bc00e));_0x5dd460[_0xa2af('0xf')]();});})['catch'](function(_0x144c1f){logger[_0xa2af('0x23')](_0xa2af('0xe'),_0x544f7a,_0x144c1f[_0xa2af('0x2a')]);_0x5dd460[_0xa2af('0xf')]();});}}catch(_0x36d1bc){logger[_0xa2af('0x23')](_0xa2af('0xe'),_0x544f7a,JSON[_0xa2af('0x24')](_0x36d1bc));_0x5dd460[_0xa2af('0x27')]();}};}; \ No newline at end of file +var _0x316a=['next','YYYY-MM-DD\x20HH:mm:ss','channel','chat','ChatWebsiteId','upperFirst','AccountId','InteractionId','created','body','getMustacheRender','Message','catch','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','message','result','speech','create','then','metadata','endConversation','error','lodash','moment','apiai-promise','md5','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info','[%s][DIALOGFLOW]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.'];(function(_0x250a51,_0x5bf8f8){var _0x5042b7=function(_0xa8a250){while(--_0xa8a250){_0x250a51['push'](_0x250a51['shift']());}};_0x5042b7(++_0x5bf8f8);}(_0x316a,0x161));var _0xa316=function(_0x2acce9,_0x461dff){_0x2acce9=_0x2acce9-0x0;var _0x53fb34=_0x316a[_0x2acce9];return _0x53fb34;};'use strict';var _=require(_0xa316('0x0'));var moment=require(_0xa316('0x1'));var apiai=require(_0xa316('0x2'));var md5=require(_0xa316('0x3'));var utils=require(_0xa316('0x4'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xa316('0x5')),'openchannelMessage':require(_0xa316('0x6')),'mailMessage':require(_0xa316('0x7')),'smsMessage':require(_0xa316('0x8')),'faxMessage':require(_0xa316('0x9'))};exports[_0xa316('0xa')]=function(_0x4a40b7,_0x16dca2){return function(_0x284d19){try{if(!_[_0xa316('0xb')](this[_0xa316('0xc')]['UserId'])){logger[_0xa316('0xd')](_0xa316('0xe'),_0x4a40b7,_0xa316('0xf'));return _0x284d19[_0xa316('0x10')]();}var _0x43dc95={'ContactId':this['contact']['id'],'sentAt':moment()['format'](_0xa316('0x11')),'direction':'out'};var _0x5b8772=this[_0xa316('0x12')];if(_0x5b8772===_0xa316('0x13')){_0x43dc95[_0xa316('0x14')]=this['account']['id'];}else{_0x43dc95[_[_0xa316('0x15')](_0x5b8772)+_0xa316('0x16')]=this['account']['id'];}_0x43dc95[_['upperFirst'](_0x5b8772)+_0xa316('0x17')]=this[_0xa316('0xc')]['id'];if(this[_0xa316('0xc')][_0xa316('0x18')]){var _0x5ec55a=_0x16dca2[0x2];if(!_['isEmpty'](_0x5ec55a)){_0x43dc95[_0xa316('0x19')]=utils[_0xa316('0x1a')](_0x5ec55a,this);return rpc[_0x5b8772+_0xa316('0x1b')]['create'](_0x43dc95)['then'](function(_0x570ebe){logger[_0xa316('0xd')](_0xa316('0xe'),_0x4a40b7,_0x43dc95[_0xa316('0x19')]);})[_0xa316('0x1c')](function(_0x4ae0fc){logger['error']('[%s][DIALOGFLOW]\x20%s',_0x4a40b7,JSON[_0xa316('0x1d')](_0x4ae0fc));})[_0xa316('0x1e')](function(){logger[_0xa316('0xd')](_0xa316('0x1f'),_0x4a40b7);_0x284d19[_0xa316('0x20')]();});}else{logger[_0xa316('0xd')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!',_0x4a40b7);_0x284d19[_0xa316('0x20')]();}}else{var _0x2461ab=this;var _0x351872=apiai(_0x16dca2[0x0],{'language':_0x16dca2[0x1]||'en'});return _0x351872['textRequest'](this[_0xa316('0x21')]['body'],{'sessionId':md5(this[_0xa316('0xc')]['id'])})['then'](function(_0x463709){_0x2461ab[_0xa316('0x19')]['dialogflow']=_0x463709;_0x43dc95[_0xa316('0x19')]=_0x463709[_0xa316('0x22')]['fulfillment'][_0xa316('0x23')];return rpc[_0x5b8772+'Message'][_0xa316('0x24')](_0x43dc95)[_0xa316('0x25')](function(_0x228138){logger[_0xa316('0xd')](_0xa316('0xe'),_0x4a40b7,_0x43dc95['body']);if(_0x463709['result'][_0xa316('0x26')][_0xa316('0x27')]){_0x284d19[_0xa316('0x10')]();}else{_0x284d19[_0xa316('0x20')]();}})[_0xa316('0x1c')](function(_0x1170c6){logger[_0xa316('0x28')](_0xa316('0xe'),_0x4a40b7,JSON[_0xa316('0x1d')](_0x1170c6));_0x284d19[_0xa316('0x10')]();});})[_0xa316('0x1c')](function(_0xd020c7){logger[_0xa316('0x28')](_0xa316('0xe'),_0x4a40b7,_0xd020c7[_0xa316('0x21')]);_0x284d19[_0xa316('0x10')]();});}}catch(_0x2c376f){logger[_0xa316('0x28')](_0xa316('0xe'),_0x4a40b7,JSON[_0xa316('0x1d')](_0x2c376f));_0x284d19['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 963320f..1cb673a 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 _0x12cc=['length','error','map','message','join','stop','condition','priorityTrue','priorityFalse','info','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','validate','lodash','html-to-text','./utils','../../../../config/logger','routing','string','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20true\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace'];(function(_0x38a0ce,_0x1b7524){var _0x29409f=function(_0x143795){while(--_0x143795){_0x38a0ce['push'](_0x38a0ce['shift']());}};_0x29409f(++_0x1b7524);}(_0x12cc,0x178));var _0xc12c=function(_0x31199a,_0x237cf9){_0x31199a=_0x31199a-0x0;var _0x3f26d8=_0x12cc[_0x31199a];return _0x3f26d8;};'use strict';var schema=require(_0xc12c('0x0'));var _=require(_0xc12c('0x1'));var htmlToText=require(_0xc12c('0x2'));var utils=require(_0xc12c('0x3'));var logger=require(_0xc12c('0x4'))(_0xc12c('0x5'));var gotoif=schema({'condition':{'type':_0xc12c('0x6'),'required':!![],'message':_0xc12c('0x7')},'priorityTrue':{'type':_0xc12c('0x8'),'message':_0xc12c('0x9')},'priorityFalse':{'type':_0xc12c('0x8'),'message':'priority\x20false\x20is\x20a\x20number'}});exports[_0xc12c('0xa')]=function(_0x2fe053,_0x374a4b){return function(_0x37cf24){try{var _0x3949cf={'condition':htmlToText[_0xc12c('0xb')](utils[_0xc12c('0xc')](_0x374a4b[0x0],this),{'wordwrap':![]})[_0xc12c('0xd')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x374a4b[0x1],'priorityFalse':_0x374a4b[0x2]};var _0x56618f=gotoif['validate'](_0x3949cf,{'typecast':!![]});if(_0x56618f[_0xc12c('0xe')]){logger[_0xc12c('0xf')]('[%s][GOTOIF]\x20%s',_0x2fe053,_[_0xc12c('0x10')](_0x56618f,_0xc12c('0x11'))[_0xc12c('0x12')](',\x20'));_0x37cf24[_0xc12c('0x13')]();}else{try{var _0x397907=eval('('+_0x3949cf[_0xc12c('0x14')]+')');var _0x5da45c=_0x397907?_0x3949cf[_0xc12c('0x15')]:_0x3949cf[_0xc12c('0x16')];logger[_0xc12c('0x17')]('[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s',_0x2fe053,_0x3949cf[_0xc12c('0x14')],_0x397907,_0x5da45c||_0xc12c('0x18'));if(_0x5da45c){var _0x328260=_['findIndex'](_0x37cf24[_0xc12c('0x19')](),{'p':_0x5da45c});if(_0x328260>=0x0){logger['info'](_0xc12c('0x1a'),_0x2fe053,_0x5da45c||'next',_0x328260);_0x37cf24['next'](_0x328260);}else{logger[_0xc12c('0x17')](_0xc12c('0x1b'),_0x2fe053,_0x5da45c||_0xc12c('0x18'));_0x37cf24[_0xc12c('0x13')]();}}else{_0x37cf24['next']();}}catch(_0x5f49ee){logger[_0xc12c('0xf')](_0xc12c('0x1c'),_0x2fe053,_0x5f49ee['message']);_0x37cf24[_0xc12c('0x13')]();}}}catch(_0x56b6f1){logger[_0xc12c('0xf')]('[%s][GOTOIF]\x20%s',_0x2fe053,JSON[_0xc12c('0x1d')](_0x56b6f1));_0x37cf24['stop']();}};}; \ No newline at end of file +var _0xf362=['condition','priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','next','rules','[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','routing','string','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','error','map','message','join','stop'];(function(_0x4f4343,_0x5779a0){var _0x26317e=function(_0x2adfc9){while(--_0x2adfc9){_0x4f4343['push'](_0x4f4343['shift']());}};_0x26317e(++_0x5779a0);}(_0xf362,0x111));var _0x2f36=function(_0x149c43,_0x101c60){_0x149c43=_0x149c43-0x0;var _0xd7a8a3=_0xf362[_0x149c43];return _0xd7a8a3;};'use strict';var schema=require(_0x2f36('0x0'));var _=require('lodash');var htmlToText=require(_0x2f36('0x1'));var utils=require(_0x2f36('0x2'));var logger=require('../../../../config/logger')(_0x2f36('0x3'));var gotoif=schema({'condition':{'type':_0x2f36('0x4'),'required':!![],'message':'condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'priorityTrue':{'type':_0x2f36('0x5'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x2f36('0x5'),'message':_0x2f36('0x6')}});exports[_0x2f36('0x7')]=function(_0x1d6297,_0x269daf){return function(_0x2ad727){try{var _0xf56ce0={'condition':htmlToText[_0x2f36('0x8')](utils[_0x2f36('0x9')](_0x269daf[0x0],this),{'wordwrap':![]})[_0x2f36('0xa')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x269daf[0x1],'priorityFalse':_0x269daf[0x2]};var _0x3d89ab=gotoif[_0x2f36('0x0')](_0xf56ce0,{'typecast':!![]});if(_0x3d89ab[_0x2f36('0xb')]){logger[_0x2f36('0xc')]('[%s][GOTOIF]\x20%s',_0x1d6297,_[_0x2f36('0xd')](_0x3d89ab,_0x2f36('0xe'))[_0x2f36('0xf')](',\x20'));_0x2ad727[_0x2f36('0x10')]();}else{try{var _0x31d306=eval('('+_0xf56ce0[_0x2f36('0x11')]+')');var _0x5cbdb1=_0x31d306?_0xf56ce0[_0x2f36('0x12')]:_0xf56ce0[_0x2f36('0x13')];logger[_0x2f36('0x14')](_0x2f36('0x15'),_0x1d6297,_0xf56ce0[_0x2f36('0x11')],_0x31d306,_0x5cbdb1||_0x2f36('0x16'));if(_0x5cbdb1){var _0x36f2e3=_['findIndex'](_0x2ad727[_0x2f36('0x17')](),{'p':_0x5cbdb1});if(_0x36f2e3>=0x0){logger['info'](_0x2f36('0x18'),_0x1d6297,_0x5cbdb1||_0x2f36('0x16'),_0x36f2e3);_0x2ad727[_0x2f36('0x16')](_0x36f2e3);}else{logger['info'](_0x2f36('0x19'),_0x1d6297,_0x5cbdb1||_0x2f36('0x16'));_0x2ad727[_0x2f36('0x10')]();}}else{_0x2ad727['next']();}}catch(_0x6d814f){logger[_0x2f36('0xc')](_0x2f36('0x1a'),_0x1d6297,_0x6d814f['message']);_0x2ad727[_0x2f36('0x10')]();}}}catch(_0x24d4bd){logger[_0x2f36('0xc')](_0x2f36('0x1b'),_0x1d6297,JSON[_0x2f36('0x1c')](_0x24d4bd));_0x2ad727[_0x2f36('0x10')]();}};}; \ 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 7d79d8f..3a6e455 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 _0xdd3f=['number','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','length','error','message','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','info','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','stop','lodash','../../../../config/logger'];(function(_0x3dd8db,_0xd48930){var _0x49981f=function(_0x28eb8d){while(--_0x28eb8d){_0x3dd8db['push'](_0x3dd8db['shift']());}};_0x49981f(++_0xd48930);}(_0xdd3f,0x11f));var _0xfdd3=function(_0x3a3c76,_0x4aa626){_0x3a3c76=_0x3a3c76-0x0;var _0x28c2ba=_0xdd3f[_0x3a3c76];return _0x28c2ba;};'use strict';var schema=require('validate');var _=require(_0xfdd3('0x0'));var logger=require(_0xfdd3('0x1'))('routing');var gotop=schema({'priority':{'type':_0xfdd3('0x2'),'required':!![],'message':_0xfdd3('0x3')}});exports['consequence']=function(_0x5b423c,_0x4d3263){return function(_0x4f7fe3){try{var _0xe51199={'priority':_0x4d3263[0x0]};var _0x4fe459=gotop['validate'](_0xe51199,{'typecast':!![]});if(_0x4fe459[_0xfdd3('0x4')]){logger[_0xfdd3('0x5')]('[%s][GOTOP]\x20%s',_0x5b423c,_['map'](_0x4fe459,_0xfdd3('0x6'))['join'](',\x20'));_0x4f7fe3['stop']();}else{logger['info'](_0xfdd3('0x7'),_0x5b423c,_0xe51199[_0xfdd3('0x8')]);if(_0xe51199[_0xfdd3('0x8')]){var _0x32cad4=_[_0xfdd3('0x9')](_0x4f7fe3[_0xfdd3('0xa')](),{'p':_0xe51199[_0xfdd3('0x8')]});if(_0x32cad4>=0x0){logger['info'](_0xfdd3('0xb'),_0x5b423c,_0xe51199['priority']||'next',_0x32cad4);_0x4f7fe3[_0xfdd3('0xc')](_0x32cad4);}else{logger[_0xfdd3('0xd')](_0xfdd3('0xe'),_0x5b423c,_0xe51199[_0xfdd3('0x8')]||'next');_0x4f7fe3['stop']();}}else{_0x4f7fe3[_0xfdd3('0xc')]();}}}catch(_0x32fe6e){logger[_0xfdd3('0x5')]('[%s][GOTOP]\x20%s',_0x5b423c,JSON[_0xfdd3('0xf')](_0x32fe6e));_0x4f7fe3[_0xfdd3('0x10')]();}};}; \ No newline at end of file +var _0xde4d=['[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','stringify','validate','../../../../config/logger','routing','number','consequence','error','[%s][GOTOP]\x20%s','map','message','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','findIndex','rules'];(function(_0x31a447,_0x125cb6){var _0x317e8a=function(_0x3841c4){while(--_0x3841c4){_0x31a447['push'](_0x31a447['shift']());}};_0x317e8a(++_0x125cb6);}(_0xde4d,0x89));var _0xdde4=function(_0x40ff05,_0xc9ba32){_0x40ff05=_0x40ff05-0x0;var _0x36a7e6=_0xde4d[_0x40ff05];return _0x36a7e6;};'use strict';var schema=require(_0xdde4('0x0'));var _=require('lodash');var logger=require(_0xdde4('0x1'))(_0xdde4('0x2'));var gotop=schema({'priority':{'type':_0xdde4('0x3'),'required':!![],'message':'priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required'}});exports[_0xdde4('0x4')]=function(_0x3bae77,_0x171709){return function(_0x479482){try{var _0x36dd89={'priority':_0x171709[0x0]};var _0x1596c8=gotop['validate'](_0x36dd89,{'typecast':!![]});if(_0x1596c8['length']){logger[_0xdde4('0x5')](_0xdde4('0x6'),_0x3bae77,_[_0xdde4('0x7')](_0x1596c8,_0xdde4('0x8'))['join'](',\x20'));_0x479482[_0xdde4('0x9')]();}else{logger[_0xdde4('0xa')](_0xdde4('0xb'),_0x3bae77,_0x36dd89[_0xdde4('0xc')]);if(_0x36dd89[_0xdde4('0xc')]){var _0x4a172d=_[_0xdde4('0xd')](_0x479482[_0xdde4('0xe')](),{'p':_0x36dd89[_0xdde4('0xc')]});if(_0x4a172d>=0x0){logger['info'](_0xdde4('0xf'),_0x3bae77,_0x36dd89[_0xdde4('0xc')]||_0xdde4('0x10'),_0x4a172d);_0x479482[_0xdde4('0x10')](_0x4a172d);}else{logger[_0xdde4('0xa')](_0xdde4('0x11'),_0x3bae77,_0x36dd89['priority']||_0xdde4('0x10'));_0x479482['stop']();}}else{_0x479482['next']();}}}catch(_0xb9e7f){logger[_0xdde4('0x5')]('[%s][GOTOP]\x20%s',_0x3bae77,JSON[_0xdde4('0x12')](_0xb9e7f));_0x479482['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 31eb5c5..deb4efc 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 _0xff7a=['channel','AccountId','account','upperFirst','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','ChatWebsiteId'];(function(_0x177ff1,_0x493fb3){var _0x1a2909=function(_0xd0045f){while(--_0xd0045f){_0x177ff1['push'](_0x177ff1['shift']());}};_0x1a2909(++_0x493fb3);}(_0xff7a,0x13a));var _0xaff7=function(_0x1dda13,_0x46927e){_0x1dda13=_0x1dda13-0x0;var _0x4f4728=_0xff7a[_0x1dda13];return _0x4f4728;};'use strict';var _=require(_0xaff7('0x0'));var utils=require(_0xaff7('0x1'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0xaff7('0x2')),'openchannelMessage':require(_0xaff7('0x3')),'mailMessage':require(_0xaff7('0x4')),'smsMessage':require(_0xaff7('0x5')),'faxMessage':require(_0xaff7('0x6'))};exports[_0xaff7('0x7')]=function(_0x4899d7,_0x8f4158){return function(_0x3337cb){try{var _0x1265d3={'body':utils[_0xaff7('0x8')](_0x8f4158[0x0],this),'ContactId':this[_0xaff7('0x9')]['id']};if(this['channel']==='chat'){_0x1265d3[_0xaff7('0xa')]=this['account']['id'];}else{_0x1265d3[_['upperFirst'](this[_0xaff7('0xb')])+_0xaff7('0xc')]=this[_0xaff7('0xd')]['id'];}_0x1265d3[_[_0xaff7('0xe')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0xaff7('0xb')]+_0xaff7('0xf')]){return rpc[this[_0xaff7('0xb')]+_0xaff7('0xf')][_0xaff7('0x10')](_0x1265d3)[_0xaff7('0x11')](function(_0x522498){logger[_0xaff7('0x12')](_0xaff7('0x13'),_0x4899d7,_0x1265d3[_0xaff7('0x14')]);_0x3337cb[_0xaff7('0x15')]();})['catch'](function(_0x26cb2b){logger[_0xaff7('0x16')](_0xaff7('0x13'),_0x4899d7,JSON[_0xaff7('0x17')](_0x26cb2b));_0x3337cb[_0xaff7('0x18')]();});}}catch(_0x218c33){logger[_0xaff7('0x16')]('[%s][MESSAGE]\x20%s',_0x4899d7,JSON['stringify'](_0x218c33));_0x3337cb[_0xaff7('0x18')]();}};}; \ No newline at end of file +var _0xbc9d=['./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','contact','channel','chat','upperFirst','account','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','body','next','error','stringify','stop','lodash'];(function(_0xc8a931,_0x260690){var _0x28bd27=function(_0x591b9f){while(--_0x591b9f){_0xc8a931['push'](_0xc8a931['shift']());}};_0x28bd27(++_0x260690);}(_0xbc9d,0x67));var _0xdbc9=function(_0x2a9bf4,_0x3ee11e){_0x2a9bf4=_0x2a9bf4-0x0;var _0x40edc2=_0xbc9d[_0x2a9bf4];return _0x40edc2;};'use strict';var _=require(_0xdbc9('0x0'));var utils=require(_0xdbc9('0x1'));var logger=require(_0xdbc9('0x2'))(_0xdbc9('0x3'));var rpc={'chatMessage':require(_0xdbc9('0x4')),'openchannelMessage':require(_0xdbc9('0x5')),'mailMessage':require(_0xdbc9('0x6')),'smsMessage':require(_0xdbc9('0x7')),'faxMessage':require(_0xdbc9('0x8'))};exports[_0xdbc9('0x9')]=function(_0x44f5eb,_0x3d22a4){return function(_0x453d6a){try{var _0x1d0f81={'body':utils['getMustacheRender'](_0x3d22a4[0x0],this),'ContactId':this[_0xdbc9('0xa')]['id']};if(this[_0xdbc9('0xb')]===_0xdbc9('0xc')){_0x1d0f81['ChatWebsiteId']=this['account']['id'];}else{_0x1d0f81[_[_0xdbc9('0xd')](this['channel'])+'AccountId']=this[_0xdbc9('0xe')]['id'];}_0x1d0f81[_['upperFirst'](this[_0xdbc9('0xb')])+'InteractionId']=this[_0xdbc9('0xf')]['id'];if(rpc[this[_0xdbc9('0xb')]+'Message']){return rpc[this[_0xdbc9('0xb')]+_0xdbc9('0x10')][_0xdbc9('0x11')](_0x1d0f81)[_0xdbc9('0x12')](function(_0x4cecf8){logger[_0xdbc9('0x13')](_0xdbc9('0x14'),_0x44f5eb,_0x1d0f81[_0xdbc9('0x15')]);_0x453d6a[_0xdbc9('0x16')]();})['catch'](function(_0x122214){logger[_0xdbc9('0x17')](_0xdbc9('0x14'),_0x44f5eb,JSON[_0xdbc9('0x18')](_0x122214));_0x453d6a[_0xdbc9('0x19')]();});}}catch(_0x286422){logger[_0xdbc9('0x17')]('[%s][MESSAGE]\x20%s',_0x44f5eb,JSON[_0xdbc9('0x18')](_0x286422));_0x453d6a[_0xdbc9('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 05717b2..1b35179 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 _0xb585=['stop','../../../../config/logger','info','[%s][NOOP]\x20%s','getMustacheRender','next','stringify'];(function(_0xb7dd6f,_0x2f9ce2){var _0x1f548d=function(_0x43ab87){while(--_0x43ab87){_0xb7dd6f['push'](_0xb7dd6f['shift']());}};_0x1f548d(++_0x2f9ce2);}(_0xb585,0x78));var _0x5b58=function(_0x27b41b,_0x37bd22){_0x27b41b=_0x27b41b-0x0;var _0x4b24d7=_0xb585[_0x27b41b];return _0x4b24d7;};'use strict';var utils=require('./utils');var logger=require(_0x5b58('0x0'))('routing');exports['consequence']=function(_0x46568d,_0x5d45dd){return function(_0x2e7048){try{logger[_0x5b58('0x1')](_0x5b58('0x2'),_0x46568d,utils[_0x5b58('0x3')](_0x5d45dd[0x0],this));_0x2e7048[_0x5b58('0x4')]();}catch(_0x7d15e0){logger['error'](_0x5b58('0x2'),_0x46568d,JSON[_0x5b58('0x5')](_0x7d15e0));_0x2e7048[_0x5b58('0x6')]();}};}; \ No newline at end of file +var _0xc681=['error','stringify','stop','routing','consequence','info','[%s][NOOP]\x20%s','next'];(function(_0x205b0f,_0x46fce5){var _0x14d875=function(_0x55e10d){while(--_0x55e10d){_0x205b0f['push'](_0x205b0f['shift']());}};_0x14d875(++_0x46fce5);}(_0xc681,0x1cb));var _0x1c68=function(_0x3fe5b4,_0x545d83){_0x3fe5b4=_0x3fe5b4-0x0;var _0x12b07d=_0xc681[_0x3fe5b4];return _0x12b07d;};'use strict';var utils=require('./utils');var logger=require('../../../../config/logger')(_0x1c68('0x0'));exports[_0x1c68('0x1')]=function(_0x367924,_0x39eef7){return function(_0x114b0e){try{logger[_0x1c68('0x2')](_0x1c68('0x3'),_0x367924,utils['getMustacheRender'](_0x39eef7[0x0],this));_0x114b0e[_0x1c68('0x4')]();}catch(_0x5f2d76){logger[_0x1c68('0x5')](_0x1c68('0x3'),_0x367924,JSON[_0x1c68('0x6')](_0x5f2d76));_0x114b0e[_0x1c68('0x7')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/queue.js b/server/services/routing/server/applications/queue.js index 85daa1d..dfaa24a 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 _0x1339=['../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','timeout\x20is\x20a\x20number','waiting','body','list','channel','QueueId','upperFirst','interaction','MessageId','message','chat','AccountId','info','[%s][START:QUEUE][NAME:%s]','name','QueueReport','catch','error','create\x20queue\x20report','YYYY-MM-DD\x20HH:mm:ss','[%s][STOP:QUEUE][NAME:%s]','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','validate','join','stop','find','Queues','createQueue','atimeout','rules','end','close','complete','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','stack','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','defaults','redis','localhost','queue_id','account','queue','from','joinAt','emit','clone','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','../../rpc/openchannelQueueReport'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x1339,0x1ed));var _0x9133=function(_0x404430,_0x3d601b){_0x404430=_0x404430-0x0;var _0x163c67=_0x1339[_0x404430];return _0x163c67;};'use strict';var schema=require('validate');var _=require('lodash');var util=require(_0x9133('0x0'));var seqqueue=require(_0x9133('0x1'));var moment=require(_0x9133('0x2'));var Redis=require(_0x9133('0x3'));var config=require(_0x9133('0x4'));var logger=require(_0x9133('0x5'))(_0x9133('0x6'));var strategy=require(_0x9133('0x7'));config['redis']=_[_0x9133('0x8')](config[_0x9133('0x9')],{'host':_0x9133('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9133('0x9')]));var attributes=['id',_0x9133('0xb'),_0x9133('0xc'),_0x9133('0xd'),_0x9133('0xe'),_0x9133('0xf')];function emit(_0x4294b7,_0x245134,_0x10a9e4){io['to'](_0x4294b7)[_0x9133('0x10')](_0x245134,_0x10a9e4);}function emitChannelQueueInteraction(_0x4c4517,_0x3f9650,_0x3533fa,_0x438f23,_0x452481,_0x3b8f89,_0x244ced,_0x5ef6b5){var _0xb64550=_[_0x9133('0x11')](_0x3533fa);_0xb64550['queue_id']=_0x5ef6b5;_0xb64550['queue']=_0x3f9650;_0xb64550[_0x9133('0xc')]=_0x438f23;_0xb64550['id']=_0x452481;if(_0x3b8f89){_0x244ced[util['format'](_0x9133('0x12'),_0x4c4517)][_0x452481]=_[_0x9133('0x13')](_0xb64550,attributes);}else{delete _0x244ced[util[_0x9133('0x14')](_0x9133('0x12'),_0x4c4517)][_0x452481];}emit(util[_0x9133('0x14')](_0x9133('0x15'),_0x4c4517,_0x3f9650),util['format'](_0x9133('0x16'),_0x4c4517,_0x3b8f89?_0x9133('0x17'):'remove'),_[_0x9133('0x13')](_0xb64550,attributes));}var rpc={'openchannelQueueReport':require(_0x9133('0x18')),'mailQueueReport':require(_0x9133('0x19')),'chatQueueReport':require(_0x9133('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require(_0x9133('0x1b'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0x9133('0x1c')},'timeout':{'type':'number','message':_0x9133('0x1d')}});function startRouting(_0x1d6d0b,_0x5e8620,_0x38dd60,_0x4b940b){if(_0x1d6d0b&&_0x5e8620&&_0x38dd60){_0x5e8620[_0x9133('0x1e')]+=0x1;var _0x57af5e={'uniqueid':_0x1d6d0b,'from':_0x38dd60['body']?_0x38dd60[_0x9133('0x1f')]['from']:'','joinAt':moment()[_0x9133('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x38dd60['contact']?_0x38dd60['contact']['id']:null,'ListId':_0x38dd60[_0x9133('0x20')]?_0x38dd60[_0x9133('0x20')]['id']:null};_0x57af5e[_['upperFirst'](_0x38dd60[_0x9133('0x21')])+_0x9133('0x22')]=_0x5e8620['id']||null;_0x57af5e[_[_0x9133('0x23')](_0x38dd60[_0x9133('0x21')])+'InteractionId']=_0x38dd60[_0x9133('0x24')]?_0x38dd60['interaction']['id']:null;_0x57af5e[_[_0x9133('0x23')](_0x38dd60[_0x9133('0x21')])+_0x9133('0x25')]=_0x38dd60[_0x9133('0x26')]?_0x38dd60[_0x9133('0x26')]['id']:null;_0x57af5e[_[_0x9133('0x23')](_0x38dd60[_0x9133('0x21')])+(_0x38dd60[_0x9133('0x21')]!==_0x9133('0x27')?_0x9133('0x28'):'WebsiteId')]=_0x38dd60['account']?_0x38dd60[_0x9133('0xc')]['id']:null;logger[_0x9133('0x29')](util[_0x9133('0x14')](_0x9133('0x2a'),_0x1d6d0b,_0x5e8620['name']));emitChannelQueueInteraction(_0x38dd60['channel'],_0x5e8620[_0x9133('0x2b')],_0x57af5e,_0x38dd60[_0x9133('0xc')][_0x9133('0x2b')],_0x38dd60[_0x9133('0x26')]['id'],!![],_0x4b940b,_0x5e8620['id']);if(rpc[_0x38dd60[_0x9133('0x21')]+_0x9133('0x2c')]){return rpc[_0x38dd60['channel']+'QueueReport']['create'](_0x57af5e)[_0x9133('0x2d')](function(_0x4a4a8e){logger[_0x9133('0x2e')](_0x9133('0x2f'));});}}}function stopRouting(_0x540c79,_0xc9c724,_0x5dd90b,_0xf0aec4){if(_0x540c79&&_0xc9c724){_0xc9c724[_0x9133('0x1e')]-=0x1;var _0x4020d1={'leaveAt':moment()['format'](_0x9133('0x30')),'acceptAt':moment()[_0x9133('0x14')](_0x9133('0x30')),'reason':'accepted'};logger[_0x9133('0x29')](util[_0x9133('0x14')](_0x9133('0x31'),_0x540c79,_0xc9c724['name']));emitChannelQueueInteraction(_0x5dd90b[_0x9133('0x21')],_0xc9c724[_0x9133('0x2b')],_0x5dd90b[_0x9133('0x1f')],_0x5dd90b[_0x9133('0xc')]['name'],_0x5dd90b[_0x9133('0x26')]['id'],![],_0xf0aec4,_0xc9c724['id']);if(rpc[_0x5dd90b[_0x9133('0x21')]+'QueueReport']){return rpc[_0x5dd90b[_0x9133('0x21')]+_0x9133('0x2c')][_0x9133('0x32')](_0x540c79,_0x4020d1)[_0x9133('0x2d')](function(_0x19d555){logger[_0x9133('0x2e')](_0x9133('0x33'));});}}}function endRouting(_0x167e45,_0x4172e3,_0x335217,_0x40d92f){if(_0x167e45&&_0x4172e3){_0x4172e3['waiting']-=0x1;var _0x17bb4c={'leaveAt':moment()[_0x9133('0x14')]('YYYY-MM-DD\x20HH:mm:ss'),'exitAt':moment()[_0x9133('0x14')](_0x9133('0x30')),'reason':_0x9133('0x34')};logger[_0x9133('0x29')](util[_0x9133('0x14')](_0x9133('0x35'),_0x167e45,_0x4172e3['name']));emitChannelQueueInteraction(_0x335217['channel'],_0x4172e3[_0x9133('0x2b')],_0x335217[_0x9133('0x1f')],_0x335217[_0x9133('0xc')][_0x9133('0x2b')],_0x335217[_0x9133('0x26')]['id'],![],_0x40d92f);if(rpc[_0x335217[_0x9133('0x21')]+_0x9133('0x2c')]){return rpc[_0x335217[_0x9133('0x21')]+_0x9133('0x2c')]['update'](_0x167e45,_0x17bb4c)[_0x9133('0x2d')](function(_0x2daef9){logger[_0x9133('0x2e')](_0x9133('0x33'));});}}}function handleFindQueue(_0x3df6ca){return function(_0x4c045e){return _0x4c045e[_0x9133('0x2b')][_0x9133('0x36')]()===_0x3df6ca[_0x9133('0x36')]();};}exports[_0x9133('0x37')]=function(_0x592267,_0x146734,_0x1293f1,_0x1f1849){return function(_0x202b94){try{var _0x1dd475={'name':_0x146734[0x0],'timeout':_0x146734[0x1]};var _0x338049=queue[_0x9133('0x38')](_0x1dd475,{'typecast':!![]});if(_0x338049['length']){logger[_0x9133('0x2e')]('[%s][QUEUE]\x20%s',_0x592267,_['map'](_0x338049,_0x9133('0x26'))[_0x9133('0x39')](',\x20'));_0x202b94[_0x9133('0x3a')]();}else{var _0x264df4=_[_0x9133('0x3b')](_0x1293f1[_0x1f1849[_0x9133('0x21')]+_0x9133('0x3c')],handleFindQueue(_0x1dd475[_0x9133('0x2b')]));if(_0x264df4){startRouting(_0x592267,_0x264df4,_0x1f1849,_0x1293f1);var _0x207566=(_0x264df4['timeout']||0xa)*0x3e8;var _0x1db641=(_0x1dd475[_0x9133('0x34')]||0x14)*0x3e8;var _0x2928bd,_0x597434;if(_0x207566>_0x1db641){_0x1db641=_0x207566;}var _0x49d3fe=seqqueue[_0x9133('0x3d')](_0x207566);_0x49d3fe['id']=_0x592267;_0x49d3fe[_0x9133('0x3e')]=_0x207566;_0x49d3fe['qtimeout']=_0x1db641;_0x49d3fe[_0x9133('0x21')]=_0x1f1849[_0x9133('0x21')];_0x1293f1[_0x9133('0x3f')][_0x592267]['on'](_0x9133('0x40'),function(){logger[_0x9133('0x29')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x592267);stopRouting(_0x592267,_0x264df4,_0x1f1849,_0x1293f1);clearTimeout(_0x2928bd);_0x2928bd=undefined;_0x49d3fe[_0x9133('0x41')](!![]);if(_0x1293f1[_0x9133('0x3f')][_0x592267]){delete _0x1293f1[_0x9133('0x3f')][_0x592267];}_0x202b94['stop']();});_0x1293f1[_0x9133('0x3f')][_0x592267]['on'](_0x9133('0x42'),function(){if(_0x1293f1['rules'][_0x592267]){delete _0x1293f1['rules'][_0x592267];}});_0x2928bd=setTimeout(function(){logger[_0x9133('0x29')](_0x9133('0x43'),_0x592267);endRouting(_0x592267,_0x264df4,_0x1f1849,_0x1293f1);clearTimeout(_0x2928bd);_0x49d3fe[_0x9133('0x41')](!![]);_0x202b94[_0x9133('0x44')]();},_0x1db641);switch(_0x264df4[_0x9133('0x45')]){case _0x9133('0x46'):strategy[_0x9133('0x46')](_0x49d3fe,_0x264df4,_0x1293f1,_0x1f1849);break;default:strategy[_0x9133('0x47')](_0x49d3fe,_0x264df4,_0x1293f1,_0x1f1849);}}else{logger[_0x9133('0x2e')](_0x9133('0x48'),_0x592267,_0x1dd475[_0x9133('0x2b')]);_0x202b94[_0x9133('0x3a')]();}}}catch(_0x4f3092){console['log'](_0x4f3092);logger[_0x9133('0x2e')]('[%s][QUEUE]\x20%s',_0x592267,_0x4f3092[_0x9133('0x49')]);_0x202b94[_0x9133('0x3a')]();}};}; \ No newline at end of file +var _0x878f=['interaction','MessageId','message','chat','AccountId','WebsiteId','info','[%s][START:QUEUE][NAME:%s]','name','create','create\x20queue\x20report','waiting','accepted','[%s][STOP:QUEUE][NAME:%s]','QueueReport','catch','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','update','toLowerCase','validate','length','error','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','createQueue','qtimeout','rules','[%s][QUEUE]\x20ROUTING\x20STOPPED','close','[%s][QUEUE]\x20APPLICATION\x20END','next','strategy','rrmemory','beepall','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','stack','lodash','util','seq-queue','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','defaults','socket.io-emitter','from','emit','queue_id','queue','account','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport','../../rpc/smsQueueReport','../../rpc/faxQueueReport','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','timeout\x20is\x20a\x20number','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','QueueId'];(function(_0x1593a7,_0x2b7304){var _0x1aaa80=function(_0x14cb95){while(--_0x14cb95){_0x1593a7['push'](_0x1593a7['shift']());}};_0x1aaa80(++_0x2b7304);}(_0x878f,0x173));var _0xf878=function(_0x15cb5b,_0x4e5a44){_0x15cb5b=_0x15cb5b-0x0;var _0x14011d=_0x878f[_0x15cb5b];return _0x14011d;};'use strict';var schema=require('validate');var _=require(_0xf878('0x0'));var util=require(_0xf878('0x1'));var seqqueue=require(_0xf878('0x2'));var moment=require(_0xf878('0x3'));var Redis=require(_0xf878('0x4'));var config=require(_0xf878('0x5'));var logger=require(_0xf878('0x6'))(_0xf878('0x7'));var strategy=require(_0xf878('0x8'));config[_0xf878('0x9')]=_[_0xf878('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0xf878('0xb'))(new Redis(config[_0xf878('0x9')]));var attributes=['id','queue_id','account','queue',_0xf878('0xc'),'joinAt'];function emit(_0x4a9d79,_0x307653,_0x2e6931){io['to'](_0x4a9d79)[_0xf878('0xd')](_0x307653,_0x2e6931);}function emitChannelQueueInteraction(_0x52edde,_0xb2863e,_0x1399a3,_0x531b9c,_0xdf76,_0x4f7e7f,_0x31d3d2,_0x97c396){var _0x339c9c=_['clone'](_0x1399a3);_0x339c9c[_0xf878('0xe')]=_0x97c396;_0x339c9c[_0xf878('0xf')]=_0xb2863e;_0x339c9c[_0xf878('0x10')]=_0x531b9c;_0x339c9c['id']=_0xdf76;if(_0x4f7e7f){_0x31d3d2[util['format'](_0xf878('0x11'),_0x52edde)][_0xdf76]=_[_0xf878('0x12')](_0x339c9c,attributes);}else{delete _0x31d3d2[util[_0xf878('0x13')]('%sQueuesWaitingInteractions',_0x52edde)][_0xdf76];}emit(util['format'](_0xf878('0x14'),_0x52edde,_0xb2863e),util[_0xf878('0x13')](_0xf878('0x15'),_0x52edde,_0x4f7e7f?_0xf878('0x16'):_0xf878('0x17')),_[_0xf878('0x12')](_0x339c9c,attributes));}var rpc={'openchannelQueueReport':require(_0xf878('0x18')),'mailQueueReport':require(_0xf878('0x19')),'chatQueueReport':require(_0xf878('0x1a')),'smsQueueReport':require(_0xf878('0x1b')),'faxQueueReport':require(_0xf878('0x1c'))};var queue=schema({'name':{'type':'string','required':!![],'message':_0xf878('0x1d')},'timeout':{'type':_0xf878('0x1e'),'message':_0xf878('0x1f')}});function startRouting(_0x622ea8,_0x3714f6,_0x237d15,_0x17089c){if(_0x622ea8&&_0x3714f6&&_0x237d15){_0x3714f6['waiting']+=0x1;var _0x73f6bf={'uniqueid':_0x622ea8,'from':_0x237d15[_0xf878('0x20')]?_0x237d15[_0xf878('0x20')]['from']:'','joinAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'ContactId':_0x237d15[_0xf878('0x22')]?_0x237d15[_0xf878('0x22')]['id']:null,'ListId':_0x237d15[_0xf878('0x23')]?_0x237d15[_0xf878('0x23')]['id']:null};_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+_0xf878('0x26')]=_0x3714f6['id']||null;_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+'InteractionId']=_0x237d15[_0xf878('0x27')]?_0x237d15['interaction']['id']:null;_0x73f6bf[_[_0xf878('0x24')](_0x237d15[_0xf878('0x25')])+_0xf878('0x28')]=_0x237d15[_0xf878('0x29')]?_0x237d15[_0xf878('0x29')]['id']:null;_0x73f6bf[_['upperFirst'](_0x237d15['channel'])+(_0x237d15['channel']!==_0xf878('0x2a')?_0xf878('0x2b'):_0xf878('0x2c'))]=_0x237d15['account']?_0x237d15[_0xf878('0x10')]['id']:null;logger[_0xf878('0x2d')](util[_0xf878('0x13')](_0xf878('0x2e'),_0x622ea8,_0x3714f6[_0xf878('0x2f')]));emitChannelQueueInteraction(_0x237d15['channel'],_0x3714f6['name'],_0x73f6bf,_0x237d15[_0xf878('0x10')][_0xf878('0x2f')],_0x237d15['message']['id'],!![],_0x17089c,_0x3714f6['id']);if(rpc[_0x237d15[_0xf878('0x25')]+'QueueReport']){return rpc[_0x237d15[_0xf878('0x25')]+'QueueReport'][_0xf878('0x30')](_0x73f6bf)['catch'](function(_0x2630fb){logger['error'](_0xf878('0x31'));});}}}function stopRouting(_0x2cadd3,_0x233a00,_0x1f5331,_0x27c53b){if(_0x2cadd3&&_0x233a00){_0x233a00[_0xf878('0x32')]-=0x1;var _0x5aed48={'leaveAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'acceptAt':moment()[_0xf878('0x13')](_0xf878('0x21')),'reason':_0xf878('0x33')};logger['info'](util[_0xf878('0x13')](_0xf878('0x34'),_0x2cadd3,_0x233a00['name']));emitChannelQueueInteraction(_0x1f5331[_0xf878('0x25')],_0x233a00[_0xf878('0x2f')],_0x1f5331[_0xf878('0x20')],_0x1f5331[_0xf878('0x10')][_0xf878('0x2f')],_0x1f5331['message']['id'],![],_0x27c53b,_0x233a00['id']);if(rpc[_0x1f5331[_0xf878('0x25')]+_0xf878('0x35')]){return rpc[_0x1f5331[_0xf878('0x25')]+_0xf878('0x35')]['update'](_0x2cadd3,_0x5aed48)[_0xf878('0x36')](function(_0x5a6330){logger['error'](_0xf878('0x37'));});}}}function endRouting(_0x2c628e,_0x8b6230,_0x105416,_0x20f415){if(_0x2c628e&&_0x8b6230){_0x8b6230['waiting']-=0x1;var _0xc2d7ef={'leaveAt':moment()['format'](_0xf878('0x21')),'exitAt':moment()[_0xf878('0x13')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0xf878('0x38')};logger[_0xf878('0x2d')](util['format'](_0xf878('0x39'),_0x2c628e,_0x8b6230[_0xf878('0x2f')]));emitChannelQueueInteraction(_0x105416['channel'],_0x8b6230[_0xf878('0x2f')],_0x105416[_0xf878('0x20')],_0x105416[_0xf878('0x10')][_0xf878('0x2f')],_0x105416[_0xf878('0x29')]['id'],![],_0x20f415);if(rpc[_0x105416[_0xf878('0x25')]+_0xf878('0x35')]){return rpc[_0x105416['channel']+_0xf878('0x35')][_0xf878('0x3a')](_0x2c628e,_0xc2d7ef)['catch'](function(_0x226e8b){logger['error']('update\x20queue\x20report');});}}}function handleFindQueue(_0x2ec109){return function(_0x379fc1){return _0x379fc1[_0xf878('0x2f')][_0xf878('0x3b')]()===_0x2ec109[_0xf878('0x3b')]();};}exports['consequence']=function(_0x3629c3,_0x4c4ae4,_0xb09736,_0x2801b0){return function(_0x4f6be1){try{var _0x5517c9={'name':_0x4c4ae4[0x0],'timeout':_0x4c4ae4[0x1]};var _0x180594=queue[_0xf878('0x3c')](_0x5517c9,{'typecast':!![]});if(_0x180594[_0xf878('0x3d')]){logger[_0xf878('0x3e')](_0xf878('0x3f'),_0x3629c3,_[_0xf878('0x40')](_0x180594,_0xf878('0x29'))[_0xf878('0x41')](',\x20'));_0x4f6be1[_0xf878('0x42')]();}else{var _0x5444eb=_[_0xf878('0x43')](_0xb09736[_0x2801b0[_0xf878('0x25')]+_0xf878('0x44')],handleFindQueue(_0x5517c9[_0xf878('0x2f')]));if(_0x5444eb){startRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);var _0x3714a6=(_0x5444eb[_0xf878('0x38')]||0xa)*0x3e8;var _0x47dbfa=(_0x5517c9[_0xf878('0x38')]||0x14)*0x3e8;var _0xf055ce,_0x1f57d0;if(_0x3714a6>_0x47dbfa){_0x47dbfa=_0x3714a6;}var _0xc49e70=seqqueue[_0xf878('0x45')](_0x3714a6);_0xc49e70['id']=_0x3629c3;_0xc49e70['atimeout']=_0x3714a6;_0xc49e70[_0xf878('0x46')]=_0x47dbfa;_0xc49e70[_0xf878('0x25')]=_0x2801b0[_0xf878('0x25')];_0xb09736[_0xf878('0x47')][_0x3629c3]['on']('end',function(){logger[_0xf878('0x2d')](_0xf878('0x48'),_0x3629c3);stopRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);clearTimeout(_0xf055ce);_0xf055ce=undefined;_0xc49e70[_0xf878('0x49')](!![]);if(_0xb09736['rules'][_0x3629c3]){delete _0xb09736['rules'][_0x3629c3];}_0x4f6be1[_0xf878('0x42')]();});_0xb09736['rules'][_0x3629c3]['on']('complete',function(){if(_0xb09736['rules'][_0x3629c3]){delete _0xb09736[_0xf878('0x47')][_0x3629c3];}});_0xf055ce=setTimeout(function(){logger['info'](_0xf878('0x4a'),_0x3629c3);endRouting(_0x3629c3,_0x5444eb,_0x2801b0,_0xb09736);clearTimeout(_0xf055ce);_0xc49e70[_0xf878('0x49')](!![]);_0x4f6be1[_0xf878('0x4b')]();},_0x47dbfa);switch(_0x5444eb[_0xf878('0x4c')]){case _0xf878('0x4d'):strategy[_0xf878('0x4d')](_0xc49e70,_0x5444eb,_0xb09736,_0x2801b0);break;default:strategy[_0xf878('0x4e')](_0xc49e70,_0x5444eb,_0xb09736,_0x2801b0);}}else{logger['error'](_0xf878('0x4f'),_0x3629c3,_0x5517c9[_0xf878('0x2f')]);_0x4f6be1[_0xf878('0x42')]();}}}catch(_0x227dd7){console[_0xf878('0x50')](_0x227dd7);logger['error']('[%s][QUEUE]\x20%s',_0x3629c3,_0x227dd7[_0xf878('0x51')]);_0x4f6be1[_0xf878('0x42')]();}};}; \ 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 831b1bb..28975c7 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 _0xde8a=['notificationId','squeue','agent','realtime','push','handleRun','bind','timeout','handleTimeout','handleDrained','prototype','info','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','isNil','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','STOP','TIMEOUT','lodash','uuid','./util','routing'];(function(_0x17ce75,_0x83aaf8){var _0x38c012=function(_0x4a6c59){while(--_0x4a6c59){_0x17ce75['push'](_0x17ce75['shift']());}};_0x38c012(++_0x83aaf8);}(_0xde8a,0x13c));var _0xade8=function(_0x11c5ce,_0x36fd99){_0x11c5ce=_0x11c5ce-0x0;var _0x5e256d=_0xde8a[_0x11c5ce];return _0x5e256d;};'use strict';var _=require(_0xade8('0x0'));var uuid=require(_0xade8('0x1'));var util=require(_0xade8('0x2'));var logger=require('../../../../../config/logger')(_0xade8('0x3'));var Agent=function(_0x27813a,_0x56dff7,_0x20b4a1,_0x513fa4){this[_0xade8('0x4')]=uuid['v4']();this[_0xade8('0x5')]=_0x27813a;this[_0xade8('0x6')]=_0x56dff7;this[_0xade8('0x7')]=_0x20b4a1;this['routing']=_0x513fa4;this[_0xade8('0x5')][_0xade8('0x8')](this[_0xade8('0x9')][_0xade8('0xa')](this),this['handleTimeout'][_0xade8('0xa')](this));this[_0xade8('0x5')]['on'](_0xade8('0xb'),this[_0xade8('0xc')][_0xade8('0xa')](this));this['squeue']['on']('drained',this[_0xade8('0xd')][_0xade8('0xa')](this));};Agent[_0xade8('0xe')][_0xade8('0x8')]=function(){this['squeue'][_0xade8('0x8')](this[_0xade8('0x9')]['bind'](this),this[_0xade8('0xc')]['bind'](this));};Agent['prototype'][_0xade8('0xd')]=function(){this[_0xade8('0xc')](!![]);};Agent[_0xade8('0xe')][_0xade8('0x9')]=function(_0x12f0fa){logger[_0xade8('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0xade8('0x5')]['id'],this[_0xade8('0x6')]['id']);if(_['isNil'](this[_0xade8('0x7')][_0xade8('0x10')][this['agent']['id']])){logger[_0xade8('0xf')](_0xade8('0x11'),this[_0xade8('0x5')]['id'],this['agent']['id']);setTimeout(this[_0xade8('0x8')][_0xade8('0xa')](this),0x3e8);}else{if(this['routing'][_0xade8('0x12')]||util[_0xade8('0x13')](this[_0xade8('0x5')]['id'],this[_0xade8('0x7')]['agents'][this['agent']['id']],this[_0xade8('0x5')][_0xade8('0x14')],![])){this[_0xade8('0x7')][_0xade8('0x10')][this['agent']['id']][_0xade8('0x15')]=!![];this[_0xade8('0x7')]['agents'][this[_0xade8('0x6')]['id']][_0xade8('0x16')]=undefined;util[_0xade8('0x17')](this['notificationId'],this[_0xade8('0x5')]['id'],this[_0xade8('0x7')][_0xade8('0x10')][this[_0xade8('0x6')]['id']],null,this['routing']);util[_0xade8('0x18')](this[_0xade8('0x5')]['id'],this[_0xade8('0x7')][_0xade8('0x10')][this['agent']['id']],_0xade8('0x19')+(this[_0xade8('0x3')][_0xade8('0x12')]?':FORCED':''));}else{logger[_0xade8('0xf')](_0xade8('0x1a'),this[_0xade8('0x5')]['id'],this[_0xade8('0x6')]['id']);setTimeout(this['push'][_0xade8('0xa')](this),0x3e8);}}};Agent['prototype'][_0xade8('0xc')]=function(_0x257868){if(_[_0xade8('0x1b')](this['realtime'][_0xade8('0x10')][this[_0xade8('0x6')]['id']])){return logger[_0xade8('0xf')](_0xade8('0x11'),this[_0xade8('0x5')]['id'],this[_0xade8('0x6')]['id']);}else{logger[_0xade8('0xf')](_0xade8('0x1c'),this[_0xade8('0x5')]['id'],this['agent']['id']);util[_0xade8('0x1d')](this['notificationId'],this[_0xade8('0x5')]['id'],this[_0xade8('0x7')][_0xade8('0x10')][this[_0xade8('0x6')]['id']],null,this['routing']);this[_0xade8('0x7')][_0xade8('0x10')][this[_0xade8('0x6')]['id']]['busy']=![];this[_0xade8('0x7')][_0xade8('0x10')][this[_0xade8('0x6')]['id']]['busyQueue']=undefined;util[_0xade8('0x18')](this['squeue']['id'],this[_0xade8('0x7')][_0xade8('0x10')][this['agent']['id']],_0x257868?_0xade8('0x1e'):_0xade8('0x1f'));}if(!_0x257868){setTimeout(this[_0xade8('0x8')]['bind'](this),0x3e8);}};function agent(_0x3eac5b,_0x4a9c92,_0x54c777,_0x307d13){return new Agent(_0x3eac5b,_0x4a9c92,_0x54c777,_0x307d13);}module['exports']=agent; \ No newline at end of file +var _0xfcbf=['forcedOwnership','isAgentAvailable','channel','busy','busyQueue','showNotification','writeLog','RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','hideNotification','STOP','TIMEOUT','exports','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','push','handleRun','handleTimeout','bind','timeout','drained','prototype','handleDrained','info','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s'];(function(_0x4d70df,_0x2ef178){var _0xc0d57c=function(_0x1ab8cd){while(--_0x1ab8cd){_0x4d70df['push'](_0x4d70df['shift']());}};_0xc0d57c(++_0x2ef178);}(_0xfcbf,0x158));var _0xffcb=function(_0x355b08,_0x35d0b8){_0x355b08=_0x355b08-0x0;var _0x88ceeb=_0xfcbf[_0x355b08];return _0x88ceeb;};'use strict';var _=require('lodash');var uuid=require('uuid');var util=require(_0xffcb('0x0'));var logger=require(_0xffcb('0x1'))(_0xffcb('0x2'));var Agent=function(_0x474921,_0x4d7f78,_0xae55aa,_0x24e617){this[_0xffcb('0x3')]=uuid['v4']();this[_0xffcb('0x4')]=_0x474921;this[_0xffcb('0x5')]=_0x4d7f78;this[_0xffcb('0x6')]=_0xae55aa;this[_0xffcb('0x2')]=_0x24e617;this[_0xffcb('0x4')][_0xffcb('0x7')](this[_0xffcb('0x8')]['bind'](this),this[_0xffcb('0x9')][_0xffcb('0xa')](this));this[_0xffcb('0x4')]['on'](_0xffcb('0xb'),this[_0xffcb('0x9')][_0xffcb('0xa')](this));this[_0xffcb('0x4')]['on'](_0xffcb('0xc'),this['handleDrained'][_0xffcb('0xa')](this));};Agent['prototype'][_0xffcb('0x7')]=function(){this[_0xffcb('0x4')][_0xffcb('0x7')](this[_0xffcb('0x8')][_0xffcb('0xa')](this),this[_0xffcb('0x9')][_0xffcb('0xa')](this));};Agent[_0xffcb('0xd')][_0xffcb('0xe')]=function(){this['handleTimeout'](!![]);};Agent[_0xffcb('0xd')]['handleRun']=function(_0x103ef0){logger[_0xffcb('0xf')]('[%s][AGENT]\x20try\x20with\x20%s',this['squeue']['id'],this['agent']['id']);if(_[_0xffcb('0x10')](this[_0xffcb('0x6')][_0xffcb('0x11')][this[_0xffcb('0x5')]['id']])){logger[_0xffcb('0xf')](_0xffcb('0x12'),this[_0xffcb('0x4')]['id'],this[_0xffcb('0x5')]['id']);setTimeout(this['push'][_0xffcb('0xa')](this),0x3e8);}else{if(this[_0xffcb('0x2')][_0xffcb('0x13')]||util[_0xffcb('0x14')](this['squeue']['id'],this[_0xffcb('0x6')]['agents'][this[_0xffcb('0x5')]['id']],this['squeue'][_0xffcb('0x15')],![])){this[_0xffcb('0x6')][_0xffcb('0x11')][this[_0xffcb('0x5')]['id']][_0xffcb('0x16')]=!![];this['realtime'][_0xffcb('0x11')][this[_0xffcb('0x5')]['id']][_0xffcb('0x17')]=undefined;util[_0xffcb('0x18')](this['notificationId'],this[_0xffcb('0x4')]['id'],this[_0xffcb('0x6')]['agents'][this[_0xffcb('0x5')]['id']],null,this[_0xffcb('0x2')]);util[_0xffcb('0x19')](this['squeue']['id'],this['realtime'][_0xffcb('0x11')][this[_0xffcb('0x5')]['id']],_0xffcb('0x1a')+(this[_0xffcb('0x2')][_0xffcb('0x13')]?_0xffcb('0x1b'):''));}else{logger[_0xffcb('0xf')](_0xffcb('0x1c'),this[_0xffcb('0x4')]['id'],this['agent']['id']);setTimeout(this[_0xffcb('0x7')]['bind'](this),0x3e8);}}};Agent[_0xffcb('0xd')]['handleTimeout']=function(_0x45ebd4){if(_[_0xffcb('0x10')](this[_0xffcb('0x6')][_0xffcb('0x11')][this['agent']['id']])){return logger[_0xffcb('0xf')](_0xffcb('0x12'),this[_0xffcb('0x4')]['id'],this[_0xffcb('0x5')]['id']);}else{logger[_0xffcb('0xf')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0xffcb('0x4')]['id'],this[_0xffcb('0x5')]['id']);util[_0xffcb('0x1d')](this[_0xffcb('0x3')],this['squeue']['id'],this[_0xffcb('0x6')][_0xffcb('0x11')][this['agent']['id']],null,this['routing']);this[_0xffcb('0x6')][_0xffcb('0x11')][this['agent']['id']][_0xffcb('0x16')]=![];this[_0xffcb('0x6')][_0xffcb('0x11')][this['agent']['id']][_0xffcb('0x17')]=undefined;util[_0xffcb('0x19')](this[_0xffcb('0x4')]['id'],this[_0xffcb('0x6')][_0xffcb('0x11')][this['agent']['id']],_0x45ebd4?_0xffcb('0x1e'):_0xffcb('0x1f'));}if(!_0x45ebd4){setTimeout(this['push'][_0xffcb('0xa')](this),0x3e8);}};function agent(_0x3ca02d,_0x321f61,_0x9265e7,_0x54302a){return new Agent(_0x3ca02d,_0x321f61,_0x9265e7,_0x54302a);}module[_0xffcb('0x20')]=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 7331f5b..bd169ba 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 _0x9246=['lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','queue','realtime','push','handleRun','bind','handleTimeout','timeout','handleDrained','prototype','isNil','Agents','length','info','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','agents','writeLog','RINGING','busyQueue','name','[%s][QUEUE]\x20EMPTY','hideNotification','STOP','TIMEOUT','busy','exports'];(function(_0x58999b,_0xea4695){var _0x5efc3a=function(_0x98de31){while(--_0x98de31){_0x58999b['push'](_0x58999b['shift']());}};_0x5efc3a(++_0xea4695);}(_0x9246,0xa5));var _0x6924=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0x9246[_0x1a72f3];return _0x57ef47;};'use strict';var _=require(_0x6924('0x0'));var uuid=require(_0x6924('0x1'));var util=require(_0x6924('0x2'));var logger=require(_0x6924('0x3'))(_0x6924('0x4'));var Beepall=function(_0x4258eb,_0x35ff7a,_0x5372e1,_0x2a27e3){this[_0x6924('0x5')]=uuid['v4']();this[_0x6924('0x6')]=_0x4258eb;this[_0x6924('0x7')]=_0x35ff7a;this[_0x6924('0x8')]=_0x5372e1;this[_0x6924('0x4')]=_0x2a27e3;this['squeue'][_0x6924('0x9')](this[_0x6924('0xa')][_0x6924('0xb')](this),this[_0x6924('0xc')][_0x6924('0xb')](this));this[_0x6924('0x6')]['on'](_0x6924('0xd'),this[_0x6924('0xc')][_0x6924('0xb')](this));this[_0x6924('0x6')]['on']('drained',this[_0x6924('0xe')][_0x6924('0xb')](this));};Beepall[_0x6924('0xf')][_0x6924('0x9')]=function(){this[_0x6924('0x6')]['push'](this['handleRun'][_0x6924('0xb')](this),this[_0x6924('0xc')][_0x6924('0xb')](this));};Beepall[_0x6924('0xf')][_0x6924('0xe')]=function(_0x31bb1d){this[_0x6924('0xc')](!![]);};Beepall[_0x6924('0xf')]['handleRun']=function(_0x1d38f5){var _0x17a73a=!![];if(!_[_0x6924('0x10')](this[_0x6924('0x7')])&&!_[_0x6924('0x10')](this[_0x6924('0x7')]['Agents'])&&this[_0x6924('0x7')][_0x6924('0x11')][_0x6924('0x12')]>0x0){for(var _0x2da2dd=0x0,_0x48653e;_0x2da2dd0x0){for(var _0x150147=0x0,_0x5cb0b9;_0x1501470x0&&_0x1f2b1a[_0x591609+_0x9978('0x21')]>=_0x1f2b1a[_0x591609+'Capacity']){writeLog(_0x228de5,_0x1f2b1a,_0x591609[_0x9978('0x23')]()+_0x9978('0x24'));return![];}}return!![];};exports[_0x9978('0x25')]=function(_0x3282dc,_0x4df64e,_0x5eaa32,_0x57cedf,_0x1feaf1){return sendNotification(!![],_0x3282dc,_0x4df64e,_0x5eaa32,_0x57cedf,_0x1feaf1);};exports[_0x9978('0x26')]=function(_0x69183f,_0x134fd3,_0x1c5af5,_0xbda0fc,_0x8b6206){return sendNotification(![],_0x69183f,_0x134fd3,_0x1c5af5,_0xbda0fc,_0x8b6206);};exports[_0x9978('0x27')]=writeLog; \ No newline at end of file +var _0x2b81=['BUSY','online','OFFLINE','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','lodash','util','../utils','mustache','ioredis','../../../../../config/environment','../../../../../config/logger','routing','redis','defaults','localhost','format','user:%s','emit','split','name','account','notificationSound','notificationShake','body','queue','getMustacheRender','notificationTemplate','msg','I\x20can\x27t\x20render\x20your\x20template','error','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','isAgentAvailable'];(function(_0x446322,_0xe6e3){var _0x17d972=function(_0x527b57){while(--_0x527b57){_0x446322['push'](_0x446322['shift']());}};_0x17d972(++_0xe6e3);}(_0x2b81,0x1ef));var _0x12b8=function(_0x152aa1,_0x307718){_0x152aa1=_0x152aa1-0x0;var _0x1bc01a=_0x2b81[_0x152aa1];return _0x1bc01a;};'use strict';var _=require(_0x12b8('0x0'));var util=require(_0x12b8('0x1'));var utils=require(_0x12b8('0x2'));var Mustache=require(_0x12b8('0x3'));var Redis=require(_0x12b8('0x4'));var config=require(_0x12b8('0x5'));var logger=require(_0x12b8('0x6'))(_0x12b8('0x7'));config[_0x12b8('0x8')]=_[_0x12b8('0x9')](config['redis'],{'host':_0x12b8('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x12b8('0x8')]));function emit(_0x29eb3d,_0x3f9216,_0x119d5b){io['to'](_0x29eb3d)['emit'](_0x3f9216,_0x119d5b);}function sendNotification(_0x3e8473,_0x12f442,_0x3727c3,_0x6010df,_0x2d236a,_0x18fedb){io['to'](util[_0x12b8('0xb')](_0x12b8('0xc'),_0x6010df['name']))[_0x12b8('0xd')]('user:save',_0x6010df);var _0x5d2a1d=_0x18fedb||{};var _0x4451fa=_0x3727c3[_0x12b8('0xe')]('.');var _0xca9f1b={'uniqueid':_0x12f442,'channel':_0x4451fa[0x0],'id':_0x4451fa[0x1],'title':_0x4451fa[0x0]+'\x20interaction','interactionId':_0x4451fa[0x2],'queue':_0x2d236a?_0x2d236a[_0x12b8('0xf')]:null,'sound':_0x5d2a1d[_0x12b8('0x10')][_0x12b8('0x11')],'shake':_0x5d2a1d[_0x12b8('0x10')][_0x12b8('0x12')]};try{if(!_0x5d2a1d[_0x12b8('0x13')]){_0x5d2a1d[_0x12b8('0x13')]={};}if(_0x2d236a){_0x5d2a1d['body']['queue']=_0x2d236a;}else if(_0x5d2a1d[_0x12b8('0x13')][_0x12b8('0x14')]){delete _0x5d2a1d[_0x12b8('0x13')]['queue'];}_0xca9f1b['msg']=utils[_0x12b8('0x15')](_0x5d2a1d[_0x12b8('0x10')][_0x12b8('0x16')],_0x5d2a1d);}catch(_0x130b49){_0xca9f1b[_0x12b8('0x17')]=_0x12b8('0x18');logger[_0x12b8('0x19')](util[_0x12b8('0xb')](_0x12b8('0x1a'),_0x12f442,_0x130b49[_0x12b8('0x1b')]));}io['to'](util['format']('user:%s',_0x6010df[_0x12b8('0xf')]))[_0x12b8('0xd')](util[_0x12b8('0xb')](_0x12b8('0x1c'),_0x3e8473?_0x12b8('0x1d'):_0x12b8('0x1e')),_0xca9f1b);}function writeLog(_0x514ef6,_0x3b38b4,_0x4d2769){return logger['info'](util[_0x12b8('0xb')](_0x12b8('0x1f'),_0x514ef6,_0x3b38b4['name'],_0x4d2769));}exports[_0x12b8('0x20')]=function(_0x437f4b,_0x1cd4aa,_0x4443d0,_0x323bdc){if(_0x1cd4aa['busy']){writeLog(_0x437f4b,_0x1cd4aa,_0x12b8('0x21'));return![];}if(!_0x1cd4aa[_0x12b8('0x22')]){writeLog(_0x437f4b,_0x1cd4aa,_0x12b8('0x23'));return![];}if(_0x1cd4aa[_0x4443d0+'Pause']){writeLog(_0x437f4b,_0x1cd4aa,_0x12b8('0x24'));return![];}if(_0x323bdc&&_0x1cd4aa[_0x12b8('0x25')](_0x4443d0+_0x12b8('0x26'))&&_0x1cd4aa[_0x12b8('0x25')](_0x4443d0+'CurrentCapacity')){if(_0x1cd4aa[_0x4443d0+_0x12b8('0x26')]>0x0&&_0x1cd4aa[_0x4443d0+_0x12b8('0x27')]>=_0x1cd4aa[_0x4443d0+_0x12b8('0x26')]){writeLog(_0x437f4b,_0x1cd4aa,_0x4443d0[_0x12b8('0x28')]()+_0x12b8('0x29'));return![];}}return!![];};exports[_0x12b8('0x2a')]=function(_0x2015a2,_0x48ce8f,_0x1208bd,_0x2c1c38,_0x54aba3){return sendNotification(!![],_0x2015a2,_0x48ce8f,_0x1208bd,_0x2c1c38,_0x54aba3);};exports[_0x12b8('0x2b')]=function(_0x1ec4d5,_0x35b756,_0x19abbd,_0x2dcd84,_0x43888e){return sendNotification(![],_0x1ec4d5,_0x35b756,_0x19abbd,_0x2dcd84,_0x43888e);};exports['writeLog']=writeLog; \ No newline at end of file diff --git a/server/services/routing/server/applications/system.js b/server/services/routing/server/applications/system.js index dcd1905..4f78d79 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 _0xe441=['validate','./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','error','[%s][SYSTEM]\x20%s','map','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isEmpty','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','isObject','stringify'];(function(_0x57bd30,_0x3bd13f){var _0x3253c7=function(_0x2436cf){while(--_0x2436cf){_0x57bd30['push'](_0x57bd30['shift']());}};_0x3253c7(++_0x3bd13f);}(_0xe441,0x1d4));var _0x1e44=function(_0x3f6222,_0x52c372){_0x3f6222=_0x3f6222-0x0;var _0x3912a6=_0xe441[_0x3f6222];return _0x3912a6;};'use strict';var schema=require(_0x1e44('0x0'));var sh=require('shelljs');var _=require('lodash');var utils=require(_0x1e44('0x1'));var logger=require(_0x1e44('0x2'))(_0x1e44('0x3'));var system=schema({'command':{'type':_0x1e44('0x4'),'required':!![],'message':_0x1e44('0x5')}});exports[_0x1e44('0x6')]=function(_0x3638c7,_0x1c5f93){return function(_0x5dba01){try{var _0x7d9b3={'command':_0x1c5f93[0x0]};var _0x26cbbb=system['validate'](_0x7d9b3,{'typecast':!![]});if(_0x26cbbb[_0x1e44('0x7')]){logger[_0x1e44('0x8')](_0x1e44('0x9'),_0x3638c7,_[_0x1e44('0xa')](_0x26cbbb,_0x1e44('0xb'))[_0x1e44('0xc')](',\x20'));logger[_0x1e44('0xd')](_0x1e44('0xe'),_0x3638c7);_0x5dba01[_0x1e44('0xf')]();}else{var _0x517e4c=this;var _0x352cc1=utils[_0x1e44('0x10')](_0x1c5f93[0x0],this);logger['info'](_0x1e44('0x11'),_0x3638c7,_0x352cc1);sh['exec'](_[_0x1e44('0x12')](_0x352cc1),function(_0x1c7d1a,_0x1baaef){logger[_0x1e44('0xd')](_0x1e44('0x13'),_0x3638c7,_0x1c7d1a);if(_0x1c7d1a==0x0){var _0x129f92=_0x1baaef['replace'](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x1c5f93[0x1])||_[_0x1e44('0x14')](_0x1c5f93[0x1])){logger['info'](_0x1e44('0x15'),_0x3638c7);_0x517e4c[_0x1e44('0x16')][_0x1c5f93[0x1]]=_0x129f92;}else{logger['info'](_0x1e44('0x17'),_0x3638c7,_0x1c5f93[0x1],_0x129f92);_0x517e4c[_0x1e44('0x16')][_0x1c5f93[0x1]]=_0x129f92;}}_0x5dba01['next']();});}}catch(_0x3bc282){logger[_0x1e44('0x8')](_0x1e44('0x9'),_0x3638c7,_[_0x1e44('0x18')](_0x3bc282)?JSON[_0x1e44('0x19')](_0x3bc282):_0x3bc282);logger[_0x1e44('0xd')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3638c7);_0x5dba01[_0x1e44('0xf')]();}};}; \ No newline at end of file +var _0x1d59=['./utils','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','[%s][SYSTEM]\x20%s','message','join','info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','isNil','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','stringify','validate','shelljs','lodash'];(function(_0x1d9aa0,_0x272488){var _0x226868=function(_0x17127c){while(--_0x17127c){_0x1d9aa0['push'](_0x1d9aa0['shift']());}};_0x226868(++_0x272488);}(_0x1d59,0x105));var _0x91d5=function(_0x29a3ef,_0x3d28cc){_0x29a3ef=_0x29a3ef-0x0;var _0x3b1c05=_0x1d59[_0x29a3ef];return _0x3b1c05;};'use strict';var schema=require(_0x91d5('0x0'));var sh=require(_0x91d5('0x1'));var _=require(_0x91d5('0x2'));var utils=require(_0x91d5('0x3'));var logger=require(_0x91d5('0x4'))(_0x91d5('0x5'));var system=schema({'command':{'type':_0x91d5('0x6'),'required':!![],'message':_0x91d5('0x7')}});exports['consequence']=function(_0x594098,_0x28fc48){return function(_0x4387d0){try{var _0x3bc711={'command':_0x28fc48[0x0]};var _0x293449=system['validate'](_0x3bc711,{'typecast':!![]});if(_0x293449[_0x91d5('0x8')]){logger[_0x91d5('0x9')](_0x91d5('0xa'),_0x594098,_['map'](_0x293449,_0x91d5('0xb'))[_0x91d5('0xc')](',\x20'));logger[_0x91d5('0xd')](_0x91d5('0xe'),_0x594098);_0x4387d0[_0x91d5('0xf')]();}else{var _0x35e055=this;var _0x51d0d3=utils['getMustacheRender'](_0x28fc48[0x0],this);logger[_0x91d5('0xd')](_0x91d5('0x10'),_0x594098,_0x51d0d3);sh[_0x91d5('0x11')](_[_0x91d5('0x12')](_0x51d0d3),function(_0x4fd42e,_0x58436c){logger[_0x91d5('0xd')](_0x91d5('0x13'),_0x594098,_0x4fd42e);if(_0x4fd42e==0x0){var _0x19944e=_0x58436c['replace'](/(\r\n|\n|\r)/gm,'');if(_[_0x91d5('0x14')](_0x28fc48[0x1])||_['isEmpty'](_0x28fc48[0x1])){logger[_0x91d5('0xd')]('[%s][SYSTEM]\x20no\x20variable',_0x594098);_0x35e055[_0x91d5('0x15')][_0x28fc48[0x1]]=_0x19944e;}else{logger[_0x91d5('0xd')](_0x91d5('0x16'),_0x594098,_0x28fc48[0x1],_0x19944e);_0x35e055['body'][_0x28fc48[0x1]]=_0x19944e;}}_0x4387d0[_0x91d5('0xf')]();});}}catch(_0x2f8000){logger['error'](_0x91d5('0xa'),_0x594098,_['isObject'](_0x2f8000)?JSON[_0x91d5('0x17')](_0x2f8000):_0x2f8000);logger[_0x91d5('0xd')](_0x91d5('0xe'),_0x594098);_0x4387d0[_0x91d5('0xf')]();}};}; \ 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 6fd88a0..eedbec0 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(_0x54faff,_0x9a3b5e){var _0x5a784c=function(_0x3d1147){while(--_0x3d1147){_0x54faff['push'](_0x54faff['shift']());}};_0x5a784c(++_0x9a3b5e);}(_0x9957,0x93));var _0x7995=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x9957[_0x2dafbe];return _0x58a45a;};'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 _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(_0x32be7d,_0x1e1fd6){var _0x3ddf=function(_0x63d160){while(--_0x63d160){_0x32be7d['push'](_0x32be7d['shift']());}};_0x3ddf(++_0x1e1fd6);}(_0x9957,0x93));var _0x7995=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x9957[_0x1facfa];return _0x9ec701;};'use strict';var schema=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var rpc={'chatInteraction':require(_0x7995('0x2')),'openchannelInteraction':require(_0x7995('0x3')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0x7995('0x4')),'faxInteraction':require(_0x7995('0x5'))};var logger=require(_0x7995('0x6'))(_0x7995('0x7'));var tag=schema({'tag':{'type':'number','required':!![],'message':_0x7995('0x8')}});exports[_0x7995('0x9')]=function(_0x137b6b,_0x219534,_0xbda126,_0x326741){return function(_0x4996ca){try{var _0x465276={'tag':_0x219534[0x0]};var _0x1cad37=tag['validate'](_0x465276,{'typecast':!![]});if(_0x1cad37[_0x7995('0xa')]){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0xd')](_0x1cad37,_0x7995('0xe'))[_0x7995('0xf')](',\x20'));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca[_0x7995('0x11')]();}else{var _0x41c652={'ids':[_0x219534[0x0]]};if(rpc[_0x326741['channel']+_0x7995('0x12')]){rpc[_0x326741[_0x7995('0x13')]+_0x7995('0x12')][_0x7995('0x14')](_0x326741[_0x7995('0x15')]['id'],_0x41c652)[_0x7995('0x16')](function(_0x2bbe7a){logger['info']('[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s',_0x137b6b,_0x219534[0x1],_0x326741[_0x7995('0x13')],_0x326741[_0x7995('0x15')]['id']);})[_0x7995('0x17')](function(_0x321ae8){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,JSON[_0x7995('0x18')](_0x321ae8));logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);})[_0x7995('0x19')](function(){_0x4996ca['next']();});}}}catch(_0x2f832e){logger[_0x7995('0xb')](_0x7995('0xc'),_0x137b6b,_[_0x7995('0x1a')](_0x2f832e)?JSON[_0x7995('0x18')](_0x2f832e):_0x2f832e);logger[_0x7995('0x10')]('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x137b6b);_0x4996ca['next']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/utils.js b/server/services/routing/server/applications/utils.js index 48192a0..2ec85e4 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 _0x53d5=['mustache','lodash','exports','render','merge','contact','message','account','interaction','list'];(function(_0x882b99,_0x58a2e5){var _0x3a642=function(_0x4dd74d){while(--_0x4dd74d){_0x882b99['push'](_0x882b99['shift']());}};_0x3a642(++_0x58a2e5);}(_0x53d5,0x1cc));var _0x553d=function(_0x264b61,_0x4a5017){_0x264b61=_0x264b61-0x0;var _0x8fff4f=_0x53d5[_0x264b61];return _0x8fff4f;};'use strict';var Mustache=require(_0x553d('0x0'));var _=require(_0x553d('0x1'));module[_0x553d('0x2')]={'getMustacheRender':function(_0x619750,_0x1036b6){return Mustache[_0x553d('0x3')](_0x619750,_[_0x553d('0x4')](_0x1036b6['body'],{'contact':_0x1036b6[_0x553d('0x5')],'message':_0x1036b6[_0x553d('0x6')],'account':_0x1036b6[_0x553d('0x7')],'interaction':_0x1036b6[_0x553d('0x8')],'list':_0x1036b6[_0x553d('0x9')]}))||'';}}; \ No newline at end of file +var _0x0a9a=['interaction','list','lodash','render','merge','contact','message'];(function(_0x352070,_0x3b4d38){var _0x235a6b=function(_0x5d11f6){while(--_0x5d11f6){_0x352070['push'](_0x352070['shift']());}};_0x235a6b(++_0x3b4d38);}(_0x0a9a,0x183));var _0xa0a9=function(_0x23a36d,_0xa7d1f7){_0x23a36d=_0x23a36d-0x0;var _0x337e56=_0x0a9a[_0x23a36d];return _0x337e56;};'use strict';var Mustache=require('mustache');var _=require(_0xa0a9('0x0'));module['exports']={'getMustacheRender':function(_0x3b1a40,_0x3cff22){return Mustache[_0xa0a9('0x1')](_0x3b1a40,_[_0xa0a9('0x2')](_0x3cff22['body'],{'contact':_0x3cff22[_0xa0a9('0x3')],'message':_0x3cff22[_0xa0a9('0x4')],'account':_0x3cff22['account'],'interaction':_0x3cff22[_0xa0a9('0x5')],'list':_0x3cff22[_0xa0a9('0x6')]}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index 8bea39f..bcbf544 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 _0x0cfa=['join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','dialogflow','amazonlex','tag','TagId','./interval','condition','./applications/','consequence','info','on\x20interval','intervals','\x20|\x20','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','stringify','matchPath','No\x20applications\x20to\x20execute','error','stack','routing\x20is\x20empty','emit','end','QueueReport','UserId','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','available','loggedIn','name','mailQueues','paused','waiting','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','isArray','applications','length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0cfa,0x1aa));var _0xa0cf=function(_0x485a1c,_0x3350af){_0x485a1c=_0x485a1c-0x0;var _0x27ac8a=_0x0cfa[_0x485a1c];return _0x27ac8a;};'use strict';var _=require(_0xa0cf('0x0'));var util=require(_0xa0cf('0x1'));var path=require('path');var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0xa0cf('0x2'));var uuid=require(_0xa0cf('0x3'));var config=require(_0xa0cf('0x4'));var logger=require('../../../config/logger')(_0xa0cf('0x5'));var rpc={'openchannelQueueReport':require(_0xa0cf('0x6'))};var rpc={'openchannelQueueReport':require(_0xa0cf('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0xa0cf('0x7')),'smsQueueReport':require('../rpc/smsQueueReport'),'faxQueueReport':require(_0xa0cf('0x8'))};var RuleEngine=require(_0xa0cf('0x9'));function getId(_0x23eb8e,_0xd9b9af,_0x50e9f0){return util[_0xa0cf('0xa')](_0xa0cf('0xb'),_0x23eb8e,_0xd9b9af||0x0,_0x50e9f0||0x0);}function getIntervals(_0x6f30da,_0x411abc){var _0x1b9c6f=[];if(!_[_0xa0cf('0xc')](_0x411abc['IntervalId'])&&!_[_0xa0cf('0xc')](_0x6f30da[_0x411abc[_0xa0cf('0xd')]])&&!_[_0xa0cf('0xc')](_0x6f30da[_0x411abc[_0xa0cf('0xd')]][_0xa0cf('0xe')])){_0x1b9c6f=_[_0xa0cf('0xf')](_0x6f30da[_0x411abc['IntervalId']][_0xa0cf('0xe')],_0xa0cf('0x10'));}else if(!_[_0xa0cf('0xc')](_0x411abc[_0xa0cf('0x10')])){_0x1b9c6f=[_0x411abc[_0xa0cf('0x10')]];}return _0x1b9c6f;}exports[_0xa0cf('0x11')]=function(_0x3a3591){_0x3a3591['rules']={};return new BPromise(function(_0x3b1bd3,_0x2a63fe){var _0x29358f={'Start':function(_0x216034){var _0x48a63a=this;return new Promise(function(_0x3d555d,_0x4e5e59){if(_0x216034){try{var _0x27db57=[];var _0x6a4c53=getId(_0x216034[_0xa0cf('0x12')],_0x216034[_0xa0cf('0x13')]?_0x216034[_0xa0cf('0x13')]['id']:0x0,_0x216034[_0xa0cf('0x14')]?_0x216034[_0xa0cf('0x14')]['id']:0x0);if(_0x216034['applications']&&_[_0xa0cf('0x15')](_0x216034[_0xa0cf('0x16')])&&_0x216034['applications'][_0xa0cf('0x17')]){for(var _0x4e1740=0x0;_0x4e1740<_0x216034[_0xa0cf('0x16')][_0xa0cf('0x17')];_0x4e1740+=0x1){var _0x43816f=_0x216034[_0xa0cf('0x16')][_0x4e1740];if(fs['existsSync'](path[_0xa0cf('0x18')](__dirname,_0xa0cf('0x16'),_0x43816f[_0xa0cf('0x19')]+_0xa0cf('0x1a')))){var _0x20738b=[];switch(_0x43816f[_0xa0cf('0x19')][_0xa0cf('0x1b')]()){case _0xa0cf('0x1c'):var _0x4bdee4=_0x43816f[_0xa0cf('0x1d')][_0xa0cf('0x1e')](',');_0x20738b['push'](_0x4bdee4[0x0]);_0x20738b[_0xa0cf('0x1f')](_0x4bdee4[_0xa0cf('0x20')](0x1,_0x4bdee4[_0xa0cf('0x17')])[_0xa0cf('0x18')](','));break;case _0xa0cf('0x21'):var _0x5a1668=_0x43816f[_0xa0cf('0x1d')]['split'](',');_0x20738b[_0xa0cf('0x1f')](_0x5a1668[0x0]);_0x20738b['push'](_0x5a1668[0x1]);_0x20738b[_0xa0cf('0x1f')](_0x5a1668[_0xa0cf('0x20')](0x2,_0x5a1668[_0xa0cf('0x17')])[_0xa0cf('0x18')](','));break;case _0xa0cf('0x22'):var _0x5947a3=_0x43816f[_0xa0cf('0x1d')]['split'](',');_0x20738b[_0xa0cf('0x1f')](_0x5947a3[0x0]);_0x20738b[_0xa0cf('0x1f')](_0x5947a3[0x1]);_0x20738b['push'](_0x5947a3[0x2]);_0x20738b[_0xa0cf('0x1f')](_0x5947a3[0x3]);_0x20738b['push'](_0x5947a3[_0xa0cf('0x20')](0x4,_0x5947a3[_0xa0cf('0x17')])['join'](','));break;case _0xa0cf('0x13'):_0x20738b[_0xa0cf('0x1f')](_0x43816f['appdata']);break;case _0xa0cf('0x23'):_0x20738b[_0xa0cf('0x1f')](_0x43816f[_0xa0cf('0x24')]);_0x20738b[_0xa0cf('0x1f')](_0x43816f[_0xa0cf('0x1d')]);break;default:_0x20738b=_['isNil'](_0x43816f[_0xa0cf('0x1d')])?[]:_0x43816f[_0xa0cf('0x1d')][_0xa0cf('0x1e')](',');}var _0x2cac34={'id':util[_0xa0cf('0xa')]('%s:%s:%s',_0x6a4c53,_0x43816f['id'],_0x43816f[_0xa0cf('0x19')]),'condition':require(_0xa0cf('0x25'))[_0xa0cf('0x26')](_0x6a4c53,getIntervals(_0x3a3591['intervals'],_0x43816f),_0x3a3591),'consequence':require(_0xa0cf('0x27')+_0x43816f[_0xa0cf('0x19')])[_0xa0cf('0x28')](_0x6a4c53,_0x20738b,_0x3a3591,_0x216034),'p':_0x43816f['priority']||0x0};logger[_0xa0cf('0x29')]('Push\x20new\x20rule',_0x2cac34['id'],_0xa0cf('0x2a'),getIntervals(_0x3a3591[_0xa0cf('0x2b')],_0x43816f)[_0xa0cf('0x18')](_0xa0cf('0x2c')));_0x27db57[_0xa0cf('0x1f')](_0x2cac34);}else{logger['error'](_0xa0cf('0x2d'),path[_0xa0cf('0x18')](__dirname,'applications',_0x43816f['app']+_0xa0cf('0x1a')));}}_0x3a3591[_0xa0cf('0x2e')][_0x6a4c53]=new RuleEngine(_0x27db57);_0x3a3591[_0xa0cf('0x2e')][_0x6a4c53][_0xa0cf('0x2f')](_0x216034,function(_0x10b9d5){logger[_0xa0cf('0x29')]('Applications\x20executed',JSON[_0xa0cf('0x30')](_0x10b9d5[_0xa0cf('0x31')]));if(_0x3a3591[_0xa0cf('0x2e')][_0x6a4c53]){_0x3a3591[_0xa0cf('0x2e')][_0x6a4c53]['emit']('complete');}});return _0x3d555d({'code':0xc8,'message':_0x216034});}else{logger[_0xa0cf('0x29')](_0xa0cf('0x32'));return _0x3d555d({'code':0xc8,'message':_0x216034});}}catch(_0x1db0ca){logger[_0xa0cf('0x33')](_0x1db0ca[_0xa0cf('0x34')]);return _0x4e5e59(_0x48a63a['error'](0x1f4,_0x1db0ca));}}return _0x4e5e59(_0xa0cf('0x35'));});},'AcceptMessage':function(_0x4665b9){var _0x1d74bd=this;return new Promise(function(_0x3e8315,_0x7f6c12){if(_0x4665b9[_0xa0cf('0x13')]&&_0x4665b9[_0xa0cf('0x13')]['id']){try{var _0x1e3434=getId(_0x4665b9[_0xa0cf('0x12')],_0x4665b9[_0xa0cf('0x13')]?_0x4665b9[_0xa0cf('0x13')]['id']:0x0,_0x4665b9[_0xa0cf('0x14')]?_0x4665b9['interaction']['id']:0x0);if(_0x3a3591[_0xa0cf('0x2e')][_0x1e3434]){_0x3a3591['rules'][_0x1e3434][_0xa0cf('0x36')](_0xa0cf('0x37'));if(rpc[_0x4665b9[_0xa0cf('0x12')]+_0xa0cf('0x38')]){rpc[_0x4665b9['channel']+_0xa0cf('0x38')]['update'](_0x1e3434,{'UserId':_0x4665b9['message'][_0xa0cf('0x39')]})['catch'](function(_0x5a0fe1){logger[_0xa0cf('0x33')](_0xa0cf('0x3a'));});}}return _0x3e8315({'code':0xc8,'message':_0x4665b9});}catch(_0x491c9e){logger[_0xa0cf('0x33')](_0x491c9e[_0xa0cf('0x34')]);return _0x7f6c12(_0x1d74bd[_0xa0cf('0x33')](0x1f4,_0x491c9e));}}logger[_0xa0cf('0x33')](_0xa0cf('0x3b'));return _0x7f6c12(_0x1d74bd[_0xa0cf('0x33')](0x1f4,_0xa0cf('0x3b')));});},'RejectMessage':function(_0x252d41){var _0x15a931=this;return new Promise(function(_0x4a467f,_0x350aee){if(_0x252d41[_0xa0cf('0x3c')]&&_0x252d41[_0xa0cf('0x3c')]['id']){try{if(_0x3a3591[_0xa0cf('0x3d')][_0x252d41[_0xa0cf('0x3c')]['id']]){_0x3a3591[_0xa0cf('0x3d')][_0x252d41[_0xa0cf('0x3c')]['id']][_0xa0cf('0x3e')]=![];_0x3a3591[_0xa0cf('0x3d')][_0x252d41[_0xa0cf('0x3c')]['id']][_0xa0cf('0x3f')]=undefined;}return _0x4a467f({'code':0xc8,'message':_0x252d41});}catch(_0x84fd15){logger['error'](_0x84fd15[_0xa0cf('0x34')]);return _0x350aee(_0x15a931[_0xa0cf('0x33')](0x1f4,_0x84fd15));}}logger[_0xa0cf('0x33')]('message\x20is\x20empty');return _0x350aee(_0x15a931[_0xa0cf('0x33')](0x1f4,_0xa0cf('0x3b')));});},'AbandonInteraction':function(_0x20641e){var _0x1eb824=this;return new Promise(function(_0x97fef0,_0x564799){if(_0x20641e['channel']&&_0x20641e['interaction']&&_0x20641e['interaction']['id']){try{var _0x386ec2=getId(_0x20641e[_0xa0cf('0x12')],_0x20641e['message']?_0x20641e[_0xa0cf('0x13')]['id']:0x0,_0x20641e[_0xa0cf('0x14')]?_0x20641e[_0xa0cf('0x14')]['id']:0x0);if(_0x3a3591[_0xa0cf('0x2e')][_0x386ec2]){_0x3a3591['rules'][_0x386ec2]['emit'](_0xa0cf('0x37'));}return _0x97fef0({'code':0xc8,'message':_0x20641e});}catch(_0x5272ca){logger['error'](_0x5272ca[_0xa0cf('0x34')]);return _0x564799(_0x1eb824['error'](0x1f4,_0x5272ca));}}logger[_0xa0cf('0x33')](_0xa0cf('0x3b'));return _0x564799(_0x1eb824[_0xa0cf('0x33')](0x1f4,_0xa0cf('0x3b')));});},'AgentCapacity':function(_0x4af2a0){var _0x4d2410=this;return new Promise(function(_0x4044f5,_0x35f6c8){if(_0x3a3591[_0xa0cf('0x3d')][_0xa0cf('0x40')](_0x4af2a0['id'])){for(var _0x4a0049 in _0x4af2a0[_0xa0cf('0x41')]){if(_0x4af2a0[_0xa0cf('0x41')][_0xa0cf('0x40')](_0x4a0049)){if(_0x3a3591[_0xa0cf('0x3d')][_0x4af2a0['id']][_0xa0cf('0x40')](_0x4a0049+_0xa0cf('0x42'))){_0x3a3591[_0xa0cf('0x3d')][_0x4af2a0['id']][_0x4a0049+_0xa0cf('0x42')]=parseInt(_0x4af2a0[_0xa0cf('0x41')][_0x4a0049],0xa);}}}_0x3a3591[_0xa0cf('0x3d')][_0x4af2a0['id']][_0xa0cf('0x43')]();return _0x4044f5({'code':0xc8,'message':_0x3a3591[_0xa0cf('0x3d')][_0x4af2a0['id']]});}else{return _0x35f6c8(_0x4d2410['error'](0x1f4,_0xa0cf('0x44')));}});},'Agents':function(_0x15e823){return new Promise(function(_0x462c5b,_0x188962){var _0x21eb6c=_['values'](_0x3a3591[_0xa0cf('0x3d')]);_0x462c5b({'count':_0x21eb6c[_0xa0cf('0x17')],'rows':_0x21eb6c});});},'ChatQueues':function(_0x46db9c){return new Promise(function(_0x14a128,_0x533c44){var _0x4395a0=[];for(var _0x50de93 in _0x3a3591[_0xa0cf('0x45')]){if(_0x3a3591[_0xa0cf('0x45')]['hasOwnProperty'](_0x50de93)){var _0x37b1c0=_0x3a3591[_0xa0cf('0x45')][_0x50de93];var _0x156536={'id':_0x37b1c0['id'],'available':_0x37b1c0[_0xa0cf('0x46')],'loggedIn':_0x37b1c0[_0xa0cf('0x47')],'name':_0x37b1c0[_0xa0cf('0x48')],'paused':_0x37b1c0['paused'],'waiting':_0x37b1c0['waiting']};_0x4395a0[_0xa0cf('0x1f')](_0x156536);}}_0x14a128({'count':_0x4395a0['length'],'rows':_0x4395a0});});},'MailQueues':function(_0x2b5088){return new Promise(function(_0x22659d,_0x15efaf){var _0x30e1bb=[];for(var _0x47eea7 in _0x3a3591[_0xa0cf('0x49')]){if(_0x3a3591[_0xa0cf('0x49')][_0xa0cf('0x40')](_0x47eea7)){var _0x513387=_0x3a3591[_0xa0cf('0x49')][_0x47eea7];var _0x318459={'id':_0x513387['id'],'available':_0x513387[_0xa0cf('0x46')],'loggedIn':_0x513387['loggedIn'],'name':_0x513387[_0xa0cf('0x48')],'paused':_0x513387[_0xa0cf('0x4a')],'waiting':_0x513387[_0xa0cf('0x4b')]};_0x30e1bb[_0xa0cf('0x1f')](_0x318459);}}_0x22659d({'count':_0x30e1bb['length'],'rows':_0x30e1bb});});},'OpenchannelQueues':function(_0x3234bb){return new Promise(function(_0x29642d,_0x21cca5){var _0x534683=[];for(var _0x5e5b77 in _0x3a3591['openchannelQueues']){if(_0x3a3591['openchannelQueues']['hasOwnProperty'](_0x5e5b77)){var _0x51466f=_0x3a3591[_0xa0cf('0x4c')][_0x5e5b77];var _0x30f12f={'id':_0x51466f['id'],'available':_0x51466f['available'],'loggedIn':_0x51466f['loggedIn'],'name':_0x51466f['name'],'paused':_0x51466f[_0xa0cf('0x4a')],'waiting':_0x51466f[_0xa0cf('0x4b')]};_0x534683[_0xa0cf('0x1f')](_0x30f12f);}}_0x29642d({'count':_0x534683['length'],'rows':_0x534683});});},'SmsQueues':function(_0x95acde){return new Promise(function(_0x42a990,_0x3e167e){var _0x370305=[];for(var _0x17e02b in _0x3a3591[_0xa0cf('0x4d')]){if(_0x3a3591[_0xa0cf('0x4d')][_0xa0cf('0x40')](_0x17e02b)){var _0x3bea77=_0x3a3591[_0xa0cf('0x4d')][_0x17e02b];var _0x258ab7={'id':_0x3bea77['id'],'available':_0x3bea77[_0xa0cf('0x46')],'loggedIn':_0x3bea77[_0xa0cf('0x47')],'name':_0x3bea77['name'],'paused':_0x3bea77['paused'],'waiting':_0x3bea77[_0xa0cf('0x4b')]};_0x370305[_0xa0cf('0x1f')](_0x258ab7);}}_0x42a990({'count':_0x370305[_0xa0cf('0x17')],'rows':_0x370305});});},'FaxQueues':function(_0x310ed8){return new Promise(function(_0x49189e,_0xccc426){var _0x13d8ef=[];for(var _0x3a220b in _0x3a3591[_0xa0cf('0x4e')]){if(_0x3a3591[_0xa0cf('0x4e')]['hasOwnProperty'](_0x3a220b)){var _0x289594=_0x3a3591['faxQueues'][_0x3a220b];var _0x564029={'id':_0x289594['id'],'available':_0x289594[_0xa0cf('0x46')],'loggedIn':_0x289594[_0xa0cf('0x47')],'name':_0x289594[_0xa0cf('0x48')],'paused':_0x289594['paused'],'waiting':_0x289594[_0xa0cf('0x4b')]};_0x13d8ef[_0xa0cf('0x1f')](_0x564029);}}_0x49189e({'count':_0x13d8ef[_0xa0cf('0x17')],'rows':_0x13d8ef});});},'ChatQueuesWaitingInteractions':function(_0x1d4753){return new Promise(function(_0x5b7d69,_0x20ce9c){var _0x5161e8=_['values'](_0x3a3591[_0xa0cf('0x4f')]);_0x5b7d69({'count':_0x5161e8[_0xa0cf('0x17')],'rows':_0x5161e8});});},'MailQueuesWaitingInteractions':function(_0x1127ed){return new Promise(function(_0x4f409b,_0x1770b1){var _0x1f7935=_[_0xa0cf('0x50')](_0x3a3591[_0xa0cf('0x51')]);_0x4f409b({'count':_0x1f7935[_0xa0cf('0x17')],'rows':_0x1f7935});});},'OpenchannelQueuesWaitingInteractions':function(_0x50a1a7){return new Promise(function(_0x17562c,_0x4f224a){var _0x273964=_[_0xa0cf('0x50')](_0x3a3591[_0xa0cf('0x52')]);_0x17562c({'count':_0x273964[_0xa0cf('0x17')],'rows':_0x273964});});},'SmsQueuesWaitingInteractions':function(_0x451324){return new Promise(function(_0x18fca3,_0x45c7fb){var _0x3926b2=_[_0xa0cf('0x50')](_0x3a3591[_0xa0cf('0x53')]);_0x18fca3({'count':_0x3926b2[_0xa0cf('0x17')],'rows':_0x3926b2});});},'FaxQueuesWaitingInteractions':function(_0x1dfc4f){return new Promise(function(_0x1fd6b1,_0x4c3862){var _0x2613cc=_[_0xa0cf('0x50')](_0x3a3591[_0xa0cf('0x54')]);_0x1fd6b1({'count':_0x2613cc[_0xa0cf('0x17')],'rows':_0x2613cc});});}};var _0x56da2f=jayson[_0xa0cf('0x55')](_0x29358f)['http']();_0x56da2f['on']('error',function(_0x1d41eb){logger[_0xa0cf('0x33')](JSON[_0xa0cf('0x30')](_0x1d41eb));return _0x2a63fe(_0x1d41eb);});_0x56da2f[_0xa0cf('0x11')](0x232c,_0xa0cf('0x56'),function(){console[_0xa0cf('0x57')](_0xa0cf('0x58'),0x232c);return _0x3b1bd3(_0xa0cf('0x59')+0x232c);});});}; \ No newline at end of file +var _0xaa53=['push','amazonlex','tag','TagId','%s:%s:%s','./interval','condition','intervals','consequence','priority','info','error','Please\x20create\x20a\x20new\x20file\x20under','rules','execute','Applications\x20executed','stringify','matchPath','emit','complete','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty','end','QueueReport','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','busy','agents','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','values','chatQueues','available','loggedIn','name','waiting','mailQueues','paused','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','jayson/promise','bluebird','uuid','../../../config/environment','routing','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','app','.js','toLowerCase','autoreply','appdata','split','slice','join','dialogflow'];(function(_0x542e32,_0x43099b){var _0x275875=function(_0x52a5f2){while(--_0x52a5f2){_0x542e32['push'](_0x542e32['shift']());}};_0x275875(++_0x43099b);}(_0xaa53,0x1a9));var _0x3aa5=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xaa53[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x3aa5('0x0'));var util=require('util');var path=require('path');var fs=require('fs');var jayson=require(_0x3aa5('0x1'));var BPromise=require(_0x3aa5('0x2'));var uuid=require(_0x3aa5('0x3'));var config=require(_0x3aa5('0x4'));var logger=require('../../../config/logger')(_0x3aa5('0x5'));var rpc={'openchannelQueueReport':require(_0x3aa5('0x6'))};var rpc={'openchannelQueueReport':require(_0x3aa5('0x6')),'mailQueueReport':require(_0x3aa5('0x7')),'chatQueueReport':require(_0x3aa5('0x8')),'smsQueueReport':require(_0x3aa5('0x9')),'faxQueueReport':require(_0x3aa5('0xa'))};var RuleEngine=require(_0x3aa5('0xb'));function getId(_0x2b5ef2,_0x48f0ab,_0x4a5b4f){return util[_0x3aa5('0xc')](_0x3aa5('0xd'),_0x2b5ef2,_0x48f0ab||0x0,_0x4a5b4f||0x0);}function getIntervals(_0x149a48,_0x4655eb){var _0x5cb238=[];if(!_['isNil'](_0x4655eb['IntervalId'])&&!_[_0x3aa5('0xe')](_0x149a48[_0x4655eb[_0x3aa5('0xf')]])&&!_[_0x3aa5('0xe')](_0x149a48[_0x4655eb['IntervalId']][_0x3aa5('0x10')])){_0x5cb238=_[_0x3aa5('0x11')](_0x149a48[_0x4655eb[_0x3aa5('0xf')]][_0x3aa5('0x10')],_0x3aa5('0x12'));}else if(!_[_0x3aa5('0xe')](_0x4655eb[_0x3aa5('0x12')])){_0x5cb238=[_0x4655eb[_0x3aa5('0x12')]];}return _0x5cb238;}exports[_0x3aa5('0x13')]=function(_0x5d00c4){_0x5d00c4['rules']={};return new BPromise(function(_0x43e669,_0x1fa420){var _0x302fdf={'Start':function(_0x3662ab){var _0x3546c1=this;return new Promise(function(_0x8a46da,_0x381729){if(_0x3662ab){try{var _0x221342=[];var _0x53b0d1=getId(_0x3662ab[_0x3aa5('0x14')],_0x3662ab[_0x3aa5('0x15')]?_0x3662ab[_0x3aa5('0x15')]['id']:0x0,_0x3662ab['interaction']?_0x3662ab[_0x3aa5('0x16')]['id']:0x0);if(_0x3662ab[_0x3aa5('0x17')]&&_[_0x3aa5('0x18')](_0x3662ab[_0x3aa5('0x17')])&&_0x3662ab[_0x3aa5('0x17')]['length']){for(var _0x3b29ac=0x0;_0x3b29ac<_0x3662ab[_0x3aa5('0x17')][_0x3aa5('0x19')];_0x3b29ac+=0x1){var _0x132116=_0x3662ab[_0x3aa5('0x17')][_0x3b29ac];if(fs['existsSync'](path['join'](__dirname,'applications',_0x132116[_0x3aa5('0x1a')]+_0x3aa5('0x1b')))){var _0x25cfcc=[];switch(_0x132116[_0x3aa5('0x1a')][_0x3aa5('0x1c')]()){case _0x3aa5('0x1d'):var _0x1fae3d=_0x132116[_0x3aa5('0x1e')][_0x3aa5('0x1f')](',');_0x25cfcc['push'](_0x1fae3d[0x0]);_0x25cfcc['push'](_0x1fae3d[_0x3aa5('0x20')](0x1,_0x1fae3d[_0x3aa5('0x19')])[_0x3aa5('0x21')](','));break;case _0x3aa5('0x22'):var _0x2262b8=_0x132116[_0x3aa5('0x1e')][_0x3aa5('0x1f')](',');_0x25cfcc[_0x3aa5('0x23')](_0x2262b8[0x0]);_0x25cfcc[_0x3aa5('0x23')](_0x2262b8[0x1]);_0x25cfcc[_0x3aa5('0x23')](_0x2262b8['slice'](0x2,_0x2262b8['length'])[_0x3aa5('0x21')](','));break;case _0x3aa5('0x24'):var _0x36b9c4=_0x132116['appdata'][_0x3aa5('0x1f')](',');_0x25cfcc[_0x3aa5('0x23')](_0x36b9c4[0x0]);_0x25cfcc[_0x3aa5('0x23')](_0x36b9c4[0x1]);_0x25cfcc[_0x3aa5('0x23')](_0x36b9c4[0x2]);_0x25cfcc[_0x3aa5('0x23')](_0x36b9c4[0x3]);_0x25cfcc[_0x3aa5('0x23')](_0x36b9c4['slice'](0x4,_0x36b9c4['length'])[_0x3aa5('0x21')](','));break;case _0x3aa5('0x15'):_0x25cfcc['push'](_0x132116[_0x3aa5('0x1e')]);break;case _0x3aa5('0x25'):_0x25cfcc[_0x3aa5('0x23')](_0x132116[_0x3aa5('0x26')]);_0x25cfcc[_0x3aa5('0x23')](_0x132116[_0x3aa5('0x1e')]);break;default:_0x25cfcc=_[_0x3aa5('0xe')](_0x132116[_0x3aa5('0x1e')])?[]:_0x132116[_0x3aa5('0x1e')][_0x3aa5('0x1f')](',');}var _0x1b7ed6={'id':util[_0x3aa5('0xc')](_0x3aa5('0x27'),_0x53b0d1,_0x132116['id'],_0x132116[_0x3aa5('0x1a')]),'condition':require(_0x3aa5('0x28'))[_0x3aa5('0x29')](_0x53b0d1,getIntervals(_0x5d00c4[_0x3aa5('0x2a')],_0x132116),_0x5d00c4),'consequence':require('./applications/'+_0x132116[_0x3aa5('0x1a')])[_0x3aa5('0x2b')](_0x53b0d1,_0x25cfcc,_0x5d00c4,_0x3662ab),'p':_0x132116[_0x3aa5('0x2c')]||0x0};logger[_0x3aa5('0x2d')]('Push\x20new\x20rule',_0x1b7ed6['id'],'on\x20interval',getIntervals(_0x5d00c4[_0x3aa5('0x2a')],_0x132116)[_0x3aa5('0x21')]('\x20|\x20'));_0x221342['push'](_0x1b7ed6);}else{logger[_0x3aa5('0x2e')](_0x3aa5('0x2f'),path[_0x3aa5('0x21')](__dirname,_0x3aa5('0x17'),_0x132116[_0x3aa5('0x1a')]+_0x3aa5('0x1b')));}}_0x5d00c4[_0x3aa5('0x30')][_0x53b0d1]=new RuleEngine(_0x221342);_0x5d00c4[_0x3aa5('0x30')][_0x53b0d1][_0x3aa5('0x31')](_0x3662ab,function(_0x48cc0c){logger[_0x3aa5('0x2d')](_0x3aa5('0x32'),JSON[_0x3aa5('0x33')](_0x48cc0c[_0x3aa5('0x34')]));if(_0x5d00c4['rules'][_0x53b0d1]){_0x5d00c4[_0x3aa5('0x30')][_0x53b0d1][_0x3aa5('0x35')](_0x3aa5('0x36'));}});return _0x8a46da({'code':0xc8,'message':_0x3662ab});}else{logger['info'](_0x3aa5('0x37'));return _0x8a46da({'code':0xc8,'message':_0x3662ab});}}catch(_0x55d063){logger['error'](_0x55d063[_0x3aa5('0x38')]);return _0x381729(_0x3546c1[_0x3aa5('0x2e')](0x1f4,_0x55d063));}}return _0x381729(_0x3aa5('0x39'));});},'AcceptMessage':function(_0xd1051){var _0x4c6320=this;return new Promise(function(_0x523f00,_0x53bd6d){if(_0xd1051[_0x3aa5('0x15')]&&_0xd1051[_0x3aa5('0x15')]['id']){try{var _0x4341e8=getId(_0xd1051[_0x3aa5('0x14')],_0xd1051['message']?_0xd1051[_0x3aa5('0x15')]['id']:0x0,_0xd1051['interaction']?_0xd1051[_0x3aa5('0x16')]['id']:0x0);if(_0x5d00c4[_0x3aa5('0x30')][_0x4341e8]){_0x5d00c4[_0x3aa5('0x30')][_0x4341e8][_0x3aa5('0x35')](_0x3aa5('0x3a'));if(rpc[_0xd1051[_0x3aa5('0x14')]+_0x3aa5('0x3b')]){rpc[_0xd1051[_0x3aa5('0x14')]+'QueueReport']['update'](_0x4341e8,{'UserId':_0xd1051[_0x3aa5('0x15')]['UserId']})[_0x3aa5('0x3c')](function(_0x277c00){logger[_0x3aa5('0x2e')](_0x3aa5('0x3d'));});}}return _0x523f00({'code':0xc8,'message':_0xd1051});}catch(_0x3768e0){logger['error'](_0x3768e0[_0x3aa5('0x38')]);return _0x53bd6d(_0x4c6320[_0x3aa5('0x2e')](0x1f4,_0x3768e0));}}logger[_0x3aa5('0x2e')](_0x3aa5('0x3e'));return _0x53bd6d(_0x4c6320[_0x3aa5('0x2e')](0x1f4,'message\x20is\x20empty'));});},'RejectMessage':function(_0x3cdf87){var _0x2b167a=this;return new Promise(function(_0x8d9e70,_0x253499){if(_0x3cdf87[_0x3aa5('0x3f')]&&_0x3cdf87[_0x3aa5('0x3f')]['id']){try{if(_0x5d00c4['agents'][_0x3cdf87[_0x3aa5('0x3f')]['id']]){_0x5d00c4['agents'][_0x3cdf87[_0x3aa5('0x3f')]['id']][_0x3aa5('0x40')]=![];_0x5d00c4[_0x3aa5('0x41')][_0x3cdf87[_0x3aa5('0x3f')]['id']][_0x3aa5('0x42')]=undefined;}return _0x8d9e70({'code':0xc8,'message':_0x3cdf87});}catch(_0x5aaed0){logger[_0x3aa5('0x2e')](_0x5aaed0[_0x3aa5('0x38')]);return _0x253499(_0x2b167a[_0x3aa5('0x2e')](0x1f4,_0x5aaed0));}}logger[_0x3aa5('0x2e')]('message\x20is\x20empty');return _0x253499(_0x2b167a[_0x3aa5('0x2e')](0x1f4,_0x3aa5('0x3e')));});},'AbandonInteraction':function(_0x4cd9fb){var _0x5f1f56=this;return new Promise(function(_0x4cc99c,_0xd2ec21){if(_0x4cd9fb[_0x3aa5('0x14')]&&_0x4cd9fb[_0x3aa5('0x16')]&&_0x4cd9fb[_0x3aa5('0x16')]['id']){try{var _0x26a04b=getId(_0x4cd9fb[_0x3aa5('0x14')],_0x4cd9fb[_0x3aa5('0x15')]?_0x4cd9fb[_0x3aa5('0x15')]['id']:0x0,_0x4cd9fb[_0x3aa5('0x16')]?_0x4cd9fb[_0x3aa5('0x16')]['id']:0x0);if(_0x5d00c4[_0x3aa5('0x30')][_0x26a04b]){_0x5d00c4['rules'][_0x26a04b][_0x3aa5('0x35')](_0x3aa5('0x3a'));}return _0x4cc99c({'code':0xc8,'message':_0x4cd9fb});}catch(_0x58245e){logger[_0x3aa5('0x2e')](_0x58245e['stack']);return _0xd2ec21(_0x5f1f56[_0x3aa5('0x2e')](0x1f4,_0x58245e));}}logger[_0x3aa5('0x2e')](_0x3aa5('0x3e'));return _0xd2ec21(_0x5f1f56[_0x3aa5('0x2e')](0x1f4,_0x3aa5('0x3e')));});},'AgentCapacity':function(_0x254865){var _0x5ef7ef=this;return new Promise(function(_0x4227d1,_0x59708c){if(_0x5d00c4['agents'][_0x3aa5('0x43')](_0x254865['id'])){for(var _0x474697 in _0x254865[_0x3aa5('0x44')]){if(_0x254865[_0x3aa5('0x44')][_0x3aa5('0x43')](_0x474697)){if(_0x5d00c4[_0x3aa5('0x41')][_0x254865['id']][_0x3aa5('0x43')](_0x474697+_0x3aa5('0x45'))){_0x5d00c4[_0x3aa5('0x41')][_0x254865['id']][_0x474697+_0x3aa5('0x45')]=parseInt(_0x254865['capacity'][_0x474697],0xa);}}}_0x5d00c4[_0x3aa5('0x41')][_0x254865['id']][_0x3aa5('0x46')]();return _0x4227d1({'code':0xc8,'message':_0x5d00c4['agents'][_0x254865['id']]});}else{return _0x59708c(_0x5ef7ef[_0x3aa5('0x2e')](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0xfb5dee){return new Promise(function(_0x53b09e,_0x4b29e9){var _0x5bccf3=_[_0x3aa5('0x47')](_0x5d00c4['agents']);_0x53b09e({'count':_0x5bccf3[_0x3aa5('0x19')],'rows':_0x5bccf3});});},'ChatQueues':function(_0x19fc9d){return new Promise(function(_0x27b404,_0x1f2c91){var _0x5cdac2=[];for(var _0x2a69d3 in _0x5d00c4['chatQueues']){if(_0x5d00c4[_0x3aa5('0x48')][_0x3aa5('0x43')](_0x2a69d3)){var _0x161aa4=_0x5d00c4[_0x3aa5('0x48')][_0x2a69d3];var _0x148618={'id':_0x161aa4['id'],'available':_0x161aa4[_0x3aa5('0x49')],'loggedIn':_0x161aa4[_0x3aa5('0x4a')],'name':_0x161aa4[_0x3aa5('0x4b')],'paused':_0x161aa4['paused'],'waiting':_0x161aa4[_0x3aa5('0x4c')]};_0x5cdac2['push'](_0x148618);}}_0x27b404({'count':_0x5cdac2[_0x3aa5('0x19')],'rows':_0x5cdac2});});},'MailQueues':function(_0x683209){return new Promise(function(_0x4444f5,_0x251c8c){var _0x451367=[];for(var _0xd14d43 in _0x5d00c4[_0x3aa5('0x4d')]){if(_0x5d00c4[_0x3aa5('0x4d')][_0x3aa5('0x43')](_0xd14d43)){var _0x15dd2c=_0x5d00c4[_0x3aa5('0x4d')][_0xd14d43];var _0x37d13f={'id':_0x15dd2c['id'],'available':_0x15dd2c['available'],'loggedIn':_0x15dd2c[_0x3aa5('0x4a')],'name':_0x15dd2c['name'],'paused':_0x15dd2c[_0x3aa5('0x4e')],'waiting':_0x15dd2c[_0x3aa5('0x4c')]};_0x451367[_0x3aa5('0x23')](_0x37d13f);}}_0x4444f5({'count':_0x451367[_0x3aa5('0x19')],'rows':_0x451367});});},'OpenchannelQueues':function(_0x317b50){return new Promise(function(_0x405c5a,_0x63f373){var _0x2dece4=[];for(var _0x363ab9 in _0x5d00c4[_0x3aa5('0x4f')]){if(_0x5d00c4[_0x3aa5('0x4f')]['hasOwnProperty'](_0x363ab9)){var _0x467ded=_0x5d00c4[_0x3aa5('0x4f')][_0x363ab9];var _0x5b9a11={'id':_0x467ded['id'],'available':_0x467ded['available'],'loggedIn':_0x467ded[_0x3aa5('0x4a')],'name':_0x467ded[_0x3aa5('0x4b')],'paused':_0x467ded[_0x3aa5('0x4e')],'waiting':_0x467ded[_0x3aa5('0x4c')]};_0x2dece4[_0x3aa5('0x23')](_0x5b9a11);}}_0x405c5a({'count':_0x2dece4[_0x3aa5('0x19')],'rows':_0x2dece4});});},'SmsQueues':function(_0x2e2094){return new Promise(function(_0x14737b,_0x1b783e){var _0x2acc9f=[];for(var _0x37d575 in _0x5d00c4[_0x3aa5('0x50')]){if(_0x5d00c4[_0x3aa5('0x50')][_0x3aa5('0x43')](_0x37d575)){var _0x283df4=_0x5d00c4[_0x3aa5('0x50')][_0x37d575];var _0x20ed0f={'id':_0x283df4['id'],'available':_0x283df4['available'],'loggedIn':_0x283df4[_0x3aa5('0x4a')],'name':_0x283df4[_0x3aa5('0x4b')],'paused':_0x283df4[_0x3aa5('0x4e')],'waiting':_0x283df4['waiting']};_0x2acc9f[_0x3aa5('0x23')](_0x20ed0f);}}_0x14737b({'count':_0x2acc9f[_0x3aa5('0x19')],'rows':_0x2acc9f});});},'FaxQueues':function(_0x352643){return new Promise(function(_0x1b09e9,_0x17109d){var _0x551311=[];for(var _0x2831ae in _0x5d00c4[_0x3aa5('0x51')]){if(_0x5d00c4[_0x3aa5('0x51')][_0x3aa5('0x43')](_0x2831ae)){var _0x2b0de4=_0x5d00c4[_0x3aa5('0x51')][_0x2831ae];var _0x43a312={'id':_0x2b0de4['id'],'available':_0x2b0de4[_0x3aa5('0x49')],'loggedIn':_0x2b0de4['loggedIn'],'name':_0x2b0de4[_0x3aa5('0x4b')],'paused':_0x2b0de4['paused'],'waiting':_0x2b0de4['waiting']};_0x551311[_0x3aa5('0x23')](_0x43a312);}}_0x1b09e9({'count':_0x551311[_0x3aa5('0x19')],'rows':_0x551311});});},'ChatQueuesWaitingInteractions':function(_0x231b12){return new Promise(function(_0x1ce39a,_0x26d4e1){var _0x5be4dd=_['values'](_0x5d00c4[_0x3aa5('0x52')]);_0x1ce39a({'count':_0x5be4dd[_0x3aa5('0x19')],'rows':_0x5be4dd});});},'MailQueuesWaitingInteractions':function(_0x4ebe33){return new Promise(function(_0x360847,_0x1f1686){var _0xacb8af=_['values'](_0x5d00c4[_0x3aa5('0x53')]);_0x360847({'count':_0xacb8af['length'],'rows':_0xacb8af});});},'OpenchannelQueuesWaitingInteractions':function(_0x49634e){return new Promise(function(_0xe49f20,_0x30fac2){var _0x2724a7=_[_0x3aa5('0x47')](_0x5d00c4[_0x3aa5('0x54')]);_0xe49f20({'count':_0x2724a7[_0x3aa5('0x19')],'rows':_0x2724a7});});},'SmsQueuesWaitingInteractions':function(_0x35e98e){return new Promise(function(_0x475974,_0x16dc5d){var _0x4db700=_[_0x3aa5('0x47')](_0x5d00c4['smsQueuesWaitingInteractions']);_0x475974({'count':_0x4db700[_0x3aa5('0x19')],'rows':_0x4db700});});},'FaxQueuesWaitingInteractions':function(_0x1f45a8){return new Promise(function(_0x126c4a,_0x4a8897){var _0x7add0a=_['values'](_0x5d00c4[_0x3aa5('0x55')]);_0x126c4a({'count':_0x7add0a['length'],'rows':_0x7add0a});});}};var _0x5fab51=jayson[_0x3aa5('0x56')](_0x302fdf)[_0x3aa5('0x57')]();_0x5fab51['on']('error',function(_0x4d390d){logger[_0x3aa5('0x2e')](JSON[_0x3aa5('0x33')](_0x4d390d));return _0x1fa420(_0x4d390d);});_0x5fab51[_0x3aa5('0x13')](0x232c,_0x3aa5('0x58'),function(){console[_0x3aa5('0x59')](_0x3aa5('0x5a'),0x232c);return _0x43e669(_0x3aa5('0x5b')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 663b423..a81ae79 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 _0xcd23=['when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util','jayson/promise','routing','client','request','then','error','message','result','catch','condition','rules','info','stop','length','push','Command','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','join'];(function(_0x37be36,_0x18fe03){var _0x47108e=function(_0x3f32b6){while(--_0x3f32b6){_0x37be36['push'](_0x37be36['shift']());}};_0x47108e(++_0x18fe03);}(_0xcd23,0x19b));var _0x3cd2=function(_0x218015,_0x5e5289){_0x218015=_0x218015-0x0;var _0xd77e9c=_0xcd23[_0x218015];return _0xd77e9c;};'use strict';var util=require(_0x3cd2('0x0'));var BPromise=require('bluebird');var jayson=require(_0x3cd2('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0x3cd2('0x2'));var client=jayson[_0x3cd2('0x3')]['http']({'port':0x232a});function request(_0x1659ff,_0x3657fa){return new BPromise(function(_0x1958be,_0x47d2d2){return client[_0x3cd2('0x4')](_0x1659ff,_0x3657fa)[_0x3cd2('0x5')](function(_0x4804db){if(_0x4804db[_0x3cd2('0x6')]){return _0x47d2d2(_0x4804db[_0x3cd2('0x6')][_0x3cd2('0x7')]);}else{return _0x1958be(_0x4804db[_0x3cd2('0x8')]);}})[_0x3cd2('0x9')](function(_0x3fa7f7){return _0x47d2d2(_0x3fa7f7);});});}exports[_0x3cd2('0xa')]=function(_0x164962,_0x5bee3d,_0x587911){return function(_0xd98f3b){if(_0x587911[_0x3cd2('0xb')]&&!_0x587911[_0x3cd2('0xb')][_0x164962]){logger[_0x3cd2('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x164962);return _0xd98f3b[_0x3cd2('0xd')]();}var _0x1f6676=[];for(var _0x2c75fe=0x0;_0x2c75fe<_0x5bee3d[_0x3cd2('0xe')];_0x2c75fe+=0x1){_0x1f6676[_0x3cd2('0xf')](request(_0x3cd2('0x10'),{'command':util['format'](_0x3cd2('0x11'),_0x5bee3d[_0x2c75fe])})[_0x3cd2('0x5')](function(_0x5a78b2){return _0x5a78b2&&_0x5a78b2[_0x3cd2('0x7')]&&_0x5a78b2['message'][_0x3cd2('0x12')](_0x3cd2('0x13'))>=0x0?!![]:![];})[_0x3cd2('0x9')](function(_0x185d45){logger[_0x3cd2('0x6')](_0x3cd2('0x14'),_0x164962,_0x5bee3d[_0x2c75fe]);}));}BPromise[_0x3cd2('0x15')](_0x1f6676)[_0x3cd2('0x5')](function(_0x518ac7){var _0x369cc0=_[_0x3cd2('0x16')](_0x518ac7);logger['info']('[%s][INTERVAL]\x20%s\x20%s',_0x164962,_0x5bee3d[_0x3cd2('0x17')]('\x20|\x20'),_0x369cc0);_0xd98f3b[_0x3cd2('0x18')](_0x369cc0);})[_0x3cd2('0x9')](function(_0x337fee){console[_0x3cd2('0x19')](_0x337fee);logger[_0x3cd2('0x6')](_0x3cd2('0x1a'),_0x164962,_0x5bee3d[_0x3cd2('0x17')](_0x3cd2('0x1b')),_0x337fee[_0x3cd2('0x1c')]);_0xd98f3b[_0x3cd2('0xd')]();});};}; \ No newline at end of file +var _0x6bf7=['bluebird','jayson/promise','lodash','routing','client','http','request','error','result','condition','rules','info','stop','length','push','Command','format','iftime\x20%s','then','message','indexOf','true','catch','[%s][INTERVAL]\x20%s','all','join','when','log','[%s][INTERVAL]\x20%s\x20%s','\x20|\x20','stack','util'];(function(_0x1268eb,_0x4c7fe5){var _0x39e5b5=function(_0xfd25f9){while(--_0xfd25f9){_0x1268eb['push'](_0x1268eb['shift']());}};_0x39e5b5(++_0x4c7fe5);}(_0x6bf7,0x9f));var _0x76bf=function(_0x1f7a13,_0x1928f0){_0x1f7a13=_0x1f7a13-0x0;var _0xe564a6=_0x6bf7[_0x1f7a13];return _0xe564a6;};'use strict';var util=require(_0x76bf('0x0'));var BPromise=require(_0x76bf('0x1'));var jayson=require(_0x76bf('0x2'));var _=require(_0x76bf('0x3'));var logger=require('../../../config/logger')(_0x76bf('0x4'));var client=jayson[_0x76bf('0x5')][_0x76bf('0x6')]({'port':0x232a});function request(_0x19e239,_0x17c8ce){return new BPromise(function(_0x4cbbec,_0x5be9a9){return client[_0x76bf('0x7')](_0x19e239,_0x17c8ce)['then'](function(_0x5e6765){if(_0x5e6765[_0x76bf('0x8')]){return _0x5be9a9(_0x5e6765[_0x76bf('0x8')]['message']);}else{return _0x4cbbec(_0x5e6765[_0x76bf('0x9')]);}})['catch'](function(_0x3ffaf5){return _0x5be9a9(_0x3ffaf5);});});}exports[_0x76bf('0xa')]=function(_0x35cea6,_0x3379ea,_0x13e13b){return function(_0x1d0615){if(_0x13e13b[_0x76bf('0xb')]&&!_0x13e13b[_0x76bf('0xb')][_0x35cea6]){logger[_0x76bf('0xc')]('[%s][INTERVAL]\x20ROUTING\x20STOPPED',_0x35cea6);return _0x1d0615[_0x76bf('0xd')]();}var _0x3f1e43=[];for(var _0x426d04=0x0;_0x426d04<_0x3379ea[_0x76bf('0xe')];_0x426d04+=0x1){_0x3f1e43[_0x76bf('0xf')](request(_0x76bf('0x10'),{'command':util[_0x76bf('0x11')](_0x76bf('0x12'),_0x3379ea[_0x426d04])})[_0x76bf('0x13')](function(_0x1a4a97){return _0x1a4a97&&_0x1a4a97['message']&&_0x1a4a97[_0x76bf('0x14')][_0x76bf('0x15')](_0x76bf('0x16'))>=0x0?!![]:![];})[_0x76bf('0x17')](function(_0x3408bd){logger[_0x76bf('0x8')](_0x76bf('0x18'),_0x35cea6,_0x3379ea[_0x426d04]);}));}BPromise[_0x76bf('0x19')](_0x3f1e43)[_0x76bf('0x13')](function(_0x4c1d7e){var _0x9634a7=_['some'](_0x4c1d7e);logger[_0x76bf('0xc')]('[%s][INTERVAL]\x20%s\x20%s',_0x35cea6,_0x3379ea[_0x76bf('0x1a')]('\x20|\x20'),_0x9634a7);_0x1d0615[_0x76bf('0x1b')](_0x9634a7);})[_0x76bf('0x17')](function(_0x8a9bd2){console[_0x76bf('0x1c')](_0x8a9bd2);logger[_0x76bf('0x8')](_0x76bf('0x1d'),_0x35cea6,_0x3379ea[_0x76bf('0x1a')](_0x76bf('0x1e')),_0x8a9bd2[_0x76bf('0x1f')]);_0x1d0615['stop']();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index 6cdf848..83fa304 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 _0xa4e3=['isNil','agentringnoanswerAt','timeout','reason','holdtime','ringtime','talktime','queuecallerabandon','forIn','agentconnect','agentconnectAt','now','connect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcompleteAt','diffTime','transfereruniqueid','transfertype','transferexten','transferuniqueid','attendedtransfer','origtransfererlinkedid','secondtransfereruniqueid','transfer','ATTENDED','origtransfererexten','origtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','agent','complete','lodash','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','calleridnum','connectedlinenum','lastevent','agentacw','agentcomplete','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid','agentcalled','agentcalledAt','called','connectedlinename','error','stack','agentringnoanswer'];(function(_0x5b66b1,_0x3acd9f){var _0x409294=function(_0x52f89d){while(--_0x52f89d){_0x5b66b1['push'](_0x5b66b1['shift']());}};_0x409294(++_0x3acd9f);}(_0xa4e3,0x129));var _0x3a4e=function(_0x420222,_0x209df5){_0x420222=_0x420222-0x0;var _0x2f9237=_0xa4e3[_0x420222];return _0x2f9237;};'use strict';var _=require(_0x3a4e('0x0'));var util=require('util');var utils=require(_0x3a4e('0x1'));var agents={};var transfers={};function writeDB(_0x4c353c,_0x212ed8){utils[_0x3a4e('0x2')](util[_0x3a4e('0x3')](_0x3a4e('0x4'),_0x4c353c[_0x3a4e('0x5')],_0x4c353c[_0x3a4e('0x6')],_0x4c353c[_0x3a4e('0x7')],_0x4c353c[_0x3a4e('0x8')],_0x4c353c[_0x3a4e('0x9')],_0x4c353c[_0x3a4e('0xa')],_0x4c353c[_0x3a4e('0xb')],_0x4c353c[_0x3a4e('0xc')]));if(_0x4c353c[_0x3a4e('0x7')]){utils['getVoiceQueueByName'](_0x4c353c[_0x3a4e('0x7')])['then'](function(_0x4c5b69){if(_0x4c5b69){_0x4c353c['type']=_0x4c5b69['type'];_0x4c353c[_0x3a4e('0xd')]=_0x4c353c[_0x3a4e('0xe')]?_0x4c5b69[_0x3a4e('0xf')]:![];_0x4c353c[_0x3a4e('0x10')]=_0x4c353c[_0x3a4e('0xd')]?_0x4c5b69[_0x3a4e('0x11')]:0x0;}utils[_0x3a4e('0x12')]('CreateVoiceAgentReport',_0x4c353c);});}else{utils[_0x3a4e('0x12')](_0x3a4e('0x13'),_0x4c353c);}if(_0x212ed8){delete transfers[_0x4c353c[_0x3a4e('0x5')]];}else{delete agents[_0x4c353c[_0x3a4e('0x14')]];}}exports[_0x3a4e('0x15')]=function(_0x3f0589){try{agents[_0x3f0589[_0x3a4e('0x14')]]=_0x3f0589;agents[_0x3f0589[_0x3a4e('0x14')]][_0x3a4e('0x16')]=utils['now']();agents[_0x3f0589[_0x3a4e('0x14')]][_0x3a4e('0xc')]=_0x3a4e('0x17');agents[_0x3f0589['destuniqueid']][_0x3a4e('0xb')]=null;agents[_0x3f0589[_0x3a4e('0x14')]][_0x3a4e('0x18')]=null;}catch(_0x1aad4d){utils[_0x3a4e('0x19')](_0x1aad4d[_0x3a4e('0x1a')]);}};exports[_0x3a4e('0x1b')]=function(_0x1f0eb9){try{if(!_[_0x3a4e('0x1c')](agents[_0x1f0eb9[_0x3a4e('0x14')]])){agents[_0x1f0eb9[_0x3a4e('0x14')]][_0x3a4e('0x1b')]=!![];agents[_0x1f0eb9['destuniqueid']][_0x3a4e('0x1d')]=utils['now']();agents[_0x1f0eb9['destuniqueid']]['lastevent']=_0x3a4e('0x1e');agents[_0x1f0eb9[_0x3a4e('0x14')]][_0x3a4e('0x1f')]=_0x3a4e('0x1e');agents[_0x1f0eb9[_0x3a4e('0x14')]][_0x3a4e('0x20')]=_0x1f0eb9[_0x3a4e('0x21')]?parseInt(_0x1f0eb9[_0x3a4e('0x21')])/0x3e8:0x0;agents[_0x1f0eb9[_0x3a4e('0x14')]][_0x3a4e('0x22')]=0x0;writeDB(agents[_0x1f0eb9[_0x3a4e('0x14')]]);}}catch(_0x5c1b81){utils[_0x3a4e('0x19')](_0x5c1b81[_0x3a4e('0x1a')]);}};exports[_0x3a4e('0x23')]=function(_0x26df6f){try{_[_0x3a4e('0x24')](agents,function(_0x529879,_0xba551){if(_0x529879[_0x3a4e('0x5')]==_0x26df6f['uniqueid']){_0x529879['agentringnoanswer']=!![];_0x529879[_0x3a4e('0x1d')]=utils['now']();_0x529879['lastevent']='abandoned';_0x529879[_0x3a4e('0x1f')]='abandoned';_0x529879[_0x3a4e('0x20')]=_0x26df6f[_0x3a4e('0x20')];_0x529879[_0x3a4e('0x22')]=0x0;writeDB(_0x529879);}});}catch(_0x433543){utils['error'](_0x433543['stack']);}};exports[_0x3a4e('0x25')]=function(_0x862c0f){try{if(agents[_0x862c0f['destuniqueid']]){agents[_0x862c0f[_0x3a4e('0x14')]][_0x3a4e('0x26')]=utils[_0x3a4e('0x27')]();agents[_0x862c0f[_0x3a4e('0x14')]][_0x3a4e('0xb')]=_0x862c0f['connectedlinenum'];agents[_0x862c0f[_0x3a4e('0x14')]][_0x3a4e('0x18')]=_0x862c0f[_0x3a4e('0x18')];agents[_0x862c0f[_0x3a4e('0x14')]][_0x3a4e('0x20')]=_0x862c0f['ringtime'];agents[_0x862c0f[_0x3a4e('0x14')]][_0x3a4e('0xc')]=_0x3a4e('0x28');_['forIn'](agents,function(_0x422e09,_0xc34488){if(_0x422e09[_0x3a4e('0x14')]!=_0x862c0f[_0x3a4e('0x14')]&&_0x422e09[_0x3a4e('0x5')]==_0x862c0f[_0x3a4e('0x5')]){_0x422e09[_0x3a4e('0x22')]=0x0;_0x422e09[_0x3a4e('0x20')]=_0x862c0f[_0x3a4e('0x21')];_0x422e09[_0x3a4e('0x1b')]=!![];_0x422e09[_0x3a4e('0x1d')]=utils[_0x3a4e('0x27')]();_0x422e09[_0x3a4e('0xc')]=_0x3a4e('0x29');_0x422e09['reason']='answered_elsewhere';_0x422e09[_0x3a4e('0x2a')]=_0x862c0f['destuniqueid'];_0x422e09[_0x3a4e('0x2b')]=_0x862c0f[_0x3a4e('0x8')];writeDB(_0x422e09);}});}}catch(_0x1e19e8){utils[_0x3a4e('0x19')](_0x1e19e8['stack']);}};exports[_0x3a4e('0xe')]=function(_0x51704c){try{if(!_[_0x3a4e('0x1c')](agents[_0x51704c[_0x3a4e('0x14')]])){agents[_0x51704c['destuniqueid']][_0x3a4e('0xe')]=!![];agents[_0x51704c[_0x3a4e('0x14')]][_0x3a4e('0x2c')]=utils[_0x3a4e('0x27')]();agents[_0x51704c[_0x3a4e('0x14')]]['talktime']=utils[_0x3a4e('0x2d')](agents[_0x51704c[_0x3a4e('0x14')]][_0x3a4e('0x2c')],agents[_0x51704c[_0x3a4e('0x14')]][_0x3a4e('0x26')]);agents[_0x51704c[_0x3a4e('0x14')]][_0x3a4e('0x1f')]=_0x51704c['reason'];agents[_0x51704c[_0x3a4e('0x14')]][_0x3a4e('0xc')]='complete';writeDB(agents[_0x51704c['destuniqueid']]);}}catch(_0x20ca93){utils[_0x3a4e('0x19')](_0x20ca93[_0x3a4e('0x1a')]);}};exports['blindtransfer']=function(_0x3ce827){try{if(!_[_0x3a4e('0x1c')](agents[_0x3ce827[_0x3a4e('0x2e')]])){agents[_0x3ce827[_0x3a4e('0x2e')]]['transfer']=!![];agents[_0x3ce827[_0x3a4e('0x2e')]][_0x3a4e('0x2f')]='blind';agents[_0x3ce827['transfereruniqueid']][_0x3a4e('0x30')]=_0x3ce827['extension'];agents[_0x3ce827['transfereruniqueid']][_0x3a4e('0x31')]=agents[_0x3ce827[_0x3a4e('0x2e')]][_0x3a4e('0x5')];}}catch(_0x40b11a){utils[_0x3a4e('0x19')](_0x40b11a[_0x3a4e('0x1a')]);}};exports[_0x3a4e('0x32')]=function(_0x4eea0d){try{if(_0x4eea0d['origtransfereruniqueid']==_0x4eea0d[_0x3a4e('0x33')]){if(!_['isNil'](agents[_0x4eea0d['secondtransfereruniqueid']])){agents[_0x4eea0d[_0x3a4e('0x34')]][_0x3a4e('0x35')]=!![];agents[_0x4eea0d[_0x3a4e('0x34')]]['transfertype']=_0x3a4e('0x36');agents[_0x4eea0d[_0x3a4e('0x34')]][_0x3a4e('0x30')]=_0x4eea0d[_0x3a4e('0x37')];agents[_0x4eea0d['secondtransfereruniqueid']][_0x3a4e('0x31')]=_0x4eea0d[_0x3a4e('0x38')];}if(_0x4eea0d[_0x3a4e('0x39')]&&agents[_0x4eea0d[_0x3a4e('0x39')]]){agents[_0x4eea0d[_0x3a4e('0x39')]][_0x3a4e('0x3a')]=0x1;transfers[_0x4eea0d[_0x3a4e('0x39')]]=_[_0x3a4e('0x3b')](agents[_0x4eea0d[_0x3a4e('0x39')]]);transfers[_0x4eea0d[_0x3a4e('0x39')]]['calleridnum']=agents[_0x4eea0d[_0x3a4e('0x34')]][_0x3a4e('0xa')];transfers[_0x4eea0d[_0x3a4e('0x39')]][_0x3a4e('0x3c')]=agents[_0x4eea0d['secondtransfereruniqueid']]['calleridname'];transfers[_0x4eea0d[_0x3a4e('0x39')]][_0x3a4e('0x16')]=utils[_0x3a4e('0x27')]();transfers[_0x4eea0d[_0x3a4e('0x39')]][_0x3a4e('0x26')]=utils[_0x3a4e('0x27')]();transfers[_0x4eea0d['transfereeuniqueid']][_0x3a4e('0x20')]=0x0;transfers[_0x4eea0d['transfereeuniqueid']][_0x3a4e('0x3a')]=0x2;}}else if(_0x4eea0d['secondtransfereruniqueid']==_0x4eea0d['secondtransfererlinkedid']){if(!_[_0x3a4e('0x1c')](agents[_0x4eea0d[_0x3a4e('0x38')]])){agents[_0x4eea0d[_0x3a4e('0x38')]][_0x3a4e('0x35')]=!![];agents[_0x4eea0d['origtransfereruniqueid']][_0x3a4e('0x2f')]='ATTENDED';agents[_0x4eea0d['origtransfereruniqueid']][_0x3a4e('0x30')]=_0x4eea0d[_0x3a4e('0x3d')];agents[_0x4eea0d[_0x3a4e('0x38')]][_0x3a4e('0x31')]=_0x4eea0d['secondtransfereruniqueid'];}if(_0x4eea0d[_0x3a4e('0x3e')]&&agents[_0x4eea0d['transfertargetuniqueid']]){agents[_0x4eea0d[_0x3a4e('0x3e')]][_0x3a4e('0x3a')]=0x1;transfers[_0x4eea0d[_0x3a4e('0x3e')]]=_[_0x3a4e('0x3b')](agents[_0x4eea0d[_0x3a4e('0x3e')]]);transfers[_0x4eea0d['transfertargetuniqueid']][_0x3a4e('0xa')]=agents[_0x4eea0d[_0x3a4e('0x38')]]['calleridnum'];transfers[_0x4eea0d[_0x3a4e('0x3e')]][_0x3a4e('0x3c')]=agents[_0x4eea0d[_0x3a4e('0x38')]][_0x3a4e('0x3c')];transfers[_0x4eea0d['transfertargetuniqueid']]['agentcalledAt']=utils[_0x3a4e('0x27')]();transfers[_0x4eea0d['transfertargetuniqueid']][_0x3a4e('0x26')]=utils[_0x3a4e('0x27')]();transfers[_0x4eea0d[_0x3a4e('0x3e')]]['holdtime']=0x0;transfers[_0x4eea0d['transfertargetuniqueid']][_0x3a4e('0x3a')]=0x2;}}}catch(_0x308565){utils[_0x3a4e('0x19')](_0x308565[_0x3a4e('0x1a')]);}};exports['hangup']=function(_0xde9d55){try{if(transfers[_0xde9d55[_0x3a4e('0x5')]]){transfers[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0xe')]=!![];transfers[_0xde9d55['uniqueid']][_0x3a4e('0x2c')]=utils[_0x3a4e('0x27')]();transfers[_0xde9d55['uniqueid']][_0x3a4e('0x22')]=utils[_0x3a4e('0x2d')](transfers[_0xde9d55[_0x3a4e('0x5')]]['agentcompleteAt'],transfers[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x26')]);transfers[_0xde9d55[_0x3a4e('0x5')]]['reason']=_0x3a4e('0x3f');transfers[_0xde9d55['uniqueid']][_0x3a4e('0xc')]=_0x3a4e('0x40');writeDB(transfers[_0xde9d55[_0x3a4e('0x5')]],!![]);}if(agents[_0xde9d55[_0x3a4e('0x5')]]&&agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x26')]){agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0xe')]=!![];agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x2c')]=utils[_0x3a4e('0x27')]();agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x22')]=utils[_0x3a4e('0x2d')](agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x2c')],agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x26')]);agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x1f')]=agents[_0xde9d55[_0x3a4e('0x5')]][_0x3a4e('0x35')]?_0x3a4e('0x35'):_0x3a4e('0x3f');agents[_0xde9d55['uniqueid']][_0x3a4e('0xc')]='complete';writeDB(agents[_0xde9d55['uniqueid']]);}}catch(_0x44401f){utils[_0x3a4e('0x19')](_0x44401f[_0x3a4e('0x1a')]);}}; \ No newline at end of file +var _0xf3a8=['agentringnoanswer','agentringnoanswerAt','timeout','holdtime','ringtime','talktime','queuecallerabandon','uniqueid','reason','agentconnect','agentconnectAt','connectedlinename','connect','forIn','answered_elsewhere','answeredelsewheremembername','isNil','agentcompleteAt','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','secondtransfereruniqueid','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridname','secondtransfererexten','transfertargetuniqueid','hangup','agent','diffTime','complete','util','./utils','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','channel','membername','interface','calleridnum','connectedlinenum','lastevent','queue','getVoiceQueueByName','then','type','agentacw','agentcomplete','acw','acwtime','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','called','error','stack'];(function(_0x53c7bf,_0x551421){var _0x3c40c9=function(_0xb59797){while(--_0xb59797){_0x53c7bf['push'](_0x53c7bf['shift']());}};_0x3c40c9(++_0x551421);}(_0xf3a8,0xf2));var _0x8f3a=function(_0x2a56a5,_0x35ee90){_0x2a56a5=_0x2a56a5-0x0;var _0x4371fb=_0xf3a8[_0x2a56a5];return _0x4371fb;};'use strict';var _=require('lodash');var util=require(_0x8f3a('0x0'));var utils=require(_0x8f3a('0x1'));var agents={};var transfers={};function writeDB(_0x52b2ae,_0xa87ecd){utils['info'](util['format'](_0x8f3a('0x2'),_0x52b2ae['uniqueid'],_0x52b2ae[_0x8f3a('0x3')],_0x52b2ae['queue'],_0x52b2ae[_0x8f3a('0x4')],_0x52b2ae[_0x8f3a('0x5')],_0x52b2ae[_0x8f3a('0x6')],_0x52b2ae[_0x8f3a('0x7')],_0x52b2ae[_0x8f3a('0x8')]));if(_0x52b2ae[_0x8f3a('0x9')]){utils[_0x8f3a('0xa')](_0x52b2ae[_0x8f3a('0x9')])[_0x8f3a('0xb')](function(_0x59437b){if(_0x59437b){_0x52b2ae[_0x8f3a('0xc')]=_0x59437b['type'];_0x52b2ae[_0x8f3a('0xd')]=_0x52b2ae[_0x8f3a('0xe')]?_0x59437b[_0x8f3a('0xf')]:![];_0x52b2ae[_0x8f3a('0x10')]=_0x52b2ae[_0x8f3a('0xd')]?_0x59437b['acwTimeout']:0x0;}utils[_0x8f3a('0x11')](_0x8f3a('0x12'),_0x52b2ae);});}else{utils['request'](_0x8f3a('0x12'),_0x52b2ae);}if(_0xa87ecd){delete transfers[_0x52b2ae['uniqueid']];}else{delete agents[_0x52b2ae['destuniqueid']];}}exports[_0x8f3a('0x13')]=function(_0x2138c7){try{agents[_0x2138c7['destuniqueid']]=_0x2138c7;agents[_0x2138c7[_0x8f3a('0x14')]][_0x8f3a('0x15')]=utils[_0x8f3a('0x16')]();agents[_0x2138c7['destuniqueid']][_0x8f3a('0x8')]=_0x8f3a('0x17');agents[_0x2138c7['destuniqueid']][_0x8f3a('0x7')]=null;agents[_0x2138c7[_0x8f3a('0x14')]]['connectedlinename']=null;}catch(_0x2a491a){utils[_0x8f3a('0x18')](_0x2a491a[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x1a')]=function(_0x2a7c0c){try{if(!_['isNil'](agents[_0x2a7c0c[_0x8f3a('0x14')]])){agents[_0x2a7c0c[_0x8f3a('0x14')]][_0x8f3a('0x1a')]=!![];agents[_0x2a7c0c[_0x8f3a('0x14')]][_0x8f3a('0x1b')]=utils[_0x8f3a('0x16')]();agents[_0x2a7c0c['destuniqueid']][_0x8f3a('0x8')]=_0x8f3a('0x1c');agents[_0x2a7c0c[_0x8f3a('0x14')]]['reason']=_0x8f3a('0x1c');agents[_0x2a7c0c['destuniqueid']][_0x8f3a('0x1d')]=_0x2a7c0c[_0x8f3a('0x1e')]?parseInt(_0x2a7c0c[_0x8f3a('0x1e')])/0x3e8:0x0;agents[_0x2a7c0c[_0x8f3a('0x14')]][_0x8f3a('0x1f')]=0x0;writeDB(agents[_0x2a7c0c['destuniqueid']]);}}catch(_0x5a6177){utils[_0x8f3a('0x18')](_0x5a6177[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x20')]=function(_0x36b477){try{_['forIn'](agents,function(_0x556a88,_0x37f23b){if(_0x556a88['uniqueid']==_0x36b477[_0x8f3a('0x21')]){_0x556a88[_0x8f3a('0x1a')]=!![];_0x556a88['agentringnoanswerAt']=utils['now']();_0x556a88['lastevent']='abandoned';_0x556a88[_0x8f3a('0x22')]='abandoned';_0x556a88['holdtime']=_0x36b477[_0x8f3a('0x1d')];_0x556a88[_0x8f3a('0x1f')]=0x0;writeDB(_0x556a88);}});}catch(_0xb767c){utils[_0x8f3a('0x18')](_0xb767c[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x23')]=function(_0x108938){try{if(agents[_0x108938[_0x8f3a('0x14')]]){agents[_0x108938[_0x8f3a('0x14')]][_0x8f3a('0x24')]=utils['now']();agents[_0x108938[_0x8f3a('0x14')]]['connectedlinenum']=_0x108938[_0x8f3a('0x7')];agents[_0x108938[_0x8f3a('0x14')]][_0x8f3a('0x25')]=_0x108938[_0x8f3a('0x25')];agents[_0x108938[_0x8f3a('0x14')]]['holdtime']=_0x108938[_0x8f3a('0x1e')];agents[_0x108938[_0x8f3a('0x14')]][_0x8f3a('0x8')]=_0x8f3a('0x26');_[_0x8f3a('0x27')](agents,function(_0x49c75a,_0x2ca2f1){if(_0x49c75a[_0x8f3a('0x14')]!=_0x108938[_0x8f3a('0x14')]&&_0x49c75a[_0x8f3a('0x21')]==_0x108938[_0x8f3a('0x21')]){_0x49c75a[_0x8f3a('0x1f')]=0x0;_0x49c75a[_0x8f3a('0x1d')]=_0x108938[_0x8f3a('0x1e')];_0x49c75a['agentringnoanswer']=!![];_0x49c75a['agentringnoanswerAt']=utils['now']();_0x49c75a[_0x8f3a('0x8')]=_0x8f3a('0x28');_0x49c75a[_0x8f3a('0x22')]=_0x8f3a('0x28');_0x49c75a['answeredelsewheredestinationuniqueid']=_0x108938[_0x8f3a('0x14')];_0x49c75a[_0x8f3a('0x29')]=_0x108938[_0x8f3a('0x4')];writeDB(_0x49c75a);}});}}catch(_0x123db1){utils[_0x8f3a('0x18')](_0x123db1[_0x8f3a('0x19')]);}};exports[_0x8f3a('0xe')]=function(_0x5c3cd8){try{if(!_[_0x8f3a('0x2a')](agents[_0x5c3cd8[_0x8f3a('0x14')]])){agents[_0x5c3cd8[_0x8f3a('0x14')]]['agentcomplete']=!![];agents[_0x5c3cd8[_0x8f3a('0x14')]][_0x8f3a('0x2b')]=utils[_0x8f3a('0x16')]();agents[_0x5c3cd8[_0x8f3a('0x14')]][_0x8f3a('0x1f')]=utils['diffTime'](agents[_0x5c3cd8['destuniqueid']][_0x8f3a('0x2b')],agents[_0x5c3cd8[_0x8f3a('0x14')]][_0x8f3a('0x24')]);agents[_0x5c3cd8[_0x8f3a('0x14')]][_0x8f3a('0x22')]=_0x5c3cd8[_0x8f3a('0x22')];agents[_0x5c3cd8[_0x8f3a('0x14')]][_0x8f3a('0x8')]='complete';writeDB(agents[_0x5c3cd8[_0x8f3a('0x14')]]);}}catch(_0x544db7){utils[_0x8f3a('0x18')](_0x544db7[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x2c')]=function(_0x547c5f){try{if(!_[_0x8f3a('0x2a')](agents[_0x547c5f[_0x8f3a('0x2d')]])){agents[_0x547c5f[_0x8f3a('0x2d')]][_0x8f3a('0x2e')]=!![];agents[_0x547c5f[_0x8f3a('0x2d')]][_0x8f3a('0x2f')]=_0x8f3a('0x30');agents[_0x547c5f[_0x8f3a('0x2d')]][_0x8f3a('0x31')]=_0x547c5f[_0x8f3a('0x32')];agents[_0x547c5f[_0x8f3a('0x2d')]][_0x8f3a('0x33')]=agents[_0x547c5f[_0x8f3a('0x2d')]]['uniqueid'];}}catch(_0x2aa992){utils[_0x8f3a('0x18')](_0x2aa992[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x34')]=function(_0x2bed96){try{if(_0x2bed96[_0x8f3a('0x35')]==_0x2bed96['origtransfererlinkedid']){if(!_['isNil'](agents[_0x2bed96[_0x8f3a('0x36')]])){agents[_0x2bed96[_0x8f3a('0x36')]]['transfer']=!![];agents[_0x2bed96[_0x8f3a('0x36')]][_0x8f3a('0x2f')]=_0x8f3a('0x37');agents[_0x2bed96[_0x8f3a('0x36')]][_0x8f3a('0x31')]=_0x2bed96[_0x8f3a('0x38')];agents[_0x2bed96[_0x8f3a('0x36')]][_0x8f3a('0x33')]=_0x2bed96['origtransfereruniqueid'];}if(_0x2bed96[_0x8f3a('0x39')]&&agents[_0x2bed96[_0x8f3a('0x39')]]){agents[_0x2bed96['transfereeuniqueid']][_0x8f3a('0x3a')]=0x1;transfers[_0x2bed96[_0x8f3a('0x39')]]=_[_0x8f3a('0x3b')](agents[_0x2bed96[_0x8f3a('0x39')]]);transfers[_0x2bed96['transfereeuniqueid']][_0x8f3a('0x6')]=agents[_0x2bed96['secondtransfereruniqueid']][_0x8f3a('0x6')];transfers[_0x2bed96[_0x8f3a('0x39')]][_0x8f3a('0x3c')]=agents[_0x2bed96[_0x8f3a('0x36')]][_0x8f3a('0x3c')];transfers[_0x2bed96[_0x8f3a('0x39')]][_0x8f3a('0x15')]=utils[_0x8f3a('0x16')]();transfers[_0x2bed96[_0x8f3a('0x39')]][_0x8f3a('0x24')]=utils[_0x8f3a('0x16')]();transfers[_0x2bed96[_0x8f3a('0x39')]]['holdtime']=0x0;transfers[_0x2bed96['transfereeuniqueid']][_0x8f3a('0x3a')]=0x2;}}else if(_0x2bed96['secondtransfereruniqueid']==_0x2bed96['secondtransfererlinkedid']){if(!_[_0x8f3a('0x2a')](agents[_0x2bed96[_0x8f3a('0x35')]])){agents[_0x2bed96['origtransfereruniqueid']][_0x8f3a('0x2e')]=!![];agents[_0x2bed96[_0x8f3a('0x35')]][_0x8f3a('0x2f')]=_0x8f3a('0x37');agents[_0x2bed96[_0x8f3a('0x35')]][_0x8f3a('0x31')]=_0x2bed96[_0x8f3a('0x3d')];agents[_0x2bed96['origtransfereruniqueid']][_0x8f3a('0x33')]=_0x2bed96[_0x8f3a('0x36')];}if(_0x2bed96['transfertargetuniqueid']&&agents[_0x2bed96[_0x8f3a('0x3e')]]){agents[_0x2bed96[_0x8f3a('0x3e')]][_0x8f3a('0x3a')]=0x1;transfers[_0x2bed96[_0x8f3a('0x3e')]]=_['clone'](agents[_0x2bed96[_0x8f3a('0x3e')]]);transfers[_0x2bed96[_0x8f3a('0x3e')]][_0x8f3a('0x6')]=agents[_0x2bed96['origtransfereruniqueid']][_0x8f3a('0x6')];transfers[_0x2bed96[_0x8f3a('0x3e')]]['calleridname']=agents[_0x2bed96[_0x8f3a('0x35')]][_0x8f3a('0x3c')];transfers[_0x2bed96['transfertargetuniqueid']][_0x8f3a('0x15')]=utils[_0x8f3a('0x16')]();transfers[_0x2bed96['transfertargetuniqueid']][_0x8f3a('0x24')]=utils[_0x8f3a('0x16')]();transfers[_0x2bed96[_0x8f3a('0x3e')]][_0x8f3a('0x1d')]=0x0;transfers[_0x2bed96[_0x8f3a('0x3e')]][_0x8f3a('0x3a')]=0x2;}}}catch(_0x232e9b){utils[_0x8f3a('0x18')](_0x232e9b[_0x8f3a('0x19')]);}};exports[_0x8f3a('0x3f')]=function(_0x544878){try{if(transfers[_0x544878[_0x8f3a('0x21')]]){transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0xe')]=!![];transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x2b')]=utils[_0x8f3a('0x16')]();transfers[_0x544878['uniqueid']][_0x8f3a('0x1f')]=utils['diffTime'](transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x2b')],transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x24')]);transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x22')]=_0x8f3a('0x40');transfers[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x8')]='complete';writeDB(transfers[_0x544878[_0x8f3a('0x21')]],!![]);}if(agents[_0x544878[_0x8f3a('0x21')]]&&agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x24')]){agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0xe')]=!![];agents[_0x544878[_0x8f3a('0x21')]]['agentcompleteAt']=utils[_0x8f3a('0x16')]();agents[_0x544878['uniqueid']][_0x8f3a('0x1f')]=utils[_0x8f3a('0x41')](agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x2b')],agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x24')]);agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x22')]=agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x2e')]?'transfer':_0x8f3a('0x40');agents[_0x544878[_0x8f3a('0x21')]][_0x8f3a('0x8')]=_0x8f3a('0x42');writeDB(agents[_0x544878[_0x8f3a('0x21')]]);}}catch(_0x37a82b){utils[_0x8f3a('0x18')](_0x37a82b[_0x8f3a('0x19')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index 3b44cc6..dabe7ed 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 _0x015f=['NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','format','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','accountcode','source','destination','callerid','disposition','then','UserId','CreateVoiceCallReport','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','context','now','DOCUMENTATION','stack','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','error','calleridname','endtime','diffTime','starttime','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstop','musiconholdstartAt','mohtime','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','xmd-queue','xmcs-queue','lastapplication','xmd-contactid','xmd-cdrtype','outboundrouteid','sipcallid','newexten','application','set','appdata','toLowerCase','split','substring','lastIndexOf','includes','hangup','noop','execif','gotoif','lastdata','./utils'];(function(_0x55fa6f,_0x4154f9){var _0x2180ac=function(_0x54c5a0){while(--_0x54c5a0){_0x55fa6f['push'](_0x55fa6f['shift']());}};_0x2180ac(++_0x4154f9);}(_0x015f,0x17b));var _0xf015=function(_0x142d3e,_0x353e86){_0x142d3e=_0x142d3e-0x0;var _0x493084=_0x015f[_0x142d3e];return _0x493084;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xf015('0x0'));var dispositions=[_0xf015('0x1'),_0xf015('0x2'),_0xf015('0x2'),_0xf015('0x1'),_0xf015('0x1'),_0xf015('0x1'),_0xf015('0x3'),_0xf015('0x4'),_0xf015('0x2'),_0xf015('0x2'),_0xf015('0x2')];var channels={};function writeDB(_0x267176){utils[_0xf015('0x5')](util[_0xf015('0x6')](_0xf015('0x7'),_0x267176[_0xf015('0x8')],_0x267176[_0xf015('0x9')],_0x267176['type'],_0x267176[_0xf015('0xa')],_0x267176[_0xf015('0xb')],_0x267176[_0xf015('0xc')],_0x267176[_0xf015('0xd')],_0x267176[_0xf015('0xe')]));if(_0x267176['accountcode']){utils['getUserByInternal'](_0x267176[_0xf015('0xa')])[_0xf015('0xf')](function(_0x571e58){if(_0x571e58){_0x267176[_0xf015('0x10')]=_0x571e58['id'];}utils['request']('CreateVoiceCallReport',_0x267176);});}else{utils['request'](_0xf015('0x11'),_0x267176);}if(channels[_0x267176[_0xf015('0x8')]]){delete channels[_0x267176['uniqueid']];}}exports[_0xf015('0x12')]=function(_0x3d309a){try{if(_0x3d309a['uniqueid']==_0x3d309a[_0xf015('0x13')]&&_0x3d309a['channel']!=_0xf015('0x14')){channels[_0x3d309a[_0xf015('0x8')]]={'uniqueid':_0x3d309a[_0xf015('0x8')],'accountcode':_0x3d309a[_0xf015('0xa')],'source':_0x3d309a[_0xf015('0x15')],'destination':_0x3d309a['exten'],'destinationcontext':_0x3d309a[_0xf015('0x16')],'channel':_0x3d309a[_0xf015('0x9')],'starttime':utils[_0xf015('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':'NO\x20ANSWER','amaflags':_0xf015('0x18')};}}catch(_0x526a14){utils['error'](_0x526a14[_0xf015('0x19')]);}};exports[_0xf015('0x1a')]=function(_0x323c49){try{if(!_[_0xf015('0x1b')](channels[_0x323c49[_0xf015('0x8')]])&&_0x323c49[_0xf015('0x1c')]==0x6){if(_[_0xf015('0x1b')](channels[_0x323c49[_0xf015('0x8')]][_0xf015('0x1d')])){channels[_0x323c49[_0xf015('0x8')]][_0xf015('0x1d')]=utils[_0xf015('0x17')]();}}else if(!_['isNil'](channels[_0x323c49[_0xf015('0x13')]])&&_0x323c49[_0xf015('0x1c')]==0x6&&_0x323c49['context']!=_0xf015('0x1e')){channels[_0x323c49[_0xf015('0x13')]]['accountcode']=_0x323c49[_0xf015('0xa')];channels[_0x323c49[_0xf015('0x13')]][_0xf015('0x1f')]=_0x323c49[_0xf015('0x9')];if(_['isNil'](channels[_0x323c49['linkedid']][_0xf015('0x20')])){channels[_0x323c49[_0xf015('0x13')]][_0xf015('0x20')]=utils['now']();}channels[_0x323c49[_0xf015('0x13')]][_0xf015('0xe')]=dispositions[_['toNumber'](_0x323c49[_0xf015('0x1c')])]||_0xf015('0x3');}}catch(_0x3bae94){utils[_0xf015('0x21')](_0x3bae94[_0xf015('0x19')]);}};exports['hangup']=function(_0x442417){try{if(!_[_0xf015('0x1b')](channels[_0x442417[_0xf015('0x8')]])){if(_[_0xf015('0x1b')](channels[_0x442417[_0xf015('0x8')]][_0xf015('0xd')])){channels[_0x442417[_0xf015('0x8')]][_0xf015('0xd')]=_0x442417[_0xf015('0x22')]+'\x20<'+_0x442417[_0xf015('0x15')]+'>';}channels[_0x442417[_0xf015('0x8')]][_0xf015('0x23')]=utils[_0xf015('0x17')]();channels[_0x442417[_0xf015('0x8')]]['duration']=utils[_0xf015('0x24')](channels[_0x442417['uniqueid']][_0xf015('0x23')],channels[_0x442417[_0xf015('0x8')]][_0xf015('0x25')]);channels[_0x442417[_0xf015('0x8')]]['billableseconds']=channels[_0x442417[_0xf015('0x8')]][_0xf015('0x20')]?utils[_0xf015('0x24')](channels[_0x442417['uniqueid']][_0xf015('0x23')],channels[_0x442417['uniqueid']][_0xf015('0x20')]):0x0;writeDB(channels[_0x442417['uniqueid']]);}}catch(_0x5aa40c){utils[_0xf015('0x21')](_0x5aa40c[_0xf015('0x19')]);}};exports[_0xf015('0x26')]=function(_0x5deda0){try{if(!_[_0xf015('0x1b')](channels[_0x5deda0[_0xf015('0x27')]])){if(channels[_0x5deda0[_0xf015('0x27')]]['channel']==_0x5deda0['transfereechannel']){channels[_0x5deda0[_0xf015('0x27')]][_0xf015('0x1f')]=_0x5deda0[_0xf015('0x28')];channels[_0x5deda0[_0xf015('0x27')]][_0xf015('0x29')]=_0xf015('0x2a');}else if(channels[_0x5deda0[_0xf015('0x27')]][_0xf015('0x9')]=_0x5deda0['transfertargetchannel']){channels[_0x5deda0[_0xf015('0x27')]][_0xf015('0x1f')]=_0x5deda0[_0xf015('0x2b')];channels[_0x5deda0[_0xf015('0x27')]][_0xf015('0x29')]='_attended';}}}catch(_0x49211a){utils['error'](_0x49211a[_0xf015('0x19')]);}};exports[_0xf015('0x2c')]=function(_0x3bd228){try{if(!_['isNil'](channels[_0x3bd228[_0xf015('0x8')]])){channels[_0x3bd228['uniqueid']]['musiconholdstartAt']=utils['now']();}}catch(_0x3b0fde){utils[_0xf015('0x21')](_0x3b0fde[_0xf015('0x19')]);}};exports[_0xf015('0x2d')]=function(_0x3d9526){try{if(!_[_0xf015('0x1b')](channels[_0x3d9526[_0xf015('0x8')]])){if(!_[_0xf015('0x1b')](channels[_0x3d9526[_0xf015('0x8')]][_0xf015('0x2e')])){channels[_0x3d9526['uniqueid']][_0xf015('0x2f')]+=utils[_0xf015('0x24')](utils['now'](),channels[_0x3d9526[_0xf015('0x8')]][_0xf015('0x2e')]);delete channels[_0x3d9526['uniqueid']][_0xf015('0x2e')];}}}catch(_0xb6bddc){utils['error'](_0xb6bddc[_0xf015('0x19')]);}};exports[_0xf015('0x30')]=function(_0x40259c){try{if(!_['isNil'](channels[_0x40259c[_0xf015('0x8')]])){if(!_[_0xf015('0x1b')](_0x40259c[_0xf015('0x31')]['xmd-originatecalleridnum'])){channels[_0x40259c['uniqueid']]['source']=_0x40259c[_0xf015('0x32')];}if(!_['isNil'](_0x40259c[_0xf015('0x31')][_0xf015('0x33')])){channels[_0x40259c[_0xf015('0x8')]][_0xf015('0xc')]=_0x40259c[_0xf015('0x32')];channels[_0x40259c[_0xf015('0x8')]][_0xf015('0xd')]='\x22'+_0x40259c[_0xf015('0x32')]+_0xf015('0x34')+_0x40259c[_0xf015('0x32')]+'>';}if(!_['isNil'](_0x40259c['variable'][_0xf015('0x35')])||!_[_0xf015('0x1b')](_0x40259c[_0xf015('0x31')][_0xf015('0x36')])){channels[_0x40259c[_0xf015('0x8')]][_0xf015('0xd')]=_0x40259c[_0xf015('0x32')];}if(!_['isNil'](_0x40259c[_0xf015('0x31')][_0xf015('0x37')])||!_[_0xf015('0x1b')](_0x40259c['variable'][_0xf015('0x38')])){channels[_0x40259c[_0xf015('0x8')]][_0xf015('0x39')]='Queue';channels[_0x40259c['uniqueid']]['lastdata']=_0x40259c[_0xf015('0x32')];channels[_0x40259c['uniqueid']]['queue']=!![];}if(!_[_0xf015('0x1b')](_0x40259c[_0xf015('0x31')][_0xf015('0x3a')])){channels[_0x40259c[_0xf015('0x8')]]['ContactId']=_0x40259c[_0xf015('0x32')];}if(!_['isNil'](_0x40259c[_0xf015('0x31')][_0xf015('0x3b')])){channels[_0x40259c['uniqueid']]['type']=_0x40259c[_0xf015('0x32')];}if(!_[_0xf015('0x1b')](_0x40259c[_0xf015('0x31')][_0xf015('0x3c')])){channels[_0x40259c['uniqueid']]['routeid']=_0x40259c['value'];}if(!_['isNil'](_0x40259c[_0xf015('0x31')][_0xf015('0x3d')])){channels[_0x40259c[_0xf015('0x8')]][_0xf015('0x3d')]=_0x40259c[_0xf015('0x32')];}}}catch(_0x354aa5){utils['error'](_0x354aa5[_0xf015('0x19')]);}};exports[_0xf015('0x3e')]=function(_0xbe7a4f){try{if(!_['isNil'](channels[_0xbe7a4f[_0xf015('0x8')]])){if(_0xbe7a4f[_0xf015('0x3f')]['toLowerCase']()==_0xf015('0x40')&&_['startsWith'](_0xbe7a4f[_0xf015('0x41')][_0xf015('0x42')](),'cdr')){var _0x436699=_0xbe7a4f[_0xf015('0x41')][_0xf015('0x43')]('=');var _0x1f5a58=_0x436699[0x0][_0xf015('0x44')](_0x436699[0x0]['lastIndexOf']('(')+0x1,_0x436699[0x0][_0xf015('0x45')](')'));var _0x333aec=_0x436699[0x1];channels[_0xbe7a4f['uniqueid']][_0x1f5a58]=_0x333aec;}if(!_[_0xf015('0x46')]([_0xf015('0x47'),_0xf015('0x48'),_0xf015('0x49'),_0xf015('0x40'),_0xf015('0x4a')],_0xbe7a4f[_0xf015('0x3f')][_0xf015('0x42')]())){channels[_0xbe7a4f['uniqueid']][_0xf015('0x39')]=_0xbe7a4f['application'];channels[_0xbe7a4f['uniqueid']][_0xf015('0x4b')]=_0xbe7a4f[_0xf015('0x41')];}}}catch(_0x363065){utils['error'](_0x363065[_0xf015('0x19')]);}}; \ No newline at end of file +var _0x9e87=['xmd-originatecalleridnum','value','\x22\x20<','xmd-callerid-preview','xmd-queue','lastapplication','Queue','lastdata','xmd-contactid','ContactId','routeid','sipcallid','application','toLowerCase','appdata','cdr','substring','lastIndexOf','includes','noop','execif','gotoif','lodash','util','./utils','NO\x20ANSWER','FAILED','ANSWERED','BUSY','type','accountcode','source','destination','callerid','disposition','getUserByInternal','then','UserId','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','channel','calleridnum','exten','context','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','now','toNumber','stack','hangup','calleridname','endtime','duration','starttime','answertime','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','origtransfererchannel','_attended','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable'];(function(_0x5da0d9,_0x49ee54){var _0x4b6d2f=function(_0x9832cf){while(--_0x9832cf){_0x5da0d9['push'](_0x5da0d9['shift']());}};_0x4b6d2f(++_0x49ee54);}(_0x9e87,0xfa));var _0x79e8=function(_0x533d54,_0x29c8ab){_0x533d54=_0x533d54-0x0;var _0x4e03f5=_0x9e87[_0x533d54];return _0x4e03f5;};'use strict';var _=require(_0x79e8('0x0'));var util=require(_0x79e8('0x1'));var utils=require(_0x79e8('0x2'));var dispositions=[_0x79e8('0x3'),_0x79e8('0x4'),_0x79e8('0x4'),_0x79e8('0x3'),_0x79e8('0x3'),'NO\x20ANSWER',_0x79e8('0x5'),_0x79e8('0x6'),_0x79e8('0x4'),_0x79e8('0x4'),'FAILED'];var channels={};function writeDB(_0x14ed9a){utils['info'](util['format']('CALL|%s|%s|%s|%s|%s|%s|%s|%s',_0x14ed9a['uniqueid'],_0x14ed9a['channel'],_0x14ed9a[_0x79e8('0x7')],_0x14ed9a[_0x79e8('0x8')],_0x14ed9a[_0x79e8('0x9')],_0x14ed9a[_0x79e8('0xa')],_0x14ed9a[_0x79e8('0xb')],_0x14ed9a[_0x79e8('0xc')]));if(_0x14ed9a[_0x79e8('0x8')]){utils[_0x79e8('0xd')](_0x14ed9a[_0x79e8('0x8')])[_0x79e8('0xe')](function(_0x2bc74d){if(_0x2bc74d){_0x14ed9a[_0x79e8('0xf')]=_0x2bc74d['id'];}utils[_0x79e8('0x10')](_0x79e8('0x11'),_0x14ed9a);});}else{utils[_0x79e8('0x10')](_0x79e8('0x11'),_0x14ed9a);}if(channels[_0x14ed9a[_0x79e8('0x12')]]){delete channels[_0x14ed9a[_0x79e8('0x12')]];}}exports[_0x79e8('0x13')]=function(_0x580cfb){try{if(_0x580cfb[_0x79e8('0x12')]==_0x580cfb[_0x79e8('0x14')]&&_0x580cfb[_0x79e8('0x15')]!='OutgoingSpoolFailed'){channels[_0x580cfb[_0x79e8('0x12')]]={'uniqueid':_0x580cfb[_0x79e8('0x12')],'accountcode':_0x580cfb[_0x79e8('0x8')],'source':_0x580cfb[_0x79e8('0x16')],'destination':_0x580cfb[_0x79e8('0x17')],'destinationcontext':_0x580cfb[_0x79e8('0x18')],'channel':_0x580cfb[_0x79e8('0x15')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x79e8('0x3'),'amaflags':_0x79e8('0x19')};}}catch(_0x5651b5){utils[_0x79e8('0x1a')](_0x5651b5['stack']);}};exports[_0x79e8('0x1b')]=function(_0xe5179e){try{if(!_[_0x79e8('0x1c')](channels[_0xe5179e[_0x79e8('0x12')]])&&_0xe5179e[_0x79e8('0x1d')]==0x6){if(_[_0x79e8('0x1c')](channels[_0xe5179e[_0x79e8('0x12')]][_0x79e8('0x1e')])){channels[_0xe5179e[_0x79e8('0x12')]]['systemanswertime']=utils[_0x79e8('0x1f')]();}}else if(!_[_0x79e8('0x1c')](channels[_0xe5179e['linkedid']])&&_0xe5179e[_0x79e8('0x1d')]==0x6&&_0xe5179e[_0x79e8('0x18')]!='transfer'){channels[_0xe5179e['linkedid']][_0x79e8('0x8')]=_0xe5179e['accountcode'];channels[_0xe5179e[_0x79e8('0x14')]]['destinationchannel']=_0xe5179e[_0x79e8('0x15')];if(_[_0x79e8('0x1c')](channels[_0xe5179e['linkedid']]['answertime'])){channels[_0xe5179e[_0x79e8('0x14')]]['answertime']=utils[_0x79e8('0x1f')]();}channels[_0xe5179e['linkedid']]['disposition']=dispositions[_[_0x79e8('0x20')](_0xe5179e['channelstate'])]||_0x79e8('0x5');}}catch(_0x1c68cc){utils[_0x79e8('0x1a')](_0x1c68cc[_0x79e8('0x21')]);}};exports[_0x79e8('0x22')]=function(_0x49de20){try{if(!_[_0x79e8('0x1c')](channels[_0x49de20['uniqueid']])){if(_[_0x79e8('0x1c')](channels[_0x49de20['uniqueid']][_0x79e8('0xb')])){channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0xb')]=_0x49de20[_0x79e8('0x23')]+'\x20<'+_0x49de20[_0x79e8('0x16')]+'>';}channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0x24')]=utils[_0x79e8('0x1f')]();channels[_0x49de20['uniqueid']][_0x79e8('0x25')]=utils['diffTime'](channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0x24')],channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0x26')]);channels[_0x49de20[_0x79e8('0x12')]]['billableseconds']=channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0x27')]?utils['diffTime'](channels[_0x49de20['uniqueid']][_0x79e8('0x24')],channels[_0x49de20[_0x79e8('0x12')]][_0x79e8('0x27')]):0x0;writeDB(channels[_0x49de20[_0x79e8('0x12')]]);}}catch(_0x502397){utils[_0x79e8('0x1a')](_0x502397['stack']);}};exports[_0x79e8('0x28')]=function(_0x16c31d){try{if(!_[_0x79e8('0x1c')](channels[_0x16c31d[_0x79e8('0x29')]])){if(channels[_0x16c31d[_0x79e8('0x29')]]['channel']==_0x16c31d[_0x79e8('0x2a')]){channels[_0x16c31d[_0x79e8('0x29')]][_0x79e8('0x2b')]=_0x16c31d[_0x79e8('0x2c')];channels[_0x16c31d['localtwolinkedid']][_0x79e8('0x2d')]='_attended';}else if(channels[_0x16c31d[_0x79e8('0x29')]]['channel']=_0x16c31d['transfertargetchannel']){channels[_0x16c31d['localtwolinkedid']][_0x79e8('0x2b')]=_0x16c31d[_0x79e8('0x2e')];channels[_0x16c31d[_0x79e8('0x29')]][_0x79e8('0x2d')]=_0x79e8('0x2f');}}}catch(_0x52ccb0){utils['error'](_0x52ccb0['stack']);}};exports[_0x79e8('0x30')]=function(_0x13e829){try{if(!_['isNil'](channels[_0x13e829[_0x79e8('0x12')]])){channels[_0x13e829['uniqueid']][_0x79e8('0x31')]=utils['now']();}}catch(_0xf5ad9f){utils[_0x79e8('0x1a')](_0xf5ad9f[_0x79e8('0x21')]);}};exports[_0x79e8('0x32')]=function(_0x4693db){try{if(!_[_0x79e8('0x1c')](channels[_0x4693db[_0x79e8('0x12')]])){if(!_[_0x79e8('0x1c')](channels[_0x4693db[_0x79e8('0x12')]][_0x79e8('0x31')])){channels[_0x4693db[_0x79e8('0x12')]][_0x79e8('0x33')]+=utils['diffTime'](utils[_0x79e8('0x1f')](),channels[_0x4693db[_0x79e8('0x12')]][_0x79e8('0x31')]);delete channels[_0x4693db[_0x79e8('0x12')]][_0x79e8('0x31')];}}}catch(_0x4ebbcc){utils[_0x79e8('0x1a')](_0x4ebbcc[_0x79e8('0x21')]);}};exports[_0x79e8('0x34')]=function(_0x45289e){try{if(!_['isNil'](channels[_0x45289e[_0x79e8('0x12')]])){if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')][_0x79e8('0x36')])){channels[_0x45289e[_0x79e8('0x12')]]['source']=_0x45289e[_0x79e8('0x37')];}if(!_['isNil'](_0x45289e[_0x79e8('0x35')]['xmd-phone'])){channels[_0x45289e[_0x79e8('0x12')]]['destination']=_0x45289e[_0x79e8('0x37')];channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0xb')]='\x22'+_0x45289e[_0x79e8('0x37')]+_0x79e8('0x38')+_0x45289e[_0x79e8('0x37')]+'>';}if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')][_0x79e8('0x39')])||!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')]['xmd-callerid'])){channels[_0x45289e['uniqueid']]['callerid']=_0x45289e[_0x79e8('0x37')];}if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')][_0x79e8('0x3a')])||!_['isNil'](_0x45289e[_0x79e8('0x35')]['xmcs-queue'])){channels[_0x45289e['uniqueid']][_0x79e8('0x3b')]=_0x79e8('0x3c');channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0x3d')]=_0x45289e['value'];channels[_0x45289e['uniqueid']]['queue']=!![];}if(!_[_0x79e8('0x1c')](_0x45289e['variable'][_0x79e8('0x3e')])){channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0x3f')]=_0x45289e[_0x79e8('0x37')];}if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')]['xmd-cdrtype'])){channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0x7')]=_0x45289e[_0x79e8('0x37')];}if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')]['outboundrouteid'])){channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0x40')]=_0x45289e[_0x79e8('0x37')];}if(!_[_0x79e8('0x1c')](_0x45289e[_0x79e8('0x35')]['sipcallid'])){channels[_0x45289e[_0x79e8('0x12')]][_0x79e8('0x41')]=_0x45289e[_0x79e8('0x37')];}}}catch(_0x2fb662){utils[_0x79e8('0x1a')](_0x2fb662['stack']);}};exports['newexten']=function(_0x30d1ce){try{if(!_['isNil'](channels[_0x30d1ce[_0x79e8('0x12')]])){if(_0x30d1ce[_0x79e8('0x42')][_0x79e8('0x43')]()=='set'&&_['startsWith'](_0x30d1ce[_0x79e8('0x44')][_0x79e8('0x43')](),_0x79e8('0x45'))){var _0x29d832=_0x30d1ce[_0x79e8('0x44')]['split']('=');var _0x48de85=_0x29d832[0x0][_0x79e8('0x46')](_0x29d832[0x0][_0x79e8('0x47')]('(')+0x1,_0x29d832[0x0][_0x79e8('0x47')](')'));var _0xd9242e=_0x29d832[0x1];channels[_0x30d1ce[_0x79e8('0x12')]][_0x48de85]=_0xd9242e;}if(!_[_0x79e8('0x48')](['hangup',_0x79e8('0x49'),_0x79e8('0x4a'),'set',_0x79e8('0x4b')],_0x30d1ce[_0x79e8('0x42')][_0x79e8('0x43')]())){channels[_0x30d1ce[_0x79e8('0x12')]]['lastapplication']=_0x30d1ce[_0x79e8('0x42')];channels[_0x30d1ce[_0x79e8('0x12')]][_0x79e8('0x3d')]=_0x30d1ce['appdata'];}}}catch(_0x9d1c96){utils['error'](_0x9d1c96['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index a30c194..609e680 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 _0x3f8a=['managerevent','./utils','lodash','connect','info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE'];(function(_0x11aadc,_0x1dd983){var _0x1a80bc=function(_0x26eca0){while(--_0x26eca0){_0x11aadc['push'](_0x11aadc['shift']());}};_0x1a80bc(++_0x1dd983);}(_0x3f8a,0x1d5));var _0xa3f8=function(_0x1e38bd,_0xc29d61){_0x1e38bd=_0x1e38bd-0x0;var _0x533bd9=_0x3f8a[_0x1e38bd];return _0x533bd9;};'use strict';var utils=require(_0xa3f8('0x0'));var _=require(_0xa3f8('0x1'));exports[_0xa3f8('0x2')]=function(){utils[_0xa3f8('0x3')]('CONNECTED');};exports[_0xa3f8('0x4')]=function(){utils[_0xa3f8('0x3')](_0xa3f8('0x5'));};exports[_0xa3f8('0x6')]=function(){utils[_0xa3f8('0x3')](_0xa3f8('0x7'));};exports[_0xa3f8('0x8')]=function(_0x471464){utils[_0xa3f8('0x8')](_0x471464);};exports[_0xa3f8('0x9')]=function(){utils[_0xa3f8('0x3')](_0xa3f8('0xa'));};exports[_0xa3f8('0xb')]=function(_0x2448de){}; \ No newline at end of file +var _0xbff5=['error','close','CLOSE','managerevent','./utils','lodash','connect','info','CONNECTED','shutdown','fullybooted'];(function(_0x2070da,_0x45e586){var _0x4f9fe1=function(_0x5b6f2a){while(--_0x5b6f2a){_0x2070da['push'](_0x2070da['shift']());}};_0x4f9fe1(++_0x45e586);}(_0xbff5,0x1bc));var _0x5bff=function(_0x57263e,_0x45e529){_0x57263e=_0x57263e-0x0;var _0x5d129a=_0xbff5[_0x57263e];return _0x5d129a;};'use strict';var utils=require(_0x5bff('0x0'));var _=require(_0x5bff('0x1'));exports[_0x5bff('0x2')]=function(){utils[_0x5bff('0x3')](_0x5bff('0x4'));};exports[_0x5bff('0x5')]=function(){utils[_0x5bff('0x3')]('SHUTDOWN');};exports[_0x5bff('0x6')]=function(){utils['info']('FULLYBOOTED');};exports[_0x5bff('0x7')]=function(_0x1d8650){utils[_0x5bff('0x7')](_0x1d8650);};exports[_0x5bff('0x8')]=function(){utils[_0x5bff('0x3')](_0x5bff('0x9'));};exports[_0x5bff('0xa')]=function(_0x139c99){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 6eec69d..dfd0435 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 _0x45b1=['answertime','connect','hangup','assign','diffTime','endtime','holdtime','starttime','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring','calleridnum','connectedlinenum','dialstatus','CreateVoiceDialReport','newexten','application','startsWith','toLowerCase','appdata','split','stack','varset','isNil','outboundrouteid','error','now','lastevent','ANSWER'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x45b1,0x1c8));var _0x145b=function(_0x27e0f7,_0x43782a){_0x27e0f7=_0x27e0f7-0x0;var _0x2d18d1=_0x45b1[_0x27e0f7];return _0x2d18d1;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x145b('0x0'));var dials={};function writeDB(_0x187586){utils[_0x145b('0x1')](util[_0x145b('0x2')](_0x145b('0x3'),_0x187586[_0x145b('0x4')],_0x187586['channel'],_0x187586[_0x145b('0x5')],_0x187586[_0x145b('0x6')],_0x187586[_0x145b('0x7')],_0x187586[_0x145b('0x8')]));utils['request'](_0x145b('0x9'),_0x187586);delete dials[_0x187586[_0x145b('0x4')]];}exports[_0x145b('0xa')]=function(_0x43a7d2){try{if(_0x43a7d2[_0x145b('0xb')]['toLowerCase']()=='set'&&_[_0x145b('0xc')](_0x43a7d2['appdata'][_0x145b('0xd')](),'cdr(routeid)')){var _0x16f760=_0x43a7d2[_0x145b('0xe')][_0x145b('0xf')]('=');dials[_0x43a7d2[_0x145b('0x4')]]={'routeId':_0x16f760[0x1]};}}catch(_0x52f1db){utils['error'](_0x52f1db[_0x145b('0x10')]);}};exports[_0x145b('0x11')]=function(_0x5d0a68){try{if(!_[_0x145b('0x12')](_0x5d0a68['variable'][_0x145b('0x13')])){dials[_0x5d0a68[_0x145b('0x4')]]={'routeId':_0x5d0a68['value']};}}catch(_0xcad1cf){utils[_0x145b('0x14')](_0xcad1cf[_0x145b('0x10')]);}};exports['dialbegin']=function(_0x45558b){try{if(!_['isNil'](dials[_0x45558b[_0x145b('0x4')]])){dials[_0x45558b[_0x145b('0x4')]]=_['assign'](dials[_0x45558b[_0x145b('0x4')]],_0x45558b);dials[_0x45558b[_0x145b('0x4')]]['starttime']=utils[_0x145b('0x15')]();dials[_0x45558b[_0x145b('0x4')]][_0x145b('0x16')]='called';}}catch(_0x52a152){utils[_0x145b('0x14')](_0x52a152[_0x145b('0x10')]);}};exports['dialend']=function(_0x336ced){try{if(!_['isNil'](dials[_0x336ced[_0x145b('0x4')]])){dials[_0x336ced['uniqueid']][_0x145b('0x8')]=_0x336ced[_0x145b('0x8')];if(_0x336ced[_0x145b('0x8')]==_0x145b('0x17')){dials[_0x336ced['uniqueid']]=_['assign'](dials[_0x336ced[_0x145b('0x4')]],_0x336ced);dials[_0x336ced[_0x145b('0x4')]][_0x145b('0x18')]=utils[_0x145b('0x15')]();dials[_0x336ced[_0x145b('0x4')]][_0x145b('0x16')]=_0x145b('0x19');}}}catch(_0x13f922){utils[_0x145b('0x14')](_0x13f922[_0x145b('0x10')]);}};exports[_0x145b('0x1a')]=function(_0x3023dc){try{if(!_['isNil'](dials[_0x3023dc[_0x145b('0x4')]])){dials[_0x3023dc[_0x145b('0x4')]]=_[_0x145b('0x1b')](dials[_0x3023dc[_0x145b('0x4')]],{'endtime':utils[_0x145b('0x15')](),'lastevent':'complete'});dials[_0x3023dc[_0x145b('0x4')]]['duration']=utils[_0x145b('0x1c')](dials[_0x3023dc[_0x145b('0x4')]][_0x145b('0x1d')],dials[_0x3023dc[_0x145b('0x4')]]['starttime']);dials[_0x3023dc[_0x145b('0x4')]][_0x145b('0x1e')]=utils[_0x145b('0x1c')](dials[_0x3023dc[_0x145b('0x4')]]['answertime']||dials[_0x3023dc['uniqueid']]['endtime'],dials[_0x3023dc[_0x145b('0x4')]][_0x145b('0x1f')]);dials[_0x3023dc[_0x145b('0x4')]]['billableseconds']=dials[_0x3023dc['uniqueid']][_0x145b('0x18')]?utils[_0x145b('0x1c')](dials[_0x3023dc[_0x145b('0x4')]][_0x145b('0x1d')],dials[_0x3023dc[_0x145b('0x4')]]['answertime']):0x0;writeDB(dials[_0x3023dc[_0x145b('0x4')]]);}}catch(_0x405dcb){utils['error'](_0x405dcb[_0x145b('0x10')]);}}; \ No newline at end of file +var _0x438b=['connectedlinenum','dialstatus','request','CreateVoiceDialReport','newexten','application','set','appdata','toLowerCase','cdr(routeid)','split','varset','isNil','variable','value','error','dialbegin','assign','starttime','now','lastevent','called','stack','dialend','ANSWER','answertime','hangup','complete','duration','endtime','diffTime','util','format','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','dialstring'];(function(_0xff1a6f,_0x162f85){var _0x2bec80=function(_0xc5243d){while(--_0xc5243d){_0xff1a6f['push'](_0xff1a6f['shift']());}};_0x2bec80(++_0x162f85);}(_0x438b,0x67));var _0xb438=function(_0x24a0d3,_0x154dd){_0x24a0d3=_0x24a0d3-0x0;var _0x31db3f=_0x438b[_0x24a0d3];return _0x31db3f;};'use strict';var _=require('lodash');var util=require(_0xb438('0x0'));var utils=require('./utils');var dials={};function writeDB(_0x4b5436){utils['info'](util[_0xb438('0x1')](_0xb438('0x2'),_0x4b5436[_0xb438('0x3')],_0x4b5436['channel'],_0x4b5436[_0xb438('0x4')],_0x4b5436['calleridnum'],_0x4b5436[_0xb438('0x5')],_0x4b5436[_0xb438('0x6')]));utils[_0xb438('0x7')](_0xb438('0x8'),_0x4b5436);delete dials[_0x4b5436[_0xb438('0x3')]];}exports[_0xb438('0x9')]=function(_0x183634){try{if(_0x183634[_0xb438('0xa')]['toLowerCase']()==_0xb438('0xb')&&_['startsWith'](_0x183634[_0xb438('0xc')][_0xb438('0xd')](),_0xb438('0xe'))){var _0x983c41=_0x183634['appdata'][_0xb438('0xf')]('=');dials[_0x183634['uniqueid']]={'routeId':_0x983c41[0x1]};}}catch(_0x35821e){utils['error'](_0x35821e['stack']);}};exports[_0xb438('0x10')]=function(_0x16ea1c){try{if(!_[_0xb438('0x11')](_0x16ea1c[_0xb438('0x12')]['outboundrouteid'])){dials[_0x16ea1c['uniqueid']]={'routeId':_0x16ea1c[_0xb438('0x13')]};}}catch(_0xa8814c){utils[_0xb438('0x14')](_0xa8814c['stack']);}};exports[_0xb438('0x15')]=function(_0x36e182){try{if(!_['isNil'](dials[_0x36e182[_0xb438('0x3')]])){dials[_0x36e182[_0xb438('0x3')]]=_[_0xb438('0x16')](dials[_0x36e182['uniqueid']],_0x36e182);dials[_0x36e182[_0xb438('0x3')]][_0xb438('0x17')]=utils[_0xb438('0x18')]();dials[_0x36e182[_0xb438('0x3')]][_0xb438('0x19')]=_0xb438('0x1a');}}catch(_0xfe9bc3){utils[_0xb438('0x14')](_0xfe9bc3[_0xb438('0x1b')]);}};exports[_0xb438('0x1c')]=function(_0x1cce4a){try{if(!_[_0xb438('0x11')](dials[_0x1cce4a['uniqueid']])){dials[_0x1cce4a['uniqueid']][_0xb438('0x6')]=_0x1cce4a[_0xb438('0x6')];if(_0x1cce4a[_0xb438('0x6')]==_0xb438('0x1d')){dials[_0x1cce4a['uniqueid']]=_[_0xb438('0x16')](dials[_0x1cce4a[_0xb438('0x3')]],_0x1cce4a);dials[_0x1cce4a[_0xb438('0x3')]][_0xb438('0x1e')]=utils[_0xb438('0x18')]();dials[_0x1cce4a[_0xb438('0x3')]]['lastevent']='connect';}}}catch(_0x3014bf){utils['error'](_0x3014bf[_0xb438('0x1b')]);}};exports[_0xb438('0x1f')]=function(_0x4e03b8){try{if(!_[_0xb438('0x11')](dials[_0x4e03b8[_0xb438('0x3')]])){dials[_0x4e03b8['uniqueid']]=_['assign'](dials[_0x4e03b8[_0xb438('0x3')]],{'endtime':utils['now'](),'lastevent':_0xb438('0x20')});dials[_0x4e03b8[_0xb438('0x3')]][_0xb438('0x21')]=utils['diffTime'](dials[_0x4e03b8[_0xb438('0x3')]][_0xb438('0x22')],dials[_0x4e03b8['uniqueid']][_0xb438('0x17')]);dials[_0x4e03b8['uniqueid']]['holdtime']=utils[_0xb438('0x23')](dials[_0x4e03b8[_0xb438('0x3')]][_0xb438('0x1e')]||dials[_0x4e03b8[_0xb438('0x3')]]['endtime'],dials[_0x4e03b8[_0xb438('0x3')]][_0xb438('0x17')]);dials[_0x4e03b8[_0xb438('0x3')]]['billableseconds']=dials[_0x4e03b8[_0xb438('0x3')]]['answertime']?utils[_0xb438('0x23')](dials[_0x4e03b8[_0xb438('0x3')]]['endtime'],dials[_0x4e03b8[_0xb438('0x3')]][_0xb438('0x1e')]):0x0;writeDB(dials[_0x4e03b8[_0xb438('0x3')]]);}}catch(_0x80320){utils[_0xb438('0x14')](_0x80320[_0xb438('0x1b')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index d496a82..3c9f2c0 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 _0x1514=['./members.controller','./transfers.controller','./core.controller','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','asterisk-manager','../../config/environment','./utils','asterisk','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller'];(function(_0x505d44,_0x5d1152){var _0x461166=function(_0xb0848d){while(--_0xb0848d){_0x505d44['push'](_0x505d44['shift']());}};_0x461166(++_0x5d1152);}(_0x1514,0xc4));var _0x4151=function(_0x5cfeeb,_0x2af3c4){_0x5cfeeb=_0x5cfeeb-0x0;var _0x43fd28=_0x1514[_0x5cfeeb];return _0x43fd28;};var AsteriskManager=require(_0x4151('0x0'));var config=require(_0x4151('0x1'));var utils=require(_0x4151('0x2'));var ami=new AsteriskManager(config[_0x4151('0x3')]['port'],config[_0x4151('0x3')]['ip'],config[_0x4151('0x3')][_0x4151('0x4')],config[_0x4151('0x3')]['password'],!![]);ami[_0x4151('0x5')]();if(config['xdr']&&config[_0x4151('0x6')][_0x4151('0x7')]){utils[_0x4151('0x8')](_0x4151('0x9'));}else{var agents=require(_0x4151('0xa'));var calls=require(_0x4151('0xb'));var queues=require(_0x4151('0xc'));var recordings=require(_0x4151('0xd'));var members=require(_0x4151('0xe'));var dials=require('./dials.controller');var transfers=require(_0x4151('0xf'));var core=require(_0x4151('0x10'));ami['on']('connect',core['connect']);ami['on'](_0x4151('0x11'),core[_0x4151('0x11')]);ami['on']('fullybooted',core[_0x4151('0x12')]);ami['on']('error',core[_0x4151('0x13')]);ami['on'](_0x4151('0x14'),core['close']);ami['on'](_0x4151('0x15'),core[_0x4151('0x15')]);ami['on'](_0x4151('0x16'),function(_0x50248b){try{members[_0x4151('0x16')](_0x50248b);}catch(_0x10c956){utils[_0x4151('0x13')](_0x10c956);}});ami['on'](_0x4151('0x17'),function(_0x3cf791){try{agents['agentcalled'](_0x3cf791);}catch(_0x3c8264){utils[_0x4151('0x13')](_0x3c8264);}});ami['on']('agentringnoanswer',function(_0x5bff73){try{agents[_0x4151('0x18')](_0x5bff73);}catch(_0x15b845){utils[_0x4151('0x13')](_0x15b845);}});ami['on'](_0x4151('0x19'),function(_0x5b2a84){try{agents[_0x4151('0x19')](_0x5b2a84);queues[_0x4151('0x19')](_0x5b2a84);}catch(_0x1296de){utils['error'](_0x1296de);}});ami['on'](_0x4151('0x1a'),function(_0x2ea6bd){try{agents[_0x4151('0x1a')](_0x2ea6bd);queues[_0x4151('0x1a')](_0x2ea6bd);members['agentcomplete'](_0x2ea6bd);}catch(_0x52392c){utils[_0x4151('0x13')](_0x52392c);}});ami['on'](_0x4151('0x1b'),function(_0x583779){try{agents[_0x4151('0x1b')](_0x583779);queues[_0x4151('0x1b')](_0x583779);}catch(_0x5336cf){utils[_0x4151('0x13')](_0x5336cf);}});ami['on'](_0x4151('0x1c'),function(_0x479f18){try{queues['queuecallerjoin'](_0x479f18);recordings[_0x4151('0x1c')](_0x479f18);}catch(_0x40adfa){utils[_0x4151('0x13')](_0x40adfa);}});ami['on'](_0x4151('0x1d'),function(_0x5caaa5){try{queues[_0x4151('0x1d')](_0x5caaa5);}catch(_0x475be1){utils[_0x4151('0x13')](_0x475be1);}});ami['on'](_0x4151('0x1e'),function(_0x26b6cd){try{queues[_0x4151('0x1e')](_0x26b6cd);calls['musiconholdstart'](_0x26b6cd);}catch(_0x483aac){utils[_0x4151('0x13')](_0x483aac);}});ami['on'](_0x4151('0x1f'),function(_0x215160){try{queues[_0x4151('0x1f')](_0x215160);calls[_0x4151('0x1f')](_0x215160);}catch(_0x1a193f){utils[_0x4151('0x13')](_0x1a193f);}});ami['on']('newstate',function(_0x59badc){try{calls[_0x4151('0x20')](_0x59badc);recordings[_0x4151('0x20')](_0x59badc);}catch(_0x521066){utils[_0x4151('0x13')](_0x521066);}});ami['on'](_0x4151('0x21'),function(_0x5eade9){try{calls[_0x4151('0x21')](_0x5eade9);recordings[_0x4151('0x21')](_0x5eade9);dials[_0x4151('0x21')](_0x5eade9);agents[_0x4151('0x21')](_0x5eade9);queues['hangup'](_0x5eade9);}catch(_0x16b0a5){utils[_0x4151('0x13')](_0x16b0a5);}});ami['on'](_0x4151('0x22'),function(_0x2bb765){try{members[_0x4151('0x22')](_0x2bb765);}catch(_0x47858e){utils['error'](_0x47858e);}});ami['on']('blindtransfer',function(_0x21349e){try{queues[_0x4151('0x23')](_0x21349e);agents[_0x4151('0x23')](_0x21349e);transfers[_0x4151('0x23')](_0x21349e);}catch(_0x401537){utils[_0x4151('0x13')](_0x401537);}});ami['on'](_0x4151('0x24'),function(_0x217d00){try{queues['attendedtransfer'](_0x217d00);transfers[_0x4151('0x24')](_0x217d00);agents[_0x4151('0x24')](_0x217d00);calls['attendedtransfer'](_0x217d00);}catch(_0x1f20f9){utils[_0x4151('0x13')](_0x1f20f9);}});ami['on'](_0x4151('0x25'),function(_0x207734){try{queues[_0x4151('0x25')](_0x207734);recordings[_0x4151('0x25')](_0x207734);calls['varset'](_0x207734);dials[_0x4151('0x25')](_0x207734);}catch(_0x4dbc5a){utils['error'](_0x4dbc5a);}});ami['on'](_0x4151('0x26'),function(_0x459739){try{calls[_0x4151('0x26')](_0x459739);recordings['newexten'](_0x459739);dials[_0x4151('0x26')](_0x459739);}catch(_0x3eff44){utils[_0x4151('0x13')](_0x3eff44);}});ami['on'](_0x4151('0x27'),function(_0x56ac5c){try{calls['newchannel'](_0x56ac5c);recordings[_0x4151('0x27')](_0x56ac5c);}catch(_0x240f67){utils[_0x4151('0x13')](_0x240f67);}});ami['on'](_0x4151('0x28'),function(_0x127f71){try{dials['dialbegin'](_0x127f71);}catch(_0xe81748){utils[_0x4151('0x13')](_0xe81748);}});ami['on'](_0x4151('0x29'),function(_0x44a85f){try{dials[_0x4151('0x29')](_0x44a85f);}catch(_0x66d3d2){utils['error'](_0x66d3d2);}});} \ No newline at end of file +var _0xec45=['agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','asterisk','port','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./recordings.controller','./members.controller','./dials.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer'];(function(_0x3c0397,_0x259f7f){var _0x208e88=function(_0x19c007){while(--_0x19c007){_0x3c0397['push'](_0x3c0397['shift']());}};_0x208e88(++_0x259f7f);}(_0xec45,0x145));var _0x5ec4=function(_0x8c856a,_0x5d36e3){_0x8c856a=_0x8c856a-0x0;var _0x241283=_0xec45[_0x8c856a];return _0x241283;};var AsteriskManager=require('asterisk-manager');var config=require(_0x5ec4('0x0'));var utils=require(_0x5ec4('0x1'));var ami=new AsteriskManager(config[_0x5ec4('0x2')][_0x5ec4('0x3')],config['asterisk']['ip'],config['asterisk'][_0x5ec4('0x4')],config[_0x5ec4('0x2')][_0x5ec4('0x5')],!![]);ami[_0x5ec4('0x6')]();if(config['xdr']&&config[_0x5ec4('0x7')][_0x5ec4('0x8')]){utils[_0x5ec4('0x9')](_0x5ec4('0xa'));}else{var agents=require(_0x5ec4('0xb'));var calls=require(_0x5ec4('0xc'));var queues=require('./queues.controller');var recordings=require(_0x5ec4('0xd'));var members=require(_0x5ec4('0xe'));var dials=require(_0x5ec4('0xf'));var transfers=require(_0x5ec4('0x10'));var core=require(_0x5ec4('0x11'));ami['on'](_0x5ec4('0x12'),core[_0x5ec4('0x12')]);ami['on'](_0x5ec4('0x13'),core[_0x5ec4('0x13')]);ami['on'](_0x5ec4('0x14'),core[_0x5ec4('0x14')]);ami['on'](_0x5ec4('0x15'),core[_0x5ec4('0x15')]);ami['on'](_0x5ec4('0x16'),core['close']);ami['on'](_0x5ec4('0x17'),core[_0x5ec4('0x17')]);ami['on'](_0x5ec4('0x18'),function(_0x667f6b){try{members[_0x5ec4('0x18')](_0x667f6b);}catch(_0x307212){utils['error'](_0x307212);}});ami['on']('agentcalled',function(_0x45dcf4){try{agents[_0x5ec4('0x19')](_0x45dcf4);}catch(_0x24743c){utils[_0x5ec4('0x15')](_0x24743c);}});ami['on'](_0x5ec4('0x1a'),function(_0x4ff8b7){try{agents[_0x5ec4('0x1a')](_0x4ff8b7);}catch(_0x41a85b){utils[_0x5ec4('0x15')](_0x41a85b);}});ami['on'](_0x5ec4('0x1b'),function(_0x47712f){try{agents[_0x5ec4('0x1b')](_0x47712f);queues[_0x5ec4('0x1b')](_0x47712f);}catch(_0x507a66){utils['error'](_0x507a66);}});ami['on'](_0x5ec4('0x1c'),function(_0x543a2d){try{agents[_0x5ec4('0x1c')](_0x543a2d);queues[_0x5ec4('0x1c')](_0x543a2d);members[_0x5ec4('0x1c')](_0x543a2d);}catch(_0x37e35c){utils[_0x5ec4('0x15')](_0x37e35c);}});ami['on'](_0x5ec4('0x1d'),function(_0xa925cc){try{agents[_0x5ec4('0x1d')](_0xa925cc);queues[_0x5ec4('0x1d')](_0xa925cc);}catch(_0x517ba0){utils[_0x5ec4('0x15')](_0x517ba0);}});ami['on'](_0x5ec4('0x1e'),function(_0x5431fc){try{queues[_0x5ec4('0x1e')](_0x5431fc);recordings[_0x5ec4('0x1e')](_0x5431fc);}catch(_0x31bb4f){utils[_0x5ec4('0x15')](_0x31bb4f);}});ami['on']('queuecallerleave',function(_0x15b914){try{queues[_0x5ec4('0x1f')](_0x15b914);}catch(_0x217a4b){utils['error'](_0x217a4b);}});ami['on'](_0x5ec4('0x20'),function(_0x20014e){try{queues[_0x5ec4('0x20')](_0x20014e);calls[_0x5ec4('0x20')](_0x20014e);}catch(_0x743e95){utils['error'](_0x743e95);}});ami['on'](_0x5ec4('0x21'),function(_0x21163a){try{queues['musiconholdstop'](_0x21163a);calls['musiconholdstop'](_0x21163a);}catch(_0x34e2e8){utils[_0x5ec4('0x15')](_0x34e2e8);}});ami['on']('newstate',function(_0x40bd08){try{calls[_0x5ec4('0x22')](_0x40bd08);recordings[_0x5ec4('0x22')](_0x40bd08);}catch(_0x31f348){utils[_0x5ec4('0x15')](_0x31f348);}});ami['on'](_0x5ec4('0x23'),function(_0x1c7ba1){try{calls[_0x5ec4('0x23')](_0x1c7ba1);recordings[_0x5ec4('0x23')](_0x1c7ba1);dials[_0x5ec4('0x23')](_0x1c7ba1);agents[_0x5ec4('0x23')](_0x1c7ba1);queues[_0x5ec4('0x23')](_0x1c7ba1);}catch(_0x4c9678){utils[_0x5ec4('0x15')](_0x4c9678);}});ami['on'](_0x5ec4('0x24'),function(_0x5d228c){try{members[_0x5ec4('0x24')](_0x5d228c);}catch(_0x1c9395){utils[_0x5ec4('0x15')](_0x1c9395);}});ami['on'](_0x5ec4('0x25'),function(_0x1a2aae){try{queues['blindtransfer'](_0x1a2aae);agents[_0x5ec4('0x25')](_0x1a2aae);transfers[_0x5ec4('0x25')](_0x1a2aae);}catch(_0x46fa2a){utils['error'](_0x46fa2a);}});ami['on'](_0x5ec4('0x26'),function(_0xbd285f){try{queues[_0x5ec4('0x26')](_0xbd285f);transfers[_0x5ec4('0x26')](_0xbd285f);agents[_0x5ec4('0x26')](_0xbd285f);calls[_0x5ec4('0x26')](_0xbd285f);}catch(_0x1585af){utils[_0x5ec4('0x15')](_0x1585af);}});ami['on'](_0x5ec4('0x27'),function(_0x32ecce){try{queues[_0x5ec4('0x27')](_0x32ecce);recordings['varset'](_0x32ecce);calls['varset'](_0x32ecce);dials[_0x5ec4('0x27')](_0x32ecce);}catch(_0x5ded9e){utils['error'](_0x5ded9e);}});ami['on'](_0x5ec4('0x28'),function(_0x353669){try{calls[_0x5ec4('0x28')](_0x353669);recordings[_0x5ec4('0x28')](_0x353669);dials[_0x5ec4('0x28')](_0x353669);}catch(_0x4e9f6f){utils[_0x5ec4('0x15')](_0x4e9f6f);}});ami['on'](_0x5ec4('0x29'),function(_0x412524){try{calls[_0x5ec4('0x29')](_0x412524);recordings['newchannel'](_0x412524);}catch(_0x1a93c8){utils['error'](_0x1a93c8);}});ami['on']('dialbegin',function(_0x2429ad){try{dials[_0x5ec4('0x2a')](_0x2429ad);}catch(_0x14de09){utils[_0x5ec4('0x15')](_0x14de09);}});ami['on'](_0x5ec4('0x2b'),function(_0x6cfb09){try{dials['dialend'](_0x6cfb09);}catch(_0x2d01bd){utils[_0x5ec4('0x15')](_0x2d01bd);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 02cf4b8..834a5cc 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 _0xe76a=['data2','membername','type','getUserByInterface','internal','request','split','then','name','CreateMemberReport','some','startsWith','INUSE','BUSY','device','voice','TALKING','agent','isNil','exitAt','now','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','data3','destination','destinationchannel','source','util','./utils','Local/_attended@transfer','Queue:','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe76a,0x1cf));var _0xae76=function(_0x39dd6e,_0xcbd3e7){_0x39dd6e=_0x39dd6e-0x0;var _0x577772=_0xe76a[_0x39dd6e];return _0x577772;};'use strict';var _=require('lodash');var util=require(_0xae76('0x0'));var utils=require(_0xae76('0x1'));var members={};var exclude=[_0xae76('0x2'),_0xae76('0x3')];function writeDB(_0xd2b05c){utils[_0xae76('0x4')](util[_0xae76('0x5')](_0xae76('0x6'),_0xd2b05c[_0xae76('0x7')],_0xd2b05c[_0xae76('0x8')],_0xd2b05c[_0xae76('0x9')],_0xd2b05c[_0xae76('0xa')],_0xd2b05c[_0xae76('0xb')],_0xd2b05c[_0xae76('0xc')]));if(_0xd2b05c[_0xae76('0x8')]){utils[_0xae76('0xd')](_0xd2b05c['interface'])['then'](function(_0x19bfac){if(_0x19bfac){_0xd2b05c[_0xae76('0xb')]=_0x19bfac['name'];_0xd2b05c['internal']=_0x19bfac[_0xae76('0xe')];utils[_0xae76('0xf')]('CreateMemberReport',_0xd2b05c);}else{utils['getUserByName'](_0xd2b05c['interface'][_0xae76('0x10')]('/')[0x1])[_0xae76('0x11')](function(_0x3468ac){if(_0x3468ac){_0xd2b05c[_0xae76('0xb')]=_0x3468ac[_0xae76('0x12')];_0xd2b05c['internal']=_0x3468ac[_0xae76('0xe')];utils[_0xae76('0xf')](_0xae76('0x13'),_0xd2b05c);}});}})['catch'](function(_0x29ce03){utils['error'](_0x29ce03);});}delete members[_0xd2b05c[_0xae76('0x8')]];}function startsWith(_0x27dbb2,_0x250545){return _[_0xae76('0x14')](_0x27dbb2,function(_0x5f0fd8){return _[_0xae76('0x15')](_0x250545,_0x5f0fd8);});}exports['devicestatechange']=function(_0x2eeed8){switch(_0x2eeed8['state']){case _0xae76('0x16'):case _0xae76('0x17'):if(!startsWith(exclude,_0x2eeed8[_0xae76('0x18')])){members[_0x2eeed8[_0xae76('0x18')]]={'channel':_0xae76('0x19'),'interface':_0x2eeed8[_0xae76('0x18')],'type':_0xae76('0x1a'),'enterAt':utils['now'](),'role':_0xae76('0x1b')};}break;case'NOT_INUSE':if(!_[_0xae76('0x1c')](members[_0x2eeed8[_0xae76('0x18')]])){members[_0x2eeed8[_0xae76('0x18')]][_0xae76('0x1d')]=utils[_0xae76('0x1e')]();members[_0x2eeed8['device']][_0xae76('0x1f')]=utils[_0xae76('0x20')](members[_0x2eeed8[_0xae76('0x18')]][_0xae76('0x1d')],members[_0x2eeed8[_0xae76('0x18')]][_0xae76('0x21')]);if(members[_0x2eeed8[_0xae76('0x18')]][_0xae76('0x7')]){writeDB(members[_0x2eeed8[_0xae76('0x18')]]);}}default:break;}};exports[_0xae76('0x22')]=function(_0x1804ce){if(!_[_0xae76('0x1c')](members[_0x1804ce[_0xae76('0x8')]])){members[_0x1804ce['interface']]=_[_0xae76('0x23')](members[_0x1804ce[_0xae76('0x8')]],{'data4':_0x1804ce[_0xae76('0x24')],'uniqueid':_0x1804ce['uniqueid']});}};exports[_0xae76('0x25')]=function(_0xbd57ee){if(_0xbd57ee[_0xae76('0x9')]){var _0x5e3e8b=_0xbd57ee[_0xae76('0x9')][_0xae76('0x10')]('-')[0x0];if(!_['isNil'](members[_0x5e3e8b])){members[_0x5e3e8b]=_['assign'](members[_0x5e3e8b],{'data1':members[_0x5e3e8b][_0xae76('0x26')]||_0xbd57ee[_0xae76('0xc')],'data2':members[_0x5e3e8b][_0xae76('0xa')]||_0xbd57ee['source'],'data3':members[_0x5e3e8b][_0xae76('0x27')]||_0xbd57ee[_0xae76('0x28')],'uniqueid':members[_0x5e3e8b]['uniqueid']||_0xbd57ee['uniqueid']});if(members[_0x5e3e8b][_0xae76('0x1d')]){writeDB(members[_0x5e3e8b]);}}}if(_0xbd57ee[_0xae76('0x29')]){var _0x2729f7=_0xbd57ee[_0xae76('0x29')][_0xae76('0x10')]('-')[0x0];if(!_['isNil'](members[_0x2729f7])){members[_0x2729f7]=_[_0xae76('0x23')](members[_0x2729f7],{'data1':members[_0x2729f7][_0xae76('0x26')]||_0xbd57ee['type'],'data2':members[_0x2729f7][_0xae76('0xa')]||_0xbd57ee[_0xae76('0x2a')],'data3':members[_0x2729f7][_0xae76('0x27')]||_0xbd57ee['destination'],'uniqueid':members[_0x2729f7][_0xae76('0x7')]||_0xbd57ee['uniqueid']});if(members[_0x2729f7][_0xae76('0x1d')]){writeDB(members[_0x2729f7]);}}}}; \ No newline at end of file +var _0x447e=['some','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','isNil','exitAt','duration','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','type','data2','data3','destination','destinationchannel','split','source','util','./utils','Local/_attended@transfer','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','membername','getUserByInterface','then','name','internal','CreateMemberReport','getUserByName','request','error'];(function(_0x4b369d,_0x265eb8){var _0x571a98=function(_0x56341a){while(--_0x56341a){_0x4b369d['push'](_0x4b369d['shift']());}};_0x571a98(++_0x265eb8);}(_0x447e,0x11c));var _0xe447=function(_0x18519c,_0x174c40){_0x18519c=_0x18519c-0x0;var _0x397e3a=_0x447e[_0x18519c];return _0x397e3a;};'use strict';var _=require('lodash');var util=require(_0xe447('0x0'));var utils=require(_0xe447('0x1'));var members={};var exclude=[_0xe447('0x2'),'Queue:'];function writeDB(_0x576307){utils['info'](util[_0xe447('0x3')](_0xe447('0x4'),_0x576307[_0xe447('0x5')],_0x576307[_0xe447('0x6')],_0x576307[_0xe447('0x7')],_0x576307['data2'],_0x576307[_0xe447('0x8')],_0x576307['type']));if(_0x576307['interface']){utils[_0xe447('0x9')](_0x576307['interface'])[_0xe447('0xa')](function(_0x233578){if(_0x233578){_0x576307[_0xe447('0x8')]=_0x233578[_0xe447('0xb')];_0x576307[_0xe447('0xc')]=_0x233578['internal'];utils['request'](_0xe447('0xd'),_0x576307);}else{utils[_0xe447('0xe')](_0x576307[_0xe447('0x6')]['split']('/')[0x1])[_0xe447('0xa')](function(_0x5e70b7){if(_0x5e70b7){_0x576307[_0xe447('0x8')]=_0x5e70b7[_0xe447('0xb')];_0x576307[_0xe447('0xc')]=_0x5e70b7[_0xe447('0xc')];utils[_0xe447('0xf')](_0xe447('0xd'),_0x576307);}});}})['catch'](function(_0x37cfb0){utils[_0xe447('0x10')](_0x37cfb0);});}delete members[_0x576307[_0xe447('0x6')]];}function startsWith(_0xf18fde,_0x262141){return _[_0xe447('0x11')](_0xf18fde,function(_0x3b7b6d){return _['startsWith'](_0x262141,_0x3b7b6d);});}exports[_0xe447('0x12')]=function(_0x1d507e){switch(_0x1d507e[_0xe447('0x13')]){case'INUSE':case _0xe447('0x14'):if(!startsWith(exclude,_0x1d507e[_0xe447('0x15')])){members[_0x1d507e[_0xe447('0x15')]]={'channel':_0xe447('0x16'),'interface':_0x1d507e[_0xe447('0x15')],'type':_0xe447('0x17'),'enterAt':utils[_0xe447('0x18')](),'role':_0xe447('0x19')};}break;case'NOT_INUSE':if(!_[_0xe447('0x1a')](members[_0x1d507e['device']])){members[_0x1d507e[_0xe447('0x15')]][_0xe447('0x1b')]=utils[_0xe447('0x18')]();members[_0x1d507e[_0xe447('0x15')]][_0xe447('0x1c')]=utils[_0xe447('0x1d')](members[_0x1d507e[_0xe447('0x15')]][_0xe447('0x1b')],members[_0x1d507e[_0xe447('0x15')]][_0xe447('0x1e')]);if(members[_0x1d507e[_0xe447('0x15')]][_0xe447('0x5')]){writeDB(members[_0x1d507e['device']]);}}default:break;}};exports[_0xe447('0x1f')]=function(_0x23f923){if(!_[_0xe447('0x1a')](members[_0x23f923[_0xe447('0x6')]])){members[_0x23f923[_0xe447('0x6')]]=_[_0xe447('0x20')](members[_0x23f923[_0xe447('0x6')]],{'data4':_0x23f923[_0xe447('0x21')],'uniqueid':_0x23f923[_0xe447('0x5')]});}};exports[_0xe447('0x22')]=function(_0x5c9747){if(_0x5c9747[_0xe447('0x7')]){var _0x21fffe=_0x5c9747[_0xe447('0x7')]['split']('-')[0x0];if(!_[_0xe447('0x1a')](members[_0x21fffe])){members[_0x21fffe]=_[_0xe447('0x20')](members[_0x21fffe],{'data1':members[_0x21fffe][_0xe447('0x23')]||_0x5c9747[_0xe447('0x24')],'data2':members[_0x21fffe][_0xe447('0x25')]||_0x5c9747['source'],'data3':members[_0x21fffe][_0xe447('0x26')]||_0x5c9747[_0xe447('0x27')],'uniqueid':members[_0x21fffe][_0xe447('0x5')]||_0x5c9747[_0xe447('0x5')]});if(members[_0x21fffe]['exitAt']){writeDB(members[_0x21fffe]);}}}if(_0x5c9747[_0xe447('0x28')]){var _0x57af5f=_0x5c9747[_0xe447('0x28')][_0xe447('0x29')]('-')[0x0];if(!_[_0xe447('0x1a')](members[_0x57af5f])){members[_0x57af5f]=_[_0xe447('0x20')](members[_0x57af5f],{'data1':members[_0x57af5f][_0xe447('0x23')]||_0x5c9747[_0xe447('0x24')],'data2':members[_0x57af5f][_0xe447('0x25')]||_0x5c9747[_0xe447('0x2a')],'data3':members[_0x57af5f][_0xe447('0x26')]||_0x5c9747[_0xe447('0x27')],'uniqueid':members[_0x57af5f][_0xe447('0x5')]||_0x5c9747[_0xe447('0x5')]});if(members[_0x57af5f]['exitAt']){writeDB(members[_0x57af5f]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 9c6a665..b4520b0 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 _0x70b4=['queuecallercomplete','queuecallerenterreason','varset','queuestatus','value','toUpperCase','CONTINUE','queuecallerabandonAt','queuecallerexitAt','EXITWITHKEY','ABANDONED','queuecallerleave','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','lastAssignedTo','membername','queuecallercompleteAt','reason','transfer','blindtransfer','transfereeuniqueid','transfertype','transferexten','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','holdtime','mohtime','secondtransfereruniqueid','transfertargetlinkedid','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','util','./utils','info','format','channel','calleridnum','accountcode','queuecallerexitreason','queue','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','uniqueid','queuecallerjoin','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit'];(function(_0x28a154,_0x430fc0){var _0x3110f0=function(_0x8ff792){while(--_0x8ff792){_0x28a154['push'](_0x28a154['shift']());}};_0x3110f0(++_0x430fc0);}(_0x70b4,0x7d));var _0x470b=function(_0x1d466f,_0x4e4c3e){_0x1d466f=_0x1d466f-0x0;var _0xf2ff3b=_0x70b4[_0x1d466f];return _0xf2ff3b;};'use strict';var _=require('lodash');var util=require(_0x470b('0x0'));var utils=require(_0x470b('0x1'));var queues={};function writeDB(_0x76e353){utils[_0x470b('0x2')](util[_0x470b('0x3')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x76e353['uniqueid'],_0x76e353[_0x470b('0x4')],_0x76e353['queue'],_0x76e353['lastAssignedTo'],_0x76e353[_0x470b('0x5')],_0x76e353[_0x470b('0x6')],_0x76e353[_0x470b('0x7')]));if(_0x76e353[_0x470b('0x8')]){utils[_0x470b('0x9')](_0x76e353['queue'])[_0x470b('0xa')](function(_0x143405){if(_0x143405){_0x76e353[_0x470b('0xb')]=_0x143405[_0x470b('0xb')];}utils[_0x470b('0xc')](_0x470b('0xd'),_0x76e353);});}else{utils[_0x470b('0xc')](_0x470b('0xd'),_0x76e353);}if(_0x76e353[_0x470b('0xe')]){delete queues[_0x76e353[_0x470b('0xe')]];}else{delete queues[_0x76e353[_0x470b('0xf')]];}}exports[_0x470b('0x10')]=function(_0x4989b3){queues[_0x4989b3[_0x470b('0xf')]]=_[_0x470b('0x11')](_0x4989b3,{'originalposition':_0x4989b3[_0x470b('0x12')],'queuecallerjoinAt':utils[_0x470b('0x13')](),'mohtime':0x0});};exports[_0x470b('0x14')]=function(_0x139ffa){if(!_[_0x470b('0x15')](queues[_0x139ffa['uniqueid']])){if(queues[_0x139ffa[_0x470b('0xf')]][_0x470b('0x16')]){if(!queues[_0x139ffa['uniqueid']][_0x470b('0x17')]&&!queues[_0x139ffa[_0x470b('0xf')]][_0x470b('0x18')]){queues[_0x139ffa[_0x470b('0xf')]][_0x470b('0x19')]=!![];queues[_0x139ffa[_0x470b('0xf')]]['queuecallercompleteAt']=utils[_0x470b('0x13')]();queues[_0x139ffa[_0x470b('0xf')]][_0x470b('0x7')]='COMPLETEDBYAGENT';}writeDB(queues[_0x139ffa[_0x470b('0xf')]]);}else{if(queues[_0x139ffa[_0x470b('0xf')]][_0x470b('0xe')]){queues[queues[_0x139ffa[_0x470b('0xf')]]['transfereduniqueid']]=queues[_0x139ffa[_0x470b('0xf')]];queues[queues[_0x139ffa['uniqueid']][_0x470b('0xe')]][_0x470b('0x1a')]=0x2;delete queues[_0x139ffa[_0x470b('0xf')]];}}}};exports[_0x470b('0x1b')]=function(_0xfaf902){if(!_[_0x470b('0x15')](_0xfaf902['variable'][_0x470b('0x1c')])&&_0xfaf902[_0x470b('0x1d')][_0x470b('0x1e')]()!==_0x470b('0x1f')){if(!_[_0x470b('0x15')](queues[_0xfaf902[_0x470b('0xf')]])){queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x17')]=![];queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x20')]=null;queues[_0xfaf902['uniqueid']][_0x470b('0x18')]=!![];queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x21')]=utils[_0x470b('0x13')]();queues[_0xfaf902[_0x470b('0xf')]]['queuecallerexitreason']=_0xfaf902[_0x470b('0x1d')][_0x470b('0x1e')]();writeDB(queues[_0xfaf902[_0x470b('0xf')]]);}}else if(!_[_0x470b('0x15')](_0xfaf902['variable']['queueposition'])){if(!_['isNil'](queues[_0xfaf902[_0x470b('0xf')]])&&!queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x17')]){queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x17')]=![];queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x20')]=null;queues[_0xfaf902['uniqueid']][_0x470b('0x18')]=!![];queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x21')]=utils['now']();queues[_0xfaf902[_0x470b('0xf')]][_0x470b('0x7')]=_0x470b('0x22');}}};exports[_0x470b('0x17')]=function(_0x499b86){if(!_['isNil'](queues[_0x499b86[_0x470b('0xf')]])){queues[_0x499b86[_0x470b('0xf')]]['queuecallerexit']=![];queues[_0x499b86['uniqueid']]['queuecallerexitAt']=null;queues[_0x499b86[_0x470b('0xf')]]['queuecallerabandon']=!![];queues[_0x499b86[_0x470b('0xf')]][_0x470b('0x20')]=utils['now']();queues[_0x499b86[_0x470b('0xf')]]['queuecallerexitreason']=_0x470b('0x23');}};exports[_0x470b('0x24')]=function(_0x4c053f){if(!_[_0x470b('0x15')](queues[_0x4c053f['uniqueid']])){queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x24')]=!![];queues[_0x4c053f['uniqueid']]['queuecallerleaveAt']=utils[_0x470b('0x13')]();queues[_0x4c053f[_0x470b('0xf')]]['holdtime']=utils[_0x470b('0x25')](queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x16')],queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x26')]);queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x12')]=_0x4c053f[_0x470b('0x12')];queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x27')]=_0x4c053f[_0x470b('0x27')];queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x28')]=_0x4c053f[_0x470b('0x28')];queues[_0x4c053f[_0x470b('0xf')]][_0x470b('0x29')]=_0x4c053f[_0x470b('0x29')];}};exports[_0x470b('0x2a')]=function(_0x2cb40f){if(!_[_0x470b('0x15')](queues[_0x2cb40f[_0x470b('0xf')]])){queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x17')]=![];queues[_0x2cb40f[_0x470b('0xf')]]['queuecallerabandon']=![];queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x20')]=null;queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x18')]=![];queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x7')]=null;queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x21')]=null;queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x2b')]=!![];queues[_0x2cb40f['uniqueid']][_0x470b('0x6')]=_0x2cb40f['destaccountcode'];queues[_0x2cb40f[_0x470b('0xf')]][_0x470b('0x2c')]=_0x2cb40f[_0x470b('0x2d')];}};exports['agentcomplete']=function(_0x522669){if(!_[_0x470b('0x15')](queues[_0x522669[_0x470b('0xf')]])){if(queues[_0x522669['uniqueid']][_0x470b('0x16')]){queues[_0x522669['uniqueid']][_0x470b('0x17')]=![];queues[_0x522669[_0x470b('0xf')]]['queuecallerabandon']=![];queues[_0x522669[_0x470b('0xf')]][_0x470b('0x20')]=null;queues[_0x522669[_0x470b('0xf')]][_0x470b('0x18')]=![];queues[_0x522669[_0x470b('0xf')]][_0x470b('0x21')]=null;queues[_0x522669[_0x470b('0xf')]][_0x470b('0x2b')]=!![];queues[_0x522669['uniqueid']][_0x470b('0x2c')]=_0x522669[_0x470b('0x2d')];queues[_0x522669[_0x470b('0xf')]][_0x470b('0x19')]=!![];queues[_0x522669[_0x470b('0xf')]][_0x470b('0x2e')]=utils[_0x470b('0x13')]();if(_0x522669[_0x470b('0x2f')]=='transfer'){if(!queues[_0x522669[_0x470b('0xf')]][_0x470b('0x30')]){queues[_0x522669[_0x470b('0xf')]]['queuecallerexitreason']='TRANSFER';}}else{queues[_0x522669[_0x470b('0xf')]][_0x470b('0x7')]='COMPLETEDBY'+_0x522669['reason'][_0x470b('0x1e')]();}writeDB(queues[_0x522669[_0x470b('0xf')]]);}}};exports[_0x470b('0x31')]=function(_0xf61fa0){if(!_[_0x470b('0x15')](queues[_0xf61fa0['transfereeuniqueid']])){queues[_0xf61fa0[_0x470b('0x32')]][_0x470b('0x30')]=!![];queues[_0xf61fa0[_0x470b('0x32')]][_0x470b('0x33')]='BLIND';queues[_0xf61fa0[_0x470b('0x32')]][_0x470b('0x34')]=_0xf61fa0[_0x470b('0x35')];queues[_0xf61fa0['transfereeuniqueid']][_0x470b('0x36')]=_0xf61fa0[_0x470b('0x32')];queues[_0xf61fa0[_0x470b('0x32')]][_0x470b('0x7')]='BLINDTRANSFER';}};exports[_0x470b('0x37')]=function(_0x11b907){try{if(_0x11b907[_0x470b('0x38')]==_0x11b907[_0x470b('0x39')]){if(!_['isNil'](queues[_0x11b907[_0x470b('0x3a')]])){queues[_0x11b907[_0x470b('0x3a')]][_0x470b('0x30')]=!![];queues[_0x11b907[_0x470b('0x3a')]]['transfertype']=_0x470b('0x3b');queues[_0x11b907['secondtransfererlinkedid']][_0x470b('0x34')]=_0x11b907[_0x470b('0x3c')];queues[_0x11b907[_0x470b('0x3a')]][_0x470b('0x36')]=_0x11b907['origtransfereruniqueid'];queues[_0x11b907['secondtransfererlinkedid']][_0x470b('0x7')]=_0x470b('0x3d');}if(!_[_0x470b('0x15')](queues[_0x11b907['origtransfererlinkedid']])){if(_0x11b907[_0x470b('0x3e')]&&queues[_0x11b907[_0x470b('0x3e')]]){queues[_0x11b907[_0x470b('0x3e')]][_0x470b('0x1a')]=0x1;queues[_0x11b907[_0x470b('0x32')]]=_[_0x470b('0x3f')](queues[_0x11b907[_0x470b('0x3e')]]);queues[_0x11b907[_0x470b('0x32')]][_0x470b('0xe')]=_0x11b907[_0x470b('0x40')];queues[_0x11b907['transfereeuniqueid']][_0x470b('0x1a')]=0x2;queues[_0x11b907['transfereeuniqueid']]['calleridnum']=queues[_0x11b907['secondtransfererlinkedid']]['calleridnum'];queues[_0x11b907[_0x470b('0x32')]][_0x470b('0x41')]=queues[_0x11b907['secondtransfererlinkedid']][_0x470b('0x41')];queues[_0x11b907[_0x470b('0x32')]][_0x470b('0x26')]=utils['now']();queues[_0x11b907[_0x470b('0x32')]][_0x470b('0x16')]=utils[_0x470b('0x13')]();queues[_0x11b907[_0x470b('0x32')]][_0x470b('0x42')]=0x0;queues[_0x11b907[_0x470b('0x32')]][_0x470b('0x43')]=0x0;}else{queues[_0x11b907['origtransfererlinkedid']][_0x470b('0xe')]=_0x11b907['secondtransfererlinkedid'];}}}else if(_0x11b907[_0x470b('0x44')]==_0x11b907[_0x470b('0x3a')]){if(!_['isNil'](queues[_0x11b907[_0x470b('0x39')]])){queues[_0x11b907['origtransfererlinkedid']][_0x470b('0x30')]=!![];queues[_0x11b907['origtransfererlinkedid']]['transfertype']='ATTENDED';queues[_0x11b907[_0x470b('0x39')]][_0x470b('0x34')]=_0x11b907['secondtransfererexten'];queues[_0x11b907[_0x470b('0x39')]][_0x470b('0x36')]=_0x11b907[_0x470b('0x44')];queues[_0x11b907[_0x470b('0x39')]][_0x470b('0x7')]=_0x470b('0x3d');}if(!_[_0x470b('0x15')](queues[_0x11b907[_0x470b('0x3a')]])){if(_0x11b907[_0x470b('0x45')]&&queues[_0x11b907[_0x470b('0x45')]]){queues[_0x11b907[_0x470b('0x45')]]['queuecallerenterreason']=0x1;queues[_0x11b907[_0x470b('0x40')]]=_[_0x470b('0x3f')](queues[_0x11b907[_0x470b('0x45')]]);queues[_0x11b907['transfertargetuniqueid']][_0x470b('0xe')]=_0x11b907['transfertargetuniqueid'];queues[_0x11b907[_0x470b('0x40')]][_0x470b('0x1a')]=0x2;queues[_0x11b907['transfertargetuniqueid']][_0x470b('0x5')]=queues[_0x11b907[_0x470b('0x39')]][_0x470b('0x5')];queues[_0x11b907[_0x470b('0x40')]]['calleridname']=queues[_0x11b907[_0x470b('0x39')]][_0x470b('0x41')];queues[_0x11b907['transfertargetuniqueid']][_0x470b('0x26')]=utils[_0x470b('0x13')]();queues[_0x11b907[_0x470b('0x40')]]['queuecallerleaveAt']=utils[_0x470b('0x13')]();queues[_0x11b907[_0x470b('0x40')]][_0x470b('0x42')]=0x0;queues[_0x11b907[_0x470b('0x40')]][_0x470b('0x43')]=0x0;}else{queues[_0x11b907[_0x470b('0x3a')]][_0x470b('0xe')]=_0x11b907[_0x470b('0x39')];}}}}catch(_0xe138c9){utils[_0x470b('0x46')](_0xe138c9[_0x470b('0x47')]);}};exports[_0x470b('0x48')]=function(_0x44745e){if(!_['isNil'](queues[_0x44745e[_0x470b('0xf')]])){queues[_0x44745e[_0x470b('0xf')]][_0x470b('0x49')]=utils[_0x470b('0x13')]();}};exports[_0x470b('0x4a')]=function(_0x56644c){if(!_[_0x470b('0x15')](queues[_0x56644c['uniqueid']])){if(!_['isNil'](queues[_0x56644c[_0x470b('0xf')]][_0x470b('0x49')])){queues[_0x56644c[_0x470b('0xf')]]['mohtime']+=utils[_0x470b('0x25')](utils[_0x470b('0x13')](),queues[_0x56644c[_0x470b('0xf')]][_0x470b('0x49')]);delete queues[_0x56644c[_0x470b('0xf')]][_0x470b('0x49')];}}}; \ No newline at end of file +var _0x2154=['queuecallerexitreason','getVoiceQueueByName','then','type','request','CreateVoiceQueueReport','transfereduniqueid','queuecallerjoin','position','now','hangup','isNil','queuecallerabandon','queuecallerexit','queuecallercompleteAt','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','value','toUpperCase','CONTINUE','queuecallerabandonAt','EXITWITHKEY','queuecallerexitAt','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','lastAssignedTo','membername','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','transfereeuniqueid','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','transfertype','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','calleridname','secondtransfereruniqueid','transfertargetlinkedid','transfertargetuniqueid','clone','mohtime','musiconholdstart','musiconholdstartAt','musiconholdstop','util','./utils','info','format','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','calleridnum','accountcode'];(function(_0x469e05,_0x35a1d5){var _0x582aec=function(_0x47b4cb){while(--_0x47b4cb){_0x469e05['push'](_0x469e05['shift']());}};_0x582aec(++_0x35a1d5);}(_0x2154,0x12a));var _0x4215=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x2154[_0x138adb];return _0x1b27f2;};'use strict';var _=require('lodash');var util=require(_0x4215('0x0'));var utils=require(_0x4215('0x1'));var queues={};function writeDB(_0x2c1259){utils[_0x4215('0x2')](util[_0x4215('0x3')](_0x4215('0x4'),_0x2c1259[_0x4215('0x5')],_0x2c1259[_0x4215('0x6')],_0x2c1259[_0x4215('0x7')],_0x2c1259['lastAssignedTo'],_0x2c1259[_0x4215('0x8')],_0x2c1259[_0x4215('0x9')],_0x2c1259[_0x4215('0xa')]));if(_0x2c1259[_0x4215('0x7')]){utils[_0x4215('0xb')](_0x2c1259[_0x4215('0x7')])[_0x4215('0xc')](function(_0x44cf8a){if(_0x44cf8a){_0x2c1259[_0x4215('0xd')]=_0x44cf8a[_0x4215('0xd')];}utils[_0x4215('0xe')]('CreateVoiceQueueReport',_0x2c1259);});}else{utils[_0x4215('0xe')](_0x4215('0xf'),_0x2c1259);}if(_0x2c1259[_0x4215('0x10')]){delete queues[_0x2c1259[_0x4215('0x10')]];}else{delete queues[_0x2c1259[_0x4215('0x5')]];}}exports[_0x4215('0x11')]=function(_0x383f20){queues[_0x383f20[_0x4215('0x5')]]=_['assign'](_0x383f20,{'originalposition':_0x383f20[_0x4215('0x12')],'queuecallerjoinAt':utils[_0x4215('0x13')](),'mohtime':0x0});};exports[_0x4215('0x14')]=function(_0x1a815f){if(!_[_0x4215('0x15')](queues[_0x1a815f[_0x4215('0x5')]])){if(queues[_0x1a815f[_0x4215('0x5')]]['queuecallerleaveAt']){if(!queues[_0x1a815f[_0x4215('0x5')]][_0x4215('0x16')]&&!queues[_0x1a815f[_0x4215('0x5')]][_0x4215('0x17')]){queues[_0x1a815f[_0x4215('0x5')]]['queuecallercomplete']=!![];queues[_0x1a815f['uniqueid']][_0x4215('0x18')]=utils[_0x4215('0x13')]();queues[_0x1a815f[_0x4215('0x5')]][_0x4215('0xa')]=_0x4215('0x19');}writeDB(queues[_0x1a815f[_0x4215('0x5')]]);}else{if(queues[_0x1a815f['uniqueid']][_0x4215('0x10')]){queues[queues[_0x1a815f['uniqueid']][_0x4215('0x10')]]=queues[_0x1a815f[_0x4215('0x5')]];queues[queues[_0x1a815f['uniqueid']]['transfereduniqueid']][_0x4215('0x1a')]=0x2;delete queues[_0x1a815f[_0x4215('0x5')]];}}}};exports[_0x4215('0x1b')]=function(_0x1f90a5){if(!_[_0x4215('0x15')](_0x1f90a5[_0x4215('0x1c')]['queuestatus'])&&_0x1f90a5[_0x4215('0x1d')][_0x4215('0x1e')]()!==_0x4215('0x1f')){if(!_[_0x4215('0x15')](queues[_0x1f90a5[_0x4215('0x5')]])){queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x16')]=![];queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x20')]=null;queues[_0x1f90a5[_0x4215('0x5')]]['queuecallerexit']=!![];queues[_0x1f90a5['uniqueid']]['queuecallerexitAt']=utils[_0x4215('0x13')]();queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0xa')]=_0x1f90a5['value'][_0x4215('0x1e')]();writeDB(queues[_0x1f90a5[_0x4215('0x5')]]);}}else if(!_[_0x4215('0x15')](_0x1f90a5[_0x4215('0x1c')]['queueposition'])){if(!_[_0x4215('0x15')](queues[_0x1f90a5[_0x4215('0x5')]])&&!queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x16')]){queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x16')]=![];queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x20')]=null;queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0x17')]=!![];queues[_0x1f90a5[_0x4215('0x5')]]['queuecallerexitAt']=utils['now']();queues[_0x1f90a5[_0x4215('0x5')]][_0x4215('0xa')]=_0x4215('0x21');}}};exports[_0x4215('0x16')]=function(_0x55933b){if(!_[_0x4215('0x15')](queues[_0x55933b[_0x4215('0x5')]])){queues[_0x55933b['uniqueid']]['queuecallerexit']=![];queues[_0x55933b[_0x4215('0x5')]][_0x4215('0x22')]=null;queues[_0x55933b[_0x4215('0x5')]][_0x4215('0x16')]=!![];queues[_0x55933b[_0x4215('0x5')]][_0x4215('0x20')]=utils['now']();queues[_0x55933b[_0x4215('0x5')]]['queuecallerexitreason']=_0x4215('0x23');}};exports[_0x4215('0x24')]=function(_0xb17bf1){if(!_['isNil'](queues[_0xb17bf1[_0x4215('0x5')]])){queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x24')]=!![];queues[_0xb17bf1[_0x4215('0x5')]]['queuecallerleaveAt']=utils[_0x4215('0x13')]();queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x25')]=utils[_0x4215('0x26')](queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x27')],queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x28')]);queues[_0xb17bf1[_0x4215('0x5')]]['position']=_0xb17bf1['position'];queues[_0xb17bf1['uniqueid']][_0x4215('0x29')]=_0xb17bf1[_0x4215('0x29')];queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x2a')]=_0xb17bf1[_0x4215('0x2a')];queues[_0xb17bf1[_0x4215('0x5')]][_0x4215('0x2b')]=_0xb17bf1[_0x4215('0x2b')];}};exports[_0x4215('0x2c')]=function(_0x99491e){if(!_[_0x4215('0x15')](queues[_0x99491e[_0x4215('0x5')]])){queues[_0x99491e[_0x4215('0x5')]][_0x4215('0x16')]=![];queues[_0x99491e['uniqueid']]['queuecallerabandon']=![];queues[_0x99491e[_0x4215('0x5')]][_0x4215('0x20')]=null;queues[_0x99491e[_0x4215('0x5')]]['queuecallerexit']=![];queues[_0x99491e[_0x4215('0x5')]][_0x4215('0xa')]=null;queues[_0x99491e[_0x4215('0x5')]][_0x4215('0x22')]=null;queues[_0x99491e[_0x4215('0x5')]][_0x4215('0x2d')]=!![];queues[_0x99491e[_0x4215('0x5')]]['accountcode']=_0x99491e[_0x4215('0x2e')];queues[_0x99491e['uniqueid']][_0x4215('0x2f')]=_0x99491e[_0x4215('0x30')];}};exports['agentcomplete']=function(_0x2c9638){if(!_[_0x4215('0x15')](queues[_0x2c9638['uniqueid']])){if(queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x27')]){queues[_0x2c9638[_0x4215('0x5')]]['queuecallerabandon']=![];queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x16')]=![];queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x20')]=null;queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x17')]=![];queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x22')]=null;queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x2d')]=!![];queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x2f')]=_0x2c9638[_0x4215('0x30')];queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0x31')]=!![];queues[_0x2c9638['uniqueid']]['queuecallercompleteAt']=utils[_0x4215('0x13')]();if(_0x2c9638[_0x4215('0x32')]==_0x4215('0x33')){if(!queues[_0x2c9638['uniqueid']]['transfer']){queues[_0x2c9638[_0x4215('0x5')]][_0x4215('0xa')]=_0x4215('0x34');}}else{queues[_0x2c9638['uniqueid']][_0x4215('0xa')]=_0x4215('0x35')+_0x2c9638[_0x4215('0x32')]['toUpperCase']();}writeDB(queues[_0x2c9638[_0x4215('0x5')]]);}}};exports['blindtransfer']=function(_0x6ea903){if(!_[_0x4215('0x15')](queues[_0x6ea903['transfereeuniqueid']])){queues[_0x6ea903['transfereeuniqueid']]['transfer']=!![];queues[_0x6ea903[_0x4215('0x36')]]['transfertype']='BLIND';queues[_0x6ea903[_0x4215('0x36')]][_0x4215('0x37')]=_0x6ea903[_0x4215('0x38')];queues[_0x6ea903[_0x4215('0x36')]][_0x4215('0x39')]=_0x6ea903[_0x4215('0x36')];queues[_0x6ea903['transfereeuniqueid']][_0x4215('0xa')]=_0x4215('0x3a');}};exports[_0x4215('0x3b')]=function(_0x1b896d){try{if(_0x1b896d['origtransfereruniqueid']==_0x1b896d[_0x4215('0x3c')]){if(!_[_0x4215('0x15')](queues[_0x1b896d['secondtransfererlinkedid']])){queues[_0x1b896d[_0x4215('0x3d')]]['transfer']=!![];queues[_0x1b896d[_0x4215('0x3d')]][_0x4215('0x3e')]=_0x4215('0x3f');queues[_0x1b896d[_0x4215('0x3d')]]['transferexten']=_0x1b896d[_0x4215('0x40')];queues[_0x1b896d['secondtransfererlinkedid']][_0x4215('0x39')]=_0x1b896d[_0x4215('0x41')];queues[_0x1b896d[_0x4215('0x3d')]][_0x4215('0xa')]=_0x4215('0x42');}if(!_['isNil'](queues[_0x1b896d[_0x4215('0x3c')]])){if(_0x1b896d[_0x4215('0x43')]&&queues[_0x1b896d[_0x4215('0x43')]]){queues[_0x1b896d[_0x4215('0x43')]]['queuecallerenterreason']=0x1;queues[_0x1b896d[_0x4215('0x36')]]=_['clone'](queues[_0x1b896d[_0x4215('0x43')]]);queues[_0x1b896d['transfereeuniqueid']][_0x4215('0x10')]=_0x1b896d['transfertargetuniqueid'];queues[_0x1b896d['transfereeuniqueid']]['queuecallerenterreason']=0x2;queues[_0x1b896d[_0x4215('0x36')]]['calleridnum']=queues[_0x1b896d[_0x4215('0x3d')]]['calleridnum'];queues[_0x1b896d[_0x4215('0x36')]][_0x4215('0x44')]=queues[_0x1b896d[_0x4215('0x3d')]][_0x4215('0x44')];queues[_0x1b896d['transfereeuniqueid']][_0x4215('0x28')]=utils[_0x4215('0x13')]();queues[_0x1b896d[_0x4215('0x36')]]['queuecallerleaveAt']=utils[_0x4215('0x13')]();queues[_0x1b896d[_0x4215('0x36')]][_0x4215('0x25')]=0x0;queues[_0x1b896d[_0x4215('0x36')]]['mohtime']=0x0;}else{queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x10')]=_0x1b896d['secondtransfererlinkedid'];}}}else if(_0x1b896d[_0x4215('0x45')]==_0x1b896d['secondtransfererlinkedid']){if(!_[_0x4215('0x15')](queues[_0x1b896d['origtransfererlinkedid']])){queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x33')]=!![];queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x3e')]='ATTENDED';queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x37')]=_0x1b896d['secondtransfererexten'];queues[_0x1b896d[_0x4215('0x3c')]]['transferuniqueid']=_0x1b896d[_0x4215('0x45')];queues[_0x1b896d['origtransfererlinkedid']][_0x4215('0xa')]=_0x4215('0x42');}if(!_[_0x4215('0x15')](queues[_0x1b896d['secondtransfererlinkedid']])){if(_0x1b896d[_0x4215('0x46')]&&queues[_0x1b896d[_0x4215('0x46')]]){queues[_0x1b896d[_0x4215('0x46')]]['queuecallerenterreason']=0x1;queues[_0x1b896d[_0x4215('0x47')]]=_[_0x4215('0x48')](queues[_0x1b896d['transfertargetlinkedid']]);queues[_0x1b896d[_0x4215('0x47')]][_0x4215('0x10')]=_0x1b896d['transfertargetuniqueid'];queues[_0x1b896d[_0x4215('0x47')]][_0x4215('0x1a')]=0x2;queues[_0x1b896d[_0x4215('0x47')]][_0x4215('0x8')]=queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x8')];queues[_0x1b896d['transfertargetuniqueid']][_0x4215('0x44')]=queues[_0x1b896d[_0x4215('0x3c')]][_0x4215('0x44')];queues[_0x1b896d[_0x4215('0x47')]]['queuecallerjoinAt']=utils['now']();queues[_0x1b896d[_0x4215('0x47')]][_0x4215('0x27')]=utils['now']();queues[_0x1b896d[_0x4215('0x47')]]['holdtime']=0x0;queues[_0x1b896d[_0x4215('0x47')]][_0x4215('0x49')]=0x0;}else{queues[_0x1b896d[_0x4215('0x3d')]][_0x4215('0x10')]=_0x1b896d[_0x4215('0x3c')];}}}}catch(_0x3a88ce){utils['error'](_0x3a88ce['stack']);}};exports[_0x4215('0x4a')]=function(_0x938bf){if(!_[_0x4215('0x15')](queues[_0x938bf[_0x4215('0x5')]])){queues[_0x938bf[_0x4215('0x5')]][_0x4215('0x4b')]=utils['now']();}};exports[_0x4215('0x4c')]=function(_0x44638f){if(!_[_0x4215('0x15')](queues[_0x44638f['uniqueid']])){if(!_[_0x4215('0x15')](queues[_0x44638f[_0x4215('0x5')]][_0x4215('0x4b')])){queues[_0x44638f['uniqueid']][_0x4215('0x49')]+=utils['diffTime'](utils[_0x4215('0x13')](),queues[_0x44638f[_0x4215('0x5')]][_0x4215('0x4b')]);delete queues[_0x44638f['uniqueid']][_0x4215('0x4b')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index c66c717..52b0d55 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 _0x34e8=['membername','name','UserId','CreateVoiceRecording','newchannel','uniqueid','linkedid','exten','context','channel','error','stack','newstate','isNil','channelstate','transfer','variable','mixmonitor_filename','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','lodash','./utils','debug','getUserByInternal','accountcode','then'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0x34e8,0x12c));var _0x834e=function(_0x3347b8,_0xd8efa){_0x3347b8=_0x3347b8-0x0;var _0x1ced54=_0x34e8[_0x3347b8];return _0x1ced54;};'use strict';var _=require(_0x834e('0x0'));var utils=require(_0x834e('0x1'));var recordings={};function writeDB(_0x8b339){utils[_0x834e('0x2')](_0x8b339);if(_0x8b339['accountcode']){utils[_0x834e('0x3')](_0x8b339[_0x834e('0x4')])[_0x834e('0x5')](function(_0x31bf20){if(_0x31bf20){_0x8b339[_0x834e('0x6')]=_0x31bf20[_0x834e('0x7')];_0x8b339[_0x834e('0x8')]=_0x31bf20['id'];}utils['request'](_0x834e('0x9'),_0x8b339);});}else{utils['request'](_0x834e('0x9'),_0x8b339);}}exports[_0x834e('0xa')]=function(_0x3a3ef6){try{if(_0x3a3ef6[_0x834e('0xb')]==_0x3a3ef6[_0x834e('0xc')]){recordings[_0x3a3ef6[_0x834e('0xb')]]={'uniqueid':_0x3a3ef6[_0x834e('0xb')],'accountcode':_0x3a3ef6[_0x834e('0x4')],'exten':_0x3a3ef6[_0x834e('0xd')],'context':_0x3a3ef6[_0x834e('0xe')],'channel':_0x3a3ef6[_0x834e('0xf')],'monitors':[]};}}catch(_0x36e124){utils[_0x834e('0x10')](_0x36e124[_0x834e('0x11')]);}};exports[_0x834e('0x12')]=function(_0x1e00de){try{if(!_[_0x834e('0x13')](recordings[_0x1e00de['uniqueid']])&&_0x1e00de[_0x834e('0x14')]==0x6){}else if(!_[_0x834e('0x13')](recordings[_0x1e00de['linkedid']])&&_0x1e00de[_0x834e('0x14')]==0x6&&_0x1e00de[_0x834e('0xe')]!=_0x834e('0x15')){recordings[_0x1e00de[_0x834e('0xc')]]['accountcode']=_0x1e00de[_0x834e('0x4')];}}catch(_0x302cbd){utils['error'](_0x302cbd[_0x834e('0x11')]);}};exports['varset']=function(_0x38a8cd){try{if(!_[_0x834e('0x13')](_0x38a8cd['variable'])&&!_[_0x834e('0x13')](_0x38a8cd[_0x834e('0x16')][_0x834e('0x17')])){if(_['endsWith'](_0x38a8cd[_0x834e('0x18')],_0x834e('0x19'))){_0x38a8cd[_0x834e('0x18')]=_0x38a8cd[_0x834e('0x18')][_0x834e('0x1a')](_0x834e('0x19'),_0x834e('0x1b'));}if(recordings[_0x38a8cd['linkedid']]){var _0x2545b4=_[_0x834e('0x1c')](recordings[_0x38a8cd[_0x834e('0xc')]][_0x834e('0x1d')],{'value':_0x38a8cd['value']});if(_[_0x834e('0x13')](_0x2545b4)){recordings[_0x38a8cd[_0x834e('0xc')]]['monitors'][_0x834e('0x1e')]({'value':_0x38a8cd[_0x834e('0x18')]});}}}}catch(_0x8d406e){utils['error'](_0x8d406e['stack']);}};exports[_0x834e('0x1f')]=function(_0x34563b){try{if(!_['isNil'](recordings[_0x34563b[_0x834e('0xb')]])){recordings[_0x34563b[_0x834e('0xb')]]['calleridnum']=_0x34563b[_0x834e('0x20')];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x21')]=_0x34563b['calleridname'];recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x22')]=_0x34563b['connectedlinenum'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]=_0x34563b['connectedlinename'];if(recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x24')]==_0x834e('0x25')&&recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x4')]){recordings[_0x34563b[_0x834e('0xb')]]['connectedlinenum']=recordings[_0x34563b['uniqueid']]['accountcode'];recordings[_0x34563b['uniqueid']][_0x834e('0x23')]='';}recordings[_0x34563b[_0x834e('0xb')]][_0x834e('0x1d')]['forEach'](_0xb5bc06=>{var _0x11f1ce=_[_0x834e('0x26')](recordings[_0x34563b[_0x834e('0xb')]]);_0x11f1ce[_0x834e('0x18')]=_0xb5bc06[_0x834e('0x18')];writeDB(_0x11f1ce);});delete recordings[_0x34563b[_0x834e('0xb')]];}}catch(_0xfaf716){utils[_0x834e('0x10')](_0xfaf716['stack']);}};exports[_0x834e('0x27')]=function(_0x5cad11){try{if(!_[_0x834e('0x13')](recordings[_0x5cad11[_0x834e('0xb')]])){if(_0x5cad11[_0x834e('0x28')][_0x834e('0x29')]()==_0x834e('0x2a')&&_[_0x834e('0x2b')](_0x5cad11[_0x834e('0x2c')][_0x834e('0x29')](),_0x834e('0x2d'))){var _0x12b2bc=_0x5cad11['appdata'][_0x834e('0x2e')]('=');var _0x2f408a=_0x12b2bc[0x0][_0x834e('0x2f')](_0x12b2bc[0x0][_0x834e('0x30')]('(')+0x1,_0x12b2bc[0x0]['lastIndexOf'](')'));var _0x3f88ad=_0x12b2bc[0x1];recordings[_0x5cad11[_0x834e('0xb')]][_0x2f408a]=_0x3f88ad;}}}catch(_0x4b12f5){utils['error'](_0x4b12f5['stack']);}};exports[_0x834e('0x31')]=function(_0x41bf4d){try{if(!_[_0x834e('0x13')](recordings[_0x41bf4d[_0x834e('0xb')]])){recordings[_0x41bf4d[_0x834e('0xb')]][_0x834e('0x32')]=_0x41bf4d['queue'];}}catch(_0x2c2d94){utils['error'](_0x2c2d94[_0x834e('0x11')]);}}; \ No newline at end of file +var _0x9c44=['getUserByInternal','then','name','request','CreateVoiceRecording','newchannel','uniqueid','linkedid','context','channel','error','stack','isNil','transfer','variable','endsWith','value','replace','.wav49','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','outbound','forEach','clone','newexten','toLowerCase','set','startsWith','appdata','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode'];(function(_0x4a45de,_0x236534){var _0x377b63=function(_0x1e1ffc){while(--_0x1e1ffc){_0x4a45de['push'](_0x4a45de['shift']());}};_0x377b63(++_0x236534);}(_0x9c44,0x178));var _0x49c4=function(_0x13b02f,_0x462a53){_0x13b02f=_0x13b02f-0x0;var _0x12e9a6=_0x9c44[_0x13b02f];return _0x12e9a6;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x1ffbbf){utils[_0x49c4('0x0')](_0x1ffbbf);if(_0x1ffbbf[_0x49c4('0x1')]){utils[_0x49c4('0x2')](_0x1ffbbf[_0x49c4('0x1')])[_0x49c4('0x3')](function(_0x4e0313){if(_0x4e0313){_0x1ffbbf['membername']=_0x4e0313[_0x49c4('0x4')];_0x1ffbbf['UserId']=_0x4e0313['id'];}utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);});}else{utils[_0x49c4('0x5')](_0x49c4('0x6'),_0x1ffbbf);}}exports[_0x49c4('0x7')]=function(_0x511d53){try{if(_0x511d53[_0x49c4('0x8')]==_0x511d53[_0x49c4('0x9')]){recordings[_0x511d53[_0x49c4('0x8')]]={'uniqueid':_0x511d53[_0x49c4('0x8')],'accountcode':_0x511d53['accountcode'],'exten':_0x511d53['exten'],'context':_0x511d53[_0x49c4('0xa')],'channel':_0x511d53[_0x49c4('0xb')],'monitors':[]};}}catch(_0x58cad7){utils[_0x49c4('0xc')](_0x58cad7[_0x49c4('0xd')]);}};exports['newstate']=function(_0x536d42){try{if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x8')]])&&_0x536d42['channelstate']==0x6){}else if(!_[_0x49c4('0xe')](recordings[_0x536d42[_0x49c4('0x9')]])&&_0x536d42['channelstate']==0x6&&_0x536d42[_0x49c4('0xa')]!=_0x49c4('0xf')){recordings[_0x536d42[_0x49c4('0x9')]][_0x49c4('0x1')]=_0x536d42[_0x49c4('0x1')];}}catch(_0x18211c){utils[_0x49c4('0xc')](_0x18211c[_0x49c4('0xd')]);}};exports['varset']=function(_0x3acd06){try{if(!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')])&&!_[_0x49c4('0xe')](_0x3acd06[_0x49c4('0x10')]['mixmonitor_filename'])){if(_[_0x49c4('0x11')](_0x3acd06[_0x49c4('0x12')],'.wav49')){_0x3acd06['value']=_0x3acd06[_0x49c4('0x12')][_0x49c4('0x13')](_0x49c4('0x14'),'.WAV');}if(recordings[_0x3acd06[_0x49c4('0x9')]]){var _0x50b151=_[_0x49c4('0x15')](recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')],{'value':_0x3acd06[_0x49c4('0x12')]});if(_[_0x49c4('0xe')](_0x50b151)){recordings[_0x3acd06[_0x49c4('0x9')]][_0x49c4('0x16')][_0x49c4('0x17')]({'value':_0x3acd06[_0x49c4('0x12')]});}}}}catch(_0x578447){utils['error'](_0x578447['stack']);}};exports[_0x49c4('0x18')]=function(_0x4f0b62){try{if(!_['isNil'](recordings[_0x4f0b62[_0x49c4('0x8')]])){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x19')]=_0x4f0b62[_0x49c4('0x19')];recordings[_0x4f0b62['uniqueid']]['calleridname']=_0x4f0b62[_0x49c4('0x1a')];recordings[_0x4f0b62[_0x49c4('0x8')]]['connectedlinenum']=_0x4f0b62[_0x49c4('0x1b')];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]=_0x4f0b62[_0x49c4('0x1c')];if(recordings[_0x4f0b62['uniqueid']]['type']==_0x49c4('0x1d')&&recordings[_0x4f0b62['uniqueid']][_0x49c4('0x1')]){recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1b')]=recordings[_0x4f0b62[_0x49c4('0x8')]]['accountcode'];recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x1c')]='';}recordings[_0x4f0b62[_0x49c4('0x8')]][_0x49c4('0x16')][_0x49c4('0x1e')](_0x29f835=>{var _0x26ba17=_[_0x49c4('0x1f')](recordings[_0x4f0b62[_0x49c4('0x8')]]);_0x26ba17[_0x49c4('0x12')]=_0x29f835[_0x49c4('0x12')];writeDB(_0x26ba17);});delete recordings[_0x4f0b62['uniqueid']];}}catch(_0x4f4495){utils['error'](_0x4f4495[_0x49c4('0xd')]);}};exports[_0x49c4('0x20')]=function(_0x1eb035){try{if(!_[_0x49c4('0xe')](recordings[_0x1eb035[_0x49c4('0x8')]])){if(_0x1eb035['application'][_0x49c4('0x21')]()==_0x49c4('0x22')&&_[_0x49c4('0x23')](_0x1eb035[_0x49c4('0x24')]['toLowerCase'](),'cdr')){var _0xce57ef=_0x1eb035[_0x49c4('0x24')][_0x49c4('0x25')]('=');var _0x13b3b4=_0xce57ef[0x0][_0x49c4('0x26')](_0xce57ef[0x0]['lastIndexOf']('(')+0x1,_0xce57ef[0x0][_0x49c4('0x27')](')'));var _0x84c621=_0xce57ef[0x1];recordings[_0x1eb035[_0x49c4('0x8')]][_0x13b3b4]=_0x84c621;}}}catch(_0x512d02){utils['error'](_0x512d02[_0x49c4('0xd')]);}};exports[_0x49c4('0x28')]=function(_0x3bec0a){try{if(!_[_0x49c4('0xe')](recordings[_0x3bec0a[_0x49c4('0x8')]])){recordings[_0x3bec0a[_0x49c4('0x8')]][_0x49c4('0x29')]=_0x3bec0a[_0x49c4('0x29')];}}catch(_0x3209cd){utils['error'](_0x3209cd[_0x49c4('0xd')]);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index 3cfb181..bfc6950 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 _0xaab2=['CreateVoiceTransferReport','blind','error','stack','assign','origtransfererchannel','origtransferercalleridnum','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransferercontext','secondtransfererexten','origtransferercontext','origtransfererexten','attended','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetcontext','util','./utils','format','TRANSFER|%s','type','request'];(function(_0x50368e,_0x17ee72){var _0x381d5d=function(_0x1aa026){while(--_0x1aa026){_0x50368e['push'](_0x50368e['shift']());}};_0x381d5d(++_0x17ee72);}(_0xaab2,0xca));var _0x2aab=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0xaab2[_0x29b609];return _0x54c952;};'use strict';var _=require('lodash');var util=require(_0x2aab('0x0'));var utils=require(_0x2aab('0x1'));function writeDB(_0x1d1057){utils['info'](util[_0x2aab('0x2')](_0x2aab('0x3'),_0x1d1057[_0x2aab('0x4')]));utils[_0x2aab('0x5')](_0x2aab('0x6'),_0x1d1057);}exports['blindtransfer']=function(_0x1b01e0){try{_0x1b01e0['type']=_0x2aab('0x7');writeDB(_0x1b01e0);}catch(_0x276906){utils[_0x2aab('0x8')](_0x276906[_0x2aab('0x9')]);}};exports['attendedtransfer']=function(_0xf6602a){try{_0xf6602a=_[_0x2aab('0xa')](_0xf6602a,{'transfererchannel':_0xf6602a[_0x2aab('0xb')],'transferercalleridnum':_0xf6602a[_0x2aab('0xc')],'transferercalleridname':_0xf6602a[_0x2aab('0xd')],'transfererconnectedlinenum':_0xf6602a[_0x2aab('0xe')],'transfererconnectedlinename':_0xf6602a['secondtransfererconnectedlinename'],'transfereraccountcode':_0xf6602a['origtransfereraccountcode'],'transferercontext':_0xf6602a[_0x2aab('0xf')],'transfererexten':_0xf6602a[_0x2aab('0x10')],'transfererlinkedid':_0xf6602a['origtransfererlinkedid'],'context':_0xf6602a[_0x2aab('0x11')],'extension':_0xf6602a[_0x2aab('0x12')],'type':_0x2aab('0x13')});if(_['isNil'](_0xf6602a[_0x2aab('0x14')])){_0xf6602a=_[_0x2aab('0xa')](_0xf6602a,{'transfereechannel':_0xf6602a[_0x2aab('0x15')],'transfereecalleridnum':_0xf6602a[_0x2aab('0x16')],'transfereecalleridname':_0xf6602a[_0x2aab('0x17')],'transfereeconnectedlinenum':_0xf6602a[_0x2aab('0x18')],'transfereeconnectedlinename':_0xf6602a['transfertargetconnectedlinename'],'transfereeaccountcode':_0xf6602a['transfertargetaccountcode'],'transfereecontext':_0xf6602a[_0x2aab('0x19')],'transfereeexten':_0xf6602a['transfertargetexten'],'transfereelinkedid':_0xf6602a['transfertargetlinkedid']});}writeDB(_0xf6602a);}catch(_0x135345){utils[_0x2aab('0x8')](_0x135345[_0x2aab('0x9')]);}}; \ No newline at end of file +var _0x6b71=['stack','attendedtransfer','assign','origtransferercalleridnum','secondtransfererconnectedlinenum','origtransfereraccountcode','origtransfererlinkedid','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','transfertargetlinkedid','lodash','util','info','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer'];(function(_0x5c7883,_0x2d0e2e){var _0x2e4777=function(_0x86e0cc){while(--_0x86e0cc){_0x5c7883['push'](_0x5c7883['shift']());}};_0x2e4777(++_0x2d0e2e);}(_0x6b71,0x12c));var _0x16b7=function(_0x196995,_0x2575dd){_0x196995=_0x196995-0x0;var _0x1ff73a=_0x6b71[_0x196995];return _0x1ff73a;};'use strict';var _=require(_0x16b7('0x0'));var util=require(_0x16b7('0x1'));var utils=require('./utils');function writeDB(_0x349f1e){utils[_0x16b7('0x2')](util['format'](_0x16b7('0x3'),_0x349f1e[_0x16b7('0x4')]));utils[_0x16b7('0x5')](_0x16b7('0x6'),_0x349f1e);}exports[_0x16b7('0x7')]=function(_0x22f69e){try{_0x22f69e['type']='blind';writeDB(_0x22f69e);}catch(_0x30002d){utils['error'](_0x30002d[_0x16b7('0x8')]);}};exports[_0x16b7('0x9')]=function(_0x38b48f){try{_0x38b48f=_[_0x16b7('0xa')](_0x38b48f,{'transfererchannel':_0x38b48f['origtransfererchannel'],'transferercalleridnum':_0x38b48f[_0x16b7('0xb')],'transferercalleridname':_0x38b48f['origtransferercalleridname'],'transfererconnectedlinenum':_0x38b48f[_0x16b7('0xc')],'transfererconnectedlinename':_0x38b48f['secondtransfererconnectedlinename'],'transfereraccountcode':_0x38b48f[_0x16b7('0xd')],'transferercontext':_0x38b48f['secondtransferercontext'],'transfererexten':_0x38b48f['secondtransfererexten'],'transfererlinkedid':_0x38b48f[_0x16b7('0xe')],'context':_0x38b48f[_0x16b7('0xf')],'extension':_0x38b48f['origtransfererexten'],'type':_0x16b7('0x10')});if(_[_0x16b7('0x11')](_0x38b48f[_0x16b7('0x12')])){_0x38b48f=_['assign'](_0x38b48f,{'transfereechannel':_0x38b48f[_0x16b7('0x13')],'transfereecalleridnum':_0x38b48f[_0x16b7('0x14')],'transfereecalleridname':_0x38b48f[_0x16b7('0x15')],'transfereeconnectedlinenum':_0x38b48f[_0x16b7('0x16')],'transfereeconnectedlinename':_0x38b48f[_0x16b7('0x17')],'transfereeaccountcode':_0x38b48f[_0x16b7('0x18')],'transfereecontext':_0x38b48f[_0x16b7('0x19')],'transfereeexten':_0x38b48f[_0x16b7('0x1a')],'transfereelinkedid':_0x38b48f[_0x16b7('0x1b')]});}writeDB(_0x38b48f);}catch(_0x5e5035){utils['error'](_0x5e5035[_0x16b7('0x8')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index 21a5f33..a3f1194 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 _0xfe59=['interface','GETUSER|','result','length','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','FOUND','NOTFOUND','addTime','seconds','format','YYYY-MM-DD\x20HH:mm:ss','diffTime','sumTime','now','isAfter','isBefore','moment','client','http','../../config/logger','xdr','info','stringify','error','stack','request','then','catch','name'];(function(_0x30ae5e,_0x391fc4){var _0x1f2e93=function(_0x60307d){while(--_0x60307d){_0x30ae5e['push'](_0x30ae5e['shift']());}};_0x1f2e93(++_0x391fc4);}(_0xfe59,0x83));var _0x9fe5=function(_0x59a0df,_0x2c95ef){_0x59a0df=_0x59a0df-0x0;var _0x3639b3=_0xfe59[_0x59a0df];return _0x3639b3;};'use strict';var jayson=require('jayson/promise');var moment=require(_0x9fe5('0x0'));var BPromise=require('bluebird');var client=jayson[_0x9fe5('0x1')][_0x9fe5('0x2')]({'port':0x2329});var logger=require(_0x9fe5('0x3'))(_0x9fe5('0x4'));exports['info']=function(_0xf7e98d){logger[_0x9fe5('0x5')](_0xf7e98d);};exports['debug']=function(_0x1bbb54){logger['debug'](JSON[_0x9fe5('0x6')](_0x1bbb54));};exports['error']=function(_0xb0d953){logger[_0x9fe5('0x7')](_0xb0d953[_0x9fe5('0x8')]);};exports[_0x9fe5('0x9')]=function(_0x118950,_0x38fed4){return client[_0x9fe5('0x9')](_0x118950,{'body':_0x38fed4})[_0x9fe5('0xa')](function(_0x614930){logger['debug'](JSON['stringify'](_0x614930));})[_0x9fe5('0xb')](function(_0x4e4d28){logger[_0x9fe5('0x7')](_0x4e4d28[_0x9fe5('0x8')]);});};function getUser(_0x2baa6b){return client['request']('GetUser',{'options':{'raw':!![],'attributes':['id','internal',_0x9fe5('0xc'),_0x9fe5('0xd')],'where':_0x2baa6b,'limit':0x1}})[_0x9fe5('0xa')](function(_0x2e0a06){logger['info'](_0x9fe5('0xe')+JSON[_0x9fe5('0x6')](_0x2baa6b)+'|'+(_0x2e0a06[_0x9fe5('0xf')][_0x9fe5('0x10')]?'FOUND':'NOTFOUND'));return _0x2e0a06['result'][_0x9fe5('0x10')]?_0x2e0a06['result'][0x0]:null;});}exports['getUserByInternal']=function(_0x5f488e){return new BPromise(function(_0x499118,_0x2b4a8e){if(_0x5f488e){return getUser({'internal':_0x5f488e})[_0x9fe5('0xa')](function(_0xfa1f3d){return _0x499118(_0xfa1f3d);})[_0x9fe5('0xb')](function(_0x37f21b){logger[_0x9fe5('0x7')](_0x37f21b[_0x9fe5('0x8')]);return _0x499118(null);});}else{return _0x499118(null);}});};exports[_0x9fe5('0x11')]=function(_0x5ce259){return new BPromise(function(_0x344f1e,_0x4b6028){if(_0x5ce259){return getUser({'interface':_0x5ce259})['then'](function(_0x8a83a4){return _0x344f1e(_0x8a83a4);})[_0x9fe5('0xb')](function(_0x132d9f){logger[_0x9fe5('0x7')](_0x132d9f[_0x9fe5('0x8')]);return _0x344f1e(null);});}else{return _0x344f1e(null);}});};exports[_0x9fe5('0x12')]=function(_0x18e65a){return new BPromise(function(_0x147a49,_0x23c7fc){if(_0x18e65a){return getUser({'name':_0x18e65a})[_0x9fe5('0xa')](function(_0x173c50){return _0x147a49(_0x173c50);})[_0x9fe5('0xb')](function(_0x55beb6){logger['error'](_0x55beb6['stack']);return _0x147a49(null);});}else{return _0x147a49(null);}});};exports[_0x9fe5('0x13')]=function(_0x425ad5){return new BPromise(function(_0x4374ce,_0x3ae007){if(_0x425ad5){return client[_0x9fe5('0x9')](_0x9fe5('0x14'),{'options':{'raw':!![],'attributes':['id',_0x9fe5('0xc'),_0x9fe5('0x15'),_0x9fe5('0x16'),_0x9fe5('0x17')],'where':{'name':_0x425ad5},'limit':0x1}})[_0x9fe5('0xa')](function(_0x4e832d){logger[_0x9fe5('0x5')](_0x9fe5('0x18')+_0x425ad5+'|'+(_0x4e832d[_0x9fe5('0xf')][_0x9fe5('0x10')]?_0x9fe5('0x19'):_0x9fe5('0x1a')));return _0x4374ce(_0x4e832d['result'][_0x9fe5('0x10')]?_0x4e832d[_0x9fe5('0xf')][0x0]:null);})[_0x9fe5('0xb')](function(_0x1cd56f){logger['error'](_0x1cd56f['stack']);return _0x4374ce(null);});}else{return _0x4374ce(null);}});};exports[_0x9fe5('0x1b')]=function(_0x2a7517,_0x37fef7){return moment(_0x2a7517)['add'](_0x37fef7,_0x9fe5('0x1c'))['format']('YYYY-MM-DD\x20HH:mm:ss');};exports['subtractTime']=function(_0x186a73,_0x52ee05){return moment(_0x186a73)['subtract'](_0x52ee05,'seconds')[_0x9fe5('0x1d')](_0x9fe5('0x1e'));};exports[_0x9fe5('0x1f')]=function(_0x5411c2,_0x3e4bfe){return moment(_0x5411c2)['diff'](moment(_0x3e4bfe),_0x9fe5('0x1c'));};exports[_0x9fe5('0x20')]=function(_0x47309e,_0x41f1ac){return parseInt(_0x47309e,0xa)+parseInt(_0x41f1ac,0xa);};exports[_0x9fe5('0x21')]=function(){return moment()['format'](_0x9fe5('0x1e'));};exports[_0x9fe5('0x22')]=function(_0x33c31c,_0x1f9adf){if(_0x1f9adf){return moment(_0x33c31c)[_0x9fe5('0x22')](_0x1f9adf);}else{return!![];}};exports[_0x9fe5('0x23')]=function(_0x1c086b,_0x4c7e7a){if(_0x4c7e7a){return moment(_0x1c086b)[_0x9fe5('0x23')](_0x4c7e7a);}else if(_0x1c086b){return!![];}else{return![];}}; \ No newline at end of file +var _0x0f8e=['seconds','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','diff','now','isAfter','isBefore','moment','bluebird','client','http','../../config/logger','xdr','info','debug','error','stack','catch','request','GetUser','internal','name','interface','then','result','FOUND','NOTFOUND','getUserByInternal','getUserByInterface','getUserByName','getVoiceQueueByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','length','addTime'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x0f8e,0x199));var _0xe0f8=function(_0x11ea64,_0x59f7a2){_0x11ea64=_0x11ea64-0x0;var _0x30590a=_0x0f8e[_0x11ea64];return _0x30590a;};'use strict';var jayson=require('jayson/promise');var moment=require(_0xe0f8('0x0'));var BPromise=require(_0xe0f8('0x1'));var client=jayson[_0xe0f8('0x2')][_0xe0f8('0x3')]({'port':0x2329});var logger=require(_0xe0f8('0x4'))(_0xe0f8('0x5'));exports[_0xe0f8('0x6')]=function(_0x4a7cef){logger[_0xe0f8('0x6')](_0x4a7cef);};exports[_0xe0f8('0x7')]=function(_0x3b79e7){logger[_0xe0f8('0x7')](JSON['stringify'](_0x3b79e7));};exports[_0xe0f8('0x8')]=function(_0x163822){logger[_0xe0f8('0x8')](_0x163822[_0xe0f8('0x9')]);};exports['request']=function(_0xf755ed,_0x36ead0){return client['request'](_0xf755ed,{'body':_0x36ead0})['then'](function(_0x4dccb4){logger['debug'](JSON['stringify'](_0x4dccb4));})[_0xe0f8('0xa')](function(_0x158793){logger[_0xe0f8('0x8')](_0x158793[_0xe0f8('0x9')]);});};function getUser(_0x5a8cea){return client[_0xe0f8('0xb')](_0xe0f8('0xc'),{'options':{'raw':!![],'attributes':['id',_0xe0f8('0xd'),_0xe0f8('0xe'),_0xe0f8('0xf')],'where':_0x5a8cea,'limit':0x1}})[_0xe0f8('0x10')](function(_0xa8489f){logger[_0xe0f8('0x6')]('GETUSER|'+JSON['stringify'](_0x5a8cea)+'|'+(_0xa8489f[_0xe0f8('0x11')]['length']?_0xe0f8('0x12'):_0xe0f8('0x13')));return _0xa8489f[_0xe0f8('0x11')]['length']?_0xa8489f[_0xe0f8('0x11')][0x0]:null;});}exports[_0xe0f8('0x14')]=function(_0x4e7464){return new BPromise(function(_0x3b91f3,_0x24d7c8){if(_0x4e7464){return getUser({'internal':_0x4e7464})[_0xe0f8('0x10')](function(_0x25aff7){return _0x3b91f3(_0x25aff7);})[_0xe0f8('0xa')](function(_0x35bef0){logger[_0xe0f8('0x8')](_0x35bef0[_0xe0f8('0x9')]);return _0x3b91f3(null);});}else{return _0x3b91f3(null);}});};exports[_0xe0f8('0x15')]=function(_0x11f866){return new BPromise(function(_0x2d0a92,_0x356664){if(_0x11f866){return getUser({'interface':_0x11f866})['then'](function(_0x193619){return _0x2d0a92(_0x193619);})[_0xe0f8('0xa')](function(_0x2d0dd6){logger[_0xe0f8('0x8')](_0x2d0dd6[_0xe0f8('0x9')]);return _0x2d0a92(null);});}else{return _0x2d0a92(null);}});};exports[_0xe0f8('0x16')]=function(_0x438683){return new BPromise(function(_0x28aadc,_0x5eaa8c){if(_0x438683){return getUser({'name':_0x438683})[_0xe0f8('0x10')](function(_0x1b8f27){return _0x28aadc(_0x1b8f27);})[_0xe0f8('0xa')](function(_0x32a788){logger[_0xe0f8('0x8')](_0x32a788[_0xe0f8('0x9')]);return _0x28aadc(null);});}else{return _0x28aadc(null);}});};exports[_0xe0f8('0x17')]=function(_0x146622){return new BPromise(function(_0x536adc,_0x367764){if(_0x146622){return client[_0xe0f8('0xb')](_0xe0f8('0x18'),{'options':{'raw':!![],'attributes':['id',_0xe0f8('0xe'),_0xe0f8('0x19'),_0xe0f8('0x1a'),_0xe0f8('0x1b')],'where':{'name':_0x146622},'limit':0x1}})['then'](function(_0x41955a){logger[_0xe0f8('0x6')](_0xe0f8('0x1c')+_0x146622+'|'+(_0x41955a['result']['length']?_0xe0f8('0x12'):_0xe0f8('0x13')));return _0x536adc(_0x41955a[_0xe0f8('0x11')][_0xe0f8('0x1d')]?_0x41955a[_0xe0f8('0x11')][0x0]:null);})[_0xe0f8('0xa')](function(_0x3c76f0){logger[_0xe0f8('0x8')](_0x3c76f0['stack']);return _0x536adc(null);});}else{return _0x536adc(null);}});};exports[_0xe0f8('0x1e')]=function(_0x536351,_0x51190f){return moment(_0x536351)['add'](_0x51190f,_0xe0f8('0x1f'))[_0xe0f8('0x20')](_0xe0f8('0x21'));};exports[_0xe0f8('0x22')]=function(_0x322b25,_0xe6a656){return moment(_0x322b25)[_0xe0f8('0x23')](_0xe6a656,_0xe0f8('0x1f'))['format'](_0xe0f8('0x21'));};exports['diffTime']=function(_0x53541c,_0x2b06ac){return moment(_0x53541c)[_0xe0f8('0x24')](moment(_0x2b06ac),_0xe0f8('0x1f'));};exports['sumTime']=function(_0x481f0c,_0x2f6e89){return parseInt(_0x481f0c,0xa)+parseInt(_0x2f6e89,0xa);};exports[_0xe0f8('0x25')]=function(){return moment()['format'](_0xe0f8('0x21'));};exports[_0xe0f8('0x26')]=function(_0x58c943,_0x4e01e0){if(_0x4e01e0){return moment(_0x58c943)['isAfter'](_0x4e01e0);}else{return!![];}};exports[_0xe0f8('0x27')]=function(_0x5c671c,_0x757b1e){if(_0x757b1e){return moment(_0x5c671c)[_0xe0f8('0x27')](_0x757b1e);}else if(_0x5c671c){return!![];}else{return![];}}; \ No newline at end of file